From 7d64afa739078f2f1dfc287a934b78cf6a66f423 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 23 May 2023 13:53:39 +0200 Subject: [PATCH 0001/1777] LanguageClient: always rerequest completions Even if we receive a complete list the sorting of the items might change after expanding the completion prefix. Fixes: QTCREATORBUG-29178 Change-Id: I51762d0f4f26935f519e1c521ae65d781bb150b9 Reviewed-by: Christian Kandeler --- .../languageclientcompletionassist.cpp | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/plugins/languageclient/languageclientcompletionassist.cpp b/src/plugins/languageclient/languageclientcompletionassist.cpp index c5c86122fcd..5d68cb92e91 100644 --- a/src/plugins/languageclient/languageclientcompletionassist.cpp +++ b/src/plugins/languageclient/languageclientcompletionassist.cpp @@ -225,13 +225,6 @@ public: bool supportsPrefixExpansion() const override { return false; } QList items() const { return m_currentItems; } - - bool isComplete(const QString prefix) - { return m_completePrefix && prefix.startsWith(*m_completePrefix); } - void setCompletePrefix(const QString &completePrefix) { m_completePrefix = completePrefix; } - -private: - std::optional m_completePrefix; }; bool LanguageClientCompletionModel::isSortable(const QString &) const @@ -278,13 +271,6 @@ public: } } - bool isComplete(const AssistInterface *interface) - { - const QString prefix = interface->textAt(basePosition(), - interface->position() - basePosition()); - return static_cast(model().data())->isComplete(prefix); - } - void setProposal(IAssistProposal *proposal, const QString &prefix) { if (!proposal) @@ -301,7 +287,7 @@ public: void updateProposal(std::unique_ptr &&interface) override { deleteCurrentProcessor(); - if (!m_provider || isComplete(interface.get())) { + if (!m_provider) { GenericProposalWidget::updateProposal(std::move(interface)); return; } @@ -507,12 +493,9 @@ void LanguageClientCompletionAssistProcessor::handleCompletionResponse( m_pos - m_basePos); QList items; - bool isComplete = true; if (std::holds_alternative(*result)) { const auto &list = std::get(*result); items = list.items().value_or(QList()); - if (list.isIncomplete()) - isComplete = false; } else if (std::holds_alternative>(*result)) { items = std::get>(*result); } @@ -525,8 +508,6 @@ void LanguageClientCompletionAssistProcessor::handleCompletionResponse( } auto model = new LanguageClientCompletionModel(); model->loadContent(proposalItems); - if (isComplete) - model->setCompletePrefix(prefix); LanguageClientCompletionProposal *proposal = new LanguageClientCompletionProposal(m_provider, m_basePos, model); From 40e7a9826d0a9ab5d59122a45e7930f517f6149f Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 25 May 2023 13:40:12 +0200 Subject: [PATCH 0002/1777] Bump version to 12.0.0-beta1 Change-Id: I887dc5a098dcb76d5a6ea7e3ba55c46bc974c882 Reviewed-by: David Schulz --- cmake/QtCreatorIDEBranding.cmake | 6 +++--- qbs/modules/qtc/qtc.qbs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index 0d9e4b81860..171b65ded2b 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,6 +1,6 @@ -set(IDE_VERSION "10.0.82") # The IDE version. -set(IDE_VERSION_COMPAT "10.0.82") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "11.0.0-beta1") # The IDE display version. +set(IDE_VERSION "11.0.82") # The IDE version. +set(IDE_VERSION_COMPAT "11.0.82") # The IDE Compatibility version. +set(IDE_VERSION_DISPLAY "12.0.0-beta1") # The IDE display version. set(IDE_COPYRIGHT_YEAR "2023") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 226d432b181..58ad299d3e3 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -6,14 +6,14 @@ import qbs.Utilities Module { Depends { name: "cpp"; required: false } - property string qtcreator_display_version: '11.0.0-beta1' - property string ide_version_major: '10' + property string qtcreator_display_version: '12.0.0-beta1' + property string ide_version_major: '11' property string ide_version_minor: '0' property string ide_version_release: '82' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release - property string ide_compat_version_major: '10' + property string ide_compat_version_major: '11' property string ide_compat_version_minor: '0' property string ide_compat_version_release: '82' property string qtcreator_compat_version: ide_compat_version_major + '.' From a78720060eb71b6e647eb8864b40dc6c0db48a2b Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 22 May 2023 13:56:37 +0200 Subject: [PATCH 0003/1777] FindFlags: Move it into Utils lib It's going to be reused in filesearch.h API. Change-Id: I7ef133368536a647e19949ba8623134cf078a87d Reviewed-by: Qt CI Bot Reviewed-by: Eike Ziller --- src/libs/utils/filesearch.cpp | 12 +++++++ src/libs/utils/filesearch.h | 15 ++++++++ src/plugins/bineditor/bineditorplugin.cpp | 16 +++++---- src/plugins/coreplugin/find/basetextfind.cpp | 15 ++++---- src/plugins/coreplugin/find/basetextfind.h | 28 ++++++++------- .../coreplugin/find/currentdocumentfind.cpp | 7 ++-- .../coreplugin/find/currentdocumentfind.h | 18 +++++----- src/plugins/coreplugin/find/findplugin.cpp | 15 +------- src/plugins/coreplugin/find/findplugin.h | 8 +++-- src/plugins/coreplugin/find/findtoolbar.h | 8 ++--- src/plugins/coreplugin/find/ifindfilter.cpp | 10 +++--- src/plugins/coreplugin/find/ifindfilter.h | 12 ++++--- src/plugins/coreplugin/find/ifindsupport.cpp | 19 +++++----- src/plugins/coreplugin/find/ifindsupport.h | 24 ++++++------- src/plugins/coreplugin/find/itemviewfind.cpp | 4 ++- src/plugins/coreplugin/find/itemviewfind.h | 10 +++--- .../coreplugin/find/textfindconstants.h | 15 -------- src/plugins/coreplugin/icore.cpp | 2 +- src/plugins/cppeditor/cppindexingsupport.cpp | 6 ++-- src/plugins/cppeditor/cppindexingsupport.h | 2 +- src/plugins/cppeditor/symbolsfindfilter.h | 4 +-- src/plugins/help/helpfindsupport.cpp | 1 + src/plugins/help/helpfindsupport.h | 8 ++--- src/plugins/help/helpviewer.h | 4 ++- src/plugins/help/litehtmlhelpviewer.cpp | 4 +-- src/plugins/help/litehtmlhelpviewer.h | 2 +- src/plugins/help/macwebkithelpviewer.h | 2 +- src/plugins/help/macwebkithelpviewer.mm | 6 ++-- src/plugins/help/textbrowserhelpviewer.cpp | 6 ++-- src/plugins/help/textbrowserhelpviewer.h | 2 +- src/plugins/macros/findmacrohandler.cpp | 35 ++++++++++--------- src/plugins/macros/findmacrohandler.h | 11 +++--- src/plugins/macros/macrotextfind.cpp | 15 ++++---- src/plugins/macros/macrotextfind.h | 27 +++++++------- .../qmlprofiler/qmlprofilertraceview.cpp | 26 +++++++------- .../qmlprofiler/qmlprofilertraceview.h | 10 +++--- src/plugins/terminal/terminalsearch.cpp | 29 +++++++-------- src/plugins/terminal/terminalsearch.h | 12 +++---- src/plugins/texteditor/basefilefind.cpp | 2 +- src/plugins/texteditor/basefilefind.h | 8 ++--- src/plugins/texteditor/texteditor.cpp | 6 ++-- tests/auto/treeviewfind/tst_treeviewfind.cpp | 22 ++++++------ 42 files changed, 257 insertions(+), 231 deletions(-) diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index a72ddc6ab04..062d964509f 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -22,6 +22,18 @@ Q_LOGGING_CATEGORY(searchLog, "qtc.utils.filesearch", QtWarningMsg) using namespace Utils; +QTextDocument::FindFlags Utils::textDocumentFlagsForFindFlags(FindFlags flags) +{ + QTextDocument::FindFlags textDocFlags; + if (flags & FindBackward) + textDocFlags |= QTextDocument::FindBackward; + if (flags & FindCaseSensitively) + textDocFlags |= QTextDocument::FindCaseSensitively; + if (flags & FindWholeWords) + textDocFlags |= QTextDocument::FindWholeWords; + return textDocFlags; +} + static inline QString msgCanceled(const QString &searchTerm, int numMatches, int numFilesSearched) { return Tr::tr("%1: canceled. %n occurrences found in %2 files.", diff --git a/src/libs/utils/filesearch.h b/src/libs/utils/filesearch.h index fc6ce62ab0b..ae06e3d5a89 100644 --- a/src/libs/utils/filesearch.h +++ b/src/libs/utils/filesearch.h @@ -23,6 +23,18 @@ QT_END_NAMESPACE namespace Utils { +enum FindFlag { + FindBackward = 0x01, + FindCaseSensitively = 0x02, + FindWholeWords = 0x04, + FindRegularExpression = 0x08, + FindPreserveCase = 0x10 +}; +Q_DECLARE_FLAGS(FindFlags, FindFlag) + +QTCREATOR_UTILS_EXPORT +QTextDocument::FindFlags textDocumentFlagsForFindFlags(FindFlags flags); + QTCREATOR_UTILS_EXPORT std::function filterFilesFunction(const QStringList &filters, const QStringList &exclusionFilters); @@ -170,3 +182,6 @@ QTCREATOR_UTILS_EXPORT QString matchCaseReplacement(const QString &originalText, const QString &replaceText); } // namespace Utils + +Q_DECLARE_OPERATORS_FOR_FLAGS(Utils::FindFlags) +Q_DECLARE_METATYPE(Utils::FindFlags) diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index 0d66bc10ffc..00240c4e322 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -71,7 +71,8 @@ public: void highlightAll(const QString &txt, FindFlags findFlags) override { - m_widget->highlightSearchResults(txt.toLatin1(), textDocumentFlagsForFindFlags(findFlags)); + m_widget->highlightSearchResults(txt.toLatin1(), + Utils::textDocumentFlagsForFindFlags(findFlags)); } void clearHighlights() override @@ -88,10 +89,10 @@ public: return pos; } - int res = m_widget->find(pattern, pos, textDocumentFlagsForFindFlags(findFlags)); + int res = m_widget->find(pattern, pos, Utils::textDocumentFlagsForFindFlags(findFlags)); if (res < 0) { pos = (findFlags & FindBackward) ? -1 : 0; - res = m_widget->find(pattern, pos, textDocumentFlagsForFindFlags(findFlags)); + res = m_widget->find(pattern, pos, Utils::textDocumentFlagsForFindFlags(findFlags)); if (res < 0) return res; if (wrapped) @@ -119,7 +120,8 @@ public: Result result; if (found >= 0) { result = Found; - m_widget->highlightSearchResults(pattern, textDocumentFlagsForFindFlags(findFlags)); + m_widget->highlightSearchResults(pattern, + Utils::textDocumentFlagsForFindFlags(findFlags)); m_contPos = -1; } else { if (found == -2) { @@ -154,8 +156,10 @@ public: result = Found; m_incrementalStartPos = found; m_contPos = -1; - if (wasReset) - m_widget->highlightSearchResults(pattern, textDocumentFlagsForFindFlags(findFlags)); + if (wasReset) { + m_widget->highlightSearchResults(pattern, + Utils::textDocumentFlagsForFindFlags(findFlags)); + } } else if (found == -2) { result = NotYetFound; m_contPos += findFlags & FindBackward diff --git a/src/plugins/coreplugin/find/basetextfind.cpp b/src/plugins/coreplugin/find/basetextfind.cpp index 1a282fd4c80..eca378045ab 100644 --- a/src/plugins/coreplugin/find/basetextfind.cpp +++ b/src/plugins/coreplugin/find/basetextfind.cpp @@ -13,6 +13,8 @@ #include #include +using namespace Utils; + namespace Core { QRegularExpression BaseTextFind::regularExpression(const QString &txt, FindFlags flags) @@ -73,7 +75,7 @@ BaseTextFindPrivate::BaseTextFindPrivate(QPlainTextEdit *editor) */ /*! - \fn void Core::BaseTextFind::highlightAllRequested(const QString &txt, Core::FindFlags findFlags) + \fn void Core::BaseTextFind::highlightAllRequested(const QString &txt, Utils::FindFlags findFlags) This signal is emitted when the search results for \a txt using the given \a findFlags should be highlighted in the editor widget. @@ -329,7 +331,8 @@ int BaseTextFind::replaceAll(const QString &before, const QString &after, FindFl bool usesRegExp = (findFlags & FindRegularExpression); bool preserveCase = (findFlags & FindPreserveCase); QRegularExpression regexp = regularExpression(before, findFlags); - QTextCursor found = findOne(regexp, editCursor, textDocumentFlagsForFindFlags(findFlags)); + QTextCursor found = findOne(regexp, editCursor, + Utils::textDocumentFlagsForFindFlags(findFlags)); bool first = true; while (!found.isNull()) { if (found == editCursor && !first) { @@ -342,7 +345,7 @@ int BaseTextFind::replaceAll(const QString &before, const QString &after, FindFl newPosCursor.movePosition(findFlags & FindBackward ? QTextCursor::PreviousCharacter : QTextCursor::NextCharacter); - found = findOne(regexp, newPosCursor, textDocumentFlagsForFindFlags(findFlags)); + found = findOne(regexp, newPosCursor, Utils::textDocumentFlagsForFindFlags(findFlags)); continue; } if (first) @@ -360,7 +363,7 @@ int BaseTextFind::replaceAll(const QString &before, const QString &after, FindFl else realAfter = after; insertTextAfterSelection(realAfter, editCursor); - found = findOne(regexp, editCursor, textDocumentFlagsForFindFlags(findFlags)); + found = findOne(regexp, editCursor, Utils::textDocumentFlagsForFindFlags(findFlags)); } editCursor.endEditBlock(); return count; @@ -373,7 +376,7 @@ bool BaseTextFind::find(const QString &txt, FindFlags findFlags, QTextCursor sta return true; } QRegularExpression regexp = regularExpression(txt, findFlags); - QTextCursor found = findOne(regexp, start, textDocumentFlagsForFindFlags(findFlags)); + QTextCursor found = findOne(regexp, start, Utils::textDocumentFlagsForFindFlags(findFlags)); if (wrapped) *wrapped = false; @@ -382,7 +385,7 @@ bool BaseTextFind::find(const QString &txt, FindFlags findFlags, QTextCursor sta start.movePosition(QTextCursor::Start); else start.movePosition(QTextCursor::End); - found = findOne(regexp, start, textDocumentFlagsForFindFlags(findFlags)); + found = findOne(regexp, start, Utils::textDocumentFlagsForFindFlags(findFlags)); if (found.isNull()) return false; if (wrapped) diff --git a/src/plugins/coreplugin/find/basetextfind.h b/src/plugins/coreplugin/find/basetextfind.h index 75b63cb3234..97ebd072bf3 100644 --- a/src/plugins/coreplugin/find/basetextfind.h +++ b/src/plugins/coreplugin/find/basetextfind.h @@ -28,43 +28,47 @@ public: ~BaseTextFind() override; bool supportsReplace() const override; - FindFlags supportedFindFlags() const override; + Utils::FindFlags supportedFindFlags() const override; void resetIncrementalSearch() override; void clearHighlights() override; QString currentFindString() const override; QString completedFindString() const override; - Result findIncremental(const QString &txt, FindFlags findFlags) override; - Result findStep(const QString &txt, FindFlags findFlags) override; - void replace(const QString &before, const QString &after, FindFlags findFlags) override; - bool replaceStep(const QString &before, const QString &after, FindFlags findFlags) override; - int replaceAll(const QString &before, const QString &after, FindFlags findFlags) override; + Result findIncremental(const QString &txt, Utils::FindFlags findFlags) override; + Result findStep(const QString &txt, Utils::FindFlags findFlags) override; + void replace(const QString &before, const QString &after, Utils::FindFlags findFlags) override; + bool replaceStep(const QString &before, const QString &after, + Utils::FindFlags findFlags) override; + int replaceAll(const QString &before, const QString &after, + Utils::FindFlags findFlags) override; void defineFindScope() override; void clearFindScope() override; - void highlightAll(const QString &txt, FindFlags findFlags) override; + void highlightAll(const QString &txt, Utils::FindFlags findFlags) override; using CursorProvider = std::function; void setMultiTextCursorProvider(const CursorProvider &provider); bool inScope(const QTextCursor &candidate) const; - static QRegularExpression regularExpression(const QString &txt, FindFlags flags); + static QRegularExpression regularExpression(const QString &txt, Utils::FindFlags flags); signals: - void highlightAllRequested(const QString &txt, Core::FindFlags findFlags); + void highlightAllRequested(const QString &txt, Utils::FindFlags findFlags); void findScopeChanged(const Utils::MultiTextCursor &cursor); private: - bool find(const QString &txt, FindFlags findFlags, QTextCursor start, bool *wrapped); - QTextCursor replaceInternal(const QString &before, const QString &after, FindFlags findFlags); + bool find(const QString &txt, Utils::FindFlags findFlags, QTextCursor start, bool *wrapped); + QTextCursor replaceInternal(const QString &before, const QString &after, + Utils::FindFlags findFlags); Utils::MultiTextCursor multiTextCursor() const; QTextCursor textCursor() const; void setTextCursor(const QTextCursor&); QTextDocument *document() const; bool isReadOnly() const; - QTextCursor findOne(const QRegularExpression &expr, QTextCursor from, QTextDocument::FindFlags options) const; + QTextCursor findOne(const QRegularExpression &expr, QTextCursor from, + QTextDocument::FindFlags options) const; BaseTextFindPrivate *d; }; diff --git a/src/plugins/coreplugin/find/currentdocumentfind.cpp b/src/plugins/coreplugin/find/currentdocumentfind.cpp index 9a8c7864dbd..232c8904c0e 100644 --- a/src/plugins/coreplugin/find/currentdocumentfind.cpp +++ b/src/plugins/coreplugin/find/currentdocumentfind.cpp @@ -14,6 +14,8 @@ #include #include +using namespace Utils; + namespace Core::Internal { CurrentDocumentFind::CurrentDocumentFind() @@ -126,9 +128,8 @@ int CurrentDocumentFind::replaceAll(const QString &before, const QString &after, QTC_ASSERT(m_currentFind, return 0); QTC_CHECK(m_currentWidget); int count = m_currentFind->replaceAll(before, after, findFlags); - Utils::FadingIndicator::showText(m_currentWidget, - Tr::tr("%n occurrences replaced.", nullptr, count), - Utils::FadingIndicator::SmallText); + FadingIndicator::showText(m_currentWidget, Tr::tr("%n occurrences replaced.", nullptr, count), + FadingIndicator::SmallText); return count; } diff --git a/src/plugins/coreplugin/find/currentdocumentfind.h b/src/plugins/coreplugin/find/currentdocumentfind.h index ba0b92ea41c..31fbefa2baa 100644 --- a/src/plugins/coreplugin/find/currentdocumentfind.h +++ b/src/plugins/coreplugin/find/currentdocumentfind.h @@ -5,6 +5,8 @@ #include "ifindsupport.h" +#include + #include namespace Core { @@ -21,19 +23,19 @@ public: void clearHighlights(); bool supportsReplace() const; bool supportsSelectAll() const; - FindFlags supportedFindFlags() const; + Utils::FindFlags supportedFindFlags() const; QString currentFindString() const; QString completedFindString() const; bool isEnabled() const; IFindSupport *candidate() const; - void highlightAll(const QString &txt, FindFlags findFlags); - IFindSupport::Result findIncremental(const QString &txt, FindFlags findFlags); - IFindSupport::Result findStep(const QString &txt, FindFlags findFlags); - void selectAll(const QString &txt, FindFlags findFlags); - void replace(const QString &before, const QString &after, FindFlags findFlags); - bool replaceStep(const QString &before, const QString &after, FindFlags findFlags); - int replaceAll(const QString &before, const QString &after, FindFlags findFlags); + void highlightAll(const QString &txt, Utils::FindFlags findFlags); + IFindSupport::Result findIncremental(const QString &txt, Utils::FindFlags findFlags); + IFindSupport::Result findStep(const QString &txt, Utils::FindFlags findFlags); + void selectAll(const QString &txt, Utils::FindFlags findFlags); + void replace(const QString &before, const QString &after, Utils::FindFlags findFlags); + bool replaceStep(const QString &before, const QString &after, Utils::FindFlags findFlags); + int replaceAll(const QString &before, const QString &after, Utils::FindFlags findFlags); void defineFindScope(); void clearFindScope(); void acceptCandidate(); diff --git a/src/plugins/coreplugin/find/findplugin.cpp b/src/plugins/coreplugin/find/findplugin.cpp index 3be3c8209e2..69679798b79 100644 --- a/src/plugins/coreplugin/find/findplugin.cpp +++ b/src/plugins/coreplugin/find/findplugin.cpp @@ -156,7 +156,7 @@ class FindPrivate : public QObject public: bool isAnyFilterEnabled() const; void writeSettings(); - void setFindFlag(Core::FindFlag flag, bool enabled); + void setFindFlag(FindFlag flag, bool enabled); static void updateCompletion(const QString &text, QStringList &completions, QStringListModel *model); void setupMenu(); @@ -452,17 +452,4 @@ QStringListModel *Find::replaceCompletionModel() return &(d->m_replaceCompletionModel); } -// declared in textfindconstants.h -QTextDocument::FindFlags textDocumentFlagsForFindFlags(FindFlags flags) -{ - QTextDocument::FindFlags textDocFlags; - if (flags & FindBackward) - textDocFlags |= QTextDocument::FindBackward; - if (flags & FindCaseSensitively) - textDocFlags |= QTextDocument::FindCaseSensitively; - if (flags & FindWholeWords) - textDocFlags |= QTextDocument::FindWholeWords; - return textDocFlags; -} - } // namespace Core diff --git a/src/plugins/coreplugin/find/findplugin.h b/src/plugins/coreplugin/find/findplugin.h index 8ffb18be159..54a3c7234e3 100644 --- a/src/plugins/coreplugin/find/findplugin.h +++ b/src/plugins/coreplugin/find/findplugin.h @@ -5,6 +5,8 @@ #include "textfindconstants.h" +#include + #include QT_BEGIN_NAMESPACE @@ -30,9 +32,9 @@ public: enum { CompletionModelFindFlagsRole = Qt::UserRole + 1 }; - static FindFlags findFlags(); - static bool hasFindFlag(FindFlag flag); - static void updateFindCompletion(const QString &text, FindFlags flags = {}); + static Utils::FindFlags findFlags(); + static bool hasFindFlag(Utils::FindFlag flag); + static void updateFindCompletion(const QString &text, Utils::FindFlags flags = {}); static void updateReplaceCompletion(const QString &text); static QAbstractListModel *findCompletionModel(); static QStringListModel *replaceCompletionModel(); diff --git a/src/plugins/coreplugin/find/findtoolbar.h b/src/plugins/coreplugin/find/findtoolbar.h index f7295b2334c..baca57597ca 100644 --- a/src/plugins/coreplugin/find/findtoolbar.h +++ b/src/plugins/coreplugin/find/findtoolbar.h @@ -111,9 +111,9 @@ private: void installEventFilters(); void invokeClearResults(); - void setFindFlag(FindFlag flag, bool enabled); - bool hasFindFlag(FindFlag flag); - FindFlags effectiveFindFlags(); + void setFindFlag(Utils::FindFlag flag, bool enabled); + bool hasFindFlag(Utils::FindFlag flag); + Utils::FindFlags effectiveFindFlags(); static FindToolBarPlaceHolder *findToolBarPlaceHolder(); bool toolBarHasFocus() const; ControlStyle controlStyle(bool replaceIsVisible); @@ -174,7 +174,7 @@ private: QToolButton *m_replaceNextButton; QToolButton *m_replaceAllButton; QToolButton *m_advancedButton; - FindFlags m_findFlags; + Utils::FindFlags m_findFlags; QTimer m_findIncrementalTimer; QTimer m_findStepTimer; diff --git a/src/plugins/coreplugin/find/ifindfilter.cpp b/src/plugins/coreplugin/find/ifindfilter.cpp index 85b8a68be80..935febec136 100644 --- a/src/plugins/coreplugin/find/ifindfilter.cpp +++ b/src/plugins/coreplugin/find/ifindfilter.cpp @@ -11,6 +11,8 @@ #include #include +using namespace Utils; + /*! \class Core::IFindFilter \inheaderfile coreplugin/find/ifindfilter.h @@ -130,7 +132,7 @@ */ /*! - \fn void Core::IFindFilter::findAll(const QString &txt, Core::FindFlags findFlags) + \fn void Core::IFindFilter::findAll(const QString &txt, Utils::FindFlags findFlags) This function is called when the user selected this find scope and initiated a search. @@ -147,7 +149,7 @@ */ /*! - \fn void Core::IFindFilter::replaceAll(const QString &txt, Core::FindFlags findFlags) + \fn void Core::IFindFilter::replaceAll(const QString &txt, Utils::FindFlags findFlags) Override this function if you want to support search and replace. This function is called when the user selected this find scope and @@ -252,8 +254,8 @@ QKeySequence IFindFilter::defaultShortcut() const Depending on the returned value, the default find option widgets are enabled or disabled. - The default is Core::FindCaseSensitively, Core::FindRegularExpression - and Core::FindWholeWords. + The default is Utils::FindCaseSensitively, Utils::FindRegularExpression + and Uitls::FindWholeWords. */ FindFlags IFindFilter::supportedFindFlags() const { diff --git a/src/plugins/coreplugin/find/ifindfilter.h b/src/plugins/coreplugin/find/ifindfilter.h index 6ebe76ba22a..b8df36e536e 100644 --- a/src/plugins/coreplugin/find/ifindfilter.h +++ b/src/plugins/coreplugin/find/ifindfilter.h @@ -5,6 +5,8 @@ #include "textfindconstants.h" +#include + QT_BEGIN_NAMESPACE class QWidget; class QSettings; @@ -32,18 +34,18 @@ public: virtual QKeySequence defaultShortcut() const; virtual bool isReplaceSupported() const { return false; } virtual bool showSearchTermInput() const { return true; } - virtual FindFlags supportedFindFlags() const; + virtual Utils::FindFlags supportedFindFlags() const; - virtual void findAll(const QString &txt, FindFlags findFlags) = 0; - virtual void replaceAll(const QString &txt, FindFlags findFlags) + virtual void findAll(const QString &txt, Utils::FindFlags findFlags) = 0; + virtual void replaceAll(const QString &txt, Utils::FindFlags findFlags) { Q_UNUSED(txt) Q_UNUSED(findFlags) } virtual QWidget *createConfigWidget() { return nullptr; } virtual void writeSettings(QSettings *settings) { Q_UNUSED(settings) } virtual void readSettings(QSettings *settings) { Q_UNUSED(settings) } - static QPixmap pixmapForFindFlags(FindFlags flags); - static QString descriptionForFindFlags(FindFlags flags); + static QPixmap pixmapForFindFlags(Utils::FindFlags flags); + static QString descriptionForFindFlags(Utils::FindFlags flags); signals: void enabledChanged(bool enabled); void validChanged(bool valid); diff --git a/src/plugins/coreplugin/find/ifindsupport.cpp b/src/plugins/coreplugin/find/ifindsupport.cpp index 54d8c0128ab..694ded20b3c 100644 --- a/src/plugins/coreplugin/find/ifindsupport.cpp +++ b/src/plugins/coreplugin/find/ifindsupport.cpp @@ -7,6 +7,7 @@ #include using namespace Core; +using namespace Utils; /*! \class Core::IFindSupport @@ -54,16 +55,16 @@ bool IFindSupport::supportsSelectAll() const } /*! - \fn Core::FindFlags Core::IFindSupport::supportedFindFlags() const + \fn Utils::FindFlags Core::IFindSupport::supportedFindFlags() const Returns the find flags, such as whole words or regular expressions, that this find filter supports. Depending on the returned value, the default find option widgets are enabled or disabled. - The default is Core::FindBackward, Core::FindCaseSensitively, - Core::FindRegularExpression, Core::FindWholeWords, and - Core::FindPreserveCase. + The default is Uitls::FindBackward, Utils::FindCaseSensitively, + Uitls::FindRegularExpression, Uitls::FindWholeWords, and + Uitls::FindPreserveCase. */ /*! @@ -87,17 +88,17 @@ bool IFindSupport::supportsSelectAll() const */ /*! - \fn void Core::IFindSupport::highlightAll(const QString &txt, Core::FindFlags findFlags) + \fn void Core::IFindSupport::highlightAll(const QString &txt, Utils::FindFlags findFlags) Highlights all search hits for \a txt when using \a findFlags. */ /*! - \fn Core::IFindSupport::Result Core::IFindSupport::findIncremental(const QString &txt, Core::FindFlags findFlags) + \fn Core::IFindSupport::Result Core::IFindSupport::findIncremental(const QString &txt, Utils::FindFlags findFlags) Performs an incremental search of the search term \a txt using \a findFlags. */ /*! - \fn Core::IFindSupport::Result Core::IFindSupport::findStep(const QString &txt, Core::FindFlags findFlags) + \fn Core::IFindSupport::Result Core::IFindSupport::findStep(const QString &txt, Utils::FindFlags findFlags) Searches for \a txt using \a findFlags. */ @@ -166,6 +167,6 @@ void IFindSupport::selectAll(const QString &txt, FindFlags findFlags) */ void IFindSupport::showWrapIndicator(QWidget *parent) { - Utils::FadingIndicator::showPixmap(parent, Utils::StyleHelper::dpiSpecificImageFile( - QLatin1String(":/find/images/wrapindicator.png"))); + FadingIndicator::showPixmap(parent, StyleHelper::dpiSpecificImageFile( + ":/find/images/wrapindicator.png")); } diff --git a/src/plugins/coreplugin/find/ifindsupport.h b/src/plugins/coreplugin/find/ifindsupport.h index 123cf59da94..c9509b79f3a 100644 --- a/src/plugins/coreplugin/find/ifindsupport.h +++ b/src/plugins/coreplugin/find/ifindsupport.h @@ -5,6 +5,8 @@ #include "textfindconstants.h" +#include + #include #include @@ -22,25 +24,23 @@ public: virtual bool supportsReplace() const = 0; virtual bool supportsSelectAll() const; - virtual FindFlags supportedFindFlags() const = 0; + virtual Utils::FindFlags supportedFindFlags() const = 0; virtual void resetIncrementalSearch() = 0; virtual void clearHighlights() = 0; virtual QString currentFindString() const = 0; virtual QString completedFindString() const = 0; - virtual void highlightAll(const QString &, FindFlags) {} - virtual Result findIncremental(const QString &txt, FindFlags findFlags) = 0; - virtual Result findStep(const QString &txt, FindFlags findFlags) = 0; - virtual void replace(const QString &before, const QString &after, - FindFlags findFlags); + virtual void highlightAll(const QString &, Utils::FindFlags) {} + virtual Result findIncremental(const QString &txt, Utils::FindFlags findFlags) = 0; + virtual Result findStep(const QString &txt, Utils::FindFlags findFlags) = 0; + virtual void replace(const QString &before, const QString &after, Utils::FindFlags findFlags); virtual bool replaceStep(const QString &before, const QString &after, - FindFlags findFlags); - virtual int replaceAll(const QString &before, const QString &after, - FindFlags findFlags); - virtual void selectAll(const QString &txt, FindFlags findFlags); + Utils::FindFlags findFlags); + virtual int replaceAll(const QString &before, const QString &after, Utils::FindFlags findFlags); + virtual void selectAll(const QString &txt, Utils::FindFlags findFlags); - virtual void defineFindScope(){} - virtual void clearFindScope(){} + virtual void defineFindScope() {} + virtual void clearFindScope() {} static void showWrapIndicator(QWidget *parent); diff --git a/src/plugins/coreplugin/find/itemviewfind.cpp b/src/plugins/coreplugin/find/itemviewfind.cpp index 8bba18ae692..9cb9125b1ef 100644 --- a/src/plugins/coreplugin/find/itemviewfind.cpp +++ b/src/plugins/coreplugin/find/itemviewfind.cpp @@ -11,6 +11,8 @@ #include #include +using namespace Utils; + namespace Core { /*! @@ -163,7 +165,7 @@ IFindSupport::Result ItemViewFind::find(const QString &searchTxt, QModelIndex currentIndex = d->m_view->currentIndex(); if (!currentIndex.isValid()) // nothing selected, start from top currentIndex = d->m_view->model()->index(0, 0); - QTextDocument::FindFlags flags = textDocumentFlagsForFindFlags(findFlags); + QTextDocument::FindFlags flags = Utils::textDocumentFlagsForFindFlags(findFlags); QModelIndex resultIndex; QModelIndex index = currentIndex; int currentRow = currentIndex.row(); diff --git a/src/plugins/coreplugin/find/itemviewfind.h b/src/plugins/coreplugin/find/itemviewfind.h index 3637a6f5b31..9447c20a7a5 100644 --- a/src/plugins/coreplugin/find/itemviewfind.h +++ b/src/plugins/coreplugin/find/itemviewfind.h @@ -33,22 +33,22 @@ public: ~ItemViewFind() override; bool supportsReplace() const override; - FindFlags supportedFindFlags() const override; + Utils::FindFlags supportedFindFlags() const override; void resetIncrementalSearch() override; void clearHighlights() override; QString currentFindString() const override; QString completedFindString() const override; - void highlightAll(const QString &txt, FindFlags findFlags) override; - Result findIncremental(const QString &txt, FindFlags findFlags) override; - Result findStep(const QString &txt, FindFlags findFlags) override; + void highlightAll(const QString &txt, Utils::FindFlags findFlags) override; + Result findIncremental(const QString &txt, Utils::FindFlags findFlags) override; + Result findStep(const QString &txt, Utils::FindFlags findFlags) override; static QFrame *createSearchableWrapper(QAbstractItemView *treeView, ColorOption colorOption = DarkColored, FetchOption option = DoNotFetchMoreWhileSearching); static QFrame *createSearchableWrapper(ItemViewFind *finder, ColorOption colorOption = DarkColored); private: - Result find(const QString &txt, FindFlags findFlags, + Result find(const QString &txt, Utils::FindFlags findFlags, bool startFromCurrentIndex, bool *wrapped); QModelIndex nextIndex(const QModelIndex &idx, bool *wrapped) const; QModelIndex prevIndex(const QModelIndex &idx, bool *wrapped) const; diff --git a/src/plugins/coreplugin/find/textfindconstants.h b/src/plugins/coreplugin/find/textfindconstants.h index 067bf5fc7f1..83e9888dfca 100644 --- a/src/plugins/coreplugin/find/textfindconstants.h +++ b/src/plugins/coreplugin/find/textfindconstants.h @@ -40,19 +40,4 @@ const char TASK_SEARCH[] = "Find.Task.Search"; } // namespace Constants -enum FindFlag { - FindBackward = 0x01, - FindCaseSensitively = 0x02, - FindWholeWords = 0x04, - FindRegularExpression = 0x08, - FindPreserveCase = 0x10 -}; -Q_DECLARE_FLAGS(FindFlags, FindFlag) - -// defined in findplugin.cpp -QTextDocument::FindFlags CORE_EXPORT textDocumentFlagsForFindFlags(FindFlags flags); - } // namespace Core - -Q_DECLARE_OPERATORS_FOR_FLAGS(Core::FindFlags) -Q_DECLARE_METATYPE(Core::FindFlags) diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index fc6ec2bf925..59224d48a5c 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -30,7 +30,7 @@ */ /*! - \enum Core::FindFlag + \enum Utils::FindFlag This enum holds the find flags. \value FindBackward diff --git a/src/plugins/cppeditor/cppindexingsupport.cpp b/src/plugins/cppeditor/cppindexingsupport.cpp index 22ff93cdaa0..6aafb6043d7 100644 --- a/src/plugins/cppeditor/cppindexingsupport.cpp +++ b/src/plugins/cppeditor/cppindexingsupport.cpp @@ -251,11 +251,11 @@ void SymbolSearcher::runSearch(QPromise &promise) search.setSymbolsToSearchFor(m_parameters.types); CPlusPlus::Snapshot::const_iterator it = m_snapshot.begin(); - QString findString = (m_parameters.flags & Core::FindRegularExpression + QString findString = (m_parameters.flags & FindRegularExpression ? m_parameters.text : QRegularExpression::escape(m_parameters.text)); - if (m_parameters.flags & Core::FindWholeWords) + if (m_parameters.flags & FindWholeWords) findString = QString::fromLatin1("\\b%1\\b").arg(findString); - QRegularExpression matcher(findString, (m_parameters.flags & Core::FindCaseSensitively + QRegularExpression matcher(findString, (m_parameters.flags & FindCaseSensitively ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption)); matcher.optimize(); diff --git a/src/plugins/cppeditor/cppindexingsupport.h b/src/plugins/cppeditor/cppindexingsupport.h index b5aa68585d6..9995ca631cd 100644 --- a/src/plugins/cppeditor/cppindexingsupport.h +++ b/src/plugins/cppeditor/cppindexingsupport.h @@ -38,7 +38,7 @@ public: struct Parameters { QString text; - Core::FindFlags flags; + Utils::FindFlags flags; SymbolTypes types; SearchScope scope; }; diff --git a/src/plugins/cppeditor/symbolsfindfilter.h b/src/plugins/cppeditor/symbolsfindfilter.h index a77f5873606..db7d4d323ab 100644 --- a/src/plugins/cppeditor/symbolsfindfilter.h +++ b/src/plugins/cppeditor/symbolsfindfilter.h @@ -36,7 +36,7 @@ public: QString displayName() const override; bool isEnabled() const override; - void findAll(const QString &txt, Core::FindFlags findFlags) override; + void findAll(const QString &txt, Utils::FindFlags findFlags) override; QWidget *createConfigWidget() override; void writeSettings(QSettings *settings) override; @@ -62,7 +62,7 @@ private: void onAllTasksFinished(Utils::Id type); QString label() const; - QString toolTip(Core::FindFlags findFlags) const; + QString toolTip(Utils::FindFlags findFlags) const; void startSearch(Core::SearchResult *search); CppModelManager *m_manager; diff --git a/src/plugins/help/helpfindsupport.cpp b/src/plugins/help/helpfindsupport.cpp index cc2c1b1381f..799fb4c5e87 100644 --- a/src/plugins/help/helpfindsupport.cpp +++ b/src/plugins/help/helpfindsupport.cpp @@ -8,6 +8,7 @@ using namespace Core; using namespace Help::Internal; +using namespace Utils; HelpViewerFindSupport::HelpViewerFindSupport(HelpViewer *viewer) : m_viewer(viewer) diff --git a/src/plugins/help/helpfindsupport.h b/src/plugins/help/helpfindsupport.h index cdb0aa10a37..8a334083bde 100644 --- a/src/plugins/help/helpfindsupport.h +++ b/src/plugins/help/helpfindsupport.h @@ -17,17 +17,17 @@ public: HelpViewerFindSupport(HelpViewer *viewer); bool supportsReplace() const override { return false; } - Core::FindFlags supportedFindFlags() const override; + Utils::FindFlags supportedFindFlags() const override; void resetIncrementalSearch() override {} void clearHighlights() override {} QString currentFindString() const override; QString completedFindString() const override { return QString(); } - Result findIncremental(const QString &txt, Core::FindFlags findFlags) override; - Result findStep(const QString &txt, Core::FindFlags findFlags) override; + Result findIncremental(const QString &txt, Utils::FindFlags findFlags) override; + Result findStep(const QString &txt, Utils::FindFlags findFlags) override; private: - bool find(const QString &ttf, Core::FindFlags findFlags, bool incremental); + bool find(const QString &ttf, Utils::FindFlags findFlags, bool incremental); HelpViewer *m_viewer; }; diff --git a/src/plugins/help/helpviewer.h b/src/plugins/help/helpviewer.h index 5368c09a84d..c05685794d6 100644 --- a/src/plugins/help/helpviewer.h +++ b/src/plugins/help/helpviewer.h @@ -5,6 +5,8 @@ #include +#include + #include #include #include @@ -52,7 +54,7 @@ public: void setActionVisible(Action action, bool visible); bool isActionVisible(Action action); - virtual bool findText(const QString &text, Core::FindFlags flags, + virtual bool findText(const QString &text, Utils::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped = nullptr) = 0; bool handleForwardBackwardMouseButtons(QMouseEvent *e); diff --git a/src/plugins/help/litehtmlhelpviewer.cpp b/src/plugins/help/litehtmlhelpviewer.cpp index e965ae60ca6..59df62ba666 100644 --- a/src/plugins/help/litehtmlhelpviewer.cpp +++ b/src/plugins/help/litehtmlhelpviewer.cpp @@ -209,11 +209,11 @@ void LiteHtmlHelpViewer::addForwardHistoryItems(QMenu *forwardMenu) } bool LiteHtmlHelpViewer::findText( - const QString &text, Core::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped) + const QString &text, Utils::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped) { Q_UNUSED(fromSearch) return m_viewer->findText(text, - Core::textDocumentFlagsForFindFlags(flags), + Utils::textDocumentFlagsForFindFlags(flags), incremental, wrapped); } diff --git a/src/plugins/help/litehtmlhelpviewer.h b/src/plugins/help/litehtmlhelpviewer.h index be2182a8880..82f5d89e483 100644 --- a/src/plugins/help/litehtmlhelpviewer.h +++ b/src/plugins/help/litehtmlhelpviewer.h @@ -40,7 +40,7 @@ public: void addBackHistoryItems(QMenu *backMenu) override; void addForwardHistoryItems(QMenu *forwardMenu) override; - bool findText(const QString &text, Core::FindFlags flags, + bool findText(const QString &text, Utils::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped = nullptr) override; void copy() override; diff --git a/src/plugins/help/macwebkithelpviewer.h b/src/plugins/help/macwebkithelpviewer.h index 31bd3bd716e..2eb1ff2c048 100644 --- a/src/plugins/help/macwebkithelpviewer.h +++ b/src/plugins/help/macwebkithelpviewer.h @@ -65,7 +65,7 @@ public: void addForwardHistoryItems(QMenu *forwardMenu) override; void setActionVisible(bool visible); - bool findText(const QString &text, Core::FindFlags flags, + bool findText(const QString &text, Utils::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped = nullptr) override; MacWebKitHelpWidget *widget() const { return m_widget; } diff --git a/src/plugins/help/macwebkithelpviewer.mm b/src/plugins/help/macwebkithelpviewer.mm index d5781103158..68cfa56debf 100644 --- a/src/plugins/help/macwebkithelpviewer.mm +++ b/src/plugins/help/macwebkithelpviewer.mm @@ -700,7 +700,7 @@ DOMRange *MacWebKitHelpViewer::findText(NSString *text, bool forward, bool caseS return nil; } -bool MacWebKitHelpViewer::findText(const QString &text, Core::FindFlags flags, bool incremental, +bool MacWebKitHelpViewer::findText(const QString &text, FindFlags flags, bool incremental, bool fromSearch, bool *wrapped) { Q_UNUSED(incremental); @@ -708,8 +708,8 @@ bool MacWebKitHelpViewer::findText(const QString &text, Core::FindFlags flags, b @autoreleasepool { if (wrapped) *wrapped = false; - bool forward = !(flags & Core::FindBackward); - bool caseSensitive = (flags & Core::FindCaseSensitively); + bool forward = !(flags & FindBackward); + bool caseSensitive = (flags & FindCaseSensitively); WebView *webView = m_widget->webView(); // WebView searchFor:.... grabs first responder, and when losing first responder afterwards, diff --git a/src/plugins/help/textbrowserhelpviewer.cpp b/src/plugins/help/textbrowserhelpviewer.cpp index 3f32fe29a47..d2b37dd87d2 100644 --- a/src/plugins/help/textbrowserhelpviewer.cpp +++ b/src/plugins/help/textbrowserhelpviewer.cpp @@ -143,7 +143,7 @@ void TextBrowserHelpViewer::addForwardHistoryItems(QMenu *forwardMenu) } } -bool TextBrowserHelpViewer::findText(const QString &text, Core::FindFlags flags, +bool TextBrowserHelpViewer::findText(const QString &text, Utils::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped) { if (wrapped) @@ -157,10 +157,10 @@ bool TextBrowserHelpViewer::findText(const QString &text, Core::FindFlags flags, if (incremental) cursor.setPosition(position); - QTextDocument::FindFlags f = Core::textDocumentFlagsForFindFlags(flags); + QTextDocument::FindFlags f = Utils::textDocumentFlagsForFindFlags(flags); QTextCursor found = doc->find(text, cursor, f); if (found.isNull()) { - if ((flags & Core::FindBackward) == 0) + if ((flags & Utils::FindBackward) == 0) cursor.movePosition(QTextCursor::Start); else cursor.movePosition(QTextCursor::End); diff --git a/src/plugins/help/textbrowserhelpviewer.h b/src/plugins/help/textbrowserhelpviewer.h index 56fc20ff6c1..59994539274 100644 --- a/src/plugins/help/textbrowserhelpviewer.h +++ b/src/plugins/help/textbrowserhelpviewer.h @@ -38,7 +38,7 @@ public: void addBackHistoryItems(QMenu *backMenu) override; void addForwardHistoryItems(QMenu *forwardMenu) override; - bool findText(const QString &text, Core::FindFlags flags, + bool findText(const QString &text, Utils::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped = nullptr) override; void copy() override; diff --git a/src/plugins/macros/findmacrohandler.cpp b/src/plugins/macros/findmacrohandler.cpp index ba853adc1a5..878854e7b17 100644 --- a/src/plugins/macros/findmacrohandler.cpp +++ b/src/plugins/macros/findmacrohandler.cpp @@ -15,6 +15,7 @@ using namespace Macros; using namespace Macros::Internal; +using namespace Utils; static const char EVENTNAME[] = "Find"; static const quint8 TYPE = 0; @@ -59,26 +60,26 @@ bool FindMacroHandler::executeEvent(const MacroEvent ¯oEvent) switch (macroEvent.value(TYPE).toInt()) { case FINDINCREMENTAL: currentFind->findIncremental(macroEvent.value(BEFORE).toString(), - (Core::FindFlags)macroEvent.value(FLAGS).toInt()); + FindFlags(macroEvent.value(FLAGS).toInt())); break; case FINDSTEP: currentFind->findStep(macroEvent.value(BEFORE).toString(), - (Core::FindFlags)macroEvent.value(FLAGS).toInt()); + FindFlags(macroEvent.value(FLAGS).toInt())); break; case REPLACE: currentFind->replace(macroEvent.value(BEFORE).toString(), macroEvent.value(AFTER).toString(), - (Core::FindFlags)macroEvent.value(FLAGS).toInt()); + FindFlags(macroEvent.value(FLAGS).toInt())); break; case REPLACESTEP: currentFind->replaceStep(macroEvent.value(BEFORE).toString(), - macroEvent.value(AFTER).toString(), - (Core::FindFlags)macroEvent.value(FLAGS).toInt()); + macroEvent.value(AFTER).toString(), + FindFlags(macroEvent.value(FLAGS).toInt())); break; case REPLACEALL: currentFind->replaceAll(macroEvent.value(BEFORE).toString(), - macroEvent.value(AFTER).toString(), - (Core::FindFlags)macroEvent.value(FLAGS).toInt()); + macroEvent.value(AFTER).toString(), + FindFlags(macroEvent.value(FLAGS).toInt())); break; case RESET: currentFind->resetIncrementalSearch(); @@ -87,31 +88,31 @@ bool FindMacroHandler::executeEvent(const MacroEvent ¯oEvent) return true; } -void FindMacroHandler::findIncremental(const QString &txt, Core::FindFlags findFlags) +void FindMacroHandler::findIncremental(const QString &txt, FindFlags findFlags) { if (!isRecording()) return; MacroEvent e; e.setId(EVENTNAME); e.setValue(BEFORE, txt); - e.setValue(FLAGS, (int)findFlags); + e.setValue(FLAGS, int(findFlags)); e.setValue(TYPE, FINDINCREMENTAL); addMacroEvent(e); } -void FindMacroHandler::findStep(const QString &txt, Core::FindFlags findFlags) +void FindMacroHandler::findStep(const QString &txt, FindFlags findFlags) { if (!isRecording()) return; MacroEvent e; e.setId(EVENTNAME); e.setValue(BEFORE, txt); - e.setValue(FLAGS, (int)findFlags); + e.setValue(FLAGS, int(findFlags)); e.setValue(TYPE, FINDSTEP); addMacroEvent(e); } -void FindMacroHandler::replace(const QString &before, const QString &after, Core::FindFlags findFlags) +void FindMacroHandler::replace(const QString &before, const QString &after, FindFlags findFlags) { if (!isRecording()) return; @@ -119,12 +120,12 @@ void FindMacroHandler::replace(const QString &before, const QString &after, Core e.setId(EVENTNAME); e.setValue(BEFORE, before); e.setValue(AFTER, after); - e.setValue(FLAGS, (int)findFlags); + e.setValue(FLAGS, int(findFlags)); e.setValue(TYPE, REPLACE); addMacroEvent(e); } -void FindMacroHandler::replaceStep(const QString &before, const QString &after, Core::FindFlags findFlags) +void FindMacroHandler::replaceStep(const QString &before, const QString &after, FindFlags findFlags) { if (!isRecording()) return; @@ -132,12 +133,12 @@ void FindMacroHandler::replaceStep(const QString &before, const QString &after, e.setId(EVENTNAME); e.setValue(BEFORE, before); e.setValue(AFTER, after); - e.setValue(FLAGS, (int)findFlags); + e.setValue(FLAGS, int(findFlags)); e.setValue(TYPE, REPLACESTEP); addMacroEvent(e); } -void FindMacroHandler::replaceAll(const QString &before, const QString &after, Core::FindFlags findFlags) +void FindMacroHandler::replaceAll(const QString &before, const QString &after, FindFlags findFlags) { if (!isRecording()) return; @@ -145,7 +146,7 @@ void FindMacroHandler::replaceAll(const QString &before, const QString &after, C e.setId(EVENTNAME); e.setValue(BEFORE, before); e.setValue(AFTER, after); - e.setValue(FLAGS, (int)findFlags); + e.setValue(FLAGS, int(findFlags)); e.setValue(TYPE, REPLACEALL); addMacroEvent(e); } diff --git a/src/plugins/macros/findmacrohandler.h b/src/plugins/macros/findmacrohandler.h index 4c876e33cb4..ef157051c75 100644 --- a/src/plugins/macros/findmacrohandler.h +++ b/src/plugins/macros/findmacrohandler.h @@ -6,6 +6,7 @@ #include "imacrohandler.h" #include +#include namespace Core { class IEditor; } @@ -24,11 +25,11 @@ public: bool canExecuteEvent(const MacroEvent ¯oEvent) override; bool executeEvent(const MacroEvent ¯oEvent) override; - void findIncremental(const QString &txt, Core::FindFlags findFlags); - void findStep(const QString &txt, Core::FindFlags findFlags); - void replace(const QString &before, const QString &after, Core::FindFlags findFlags); - void replaceStep(const QString &before, const QString &after, Core::FindFlags findFlags); - void replaceAll(const QString &before, const QString &after, Core::FindFlags findFlags); + void findIncremental(const QString &txt, Utils::FindFlags findFlags); + void findStep(const QString &txt, Utils::FindFlags findFlags); + void replace(const QString &before, const QString &after, Utils::FindFlags findFlags); + void replaceStep(const QString &before, const QString &after, Utils::FindFlags findFlags); + void replaceAll(const QString &before, const QString &after, Utils::FindFlags findFlags); void resetIncrementalSearch(); private: diff --git a/src/plugins/macros/macrotextfind.cpp b/src/plugins/macros/macrotextfind.cpp index 4dca44ee9b6..0f949426a03 100644 --- a/src/plugins/macros/macrotextfind.cpp +++ b/src/plugins/macros/macrotextfind.cpp @@ -7,6 +7,7 @@ using namespace Macros; using namespace Macros::Internal; +using namespace Utils; MacroTextFind::MacroTextFind(Core::IFindSupport *currentFind): Core::IFindSupport(), @@ -20,7 +21,7 @@ bool MacroTextFind::supportsReplace() const return m_currentFind->supportsReplace(); } -Core::FindFlags MacroTextFind::supportedFindFlags() const +FindFlags MacroTextFind::supportedFindFlags() const { QTC_ASSERT(m_currentFind, return {}); return m_currentFind->supportedFindFlags(); @@ -51,13 +52,13 @@ QString MacroTextFind::completedFindString() const return m_currentFind->completedFindString(); } -void MacroTextFind::highlightAll(const QString &txt, Core::FindFlags findFlags) +void MacroTextFind::highlightAll(const QString &txt, FindFlags findFlags) { QTC_ASSERT(m_currentFind, return); m_currentFind->highlightAll(txt, findFlags); } -Core::IFindSupport::Result MacroTextFind::findIncremental(const QString &txt, Core::FindFlags findFlags) +Core::IFindSupport::Result MacroTextFind::findIncremental(const QString &txt, FindFlags findFlags) { QTC_ASSERT(m_currentFind, return IFindSupport::NotFound); Core::IFindSupport::Result result = m_currentFind->findIncremental(txt, findFlags); @@ -66,7 +67,7 @@ Core::IFindSupport::Result MacroTextFind::findIncremental(const QString &txt, Co return result; } -Core::IFindSupport::Result MacroTextFind::findStep(const QString &txt, Core::FindFlags findFlags) +Core::IFindSupport::Result MacroTextFind::findStep(const QString &txt, FindFlags findFlags) { QTC_ASSERT(m_currentFind, return IFindSupport::NotFound); Core::IFindSupport::Result result = m_currentFind->findStep(txt, findFlags); @@ -75,14 +76,14 @@ Core::IFindSupport::Result MacroTextFind::findStep(const QString &txt, Core::Fin return result; } -void MacroTextFind::replace(const QString &before, const QString &after, Core::FindFlags findFlags) +void MacroTextFind::replace(const QString &before, const QString &after, FindFlags findFlags) { QTC_ASSERT(m_currentFind, return); m_currentFind->replace(before, after, findFlags); emit replaced(before, after, findFlags); } -bool MacroTextFind::replaceStep(const QString &before, const QString &after, Core::FindFlags findFlags) +bool MacroTextFind::replaceStep(const QString &before, const QString &after, FindFlags findFlags) { QTC_ASSERT(m_currentFind, return false); bool result = m_currentFind->replaceStep(before, after, findFlags); @@ -90,7 +91,7 @@ bool MacroTextFind::replaceStep(const QString &before, const QString &after, Cor return result; } -int MacroTextFind::replaceAll(const QString &before, const QString &after, Core::FindFlags findFlags) +int MacroTextFind::replaceAll(const QString &before, const QString &after, FindFlags findFlags) { QTC_ASSERT(m_currentFind, return 0); int result = m_currentFind->replaceAll(before, after, findFlags); diff --git a/src/plugins/macros/macrotextfind.h b/src/plugins/macros/macrotextfind.h index b5270662f50..e59b8086c05 100644 --- a/src/plugins/macros/macrotextfind.h +++ b/src/plugins/macros/macrotextfind.h @@ -18,32 +18,29 @@ public: MacroTextFind(Core::IFindSupport *currentFind); bool supportsReplace() const override; - Core::FindFlags supportedFindFlags() const override; + Utils::FindFlags supportedFindFlags() const override; void resetIncrementalSearch() override; void clearHighlights() override; QString currentFindString() const override; QString completedFindString() const override; - void highlightAll(const QString &txt, Core::FindFlags findFlags) override; - Core::IFindSupport::Result findIncremental(const QString &txt, Core::FindFlags findFlags) override; - Core::IFindSupport::Result findStep(const QString &txt, Core::FindFlags findFlags) override; - void replace(const QString &before, const QString &after, Core::FindFlags findFlags) override; - bool replaceStep(const QString &before, const QString &after, Core::FindFlags findFlags) override; - int replaceAll(const QString &before, const QString &after, Core::FindFlags findFlags) override; + void highlightAll(const QString &txt, Utils::FindFlags findFlags) override; + Core::IFindSupport::Result findIncremental(const QString &txt, Utils::FindFlags findFlags) override; + Core::IFindSupport::Result findStep(const QString &txt, Utils::FindFlags findFlags) override; + void replace(const QString &before, const QString &after, Utils::FindFlags findFlags) override; + bool replaceStep(const QString &before, const QString &after, Utils::FindFlags findFlags) override; + int replaceAll(const QString &before, const QString &after, Utils::FindFlags findFlags) override; void defineFindScope() override; void clearFindScope() override; signals: void incrementalSearchReseted(); - void incrementalFound(const QString &txt, Core::FindFlags findFlags); - void stepFound(const QString &txt, Core::FindFlags findFlags); - void replaced(const QString &before, const QString &after, - Core::FindFlags findFlags); - void stepReplaced(const QString &before, const QString &after, - Core::FindFlags findFlags); - void allReplaced(const QString &before, const QString &after, - Core::FindFlags findFlags); + void incrementalFound(const QString &txt, Utils::FindFlags findFlags); + void stepFound(const QString &txt, Utils::FindFlags findFlags); + void replaced(const QString &before, const QString &after, Utils::FindFlags findFlags); + void stepReplaced(const QString &before, const QString &after, Utils::FindFlags findFlags); + void allReplaced(const QString &before, const QString &after, Utils::FindFlags findFlags); private: QPointer m_currentFind; diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp index c859624f60d..d07b731815a 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp @@ -298,10 +298,10 @@ bool TraceViewFindSupport::supportsReplace() const return false; } -Core::FindFlags TraceViewFindSupport::supportedFindFlags() const +Utils::FindFlags TraceViewFindSupport::supportedFindFlags() const { - return Core::FindBackward | Core::FindCaseSensitively | Core::FindRegularExpression - | Core::FindWholeWords; + return Utils::FindBackward | Utils::FindCaseSensitively | Utils::FindRegularExpression + | Utils::FindWholeWords; } void TraceViewFindSupport::resetIncrementalSearch() @@ -325,7 +325,7 @@ QString TraceViewFindSupport::completedFindString() const } Core::IFindSupport::Result TraceViewFindSupport::findIncremental(const QString &txt, - Core::FindFlags findFlags) + Utils::FindFlags findFlags) { if (m_incrementalStartPos < 0) m_incrementalStartPos = qMax(m_currentPosition, 0); @@ -339,9 +339,9 @@ Core::IFindSupport::Result TraceViewFindSupport::findIncremental(const QString & } Core::IFindSupport::Result TraceViewFindSupport::findStep(const QString &txt, - Core::FindFlags findFlags) + Utils::FindFlags findFlags) { - int start = (findFlags & Core::FindBackward) ? m_currentPosition : m_currentPosition + 1; + int start = (findFlags & Utils::FindBackward) ? m_currentPosition : m_currentPosition + 1; bool wrapped; bool found = find(txt, findFlags, start, &wrapped); if (wrapped) @@ -355,14 +355,14 @@ Core::IFindSupport::Result TraceViewFindSupport::findStep(const QString &txt, // "start" is the model index that is searched first in a forward search, i.e. as if the // "cursor" were between start-1 and start -bool TraceViewFindSupport::find(const QString &txt, Core::FindFlags findFlags, int start, +bool TraceViewFindSupport::find(const QString &txt, Utils::FindFlags findFlags, int start, bool *wrapped) { if (wrapped) *wrapped = false; if (!findOne(txt, findFlags, start)) { int secondStart; - if (findFlags & Core::FindBackward) + if (findFlags & Utils::FindBackward) secondStart = m_modelManager->notesModel()->count(); else secondStart = 0; @@ -376,19 +376,19 @@ bool TraceViewFindSupport::find(const QString &txt, Core::FindFlags findFlags, i // "start" is the model index that is searched first in a forward search, i.e. as if the // "cursor" were between start-1 and start -bool TraceViewFindSupport::findOne(const QString &txt, Core::FindFlags findFlags, int start) +bool TraceViewFindSupport::findOne(const QString &txt, Utils::FindFlags findFlags, int start) { - bool caseSensitiveSearch = (findFlags & Core::FindCaseSensitively); - bool regexSearch = (findFlags & Core::FindRegularExpression); + bool caseSensitiveSearch = (findFlags & Utils::FindCaseSensitively); + bool regexSearch = (findFlags & Utils::FindRegularExpression); QRegularExpression regexp(regexSearch ? txt : QRegularExpression::escape(txt), caseSensitiveSearch ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption); QTextDocument::FindFlags flags; if (caseSensitiveSearch) flags |= QTextDocument::FindCaseSensitively; - if (findFlags & Core::FindWholeWords) + if (findFlags & Utils::FindWholeWords) flags |= QTextDocument::FindWholeWords; - bool forwardSearch = !(findFlags & Core::FindBackward); + bool forwardSearch = !(findFlags & Utils::FindBackward); int increment = forwardSearch ? +1 : -1; int current = forwardSearch ? start : start - 1; Timeline::TimelineNotesModel *model = m_modelManager->notesModel(); diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.h b/src/plugins/qmlprofiler/qmlprofilertraceview.h index 37d22913ac3..ff41857fba9 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.h +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.h @@ -61,17 +61,17 @@ public: TraceViewFindSupport(QmlProfilerTraceView *view, QmlProfilerModelManager *manager); bool supportsReplace() const override; - Core::FindFlags supportedFindFlags() const override; + Utils::FindFlags supportedFindFlags() const override; void resetIncrementalSearch() override; void clearHighlights() override; QString currentFindString() const override; QString completedFindString() const override; - Result findIncremental(const QString &txt, Core::FindFlags findFlags) override; - Result findStep(const QString &txt, Core::FindFlags findFlags) override; + Result findIncremental(const QString &txt, Utils::FindFlags findFlags) override; + Result findStep(const QString &txt, Utils::FindFlags findFlags) override; private: - bool find(const QString &txt, Core::FindFlags findFlags, int start, bool *wrapped); - bool findOne(const QString &txt, Core::FindFlags findFlags, int start); + bool find(const QString &txt, Utils::FindFlags findFlags, int start, bool *wrapped); + bool findOne(const QString &txt, Utils::FindFlags findFlags, int start); QmlProfilerTraceView *m_view; QmlProfilerModelManager *m_modelManager; diff --git a/src/plugins/terminal/terminalsearch.cpp b/src/plugins/terminal/terminalsearch.cpp index e909e75dfe6..341c6af402c 100644 --- a/src/plugins/terminal/terminalsearch.cpp +++ b/src/plugins/terminal/terminalsearch.cpp @@ -12,6 +12,8 @@ Q_LOGGING_CATEGORY(terminalSearchLog, "qtc.terminal.search", QtWarningMsg) +using namespace Utils; + using namespace std::chrono_literals; namespace Terminal { @@ -44,7 +46,7 @@ void TerminalSearch::setCurrentSelection(std::optional select m_currentSelection = selection; } -void TerminalSearch::setSearchString(const QString &searchString, Core::FindFlags findFlags) +void TerminalSearch::setSearchString(const QString &searchString, FindFlags findFlags) { if (m_currentSearchString != searchString || m_findFlags != findFlags) { m_currentSearchString = searchString; @@ -99,7 +101,7 @@ QList TerminalSearch::search() std::function compare; - if (m_findFlags.testFlag(Core::FindFlag::FindCaseSensitively)) { + if (m_findFlags.testFlag(FindFlag::FindCaseSensitively)) { compare = [](char32_t a, char32_t b) { return a == b || isSpace(a, b); }; } else { compare = [](char32_t a, char32_t b) { @@ -111,7 +113,7 @@ QList TerminalSearch::search() const QList asUcs4 = m_currentSearchString.toUcs4(); std::u32string searchString(asUcs4.begin(), asUcs4.end()); - if (m_findFlags.testFlag(Core::FindFlag::FindWholeWords)) { + if (m_findFlags.testFlag(FindFlag::FindWholeWords)) { searchString.push_back(std::numeric_limits::max()); searchString.insert(searchString.begin(), std::numeric_limits::max()); } @@ -123,7 +125,7 @@ QList TerminalSearch::search() if (it != m_surface->end()) { auto hit = SearchHit{it.position(), static_cast(it.position() + searchString.size())}; - if (m_findFlags.testFlag(Core::FindFlag::FindWholeWords)) { + if (m_findFlags.testFlag(FindFlag::FindWholeWords)) { hit.start++; hit.end--; } @@ -153,7 +155,7 @@ QList TerminalSearch::searchRegex() } QRegularExpression re(m_currentSearchString, - m_findFlags.testFlag(Core::FindFlag::FindCaseSensitively) + m_findFlags.testFlag(FindFlag::FindCaseSensitively) ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption); @@ -191,7 +193,7 @@ void TerminalSearch::debouncedUpdateHits() m_currentHit = -1; - const bool regex = m_findFlags.testFlag(Core::FindFlag::FindRegularExpression); + const bool regex = m_findFlags.testFlag(FindFlag::FindRegularExpression); QList hits = regex ? searchRegex() : search(); @@ -212,10 +214,10 @@ void TerminalSearch::debouncedUpdateHits() qCDebug(terminalSearchLog) << "Search took" << t.elapsed() << "ms"; } -Core::FindFlags TerminalSearch::supportedFindFlags() const +FindFlags TerminalSearch::supportedFindFlags() const { - return Core::FindFlag::FindCaseSensitively | Core::FindFlag::FindBackward - | Core::FindFlag::FindRegularExpression | Core::FindFlag::FindWholeWords; + return FindFlag::FindCaseSensitively | FindFlag::FindBackward + | FindFlag::FindRegularExpression | FindFlag::FindWholeWords; } void TerminalSearch::resetIncrementalSearch() @@ -241,8 +243,7 @@ QString TerminalSearch::completedFindString() const return {}; } -Core::IFindSupport::Result TerminalSearch::findIncremental(const QString &txt, - Core::FindFlags findFlags) +Core::IFindSupport::Result TerminalSearch::findIncremental(const QString &txt, FindFlags findFlags) { if (txt == m_currentSearchString) { if (m_debounceTimer.isActive()) @@ -257,7 +258,7 @@ Core::IFindSupport::Result TerminalSearch::findIncremental(const QString &txt, return Result::NotYetFound; } -Core::IFindSupport::Result TerminalSearch::findStep(const QString &txt, Core::FindFlags findFlags) +Core::IFindSupport::Result TerminalSearch::findStep(const QString &txt, FindFlags findFlags) { if (txt == m_currentSearchString) { if (m_debounceTimer.isActive()) @@ -265,7 +266,7 @@ Core::IFindSupport::Result TerminalSearch::findStep(const QString &txt, Core::Fi else if (m_hits.isEmpty()) return Result::NotFound; - if (findFlags.testFlag(Core::FindFlag::FindBackward)) + if (findFlags.testFlag(FindFlag::FindBackward)) previousHit(); else nextHit(); @@ -276,7 +277,7 @@ Core::IFindSupport::Result TerminalSearch::findStep(const QString &txt, Core::Fi return findIncremental(txt, findFlags); } -void TerminalSearch::highlightAll(const QString &txt, Core::FindFlags findFlags) +void TerminalSearch::highlightAll(const QString &txt, FindFlags findFlags) { setSearchString(txt, findFlags); } diff --git a/src/plugins/terminal/terminalsearch.h b/src/plugins/terminal/terminalsearch.h index 3daa05c04d2..a5a66edbcd5 100644 --- a/src/plugins/terminal/terminalsearch.h +++ b/src/plugins/terminal/terminalsearch.h @@ -36,7 +36,7 @@ public: TerminalSearch(Internal::TerminalSurface *surface); void setCurrentSelection(std::optional selection); - void setSearchString(const QString &searchString, Core::FindFlags findFlags); + void setSearchString(const QString &searchString, Utils::FindFlags findFlags); void nextHit(); void previousHit(); @@ -48,15 +48,15 @@ public: public: bool supportsReplace() const override { return false; } - Core::FindFlags supportedFindFlags() const override; + Utils::FindFlags supportedFindFlags() const override; void resetIncrementalSearch() override; void clearHighlights() override; QString currentFindString() const override; QString completedFindString() const override; - Result findIncremental(const QString &txt, Core::FindFlags findFlags) override; - Result findStep(const QString &txt, Core::FindFlags findFlags) override; + Result findIncremental(const QString &txt, Utils::FindFlags findFlags) override; + Result findStep(const QString &txt, Utils::FindFlags findFlags) override; - void highlightAll(const QString &, Core::FindFlags) override; + void highlightAll(const QString &, Utils::FindFlags) override; signals: void hitsChanged(); @@ -71,7 +71,7 @@ protected: private: std::optional m_currentSelection; QString m_currentSearchString; - Core::FindFlags m_findFlags; + Utils::FindFlags m_findFlags; Internal::TerminalSurface *m_surface; int m_currentHit{-1}; diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 8a75a27910c..2561bcfeb36 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -60,7 +60,7 @@ public: return func(parameters.text, baseFileFind->files(parameters.nameFilters, parameters.exclusionFilters, parameters.additionalParameters), - textDocumentFlagsForFindFlags(parameters.flags), + Utils::textDocumentFlagsForFindFlags(parameters.flags), TextDocument::openedTextDocumentContents()); } diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index b564b35c0c1..7da5bec9038 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -38,7 +38,7 @@ public: QVariant additionalParameters; QVariant searchEngineParameters; int searchEngineIndex; - Core::FindFlags flags; + Utils::FindFlags flags; }; class BaseFileFind; @@ -80,8 +80,8 @@ public: bool isEnabled() const override; bool isReplaceSupported() const override { return true; } - void findAll(const QString &txt, Core::FindFlags findFlags) override; - void replaceAll(const QString &txt, Core::FindFlags findFlags) override; + void findAll(const QString &txt, Utils::FindFlags findFlags) override; + void replaceAll(const QString &txt, Utils::FindFlags findFlags) override; void addSearchEngine(SearchEngine *searchEngine); /* returns the list of unique files that were passed in items */ @@ -120,7 +120,7 @@ private: void searchAgain(Core::SearchResult *search); virtual void recheckEnabled(Core::SearchResult *search); - void runNewSearch(const QString &txt, Core::FindFlags findFlags, + void runNewSearch(const QString &txt, Utils::FindFlags findFlags, Core::SearchResultWindow::SearchMode searchMode); void runSearch(Core::SearchResult *search); diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index ecb617aed70..aad9553e748 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -902,7 +902,7 @@ void TextEditorWidgetFind::selectAll(const QString &txt, FindFlags findFlags) FileListIterator *it = new FileListIterator({fileName}, {const_cast( m_editor->textDocument()->codec())}); - const QTextDocument::FindFlags findFlags2 = textDocumentFlagsForFindFlags(findFlags); + const QTextDocument::FindFlags findFlags2 = Utils::textDocumentFlagsForFindFlags(findFlags); if (findFlags & FindRegularExpression) m_selectWatcher->setFuture(findInFilesRegExp(txt, it, findFlags2, fileToContentsMap)); @@ -6744,7 +6744,7 @@ void TextEditorWidgetPrivate::highlightSearchResultsInScrollBar() this, &TextEditorWidgetPrivate::searchFinished); m_searchWatcher->setPendingResultsLimit(10); - const QTextDocument::FindFlags findFlags = textDocumentFlagsForFindFlags(m_findFlags); + const QTextDocument::FindFlags findFlags = Utils::textDocumentFlagsForFindFlags(m_findFlags); const FilePath &fileName = m_document->filePath(); FileListIterator *it = @@ -7291,7 +7291,7 @@ void TextEditorWidgetPrivate::addSelectionNextFindMatch() return; } - const QTextDocument::FindFlags findFlags = textDocumentFlagsForFindFlags(m_findFlags); + const QTextDocument::FindFlags findFlags = Utils::textDocumentFlagsForFindFlags(m_findFlags); int searchFrom = cursors.last().selectionEnd(); while (true) { diff --git a/tests/auto/treeviewfind/tst_treeviewfind.cpp b/tests/auto/treeviewfind/tst_treeviewfind.cpp index 301c9084d3c..a3a8b11545e 100644 --- a/tests/auto/treeviewfind/tst_treeviewfind.cpp +++ b/tests/auto/treeviewfind/tst_treeviewfind.cpp @@ -48,13 +48,13 @@ void tst_treeviewfind::wrapping() QCOMPARE(tree->currentItem()->text(0), QString::fromLatin1("FOO2")); // forward - findSupport->findStep(QLatin1String("FOO"), Core::FindFlags()); + findSupport->findStep(QLatin1String("FOO"), {}); QCOMPARE(tree->currentItem(), toplevelitems.at(0)->child(0)); // backward tree->setCurrentItem(toplevelitems.at(0)->child(0)); QCOMPARE(tree->currentItem()->text(0), QString::fromLatin1("FOO1")); - findSupport->findStep(QLatin1String("FOO"), Core::FindBackward); + findSupport->findStep(QLatin1String("FOO"), Utils::FindBackward); QCOMPARE(tree->currentItem(), toplevelitems.at(2)->child(0)); // clean up @@ -93,31 +93,31 @@ void tst_treeviewfind::columns() QCOMPARE(tree->currentItem()->text(0), QString::fromLatin1("HEADER1")); // find in first column - findSupport->findStep(QLatin1String("FOO"), Core::FindFlags()); + findSupport->findStep(QLatin1String("FOO"), {}); QCOMPARE(tree->currentItem(), toplevelitems.at(0)->child(0)); // find in second column of node with children - findSupport->findStep(QLatin1String("FOO"), Core::FindFlags()); + findSupport->findStep(QLatin1String("FOO"), {}); QCOMPARE(tree->currentItem(), toplevelitems.at(1)); // again find in first column - findSupport->findStep(QLatin1String("FOO"), Core::FindFlags()); + findSupport->findStep(QLatin1String("FOO"), {}); QCOMPARE(tree->currentItem(), toplevelitems.at(1)->child(0)); // don't stay in item if multiple columns match, and find in second column - findSupport->findStep(QLatin1String("FOO"), Core::FindFlags()); + findSupport->findStep(QLatin1String("FOO"), {}); QCOMPARE(tree->currentItem(), toplevelitems.at(2)->child(0)); // wrap - findSupport->findStep(QLatin1String("FOO"), Core::FindFlags()); + findSupport->findStep(QLatin1String("FOO"), {}); QCOMPARE(tree->currentItem(), toplevelitems.at(0)->child(0)); // backwards tree->setCurrentItem(toplevelitems.at(2)->child(0)); QCOMPARE(tree->currentItem()->text(0), QString::fromLatin1("A")); - findSupport->findStep(QLatin1String("FOO"), Core::FindBackward); + findSupport->findStep(QLatin1String("FOO"), Utils::FindBackward); QCOMPARE(tree->currentItem(), toplevelitems.at(1)->child(0)); - findSupport->findStep(QLatin1String("FOO"), Core::FindBackward); + findSupport->findStep(QLatin1String("FOO"), Utils::FindBackward); QCOMPARE(tree->currentItem(), toplevelitems.at(1)); - findSupport->findStep(QLatin1String("FOO"), Core::FindBackward); + findSupport->findStep(QLatin1String("FOO"), Utils::FindBackward); QCOMPARE(tree->currentItem(), toplevelitems.at(0)->child(0)); - findSupport->findStep(QLatin1String("FOO"), Core::FindBackward); + findSupport->findStep(QLatin1String("FOO"), Utils::FindBackward); QCOMPARE(tree->currentItem(), toplevelitems.at(2)->child(0)); // clean up From 7830bb6bc47dd076cd150a821f60ab87fbfd1f7e Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 22 May 2023 15:30:54 +0200 Subject: [PATCH 0004/1777] FileSearch: Introduce searchInContents() Change-Id: I314a5205f51d14e8a3205548049f017d93754212 Reviewed-by: Eike Ziller --- src/libs/utils/filesearch.cpp | 179 ++++++++++++++++++++++++++++++++-- src/libs/utils/filesearch.h | 5 + 2 files changed, 175 insertions(+), 9 deletions(-) diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index 062d964509f..259e38af043 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -22,6 +22,15 @@ Q_LOGGING_CATEGORY(searchLog, "qtc.utils.filesearch", QtWarningMsg) using namespace Utils; +const int MAX_LINE_SIZE = 400; + +static QString clippedText(const QString &text, int maxLength) +{ + if (text.length() > maxLength) + return text.left(maxLength) + QChar(0x2026); // '...' + return text; +} + QTextDocument::FindFlags Utils::textDocumentFlagsForFindFlags(FindFlags flags) { QTextDocument::FindFlags textDocFlags; @@ -34,6 +43,167 @@ QTextDocument::FindFlags Utils::textDocumentFlagsForFindFlags(FindFlags flags) return textDocFlags; } +static SearchResultItems searchWithoutRegExp(const QFuture &future, const QString &searchTerm, + FindFlags flags, const FilePath &filePath, + const QString &contents) +{ + const bool caseSensitive = (flags & QTextDocument::FindCaseSensitively); + const bool wholeWord = (flags & QTextDocument::FindWholeWords); + const QString searchTermLower = searchTerm.toLower(); + const QString searchTermUpper = searchTerm.toUpper(); + const int termMaxIndex = searchTerm.length() - 1; + const QChar *termData = searchTerm.constData(); + const QChar *termDataLower = searchTermLower.constData(); + const QChar *termDataUpper = searchTermUpper.constData(); + + SearchResultItems results; + QString copy = contents; + QTextStream stream(©); + int lineNr = 0; + + while (!stream.atEnd()) { + ++lineNr; + const QString chunk = stream.readLine(); + const int chunkLength = chunk.length(); + const QChar *chunkPtr = chunk.constData(); + const QChar *chunkEnd = chunkPtr + chunkLength - 1; + for (const QChar *regionPtr = chunkPtr; regionPtr + termMaxIndex <= chunkEnd; ++regionPtr) { + const QChar *regionEnd = regionPtr + termMaxIndex; + if ( /* optimization check for start and end of region */ + // case sensitive + (caseSensitive && *regionPtr == termData[0] + && *regionEnd == termData[termMaxIndex]) + || + // case insensitive + (!caseSensitive && (*regionPtr == termDataLower[0] + || *regionPtr == termDataUpper[0]) + && (*regionEnd == termDataLower[termMaxIndex] + || *regionEnd == termDataUpper[termMaxIndex])) + ) { + bool equal = true; + + // whole word check + const QChar *beforeRegion = regionPtr - 1; + const QChar *afterRegion = regionEnd + 1; + if (wholeWord + && (((beforeRegion >= chunkPtr) + && (beforeRegion->isLetterOrNumber() + || ((*beforeRegion) == QLatin1Char('_')))) + || + ((afterRegion <= chunkEnd) + && (afterRegion->isLetterOrNumber() + || ((*afterRegion) == QLatin1Char('_')))) + )) { + equal = false; + } else { + // check all chars + int regionIndex = 1; + for (const QChar *regionCursor = regionPtr + 1; + regionCursor < regionEnd; + ++regionCursor, ++regionIndex) { + if ( // case sensitive + (caseSensitive + && *regionCursor != termData[regionIndex]) + || + // case insensitive + (!caseSensitive + && *regionCursor != termDataLower[regionIndex] + && *regionCursor != termDataUpper[regionIndex]) + ) { + equal = false; + break; + } + } + } + if (equal) { + SearchResultItem result; + result.setFilePath(filePath); + result.setMainRange(lineNr, regionPtr - chunkPtr, termMaxIndex + 1); + result.setDisplayText(clippedText(chunk, MAX_LINE_SIZE)); + result.setUserData(QStringList()); + result.setUseTextEditorFont(true); + results << result; + regionPtr += termMaxIndex; // another +1 done by for-loop + } + } + } + if (future.isCanceled()) + return {}; + } + if (future.isCanceled()) + return {}; + return results; +} + +static SearchResultItems searchWithRegExp(const QFuture &future, const QString &searchTerm, + FindFlags flags, const FilePath &filePath, + const QString &contents) +{ + const QString term = flags & QTextDocument::FindWholeWords + ? QString::fromLatin1("\\b%1\\b").arg(searchTerm) : searchTerm; + const QRegularExpression::PatternOptions patternOptions = (flags & FindCaseSensitively) + ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption; + const QRegularExpression expression = QRegularExpression(term, patternOptions); + if (!expression.isValid()) { + QFuture nonConstFuture = future; + nonConstFuture.cancel(); + return {}; + } + + SearchResultItems results; + QString copy = contents; + QTextStream stream(©); + int lineNr = 0; + + QRegularExpressionMatch match; + while (!stream.atEnd()) { + ++lineNr; + const QString line = stream.readLine(); + const QString resultItemText = clippedText(line, MAX_LINE_SIZE); + int lengthOfLine = line.size(); + int pos = 0; + while ((match = expression.match(line, pos)).hasMatch()) { + pos = match.capturedStart(); + SearchResultItem result; + result.setFilePath(filePath); + result.setMainRange(lineNr, pos, match.capturedLength()); + result.setDisplayText(resultItemText); + result.setUserData(match.capturedTexts()); + result.setUseTextEditorFont(true); + results << result; + if (match.capturedLength() == 0) + break; + pos += match.capturedLength(); + if (pos >= lengthOfLine) + break; + } + if (future.isCanceled()) + return {}; + } + if (future.isCanceled()) + return {}; + return results; +} + +static SearchResultItems searchInContents(const QFuture &future, const QString &searchTerm, + FindFlags flags, const FilePath &filePath, + const QString &contents) +{ + if (flags & FindRegularExpression) + return searchWithRegExp(future, searchTerm, flags, filePath, contents); + return searchWithoutRegExp(future, searchTerm, flags, filePath, contents); +} + +void searchInContents(QPromise &promise, const QString &searchTerm, + FindFlags flags, const FilePath &filePath, const QString &contents) +{ + const QFuture future(promise.future()); + const SearchResultItems results = searchInContents(future, searchTerm, flags, filePath, + contents); + if (!promise.isCanceled()) + promise.addResult(results); +} + static inline QString msgCanceled(const QString &searchTerm, int numMatches, int numFilesSearched) { return Tr::tr("%1: canceled. %n occurrences found in %2 files.", @@ -48,15 +218,6 @@ static inline QString msgFound(const QString &searchTerm, int numMatches, int nu namespace { -const int MAX_LINE_SIZE = 400; - -QString clippedText(const QString &text, int maxLength) -{ - if (text.length() > maxLength) - return text.left(maxLength) + QChar(0x2026); // '...' - return text; -} - // returns success static bool getFileContent(const FilePath &filePath, QTextCodec *encoding, diff --git a/src/libs/utils/filesearch.h b/src/libs/utils/filesearch.h index ae06e3d5a89..664ccf02319 100644 --- a/src/libs/utils/filesearch.h +++ b/src/libs/utils/filesearch.h @@ -9,6 +9,7 @@ #include "searchresultitem.h" #include +#include #include #include #include @@ -35,6 +36,10 @@ Q_DECLARE_FLAGS(FindFlags, FindFlag) QTCREATOR_UTILS_EXPORT QTextDocument::FindFlags textDocumentFlagsForFindFlags(FindFlags flags); +QTCREATOR_UTILS_EXPORT +void searchInContents(QPromise &promise, const QString &searchTerm, + FindFlags flags, const FilePath &filePath, const QString &contents); + QTCREATOR_UTILS_EXPORT std::function filterFilesFunction(const QStringList &filters, const QStringList &exclusionFilters); From bd48121a8878c07b69269fc782836284212fedcc Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 22 May 2023 15:44:19 +0200 Subject: [PATCH 0005/1777] TextEditor: Reuse searchInContents() Change-Id: I08403d05830232becf7e5329339aaecf288894b7 Reviewed-by: David Schulz Reviewed-by: Qt CI Bot --- src/libs/utils/filesearch.cpp | 4 ++-- src/plugins/texteditor/texteditor.cpp | 32 +++++---------------------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index 259e38af043..0fbb2ad9f3c 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -194,8 +194,8 @@ static SearchResultItems searchInContents(const QFuture &future, const QSt return searchWithoutRegExp(future, searchTerm, flags, filePath, contents); } -void searchInContents(QPromise &promise, const QString &searchTerm, - FindFlags flags, const FilePath &filePath, const QString &contents) +void Utils::searchInContents(QPromise &promise, const QString &searchTerm, + FindFlags flags, const FilePath &filePath, const QString &contents) { const QFuture future(promise.future()); const SearchResultItems results = searchInContents(future, searchTerm, flags, filePath, diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index aad9553e748..7388a3ae393 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -48,6 +48,7 @@ #include #include +#include #include #include #include @@ -895,19 +896,9 @@ void TextEditorWidgetFind::selectAll(const QString &txt, FindFlags findFlags) m_editor->setFocus(); }); - const FilePath &fileName = m_editor->textDocument()->filePath(); - QMap fileToContentsMap; - fileToContentsMap[fileName] = m_editor->textDocument()->plainText(); - - FileListIterator *it = new FileListIterator({fileName}, - {const_cast( - m_editor->textDocument()->codec())}); - const QTextDocument::FindFlags findFlags2 = Utils::textDocumentFlagsForFindFlags(findFlags); - - if (findFlags & FindRegularExpression) - m_selectWatcher->setFuture(findInFilesRegExp(txt, it, findFlags2, fileToContentsMap)); - else - m_selectWatcher->setFuture(findInFiles(txt, it, findFlags2, fileToContentsMap)); + m_selectWatcher->setFuture(Utils::asyncRun(Utils::searchInContents, txt, findFlags, + m_editor->textDocument()->filePath(), + m_editor->textDocument()->plainText())); } void TextEditorWidgetFind::cancelCurrentSelectAll() @@ -6743,19 +6734,8 @@ void TextEditorWidgetPrivate::highlightSearchResultsInScrollBar() connect(m_searchWatcher, &QFutureWatcher::finished, this, &TextEditorWidgetPrivate::searchFinished); m_searchWatcher->setPendingResultsLimit(10); - - const QTextDocument::FindFlags findFlags = Utils::textDocumentFlagsForFindFlags(m_findFlags); - - const FilePath &fileName = m_document->filePath(); - FileListIterator *it = - new FileListIterator({fileName} , {const_cast(m_document->codec())}); - QMap fileToContentsMap; - fileToContentsMap[fileName] = m_document->plainText(); - - if (m_findFlags & FindRegularExpression) - m_searchWatcher->setFuture(findInFilesRegExp(txt, it, findFlags, fileToContentsMap)); - else - m_searchWatcher->setFuture(findInFiles(txt, it, findFlags, fileToContentsMap)); + m_searchWatcher->setFuture(Utils::asyncRun(Utils::searchInContents, txt, m_findFlags, + m_document->filePath(), m_document->plainText())); } void TextEditorWidgetPrivate::scheduleUpdateHighlightScrollBar() From 61f0bf479dab9688c742ca061d2635c86d0f316c Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 22 May 2023 16:28:45 +0200 Subject: [PATCH 0006/1777] FileSearch: Reuse searchInContents() inside findInFiles() Get rid of findInFilesRegExp(). Change-Id: Iae47b023a1428a66fff165c0a0a4fa38d55ba132 Reviewed-by: Eike Ziller --- src/libs/utils/filesearch.cpp | 237 ++--------------------- src/libs/utils/filesearch.h | 10 +- src/plugins/texteditor/basefilefind.cpp | 14 +- tests/auto/filesearch/tst_filesearch.cpp | 18 +- 4 files changed, 22 insertions(+), 257 deletions(-) diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index 0fbb2ad9f3c..662448a7de3 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -12,7 +12,6 @@ #include "utilstr.h" #include -#include #include #include @@ -218,7 +217,6 @@ static inline QString msgFound(const QString &searchTerm, int numMatches, int nu namespace { -// returns success static bool getFileContent(const FilePath &filePath, QTextCodec *encoding, QString *tempString, @@ -239,57 +237,13 @@ static bool getFileContent(const FilePath &filePath, class FileSearch { public: - FileSearch(const QString &searchTerm, - QTextDocument::FindFlags flags, - const QMap &fileToContentsMap); void operator()(QFutureInterface &futureInterface, const FileIterator::Item &item) const; - -private: - QMap fileToContentsMap; - QString searchTermLower; - QString searchTermUpper; - int termMaxIndex; - const QChar *termData; - const QChar *termDataLower; - const QChar *termDataUpper; - bool caseSensitive; - bool wholeWord; + const QString m_searchTerm; + const FindFlags m_flags; + const QMap m_fileToContentsMap; }; -class FileSearchRegExp -{ -public: - FileSearchRegExp(const QString &searchTerm, - QTextDocument::FindFlags flags, - const QMap &fileToContentsMap); - FileSearchRegExp(const FileSearchRegExp &other); - void operator()(QFutureInterface &futureInterface, - const FileIterator::Item &item) const; - -private: - QRegularExpressionMatch doGuardedMatch(const QString &line, int offset) const; - - QMap fileToContentsMap; - QRegularExpression expression; - mutable QMutex mutex; -}; - -FileSearch::FileSearch(const QString &searchTerm, - QTextDocument::FindFlags flags, - const QMap &fileToContentsMap) -{ - this->fileToContentsMap = fileToContentsMap; - caseSensitive = (flags & QTextDocument::FindCaseSensitively); - wholeWord = (flags & QTextDocument::FindWholeWords); - searchTermLower = searchTerm.toLower(); - searchTermUpper = searchTerm.toUpper(); - termMaxIndex = searchTerm.length() - 1; - termData = searchTerm.constData(); - termDataLower = searchTermLower.constData(); - termDataUpper = searchTermUpper.constData(); -} - void FileSearch::operator()(QFutureInterface &futureInterface, const FileIterator::Item &item) const { @@ -298,169 +252,16 @@ void FileSearch::operator()(QFutureInterface &futureInterface qCDebug(searchLog) << "Searching in" << item.filePath; futureInterface.setProgressRange(0, 1); futureInterface.setProgressValue(0); - SearchResultItems results; - QString tempString; - if (!getFileContent(item.filePath, item.encoding, &tempString, fileToContentsMap)) { + QString contents; + if (!getFileContent(item.filePath, item.encoding, &contents, m_fileToContentsMap)) { qCDebug(searchLog) << "- failed to get content for" << item.filePath; futureInterface.cancel(); // failure return; } - QTextStream stream(&tempString); - int lineNr = 0; - while (!stream.atEnd()) { - ++lineNr; - const QString chunk = stream.readLine(); - const int chunkLength = chunk.length(); - const QChar *chunkPtr = chunk.constData(); - const QChar *chunkEnd = chunkPtr + chunkLength - 1; - for (const QChar *regionPtr = chunkPtr; regionPtr + termMaxIndex <= chunkEnd; ++regionPtr) { - const QChar *regionEnd = regionPtr + termMaxIndex; - if ( /* optimization check for start and end of region */ - // case sensitive - (caseSensitive && *regionPtr == termData[0] - && *regionEnd == termData[termMaxIndex]) - || - // case insensitive - (!caseSensitive && (*regionPtr == termDataLower[0] - || *regionPtr == termDataUpper[0]) - && (*regionEnd == termDataLower[termMaxIndex] - || *regionEnd == termDataUpper[termMaxIndex])) - ) { - bool equal = true; - - // whole word check - const QChar *beforeRegion = regionPtr - 1; - const QChar *afterRegion = regionEnd + 1; - if (wholeWord - && (((beforeRegion >= chunkPtr) - && (beforeRegion->isLetterOrNumber() - || ((*beforeRegion) == QLatin1Char('_')))) - || - ((afterRegion <= chunkEnd) - && (afterRegion->isLetterOrNumber() - || ((*afterRegion) == QLatin1Char('_')))) - )) { - equal = false; - } else { - // check all chars - int regionIndex = 1; - for (const QChar *regionCursor = regionPtr + 1; - regionCursor < regionEnd; - ++regionCursor, ++regionIndex) { - if ( // case sensitive - (caseSensitive - && *regionCursor != termData[regionIndex]) - || - // case insensitive - (!caseSensitive - && *regionCursor != termDataLower[regionIndex] - && *regionCursor != termDataUpper[regionIndex]) - ) { - equal = false; - break; - } - } - } - if (equal) { - SearchResultItem result; - result.setFilePath(item.filePath); - result.setMainRange(lineNr, regionPtr - chunkPtr, termMaxIndex + 1); - result.setDisplayText(clippedText(chunk, MAX_LINE_SIZE)); - result.setUserData(QStringList()); - result.setUseTextEditorFont(true); - results << result; - regionPtr += termMaxIndex; // another +1 done by for-loop - } - } - } - if (futureInterface.isPaused()) - futureInterface.waitForResume(); - if (futureInterface.isCanceled()) - break; - } - if (!futureInterface.isCanceled()) { - futureInterface.reportResult(results); - futureInterface.setProgressValue(1); - } - qCDebug(searchLog) << "- finished searching in" << item.filePath; -} - -FileSearchRegExp::FileSearchRegExp(const QString &searchTerm, - QTextDocument::FindFlags flags, - const QMap &fileToContentsMap) -{ - this->fileToContentsMap = fileToContentsMap; - QString term = searchTerm; - if (flags & QTextDocument::FindWholeWords) - term = QString::fromLatin1("\\b%1\\b").arg(term); - const QRegularExpression::PatternOptions patternOptions = (flags & QTextDocument::FindCaseSensitively) - ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption; - expression = QRegularExpression(term, patternOptions); -} - -FileSearchRegExp::FileSearchRegExp(const FileSearchRegExp &other) - : fileToContentsMap(other.fileToContentsMap), - expression(other.expression) -{ -} - -QRegularExpressionMatch FileSearchRegExp::doGuardedMatch(const QString &line, int offset) const -{ - QMutexLocker lock(&mutex); - return expression.match(line, offset); -} - -void FileSearchRegExp::operator()(QFutureInterface &futureInterface, - const FileIterator::Item &item) const -{ - if (!expression.isValid()) { - futureInterface.cancel(); - return; - } - if (futureInterface.isCanceled()) - return; - qCDebug(searchLog) << "Searching in" << item.filePath; - futureInterface.setProgressRange(0, 1); - futureInterface.setProgressValue(0); - SearchResultItems results; - QString tempString; - if (!getFileContent(item.filePath, item.encoding, &tempString, fileToContentsMap)) { - qCDebug(searchLog) << "- failed to get content for" << item.filePath; - futureInterface.cancel(); // failure - return; - } - QTextStream stream(&tempString); - int lineNr = 0; - - QString line; - QRegularExpressionMatch match; - while (!stream.atEnd()) { - ++lineNr; - line = stream.readLine(); - const QString resultItemText = clippedText(line, MAX_LINE_SIZE); - int lengthOfLine = line.size(); - int pos = 0; - while ((match = doGuardedMatch(line, pos)).hasMatch()) { - pos = match.capturedStart(); - SearchResultItem result; - result.setFilePath(item.filePath); - result.setMainRange(lineNr, pos, match.capturedLength()); - result.setDisplayText(resultItemText); - result.setUserData(match.capturedTexts()); - result.setUseTextEditorFont(true); - results << result; - if (match.capturedLength() == 0) - break; - pos += match.capturedLength(); - if (pos >= lengthOfLine) - break; - } - if (futureInterface.isPaused()) - futureInterface.waitForResume(); - if (futureInterface.isCanceled()) - break; - } + const QFuture future(futureInterface.future()); + const SearchResultItems results = searchInContents(future, m_searchTerm, m_flags, item.filePath, + contents); if (!futureInterface.isCanceled()) { futureInterface.reportResult(results); futureInterface.setProgressValue(1); @@ -530,31 +331,15 @@ void cleanUpFileSearch(QFutureInterface &futureInterface, } // namespace -QFuture Utils::findInFiles(const QString &searchTerm, - FileIterator *files, - QTextDocument::FindFlags flags, +QFuture Utils::findInFiles(const QString &searchTerm, FileIterator *files, + FindFlags flags, const QMap &fileToContentsMap) { return mapReduce(files->begin(), files->end(), [searchTerm, files](QFutureInterface &futureInterface) { return initFileSearch(futureInterface, searchTerm, files); }, - FileSearch(searchTerm, flags, fileToContentsMap), - &collectSearchResults, - &cleanUpFileSearch); -} - -QFuture Utils::findInFilesRegExp( - const QString &searchTerm, - FileIterator *files, - QTextDocument::FindFlags flags, - const QMap &fileToContentsMap) -{ - return mapReduce(files->begin(), files->end(), - [searchTerm, files](QFutureInterface &futureInterface) { - return initFileSearch(futureInterface, searchTerm, files); - }, - FileSearchRegExp(searchTerm, flags, fileToContentsMap), + FileSearch{searchTerm, flags, fileToContentsMap}, &collectSearchResults, &cleanUpFileSearch); } diff --git a/src/libs/utils/filesearch.h b/src/libs/utils/filesearch.h index 664ccf02319..b0bd01c3362 100644 --- a/src/libs/utils/filesearch.h +++ b/src/libs/utils/filesearch.h @@ -171,15 +171,7 @@ private: }; QTCREATOR_UTILS_EXPORT QFuture findInFiles(const QString &searchTerm, - FileIterator *files, - QTextDocument::FindFlags flags, - const QMap &fileToContentsMap = {}); - -QTCREATOR_UTILS_EXPORT QFuture findInFilesRegExp( - const QString &searchTerm, - FileIterator *files, - QTextDocument::FindFlags flags, - const QMap &fileToContentsMap = {}); + FileIterator *files, FindFlags flags, const QMap &fileToContentsMap); QTCREATOR_UTILS_EXPORT QString expandRegExpReplacement(const QString &replaceText, const QStringList &capturedTexts); diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 2561bcfeb36..a98cd210826 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -54,14 +54,12 @@ public: QFuture executeSearch(const TextEditor::FileFindParameters ¶meters, BaseFileFind *baseFileFind) override { - const auto func = parameters.flags & FindRegularExpression ? Utils::findInFilesRegExp - : Utils::findInFiles; - - return func(parameters.text, - baseFileFind->files(parameters.nameFilters, parameters.exclusionFilters, - parameters.additionalParameters), - Utils::textDocumentFlagsForFindFlags(parameters.flags), - TextDocument::openedTextDocumentContents()); + return Utils::findInFiles(parameters.text, + baseFileFind->files(parameters.nameFilters, + parameters.exclusionFilters, + parameters.additionalParameters), + parameters.flags, + TextDocument::openedTextDocumentContents()); } Core::IEditor *openEditor(const SearchResultItem &/*item*/, diff --git a/tests/auto/filesearch/tst_filesearch.cpp b/tests/auto/filesearch/tst_filesearch.cpp index 95bec53e099..e4ce57b670f 100644 --- a/tests/auto/filesearch/tst_filesearch.cpp +++ b/tests/auto/filesearch/tst_filesearch.cpp @@ -11,12 +11,6 @@ using namespace Utils; class tst_FileSearch : public QObject { Q_OBJECT -public: - enum RegExpFlag { - NoRegExp, - RegExp - }; - private slots: void multipleResults(); void caseSensitive(); @@ -41,16 +35,12 @@ SearchResultItem searchResult(const FilePath &fileName, const QString &matchingL } void test_helper(const FilePath &filePath, const SearchResultItems &expectedResults, - const QString &term, QTextDocument::FindFlags flags = {}, - tst_FileSearch::RegExpFlag regexp = tst_FileSearch::NoRegExp) + const QString &term, Utils::FindFlags flags = {}) { FileIterator *it = new FileListIterator({filePath}, {QTextCodec::codecForLocale()}); QFutureWatcher watcher; QSignalSpy ready(&watcher, &QFutureWatcherBase::resultsReadyAt); - if (regexp == tst_FileSearch::NoRegExp) - watcher.setFuture(Utils::findInFiles(term, it, flags)); - else - watcher.setFuture(Utils::findInFilesRegExp(term, it, flags)); + watcher.setFuture(Utils::findInFiles(term, it, flags, {})); watcher.future().waitForFinished(); QTest::qWait(100); // process events QCOMPARE(ready.count(), 1); @@ -84,7 +74,7 @@ void tst_FileSearch::multipleResults() expectedResults << searchResult(m_filePath, "aaaaaaaa this line has 2 results for four a in a row", 5, 4, 4, {"aaaa"}); - test_helper(m_filePath, expectedResults, "aaaa", {}, RegExp); + test_helper(m_filePath, expectedResults, "aaaa", FindRegularExpression); } void tst_FileSearch::caseSensitive() @@ -92,7 +82,7 @@ void tst_FileSearch::caseSensitive() SearchResultItems expectedResults; expectedResults << searchResult(m_filePath, "search CaseSensitively for casesensitive", 3, 7, 13); - test_helper(m_filePath, expectedResults, "CaseSensitive", QTextDocument::FindCaseSensitively); + test_helper(m_filePath, expectedResults, "CaseSensitive", FindCaseSensitively); } void tst_FileSearch::caseInSensitive() From 3a75af37941105b3a72f9d15b079d4d4ae834c9a Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 19 May 2023 11:53:44 +0200 Subject: [PATCH 0007/1777] tst_SubDirFileIterator: Always generate ~700000 files And ~175000 directories. Distribute the generation and cleanup on all available cores. With this patch I get the following config / measurements (linux): Generating on 24 cores... Generating 698881 files... Generating 174721 dirs... Generating inside "/tmp/tst_manual_subdirfileiterator-eHVKTL" dir... GENERATING TEMPORARY FILES TREE stopped with timeout: 1777ms ITERATING with SubDirFileIterator stopped with timeout: 92744ms ITERATING with manual iterator stopped with timeout: 7905ms ITERATING with QDirIterator stopped with timeout: 4706ms CLEANING UP stopped with timeout: 1969ms Amends 686a40d199864c1b2e29defc1ba67fd73f5aaaf0 Change-Id: I7838e9cf73eae731a4dc3be02eeefa5caae8613d Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: Eike Ziller --- .../tst_subdirfileiterator.cpp | 136 ++++++++++-------- 1 file changed, 77 insertions(+), 59 deletions(-) diff --git a/tests/manual/subdirfileiterator/tst_subdirfileiterator.cpp b/tests/manual/subdirfileiterator/tst_subdirfileiterator.cpp index 66dd7737816..b00d3aa7f65 100644 --- a/tests/manual/subdirfileiterator/tst_subdirfileiterator.cpp +++ b/tests/manual/subdirfileiterator/tst_subdirfileiterator.cpp @@ -19,9 +19,10 @@ using namespace Tasking; using namespace Utils; -static const int s_subDirsCount = 8; -static const int s_subFilesCount = 8; -static const int s_treeDepth = 4; +static const int s_topLevelSubDirsCount = 128; +static const int s_subDirsCount = 4; +static const int s_subFilesCount = 4; +static const int s_treeDepth = 5; static const QDir::Filters s_filters = QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot; @@ -29,6 +30,16 @@ static const QDir::Filters s_filters = QDir::Dirs | QDir::Files | QDir::Hidden static const char s_dirPrefix[] = "dir_"; static const char s_filePrefix[] = "file_"; +static QString dirName(int suffix) +{ + return QString("%1%2").arg(s_dirPrefix).arg(suffix); +} + +static QString fileName(int suffix) +{ + return QString("%1%2.txt").arg(s_filePrefix).arg(suffix); +} + static int expectedDirsCountHelper(int depth) { if (depth == 1) @@ -36,9 +47,9 @@ static int expectedDirsCountHelper(int depth) return expectedDirsCountHelper(depth - 1) * s_subDirsCount + 1; // +1 -> dir itself } -static int expectedDirsCount(int tasksCount) +static int expectedDirsCount() { - return expectedDirsCountHelper(s_treeDepth) * tasksCount + 1; // +1 -> root temp dir + return expectedDirsCountHelper(s_treeDepth) * s_topLevelSubDirsCount; } static int expectedFilesCountHelper(int depth) @@ -48,45 +59,49 @@ static int expectedFilesCountHelper(int depth) return expectedFilesCountHelper(depth - 1) * s_subDirsCount + s_subFilesCount; } -static int expectedFilesCount(int tasksCount) +static int expectedFilesCount() { - return expectedFilesCountHelper(s_treeDepth) * tasksCount + 1; // +1 -> fileTemplate.txt + return expectedFilesCountHelper(s_treeDepth) * s_topLevelSubDirsCount + 1; // +1 -> fileTemplate.txt } -static void generate(QPromise &promise, const QString &parentPath, - const QString &templateFile, int depth) +static int threadsCount() +{ + return qMax(QThread::idealThreadCount() - 1, 1); // "- 1" -> left for main thread +} + +static bool generateOriginal(const QString &parentPath, const QString &templateFile, int depth) { const QDir parentDir(parentPath); for (int i = 0; i < s_subFilesCount; ++i) - QFile::copy(templateFile, parentDir.filePath(QString("%1%2").arg(s_filePrefix).arg(i))); + QFile::copy(templateFile, parentDir.filePath(fileName(i))); if (depth == 0) - return; + return true; - if (promise.isCanceled()) - return; + const QString originalDirName = dirName(0); + if (!parentDir.mkdir(originalDirName)) + return false; - const QString templateDir("dirTemplate"); - if (!parentDir.mkdir(templateDir)) { + const QString originalDirPath = parentDir.filePath(originalDirName); + if (!generateOriginal(originalDirPath, templateFile, depth - 1)) + return false; + + for (int i = 1; i < s_subDirsCount; ++i) { + const FilePath source = FilePath::fromString(originalDirPath); + const FilePath destination = FilePath::fromString(parentDir.filePath(dirName(i))); + if (!source.copyRecursively(destination)) + return false; + } + return true; +} + +static void generateCopy(QPromise &promise, const QString &sourcePath, + const QString &destPath) +{ + const FilePath source = FilePath::fromString(sourcePath); + const FilePath destination = FilePath::fromString(destPath); + if (!source.copyRecursively(destination)) promise.future().cancel(); - return; - } - - const QString templateDirPath = parentDir.filePath(templateDir); - generate(promise, templateDirPath, templateFile, depth - 1); - - if (promise.isCanceled()) - return; - - for (int i = 0; i < s_subDirsCount - 1; ++i) { - const QString dirName = QString("%1%2").arg(s_dirPrefix).arg(i); - const FilePath source = FilePath::fromString(templateDirPath); - const FilePath destination = FilePath::fromString(parentDir.filePath(dirName)); - if (!source.copyRecursively(destination)) { - promise.future().cancel(); - return; - } - } } class tst_SubDirFileIterator : public QObject @@ -106,11 +121,11 @@ private slots: qDebug() << "This manual test compares the performance of the SubDirFileIterator with " "a manually written iterator using QDir::entryInfoList()."; QTC_SCOPED_TIMER("GENERATING TEMPORARY FILES TREE"); - const int tasksCount = QThread::idealThreadCount(); - m_filesCount = expectedFilesCount(tasksCount); - m_dirsCount = expectedDirsCount(tasksCount); + m_threadsCount = threadsCount(); + m_filesCount = expectedFilesCount(); + m_dirsCount = expectedDirsCount(); m_tempDir.reset(new QTemporaryDir); - qDebug() << "Generating on" << tasksCount << "cores..."; + qDebug() << "Generating on" << m_threadsCount << "cores..."; qDebug() << "Generating" << m_filesCount << "files..."; qDebug() << "Generating" << m_dirsCount << "dirs..."; qDebug() << "Generating inside" << m_tempDir->path() << "dir..."; @@ -121,20 +136,25 @@ private slots: file.write("X"); } - // Parallelize tree generation const QDir parentDir(m_tempDir->path()); - const auto onSetup = [](const QString &parentPath, const QString &templateFile) { - return [parentPath, templateFile](Async &async) { - async.setConcurrentCallData(generate, parentPath, templateFile, s_treeDepth); + const QString sourceDirName = dirName(0); + QVERIFY(parentDir.mkdir(sourceDirName)); + QVERIFY(generateOriginal(parentDir.filePath(sourceDirName), templateFile, s_treeDepth)); + + const auto onCopySetup = [](const QString &sourcePath, const QString &destPath) { + return [sourcePath, destPath](Async &async) { + async.setConcurrentCallData(generateCopy, sourcePath, destPath); }; }; - QList tasks {parallel}; - for (int i = 0; i < tasksCount; ++i) { - const QString dirName = QString("%1%2").arg(s_dirPrefix).arg(i); - QVERIFY(parentDir.mkdir(dirName)); - tasks.append(AsyncTask(onSetup(parentDir.filePath(dirName), templateFile))); - } + // Parallelize tree generation + QList tasks{parallelLimit(m_threadsCount)}; + for (int i = 1; i < s_topLevelSubDirsCount; ++i) { + const QString destDirName = dirName(i); + QVERIFY(parentDir.mkdir(destDirName)); + tasks.append(AsyncTask(onCopySetup(parentDir.filePath(sourceDirName), + parentDir.filePath(destDirName)))); + } TaskTree taskTree(tasks); QVERIFY(taskTree.runBlocking()); } @@ -148,18 +168,15 @@ private slots: FilePath::fromString(parentPath).removeRecursively(); }; - const QDir parentDir(m_tempDir->path()); const auto onSetup = [removeTree](const QString &parentPath) { return [parentPath, removeTree](Async &async) { async.setConcurrentCallData(removeTree, parentPath); }; }; - QList tasks {parallel}; - const int tasksCount = QThread::idealThreadCount(); - for (int i = 0; i < tasksCount; ++i) { - const QString dirName = QString("%1%2").arg(s_dirPrefix).arg(i); - tasks.append(AsyncTask(onSetup(parentDir.filePath(dirName)))); - } + const QDir parentDir(m_tempDir->path()); + QList tasks {parallelLimit(m_threadsCount)}; + for (int i = 0; i < s_topLevelSubDirsCount; ++i) + tasks.append(AsyncTask(onSetup(parentDir.filePath(dirName(i))))); TaskTree taskTree(tasks); QVERIFY(taskTree.runBlocking()); @@ -184,7 +201,7 @@ private slots: qDebug() << filesCount << '/' << m_filesCount << "files visited so far..."; } } - qDebug() << "Visited" << filesCount << "files."; + QCOMPARE(filesCount, m_filesCount); } void testManualIterator() @@ -198,7 +215,6 @@ private slots: std::unordered_set visitedDirs; visitedDirs.emplace(root.absolutePath()); QFileInfoList workingList = root.entryInfoList(s_filters); - ++dirsCount; // for root itself while (!workingList.isEmpty()) { const QFileInfo fi = workingList.takeLast(); const QString absoluteFilePath = fi.absoluteFilePath(); @@ -220,7 +236,8 @@ private slots: } } } - qDebug() << "Visited" << filesCount << "files and" << dirsCount << "directories."; + QCOMPARE(filesCount, m_filesCount); + QCOMPARE(dirsCount, m_dirsCount); } void testQDirIterator() @@ -229,7 +246,6 @@ private slots: int filesCount = 0; int dirsCount = 0; { - ++dirsCount; // for root itself QDirIterator it(m_tempDir->path(), s_filters, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks); while (it.hasNext()) { @@ -248,10 +264,12 @@ private slots: } } } - qDebug() << "Visited" << filesCount << "files and" << dirsCount << "directories."; + QCOMPARE(filesCount, m_filesCount); + QCOMPARE(dirsCount, m_dirsCount); } private: + int m_threadsCount = 1; int m_dirsCount = 0; int m_filesCount = 0; std::unique_ptr m_tempDir; From 29811f81dcee8d9c2f0d608cb9d30ba42d7d0454 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Tue, 23 May 2023 17:34:59 +0200 Subject: [PATCH 0008/1777] FileSearch: Introduce FileContainer That's going to replace FileIterator. Benefits over FileIterator: 1. The FileContainer is a value type which may be freely copied. 2. Much faster iterating, especially for SubDirFileContainer with a big number of dirs / files (over 500000). The FileContainer has begin() and end() functions returning FileContainerIterator. The FileContainerIterator, when it's not an end() iterator, contains the Item's value itself. Whenever the iterator advances, the Item's value changes, while the reference to Item's value remains unchanged inside the iterator. The SubDirFileContainer doesn't keep the references to all visited Items anymore, contrary to the corresponding SubDirFileInterator. The values of the individually visited Items are kept only inside FileContainerIterator instances. The progress information is available through the FileContainerIterator's progressValue() / progressMaximum(). Task-number: QTCREATORBUG-28892 Change-Id: If89ac1121c21fa2fb7355aa12438dce3e85e465d Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: Marcus Tillmanns Reviewed-by: Eike Ziller --- src/libs/utils/filesearch.cpp | 202 +++++++++++++++++- src/libs/utils/filesearch.h | 97 +++++++++ .../tst_subdirfileiterator.cpp | 19 ++ 3 files changed, 310 insertions(+), 8 deletions(-) diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index 662448a7de3..7dd8951b91c 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -550,6 +550,196 @@ FileIterator::const_iterator FileIterator::end() const // #pragma mark -- FileListIterator +void FileContainerIterator::operator++() +{ + QTC_ASSERT(m_data.m_container, return); + QTC_ASSERT(m_data.m_index >= 0, return); + QTC_ASSERT(m_data.m_advancer, return); + m_data.m_advancer(&m_data); +} + +int FileContainerIterator::progressMaximum() const +{ + return m_data.m_container ? m_data.m_container->progressMaximum() : 0; +} + +static QList toFileListCache(const FilePaths &fileList, + const QList &encodings) +{ + QList items; + items.reserve(fileList.size()); + QTextCodec *defaultEncoding = QTextCodec::codecForLocale(); + for (int i = 0; i < fileList.size(); ++i) + items.append({fileList.at(i), encodings.value(i, defaultEncoding)}); + return items; +} + +static FileContainerIterator::Advancer fileListAdvancer( + const QList &items) +{ + return [items](FileContainerIterator::Data *iterator) { + ++iterator->m_index; + if (iterator->m_index >= items.size() || iterator->m_index < 0) { + iterator->m_value = {}; + iterator->m_index = -1; + iterator->m_progressValue = items.size(); + return; + } + iterator->m_value = items.at(iterator->m_index); + iterator->m_progressValue = iterator->m_index; + }; +} + +static FileContainer::AdvancerProvider fileListAdvancerProvider(const FilePaths &fileList, + const QList &encodings) +{ + const auto initialCache = toFileListCache(fileList, encodings); + return [=] { return fileListAdvancer(initialCache); }; +} + +FileListContainer::FileListContainer(const FilePaths &fileList, + const QList &encodings) + : FileContainer(fileListAdvancerProvider(fileList, encodings), fileList.size()) {} + +const int s_progressMaximum = 1000; + +struct SubDirCache +{ + SubDirCache(const FilePaths &directories, const QStringList &filters, + const QStringList &exclusionFilters, QTextCodec *encoding); + + std::optional updateCache(int advanceIntoIndex, + const SubDirCache &initialCache); + + std::function m_filterFiles; + QTextCodec *m_encoding = nullptr; + QStack m_dirs; + QSet m_knownDirs; + QStack m_progressValues; + QStack m_processedValues; + qreal m_progress = 0; + QList m_items; + // When forward iterating, we construct some results for the future iterations + // and keep them in m_items cache. Later, when we iterated over all from the cache, + // we don't want to keep the cache anymore, so we are clearing it. + // In order to match the iterator's index with the position inside m_items cache, + // we need to remember how many items were removed from the cache and subtract + // this value from the iterator's index when a new advance comes. + int m_removedItemsCount = 0; +}; + +SubDirCache::SubDirCache(const FilePaths &directories, const QStringList &filters, + const QStringList &exclusionFilters, QTextCodec *encoding) + : m_filterFiles(filterFilesFunction(filters, exclusionFilters)) + , m_encoding(encoding == nullptr ? QTextCodec::codecForLocale() : encoding) +{ + const qreal maxPer = qreal(s_progressMaximum) / directories.count(); + for (const FilePath &directoryEntry : directories) { + if (!directoryEntry.isEmpty()) { + const FilePath canonicalPath = directoryEntry.canonicalPath(); + if (!canonicalPath.isEmpty() && directoryEntry.exists()) { + m_dirs.push(directoryEntry); + m_knownDirs.insert(canonicalPath); + m_progressValues.push(maxPer); + m_processedValues.push(false); + } + } + } +} + +std::optional SubDirCache::updateCache(int advanceIntoIndex, + const SubDirCache &initialCache) +{ + QTC_ASSERT(advanceIntoIndex >= 0, return {}); + if (advanceIntoIndex < m_removedItemsCount) + *this = initialCache; // Regenerate the cache from scratch + const int currentIndex = advanceIntoIndex - m_removedItemsCount; + if (currentIndex < m_items.size()) + return m_items.at(currentIndex); + + m_removedItemsCount += m_items.size(); + m_items.clear(); + const int newCurrentIndex = advanceIntoIndex - m_removedItemsCount; + + while (!m_dirs.isEmpty() && newCurrentIndex >= m_items.size()) { + const FilePath dir = m_dirs.pop(); + const qreal dirProgressMax = m_progressValues.pop(); + const bool processed = m_processedValues.pop(); + if (dir.exists()) { + using Dir = FilePath; + using CanonicalDir = FilePath; + std::vector> subDirs; + if (!processed) { + const FilePaths entries = dir.dirEntries(QDir::Dirs | QDir::Hidden + | QDir::NoDotAndDotDot); + for (const FilePath &entry : entries) { + const FilePath canonicalDir = entry.canonicalPath(); + if (!m_knownDirs.contains(canonicalDir)) + subDirs.emplace_back(entry, canonicalDir); + } + } + if (subDirs.empty()) { + const FilePaths allFilePaths = dir.dirEntries(QDir::Files | QDir::Hidden); + const FilePaths filePaths = m_filterFiles(allFilePaths); + m_items.reserve(m_items.size() + filePaths.size()); + Utils::reverseForeach(filePaths, [this](const FilePath &file) { + m_items.append({file, m_encoding}); + }); + m_progress += dirProgressMax; + } else { + const qreal subProgress = dirProgressMax / (subDirs.size() + 1); + m_dirs.push(dir); + m_progressValues.push(subProgress); + m_processedValues.push(true); + Utils::reverseForeach(subDirs, + [this, subProgress](const std::pair &dir) { + m_dirs.push(dir.first); + m_knownDirs.insert(dir.second); + m_progressValues.push(subProgress); + m_processedValues.push(false); + }); + } + } else { + m_progress += dirProgressMax; + } + } + if (newCurrentIndex < m_items.size()) + return m_items.at(newCurrentIndex); + + m_progress = s_progressMaximum; + return {}; +} + +static FileContainerIterator::Advancer subDirAdvancer(const SubDirCache &initialCache) +{ + const std::shared_ptr sharedCache(new SubDirCache(initialCache)); + return [=](FileContainerIterator::Data *iterator) { + ++iterator->m_index; + const std::optional item + = sharedCache->updateCache(iterator->m_index, initialCache); + if (!item) { + iterator->m_value = {}; + iterator->m_index = -1; + iterator->m_progressValue = s_progressMaximum; + return; + } + iterator->m_value = *item; + iterator->m_progressValue = qMin(qRound(sharedCache->m_progress), s_progressMaximum); + }; +} + +static FileContainer::AdvancerProvider subDirAdvancerProvider(const FilePaths &directories, + const QStringList &filters, const QStringList &exclusionFilters, QTextCodec *encoding) +{ + const SubDirCache initialCache(directories, filters, exclusionFilters, encoding); + return [=] { return subDirAdvancer(initialCache); }; +} + +SubDirFileContainer::SubDirFileContainer(const FilePaths &directories, const QStringList &filters, + const QStringList &exclusionFilters, QTextCodec *encoding) + : FileContainer(subDirAdvancerProvider(directories, filters, exclusionFilters, encoding), + s_progressMaximum) {} + QList constructItems(const FilePaths &fileList, const QList &encodings) { @@ -594,10 +784,6 @@ int FileListIterator::currentProgress() const // #pragma mark -- SubDirFileIterator -namespace { - const int MAX_PROGRESS = 1000; -} - SubDirFileIterator::SubDirFileIterator(const FilePaths &directories, const QStringList &filters, const QStringList &exclusionFilters, @@ -606,7 +792,7 @@ SubDirFileIterator::SubDirFileIterator(const FilePaths &directories, , m_progress(0) { m_encoding = (encoding == nullptr ? QTextCodec::codecForLocale() : encoding); - qreal maxPer = qreal(MAX_PROGRESS) / directories.count(); + qreal maxPer = qreal(s_progressMaximum) / directories.count(); for (const FilePath &directoryEntry : directories) { if (!directoryEntry.isEmpty()) { const FilePath canonicalPath = directoryEntry.canonicalPath(); @@ -672,7 +858,7 @@ void SubDirFileIterator::update(int index) } } if (index >= m_items.size()) - m_progress = MAX_PROGRESS; + m_progress = s_progressMaximum; } int SubDirFileIterator::currentFileCount() const @@ -687,12 +873,12 @@ const FileIterator::Item &SubDirFileIterator::itemAt(int index) const int SubDirFileIterator::maxProgress() const { - return MAX_PROGRESS; + return s_progressMaximum; } int SubDirFileIterator::currentProgress() const { - return qMin(qRound(m_progress), MAX_PROGRESS); + return qMin(qRound(m_progress), s_progressMaximum); } } diff --git a/src/libs/utils/filesearch.h b/src/libs/utils/filesearch.h index b0bd01c3362..81c5e2b8cd1 100644 --- a/src/libs/utils/filesearch.h +++ b/src/libs/utils/filesearch.h @@ -61,6 +61,103 @@ enum class InclusionType { QTCREATOR_UTILS_EXPORT QString msgFilePatternToolTip(InclusionType inclusionType = InclusionType::Included); +class FileContainer; + +class QTCREATOR_UTILS_EXPORT FileContainerIterator +{ +public: + class Item + { + public: + FilePath filePath {}; + QTextCodec *encoding = nullptr; + }; + + class Data; + using Advancer = std::function; + + class Data + { + public: + const FileContainer *m_container = nullptr; + int m_progressValue = 0; + Advancer m_advancer = {}; + int m_index = -1; // end iterator + Item m_value = {}; + }; + + using value_type = Item; + using pointer = const value_type *; + using reference = const value_type &; + using iterator_category = std::forward_iterator_tag; + using difference_type = std::ptrdiff_t; + + FileContainerIterator() = default; + + reference operator*() const { return m_data.m_value; } + pointer operator->() const { return &m_data.m_value; } + void operator++(); + + bool operator==(const FileContainerIterator &other) const { + return m_data.m_container == other.m_data.m_container + && m_data.m_index == other.m_data.m_index; + } + bool operator!=(const FileContainerIterator &other) const { return !operator==(other); } + int progressValue() const { return m_data.m_progressValue; } + int progressMaximum() const; + +private: + friend class FileContainer; + FileContainerIterator(const Data &data) : m_data(data) {} + Data m_data; +}; + +class QTCREATOR_UTILS_EXPORT FileContainer +{ +public: + using AdvancerProvider = std::function; + + FileContainer() = default; + + FileContainerIterator begin() const { + if (!m_provider) + return end(); + const FileContainerIterator::Advancer advancer = m_provider(); + if (!advancer) + return end(); + FileContainerIterator iterator({this, 0, advancer}); + advancer(&iterator.m_data); + return iterator; + } + FileContainerIterator end() const { return FileContainerIterator({this, m_progressMaximum}); } + int progressMaximum() const { return m_progressMaximum; } + +protected: + FileContainer(const AdvancerProvider &provider, int progressMaximum) + : m_provider(provider) + , m_progressMaximum(progressMaximum) {} + +private: + friend class FileContainerIterator; + AdvancerProvider m_provider; + int m_progressMaximum = 0; +}; + +class QTCREATOR_UTILS_EXPORT FileListContainer : public FileContainer +{ +public: + FileListContainer(const FilePaths &fileList, const QList &encodings); +}; + +class QTCREATOR_UTILS_EXPORT SubDirFileContainer : public FileContainer +{ +public: + SubDirFileContainer(const FilePaths &directories, + const QStringList &filters, + const QStringList &exclusionFilters, + QTextCodec *encoding = nullptr); +}; + class QTCREATOR_UTILS_EXPORT FileIterator { public: diff --git a/tests/manual/subdirfileiterator/tst_subdirfileiterator.cpp b/tests/manual/subdirfileiterator/tst_subdirfileiterator.cpp index b00d3aa7f65..55312208e8a 100644 --- a/tests/manual/subdirfileiterator/tst_subdirfileiterator.cpp +++ b/tests/manual/subdirfileiterator/tst_subdirfileiterator.cpp @@ -204,6 +204,25 @@ private slots: QCOMPARE(filesCount, m_filesCount); } + void testSubDirFileContainer() + { + QTC_SCOPED_TIMER("ITERATING with FileContainer"); + int filesCount = 0; + { + const FilePath root(FilePath::fromString(m_tempDir->path())); + FileContainer container = SubDirFileContainer({root}, {}, {}); + auto it = container.begin(); + const auto end = container.end(); + while (it != end) { + ++filesCount; + ++it; + if (filesCount % 100000 == 0) + qDebug() << filesCount << '/' << m_filesCount << "files visited so far..."; + } + } + QCOMPARE(filesCount, m_filesCount); + } + void testManualIterator() { QTC_SCOPED_TIMER("ITERATING with manual iterator"); From 80665d6acf6cf5eb284c5f3e6f956d9932bcece0 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Tue, 6 Jun 2023 10:21:49 +0200 Subject: [PATCH 0009/1777] Fix master build Amend a78720060eb71b6e647eb8864b40dc6c0db48a2b Change-Id: I179fac4a604a6e582fd289ac972068b74ef4288f Reviewed-by: Jarek Kobus --- src/plugins/help/webenginehelpviewer.cpp | 6 +++--- src/plugins/help/webenginehelpviewer.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/help/webenginehelpviewer.cpp b/src/plugins/help/webenginehelpviewer.cpp index 15a9eb9fafb..ec8929bff77 100644 --- a/src/plugins/help/webenginehelpviewer.cpp +++ b/src/plugins/help/webenginehelpviewer.cpp @@ -219,7 +219,7 @@ void WebEngineHelpViewer::addForwardHistoryItems(QMenu *forwardMenu) } } -bool WebEngineHelpViewer::findText(const QString &text, Core::FindFlags flags, bool incremental, +bool WebEngineHelpViewer::findText(const QString &text, Utils::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped) { Q_UNUSED(incremental) @@ -227,9 +227,9 @@ bool WebEngineHelpViewer::findText(const QString &text, Core::FindFlags flags, b if (wrapped) *wrapped = false; // missing feature in QWebEngine QWebEnginePage::FindFlags webEngineFlags; - if (flags & Core::FindBackward) + if (flags & Utils::FindBackward) webEngineFlags |= QWebEnginePage::FindBackward; - if (flags & Core::FindCaseSensitively) + if (flags & Utils::FindCaseSensitively) webEngineFlags |= QWebEnginePage::FindCaseSensitively; // QWebEngineView's findText is asynchronous, and the variant taking a callback runs the // callback on the main thread, so blocking here becomes ugly too diff --git a/src/plugins/help/webenginehelpviewer.h b/src/plugins/help/webenginehelpviewer.h index 0ecfc58a4d9..6f810f8769b 100644 --- a/src/plugins/help/webenginehelpviewer.h +++ b/src/plugins/help/webenginehelpviewer.h @@ -71,7 +71,7 @@ public: bool isBackwardAvailable() const override; void addBackHistoryItems(QMenu *backMenu) override; void addForwardHistoryItems(QMenu *forwardMenu) override; - bool findText(const QString &text, Core::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped) override; + bool findText(const QString &text, Utils::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped) override; WebEngineHelpPage *page() const; From ac24b23ff8ec5a2a211e7efba048face5fed9372 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Thu, 11 May 2023 11:34:08 +0200 Subject: [PATCH 0010/1777] ClangFormat: Add file size threshold Add file size threshold to prevent qtcreator freeze when a file is big. The default value is 1MB. Change-Id: I356c64cd5ca99a34413043896076dbab859538b6 Reviewed-by: Christian Kandeler Reviewed-by: --- .../clangformat/clangformatconstants.h | 1 + .../clangformatglobalconfigwidget.cpp | 31 ++++++++++++++++++- .../clangformatglobalconfigwidget.h | 4 +++ .../clangformat/clangformatindenter.cpp | 3 +- .../clangformat/clangformatsettings.cpp | 13 ++++++++ src/plugins/clangformat/clangformatsettings.h | 4 +++ 6 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/plugins/clangformat/clangformatconstants.h b/src/plugins/clangformat/clangformatconstants.h index 5bd8b1246c3..572effee21e 100644 --- a/src/plugins/clangformat/clangformatconstants.h +++ b/src/plugins/clangformat/clangformatconstants.h @@ -13,6 +13,7 @@ static const char OVERRIDE_FILE_ID[] = "ClangFormat.OverrideFile"; static const char FORMAT_CODE_ON_SAVE_ID[] = "ClangFormat.FormatCodeOnSave"; static const char FORMAT_WHILE_TYPING_ID[] = "ClangFormat.FormatWhileTyping"; static const char MODE_ID[] = "ClangFormat.Mode"; +static const char FILE_SIZE_THREDSHOLD[] = "ClangFormat.FileSizeThreshold"; static const char USE_GLOBAL_SETTINGS[] = "ClangFormat.UseGlobalSettings"; static const char OPEN_CURRENT_CONFIG_ID[] = "ClangFormat.OpenCurrentConfig"; } // namespace Constants diff --git a/src/plugins/clangformat/clangformatglobalconfigwidget.cpp b/src/plugins/clangformat/clangformatglobalconfigwidget.cpp index af8a0846b15..d8533f268c7 100644 --- a/src/plugins/clangformat/clangformatglobalconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatglobalconfigwidget.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -31,8 +32,14 @@ ClangFormatGlobalConfigWidget::ClangFormatGlobalConfigWidget( , m_project(project) , m_codeStyle(codeStyle) { + const QString sizeThresholdToolTip = Tr::tr( + "Files greater than this will not be indented by ClangFormat.\n" + "The built-in code indenter will handle indentation."); + m_projectHasClangFormat = new QLabel(this); m_formattingModeLabel = new QLabel(Tr::tr("Formatting mode:")); + m_fileSizeThresholdLabel = new QLabel(Tr::tr("Ignore files greater than:")); + m_fileSizeThresholdSpinBox = new QSpinBox(this); m_indentingOrFormatting = new QComboBox(this); m_formatWhileTyping = new QCheckBox(Tr::tr("Format while typing")); m_formatOnSave = new QCheckBox(Tr::tr("Format edited code on file save")); @@ -50,7 +57,10 @@ ClangFormatGlobalConfigWidget::ClangFormatGlobalConfigWidget( title(Tr::tr("ClangFormat settings:")), Column { m_useGlobalSettings, - Row { m_formattingModeLabel, m_indentingOrFormatting, st }, + Form { + m_formattingModeLabel, m_indentingOrFormatting, st, br, + m_fileSizeThresholdLabel, m_fileSizeThresholdSpinBox, st, br + }, m_formatWhileTyping, m_formatOnSave, m_projectHasClangFormat, @@ -67,6 +77,7 @@ ClangFormatGlobalConfigWidget::ClangFormatGlobalConfigWidget( initIndentationOrFormattingCombobox(); initOverrideCheckBox(); initUseGlobalSettingsCheckBox(); + initFileSizeThresholdSpinBox(); if (project) { m_formattingModeLabel->hide(); @@ -139,6 +150,23 @@ void ClangFormatGlobalConfigWidget::initUseGlobalSettingsCheckBox() }); } +void ClangFormatGlobalConfigWidget::initFileSizeThresholdSpinBox() +{ + m_fileSizeThresholdSpinBox->setMinimum(1); + m_fileSizeThresholdSpinBox->setMaximum(std::numeric_limits::max()); + m_fileSizeThresholdSpinBox->setSuffix(" KB"); + m_fileSizeThresholdSpinBox->setValue(ClangFormatSettings::instance().fileSizeThreshold()); + if (m_project) + m_fileSizeThresholdSpinBox->hide(); + + connect(m_indentingOrFormatting, &QComboBox::currentIndexChanged, this, [this](int index) { + m_fileSizeThresholdLabel->setEnabled( + index != static_cast(ClangFormatSettings::Mode::Disable)); + m_fileSizeThresholdSpinBox->setEnabled( + index != static_cast(ClangFormatSettings::Mode::Disable)); + }); +} + bool ClangFormatGlobalConfigWidget::projectClangFormatFileExists() { llvm::Expected styleFromProjectFolder @@ -215,6 +243,7 @@ void ClangFormatGlobalConfigWidget::apply() settings.setMode( static_cast(m_indentingOrFormatting->currentIndex())); settings.setOverrideDefaultFile(m_overrideDefault->isChecked()); + settings.setFileSizeThreshold(m_fileSizeThresholdSpinBox->value()); m_overrideDefaultFile = m_overrideDefault->isChecked(); } settings.write(); diff --git a/src/plugins/clangformat/clangformatglobalconfigwidget.h b/src/plugins/clangformat/clangformatglobalconfigwidget.h index 7b2d6fe7c9c..e4a7be50478 100644 --- a/src/plugins/clangformat/clangformatglobalconfigwidget.h +++ b/src/plugins/clangformat/clangformatglobalconfigwidget.h @@ -13,6 +13,7 @@ QT_BEGIN_NAMESPACE class QCheckBox; class QComboBox; class QLabel; +class QSpinBox; QT_END_NAMESPACE namespace ProjectExplorer { class Project; } @@ -37,6 +38,7 @@ private: void initIndentationOrFormattingCombobox(); void initOverrideCheckBox(); void initUseGlobalSettingsCheckBox(); + void initFileSizeThresholdSpinBox(); bool projectClangFormatFileExists(); @@ -47,6 +49,8 @@ private: QLabel *m_projectHasClangFormat; QLabel *m_formattingModeLabel; + QLabel *m_fileSizeThresholdLabel; + QSpinBox *m_fileSizeThresholdSpinBox; QComboBox *m_indentingOrFormatting; QCheckBox *m_formatWhileTyping; QCheckBox *m_formatOnSave; diff --git a/src/plugins/clangformat/clangformatindenter.cpp b/src/plugins/clangformat/clangformatindenter.cpp index 67d5171b010..35f0c8b1ede 100644 --- a/src/plugins/clangformat/clangformatindenter.cpp +++ b/src/plugins/clangformat/clangformatindenter.cpp @@ -130,7 +130,8 @@ TextEditor::Indenter *ClangFormatForwardingIndenter::currentIndenter() const { ClangFormatSettings::Mode mode = getCurrentIndentationOrFormattingSettings(m_fileName); - if (mode == ClangFormatSettings::Disable) + if (mode == ClangFormatSettings::Disable + || m_fileName.fileSize() >= ClangFormatSettings::instance().fileSizeThreshold() * 1024) return m_cppIndenter.get(); return m_clangFormatIndenter.get(); diff --git a/src/plugins/clangformat/clangformatsettings.cpp b/src/plugins/clangformat/clangformatsettings.cpp index 4f4ea8ac232..1c76d14df6b 100644 --- a/src/plugins/clangformat/clangformatsettings.cpp +++ b/src/plugins/clangformat/clangformatsettings.cpp @@ -25,6 +25,8 @@ ClangFormatSettings::ClangFormatSettings() .toBool(); m_formatOnSave = settings->value(QLatin1String(Constants::FORMAT_CODE_ON_SAVE_ID), false) .toBool(); + m_fileSizeThreshold + = settings->value(QLatin1String(Constants::FILE_SIZE_THREDSHOLD), 1024).toInt(); // Convert old settings to new ones. New settings were added to QtC 8.0 bool isOldFormattingOn @@ -51,6 +53,7 @@ void ClangFormatSettings::write() const settings->setValue(QLatin1String(Constants::FORMAT_WHILE_TYPING_ID), m_formatWhileTyping); settings->setValue(QLatin1String(Constants::FORMAT_CODE_ON_SAVE_ID), m_formatOnSave); settings->setValue(QLatin1String(Constants::MODE_ID), static_cast(m_mode)); + settings->setValue(QLatin1String(Constants::FILE_SIZE_THREDSHOLD), m_fileSizeThreshold); settings->endGroup(); } @@ -94,4 +97,14 @@ ClangFormatSettings::Mode ClangFormatSettings::mode() const return m_mode; } +void ClangFormatSettings::setFileSizeThreshold(int fileSizeInKb) +{ + m_fileSizeThreshold = fileSizeInKb; +} + +int ClangFormatSettings::fileSizeThreshold() const +{ + return m_fileSizeThreshold; +} + } // namespace ClangFormat diff --git a/src/plugins/clangformat/clangformatsettings.h b/src/plugins/clangformat/clangformatsettings.h index c2ce53f4c76..07e854df461 100644 --- a/src/plugins/clangformat/clangformatsettings.h +++ b/src/plugins/clangformat/clangformatsettings.h @@ -33,11 +33,15 @@ public: void setFormatOnSave(bool enable); bool formatOnSave() const; + void setFileSizeThreshold(int fileSizeInKb); + int fileSizeThreshold() const; + private: Mode m_mode; bool m_overrideDefaultFile = false; bool m_formatWhileTyping = false; bool m_formatOnSave = false; + int m_fileSizeThreshold = 1024; }; } // namespace ClangFormat From 27b630c3abe9c710055dfcfd7769b7684a497d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 7 Jun 2023 02:10:07 +0200 Subject: [PATCH 0011/1777] Replace Q_OS_OSX with Q_OS_MACOS Change-Id: Ibee0c259d7df86a8df58b1ad12549b145f715397 Reviewed-by: Qt CI Bot Reviewed-by: Eike Ziller --- .../qmlpuppetcommunication/container/sharedmemory_unix.cpp | 4 ++-- src/libs/utils/dropsupport.cpp | 2 +- src/libs/utils/processhandle.cpp | 2 +- src/plugins/coreplugin/windowsupport.cpp | 2 +- tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libs/qmlpuppetcommunication/container/sharedmemory_unix.cpp b/src/libs/qmlpuppetcommunication/container/sharedmemory_unix.cpp index fce49841803..76b93a3c4f9 100644 --- a/src/libs/qmlpuppetcommunication/container/sharedmemory_unix.cpp +++ b/src/libs/qmlpuppetcommunication/container/sharedmemory_unix.cpp @@ -15,7 +15,7 @@ #include #include -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include #endif #include @@ -326,7 +326,7 @@ bool SharedMemory::createInternal(QSharedMemory::AccessMode mode, size_t size) { detachInternal(); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS if (m_fileHandle > -1 && m_createdByMe) { close(m_fileHandle); shm_unlink(m_nativeKey.constData()); diff --git a/src/libs/utils/dropsupport.cpp b/src/libs/utils/dropsupport.cpp index 6def3fd1aff..9bb86f5caf1 100644 --- a/src/libs/utils/dropsupport.cpp +++ b/src/libs/utils/dropsupport.cpp @@ -10,7 +10,7 @@ #include #include -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // for file drops from Finder, working around QTBUG-40449 #include "fileutils_mac.h" #endif diff --git a/src/libs/utils/processhandle.cpp b/src/libs/utils/processhandle.cpp index 06850457d37..c27e8a70db6 100644 --- a/src/libs/utils/processhandle.cpp +++ b/src/libs/utils/processhandle.cpp @@ -47,7 +47,7 @@ bool ProcessHandle::equals(const ProcessHandle &rhs) const return m_pid == rhs.m_pid; } -#ifndef Q_OS_OSX +#ifndef Q_OS_MACOS bool ProcessHandle::activate() { return false; diff --git a/src/plugins/coreplugin/windowsupport.cpp b/src/plugins/coreplugin/windowsupport.cpp index fd80fe23181..220df7fe5bc 100644 --- a/src/plugins/coreplugin/windowsupport.cpp +++ b/src/plugins/coreplugin/windowsupport.cpp @@ -146,7 +146,7 @@ WindowList::~WindowList() void WindowList::addWindow(QWidget *window) { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS if (!m_dockMenu) { m_dockMenu = new QMenu; m_dockMenu->setAsDockMenu(); diff --git a/tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp b/tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp index f3618841c8d..abf5bd5c068 100644 --- a/tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp +++ b/tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp @@ -33,7 +33,7 @@ static QJsonObject metaData(const QString &fileName) static QString libraryName(const QString &basename) { -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) return QLatin1String("lib") + basename + QLatin1String("_debug.dylib"); #elif defined(Q_OS_UNIX) return QLatin1String("lib") + basename + QLatin1String(".so"); From c276a896b8d7f8eff6f63b8cf283c0e28ed0301b Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 7 Jun 2023 10:47:13 +0200 Subject: [PATCH 0012/1777] AndroidSdkDownloader: Do some reformatting Use #pragma once. Use Android::Internal namespace. Change-Id: Ic5ceef259fb2c333448f2ed48a10645d6945c029 Reviewed-by: Alessandro Portale --- src/plugins/android/androidsdkdownloader.cpp | 10 +++------- src/plugins/android/androidsdkdownloader.h | 11 +++-------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp index f975ecbd589..a4c8c9eff60 100644 --- a/src/plugins/android/androidsdkdownloader.cpp +++ b/src/plugins/android/androidsdkdownloader.cpp @@ -16,12 +16,9 @@ using namespace Utils; -namespace { -Q_LOGGING_CATEGORY(sdkDownloaderLog, "qtc.android.sdkDownloader", QtWarningMsg) -} +namespace { Q_LOGGING_CATEGORY(sdkDownloaderLog, "qtc.android.sdkDownloader", QtWarningMsg) } -namespace Android { -namespace Internal { +namespace Android::Internal { /** * @class SdkDownloader * @brief Download Android SDK tools package from within Qt Creator. @@ -194,5 +191,4 @@ void AndroidSdkDownloader::downloadFinished(QNetworkReply *reply) reply->deleteLater(); } -} // Internal -} // Android +} // namespace Android::Internal diff --git a/src/plugins/android/androidsdkdownloader.h b/src/plugins/android/androidsdkdownloader.h index ac1eef76070..3f14622ec5d 100644 --- a/src/plugins/android/androidsdkdownloader.h +++ b/src/plugins/android/androidsdkdownloader.h @@ -1,8 +1,7 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#ifndef ANDROIDSDKDOWNLOADER_H -#define ANDROIDSDKDOWNLOADER_H +#pragma once #include "androidconfigurations.h" @@ -15,8 +14,7 @@ class Archive; class FilePath; } -namespace Android { -namespace Internal { +namespace Android::Internal { class AndroidSdkDownloader : public QObject { @@ -57,7 +55,4 @@ private: std::unique_ptr m_archive; }; -} // Internal -} // Android - -#endif // ANDROIDSDKDOWNLOADER_H +} // namespace Android::Internal From 34ef7d4150c8df77f21bb2323225ac21282b3fdf Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 7 Jun 2023 10:55:28 +0200 Subject: [PATCH 0013/1777] AndroidSdkDownloader: Use Utils::NetworkAccessManager Change-Id: Idd245f578ead0f22e457f9571441a4d9c9a1ce40 Reviewed-by: Alessandro Portale Reviewed-by: Qt CI Bot --- src/plugins/android/androidsdkdownloader.cpp | 26 +++++++++++--------- src/plugins/android/androidsdkdownloader.h | 3 +-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp index a4c8c9eff60..d284ce857fa 100644 --- a/src/plugins/android/androidsdkdownloader.cpp +++ b/src/plugins/android/androidsdkdownloader.cpp @@ -7,6 +7,7 @@ #include #include +#include #include @@ -25,9 +26,7 @@ namespace Android::Internal { */ AndroidSdkDownloader::AndroidSdkDownloader() : m_androidConfig(AndroidConfigurations::currentConfig()) -{ - connect(&m_manager, &QNetworkAccessManager::finished, this, &AndroidSdkDownloader::downloadFinished); -} +{} AndroidSdkDownloader::~AndroidSdkDownloader() = default; @@ -47,8 +46,9 @@ void AndroidSdkDownloader::downloadAndExtractSdk() return; } - QNetworkRequest request(m_androidConfig.sdkToolsUrl()); - m_reply = m_manager.get(request); + const QNetworkRequest request(m_androidConfig.sdkToolsUrl()); + m_reply = NetworkAccessManager::instance()->get(request); + connect(m_reply, &QNetworkReply::finished, this, &AndroidSdkDownloader::downloadFinished); #if QT_CONFIG(ssl) connect(m_reply, &QNetworkReply::sslErrors, this, &AndroidSdkDownloader::sslErrors); @@ -110,6 +110,7 @@ void AndroidSdkDownloader::cancel() if (m_reply) { m_reply->abort(); m_reply->deleteLater(); + m_reply = nullptr; } if (m_progressDialog) m_progressDialog->cancel(); @@ -169,18 +170,18 @@ bool AndroidSdkDownloader::isHttpRedirect(QNetworkReply *reply) || statusCode == 307 || statusCode == 308; } -void AndroidSdkDownloader::downloadFinished(QNetworkReply *reply) +void AndroidSdkDownloader::downloadFinished() { - QUrl url = reply->url(); - if (reply->error()) { + QUrl url = m_reply->url(); + if (m_reply->error()) { cancelWithError(QString(Tr::tr("Downloading Android SDK Tools from URL %1 has failed: %2.")) - .arg(url.toString(), reply->errorString())); + .arg(url.toString(), m_reply->errorString())); } else { - if (isHttpRedirect(reply)) { + if (isHttpRedirect(m_reply)) { cancelWithError(QString(Tr::tr("Download from %1 was redirected.")).arg(url.toString())); } else { m_sdkFilename = getSaveFilename(url); - if (saveToDisk(m_sdkFilename, reply) && verifyFileIntegrity()) + if (saveToDisk(m_sdkFilename, m_reply) && verifyFileIntegrity()) emit sdkPackageWriteFinished(); else cancelWithError( @@ -188,7 +189,8 @@ void AndroidSdkDownloader::downloadFinished(QNetworkReply *reply) } } - reply->deleteLater(); + m_reply->deleteLater(); + m_reply = nullptr; } } // namespace Android::Internal diff --git a/src/plugins/android/androidsdkdownloader.h b/src/plugins/android/androidsdkdownloader.h index 3f14622ec5d..e8c5106679c 100644 --- a/src/plugins/android/androidsdkdownloader.h +++ b/src/plugins/android/androidsdkdownloader.h @@ -42,12 +42,11 @@ private: void cancelWithError(const QString &error); void logError(const QString &error); - void downloadFinished(QNetworkReply *m_reply); + void downloadFinished(); #if QT_CONFIG(ssl) void sslErrors(const QList &errors); #endif - QNetworkAccessManager m_manager; QNetworkReply *m_reply = nullptr; Utils::FilePath m_sdkFilename; QProgressDialog *m_progressDialog = nullptr; From 6cc325f845b1ed2df3d28271146919c158f003d3 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 7 Jun 2023 11:09:19 +0200 Subject: [PATCH 0014/1777] AndroidSdkDownloader: Move private static methods into cpp Adapt their API, when needed. Change-Id: I2fd0a5673f5b0e83442cb800299980dc0f28832e Reviewed-by: Qt CI Bot Reviewed-by: Jarek Kobus --- src/plugins/android/androidsdkdownloader.cpp | 117 +++++++++---------- src/plugins/android/androidsdkdownloader.h | 5 - 2 files changed, 58 insertions(+), 64 deletions(-) diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp index d284ce857fa..4c7963bb95a 100644 --- a/src/plugins/android/androidsdkdownloader.cpp +++ b/src/plugins/android/androidsdkdownloader.cpp @@ -30,6 +30,55 @@ AndroidSdkDownloader::AndroidSdkDownloader() AndroidSdkDownloader::~AndroidSdkDownloader() = default; +static bool isHttpRedirect(QNetworkReply *reply) +{ + int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + return statusCode == 301 || statusCode == 302 || statusCode == 303 || statusCode == 305 + || statusCode == 307 || statusCode == 308; +} + +static FilePath sdkFromUrl(const QUrl &url) +{ + QString path = url.path(); + QString basename = QFileInfo(path).fileName(); + + if (basename.isEmpty()) + basename = "sdk-tools.zip"; + + if (QFile::exists(basename)) { + int i = 0; + basename += '.'; + while (QFile::exists(basename + QString::number(i))) + ++i; + basename += QString::number(i); + } + + return FilePath::fromString(QStandardPaths::writableLocation(QStandardPaths::TempLocation)) + / basename; +} + +static std::optional saveToDisk(const FilePath &filename, QIODevice *data) +{ + QFile file(filename.toString()); + if (!file.open(QIODevice::WriteOnly)) { + return Tr::tr("Could not open %1 for writing: %2.") + .arg(filename.toUserOutput(), file.errorString()); + } + file.write(data->readAll()); + return {}; +} + +static bool verifyFileIntegrity(const FilePath fileName, const QByteArray &sha256) +{ + QFile file(fileName.toString()); + if (file.open(QFile::ReadOnly)) { + QCryptographicHash hash(QCryptographicHash::Sha256); + if (hash.addData(&file)) + return hash.result() == sha256; + } + return false; +} + #if QT_CONFIG(ssl) void AndroidSdkDownloader::sslErrors(const QList &sslErrors) { @@ -88,18 +137,6 @@ void AndroidSdkDownloader::downloadAndExtractSdk() }); } -bool AndroidSdkDownloader::verifyFileIntegrity() -{ - QFile f(m_sdkFilename.toString()); - if (f.open(QFile::ReadOnly)) { - QCryptographicHash hash(QCryptographicHash::Sha256); - if (hash.addData(&f)) { - return hash.result() == m_androidConfig.getSdkToolsSha256(); - } - } - return false; -} - QString AndroidSdkDownloader::dialogTitle() { return Tr::tr("Download SDK Tools"); @@ -128,48 +165,6 @@ void AndroidSdkDownloader::logError(const QString &error) emit sdkDownloaderError(error); } -FilePath AndroidSdkDownloader::getSaveFilename(const QUrl &url) -{ - QString path = url.path(); - QString basename = QFileInfo(path).fileName(); - - if (basename.isEmpty()) - basename = "sdk-tools.zip"; - - if (QFile::exists(basename)) { - int i = 0; - basename += '.'; - while (QFile::exists(basename + QString::number(i))) - ++i; - basename += QString::number(i); - } - - return FilePath::fromString(QStandardPaths::writableLocation(QStandardPaths::TempLocation)) - / basename; -} - -bool AndroidSdkDownloader::saveToDisk(const FilePath &filename, QIODevice *data) -{ - QFile file(filename.toString()); - if (!file.open(QIODevice::WriteOnly)) { - logError(QString(Tr::tr("Could not open %1 for writing: %2.")) - .arg(filename.toUserOutput(), file.errorString())); - return false; - } - - file.write(data->readAll()); - file.close(); - - return true; -} - -bool AndroidSdkDownloader::isHttpRedirect(QNetworkReply *reply) -{ - int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); - return statusCode == 301 || statusCode == 302 || statusCode == 303 || statusCode == 305 - || statusCode == 307 || statusCode == 308; -} - void AndroidSdkDownloader::downloadFinished() { QUrl url = m_reply->url(); @@ -180,12 +175,16 @@ void AndroidSdkDownloader::downloadFinished() if (isHttpRedirect(m_reply)) { cancelWithError(QString(Tr::tr("Download from %1 was redirected.")).arg(url.toString())); } else { - m_sdkFilename = getSaveFilename(url); - if (saveToDisk(m_sdkFilename, m_reply) && verifyFileIntegrity()) + m_sdkFilename = sdkFromUrl(url); + const std::optional saveResult = saveToDisk(m_sdkFilename, m_reply); + if (saveResult) { + cancelWithError(*saveResult); + } else if (!verifyFileIntegrity(m_sdkFilename, m_androidConfig.getSdkToolsSha256())) { + cancelWithError(Tr::tr("Writing and verifying the integrity of the " + "downloaded file has failed.")); + } else { emit sdkPackageWriteFinished(); - else - cancelWithError( - Tr::tr("Writing and verifying the integrity of the downloaded file has failed.")); + } } } diff --git a/src/plugins/android/androidsdkdownloader.h b/src/plugins/android/androidsdkdownloader.h index e8c5106679c..c633dcbd09d 100644 --- a/src/plugins/android/androidsdkdownloader.h +++ b/src/plugins/android/androidsdkdownloader.h @@ -34,11 +34,6 @@ signals: void sdkDownloaderError(const QString &error); private: - static Utils::FilePath getSaveFilename(const QUrl &url); - bool saveToDisk(const Utils::FilePath &filename, QIODevice *data); - static bool isHttpRedirect(QNetworkReply *m_reply); - - bool verifyFileIntegrity(); void cancelWithError(const QString &error); void logError(const QString &error); From 8e75381fce29504cd3f278f90cfcda22b9e47b4d Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 31 May 2023 14:29:03 +0200 Subject: [PATCH 0015/1777] CppEditor: Give C++ file name settings a per-project variant Fixes: QTCREATORBUG-22033 Change-Id: If37517bb091438e70c5af5102bf833ed46d0c951 Reviewed-by: Reviewed-by: David Schulz --- .../templates/wizards/classes/cpp/file.cpp | 2 +- .../templates/wizards/classes/cpp/file.h | 8 +- .../templates/wizards/classes/cpp/wizard.json | 4 +- .../wizards/classes/itemmodel/itemmodel.cpp | 2 +- .../wizards/classes/itemmodel/itemmodel.h | 6 +- .../wizards/classes/itemmodel/listmodel.cpp | 2 +- .../wizards/classes/itemmodel/listmodel.h | 6 +- .../wizards/classes/itemmodel/tablemodel.cpp | 2 +- .../wizards/classes/itemmodel/tablemodel.h | 6 +- .../wizards/classes/itemmodel/wizard.json | 6 +- .../templates/wizards/codesnippet/wizard.json | 2 +- .../templates/wizards/files/cppheader/file.h | 4 +- .../wizards/files/cppheader/wizard.json | 2 +- .../wizards/files/cppsource/file.cpp | 2 +- .../wizards/files/cppsource/wizard.json | 2 +- .../templates/wizards/files/testing/file.cpp | 2 +- .../wizards/files/testing/wizard.json | 4 +- src/plugins/clangcodemodel/clangdclient.cpp | 3 +- .../clangcodemodel/clangdfindreferences.cpp | 19 +- .../cppeditor/abstracteditorsupport.cpp | 9 +- src/plugins/cppeditor/abstracteditorsupport.h | 8 +- src/plugins/cppeditor/cppeditorplugin.cpp | 83 ++++---- src/plugins/cppeditor/cppeditorplugin.h | 16 +- src/plugins/cppeditor/cppfilesettingspage.cpp | 201 ++++++++++++++++-- src/plugins/cppeditor/cppfilesettingspage.h | 36 +++- src/plugins/cppeditor/cppfindreferences.cpp | 4 +- src/plugins/cppeditor/cppfindreferences.h | 2 + .../cppeditor/cppheadersource_test.cpp | 30 +-- src/plugins/cppeditor/cpptoolsjsextension.cpp | 32 ++- src/plugins/cppeditor/cpptoolsjsextension.h | 10 + src/plugins/cppeditor/cpptoolsreuse.cpp | 14 +- src/plugins/cppeditor/cpptoolsreuse.h | 4 +- src/plugins/designer/cpp/formclasswizard.cpp | 6 +- .../designer/cpp/formclasswizarddialog.cpp | 4 +- .../designer/cpp/formclasswizardpage.cpp | 14 +- src/plugins/designer/qtcreatorintegration.cpp | 3 +- .../qtdesignerformclasscodegenerator.cpp | 16 +- .../customwidgetwizard/plugingenerator.cpp | 11 +- .../qmakeprojectmanager/wizards/qtwizard.cpp | 6 +- 39 files changed, 431 insertions(+), 162 deletions(-) diff --git a/share/qtcreator/templates/wizards/classes/cpp/file.cpp b/share/qtcreator/templates/wizards/classes/cpp/file.cpp index 8ebbf1d26b4..760f19c2e7b 100644 --- a/share/qtcreator/templates/wizards/classes/cpp/file.cpp +++ b/share/qtcreator/templates/wizards/classes/cpp/file.cpp @@ -1,4 +1,4 @@ -%{Cpp:LicenseTemplate}\ +%{JS: Cpp.licenseTemplate()}\ #include "%{JS: Util.relativeFilePath('%{Path}/%{HdrFileName}', '%{Path}' + '/' + Util.path('%{SrcFileName}'))}" %{JS: Cpp.openNamespaces('%{Class}')} @if '%{IncludeQSharedData}' diff --git a/share/qtcreator/templates/wizards/classes/cpp/file.h b/share/qtcreator/templates/wizards/classes/cpp/file.h index ad2b178e8ff..aa5e50913ad 100644 --- a/share/qtcreator/templates/wizards/classes/cpp/file.h +++ b/share/qtcreator/templates/wizards/classes/cpp/file.h @@ -1,12 +1,12 @@ -%{Cpp:LicenseTemplate}\ -@if '%{Cpp:PragmaOnce}' +%{JS: Cpp.licenseTemplate()}\ +@if '%{JS: Cpp.usePragmaOnce()}' #pragma once @else #ifndef %{GUARD} #define %{GUARD} @endif -%{JS: Cpp.includeStatement('%{Base}', Util.preferredSuffix('text/x-c++hdr'), ['QObject', 'QWidget', 'QMainWindow', 'QQuickItem', 'QSharedData'], '%{TargetPath}')}\ +%{JS: Cpp.includeStatement('%{Base}', Cpp.cxxHeaderSuffix(), ['QObject', 'QWidget', 'QMainWindow', 'QQuickItem', 'QSharedData'], '%{TargetPath}')}\ %{JS: QtSupport.qtIncludes([ ( '%{IncludeQObject}' ) ? 'QtCore/%{IncludeQObject}' : '', ( '%{IncludeQWidget}' ) ? 'QtGui/%{IncludeQWidget}' : '', ( '%{IncludeQMainWindow}' ) ? 'QtGui/%{IncludeQMainWindow}' : '', @@ -65,6 +65,6 @@ private: @endif }; %{JS: Cpp.closeNamespaces('%{Class}')} -@if ! '%{Cpp:PragmaOnce}' +@if ! '%{JS: Cpp.usePragmaOnce()}' #endif // %{GUARD} @endif diff --git a/share/qtcreator/templates/wizards/classes/cpp/wizard.json b/share/qtcreator/templates/wizards/classes/cpp/wizard.json index 9317c175981..06e856c1ab5 100644 --- a/share/qtcreator/templates/wizards/classes/cpp/wizard.json +++ b/share/qtcreator/templates/wizards/classes/cpp/wizard.json @@ -167,14 +167,14 @@ "type": "LineEdit", "trDisplayName": "Header file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Cpp.cxxHeaderSuffix())}" } }, { "name": "SrcFileName", "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++src'))}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Cpp.cxxSourceSuffix())}" } }, { "name": "Path", diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.cpp index 71f9074a69b..be4af3270e2 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.cpp @@ -1,4 +1,4 @@ -%{Cpp:LicenseTemplate}\ +%{JS: Cpp.licenseTemplate()}\ #include "%{JS: Util.relativeFilePath('%{Path}/%{HdrFileName}', '%{Path}' + '/' + Util.path('%{SrcFileName}'))}" %{JS: Cpp.openNamespaces('%{Class}')}\ diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.h b/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.h index 4aa7ea11fc7..1ca540277d4 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.h +++ b/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.h @@ -1,5 +1,5 @@ -%{Cpp:LicenseTemplate}\ -@if '%{Cpp:PragmaOnce}' +%{JS: Cpp.licenseTemplate()}\ +@if '%{JS: Cpp.usePragmaOnce()}' #pragma once @else #ifndef %{GUARD} @@ -66,6 +66,6 @@ public: private: }; %{JS: Cpp.closeNamespaces('%{Class}')} -@if ! '%{Cpp:PragmaOnce}' +@if ! '%{JS: Cpp.usePragmaOnce()}' #endif // %{GUARD} @endif diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp index 9b08462ef4e..86dc009c144 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp @@ -1,4 +1,4 @@ -%{Cpp:LicenseTemplate}\ +%{JS: Cpp.licenseTemplate()}\ #include "%{JS: Util.relativeFilePath('%{Path}/%{HdrFileName}', '%{Path}' + '/' + Util.path('%{SrcFileName}'))}" %{JS: Cpp.openNamespaces('%{Class}')}\ diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h index fe1ef78cc61..7b756f99baf 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h +++ b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h @@ -1,5 +1,5 @@ -%{Cpp:LicenseTemplate}\ -@if '%{Cpp:PragmaOnce}' +%{JS: Cpp.licenseTemplate()}\ +@if '%{JS: Cpp.usePragmaOnce()}' #pragma once @else #ifndef %{GUARD} @@ -59,6 +59,6 @@ public: private: }; %{JS: Cpp.closeNamespaces('%{Class}')} -@if ! '%{Cpp:PragmaOnce}' +@if ! '%{JS: Cpp.usePragmaOnce()}' #endif // %{GUARD} @endif diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp index 794510501fa..c86cfe64871 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp @@ -1,4 +1,4 @@ -%{Cpp:LicenseTemplate}\ +%{JS: Cpp.licenseTemplate()}\ #include "%{JS: Util.relativeFilePath('%{Path}/%{HdrFileName}', '%{Path}' + '/' + Util.path('%{SrcFileName}'))}" %{JS: Cpp.openNamespaces('%{Class}')}\ diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h index b6293563064..cfc07fb5acc 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h +++ b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h @@ -1,5 +1,5 @@ -%{Cpp:LicenseTemplate}\ -@if '%{Cpp:PragmaOnce}' +%{JS: Cpp.licenseTemplate()}\ +@if '%{JS: Cpp.usePragmaOnce()}' #pragma once @else #ifndef %{GUARD} @@ -62,6 +62,6 @@ public: private: }; %{JS: Cpp.closeNamespaces('%{Class}')} -@if ! '%{Cpp:PragmaOnce}' +@if ! '%{JS: Cpp.usePragmaOnce()}' #endif // %{GUARD} @endif diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json b/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json index 1e0cd06e197..afecf16c334 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json +++ b/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json @@ -14,7 +14,7 @@ { "key": "HdrPath", "value": "%{Path}/%{HdrFileName}" }, { "key": "SrcPath", "value": "%{Path}/%{SrcFileName}" }, { "key": "CN", "value": "%{JS: Cpp.className(value('Class'))}" }, - { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" } + { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('Class'), Cpp.cxxHeaderSuffix())}" } ], "pages": @@ -92,14 +92,14 @@ "type": "LineEdit", "trDisplayName": "Header file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Cpp.cxxHeaderSuffix())}" } }, { "name": "SrcFileName", "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++src'))}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Cpp.cxxSourceSuffix())}" } }, { "name": "Path", diff --git a/share/qtcreator/templates/wizards/codesnippet/wizard.json b/share/qtcreator/templates/wizards/codesnippet/wizard.json index c64ad36822e..e5dbc0c70c2 100644 --- a/share/qtcreator/templates/wizards/codesnippet/wizard.json +++ b/share/qtcreator/templates/wizards/codesnippet/wizard.json @@ -12,7 +12,7 @@ "options": [ { "key": "ProjectFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, - { "key": "CppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" }, + { "key": "CppFileName", "value": "%{JS: 'main.' + Cpp.cxxSourceSuffix()}" }, { "key": "MacOSBundleValue", "value": "%{JS: %{MacOSBundle} ? 'TRUE' : 'FALSE' }" } ], "pages": diff --git a/share/qtcreator/templates/wizards/files/cppheader/file.h b/share/qtcreator/templates/wizards/files/cppheader/file.h index e92e2c0aad7..d7432eb5234 100644 --- a/share/qtcreator/templates/wizards/files/cppheader/file.h +++ b/share/qtcreator/templates/wizards/files/cppheader/file.h @@ -1,5 +1,5 @@ -%{Cpp:LicenseTemplate}\ -@if '%{Cpp:PragmaOnce}' +%{JS: Cpp.licenseTemplate()}\ +@if '%{JS: Cpp.usePragmaOnce()}' #pragma once @else #ifndef %{JS: Cpp.headerGuard('%{FileName}')} diff --git a/share/qtcreator/templates/wizards/files/cppheader/wizard.json b/share/qtcreator/templates/wizards/files/cppheader/wizard.json index 36956636a3f..a4bbb5ccc66 100644 --- a/share/qtcreator/templates/wizards/files/cppheader/wizard.json +++ b/share/qtcreator/templates/wizards/files/cppheader/wizard.json @@ -10,7 +10,7 @@ "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", "options": [ - { "key": "DefaultSuffix", "value": "%{JS: Util.preferredSuffix('text/x-c++hdr')}" }, + { "key": "DefaultSuffix", "value": "%{JS: Cpp.cxxHeaderSuffix()}" }, { "key": "FileName", "value": "%{JS: Util.fileName(value('TargetPath'), value('DefaultSuffix'))}" } ], diff --git a/share/qtcreator/templates/wizards/files/cppsource/file.cpp b/share/qtcreator/templates/wizards/files/cppsource/file.cpp index b6e652a44a6..70ffeadc39b 100644 --- a/share/qtcreator/templates/wizards/files/cppsource/file.cpp +++ b/share/qtcreator/templates/wizards/files/cppsource/file.cpp @@ -1 +1 @@ -%{Cpp:LicenseTemplate}\ +%{JS: Cpp.licenseTemplate()}\ diff --git a/share/qtcreator/templates/wizards/files/cppsource/wizard.json b/share/qtcreator/templates/wizards/files/cppsource/wizard.json index c75600ff8af..707351da501 100644 --- a/share/qtcreator/templates/wizards/files/cppsource/wizard.json +++ b/share/qtcreator/templates/wizards/files/cppsource/wizard.json @@ -11,7 +11,7 @@ "options": [ { "key": "FileName", "value": "%{JS: Util.fileName(value('TargetPath'), value('DefaultSuffix'))}" }, - { "key": "DefaultSuffix", "value": "%{JS: Util.preferredSuffix('text/x-c++src')}" } + { "key": "DefaultSuffix", "value": "%{JS: Cpp.cxxSourceSuffix()}" } ], "pages" : diff --git a/share/qtcreator/templates/wizards/files/testing/file.cpp b/share/qtcreator/templates/wizards/files/testing/file.cpp index e515339e2db..981fd0478e7 100644 --- a/share/qtcreator/templates/wizards/files/testing/file.cpp +++ b/share/qtcreator/templates/wizards/files/testing/file.cpp @@ -1,4 +1,4 @@ -%{Cpp:LicenseTemplate} +%{JS: Cpp.licenseTemplate()} @if "%{TestFrameWork}" == "GTest" #include #include diff --git a/share/qtcreator/templates/wizards/files/testing/wizard.json b/share/qtcreator/templates/wizards/files/testing/wizard.json index 34170434bea..9a9718ef55d 100644 --- a/share/qtcreator/templates/wizards/files/testing/wizard.json +++ b/share/qtcreator/templates/wizards/files/testing/wizard.json @@ -13,7 +13,7 @@ "options": [ { "key": "TargetPath", "value": "%{Path}" }, { "key": "QmlFileName", "value": "%{JS: Util.fileName(value('QmlSrcFile').startsWith('tst_') ? value('QmlSrcFile') : 'tst_' + value('QmlSrcFile'), '.qml')}" }, - { "key": "CppFileName", "value": "%{JS: Util.fileName(value('CppSrcFile'), Util.preferredSuffix('text/x-c++src'))}" } + { "key": "CppFileName", "value": "%{JS: Util.fileName(value('CppSrcFile'), Cpp.cxxSourceSuffix())}" } ], "pages" : @@ -91,7 +91,7 @@ "trDisplayName": "Source file:", "mandatory": true, "visible": "%{JS: value('TestFrameWork') !== 'QtQuickTest' }", - "data": { "trText": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Util.preferredSuffix('text/x-c++src')}" } + "data": { "trText": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Cpp.cxxSourceSuffix()}" } }, { "name": "QmlSrcFile", diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 0082ff6cef9..070653c702a 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -570,7 +570,8 @@ void ClangdClient::findUsages(const CppEditor::CursorInEditor &cursor, if (useClangdForRenaming) { symbolSupport().renameSymbol(cursor.textDocument(), adjustedCursor, *replacement, - renameCallback, CppEditor::preferLowerCaseFileNames()); + renameCallback, + CppEditor::preferLowerCaseFileNames(project())); return; } } diff --git a/src/plugins/clangcodemodel/clangdfindreferences.cpp b/src/plugins/clangcodemodel/clangdfindreferences.cpp index b44fd41a828..d6a91aa334b 100644 --- a/src/plugins/clangcodemodel/clangdfindreferences.cpp +++ b/src/plugins/clangcodemodel/clangdfindreferences.cpp @@ -90,7 +90,8 @@ public: const ReplacementData &replacementData, const QString &newSymbolName, const SearchResultItems &checkedItems, - bool preserveCase); + bool preserveCase, + bool preferLowerCaseFileNames); void handleFindUsagesResult(const QList &locations); void finishSearch(); void reportAllSearchResultsAndFinish(); @@ -141,13 +142,14 @@ ClangdFindReferences::ClangdFindReferences(ClangdClient *client, TextDocument *d const auto renameFilesCheckBox = new QCheckBox; renameFilesCheckBox->setVisible(false); d->search->setAdditionalReplaceWidget(renameFilesCheckBox); - const auto renameHandler = - [search = d->search](const QString &newSymbolName, - const SearchResultItems &checkedItems, - bool preserveCase) { + const bool preferLowerCase = CppEditor::preferLowerCaseFileNames(client->project()); + const auto renameHandler = [search = d->search, preferLowerCase]( + const QString &newSymbolName, + const SearchResultItems &checkedItems, + bool preserveCase) { const auto replacementData = search->userData().value(); Private::handleRenameRequest(search, replacementData, newSymbolName, checkedItems, - preserveCase); + preserveCase, preferLowerCase); }; connect(d->search, &SearchResult::replaceButtonClicked, renameHandler); } @@ -244,7 +246,8 @@ void ClangdFindReferences::Private::handleRenameRequest( const ReplacementData &replacementData, const QString &newSymbolName, const SearchResultItems &checkedItems, - bool preserveCase) + bool preserveCase, + bool preferLowerCaseFileNames) { const Utils::FilePaths filePaths = BaseFileFind::replaceAll(newSymbolName, checkedItems, preserveCase); @@ -261,7 +264,7 @@ void ClangdFindReferences::Private::handleRenameRequest( ProjectExplorerPlugin::renameFilesForSymbol( replacementData.oldSymbolName, newSymbolName, Utils::toList(replacementData.fileRenameCandidates), - CppEditor::preferLowerCaseFileNames()); + preferLowerCaseFileNames); } void ClangdFindReferences::Private::handleFindUsagesResult(const QList &locations) diff --git a/src/plugins/cppeditor/abstracteditorsupport.cpp b/src/plugins/cppeditor/abstracteditorsupport.cpp index a47fb412f32..a275ed6b571 100644 --- a/src/plugins/cppeditor/abstracteditorsupport.cpp +++ b/src/plugins/cppeditor/abstracteditorsupport.cpp @@ -39,9 +39,10 @@ void AbstractEditorSupport::notifyAboutUpdatedContents() const filePath().toString(), sourceFilePath().toString(), contents()); } -QString AbstractEditorSupport::licenseTemplate(const FilePath &filePath, const QString &className) +QString AbstractEditorSupport::licenseTemplate(ProjectExplorer::Project *project, + const FilePath &filePath, const QString &className) { - const QString license = Internal::CppFileSettings::licenseTemplate(); + const QString license = Internal::CppEditorPlugin::licenseTemplate(project); Utils::MacroExpander expander; expander.registerVariable("Cpp:License:FileName", Tr::tr("The file name."), [filePath] { return filePath.fileName(); }); @@ -51,9 +52,9 @@ QString AbstractEditorSupport::licenseTemplate(const FilePath &filePath, const Q return Utils::TemplateEngine::processText(&expander, license, nullptr); } -bool AbstractEditorSupport::usePragmaOnce() +bool AbstractEditorSupport::usePragmaOnce(ProjectExplorer::Project *project) { - return Internal::CppEditorPlugin::usePragmaOnce(); + return Internal::CppEditorPlugin::usePragmaOnce(project); } } // CppEditor diff --git a/src/plugins/cppeditor/abstracteditorsupport.h b/src/plugins/cppeditor/abstracteditorsupport.h index 2b18873238b..277001e0433 100644 --- a/src/plugins/cppeditor/abstracteditorsupport.h +++ b/src/plugins/cppeditor/abstracteditorsupport.h @@ -9,6 +9,8 @@ #include +namespace ProjectExplorer { class Project; } + namespace CppEditor { class CppModelManager; @@ -30,8 +32,10 @@ public: void notifyAboutUpdatedContents() const; unsigned revision() const { return m_revision; } - static QString licenseTemplate(const Utils::FilePath &filePath = {}, const QString &className = {}); - static bool usePragmaOnce(); + static QString licenseTemplate(ProjectExplorer::Project *project, + const Utils::FilePath &filePath = {}, + const QString &className = {}); + static bool usePragmaOnce(ProjectExplorer::Project *project); private: CppModelManager *m_modelmanager; diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 5791a5cb62a..223ec0e09f7 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -72,6 +72,7 @@ #include #include #include +#include #include #include @@ -261,17 +262,18 @@ void CppEditorPlugin::initialize() this, [] { CppModelManager::switchHeaderSource(true); }); MacroExpander *expander = globalMacroExpander(); + + // TODO: Per-project variants of these three? expander->registerVariable("Cpp:LicenseTemplate", Tr::tr("The license template."), - []() { return CppEditorPlugin::licenseTemplate(); }); + []() { return CppEditorPlugin::licenseTemplate(nullptr); }); expander->registerFileVariables("Cpp:LicenseTemplatePath", Tr::tr("The configured path to the license template"), - []() { return CppEditorPlugin::licenseTemplatePath(); }); - + []() { return CppEditorPlugin::licenseTemplatePath(nullptr); }); expander->registerVariable( "Cpp:PragmaOnce", Tr::tr("Insert \"#pragma once\" instead of \"#ifndef\" include guards into header file"), - [] { return usePragmaOnce() ? QString("true") : QString(); }); + [] { return usePragmaOnce(nullptr) ? QString("true") : QString(); }); const auto quickFixSettingsPanelFactory = new ProjectPanelFactory; quickFixSettingsPanelFactory->setPriority(100); @@ -505,6 +507,14 @@ void CppEditorPlugin::extensionsInitialized() if (!d->m_fileSettings.applySuffixesToMimeDB()) qWarning("Unable to apply cpp suffixes to mime database (cpp mime types not found).\n"); + const auto fileNamesPanelFactory = new ProjectPanelFactory; + fileNamesPanelFactory->setPriority(99); + fileNamesPanelFactory->setDisplayName(Tr::tr("C++ File Naming")); + fileNamesPanelFactory->setCreateWidgetFunction([](Project *project) { + return new CppFileSettingsForProjectWidget(project); + }); + ProjectPanelFactory::registerFactory(fileNamesPanelFactory); + if (CppModelManager::instance()->isClangCodeModelActive()) { d->m_clangdSettingsPage = new ClangdSettingsPage; const auto clangdPanelFactory = new ProjectPanelFactory; @@ -614,39 +624,19 @@ void CppEditorPlugin::clearHeaderSourceCache() m_headerSourceMapping.clear(); } -FilePath CppEditorPlugin::licenseTemplatePath() +FilePath CppEditorPlugin::licenseTemplatePath(Project *project) { - return FilePath::fromString(m_instance->d->m_fileSettings.licenseTemplatePath); + return FilePath::fromString(fileSettings(project).licenseTemplatePath); } -QString CppEditorPlugin::licenseTemplate() +QString CppEditorPlugin::licenseTemplate(Project *project) { - return CppFileSettings::licenseTemplate(); + return fileSettings(project).licenseTemplate(); } -bool CppEditorPlugin::usePragmaOnce() +bool CppEditorPlugin::usePragmaOnce(Project *project) { - return m_instance->d->m_fileSettings.headerPragmaOnce; -} - -const QStringList &CppEditorPlugin::headerSearchPaths() -{ - return m_instance->d->m_fileSettings.headerSearchPaths; -} - -const QStringList &CppEditorPlugin::sourceSearchPaths() -{ - return m_instance->d->m_fileSettings.sourceSearchPaths; -} - -const QStringList &CppEditorPlugin::headerPrefixes() -{ - return m_instance->d->m_fileSettings.headerPrefixes; -} - -const QStringList &CppEditorPlugin::sourcePrefixes() -{ - return m_instance->d->m_fileSettings.sourcePrefixes; + return fileSettings(project).headerPragmaOnce; } CppCodeModelSettings *CppEditorPlugin::codeModelSettings() @@ -654,11 +644,20 @@ CppCodeModelSettings *CppEditorPlugin::codeModelSettings() return &d->m_codeModelSettings; } -CppFileSettings *CppEditorPlugin::fileSettings() +CppFileSettings CppEditorPlugin::fileSettings(Project *project) { - return &instance()->d->m_fileSettings; + if (!project) + return instance()->d->m_fileSettings; + return CppFileSettingsForProject(project).settings(); } +#ifdef WITH_TESTS +void CppEditorPlugin::setGlobalFileSettings(const CppFileSettings &settings) +{ + instance()->d->m_fileSettings = settings; +} +#endif + static QStringList findFilesInProject(const QString &name, const Project *project) { if (debug) @@ -721,11 +720,12 @@ static QStringList baseNameWithAllSuffixes(const QString &baseName, const QStrin return result; } -static QStringList baseNamesWithAllPrefixes(const QStringList &baseNames, bool isHeader) +static QStringList baseNamesWithAllPrefixes(const CppFileSettings &settings, + const QStringList &baseNames, bool isHeader) { QStringList result; - const QStringList &sourcePrefixes = m_instance->sourcePrefixes(); - const QStringList &headerPrefixes = m_instance->headerPrefixes(); + const QStringList &sourcePrefixes = settings.sourcePrefixes; + const QStringList &headerPrefixes = settings.headerPrefixes; for (const QString &name : baseNames) { for (const QString &prefix : isHeader ? headerPrefixes : sourcePrefixes) { @@ -812,6 +812,9 @@ FilePath correspondingHeaderOrSource(const FilePath &filePath, bool *wasHeader, if (m_headerSourceMapping.contains(fi.absoluteFilePath())) return FilePath::fromString(m_headerSourceMapping.value(fi.absoluteFilePath())); + Project * const projectForFile = ProjectManager::projectForFile(filePath); + const CppFileSettings settings = CppEditorPlugin::fileSettings(projectForFile); + if (debug) qDebug() << Q_FUNC_INFO << fileName << kind; @@ -838,11 +841,11 @@ FilePath correspondingHeaderOrSource(const FilePath &filePath, bool *wasHeader, const QDir absoluteDir = fi.absoluteDir(); QStringList candidateDirs(absoluteDir.absolutePath()); // If directory is not root, try matching against its siblings - const QStringList searchPaths = isHeader ? m_instance->sourceSearchPaths() - : m_instance->headerSearchPaths(); + const QStringList searchPaths = isHeader ? settings.sourceSearchPaths + : settings.headerSearchPaths; candidateDirs += baseDirWithAllDirectories(absoluteDir, searchPaths); - candidateFileNames += baseNamesWithAllPrefixes(candidateFileNames, isHeader); + candidateFileNames += baseNamesWithAllPrefixes(settings, candidateFileNames, isHeader); // Try to find a file in the same or sibling directories first for (const QString &candidateDir : std::as_const(candidateDirs)) { @@ -862,7 +865,9 @@ FilePath correspondingHeaderOrSource(const FilePath &filePath, bool *wasHeader, } // Find files in the current project - Project *currentProject = ProjectTree::currentProject(); + Project *currentProject = projectForFile; + if (!projectForFile) + currentProject = ProjectTree::currentProject(); if (currentProject) { const FilePath path = correspondingHeaderOrSourceInProject(fi, candidateFileNames, currentProject, cacheUsage); diff --git a/src/plugins/cppeditor/cppeditorplugin.h b/src/plugins/cppeditor/cppeditorplugin.h index c28ee16b1e1..d5b5b75f722 100644 --- a/src/plugins/cppeditor/cppeditorplugin.h +++ b/src/plugins/cppeditor/cppeditorplugin.h @@ -5,6 +5,7 @@ #include +namespace ProjectExplorer { class Project; } namespace Utils { class FilePath; } namespace CppEditor { @@ -29,14 +30,10 @@ public: CppQuickFixAssistProvider *quickFixProvider() const; - static const QStringList &headerSearchPaths(); - static const QStringList &sourceSearchPaths(); - static const QStringList &headerPrefixes(); - static const QStringList &sourcePrefixes(); static void clearHeaderSourceCache(); - static Utils::FilePath licenseTemplatePath(); - static QString licenseTemplate(); - static bool usePragmaOnce(); + static Utils::FilePath licenseTemplatePath(ProjectExplorer::Project *project); + static QString licenseTemplate(ProjectExplorer::Project *project); + static bool usePragmaOnce(ProjectExplorer::Project *project); void openDeclarationDefinitionInNextSplit(); void openTypeHierarchy(); @@ -46,7 +43,10 @@ public: void switchDeclarationDefinition(); CppCodeModelSettings *codeModelSettings(); - static CppFileSettings *fileSettings(); + static CppFileSettings fileSettings(ProjectExplorer::Project *project); +#ifdef WITH_TESTS + static void setGlobalFileSettings(const CppFileSettings &settings); +#endif signals: void typeHierarchyRequested(); diff --git a/src/plugins/cppeditor/cppfilesettingspage.cpp b/src/plugins/cppeditor/cppfilesettingspage.cpp index 447d6083697..21411577d35 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.cpp +++ b/src/plugins/cppeditor/cppfilesettingspage.cpp @@ -7,10 +7,9 @@ #include "cppeditortr.h" #include - #include #include - +#include #include #include #include @@ -25,11 +24,14 @@ #include #include #include +#include using namespace Utils; namespace CppEditor::Internal { +const char projectSettingsKeyC[] = "CppEditorFileNames"; +const char useGlobalKeyC[] = "UseGlobal"; const char headerPrefixesKeyC[] = "HeaderPrefixes"; const char sourcePrefixesKeyC[] = "SourcePrefixes"; const char headerSuffixKeyC[] = "HeaderSuffix"; @@ -202,18 +204,14 @@ static void parseLicenseTemplatePlaceholders(QString *t) } // Convenience that returns the formatted license template. -QString CppFileSettings::licenseTemplate() +QString CppFileSettings::licenseTemplate() const { - const QSettings *s = Core::ICore::settings(); - QString key = QLatin1String(Constants::CPPEDITOR_SETTINGSGROUP); - key += QLatin1Char('/'); - key += QLatin1String(licenseTemplatePathKeyC); - const QString path = s->value(key, QString()).toString(); - if (path.isEmpty()) + if (licenseTemplatePath.isEmpty()) return QString(); - QFile file(path); + QFile file(licenseTemplatePath); if (!file.open(QIODevice::ReadOnly|QIODevice::Text)) { - qWarning("Unable to open the license template %s: %s", qPrintable(path), qPrintable(file.errorString())); + qWarning("Unable to open the license template %s: %s", qPrintable(licenseTemplatePath), + qPrintable(file.errorString())); return QString(); } @@ -235,11 +233,17 @@ QString CppFileSettings::licenseTemplate() class CppFileSettingsWidget final : public Core::IOptionsPageWidget { + Q_OBJECT + public: explicit CppFileSettingsWidget(CppFileSettings *settings); void apply() final; void setSettings(const CppFileSettings &s); + CppFileSettings currentSettings() const; + +signals: + void userChange(); private: void slotEdit(); @@ -336,6 +340,25 @@ CppFileSettingsWidget::CppFileSettingsWidget(CppFileSettings *settings) m_licenseTemplatePathChooser->addButton(Tr::tr("Edit..."), this, [this] { slotEdit(); }); setSettings(*m_settings); + + connect(m_headerSuffixComboBox, &QComboBox::currentIndexChanged, + this, &CppFileSettingsWidget::userChange); + connect(m_sourceSuffixComboBox, &QComboBox::currentIndexChanged, + this, &CppFileSettingsWidget::userChange); + connect(m_headerSearchPathsEdit, &QLineEdit::textEdited, + this, &CppFileSettingsWidget::userChange); + connect(m_sourceSearchPathsEdit, &QLineEdit::textEdited, + this, &CppFileSettingsWidget::userChange); + connect(m_headerPrefixesEdit, &QLineEdit::textEdited, + this, &CppFileSettingsWidget::userChange); + connect(m_sourcePrefixesEdit, &QLineEdit::textEdited, + this, &CppFileSettingsWidget::userChange); + connect(m_headerPragmaOnceCheckBox, &QCheckBox::stateChanged, + this, &CppFileSettingsWidget::userChange); + connect(m_lowerCaseFileNamesCheckBox, &QCheckBox::stateChanged, + this, &CppFileSettingsWidget::userChange); + connect(m_licenseTemplatePathChooser, &PathChooser::textChanged, + this, &CppFileSettingsWidget::userChange); } FilePath CppFileSettingsWidget::licenseTemplatePath() const @@ -358,17 +381,7 @@ static QStringList trimmedPaths(const QString &paths) void CppFileSettingsWidget::apply() { - CppFileSettings rc; - rc.lowerCaseFiles = m_lowerCaseFileNamesCheckBox->isChecked(); - rc.headerPragmaOnce = m_headerPragmaOnceCheckBox->isChecked(); - rc.headerPrefixes = trimmedPaths(m_headerPrefixesEdit->text()); - rc.sourcePrefixes = trimmedPaths(m_sourcePrefixesEdit->text()); - rc.headerSuffix = m_headerSuffixComboBox->currentText(); - rc.sourceSuffix = m_sourceSuffixComboBox->currentText(); - rc.headerSearchPaths = trimmedPaths(m_headerSearchPathsEdit->text()); - rc.sourceSearchPaths = trimmedPaths(m_sourceSearchPathsEdit->text()); - rc.licenseTemplatePath = licenseTemplatePath().toString(); - + const CppFileSettings rc = currentSettings(); if (rc == *m_settings) return; @@ -398,6 +411,21 @@ void CppFileSettingsWidget::setSettings(const CppFileSettings &s) setLicenseTemplatePath(FilePath::fromString(s.licenseTemplatePath)); } +CppFileSettings CppFileSettingsWidget::currentSettings() const +{ + CppFileSettings rc; + rc.lowerCaseFiles = m_lowerCaseFileNamesCheckBox->isChecked(); + rc.headerPragmaOnce = m_headerPragmaOnceCheckBox->isChecked(); + rc.headerPrefixes = trimmedPaths(m_headerPrefixesEdit->text()); + rc.sourcePrefixes = trimmedPaths(m_sourcePrefixesEdit->text()); + rc.headerSuffix = m_headerSuffixComboBox->currentText(); + rc.sourceSuffix = m_sourceSuffixComboBox->currentText(); + rc.headerSearchPaths = trimmedPaths(m_headerSearchPathsEdit->text()); + rc.sourceSearchPaths = trimmedPaths(m_sourceSearchPathsEdit->text()); + rc.licenseTemplatePath = licenseTemplatePath().toString(); + return rc; +} + void CppFileSettingsWidget::slotEdit() { FilePath path = licenseTemplatePath(); @@ -426,4 +454,133 @@ CppFileSettingsPage::CppFileSettingsPage(CppFileSettings *settings) setWidgetCreator([settings] { return new CppFileSettingsWidget(settings); }); } +CppFileSettingsForProject::CppFileSettingsForProject(ProjectExplorer::Project *project) + : m_project(project) +{ + loadSettings(); +} + +CppFileSettings CppFileSettingsForProject::settings() const +{ + return m_useGlobalSettings ? CppEditorPlugin::fileSettings(nullptr) : m_customSettings; +} + +void CppFileSettingsForProject::setSettings(const CppFileSettings &settings) +{ + m_customSettings = settings; + saveSettings(); +} + +void CppFileSettingsForProject::setUseGlobalSettings(bool useGlobal) +{ + m_useGlobalSettings = useGlobal; + saveSettings(); +} + +void CppFileSettingsForProject::loadSettings() +{ + if (!m_project) + return; + + const QVariant entry = m_project->namedSettings(projectSettingsKeyC); + if (!entry.isValid()) + return; + + const QVariantMap data = entry.toMap(); + m_useGlobalSettings = data.value(useGlobalKeyC, true).toBool(); + m_customSettings.headerPrefixes = data.value(headerPrefixesKeyC, + m_customSettings.headerPrefixes).toStringList(); + m_customSettings.sourcePrefixes = data.value(sourcePrefixesKeyC, + m_customSettings.sourcePrefixes).toStringList(); + m_customSettings.headerSuffix = data.value(headerSuffixKeyC, m_customSettings.headerSuffix) + .toString(); + m_customSettings.sourceSuffix = data.value(sourceSuffixKeyC, m_customSettings.sourceSuffix) + .toString(); + m_customSettings.headerSearchPaths + = data.value(headerSearchPathsKeyC, m_customSettings.headerSearchPaths).toStringList(); + m_customSettings.sourceSearchPaths + = data.value(sourceSearchPathsKeyC, m_customSettings.sourceSearchPaths).toStringList(); + m_customSettings.lowerCaseFiles = data.value(Constants::LOWERCASE_CPPFILES_KEY, + m_customSettings.lowerCaseFiles).toBool(); + m_customSettings.headerPragmaOnce = data.value(headerPragmaOnceC, + m_customSettings.headerPragmaOnce).toBool(); + m_customSettings.licenseTemplatePath + = data.value(licenseTemplatePathKeyC, m_customSettings.licenseTemplatePath).toString(); +} + +void CppFileSettingsForProject::saveSettings() +{ + if (!m_project) + return; + + // Optimization: Don't save anything if the user never switched away from the default. + if (m_useGlobalSettings && !m_project->namedSettings(projectSettingsKeyC).isValid()) + return; + + QVariantMap data; + data.insert(useGlobalKeyC, m_useGlobalSettings); + data.insert(headerPrefixesKeyC, m_customSettings.headerPrefixes); + data.insert(sourcePrefixesKeyC, m_customSettings.sourcePrefixes); + data.insert(headerSuffixKeyC, m_customSettings.headerSuffix); + data.insert(sourceSuffixKeyC, m_customSettings.sourceSuffix); + data.insert(headerSearchPathsKeyC, m_customSettings.headerSearchPaths); + data.insert(sourceSearchPathsKeyC, m_customSettings.sourceSearchPaths); + data.insert(Constants::LOWERCASE_CPPFILES_KEY, m_customSettings.lowerCaseFiles); + data.insert(headerPragmaOnceC, m_customSettings.headerPragmaOnce); + data.insert(licenseTemplatePathKeyC, m_customSettings.licenseTemplatePath); + m_project->setNamedSettings(projectSettingsKeyC, data); +} + +class CppFileSettingsForProjectWidget::Private +{ +public: + Private(const CppFileSettingsForProject &s) : settings(s) {} + + void maybeClearHeaderSourceCache(); + void updateSubWidgetState() { widget.setEnabled(!settings.useGlobalSettings()); } + + CppFileSettingsForProject settings; + CppFileSettings initialSettings = settings.settings(); + CppFileSettingsWidget widget{&initialSettings}; + QCheckBox useGlobalSettingsCheckBox; + const bool wasGlobal = settings.useGlobalSettings(); +}; + +CppFileSettingsForProjectWidget::CppFileSettingsForProjectWidget( + const CppFileSettingsForProject &settings) : d(new Private(settings)) +{ + setGlobalSettingsId(Constants::CPP_FILE_SETTINGS_ID); + const auto layout = new QVBoxLayout(this); + layout->setContentsMargins(0, 0, 0, 0); + layout->addWidget(&d->widget); + + connect(this, &ProjectSettingsWidget::useGlobalSettingsChanged, this, + [this](bool checked) { + d->settings.setUseGlobalSettings(checked); + if (!checked) + d->settings.setSettings(d->widget.currentSettings()); + d->maybeClearHeaderSourceCache(); + d->updateSubWidgetState(); + }); + connect(&d->widget, &CppFileSettingsWidget::userChange, this, [this] { + d->settings.setSettings(d->widget.currentSettings()); + d->maybeClearHeaderSourceCache(); + }); + d->updateSubWidgetState(); +} + +CppFileSettingsForProjectWidget::~CppFileSettingsForProjectWidget() { delete d; } + +void CppFileSettingsForProjectWidget::Private::maybeClearHeaderSourceCache() +{ + const CppFileSettings &s = settings.settings(); + if (settings.useGlobalSettings() != wasGlobal + || s.headerSearchPaths != initialSettings.headerSearchPaths + || s.sourceSearchPaths != initialSettings.sourceSearchPaths) { + CppEditorPlugin::clearHeaderSourceCache(); + } +} + } // namespace CppEditor::Internal + +#include diff --git a/src/plugins/cppeditor/cppfilesettingspage.h b/src/plugins/cppeditor/cppfilesettingspage.h index 50cc38133a0..f4c65fbbc5c 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.h +++ b/src/plugins/cppeditor/cppfilesettingspage.h @@ -6,6 +6,7 @@ #include "cppeditorconstants.h" #include +#include #include @@ -13,6 +14,8 @@ QT_BEGIN_NAMESPACE class QSettings; QT_END_NAMESPACE +namespace ProjectExplorer { class Project; } + namespace CppEditor::Internal { class CppFileSettings @@ -38,18 +41,47 @@ public: bool applySuffixesToMimeDB(); // Convenience to return a license template completely formatted. - // Currently made public in - static QString licenseTemplate(); + QString licenseTemplate() const; bool equals(const CppFileSettings &rhs) const; bool operator==(const CppFileSettings &s) const { return equals(s); } bool operator!=(const CppFileSettings &s) const { return !equals(s); } }; +class CppFileSettingsForProject +{ +public: + CppFileSettingsForProject(ProjectExplorer::Project *project); + + CppFileSettings settings() const; + void setSettings(const CppFileSettings &settings); + bool useGlobalSettings() const { return m_useGlobalSettings; } + void setUseGlobalSettings(bool useGlobal); + +private: + void loadSettings(); + void saveSettings(); + + ProjectExplorer::Project * const m_project; + CppFileSettings m_customSettings; + bool m_useGlobalSettings = true; +}; + class CppFileSettingsPage : public Core::IOptionsPage { public: explicit CppFileSettingsPage(CppFileSettings *settings); }; +class CppFileSettingsForProjectWidget : public ProjectExplorer::ProjectSettingsWidget +{ +public: + CppFileSettingsForProjectWidget(const CppFileSettingsForProject &settings); + ~CppFileSettingsForProjectWidget(); + +private: + class Private; + Private * const d; +}; + } // namespace CppEditor::Internal diff --git a/src/plugins/cppeditor/cppfindreferences.cpp b/src/plugins/cppeditor/cppfindreferences.cpp index 5da22854386..460ad7d0b2d 100644 --- a/src/plugins/cppeditor/cppfindreferences.cpp +++ b/src/plugins/cppeditor/cppfindreferences.cpp @@ -398,6 +398,8 @@ void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol, parameters.symbolId = fullIdForSymbol(symbol); parameters.symbolFilePath = symbol->filePath(); parameters.categorize = codeModelSettings()->categorizeFindReferences(); + parameters.preferLowerCaseFileNames = preferLowerCaseFileNames( + ProjectManager::projectForFile(symbol->filePath())); if (symbol->asClass() || symbol->asForwardClassDeclaration()) { CPlusPlus::Overview overview; @@ -475,7 +477,7 @@ void CppFindReferences::onReplaceButtonClicked(Core::SearchResult *search, const ProjectExplorerPlugin::renameFilesForSymbol( parameters.prettySymbolName, text, parameters.filesToRename, - preferLowerCaseFileNames()); + parameters.preferLowerCaseFileNames); } void CppFindReferences::searchAgain(SearchResult *search) diff --git a/src/plugins/cppeditor/cppfindreferences.h b/src/plugins/cppeditor/cppfindreferences.h index b05ce723c4e..37e105ab364 100644 --- a/src/plugins/cppeditor/cppfindreferences.h +++ b/src/plugins/cppeditor/cppfindreferences.h @@ -4,6 +4,7 @@ #pragma once #include "cppeditor_global.h" +#include "cppeditorconstants.h" #include #include @@ -51,6 +52,7 @@ public: QString prettySymbolName; Utils::FilePaths filesToRename; bool categorize = false; + bool preferLowerCaseFileNames = Constants::LOWERCASE_CPPFILES_DEFAULT; }; class CppFindReferences: public QObject diff --git a/src/plugins/cppeditor/cppheadersource_test.cpp b/src/plugins/cppeditor/cppheadersource_test.cpp index d94920a3295..28f5a8b6fb7 100644 --- a/src/plugins/cppeditor/cppheadersource_test.cpp +++ b/src/plugins/cppeditor/cppheadersource_test.cpp @@ -71,25 +71,27 @@ void HeaderSourceTest::test_data() void HeaderSourceTest::initTestCase() { QDir(baseTestDir()).mkpath(_(".")); - CppFileSettings *fs = CppEditorPlugin::fileSettings(); - fs->headerSearchPaths.append(QLatin1String("include")); - fs->headerSearchPaths.append(QLatin1String("../include")); - fs->sourceSearchPaths.append(QLatin1String("src")); - fs->sourceSearchPaths.append(QLatin1String("../src")); - fs->headerPrefixes.append(QLatin1String("testh_")); - fs->sourcePrefixes.append(QLatin1String("testc_")); + CppFileSettings fs = CppEditorPlugin::fileSettings(nullptr); + fs.headerSearchPaths.append(QLatin1String("include")); + fs.headerSearchPaths.append(QLatin1String("../include")); + fs.sourceSearchPaths.append(QLatin1String("src")); + fs.sourceSearchPaths.append(QLatin1String("../src")); + fs.headerPrefixes.append(QLatin1String("testh_")); + fs.sourcePrefixes.append(QLatin1String("testc_")); + CppEditorPlugin::setGlobalFileSettings(fs); } void HeaderSourceTest::cleanupTestCase() { Utils::FilePath::fromString(baseTestDir()).removeRecursively(); - CppFileSettings *fs = CppEditorPlugin::fileSettings(); - fs->headerSearchPaths.removeLast(); - fs->headerSearchPaths.removeLast(); - fs->sourceSearchPaths.removeLast(); - fs->sourceSearchPaths.removeLast(); - fs->headerPrefixes.removeLast(); - fs->sourcePrefixes.removeLast(); + CppFileSettings fs = CppEditorPlugin::fileSettings(nullptr); + fs.headerSearchPaths.removeLast(); + fs.headerSearchPaths.removeLast(); + fs.sourceSearchPaths.removeLast(); + fs.sourceSearchPaths.removeLast(); + fs.headerPrefixes.removeLast(); + fs.sourcePrefixes.removeLast(); + CppEditorPlugin::setGlobalFileSettings(fs); } } // namespace CppEditor::Internal diff --git a/src/plugins/cppeditor/cpptoolsjsextension.cpp b/src/plugins/cppeditor/cpptoolsjsextension.cpp index 73a846593c1..0818af0acb4 100644 --- a/src/plugins/cppeditor/cpptoolsjsextension.cpp +++ b/src/plugins/cppeditor/cpptoolsjsextension.cpp @@ -3,6 +3,7 @@ #include "cpptoolsjsextension.h" +#include "cppeditorplugin.h" #include "cppfilesettingspage.h" #include "cpplocatordata.h" #include "cppworkingcopy.h" @@ -12,6 +13,7 @@ #include #include #include +#include #include #include @@ -27,6 +29,13 @@ namespace CppEditor::Internal { +static CppFileSettings fileSettings() +{ + // Note that the user can set a different project in the wizard *after* the file names + // have been determined. There's nothing we can do about that here. + return CppEditorPlugin::fileSettings(ProjectExplorer::ProjectTree::currentProject()); +} + static QString fileName(const QString &path, const QString &extension) { return Utils::FilePath::fromStringWithExtension(path, extension).toString(); @@ -37,6 +46,16 @@ QString CppToolsJsExtension::headerGuard(const QString &in) const return Utils::headerGuard(in); } +QString CppToolsJsExtension::licenseTemplate() const +{ + return fileSettings().licenseTemplate(); +} + +bool CppToolsJsExtension::usePragmaOnce() const +{ + return fileSettings().headerPragmaOnce; +} + static QStringList parts(const QString &klass) { return klass.split(QStringLiteral("::")); @@ -63,8 +82,7 @@ QString CppToolsJsExtension::className(const QString &klass) const QString CppToolsJsExtension::classToFileName(const QString &klass, const QString &extension) const { const QString raw = fileName(className(klass), extension); - CppFileSettings settings; - settings.fromSettings(Core::ICore::settings()); + const CppFileSettings &settings = fileSettings(); if (!settings.lowerCaseFiles) return raw; @@ -249,4 +267,14 @@ QString CppToolsJsExtension::includeStatement( return {}; } +QString CppToolsJsExtension::cxxHeaderSuffix() const +{ + return fileSettings().headerSuffix; +} + +QString CppToolsJsExtension::cxxSourceSuffix() const +{ + return fileSettings().sourceSuffix; +} + } // namespace CppEditor::Internal diff --git a/src/plugins/cppeditor/cpptoolsjsextension.h b/src/plugins/cppeditor/cpptoolsjsextension.h index cdb7e56c813..593f9536411 100644 --- a/src/plugins/cppeditor/cpptoolsjsextension.h +++ b/src/plugins/cppeditor/cpptoolsjsextension.h @@ -26,6 +26,12 @@ public: // Generate header guard: Q_INVOKABLE QString headerGuard(const QString &in) const; + // Generate license template: + Q_INVOKABLE QString licenseTemplate() const; + + // Use #pragma once: + Q_INVOKABLE bool usePragmaOnce() const; + // Work with classes: Q_INVOKABLE QStringList namespaces(const QString &klass) const; Q_INVOKABLE bool hasNamespaces(const QString &klass) const; @@ -46,6 +52,10 @@ public: const QString &pathOfIncludingFile ); + // File suffixes: + Q_INVOKABLE QString cxxHeaderSuffix() const; + Q_INVOKABLE QString cxxSourceSuffix() const; + private: CppLocatorData * const m_locatorData; }; diff --git a/src/plugins/cppeditor/cpptoolsreuse.cpp b/src/plugins/cppeditor/cpptoolsreuse.cpp index 8f68ed3ec9d..325aa8bb249 100644 --- a/src/plugins/cppeditor/cpptoolsreuse.cpp +++ b/src/plugins/cppeditor/cpptoolsreuse.cpp @@ -611,9 +611,19 @@ void openEditor(const Utils::FilePath &filePath, bool inNextSplit, Utils::Id edi : EditorManager::NoFlags); } -bool preferLowerCaseFileNames() +bool preferLowerCaseFileNames(ProjectExplorer::Project *project) { - return Internal::CppEditorPlugin::fileSettings()->lowerCaseFiles; + return Internal::CppEditorPlugin::fileSettings(project).lowerCaseFiles; +} + +QString preferredCxxHeaderSuffix(ProjectExplorer::Project *project) +{ + return Internal::CppEditorPlugin::fileSettings(project).headerSuffix; +} + +QString preferredCxxSourceSuffix(ProjectExplorer::Project *project) +{ + return Internal::CppEditorPlugin::fileSettings(project).sourceSuffix; } namespace Internal { diff --git a/src/plugins/cppeditor/cpptoolsreuse.h b/src/plugins/cppeditor/cpptoolsreuse.h index 9948ab6de70..78d158b5764 100644 --- a/src/plugins/cppeditor/cpptoolsreuse.h +++ b/src/plugins/cppeditor/cpptoolsreuse.h @@ -67,7 +67,9 @@ void CPPEDITOR_EXPORT openEditor(const Utils::FilePath &filePath, bool inNextSpl class CppCodeModelSettings; CppCodeModelSettings CPPEDITOR_EXPORT *codeModelSettings(); -bool CPPEDITOR_EXPORT preferLowerCaseFileNames(); +QString CPPEDITOR_EXPORT preferredCxxHeaderSuffix(ProjectExplorer::Project *project); +QString CPPEDITOR_EXPORT preferredCxxSourceSuffix(ProjectExplorer::Project *project); +bool CPPEDITOR_EXPORT preferLowerCaseFileNames(ProjectExplorer::Project *project); UsePrecompiledHeaders CPPEDITOR_EXPORT getPchUsage(); diff --git a/src/plugins/designer/cpp/formclasswizard.cpp b/src/plugins/designer/cpp/formclasswizard.cpp index 593c9db95f1..1582cd26de5 100644 --- a/src/plugins/designer/cpp/formclasswizard.cpp +++ b/src/plugins/designer/cpp/formclasswizard.cpp @@ -6,6 +6,8 @@ #include #include #include +#include +#include #include #include @@ -22,12 +24,12 @@ FormClassWizard::FormClassWizard() QString FormClassWizard::headerSuffix() const { - return preferredSuffix(CppEditor::Constants::CPP_HEADER_MIMETYPE); + return CppEditor::preferredCxxHeaderSuffix(ProjectExplorer::ProjectTree::currentProject()); } QString FormClassWizard::sourceSuffix() const { - return preferredSuffix(CppEditor::Constants::CPP_SOURCE_MIMETYPE); + return CppEditor::preferredCxxSourceSuffix(ProjectExplorer::ProjectTree::currentProject()); } QString FormClassWizard::formSuffix() const diff --git a/src/plugins/designer/cpp/formclasswizarddialog.cpp b/src/plugins/designer/cpp/formclasswizarddialog.cpp index 3d6d760332a..cc912683f69 100644 --- a/src/plugins/designer/cpp/formclasswizarddialog.cpp +++ b/src/plugins/designer/cpp/formclasswizarddialog.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -68,7 +69,8 @@ FormClassWizardParameters FormClassWizardDialog::parameters() const m_classPage->getParameters(&rc); // Name the ui class in the Ui namespace after the class specified rc.uiTemplate = QtSupport::CodeGenerator::changeUiClassName(m_rawFormTemplate, rc.className); - rc.usePragmaOnce = CppEditor::AbstractEditorSupport::usePragmaOnce(); + rc.usePragmaOnce = CppEditor::AbstractEditorSupport::usePragmaOnce( + ProjectExplorer::ProjectTree::currentProject()); return rc; } diff --git a/src/plugins/designer/cpp/formclasswizardpage.cpp b/src/plugins/designer/cpp/formclasswizardpage.cpp index f8113c65754..9ec4ebfa279 100644 --- a/src/plugins/designer/cpp/formclasswizardpage.cpp +++ b/src/plugins/designer/cpp/formclasswizardpage.cpp @@ -8,9 +8,9 @@ #include "../designertr.h" #include - #include - +#include +#include #include #include @@ -32,9 +32,9 @@ FormClassWizardPage::FormClassWizardPage() m_newClassWidget = new NewClassWidget(classGroupBox); m_newClassWidget->setHeaderExtension( - Utils::mimeTypeForName(CppEditor::Constants::CPP_HEADER_MIMETYPE).preferredSuffix()); + CppEditor::preferredCxxHeaderSuffix(ProjectExplorer::ProjectTree::currentProject())); m_newClassWidget->setSourceExtension( - Utils::mimeTypeForName(CppEditor::Constants::CPP_SOURCE_MIMETYPE).preferredSuffix()); + CppEditor::preferredCxxSourceSuffix(ProjectExplorer::ProjectTree::currentProject())); m_newClassWidget->setLowerCaseFiles(lowercaseHeaderFiles()); connect(m_newClassWidget, &NewClassWidget::validChanged, @@ -54,11 +54,7 @@ FormClassWizardPage::~FormClassWizardPage() = default; // Retrieve settings of CppEditor plugin. bool FormClassWizardPage::lowercaseHeaderFiles() { - QString lowerCaseSettingsKey = CppEditor::Constants::CPPEDITOR_SETTINGSGROUP; - lowerCaseSettingsKey += '/'; - lowerCaseSettingsKey += CppEditor::Constants::LOWERCASE_CPPFILES_KEY; - const bool lowerCaseDefault = CppEditor::Constants::LOWERCASE_CPPFILES_DEFAULT; - return Core::ICore::settings()->value(lowerCaseSettingsKey, QVariant(lowerCaseDefault)).toBool(); + return CppEditor::preferLowerCaseFileNames(ProjectExplorer::ProjectTree::currentProject()); } void FormClassWizardPage::setClassName(const QString &suggestedClassName) diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index 010ab85a82b..75a21d0b5d2 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -795,6 +796,6 @@ void QtCreatorIntegration::handleSymbolRenameStage2( void QtCreatorIntegration::slotSyncSettingsToDesigner() { // Set promotion-relevant parameters on integration. - setHeaderSuffix(Utils::mimeTypeForName(CppEditor::Constants::CPP_HEADER_MIMETYPE).preferredSuffix()); + setHeaderSuffix(CppEditor::preferredCxxHeaderSuffix(ProjectTree::currentProject())); setHeaderLowercase(FormClassWizardPage::lowercaseHeaderFiles()); } diff --git a/src/plugins/designer/qtdesignerformclasscodegenerator.cpp b/src/plugins/designer/qtdesignerformclasscodegenerator.cpp index d4d5e02a3c2..f5989840414 100644 --- a/src/plugins/designer/qtdesignerformclasscodegenerator.cpp +++ b/src/plugins/designer/qtdesignerformclasscodegenerator.cpp @@ -5,12 +5,13 @@ #include "formtemplatewizardpage.h" #include -#include +#include #include #include +#include #include #include -#include +#include #include #include @@ -70,12 +71,11 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete const QString unqualifiedClassName = namespaceList.takeLast(); - const QString headerLicense = - CppEditor::AbstractEditorSupport::licenseTemplate( - FilePath::fromString(parameters.headerFile), parameters.className); - const QString sourceLicense = - CppEditor::AbstractEditorSupport::licenseTemplate( - FilePath::fromString(parameters.sourceFile), parameters.className); + ProjectExplorer::Project * const project = ProjectExplorer::ProjectTree::currentProject(); + const QString headerLicense = CppEditor::AbstractEditorSupport::licenseTemplate( + project, FilePath::fromString(parameters.headerFile), parameters.className); + const QString sourceLicense = CppEditor::AbstractEditorSupport::licenseTemplate( + project, FilePath::fromString(parameters.sourceFile), parameters.className); // Include guards const QString guard = Utils::headerGuard(parameters.headerFile, namespaceList); diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp b/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp index 28e67ec3ece..565766dff4b 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp @@ -7,7 +7,7 @@ #include #include - +#include #include #include #include @@ -82,6 +82,7 @@ QList PluginGenerator::generatePlugin(const GenerationPara // First create the widget wrappers (plugins) and - if requested - skeletons // for the widgets. const int widgetCount = options.widgetOptions.size(); + ProjectExplorer::Project *project = ProjectExplorer::ProjectTree::currentProject(); for (int i = 0; i < widgetCount; i++) { const PluginOptions::WidgetOptions &wo = options.widgetOptions.at(i); sm.clear(); @@ -95,7 +96,8 @@ QList PluginGenerator::generatePlugin(const GenerationPara return QList(); Core::GeneratedFile pluginHeader(baseDir / wo.pluginHeaderFile); pluginHeader.setContents(CppEditor::AbstractEditorSupport::licenseTemplate( - FilePath::fromString(wo.pluginHeaderFile), wo.pluginClassName) + project, FilePath::fromString(wo.pluginHeaderFile), + wo.pluginClassName) + pluginHeaderContents); rc.push_back(pluginHeader); @@ -122,6 +124,7 @@ QList PluginGenerator::generatePlugin(const GenerationPara return QList(); Core::GeneratedFile pluginSource(baseDir / wo.pluginSourceFile); pluginSource.setContents(CppEditor::AbstractEditorSupport::licenseTemplate( + project, FilePath::fromString(wo.pluginSourceFile), wo.pluginClassName) + pluginSourceContents); if (i == 0 && widgetCount == 1) // Open first widget unless collection @@ -169,6 +172,7 @@ QList PluginGenerator::generatePlugin(const GenerationPara return QList(); Core::GeneratedFile widgetHeader(baseDir / wo.widgetHeaderFile); widgetHeader.setContents(CppEditor::AbstractEditorSupport::licenseTemplate( + project, FilePath::fromString(wo.widgetHeaderFile), wo.widgetClassName) + widgetHeaderContents); @@ -181,6 +185,7 @@ QList PluginGenerator::generatePlugin(const GenerationPara return QList(); Core::GeneratedFile widgetSource(baseDir / wo.widgetSourceFile); widgetSource.setContents(CppEditor::AbstractEditorSupport::licenseTemplate( + project, FilePath::fromString(wo.widgetSourceFile), wo.widgetClassName) + widgetSourceContents); @@ -218,6 +223,7 @@ QList PluginGenerator::generatePlugin(const GenerationPara return QList(); Core::GeneratedFile collectionHeader(baseDir / options.collectionHeaderFile); collectionHeader.setContents(CppEditor::AbstractEditorSupport::licenseTemplate( + project, FilePath::fromString(options.collectionHeaderFile), options.collectionClassName) + collectionHeaderContents); @@ -235,6 +241,7 @@ QList PluginGenerator::generatePlugin(const GenerationPara return QList(); Core::GeneratedFile collectionSource(baseDir / options.collectionSourceFile); collectionSource.setContents(CppEditor::AbstractEditorSupport::licenseTemplate( + project, FilePath::fromString(options.collectionSourceFile), options.collectionClassName) + collectionSourceFileContents); diff --git a/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp b/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp index 816101dd31e..16f533020db 100644 --- a/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp +++ b/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp @@ -10,10 +10,12 @@ #include #include +#include #include #include #include +#include #include #include @@ -39,12 +41,12 @@ QtWizard::QtWizard() QString QtWizard::sourceSuffix() { - return preferredSuffix(QLatin1String(ProjectExplorer::Constants::CPP_SOURCE_MIMETYPE)); + return CppEditor::preferredCxxSourceSuffix(ProjectTree::currentProject()); } QString QtWizard::headerSuffix() { - return preferredSuffix(QLatin1String(ProjectExplorer::Constants::CPP_HEADER_MIMETYPE)); + return CppEditor::preferredCxxHeaderSuffix(ProjectTree::currentProject()); } QString QtWizard::formSuffix() From a4b60e5f13c2b768e6c4ca42209b6261d3671984 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Sun, 4 Jun 2023 19:34:21 +0200 Subject: [PATCH 0016/1777] Utils: Introduce UnarchiverTask Transform the Archive class into Unarchiver class. The Unarchiver class is prepared to work with TaskTree. The Unarchiver is going to replace the Archive class. Provide the task tree adapter for the Unarchiver class. Register the task inside the Tasking namespace under the UnarchiverTask name. Change-Id: Ib8f95a80c411d5afd18aa0e2ca428914430641ad Reviewed-by: Qt CI Bot Reviewed-by: Alessandro Portale --- src/libs/utils/archive.cpp | 78 +++++++++++++++++++++++++++++++++++++- src/libs/utils/archive.h | 46 ++++++++++++++++++++-- 2 files changed, 120 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/archive.cpp b/src/libs/utils/archive.cpp index 5e62835a20f..b86a7ab0b89 100644 --- a/src/libs/utils/archive.cpp +++ b/src/libs/utils/archive.cpp @@ -5,7 +5,6 @@ #include "algorithm.h" #include "mimeutils.h" -#include "process.h" #include "qtcassert.h" #include "utilstr.h" @@ -180,4 +179,81 @@ void Archive::unarchive() m_process->start(); } +expected_str Unarchiver::sourceAndCommand(const FilePath &sourceFile) +{ + const QVector tools = toolsForFilePath(sourceFile); + if (tools.isEmpty()) + return make_unexpected(Tr::tr("File format not supported.")); + + for (const Tool &tool : tools) { + const std::optional resolvedTool = resolveTool(tool); + if (resolvedTool) + return SourceAndCommand(sourceFile, resolvedTool->command); + } + + const QStringList execs = transform(tools, [](const Tool &tool) { + return tool.command.executable().toUserOutput(); + }); + return make_unexpected(Tr::tr("Could not find any unarchiving executable in PATH (%1).") + .arg(execs.join(", "))); +} + +static CommandLine unarchiveCommand(const CommandLine &commandTemplate, const FilePath &sourceFile, + const FilePath &destDir) +{ + CommandLine command = commandTemplate; + command.setArguments(command.arguments().replace("%{src}", sourceFile.path()) + .replace("%{dest}", destDir.path())); + return command; +} + +void Unarchiver::start() +{ + QTC_ASSERT(!m_process, emit done(false); return); + + if (!m_sourceAndCommand) { + emit outputReceived(Tr::tr("No source file set.")); + emit done(false); + return; + } + if (m_destDir.isEmpty()) { + emit outputReceived(Tr::tr("No destination directory set.")); + emit done(false); + return; + } + + const CommandLine command = unarchiveCommand(m_sourceAndCommand->m_commandTemplate, + m_sourceAndCommand->m_sourceFile, m_destDir); + m_destDir.ensureWritableDir(); + + m_process.reset(new Process); + m_process->setProcessChannelMode(QProcess::MergedChannels); + QObject::connect(m_process.get(), &Process::readyReadStandardOutput, this, [this] { + emit outputReceived(m_process->readAllStandardOutput()); + }); + QObject::connect(m_process.get(), &Process::done, this, [this] { + const bool success = m_process->result() == ProcessResult::FinishedWithSuccess; + if (!success) + emit outputReceived(Tr::tr("Command failed.")); + emit done(success); + }); + + emit outputReceived(Tr::tr("Running %1\nin \"%2\".\n\n", "Running in ") + .arg(command.toUserOutput(), m_destDir.toUserOutput())); + + m_process->setCommand(command); + m_process->setWorkingDirectory(m_destDir); + m_process->start(); +} + +UnarchiverTaskAdapter::UnarchiverTaskAdapter() +{ + connect(task(), &Unarchiver::done, this, &Tasking::TaskInterface::done); +} + +void UnarchiverTaskAdapter::start() +{ + task()->start(); +} + } // namespace Utils diff --git a/src/libs/utils/archive.h b/src/libs/utils/archive.h index ccf62d3885c..b40d26c7a4b 100644 --- a/src/libs/utils/archive.h +++ b/src/libs/utils/archive.h @@ -6,14 +6,14 @@ #include "utils_global.h" #include "commandline.h" +#include "process.h" + +#include #include namespace Utils { -class FilePath; -class Process; - class QTCREATOR_UTILS_EXPORT Archive : public QObject { Q_OBJECT @@ -36,4 +36,44 @@ private: std::unique_ptr m_process; }; +class QTCREATOR_UTILS_EXPORT Unarchiver : public QObject +{ + Q_OBJECT +public: + class SourceAndCommand + { + private: + friend class Unarchiver; + SourceAndCommand(const FilePath &sourceFile, const CommandLine &commandTemplate) + : m_sourceFile(sourceFile), m_commandTemplate(commandTemplate) {} + FilePath m_sourceFile; + CommandLine m_commandTemplate; + }; + + static expected_str sourceAndCommand(const FilePath &sourceFile); + + void setSourceAndCommand(const SourceAndCommand &data) { m_sourceAndCommand = data; } + void setDestDir(const FilePath &destDir) { m_destDir = destDir; } + + void start(); + +signals: + void outputReceived(const QString &output); + void done(bool success); + +private: + std::optional m_sourceAndCommand; + FilePath m_destDir; + std::unique_ptr m_process; +}; + +class QTCREATOR_UTILS_EXPORT UnarchiverTaskAdapter : public Tasking::TaskAdapter +{ +public: + UnarchiverTaskAdapter(); + void start() final; +}; + } // namespace Utils + +TASKING_DECLARE_TASK(UnarchiverTask, Utils::UnarchiverTaskAdapter); From 804ad5a7f646739839bb3d4ef62a4771ba6fa1e1 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 7 Jun 2023 11:15:12 +0200 Subject: [PATCH 0017/1777] AndroidSdkDownloader: Reuse TaskTree Use it for downloading and unarchiving chain of tasks. Change-Id: I28d4c07a49933665158452ec836a4a6b2c5e23b0 Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: Alessandro Portale --- src/plugins/android/androidsdkdownloader.cpp | 189 ++++++++++-------- src/plugins/android/androidsdkdownloader.h | 27 +-- src/plugins/android/androidsettingswidget.cpp | 1 + 3 files changed, 110 insertions(+), 107 deletions(-) diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp index 4c7963bb95a..0fa1d6ae831 100644 --- a/src/plugins/android/androidsdkdownloader.cpp +++ b/src/plugins/android/androidsdkdownloader.cpp @@ -5,6 +5,8 @@ #include "androidsdkdownloader.h" #include "androidtr.h" +#include + #include #include #include @@ -13,6 +15,7 @@ #include #include +#include #include using namespace Utils; @@ -32,14 +35,14 @@ AndroidSdkDownloader::~AndroidSdkDownloader() = default; static bool isHttpRedirect(QNetworkReply *reply) { - int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + const int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); return statusCode == 301 || statusCode == 302 || statusCode == 303 || statusCode == 305 || statusCode == 307 || statusCode == 308; } static FilePath sdkFromUrl(const QUrl &url) { - QString path = url.path(); + const QString path = url.path(); QString basename = QFileInfo(path).fileName(); if (basename.isEmpty()) @@ -57,6 +60,7 @@ static FilePath sdkFromUrl(const QUrl &url) / basename; } +// TODO: Make it a separate async task in a chain? static std::optional saveToDisk(const FilePath &filename, QIODevice *data) { QFile file(filename.toString()); @@ -68,6 +72,7 @@ static std::optional saveToDisk(const FilePath &filename, QIODevice *da return {}; } +// TODO: Make it a separate async task in a chain? static bool verifyFileIntegrity(const FilePath fileName, const QByteArray &sha256) { QFile file(fileName.toString()); @@ -79,15 +84,6 @@ static bool verifyFileIntegrity(const FilePath fileName, const QByteArray &sha25 return false; } -#if QT_CONFIG(ssl) -void AndroidSdkDownloader::sslErrors(const QList &sslErrors) -{ - for (const QSslError &error : sslErrors) - qCDebug(sdkDownloaderLog, "SSL error: %s\n", qPrintable(error.errorString())); - cancelWithError(Tr::tr("Encountered SSL errors, download is aborted.")); -} -#endif - void AndroidSdkDownloader::downloadAndExtractSdk() { if (m_androidConfig.sdkToolsUrl().isEmpty()) { @@ -95,46 +91,106 @@ void AndroidSdkDownloader::downloadAndExtractSdk() return; } - const QNetworkRequest request(m_androidConfig.sdkToolsUrl()); - m_reply = NetworkAccessManager::instance()->get(request); - connect(m_reply, &QNetworkReply::finished, this, &AndroidSdkDownloader::downloadFinished); - -#if QT_CONFIG(ssl) - connect(m_reply, &QNetworkReply::sslErrors, this, &AndroidSdkDownloader::sslErrors); -#endif - - m_progressDialog = new QProgressDialog(Tr::tr("Downloading SDK Tools package..."), Tr::tr("Cancel"), - 0, 100, Core::ICore::dialogParent()); + m_progressDialog.reset(new QProgressDialog(Tr::tr("Downloading SDK Tools package..."), + Tr::tr("Cancel"), 0, 100, Core::ICore::dialogParent())); m_progressDialog->setWindowModality(Qt::ApplicationModal); m_progressDialog->setWindowTitle(dialogTitle()); m_progressDialog->setFixedSize(m_progressDialog->sizeHint()); - - connect(m_reply, &QNetworkReply::downloadProgress, this, [this](qint64 received, qint64 max) { - m_progressDialog->setRange(0, max); - m_progressDialog->setValue(received); + connect(m_progressDialog.get(), &QProgressDialog::canceled, this, [this] { + m_progressDialog.release()->deleteLater(); + m_taskTree.reset(); }); - connect(m_progressDialog, &QProgressDialog::canceled, this, &AndroidSdkDownloader::cancel); + using namespace Tasking; - connect(this, &AndroidSdkDownloader::sdkPackageWriteFinished, this, [this] { - if (!Archive::supportsFile(m_sdkFilename)) - return; - const FilePath extractDir = m_sdkFilename.parentDir(); - m_archive.reset(new Archive(m_sdkFilename, extractDir)); - if (m_archive->isValid()) { - connect(m_archive.get(), &Archive::finished, this, [this, extractDir](bool success) { - if (success) { - // Save the extraction path temporarily which can be used by sdkmanager - // to install essential packages at firt time setup. - m_androidConfig.setTemporarySdkToolsPath( - extractDir.pathAppended(Constants::cmdlineToolsName)); - emit sdkExtracted(); - } - m_archive.release()->deleteLater(); + TreeStorage> storage; + + const auto onQuerySetup = [this](NetworkQuery &query) { + query.setRequest(QNetworkRequest(m_androidConfig.sdkToolsUrl())); + query.setNetworkAccessManager(NetworkAccessManager::instance()); + NetworkQuery *queryPtr = &query; + connect(queryPtr, &NetworkQuery::started, this, [this, queryPtr] { + QNetworkReply *reply = queryPtr->reply(); + if (!reply) + return; + connect(reply, &QNetworkReply::downloadProgress, + this, [this](qint64 received, qint64 max) { + m_progressDialog->setRange(0, max); + m_progressDialog->setValue(received); }); - m_archive->unarchive(); +#if QT_CONFIG(ssl) + connect(reply, &QNetworkReply::sslErrors, + this, [this, reply](const QList &sslErrors) { + for (const QSslError &error : sslErrors) + qCDebug(sdkDownloaderLog, "SSL error: %s\n", qPrintable(error.errorString())); + logError(Tr::tr("Encountered SSL errors, download is aborted.")); + reply->abort(); + }); +#endif + }); + }; + const auto onQueryDone = [this, storage](const NetworkQuery &query) { + QNetworkReply *reply = query.reply(); + QTC_ASSERT(reply, return); + const QUrl url = reply->url(); + if (isHttpRedirect(reply)) { + logError(Tr::tr("Download from %1 was redirected.").arg(url.toString())); + return; } - }); + const FilePath sdkFileName = sdkFromUrl(url); + const std::optional saveResult = saveToDisk(sdkFileName, reply); + if (saveResult) { + logError(*saveResult); + return; + } + *storage = sdkFileName; + }; + const auto onQueryError = [this](const NetworkQuery &query) { + QNetworkReply *reply = query.reply(); + QTC_ASSERT(reply, return); + const QUrl url = reply->url(); + logError(Tr::tr("Downloading Android SDK Tools from URL %1 has failed: %2.") + .arg(url.toString(), reply->errorString())); + }; + + const auto onUnarchiveSetup = [this, storage](Unarchiver &unarchiver) { + m_progressDialog.reset(); + if (!*storage) + return TaskAction::StopWithError; + const FilePath sdkFileName = **storage; + if (!verifyFileIntegrity(sdkFileName, m_androidConfig.getSdkToolsSha256())) { + logError(Tr::tr("Verifying the integrity of the downloaded file has failed.")); + return TaskAction::StopWithError; + } + const auto sourceAndCommand = Unarchiver::sourceAndCommand(sdkFileName); + if (!sourceAndCommand) { + logError(sourceAndCommand.error()); + return TaskAction::StopWithError; + } + unarchiver.setSourceAndCommand(*sourceAndCommand); + unarchiver.setDestDir(sdkFileName.parentDir()); + return TaskAction::Continue; + }; + const auto onUnarchiverDone = [this, storage](const Unarchiver &) { + m_androidConfig.setTemporarySdkToolsPath( + (*storage)->parentDir().pathAppended(Constants::cmdlineToolsName)); + QMetaObject::invokeMethod(this, [this] { emit sdkExtracted(); }, Qt::QueuedConnection); + }; + + const Group root { + Storage(storage), + NetworkQueryTask(onQuerySetup, onQueryDone, onQueryError), + UnarchiverTask(onUnarchiveSetup, onUnarchiverDone) + }; + + m_taskTree.reset(new TaskTree(root)); + const auto onDone = [this] { + m_taskTree.release()->deleteLater(); + m_progressDialog.reset(); + }; + connect(m_taskTree.get(), &TaskTree::done, this, onDone); + connect(m_taskTree.get(), &TaskTree::errorOccurred, this, onDone); + m_taskTree->start(); } QString AndroidSdkDownloader::dialogTitle() @@ -142,54 +198,11 @@ QString AndroidSdkDownloader::dialogTitle() return Tr::tr("Download SDK Tools"); } -void AndroidSdkDownloader::cancel() -{ - if (m_reply) { - m_reply->abort(); - m_reply->deleteLater(); - m_reply = nullptr; - } - if (m_progressDialog) - m_progressDialog->cancel(); -} - -void AndroidSdkDownloader::cancelWithError(const QString &error) -{ - cancel(); - logError(error); -} - void AndroidSdkDownloader::logError(const QString &error) { qCDebug(sdkDownloaderLog, "%s", error.toUtf8().data()); - emit sdkDownloaderError(error); -} - -void AndroidSdkDownloader::downloadFinished() -{ - QUrl url = m_reply->url(); - if (m_reply->error()) { - cancelWithError(QString(Tr::tr("Downloading Android SDK Tools from URL %1 has failed: %2.")) - .arg(url.toString(), m_reply->errorString())); - } else { - if (isHttpRedirect(m_reply)) { - cancelWithError(QString(Tr::tr("Download from %1 was redirected.")).arg(url.toString())); - } else { - m_sdkFilename = sdkFromUrl(url); - const std::optional saveResult = saveToDisk(m_sdkFilename, m_reply); - if (saveResult) { - cancelWithError(*saveResult); - } else if (!verifyFileIntegrity(m_sdkFilename, m_androidConfig.getSdkToolsSha256())) { - cancelWithError(Tr::tr("Writing and verifying the integrity of the " - "downloaded file has failed.")); - } else { - emit sdkPackageWriteFinished(); - } - } - } - - m_reply->deleteLater(); - m_reply = nullptr; + QMetaObject::invokeMethod(this, [this, error] { emit sdkDownloaderError(error); }, + Qt::QueuedConnection); } } // namespace Android::Internal diff --git a/src/plugins/android/androidsdkdownloader.h b/src/plugins/android/androidsdkdownloader.h index c633dcbd09d..7859f2b6a8e 100644 --- a/src/plugins/android/androidsdkdownloader.h +++ b/src/plugins/android/androidsdkdownloader.h @@ -5,14 +5,13 @@ #include "androidconfigurations.h" -#include #include -#include -namespace Utils { -class Archive; -class FilePath; -} +QT_BEGIN_NAMESPACE +class QProgressDialog; +QT_END_NAMESPACE + +namespace Tasking { class TaskTree; } namespace Android::Internal { @@ -23,30 +22,20 @@ class AndroidSdkDownloader : public QObject public: AndroidSdkDownloader(); ~AndroidSdkDownloader(); + void downloadAndExtractSdk(); static QString dialogTitle(); - void cancel(); - signals: - void sdkPackageWriteFinished(); void sdkExtracted(); void sdkDownloaderError(const QString &error); private: - void cancelWithError(const QString &error); void logError(const QString &error); - void downloadFinished(); -#if QT_CONFIG(ssl) - void sslErrors(const QList &errors); -#endif - - QNetworkReply *m_reply = nullptr; - Utils::FilePath m_sdkFilename; - QProgressDialog *m_progressDialog = nullptr; AndroidConfig &m_androidConfig; - std::unique_ptr m_archive; + std::unique_ptr m_progressDialog; + std::unique_ptr m_taskTree; }; } // namespace Android::Internal diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index dfb14c49cfc..c48ad217ec0 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include From 74f77f6407589048878b9e61d2da7a9d44bb3c1d Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Fri, 12 May 2023 11:57:26 +0200 Subject: [PATCH 0018/1777] ClangFormat: Add caching of current style Previously, ClangFormat was getting the style for a file every time styleForFile was called, which could cause unnecessary delays and impact performance. This commit adds caching of the current style with a timeout of 1s, so that ClangFormat can quickly access the cached style instead of recalculating it each time. Change-Id: I33c114d51d6ce1acd0b6d9d2a28e2b6712e149dd Reviewed-by: Christian Kandeler --- .../clangformat/clangformatbaseindenter.cpp | 31 ++++++++++++++++--- .../clangformat/clangformatbaseindenter.h | 14 ++++++++- src/plugins/clangformat/clangformatutils.cpp | 8 ++++- 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/plugins/clangformat/clangformatbaseindenter.cpp b/src/plugins/clangformat/clangformatbaseindenter.cpp index 5138e03510f..a44d5308304 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.cpp +++ b/src/plugins/clangformat/clangformatbaseindenter.cpp @@ -774,10 +774,28 @@ clang::format::FormatStyle overrideStyle(const Utils::FilePath &fileName) return currentSettingsStyle; } -clang::format::FormatStyle ClangFormatBaseIndenter::styleForFile() const +static std::chrono::milliseconds getCacheTimeout() { - if (getCurrentOverriddenSettings(m_fileName)) - return overrideStyle(m_fileName); + using namespace std::chrono_literals; + bool ok = false; + const int envCacheTimeout = qEnvironmentVariableIntValue("CLANG_FORMAT_CACHE_TIMEOUT", &ok); + return ok ? std::chrono::milliseconds(envCacheTimeout) : 1s; +} + +const clang::format::FormatStyle &ClangFormatBaseIndenter::styleForFile() const +{ + using namespace std::chrono_literals; + static const std::chrono::milliseconds cacheTimeout = getCacheTimeout(); + + QDateTime time = QDateTime::currentDateTime(); + if (m_cachedStyle.expirationTime > time && !(m_cachedStyle.style == clang::format::getNoStyle())) + return m_cachedStyle.style; + + if (getCurrentOverriddenSettings(m_fileName)) { + clang::format::FormatStyle style = overrideStyle(m_fileName); + m_cachedStyle.setCache(style, cacheTimeout); + return m_cachedStyle.style; + } llvm::Expected styleFromProjectFolder = clang::format::getStyle("file", @@ -788,14 +806,17 @@ clang::format::FormatStyle ClangFormatBaseIndenter::styleForFile() const if (styleFromProjectFolder && !(*styleFromProjectFolder == clang::format::getNoStyle())) { addQtcStatementMacros(*styleFromProjectFolder); - return *styleFromProjectFolder; + m_cachedStyle.setCache(*styleFromProjectFolder, cacheTimeout); + return m_cachedStyle.style; } handleAllErrors(styleFromProjectFolder.takeError(), [](const llvm::ErrorInfoBase &) { // do nothing }); - return qtcStyle(); + + m_cachedStyle.setCache(qtcStyle(), 0ms); + return m_cachedStyle.style; } } // namespace ClangFormat diff --git a/src/plugins/clangformat/clangformatbaseindenter.h b/src/plugins/clangformat/clangformatbaseindenter.h index b484654a1f7..1f0674dec57 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.h +++ b/src/plugins/clangformat/clangformatbaseindenter.h @@ -46,7 +46,7 @@ public: std::optional margin() const override; - clang::format::FormatStyle styleForFile() const; + const clang::format::FormatStyle &styleForFile() const; protected: virtual bool formatCodeInsteadOfIndent() const { return false; } @@ -71,6 +71,18 @@ private: ReplacementsToKeep replacementsToKeep, const QChar &typedChar = QChar::Null, bool secondTry = false) const; + + struct CachedStyle { + clang::format::FormatStyle style = clang::format::getNoStyle(); + QDateTime expirationTime; + void setCache(clang::format::FormatStyle newStyle, std::chrono::milliseconds timeout) + { + style = newStyle; + expirationTime = QDateTime::currentDateTime() + timeout; + } + }; + + mutable CachedStyle m_cachedStyle; }; } // namespace ClangFormat diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 9304599d999..1e3e1a72e33 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -31,7 +31,7 @@ using namespace Utils; namespace ClangFormat { -clang::format::FormatStyle qtcStyle() +clang::format::FormatStyle calculateQtcStyle() { clang::format::FormatStyle style = getLLVMStyle(); style.Language = FormatStyle::LK_Cpp; @@ -179,6 +179,12 @@ clang::format::FormatStyle qtcStyle() return style; } +clang::format::FormatStyle qtcStyle() +{ + static clang::format::FormatStyle style = calculateQtcStyle(); + return style; +} + QString projectUniqueId(ProjectExplorer::Project *project) { if (!project) From a250ddb6680ac445acced03d07afd2b3cb27bba9 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 9 Jun 2023 10:00:49 +0200 Subject: [PATCH 0019/1777] AndroidSdkDownloader: Prolong the progress dialog for unarchiving When the unarchiving task starts, change the label of the progress dialog into "Unarchiving..." and make the progress dialog infinite. Change-Id: Ib7faf1d6d1af75bcad21200e5bd43431b70da4cc Reviewed-by: Reviewed-by: Alessandro Portale --- src/plugins/android/androidsdkdownloader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp index 0fa1d6ae831..ca1758fa217 100644 --- a/src/plugins/android/androidsdkdownloader.cpp +++ b/src/plugins/android/androidsdkdownloader.cpp @@ -96,6 +96,7 @@ void AndroidSdkDownloader::downloadAndExtractSdk() m_progressDialog->setWindowModality(Qt::ApplicationModal); m_progressDialog->setWindowTitle(dialogTitle()); m_progressDialog->setFixedSize(m_progressDialog->sizeHint()); + m_progressDialog->setAutoClose(false); connect(m_progressDialog.get(), &QProgressDialog::canceled, this, [this] { m_progressDialog.release()->deleteLater(); m_taskTree.reset(); @@ -154,7 +155,8 @@ void AndroidSdkDownloader::downloadAndExtractSdk() }; const auto onUnarchiveSetup = [this, storage](Unarchiver &unarchiver) { - m_progressDialog.reset(); + m_progressDialog->setRange(0, 0); + m_progressDialog->setLabelText(Tr::tr("Unarchiving SDK Tools package...")); if (!*storage) return TaskAction::StopWithError; const FilePath sdkFileName = **storage; From 64078126a9b8a068d9b94882c867024c2d4b3847 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 9 Jun 2023 10:29:26 +0200 Subject: [PATCH 0020/1777] AndroidSdkDownloader: Add a handler for unarchiver error Call logError() in this case. Change-Id: Iab2b44ebc00fd7fe3ae755e7e575f8eb0f314c9f Reviewed-by: Reviewed-by: Alessandro Portale --- src/plugins/android/androidsdkdownloader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp index ca1758fa217..60170fb2874 100644 --- a/src/plugins/android/androidsdkdownloader.cpp +++ b/src/plugins/android/androidsdkdownloader.cpp @@ -178,11 +178,14 @@ void AndroidSdkDownloader::downloadAndExtractSdk() (*storage)->parentDir().pathAppended(Constants::cmdlineToolsName)); QMetaObject::invokeMethod(this, [this] { emit sdkExtracted(); }, Qt::QueuedConnection); }; + const auto onUnarchiverError = [this](const Unarchiver &) { + logError(Tr::tr("Unarchiving error.")); + }; const Group root { Storage(storage), NetworkQueryTask(onQuerySetup, onQueryDone, onQueryError), - UnarchiverTask(onUnarchiveSetup, onUnarchiverDone) + UnarchiverTask(onUnarchiveSetup, onUnarchiverDone, onUnarchiverError) }; m_taskTree.reset(new TaskTree(root)); From 87a93453981b72fb46a851ca40442bbaf55f3148 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 1 Jun 2023 18:28:57 +0200 Subject: [PATCH 0021/1777] CMakeProjectManager: Remove compatibility code with < 4.13 This hunk was added as part of 01b0d4f8f561 in 2020. Change-Id: I3b520005dc2462397ddfb1a2f6671603131ddced Reviewed-by: Cristian Adam --- .../cmakebuildconfiguration.cpp | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 5ddc68c1c23..a410881bacc 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1576,36 +1576,7 @@ QVariantMap CMakeBuildConfiguration::toMap() const bool CMakeBuildConfiguration::fromMap(const QVariantMap &map) { - if (!BuildConfiguration::fromMap(map)) - return false; - - const CMakeConfig conf - = Utils::filtered(Utils::transform(map.value(QLatin1String(CONFIGURATION_KEY)).toStringList(), - [](const QString &v) { return CMakeConfigItem::fromString(v); }), - [](const CMakeConfigItem &c) { return !c.isNull(); }); - - // TODO: Upgrade from Qt Creator < 4.13: Remove when no longer supported! - const QString buildTypeName = [this] { - switch (buildType()) { - case Debug: - return QString("Debug"); - case Profile: - return QString("RelWithDebInfo"); - case Release: - return QString("Release"); - case Unknown: - default: - return QString(""); - } - }(); - if (m_buildSystem->initialCMakeArguments().isEmpty()) { - CommandLine cmd = defaultInitialCMakeCommand(kit(), buildTypeName); - for (const CMakeConfigItem &item : conf) - cmd.addArg(item.toArgument(macroExpander())); - m_buildSystem->setInitialCMakeArguments(cmd.splitArguments()); - } - - return true; + return BuildConfiguration::fromMap(map); } FilePath CMakeBuildConfiguration::shadowBuildDirectory(const FilePath &projectFilePath, From 3e074a52c1d4f6d519356651380b422e504d6063 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Sun, 4 Jun 2023 20:30:40 +0200 Subject: [PATCH 0022/1777] PluginInstallWizard: Reuse TaskTree Change-Id: I0e139627a9d4c3401bcf7727ef1e51b2de858b77 Reviewed-by: Reviewed-by: Eike Ziller --- .../coreplugin/plugininstallwizard.cpp | 215 ++++++++---------- 1 file changed, 99 insertions(+), 116 deletions(-) diff --git a/src/plugins/coreplugin/plugininstallwizard.cpp b/src/plugins/coreplugin/plugininstallwizard.cpp index ac2dfd6c240..bf3e7f28e6f 100644 --- a/src/plugins/coreplugin/plugininstallwizard.cpp +++ b/src/plugins/coreplugin/plugininstallwizard.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -38,6 +37,7 @@ #include using namespace ExtensionSystem; +using namespace Tasking; using namespace Utils; struct Data @@ -117,12 +117,11 @@ public: if (hasLibSuffix(path)) return true; - QString error; - if (!Archive::supportsFile(path, &error)) { - m_info->setText(error); - return false; - } - return true; + const auto sourceAndCommand = Unarchiver::sourceAndCommand(path); + if (!sourceAndCommand) + m_info->setText(sourceAndCommand.error()); + + return bool(sourceAndCommand); } int nextId() const final @@ -136,15 +135,48 @@ public: Data *m_data = nullptr; }; +struct ArchiveIssue +{ + QString message; + InfoLabel::InfoType type; +}; + +// Async. Result is set if any issue was found. +void checkContents(QPromise &promise, const FilePath &tempDir) +{ + PluginSpec *coreplugin = PluginManager::specForPlugin(CorePlugin::instance()); + + // look for plugin + QDirIterator it(tempDir.path(), libraryNameFilter(), QDir::Files | QDir::NoSymLinks, + QDirIterator::Subdirectories); + while (it.hasNext()) { + if (promise.isCanceled()) + return; + it.next(); + PluginSpec *spec = PluginSpec::read(it.filePath()); + if (spec) { + // Is a Qt Creator plugin. Let's see if we find a Core dependency and check the + // version + const QVector dependencies = spec->dependencies(); + const auto found = std::find_if(dependencies.constBegin(), dependencies.constEnd(), + [coreplugin](const PluginDependency &d) { return d.name == coreplugin->name(); }); + if (found == dependencies.constEnd()) + return; + if (coreplugin->provides(found->name, found->version)) + return; + promise.addResult(ArchiveIssue{ + Tr::tr("Plugin requires an incompatible version of %1 (%2).") + .arg(Constants::IDE_DISPLAY_NAME, found->version), InfoLabel::Error}); + return; // successful / no error + } + } + promise.addResult(ArchiveIssue{Tr::tr("Did not find %1 plugin.") + .arg(Constants::IDE_DISPLAY_NAME), InfoLabel::Error}); +} + class CheckArchivePage : public WizardPage { public: - struct ArchiveIssue - { - QString message; - InfoLabel::InfoType type; - }; - CheckArchivePage(Data *data, QWidget *parent) : WizardPage(parent) , m_data(data) @@ -155,6 +187,12 @@ public: m_label->setElideMode(Qt::ElideNone); m_label->setWordWrap(true); m_cancelButton = new QPushButton(Tr::tr("Cancel")); + connect(m_cancelButton, &QPushButton::clicked, this, [this] { + m_taskTree.reset(); + m_cancelButton->setVisible(false); + m_label->setType(InfoLabel::Information); + m_label->setText(Tr::tr("Canceled.")); + }); m_output = new QTextEdit; m_output->setReadOnly(true); @@ -169,142 +207,87 @@ public: { m_isComplete = false; emit completeChanged(); - m_canceled = false; m_tempDir = std::make_unique("plugininstall"); m_data->extractedPath = m_tempDir->path(); m_label->setText(Tr::tr("Checking archive...")); m_label->setType(InfoLabel::None); - m_cancelButton->setVisible(true); m_output->clear(); - m_archive.reset(new Archive(m_data->sourcePath, m_tempDir->path())); - if (!m_archive->isValid()) { + const auto sourceAndCommand = Unarchiver::sourceAndCommand(m_data->sourcePath); + if (!sourceAndCommand) { m_label->setType(InfoLabel::Error); - m_label->setText(Tr::tr("The file is not an archive.")); + m_label->setText(sourceAndCommand.error()); return; } - QObject::connect(m_archive.get(), &Archive::outputReceived, this, - [this](const QString &output) { - m_output->append(output); - }); - QObject::connect(m_archive.get(), &Archive::finished, this, [this](bool success) { - m_archive.release()->deleteLater(); - handleFinished(success); - }); - QObject::connect(m_cancelButton, &QPushButton::clicked, this, [this] { - m_canceled = true; - m_archive.reset(); - handleFinished(false); - }); - m_archive->unarchive(); - } - void handleFinished(bool success) - { - m_cancelButton->disconnect(); - if (!success) { // unarchiving failed - m_cancelButton->setVisible(false); - if (m_canceled) { - m_label->setType(InfoLabel::Information); - m_label->setText(Tr::tr("Canceled.")); + const auto onUnarchiverSetup = [this, sourceAndCommand](Unarchiver &unarchiver) { + unarchiver.setSourceAndCommand(*sourceAndCommand); + unarchiver.setDestDir(m_tempDir->path()); + connect(&unarchiver, &Unarchiver::outputReceived, this, [this](const QString &output) { + m_output->append(output); + }); + }; + const auto onUnarchiverError = [this](const Unarchiver &) { + m_label->setType(InfoLabel::Error); + m_label->setText(Tr::tr("There was an error while unarchiving.")); + }; + + const auto onCheckerSetup = [this](Async &async) { + if (!m_tempDir) + return TaskAction::StopWithError; + + async.setConcurrentCallData(checkContents, m_tempDir->path()); + async.setFutureSynchronizer(PluginManager::futureSynchronizer()); + return TaskAction::Continue; + }; + const auto onCheckerDone = [this](const Async &async) { + m_isComplete = !async.isResultAvailable(); + if (m_isComplete) { + m_label->setType(InfoLabel::Ok); + m_label->setText(Tr::tr("Archive is OK.")); } else { - m_label->setType(InfoLabel::Error); - m_label->setText(Tr::tr("There was an error while unarchiving.")); + const ArchiveIssue issue = async.result(); + m_label->setType(issue.type); + m_label->setText(issue.message); } - } else { // unarchiving was successful, run a check - m_archiveCheck = Utils::asyncRun([this](QPromise &promise) - { return checkContents(promise); }); - Utils::onFinished(m_archiveCheck, this, [this](const QFuture &f) { - m_cancelButton->setVisible(false); - m_cancelButton->disconnect(); - const bool ok = f.resultCount() == 0 && !f.isCanceled(); - if (f.isCanceled()) { - m_label->setType(InfoLabel::Information); - m_label->setText(Tr::tr("Canceled.")); - } else if (ok) { - m_label->setType(InfoLabel::Ok); - m_label->setText(Tr::tr("Archive is OK.")); - } else { - const ArchiveIssue issue = f.result(); - m_label->setType(issue.type); - m_label->setText(issue.message); - } - m_isComplete = ok; - emit completeChanged(); - }); - QObject::connect(m_cancelButton, &QPushButton::clicked, this, [this] { - m_archiveCheck.cancel(); - }); - } - } + emit completeChanged(); + }; - // Async. Result is set if any issue was found. - void checkContents(QPromise &promise) - { - QTC_ASSERT(m_tempDir.get(), return ); + const Group root { + UnarchiverTask(onUnarchiverSetup, {}, onUnarchiverError), + AsyncTask(onCheckerSetup, onCheckerDone) + }; + m_taskTree.reset(new TaskTree(root)); - PluginSpec *coreplugin = PluginManager::specForPlugin(CorePlugin::instance()); + const auto onEnd = [this] { + m_cancelButton->setVisible(false); + m_taskTree.release()->deleteLater(); + }; + connect(m_taskTree.get(), &TaskTree::done, this, onEnd); + connect(m_taskTree.get(), &TaskTree::errorOccurred, this, onEnd); - // look for plugin - QDirIterator it(m_tempDir->path().path(), - libraryNameFilter(), - QDir::Files | QDir::NoSymLinks, - QDirIterator::Subdirectories); - while (it.hasNext()) { - if (promise.isCanceled()) - return; - it.next(); - PluginSpec *spec = PluginSpec::read(it.filePath()); - if (spec) { - // Is a Qt Creator plugin. Let's see if we find a Core dependency and check the - // version - const QVector dependencies = spec->dependencies(); - const auto found = std::find_if(dependencies.constBegin(), - dependencies.constEnd(), - [coreplugin](const PluginDependency &d) { - return d.name == coreplugin->name(); - }); - if (found != dependencies.constEnd()) { - if (!coreplugin->provides(found->name, found->version)) { - promise.addResult(ArchiveIssue{ - Tr::tr("Plugin requires an incompatible version of %1 (%2).") - .arg(Constants::IDE_DISPLAY_NAME).arg(found->version), - InfoLabel::Error}); - return; - } - } - return; // successful / no error - } - } - promise.addResult(ArchiveIssue{Tr::tr("Did not find %1 plugin.") - .arg(Constants::IDE_DISPLAY_NAME), InfoLabel::Error}); + m_cancelButton->setVisible(true); + m_taskTree->start(); } void cleanupPage() final { // back button pressed - m_cancelButton->disconnect(); - m_archive.reset(); - if (m_archiveCheck.isRunning()) { - m_archiveCheck.cancel(); - m_archiveCheck.waitForFinished(); - } + m_taskTree.reset(); m_tempDir.reset(); } bool isComplete() const final { return m_isComplete; } std::unique_ptr m_tempDir; - std::unique_ptr m_archive; - QFuture m_archiveCheck; + std::unique_ptr m_taskTree; InfoLabel *m_label = nullptr; QPushButton *m_cancelButton = nullptr; QTextEdit *m_output = nullptr; Data *m_data = nullptr; bool m_isComplete = false; - bool m_canceled = false; }; class InstallLocationPage : public WizardPage From f84d75402a105bd97740b65db50c8b477702246d Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 20 Jun 2023 13:37:31 +0200 Subject: [PATCH 0023/1777] Core: Fix compile Amends 3e074a52c1d4f6d519356651380b422e504d6063. Change-Id: I229a6db53d973168150f063edb7417117ed0dcee Reviewed-by: Jarek Kobus --- src/plugins/coreplugin/plugininstallwizard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/plugininstallwizard.cpp b/src/plugins/coreplugin/plugininstallwizard.cpp index bf3e7f28e6f..c7e3a57aa9e 100644 --- a/src/plugins/coreplugin/plugininstallwizard.cpp +++ b/src/plugins/coreplugin/plugininstallwizard.cpp @@ -166,7 +166,7 @@ void checkContents(QPromise &promise, const FilePath &tempDir) return; promise.addResult(ArchiveIssue{ Tr::tr("Plugin requires an incompatible version of %1 (%2).") - .arg(Constants::IDE_DISPLAY_NAME, found->version), InfoLabel::Error}); + .arg(Constants::IDE_DISPLAY_NAME).arg(found->version), InfoLabel::Error}); return; // successful / no error } } From 9ad37a3c43d351c0e8826870c653286b34f980c1 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Tue, 13 Jun 2023 17:24:28 +0200 Subject: [PATCH 0024/1777] DAP: Add stepIn and stepOut and stepOver Change-Id: I7d2bb573c4fc359a4d07b4cff8867a47f9691392 Reviewed-by: hjk Reviewed-by: --- src/plugins/debugger/dap/dapengine.cpp | 165 ++++++++++++++++++------- src/plugins/debugger/dap/dapengine.h | 3 + 2 files changed, 124 insertions(+), 44 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 3f31129a5a8..828585d5ed4 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -25,8 +25,10 @@ #include #include -#include +#include +#include #include +#include #include #include @@ -173,64 +175,106 @@ void DapEngine::handleDabLaunch() { QTC_ASSERT(state() == EngineRunRequested, qDebug() << state()); - // CHECK_STATE(EngineRunRequested); - - postDirectCommand( - {{"command", "launch"}, - {"type", "request"}, -// {"program", runParameters().inferior.command.executable().path()}, - {"arguments", - QJsonObject{ - {"noDebug", false}, - {"program", runParameters().inferior.command.executable().path()}, - {"__restart", ""} - }}}); + postDirectCommand({ + {"command", "launch"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"noDebug", false}, + {"program", runParameters().inferior.command.executable().path()}, + {"__restart", ""} + }} + }); qDebug() << "handleDabLaunch"; } void DapEngine::interruptInferior() { - postDirectCommand({{"command", "pause"}, - {"type", "request"}}); + postDirectCommand({ + {"command", "pause"}, + {"type", "request"} + }); +} + +void DapEngine::dabStackTrace() +{ + if (m_currentThreadId == -1) + return; + + postDirectCommand({ + {"command", "stackTrace"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"threadId", m_currentThreadId}, + {"startFrame", 0}, + {"levels", 1} + }} + }); } void DapEngine::executeStepIn(bool) { + if (m_currentThreadId == -1) + return; + notifyInferiorRunRequested(); -// postDirectCommand({{"command", "stepIn"}, -// {"type", "request"}, -// {"arguments", -// QJsonObject{ -// {"threadId", 1}, // The ID of the client using this adapter. -// }}}); + postDirectCommand({ + {"command", "stepIn"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"threadId", m_currentThreadId}, + }} + }); notifyInferiorRunOk(); } void DapEngine::executeStepOut() { + if (m_currentThreadId == -1) + return; + notifyInferiorRunRequested(); + + postDirectCommand({ + {"command", "stepOut"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"threadId", m_currentThreadId}, + }} + }); + notifyInferiorRunOk(); -// postDirectCommand("return"); } void DapEngine::executeStepOver(bool) { + if (m_currentThreadId == -1) + return; + notifyInferiorRunRequested(); + + postDirectCommand({ + {"command", "next"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"threadId", m_currentThreadId}, + }} + }); + notifyInferiorRunOk(); -// postDirectCommand("next"); } void DapEngine::continueInferior() { notifyInferiorRunRequested(); - postDirectCommand({{"command", "continue"}, - {"type", "request"}, - {"arguments", - QJsonObject{ - {"threadId", 1}, // The ID of the client using this adapter. - }}}); + postDirectCommand({ + {"command", "continue"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"threadId", m_currentThreadId}, + }} + }); } void DapEngine::executeRunToLine(const ContextData &data) @@ -306,14 +350,16 @@ void DapEngine::insertBreakpoint(const Breakpoint &bp) } } - postDirectCommand( - {{"command", "setBreakpoints"}, - {"type", "request"}, - {"arguments", - QJsonObject{{"source", QJsonObject{{"path", params.fileName.path()}}}, - {"breakpoints", breakpoints} - - }}}); + postDirectCommand( { + {"command", "setBreakpoints"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"source", QJsonObject{ + {"path", params.fileName.path()} + }}, + {"breakpoints", breakpoints} + }} + }); qDebug() << "insertBreakpoint" << bp->modelId() << bp->responseId(); } @@ -356,11 +402,16 @@ void DapEngine::removeBreakpoint(const Breakpoint &bp) breakpoints.append(jsonBp); } - postDirectCommand({{"command", "setBreakpoints"}, - {"type", "request"}, - {"arguments", - QJsonObject{{"source", QJsonObject{{"path", params.fileName.path()}}}, - {"breakpoints", breakpoints}}}}); + postDirectCommand({ + {"command", "setBreakpoints"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"source", QJsonObject{ + {"path", params.fileName.path()} + }}, + {"breakpoints", breakpoints} + }} + }); qDebug() << "removeBreakpoint" << bp->modelId() << bp->responseId(); } @@ -584,12 +635,32 @@ void DapEngine::handleOutput(const QJsonDocument &data) return; } + if (command == "stackTrace") { + QJsonArray stackFrames = ob.value("body").toObject().value("stackFrames").toArray(); + if (stackFrames.isEmpty()) + return; + + QJsonObject stackFrame = stackFrames[0].toObject(); + const FilePath file = FilePath::fromString( + stackFrame.value("source").toObject().value("path").toString()); + const int line = stackFrame.value("line").toInt(); + qDebug() << "stackTrace success" << file << line; + gotoLocation(Location(file, line)); + return; + } } if (type == "event") { const QString event = ob.value("event").toString(); const QJsonObject body = ob.value("body").toObject(); + if (event == "exited") { + notifyInferiorExited(); + m_proc.kill(); + showMessage("exited", LogDebug); + return; + } + if (event == "output") { const QString category = body.value("category").toString(); const QString output = body.value("output").toString(); @@ -617,14 +688,21 @@ void DapEngine::handleOutput(const QJsonDocument &data) } if (event == "stopped") { + m_currentThreadId = body.value("threadId").toInt(); showMessage(event, LogDebug); if (body.value("reason").toString() == "breakpoint") { - QString id = QString::number(body.value("hitBreakpointIds").toArray().first().toInteger()); + QString id = QString::number( + body.value("hitBreakpointIds").toArray().first().toInteger()); const BreakpointParameters ¶ms = breakHandler()->findBreakpointByResponseId(id)->requestedParameters(); gotoLocation(Location(params.fileName, params.textPosition)); } + if (body.value("reason").toString() == "pause" + || body.value("reason").toString() == "step") { + dabStackTrace(); + } + if (state() == InferiorStopRequested) notifyInferiorStopOk(); else @@ -671,7 +749,6 @@ void DapEngine::handleOutput(const QJsonDocument &data) return; } - showMessage("UNKNOWN EVENT:" + event); return; } diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 2fa3019cad9..c9b517674a7 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -82,6 +82,8 @@ private: void handleDabLaunch(); void handleDabConfigurationDone(); + void dabStackTrace(); + void handleDapDone(); void readDapStandardOutput(); void readDapStandardError(); @@ -93,6 +95,7 @@ private: QByteArray m_inbuffer; Utils::Process m_proc; int m_nextBreakpointId = 1; + int m_currentThreadId = -1; }; } // Debugger::Internal From b4874b6ce5f6d24c7ecbec3210eb8a28cec1c9bd Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Thu, 15 Jun 2023 15:27:33 +0200 Subject: [PATCH 0025/1777] DAP: Add thread list Change-Id: Ide9305e246f4e0dbe687e37a96b20e99b197ea3f Reviewed-by: hjk --- src/plugins/debugger/dap/dapengine.cpp | 50 +++++++++++++++++++++----- src/plugins/debugger/dap/dapengine.h | 1 + 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 828585d5ed4..90c0e5d99a0 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -211,6 +211,13 @@ void DapEngine::dabStackTrace() }); } +void DapEngine::threads() +{ + postDirectCommand( + {{"command", "threads"}, + {"type", "request"}}); +} + void DapEngine::executeStepIn(bool) { if (m_currentThreadId == -1) @@ -226,7 +233,6 @@ void DapEngine::executeStepIn(bool) }} }); - notifyInferiorRunOk(); } void DapEngine::executeStepOut() @@ -244,7 +250,6 @@ void DapEngine::executeStepOut() }} }); - notifyInferiorRunOk(); } void DapEngine::executeStepOver(bool) @@ -262,7 +267,6 @@ void DapEngine::executeStepOver(bool) }} }); - notifyInferiorRunOk(); } void DapEngine::continueInferior() @@ -648,6 +652,37 @@ void DapEngine::handleOutput(const QJsonDocument &data) gotoLocation(Location(file, line)); return; } + + if (command == "stepIn" || command == "stepOut" || command == "next") { + if (ob.value("success").toBool()) { + showMessage(command, LogDebug); + notifyInferiorRunOk(); + } else { + notifyInferiorRunFailed(); + } + return; + } + + if (command == "threads") { + QJsonArray threads = ob.value("body").toObject().value("threads").toArray(); + if (threads.isEmpty()) + return; + + ThreadsHandler *handler = threadsHandler(); + for (auto thread : threads) { + ThreadData threadData; + threadData.id = QString::number(thread.toObject().value("id").toInt()); + threadData.name = thread.toObject().value("name").toString(); + handler->updateThread(threadData); + } + + if (m_currentThreadId) + handler->setCurrentThread( + threadsHandler()->threadForId(QString::number(m_currentThreadId))); + return; + } + + } if (type == "event") { @@ -682,12 +717,8 @@ void DapEngine::handleOutput(const QJsonDocument &data) return; } - if (event == "initialized") { - showMessage(event, LogDebug); - return; - } - if (event == "stopped") { + ThreadsHandler *handler = threadsHandler(); m_currentThreadId = body.value("threadId").toInt(); showMessage(event, LogDebug); if (body.value("reason").toString() == "breakpoint") { @@ -707,10 +738,13 @@ void DapEngine::handleOutput(const QJsonDocument &data) notifyInferiorStopOk(); else notifyInferiorSpontaneousStop(); + threads(); return; } if (event == "thread") { + threads(); + showMessage(event, LogDebug); if (body.value("reason").toString() == "started" && body.value("threadId").toInt() == 1) claimInitialBreakpoints(); diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index c9b517674a7..746a1be2844 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -83,6 +83,7 @@ private: void handleDabConfigurationDone(); void dabStackTrace(); + void threads(); void handleDapDone(); void readDapStandardOutput(); From 0bc14bfd7dde33d4456c7b662a4e74ede81a1937 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 21 Jun 2023 17:56:17 +0200 Subject: [PATCH 0026/1777] Core: Remove some unneeded semicolons Change-Id: Iba7cbd09a879e4ae904fab2abd8acf74715c5b4d Reviewed-by: Reviewed-by: Eike Ziller --- src/plugins/coreplugin/dialogs/ioptionspage.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index f4801b7c734..4007a3219ef 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -16,9 +16,9 @@ #include -namespace Layouting { class LayoutItem; }; +namespace Layouting { class LayoutItem; } -namespace Utils { class AspectContainer; }; +namespace Utils { class AspectContainer; } namespace Core { From 39837d9c26aac8c4ecfc41378fb575a8aebafd36 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 20 Jun 2023 14:59:37 +0200 Subject: [PATCH 0027/1777] Utils: ensureWritableDir returns expected_str Allows calling code to get better feedback to user. Change-Id: I6d11787d314921dc052e87a8348683b221a17425 Reviewed-by: hjk --- src/libs/utils/devicefileaccess.cpp | 117 ++++++++++-------- src/libs/utils/devicefileaccess.h | 4 +- src/libs/utils/filepath.cpp | 2 +- src/libs/utils/filepath.h | 2 +- .../projectexplorer/buildconfiguration.cpp | 2 +- src/plugins/squish/squishtesttreeview.cpp | 10 +- src/plugins/squish/suiteconf.cpp | 6 +- 7 files changed, 80 insertions(+), 63 deletions(-) diff --git a/src/libs/utils/devicefileaccess.cpp b/src/libs/utils/devicefileaccess.cpp index bd139d9b168..54f1ab2121c 100644 --- a/src/libs/utils/devicefileaccess.cpp +++ b/src/libs/utils/devicefileaccess.cpp @@ -18,10 +18,10 @@ #include #include +#include #include #include #include -#include #ifdef Q_OS_WIN #ifdef QTCREATOR_PCH_H @@ -113,11 +113,22 @@ bool DeviceFileAccess::hasHardLinks(const FilePath &filePath) const return false; } -bool DeviceFileAccess::ensureWritableDirectory(const FilePath &filePath) const +expected_str DeviceFileAccess::ensureWritableDirectory(const FilePath &filePath) const { if (isWritableDirectory(filePath)) - return true; - return createDirectory(filePath); + return {}; + + if (exists(filePath)) { + return make_unexpected(Tr::tr("Path \"%1\" exists but is not a writable directory.") + .arg(filePath.toUserOutput())); + } + + const bool result = createDirectory(filePath); + if (result) + return {}; + + return make_unexpected( + Tr::tr("Failed to create directory \"%1\".").arg(filePath.toUserOutput())); } bool DeviceFileAccess::ensureExistingFile(const FilePath &filePath) const @@ -166,31 +177,24 @@ expected_str DeviceFileAccess::copyFile(const FilePath &filePath, const Fi expected_str copyRecursively_fallback(const FilePath &src, const FilePath &target) { - QString error; + expected_str result; src.iterateDirectory( - [&target, &src, &error](const FilePath &path) { + [&target, &src, &result](const FilePath &path) { const FilePath relative = path.relativePathFrom(src); const FilePath targetPath = target.pathAppended(relative.path()); - - if (!targetPath.parentDir().ensureWritableDir()) { - error = QString("Could not create directory %1") - .arg(targetPath.parentDir().toUserOutput()); + result = targetPath.parentDir().ensureWritableDir(); + if (!result) return IterationPolicy::Stop; - } - const expected_str result = path.copyFile(targetPath); - if (!result) { - error = result.error(); + result = path.copyFile(targetPath); + if (!result) return IterationPolicy::Stop; - } + return IterationPolicy::Continue; }, {{"*"}, QDir::NoDotAndDotDot | QDir::Files, QDirIterator::Subdirectories}); - if (error.isEmpty()) - return {}; - - return make_unexpected(error); + return result; } expected_str DeviceFileAccess::copyRecursively(const FilePath &src, @@ -200,12 +204,12 @@ expected_str DeviceFileAccess::copyRecursively(const FilePath &src, return make_unexpected( Tr::tr("Cannot copy from \"%1\", it is not a directory.").arg(src.toUserOutput())); } - - if (!target.ensureWritableDir()) { - return make_unexpected( - Tr::tr("Cannot copy \"%1\" to \"%2\", it is not a writable directory.") - .arg(src.toUserOutput()) - .arg(target.toUserOutput())); + const expected_str result = target.ensureWritableDir(); + if (!result) { + return make_unexpected(Tr::tr("Cannot copy \"%1\" to \"%2\": %3") + .arg(src.toUserOutput()) + .arg(target.toUserOutput()) + .arg(result.error())); } #ifdef UTILS_STATIC_LIBRARY @@ -386,7 +390,6 @@ expected_str DeviceFileAccess::createTempFile(const FilePath &filePath Tr::tr("createTempFile is not implemented for \"%1\".").arg(filePath.toUserOutput())); } - // DesktopDeviceFileAccess DesktopDeviceFileAccess::~DesktopDeviceFileAccess() = default; @@ -513,12 +516,23 @@ bool DesktopDeviceFileAccess::hasHardLinks(const FilePath &filePath) const return false; } -bool DesktopDeviceFileAccess::ensureWritableDirectory(const FilePath &filePath) const +expected_str DesktopDeviceFileAccess::ensureWritableDirectory(const FilePath &filePath) const { const QFileInfo fi(filePath.path()); if (fi.isDir() && fi.isWritable()) - return true; - return QDir().mkpath(filePath.path()); + return {}; + + if (fi.exists()) { + return make_unexpected(Tr::tr("Path \"%1\" exists but is not a writable directory.") + .arg(filePath.toUserOutput())); + } + + const bool result = QDir().mkpath(filePath.path()); + if (result) + return {}; + + return make_unexpected( + Tr::tr("Failed to create directory \"%1\".").arg(filePath.toUserOutput())); } bool DesktopDeviceFileAccess::ensureExistingFile(const FilePath &filePath) const @@ -945,7 +959,9 @@ expected_str UnixDeviceFileAccess::copyFile(const FilePath &filePath, if (result.exitCode != 0) { return make_unexpected(Tr::tr("Failed to copy file \"%1\" to \"%2\": %3") - .arg(filePath.toUserOutput(), target.toUserOutput(), QString::fromUtf8(result.stdErr))); + .arg(filePath.toUserOutput(), + target.toUserOutput(), + QString::fromUtf8(result.stdErr))); } return {}; } @@ -1080,7 +1096,8 @@ QStringList UnixDeviceFileAccess::statArgs(const FilePath &filePath, const QString &linuxFormat, const QString &macFormat) const { - return (filePath.osType() == OsTypeMac ? QStringList{"-f", macFormat} : QStringList{"-c", linuxFormat}) + return (filePath.osType() == OsTypeMac ? QStringList{"-f", macFormat} + : QStringList{"-c", linuxFormat}) << "-L" << filePath.path(); } @@ -1173,8 +1190,8 @@ bool UnixDeviceFileAccess::iterateWithFind(const FilePath &filePath, // TODO: Using stat -L will always return the link target, not the link itself. // We may wan't to add the information that it is a link at some point. - const QString statFormat = filePath.osType() == OsTypeMac - ? QLatin1String("-f \"%p %m %z\"") : QLatin1String("-c \"%f %Y %s\""); + const QString statFormat = filePath.osType() == OsTypeMac ? QLatin1String("-f \"%p %m %z\"") + : QLatin1String("-c \"%f %Y %s\""); if (callBack.index() == 1) cmdLine.addArgs(QString(R"(-exec echo -n \"{}\"" " \; -exec stat -L %1 "{}" \;)") @@ -1202,24 +1219,23 @@ bool UnixDeviceFileAccess::iterateWithFind(const FilePath &filePath, const int modeBase = filePath.osType() == OsTypeMac ? 8 : 16; - const auto toFilePath = - [&filePath, &callBack, modeBase](const QString &entry) { - if (callBack.index() == 0) - return std::get<0>(callBack)(filePath.withNewPath(entry)); + const auto toFilePath = [&filePath, &callBack, modeBase](const QString &entry) { + if (callBack.index() == 0) + return std::get<0>(callBack)(filePath.withNewPath(entry)); - const QString fileName = entry.mid(1, entry.lastIndexOf('\"') - 1); - const QString infos = entry.mid(fileName.length() + 3); + const QString fileName = entry.mid(1, entry.lastIndexOf('\"') - 1); + const QString infos = entry.mid(fileName.length() + 3); - const FilePathInfo fi = FileUtils::filePathInfoFromTriple(infos, modeBase); - if (!fi.fileFlags) - return IterationPolicy::Continue; + const FilePathInfo fi = FileUtils::filePathInfoFromTriple(infos, modeBase); + if (!fi.fileFlags) + return IterationPolicy::Continue; - const FilePath fp = filePath.withNewPath(fileName); - // Do not return the entry for the directory we are searching in. - if (fp.path() == filePath.path()) - return IterationPolicy::Continue; - return std::get<1>(callBack)(fp, fi); - }; + const FilePath fp = filePath.withNewPath(fileName); + // Do not return the entry for the directory we are searching in. + if (fp.path() == filePath.path()) + return IterationPolicy::Continue; + return std::get<1>(callBack)(fp, fi); + }; // Remove the first line, this can be the directory we are searching in. // as long as we do not specify "mindepth > 0" @@ -1238,7 +1254,8 @@ void UnixDeviceFileAccess::findUsingLs(const QString ¤t, const FileFilter &filter, QStringList *found) const { - const RunResult result = runInShell({"ls", {"-1", "-a", "-p", "--", current}, OsType::OsTypeLinux}); + const RunResult result = runInShell( + {"ls", {"-1", "-a", "-p", "--", current}, OsType::OsTypeLinux}); const QStringList entries = QString::fromUtf8(result.stdOut).split('\n', Qt::SkipEmptyParts); for (QString entry : entries) { const QChar last = entry.back(); @@ -1317,4 +1334,4 @@ Environment UnixDeviceFileAccess::deviceEnvironment() const return Environment(out.split('\n', Qt::SkipEmptyParts), OsTypeLinux); } -} // Utils +} // namespace Utils diff --git a/src/libs/utils/devicefileaccess.h b/src/libs/utils/devicefileaccess.h index 0f8282477f6..6dddbc70045 100644 --- a/src/libs/utils/devicefileaccess.h +++ b/src/libs/utils/devicefileaccess.h @@ -35,7 +35,7 @@ protected: virtual bool isDirectory(const FilePath &filePath) const; virtual bool isSymLink(const FilePath &filePath) const; virtual bool hasHardLinks(const FilePath &filePath) const; - virtual bool ensureWritableDirectory(const FilePath &filePath) const; + virtual expected_str ensureWritableDirectory(const FilePath &filePath) const; virtual bool ensureExistingFile(const FilePath &filePath) const; virtual bool createDirectory(const FilePath &filePath) const; virtual bool exists(const FilePath &filePath) const; @@ -92,7 +92,7 @@ protected: bool isDirectory(const FilePath &filePath) const override; bool isSymLink(const FilePath &filePath) const override; bool hasHardLinks(const FilePath &filePath) const override; - bool ensureWritableDirectory(const FilePath &filePath) const override; + expected_str ensureWritableDirectory(const FilePath &filePath) const override; bool ensureExistingFile(const FilePath &filePath) const override; bool createDirectory(const FilePath &filePath) const override; bool exists(const FilePath &filePath) const override; diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 9059a37ecc3..e7697f1bc8f 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -486,7 +486,7 @@ bool FilePath::isWritableFile() const \sa createDir() */ -bool FilePath::ensureWritableDir() const +expected_str FilePath::ensureWritableDir() const { return fileAccess()->ensureWritableDirectory(*this); } diff --git a/src/libs/utils/filepath.h b/src/libs/utils/filepath.h index f313ba5ff92..ae71d3f2e31 100644 --- a/src/libs/utils/filepath.h +++ b/src/libs/utils/filepath.h @@ -108,7 +108,7 @@ public: bool isWritableDir() const; bool isWritableFile() const; - bool ensureWritableDir() const; + expected_str ensureWritableDir() const; bool ensureExistingFile() const; bool isExecutableFile() const; bool isReadableFile() const; diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 70d5a348c1c..a1e440d7c4e 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -293,7 +293,7 @@ MacroExpander *BuildConfiguration::macroExpander() const bool BuildConfiguration::createBuildDirectory() { - const bool result = buildDirectory().ensureWritableDir(); + const bool result = buildDirectory().ensureWritableDir().has_value(); buildDirectoryAspect()->validateInput(); return result; } diff --git a/src/plugins/squish/squishtesttreeview.cpp b/src/plugins/squish/squishtesttreeview.cpp index d01ab0440f5..2a1b85a0887 100644 --- a/src/plugins/squish/squishtesttreeview.cpp +++ b/src/plugins/squish/squishtesttreeview.cpp @@ -167,8 +167,8 @@ static bool copyScriptTemplates(const SuiteConf &suiteConf, const Utils::FilePat QTC_ASSERT(s, return false); // copy template files - bool ok = destination.ensureWritableDir(); - QTC_ASSERT(ok, return false); + Utils::expected_str result = destination.ensureWritableDir(); + QTC_ASSERT_EXPECTED(result, return false); const bool scripted = suiteConf.objectMapStyle() == "script"; const QString extension = suiteConf.scriptExtension(); @@ -178,12 +178,12 @@ static bool copyScriptTemplates(const SuiteConf &suiteConf, const Utils::FilePat const Utils::FilePath test = scripts.pathAppended(testStr + extension); const Utils::FilePath testFile = destination.pathAppended("test" + extension); QTC_ASSERT(!testFile.exists(), return false); - const Utils::expected_str result = test.copyFile(testFile); + result = test.copyFile(testFile); QTC_ASSERT_EXPECTED(result, return false); if (scripted) - ok = suiteConf.ensureObjectMapExists(); - return ok; + return suiteConf.ensureObjectMapExists(); + return true; } void SquishTestTreeItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, diff --git a/src/plugins/squish/suiteconf.cpp b/src/plugins/squish/suiteconf.cpp index 9513b566698..b47034e67cc 100644 --- a/src/plugins/squish/suiteconf.cpp +++ b/src/plugins/squish/suiteconf.cpp @@ -324,9 +324,9 @@ bool SuiteConf::ensureObjectMapExists() const return true; const Utils::FilePath objectMap = scripts.pathAppended("objectmap_template" + extension); - bool ok = destinationObjectMap.parentDir().ensureWritableDir(); - QTC_ASSERT(ok, return false); - const Utils::expected_str result = objectMap.copyFile(destinationObjectMap); + Utils::expected_str result = destinationObjectMap.parentDir().ensureWritableDir(); + QTC_ASSERT_EXPECTED(result, return false); + result = objectMap.copyFile(destinationObjectMap); QTC_ASSERT_EXPECTED(result, return false); return true; } From 68b750d83d226854911693ee4f28a723b44aea30 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 20 Jun 2023 15:01:02 +0200 Subject: [PATCH 0028/1777] RemoteLinux: Use FilePath to create directories Change-Id: I90986632fd601b588f7ca0459b5eb62ac2379d97 Reviewed-by: Jarek Kobus --- src/plugins/remotelinux/rsyncdeploystep.cpp | 54 +++++++++++++-------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index 317b08bb77c..83d729108b2 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -7,6 +7,7 @@ #include "remotelinux_constants.h" #include "remotelinuxtr.h" +#include #include #include #include @@ -16,6 +17,7 @@ #include #include +#include #include #include @@ -87,30 +89,42 @@ bool RsyncDeployStep::isDeploymentNecessary() const GroupItem RsyncDeployStep::mkdirTask() { - const auto setupHandler = [this](Process &process) { - QStringList remoteDirs; - for (const FileToTransfer &file : std::as_const(m_files)) - remoteDirs << file.m_target.parentDir().path(); - remoteDirs.sort(); - remoteDirs.removeDuplicates(); - process.setCommand({deviceConfiguration()->filePath("mkdir"), - QStringList("-p") + remoteDirs}); - connect(&process, &Process::readyReadStandardError, this, [this, proc = &process] { - handleStdErrData(QString::fromLocal8Bit(proc->readAllRawStandardError())); + using ResultType = expected_str; + + const auto onSetup = [files = m_files](Async &async) { + FilePaths remoteDirs; + for (const FileToTransfer &file : std::as_const(files)) + remoteDirs << file.m_target.parentDir(); + + FilePath::sort(remoteDirs); + FilePath::removeDuplicates(remoteDirs); + + async.setConcurrentCallData([remoteDirs](QPromise &promise) { + for (auto dir : remoteDirs) { + const expected_str result = dir.ensureWritableDir(); + promise.addResult(result); + if (!result) + promise.future().cancel(); + } }); }; - const auto errorHandler = [this](const Process &process) { - QString finalMessage = process.errorString(); - const QString stdErr = process.cleanedStdErr(); - if (!stdErr.isEmpty()) { - if (!finalMessage.isEmpty()) - finalMessage += '\n'; - finalMessage += stdErr; + + const auto onError = [this](const Async &async) { + const int numResults = async.future().resultCount(); + if (numResults == 0) { + addErrorMessage( + Tr::tr("Unknown error occurred while trying to create remote directories") + '\n'); + return; + } + + for (int i = 0; i < numResults; ++i) { + const auto result = async.future().resultAt(i); + if (!result.has_value()) + addErrorMessage(result.error()); } - addErrorMessage(Tr::tr("Deploy via rsync: failed to create remote directories:") - + '\n' + finalMessage); }; - return ProcessTask(setupHandler, {}, errorHandler); + + return AsyncTask(onSetup, {}, onError); } GroupItem RsyncDeployStep::transferTask() From 87861cf7eefbfa56d0ef46133930b4bb7dc97267 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 25 May 2023 12:13:36 +0200 Subject: [PATCH 0029/1777] Wizards: Format generated code according to current style Needs ClangFormat to be enabled. Task-number: QTCREATORBUG-25065 Change-Id: I127da0f9ac55af7f19dead19b28470a9b72c4ee5 Reviewed-by: Eike Ziller Reviewed-by: David Schulz --- .../coreplugin/basefilewizardfactory.cpp | 12 ++++++--- .../editormanager/editormanager.cpp | 25 ++++++++++++++++++- .../coreplugin/editormanager/editormanager.h | 3 +++ src/plugins/coreplugin/idocument.cpp | 7 ++++++ src/plugins/coreplugin/idocument.h | 1 + .../projectexplorer/jsonwizard/jsonwizard.cpp | 8 ++++++ src/plugins/texteditor/textdocument.cpp | 6 +++++ src/plugins/texteditor/textdocument.h | 1 + 8 files changed, 58 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/basefilewizardfactory.cpp b/src/plugins/coreplugin/basefilewizardfactory.cpp index 3f7d4c771fb..0e4652b7e53 100644 --- a/src/plugins/coreplugin/basefilewizardfactory.cpp +++ b/src/plugins/coreplugin/basefilewizardfactory.cpp @@ -165,12 +165,16 @@ bool BaseFileWizardFactory::postGenerateOpenEditors(const GeneratedFiles &l, QSt { for (const GeneratedFile &file : std::as_const(l)) { if (file.attributes() & GeneratedFile::OpenEditorAttribute) { - if (!EditorManager::openEditor(file.filePath(), file.editorId())) { - if (errorMessage) - *errorMessage = Tr::tr("Failed to open an editor for \"%1\"."). - arg(file.filePath().toUserOutput()); + IEditor * const editor = EditorManager::openEditor(file.filePath(), file.editorId()); + if (!editor) { + if (errorMessage) { + *errorMessage = Tr::tr("Failed to open an editor for \"%1\".") + .arg(file.filePath().toUserOutput()); + } return false; } + editor->document()->formatContents(); + editor->document()->save(nullptr); } } return true; diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 261146797b4..e617e98d1c7 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -76,12 +76,14 @@ #include #include #include -#include #if defined(WITH_TESTS) #include #endif +#include +#include + enum { debugEditorManager=0 }; static const char kCurrentDocumentPrefix[] = "CurrentDocument"; @@ -2975,6 +2977,27 @@ void EditorManager::populateOpenWithMenu(QMenu *menu, const FilePath &filePath) menu->setEnabled(anyMatches); } +void EditorManager::runWithTemporaryEditor(const Utils::FilePath &filePath, + const std::function &callback) +{ + const MimeType mt = mimeTypeForFile(filePath, MimeMatchMode::MatchDefaultAndRemote); + const QList factories = Utils::transform( + EditorType::defaultEditorTypes(mt), [](EditorType *t) { + return t->asEditorFactory(); }); + for (IEditorFactory * const factory : factories) { + if (!factory) + continue; + std::unique_ptr editor(factory->createEditor()); + if (!editor) + continue; + editor->document()->setTemporary(true); + if (editor->document()->open(nullptr, filePath, filePath) != IDocument::OpenResult::Success) + continue; + callback(editor.get()); + break; + } +} + /*! Returns reload behavior settings. */ diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index 09218f42c3e..ea0fd5df8cd 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -143,6 +143,9 @@ public: static void addNativeDirAndOpenWithActions(QMenu *contextMenu, DocumentModel::Entry *entry); static void populateOpenWithMenu(QMenu *menu, const Utils::FilePath &filePath); + static void runWithTemporaryEditor(const Utils::FilePath &filePath, + const std::function &callback); + public: // for tests static IDocument::ReloadSetting reloadSetting(); static void setReloadSetting(IDocument::ReloadSetting behavior); diff --git a/src/plugins/coreplugin/idocument.cpp b/src/plugins/coreplugin/idocument.cpp index 5dcff9d3fc1..c6fdac85736 100644 --- a/src/plugins/coreplugin/idocument.cpp +++ b/src/plugins/coreplugin/idocument.cpp @@ -401,6 +401,13 @@ bool IDocument::setContents(const QByteArray &contents) return false; } +/*! + Formats the contents of the document, if the implementation supports such functionality. +*/ +void IDocument::formatContents() +{ +} + /*! Returns the absolute path of the file that this document refers to. May be empty for documents that are not backed by a file. diff --git a/src/plugins/coreplugin/idocument.h b/src/plugins/coreplugin/idocument.h index b771843056b..8fbca1d02f7 100644 --- a/src/plugins/coreplugin/idocument.h +++ b/src/plugins/coreplugin/idocument.h @@ -72,6 +72,7 @@ public: virtual QByteArray contents() const; virtual bool setContents(const QByteArray &contents); + virtual void formatContents(); const Utils::FilePath &filePath() const; virtual void setFilePath(const Utils::FilePath &filePath); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp index 6bc09c5e58f..8204f7aaa25 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp @@ -424,6 +424,10 @@ void JsonWizard::openFiles(const JsonWizard::GeneratorFiles &files) { QString errorMessage; bool openedSomething = stringValue("DoNotOpenFile") == "true"; + static const auto formatFile = [](Core::IEditor *editor) { + editor->document()->formatContents(); + editor->document()->save(nullptr); + }; for (const JsonWizard::GeneratorFile &f : files) { const Core::GeneratedFile &file = f.file; if (!file.filePath().exists()) { @@ -454,8 +458,12 @@ void JsonWizard::openFiles(const JsonWizard::GeneratorFiles &files) break; } else if (file.attributes() & Core::GeneratedFile::TemporaryFile) { editor->document()->setTemporary(true); + } else { + formatFile(editor); } openedSomething = true; + } else if (file.filePath().fileSize() < 100 * 1024 ) { + Core::EditorManager::runWithTemporaryEditor(file.filePath(), formatFile); } } diff --git a/src/plugins/texteditor/textdocument.cpp b/src/plugins/texteditor/textdocument.cpp index f8512e9a111..bff716ea8ba 100644 --- a/src/plugins/texteditor/textdocument.cpp +++ b/src/plugins/texteditor/textdocument.cpp @@ -717,6 +717,12 @@ bool TextDocument::setContents(const QByteArray &contents) return setPlainText(QString::fromUtf8(contents)); } +void TextDocument::formatContents() +{ + d->m_indenter->format({{document()->firstBlock().blockNumber() + 1, + document()->lastBlock().blockNumber() + 1}}); +} + bool TextDocument::shouldAutoSave() const { return d->m_autoSaveRevision != d->m_document.revision(); diff --git a/src/plugins/texteditor/textdocument.h b/src/plugins/texteditor/textdocument.h index 6527aefd5f4..a4dd3dd45f0 100644 --- a/src/plugins/texteditor/textdocument.h +++ b/src/plugins/texteditor/textdocument.h @@ -103,6 +103,7 @@ public: // IDocument implementation. QByteArray contents() const override; bool setContents(const QByteArray &contents) override; + void formatContents() override; bool shouldAutoSave() const override; bool isModified() const override; bool isSaveAsAllowed() const override; From 8d84ae37e9d557222e1cd435328ef32ceaae0785 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 21 Jun 2023 16:55:55 +0200 Subject: [PATCH 0030/1777] Debugger: Fix some Qt dev deprecation warnings Change-Id: I3a35b7d30b749a7139a54097aa73681a0b870e29 Reviewed-by: Qt CI Bot Reviewed-by: David Schulz Reviewed-by: --- src/plugins/debugger/cdb/cdbengine.cpp | 2 +- src/plugins/debugger/debuggerprotocol.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 28d90c747cf..bb750f4753f 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -2119,7 +2119,7 @@ void CdbEngine::handleExtensionMessage(char t, int token, const QString &what, c if (what == "debuggee_output") { const QByteArray decoded = QByteArray::fromHex(message.toUtf8()); - showMessage(QString::fromUtf16(reinterpret_cast(decoded.data()), decoded.size() / 2), + showMessage(QString::fromUtf16(reinterpret_cast(decoded.data()), decoded.size() / 2), AppOutput); return; } diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index 8ab7a71b339..3740b5b3b63 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -655,13 +655,13 @@ QString decodeData(const QString &ba, const QString &encoding) } case DebuggerEncoding::HexEncodedUtf16: { const QByteArray decodedBa = QByteArray::fromHex(ba.toUtf8()); - result = QString::fromUtf16(reinterpret_cast + result = QString::fromUtf16(reinterpret_cast (decodedBa.data()), decodedBa.size() / 2); break; } case DebuggerEncoding::HexEncodedUcs4: { const QByteArray decodedBa = QByteArray::fromHex(ba.toUtf8()); - result = QString::fromUcs4(reinterpret_cast + result = QString::fromUcs4(reinterpret_cast (decodedBa.data()), decodedBa.size() / 4); break; } @@ -706,7 +706,7 @@ QString decodeData(const QString &ba, const QString &encoding) const QByteArray scopeId = p == -1 ? QByteArray() : QByteArray::fromHex(ba.mid(p + 1).toUtf8()); if (!scopeId.isEmpty()) - ip6.setScopeId(QString::fromUtf16(reinterpret_cast(scopeId.constData()), + ip6.setScopeId(QString::fromUtf16(reinterpret_cast(scopeId.constData()), scopeId.length() / 2)); return ip6.toString(); } From 153cd8464db10927a417aa2432a9d636b0766c3d Mon Sep 17 00:00:00 2001 From: Olivier Delaune Date: Mon, 12 Jun 2023 23:47:08 +0200 Subject: [PATCH 0031/1777] Update many French translations Change-Id: I2a006464070dc766df377b8da32c0b443854f05c Reviewed-by: Eike Ziller Reviewed-by: Johnny Jazeix Reviewed-by: --- share/qtcreator/translations/qtcreator_fr.ts | 90824 +++++++++-------- 1 file changed, 48459 insertions(+), 42365 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index 14a146f2109..c2573bd2729 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -2,42 +2,12489 @@ - Application + AbstractButtonSection - Failed to load core: %1 - Échec dans le chargement du core : %1 + Button Content + Contenu d’un bouton - Unable to send command line arguments to the already running instance. It appears to be not responding. Do you want to start a new instance of Creator? - Impossible d'envoyer les arguments en ligne de commande à une instance déjà lancée. Il semble qu'elle ne réponde pas. Voulez-vous lancer une nouvelle instance de Qt Creator ? + Text + Texte - Unable to send command line arguments to the already running instance. It appears to be not responding. - Impossible de passer les arguments de la ligne de commande à l'instance en cours d'exécution. Elle semble ne pas répondre. + Text displayed on the button. + Texte affiché sur le bouton. - Could not send message - Impossible d'envoyer un message + Display + Affichage - Unable to send command line arguments to the already running instance.It appears to be not responding. Do you want to start a new instance of Creator? - Impossible d'envoyer les arguments en ligne de commande à une instance déjà lancée. Il semble qu'elle ne réponde pas. Voulez-vous lancer une nouvelle instance de Qt Creator ? + Determines how the icon and text are displayed within the button. + Détermine comment l’icône et le texte sont affichés dans le bouton. - Could not find 'Core.pluginspec' in %1 - 'Core.pluginspec' introuvable dans %1 + Checkable + Cochable - Qt Creator - Plugin loader messages - Qt Creator - messages du chargeur de plug-in + Whether the button is checkable. + Si le bouton est cochable. - Couldn't find 'Core.pluginspec' in %1 - 'Core.pluginspec' introuvable dans %1 + Checked + Coché + + + Whether the button is checked. + Si le bouton est coché. + + + Exclusive + Exclusif + + + Whether the button is exclusive. + Si le bouton est exclusif. + + + Auto-repeat + Répétition automatique + + + Whether the button repeats pressed(), released() and clicked() signals while the button is pressed and held down. + Si le bouton répète les signaux pressed(), released() et clicked() pendant que le bouton est pressé et maintenu enfoncé. + + + Repeat delay + Délai de répétition + + + Initial delay of auto-repetition in milliseconds. + Délai initial de répétition automatique en millisecondes. + + + Repeat interval + Intervalle de répétition + + + Interval of auto-repetition in milliseconds. + Intervalle de répétition automatique en millisecondes. + + + + AccountImage + + Account + Compte + + + + AddImageToResources + + File Name + Nom du fichier + + + Size + Taille + + + Add Resources + Ajouter des ressources + + + &Browse... + &Parcourir… + + + Target Directory + Répertoire cible + + + + AddModuleView + + Select a Module to Add + Sélectionner un module à ajouter + + + + AddSignalHandlerDialog + + Implement Signal Handler + Mise en œuvre d’un gestionnaire de signaux + + + Frequently used signals + Signaux fréquemment utilisés + + + Property changes + Changements de propriété + + + All signals + Tous les signaux + + + Signal: + Signal : + + + Choose the signal you want to handle: + Sélectionner le signal à gérer : + + + The item will be exported automatically. + L’élément sera exporté automatiquement. + + + + AdvancedSection + + Advanced + Avancé + + + Enabled + Activé + + + Smooth + Lissage + + + Antialiasing + Anticrénelage + + + Focus + Focus + + + Sets focus on the component within the enclosing focus scope. + Définit la mise au point sur le composant dans l’étendue de la mise au point qui l’entoure. + + + Focus on tab + Focus sur l’onglet + + + Adds the component to the tab focus chain. + Ajoute le composant à la chaîne de focus de l’onglet. + + + Baseline offset + Décalage de la ligne de base + + + Position of the component's baseline in local coordinates. + Position de la ligne de base du composant en coordonnées locales. + + + + AlignCamerasToViewAction + + Align Selected Cameras to View + Aligner les caméras sélectionnées sur la vue + + + Align View to Selected Camera + Aligner la vue sur les caméras sélectionnées + + + + AlignDistributeSection + + Alignment + Alignement + + + Align left edges. + Aligner les bords à gauche. + + + Align horizontal centers. + Aligner les centres horizontaux. + + + Align right edges. + Aligner les bords à droite. + + + Align top edges. + Aligner les bords en haut. + + + Align vertical centers. + Aligner les centres verticaux. + + + Align bottom edges. + Aligner les bords en bas. + + + Distribute objects + Répartir les objets + + + Distribute left edges. + Répartir les bords à gauche. + + + Distribute horizontal centers. + Répartir les centres horizontaux. + + + Distribute right edges. + Répartir les bords à droite. + + + Distribute top edges. + Répartir les bords en haut. + + + Distribute vertical centers. + Répartir les centres verticaux. + + + Distribute bottom edges. + Répartir les bords en bas. + + + Distribute spacing + Répartir l’espacement + + + Distribute spacing horizontally. + Répartir l’espacement horizontalement. + + + Distribute spacing vertically. + Répartir l’espacement verticalement. + + + Disables the distribution of spacing in pixels. + Désactive la répartition de l’espacement en pixels. + + + Sets the left or top border of the target area or item as the starting point, depending on the distribution orientation. + Définit le bord gauche ou supérieur de la zone ou de l’élément cible comme point de départ, en fonction de l’orientation de la répartition. + + + Sets the horizontal or vertical center of the target area or item as the starting point, depending on the distribution orientation. + Définit le centre horizontal ou vertical de la zone ou de l’élément cible comme point de départ, en fonction de l’orientation de la répartition. + + + Sets the bottom or right border of the target area or item as the starting point, depending on the distribution orientation. + Définit le bord droit ou inférieur de la zone ou de l’élément cible comme point de départ, en fonction de l’orientation de la répartition. + + + Pixel spacing + Espacement des pixels + + + Align to + Aligner sur + + + Key object + Objet clé + + + Warning + Avertissement + + + - The selection contains the root component. + - La sélection contient le composant racine. + + + - The selection contains a non-visual component. + - La sélection contient un composant non-visuel. + + + - A component in the selection uses anchors. + - Un composant de la sélection utilise des ancres. + + + + AnchorButtons + + Anchors can only be applied to child items. + Les ancres ne peuvent être appliquées qu’aux éléments enfants. + + + Anchors can only be applied to the base state. + Les ancres ne peuvent être appliquées qu’aux états de base. + + + Anchor component to the top. + Ancrer le composant en haut. + + + Anchor component to the bottom. + Ancrer le composant en bas. + + + Anchor component to the left. + Ancrer le composant à gauche. + + + Anchor component to the right. + Ancrer le composant à droite. + + + Fill parent component. + Remplir le composant parent. + + + Anchor component vertically. + Ancrer le composant verticalement. + + + Anchor component horizontally. + Ancrer le composant horizontalement. + + + + AnchorRow + + Target + Cible + + + Margin + Marge + + + Anchor to the top of the target. + Ancrer en haut de la cible. + + + Anchor to the left of the target. + Ancrer à gauche de la cible. + + + Anchor to the vertical center of the target. + Ancrer au centre vertical de la cible. + + + Anchor to the horizontal center of the target. + Ancrer au centre horizontal de la cible. + + + Anchor to the bottom of the target. + Ancrer en bas de la cible. + + + Anchor to the right of the target. + Ancrer à droite de la cible. + + + + AnimatedImageSpecifics + + Image + Image + + + Animated image + Image animé + + + Speed + Vitesse + + + Playing + En cours + + + Whether the animation is playing or paused. + Si l’animation est en cours de lecture ou en pause. + + + + AnimationSection + + Animation + Animation + + + Running + En cours d’exécution + + + Whether the animation is running and/or paused. + Si l’animation est en cours et/ou en pause. + + + Loops + Boucles + + + Number of times the animation should play. + Nombre de fois que l’animation doit être jouée. + + + Duration + Durée + + + Duration of the animation in milliseconds. + Durée de l’animation en millisecondes. + + + Run to end + Exécuter jusqu’à la fin + + + Runs the animation to completion when it is stopped. + Exécute l’animation jusqu’à son terme lorsqu’elle est arrêtée. + + + Easing curve + Courbe d’assouplissement + + + Defines a custom easing curve. + Définit une courbe d’assouplissement personnalisée. + + + + AnimationTargetSection + + Animation Targets + Cibles d’animation + + + Target + Cible + + + Target to animate the properties of. + Cible pour animer les propriétés de. + + + Property + Propriété + + + Property to animate. + Propriété à animer. + + + Properties + Propriétés + + + Properties to animate. + Propriétés à animer. + + + + ApplicationWindowSpecifics + + Window + Fenêtre + + + Title + Titre + + + Size + Taille + + + Color + Couleur + + + Visible + Visible + + + Opacity + Opacité + + + + AssetDelegate + + (empty) + (vide) + + + + Assets + + Add a new asset to the project. + + + + No match found. + Aucun résultat. + + + Looks like you don't have any assets yet. + + + + Drag-and-drop your assets here or click the '+' button to browse assets from the file system. + + + + + AssetsContextMenu + + Delete Files + Supprimer les fichiers + + + Add Textures + Ajouter des textures + + + Delete File + Supprimer le fichier + + + Add Texture + Ajouter une texture + + + Expand All + Tout développer + + + Collapse All + Tout réduire + + + Add Light Probe + + + + Rename Folder + Renommer le dossier + + + New Folder + Nouveau dossier + + + Delete Folder + Supprimer le dossier + + + New Effect + Nouvel effet + + + + AudioSection + + Audio + Audio + + + Volume + Volume + + + Muted + En sourdine + + + + BackgroundColorMenuActions + + Background Color Actions + Actions sur la couleur d’arrière-plan + + + + BorderImageSpecifics + + Source + Source + + + W + width + The width of the object + + + + H + height + The height of the object + + + + Tile mode H + + + + Tile mode V + + + + Border left + + + + Border right + + + + Border top + + + + Border bottom + + + + Mirror + + + + Specifies whether the image should be horizontally inverted. + + + + Smooth + Lissage + + + Specifies whether the image is smoothly filtered when scaled or transformed. + + + + Cache + Cache + + + Specifies whether the image should be cached. + + + + Asynchronous + + + + Specifies that images on the local filesystem should be loaded asynchronously in a separate thread. + + + + Border Image + Image avec bordure + + + Source size + Taille de la source + + + + BusyIndicatorSpecifics + + Busy Indicator + + + + Running + En cours d’exécution + + + Whether the busy indicator is currently indicating activity. + + + + Live + + + + + ButtonSection + + Button + Bouton + + + Appearance + + + + Whether the button is flat and/or highlighted. + + + + Flat + + + + Highlight + + + + + ButtonSpecifics + + Button + Bouton + + + Text + Texte + + + Checked + Coché + + + Text displayed on the button. + Texte affiché sur le bouton. + + + State of the button. + État du bouton. + + + Checkable + Cochable + + + Determines whether the button is checkable or not. + Détermine si le bouton est cochable ou non. + + + Enabled + Activé + + + Determines whether the button is enabled or not. + Détermine si le bouton est activé ou non. + + + Default button + Bouton par défaut + + + Sets the button as the default button in a dialog. + Définit le bouton comme bouton par défaut dans la boite de dialogue. + + + Tool tip + Info-bulle + + + The tool tip shown for the button. + L’info-bulle affichée pour le bouton. + + + Focus on press + Focus à l’appui + + + Determines whether the button gets focus if pressed. + Déterminer si le bouton reçoit le focus lors d’un appui. + + + Icon source + Source de l’icône + + + The URL of an icon resource. + L’URL de la ressource pour l’icône. + + + + CameraToggleAction + + Toggle Perspective/Orthographic Edit Camera + + + + + ChangeStyleWidgetAction + + Change style for Qt Quick Controls 2. + Changer le style de Qt Quick Controls 2. + + + Change style for Qt Quick Controls 2. Configuration file qtquickcontrols2.conf not found. + Changer le style de Qt Quick Controls 2. Fichier de configuration qtquickcontrols2.conf introuvable. + + + + CharacterSection + + Character + + + + Text + Texte + + + Font + Police + + + Style name + + + + Font's style. + + + + Size + Taille + + + Text color + Couleur du texte + + + Weight + + + + Font's weight. + + + + Emphasis + + + + Alignment H + + + + Alignment V + + + + Letter spacing + + + + Letter spacing for the font. + + + + Word spacing + + + + Word spacing for the font. + + + + Line height + + + + Line height for the text. + + + + + CheckBoxSpecifics + + Check Box + Case à cocher + + + Text + Texte + + + Text shown on the check box. + Texte affiché sur la case à cocher. + + + State of the check box. + État de la case à cocher. + + + Determines whether the check box gets focus if pressed. + Déterminer si la boite à cocher reçoit le focus lors d’un appui. + + + Checked + Coché + + + Focus on press + Focus à l’appui + + + + CheckSection + + Check Box + Case à cocher + + + Check state + + + + The current check state. + + + + Tri-state + + + + Whether the checkbox has three states. + + + + + ChooseMaterialProperty + + Select material: + Sélectionner un matériau : + + + Select property: + Sélectionner une propriété : + + + Cancel + Annuler + + + Apply + Appliquer + + + + ColorAnimationSpecifics + + Color Animation + Animation de couleur + + + From color + De la couleur + + + To color + À la couleur + + + + ColorEditorPopup + + Solid + Unie + + + Linear + Linéaire + + + Radial + Radial + + + Conical + Conique + + + Open Color Dialog + Ouvrir la fenêtre Couleur + + + Fill type can only be changed in base state. + Le type de remplissage ne peut être modifié que dans l’état de base. + + + Transparent + Transparent + + + Gradient Picker + Sélecteur de dégradé + + + Eye Dropper + + + + Original + Original + + + New + Nouveau + + + Add to Favorites + Ajouter aux favoris + + + Color Details + Détails de la couleur + + + Palette + Palette + + + Gradient Controls + Contrôles du dégradé + + + Vertical + Vertical + + + Horizontal + Horizontal + + + Defines the direction of the gradient. + Définit la direction du dégradé. + + + Defines the start point for color interpolation. + Définit le point de départ de l’interpolation des couleurs. + + + Defines the end point for color interpolation. + Définit le point final de l’interpolation des couleurs. + + + Defines the center point. + Définit le point central. + + + Defines the focal point. + Définit le point focal. + + + Defines the center radius. + + + + Defines the focal radius. Set to 0 for simple radial gradients. + + + + Defines the start angle for the conical gradient. The value is in degrees (0-360). + Définit l’angle de départ du gradient conique. La valeur est exprimée en degrés (0-360). + + + + ColorPalette + + Remove from Favorites + Supprimer des favoris + + + Add to Favorites + Ajouter aux favoris + + + + ColumnLayoutSpecifics + + Column Layout + + + + Column spacing + Espacement des colonnes + + + Layout direction + Direction du layout + + + + ColumnSpecifics + + Column + Colonne + + + Spacing + Espacement + + + + ComboBoxSpecifics + + Combo Box + Liste déroulante + + + Text role + + + + The model role used for displaying text. + + + + Display text + + + + Holds the text that is displayed on the combo box button. + + + + Current index + + + + The index of the current item. + + + + Flat + + + + Whether the combo box button is flat. + + + + Editable + + + + Whether the combo box is editable. + + + + Focus on press + Focus à l’appui + + + Determines whether the combobox gets focus if pressed. + + + + + Component + + Error exporting node %1. Cannot parse type %2. + Erreur d’exportation du nœud %1. Impossible d’analyser le type %2. + + + + ComponentButton + + This is an instance of a component + Il s’agit d’une instance d’un composant + + + Edit Base Component + Modifier le composant de base + + + + ComponentSection + + Component + Composant + + + Type + Type + + + Sets the QML type of the component. + + + + ID + Identifiant + + + Sets a unique identification or name. + + + + id + identifiant + + + Exports this component as an alias property of the root component. + + + + Name + Nom + + + Adds a note with a title to explain the component. + + + + Descriptive text + + + + Edit Annotation + + + + Remove Annotation + + + + Add Annotation + + + + State + État + + + Sets the state of the component. + + + + + ConfirmDeleteFilesDialog + + Confirm Delete Files + Confirmer la suppression des fichiers + + + Some files might be in use. Delete anyway? + Certains fichiers peuvent être en cours d’utilisation. Supprimer quand même ? + + + Do not ask this again + Ne plus poser la question + + + Delete + Supprimer + + + Cancel + Annuler + + + + ConfirmDeleteFolderDialog + + Folder Not Empty + Le dossier n’est pas vide + + + Folder "%1" is not empty. Delete it anyway? + Le dossier « %1 » n’est pas vide. Le supprimer quand même ? + + + If the folder has assets in use, deleting it might cause the project to not work correctly. + + + + Delete + Supprimer + + + Cancel + Annuler + + + + ConnectionsSpecifics + + Connections + Connexions + + + Enabled + Activé + + + Sets whether the component accepts change events. + + + + Ignore unknown signals + + + + Ignores runtime errors produced by connections to non-existent signals. + + + + Target + Cible + + + Sets the component that sends the signal. + + + + + ContainerSection + + Container + Conteneur + + + Current index + Indice actuel + + + The index of the current item. + L’indice de l’élément actuel. + + + + ContentLibrary + + Materials + Matériaux + + + Textures + Textures + + + Environments + Environnements + + + + ContentLibraryMaterial + + Material is imported to project + Le matériau est importé dans le projet + + + Add an instance to project + Ajouter une instance au projet + + + + ContentLibraryMaterialContextMenu + + Apply to selected (replace) + + + + Apply to selected (add) + + + + Add an instance to project + + + + Remove from project + + + + + ContentLibraryMaterialsView + + <b>Content Library</b> materials are not installed. + + + + To use <b>Content Library</b>, first add the QtQuick3D module in the <b>Components</b> view. + + + + To use <b>Content Library</b>, version 6.3 or later of the QtQuick3D module is required. + + + + <b>Content Library</b> is disabled inside a non-visual component. + + + + No match found. + Aucun résultat. + + + + ContentLibraryTextureContextMenu + + Add image + Ajouter une image + + + Add texture + Ajouter une texture + + + Add light probe + Ajouter une sonde de lumière + + + + ContentLibraryTexturesView + + <b>Content Library</b> textures are not installed. + + + + No match found. + Aucun résultat. + + + + ControlSection + + Control + + + + Enable + + + + Whether the control is enabled and hover events are received. + + + + Hover + + + + Focus policy + + + + Focus policy of the control. + + + + Spacing + Espacement + + + Spacing between internal elements of the control. + + + + Wheel + + + + Whether control accepts wheel events. + + + + + DelayButtonSpecifics + + Delay Button + + + + Delay + Délai + + + The delay in milliseconds. + Le délai en millisecondes. + + + + DesignerActionManager + + Document Has Errors + Le document contient des erreurs + + + The document which contains the list model contains errors. So we cannot edit it. + Le document qui contient le modèle de liste contient des erreurs. Nous ne pouvons donc pas le modifier. + + + Document Cannot Be Written + Le document ne peut être écrit + + + An error occurred during a write attemp. + Une erreur s’est produite lors d’une tentative d’écriture. + + + + Details + + Details + Détails + + + Use as default project location + Utiliser comme emplacement par défaut pour les projets + + + Width + Largeur + + + Height + Hauteur + + + Orientation + Orientation + + + Use Qt Virtual Keyboard + Utiliser le clavier virtuel Qt + + + Target Qt Version: + Version de Qt cible : + + + Save Custom Preset + + + + Save Preset + + + + Preset name + + + + MyPreset + + + + + DialSpecifics + + Dial + + + + Value + Valeur + + + The current value of the dial and whether it provides live value updates. + + + + Live + + + + From + À partir de + + + The starting value of the dial range. + + + + To + Jusqu’à + + + The ending value of the dial range. + + + + Step size + + + + The step size of the dial. + + + + Snap mode + Mode aimant + + + The snap mode of the dial. + + + + Input mode + + + + How the dial tracks movement. + + + + Wrap + + + + Whether the dial wraps when dragged. + + + + + DialogSpecifics + + Dialog + + + + Title + Titre + + + + DrawerSpecifics + + Drawer + + + + Edge + + + + Defines the edge of the window the drawer will open from. + + + + Drag margin + Glisser la marge + + + Defines the distance from the screen edge within which drag actions will open the drawer. + + + + + DynamicPropertiesProxyModel + + Property Already Exists + La propriété existe déjà + + + Property "%1" already exists. + La propriété « %1 » existe déjà. + + + + DynamicPropertiesSection + + Local Custom Properties + Propriétés personnalisées locales + + + No editor for type: + Aucun éditeur pour ce type : + + + Add New Property + Ajouter une nouvelle propriété + + + Name + Nom + + + Type + Type + + + Add Property + Ajouter une propriété + + + + EditLightToggleAction + + Toggle Edit Light On/Off + + + + + EmptyMaterialEditorPane + + To use <b>Material Editor</b>, first add the QtQuick3D module in the <b>Components</b> view. + Pour utiliser l’<b>éditeur de matériaux<b/>, ajoutez d’abord le module QtQuick3D dans la vue <b>Composants</b>. + + + <b>Material Editor</b> is disabled inside a non-visual component. + L’<b>éditeur de matériaux</b> est désactivé dans un composant non visuel. + + + There are no materials in this project.<br>Select '<b>+</b>' to create one. + Il n’y a pas de matériaux dans ce projet.<br>Sélectionnez « <b>+</b> » pour en créer un. + + + + EmptyTextureEditorPane + + To use <b>Texture Editor</b>, first add the QtQuick3D module in the <b>Components</b> view. + Pour utiliser l’<b>éditeur de textures<b/>, ajoutez d’abord le module QtQuick3D dans la vue <b>Composants</b>. + + + <b>Texture Editor</b> is disabled inside a non-visual component. + L’<b>éditeur de textures</b> est désactivé dans un composant non visuel. + + + There are no textures in this project.<br>Select '<b>+</b>' to create one. + Il n’y a pas de textures dans ce projet.<br>Sélectionnez « <b>+</b> » pour en créer une. + + + + EnterTabDesignerAction + + Step into: %1 + Entrer dans : %1 + + + + ErrorDialog + + Close + Fermer + + + + ExtendedFunctionLogic + + Reset + Réinitialiser + + + Set Binding + + + + Export Property as Alias + + + + Insert Keyframe + + + + + FileExtractor + + Choose Directory + Sélectionner un répertoire + + + + FileResourcesModel + + Open File + Ouvrir le fichier + + + + FitToViewAction + + Fit Selected Object to View + Ajuster l’objet sélectionné à la vue + + + + FlickableGeometrySection + + Flickable Geometry + + + + Content size + Taille du contenu + + + W + width + The width of the object + + + + Content width used for calculating the total implicit width. + + + + H + height + The height of the object + + + + Content height used for calculating the total implicit height. + + + + Content + Contenu + + + Origin + Origine + + + Left margin + Marge à gauche + + + Right margin + Marge à droite + + + Top margin + Marge en haut + + + Bottom margin + Marge en bas + + + + FlickableSection + + Flickable + Flickable + + + Flick direction + Direction du flick + + + Behavior + Comportement + + + Interactive + Interactif + + + Allows users to drag or flick a flickable component. + + + + Whether the surface may be dragged beyond the Flickable's boundaries, or overshoot the Flickable's boundaries when flicked. + + + + Movement + + + + Whether the Flickable will give a feeling that the edges of the view are soft, rather than a hard physical boundary. + + + + Max. velocity + Vitesse maximale + + + Maximum flick velocity + Vitesse de flick maximale + + + Deceleration + Ralentissement + + + Flick deceleration + Ralentissement du flick + + + Press delay + + + + Time to delay delivering a press to children of the Flickable in milliseconds. + + + + Pixel aligned + + + + Sets the alignment of contentX and contentY to pixels (true) or subpixels (false). + + + + Synchronous drag + + + + If set to true, then when the mouse or touchpoint moves far enough to begin dragging +the content, the content will jump, such that the content pixel which was under the +cursor or touchpoint when pressed remains under that point. + + + + + FlipableSpecifics + + Flipable + Flipable + + + + FlowSpecifics + + Flow + Flux + + + Layout direction + Direction du layout + + + Spacing + Espacement + + + + FontExtrasSection + + Font Extras + + + + Capitalization + + + + Capitalization for the text. + + + + Style + Style + + + Style color + + + + Hinting + + + + Preferred hinting on the text. + + + + Auto kerning + + + + Enables or disables the kerning OpenType feature when shaping the text. Disabling this may improve performance when creating or changing the text, at the expense of some cosmetic features. + + + + Prefer shaping + + + + Sometimes, a font will apply complex rules to a set of characters in order to display them correctly. +In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in Latin script, + it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features +when they are not required, which will improve performance in most cases. + + + + + FontSection + + Font + Police + + + Size + Taille + + + Emphasis + + + + Capitalization + + + + Capitalization for the text. + + + + Weight + + + + Font's weight. + + + + Style name + + + + Font's style. + + + + Style color + + + + Hinting + + + + Preferred hinting on the text. + + + + Letter spacing + + + + Letter spacing for the font. + + + + Word spacing + + + + Word spacing for the font. + + + + Auto kerning + + + + Enables or disables the kerning OpenType feature when shaping the text. Disabling this may improve performance when creating or changing the text, at the expense of some cosmetic features. + + + + Prefer shaping + + + + Sometimes, a font will apply complex rules to a set of characters in order to display them correctly. +In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in Latin script, + it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features +when they are not required, which will improve performance in most cases. + + + + Style + Style + + + + FrameSpecifics + + Frame + Cadre + + + Font Inheritance + Héritage des polices + + + + GeometrySection + + Geometry - 2D + + + + This property is defined by an anchor or a layout. + + + + Position + Position + + + Sets the position of the component relative to its parent. + + + + X-coordinate + + + + Y-coordinate + + + + Size + Taille + + + Sets the width and height of the component. + + + + W + width + The width of the object + + + + Width + Largeur + + + H + height + The height of the object + + + + Height + Hauteur + + + Rotation + Rotation + + + Rotate the component at an angle. + + + + Angle (in degree) + + + + Scale + + + + Sets the scale of the component by percentage. + + + + Percentage + + + + Z stack + + + + Sets the stacking order of the component. + + + + Origin + Origine + + + Sets the modification point of the component. + + + + + GradientPresetList + + Gradient Picker + + + + System Presets + + + + User Presets + + + + Delete preset? + + + + Are you sure you want to delete this preset? + + + + Close + Fermer + + + Save + Enregistrer + + + Apply + Appliquer + + + + GridLayoutSpecifics + + Grid Layout + + + + Columns & Rows + + + + Spacing + Espacement + + + Flow + Flux + + + Layout direction + Direction du layout + + + + GridSpecifics + + Grid + Grille + + + Columns + Colonnes + + + Rows + Lignes + + + Flow + Flux + + + Layout direction + Direction du layout + + + Alignment H + + + + Alignment V + + + + Spacing + Espacement + + + + GridViewSpecifics + + Grid View + Vue en grille + + + Cell size + + + + W + width + The width of the object + + + + H + height + The height of the object + + + + Layout direction + Direction du layout + + + Cache + Cache + + + Cache buffer + Cache du buffer + + + Flow + Flux + + + Navigation wraps + Encapsulations de navigation + + + Snap mode + Mode aimant + + + Determines how the view scrolling will settle following a drag or flick. + Détermine la façon dont le défilement de la vue se réglera à la suite d’un glissage ou feuilletage. + + + Whether the grid wraps key navigation. + + + + Grid View Highlight + Surlignage de la vue en grille + + + Range + Intervalle + + + Highlight range + Surlignage de l’intervalle + + + Move duration + Durée de déplacement + + + Move animation duration of the highlight delegate. + Durée de déplacement de l’animation de surlignage des délégués. + + + Whether the highlight is managed by the view. + + + + Preferred begin + Début préféré + + + Preferred highlight begin - must be smaller than Preferred end. + Début préféré de surlignage - doit être plus petit que la fin préférée. + + + Preferred end + Fin préférée + + + Preferred highlight end - must be larger than Preferred begin. + Fin préférée de surlignage - doit être plus grand que le début préféré. + + + Follows current + ? + Suit l’actuel + + + + GroupBoxSpecifics + + Group Box + + + + Title + Titre + + + The title of the group box. + + + + + IconSection + + Icon + Icône + + + Source + Source + + + Color + Couleur + + + Size + Taille + + + W + width + The width of the object + + + + Width + Largeur + + + H + height + The height of the object + + + + Height + Hauteur + + + Cache + Cache + + + Whether the icon should be cached. + + + + + ImageSection + + Image + Image + + + Source + Source + + + Fill mode + Mode de remplissage + + + Source size + Taille de la source + + + W + width + The width of the object + + + + H + height + The height of the object + + + + Alignment H + + + + Alignment V + + + + Asynchronous + + + + Loads images on the local filesystem asynchronously in a separate thread. + + + + Auto transform + + + + Automatically applies image transformation metadata such as EXIF orientation. + + + + Cache + Cache + + + Caches the image. + + + + Mipmap + + + + Uses mipmap filtering when the image is scaled or transformed. + + + + Mirror + + + + Inverts the image horizontally. + + + + Smooth + Lissage + + + Smoothly filters the image when it is scaled or transformed. + + + + + InsetSection + + Inset + + + + Vertical + + + + Top inset for the background. + + + + Bottom inset for the background. + + + + Horizontal + + + + Left inset for the background. + + + + Right inset for the background. + + + + + InsightSection + + Analytics + + + + [None] + + + + Category + + + + + InvalidIdException + + Only alphanumeric characters and underscore allowed. +Ids must begin with a lowercase letter. + Seuls les caractères numériques et les tirets bas sont autorisés. +L’identifiant doit commencer avec une lettre minuscule. + + + Ids have to be unique. + Les identifiants doivent être uniques. + + + Invalid Id: %1 +%2 + Identifiant invalide : %1 +%2 + + + + ItemDelegateSection + + Item Delegate + + + + Highlight + + + + Whether the delegate is highlighted. + + + + + ItemFilterComboBox + + [None] + [Aucun] + + + + ItemPane + + Visibility + Visibilité + + + Visible + Visible + + + Clip + Retailler + + + Opacity + Opacité + + + Layout + Layout + + + + ItemsView + + Remove Module + Supprimer le module + + + Expand All + Tout développer + + + Collapse All + Tout réduire + + + Hide Category + Cacher la catégorie + + + Show Module Hidden Categories + Afficher toutes les catégories cachées de modules + + + Show All Hidden Categories + Afficher toutes les catégories cachées + + + Add Module: + Ajouter un module : + + + Go into Component + Aller dans le composant + + + Add a module. + Ajouter un module. + + + + Label + + This property is not available in this configuration. + Cette propriété n’est pas disponible dans cette configuration. + + + + Language + + None + Aucune + + + + LayerSection + + Layer + + + + Enabled + + + + Whether the component is layered or not. + + + + Sampler name + + + + Name of the effect's source texture property. + + + + Samples + + + + Allows requesting multisampled rendering in the layer. + + + + Effect + Effet + + + Applies the effect to this layer. + + + + Format + Format + + + Internal OpenGL format of the texture. + + + + Texture size + + + + Requested pixel size of the layer's texture. + + + + W + width + The width of the object + + + + H + height + The height of the object + + + + Texture mirroring + + + + Sets how the generated OpenGL texture should be mirrored. + + + + Wrap mode + + + + OpenGL wrap modes associated with the texture. + + + + Mipmap + + + + Generates mipmaps for the texture. + + + + Smooth + Lissage + + + Transforms the layer smoothly. + + + + Source rectangle + + + + Sets the rectangular area of the component that should be rendered into the texture. + + + + + LayoutProperties + + Alignment + Alignement + + + Alignment of a component within the cells it occupies. + + + + Fill layout + + + + Expands the component as much as possible within the given constraints. + + + + Width + Largeur + + + Height + Hauteur + + + Preferred size + Taille préférée + + + Preferred size of a component in a layout. If the preferred height or width is -1, it is ignored. + + + + W + width + The width of the object + + + + H + height + The height of the object + T + + + Minimum size + Taille minimum + + + Minimum size of a component in a layout. + + + + Maximum size + Taille maximum + + + Maximum size of a component in a layout. + + + + Row span + + + + Row span of a component in a Grid Layout. + + + + Column span + + + + Column span of a component in a Grid Layout. + + + + + LayoutSection + + Layout + Layout + + + Anchors + Ancres + + + + ListViewSpecifics + + List View + Vue en liste + + + Spacing between components. + Espacement entre les composants. + + + Cache + Cache + + + Navigation wraps + Encapsulations de navigation + + + Orientation + Orientation + + + Orientation of the list. + Orientation de la liste. + + + Layout direction + Direction du layout + + + Snap mode + Mode aimant + + + Determines how the view scrolling will settle following a drag or flick. + Détermine la façon dont le défilement de la vue se réglera à la suite d’un glissage ou feuilletage.. + + + Spacing + Espacement + + + Cache buffer. + + + + Whether the grid wraps key navigation. + + + + Highlight range. + + + + Move velocity + + + + Move animation velocity of the highlight delegate. + + + + Resize velocity + + + + Resize animation velocity of the highlight delegate. + + + + Whether the highlight is managed by the view. + + + + List View Highlight + Surlignage de la vue en liste + + + Range + Intervalle + + + Move duration + Durée de déplacement + + + Move animation duration of the highlight delegate. + Durée de déplacement de l’animation de surlignage des délégués. + + + Resize duration + Durée de redimensionnement + + + Resize animation duration of the highlight delegate. + Durée de redimensionnement de l’animation de surlignage des délégués. + + + Preferred begin + Début préféré + + + Preferred highlight begin - must be smaller than Preferred end. + Début préféré de surlignage - doit être plus petit que la fin préférée. + + + Preferred end + Fin préférée + + + Preferred highlight end - must be larger than Preferred begin. + Fin préférée de surlignage - doit être plus grand que le début préféré. + + + Follows current + Suit l’actuel + + + + LoaderSpecifics + + Loader + + + + Active + Actif + + + Whether the loader is currently active. + + + + Source + Source + + + URL of the component to instantiate. + + + + Source component + + + + Component to instantiate. + + + + Asynchronous + + + + Whether the component will be instantiated asynchronously. + + + + + Main + + Rename state group + Renommer le groupe d’états + + + State Group + Groupe d’états + + + Switch State Group + Basculer le groupe d’états + + + Create State Group + Créer le groupe d’états + + + Remove State Group + Supprimer le groupe d’états + + + Rename State Group + Renommer le groupe d’états + + + Show thumbnails + Afficher les vignettes + + + Show property changes + Afficher les changements de propriété + + + + MarginSection + + Margin + Marge + + + Vertical + Verticale + + + The margin above the item. + La marge au-dessus de l’élément. + + + The margin below the item. + La marge en dessous de l’élément. + + + Horizontal + Horizontale + + + The margin left of the item. + La marge à gauche de l’élément. + + + The margin right of the item. + La marge à droite de l’élément. + + + Margins + Marges + + + The margins around the item. + Les marges autour de l’élément. + + + + MaterialBrowser + + To use <b>Material Browser</b>, first add the QtQuick3D module in the <b>Components</b> view. + Pour utiliser le <b>navigateur de matériaux<b/>, ajoutez d’abord le module QtQuick3D dans la vue <b>Composants</b>. + + + <b>Material Browser</b> is disabled inside a non-visual component. + Le<b>navigateur de matériaux</b> est désactivé dans un composant non visuel. + + + Materials + Matériaux + + + No match found. + Aucun résultat. + + + There are no materials in this project.<br>Select '<b>+</b>' to create one. + Il n’y a pas de matériau dans ce projet.<br>Sélectionnez « <b>+</b> » pour en créer un. + + + Add a material. + Ajouter un matériau. + + + Textures + Textures + + + There are no textures in this project. + Il n’y a pas de texture dans ce projet. + + + Add a texture. + Ajouter une texture. + + + + MaterialBrowserContextMenu + + Apply to selected (replace) + Appliquer à la sélection (remplacer) + + + Apply to selected (add) + Appliquer à la sélection (ajouter) + + + Copy properties + Copier les propriétés + + + Paste properties + Coller les propriétés + + + Duplicate + Dupliquer + + + Rename + Renommer + + + Delete + Supprimer + + + Create New Material + Créer un nouveau matériau + + + + MaterialEditorToolBar + + Apply material to selected model. + Appliquer le matériau au modèle sélectionné. + + + Create new material. + Créer un nouveau matériau. + + + Delete current material. + Supprimer le matériau en cours. + + + Open material browser. + Ouvrir le navigateur de matériaux. + + + + MaterialEditorTopSection + + Cone + Cone + + + Cube + Cube + + + Cylinder + Cylindre + + + Sphere + Sphère + + + Basic + Basique + + + Color + Couleur + + + Studio + Studio + + + Landscape + Paysage + + + Select preview environment. + Sélectionner un environnement d’aperçu. + + + Select preview model. + Sélectionner un modèle d’aperçu. + + + Name + Nom + + + Material name + Nom du matériau + + + Type + Type + + + + MediaPlayerSection + + Media Player + + + + Playback rate + + + + Audio output + + + + Target audio output. + + + + Video output + + + + Target video output. + + + + + ModelNodeOperations + + Go to Implementation + Aller à l’implémentation + + + Invalid component. + Composant invalide. + + + Cannot find an implementation. + Impossible de trouver une implémentation. + + + Cannot Set Property %1 + Impossible de définir la propriété %1 + + + The property %1 is bound to an expression. + La propriété %1 est liée à une expression. + + + Overwrite Existing File? + Écraser le fichier existant ? + + + File already exists. Overwrite? +"%1" + Le fichier existe déjà. L’écraser ? +« %1 » + + + Asset import data file "%1" is invalid. + + + + Unable to locate source scene "%1". + Impossible de localiser la scène source « %1 ». + + + Opening asset import data file "%1" failed. + + + + Unable to resolve asset import path. + + + + Import Update Failed + Échec de la mise à jour de l’importation + + + Failed to update import. +Error: +%1 + Échec de la mise à jour de l’importation. +Erreur : +%1 + + + + Modeling + + Modeling + + + + + MouseAreaSpecifics + + Enable + + + + Accepts mouse events. + + + + Area + + + + Hover + + + + Accepted buttons + + + + Mouse buttons that the mouse area reacts to. + + + + Cursor shape + + + + Cursor shape for this mouse area. + + + + Hold interval + + + + Overrides the elapsed time in milliseconds before pressAndHold signal is emitted. + + + + Scroll gesture + + + + Responds to scroll gestures from non-mouse devices. + + + + Enabled + Activé + + + Prevent stealing + + + + Stops mouse events from being stolen from this mouse area. + + + + Propagate events + + + + Automatically propagates composed mouse events to other mouse areas. + + + + Drag + + + + Target + Cible + + + ID of the component to drag. + + + + Axis + + + + Whether dragging can be done horizontally, vertically, or both. + + + + Threshold + + + + Threshold in pixels of when the drag operation should start. + + + + Filter children + + + + Whether dragging overrides descendant mouse areas. + + + + Smoothed + + + + Moves targets only after the drag operation has started. +When disabled, moves targets straight to the current mouse position. + + + + Mouse Area + MouseArea + + + + MoveToolAction + + Activate Move Tool + + + + + NavigatorTreeModel + + Warning + Avertissement + + + Reparenting the component %1 here will cause the component %2 to be deleted. Do you want to proceed? + Redéfinir ici le parent du composant %1 entrainera la suppression du composant %2. Voulez-vous continuer ? + + + + NewEffectDialog + + Create New Effect + Créer un nouvel effet + + + Could not create effect + Impossible de créer l’effet + + + An error occurred while trying to create the effect. + Une erreur s’est produite lors de la création de l’effet. + + + Effect name: + Nom de l’effet : + + + Effect name cannot be empty. + Le nom de l’effet ne peut pas être vide. + + + Effect path is too long. + Le chemin de l’effet est trop long. + + + Create + Créer + + + Cancel + Annuler + + + + NewFolderDialog + + Create New Folder + Créer un nouveau dossier + + + Could not create folder + Impossible de créer le dossier + + + An error occurred while trying to create the folder. + Une erreur s’est produite lors de la création du dossier. + + + Folder name: + Nom du dossier : + + + Folder name cannot be empty. + Le nom du dossier ne peut pas être vide. + + + Folder path is too long. + Le chemin du dossier est trop long. + + + Create + Créer + + + Cancel + Annuler + + + New folder + Nouveau dossier + + + + NewProjectDialog + + Let's create something wonderful with + Créons quelque chose de super avec + + + Qt Design Studio! + Qt Design Studio ! + + + Create new project by selecting a suitable Preset and then adjust details. + Créez un nouveau projet en sélectionnant un préréglage approprié, puis ajustez les détails. + + + Presets + Préréglages + + + Cancel + Annuler + + + Create + Créer + + + + NumberAnimationSpecifics + + Number Animation + + + + From + À partir de + + + Start value for the animation. + + + + To + Jusqu’à + + + End value for the animation. + + + + + OrientationToggleAction + + Toggle Global/Local Orientation + Activer/désactiver l’orientation globale/locale + + + + PaddingSection + + Padding + + + + Vertical + + + + Padding between the content and the top edge of the item. + + + + Padding between the content and the bottom edge of the item. + + + + Horizontal + + + + Padding between the content and the left edge of the item. + + + + Padding between the content and the right edge of the item. + + + + Global + + + + Padding between the content and the edges of the items. + + + + + PageIndicatorSpecifics + + Page Indicator + + + + Count + + + + The number of pages. + + + + Current + + + + The index of the current page. + + + + Interactive + + + + Whether the control is interactive. + + + + + PageSpecifics + + Page + + + + Title + Titre + + + Title of the page. + + + + Content size + Taille du contenu + + + Content width and height used for calculating the total implicit size. + + + + W + width + The width of the object + + + + Content width used for calculating the total implicit width. + + + + H + height + The height of the object + T + + + Content height used for calculating the total implicit height. + + + + + PaneSection + + Pane + + + + Content size + Taille du contenu + + + Content width and height used for calculating the total implicit size. + + + + W + width + The width of the object + + + + Content width used for calculating the total implicit width. + + + + H + height + The height of the object + T + + + Content height used for calculating the total implicit height. + + + + + PaneSpecifics + + Font Inheritance + Héritage des polices + + + + ParticleViewModeAction + + Toggle particle animation On/Off + Activer/Désactiver l’animation des particules + + + + ParticlesPlayAction + + Play Particles + Lancer les particules + + + + ParticlesRestartAction + + Restart Particles + Relancer les particules + + + + PathTool + + Path Tool + + + + + PathToolAction + + Edit Path + + + + + PathViewSpecifics + + Path View + Vue en chemin + + + Allows users to drag or flick a path view. + + + + Drag margin + Glisser la marge + + + Flick deceleration + Ralentissement du flick + + + Offset + Décalage + + + Specifies how far along the path the items are from their initial positions. This is a real number that ranges from 0.0 to the count of items in the model. + Détermine la distance sur le chemin qui sépare les éléments avec leurs positions initiales. Il s’agit d’un nombre réel dont l’intervalle est entre 0.0 et le nombre d’éléments dans le modèle. + + + Item count + Nombre d’éléments + + + Path View Highlight + Surlignage de la vue en chemin + + + Highlight range + Surlignage de l’intervalle + + + Move duration + Durée de déplacement + + + Move animation duration of the highlight delegate. + Durée de déplacement de l’animation de surlignage des délégués. + + + Preferred begin + Début préféré + + + Preferred highlight begin - must be smaller than Preferred end. Note that the user has to add a highlight component. + + + + Preferred highlight end - must be larger than Preferred begin. Note that the user has to add a highlight component. + + + + Preferred end + Fin préférée + + + Interactive + Interactive + + + Number of items visible on the path at any one time. + + + + Range + Intervalle + + + + PerfKallsyms + + Invalid address: %1 + Adresse invalide : %1 + + + Mapping is empty. + Le mappage est vide. + + + + PerfUnwind + + Could not find ELF file for %1. This can break stack unwinding and lead to missing symbols. + + + + Failed to parse kernel symbol mapping file "%1": %2 + + + + Time order violation of MMAP event across buffer flush detected. Event time is %1, max time during last buffer flush was %2. This potentially breaks the data analysis. + + + + + PluginManager + + Failed Plugins + Greffons défectueux + + + + PopupSection + + Popup + + + + Size + Taille + + + W + width + The width of the object + + + + H + height + The height of the object + T + + + Visibility + Visibilité + + + Visible + Visible + + + Clip + Retailler + + + Behavior + Comportement + + + Modal + + + + Defines the modality of the popup. + + + + Dim + + + + Defines whether the popup dims the background. + + + + Opacity + Opacité + + + Scale + + + + Spacing + Espacement + + + Spacing between internal elements of the control. + + + + + PresetView + + Delete Custom Preset + + + + + ProgressBarSpecifics + + Progress Bar + Barre de progression + + + Value + Valeur + + + The current value of the progress. + La valeur actuelle de la progression. + + + From + À partir de + + + The starting value for the progress. + La valeur initiale de la progression. + + + To + Jusqu’à + + + The ending value for the progress. + La valeur finale de la progression. + + + Indeterminate + Indéterminée + + + Whether the progress is indeterminate. + Si la progression est indéterminée. + + + + PropertyActionSpecifics + + Property Action + + + + Value + Valeur + + + Value of the property. + Valeur de la propriété. + + + + PropertyLabel + + This property is not available in this configuration. + Cette propriété n’est pas disponible dans cette configuration. + + + + PuppetStarter + + Puppet is starting... + + + + You can now attach your debugger to the %1 puppet with process id: %2. + + + + + QAbstractFileIconProvider + + File Folder + Match Windows Explorer + Dossier + + + Folder + All other platforms + Dossier + + + + QDockWidget + + Float + Flottant + + + Undocks and re-attaches the dock widget + Détache et rattache le QDockWidget + + + Close + Fermer + + + Closes the dock widget + Ferme le QDockWidget + + + + QObject + + All syntax definitions are up-to-date. + Toutes les définitions syntaxiques sont à jour. + + + Downloading new syntax definition for '%1'... + Téléchargement d’une nouvelle définition syntaxique pour « %1 »… + + + Updating syntax definition for '%1' to version %2... + Mise à jour de la définition syntaxique pour « %1 » vers la version %2… + + + <Filter> + Library search input hint text + <Filtre> + + + Effect %1 not complete + L’effet %1 est incomplet + + + Do you want to edit %1? + Voulez-vous modifier %1 ? + + + Start Nanotrace + Démarrer Nanotrace + + + Shut Down Nanotrace + Arrêter Nanotrace + + + Failed to Add Texture + Échec de l’ajout de la texture + + + Could not add %1 to project. + Impossible d’ajouter %1 au projet. + + + Show Event List + Afficher la liste des évènements + + + Assign Events to Actions + Assigner des évènements aux actions + + + Connect Signal to Event + Connecter un signal à un évènement + + + Connected Events + Évènements connectés + + + Connected Signals + Signaux connectés + + + Exposed Custom Properties + Propriétés personnalisées exposées + + + ID cannot start with an uppercase character (%1). + L’identifiant ne peut pas commencer par une majuscule (%1). + + + ID cannot start with a number (%1). + L’identifiant ne peut pas commencer par un nombre (%1). + + + ID cannot include whitespace (%1). + L’identifiant ne peut pas contenir d’espace (%1). + + + %1 is a reserved QML keyword. + %1 est un mot-clé QML réservé. + + + %1 is a reserved property keyword. + %1 est un mot-clé de propriété réservé. + + + ID includes invalid characters (%1). + L’identifiant contient des caractères invalides (%1). + + + Empty document + Document vide + + + UntitledProject + File path suggestion for a new project. If you choose to translate it, make sure it is a valid path name without blanks and using only ascii chars. + ProjetSansNom + + + + QmlDesigner::AbstractEditorDialog + + Untitled Editor + + + + + QmlDesigner::ActionEditorDialog + + Connection Editor + + + + + QmlDesigner::AddNewBackendDialog + + Add New C++ Backend + + + + Type + Type + + + Define object locally + + + + Required import + + + + Choose a type that is registered using qmlRegisterType or qmlRegisterSingletonType. The type will be available as a property in the current .qml file. + + + + + QmlDesigner::AddTabDesignerAction + + Naming Error + Erreur de nommage + + + Component already exists. + Le composant existe déjà. + + + + QmlDesigner::AddTabToTabViewDialog + + Dialog + Dialogue + + + Add tab: + Ajouter un onglet : + + + + QmlDesigner::AlignDistribute + + Cannot Distribute Perfectly + Une distribution parfaite est impossible + + + These objects cannot be distributed to equal pixel values. Do you want to distribute to the nearest possible values? + Ces objets ne peuvent pas être distribués à des valeurs de pixels égales. Voulez-vous distribuer les valeurs les plus proches possibles ? + + + + QmlDesigner::AnnotationCommentTab + + Title + Titre + + + Text + Texte + + + Author + Auteur + + + + QmlDesigner::AnnotationEditor + + Annotation + Annotation + + + Delete this annotation? + Supprimer cette annotation ? + + + + QmlDesigner::AnnotationEditorDialog + + Annotation Editor + Éditeur d’annotations + + + + QmlDesigner::AnnotationEditorWidget + + Add Status + + + + In Progress + + + + In Review + + + + Done + + + + Tab view + + + + Table view + + + + Selected component + + + + Name + Nom + + + Tab 1 + + + + Tab 2 + + + + + QmlDesigner::AnnotationTabWidget + + Add Comment + + + + Remove Comment + + + + Delete this comment? + + + + Annotation + + + + + QmlDesigner::AnnotationTableView + + Title + Titre + + + Author + Auteur + + + Value + Valeur + + + + QmlDesigner::AssetExportDialog + + Export Components + + + + Export path: + + + + Choose Export File + + + + Metadata file (*.metadata) + + + + Open + Ouvrir + + + Advanced Options + + + + Export assets + + + + Export components separately + + + + Export + + + + + QmlDesigner::AssetExporter + + Export root directory: %1. +Exporting assets: %2 + + + + Yes + Oui + + + No + Non + + + Each component is exported separately. + + + + Canceling export. + + + + Unknown error. + Erreur inconnue. + + + Loading file is taking too long. + + + + Cannot parse. The file contains coding errors. + + + + Loading components failed. %1 + + + + Cannot export component. Document "%1" has parsing errors. + + + + Error saving component file. %1 + + + + Unknown + Inconnue + + + Cannot preprocess file: %1. Error %2 + + + + Cannot preprocess file: %1 + + + + Cannot update %1. +%2 + + + + Exporting file %1. + + + + Export canceled. + + + + Writing metadata failed. Cannot create file %1 + + + + Writing metadata to file %1. + + + + Empty JSON document. + + + + Writing metadata failed. %1 + + + + Export finished. + + + + Error creating asset directory. %1 + + + + Error saving asset. %1 + + + + + QmlDesigner::AssetExporterPlugin + + Asset Export + + + + Export Components + + + + Export components in the current project. + + + + + QmlDesigner::AssetsLibraryModel + + Failed to Delete File + Échec de la suppression du fichier + + + Could not delete "%1". + Impossible de supprimer « %1 ». + + + + QmlDesigner::AssetsLibraryView + + Assets + Ressources + + + + QmlDesigner::AssetsLibraryWidget + + Assets Library + Title of assets library widget + + + + Failed to Add Files + + + + Could not add %1 to project. + + + + All Files (%1) + + + + Add Assets + + + + Could not add %1 to project. Unsupported file format. + + + + + QmlDesigner::AssignEventDialog + + Nonexistent events discovered + + + + The Node references the following nonexistent events: + + + + + + QmlDesigner::BackgroundAction + + Set the color of the canvas. + + + + + QmlDesigner::BindingEditorDialog + + Binding Editor + + + + NOT + NOT + + + Invert the boolean expression. + Inverser l’expression booléenne. + + + + QmlDesigner::BindingEditorWidget + + Trigger Completion + Déclencher la complétion + + + Meta+Space + Meta+Espace + + + Ctrl+Space + Ctrl+Espace + + + + QmlDesigner::CapturingConnectionManager + + QML Emulation Layer (QML Puppet - %1) Crashed + La couche d’émulation de QML (QML Puppet - %1) a planté + + + You are recording a puppet stream and the emulations layer crashed. It is recommended to reopen the Qt Quick Designer and start again. + + + + + QmlDesigner::ChooseFromPropertyListDialog + + Select Property + + + + Bind to property: + + + + Binds this component to the parent's selected property. + + + + + QmlDesigner::ColorTool + + Color Tool + + + + + QmlDesigner::ComponentAction + + Edit sub components defined in this file. + + + + + QmlDesigner::ConnectionViewWidget + + Connections + + + + + QmlDesigner::ContentLibraryView + + Content Library + + + + + QmlDesigner::ContentLibraryWidget + + Content Library + Title of content library widget + + + + + QmlDesigner::CrumbleBar + + Save the changes to preview them correctly. + + + + Always save when leaving subcomponent + + + + + QmlDesigner::CurveEditor + + This file does not contain a timeline. <br><br>To create an animation, add a timeline by clicking the + button in the "Timeline" view. + + + + + QmlDesigner::CurveEditorToolBar + + Unify + + + + Start Frame + + + + End Frame + + + + Current Frame + + + + + QmlDesigner::CurveEditorView + + Curves + + + + + QmlDesigner::DebugViewWidget + + Debug + + + + Model Log + Log du modèle + + + Clear + + + + Instance Notifications + Notifications d’instance + + + Instance Errors + Erreurs d’instance + + + Enabled + + + + + QmlDesigner::DesignDocument + + Locked items: + + + + Delete/Cut Item + + + + Deleting or cutting this item will modify locked items. + + + + Do you want to continue by removing the item (Delete) or removing it and copying it to the clipboard (Cut)? + + + + + QmlDesigner::DocumentMessage + + Error parsing + Erreur d’analyse syntaxique + + + Internal error + Erreur interne + + + line %1 + + Ligne %1 + + + + column %1 + + Colonne %1 + + + + + QmlDesigner::DocumentWarningWidget + + Always ignore these warnings about features not supported by Qt Quick Designer. + + + + Cannot open this QML document because of an error in the QML file: + + + + OK + OK + + + This QML file contains features which are not supported by Qt Quick Designer at: + + + + Ignore + Ignorer + + + Previous + Précédent + + + Next + Suivant + + + Go to error + Aller à l'erreur + + + Go to warning + Aller à l'avertissement + + + + QmlDesigner::Edit3DView + + 3D + 3D + + + Cameras + + + + Lights + + + + Primitives + + + + Imported Models + + + + Failed to Add Import + + + + Could not add QtQuick3D import to project. + + + + + QmlDesigner::Edit3DWidget + + Your file does not import Qt Quick 3D.<br><br>To create a 3D view, add the <b>QtQuick3D</b> module in the <b>Components</b> view or click <a href="#add_import"><span style="text-decoration:none;color:%1">here</span></a>.<br><br>To import 3D assets, select <b>+</b> in the <b>Assets</b> view. + + + + Edit Component + + + + Edit Material + + + + Duplicate + Dupliquer + + + Copy + Copier + + + Paste + Coller + + + Delete + Supprimer + + + Fit Selected Items to View + + + + Align Camera to View + + + + Align View to Camera + + + + Select Parent + + + + Group Selection Mode + + + + Create + Créer + + + + QmlDesigner::EventListDelegate + + Release + Release + + + Connect + + + + + QmlDesigner::EventListDialog + + Add Event + + + + Remove Selected Events + + + + + QmlDesigner::EventListModel + + Event ID + Identifiant de l’évènement + + + Shortcut + Raccourci + + + Description + Description + + + + QmlDesigner::EventListPluginView + + Event List + + + + + QmlDesigner::Experimental::StatesEditorModel + + base state + Implicit default state + + + + Invalid state name + Nom d’état invalide + + + The empty string as a name is reserved for the base state. + La chaîne vide comme nom est réservée à l’état de base. + + + Name already used in another state + Le nom est déjà utilisé dans un autre état + + + Default + Défaut + + + Invalid ID + + + + %1 already exists. + %1 existe déjà. + + + + QmlDesigner::Experimental::StatesEditorView + + States + États + + + Remove State + + + + This state is not empty. Are you sure you want to remove it? + + + + Locked components: + + + + Removing this state will modify locked components. + + + + Continue by removing the state? + + + + base state + + + + + QmlDesigner::Experimental::StatesEditorWidget + + States New + Title of Editor widget + + + + Cannot Create QtQuick View + Impossible de créer une vue QtQuick + + + StatesEditorWidget: %1 cannot be created.%2 + + + + + QmlDesigner::FilePathModel + + Canceling file preparation. + + + + + QmlDesigner::FormEditorAnnotationIcon + + Annotation + + + + Edit Annotation + + + + Remove Annotation + + + + By: + + + + Edited: + + + + Delete this annotation? + + + + + QmlDesigner::FormEditorView + + 2D + 2D + + + %1 is not supported as the root element by the 2D view. + + + + + QmlDesigner::FormEditorWidget + + No Snapping + + + + Snap with Anchors + + + + Snap without Anchors + + + + Show Bounds + + + + Override Width + + + + Override width of root component. + + + + Override Height + + + + Override height of root component. + + + + Zoom In + Zoom avant + + + Zoom Out + Zoom arrière + + + Zoom screen to fit all content. + + + + Ctrl+Alt+0 + + + + Zoom screen to fit current selection. + + + + Ctrl+Alt+i + + + + Reset View + + + + Export Current QML File as Image + + + + PNG (*.png);;JPG (*.jpg) + + + + + QmlDesigner::GenerateResource + + Unable to generate resource file: %1 + + + + A timeout occurred running "%1" + + + + "%1" crashed. + « %1 » a planté. + + + "%1" failed (exit code %2). + + + + Generate QRC Resource File... + + + + Save Project as QRC File + + + + QML Resource File (*.qrc) + + + + Generate Deployable Package... + + + + Save Project as Resource + + + + QML Resource File (*.qmlrc);;Resource File (*.rcc) + + + + Generate a resource file out of project %1 to %2 + + + + Success + + + + Successfully generated deployable package + %1 + + + + + QmlDesigner::GlobalAnnotationDialog + + Global Annotation Editor + Éditeur d’annotations globales + + + Global Annotation + Annotation globale + + + All Annotations + Toutes les annotations + + + + QmlDesigner::GlobalAnnotationEditor + + Global Annotation + + + + Delete this annotation? + + + + + QmlDesigner::GraphicsView + + Open Style Editor + + + + Insert Keyframe + + + + Delete Selected Keyframes + + + + + QmlDesigner::HyperlinkDialog + + Link + Lien + + + Anchor + + + + + QmlDesigner::InteractiveConnectionManager + + Cannot Connect to QML Emulation Layer (QML Puppet) + + + + The executable of the QML emulation layer (QML Puppet) may not be responding. Switching to another kit might help. + + + + + QmlDesigner::Internal::AssetImportUpdateDialog + + Select Files to Update + Sélectionner les fichiers à mettre à jour + + + Expand All + Tout développer + + + Collapse All + Tout réduire + + + + QmlDesigner::Internal::BackendModel + + Type + Type + + + Name + Nom + + + Singleton + + + + Local + + + + + QmlDesigner::Internal::BindingModel + + Item + + + + Property + Propriété + + + Source Item + + + + Source Property + + + + Error + Erreur + + + + QmlDesigner::Internal::ConnectionDelegate + + Change to default state + + + + Change state to %1 + + + + Activate FlowAction %1 + + + + + QmlDesigner::Internal::ConnectionModel + + Target + Cible + + + Signal Handler + Gestionnaire de signaux + + + Action + Action + + + Error + Erreur + + + + QmlDesigner::Internal::ConnectionView + + Connections + + + + + QmlDesigner::Internal::ConnectionViewWidget + + Connections + Title of connections window + + + + Connections + Title of connection tab + + + + Bindings + Title of connection tab + + + + Properties + Title of dynamic properties tab + Propriétés + + + Backends + Title of dynamic properties view + + + + Open Connection Editor + + + + Open Binding Editor + + + + Reset Property + + + + Add binding or connection. + + + + Remove selected binding or connection. + + + + + QmlDesigner::Internal::DebugView + + Debug view is enabled + + + + ::nodeReparented: + + + + ::nodeIdChanged: + + + + Debug View + Vue de débogage + + + + QmlDesigner::Internal::DesignModeWidget + + &Workspaces + + + + Output + Sortie + + + Switch the active workspace. + + + + Edit global annotation for current file. + Modifier les annotations globales pour le fichier actuel. + + + Manage... + Gérer… + + + Reset Active + + + + + QmlDesigner::Internal::DynamicPropertiesModel + + Item + + + + Property + Propriété + + + Property Type + + + + Property Value + + + + Error + Erreur + + + + QmlDesigner::Internal::MetaInfoPrivate + + Invalid meta info + Méta-information invalide + + + + QmlDesigner::Internal::MetaInfoReader + + Illegal state while parsing. + + + + No property definition allowed. + + + + Invalid type %1 + Type invalide %1 + + + Unknown property for Imports %1 + + + + Unknown property for Type %1 + Propriété inconnue pour le type %1 + + + Unknown property for ItemLibraryEntry %1 + Propriété inconnue pour ItemLibraryEntry %1 + + + Unknown property for Property %1 + Propriété inconnue pour Property %1 + + + Unknown property for QmlSource %1 + Propriété inconnue pour QmlSource %1 + + + Unknown property for ExtraFile %1 + + + + Invalid or duplicate library entry %1 + + + + + QmlDesigner::Internal::ModelPrivate + + Exception thrown by view %1. + + + + + QmlDesigner::Internal::SettingsPage + + Snapping + pour être cohérents avec designer + Aimantation + + + Qt Quick Designer + Designer Qt Quick + + + Canvas + Canevas + + + Debugging + Débogage + + + Show the debugging view + Afficher la vue de débogage + + + Enable smooth rendering in the 2D view. + + + + Default style + + + + Reset Style + + + + QML Emulation Layer + + + + Use fallback QML emulation layer + + + + If you select this radio button, Qt Quick Designer always uses the QML emulation layer (QML Puppet) located at the following path. + + + + Path to the QML emulation layer executable (qmlpuppet). + + + + Reset Path + + + + Resets the path to the built-in QML emulation layer. + + + + Use QML emulation layer that is built with the selected Qt + + + + Always save when leaving subcomponent in bread crumb + + + + Warn about unsupported features of .ui.qml files in code editor + + + + Also warns in the code editor about QML features that are not properly supported by the Qt Quick Designer. + + + + Warn about unsupported features in .ui.qml files + + + + Warns about QML features that are not properly supported by the Qt Quick Designer. + + + + Warn about using .qml files instead of .ui.qml files + + + + Qt Quick Designer will propose to open .ui.qml files instead of opening a .qml file. + + + + qsTr() + + + + qsTrId() + + + + qsTranslate() + + + + Always open ui.qml files in Design mode + + + + Ask for confirmation before deleting asset + + + + Always auto-format ui.qml files in Design mode + + + + Enable Timeline editor + + + + Show property editor warnings + + + + Enable the debugging view + Activer la vue de débogage + + + Show warn exceptions + + + + Path: + Chemin : + + + Top level build path: + + + + Forward QML emulation layer output: + + + + Debug QML emulation layer: + + + + Parent component padding: + + + + Sibling component spacing: + + + + Width: + + + + Height: + + + + Smooth rendering: + + + + Root Component Init Size + + + + Styling + + + + Controls style: + + + + Controls 2 style: + + + + Subcomponents + + + + Warnings + Avertissements + + + Internationalization + + + + Features + + + + Restart Required + Redémarrage nécessaire + + + The made changes will take effect after a restart of the QML Emulation layer or %1. + Les changements effectués prendront effet au prochain démarrage de la couche d’émulation QML ou %1. + + + + QmlDesigner::InvalidArgumentException + + Failed to create item of type %1 + Échec lors de la création d’un élément de type %1 + + + + QmlDesigner::ItemLibraryAssetImportDialog + + Asset Import + + + + Import Options + + + + Show All Options + Afficher tous les options + + + Import + Importer + + + Select import options and press "Import" to import the following files: + + + + Locate 3D Asset "%1" + + + + %1 options + + + + No options available for this type. + + + + No simple options available for this type. + + + + Cancel + Annuler + + + Close + Fermer + + + Import interrupted. + + + + Import done. + + + + Canceling import. + + + + Hide Advanced Options + + + + + QmlDesigner::ItemLibraryAssetImporter + + Could not create a temporary directory for import. + + + + Importing 3D assets. + + + + Import process crashed. + Le processus d’importation a planté. + + + Import failed for unknown reason. + + + + Asset import process failed: "%1". + + + + Parsing files. + + + + Skipped import of duplicate asset: "%1". + + + + Skipped import of existing asset: "%1". + + + + No files selected for overwrite, skipping import: "%1". + + + + Could not access temporary asset directory: "%1". + + + + Failed to create qmldir file for asset: "%1". + + + + Removing old overwritten assets. + + + + Copying asset files. + + + + Overwrite Existing Asset? + + + + Asset already exists. Overwrite existing or skip? +"%1" + + + + Overwrite Selected Files + + + + Overwrite All Files + Écraser tous les fichiers + + + Skip + Passer + + + Failed to start import 3D asset process. + + + + Failed to start icon generation process. + + + + Generating icons. + + + + Updating data model. + + + + Failed to insert import statement into qml document. + + + + Failed to update imports: %1 + + + + + QmlDesigner::ItemLibraryImport + + Default Components + + + + My Components + + + + My 3D Components + + + + All Other Components + + + + + QmlDesigner::ItemLibraryView + + Components + + + + + QmlDesigner::ItemLibraryWidget + + Components Library + Title of library view + + + + + QmlDesigner::ListModelEditorDialog + + Add Row + + + + Remove Columns + + + + Add Column + + + + Move Down (Ctrl + Down) + + + + Move Up (Ctrl + Up) + + + + Add Property + + + + Property name: + Nom de la propriété : + + + Change Property + + + + Column name: + + + + + QmlDesigner::MaterialBrowserTexturesModel + + Texture has no source image. + + + + Texture has no data. + + + + + QmlDesigner::MaterialBrowserView + + Material Browser + + + + Select a material property + + + + + QmlDesigner::MaterialBrowserWidget + + Material Browser + Title of material browser widget + + + + + QmlDesigner::MaterialEditorContextObject + + <b>Incompatible properties:</b><br> + + + + Change Type + + + + Changing the type from %1 to %2 can't be done without removing incompatible properties.<br><br>%3 + + + + Do you want to continue by removing incompatible properties? + + + + + QmlDesigner::MaterialEditorView + + Cannot Export Property as Alias + + + + Property %1 does already exist for root component. + + + + Material Editor + + + + + QmlDesigner::NavigatorSearchWidget + + Search + Rechercher + + + + QmlDesigner::NavigatorTreeModel + + Unknown component: %1 + Composant inconnu : %1 + + + Toggles whether this component is exported as an alias property of the root component. + Indique si ce composant est exporté en tant que propriété alias du composant racine. + + + Toggles the visibility of this component in the 2D view. +This is independent of the visibility property. + Active/désactive la visibilité de ce composant dans la vue 2D. +Cette fonction est indépendante de la propriété de visibilité. + + + Toggles whether this component is locked. +Locked components cannot be modified or selected. + Indique si ce composant est verrouillé. +Les composants verrouillés ne peuvent être ni modifiés ni sélectionnés. + + + + QmlDesigner::NavigatorTreeView + + Invalid Id + Identifiant invalide + + + %1 is an invalid id. + %1 n’est pas un identifiant valide. + + + %1 already exists. + %1 existe déjà. + + + + QmlDesigner::NavigatorView + + Navigator + Navigateur + + + + QmlDesigner::NavigatorWidget + + Navigator + Title of navigator view + Navigateur + + + Become last sibling of parent (CTRL + Left). + + + + Become child of last sibling (CTRL + Right). + + + + Move down (CTRL + Down). + + + + Move up (CTRL + Up). + + + + Filter Tree + Filtrer l’arborescence + + + Show Only Visible Components + + + + Reverse Component Order + + + + + QmlDesigner::NodeInstanceView + + Qt Quick emulation layer crashed. + Plantage de la couche d’émulation de Qt Quick. + + + Source item: %1 + Élément source : %1 + + + Failed to generate QSB file for: %1 + Échec de la génération du fichier QSB pour : %1 + + + + QmlDesigner::NodeListModel + + ID + Identifiant + + + Type + Type + + + From + À partir de + + + To + Jusqu’à + + + + QmlDesigner::OpenUiQmlFileDialog + + Open ui.qml file + + + + Do not show this dialog again + + + + Cancel + Annuler + + + You are opening a .qml file in the designer. Do you want to open a .ui.qml file instead? + + + + + QmlDesigner::PathItem + + Closed Path + + + + Split Segment + + + + Make Curve Segment Straight + + + + Remove Edit Point + + + + + QmlDesigner::PresetEditor + + Save Preset + + + + Name + Nom + + + + QmlDesigner::PresetList + + Add Preset + + + + Delete Selected Preset + + + + + QmlDesigner::PropertyEditorContextObject + + Invalid Type + + + + %1 is an invalid type. + + + + + QmlDesigner::PropertyEditorView + + Properties + Propriétés + + + Invalid ID + + + + Cannot Export Property as Alias + + + + Property %1 does already exist for root component. + + + + %1 already exists. + %1 existe déjà. + + + + QmlDesigner::PuppetBuildProgressDialog + + Build Progress + + + + Building Adapter for the current Qt. Happens only once for every Qt installation. + + + + Open error output file + + + + Use Fallback QML Emulation Layer + + + + OK + OK + + + + QmlDesigner::PuppetDialog + + Dialog + + + + + QmlDesigner::QmlDesignerPlugin + + Cannot Open Design Mode + + + + The QML file is not currently opened in a QML Editor. + + + + License: Enterprise + + + + License: Professional + + + + Licensee: %1 + + + + + QmlDesigner::QmlModelNodeProxy + + multiselection + + + + + QmlDesigner::QmlPreviewWidgetPlugin + + Show Live Preview + + + + + QmlDesigner::RichTextEditor + + &Undo + + + + &Redo + + + + &Bold + + + + &Italic + + + + &Underline + + + + Select Image + + + + Image files (*.png *.jpg) + + + + Insert &Image + + + + Hyperlink Settings + + + + &Left + + + + C&enter + + + + &Right + + + + &Justify + + + + Bullet List + + + + Numbered List + + + + &Color... + + + + &Table Settings + + + + Create Table + + + + Remove Table + + + + Add Row + + + + Add Column + + + + Remove Row + + + + Remove Column + + + + Merge Cells + + + + Split Row + + + + Split Column + + + + + QmlDesigner::SetFrameValueDialog + + Edit Keyframe + + + + Frame + Cadre + + + + QmlDesigner::ShortCutManager + + &Undo + Ann&uler + + + &Redo + &Refaire + + + Delete + Supprimer + + + Cu&t + Co&uper + + + &Copy + &Copier + + + &Paste + C&oller + + + Select &All + Tout &sélectionner + + + Export as &Image... + Exporter en tant qu’&image… + + + &Duplicate + &Dupliquer + + + Save %1 As... + Enregistrer %1 sous… + + + &Save %1 + Enregi&strer %1 + + + Revert %1 to Saved + Restaurer %1 à la version enregistrée + + + Close %1 + Fermer %1 + + + Close All Except %1 + Tout fermer sauf %1 + + + Close Others + Fermer les autres éditeurs + + + + QmlDesigner::SignalList + + Signal List for %1 + + + + + QmlDesigner::SignalListDelegate + + Release + Release + + + Connect + + + + + QmlDesigner::SignalListModel + + Item ID + + + + Signal + Signal + + + + QmlDesigner::SourceTool + + Open File + + + + Source Tool + + + + + QmlDesigner::SplineEditor + + Delete Point + + + + Smooth Point + + + + Corner Point + + + + Add Point + + + + Reset Zoom + Réinitialiser le zoom + + + + QmlDesigner::StatesEditorModel + + base state + Implicit default state + état de base + + + Invalid State Name + + + + The empty string as a name is reserved for the base state. + La chaîne vide comme nom est réservée à l’état de base. + + + Name already used in another state. + Le nom est déjà utilisé dans un autre état. + + + + QmlDesigner::StatesEditorView + + States + États + + + Remove State + + + + This state is not empty. Are you sure you want to remove it? + + + + Locked components: + + + + Removing this state will modify locked components. + + + + Continue by removing the state? + + + + base state + état de base + + + + QmlDesigner::StatesEditorWidget + + States + Title of Editor widget + États + + + Cannot Create QtQuick View + Impossible de créer une vue QtQuick + + + StatesEditorWidget: %1 cannot be created.%2 + StatesEditorWidget : %1 ne peut être créé.%2 + + + + QmlDesigner::SubComponentManager + + My 3D Components + + + + + QmlDesigner::SwitchLanguageComboboxAction + + Switch the language used by preview. + + + + Default + Défaut + + + + QmlDesigner::TextEditorView + + Trigger Completion + Déclencher la complétion + + + Meta+Space + Meta+Espace + + + Ctrl+Space + Ctrl+Espace + + + Code + Code + + + + QmlDesigner::TextToModelMerger + + No import statements found. + + + + Qt Quick 6 is not supported with a Qt 5 kit. + + + + The Design Mode requires a valid Qt kit. + + + + Unsupported Qt Quick version. + + + + No import for Qt Quick found. + + + + + QmlDesigner::TextureEditorView + + Cannot Export Property as Alias + + + + Property %1 does already exist for root component. + + + + Texture Editor + + + + + QmlDesigner::TimelineAnimationForm + + Number of times the animation runs before it stops. + + + + Loops: + + + + Sets the animation to loop indefinitely. + + + + Continuous + + + + none + + + + Animation Settings + + + + Name for the animation. + + + + Animation ID: + + + + State to activate when the animation finishes. + + + + Finished: + + + + Runs the animation backwards to the beginning when it reaches the end. + + + + Ping pong + + + + Transition to state: + + + + animation02 + + + + Runs the animation automatically when the base state is active. + + + + Running in base state + + + + First frame of the animation. + + + + Start frame: + + + + Length of the animation in milliseconds. If you set a shorter duration than the number of frames, frames are left out from the end of the animation. + + + + Duration: + Durée : + + + Last frame of the animation. + + + + End frame: + + + + Invalid Id + + + + %1 is an invalid id. + %1 n’est pas un identifiant valide. + + + %1 already exists. + %1 existe déjà. + + + Base State + + + + + QmlDesigner::TimelineForm + + Last frame of the timeline. + + + + End frame: + + + + First frame of the timeline. Negative numbers are allowed. + + + + Start frame: + + + + To create an expression binding animation, delete all animations from this timeline. + + + + Expression binding + + + + Name for the timeline. + + + + Timeline ID: + + + + Timeline Settings + + + + Animation + Animation + + + Sets the expression to bind the current keyframe to. + + + + Expression binding: + + + + Invalid Id + + + + %1 is an invalid id. + %1 n’est pas un identifiant valide. + + + %1 already exists. + %1 existe déjà. + + + + QmlDesigner::TimelinePropertyItem + + Previous Frame + + + + Next Frame + + + + Auto Record + + + + Insert Keyframe + + + + Delete Keyframe + + + + Edit Easing Curve... + + + + Edit Keyframe... + + + + Remove Property + + + + + QmlDesigner::TimelineSettingsDialog + + Timeline Settings + + + + Add Timeline + + + + Remove Timeline + + + + Add Animation + + + + Remove Animation + + + + No Timeline + + + + No Animation + + + + + QmlDesigner::TimelineSettingsModel + + None + Aucune + + + State + État + + + Timeline + Ligne du temps + + + Animation + Animation + + + Fixed Frame + + + + Base State + + + + Error + Erreur + + + + QmlDesigner::TimelineToolBar + + Base State + + + + Timeline Settings + + + + To Start + + + + Previous + Précédent + + + Play + + + + Next + Suivant + + + To End + + + + Loop Playback + + + + Playback Speed + + + + Auto Key + + + + Easing Curve Editor + + + + Curve Editor + + + + Zoom Out + Zoom arrière + + + Zoom In + Zoom avant + + + + QmlDesigner::TimelineView + + Timeline + Ligne du temps + + + + QmlDesigner::TimelineWidget + + Timeline + Title of timeline view + Ligne du temps + + + Add Timeline + + + + This file does not contain a timeline. <br><br>To create an animation, add a timeline by clicking the + button. + + + + To edit the timeline settings, click + + + + + QmlDesigner::TransitionEditorSettingsDialog + + Transition Settings + + + + Add Transition + + + + Remove Transition + + + + No Transition + + + + + QmlDesigner::TransitionEditorToolBar + + Transition Settings + + + + Easing Curve Editor + + + + Curve Editor + + + + Zoom Out + Zoom arrière + + + Zoom In + Zoom avant + + + + QmlDesigner::TransitionEditorView + + No States Defined + + + + There are no states defined in this component. + + + + No Property Changes to Animate + + + + To add transitions, first change the properties that you want to animate in states (%1). + + + + Transitions + + + + + QmlDesigner::TransitionEditorWidget + + Transition + Title of transition view + + + + Add Transition + + + + This file does not contain transitions. <br><br> To create an animation, add a transition by clicking the + button. + + + + To edit the transition settings, click + + + + + QmlDesigner::TransitionForm + + Invalid ID + Identifiant invalide + + + %1 is an invalid ID. + %1 n’est pas un identifiant valide. + + + %1 already exists. + %1 existe déjà. + + + + QmlDesigner::TransitionTool + + Add Transition + Ajouter une transition + + + Remove Transitions + Supprimer des transitions + + + Remove All Transitions + Supprimer toutes les transitions + + + Do you really want to remove all transitions? + Voulez-vous vraiment supprimer toutes les transitions ? + + + Remove Dangling Transitions + + + + Transition Tool + Outil de transition + + + + QmlDesignerAddResources + + Image Files + + + + Font Files + + + + Sound Files + + + + Video Files + + + + Shader Files + + + + 3D Assets + + + + Qt 3D Studio Presentations + + + + Effect Maker Files + + + + + QmlDesignerContextMenu + + Selection + Sélection + + + Edit + Modifier + + + Anchors + Ancres + + + Layout + Organisation + + + Parent + + + + Select: %1 + Sélectionner : %1 + + + Change State + + + + Change State Group + + + + Default State + + + + Change Signal + + + + Change Slot + + + + to + + + + Open Connections Editor + + + + Remove This Handler + + + + Add Signal Handler + + + + Connect: %1 + + + + Cut + Couper + + + Copy + Copier + + + Paste + Coller + + + Delete Selection + Supprimer la sélection + + + Connections + + + + Connect + + + + Select Effect + + + + Arrange + + + + Positioner + + + + Group + + + + Snapping + Aimantation + + + Flow + Flux + + + Flow Effects + + + + Stacked Container + + + + Bring to Front + + + + Send to Back + + + + Bring Forward + + + + Send Backward + + + + Undo + Annuler + + + Redo + Refaire + + + Visibility + Visibilité + + + Reset Size + Réinitialiser la taille + + + Reset Position + Réinitialiser la position + + + Copy Formatting + + + + Apply Formatting + + + + Enter Component + + + + Merge with Template + + + + Go to Implementation + + + + Add New Signal Handler + + + + Make Component + + + + Edit Material + + + + Edit Annotations + + + + Add Mouse Area + + + + Open Signal Dialog + + + + Update 3D Asset + + + + Reverse + + + + Fill Parent + + + + No Anchors + + + + Top And Bottom + + + + Left And Right + + + + Top + Haut + + + Right + Droite + + + Bottom + Bas + + + Left + Gauche + + + Column Positioner + + + + Row Positioner + + + + Grid Positioner + + + + Flow Positioner + + + + Remove Positioner + + + + Create Flow Action + + + + Set Flow Start + + + + Remove Layout + + + + Group in GroupItem + + + + Remove GroupItem + + + + Add Component + + + + Add Tab Bar + + + + Increase Index + + + + Decrease Index + + + + Column Layout + + + + Row Layout + + + + Grid Layout + + + + Raise selected component. + + + + Lower selected component. + + + + Reset size and use implicit size. + + + + Reset position and use implicit position. + + + + Copy formatting. + + + + Apply formatting. + + + + Fill selected component to parent. + + + + Reset anchors for selected component. + + + + Layout selected components in column layout. + + + + Layout selected components in row layout. + + + + Layout selected components in grid layout. + + + + Increase index of stacked container. + + + + Decrease index of stacked container. + + + + Add component to stacked container. + + + + Add flow action. + + + + Edit List Model... + + + + Set Id + Définir l’identifiant + + + Reset z Property + Réinitialiser la propriété z + + + Fill Width + Remplir en largeur + + + Fill Height + Remplir en hauteur + + + Timeline + Ligne du temps + + + Copy All Keyframes + + + + Paste Keyframes + + + + Add Keyframe + + + + Delete All Keyframes + + + + + QmlDesignerTimeline + + Playhead frame %1 + + + + Keyframe %1 + + + + + QmlParser + + Unclosed string at end of line + Chaîne de caractère non terminée en fin de ligne + + + Illegal unicode escape sequence + trad illegal ? + Séquence d’échappement unicode invalide + + + Illegal syntax for exponential number + Syntaxe pour le nombre exponentiel invalide + + + Unterminated regular expression literal + Expression rationnelle non terminée + + + Invalid regular expression flag '%0' + Flag d’expression rationnelle invalide « %0 » + + + Unexpected token '.' + Symbole inattendu « . » + + + Stray newline in string literal + Retour à la ligne inopiné dans la chaîne littérale + + + End of file reached at escape sequence + Fin du fichier atteinte lors de la séquence d’échappement + + + Illegal hexadecimal escape sequence + La séquence d’échappement hexadécimale n’est pas correcte + + + Octal escape sequences are not allowed + Les séquences d’échappement octale ne sont pas autorisées + + + At least one octal digit is required after '0%1' + Au moins un chiffre octal est requis après « 0%1 » + + + At least one binary digit is required after '0%1' + Au moins un chiffre binaire est requis après « 0%1 » + + + Decimal numbers can't start with '0' + Les nombres décimaux ne peuvent pas commencer par « 0 » + + + Imported file must be a script + Le fichier importé doit être un script + + + Invalid module URI + URI de module invalide + + + Incomplete version number (dot but no minor) + Numéro de version incomplet (il y a un point mais pas de version mineur) + + + File import requires a qualifier + L’importation de fichiers nécessite un qualificatif + + + Module import requires a qualifier + L’importation de modules nécessite un qualificatif + + + Invalid import qualifier + Qualificatif d’importation invalide + + + At least one hexadecimal digit is required after '0%1' + Au moins un chiffre hexadécimal est requis après « 0%1 » + + + Unterminated regular expression backslash sequence + Expression rationnelle non terminée contenant une séquence de backslash + + + Unterminated regular expression class + Classe d’expression rationnelle non terminée + + + Unexpected token `%1' + Symbole inattendu « %1 » + + + Expected token `%1' + Symbole attendu « %1 » + + + Syntax error + Erreur de syntaxe + + + + QtC::ADS + + List All Tabs + Lister tous les onglets + + + Detach Group + + + + Close Active Tab + Fermer l’onglet actif + + + Close Group + Fermer le groupe + + + Detach Area + + + + Close Area + + + + Close Other Areas + + + + Close Tab + Fermer l’onglet + + + Detach + Détacher + + + Close + Fermer + + + Close Others + Fermer les autres éditeurs + + + Enter the name of the workspace: + Saisir le nom de l’espace de travail : + + + &New + &Nouveau + + + &Rename + &Renommer + + + C&lone + C&lone + + + &Delete + &Supprimer + + + Reset + Réinitialiser + + + &Switch To + + + + Import + Importer + + + Export + Exporter + + + Restore last workspace on startup + + + + Workspace Manager + + + + <a href="qthelp://org.qt-project.qtcreator/doc/creator-project-managing-workspaces.html">What is a Workspace?</a> + <a href="qthelp://org.qt-project.qtcreator/doc/creator-project-managing-workspaces.html">Qu’est-ce qu’un espace de travail ?</a> + + + Workspace + Espace de travail + + + Last Modified + Dernière modification + + + New Workspace Name + + + + &Create + + + + Create and &Open + + + + &Clone + &Cloner + + + Clone and &Open + Cloner et &ouvrir + + + Rename Workspace + + + + Rename and &Open + + + + Import Workspace + + + + Export Workspace + + + + + QtC::Android + + Android SDK Manager + + + + Update Installed + + + + Default + Défaut + + + Stable + + + + Beta + + + + Dev + + + + Canary + + + + Include obsolete + + + + Available + Disponibles + + + Installed + Installées + + + All + Tout + + + Advanced Options... + + + + Expand All + Tout développer + + + Do you want to accept the Android SDK license? + + + + Show Packages + + + + Channel: + + + + Android SDK Changes + + + + %1 cannot find the following essential packages: "%2". +Install them manually after the current operation is done. + + + + + Android SDK installation is missing necessary packages. Do you want to install the missing packages? + + + + Checking pending licenses... + + + + + The installation of Android SDK packages may fail if the respective licenses are not accepted. + + + + + +SDK Manager is busy. + + + + %n Android SDK packages shall be updated. + + + + + + + [Packages to be uninstalled:] + + + + + SDK Manager is busy. Operation cancelled. + + + + Installing/Uninstalling selected packages... + + + + + Closing the %1 dialog will cancel the running and scheduled SDK operations. + + + + + preferences + + + + options + + + + Updating installed packages... + + + + + Android SDK operations finished. + + + + Operation cancelled. + + + + + +No pending operations to cancel... + + + + + +Cancelling pending operations... + + + + + SDK Manager Arguments + + + + Cannot load available arguments for "sdkmanager" command. + + + + SDK manager arguments: + + + + Available arguments: + + + + Create new AVD + Créer un nouvel AVD + + + Overwrite existing AVD name + + + + Name: + Nom : + + + Device definition: + + + + Architecture (ABI): + + + + Cannot create a new AVD. No suitable Android system image is installed.<br/>Install a system image for the intended Android version from the SDK Manager. + + + + Cannot create an AVD for ABI %1.<br/>Install a system image for it from the SDK Manager tab first. + + + + Allowed characters are: a-z A-Z 0-9 and . _ - + + + + SD card size: + Taille de la carte SD : + + + Create a keystore and a certificate + Crée un classeur de clés et un certificat + + + Keystore + Trousseau de clés + + + Password: + Mot de passe : + + + Retype password: + Resaisir le mot de passe : + + + Show password + Afficher le mot de passe + + + Certificate + Certificat + + + Alias name: + Nom d’alias : + + + Keysize: + Taille de la clé : + + + Validity (days): + Validité (en jours) : + + + Certificate Distinguished Names + Noms distingués de certificats + + + First and last name: + Prénom et nom : + + + Organizational unit (e.g. Necessitas): + Unité d’organisation (par exemple, Necessitas) : + + + Organization (e.g. KDE): + Organisation (comme KDE) : + + + City or locality: + Ville ou localité : + + + State or province: + État ou province : + + + Two-letter country code for this unit (e.g. RO): + Code de pays sur deux lettres pour cette unité (comme RO) : + + + Keystore Filename + + + + Use Keystore password + Utilise le mot de passe du trousseau de clés + + + Advanced Actions + Actions avancées + + + Application + Application + + + Sign package + Signature du paquet + + + Keystore: + Trousseau de clés : + + + Certificate alias: + Alias de certificat : + + + Android Configuration + Configuration Android + + + Open Android SDK download URL in the system's browser. + + + + Add the selected custom NDK. The toolchains and debuggers will be created automatically. + + + + Remove the selected NDK if it has been added manually. + + + + Force a specific NDK installation to be used by all Android kits.<br/>Note that the forced NDK might not be compatible with all registered Qt versions. + + + + Open JDK download URL in the system's browser. + + + + Set Up SDK + + + + Automatically download Android SDK Tools to selected location. + +If the selected path contains no valid SDK Tools, the SDK Tools package is downloaded +from %1, +and extracted to the selected path. +After the SDK Tools are properly set up, you are prompted to install any essential +packages required for Qt to build for Android. + + + + SDK Manager + + + + Open Android NDK download URL in the system's browser. + + + + Select the path of the prebuilt OpenSSL binaries. + + + + Download OpenSSL + + + + Automatically download OpenSSL prebuilt libraries. + +These libraries can be shipped with your application if any SSL operations +are performed. Find the checkbox under "Projects > Build > Build Steps > +Build Android APK > Additional Libraries". +If the automatic download fails, Qt Creator proposes to open the download URL +in the system's browser for manual download. + + + + JDK path exists and is writable. + + + + Android SDK path exists and is writable. + + + + Android SDK Command-line Tools installed. + + + + Android SDK Command-line Tools run. + + + + Android SDK Platform-Tools installed. + + + + All essential packages installed for all installed Qt versions. + + + + Android SDK Build-Tools installed. + + + + Android Platform SDK (version) installed. + + + + Android settings are OK. + + + + Android settings have errors. + + + + OpenSSL path exists. + + + + QMake include project (openssl.pri) exists. + + + + CMake include project (CMakeLists.txt) exists. + + + + OpenSSL Settings are OK. + + + + OpenSSL settings have errors. + + + + Select JDK Path + + + + Select Android SDK Folder + + + + Select OpenSSL Include Project File + + + + Android Settings + + + + Android SDK location: + Emplacement du SDK Android : + + + Android NDK list: + + + + Android OpenSSL settings (Optional) + + + + OpenSSL binaries location: + + + + Failed to create the SDK Tools path %1. + + + + Select an NDK + + + + Add Custom NDK + + + + The selected path has an invalid NDK. This might mean that the path contains space characters, or that it does not have a "toolchains" sub-directory, or that the NDK version could not be retrieved because of a missing "source.properties" or "RELEASE.TXT" file + + + + OpenSSL Cloning + + + + OpenSSL prebuilt libraries repository is already configured. + + + + The selected download path (%1) for OpenSSL already exists and the directory is not empty. Select a different path or make sure it is an empty directory. + + + + Cloning OpenSSL prebuilt libraries... + + + + OpenSSL prebuilt libraries cloning failed. + + + + Opening OpenSSL URL for manual download. + + + + Open Download URL + + + + The Git tool might not be installed properly on your system. + + + + (SDK Version: %1, NDK Version: %2) + + + + Unset Default + + + + Make Default + Rendre par défaut + + + The selected path already has a valid SDK Tools package. + + + + Download and install Android SDK Tools to %1? + + + + Add + Ajouter + + + Remove + Supprimer + + + Automatically create kits for Android tool chains + Créer automatiquement les kits pour les chaînes de compilation Android + + + JDK location: + Emplacement du JDK : + + + Could not run: %1 + Impossible de démarrer : %1 + + + No devices found in output of: %1 + Aucun périphérique n’a été trouvé dans la sortie de : %1 + + + Android Debugger (%1, NDK %2) + + + + Android %1 Clang %2 + + + + Keystore password is too short. + Le mot de passe du trousseau de clés est trop court. + + + Keystore passwords do not match. + Les mots de passe du trousseau de clés ne correspondent pas. + + + Certificate password is too short. + Le mot de passe du certificat est manquant. + + + Certificate passwords do not match. + Les mots de passe du certificat ne correspondent pas. + + + Certificate alias is missing. + L’alias du certificat est manquant. + + + Invalid country code. + Le code de pays est invalide. + + + Keystore files (*.keystore *.jks) + Fichier de trousseau de clés (*.keystore *.jks) + + + Include prebuilt OpenSSL libraries + + + + This is useful for apps that use SSL operations. The path can be defined in Edit > Preferences > Devices > Android. + + + + Build Android APK + + + + "%1" step failed initialization. + + + + Keystore/Certificate password verification failed. + + + + Warning: Signing a debug or profile package. + + + + The Qt version for kit %1 is invalid. + + + + The minimum Qt version required for Gradle build to work is %1. It is recommended to install the latest Qt version. + + + + The API level set for the APK is less than the minimum required by the kit. +The minimum API level required by the kit is %1. + + + + No valid input file for "%1". + + + + Android build SDK version is not defined. Check Android settings. + + + + Cannot sign the package. Invalid keystore path (%1). + + + + Cannot sign the package. Certificate alias %1 does not exist. + + + + Android deploy settings file not found, not building an APK. + + + + The Android build folder %1 was not found and could not be created. + + + + Cannot copy the target's lib file %1 to the Android build folder %2. + + + + Cannot copy file "%1" to Android build libs folder "%2". + + + + Cannot open androiddeployqt input file "%1" for writing. + + + + Cannot set up "%1", not building an APK. + + + + Error + Erreur + + + Enter keystore password + + + + Enter certificate password + + + + Uninstall the existing app before deployment + + + + No Android architecture (ABI) is set by the project. + + + + Initializing deployment to Android device/simulator + + + + The kit's run configuration is invalid. + + + + The kit's build configuration is invalid. + + + + The kit's build steps list is invalid. + + + + The kit's deploy configuration is invalid. + + + + No valid deployment device is set. + + + + The deployment device "%1" is invalid. + + + + The deployment device "%1" does not support the architectures used by the kit. +The kit supports "%2", but the device uses "%3". + + + + The deployment device "%1" is disconnected. + + + + Android: The main ABI of the deployment device (%1) is not selected. The app execution or debugging might not work properly. Add it from Projects > Build > Build Steps > qmake > ABIs. + + + + Deploying to %1 + + + + The deployment step's project node is invalid. + + + + Cannot find the androiddeployqt input JSON file. + + + + Cannot find the androiddeployqt tool. + + + + Cannot find the package name from the Android Manifest file "%1". + + + + Uninstalling the previous package "%1". + + + + Starting: "%1" + + + + The process "%1" exited normally. + Le processus « %1 » s’est terminé normalement. + + + The process "%1" exited with code %2. + Le processus « %1 » s’est terminé avec le code %2. + + + The process "%1" crashed. + Le processus « %1 » a planté. + + + Installing the app failed even after uninstalling the previous one. + + + + Installing the app failed with an unknown error. + + + + Deployment failed with the following errors: + + + + + + +Uninstalling the installed package may solve the issue. +Do you want to uninstall the existing package? + +La désinstallation du paquet installé peut résoudre le problème. +Voulez-vous désinstaller le paquet existant ? + + + Install failed + + + + The deployment AVD "%1" cannot be started. + + + + Package deploy: Failed to pull "%1" to "%2". + + + + Package deploy: Running command "%1". + + + + Install an APK File + + + + Qt Android Installer + + + + Deploy to Android device + Déployer sur périphérique Android + + + Pulling files necessary for debugging. + Envoie des fichiers nécessaires au débogage. + + + Android package (*.apk) + Paquet Android (*.apk) + + + Device name: + Nom du périphérique : + + + Device type: + Type de périphérique : + + + Unknown + Inconnue + + + Serial number: + + + + CPU architecture: + + + + OS version: + Version de l’OS : + + + Yes + Oui + + + No + Non + + + Authorized: + + + + Android target flavor: + + + + Skin type: + + + + OpenGL status: + + + + Android Device Manager + + + + Run on Android + Exécuter sur Android + + + Refresh + Rafraîchir + + + Start AVD + + + + Erase AVD + + + + AVD Arguments + + + + Set up Wi-Fi + + + + Emulator for "%1" + + + + Physical device + Périphérique physique + + + None + Aucune + + + Erase the Android AVD "%1"? +This cannot be undone. + + + + The device has to be connected with ADB debugging enabled to use this feature. + + + + Opening connection port %1 failed. + + + + Retrieving the device IP address failed. + + + + The retrieved IP address is invalid. + + + + Connecting to the device IP "%1" failed. + + + + An error occurred while removing the Android AVD "%1" using avdmanager tool. + + + + Emulator Command-line Startup Options + + + + Emulator command-line startup options (<a href="%1">Help Web Page</a>): + + + + Android Device + Périphérique Android + + + The device info returned from AvdDialog is invalid. + + + + Unknown Android version. API Level: %1 + + + + Error creating Android templates. + Erreur lors de la création des modèles Android. + + + Cannot parse "%1". + + + + Android package installation failed. +%1 + + + + Starting Android virtual device failed. + Le démarrage du périphérique virtuel Android a échoué. + + + Deploy to device + Déployer sur le périphérique + + + Copy application data + Copie des données de l’application + + + <b>Make install:</b> Copy App Files to %1 + + + + "%1" step has an invalid C++ toolchain. + + + + Removing directory %1 + Supprimer le répertoire %1 + + + Failed to clean "%1" from the previous build, with error: +%2 + + + + Android + Qt Version is meant for Android + Android + + + No free ports available on host for QML debugging. + Aucun port libre n’est disponible sur l’hôte pour le débogage.QML. + + + Failed to find application directory. + + + + Cannot find C++ debug server in NDK installation. + + + + The lldb-server binary has not been found. + + + + Cannot copy C++ debug server. + + + + Failed to start the activity. + + + + Activity Manager threw the error: %1 + + + + Failed to start debugger server. + + + + Failed to forward JDB debugging ports. + + + + Failed to start JDB. + + + + Cannot attach JDB to the running application. + + + + "%1" died. + + + + Failed to forward C++ debugging ports. + Échec du transfert des ports de débogage C++. + + + Failed to forward QML debugging ports. + Échec du transfert des ports de débogage QML. + + + General + Général + + + XML Source + Source XML + + + Android Manifest editor + Éditeur de manifest Android + + + Package + Paquet + + + Include default permissions for Qt modules. + + + + Include default features for Qt modules. + + + + <p align="justify">Please choose a valid package name for your application (for example, "org.example.myapplication").</p><p align="justify">Packages are usually defined using a hierarchical naming pattern, with levels in the hierarchy separated by periods (.) (pronounced "dot").</p><p align="justify">In general, a package name begins with the top level domain name of the organization and then the organization's domain and then any subdomains listed in reverse order. The organization can then choose a specific name for their package. Package names should be all lowercase characters whenever possible.</p><p align="justify">Complete conventions for disambiguating package names and rules for naming packages when the Internet domain name cannot be directly used as a package name are described in section 7.7 of the Java Language Specification.</p> + <p align="justify">Veuillez choisir un nom de paquet valide pour votre application (par exemple « org.exemple.monapplication »).</p><p align="justify">Les paquets sont habituellement définis en utilisant un modèle hiérarchique de nommage, avec des niveaux dans la hiérarchie séparés par des points (.) (prononcé « dot »).</p><p align="justify">En général, un nom de paquet commence avec le nom du domaine de premier niveau de l’organisation puis le domaine de l’organisation et ensuite les sous-domaines listés dans l’ordre inverse. L’organisation peut alors choisir un nom spécifique pour leurs paquets. Les noms de paquets doivent tous être en minuscule autant que possible.</p><p align="justify">La convention complète pour les noms de paquets et les règles pour les nommer lorsque le nom de domaine internet ne peut être utilisé directement comme nom de paquet sont décrites dans la section 7.7 de la spécification du langage Java.</p> + + + Package name: + Nom du paquet : + + + The package name is not valid. + Le nom du paquet n’est pas valide. + + + Version code: + Version du code : + + + Version name: + Nom de version : + + + Sets the minimum required version on which this application can be run. + Définie la version minimale nécessaire sur laquelle cette application peut tourner. + + + Not set + Non défini + + + Minimum required SDK: + Version du SDK Minimale requise : + + + Sets the target SDK. Set this to the highest tested version. This disables compatibility behavior of the system for your application. + + + + Activity name: + + + + Style extraction: + + + + Screen orientation: + + + + Advanced + Avancé + + + Application icon + + + + Splash screen + + + + Could not parse file: "%1". + + + + %2: Could not parse file: "%1". + + + + Target SDK: + SDK cible : + + + Application name: + Nom de l’application : + + + The structure of the Android manifest file is corrupted. Expected a top level 'manifest' node. + La structure du fichier manifest Android est corrompue. Un nœud de premier niveau « manifest » est attendu. + + + The structure of the Android manifest file is corrupted. Expected an 'application' and 'activity' sub node. + La structure du fichier manifest Android est corrompue. Des sous-nœud « application » et « activity » sont attendus. + + + API %1: %2 + API %1 : %2 + + + Permissions + Permissions + + + Goto error + Aller à l’erreur + + + Target API: + API cible : + + + MiB + Mio + + + Signing a debug package + Authentifier un paquet Debug + + + Open package location after build + Ouvrir l’emplacement du paquet après la compilation + + + Verbose output + Sortie détaillée + + + Incorrect password. + + + + Android build-tools version: + + + + Android build platform SDK: + + + + Create Templates + + + + Create an Android package for Custom Java code, assets, and Gradle configurations. + + + + Android customization: + + + + Application Signature + + + + Select Keystore File + + + + Create... + + + + Add debug server + + + + Packages debug server with the APK to enable debugging. For the signed APK this option is unchecked by default. + + + + Build Android App Bundle (*.aab) + + + + Additional Libraries + Bibliothèques supplémentaires + + + List of extra libraries to include in Android package and load on startup. + Liste des bibliothèques supplémentaires à inclure dans le paquet Android et à charger au démarrage. + + + Add... + Ajouter… + + + Select library to include in package. + Sélectionner la bibliothèque à inclure dans le paquet. + + + Remove currently selected library from list. + Supprimer de la liste la bibliothèque actuellement sélectionnée. + + + Failed to run keytool. + Échec d’exécution de keytool. + + + Select additional libraries + Sélectionner les bibliothèques supplémentaires + + + Libraries (*.so) + Bibliothèques (*.so) + + + Android: SDK installation error 0x%1 + Android : erreur d’installation du SDK 0x%1 + + + Android: NDK installation error 0x%1 + Android : erreur d’installation du NDK 0x%1 + + + Android: Java installation error 0x%1 + Android : erreur d’installation de Java 0x%1 + + + Android: ant installation error 0x%1 + Android : erreur d’installation de ant 0x%1 + + + Android: adb installation error 0x%1 + Android : erreur d’installation de adb 0x%1 + + + Android: Device connection error 0x%1 + Android : erreur de connexion du périphérique 0x%1 + + + Android: Device permission error 0x%1 + Android : erreur de permission du périphérique 0x%1 + + + Android: Device authorization error 0x%1 + Android : erreur d’autorisation du périphérique 0x%1 + + + Android: Device API level not supported: error 0x%1 + Android : le niveau d’API du périphérique n’est pas pris en charge : erreur 0x%1 + + + Android: Unknown error 0x%1 + Android : erreur inconnue 0x%1 + + + No application .pro file found in this project. + Aucun fichier d’application .pro n’a été trouvé dans ce projet. + + + No Application .pro File + Aucun ficher d’application .pro + + + Select the .pro file for which you want to create the Android template files. + + + + .pro file: + Fichier .pro : + + + Select a .pro File + Sélectionner un fichier .pro + + + Android package source directory: + Répertoire des sources du paquet Android : + + + The Android package source directory cannot be the same as the project directory. + + + + Copy the Gradle files to Android directory + + + + It is highly recommended if you are planning to extend the Java part of your Qt application. + + + + Select the Android package source directory. + +The files in the Android package source directory are copied to the build directory's Android directory and the default files are overwritten. + + + + The Android template files will be created in the %1 set in the .pro file. + + + + Create Android Template Files Wizard + + + + Could not update the project file %1. + + + + Project File not Updated + Le fichier de projet n’a pas été mis à jour + + + Cannot create AVD. Invalid input. + + + + Could not start process "%1" + + + + Cannot create AVD. Command timed out. + + + + Emulator Tool Is Missing + + + + Install the missing emulator tool (%1) to the installed Android SDK. + + + + AVD Start Error + + + + Master icon + + + + Select master icon. + + + + LDPI icon + + + + Select an icon suitable for low-density (ldpi) screens (~120dpi). + + + + MDPI icon + + + + Select an icon for medium-density (mdpi) screens (~160dpi). + + + + HDPI icon + + + + Select an icon for high-density (hdpi) screens (~240dpi). + + + + XHDPI icon + + + + Select an icon for extra-high-density (xhdpi) screens (~320dpi). + + + + XXHDPI icon + + + + Select an icon for extra-extra-high-density (xxhdpi) screens (~480dpi). + + + + XXXHDPI icon + + + + Select an icon for extra-extra-extra-high-density (xxxhdpi) screens (~640dpi). + + + + Icon scaled up. + + + + Click to select... + + + + Images (*.png *.jpg *.jpeg *.webp *.svg) + + + + Deploy to Android Device + + + + Java Language Server + + + + Would you like to configure Android options? This will ensure Android kits can be usable and all essential packages are installed. To do it later, select Edit > Preferences > Devices > Android. + + + + Configure Android + + + + Configure Android... + + + + %1 needs additional settings to enable Android support. You can configure those settings in the Options dialog. + + + + %1 has been stopped. + + + + Selected device is invalid. + + + + Selected device is disconnected. + + + + Launching AVD. + + + + Could not start AVD. + + + + No valid AVD has been selected. + + + + Checking if %1 app is installed. + + + + ABI of the selected device is unknown. Cannot install APK. + + + + Cannot install %1 app for %2 architecture. The appropriate APK was not found in resources folders. + + + + Installing %1 APK. + + + + Too many .qmlproject files in your project. Open directly the .qmlproject file you want to work with and then run the preview. + + + + No .qmlproject file found among project files. + + + + Could not gather information on project files. + + + + Could not create file for %1 "%2" + + + + A timeout occurred running "%1" + + + + Crash while creating file for %1 "%2" + + + + Creating file for %1 failed. "%2" (exit code %3). + + + + Uploading files. + + + + Starting %1. + Démarrage de %1. + + + %1 is running. + %1 est en cours d’exécution. + + + NDK is not configured in Devices > Android. + + + + SDK is not configured in Devices > Android. + + + + Failed to detect the ABIs used by the Qt version. Check the settings in Devices > Android for errors. + Échec de la détection de l’ABI utilisée par la version de Qt. Vérifiez les réglages dans Périphériques > Android pour connaitre les erreurs. + + + Clean Environment + Environnement vierge + + + Activity manager start arguments: + + + + Pre-launch on-device shell commands: + + + + Post-quit on-device shell commands: + + + + "%1" terminated. + + + + Encountered SSL errors, download is aborted. + + + + The SDK Tools download URL is empty. + + + + Downloading SDK Tools package... + + + + Cancel + Annuler + + + Download SDK Tools + + + + Could not open %1 for writing: %2. + + + + Downloading Android SDK Tools from URL %1 has failed: %2. + + + + Download from %1 was redirected. + + + + Writing and verifying the integrity of the downloaded file has failed. + + + + The operation requires user interaction. Use the "sdkmanager" command-line tool. + + + + Updating installed packages. + + + + Failed. + Échec. + + + Done + + + + + + Installing + Installation + + + Uninstalling + Désinstallation + + + AndroidSdkManager + Failed + + + + AndroidSdkManager + Done + + + + + + License command failed. + + + + + + Revision + + + + API + + + + Tools + + + + SDK Platform + + + + Android Clang + + + + Java: + + + + Java Language Server: + + + + Path to equinox launcher jar + + + + Images (*.png *.jpg *.jpeg) + + + + Select splash screen image + + + + Portrait splash screen + + + + Select portrait splash screen image + + + + Landscape splash screen + + + + Select landscape splash screen image + + + + Clear All + Tout effacer + + + A non-sticky splash screen is hidden automatically when an activity is drawn. +To hide a sticky splash screen, invoke QtAndroid::hideSplashScreen(). + + + + Sticky splash screen: + + + + Image show mode: + + + + Background color of the splash screen. + + + + Background color: + + + + Select master image to use. + + + + Master image: + + + + Select portrait master image to use. + + + + Portrait master image: + + + + Select landscape master image to use. + + + + Landscape master image: + + + + LDPI + + + + MDPI + + + + HDPI + + + + XHDPI + + + + XXHDPI + + + + XXXHDPI + + + + An image is used for the splashscreen. Qt Creator manages +splashscreen by using a different method which requires changing +the manifest file by overriding your settings. Allow override? + + + + Convert + + + + Select background color + + + + Select master image + + + + Select portrait master image + + + + Select landscape master image + + + + Images + Images + + + + QtC::Autotest + + Testing + Test + + + &Tests + &Tests + + + Run &All Tests + Exécuter &tous les tests + + + Run all tests + Exécuter tous les tests + + + Ctrl+Meta+T, Ctrl+Meta+A + Ctrl+Meta+T, Ctrl+Meta+A + + + Alt+Shift+T,Alt+A + Alt+Maj+T,Alt+A + + + Run All Tests Without Deployment + Exécuter tous les tests sans déploiement + + + Run all tests without deployment + Exécuter tous les tests sans déploiement + + + Ctrl+Meta+T, Ctrl+Meta+E + Ctrl+Meta+T, Ctrl+Meta+E + + + Alt+Shift+T,Alt+E + Alt+Maj+T,Alt+E + + + &Run Selected Tests + &Exécuter les tests sélectionnés + + + Run selected tests + Exécuter les tests sélectionnés + + + Ctrl+Meta+T, Ctrl+Meta+R + Ctrl+Meta+T, Ctrl+Meta+R + + + Alt+Shift+T,Alt+R + Alt+Maj+T,Alt+R + + + &Run Selected Tests Without Deployment + &Exécuter les tests sélectionnés sans déploiement + + + Ctrl+Meta+T, Ctrl+Meta+W + Ctrl+Meta+T, Ctrl+Meta+W + + + Alt+Shift+T,Alt+W + Alt+Maj+T,Alt+W + + + Run &Failed Tests + Exécuter les tests en é&chec + + + Run failed tests + Exécuter les tests en échec + + + Ctrl+Meta+T, Ctrl+Meta+F + Ctrl+Meta+T, Ctrl+Meta+F + + + Alt+Shift+T,Alt+F + Alt+Maj+T,Alt+F + + + Run Tests for &Current File + Exécuter les tests pour le fichier &actuel + + + Run tests for current file + Exécuter les tests pour le fichier actuel + + + Ctrl+Meta+T, Ctrl+Meta+C + Ctrl+Meta+T, Ctrl+Meta+C + + + Alt+Shift+T,Alt+C + Alt+Maj+T,Alt+C + + + Re&scan Tests + Rescanner les tests + + + Ctrl+Meta+T, Ctrl+Meta+S + Ctrl+Meta+T, Ctrl+Meta+S + + + Alt+Shift+T,Alt+S + Alt+Maj+T,Alt+S + + + &Run Test Under Cursor + &Exécuter les tests sous le curseur + + + Run Test Under Cursor Without Deployment + Exécuter les tests sous le curseur sans déploiement + + + &Debug Test Under Cursor + &Déboguer le test sous le curseur + + + Debug Test Under Cursor Without Deployment + Déboguer le test sous le curseur sans déploiement + + + Cannot debug multiple tests at once. + Impossible de déboguer plusieurs tests à la fois. + + + Selected test was not found (%1). + Le test sélectionné n’a pas été trouvé (%1). + + + Boost Test + Test boost + + + Executing test case %1 + + + + Executing test suite %1 + + + + Test execution took %1 + + + + Test suite execution took %1 + + + + Executing test module %1 + + + + Test module execution took %1 + + + + %1 failures detected in %2. + + + + %1 tests passed. + + + + No errors detected. + + + + Running tests exited with %1 + + + + Executable: %1 + + + + Running tests failed. +%1 +Executable: %2 + + + + Running tests without output. + + + + Log format: + + + + Report level: + + + + Seed: + + + + A seed of 0 means no randomization. A value of 1 uses the current time, any other value is used as random seed generator. + + + + Randomize + + + + Randomize execution order. + + + + Catch system errors + + + + Catch or ignore system errors. + + + + Floating point exceptions + + + + Enable floating point exception traps. + + + + Detect memory leaks + + + + Enable memory leak detection. + + + + parameterized + + + + fixture + + + + templated + + + + Catch Test + + + + Exception: + + + + Executing %1 "%2" + + + + %1 "%2" passed + + + + Expression passed + + + + Expression failed: %1 + + + + Finished executing %1 "%2" + + + + Number of resamples for bootstrapping. + + + + ms + + + + Abort after + + + + Aborts after the specified number of failures. + + + + Benchmark samples + + + + Number of samples to collect while running benchmarks. + + + + Benchmark resamples + + + + Number of resamples used for statistical bootstrapping. + + + + Confidence interval used for statistical bootstrapping. + + + + Benchmark confidence interval + + + + Benchmark warmup time + + + + Warmup time for each test. + + + + Disable analysis + + + + Disables statistical analysis and bootstrapping. + + + + Show success + + + + Show success for tests. + + + + Break on failure while debugging + + + + Turns failures into debugger breakpoints. + + + + Skip throwing assertions + + + + Skips all assertions that test for thrown exceptions. + + + + Visualize whitespace + + + + Makes whitespace visible. + + + + Warn on empty tests + + + + Warns if a test section does not check any assertion. + + + + Running tests for %1 + + + + Output on failure + + + + Output mode + + + + Default + Défaut + + + Verbose + Journal + + + Very Verbose + + + + Repetition mode + + + + Until Fail + + + + Until Pass + + + + After Timeout + + + + Count + + + + Number of re-runs for the test. + + + + Schedule random + + + + Stop on failure + + + + Run tests in parallel mode using given number of jobs. + + + + Jobs + + + + Test load + + + + Try not to start tests when they may cause CPU load to pass a threshold. + + + + Threshold + + + + CTest + + + + Repeat tests + + + + Run in parallel + + + + Google Test + + + + Enable or disable grouping of test cases by folder or GTest filter. +See also Google Test settings. + + + + Running tests failed. + %1 +Executable: %2 + + + + Repeating test suite %1 (iteration %2) + + + + Entering test case %1 + + + + Execution took %1. + + + + Iterations: + + + + A seed of 0 generates a seed based on the current timestamp. + + + + Run disabled tests + + + + Executes disabled tests when performing a test run. + + + + Shuffle tests + + + + Shuffles tests automatically on every iteration by the given seed. + + + + Repeats a test run (you might be required to increase the timeout to avoid canceling the tests). + + + + Throw on failure + + + + Turns assertion failures into C++ exceptions. + + + + Directory + Répertoire + + + GTest Filter + + + + Group mode: + + + + Select on what grouping the tests should be based. + + + + Active filter: + + + + Set the GTest filter to be used for grouping. +See Google Test documentation for further information on GTest filters. + + + + <matching> + + + + <not matching> + + + + Change GTest filter in use inside the settings. + + + + typed + + + + Active frameworks: + Cadriciels actifs : + + + Automatically run tests after build + Exécuter automatiquement les tests après la compilation + + + None + Aucun + + + All + Tous + + + Selected + Sélectionné + + + Qt Test + Qt Test + + + %1 %2 per iteration (total: %3, iterations: %4) + + + + Qt version: %1 + Version de Qt : %1 + + + Qt build: %1 + + + + QTest version: %1 + Version de QTest : %1 + + + XML parsing failed. + Échec de l’analyse XML. + + + Entering test function %1::%2 + + + + Executing test function %1 + + + + Execution took %1 ms. + + + + Test execution took %1 ms. + + + + Test function finished. + + + + Test finished. + + + + Walltime + + + + Uses walltime metrics for executing benchmarks (default). + + + + Tick counter + + + + Uses tick counter when executing benchmarks. + + + + Event counter + + + + Uses event counter when executing benchmarks. + + + + Callgrind + Callgrind + + + Uses Valgrind Callgrind when executing benchmarks (it must be installed). + + + + Perf + + + + Uses Perf when executing benchmarks (it must be installed). + + + + Disable crash handler while debugging + + + + Enables interrupting tests on assertions. + + + + Use XML output + + + + XML output is recommended, because it avoids parsing issues, while plain text is more human readable. + +Warning: Plain text misses some information, such as duration. + + + + Verbose benchmarks + + + + Log signals and slots + + + + Log every signal emission and resulting slot invocations. + + + + Limit warnings + + + + Set the maximum number of warnings. 0 means that the number is not limited. + + + + Unlimited + + + + Check for derived Qt Quick tests + + + + Search for Qt Quick tests that are derived from TestCase. +Warning: Enabling this feature significantly increases scan time. + + + + Benchmark Metrics + + + + <p>Multiple testcases inside a single executable are not officially supported. Depending on the implementation they might get executed or not, but never will be explicitly selectable.</p> + + + + inherited + + + + multiple testcases + + + + Quick Test + + + + <unnamed> + <sans nom> + + + Give all test cases a name to ensure correct behavior when running test cases and to be able to select them + + + + Scanning for Tests + Scan pour les tests + + + Auto Test + + + + Tests + + + + No active test frameworks. + + + + Run This Test + Exécuter ce test + + + Run Without Deployment + Exécuter sans déploiement + + + Debug This Test + Déboguer ce test + + + Debug Without Deployment + Déboguer sans déploiement + + + Select All + Tout sélectionner + + + Deselect All + Tout désélectionner + + + Filter Test Tree + Filtrer l’arbre de test + + + Sort Naturally + + + + Expand All + Tout développer + + + Collapse All + Tout réduire + + + Sort Alphabetically + Trier par ordre alphabétique + + + Show Init and Cleanup Functions + + + + Show Data Functions + + + + Test executable crashed. + L’exécutable du test a planté. + + + Stop Test Run + Arrêter l’exécution du test + + + Filter Test Results + Filtrer les résultats du test + + + Switch Between Visual and Text Display + Passer de l’affichage visuel à l’affichage textuel + + + Test Results + Résultats des tests + + + Pass + Succès + + + Fail + Échec + + + Expected Fail + Échec attendu + + + Unexpected Pass + Succès inattendu + + + Skip + À sauter + + + Benchmarks + Benchmarks + + + Debug Messages + Messages de débogage + + + Warning Messages + Messages d’avertissement + + + Internal Messages + Messages internes + + + Check All Filters + Cocher tous les filtres + + + Uncheck All Filters + Décocher tous les filtres + + + Test summary + Résumé des tests + + + passes + passe + + + fails + échoue + + + unexpected passes + passe de façon inattendue + + + expected fails + échoue de façon attendue + + + fatals + + + + blacklisted + + + + skipped + + + + disabled + + + + Copy + Copier + + + Copy All + Tout copier + + + Save Output to File... + + + + Run This Test Without Deployment + + + + Debug This Test Without Deployment + + + + Save Output To + + + + Error + Erreur + + + Failed to write "%1". + +%2 + + + + AutoTest Debug + + + + Test run canceled by user. + + + + +Run configuration: deduced from "%1" + + + + +Run configuration: "%1" + + + + Omitted the following arguments specified on the run configuration page for "%1": + + + + Omitted the following environment variables for "%1": + + + + Executable path is empty. (%1) + + + + Current kit has changed. Canceling test run. + + + + Test case canceled due to timeout. +Maybe raise the timeout? + + + + Failed to start test for project "%1". + + + + Test for project "%1" crashed. + Le test pour le projet « %1 » a planté. + + + Test for project "%1" did not produce any expected output. + + + + No tests selected. Canceling test run. + + + + Project is null. Canceling test run. +Only desktop kits are supported. Make sure the currently active kit is a desktop kit. + + + + Project is not configured. Canceling test run. + + + + Project is null for "%1". Removing from test run. +Check the test environment. + + + + Project's run configuration was deduced for "%1". +This might cause trouble during execution. +(deduced from "%2") + + + + Startup project has changed. Canceling test run. + + + + No test cases left for execution. Canceling test run. + + + + Running Tests + + + + Failed to get run configuration. + + + + Could not find command "%1". (%2) + + + + Unable to display test results when using CDB. + + + + Build failed. Canceling test run. + + + + Select Run Configuration + + + + Could not determine which run configuration to choose for running tests + + + + Remember choice. Cached choices can be reset by switching projects or using the option to clear the cache. + + + + Run Configuration: + + + + Executable: + + + + Arguments: + + + + Working Directory: + Répertoire de travail : + + + Omit internal messages + + + + Hides internal messages by default. You can still enable them by using the test results filter. + + + + Omit run configuration warnings + + + + Hides warnings related to a deduced run configuration. + + + + Limit result output + + + + Limits result output to 100000 characters. + + + + Limit result description: + + + + Limit number of lines shown in test result tooltip and description. + + + + Open results when tests start + + + + Displays test results automatically when tests are started. + + + + Open results when tests finish + + + + Displays test results automatically when tests are finished. + + + + Only for unsuccessful test runs + + + + Displays test results only if the test run contains failed, fatal or unexpectedly passed tests. + + + + Automatically scroll results + + + + Automatically scrolls down when new items are added and scrollbar is at bottom. + + + + Group results by application + + + + Process arguments + + + + Allow passing arguments specified on the respective run configuration. +Warning: this is an experimental feature and might lead to failing to execute the test executable. + + + + Runs chosen tests automatically if a build succeeded. + + + + Timeout: + Délai d’attente : + + + Timeout used when executing each test case. + + + + s + s + + + Timeout used when executing test cases. This will apply for each test case on its own, not the whole project. + + + + Selects the test frameworks to be handled by the AutoTest plugin. + + + + Framework + Framework + + + Group + + + + Enables grouping of test cases. + + + + Reset Cached Choices + + + + Clear all cached choices of run configurations for tests where the executable could not be deduced. + + + + General + Général + + + Automatically run + + + + Active Test Frameworks + + + + Enable or disable test frameworks to be handled by the AutoTest plugin. + + + + Enable or disable grouping of test cases by folder. + + + + No active test frameworks or tools. + + + + You will not be able to use the AutoTest plugin without having at least one active test framework. + + + + Mixing test frameworks and test tools. + + + + Mixing test frameworks and test tools can lead to duplicating run information when using "Run All Tests", for example. + + + + %1 (none) + + + + + QtC::AutotoolsProjectManager + + Arguments: + Arguments : + + + Configuration unchanged, skipping autogen step. + Configuration inchangée, étape autogen ignorée. + + + Autogen + Display name for AutotoolsProjectManager::AutogenStep id. + Autogen + + + Configuration unchanged, skipping autoreconf step. + Configuration inchangée, étape autoreconf ignorée. + + + Autoreconf + Display name for AutotoolsProjectManager::AutoreconfStep id. + Autoreconf + + + Autotools Manager + Gestionnaire pour Autotools + + + Configuration unchanged, skipping configure step. + Configuration inchangée, étape de configuration sautée. + + + Configure + Display name for AutotoolsProjectManager::ConfigureStep id. + Configurer + + + Parsing %1 in directory %2 + Analyse %1 dans le répertoire %2 + + + Parsing directory %1 + Analyse du répertoire %1 + + + + QtC::BareMetal + + Set up Debug Server or Hardware Debugger + + + + Name: + Nom : + + + Bare Metal + Bare Metal + + + Bare Metal Device + Périphérique Bare Metal + + + New Bare Metal Device Configuration Setup + Nouveau paramètres de configuration du périphérique Bare Metal + + + Unknown + Inconnue + + + Custom Executable + Exécutable personnalisé + + + The remote executable must be set in order to run a custom remote run configuration. + + + + Cannot debug: Kit has no device. + Impossible de déboguer : le kit n’a pas de périphérique. + + + No debug server provider found for %1 + + + + Debug server provider: + + + + Deploy to BareMetal Device + + + + Manage... + Gérer… + + + None + Aucune + + + Not recognized + Non reconnu + + + GDB + GDB + + + UVSC + + + + GDB compatible provider engine +(used together with the GDB debuggers). + + + + UVSC compatible provider engine +(used together with the KEIL uVision). + + + + Name + Nom + + + Type + Type + + + Engine + + + + Duplicate Providers Detected + + + + The following providers were already configured:<br>&nbsp;%1<br>They were not configured again. + + + + Add + Ajouter + + + Clone + Cloner + + + Remove + Supprimer + + + Debug Server Providers + + + + Clone of %1 + Clone de %1 + + + EBlink + + + + Host: + Hôte : + + + Executable file: + + + + Script file: + + + + Specify the verbosity level (0 to 7). + + + + Verbosity level: + + + + Connect under reset (hotplug). + + + + Connect under reset: + + + + Interface type. + + + + Type: + Type : + + + Specify the speed of the interface (120 to 8000) in kilohertz (kHz). + + + + Speed: + + + + Do not use EBlink flash cache. + + + + Disable cache: + + + + Shut down EBlink server after disconnect. + + + + Auto shutdown: + + + + Init commands: + + + + Reset commands: + + + + SWD + + + + JTAG + + + + Cannot debug: Local executable is not set. + + + + Cannot debug: Could not find executable for "%1". + + + + Choose the desired startup mode of the GDB server provider. + + + + Startup mode: + + + + Peripheral description files (*.svd) + + + + Select Peripheral Description File + + + + Peripheral description file: + + + + Startup in TCP/IP Mode + + + + Startup in Pipe Mode + + + + Enter GDB commands to reset the board and to write the nonvolatile memory. + + + + Enter GDB commands to reset the hardware. The MCU should be halted after these commands. + + + + Generic + + + + Use GDB target extended-remote + + + + Extended mode: + + + + JLink + + + + JLink GDB Server (JLinkGDBServerCL.exe) + + + + JLink GDB Server (JLinkGDBServer) + + + + IP Address + + + + Host interface: + + + + Speed + + + + Target interface: + + + + Device: + Appareil mobile : + + + Additional arguments: + Arguments supplémentaires : + + + Default + Défaut + + + USB + + + + TCP/IP + + + + Compact JTAG + + + + Renesas RX FINE + + + + ICSP + + + + Auto + + + + Adaptive + + + + %1 kHz + + + + OpenOCD + + + + Root scripts directory: + + + + Configuration file: + + + + ST-LINK Utility + + + + Specify the verbosity level (0..99). + + + + Continue listening for connections after disconnect. + + + + Reset board on connection. + + + + Reset on connection: + + + + Connects to the board before executing any instructions. + + + + Transport layer type. + + + + Version: + Version : + + + ST-LINK/V1 + + + + ST-LINK/V2 + + + + Keep unspecified + + + + uVision JLink + + + + Unable to create a uVision project options template. + + + + Adapter options: + + + + Port: + Port : + + + 50MHz + + + + 33MHz + + + + 25MHz + + + + 20MHz + + + + 10MHz + + + + 5MHz + + + + 3MHz + + + + 2MHz + + + + 1MHz + + + + 500kHz + + + + 200kHz + + + + 100kHz + + + + uVision Simulator + + + + Limit speed to real-time. + + + + Limit speed to real-time: + + + + uVision St-Link + + + + 9MHz + + + + 4.5MHz + + + + 2.25MHz + + + + 1.12MHz + + + + 560kHz + + + + 280kHz + + + + 140kHz + + + + 4MHz + + + + 1.8MHz + + + + 950kHz + + + + 480kHz + + + + 240kHz + + + + 125kHz + + + + 50kHz + + + + 25kHz + + + + 15kHz + + + + 5kHz + + + + Unable to create a uVision project template. + + + + Choose Keil Toolset Configuration File + + + + Tools file path: + + + + Target device: + + + + Target driver: + + + + Starting %1 ... + + + + Version + Version + + + Vendor + Vendeur + + + ID + Identifiant + + + Start + Démarrer + + + Size + Taille + + + FLASH Start + + + + FLASH Size + + + + RAM Start + + + + RAM Size + + + + Algorithm path. + + + + FLASH: + + + + Start address. + + + + Size. + + + + RAM: + + + + Vendor: + Vendeur : + + + Package: + Paquet : + + + Description: + Description : + + + Memory: + + + + Flash algorithm: + + + + Target device not selected. + + + + Available Target Devices + + + + Path + Chemin + + + Debugger CPU library (depends on a CPU core). + + + + Debugger driver library. + + + + Driver library: + + + + CPU library: + + + + Target driver not selected. + + + + Available Target Drivers + + + + IAREW %1 (%2, %3) + + + + IAREW + + + + &Compiler path: + + + + Platform codegen flags: + Flags de plateforme de la génération de code : + + + &ABI: + &ABI : + + + Enter the name of the debugger server provider. + + + + Enter TCP/IP hostname of the debug server, like "localhost" or "192.0.2.1". + + + + Enter TCP/IP port which will be listened by the debug server. + + + + KEIL %1 (%2, %3) + + + + KEIL + + + + SDCC %1 (%2, %3) + + + + SDCC + + + + + QtC::Bazaar + + General Information + Informations générales + + + Branch: + Branche : + + + Local commit + Commit local + + + Performs a local commit in a bound branch. +Local commits are not pushed to the master branch until a normal commit is performed. + + + + Commit Information + Informations de commit + + + Author: + Auteur : + + + Email: + Courriel : + + + Fixed bugs: + Bogues corrigés : + + + Configuration + Configuration + + + Command: + Commande : + + + User + Utilisateur + + + Username to use by default on commit. + Nom d’utilisateur à utiliser par défaut lors des commits. + + + Default username: + Nom d’utilisateur par défaut : + + + Email to use by default on commit. + Courriel à utiliser par défaut lors des commit. + + + Default email: + Courriel par défaut : + + + Miscellaneous + Divers + + + Log count: + Nombre d’entrées de log : + + + Timeout: + Délai d’attente : + + + s + s + + + The number of recent commit logs to show. Choose 0 to see all entries. + Le nombre de logs de commit récents à afficher, 0 pour tout afficher. + + + Dialog + Boite de dialogue + + + For example: 'https://[user[:pass]@]host[:port]/[path]'. + + + + Ignores differences between branches and overwrites +unconditionally. + + + + Creates the path leading up to the branch if it does not already exist. + + + + Performs a local pull in a bound branch. +Local pulls are not applied to the master branch. + + + + Branch Location + Emplacement de la branche + + + Default location + Emplacement par défaut + + + Local filesystem: + Système local de fichier : + + + Specify URL: + Spécifier l’URL : + + + Options + Options + + + Remember specified location as default + Se souvenir de l’emplacement par défaut + + + Overwrite + Écraser + + + Use existing directory + Utiliser le répertoire existant + + + Create prefix + Créer le préfixe + + + Local + Local + + + Pull Source + Rapatrier la source + + + Push Destination + ça semble plus cohérent + Destination de l’envoi + + + By default, push will fail if the target directory exists, but does not already have a control directory. +This flag will allow push to proceed. + Par défaut,le push va échouer si le répertoire cible existe, mais n’a pas déjà de répertoire de contrôle. +Ce drapeau permettra au push de se poursuivre. + + + Revert + Rétablir + + + Specify a revision other than the default? + Spécifier une révision différente de celle par défaut ? + + + Revision: + Révision : + + + Uncommit + + + + Keep tags that point to removed revisions + + + + Only remove the commits from the local branch when in a checkout + + + + If a revision is specified, uncommits revisions to leave the branch at the specified revision. +For example, "Revision: 15" will leave the branch at revision 15. + + + + Last committed + + + + Dry Run + Exécution à froid + + + Test the outcome of removing the last committed revision, without actually removing anything. + + + + Triggers a Bazaar version control operation. + + + + Bazaar + Bazaar + + + Annotate Current File + Annoter le fichier actuel + + + Annotate "%1" + Annoter « %1 » + + + Diff Current File + + + + Diff "%1" + + + + Meta+Z,Meta+D + Meta+Z, Meta+D + + + ALT+Z,Alt+D + ALT+Z, Alt+D + + + Log Current File + Réaliser un log du fichier actuel + + + Log "%1" + Réaliser un log de « %1 » + + + Meta+Z,Meta+L + Meta+Z, Meta+L + + + ALT+Z,Alt+L + ALT+Z, Alt+L + + + Status Current File + État du fichier actuel + + + Status "%1" + État « %1 » + + + Meta+Z,Meta+S + Meta+Z, Meta+S + + + ALT+Z,Alt+S + ALT+Z, Alt+S + + + Add + Ajouter + + + Add "%1" + Ajouter « %1 » + + + Delete... + Supprimer… + + + Delete "%1"... + Supprimer « %1 »… + + + Revert Current File... + Rétablir le fichier actuel… + + + Revert "%1"... + Rétablir « %1 »… + + + Diff + Diff + + + Log + Log + + + Revert... + Rétablir… + + + Status + + + + Pull... + Pull… + + + Push... + Push… + + + Update... + Mise à jour… + + + Commit... + Commit… + + + Meta+Z,Meta+C + Meta+Z, Meta+C + + + ALT+Z,Alt+C + ALT+Z, Alt+C + + + Uncommit... + + + + Create Repository... + + + + Update + Mettre à jour + + + There are no changes to commit. + Il n’y a aucun changement à envoyer. + + + Unable to create an editor for the commit. + Impossible d’ouvrir un éditeur pour le commit. + + + Unable to create a commit editor. + Impossible d’ouvrir un éditeur de commit. + + + Commit changes for "%1". + Soumettre les changements pour « %1 ». + + + Commit Editor + Faire un commit de l’éditeur + + + Bazaar Command + Commande Bazaar + + + Ignore Whitespace + Ignorer les espaces + + + Ignore Blank Lines + Ignorer les lignes vides + + + Show files changed in each revision. + + + + Show from oldest to newest. + + + + Include Merges + + + + Show merged revisions. + + + + Moderately Short + + + + One Line + + + + GNU Change Log + + + + Format + Format + + + Verbose + Journal + + + Forward + Avancer + + + Detailed + Détaillé + + + &Annotate %1 + + + + Annotate &parent revision %1 + + + + + QtC::Beautifier + + Cannot save styles. %1 does not exist. + Impossible d’enregistrer les styles. %1 n’existe pas. + + + Cannot open file "%1": %2. + Impossible d’ouvrir le fichier « %1 » : %2. + + + Cannot save file "%1": %2. + Impossible d’enregistrer le fichier « %1 » : %2. + + + No documentation file specified. + Aucun fichier de documentation n’est indiqué. + + + Cannot open documentation file "%1". + Impossible d’ouvrir le fichier de documentation « %1 ». + + + The file "%1" is not a valid documentation file. + Le fichier « %1 » n’est pas un fichier de documentation valide. + + + Cannot read documentation file "%1": %2. + Impossible de lire le fichier de documentation « %1 » : %2. + + + &Artistic Style + &Artistic Style + + + Artistic Style + Artistic Style + + + Options + Options + + + Use file *.astylerc defined in project files + Utiliser le fichier *.astylerc défini dans les fichiers du projet + + + Use specific config file: + Utiliser un fichier de configuration spécifique : + + + AStyle (*.astylerc) + AStyle (*.astylerc) + + + Use file .astylerc or astylerc in HOME + Utiliser le fichier .astylerc ou astylerc dans HOME + + + Use customized style: + Utiliser un style personnalisé : + + + Configuration + Configuration + + + Artistic Style command: + Commande d’Artistic Style : + + + Restrict to MIME types: + Restreindre aux types MIME : + + + Bea&utifier + Bea&utifier + + + Error in Beautifier: %1 + Erreur dans Beautifier : %1 + + + Cannot get configuration file for %1. + Impossible d’obtenir le fichier de configuration pour %1. + + + Format &Current File + Menu entry + Formater le fichier &actuel + + + Format &Selected Text + Menu entry + Formater le texte &sélectionné + + + &Format at Cursor + Menu entry + &Formater au niveau du curseur + + + Format &Line(s) + Menu entry + Formater la/les &ligne(s) + + + &Disable Formatting for Selected Text + Menu entry + &Désactiver le formatage du texte sélectionné + + + %1 Command + File dialog title for path chooser when choosing binary + Commande %1 + + + &ClangFormat + &ClangFormat + + + ClangFormat + ClangFormat + + + Use predefined style: + Utiliser un style pré-défini : + + + Fallback style: + Style de repli : + + + Clang Format command: + Commande de Clang Format : + + + Clang Format + Clang Format + + + No description available. + Aucune description disponible. + + + Name + Nom + + + Value + Valeur + + + Documentation + Documentation + + + Documentation for "%1" + Documentation pour « %1 » + + + Edit + Modifier + + + Remove + Supprimer + + + Add + Ajouter + + + Add Configuration + Ajouter une configuration + + + Edit Configuration + Modifier une configuration + + + Enable auto format on file save + Activer le formatage automatique lors de l’enregistrement du fichier + + + Tool: + Outil : + + + Restrict to files contained in the current project + Restreindre aux fichiers contenus dans le projet en cours + + + Automatic Formatting on File Save + Formatage automatique lors de l’enregistrement du fichier + + + General + Général + + + Beautifier + Beautifier + + + &Uncrustify + &Uncrustify + + + Uncrustify + Uncrustify + + + Use file uncrustify.cfg defined in project files + Utiliser le fichier uncrustify.cfg défini dans les fichiers du projet + + + Use file specific uncrustify.cfg + Utiliser un fichier uncrustify.cfg spécifique + + + Uncrustify file (*.cfg) + Fichier Uncrustify (*.cfg) + + + Use file uncrustify.cfg in HOME + Utiliser le fichier uncrustify.cfg dans HOME + + + Format entire file if no text was selected + Formatage du fichier entier si aucun texte n’a été sélectionné + + + For action Format Selected Text + + + + Uncrustify command: + Commande d’Uncrustify : QtC::BinEditor + + The file is too big for the Binary Editor (max. 32GB). + Le fichier est trop volumineux pour l’éditeur binaire (max. 32 Go). + &Undo Annu&ler @@ -46,88 +12493,145 @@ &Redo &Refaire + + The Binary Editor cannot open empty files. + L’éditeur binaire ne peut ouvrir des fichiers vides. + + + Cannot open %1: %2 + Impossible d’ouvrir %1 : %2 + + + File Error + Erreur de fichier + + + Memory at 0x%1 + Mémoire à 0x%1 + + + Little Endian + remettre endian ? + Petit boutiste + + + Big Endian + Grand boutiste + + + Decimal&nbsp;unsigned&nbsp;value: + Valeur&nbsp;décimale&nbsp;non signée : + + + Decimal&nbsp;signed&nbsp;value: + Valeur&nbsp;décimale&nbsp;signée : + + + Previous&nbsp;decimal&nbsp;unsigned&nbsp;value: + Valeur&nbsp;décimale&nbsp;non signée&nbsp;précédente : + + + Previous&nbsp;decimal&nbsp;signed&nbsp;value: + Valeur&nbsp;décimale&nbsp;signée&nbsp;précédente : + + + %1-bit&nbsp;Integer&nbsp;Type + Type&nbsp;entier&nbsp;de&nbsp;%1&nbsp;bits + + + Binary&nbsp;value: + Valeur&nbsp;binaire : + + + Octal&nbsp;value: + Valeur&nbsp;octale : + + + Previous&nbsp;binary&nbsp;value: + Valeur&nbsp;binaire&nbsp;précédente : + + + Previous&nbsp;octal&nbsp;value: + Valeur&nbsp;octale&nbsp;précédente : + + + <i>double</i>&nbsp;value: + Valeur&nbsp;<i>double</i> : + + + Previous <i>double</i>&nbsp;value: + Valeur&nbsp;<i>double</i>&nbsp;précédente : + + + <i>float</i>&nbsp;value: + Valeur&nbsp;<i>float</i> : + + + Previous <i>float</i>&nbsp;value: + Valeur&nbsp;<i>float</i>&nbsp;précédente : + + + Zoom: %1% + Zoom : %1 % + + + Copying Failed + Échec de la copie + + + You cannot copy more than 4 MB of binary data. + Vous ne pouvez pas copier plus de 4 Mo de données binaires. + + + Copy Selection as ASCII Characters + Copier la sélection comme des caractères ASCII + + + Copy Selection as Hex Values + Copier la sélection comme des valeurs hexadécimales + + + Set Data Breakpoint on Selection + Ajouter un point d’arrêt sur la sélection + + + Copy 0x%1 + Copier 0x%1 + + + Jump to Address in This Window + Aller à l’adresse dans cette fenêtre + + + Jump to Address in New Window + Aller à l’adresse dans une nouvelle fenêtre + + + Copy Value + Copier la valeur + + + Jump to Address 0x%1 in This Window + Aller à l’adresse 0x%1 dans cette fenêtre + + + Jump to Address 0x%1 in New Window + Aller à l’adresse 0x%1 dans une nouvelle fenêtre + QtC::Bookmarks - - Add Bookmark - Ajouter un signet - - - Bookmark: - Signet : - - - Add in Folder: - Ajouter dans le dossier : - - - + - + - - - New Folder - Nouveau dossier - Bookmarks Signets - Delete Folder - Supprimer le dossier - - - Rename Folder - Renommer le dossier - - - Add in folder: - Ajouter dans le dossier : + Matches all bookmarks. Filter by file name, by the text on the line of the bookmark, or by the bookmark's note text. + Correspond à tous les signets. Filtre par nom de fichier, par le texte de la ligne du signet ou par le texte de la note du signet. Bookmark - Signet - - - Remove - Supprimer - - - Deleting a folder also removes its content.<br>Do you want to continue? - Supprimer un dossier supprime également ce qu'il contient.<br>Êtes vous sûr de vouloir continuer ? - - - You are going to delete a Folder which will also<br>remove its content. Are you sure you would like to continue? - Vous allez supprimer un dossier et tout ce qu'il contient.<br>Êtes vous sûr de vouloir continuer ? - - - Show Bookmark - Afficher le signet - - - Show Bookmark as New Page - Afficher le signet comme une nouvelle page - - - Show Bookmark in New Tab - Afficher le signet dans un nouvel onglet - - - Delete Bookmark - Supprimer le signet - - - Rename Bookmark - Renommer le signet - - - Filter: - Filtre : - - - Add - Ajouter + Signet Move Up @@ -138,8 +12642,8 @@ Déplacer vers le bas - Edit Note - Éditer la note + &Edit + &Édition &Remove @@ -147,7 +12651,7 @@ Remove All - Supprimer tout + Tout supprimer Remove All Bookmarks @@ -155,19 +12659,15 @@ Are you sure you want to remove all bookmarks from all files in the current session? - Êtes-vous sûr de vouloir supprimer tous les signets de tous les fichiers de la session en cours ? + Voulez-vous vraiment supprimer tous les signets de tous les fichiers de la session en cours ? - Do not &ask again. - Ne plus re&demander. + Edit Bookmark + Modifier le signet - &Remove Bookmark - &Supprimer le Signet - - - Remove all Bookmarks - Supprimer tous les signets + Line number: + Numéro de ligne : &Bookmarks @@ -175,7 +12675,7 @@ Toggle Bookmark - Activer/Désactiver le signet + Activer/désactiver les signets Ctrl+M @@ -201,6 +12701,14 @@ Next Bookmark Signet suivant + + Meta+Shift+M + Meta+Maj+M + + + Ctrl+Shift+M + Ctrl+Maj+M + Ctrl+. Ctrl+. @@ -218,336 +12726,2731 @@ Signet suivant dans le document - Edit Bookmark Note - Éditer la note du signet + Alt+Meta+M + Alt+Meta+M - Previous Bookmark In Document - Signet précédent dans le document + Alt+M + Alt+M - Next Bookmark In Document - Signet suivant dans le document - - - - QtC::Debugger - - Set Breakpoint at Function - Placer un point d'arrêt à la fonction - - - Function to break on: - Fonction à interrompre : + Note text: + Note : QtC::CMakeProjectManager + + Current executable + Exécutable actuel + + + Build the executable used in the active run configuration. Currently: %1 + Compiler l’exécutable utilisé dans la configuration d’exécution active. Actuellement : %1 + + + Target: %1 + Cible : %1 + + + CMake arguments: + Arguments de Cmake : + + + Tool arguments: + Arguments de l’outil : + + + Enable automatic provisioning updates: + Activer les mises à jour automatiques du provisionnement : + + + Tells xcodebuild to create and download a provisioning profile if a valid one does not exist. + Indique à xcodebuild de créer et de télécharger un profil de provisionnement s’il n’en existe pas de valide. + + + Target + Cible + + + Persisting CMake state... + Persistance de l’état de CMake… + + + Running CMake in preparation to build... + Exécution de CMake en préparation de la compilation… + + + Project did not parse successfully, cannot build. + Le projet n’a pas été analysé avec succès, compilation impossible. + + + Build + ConfigWidget display name. + Compiler + Clear system environment - Nettoyer l'environnement système + Nettoyer l’environnement du système + + + CMake Build + Display name for CMakeProjectManager::CMakeBuildStep id. + CMake Compilation + + + Initial Configuration + Configuration initiale + + + Current Configuration + Configuration actuelle + + + Kit Configuration + Configuration du kit + + + Edit the current kit's CMake configuration. + Modifier la configuration CMake du kit actuel. + + + Filter + Filtrer + + + &Add + &Ajouter + + + Add a new configuration value. + Ajouter une nouvelle valeur de configuration. + + + &Boolean + &Booléen + + + &String + &Chaîne de caractères + + + &Directory + &Répertoire + + + &File + &Fichier + + + &Edit + &Modifier + + + Edit the current CMake configuration value. + Modifier la valeur actuelle de la configuration de CMake. + + + &Set + &Définir + + + Set a value in the CMake configuration. + Définir une valeur dans la configuration de CMake. + + + &Unset + Rà&Z + + + Unset a value in the CMake configuration. + Remettre à zéro une valeur dans la configuration de CMake. + + + &Reset + &Réinitialiser + + + Reset all unapplied changes. + Réinitialiser toutes les modifications non appliquées. + + + Batch Edit... + Modifier par lots… + + + Set or reset multiple values in the CMake configuration. + Définir ou remettre à zéro plusieurs valeurs dans la configuration de CMake. + + + Advanced + Avancé + + + <UNSET> + <NON-DÉFINI> + + + Edit CMake Configuration + Modifier la configuration de CMake + + + Enter one CMake <a href="variable">variable</a> per line.<br/>To set or change a variable, use -D&lt;variable&gt;:&lt;type&gt;=&lt;value&gt;.<br/>&lt;type&gt; can have one of the following values: FILEPATH, PATH, BOOL, INTERNAL, or STRING.<br/>To unset a variable, use -U&lt;variable&gt;.<br/> + Saisir une <a href="variable">variable</a> CMake par ligne.<br/>Pour définir ou modifier une variable, utiliser -D&lt;variable&gt;:&lt;type&gt;=&lt;valeur&gt;.<br/>le &lt;type&gt; peut avoir l’une des valeurs suivantes : FILEPATH, PATH, BOOL, INTERNAL, ou STRING.<br/>Pour remettre à zéro une variable, utiliser -U&lt;variable&gt;.<br/> + + + Re-configure with Initial Parameters + Reconfigurer avec les paramètres initiaux + + + Clear CMake configuration and configure with initial parameters? + Effacer la configuration de CMake et configurer avec les paramètres initiaux ? + + + Do not ask again + Ne plus poser la question + + + Kit CMake Configuration + Configuration CMake du kit + + + Configure + Configurer + + + Stop CMake + Arrêter CMake + + + bool + display string for cmake type BOOLEAN + bool + + + file + display string for cmake type FILE + file + + + directory + display string for cmake type DIRECTORY + directory + + + string + display string for cmake type STRING + string + + + Force to %1 + Forcer à %1 + + + Help + Aide + + + Apply Kit Value + Appliquer la valeur de kit + + + Apply Initial Configuration Value + Appliquer la valeur de configuration initiale + + + Copy + Copier + + + Changing Build Directory + Changement du répertoire de compilation + + + Change the build directory to "%1" and start with a basic CMake configuration? + Changer le répertoire de compilation en « %1 » et commencer avec une configuration CMake de base ? + + + The CMake flag for the development team + Le drapeau CMake pour l’équipe de développement + + + The CMake flag for the provisioning profile + Le drapeau CMake pour le profil de provisionnement + + + The CMake flag for the architecture on macOS + Le drapeau CMake pour l’architecture sur macOS + + + The CMake flag for QML debugging, if enabled + Le drapeau CMake pour le débogage QML, s’il est activé + + + Minimum Size Release + Minimum Size Release + + + Release with Debug Information + Release with Debug Information + + + Profile + Profiler + + + Additional CMake <a href="options">options</a>: + <a href="options">Options</a> CMake supplémentaires : + + + Build type: + Type de compilation : + + + Clean Environment + Environnement vierge + + + Base environment for the CMake configure step: + Environnement de base pour l’étape de configuration de CMake : + + + System Environment + Environnement du système Build Environment - Environnement de compilation + Environnement de compilation - Create - Créer + Clear CMake Configuration + Effacer la configuration CMake - Default - The name of the build configuration created by default for a cmake project. - Défaut + Rescan Project + Rescanner le projet Build Compilation - New Configuration - Nouvelle configuration + Build File + Compiler le fichier - New configuration name: - Nom de la nouvelle configuration : + Build File "%1" + Compiler le fichier « %1 » - New configuration - Nouvelle configuration + Ctrl+Alt+B + Ctrl+Alt+B - New Configuration Name: - Nom de la nouvelle configuration : - - - Run cmake - Exécuter CMake - - - Reconfigure project: - Reconfigurer le projet : - - - &Change - &Modifier - - - Build directory: - Répertoire de compilation : + Build File is not supported for generator "%1" + Le fichier de compilation n’est pas pris en charge pour le générateur « %1 » CMake CMake - CMake Wizard - Assistant CMake + <No CMake Tool available> + <Aucun outil CMake disponible> - Arguments: - Arguments : + CMake Tool + Outil CMake - Select the working directory - Sélectionner le répertoire de travail + The CMake Tool to use when building a project with CMake.<br>This setting is ignored when using other build systems. + L’outil CMake à utiliser lors de la compilation d’un projet avec CMake.<br>Ce paramètre est ignoré lors de l’utilisation d’autres systèmes de compilation. - Select Working Directory - Sélectionner le répertoire de travail + Unconfigured + Non configuré - Reset to default - Restaurer les paramètres par défaut + Path to the cmake executable + Chemin vers l’exécutable cmake - Working Directory: - Répertoire de travail : + CMake version %1 is unsupported. Update to version 3.15 (with file-api) or later. + La version %1 de CMake n’est pas prise en charge. Mettez à jour vers la version 3.15 (avec file-api) ou plus récente. - Working directory: - Répertoire de travail : + Change... + Modifier… - Run in Terminal - Exécuter dans un terminal + Platform + Plateforme - Debugger: - Débogueur : + Toolset + pas trouvé de traduction adéquate pour « toolset » + Toolset - Qt Creator has detected an <b>in-source-build in %1</b> which prevents shadow builds. Qt Creator will not allow you to change the build directory. If you want a shadow build, clean your source directory and re-open the project. - Qt Creator a détecté une <b>compilation dans les sources de %1</b> qui empêche les shadow builds. Qt Creator ne permettra pas de changer le répertoire de compilation. Si vous voulez effectuer un "shadow build", nettoyez le répertoire source et rouvrez le projet. - - - Build Location - Emplacement de compilation - - - Qt Creator has detected an in-source-build which prevents shadow builds. Qt Creator will not allow you to change the build directory. If you want a shadow build, clean your source directory and re-open the project. - Qt Creator a détecté une compilation dans les sources qui empêche les shadow builds. Qt Creator ne permettra pas de changer le répertoire de compilation. Si vous voulez effectuer un "shadow build", nettoyez le répertoire source et rouvrez le projet. + CMake Generator + Générateur CMake Generator: - Générateur : + Générateur : + + + Extra generator: + Générateur supplémentaire : + + + Platform: + Plateforme : + + + Toolset: + Toolset : + + + <none> + <aucun> + + + CMake <a href="generator">generator</a> + <a href="generator">Générateur</a> CMake + + + CMake generator defines how a project is built when using CMake.<br>This setting is ignored when using other build systems. + + + + CMake Tool is unconfigured, CMake generator will be ignored. + L’outil CMake n’est pas configuré, le générateur CMake sera ignoré. + + + CMake Tool does not support the configured generator. + L’outil CMake ne prend pas en charge le générateur configuré. + + + Platform is not supported by the selected CMake generator. + La plate-forme n’est pas prise en charge par le générateur CMake sélectionné. + + + Toolset is not supported by the selected CMake generator. + Le toolset n’est pas pris en charge par le générateur CMake sélectionné. + + + The selected CMake binary does not support file-api. %1 will not be able to parse CMake projects. + Le binaire CMake sélectionné ne prend pas en charge file-api. %1 ne pourra pas analyser les projets CMake. + + + <Use Default Generator> + <Utiliser le générateur par défaut> + + + Generator: %1<br>Extra generator: %2 + Générateur : %1<br>Générateur supplémentaire : %2 + + + Platform: %1 + Plateforme : %1 + + + Toolset: %1 + Toolset : %1 + + + Enter one CMake <a href="variable">variable</a> per line.<br/>To set a variable, use -D&lt;variable&gt;:&lt;type&gt;=&lt;value&gt;.<br/>&lt;type&gt; can have one of the following values: FILEPATH, PATH, BOOL, INTERNAL, or STRING. + Saisir une <a href="variable">variable</a> CMake par ligne.<br/>Pour définir une variable, utiliser -D&lt;variable&gt;:&lt;type&gt;=&lt;valeur&gt;.<br/>le &lt;type&gt; peut avoir l’une des valeurs suivantes : FILEPATH, PATH, BOOL, INTERNAL, ou STRING. + + + CMake Configuration + Configuration de CMake + + + Default configuration passed to CMake when setting up a project. + Configuration par défaut transmise à CMake lors de la création d’un projet. + + + CMake configuration has no path to qmake binary set, even though the kit has a valid Qt version. + La configuration CMake n’a pas de chemin vers le binaire qmake, même si le kit a une version valide de Qt. + + + CMake configuration has a path to a qmake binary set, even though the kit has no valid Qt version. + La configuration CMake a un chemin vers le binaire qmake, même si le kit n’a pas de version Qt valide. + + + CMake configuration has a path to a qmake binary set that does not match the qmake binary path configured in the Qt version. + La configuration CMake a un chemin vers le binaire qmake qui ne correspond pas au chemin du binaire qmake configuré dans la version Qt. + + + CMake configuration has no CMAKE_PREFIX_PATH set that points to the kit Qt version. + La configuration CMake n’a pas de CMAKE_PREFIX_PATH qui pointe vers la version Qt du kit. + + + CMake configuration has no path to a C compiler set, even though the kit has a valid tool chain. + La configuration CMake n’a pas de chemin vers un ensemble de compilateurs C, même si le kit a une chaîne de compilation valide. + + + CMake configuration has a path to a C compiler set, even though the kit has no valid tool chain. + La configuration CMake contient un chemin vers un ensemble de compilateurs C, même si le kit n’a pas de chaîne de compilation valide. + + + CMake configuration has a path to a C compiler set that does not match the compiler path configured in the tool chain of the kit. + La configuration de CMake comporte un chemin d’accès à un ensemble de compilateurs C qui ne correspond pas au chemin d’accès au compilateur configuré dans la chaîne de compilation du kit. + + + CMake configuration has no path to a C++ compiler set, even though the kit has a valid tool chain. + La configuration CMake n’a pas de chemin vers un ensemble de compilateurs C++, même si le kit a une chaîne de compilation valide. + + + CMake configuration has a path to a C++ compiler set, even though the kit has no valid tool chain. + La configuration CMake contient un chemin vers un ensemble de compilateurs C++, même si le kit n’a pas de chaîne de compilation valide. + + + CMake configuration has a path to a C++ compiler set that does not match the compiler path configured in the tool chain of the kit. + La configuration de CMake comporte un chemin d’accès à un ensemble de compilateurs C++ qui ne correspond pas au chemin d’accès au compilateur configuré dans la chaîne de compilation du kit. Run CMake Exécuter CMake - - Arguments - Arguments - - - The directory %1 already contains a cbp file, which is recent enough. You can pass special arguments or change the used toolchain here and rerun cmake. Or simply finish the wizard directly - toolchain -> chaîne de compilation ? terminer ou terminez ? - Le répertoire %1 contient déjà un fichier cbp qui est assez récent. Vous pouvez passer des arguments spéciaux ou changer la chaîne de compilation utilisée ici et réexécuter cmake. Vous pouvez aussi terminer l'assistant directement - - - The directory %1 does not contain a cbp file. Qt Creator needs to create this file by running cmake. Some projects require command line arguments to the initial cmake call. - Le répertoire %1 ne contient pas de fichier cbp. Qt Creator a besoin de créer ce fichier en exécutant cmake. Certains projets nécessitent des arguments de ligne de commande pour le premier appel à cmake. - - - The directory %1 contains an outdated .cbp file. Qt Creator needs to update this file by running cmake. If you want to add additional command line arguments, add them below. Note that cmake remembers command line arguments from the previous runs. - Le répertoire %1 contient un fichier cbp obsolète. Qt Creator a besoin de mettre à jour ce fichier en exécutant cmake. Si vous voulez passer des arguments de ligne de commande supplémentaires, ajoutez les ci dessous. Notez que cmake conserve les arguments passés lors des exécutions précédentes. - - - The directory %1 specified in a build-configuration, does not contain a cbp file. Qt Creator needs to recreate this file, by running cmake. Some projects require command line arguments to the initial cmake call. Note that cmake remembers command line arguments from the previous runs. - Le répertoire %1, sélectionné dans une des configurations de compilation, ne contient pas de fichier cbp. Qt Creator a besoin de mettre à jour ce fichier en exécutant cmake. Certains projets nécessitent des arguments de ligne de commande pour le premier appel à cmake. Notez que cmake conserve les arguments passés lors des exécutions précédentes. - - - Qt Creator needs to run cmake in the new build directory. Some projects require command line arguments to the initial cmake call. - Qt Creator doit exécuter cmake dans le nouveau répertoire de compilation. Certains projets nécessitent des arguments de ligne de commande pour le premier appel à cmake. - - - Please specify the path to the CMake executable. No CMake executable was found in the path. - capitalisation de CMake, contenu inchangé (cmake -> CMake) - Veuillez spécifier l'emplacement de l'exécutable CMake. Aucun exécutable CMake n'a été trouvé dans la liste de répertoires standards. - - - The directory %1 already contains a cbp file, which is recent enough. You can pass special arguments or change the used toolchain here and rerun CMake. Or simply finish the wizard directly. - Le répertoire %1 contient déjà un fichier cbp qui est assez récent. Vous pouvez passer des arguments spéciaux ou changer la chaîne de compilation utilisée ici et réexécuter CMake. Vous pouvez aussi terminer l'assistant directement. - - - The directory %1 already contains a cbp file, which is recent enough. You can pass special arguments or change the used tool chain here and rerun CMake. Or simply finish the wizard directly. - Le répertoire %1 contient déjà un fichier cbp qui est assez récent. Vous pouvez passer des arguments spéciaux ou changer la chaîne de compilation utilisée ici et réexécuter CMake. Vous pouvez aussi terminer l'assistant directement. - - - The directory %1 already contains a cbp file, which is recent enough. You can pass special arguments and rerun CMake. Or simply finish the wizard directly. - Le répertoire %1 contient déjà un fichier cbp assez récent. Vous pouvez passer des arguments spéciaux et réexécuter CMake. Vous pouvez aussi terminer l'assistant directement. - - - The directory %1 does not contain a cbp file. Qt Creator needs to create this file by running CMake. Some projects require command line arguments to the initial CMake call. - Le répertoire %1 ne contient pas de fichier cbp. Qt Creator a besoin de créer ce fichier en exécutant CMake. Certains projets nécessitent des arguments de ligne de commande pour le premier appel à CMake. - - - The directory %1 contains an outdated .cbp file. Qt Creator needs to update this file by running CMake. If you want to add additional command line arguments, add them below. Note that CMake remembers command line arguments from the previous runs. - Le répertoire %1 contient un fichier cbp obsolète. Qt Creator a besoin de mettre à jour ce fichier en exécutant CMake. Si vous voulez passer des arguments de ligne de commande supplémentaires, ajoutez les ci-dessous. Notez que CMake conserve les arguments passés lors des exécutions précédentes. - - - The directory %1 specified in a build-configuration, does not contain a cbp file. Qt Creator needs to recreate this file, by running CMake. Some projects require command line arguments to the initial CMake call. Note that CMake remembers command line arguments from the previous runs. - Le répertoire %1, sélectionné dans une des configurations de compilation, ne contient pas de fichier cbp. Qt Creator a besoin de mettre à jour ce fichier en exécutant CMake. Certains projets nécessitent des arguments de ligne de commande pour le premier appel à CMake. Notez que CMake conserve les arguments passés lors des exécutions précédentes. - - - Qt Creator needs to run CMake in the new build directory. Some projects require command line arguments to the initial CMake call. - Qt Creator doit exécuter CMake dans le nouveau répertoire de compilation. Certains projets nécessitent des arguments de ligne de commande pour le premier appel à CMake. - - - Refreshing cbp file in %1. - Rafraîchissement du fichier cbp dans %1 en cours. - - - No generator selected. - Pas de générateur sélectionné. - - - CMake exited with errors. Please check CMake output. - CMake s'est terminé avec des erreurs. Veuillez regarder la sortie CMake. - - - CMake exited with errors. Please check cmake output. - CMake s'est terminé avec erreur(s). Vérifiez les messages d'erreur de sortie de CMake. - - - NMake Generator - Générateur NMake - - - No valid CMake executable specified. - L'exécutable CMake spécifié est invalide. - - - No valid cmake executable specified. - L'exécutable CMake spécifié est invalide. - - - Executable: - Exécutable : - - - Prefer Ninja generator (CMake 2.8.9 or higher required) - Préférer le générateur Ninja (CMake 2.8.9 ou supérieur requis) - - - CMake executable - Exécutable CMake - - - Additional arguments: - Arguments supplémentaires : - - - Kits: - Kits : - - - <b>No build configuration found on this kit.</b> - <b>Aucune configuration de compilation n'a été trouvé pour ce kit.</b> - Targets: Cibles : - Make - CMakeProjectManager::MakeStepConfigWidget display name. - Make + Build CMake target + Compiler la cible CMake - <b>Unknown tool chain</b> - <b>Chaîne de compilation inconnue</b> + Builds a target of any open CMake project. + Compile une cible de n’importe quel projet CMake ouvert. - <b>Make:</b> %1 %2 - <b>Make : </b>%1 %2 + Open CMake target + Ouvrir une cible CMake - <b>Unknown Toolchain</b> - <b>Chaîne de compilation inconnue</b> + Jumps to the definition of a target of any open CMake project. + Passe à la définition d’une cible de n’importe quel projet CMake ouvert. - Please enter the directory in which you want to build your project. - Veuillez spécifier le répertoire où vous voulez compiler votre projet. + The build configuration is currently disabled. + La configuration de la compilation est actuellement désactivée. - Please enter the directory in which you want to build your project. - Veuillez spécifier le répertoire dans lequel vous voulez compiler votre projet. + A CMake tool must be set up for building. Configure a CMake tool in the kit options. + Un outil CMake doit être configuré pour la compilation. Configurez un outil CMake dans les options du kit. - Please enter the directory in which you want to build your project. Qt Creator recommends to not use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. - Veuillez spécifier le répertoire où vous voulez compiler votre projet. Qt Creator recommande de ne pas utiliser le répertoire source pour la compilation. Cela garantit que le répertoire source reste propre et permet des compilations multiples avec différents paramètres. + There is a CMakeCache.txt file in "%1", which suggest an in-source build was done before. You are now building in "%2", and the CMakeCache.txt file might confuse CMake. + Il y a un fichier CMakeCache.txt dans « %1 », ce qui suggère qu’une compilation in-source a été faite auparavant. Vous compilez maintenant dans « %2 », et le fichier CMakeCache.txt peut perturber CMake. - Qt Creator has found a recent cbp file, which Qt Creator will parse to gather information about the project. You can change the command line arguments used to create this file in the project mode. Click finish to load the project. - Qt Creator a trouvé un fichier cbp récent, Qt Creator va maintenant l'analyser pour rassembler des informations sur le projet. Vous pouvez changer les arguments de ligne de commande utilisés pour la création de ce fichier depuis le mode "projet". Cliquer sur Terminer pour charger le projet. + Copy to Clipboard? + Copier dans le presse-papiers ? + + + Files are not automatically added to the CMakeLists.txt file of the CMake project. +Copy the path to the source files to the clipboard? + Les fichiers ne sont pas automatiquement ajoutés au fichier CMakeLists.txt du projet CMake. +Copier le chemin d’accès aux fichiers sources dans le presse-papiers ? + + + The kit needs to define a CMake tool to parse this project. + Le kit doit définir un outil CMake pour analyser ce projet. + + + Apply configuration changes? + Appliquer les changements de configuration ? + + + Run CMake with configuration changes? + Exécuter CMake avec des changements de configuration ? + + + <b>CMake configuration failed<b><p>The backup of the previous configuration has been restored.</p><p>Issues and "Projects > Build" settings show more information about the failure.</p> + <b>Échec de la configuration de CMake<b><p>L’enregistrement de la configuration précédente a été restaurée.</p><p>Les problèmes et les paramètres de « Projets > Compilation » affichent plus d’informations sur l’échec.</p> + + + <b>Failed to load project<b><p>Issues and "Projects > Build" settings show more information about the failure.</p> + <b>Échec du chargement du projet<b><p>Les problèmes et les paramètres de « Projets > Compilation » affichent plus d’informations sur l’échec.</p> + + + Scan "%1" project tree + Scanner l’arbre du projet « %1 » + + + Failed to create build directory "%1". + Échec de la création du répertoire de compilation « %1 ». + + + No CMake tool set up in kit. + Pas d’outil CMake dans le kit. + + + The remote CMake executable cannot write to the local build directory. + L’exécutable CMake distant ne peut pas écrire dans le répertoire de compilation local. + + + %1 (via cmake) + %1 (via cmake) + + + cmake generator failed: %1. + le générateur cmake a échoué : %1. + + + Kit does not have a cmake binary set + Le kit n’a pas d’ensemble binaire cmake + + + Cannot create output directory "%1" + Impossible de créer le répertoire de sortie « %1 » + + + No valid cmake executable + Aucun exécutable valide pour cmake + + + Running in %1: %2 + Exécute dans %1 : %2 + + + Failed to open %1 for reading. + Échec de l’ouverture de %1 en lecture. + + + Format &Current File + Fomatter le fichier a&ctuel + + + Enable auto format on file save + Activer le formatage automatique lors de l’enregistrement du fichier + + + Restrict to MIME types: + Restreindre aux types MIME : + + + Restrict to files contained in the current project + Restreindre aux fichiers contenus dans le projet en cours + + + %1 Command + Commande %1 + + + Formatter + Formateur + + + Automatic Formatting on File Save + Formatage automatique lors de l’enregistrement du fichier + + + CMakeFormat command: + Commande CMakeFormat : + + + Install + ConfigWidget display name. + Installer + + + CMake Install + Display name for CMakeProjectManager::CMakeInstallStep id. + Cmake Installation + + + The source directory %1 is not reachable by the CMake executable %2. + Le répertoire source %1 n’est pas accessible par l’exécutable CMake %2. + + + The build directory %1 is not reachable by the CMake executable %2. + Le répertoire de compilation %1 n’est pas accessible par l’exécutable CMake %2. + + + The build directory "%1" does not exist + Le répertoire de compilation « %1 » n’existe pas + + + CMake executable "%1" and build directory "%2" must be on the same device. + L’exécutable CMake « %1 » et le répertoire de compilation « %2 » doivent se trouver sur le même périphérique. + + + Running %1 in %2. + Exécute %1 dans %2. + + + Configuring "%1" + Configuration de « %1 » + + + CMake process failed to start. + Échec de démarrage du processus CMake. + + + CMake process was canceled by the user. + Le processus CMake a été annulé par l’utilisateur. + + + CMake process crashed. + Le processus CMake a planté. + + + CMake process exited with exit code %1. + Le processus CMake s’est terminé avec le code %1. + + + No cmake tool set. + Pas d’ensemble d'outils cmake. + + + No compilers set in kit. + Pas d’ensemble de compilation dans le kit. + + + CMakeUserPresets.json cannot re-define the %1 preset: %2 + CMakeUserPresets.json ne peut pas redéfinir la présélection %1 : %2 + + + Build preset %1 is missing a corresponding configure preset. + La présélection de compilation %1 n’a pas de présélection de configuration correspondante. + + + Failed to load %1: %2 + Échec lors du chargement de %1 : %2 + + + Attempt to include %1 which was already parsed. + Tentative d’inclusion de %1 qui a déjà été analysé. + + + Unexpected source directory "%1", expected "%2". This can be correct in some situations, for example when importing a standalone Qt test, but usually this is an error. Import the build anyway? + Répertoire source inattendu « %1 », attendu « %2 ». Cela peut être correct dans certaines situations, par exemple lors de l’importation d’un test Qt autonome, mais il s’agit généralement d’une erreur. Importer quand même la compilation ? + + + CMake Modules + Modules CMake + + + Target type: + Type de cible : + + + No build artifacts + Pas d’artefacts de compilation + + + Build artifacts: + Compiler les artefacts : + + + Build "%1" + Compiler « %1 » + + + CMake + SnippetProvider + CMake + + + CMakeFormatter + CMakeFormatter + + + Version: %1 + Version : %1 + + + Supports fileApi: %1 + Prend en charge fileApi : %1 + + + yes + oui + + + no + non + + + Detection source: "%1" + Source de détection : « %1 » + + + (Default) + (par défaut) + + + CMake executable path does not exist. + Le chemin d’accès à l’exécutable CMake n’existe pas. + + + CMake executable path is not a file. + Le chemin d’accès à l’exécutable CMake n’est pas un fichier. + + + CMake executable path is not executable. + Le chemin d’accès à l’exécutable CMake n’est pas exécutable. + + + CMake executable does not provide required IDE integration features. + L’exécutable CMake ne fournit pas les fonctionnalités d’intégration de l’IDE requises. + + + Name + Nom + + + Path + Chemin + + + Manual + Manuel + + + CMake .qch File + Fichier CMake .qch + + + Name: + Nom : + + + Path: + Chemin : + + + Version: + Version : + + + Help file: + Fichier d’aide : + + + Add + Ajouter + + + Clone + Cloner + + + Remove + Supprimer + + + Make Default + Rendre par défaut + + + Set as the default CMake Tool to use when creating a new kit or when no value is set. + Définit l’outil CMake par défaut à utiliser lors de la création d’un nouveau kit ou si aucune valeur n’est définie. + + + Clone of %1 + Clone de %1 + + + New CMake + Nouveau CMake + + + Tools + Outils + + + Autorun CMake + Exécution automatique de CMake + + + Automatically run CMake after changes to CMake project files. + Exécution automatique de CMake après modification des fichiers de projet CMake. + + + Ask about copying file paths + Demander à propos de la copie des chemins d’accès aux fichiers + + + Do not copy file paths + Ne pas copier les chemins de fichiers + + + Copy file paths + Copier les chemins de fichiers + + + Determines whether file paths are copied to the clipboard for pasting to the CMakeLists.txt file when you add new files to CMake projects. + Détermine si les chemins d’accès aux fichiers sont copiés dans le presse-papiers pour être collés dans le fichier CMakeLists.txt lorsque vous ajoutez de nouveaux fichiers aux projets CMake. + + + Package manager auto setup + Configuration automatique du gestionnaire de paquets + + + Add the CMAKE_PROJECT_INCLUDE_BEFORE variable pointing to a CMake script that will install dependencies from the conanfile.txt, conanfile.py, or vcpkg.json file from the project source directory. + Ajoutez la variable CMAKE_PROJECT_INCLUDE_BEFORE pointant vers un script CMake qui installera les dépendances du fichier conanfile.txt, conanfile.py, ou vcpkg.json du répertoire source du projet. + + + Ask before re-configuring with initial parameters + Demander avant de reconfigurer avec les paramètres initiaux + + + Show subfolders inside source group folders + Afficher les sous-dossiers à l’intérieur des dossiers du groupe source + + + Show advanced options by default + Afficher les options avancées par défaut + + + General + Général + + + Adding Files + Ajout de fichiers + + + Version not parseable + Version non analysable + + + Searching CMake binaries... + Recherche des binaires CMake… + + + Found "%1" + « %1 » trouvé + + + Removing CMake entries... + Suppression des entrées CMake… + + + Removed "%1" + Supprimer « %1 » + + + CMake: + CMake : + + + System CMake at %1 + Cmake du système à %1 + + + Key + Clé + + + Value + Valeur + + + Kit: + Kit : + + + Initial Configuration: + Configuration initiale : + + + Current Configuration: + Configuration actuelle : + + + Not in CMakeCache.txt + Pas dans CMakeCache.txt + + + Type: + Type : + + + Select a file for %1 + Sélectionner un fichier pour %1 + + + Select a directory for %1 + Sélectionner un répertoire pour %1 + + + <Build Directory> + <Répertoire de compilation> + + + <Other Locations> + <Autres emplacements> + + + Failed to set up CMake file API support. %1 cannot extract project information. + Échec de la configuration de la prise en charge de l’API de fichiers CMake. %1 ne peut pas extraire les informations du projet. + + + Invalid reply file created by CMake. + Fichier de réponse invalide créé par CMake. + + + Invalid cache file generated by CMake. + Fichier cache invalide généré par CMake. + + + Invalid cmakeFiles file generated by CMake. + Fichier cmakeFiles invalide généré par CMake. + + + Invalid codemodel file generated by CMake: No directories. + Fichier de modèle de code invalide généré par CMake : aucun répertoire. + + + Invalid codemodel file generated by CMake: Empty directory object. + Fichier de modèle de code invalide généré par CMake : objet de répertoire vide. + + + Invalid codemodel file generated by CMake: No projects. + Fichier de modèle de code invalide généré par CMake : aucun projet. + + + Invalid codemodel file generated by CMake: Empty project object. + Fichier de modèle de code invalide généré par CMake : objet de projet vide. + + + Invalid codemodel file generated by CMake: Broken project data. + Fichier de modèle de code invalide généré par CMake : données de projet cassées. + + + Invalid codemodel file generated by CMake: Empty target object. + Fichier de modèle de code invalide généré par CMake : objet de cible vide. + + + Invalid codemodel file generated by CMake: Broken target data. + Fichier de modèle de code invalide généré par CMake : données de cible cassées. + + + Invalid codemodel file generated by CMake: No configurations. + Fichier de modèle de code invalide généré par CMake : aucune configuration. + + + Invalid codemodel file generated by CMake: Empty configuration object. + Fichier de modèle de code invalide généré par CMake : objet de configuration vide. + + + Invalid codemodel file generated by CMake: Broken indexes in directories, projects, or targets. + Fichier de modèle de code invalide généré par CMake : indices cassés dans les répertoires, projets ou cibles. + + + Invalid codemodel file generated by CMake. + Fichier de modèle de code invalide généré par CMake. + + + Invalid target file: Information is missing. + Fichier cible non valide : des informations sont manquantes. + + + Invalid target file generated by CMake: Broken indexes in target details. + Fichier de cible invalide généré par CMake : indices cassés dans les détails de la cible. + + + CMake parsing was canceled. + L’analyse CMake a été annulée. + + + CMake project configuration failed. No CMake configuration for build type "%1" found. + La configuration du projet CMake a échoué. Aucune configuration CMake pour le type de compilation « %1 » n’a été trouvée. + + + No "%1" CMake configuration found. Available configurations: "%2". +Make sure that CMAKE_CONFIGURATION_TYPES variable contains the "Build type" field. + Aucune configuration CMake « %1 » n’a été trouvée. Configurations disponibles : « %2 ». +Assurez-vous que la variable CMAKE_CONFIGURATION_TYPES contient le champ « Build type ». + + + No "%1" CMake configuration found. Available configuration: "%2". +Make sure that CMAKE_BUILD_TYPE variable matches the "Build type" field. + Aucune configuration CMake « %1 » n’a été trouvée. Configurations disponibles : « %2 ». +Assurez-vous que la variable CMAKE_BUILD_TYPE contient le champ « Build type ». + + + CMake returned error code: %1 + CMake a renvoyé le code d’erreur : %1 + + + Failed to rename "%1" to "%2". + Impossible de renommer « %1 » en « %2 ». + + + Failed to copy "%1" to "%2". + Échec de la copie de « %1 » vers « %2 ». + + + Failed to read file "%1". + Impossible de lire le fichier « %1 ». + + + Invalid file "%1". + Fichier invalide « %1 ». + + + Invalid "version" in file "%1". + « Version » non valide dans le fichier « %1 ». + + + Invalid "configurePresets" section in %1 file + Section « configurePresets » non valide dans le fichier %1 + + + Invalid "buildPresets" section in %1 file + Section « buildPresets » non valide dans le fichier %1 + + + <File System> + <Système de fichiers> - QtC::CppEditor + QtC::CVS - <Select Symbol> - <Selectionner un symbole> + CVS + CVS - <No Symbols> - <Aucun symbole> + Configuration + Configuration + + + CVS command: + Commande CVS : + + + CVS root: + Racine CVS : + + + Miscellaneous + Divers + + + When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit ID). Otherwise, only the respective file will be displayed. + Si coché, tous les fichiers modifiés par un commit seront affichés lors d’un clic sur un numéro de version dans la vue d’annotation (reçue par un identifiant de commit). Sinon, seul le fichier respectif sera affiché. + + + Describe all files matching commit id + Décrire tous les fichiers correspondant à l’identifiant de commit + + + CVS Checkout + Import CVS + + + &CVS + &CVS + + + Add + Ajouter + + + Add "%1" + Ajouter « %1 » + + + Alt+C,Alt+A + Alt+C,Alt+A + + + Diff Project + Faire un diff sur le projet + + + Diff Current File + Faire un diff du fichier actuel + + + Triggers a CVS version control operation. + + + + Diff "%1" + Faire un diff de « %1 » + + + Alt+C,Alt+D + Alt+C,Alt+D + + + Commit All Files + Faire un commit de tous les fichiers + + + Commit Current File + Faire un commit du fichier actuel + + + Commit "%1" + Faire un commit de « %1 » + + + Alt+C,Alt+C + Alt+C,Alt+C + + + Filelog Current File + Journal du fichier actuel + + + Meta+C,Meta+D + Meta+C, Meta+D + + + Filelog "%1" + Journal du fichier « %1 » + + + Annotate Current File + Annoter le fichier actuel + + + Annotate "%1" + Annoter « %1 » + + + Meta+C,Meta+A + Meta+C, Meta+A + + + Meta+C,Meta+C + Meta+C, Meta+C + + + Delete... + Supprimer… + + + Delete "%1"... + Supprimer « %1 »… + + + Revert... + Rétablir… + + + Revert "%1"... + Rétablir « %1 »… + + + Edit + Modifier + + + Edit "%1" + Modifier « %1 » + + + Unedit + Annuler la modification + + + Unedit "%1" + Annuler la modification de « %1 » + + + Unedit Repository + Annuler la modification du dépôt + + + Diff Project "%1" + Réaliser un diff du projet « %1 » + + + Project Status + État du projet + + + Status of Project "%1" + État du projet « %1 » + + + Log Project + Réaliser un log du projet + + + Log Project "%1" + Réaliser un log du projet « %1 » + + + Update Project + Mettre à jour le projet + + + Update Project "%1" + Mettre à jour le projet « %1 » + + + Commit Project + Faire un commit du projet + + + Commit Project "%1" + Faire un commit du projet « %1 » + + + Update Directory + + + + Update Directory "%1" + + + + Commit Directory + + + + Commit Directory "%1" + + + + Diff Repository + Réaliser un diff du dépôt + + + Repository Status + État du dépôt + + + Repository Log + Réaliser un log du dépôt + + + Update Repository + Mettre à jour le dépôt + + + Revert Repository... + Rétablir le dépôt… + + + Revert Repository + + + + Would you like to discard your changes to the repository "%1"? + + + + Would you like to discard your changes to the file "%1"? + + + + Parsing of the log output failed. + + + + Could not find commits of id "%1" on %2. + + + + No CVS executable specified. + + + + Revert all pending changes to the repository? + Rétablir toutes les changements en attente sur le dépôt ? + + + Revert failed: %1 + Échec de la restauration : %1 + + + The file has been changed. Do you want to revert it? + Le fichier a été modifié. Voulez-vous le rétablir ? + + + Another commit is currently being executed. + Un autre commit est en cours d’exécution. + + + There are no modified files. + Il n’y a aucun fichier modifié. + + + Project status + État du projet + + + Repository status + État du dépôt + + + Cannot find repository for "%1". + + + + The initial revision %1 cannot be described. + La révision initiale %1 n’a pas pu être décrite. + + + Added + Ajouté + + + Removed + Supprimé + + + Modified + Modifié + + + CVS Command + CVS Command + + + Annotate revision "%1" + Révision annotée « %1 » + + + Ignore Whitespace + Ignorer les espaces + + + Ignore Blank Lines + Ignorer les lignes vides + + + &Edit + &Édition - ChangeSelectionDialog + QtC::ClangCodeModel - Repository Location: - Adresse du depôt : + Generating Compilation DB + Génération de la base de données de compilation - Select - Sélectionner + Clang Code Model + Modèle de code Clang - Change: - Modification : + Generate Compilation Database + Générer la base de données de compilation - Repository location: - Emplacement du dépôt : + Generate Compilation Database for "%1" + Générer la base de données de compilation pour « %1 » + + + Clang compilation database generated at "%1". + Base de données de compilation de Clang générée à « %1 ». + + + Generating Clang compilation database failed: %1 + La génération de la base de données de compilation de Clang a échoué : %1 + + + clangd + clangd + + + Indexing %1 with clangd + Indexation de %1 avec clangd + + + Indexing session with clangd + Indexation de la session avec clangd + + + Memory Usage + Utilisation de la mémoire + + + Location: %1 + Parent folder for proposed #include completion + Emplacement : %1 + + + C++ Usages: + Utilisations de C++ : + + + Re&name %n files + + Re&nommer %n fichier + Re&nommer %n fichiers + + + + Files: +%1 + Fichiers : +%1 + + + collecting overrides ... + réception des surcharges… + + + <base declaration> + <déclaration de base> + + + [Source: %1] + [Source : %1] + + + Component + Composant + + + Total Memory + Mémoire totale + + + Update + Mettre à jour + + + The use of clangd for the C/C++ code model was disabled, because it is likely that its memory requirements would be higher than what your system can handle. + L’utilisation de clangd pour le modèle de code C/C++ a été désactivée, car il est probable que ses besoins en mémoire soient supérieurs à ce que votre système peut prendre en charge. + + + With clangd enabled, Qt Creator fully supports modern C++ when highlighting code, completing symbols and so on.<br>This comes at a higher cost in terms of CPU load and memory usage compared to the built-in code model, which therefore might be the better choice on older machines and/or with legacy code.<br>You can enable/disable and fine-tune clangd <a href="dummy">here</a>. + Avec clangd activé, Qt Creator prend entièrement en charge le C++ moderne lorsqu’il surligne le code, complète les symboles et ainsi de suite.<br>Cela a un coût plus élevé en termes de charge CPU et d’utilisation de la mémoire par rapport au modèle de code intégré, qui peut donc être le meilleur choix sur les machines plus anciennes et/ou avec du code hérité.<br>Vous pouvez activer/désactiver et affiner clangd <a href="dummy">ici</a>. + + + Enable Anyway + Activer quand même + + + Cannot use clangd: Failed to generate compilation database: +%1 + Impossible d’utiliser clangd : échec de la génération de la base de données de compilation : +%1 + + + Project: %1 (based on %2) + Projet : %1 (fondé sur %2) + + + Changes applied in Projects Mode > Clang Code Model + Changements appliqués dans le mode Projets > Modèle de code Clang + + + Code Model Error + Erreur du modèle de code + + + Code Model Warning + Avertissement du modèle de code + + + Copy to Clipboard + Clang Code Model Marks + Copier dans le presse-papiers + + + Disable Diagnostic in Current Project + Désactiver les diagnostics dans le projet en cours + + + Could not retrieve build directory. + Impossible d’accéder au répertoire de compilation. + + + Could not create "%1": %2 + Impossible de créer « %1 » : %2 + + + Clazy Issue + Problème de Clazy + + + Clang-Tidy Issue + Problème de Clang-Tidy + + + + QtC::ClangFormat + + Clang-Format Style + Style de Clang-Format + + + Formatting mode: + Mode de formatage : + + + Format while typing + Formater lors de la frappe + + + Format edited code on file save + Formatage du code modifié lors de l’enregistrement du fichier + + + Override Clang Format configuration file + Écraser le fichier de configuration de Clang Format + + + Use global settings + Utiliser les paramètres généraux + + + ClangFormat settings: + Paramètres de ClangFormat : + + + Indenting only + Indentation uniquement + + + Full formatting + Formatage complet + + + Disable + Désactiver + + + The current project has its own .clang-format file which can be overridden by the settings below. + Le projet actuel possède son propre fichier .clang-format qui peut être écrasé par les paramètres ci-dessous. + + + Override Clang Format configuration file with the chosen configuration. + Écraser le fichier de configuration de Clang Format par la configuration choisie. + + + ClangFormat + ClangFormat + + + Open Used .clang-format Configuration File + Ouvrir le fichier de configuration .clang-format utilisé + + + + QtC::ClangTools + + Files outside of the base directory + Fichiers en dehors du répertoire de base + + + Files to Analyze + Fichiers à analyser + + + Analyze + Analyser + + + Analyze Project with %1... + Analyser le projet avec %1… + + + Analyze Current File with %1 + Analyser le fichier actuel avec %1 + + + Go to previous diagnostic. + Revenir au diagnostic précédant. + + + Go to next diagnostic. + Passer au diagnostic suivant. + + + Load diagnostics from YAML files exported with "-export-fixes". + Charger les diagnostics des fichiers YAML exportés avec « -export-fixes ». + + + Clear + Effacer + + + Expand All + Tout développer + + + Collapse All + Tout réduire + + + Filter Diagnostics + Filtrer les diagnostics + + + Apply Fixits + Appliquer les fixits + + + Clang-Tidy and Clazy use a customized Clang executable from the Clang project to search for diagnostics. + Clang-Tidy et Clazy utilisent un exécutable Clang personnalisé issu du projet Clang pour rechercher des diagnostics. + + + Clang-Tidy and Clazy + Clang-Tidy et Clazy + + + Release + Release + + + Run %1 in %2 Mode? + Lancer %1 en mode %2 ? + + + You are trying to run the tool "%1" on an application in %2 mode. The tool is designed to be used in Debug mode since enabled assertions can reduce the number of false positives. + Vous essayez d’exécuter l’outil « %1 » sur une application en mode %2. L’outil est conçu pour être utilisé en mode Debug car les assertions activées peuvent réduire le nombre de faux positifs. + + + Do you want to continue and run the tool in %1 mode? + Voulez-vous continuer et exécuter l’outil en mode %1 ? + + + %1 tool stopped by user. + L’outil %1 a été arrêté par l’utilisateur. + + + Cannot analyze current file: No files open. + Impossible d’analyser le fichier actuel : aucun fichier ouvert. + + + Cannot analyze current file: "%1" is not a known source file. + Impossible d’analyser le fichier actuel : « %1 » n’est pas un fichier source connu. + + + Select YAML Files with Diagnostics + Sélectionner des fichiers YAML avec des diagnostics + + + YAML Files (*.yml *.yaml);;All Files (*) + Fichiers YAML (*.yml *.yaml);;Tous les fichiers (*) + + + Error Loading Diagnostics + Erreur de chargement des diagnostics + + + Set a valid Clang-Tidy executable. + Définir un exécutable Clang-Tidy valide. + + + Set a valid Clazy-Standalone executable. + Définir un exécutable Clazy autonome valide. + + + Project "%1" is not a C/C++ project. + Le projet « %1 » n’est pas un projet C/C++. + + + Open a C/C++ project to start analyzing. + Ouvrir un projet C/C++ pour commencer l’analyse. + + + Failed to build the project. + Échec de la compilation du projet. + + + Failed to start the analyzer. + Échec du lancement de l’analyseur. + + + All Files + Tous les fichiers + + + Opened Files + Fichiers ouverts + + + Edited Files + Fichiers modifiés + + + Failed to analyze %n file(s). + + Échec de l’analyse de %n fichier. + Échec de l’analyse de %n fichiers. + + + + Analyzing... + Analyse… + + + Analyzing... %1 of %n file(s) processed. + + Analyse… %1 de %n fichier traité. + Analyse… %1 de %n fichiers traités. + + + + Analysis stopped by user. + L’analyse a été arrêtée par l’utilisateur. + + + Finished processing %n file(s). + + Traitement du fichier terminé. + Traitement de %n fichiers terminé. + + + + Diagnostics imported. + Diagnostics importés. + + + %1 diagnostics. %2 fixits, %3 selected. + %1 diagnostics. %2 fixits, %3 sélectionné. + + + No diagnostics. + Aucun diagnostic. + + + Clang-Tidy + Clang-Tidy + + + Clazy + Clazy + + + No code model data available for project. + Aucune donnée de modèle de code n’est disponible pour le projet. + + + The project configuration changed since the start of the %1. Please re-run with current configuration. + La configuration du projet a changé depuis le début de %1. Veuillez réexécuter avec la configuration actuelle. + + + Failed to create temporary directory: %1. + Échec de la création du répertoire temporaire : %1. + + + Running %1 on %2 with configuration "%3". + Exécution de %1 sur %2 avec la configuration « %3 ». + + + Analyzing "%1" [%2]. + Analyse « %1 » [%2]. + + + Analyzing + Analyse + + + Failed to analyze "%1": %2 + Échec de l’analyse de « %1 » : %2 + + + Error: Failed to analyze %n files. + + Erreur : échec de l’analyse de %n fichier. + Erreur : échec de l’analyse de %n fichiers. + + + + Note: You might need to build the project to generate or update source files. To build automatically, enable "Build the project before analysis". + Remarque : il se peut que vous deviez compiler le projet pour générer ou mettre à jour les fichiers sources. Pour construire automatiquement le projet, activez l’option « Compiler le projet avant l’analyse ». + + + %1 finished: Processed %2 files successfully, %3 failed. + %1 terminé : traitement réussi de %2 fichier(s), échec de %3. + + + Command line: %1 +Process Error: %2 +Output: +%3 + Ligne de commande : %1 +Erreur du processus : %2 +Sortie : +%3 + + + An error occurred with the %1 process. + Une erreur est survenue avec le processus %1. + + + %1 finished with exit code: %2. + %1 s’est terminé en retournant %2. + + + %1 crashed. + %1 a planté. + + + Message: + Message : + + + Location: + Emplacement : + + + Filter... + Filtrer… + + + Clear Filter + Effacer le filtre + + + Filter for This Diagnostic Kind + Filtre pour ce type de diagnostic + + + Filter out This Diagnostic Kind + Filtrer ce type de diagnostic + + + Web Page + Page web + + + Suppress Selected Diagnostics + Supprimer les diagnostics sélectionnés + + + Suppress This Diagnostic + Supprimer ce diagnostic + + + Disable These Checks + Désactiver ces vérifications + + + Disable This Check + Désactiver cette vérification + + + File "%1" does not exist or is not readable. + Le fichier « %1 » n’existe pas ou n’est pas lisible. + + + Error: Failed to parse YAML file "%1": %2. + Erreur : échec de l’analyse du fichier YAML « %1 » : %2. + + + Clang Tools + Outils Clang + + + Analyze File... + Analyser le fichier… + + + Restore Global Settings + Restaurer les paramètres généraux + + + Go to Clang-Tidy + Aller à Clang-Tidy + + + Go to Clazy + Aller à Clazy + + + Remove Selected + Supprimer la sélection + + + Remove All + Tout supprimer + + + Suppressed diagnostics + Diagnostics supprimés + + + File + Fichier + + + Diagnostic + Diagnostic + + + No Fixits + Aucun fixit + + + Not Scheduled + Non programmé + + + Invalidated + Invalidé + + + Scheduled + Programmé + + + Failed to Apply + Échec de l’application + + + Applied + Appliqué + + + Category: + Catégorie : + + + Type: + Type : + + + Description: + Description : + + + Fixit status: + État de Fixit : + + + Steps: + Étapes : + + + Documentation: + Documentation : + + + In general, the project should be built before starting the analysis to ensure that the code to analyze is valid.<br/><br/>Building the project might also run code generators that update the source files as necessary. + En général, le projet doit être compilé avant de commencer l’analyse pour s’assurer que le code à analyser est valide.<br/><rb/>La compilation du projet peut également exécuter des générateurs de code qui mettent à jour les fichiers source si nécessaire. + + + Info About Build the Project Before Analysis + Informations sur la compilation du projet avant l’analyse + + + Default Clang-Tidy and Clazy checks + Vérifications par défaut de Clang-Tidy et Clazy + + + Select Checks + Sélectionner les vérifications + + + Use .clang-tidy config file + Utiliser le fichier de configuration .clang-tidy + + + Edit Checks as String... + Modifier la vérification en tant que chaîne de caractères… + + + Could not query the supported checks from the clang-tidy executable. +Set a valid executable first. + Impossible d’interroger les vérifications prises en charge à partir de l’exécutable clang-tidy. +Définissez d’abord un exécutable valide. + + + See <a href="https://github.com/KDE/clazy">Clazy's homepage</a> for more information. + Voir <a href="https://github.com/KDE/clazy">la page d’accueil de Clazy</a> pour plus d’informations. + + + Filters + Filtres + + + Reset Topic Filter + Réinitialiser le filtre thématique + + + Checks + Vérifie + + + Enable lower levels automatically + Activation automatique des niveaux inférieurs + + + When enabling a level explicitly, also enable lower levels (Clazy semantic). + Lorsqu’un niveau est explicitement activé, les niveaux inférieurs le sont également (sémantique Clazy). + + + Could not query the supported checks from the clazy-standalone executable. +Set a valid executable first. + Impossible d’interroger les vérifications prises en charge à partir de l’exécutable clang-tidy autonome. +Définissez d’abord un exécutable valide. + + + Options for %1 + Options pour %1 + + + Option + Option + + + Value + Valeur + + + Add Option + Ajouter une option + + + Remove Option + Supprimer l’option + + + <new option> + <nouvelle option> + + + Options + Options + + + Manual Level: Very few false positives + Niveau manuel : très peu de faux positifs + + + Level 0: No false positives + Niveau 0 : pas de faux positifs + + + Level 1: Very few false positives + Niveau 1 : très peu de faux positifs + + + Level 2: More false positives + Niveau 2 : davantage de faux positifs + + + Level 3: Experimental checks + Niveau 3 : vérifications expérimentales + + + Level %1 + Niveau %1 + + + Clang-Tidy Checks + Vérification Clang-Tidy + + + Clazy Checks + Vérification Clazy + + + View Checks as String... + Voir les vérifications en tant que chaîne de caractères… + + + Checks (%n enabled, some are filtered out) + + Vérifie (%n activé, certains sont filtrés) + Vérifie (%n activés, certains sont filtrés) + + + + Checks (%n enabled) + + Vérifie (%n activé) + Vérifie (%n activés) + + + + Custom Configuration + Configuration personnalisée + + + Copy to Clipboard + Copier dans le presse-papiers + + + Disable Diagnostic + Désactiver le diagnostic + + + Check + Vérifier + + + Select All + Tout sélectionner + + + Select All with Fixits + Tout sélectionner avec les fixits + + + Clear Selection + Effacer la sélection + + + Select the diagnostics to display. + Sélectionner les diagnostics à afficher. + + + Build the project before analysis + Compiler le projet avant l’analyse + + + Analyze open files + Analyser les fichiers ouverts + + + Run Options + Options d’exécution + + + Parallel jobs: + Jobs en parallèle : + + + Clang-Tidy Executable + Exécutable de Clang Tidy + + + Clazy Executable + Exécutable de Clazy + + + Executables + Exécutables + + + Clang-Tidy: + Clang Tidy : + + + Clazy-Standalone: + Clazy autonome : + + + + QtC::ClassView + + Show Subprojects + Afficher les sous-projets + + + Class View + Ou est-ce un rapport avec la Vue ? (graphics/view) + Affichage de la classe + + + + QtC::ClearCase + + Check Out + Importer + + + &Checkout comment: + Commentaire d’&importation : + + + &Reserved + &Réservé + + + &Unreserved if already reserved + &Non réservé si déjà réservé + + + &Preserve file modification time + &Préserver la date de modification du fichier + + + Use &Hijacked file + ça sent le dikkenek un peu tout ça: http://www.lembrouille.com/dikkenek/dikkenek-je-viens-de-me-faire-carjacker + Utiliser fichier &Hijacké + + + Configuration + Configuration + + + &Command: + &Commande : + + + Diff + Diff + + + &External + &Externe + + + VOBs list, separated by comma. Indexer will only traverse the specified VOBs. If left blank, all active VOBs will be indexed. + + + + Check this if you have a trigger that renames the activity automatically. You will not be prompted for activity name. + + + + Do &not prompt for comment during checkout or check-in + + + + Check out or check in files with no comment (-nc/omment). + + + + Arg&uments: + Arg&uments : + + + Miscellaneous + Divers + + + &History count: + Pluriel ? + Compteur d’&historique : + + + &Timeout: + Pluriel ? + &Délai d’attente : + + + In order to use External diff, "diff" command needs to be accessible. + + + + DiffUtils is available for free download at http://gnuwin32.sourceforge.net/packages/diffutils.htm. Extract it to a directory in your PATH. + + + + s + s + + + &Automatically check out files on edit + Importer &automatiquement les fichiers à l’édition + + + Aut&o assign activity names + Assigner aut&omatiquement les noms d’activité + + + &Prompt on check-in + Afficher lors d’une ex&portation + + + &Graphical (single file only) + + + + Di&sable indexer + Dé&sactiver l’indexeur + + + &Index only VOBs: + &Indexer seulement les VOBs : + + + ClearCase + ClearCase + + + Dialog + Boite de dialogue + + + The file was changed. + Le fichier a été modifié. + + + &Save copy of the file with a '.keep' extension + &Enregistrer une copie du fichier avec une extension « .keep » + + + Confirm Version to Check Out + Confirmer la version à importer + + + Multiple versions of "%1" can be checked out. Select the version to check out: + + + + &Loaded version + + + + Note: You will not be able to check in this file without merging the changes (not supported by the plugin) + + + + Created by: + Crée par : + + + Created on: + Crée le : + + + Version after &update + Version après &mise à jour + + + Select &activity: + Sélectionner une &activité : + + + Add + Ajouter + + + Keep item activity + Conserver l’élément de l’activité + + + Check &Out + &Importer + + + &Hijack + &Hijack + + + Annotate version "%1" + Annoter la version « %1 » + + + Editing Derived Object: %1 + + + + Triggers a ClearCase version control operation. + + + + C&learCase + C&learCase + + + Check Out... + Exporter… + + + Check &Out "%1"... + Exp&orter « %1 »… + + + Meta+L,Meta+O + Meta+L, Meta+O + + + Alt+L,Alt+O + Alt+L, Alt+O + + + Check &In... + &Importer… + + + Check &In "%1"... + &Importer « %1 »… + + + Meta+L,Meta+I + Meta+L, Meta+I + + + Alt+L,Alt+I + Alt+L, Alt+I + + + Undo Check Out + Défaire l’exportation + + + &Undo Check Out "%1" + &Défaire l’exportation « %1 » + + + Meta+L,Meta+U + Meta+L, Meta+U + + + Alt+L,Alt+U + Alt+L, Alt+U + + + Undo Hijack + Annuler Hijack + + + Undo Hi&jack "%1" + Annuler Hi&jack « %1 » + + + Meta+L,Meta+R + Meta+L, Meta+R + + + Alt+L,Alt+R + Alt+L, Alt+R + + + Diff Current File + Diff du fichier actuel + + + &Diff "%1" + Faire un &diff de « %1 » + + + Meta+L,Meta+D + Meta+L, Meta+D + + + Alt+L,Alt+D + Alt+L, Alt+D + + + History Current File + Historique du fichier actuel + + + &History "%1" + &Historique de « %1 » + + + Meta+L,Meta+H + Meta+L, Meta+H + + + Alt+L,Alt+H + Alt+L, Alt+H + + + Annotate Current File + Annoter le fichier actuel + + + &Annotate "%1" + &Annoter « %1 » + + + Meta+L,Meta+A + Meta+L, Meta+A + + + Alt+L,Alt+A + Alt+L, Alt+A + + + Add File... + Ajouter un fichier… + + + Add File "%1" + Ajouter le fichier « %1 » + + + Diff A&ctivity... + Différence d’a&ctivité… + + + Ch&eck In Activity + &Importer l’activité + + + Chec&k In Activity "%1"... + Import&er l’activité « %1 »… + + + Update Index + Mettre à jour l’index + + + Update View + Mettre à jour la vue + + + U&pdate View "%1" + Mettre à jour la vue « %1 » (&P) + + + Check In All &Files... + Importer tous les &fichiers… + + + Meta+L,Meta+F + Meta+L, Meta+F + + + Alt+L,Alt+F + Alt+L, Alt+F + + + View &Status + Voir l’é&tat + + + Meta+L,Meta+S + Meta+L, Meta+S + + + Alt+L,Alt+S + Alt+L, Alt+S + + + Check In + Importer + + + Do you want to undo the check out of "%1"? + + + + Do you want to undo hijack of "%1"? + + + + Updating ClearCase Index + + + + Undo Hijack File + ils ont vraiment des concepts bizarres dans Clearcase, mais en general je trouve ce jargon specifique à un outil particulier assez intraduisible... +Oui :) + Annuler hijack du fichier + + + External diff is required to compare multiple files. + Un diff externe est nécessaire pour comparer plusieurs fichiers. + + + Enter Activity + Saisir l’activité + + + Activity Name + Nom de l’activité + + + Check In Activity + Importer l’activité + + + Another check in is currently being executed. + Une autre vérification est actuellement en cours. + + + There are no modified files. + Aucun fichier n’a été modifié. + + + No ClearCase executable specified. + Aucun exécutable ClearCase spécifié. + + + ClearCase Checkout + Export ClearCase + + + File is already checked out. + Le fichier est déjà exporté. + + + Set current activity failed: %1 + La définition de l’activité actuelle a échoué : %1 + + + Enter &comment: + Saisir un &commentaire : + + + ClearCase Add File %1 + ClearCase Ajouter le fichier %1 + + + ClearCase Remove Element %1 + ClearCase Enlever l’élément %1 + + + This operation is irreversible. Are you sure? + Cette opération est irréversible. Voulez-vous continuer ? + + + ClearCase Remove File %1 + ClearCase Enlever le fichier %1 + + + ClearCase Rename File %1 -> %2 + ClearCase Renommer le fichier de %1 vers %2 + + + Activity Headline + En-tête de l’activité + + + Enter activity headline + Saisir l’en-tête de l’activité + + + ClearCase Check In + Import ClearCase + + + Chec&k in even if identical to previous version + Importer même si identique à la version précédente (&K) + + + &Check In + Importer (&C) + + + ClearCase Command + Commande ClearCase + + + + QtC::Coco + + Select a Squish Coco CoverageBrowser Executable + + + + CoverageBrowser: + + + + Coco instrumentation files (*.csmes) + + + + Select a Squish Coco Instrumentation File + + + + CSMes: + QtC::CodePaster - - &CodePaster - &CodePaster - &Code Pasting &Collage de code Paste Snippet... - snippet is quite common in French for programming - Coller le snippet... + snippet est traduit par « extrait de code » partout ailleurs + Coller l’extrait de code… Alt+C,Alt+P @@ -557,13 +15460,9 @@ Meta+C,Meta+P Meta+C, Meta+P - - Paste Clipboard... - Coller le contenu du presse-papier… - Fetch Snippet... - Récuperer le snippet... + Accéder à l’extrait de code… Alt+C,Alt+F @@ -575,35 +15474,19 @@ Fetch from URL... - Récupérer depuis l'URL... + Réception depuis l’URL… Fetch from URL - Récupérer depuis l'URL + Réception depuis l’URL Enter URL: - Entrer l'URL : + Saisir l’URL : Empty snippet received for "%1". - Fragment vide reçu pour "%1". - - - This protocol supports no listing - Ce protocole ne prend en charge le listage - - - CodePaster Error - Erreur dans CodePaster - - - Could not fetch code - Impossible de récuperer le code - - - Some error occured while posting - Une erreur s'est produite lors de la publication + L’extrait de code reçu pour « %1 » est vide. Refresh @@ -621,99 +15504,163 @@ General Général - - - QtC::TextEditor - Code Completion - Complétion du code + Code Pasting + Collage de code - Do a case-sensitive match for completion items. - Tenir compte de la casse lors de la complétion. + Cannot open %1: %2 + Impossible d’ouvrir %1 : %2 - &Case-sensitive completion - Sensible à la &casse + %1 does not appear to be a paster file. + %1 ne semble pas être un fichier copiable. - Automatically insert (, ) and ; when appropriate. - Insérer automatiquement (, ) et; si approprié. + Error in %1 at %2: %3 + Erreur dans %1 à la ligne %2 : %3 - &Automatically insert brackets - Insertion &automatique des parenthèses + Please configure a path. + Veuillez configurer un chemin. - Insert the common prefix of available completion items. - Insérer le préfixe commun des élements disponibles. + Fileshare + Fileshare - Autocomplete common &prefix - Autocomplétion du &préfixe commun + <Comment> + <Commentaire> - &Case-sensitivity: - Sensibilité à la &casse : + Days + jours - Full - Totale + Paste + Coller - First Letter - Première lettre + %1 - Configuration Error + %1 - Erreur de configuration - Insert &space after function name - Insérer un e&space après le nom de fonction + Checking connection + Vérification de la connexion - Activate completion: - Activer la complétion : + Connecting to %1... + Connexion à %1… - Manually - Manuellement + The fileshare-based paster protocol allows for sharing code snippets using simple files on a shared network drive. Files are never deleted. + Le protocole de collage fondé sur le partage de fichiers permet de partager des extraits de code en utilisant de simples fichiers sur un disque réseau partagé. Ces fichiers ne sont jamais effacés. - When Triggered - À la demande + &Path: + Che&min : - Automatically insert brackets and semicolons when appropriate. - Insérer automatiquement les accolades et les points-virgule où cela est approprié. + &Display: + &Afficher : - Automatically insert semicolons and closing brackets, parentheses, curly braces, and quotes when appropriate. - Insérer automatiquement les deux points et crochets fermants, parenthèses, accolades et guillemets quand cela est approprié. + entries + entrées - &Automatically insert matching characters - Insérer &automatiquement les caractères correspondants + Protocol: + Protocole : - When typing a matching character and there is a text selection, instead of removing the selection, surround it with the corresponding characters. - Lors de la frappe d'un caractère correspondant, s'il y a une sélection de texte, au lieu de la supprimer, l'entourer des caractères correspondants. + Paste: + Collage : - Surround &text selections - Entourer les sélections de &texte + Send to Codepaster + Envoyer sur Codepaster + + + &Username: + &Utilisateur : + + + <Username> + <Utilisateur> + + + &Description: + &Description : + + + <Description> + <Description> + + + Parts to Send to Server + Parties à envoyer au serveur + + + &Expires after: + &Expire après : + + + Copy-paste URL to clipboard + Copier l’URL dans le presse-papier + + + Username: + Nom d’utilisateur : + + + Default protocol: + Protocole par défaut : + + + Display General Messages after sending a post + Afficher les messages généraux après l’envoi d’un message + + + %1: %2 + %1 : %2 - QtC::Help + QtC::CompilationDatabaseProjectManager - Open Link - Ouvrir le lien + Change Root Directory + Modifier le répertoire racine - Open Link as New Page - Ouvrir le lien en tant que nouvelle page + Scan "%1" project tree + Scanner l’arbre du projet « %1 » - Open Link in New Tab - Ouvrir le lien dans un nouvel onglet + Parse "%1" project + Analyser le projet « %1 » + + + + QtC::Conan + + Conan install + + + + Conan file: + + + + Enter location of conanfile.txt or conanfile.py. + + + + Additional arguments: + Arguments supplémentaires : + + + Run conan install + @@ -727,8 +15674,8 @@ Fichiers existants - Failed to open an editor for '%1'. - Échec de l'ouverture d'un éditeur pour "%1'. + Failed to open an editor for "%1". + Échec de l’ouverture d’un éditeur pour « %1 ». [read only] @@ -742,39 +15689,15 @@ [symbolic link] [lien symbolique] - - [read only] - [lecture seule] - - - [folder] - [dossier] - - - [directory] - [répertoire] - - - [symbolic link] - [lien symbolique] - The project directory %1 contains files which cannot be overwritten: %2. Le répertoire du projet %1 contient des fichiers qui ne peuvent être écrasés : %2. - - - The following files already exist in the directory %1: -%2. -Would you like to overwrite them? - Les fichiers suivants existent déjà dans le répertoire %1 : -%2. -Voulez vous les écraser ? Revert to Saved - Revenir à la version sauvegardée + Revenir à la version enregistrée Close @@ -782,27 +15705,19 @@ Voulez vous les écraser ? Close All - Fermer Tout + Tout fermer Close Others Fermer les autres éditeurs - - Next Document in History - Document Suivant dans l'Historique - - - Previous Document in History - Document Précédent dans l'Historique - Next Open Document in History - Document ouvert suivant dans l'historique + Document ouvert suivant dans l’historique Previous Open Document in History - Document ouvert précédent dans l'historique + Document ouvert précédent dans l’historique Go Back @@ -812,13 +15727,9 @@ Voulez vous les écraser ? Go Forward Suivant - - Open in External Editor - Ouvrir dans l'éditeur externe - Revert File to Saved - Restaurer le fichier sauvegardé + Restaurer le fichier enregistré Ctrl+W @@ -830,7 +15741,7 @@ Voulez vous les écraser ? Ctrl+Shift+W - Ctrl+Shift+W + Ctrl+Maj+W Alt+Tab @@ -842,43 +15753,67 @@ Voulez vous les écraser ? Alt+Shift+Tab - Alt+Shift+Tab + Alt+Maj+Tab Ctrl+Shift+Tab - Ctrl+Shift+Tab + Ctrl+Maj+Tab Ctrl+Alt+Left - Ctrl+Alt+Left + Ctrl+Alt+Gauche Alt+Left - Alt+Left + Alt+Gauche Ctrl+Alt+Right - Ctrl+Alt+Right + Ctrl+Alt+Droite Alt+Right - Alt+Right - - - Meta+E - Meta+E + Alt+Droite Close All Except Visible - Fermer tout sauf l'éditeur visible + Tout fermer sauf l’éditeur visible &Save &Enregistrer + + Go to Last Edit + Aller à la dernière modification + + + Copy Full Path + Copier le chemin complet + + + Copy Path and Line Number + Copier le chemin et le numéro de ligne + + + Copy File Name + Copier le nom du fichier + Save &As... - Enregistrer &sous... + Enregistrer &sous… + + + Properties... + Propriétés… + + + Pin + Épingler + + + Alternative Close + Fermeture alternative Split @@ -918,7 +15853,7 @@ Voulez vous les écraser ? Remove Current Split - Fermer la Vue Courante + Fermer la vue actuelle Meta+E,0 @@ -940,6 +15875,18 @@ Voulez vous les écraser ? Ctrl+E,1 Ctrl+E,1 + + Go to Previous Split or Window + Retourner à la séparation ou à la fenêtre précédente + + + Meta+E,i + Meta+E,i + + + Ctrl+E,i + Ctrl+E,i + Go to Next Split or Window Aller à la vue ou la fenêtre suivante @@ -958,35 +15905,75 @@ Voulez vous les écraser ? Current document - Document courant + Document actuel - Full path of the current document including file name. - Chemin complet du document courant, dont le nom de fichier. + Unpin "%1" + Désépingler « %1 » - Full path of the current document excluding file name. - Chemin complet du document courant hors nom de fichier. + Pin "%1" + Épingler « %1 » + + + Pin Editor + Épingler l’éditeur + + + Open With + Ouvrir avec X-coordinate of the current editor's upper left corner, relative to screen. - Abscisse du coin supérieur gauche de l'éditeur courant, relative à l'écran. + Abscisse du coin supérieur gauche de l’éditeur actuel, relative à l’écran. Y-coordinate of the current editor's upper left corner, relative to screen. - Ordonnée du coin supérieur gauche de l'éditeur courant, relative à l'écran. + Ordonnée du coin supérieur gauche de l’éditeur actuel, relative à l’écran. + + + Continue Opening Huge Text File? + Continuer à ouvrir l’énorme fichier texte ? + + + The text file "%1" has the size %2MB and might take more memory to open and process than available. + +Continue? + Le fichier texte « %1 » a une taille de %2 Mo et son ouverture et son traitement pourraient nécessiter plus de mémoire que celle disponible. + +Poursuivre ? + + + Could not open "%1": Cannot open files of type "%2". + Impossible d’ouvrir « %1 » : impossible d’ouvrir les fichiers de type « %2 ». + + + Could not open "%1" for reading. Either the file does not exist or you do not have the permissions to open it. + Impossible d’ouvrir « %1 » en lecture. Soit le fichier n’existe pas, soit vous n’avez pas les autorisations nécessaires pour l’ouvrir. + + + Could not open "%1": Unknown error. + Impossible d’ouvrir « %1 » : erreur inconnue. + + + Reload %1 + Recharger %1 + + + Cancel && &Diff + Annuler et &diff Close "%1" - Fermer "%1" + Fermer « %1 » Close Editor - Fermer l'éditeur + Fermer l’éditeur Close All Except "%1" - Fermer tout sauf "%1" + Tout fermer sauf « %1 » Close Other Editors @@ -998,91 +15985,27 @@ Voulez vous les écraser ? Cannot Open File - Impossible d'ouvrir un fichier - - - Cannot open the file for editing with SCC. - Impossible d'ouvrir le fichier pour édition avec SCC. + Impossible d’ouvrir un fichier Cannot open the file for editing with VCS. - Impossible d'ouvrir le fichier pour édition avec VCS. + Impossible d’ouvrir le fichier pour édition avec VCS. Make Writable Rendre inscriptible - - The file <i>%1</i> is read only. - Le fichier <i>%1</i> est en lecture seule. - Save %1 &As... - Enregistrer %1 &sous... - - - Goto Other Split - Changer de vue - - - %1,2 - %1,2 - - - %1,3 - %1,3 - - - %1,0 - %1,0 - - - %1,1 - %1,1 - - - Go to Next Split - Aller à la vue suivante - - - %1,o - %1,o - - - &Advanced - A&vancé - - - Alt+V,Alt+I - nav.net + Enregistrer %1 &sous… Opening File Ouverture du Fichier - - Cannot open file %1! - Impossible d'ouvrir le fichier %1! - - - Failed! - Échec ! - - - Could not open the file for editing with SCC. - Impossible d'ouvrir le fichier pour édition avec SCC. - - - Could not set permissions to writable. - Impossible d'attribuer les droits en écriture. - - - Qt Creator - Qt Creator - <b>Warning:</b> This file was not opened in %1 yet. - <b>Attention :</b> le fichier n'est pas encore ouvert dans %1. + <b>Attention :</b> le fichier n’est pas encore ouvert dans %1. Open @@ -1090,11 +16013,7 @@ Voulez vous les écraser ? <b>Warning:</b> You are changing a read-only file. - <b>Attention:</b> Vous apportez des modifications à un fichier en lecture seule. - - - Save %1 As... - Enregistrer %1 sous... + <b>Attention :</b> Vous apportez des modifications à un fichier en lecture seule. &Save %1 @@ -1102,7 +16021,7 @@ Voulez vous les écraser ? Revert %1 to Saved - Restaurer %1 à la version sauvegardée + Restaurer %1 à la version enregistrée Close %1 @@ -1110,7 +16029,7 @@ Voulez vous les écraser ? Close All Except %1 - Fermer tout sauf %1 + Tout fermer sauf %1 You will lose your current changes if you proceed reverting %1. @@ -1128,29 +16047,58 @@ Voulez vous les écraser ? Terminal: Terminal : - - External editor: - Éditeur externe : - ? ? - General - Général + Reset Warnings + Button text + Réinitialiser les avertissements + + + Re-enable warnings that were suppressed by selecting "Do Not Show Again" (for example, missing highlighter). + Réactiver les avertissements qui ont été supprimés en sélectionnant « Ne plus afficher » (par exemple, surligneur manquant). + + + Theme: + Thème : + + + Enable high DPI scaling + Activer la mise à l’échelle DPI élevée + + + The high DPI settings will take effect after restart. + Les paramètres DPI élevés prendront effet après le redémarrage. + + + Text codec for tools: + Codec de texte pour les outils : + + + Show keyboard shortcuts in context menus (default: %1) + Afficher les raccourcis clavier dans les menus contextuels (par défaut : %1) + + + on + oui + + + off + non <System Language> <Langue du système> - Restart required - Redémarrage nécessaire + The language change will take effect after restart. + Le changement de langue prend effet après le redémarrage. - The language change will take effect after a restart of Qt Creator. - Le changement de langue prendra effet au prochain démarrage de Qt Creator. + Interface + Interface Variables @@ -1160,18 +16108,6 @@ Voulez vous les écraser ? When files are externally modified: Quand des fichiers ont été modifiés en dehors de Qt Creator : - - Always ask - Demander quoi faire - - - Reload all modified files - Recharger tous les fichiers modifiés - - - Ignore modifications - Ignorer les modifications - User Interface Interface utilisateur @@ -1180,10 +16116,6 @@ Voulez vous les écraser ? Color: Couleur : - - Default file encoding: - Encodage de fichier par défaut : - Language: Langue : @@ -1196,6 +16128,62 @@ Voulez vous les écraser ? External file browser: Navigateur de fichiers externe : + + Bytes + Octets + + + KB + ko + + + MB + Mo + + + GB + Go + + + TB + To + + + Auto-suspend unmodified files + Suspendre automatiquement les fichiers non modifiés + + + Enable crash reporting + Activer les rapports de plantage + + + Warn before opening text files greater than + Avertir avant d’ouvrir des fichiers texte plus grands que + + + Ask for confirmation before exiting + Demander une confirmation avant de quitter + + + Clear Local Crash Reports + Effacer les rapports locaux de plantage + + + Auto-save files after refactoring + Enregistrer automatiquement les fichiers après refactorisation + + + Automatically free resources of old documents that are not visible and not modified. They stay visible in the list of open documents. + Libérer automatiquement les ressources des anciens documents qui ne sont ni visibles ni modifiés. Ils restent visibles dans la liste des documents ouverts. + + + Allow crashes to be automatically reported. Collected reports are used for the sole purpose of fixing bugs. + Autoriser le signalement automatique des plantages. Les rapports collectés sont utilisés dans le seul but de corriger les bogues. + + + Command line arguments used for "Run in terminal". + Arguments de ligne de commande utilisés pour « Exécuter dans le terminal ». + Always Ask Demander quoi faire @@ -1208,6 +16196,48 @@ Voulez vous les écraser ? Ignore Modifications Ignorer les modifications + + Maximum number of entries in "Recent Files": + Nombre maximal d’entrées dans « Fichiers récents » : + + + Command used for reverting diff chunks. + Commande utilisée pour revenir sur des fragments de diff (diff chunk). + + + Automatically creates temporary copies of modified files. If %1 is restarted after a crash or power failure, it asks whether to recover the auto-saved content. + Crée automatiquement des copies temporaires des fichiers modifiés. Si %1 est redémarré après un plantage ou une panne de courant, il demande s’il faut accéder au contenu enregistré automatiquement. + + + Automatically saves all open files affected by a refactoring operation, +provided they were unmodified before the refactoring. + Enregistre automatiquement tous les fichiers ouverts affectés par une opération de refactorisation, +à condition qu’ils n’aient pas été modifiés avant la refactorisation. + + + Crash Reporting + Rapport de plantage + + + The change will take effect after restart. + La modification prendra effet après le redémarrage. + + + Case Sensitive (Default) + Sensible à la casse (par défaut) + + + Case Insensitive (Default) + Insensible à la casse (par défaut) + + + Case Insensitive + Insensible à la casse + + + The file system case sensitivity change will take effect after restart. + La modification de la sensibilité à la casse du système de fichiers prendra effet après le redémarrage. + Reset Réinitialiser @@ -1215,44 +16245,49 @@ Voulez vous les écraser ? Reset to default. Color - Restaurer les paramètres par défaut. + Restaurer les paramètres par défaut. Reset to default. Terminal - Restaurer les paramètres par défaut. - - - Reset to default. - File Browser - Restaurer les paramètres par défaut. - - - Automatically create temporary copies of modified files. If Qt Creator is restarted after a crash or power failure, it asks whether to recover the auto-saved content. - Créer automatiquement des copies temporaires des fichiers modifiés. Si Qt Creator est relancé après un crash ou un défaut d'alimentation, il va demander s'il faut récupérer le contenu ainsi sauvé. + Restaurer les paramètres par défaut. Auto-save modified files - Sauvegarder automatiquement les fichiers modifiés + Enregistrer automatiquement les fichiers modifiés + + + Command line arguments used for "%1". + Arguments de la ligne de commande utilisés pour « %1 ». + + + File system case sensitivity: + Sensibilité à la casse du système de fichiers : + + + Influences how file names are matched to decide if they are the same. + Influence la façon dont les noms de fichiers sont comparés pour déterminer s’ils sont identiques. + + + Files to keep open: + Fichiers à conserver ouverts : + + + Minimum number of open documents that should be kept in memory. Increasing this number will lead to greater resource usage when not manually closing documents. + Nombre minimum de documents ouverts qui doivent être conservés en mémoire. L’augmentation de ce nombre entraînera une plus grande utilisation des ressources lorsque les documents ne sont pas fermés manuellement. + + + Patch command: + Commande de patch : Interval: - Intervale : + Intervalle : min - unit for minutes min - - Re-enable all warnings which were suppressed using "Don't show again" button (e.g. missing highlighter). - Réactiver tous les avertissements qui ont été supprimées avec le bouton "Ne plus afficher" (par exemple si la coloration syntaxique est manquante). - - - Reset warnings - Button text - Réinitialiser les avertissements - &File &Fichier @@ -1263,43 +16298,19 @@ Voulez vous les écraser ? &Tools - O&utils + &Outils &Window - Fe&nêtre + Fenê&tre &Help - &Aide - - - &New... - &Nouveau... - - - &Open... - &Ouvrir... - - - &Open With... - Ou&vrir avec... - - - &New File or Project... - &Nouveau fichier ou projet... + A&ide &Open File or Project... - &Ouvrir un fichier ou projet... - - - &Open File With... - Ouvrir le fichier &avec... - - - Recent Files - Fichiers récents + &Ouvrir un fichier ou projet… Exit Full Screen @@ -1311,7 +16322,7 @@ Voulez vous les écraser ? Open File &With... - Ouvrir le fichier &avec... + Ouvrir le fichier &avec… Recent &Files @@ -1323,19 +16334,48 @@ Voulez vous les écraser ? Ctrl+Shift+S - Ctrl+Shift+S + Ctrl+Maj+S Save As... - Enregistrer sous... + Enregistrer sous… Save A&ll &Tout enregistrer + + Exit %1? + Quitter %1 ? + + + &View + &Affichage + + + Return to Editor + Retourner à l’éditeur + + + &New Project... + &Nouveau projet… + + + New Project + Title of dialog + Nouveau projet + + + New File... + Nouveau fichier… + + + Open From Device... + Ouvrir à partir d’un appareil… + &Print... - Im&primer... + Im&primer… E&xit @@ -1379,28 +16419,88 @@ Voulez vous les écraser ? &Go to Line... - &Aller à la ligne... + &Aller à la ligne… - &Select All - Tout &sélectionner + Zoom In + Zoomer - &Go To Line... - &Aller à la ligne... + Ctrl++ + Ctrl++ + + + Zoom Out + Dézoomer + + + Ctrl+- + Ctrl+- + + + Ctrl+Shift+- + Ctrl+Maj+- + + + Original Size + Taille réelle + + + About &%1 + À propos de &%1 + + + About &%1... + À propos de &%1… + + + Change Log... + Journal des modifications… + + + Contact... + Contact… + + + Cycle Mode Selector Styles + + + + Mode Selector Style + Style de sélecteur de mode + + + Icons and Text + Icônes et texte + + + Icons Only + Icônes uniquement + + + Hidden + Caché + + + Version: + Version : + + + Change Log + Journal des modifications + + + Contact + Contact + + + <p>Qt Creator developers can be reached at the Qt Creator mailing list:</p>%1<p>or the #qt-creator channel on Libera.Chat IRC:</p>%2<p>Our bug tracker is located at %3.</p><p>Please use %4 for bigger chunks of text.</p> + <p>Les développeurs de Qt Creator peuvent être contactés sur la liste de diffusion de Qt Creator :</p>%1<p>ou sur le canal IRC #qt-creator sur Libera.Chat :</p>%2<p>Notre suivi des bogues est accessible à %3.</p><p>Veuillez utiliser %4 pour les plus gros morceaux de texte.</p> Ctrl+L Ctrl+L - - &Options... - &Options... - - - Ctrl+, - Ctrl+, - Minimize Minimiser @@ -1413,21 +16513,37 @@ Voulez vous les écraser ? Zoom Zoom - - Show Sidebar - Afficher la barre latérale - Ctrl+0 Ctrl+0 - Alt+0 - Alt+0 + Meta+0 + Meta+0 - Show Mode Selector - Afficher le sélecteur de mode + Debug %1 + Déboguer %1 + + + Show Logs... + Afficher les journaux… + + + Pr&eferences... + &Préférences… + + + Close Window + Fermer la fenêtre + + + Ctrl+Meta+W + Ctrl+Meta+W + + + Alt+0 + Alt+0 Full Screen @@ -1445,55 +16561,21 @@ Voulez vous les écraser ? &Views &Vues - - About &Qt Creator - À propos de &Qt Creator - - - About &Qt Creator... - À propos de &Qt Creator... - About &Plugins... - À propos des &plug-ins... - - - New - Title of dialog - Nouveau - - - Open Project - Ouvrir le projet - - - New... - Title of dialog - Nouveau... - - - Settings... - Paramètres... + À propos des &greffons… General Messages Messages généraux - - New Project - Nouveau projet - - - 1 - 1 - Choose a template: - Choisir un modèle : + Sélectionner un modèle : - &Choose... - &Choisir… + Choose... + Sélectionner… Projects @@ -1517,105 +16599,205 @@ Voulez vous les écraser ? Supported Platforms - Plateformes supportées + Plateformes prises en charge * * - - Open file '%1' with: - Ouvrir le fichier %1 avec : - Open File With... - Ouvrir le fichier avec... + Ouvrir le fichier avec… - Open file extension with: - Ouvrir ce type d'extension avec : + Open file "%1" with: + Ouvrir le fichier « %1 » avec : Output Sortie + + Category + Catégorie + + + Color + Couleur + + + Logging Category Viewer + Afficheur de catégories de journaux + + + Save Log + Enregistrer le journal + Clear Effacer + + Stop Logging + Arrêter la journalisation + + + Toggle Qt Internal Logging + Activer/désactiver la journalisation interne de Qt + + + Auto Scroll + Défilement auto + + + Timestamps + Horodatages + + + Message Types + Types de message + + + Timestamp + Horodatage + + + Message + Message + + + Start Logging + Démarrer la journalisation + + + Copy Selected Logs + Copier les journaux sélectionnés + + + Copy All + Tout copier + + + Save Enabled as Preset... + Enregistrer tout ce qui est activé comme préconfiguration… + + + Update from Preset... + Mettre à jour à partir des préconfigurations… + + + Uncheck All + Tout décocher + + + Save Logs As + Enregistrer les journaux sous + + + Failed to write logs to "%1". + Échec de l’écriture des journaux dans « %1 ». + + + Failed to open file "%1" for writing logs. + Échec de l’ouverture du fichier « %1 » pour l’écriture des journaux. + + + Save Enabled Categories As + Enregistrer les catégories activées sous + + + Failed to write preset file "%1". + Échec de l’écriture du fichier de préconfiguration « %1 ». + + + Load Enabled Categories From + Charger les catégories activées depuis + + + Failed to open preset file "%1" for reading + Échec de l’ouverture en lecture du fichier de préconfiguration « %1 » + + + Failed to read preset file "%1": %2 + Échec de la lecture du fichier de préconfiguration « %1 » : %2 + + + Unexpected preset file format. + Format du fichier de préconfiguration inattendu. + + + Show Non-matching Lines + Afficher les lignes non concordantes + + + Filter output... + Filtrer la sortie… + + + Maximize + Maximiser + Next Item - Élement suivant + Élément suivant Previous Item - Élement précédent + Élément précédent - Maximize Output Pane - Maximiser le panneau de sortie + Out&put + &Sortie - Output &Panes - &Panneaux de sortie + Ctrl+Shift+9 + Ctrl+Maj+9 + + + Alt+Shift+9 + Alt+Maj+9 Shift+F6 - Shift+F6 + Maj+F6 F6 F6 - - Ctrl+9 - Ctrl+9 - - - Alt+9 - Alt+9 - - - Minimize Output Pane - Minimiser le panneau de sortie - Details Détails Error Details - Détails de l'erreur + Détails de l’erreur - Restart required. - Redémarrage nécessaire. + Install Plugin... + Installer un greffon… Installed Plugins - Plug-ins installés + Greffons installés + + + Plugin changes will take effect after restart. + Les modifications apportées au greffon prendront effet après le redémarrage. Plugin Details of %1 - Détail sur le plug-in %1 ? - Détails du plug-in %1 + Détail sur le greffon %1 ? + Détails du greffon %1 Plugin Errors of %1 - Erreurs du plug-in %1 + Erreurs du greffon %1 Processes Processus - - Don't Save - Ne pas enregistrer - - - Do not Save - Ne pas enregistrer - Save All Tout enregistrer @@ -1626,7 +16808,7 @@ Voulez vous les écraser ? Save Changes - Sauvegarder les changements + Enregistrer les changements The following files have unsaved changes: @@ -1634,7 +16816,35 @@ Voulez vous les écraser ? Automatically save all files before building - Sauvegarder automatiquement tous les fichiers avant de compiler + Enregistrer automatiquement tous les fichiers avant de compiler + + + &Diff + &Diff + + + Do &Not Save + &Ne pas enregistrer + + + &Diff && Cancel + &Diff et annuler + + + &Save All + Tout enregi&strer + + + &Diff All && Cancel + &Diff tout et annuler + + + &Save Selected + Enregi&strer la sélection + + + &Diff Selected && Cancel + &Diff la sélection et annuler Keyboard @@ -1644,17 +16854,49 @@ Voulez vous les écraser ? Keyboard Shortcuts Raccourcis clavier + + Click and type the new key sequence. + Cliquer et saisir la nouvelle séquence de touches. + + + Stop Recording + Arrêter l’enregistrement + + + Record + Enregistrer + + + Invalid key sequence. + Séquence de touches invalide. + + + Key sequence will not work in editor. + La séquence de touches ne fonctionnera pas dans l’éditeur. + Key sequence: Combinaison de touches : - Shortcut - Raccourci + Use "Cmd", "Opt", "Ctrl", and "Shift" for modifier keys. Use "Escape", "Backspace", "Delete", "Insert", "Home", and so on, for special keys. Combine individual keys with "+", and combine multiple shortcuts to a shortcut sequence with ",". For example, if the user must hold the Ctrl and Shift modifier keys while pressing Escape, and then release and press A, enter "Ctrl+Shift+Escape,A". + Utilisez « Cmd », « Opt », « Ctrl » et « Maj » pour les touches de modification. Utilisez « Échap », « Retour arrière », « Suppression », « Insertion », « Accueil », etc. pour les touches spéciales. Combinez des touches individuelles avec « + » et combinez plusieurs raccourcis en une séquence de raccourcis avec « , ». Par exemple, si l’utilisateur doit maintenir les touches de modification Ctrl et Maj tout en appuyant sur Échap, puis relâcher et appuyer sur A, saisissez « Ctrl+Maj+Échap,A ». - Type to set shortcut - Appuyer pour définir le raccourci + Use "Ctrl", "Alt", "Meta", and "Shift" for modifier keys. Use "Escape", "Backspace", "Delete", "Insert", "Home", and so on, for special keys. Combine individual keys with "+", and combine multiple shortcuts to a shortcut sequence with ",". For example, if the user must hold the Ctrl and Shift modifier keys while pressing Escape, and then release and press A, enter "Ctrl+Shift+Escape,A". + Utilisez « Ctrl », « Alt », « Meta » et « Maj » pour les touches de modification. Utilisez « Échap », « Retour arrière », « Suppression », « Insertion », « Accueil », etc. pour les touches spéciales. Combinez des touches individuelles avec « + » et combinez plusieurs raccourcis en une séquence de raccourcis avec « , ». Par exemple, si l’utilisateur doit maintenir les touches de modification Ctrl et Maj tout en appuyant sur Échap, puis relâcher et appuyer sur A, saisissez « Ctrl+Maj+Échap,A ». + + + Enter key sequence as text + Saisir la séquence de touches sous forme de texte + + + Key sequence has potential conflicts. <a href="#conflicts">Show.</a> + La séquence de touches présente des conflits potentiels. <a href="#conflicts">Afficher.</a> + + + Shortcut + Raccourci Import Keyboard Mapping Scheme @@ -1668,821 +16910,2112 @@ Voulez vous les écraser ? Export Keyboard Mapping Scheme Exporter le mapping clavier - - About Qt Creator - À propos de Qt Creator - - - <h3>%1</h3>%2<br/><br/>Built on %3 at %4<br /><br/>%5<br/>Copyright 2008-%6 %7. All rights reserved.<br/><br/>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<br/> - %1 version string, %2build compatibility string, %3 date, %4 heure, %5 ide revision, %6 year, %7 author - <h3>%1</h3>%2<br/><br/>Compilé le %3 à %4<br /><br/>%5<br/>Copyright 2008-%6 %7. Tous droits réservés.<br/><br/>Le programme est fourni TEL QUEL sans GARANTIE D'AUCUNE SORTE, Y COMPRIS DE GARANTIE DE LA CONCEPTION, DE QUALITÉ MARCHANDE ET D'ADÉQUATION À UN USAGE PARTICULIER.<br/> - - - (%1) - (%1) - - - From revision %1<br/> - This gets conditionally inserted as argument %8 into the description string. - Depuis la révision %1<br/> - - - <h3>Qt Creator %1 %8</h3>Based on Qt %2 (%3 bit)<br/><br/>Built on %4 at %5<br /><br/>%9<br/>Copyright 2008-%6 %7. All rights reserved.<br/><br/>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<br/> - <h3>Qt Creator %1 %8</h3>Basé sur Qt %2 (%3 bit)<br/><br/>Compilé le %4 à %5<br /><br/>%9<br/>Copyright 2008-%6 %7. Tous droits réservés.<br/><br/>Ce programme est fourni « EN L'ÉTAT », SANS GARANTIE D'AUCUNE SORTE, INCLUANT, SANS S'Y LIMITER, LES GARANTIES D'ABSENCE DE DÉFAUT, DE QUALITÉ MARCHANDE, D'ADÉQUATION À UN USAGE PARTICULIER.<br/> - - - <h3>Qt Creator %1</h3>Based on Qt %2 (%3 bit)<br/><br/>Built on %4 at %5<br /><br/>%8<br/>Copyright 2008-%6 %7. All rights reserved.<br/><br/>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<br/> - %4 == __DATE__ et %5 ==__TIME__. Pour les formulations légales, dans le doute, mieux vaut laisser l'anglais... (legal m'a l'air correct, enfin chuis pas avocat !) - <h3>Qt Creator %1</h3>Basé sur Qt %2 (%3 bit)<br/><br/>Compilé le %4 à %5<br /><br/>%8<br/>Copyright 2008-%6 %7. Tous droits réservés.<br/><br/>Ce programme est fourni « EN L'ÉTAT », SANS GARANTIE D'AUCUNE SORTE, INCLUANT, SANS S'Y LIMITER, LES GARANTIES D'ABSENCE DE DÉFAUT, DE QUALITÉ MARCHANDE, D'ADÉQUATION À UN USAGE PARTICULIER.<br/> - - - - QtC::Welcome - - Open Recent Project - Ouvrir un projet récent - - - Resume Session - Reprendre la session - - - Tutorials - Tutoriels - - - Explore Qt Examples - Explorer les exemples Qt - - - Did You Know? - Le saviez-vous ? - - - Qt Websites - Sites web Qt - - - Qt Home - Qt Home - - - Qt Git Hosting - Dépôts Git Qt - - - Qt for S60 at Forum Nokia - Qt pour S60 - - - <b>Qt Creator - A quick tour</b> - <b>Qt Creator - Aperçu rapide</b> - - - Creating an address book - Créer un carnet d'adresses - - - Understanding widgets - Comprendre les widgets - - - Building with qmake - Compiler grâce à qmake - - - Writing test cases - Écrire des tests - - - Welcome - il s'agit du mode, donc d'un écran d'accueil - Accueil - - - %1 (last session) - %1 (dernière session) - - - Choose an example... - Choisir un exemple... - - - New Project... - Nouveau projet... - - - You can switch between Qt Creator's modes using <tt>Ctrl+number</tt>:<ul><li>1 - Welcome</li><li>2 - Edit</li><li>3 - Debug</li><li>4 - Projects</li><li>5 - Help</li><li></li><li>6 - Output</li></ul> - Vous pouvez basculer entre les modes de Qt Creator en utilisant <tt>Ctrl+number</tt>:<ul><li>1 - Accueil</li><li>2 - Éditeur</li><li>3 - Débogueur</li><li>4 - Projets</li><li>5 - Aide</li><li></li><li>6 - Output</li></ul> - - - You can show and hide the side bar using <tt>%1+0<tt>. - %1 gets replaced by Alt (Win/Unix) or Cmd (Mac) - Vous pouvez afficher et masquer la barre latérale en utilisant <tt>%1+0<tt>. - - - You can fine tune the <tt>Find</tt> function by selecting &quot;Whole Words&quot; or &quot;Case Sensitive&quot;. Simply click on the icons on the right end of the line edit. - Vous pouvez affiner les résultats de la fonction recherche en sélectionnant &quot;Mots complets&quot; ou &quot;Sensible à la casse&quot;. Cliquez simplement sur les icônes sur le bord droit du champ de recherche. - - - If you add <a href="qthelp://com.nokia.qtcreator/doc/creator-external-library-handling.html">external libraries</a>, Qt Creator will automatically offer syntax highlighting and code completion. - Si vous ajoutez <a href="qthelp://com.nokia.qtcreator/doc/creator-external-library-handling.html">des bibliothèques externes</a>, Qt Creator proposera automatiquement la coloration syntaxique et l'auto-complétion du code. - - - The code completion is CamelCase-aware. For example, to complete <tt>namespaceUri</tt> you can just type <tt>nU</tt> and hit <tt>Ctrl+Space</tt>. - L'auto-complétion du code.est compatible avec CamelCase. Par exemple, pour compléter <tt>namespaceUri</tt> vous pouvez taper simplement <tt>nU</tt> puis <tt>Ctrl+Espace</tt>. - - - Getting Started - Commencer - - - Develop - Developper - - - Community - Communauté - - - Examples not installed - Exemples non trouvés - - - Open - Ouvrir - - - Manage Sessions... - Gestion des sessions... - - - Create New Project... - Créer un nouveau projet... - - - Help us make Qt Creator even better - Aidez-nous à améliorer Qt Creator - - - Feedback - Votre avis nous interesse - - - - QtC::Core - - Switch to %1 mode - Basculer vers le mode %1 - Switch to <b>%1</b> mode Basculer vers le mode <b>%1</b> - Exception at line %1: %2 -%3 - Exception à la ligne %1 : %2 -%3 + Search for... + Rechercher… - Unknown error - Erreur inconnue + &Search + &Rechercher - New %1 - Nouveau %1 + &Case sensitive + Sensible à la &casse - - - QtC::Utils - Dialog - Boîte de dialogue + Sco&pe: + &Contexte : - TextLabel - Label de texte + Empty search term. + Terme de recherche vide. - CheckBox - Case à cocher + Search f&or: + &Rechercher : - Do not ask again - Ne plus me demander + Whole words o&nly + &Mots complets uniquement - Do not &ask again - Ne plus &redemander + Use re&gular expressions + Utiliser des e&xpressions régulières - The class name must not contain namespace delimiters. - Le nom de classe ne doit pas contenir de délimiteur d'espace de nommage. + Search && &Replace + &Rechercher et remplacer - Please enter a class name. - Veuillez entrer un nom de classe. + Find/Replace + Rechercher/remplacer - The class name contains invalid characters. - Le nom de classe contient des caractères invalides. + Enter Find String + Saisir la chaîne à rechercher - Cannot set up communication channel: %1 - Impossible d'établir le canal de communication : %1 + Ctrl+E + Ctrl+E - Press <RETURN> to close this window... - Appuyez sur <ENTRÉE> pour fermer cette fenêtre... + Find Next + Suivant - Cannot create temporary file: %1 - Impossible de créer un fichier temporaire : %1 + Find Previous + Précédent - Cannot write temporary file. Disk full? - Impossible d'écrire le fichier temporaire. Disque plein ? + Shift+Enter + Maj+Entrée - Cannot create temporary directory '%1': %2 - Impossible de créer un dossier temporaire "%1" : %2 + Shift+Return + Maj+Entrée - Unexpected output from helper program (%1). - Sortie imprévue du logiciel externe (%1). + Find Next (Selected) + Trouvez le suivant (sélectionné) - Unexpected output from helper program. - Sortie imprévue du logiciel externe. + Ctrl+F3 + Ctrl+F3 - Cannot change to working directory '%1': %2 - Impossible de changer le répertoire de travail "%1" : %2 + Find Previous (Selected) + Trouver le précédent (sélectionné) - Cannot execute '%1': %2 - Impossible d'éxecuter "%1": %2 + Ctrl+Shift+F3 + Ctrl+Maj+F3 - Quoting error in command. - Erreur de guillemets dans la commande. + Replace + Remplacer - Debugging complex shell commands in a terminal is currently not supported. - Le débogage de commandes shell complexes dans un terminal n'est pas supporté actuellement. + Replace && Find + Remplacer et chercher - Quoting error in terminal command. - Citer l'erreur dans la commande au terminal. + Ctrl+= + Ctrl+= - Terminal command may not be a shell command. - La commande terminal peut ne pas être une commande shell. + Replace && Find Previous + Remplacer et trouver le précédent - Cannot start the terminal emulator '%1', change the setting in the Environment preferences. - Impossible de démarrer l'émulateur de terminal "%1", modifiez les paramètres dans les options d'environnement. + Replace All + Tout remplacer - Cannot start the terminal emulator '%1'. - Impossible de démarrer l'émulateur de terminal "%1". + Select All + Tout sélectionner - Cannot create socket '%1': %2 - Impossible de créer le socket "%1": %2 + Ctrl+Alt+Return + Ctrl+Alt+Entrée - The process '%1' could not be started: %2 - Le processus "%1" ne peut pas être démarré : %2 + Case Sensitive + Sensible à la casse - Cannot obtain a handle to the inferior: %1 - Impossible d'obtenir le descripteur du processus : %1 + Whole Words Only + Mots complets uniquement - Cannot obtain exit status from inferior: %1 - Impossible d'obtenir la valeur de retour du processus : %1 + Use Regular Expressions + Utiliser des expressions régulières - The name must not be empty - Le nom ne peut pas être vide + Preserve Case when Replacing + Conserver la casse lors du remplacement - The name must not contain any of the characters '%1'. - Le nom ne peut pas contenir un des caractères suivant : "%1". + Replace with... + Remplacer avec… - The name must not contain '%1'. - Le nom ne peut pas contenir "%1". + Find + Rechercher - The name must not match that of a MS Windows device. (%1). - Le nom ne peut pas correspondre à un périphérique MS Windows. (%1). + Find: + Rechercher : - Name is empty. - Le nom de fichier est vide. + Advanced... + Avancé… - Name contains white space. - Le nom contient des espaces. + New Search + Nouvelle recherche - Invalid character '%1'. - Caractère invalide "%1". + Expand All + Tout développer - Invalid characters '%1'. - Caractères invalides "%1". + Filter Results + Filtrer les résultats - Name matches MS Windows device. (%1). - Le nom correspond à un périphérique MS Windows. (%1). + %1 %2 + %1 %2 - File extension %1 is required: - L'extension de fichier %1 est nécessaire : + Collapse All + Tout réduire - File extensions %1 are required: - Les extensions de fichier %1 sont nécessaires : - - - %1: canceled. %n occurrences found in %2 files. - - %1 : annulé. %n entrée trouvée dans %2 fichiers. - %1 : annulé. %n entrées trouvées dans %2 fichiers. - - - - %1: %n occurrences found in %2 files. - - %1 : %n occurrence trouvée dans %2 fichiers. - %1 : %n occurrences trouvées dans %2 fichiers. - - - - %1: %n occurrences found in %2 of %3 files. - - %1 : %n occurence trouvé dans %2 de %3 fichiers. - %1 : %n occurences trouvés dans %2 de %3 fichiers. - - - - Class name: - Nom de la classe : - - - Base class: - Classe parent : - - - Header file: - Fichier d'en-tête : - - - Source file: - Fichier source : - - - Generate form: - Générer l'interface graphique : - - - Form file: - Fichier d'interface : - - - Invalid base class name - Nom de la classe parente invalide - - - Invalid header file name: '%1' - Nom du fichier d'en-tête invalide : "%1" - - - Invalid source file name: '%1' - Nom du fichier source invalide : "%1" - - - Invalid form file name: '%1' - Nom du fichier d'interface invalide : "%1" - - - Inherits QObject - hérite de QObject - - - Type information: - Information de type : - - - None - Aucune - - - Inherits QWidget - Hérite de QWidget - - - &Class name: - Nom de la &classe : - - - &Base class: - Classe &parent : - - - &Type information: - Information de &type : - - - Based on QSharedData - il s'agit de l'information - Basée sur QSharedData - - - &Header file: - Fichier d'&en-tête : - - - &Source file: - Fichier &source : + History: + Historique : - &Generate form: - &Générer l'interface graphique : + Search Results + Résultat de la recherche - &Form file: - &Fichier d'interface : + Locator + Localisateur - &Path: - Che&min : + File System + Système de fichiers - Inherits QDeclarativeItem - hérite de QDeclarativeItem + Filter Configuration + Configuration du filtre - Inherits QDeclarativeItem - Qt Quick 1 - Hérite de QDeclarativeItem - Qt Quick 1 + Type the prefix followed by a space and search term to restrict search to the filter. + Saisir le préfixe suivi d’une espace et le terme recherché pour restreindre la recherche au filtre. - Inherits QQuickItem - Qt Quick 2 - Hérite de QQuickItem - Qt Quick 2 + Include by default + Inclure par défaut - Choose... - Choisir... + Include the filter when not using a prefix for searches. + Inclure le filtre lorsqu’on n’utilise pas de préfixe pour les recherches. - Browse... - Parcourir... + Prefix: + Préfixe : - Choose a directory - Sélectionner un répertoire + Generic Directory Filter + Filtre de dossier générique - Choose a file - Sélectionner un fichier + Matches all files from a custom set of directories. Append "+<number>" or ":<number>" to jump to the given line number. Append another "+<number>" or ":<number>" to jump to the column number as well. + Fait correspondre tous les fichiers d’un ensemble personnalisé de répertoires. Ajoutez « +<numéro> » ou « :<numéro> » pour passer au numéro de ligne donné. Ajoutez un autre « +<nombre> » ou « :<nombre> » pour passer également au numéro de colonne. - Choose Directory + Select Directory Sélectionner un répertoire - Choose Executable - Selectionner l'exécutable + %1 filter update: 0 files + Mise à jour du filtre %1 : 0 fichiers + + + %1 filter update: %n files + + Mise à jour du filtre %1 : %n fichier + Mise à jour du filtre %1 : %n fichiers + - Choose File - Sélectionner un fichier - - - <not valid> - Selected path is not valid: - <invalide> - - - The path must not be empty. - Le chemin ne peut pas être vide. - - - The path '%1' expanded to an empty string. - Le chemin "%1" a été étendu en une chaîne vide. - - - The path '%1' does not exist. - Le chemin "%1' n"existe pas. - - - The directory '%1' does not exist. - Le répertoire '%1' n'existe pas. - - - Cannot execute '%1'. - Impossible d'exécuter "%1". - - - The path <b>%1</b> is not a directory. - <b>%1</b> n'est pas le chemin d'un répertoire. - - - The path <b>%1</b> is not a file. - <b>%1</b> n'est pas le chemin d'un fichier. - - - The path <b>%1</b> is not an executable file. - Le chemin <b>%1</b> n'est pas un fichier exécutable. - - - The path <b>%1</b> is not a executable file. - <b>%1</b> n'est pas le chemin d'un exécutable. - - - Full path: <b>%1</b> - Chemin complet : <b>%1</b> - - - The path '%1' is not a directory. - "%1' n'est pas le chemin d"un répertoire. - - - The path '%1' is not a file. - %1 n'est pas le chemin d'un fichier. - - - Path: - Chemin : - - - Insert... - Insérer... - - - Add... - Ajouter... - - - Delete Line - Supprimer la ligne - - - Delete line - Supprimer la ligne - - - Clear - Effacer tout - - - From "%1" - Depuis "%1" - - - Introduction and project location - Introduction et emplacement du projet + %1 filter update: canceled + Mise à jour du filtre %1 : annulée Name: Nom : - Create in: - Créer dans : + Path: + Chemin : - <Enter_Name> - <Entrer_Nom> + MIME type: + Type MIME : - The project already exists. - Le projet existe déjà. + Default editor: + Éditeur par défaut : - A file with that name already exists. - Un fichier existe déjà avec ce nom. + Line endings: + Fins de ligne : - Use as default project location - Utiliser comme emplacement par défaut pour les projets + Indentation: + Indentation : - Introduction and Project Location - Introduction et emplacement du projet + Owner: + Propriétaire : - Project: - Projet : + Group: + Groupe : - The name must not contain the '.'-character. - Le nom ne peut pas contenir le caractère '.'. + Size: + Taille : - Invalid character '.'. - Caractère invalide '.'. + Last read: + Dernière lecture : - Subversion Submit - Submit Subversion + Last modified: + Dernière modification : - Des&cription - Des&cription + Readable: + Lisible : - F&iles - F&ichiers + Writable: + Écriture possible : + + + Symbolic link: + Lien symbolique : + + + Unknown + Inconnue + + + Windows (CRLF) + Windows (CRLF) + + + Unix (LF) + Unix (LF) + + + Mac (CR) + Mac (CR) + + + %1 Spaces + %1 espaces + + + Tabs + Onglets + + + Specify a short word/abbreviation that can be used to restrict completions to files from this directory tree. +To do this, you type this shortcut and a space in the Locator entry field, and then the word to search for. + Spécifier un mot court ou une abréviation qui peut être utilisé pour restreindre les complétions aux fichiers de cette arborescence. Pour ce faire, saisir ce raccourci et une espace dans le champs localisation, puis ensuite le mot à chercher. + + + Remove + Supprimer + + + Directories: + Dossiers : + + + Add + Ajouter + + + Files in File System + Fichiers dans le système de fichiers + + + Opens a file given by a relative path to the current document, or absolute path. "~" refers to your home directory. You have the option to create a file if it does not exist yet. + Ouvre un fichier indiqué par un chemin relatif au document actuel ou un chemin absolu. « ~ » fait référence à votre répertoire personnel. Vous avez la possibilité de créer un fichier s’il n’existe pas encore. + + + Create and Open "%1" + Créer et ouvrir « %1 » + + + Create File + Créer un fichier + + + Create "%1"? + Créer « %1 » ? + + + Always create + Toujours créer + + + Create + Créer + + + Include hidden files + Inclure les fichiers cachés + + + Filter: + Filtre : + + + Open Documents + Documents ouverts + + + Available filters + Filtres disponibles + + + Web Search + Recherche sur le web + + + Qt Project Bugs + Bogues du projet Qt + + + Ctrl+K + Ctrl+K + + + <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Open a document</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; File > Open File or Project (%1)</div><div style="margin-top: 5px">&bull; File > Recent Files</div><div style="margin-top: 5px">&bull; Tools > Locate (%2) and</div><div style="margin-left: 1em">- type to open file from any open project</div>%4%5<div style="margin-left: 1em">- type <code>%3&lt;space&gt;&lt;filename&gt;</code> to open file from file system</div><div style="margin-left: 1em">- select one of the other filters for jumping to a location</div><div style="margin-top: 5px">&bull; Drag and drop files here</div></td></tr></table></div></body></html> + <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Ouvrir un document</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Fichier> Ouvrir un fichier ou un projet (%1)</div><div style="margin-top: 5px">&bull; Fichier > Fichiers récents</div><div style="margin-top: 5px">&bull; Outils > Localiser (%2) et</div><div style="margin-left: 1em">- taper pour ouvrir un fichier à partir de n’importe quel projet ouvert</div>%4%5<div style="margin-left: 1em">- saisir <code>%3&lt;espace&gt;&lt;nom du fichier&gt;</code> pour ouvrir le fichier à partir du système de fichiers</div><div style="margin-left: 1em">- sélectionner l’un des autres filtres pour accéder à un emplacement donné</div><div style="margin-top: 5px">&bull; Glisser-déposer des fichiers ici</div></td></tr></table></div></body></html> + + + <div style="margin-left: 1em">- type <code>%1&lt;space&gt;&lt;pattern&gt;</code> to jump to a class definition</div> + <div style="margin-left: 1em">- saisir <code>%1&lt;espace&gt;&lt;motif&gt;</code> pour passer à la définition d’une classe</div> + + + <div style="margin-left: 1em">- type <code>%1&lt;space&gt;&lt;pattern&gt;</code> to jump to a function definition</div> + <div style="margin-left: 1em">- saisir <code>%1&lt;espace&gt;&lt;motif&gt;</code> pour passer à la définition d’une fonction</div> + + + Updating Locator Caches + Mise à jour des caches des localisateurs + + + Open as Centered Popup + Ouvrir en tant que fenêtre contextuelle centrée + + + Type to locate + Taper pour localiser + + + Type to locate (%1) + Taper pour localiser (%1) + + + Refresh + Rafraîchir + + + Locate... + Localiser… + + + Options + Options + + + Edit + Modifier + + + min + min + + + Refresh interval: + Intervalle de rafraîchissement : + + + Locator filters that do not update their cached data immediately, such as the custom directory filters, update it after this time interval. + Les filtres de locator ne mettent pas à jour immédiatement leurs données mises en cache, tel que les filtres personnalisés de répertoire, celle-ci sont mise à jour après cet intervalle de temps. + + + Files in Directories + Fichiers dans les répertoires + + + URL Template + Modèle d’URL + + + Name + Nom + + + Prefix + Préfixe + + + Default + Défaut + + + Built-in + Intégré + + + Custom + Personnalisé + + + Plain Text Editor + Éditeur de texte + + + Show Left Sidebar + Afficher le panneau latéral de gauche + + + Hide Left Sidebar + Cacher le panneau latéral de gauche + + + Show Right Sidebar + Afficher le panneau latéral de droite + + + Hide Right Sidebar + Cacher le panneau latéral de droite + + + Binary Editor + Éditeur de binaire + + + C++ Editor + Éditeur C++ + + + .pro File Editor + Éditeur de fichier .pro + + + .files Editor + Éditeur de fichiers .files + + + QMLJS Editor + Éditeur QMLJS + + + Qt Designer + Qt Designer + + + Qt Linguist + Qt Linguist + + + Resource Editor + Éditeur de ressources + + + GLSL Editor + Éditeur GLSL + + + Python Editor + Éditeur Python + + + Preferences + Préférences + + + Command + Commande + + + Label + Libellé + + + Qt + Qt + + + Environment + Environnement + + + Clear Menu + Effacer le menu + + + Design + Design + + + Drag to drag documents between splits + Glisser pour faire glisser des documents d’une séparation à l’autre + + + Remove Split + Supprimer la séparation + + + File is writable + Le fichier est inscriptible + + + &Find/Replace + &Rechercher/remplacer + + + Advanced Find + Recherche avancée + + + Open Advanced Find... + Ouvrir la recherche avancée… + + + Ctrl+Shift+F + Ctrl+Maj+F + + + Open "%1" + Ouvrir « %1 » + + + Show Hidden Files + Afficher les fichiers cachés + + + Show Bread Crumbs + + + + Show Folders on Top + Afficher les dossiers en haut + + + Synchronize with Editor + Synchroniser avec l’éditeur + + + Synchronize Root Directory with Editor + Synchroniser le répertoire racine avec l’éditeur + + + New File + Title of dialog + Nouveau fichier + + + New Folder + Nouveau dossier + + + Remove Folder + Supprimer le dossier + + + Meta+Y,Meta+F + Meta+Y, Meta+F + + + Alt+Y,Alt+F + Alt+Y, Alt+F + + + Computer + Ordinateur + + + Home + Accueil + + + Add New... + Ajouter un nouveau… + + + Rename... + Renommer… + + + Remove... + Supprimer… + + + Close Document + Fermer le document + + + Description: + Description : + + + Executable: + Exécutable : + + + Arguments: + Arguments : + + + Working directory: + Répertoire de travail : + + + Output: + Sortie : + + + Ignore + Ignorer + + + Replace Selection + Remplacer la sélection + + + Error output: + Sortie d’erreur : + + + Text to pass to the executable via standard input. Leave empty if the executable should not receive any input. + Test à passer à l’exécutable par l’entrée standard. Laisser vide si l’exécutable ne devrait pas recevoir d’entrée. + + + Input: + Entrée : + + + If the tool modifies the current document, set this flag to ensure that the document is saved before running the tool and is reloaded after the tool finished. + Si l’outil modifie le document actuel, mettre ce drapeau pour s’assurer que le document est enregistré avant de lancer l’outil et qu’il est rechargé après qu’il a fini. + + + Modifies current document + le reste des verbes similaires est à l'infinitif dans l'application + Modifier le document actuel + + + System Environment + Environnement du système + + + Add tool. + Ajouter un outil. + + + Remove tool. + Supprimer un outil. + + + Revert tool to default. + Rétablir l’outil par défaut. + + + <html><head/><body> +<p>What to do with the executable's standard output. +<ul><li>Ignore: Do nothing with it.</li><li>Show in General Messages.</li><li>Replace selection: Replace the current selection in the current document with it.</li></ul></p></body></html> + + <html><head/><body> +<p>Que faire de la sortie standard de l’exécutable ? +<ul><li>Ignorer : ne rien faire.</li><li>Afficher dans les messages généraux.</li><li>Remplacer la sélection : remplacer la sélection actuelle dans le document actuel par celle-ci.</li></ul></p></body></html> + + + + Show in General Messages + Afficher dans les messages généraux + + + <html><head><body> +<p >What to do with the executable's standard error output.</p> +<ul><li>Ignore: Do nothing with it.</li> +<li>Show in General Messages.</li> +<li>Replace selection: Replace the current selection in the current document with it.</li> +</ul></body></html> + <html><head/><body> +<p>Que faire de la sortie standard de l’exécutable ?</p> +<ul><li>Ignorer : ne rien faire.</li> +<li>Afficher dans les messages généraux.</li> +<li>Remplacer la sélection : remplacer la sélection actuelle dans le document actuel par celle-ci.</li> +</ul></body></html> + + + No changes to apply. + Aucune modification à appliquer. + + + Change... + Modifier… + + + Base environment: + Environnement de base : + + + Environment: + Environnement : + + + Add Tool + Ajouter un outil + + + Add Category + Ajouter une catégorie + + + PATH=C:\dev\bin;${PATH} + PATH=C:\dev\bin;${PATH} + + + PATH=/opt/bin:${PATH} + PATH=/opt/bin:${PATH} + + + Uncategorized + Sans catégorie + + + Tools that will appear directly under the External Tools menu. + Outils qui apparaissent directement dans le menu Outils externes. + + + New Category + Nouvelle catégorie + + + New Tool + Nouvel outil + + + This tool prints a line of useful text + Cet outil affiche une ligne de texte utile + + + Useful text + Sample external tool text + Texte utile + + + Creates qm translation files that can be used by an application from the translator's ts files + Crée un fichier de traduction qm utilisable par l’application à partir des fichiers ts du traducteur + + + Release Translations (lrelease) + Publier les traductions (lrelease) + + + Linguist + Linguist + + + Synchronizes translator's ts files with the program code + Synchronise les fichiers ts de traduction avec le code source + + + Update Translations (lupdate) + Mettre à jour les traductions (lupdate) + + + Opens the current file in Notepad + Notepad, c'est pas très cross-platform + Ouvre le fichier actuel avec Notepad + + + Edit with Notepad + Notepad, c'est pas très cross-platform + Modifier avec Notepad + + + Runs the current QML file with QML utility. + Exécute le fichier QML actuel avec l’utilitaire QML. + + + QML utility + Utilitaire QML + + + Text + Texte + + + Runs the current QML file with qmlscene. This requires Qt 5. + Exécute le fichier QML actuel avec qmlscene. Cela nécessite Qt 5. + + + Qt Quick 2 Preview (qmlscene) + Aperçu de Qt Quick 2 (qmlscene) + + + Qt Quick + Qt Quick + + + Opens the current file in vi + Ouvre le fichier courant avec vi + + + Edit with vi + Modifier avec vi + + + Error while parsing external tool %1: %2 + Erreur lors de l’analyse de l’outil externe %1 : %2 + + + &External + &Externes + + + Error: External tool in %1 has duplicate id + Erreur : l’outil externe dans %1 a un identifiant dupliqué + + + Add Magic Header + Ajouter un en-tête magique + + + Error + Erreur + + + Value: + Valeur : + + + Type + Type + + + <html><head/><body><p>MIME magic data is interpreted as defined by the Shared MIME-info Database specification from <a href="http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html">freedesktop.org</a>.<hr/></p></body></html> + <html><head/><body><p>Les données magiques MIME sont interprétées conformément à la spécification de la base de données partagée d’informations MIME de <a href="http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html">freedesktop.org</a>.<hr/></p></body></html> + + + String + Chaîne de caractères + + + RegExp + RegExp + + + Host16 + Host16 + + + Host32 + Host32 + + + Big16 + Big16 + + + Big32 + Big32 + + + Little16 + Little16 + + + Little32 + Little32 + + + Byte + Octet + + + Use Recommended + Utiliser le paramètre recommandé + + + <html><head/><body><p><span style=" font-style:italic;">Note: Wide range values might impact performance when opening files.</span></p></body></html> + <html><head/><body><p><span style=" font-style:italic;">Remarque : des valeurs élevées peuvent avoir un impact sur les performances lors de l’ouverture de fichiers.</span></p></body></html> + + + Range start: + Début de l’intervalle : + + + Range end: + Fin de l’intervalle : + + + Type: + Type : + + + Mask: + Masque : + + + Internal error: Type is invalid + Erreur interne : le type est invalide + + + Priority: + Priorité : + + + MIME Type + Type MIME + + + Handler + Gestionnaire + + + Undefined + Indéfini + + + MIME Types + Types MIME + + + External Tools + Outils externes + + + %1 repository was detected but %1 is not configured. + Le dépôt %1 a été détecté mais %1 n’est pas configuré. + + + Version Control + Gestion de versions + + + Remove the following files from the version control system (%2)? %1Note: This might remove the local file. + Supprimer les fichiers suivants du système de gestion de versions (%2) ? %1Remarque : cela pourrait supprimer le fichier local. + + + Add to Version Control + Ajouter au gestionnaire de versions + + + Add the file +%1 +to version control (%2)? + Ajouter le fichier +%1 +au gestionnaire de versions (%2) ? + + + Add the files +%1 +to version control (%2)? + Ajouter les fichiers +%1 +au gestionnaire de versions (%2) ? + + + Adding to Version Control Failed + L’ajout au gestionnaire de versions a échoué + + + Could not add the file +%1 +to version control (%2) + + Impossible d’ajouter le fichier +%1 +au gestionnaire de versions (%2) + + + + Could not add the following files to version control (%1) +%2 + Impossible d’ajouter les fichiers +%1 +au gestionnaire de versions (%2) + + + Tags: + Étiquettes : + + + Overwrite Existing Files + Écraser les fichiers existants + + + The following files already exist in the folder +%1. +Would you like to overwrite them? + Les fichiers suivants existent déjà dans le dossier +%1. +Voulez-vous les écraser ? + + + Launching a file browser failed + Échec du lancement du navigateur de fichier + + + Unable to start the file manager: + +%1 + + + Impossible de démarrer le gestionnaire de fichiers : + +%1 + + + + + "%1" returned the following error: + +%2 + « %1 » a renvoyé l’erreur suivante : + +%2 + + + Launching Windows Explorer Failed + Échec du lancement de l’explorateur Windows + + + Could not find explorer.exe in path to launch Windows Explorer. + explorer.exe introuvable dans le chemin pour lancer Windows Explorer. + + + The command for file browser is not set. + La commande pour le navigateur de fichiers n’est pas définie. + + + Error while starting file browser. + Erreur lors du démarrage du navigateur de fichiers. + + + Find in This Directory... + Trouver dans ce répertoire… + + + Show in File System View + Afficher dans la vue du système de fichiers + + + Show in Explorer + Afficher dans l’explorateur + + + Show in Finder + Afficher dans la recherche + + + Show Containing Folder + Afficher le dossier parent + + + Open Command Prompt Here + Ouvre une invite de commande ici + + + Open Terminal Here + Ouvre un terminal ici + + + Open Command Prompt With + Opens a submenu for choosing an environment, such as "Run Environment" + Ouvrir l’invite de commande avec + + + Open Terminal With + Opens a submenu for choosing an environment, such as "Run Environment" + Ouvrir le terminal avec + + + Failed to remove file "%1". + Échec de la suppression du fichier « %1 ». + + + Failed to rename the include guard in file "%1". + Échec du renommage de la garde d’inclusion dans le fichier « %1 ». + + + Unable to create the directory %1. + Impossible de créer le répertoire %1. + + + Case sensitive + Sensible à la casse + + + Whole words + Mots entier + + + Regular expressions + Expressions régulière + + + Preserve case + Préserver la casse + + + Flags: %1 + Flags : %1 + + + None + Aucune + + + , + , + + + Search was canceled. + La recherche a été annulée. + + + Replace with: + Remplacer avec : + + + Repeat the search with same parameters. + Répéter la recherche avec les mêmes paramètres. + + + &Search Again + &Rechercher encore + + + Repla&ce with: + Rempla&cer avec : + + + Preser&ve case + Préser&ver la casse + + + Replace all occurrences. + Remplacer toutes les occurrences. + + + &Replace + &Remplacer + + + This change cannot be undone. + Ce changement ne peut être annulé. - Commit %1/%n Files - c'est tarabiscoté comme string en anglais... - - Faire un commit d'un fichier (%1/%n) - Faire un commit de plusieurs fichiers (%1/%n) + The search resulted in more than %n items, do you still want to continue? + + La recherche a trouvé plus de %n élément, souhaitez-vous continuer ? + La recherche a trouvé plus de %n éléments, souhaitez-vous continuer ? - Commit - Faire un commit + Continue + Continue + + + Searching... + Recherche… + + + No matches found. + Aucun résultat. - %1 %2/%n File(s) - - %1 %2/%n fichier - %1 %2/%n fichiers + %n matches found. + + %n résultat trouvé. + %n résultats trouvés. - &Commit - &Commit + Command Mappings + Mappages de commandes - Check All - Check all for submit - Cocher tout + Target + Cible - Uncheck All - Uncheck all for submit - Décocher tout + Reset All + Tout restaurer - Descriptio&n - Descriptio&n + Reset to default. + Restaurer les paramètres par défaut. - Check &all - Cocher tout (&A) + Import... + Importer… - Check a&ll - Coche&r tout + Export... + Exporter… - Choose the location - Choisir l'emplacement + Registered MIME Types + Types MIME enregistrés - Choose the Location - Choisir l'emplacement + Reset all to default. + Restaurer tous les paramètres aux valeurs par défaut. - File Changed - Fichier modifié + Reset all MIME type definitions to their defaults. + Restaurer toutes les définitions de type MIME aux valeurs par défaut. - The unsaved file <i>%1</i> has changed outside Qt Creator. Do you want to reload it and discard your changes? - Le fichier <i>%1</i> n'est pas enregistré et a été modifé en dehors de Qt Creator. Voulez-vous le recharger et ignorer vos changements ? + Reset MIME Types + Restaurer tous les types MIME - The unsaved file <i>%1</i> has been changed outside Qt Creator. Do you want to reload it and discard your changes? - Le fichier <i>%1</i> n'est pas enregistré et a été modifé en dehors de Qt Creator. Voulez-vous le recharger et ignorer vos changements ? + Reset the assigned handler for all MIME type definitions to the default. + Restaurer le gestionnaire assigné pour toutes les définitions de type MIME à la valeur par défaut. - The file <i>%1</i> has changed outside Qt Creator. Do you want to reload it? - Le fichier <i>%1</i> a été modifié en dehors de Qt Creator. Voulez-vous le charger à nouveau ? + Reset Handlers + Restaurer les gestionnaires - The unsaved file %1 has been changed outside Qt Creator. Do you want to reload it and discard your changes? - Le fichier %1 n'est pas enregistré et a été modifé en dehors de Qt Creator. Voulez-vous le recharger et ignorer vos changements ? + Patterns: + Motifs : - The file %1 has changed outside Qt Creator. Do you want to reload it? - Le fichier %1 a été modifié en dehors de Qt Creator. Voulez-vous le charger à nouveau ? + A semicolon-separated list of wildcarded file names. + Une liste de noms de fichiers joker séparés par des points-virgules. + + + Magic Header + En-tête magique + + + Range + Intervalle + + + Priority + Priorité + + + Changes will take effect after restart. + Les modifications prendront effet après le redémarrage. + + + Add... + Ajouter… + + + Edit... + Modifier… + + + Could not save the files. + error message + Impossible d’enregistrer les fichiers. + + + Error while saving file: %1 + Erreur lors de l’enregistrement du fichier : %1 + + + All Files (*.*) + On Windows + Tous les fichiers (*.*) + + + All Files (*) + On Linux/macOS + Tous les fichiers (*) + + + Overwrite? + Écraser ? + + + An item named "%1" already exists at this location. Do you want to overwrite it? + Un élément nommé « %1 » existe déjà à cet emplacement. Voulez-vous l’écraser ? + + + Save File As + Enregistrer sous + + + Open File + Ouvrir le fichier + + + Cannot reload %1 + Impossible de recharger %1 + + + File was restored from auto-saved copy. Select Save to confirm or Revert to Saved to discard changes. + Le fichier a été restauré depuis une copie d’enregistrement automatique. Sélectionnez Enregistrer pour confirmer ou Retour à l’enregistrement pour effacer les changements. + + + Runs an arbitrary command with arguments. The command is searched for in the PATH environment variable if needed. Note that the command is run directly, not in a shell. + Exécute une commande arbitraire avec des arguments. La commande est recherchée dans la variable d’environnement PATH si nécessaire. Notez que la commande est exécutée directement, et non dans un shell. + + + Previous command is still running ("%1"). +Do you want to kill it? + La commande précédente est toujours en cours d’exécution (« %1 »). +Voulez-vous l’arrêter ? + + + Kill Previous Process? + Tuer les processus précédents ? + + + Could not find executable for "%1". + Impossible de trouver un exécutable pour « %1 ». + + + Starting command "%1". + Lancement de la commande « %1 ». + + + Execute Custom Commands + Exécuter une commande personnalisée + + + Meta+O + Meta+O + + + Alt+O + Alt+O + + + Open with VCS (%1) + Ouvrir avec VCS (%1) + + + Files Without Write Permissions + Fichiers sans permissions d’écriture + + + The following files have no write permissions. Do you want to change the permissions? + Les fichiers suivants n’ont pas de permission d’écriture. Souhaitez-vous changer les permissions ? + + + Open with VCS + Ouvrir avec VCS + + + Save As + Enregistrer sous + + + See details for a complete list of files. + Voir les détails pour une liste complète des fichiers. + + + Filename + Nom de fichier + + + Path + Chemin + + + Change &Permission + Modifier les &permissions + + + Select all, if possible: + Tout sélectionner, si possible : + + + Mixed + Mixte + + + Failed to %1 File + Échec pour %1 le fichier + + + No Version Control System Found + Aucun système de gestion de versions trouvé + + + Cannot Set Permissions + Impossible de définir les permissions + + + Cannot Save File + Impossible d’enregistrer le fichier + + + %1 file %2 from version control system %3 failed. + %1 fichier %2 à partir du système de gestion de versions %3 a échoué. + + + Cannot open file %1 from version control system. +No version control system found. + Impossible d’ouvrir le fichier %1 à partir du système de gestion de versions. +Aucun système de gestion de versions trouvé. + + + Cannot set permissions for %1 to writable. + Impossible de définir les permissions pour rendre %1 inscriptible. + + + Cannot save file %1 + Impossible d’enregistrer le fichier %1 + + + Canceled Changing Permissions + Changement des permissions annulé + + + Could Not Change Permissions on Some Files + Impossible de changer la permissions sur certains fichiers + + + The following files are not checked out yet. +Do you want to check them out now? + Les fichiers suivants ne sont pas encore importés. +Souhaitez-vous les importer maintenant ? + + + Configure... + msgShowOptionsDialog + Configurer… + + + Open Preferences dialog. + msgShowOptionsDialogToolTip (mac version) + Ouvrir la fenêtre Préférences. + + + Open Options dialog. + msgShowOptionsDialogToolTip (non-mac version) + Ouvrir la fenêtre Options. + + + (%1) + (%1) + + + %1 %2%3 + %1 %2%3 + + + Based on Qt %1 (%2, %3) + Fondé sur Qt %1 (%2, %3) + + + Toggle Progress Details + Activer/désactiver les détails de la progression + + + Ctrl+Shift+0 + Ctrl+Maj+0 + + + Alt+Shift+0 + Alt+Maj+0 + + + Add the file to version control (%1) + Ajouter le fichier au gestionnaire de versions (%1) + + + Add the files to version control (%1) + Ajouter les fichiers au gestionnaire de versions (%1) + + + <no document> + <aucun document> + + + No document is selected. + Aucun document n’est sélectionné. + + + Java Editor + Éditeur Java + + + CMake Editor + Éditeur CMake + + + Compilation Database + Base de données de compilation + + + Global Actions & Actions from the Menu + Actions globales et actions à partir du menu + + + Triggers an action. If it is from the menu it matches any part of a menu hierarchy, separated by ">". For example "sess def" matches "File > Sessions > Default". + Déclenche une action. Si elle provient du menu, elle correspond à n’importe quelle partie d’une hiérarchie de menu, séparée par « > ». Par exemple, « sess def » correspond à « Fichier > Sessions > Défaut ». + + + No themes found in installation. + Aucun thème n’a été trouvé dans l’installation. + + + The current date (ISO). + La date actuelle (ISO). + + + The current time (ISO). + L’heure actuelle (ISO). + + + The current date (RFC2822). + La date actuelle (RFC2822). + + + The current time (RFC2822). + L’heure actuelle (RFC2822). + + + The current date (Locale). + La date actuelle (locale). + + + The current time (Locale). + L’heure actuelle (locale). + + + The configured default directory for projects. + Le répertoire par défaut configuré pour les projets. + + + The directory last visited in a file dialog. + Le dernier répertoire visité dans une boite de dialogue de fichiers. + + + Is %1 running on Windows? + Est-ce que %1 tourne sous Windows ? + + + Is %1 running on OS X? + Est-ce que %1 tourne sous OS X ? + + + Is %1 running on Linux? + Est-ce que %1 tourne sous Linux ? + + + Is %1 running on any unix-based platform? + Est-ce que %1 tourne sur une plate-forme Unix ? + + + The path list separator for the platform. + Le séparateur de liste de chemins pour la plate-forme. + + + The platform executable suffix. + Suffixe de l’exécutable de la plate-forme. + + + The directory where %1 finds its pre-installed resources. + Répertoire dans lequel %1 trouve ses ressources préinstallées. + + + The current date (QDate formatstring). + La date actuelle (chaîne de formatage QDate). + + + The current time (QTime formatstring). + L’heure actuelle (chaîne de formatage QTime). + + + Generate a new UUID. + Générer un nouvel UUID. + + + A comment. + Un commentaire. + + + %1 > %2 Preferences... + Préférences %1 > %2… + + + Create Folder + Créer un dossier + + + Settings File Error + Erreur dans le fichier des paramètres + + + The settings file "%1" is not writable. +You will not be able to store any %2 settings. + Le fichier de paramètres « %1 » n’est pas accessible en écriture. +Vous ne pourrez pas enregistrer de paramètres %2. + + + The file is not readable. + Le fichier n’est pas lisible. + + + The file is invalid. + Le fichier est invalide. + + + Error reading settings file "%1": %2 +You will likely experience further problems using this instance of %3. + Erreur de lecture du fichier de paramètres « %1 » : %2 +Vous rencontrerez probablement d’autres problèmes en utilisant cette instance de %3. + + + %1 collects crash reports for the sole purpose of fixing bugs. To disable this feature go to %2. + %1 récupère les rapports de plantage dans le seul but de corriger les bogues. Pour désactiver cette fonction, allez à %2. + + + %1 can collect crash reports for the sole purpose of fixing bugs. To enable this feature go to %2. + %1 peut recevoir des rapports de plantage dans le seul but de corriger des bogues. Pour activer cette fonction, allez à %2. + + + > Preferences > Environment > System + > Préférences > Environnement > Système + + + Edit > Preferences > Environment > System + Édition > Préférences > Environnement > Système + + + %1 uses Google Crashpad for collecting crashes and sending them to our backend for processing. Crashpad may capture arbitrary contents from crashed process’ memory, including user sensitive information, URLs, and whatever other content users have trusted %1 with. The collected crash reports are however only used for the sole purpose of fixing bugs. + %1 utilise Google Crashpad pour recevoir les plantages et les envoyer à notre backend pour traitement. Crashpad peut capturer des contenus arbitraires de la mémoire du processus accidenté, y compris des informations sensibles de l’utilisateur, des URL et tout autre contenu que les utilisateurs ont confié à %1. Les rapports de plantage collectés ne sont toutefois utilisés que dans le seul but de corriger les bogues. + + + More information: + Plus d’informations : + + + Crashpad Overview + Aperçu de Crashpad + + + %1 security policy + politique de sécurité %1 + + + Text Encoding + Encodage du texte + + + The following encodings are likely to fit: + Les encodages suivants sont susceptibles de convenir : + + + Select encoding for "%1".%2 + Sélectionner l’encodage pour « %1 ».%2 + + + Reload with Encoding + Recharger avec l’encodage + + + Save with Encoding + Enregistrer avec l’encodage + + + Restart Required + Redémarrage nécessaire + + + Later + Plus tard + + + Restart Now + Redémarrer maintenant + + + System Editor + Éditeur du système + + + Could not open URL %1. + Impossible d’ouvrir l’URL %1. + + + Could not find executable for "%1" (expanded "%2") + Impossible de trouver l’exécutable pour « %1 » (développé « %2 ») + + + Starting external tool "%1" + Démarrage de l’outil externe « %1 » + + + "%1" finished + « %1 » terminé + + + "%1" finished with error + « %1 » terminé avec une erreur + + + %n occurrences replaced. + + %n occurrence remplacée. + %n occurrences remplacées. + + + + Factory with id="%1" already registered. Deleting. + Fabrique avec identifiant=« %1 » déjà enregistrée. Suppression. + + + Reload All Wizards + Recharger tous les assistants + + + Inspect Wizard State + Inspecter l’état de l’assistant + + + Error in "%1": %2 + Erreur dans « %1 » : %2 + + + Cannot convert result of "%1" to string. + Impossible de convertir le résultat de « %1 » en chaîne de caractères. + + + Evaluate simple JavaScript statements.<br>Literal '}' characters must be escaped as "\}", '\' characters must be escaped as "\\", and "%{" must be escaped as "%\{". + Évaluer des instructions JavaScript simples.<br>Les caractères littéraux « } » doivent être échappés sous la forme « \} », les caractères « \ » doivent être échappés sous la forme « \\ » et les caractères « %{ » doivent être échappés sous la forme « %\{ ». + + + Run External Tool + Exécuter un outil externe + + + Runs an external tool that you have set up in the preferences (Environment > External Tools). + Exécute un outil externe que vous avez configuré dans les préférences (Environnement > Outils externes). + + + Evaluate JavaScript + Évaluer le JavaScript + + + Evaluates arbitrary JavaScript expressions and copies the result. + Évalue des expressions JavaScript arbitraires et copie le résultat. + + + Reset Engine + Réinitialisation du moteur + + + Engine aborted after timeout. + Le moteur s’est arrêté après le délai d’attente. + + + Copy to clipboard: %1 + Copier dans le presse-papiers : %1 + + + Locator: Error occurred when running "%1". + Localisateur : une erreur s’est produite lors de l’exécution de « %1 ». + + + Locator query string. + Chaîne de requête du localisateur. + + + Locator query string with quotes escaped with backslash. + Chaîne de requête du localisateur avec les guillemets échappés par la barre oblique inverse. + + + Locator query string with quotes escaped with backslash and spaces replaced with "*" wildcards. + Chaîne de requête du localisateur avec les guillemets échappés par la barre oblique inverse et les espaces remplacées par des caractères joker « * ». + + + Locator query string as regular expression. + Chaîne de requête du localisateur sous forme d’expression rationnelle. + + + File Name Index + Index des noms de fichiers + + + Matches files from a global file system index (Spotlight, Locate, Everything). Append "+<number>" or ":<number>" to jump to the given line number. Append another "+<number>" or ":<number>" to jump to the column number as well. + Correspond aux fichiers à partir d’un index global du système de fichiers (Spotlight, Locate, Everything). Ajouter « +<numéro> » ou « :<numéro> » pour passer au numéro de ligne donné. Ajouter un autre « +<nombre> » ou « :<nombre> » pour passer également au numéro de colonne. + + + Case sensitive: + Sensible à la casse : + + + Add "%1" placeholder for the query string. +Double-click to edit item. + Ajouter l’espace réservé « %1 » pour la chaîne de requête. +Double-cliquez pour modifier l’élément. + + + Move Up + Déplacer vers le haut + + + Move Down + Déplacer vers le bas + + + URLs: + URLs : + + + Activate %1 View + Activer la vue %1 + + + Elided %n characters due to Application Output settings + + Élision d’un caractère en raison des paramètres de sortie de l’application + Élision de %n caractères en raison des paramètres de sortie de l’application + + + + [Discarding excessive amount of pending output.] + + [Rejet d’une quantité excessive de produits en attente.] + + + + Apply Chunk + Appliquer le morceau + + + Revert Chunk + Rétablir le morceau + + + Would you like to apply the chunk? + Souhaitez-vous appliquer le morceau ? + + + Would you like to revert the chunk? + Souhaitez-vous rétablir le morceau ? + + + Note: The file will be saved before this operation. + Remarque : le fichier sera enregistré avant cette opération. + + + There is no patch-command configured in the general "Environment" settings. + Il n’y a pas de commande patch configurée dans les paramètres généraux de « Environnement ». + + + The patch-command configured in the general "Environment" settings does not exist. + La commande-patch configurée dans les paramètres généraux de « Environnement » n’existe pas. + + + Running in %1: %2 %3 + En cours d’exécution dans %1 : %2 %3 + + + Unable to launch "%1": %2 + Impossible de lancer « %1 » : %2 + + + A timeout occurred running "%1" + Un dépassement de délai s’est produit lors de l’exécution de « %1 » + + + "%1" crashed. + « %1 » a planté. + + + "%1" failed (exit code %2). + « %1 » a échoué (code de sortie %2). + + + Source + Source + + + Choose source location. This can be a plugin library file or a zip file. + Sélectionner l’emplacement de la source. Il peut s’agir d’un fichier de bibliothèque de greffons ou d’un fichier zip. + + + File does not exist. + Le fichier n’existe pas. + + + Check Archive + Vérifier l’archive + + + Checking archive... + Vérification de l’archive… + + + The file is not an archive. + Le fichier n’est pas une archive. + + + Canceled. + Annulé. + + + There was an error while unarchiving. + Une erreur s’est produite lors du désarchivage. + + + Archive is OK. + L’archive est OK. + + + Plugin requires an incompatible version of %1 (%2). + Le greffon nécessite une version incompatible de %1 (%2). + + + Did not find %1 plugin. + Le greffon %1 est introuvable. + + + Install Location + Emplacement de l’installation + + + Choose install location. + Sélectionner l’emplacement de l’installation. + + + User plugins + Greffons utilisateur + + + The plugin will be available to all compatible %1 installations, but only for the current user. + Le greffon sera disponible pour toutes les installations compatibles %1, mais seulement pour l’utilisateur actuel. + + + %1 installation + Installation %1 + + + The plugin will be available only to this %1 installation, but for all users that can access it. + Le greffon ne sera disponible que pour cette installation %1, mais pour tous les utilisateurs qui peuvent y accéder. + + + Summary + Résumé + + + "%1" will be installed into "%2". + « %1 » sera installé dans « %2 ». + + + Overwrite File + Écraser le fichier + + + The file "%1" exists. Overwrite? + Le fichier « %1 » existe. Écraser ? + + + Overwrite + Écraser + + + Failed to Write File + Échec de l’écriture du fichier + + + Failed to write file "%1". + Échec de l’écriture du fichier « %1 ». + + + Install Plugin + Installer le greffon + + + Failed to Copy Plugin Files + Échec de la copie des fichiers de greffon + + + unnamed + sans nom + + + Current theme: %1 + Thème actuel : %1 + + + The theme change will take effect after restart. + Le changement de thème prendra effet après le redémarrage. + + + About %1 + À propos de %1 + + + <br/>From revision %1<br/> + <br/>À partir de la révision %1<br/> + + + <br/>Built on %1 %2<br/> + <br/>Construit sur %1 %2<br/> + + + <h3>%1</h3>%2<br/>%3%4%5<br/>Copyright 2008-%6 %7. All rights reserved.<br/><br/>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<br/> + <h3>%1</h3>%2<br/>%3%4%5<br/>Copyright 2008-%6 %7. Tous droits réservés.<br/><br/>Le programme est fourni tel quel, sans garantie d’aucune sorte, y compris la garantie de conception, de qualité marchande et d’adéquation à un usage particulier.<br/> + + + The Qt logo as well as Qt®, Qt Quick®, Built with Qt®, Boot to Qt®, Qt Quick Compiler®, Qt Enterprise®, Qt Mobile® and Qt Embedded® are registered trademarks of The Qt Company Ltd. + Le logo Qt ainsi que Qt®, Qt Quick®, Built with Qt®, Boot to Qt®, Qt Quick Compiler®, Qt Enterprise®, Qt Mobile® et Qt Embedded® sont des marques déposées de The Qt Company Ltd. + + + Haskell Editor + Éditeur Haskell + + + Model Editor + Éditeur de modèle + + + Nim Editor + Éditeur Nim + + + Binding Editor + Éditeur de binding + + + Qt Quick Designer + Qt Quick Designer + + + SCXML Editor + Éditeur SCXML QtC::CppEditor - Sort alphabetically - Trier par ordre alphabétique + <Select Symbol> + <Sélectionner un symbole> - This change cannot be undone. - Ce changement ne peut être annulé. - - - Yes, I know what I am doing. - Simplifier les déclarations. - - - Simplify Declarations - Simplifier les déclarations - - - Enter class name - Entrer le nom de la classe - - - Enter Class Name - Entrer le nom de la classe - - - The header and source file names will be derived from the class name - Le nom du fichier source et du fichier d'en-tête seront dérivés du nom de la classe - - - Configure... - Configurer... - - - Error while generating file contents. - Erreur a la génération du contenu du fichier. - - - C++ Class Wizard - Assistant de création de classe C++ - - - Details - Détails - - - Unfiltered - Sans filtre - - - Creates a C++ header file. - Créer un fichier header C++. - - - Creates a C++ source file. - Créer un fichier source C++. - - - Creates a header and a source file for a new class. - Créer un header et un fichier source pour une nouvelle classe. - - - Follow Symbol under Cursor - Suivre le symbole sous le curseur - - - Switch between Method Declaration/Definition - Changer entre la définition et déclaration de la méthode - - - Follow Symbol Under Cursor - Suivre le symbole sous le curseur - - - Rename Symbol under Cursor - Renommer le symbole sous le curseur - - - Update code model - Mettre à jour le modèle de code - - - License Template: - Modèle de licence : + <No Symbols> + <Aucun symbole> %1: No such file or directory %1 : aucun fichier ou répertoire de ce type - Scanning - Balayage ? (Numérisation ça fait franchement scanner) - Analyse - - - unnamed - sans nom - - - Indexing - Indexation - - - File Naming Conventions - Conventions de nommage des fichiers + %1: Could not get file contents + %1 : Impossible d’obtenir le contenu du fichier Code Style @@ -2492,6 +19025,42 @@ Voulez vous les écraser ? File Naming Nommage de fichier + + Interpret ambiguous headers as C headers + Interpréter les en-têtes ambigus comme des en-têtes C + + + Do not index files greater than + Ne pas indexer les fichiers plus grands que + + + MB + Mo + + + Ignore files + Ignorer les fichiers + + + <html><head/><body><p>Ignore files that match these wildcard patterns, one wildcard per line.</p></body></html> + <html><head/><body><p>Ignorer les fichiers qui correspondent à ces caractères joker, un caractère joker par ligne.</p></body></html> + + + Ignore precompiled headers + Ignorer les en-têtes précompilés + + + <html><head/><body><p>When precompiled headers are not ignored, the parsing for code completion and semantic highlighting will process the precompiled header before processing any file.</p></body></html> + <html><head/><body><p>Lorsque les en-têtes précompilés ne sont pas ignorés, l’analyse pour la complétion de code et le surlignage sémantique traitera l’en-tête précompilé avant de traiter tout fichier.</p></body></html> + + + Use built-in preprocessor to show pre-processed files + Utiliser le préprocesseur intégré pour afficher les fichiers prétraités + + + Uncheck this to invoke the actual compiler to show a pre-processed source file in the editor. + Décocher cette case pour invoquer le compilateur actuel et afficher un fichier source prétraité dans l’éditeur. + Code Model Modèle de code @@ -2501,197 +19070,129 @@ Voulez vous les écraser ? C++ - Completion - Complétion + <p>If background indexing is enabled, global symbol searches will yield more accurate results, at the cost of additional CPU load when the project is first opened. The indexing result is persisted in the project's build directory. If you disable background indexing, a faster, but less accurate, built-in indexer is used instead. The thread priority for building the background index can be adjusted since clangd 15.</p><p>Background Priority: Minimum priority, runs on idle CPUs. May leave 'performance' cores unused.</p><p>Normal Priority: Reduced priority compared to interactive work.</p>Low Priority: Same priority as other clangd work. + <p>Si l’indexation en arrière-plan est activée, les recherches globales de symboles donneront des résultats plus précis, au prix d’une charge de travail supplémentaire du CPU lors de la première ouverture du projet. Le résultat de l’indexation est conservé dans le répertoire de construction du projet. Si vous désactivez l’indexation en arrière-plan, un indexeur intégré plus rapide, mais moins précis, est utilisé à la place. La priorité des threads pour la construction de l’index d’arrière-plan peut être ajustée depuis clangd 15.</p><p>Priorité d’arrière-plan : priorité minimale, s’exécute sur les processeurs inactifs. Peut laisser les cœurs de « performance » inutilisés.</p><p>Priorité normale : priorité réduite par rapport au travail interactif.</p>Priorité basse : même priorité que les autres travaux de clangd. - Text Editor - Éditeur de texte + Number of worker threads used by clangd. Background indexing also uses this many worker threads. + Nombre de threads de travail utilisés par clangd. L’indexation en arrière-plan utilise également ce nombre de threads de travail. - Behavior - Comportement + Controls whether clangd may insert header files as part of symbol completion. + Contrôle si clangd peut insérer des fichiers d’en-tête dans le cadre de la complétion de symboles. - &Case-sensitivity: - Sensibilité à la &casse : + Defines the amount of time Qt Creator waits before sending document changes to the server. +If the document changes again while waiting, this timeout resets. + Définit le temps d’attente de Qt Creator avant d’envoyer les modifications du document au serveur. +Si le document est à nouveau modifié pendant l’attente, ce délai est réinitialisé. - Full - Totale + Files greater than this will not be opened as documents in clangd. +The built-in code model will handle highlighting, completion and so on. + Les fichiers d’une taille supérieure ne seront pas ouverts en tant que documents dans clangd. +Le modèle de code intégré gèrera le surlignage, la complétion, etc. + + + The maximum number of completion results returned by clangd. + Le nombre maximum de résultats de complétion renvoyés par clangd. + + + Use clangd + Utiliser clangd + + + Insert header files on completion + Insérer les fichiers d’en-tête dans la complétion + + + Ignore files greater than + Ignorer les fichiers plus grands que + + + Completion results: + Résultats de la complétion : + + + No limit + Aucune limite + + + Path to executable: + Chemin vers l’exécutable : + + + Background indexing: + Indexation en arrière-plan : + + + Worker thread count: + Nombre de threads de travail : + + + Document update threshold: + Seuil de mise à jour du document : + + + Sessions with a single clangd instance + Sessions avec une seule instance de clangd + + + By default, Qt Creator runs one clangd process per project. +If you have sessions with tightly coupled projects that should be +managed by the same clangd process, add them here. + Par défaut, Qt Creator lance un processus clangd par projet. +Si vous avez des sessions avec des projets étroitement liés qui +devraient être gérés par le même processus clangd, ajoutez-les ici. + + + Add ... + Ajouter… + + + Choose a session: + Sélectionner une session : + + + Additional settings are available via <a href="https://clangd.llvm.org/config"> clangd configuration files</a>.<br>User-specific settings go <a href="%1">here</a>, project-specific settings can be configured by putting a .clangd file into the project source tree. + Des paramètres supplémentaires sont disponibles via <a href="https://clangd.llvm.org/config">les fichiers de configuration de clangd</a>.<br>Les paramètres spécifiques à l’utilisateur vont <a href="%1">ici</a>, les paramètres spécifiques au projet peuvent être configurés en plaçant un fichier .clangd dans l’arbre des sources du projet. + + + Clangd + Clangd None Aucune - First Letter - Première lettre - - - Activate completion: - Activer la complétion : - - - Manually - Manuellement - - - When Triggered - À la demande - - - Always - Toujours - - - Insert the common prefix of available completion items. - Insérer le préfixe commun des élements disponibles. - - - Autocomplete common &prefix - Autocomplétion du &préfixe commun - - - Automatically insert semicolons and closing brackets, parentheses, curly braces, and quotes when appropriate. - Insérer automatiquement les deux points et crochets fermants, parenthèses, accolades et guillemets quand cela est approprié. - - - &Automatically insert matching characters - Insérer &automatiquement les caractères correspondants - - - When typing a matching character and there is a text selection, instead of removing the selection, surround it with the corresponding characters. - Lors de la frappe d'un caractère correspondant, s'il y a une sélection de texte, au lieu de la supprimer, l'entourer des caractères correspondants. - - - Surround &text selections - Entourer les sélections de &texte - - - Insert &space after function name - Insérer un e&space après le nom de fonction - - - Documentation Comments - Commentaires de documentation - - - Automatically create a Doxygen comment upon pressing enter after a /** or /*! - Créer automatiquement un commentaire Doxygen lorsque vous appuyez sur entrée après /** ou /*! - - - Enable Doxygen blocks - Activer les blocs Doxygen - - - Generate a <i>brief</i> command with an initial description for the corresponding declaration - on garde vraiment le mot initiale ? - Générer une commande <i>brief</i> avec une description initiale pour la déclaration correspondante - - - Generate brief description - Générer une description "brief" - - - Add leading asterisks when continuing comments on new lines - Ajouter des astérisques en début de ligne pour les commentaires multilignes - - - Add leading asterisks - Ajouter des astérisques en début de ligne - - - Add leading asterisks when continuing Qt (/*!) and Java (/**) style comments on new lines - Ajouter des astérisques en début de ligne pour continuer les commentaires de style Qt (/*!) et Java (/ **) sur les nouvelles lignes - - - Methods in current Document - Méthodes du document courant - - - Methods in Current Document - Méthodes du document courant - - - C++ Methods in Current Document - Méthodes C++ du document courant + Quick Fixes + Corrections rapides C++ Symbols in Current Document - Symboles C++ du document courant + Symboles C++ du document actuel - /************************************************************************** -** Qt Creator license header template -** Special keywords: %USER% %DATE% %YEAR% -** Environment variables: %$VARIABLE% -** To protect a percent sign, use '%%'. -**************************************************************************/ - - /************************************************************************** -** Modèle de licence Qt Creator -** Mots-clés spéciaux : %USER% %DATE% %YEAR% -** Variables d'environnement : %$VARIABLE% -** Pour échaper un caractère pourcentage, utilisez '%%'. -**************************************************************************/ + All Included C/C++ Files + Tous les fichiers C/C++ inclus + + + C++ Classes, Enums, Functions and Type Aliases + Classes, énumérations, fonctions et alias de type C++ Edit... - Modifier... + Modifier… Choose Location for New License Template File - Choisir l'emplacement pour le nouveau modèle de license - - - Choose a location for the new license template file - Choisir un nouveau fichier pour le modèle de license - - - Choose a new license template file - Choisir un nouveau fichier pour le modèle de license - - - Edit - Éditer - - - Template write error - Erreur d'écriture du modèle - - - Cannot write to %1: %2 - Impossible d'écrire %1 : %2 - - - Methods and functions - Méthodes et fonctions - - - Methods and Functions - Méthodes et fonctions - - - C++ Methods and Functions - Méthodes et fonctions C++ + Sélectionner l’emplacement pour le nouveau modèle de licence C++ Functions Fonctions C++ - - Classes and Methods - Classes et méthodes - - - C++ Classes and Methods - Classes et méthodes C++ - - - C++ Classes, Enums and Functions - Classes, énumérations et fonctions C++ - &C++ &C++ @@ -2702,7 +19203,7 @@ Voulez vous les écraser ? Open Corresponding Header/Source in Next Split - Ouvrir les fichiers d'en-tête/source dans la vue suivante + Ouvrir les fichiers d’en-tête/source dans la vue suivante Meta+E, F4 @@ -2713,24 +19214,1823 @@ Voulez vous les écraser ? Ctrl+E, F4 - Search class - Rechercher la classe + Reads + Lectures - Class Declarations - Déclarations de classe + Writes + Écritures - Search functions - Rechercher les fonctions + Other + Autre - Function calls - Appels de fonction + C++ Usages: + Utilisations de C++ : - %1 of %2 - %1 de %2 + Searching for Usages + Recherche des utilisations + + + Re&name %n files + + Re&nommer %n fichier + Re&nommer %n fichiers + + + + Files: +%1 + Fichiers : +%1 + + + C++ Macro Usages: + Utilisations de macros C++ : + + + Rewrite Using %1 + Réécrire en utilisant %1 + + + Swap Operands + Échanger les opérandes + + + Rewrite Condition Using || + Réécrire la condition en utilisant || + + + Split Declaration + Fractionner la déclaration + + + Add Curly Braces + Ajouter des accolades + + + Move Declaration out of Condition + Déplacer la déclaration en dehors de la condition + + + Split if Statement + aaaaaaaah ! Je n'avais pas tilté. + Fractionner la condition if + + + Enclose in %1(...) + Encapsuler dans %1(…) + + + Convert to String Literal + Convertir en une chaîne littérale + + + Convert to Character Literal and Enclose in QLatin1Char(...) + Convertir en une chaîne littérale et l’insère dans QLatin1Char(…) + + + Convert to Character Literal + Convertir en un caractère littéral + + + Add #include %1 + Ajouter #include %1 + + + Switch with Previous Parameter + Interchanger avec le paramètre précédent + + + Switch with Next Parameter + Interchanger avec le paramètre suivant + + + Mark as Translatable + Marquer comme traduisible + + + Convert to Objective-C String Literal + Convertir en une chaîne littérale Objective-C + + + Convert to Hexadecimal + Convertir en hexadécimal + + + Convert to Octal + Convertir en octal + + + Convert to Decimal + Convertir en décimal + + + Convert to Binary + Convertir en binaire + + + Add Local Declaration + Ajouter la déclaration locale + + + Convert to Camel Case + Convertir en Camel Case + + + Add forward declaration for %1 + Ajouter la déclaration préalable pour %1 + + + Reformat to "%1" + Reformater en « %1 » + + + Reformat Pointers or References + Reformater les pointeurs ou références + + + Complete Switch Statement + Terminer l’instruction switch + + + Add Class Member "%1" + Ajouter le membre de la classe « %1 » + + + Provide the type + Fournir le type + + + Data type: + Type de donnée : + + + Member Function Implementations + Implémentation des fonctions membres + + + Inline + Inline + + + Outside Class + En dehors de la classe + + + Default implementation location: + Emplacement de l’implémentation par défaut : + + + Create Implementations for Member Functions + Créer des implémentations pour les fonctions membres + + + Generate Missing Q_PROPERTY Members + Générer les membres manquants de Q_PROPERTY + + + Generate Setter + Générer le setter + + + Generate Getter + Générer le getter + + + Generate Getter and Setter + Générer le getter et le setter + + + Generate Constant Q_PROPERTY and Missing Members + Générer un Q_PROPERTY constant et les membres manquants + + + Generate Q_PROPERTY and Missing Members with Reset Function + Générer le Q_PROPERTY et les membres manquants avec la fonction Reset + + + Generate Q_PROPERTY and Missing Members + Générer le Q_PROPERTY et les membres manquants + + + Getters and Setters + Getters et setters + + + Member + Membre + + + Getter + Getter + + + Setter + Setter + + + Signal + Signal + + + Reset + Réinitialiser + + + QProperty + QProperty + + + Constant QProperty + QProperty constante + + + Create getters for all members + Créer les getters pour tous les membres + + + Create setters for all members + Créer les setters pour tous les membres + + + Create signals for all members + Créer les signaux pour tous les membres + + + Create Q_PROPERTY for all members + Créer les Q_PROPERTY pour tous les membres + + + Select the getters and setters to be created. + Sélectionner les getters et les setters à créer. + + + Function name + Nom de fonction + + + Access + Accéder + + + Extract Constant as Function Parameter + Extraire la constante comme paramètre de fonction + + + Convert to Stack Variable + Convertir en variable de pile + + + Convert to Pointer + Convertir en pointeur + + + Definitions Outside Class + Définitions en dehors de la classe + + + Move All Function Definitions to %1 + Déplacer toutes les définitions de fonction vers %1 + + + Assign to Local Variable + Affecter à la variable locale + + + Optimize for-Loop + Optimiser la boucle for + + + Escape String Literal as UTF-8 + Échapper la chaîne de caractères littérale en UTF-8 + + + Unescape String Literal as UTF-8 + Déséchapper la chaîne de caractères littérale en UTF-8 + + + Convert connect() to Qt 5 Style + Convertir connect() au style Qt 5 + + + Remove All Occurrences of "using namespace %1" in Global Scope and Adjust Type Names Accordingly + Supprimer toutes les occurrences de « using namespace %1 » dans la portée globale et ajuster les noms de types en conséquence + + + Remove "using namespace %1" and Adjust Type Names Accordingly + Supprimer « using namespace %1 » et adapter les noms de types en conséquence + + + Initialize in Constructor + Initialiser dans le constructeur + + + Member Name + Nom du membre + + + Parameter Name + Nom du paramètre + + + Default Value + Valeur par défaut + + + Base Class Constructors + Constructeurs de la classe de base + + + Constructor + Constructeur + + + Parameters without default value must come before parameters with default value. + Les paramètres sans valeur par défaut doivent être placés avant les paramètres avec valeur par défaut. + + + Initialize all members + Initialiser tous les membres + + + Select the members to be initialized in the constructor. +Use drag and drop to change the order of the parameters. + Sélectionnez les membres à initialiser dans le constructeur. +Utilisez le glisser-déposer pour modifier l’ordre des paramètres. + + + Generate Constructor + Générer le constructeur + + + Add %1 Declaration + Ajouter la déclaration %1 + + + Add Definition in %1 + Ajouter la définition dans %1 + + + Add Definition Here + Ajouter une définition ici + + + Add Definition Inside Class + Ajouter une définition dans la classe + + + Add Definition Outside Class + Ajouter une définition en dehors de la classe + + + No type hierarchy available + Aucune hiérarchie de type disponible + + + Bases + Bases + + + Open in Editor + Ouvrir dans un éditeur + + + Evaluating Type Hierarchy + Évaluation de la hiérarchie de type + + + Derived + Dérivé + + + Evaluating type hierarchy... + Évaluation de la hiérarchie de type… + + + Type Hierarchy + Hiérarchie de type + + + C++ Symbols + Symboles C++ + + + C++ Symbols: + Symboles C++ : + + + Classes + Classes + + + Functions + Fonctions + + + Enums + Énumérations + + + Declarations + Déclarations + + + Searching for Symbol + Recherche des symboles + + + Scope: %1 +Types: %2 +Flags: %3 + Contexte : %1 +Types : %2 +Indicateurs : %3 + + + All + Tout + + + Projects + Projets + + + ≥ + + + + lines + lignes + + + See tool tip for more information + Voir l’info-bulle pour plus d’informations + + + Use <name> for the variable +Use <camel> for camel case +Use <snake> for snake case +Use <Name>, <Camel> and <Snake> for upper case +e.g. name = "m_test_foo_": +"set_<name> => "set_test_foo" +"set<Name> => "setTest_foo" +"set<Camel> => "setTestFoo" + Utiliser <nom> pour la variable +Utiliser <camel> pour le camel case +Utiliser <snake> for snake case +Utiliser <Nom>, <Camel> et <Snake> pour les majuscules +p.ex. nom = « m_test_toto_ » : +"set_<nom> => « set_test_toto » +"set<Nom> => « setTest_toto » +"set<Camel> => « setTestToto » + + + For example, [[nodiscard]] + Par exemple, [[nodiscard]] + + + For example, new<Name> + Par exemple, new<Nom> + + + Setters should be slots + Les setters doivent être des slots + + + Normally reset<Name> + Normalement reset<Nom> + + + Normally <name>Changed + Normalement <Nom>Changed + + + Generate signals with the new value as parameter + Générer des signaux avec la nouvelle valeur comme paramètre + + + For example, m_<name> + Par exemple, m_<nom> + + + Generate missing namespaces + Générer les espaces de noms manquants + + + Add "using namespace ..." + Ajouter « using namespace … » + + + Rewrite types to match the existing namespaces + Réécrire les types pour qu’ils correspondent aux espaces de noms existants + + + <html><head/><body><p>Uncheck this to make Qt Creator try to derive the type of expression in the &quot;Assign to Local Variable&quot; quickfix.</p><p>Note that this might fail for more complex types.</p></body></html> + <html><head/><body><p>Décochez cette case pour que Qt Creator essaie de dériver le type d’expression dans la correction rapide &quot;Assigner à une variable locale&quot;.</p><p>Notez que cela peut échouer pour des types plus complexes.</p></body></html> + + + Use type "auto" when creating new variables + Utiliser le type « auto » lors de la création de nouvelles variables + + + Template + Template + + + Separate the types by comma. + Séparer les types par une virgule. + + + Use <new> and <cur> to access the parameter and current value. Use <type> to access the type and <T> for the template parameter. + Utiliser <new> et <cur> pour accéder au paramètre et à la valeur actuelle. Utilisez <type> pour accéder au type et <T> pour le paramètre du template. + + + Add + Ajouter + + + Normally arguments get passed by const reference. If the Type is one of the following ones, the argument gets passed by value. Namespaces and template arguments are removed. The real Type must contain the given Type. For example, "int" matches "int32_t" but not "vector<int>". "vector" matches "std::pmr::vector<int>" but not "std::optional<vector<int>>" + Normalement, les arguments sont transmis par référence constante. Si le type est l’un des suivants, l’argument est transmis par valeur. Les espaces de noms et les arguments du modèle sont supprimés. Le type réel doit contenir le type donné. Par exemple, « int » correspond à « int32_t » mais pas à « vector<int> ». « vector » correspond à « std::pmr::vector<int> » mais pas à « std::optional<vector<int>> » + + + Return non-value types by const reference + Retourner les types de non-valeurs par référence constante + + + Generate Setters + Générer les setters + + + Generate Getters + Générer les getters + + + Inside class: + À l’intérieur de la classe : + + + Default + Défaut + + + Outside class: + En dehors de la classe : + + + In .cpp file: + Dans le fichier .cpp : + + + Types: + Types : + + + Comparison: + Comparaison : + + + Assignment: + Assignation : + + + Return expression: + Expression renvoyée : + + + Return type: + Type renvoyé : + + + Generated Function Locations + Emplacement des fonctions générées + + + Getter Setter Generation Properties + Propriétés de génération des getters et des setters + + + Getter attributes: + Attributs du getter : + + + Getter name: + Nom du getter : + + + Setter name: + Nom du setter : + + + Setter parameter name: + Nom du paramètre du setter : + + + Reset name: + Réinitialiser le nom : + + + Signal name: + Nom du signal : + + + Member variable name: + Nom de la variable membre : + + + Missing Namespace Handling + Traitement des espaces de noms manquants + + + Custom Getter Setter Templates + Modèles de getters et setters personnalisés + + + Value types: + Types de valeur : + + + Projects only + Projets uniquement + + + All files + Tous les fichiers + + + Sort Alphabetically + Trier par ordre alphabétique + + + You are trying to rename a symbol declared in the generated file "%1". +This is normally not a good idea, as the file will likely get overwritten during the build process. + Vous essayez de renommer un symbole déclaré dans le fichier généré « %1 ». +Ce n’est normalement pas une bonne idée, car le fichier risque d’être écrasé au cours du processus de compilation. + + + Do you want to edit "%1" instead? + Voulez-vous modifier « %1 » à la place ? + + + Open %1 + Ouvrir %1 + + + &Refactor + &Refactoriser + + + Expand All + Tout développer + + + Collapse All + Tout réduire + + + General + Général + + + Content + Contenu + + + Indent + Indenter + + + "public", "protected" and +"private" within class body + « public », « protected » et « private » +dans le corps de la classe + + + Declarations relative to "public", +"protected" and "private" + Déclarations relatives à « public », +« protected » et « private » + + + Statements within blocks + Déclarations dans les blocs + + + Declarations within +"namespace" definition + Déclarations dans la +définition de « namespace » + + + Braces + Accolades + + + Indent Braces + Indenter les accolades + + + Class declarations + Déclarations de classes + + + Namespace declarations + Déclarations d’espaces de noms + + + Enum declarations + Déclarations d’énumérations + + + Blocks + Blocs + + + "switch" + « switch » + + + Indent within "switch" + Indenter à l’intérieur +de « switch » + + + "case" or "default" + « case » ou « default » + + + Statements relative to +"case" or "default" + Déclarations relatives à +« case » ou « default » + + + Blocks relative to +"case" or "default" + Blocs relatifs à +« case » ou « default » + + + "break" statement relative to +"case" or "default" + Déclarations « break » relatives +à « case » ou « default » + + + Alignment + Alignement + + + Align + Aligner + + + <html><head/><body> +Enables alignment to tokens after =, += etc. When the option is disabled, regular continuation line indentation will be used.<br> +<br> +With alignment: +<pre> +a = a + + b +</pre> +Without alignment: +<pre> +a = a + + b +</pre> +</body></html> + <html><head/><body> +Active l’alignement des jetons après =, +=, etc. Quand cette option est désactivée, l’indentation régulière de continuation de ligne sera utilisée.<br> +<br> +Avec alignement : +<pre> +a = a + + b +</pre> +Sans alignement : +<pre> +a = a + + b +</pre> +</body></html> + + + Align after assignments + Aligner après les assignations + + + Add extra padding to conditions +if they would align to the next line + Ajoute une marge supplémentaire aux conditions +si elles devaient s’aligner sur la ligne suivante + + + <html><head/><body> +Adds an extra level of indentation to multiline conditions in the switch, if, while and foreach statements if they would otherwise have the same or less indentation than a nested statement. + +For four-spaces indentation only if statement conditions are affected. Without extra padding: +<pre> +if (a && + b) + c; +</pre> +With extra padding: +<pre> +if (a && + b) + c; +</pre> +</body></html> + <html><head/><body> +Ajoute un niveau supplémentaire d’indentation aux conditions multilignes dans les switch, if, while et foreach si elle avaient moins ou autant d’indentation qu’un code imbriqué. + +Pour les indentations à quatre espaces, seules les if sont affectés. Sans décalage supplémentaire : +<pre> +if (a && + b) + c; +</pre> +Avec du décalage supplémentaire : +<pre> +if (a && + b) + c; +</pre> +</body></html> + + + Pointers and References + Pointeurs et références + + + Bind '*' and '&&' in types/declarations to + Lier « * » et « && » dans les types/déclarations de + + + <html><head/><body>This does not apply to the star and reference symbol in pointer/reference to functions and arrays, e.g.: +<pre> int (&rf)() = ...; + int (*pf)() = ...; + + int (&ra)[2] = ...; + int (*pa)[2] = ...; + +</pre></body></html> + <html><head/><body>Cela ne s’applique par à l’étoile et le symbole de la référence pour les pointeurs/références aux fonctions et tableaux, par exemple : +<pre> int (&rf)() = …; + int (*pf)() = …; + + int (&ra)[2] = …; + int (*pa)[2] = …; + +</pre></body></html> + + + Identifier + Identifiant + + + Type name + Nom du type + + + Left const/volatile + Const/volatile à gauche + + + This does not apply to references. + Cela ne s’applique pas aux références. + + + Right const/volatile + Const/volatile à droite + + + Statements within function body + Instructions dans le corps de la fonction + + + Function declarations + Déclarations de fonction + + + Global + Settings + Globale + + + Qt + Qt + + + GNU + GNU + + + Old Creator + Ancien Creator + + + &Suffix: + &Suffixe : + + + S&earch paths: + &Chemins de la recherche : + + + Comma-separated list of header paths. + +Paths can be absolute or relative to the directory of the current open document. + +These paths are used in addition to current directory on Switch Header/Source. + Liste des chemins pour les fichiers d’en-tête (séparation par des virgules). + +Les chemins peuvent être donnés en absolus ou en relatifs au dossier contenant le document ouvert actuel. + +Ces chemins sont utilisés en complément au répertoire actuel pour basculer entre les fichiers d’en-tête et de source. + + + S&uffix: + S&uffixe : + + + Se&arch paths: + &Chemins de la recherche : + + + Comma-separated list of source paths. + +Paths can be absolute or relative to the directory of the current open document. + +These paths are used in addition to current directory on Switch Header/Source. + Liste des chemins pour les fichiers de source (séparation par des virgules). + +Les chemins peuvent être donnés en absolus ou en relatifs au dossier contenant le document ouvert actuel. + +Ces chemins sont utilisés en complément au répertoire actuel pour basculer entre les fichiers d’en-tête et de source. + + + /************************************************************************** +** %1 license header template +** Special keywords: %USER% %DATE% %YEAR% +** Environment variables: %$VARIABLE% +** To protect a percent sign, use '%%'. +**************************************************************************/ + + /************************************************************************** +** %1 modèle d’en-tête de licence +** Mots-clés spéciaux : %USER% %DATE% %YEAR% +** Variables d’environnement : %$VARIABLE%. +** Pour protéger un signe de pourcentage, utilisez « %% ». +**************************************************************************/ + + + + Use "#pragma once" instead of "#ifndef" guards + Utiliser « #pragma-once » au lieu du garde-fou « #ifndef » + + + &Lower case file names + &Noms des fichiers en minuscule + + + Comma-separated list of header prefixes. + +These prefixes are used in addition to current file name on Switch Header/Source. + Liste de préfixes d’en-tête séparés par des virgules. + +Ces préfixes sont utilisés en complément au répertoire actuel pour basculer entre les fichiers d’en-tête et de source. + + + Uses "#pragma once" instead of "#ifndef" include guards. + Utilise les garde-fous « #pragma-once » au lieu de « #ifndef ». + + + Comma-separated list of source prefixes. + +These prefixes are used in addition to current file name on Switch Header/Source. + Liste de préfixes de sources par des virgules. + +Ces préfixes sont utilisés en complément au répertoire actuel pour basculer entre les fichiers d’en-tête et de source. + + + &Prefixes: + &Préfixes : + + + Include guards + Garde-fous + + + P&refixes: + Pré&fixes : + + + License &template: + &Modèle de licence : + + + Extract Function + Extraire la fonction + + + Extract Function Refactoring + contexte ? [Pierre] là je cale... + Refactorisation de la fonction extraite + + + C++ Classes + Classes C++ + + + Target file was changed, could not apply changes + Le fichier cible a été modifié, impossible d’appliquer les changements + + + Apply changes to definition + Appliquer les changements aux définitions + + + Apply changes to declaration + Appliquer les changements aux déclarations + + + Apply Function Signature Changes + Pluriel ? + Appliquer les changements de signature de fonction + + + Only virtual functions can be marked 'override' + Seules les fonctions virtuelles peuvent être marqués « override » + + + Only virtual functions can be marked 'final' + Seules les fonctions virtuelles peuvent être marqués « final » + + + Expected a namespace-name + Un nom d’espace de noms est attendu + + + Too many arguments + Trop d’arguments + + + Shift+F2 + Maj+F2 + + + Additional Preprocessor Directives... + Directives supplémentaires pour le préprocesseur… + + + Switch Between Function Declaration/Definition + Changer entre la définition et déclaration de la fonction + + + Open Function Declaration/Definition in Next Split + Ouvrir la déclaration/définition de la fonction dans une nouvelle vue + + + Meta+E, Shift+F2 + Meta+E, Maj+F2 + + + Ctrl+E, Shift+F2 + Ctrl+E, Maj+F2 + + + The license template. + Le modèle de licence. + + + The configured path to the license template + La chemin configuré vers le modèle de licence + + + Insert "#pragma once" instead of "#ifndef" include guards into header file + Insérer « #pragma once » au lieu de « #ifndef » dans le fichier d’en-tête + + + C++ + SnippetProvider + C++ + + + Header/Source + text on macOS touch bar + En-tête/source + + + Follow + text on macOS touch bar + Suivre + + + Decl/Def + text on macOS touch bar + Decl/Def + + + Follow Symbol Under Cursor to Type + Suivre le symbole sous le curseur pour taper + + + Ctrl+Shift+F2 + Ctrl+Maj+F2 + + + Follow Symbol to Type in Next Split + Suivre le symbole pour taper dans le prochain panneau + + + Meta+E, Ctrl+Shift+F2 + Meta+E, Ctrl+Maj+F2 + + + Ctrl+E, Ctrl+Shift+F2 + Ctrl+E, Ctrl+Maj+F2 + + + Find References With Access Type + Rechercher des références avec le type d’accès + + + Show Preprocessed Source + Afficher la source prétraitée + + + Show Preprocessed Source in Next Split + Afficher la source prétraitée dans le prochain panneau + + + Find Unused Functions + Trouver les fonctions inutilisées + + + Find Unused C/C++ Functions + Trouver les fonctions C/C++ inutilisées + + + Open Type Hierarchy + Ouvrir la hiérarchie de type + + + Meta+Shift+T + Meta+Maj+T + + + Ctrl+Shift+T + Ctrl+Maj+T + + + Open Include Hierarchy + Ouvrir la hiérarchie d’includes + + + Meta+Shift+I + Meta+Maj+I + + + Ctrl+Shift+I + Ctrl+Maj+I + + + Inspect C++ Code Model... + Inspecter le modèle de code C++… + + + Meta+Shift+F12 + Meta+Maj+F12 + + + Ctrl+Shift+F12 + Ctrl+Maj+F12 + + + Reparse Externally Changed Files + Réanalyser les fichiers modifiés en dehors de Qt Creator + + + Create Getter and Setter Member Functions + Créer des fonctions membres accesseurs et mutateurs + + + Move Definition Outside Class + Déplacer la définition en dehors de la classe + + + Move Definition to %1 + Déplacer la définition dans %1 + + + Move Definition to Class + Déplacer la définition dans la classe + + + Insert Virtual Functions of Base Classes + Insérer les fonctions virtuelles des classes de bases + + + Insert Virtual Functions + Insérer les fonctions virtuelles + + + &Functions to insert: + &Fonctions à insérer : + + + Filter + Filtrer + + + &Hide reimplemented functions + &Cacher les fonctions réimplémentées + + + &Insertion options: + Options d’&insertion : + + + Insert only declarations + Insérer seulement les déclarations + + + Insert definitions inside class + Insérer les définitions dans la classe + + + Insert definitions outside class + Insérer les définitions en dehors de la classe + + + Insert definitions in implementation file + Insérer les définitions dans un fichier d’implémentation + + + Add "&virtual" to function declaration + Ajouter « &virtual » à la déclaration de la fonction + + + Add "override" equivalent to function declaration: + Ajouter l’équivalent « override » à la déclaration de la fonction : + + + Clear Added "override" Equivalents + Effacer les équivalents « override » ajoutés + + + Too few arguments + Trop peu d’arguments + + + Additional C++ Preprocessor Directives + Directives supplémentaires pour le préprocesseur C++ + + + Additional C++ Preprocessor Directives for %1: + Directives supplémentaires pour le préprocesseur C++ pour %1 : + + + No include hierarchy available + Aucune hiérarchie d’includes n’est disponible + + + Synchronize with Editor + Synchroniser avec l’éditeur + + + Include Hierarchy + Hiérarchie d’includes + + + Includes + Inclusions + + + Included by + Inclut par + + + (none) + (aucun) + + + (cyclic) + (cyclique) + + + The file name. + Le nom du fichier. + + + The class name. + Le nom de la classe. + + + Diagnostic configuration: + Configuration du diagnostic : + + + Diagnostic Configurations + Configurations du diagnostic + + + Built-in + Intégré + + + Custom + Personnalisé + + + For appropriate options, consult the GCC or Clang manual pages or the %1 GCC online documentation</a>. + Pour connaître les options appropriées, consultez les pages de manuel de GCC ou de Clang ou la documentation en ligne de GCC %1</a>. + + + Use diagnostic flags from build system + Utiliser les drapeaux de diagnostic du système de compilation + + + Copy... + Copier… + + + Rename... + Renommer… + + + Remove + Supprimer + + + Clang Warnings + Avertissement Clang + + + Copy Diagnostic Configuration + Copier la configuration du diagnostic + + + Diagnostic configuration name: + Nom de la configuration du diagnostic : + + + %1 (Copy) + %1 (copie) + + + Rename Diagnostic Configuration + Renommer la configuration du diagnostic + + + New name: + Nouveau nom : + + + Option "%1" is invalid. + L’option « %1 » est invalide. + + + Copy this configuration to customize it. + Copier cette configuration pour la personnaliser. + + + Configuration passes sanity checks. + La configuration est conforme aux contrôles d’aptitude (sanity checks). + + + Follow Symbol to Type is only available when using clangd + Suivre le symbole pour taper n’est disponible que lorsque l’on utilise clangd + + + Compiler Flags + Drapeaux du compilateur + + + Background Priority + Priorité en arrière-plan + + + Normal Priority + Priorité normale + + + Low Priority + Priorité basse + + + Off + Éteint + + + <b>Warning</b>: This file is not part of any project. The code model might have issues parsing this file properly. + <b>Avertissement</b> : ce fichier ne fait partie d’aucun projet. Le modèle de code peut avoir des difficultés à analyser correctement ce fichier. + + + Note: Multiple parse contexts are available for this file. Choose the preferred one from the editor toolbar. + Remarque : plusieurs contextes d’analyse sont disponibles pour ce fichier. Sélectionnez celui que vous préférez dans la barre d’outils de l’éditeur. + + + C++ Code Model + Modèle de code C++ + + + Matches all files that are included by all C++ files in all projects. Append "+<number>" or ":<number>" to jump to the given line number. Append another "+<number>" or ":<number>" to jump to the column number as well. + Correspond à tous les fichiers inclus dans tous les fichiers C++ de tous les projets. Ajouter « +<numéro> » ou « :<numéro> » pour passer au numéro de ligne donné. Ajouter un autre « +<numéro> » ou « :<numéro> » pour passer également au numéro de colonne. + + + Parsing C/C++ Files + Analyse des fichiers C/C++ + + + Cannot show preprocessed file: %1 + Impossible d’afficher le fichier prétraité : %1 + + + Falling back to built-in preprocessor: %1 + Retour au préprocesseur intégré : %1 + + + Failed to open output file "%1". + Échec de l’ouverture du fichier de sortie « %1 ». + + + Failed to write output file "%1". + Échec de l’écriture du fichier de sortie « %1 ». + + + Could not determine which compiler to invoke. + Impossible de déterminer le compilateur à invoquer. + + + Could not determine compiler command line. + Impossible de déterminer la ligne de commande du compilateur. + + + Checked %1 of %2 functions + Fonction %1 sur %2 vérifiée + + + Finding Unused Functions + Recherche de fonctions inutilisées + + + C++ Indexer: Skipping file "%1" because its path matches the ignore pattern. + Indexeur C++ : ignore le fichier « %1 » car son chemin d’accès correspond au motif ignoré. + + + <p><b>Active Parse Context</b>:<br/>%1</p><p>Multiple parse contexts (set of defines, include paths, and so on) are available for this file.</p><p>Choose a parse context to set it as the preferred one. Clear the preference from the context menu.</p> + <p><b>Contexte d’analyse actif</b> :<br/>%1</p><p>Plusieurs contextes d’analyse (ensemble de définitions, chemins d’inclusion, etc.) sont disponibles pour ce fichier.</p><p>Sélectionnez un contexte d’analyse pour le définir comme contexte préféré. Effacez la préférence à partir du menu contextuel.</p> + + + Clear Preferred Parse Context + Effacer le contexte d’analyse préféré + + + The project contains C source files, but the currently active kit has no C compiler. The code model will not be fully functional. + Le projet contient des fichiers source C, mais le kit actuellement actif n’a pas de compilateur C. Le modèle de code ne sera pas entièrement fonctionnel. + + + The project contains C++ source files, but the currently active kit has no C++ compiler. The code model will not be fully functional. + Le projet contient des fichiers source C++, mais le kit actuellement actif n’a pas de compilateur C++. Le modèle de code ne sera pas entièrement fonctionnel. + + + Preparing C++ Code Model + Préparation du modèle de code C++ + + + Quick Fix settings are saved in a file. Existing settings file "%1" found. Should this file be used or a new one be created? + Les paramètres de la Correction rapide sont enregistrés dans un fichier. Fichier de paramètres existant « %1 » trouvé. Faut-il utiliser ce fichier ou en créer un nouveau ? + + + Switch Back to Global Settings + Retour aux paramètres généraux + + + Use Existing + Utiliser l’existant + + + Create New + Créer un nouveau + + + Custom settings are saved in a file. If you use the global settings, you can delete that file. + Les paramètres personnalisés sont enregistrés dans un fichier. Si vous utilisez les paramètres généraux, vous pouvez supprimer ce fichier. + + + Delete Custom Settings File + Supprimer le fichier des paramètres personnalisés + + + Resets all settings to the global settings. + Réinitialise tous les paramètres aux paramètres généraux. + + + Reset to Global + Restaurer les paramètres généraux + + + C++ Indexer: Skipping file "%1" because it is too big. + Indexeur C++ : passer le fichier « %1 » parce qu’il est trop grand. + + + Checks for questionable constructs + Vérifie les compilations douteuses + + + Build-system warnings + Avertissements du système de compilation + + + collecting overrides ... + réception des surcharges… + + + + QtC::Cppcheck + + Diagnostic + Diagnostic + + + Cppcheck Diagnostics + Diagnostics de Cppcheck + + + Cppcheck Run Configuration + Configuration de l’exécution de Cppcheck + + + Analyze + Analyser + + + Warnings + Avertissements + + + Style + Style + + + Performance + Performance + + + Portability + Portabilité + + + Information + Information + + + Unused functions + Fonctions inutilisées + + + Missing includes + Includes manquants + + + Inconclusive errors + Erreurs non concluantes + + + Check all define combinations + Vérifier toutes les combinaisons de définitions + + + Show raw output + Afficher les résultats bruts + + + Add include paths + Ajouter des chemins d’include + + + Calculate additional arguments + Calculer les arguments supplémentaires + + + Disables multithreaded check. + Désactive la vérification multithread. + + + Comma-separated wildcards of full file paths. Files still can be checked if others include them. + Caractères joker de chemins d’accès complets aux fichiers, séparés par des virgules. Les fichiers peuvent toujours être vérifiés si d’autres les incluent. + + + Can find missing includes but makes checking slower. Use only when needed. + Permet de trouver les includes manquants, mais ralentit la vérification. À n’utiliser qu’en cas de besoin. + + + Like C++ standard and language. + Comme la norme et le langage C++. + + + Binary: + Binaire : + + + Checks: + Vérifie : + + + Custom arguments: + Arguments personnalisés : + + + Ignored file patterns: + Motifs de fichier ignorés : + + + Cppcheck + Cppcheck + + + Go to previous diagnostic. + Revenir au diagnostic précédant. + + + Go to next diagnostic. + Passer au diagnostic suivant. + + + Clear + Effacer + + + Cppcheck... + Cppcheck… + + + Cppcheck started: "%1". + Cppcheck démarré : « %1 ». + + + Cppcheck finished. + Cppcheck terminé. + + + + QtC::CtfVisualizer + + Title + Titre + + + Count + + + + Total Time + Temps total + + + Percentage + Pourcentage + + + Minimum Time + Temps minimum + + + Average Time + Temps moyen + + + Maximum Time + Temps maximum + + + Stack Level %1 + Niveau de la pile %1 + + + Value + Valeur + + + Min + Min + + + Max + Max + + + Start + Démarrer + + + Wall Duration + + + + Unfinished + + + + true + + + + Thread %1 + Thread %1 + + + Categories + Catégories + + + Arguments + Arguments + + + Instant + + + + Scope + Contexte + + + global + + + + process + processus + + + thread + thread + + + Return Arguments + + + + CTF Visualizer + + + + Cannot read the CTF file. + Impossible de lire le fichier CTF. + + + The trace contains threads with stack depth > 512. +Do you want to display them anyway? + + + + Chrome Trace Format Viewer + + + + Load JSON File + Charger un fichier JSON + + + Restrict to Threads + Restreindre aux threads + + + Timeline + Ligne du temps + + + Reset Zoom + Réinitialiser le zoom + + + Statistics + Statistiques + + + Load Chrome Trace Format File + + + + JSON File (*.json) + Fichier JSON (*.json) + + + The file does not contain any trace data. + Le fichier ne contient aucune donnée de traçage. + + + Loading CTF File + Chargement d’un fichier CTF + + + Chrome Trace Format Visualizer + @@ -2739,6 +21039,18 @@ Voulez vous les écraser ? General Général + + Always adds a breakpoint on the <i>%1()</i> function. + Ajoute toujours un point d’arrêt sur la fonction <i>%1()</i>. + + + The debugging helpers are used to produce a nice display of objects of certain types like QString or std::map in the &quot;Locals&quot; and &quot;Expressions&quot; views. + L’assistance au débogage est utilisée pour produire un affichage agréable des objets de certains types comme QString ou std::map dans les vues « Locales » et « Expressions ». + + + Extra Debugging Helper + Assistance au débogage supplémentaire + Locals && Expressions '&&' will appear as one (one is marking keyboard shortcut) @@ -2746,15 +21058,7 @@ Voulez vous les écraser ? <Encoding error> - <Erreur d'encodage> - - - Found a too-old version of the debugging helper library (%1); version %2 is required. - Une version trop ancienne de la bibliothèque d'aide au débogage a été trouvé(%1); La version %2 est nécessaire. - - - Found an outdated version of the debugging helper library (%1); version %2 is required. - Une version obsolète de la bibliothèque d'assistance au débogage a été trouvée (%1); version %2 requise. + <Erreur d’encodage> ptrace: Operation not permitted. @@ -2766,7 +21070,7 @@ For more details, see /etc/sysctl.d/10-ptrace.conf ptrace : opération non permise. -Impossible de s'attacher au processus. Vérifier qu'aucun autre débogueur ne suit ce processus. +Impossible de s’attacher au processus. Vérifier qu’aucun autre débogueur ne suit ce processus. Vérifiez les paramètres de /proc/sys/kernel/yama/ptrace_scope Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf @@ -2783,120 +21087,72 @@ For more details, see /etc/sysctl.d/10-ptrace.conf ptrace : opération non permise. -Impossible de s'attacher au processus. Vérifier qu'aucun autre débogueur ne suit ce processus. +Impossible de s’attacher au processus. Vérifier qu’aucun autre débogueur ne suit ce processus. Si votre uid correspond au uid du processus cible, vérifiez les paramètres de /proc/sys/kernel/yama/ptrace_scope Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf - - ptrace: Operation not permitted. - -Could not attach to the process. Check the settings of -/proc/sys/kernel/yama/ptrace_scope -For more details, see/etc/sysctl.d/10-ptrace.conf - - ptrace : opération non permise. - -Impossible de s'attacher à ce processus. Vérifiez les paramètres de -/proc/sys/kernel/yama/ptrace_scope -Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf - - - ptrace: Operation not permitted. - -Could not attach to the process. If your uid matches the uid -of the target process, check the settings of -/proc/sys/kernel/yama/ptrace_scope -For more details, see/etc/sysctl.d/10-ptrace.conf - - ptrace : opération non permise. - -Impossible de s'attacher à ce processus. Si votre uid correspond au uid -du processus cible, vérifiez les paramètres de -/proc/sys/kernel/yama/ptrace_scope -Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf - - - %n known types, Qt version: %1, Qt namespace: %2 Dumper version: %3 - - %n type connu, version de Qt : %1, espace de noms Qt : %2, version du collecteur : %3 - %n types connus, version de Qt : %1, espace de noms Qt : %2, version du collecteur : %3 - - - - <none> - <aucun> - Load Core File Charger un fichier core - Browse... - Parcourir... + Select Executable or Symbol File + Sélectionner l’exécutable ou le fichier de symboles - Use local core file: - Utiliser un fichier core local : + Select a file containing debug information corresponding to the core file. Typically, this is the executable or a *.debug file if the debug information is stored separately from the executable. + Sélectionner un fichier contenant des informations de débogage correspondant au fichier principal. Il s’agit généralement de l’exécutable ou d’un fichier *.debug si les informations de débogage sont stockées séparément de l’exécutable. + + + This option can be used to override the kit's SysRoot setting + Cette option peut être utilisée pour remplacer le paramètre SysRoot du kit + + + &Executable or symbol file: + &Exécutable ou fichier de symboles : + + + Failed to copy core file to device: %1 + Échec de la copie du fichier core sur le périphérique : %1 + + + Failed to copy symbol file to device: %1 + Échec de la copie du fichier de symboles sur le périphérique : %1 + + + Copying files to device... %1/%2 + Copie des fichiers sur le périphérique… %1/%2 + + + Copying files to device... + Copie des fichiers sur le périphérique… Core file: Fichier core : - - Select Remote Core File - Sélectionner le fichier core distant - Select Core File Sélectionner le fichier core - - Select Sysroot - ou racine système ? quel est le contexte ? - Sélectionner la racine système - Select Startup Script Sélectionner le script de démarrage - - &Executable: - &Exécutable : - - - &Core file: - Fichier &core : - - - &Tool chain: - Chaîne de &compilation : - - - Sys&root: - &Racine système : - Override &start script: Surcharger le &script de démarrage : - - Select start address - Sélectionner l'adresse de départ - Select Start Address - Sélectionner l'adresse de départ + Sélectionner l’adresse de départ Enter an address: - Entrer une adresse : - - - Enter an address: - Entrer une adresse : + Saisir une adresse : Marker File: @@ -2908,13 +21164,9 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf idem Ligne marquée : - - Breakpoint Number: - Numéro du point d'arrêt : - Breakpoint Address: - Adresse du point d'arrêt : + Adresse du point d’arrêt : Property @@ -2922,19 +21174,11 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Breakpoint Type: - Type de point d'arrêt : + Type de point d’arrêt : Breakpoint - Point d'arrêt - - - Watchpoint - Point d'observation - - - Unknown breakpoint type - Type de point d'arrêt inconnu + Point d’arrêt Requested @@ -2944,10 +21188,6 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Obtained Obtenu - - Internal Number: - Numéro interne : - File Name: Nom du fichier : @@ -2958,7 +21198,7 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Breakpoint on QML Signal Emit - Point d'arrêt lors de l'émission d'un signal QML + Point d’arrêt lors de l’émission d’un signal QML Data at 0x%1 @@ -2968,6 +21208,34 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Data at %1 Données à %1 + + Delete Selected Breakpoints + Supprimer les points d’arrêt sélectionnés + + + Edit Selected Breakpoints... + Modifier les points d’arrêt sélectionnés… + + + Disable Selected Locations + Désactiver les emplacements sélectionnés + + + Enable Selected Locations + Activer les emplacements sélectionnés + + + Disable Location + Désactiver l’emplacement + + + Enable Location + Activer l’emplacement + + + Internal ID: + ID interne : + Enabled ou activé ? modifier en conséquence disabled plus haut. @@ -2977,33 +21245,13 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Disabled Désactivé - - , pending - , en attente - - - Engine: - Moteur : - - - Extra Information: - Informations supplémentaires : - Line Number: Numéro de ligne : - - Corrected Line Number: - Numéro de la ligne corrigée : - Module: - Module : - - - Multiple Addresses: - Adresses multiples : + Module : Command: @@ -3051,7 +21299,7 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Breakpoint inserted - Point d'arrêt inséré + Point d’arrêt inséré Removal requested @@ -3072,43 +21320,103 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Breakpoint at "%1" - Point d'arrêt à "%1" + Point d’arrêt à « %1 » Breakpoint by File and Line - Point d'arrêt par fichier et ligne + Point d’arrêt par fichier et ligne Breakpoint by Function - Point d'arrêt par fonction + Point d’arrêt par fonction Breakpoint by Address - Point d'arrêt par adresse + Point d’arrêt par adresse Breakpoint at Function "main()" - Point d'arrêt dans la fonction "main()" + Point d’arrêt dans la fonction « main() » Watchpoint at Address - Point d'observation à l'adresse + Point d’observation à l’adresse Watchpoint at Expression - Point d'observation à l'expression - - - Breakpoint on QML Signal Handler - Point d'arrêt sur un gestionnaire de signal QML + Point d’observation à l’expression Breakpoint at JavaScript throw - Point d'arrêt sur exception JavaScript + Point d’arrêt sur une exception JavaScript Unknown Breakpoint Type - Type de point d'arrêt inconnu + Type de point d’arrêt inconnu + + + File Name and Line Number + Nom de fichier et numéro de ligne + + + Break on Memory Address + Arrêt sur adresse mémoire + + + Break When C++ Exception Is Thrown + Arrêt quand une exception C++ est lancée + + + Break When C++ Exception Is Caught + Arrêt quand une exception C++ est reçue + + + Break When Function "main" Starts + Arrêt quand la fonction « main » commence + + + Break When a New Process Is Forked + Arrêt quand un nouveau processus est forké + + + Break When a New Process Is Executed + Arrêt quand un nouveau processus est exécuté + + + Break When a System Call Is Executed + Arrêt quand un appel système est exécuté + + + Break on Data Access at Fixed Address + Arrêt sur accès aux données à une adresse fixée + + + Break on Data Access at Address Given by Expression + Arrêt sur accès aux données à une adresse donnée par l’expression + + + Break on QML Signal Emit + Arrêt sur l’émission d’un signal QML + + + Break When JavaScript Exception Is Thrown + Arrêt quand une exception JavaScript est lancée + + + <p>Determines how the path is specified when setting breakpoints:</p><ul><li><i>Use Engine Default</i>: Preferred setting of the debugger engine.</li><li><i>Use Full Path</i>: Pass full path, avoiding ambiguities should files of the same name exist in several modules. This is the engine default for CDB and LLDB.</li><li><i>Use File Name</i>: Pass the file name only. This is useful when using a source tree whose location does not match the one used when building the modules. It is the engine default for GDB as using full paths can be slow with this engine.</li></ul> + <p>Détermine la manière dont le chemin est spécifié lors de la définition des points d’arrêt :</p><ul><li><i>Utiliser le moteur par défaut</i> : paramètre préféré du moteur de débogage.</li><li><i>Utiliser le chemin complet</i> : passer le chemin complet, afin d’éviter les ambiguïtés si des fichiers portant le même nom existent dans plusieurs modules. C’est la valeur par défaut du moteur pour CDB et LLDB.</li><li><i>Utiliser le nom du fichier</i> : indiquer uniquement le nom du fichier. Cette option est utile lorsque l’on utilise un arbre source dont l’emplacement ne correspond pas à celui utilisé lors de la compilation des modules. C’est le moteur par défaut pour GDB, car l’utilisation de chemins complets peut être lente avec ce moteur.</li></ul> + + + Specifying the module (base name of the library or executable) for function or file type breakpoints can significantly speed up debugger startup times (CDB, LLDB). + La spécification du module (nom de base de la bibliothèque ou de l’exécutable) pour les points d’arrêt de type fonction ou fichier peut accélérer considérablement les temps de démarrage du débogueur (CDB, LLDB). + + + Debugger commands to be executed when the breakpoint is hit. This feature is only available for GDB. + Commandes du débogueur à exécuter lorsque le point d’arrêt est atteint. Cette fonction n’est disponible que pour GDB. + + + Propagate Change to Preset Breakpoint + Function @@ -3130,17 +21438,13 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Ignore Ignorer - - Watchpoint at 0x%1 - Point d'observation à 0x%1 - Breakpoint will only be hit if this condition is met. - Le point d'arrêt ne sera respecté que si la condition est remplie. + Le point d’arrêt ne sera respecté que si la condition est remplie. Breakpoint will only be hit after being ignored so many times. - Le point d'arrêt ne sera respecté qu'après avoir été ignoré autant de fois. + Le point d’arrêt ne sera respecté qu’après avoir été ignoré autant de fois. (all) @@ -3148,109 +21452,19 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Breakpoint will only be hit in the specified thread(s). - Le point d'arrêt ne sera rencontré que dans le(s) thread(s) spécifié(s). - - - Breakpoints - Points d'arrêt - - - injection - injection - - - debugger call - appel au débogueur - - - Loading the custom dumper library '%1' (%2) ... - Chargement de la bibliothèque du collecteur de données personnalisé "%1" (%2)... - - - Loading of the custom dumper library '%1' (%2) failed: %3 - Échec du chargement de la bibliothèque du collecteur de données personnalisé "%1" (%2) : %3 - - - Loaded the custom dumper library '%1' (%2). - Bibliothèque du collecteur de données personnalisé "%1" chargée (%2). - - - Stopped / Custom dumper library initialized. - Stopped? - Collecteur de données personnalisé initialisé. - - - Disabling dumpers due to debuggee crash... - Désactive les collecteurs de données à cause d'un crash du débogué... - - - The debuggee does not appear to be Qt application. - Le débogué ne semble pas être une application Qt. - - - Initializing dumpers... - Initialise les collecteurs de données... - - - The custom dumper library could not be initialized: %1 - La bibliothèque de collecteurs de données personnalisé n'a pas pu être initialisé : %1 - - - Querying dumpers for '%1'/'%2' (%3) - Recherche de collecteur pour '%1'/"%2" (%3) - - - Cdb - Cdb + Le point d’arrêt ne sera rencontré que dans le(s) thread(s) spécifié(s). Startup - Placeholder Démarrage - - Additional &arguments: - &Arguments supplémentaires : - - - Debugger Paths - Chemins du débogueur - - - &Symbol paths: - Chemins des &symboles : - - - S&ource paths: - Chemins des s&ources : - - - Break on: - Point d'arrêt : - - - <html><head/><body><p>Use CDB's native console instead of Qt Creator's console for console applications. The native console does not prompt on application exit. It is suitable for diagnosing cases in which the application does not start up properly in Qt Creator's console and the subsequent attach fails.</p></body></html> - <html><head/><body><p>Utilisez la console native de CDB au lieu de celle de Qt Creator pour les applications en console. Cette console native ne prompte pas à la sortie de l'application. Elle est préférable pour diagnostiquer des cas dans lesquels l'application ne se lance pas correctement dans la console de Qt Creator et que les attachements à venir échouent. </p></body></html> - Use CDB &console Utiliser la &console CDB - - <html><head/><body><p>Attempt to correct the location of a breakpoint based on file and line number should it be in a comment or in a line for which no code is generated. The correction is based on the code model.</p></body></html> - <html><head/><body><p>Essaie de corriger l'emplacement d'un point d'arrêt selon le fichier et la ligne du fichier s'il est placé dans un commentaire ou une ligne ne générant pas de code. La correction est basée sur le modèle de code.</p></body></html> - Correct breakpoint location - Corriger l'emplacement du point d'arrêt - - - Break on functions: - Arrêt sur les fonctions : - - - This is useful to catch runtime error messages, for example caused by assert(). - Ceci est utile pour intercepter des messages d'erreur à l'exécution, par exemple ceux causés par assert(). + Corriger l’emplacement du point d’arrêt Various @@ -3258,64 +21472,16 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Ignore first chance access violations - Ignorer les violations d'accès à la première tentative - - - Symbol Server... - Serveur de symboles... - - - Adds the Microsoft symbol server providing symbols for operating system libraries.Requires specifying a local cache directory. - Ajoute le serveur de symboles Microsoft pour fournir les symboles des bibliothèques du système d'exploitation. Exige de spécifier un répertoire local de cache. - - - Symbol Cache... - Cache de symboles... + Ignorer les violations d’accès à la première tentative Uses a directory to cache symbols used by the debugger. Utilise un répertoire comme cache des symboles utilisés par le débogueur. - - <html><head/><body><p>The debugger is not configured to use the public <a href="%1">Microsoft Symbol Server</a>. This is recommended for retrieval of the symbols of the operating system libraries.</p><p><i>Note:</i> A fast internet connection is required for this to work smoothly. Also, a delay might occur when connecting for the first time.</p><p>Would you like to set it up?</p></body></html> - <html><head/><body><p>Le débogueur n'est pas configuré pour utiliser le <a href="%1">serveur de symbole de Microsoft</a> public. Cela est recommandé pour récupérer les symboles des bibliothèques du système d'exploitation.</p><p><i>Remarque :</i> une connexion internet rapide est nécessaire pour que cela fonctionne correctement. En outre, un retard peut se produire lors de la première connexion.</p><p>Voulez-vous le configurer ?</p></body></html> - - - <html><head/><body><p>The debugger is not configured to use the public <a href="%1">Microsoft Symbol Server</a>. This is recommended for retrieval of the symbols of the operating system libraries.</p><p><i>Note:</i> A fast internet connection is required for this to work smoothly. Also, a delay might occur when connecting for the first time.</p><p>Would you like to set it up?</p></br></body></html> - <html><head/><body><p>Le débogueur n'est pas configuré pour utiliser le <a href="%1">serveur de symbole Microsoft</a> public. Ceci est recommandé pour récupérer les symboles des bibliothèques du système d'exploitation.</p><p><i>Note :</i> une connexion internet rapide est requise pour que cela fonctione en douceur. Une attente peut également avoir lieu lors de la première connexion.</p><p>Souhaitez-vous le configurer ?</p></br></body></html> - - - Symbol Server - Serveur de symbole - - - Pick a local cache directory - Sélectionner un répertoire local de cache - - - Always Adjust Column Widths to Contents - Toujours ajuster la largeur des colonnes au contenu - - - Use Alternating Row Colors - Utiliser des couleurs de lignes alternées - - - Debugger Font Size Follows Main Editor - La taille de police du débogueur suit celle de l'éditeur principal - - - Show a Message Box When Receiving a Signal - Afficher un message à la réception d'un signal - Log Time Stamps Horodater le journal - - Verbose Log - Journal des opérations - Operate by Instruction Opérer par instruction @@ -3326,79 +21492,155 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Break on "abort" - S'arrêter sur "interrompre" + S’arrêter sur « interrompre » + + + Shows a warning when starting the debugger on a binary with insufficient debug information. + Affiche un avertissement lors du démarrage du débogueur sur un binaire dont les informations de débogage sont insuffisantes. + + + GDB commands entered here will be executed after GDB has been started, but before the debugged program is started or attached, and before the debugging helpers are initialized. + Les commandes GDB saisies ici seront exécutées après le démarrage de GDB, mais avant que le programme débogué ne soit lancé ou attaché, et avant que l’assistance au débogage ne soit initialisée. + + + GDB commands entered here will be executed after GDB has successfully attached to remote targets.</p><p>You can add commands to further set up the target here, such as "monitor reset" or "load". + Les commandes GDB saisies ici seront exécutées après que GDB se soit attaché avec succès aux cibles distantes. </p><p>Vous pouvez ajouter des commandes pour configurer davantage la cible ici, telles que « monitor reset » ou « load ». + + + Python commands entered here will be executed after built-in debugging helpers have been loaded and fully initialized. You can load additional debugging helpers or modify existing ones here. + Les commandes Python saisies ici seront exécutées après que l’assistance au débogage intégrée ait été chargée et entièrement initialisée. Vous pouvez charger des l’assistance au débogage supplémentaires ou modifier les assistances existantes ici. + + + Extra Debugging Helpers + Assistances au débogage supplémentaires + + + Path to a Python file containing additional data dumpers. + Chemin vers un fichier Python contenant des collecteurs de données supplémentaires. + + + Stopping and stepping in the debugger will automatically open views associated with the current location. + L’arrêt et le mode pas à pas dans le débogueur ouvrent automatiquement les vues associées à l’emplacement actuel. + + + Close temporary source views on debugger exit + Fermer les vues temporaires des sources à la sortie du débogueur + + + Closes automatically opened source views when the debugger exits. + Ferme les vues de source automatiquement ouvertes lorsque le débogueur se termine. + + + Close temporary memory views on debugger exit + Fermer les vues temporaires de la mémoire à la sortie du débogueur + + + Closes automatically opened memory views when the debugger exits. + Ferme les vues de la mémoire automatiquement ouvertes lorsque le débogueur se termine. + + + Enables a full file path in breakpoints by default also for GDB. + Active un chemin de fichier complet dans les points d’arrêt par défaut, y compris pour GDB. + + + Bring %1 to foreground when application interrupts + Ramener %1 au premier plan lorsque l’application s’interrompt + + + Debug all child processes + Déboguer tous les processus enfants + + + <html><head/><body>Keeps debugging all children after a fork.</body></html> + <html><head/><body>Continue à déboguer tous les enfants après un fork.</body></html> + + + GDB shows by default AT&&T style disassembly. + GDB affiche par défaut un désassemblage de type AT&&T. + + + Use annotations in main editor when debugging + Utiliser les annotations dans l’éditeur principal lors du débogage + + + Shows simple variable values as annotations in the main editor during debugging. + Affiche des valeurs de variables simples sous forme d’annotations dans l’éditeur principal pendant le débogage. + + + Use pseudo message tracepoints + Utiliser un pseudo-message de traçage + + + Uses Python to extend the ordinary GDB breakpoint class. + Utilise Python pour étendre la classe de points d’arrêt GDB ordinaires. + + + Use automatic symbol cache + Utiliser le cache de symboles automatique + + + It is possible for GDB to automatically save a copy of its symbol index in a cache on disk and retrieve it from there when loading the same binary in the future. + Il est possible pour GDB d’enregistrer automatiquement une copie de son index des symboles dans un cache sur le disque et d’y accéder à partir de là lors du chargement du même binaire à l’avenir. + + + Enables tooltips for variable values during debugging. Since this can slow down debugging and does not provide reliable information as it does not use scope information, it is switched off by default. + Active les infobulles pour les valeurs des variables pendant le débogage. Comme cela peut ralentir le débogage et ne fournit pas d’informations fiables puisqu’il n’utilise pas d’informations de contexte, cette option est désactivée par défaut. Use Tooltips in Locals View when Debugging - Utiliser les info-bulles dans la vue "variables locales" lors du débogage + Utiliser les info-bulles dans la vue « variables locales » lors du débogage + + + Enables tooltips in the locals view during debugging. + Active les infobulles dans les vues locales pendant le débogage. Use Tooltips in Breakpoints View when Debugging - Utiliser les info-bulles dans la vue des points d'arrêt lors du débogage + Utiliser les info-bulles dans la vue des points d’arrêt lors du débogage + + + Enables tooltips in the breakpoints view during debugging. + Active les info-bulles dans la vue des points d’arrêt lors du débogage. Use Tooltips in Stack View when Debugging Utiliser les info-bulles dans la vue de la pile lors du débogage - Checking this will enable tooltips in the stack view during debugging. - Cocher ceci activera les info-bulles dans la vue de la pile lors du débogage. + The maximum length for strings in separated windows. Longer strings are cut off and displayed with an ellipsis attached. + La longueur maximale des chaînes dans les fenêtres séparées. Les chaînes plus longues sont coupées et affichées avec des points de suspension. - Show Address Data in Breakpoints View when Debugging - Afficher l'adresse des données dans la vue des points d'arrêt lors du débogage + The number of seconds before a non-responsive GDB process is terminated. +The default value of 20 seconds should be sufficient for most +applications, but there are situations when loading big libraries or +listing source files takes much longer than that on slow machines. +In this case, the value should be increased. + Le nombre de secondes avant qu’un processus GDB ne réponde plus. +La valeur par défaut de 20 secondes devrait être suffisante pour la plupart +des applications. mais il existe des situations où le chargement de grosses bibliothèques +ou l’énumération de fichiers sources prend beaucoup plus de temps que cela sur des machines lentes. +Dans ce cas, la valeur doit être augmentée. - Show Address Data in Stack View when Debugging - Afficher l'adresse des données dans la vue de la pile lors du débogage - - - Watch Expression "%1" - Observer l'expression "%1" - - - Remove Watch Expression "%1" - Retirer "%1" des expressions observées - - - Watch Expression "%1" in Separate Window - Observer l'expression "%1" dans une fenêtre séparée + Shows QML object tree in Locals and Expressions when connected and not stepping. + Afficher l’arbre d’objets QML dans « Locales et expressions » lorsqu’il est connecté et non en pas-à-pas. Show "std::" Namespace in Types - Afficher l'espace de nommage "std::" dans les types + Afficher l’espace de nommage « std:: » dans les types Show Qt's Namespace in Types - Afficher l'espace de nommage Qt dans les types + Afficher l’espace de nommage Qt dans les types Use Debugging Helpers - Utiliser l'assistance au débogage - - - Debug Debugging Helpers - Déboguer l'assistance au débogage - - - Use Code Model - Utiliser le modèle de code + Utiliser l’assistance au débogage Selecting this causes the C++ Code Model being asked for variable scope information. This might result in slightly faster debugger operation but may fail for optimized code. - Selectionner cette option fait que l'information de contexte de la variable est demandée au modèle de code C++. Ceci peut résulter en des opérations de débogueur légèrement plus rapides mais risque d'échouer dans le cas de code optimisé. - - - Use Precise Breakpoints - Utiliser des points d'arrêt précis - - - Selecting this causes breakpoint synchronization being done after each step. This results in up-to-date breakpoint information on whether a breakpoint has been resolved after loading shared libraries, but slows down stepping. - Sélectionner cette option provoque une synchronisation des points d'arrêt après chaque étape. Par conséquent l'information concernant un point d'arrêt résolu après le chargement de bibliothèques dynamiques est à jour mais le pas à pas est plus lent. - - - This switches the Locals&&Watchers view to automatically dereference pointers. This saves a level in the tree view, but also loses data for the now-missing intermediate level. - Ceci active le déférencement automatique des pointeurs dans la vue "Variables locales et observateurs". Ceci réduit l'arbre d'un niveau mais certaines données sont cachées. + Sélectionner cette option fait que l’information de contexte de la variable est demandée au modèle de code C++. Ceci peut résulter en des opérations de débogueur légèrement plus rapides mais risque d’échouer dans le cas de code optimisé. Sort Members of Classes and Structs Alphabetically @@ -3406,35 +21648,27 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Adjust Breakpoint Locations - Ajuster les emplacements des points d'arrêt - - - Not all source code lines generate executable code. Putting a breakpoint on such a line acts as if the breakpoint was set on the next line that generated code. Selecting 'Adjust Breakpoint Locations' shifts the red breakpoint markers in such cases to the location of the true breakpoint. - Toutes les lignes de code n'ont pas généré du code exécutable. Mettre un point d'arrêt sur une telle ligne agit comme si le point d'arrêt était mis sur la ligne suivante qui a généré du code. Sélectionner "Ajuster les emplacements des points d'arrêt" déplace les marqueurs rouges de points d'arrêt dans de tels cas à l'emplacement réel du point d'arrêt. + Ajuster les emplacements des points d’arrêt Break on "throw" - S'arrêter sur "throw" + S’arrêter sur « throw » Break on "catch" - S'arrêter sur "catch" + S’arrêter sur « catch » Break on "qWarning" - S'arrêter sur "qWarning" + S’arrêter sur « qWarning » Break on "qFatal" - S'arrêter sur "qFatal" - - - Break on "raise" - S'arrêter sur "raise" + S’arrêter sur « qFatal » Use Dynamic Object Type for Display - Utilisez le type dynamique des objets pour l'affichage + Utilisez le type dynamique des objets pour l’affichage Automatically Quit Debugger @@ -3442,145 +21676,24 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Use tooltips in main editor when debugging - Utiliser les info-bulles dans l'éditeur principal lors du débogage - - - Checking this will enable tooltips for variable values during debugging. Since this can slow down debugging and does not provide reliable information as it does not use scope information, it is switched off by default. - Active les info-bulles sur les variables pendant le débogage. Comme ceci peut ralentir le débogage et ne fournit pas nécessairement des valeurs fiables, cette option est désactivée par défaut. - - - Use Tooltips in Locals View When Debugging - Utiliser les info-bulles dans la vue "variables locales" lors du débogage - - - Use Tooltips in Breakpoints View When Debugging - Utiliser les info-bulles dans la vue des points d'arrêt lors du débogage - - - Show Address Data in Breakpoints View When Debugging - Afficher l'adresse des données dans la vue des points d'arrêt lors du débogage - - - Show Address Data in Stack View When Debugging - Afficher les adresses des données dans la vue de la pile lors du débogage - - - List Source Files - Lister les fichiers source + Utiliser les info-bulles dans l’éditeur principal lors du débogage Skip Known Frames Sauter les frames connues - - Selecting this results in well-known but usually not interesting frames belonging to reference counting and signal emission being skipped while single-stepping. - Sélectionner cette option fait que les trames connues et présentant généralement peu d'intérêt telles que le comptage de référence ou les émissions de signaux soient passées lors d'un débogage pas à pas. - Enable Reverse Debugging Activer le débogage inversé - - Register For Post-Mortem Debugging - Activer le débogage post-mortem - Reload Full Stack - Recharger l'intégralité de la pile + Recharger l’intégralité de la pile Create Full Backtrace Créer une backtrace complète - - Execute Line - Exécuter la ligne - - - Change debugger language automatically - Changer le langage du débogueur automatiquement - - - Changes the debugger language according to the currently opened file. - Changer le langage du débogueur en fonction du fichier ouvert. - - - Use tooltips in locals view when debugging - Utiliser les info-bulles dans la vue "variables locales" lors du débogage - - - Checking this will enable tooltips in the locals view during debugging. - Cocher ceci activera les info-bulles dans la vue des variables locales lors du débogage. - - - Use tooltips in breakpoints view when debugging - Utiliser les info-bulles dans la vue des points d'arrêt lors du débogage - - - Checking this will enable tooltips in the breakpoints view during debugging. - Cocher ceci activera les info-bulles dans la vue des points d'arrêt lors du débogage. - - - Show address data in breakpoints view when debugging - Afficher l'adresse des données dans la vue des points d'arrêt lors du débogage - - - Checking this will show a column with address information in the breakpoint view during debugging. - Cocher ceci affichera l'adresse des données dans la vue des points d'arrêt lors du débogage. - - - Show address data in stack view when debugging - Afficher les adresses des données dans la vue de la pile lors du débogage - - - Checking this will show a column with address information in the stack view during debugging. - Cocher ceci affichera les adresses des données dans la vue de la pile lors du débogage. - - - Automatically quit debugger - Quitter le débogueur automatiquement - - - List source files - Lister les fichiers source - - - Skip known frames - Sauter les frames connues - - - Reload full stack - Recharger l'intégralité de la pile - - - Execute line - Exécuter la ligne - - - Debugging Helper - Assistance au débogage - - - Choose DebuggingHelper Location - Choisir l'emplacement de l'assistance au débogage - - - Ctrl+Shift+F11 - Ctrl+Maj+F11 - - - <html><head/><body> -<p>The debugging helper is only used to produce a nice display of objects of certain types like QString or std::map in the &quot;Locals and Expressions&quot; view. It is not strictly necessary for debugging with Qt Creator. </p></body></html> - <html><head/><body><p>L'assistant de débogage est utilisé uniquement pour un affichage amélioré de certains types d'objets comme QString ou std::map dans la vue "Locales et expressions". Il n'est pas strictement nécessaire pour le débogage avec Qt Creator. </p></body></html> - - - Use Debugging Helper - Utiliser l'assistance au débogage - - - Makes use of Qt Creator's code model to find out if a variable has already been assigned a value at the point the debugger interrupts. - Utilise le modèle de code de Qt Creator pour trouver si une valeur à déjà été assignée à une variable au point où le débogueur interrompt l'exécution. - Use code model Utiliser le modèle de code @@ -3593,224 +21706,211 @@ Pour plus de détails, voir /etc/sysctl.d/10-ptrace.conf Display thread names Affiches les noms des threads - - Show 'std::' prefix for types from the standard library. - Afficher le préfixe "std::" pour les types de la bibliothèque standard. - - - Show "std::" namespace for types - Afficher l'espace de noms "std::" pour les types - - - Show Qt namespace prefix for Qt types. This is only relevant if Qt was configured with '-qtnamespace'. - Afficher l'espace de noms de Qt pour les types de Qt. Ceci n'est valable que si Qt a été configuré avec l'option "-qtnamespace". - - - Show Qt's namespace for types - Afficher l'espace de noms de Qt pour les types - - - The Gdb process failed to start. Either the invoked program '%1' is missing, or you may have insufficient permissions to invoke the program. - Échec du démarrage du processus Gdb. Soit le programme "%1" est manquant, soit les droits sont insuffisants pour exécuter le programme. - - - The Gdb process crashed some time after starting successfully. - Le processus Gdb a crashé après avoir démarré correctement. - - - An error occurred when attempting to write to the Gdb process. For example, the process may not be running, or it may have closed its input channel. - Une erreur s'est produite lors d'une tentative d'écriture sur le processus Gdb. Le processus peut ne pas être démarré ou il peut avoir fermé son entrée standard. - - - An error occurred when attempting to read from the Gdb process. For example, the process may not be running. - Une erreur s'est produite lors d'une tentative de lecture depuis le processus Gdb. Le processus peut ne pas être en cours d'exécution. - Library %1 loaded. - Bibliothèque %1 chargée. + Bibliothèque %1 chargée. Library %1 unloaded. - Bibliothèque %1 déchargée. + Bibliothèque %1 déchargée. Thread group %1 created. - Group de thread %1 créé. + Groupe de threads %1 créé. Thread %1 created. - Thread %1 créé. + Thread %1 créé. Thread group %1 exited. - Groupe de thread %1 terminé. + Groupe de threads %1 terminé. Thread %1 in group %2 exited. - Thread %1 dans le groupe %2 terminé. + Thread %1 dans le groupe %2 terminé. Thread %1 selected. - Thread %1 sélecitonné. + Thread %1 sélectionné. Reading %1... - Lecture de %1... + Lecture de %1… + + + The gdb process failed to start. + Échec de démarrage du processus gdb. Stopping temporarily. - Arrêt temporaire. + Arrêt temporaire. + + + The gdb process has not responded to a command within %n seconds. This could mean it is stuck in an endless loop or taking longer than expected to perform the operation. +You can choose between waiting longer or aborting debugging. + + Le processus gdb n’a pas répondu a une commande en moins d’une seconde. Ceci peut signifier qu’il est bloqué dans une boucle infinie ou qu’il prend plus de temps que prévu pour exécuter l’opération. +Vous pouvez décider entre attendre plus longtemps ou mettre fin au débogage. + Le processus gdb n’a pas répondu a une commande en moins de %n secondes. Ceci peut signifier qu’il est bloqué dans une boucle infinie ou qu’il prend plus de temps que prévu pour exécuter l’opération. +Vous pouvez décider entre attendre plus longtemps ou mettre fin au débogage. + + + + GDB Not Responding + GDB ne répond pas + + + Give GDB More Time + Donner plus de temps à GDB + + + Stop Debugging + Arrêter le débogage + + + Setting Breakpoints Failed + La définition de points d’arrêt a échoué + + + Cannot jump. Stopped. + Impossible de sauter. Arrêté. Jumped. Stopped. - Sauté. Arrêté. + Sauté. Arrêté. - Processing queued commands. - Traite les commandes en file d'attente. + Target line hit, and therefore stopped. + Ligne cible atteinte, et donc arrêtée. - Loading %1... - Charge %1... + Application exited normally. + L’application s’est terminée normalement. - Stopped at breakpoint. - Arrêté au point d'arrêt. + The selected build of GDB supports Python scripting, but the used version %1.%2 is not sufficient for %3. Supported versions are Python 2.7 and 3.x. + La version sélectionnée de GDB prend en charge les scripts Python, mais la version utilisée %1.%2 n’est pas suffisante pour %3. Les versions prises en charge sont Python 2.7 et 3.x. - An unknown error in the Gdb process occurred. - Une erreur inconnue est survenue dans le processus Gdb. + Failed to Shut Down Application + Échec de la terminaison du programme - Running... - En cours d'éxecution... + There is no GDB binary available for binaries in format "%1". + Il n’y a pas de binaire GDB disponible pour les binaires au format « %1 ». + + + Retrieving data for stack view thread %1... + Collecte des données pour la vue de la pile du thread 0x%1… + + + No symbols found in the core file "%1". + Pas de symbole trouvé dans le fichier core « %1 ». + + + Try to specify the binary in Debug > Start Debugging > Load Core File. + Essayez d’indiquer le binaire dans Débogage -> Commencer le débogage -> Charger un fichier core. + + + No Remote Executable or Process ID Specified + Pas d’exécutable distant ou d’identifiant de processus spécifié + + + No remote executable could be determined from your build system files.<p>In case you use qmake, consider adding<p>&nbsp;&nbsp;&nbsp;&nbsp;target.path = /tmp/your_executable # path on device<br>&nbsp;&nbsp;&nbsp;&nbsp;INSTALLS += target</p>to your .pro file. + Aucun exécutable distant n’a pu être déterminé à partir des fichiers de votre système de compilation.<p>Dans le cas où vous utilisez qmake, pensez à ajouter <p>&nbsp;&nbsp;&nbsp;&nbsp;target.path = /tmp/votre_executable # chemin sur le périphérique<br>&nbsp;&nbsp;&nbsp;&nbsp;INSTALLS += target</p> à votre fichier .pro. + + + Continue Debugging + Continuer le débogage + + + Continuing nevertheless. + Continuant néanmoins. Stop requested... - Arrêt demandé... - - - Executable failed - Échec de l'exécutable + Arrêt demandé… Process failed to start. - Le processus n'a pu pas démarrer. + Le processus n’a pu pas démarrer. Executable failed: %1 - Échec de l'exécutable : %1 - - - Program exited with exit code %1. - Le programme s'est terminé avec le code de sortie %1. - - - Program exited after receiving signal %1. - Le programme s'est terminé après la reception du signal %1. - - - Program exited normally. - Le programme s'est terminé normallement. - - - The debugger you are using identifies itself as: - Le débogueur que vous utilisez s'identifie comme : - - - This version is not officially supported by Qt Creator. -Debugging will most likely not work well. -Using gdb 6.7 or later is strongly recommended. - Cette version n'est pas supportée officiellement par Qt Creator. -Le débogage ne fonctionnera probablement pas parfaitement. -L'utilisation de gdb 6.7 ou supérieur est recommandée. + Échec de l’exécutable : %1 Step requested... - Pas à pas demandé... - - - Step by instruction requested... - Pas à pas d'instruction demandé... + Pas à pas demandé… Finish function requested... - Finir la fonction demandé... + Finir la fonction demandé… Step next requested... - Étape suivante demandée... - - - Step next instruction requested... - Instruction suivante demandée... + Étape suivante demandée… Run to line %1 requested... - Exécuter jusque la ligne %1 demandé... + Exécuter jusque la ligne %1 demandé… Run to function %1 requested... - Exécution jusque la fonction %1 demandé... + Exécution jusque la fonction %1 demandé… Immediate return from function requested... - Retour immédiat de la fonction demandé... - - - ATTEMPT BREAKPOINT SYNC - ATTEMPT BREAKPOINT SYNC - - - Jumping out of bogus frame... - Sauter hors des frames buggées... - - - Dumper version %1, %n custom dumpers found. - - Collecteur version %1, %n collecteur personnalisé trouvé. - Collecteur version %1, %n collecteurs personnalisés trouvés. - + Retour immédiat de la fonction demandé… Disassembler failed: %1 Échec du désassemblage : %1 + + Cannot Find Debugger Initialization Script + Impossible de trouver les scripts d’initialisation du débogueur + + + The debugger settings point to a script file at "%1", which is not accessible. If a script file is not needed, consider clearing that entry to avoid this warning. + Les paramètres du débogueur référencent un fichier script à l’emplacement « %1 » qui n’est pas accessible. Si un fichier script n’est pas nécessaire, les paramètres pourraient être nettoyés pour éviter cet avertissement. + + + The working directory "%1" is not usable. + Le répertoire de travail « %1 » n’est pas utilisable. + GDB I/O Error - Erreur d'E/S GDB + Erreur d’E/S GDB + + + Adapter Start Failed + Le démarrage de l’adaptateur a échoué + + + Failed to Start Application + Échec au démarrage de l’application + + + Application started. + Application démarrée. + + + Application running. + Application en cours d’exécution. + + + Attached to stopped application. + Attaché à l’application arrêtée. Setting breakpoints... - Définit les points d'arrêts... - - - Starting inferior... - Démarrage de l'inférieur... - - - The debugging helper library was not found at %1. - La bibliothèque d'assistance au débogage n'a pas été trouvée à l'emplacement %1. - - - Unable to start gdb '%1': %2 - Impossible de démarrer gdb "%1" : %2 - - - Gdb I/O Error - Erreur d'E/S Gdb - - - Unexpected Gdb Exit - Arrêt inattendu de Gdb - - - The gdb process exited unexpectedly (%1). - Le processus de gdb s'est terminé de façon inattendue (%1). + Définition des points d’arrêts… Stopped at breakpoint %1 in thread %2. - Arrêté au point d'arrêt %1 dans le thread %2. + Arrêté au point d’arrêt %1 dans le thread %2. Snapshot Creation Error @@ -3820,175 +21920,21 @@ L'utilisation de gdb 6.7 ou supérieur est recommandée. Cannot create snapshot file. Impossible de créer un fichier snapshot. - - Cannot create snapshot: - - Impossible de créer le snapshot : - - - - Snapshot Reloading - Recharger le snapshot - - - In order to load snapshots the debugged process needs to be stopped. Continuation will not be possible afterwards. -Do you want to stop the debugged process and load the selected snapshot? - Pour charger des snapshots, le processus débogué doit être arrêté. Il sera impossible de continuer par la suite. -Voulez vous arrêter le processus débogué et charger le snapshot selectionné ? - - - Finished retrieving data - Collecte des données terminée - - - crashed - crashé - - - code %1 - code %1 - - - Inferior start failed - Démarrage de l'inférieur échoué - - - Inferior shutdown failed - Arrêt de l'inférieur échoué - - - Adapter crashed - Adaptateur crashé - - - Cannot find debugger initialization script - Impossible de trouver les scripts d'initialisation du débogueur - - - The gdb process failed to start. Either the invoked program '%1' is missing, or you may have insufficient permissions to invoke the program. -%2 - Le processus gdb n'a pas pu démarrer. Soit le programme '%1' est manquant, soit vous n'avez pas les permissions nécessaires pour l'invoquer. -%2 - - - The gdb process crashed some time after starting successfully. - Le processus gdb a crashé peu de temps après avoir démarré avec succès. - - - The gdb process was ended forcefully - Le processus gdb a été forcé de fermer - - - An error occurred when attempting to write to the gdb process. For example, the process may not be running, or it may have closed its input channel. - Une erreur s'est produite lors d'une tentative d'écriture sur le processus gdb. Par exemple, le processus peut ne pas être démarré ou avoir fermé son canal d'entrée. - - - An error occurred when attempting to read from the gdb process. For example, the process may not be running. - Une erreur s'est produite lors d'une tentative d'écriture sur le processus gdb. Par exemple, le processus peut ne pas être démarré. - - - An unknown error in the gdb process occurred. - Une erreur inconnue s'est produite dans le processus gdb. - - - The gdb process has not responded to a command within %n second(s). This could mean it is stuck in an endless loop or taking longer than expected to perform the operation. -You can choose between waiting longer or abort debugging. - - Le processus gdb n'a pas répondu a une commande en moins de %n seconde. Ceci peut signifier qu'il est bloqué dans une boucle infinie ou qu'il prend plus de temps que prévu pour exécuter l'opération. -Vous pouvez décider entre attendre plus longtemps ou mettre fin au débogage. - Le processus gdb n'a pas répondu a une commande en moins de %n secondes. Ceci peut signifier qu'il est bloqué dans une boucle infinie ou qu'il prend plus de temps que prévu pour exécuter l'opération. -Vous pouvez décider entre attendre plus longtemps ou mettre fin au débogage. - - - - GDB not responding - GDB ne répond pas - - - Give GDB more time - Donner plus de temps à GDB - Value changed from %1 to %2. - Valeur changée de %1 à %2. - - - There is no gdb binary available for binaries in format '%1' - Il n'y a pas de binaire gdb disponible pour les binaires au format "%1" - - - The GDB installed at %1 cannot find a valid python installation in its %2 subdirectory. -You may set the environment variable PYTHONPATH to point to your installation. - Le GDB installé en %1 ne peut pas trouver une installation valide de Python dans son sous-répertoire %2. -Vous devriez définir la variable d'environnement PYTHONPATH pour pointer sur votre installation. - - - The debugger settings point to a script file at '%1' which is not accessible. If a script file is not needed, consider clearing that entry to avoid this warning. - Les paramètres du débogueur référencent un fichier script à l'emplacement "%1' qui n'est pas accessible. Si un fichier script n"est pas nécessaire, les paramètres pourraient être nettoyés pour éviter cet avertissement. - - - Unable to run '%1': %2 - Impossible d'exécuter "%1" : %2 - - - The Gdb process failed to start. Either the invoked program '%1' is missing, or you may have insufficient permissions to invoke the program. -%2 - Échec du démarrage du processus Gdb. Soit le programme '%1' est manquant, soit les droits sont insuffisants pour exécuter le programme. -%2 + Valeur changée de %1 à %2. An exception was triggered. Une exception a été déclenchée. - - An exception was triggered: - Une exception a été déclenchée : - - - Library %1 loaded - Bibliothèque %1 chargée - - - Library %1 unloaded - Bibliothèque %1 déchargée - - - Thread group %1 created - Group de thread %1 créé - - - Thread %1 created - Thread %1 créé - - - Thread group %1 exited - Groupe de thread %1 terminé - - - Thread %1 in group %2 exited - Thread %1 dans le groupe %2 terminé - - - Thread %1 selected - Thread %1 sélectionné - - - Missing debug information for %1 -Try: %2 - Informations de débogage manquantes pour %1 -Essayez : %2 - Stopping temporarily Arrêt temporaire - - Processing queued commands - Traite les commandes en file d'attente - Failed to start application: - Impossible de démarrer l'application : + Impossible de démarrer l’application : The gdb process could not be stopped: @@ -3998,19 +21944,7 @@ Essayez : %2 Application process could not be stopped: %1 - Le processus de l'application ne peut être arrêté : %1 - - - Application started - Démarrage de l'application - - - Application running - Application en cours d'exécution - - - Attached to stopped application - Attachés à l'application arrêtée + Le processus de l’application ne peut être arrêté : %1 Connecting to remote server failed: @@ -4018,84 +21952,149 @@ Essayez : %2 La connexion au serveur distant a échoué : %1 - - The gdb process has not responded to a command within %1 seconds. This could mean it is stuck in an endless loop or taking longer than expected to perform the operation. -You can choose between waiting longer or abort debugging. - Le processus n'a pas répondu a une commande en moins de %1 secondes. Ceci peut signifier qu'il est bloqué dans une boucle infinie ou qu'il prend plus de temps que prévu pour exécuter l'opération. -Vous pouvez décider entre attendre plus longtemps ou mettre fin au débogage. - - - Gdb not responding - Gdb ne répond pas - - - Give gdb more time - Laisser plus de temps à gdb - - - Stop debugging - Arrêter le débogage - - - Process failed to start - Le processus n'a pu pas démarrer - - - Setting breakpoints failed - La définition de points d'arrêt a échoué - Executable Failed - Échec de l'exécutable - - - Jumped. Stopped - Sauté. Arrêté - - - Target line hit. Stopped - Ligne cible atteinte. Arrêté + Échec de l’exécutable Application exited with exit code %1 - L'application s'est terminée avec le code de sortie %1 + L’application s’est terminée avec le code de sortie %1 Application exited after receiving signal %1 - L'application s'est terminée après la reception du signal %1 - - - Application exited normally - L'application s'est terminée normalement - - - Watchpoint %1 at %2 triggered: - Observe %1 au déclenchement de %2 : - - - Stopped at breakpoint %1 in thread %2 - Arrêté au point d'arrêt %1 dans le thread %2. {1 ?} {2?} - - - Stopped: %1 by signal %2 - Arrêté : %1 par le signal %2 - - - Raw structure - ou brute ? - Structure simple + L’application s’est terminée après la reception du signal %1 Normal Normal - Displayed - Affiché + Execution Error + Erreur d’exécution - Execution Error - Erreur d'exécution + Internal error: Invalid TCP/IP port specified %1. + Erreur interne : le port TCP/IP spécifié %1 n’est pas valide. + + + Internal error: No uVision executable specified. + Erreur interne : aucun exécutable uVision n’est indiqué. + + + Internal error: The specified uVision executable does not exist. + Erreur interne : l’exécutable uVision indiqué n’existe pas. + + + Internal error: Cannot resolve the library: %1. + Erreur interne : impossible de résoudre la bibliothèque : %1. + + + UVSC Version: %1, UVSOCK Version: %2. + Version d’UVSC : %1, version d’UVSOCK : %2. + + + Internal error: Cannot open the session: %1. + Erreur interne : impossible d’ouvrir la session : %1. + + + Internal error: Failed to start the debugger: %1 + Erreur interne : échec du démarrage du débogueur : %1 + + + UVSC: Starting execution failed. + UVSC : le démarrage de l’exécution a échoué. + + + UVSC: Stopping execution failed. + UVSC : l’arrêt de l’exécution a échoué. + + + UVSC: Setting local value failed. + UVSC : la définition de la valeur locale a échoué. + + + UVSC: Setting watcher value failed. + UVSC : la définition de la valeur de l’observateur a échoué. + + + UVSC: Disassembling by address failed. + UVSC : le désassemblage par adresse a échoué. + + + UVSC: Changing memory at address 0x%1 failed. + UVSC : le changement de mémoire à l’adresse 0x%1 a échoué. + + + UVSC: Fetching memory at address 0x%1 failed. + UVSC : la réception de la mémoire à l’adresse 0x%1 a échoué. + + + Internal error: The specified uVision project options file does not exist. + Erreur interne : le fichier d’options du projet uVision indiqué n’existe pas. + + + Internal error: The specified uVision project file does not exist. + Erreur interne : le fichier de projet uVision indiqué n’existe pas. + + + Internal error: Unable to open the uVision project %1: %2. + Erreur interne : impossible d’ouvrir le projet uVision %1 : %2. + + + Internal error: Unable to set the uVision debug target: %1. + Erreur interne : impossible de définir la cible de débogage d’uVision : %1. + + + Internal error: The specified output file does not exist. + Erreur interne : le fichier de sortie indiqué n’existe pas. + + + Internal error: Unable to set the uVision output file %1: %2. + Erreur interne : impossible de définir le fichier de sortie uVision %1 : %2. + + + UVSC: Reading registers failed. + UVSC : la lecture des registres a échoué. + + + UVSC: Fetching peripheral register failed. + UVSC : la réception du registre périphérique a échoué. + + + UVSC: Locals enumeration failed. + UVSC : l’énumération des locales a échoué. + + + UVSC: Watchers enumeration failed. + UVSC : l’énumération des observateurs a échoué. + + + UVSC: Inserting breakpoint failed. + UVSC : l’insertion du point d’arrêt a échoué. + + + UVSC: Removing breakpoint failed. + UVSC : la suppression du point d’arrêt a échoué. + + + UVSC: Enabling breakpoint failed. + UVSC : l’activation du point d’arrêt a échoué. + + + UVSC: Disabling breakpoint failed. + UVSC : la désactivation du point d’arrêt a échoué. + + + Failed to initialize the UVSC. + Échec de l’initialisation d’UVSC. + + + Failed to de-initialize the UVSC. + Échec de la désinitialisation d’UVSC. + + + Failed to run the UVSC. + Échec à l’exécution de l’UVSC. Cannot continue debugged process: @@ -4104,16 +22103,9 @@ Vous pouvez décider entre attendre plus longtemps ou mettre fin au débogage. - Failed to shut down application - Échec de la terminaison du programme - - - There is no gdb binary available for '%1' - Il n'y a pas de binaire de gdb disponible pour "%1" - - - Continuing after temporary stop... - Continue après un arrêt temporaire... + Cannot stop debugged process: + + Impossible d’arrêter le processus débogué : Cannot Read Symbols @@ -4121,169 +22113,40 @@ Vous pouvez décider entre attendre plus longtemps ou mettre fin au débogage. Cannot read symbols for module "%1". - Impossible de lire les symboles du module "%1". - - - Retrieving data for stack view thread 0x%1... - Collecte des données pour la vue de la pile du thread 0x%1... - - - Cannot read widget data: %1 - Impossible de lire les données du widget : %1 + Impossible de lire les symboles du module « %1 ». Could not find a widget. - Impossible de trouver un widget. - - - The gdb location must be given as an absolute path in the debugger settings (%1). - L'emplacement de GDB doit être donné comme un chemin absolu dans les paramètres du débogueur (%1). - - - The GDB installed at %1 cannot find a valid python installation in its subdirectories. -You may set the environment variable PYTHONPATH to point to your installation. - Le GDB installé en %1 ne peut pas trouver une installation valide de Python dans son sous-répertoire. -Vous devriez définir la variable d'environnement PYTHONPATH pour pointer sur votre installation. - - - The gdb process crashed. - Le processus gdb a crashé. - - - The gdb process exited unexpectedly (code %1) - Le processus de gdb s'est terminé de façon inattendue (%1) - - - Unexpected GDB Exit - Arrêt inattendu de GDB + Impossible de trouver un widget. Setting up inferior... - Mise en place de l'inférieur... - - - The gdb process failed to start. Either the invoked program "%1" is missing, or you may have insufficient permissions to invoke the program. -%2 - Le processus gdb n'a pas pu démarrer. Soit le programme "%1" est manquant, soit vous n'avez pas les permissions nécessaires pour l'invoquer. -%2 - - - An unknown error in the gdb process occurred. - Une erreur inconnue est survenue dans le processus gdb. + Mise en place de l’inférieur… An exception was triggered: Une exception a été déclenchée : - - The gdb process has not responded to a command within %n second(s). This could mean it is stuck in an endless loop or taking longer than expected to perform the operation. -You can choose between waiting longer or aborting debugging. - - Le processus gdb n'a pas répondu à une commande en moins de %n seconde. Ceci peut signifier qu'il est bloqué dans une boucle infinie ou qu'il prend plus de temps que prévu pour exécuter l'opération. -Vous pouvez décider d'attendre plus longtemps ou mettre fin au débogage. - Le processus gdb n'a pas répondu à une commande en moins de %n secondes. Ceci peut signifier qu'il est bloqué dans une boucle infinie ou qu'il prend plus de temps que prévu pour exécuter l'opération. -Vous pouvez décider d'attendre plus longtemps ou mettre fin au débogage. - - Cannot continue debugged process: Impossible de continuer le processus débogué : - - There is no GDB binary available for binaries in format '%1' - Il n'y a pas de binaire gdb disponible pour les binaires au format "%1" - Cannot create snapshot: Impossible de créer le snapshot : - - The gdb process terminated. - Le processus gdb s'est terminé. - - - The gdb process terminated unexpectedly (code %1) - Le processus gdb s'est terminé de façon inattendue (code %1) - - - Failed to start application: - Impossible de démarrer l'application : - - - Failed to start application - Impossible de démarrer l'application - - - <unknown> - <inconnue> - Retrieving data for stack view... - Collecte des données pour la vue de la pile... - - - Retrieving data for watch view (%n requests pending)... - - Collecte des données pour la vue des observateurs (%n requête restante)... - Collecte des données pour la vue des observateurs (%n requêtes restantes)... - + Réception des données pour la vue de la pile… Finished retrieving data. - Collecte des données terminée. - - - Debugging helpers not found. - Assistance au débogage non trouvée. - - - Custom dumper setup: %1 - Configuration du collecteur pesonnalisé : %1 - - - <0 items> - <0 éléments> - - - <shadowed> - Type of local variable or parameter shadowed by another variable of the same name in a nested block. - <%n élément> - - - Debugging helpers: Qt version mismatch - Assistants de débogage : les versions de Qt ne correspondent pas - - - The Qt version used to build the debugging helpers (%1) does not match the Qt version used to build the debugged application (%2). -This might yield incorrect results. - La version de Qt utilisée pour la compilation des assistants de débogage (%1) ne correspond pas à la version de Qt utilisée pour compiler l'application à déboguer (%2). -Ceci pourrait amener à des résultats incorrects. - - - <n/a> - <%n élément> - - - <anonymous union> - <union anonyme> - - - <no information> - About variable's value - <aucune information> + Réception des données terminée. GDB timeout: Délai GDB : - - This is the number of seconds Qt Creator will wait before -it terminates a non-responsive GDB process. The default value of 20 seconds -should be sufficient for most applications, but there are situations when -loading big libraries or listing source files takes much longer than that -on slow machines. In this case, the value should be increased. - Ceci est le nombre de secondes que Qt Creator attendra avec de terminer un processus GDB qui ne répond pas. La valeur par défaut est de vingt secondes et elle devrait suffire pour la plupart des applications, mais il y a des situations où le chargement de grosses bibliothèques ou le listing des fichiers source prend beaucoup de temps. Dans ce cas, cette valeur devrait être augmentée. - sec sec @@ -4292,34 +22155,9 @@ on slow machines. In this case, the value should be increased. Skip known frames when stepping Passer les trames connues en pas à pas - - Allows 'Step Into' to compress several steps into one step -for less noisy debugging. For example, the atomic reference -counting code is skipped, and a single 'Step Into' for a signal -emission ends up directly in the slot connected to it. - Permet à 'Entrer dans' de compresser plusieurs étapes en une seule pour un débogage avec moins de bruit. Par exemple, le code de comptage de références atomiques est ignoré et un seul 'Entrer dans' sur le point d'émission d'un signal se terminera directement dans le slot connecté à celui-ci. - Show a message box when receiving a signal - Afficher un message à la réception d'un signal - - - This will show a message box as soon as your application -receives a signal like SIGSEGV during debugging. - Ceci affichera un message dès que votre application reçoit un signal comme SIGSEGV pendant le débogage. - - - The number of seconds Qt Creator will wait before it terminates -a non-responsive GDB process. The default value of 20 seconds should -be sufficient for most applications, but there are situations when -loading big libraries or listing source files takes much longer than -that on slow machines. In this case, the value should be increased. - Nombre de secondes que Qt Creator attendra avant -de clore un processus gdb qui ne répond pas. La valeur par défaut de 20 -secondes devrait suffire pour la plupart des applications, mais il peut arriver -que le chargement de grosses bibliothèques ou le listage de fichiers sources -prenne plus de temps sur des machines lentes. Dans ce cas, cette valeur -devra être augmentée. + Afficher un message à la réception d’un signal <html><head/><body><p>Allows <i>Step Into</i> to compress several steps into one step @@ -4328,8 +22166,8 @@ counting code is skipped, and a single <i>Step Into</i> for a signal emission ends up directly in the slot connected to it. <html><head/><body><p>Permet à <i>Entrer dans</i> de compresser plusieurs étapes en une seule pour un débogage moins nuisible. Par exemple, le comptage -de code atomique est ignorée et un seul <i>Entrer dans</i> pour l'émission -d'un signal terminera directement dans le slot connecté à celui-ci. +de code atomique est ignorée et un seul <i>Entrer dans</i> pour l’émission +d’un signal terminera directement dans le slot connecté à celui-ci. Displays a message box as soon as your application @@ -4337,9 +22175,101 @@ receives a signal like SIGSEGV during debugging. Affiche un message dès que votre application reçoit un signal comme SIGSEGV pendant le débogage. + + Configure Debugger... + Configurer le débogueur… + + + Always Adjust View Column Widths to Contents + Toujours adapter la largeur des colonnes d’affichage au contenu + + + Keep editor stationary when stepping + Conserver l’éditeur stationnaire lors du mode pas à pas + + + Scrolls the editor only when it is necessary to keep the current line in view, instead of keeping the next statement centered at all times. + Fait défiler l’éditeur uniquement lorsqu’il est nécessaire de conserver la ligne en cours dans la vue, au lieu de conserver la déclaration suivante centrée en permanence. + + + Force logging to console + Forcer la journalisation vers la console + + + Sets QT_LOGGING_TO_CONSOLE=1 in the environment of the debugged program, preventing storing debug output in system logs. + Définit QT_LOGGING_TO_CONSOLE=1 dans l’environnement du programme débogué, empêchant le stockage de la sortie de débogage dans les journaux du système. + + + Changes the font size in the debugger views when the font size in the main editor changes. + Modifie la taille de la police dans les vues du débogueur lorsque la taille de la police dans l’éditeur principal change. + + + This switches the Locals and Expressions views to automatically dereference pointers. This saves a level in the tree view, but also loses data for the now-missing intermediate level. + Cela permet aux vues « Locales et expressions x de déréférencer automatiquement les pointeurs. Cela permet d’économiser un niveau dans l’arborescence, mais cela perd des données pour le niveau intermédiaire manquant. + + + Additional arguments: + Arguments supplémentaires : + + + Catches runtime error messages caused by assert(), for example. + Capture les messages d’erreur d’exécution causés par assert(), par exemple. + + + Uses CDB's native console for console applications. This overrides the setting in Environment > System. The native console does not prompt on application exit. It is suitable for diagnosing cases in which the application does not start up properly in the configured console and the subsequent attach fails. + Utilise la console native de CDB pour les applications de console. Cette option remplace le paramètre défini dans Environnement > Système. La console native n’invite pas à quitter l’application. Elle convient pour diagnostiquer les cas où l’application ne démarre pas correctement dans la console configurée et où l’attachement ultérieur échoue. + + + Attempts to correct the location of a breakpoint based on file and line number should it be in a comment or in a line for which no code is generated. The correction is based on the code model. + Tente de corriger l’emplacement d’un point d’arrêt en fonction du fichier et du numéro de ligne s’il se trouve dans un commentaire ou dans une ligne pour laquelle aucun code n’est généré. La correction est basée sur le modèle de code. + + + Use Python dumper + Utiliser le collecteur Python + + + First chance exceptions + Exceptions de première chance + + + Second chance exceptions + Exceptions de deuxième chance + + + Show "std::" namespace in types + Afficher l’espace de noms « std:: » dans les types + + + Shows "std::" prefix for types from the standard library. + Affiche le préfixe « std:: » pour les types de la bibliothèque standard. + + + Show Qt's namespace in types + Afficher l’espace de noms de Qt dans les types + + + Shows Qt namespace prefix for Qt types. This is only relevant if Qt was configured with "-qtnamespace". + Affiche le préfixe de l’espace de noms Qt pour les types Qt. Ceci n’est pertinent que si Qt a été configuré avec « -qtnamespace ». + + + Show QObject names if available + Afficher les noms des QObject s’ils sont disponibles + + + Displays the objectName property of QObject based items. Note that this can negatively impact debugger performance even if no QObjects are present. + Affiche la propriété nomObjet des éléments basés sur QObject. Notez que cela peut avoir un impact négatif sur les performances du débogueur, même si aucun QObject n’est présent. + + + Sort members of classes and structs alphabetically + Trier les membres des classes et des structures par ordre alphabétique + + + <p>Not all source code lines generate executable code. Putting a breakpoint on such a line acts as if the breakpoint was set on the next line that generated code. Selecting 'Adjust Breakpoint Locations' shifts the red breakpoint markers in such cases to the location of the true breakpoint. + <p>Toutes les lignes du code source ne génèrent pas de code exécutable. Le fait de placer un point d’arrêt sur une telle ligne agit comme si le point d’arrêt était placé sur la ligne suivante qui génère du code. En sélectionnant « Ajuster les emplacements des points d’arrêt », les marqueurs rouges des points d’arrêt sont déplacés vers l’emplacement du véritable point d’arrêt. + Adjust breakpoint locations - Ajuster les emplacements des points d'arrêt + Ajuster les emplacements des points d’arrêt GDB allows setting breakpoints on source lines for which no code @@ -4347,174 +22277,82 @@ was generated. In such situations the breakpoint is shifted to the next source code line for which code was actually generated. This option reflects such temporary change by moving the breakpoint markers in the source code editor. - GDB autorise l'ajout de points d'arrêt sur des lignes de source pour lesquelles aucun code n'a été généré. Dans de telles situations, le point d'arrêt est décalé à la ligne de code suivante pour laquelle du code a été généré. Cette option affiche ces changements temporaires en déplaçant le marqueur dans l'éditeur de code source. + GDB autorise l’ajout de points d’arrêt sur des lignes de source pour lesquelles aucun code n’a été généré. Dans de telles situations, le point d’arrêt est décalé à la ligne de code suivante pour laquelle du code a été généré. Cette option affiche ces changements temporaires en déplaçant le marqueur dans l’éditeur de code source. + + + Uses the default GDB pretty printers installed in your system or linked to the libraries your application uses. + Utilise l’affichage amélioré par défaut de GDB installé sur votre système ou lié aux bibliothèques utilisées par votre application. + + + <html><head/><body>Adds common paths to locations of debug information such as <i>/usr/src/debug</i> when starting GDB.</body></html> + <html><head/><body>Ajoute des chemins communs aux emplacements des informations de débogage telles que <i>/usr/src/debug</i> lors du démarrage de GDB.</body></html> Use dynamic object type for display - Utilisez le type dynamique des objets pour l'affichage + Utiliser le type dynamique des objets pour l’affichage Specifies whether the dynamic or the static type of objects will be displayed. Choosing the dynamic type might be slower. - Indique s'il faut afficher le type dynamique ou le type statique des objets. Choisir le type dynamique pourrait être plus lent. + Indique s’il faut afficher le type dynamique ou le type statique des objets. Choisir le type dynamique pourrait être plus lent. Allows or inhibits reading the user's default .gdbinit file on debugger startup. Permettre ou empêcher la lecture du fichier .gdbinit -par défaut de l'utilisateur au démarrage du débogueur. +par défaut de l’utilisateur au démarrage du débogueur. Load system GDB pretty printers - Charge le système d'affichage amélioré - - - Uses the default GDB pretty printers installed in your system or linked to the libraries your application uses. - - Utilise l'affichage amélioré par défaut de GDB installé sur votre système ou lié aux bibliothèques utilisées par votre application. + Charger le système d’affichage amélioré Use Intel style disassembly - Utilise le désassemblage avec le style Intel - - - <html><head/><body>GDB shows by default AT&&T style disassembly.</body></html> - <html><head/><body>GDB montre par défaut le désassemblage avec le style AT&&T.</body></html> - - - Create tasks from missing packages - Créer des tâches pour les paquets manquants - - - <html><head/><body><p>Attempts to identify missing debug info packages and lists them in the Issues output pane.</p><p><b>Note:</b> This feature needs special support from the Linux distribution and GDB build and is not available everywhere.</p></body></html> - <html><head/><body><p>Tenter d'identifier les informations manquantes de débogage des paquets et les lister dans le panneau de sortie Problèmes.</p><p><b>Note :</b> cette fonctionnalité nécessite d'être supportée spécialement par la distribution Linux et par GDB et n'est pas disponible partout.</p></body></html> + Utiliser le désassemblage avec le style Intel <p>To execute simple Python commands, prefix them with "python".</p><p>To execute sequences of Python commands spanning multiple lines prepend the block with "python" on a separate line, and append "end" on a separate line.</p><p>To execute arbitrary Python scripts, use <i>python execfile('/path/to/script.py')</i>.</p> - <p>Pour exécuter de simples commandes Python, préfixez les avec "python".</p><p>Pour exécuter des séquences de commandes Python sur plusieurs lignes, débutez le bloc avec "python" sur une ligne distincte et terminer avec "fin" sur une ligne distincte.</p><p>Pour exécuter n'importe quel script Python, utilisez <i>python execfile('/path/to/script.py')</i>.</p> + <p>Pour exécuter de simples commandes Python, préfixez les avec « python ».</p><p>Pour exécuter des séquences de commandes Python sur plusieurs lignes, débutez le bloc avec « python » sur une ligne distincte et terminer avec « end » sur une ligne distincte.</p><p>Pour exécuter n’importe quel script Python, utilisez <i>python execfile('/path/to/script.py')</i>.</p> - <html><head/><body><p>GDB commands entered here will be executed after GDB has been started, but before the debugged program is started or attached, and before the debugging helpers are initialized.</p>%1</body></html> - <html><head/><body><p>Les commandes GDB entrées ici seront exécutées après que GDB a été lancé, mais avant que le programme à déboguer ne soit démarré ou attaché et avant que les assistants de débogage ne soient initialisés.</p>%1</body></html> + The options below give access to advanced<br>or experimental functions of GDB.<p>Enabling them may negatively impact<br>your debugging experience. + Les options ci-dessous permettent d’accéder<br>à des fonctions avancées ou expérimentales de GDB.<p>Leur activation peut avoir un impact négatif<br>sur votre expérience de débogage. Additional Attach Commands - Commandes attachées additionnelles - - - <html><head/><body><p>GDB commands entered here will be executed after GDB has successfully attached to remote targets.</p><p>You can add commands to further set up the target here, such as "monitor reset" or "load".</body></html> - missing </p> in source - <html><head/><body><p>Les commandes GDB entrées ici seront exécutées après que GDB soit attaché avec succès à des cibles distantes.</p><p>Vous pouvez ajouter des commandes pour configurer le cible ici, comme "monitor reset" ou "load".</p></body></html> + Commandes attachées supplémentaires Debugging Helper Customization - Personnalisation de l'assistance au débogage - - - <html><head/><body><p>GDB commands entered here will be executed after Qt Creator's debugging helpers have been loaded and fully initialized. You can load additional debugging helpers or modify existing ones here.</p>%1</body></html> - <html><head/><body><p>Les commandes GDB entrées ici seront exécutées après que les assistants de débogage de Qt Creator ont été chargés et entièrement initialisés. Vous pouvez charger des assistants de débogage supplémentaires ou modifier les existant ici.</p>%1</body></html> + Personnalisation de l’assistance au débogage Extended Extensions - - Debug all children - Déboguer tous les enfants - - - <html><head/><body>Keep debugging all children after a fork.</body></html> - <html><head/><body>Continuer le débogage tous les enfants après un fork.</body></html> - - - <html><head/><body>Add common paths to locations of debug information such as <i>/usr/src/debug</i> when starting GDB.</body></html> - <html><head/><body>Ajouter les chemins habituels de localisation des informations de débogage, tels que <i>/usr/src/debug</i> lors du démarrage de GDB.</body></html> - - - <html><head/><body><p>Enable stepping backwards.</p><p><b>Note:</b> This feature is very slow and unstable on the GDB side. It exhibits unpredictable behavior when going backwards over system calls and is very likely to destroy your debugging session.</p></body></html> - <html><head/><body><p>Activer le mode pas-à-pas en arrière.</p><p><b>Remarque :</b> cette fonction est très lente et instable du côté de GDB. Elle présente un comportement imprévisible lors d'un retour sur les appels système et est fortement susceptible de détruire votre session de débogage.</p></body></html> - - - Attempt quick start - Tentative de démarrage rapide - - - <html><head/><body>Postpone reading debug information as long as possible. This can result in faster startup times at the price of not being able to set breakpoints by file and number.</body></html> - <html><head/><body>Retarder la lecture des informations de débogage dans la mesure du possible. Cela peut entraîner des temps de démarrage plus rapide au risque de ne pas être en mesure de définir les points d'arrêt par fichier et par numéro.</body></html> - - - This specifies whether the dynamic or the static type of objects will bedisplayed. Choosing the dynamic type might be slower. - Ceci indique s'il faut afficher le type dynamique ou le type statique des objets. Choisir le type dynamique pourrait s'avérer plus lent. - Load .gdbinit file on startup Charger .gdbinit au chargement - - This allows or inhibits reading the user's default -.gdbinit file on debugger startup. - Permet ou empêche la lecture du fichier .gbdinit par défaut de l'utilisateur au démarrage du débogueur. - - - The options below should be used with care. - L'option ci-dessous doit être utilisé avec précaution. - - - <html><head/><body>The options below give access to advanced or experimental functions of GDB. Enabling them may negatively impact your debugging experience.</body></html> - <html><head/><body>Les options ci-dessous donnent accès à des fonctions avancées ou expérimentales de GDB. Les activer peut nuire à votre expérience de débogage.</body></html> - Use asynchronous mode to control the inferior - Utiliser un mode asynchrone pour contrôler l'inférieur + Utiliser un mode asynchrone pour contrôler l’inférieur Use common locations for debug information - Utiliser les emplacements courants pour les informations de debogage - - - This adds common paths to locations of debug information -at debugger startup. - Cela ajoute les chemins courants dans les emplacements des informations de débogage au démarage du débogueur. - - - Stop when a qWarning is issued - Arrêt lorsqu'un qWarning est atteint - - - Stop when a qFatal is issued - Arrêt lorsqu'un qWarning est atteint - - - Stop when raise() is called - Arrêt lorsque raise() est appelé + Utiliser les emplacements actuels pour les informations de débogage Enable reverse debugging Activer le débogage inversé - - <html><head/><body><p>Selecting this enables reverse debugging.</p><.p><b>Note:</b> This feature is very slow and unstable on the GDB side.It exhibits unpredictable behavior when going backwards over system calls and is very likely to destroy your debugging session.</p><body></html> - <html><head/><body><p>Sélectionner cette option active le débogage inverse.</p><.p><b>Note :</b> Cette fonctionnalité est très lente et instable pour GDB. Elle présente des comportements imprévisible lors d'un retour sur des appel système et peut détruire votre session de débogage.</p><body></html> - Additional Startup Commands - Commandes supplémantaires de démarrage - - - <html><head/><body><p>GDB commands entered here will be executed after GDB has been started and the debugging helpers have been initialized.</p><p>You can add commands to load further debugging helpers here, or modify existing ones.</p><p>To execute arbitrary Python scripts, use <i>python execfile('/path/to/script.py')</i>.</p></body></html> - <html><head/><body><p>Les commandes GDB entrées ici seront exécutées après que GDB a démarré et que les assistants de débogage ont été initialisés.</p><p>Vous pouvez ajouter ici des commandes pour charger des assistants de débogage supplémentaires ou modifier les commandes existantes.</p><p>Pour exécuter des scripts Python quelconques, utilisez <i>python execfile('/path/to/script.py')</i>.</p></body></html> + Commandes supplémentaires de démarrage GDB GDB - - Choose Location of Startup Script File - Choisir l'emplacement du fichier contenant le script de démarrage - - - Modules - Modules - Cannot create temporary file: %1 Impossible de créer le fichier temporaire : %1 @@ -4525,27 +22363,7 @@ at debugger startup. Cannot open FiFo %1: %2 - Impossible d'ouvrir le FiFo %1 : %2 - - - Value (Base %1) - Valeur (base %1) - - - Registers - Registres - - - '%1' contains no identifier. - '%1' ne contient pas d'identifiant. - - - Cowardly refusing to evaluate expression '%1' with potential side effects. - Refuse lâchement d'évaluer l'expression '%1' qui pourrait avoir des effets de bord. - - - Stopped at %1:%2. - Arrêté à %1 : %2. + Impossible d’ouvrir le FiFo %1 : %2 Stopped. @@ -4559,6 +22377,10 @@ at debugger startup. Address: Adresse : + + File: + Fichier : + Line: Ligne : @@ -4571,9 +22393,17 @@ at debugger startup. To: Vers : + + JS-Function: + Fonction JS : + + + Receiver: + Récepteur : + Note: - Note : + Remarque : Sources for this frame are available.<br>Double-click on the file name to open an editor. @@ -4581,29 +22411,19 @@ at debugger startup. Binary debug information is not accessible for this frame. This either means the core was not compiled with debug information, or the debug information is not accessible. - Les informations de débogage binaires ne sont pas accessibles dans cette fenêtre. Cela signifie soit que le noyau n'a pas été compilé avec les informations de débogage, soit que les informations de débogage ne sont pas accessibles. + Les informations de débogage binaires ne sont pas accessibles dans cette fenêtre. Cela signifie soit que le noyau n’a pas été compilé avec les informations de débogage, soit que les informations de débogage ne sont pas accessibles. Binary debug information is accessible for this frame. However, matching sources have not been found. - Les informations de débogage binaires sont accessibles dans cette fenêtre. Cependant, les sources correspondantes n'ont pas été trouvées. + Les informations de débogage binaires sont accessibles dans cette fenêtre. Cependant, les sources correspondantes n’ont pas été trouvées. Note that most distributions ship debug information in separate packages. Notez que la plupart des distributions fournissent les informations de débogage dans des paquets séparés. - - Binary debug information is not accessible for this frame. This either means the core was not compiled with debug information, or the debug information is not accessible. Note that most distributions ship debug information in separate packages. - Binary se rapporte à quoi ??? -> je pense que tu es ok avec ta phrase :) - Les informations de débogage du fichier binaire ne sont pas accessibles dans ce cadre. Cela signifie soit que le noyau n'a pas été compilé avec les informations de débogage, soit que les informations de débogage ne sont pas accessibles. Notez que la plupart des distributions fournissent les informations de débogage dans des paquets séparés. - - - Binary debug information is accessible for this frame. However, matching sources have not been found. Note that some distributions ship debug sources in separate packages. - Binary se rapporte à quoi ??? - Les informations de débogage sont accessible dans ce cadre. Cependant, les sources correspondantes n'ont pas été trouvées. Notez que certaines distributions fournissent des sources de débogage dans des paquets séparés. - ... - ... + <More> @@ -4613,33 +22433,17 @@ at debugger startup. Level Niveau - - Thread id: - ID du thread : - - - Target id: - Identifiant de la cible : - - - Group id: - ID du groupes : - Name: - Nom : + Nom : State: - État : + État : Core: - Core : - - - Stopped at: - Arrêté à : + Core : ID @@ -4653,6 +22457,22 @@ at debugger startup. State État + + Thread&nbsp;id: + ID&nbsp;du&nbsp;thread : + + + Target&nbsp;id: + ID&nbsp;de&nbsp;la&nbsp;cible : + + + Group&nbsp;id: + ID&nbsp;du&nbsp;groupe : + + + Stopped&nbsp;at: + Arrêté&nbsp;à : + Target ID Identifiant cible @@ -4661,19 +22481,10 @@ at debugger startup. Details Détails - - Stack - Pile - Threads Threads - - <not in scope> - Value of variable in Debugger Locals display for variables out of scope (stopped above initialization). - <pas dans la portée> - %1 <shadowed %2> Display of variables shadowed by variables of the same name in nested scopes: Variable %1 is the variable name, %2 is a simple count. @@ -4688,32 +22499,32 @@ at debugger startup. Type interne - Displayed Type - Type affiché + Array Index + Indice du tableau - ... <cut off> - ... <coupé> + Creation Time in ms + Date de création en ms + + + Source + Source ... <cut off> - ... <coupé> + … <coupé> Object Address - Adresse de l'objet + Adresse de l’objet Pointer Address Adresse du pointeur - - Referencing Address - Référencement de l'adresse - Static Object Size - Taille de l'objet statique + Taille de l’objet statique %n bytes @@ -4723,22 +22534,25 @@ at debugger startup. %n octets - - Size - Taille - - - Stored Address - Adresse stockée - - - Debugger - Qt Creator - Débogueur - Qt Creator - <empty> <vide> + + <at least %n items> + + <au moins un élément> + <au moins %n éléments> + + + + <optimized out> + <optimisé> + + + <null reference> + <référence nulle> + <uninitialized> <non initialisé> @@ -4747,18 +22561,18 @@ at debugger startup. <invalid> <invalide> + + <not callable> + <non appelable> + + + <out of scope> + <pas dans la portée> + <not accessible> <inaccessible> - - <more than %n items> - singulier en français : entre zéro et un uniquement, d'où l'absence de %n au singulier - - <plus d'un item> - <plus de %n items> - - <%n items> @@ -4775,82 +22589,14 @@ at debugger startup. %1 est le data type => "Objet QMainWindow" par exemple. Objet %1 à une adresse inconnue - - unknown address - adresse inconnue - Internal ID ID interne - - Generation - Génération - - - decimal - décimal - - - hexadecimal - hexadécimal - - - binary - binaire - - - octal - octal - - - Bald pointer - Pointeur simple - - - <Edit> - <Éditer> - - - Raw pointer - Pointeur simple - - - Latin1 string - Chaîne de caractères latin1 - - - UTF8 string - Chaîne de caractères UTF8 - - - Local 8bit string - Chaîne de caractères locale sur 8 bits - - - UTF16 string - Chaîne de caractères UTF16 - - - UCS4 string - Chaîne de caractères UCS4 - - - Array of 10 items - Tableau de 10 éléments - - - Array of 1000 items - Tableau de 1000 éléments - returned value valeur de retour - - Root - Racine - Locals Variables locales @@ -4880,258 +22626,2994 @@ at debugger startup. Valeur - Add Watchpoint at Object's Address (0x%1) - Ajouter un point d'observation à l'adresse de l'objet (0x%1) + Expression %1 in function %2 from line %3 to %4 + Expression %1 dans la fonction %2 de la ligne %3 à %4 - Add Watchpoint at Referenced Address (0x%1) - Ajouter un point d'observation à l'adresse référencée (0x%1) + No valid expression + Aucune expression valide - Add Watchpoint - Ajouter un point d'observation + %1 (Previous) + %1 (précédente) - Setting a watchpoint on an address will cause the program to stop when the data at the address it modified. - Définir un point d'observation sur une adresse fera que le programme s'arrêtera quand les données à cette adresse seront modifiées. + %1 (Restored) + %1 (restaurée) - Remove All Watch Items - Supprimer tous les éléments observés + Expression too complex + Expression trop complexe - Open Memory View at Referenced Address (0x%1) - Ouvrir la vue mémoire à l'adresse référencée (0x%1) + CDB + CDB - Open Memory View at Referenced Address - Ouvrir la vue mémoire à l'adresse référencée + Select Local Cache Folder + Sélectionner un dossier de cache local - Refresh Code Model Snapshot - Rafraîchir le snapshot du modèle de code - - - - QtC::ProjectExplorer - - Unable to add dependency - Impossible d'ajouter une dépendance + Already Exists + Existe déjà - Unable to Add Dependency - Impossible d'ajouter une dépendance + A file named "%1" already exists. + Un fichier nommé « %1 » existe déjà. - This would create a circular dependency. - Ceci créerait une dépendance circulaire. + The folder "%1" could not be created. + Le dossier « %1 » n’a pas pu être créé. - %1 has no dependencies. - %1 n'a aucune dépendance. + Insert Symbol Server... + Insérer un serveur de symboles… - %1 depends on %2. - %1 dépend de %2. + Adds the Microsoft symbol server providing symbols for operating system libraries. Requires specifying a local cache directory. + Ajoute le serveur de symboles Microsoft pour fournir les symboles des bibliothèques du système d’exploitation. Exige de renseigner un répertoire local de cache. - %1 depends on: %2. - %1 dépend de : %2. + Insert Symbol Cache... + Insérer un cache de symboles… + + + Set up Symbol Paths... + Configurer les chemins d’accès aux symboles… + + + Configure Symbol paths that are used to locate debug symbol files. + Configurer les chemins d’accès aux symboles utilisés pour localiser les fichiers de symboles de débogage. + + + Cannot Create + Impossible de créer + + + Running requested... + Exécution demandée… + + + Python Error + Erreur Python + + + Pdb I/O Error + Erreur d’E/S Pdb + + + The Pdb process crashed some time after starting successfully. + Le processus Pdb a planté après avoir démarré correctement. + + + The last waitFor...() function timed out. The state of QProcess is unchanged, and you can try calling waitFor...() again. + La dernière fonction waitFor…() est arrivée à échéance. L’état de QProcess est inchangé, vous pouvez essayer d’appeler waitFor…() à nouveau. + + + The Pdb process failed to start. Either the invoked program "%1" is missing, or you may have insufficient permissions to invoke the program. + Échec du démarrage du processus Pdb. Soit le programme « %1 » est manquant, soit les droits sont insuffisants pour exécuter le programme. + + + An error occurred when attempting to write to the Pdb process. For example, the process may not be running, or it may have closed its input channel. + Une erreur s’est produite lors d’une tentative d’écriture sur le processus Pdb. Le processus peut ne pas être démarré ou il peut avoir fermé son entrée standard. + + + An error occurred when attempting to read from the Pdb process. For example, the process may not be running. + Une erreur s’est produite lors d’une tentative de lecture depuis le processus Pdb. Le processus peut ne pas être en cours d’exécution. + + + An unknown error in the Pdb process occurred. + Une erreur inconnue est survenue dans le processus Pdb. + + + Function Name + Nom de la fonction + + + Edit Breakpoint Properties + Modifier les propriétés du point d’arrêt + + + Basic + Basique + + + Breakpoint &type: + &Types de points d’arrêt : + + + &File name: + Nom de &fichier : + + + &Line number: + Numéro de &ligne : + + + &Enabled: + &Activé : + + + &Address: + A&dresse : + + + Fun&ction: + Fon&ction : + + + Advanced + Avancé + + + T&racepoint only: + Point de &traçage uniquement : + + + &One shot only: + &Un seul déclenchement : + + + Pat&h: + Che&min : + + + &Module: + &Module : + + + Use Engine Default + Utiliser le moteur par défaut + + + Use Full Path + Utiliser le chemin complet + + + Use File Name + Utiliser le nom de fichier + + + &Commands: + &Commandes : + + + C&ondition: + C&ondition : + + + &Ignore count: + Nombre de passages à &ignorer : + + + &Thread specification: + Spécification de &thread : + + + &Expression: + &Expression : + + + &Message: + &Message : + + + Debugger Error + Erreur du débogueur + + + Failed to Start the Debugger + Échec lors du démarrage du débogueur + + + Separate Window + Fenêtre séparée + + + There is no CDB executable specified. + Il n’y a pas d’exécutable CDB spécifié. + + + Internal error: The extension %1 cannot be found. +If you have updated %2 via Maintenance Tool, you may need to rerun the Tool and select "Add or remove components" and then select the Qt > Tools > Qt Creator CDB Debugger Support component. +If you build %2 from sources and want to use a CDB executable with another bitness than your %2 build, you will need to build a separate CDB extension with the same bitness as the CDB you want to use. + Erreur interne : l’extension %1 est introuvable. +Si vous avez mis à jour %2 via l’outil de maintenance, il se peut que vous deviez réexécuter l’outil et sélectionner « Ajouter ou supprimer des composants », puis sélectionner le composant Qt > Tools > Qt Creator CDB Debugger Support. +Si vous compilez %2 à partir des sources et que vous souhaitez utiliser un exécutable CDB avec une largeur de bits (« bitness ») » différente de celle de votre compilation %2, vous devrez compiler une extension CDB séparée avec la même largeur de bits que le CDB que vous souhaitez utiliser. + + + Trace point %1 in thread %2 triggered. + Le point de traçage %1 dans le thread %2 a été déclenché. + + + Conditional breakpoint %1 in thread %2 triggered, examining expression "%3". + Point d’arrêt conditionnel %1 dans le thread %2 déclenché, en examinant l’expression « %3 ». + + + Malformed stop response received. + Réponse au stop malformée reçue. + + + Switching to main thread... + Basculer vers le thread principal… + + + Debugger encountered an exception: %1 + Le débogueur a rencontré une exception : %1 + + + The installed %1 is missing debug information files. +Locals and Expression might not be able to display all Qt types in a human readable format. + +Install the "Qt Debug Information Files" Package from the Maintenance Tool for this Qt installation to get all relevant symbols for the debugger. + Les fichiers d’information de débogage manquent à %1 qui est installé. +« Locales et Expression » peut ne pas être en mesure d’afficher tous les types de Qt dans un format lisible par l’homme. + +Installez le paquet « Qt Debug Information Files » à partir de l’outil de maintenance pour cette installation de Qt afin d’obtenir tous les symboles pertinents pour le débogueur. + + + Missing Qt Debug Information + Informations de débogage de Qt manquantes + + + Debugger Start Failed + Le démarrage du débogueur a échoué + + + The system prevents loading of %1, which is required for debugging. Make sure that your antivirus solution is up to date and if that does not work consider adding an exception for %1. + Le système empêche le chargement de %1, qui est nécessaire pour le débogage. Assurez-vous que votre solution antivirus est à jour et, si cela ne fonctionne pas, envisagez d’ajouter une exception pour %1. + + + Module loaded: %1 + Module chargé : %1 + + + Value %1 obtained from evaluating the condition of breakpoint %2, stopping. + Valeur %1 obtenue par l’évaluation de la condition du point d’arrêt %2, arrêt. + + + Value 0 obtained from evaluating the condition of breakpoint %1, continuing. + Valeur nulle obtenue de l’évaluation de la condition du point d’arrêt %1, suite. + + + Attempting to interrupt. + Tentative d’interruption. + + + This debugger cannot handle user input. + Ce débogueur ne peut pas gérer l’entrée utilisateur. + + + Internal data breakpoint %1 at %2 triggered. + Point d’arrêt interne sur les données %1 à %2. + + + Internal data breakpoint %1 at %2 in thread %3 triggered. + Point d’arrêt interne sur les données %1 à %2 dans le thread %3. + + + Internal data breakpoint %1 at 0x%2 triggered. + Point d’arrêt interne sur les donnée %1 à 0x%2. + + + Internal data breakpoint %1 at 0x%2 in thread %3 triggered. + Point d’arrêt interne sur les données %1 à 0x%2 dans le thread %3. + + + <Unknown> + name + <Inconnu> + + + <Unknown> + meaning + <Inconnu> + + + This does not seem to be a "Debug" build. +Setting breakpoints by file name and line number may fail. + Ceci ne semble pas être une compilation « Debug ». +Mettre des points d’arrêt par nom de fichier et numéro de ligne pourrait échouer. + + + Loading finished. + Le chargement est terminé. + + + Run failed. + Exécution a échouée. + + + Running. + Exécution. + + + Run requested... + Exécution demandée… + + + Stopped: %1 (Signal %2). + Arrêté : %1 (signal %2). + + + Stopped in thread %1 by: %2. + Interrompu dans le thread %1 par : %2. + + + Interrupted. + Interrompu. + + + <p>The inferior stopped because it triggered an exception.<p>%1 + <p>L’inférieur s’est arrêté parce qu’il a rencontré une exception.<p>%1 + + + Exception Triggered + Exception déclenchée + + + The inferior is in the Portable Executable format. +Selecting %1 as debugger would improve the debugging experience for this binary format. + L’inférieur est au format Portable Executable. +Sélectionner %1 comme débogueur améliorerait l’expérience de débogage pour ce format binaire. + + + The inferior is in the ELF format. +Selecting GDB or LLDB as debugger would improve the debugging experience for this binary format. + L’inférieur est au format ELF. +Sélectionner GDB ou LLDB comme débogueur améliorerait l’expérience de débogage pour ce format binaire. + + + Found. + Trouvé. + + + Not found. + Non trouvé. + + + Taking notice of pid %1 + Pas sur de la traduction... + Prends note du pid %1 + + + Run to Address 0x%1 + Aller à l’adresse 0x%1 + + + Run to Line %1 + Aller à la ligne %1 + + + Jump to Address 0x%1 + Sauter à l’adresse 0x%1 + + + Jump to Line %1 + Sauter à la ligne %1 + + + Invalid debugger option: %1 + Option du débogueur invalide : %1 + + + Not enough free ports for QML debugging. + Pas assez de ports libres pour le débogage QML. + + + Unable to create a debugging engine. + Impossible de créer un moteur de débogage. + + + The kit does not have a debugger set. + Le kit ne dispose pas d’un ensemble de débogage. + + + Unpacking core file to %1 + Dépaquetage du fichier core vers %1 + + + Cannot debug: Local executable is not set. + Débogage impossible : l’exécutable local n’est pas défini. + + + No executable specified. + Aucun exécutable n’est spécifié. + + + %1 is a 64 bit executable which can not be debugged by a 32 bit Debugger. +Please select a 64 bit Debugger in the kit settings for this kit. + %1 est un exécutable 64 bits qui ne peut pas être débogué par un débogueur 32 bits. +Veuillez sélectionner un débogueur 64 bits dans les paramètres du kit pour ce kit. + + + Debugged executable + Exécutable déboguée + + + Unsupported CDB host system. + Système hôte CDB non pris en charge. + + + Specify Debugger settings in Projects > Run. + Spécifiez les paramètres du débogueur dans Projets > Exécuter. + + + %1 - Snapshot %2 + %1 - Snapshot %2 + + + Some breakpoints cannot be handled by the debugger languages currently active, and will be ignored.<p>Affected are breakpoints %1 + Certains points d’arrêt ne peuvent pas être gérés par les langages de débogage actuellement actifs et seront ignorés.<p>Les points d’arrêt affectés sont %1 + + + QML debugging needs to be enabled both in the Build and the Run settings. + Le débogage QML doit être activé à la fois dans les paramètres de compilation et d’exécution. + + + &Show this message again. + &Montrer ce message de nouveau. + + + Debugging %1 ... + Débogage de %1… + + + Debugging of %1 has finished with exit code %2. + La débogage de « %1 » s’est terminé avec le code de sortie %2. + + + Debugging of %1 has finished. + La débogage de « %1 » s’est terminé. + + + A debugging session is still in progress. Terminating the session in the current state can leave the target in an inconsistent state. Would you still like to terminate it? + Une session de débogage est en cours. Terminer la session dans l’état actuel risque de laisser la cible dans un état incohérent. Voulez-vous vraiment terminer la session ? + + + Close Debugging Session + Fermer la session de débogage + + + Clear Contents + Effacer le contenu + + + Save Contents + Enregistrer le contenu + + + Debugger &Log + &Journal du débogueur + + + Note: This log contains possibly confidential information about your machine, environment variables, in-memory data of the processes you are debugging, and more. It is never transferred over the internet by %1, and only stored to disk if you manually use the respective option from the context menu, or through mechanisms that are not under the control of %1's Debugger plugin, for instance in swap files, or other plugins you might use. +You may be asked to share the contents of this log when reporting bugs related to debugger operation. In this case, make sure your submission does not contain data you do not want to or you are not allowed to share. + + + Remarque : ce journal contient des informations éventuellement confidentielles sur votre machine, des variables d’environnement, des données en mémoire des processus que vous déboguez, et bien d’autres choses encore. Il n’est jamais transféré sur Internet par %1, et n’est stocké sur le disque que si vous utilisez manuellement l’option correspondante du menu contextuel, ou par des mécanismes qui ne sont pas sous le contrôle du greffon de débogage de %1, par exemple dans les fichiers d’échange, ou d’autres greffons que vous pourriez utiliser. +Il peut vous être demandé de partager le contenu de ce journal lorsque vous signalez des bogues liés au fonctionnement du débogueur. Dans ce cas, assurez-vous que votre soumission ne contient pas de données que vous ne voulez pas ou que vous n’êtes pas autorisé à partager. + + + + + Global Debugger &Log + &Journal du débogueur général + + + Reload Debugging Helpers + Recharger l’assistance au débogage + + + Type Ctrl-<Return> to execute a line. + Taper Ctrl-<Retour> pour exécuter une ligne. + + + Repeat last command for debug reasons. + Répétition de la dernière commande pour des raisons de débogage. + + + Log File + Réaliser un log du fichier + + + Internal Name + Nom interne + + + Full Name + Nom complet + + + Open File "%1" + Ouvrir le fichier « %1 » + + + Analyzer + Analyseur + + + &Condition: + &Condition : + + + Start a CDB Remote Session + Lancer une session CDB distante + + + &Connection: + &Connexion : + + + Memory... + Mémoire… + + + No function selected. + Aucune fonction sélectionnée. + + + Running to function "%1". + Lancement de la fonction « %1 ». + + + Process %1 + %1: PID + Processus %1 + + + Attaching to local process %1. + Attacher au processus local %1. + + + Remote: "%1" + Distant : « %1 » + + + Attaching to remote server %1. + Attachement au serveur distant %1. + + + Core file "%1" + Fichier core « %1 » + + + Attaching to core file %1. + Attacher au fichier core %1. + + + Crashed process %1 + Processus %1 planté + + + Attaching to crashed process %1 + Attacher au processus planté %1 + + + 0x%1 hit + Message tracepoint: Address hit. + 0x%1 atteint + + + %1:%2 %3() hit + Message tracepoint: %1 file, %2 line %3 function hit. + %1 : %2 %3() atteinte + + + Add Message Tracepoint + Ajouter un message de traçage + + + Ctrl+F8 + Ctrl+F8 + + + Ctrl+F9 + Ctrl+F9 + + + Option "%1" is missing the parameter. + Le paramètre de l’option « %1 » est manquant. + + + Only one executable allowed. + Un seul exécutable est autorisé. + + + Executable file "%1" + Fichier exécutable « %1 » + + + Debugging file %1. + Fichier de débogage %1. + + + The parameter "%1" of option "%2" does not match the pattern <handle>:<pid>. + Le paramètre « %1 » de l’option « %2 » ne correspond pas au modèle <handle> : <pid>. + + + Start debugging of startup project + Lancer le débogage du projet + + + Start Debugging of Startup Project + Lancer le débogage du projet + + + Reload debugging helpers skipped as no engine is running. + Le rechargement de l’assistance au débogage est ignoré car aucun moteur n’est en cours d’exécution. + + + &Attach to Process + &Attacher au processus + + + Cannot attach to process with PID 0 + Impossible de s’attacher au processus avec PID 0 + + + Set Breakpoint at 0x%1 + Placer un point d’arrêt à 0x%1 + + + Set Message Tracepoint at 0x%1... + Placer un message de traçage à 0x%1… + + + Save Debugger Log + Enregistrer le journal du débogueur + + + User commands are not accepted in the current state. + Les commandes utilisateur ne sont pas acceptées dans l’état actuel. + + + Debugger finished. + Débogage terminé. + + + Set Breakpoint at Line %1 + Définir un point d’arrêt à la ligne %1 + + + Set Message Tracepoint at Line %1... + Définir un message de traçage à la ligne %1… + + + Disassemble Function "%1" + Désassembler la fonction « %1 » + + + Starting debugger "%1" for ABI "%2"... + Démarrage du débogueur « %1 » pour l’ABI « %2 »… + + + Continue + Continuer + + + Interrupt + Interrompre + + + Abort Debugging + Annuler le débogage + + + Set or Remove Breakpoint + Définir ou supprimer un point d’arrêt + + + Enable or Disable Breakpoint + Activer ou désactiver un point d’arrêt + + + Restart Debugging + Relancer le débogage + + + Record Information to Allow Reversal of Direction + Enregistrer les informations permettant d’inverser la direction + + + Take Snapshot of Process State + Prendre un snapshot de l’état du processus + + + Launching Debugger + Lancement du débogueur + + + Switches the debugger to instruction-wise operation mode. In this mode, stepping operates on single instructions and the source location view also shows the disassembled instructions. + Bascule le débogueur en mode de fonctionnement par instructions. Dans ce mode, le débogage opère sur des instructions individuelles et la vue de l’emplacement de la source montre également les instructions désassemblées. + + + &Modules + &Modules + + + Reg&isters + Reg&istres + + + Peripheral Reg&isters + Reg&istres périphériques + + + &Stack + &Pile + + + &Threads + &Threads + + + &Expressions + &Expressions + + + &Breakpoints + Point d’&arrêt + + + Aborts debugging and resets the debugger to the initial state. + Annuler le débogage et réinitialiser le débogueur a son état initial. + + + Restarts the debugging session. + Relance la session de débogage. + + + Step Over + Passer + + + Debugger Location + Emplacement du débogueur + + + Continue %1 + Continuer %1 + + + Interrupt %1 + Interrompre %1 + + + Step Into + Entrer dans + + + Step Out + Sortir de + + + Run to Line + Exécuter jusqu’à la ligne + + + Run to Selected Function + Exécuter jusqu’à la fonction sélectionnée + + + Immediately Return From Inner Function + Retourne immédiatement d’une fonction interne + + + Jump to Line + Sauter à la ligne + + + Reverse Direction + Inverser la direction + + + Move to Called Frame + Se déplacer sur la frame appelée + + + Move to Calling Frame + Se déplacer sur la frame appelante + + + Error evaluating command line arguments: %1 + Erreur durant l’évaluation des arguments de la ligne de commande : %1 + + + Start Debugging + Commencer le débogage + + + Start Debugging Without Deployment + Démarrer le débogage sans déploiement + + + Start and Debug External Application... + Déboguer une application externe… + + + Load Core File... + Charger un fichier core… + + + Attach to QML Port... + Attacher au port QML… + + + Attach to Remote CDB Session... + Attacher à une session CDB distante… + + + Detach Debugger + Détacher le débogueur + + + Interrupt Debugger + Interrompre le débogueur + + + Stop Debugger + Arrêter le débogueur + + + Debug Information + Information de débogage + + + Debugger Runtime + Exécution du débogueur + + + Process Already Under Debugger Control + Processus déjà sous contrôle d’un débogueur + + + Ctrl+Y + Ctrl+Y + + + F5 + F5 + + + Attach to Running Application... + Attacher à l’application en cours d’exécution… + + + Attach to Unstarted Application... + Attacher à l’application non démarrée… + + + Attach to Running Debug Server... + Attacher à un serveur de débogage en cours d’exécution… + + + Start and Break on Main + Démarrer et s’arrêter sur le Main + + + &Analyze + A&nalyser + + + Breakpoint Preset + pas d'idée de la façon de traduire « preset » + + + + Running Debuggers + Exécution des débogueurs + + + Debugger Perspectives + Perspectives du débogueur + + + Start Debugging or Continue + Lancer le débogage ou continuer + + + Attach to Running Application + Attacher à l’application en cours d’exécution + + + Attach to Unstarted Application + Attacher à l’application non démarrée + + + Shift+Ctrl+Y + Maj+Ctrl+Y + + + Shift+F5 + Maj+F5 + + + Reset Debugger + Réinitialiser le débogueur + + + Restart the debugging session. + Relancer la session de débogage. + + + Ctrl+Shift+O + Ctrl+Maj+O + + + F10 + F10 + + + Ctrl+Shift+I + Ctrl+Maj+I + + + F11 + F11 + + + Ctrl+Shift+T + Ctrl+Maj+T + + + Shift+F11 + Maj+F11 + + + Shift+F8 + Maj+F8 + + + Ctrl+F10 + Ctrl+F10 + + + Ctrl+F6 + Ctrl+F6 + + + in Debug mode + en mode Debug + + + in Profile mode + en mode Profile + + + in Release mode + en mode Release + + + with debug symbols (Debug or Profile mode) + avec les symboles de débogage (modes Debug ou Profile) + + + on optimized code (Profile or Release mode) + sur du code optimisé (modes Profile ou Release) + + + <html><head/><body><p>You are trying to run the tool "%1" on an application in %2 mode. The tool is designed to be used %3.</p><p>Run-time characteristics differ significantly between optimized and non-optimized binaries. Analytical findings for one mode may or may not be relevant for the other.</p><p>Running tools that need debug symbols on binaries that don't provide any may lead to missing function names or otherwise insufficient output.</p><p>Do you want to continue and run the tool in %2 mode?</p></body></html> + <html><head/><body><p>Vous essayez d’exécuter l’outil « %1 » sur une application en mode %2. L’outil est conçu pour être utilisé en mode %3.</p><p>Les caractéristiques d’exécution diffèrent considérablement entre les binaires optimisés et non optimisés. L’exécution d’outils nécessitant des symboles de débogage sur des binaires qui n’en fournissent pas peut conduire à des noms de fonctions manquants ou à des résultats insuffisants.</p><p>Voulez-vous continuer et exécuter l’outil en mode %2 ?</p></body></html> + + + Start + Démarrer + + + Stop + Arrêter + + + F8 + F8 + + + F9 + F9 + + + Show Application on Top + Afficher l’application au premier plan + + + From + À partir de + + + To + Jusqu'à + + + Flags + Flags + + + Sections in "%1" + Sections dans « %1 » + + + Select + Sélectionner + + + Threads: + Threads : + + + Current debugger location of %1 + Emplacement du débogueur actuel de %1 + + + Debugging has failed. + Échec du débogage. + + + Record information to enable stepping backwards. + Enregistrer les informations permettant de revenir en arrière. + + + Note: + Remarque : + + + This feature is very slow and unstable on the GDB side. It exhibits unpredictable behavior when going backwards over system calls and is very likely to destroy your debugging session. + Cette fonctionnalité est très lente et instable du côté de GDB. Elle présente un comportement imprévisible lors du retour en arrière sur les appels système et risque fort de détruire votre session de débogage. + + + Operate in Reverse Direction + Fonctionner en sens inverse + + + The %1 process terminated. + Le processus %1 s’est terminé. + + + The %2 process terminated unexpectedly (exit code %1). + Le processus %2 s’est terminé de façon inattendue (code de sortie %1). + + + Unexpected %1 Exit + Arrêt inattendu de %1 + + + Reverse-execution history exhausted. Going forward again. + L’historique de l’exécution inversée est épuisée. Il faut à nouveau aller vers l’avant. + + + Reverse-execution recording failed. + L’enregistrement de l’exécution inverse a échoué. + + + %1 for "%2" + e.g. LLDB for "myproject", shows up i + %1 pour « %2 » + + + Stopped: "%1". + Arrêté : « %1 ». + + + <p>The inferior stopped because it received a signal from the operating system.<p><table><tr><td>Signal name : </td><td>%1</td></tr><tr><td>Signal meaning : </td><td>%2</td></tr></table> + <p>L’inférieur a stoppé car il a reçu un signal du système d’exploitation.</p><table><tr><td>Nom du signal : </td><td>%1</td></tr><tr><td>Signification du signal : </td><td>%2</td></tr></table> + + + Signal Received + Signal reçu + + + Select a valid expression to evaluate. + Sélectionner une expression valide à évaluer. + + + Symbol + Symbole + + + Section %1: %2 + Section %1 : %2 + + + The selected debugger may be inappropriate for the inferior. +Examining symbols and setting breakpoints by file name and line number may fail. + + Le débogueur sélectionné n’est peut-être pas adapté à l’inférieur. +L’examen des symboles et la définition de points d’arrêt par nom de fichier et numéro de ligne peut échouer. + + + + Address + Adresse + + + Code + Code + + + Section + Section + + + Symbols in "%1" + Symboles dans « %1 » + + + <new source> + <nouvelle source> + + + <new target> + <nouvelle cible> + + + Source path + Chemin des sources + + + Target path + Chemin de destination + + + Add Qt sources... + Ajouter les sources de Qt… + + + <p>Mappings of source file folders to be used in the debugger can be entered here.</p><p>This is useful when using a copy of the source tree at a location different from the one at which the modules where built, for example, while doing remote debugging.</p><p>If source is specified as a regular expression by starting it with an open parenthesis, the paths in the ELF are matched with the regular expression to automatically determine the source path.</p><p>Example: <b>(/home/.*/Project)/KnownSubDir -> D:\Project</b> will substitute ELF built by any user to your local project directory.</p> + <p>Il est possible de saisir ici les correspondances des dossiers de fichiers source à utiliser dans le débogueur.</p><p>Ceci est utile pour utiliser une copie de l’arborescence des sources à un endroit différent de celui où les modules ont été compilés, par exemple, lors d’un débogage à distance.</p><p>Si la source est spécifiée sous la forme d’une expression rationnelle commençant par une parenthèse ouverte, les chemins dans l’ELF sont comparés à l’expression rationnelle pour déterminer automatiquement le chemin d’accès à la source</p><p>Exemple : <b>(/home/.*/Projet)/SousDirConnu -> D:\Projet</b> substituera l’ELF construit par n’importe quel utilisateur à votre répertoire de projet local.</p> + + + <p>Add a mapping for Qt's source folders when using an unpatched version of Qt. + <p>Ajouter un mapping pour les répertoires des sources Qt quand vous utilisez une version de Qt non patchée. + + + <p>The source path contained in the debug information of the executable as reported by the debugger + <p>Le chemin des sources contenu dans les informations de débogage de l’exécutable, comme reporté par le débogueur + + + <p>The actual location of the source tree on the local machine + <p>L’emplacement réel de l’arbre des sources sur la machine locale + + + Remove + Supprimer + + + Source Paths Mapping + Chemins de source du Mapping + + + &Source path: + Chemin des &sources : + + + &Target path: + Chemin de des&tination : + + + Qt Sources + Sources de Qt + + + Debugging complex command lines is currently not supported on Windows. + Débogueur des lignes de commande complexes n’est pas actuellement pris en charge sous Windows. + + + Memory at Register "%1" (0x%2) + Mémoire au registre « %1 » (0x%2) + + + Register "%1" + Registre « %1 » + + + Memory at 0x%1 + Mémoire à 0x%1 + + + No Memory Viewer Available + Aucun afficheur de mémoire disponible + + + The memory contents cannot be shown as no viewer plugin for binary data has been loaded. + Le contenu de la mémoire ne peut pas être affiché car aucun greffon de visualisation de données binaires n’a pu être chargé. + + + No application output received in time + Pas de sortie de l’application reçue à temps + + + Could not connect to the in-process QML debugger. +Do you want to retry? + Impossible de se connecter au processus du débogueur QML. +Voulez-vous réessayer ? + + + JS Source for %1 + Source JS pour %1 + + + Could not connect to the in-process QML debugger. %1 + Impossible de se connecter au processus du débogueur QML : %1 + + + Starting %1 + Démarrage de %1 + + + Waiting for JavaScript engine to interrupt on next statement. + En attente de l’interruption du moteur JavaScript à la prochaine déclaration. + + + Run to line %1 (%2) requested... + Exécution jusqu’à la ligne %1 (%2) demandée… + + + Cannot evaluate %1 in current stack frame. + Impossible d’évaluer %1 dans le cadre actuel de la pile. + + + Context: + Contexte : + + + Global QML Context + Contexte QML général + + + QML Debugger: Connection failed. + Débogueur QML : échec de la connexion. + + + QML Debugger disconnected. + Débogueur QML déconnecté. + + + C++ exception + Exception C++ + + + Thread creation + Création de thread + + + Thread exit + Sortie de thread + + + Load module: + Charger le module : + + + Unload module: + Décharger le module : + + + Output: + Sortie : + + + Break On + S’arrêter sur + + + Add Exceptions to Issues View + Ajouter des exceptions à la vue « Problèmes » + + + Start Debugger + Lancer le débogueur + + + Start Remote Analysis + Démarrer l’analyse distante + + + Kit: + Kit : + + + Executable: + Exécutable : + + + Arguments: + Arguments : + + + Working directory: + Répertoire de travail : + + + &Port: + &Port : + + + Stop when %1() is called + Arrêter lorsque %1() est appelé + + + Start Remote Engine + Démarrer le moteur distant + + + &Host: + &Hôte : + + + &Username: + &Utilisateur : + + + &Password: + Mot de &passe : + + + &Engine path: + Chemin du mot&eur : + + + &Inferior path: + Chemin &inférieur : + + + Reset + Réinitialiser + + + Type Formats + Formats des types + + + Qt Types + Types Qt + + + Standard Types + Types standards + + + Misc Types + Types divers + + + Enable C++ + Activer le C++ + + + Enable QML + Activer le QML + + + Additional startup commands: + Commandes supplémentaires de démarrage : + + + <a href="qthelp://org.qt-project.qtcreator/doc/creator-debugging-qml.html">What are the prerequisites?</a> + <a href="qthelp://org.qt-project.qtcreator/doc/creator-debugging-qml.html">Quels sont les prérequis ?</a> + + + Enable Debugging of Subprocesses + Activer le débogage des sous-processus + + + Anonymous Function + Fonction anonyme + + + Show debug, log, and info messages. + Afficher les messages de débogage, des journaux et d’informations. + + + Show warning messages. + Afficher les messages d’avertissement. + + + Show error messages. + Afficher les messages d’erreur. + + + QML Debugger Console + Console du débogueur QML + + + Can only evaluate during a debug session. + Ne peut être évalué que lors d’une session de débogage. + + + Delete All Breakpoints + Supprimer tous les points d’arrêt + + + Delete Breakpoints of "%1" + Supprimer les points d’arrêt de « %1 » + + + Delete Breakpoints of File + Supprimer les points d’arrêt du fichier + + + Edit Breakpoint... + Modifier le point d’arrêt… + + + Synchronize Breakpoints + Synchroniser les points d’arrêt + + + Disable Selected Breakpoints + Supprimer les points d’arrêt du fichier + + + Enable Selected Breakpoints + Activer les points d’arrêt sélectionnés + + + Disable Breakpoint + Désactiver le point d’arrêt + + + Enable Breakpoint + Activer le point d’arrêt + + + Add Breakpoint... + Ajouter un point d’arrêt… + + + pending + en attente + + + Hit Count: + Nombre de coups : + + + Display Name: + Nom d’affichage : + + + Unclaimed Breakpoint + Point d’arrêt non réclamé + + + Debuggee + Débogué + + + Remove All Breakpoints + Retirer tous les points d’arrêt + + + Are you sure you want to remove all breakpoints from all files in the current session? + Voulez-vous vraiment retirer tous les points d’arrêt de tous les fichiers de la session actuelle ? + + + Add Breakpoint + Ajouter un point d’arrêt + + + Select Executable + Sélectionner l’exécutable + + + Server port: + Port du serveur : + + + Select Working Directory + Sélectionner le répertoire de travail + + + Normally, the running server is identified by the IP of the device in the kit and the server port selected above. +You can choose another communication channel here, such as a serial line or custom ip:port. + Normalement, le serveur en cours d’exécution est identifié par l’adresse IP du périphérique dans le kit et le port du serveur sélectionné ci-dessus. +Vous pouvez choisir un autre canal de communication ici, comme une ligne série ou un couple ip:port personnalisé. + + + Override server channel: + Écraser le canal du serveur : + + + For example, %1 + "For example, /dev/ttyS0, COM1, 127.0.0.1:1234" + Par exemple, %1 + + + Select SysRoot Directory + Sélectionner le répertoire SysRoot + + + This option can be used to override the kit's SysRoot setting. + Cette option peut être utilisée pour écraser le paramètre SysRoot du kit. + + + Override S&ysRoot: + Écraser S&ysRoot : + + + This option can be used to send the target init commands. + Cette option peut être utilisée pour envoyer les commandes d’initialisation de la cible. + + + &Init commands: + Commandes d’&initialisation : + + + This option can be used to send the target reset commands. + Cette option peut être utilisée pour envoyer les commandes de réinitialisation de la cible. + + + &Reset commands: + Commandes de &réinitialisation : + + + Select Location of Debugging Information + Sélectionner l’emplacement des informations de débogage + + + Base path for external debug information and debug sources. If empty, $SYSROOT/usr/lib/debug will be chosen. + Chemin de base pour les informations de débogage externes et les sources de débogage. Si vide, $SYSROOT/usr/lib/debug sera choisi. + + + &Kit: + &Kit : + + + Local &executable: + &Exécutable local : + + + Command line &arguments: + &Arguments de la ligne de commande : + + + &Working directory: + &Répertoire de travail : + + + Run in &terminal: + Lancer en &terminal : + + + Break at "&main": + Arrêt à « &main » : + + + Use target extended-remote to connect: + + + + Debug &information: + &Information de débogage : + + + &Recent: + &Récent : + + + Attach to %1 + Attacher à %1 + + + <html><body><p>The remote CDB needs to load the matching %1 CDB extension (<code>%2</code> or <code>%3</code>, respectively).</p><p>Copy it onto the remote machine and set the environment variable <code>%4</code> to point to its folder.</p><p>Launch the remote CDB as <code>%5 &lt;executable&gt;</code> to use TCP/IP as communication protocol.</p><p>Enter the connection parameters as:</p><pre>%6</pre></body></html> + + + + The debugger to use for this kit. + Le débogueur à utiliser pour ce kit. + + + No debugger set up. + Aucun débogueur n’a été configuré. + + + Debugger "%1" not found. + Le débogueur « %1 » est introuvable. + + + Debugger "%1" not executable. + Le débogueur « %1 » n’est pas exécutable. + + + The debugger location must be given as an absolute path (%1). + L’emplacement du débogueur doit être un chemin absolu (%1). + + + The ABI of the selected debugger does not match the toolchain ABI. + L’ABI du débogueur sélectionné ne correspond pas à l’ABI de la chaîne de compilation. + + + Name of Debugger + Nom du débogueur + + + Unknown debugger + Débogueur inconnu + + + Unknown debugger type + Type de débogueur inconnu + + + No Debugger + Aucun débogueur + + + %1 Engine + Engin %1 + + + %1 <None> + Balise à traduire ? Yep (c'est ce qui est fait dans qtcreator_de.ts en tout cas) + %1 <None> + + + %1 using "%2" + %1 utilise « %2 » + + + Debugger + Category under which Analyzer tasks are listed in Issues view + Débogueur + + + Error Loading Core File + Core ? coeur ? Les anciennes chaînes utilisent core + Erreur lors du chargement du fichier core + + + The specified file does not appear to be a core file. + Le fichier spécifié ne semble pas être un fichier core. + + + Error Loading Symbols + Erreur de chargement des symboles + + + No executable to load symbols from specified core. + Pas d’exécutable pour charger les symboles du core spécifié. + + + Attaching to process %1. + Attachement au processus %1. + + + Attached to running application. + Attaché à l’application en cours d’exécution. + + + Failed to attach to application: %1 + Échec de l’attachement à l’application : %1 + + + Symbols found. + Symboles trouvés. + + + This can be caused by a path length limitation in the core file. + Cela peut être lié à une limitation de la taille du chemin dans le fichier core. + + + Attached to core. + Attaché au core. + + + Attach to core "%1" failed: + Échec de liaison au core « %1 » : + + + Error + Erreur + + + No symbol file given. + Pas de fichier de symboles donné. + + + Warning + Avertissement + + + Module Name + Nom du module + + + Module Path + Chemin du module + + + Symbols Read + Symboles lus + + + Symbols Type + Type des symboles + + + Start Address + Adresse de démarrage + + + End Address + Adresse de fin + + + Unknown + Inconnue + + + No + Non + + + Yes + Oui + + + None + Aucune + + + Plain + Simple + + + Fast + Rapide + + + debuglnk + debuglnk + + + buildid + buildid + + + It is unknown whether this module contains debug information. +Use "Examine Symbols" from the context menu to initiate a check. + Qt Creator ne sait pas si le module contient des informations de débogage. +Utilisez « Examiner symboles » à partir du menu contextuel pour démarrer une vérification. + + + This module neither contains nor references debug information. +Stepping into the module or setting breakpoints by file and line will not work. + Ce module ne contient pas de références sur les informations de débogage. +Le pas à pas dans le module ou la définition de points d’arrêt par fichier et par ligne peut ne pas fonctionner. + + + This module does not contain debug information itself, but contains a reference to external debug information. + Le module ne contient pas d’information de débogage en lui même, mais contient des références vers des informations de débogage externes. + + + <unknown> + address + End address of loaded module + <inconnue> + + + Update Module List + Mettre à jour la liste des modules + + + Show Source Files for Module "%1" + Afficher les fichiers source du module « %1 » + + + Show Source Files for Module + Afficher les fichiers source du module + + + Load Symbols for All Modules + Charger les symboles pour tous les modules + + + Examine All Modules + Examiner tous les modules + + + Load Symbols for Module + Charger les symboles pour le module + + + Edit File + Modifier le fichier + + + Show Symbols + Afficher les symboles + + + Show Sections + Afficher les sections + + + Show Dependencies + Montrer les dépendances + + + This module contains debug information. +Stepping into the module or setting breakpoints by file and line is expected to work. + Ce module contient des informations de débogage. +L’accès au module ou la mise en place de points d’arrêt par fichier et par ligne devraient fonctionner. + + + Load Symbols for Module "%1" + Charger les symboles pour le module « %1 » + + + Edit File "%1" + Modifier le fichier « %1 » + + + Show Symbols in File "%1" + Afficher les symboles dans le fichier « %1 » + + + Show Sections in File "%1" + Afficher les sections dans le fichier « %1 » + + + Show Dependencies of "%1" + Montrer les dépendances de « %1 » + + + Success: + Réussite : + + + <anonymous> + <anonyme> + + + Properties + Propriétés + + + Reload Register Listing + Recharger la liste des registres + + + Open Disassembler... + Ouvrir le désassembleur… + + + Open Memory Editor at 0x%1 + Ouvrir l’éditeur de mémoire à l’adresse 0x%1 + + + Content as ASCII Characters + Contenu sous la forme de caractères ASCII + + + Content as %1-bit Signed Decimal Values + Contenu sous la forme de valeurs décimales signées de %1 bits + + + Content as %1-bit Unsigned Decimal Values + Contenu sous la forme de valeurs décimales non-signées de %1 bits + + + Content as %1-bit Hexadecimal Values + Contenu sous la forme de valeurs hexadécimales de %1 bits + + + Content as %1-bit Octal Values + Contenu sous la forme de valeurs octales de %1 bits + + + Content as %1-bit Binary Values + Contenu sous la forme de valeurs binaires de %1 bits + + + Content as %1-bit Floating Point Values + Contenu sous la forme de valeurs à virgule flottante de %1 bits + + + A group of registers. + Un groupe de registres. + + + Open Memory View at Value of Register %1 0x%2 + Ouvrir la vue mémoire à la valeur du registre %1 0x%2 + + + Open Disassembler at 0x%1 + Ouvrir le désassembleur à l’adresse 0x%1 + + + Edit bits %1...%2 of register %3 + Modifier les bits %1…%2 du registre %3 + + + Open Memory Editor + Ouvrir l’éditeur de mémoire + + + Open Memory View at Value of Register + Ouvrir la vue mémoire à la valeur du registre + + + Open Disassembler + Ouvrir le désassembleur + + + RO + je pense qu'il ne faut pas traduire « RO » + RO + + + WO + je pense qu'il ne faut pas traduire « WO » + WO + + + RW + je pense qu'il ne faut pas traduire « RW » + RW + + + N/A + S/O + + + [%1..%2] + [%1..%2] + + + Access + Accès + + + View Groups + Groupes de vues + + + Format + Format + + + Hexadecimal + Hexadécimal + + + Decimal + Décimal + + + Octal + Octal + + + Binary + Binaire + + + Perspective + Perspective + + + Debugged Application + Application déboguée + + + Debugger Preset + pas d'idée sur la façon de traduire « preset » + + + + Create Snapshot + Créer un snapshot + + + Abort Debugger + Annuler le débogueur + + + Reload Data + Recharger les données + + + Open File + Ouvrir le fichier + + + Function: + Fonction : + + + Disassemble Function + Désassembler la fonction + + + Copy Contents to Clipboard + Copier le contenu dans le presse-papier + + + Open Disassembler at Address... + Ouvrir le désassembleur à l’adresse… + + + Disassemble Function... + Désassembler la fonction… + + + Try to Load Unknown Symbols + Essayer de charger les symboles inconnus + + + Memory at Frame #%1 (%2) 0x%3 + Mémoire à la frame #%1 (%2) 0x%3 + + + Cannot open "%1": %2 + Impossible d’ouvrir « %1 » : %2 + + + Cannot Open Task File + Impossible d’ouvrir le fichier de tâche + + + Copy Selection to Clipboard + Copier la sélection dans le presse-papier + + + Save as Task File... + Enregistrer la tâche sous… + + + Load QML Stack + Charger la pile QML + + + Frame #%1 (%2) + Frame #%1 (%2) + + + <i>%1</i> %2 at #%3 + HTML tooltip of a variable in the memory editor + <i>%1</i> %2 à #%3 + + + <i>%1</i> %2 + HTML tooltip of a variable in the memory editor + <i>%1</i> %2 + + + Press Ctrl to select widget at (%1, %2). Press any other keyboard modifier to stop selection. + Appuyez sur Ctrl pour sélectionner le widget à (%1, %2). Appuyez sur n’importe quel autre modificateur de clavier pour arrêter la sélection. + + + Selecting widget at (%1, %2). + Sélection du widget à (%1, %2). + + + Selection aborted. + Sélection annulée. + + + Register <i>%1</i> + Registre <i>%1</i> + + + Memory at Pointer's Address "%1" (0x%2) + Mémoire à l’adresse du pointeur « %1 » (0x%2) + + + Memory at Object's Address "%1" (0x%2) + Mémoire à l’adresse de l’objet « %1 » (0x%2) + + + Cannot Display Stack Layout + Impossible d’afficher la disposition de la pile + + + Could not determine a suitable address range. + Impossible de déterminer une plage d’adresses convenable. + + + Memory Layout of Local Variables at 0x%1 + Disposition de la mémoire des variables locales à 0x%1 + + + Add Expression Evaluator + Ajouter un évaluateur d’expression + + + Add Expression Evaluator for "%1" + Ajouter un évaluateur d’expression pour « %1 » + + + Remove Expression Evaluator + Retirer l’évaluateur d’expression + + + Remove Expression Evaluator for "%1" + Retirer l’évaluateur d’expression pour « %1 » + + + Treat All Characters as Printable + Traiter tous les caractères comme imprimables + + + Show Unprintable Characters as Escape Sequences + Montrer les caractères non imprimables comme des séquences d’échappement + + + Show Unprintable Characters as Octal + Montrer les caractères non imprimables comme octaux + + + Show Unprintable Characters as Hexadecimal + Montrer les caractères non imprimables comme hexadécimaux + + + Change Value Display Format + Changer le format d’affichage de la valeur + + + Change Display for Object Named "%1": + Changer l’affichage de l’objet nommé « %1 » : + + + Use Format for Type (Currently %1) + Utiliser le format pour le type (actuellement %1) + + + Use Display Format Based on Type + Utiliser le format d’affichage fondé sur le type + + + Change Display for Type "%1": + Changer l’affichage du type « %1 » : + + + Automatic + Automatique + + + Add Data Breakpoint at Object's Address (0x%1) + Ajouter un point d’arrêt sur les données à l’adresse de l’objet (0x%1) + + + Add Data Breakpoint at Pointer's Address (0x%1) + Ajouter un point d’arrêt de donnée à l’adresse du pointeur (0x%1) + + + Open Memory Editor at Pointer's Address (0x%1) + Ouvrir l’éditeur mémoire à l’adresse du pointeur (0x%1) + + + Open Memory View at Pointer's Address (0x%1) + Ouvrir la vue mémoire à l’adresse du pointeur (0x%1) + + + Open Memory Editor at Pointer's Address + Ouvrir l’éditeur mémoire à l’adresse du pointeur + + + Open Memory View at Pointer's Address + Ouvrir la vue mémoire à l’adresse du pointeur + + + Add Data Breakpoint + Ajouter un point d’arrêt sur les données + + + Add Data Breakpoint at Expression + Ajouter un point d’arrêt de donnée sur l’expression + + + Add Data Breakpoint at Expression "%1" + Ajouter un point d’arrêt sur les données à l’expression « %1 » + + + Select Widget to Add into Expression Evaluator + Sélectionner le widget à ajouter dans l’évaluateur d’expression + + + Remove All Expression Evaluators + Retirer tous les évaluateurs d’expression + + + Open Memory Editor... + Ouvrir l’éditeur de mémoire… + + + Open Memory Editor at Object's Address (0x%1) + Ouvrir l’éditeur de mémoire à l’adresse de l’objet (0x%1) + + + Debugger - %1 + Débogueur - %1 + + + Time + + + + Enter an expression to evaluate. + Saisir une expression à évaluer. + + + Note: Evaluators will be re-evaluated after each step. For details, see the <a href="qthelp://org.qt-project.qtcreator/doc/creator-debug-mode.html#locals-and-expressions">documentation</a>. + Remarque : les évaluateurs seront réévalués après chaque étape.Pour plus de détails, voir la <a href="qthelp://org.qt-project.qtcreator/doc/creator-debug-mode.html#locals-and-expressions">documentation.</a>. + + + New Evaluated Expression + Nouvelle expression évaluée + + + Add New Expression Evaluator... + Ajouter un nouvel évaluateur d’expressions… + + + Expand All Children + Développer tous les enfants + + + Collapse All Children + Réduire tous les enfants + + + Copy View Contents to Clipboard + Copier le contenu de la vue dans le presse-papier + + + Copy Current Value to Clipboard + Copier la valeur actuelle dans le presse-papier + + + Open View Contents in Editor + Ouvrir le contenu de la vue dans l’éditeur + + + Stop the program when the data at the address is modified. + Arrêter le programme lorsque les données à l’adresse sont modifiées. + + + Add Data Breakpoint at Pointer's Address + Ajouter un point d’arrêt de donnée à l’adresse du pointeur + + + Stop the program when the data at the address given by the expression is modified. + Arrêter le programme lorsque les données à l’adresse donnée par l’expression sont modifiées. + + + Open Memory View at Object's Address (0x%1) + Ouvrir la vue mémoire à l’adresse de l’objet (0x%1) + + + Open Memory View Showing Stack Layout + Ouvrir la vue de la mémoire montrant la disposition de la pile + + + Open Memory Editor at Object's Address + Ouvrir l’éditeur mémoire à l’adresse de l’objet + + + Reset All Individual Formats + Réinitialiser tous les formats individuels + + + Reset All Formats for Types + Réinitialiser tous les formats pour les types + + + Change Display Format for Selected Values + Changer le format d’affichage pour les valeurs sélectionnées + + + Change Display for Objects + Changer l’affichage pour les objets + + + Array of %n items + + Tableau d’un élément + Tableau de %1 éléments + + + + Raw Data + Données brutes + + + Enhanced + Amélioré + + + Latin1 String + Chaîne de caractères Latin1 + + + Latin1 String in Separate Window + Chaîne de caractères Latin1 dans une fenêtre séparée + + + UTF-8 String + Chaîne de caractères UTF-8 + + + UTF-8 String in Separate Window + Chaîne de caractères UTF-8 dans une fenêtre séparée + + + Local 8-Bit String + Chaîne de caractères locale 8 bits + + + UTF-16 String + Chaîne de caractères UTF-16 + + + UCS-4 String + Chaîne de caractères UCS-4 + + + Plot in Separate Window + Tracer dans une fenêtre séparée + + + Display Keys and Values Side by Side + Afficher les clés et les valeurs côte à côte + + + Force Display as Direct Storage Form + + + + Force Display as Indirect Storage Form + + + + Display Boolean Values as True or False + Afficher les valeurs booléennes comme « true » ou « false » + + + Display Boolean Values as 1 or 0 + Afficher les valeurs booléennes comme « 1 » ou « 0 » + + + Decimal Integer + Entier décimal + + + Hexadecimal Integer + Entier hexadécimal + + + Binary Integer + Entier binaire + + + Octal Integer + Entier octal + + + Char Code Integer + + + + Compact Float + Flottant compact + + + Scientific Float + Flottant scientifique + + + Hexadecimal Float + Flottant hexadécimal + + + Normalized, with Power-of-Two Exponent + Normalisé, avec un exposant puissance deux + + + Size: %1x%2, %3 byte, format: %4, depth: %5 + Taille : %1x%2, %3 octet, format : %4, profondeur : %5 + + + Are you sure you want to remove all expression evaluators? + Voulez-vous vraiment supprimer tous les évaluateurs d’expressions ? + + + Open Memory View at Object's Address + Ouvrir la vue mémoire à l’adresse de l’objet + + + Open Memory Editor Showing Stack Layout + Ouvrir l’éditeur mémoire montrant la pile + + + Close Editor Tooltips + Fermer l’éditeur d’infobulles + + + Locals & Expressions + Locales et expressions + + + Set up Symbol Paths + Configurer les chemins d’accès aux symboles + + + <html><head/><body><p>The debugger is not configured to use the public Microsoft Symbol Server.<br/>This is recommended for retrieval of the symbols of the operating system libraries.</p><p><span style=" font-style:italic;">Note:</span> It is recommended, that if you use the Microsoft Symbol Server, to also use a local symbol cache.<br/>A fast internet connection is required for this to work smoothly,<br/>and a delay might occur when connecting for the first time and caching the symbols.</p><p>What would you like to set up?</p></body></html> + <html><head/><body><p>Le débogueur n’est pas configuré pour utiliser le serveur de symboles Microsoft publique.<br/>Cela est recommandé pour la réception des symboles des bibliothèques du système d’exploitation.</p><p><span style=" font-style:italic;">Remarque :</span> Il est recommandé, si vous utilisez le serveur de symboles Microsoft, d’utiliser en complément un cache de symboles en local.<br/>Une connexion rapide à Internet est requise pour que cela fonctionne sans ralentissements<br/>et un délai peut apparaître lors de la première connexion et lors de la mise en cache des symboles.</p><p>Que souhaitez-vous configurer ?</p></body></html> + + + Use Local Symbol Cache + Utiliser le cache de symboles local + + + Use Microsoft Symbol Server + Utiliser le serveur de symbole Microsoft + + + Symbol Paths + Chemins des symboles + + + Source Paths + Chemin des sources + + + CDB Paths + Chemins CDB + + + Use alternating row colors in debug views + Alterner la couleur de ligne dans le débogueur visuel + + + Debugger font size follows main editor + La taille de police du débogueur suit celle de l’éditeur principal + + + Switch to previous mode on debugger exit + Retourner au mode précédent à l’arrêt du débogueur + + + Show QML object tree + Afficher l’arbre d’objets QML + + + Set breakpoints using a full absolute path + Définir les points d’arrêt en utilisant un chemin absolu complet + + + Warn when debugging "Release" builds + Avertir lors du débogage en mode « Release » + + + Maximum stack depth: + Profondeur maximale de la pile : + + + <unlimited> + <illimitée> + + + Enables tooltips in the stack view during debugging. + Active les info-bulles dans la vue de la pile pendant le débogage. + + + <html><head/><body><p>Enables stepping backwards.</p><p><b>Note:</b> This feature is very slow and unstable on the GDB side. It exhibits unpredictable behavior when going backwards over system calls and is very likely to destroy your debugging session.</p></body></html> + <html><head/><body><p>Active le mode pas-à-pas en arrière.</p><p><b>Remarque :</b> cette fonction est très lente et instable du côté de GDB. Elle présente un comportement imprévisible lors d’un retour sur les appels système et est fortement susceptible de détruire votre session de débogage.</p></body></html> + + + Registers %1 for debugging crashed applications. + Les registres %1 pour le débogage des applications ont planté. + + + Use %1 for post-mortem debugging + Utiliser %1 pour le débogage post-mortem + + + Display string length: + Afficher la longueur de la chaîne de caractères : + + + The maximum length of string entries in the Locals and Expressions views. Longer than that are cut off and displayed with an ellipsis attached. + La longueur maximale des entrées de chaînes dans les vues « Locales et Expressions ». Les chaînes plus longues sont coupées et affichées avec des points de suspension. + + + Maximum string length: + Longueur maximum de la chaîne de caractères : + + + Debugger settings + Paramètres du débogueur + + + Unable to start LLDB "%1": %2 + Impossible de démarrer LLDB « %1 » : %2 + + + Interrupt requested... + Interruption demandée… + + + Adapter start failed. + Le démarrage de l’adaptateur a échoué. + + + LLDB I/O Error + Erreur d’entrée/sortie de LLDB + + + The LLDB process failed to start. Either the invoked program "%1" is missing, or you may have insufficient permissions to invoke the program. + Échec du démarrage du processus LLDB. Soit le programme « %1 » est manquant, soit les droits sont insuffisants pour exécuter le programme. + + + The LLDB process crashed some time after starting successfully. + Le processus LLDB a planté après avoir démarré correctement. + + + An error occurred when attempting to write to the LLDB process. For example, the process may not be running, or it may have closed its input channel. + Une erreur s’est produite lors d’une tentative d’écriture sur le processus LLDB. Par exemple, le processus peut ne pas être démarré ou avoir fermé son entrée standard. + + + An unknown error in the LLDB process occurred. + Une erreur inconnue est survenue dans le processus LLDB. + + + Adapter start failed + Le démarrage de l’adaptateur a échoué + + + An error occurred when attempting to read from the Lldb process. For example, the process may not be running. + Une erreur s’est produite lors d’une tentative de lecture depuis le processus LLDB. Le processus peut ne pas être en cours d’exécution. + + + Not recognized + Non reconnu + + + Could not determine debugger type + Impossible de déterminer le type de débogueur + + + Type of Debugger Backend + Type du backend du débogueur + + + Unknown debugger version + Version inconnue du débogueur + + + Unknown debugger ABI + ABI inconnue du débogueur + + + Debuggers + Débogueurs + + + Add + Ajouter + + + Type: + Type : + + + Version: + Version : + + + Specify the path to the <a href="%1">Windows Console Debugger executable</a> (%2) here. + Label text for path configuration. %2 is "x-bit version". + <html><body><p>Spécifier le chemin à <a href="%1">l’exécutable du débogueur en console de Windows</a> (%2) ici. + + + Clone + Cloner + + + Clone of %1 + Clone de %1 + + + New Debugger + Nouveau débogueur + + + Restore + Restaurer + + + Auto-detected CDB at %1 + Autodétection CDB à %1 + + + Searching debuggers... + Recherche de débogueurs… + + + System %1 at %2 + %1: Debugger engine type (GDB, LLDB, CDB...), %2: Path + %1 du système à %2 + + + Detected %1 at %2 + %1 détecté à %2 + + + Found: "%1" + Trouvé : « %1 » + + + Auto-detected uVision at %1 + uVision auto-détecté à %1 + + + Removing debugger entries... + Suppression des entrées de débogueur… + + + Removed "%1" + « %1 » supprimé + + + Debuggers: + Débogueurs : + + + Path + Chemin + + + Type + Type + + + Path: + Chemin : + + + ABIs: + ABI : + + + 64-bit version + Version 64 bits + + + 32-bit version + Version 32 bits + + + Starting executable failed: + Échec du lancement de l’exécutable : + + + Cannot set up communication with child process: %1 + Impossible de mettre en place la communication avec le processus enfant : %1 + + + Debug + Debug + + + The process %1 is already under the control of a debugger. +%2 cannot attach to it. + Le processus %1 est déjà sous le contrôle d’un débogueur. +%2 ne peut pas s’y attacher. + + + Not a Desktop Device Type + + + + It is only possible to attach to a locally running process. + Il n’est possible de s’attacher qu’à un processus en cours d’exécution localement. + + + Remove Breakpoint + Retirer le point d’arrêt + + + Cannot start %1 without a project. Please open the project and try again. + Impossible de démarrer %1 sans projet. Veuillez ouvrir le projet et réessayer. + + + Profile + Profile + + + Release + Release + + + Run %1 in %2 Mode? + Lancer %1 en mode %2 ? + + + Global + Général + + + Custom + Personnalisé + + + Restore Global + Restaurer les valeurs générales + + + Use Customized Settings + Utiliser des réglages personnalisés + + + Use Global Settings + Utiliser les paramètres généraux + + + Copy + Copier + + + &Copy + &Copier + + + &Show in Editor + Afficher dans l’éditeur (&S) + + + C&lear + &Effacer + + + &Views + &Vues + + + Leave Debug Mode + Quitter le mode Debug + + + Toolbar + Barre d’outils + + + Editor + Éditeur + + + Next Item + Élément suivant + + + Previous Item + Élément précédent + + + Color at %1,%2: red: %3 green: %4 blue: %5 alpha: %6 + Couleur à la position %1,%2 : rouge : %3 vert : %4 bleu : %5 alpha : %6 + + + <Click to display color> + <Cliquer pour afficher la couleur> + + + Copy Image + Copier l’image + + + Open Image Viewer + Ouvrir un afficheur d’images + + + Debugger Value + Valeur du débogueur + + + Terminal: Cannot open /dev/ptmx: %1 + Terminal : impossible d’ouvrir /dev/ptmx : %1 + + + Terminal: ptsname failed: %1 + Terminal : ptsname a échoué : %1 + + + Terminal: Error: %1 + Terminal : erreur : %1 + + + Terminal: Slave is no character device. + + + + Terminal: grantpt failed: %1 + Terminal : grantpt a échoué : %1 + + + Terminal: unlock failed: %1 + Terminal : échec du déverrouillage : %1 + + + Terminal: Read failed: %1 + Terminal : la lecture a échoué : %1 + + + Attach to Process Not Yet Started + Attacher à un processus pas encore démarré + + + Reopen dialog when application finishes + Rouvrir la boite de dialogue à la fin de l’application + + + Reopens this dialog when application finishes. + Rouvre cette boite de dialogue lorsque l’application se termine. + + + Continue on attach + Continuer à attacher + + + Debugger does not stop the application after attach. + Le débogueur n’arrête pas l’application après l’attachement. + + + Start Watching + Démarrer l’observation + + + Kit: + Kit : + + + Executable: + Exécutable : + + + Stop Watching + Arrêter l’observation + + + Select valid executable. + Sélectionner un exécutable valide. + + + Not watching. + Pas d’observation. + + + Waiting for process to start... + En attente du lancement du processus… + + + Attach + Attacher + + + %1.%2 + %1.%2 + + + Unknown error. + Erreur inconnue. + + + Connection is not open. + La connexion n’est pas ouverte. + + + Locals and Expressions + Locales et expressions QtC::Designer - - The file name is empty. - Le nom de fichier est vide. - - - XML error on line %1, col %2: %3 - Erreur XML à la ligne %1, col %2 : %3 - - - The <RCC> root element is missing. - L'élement racine <RCC> est manquant. - - - Cannot write file. Disk full? - Impossible d'écrire le fichier. Disque plein ? - - - Xml Editor - Éditeur XML - Designer Designer - - Class Generation - Génération de classe - Form Editor - Éditeur d'interface graphique - - - The generated header of the form '%1' could be found. -Rebuilding the project might help. - Impossible de trouver un en-tête généré pour l'interface graphique %1. -Regénérer le projet peut résoudre ce problème. - - - The generated header of the form '%1' could not be found. -Rebuilding the project might help. - Impossible de trouver une en-tête générée pour l'interface graphique %1. -Regénérer le projet peut résoudre ce problème. - - - The generated header '%1' could not be found in the code model. -Rebuilding the project might help. - Impossible de trouver l'en-tête généré %1 dans le modèle de code. -Regénérer le projet peut résoudre ce problème. + Éditeur d’interface graphique Qt Designer Form Class - Classe d'interface graphique Qt Designer + Classe d’interface graphique Qt Designer Form Template - Modèle d'interface graphique + Modèle d’interface graphique Class Details Détails de la classe - - Choose a class name - Choisissez un nom de classe - Class Classe - - Configure... - Configurer... - %1 - Error %1 - Erreur Choose a Class Name - Choisissez un nom de classe - - - Qt - Qt - - - Qt Designer Form - Interface graphique Qt Designer - - - Creates a Qt Designer form that you can add to a Qt Widget Project. This is useful if you already have an existing class for the UI business logic. - Crée un formulaire Qt Designer que l'on peut ajouter à un projet Qt Widget. Ceci est utile si vous utilisez déjà une classe pour la logique métier de l'interface. + Sélectionner un nom de classe Creates a Qt Designer form along with a matching class (C++ header and source file) for implementation purposes. You can add the form and class to an existing Qt Widget Project. - Crée un formulaire Qt Designer avec une classe correspondante (en-tête C++ et fichier source) pour implémentation. Vous pouvez ajouter le formulaire et la classe à un projet Qt Widget existant. - - - Creates a Qt Designer form along with a matching class (C++ header and source file) for implementation purposes. You can add the form and class to an existing Qt C++ Project. - Crée une interface Qt Designer avec une classe lui correspondant (en-tête et fichier source C++) pour l'implémentation. Vous pouvez ajouter l'interface et la classe à un projet Qt C++ existant. - - - Creates a Qt Designer form that you can add to a Qt C++ project. This is useful if you already have an existing class for the UI business logic. - Crée une interface Qt Designer que vous pouvez ajouter à un projet Qt C++. Ceci est utile si vous disposez déjà d'une classe existante pour la couche métier de l'interface utilisateur. - - - Creates a Qt Designer form file (.ui). - Crée un fichier d'interface graphique Qt Designer (.ui). - - - Creates a Qt Designer form file (.ui) with a matching class. - Crée un fichier d'interface graphique Qt Designer (.ui) avec une classe correspondante. + Crée un formulaire Qt Designer avec une classe correspondante (en-tête C++ et fichier source) pour implémentation. Vous pouvez ajouter le formulaire et la classe à un projet Qt Widget existant. Widget Box this translation must coherent with the translation of Qt Designer - Boîte de widget + Boite de widget Object Inspector Je trouve que "Inspecteur d'objet" est peu adapté. Explorateur d'objet n'est pas excellent non plus, à changer surement. - Inspecteur d'objet + Inspecteur d’objets Widget box - Boîte de widget + Boite de widgets Property Editor - Éditeur de propriété - - - Signals & Slots Editor - Éditeur de signaux et slots + Éditeur de propriétés Action Editor - Éditeur d'action - - - For&m editor - Éditeur d'&interface graphique - - - Edit widgets - Éditer les widgets + Éditeur d’actions F3 F3 - - Edit signals/slots - Éditer signaux/slots - F4 F4 - - Edit buddies - Éditer les copains - - - Edit tab order - Éditer l'ordre des onglets - For&m Editor - Éditeur d'&interface graphique + Éditeur d’&interface graphique Edit Widgets - Éditer les widgets + Modifier les widgets Edit Signals/Slots - Éditer signaux/slots + Modifier les signaux/slots Edit Buddies - Éditer les copains + Modifier les copains (« buddies ») Edit Tab Order - Éditer l'ordre des onglets - - - Meta+H - Meta+H + Modifier l’ordre des onglets Ctrl+H @@ -5139,7 +25621,7 @@ Regénérer le projet peut résoudre ce problème. Meta+Shift+H - Meta+Shift+H + Meta+Maj+H Meta+L @@ -5150,8 +25632,8 @@ Regénérer le projet peut résoudre ce problème. Ctrl+L - Meta+G - Meta+G + Signals and Slots Editor + Éditeur de signaux et de slots Ctrl+G @@ -5159,7 +25641,7 @@ Regénérer le projet peut résoudre ce problème. Meta+Shift+G - Meta+Shift+G + Meta+Maj+G Meta+J @@ -5171,7 +25653,7 @@ Regénérer le projet peut résoudre ce problème. Alt+Shift+R - Alt+Shift+R + Alt+Maj+R Switch Source/Form @@ -5179,73 +25661,42 @@ Regénérer le projet peut résoudre ce problème. Shift+F4 - Shift+F4 + Maj+F4 About Qt Designer Plugins... - À propos des plugins de Qt Designer... - - - Views - Vues + À propos des greffons de Qt Designer… Signals && Slots Editor && ? typo in original ? Éditeur de signaux et slots - - Locked - Verrouillé - - - Reset to Default Layout - Restaurer la disposition par défaut - - - Ctrl+Alt+R - Ctrl+Alt+R - - - About Qt Designer plugins.... - À propos des plug-ins Qt Designer.... - Preview in Aperçu dans - The image could not be created: %1 - L'image ne peut pas être créée : %1 + Switch Mode + Changer de mode - Choose a form template - Choisir un modèle d'interface graphique + The image could not be created: %1 + L’image ne peut pas être créée : %1 Choose a Form Template - Choisir un modèle d'interface graphique + Sélectionner un modèle d’interface graphique - Error saving %1 - Erreur lors de l'enregistrement de %1 - - - Unable to open %1: %2 - Impossible d'ouvrir %1 : %2 - - - Unable to write to %1: %2 - Impossible d'écrire dans %1 : %2 - - - The class definition of '%1' could not be found in %2. - La déclaration de la classe %1 est introuvable dans %2. - - - The class containing '%1' could not be found in %2. + The class containing "%1" could not be found in %2. Please verify the #include-directives. - La classe contenant "%1" n'a pas pu être trouvée dans %2. Veuillez vérifier les directives #include. + La classe contenant « %1 » n’a pas pu être trouvée dans %2. +Veuillez vérifier les directives #include. + + + Cannot rename UI symbol "%1" in C++ files: %2 + Impossible de renommer le symbole UI « %1 » dans les fichiers C++ : %2 Error finding/adding a slot. @@ -5253,33 +25704,571 @@ Please verify the #include-directives. Erreur de la recherche/ajout de slot. - Internal error: No project could be found for %1. - Erreur interne : Aucun projet n'a pu être trouvé pour %1. + No documents matching "%1" could be found. +Rebuilding the project might help. + Aucun document correspondant à « %1 » n’a pu être trouvé. +Recompiler le projet pourrait aider. - No documents matching '%1' could be found. -Rebuilding the project might help. - Impossible de trouver un document correspondant à %1. -Regénérer le projet peut résoudre ce problème. + File "%1" not found in project. + Fichier « %1 » introuvable dans le projet. + + + No active target. + Aucune cible active. + + + No active build system. + Aucun système de compilation. + + + Failed to find the ui header. + L’en-tête UI n’a pas été trouvé. + + + Renaming via the property editor cannot be synced with C++ code; see QTCREATORBUG-19141. This message will not be repeated. + Le renommage via l’éditeur de propriétés ne peut pas être synchronisé avec le code C++ ; voir QTCREATORBUG-19141. Ce message ne sera pas répété. + + + Failed to retrieve ui header contents. + Échec de la réception du contenu de l’en-tête UI. + + + Failed to locate corresponding symbol in ui header. + Échec de la localisation du symbole correspondant dans l’en-tête UI. Unable to add the method definition. - Impossible d'ajouter la déclaration de la méthode. + Impossible d’ajouter la déclaration de la méthode. + + + This file can only be edited in <b>Design</b> mode. + Ce fichier ne peut être édité qu’en mode <b>Design</b>. + + + The generated header of the form "%1" could not be found. +Rebuilding the project might help. + L’en-tête généré de l’interface « %1 » n’a pas pu être trouvé. +La recompilation du projet peut aider. + + + The generated header "%1" could not be found in the code model. +Rebuilding the project might help. + L’en-tête généré « %1 » n’a pas pu être trouvé dans le modèle du code. +La recompilation du projet peut aider. + + + &Class name: + Nom de la &classe : + + + &Header file: + Fichier d’&en-tête : + + + &Source file: + Fichier &source : + + + &Form file: + &Fichier d’interface : + + + &Path: + Che&min : + + + Invalid header file name: "%1" + Nom de fichier d’en-tête invalide : « %1 » + + + Invalid source file name: "%1" + Nom de fichier source invalide : « %1 » + + + Invalid form file name: "%1" + Nom de fichier d’interface invalide : « %1 » - EmbeddedPropertiesPage + QtC::DiffEditor - Use Virtual Box -Note: This adds the toolchain to the build environment and runs the program inside a virtual machine. -It also automatically sets the correct Qt version. - Utiliser Virtual Box -Note : ceci ajoute la chaîne d'outils à l'environnement de compilation et exécute le programme à l'intérieur d'une machine virtuelle. -La version de Qt est aussi définie automatiquement. + Ignore Whitespace + Ignorer les espaces - Skin: - Revêtement : + Switch to Unified Diff Editor + Basculer vers l’éditeur de diff unifié + + + Waiting for data... + En attente de données… + + + Retrieving data failed. + La réception des données a échoué. + + + Switch to Side By Side Diff Editor + Basculer vers l’éditeur de différences face à face + + + Synchronize Horizontal Scroll Bars + Synchroniser les barre de défilement horizontale + + + Context lines: + Lignes contextuelles : + + + Reload Diff + Recharger le diff + + + [%1] vs. [%2] %3 + [%1] contre [%2] %3 + + + %1 vs. %2 + %1 contre %2 + + + [%1] %2 vs. [%3] %4 + [%1] %2 contre [%3] %4 + + + Diff Editor + Éditeur de diff + + + Diff + Diff + + + Saved + Enregistrée + + + Modified + Modifié + + + Diff Files + Diff les fichiers + + + Diff Modified Files + Diff les fichiers modifiés + + + &Diff + &Diff + + + Diff Current File + Diff le fichier actuel + + + Meta+H + Meta+H + + + Ctrl+H + Ctrl+H + + + Diff Open Files + Diff les fichiers ouverts + + + Meta+Shift+H + Meta+Maj+H + + + Ctrl+Shift+H + Ctrl+Maj+H + + + Diff External Files... + Diff des fichiers externes… + + + Diff "%1" + DIff « %1 » + + + Select First File for Diff + Sélectionner le premier fichier pour Diff + + + Select Second File for Diff + Sélectionner le second fichier pour Diff + + + Diff "%1", "%2" + Diff « %1 », « %2 » + + + Skipped %n lines... + + Passer %n ligne… + Passer %n lignes… + + + + Binary files differ + Les fichiers binaires diffèrent + + + Skipped unknown number of lines... + Le nombre de lignes sautées est inconnu… + + + [%1] %2 + [%1] %2 + + + No difference. + Aucune différence. + + + Rendering diff + + + + Hide Change Description + Masquer la description des changements + + + Show Change Description + Afficher la description des changements + + + Could not parse patch file "%1". The content is not of unified diff format. + Impossible d’analyser le fichier de patch « %1 ». Le contenu n’est pas au format diff unifié. + + + Send Chunk to CodePaster... + Envoyer le morceau à CodePaster… + + + Apply Chunk... + Appliquer le morceau… + + + Revert Chunk... + Rétablir le morceau… + + + <b>Error:</b> Could not decode "%1" with "%2"-encoding. + <b>Erreur :</b> impossible de décoder « %1 » avec l’encodage « %2 ». + + + Select Encoding + Choisir l’encodage + + + No document + Aucun document + + + + QtC::Docker + + Checking docker daemon + Vérification du démon docker + + + Path "%1" is not a directory or does not exist. + + + + Docker + + + + Docker Image + + + + Docker Image "%1" (%2) + + + + Error starting remote shell. No container. + + + + Error starting remote shell: %1 + + + + Open Shell in Container + + + + Docker daemon appears to be not running. Verify daemon is up and running and reset the docker daemon on the docker device settings page or restart Qt Creator. + + + + Docker Image Selection + + + + Show Unnamed Images + + + + Loading ... + + + + Running "%1" + + + + + Unexpected result: %1 + Résultat inattendu : %1 + + + Done. + Fait. + + + Error: %1 + Erreur : %1 + + + Docker Device + + + + localSource: No mount point found for %1 + + + + Repository: + Dépôt : + + + Tag: + + + + Image ID: + + + + Daemon state: + + + + Clears detected daemon state. It will be automatically re-evaluated next time access is needed. + + + + Do not modify entry point + + + + Prevents modifying the entry point of the image. Enable only if the image starts into a shell. + + + + Enable flags needed for LLDB + + + + Adds the following flags to the container: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined, this is necessary to allow lldb to run + + + + Run as outside user + + + + Uses user ID and group ID of the user running Qt Creator in the docker container. + + + + Clangd Executable: + Exécutable Clangd : + + + Paths to mount: + + + + Source directory list should not be empty. + + + + Host directories to mount into the container + + + + Maps paths in this list one-to-one to the docker container. + + + + Auto-detect Kit Items + + + + Remove Auto-Detected Kit Items + + + + List Auto-Detected Kit Items + + + + Search in PATH + + + + Search in Selected Directories + + + + Search in PATH and Additional Directories + + + + Semicolon-separated list of directories + + + + Select the paths in the docker image that should be scanned for kit entries. + + + + Docker daemon appears to be not running. + + + + Docker daemon appears to be running. + + + + Search Locations: + + + + Detection log: + + + + Daemon state not evaluated. + + + + Docker daemon running. + + + + Docker daemon not running. + + + + Docker CLI + + + + Command: + Commande : + + + Configuration + Configuration + + + + QtC::EmacsKeys + + Delete Character + Supprimer un caractère + + + Kill Word + Tuer le mot + + + Kill Line + Tuer la ligne + + + Insert New Line and Indent + Insérer une nouvelle ligne et indenter + + + Go to File Start + Aller au début du fichier + + + Go to File End + Aller à la fin du fichier + + + Go to Line Start + Aller au début de ligne + + + Go to Line End + Aller à la fin de ligne + + + Go to Next Line + Aller à la ligne suivante + + + Go to Previous Line + Aller à la ligne précédente + + + Go to Next Character + Aller au caractère suivant + + + Go to Previous Character + Aller au caractère précédent + + + Go to Next Word + Aller au mot suivant + + + Go to Previous Word + Aller au mot précédent + + + Mark + Marquer + + + Exchange Cursor and Mark + Échanger le curseur et la marque + + + Copy + Copier + + + Cut + Couper + + + Yank + + + + Scroll Half Screen Down + Défiler jusqu’à la moitié de l’écran vers le bas + + + Scroll Half Screen Up + Défiler jusqu’à la moitié de l’écran vers le haut @@ -5292,18 +26281,10 @@ La version de Qt est aussi définie automatiquement. Version: Version : - - Compatibility Version: - Version compatible : - Vendor: Vendeur : - - Url: - Url : - Location: Emplacement : @@ -5325,6 +26306,10 @@ La version de Qt est aussi définie automatiquement. Dependencies: Dépendances : + + %1 (current: "%2") + %1 (actuel : « %2 ») + Group: Groupe : @@ -5332,11 +26317,11 @@ La version de Qt est aussi définie automatiquement. Compatibility version: cf libs/extensionsystem/plugindetailsview.ui et PluginSpecPrivate::provides() : version minimum compatible - Version compatible : + Version compatible : URL: - URL : + URL : Platforms: @@ -5347,32 +26332,84 @@ La version de Qt est aussi définie automatiquement. État : - Error Message: - Message d'erreur : + Description file found, but error on read. + Le fichier de description a été trouvé, mais une erreur de lecture est survenue. + + + Description successfully read. + La description a été lue avec succès. + + + Dependencies are successfully resolved. + Les dépendances ont été résolues avec succès. + + + Library is loaded. + La bibliothèque a été chargée. + + + Plugin's initialization function succeeded. + La fonction d’initialisation du greffon a réussi. + + + Plugin successfully loaded and running. + Le greffon a été chargé avec succès et fonctionne. + + + Plugin was shut down. + Le greffon a été fermé. + + + Plugin ended its life cycle and was deleted. + Le greffon a terminé son cycle de vie et a été supprimé. Error message: - Message d'erreur : + Message d’erreur : - File does not exist: %1 - Le fichier n'existe pas : %1 + %1 (experimental) + %1 (expérimental) - Could not open file for read: %1 - Impossible d'ouvrir le fichier en lecture : %1 + Path: %1 +Plugin is not available on this platform. + Chemin : %1 +Le greffon n’est pas disponible sur cette plateforme. - Cannot open file %1 for reading: %2 - Impossible d'ouvrir le fichier %1 en lecture : %2 + Path: %1 +Plugin is enabled as dependency of an enabled plugin. + Chemin : %1 +Le greffon est activé en tant que dépendance d’un greffon activé. - Error parsing file %1: %2, at line %3, column %4 - Erreur pendant l'analyse du fichier %1 : %2, ligne %3, colonne %4 + Path: %1 +Plugin is enabled by command line argument. + Chemin : %1 +Le greffon est activé par un argument de ligne de commande. - State - État + Path: %1 +Plugin is disabled by command line argument. + Chemin : %1 +Le greffon est désactivé par un argument de ligne de commande. + + + Path: %1 + Chemin : %1 + + + Plugin is not available on this platform. + Le greffon n’est pas disponible sur cette plateforme. + + + Plugin is required. + Le plugin est nécessaire. + + + Load on startup + Charger au démarrage Name @@ -5387,8 +26424,36 @@ La version de Qt est aussi définie automatiquement. Vendeur - Location - Emplacement + Enabling Plugins + Activation des greffons + + + Enabling +%1 +will also enable the following plugins: + +%2 + Activer +%1 +activera également les greffons suivants : + +%2 + + + Disabling Plugins + Désactivation des greffons + + + Disabling +%1 +will also disable the following plugins: + +%2 + Désactiver +%1 +désactivera également les greffons suivants : + +%2 Load @@ -5398,134 +26463,232 @@ La version de Qt est aussi définie automatiquement. Invalid Invalide - - Description file found, but error on read - Fichier de description trouvé mais erreur de lecture - Read Lecture - - Description successfully read - Succès de la lecture de la description - Resolved Résolu - - Dependencies are successfully resolved - Les dépendances ont été résolues avec succès - Loaded Chargé - - Library is loaded - Bibliothèque chargée - Initialized Initialisé - - Plugin's initialization function succeeded - Fonction d'initialisation du plug-in réussie - - - Plugin's initialization method succeeded - Méthode d'initialisation du plug-in réussie - Running - En cours d'exécution - - - Plugin successfully loaded and running - Plug-in correctement chargé et démarré + En cours d’exécution Stopped Arrêté - - Plugin was shut down - Plug-in arrêté - Deleted Supprimé - - Plugin ended its life cycle and was deleted - Le plug-in a terminé son cycle de vie et a été supprimé - - - Circular dependency detected: - - Dépendance circulaire détectée : - - - - %1(%2) depends on - - %1(%2) dépend de - - Circular dependency detected: Dépendance circulaire détectée : - %1(%2) depends on - %1(%2) dépend de + %1 (%2) depends on + %1 (%2) dépend de - %1(%2) + %1 (%2) %1 (%2) - Cannot load plugin because dependencies are not resolved - Impossible de charger le plug-in car les dépendances ne sont pas résolues + Cannot load plugin because dependency failed to load: %1 (%2) +Reason: %3 + Impossible de charger le greffon car la dépendance n’a pas pu être chargée : %1 (%2) +Raison : %3 + + + %1 > About Plugins + %1 > À propos des greffons + + + Help > About Plugins + Aide > À propos des greffons + + + If you temporarily disable %1, the following plugins that depend on it are also disabled: %2. + + + Si vous désactivez temporairement %1, les greffons suivants qui en dépendent seront également désactivés : %2. + + + + + Disable plugins permanently in %1. + Désactiver les greffons de façon permanente dans %1. + + + The last time you started %1, it seems to have closed because of a problem with the "%2" plugin. Temporarily disable the plugin? + La dernière fois que vous avez lancé %1, il semble qu’il se soit fermé en raison d’un problème avec le greffon « %2 ». Désactiver temporairement le greffon ? + + + Disable Plugin + Désactiver le greffon Cannot load plugin because dependency failed to load: %1(%2) Reason: %3 - Impossible de charger le plug-in car une des dépendances n'a pas pu être chargé : %1(%2) + Impossible de charger le greffon car une des dépendances n’a pas pu être chargé : %1(%2) Raison : %3 + + The plugin "%1" is specified twice for testing. + Le greffon « %1 » est spécifié deux fois pour les tests. + + + The plugin "%1" does not exist. + Le greffon « %1 » n’existe pas. + + + The plugin "%1" is not tested. + Le greffon « %1 » n’est pas testé. + + + Cannot request scenario "%1" as it was already requested. + Impossible de demander le scénario « %1 » car il a déjà été demandé. + + + Unknown option %1 + Option « %1 » non reconnue + + + The option %1 requires an argument. + L’option %1 requiert un argument. + + + Resolving dependencies failed because state != Read + La résolution des dépendances a échoué car l’état actuel est différent de « Lecture » + + + Loading the library failed because state != Resolved + Le chargement de la bibliothèque a échoué car l’état actuel est différent de « Résolu » + + + Initializing the plugin failed because state != Loaded + L’initialisation du greffon a échoué car l’état actuel est différent de « Chargé » + + + Cannot perform extensionsInitialized because state != Initialized + Impossible d’exécuter extensionsInitialized car l’état est différent de « Initialisé » + + + Could not resolve dependency '%1(%2)' + Impossible de résoudre la dépendance « %1(%2) » + + + "%1" is missing + « %1 » est manquant + + + Value for key "%1" is not a string + La valeur pour la clé « %1 » n’est pas une chaîne de caractères + + + Value for key "%1" is not a bool + La valeur pour la clé « %1 » n’est pas un booléen + + + Value for key "%1" is not an array of objects + La valeur pour la clé « %1 » n’est pas tableau d’objets + + + Value for key "%1" is not a string and not an array of strings + La valeur pour la clé « %1 » n’est pas une chaîne de caractères, ni un tableau d’objets + + + Value "%2" for key "%1" has invalid format + La valeur « %2 » pour la clé « %1 » a un format invalide + + + Plugin meta data not found + Les métadonnées du greffon n’ont pas été trouvées + + + Invalid platform specification "%1": %2 + La spécification de la plate-forme « %1 » n’est pas valide : %2 + + + Dependency: %1 + Dépendance : %1 + + + Dependency: "%1" must be "%2" or "%3" (is "%4"). + Dépendance : « %1 » doit être « %2 » ou « %3 » (est « %4 »). + + + Argument: %1 + Argument : %1 + + + Argument: "%1" is empty + Argument : « %1 » est vide + + + Plugin is not valid (does not derive from IPlugin) + Le greffon n’est pas valide (il n’est pas une sous-classe de IPlugin) + + + Internal error: have no plugin instance to initialize + Erreur interne : pas d’instance du greffon à initialiser + + + Plugin initialization failed: %1 + L’initialisation du greffon a échoué : %1 + + + Internal error: have no plugin instance to perform extensionsInitialized + Erreur interne: aucune instance de l’extension sur laquelle exécuter extensionsInitialized + + + Internal error: have no plugin instance to perform delayedInitialize + Erreur interne : aucune instance de l’extension sur laquelle exécuter delayedInitialized + + + None + Aucune + + + All + Tout + + + Load on Startup + Charger au démarrage + + + Utilities + Utilitaires + + + The following plugins have errors and cannot be loaded: + Les chemins suivant contiennent des erreurs et ne peuvent être chargés : + + + Details: + Détails : + + + Continue + Continue + QtC::FakeVim - - Toggle vim-style editing - Activer/désactiver l'édition en mode vim - - - FakeVim properties... - Propriétés de FakeVim... - Use Vim-style Editing - Utiliser l'édition en mode vim - - - Read .vimrc - prendre en compte .vimrc - - - Path to .vimrc - Chemin vers .vimrc - - - Not implemented in FakeVim - Pas implémenté dans FakeVim - - - E20: Mark '%1' not set - E20 : Marque "%1" non définie + Utiliser l’édition en mode Vim %1%2% @@ -5535,76 +26698,42 @@ Raison : %3 %1All %1Tout - - File '%1' exists (add ! to override) - Le fichier "%1" existe déjà (ajoutez ! pour écraser) - - - Cannot open file '%1' for writing - Impossible d'ouvrir le fichier "%1" en écriture - "%1" %2 %3L, %4C written - "%1" %2 %3L, %4C écrit - - - Cannot open file '%1' for reading - Impossible d'ouvrir le fichier "%1" en lecture + « %1 » %2 %3L, %4C écrit "%1" %2L, %3C - "%1" %2L, %3C - - - %n lines filtered - - %n ligne filtrée - %n lignes filtrées - - - - %n lines >ed %1 time - - %n ligne >ed %1 fois - %n lignes >ed %1 fois - - - - E512: Unknown option: - E512 : option inconnue : - - - search hit BOTTOM, continuing at TOP - la recherche a atteint la fin du document, continue à partir du début - - - search hit TOP, continuing at BOTTOM - la recherche a atteint le début du document, continue à partir de la fin - - - Pattern not found: - Motif non trouvé : - - - Mark '%1' not set - Marque "%1" non placée - - - Mark '%1' not set. - Marque "%1" non placée. + « %1 » %2L, %3C Not implemented in FakeVim. Pas implémenté dans FakeVim. - Unknown option: - Option inconnue : + Mark "%1" not set. + + + + Type Meta-Shift-Y, Meta-Shift-Y to quit FakeVim mode. + + + + Type Alt-Y, Alt-Y to quit FakeVim mode. + Unknown option: Option inconnue : + + Invalid argument: + + + + Trailing characters: + + Move lines into themselves. Déplacer les lignes dans elles-mêmes. @@ -5618,19 +26747,19 @@ Raison : %3 File "%1" exists (add ! to override) - Le fichier "%1" existe (ajouter ! pour écraser) + Le fichier « %1 » existe (ajouter « ! » pour écraser) Cannot open file "%1" for writing - Impossible d'ouvrir le fichier "%1" en écriture + Impossible d’ouvrir le fichier « %1 » en écriture "%1" %2 %3L, %4C written. - "%1" %2 %3L, %4C écrites. + « %1 » %2 %3L, %4C écrites. Cannot open file "%1" for reading - Impossible d'ouvrir le fichier "%1" en lecture + Impossible d’ouvrir le fichier « %1 » en lecture %n lines filtered. @@ -5685,16 +26814,9 @@ Raison : %3 Already at newest change. Déjà au changement le plus récent. - - %n lines %1ed %2 time - - %n ligne %1ée %2 fois - %n lignes %1ées %2 fois - - Cannot open file %1 - Impossible d'ouvrir le fichier %1 + Impossible d’ouvrir le fichier %1 Pattern not found: %1 @@ -5702,19 +26824,7 @@ Raison : %3 Invalid regular expression: %1 - Expression régulière invalide : %1 - - - Can't open file %1 - Impossible d'ouvrir le fichier %1 - - - Already at oldest change - Déjà au changement le plus ancien - - - Already at newest change - Déjà au changement le plus récent + Expression rationnelle invalide : %1 Unknown option: %1 @@ -5722,7 +26832,7 @@ Raison : %3 Argument must be positive: %1=%2 - L'argument doit être positif : %1 = %2 + L’argument doit être positif : %1 = %2 General @@ -5752,6 +26862,10 @@ Raison : %3 Start of line Début de ligne + + Pass control keys + + Smart indentation Indentation intelligente @@ -5772,14 +26886,6 @@ Raison : %3 Smart tabulators Tabulation intelligente - - Pass key sequences like Ctrl-S to Qt Creator core instead of interpreting them in FakeVim. This gives easier access to Qt Creator core functionality at the price of losing some features of FakeVim. - Passer les séquences de touches comme Ctrl-S à Qt Creator au lieu de les interpréter dans FakeVim. Ceci donne un accès plus facile aux fonctionnalités de base de Qt Creator au prix de la perte de certaines fonctionnalités de FakeVim. - - - Pass control key - Passer la clé de contrôle - Highlight search results Surligner les résultats de recherche @@ -5790,16 +26896,24 @@ Raison : %3 Shift width: - Largeur d'indentation : - - - Vim tabstop option - Option tabstop de Vim + Largeur d’indentation : Tabulator size: Taille des tabulations : + + Use tildeop + + + + Show line numbers relative to cursor + + + + Blinking cursor + + Backspace: Touche retour : @@ -5810,7 +26924,7 @@ Raison : %3 Copy Text Editor Settings - Copier les paramètres de l'éditeur de texte + Copier les paramètres de l’éditeur de texte Set Qt Style @@ -5820,6 +26934,10 @@ Raison : %3 Set Plain Style Utiliser le style simple + + Plugin Emulation + + Use smartcase Utiliser la sensibilité à la casse intelligente @@ -5836,10 +26954,6 @@ Raison : %3 Show partial command Montrer la commande partielle - - Let Qt Creator handle some key presses in insert mode so that code can be properly completed and expanded. - Laisser Qt Creator gérer quelques touches en mode d'insertion, de sorte que le code puisse être remplis et étendu correctement. - Pass keys in insert mode Passez des touches en mode insertion @@ -5850,490 +26964,623 @@ Raison : %3 Read .vimrc from location: - Lire .vimrc depuis l'emplacement : + Lire .vimrc depuis l’emplacement : + + + Displays line numbers relative to the line containing text cursor. + + + + Does not interpret key sequences like Ctrl-S in FakeVim but handles them as regular shortcuts. This gives easier access to core functionality at the price of losing some features of FakeVim. + + + + Does not interpret some key presses in insert mode so that code can be properly completed and expanded. + + + + Vim tabstop option. + Keep empty to use the default path, i.e. %USERPROFILE%\_vimrc on Windows, ~/.vimrc otherwise. - Laissez vide pour utiliser le chemin par défaut, c'est-à-dire %USERPROFILE%\_vimrc sur Windows, ~/.vimrc autrement. - - - Browse... - Parcourir... - - - Switch to next file - Passer au fichier suivant - - - Switch to previous file - Passer au fichier précédent - - - Quit FakeVim - Quitter FakeVim - - - Meta+V,Meta+V - Meta+V, Meta+V - - - Alt+V,Alt+V - Alt+V, Alt+V + Laissez vide pour utiliser le chemin par défaut, c’est-à-dire %USERPROFILE%\_vimrc sur Windows, ~/.vimrc autrement. Execute User Action #%1 - Exécuter l'action utilisateur %1 - - - Meta+V,%1 - Meta+V, %1 - - - Alt+V,%1 - Alt+V, %1 + Exécuter l’action utilisateur %1 File not saved - Fichier non sauvegardé + Fichier non enregistré Saving succeeded - Succés de l'enregistrement + Succès de l’enregistrement %n files not saved - %n fichier n'a pas pu être enregistré - %n fichiers n'ont pas pu être enregistré + %n fichier n’a pas pu être enregistré + %n fichiers n’ont pas pu être enregistrés - FakeVim Information - Information sur FakeVim + Recursive mapping + Construction de correspondance récursif - Vim style settings - Paramètres de l'édition de type vim + [New] + [Nouveau] - vim's "expandtab" option - option "expandtab" de vim + Not an editor command: %1 + Pas une commande de l’éditeur : %1 - Expand tabulators: - Étendre les tabulations : + Ex Command Mapping + Mappage des commandes Ex - Highlight search results: - Surligner les résultats de recherche : + Ex Trigger Expression + Expression d’activation Ex - Smart tabulators: - Tabulation intelligente : + Reset + Réinitialiser - Start of line: - Début de ligne : + Reset to default. + Restaurer les paramètres par défaut. - vim's "tabstop" option - option "tabstop" de vim + Regular expression: + Expression rationnelle : - VIM's "autoindent" option - option "autoindent" de vim + Meta+Shift+Y,Meta+Shift+Y + - Automatic indentation: - Indentation automatique : + Alt+Y,Alt+Y + - Incremental search: - Recherche incrémentale : + Meta+Shift+Y,%1 + - Copy text editor settings - Copier les paramètres de l'éditeur de texte + Alt+Y,%1 + - Set Qt style - Définir le style de Qt + Ex Command + Commande Ex - Set plain style - Définir le style plein + Action + Action - Checking this box passes key sequences like Ctrl-S to the Creator core instead of interpreting them in FakeVim. This gives easier access to Creator core functionality at the price of losing some features of FakeVim. - Cocher cette case passe des séquences comme Ctrl+S au coeur de Creator au lieu de les interpréter dans FakeVim. Ceci donne un accès plus facile aux fonctionnalités du coeur de Creator, au prix de la perte de quelques fonctionnalités de FakeVim. + Command + Commande + + + User command #%1 + Commande utilisateur #%1 + + + User Command Mapping + Correspondance des commandes utilisateur - FilterNameDialogClass + QtC::Fossil - Add Filter Name - Nom du filtre à ajouter + Commit Editor + Faire un commit de l’éditeur - Filter Name: - Nom du filtre : - - - - FilterSettingsPage - - Filters - Filtres + Configure Repository + - Attributes - Attributs + Existing user to become an author of changes made to the repository. + - 1 - 1 + SSL/TLS Identity Key + - Add - Ajouter + SSL/TLS client identity key to use if requested by the server. + - Remove - Supprimer + Disable auto-sync + - <html><body> -<p> -Add, modify, and remove document filters, which determine the documentation set displayed in the Help mode. The attributes are defined in the documents. Select them to display a set of relevant documentation. Note that some attributes are defined in several documents. -</p></body></html> - <html><body> -<p> -Ajouter, modifier et supprimer des filtres de documents, qui détermine l'ensemble des contenus affichés dans le mode Aide. Les attributs sont définis dans les documents. Sélectionnez les pour afficher la documentation appropriée. Note : certains attributs sont définis dans plusieurs documents. -</p></body></html> + Disable automatic pull prior to commit or update and automatic push after commit or tag or branch creation. + - No user defined filters available or no filter selected. - Pas de filtre défini par l'utilisateur diponible ou pas de filtre sélectionné. - - - - QtC::Core - - Search for... - Rechercher... + Repository User + - Sc&ope: - &Contexte : + User: + Utilisateur : - &Search - &Rechercher + Repository Settings + - Search &for: - Rec&herche : + SSL/TLS identity: + - &Case sensitive - Sensible à la &casse + Ignore All Whitespace + Ignorer toutes les espaces - &Whole words only - &Mots complets uniquement + Strip Trailing CR + - Search && Replace - Remplacer && Suivant + Show Committers + - Use regular e&xpressions - Utiliser des e&xpressions régulières + List Versions + - Sco&pe: - &Contexte : + Ancestors + - Sear&ch for: - Rec&herche : + Descendants + - Case sensiti&ve - Sensible à la &casse + Unfiltered + Sans filtre - Whole words o&nly - &Mots complets uniquement + Lineage + - Use re&gular expressions - Utiliser des e&xpressions régulières + Verbose + Journal - Search && &Replace - &Remplacer && Suivant + Show files changed in each revision + Afficher les fichiers modifiés pour chaque révision - Find... - Rechercher dans... + All Items + - Current Document - Document courant + File Commits + - Find/Replace - Rechercher/Remplacer + Technical Notes + - Enter Find String - Entrer la chaîne à rechercher + Tags + Tags - Ctrl+E - Ctrl+E + Tickets + - Find Next - Suivant + Wiki Commits + - Find Previous - Précédent + Item Types + - Replace && Find Next - Remplacer && Suivant + Private + - Shift+Enter - Maj+Entrée + Create a private check-in that is never synced. +Children of private check-ins are automatically private. +Private check-ins are not pushed to the remote repository by default. + - Shift+Return - Maj+Entrée + Tag names to apply; comma-separated. + - Find Next (Selected) - Trouvez le suivant (sélectionné) + Current Information + - Ctrl+F3 - Ctrl+F3 + Local root: + - Find Previous (Selected) - Trouver le précédent (sélectionné) + Branch: + Branche : - Ctrl+Shift+F3 - Ctrl+Maj+F3 + Tags: + Tags : - Replace - Remplacer + Commit Information + Informations de commit - Replace && Find - Remplacer && chercher + New branch: + - Ctrl+= - Ctrl+= + Author: + Auteur : - Replace && Find Previous - Remplacer && Précédent + Message check failed. + - Replace All - Remplacer tout + &Annotate %1 + - Case Sensitive - Sensible à la casse + Annotate &Parent Revision %1 + - Whole Words Only - Mots complets uniquement + &Fossil + - Use Regular Expressions - Utiliser des expressions régulières + Annotate Current File + Annoter le fichier actuel - Preserve Case when Replacing - Conserver la casse lors du remplacement + Annotate "%1" + Annoter « %1 » - Find - Rechercher + Diff Current File + - Find: - Rechercher : + Diff "%1" + - All - Tout + Meta+I,Meta+D + - ... - ... + ALT+I,Alt+D + - Advanced... - Avancé... + Timeline Current File + - No matches found! - Aucun résultat ! + Timeline "%1" + - New Search - Nouvelle recherche + Meta+I,Meta+L + - Expand All - Développer tout + ALT+I,Alt+L + - %1 %2 - %1 %2 + Status Current File + État du fichier actuel - Do not warn again - Ne plus avertir + Status "%1" + État « %1 » - Collapse All - Réduire tout + Meta+I,Meta+S + - Search Results - Résultat de la recherche - - - - QtC::ProjectExplorer - - Override %1: - Écraser %1 : + ALT+I,Alt+S + - Make arguments: - Arguments de Make : + Add Current File + - Targets: - Cibles : + Add "%1" + Ajouter « %1 » + + + Delete Current File... + Supprimer le fichier en cours… + + + Delete "%1"... + Supprimer « %1 »… + + + Revert Current File... + Rétablir le fichier actuel… + + + Revert "%1"... + Rétablir « %1 » … + + + Diff + Diff + + + Timeline + Ligne du temps + + + Meta+I,Meta+T + + + + ALT+I,Alt+T + + + + Revert... + Rétablir… + + + Status + + + + Revert + Rétablir + + + Pull... + Pull… + + + Push... + Push… + + + Update... + Mise à jour… + + + Meta+I,Meta+U + + + + ALT+I,Alt+U + + + + Commit... + Commit… + + + Meta+I,Meta+C + + + + ALT+I,Alt+C + + + + Settings ... + + + + Create Repository... + + + + Remote repository is not defined. + + + + Update + Mettre à jour + + + There are no changes to commit. + Il n’y a aucun changement à envoyer. + + + Unable to create an editor for the commit. + Impossible d’ouvrir un éditeur pour le commit. + + + Unable to create a commit editor. + Impossible d’ouvrir un éditeur de commit. + + + Commit changes for "%1". + Soumettre les changements pour « %1 ». + + + Choose Checkout Directory + + + + The directory "%1" is already managed by a version control system (%2). Would you like to specify another directory? + + + + Repository already under version control + Le dépôt est déjà sous gestion de versions + + + Repository Created + Dépôt créé + + + A version control repository has been created in %1. + Un dépôt sous gestion de versions à été créé dans %1. + + + Repository Creation Failed + Échec lors de la création du dépôt + + + A version control repository could not be created in %1. + Un dépôt sous gestion de versions ne peut pas être créé dans %1. + + + Fossil + + + + Specify a revision other than the default? + Spécifier une révision différente de celle par défaut ? + + + Checkout revision, can also be a branch or a tag name. + + + + Revision + + + + Fossil Command + + + + Command: + Commande : + + + Fossil Repositories + + + + Default path: + + + + Directory to store local repositories by default. + + + + Default user: + + + + Log width: + + + + The width of log entry line (>20). Choose 0 to see a single line per entry. + + + + Timeout: + Délai d’attente : + + + s + s + + + Log count: + Nombre d’entrées de log : + + + The number of recent commit log entries to show. Choose 0 to see all entries. + + + + Configuration + Configuration + + + Local Repositories + + + + User + Utilisateur + + + Miscellaneous + Divers + + + Pull Source + Rapatrier la source + + + Push Destination + + + + Default location + Emplacement par défaut + + + Local filesystem: + Système local de fichier : + + + Specify URL: + Spécifier l’URL : + + + For example: https://[user[:pass]@]host[:port]/[path] + Par exemple, https://[user[:pass]@]host[:port]/[path] + + + Remember specified location as default + Se souvenir de l’emplacement par défaut + + + Include private branches + + + + Allow transfer of private branches. + + + + Remote Location + + + + Options + Options QtC::GenericProjectManager - - <new> - <nouveau> - - - Create - Créer - - - Default - The name of the build configuration created by default for a generic project. - Défaut - - - Build - Compilation - - - New Configuration - Nouvelle configuration - - - New configuration name: - Nom de la nouvelle configuration : - - - New configuration - Nouvelle configuration - - - New Configuration Name: - Nom de la nouvelle configuration : - - - Configuration Name: - Nom de la configuration : - - - Build directory: - Répertoire de compilation : - - - Tool chain: - Chaîne de compilation : - - - <Invalid tool chain> - <Chaîne d'outils invalide> - - - Tool Chain: - Chaîne d'outils : - Generic Manager Gestionnaire générique - - Make - GenericMakestep display name. - Make - - - Override %1: - Écraser %1 : - - - <b>Make:</b> %1 %2 - <b>Make : </b>%1 %2 - - - Import of Makefile-based Project - Importer un projet basé sur un Makefile - - - Creates a generic project, supporting any build system. - Crée un projet générique, supportant n'importe quel système de compilation. - - - Projects - Projets - - - The project %1 could not be opened. - Le projet %1 ne peut pas être ouvert. - Import Existing Project Importer un projet existant - - Imports existing projects that do not use qmake, CMake or Autotools. This allows you to use Qt Creator as a code editor. - Importer un projet existant n'utilisant pas qmake, CMake ou Autotools. Ceci vous permet d'utiliser Qt Creator comme éditeur de code. - - - Imports existing projects that do not use qmake or CMake. This allows you to use Qt Creator as a code editor. - Importer un projet existant n'utilisant pas qmake ni CMake. Ceci vous permet d'utiliser Qt Creator comme éditeur de code. - - - Generic Project - Projet générique - Project Name and Location Nom du projet et emplacement @@ -6351,117 +27598,154 @@ Ajouter, modifier et supprimer des filtres de documents, qui détermine l'e Sélection de fichier - Location - Emplacement + Imports existing projects that do not use qmake, CMake, Qbs, Meson, or Autotools. This allows you to use %1 as a code editor. + Importe les projets existants qui n’utilisent pas qmake, CMake, Qbs, Meson ou Autotools. Cela vous permet d’utiliser %1 comme éditeur de code. Files Fichiers - Second Page Title - Titre de la seconde page + Edit Files... + Modifier les fichiers… + + + Remove Directory + Supprimer le répertoire + + + Project files list update failed. + La mise à jour de la liste des fichiers de projet a échoué. + + + Build %1 + Compiler %1 QtC::Git - - Branches - Branches - - - General information - Informations générales - - - Remote branches - traduction de remote ici ? - Branches distantes - - - Checkout - Importer - - - Delete - Supprimer - - - Unable to find the repository directory for '%1'. - Impossible de trouver le dépôt de "%1". - Refresh - Rafraîchir + Rafraîchir - Delete... - Supprimer… + Include Old Entries + Inclure les anciennes entrées - Checkout branch? - Importer la branche ? + Include Tags + Inclure les étiquettes + + + Include branches and tags that have not been active for %n days. + + Inclure les branches et les étiquettes qui n’ont pas été actives depuis un jour. + Inclure les branches et les étiquettes qui n’ont pas été actives depuis %n jours. + - Would you like to delete the tag '%1'? - Souhaitez-vous supprimer le tag "%1" ? + Create Git Repository... + Créer un dépôt Git … - Would you like to delete the <b>unmerged</b> branch '%1'? - Voulez-vous supprimer la branche <b>non mergée</b> "%1" ? + Add Branch... + Ajouter une branche … + + + Filter + Filtre + + + &Fetch + Télécharger (&fetch) + + + Remove &Stale Branches + Retirer les branches &périmées + + + Manage &Remotes... + Gérer les dépôts &distants… + + + Rem&ove... + &Supprimer… + + + Re&name... + Re&nommer… + + + Reflo&g + Reflo&g + + + Re&set + Ré&initialiser + + + &Hard + &Dur + + + &Mixed + &Mixte + + + &Soft + Dou&ce + + + &Merge "%1" into "%2" (Fast-Forward) + &Fusionner « %1 » dans « %2 » (fast forward) + + + Merge "%1" into "%2" (No &Fast-Forward) + Fusionner « %1 » dans « %2 » (&pas de fast forward) + + + &Merge "%1" into "%2" + &Fusionner « %1 » dans « %2 » + + + &Rebase "%1" on "%2" + &Rebaser « %1 » dans « %2 » + + + Would you like to delete the tag "%1"? + Souhaitez-vous supprimer l’étiquette « %1 » ? + + + Would you like to delete the branch "%1"? + Souhaitez-vous supprimer la branche « %1 » ? + + + Would you like to delete the <b>unmerged</b> branch "%1"? + Souhaitez-vous supprimer la branche <b>non fusionnée</b> « %1 » ? Delete Branch - Supprimer la branche + Supprimer une branche Delete Tag - Supprimer le tag + Supprimer l’étiquette (tag) + + + Git Reset + Git reset + + + Reset branch "%1" to "%2"? + Réinitialiser la branche « %1 » vers « %2 » ? + + + Git Branches + Branches Git Rename Tag - Renommer le tag - - - Branch Exists - Branches existantes - - - Local branch '%1' already exists. - La branches locale "%1" existe déjà. - - - Would you like to delete the branch '%1'? - Souhaitez-vous supprimer la branche "%1" ? - - - Failed to delete branch - Échec de suppression de la branche - - - Failed to create branch - Échec de création de la branche - - - Failed to stash - Échec du stash - - - Checkout failed - Échec de l'import - - - Would you like to create a local branch '%1' tracking the remote branch '%2'? - Souhaitez-vous créer une branche locale '%1' pour la branche distante "%2" ? - - - Create branch - Créer une branche - - - Failed to create a tracking branch - tracking branch ? - Échec de la création d'une branche de suivi + Renommer l’étiquette (tag) Re&fresh @@ -6469,7 +27753,7 @@ Ajouter, modifier et supprimer des filtres de documents, qui détermine l'e &Add... - &Ajouter... + &Ajouter… &Remove @@ -6483,53 +27767,17 @@ Ajouter, modifier et supprimer des filtres de documents, qui détermine l'e &Log &Log - - Re&name - Re&nommer - - - &Merge - &Fusionner - - - Re&base - Re&baser - - - Cherry pick top commit from selected branch. - Piocher la dernière soumission de la branche sélectionnée. - - - Cherry Pick - Cherry-pick - - - Sets current branch to track the selected one. - Définit la branche courante pour suivre celle qui est sélectionnée. - &Track &Suivre - - Select a Git commit - Sélectionner un commit Git - - - Select Git repository - Sélectionner un dépôt Git - - - Browse &Directory... - Parcourir le &répertoire... - Browse &History... - Parcourir l'&historique... + Parcourir l’&historique… &Show - &Montrer + &Afficher &Revert @@ -6547,6 +27795,10 @@ Ajouter, modifier et supprimer des filtres de documents, qui détermine l'e Select a Git Commit Sélectionner un commit Git + + &Archive... + &Archiver… + Select Commit Sélectionner un commit @@ -6569,28 +27821,12 @@ Ajouter, modifier et supprimer des filtres de documents, qui détermine l'e Fetching commit data... - Obtenir les données du commit... - - - Select Git Repository - Sélectionner un dépôt Git - - - Select Working Directory - Sélectionner le répertoire de travail - - - Selected directory is not a Git repository - Le répertoire sélectionné n'est pas un dépôt Git + Obtenir les données du commit… Working directory: Répertoire de travail : - - Select - Sélectionner - Change: Modification : @@ -6599,368 +27835,79 @@ Ajouter, modifier et supprimer des filtres de documents, qui détermine l'e HEAD HEAD - - Note that the git plugin for QtCreator is not able to interact with the server so far. Thus, manual ssh-identification etc. will not work. - marchera ou marcheront ? Le etc laisse sous-entendre qu'il y aurait d'autres choses qui ne marcheraient pas. - Notez que le plug-in git pour Qt Creator n'est pas capable d'interagir directement avec le serveur. Ainsi, l'identification ssh manuelle et d'autres ne marcheront pas. - - - Unable to determine the repository for %1. - Impossible de déterminer le dépôt de %1. - - - Unable to parse the file output. - Impossible d'analyser le fichier de sortie. - - - Executing: %1 %2 - - Executing: <executable> <arguments> - Exécution de : %1 %2 - Waiting for data... - En attente de données... - - - Git Diff - Git Diff - - - Git Diff %1 - Git Diff %1 - - - Git Diff Branch %1 - Git diff branche %1 - - - Git Log - Git Log - - - Git Log %1 - Git Log %1 - - - Cannot describe '%1'. - impossible de décrire "%1". - - - Git Show %1 - Git Show %1 - - - Git Blame %1 - Git blame %1 - - - Unable to checkout %1 of %2: %3 - Meaning of the arguments: %1: Branch, %2: Repository, %3: Error message - Impossible de réaliser l'import %1 de %2 : %3 - - - Unable to add %n file(s) to %1: %2 - - Impossible d'ajouter %n fichier dans %1 : %2 - Impossible d'ajouter %n fichiers dans %1 : %2 - - - - Unable to remove %n file(s) from %1: %2 - - Impossible de supprimer %n fichier de %1 : %2 - Impossible de supprimer %n fichiers de %1 : %2 - - - - Unable to move from %1 to %2: %3 - Impossible de déplacer de %1 vers %2 : %3 - - - Unable to reset %1: %2 - Impossible de réinitialiser %1 : %2 - - - Unable to reset %n file(s) in %1: %2 - - Impossible de réinitialiser %n fichier dans %1 : %2 - Impossible de réinitialiser %n fichiers dans %1 : %2 - - - - Unable to checkout %1 of %2 in %3: %4 - Meaning of the arguments: %1: revision, %2: files, %3: repository, %4: Error message - Impossible de réaliser l'import %1 de %2 dans %3 : %4 - - - Unable to find parent revisions of %1 in %2: %3 - Failed to find parent revisions of a SHA1 for "annotate previous" - Impossible de trouver la révision parente de %1 dans %2 : %3 + En attente de données… Invalid revision Révision invalide - - Unable to retrieve branch of %1: %2 - Impossible d'obtenir la branche dans %1 : %2 - - - Unable to retrieve top revision of %1: %2 - Impossible d'obtenir la dernière révision dans %1 : %2 - - - Unable to describe revision %1 in %2: %3 - Impossible de décrire la révision %1 dans %2 : %3 - Stash Description - Description de la remise + Description de la remise (« stash ») Description: Description : - - Unable to resolve stash message '%1' in %2 - Look-up of a stash via its descriptive message failed. - Impossible de trouver le stash correspondant au message "%1" dans %2 - - - Unable to run a 'git branch' command in %1: %2 - Impossible d'exécuter la commande 'git branch' dans %1 : %2 - - - Unable to run 'git show' in %1: %2 - Impossible d'exécuter 'git show' dans %1 : %2 - - - Unable to run 'git clean' in %1: %2 - Impossible d'exécuter 'git clean' dans %1 : %2 - - - There were warnings while applying %1 to %2: -%3 - Avertissements lors de l'application du patch %1 dans %2 : -%3 - - - Unable apply patch %1 to %2: %3 - Impossible d'appliquer le patch %1 dans %2 : %3 - - - Cannot locate %1. - Impossible de localiser %1. - - - Unable to launch %1. - Impossible de lancer %1. - - - Unable to retrieve the last commit data of the repository %1. - Impossible de récupérer les données du dernier commit du dépôt %1. - - - Amended %1 (%n file(s)). - - - %1 amendé (%n fichier). - - %1 amendé (%n fichiers). - - - - - Amended %1. - %1 amendé. - - - Unable to restore stash %1: %2 - Impossible de restaurer le stash %1 : %2 - - - Unable to restore stash %1 to branch %2: %3 - Impossible de restaurer le stash %1 dans la branche %2 : %3 - - - Unable to remove stashes of %1: %2 - Impossible de supprimer des stashes de %1 : %2 - - - Unable to remove stash %1 of %2: %3 - Impossible de supprimer le stash %1 de %2 : %3 - - - Unable retrieve stash list of %1: %2 - Impossible d'obtenir une liste des stashes dans %1 : %2 - - - Unable to determine git version: %1 - impossible de déterminer la version git : %1 - - - Unable to checkout %n file(s) in %1: %2 - - Impossible de réaliser le checkout de %n fichier dans %1 : %2 - Impossible de réaliser le checkout de %n fichiers dans %1 : %2 - - - - Unable stash in %1: %2 - Impossible d'utiliser stash dans %1 : %2 - - - Unable to run branch command: %1: %2 - Impossible d'exécuter la commande branch : %1 : %2 - - - Unable to run show: %1: %2 - Impossible d'exécuter show : %1 : %2 - - - You have modified files. Would you like to stash your changes? - Vous avez modifié des fichiers. Souhaitez-vous mettre vos changements dans le stash ? - - - Unable to obtain the status: %1 - Impossible d'obtenir le statut : %1 - - - The repository %1 is not initialized yet. - Le dépôt %1 n'est pas encore initialisé. - - - You did not checkout a branch. - Aucun import de branche n'a été effectué. - - - Committed %n file(s). - - "commité" is common at the Oslo office, I don't know about France - - %n fichier a été commité. - - %n fichiers ont été commités. - - - - - Unable to commit %n file(s): %1 - - - Impossible de commiter %n fichier : %1 - - Impossible de commiter %n fichiers : %1 - - - Cannot determine the repository for "%1". - Impossible de déterminer le dépôt pour "%1". + Impossible de déterminer le dépôt pour « %1 ». Cannot parse the file output. - Impossible d'analyser le fichier de sortie. - - - Cannot run "%1 %2" in "%2": %3 - Impossible de lancer "%1 %2" in "%2" : %3 + Impossible d’analyser le fichier de sortie. Git Diff "%1" - Git Diff "%1" + Git diff de « %1 » Git Diff Branch "%1" - Git diff branche "%1" + Git diff de la branche « %1 » Git Log "%1" - Git Log "%1" + Git log de « %1 » Git Reflog "%1" - Git Reflog "%1" + Git reflog de « %1 » Cannot describe "%1". - Impossible de décrire "%1". + Impossible de décrire « %1 ». Git Show "%1" - Git Show "%1" + Git show de « %1 » Git Blame "%1" - Git blame "%1" - - - Cannot checkout "%1" of "%2": %3 - Meaning of the arguments: %1: Branch, %2: Repository, %3: Error message - Impossible de réaliser l'import "%1" de "%2" : %3 + Git blame de « %1 » Cannot obtain log of "%1": %2 - Impossible d'obtenir le journal de "%1" : %2 - - - Cannot add %n file(s) to "%1": %2 - singulier en français : entre zéro et un uniquement, d'où l'absence de %n au singulier - - Impossible d'ajouter un fichier dans "%1" : %2 - Impossible d'ajouter %n fichiers dans "%1" : %2 - - - - Cannot remove %n file(s) from "%1": %2 - singulier en français : entre zéro et un uniquement, d'où l'absence de %n au singulier - - Impossible de supprimer un fichier de "%1" : %2 - Impossible de supprimer %n fichiers de "%1" : %2 - - - - Cannot move from "%1" to "%2": %3 - Impossible de déplacer de "%1" vers "%2" : %3 - - - Cannot reset "%1": %2 - Impossible de réinitialiser "%1" : %2 - - - Cannot reset %n file(s) in "%1": %2 - singulier en français : entre zéro et un uniquement, d'où l'absence de %n au singulier - - Impossible de réinitialiser un fichier dans "%1" : %2 - Impossible de réinitialiser %n fichiers dans "%1" : %2 - + Impossible d’obtenir le journal de « %1 » : %2 Cannot checkout "%1" of %2 in "%3": %4 Meaning of the arguments: %1: revision, %2: files, %3: repository, %4: Error message - Impossible de réaliser l'import "%1" de %2 dans "%3" : %4 + Impossible de réaliser l’import « %1 » de %2 dans « %3 » : %4 Cannot find parent revisions of "%1" in "%2": %3 Failed to find parent revisions of a SHA1 for "annotate previous" - Impossible de trouver la révision parente de "%1" dans "%2" : %3 - - - Cannot execute "git %1" in "%2": %3 - Impossible d'exécuter "git %1" dans "%2" : %3 - - - Cannot retrieve branch of "%1": %2 - Impossible d'obtenir la branche dans "%1" : %2 + Impossible de trouver la révision parente de « %1 » dans « %2 » : %3 Cannot run "%1" in "%2": %3 - Impossible de lancer "%1" in "%2" : %3 + Impossible de lancer « %1 » dans « %2 » : %3 REBASING - CHANGEMENT DE BASE + REBASAGE REVERTING @@ -6968,32 +27915,24 @@ Ajouter, modifier et supprimer des filtres de documents, qui détermine l'e CHERRY-PICKING - CHERRY-PICKING + IMPORTATION SÉLECTIVE (CHERRY-PICKING) MERGING FUSIONNEMENT - - Cannot retrieve top revision of "%1": %2 - Impossible d'obtenir la dernière révision dans "%1" : %2 - Cannot describe revision "%1" in "%2": %3 - Impossible de décrire la révision "%1" dans "%2" : %3 - - - Cannot stash in "%1": %2 - Impossible d'utiliser la remise dans "%1" : %2 + Impossible de décrire la révision « %1 » dans « %2 » : %3 Cannot resolve stash message "%1" in "%2". Look-up of a stash via its descriptive message failed. - Impossible de trouver la remise correspondant au message "%1" dans "%2". + Impossible de trouver la remise (« stash ») correspondant au message « %1 » dans « %2 ». Cannot retrieve submodule status of "%1": %2 - Impossible d'obtenir le statut des sous-modules de "%1" : %2 + Impossible d’obtenir l’état des sous-modules de « %1 » : %2 Submodules Found @@ -7001,15 +27940,15 @@ Ajouter, modifier et supprimer des filtres de documents, qui détermine l'e Would you like to update submodules? - Souhaitez-vous mettre à jour les sous-modules ? + Souhaitez-vous mettre à jour les sous-modules ? Continue Rebase - Continuer le changement de base + Continuer le rebasage Rebase is in progress. What do you want to do? - Changement de base en cours. Que voulez-vous faire ? + Rebasage en cours. Que voulez-vous faire ? Continue @@ -7023,35 +27962,17 @@ Ajouter, modifier et supprimer des filtres de documents, qui détermine l'e You need to commit changes to finish merge. Commit now? Vous devez soumettre vos changements pour terminer la fusion. -Soumettre maintenant ? +Soumettre maintenant ? Continue Revert - Continuer le rétablisssement + Continuer le rétablissement You need to commit changes to finish revert. Commit now? - Vous devez soumettre vos changements pour terminer le rétablisssement. -Soumettre maintenant ? - - - Committed %n file(s). - - %n fichier a été soumis. - %n fichiers ont été soumis. - - - - Amended "%1" (%n file(s)). - - Correction de "%1" (%n fichier). - Correction de "%1" (%n fichiers). - - - - Cannot set tracking branch: %1 - Impossible de suivre la branche : %1 + Vous devez soumettre vos changements pour terminer le rétablissement. +Soumettre maintenant ? Conflicts detected with commit %1. @@ -7067,9 +27988,41 @@ Soumettre maintenant ? Conflicts detected. Conflits détectés. + + Only graphical merge tools are supported. Please configure merge.tool. + Seuls les outils de fusion graphiques sont pris en charge. Veuillez configurer l’outil merge. + + + Force Push + Forcer le push + + + Push failed. Would you like to force-push <span style="color:#%1">(rewrites remote history)</span>? + Le push a échoué. Voulez-vous forcer le push <span style="color:#%1">(réécriture de l’historique à distance)</span> ? + + + No Upstream Branch + Aucune branche en amont + + + Push failed because the local branch "%1" does not have an upstream branch on the remote. + +Would you like to create the branch "%1" on the remote and set it as upstream? + Le push a échoué car la branche locale « %1 » n’a pas de branche en amont sur le serveur distant. + +Souhaitez-vous créer la branche « %1 » sur le serveur distant et la définir comme branche amont ? + + + Stash && &Pop + Mettre dans la remise (« stash ») et &poper + Stash local changes and execute %1. - Mettre dans la remise les changements locaux et exécuter %1. + Mettre dans la remise (« stash ») les changements locaux et exécuter %1. + + + &Discard + Aban&donner Discard (reset) local changes and execute %1. @@ -7087,19 +28040,233 @@ Soumettre maintenant ? Commit Faire un commit + + <resolving> + <résolution> + + + <None> + <aucun> + + + No Move Detection + Pas de détection de déplacement + + + Detect Moves Within File + Détecter les déplacements au sein d’un fichier + + + Detect Moves Between Files + Détecter les déplacements entre les fichiers + + + Detect Moves and Copies Between Files + Détecter les déplacements et les copies entre fichiers + + + Move detection + Détection de déplacement + + + Filter commits by message or content. + Filtrer les commits par message ou contenu. + + + First Parent + Premier parent + + + Follow only the first parent on merge commits. + Ne suivre que le premier parent sur les commits de fusion. + + + Color + Couleur + + + Use colors in log. + Utiliser des couleurs dans le journal. + + + Follow + Suivre + + + Show log also for previous names of the file. + Afficher le journal également pour les noms précédents du fichier. + + + Show Date + Afficher la date + + + Show date instead of sequence. + Afficher la date au lieu de la séquence. + + + Stage Chunk + Ajout du chunk + + + Stage Selection (%n Lines) + + Ajout de la sélection (une ligne) + Ajout de la sélection (%n lignes) + + + + Unstage Chunk + Suppression du chunk + + + Unstage Selection (%n Lines) + + Ajout de la sélection (une ligne) + Ajout de la sélection (%n lignes) + + + + Chunk successfully unstaged + Le chunk a été retiré avec succès + + + Git Diff Files + Git Diff les fichiers + + + Git Diff Project + Git Diff le projet + + + Git Diff Repository + Git Diff le répertoire + + + Generate %1 archive + Générer l’archive %1 + + + Overwrite? + Écraser ? + + + An item named "%1" already exists at this location. Do you want to overwrite it? + Un élément nommé « %1 » existe déjà à cet emplacement. Voulez-vous l’écraser ? + + + Create Local Branch + Créer une branche locale + + + Would you like to create a local branch? + Vous souhaitez créer une branche locale ? + + + Reset + Réinitialiser + + + All changes in working directory will be discarded. Are you sure? + Toutes les modifications apportées au répertoire de travail seront annulées. Êtes-vous sûr(e) de vous ? + + + Nothing to recover + Rien à restaurer + + + Files recovered + Fichiers restaurés + + + Cannot reset %n files in "%1": %2 + + Impossible de réinitialiser un fichier dans « %1 » : %2 + Impossible de réinitialiser %n fichiers dans « %1 » : %2 + + Continue Cherry-Picking - Continuer le cherry-picking + Continuer l’importation sélective (« cherry-picking ») You need to commit changes to finish cherry-picking. Commit now? - Vous devez valider les changements pour finir le cherry-picking. -Valider maintenant ? + Vous devez valider les changements pour finir l’importation sélective (« cherry-picking »). +Valider maintenant ? + + + Committed %n files. + + Un fichier commité. + %n fichiers commités. + + + + Amended "%1" (%n files). + + Amender « %1 » (1 fichier) + Amender « %1 » (%n fichiers) + + + + Cannot commit %n files + + Impossible de commiter un fichier + Impossible de commiter %n fichiers + - No changes found. - Aucun changement trouvé. + Cherr&y-Pick %1 + Cherr&y-pick %1 + + + Re&vert %1 + Re&vert %1 + + + C&heckout %1 + C&heckout %1 + + + &Interactive Rebase from %1... + Rebasage &interactif à partir de %1… + + + &Log for %1 + &Log de %1 + + + Sh&ow file "%1" on revision %2 + &Afficher le fichier « %1 » sur la révision %2 + + + Add &Tag for %1... + Ajouter une é&tiquette pour %1… + + + &Reset to Change %1 + &Revenir à la modification %1 + + + Di&ff %1 + Faire le di&ff de %1 + + + Di&ff Against %1 + Réaliser un di&ff par rapport à %1 + + + Diff &Against Saved %1 + Réaliser un di&ff par rapport au fichier enregistré %1 + + + &Save for Diff + &Enregistrer pour le diff + + + Git Show %1:%2 + Git Show %1 : %2 Skip @@ -7109,30 +28276,18 @@ Valider maintenant ? <Detached HEAD> <HEAD détaché> - - Conflicts detected - Conflits détectés - - - Conflicts detected with commit %1 - Conflits détectés avec la soumission %1 - Conflicts Detected Conflits détectés Run &Merge Tool - Lancer l'outil de &fusion + Lancer l’outil de &fusion &Skip &Passer - - Cannot determine Git version: %1 - Impossible de déterminer la version de git : %1 - Uncommitted Changes Found Des changements non soumis ont été trouvés @@ -7141,75 +28296,31 @@ Valider maintenant ? What would you like to do with local changes in: Que souhaitez-vous faire avec les changements locaux dans : - - Stash && Pop - Sortir de la remise - Stash local changes and pop when %1 finishes. - Remiser les changements locaux, puis les récupérer lorsque %1 est terminé. - - - Stash local changes and continue. - Remiser les changements locaux et continuer. + Mettre dans la remise (« stash ») les changements locaux, puis y accéder lorsque %1 est terminé. Discard Abandonner - - Discard (reset) local changes and continue. - Abandonner (supprimer) les changements locaux et continuer. - - - Continue with local changes in working directory. - Continuer avec les changement locaux dans le répertoire de travail. - - - Cancel current command. - Annuler la commande en cours. - - - Cannot run "git branch" in "%1": %2 - Impossible d'exécuter "git branch" dans "%1" : %2 - - - Cannot run "git remote" in "%1": %2 - Impossible d'exécuter "git remote" dans "%1" : %2 - - - Cannot run "git show" in "%1": %2 - Impossible d'exécuter "git show" dans "%1" : %2 - - - Cannot run "git clean" in "%1": %2 - Impossible d'exécuter "git clean" dans "%1" : %2 - There were warnings while applying "%1" to "%2": %3 - Avertissements lors de l'application du patch "%1" dans "%2" : + Avertissements lors de l’application du patch « %1 » dans « %2 » : %3 Cannot apply patch "%1" to "%2": %3 - Impossible d'appliquer le patch "%1" dans "%2" : %3 - - - Would you like to stash your changes? - Souhaitez-vous remiser vos changements ? + Impossible d’appliquer le patch « %1 » dans « %2 » : %3 Cannot obtain status: %1 - Impossible d'obtenir le statut : %1 - - - Cannot locate "%1". - Impossible de localiser "%1". + Impossible d’obtenir l’état : %1 Cannot launch "%1". - Impossible de lancer "%1". + Impossible de lancer « %1 ». No changes found. @@ -7217,7 +28328,7 @@ Valider maintenant ? and %n more - Displayed after the untranslated message "Branches: branch1, branch2 'and %n more'" in git show. + Displayed after the untranslated message "Branches: branch1, branch2 'and %n more'" et %n de plus et %n de plus @@ -7225,48 +28336,23 @@ Valider maintenant ? The repository "%1" is not initialized. - Le dépôt "%1" n'est pas initialisé. + Le dépôt « %1 » n’est pas initialisé. Cannot retrieve last commit data of repository "%1". - Impossible de récupérer les données du dernier commit du dépôt "%1". - - - Amended "%1" (%n file(s)). - - - "%1" amendé (un fichier). - - "%1" amendé (%n fichiers). - - + Impossible de recevoir les données du dernier commit du dépôt « %1 ». Amended "%1". - "%1" amendé. - - - Cannot commit %n file(s): %1 - - singulier en français : entre zéro et un uniquement, d'où l'absence de %n au singulier - - Impossible de commiter un fichier : %1 - - Impossible de commiter %n fichiers : %1 - - + « %1 » amendé. The file has been changed. Do you want to revert it? - Le fichier a été modifié. Voulez-vous le rétablir ? + Le fichier a été modifié. Voulez-vous le rétablir ? The file is not modified. - Le fichier n'a pas été modifié. - - - The command 'git pull --rebase' failed, aborting rebase. - La commande 'git pull --rebase' a échoué, annulation du rebase. + Le fichier n’a pas été modifié. Git SVN Log @@ -7274,119 +28360,36 @@ Valider maintenant ? Rebase, merge or am is in progress. Finish or abort it and then try again. - Un changement de base, une fusion ou un "am" est en cours. Finissez ou annulez l'opération puis réessayez. + Un rebasage, une fusion ou un « am » est en cours. Finissez ou annulez l’opération puis réessayez. There are no modified files. - Il n'y a aucun fichier modifié. + Il n’y a aucun fichier modifié. No commits were found - Aucune soumission n'a été trouvée + Aucun commit n’a été trouvé No local commits were found - Aucune soumission locale n'a été trouvée - - - Cannot restore stash "%1": %2 - Impossible de restaurer la remise "%1" : %2 - - - Cannot restore stash "%1" to branch "%2": %3 - Impossible de restaurer la remise "%1" dans la branche "%2" : %3 - - - Cannot remove stashes of "%1": %2 - Impossible de supprimer les remises de "%1" : %2 - - - Cannot remove stash "%1" of "%2": %3 - Impossible de supprimer la remise "%1" de "%2" : %3 - - - Cannot retrieve stash list of "%1": %2 - Impossible d'obtenir la liste de la remise dans "%1" : %2 - - - Cannot determine git version: %1 - Impossible de déterminer la version de git : %1 + Aucun commit local n’a été trouvé &Git &Git - - Diff Current File - Réaliser un diff du fichier courant - - - Diff "%1" - Réaliser un diff de "%1" - Alt+G,Alt+D Alt+G,Alt+D - - File Status - Statut du fichier - - - Status Related to "%1" - Statut lié à "%1" - - - Alt+G,Alt+S - Alt+G,Alt+S - - - Log File - Réaliser un log du fichier - - - Log of "%1" - Réaliser un log de "%1" - Alt+G,Alt+L Alt+G,Alt+L - - Blame - Traduction autre ? - Blâmer - - - Blame for "%1" - Blâmer pour "%1" - Alt+G,Alt+B Alt+G,Alt+B - - Undo Uncommited Changes... - Défaire les changements non committés... - - - Diff &Selected Files - Faire un diff sur tous les fichiers &sélectionnés - - - Undo all pending changes to the repository -%1? - Défaire tous les changements en attente sur le dépôt -%1 ? - - - Undo Changes - Annuler les changements - - - Undo Changes for "%1" - Annuler les changements de "%1" - Alt+G,Alt+U Alt+G,Alt+U @@ -7395,25 +28398,13 @@ Valider maintenant ? Stage File for Commit Ajouter le fichier au staging pour commit - - Blame Current File - Blâmer le fichier courant - - - Diff of "%1" - Diff de "%1" - Current &File - &Fichier courant - - - Log Current File - Réaliser un log du fichier courant + &Fichier actuel Stage "%1" for Commit - Ajouter "%1" au staging pour commit + Ajouter « %1 » au staging pour commit Alt+G,Alt+A @@ -7435,7 +28426,7 @@ Valider maintenant ? Undo Unstaged Changes for "%1" "non ajoutés à la staging area" commencait a faire trop alambiqué et trop anglais... - Défaire les changements non mis en cache pour "%1" + Défaire les changements non mis en cache pour « %1 » Undo Uncommitted Changes @@ -7443,198 +28434,76 @@ Valider maintenant ? Undo Uncommitted Changes for "%1" - Défaire les changements non committés pour "%1" + Défaire les changements non committés pour « %1 » Current &Project - &Projet courant - - - Diff Current Project - Réaliser un diff du projet courant - - - Diff Project "%1" - Réaliser un diff du projet "%1" - - - Project Status - Statut du projet - - - Status Project "%1" - Statut du projet "%1" - - - Log Project - Réaliser un log du projet - - - Log Project "%1" - Réaliser un log du projet "%1" + &Projet actuel Alt+G,Alt+K Alt+G,Alt+K - - Undo Project Changes - Annuler les changements sur le projet - Stash - Mettre dans la remise + Mettre dans la remise (« stash ») Saves the current state of your work. - Sauvegarde l'état actuel de votre travail. - - - Clean Project... - Nettoyer le projet... - - - Clean Project "%1"... - Nettoyer le projet "%1"... - - - Diff Repository - Réaliser un diff du dépôt - - - Repository Status - Statut du dépôt - - - Log Repository - Log du dépôt - - - Apply Patch - Appliquer un patch + Enregistre l’état actuel de votre travail. Apply "%1" - Appliquer "%1" - - - Apply Patch... - Appliquer un patch... - - - Undo Repository Changes - Annuler les changements dans le dépôt + Appliquer « %1 » Create Repository... - Création du dépôt... - - - Clean Repository... - Nettoyer le dépôt... - - - Stash Snapshot... - Faire un Snapshop du stash... + Création du dépôt… Saves the current state of your work and resets the repository. - Sauvegarde l'état actuel de votre travail et réinitialise le dépôt. - - - Pull - Pull - - - Stash Pop - Récupérer de la remise + Enregistre l’état actuel de votre travail et réinitialise le dépôt. Alt+G,Alt+Shift+D Alt+G, Alt+Maj+D - - Undo Uncommitted Changes... - Défaire les changements non committés... - Restores changes saved to the stash list using "Stash". - Restaurer les changements sauvés dans la liste de la remise à l'aide de "Stash". - - - Commit... - Commit... + Restaurer les changements enregistrés dans la liste de la remise à l’aide de « stash ». Alt+G,Alt+C Alt+G,Alt+C - - Interactive Rebase... - Rebase interactif... - Update Submodules Mis à jour des sous-modules - Abort Merge - Annuler la fusion - - - Abort Rebase - Annuler le rebasement - - - Abort Cherry Pick - Annuler l'importation sélective + Continue Cherry Pick + Continuer l’importation sélective (« cherry pick ») Abort Revert + Avoid translating "Revert" Annuler le rétablissement - - Continue Cherry Pick - Continuer l'importation sélective - &Patch &Patch &Stash - &Remise + Mettre dans la &remise (« stash ») &Remote Repository &Dépôt distant - - Push - Faire un push ou push tout court ? - Push - Branches... - Branches... - - - Stashes... - Remises... - - - Would you like to revert all pending changes to the repository -%1? - Souhaitez vous annuler tous les changements non sauvés dans le dépôt -%1 ? - - - Unable to retrieve file list - Impossible d'obtenir la liste des fichiers - - - Repository clean - Dépôt propre + Branches… The repository is clean. @@ -7644,31 +28513,10 @@ Valider maintenant ? Patches (*.patch *.diff) Patches (*.patch *.diff) - - Choose patch - Choisir un patch - Patch %1 successfully applied to %2 Patch %1 appliqué avec succès dans %2 - - List Stashes - stash ? - Lister les stashes - - - Show Commit... - Afficher le commit... - - - Subversion - Subversion - - - Log - Log - Meta+G,Meta+B Meta+G, Meta+B @@ -7677,10 +28525,74 @@ Valider maintenant ? Meta+G,Meta+D Meta+G, Meta+D + + Git Blame + Git Blame + + + &Copy "%1" + &Copier « %1 » + + + &Describe Change %1 + &Décrire le changement %1 + + + Triggers a Git version control operation. + Déclenche une opération du gestionnaire de versions Git. + + + Diff Current File + Avoid translating "Diff" + Réaliser un diff du fichier actuel + + + Diff of "%1" + Avoid translating "Diff" + Réaliser un diff de « %1 » + + + Log Current File + Avoid translating "Log" + Réaliser un log du fichier actuel + + + Log of "%1" + Avoid translating "Log" + Réaliser un log de « %1 » + Meta+G,Meta+L Meta+G, Meta+L + + Blame Current File + Avoid translating "Blame" + Blamer le fichier actuel + + + Blame for "%1" + Avoid translating "Blame" + Blamer « %1 » + + + Instant Blame Current Line + Avoid translating "Blame" + Blamer instantanément la ligne actuelle + + + Instant Blame for "%1" + Avoid translating "Blame" + Blamer instantanément « %1 » + + + Meta+G,Meta+I + Meta+G,Meta+I + + + Alt+G,Alt+I + Alt+G,Alt+I + Meta+G,Meta+A Meta+G, Meta+A @@ -7689,142 +28601,175 @@ Valider maintenant ? Meta+G,Meta+U Meta+G, Meta+U + + Diff Current Project + Avoid translating "Diff" + Réaliser un diff du projet actuel + + + Diff Project "%1" + Avoid translating "Diff" + Réaliser un diff du projet « %1 » + Meta+G,Meta+Shift+D - Meta+G, Meta+Shift+D + Meta+G, Meta+Maj+D + + + Log Project + Avoid translating "Log" + Réaliser un log du projet + + + Log Project "%1" + Avoid translating "Log" + Réaliser un log du projet « %1 » Meta+G,Meta+K Meta+G, Meta+K + + Clean Project... + Avoid translating "Clean" + Nettoyer le projet… + + + Clean Project "%1"... + Avoid translating "Clean" + Nettoyer le projet « %1 »… + &Local Repository Dépôt &local + + Amend Last Commit... + Avoid translating "Commit" + Amender le dernier commit… + + + Fixup Previous Commit... + Avoid translating "Commit" + Correction du commit précédent… + + + Recover Deleted Files + Accéder aux fichiers supprimés + + + Interactive Rebase... + Avoid translating "Rebase" + Rebasage interactif… + + + Abort Merge + Avoid translating "Merge" + Annuler la fusion + + + Abort Rebase + Avoid translating "Rebase" + Annuler le rebasage + + + Skip Rebase + Sauter le rebasage + + + Abort Cherry Pick + Avoid translating "Cherry Pick" + Annuler l’importation sélective (« cherry pick ») + + + Stash Pop + Avoid translating "Stash" + Accéder à la remise (« stash pop ») + + + Archive... + Archiver… + + + You + Vous + + + Unable to Retrieve File List + Impossible d’accéder à la liste des fichiers + Diff Diff Status - Statut - - - Fixup Previous Commit... - - - - Reset... - Réinitialiser... - - - Clean... - Nettoyer... - - - Launch gitk - Lancer gitk - - - Launch repository browser - Lancer l'exploration du dépôt - - - Remotes... - ? - Distant... - - - Show... - Afficher... - - - Patch - Patch + État Apply from Editor - Appliquer depuis l'éditeur + Appliquer depuis l’éditeur Apply from File... - Appliquer depuis le fichier... + Appliquer depuis le fichier… + + + Stash Unstaged Files + Avoid translating "Stash" + Mettre dans la remise (« stash ») les fichiers non mis en cache + + + Saves the current state of your unstaged files and resets the repository to its staged state. + Enregistre l’état actuel de vos fichiers non mis en cache et réinitialise le dépôt à son état mis en cache. Take Snapshot... - Prendre un snapshot... - - - Fetch - Fetch + Prendre un snapshot… Meta+G,Meta+C Meta+G, Meta+C - - Reflog - Reflog - - - Amend Last Commit... - Amender le dernier commit... - &Subversion &Subversion + + DCommit + DCommit + Manage Remotes... - - Revert... - Rétablir... - - - Cherry Pick... - Cherry Pick... - - - Checkout... - Extraire... - - - Rebase... - Changer de base... - - - Merge... - Fusionner... - Git &Tools - &Outils Git + Ou&tils Git Gitk - Gitk + Lancer Gitk Gitk Current File - Lancer Gitk sur le fichier courant + Lancer Gitk sur le fichier actuel Gitk of "%1" - Gitk de "%1" + Lancer Gitk pour « %1 » Gitk for folder of Current File - Gitk pour le répertoire du fichier courant + Lancer Gitk pour le dossier du fichier actuel Gitk for folder of "%1" - Gitk pour le répertoire de "%1" + Lancer Gitk pour le dossier de « %1 » Git Gui - Git Gui + Lancer Git Gui Repository Browser @@ -7834,35 +28779,21 @@ Valider maintenant ? Merge Tool Outil de fusion + + Git Bash + Git Bash + Actions on Commits... - Actions sur les soumissions... + Actions sur les commits… Interactive Rebase - Changement de base interactif + Rebasage interactif Unsupported version of Git found. Git %1 or later required. - Une version non supportée de Git a été trouvée. Git %1 ou plus récent est requis. - - - Diff Selected Files - Faire un diff sur tous les fichiers sélectionnés - - - &Undo - Annu&ler - - - &Redo - &Refaire - - - Revert all pending changes to the repository -%1? - Annuler tous les changements en attente sur le dépôt -%1 ? + Une version non prise en charge de Git a été trouvée. Git %1 ou plus récent est requis. Amend %1 @@ -7872,61 +28803,25 @@ Valider maintenant ? Git Fixup Commit Soumission de correction Git - - Closing Git Editor - Fermer l'éditeur Git - - - Git will not accept this commit. Do you want to continue to edit it? - Git n'acceptera pas ce commit. Voulez-vous continuer à l'éditer ? - Repository Clean Nettoyer le dépôt Choose Patch - Choisir le patch - - - Could not find working directory - Impossible de trouver le répertoire de travail + Sélectionner le patch Revert - Rétablir - - - Would you like to revert all pending changes to the project? - Souhaitez-vous rétablir toutes les modifications en attente sur le projet ? + Rétablir Another submit is currently being executed. Un autre submit est actuellement exécuté. - - Cannot create temporary file: %1 - Impossible de créer un fichier temporaire : %1 - - - Closing git editor - Fermeture de l'éditeur git - - - Do you want to commit the change? - Voulez vous envoyer les changements ? - - - The commit message check failed. Do you want to commit the change? - La vérification du message de commit a échoué. Voulez-vous soumettre vos modifications ? - - - The binary '%1' could not be located in the path '%2' - Le binaire '%1' n'a pas pu être trouvé dans le chemin "%2" - Git Commit - Git commit + Git commit General Information @@ -7948,6 +28843,14 @@ Valider maintenant ? branch branche + + Show HEAD + Afficher le HEAD + + + Sign off + Signer + Commit Information Informations de commit @@ -7958,57 +28861,16 @@ Valider maintenant ? Email: - Email : + Courriel : By&pass hooks contexte ? -> Les hooks dans git (ou SVN) sont des checks faites avant et après un commit. D'ailleurs, le projet Qt utilise les hooks :P . Dans le livre suivant, j'ai trouvé : http://git-scm.com/book/fr/Personnalisation-de-Git-Crochets-Git &Éviter les crochets - - <New branch> - <Nouvelle branche> - - - Type to create a new branch - Type pas facile à traduire dans ce contexte... Taper ? - Saisir pour créer une nouvelle branche - - - Environment variables - Variables d'environnement - - - PATH: - PATH : - - - From system - Copier depuis le système - - - <b>Note:</b> - <b>Note :</b> - - - Git needs to find Perl in the environment as well. - Git doit pouvoir trouver Perl dans l'environnement. - - - Log commit display count: - Nombre de commits à afficher dans le log : - Note that huge amount of commits might take some time. - Notez qu'un grand nombre de commit pourrait prendre un certain temps. - - - Timeout (seconds): - Timeout (secondes) : - - - Prompt to submit - Invite lors du submit + Notez qu’un grand nombre de commit pourrait prendre un certain temps. Git @@ -8018,70 +28880,52 @@ Valider maintenant ? Git Settings Paramètres de git - - Omit date from annotation output - Ne pas horodater l'annotation de sortie - - - Environment Variables - Variables d'environnement - - - From System - Copier depuis le système - Miscellaneous Divers - - Timeout: - Timeout : - - - s - s - - - Prompt on submit - Invite lors du submit - - - Ignore whitespace changes in annotation - Ignorer les changements relatifs aux espaces dans les annotations - - - Use "patience diff" algorithm - Utiliser l'algorithme "patience diff" - Pull with rebase - Utiliser "pull" avec "rebase" + Utiliser « pull » avec « rebase » Set "HOME" environment variable - Définir la variable d'environnement "HOME" + Définir la variable d’environnement « HOME » - Ignore whitespace changes in annotation and diff - Ignorer les changements relatifs aux espaces dans les annotations et le diff + Set the environment variable HOME to "%1" +(%2). +This causes Git to look for the SSH-keys in that location +instead of its installation directory when run outside git bash. + Définir la variable d’environnement HOME à « %1 » +(%2). +Git cherchera alors les clés SSH à cet endroit, plutôt que dans son répertoire d’installation, lorsqu’il sera exécuté en dehors de git bash. +au lieu de son répertoire d’installation lorsqu’il est exécuté en dehors de git bash. + + + currently set to "%1" + actuellement défini à « %1 » + + + Add instant blame annotations to editor + Ajouter des annotations de blame instantané à l’éditeur + + + Directly annotate each line in the editor when scrolling through the document. + Annoter directement chaque ligne dans l’éditeur lors du défilement du document. + + + The binary "%1" could not be located in the path "%2" + Le binaire « %1 » n’a pas pu être localisé dans le chemin « %2 » + + + Instant Blame + Blame instantané Arguments: Arguments : - - Customize Environment: - Personnaliser votre environnement: - - - Git needs to find Perl in the environment. - Git a besoin de trouver Perl dans l'environnement. - - - Log count: - Compteur de log: - Configuration Configuration @@ -8090,102 +28934,1235 @@ Valider maintenant ? Prepend to PATH: Préfixe pour PATH : - - Repository browser - Explorateur de dépôt - Command: Commande : - Show tags in Branches dialog - Montrer les tags dans le dialogue des branches + Stashes + Remises (« stash ») - -'%1' failed (exit code %2). - - -'%1' échoué (code de retour %2). - + Name + Nom - -'%1' completed (exit code %2). - - -'%1' terminé (code de retour %2). - + Branch + Branche + + + Message + Message + + + <No repository> + <Aucun dépôt> + + + Repository: %1 + Dépôt : %1 + + + Do you want to delete all stashes? + Voulez-vous supprimer toutes les remises (« stash ») ? + + + Do you want to delete %n stash(es)? + + Voulez-vous effacer la remise (« stash ») ? + Voulez-vous effacer %n remises (« stash ») ? + + + + Delete &All... + &Tout supprimer… + + + &Delete... + &Supprimer… + + + R&estore... + R&estaurer… + + + Restore to &Branch... + Restore a git stash to new branch to be created + Restaurer dans la &branche… + + + Delete Stashes + Supprimer les remises (« stash ») + + + Repository Modified + Dépôt modifié + + + %1 cannot be restored since the repository is modified. +You can choose between stashing the changes or discarding them. + %1 ne peut pas être restauré depuis que le dépôt a été modifié. +Vous pouvez choisir entre mettre les changements dans une remise (« stash ») ou de les abandonner. + + + Restore Stash to Branch + Restaurer la remise (« stash ») dans la branche + + + Stash Restore + Restauration de la remise (« stash ») + + + Would you like to restore %1? + Souhaitez-vous restaurer « %1 » ? + + + Error restoring %1 + Erreur lors de la restauration de %1 + + + Chunk successfully staged + Le chunk a été ajouté avec succès + + + Filter by message + Filtrer par message + + + Filter log entries by text in the commit message. + Filtrer les entrées du journal en fonction du texte dans le message du commit. + + + Filter by content + Filtrer par contenu + + + Filter log entries by added or removed string. + Filtrer les entrées du journal en fonction des chaînes de caractères ajoutées ou supprimées. + + + Filter by author + Filtrer par auteur + + + Filter log entries by author. + Filtrer les entrées du journal par auteur. + + + Filter: + Filtrer : + + + Case Sensitive + Sensible à la casse + + + &Blame %1 + &Blamer %1 + + + Blame &Parent Revision %1 + Blamer la révision &parental %1 + + + Stage Chunk... + Ajout du chunk… + + + Unstage Chunk... + Suppression du chunk… + + + not currently set + Actuellement indéfini + + + Git Repository Browser Command + Commande de navigation du dépôt Git + + + Use the patience algorithm for calculating the differences. + Utiliser l’algorithme patience pour calculer les différences. + + + Patience + Patience + + + Ignore whitespace only changes. + Ignorer les changement relatifs aux espaces. + + + Ignore Whitespace + Ignorer les espaces + + + Hide the date of a change from the output. + Cacher la date d’un changement de la sortie. + + + Omit Date + Omettre la date + + + Branch Name: + Nom de la branche : + + + Checkout new branch + Importer une nouvelle branche + + + Add Branch + Ajouter une branche + + + Rename Branch + Renommer une branche + + + Add Tag + Ajouter une étiquette + + + Tag name: + Nom de l’étiquette : + + + Track remote branch "%1" + Pister la branche distante « %1 » + + + Track local branch "%1" + Pister la branche locale « %1 » + + + A remote with the name "%1" already exists. + Une distant portant le nom « %1 » existe déjà. + + + The URL may not be valid. + L’URL n’est peut-être pas valide. + + + Name: + Nom : + + + URL: + URL : + + + Remotes + Distants + + + F&etch + Rec&evoir + + + Delete Remote + Supprimer le distant + + + Would you like to delete the remote "%1"? + Voulez-vous supprimer le distant « %1 » ? + + + &Push + &Envoyer + + + Local Branches + Branches locales + + + Remote Branches + Branches distantes + + + Tags + Étiquettes + + + untracked + non suivi + + + staged + + contexte ? pierre: concept de la staging area (ou index), pas évident à traduire... + ajouté à l’index + + + + modified + modifié + + + added + ajouté + + + deleted + supprimé + + + renamed + renommé + + + copied + copié + + + typechange + changementdetype + + + by both + provenant des deux + + + by us + provenant de nous + + + by them + provenant d’eux + + + Show difference. + Montre les différences. + + + Graph + Graphe + + + Show textual graph log. + Afficher le log textuel du graphe. + + + Changes + Modifications + + + &Query: + &Requête : + + + Change #, SHA-1, tr:id, owner:email or reviewer:email + Changer #, SHA-1, tr:id,owner:email ou reviewer:email + + + Details + Détails + + + C&heckout + C&heckout + + + &Refresh + &Rafraîchir + + + Remote: + Distant : + + + Cherry &Pick + Cherry &pick + + + &Checkout + Importer (&C) + + + Fetching "%1"... + Réception (« fetch ») de « %1 »… + + + The gerrit process has not responded within %1 s. +Most likely this is caused by problems with SSH authentication. +Would you like to terminate it? + Le processus gerrit n’a pas répondu en %1 s. +Il s’agit probablement d’un problème d’authentification SSH. +Souhaitez-vous y mettre fin ? + + + Subject + Sujet + + + Owner + Propriétaire + + + Updated + Mis à jour + + + Project + Projet + + + Approvals + Approbations + + + Number + Numéro + + + Patch set + Ensemble de patchs + + + URL + URL + + + Depends on + Dépend de + + + Needed by + Nécessaire pour + + + Parse error: "%1" -> %2 + Erreur d’analyse : « %1 » -> %2 + + + Parse error: "%1" + Erreur d’analyse : « %1 » + + + Gerrit + Gerrit + + + Error running %1: %2 + Erreur lors de l’exécution de %1 : %2 + + + %1 crashed. + %1 a planté. + + + (Draft) + (brouillon) + + + Querying Gerrit + Interrogation de Gerrit + + + %1 returned %2. + %1 a retourné %2. + + + Timeout + Délai d’attente + + + Terminate + Terminer + + + Keep Running + Continuer l’exécution + + + HTTPS + HTTPS + + + &Host: + &Hôte : + + + Authentication + Authentification + + + <html><head/><body><p>Gerrit server with HTTP was detected, but you need to set up credentials for it.</p><p>To get your password, <a href="LINK_PLACEHOLDER"><span style=" text-decoration: underline; color:#007af4;">click here</span></a> (sign in if needed). Click Generate Password if the password is blank, and copy the user name and password to this form.</p><p>Choose Anonymous if you do not want authentication for this server. In this case, changes that require authentication (like draft changes or private projects) will not be displayed.</p></body></html> + <html><head/><body><p>Le serveur Gerrit avec HTTP a été détecté, mais vous devez configurer des informations d’identification pour celui-ci.</p><p>Pour obtenir votre mot de passe, <a href="LINK_PLACEHOLDER"><span style=" text-decoration: underline; color:#007af4;">cliquez ici</span></a> (connectez-vous si nécessaire). Cliquez sur Générer un mot de passe si le mot de passe est vide, et copiez le nom d’utilisateur et le mot de passe dans ce formulaire.</p><p>Sélectionnez Anonyme si vous ne souhaitez pas d’authentification pour ce serveur. Dans ce cas, les modifications nécessitant une authentification (comme les modifications de brouillon ou les projets privés) ne seront pas affichées.</p></body></html> + + + Server: + Serveur : + + + &User: + &Utilisateur : + + + &Password: + Mot de &passe : + + + Anonymous + Anonyme + + + &ssh: + Espace avant le : (protocole ?) ? + &ssh : + + + cur&l: + cur&l : + + + SSH &Port: + &Port SSH : + + + P&rotocol: + P&rotocole : + + + Determines the protocol used to form a URL in case +"canonicalWebUrl" is not configured in the file +"gerrit.config". + Détermine si le protocole utilisé pour former une URL +dans le cas où « canonicalWebUrl » n’est pas configuré +dans le fichier « gerrit.config ». + + + Gerrit... + Gerrit… + + + Push to Gerrit... + Pousser sur Gerrit… + + + Initialization Failed + Initialisation échouée + + + Error + Erreur + + + Invalid Gerrit configuration. Host, user and ssh binary are mandatory. + La configuration de Gerrit est invalide. L’hôte, l’utilisateur et le binaire ssh sont demandés. + + + Git is not available. + Git n’est pas disponible. + + + Remote Not Verified + Dépôt distant non vérifié + + + Change host %1 +and project %2 + +were not verified among remotes in %3. Select different folder? + L’hôte %1 +et le projet %2 + +n’ont pas été vérifiés auprès des dépôt distant dans %3. Sélectionner un autre dossier ? + + + Enter Local Repository for "%1" (%2) + Saisir le dépôt local pour « %1 » (%2) + + + Detached HEAD + HEAD détachée + + + Provide a valid email to commit. + Fournir un courriel valide pour commiter. + + + Select Change + Sélectionner le changement + + + &Commit only + Seulement &soumettre + + + Commit and &Push + Soumettre et &envoyer + + + Commit and Push to &Gerrit + Soumettre et &envoyer à Gerrit + + + Invalid author + Auteur invalide + + + Invalid email + Courriel invalide + + + Unresolved merge conflicts + Conflits de fusion non résolus + + + &Commit and Push + &Soumettre et envoyer + + + &Commit and Push to Gerrit + &Soumettre et envoyer à Gerrit + + + &Commit + &Soumettre + + + Undo Changes to %1 + Annuler les changements jusqu’à %1 + + + Local Changes Found. Choose Action: + Changements locaux trouvés. Sélectionnez une action : + + + Discard Local Changes + Annuler les changements locaux + + + Checkout branch "%1" + Importer la branche « %1 » + + + Move Local Changes to "%1" + Déplacer les changements locaux vers « %1 » + + + Pop Stash of "%1" + Sortir la remise (« pop stash ») de « %1 » + + + Create Branch Stash for "%1" + Créer une branche remise (« stash ») pour « %1 » + + + Create Branch Stash for Current Branch + Créer une branche remise (« stash ») pour la branche actuelle + + + &Topic: + &Sujet : + + + Number of commits + Nombre de commits + + + &Draft/private + &Brouillon/privé + + + &Work-in-progress + &Travail en cours + + + Checked - Mark change as private. +Unchecked - Remove mark. +Partially checked - Do not change current state. + Coché - Marquer la modification comme privée. +Non coché - Supprimer la marque. +Partiellement coché - Ne pas modifier l’état actuel. + + + Pushes the selected commit and all dependent commits. + Pousser le commit sélectionné et tous les commits dépendants. + + + Comma-separated list of reviewers. + +Reviewers can be specified by nickname or email address. Spaces not allowed. + +Partial names can be used if they are unambiguous. + Liste des réviseurs séparés par des virgules. + +Les réviseurs peuvent être spécifiés par un surnom ou une adresse électronique. Les espaces ne sont pas autorisées. + +Des noms partiels peuvent être utilisés s’ils ne sont pas ambigus. + + + Push: + Push : + + + To: + Vers : + + + Commits: + Commits : + + + &Reviewers: + &Relecteurs : + + + Cannot find a Gerrit remote. Add one and try again. + Impossible de trouver un dépôt distant Gerrit. Ajoutez-en un et réessayez. + + + Number of commits between %1 and %2: %3 + Nombre de commits entre %1 et %2 : %3 + + + Are you sure you selected the right target branch? + Êtes-vous sûr(e) d’avoir sélectionné la bonne branche cible ? + + + Checked - Mark change as WIP. +Unchecked - Mark change as ready for review. +Partially checked - Do not change current state. + Coché - Marquer la modification comme WIP. +Non coché - Marquer la modification comme prête à être revue. +Partiellement coché - Ne pas modifier l’état actuel. + + + Supported on Gerrit 2.15 and later. + Pris en charge à partir de Gerrit 2.15. + + + Checked - The change is a draft. +Unchecked - The change is not a draft. + Coché - La modification est un brouillon. +Non coché - La modification n’est pas un brouillon. + + + No remote branches found. This is probably the initial commit. + Aucune branche distante n’a été trouvée. Il s’agit probablement du commit initial. + + + Branch name + Nom de la branche + + + ... Include older branches ... + … Inclusion des anciennes branches … + + + Sha1 + SHA1 + + + Reset to: + Réinitialiser à : + + + Select change: + Sélectionner la modification : + + + Reset type: + Réinitialiser le type : + + + Mixed + Mixte + + + Hard + Hard + + + Soft + Soft + + + Normal + Normal + + + Submodule + Sous-module + + + Deleted + Supprimé + + + Symbolic link + Lien symbolique + + + Modified + Modifié + + + Created + Créé + + + Submodule commit %1 + Commit du sous-module %1 + + + Symbolic link -> %1 + Lien symbolique -> %1 + + + Merge Conflict + Conflit dans la fusion + + + %1 merge conflict for "%2" +Local: %3 +Remote: %4 + conflit de fusion de %1 pour « %2 » +Local : %3 +Distant : %4 + + + Merge tool is not configured. + L’outil de fusion n’est pas configuré. + + + Run git config --global merge.tool &lt;tool&gt; to configure it, then try again. + Exécutez git config --global merge.tool &lt;tool&gt; pour le configurer, puis réessayez. + + + &Local + &Local + + + &Remote + &Distant + + + &Created + &Créé + + + &Modified + &Modifié + + + &Deleted + &Supprimé + + + Unchanged File + Fichier inchangé + + + Was the merge successful? + La fusion a-t-elle réussi ? + + + Continue Merging + Continuer la fusion + + + Continue merging other unresolved paths? + Continuer la fusion pour les autres chemins non résolus ? + + + Refresh Remote Servers + Rafraîchir les serveurs distants + + + Fallback + + + + Certificate Error + Erreur de certificat + + + Server certificate for %1 cannot be authenticated. +Do you want to disable SSL verification for this server? +Note: This can expose you to man-in-the-middle attack. + Le certificat du serveur %1 ne peut pas être authentifié. +Voulez-vous désactiver la vérification SSL pour ce serveur ? +Remarque : cela peut vous exposer à une attaque de type « homme du milieu ». + + + Tree (optional) + Arbre (optionnel) + + + Can be HEAD, tag, local or remote branch, or a commit hash. +Leave empty to search through the file system. + Peut être HEAD, une étiquette, une branche locale ou distante, ou un hash de commit. +Laisser vide pour rechercher dans le système de fichiers. + + + Recurse submodules + Parcourir récursivement les sous-modules + + + Git Grep + Git Grep + + + Ref: %1 +%2 + Ref : %1 +%2 + + + Refreshing Commit Data + Rafraîchissement des données de commit - HelloWorld::Internal::HelloWorldPlugin + QtC::GitLab - Say "&Hello World!" - Dit "&Bonjour tout le monde!" + Clone Repository + Cloner le dépôt - &Hello World - &Bonjour tout le monde + Specify repository URL, checkout path and directory. + Spécifier l’URL du dépôt, le chemin de checkout et le répertoire. - Hello world! - Bonjour tout le monde ! + Repository + Dépôt - Hello World PushButton! - Bouton bonjour tout le monde ! + Path + Chemin - Hello World! - Bonjour tout le monde ! + Path "%1" already exists. + Le chemin « %1 » existe déjà. - Hello World! Beautiful day today, isn't it? - Bonjour tout le monde! Belle journée aujourd'hui, n'est-ce pas ? + Directory + Répertoire + + + Recursive + Récursif + + + Clone + Cloner + + + User canceled process. + L’utilisateur a annulé le processus. + + + Cloning succeeded. + Le clonage a réussi. + + + Warning + Avertissement + + + Cloned project does not have a project file that can be opened. Try importing the project as a generic project. + Le projet cloné n’a pas de fichier de projet qui peut être ouvert. Essayez d’importer le projet en tant que projet générique. + + + Open Project + Ouvrir le projet + + + Choose the project file to be opened. + Sélectionnez le fichier de projet à ouvrir. + + + Cloning failed. + Le clonage a échoué. + + + GitLab + GitLab + + + Search + Rechercher + + + ... + + + + 0 + 0 + + + Clone... + Cloner… + + + Remote: + Distant : + + + Not logged in. + Non connecté. + + + Insufficient access token. + Jeton d’accès insuffisant.accès insuffisant. + + + Permission scope read_api or api needed. + Permission read_api ou api nécessaire. + + + Check settings for misconfiguration. + Vérifier les paramètres pour s’assurer qu’ils ne sont pas mal configurés. + + + Projects (%1) + Projets (%1) + + + Using project access token. + Utilisation des jetons d’accès au projet. + + + Logged in as %1 + Connecté en tant que %1 + + + Id: %1 (%2) + Identifiant : %1 (%2) + + + Host: + Hôte : + + + Description: + Description : + + + Access token: + Jeton d’accès : + + + Port: + Port : + + + HTTPS: + HTTPS : + + + Default: + Par défaut : + + + curl: + curl : + + + Edit... + Modifier… + + + Edit current selected GitLab server configuration. + Modifier la configuration du serveur GitLab actuellement sélectionné. + + + Remove + Supprimer + + + Remove current selected GitLab server configuration. + Supprimer la configuration du serveur GitLab actuellement sélectionnée. + + + Add... + Ajouter… + + + Add new GitLab server configuration. + Ajouter une nouvelle configuration de serveur GitLab. + + + Edit Server... + Modifier le serveur… + + + Modify + Modifier + + + Add Server... + Ajouter un serveur… + + + Add + Ajouter + + + GitLab... + GitLab… + + + Error + Erreur + + + Invalid GitLab configuration. For a fully functional configuration, you need to set up host name or address and an access token. Providing the path to curl is mandatory. + Configuration GitLab non valide. Pour une configuration pleinement fonctionnelle, vous devez définir le nom ou l’adresse de l’hôte et un jeton d’accès. Il est obligatoire de fournir le chemin d’accès à curl. + + + Certificate Error + Erreur de certificat + + + Server certificate for %1 cannot be authenticated. +Do you want to disable SSL verification for this server? +Note: This can expose you to man-in-the-middle attack. + Le certificat du serveur %1 ne peut pas être authentifié. +Voulez-vous désactiver la vérification SSL pour ce serveur ? +Remarque : cela peut vous exposer à une attaque de type « homme du milieu ». + + + Guest + Invité + + + Reporter + Rapporteur + + + Developer + Développeur + + + Maintainer + Mainteneur + + + Owner + Propriétaire + + + Linked GitLab Configuration: + Configuration GitLab liée : + + + Link with GitLab + Lier avec GitLab + + + Unlink from GitLab + Délier de GitLab + + + Test Connection + Tester la connexion + + + Projects linked with GitLab receive event notifications in the Version Control output pane. + Les projets liés à GitLab reçoivent des notifications d’évènements dans le panneau de sortie du gestionnaire de versions. + + + Remote host does not match chosen GitLab configuration. + L’hôte distant ne correspond pas à la configuration GitLab choisie. + + + Accessible (%1). + Accessible (%1). + + + Read only access. + Accès en lecture seule. + + + Not a git repository. + Pas un dépôt git. + + + Local git repository without remotes. + Dépôt git local sans dépôt distant. - HelloWorld::Internal::HelloWorldWindow + QtC::GlslEditor - Focus me to activate my context! - Donnez moi le focus pour activer mon contexte ! + GLSL + GLSL sub-menu in the Tools menu + GLSL + + + + QtC::Haskell + + Release + Release - Hello, world! - Bonjour tout le monde ! + General + Général + + + Build directory: + Répertoire de compilation : + + + GHCi + GHCi + + + Failed to run GHCi: "%1". + Impossible d’exécuter CHCi : « %1 ». + + + Run GHCi + Exécuter GHCi + + + Haskell + SnippetProvider + Haskell + + + Executable + Exécutable + + + Haskell + Haskell + + + Stack executable: + Exécutable de la pile : + + + Choose Stack Executable + Choisir l’exécutable de la pile + + + Stack Build + Compiler la pile QtC::Help - Add new page - Ajouter une nouvelle page + Indexing Documentation + Indexation de la documentation - Print Document - Imprimer le document + Open Link + Ouvrir le lien - unknown - inconnue + Regenerate Index + Regénérer l’index - Add New Page - Ajouter une nouvelle page - - - Close This Page - Fermer cette page - - - Close Other Pages - Fermer les autres pages - - - Add Bookmark for this Page... - Ajouter un signet pour cette page... + Open Link as New Page + Ouvrir le lien en tant que nouvelle page Documentation @@ -8195,9 +30172,13 @@ Valider maintenant ? Add Documentation Ajouter de la documentation + + %1 (auto-detected) + %1 (auto-détecté) + Qt Help Files (*.qch) - Fichiers d'aide Qt (*.qch) + Fichiers d’aide Qt (*.qch) Invalid documentation file: @@ -8208,25 +30189,16 @@ Valider maintenant ? Espace de noms déjà inscrit : - Registration failed - Échec de l'inscription + Registration Failed + Échec de l’enregistrement Unable to register documentation. - Impossible d'inscrire la documentation. - - - The file %1 is not a valid Qt Help file! - Le fichier %1 n'est pas un fichier d'aide Qt valide ! - - - Cannot unregister documentation file %1! - trad unregister ? - Impossible de désinscrire le fichier de documentation %1 ! + Impossible d’inscrire la documentation. Add and remove compressed help files, .qch. - Ajouter et supprimer des fichiers d'aide compressés, .qch. + Ajouter et supprimer des fichiers d’aide compressés, .qch. Registered Documentation @@ -8234,7 +30206,7 @@ Valider maintenant ? Add... - Ajouter... + Ajouter… Remove @@ -8248,61 +30220,9 @@ Valider maintenant ? Unfiltered Sans filtre - - No user defined filters available or no filter selected. - Pas de filtre défini par l'utilisateur disponible ou de filtre sélectionné. - - - The filter "%1" will show every documentation file available, as no attributes are specified. - Le filtre "%1" montrera chaque fichier de la documentation disponible, puisqu'aucun attribut n'est spécifié. - - - The filter "%1" will only show documentation files that have the attribute %2 specified. - Le filtre "%1" ne montrera que les fichiers de la documentation qui ont l'attribut %2 spécifié. - - - The filter "%1" will only show documentation files that have the attributes %2 specified. - Le filtre "%1" ne montrera que les fichiers de la documentation qui ont les attributs %2 spécifiés. - - - <html><body> -<p> -Add, modify, and remove document filters, which determine the documentation set displayed in the Help mode. The attributes are defined in the documents. Select them to display a set of relevant documentation. Note that some attributes are defined in several documents. -</p></body></html> - <html><body> -<p> -Ajouter, modifier et supprimer des filtres de documents, qui détermine l'ensemble des contenus affichés dans le mode Aide. Les attributs sont définis dans les documents. Sélectionnez les pour afficher la documentation appropriée. Note : certains attributs sont définis dans plusieurs documents. -</p></body></html> - - - Attributes - Attributs - - - 1 - 1 - - - Add - Ajouter - - - <html><body> -<p> -Add, modify, and remove document filters, which determine the documentation set displayed in the Help mode. The attributes are defined in the documents. Select them to display a set of relevant documentation. Note that some attributes are defined in several documents. -</p></body></html> - <html><body> -<p> -Ajouter, modifier et supprimer des filtres de documents, lesquels déterminent la documentation qui sera affichée dans le mode d'aide. Les attributs sont définis dans les documents. Sélectionnez-les pour afficher la documentation pertinente. Notez que certains attributs sont définis dans plusieurs documents. -</p></body></html> - - - Help index - Index de l'aide - Help Index - Index de l'aide + Index de l’aide Help @@ -8320,29 +30240,97 @@ Ajouter, modifier et supprimer des filtres de documents, lesquels déterminent l Search Rechercher + + Open Link in Window + Ouvrir le lien dans une fenêtre + Bookmarks Signets + + Show Context Help Side-by-Side if Possible + Afficher l’aide contextuelle côte à côte si possible + + + Always Show Context Help Side-by-Side + Toujours afficher l’aide contextuelle côte à côte + + + Always Show Context Help in Help Mode + Toujours afficher l’aide contextuelle dans le mode Aide + + + Always Show Context Help in External Window + Toujours afficher l’aide contextuelle dans une fenêtre externe + + + Open in Help Mode + Ouvrir dans le mode Aide + Home Accueil + + Back + Reculer + + + Forward + Avancer + + + Open Online Documentation... + Ouvrir la documentation en ligne… + + + Open in Edit Mode + Ouvrir en mode Édition + + + Open in New Page + Ouvrir dans une nouvelle page + + + Open in Window + Ouvrir dans une fenêtre + + + Activate Help Bookmarks View + Activer l’affichage des signets d’aide + + + Alt+Meta+M + Alt+Meta+M + + + Activate Help Search View + Activer l’affichage de la recherche d’aide + Meta+/ Meta+/ Ctrl+Shift+/ - Ctrl+Shift+/ + Ctrl+Maj+/ - Meta+B - Meta+B + Help - %1 + Aide - %1 + + + Print Documentation + Imprimer la documentation Ctrl+Shift+B - Ctrl+Shift+B + Ctrl+Maj+B + + + Activate Open Help Pages View + Activer l’affichage des pages d’aide ouvertes Meta+O @@ -8350,32 +30338,12 @@ Ajouter, modifier et supprimer des filtres de documents, lesquels déterminent l Ctrl+Shift+O - Ctrl+Shift+O - - - Show Sidebar - Afficher la barre latérale - - - Previous - Précédent - - - Next - Suivant + Ctrl+Maj+O Add Bookmark Ajouter un signet - - Previous Page - Page précédente - - - Next Page - Page suivante - Meta+M Meta+M @@ -8388,17 +30356,9 @@ Ajouter, modifier et supprimer des filtres de documents, lesquels déterminent l Context Help Aide contextuelle - - Technical Support - Support technique - Report Bug... - Signaler un bug... - - - Activate Index in Help mode - Activer l'index en mode aide + Signaler un bogue… Meta+I @@ -8406,87 +30366,39 @@ Ajouter, modifier et supprimer des filtres de documents, lesquels déterminent l Ctrl+Shift+I - Ctrl+Shift+I - - - Activate Contents in Help mode - Activer le contenu en mode aide + Ctrl+Maj+I Meta+Shift+C - Meta+Shift+C + Meta+Maj+C Ctrl+Shift+C - Ctrl+Shift+C - - - Activate Search in Help mode - Activer la recherche en mode aide - - - Hide Sidebar - Masquer la barre latérale + Ctrl+Maj+C Increase Font Size Augmenter la taille de la police - - Ctrl++ - Ctrl++ - Decrease Font Size Diminuer la taille de la police - - Ctrl+- - Ctrl+- - Reset Font Size Réinitialiser la taille de la police - - Ctrl+0 - Ctrl+0 - - - Alt+Tab - Alt+Tab - - - Alt+Shift+Tab - Alt+Shift+Tab - - - Ctrl+Tab - Ctrl+Tab - - - Ctrl+Shift+Tab - Ctrl+Shift+Tab - - - Activate Bookmarks in Help mode - Activer les signets dans le mode aide - Open Pages Pages ouvertes - Activate Open Pages in Help mode - Activer les pages ouvertes en mode aide + Technical Support... + Support technique… - Go to Help Mode - Passer au mode Aide - - - Close current Page - Fermer la page courante + System Information... + Information du système… No Documentation @@ -8497,33 +30409,16 @@ Ajouter, modifier et supprimer des filtres de documents, lesquels déterminent l Aucune documentation disponible. - Close current page - Fermer la page courante + System Information + Information du système - Filtered by: - better than "filtré par" in the context - Filtre : + Use the following to provide more detailed information about your system to bug reports: + Utiliser les éléments suivants pour fournir des informations plus détaillées concernant votre système aux rapports de bogues : - &Copy - Co&pier - - - Copy &Link Location - Copier l'adresse du &lien - - - Select All - Tout sélectionner - - - Indexing - Indexation - - - Indexing Documentation... - Indexation de la documentation… + Copy to Clipboard + Copier dans le presse-papiers Copy Link @@ -8537,343 +30432,3631 @@ Ajouter, modifier et supprimer des filtres de documents, lesquels déterminent l Reload Recharger - - <html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Error 404...</title></head><body><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div></body> - <html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Erreur 404...</title></head><body><div align="center"><br><br><h1>La page n'a pas pu être trouvée</h1><br><h3>"%1"</h3></div></body> - - - <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - <title>Erreur 404...</title><div align="center"><br><br><h1>La page est introuvable</h1><br><h3>"%1"</h3></div> - - - Unable to launch external application. - - Impossible de lancer l'application externe. - - - - OK - OK - - - Open Link in New Tab Ctrl+LMB - Ouvrir le lien dans un nouvel onglet Ctrl+LMB - - - Error 404... - Erreur 404... - - - The page could not be found! - Passé ? - La page n'a pas été trouvée ! - - - <li>Check that you have one or more documentation sets installed.</li> - <li>Vérifiez que vous avez un ou plusieurs ensembles de documentation installés.</li> - - - <li>Check that you have installed the appropriate browser plug-in to support the file your loading.</li> - un peu bancal le "pour le navigateur" ? >> un peu changé (was: "<li>Vérifiez que vous avez installé le plug-in approprié pour le navigateur qui accepte le fichier que vous chargez.</li>"). - <li>Vérifiez que vous avez installé le plug-in approprié au fichier que vous chargez dans le navigateur.</li> - - - <li>If you try to access a public URL, make sure to have a network connection.</li> - <li>Si vous essayez d'accéder à une URL publique, assurez-vous d'avoir une connexion réseau.</li> - - - <li>If your computer or network is protected by a firewall or proxy, make sure the application is permitted to access the network.</li> - proxy -> serveur mandataire ? -> en théorie, oui - <li>Si votre ordinateur ou votre réseau est protégé par un pare-feu ou un serveur mandataire, assurez-vous que l'application est autorisée à accéder au réseau.</li> - &Look for: &Rechercher : - - - QtC::Core - Filters - Filtres + Choose Topic + thème ? + Sélectionner le thème - Locator - Localisateur + Choose a topic for <b>%1</b>: + Sélectionnez un thème pour <b>%1</b> : + + + General + Général + + + Default (%1) + Default viewer backend + Par défaut (%1) + + + Import Bookmarks + Importer les signets + + + Files (*.xbel) + Fichiers (*.xbel) + + + Cannot import bookmarks. + Impossible d’importer les signets. + + + Save File + Enregistrer ? (tout court) + Enregistrer le fichier + + + Font + Police + + + Family: + Famille : + + + Style: + Style : + + + Size: + Taille : + + + Note: The above setting takes effect only if the HTML file does not use a style sheet. + Remarque : le réglage ci-dessus n’est effectif que si le fichier HTML n’utilise pas de feuille de style. + + + Zoom: + Zoom : + + + % + % + + + Startup + Démarrage + + + Always Show in Help Mode + Toujours afficher le mode Aide + + + Always Show in External Window + Toujours afficher dans une fenêtre externe + + + On context help: + Pour l’aide contextuelle : + + + Enable scroll wheel zooming + Activer le zoom avec la molette de défilement + + + Switches to editor context after last help page is closed. + Bascule dans l’aide contextuelle de l’éditeur après la fermeture de la dernière page d’aide. + + + Viewer backend: + Backend de l’afficheur : + + + Change takes effect after reloading help pages. + La modification prend effet après le rechargement des pages d’aide. + + + Show Side-by-Side if Possible + Afficher côte à côte si possible + + + Always Show Side-by-Side + Toujours afficher côte à côte + + + On help start: + Au démarrage de l’aide : + + + Show My Home Page + Afficher ma page d’accueil + + + Show a Blank Page + Afficher une page blanche + + + Show My Tabs from Last Session + Afficher mes onglets de la dernière session + + + Reset to default. + Restaurer les paramètres par défaut. + + + Home page: + Page d’accueil : + + + Use &Current Page + Utiliser la page a&ctuelle + + + Use &Blank Page + Utiliser une page &blanche + + + Reset + Réinitialiser + + + Behaviour + Comportement + + + Return to editor on closing the last page + Retourner à l’éditeur lors de la fermeture de la dernière page + + + Import Bookmarks... + Importer les signets… + + + Export Bookmarks... + Exporter les signets… + + + The file is not an XBEL version 1.0 file. + Il ne s’agit pas d’un fichier XBEL version 1.0. + + + Unknown title + Titre inconnu + + + litehtml + litehtml + + + QtWebEngine + QtWebEngine + + + QTextBrowser + QTextBrowser + + + WebKit + WebKit + + + Error loading page + Erreur lors du chargement de la page + + + <p>Check that you have the corresponding documentation set installed.</p> + <p>Vérifiez que vous avez installé la documentation correspondante.</p> + + + Error loading: %1 + Erreur lors du chargement : %1 + + + The page could not be found + La page n’a pas été trouvée + + + (Untitled) + (Sans titre) + + + Close %1 + Fermer %1 + + + Close All Except %1 + Tout fermer sauf %1 + + + Copy Full Path to Clipboard + Copier le chemin complet dans le presse papier + + + Update Documentation + Mettre à jour la documentation + + + Zoom: %1% + Zoom : %1% + + + Get Help Online + Obtenir l’aide en ligne + + + New Folder + Nouveau dossier + + + Bookmark: + Signet : + + + Add in folder: + Ajouter dans le dossier : + + + Delete Folder + Supprimer le dossier + + + Rename Folder + Renommer le dossier + + + Show Bookmark + Afficher le signet + + + Show Bookmark as New Page + Afficher le signet comme une nouvelle page + + + Delete Bookmark + Supprimer le signet + + + Rename Bookmark + Renommer le signet + + + Deleting a folder also removes its content.<br>Do you want to continue? + Supprimer un dossier supprime également ce qu’il contient.<br>Voulez-vous continuer ? - MainWindow + QtC::ImageViewer - Open file - Ouvrir le fichier + Export + Exporter - Bauhaus - MainWindowClass - Bauhaus + Set as Default + Définir comme par défaut - &File - &Fichier + on + activé - &New... - &Nouveau... + off + désactivé - Ctrl+N - Ctrl+N + Use the current settings for background, outline, and fitting to screen as the default for new image viewers. Current default: + Utiliser les paramètres actuels pour l’arrière-plan, le contour et l’adaptation à l’écran comme valeur par défaut pour les nouveaux afficheurs d’images. Valeur par défaut actuelle : - &Open... - &Ouvrir... + Background: %1 + Arrière-plan : %1 - Ctrl+O - Ctrl+O + Outline: %1 + Contour : %1 - Recent Files - Fichiers récents + Fit to Screen: %1 + Adaptation à l’écran : %1 - &Save - &Enregistrer + Image Viewer + Afficheur d’images - Ctrl+S - Ctrl+S + Fit to Screen + Ajuster à la taille de l’écran - Save &As... - Enregistrer &sous... + Ctrl+= + Ctrl+= - &Preview - A&perçu + Switch Background + Basculer l’arrière-plan - Ctrl+R - Ctrl+R + Switch Outline + Basculer le contour - &Preview with Debug - Aperçu avec &débogage + Toggle Animation + Activer/désactiver l’animation - Ctrl+D - Ctrl+D + Export Multiple Images + Exporter plusieurs images - &Quit - &Quitter + Copy as Data URL + Copier comme URL de données - &Edit - &Édition + Ctrl+[ + Ctrl+[ - Ctrl+Z - Ctrl+Z + Ctrl+] + Ctrl+] - Ctrl+Y - Ctrl+Y + Play Animation + Jouer l’animation - Ctrl+Shift+Z - Ctrl+Shift+Z + Pause Animation + Mettre en pause l’animation - &Copy - Cop&ier + File: + Fichier : - &Cut - Co&uper + x + Multiplication, as in 32x32 + x - &Paste - C&oller + Size: + Taille : - &Delete - &Supprimer + %1 already exists. +Would you like to overwrite it? + %1 existe déjà. +Souhaitez-vous l’écraser ? - Del - Suppr + Exported "%1", %2x%3, %4 bytes + « %1 » exporté, %2x%3, %4 octets - Backspace - Backspace + Could not write file "%1". + Impossible d’écrire le fichier « %1 ». - &View - Affichage ? - &Vue + Export Image + Exporter l’image - &Help - &Aide + Export %1 + Exporter %1 - &About... - À p&ropos… + Export a Series of Images from %1 (%2x%3) + Exporter une série d’images à partir de %1 (%2x%3) - Properties - Propriétés + Image format not supported. + Format d’image non pris en charge. - Could not open file <%1> - Impossible d'ouvrir le fichier <%1> + Failed to read SVG image. + Échec de la lecture de l’image SVG. - Qml Errors: - Erreurs QML : + Failed to read image. + Échec de la lecture de l’image. - -%1 %2:%3 - %4 - -%1 %2:%3 - %4 - - - -%1:%2 - %3 - -%1:%2 - %3 - - - Quit - Quitter - - - Ctrl+Q - Ctrl+Q - - - Run to main() - Exécuter jusqu'à main() - - - Ctrl+F5 - Ctrl+F5 - - - F5 - F5 - - - Shift+F5 - Shift+F5 - - - F6 - F6 - - - F7 - F7 - - - Shift+F6 - Shift+F6 - - - Shift+F9 - Shift+F9 - - - Shift+F7 - Shift+F7 - - - Shift+F8 - Shift+F8 - - - F8 - F8 - - - ALT+D,ALT+W - ALT+D,ALT+W - - - Files - Fichiers - - - Debug - Déboguer - - - Not a runnable project - Pas un projet exécutable - - - The current startup project can not be run. - Le projet de démarrage actuel ne peut pas être exéctué. - - - Open File - Ouvrir un fichier - - - Cannot find special data dumpers - Impossible de trouver les collecteurs de données - - - The debugged binary does not contain information needed for nice display of Qt data types. - -Make sure you use something like - -SOURCES *= .../ide/main/bin/dumper/dumper.cpp - -in your .pro file. - Le fichier binaire débogué ne contient pas les informations nécessaires pour l'affichage correct des types de données Qt. - -Assurez-vous que vous utilisez quelque chose comme - -SOURCES *= .../ide/main/bin/dumper/dumper.cpp - -dans votre fichier .pro. - - - Open Executable File - Ouvrir un fichier exécutable - - - - QtC::ProjectExplorer - - - MyMain - - N/A - Indisponible - - - - NickNameDialog - - Nick Names - Noms - - - Filter: - Filtre : + Enter a file name containing place holders %1 which will be replaced by the width and height of the image, respectively. + Saisir un nom de fichier contenant des caractères d’espacement %1 qui seront remplacés par la largeur et la hauteur de l’image, respectivement. Clear - Effacer + Effacer - Nicknames - Surnoms + Set Standard Icon Sizes + Définir des tailles d’icônes standard + + + Generate Sizes + Générer les tailles + + + A comma-separated list of size specifications of the form "<width>x<height>". + Une liste de spécifications de taille séparées par des virgules de la forme « <largeur>x<hauteur> ». + + + Sizes: + Tailles: + + + Please specify some sizes. + Veuillez indiquer certaines tailles. + + + Invalid size specification: %1 + Indication de taille invalide : %1 + + + The file name must contain one of the placeholders %1, %2. + Le nom du fichier doit contenir l’un de ces caractères d’espacement %1, %2. + + + The file %1 already exists. +Would you like to overwrite it? + Le fichier %1 existe déjà. +Souhaitez-vous l’écraser ? + + + The files %1 already exist. +Would you like to overwrite them? + Les fichiers %1 existent déjà. +Souhaitez-vous les écraser ? + + + + QtC::IncrediBuild + + IncrediBuild for Windows + + + + Target and Configuration + + + + Enter the appropriate arguments to your build command. + + + + Make sure the build command's multi-job parameter value is large enough (such as -j200 for the JOM or Make build tools) + + + + Keep original jobs number: + + + + Forces IncrediBuild to not override the -j command line switch, that controls the number of parallel spawned tasks. The default IncrediBuild behavior is to set it to 200. + + + + IncrediBuild Distribution Control + + + + Profile.xml: + + + + Defines how Automatic Interception Interface should handle the various processes involved in a distributed job. It is not necessary for "Visual Studio" or "Make and Build tools" builds, but can be used to provide configuration options if those builds use additional processes that are not included in those packages. It is required to configure distributable processes in "Dev Tools" builds. + + + + Avoid local task execution: + + + + Overrides the Agent Settings dialog Avoid task execution on local machine when possible option. This allows to free more resources on the initiator machine and could be beneficial to distribution in scenarios where the initiating machine is bottlenecking the build with High CPU usage. + + + + Determines the maximum number of CPU cores that can be used in a build, regardless of the number of available Agents. It takes into account both local and remote cores, even if the Avoid Task Execution on Local Machine option is selected. + + + + Maximum CPUs to utilize in the build: + + + + Newest allowed helper machine OS: + + + + Specifies the newest operating system installed on a helper machine to be allowed to participate as helper in the build. + + + + Oldest allowed helper machine OS: + + + + Specifies the oldest operating system installed on a helper machine to be allowed to participate as helper in the build. + + + + Output and Logging + + + + Build title: + + + + Specifies a custom header line which will be displayed in the beginning of the build output text. This title will also be used for the Build History and Build Monitor displays. + + + + Save IncrediBuild monitor file: + + + + Writes a copy of the build progress file (.ib_mon) to the specified location. If only a folder name is given, a generated GUID will serve as the file name. The full path of the saved Build Monitor will be written to the end of the build output. + + + + Suppress STDOUT: + + + + Does not write anything to the standard output. + + + + Output Log file: + + + + Writes build output to a file. + + + + Show Commands in output: + + + + Shows, for each file built, the command-line used by IncrediBuild to build the file. + + + + Show Agents in output: + + + + Shows the Agent used to build each file. + + + + Show Time in output: + + + + Shows the Start and Finish time for each file built. + + + + Hide IncrediBuild Header in output: + + + + Suppresses IncrediBuild's header in the build output + + + + Internal IncrediBuild logging level: + + + + Overrides the internal Incredibuild logging level for this build. Does not affect output or any user accessible logging. Used mainly to troubleshoot issues with the help of IncrediBuild support + + + + Miscellaneous + Divers + + + Set an Environment Variable: + + + + Sets or overrides environment variables for the context of the build. + + + + Stop on errors: + + + + When specified, the execution will stop as soon as an error is encountered. This is the default behavior in "Visual Studio" builds, but not the default for "Make and Build tools" or "Dev Tools" builds + + + + Additional Arguments: + + + + Add additional buildconsole arguments manually. The value of this field will be concatenated to the final buildconsole command line + + + + Open Build Monitor: + + + + Opens Build Monitor once the build starts. + + + + CMake + CMake + + + Custom Command + + + + Command Helper: + + + + Select a helper to establish the build command. + + + + Make command: + + + + Make arguments: + Arguments de Make : + + + IncrediBuild for Linux + + + + Specify nice value. Nice Value should be numeric and between -20 and 19 + + + + Nice value: + + + + Force remote: + + + + Alternate tasks preference: + + + + Make + Make + + + + QtC::Ios + + Base arguments: + Arguments de base : + + + Reset Defaults + Restaurer les paramètres par défaut + + + Extra arguments: + Arguments supplémentaires : + + + xcodebuild + xcodebuild + + + Command: + Commande : + + + Arguments: + Arguments : + + + Reset to Default + Restaurer les paramètres par défaut + + + iOS Configuration + Configuration iOS + + + Ask about devices not in developer mode + Demander pour les périphériques qui ne sont pas en mode développeur + + + Rename + Renommer + + + Rename a simulator device. + + + + Delete + Supprimer + + + Delete simulator devices. + + + + Reset contents and settings of simulator devices. + + + + Create + Créer + + + Create a new simulator device. + + + + Start + Démarrer + + + Start simulator devices. + + + + Screenshot + Capture d’écran + + + Devices + Périphériques + + + Simulator + Simulateur + + + Screenshot directory: + + + + You are trying to launch %n simulators simultaneously. This will take significant system resources. Do you really want to continue? + + + + + + + Simulator Start + + + + Starting %n simulator device(s)... + + + + + + + Cannot start simulator (%1, %2) in current state: %3 + + + + simulator start + + + + Creating simulator device... + + + + Simulator device (%1) created. +UDID: %2 + + + + Simulator device (%1) creation failed. +Error: %2 + + + + Do you really want to reset the contents and settings of the %n selected device(s)? + + + + + + + Resetting contents and settings... + + + + simulator reset + + + + Rename %1 + + + + Enter new name: + + + + Renaming simulator device... + + + + simulator rename + + + + Delete Device + + + + Do you really want to delete the %n selected device(s)? + + + + + + + Deleting %n simulator device(s)... + + + + + + + simulator delete + + + + Capturing screenshots from %n device(s)... + + + + + + + simulator screenshot + + + + iOS build + iOS BuildStep display name. + Compilation iOS + + + Deploy on iOS + Déploiement sur iOS + + + Deploy to %1 + Déploiement sur %1 + + + Error: no device available, deploy failed. + Erreur : aucun périphérique n’est disponible, le déploiement a échoué. + + + Deployment failed. No iOS device found. + Échec lors du déploiement. Aucun périphérique iOS n’a été trouvé. + + + Transferring application + + + + Deployment failed. The settings in the Devices window of Xcode might be incorrect. + + + + The provisioning profile "%1" (%2) used to sign the application does not cover the device %3 (%4). Deployment to it will fail. + + + + Deploy to iOS device + + + + Deployment failed. + Échec lors du déploiement. + + + The Info.plist might be incorrect. + Le fichier Info.plist est peut-être incorrecte. + + + iOS Device + Périphérique iOS + + + Device name + Nom du périphérique + + + Developer status + Whether the device is in developer mode. + État du mode développeur + + + Connected + Connecté + + + yes + oui + + + no + non + + + unknown + inconnu + + + OS version + + + + An iOS device in user mode has been detected. + Un périphérique iOS en mode utilisateur a été détecté. + + + Do you want to see how to set it up for development? + Voulez-vous voir comment l’activer pour le développement ? + + + Device name: + Nom du périphérique : + + + Identifier: + + + + OS Version: + + + + CPU Architecture: + + + + Failed to detect the ABIs used by the Qt version. + Échec de la détection des ABI utilisées par la version de Qt. + + + iOS + Qt Version is meant for Ios + iOS + + + Run on %1 + Exécuter sur %1 + + + Run %1 on %2 + + + + Kit has incorrect device type for running on iOS devices. + + + + No device chosen. Select %1. + + + + No device chosen. Enable developer mode on a device. + + + + No device available. + + + + To use this device you need to enable developer mode on it. + + + + %1 is not connected. Select %2? + + + + %1 is not connected. Enable developer mode on a device? + + + + %1 is not connected. + + + + Starting remote process. + Démarrage des processus distants. + + + Could not find %1. + + + + Could not get necessary ports for the debugger connection. + + + + Could not get inferior PID. + + + + Run failed. The settings in the Organizer window of Xcode might be incorrect. + Échec lors de l’exécution. Les paramètres dans la fenêtre Organizer de Xcode sont peut-être incorrects. + + + The device is locked, please unlock. + Le périphérique est verrouillé, veuillez le déverrouiller. + + + Run ended. + + + + Run ended with error. + + + + Could not get necessary ports for the profiler connection. + + + + Application not running. + + + + Could not find device specific debug symbols at %1. Debugging initialization will be slow until you open the Organizer window of Xcode with the device connected to have the symbols generated. + + + + The dSYM %1 seems to be outdated, it might confuse the debugger. + + + + iOS Simulator + Simulateur iOS + + + Create Simulator + + + + Simulator name: + + + + Device type: + Type de périphérique : + + + OS version: + Version de l’OS : + + + None + Aucune + + + iOS Settings + + + + Reset + Réinitialiser + + + Automatically manage signing + + + + Development team: + + + + Provisioning profile: + + + + Default + Défaut + + + Development team is not selected. + + + + Provisioning profile is not selected. + + + + Using default development team and provisioning profile. + + + + Development team: %1 (%2) + + + + Settings defined here override the QMake environment. + + + + %1 not configured. Use Xcode and Apple developer account to configure the provisioning profiles and teams. + + + + Development teams + + + + Provisioning profiles + + + + No provisioning profile found for the selected team. + + + + Provisioning profile expired. Expiration date: %1 + + + + %1 Simulator + + + + %1 - Free Provisioning Team : %2 + + + + Yes + Oui + + + No + Non + + + Team: %1 +App ID: %2 +Expiration date: %3 + + + + iOS tool error %1 + + + + Application install on simulator failed. Simulator not running. + + + + Application launch on simulator failed. Invalid bundle path %1 + + + + Application launch on simulator failed. Simulator not running. + + + + Application install on simulator failed. %1 + + + + Cannot capture console output from %1. Error redirecting output to %2.* + + + + Cannot capture console output from %1. Install Xcode 8 or later. + + + + Application launch on simulator failed. %1 + + + + Invalid simulator response. Device Id mismatch. Device Id = %1 Response Id = %2 + + + + UDID: %1 + + + + Simulator Name + + + + Runtime + + + + Current State + + + + Simulator Operation Status + + + + %1, %2 +Operation %3 completed successfully. + + + + %1, %2 +Operation %3 failed. +UDID: %4 +Error: %5 + + + + Unknown + Inconnue + + + Done. + Fait. + + + + QtC::LanguageClient + + Error %1 + Erreur %1 + + + Incoming + Entrant + + + Outgoing + Sortant + + + Call Hierarchy + Hiérarchie d’appels + + + %1 for %2 + %1 pour %2 + + + uninitialized + non initialisé + + + initialize requested + initialisation demandée + + + initialized + initialisé + + + shutdown requested + arrêt demandé + + + shutdown + arrêt + + + error + erreur + + + Invalid parameter in "%1": +%2 + Paramètre invalide dans « %1 » : +%2 + + + Language Server "%1" Initialize Error + Erreur d’initialisation du serveur de langages « %1 » + + + Initialize error: + Error d’initialisation : + + + Initialize result is invalid. + Le résultat de l’initialisation n’est pas valide. + + + Server Info is invalid. + Les informations sur le serveur ne sont pas valides. + + + No initialize result. + Aucun résultat d’initialisation. + + + Copy to Clipboard + Copier dans le presse-papiers + + + Language Client + Fournisseur de langages + + + Symbols in Current Document + Symboles dans le document actuel + + + Symbols in Workspace + Symboles dans l’espace de travail + + + Classes and Structs in Workspace + Classes et structures dans l’espace de travail + + + Functions and Methods in Workspace + Fonctions et méthodes dans l’espace de travail + + + Cannot handle MIME type of message %1 + Impossible de traiter le type MIME du message %1 + + + Cannot send data to unstarted server %1 + Impossible d’envoyer des données au serveur non démarré %1 + + + Unexpectedly finished. Restarting in %1 seconds. + Terminé de manière inattendue. Redémarrage dans %1 secondes. + + + Unexpectedly finished. + Terminé de manière inattendue. + + + Generic StdIO Language Server + Serveur de langages StdIO générique + + + Inspect Language Clients... + Inspecter les fournisseurs de langages… + + + &Add + &Ajouter + + + &Delete + &Supprimer + + + General + Général + + + Always On + Toujours activé + + + Requires an Open File + Nécessite un fichier ouvert + + + Start Server per Project + Démarrer un serveur par projet + + + Name: + Nom : + + + Language: + Langage : + + + Set MIME Types... + Régler les types MIME… + + + File pattern + Motif de fichier + + + List of file patterns. +Example: *.cpp%1*.h + Liste des motifs de fichier. +Exemple : *.cpp%1*.h + + + Startup behavior: + Comportement au lancement : + + + Initialization options: + Options d’initialisation : + + + Failed to parse JSON at %1: %2 + Échec de l’analyse JSON à %1 : %2 + + + Language server-specific JSON to pass via "initializationOptions" field of "initialize" request. + JSON spécifique au serveur à transmettre via le champ « initializationOptions » de la requête « initialize ». + + + Select MIME Types + Sélectionner les types MIME + + + Filter + Filtrer + + + Executable: + Exécutable : + + + Arguments: + Arguments : + + + JSON Error + Erreur JSON + + + Search Again to update results and re-enable Replace + Rechercher à nouveau pour mettre à jour les résultats et réactiver la fonction Remplacer + + + Re&name %n files + + Renommer le fichier + Renommer %n fichiers + + + + Files: +%1 + Fichiers : +%1 + + + Find References with %1 for: + Trouver les références avec %1 pour : + + + Renaming is not supported with %1 + Le renommage n’est pas pris en charge avec %1 + + + %1 is not reachable anymore. + %1 n’est plus accessible. + + + Show available quick fixes + Afficher les corrections rapides disponibles + + + Restart %1 + Relancer %1 + + + Inspect Language Clients + Inspecter les fournisseurs de langages + + + Manage... + Gérer… + + + Matches all symbols from the current document, based on a language server. + Correspond à tous les symboles du document actuel, sur la base d’un serveur de langages. + + + Expand All + Tout développer + + + Capabilities: + Capacités : + + + Dynamic Capabilities: + Capacités dynamiques : + + + Method: + Méthode : + + + Options: + Options : + + + Server Capabilities + Capacités du serveur + + + Client Message + Message du fournisseur + + + Messages + Messages + + + Server Message + Message du serveur + + + Log File + Réaliser un log du fichier + + + Language Client Inspector + Inspecteur du fournisseur de langages + + + Log + Journal + + + Capabilities + Capacités + + + Clear + Effacer + + + + QtC::LanguageServerProtocol + + Cannot decode content with "%1". Falling back to "%2". + Impossible de décoder le contenu de « %1 ». Retour à « %2 ». + + + Expected an integer in "%1", but got "%2". + Un entier était attendu dans « %1 », mais « %2 » a été obtenu. + + + Could not parse JSON message "%1". + Impossible d’analyser le message JSON « %1 ». + + + Expected a JSON object, but got a JSON "%1" value. + Un objet JSON était attendu, mais une valeur JSON « %1 » a été obtenue. + + + No parameters in "%1". + Aucun paramètre dans « %1 ». + + + No ID set in "%1". + Aucun identifiant n’est défini dans « %1 ». + + + + QtC::Macros + + Preferences + Préférences + + + Name + Nom + + + Description + Description + + + Shortcut + Raccourci + + + Remove + Supprimer + + + Macro + Macro + + + Description: + Description : + + + Save Macro + Enregistrer la macro + + + Name: + Nom : + + + Macros + Macros + + + Playing Macro + Lancer une macro + + + An error occurred while replaying the macro, execution stopped. + Une erreur est apparue lors de l’exécution de la macro, exécution arrêtée. + + + Stop Recording Macro + Arrêter d’enregistrer la macro + + + Record Macro + Enregistrer une macro + + + Text Editing &Macros + &Macros d’édition de texte + + + Ctrl+[ + Ctrl+[ + + + Alt+[ + Alt+[ + + + Ctrl+] + Ctrl+] + + + Alt+] + Alt+] + + + Play Last Macro + Lancer la dernière macro + + + Alt+R + Alt+R + + + Meta+R + Meta+R + + + Save Last Macro + Enregistrer la dernière macro + + + Macro mode. Type "%1" to stop recording and "%2" to play the macro. + Mode macro. Taper « %1 » pour arrêter l’enregistrement et « %2 » pour le lancer. + + + Text Editing Macros + Macros d’édition de texte + + + Runs a text editing macro that was recorded with Tools > Text Editing Macros > Record Macro. + Exécute une macro d’édition de texte qui a été enregistrée avec Outils > Macros d’édition de texte > Enregistrer une macro. + + + + QtC::Marketplace + + Marketplace + Marketplace + + + Search in Marketplace... + Rechercher dans le Marketplace… + + + <p>Could not fetch data from Qt Marketplace.</p><p>Try with your browser instead: <a href='https://marketplace.qt.io'>https://marketplace.qt.io</a></p><br/><p><small><i>Error: %1</i></small></p> + <p>Impossible d’accéder aux données depuis Qt Marketplace.</p><p>Essayer plutôt avec votre navigateur : <a href='https://marketplace.qt.io'>https://marketplace.qt.io</a></p><br/><p><small><i>Erreur : %1</i></small></p> + + + + QtC::McuSupport + + MCU Dependencies + + + + Paths to 3rd party dependencies + + + + The MCU dependencies setting value is invalid. + + + + CMake variable %1 not defined. + + + + CMake variable %1: path %2 does not exist. + + + + Warning for target %1: invalid toolchain path (%2). Update the toolchain in Edit > Preferences > Kits. + + + + Warning for target %1: missing CMake toolchain file expected at %2. + + + + Warning for target %1: missing QulGenerators expected at %2. + + + + Kit for %1 created. + + + + Error registering Kit for %1. + + + + Path %1 exists, but does not contain %2. + + + + Path %1 does not exist. Add the path in Edit > Preferences > Devices > MCU. + + + + Missing %1. Add the path in Edit > Preferences > Devices > MCU. + + + + No CMake tool was detected. Add a CMake tool in Edit > Preferences > Kits > CMake. + + + + or + + + + Path %1 exists. + + + + Path %1 exists. Version %2 was found. + + + + Path %1 is valid, %2 was found. + + + + but only version %1 is supported + + + + but only versions %1 are supported + + + + Path %1 is valid, %2 was found, %3. + + + + Path %1 does not exist. + + + + Path is empty. + + + + Path is empty, %1 not found. + + + + Path %1 exists, but version %2 could not be detected. + + + + Download from "%1" + + + + Board SDK for MIMXRT1050-EVK + + + + Board SDK MIMXRT1060-EVK + + + + Board SDK for MIMXRT1060-EVK + + + + Board SDK for MIMXRT1064-EVK + + + + Board SDK for MIMXRT1170-EVK + + + + Board SDK for STM32F469I-Discovery + + + + Board SDK for STM32F769I-Discovery + + + + Board SDK for STM32H750B-Discovery + + + + Board SDK + + + + Flexible Software Package for Renesas RA MCU Family + + + + Graphics Driver for Traveo II Cluster Series + + + + Renesas Graphics Library + + + + Cypress Auto Flash Utility + + + + MCUXpresso IDE + + + + Path to SEGGER J-Link + + + + Path to Renesas Flash Programmer + + + + STM32CubeProgrammer + + + + Green Hills Compiler for ARM + + + + IAR ARM Compiler + + + + Green Hills Compiler + + + + GNU Arm Embedded Toolchain + + + + GNU Toolchain + + + + MSVC Toolchain + + + + FreeRTOS SDK for MIMXRT1050-EVK + + + + FreeRTOS SDK for MIMXRT1064-EVK + + + + FreeRTOS SDK for MIMXRT1170-EVK + + + + FreeRTOS SDK for EK-RA6M3G + + + + FreeRTOS SDK for STM32F769I-Discovery + + + + Path to project for Renesas e2 Studio + + + + Arm GDB at %1 + + + + MCU Device + + + + Qt for MCUs Demos + + + + Qt for MCUs Examples + + + + Replace Existing Kits + + + + Create New Kits + + + + Qt for MCUs + + + + New version of Qt for MCUs detected. Upgrade existing kits? + + + + Qt for MCUs SDK + + + + Targets supported by the %1 + + + + Requirements + + + + Automatically create kits for all available targets on start + + + + Create a Kit + + + + Create Kit + + + + Update Kit + + + + No valid kit descriptions found at %1. + + + + A kit for the selected target and SDK version already exists. + + + + Kits for a different SDK version exist. + + + + A kit for the selected target can be created. + + + + Provide the package paths in order to create a kit for your target. + + + + No CMake tool was detected. Add a CMake tool in the <a href="cmake">CMake options</a> and press Apply. + + + + Warning + Avertissement + + + Unable to apply changes in Devices > MCU. + + + + No target selected. + + + + Invalid paths present for target +%1 + + + + MCU + + + + Qt for MCUs: %1 + + + + Create Kits for Qt for MCUs? To do it later, select Edit > Preferences > Devices > MCU. + + + + Create Kits for Qt for MCUs + + + + New version of Qt for MCUs detected. Upgrade existing Kits? + + + + Create new kits + + + + Replace existing kits + + + + Proceed + Continuer + + + Detected %n uninstalled MCU target(s). Remove corresponding kits? + + + + + + + Keep + + + + Remove + Supprimer + + + Flash and run CMake parameters: + + + + MSVC Binary directory + + + + GCC Toolchain + + + + Parsing error: the type entry in JSON kit files must be a string, defaulting to "path" + + + + Parsing error: the type entry "%2" in JSON kit files is not supported, defaulting to "path" + + + + Qt for MCUs SDK version %1 detected, only supported by Qt Creator version %2. This version of Qt Creator requires Qt for MCUs %3 or greater. + + + + Skipped %1. Unsupported version "%2". + + + + Detected version "%1", only supported by Qt Creator %2. + + + + Unsupported version "%1". + + + + Skipped %1. %2 Qt for MCUs version >= %3 required. + + + + Error creating kit for target %1, package %2: %3 + + + + Warning creating kit for target %1, package %2: %3 + + + + the toolchain.id JSON entry is empty + + + + the given toolchain "%1" is not supported + + + + the toolchain.compiler.cmakeVar JSON entry is empty + + + + the toolchain.file.cmakeVar JSON entry is empty + + + + Toolchain is invalid because %2 in file "%3". + + + + Toolchain description for "%1" is invalid because %2 in file "%3". + + + + + QtC::Mercurial + + General Information + Informations générales + + + Repository: + Dépôt : + + + Branch: + Branche : + + + Commit Information + Informations de commit + + + Author: + Auteur : + + + Email: + Courriel : + + + Configuration + Configuration + + + Command: + Commande : + + + User + Utilisateur + + + Username to use by default on commit. + Nom d’utilisateur à utiliser par défaut lors des commits. + + + Default username: + Nom d’utilisateur par défaut : + + + Email to use by default on commit. + Courriel à utiliser par défaut lors des commit. + + + Default email: + Courriel par défaut : + + + Miscellaneous + Divers + + + Revert + Rétablir + + + Specify a revision other than the default? + Spécifier une révision différente de celle par défaut ? + + + Revision: + Révision : + + + Default Location + Emplacement par défaut + + + Local filesystem: + Système local de fichier : + + + Specify URL: + Spécifier l’URL : + + + For example: 'https://[user[:pass]@]host[:port]/[path]'. + Par exemple : « https://[utilisateur[:motdepasse]@]hôte[:port]/[chemin] ». + + + Prompt for credentials + Invite des certifications + + + Commit Editor + Faire un commit de l’éditeur + + + Unable to find parent revisions of %1 in %2: %3 + Impossible de trouver la révision parente de %1 dans %2 : %3 + + + Cannot parse output: %1 + Impossible d’analyser la sortie : %1 + + + Mercurial Diff + + + + Mercurial Diff "%1" + + + + Hg incoming %1 + Hg incoming %1 + + + Hg outgoing %1 + Hg outgoing %1 + + + Mercurial + Mercurial + + + Me&rcurial + Me&rcurial + + + Triggers a Mercurial version control operation. + Déclenche une opération du gestionnaire de versions Mercurial. + + + Annotate Current File + Annoter le fichier actuel + + + Annotate "%1" + Annoter « %1 » + + + Diff Current File + Réaliser un diff du fichier actuel + + + Diff "%1" + Réaliser un diff de « %1 » + + + Meta+H,Meta+D + Meta+H, Meta+D + + + Alt+G,Alt+D + Alt+G, Alt+D + + + Log Current File + Réaliser un log du fichier actuel + + + Log "%1" + Réaliser un log de « %1 » + + + Meta+H,Meta+L + Meta+H, Meta+L + + + Alt+G,Alt+L + Alt+G,Alt+L + + + Status Current File + État du fichier actuel + + + Status "%1" + État « %1 » + + + Meta+H,Meta+S + Meta+H, Meta+S + + + Alt+G,Alt+S + Alt+G,Alt+S + + + Add + Ajouter + + + Add "%1" + Ajouter « %1 » + + + Delete... + Supprimer… + + + Delete "%1"... + Supprimer « %1 »… + + + Revert Current File... + Rétablir le fichier actuel… + + + Revert "%1"... + Rétablir « %1 »… + + + Diff + Diff + + + Log + Log + + + Revert... + Rétablir… + + + Status + État + + + Pull... + Pull… + + + Push... + Push… + + + Update... + Mise à jour… + + + Import... + Importation… + + + Incoming... + Entrant… + + + Outgoing... + Sortant… + + + Commit... + Commit… + + + Meta+H,Meta+C + Meta+H, Meta+C + + + Alt+G,Alt+C + Alt+G,Alt+C + + + Create Repository... + Créer un dépôt… + + + Pull Source + Rapatrier la source + + + Push Destination + Envoyer la destination + + + Update + Mettre à jour + + + Incoming Source + Source entrante + + + There are no changes to commit. + Il n’y a aucun changement à envoyer. + + + Unable to create an editor for the commit. + Impossible d’ouvrir un éditeur pour le commit. + + + Commit changes for "%1". + Soumettre les changements pour « %1 ». + + + Mercurial Command + Commande Mercurial + + + Username: + Nom d’utilisateur : + + + Password: + Mot de passe : + + + &Annotate %1 + &Annoter %1 + + + Annotate &parent revision %1 + Annoter la révision &parent %1 + + + + QtC::MesonProjectManager + + Key + Clé + + + Value + Valeur + + + Configure + Configurer + + + Build + Compiler + + + Build "%1" + Compiler « %1 » + + + Meson + Meson + + + Apply Configuration Changes + Appliquer les changements de configuration + + + Wipe Project + Projet d’effacement + + + Wipes build directory and reconfigures using previous command line options. +Useful if build directory is corrupted or when rebuilding with a newer version of Meson. + Efface le répertoire de compilation et reconfigure en utilisant les options de la ligne de commande précédentes. +Utile si le répertoire de compilation est corrompu ou lors d’une recompilation avec une version plus récente de Meson. + + + Parameters + Paramètres + + + Meson build: Parsing failed + Compilation Meson : échec de l’analyse + + + Running %1 in %2. + Exécute %1 dans %2. + + + Configuring "%1". + Configuration de « %1 ». + + + Executable does not exist: %1 + L’exécutable n’existe pas : %1 + + + Command is not executable: %1 + La commande n’est pas exécutable : %1 + + + No Meson tool set. + Aucun outil Meson n’est défini. + + + No Ninja tool set. + Aucun outil Ninja n’est défini. + + + No compilers set in kit. + Pas d’ensemble de compilation dans le kit. + + + Meson Tool + Outils Meson + + + The Meson tool to use when building a project with Meson.<br>This setting is ignored when using other build systems. + Les outils Meson à utiliser lors de la compilation d’un projet avec Meson.<br>Ce paramètre est ignoré lors de l’utilisation d’autres systèmes de compilation. + + + Cannot validate this meson executable. + Impossible de valider l’exécutable Meson. + + + Unconfigured + Non configuré + + + Build + MesonProjectManager::MesonBuildStepConfigWidget display name. + Compiler + + + Tool arguments: + Arguments de l’outil : + + + Targets: + Cibles : + + + Meson Build + Compilation Meson + + + Ninja Tool + Outils Ninja + + + The Ninja tool to use when building a project with Meson.<br>This setting is ignored when using other build systems. + Les outils Ninja à utiliser lors de la compilation d’un projet avec Meson.<br>Ce paramètre est ignoré lors de l’utilisation d’autres systèmes de compilation. + + + Cannot validate this Ninja executable. + Impossible de valider l’exécutable Ninja. + + + Ninja + Ninja + + + Autorun Meson + Exécution automatique de Meson + + + Automatically run Meson when needed. + Exécuter automatiquement Meson lorsque c’est nécessaire. + + + Ninja verbose mode + Mode verbeux de Ninja + + + Enables verbose mode by default when invoking Ninja. + Active le mode verbeux par défaut lors de l’invocation de Ninja. + + + General + Général + + + Name: + Nom : + + + Path: + Chemin : + + + Name + Nom + + + Location + Emplacement + + + New Meson or Ninja tool + Nouveaux outils Meson ou Ninja + + + Tools + Outils + + + Add + Ajouter + + + Clone + Cloner + + + Remove + Supprimer + + + Make Default + Rendre par défaut + + + Set as the default Meson executable to use when creating a new kit or when no value is set. + Définit l’exécutable Meson par défaut à utiliser lors de la création d’un nouveau kit ou si aucune valeur n’est définie. + + + Version: %1 + Version : %1 + + + Clone of %1 + Clone de %1 + + + Meson executable path does not exist. + Le chemin d’accès à l’exécutable Meson n’existe pas. + + + Meson executable path is not a file. + Le chemin d’accès à l’exécutable Meson n’est pas un fichier. + + + Meson executable path is not executable. + Le chemin d’accès à l’exécutable Meson n’est pas exécutable. + + + Cannot get tool version. + Impossible d’obtenir la version de l’outil. + + + + QtC::ModelEditor + + &Remove + &Retirer + + + &Delete + &Supprimer + + + Export Diagram... + Exporter le diagramme… + + + Export Selected Elements... + Exporter les éléments sélectionnés… + + + Open Parent Diagram + Ouvrir le diagramme parent + + + Add Package + Ajouter un paquet + + + Add Component + Ajouter un composant + + + Add Class + Ajouter une classe + + + Add Canvas Diagram + Ajouter un diagramme de canevas + + + Synchronize Browser and Diagram + Synchroniser le navigateur et le diagramme + + + Press && Hold for Options + Appuyer et maintenir pour les options + + + Edit Element Properties + Modifier les propriétés de l’élément + + + Shift+Return + Maj+Entrée + + + Edit Item on Diagram + Modifier les éléments sur le diagramme + + + Return + Entrée + + + Update Include Dependencies + Mise à jour des dépendances d’inclusion + + + Select Custom Configuration Folder + Sélectionner le dossier de configuration personnalisé + + + Config path: + Chemin de la configuration : + + + <font color=red>Model file must be reloaded.</font> + <font color=red>Le fichier de modèle doit être rechargé.</font> + + + No model loaded. Cannot save. + + + + Could not open "%1" for reading: %2. + + + + <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Open a diagram</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Double-click on diagram in model tree</div><div style="margin-top: 5px">&bull; Select "Open Diagram" from package's context menu in model tree</div></td></tr></table></div></body></html> + + + + Synchronize Structure with Diagram + + + + Synchronize Diagram with Structure + + + + Keep Synchronized + + + + Images (*.png *.jpeg *.jpg *.tif *.tiff);;PDF (*.pdf) + + + + ;;SVG (*.svg) + ;;SVG (*.svg) + + + Export Selected Elements + + + + Export Diagram + + + + Exporting Selected Elements Failed + + + + Exporting the selected elements of the current diagram into file<br>"%1"<br>failed. + + + + Exporting Diagram Failed + + + + Exporting the diagram into file<br>"%1"<br>failed. + + + + Zoom: %1% + + + + New %1 + Nouveau %1 + + + Package + Paquet + + + New Package + + + + Component + + + + New Component + + + + Class + Classe + + + New Class + + + + Item + + + + New Item + + + + Annotation + + + + Boundary + + + + Swimlane + + + + Open Diagram + + + + Add Component %1 + + + + Add Class %1 + + + + Add Package %1 + + + + Add Package and Diagram %1 + + + + Add Component Model + + + + Create Component Model + + + + Drop Node + + + + + QtC::Nim + + Nim + + + + Nim + SnippetProvider + Nim + + + General + Général + + + Debug + + + + Release + Release + + + Nimble Build + + + + Nimble Test + + + + Nimble Task + + + + Task arguments: + + + + Tasks: + + + + Nimble task %1 not found. + + + + Nim build step + + + + None + Aucune + + + Target: + Cible : + + + Default arguments: + + + + Extra arguments: + Arguments supplémentaires : + + + Command: + Commande : + + + Nim Compiler Build Step + + + + Working directory: + Répertoire de travail : + + + Build directory "%1" does not exist. + + + + Failed to delete the cache directory. + + + + Failed to delete the out file. + + + + Clean step completed successfully. + + + + Nim Clean Step + + + + No Nim compiler set. + + + + Nim compiler does not exist. + + + + Current Build Target + + + + &Compiler path: + + + + &Compiler version: + + + + Code Style + Style de code + + + Path: + Chemin : + + + Global + Settings + + + + Tools + + + + + QtC::PerfProfiler + + Samples + Échantillons + + + Function + Fonction + + + Source + Source + + + Binary + Binaire + + + Allocations + Allocations + + + observed + observées + + + guessed + déduites + + + Releases + + + + Peak Usage + Utilisation maximale + + + Various + Divers + + + Event Type + Type d’évènement + + + Counter + Compteur + + + Operation + Opération + + + Result + Résultat + + + Use Trace Points + Utiliser des points de traçage + + + Add Event + Ajouter un évènement + + + Remove Event + Supprimer un évènement + + + Reset + Réinitialiser + + + Replace events with trace points read from the device? + Remplacer les évènements avec des points de traçage lus depuis le périphérique ? + + + Cannot List Trace Points + Impossible de lister les points de traçage + + + "perf probe -l" failed to start. Is perf installed? + « perf probe -l » n’a pas pu démarrer. Perf est-il installé ? + + + No Trace Points Found + Aucun point de traçage n’a été trouvé + + + Trace points can be defined with "perf probe -a". + Des points de traçage peuvent être définis avec « perf probe -a ». + + + Perf Data Parser Failed + Échec de l’analyseur des données Perf + + + The Perf data parser failed to process all the samples. Your trace is incomplete. The exit code was %1. + L’analyseur des données Perf n’a pas réussi à traiter tous les échantillons. Votre trace est incomplète. Le code de sortie était %1. + + + perfparser failed to start. + perfparser n’a pas démarré. + + + Could not start the perfparser utility program. Make sure a working Perf parser is available at the location given by the PERFPROFILER_PARSER_FILEPATH environment variable. + Impossible de démarrer le programme utilitaire perfparser. Assurez-vous qu’un analyseur Perf fonctionnel est disponible à l’emplacement indiqué par la variable d’environnement PERFPROFILER_PARSER_FILEPATH. + + + Perf Data Parser Crashed + L’analyseur des données Perf a planté + + + This is a bug. Please report it. + Il s’agit d’un bogue. Veuillez le signaler. + + + Skipping Processing Delay + Saut du délai de traitement + + + Cancel this to ignore the processing delay and immediately start recording. + Annuler cela pour ignorer le délai de traitement et commencer immédiatement l’enregistrement. + + + Cancel this to ignore the processing delay and immediately stop recording. + Annuler cela pour ignorer le délai de traitement et arrêter immédiatement l’enregistrement. + + + Cannot Send Data to Perf Data Parser + Impossible d’envoyer des données à l’analyseur des données Perf + + + The Perf data parser does not accept further input. Your trace is incomplete. + L’analyseur des données Perf n’accepte pas d’autres données. Votre trace est incomplète. + + + Load Perf Trace + Charger une trace de perf + + + &Trace file: + Fichier de &traçage : + + + &Browse... + &Parcourir… + + + Directory of &executable: + Répertoire de l’&exécutable : + + + B&rowse... + &Parcourir… + + + Kit: + Kit : + + + Choose Perf Trace + Sélectionner une trace de perf + + + Perf traces (*%1) + Traces de perf (*%1) + + + Choose Directory of Executable + Sélectionner un répertoire ou un exécutable + + + CPU Usage + Utilisation du CPU + + + [unknown] + [inconnu] + + + Perf Process Failed to Start + Le processus perf n’a pas pu démarrer + + + Make sure that you are running a recent Linux kernel and that the "perf" utility is available. + Assurez-vous que vous utilisez un noyau Linux récent et que l’utilitaire « perf » est disponible. + + + Failed to transfer Perf data to perfparser. + Échec du transfert des données Perf à perfparser. + + + Address + Adresse + + + Source Location + Emplacement de la source + + + Binary Location + Emplacement du binaire + + + Caller + Appeleur + + + Callee + Appelé + + + Occurrences + Occurrences + + + Occurrences in Percent + Occurrences en pourcent + + + Recursion in Percent + Récursion en pourcent + + + Samples in Percent + Échantillons en pourcent + + + Self Samples + + + + Self in Percent + + + + Performance Analyzer Options + Options de l’analyseur de performance + + + Load perf.data File + Charger un fichier perf.data + + + Load Trace File + Charger un fichier de trace + + + Save Trace File + Enregistrer un fichier de trace + + + Limit to Range Selected in Timeline + Limiter à la plage sélectionnée dans la ligne du temps + + + Show Full Range + Afficher la plage complète + + + Create Memory Trace Points + Créer des points de trace de mémoire + + + Create trace points for memory profiling on the target device. + Créer des points de trace pour le profilage de la mémoire sur le dispositif cible. + + + Performance Analyzer + Analyseur de performance + + + Finds performance bottlenecks. + Identifie les goulets d’étranglement en matière de performances. + + + Timeline + Ligne du temps + + + Statistics + Statistiques + + + Flame Graph + Flame Graph + + + Discard data. + Abandonner les données. + + + Limit to Selected Range + Limiter à la plage sélectionnée + + + Reset Zoom + Réinitialiser le zoom + + + Copy Table + Copier le tableau + + + Copy Row + Copier la ligne + + + Reset Flame Graph + Réinitialiser le Flame Graph + + + No Data Loaded + Aucune donnée chargée + + + The profiler did not produce any samples. Make sure that you are running a recent Linux kernel and that the "perf" utility is available and generates useful call graphs. +You might find further explanations in the Application Output view. + Le profileur n’a produit aucun échantillon. Assurez-vous que vous utilisez un noyau Linux récent et que l’utilitaire « perf » est disponible et génère des graphiques d’appels utiles. +Vous pouvez trouver des explications supplémentaires dans la vue « Sortie de l’application ». + + + A performance analysis is still in progress. + Une analyse des performances est toujours en cours. + + + Start a performance analysis. + Démarrer une analyse des performances. + + + Enable All + Tout activer + + + Disable All + Tout désactiver + + + Trace File (*.ptq) + Fichier de trace (*.ptq) + + + Show all addresses. + Afficher toutes les adresses. + + + Aggregate by functions. + Agréger par fonctions. + + + Stop collecting profile data. + Arrêter la collecte des données de profilage. + + + Collect profile data. + Collecte des données de profilage. + + + Recorded: %1.%2s + Enregistré : %1.%2s + + + Processing delay: %1.%2s + Délai de traitement : %1.%2s + + + Invalid data format. The trace file's identification string is "%1". An acceptable trace file should have "%2". You cannot read trace files generated with older versions of %3. + + + + Invalid data format. The trace file was written with data stream version %1. We can read at most version %2. Please use a newer version of Qt. + + + + Failed to reset temporary trace file. + + + + Failed to flush temporary trace file. + + + + Cannot re-open temporary trace file. + + + + Read past end from temporary trace file. + + + + Thread started + + + + Thread ended + + + + Samples lost + + + + Context switch + + + + Invalid + Invalide + + + Failed to replay Perf events from stash file. + + + + Loading Trace Data + + + + Saving Trace Data + + + + Performance Analyzer Settings + Paramètre de l’analyseur de performance + + + Sample period: + Période d’échantillons : + + + Stack snapshot size (kB): + + + + Sample mode: + Mode d’échantillons : + + + frequency (Hz) + fréquence (Hz) + + + event count + comptage d’évènements + + + Call graph mode: + + + + dwarf + « dwarf » + + + frame pointer + pointeur de trames + + + last branch record + dernier enregistrement de branche + + + Additional arguments: + Arguments supplémentaires : + + + sample collected + échantillons collectés + + + Details + Détails + + + Timestamp + Horodatage + + + Guessed + Supposé + + + %n frames + %n trames + + + + + + + System + Système + + + Name + Nom + + + Resource Usage + Utilisation des ressources + + + Resource Change + Modification des ressources + + + thread started + thread démarré + + + thread ended + thread terminé + + + lost sample + échantillon perdu + + + context switch + changement de contexte + + + Duration + Durée + + + (guessed from context) + (supposé à partir du contexte) + + + Total Samples + Échantillons totaux + + + Total Unique Samples + Échantillons totaux uniques + + + Resource Peak + Pic de ressources + + + Resource Guesses + Suppositions de ressources + + + Run the following script as root to create trace points? + Exécutez le script suivant en tant que root pour créer des points de trace ? + + + Elevate privileges using: + Élever les privilèges en utilisant : + + + Error: No device available for active target. + Erreur : aucun périphérique n’est disponible pour la cible active. + + + Error: Failed to load trace point script %1: %2. + Erreur : échec du chargement du script des points de trace %1 : %2. + + + Executing script... + Exécution du script… + + + Failed to run trace point script: %1 + Échec de l’exécution du script des points de trace : %1 + + + Failed to create trace points. + Échec de la création des points de trace. + + + Created trace points for: %1 + Points de trace créés pour : %1 @@ -8884,8 +34067,7 @@ dans votre fichier .pro. Numéro du changement - Change Number: - ? + Change number: Numéro du changement : @@ -8896,10 +34078,6 @@ dans votre fichier .pro. Submit Envoyer - - Cancel - Annuler - Change %1: %2 Modification %1 : %2 @@ -8910,11 +34088,11 @@ dans votre fichier .pro. Edit - Éditer + Modifier Edit "%1" - Éditer "%1" + Modifier « %1 » Alt+P,Alt+E @@ -8922,7 +34100,7 @@ dans votre fichier .pro. Edit File - Éditer le fichier + Modifier le fichier Add @@ -8930,7 +34108,7 @@ dans votre fichier .pro. Add "%1" - Ajouter "%1" + Ajouter « %1 » Alt+P,Alt+A @@ -8940,14 +34118,6 @@ dans votre fichier .pro. Add File Ajouter le fichier - - Delete - Supprimer - - - Delete "%1" - Supprimer "%1" - Delete File Supprimer le fichier @@ -8958,7 +34128,7 @@ dans votre fichier .pro. Revert "%1" - Rétablir "%1" + Rétablir « %1 » Alt+P,Alt+R @@ -8970,19 +34140,19 @@ dans votre fichier .pro. Diff Current File - Faire un diff du fichier courant + Faire un diff du fichier actuel Diff "%1" - Faire un diff de "%1" + Faire un diff de « %1 » Diff Current Project/Session - Diff du projet courant/de la session courante + Diff du projet actuel/de la session actuelle Diff Project "%1" - Diff du projet "%1" + Faire un diff du projet « %1 » Alt+P,Alt+D @@ -9010,39 +34180,35 @@ dans votre fichier .pro. Pending Changes... - Changements en attente... - - - Update Current Project/Session - Mettre à jour le projet ou la session courante + Changements en attente… Update Project "%1" - Mettre à jour le projet "%1" + Mettre à jour le projet « %1 » Describe... - Décrire... + Décrire… Annotate Current File - Annoter le fichier courant + Annoter le fichier actuel Annotate "%1" - Annoter "%1" + Annoter « %1 » Annotate... - Annoter... + Annoter… Filelog Current File - Journal du fichier courant + Journal du fichier actuel Filelog "%1" - Journal du fichier "%1" + Journal du fichier « %1 » Alt+P,Alt+F @@ -9050,12 +34216,16 @@ dans votre fichier .pro. Filelog... - Journal... + Journal… Update All Tout mettre à jour + + Triggers a Perforce version control operation. + Déclenche une opération du gestionnaire de versions Perforce. + Meta+P,Meta+F Meta+P, Meta+F @@ -9074,7 +34244,7 @@ dans votre fichier .pro. Delete "%1"... - Supprimer "%1"… + Supprimer « %1 »… Meta+P,Meta+R @@ -9090,11 +34260,11 @@ dans votre fichier .pro. Log Project "%1" - Réaliser un log du projet "%1" + Réaliser un log du projet « %1 » Submit Project "%1" - Soumettre le projet "%1" + Soumettre le projet « %1 » Meta+P,Meta+S @@ -9102,7 +34272,7 @@ dans votre fichier .pro. Update Current Project - Mettre à jour le projet courant + Mettre à jour le projet actuel Revert Unchanged @@ -9110,7 +34280,7 @@ dans votre fichier .pro. Revert Unchanged Files of Project "%1" - Restaurer les fichiers non altérés du projet "%1" + Restaurer les fichiers non altérés du projet « %1 » Revert Project @@ -9118,7 +34288,7 @@ dans votre fichier .pro. Revert Project "%1" - Restaurer le projet "%1" + Restaurer le projet « %1 » Meta+P,Meta+O @@ -9129,16 +34299,16 @@ dans votre fichier .pro. Log du dépôt - Diff Selected Files - Faire un diff sur tous les fichiers sélectionnés + p4 changelists %1 + - &Undo - Annu&ler + Could not start perforce "%1". Please check your settings in the preferences. + Impossible de démarrer perforce « %1 ». Veuillez vérifier les réglages dans les préférences. - &Redo - &Refaire + Perforce did not respond within timeout limit (%1 s). + Perforce n’a pas répondu dans le temps imparti (%1 ms). p4 revert @@ -9146,31 +34316,27 @@ dans votre fichier .pro. The file has been changed. Do you want to revert it? - Le fichier a été modifié. Voulez-vous le restaurer ? + Le fichier a été modifié. Voulez-vous le restaurer ? Do you want to revert all changes to the project "%1"? - Souhaitez-vous annuler toutes les modifications sur le projet "%1" ? + Souhaitez-vous annuler toutes les modifications sur le projet « %1 » ? Another submit is currently executed. - Un autre envoi est en cours d'exécution. - - - Cannot create temporary file. - Impossible de créer un fichier temporaire. + Un autre envoi est en cours d’exécution. Project has no files - Le projet n'a pas de fichiers + Le projet n’a pas de fichiers p4 annotate - Anotation p4 + Annotation p4 p4 annotate %1 - Anotation p4 %1 + Annotation p4 %1 p4 filelog @@ -9180,10 +34346,6 @@ dans votre fichier .pro. p4 filelog %1 Journal p4 %1 - - The commit message check failed. Do you want to submit this change list? - La vérification du message de commit a échoué. Voulez-vous soumettre cette liste de changements ? - p4 submit failed: %1 Échec de la soumission p4 : %1 @@ -9191,15 +34353,15 @@ dans votre fichier .pro. Error running "where" on %1: %2 Failed to run p4 "where" to resolve a Perforce file name to a local file system name. - Erreur lors de l'exécution de "where" sur %1 : %2 + Erreur lors de l’exécution de « where » sur %1 : %2 The file is not mapped File is not managed by Perforce - Ce fichier n'est pas "mappé" ? + Ce fichier n’est pas "mappé" ? pierre: oups bien vu j'avais traduit le commentaire ! :D nouvelle suggestion... francis : voila une nouvelle suggestion :) - Le fichier n'est pas référencé + Le fichier n’est pas référencé Perforce repository: %1 @@ -9209,39 +34371,24 @@ francis : voila une nouvelle suggestion :) Perforce: Unable to determine the repository: %1 Perforce : impossible de déterminer le dépôt : %1 - - Executing: %1 - - Exécution : %1 - - The process terminated with exit code %1. - Le processus s'est terminé avec le code de sortie %1. + Le processus s’est terminé avec le code de sortie %1. The process terminated abnormally. - Le processus s'est terminé de façon anormale. - - - Diff &Selected Files - Faire un diff sur tous les fichiers &sélectionnés - - - Could not start perforce '%1'. Please check your settings in the preferences. - Impossible de démarrer perfoce "%1". Veuillez vérifier les réglages dans les préférences. - - - Perforce did not respond within timeout limit (%1 ms). - Perforce n'a pas répondu dans le temps imparti (%1 ms). - - - Unable to write input data to process %1: %2 - Impossible d'écrire des données entrantes dans le processus %1 : %2 + Le processus s’est terminé de façon anormale. Perforce is not correctly configured. - Perforce n'est pas configuré correctement. + Perforce n’est pas configuré correctement. + + + [Only %n MB of output shown] + + [Seulement un Mo de la sortie affichée] + [Seulement %n Mo de la sortie affichée] + p4 diff %1 @@ -9251,90 +34398,18 @@ francis : voila une nouvelle suggestion :) p4 describe %1 p4 describe %1 - - Closing p4 Editor - Ferme l'éditeur p4 - - - Do you want to submit this change list? - Voulez-vous soumettre cette liste de changement ? - - - The commit message check failed. Do you want to submit this change list - La vérification du message de commit a échoué. Voulez-vous soumettre cette liste de changement - - - Cannot open temporary file. - Impossible d'ouvrir le fichier temporaire. - - - Cannot execute p4 submit. - Impossible d'exécuter "p4 submit". - - - p4 submit failed (exit code %1). - Échec de "p4 submit" (code de retour %1). - Pending change Changement restant Could not submit the change, because your workspace was out of date. Created a pending submit instead. - Impossible de soumettre le changement, votre workspace n'est pas à jour. Un submit en attente a été créé à la place. - - - Invalid configuration: %1 - Configuration invalide : %1 - - - Timeout waiting for "where" (%1). - Temps limite dépassé lors de l'attente de "where" (%1). - - - Error running "where" on %1: The file is not mapped - Erreur d'exécution de "where" sur %1 : le fichier n'est pas mappé + Impossible de soumettre le changement, votre espace de travail n’est pas à jour. Un submit en attente a été créé à la place. Perforce Submit Perforce Submit - - Perforce Prompt - Prompt Perforce - - - OK - OK - - - Prompt to submit - Invite lors du submit - - - P4 Command: - Commande p4 : - - - Use default P4 environment variables - Utiliser les variables d'environnement par défaut pour P4 - - - Environment variables - Variables d'environnement - - - P4 Client: - Client P4 : - - - P4 User: - Utilisateur P4 : - - - P4 Port: - Port P4 : - Test Test @@ -9353,7 +34428,7 @@ francis : voila une nouvelle suggestion :) Environment Variables - Variables d'environnement + Variables d’environnement P4 client: @@ -9373,23 +34448,19 @@ francis : voila une nouvelle suggestion :) Timeout: - Timeout : + Délai d’attente : s s - - Prompt on submit - Invite lors du submit - Log count: - Nombre d'entrées de log : + Nombre d’entrées de log : Automatically open files when editing - Ouvrir automatiquement les fichiers lors de l'édition + Ouvrir automatiquement les fichiers lors de l’édition Perforce Command @@ -9397,16 +34468,12 @@ francis : voila une nouvelle suggestion :) Testing... - En test... + En test… Test succeeded (%1). Test réussi (%1). - - Test succeeded. - Test réussi. - Change: Modification : @@ -9419,159 +34486,161 @@ francis : voila une nouvelle suggestion :) User: Utilisateur : - - - QtC::ExtensionSystem - The plugin '%1' is specified twice for testing. - Le plugin "%1' est spécifié deux fois pour les tests. + No executable specified + Aucun exécutable spécifié - The plugin '%1' does not exist. - Le plug-in "%1' n"existe pas. + "%1" timed out after %2 ms. + « %1 » arrivé à échéance après %2 ms. - Unknown option %1 - Option "%1" non reconnue + Unable to launch "%1": %2 + Impossible de lancer « %1 » : %2 - The option %1 requires an argument. - L'option %1 requiert un argument. + "%1" crashed. + « %1 » a planté. - Failed Plugins - Plug-ins défectueux + "%1" terminated with exit code %2: %3 + « %1 » terminé avec le code %2 : %3 - '%1' misses attribute '%2' - L'attribute '%1' est manquant pour "%2" + The client does not seem to contain any mapped files. + Le client ne semble contenir aucun fichier correspondant. - '%1' has invalid format - "%1" a un format invalide + Unable to determine the client root. + Unable to determine root of the p4 client installation + Impossible de déterminer la racine du client. - Invalid element '%1' - Élément invalide "%1" + The repository "%1" does not exist. + Le dépôt « %1 » n’existe pas. - Unexpected closing element '%1' - Élément fermant inattendu "%1" + Annotate change list "%1" + Annoter la liste des changements « %1 » - Unexpected token - Lexème inattendu + Ignore Whitespace + Ignorer les espaces - Expected element '%1' as top level element - L'élément "%1" devrait être un élément racine + &Edit + &Édition - Resolving dependencies failed because state != Read - La résolution des dépendances a échoué car l'état courant est différent de "Lecture" - - - Loading the library failed because state != Resolved - Le chargement de la bibliothèque a échoué car l'état courant est différent de "Résolu" - - - Initializing the plugin failed because state != Loaded - L'initialisation de l'extension a échoué car l'état courant est différent de "Chargé" - - - Cannot perform extensionsInitialized because state != Initialized - Impossible d'exécuter extensionsInitialized car l'état est différent de "Initialisé" - - - Could not resolve dependency '%1(%2)' - Impossible de résoudre la dépendance "%1(%2)" - - - Plugin is not valid (does not derive from IPlugin) - L'extension n'est pas valide (elle n'est pas une sous-classe de IPlugin) - - - Internal error: have no plugin instance to initialize - Erreur interne : pas d'instance de l'extension à initialiser - - - Plugin initialization failed: %1 - L'initialisation de l'extension a échoué: %1 - - - Internal error: have no plugin instance to perform extensionsInitialized - Erreur interne: aucune instance de l'extention sur laquelle exécuter extensionsInitialized - - - Internal error: have no plugin instance to perform delayedInitialize - Erreur interne : aucune instance de l'extention sur laquelle exécuter delayedInitialized + &Hijack + &Hijack QtC::ProjectExplorer - <font color="#0000ff">Starting: %1 %2</font> - - <font color="#0000ff">Lancement : %1 %2</font> + Unable to Add Dependency + Impossible d’ajouter une dépendance - <font color="#0000ff">Exited with code %1.</font> - <font color="#0000ff">Terminé avec le code de sortie %1.</font> + This would create a circular dependency. + Ceci créerait une dépendance circulaire. - <font color="#ff0000"><b>Exited with code %1.</b></font> - <font color="#0000ff"><b>Terminé avec le code de sortie %1.</b></font> + Synchronize configuration + Synchroniser la configuration - <font color="#ff0000">Could not start process %1 </b></font> - <font color="#ff0000">Impossible de lancer le processus %1 </b></font> + Synchronize active kit, build, and deploy configuration between projects. + Synchroniser la configuration du kit actif, de la compilation au déploiement entre les projets. - <font color="#0000ff">Starting: "%1" %2</font> - - <font color="#0000ff">Lancement : %1 %2</font> + Override %1: + Écraser %1 : - <font color="#0000ff">The process "%1" exited normally.</font> - <font color="#0000ff">Le processus %1 s'est .terminé normalement.</font> + Make arguments: + Arguments de Make : - <font color="#ff0000"><b>The process "%1" exited with code %2.</b></font> - <font color="#ff0000"><b>Le processus "%1" s'est terminé avec le code de sortie %2.</b></font> + Parallel jobs: + Jobs en parallèle : - <font color="#ff0000"><b>The process "%1" crashed.</b></font> - <font color="#ff0000"><b>Le processus "%1" a crashé </b></font> + Override MAKEFLAGS + Écraser MAKEFLAGS - <font color="#ff0000"><b>Could not start process "%1"</b></font> - <font color="#ff0000"><b>Impossible de lancer le processus "%1" </b></font> + <code>MAKEFLAGS</code> specifies parallel jobs. Check "%1" to override. + <code>MAKEFLAGS</code> spécifie les jobs parallèles. Cocher « %1 » pour l’ignorer. - Starting: "%1" %2 - - Commence : "%1" %2 - + Disable in subdirectories: + Désactiver dans les sous-répertoires : + + + Runs this step only for a top-level build. + Exécute cette étape uniquement pour une compilation de niveau supérieur. + + + Targets: + Cibles : + + + Make: + Make : + + + Make + Make + + + Make command missing. Specify Make command in step configuration. + Commande Make manquante. Indiquer la commande Make dans la configuration des étapes. + + + <b>Make:</b> %1 + <b>Make :</b> %1 + + + <b>Make:</b> No build configuration. + <b>Make :</b> pas de configuration de compilation. + + + <b>Make:</b> %1 not found in the environment. + <b>Make :</b> %1 non trouvé dans l’environnement. + + + Configuration is faulty. Check the Issues view for details. + La configuration est défectueuse, veuillez vérifier la vue des problèmes pour les détails. + + + Could not create directory "%1" + Impossible de créer le répertoire « %1 » Starting: "%1" %2 - Débute : "%1" %2 + Débute : « %1 » %2 + + + The build step was ended forcefully. + L’étape de compilation a été clôturée avec force. The process "%1" exited normally. - Le processus "%1" s'est terminé normalement. + Le processus « %1 » s’est terminé normalement. The process "%1" exited with code %2. - Le processus "%1" s'est terminé avec le code %2. + Le processus « %1 » s’est terminé avec le code %2. The process "%1" crashed. - Le processus "%1" a crashé. + Le processus « %1 » a planté. - Could not start process "%1" %2 - Impossible de démarrer le processus "%1" %2 + Could not start process "%1" %2. + Impossible de démarrer le processus « %1 » %2. Finished %1 of %n steps @@ -9581,6 +34650,18 @@ francis : voila une nouvelle suggestion :) Étape %1 sur %n terminée + + Stop Applications + Arrêter les applications + + + Stop these applications before building? + Arrêter ces applications avant de compiler ? + + + The build device failed to prepare for the build of %1 (%2). + Le dispositif de compilation n’a pas réussi à se préparer pour la compilation de %1 (%2). + Compile Category for compiler issues listed under 'Issues' @@ -9597,8 +34678,12 @@ francis : voila une nouvelle suggestion :) Déploiement - Elapsed time: %1. - Temps écoulé : %1. + The kit %1 has configuration issues which might be the root cause for this problem. + Le kit %1 présente des problèmes de configuration qui pourraient être à l’origine de ce problème. + + + When executing step "%1" + Lors de l’exécution de l’étape « %1 » Build/Deployment canceled @@ -9608,29 +34693,38 @@ francis : voila une nouvelle suggestion :) Canceled build/deployment. Compilation/Déploiement annulé. + + Autotests + Category for autotest issues listed under 'Issues' + Autotests + Error while building/deploying project %1 (kit: %2) Erreur lors de la compilation/déploiement du projet %1 (kit : %2) - - Error while building/deploying project %1 (target: %2) - Erreur lors de la compilation/déploiement du projet %1 (cible : %2) - - - When executing step '%1' - Lors de l'exécution de l'étape "%1" - Running steps for project %1... - Exécution des étapes pour le projet %1... + Exécution des étapes pour le projet %1… Skipping disabled step %1. - Ignore l'étape désactivée %1. + Ignore l’étape désactivée %1. - &Edit - &Édition + Edit... + Modifier… + + + Choose Directory + Sélectionner un répertoire + + + Variable already exists. + La variable existe déjà. + + + Ed&it + &Modifier &Add @@ -9642,11 +34736,27 @@ francis : voila une nouvelle suggestion :) &Unset - &RàZ + Rà&Z + + + Append Path... + Suffixer le chemin… + + + Prepend Path... + Préfixer le chemin… &Batch Edit... - Éditer le &batch... + Modifier par &lots… + + + Open &Terminal + Ouvrir un &terminal + + + Open a terminal with this environment set up. + Ouvrir un terminal avec cet environnement configuré. Unset <a href="%1"><b>%1</b></a> @@ -9654,64 +34764,53 @@ francis : voila une nouvelle suggestion :) Set <a href="%1"><b>%1</b></a> to <b>%2</b> - <a href="%1"><b>%1</b></a> définit à <b>%2</b> + <a href="%1"><b>%1</b></a> défini à <b>%2</b> + + + Append <b>%2</b> to <a href="%1"><b>%1</b></a> + Ajouter <b>%2</b> à la suite de <a href="%1"><b>%1</b></a> + + + Prepend <b>%2</b> to <a href="%1"><b>%1</b></a> + Ajouter <b>%2</b> avant <a href="%1"><b>%1</b></a> + + + Set <a href="%1"><b>%1</b></a> to <b>%2</b> [disabled] + <a href="%1"><b>%1</b></a> défini à <b>%2</b> (désactivé) Use <b>%1</b> %1 is "System Environment" or some such. Utiliser <b>%1</b> + + <b>No environment changes</b> + <b>Aucune modification de l’environnement</b> + Use <b>%1</b> and Yup, word puzzle. The Set/Unset phrases above are appended to this. %1 is "System Environment" or some such. Utiliser <b>%1</b> et - - Unset <b>%1</b> - text included in the summary - <b>%1</b> remis à zéro - - - Set <b>%1</b> to <b>%2</b> - <b>%1</b> définit à <b>%2</b> - - - Using <b>%1</b> - utilisation de <b>%1</b> - - - Using <b>%1</b> and - Utilisation de <b>%1</b> et - - - Summary: No changes to Environment - Résumé : l'environnement n'est pas modifié - - - Files in any project - Fichiers dans n'importe quel projet - Files in Any Project - Fichiers dans n'importe quel projet + Fichiers dans n’importe quel projet + + + Matches all files of all open projects. Append "+<number>" or ":<number>" to jump to the given line number. Append another "+<number>" or ":<number>" to jump to the column number as well. + Correspond à tous les fichiers de tous les projets ouverts. Ajouter « +<numéro> » ou « :<numéro> » à la suite pour passer au numéro de ligne donné. Ajouter un autre « +<numéro> » ou « :<numéro> » à la suite pour passer également au numéro de colonne. All Projects: - tous les projets : + Tous les projets : Filter: %1 -%2 - Filtre : %1 -%2 - - - Fi&le pattern: - Pat&ron de fichier : - - - &Clone Selected - &Cloner la version sélectionnée +Excluding: %2 +%3 + Filtrer : %1 +En excluant : %2 +%3 No build settings available @@ -9719,7 +34818,7 @@ francis : voila une nouvelle suggestion :) Edit build configuration: - Éditer la configuration de compilation : + Modifier la configuration de compilation : Add @@ -9729,38 +34828,36 @@ francis : voila une nouvelle suggestion :) Remove Supprimer - - Remove Build Configuration - Supprimer la configuration de la compilation - - - Do you really want to delete the build configuration <b>%1</b>? - Voulez-vous vraiment supprimer la configuration de la compilation <b>%1</b> ? - Rename... - Renommer... + Renommer… New name for build configuration <b>%1</b>: - Nouveau nom pour la configuration de la compilation <b>%1</b> : + Nouveau nom pour la configuration de la compilation <b>%1</b> : Clone Configuration - Title of a the cloned BuildConfiguration window, text of the window + Title of a the cloned BuildConfiguration window, text of the window +---------- +Title of a the cloned RunConfiguration window, text of the window Configuration du clone New configuration name: Nom de la nouvelle configuration : + + Clone... + Cloner… + New Configuration Nouvelle configuration Cancel Build && Remove Build Configuration - Annuler la compilation && supprimer la configuration de compilation + Annuler la compilation et supprimer la configuration de compilation Do Not Remove @@ -9768,7 +34865,7 @@ francis : voila une nouvelle suggestion :) Remove Build Configuration %1? - Supprimer la configuration de compilation %1 ? + Supprimer la configuration de compilation %1 ? The build configuration <b>%1</b> is currently being built. @@ -9776,23 +34873,27 @@ francis : voila une nouvelle suggestion :) Do you want to cancel the build process and remove the Build Configuration anyway? - Voulez-vous annuler la compilation et supprimer la configuration de compilation ? + Voulez-vous annuler la compilation et supprimer la configuration de compilation ? Remove Build Configuration? - Supprimer la configuration de compilation ? + Supprimer la configuration de compilation ? Do you really want to delete build configuration <b>%1</b>? - Voulez-vous vraiment supprimer la configuration de compilation <b>%1</b> ? + Voulez-vous vraiment supprimer la configuration de compilation <b>%1</b> ? - Build Steps - Étapes de compilation + Show Compile &Output + Afficher la &sortie de compilation - Clean Steps - Étapes de nettoyage + Show the output that generated this issue in Compile Output. + Affiche la sortie qui a généré le problème dans la sortie de compilation. + + + Open Compile Output when building + Ouvrir la sortie de compilation lors de la compilation Compile Output @@ -9800,53 +34901,45 @@ francis : voila une nouvelle suggestion :) Files in Current Project - Fichiers dans le projet courant + Fichiers dans le projet actuel + + + Matches all files from the current document's project. Append "+<number>" or ":<number>" to jump to the given line number. Append another "+<number>" or ":<number>" to jump to the column number as well. + Correspond à tous les fichiers du projet du document actuel. Ajouter « +<numéro> » ou « :<numéro> » pour passer au numéro de ligne donné. Ajouter un autre « +<numéro> » ou « :<numéro> » pour passer également au numéro de colonne. + + + Project "%1" + Projet « %1 » Current Project - lower character at the beginning because this is indented after "Rechercher dans..." - projet courant + Projet actuel - Project '%1': - Projet '%1' : - - - Editor settings: - Paramètres de l'éditeur : - - - Global - féminin ? - Global + Project "%1": + Projet « %1 » : Restore Global ? Restaurer les valeurs globales - - - QtC::Core - File System - Système de fichier + Display Settings + Paramètres de l’affichage - Meta+Y - Meta+Y + Display right &margin at column: + Afficher une &marge à la colonne : - Alt+Y - Alt+Y + Use context-specific margin + Utiliser une marge spécifique à l’aide contextuelle - Filter Files - Fichiers de filtre + If available, use a different margin. For example, the ColumnLimit from the ClangFormat plugin. + Si possible, utilisez une marge différente. Par exemple, la marge ColumnLimit du greffon ClangFormat. - - - QtC::ProjectExplorer Session Manager Gestionnaire de session @@ -9871,28 +34964,17 @@ francis : voila une nouvelle suggestion :) &Open &Ouvrir - - New session name - Nom de la nouvelle session - - - Rename session - Renommer la session - - - Automatically restore the last session when Qt Creator is started. - Restaurer automatiquement la dernière session quand Qt Creator est démarré. - Restore last session on startup Restaurer la dernière session au démarrage - What is a Session? - Qu'est-ce qu'une session ? + <a href="qthelp://org.qt-project.qtcreator/doc/creator-project-managing-sessions.html">What is a Session?</a> + <a href="qthelp://org.qt-project.qtcreator/doc/creator-project-managing-sessions.html">Qu’est-ce qu’une session ?</a> Custom Process Step + Default ProcessStep display name Étape personnalisée @@ -9911,85 +34993,65 @@ francis : voila une nouvelle suggestion :) General Général - - Project File Factory - ProjectExplorer::ProjectFileFactory display name. - Fabrique de fichiers de projets - - - Could not open the following project: '%1' - Impossible d'ouvrir le projet "%1" - All Projects - tous les projets + Tous les projets <Implicitly Add> <Ajouter Implicitement> - - The files are implicitly added to the projects: - - Les fichiers sont implicitement ajoutés aux projets : - - The files are implicitly added to the projects: Les fichiers sont implicitement ajoutés aux projets : <None> - No project selected <aucun> Open project anyway? - Ouvrir le projet quand même ? + Ouvrir le projet quand même ? Version Control Failure - Échec du contrôle de version - - - Failed to add subproject '%1' -to project '%2'. - Impossible d'ajouter le sous-projet '%1' -au projet '%2'. - - - Failed to add one or more files to project -'%1' (%2). - Impossible d'ajouter un ou plusieurs fichier au projet -'%1' (%2). - - - A version control system repository could not be created in '%1'. - impossible de créer un dépot de système de gestion de version dans "%1". - - - Failed to add '%1' to the version control system. - Échec de l'ajout de "%1" au système de gestion de version. - - - Simplify tree - Simplifier l'arbre - - - Hide generated files - Cacher les fichiers générés + Échec du gestionnaire de versions Simplify Tree - Simplifier l'arbre + Simplifier l’arbre Hide Generated Files Cacher les fichiers générés + + Hide Disabled Files + Cacher les fichiers désactivés + + + Focus Document in Project Tree + Mettre le focus sur le document dans l’arborescence du projet + + + Meta+Shift+L + Meta+Maj+L + + + Alt+Shift+L + Alt+Maj+L + + + Hide Empty Directories + Cacher les répertoires vides + + + Hide Source and Header Groups + Cacher les groupes de sources et d’en-têtes + Synchronize with Editor - Synchroniser avec l'éditeur + Synchroniser avec l’éditeur Projects @@ -10005,15 +35067,7 @@ au projet '%2'. Filter Tree - Filtrer l'arbre - - - Filter tree - Filtrer l'arbre - - - Add to &VCS (%1) - Ajouter à &SGV (%1) + Filtrer l’arbre Summary @@ -10027,6 +35081,14 @@ au projet '%2'. Add to &project: &Ajouter au projet : + + A version control system repository could not be created in "%1". + Un dépôt de système de gestion de versions n’a pas pu être créé dans « %1 ». + + + Failed to add "%1" to the version control system. + Échec de l’ajout de « %1 » au système de gestion de versions. + Files to be added: Fichiers à ajouter : @@ -10037,7 +35099,37 @@ au projet '%2'. Run Settings - Paramètres d'exécution + Paramètres d’exécution + + + Variables in the run environment. + Variables de l’environnement d’exécution. + + + The run configuration's working directory. + Le répertoire de travail de la configuration d’exécution. + + + The run configuration's name. + Le nom de la configuration d’exécution. + + + The run configuration's executable. + L’exécutable de la configuration d’exécution. + + + No build system active + Aucun système de compilation n’est actif + + + Run on %{Device:Name} + Shown in Run configuration if no executable is given, %1 is device name + Exécuter sur %{Device:Name} + + + %1 (on %{Device:Name}) + Shown in Run configuration, Add menu: "name of runnable (on device name)" + %1 (sur %{Device:Name}) Deployment @@ -10049,27 +35141,27 @@ au projet '%2'. Run configuration: - Configuration d'exécution : + Configuration d’exécution : Remove Run Configuration? - Supprimer la configuration d'exécution ? + Supprimer la configuration d’exécution ? Do you really want to delete the run configuration <b>%1</b>? - Êtes vous sûr de vouloir supprimer la configuration d'exécution <b>%1</b> ? + Êtes-vous sûr(e) de vouloir supprimer la configuration d’exécution <b>%1</b> ? New name for run configuration <b>%1</b>: - Nouveau nom pour la configuration d'exécution <b>%1</b> : + Nouveau nom pour la configuration d’exécution <b>%1</b> : Cancel Build && Remove Deploy Configuration - Annuler la compilation && supprimer le configuration de déploiement + Annuler la compilation et supprimer le configuration de déploiement Remove Deploy Configuration %1? - Supprimer la configuration de déploiement %1 ? + Supprimer la configuration de déploiement %1 ? The deploy configuration <b>%1</b> is currently being built. @@ -10077,19 +35169,19 @@ au projet '%2'. Do you want to cancel the build process and remove the Deploy Configuration anyway? - Voulez-vous annuler le processus de compilation et supprimer la configuration de déploiement ? + Voulez-vous annuler le processus de compilation et supprimer la configuration de déploiement ? Remove Deploy Configuration? - Supprimer la configuration de déploiement ? + Supprimer la configuration de déploiement ? Do you really want to delete deploy configuration <b>%1</b>? - Voulez-vous vraiment supprimer la configuration de déploiement <b>%1</b> ? + Voulez-vous vraiment supprimer la configuration de déploiement <b>%1</b> ? New name for deploy configuration <b>%1</b>: - Nouveau nom pour la configuration de déploiement <b>%1</b> : + Nouveau nom pour la configuration de déploiement <b>%1</b> : File not found: %1 @@ -10103,57 +35195,13 @@ au projet '%2'. Filter by categories Filtrer par catégories - - &Copy - Cop&ier - Show Warnings Afficher les avertissements - - The process could not be started! - Le processus n'a pas pû être démarré ! - - - Cannot retrieve debugging output! - Impossible d'obtenir la sortie de débogage ! - - - The process could not be started: %1 - Le processus n'a pas pu être démarré : %1 - - - Project management - Gestion du projet - - - &Add to Project - &Ajouer au projet - - - &Project - &Projet - - - Add to &version control - Ajouter au gestionnaire de &version - - - The following files will be added: - - - - - Les fichiers suivants seronts ajoutés : - - - - - Add to &version control: - Ajouter au gestionnaire de &version : + Ajouter au gestionnaire de &versions : Project Management @@ -10175,41 +35223,21 @@ au projet '%2'. Open With Ouvrir avec - - Session Manager... - Gestionnaire de session... - New Project... - Nouveau projet... - - - Ctrl+Shift+N - Ctrl+Shift+N + Nouveau projet… Load Project... - Charger le projet... + Charger le projet… Ctrl+Shift+O - Ctrl+Shift+O + Ctrl+Maj+O Open File - Ouvrir un fichier - - - Show in Explorer... - Afficher dans l'explorateur de fichier... - - - Show in Finder... - Afficher dans Finder... - - - Show containing folder... - Afficher le dossier parent... + Ouvrir le fichier Close Project @@ -10217,31 +35245,11 @@ au projet '%2'. Close Project "%1" - Fermer le projet "%1" - - - Close All Projects - Fermer tous les projets - - - Set Build Configuration - Définir la configuration de compilation - - - Build All - Tout compiler + Fermer le projet « %1 » Ctrl+Shift+B - Ctrl+Shift+B - - - Rebuild All - Tout recompiler - - - Clean All - Tout nettoyer + Ctrl+Maj+B Build Project @@ -10249,7 +35257,7 @@ au projet '%2'. Build Project "%1" - Compiler le projet "%1" + Compiler le projet « %1 » Ctrl+B @@ -10259,26 +35267,10 @@ au projet '%2'. Rebuild Project Recompiler le projet - - Rebuild Project "%1" - Recompiler le projet "%1" - - - Publish Project... - Publier le projet... - - - Publish Project "%1"... - Publier le projet "%1"... - Clean Project Nettoyer le projet - - Clean Project "%1" - Nettoyer le projet "%1" - Build Without Dependencies Compiler sans les dépendances @@ -10309,20 +35301,11 @@ au projet '%2'. Collapse All - Réduire tout - - - Quick Switch Target Selector - Bon, celle là est à vérifier deux fois ; gbdivers : aucune idée non plus; Pierre: pff, ils rajoutent de ces trucs bizarre dans Creator... Allez, Banco ! - Interchangeur rapide de cible - - - Failed to open project - Échec d'ouverture du projet + Tout réduire Cancel Build && Unload - Annuler la compilation && fermer + Annuler la compilation et fermer Do Not Unload @@ -10330,7 +35313,7 @@ au projet '%2'. Unload Project %1? - Fermer le projet %1 ? + Fermer le projet %1 ? The project %1 is currently being built. @@ -10338,52 +35321,20 @@ au projet '%2'. Do you want to cancel the build process and unload the project anyway? - Voulez-vous annuler le processus de compilation et fermer le projet ? - - - No active project - Pas de projet actif - - - The project '%1' has no active target - Le projet "%1" n'a pas de cible active - - - The target '%1' for project '%2' has no active run configuration - La cible "%1" du projet "%2" n'a pas de configuration de lancement active - - - Cannot run '%1' in mode '%2'. - Impossible de lancer "%1" dans le mode "%2". + Voulez-vous annuler le processus de compilation et fermer le projet ? A build is still in progress. - Une compilation est toujours en cours. - - - Set Run Configuration - Définir la configuration d'exécution + Une compilation est toujours en cours. Recent P&rojects P&rojets récents - - Recent Sessions - Sessions récentes - - - Deploy All - Tout déployer - Deploy Project Déployer le projet - - Deploy Project "%1" - Déployer le projet "%1" - Deploy Without Dependencies Déployer sans les dépendances @@ -10392,59 +35343,31 @@ au projet '%2'. Cancel Build Annuler la compilation - - Start Debugging - Commencer le débogage - - - F5 - F5 - Add New... - Ajouter nouveau... + Ajouter un nouveau… Add Existing Files... - Ajouter des fichiers existants... + Ajouter des fichiers existants… New Subproject... - Nouveau sous-projet... - - - Remove File... - Supprimer fichier... + Nouveau sous-projet… Remove Project... Remove project from parent profile (Project explorer view); will not physically delete any files. - Supprimer le projet... + Supprimer le projet… Delete File... - Effacer le fichier... - - - Set as Startup Project - Définir en tant que projet de démarrage - - - Open Build/Run Target Selector... - Ouvrir le sélecteur de cible de compilation/exécution... + Effacer le fichier… Ctrl+T Ctrl+T - - Full path of the current project's main file, including file name. - Chemin complet du fichier principal du projet actuel, dont le nom de fichier. - - - Full path of the current project's main file, excluding file name. - Chemin complet du fichier principal du projet actuel, sans le nom de fichier. - Load Project Charger un projet @@ -10454,15 +35377,11 @@ au projet '%2'. Title of dialog Nouveau projet - - Ignore all errors? - Ignorer toutes les erreurs ? - Found some build errors in current task. Do you want to ignore them? - Erreurs de compilation trouvées dans la tâche courante. -Souhaitez-vous les ignorer ? + Erreurs de compilation trouvées dans la tâche actuelle. +Souhaitez-vous les ignorer ? Always save files before build @@ -10472,125 +35391,193 @@ Souhaitez-vous les ignorer ? Close All Projects and Editors Fermer tous les projets et éditeurs + + Project Environment + Environnement du projet + + + C++ + C++ + + + Open... + Ouvrir… + + + S&essions + S&essions + + + &Manage... + &Gérer… + + + Close Pro&ject "%1" + Fermer le pro&jet « %1 » + + + Close All Files in Project + Fermer tous les fichiers du projet + + + Close All Files in Project "%1" + Fermer tous les fichiers du projet « %1 » + + + Close Pro&ject + Fermer le pro&jet + + + Build All Projects + Compiler tous les projets + + + Build All Projects for All Configurations + Compiler tous les projets pour toutes les configurations + + + Deploy All Projects + Déployer tous les projets + Rebuild Recompiler + + Rebuild All Projects + Recompiler tous les projets + + + Rebuild All Projects for All Configurations + Recompiler tous les projets pour toutes les configurations + + + Clean All Projects + Nettoyer tous les projets + + + Clean All Projects for All Configurations + Nettoyer tous les projets pour toutes les configurations + + + Build Project for All Configurations + Compiler le projet pour toutes les configurations + + + Build Project "%1" for All Configurations + Compiler le projet « %1 » pour toutes les configurations + + + Build for &Run Configuration + Compiler pour la configuration d’&exécution + + + Build for &Run Configuration "%1" + Compiler pour la configuration d’exécution « %1 » + + + Run Generator + Générateur d’exécution + + + Rebuild Project for All Configurations + Recompiler le projet pour toutes les configurations + + + Clean Project for All Configurations + Nettoyer le projet pour toutes les configurations + + + Meta+Backspace + Meta+Retour arrière + + + Alt+Backspace + Alt+Retour arrière + + + Add Existing Projects... + Ajouter les projets existants… + + + Add Existing Directory... + Ajouter les répertoires existants… + + + Close All Files + Fermer tous les fichiers + + + Close Other Projects + Fermer les autres projets + + + Close All Projects Except "%1" + Fermer tous les projets sauf « %1 » + + + Properties... + Propriétés… + + + Remove... + Supprimer… + + + Duplicate File... + Dupliquer le fichier… + Set "%1" as Active Project - Définir "%1" comme projet actif + Définir « %1 » comme le projet actif + + + Expand + Développer + + + Expand All + Tout développer Open Build and Run Kit Selector... - Ouvrir le sélecteur de kit de compilation et d'exécution... + Ouvrir le sélecteur de kit de compilation et d’exécution… Quick Switch Kit Selector Sélecteur rapide de kit - - Current project's main file - Fichier principal du projet courant - - - Full build path of the current project's active build configuration. - Lourd :( >> was "configuration de compilation active" - Chemin complet de génération indiqué dans la configuration active du projet courant. - - - The current project's name. - Nom du projet courant. - - - The currently active kit's name. - Nom du kit actif courant. - - - The currently active kit's name in a filesystem friendly version. - Nom du kit actif courant dans une version compatible avec le système de fichiers. - - - The currently active kit's id. - Identifiant du kit actif courant. - - - The currently active build configuration's name. - Nom de la configuration de compilation active courante. - - - The currently active build configuration's type. - Type de la configuration de compilation active courante. - File where current session is saved. - Fichier dans lequel est enregistré la session courante. + Fichier dans lequel est enregistré la session actuelle. Name of current session. - Nom de la session courante. - - - debug - debug - - - release - release - - - unknown - inconnu + Nom de la session actuelle. Failed to Open Project - Échec d'ouverture du projet + Échec d’ouverture du projet - Failed opening project '%1': Project already open - Échec de l'ouverture du projet "%1" : le projet est déjà ouvert - - - Unknown error - Erreur inconnue - - - Could Not Run - Impossible de démarrer + <b>Warning:</b> This file is generated. + <b>Avertissement :</b> ce fichier est généré. <b>Warning:</b> This file is outside the project directory. <b>Avertissement :</b> ce fichier est en dehors du répertoire du projet. - - Build - Build step - Compilation - - - The project %1 is not configured, skipping it. - - Le projet %1 n'est pas configuré, il sera ignoré. - - Currently building the active project. En cours de compilation du projet actif. The project %1 is not configured. - Le projet %1 n'est pas configuré. + Le projet %1 n’est pas configuré. Project has no build settings. - Le projet n'a pas de configuration de compilation. - - - No project loaded - Pas de projet chargé - - - Building '%1' is disabled: %2 - La compilation de "%1" désactivée : %2 + Le projet n’a pas de configuration de compilation. No active project. @@ -10598,53 +35585,229 @@ Souhaitez-vous les ignorer ? Could not add following files to project %1: - Impossible d'ajouter les fichiers suivants au projet %1 : + Impossible d’ajouter les fichiers suivants au projet %1 : Project Editing Failed - Échec d'édition du projet + Échec d’édition du projet + + + Current Build Environment + Environnement de compilation actuel + + + Current Run Environment + Environnement d’exécution actuel + + + Active build environment of the active project. + les messages similaires précédent n'ont pas de point final. Ce message apparait dans une boite déroulante. + Environnement de compilation actif du projet actif + + + Active run environment of the active project. + les messages similaires précédent n'ont pas de point final. Ce message apparait dans une boite déroulante. + Environnement d’exécution actif du projet actif + + + Sanitizer + Category for sanitizer issues listed under 'Issues' + Si on tient vraiment à traduire, on peut utiliser « assainissant » mais le terme « sanitizer » semble plus répandu en français + Sanitizer + + + Parse Build Output... + Analyser la sortie de compilation… + + + <h3>Project already open</h3> + <h3>Le projet est déjà ouvert</h3> + + + Failed opening project "%1": Project is not a file. + Échec de l’ouverture du projet « %1 » : le projet n’est pas un fichier. + + + Failed opening project "%1": No plugin can open project type "%2". + Échec de l’ouverture du projet « %1 » : aucun greffon ne peut ouvrir le type de projet « %2 ». + + + Ignore All Errors? + Ignorer toutes les erreurs ? + + + Run Configuration Removed + Configuration de l’exécution supprimée + + + The configuration that was supposed to run is no longer available. + La configuration qui devait être exécutée n’est plus disponible. + + + Open Project in "%1" + Ouvrir le projet dans « %1 » + + + Open Project "%1" + Ouvrir le projet « %1 » + + + The file "%1" was renamed to "%2", but the following projects could not be automatically changed: %3 + Le fichier « %1 » a été renommé en « %2 », mais les projets suivants n’ont pas pu être modifiés automatiquement : %3 + + + The following projects failed to automatically remove the file: %1 + Les projets suivants n’ont pas réussi à supprimer automatiquement le fichier : %1 + + + Building "%1" is disabled: %2<br> + La compilation de « %1 » est désactivée : %2<br> + + + A build is in progress. + Une compilation est en cours. + + + Close %1? + Fermer %1 ? + + + Do you want to cancel the build process and close %1 anyway? + Voulez-vous annuler le processus de compilation et fermer quand même %1 ? + + + The project "%1" is not configured. + Le projet « %1 » n’est pas configuré. + + + The project "%1" has no active kit. + Le projet « %1 » n’a pas de kit actif. + + + The kit "%1" for the project "%2" has no active run configuration. + Le kit « %1 » pour le projet « %2 » n’a pas de configuration d’exécution active. + + + Cannot run "%1". + Impossible d’exécuter « %1 ». + + + A run action is already scheduled for the active project. + Une action d’exécution est déjà programmée pour le projet actif. + + + %1 in %2 + %1 dans %2 + + + The following subprojects could not be added to project "%1": + Les sous-projets suivants n’ont pas pu être ajoutés au projet « %1 » : + + + Adding Subproject Failed + Échec de l’ajout du sous-projet + + + Remove More Files? + Supprimer d’autres fichiers ? + + + Remove these files as well? + %1 + Supprimer également ces fichiers ? +…%1 + + + File "%1" was not removed, because the project has changed in the meantime. +Please try again. + Le fichier « %1 » n’a pas été supprimé, car le projet a été modifié entre-temps. +Veuillez réessayer. + + + Could not remove file "%1" from project "%2". + Impossible de supprimer le fichier « %1 » du projet « %2 ». + + + _copy + _copier + + + Choose File Name + Sélectionner un nom de fichier + + + New file name: + Nouveau nom de fichier : + + + Duplicating File Failed + Échec de la duplication du fichier + + + Failed to copy file "%1" to "%2": %3. + Échec de la copie du fichier « %1 » vers « %2 » : %3. + + + Failed to add new file "%1" to the project. + Échec de l’ajout du nouveau fichier « %1 » au projet. + + + The project file %1 cannot be automatically changed. + +Rename %2 to %3 anyway? + Le fichier de projet %1 ne peut pas être modifié automatiquement. + +Renommer quand même %2 en %3 ? The file %1 was renamed to %2, but the project file %3 could not be automatically changed. Le fichier %1 a été renommé en %2, mais le fichier de projet %3 ne peut être modifié automatiquement. - The project '%1' has no active target. - Le projet '%1' n'a aucune cible active. + The file %1 could not be renamed %2. + Le fichier %1 n’a pas pu être renommé en %2. - The target '%1' for the project '%2' has no active run configuration. - La cible '%1' pour le projet '%2' n'a aucune configuration d'exécution. + Cannot Rename File + Impossible de renommer le fichier - Cannot run '%1'. - Impossible d'exécuter "%1". + Matches all files from all project directories. Append "+<number>" or ":<number>" to jump to the given line number. Append another "+<number>" or ":<number>" to jump to the column number as well. + Fait correspondre tous les fichiers de tous les répertoires du projet. Ajoutez « +<numéro> » ou « :<numéro> » pour passer au numéro de ligne donné. Ajoutez un autre « +<nombre> » ou « :<nombre> » pour passer également au numéro de colonne. + + + Run run configuration + Lancer la configuration d’exécution + + + Run a run configuration of the current active project + Lancer une configuration d’exécution du projet actif actuel + + + Switch run configuration + Échanger la configuration d’exécution + + + Switch active run configuration + Échanger la configuration d’exécution active + + + Switched run configuration to +%1 + Configuration d’exécution changée en +%1 + + + Custom Executable + Exécutable personnalisé Run %1 Exécuter %1 - Currently building the active project - Compilation du projet actif en cours - - - Project has no build settings - Le projet n'a pas de paramètres de compilation - - - Building '%1' is disabled: %2<br> - Compilation de "%1" désactivée : %2<br/> - - - A build is in progress - Une compilation est en cours - - - Building '%1' is disabled: %2 - - Compilation de "%1" désactivée : %2 - + You need to set an executable in the custom run configuration. + Vous devez définir un exécutable dans la configuration d’exécution personnalisée. Cancel Build && Close @@ -10654,26 +35817,10 @@ Souhaitez-vous les ignorer ? Do Not Close Ne pas fermer - - Close Qt Creator? - Fermer Qt Creator ? - A project is currently being built. Un projet est en cours de compilation. - - Do you want to cancel the build process and close Qt Creator anyway? - Voulez-vous annuler le processus de compilation et fermer Qt Creator ? - - - Cannot run without a project. - Impossible d'exécuter sans projet. - - - Cannot debug without a project. - Impossible de déboguer sans projet. - New File Title of dialog @@ -10688,19 +35835,9 @@ Souhaitez-vous les ignorer ? Add Existing Files Ajouter des fichiers existants - - Could not add following files to project %1: - - Impossible d'ajouter les fichiers suivants au projet %1 : - - Adding Files to Project Failed - L'ajout de fichiers au projet a échoué - - - Adding to Version Control Failed - L'ajout au système de controle de version a échoué + L’ajout de fichiers au projet a échoué Removing File Failed @@ -10708,7 +35845,7 @@ Souhaitez-vous les ignorer ? Deleting File Failed - L'effacement de fichier a échoué + L’effacement de fichier a échoué Delete File @@ -10716,81 +35853,11 @@ Souhaitez-vous les ignorer ? The project %1 is not configured, skipping it. - Le projet %1 n'est pas configuré, il sera ignoré. - - - The project '%1' has no active kit. - Le projet "%1" n'a pas de kit actif. - - - The kit '%1' for the project '%2' has no active run configuration. - Le kit "%1" du projet "%2" n'a pas de configuration de lancement active. + Le projet %1 n’est pas configuré, il sera ignoré. Delete %1 from file system? - Supprimer %1 du système de fichiers ? - - - Add files to project failed - Échec de l'ajout des fichiers au projet - - - Add to Version Control - Ajouter au gestionnaire de version - - - Add files -%1 -to version control (%2)? - Ajouter les fichiers -%1 -au système de gestion de version (%2) ? - - - Could not add following files to version control (%1) - - Impossible d'ajouter les fichiers suivant au système de gestion de version (%1) - - - - Add files to version control failed - Échec de l'ajout des fichiers au système de gestion de version - - - Projects (%1) - Projets (%1) - - - All Files (*) - Tous les fichiers (*) - - - Launching Windows Explorer failed - Échec du lancement de l'Explorer Windows - - - Could not find explorer.exe in path to launch Windows Explorer. - Impossible de trouver explorer.exe dans le path pour lancer l'Explorer Windows. - - - Launching a file explorer failed - Échec du lancement du gestionnaire de fichier - - - Could not find xdg-open to launch the native file explorer. - Impossible de trouver xdg-open pour lancer un gestionnaire de fichier natif. - - - Remove file failed - Suppression du fichier échoué - - - Could not remove file %1 from project %2. - Impossible de supprimer le fichier %1 du projet %2. - - - Delete file failed - Échec de la suppression du fichier + Supprimer %1 du système de fichiers ? Could not delete file %1. @@ -10806,15 +35873,29 @@ au système de gestion de version (%2) ? Failed to restore project files - Echec de la restauration des fichiers de projet + Échec de la restauration des fichiers de projet + + + Could not save session %1 + Impossible d’enregistrer la session %1 Delete Session Supprimer la session + + Delete Sessions + Supprimer les sessions + Delete session %1? - Supprimer la session %1 ? + Supprimer la session %1 ? + + + Delete these sessions? + %1 + Supprimer ces sessions ? +…%1 Could not restore the following project files:<br><b>%1</b> @@ -10822,178 +35903,9876 @@ au système de gestion de version (%2) ? Keep projects in Session - Garder les projets dans la session + Conserver les projets dans la session Remove projects from Session Supprimer les projets de la session + + Loading Session + Chargement de la session + Session Session - Error while saving session - Erreur lors de l'enregistrement de la session + Last Modified + Dernière modification - Could not save session to file "%1" - Impossible d'enregistrer la session dans le fichier "%1" + New Session Name + Nouveau nom de session + + + &Create + &Créer + + + Create and &Open + Créer et &ouvrir + + + &Clone + &Cloner + + + Clone and &Open + Cloner et &ouvrir + + + Rename Session + Renommer la session + + + Rename and &Open + Renommer et &ouvrir + + + Error while saving session + Erreur lors de l’enregistrement de la session + + + Could not save session to file %1 + Impossible d’enregistrer la session dans le fichier %1 Untitled Sans titre - Session ('%1') - Session ("%1") + Build and Run + Compiler et exécuter + + + Use jom instead of nmake + Utiliser jom à la place de nmake + + + Projects Directory + Répertoire du projet + + + Current directory + Répertoire actuel + + + Directory + Répertoire + + + Close source files along with project + Fermer les fichiers sources en même temps que le projet + + + Save all files before build + Enregistrer tous les fichiers avant de compiler + + + Add linker library search paths to run environment + Ajouter les chemins de recherche de la bibliothèque de l’éditeur de liens à l’environnement d’exécution + + + Create suitable run configurations automatically + Créer automatiquement des configurations d’exécution adaptées + + + Clear issues list on new build + Effacer la liste des problèmes liés à la nouvelle compilation + + + Abort on error when building all projects + Abandonner en cas d’erreur lors de la compilation de tous les projets + + + Start build processes with low priority + Démarrer les processus de compilation avec une faible priorité + + + Do Not Build Anything + Ne rien compiler + + + Build the Whole Project + Compiler le projet complet + + + Build Only the Application to Be Run + Compiler uniquement l’application à exécuter + + + All + Toutes + + + Same Project + Le même projet + + + Same Build Directory + Le même répertoire de compilation + + + Same Application + La même application + + + Enabled + Activé + + + Disabled + Désactivé + + + Deduced from Project + Déduit du projet + + + Closing Projects + Fermeture des projets + + + Build before deploying: + Compiler avec le déploiement : + + + Stop applications before building: + Arrêter les applications avant la compilation : + + + Default for "Run in terminal": + Valeur par défaut pour « Exécuter dans un terminal » : + + + Always deploy project before running it + Toujours déployer le projet avant de l’exécuter + + + Always ask before stopping applications + Toujours demander avant d’arrêter des applications + + + Merge stderr and stdout + Rassembler stderr et stdout + + + Enable + Activer + + + Use Project Default + Utiliser les paramètres par défaut du projet + + + Default build directory: + Répertoire par défaut de compilation : + + + QML debugging: + Débogage QML : + + + Use qmlcachegen: + Utiliser qmlcachegen : + + + Default Build Properties + Propriétés de compilation par défaut + + + Unexpected run control state %1 when worker %2 started. + État de contrôle d’exécution inattendu %1 lorsque le worker %2 a démarré. + + + Force &Quit + Forcer à &quitter + + + &Keep Running + &Continuer l’exécution + + + Cannot retrieve debugging output. + Impossible d’obtenir la sortie du débogage. + + + Cannot run: No command given. + Exécution impossible : aucune commande n’a été donnée. + + + %1 crashed. + %1 a planté. + + + The process was ended forcefully. + Le processus a été stoppé avec force. + + + An unknown error in the process occurred. + Une erreur inconnue est survenue dans le processus. + + + Either the invoked program "%1" is missing, or you may have insufficient permissions to invoke the program. + Soit le programme invoqué « %1 » est manquant, soit vous n’avez pas les autorisations suffisantes pour invoquer le programme. + + + An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel. + Une erreur est survenue lors de la tentative d’écriture sur le processus. Par exemple, le processus peut ne pas être en cours d’exécution ou avoir fermé son canal d’entrée. + + + An error occurred when attempting to read from the process. For example, the process may not be running. + Une erreur est survenue lors de la tentative de lecture du processus. Par exemple, le processus peut ne pas être en cours d’exécution. + + + Run + Exécuter + + + No executable specified. + Aucun exécutable n’est spécifié. + + + Starting %1... + Démarrage de %1… + + + %1 exited with code %2 + %1 s’est terminé avec le code %2 + + + No project loaded. + Aucun projet chargé. + + + Use Regular Expressions + Utiliser des expressions régulières + + + Case Sensitive + Sensible à la casse + + + Show Non-matching Lines + Afficher les lignes non concordantes + + + Project Settings + Paramètres du projet + + + Import Existing Build... + Importer une compilation existante… + + + Manage Kits... + Gérer les kits… + + + Project Selector + Sélecteur de projet + + + Active Project + Projet actif + + + Build System Output + Sortie du système de compilation + + + Import Directory + Importer un répertoire + + + Location + Emplacement + + + untitled + File path suggestion for a new project. If you choose to translate it, make sure it is a valid path name without blanks and using only ascii chars. + sans_titre + + + Clean + Displayed name for a "cleaning" build step +---------- +Display name of the clean build step list. Used as part of the labels in the project window. + Nettoyer + + + Clear system environment + Nettoyer l’environnement système + + + Build Environment + Environnement de compilation + + + URI: + URI : + + + Creates a custom Qt Creator plugin. + Crée un greffon personnalisé pour Qt Creator. + + + Non-Qt Project + Projet non Qt + + + Qt Creator Plugin + Greffon Qt Creator + + + Code Snippet + Extrait de code + + + Code: + Code : + + + Type: + Type : + + + Object class-name: + Nom de classe de l’objet : + + + Plugin name: + Nom du greffon : + + + Vendor name: + Nom du vendeur : + + + Copyright: + Copyright : + + + License: + Licence : + + + This wizard creates an empty .pro file. + Cet assistant génère un fichier .pro vide. + + + Project Location + Emplacement du projet + + + Creates a qmake-based project without any files. This allows you to create an application without any default classes. + Génère un projet fondé sur qmake sans aucun fichier. Cela vous permet de créer une application sans aucune classe par défaut. + + + Empty qmake Project + Projet qmake vide + + + Use Qt Virtual Keyboard + Utiliser un clavier virtuel Qt + + + Define Project Details + Définir les détails du projet + + + Details + Détails + + + Creates a Qt Quick 2 UI project with a QML entry point. To use it, you need to have a QML runtime environment. + +Use this only if you are prototyping. You cannot create a full application with this. Consider using a Qt Quick Application project instead. + Crée un projet d’interface Qt Quick 2 avec un point d’entrée QML. Pour l’utiliser, vous devez disposer d’un environnement d’exécution QML. + +N’utilisez cette option que si vous faites du prototypage. Il ne permet pas de créer une application complète. Envisagez plutôt d’utiliser un projet Qt Quick Application. + + + Qt Quick UI Prototype + Prototype d’interface Qt Quick + + + This wizard creates a C++ library project. + L’assistant génère un projet de bibliothèque C++. + + + qmake + qmake + + + CMake + CMake + + + Qbs + Qbs + + + Meson + Meson + + + Build system: + Système de compilation : + + + Define Build System + Définir le système de compilation + + + Build System + Système de compilation + + + Specify basic information about the classes for which you want to generate skeleton source code files. + Définir les informations de base des classes pour lesquelles vous souhaitez générer des fichiers squelettes de code source. + + + Shared Library + Bibliothèque partagée + + + Statically Linked Library + Bibliothèque liée statiquement + + + Qt Plugin + Greffon Qt + + + %{JS: value('Type') === 'qtplugin' ? value('BaseClassName').slice(1) : (value('ProjectName').charAt(0).toUpperCase() + value('ProjectName').slice(1))} + %{JS: value('Type') === 'qtplugin' ? value('NomClasseParent').slice(1) : (value('NomDuProjet').charAt(0).toUpperCase() + value('NomDuProjet').slice(1))} + + + Class name: + Nom de la classe : + + + QAccessiblePlugin + QAccessiblePlugin + + + QGenericPlugin + QGenericPlugin + + + QIconEnginePlugin + QIconEnginePlugin + + + QImageIOPlugin + QImageIOPlugin + + + QScriptExtensionPlugin + QScriptExtensionPlugin + + + QSqlDriverPlugin + QSqlDriverPlugin + + + QStylePlugin + QStylePlugin + + + Base class: + Classe parent : + + + Core + Cœur + + + Gui + Interface graphique + + + Widgets + Widgets + + + Qt module: + Module Qt : + + + %{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++hdr'))} + %{JS: Cpp.classToFileName(value('Classe'), Util.preferredSuffix('text/x-c++hdr'))} + + + Header file: + Fichier d’en-tête : + + + %{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++src'))} + %{JS: Cpp.classToFileName(value('Classe'), Util.preferredSuffix('text/x-c++src'))} + + + Source file: + Fichier source : + + + Translation File + Fichier de traduction + + + Translation + Traduction + + + Creates a C++ library. This can be used to create:<ul><li>a shared C++ library for use with <tt>QPluginLoader</tt> and runtime (Plugins)</li><li>a shared or static C++ library for use with another project at linktime</li></ul> + une bibliothèque C++ partagée ou statique à utiliser avec un autre projet au moment de l’exécution (linktime) + Génère une bibliothèque C++. Cela peut être utiliser pour créer :<ul><li>une bibliothèque C++ partagée à utiliser avec <tt>QPluginLoader</tt> et le runtime (greffons)</li><li>une bibliothèque C++ partagée ou statique à utiliser avec un autre projet au moment de l’exécution (linktime)</li></ul> + + + Library + Bibliothèque + + + C++ Library + Bibliothèque C++ + + + Qt 6.2 + Qt 6.2 + + + Qt 5.15 + Qt 5.15 + + + Qt 5.14 + Qt 5.14 + + + Qt 5.13 + Qt 5.13 + + + Qt 5.12 + Qt 5.12 + + + Minimum required Qt version: + Version minimale requise de Qt : + + + MyItem + MonElement + + + com.mycompany.qmlcomponents + com.mycompany.qmlcomponents + + + Create example project + Créer un projet d’exemple + + + Custom Parameters + Paramètres personnalisés + + + Creates a C++ plugin to load Qt Quick extensions dynamically into applications using the QQmlEngine class. + Crée un greffon C++ pour charger les extensions Qt Quick dynamiquement dans les applications en utilisant la classe QQmlEngine. + + + Binary + Binaire + + + Hybrid + Hybride + + + Author: + Auteur : + + + Description: + Description : + + + 0.1.0 + 0.1.0 + + + Version: + Version : + + + MIT + MIT + + + GPL-2.0 + GPL-2.0 + + + Apache-2.0 + Apache-2.0 + + + ISC + ISC + + + GPL-3.0 + GPL-3.0 + + + BSD-3-Clause + BSD-3-Clause + + + LGPL-2.1 + LGPL-2.1 + + + LGPL-3.0 + LGPL-3.0 + + + EPL-2.0 + EPL-2.0 + + + Proprietary + Propriétaire + + + Other + Autre + + + C + C + + + Cpp + Cpp + + + Objective C + Objective C + + + Javascript + Javascript + + + Backend: + Backend : + + + 1.0.0 + 1.0.0 + + + Min Nim Version: + Version minimale de Nim : + + + Define Project Configuration + Définir la configuration du projet + + + Configuration + Configuration + + + Creates a Nim application with Nimble. + Génère une application Nim avec Nimble. + + + Nimble Application + Application Nimble + + + Creates a simple C++ application with no dependencies. + Génère une simple application C++ avec aucune dépendance. + + + Plain C++ Application + Application C++ simple + + + Please configure <b>%{vcsName}</b> now. + Veuillez configurer <b>%{vcsName}</b> maintenant. + + + Repository: + Dépôt : + + + Repository URL is not valid + L’URL du dépôt n’est pas valide + + + <default branch> + <branche par défaut> + + + Branch: + Branche : + + + %{defaultDir} + %{repertoireParDefaut} + + + Directory: + Répertoire : + + + "%{JS: Util.toNativeSeparators('%{TargetPath}')}" exists in the filesystem. + « %{JS: Util.toNativeSeparators('%{CheminDeLaCible}')} » existe dans le système de fichiers. + + + Recursive + Récursif + + + Recursively initialize submodules. + Initialiser récursivement les sous-modules. + + + Specify repository URL, branch, checkout directory, and path. + Spécifiez l’URL du dépôt, la branche, le répertoire de checkout et le chemin. + + + Running Git clone... + Exécution de Git clone… + + + Checkout + Checkout + + + Clones a Git repository and tries to load the contained project. + Clone un dépôt Git et essaye de charger le projet contenu. + + + Git Clone + Git clone + + + Use existing directory + Utiliser le répertoire existant + + + Proceed with cloning the repository, even if the target directory already exists. + Procéder au clonage du dépôt, même si le répertoire cible existe déjà. + + + Stacked + Empilée + + + Make the new branch depend on the availability of the source branch. + Faire dépendre la nouvelle branche de la disponibilité de la branche source. + + + Standalone + Autonome + + + Do not use a shared repository. + Ne pas utiliser de dépôt partagé. + + + Bind new branch to source location + Lier les nouvelles branches aux emplacements des sources + + + Bind the new branch to the source location. + Lier la nouvelle branche à l’emplacement des sources. + + + Switch checkout + Basculer l’import + + + Switch the checkout in the current directory to the new branch. + Basculer l’import du répertoire actuel à la nouvelle branche. + + + Hardlink + Lien dur + + + Use hard-links in working tree. + Utiliser les liens durs dans l’arbre de travail. + + + No working-tree + Pas d’arbre de travail + + + Do not create a working tree. + Ne pas créer d’arbre de travail. + + + Revision: + Révision : + + + Specify repository URL, checkout directory, and path. + Indiquer l’URL du dépôt, son répertoire de checkout et son chemin. + + + Running Bazaar branch... + Exécution de la branche Bazaar… + + + Clones a Bazaar branch and tries to load the contained project. + Clone une branche Bazaar et essaye de charger le projet qu’elle contient. + + + Bazaar Clone (Or Branch) + Clone Bazaar (ou branche) + + + Running Mercurial clone... + Exécution du clone Mercurial… + + + Clones a Mercurial repository and tries to load the contained project. + Clone un dépôt Mercurial et essaie de charger le projet qu’il contient. + + + Mercurial Clone + Clone Mercurial + + + Trust Server Certificate + Faire confiance au certificat du serveur + + + Running Subversion checkout... + Exécution du checkout Subversion… + + + Checks out a Subversion repository and tries to load the contained project. + Importer le dépôt Subversion et essayer le charger le projet qu’il contient. + + + Subversion Checkout + Checkout Subversion + + + Module: + Module : + + + Specify module and checkout directory. + Indiquer le module et le répertoire de checkout. + + + Running CVS checkout... + Exécution du checkout CVS… + + + Checks out a CVS repository and tries to load the contained project. + Importer le dépôt CVS et essayer le charger le projet qu’il contient. + + + CVS Checkout + Checkout CVS + + + Creates a simple Nim application. + Génère une application Nim simple. + + + Nim Application + Application Nim + + + This wizard generates a Qt Widgets Application project. The application derives by default from QApplication and includes an empty widget. + Cet assistant génère un projet d’application Qt avec widgets. L’application dérive par défaut de QApplication et inclut un widget vide. + + + %{JS: value('BaseClass') ? value('BaseClass').slice(1) : 'MyClass'} + %{JS: value('ClasseParent') ? value('ClasseParent').slice(1) : 'MaClasse'} + + + Generate form + Générer le formulaire + + + %{JS: Cpp.classToFileName(value('Class'), 'ui')} + %{JS: Cpp.classToFileName(value('Classe'), 'ui')} + + + Form file: + Fichier d’interface : + + + Class Information + Information sur la classe + + + Creates a widget-based Qt application that contains a Qt Designer-based main window. + +Preselects a desktop Qt for building the application if available. + Génère une application Qt basée sur des widgets qui contient une fenêtre principale basée sur Qt Designer. + +Présélectionne un Qt optimisé pour le bureau pour la compilation de l’application, s’il est disponible. + + + Application (Qt) + Application (Qt) + + + Qt Widgets Application + Application Qt avec widgets + + + Create a project that you can open in Qt Design Studio + Créer un projet que vous pouvez ouvrir dans Qt Design Studio + + + Create a project with a structure that is compatible both with Qt Design Studio (via .qmlproject) and with Qt Creator (via CMakeLists.txt). It contains a .ui.qml form that you can visually edit in Qt Design Studio. + Génère un projet dont la structure est compatible à la fois avec Qt Design Studio (via .qmlproject) et avec Qt Creator (via CMakeLists.txt). Il contient un formulaire .ui.qml que vous pouvez modifier visuellement dans Qt Design Studio. + + + The minimum version of Qt you want to build the application for + La version minimale de Qt pour laquelle vous souhaitez créer l’application + + + Creates a Qt Quick application that contains an empty window. Optionally, you can create a Qt Design Studio project. + Génère une application Qt Quick contenant une fenêtre vide. En option, vous pouvez créer un projet Qt Design Studio. + + + Qt Quick Application + Application Qt Quick + + + Creates a simple C application with no dependencies. + Génère une simple application en C sans aucune dépendance. + + + Plain C Application + Application C simple + + + PySide version: + Version de PySide : + + + %{JS: value('BaseCB') ? value('BaseCB').slice(1) : 'MyClass'} + %{JS: value('BaseCB') ? value('BaseCB').slice(1) : 'MaClasse'} + + + %{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-python'))} + %{JS: Cpp.classToFileName(value('Classe'), Util.preferredSuffix('text/x-python'))} + + + %{JS: Util.fileName('%{ProjectName}', 'pyproject')} + %{JS: Util.fileName('%{NomDuProjet}', 'projetpy')} + + + Project file: + Fichier du projet : + + + Define Class + Définir la classe + + + Creates a Qt for Python application that includes a Qt Designer-based widget (ui file) - Requires .ui to Python conversion + Génère une application Qt pour Python qui inclut un widget fondé sur Qt Designer (fichier ui) - Nécessite une conversion .ui vers Python + + + Application (Qt for Python) + Application (Qt pour Python) + + + Window UI + Interface utilisateur de la fenêtre + + + <Custom> + <Personnalisé> + + + Creates a Qt for Python application that contains an empty window. + Génère une application Qt pour Python qui contient une fenêtre vide. + + + Empty Window + Fenêtre vide + + + PySide 6 + PySide 6 + + + PySide 5.15 + PySide 5.15 + + + PySide 5.14 + PySide 5.14 + + + PySide 5.13 + PySide 5.13 + + + PySide 5.12 + PySide 5.12 + + + Creates a Qt Quick application that contains an empty window. + Génère une application Qt Quick qui contient une fenêtre vide. + + + Qt Quick Application - Empty + Application Qt Quick - vide + + + Creates a Qt for Python application that contains only the main code for a QApplication. + Génère une application Qt pour Python qui ne contient que le code principal d’une QApplication. + + + Empty Application + Application vide + + + This wizard creates a simple Qt-based console application. + Cet assistant génère une application en console simple basée sur Qt. + + + Creates a project containing a single main.cpp file with a stub implementation. + +Preselects a desktop Qt for building the application if available. + Génère un projet contenant un seul fichier main.cpp avec un début d’implémentation. + +Présélectionne un Qt optimisé pour le bureau pour compiler l’application si disponible. + + + Qt Console Application + Application Qt en console + + + This wizard creates a simple unit test project. + Cet assistant génère un projet de test unitaire simple. + + + Qt Test + Qt Test + + + Google Test + Google Test + + + Qt Quick Test + Qt Quick Test + + + Boost Test + Boost Test + + + Catch2 + Catch2 + + + Test framework: + Cadriciel de test : + + + GUI Application + Application graphique + + + Test suite name: + Nom de la suite de tests : + + + Test case name: + Nom du cas de test : + + + Requires QApplication + QApplication est nécessaire + + + Generate setup code + Générer le code d’installation + + + Generate initialization and cleanup code + Génère le code d’initialisation et de nettoyage + + + Enable C++11 + Activer le C++11 + + + Googletest source directory (optional): + Répertoire source de Googletest (optionnel) : + + + Boost include directory (optional): + Répertoire source de Boost (optionnel) : + + + Catch2 include directory (optional): + Répertoire d’include de Catch2 (optionnel) : + + + Use Qt libraries + Utiliser les bibliothèques Qt + + + Project and Test Information + + + + Creates a new unit test project. Unit tests allow you to verify that the code is fit for use and that there are no regressions. + Génère un nouveau projet de test unitaire. Les tests unitaires permettent de vérifier que le code est utilisable et qu’il n’y a pas de régression. + + + Auto Test Project + Tester automatiquement le projet + + + Qt for Python module: + Module de Qt pour Python : + + + You can choose Qt classes only if you select a Qt for Python module. + Vous ne pouvez choisir des classes Qt que si vous sélectionnez un module Qt pour Python. + + + %{BaseCB} + %{BaseCB} + + + Import QtCore + Importer QtCore + + + Import QtWidgets + Importer QtWidgets + + + Import QtQuick + Importer QtQuick + + + %{JS: Util.fileName(value('Class'), Util.preferredSuffix('text/x-python'))} + %{JS: Util.fileName(value('Classe'), Util.preferredSuffix('text/x-python'))} + + + Creates new Python class file. + Génère un nouveau fichier de classe Python. + + + Python + Python + + + Python Class + Classe Python + + + Customize header row + Personnaliser la ligne d’en-tête + + + Items are editable + Les éléments sont modifiables + + + Rows and columns can be added + Des lignes et des colonnes peuvent être ajoutées + + + Rows and columns can be removed + Les lignes et les colonnes peuvent être supprimées + + + Fetch data dynamically + Recevoir des données de manière dynamique + + + Define Item Model Class + Définir la classe du modèle d’élément + + + Creates a Qt item model. + Crée un modèle d’élément Qt. + + + Qt + Qt + + + Qt Item Model + Modèle d’élément Qt + + + Fully qualified name, including namespaces + Nom entièrement qualifié, y compris les espaces de noms + + + Include QObject + Inclure QObject + + + Include QWidget + Inclure QWidget + + + Include QMainWindow + Inclure QMainWindow + + + Include QDeclarativeItem - Qt Quick 1 + Inclure QDeclarativeItem - Qt Quick 1 + + + Include QQuickItem - Qt Quick 2 + Inclure QQuickItem - Qt Quick 2 + + + Include QSharedData + Inclure QSharedData + + + Add Q_OBJECT + Ajouter Q_OBJECT + + + Add QML_ELEMENT + Ajouter QML_ELEMENT + + + Creates a C++ header and a source file for a new class that you can add to a C++ project. + Crée les fichier d’en-tête et de fichier source C++ pour une nouvelle classe que vous pouvez ajouter a votre projet C++. + + + C/C++ + C/C++ + + + C++ Class + Classe C++ + + + Creates a CMake-based test project for which a code snippet can be entered. + Génère un projet de test fondé sur CMake pour lequel un extrait de code peut être saisi. + + + int main(int argc, char *argv[]) +{ + return 0; +} + int main(int argc, char *argv[]) +{ + return 0; +} + + + QtCore + QtCore + + + QtCore, QtWidgets + QtCore, QtWidgets + + + Use Qt Modules: + Utiliser Qt Modules : + + + Application bundle (macOS) + Paquet d’application (macOS) + + + Define Code snippet + Définir l’extrait de code + + + Code snippet + Extrait de code + + + Creates an empty Python script file using UTF-8 charset. + Génère un fichier script Python vide en utilisant le jeu de caractères UTF-8. + + + Python File + Fichier Python + + + Creates a scratch model using a temporary file. + Génère un modèle brouillon à l’aide d’un fichier temporaire. + + + Modeling + Modélisation + + + Scratch Model + Modèle brouillon + + + Model name: + Nom du modèle : + + + Location: + Emplacement : + + + "%{JS: Util.toNativeSeparators(value('TargetPath'))}" exists in the filesystem. + « %{JS: Util.toNativeSeparators(value('CheminDeLaCible'))} » existe dans le système de fichiers. + + + Model Name and Location + Emplacement et nom du modèle + + + Creates a new empty model with an empty diagram. + Génère un nouveau modèle vide avec un diagramme vide. + + + Model + Modèle + + + Creates a scratch buffer using a temporary file. + Génère un brouillon en utilisant un fichier temporaire. + + + Scratch Buffer + Brouillon + + + State chart name: + Nom du diagramme d’état : + + + State Chart Name and Location + Nom du diagramme d’état et emplacement + + + Creates a new empty state chart. + Crée un nouveau diagramme d’état vide. + + + State Chart + Diagramme d’état + + + Creates a Qt Resource file (.qrc). + Crée une fichier de ressources Qt (.qrc). + + + Qt Resource File + Fichier de ressources Qt + + + Creates an empty Nim script file using UTF-8 charset. + Crée un fichier de script Nim vide en utilisant le jeu de caractères UTF-8. + + + Nim + Nim + + + Nim Script File + + + + Creates an empty Nim file using UTF-8 charset. + Crée un fichier Nim vide en utilisant le jeu de caractères UTF-8. + + + Nim File + Fichier Nim + + + Creates an empty file. + Crée un fichier vide. + + + Empty File + Fichier vide + + + Choose a Form Template + Sélectionner un modèle d’interface graphique + + + Form Template + Modèle d’interface graphique + + + Creates a Qt Designer form that you can add to a Qt Widget Project. This is useful if you already have an existing class for the UI business logic. + Crée un formulaire Qt Designer que l’on peut ajouter à un projet Qt Widget. Ceci est utile si vous utilisez déjà une classe pour la logique métier de l’interface. + + + Qt Designer Form + Interface graphique Qt Designer + + + Creates a source file that you can add to a C/C++ project. + Crée un fichier source que vous pouvez ajouter à un projet C/C++. + + + C/C++ Source File + Fichier source C/C++ + + + Creates a header file that you can add to a C/C++ project. + Crée un fichier d’en-tête que vous pouvez ajouter à un projet C/C++. + + + C/C++ Header File + Fichier d’en-tête C/C++ + + + Stateless library + Bibliothèque sans état + + + Options + Options + + + Creates a JavaScript file. + Crée un fichier JavaScript. + + + JS File + Fichier JS + + + Creates a vertex shader in the Desktop OpenGL Shading Language (GLSL). Vertex shaders transform the positions, normals and texture coordinates of triangles, points and lines rendered with OpenGL. + Crée un vertex shader dans le langage de shaders d’OpenGL pour le bureau (GLSL). Les vertex shaders transforment les positions, normales et coordonnées des textures des triangles, points et lignes rendues avec OpenGL. + + + GLSL + GLSL + + + Vertex Shader (Desktop OpenGL) + Vertex shader (OpenGL bureau) + + + Creates a fragment shader in the Desktop OpenGL Shading Language (GLSL). Fragment shaders generate the final pixel colors for triangles, points and lines rendered with OpenGL. + Crée un fragment shader dans le langage de shaders d’OpenGL (GLSL). Les fragment shaders génèrent la couleur finale des pixels pour les triangles, points et lignes rendues avec OpenGL. + + + Fragment Shader (Desktop OpenGL) + Fragment shader (OpenGL Bureau) + + + Creates a vertex shader in the OpenGL/ES 2.0 Shading Language (GLSL/ES). Vertex shaders transform the positions, normals and texture coordinates of triangles, points and lines rendered with OpenGL. + Crée un vertex shader dans le langage de shaders d’OpenGL/ES 2.0 (GLSL/ES). Les vertex shaders transforment les positions, normales et coordonnées des textures des triangles, points et lignes rendues avec OpenGL. + + + Vertex Shader (OpenGL/ES 2.0) + Vertex shader (OpenGL/ES 2.0) + + + Creates a fragment shader in the OpenGL/ES 2.0 Shading Language (GLSL/ES). Fragment shaders generate the final pixel colors for triangles, points and lines rendered with OpenGL. + Crée un fragment shader dans le langage de shaders d’OpenGL/ES 2.0 (GLSL/ES). Les fragment shaders génèrent la couleur finale des pixels pour les triangles, points et lignes rendues avec OpenGL. + + + Fragment Shader (OpenGL/ES 2.0) + Fragment shader (OpenGL/ES 2.0) + + + Creates a Java file with boilerplate code. + Crée un fichier Java avec du code standard. + + + Java + Java + + + Java File + Fichier Java + + + Creates a QML file with boilerplate code, starting with "import QtQuick". + Crée un fichier QML avec du code standard, commençant par « import QtQuick ». + + + QML File (Qt Quick 2) + Fichier QML (Qt Quick 2) + + + This wizard creates a custom Qt Creator plugin. + Cet assistant crée un greffon pour Qt Creator personnalisé. + + + Specify details about your custom Qt Creator plugin. + Indiquer les détails de votre greffon pour Qt Creator personnalisé. + + + %{JS: value('ProjectName').charAt(0).toUpperCase() + value('ProjectName').slice(1)} + %{JS: value('NomDuProjet').charAt(0).toUpperCase() + value('NomDuProjet').slice(1)} + + + MyCompany + MonEntreprise + + + (C) %{VendorName} + (C) %{NomDuVendeur} + + + Put short license information here + Indiquer ici une courte information relatives à la licence + + + Put a short description of your plugin here + Indiquer ici une courte description de votre greffon + + + https://www.%{JS: encodeURIComponent(value('VendorName').toLowerCase())}.com + https://www.%{JS: encodeURIComponent(value('NomDuVendeur').toLowerCase())}.com + + + URL: + URL : + + + Qt Quick 2 Extension Plugin + Greffon d’extension Qt Quick 2 + + + Qt Creator build: + Compilation de Qt Creator : + + + Path: + Chemin : + + + <No other projects in this session> + <Pas d’autres projets dans cette session> + + + Dependencies + Dépendances + + + Editor + Éditeur + + + Project + Projet + + + Build + Displayed name for a normal build step +---------- +Display name of the build build step list. Used as part of the labels in the project window. + Compiler + + + Default + The name of the build configuration created by default for a autotools project. +---------- +The name of the build configuration created by default for a generic project. + Défaut + + + Kit + Kit + + + Kit ID + Identifiant du kit + + + Kit filesystem-friendly name + Nom convivial pour le système de fichiers du kit + + + The name of the kit. + Le nom du kit. + + + The name of the kit in a filesystem-friendly version. + Le nom du kit dans une version convivial du système de fichiers. + + + The ID of the kit. + L’identifiant du kit. + + + Unconfigured + Non configuré + + + <b>Project:</b> %1 + <b>Projet :</b> %1 + + + <b>Path:</b> %1 + <b>Chemin :</b> %1 + + + <b>Kit:</b> %1 + <b>Kit :</b> %1 + + + %1 + %1 + + + Kit: <b>%1</b><br/> + Kit : <b>%1</b><br/> + + + <style type=text/css>a:link {color: rgb(128, 128, 255);}</style>The project <b>%1</b> is not yet configured<br/><br/>You can configure it in the <a href="projectmode">Projects mode</a><br/> + <style type=text/css>a:link {color: rgb(128, 128, 255);}</style>Le projet <b>%1</b> n’est pas encore configuré<br/><br/>Vous pouvez le configurer dans le <a href="projectmode">mode Projets</a><br/> + + + <b>Build:</b> %1 + <b>Compilation :</b> %1 + + + <b>Deploy:</b> %1 + <b>Déploiement :</b> %1 + + + <b>Run:</b> %1 + <b>Exécution :</b> %1 + + + Project: <b>%1</b><br/> + Projet : <b>%1</b><br/> + + + Build: <b>%1</b><br/> + Compilation : <b>%1</b><br/> + + + Deploy: <b>%1</b><br/> + Déploiement : <b>%1</b><br/> + + + Run: <b>%1</b><br/> + Exécution : <b>%1</b><br/> + + + Clone of %1 + Clone de %1 + + + Build & Run + Compiler et exécuter + + + Other Project + Autre projet + + + Import Project + Importer un projet + + + Enter the name of the session: + Entrez le nom de la session : + + + No kit defined in this project. + Aucun kit n’est défini dans ce projet. + + + Project Name + Nom du projet + + + Kit is not valid. + Le kit n’est pas valide. + + + Incompatible Kit + Kit incompatible + + + Kit %1 is incompatible with kit %2. + Le kit %1 est incompatible avec le kit %2. + + + Run configurations: + Configurations d’exécution : + + + Select the Root Directory + Sélectionner le répertoire racine + + + Replacement for + Remplacement de + + + Replacement for "%1" + Remplacement de « %1 » + + + Project "%1" was configured for kit "%2" with id %3, which does not exist anymore. The new kit "%4" was created in its place, in an attempt not to lose custom project settings. + Le projet « %1 » a été configuré pour le kit « %2 » avec l’identifiant %3, qui n’existe plus. Le nouveau kit « %4 » a été créé à sa place, afin de ne pas perdre les paramètres personnalisés du projet. + + + Could not find any qml_*.qm file at "%1" + Impossible de trouver un fichier qml_*.qm dans « %1 » + + + %1: Name. + %1 is something like "Active project" + %1 : Nom. + + + %1: Full path to main file. + %1 is something like "Active project" + %1 : chemin complet ver le fichier main. + + + %1: The name the active kit. + %1 is something like "Active project" + %1 : le nom du kit actif. + + + %1: Name of the active build configuration. + %1 is something like "Active project" + %1 : le nom de la configuration de compilation active. + + + %1: Type of the active build configuration. + %1 is something like "Active project" + %1 : type de la configuration de compilation active. + + + %1: Full build path of active build configuration. + %1 is something like "Active project" + %1 : chemin de compilation complet de la configuration de complet active. + + + %1: Variables in the active build environment. + %1 is something like "Active project" + %1 : variables dans l’environnement de compilation actif. + + + %1: Name of the active run configuration. + %1 is something like "Active project" + %1 : nom de la configuration d’exécution active. + + + %1: Executable of the active run configuration. + %1 is something like "Active project" + %1 : exécutable de la configuration d’exécution active. + + + %1: Variables in the environment of the active run configuration. + %1 is something like "Active project" + %1 : variables dans l’environnement de la configuration d’exécution active. + + + %1: Working directory of the active run configuration. + %1 is something like "Active project" + %1 : répertoire de travail de la configuration d’exécution active. + + + Build configurations: + Configurations de compilation : + + + Deploy configurations: + Configurations de déploiement : + + + Partially Incompatible Kit + Kit partiellement incompatible + + + Some configurations could not be copied. + Certaines configurations n’ont pas pu être copiées. + + + &Configure Project + &Configurer le projet + + + Kit is unsuited for project + Le kit n’est pas adapté au projet + + + Click to activate + Cliquer pour activer + + + Enable Kit for Project "%1" + Activer le kit pour le projet « %1 » + + + Enable Kit for All Projects + Activer le kit pour tous les projets + + + Disable Kit for Project "%1" + Désactiver le kit pour le projet « %1 » + + + Cancel Build and Disable Kit in This Project + Annuler la compilation et désactiver le kit dans ce projet + + + Disable Kit "%1" in This Project? + Désactiver le kit « %1 » dans ce projet ? + + + The kit <b>%1</b> is currently being built. + Le kit <b>%1</b> est actuellement en cours de compilation. + + + Do you want to cancel the build process and remove the kit anyway? + Voulez-vous annuler le processus de compilation et retirer le kit ? + + + Disable Kit for All Projects + Désactiver le kit pour tous les projets + + + Copy Steps From Another Kit... + Copier les étapes d’un autre kit… + + + Enable Kit + Activer le kit + + + The process crashed. + Le processus a planté. + + + %1 Steps + %1 is the name returned by BuildStepList::displayName + Étapes %1 + + + No %1 Steps + Aucune étape %1 + + + Add %1 Step + Ajouter l’étape %1 + + + Move Up + Déplacer vers le haut + + + Disable + Désactiver + + + Move Down + Déplacer vers le bas + + + Remove Item + Supprimer l’élément + + + Removing Step failed + Échec de la suppression de l’étape + + + Cannot remove build step while building + Impossible de supprimer une étape de compilation pendant la compilation + + + No Build Steps + Aucune étape de compilation + + + error: + Task is of type: error + erreur : + + + warning: + Task is of type: warning + avertissement : + + + Deploy + Displayed name for a deploy step +---------- +Display name of the deploy build step list. Used as part of the labels in the project window. + Déploiement + + + Deploy locally + Default DeployConfiguration display name + Déployer localement + + + Deploy Configuration + Display name of the default deploy configuration + Déployer la configuration + + + Application Still Running + Application toujours en cours d’exécution + + + PID %1 + PID %1 + + + Invalid + Invalide + + + <html><head/><body><center><i>%1</i> is still running.<center/><center>Force it to quit?</center></body></html> + <html><head/><body><center><i>%1</i> fonctionne toujours.<center/><center>Le forcer à quitter ? </center></body></html> + + + Show in Editor + Afficher dans l’éditeur + + + Show task location in an editor. + Montre l’emplacement de la tâche dans un éditeur. + + + O + O + + + &Annotate + &Annoter + + + Annotate using version control system. + Annoter à l’aide d’un système de gestion de versions. + + + Stop Monitoring + Arrêter la surveillance + + + Stop monitoring task files. + Arrêter la surveillance des fichiers de tâches. + + + File Error + Erreur de fichier + + + Cannot open task file %1: %2 + Impossible d’ouvrir le fichier de tâche %1 : %2 + + + My Tasks + Mes tâches + + + Start Wizard + Démarrer l’assistant + + + GCC + GCC + + + %1 (%2, %3 %4 at %5) + %1 (%2, %3 %4 à %5) + + + Override for code model + Écraser le modèle de code + + + Enable in the rare case that the code model +fails because Clang does not understand the target architecture. + Activer dans le rare cas où le modèle de code +échoue parce que Clang ne comprend pas l’architecture cible. + + + Platform codegen flags: + Flags de plateforme de la génération de code : + + + Platform linker flags: + Flags de plateforme de l’éditeur de liens : + + + Target triple: + Cible triple : + + + Parent toolchain: + Chaîne de compilation parent : + + + MinGW + MinGW + + + MSVC + MSVC + + + Falling back to use the cached environment for "%1" after: + Utilisation de l’environnement mis en cache pour « %1 » après : + + + Initialization: + Initialisation : + + + <empty> + <vide> + + + Additional arguments for the vcvarsall.bat call + Arguments supplémentaires pour l’appel de vcvarsall.bat + + + clang-cl + clang-cl + + + Failed to retrieve MSVC Environment from "%1": +%2 + Échec de la réception de l’environnement MSVC de « %1 » : +%2 + + + Name: + Nom : + + + Automatically managed by %1 or the installer. + Géré automatiquement par %1 ou le programme d’installation. + + + Manual + Manuel + + + <nobr><b>ABI:</b> %1 + <nobr><b>ABI :</b> %1 + + + not up-to-date + pas à jour + + + This toolchain is invalid. + Cette chaîne de compilation est invalide. + + + Toolchain Auto-detection Settings + Paramètres de l’auto-détection de la chaîne de compilation + + + Detect x86_64 GCC compilers as x86_64 and x86 + Détecter les compilateurs GCC x86_64 comme x86_64 et x86 + + + If checked, %1 will set up two instances of each x86_64 compiler: +One for the native x86_64 target, and one for a plain x86 target. +Enable this if you plan to create 32-bit x86 binaries without using a dedicated cross compiler. + Si cette option est cochée, %1 créera deux instances de chaque compilateur x86_64 : +un pour la cible x86_64 native, et un pour une cible x86 ordinaire. +Activez cette option si vous envisagez de créer des binaires x86 32 bits sans utiliser de compilateur croisé dédié. + + + The following compiler was already configured:<br>&nbsp;%1<br>It was not configured again. + Le compilateur suivant a déjà été configuré :<br>&nbsp;%1<br>Il n’a pas été reconfiguré. + + + The following compilers were already configured:<br>&nbsp;%1<br>They were not configured again. + Les compilateurs suivants ont déjà été configurés :<br>&nbsp;%1<br>Ils n’ont pas encore été reconfigurés. + + + [none] + [aucun] + + + Name + Nom + + + Source + Source + + + Create Run Configuration + Créer une configuration d’exécution + + + Filter candidates by name + Filtrer les candidats par nom + + + Create + Créer + + + Type + Type + + + Remove All + Tout supprimer + + + Re-detect + Re-détecter + + + Auto-detection Settings... + Paramètres de l’auto-détection… + + + Duplicate Compilers Detected + Duplication de compilateurs détectée + + + Tool Chains + Chaînes de compilation + + + Compilers + Compilateurs + + + Clone + Cloner + + + <custom> + <personnalisé> + + + Attach debugger to this process + Attacher le débogueur à ce processus + + + Attach debugger to %1 + Attacher le débogueur à %1 + + + Stop + Arrêter + + + Close Tab + Fermer l’onglet + + + Close All Tabs + Fermer tous les onglets + + + Close Other Tabs + Fermer tous les autres onglets + + + Show &App Output + Afficher la sortie de l’&application + + + Show the output that generated this issue in Application Output. + Afficher la sortie qui a généré ce problème dans la sortie de l’application. + + + A + A + + + Re-run this run-configuration. + Ré-exécuter cette configuration d’exécution. + + + Stop running program. + Arrêter l’exécution du programme. + + + Word-wrap output + Retour à la ligne automatique + + + Clear old output on a new run + Effacer l’ancienne sortie lors d’une nouvelle exécution + + + Always + Toujours + + + Never + Jamais + + + On First Output Only + Sur la première sortie uniquement + + + Limit output to %1 characters + Limiter la sortie à %1 caractères + + + Open Application Output when running: + Ouvrir la sortie de l’application en cours d’exécution : + + + Open Application Output when debugging: + Ouvrir la sortie de l’application lors du débogage : + + + Application Output + Sortie de l’application + + + Application Output Window + Fenêtre de sortie de l’application + + + Code Style + Style de code + + + Project + Settings + Projet + + + Project %1 + Settings, %1 is a language (C++ or QML) + Projet %1 + + + Clang + Clang + + + Language: + Langue : + + + Rename + Renommer + + + Delete + Supprimer + + + %1 (last session) + %1 (dernière session) + + + Open Session #%1 + Ouvrir la session #%1 + + + Ctrl+Meta+%1 + Ctrl+Meta+%1 + + + Ctrl+Alt+%1 + Ctrl+Alt+%1 + + + Open Recent Project #%1 + Ouvrir le projet récent #%1 + + + Ctrl+Shift+%1 + Ctrl+Maj+%1 + + + Open %1 "%2" + Ouvrir %1 « %2 » + + + Open %1 "%2" (%3) + Ouvrir %1 « %2 » (%3) + + + session + Appears in "Open session <name>" + session + + + %1 (current session) + %1 (session actuelle) + + + project + Appears in "Open project <name>" + projet + + + Remove Project from Recent Projects + Supprimer le projet des projets récents + + + Clear Recent Project List + Effacer la liste des projets récents + + + Available device types: + Types de périphérique disponibles : + + + &Device: + &Périphérique : + + + &Name: + &Nom : + + + Auto-detected: + Autodétecté : + + + Current state: + État actuel : + + + Type Specific + Type spécifique + + + &Add... + &Ajouter… + + + &Remove + &Supprimer + + + Set As Default + Définir comme valeur par défaut + + + Yes (id is "%1") + Oui (l’identifiant est « %1 ») + + + No + Non + + + Show Running Processes... + Afficher les processus en cours… + + + Test + Test + + + Local PC + Local PC + + + Desktop + Desktop + + + User requested stop. Shutting down... + L’utilisateur a demandé l’arrêt. Arrêt en cours… + + + %1 (default for %2) + %1 (défaut pour %2) + + + Kit: + Kit : + + + List of Processes + Liste de processus + + + Filter + Filtre + + + &Update List + Mettre à jo&ur la liste + + + &Kill Process + &Tuer processus + + + &Filter: + &Filtre : + + + Remote Error + Erreur distante + + + Process ID + ID du processus + + + Command Line + Ligne de commande + + + Fetching process list. This might take a while. + Réception de la liste des processus. Cela peut prendre un certain temps. + + + Devices + Périphériques + + + Device + Périphérique + + + Ready to use + Prêt à l’emploi + + + Connected + Connecté + + + Disconnected + Déconnecté + + + Unknown + Inconnu + + + localSource() not implemented for this device type. + localSource() n’est pas implémenté pour ce type d’appareil. + + + No device for given path: "%1". + Pas de périphérique pour le chemin d’accès donné : « %1 ». + + + Device for path "%1" does not support killing processes. + Le périphérique pour le chemin « %1 » ne prend pas en charge l’arrêt des processus. + + + Process listing command failed with exit code %1. + Le processus listant les commandes a échoué en retournant le code %1. + + + Remote stderr was: %1 + Le stderr distant était : %1 + + + Error: Kill process failed: %1 + Erreur : le processus kill a échoué : %1 + + + Unnamed + Sans nom + + + %1 needs a compiler set up to build. Configure a compiler in the kit options. + %1 a besoin d’un compilateur pour être compilé. Configurez un compilateur dans les options du kit. + + + Error: + Erreur : + + + Warning: + Avertissement : + + + Sysroot + Racine du système + + + Sys Root "%1" does not exist in the file system. + La racine du système « %1 » n’existe pas dans le système de fichiers. + + + Sys Root "%1" is not a directory. + La racine du système « %1 » n’est pas un répertoire. + + + Sys Root "%1" is empty. + La racine du système « %1 » est vide. + + + Sys Root + Racine du système + + + <No compiler> + <Aucun compilateur> + + + Compiler + Compilateur + + + Compilers produce code for different ABIs: %1 + Les compilateurs produisent du code pour différentes ABI : %1 + + + Path to the compiler executable + Chemin d’accès à l’exécutable du compilateur + + + Compiler for different languages + Compilateur pour différents langages + + + Compiler executable for different languages + Exécutable de compilateur pour différents langages + + + Device is incompatible with this kit. + Le périphérique est incompatible avec ce kit. + + + Host address + Adresse de l’hôte + + + SSH port + Port SSH + + + User name + Nom d’utilisateur + + + Private key file + Fichier de clé privée + + + Device name + Nom du périphérique + + + Build device + Compiler le périphérique + + + The device used to build applications on. + Le périphérique utilisé pour créer des applications. + + + No build device set. + Aucun périphérique de compilation n’est défini. + + + Build host address + Adresse de l’hôte de compilation + + + Build SSH port + Port SSH de compilation + + + Build user name + Nom d’utilisateur de compilation + + + Build private key file + Fichier de clé privée de compilation + + + Build device name + Nom du périphérique de compilation + + + Change... + Modifier… + + + No changes to apply. + Aucune modification à appliquer. + + + Force UTF-8 MSVC compiler output + Forcer la sortie UTF-8 du compilateur MSVC + + + Either switches MSVC to English or keeps the language and just forces UTF-8 output (may vary depending on the used MSVC compiler). + Permet de basculer MSVC vers l’anglais ou de conserver la langue et de forcer la sortie UTF-8 (peut varier en fonction du compilateur MSVC utilisé). + + + Additional build environment settings when using this kit. + Paramètres supplémentaires de l’environnement de compilation lors de l’utilisation de ce kit. + + + The environment setting value is invalid. + La valeur du réglage de l’environnement n’est pas valide. + + + None + Aucune + + + No compiler set in kit. + Aucun compilateur n’est défini dans le kit. + + + Unknown device type + Type de périphérique inconnu + + + Device type + Type de périphérique + + + No device set. + Pas de périphérique défini. + + + The root directory of the system image to use.<br>Leave empty when building for the desktop. + Le répertoire racine du système image à utiliser.<br>Laisser vide lors d’une compilation sur le bureau. + + + The compiler to use for building.<br>Make sure the compiler will produce binaries compatible with the target device, Qt version and other libraries used. + Le compilateur à utiliser pour la compilation.<br>Assurez-vous que le compilateur génère des binaires compatibles avec le périphérique cible, la version de Qt et les autres bibliothèques utilisées. + + + The type of device to run applications on. + Le type de périphérique sur lequel les applications sont exécutées. + + + The device to run the applications on. + Le périphérique sur lequel les applications sont exécutées. + + + Desktop (%1) + Bureau (%1) + + + Manage... + Gérer… + + + Kit name and icon. + Nom du kit et icône. + + + Mark as Mutable + Marquer comme mutable + + + <html><head/><body><p>The name of the kit suitable for generating directory names. This value is used for the variable <i>%1</i>, which for example determines the name of the shadow build directory.</p></body></html> + <html><head/><body><p>Le nom du kit permettant de générer des noms de répertoire. Cette valeur est utilisée pour la variable <i>%1</i>, qui détermine par exemple le nom du répertoire de compilation de l’ombre.</p></body></html> + + + File system name: + Nom du système de fichiers : + + + Kit icon. + Icône du kit. + + + Select Icon... + Sélection l’icône… + + + Reset to Device Default Icon + Restaurer l’icône par défaut du périphérique + + + Display name is not unique. + Le nom d’affichage n’est pas unique. + + + Default for %1 + Valeur par défaut pour %1 + + + Select Icon + Sélectionner une icône + + + Images (*.png *.xpm *.jpg) + Images (*.png *.xpm *.jpg) + + + Auto-detected + Autodétecté + + + %1 (default) + Mark up a kit as the default one. + %1 (par défaut) + + + Kits + Kits + + + Make Default + Rendre par défaut + + + Settings Filter... + Filtre des paramètres… + + + Choose which settings to display for this kit. + Sélectionner les paramètres à afficher pour ce kit. + + + Default Settings Filter... + Filtre par défaut des paramètres… + + + Choose which kit settings to display by default. + Sélectionner les paramètres du kit à afficher par défaut. + + + Custom + Personnalisé + + + %n entries + + %n entrée + %n entrées + + + + Empty + Vide + + + MACRO[=VALUE] + MACRO[=VALEUR] + + + Each line defines a macro. Format is MACRO[=VALUE]. + Chaque ligne définit une macro. Le format est MACRO[=VALEUR]. + + + Each line adds a global header lookup path. + Chaque ligne ajoute un chemin de correspondance d’en-tête global. + + + Comma-separated list of flags that turn on C++11 support. + Liste des flags séparés par des virgules qui active le support du C++11. + + + Comma-separated list of mkspecs. + Liste de mkspecs séparés par une virgule. + + + &Compiler path: + Chemin du &compilateur : + + + &Make path: + Chemin de &make : + + + &ABI: + &ABI : + + + &Predefined macros: + Macros &prédéfinies : + + + &Header paths: + Chemins des &en-têtes : + + + C++11 &flags: + &Flags C++11 : + + + &Qt mkspecs: + mkspecs de &Qt : + + + &Error parser: + &Erreur d’analyse syntaxique : + + + No device configured. + Aucun périphérique configuré. + + + Set Up Device + Configurer le périphérique + + + There is no device set up for this kit. Do you want to add a device? + Il n’y a pas de périphérique configuré pour ce kit. Souhaitez-vous ajouter un périphérique ? + + + Check for a configured device + Vérifier pour les périphériques configurés + + + Run Environment + Environnement d’exécution + + + Base environment for this run configuration: + Environnement de base pour cette configuration d’exécution : + + + Custom Output Parsers + Analyseurs de sortie personnalisés + + + Parse standard output during build + Analyser la sortie standard pendant la compilation + + + Makes output parsers look for diagnostics on stdout rather than stderr. + Fait en sorte que les analyseurs de sortie recherchent les diagnostics sur stdout plutôt que sur stderr. + + + Build Settings + Paramètres de compilation + + + Build directory + Répertoire de compilation + + + Name of the build configuration + Nom de la configuration de compilation + + + Variables in the build configuration's environment + Variables de l’environnement de la configuration de compilation + + + Tooltip in target selector: + Info-bulle dans le sélecteur de cible : + + + Appears as a tooltip when hovering the build configuration + Apparaît sous forme d’info-bulle au survol de la configuration de compilation + + + System Environment + Environnement du système + + + Clean Environment + Environnement vierge + + + The project was not parsed successfully. + Le projet n’a pas été analysé avec succès. + + + Main file of the project + Fichier principal du projet + + + Name of the project + Nom du projet + + + Name of the project's active build configuration + Nom de la configuration de compilation active du projet + + + Name of the project's active build system + Nom du système de compilation active du projet + + + Type of current build + Type de la compilation actuelle + + + Type of the project's active build configuration + Type de configuration de compilation active du projet + + + Remove + Name of the action triggering the removetaskhandler + Supprimer + + + Remove task from the task list. + Supprimer la tâche de la liste des tâches. + + + Custom Parser + Analyseur personnalisé + + + &Error message capture pattern: + &Motif de capture des messages d’erreur : + + + Capture Positions + Position des captures + + + &File name: + Nom de &fichier : + + + &Line number: + Numéro de &ligne : + + + &Message: + &Message : + + + Standard output + Sortie standard (stdout) + + + Standard error + Sortie erreur (stderr) + + + E&rror message: + &Message d’erreur : + + + Warning message: + Message d’avertissement : + + + Warning message capture pattern: + Motif de capture des messages d’avertissement : + + + Capture Output Channels + Capture des canaux de sortie + + + No message given. + Aucun message n’est donné. + + + Pattern does not match the message. + Le motif ne correspond pas au message. + + + File name: + Nom du fichier : + + + Line number: + Numéro de ligne : + + + Message: + Message : + + + Error + Erreur + + + Warning + Avertissement + + + Not applicable: + Non applicable : + + + Pattern is empty. + Le motif est vide. + + + Close + Fermer + + + Device test finished successfully. + Le test du périphérique s’est terminé avec succès. + + + Device test failed. + Le test du périphérique a échoué. + + + ICC + ICC + + + Cannot kill process with pid %1: %2 + Impossible de tuer le processus avec le pid %1 : %2 + + + Cannot interrupt process with pid %1: %2 + Impossible d’interrompre le processus avec le pid %1 : %2 + + + Cannot open process. + Impossible d’ouvrir le processus. + + + Invalid process id. + L’identifiant de processus est invalide. + + + Cannot open process: %1 + Impossible d’ouvrir le processus : %1 + + + DebugBreakProcess failed: + DebugBreakProcessus a échoué : + + + %1 does not exist. If you built %2 yourself, check out https://code.qt.io/cgit/qt-creator/binary-artifacts.git/. + %1 n’existe pas. Si vous avez compilé %2 vous-même, consultez https://code.qt.io/cgit/qt-creator/binary-artifacts.git/. + + + Cannot start %1. Check src\tools\win64interrupt\win64interrupt.c for more information. + Impossible de démarrer %1. Vérifier src\tools\win64interrupt\win64interrupt.c pour plus d’information. + + + could not break the process. + Impossible d’interrompre le processus. + + + Import Build From... + Importer la compilation depuis… + + + Import + Importer + + + No Build Found + Aucune compilation trouvée + + + No build found in %1 matching project %2. + Aucune compilation trouvée dans %1 pour le projet %2 correspondant. + + + Import Warning + Importer un avertissement + + + Import Build + Importer une compilation + + + %1 - temporary + %1 – temporaire + + + Imported Kit + Kit importé + + + No suitable kits found. + Aucun kit approprié n’a été trouvé. + + + Add a kit in the <a href="buildandrun">options</a> or via the maintenance tool of the SDK. + Ajouter un kit dans les <a href="buildandrun">options</> ou via l’outil de maintenance du SDK. + + + Select all kits + Sélectionner tous les kits + + + Type to filter kits by name... + Taper pour filtrer les kits par nom… + + + Select Kits for Your Project + Sélectionner un kit pour votre projet + + + The following kits can be used for project <b>%1</b>: + %1: Project name + Les kits suivants peuvent être utilisés pour le projet <b>%1</b> : + + + Kit Selection + Sélection de kit + + + <b>Error:</b> + Severity is Task::Error + <b>Erreur :</b> + + + <b>Warning:</b> + Severity is Task::Warning + <b>Avertissement :</b> + + + Configure Project + Configurer le projet + + + Waiting for Applications to Stop + Attente de l’arrêt des applications + + + Cancel + Annuler + + + Waiting for applications to stop. + Attente de l’arrêt des applications. + + + Debug + The name of the debug build configuration created by default for a qmake project. + Debug + + + Release + The name of the release build configuration created by default for a qmake project. + Release + + + You asked to build the current Run Configuration's build target only, but it is not associated with a build target. Update the Make Step in your build settings. + Vous avez demandé à compiler uniquement la cible de compilation de la configuration d’exécution actuelle, mais elle n’est pas associée à une cible de compilation. Mettez à jour l’étape Make dans vos paramètres de compilation. + + + "data" for a "Form" page needs to be unset or an empty object. + « data » pour une page « Form » doit être désactivé ou être un objet vide. + + + The process failed to start. + Le processus n’a pas démarré. + + + Start removing auto-detected items associated with this docker image. + Commencer à supprimer les éléments auto-détectés associés à cette image docker. + + + Removing kits... + Suppression des kits… + + + Removed "%1" + « %1 » supprimé + + + Removing Qt version entries... + Suppression des entrées de version de Qt… + + + Removing toolchain entries... + Suppression des entrées de la chaîne de compilation… + + + Removal of previously auto-detected kit items finished. + La suppression des éléments du kit précédemment auto-détectés est terminée. + + + Start listing auto-detected items associated with this docker image. + Commencer à lister les éléments auto-détectés associés à cette image docker. + + + Kits: + Kits : + + + Qt versions: + Versions de Qt : + + + Toolchains: + Chaînes de compilation : + + + Listing of previously auto-detected kit items finished. + Liste des éléments de kits précédemment auto-détectés. + + + Found "%1" + « %1 » trouvé + + + Searching for qmake executables... + Recherche des exécutables de qmake… + + + Error: %1. + Erreur : %1. + + + No Qt installation found. + Aucune installation de Qt n’a été trouvée. + + + Searching toolchains... + Recherche des chaînes de compilation… + + + Searching toolchains of type %1 + Recherche des chaînes de compilation de type %1 + + + %1 new toolchains found. + La nouvelle chaîne de compilation %1 a été trouvée. + + + Starting auto-detection. This will take a while... + Démarrage de l’auto-détection. Cela va prendre un certain temps… + + + Registered kit %1 + Kit enregistrée %1 + + + Build directory: + Répertoire de compilation : + + + The build directory is not reachable from the build device. + Le répertoire de compilation n’est pas accessible depuis le périphérique de compilation. + + + Shadow build: + Shadow build : + + + Separate debug info: + Séparer les informations de débogage : + + + The project is currently being parsed. + Le projet est en cours d’analyse. + + + The project could not be fully parsed. + Le projet n’a pas pu être entièrement analysé. + + + The project file "%1" does not exist. + Le fichier du projet « %1 » n’existe pas. + + + Custom output parsers scan command line output for user-provided error patterns<br>to create entries in Issues.<br>The parsers can be configured <a href="dummy">here</a>. + Les analyseurs de sortie personnalisés analysent la sortie de la ligne de commande à la recherche de modèles d’erreur fournis par l’utilisateur<br>afin de créer des entrées dans Problèmes.<br>Les analyseurs peuvent être configurés <a href="dummy">ici</a>. + + + There are no custom parsers active + Il n’y a aucun analyseur de sortie personnalisé actif + + + There are %n custom parsers active + + Il y a %n analyseur de sortie personnalisé actif + Il y a %n analyseurs de sortie personnalisés actifs + + + + Custom output parsers defined here can be enabled individually in the project's build or run settings. + Les analyseurs de sortie personnalisés définis ici peuvent être activés individuellement dans les paramètres de compilation ou d’exécution du projet. + + + Add... + Ajouter… + + + New Parser + Nouvel analyseur + + + Source File Path + Chemin du fichier source + + + Target Directory + Répertoire cible + + + Files to deploy: + Fichiers à déployer : + + + Override deployment data from build system + Écraser les données de déploiement du système de compilation + + + Qt Run Configuration + Configuration d’exécution de Qt + + + No device for path "%1" + Aucun périphérique pour le chemin « %1 » + + + Remote error output was: %1 + La sortie d’erreur distante était : %1 + + + Found %n free ports. + + Trouvé un port libre. + Trouvé %n ports libres. + + + + Checking available ports... + Vérification des ports disponibles… + + + No device set for test transfer. + Aucun dispositif n’est défini pour le transfert de test. + + + No files to transfer. + Aucun fichier à transférer. + + + Missing transfer implementation. + Implémentation du transfert manquante. + + + sftp + sftp + + + rsync + rsync + + + generic file copy + copie de fichier générique + + + SSH + SSH + + + Enable connection sharing: + Activer le partage de connexion : + + + Connection sharing timeout: + Délai de partage de la connexion : + + + Path to ssh executable: + Chemin de l’exécutable ssh : + + + Path to sftp executable: + Chemin de l’exécutable sftp : + + + Path to ssh-askpass executable: + Chemin de l’exécutable ssh-askpass : + + + Path to ssh-keygen executable: + Chemin de l’exécutable ssh-keygen : + + + minutes + minutes + + + Environment + Environnement + + + ABI + ABI + + + Files in All Project Directories + Fichiers dans tous les répertoires du projet + + + Files in All Project Directories: + Fichiers dans tous les répertoires du projet : + + + Setting + Paramètres + + + Visible + Visible + + + Line Edit Validator Expander + + + + The text edit input to fix up. + L’entrée d’édition de texte à corriger. + + + Field is not an object. + Le champ n’est pas un objet. + + + Field has no name. + Le champ n’a pas de nom. + + + Field "%1" has no type. + Le champ « %1 » n’a pas de type. + + + Field "%1" has unsupported type "%2". + Le champ « %1 » a un type « %2 » non pris en charge. + + + When parsing Field "%1": %2 + Lors de l’analyse du champ « %1 » : %2 + + + Label ("%1") data is not an object. + Les données du libellé (« %1 ») ne sont pas des objets. + + + Label ("%1") has no trText. + Le libellé (« %1 ») n’a pas de trText. + + + Spacer ("%1") data is not an object. + Les données de l’espaceur (« %1 ») ne sont pas des objets. + + + Spacer ("%1") property "factor" is no integer value. + La propriété « factor » de l’espaceur (« %1 ») n’a pas de valeur entière. + + + LineEdit ("%1") data is not an object. + Les données du LineEdit (« %1 ») ne sont pas des objets. + + + LineEdit ("%1") has an invalid regular expression "%2" in "validator". + Le LineEdit (« %1 ») a une expression rationnelle invalide « %2 » dans « validator ». + + + LineEdit ("%1") has an invalid value "%2" in "completion". + Le LineEdit (« %1 ») a une valeur invalide « %2 » dans « complétion ». + + + TextEdit ("%1") data is not an object. + Les données du TextEdit (« %1 ») ne sont pas des objets. + + + PathChooser data is not an object. + Les données du PathChooser ne sont pas des objets. + + + kind "%1" is not one of the supported "existingDirectory", "directory", "file", "saveFile", "existingCommand", "command", "any". + le type « %1 » n’est pas l’un des types pris en charge « existingDirectory », « directory », « file », « saveFile », « existingCommand », « command », « any ». + + + CheckBox ("%1") data is not an object. + Les données du CheckBox (« %1 ») ne sont pas des objets. + + + CheckBox ("%1") values for checked and unchecked state are identical. + Les valeurs du CheckBox (« %1 ») sont identiques pour l’état coché et non coché. + + + No JSON lists allowed inside List items. + Aucune liste JSON n’est autorisée dans les éléments de la liste. + + + No "key" found in List items. + Aucune « clé » n’a été trouvée dans les éléments de la liste. + + + %1 ("%2") data is not an object. + Les données du %1 (« %2 ») ne sont pas des objets. + + + %1 ("%2") "index" is not an integer value. + L’« index » de %1 (« %2 ») n’est pas une valeur entière. + + + %1 ("%2") "disabledIndex" is not an integer value. + Le « disabledIndex » de %1 (« %2 ») n’est pas une valeur entière. + + + %1 ("%2") "items" missing. + Le « items » de %1 (« %2 ») est manquant. + + + %1 ("%2") "items" is not a JSON list. + Le « items » de %1 (« %2 ») n’est pas une liste JSON. + + + At least one required feature is not present. + Au moins une caractéristique requise n’est pas présente. + + + Platform is not supported. + La plate-forme n’est pas prise en charge. + + + At least one preferred feature is not present. + Au moins une caractéristique préférée n’est pas présente. + + + Feature list is set and not of type list. + La liste des caractéristiques est définie et n’est pas de type liste. + + + No "%1" key found in feature list object. + Aucune clé « %1 » n’a été trouvée dans l’objet de la liste des caractéristiques. + + + Feature list element is not a string or object. + L’élément de la liste des caractéristiques n’est pas une chaîne de caractères ou un objet. + + + Failed to Commit to Version Control + Échec du commit dans le gestionnaire de versions + + + Error message from Version Control System: "%1". + Message d’erreur du système de gestion de versions : « %1 ». + + + Failed to Add to Project + Échec de l’ajout au projet + + + Failed to add subproject "%1" +to project "%2". + Échec de l’ajout du sous-projet « %1 » +au projet « %2 ». + + + Failed to add one or more files to project +"%1" (%2). + Échec de l’ajout d’un ou plusieurs fichiers au projet +« %1 » (%2). + + + Project File + Fichier du projet + + + Choose Project File + Sélectionner un fichier du projet + + + The project contains more than one project file. Select the one you would like to use. + Le projet contient plus d’un fichier de projet. Sélectionnez celui que vous souhaitez utiliser. + + + Check whether a variable exists.<br>Returns "true" if it does and an empty string if not. + Vérifie si une variable existe.<br>Renvoie « true » si c’est le cas et une chaîne vide si ce n’est pas le cas. + + + Could not determine target path. "TargetPath" was not set on any page. + Impossible de déterminer le chemin cible. Le paramètre « TargetPath » n’a été défini sur aucune page. + + + File Generation Failed + Échec de la génération du fichier + + + The wizard failed to generate files.<br>The error message was: "%1". + L’assistant n’a pas réussi à générer les fichiers.<br>Le message d’erreur était : « %1 ». + + + No 'key' in options object. + + + + Failed to Overwrite Files + Échec de l’écrasement des fichiers + + + Failed to Format Files + Échec du formatage des fichiers + + + Failed to Write Files + Échec de l’écriture des fichiers + + + Failed to Post-Process Files + Échec du post-traitement des fichiers + + + Failed to Polish Files + Échec du polissage des fichiers + + + Failed to Open Files + Échec de l’ouverture des fichiers + + + "%1" does not exist in the file system. + « %1 » n’existe pas dans le système de fichiers. + + + Failed to open "%1" as a project. + Échec de l’ouverture de « %1 » en tant que projet. + + + Failed to open an editor for "%1". + Échec de l’ouverture d’un éditeur pour « %1 ». + + + No file to open found in "%1". + Aucun fichier à ouvrir n’a été trouvé dans « %1 ». + + + Failed to open project. + Échec de l’ouverture du projet. + + + Failed to open project in "%1". + Échec de l’ouverture du projet dans « %1 ». + + + Cannot Open Project + Impossible d’ouvrir le projet + + + Generator is not a object. + Le générateur n’est pas un objet. + + + Generator has no typeId set. + Le générateur n’a pas de typeId défini. + + + TypeId "%1" of generator is unknown. Supported typeIds are: "%2". + Le typeId « %1 » du générateur est inconnu. Les typesIds pris en charge sont : « %2 ». + + + Path "%1" does not exist when checking Json wizard search paths. + + Le chemin « %1 » n’existe pas lors de la vérification des chemins de recherche de l’assistant Json. + + + Checking "%1" for %2. + + Vérification de « %1 » pour %2. + + + + * Failed to parse "%1":%2:%3: %4 + + * Échec de l’analyse de « %1 »:%2:%3 : %4 + + + + * Did not find a JSON object in "%1". + + * N’a pas trouvé d’objet JSON dans « %1 ». + + + + * Configuration found and parsed. + + * La configuration a été trouvée et analysée. + + + + JsonWizard: "%1" not found + + Assistant Json : « %1 » introuvable + + + + Page is not an object. + La page n’est pas un objet. + + + Page has no typeId set. + La page n’a pas de typeId défini. + + + TypeId "%1" of page is unknown. Supported typeIds are: "%2". + Le typeId « %1 » de la page est inconnu. Les typesIds pris en charge sont : « %2 ». + + + Page with typeId "%1" has invalid "index". + La page avec le typeId « %1 » a un « index » invalide. + + + * Version %1 not supported. + + * La version %1 n’est pas prise en charge. + + + + key not found. + clé introuvable. + + + Expected an object or a list. + Un objet ou une liste est attendu. + + + The platform selected for the wizard. + La plate-forme sélectionnée pour l’assistant. + + + The features available to this wizard. + Les fonctionnalités disponibles pour cet assistant. + + + The plugins loaded. + Les greffons chargés. + + + "kind" value "%1" is not "class" (deprecated), "file" or "project". + La valeur de « kind » de « %1 » n’est pas un « class » (obsolète), un « file » ou un « project ». + + + "kind" is "file" or "class" (deprecated) and "%1" is also set. + « kind » est un « file » ou un « class » (obsolète) et « %1 » est également défini. + + + No id set. + Aucun identifiant n’a été défini. + + + No category is set. + Aucune catégorie n’a été définie. + + + Icon file "%1" not found. + Fichier d’icône « %1 » introuvable. + + + Image file "%1" not found. + Fichier d’image « %1 » introuvable. + + + No displayName set. + Aucun displayName n’a été défini. + + + No displayCategory set. + Aucun displayCategory n’a été défini. + + + No description set. + Aucune description n’a été définie. + + + When parsing "generators": %1 + Lors de l’analyse des « générateurs » : %1 + + + When parsing "pages": %1 + Lors de l’analyse des « pages » : %1 + + + Files data list entry is not an object. + L’entrée de la liste de données des fichiers n’est pas un objet. + + + Source and target are both empty. + La source et la cible sont toutes deux vides. + + + When processing "%1":<br>%2 + Lors du traitement de « %1 » :<br>%2 + + + %1 [folder] + %1 [dossier] + + + %1 [symbolic link] + %1 [lien symbolique] + + + %1 [read only] + %1 [lecture seule] + + + The directory %1 contains files which cannot be overwritten: +%2. + Le répertoire %1 contient des fichiers qui ne peuvent pas être écrasés : +%2. + + + When parsing fields of page "%1": %2 + Lors de l’analyse des champs de la page « %1 » : %2 + + + "data" for a "File" page needs to be unset or an empty object. + « data » pour une page « File » doit être désactivé ou être un objet vide. + + + Error parsing "%1" in "Kits" page: %2 + Erreur d’analyse de « %1 » dans la page « Kits » : %2 + + + "data" must be a JSON object for "Kits" pages. + « data » doit être un objet JSON pour les pages « Kits ». + + + "Kits" page requires a "%1" set. + La page « Kits » nécessite un jeu de « %1 ». + + + "data" must be empty or a JSON object for "Project" pages. + « data » doit être un objet JSON pour les pages « Project ». + + + Invalid regular expression "%1" in "%2". %3 + Expression rationnelle invalide « %1 » dans « %2 ». %3 + + + "data" for a "Summary" page can be unset or needs to be an object. + « data » pour une page « Summary » doit être désactivé ou être un objet vide. + + + Key is not an object. + La clé n’est pas un objet. + + + Pattern "%1" is no valid regular expression. + Le motif « %1 » n’est pas une expression rationnelle valide. + + + ScannerGenerator: Binary pattern "%1" not valid. + ScannerGenerator : le motif binaire « %1 » n’est pas valide. + + + Kit of Active Project: %1 + Kit du projet actif : %1 + + + The process cannot access the file because it is being used by another process. +Please close all running instances of your application before starting a build. + Le processus ne peut pas accéder au fichier car il est utilisé par un autre processus. +Veuillez fermer toutes les instances en cours d’exécution de votre application avant de lancer une compilation. + + + Parse Build Output + Analyse de la sortie de la compilation + + + Output went to stderr + La sortie a été envoyée à stderr + + + Clear existing tasks + Effacer les tâches existantes + + + Load from File... + Charger depuis un fichier… + + + Choose File + Sélectionner un fichier + + + Could Not Open File + Impossible d’ouvrir le fichier + + + Could not open file: "%1": %2 + Impossible d’ouvrir le fichier : « %1 » : %2 + + + Build Output + Sortie de compilation + + + Parsing Options + Options d’analyse + + + Use parsers from kit: + Utiliser les analyseurs du kit : + + + Cannot Parse + Impossible d’analyser + + + Cannot parse: The chosen kit does not provide an output parser. + Impossible d’analyser : le kit choisi ne fournit pas d’analyseur de sortie. + + + No kits are enabled for this project. Enable kits in the "Projects" mode. + Aucun kit n’est activé pour ce projet. Activez les kits dans le mode « Projets ». + + + Rename More Files? + Renommer d’autres fichiers ? + + + Would you like to rename these files as well? + %1 + Souhaitez-vous également renommer ces fichiers ? +…%1 + + + Choose Drop Action + Sélectionner une action pour le glissement + + + You just dragged some files from one project node to another. +What should %1 do now? + Vous venez de faire glisser des fichiers d’un nœud de projet à un autre. +Que doit faire %1 maintenant ? + + + Copy Only File References + Copier uniquement les références du fichier + + + Move Only File References + Déplacer uniquement les références du fichier + + + Copy file references and files + Copier les références de fichiers et les fichiers + + + Move file references and files + Déplacer les références de fichiers et les fichiers + + + Target directory: + Répertoire cible : + + + Copy File References + Copier les références du fichier + + + Move File References + Déplacer les références du fichier + + + Not all operations finished successfully. + Toutes les opérations ne se sont pas terminées avec succès. + + + The following files could not be copied or moved: + Les fichiers suivants n’ont pas pu être copiés ou déplacés : + + + The following files could not be removed from the project file: + Les fichiers suivants n’ont pas pu être supprimés du fichier du projet : + + + The following files could not be added to the project file: + Les fichiers suivants n’ont pas pu être ajoutés au fichier du projet : + + + The following files could not be deleted: + Les fichiers suivants n’ont pas pu être supprimés : + + + A version control operation failed for the following files. Please check your repository. + Une opération du gestionnaire de versions a échoué pour les fichiers suivants. Veuillez vérifier votre dépôt. + + + Failure Updating Project + Échec de la mise à jour du projet + + + Terminal + Terminal + + + Run in terminal + Exécuter dans un terminal + + + Working Directory + Répertoire de travail + + + Select Working Directory + Sélectionner le répertoire de travail + + + Reset to Default + Restaurer les paramètres par défaut + + + Arguments + Arguments + + + Command line arguments: + Arguments de la ligne de commande : + + + Toggle multi-line mode. + Activer/désactiver le mode multi-ligne. + + + Executable + Exécutable + + + <unknown> + <inconnu> + + + Executable: + Exécutable : + + + Alternate executable on device: + Exécutable alternatif sur le périphérique : + + + Use this command instead + Utiliser cette commande à la place + + + Add build library search path to DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH + Ajouter le chemin de recherche de la bibliothèque de compilation à DYLD_LIBRARY_PATH et DYLD_FRAMEWORK_PATH + + + Add build library search path to PATH + Ajouter le chemin de recherche de la bibliothèque de compilation à PATH + + + Add build library search path to LD_LIBRARY_PATH + Ajouter le chemin de recherche de la bibliothèque de compilation à LD_LIBRARY_PATH + + + Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug) + Utiliser les versions debug des cadriciels (DYLD_IMAGE_SUFFIX=_debug) + + + Run as root user + Exécuter en tant que super-utilisateur + + + Interpreter + Interpréteur + + + X11 Forwarding: + X11 forwarding : + + + Forward to local display + Déporter vers un affichage local + + + Source directory: + Répertoire source : + + + Start Parsing + Démarrer l’analyse + + + Select files matching: + Sélectionner les fichiers qui correspondent à : + + + Hide files matching: + Cacher les fichiers correspondant à : + + + Apply Filters + Appliquer les filtres + + + Generating file list... + +%1 + Génération de la liste des fichiers… + +%1 + + + Not showing %n files that are outside of the base directory. +These files are preserved. + + Ne pas montrer le fichier en dehors du répertoire de base. +Ces fichiers sont préservés. + Ne pas montrer les %n fichiers en dehors du répertoire de base. +Ces fichiers sont préservés. + + + + Edit Files + Modifier les fichiers + + + Add Existing Directory + Ajouter un répertoire existant + + + Files + Fichiers + + + Import Existing Project + Importer un projet existant + + + Project Name and Location + Nom du projet et emplacement + + + Project name: + Nom du projet : + + + File Selection + Sélection de fichier + + + Import as qmake or CMake Project (Limited Functionality) + Importer en tant que projet qmake ou CMake (fonctionnalité limitée) + + + Imports existing projects that do not use qmake, CMake, Qbs, Meson, or Autotools.<p>This creates a project file that allows you to use %1 as a code editor and as a launcher for debugging and analyzing tools. If you want to build the project, you might need to edit the generated project file. + Importe les projets existants qui n’utilisent pas qmake, CMake, Qbs, Meson ou Autotools.<p>Cela crée un fichier de projet qui vous permet d’utiliser %1 comme éditeur de code et comme lanceur d’outils de débogage et d’analyse. Si vous souhaitez compiler le projet, vous devrez peut-être modifier le fichier de projet généré. + + + Unknown build system "%1" + Système de compilation inconnu « %1 » + + + Target Settings + Paramètres de la cible + + + Source directory + Répertoire source + + + Build system + Système de compilation + + + Name of current project + Nom du projet actuel + + + Taskhub Error + Erreur Taskhub + + + Taskhub Warning + Avertissement Taskhub + + + Build Issue + Problème de compilation + + + Replacing signature + Remplacement de la signature + + + Xcodebuild failed. + Xcodebuild a échoué. + + + Profile + The name of the profile build configuration created by default for a qmake project. + Profiler + + + Profiling + Profilage + + + "data" must be a JSON object for "VcsConfiguration" pages. + Do not translate "VcsConfiguration", because it is the id of a page. + « data » doit être un objet JSON pour les pages « VcsConfiguration ». + + + "VcsConfiguration" page requires a "vcsId" set. + Do not translate "VcsConfiguration", because it is the id of a page. + La page « VcsConfiguration » nécessite un jeu de « vcsId ». + + + + QtC::Python + + Install %1 + Installer %1 + + + Running "%1" to install %2. + Exécution de « %1 » pour installer %2. + + + The %1 installation was canceled by %2. + L’installation de %1 a été annulée par %2. + + + user + utilisateur + + + time out + délai d’attente + + + Installing the %1 failed with exit code %2 + L’installation de %1 a échoué avec le code de sortie %2 + + + %1 installation missing for %2 (%3) + L’installation %1 est manquante pour %2 (%3) + + + Install %1 for %2 using pip package installer. + Installer %1 pour %2 en utilisant l’installateur de paquets pip. + + + Install + Installer + + + Run PySide6 project tool + Exécuter l’outil de projet PySide6 + + + PySide project tool: + Outil de projet PySide : + + + Enter location of PySide project tool. + Saisir l’emplacement de l’outil de projet PySide. + + + General + Général + + + REPL + REPL + + + Open interactive Python. + Ouvrir un Python interactif. + + + REPL Import File + Fichier d’importation REPL + + + Open interactive Python and import file. + Ouvrir un Python interactif et importer un fichier. + + + REPL Import * + Importation REPL * + + + Open interactive Python and import * from file. + Ouvrir un Python interactif et importer * du fichier. + + + Open interactive Python. Either importing nothing, importing the current file, or importing everything (*) from the current file. + Ouvrir un Python interactif. Soit en n’important rien, soit en important le fichier actuel, soit en important tout (*) du fichier actuel. + + + No Python Selected + Aucun Python n’est sélectionné + + + Manage Python Interpreters + Gérer les interpréteurs Python + + + Python Language Server (%1) + Serveur de langages Python (%1) + + + Install Python language server (PyLS) for %1 (%2). The language server provides Python specific completion and annotation. + Installer le serveur de langages Python (PyLS) pour %1 (%2). Le serveur de langages fournit des complétions et des annotations spécifiques à Python. + + + Unable to open "%1" for reading: %2 + Impossible d’ouvrir « %1 » pour la lecture : %2 + + + Unable to read "%1": The file is empty. + Impossible de lire « %1 » : le fichier est vide. + + + Unable to parse "%1":%2: %3 + Impossible d’analyser « %1 » : %2 : %3 + + + Buffered output + Sortie bufferisée + + + Enabling improves output performance, but results in delayed output. + L’activation améliore les performances de sortie, mais entraîne un retard de la sortie. + + + Script: + Script : + + + Run %1 + Exécuter %1 + + + Name: + Nom : + + + Executable + Exécutable + + + Executable is empty. + L’exécutable est vide. + + + %1 does not exist. + %1 n’existe pas. + + + %1 is not an executable file. + %1 n'est pas un fichier exécutable. + + + &Add + &Ajouter + + + &Delete + &Supprimer + + + &Make Default + &Rendre par défaut + + + &Clean Up + &Nettoyer + + + Remove all Python interpreters without a valid executable. + Supprimer tous les interpréteurs Python qui n’ont pas d’exécutable valide. + + + Interpreters + Interpréteurs + + + Python + Python + + + Plugins: + Greffons : + + + Use Python Language Server + Utiliser le serveur de langages Python + + + For a complete list of available options, consult the <a href="https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md">Python LSP Server configuration documentation</a>. + Pour une liste complète des options disponibles, consultez la <a href="https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md">documentation de configuration du serveur LSP de Python</a>. + + + Advanced + Avancé + + + Language Server Configuration + Configuration du serveur de langages + + + (Windowed) + (Fenêtré) + + + Searching Python binaries... + Recherche des binaires Python… + + + Found "%1" (%2) + « %1 » trouvé (%2) + + + Removing Python + Suppression de Python + + + Python: + Python : + + + + QtC::QbsProjectManager + + Build variant: + Variante de compilation : + + + ABIs: + ABIs : + + + Keep going when errors occur (if at all possible). + Continuer en cas d’erreur (dans la mesure du possible). + + + Parallel jobs: + Jobs en parallèle : + + + Number of concurrent build jobs. + Nombre de jobs de compilation concurrents. + + + Show command lines + Afficher les lignes de commande + + + Install + Installer + + + Clean install root + Nettoyer de la racine de l’installation + + + Force probes + Forcer les sondes + + + No qbs session exists for this target. + Aucune session qbs n’existe pour cette cible. + + + Build canceled: Qbs session failed. + Compilation annulée : la session Qbs a échoué. + + + Installation flags: + Flags d’installation : + + + Installation directory: + Répertoire d’installation : + + + Properties to pass to the project. + Propriétés à transmettre au projet. + + + Use default location + Utiliser l’emplacement par défaut + + + Property "%1" cannot be set here. Please use the dedicated UI element. + La propriété « %1 » ne peut pas être définie ici. Veuillez utiliser l’élément UI dédié. + + + No ":" found in property definition. + Aucun « : » n’a été trouvé dans la définition de la propriété. + + + Properties: + Propriétés : + + + Dry run + Exécution à froid + + + Installing canceled: Qbs session failed. + Installation annulée : la session Qbs a échoué. + + + Keep going + Continuer + + + <b>Qbs:</b> %1 + <b>Qbs :</b> %1 + + + Flags: + Flags : + + + Equivalent command line: + Ligne de commande équivalente : + + + Install root: + Racine de l’installation : + + + Remove first + Retirer en premier + + + Build + Compilation + + + Qbs Build + Compilation Qbs + + + Qbs Clean + Nettoyage Qbs + + + Dry run: + Exécution à froid : + + + Keep going: + Continuer l’exécution : + + + Cleaning canceled: Qbs session failed. + Nettoyage annulé : la session Qbs a échoué. + + + Qbs Install + Installation Qbs + + + Reparse Qbs + Recommencer l’analyse Qbs + + + Build File + Compiler le fichier + + + Build File "%1" + Compiler le fichier « %1 » + + + Ctrl+Alt+B + Ctrl+Alt+B + + + Build Product + Compiler le produit + + + Build Product "%1" + Compiler le produit « %1 » + + + Ctrl+Alt+Shift+B + Ctrl+Alt+Maj+B + + + Clean + Nettoyer + + + Clean Product + Nettoyer le produit + + + Rebuild + Recompiler + + + Rebuild Product + Recompiler le produit + + + Could not split properties. + Impossible de séparer les propriétés. + + + Custom Properties + Propriétés personnalisées + + + Key + Clé + + + Value + Valeur + + + &Remove + &Supprimer + + + &Add + &Ajouter + + + C and C++ compiler paths differ. C compiler may not work. + Les chemins d’accès aux compilateurs C et C++ sont différents. Le compilateur C peut ne pas fonctionner. + + + Configuration name: + Nom de la configuration : + + + The qbs project build root + La racine de compilation du projet qbs + + + Debug + Shadow build directory suffix + Non-ASCII characters in directory suffix may cause build issues. + Debug + + + Release + Shadow build directory suffix + Non-ASCII characters in directory suffix may cause build issues. + Release + + + Profile + Shadow build directory suffix + Non-ASCII characters in directory suffix may cause build issues. + Profile + + + Change... + Modifier… + + + Additional Qbs Profile Settings + Paramètres supplémentaires du profil Qbs + + + Generated files + Fichiers générés + + + Qbs files + Fichiers Qbs + + + Failed to run qbs config: %1 + Échec de l’exécution de la configuration qbs : %1 + + + Profiles + Profils + + + Kit: + Kit : + + + Associated profile: + Profil associé : + + + Profile properties: + Propriétés du profil : + + + E&xpand All + Tout &développer + + + &Collapse All + Tout &réduire + + + Fatal qbs error: %1 + Erreur qbs fatale : %1 + + + Failed + Échec + + + Could not write project file %1. + Impossible d’écrire dans le fichier de projet %1. + + + Reading Project "%1" + Lecture du projet « %1 » + + + Error retrieving run environment: %1 + Erreur dans la réception de l’environnement d’exécution : %1 + + + Qbs + Qbs + + + Received invalid input. + Réception d’une entrée invalide. + + + No qbs executable was found, please set the path in the settings. + Aucun exécutable qbs n’a été trouvé, veuillez définir le chemin d’accès dans les paramètres. + + + The qbs executable was not found at the specified path, or it is not executable ("%1"). + L’exécutable qbs n’a pas été trouvé au chemin spécifié, ou bien ce n’est pas exécutable (« %1 »). + + + The qbs process quit unexpectedly. + Le processus de qbs s’est terminé de façon inattendue. + + + The qbs process failed to start. + Le processus qbs n’a pas démarré. + + + The qbs process sent unexpected data. + Le processus qbs a envoyé des données inattendues. + + + The qbs API level is not compatible with what %1 expects. + Le niveau de l’API qbs n’est pas compatible avec ce que %1 attend. + + + Request timed out. + La demande a expiré. + + + Failed to load qbs build graph. + Échec du chargement du graphe de compilation de qbs. + + + The qbs session is not in a valid state. + La session qbs n’est pas dans un état valide. + + + Failed to update files in Qbs project: %1. +The affected files are: + %2 + Échec de la mise à jour des fichiers dans le projet Qbs : %1. +Les fichiers affectés sont : + %2 + + + Use %1 settings directory for Qbs + Utiliser le répertoire de paramètres %1 pour Qbs + + + Path to qbs executable: + Chemin vers l’exécutable de qbs : + + + Default installation directory: + Répertoire d’installation par défaut : + + + Qbs version: + Version de Qbs : + + + Failed to retrieve version. + Échec de la réception de la version. + + + General + Général + + + + QtC::Qdb + + Device "%1" %2 + + + + Qt Debug Bridge device %1 + + + + Device detection error: %1 + + + + Shutting down device discovery due to unexpected response: %1 + + + + Shutting down message reception due to unexpected response: %1 + + + + QDB message: %1 + + + + Unexpected QLocalSocket error: %1 + + + + Could not connect to QDB host server even after trying to start it. + + + + Invalid JSON response received from QDB server: %1 + + + + Could not find QDB host server executable. You can set the location with environment variable %1. + + + + QDB host server started. + + + + Could not start QDB host server in %1 + + + + Starting QDB host server. + + + + Deploy to Boot2Qt target + + + + Starting command "%1" on device "%2". + + + + Command failed on device "%1": %2 + + + + Command failed on device "%1". + + + + stdout was: "%1" + + + + stderr was: "%1" + + + + Commands on device "%1" finished successfully. + + + + Boot2Qt Device + + + + Reboot Device + + + + Restore Default App + + + + WizardPage + + + + Device Settings + + + + A short, free-text description + + + + Host name or IP address + + + + Device name: + Nom du périphérique : + + + Device address: + Adresse du périphérique : + + + Boot2Qt Network Device Setup + + + + Application set as the default one. + + + + Reset the default application. + + + + Remote process failed: %1 + Échec du processus distant : %1 + + + Set this application to start by default + + + + Reset default application + + + + Change default application + + + + Flash wizard "%1" failed to start. + + + + Flash wizard executable "%1" not found. + + + + Flash Boot to Qt Device + + + + Full command line: + + + + Executable on device: + Exécutable sur le périphérique : + + + Remote path not set + Chemin distant indéfini + + + Executable on host: + Exécutable sur l’hôte : + + + Run on Boot2Qt Device + + + + The remote executable must be set in order to run on a Boot2Qt device. + + + + No device to stop the application on. + + + + Stopped the running application. + + + + Could not check and possibly stop running application. + + + + Checked that there is no running application. + + + + Stop already running application + + + + Boot2Qt: %1 + QtC::QmakeProjectManager - QMake Build Configuration: - Configuration de QMake pour la compilation : + Qt Designer is not responding (%1). + Qt Designer ne répond pas (%1). + + + Unable to create server socket: %1 + Impossible de créer le socket serveur : %1 + + + Unable to start "%1" + Impossible de démarrer « %1 » + + + The application "%1" could not be found. + L’application « %1 » est introuvable. + + + Details + Détails + + + Type + Type + + + General + Général + + + This kit cannot build this project since it does not define a Qt version. + Ce kit ne peut pas compiler ce projet, car il ne définit pas de version de Qt. + + + Run + Exécuter + + + Ignore + Ignorer + + + Use global setting + Utiliser les paramètres généraux + + + qmake system() behavior when parsing: + comportement de qmake system() lors de l’analyse : + + + Error: + Erreur : + + + Warning: + Avertissement : + + + The build directory contains a build for a different project, which will be overwritten. + Le répertoire de compilation contient une compilation pour un autre projet, qui sera écrasée. + + + %1 The build will be overwritten. + %1 error message + %1 La compilation sera écrasée. + + + The build directory should be at the same level as the source directory. + Le répertoire de compilation doit être au même niveau que le répertoire source. + + + Could not parse Makefile. + Impossible d’analyser le fichier Makefile. + + + The Makefile is for a different project. + Le Makefile correspond à un projet différent. + + + The build type has changed. + Le type de compilation a été modifié. + + + The qmake arguments have changed. + Les arguments de qmake ont changé. + + + The mkspec has changed. + Le mkspec a changé. + + + Release + Shadow build directory suffix + Non-ASCII characters in directory suffix may cause build issues. + Release + + + Debug + Shadow build directory suffix + Non-ASCII characters in directory suffix may cause build issues. + Debug + + + Profile + Shadow build directory suffix + Non-ASCII characters in directory suffix may cause build issues. + Profile + + + Run qmake + Exécuter qmake + + + Build + Compilation + + + Build "%1" + Compiler « %1 » + + + Rebuild + Recompiler + + + Clean + Nettoyer + + + Build &Subproject + Compiler le &sous-projet + + + Build &Subproject "%1" + Compiler le &sous-projet « %1 » + + + Rebuild Subproject + Recompiler le sous-projet + + + Clean Subproject + Nettoyer le sous-projet + + + Build File + Compiler le fichier + + + Build File "%1" + Compiler le fichier « %1 » + + + Ctrl+Alt+B + Ctrl+Alt+B + + + Add Library... + Ajouter une bibliothèque… + + + Cannot find Makefile. Check your build settings. + Impossible de trouver un Makefile. Vérifiez vos options de compilation. + + + The build directory is not at the same level as the source directory, which could be the reason for the build failure. + Le répertoire de compilation n’est pas au même niveau que le répertoire source, ce qui pourrait être la raison de l’échec de la compilation. + + + qmake + QMakeStep default display name + qmake + + + Configuration unchanged, skipping qmake step. + Configuration inchangée, étape qmake sautée. + + + No Qt version configured. + Aucune version de Qt n’est configurée. + + + Could not determine which "make" command to run. Check the "make" step in the build configuration. + Impossible de déterminer la commande « make » à exécuter. Vérifier l’étape « make » dans la configuration de la compilation. + + + The process "%1" exited normally. + Le processus « %1 » s’est terminé normalement. + + + The process "%1" exited with code %2. + Le processus « %1 » s’est terminé avec le code %2. + + + Could not start process "%1" %2. + Impossible de démarrer le processus « %1 » %2. + + + The process "%1" crashed. + Le processus « %1 » a planté. + + + <no Qt version> + <pas de version de Qt> + + + <no Make step found> + <pas d’étape Make trouvée> + + + ABIs: + ABIs : + + + QML Debugging + Débogage QML + + + Qt Quick Compiler + Compilateur Qt Quick + + + Separate Debug Information + Séparer les informations de débogage + + + The option will only take effect if the project is recompiled. Do you want to recompile now? + Cette option ne prendra effet que si le projet est recompilé. Voulez-vous le recompiler maintenant ? + + + <b>qmake:</b> No Qt version set. Cannot run qmake. + <b>qmake :</b> Aucune version de Qt définie. qmake ne peut être lancé. + + + <b>qmake:</b> %1 %2 + <b>qmake :</b> %1 %2 + + + QMake + qmake + + + &Sources + &Sources + + + Widget librar&y: + B&ibliothèque de widget : + + + Widget project &file: + Fichier de &projet du widget : + + + Widget h&eader file: + Fichier d’en-&tête du widget : + + + Widge&t source file: + Fichier source du &widget : + + + Widget &base class: + Classe de &base du widget : + + + Plugin class &name: + &Nom de la classe du greffon : + + + Plugin &header file: + Fichier d’&en-tête du greffon : + + + Plugin sou&rce file: + Fichier sou&rce du greffon : + + + Icon file: + Fichier de l’icône : + + + &Link library + &Lier à la bibliothèque + + + Create s&keleton + Créer s&quelette + + + Include pro&ject + Inclure le pro&jet + + + &Description + &Description + + + G&roup: + &Groupe : + + + &Tooltip: + &Info-bulle : + + + W&hat's this: + &Qu’est-ce que c’est ? : + + + The widget is a &container + Le widget est un &conteneur + + + Property defa&ults + Propriétés par défa&ut + + + dom&XML: + dom &XML : + + + Select Icon + Sélectionner une icône + + + Icon files (*.png *.ico *.jpg *.xpm *.tif *.svg) + Fichier d’icône (*.png *.ico *.jpg *.xpm *.tif *.svg) + + + Specify the properties of the plugin library and the collection class. + Spécifiez les propriétés de la bibliothèque du greffon et la classe de collection. + + + Collection class: + Classe de collection : + + + Collection header file: + Fichier d’en-tête de la collection : + + + Collection source file: + Fichier source de la collection : + + + Plugin name: + Nom du greffon : + + + Resource file: + Fichier ressource : + + + icons.qrc + icons.qrc + + + Widget &Classes: + &Classes des widgets : + + + Specify the list of custom widgets and their properties. + Spécifiez la liste des widgets personnalisés et leurs propriétés. + + + <New class> + <Nouvelle classe> + + + Confirm Delete + Confirmez la suppression + + + Delete class %1 from list? + Supprimer la classe %1 de la liste ? + + + Qt Custom Designer Widget + Widget personnalisé pour Qt4 Designer + + + Creates a Qt Custom Designer Widget or a Custom Widget Collection. + Crée un widget personnalisé ou une collection de widgets personnalisés pour Qt4 Designer. + + + This wizard generates a Qt Designer Custom Widget or a Qt Designer Custom Widget Collection project. + lourd ? "contenant un widget ou une collection de widgets, personnalisé pour Qt Designer" ? + Cet assistant génère un projet contenant un widget ou une collection de widgets personnalisés pour Qt Designer. + + + Custom Widgets + Widgets personnalisés + + + Plugin Details + Détails du greffon + + + Creating multiple widget libraries (%1, %2) in one project (%3) is not supported. + Créer de plusieurs bibliothèques de widgets (%1, %2) dans un même projet (%3) n’est pas pris en charge. + + + Debug + Debug + + + Release + Release + + + Reading Project "%1" + Lecture du projet « %1 » + + + Cannot parse project "%1": The currently selected kit "%2" does not have a valid Qt. + Impossible d’analyser le projet « %1 » : le kit « %2 » actuellement sélectionné n’a pas de Qt valide. + + + Cannot parse project "%1": No kit selected. + Impossible d’analyser le projet « %1 » : aucun kit n’est sélectionné. + + + No Qt version set in kit. + Aucune version de Qt définie dans le kit. + + + Qt version is invalid. + La version de Qt est invalide. + + + No C++ compiler set in kit. + Pas de compilateur C++ dans le kit. + + + Project is part of Qt sources that do not match the Qt defined in the kit. + Le projet fait partie de sources Qt qui ne correspondent pas au Qt défini dans le kit. + + + "%1" is used by qmake, but "%2" is configured in the kit. +Please update your kit (%3) or choose a mkspec for qmake that matches your target environment better. + « %1 » est utilisé par qmake, mais « %2 » est configuré dans le kit. +Veuillez mettre à jour votre kit (%3) ou choisir un mkspec pour qmake qui correspond mieux à votre environnement cible. + + + Generate Xcode project (via qmake) + Générer un projet Xcode (via qmake) + + + Generate Visual Studio project (via qmake) + Générer un projet Visual Studio (via qmake) + + + qmake generator failed: %1. + le générateur qmake a échoué : %1. + + + No Qt in kit + Pas de Qt dans le kit + + + No valid qmake executable + Aucun exécutable valide pour qmake + + + No qmake step in active build configuration + Pas d’étape qmake dans la configuration de compilation active + + + Cannot create output directory "%1" + Impossible de créer le répertoire de sortie « %1 » + + + Running in %1: %2 + Exécute dans %1 : %2 + + + Library: + Bibliothèque : + + + Library file: + Fichier de bibliothèque : + + + Include path: + Chemin d’inclusion : + + + Linux + Linux + + + Mac + Mac + + + Windows + Windows + + + Linkage: + Edition de liens : + + + Dynamic + Dynamique + + + Static + Statique + + + Mac: + Mac : + + + Library + Bibliothèque + + + Framework + Framework + + + Windows: + Windows : + + + Platform: + Plateforme : + + + Library inside "debug" or "release" subfolder + Bibliothèque dans le sous-dossier « debug » ou « release » + + + Add "d" suffix for debug version + Ajouter le suffixe « d » pour la version debug + + + Remove "d" suffix for release version + Retirer le suffixe « d » pour la version release + + + Library type: + Type de bibliothèque : + + + Package: + Paquet : + + + Add Library + Ajouter une bibliothèque + + + Summary + Résumé + + + Library Type + Type de bibliothèque + + + Choose the type of the library to link to + Sélectionner le type de bibliothèque pour l’édition de liens + + + System library + Bibliothèque système + + + Links to a system library. +Neither the path to the library nor the path to its includes is added to the .pro file. + Faire un lien vers une bibliothèque système. +Ni le chemin vers la bibliothèque, ni le chemin vers ses inclusion ne seront ajoutés au fichier .pro. + + + System package + Paquet système + + + Links to a system library using pkg-config. + Lie à une bibliothèque système en utilisant pkg-config. + + + External library + Bibliothèque externe + + + Links to a library that is not located in your build tree. +Adds the library and include paths to the .pro file. + Avant : Fait l’édition de liens avec une bibliothèque qui n’est pas dans votre arbre de compilation. +Ajoute la bibliothèque et les chemins d’inclusion dans le fichier .pro. + Faire un lien vers une bibliothèque qui n’est pas dans votre arbre de compilation. +Ajoute la bibliothèque et les chemins d’inclusion dans le fichier .pro. + + + Internal library + Bibliothèque interne + + + Links to a library that is located in your build tree. +Adds the library and include paths to the .pro file. + Faire un lien vers une bibliothèque localisée dans votre arbre de compilation. +Ajoute la bibliothèque et les chemins d’inclusion dans le fichier .pro. + + + System Library + Bibliothèque système + + + Specify the library to link to + Spécifier la bibliothèque vers laquelle faire un lien + + + System Package + Paquet système + + + Specify the package to link to + Spécifie le paquet à lier + + + External Library + Bibliothèque externe + + + Specify the library to link to and the includes path + Spécifier la bibliothèque vers laquelle faire un lien et les chemins d’inclusion + + + Internal Library + Bibliothèque interne + + + Choose the project file of the library to link to + Choisir le fichier projet de la bibliothèque vers laquelle faire un lien + + + The following snippet will be added to the<br><b>%1</b> file: + L’extrait de code suivant va être ajouté au <br> fichier <b>%1</b> : + + + %1 Dynamic + %1, c'est linkage(tr("Linkage:")), donc "edition de lien". + %1 dynamique + + + %1 Static + %1 statique + + + %1 Framework + traduire framework ? pas certain que ça ait un sens en français dans le context OSX. John : non on ne traduit pas + Framework %1 + + + %1 Library + On inverse l'ordre non ? + Bibliothèque %1 + + + Subdirs Project + Projet de sous-répertoires + + + Creates a qmake-based subdirs project. This allows you to group your projects in a tree structure. + Crée un projet de sous-répertoires fondé sur qmake. Ceci vous permet de grouper vos projets dans une structure arborescente. + + + Done && Add Subproject + Fait et ajouter le sous-projet + + + Finish && Add Subproject + Terminé et ajouter le sous-projet + + + New Subproject + Title of dialog + Nouveau sous-projet + + + Error while parsing file %1. Giving up. + Erreur pendant l’analyse du fichier %1. Abandon. + + + Headers + En-têtes + + + Sources + Sources + + + Forms + Formulaires + + + State charts + Diagramme d’état + + + Resources + Ressources + + + QML + QML + + + Other files + Autres fichiers + + + Generated Files + Fichiers générés + + + Failed + Échec + + + Could not write project file %1. + Impossible d’écrire dans le fichier de projet %1. + + + File Error + Erreur de fichier + + + Could not find .pro file for subdirectory "%1" in "%2". + Impossible de trouver le fichier .pro pour le sous-répertoire « %1 » dans « %2 ». + + + qmake build configuration: + Configuration de qmake pour la compilation : + + + Additional arguments: + Arguments supplémentaires : + + + Effective qmake call: + Appels qmake : + + + The mkspec to use when building the project with qmake.<br>This setting is ignored when using other build systems. + Le mkspec à utiliser lors de la compilation du projet avec qmake.<br>Ce paramètre est ignoré lors de l’utilisation avec d’autres systèmes de compilation. + + + Qt mkspec + mkspec de Qt + + + No Qt version set, so mkspec is ignored. + Aucune version de Qt définie, mkspec est donc ignoré. + + + Mkspec not found for Qt version. + Aucun mkspec trouvé pour cette version de Qt. + + + mkspec + mkspec + + + Mkspec configured for qmake by the kit. + Mkspec configuré pour qmake par le kit. + + + Warn if a project's source and build directories are not at the same level + Avertir si les répertoires source et de compilation d’un projet ne sont pas au même niveau + + + Qmake has subtle bugs that can be triggered if source and build directory are not at the same level. + Qmake souffre de bogues subtils qui peuvent apparaitre si le répertoire source et le répertoire de compilation ne sont pas au même niveau. + + + Run qmake on every build + Exécuter qmake à chaque compilation + + + This option can help to prevent failures on incremental builds, but might slow them down unnecessarily in the general case. + Cette option permet d’éviter les échecs des compilations incrémentales, mais risque de les ralentir inutilement dans le cas général. + + + Ignore qmake's system() function when parsing a project + Ignorer la fonction system() de qmake lors de l’analyse d’un projet + + + Checking this option avoids unwanted side effects, but may result in inexact parsing results. + Cocher cette option permet d’éviter les effets secondaires indésirables, mais peut entraîner des résultats d’analyse inexacts. + + + Qmake + Qmake + + + Required Qt features not present. + Les fonctionnalités de Qt requises ne sont pas présentes. + + + Qt version does not target the expected platform. + La version de Qt ne correspond pas à la plateforme attendue. + + + Qt version does not provide all features. + La version de Qt n’offre pas toutes les fonctionnalités. + + + This wizard generates a Qt Subdirs project. Add subprojects to it later on by using the other wizards. + Cet assistant génère un projet de sous-répertoires Qt. Ajoutez-y ultérieurement des sous-projets en utilisant les autres assistants. - QObject + QtC::QmlDebug - Pass - Succès + The port seems to be in use. + Error message shown after 'Could not connect ... debugger:" + Le port semble déjà utilisé. - Expected Failure - Échec attendu + The application is not set up for QML/JS debugging. + Error message shown after 'Could not connect ... debugger:" + L’application n’est pas configurée pour du débogage QML/JS. - Failure - Échec + Socket state changed to %1 + L’état de la socket a changé en %1 - Expected Pass - Succès attendu + Error: %1 + Erreur : %1 - Warning - Avertissement + Debug connection opened. + - Qt Warning - Avertissements Qt (niveau Warning) + Debug connection closed. + - Qt Debug - Debogage Qt (niveau Debug) - - - Critical - Critique (niveau critical) - - - Fatal - Fatal - - - Skipped - Passé - - - Info - Info + Debug connection failed. + - QTestLib::Internal::QTestOutputPane + QtC::QmlDesigner - Test Results - Résultats des tests + Error + Erreur + + + + QtC::QmlEditorWidgets + + Text + Texte - Result - Résultat + Style + Style + + + Stretch vertically. Scales the image to fit to the available area. + Étirer verticalement. Redimensionne l’image pour qu’elle occupe l’espace disponible. + + + Repeat vertically. Tiles the image until there is no more space. May crop the last image. + tronquée ? rognée ? john :rognée + Répéter verticalement. Répète l’image en utilisant tout l’espace disponible. Il se peut que la dernière image soit rognée. + + + Double click for preview. + Double-cliquer pour l’aperçu. + + + Round. Like Repeat, but scales the images down to ensure that the last image is not cropped. + Arrondir. Comme répéter mais redimensionne les images afin de s’assurer que la dernière ne soit pas rognée. + + + Repeat horizontally. Tiles the image until there is no more space. May crop the last image. + Répéter horizontalement. Répète l’image en utilisant tout l’espace disponible. Il se peut que la dernière image soit rognée. + + + Stretch horizontally. Scales the image to fit to the available area. + Étirer horizontalement. Redimensionne l’image pour qu’elle occupe l’espace disponible. + + + The image is scaled to fit. + + + + The image is stretched horizontally and tiled vertically. + + + + The image is stretched vertically and tiled horizontally. + + + + The image is duplicated horizontally and vertically. + + + + The image is scaled uniformly to fit without cropping. + + + + The image is scaled uniformly to fill, cropping if necessary. + + + + Gradient + Dégradé + + + Color + Couleur + + + Border + Bordure + + + Easing + Amortissement + + + Subtype + Sous-type + + + Duration + Durée + + + Play simulation. + + + + Type of easing curve. + + + + Acceleration or deceleration of easing curve. + + + + ms + ms + + + Duration of animation. + + + + Amplitude of elastic and bounce easing curves. + + + + Easing period of an elastic curve. + + + + Easing overshoot for a back curve. + + + + Amplitude + Amplitude + + + Period + Période + + + Overshoot + Dépasser + + + Hides this toolbar. + Cache cette barre d’outils. + + + Pin Toolbar + Épingler la barre d’outils + + + Show Always + Toujours montrer + + + Unpins the toolbar and moves it to the default position. + Détacher la barre d’outils et déplacer la à sa position par défaut. + + + Hides this toolbar. This toolbar can be permanently disabled in the options page or in the context menu. + Cache cette barre d’outils. Cette barre d’outils peut être désactivée définitivement dans la page des options ou dans le menu contextuel. + + + Open File + Ouvrir le fichier + + + + QtC::QmlJS + + 'int' or 'real' + « int » ou « real » + + + Hit maximal recursion depth in AST visit. + + + + package import requires a version number + l’importation d’un paquet a besoin d’un numéro de version + + + Nested inline components are not supported + + + + Errors while loading qmltypes from %1: +%2 + Erreurs lors du chargement de qmltypes depuis %1 : +%2 + + + Warnings while loading qmltypes from %1: +%2 + Avertissements lors du chargement de qmltypes depuis %1 : +%2 + + + Could not parse document. + Impossible d’analyser le document. + + + Expected a single import. + Un seul import est attendu. + + + Expected import of QtQuick.tooling. + Un import de QtQuick.tooling est attendu. + + + Expected document to contain a Module {} member. + Un document contenant un membre Module {} est attendu. + + + Component definition is missing a name binding. + Une liaison de nom est manquant dans la définition du composant. + + + ModuleApi definition has no or invalid version binding. + La définition du ModuleApi ne possède pas de liaison de version ou celle-ci est invalide. + + + Method or signal is missing a name script binding. + Il manque une méthode ou un signal dans la liaison de script de nom. + + + Expected script binding. + Une liaison de script est attendu. + + + Property object is missing a name or type script binding. + Il manque une liaison de script de nom ou de type dans un objet propriété. + + + Major version different from 1 not supported. + + + + Expected dependency definitions + + + + Expected string after colon. + Une chaîne est attendue après la virgule. + + + Expected boolean after colon. + Un booléen est attendu après la virgule. + + + Expected true or false after colon. + Vrai ou faux est attendu après la virgule. + + + Expected numeric literal after colon. + Un littéral numérique est attendu après la virgule. + + + Expected integer after colon. + Un entier est attendu après la virgule. + + + Expected array of strings after colon. + Un tableau de chaînes est attendu après la virgule. + + + Expected array literal with only string literal members. + Un littéral tableau contenant que des littérals chaînes est attendu. + + + Expected string literal to contain 'Package/Name major.minor' or 'Name major.minor'. + Une chaîne littérale qui contient « Paquet/Nom majeur.mineur » ou « Nom majeur.mineur » est attendu. + + + Expected array of numbers after colon. + Un tableau de nombres est attendu après la virgule. + + + Expected array literal with only number literal members. + Un littéral tableau avec uniquement des membres littérals numérique est attendu. + + + Meta object revision without matching export. + Révision du méta-objet sans exportation correspondante. + + + Expected integer. + Un entier est attendu. + + + Expected object literal after colon. + Un littéral objet est attendu après la virgule. + + + Expected expression after colon. + + + + Expected strings as enum keys. + + + + Expected either array or object literal as enum definition. + + + + The type will only be available in the QML editors when the type name is a string literal. + + + + The module URI cannot be determined by static analysis. The type will not be available +globally in the QML editor. You can add a "// @uri My.Module.Uri" annotation to let +the QML editor know about a likely URI. + + + + must be a string literal to be available in the QML editor + doit être une chaîne de caractères afin d’être disponible dans l’éditeur QML + + + Cannot find file %1. + Impossible de trouver le fichier %1. + + + Expected document to contain a single object definition. + Le document ne devrait contenir qu’une seule définition d’objet. + + + Expected expression statement after colon. + Expression attendue après les deux points. + + + Property is defined twice, previous definition at %1:%2 + + + + Invalid value for enum. + Valeur invalide pour une énumération. + + + Enum value must be a string or a number. + La valeur d’une énumération doit être une chaîne de caractères ou un nombre. + + + Number value expected. + Valeur numérique attendue. + + + Boolean value expected. + Valeur binaire attendue. + + + String value expected. + Chaîne de caractères attendue. + + + Invalid URL. + URL invalide. + + + File or directory does not exist. + Le fichier ou le répertoire n’existe pas. + + + Invalid color. + Couleur invalide. + + + Anchor line expected. + Ligne d’ancrage attendue. + + + Duplicate property binding. + Lien de propriété dupliquée. + + + Id expected. + Identifiant attendu. + + + Invalid id. + Identifiant invalide. + + + Duplicate id. + ID dupliqué. + + + Assignment in condition. + Assignation dans une condition. + + + Unterminated non-empty case block. + Bloc case non vide et non terminé. + + + Do not use 'eval'. + Ne pas utiliser « eval ». + + + Unreachable. + Inatteignable. + + + Do not use 'with'. + Ne pas utiliser « with ». + + + Do not use comma expressions. + Ne pas utiliser les expressions séparées par des virgules. + + + Unnecessary message suppression. + Suppression d’un message inutile. + + + The 'function' keyword and the opening parenthesis should be separated by a single space. + Le mot-clé « function » et la parenthèse ouvrante doivent être séparés par une seule espace. + + + Do not use stand-alone blocks. + Ne pas utiliser de blocs indépendants. + + + Do not use void expressions. + Ne pas utiliser les expressions void. + + + Confusing pluses. + Signe plus prêtant à confusion. + + + Confusing minuses. + Signe moins prêtant à confusion. + + + Declare all function vars on a single line. + Déclarez toutes les variables de fonction sur une seule ligne. + + + Unnecessary parentheses. + Parenthèses non nécessaires. + + + == and != may perform type coercion, use === or !== to avoid it. + == et != peuvent provoquer une coercition de type, utilisez === ou !== pour l’éviter. + + + Could not resolve the prototype "%1" of "%2". + + + + Could not resolve the prototype "%1". + + + + Prototype cycle, the last non-repeated component is "%1". + + + + Invalid property type "%1". + + + + == and != perform type coercion, use === or !== to avoid it. + == et != provoquent une coercition de type, utilisez === ou !== pour l’éviter. + + + Expression statements should be assignments, calls or delete expressions only. + Les définitions d’expression devraient être des expression d’assignation, d’appel ou de suppression uniquement. + + + Do not use "%1" as a constructor. + +For more information, see the "Checking Code Syntax" documentation. + + + + Invalid property name "%1". + + + + "%1" does not have members. + + + + "%1" is not a member of "%2". + + + + "%1" already is a formal parameter. + + + + "%1" already is a function. + + + + var "%1" is used before its declaration. + + + + "%1" already is a var. + + + + "%1" is declared more than once. + + + + Function "%1" is used before its declaration. + + + + Place var declarations at the start of a function. + Les déclarations devraient être au début d’une fonction. + + + Use only one statement per line. + Utiliser seulement une déclaration par ligne. + + + Unknown component. + Composant inconnu. + + + Missing property "%1". + + + + Imperative code is not supported in Qt Design Studio. + + + + This type (%1) is not supported in Qt Design Studio. + + + + Reference to parent item cannot be resolved correctly by Qt Design Studio. + + + + This visual property binding cannot be evaluated in the local context and might not show up in Qt Design Studio as expected. + + + + Qt Design Studio only supports states in the root item. + + + + This id might be ambiguous and is not supported in Qt Design Studio. + + + + This type (%1) is not supported as a root element by Qt Design Studio. + + + + This type (%1) is not supported as a root element of a UI file (.ui.qml). + + + + This type (%1) is not supported in a UI file (.ui.qml). + + + + Functions are not supported in a UI file (.ui.qml). + + + + JavaScript blocks are not supported in a UI file (.ui.qml). + + + + Behavior type is not supported in a UI file (.ui.qml). + + + + States are only supported in the root item in a UI file (.ui.qml). + + + + Referencing the parent of the root item is not supported in a UI file (.ui.qml). + + + + Do not mix translation functions in a UI file (.ui.qml). + + + + A State cannot have a child item (%1). + + + + Duplicate import (%1). + + + + Hit maximum recursion limit when visiting AST. + + + + Type cannot be instantiated recursively (%1). + + + + Logical value does not depend on actual values. + + + + Components are only allowed to have a single child element. + + + + Components require a child element. + + + + Do not reference the root item as alias. + + + + Avoid referencing the root item in a hierarchy. + + + + Calls of functions that start with an uppercase letter should use 'new'. + Les appels de fonctions qui commence par une lettre majuscule devrait utiliser « new ». + + + Use 'new' only with functions that start with an uppercase letter. + « new » ne devrait être utilisé qu’avec des fonctions qui commence par une lettre majuscule. + + + Use spaces around binary operators. + Utilisez des espaces autour des opérateurs binaires. + + + Unintentional empty block, use ({}) for empty object literal. + Bloc vide involontaire, utilisez ({}) pour les objets vides. + + + Use %1 instead of 'var' or 'variant' to improve performance. + Utilisez %1 à la place de « var » ou « variant » pour améliorer les performances. + + + Object value expected. + Valeur objet attendue. + + + Array value expected. + Valeur de tableau attendue. + + + %1 value expected. + Valeur %1 attendue. + + + Maximum number value is %1. + La valeur maximale est %1. + + + Minimum number value is %1. + La valeur minimale est %1. + + + Maximum number value is exclusive. + La valeur maximale est exclusive. + + + Minimum number value is exclusive. + La valeur minimale est exclusive. + + + String value does not match required pattern. + La valeur de la chaîne de caractères ne correspond pas au format requis. + + + Minimum string value length is %1. + La longueur de la chaîne de caractères est d’au moins %1. + + + Maximum string value length is %1. + La longueur de la chaîne de caractères est d’au plus %1. + + + %1 elements expected in array value. + %1 éléments attendus dans la valeur du tableau. + + + File or directory not found. + + + + QML module not found (%1). + +Import paths: +%2 + +For qmake projects, use the QML_IMPORT_PATH variable to add import paths. +For Qbs projects, declare and set a qmlImportPaths property in your product to add import paths. +For qmlproject projects, use the importPaths property to add import paths. +For CMake projects, make sure QML_IMPORT_PATH variable is in CMakeCache.txt. +For qmlRegister... calls, make sure that you define the Module URI as a string literal. + + + + + Implicit import '%1' of QML module '%2' not found. + +Import paths: +%3 + +For qmake projects, use the QML_IMPORT_PATH variable to add import paths. +For Qbs projects, declare and set a qmlImportPaths property in your product to add import paths. +For qmlproject projects, use the importPaths property to add import paths. +For CMake projects, make sure QML_IMPORT_PATH variable is in CMakeCache.txt. + + + + + QML module contains C++ plugins, currently reading type information... %1 + + + + Parsing QML Files + Analyse des fichiers QML + + + Scanning QML Imports + Scan des importations QML + + + QML module does not contain information about components contained in plugins. + +Module path: %1 +See "Using QML Modules with Plugins" in the documentation. + + + + Automatic type dump of QML module failed. +Errors: +%1 + Échec du collecteur de type automatique du module QML. +Erreurs : +%1 + + + Automatic type dump of QML module failed. +First 10 lines or errors: + +%1 +Check General Messages for details. + + + + Warnings while parsing QML type information of %1: +%2 + + + + "%1" failed to start: %2 + « %1 » n’a pas pu démarrer : %2 + + + "%1" crashed. + « %1 » a planté. + + + "%1" timed out. + « %1 » a expiré. + + + I/O error running "%1". + Erreur E/S lors de l’exécution de « %1 ». + + + "%1" returned exit code %2. + « %1 » a retourné le code %2. + + + Arguments: %1 + Arguments : %1 + + + Failed to parse "%1". +Error: %2 + Impossible d’analyser « %1 » +Erreur : %2 + + + Errors while reading typeinfo files: + Erreurs lors de la lecture des fichiers d’informations sur les types : + + + Could not locate the helper application for dumping type information from C++ plugins. +Please build the qmldump application on the Qt version options page. + Impossible de trouver l’application d’aide pour la réception des informations sur les types à partir des plugins C++. +Veuillez compiler l’application qmldump à partir de la page d’options à propos de la version de Qt. + + + XML error on line %1, col %2: %3 + + + + The <RCC> root element is missing. + L’élément racine <RCC> est manquant. + + + + QtC::QmlJSEditor + + QML + SnippetProvider + QML + + + Run Checks + Exécuter les vérifications + + + Ctrl+Shift+C + Ctrl+Maj+C + + + Reformat File + Reformater le fichier + + + Inspect API for Element Under Cursor + Inspecter l’API pour l’élément sous le curseur + + + QML + QML + + + QML Analysis + Analyse QML + + + Show Qt Quick Toolbar + Montrer la barre d’outils Qt Quick + + + Library at %1 + Bibliothèque à %1 + + + Dumped plugins successfully. + Création d’un dump des greffons avec succès. + + + Read typeinfo files successfully. + Lecture du fichier typeinfo avec succès. + + + Enable auto format on file save + + + + Restrict to files contained in the current project + + + + Use custom command instead of built-in formatter + + + + Command: + Commande : + + + Arguments: + + + + Auto-fold auxiliary data + + + + Always Ask + Demander quoi faire + + + Qt Design Studio + + + + Qt Creator + Qt Creator + + + Use qmlls (EXPERIMENTAL!) + + + + Always use latest qmlls + + + + Automatic Formatting on File Save + + + + Qt Quick Toolbars + Barres d’outils Qt Quick + + + Features + + + + Open .ui.qml files with: + + + + Language Server + + + + QML/JS Editing + + + + Always show Qt Quick Toolbar + Toujours afficher la barre d’outils Qt Quick + + + Pin Qt Quick Toolbar + "Pin" -> épingler (utilisé dans d'autres traductions) + Épingler la barre d’outils Qt Quick + + + Move Component into Separate File + Déplace le composant dans un fichier séparé + + + Component Name + + + + ui.qml file + + + + Component name: + Nom du composant : + + + Path: + Chemin : + + + Property assignments for %1: + + + + Invalid component name. + + + + Invalid path. + + + + Component already exists. + Le composant existe déjà. + + + QML/JS Usages: + Utilisations QML/JS : + + + Searching for Usages + + + + Show All Bindings + myzu : faut-il traduire binding ? John : Non + Montrer tous les bindings + + + Split Initializer + Fractionner l’initialisation + + + Show Qt Quick ToolBar + Montrer la barre d’outils Qt Quick + + + Code Model Not Available + + + + Code model not available. + + + + Code Model of %1 + + + + Refactoring + Refactoriser + + + Expand All + Tout développer + + + Collapse All + Tout réduire + + + Add a Comment to Suppress This Message + Ajouter un commentaire pour supprimer ce message + + + Wrap Component in Loader + wrap en "enveloppez" = bof ; Component et Loader en majuscule = correspond à des noms de modules ? (et ne pas traduire alors ?) + Envelopper le composant dans un chargeur + + + // TODO: Move position bindings from the component to the Loader. +// Check all uses of 'parent' inside the root element of the component. + // À faire : Déplacer les liaisons de position du composant dans le Loader. +// Vérifier toutes les utilisations de « parent » à l’intérieur de l’élément racine du composant. + + + // Rename all outer uses of the id "%1" to "%2.item". + + + + // Rename all outer uses of the id "%1" to "%2.item.%1". + + + + + This file should only be edited in <b>Design</b> mode. + + + + Switch Mode + + + + Code Model Warning + + + + Code Model Error + + + + Qmlls (%1) + + + + + QtC::QmlJSTools + + QML Functions + Fonctions QML + + + Code Style + Style de code + + + &QML/JS + &QML/JS + + + Reset Code Model + Restaurer le modèle de code + + + Global + Settings + Globale + + + Qt + Qt + + + Old Creator + Ancien Creator + + + Qt Quick + Qt Quick + + + Qml JS Code Style + + + + &Line length: + + + + + QtC::QmlPreview + + QML Preview + Aperçu QML + + + Preview changes to QML code live in your application. + Prévisualiser les modifications apportées au code QML en direct dans votre application. + + + Preview File + Prévisualiser le fichier + + + + QtC::QmlProfiler + + QML Profiler + Profileur QML + + + &Port: + &Port : + + + Start QML Profiler + Démarrer le profileur QML + + + Select an externally started QML-debug enabled application.<p>Commonly used command-line arguments are: + + + + Kit: + Kit : + + + Source code not available + Code source non disponible + + + Calls + Appels + + + Allocations + Allocations + + + Memory + Mémoire + + + Various Events + Évènements divers + + + others + autres + + + The QML Profiler can be used to find performance bottlenecks in applications using QML. + Le profileur QML peut être utilisé pour trouver les goulots d’étranglement des applications QML. + + + QML Profiler Options + Options de profilage pour QML + + + Load QML Trace + Charger une trace QML + + + QML Profiler (Attach to Waiting Application) + Profileur QML (attacher à l’application en attente) + + + Save QML Trace + Enregistrer la trace QML + + + Application finished before loading profiled data. +Please use the stop button instead. + L’application s’est terminée avant le chargement des données de profilage. +Veuillez utiliser le bouton d’arrêt à la place. + + + Search timeline event notes. + + + + Hide or show event categories. + + + + Disable Profiling + + + + Enable Profiling + + + + A QML Profiler analysis is still in progress. + Une analyse avec le profileur QML est toujours en cours. + + + Start QML Profiler analysis. + Démarrer une analyse avec le profileur QML. + + + The application finished before a connection could be established. No data was loaded. + + + + Could not connect to the in-process QML profiler within %1 s. +Do you want to retry and wait %2 s? + + + + Failed to connect. + + + + %1 s + %1 s + + + Elapsed: %1 + Écoulé : %1 + + + QML traces (*%1 *%2) + Traces QML (*%1 *%2) + + + Saving Trace Data + Enregistrement des données de traçage + + + Loading Trace Data + Chargement des données de traçage + + + You are about to discard the profiling data, including unsaved notes. Do you want to continue? + + + + Starting a new profiling session will discard the previous data, including unsaved notes. +Do you want to save the data first? + + + + Discard data + Abandonner les données + + + Pixmap Cache + + + + Scene Graph + + + + Painting + Dessin + + + Compiling + Compilation + + + Creating + Création + + + Handling Signal + Gestion du signal + + + Input Events + + + + Debug Messages + + + + Quick3D + + + + Failed to replay QML events from stash file. + + + + anonymous function + + + + Cannot open temporary trace file to store events. + + + + Failed to reset temporary trace file. + + + + Failed to flush temporary trace file. + + + + Could not re-open temporary trace file. + + + + Read past end in temporary trace file. + + + + Statistics + + + + Copy Row + Copier la ligne + + + Copy Table + Copier la table + + + Extended Event Statistics + Statistiques d’évènements étendues + + + Location + Emplacement + + + Memory Allocation + + + + Memory Usage + + + + Memory Allocated + + + + Memory Freed + + + + Total + + + + %n byte(s) + + + + + + + Allocated + + + + Deallocated + + + + Deallocations + + + + Heap Allocation + + + + Large Item Allocation + + + + Heap Usage + + + + Type + Type + + + Time in Percent + Temps en pourcentage + + + Total Time + Temps total + + + Self Time in Percent + Contexte de "self" ? + Temps interne en pourcentage + + + Self Time + Contexte de "self" ? + Temps interne + + + Mean Time + Temps moyen + + + Median Time + Temps médian + + + Longest Time + Plus long temps + + + Main program + + + + +%1 in recursive calls + + + + Shortest Time + Plus court temps + + + called recursively + + + + Details + Détails + + + Could not re-read events from temporary trace file: %1 + + + + Create + Créer + + + Binding + Vérifier le contexte + Liaison + + + Signal + Signal + + + Callee + Appelé + + + Caller + Appelant + + + Callee Description + Description de l’appelé + + + Caller Description + Description de l’appelant + + + <bytecode> + <bytecode> + + + Main Program + Programme principal + + + Profiling application: %n events + + + + + + + Profiling application + Profilage de l’application + + + No QML events recorded + Aucun évènement QML enregistré + + + Loading buffered data: %n events + + + + + + + Loading offline data: %n events + + + + + + + Waiting for data + + + + Analyze Current Range + + + + Analyze Full Range + + + + Reset Zoom + Réinitialiser le zoom + + + Timeline + Ligne du temps + + + JavaScript + JavaScript + + + Animations + Animations + + + GUI Thread + + + + Render Thread + + + + Framerate + + + + Context + + + + Error while parsing trace data file: %1 + Erreur pendant l’analyse du fichier de données de traçage : %1 + + + Invalid magic: %1 + + + + Unknown data stream version: %1 + + + + Excessive number of event types: %1 + + + + Invalid type index %1 + + + + Corrupt data before position %1. + + + + Error writing trace file. + Erreur lors de l’écriture du fichier de traces. + + + Could not re-read events from temporary trace file: %1 +Saving failed. + + + + Compile + Compilation + + + Debug Message + + + + Warning Message + + + + Critical Message + + + + Fatal Message + + + + Info Message + + + + Unknown Message %1 + + + + Timestamp + Message - Message - - - - QTestLib::Internal::QTestOutputWidget - - All Incidents - Tout les incidents + Message - Show Only: - Afficher seulement : + Flame Graph + + + + Show Full Range + + + + Reset Flame Graph + + + + Mouse Events + + + + Keyboard Events + + + + Key Press + + + + Key Release + + + + Key + Clé + + + Modifiers + + + + Double Click + + + + Mouse Press + + + + Mouse Release + + + + Button + Bouton + + + Result + Résultat + + + Mouse Move + + + + X + + + + Y + + + + Mouse Wheel + + + + Angle X + + + + Angle Y + + + + Keyboard Event + + + + Mouse Event + + + + Unknown + Inconnue + + + Cache Size + + + + Image Cached + + + + Image Loaded + + + + Load Error + + + + Duration + Durée + + + File + Fichier + + + Width + Largeur + + + Height + Hauteur + + + QML Profiler Settings + Paramètres du profileur QML + + + Flush data while profiling: + + + + Periodically flush pending data to the profiler. This reduces the delay when loading the +data and the memory usage in the application. It distorts the profile as the flushing +itself takes time. + + + + Flush interval (ms): + + + + Process data only when process ends: + + + + Only process data when the process being profiled ends, not when the current recording +session ends. This way multiple recording sessions can be aggregated in a single trace, +for example if multiple QML engines start and stop sequentially during a single run of +the program. + + + + Frame + Cadre + + + Frame Delta + + + + View3D + + + + All + Tout + + + None + Aucune + + + Quick3D Frame + + + + Select View3D + + + + Compare Frame + + + + Render Frame + + + + Synchronize Frame + + + + Prepare Frame + + + + Mesh Load + + + + Custom Mesh Load + + + + Texture Load + + + + Generate Shader + + + + Load Shader + + + + Particle Update + + + + Render Call + + + + Render Pass + + + + Event Data + + + + Mesh Memory consumption + + + + Texture Memory consumption + + + + Mesh Unload + + + + Custom Mesh Unload + + + + Texture Unload + + + + Unknown Unload Message %1 + + + + Description + Description + + + Count + + + + Draw Calls + + + + Render Passes + + + + Total Memory Usage + + + + Primitives + + + + Instances + + + + Render Thread Details + + + + Polish + + + + Wait + + + + GUI Thread Sync + + + + Render Thread Sync + + + + Render + + + + Swap + + + + Render Preprocess + + + + Render Update + + + + Render Bind + + + + Render Render + + + + Material Compile + + + + Glyph Render + + + + Glyph Upload + + + + Texture Bind + + + + Texture Convert + + + + Texture Swizzle + + + + Texture Upload + + + + Texture Mipmap + + + + Texture Delete + + + + Stage + + + + Glyphs + QtC::QmlProjectManager - QML Application - Application QML + Error while loading project file %1. + Erreur lors du chargement du fichier de projet %1. - Creates a QML application. - Créer une application QML. + Warning while loading project file %1. + Avertissement lors du chargement du fichier de projet %1. - Projects - Projets + Kit has no device. + Le kit n’a pas de périphérique. - The project %1 could not be opened. - Le projet %1 n'a pas pu être ouvert. + Qt version is too old. + La version de Qt est trop vieille. - New QML Project - Nouveau projet QML + Qt version has no QML utility. + La version Qt n’a pas d’utilitaire QML. - This wizard generates a QML application project. - Cet assistant génère un projet pour une application QML. + Non-desktop Qt is used with a desktop device. + Qt non desktop est utilisé avec un périphérique desktop. - Import of existing QML directory - Importer un répertoire QML existant + No Qt version set in kit. + Pas de version de Qt définie dans le kit. - Creates a QML project from an existing directory of QML files. - Crée un projet QML à partir d'un répertoire existant de fichiers QML. + <Current File> + <Fichier actuel> - Import of QML Project - Importation de projet QML + Main QML file: + Fichier QML principal : - QML Project - Projet QML + Override device QML viewer: + Écraser l’afficheur QML du périphérique : - Project name: - Nom du projet : + System Environment + Environnement du système - Location: - Emplacement : + Clean Environment + Environnement vierge - QML Viewer arguments: - Arguments du visualisateur QML : + QML Utility + QMLRunConfiguration display name. + Utilitaire QML - Main QML File: - Fichier QML principal : + No script file to execute. + Aucun fichier de script à exécuter. + + + No QML utility found. + Aucun utilitaire QML n’a été trouvé. + + + No QML utility specified for target device. + Aucun utilitaire QML n’est spécifié pour le périphérique cible. + + + Qt Version: + Version de Qt : + + + QML Runtime + Runtime QML + + + Invalid root element: %1 + L’élément racine est invalide : %1 + + + No Qt Design Studio installation found + Aucune installation de Qt Design Studio n’a été trouvée + + + Would you like to install it now? + Voulez-vous l’installer maintenant ? + + + Install + Installer + + + Unknown + Inconnu + + + QML PROJECT FILE INFO + QML PROJECT FILE INFO + + + Qt Version - + Version de Qt - + + + Qt Design Studio Version - + Version de Qt Design Studio - + + + No QML project file found - Would you like to create one? + Aucun fichier de projet QML n’a été trouvé - Voulez-vous en créer un ? + + + Generate + Générer + + + Qt Design Studio + Qt Design Studio + + + Open with Qt Design Studio + Ouvrir avec Qt Design Studio + + + Open + Ouvrir + + + Open with Qt Creator - Text Mode + Ouvrir avec Qt Creator - Mode texte + + + Remember my choice + Se rappeler de mon choix + + + Select Files to Generate + Sélectionner les fichiers à générer + + + Start CMakeFiles.txt generation + Lancer la génération de CMakeFiles.txt + + + Advanced Options + Options avancées + + + File %1 will be created. + + Le fichier %1 sera créé. + + + + File %1 will be overwritten. + + Le fichier %1 sera écrasé. + + + + This file already exists and will be overwritten. + Ce fichier existe déjà et sera écrasé. + + + This file or folder will be created. + Ce fichier ou dossier sera créé. + + + Export as Latest Project Format... + Exporter au format du projet le plus récent… + + + Creating Project + Création du projet + + + Creating project failed. +%1 + Échec de la création du projet. +%1 + + + Creating project succeeded. + Création du projet réussie. + + + Unable to write to directory +%1. + Impossible d’écrire dans le répertoire +%1. + + + This process creates a copy of the existing project. The new project's folder structure is adjusted for CMake build process and necessary related new files are generated. + +The new project can be opened in Qt Creator using the main CMakeLists.txt file. + Ce processus crée une copie du projet existant. La structure des dossiers du nouveau projet est adaptée au processus de compilation de CMake et les nouveaux fichiers nécessaires sont générés. + +Le nouveau projet peut être ouvert dans Qt Creator en utilisant le fichier principal CMakeLists.txt. + + + Name: + Nom de fichier : + + + Create in: + Créer dans : + + + Name is empty. + Le nom de fichier est vide. + + + Name must not start with "%1". + Le nom de fichier ne doit pas commencer par « %1 ». + + + Name must begin with a capital letter + Le nom de fichier doit commencer par une lettre majuscule + + + Name must contain only letters, numbers or characters - _. + Le nom de fichier ne doit contenir que des lettres, des chiffres ou des caractères - _. + + + Target is not a directory. + La cible n’est pas un répertoire. + + + Cannot write to target directory. + Impossible d’écrire dans le répertoire cible. + + + Project directory already exists. + Le répertoire du projet existe déjà. + + + Generate CMake Build Files... + Générer des fichiers de compilation CMake… + + + Export Project + Exporter le projet + + + The project is not properly structured for automatically generating CMake files. + +Aborting process. + +The following files or directories are missing: + +%1 + Le projet n’est pas correctement structuré pour générer automatiquement des fichiers CMake. + +Abandon du processus. + +Les fichiers ou répertoires suivants sont manquants : + +%1 + + + Cannot Generate CMake Files + Impossible de générer les fichiers CMake + + + Qt 6 + Qt 6 + + + Qt 5 + Qt 5 + + + Use MultiLanguage in 2D view + Utiliser MultiLanguage dans la vue 2D + + + Reads translations from MultiLanguage plugin. + Lit les traductions à partir du greffon MultiLanguage. + + + Project File Generated + Fichier de projet généré + + + File created: + +%1 + Fichier créé : + +%1 + + + Select File Location + Sélectionner l’emplacement du fichier + + + Qt Design Studio Project Files (*.qmlproject) + Fichier de projet de Qt Design Studio (*.qmlproject) + + + Invalid Directory + Répertoire invalide + + + Project file must be placed in a parent directory of the QML files. + Le fichier de projet doit être placé dans un répertoire parent des fichiers QML. + + + Problem + Problème + + + Selected directory is far away from the QML file. This can cause unexpected results. + +Are you sure? + Le répertoire sélectionné est éloigné du fichier QML. Cela peut entraîner des résultats inattendus. + +En êtes-vous sûr(e) ? + + + Failed to start Qt Design Studio. + Échec du lancement de Qt Design Studio. + + + No project file (*.qmlproject) found for Qt Design Studio. +Qt Design Studio requires a .qmlproject based project to open the .ui.qml file. + Aucun fichier de projet (*.qmlproject) n’a été trouvé pour Qt Design Studio. +Qt Design Studio nécessite un projet fondé sur .qmlproject pour ouvrir le fichier .ui.qml. + + + Set as Main .qml File + Définir comme le fichier .qml principal + + + Set as Main .ui.qml File + Définir comme le fichier .ui.qml principal + + + + QtC::Qnx + + Deploy to QNX Device + Déployer sur un périphérique QNX + + + Attach to remote QNX application... + + + + New QNX Device Configuration Setup + Configuration du nouveau périphérique QNX + + + QNX Device + Périphérique QNX + + + Deploy Qt libraries... + + + + QNX %1 + Qt Version is meant for QNX + QNX %1 + + + No SDP path was set up. + + + + QNX + QNX + + + Generate kits + Générer les kits + + + Configuration Information: + Informations de la configuration : + + + Name: + Nom : + + + Version: + Version : + + + Host: + Hôte : + + + Target: + Cible : + + + Select QNX Environment File + Sélectionner le fichier d’environnement QNX + + + Warning + Avertissement + + + Configuration already exists or is invalid. + + + + Remove QNX Configuration + + + + Add... + Ajouter… + + + Remove + Supprimer + + + Are you sure you want to remove: + %1? + Voulez-vous vraiment supprimer : +%1 ? + + + Cannot Set Up QNX Configuration + + + + Debugger for %1 (%2) + + + + QCC for %1 (%2) + + + + Kit for %1 (%2) + + + + The following errors occurred while activating the QNX configuration: + + + + - No GCC compiler found. + - Aucun compilateur GCC trouvé. + + + - No targets found. + + + + Preparing remote side... + Préparation de la partie distante… + + + QCC + QCC + + + &Compiler path: + Chemin du &compilateur : + + + SDP path: + SDP refers to 'Software Development Platform'. + + + + &ABI: + &ABI : + + + Warning: "slog2info" is not found on the device, debug output not available. + + + + Cannot show slog2info output. Error: %1 + Impossible d’afficher la sortie de slog2info. Erreur : %1 + + + Project source directory: + + + + Local executable: + + + + Remote QNX process %1 + + + + Checking existence of "%1" + + + + The remote directory "%1" already exists. +Deploying to that directory will remove any files already present. + +Are you sure you want to continue? + + + + Connection failed: %1 + + + + Removing "%1" + + + + No files need to be uploaded. + + + + %n file(s) need to be uploaded. + + + + + + + Local file "%1" does not exist. + + + + Remote chmod failed for file "%1": %2 + + + + No device configuration set. + Aucune configuration du périphérique définie. + + + No deployment action necessary. Skipping. + Aucune action de déploiement nécessaire. Continuation. + + + All files successfully deployed. + Tous les fichiers ont été déployés avec succès. + + + Please input a remote directory to deploy to. + + + + Deploy Qt to QNX Device + + + + Deploy + + + + Close + Fermer + + + Qt library to deploy: + + + + Remote directory: + + + + Closing the dialog will stop the deployment. Are you sure you want to do this? + + + + Checking that files can be created in %1... + + + + Files can be created in /var/run. + + + + An error occurred while checking that files can be created in %1. + + + + Files cannot be created in %1. + + + + Executable on device: + Exécutable sur le périphérique : + + + Remote path not set + Chemin distant indéfini + + + Executable on host: + Exécutable sur l’hôte : + + + Path to Qt libraries on device + + + + + QtC::QtSupport + + The Qt version is invalid: %1 + %1: Reason for being invalid + La version de Qt est invalide : %1 + + + The qmake command "%1" was not found or is not executable. + %1: Path to qmake executable + La commande qmake « %1 » n’a pas été trouvée ou n’est pas exécutable. + + + No qmake path set + Chemin de qmake non spécifié + + + qmake does not exist or is not executable + qmake n’existe pas ou n’est pas exécutable + + + Qt version has no name + La version de Qt n’a pas de nom + + + <unknown> + contexte ? + <inconnu> + + + System + Système + + + Qt version is not properly installed, please run make install + La version de Qt n’est pas correctement installée, veuillez exécuter make install + + + Could not determine the path to the binaries of the Qt installation, maybe the qmake path is wrong? + Impossible de déterminer le chemin vers les programmes de Qt, peut-être que le chemin vers qmake est faux ? + + + The default mkspec symlink is broken. + Le lien symbolique sur le mkspec par défaut est cassé. + + + ABI detection failed: Make sure to use a matching compiler when building. + La détection de l’ABI a échoué : vérifiez que vous utilisez un compilateur adéquat. + + + Non-installed -prefix build - for internal development only. + ? + Version de Qt compilée avec -prefix non installée – pour le développement interne uniquement. + + + No QML utility installed. + Aucun utilitaire QML installé. + + + Desktop + Qt Version is meant for the desktop + Desktop + + + Embedded Linux + Qt Version is used for embedded Linux development + Linux embarqué + + + Edit + Modifier + + + Name + Nom + + + Remove + Supprimer + + + Add... + Ajouter… + + + Qt %{Qt:Version} in PATH (%2) + Qt %{Qt:Version} dans PATH (%2) + + + Qt %{Qt:Version} (%2) + Qt %{Qt:Version} (%2) + + + Device type is not supported by Qt version. + Le type de périphérique n’est pas pris en charge par la version de Qt. + + + The compiler "%1" (%2) cannot produce code for the Qt version "%3" (%4). + Le compilateur « %1 » (%2) ne peut pas produire de code pour la version Qt « %3 » (%4). + + + The compiler "%1" (%2) may not produce code compatible with the Qt version "%3" (%4). + Le compilateur « %1 » (%2) peut ne pas produire un code compatible avec la version Qt « %3 » (%4). + + + The kit has a Qt version, but no C++ compiler. + Le kit comporte une version de Qt, mais pas de compilateur C++. + + + Name: + Nom : + + + Invalid Qt version + Version de Qt invalide + + + ABI: + ABI : + + + Source: + Source : + + + mkspec: + mkspec : + + + qmake: + qmake : + + + Default: + Par défaut : + + + Version: + Version : + + + The version string of the current Qt version. + La chaîne de caractères de la version actuelle de Qt. + + + The type of the current Qt version. + Le type de la version actuelle de Qt. + + + The mkspec of the current Qt version. + Le mkspec de la version actuelle de Qt. + + + The installation prefix of the current Qt version. + Le préfixe d’installation de la version actuelle de Qt. + + + The installation location of the current Qt version's data. + L’emplacement de l’installation des données de la version actuelle de Qt. + + + The host location of the current Qt version. + L’emplacement de l’hôte de la version actuelle de Qt. + + + The installation location of the current Qt version's internal host executable files. + L’emplacement de l’installation des fichiers exécutables de l’hôte interne de la version actuelle de Qt. + + + The installation location of the current Qt version's header files. + L’emplacement de l’installation des fichiers d’en-tête de la version actuelle de Qt. + + + The installation location of the current Qt version's library files. + L’emplacement de l’installation des fichiers de bibliothèque de la version actuelle de Qt. + + + The installation location of the current Qt version's documentation files. + L’emplacement de l’installation des fichiers de documentation de la version actuelle de Qt. + + + The installation location of the current Qt version's executable files. + L’emplacement de l’installation des fichiers d’exécutable de la version actuelle de Qt. + + + The installation location of the current Qt version's internal executable files. + L’emplacement de l’installation des fichiers d’exécutable interne de la version actuelle de Qt. + + + The installation location of the current Qt version's plugins. + L’emplacement de l’installation des fichiers de greffons de la version actuelle de Qt. + + + The installation location of the current Qt version's QML files. + L’emplacement de l’installation des fichiers QML de la version actuelle de Qt. + + + The installation location of the current Qt version's imports. + L’emplacement de l’installation des imports de la version actuelle de Qt. + + + The installation location of the current Qt version's translation files. + L’emplacement de l’installation des fichiers de traduction de la version actuelle de Qt. + + + The installation location of the current Qt version's examples. + L’emplacement de l’installation des exemples de la version actuelle de Qt. + + + The installation location of the current Qt version's demos. + L’emplacement de l’installation des démos de la version actuelle de Qt. + + + The current Qt version's default mkspecs (Qt 4). + Les mkspecs par défaut de la version actuelle de Qt (Qt 4). + + + The current Qt version's default mkspec (Qt 5; host system). + Les mkspecs par défaut de la version actuelle de Qt (Qt 5, système hôte). + + + The current Qt version's default mkspec (Qt 5; target system). + Les mkspecs par défaut de la version actuelle de Qt (Qt 5, système cible). + + + The current Qt's qmake version. + La version actuelle de qmake de Qt. + + + Timeout running "%1". + Délai d’attente pour l’exécution de « %1 ». + + + "%1" crashed. + « %1 » a planté. + + + "%1" produced no output: %2. + « %1 » n’a produit aucune sortie : %2. + + + qmake "%1" is not an executable. + qmake « %1 » n’est pas un exécutable. + + + No Qt version. + Pas de version de Qt. + + + Invalid Qt version. + Version de Qt invalide. + + + Requires Qt 5.0.0 or newer. + Requiert Qt 5.0.0 ou plus récent. + + + Requires Qt 5.3.0 or newer. + Requiert Qt 5.3.0 ou plus récent. + + + This Qt Version does not contain Qt Quick Compiler. + Cette version de Qt ne contient pas le compilateur de Qt Quick. + + + No factory found for qmake: "%1" + Aucune fabrique trouvée pour qmake : « %1 » + + + <specify a name> + <spécifier un nom> + + + Do you want to remove all invalid Qt Versions?<br><ul><li>%1</li></ul><br>will be removed. + Voulez-vous retirer toutes les versions de Qt invalides ?<br/><ul><li>%1</li><br/> seront supprimées. + + + Qt version %1 for %2 + Qt %1 pour %2 + + + Qt Version + Version de Qt + + + Location of qmake + Emplacement de qmake + + + Link with Qt... + Lier avec Qt… + + + Clean Up + Nettoyer + + + qmake path: + Chemin de qmake : + + + Register documentation: + Enregistrer la documentation : + + + qmake Path + Chemin de qmake + + + Highest Version Only + Version la plus élevée uniquement + + + All + Toutes + + + Display Name is not unique. + Le nom affiché n’est pas unique. + + + No compiler can produce code for this Qt version. Please define one or more compilers for: %1 + Aucun compilateur ne peut produire de code pour cette version de Qt. Veuillez définir un ou plusieurs compilateurs pour : %1 + + + The following ABIs are currently not supported: %1 + Les ABI suivantes ne sont actuellement pas prises en charge : %1 + + + Select a qmake Executable + Sélectionner un exécutable qmake + + + Qt Version Already Known + Version de Qt déjà connue + + + Qmake Not Executable + Qmake n’est pas un exécutable + + + The qmake executable %1 could not be added: %2 + L’exécutable qmake %1 n’a pas pu être ajouté : %2 + + + Linking with a Qt installation automatically registers Qt versions and kits, and other tools that were installed with that Qt installer, in this Qt Creator installation. Other Qt Creator installations are not affected. + L’établissement d’un lien avec une installation de Qt enregistre automatiquement les versions et les kits de Qt, ainsi que les autres outils qui ont été installés avec ce programme d’installation de Qt, dans cette installation de Qt Creator. Les autres installations de Qt Creator ne sont pas concernées. + + + %1's resource directory is not writable. + Le répertoire de ressources de %1 n’est pas accessible en écriture. + + + %1 is currently linked to "%2". + %1 est actuellement lié à « %2 ». + + + Qt installation information was not found in "%1". Choose a directory that contains one of the files %2 + Les informations relatives à l’installation de Qt n’ont pas été trouvées dans « %1 ». Sélectionnez un répertoire qui contient l’un des fichiers %2 + + + Choose Qt Installation + Sélectionner l’installation de Qt + + + The change will take effect after restart. + La modification prendra effet après le redémarrage. + + + Qt installation path: + Chemin d’installation de Qt : + + + Choose the Qt installation directory, or a directory that contains "%1". + Sélectionner le répertoire d’installation de Qt ou un répertoire contenant « %1 ». + + + Link with Qt + Lier avec Qt + + + Cancel + Annuler + + + Remove Link + Supprimer le lien + + + Error Linking With Qt + Erreur de liaison avec Qt + + + Could not write to "%1". + Impossible d’écrire sur « %1 ». + + + The Qt version selected must match the device type. + La version de Qt sélectionnée doit correspondre au type de périphérique. + + + Remove Invalid Qt Versions + Retirer les versions de Qt non valides + + + Not all possible target environments can be supported due to missing compilers. + Tous les environnements cibles possibles ne peuvent être pris en charge à cause de compilateurs manquants. + + + This Qt version was already registered as "%1". + Cette version de Qt a déjà été enregistré comme « %1 ». + + + Incompatible Qt Versions + Versions de Qt incompatibles + + + Examples + Exemples + + + Search in Examples... + Recherche dans les exemples… + + + Tutorials + Tutoriels + + + Search in Tutorials... + Recherche dans les tutoriels… + + + Copy Project to writable Location? + Copier le projet à un emplacement accessible en écriture ? + + + <p>The project you are about to open is located in the write-protected location:</p><blockquote>%1</blockquote><p>Please select a writable location below and click "Copy Project and Open" to open a modifiable copy of the project or click "Keep Project and Open" to open the project in location.</p><p><b>Note:</b> You will not be able to alter or compile your project in the current location.</p> + <p>Le projet que vous vous apprêtez à ouvrir se trouve dans un emplacement accessible en lecture seule :</p><blockquote>%1</blockquote><p>Veuillez sélectionner un emplacement accessible en écriture et cliquer sur « Copier le projet et l’ouvrir » pour ouvrir une copie modifiable. Cliquez sur « Conserver le projet et l’ouvrir » pour ouvrir le projet à l’emplacement actuel.</p><p><b>Remarque :</b> vous ne pourrez pas modifier ou compiler votre projet à l’emplacement actuel.</p> + + + &Location: + &Emplacement : + + + &Copy Project and Open + &Copier le projet et l’ouvrir + + + &Keep Project and Open + &Conserver le projet et l’ouvrir + + + Cannot Use Location + Impossible d’utiliser l’emplacement + + + The specified location already exists. Please specify a valid location. + L’emplacement spécifié existe déjà. Veuillez spécifier un autre emplacement. + + + Cannot Copy Project + Impossible de copier le projet + + + The Qt library to use for all projects using this kit.<br>A Qt version is required for qmake-based projects and optional when using other build systems. + La bibliothèque Qt à utiliser pour tous les projets utilisant ce kit.<br>Une version de Qt est nécessaire pour les projets basés sur qmake et est optionnelle pour les autres systèmes de compilation. + + + Name of Qt Version + Nom de la version de Qt + + + unknown + inconnu + + + Path to the qmake executable + Chemin vers l’exécutable de qmake + + + %1 (invalid) + %1 (invalide) + + + Qt version + Version de Qt + + + None + Aucune + + + Qt Versions + Versions de Qt + + + Boot2Qt + Qt version is used for Boot2Qt development + Boot2Qt + + + Aggregation as a pointer member + Agrégation comme pointeur membre + + + Aggregation + Agrégation + + + Multiple inheritance + Héritage multiple + + + Support for changing languages at runtime + Prise en charge du changement de langage à l’exécution + + + Use Qt module name in #include-directive + Utiliser le nom du module Qt dans #include-directive + + + Add Qt version #ifdef for module names + Ajouter un bloc #ifdef avec la version de Qt pour les noms de module + + + Embedding of the UI Class + Intégration de la classe UI + + + Code Generation + Génération de code + + + Qt Class Generation + Génération de classe Qt + + + Featured + Category for highlighted examples + À la une + + + Other + Category for all other examples + Autre + + + [Inexact] + Prefix used for output from the cumulative evaluation of project files. + [inexact] + + + QML debugging and profiling: + Débogage et profilage QML : + + + Might make your application vulnerable.<br/>Only use in a safe environment. + Peut rendre votre application vulnérable.<br/>Utiliser uniquement dans un environnement sûr. + + + Qt Quick Compiler: + Compilateur de Qt Quick : + + + Disables QML debugging. QML profiling will still work. + Désactive le débogage QML. Le profilage QML fonctionne toujours. + + + Link with a Qt installation to automatically register Qt versions and kits? To do this later, select Edit > Preferences > Kits > Qt Versions > Link with Qt. + Lier une installation Qt pour enregistrer automatiquement les versions et kits Qt ? Pour le faire ultérieurement, sélectionnez Édition > Préférences > Kits > Versions de Qt > Lier avec Qt. + + + Full path to the host bin directory of the Qt version in the active kit of the project containing the current document. + Chemin complet vers le répertoire des exécutables de l’hôte de la version de Qt dans le kit actif du projet contenant le document actuel. + + + Full path to the target bin directory of the Qt version in the active kit of the project containing the current document.<br>You probably want %1 instead. + Chemin complet vers le répertoire des exécutables de la cible de la version de Qt dans le kit actif du projet contenant le document actuel.<br>Vous voulez probablement utiliser %1 à la place. + + + Full path to the host libexec directory of the Qt version in the active kit of the project containing the current document. + Chemin complet vers le répertoire libexec de l’hôte de la version de Qt dans le kit actif du projet contenant le document actuel. + + + Full path to the host bin directory of the Qt version in the active kit of the active project. + Chemin complet vers le répertoire des exécutables de l’hôte de la version de Qt dans le kit actif du projet actif. + + + Full path to the target bin directory of the Qt version in the active kit of the active project.<br>You probably want %1 instead. + Chemin complet vers le répertoire des exécutables de la cible de la version de Qt dans le kit actif du projet actif.<br>Vous voulez probablement utiliser %1 à la place. + + + Full path to the libexec bin directory of the Qt version in the active kit of the active project. + Chemin complet vers le répertoire libexec de l’hôte de la version de Qt dans le kit actif du projet actif. + + + If you plan to provide translations for your project's user interface via the Qt Linguist tool, please select a language here. A corresponding translation (.ts) file will be generated for you. + Si vous prévoyez de fournir des traductions pour l’interface utilisateur de votre projet via l’outil Qt Linguist, veuillez sélectionner une langue ici. Un fichier de traduction (.ts) correspondant sera généré pour vous. + + + <none> + <aucun> + + + Language: + Langue : + + + Translation file: + Fichier de traduction : + + + + QtC::RemoteLinux + + Connection + Connexion + + + The device's SSH port number: + Numéro de port SSH de l’appareil : + + + The username to log into the device: + Le nom d’utilisateur pour se connecter à l’appareil : + + + We recommend that you log into your device using public key authentication. +If your device is already set up for this, you do not have to do anything here. +Otherwise, please deploy the public key for the private key with which to connect in the future. +If you do not have a private key yet, you can also create one here. + Nous vous recommandons de vous connecter à votre appareil en utilisant l’authentification par clé publique. +Si votre appareil est déjà configuré pour cela, vous n’avez rien à faire ici. +Dans le cas contraire, veuillez déployer la clé publique pour la clé privée avec laquelle vous vous connecterez à l’avenir. +Si vous n’avez pas encore de clé privée, vous pouvez également en créer une ici. + + + Choose a Private Key File + Sélectionner un fichier de clé privée + + + Create New Key Pair + Créer une nouvelle paire de clés + + + Summary + Résumé + + + The new device configuration will now be created. +In addition, device connectivity will be tested. + La configuration du nouveau périphérique va maintenant être créée. En plus, la connectivité du périphérique sera testée. + + + Key Deployment + Déploiement de la clé + + + Public key error: %1 + Erreur de clé publique : %1 + + + Installing package failed. + Échec lors de l’installation du paquet. + + + Starting remote command "%1"... + Démarrage de la commande distante « %1 »… + + + Remote process failed: %1 + Échec du processus distant : %1 + + + Choose Public Key File + Sélectionner le fichier de clé publique + + + Public Key Files (*.pub);;All Files (*) + Fichiers de clé publique (*.pub);;Tous les fichiers (*) + + + Deploying... + Déploiement… + + + Key deployment failed. + Échec du déploiement de clé. + + + Deployment finished successfully. + Le déploiement s’est déroulé avec succès. + + + Executable on host: + Exécutable sur l’hôte : + + + Executable on device: + Exécutable sur le périphérique : + + + Remote path not set + Chemin distant indéfini + + + Ignore missing files + Ignorer les fichiers manquants + + + Tarball creation not possible. + Création de l’archive tarball impossible. + + + Create tarball: + Créer un tarball : + + + No deployment action necessary. Skipping. + Aucune action de déploiement nécessaire. Continuation. + + + No device configuration set. + Aucune configuration du périphérique définie. + + + Cannot deploy: %1 + Impossible de déployer : %1 + + + User requests deployment to stop; cleaning up. + L’utilisateur a demandé l’arrêt du déploiement; nettoyage en cours. + + + Deploy step failed. + Étape de déploiement échouée. + + + Deploy step finished. + Étape de déploiement effectuée. + + + Uploading package to device... + Téléchargement du paquet sur l’appareil… + + + Successfully uploaded package file. + Fichier de paquet envoyé avec succès. + + + Installing package to device... + Installation du paquet sur le périphérique en cours… + + + Successfully installed package file. + Fichier de paquet installé avec succès. + + + Failed to start "stat": %1 + Échec du démarrage de « stat » : %1 + + + "stat" crashed. + « stat » a planté. + + + "stat" failed with exit code %1: %2 + « stat » a échoué avec le code de sortie %1 : %2 + + + Failed to retrieve remote timestamp for file "%1". Incremental deployment will not work. Error message was: %2 + + + + Unexpected stat output for remote file "%1": %2 + + + + No files need to be uploaded. + + + + %n file(s) need to be uploaded. + + + + + + + Local file "%1" does not exist. + + + + Remote chmod failed for file "%1": %2 + + + + All files successfully deployed. + Tous les fichiers ont été déployés avec succès. + + + Incremental deployment + Déploiement incrémental + + + Command line: + Ligne de commande : + + + Upload files via SFTP + Envoi de fichiers par SFTP + + + Cannot establish SSH connection: ssh binary "%1" does not exist. + + + + Cannot establish SSH connection: Failed to create temporary directory for control socket: %1 + + + + Cannot establish SSH connection. +Control process failed to start. + + + + SSH connection failure. + + + + SSH connection failure: + + + + Remote Linux + + + + Remote Linux Device + + + + Deploy Public Key... + Déployer la clé publique… + + + Error starting remote shell. + + + + Error running remote shell. + + + + Error running remote shell: %1 + + + + Open Remote Shell + + + + "%1" failed to start: %2 + « %1 » n’a pas pu démarrer : %2 + + + "%1" crashed. + « %1 » a planté. + + + "sftp" binary "%1" does not exist. + + + + Failed to create local directory "%1". + + + + Creating directory: %1 + + + + + Failed. + Échec. + + + Copying %1/%2: %3 -> %4 + + + + + Deploy Public Key + Déployer la clé publique + + + Close + Fermer + + + Checking kernel version... + Vérification de la version du noyau… + + + uname failed: %1 + Échec d’uname : %1 + + + uname failed. + Échec d’uname. + + + Error gathering ports: %1 + Erreur lors de la collecte des ports : %1 + + + All specified ports are available. + Tous les ports spécifiés sont disponibles. + + + Sending echo to device... + + + + Device replied to echo with unexpected contents. + + + + Device replied to echo with expected contents. + + + + echo failed: %1 + + + + echo failed. + + + + The following specified ports are currently in use: %1 + Les ports suivant sont actuellement en cours d’utilisation : %1 + + + Checking whether "%1" works... + + + + "%1" is functional. + + + + + Failed to start "%1": %2 + + + + + "%1" crashed. + + « %1 » a planté. + + + + "%1" failed with exit code %2: %3 + + + + + "%1" will be used for deployment, because "%2" is not available. + + + + + Deployment to this device will not work out of the box. + + + + + %1... + + + + %1 found. + %1 trouvé. + + + An error occurred while checking for %1. + + + + %1 not found. + %1 introuvable. + + + Checking if required commands are available... + + + + Checking if specified ports are available... + Vérification si les ports spécifiés sont disponibles… + + + Run custom remote command + Exécuter une commande distante personnalisée + + + No command line given. + Aucune ligne de commande donnée. + + + Remote process finished with exit code %1. + Processus distant terminé avec le code de sortie %1. + + + Remote command finished successfully. + Processus distant terminé avec succès. + + + Deploy to Remote Linux Host + Déploiement sur une hôte Linux distante + + + Packaging finished successfully. + Paquetage terminé avec succès. + + + Packaging failed. + Échec lors de la création du paquet. + + + Creating tarball... + Création de l’archive tarball… + + + Package modified files only + + + + Tarball up to date, skipping packaging. + L’archive tarball est à jour, continuation. + + + Error: tar file %1 cannot be opened (%2). + Erreur : le fichier %1 n’a pas pu être ouvert (%2). + + + No remote path specified for file "%1", skipping. + + + + Error writing tar file "%1": %2. + + + + Cannot add file "%1" to tar-archive: path too long. + + + + Error writing tar file "%1": %2 + + + + Error reading file "%1": %2. + + + + Adding file "%1" to tarball... + + + + Create tarball + Créer un tarball + + + No tarball creation step found. + Aucune étape de création d’archive tarball trouvée. + + + Deploy tarball via SFTP upload + Déployer l’archive par SFTP + + + Authentication type: + Type d’identification : + + + &Host name: + Nom de l’&hôte : + + + IP or host name of the device + IP ou nom de l’hôte du périphérique + + + Default + Défaut + + + Specific &key + + + + &Check host key + + + + You can enter lists and ranges like this: '1024,1026-1028,1030'. + + + + &SSH port: + Port &SSH : + + + Free ports: + Ports libres : + + + QML runtime executable: + + + + Timeout: + Délai d’attente : + + + s + s + + + &Username: + &Utilisateur : + + + Private key file: + Fichier de clé privée : + + + Physical Device + Périphérique physique + + + Emulator + Émulateur + + + You will need at least one port. + Vous avez besoin d’au moins un port. + + + Create New... + Créer un nouveau… + + + Machine type: + Type de machine : + + + GDB server executable: + Exécutable du serveur GDB : + + + Leave empty to look up executable in $PATH + Laisser vide pour rechercher un exécutable dans le $PATH + + + WizardPage + WizardPage + + + The name to identify this configuration: + Le nom pour identifier cette configuration : + + + The device's host name or IP address: + Le nom d’hôte du périphérique ou son adresse IP : + + + Cannot Open Terminal + + + + Cannot open remote terminal: Current kit has no device. + + + + Clean Environment + Environnement vierge + + + System Environment + Environnement du système + + + Fetch Device Environment + Réception de l’environnement du périphérique + + + Exit code is %1. stderr: + Le code de sortie %1. stderr : + + + New Remote Linux Device Configuration Setup + + + + Trying to kill "%1" on remote device... + + + + Remote application killed. + + + + Failed to kill remote application. Assuming it was not running. + + + + Kill current application instance + + + + Command: + Commande : + + + Install root: + Racine de l’installation : + + + Clean install root first: + + + + Full command line: + + + + Custom command line: + + + + Use custom command line instead: + + + + Install into temporary host directory + + + + You must provide an install root. + + + + The install root "%1" could not be cleaned. + + + + The install root "%1" could not be created. + + + + The "make install" step should probably not be last in the list of deploy steps. Consider moving it up. + + + + You need to add an install statement to your CMakeLists.txt file for deployment to work. + + + + Remote executable: + + + + Local executable: + + + + Custom Executable + Exécutable personnalisé + + + Run "%1" + + + + The remote executable must be set in order to run a custom remote run configuration. + + + + Deploy via rsync: failed to create remote directories: + + + + rsync failed to start: %1 + + + + rsync crashed. + rsync a planté. + + + rsync failed with exit code %1. + + + + Flags: + Flags : + + + Ignore missing files: + + + + rsync is only supported for transfers between different devices. + + + + Deploy files via rsync + + + + SSH Key Configuration + Configuration de la clé SSH + + + &RSA + &RSA + + + ECDSA + + + + &Generate And Save Key Pair + &Générer et enregistrer la paire de clés + + + Options + Options + + + Key algorithm: + Algorithme de la clé : + + + Key &size: + + + + Public key file: + Fichier de clé publique : + + + The ssh-keygen tool was not found. + + + + Refusing to overwrite existing private key file "%1". + + + + The ssh-keygen tool at "%1" failed: %2 + + + + Choose Private Key File Name + + + + Key Generation Failed + La génération de la clé a échoué QtC::ResourceEditor - - Add - Ajouter - Remove Supprimer @@ -11014,1494 +45793,6 @@ au système de gestion de version (%2) ? Alias: Alias : - - - QtC::QmakeProjectManager - - Qt4 Console Application - Application Qt4 en console - - - Creates a Qt4 console application. - Crée une application Qt4 de type console. - - - Qt Console Application - Application Qt4 en console - - - Creates a project containing a single main.cpp file with a stub implementation. - -Preselects a desktop Qt for building the application if available. - Créer un projet contenant un seul fichier main.cpp avec un début d'implémentation. - -Présélectionne un bureau Qt pour compiler l'application si disponible. - - - This wizard generates a Qt4 console application project. The application derives from QCoreApplication and does not provide a GUI. - Cet assistant génère un projet d'application Qt4 console. L'application dérive de QCoreApplication et ne fournit pas d'interface graphique. - - - This wizard generates a Qt console application project. The application derives from QCoreApplication and does not provide a GUI. - Cet assistant génère un projet d'application Qt console. L'application dérive de QCoreApplication et ne fournit pas d'interface graphique. - - - Qt Designer is not responding (%1). - Qt Designer ne répond pas (%1). - - - Unable to create server socket: %1 - Impossible de créer le socket serveur : %1 - - - Embedded Linux - Linux embarqué - - - Empty Qt4 Project - Projet Qt4 vide - - - Creates an empty Qt project. - Crée un projet Qt vide. - - - Empty Qt Project - Projet Qt vide - - - Creates a qmake-based project without any files. This allows you to create an application without any default classes. - Créer un proje basé sur qmake sans aucun fichier. Cela vous permet de créer une application sans aucune classe par défaut. - - - This wizard generates an empty Qt4 project. Add files to it later on by using the other wizards. - Cet assistant génère un projet Qt4 vide. Vous pouvez ajouter des fichiers plus tard en utilisant les autres assistants. - - - This wizard generates an empty Qt project. Add files to it later on by using the other wizards. - Cet assistant génère un projet Qt vide. Vous pouvez ajouter des fichiers plus tard en utilisant les autres assistants. - - - Unable to start "%1" - Impossible de démarrer "%1" - - - The application "%1" could not be found. - L'application "%1" est introuvable. - - - Class Information - Information sur la classe - - - Specify basic information about the classes for which you want to generate skeleton source code files. - Définit les informations de base des classes pour lesquelles vous souhaitez générer des fichiers squelettes de code source. - - - Qt4 Gui Application - Application graphique Qt4 - - - Creates a Qt4 Gui Application with one form. - Crée une application GUI Qt 4 avec un formulaire. - - - Qt Gui Application - Application graphique Qt - - - Qt Widgets Application - Application Qt avec widgets - - - Creates a Qt application for the desktop. Includes a Qt Designer-based main window. - -Preselects a desktop Qt for building the application if available. - bureau sonne bizarre dans ce cas je trouve... - Créer une application Qt pour le desktop. Inclut une fenêtre principale basée sur Qt Designer. - -Présélectionne une version desktop Qt pour compiler l'application si disponible. - - - The template file '%1' could not be opened for reading: %2 - Le fichier modèle "%1' n"a pas pu être ouvert en lecture : %2 - - - This wizard generates a Qt4 GUI application project. The application derives by default from QApplication and includes an empty widget. - Cet assistant génère un projet d'application graphique Qt4. L'application dérive par défaut de QApplication et inclut un widget vide. - - - This wizard generates a Qt GUI application project. The application derives by default from QApplication and includes an empty widget. - Cet assistant génère un projet d'application graphique Qt. L'application dérive par défaut de QApplication et inclut un widget vide. - - - This wizard generates a Qt Widgets Application project. The application derives by default from QApplication and includes an empty widget. - Cet assistant génère un projet d'application Qt avec widgets. L'application dérive par défaut de QApplication et inclut un widget vide. - - - Details - Détails - - - C++ Library - Bibliothèque C++ - - - Creates a C++ library based on qmake. This can be used to create:<ul><li>a shared C++ library for use with <tt>QPluginLoader</tt> and runtime (Plugins)</li><li>a shared or static C++ library for use with another project at linktime</li></ul> - Créer une bibliothèque C++ basée sur qmake. Cela peut être utilisé pour créer :<ul><li>une bibliothèque C++ partagée pour utiliser avec <tt>QPluginLoader</tt> à l'exécution (plug-ins)</li><li>une bibliothèque C++ partagée ou statique pour utiliser avec un autre projet au moment de la compilation</li></ul> - - - Creates a C++ library based on qmake. This can be used to create:<ul><li>a shared C++ library for use with <tt>QPluginLoader</tt> and runtime (Plugins)</li><li>a shared or static C++ library for use with another project at linktime</li></ul>. - Crée une bibliothèque C++ basée sur qmake. Ceci peut être utilisé pour créer : <ul><li>une bibliothèque partagée C++ à utiliser avec <tt>QPluginLoader</tt> à l'exécution (plug-ins)</li><li>une bibliothèque partagée ou statique C++ à utiliser dans un autre projet lors de l'édition des liens</li></ul>. - - - Creates a C++ Library. - Crée une bibliothèque C++. - - - Shared library - Bibliothèque partagée - - - Statically linked library - Bibliothèque liée statiquement - - - Qt 4 plugin - Plug-in Qt 4 - - - Shared Library - Bibliothèque partagée - - - Statically Linked Library - Bibliothèque liée statiquement - - - Qt 4 Plugin - Plug-in Qt 4 - - - Qt Plugin - Plug-in Qt - - - Type - Type - - - This wizard generates a C++ library project. - Cet assistant génère un projet de bibliothèque C++. - - - Symbian Specific - Spécifique à Symbian - - - Select required modules - Sélectionner les modules requis - - - Select Required Modules - Sélectionner les modules requis - - - Select the modules you want to include in your project. The recommended modules for this project are selected by default. - Sélectionnez les modules que vous souhaitez inclure au projet. Les modules recommandés pour ce projet sont sélectionnés par défaut. - - - Remove - Supprimer - - - Up - Monter - - - Down - Descendre - - - Cut - Couper - - - Copy - Copier - - - Paste - Coller - - - Ctrl+X - Ctrl+X - - - Ctrl+C - Ctrl+C - - - Ctrl+V - Ctrl+V - - - Add Variable - Ajouter une variable - - - Add Scope - Ajouter une portée - - - Add Block - Ajouter un bloc - - - <Global Scope> - <Portée Globale> - - - Change Item - Modifier l'élément - - - Change Variable Assignment - Modifier l'affectation de la variable - - - Change Variable Type - Modifier le type de la variable - - - Change Scope Condition - Modifier la condition de la portée - - - Change Expression - Modifier l'expression - - - Move Item - Déplacer l'élément - - - Remove Item - Supprimer l'élément - - - Insert Item - Insérer un élément - - - Import existing build settings - Importer des paramètres de compilation existants - - - Qt Creator has found an already existing build in the source directory.<br><br><b>Qt Version:</b> %1<br><b>Build configuration:</b> %2<br><b>Additional QMake Arguments:</b>%3 - Qt Creator a détecté une version compilée dans le répertoire source.<br> <br> <b>Qt Version : </b> %1<br><b>Configuration de compilation :</b> %2<br>Arguments supplémentaires de QMake :</b> %3 - - - <b>Note:</b> Importing the settings will automatically add the Qt Version identified by <br><b>%1</b> to the list of Qt versions. - <b>Note:</b> Importer les paramètres ajoutera automatiquement la version de Qt identifiée par <br> <b> %1</b> à la liste des versions de Qt. - - - Import existing build settings. - Importer des paramètres de compilation existants. - - - Project setup - Installation du projet - - - Project Setup - Configuration du projet - - - Clear system environment - Nettoyer l'environnement système - - - Build Environment - Environnement de compilation - - - Cannot Open File - Impossible d'ouvrir le fichier - - - Cannot open the file for edit with VCS. - Impossible d'ouvrir le fichier pour édition avec le gestionnaire de versions. - - - Cannot set permissions to writable. - Impossible d'attribuer les droits en écriture. - - - Could not open the file for edit with VCS. - Impossible d'ouvrir le fichier pour édition avec VCS. - - - Error while reading .pro file %1: %2 - Erreur lors de la lecture du fichier .pro %1 : %2 - - - Could not open the file for edit with SCC. - Impossible d'ouvrir le fichier pour l'éditer avec SCC. - - - Could not set permissions to writable. - Impossible d'attribuer les droits en écriture. - - - Error while reading PRO file %1: %2 - Erreur pendant la lecture du fichier PRO %1 : %2 - - - Error while changing pro file %1. - Erreur pendant la modification du fichier pro %1. - - - Configuration Name: - Nom de la configuration : - - - Qt Version: - Version de Qt : - - - This Qt-Version is invalid. - Cette version de Qt est invalide. - - - Shadow Build: - Shadow Build : - - - Build Directory: - Répertoire de compilation : - - - <a href="import">Import existing build</a> - <a href="import">Importer une compilation existante</a> - - - Shadow Build Directory - Répertoire du Shadow build - - - Default Qt Version (%1) - Version de Qt par défaut (%1) - - - No Qt Version set - Aucune version de Qt définie - - - using <font color="#ff0000">invalid</font> Qt Version: <b>%1</b><br>%2 - utilisation d'une version Qt <font color="#ff0000">invalide</font> : <b>%1</b><br>%2 - - - No Qt Version found. - Aucune version de Qt trouvée. - - - using Qt version: <b>%1</b><br>with tool chain <b>%2</b><br>building in <b>%3</b> - utilise la version de Qt : <b>%1</b><br>avec la chaîne de compilation <b>%2</b><br>compilé dans <b>%3</b> - - - <Invalid tool chain> - <Chaîne de compilation invalide> - - - General - Général - - - Invalid Qt version - Version de Qt invalide - - - A build for a different project exists in %1, which will be overwritten. - %1 build directory - Une compilation pour un projet différent existe déjà dans %1, elle sera écrasée. - - - An build for a different project exists in %1, which will be overwritten. - %1 build directory - Une compilation pour un projet différent existe déjà dans %1, elle sera écrasée. - - - building in <b>%1</b> - Compilation dans <b>%1</b> - - - This kit cannot build this project since it does not define a Qt version. - Ce kit ne peut pas compiler ce projet, car il ne définit pas de version de Qt. - - - The Qt version %1 does not support shadow builds, building might fail. - La version de Qt %1 ne prend pas en charge les shadow builds, la compilation risque d'échouer. - - - Error: - Erreur : - - - Warning: - Avertissement : - - - <No tool chain selected> - <Pas de chaîne de compilation sélectionnée> - - - Building in subdirectories of the source directory is not supported by qmake. - Compiler dans un sous-répertoire du répertoire source n'est pas supporté par qmake. - - - An incompatible build exists in %1, which will be overwritten. - %1 build directory - Une compilation incompatible existe dans %1, qui sera écrasée. - - - Manage - Gérer - - - Configuration name: - Nom de la configuration : - - - Qt version: - Version de Qt : - - - This Qt version is invalid. - Cette version de Qt est invalide. - - - Tool chain: - Chaîne d'outils : - - - Shadow build: - Shadow Build : - - - Build directory: - Répertoire de compilation : - - - problemLabel - placeholder je pense - problemLabel - - - Run qmake - Exécuter qmake - - - Build - Compilation - - - Build "%1" - Compiler "%1" - - - Rebuild - Recompiler - - - Clean - Nettoyer - - - Build Subproject - Compiler le sous-projet - - - Build Subproject "%1" - Compiler le sous-projet "%1" - - - Rebuild Subproject - Recompiler le sous-projet - - - Rebuild Subproject "%1" - Recompiler le sous-projet "%1" - - - Clean Subproject - Nettoyer le sous-projet - - - Clean Subproject "%1" - Nettoyer le sous-projet "%1" - - - Build File - Compiler le fichier - - - Build File "%1" - Compiler le fichier "%1" - - - Ctrl+Alt+B - Ctrl+Alt+B - - - Jump to File Under Cursor - Aller au fichier sous le curseur - - - Add Library... - Ajouter une bibliothèque... - - - Run qmake in %1 - Exécuter qmake dans %1 - - - Arguments: - Arguments : - - - Run in Terminal - Exécuter dans un terminal - - - Select Working Directory - Sélectionner le répertoire de travail - - - Working directory: - Répertoire de travail : - - - Run in terminal - Exécuter dans un terminal - - - Executable: - Exécutable : - - - Select the working directory - Sélectionner le répertoire de travail - - - Reset to default - Restaurer les paramètres par défaut - - - Working Directory: - Répertoire de travail : - - - Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug) - Utiliser les versions debug des frameworks (DYLD_IMAGE_SUFFIX=_debug) - - - Base environment for this runconfiguration: - Environnement de base pour cette configuration d'éxecution : - - - <specify a name> - <spécifier un nom> - - - <specify a qmake location> - <spécifier l'emplacement de qmake> - - - Select QMake Executable - Sélectionner un exécutable QMake - - - Select the MinGW Directory - Sélectionner un répertoire MinGW - - - Select Carbide Install Directory - Sélectionner un répertoire d'installation de Carbide - - - Select S60 SDK Root - Sélectionner la racine du SDK S60 - - - Select the CSL Arm Toolchain (GCCE) Directory - Sélectionner le répertoire de la chaîne de compilation CSL Arm (GCCE) - - - Select qmake Executable - Sélectionner l'exécutable qmake - - - Select the CSL ARM Toolchain (GCCE) Directory - Sélectionner le répertoire de la chaîne de compilation CSL Arm (GCCE) - - - <i>Cannot be compiled.</i> - <i>Ne peut pas être compilé.</i> - - - <html><body><table><tr><td>File:</td><td><pre>%1</pre></td></tr><tr><td>Last modified:</td><td>%2</td></tr><tr><td>Size:</td><td>%3 Bytes</td></tr></table></body></html> - Tooltip showing the debugging helper library file. - <html><body><table><tr><td>Fichier :</td><td><pre>%1</pre></td></tr><tr><td>Dernière modification :</td><td>%2</td></tr><tr><td>Taille :</td><td>%3 octets</td></tr></table></body></html> - - - Debugging Helper Build Log for '%1' - Journal de compilation de l'assistant de debogage pour "%1" - - - Make - Qt MakeStep display name. - Make - - - Qt Creator needs a compiler set up to build. Configure a compiler in the kit options. - Qt Creator requiert un compilateur. Configurez-en un dans les options de kit. - - - Cannot find Makefile. Check your build settings. - Impossible de trouver un Makefile. Vérifiez vos options de compilation. - - - Configuration is faulty. Check the Issues view for details. - La configuration est défectueuse, veuillez vérifier la vue des problèmes pour les détails. - - - Configuration is faulty. Check the Build Issues view for details. - La configuration est défectueuse, veuillez vérifier la vue des problèmes de compilation pour les détails. - - - Qt Creator needs a tool chain set up to build. Please configure a tool chain in Project mode. - Qt Creator a besoin d'une chaîne d'outils pour compiler. Veuillez configurer une telle chaîne dans le mode Projet. - - - Makefile not found. Please check your build settings - Makefile non trouvé. Veuillez vérifier vos paramètres de compilation - - - Configuration is faulty, please check the Build Issues view for details. - La configuration est défectueuse, veuillez vérifier la vue des problèmes de compilation pour obtenir des détails. - - - Could not find make command: %1 in the build environment - Impossible de trouver la commande make : %1 dans l'environnement de compilation - - - <font color="#ff0000">Could not find make command: %1 in the build environment</font> - <font color="#ff0000">Impossible de trouver la commande make : %1 dans l'environnement de compilation</font> - - - <font color="#0000ff"><b>No Makefile found, assuming project is clean.</b></font> - <font color="#0000ff"><b>Aucun Makefile trouvé, assume que le projet est nettoyé.</b></font> - - - Make: - Make : - - - <b>Make:</b> %1 - <b>Make :</b> %1 - - - <b>Make:</b> No Qt build configuration. - <b>Make :</b> aucune configuration de compilation Qt. - - - No Qt4 build configuration. - Aucude configuration de compilation Qt4. - - - <b>Make:</b> %1 not found in the environment. - <b>Make :</b> %1 non trouvé dans l'environnement. - - - <b>Make Step:</b> %1 not found in the environment. - <b>Make Step:</b> %1 non trouvé dans l'environnement. - - - <b>Make:</b> %1 %2 in %3 - <b>Make:</b> %1 %2 dans %3 - - - -<font color="#ff0000"><b>No valid Qt version set. Set one in Preferences </b></font> - - -<font color="#ff0000"><b>Aucune version valide de Qt définie. Définissez-en une dans Préférences </b></font> - - - - -<font color="#ff0000"><b>No valid Qt version set. Set one in Tools/Options </b></font> - - -<font color="#ff0000"><b>Aucune version valide de Qt définie. Définissez-en une dans Outils/Options </b></font> - - - - <font color="#0000ff">Configuration unchanged, skipping QMake step.</font> - <font color="#0000ff">Configuration non modifiée, passe l'étape QMake.</font> - - - qmake - QMakeStep default display name - qmake - - - Configuration is faulty, please check the Issues view for details. - La configuration est défectueuse, veuillez vérifier la vue des problèmes pour obtenir des détails. - - - Configuration unchanged, skipping qmake step. - Configuration inchangée, étape qmake sautée. - - - No Qt version. - Pas de version de Qt. - - - Invalid Qt version. - Version de Qt invalide. - - - Requires Qt 4.7.1 or newer. - Requiert Qt 4.7.1 ou plus récent. - - - Library not available. <a href='compile'>Compile...</a> - Bibliothèque non disponible. <a href='compile'>Compiler...</a> - - - <b>QMake:</b> No Qt version set. QMake can not be run. - <b>QMake:</b> Aucune version de Qt définie. QMake ne peut être lancé. - - - <b>QMake:</b> %1 %2 - <b>QMake:</b> %1 %2 - - - No valid Qt version set. - Aucune version de Qt définie. - - - QML Debugging - Débogage QML - - - The option will only take effect if the project is recompiled. Do you want to recompile now? - Cette option ne prendra effet que si le projet est recompilé. Voulez-vous le recompiler maintenant ? - - - <b>qmake:</b> No Qt version set. Cannot run qmake. - <b>qmake :</b> Aucune version de Qt définie. qmake ne peut être lancé. - - - <b>qmake:</b> %1 %2 - <b>qmake :</b> %1 %2 - - - <b>Warning:</b> The tool chain suggests using another mkspec. - <b>Attention :</b> la chaîne de compilation suggère d'utiliser un autre mkspec. - - - <b>Warning:</b> The tool chain suggested "%1" as mkspec. - <b>Attention:</b> La chaîne d'outils a suggéré "%1" comme mkspec. - - - Enable QML debugging: - Activer le débogage QML : - - - Might make your application vulnerable. Only use in a safe environment. - Peut rendre l'application vulnérable. À n'utiliser qu'en environnement protégé. - - - <No Qt version> - <Pas de version de Qt> - - - Might make the application vulnerable. Use only in a safe environment. - Peut rendre l'application vulnérable. À utiliser dans un environnement sécurisé. - - - Loading project %1 ... - Chargement du projet %1... - - - Full path to the bin/ install directory of the current project's Qt version. - Chemin complet du répertoire bin d'installation de la version de Qt du projet actuel. - - - Full path to the bin directory of the current project's Qt version. - Chemin complet vers le répertoire bin de la version Qt actuelle du projet. - - - Full path to the host bin directory of the current project's Qt version. - host/target -> source/destination ou hôte/destination ? -> hôte - Chemin complet vers le répertoire bin d'origine de la version Qt actuelle du projet. - - - Full path to the target bin directory of the current project's Qt version. You probably want %1 instead. - ? - Chemin complet vers le répertoire bin de destination de la version Qt actuelle du projet. Vous vouliez probablement dire %1 à la place. - - - Update of Generated Files - Mise à jour des fichiers générés - - - In project<br><br>%1<br><br>The following files are either outdated or have been modified:<br><br>%2<br><br>Do you want Qt Creator to update the files? Any changes will be lost. - Dans le projet <br><br>%1<br><br>Les fichiers suivants sont périmés ou ont été modifié :<br><br>%2<br><br>Voulez-vous que Qt Creator mette à jour ces fichiers ? Tous les changements seront perdus. - - - The following files are either outdated or have been modified:<br><br>%1<br><br>Do you want Qt Creator to update the files? Any changes will be lost. - Les fichiers suivants sont trop vieux ou ont été modifiés : <br><br>%1<br><br>Voulez-vous que Qt Creator les mette à jour ? Tout changement sera perdu. - - - Failed opening project '%1': Project file does not exist - Échec de l'ouverture du projet "%1' : le fichier du projet n"existe pas - - - Failed opening project '%1': Project is not a file - Échec de l'ouverture du projet "%1" : le projet n'est pas un fichier - - - QMake - qmake - - - Failed opening project - Ouverture du projet échouée - - - Failed opening project '%1': Project already open - Échec de l'ouverture du projet "%1" : projet déjà ouvert - - - Opening %1 ... - Ouverture de %1... - - - Done opening project - Ouverture du projet terminée - - - MinGW from %1 - MinGW depuis %1 - - - <not found> - <non trouvé> - - - Qt in PATH - Qt dans le PATH - - - ABI: - ABI : - - - Source: - Source : - - - mkspec: - mkspec : - - - qmake: - qmake : - - - Default: - Par défaut : - - - Compiler: - Compilateur : - - - Version: - Version : - - - - QApplication - - The Qt Version has no toolchain. - La version de Qt n'as pas de chaîne de compilation. - - - EditorManager - Next Open Document in History - looks like an error in the tr call to me - Document ouvert suivant dans l'historique - - - EditorManager - Previous Open Document in History - Document ouvert précédent dans l'historique - - - Ninja (%1) - Ninja (%1) - - - NMake Generator (%1) - Générateur NMake (%1) - - - MinGW Generator (%1) - Générateur MinGW (%1) - - - Unix Generator (%1) - Générateur UNIX (%1) - - - - QtModulesInfo - - QtCore Module - Module QtCore - - - Core non-GUI classes used by other modules - Classes majeures non-GUI utilisé par les autres modules - - - Base classes for graphical user interface (GUI) components. (Qt 4: Includes widgets. Qt 5: Includes OpenGL.) - Classes de base pour les composants des interfaces graphiques (GUI) (Qt 4 : inclut widgets. Qt 5 : inclut OpenGL.) - - - Classes to extend Qt GUI with C++ widgets (Qt 5) - Classes pour étendre les interfaces graphiques Qt avec des widgets C++ (Qt 5) - - - Qt Quick 1 classes - Classes Qt Quick 1 - - - Classes for QML and JavaScript languages (Qt 5) - Classes pour les langages QML et JavaScript (Qt 5) - - - A declarative framework for building highly dynamic applications with custom user interfaces - Ensemble de bibliothèques déclaratives pour construire des applications dynamiques avec des interfaces utilisateurs personnalisées - - - Print support classes (Qt 5) - Classes de support pour l'impression (Qt 5) - - - WebKit1 and QWidget-based classes from Qt 4 (Qt 5) - Classes basées sur WebKit 1 et QWidget provenant de Qt 4 (Qt 5) - - - Multimedia framework classes (Qt 4 only) - Classes de l'ensemble des outils multimédia (Qt 5) - - - Classes that ease porting from Qt 3 to Qt 4 (Qt 4 only) - Classes pour faciliter le portage depuis Qt 3 vers Qt 4 (Uniquement dans Qt 4) - - - QtGui Module - Module QtGui - - - Graphical user interface components - Composants de l'interface graphique - - - QtNetwork Module - Module QtNetwork - - - Classes for network programming - Classes pour la programmation réseau - - - QtOpenGL Module - Module QtOpenGL - - - OpenGL support classes - Classes pour le support de OpenGL - - - QtSql Module - Module QtSql - - - Classes for database integration using SQL - Classes pour l'intégration aux bases de données utilisant SQL - - - QtScript Module - Module QtScript - - - Classes for evaluating Qt Scripts - Classes pour l'évaluation de scripts Qt - - - QtScriptTools Module - Module QtScriptTools - - - Additional Qt Script components - Composants additionnels pour Qt Script - - - QtSvg Module - Module QtSvg - - - Classes for displaying the contents of SVG files - Classes pour l'affichage du contenu des fichier SVG - - - QtWebKit Module - Module QtWebkit - - - Classes for displaying and editing Web content - Classes pour l'affichage et l'édition de contenu Web - - - QtXml Module - Module QtXML - - - Classes for handling XML - Classes pour la manipulation de XML - - - QtXmlPatterns Module - Module QtXmlPatterns - - - An XQuery/XPath engine for XML and custom data models - Un moteur XQuery/XPath pour XML et pour des modèles de données personnalisés - - - Phonon Module - Module Phonon - - - Multimedia framework classes - Classes du framework multimédia - - - QtMultimedia Module - Module QtMultimedia - - - Classes for low-level multimedia functionality - Classes pour l'implémentation de fonctionnalité multimédia de bas niveau - - - Qt3Support Module - Module Qt3Support - - - Classes that ease porting from Qt 3 to Qt 4 - Classes pour aider le portage de Qt 3 à Qt 4 - - - QtTest Module - Module QtTestj - - - Tool classes for unit testing - Classes d'aide à la création de tests unitaires - - - QtDBus Module - Module QtDBus - - - Classes for Inter-Process Communication using the D-Bus - Classes pour la communication inter-processus utilisant D-Bus - - - - QtScriptEditor::Internal::QtScriptEditorActionHandler - - Qt Script Error - Erreur Qt Script - - - - QtScriptEditor::Internal::QtScriptEditorPlugin - - Creates a Qt Script file. - Crée un fichier Qt Script. - - - Qt Script file - Fichier Qt Script - - - Qt - Qt - - - Run - Exécuter - - - Ctrl+R - Ctrl+R - - - - QtScriptEditor::Internal::ScriptEditor - - <Select Symbol> - <Selectionner un symbole> - - - - QtC::Core - - Filter Configuration - Configuration du filtre - - - Limit to prefix - Limiter au préfixe - - - Prefix: - Préfixe : - - - Generic Directory Filter - Filtre de dossier générique - - - Choose a directory to add - Sélectionner un répertoire à ajouter - - - Select Directory - Sélectionner un répertoire - - - %1 filter update: 0 files - Mise à jour du filtre %1 : 0 fichiers - - - %1 filter update: %n files - - Mise à jour du filtre %1 : %n fichier - Mise à jour du filtre %1 : %n fichiers - - - - %1 filter update: canceled - Mise à jour du filtre %1 : annulée - - - Name: - Nom : - - - File Types: - Types de fichiers : - - - Specify file name filters, separated by comma. Filters may contain wildcards. - Spécifier les filtres de nom de fichier, séparés par la virgule. Les filtres peuvent contenir des caractères de remplacement. - - - Specify a short word/abbreviation that can be used to restrict completions to files from this directory tree. -To do this, you type this shortcut and a space in the Locator entry field, and then the word to search for. - Spécifier un mot court ou une abbréviation qui peut être utilisé pour réstreindre les complétions aux fichiers de cette arborescence. Pour ce faire, entrer ce raccourci et un espace dans le champs localisation, puis ensuite le mot à chercher. - - - Remove - Supprimer - - - Directories: - Dossiers : - - - File types: - Types de fichiers : - - - Add - Ajouter - - - Files in file system - Fichiers du système de fichier - - - Files in File System - Fichiers dans le système de fichiers - - - Filter configuration - Configuration du filtre - - - Include hidden files - Inclure les fichiers cachés - - - Filter: - Filtre : - - - Add Filter Configuration - Ajouter un filtre de configuration - - - Open documents - Ouvrir des documents - - - Open Documents - Documents ouverts - - - Available filters - Filtres disponibles - - - Ctrl+K - Ctrl+K - - - Type to locate - Taper pour localiser - - - Type to locate (%1) - Taper pour localiser (%1) - - - Indexing - Indexation - - - Refresh - Rafraîchir - - - Configure... - Configurer... - - - Locate... - Localiser... - - - Options - Options - - - <type here> - <taper ici> - - - %1 (prefix: %2) - %1 (préfixe : %2) - - - Configure Filters - Configurer les filtres - - - Edit - Modifier - - - Refresh Interval: - Intervalle de rafraîchissement : - - - min - min - - - Refresh interval: - Intervalle de rafraîchissement : - - - Locator filters that do not update their cached data immediately, such as the custom directory filters, update it after this time interval. - Les filtres de locator ne mettent pas à jour immédiatement leurs données mises en cache, tel que les filtres personnalisés de répertoire, celle-ci sont mise à jour après cet interval de temps. - - - - RegExp::Internal::RegExpWindow - - &Pattern: - &Motif : - - - &Escaped Pattern: - Motif &échappé : - - - &Pattern Syntax: - Syntaxe du &motif : - - - &Text: - &Texte : - - - Case &Sensitive - &Sensible à la casse - - - &Minimal - &Minimale - - - Index of Match: - Index de la correspondance : - - - Matched Length: - Longueur de la correspondance : - - - Regular expression v1 - Expression régulière v1 - - - Regular expression v2 - Expression régulière v2 - - - Wildcard - Joker - - - Fixed string - Chaîne de caractères fixe - - - &Escaped pattern: - Motif &échappé : - - - &Pattern syntax: - Syntaxe du &motif : - - - Case &sensitive - &Sensible à la casse - - - Index of match: - Index de la correspondance : - - - Matched length: - Longueur de la correspondance : - - - Regular Expression v1 - Expression régulière v1 - - - Regular Expression v2 - Expression régulière v2 - - - Fixed String - Chaîne de caractères fixe - - - Capture %1: - Capture %1 : - - - Match: - Correspondance : - - - Regular Expression - Expression régulière - - - Enter Pattern from Code... - Entrer un motif depuis le code... - - - Clear Patterns - Effacer les motifs - - - Clear Text - Effacer le texte - - - Enter Pattern from Code - Entrer un motif depuis le code - - - Enter pattern from code... - Entrer un motif depuis le code... - - - Clear patterns - Effacer les motifs - - - Clear texts - Effacer les textes - - - Enter pattern from code - Entrer le motif depuis le code - - - Pattern - Motif - - - - QtC::ResourceEditor - - Creates a Qt Resource file (.qrc). - Crée une fichier ressource Qt (.qrc). - - - Qt Resource file - Fichier de ressource Qt - - - Qt - Qt - - - Creates a Qt Resource file (.qrc) that you can add to a Qt C++ project. - Crée un fichier ressource Qt (.qrc) que vous pouvez ajouter a votre projet Qt C++. - - - Creates a Qt Resource file (.qrc) that you can add to a Qt Widget Project. - Crée un fichier de ressources Qt (.qrc) que l'on peut ajouter à un projet Qt Widget. - &Undo &Annuler @@ -12511,8 +45802,60 @@ To do this, you type this shortcut and a space in the Locator entry field, and t &Refaire - Recheck existence of referenced files - Vérifiez à nouveau l'existence des fichiers référencés + Recheck Existence of Referenced Files + Revérifier l’existence des fichiers référencés + + + Remove Prefix... + Supprimer le préfixe… + + + Rename... + Renommer… + + + Remove File... + Supprimer le fichier… + + + Open in Editor + Ouvrir dans l’éditeur + + + Copy Path + Copier le chemin + + + Copy Path "%1" + Copier le chemin « %1 » + + + Copy URL + Copier l’URL + + + Copy URL "%1" + Copier l’URL « %1 » + + + Remove Prefix + Supprimer le préfixe + + + Remove prefix %1 and all its files? + Supprimer le préfixe %1 et tous ses fichiers ? + + + File Removal Failed + Échec de la suppression du fichier + + + Removing file %1 from the project failed. + La suppression du fichier %1 du projet a échoué. + + + Rename Prefix + Renommer le préfixe Open With @@ -12520,139 +45863,1604 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Rename File... - Renommer le fichier... + Renommer le fichier… Copy Resource Path to Clipboard Copier le chemin de la ressource vers le presse-papier - untitled - sans titre - - - - SettingsDialog - - Options - Options - - - 0 - 0 - - - - QtC::ResourceEditor - - Invalid file - Fichier invalide - - - The file %1 is not in a subdirectory of the resource file. Continuing will result in an invalid resource file. - Le fichier %1 n'est pas dans un sous-dossier du fichier de ressource. Continuer résulterait en un fichier de ressource invalide. - - - Choose copy location - Choisir le chemin de la copie - - - Overwrite failed - L'écrasement a échoué - - - Copying failed - Échec de la copie - - - Add Files... - Ajouter des fichiers... - - - Change Alias... - Changer l'alias... + Sort Alphabetically + Trier par ordre alphabétique Add Prefix... - Ajouter un prefixe... + Ajouter un préfixe… Change Prefix... - Changer le préfixe... + Changer le préfixe… - Change Language... - Changer la langue... + Add Files + Ajouter des fichiers - Remove Item - Supprimer l'élément + Add Prefix + Ajouter un préfixe - Input prefix: - Préfixe d'entrée : + Remove Missing Files + Supprimer les fichiers manquants - Open file - Ouvrir le fichier + Invalid file location + Emplacement de fichier invalide - Change Prefix - Changer le préfixe + Copy + Copier - Input Prefix: - Entrée du préfixe : + Abort + Abandonner - Change Language - Changer la langue + Skip + Passer - Change File Alias - Changer l'alias du fichier + The file %1 is not in a subdirectory of the resource file. You now have the option to copy this file to a valid location. + Le fichier %1 n’est pas dans un sous-dossier du fichier de ressource. Vous avez maintenant la possibilité de le copier vers un emplacement valide. + + + Choose Copy Location + Sélectionner l’emplacement de copie + + + Overwriting Failed + Échec de l’écrasement + + + Could not overwrite file %1. + L’écrasement du fichier %1 a échoué. + + + Copying Failed + Échec de la copie + + + Could not copy the file to %1. + La copie du fichier dans « %1 » a échoué. + + + The file name is empty. + Le nom de fichier est vide. + + + XML error on line %1, col %2: %3 + Erreur XML à la ligne %1, colonne %2 : %3 + + + The <RCC> root element is missing. + L’élément racine <RCC> est manquant. + + + Cannot save file. + Impossible d’enregistrer le fichier. + + + Open File + Ouvrir le fichier + + + All files (*) + Tous les fichiers (*) + + + %1 Prefix: %2 + Préfixe de %1 : %2 - QtC::Core + QtC::ScxmlEditor - Defaults - Restaurer + Basic Colors + - Key Sequence - Combinaison de touches + Last used colors + - Shortcut: - Raccourci : + Create New Color Theme + + + + Theme ID + + + + Cannot Create Theme + + + + Theme %1 is already available. + + + + Remove Color Theme + + + + Are you sure you want to delete color theme %1? + + + + Modify Color Themes... + + + + Modify Color Theme + + + + Select Color Theme + + + + Factory Default + + + + Colors from SCXML Document + + + + Pick Color + + + + Automatic Color + + + + More Colors... + + + + SCXML Generation Failed + + + + Loading document... + + + + State Color + + + + Font Color + + + + Align Left + + + + Adjust Width + + + + Alignment + Alignement + + + Adjustment + + + + Images (%1) + + + + Untitled + Sans titre + + + Export Canvas to Image + + + + Export Failed + + + + Could not export to image. + + + + Save Screenshot + + + + Saving Failed + + + + Could not save the screenshot. + + + + Navigator + Navigateur + + + Search + Rechercher + + + Type + Type + + + Name + Nom + + + Attributes + Attributs + + + Content + Contenu + + + Tag + + + + Count + + + + yyyy/MM/dd hh:mm:ss + + + + File + Fichier + + + Time + + + + Max. levels + + + + Document Statistics + + + + Common states + + + + Metadata + + + + Other tags + + + + Unknown tags + + + + Remove items + + + + Structure + + + + Expand All + Tout développer + + + Collapse All + Tout réduire + + + Add child + + + + Change parent + + + + Errors(%1) / Warnings(%2) / Info(%3) + + + + Export to File + + + + CSV files (*.csv) + + + + Cannot open file %1. + Impossible d’ouvrir le fichier %1. + + + Severity + + + + Reason + + + + Description + Description + + + Error + Erreur + + + Warning + Avertissement + + + Info + Info + + + Unknown + Inconnue + + + Severity: %1 +Type: %2 +Reason: %3 +Description: %4 + + + + Zoom In + Zoom avant + + + Zoom In (Ctrl + + / Ctrl + Wheel) + + + + Zoom Out + Zoom arrière + + + Zoom Out (Ctrl + - / Ctrl + Wheel) + + + + Fit to View + + + + Fit to View (F11) + + + + Panning + + + + Panning (Shift) + + + + Magnifier + + + + Magnifier Tool + + + + Navigator (Ctrl+E) + + + + Copy + Copier + + + Copy (Ctrl + C) + + + + Cut + Couper + + + Cut (Ctrl + X) + + + + Paste + Coller + + + Paste (Ctrl + V) + + + + Screenshot + + + + Screenshot (Ctrl + Shift + C) + + + + Export to Image + + + + Toggle Full Namespace + Activer/désactiver l’espace de nom complet + + + Align Left (Ctrl+L,1) + + + + Align Right + + + + Align Right (Ctrl+L,2) + + + + Align Top + + + + Align Top (Ctrl+L,3) + + + + Align Bottom + + + + Align Bottom (Ctrl+L,4) + + + + Align Horizontal + + + + Align Horizontal (Ctrl+L,5) + + + + Align Vertical + + + + Align Vertical (Ctrl+L,6) + + + + Adjust Width (Ctrl+L,7) + + + + Adjust Height + + + + Adjust Height (Ctrl+L,8) + + + + Adjust Size + + + + Adjust Size (Ctrl+L,9) + + + + Show Statistics... + + + + Show Statistics + + + + Add new state + + + + Move State + + + + Align states + + + + Adjust states + + + + Re-layout + + + + State + État + + + Each state must have a unique ID. + + + + Missing ID. + + + + Duplicate ID (%1). + + + + Initial + + + + One level can contain only one initial state. + + + + Too many initial states at the same level. + + + + H + T + + + Value + Valeur + + + - name - + + + + - value - + + + + Common States + + + + Final + + + + Parallel + + + + History + + + + Unexpected element. + + + + Not well formed. + + + + Premature end of document. + + + + Custom error. + + + + Error in reading XML. +Type: %1 (%2) +Description: %3 + +Row: %4, Column: %5 +%6 + + + + Current tag is not selected. + + + + Pasted data is empty. + + + + Paste items + + + + Cannot save XML to the file %1. + + + + Add Tag + + + + Remove Tag + + + + Error in reading XML + + + + New Tag + + + + Item + + + + Remove + Supprimer + + + Created editor-instance. + + + + Editor-instance is not of the type ISCEditor. + + + + Set as Initial + + + + Zoom to State + + + + Re-Layout + + + + Change initial state + + + + Draw some transitions to state. + + + + No input connection. + + + + No input or output connections (%1). + + + + Draw some transitions to or from state. + + + + No output connections (%1). + + + + Draw some transitions from state. + + + + No input connections (%1). + + + + Remove Point + + + + Transition + + + + Transitions should be connected. + + + + Not connected (%1). + + + + Undo (Ctrl + Z) + + + + Redo (Ctrl + Y) + + + + This file can only be edited in <b>Design</b> mode. + Ce fichier ne peut être édité qu’en mode <b>Design</b>. + + + Switch Mode + - ShowBuildLog + QtC::SerialTerminal - Debugging Helper Build Log - Journal de compilation de l'assistant de debogage + Unable to open port %1: %2. + Impossible d’ouvrir le port %1 : %2. + + + Session resumed. + Reprise de la session. + + + Starting new session on %1... + Démarrage d’une nouvelle session sur %1… + + + Session finished on %1. + Session terminée sur %1. + + + Session paused... + Session interrompue… + + + No Port + Aucun port + + + Serial port error: %1 (%2) + Erreur de port série : %1 (%2) + + + Close Tab + Fermer l’onglet + + + Close All Tabs + Fermer tous les onglets + + + Close Other Tabs + Fermer tous les autres onglets + + + Type text and hit Enter to send. + Taper du texte et appuyer sur Entrée pour envoyer. + + + Serial Terminal Window + Fenêtre de terminal série + + + Connect + Se connecter + + + Disconnect + Se déconnecter + + + Reset Board + + + + Add New Terminal + Ajouter un nouveau terminal + + + Serial Terminal + Terminal série + + + None + ce sont les fins de ligne + Aucune + + + LF + LF + + + CR + CR + + + CRLF + CRLF + + + + QtC::SilverSearcher + + Search Options (optional) + Options de recherche (optionnel) + + + Silver Searcher is not available on the system. + Silver Searcher n’est pas disponible sur le système. + + + + QtC::Squish + + Details + Détails + + + Adjust references to the removed symbolic name to point to: + + + + Remove the symbolic name (invalidates names referencing it) + + + + Remove the symbolic name and all names referencing it + + + + The Symbolic Name <span style='white-space: nowrap'>"%1"</span> you want to remove is used in Multi Property Names. Select the action to apply to references in these Multi Property Names. + + + + Failed to write "%1" + + + + Incomplete Squish settings. Missing Squish installation path. + + + + objectmaptool not found. + + + + Failure while parsing objects.map content. + + + + Squish Object Map Editor + + + + New + Nouveau + + + Remove + Supprimer + + + Jump to Symbolic Name + Passer au nom symbolique + + + Symbolic Names + Noms symboliques + + + Cut + Couper + + + Copy + Copier + + + Paste + Coller + + + Delete + Supprimer + + + Copy Real Name + Copier le nom réel + + + Properties: + Propriétés : + + + The properties of the Multi Property Name associated with the selected Symbolic Name. (use \\ for a literal \ in the value) + + + + The Hierarchical Name associated with the selected Symbolic Name. + + + + Do you really want to remove "%1"? + + + + Remove Symbolic Name + + + + Ambiguous Property Name + + + + Ambiguous Symbolic Name + + + + %1 "%2" already exists. Specify a unique name. + + + + Property + Propriété + + + Symbolic Name + Nom symbolique + + + CopyOf + + + + Open Squish Test Suites + + + + Select All + Tout sélectionner + + + Deselect All + Tout désélectionner + + + Base directory: + + + + Test suites: + + + + Name + Nom + + + Operator + Opérateur + + + Value + Valeur + + + Application: + Application : + + + <No Application> + <Aucune application> + + + Arguments: + Arguments : + + + Recording Settings + + + + Suite Already Open + + + + A test suite with the name "%1" is already open. +Close the opened test suite and replace it with the new one? + + + + Confirm Delete + Confirmez la suppression + + + Are you sure you want to delete Test Case "%1" from the file system? + + + + Deletion of Test Case failed. + + + + The path "%1" does not exist or is not accessible. +Refusing to run test case "%2". + + + + Test Suite Path Not Accessible + + + + The path "%1" does not exist or is not accessible. +Refusing to run test cases. + + + + No Test Cases Defined + + + + Test suite "%1" does not contain any test cases. + + + + The path "%1" does not exist or is not accessible. +Refusing to record test case "%2". + + + + Select Global Script Folder + + + + Failed to open objects.map file at "%1". + + + + Error + Erreur + + + Squish Tools in unexpected state (%1). + + + + Squish + + + + Run This Test Case + + + + Delete Test Case + + + + Run This Test Suite + + + + Add New Test Case... + + + + Close Test Suite + + + + Delete Shared File + + + + Add Shared File + + + + Remove Shared Folder + + + + Open Squish Suites... + + + + Create New Test Suite... + + + + Close All Test Suites + + + + Close all test suites? + + + + Add Shared Folder... + + + + Remove All Shared Folders + + + + Test Suites + + + + Remove "%1" from the list of shared folders? + + + + Remove all shared folders? + + + + Record Test Case + + + + Do you want to record over the test case "%1"? The existing content will be overwritten by the recorded script. + + + + Set up a valid Squish path to be able to create a new test case. +(Edit > Preferences > Squish) + + + + Test Results + Résultats des tests + + + Runner/Server Log + + + + <b>Test summary:</b>&nbsp;&nbsp; %1 passes, %2 fails, %3 fatals, %4 errors, %5 warnings. + + + + Expand All + Tout développer + + + Collapse All + Tout réduire + + + Filter Test Results + + + + Pass + Succès + + + Fail + + + + Expected Fail + + + + Unexpected Pass + + + + Warning Messages + + + + Log Messages + + + + Check All Filters + + + + Control Bar + + + + Stop Recording + + + + Ends the recording session, saving all commands to the script file. + + + + Interrupt + Interrompre + + + Step Into + Entrer dans + + + Step Over + Passer + + + Step Out + Sortir de + + + Type + Type + + + Squish Locals + + + + Continue + Continuer + + + &Squish + + + + &Server Settings... + + + + Result + Résultat + + + Message + Message + + + Time + Temps + + + Could not get Squish license from server. + + + + Squish path: + + + + Path to Squish installation + + + + Path does not contain server executable at its default location. + + + + License path: + + + + Local Server + + + + Server host: + + + + Server Port + + + + Verbose log + + + + Minimize IDE + + + + Minimize IDE automatically while running or recording test cases. + + + + General + Général + + + Maximum startup time: + + + + Specifies how many seconds Squish should wait for a reply from the AUT directly after starting it. + + + + Maximum response time: + + + + Specifies how many seconds Squish should wait for a reply from the hooked up AUT before raising a timeout error. + + + + Maximum post-mortem wait time: + + + + Specifies how many seconds Squish should wait after the the first AUT process has exited. + + + + Animate mouse cursor: + + + + Name: + Nom : + + + Host: + Hôte : + + + Port: + Port : + + + Add Attachable AUT + + + + Add + Ajouter + + + Edit + + + + Mapped AUTs + + + + AUT Paths + + + + Attachable AUTs + + + + Select Application to test + + + + Select Application Path + + + + Squish Server Settings + + + + Failed to write configuration changes. +Squish server finished with process error %1. + + + + Run Test Suite + + + + Object Map + + + + Run Test Case + + + + Shared Folders + + + + %1 (none) + + + + Refusing to run a test case. + + + + Could not create test results folder. Canceling test run. + + + + Refusing to execute server query. + + + + Refusing to record a test case. + + + + Refusing to write configuration changes. + + + + Squish Runner Error + + + + Squish runner failed to start within given timeframe. + + + + Squish could not find the AUT "%1" to start. Make sure it has been added as a Mapped AUT in the squishserver settings. +(Tools > Squish > Server Settings...) + + + + "%1" could not be found or is not executable. +Check the settings. + + + + Squish Server Error + + + + Recording test case + + + + Running test case + + + + Test run finished. + + + + Test record finished. + + + + User stop initiated. + + + + There is still an old Squish server instance running. +This will cause problems later on. + +If you continue, the old instance will be terminated. +Do you want to continue? + + + + Squish Server Already Running + + + + Unexpected state or request while starting Squish server. (state: %1, request: %2) + + + + Squish server does not seem to be running. +(state: %1, request: %2) +Try again. + + + + No Squish Server + + + + Failed to get the server port. +(state: %1, request: %2) +Try again. + + + + No Squish Server Port + + + + Squish runner seems to be running already. +(state: %1, request: %2) +Wait until it has finished and try again. + + + + Squish Runner Running + + + + Create New Squish Test Suite + + + + Available GUI toolkits: + + + + Invalid Squish settings. Configure Squish installation path inside Preferences... > Squish > General to use this wizard. + + + + Available languages: + + + + <None> + <aucun> + + + Key is not an object. + + + + Key 'mode' is not set. + + + + Unsupported mode: + + + + Could not merge results into single results.xml. +Destination file "%1" already exists. + + + + Could not merge results into single results.xml. +Failed to open file "%1" + + + + Error while parsing first test result. + QtC::Subversion - - Prompt to submit - Invite lors du submit - - - Subversion Command: - Commande Subversion : - Authentication Identification - - User name: - Nom d'utilisateur : - Password: Mot de passe : @@ -12671,7 +47479,7 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Username: - Nom d'utilisateur : + Nom d’utilisateur : Miscellaneous @@ -12679,32 +47487,24 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Timeout: - Timeout : + Délai d’attente : s s - - Prompt on submit - Invite lors du submit - Ignore whitespace changes in annotation - Ignorer les changements d'espaces dans les annotations + Ignorer les changements d’espaces dans les annotations Log count: - Nombre de log : + Nombre d’entrées de log : Subversion Command Commande Subversion - - Subversion Output - Sortie de Subversion - &Subversion &Subversion @@ -12715,39 +47515,23 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Add "%1" - Ajouter "%1" + Ajouter « %1 » Alt+S,Alt+A Alt+S,Alt+A - - Delete - Supprimer - - - Delete "%1" - Supprimer "%1" - - - Revert - Rétablir - - - Revert "%1" - Rétablir "%1" - Diff Project Faire un diff sur le projet Diff Current File - Faire un diff du fichier courant + Faire un diff du fichier actuel Diff "%1" - Faire un diff de "%1" + Faire un diff de « %1 » Alt+S,Alt+D @@ -12759,11 +47543,11 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Commit Current File - Faire un commit du fichier courant + Faire un commit du fichier actuel Commit "%1" - Faire un commit de "%1" + Faire un commit de « %1 » Alt+S,Alt+C @@ -12771,27 +47555,31 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Filelog Current File - Journal du fichier courant + Journal du fichier actuel Filelog "%1" - Journal du fichier "%1" + Journal du fichier « %1 » Annotate Current File - Annoter le fichier courant + Annoter le fichier actuel Annotate "%1" - Annoter "%1" + Annoter « %1 » Describe... - Décrire... + Décrire… Project Status - Statut du projet + État du projet + + + Triggers a Subversion version control operation. + Déclenche une opération du gestionnaire de versions Subversion. Meta+S,Meta+D @@ -12811,23 +47599,23 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Delete "%1"... - Supprimer "%1"… + Supprimer « %1 »… Revert... - Rétablir... + Rétablir… Revert "%1"... - Rétablir "%1"... + Rétablir « %1 »… Diff Project "%1" - Réaliser un diff du projet "%1" + Réaliser un diff du projet « %1 » Status of Project "%1" - Statut du projet "%1" + État du projet « %1 » Log Project @@ -12835,7 +47623,7 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Log Project "%1" - Réaliser un log du projet "%1" + Réaliser un log du projet « %1 » Update Project @@ -12843,7 +47631,7 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Update Project "%1" - Mettre à jour le projet "%1" + Mettre à jour le projet « %1 » Commit Project @@ -12851,7 +47639,7 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Commit Project "%1" - Faire un commit du projet "%1" + Faire un commit du projet « %1 » Diff Repository @@ -12859,7 +47647,7 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Repository Status - Statut du dépôt + État du dépôt Log Repository @@ -12871,39 +47659,11 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Revert Repository... - Rétablir le dépôt... + Rétablir le dépôt… - Commit - Faire un commit - - - Diff &Selected Files - Faire un diff sur tous les fichiers &sélectionnés - - - Diff Selected Files - Faire un diff sur tous les fichiers sélectionnés - - - &Undo - Annu&ler - - - &Redo - &Refaire - - - Closing Subversion Editor - Fermeture de l'éditeur Subversion - - - Do you want to commit the change? - Voulez vous envoyer les changements ? - - - The commit message check failed. Do you want to commit the change? - La vérification du message de commit a échoué. Voulez-vous soumettre vos modifications ? + No subversion executable specified. + Aucun exécutable Subversion n’a été spécifié. Revert repository @@ -12911,35 +47671,23 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Revert all pending changes to the repository? - Rétablir tous les changements en attente du dépôt ? - - - Would you like to revert all changes to the repository? - Souhaitez-vous rétablir toutes les modifications sur le dépôt ? + Rétablir tous les changements en attente du dépôt ? Revert failed: %1 - Éche de la restauration : %1 + Échec de la restauration : %1 The file has been changed. Do you want to revert it? - Le fichier a été modifié. Voulez-vous le rétablir ? - - - The commit list spans several repositories (%1). Please commit them one by one. - La liste de commits s'étend sur plusieur répertoire (%1). Veuillez les ajouter un par un. + Le fichier a été modifié. Voulez-vous le rétablir ? Another commit is currently being executed. - Un autre commit est en cours d'exécution. + Un autre commit est en cours d’exécution. There are no modified files. - Il n'y a aucun fichier modifié. - - - Cannot create temporary file: %1 - Impossible de créer le fichier temporaire : %1 + Il n’y a aucun fichier modifié. Describe @@ -12949,73 +47697,207 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Revision number: Numéro de révision : - - Executing in %1: %2 %3 - - Exécution dans %1 : %2 %3 - - - - No subversion executable specified! - Aucun exécutable Subversion n'a été spécifié ! - - - Executing: %1 %2 - - Exécution de : %1 %2 - - - - %1 Executing: %2 %3 - - <timestamp> Executing: <executable> <arguments> - %1 Exécution de : %2 %3 - - - The process terminated with exit code %1. - Le processus s'est terminé avec le code %1. - - - The process terminated abnormally. - Le processus s'est terminé de façon anormale. - - - Could not start subversion '%1'. Please check your settings in the preferences. - Impossible de démarrer subversion "%1". Veuillez vérifier la configuration dans les préférences. - - - Subversion did not respond within timeout limit (%1 ms). - Subversion n'a pas répondu après la limite de temps (%1 ms). - Subversion Submit Submit sur Subversion + + Annotate revision "%1" + Révision annotée « %1 » + + + Verbose + Verbeux + + + Show files changed in each revision + Afficher les fichiers modifiés pour chaque révision + + + Waiting for data... + En attente de données… + QtC::TextEditor - Search - Rechercher + Autocomplete common &prefix + Autocomplétion du &préfixe commun + + + &Case-sensitivity: + Sensibilité à la &casse : + + + Full + Totale + + + First Letter + Première lettre + + + Timeout in ms: + Délai d’attente en ms : + + + Character threshold: + Seuil de caractères : + + + Inserts the common prefix of available completion items. + Insère le préfixe commun des éléments de complétion disponibles. + + + Automatically split strings + Découpage automatique des chaînes de caractères + + + Splits a string into two lines by adding an end quote at the cursor position when you press Enter and a start quote to the next line, before the rest of the string. + +In addition, Shift+Enter inserts an escape character at the cursor position and moves the rest of the string to the next line. + Divise une chaîne en deux lignes en ajoutant un guillemet de fin à la position du curseur lorsque vous appuyez sur Entrée et un guillemet de début à la ligne suivante, avant le reste de la chaîne. + +En outre, Maj+Entrée insère un caractère d’échappement à la position du curseur et déplace le reste de la chaîne à la ligne suivante. + + + Insert opening or closing brackets + Insérer des parenthèses ouvrantes ou fermantes + + + Insert closing quote + Insérer une parenthèse fermante + + + Surround text selection with brackets + Entourer la sélection de texte avec des crochets + + + When typing a matching bracket and there is a text selection, instead of removing the selection, surrounds it with the corresponding characters. + Lorsque l’on saisit une parenthèse correspondante et qu’il y a une sélection de texte, au lieu de supprimer la sélection, on l’entoure des caractères correspondants. + + + Insert &space after function name + Insérer une e&space après le nom d’une fonction + + + Surround text selection with quotes + Entourer la sélection de texte avec des guillemets + + + When typing a matching quote and there is a text selection, instead of removing the selection, surrounds it with the corresponding characters. + Lorsque l’on saisit un guillemet correspondant et qu’il y a une sélection de texte, au lieu de supprimer la sélection, on l’entoure des caractères correspondants. + + + Animate automatically inserted text + Animer le texte inséré automatiquement + + + Show a visual hint when for example a brace or a quote is automatically inserted by the editor. + Afficher une indication visuelle lorsque, par exemple, une accolade ou un guillemet est insérée automatiquement par l’éditeur. + + + Highlight automatically inserted text + Surligner le texte inséré automatiquement + + + Skip automatically inserted character when typing + Sauter le caractère inséré automatiquement lors de la frappe + + + Skip automatically inserted character if re-typed manually after completion or by pressing tab. + Sauter le caractère inséré automatiquement s’il est ressaisi manuellement après avoir été complété ou en appuyant sur la touche tabulation. + + + Remove automatically inserted text on backspace + Supprimer le texte inséré automatiquement lors d’un retour arrière + + + Remove the automatically inserted character if the trigger is deleted by backspace after the completion. + Supprime le caractère inséré automatiquement si le déclencheur est supprimé par un espacement arrière après la complétion. + + + Overwrite closing punctuation + Remplacer la ponctuation finale + + + Automatically overwrite closing parentheses and quotes. + Remplacer automatiquement les parenthèses fermantes et les guillemets. + + + Enable Doxygen blocks + Activer les blocs Doxygen + + + Automatically creates a Doxygen comment upon pressing enter after a '/**', '/*!', '//!' or '///'. + Crée automatiquement un commentaire Doxygen en appuyant sur la touche Entrée après un '/**', '/*!', '//!' ou '///'. + + + Generate brief description + Générer une description « brief » + + + Generates a <i>brief</i> command with an initial description for the corresponding declaration. + Génère une commande <i>brief</i> avec une description initiale pour la déclaration correspondante. + + + Add leading asterisks + Ajouter des astérisques en début de ligne + + + Adds leading asterisks when continuing C/C++ "/*", Qt "/*!" and Java "/**" style comments on new lines. + Ajout d’astérisques en début de ligne lors de la continuation de commentaires de style C/C++ « /* », Qt « /* ! » et Java « /** » sur de nouvelles lignes. + + + Documentation Comments + Commentaires de documentation + + + Completion + Complétion + + + Activate completion: + Activer la complétion : + + + Manually + Manuellement + + + When Triggered + À la demande + + + &Automatically insert matching characters + Insérer &automatiquement les caractères correspondants + + + Internal + Interne + + + Searching + Recherche + + + %n found. + + %n trouvé. + %n trouvés. + + + + %n occurrences replaced. + + %n occurrence remplacée. + %n occurrences remplacées. + Aborting replace. Annulation du remplacement. - - List of comma separated wildcard filters - wildcard -> joker mais est-ce le terme pour les expressions régulières en français ? - Liste de filtres 'joker' séparés par des virgules - - - untitled - document ? (en plus c'est plus long...) - sans titre - - - Opening file - Ouverture du fichier - Line: %1, Col: %2 Ligne %1, colonne %2 @@ -13024,125 +47906,45 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Line: 9999, Col: 999 Ligne 9999, colonne 999 - - <html><head/><body> -Controls the indentation style of curly brace blocks. - -<ul> -<li>Exclude Braces: The braces are not indented. -<pre> -void foo() -{ - if (a) - { - bar(); - } -} -</pre> -</li> - -<li>Include Braces: The braces are indented. The contents of the block are on the same level as the braces. -<pre> -void foo() - { - if (a) - { - bar(); - } - } -</pre> -</li> - -<li>GNU Style: Indent the braces for blocks in statements. The contents are indented twice. -<pre> -void foo() -{ - if (a) - { - bar(); - } -} -</pre> -</li> -</ul></body></html> - <html><head/><body> -Contrôle le style d'indentation des blocs entre accolades. -<ul> -<li>Accolades exclusives : elles ne sont pas indentées. -<pre> -void foo() -{ - if (a) - { - bar(); - } -} -</pre> -</li> - -<li>Accolades inclusives : elles sont indentées. Le contenu du bloc est au même niveau que les accolades. -<pre> -void foo() - { - if (a) - { - bar(); - } - } -</pre> -</li> - -<li>Style GNU : indenter les accolades de blocs dans des déclarations. Le contenu est indenté deux fois. -<pre> -void foo() -{ - if (a) - { - bar(); - } -} -</pre> -</li> -</ul></body></html> - Global Settings Globaux - - Animate matching parentheses - Animer les parenthèses correspondantes - - - Navigation - Navigation - - - Mark text changes - Put a red mark next to the text that has been modified since the last save - Marquer le texte modifié - - - Font & Colors - Polices & couleurs - Copy Color Scheme Copier le jeu de couleurs - - Color Scheme name: - Nom du jeu de couleurs : - Font && Colors - Polices && couleurs + Polices et couleurs Color scheme name: Nom du jeu de couleurs : + + A line spacing value other than 100% disables text wrapping. +A value less than 100% can result in overlapping and misaligned graphics. + Une valeur d’interligne différente de 100 % désactive le découpage du texte. +Une valeur inférieure à 100 % peut entraîner un chevauchement et un mauvais alignement des éléments graphiques. + + + Import + Importer + + + Export + Exporter + + + Line spacing: + Espacement des lignes : + + + Color Scheme for Theme "%1" + Jeu de couleurs pour le thème « %1 » + %1 (copy) %1 (copie) @@ -13153,7 +47955,19 @@ void foo() Are you sure you want to delete this color scheme permanently? - Êtes vous sûr de vouloir supprimer ce jeu de couleurs ? + Êtes-vous sûr de vouloir supprimer ce jeu de couleurs ? + + + Import Color Scheme + Importer un jeu de couleurs + + + Color scheme (*.xml);;All files (*) + Jeu de couleurs (*.xml);;Tous les fichiers (*) + + + Export Color Scheme + Exporter le jeu de couleurs Delete @@ -13165,47 +47979,19 @@ void foo() The color scheme "%1" was modified, do you want to save the changes? - Le jeu de couleurs "%1" a été modifié, voulez-vous enregistrer les changements ? + Le jeu de couleurs « %1 » a été modifié, voulez-vous enregistrer les changements ? Discard Abandonner - - - This is only an example. - \n\tCeci est seulement un exemple. - - - Text Encoding - Encodage du texte - - - -The following encodings are likely to fit: - -Les encodages suivants pourraient convenir : - - - Select encoding for "%1".%2 - Selectionner l'encodage pour "%1".%2 - - - Reload with Encoding - Recharger avec l'encodage - - - Save with Encoding - Sauver avec l'encodage - Current File - lower character at the beginning because this is indented after "Rechercher dans..." - fichier courant + Fichier actuel - File '%1': - Fichier '%1' : + File "%1": + Fichier « %1 » : File path: %1 @@ -13230,13 +48016,9 @@ Les encodages suivants pourraient convenir : c'est le français pour anti-aliasing ? Anticrénelage - - Color Scheme - Jeu de couleurs - Copy... - Copier... + Copier… % @@ -13246,6 +48028,10 @@ Les encodages suivants pourraient convenir : Zoom: Zoom : + + Jumps to the given line in the current document. + Aller à la ligne donnée dans le document en cours. + Line %1, Column %2 Ligne %1, colonne %2 @@ -13258,41 +48044,9 @@ Les encodages suivants pourraient convenir : Column %1 Colonne %1 - - Line in current document - Ligne du document courant - Line in Current Document - Ligne du document courant - - - Creates a text file (.txt). - Créer un fichier texte (.txt). - - - Creates a text file. The default file extension is <tt>.txt</tt>. You can specify a different extension as part of the filename. - Crée un fichier texte. L'extension par défaut est <tt>.txt</tt>. Vous pouvez spécifier une extension différente lors de la saisie du nom de fichier. - - - Text File - Fichier texte - - - General - Général - - - Creates a scratch buffer using a temporary file. - Crée un brouillon en utilisant un fichier temporaire. - - - Scratch Buffer - Brouillon - - - Triggers a completion in this scope - Lancer la complétion dans ce contexte + Ligne du document actuel Ctrl+Space @@ -13303,36 +48057,65 @@ Les encodages suivants pourraient convenir : Meta+Espace - Triggers a quick fix in this scope - Lancer une réparation rapide dans ce contexte + Trigger Completion + Déclencher la complétion + + + Display Function Hint + Afficher les indications de fonctions + + + Meta+Shift+D + Meta+Maj+D + + + Ctrl+Shift+D + Ctrl+Maj+D + + + Trigger Refactoring Action + Déclencher une action de refactorisation Alt+Return Alt+Entrée + + Show Context Menu + Afficher le menu contextuel + + + Text + SnippetProvider + Texte + Selected text within the current document. - Sélectionner le texte dans le document courant. + Sélectionner le texte dans le document actuel. Line number of the text cursor position in current document (starts with 1). - Numéro de ligne de la position du curseur de texte dans le document courant (débute à 1). + Numéro de ligne de la position du curseur de texte dans le document actuel (débute à 1). Column number of the text cursor position in current document (starts with 0). - Numéro de colonne de la position du curseur de texte dans le document courant (débute à 0). + Numéro de colonne de la position du curseur de texte dans le document actuel (débute à 0). Number of lines visible in current document. - Nombre de lignes visibles dans le document courant. + Nombre de lignes visibles dans le document actuel. Number of columns visible in current document. - Nombre de colonnes visibles dans le document courant. + Nombre de colonnes visibles dans le document actuel. Current document's font size in points. - Taille de la police du document courant en points. + Taille de la police du document actuel en points. + + + Word under the current document's text cursor. + Mot sous le curseur de texte du document actuel. &Undo @@ -13344,7 +48127,7 @@ Les encodages suivants pourraient convenir : Select Encoding... - Choisir l'encodage... + Choisir l’encodage… Auto-&indent Selection @@ -13354,14 +48137,6 @@ Les encodages suivants pourraient convenir : Ctrl+I Ctrl+I - - Meta - Meta - - - Ctrl - Ctrl - &Rewrap Paragraph &Réadapter les retour à la ligne du paragraphe @@ -13400,7 +48175,7 @@ Les encodages suivants pourraient convenir : Toggle Comment &Selection - Inverser la &sélection de commentaires + Activer/désactiver la &sélection de commentaires Copy &Line @@ -13410,22 +48185,6 @@ Les encodages suivants pourraient convenir : Ctrl+Ins Ctrl+Ins - - Delete Word From The Cursor On - Supprimer les mots à partir du curseur - - - Delete Word Camel Case From The Cursor On - Supprimers les mots en Camel Case à partir du curseur - - - Delete Word Up To The Cursor - Supprimer les mots jusqu'au curseur - - - Delete Word Camel Case Up To The Cursor - Supprimez les mots en Camel Case jusqu'au curseur - Fold Plier @@ -13434,10 +48193,6 @@ Les encodages suivants pourraient convenir : Unfold Déplier - - (Un)&Fold All - (Dé)&plier tout - Reset Font Size Réinitialiser la taille de la police @@ -13454,34 +48209,10 @@ Les encodages suivants pourraient convenir : Go to Block End Aller à la fin du bloc - - Go to Block Start With Selection - Sélectionner jusqu'au début du bloc - - - Go to Block End With Selection - Sélectionner jusqu'à la fin du bloc - Ctrl+E, Ctrl+W Ctrl+E, Ctrl+W - - %1+E, R - %1+E, R - - - %1+E, %2+V - %1+E, %2+V - - - %1+E, %2+W - %1+E, %2+W - - - (Un)Comment &Selection - (Dé)commenter la &Sélection - Ctrl+/ Ctrl+/ @@ -13492,32 +48223,20 @@ Les encodages suivants pourraient convenir : Shift+Del - Shift+Suppr + Maj+Suppr Delete &Line Effacer la &ligne - - Collapse - Réduire - Ctrl+< Ctrl+< - - Expand - Développer - Ctrl+> Ctrl+> - - (Un)&Collapse All - (Dé)&plier tout - Increase Font Size Augmenter la taille de la police @@ -13534,55 +48253,49 @@ Les encodages suivants pourraient convenir : Ctrl+- Ctrl+- - - Goto Block Start - Aller au début du bloc - Ctrl+[ Ctrl+[ - - Goto Block End - Aller à la fin du bloc - Ctrl+] Ctrl+] - - Goto Block Start With Selection - Allez jusqu'au début du bloc avec la sélection? - Sélectionner jusqu'au début du bloc - Ctrl+{ Ctrl+{ - - Goto Block End With Selection - Allez jusqu'à la fin du bloc avec la sélection? - Sélectionner jusqu'à la fin du bloc - Delete Word from Cursor On Supprimer les mots à partir du curseur Delete Word Camel Case from Cursor On - Supprimers les mots en Camel Case à partir du curseur + Supprimer les mots en Camel Case à partir du curseur Delete Word up to Cursor - Supprimer les mots jusqu'au curseur + Supprimer les mots jusqu’au curseur Delete Word Camel Case up to Cursor - Supprimez les mots en Camel Case jusqu'au curseur + Supprimer les mots en Camel Case jusqu’au curseur + + + &Sort Selected Lines + &Trier les lignes sélectionnées + + + Meta+Shift+S + Meta+Maj+S + + + Alt+Shift+S + Alt+Maj+S Toggle &Fold All - Activer et &plier tout + Activer/désactiver tout &plier Meta+0 @@ -13590,11 +48303,11 @@ Les encodages suivants pourraient convenir : Go to Block Start with Selection - Sélectionner jusqu'au début du bloc + Sélectionner jusqu’au début du bloc Go to Block End with Selection - Sélectionner jusqu'à la fin du bloc + Sélectionner jusqu’à la fin du bloc Ctrl+} @@ -13616,25 +48329,137 @@ Les encodages suivants pourraient convenir : Join Lines Joindre les lignes + + Delete Line from Cursor On + Supprimer la ligne à partir du curseur + + + Delete Line up to Cursor + Supprimer la ligne jusqu’au curseur + + + Ctrl+Backspace + Ctrl+Retour arr + Ctrl+J Ctrl+J Insert Line Above Current Line - Insérer une ligne au-dessus de l'actuelle + Insérer une ligne au-dessus de l’actuelle Ctrl+Shift+Return - Ctrl+Shift+Return + Ctrl+Maj+Entrée Insert Line Below Current Line - Insérer une ligne en-dessous de l'actuelle + Insérer une ligne en-dessous de l’actuelle Ctrl+Return - Ctrl+Return + Ctrl+Entrée + + + Toggle UTF-8 BOM + Activer/désactiver UTF-8 BOM + + + Find References to Symbol Under Cursor + Trouver des références au symbole sous le curseur + + + Rename Symbol Under Cursor + Renommer le symbole sous le curseur + + + Ctrl+Shift+R + Ctrl+Maj+R + + + Jump to File Under Cursor + Aller au fichier sous le curseur + + + Jump to File Under Cursor in Next Split + Sauter au fichier sous le curseur dans le panneau suivant + + + Move the View a Page Up and Keep the Cursor Position + Déplacer la vue d’une page vers le haut et conserver la position du curseur + + + Ctrl+PgUp + Ctrl+Pg suiv + + + Move the View a Page Down and Keep the Cursor Position + Déplacer la vue d’une page vers le bas et conserver la position du curseur + + + Ctrl+PgDown + Ctrl+Pg préc + + + Move the View a Line Up and Keep the Cursor Position + Déplacer la vue d’une ligne vers le haut et conserver la position du curseur + + + Ctrl+Up + Ctrl+Haut + + + Move the View a Line Down and Keep the Cursor Position + Déplacer la vue d’une ligne vers le bas et conserver la position du curseur + + + Ctrl+Down + Ctrl+Bas + + + Paste Without Formatting + Coller sans mise en forme + + + Ctrl+Alt+Shift+V + Ctrl+Alt+Maj+V + + + Auto-&format Selection + Auto-&formater la sélection + + + Ctrl+; + Ctrl+; + + + Copy With Highlighting + Copier en surlignant + + + Create Cursors at Selected Line Ends + Créer des curseurs aux extrémités des lignes sélectionnées + + + Alt+Shift+I + Alt+Maj+I + + + Add Next Occurrence to Selection + Ajouter l’occurrence suivante à la sélection + + + Ctrl+D + Ctrl+D + + + &Duplicate Selection + &Dupliquer la sélection + + + &Duplicate Selection and Comment + &Dupliquer la sélection et le commentaire Uppercase Selection @@ -13642,11 +48467,11 @@ Les encodages suivants pourraient convenir : Alt+Shift+U - Alt+Shift+U + Alt+Maj+U Meta+Shift+U - Meta+Shift+U + Meta+Maj+U Lowercase Selection @@ -13660,13 +48485,29 @@ Les encodages suivants pourraient convenir : Meta+U Meta+U + + Ctrl+Shift+Alt+U + Ctrl+Maj+Alt+U + + + Select Word Under Cursor + Sélectionner le mot sous le curseur + + + Go to Document Start + Aller au début du document + + + Go to Document End + Aller à la fin du document + Paste from Clipboard History - Coller à partir de l'historique du presse papier + Coller à partir de l’historique du presse-papier Ctrl+Shift+V - Ctrl+Shift+V + Ctrl+Maj+V Indent @@ -13674,7 +48515,7 @@ Les encodages suivants pourraient convenir : Unindent - Supprimer l'indentation + Supprimer l’indentation Follow Symbol Under Cursor @@ -13692,10 +48533,6 @@ Les encodages suivants pourraient convenir : Ctrl+E, F2 Ctrl+E, F2 - - Jump To File Under Cursor - Aller au fichier sous le curseur - Go to Line Start Aller au début de ligne @@ -13710,7 +48547,7 @@ Les encodages suivants pourraient convenir : Go to Previous Line - Aller à la ligne précedente + Aller à la ligne précédente Go to Previous Character @@ -13738,135 +48575,51 @@ Les encodages suivants pourraient convenir : Go to Line Start with Selection - Selectionner jusqu'au début de ligne + Sélectionner jusqu’au début de ligne Go to Line End with Selection - Sélectionner jusqu'à la fin de la ligne + Sélectionner jusqu’à la fin de la ligne Go to Next Line with Selection - Sélectionner jusqu'à la ligne suivante + Sélectionner jusqu’à la ligne suivante Go to Previous Line with Selection - Sélectionner jusqu'à la ligne précédente + Sélectionner jusqu’à la ligne précédente Go to Previous Character with Selection - Sélectionner jusqu'au caractère précédent + Sélectionner jusqu’au caractère précédent Go to Next Character with Selection - Sélectionner jusqu'au caractère suivant + Sélectionner jusqu’au caractère suivant Go to Previous Word with Selection - Sélectionner jusqu'au mot précédent + Sélectionner jusqu’au mot précédent Go to Next Word with Selection - Sélectionner jusqu'au mot suivant + Sélectionner jusqu’au mot suivant Go to Previous Word Camel Case with Selection - Sélectionner jusqu'au mot en Camel Case précédent + Sélectionner jusqu’au mot en Camel Case précédent Go to Next Word Camel Case with Selection - Sélectionner jusqu'au mot en Camel Case suivant + Sélectionner jusqu’au mot en Camel Case suivant <line>:<column> <ligne>:<colonne> - - Goto Line Start - Aller au début de ligne - - - Goto Line End - Aller à la fin de ligne - - - Goto Next Line - Aller à la ligne suivante - - - Goto Previous Line - Aller à la ligne précédente - - - Goto Previous Character - Aller au caractère précédent - - - Goto Next Character - Aller au caractère suivant - - - Goto Previous Word - Aller au mot précédent - - - Goto Next Word - Aller au mot suivant - - - Goto Previous Word Camel Case - Aller au mot en Camel Case précédent - - - Goto Next Word Camel Case - Aller au mot en Camel Case suivant - - - Goto Line Start With Selection - Sélectionner jusqu'au début de ligne - - - Goto Line End With Selection - Sélectionner jusqu'à la fin de ligne - - - Goto Next Line With Selection - Sélectionner jusqu'à la ligne suivante - - - Goto Previous Line With Selection - Sélectionner jusqu'à la ligne précédente - - - Goto Previous Character With Selection - Sélectionner jusqu'au caractère précédent - - - Goto Next Character With Selection - Sélectionner jusqu'au caractère suivant - - - Goto Previous Word With Selection - Sélectionner jusqu'au mot précédent - - - Goto Next Word With Selection - Sélectionner jusqu'au mot suivant - - - Goto Previous Word Camel Case With Selection - Sélectionner jusqu'au mot en Camel Case pécédent - - - Goto Next Word Camel Case With Selection - Sélectionner jusqu'au mot en Camel Case suivant - - - <line number> - <numéro de ligne> - Ctrl+Shift+U - Ctrl+Shift+U + Ctrl+Maj+U Move Line Up @@ -13874,7 +48627,7 @@ Les encodages suivants pourraient convenir : Ctrl+Shift+Up - Ctrl+Shift+Up + Ctrl+Maj+Haut Move Line Down @@ -13882,7 +48635,7 @@ Les encodages suivants pourraient convenir : Ctrl+Shift+Down - Ctrl+Shift+Down + Ctrl+Maj+Bas Copy Line Up @@ -13890,7 +48643,7 @@ Les encodages suivants pourraient convenir : Ctrl+Alt+Up - Ctrl+Alt+Up + Ctrl+Alt+Haut Copy Line Down @@ -13898,21 +48651,17 @@ Les encodages suivants pourraient convenir : Ctrl+Alt+Down - Ctrl+Alt+Down - - - <line number> - <numéro de ligne> + Ctrl+Alt+Bas Text Texte - Generic text. -Applied to text, if no other rules matching. - Texte générique. -Appliquée au texte, s'il n'y a pas d'autres règles correspondantes. + Generic text and punctuation tokens. +Applied to text that matched no other rule. + Texte générique et éléments de ponctuation. +S’applique au texte qui ne correspond à aucune autre règle. Link @@ -13937,7 +48686,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Line numbers located on the left side of the editor. - Numéros de ligne situés sur le côté gauche de l'éditeur. + Numéros de ligne situés sur le côté gauche de l’éditeur. Search Result @@ -13945,7 +48694,37 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Highlighted search results inside the editor. - Surligner les résultats de la recherche à l'intérieur de l'éditeur. + Surligner les résultats de la recherche à l’intérieur de l’éditeur. + + + Search Result (Alternative 1) + Résultat de recherche (alternative 1) + + + Highlighted search results inside the editor. +Used to mark read accesses to C++ symbols. + Résultats de la recherche mis en évidence dans l’éditeur. +Utilisé pour marquer les accès en lecture aux symboles C++. + + + Search Result (Alternative 2) + Résultat de recherche (alternative 2) + + + Highlighted search results inside the editor. +Used to mark write accesses to C++ symbols. + Résultats de la recherche mis en évidence dans l’éditeur. +Utilisé pour marquer les accès en écriture aux symboles C++. + + + Search Result Containing function + Résultat de la recherche contenant une fonction + + + Highlighted search results inside the editor. +Used to mark containing function of the symbol usage. + Résultats de la recherche mis en évidence dans l’éditeur. +Utilisé pour marquer la fonction contenant l’utilisation du symbole. Search Scope @@ -13954,7 +48733,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Section where the pattern is searched in. - Section dans laquelle le modèle est recherché. + Section dans laquelle le motif est recherché. Parentheses @@ -13962,11 +48741,27 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Displayed when matching parentheses, square brackets or curly brackets are found. - Afficher lorsque les parenthèses, les crochets ou les accolades correspondants sont trouvés. + S’affiche lorsque les parenthèses, les crochets ou les accolades correspondants sont trouvés. + + + Mismatched Parentheses + Parenthèses mal appariées + + + Displayed when mismatched parentheses, square brackets, or curly brackets are found. + S’affiche lorsque des parenthèses, des crochets ou des accolades ne sont pas appariés. + + + Auto Complete + Auto-complétion + + + Displayed when a character is automatically inserted like brackets or quotes. + S’affiche lorsqu’un caractère est automatiquement inséré, comme des parenthèses ou des guillemets. Current Line - Ligne courante + Ligne actuelle Line where the cursor is placed in. @@ -13974,15 +48769,15 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Current Line Number - Numéro de la ligne courante + Numéro de la ligne actuelle Line number located on the left side of the editor where the cursor is placed in. - Numéro de la ligne situé sur le côté gauche de l'éditeur correspondant à l'emplacement du curseur. + Numéro de la ligne situé sur le côté gauche de l’éditeur correspondant à l’emplacement du curseur. Occurrences - Occurences + Occurrences Occurrences of the symbol under the cursor. @@ -13991,7 +48786,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Unused Occurrence - Occurence inutilisé + Occurrence inutilisée Occurrences of unused variables. @@ -13999,20 +48794,19 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Renaming Occurrence - Renommer l'occurence + Renommer l’occurrence Occurrences of a symbol that will be renamed. - Occurrences du symbole qui seront renommés. + Occurrences d’un symbole qui sera renommé. Number - Numéro + Nombre Number literal. - ou nombre littéral ? - Nombre constant. + Nombre littéral. String @@ -14020,7 +48814,15 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Character and string literals. - Constantes caractère et chaîne. + Caractères et chaînes de caractères littérales. + + + Primitive Type + Type primitif + + + Name of a primitive data type. + Nom d’un type de donnée primitif. Type @@ -14028,16 +48830,32 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Name of a type. - Nom d'un type. + Nom d’un type. + + + Namespace + Espace de nom + + + Name of a namespace. + Nom de l’espace de nom. Local - Locale + Local Local variables. Variables locales. + + Parameter + Paramètre + + + Function or method parameters. + Paramètres de fonction ou de méthode. + Field Champ @@ -14046,13 +48864,37 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Class' data members. Données membres de classe. + + Global + Global + + + Global variables. + Variables globales. + Enumeration Énumération Applied to enumeration items. - Appliqué aux éléments d'une énumération. + S’applique aux éléments d’une énumération. + + + Declaration + Déclaration + + + Style adjustments to declarations. + Ajustements de style des déclarations. + + + Function Definition + Définition de fonction + + + Name of function at its definition. + Nom de la fonction lors de sa définition. Virtual Function @@ -14060,7 +48902,47 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Name of function declared as virtual. - Nom de la fonction est déclarée comme virtuelle. + Nom d’une fonction déclarée comme virtuelle. + + + Reserved keywords of the programming language except keywords denoting primitive types. + Mots-clés réservés du langage de programmation, à l’exception des mots-clés désignant des types primitifs. + + + Punctuation + Ponctuation + + + Punctuation excluding operators. + Ponctuation à l’exception des opérateurs. + + + Non user-defined language operators. +To style user-defined operators, use Overloaded Operator. + Opérateurs du langage non définis par l’utilisateur. +Pour styliser les opérateurs définis par l’utilisateur, utilisez l’opérateur surchargé. + + + Overloaded Operators + Opérateurs surchargés + + + Calls and declarations of overloaded (user-defined) operators. + Appels et déclarations d’opérateurs surchargés (définis par l’utilisateur). + + + Macro + Macro + + + Macros. + Macros. + + + Whitespace. +Will not be applied to whitespace in comments and strings. + Espace blanc. +Ne s’applique pas aux espaces blancs dans les commentaires et dans les chaînes de caractères. Diff File Line @@ -14068,7 +48950,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Applied to lines with file information in differences (in side-by-side diff editor). - Appliqué aux lignes avec les informations de fichier dans les différences (dans l'éditeur de différences face à face). + S’applique aux lignes avec les informations de fichier dans les différences (dans l’éditeur de différences face à face). Diff Context Line @@ -14076,7 +48958,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Applied to lines describing hidden context in differences (in side-by-side diff editor). - Appliqué aux lignes décrivant des contextes masqués dans les différences (dans l'éditeur de différences en face à face). + S’applique aux lignes décrivant des contextes masqués dans les différences (dans l’éditeur de différences en face à face). Diff Source Line @@ -14084,7 +48966,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Applied to source lines with changes in differences (in side-by-side diff editor). - Appliqué aux lignes de la source ayant des changements dans les différences (dans l'éditeur de différences face à face). + S’applique aux lignes de la source ayant des changements dans les différences (dans l’éditeur de différences face à face). Diff Source Character @@ -14092,7 +48974,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Applied to removed characters in differences (in side-by-side diff editor). - Appliqué sur les caractères supprimés dans les différences (dans l'éditeur de différences face à face). + S’applique sur les caractères supprimés dans les différences (dans l’éditeur de différences face à face). Diff Destination Line @@ -14100,7 +48982,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Applied to destination lines with changes in differences (in side-by-side diff editor). - Appliqué aux lignes de destination ayant des changements dans les différences (dans l'éditeur de différences face à face). + S’applique aux lignes de destination ayant des changements dans les différences (dans l’éditeur de différences face à face). Diff Destination Character @@ -14108,11 +48990,171 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Applied to added characters in differences (in side-by-side diff editor). - Appliqué aux caractères ajoutés dans les différences (dans l'éditeur de différences face à face). + S’applique aux caractères ajoutés dans les différences (dans l’éditeur de différences face à face). - Applied to Enumeration Items. - Appliqué aux éléments d'une énumération. + Log Change Line + Journaliser les lignes modifiées + + + Applied to lines describing changes in VCS log. + S’applique aux lignes décrivant les changements dans le journal VCS. + + + Log Author Name + Journaliser les noms d’auteur + + + Applied to author names in VCS log. + S’applique aux noms d’auteur dans le journal VCS. + + + Log Commit Date + Journaliser les dates de commit + + + Applied to commit dates in VCS log. + S’applique aux dates de commit dans le journal VCS. + + + Log Commit Hash + Journaliser les hash de commit + + + Applied to commit hashes in VCS log. + S’applique aux hash de commit dans le journal VCS. + + + Log Decoration + Journaliser les décorations + + + Applied to commit decorations in VCS log. + S’applique aux décorations de commit dans le journal VCS. + + + Log Commit Subject + Journaliser les sujets de commit + + + Applied to commit subjects in VCS log. + S’applique aux sujets de commit dans le journal VCS. + + + Underline color of error diagnostics. + Couleur de soulignement des diagnostics d’erreur. + + + Error Context + Contexte de l’erreur + + + Underline color of the contexts of error diagnostics. + Couleur de soulignement des contextes de diagnostic d’erreur. + + + Warning + Avertissement + + + Underline color of warning diagnostics. + Couleur de soulignement des diagnostics d’avertissement. + + + Warning Context + Contexte de avertissement + + + Underline color of the contexts of warning diagnostics. + Couleur de soulignement des contextes de diagnostic d’avertissement. + + + Output Argument + Argument de sortie + + + Writable arguments of a function call. + Arguments écrivables d’un appel de fonction. + + + Static Member + Membre statique + + + Names of static fields or member functions. + Noms des champs ou des fonctions membres statiques. + + + Code Coverage Added Code + Code ajouté à la couverture de code + + + New code that was not checked for tests. + Nouveau code qui n’a pas été vérifié pour les tests. + + + Partially Covered Code + Code partiellement couvert + + + Partial branch/condition coverage. + Couverture partielle de la branche/condition. + + + Uncovered Code + Code non-couvert + + + Not covered at all. + Pas du tout couvert. + + + Fully Covered Code + Code entièrement couvert + + + Fully covered code. + Code entièrement couvert. + + + Manually Validated Code + Code validé manuellement + + + User added validation. + Validation ajoutée par l’utilisateur. + + + Code Coverage Dead Code + Code mort de la couverture de code + + + Unreachable code. + Code inaccessible. + + + Code Coverage Execution Count Too Low + Nombre d’exécutions de la couverture du code trop faible + + + Minimum count not reached. + Le nombre minimum n’a pas été atteint. + + + Implicitly Not Covered Code + Code implicitement non-couvert + + + PLACEHOLDER + + + + Implicitly Covered Code + Code implicitement couvert + + + Implicit Manual Coverage Validation + Validation implicite de la couverture manuelle Function @@ -14120,51 +49162,27 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Name of a function. - Nom d'une fonction. + Nom d’une fonction. QML item id within a QML file. - Identifiant d'une élément QML dans un fichier QML. - - - QML root Object Property - Propriété de l'objet racine QML + Identifiant d’un élément QML dans un fichier QML. QML property of a parent item. - Propriété QML de l'élément parent. - - - QML scope Object Property - Propriété de l'objet du contexte QML + Propriété QML de l’élément parent. Property of the same QML item. Propriété du même élément QML. - - Operators. (For example operator++ operator-=) - Opérateurs. (Par exemple les opérateurs operator++ ou operator-=) - Doxygen tags. - Tags de Doxygen. + Balises de Doxygen. Location in the files where the difference is (in diff editor). - Emplacement des différences entre les fichiers (dans l'éditeur de différences). - - - Static - Statique - - - Virtual Method - Méthode virtuelle - - - Name of method declared as virtual. - Nom de la méthode déclarée comme virtuelle. + Emplacement des différences entre les fichiers (dans l’éditeur de différences). QML Binding @@ -14172,7 +49190,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan QML item property, that allows a binding to another property. - Propriété de l'élément QML, qui permet la liaison avec une autre propriété. + Propriété de l’élément QML, qui permet la liaison avec une autre propriété. QML Local Id @@ -14180,19 +49198,19 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan QML Root Object Property - Propriété de l'objet racine QML + Propriété de l’objet racine QML QML Scope Object Property - Propriété de l'objet du contexte QML + Propriété de l’objet du contexte QML QML State Name - Nom d'état QML + Nom d’état QML Name of a QML state. - Nom d'un état QML. + Nom d’un état QML. QML Type Name @@ -14200,7 +49218,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Name of a QML type. - Nom d'un type QML. + Nom d’un type QML. QML External Id @@ -14212,7 +49230,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan QML External Object Property - Propriété de l'objet externe QML + Propriété de l’objet externe QML QML property defined in another QML file. @@ -14232,7 +49250,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Name of a JavaScript import inside a QML file. - Nom d'une importation JavaScript dans un fichier QML. + Nom d’une importation JavaScript dans un fichier QML. JavaScript Global Variable @@ -14244,20 +49262,12 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Keyword - mot-clé - - - Reserved keywords of the programming language. - Mots-clés réservés par le langage de programmation. + Mot-clé Operator Opérateur - - Operators. (for example operator++ operator-=) - Opérateurs (par exemple, ++ et =) - Preprocessor Préprocesseur @@ -14280,7 +49290,7 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan All style of comments except Doxygen comments. - Tout les styles de commentaires à l'exception des commentaires Doxygen. + Tous les styles de commentaires à l’exception des commentaires Doxygen. Doxygen Comment @@ -14292,22 +49302,12 @@ Appliquée au texte, s'il n'y a pas d'autres règles correspondan Doxygen Tag - Tag Doxygen - - - Doxygen tags - Balises Doxygen. + Balise Doxygen Visual Whitespace Espace visuel - - Whitespace -Will not be applied to whitespace in comments and strings. - Espace -Ne sera pas appliquée aux espaces dans les commentaires et les chaînes. - Disabled Code Code désactivé @@ -14322,7 +49322,7 @@ Ne sera pas appliquée aux espaces dans les commentaires et les chaînes. Applied to added lines in differences (in diff editor). - Appliquer aux lignes ajoutées (dans l'éditeur de différences). + S’applique aux lignes ajoutées (dans l’éditeur de différences). Removed Line @@ -14330,7 +49330,7 @@ Ne sera pas appliquée aux espaces dans les commentaires et les chaînes. Applied to removed lines in differences (in diff editor). - Appliquer aux lignes supprimées (dans l'éditeur de différences). + S’applique aux lignes supprimées (dans l’éditeur de différences). Diff File @@ -14338,7 +49338,7 @@ Ne sera pas appliquée aux espaces dans les commentaires et les chaînes. Compared files (in diff editor). - Fichiers comparés (dans l'éditeur de différences). + Fichiers comparés (dans l’éditeur de différences). Diff Location @@ -14352,1136 +49352,6 @@ Ne sera pas appliquée aux espaces dans les commentaires et les chaînes.Display Affichage - - - ToolChain - - GCC - GCC - - - Intel C++ Compiler (Linux) - Compilateur C++ Intel (Linux) - - - MinGW - MinGW - - - Microsoft Visual C++ - Microsoft Visual C++ - - - Windows CE - Windows CE - - - WINSCW - WINSCW - - - GCCE - GCCE - - - GCCE/GnuPoc - GCCE/GnuPoc - - - RVCT (ARMV6)/GnuPoc - RVCT (ARMV6)/GnuPoc - - - RVCT (ARMV5) - RVCT (ARMV5) - - - RVCT (ARMV6) - RVCT (ARMV6) - - - GCC for Maemo - GCC pour Maemo - - - Other - Autre - - - <Invalid> - <Invalide> - - - <Unknown> - <Inconnu> - - - - QtC::Help - - Choose Topic - thème ? - Choisissez le thème - - - &Topics - &Thèmes - - - &Display - &Afficher - - - &Close - &Fermer - - - Filter - Filtre - - - Choose a topic for <b>%1</b>: - Choisissez un thème pour <b>%1</b> : - - - - QtC::VcsBase - - Version Control - Gestion de versions - - - General - Général - - - Common - Commun - - - Project from Version Control - Projet d'un gestionnaire de versions - - - Name - Nom - - - E-mail - avec ou sans '-' ? - Email - - - Alias - Alias - - - Alias e-mail - Alias de l'email - - - Cannot open '%1': %2 - Impossible d'ouvrir "%1" : %2 - - - Nicknames - Surnoms - - - State - État - - - File - Fichier - - - Prompt to submit - Invite lors du submit - - - Submit Message Check failed - La vérification du message de submit a échoué - - - Check Message - Contrôle du message - - - Insert Name... - Inserez le nom... - - - Submit Message Check Failed - La vérification du message de submit a échoué - - - Executing %1 - Exécution de %1 - - - Executing [%1] %2 - Exécution de [%1] %2 - - - The check script '%1' crashed. - Le script de vérification "%1" a crashé. - - - Unable to open '%1': %2 - Impossible d'ouvrir "%1" : %2 - - - The check script '%1' could not be started: %2 - Le script de vérification "%1" ne peut pas être démarré : %2 - - - The check script '%1' timed out. - Le script de vérification "%1" a expiré. - - - The check script '%1' crashed - Le script de vérification "%1" a crashé - - - The check script '%1' could not be run: %2 - Le script de vérification "%1" ne peut pas être exécuté : %2 - - - The check script returned exit code %1. - Le script de vérification a retourné le code %1. - - - Would you like to remove this file from the version control system (%1)? -Note: This might remove the local file. - Voulez-vous retirer ce fichier du système de gestion de versions (%1) ? -Note : Ceci risque de supprimer le fichier du disque. - - - - View - - Paste - Coller - - - <Username> - <Utilisateur> - - - <Description> - <Description> - - - <Comment> - <Commentaire> - - - - ViewDialog - - Send to Codepaster - Envoyer sur Codepaster - - - &Username: - &Utilisateur : - - - <Username> - <Utilisateur> - - - &Description: - &Description : - - - <Description> - <Description> - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;Comment&gt;</p></body></html> - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;Commentaire&gt;</p></body></html> - - - Parts to send to codepaster - Fragments à envoyer sur codepaster - - - Patch 1 - Patch 1 - - - Patch 2 - Patch 2 - - - Protocol: - Protocole : - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">&lt;Comment&gt;</span></p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">&lt;Commentaire&gt;</span></p></body></html> - - - Parts to send to server - Parties à envoyer au serveur - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">&lt;Comment&gt;</span></p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">&lt;Commentaire&gt;</span></p></body></html> - - - Parts to Send to Server - Parties à envoyer au serveur - - - - mainClass - - main - main - - - Text1: - Texte 1 : - - - N/A - N/A - - - Text2: - Texte 2 : - - - Text3: - Texte 3 : - - - - QtC::CodePaster - - Server Prefix: - Préfixe du serveur : - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://pastebin.com"><span style=" text-decoration: underline; color:#0000ff;">pastebin.com</span></a><span style=" font-size:8pt;"> allows to send posts to custom subdomains (eg. qtcreator.pastebin.com). Fill in the desired prefix.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Note that the plugin will use this for posting as well as fetching.</span></p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://pastebin.com"><span style=" text-decoration: underline; color:#0000ff;">pastebin.com</span></a><span style=" font-size:8pt;"> permet d'envoyer les snippet à des sous-domaines personnalisés (eg. qtcreator.pastebin.com). Remplissez le préfixe désiré.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Notez que les plug-ins utiliseront ceci pour poster et récupérer les snippets.</span></p></body></html> - - - <html><head/><body> -<p><a href="http://pastebin.com">pastebin.com</a> allows to send posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix.</p> -<p>Note that the plugin will use this for posting as well as fetching.</p></body></html> - <html><head/><body> -<p><a href="http://pastebin.com">pastebin.com</a> permet d'envoyer les snippets à des sous-domaines personnalisés (par exemple qtcreator.pastebin.com). Remplissez le préfixe désiré.</p> -<p>Notez que les plug-ins utiliseront ceci pour poster et récupérer les snippets.</p></body></html> - - - - QtC::CVS - - Prompt to submit - Invite lors du submit - - - When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit id). Otherwise, only the respective file will be displayed. - Si coché, tous les fichiers modifiés par un commit seront affichés lors d'un clic sur un numéro de révison dans la vue d'annotation (récupérée par un id de commit). Sinon, seul le fichier respectif sera affiché. - - - Describe all files matching commit id: - Décrire tous les fichiers correspondant à l'id de commit : - - - CVS Command: - Commande CVS : - - - CVS Root: - Racine CVS : - - - Diff Options: - Options Diff : - - - CVS - CVS - - - Configuration - Configuration - - - CVS command: - Commande CVS : - - - CVS root: - Racine CVS : - - - Miscellaneous - Divers - - - Diff options: - Options diff : - - - Prompt on submit - Invite lors du submit - - - When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit ID). Otherwise, only the respective file will be displayed. - Si coché, tous les fichiers modifiés par un commit seront affichés lors d'un clic sur un numéro de version dans la vue d'annotation (récupérée par un ID de commit). Sinon, seul le fichier respectif sera affiché. - - - Describe all files matching commit id - Décrire tous les fichiers correspondant à l'id de commit - - - Timeout: - Timeout : - - - s - s - - - - QtC::Debugger - - Form - Formulaire - - - Symbian ARM gdb location: - Emplacement du gdb ARM Symbian : - - - Communication - Communication - - - Serial Port - Port Série - - - Bluetooth - Bluetooth - - - Port: - Port : - - - Device: - Appareil mobile : - - - - QtC::Designer - - Form - Formulaire - - - Embedding of the UI Class - Intégration de la classe UI - - - Aggregation as a pointer member - Agrégation comme pointeur membre - - - Aggregation - Agrégation - - - Multiple Inheritance - Héritage multiple - - - Code Generation - Génération de code - - - Support for changing languages at runtime - Prise en charge du changement de langage à l'exécution - - - Use Qt module name in #include-directive - Utiliser le nom du module Qt dans #include-directive - - - Multiple inheritance - Héritage multiple - - - Add Qt version #ifdef for module names - Ajouter un bloc #ifdef avec la version de Qt pour les noms de module - - - - Gitorious::Internal::GitoriousHostWidget - - ... - ... - - - <New Host> - <Nouvel Hôte> - - - Host - Hôte - - - Projects - Projets - - - Description - Description - - - - Gitorious::Internal::GitoriousProjectWidget - - WizardPage - WizardPage - - - Filter: - Filtre : - - - ... - ... - - - Keep updating - Mise à jour continue - - - Project - Projet - - - Description - Description - - - - Gitorious::Internal::GitoriousRepositoryWizardPage - - WizardPage - WizardPage - - - Filter: - Filtre : - - - ... - ... - - - Name - Nom - - - Owner - Propriétaire - - - Description - Description - - - Repository - Dépôt - - - Choose a repository of the project '%1'. - Choisissez un répertoire pour le projet "%1". - - - Mainline Repositories - Dépôts principaux - - - Clones - Clones - - - Baseline Repositories - Dépôts de base - - - Shared Project Repositories - Dépôts de projets partagés - - - Personal Repositories - Dépôts personnels - - - - QtC::Help - - Show side-by-side if possible - Afficher côte à côte si possible - - - Always show side-by-side - Toujours afficher côte à côte - - - Always start full help - Toujours afficher l'aide complète - - - Show my home page - Afficher ma page d'accueil - - - Show a blank page - Afficher une page blanche - - - Show my tabs from last session - Afficher mes onglets de la dernière session - - - Home Page: - Page d'accueil : - - - Restore to Default - Restaurer les paramètres par défaut - - - Help Bookmarks - Signet de l'aide - - - Import... - Importer... - - - Export... - Exporter... - - - - QtC::ProjectExplorer - - Build and Run - Compilation et exécution - - - Save all files before Build - Enregistrer tous les fichiers avant de compiler - - - Always build Project before Running - Toujours compiler le projet avant d'exécuter - - - Show Compiler Output on building - Afficher la sortie du compilateur pendant la compilation - - - Use jom instead of nmake - Utiliser jom à la place de nmake - - - <i>jom</i> is a drop-in replacement for <i>nmake</i> which distributes the compilation process to multiple CPU cores. For more details, see the <a href="http://qt.gitorious.org/qt-labs/jom/">jom Homepage</a>. Disable it if you experience problems with your builds. - <i>jom</i> est un remplaçant pour <i>nmake</i> qui répartit le processus de compilation sur les différents cores d'un CPU. Pour plus de détails, voir la <a href="http://qt.gitorious.org/qt-labs/jom/">page consacrée à jom </a>. Désactivez si vous rencontrez des problèmes de compilation. - - - Projects Directory - Répertoire du projet - - - Current directory - Répertoire courant - - - directoryButtonGroup - directoryButtonGroup - - - Directory - Répertoire - - - Save all files before build - Enregistrer tous les fichiers avant de compiler - - - Always build project before running - Toujours compiler le projet avant d'exécuter - - - Show compiler output on building - Afficher la sortie du compilateur pendant la compilation - - - Clear old application output on a new run - Effacer les sorties des anciennes applications à chaque nouvelle exécution - - - <i>jom</i> is a drop-in replacement for <i>nmake</i> which distributes the compilation process to multiple CPU cores. The latest binary is available at <a href="ftp://ftp.qt.nokia.com/jom/">ftp://ftp.qt.nokia.com/jom/</a>. Disable it if you experience problems with your builds. - <i>jom</i> est un remplaçant pour <i>nmake</i> qui répartit le processus de compilation sur les différents cores d'un CPU. Pour plus de détails, voir la <a href="http://qt.gitorious.org/qt-labs/jom/">page consacrée à jom </a>. Désactivez si vous rencontrez des problèmes de compilation. - - - Always build project before deploying it - Toujours compiler le projet avant de déployer - - - Always deploy project before running it - Toujours déployer le projet avant de l'exécuter - - - Word-wrap application output - Retour à la ligne automatique de la sortie de l'application - - - Open compiler output pane when building - Ouvrir le panneau de sortie du compilateur lors de la compilation - - - Open application output pane when running - Ouvrir le panneau de sortie de l'application au lancement - - - Ask before terminating the running application in response to clicking the stop button in Application Output. - Demander avant de terminer une application lancée en réponse au clic sur le bouton d'arrêt dans la sortie d'application. - - - Always ask before stopping applications - Toujours demander avant d'arrêter des applications - - - Enabling this option ensures that the order of interleaved messages from stdout and stderr is preserved, at the cost of disabling highlighting of stderr. - Activer cette option s'assure que l'ordre des messages imbriqués de stdout et stderr est préservé, au prix de la désactivation de la mise en évidence de stderr. - - - Merge stderr and stdout - Rassembler stderr et stdout - - - Limit application output to - Limiter la sortie de l'application à - - - lines - lignes - - - Open application output pane when debugging - Ouvrir la panneau de sortie de l'application lors du débogage - - - <i>jom</i> is a drop-in replacement for <i>nmake</i> which distributes the compilation process to multiple CPU cores. The latest binary is available at <a href="http://releases.qt-project.org/jom/">http://releases.qt-project.org/jom/</a>. Disable it if you experience problems with your builds. - <i>jom</i> est une solution de remplacement immédiat pour <i>nmake</i>, qui distribue le processus de compilation sur les différents cœurs du processeur. La dernière version binaire est disponible à <a href="http://releases.qt-project.org/jom/">http://releases.qt-project.org/jom/</a>. Désactivez-le si vous rencontrez des problèmes à la compilation. - - - Open Compile Output pane when building - Ouvrir le panneau des messages de compilations lors de la compilation - - - Open Application Output pane on output when running - Ouvrir le panneau des messages de l'application lors de l'exécution - - - Open Application Output pane on output when debugging - Ouvrir le panneau des messages de l'application lors du débogage - - - Default build directory: - Répertoire par défaut de compilation : - - - Reset - Réinitialiser - - - - QtC::Welcome - - Form - Formulaire - - - - QtC::QmakeProjectManager - - Form - Formulaire - - - The header file - Le fichier d'en-tête - - - &Sources - &Sources - - - Widget librar&y: - B&ibliothèque de widget : - - - Widget project &file: - Fichier de &projet du widget : - - - Widget h&eader file: - Fichier d'en-&tête du widget : - - - The header file has to be specified in source code. - Le fichier d'en-tête doit être spécifié dans le code source. - - - Widge&t source file: - Fichier source du &widget : - - - Widget &base class: - Classe de &base du widget : - - - QWidget - QWidget - - - Plugin class &name: - &Nom de la classe du plug-in : - - - Plugin &header file: - Fichier d'&en-tête du plug-in : - - - Plugin sou&rce file: - Fichier sou&rce du plug-in : - - - Icon file: - Fichier de l'icône : - - - &Link library - &Lier à la bibliothèque - - - Create s&keleton - Créer s&quelette - - - Include pro&ject - Inclure le pro&jet - - - &Description - &Description - - - G&roup: - &Groupe : - - - &Tooltip: - &Info-bulle : - - - W&hat's this: - &Qu'est-ce que c'est? : - - - The widget is a &container - Le widget est un &conteneur - - - Property defa&ults - Propriétés par défa&ut - - - dom&XML: - dom &XML : - - - Select Icon - Sélectionner une icône - - - Icon files (*.png *.ico *.jpg *.xpm *.tif *.svg) - Fichier d'icône (*.png *.ico *.jpg *.xpm *.tif *.svg) - - - WizardPage - WizardPage - - - Plugin and Collection Class Information - Information sur le plug-in et la classe de collection - - - Specify the properties of the plugin library and the collection class. - Spécifiez les propriétés de la bibliothèque de plug-in et la classe de collection. - - - Collection class: - Classe de collection : - - - Collection header file: - Fichier d'en-tête de la collection : - - - Collection source file: - Fichier source de la collection : - - - Plugin name: - Nom du plug-in : - - - Resource file: - Fichier ressource : - - - icons.qrc - icons.qrc - - - Custom Qt Widget Wizard - Assistant de Widget Qt personnalisé - - - Custom Widget List - Liste de widgets personnalisés - - - Widget &Classes: - &Classes des widgets : - - - Specify the list of custom widgets and their properties. - Spécifiez la liste des widgets personnalisés et leurs propriétés. - - - ... - ... - - - - QtC::Welcome - - The Qt Creator User Interface - L'interface utilisateur de Qt Creator - - - Building and Running an Example - Compiler et exécuter une exemple - - - Creating a Qt C++ Application - Créer une application Qt C++ - - - Creating a Mobile Application - Créer une application pour mobile - - - Creating a Qt Quick Application - Créer une application Qt Quick - - - Choose an Example... - Choisir un exemple... - - - Copy Project to writable Location? - Copier le projet à un emplacement inscriptible ? - - - <p>The project you are about to open is located in the write-protected location:</p><blockquote>%1</blockquote><p>Please select a writable location below and click "Copy Project and Open" to open a modifiable copy of the project or click "Keep Project and Open" to open the project in location.</p><p><b>Note:</b> You will not be able to alter or compile your project in the current location.</p> - <p>Le projet que vous vous apprêtez à ouvrir se trouve dans un emplacement accessible en lecture seule :</p><blockquote>%1</blockquote><p>Veuillez sélectionner un emplacement accessible en écriture et cliquez sur "Copier projet et ouvrir" pour ouvrir une copie modifiable. Cliquez sur "Conserver l'emplacement et ouvrir" pour ouvrir le projet à l'emplacement courant.</p><p><b>Note :</b> Vous ne pourrez pas modifier ou compiler votre projet à l'emplacement courant.</p> - - - &Location: - &Emplacement : - - - &Copy Project and Open - &Copier projet et ouvrir - - - &Keep Project and Open - see "<p>the projet you are about..." to understand the translation - &Conserver l'emplacement et ouvrir - - - The specified location already exists. Please specify a valid location. - L'emplacement spécifié existe déjà. Veuillez spécifier un autre emplacement. - - - If you add external libraries to your project, Qt Creator will automatically offer syntax highlighting and code completion. - Si vous ajoutez des bibliothèques externes à votre projet, QtCreator va automatiquement mettre en place la coloration syntaxique et l'auto-complétion. - - - You can switch between the output pane by hitting <tt>%1+n</tt> where n is the number denoted on the buttons at the window bottom: <br /><br />1: Build Issues, 2: Search Results, 3: Application Output, 4: Compile Output - Vous pouvez passer d'un panneau de sortie à l'autre avec les touches <tt>%1+n</tt> où n est le numéro qui apparaît sur les boutons en dessous de la fenêtre : <ul><li>1 - Problèmes de compilation</li><li>2 - Résultat de la recherche</li><li>3 - Sortie de l'application</li><li>4 - Sortie de compilation</li></ul> - - - You can quickly search methods, classes, help and more using the <a href="qthelp://com.nokia.qtcreator/doc/creator-editor-locator.html">Locator bar</a> (<tt>%1+K</tt>). - Vous pouvez rapidement rechercher des méthodes, classes, de l'aide et plus à l'aide du <a href="qthelp://com.nokia.qtcreator/doc/creator-navigation.html">Localisateur</a> (<tt>%1+K</tt>). - - - Within a session, you can add <a href="qthelp://com.nokia.qtcreator/doc/creator-build-dependencies.html">dependencies</a> between projects. - Dans une session, vous pouvez ajouter <a href="qthelp://com.nokia.qtcreator/doc/creator-build-dependencies.html">des dépendances</a> entre les projets. - - - <a href='%1'>Details...</a> - <a href="%1">Détails...</a> - - - <a href='%1'>Take Tutorial</a> - <a href="%1">Suivre le tutoriel</a> - - - You can switch between Qt Creator's modes using <tt>Ctrl+number</tt>:<ul><li>1 - Welcome</li><li>2 - Edit</li><li>3 - Debug</li><li>4 - Projects</li><li>5 - Help</li></ul> - Vous pouvez basculer entre les modes de Qt Creator en utilisant <tt>Ctrl+chiffre</tt>:<ul><li>1 - Accueil</li><li>2 - Editer</li><li>3 - Design</li><li>4 - Deboguer</li><li>5 - Projets</li><li>6 - Aide</li></ul> - - - You can add custom build steps in the <a href="qthelp://com.nokia.qtcreator/doc/creator-project-pane.html#build-settings">build settings</a>. - Vous pouvez ajouter vos propre étapes de compilation dans les <a href="qthelp://com.nokia.qtcreator/doc/creator-project-pane.html#build-settings">paramètres de compilation</a>. - - - Within a session, you can add <a href="qthelp://com.nokia.qtcreator/doc/creator-project-pane.html#dependencies">dependencies</a> between projects. - Dans une session, vous pouvez ajouter des <a href="qthelp://com.nokia.qtcreator/doc/creator-project-pane.html#dependencies">dépendances</a> entre des projets. - - - You can force code completion at any time using <tt>Ctrl+Space</tt>. - Vous pouvez forcer la complétion de code en utilisant <tt>Ctrl+Space</tt>. - - - You can start Qt Creator with a session by calling <tt>qtcreator &lt;sessionname&gt;</tt>. - Vous pouvez démarrer Qt Creator avec une session en le lançant avec <tt>qtcreator &lt;nomDeSession&gt;</tt>. - - - You can return to edit mode from any other mode at any time by hitting <tt>Escape</tt>. - Vous pouvez retourner en mode d'édition depuis n'importe quel autre mode en cliquant sur <tt>Echap</tt>. - - - You can switch between the output pane by hitting <tt>%1+n</tt> where n is the number denoted on the buttons at the window bottom:<ul><li>1 - Build Issues</li><li>2 - Search Results</li><li>3 - Application Output</li><li>4 - Compile Output</li></ul> - Vous pouvez passer d'un panneau de sortie à l'autre avec les touches <tt>%1+x</tt> où x est le numéro qui apparaît sur les boutons en dessous de la fenêtre : <ul><li>1 - Problèmes de compilation</li><li>2 - Résultat de la recherche</li><li>3 - Sortie de l'application</li><li>4 - Sortie de compilation</li></ul> - - - You can quickly search methods, classes, help and more using the <a href="qthelp://com.nokia.qtcreator/doc/creator-navigation.html">Locator bar</a> (<tt>%1+K</tt>). - Vous pouvez rapidement rechercher des méthodes, classes, de l'aide et plus à l'aide du <a href="qthelp://com.nokia.qtcreator/doc/creator-navigation.html">Localisateur</a> (<tt>%1+K</tt>). - - - You can add custom build steps in the <a href="qthelp://com.nokia.qtcreator/doc/creator-build-settings.html">build settings</a>. - Vous pouvez ajouter vos propre étapes de compilation dans les <a href="qthelp://com.nokia.qtcreator/doc/creator-build-settings.html">paramètres de compilation</a>. - - - Within a session, you can add <a href="qthelp://com.nokia.qtcreator/doc/creator-build-settings.html#dependencies">dependencies</a> between projects. - Dans une session, vous pouvez ajouter des <a href="qthelp://com.nokia.qtcreator/doc/creator-build-settings.html#dependencies">dépendances</a> entre des projets. - - - You can set the preferred editor encoding for every project in <tt>Projects -> Editor Settings -> Default Encoding</tt>. - Vous pouvez définir l'encodage de caractères préféré pour chaque projet dans <tt>Projet -> Paramètres de l'éditeur -> Encodage par défaut</tt>. - - - In the editor, <tt>F2</tt> follows symbol definition, <tt>Shift+F2</tt> toggles declaration and definition while <tt>F4</tt> toggles header file and source file. - Dans l'éditeur, vous pouvez aller à la définition du symbole en pressant <tt>F2</tt>, <tt>Maj+F2</tt> bascule entre déclaration et définition tandis que <tt>F4</tt> bascule entre en-tête et fichier source. - - - Explore Qt C++ Examples - Explorer les exemples Qt C++ - - - Examples not installed... - Exemples non trouvés... - - - Explore Qt Quick Examples - Explorer les exemples Qt Quick - - - Open Project... - Ouvrir le projet... - - - Create Project... - Créer un projet... - - - Examples - Exemples - - - Explore Qt C++ examples: - Parcourir les exemples Qt C++ : - - - Examples Not Installed... - Exemples non trouvés... - - - Explore Qt Quick examples: - Parcourir les exemples Qt Quick : - - - Explore Qt C++ mobile examples: - Parcourir les exemples Qt C++ mobiles : - - - Featured - À la une - - - - QtC::TextEditor Bold Gras @@ -15494,4590 +49364,1679 @@ p, li { white-space: pre-wrap; } Background: Arrière plan : + + Unset + Réinitialiser + + + <p align='center'><b>Builtin color schemes need to be <a href="copy">copied</a><br/> before they can be changed</b></p> + <p align='center'><b>Les jeux de couleurs intégrés doivent être <a href="copy">copiés</a><br/> avant de pouvoir être modifiés</b></p> + Foreground: Premier plan : - Erase background - Effacer l'arrière plan + Unset foreground. + Réinitialiser le premier plan. - x - x + Unset background. + Réinitialiser l’arrière-plan. - Erase foreground - Effacer le premier plan + Relative Foreground + Premier plan relatif - - - QtC::Welcome - News From the Qt Labs - Actualités de Qt Labs + Saturation: + Saturation : - <b>Forum Nokia</b><br /><font color='gray'>Mobile Application Support</font> - <b>Forum Nokia</b><br /><font color='gray'>Support pour application mobile</font> + Lightness: + Clarté : - <b>Qt LGPL Support</b><br /><font color='gray'>Buy commercial Qt support</font> - <b>Support LGPL de Qt</b><br /><font color='gray'>Acheter le support commercial de Qt</font> + Relative Background + Arrière-plan relatif - <b>Qt Centre</b><br /><font color='gray'>Community based Qt support</font> - <b>Qt Centre</b><br /><font color='gray'>Support communautaire de Qt</font> + Underline + - <b>Forum Nokia</b><br /><font color='gray'>Mobile application support</font> - <b>Forum Nokia</b><br /><font color='gray'>Support pour les applications mobiles</font> + Color: + Couleur : - <b>Qt DevNet</b><br /><font color='gray'>Qt Developer Resources</font> - <b>Qt DevNet</b><br /><font color='gray'>Ressources pour les développeurs Qt</font> + No Underline + Pas de soulignement - <b>Qt Home</b><br /><font color='gray'>Qt by Nokia on the web</font> - <b>Qt Home</b><br /><font color='gray'>Qt par Nokia sur le web</font> + Single Underline + Soulignement simple - <b>Qt Git Hosting</b><br /><font color='gray'>Participate in Qt development</font> - <b>Hébergement Qt Git</b><br /><font color='gray'>Participer au développement de Qt</font> + Wave Underline + Soulignement par une vague - <b>Qt Apps</b><br /><font color='gray'>Find free Qt-based apps</font> - <b>Qt Apps</b><br /><font color='gray'>Trouver les applications libres basées sur Qt</font> + Dot Underline + Soulignement par des points - http://labs.trolltech.com/blogs/feed - Add localized feed here only if one exists - http://labs.trolltech.com/blogs/feed + Dash Underline + Soulignement par des tirets - Qt Labs - Qt Labs + Dash-Dot Underline + Soulignement par des tirets et des points - Qt Centre - Qt Centre + Dash-Dot-Dot Underline + Soulignement par des tirets suivis de deux points - - Qt Apps - Qt Apps - - - Qt for Symbian at Forum Nokia - Qt pour Symbian - - - Qt Support Sites - Sites du support Qt - - - Qt Links - Liens Qt - - - #gradientWidget { - background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(215, 215, 215, 255)); -} - #gradientWidget { - background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(215, 215, 215, 255)); -} - - - #headerFrame { - border-image: url(:/welcome/images/center_frame_header.png) 0; - border-width: 0; -} - - #headerFrame { - border-image: url(:/welcome/images/center_frame_header.png) 0; - border-width: 0; -} - - - - QtC::Utils - - Show Details - Afficher les détails - - - Details - Détails - - - - QtC::Core - - Plain Text Editor - Éditeur de texte - - - Binary Editor - Éditeur de binaire - - - C++ Editor - Éditeur C++ - - - .pro File Editor - Éditeur de fichier .pro - - - .files Editor - Éditeur de fichiers .files - - - QMLJS Editor - Éditeur QMLJS - - - .qmlproject Editor - Éditeur de fichiers .qmlproject - - - Qt Designer - Qt Designer - - - Qt Linguist - Qt Linguist - - - Resource Editor - Éditeur de ressources - - - GLSL Editor - Éditeur GLSL - - - Python Editor - Éditeur Python - - - Preferences - Préférences - - - - QtC::CodePaster - - No Server defined in the CodePaster preferences! - Aucun serveur définit dans les préférences CodePaster ! - - - No Server defined in the CodePaster options! - Aucun serveur défini dans les options CodePaster ! - - - No Server defined in the CodePaster preferences. - Aucun serveur défini dans les préférences CodePaster. - - - No Server defined in the CodePaster options. - Aucun serveur défini dans les options CodePaster. - - - No such paste - Aucun collage de ce type - - - CodePaster - CodePaster - - - <i>Note: Specify the host name for the CodePaster service without any protocol prepended (e.g. codepaster.mycompany.com).</i> - <i>Note : spécifier le nom d'hôte pour le service CodePaster sans aucun protocole (par exemple, codepaster.mycompany.com).</i> - - - Server: - Serveur : - - - Note: Specify the host name for the CodePaster service without any protocol prepended (e.g. codepaster.mycompany.com). - Note : spécifiez le nom d'hôte du service CodePaster sans aucun protocole (par exemple, codepaster.mycompany.com). - - - Error during paste - Erreur durant le collage - - - Pastebin.com - Pastebin.com - - - - QtC::CppEditor - - Searching... - Recherche... - - - C++ Usages: - Utilisations de C++ : - - - Searching - Recherche - - - C++ Macro Usages: - Utilisations de macros C++ : - - - - QtC::CVS - - Checks out a project from a CVS repository. - Obtient un projet à partir d'un dépôt CVS. - - - Checks out a CVS repository and tries to load the contained project. - Importer le dépôt CVS et essayer le charger le projet contenu. - - - CVS Checkout - Import CVS - - - Location - Emplacement - - - Specify repository and path. - Spécifier le dépôt et le chemin. - - - Repository: - Dépôt : - - - Parsing of the log output failed - Échec de l'analyse de la sortie - - - &CVS - &CVS - - - Add - Ajouter - - - Add "%1" - Ajouter "%1" - - - Alt+C,Alt+A - Alt+C,Alt+A - - - Delete - Supprimer - - - Delete "%1" - Supprimer "%1" - - - Revert - Rétablir - - - Revert "%1" - Rétablir "%1" - - - Diff Project - Faire un diff sur le projet - - - Diff Current File - Faire un diff du fichier courant - - - Diff "%1" - Faire un diff de "%1" - - - Alt+C,Alt+D - Alt+C,Alt+D - - - Commit All Files - Faire un commit de tous les fichiers - - - Commit Current File - Faire un commit du fichier courant - - - Commit "%1" - Faire un commit de "%1" - - - Alt+C,Alt+C - Alt+C,Alt+C - - - Filelog Current File - Journal du fichier courant - - - Cannot find repository for '%1' - Impossible de trouver le dépot de "%1" - - - Meta+C,Meta+D - Meta+C, Meta+D - - - Filelog "%1" - Journal du fichier "%1" - - - Annotate Current File - Annoter le fichier courant - - - Annotate "%1" - Annoter "%1" - - - Meta+C,Meta+A - Meta+C, Meta+A - - - Meta+C,Meta+C - Meta+C, Meta+C - - - Delete... - Supprimer… - - - Delete "%1"... - Supprimer "%1"… - - - Revert... - Rétablir... - - - Revert "%1"... - Rétablir "%1"... - - - Edit - Éditer - - - Edit "%1" - Éditer "%1" - - - Unedit - Annuler la modification - - - Unedit "%1" - Annuler la modification de "%1" - - - Unedit Repository - Annuler la modification du dépôt - - - Diff Project "%1" - Réaliser un diff du projet "%1" - - - Project Status - Statut du projet - - - Status of Project "%1" - Statut du projet "%1" - - - Log Project - Réaliser un log du projet - - - Log Project "%1" - Réaliser un log du projet "%1" - - - Update Project - Mettre à jour le projet - - - Update Project "%1" - Mettre à jour le projet "%1" - - - Commit Project - Faire un commit du projet - - - Commit Project "%1" - Faire un commit du projet "%1" - - - Diff Repository - Réaliser un diff du dépôt - - - Repository Status - Statut du dépôt - - - Repository Log - Réaliser un log du dépôt - - - Update Repository - Mettre à jour le dépôt - - - Revert Repository... - Rétablir le dépôt... - - - Commit - Faire un commit - - - Diff &Selected Files - Faire un diff sur tous les fichiers &sélectionnés - - - Diff Selected Files - Faire un diff sur tous les fichiers sélectionnés - - - &Undo - Annu&ler - - - &Redo - Re&faire - - - Closing CVS Editor - Ferme l'éditeur CVS - - - Do you want to commit the change? - Voulez vous envoyer les changements ? - - - The commit message check failed. Do you want to commit the change? - La vérification du message de commit a échoué. Voulez-vous soumettre vos modifications ? - - - The files do not differ. - Les fichiers n'ont pas changé. - - - Revert repository - Rétablir le dépôt - - - Revert all pending changes to the repository? - Rétablir toutes les changements en attente sur le dépôt ? - - - Would you like to revert all changes to the repository? - Souhaitez-vous rétablir toutes les modifications sur le dépôt ? - - - Revert failed: %1 - Éche de la restauration : %1 - - - The file '%1' could not be deleted. - Le fichier "%1' n"a pas pu être supprimé. - - - The file has been changed. Do you want to revert it? - Le fichier a été modifié. Voulez-vous le rétablir ? - - - The commit list spans several repositories (%1). Please commit them one by one. - La liste de commits s'étend sur plusieurs répertoires (%1). Veuillez les ajouter un par un. - - - Another commit is currently being executed. - Un autre commit est en cours d'exécution. - - - There are no modified files. - Il n'y a aucun fichier modifié. - - - Cannot create temporary file: %1 - Impossible de créer le fichier temporaire : %1 - - - Would you like to discard your changes to the repository '%1'? - Voulez-vous annuler tous les changements sur le dépôt "%1" ? - - - Would you like to discard your changes to the file '%1'? - Voulez-vous annuler tous les changements sur le fichier "%1" ? - - - Project status - Statut du projet - - - Repository status - Statut du dépôt - - - The initial revision %1 cannot be described. - La révision initiale %1 n'a pas pu être décrite. - - - Could not find commits of id '%1' on %2. - %2 is a date - Impossible de trouver les commits d'id "%1" le %2. - - - Executing: %1 %2 - - Exécuter : %1 %2 - - - - Executing in %1: %2 %3 - - Exécuter dans %1 : %2 %3 - - - - No cvs executable specified! - Aucun exécutable CVS spécifié ! - - - The process terminated with exit code %1. - Le processus s'est terminé avec le code %1. - - - The process terminated abnormally. - Le processus s'est terminé de façon anormale. - - - Could not start cvs '%1'. Please check your settings in the preferences. - Impossible de démarrer cvs "%1". Veuillez vérifier vos paramètres dans les préférences. - - - CVS did not respond within timeout limit (%1 ms). - CVS n'a pas répondu dans le temps imparti (%1 ms). - - - Added - Ajouté - - - Removed - Supprimé - - - Modified - Modifié - - - CVS Submit - CVS Submit - - - CVS Command - CVS Command - - - - NameDemanglerPrivate - - Premature end of input - Saisie interrompue - - - Invalid encoding - Encodage invalide - - - Invalid name - Nom invalide - - - Invalid nested-name - Nom imbriqué invalide - - - Invalid template args - Argument du modèle invalide - - - Invalid template-param - Paramètre du modèle invalide - - - Invalid qualifiers: unexpected 'volatile' - Qualificateurs invalides : 'volatile" inattendu - - - Invalid qualifiers: 'const' appears twice - Qualificateurs invalides : 'const' apparaît deux fois - - - Invalid non-negative number - Nombre positif invalide - - - Invalid template-arg - Argument de template invalide - - - Invalid expression - Expression invalide - - - Invalid primary expression - Expression primaire invalide - - - Invalid expr-primary - expr-primary invalide - - - Invalid type - Type invalide - - - Invalid built-in type - Type prédéfini invalide - - - Invalid builtin-type - Type prédéfini invalide - - - Invalid function type - Type de fonction invalide - - - Invalid unqualified-name - Nom non-qualifié invalide - - - Invalid operator-name '%s' - Nom de l'opérateur invalide "%s" - - - Invalid array-type - Type de tableau invalide - - - Invalid pointer-to-member-type - Type de pointeur vers membre invalide - - - Invalid substitution - Substitution invalide - - - Invalid substitution: element %1 was requested, but there are only %2 - Substitution invalide : l'élément %1 était requis mais il y a seulement %2 - - - Invalid substitution: There are no elements - Substitution invalide : il n'y a aucun éléments - - - Invalid special-name - Nom spécial invalide - - - Invalid local-name - Nom local invalide - - - Invalid discriminator - Discriminateur invalide - - - Invalid ctor-dtor-name - Nom de constructeur/destructeur invalide - - - Invalid call-offset - Décalage de l'appel (call offset) invalide - - - Invalid v-offset - Décalage-v (v-offset) invalide - - - Invalid digit - Chiffre invalide - - - At position %1: - À la position %1 : - - - - QtC::Designer - - untitled - sans titre - - - - QtC::Git - - Clones a project from a git repository. - Clone un projet à partir d'un dépôt git. - - - Cloning - Cloner - - - Cloning started... - Début du clonage... - - - Clones a Git repository and tries to load the contained project. - Clone un dépôt Git et essaye de charger le projet contenu. - - - Git Repository Clone - Clone du dépôt git - - - Location - Emplacement - - - Specify repository URL, checkout directory and path. - Spécifie l'URL du dépôt, le répertoire et le chemin d'import. - - - Clone URL: - URL de clone : - - - Recursive - Récursif - - - Delete master branch - Supprimer la branche principale (master) - - - Delete the master branch after checking out the repository. - Supprimer la branche principale (master) après avoir importé le dépôt. - - - - Gitorious::Internal::Gitorious - - Error parsing reply from '%1': %2 - Erreur d'analyse de la réponse de "%1" : %2 - - - Request failed for '%1': %2 - Échec de la requête pour "%1" : %2 - - - Open source projects that use Git. - Projets open source qui utilisent Git. - - - - Gitorious::Internal::GitoriousCloneWizard - - Clones a project from a Gitorious repository. - Clone un projet à partir d'un dépôt Gitorious. - - - Clones a Gitorious repository and tries to load the contained project. - Clone un dépôt Git et essaie de charger le projet contenu. - - - Gitorious Repository Clone - Clone du dépôt Gitorious - - - - Gitorious::Internal::GitoriousHostWizardPage - - Host - Hôte - - - Select a host. - Sélectionner un hôte. - - - - Gitorious::Internal::GitoriousProjectWizardPage - - Project - Projet - - - Choose a project from '%1' - Choisir un projet à partir de "%1" - - - - QtC::Help - - General settings - Réglages généraux - - - General Settings - Réglages généraux - - - Open Image - Ouvrir une image - - - General - Général - - - Import Bookmarks - Importer les signets - - - Files (*.xbel) - Fichiers (*.xbel) - - - Cannot import bookmarks. - Impossible d'importer les signets. - - - There was an error while importing bookmarks! - Erreur lors de l'importation des signets ! - - - Save File - Enregistrer ? (tout court) - Enregistrer le fichier - - - Form - Formulaire - - - Font - Police - - - Family: - Famille : - - - Style: - Style : - - - Size: - Taille : - - - Startup - Démarrage - - - On context help: - Pour l'aide contextuelle : - - - Show Side-by-Side if Possible - Afficher côte à côte si possible - - - Always Show Side-by-Side - Toujours afficher côte à côte - - - Always Start Full Help - Toujours afficher l'aide complète - - - Always Show Help in External Window - Toujours afficher l'aide dans une fenêtre externe - - - On help start: - Au démarrage de l'aide : - - - Show My Home Page - Afficher ma page d'accueil - - - Show a Blank Page - Afficher une page blanche - - - Show My Tabs from Last Session - Afficher mes onglets de la dernière session - - - Home page: - Page d'accueil : - - - Use &Current Page - Utiliser la page &courante - - - Use &Blank Page - Utiliser une page &blanche - - - Reset to default - Restaurer les paramètres par défaut - - - Reset - Réinitialiser - - - Behaviour - Comportement - - - Switch to editor context after last help page is closed. - Basculer vers l'éditeur de contexte après que la dernière page d'aide soit fermée. - - - Return to editor on closing the last page - Retourner à l'éditeur lors de la fermeture de la dernière page - - - Note: This setting takes effect only if the HTML file does not use a style sheet. - Remarque : ce paramètre ne prend effet que si le fichier HTML n'utilise pas une feuille de style. - - - Import Bookmarks... - Importer les signets... - - - Export Bookmarks... - Exporter les signets... - - - The file is not an XBEL version 1.0 file. - Il ne s'agit pas d'un fichier XBEL version 1.0. - - - Unknown title - Titre inconnu - - - - QtC::ProjectExplorer - - Failed to start program. Path or permissions wrong? - Échec lors de l'exécution du programme. Mauvais chemin ou permissions ? - - - The program has unexpectedly finished. - Le programme s'est terminé subitement. - - - Some error has occurred while running the program. - Une erreur s'est produite lors de l'exécution du programme. - - - Cannot retrieve debugging output. - Impossible d'obtenir la sortie du débogage. - - - Cannot retrieve debugging output. - - Impossible de récupérer la sortie de débogage. - - - Run - Exécuter - - - No executable specified. - Aucun exécutable n'est spécifié. - - - Executable %1 does not exist. - L'exécutable %1 n'existe pas. - - - Starting %1... - Démarrage de %1... - - - %1 crashed - %1 a planté - - - %1 exited with code %2 - %1 s'est terminé avec le code %2 - - - No executable specified. - - Pas d'exécutable spécifié. - - - Starting %1... - - Démarrage de %1... - - - %1 exited with code %2 - - %1 a quitté avec le code %2 - - - The target directory %1 could not be created. - Le dossier cible %1 n'a pas pu être créé. - - - The existing file %1 could not be removed. - Le fichier existant %1 n'a pas pu être supprimé. - - - The file %1 could not be copied to %2. - Le fichier %1 n'a pas pu être copié en %2. - - - The debugger helpers could not be built in any of the directories: -- %1 - -Reason: %2 - Les assistances au débogage n'ont pas pu être compilées dans aucun des dossiers suivants : -- %1 - -Raison : %2 - - - GDB helper - Assistant GDB - - - Develop - Développer - - - New Project - Nouveau projet - - - No project loaded. - Aucun projet chargé. - - - - QmlEditor::Internal::ScriptEditor - - <Select Symbol> - <Selectionner un symbole> - - - Rename... - Renommer... - - - New id: - Nouvel identifiant : - - - Rename id '%1'... - Renommer l'identifiant "%1"... - - - - QmlEditor::Internal::QmlEditorPlugin - - Qt - Qt - - - Creates a Qt QML file. - Créer un fichier QML. - - - Qt QML File - Fichier QML - - - - QmlEditor::Internal::QmlModelManager - - Indexing - Indexation - - - - QtC::QmlProjectManager - - <b>QML Make</b> - <b>Make de QML</b> - - - - QtC::QmakeProjectManager - - <New class> - <Nouvelle classe> - - - Confirm Delete - Confirmez la suppression - - - Delete class %1 from list? - Supprimer la classe %1 de la liste ? - - - Qt4 Designer Custom Widget - Widget personnalisé pour Qt4 Designer - - - Creates a Qt4 Designer Custom Widget or a Custom Widget Collection. - Crée un widget personnalisé ou une collection de widgets personnalisés pour Qt4 Designer. - - - Qt Custom Designer Widget - Widget personnalisé pour Qt4 Designer - - - Creates a Qt Custom Designer Widget or a Custom Widget Collection. - Crée un widget personnalisé ou une collection de widgets personnalisés pour Qt4 Designer. - - - This wizard generates a Qt4 Designer Custom Widget or a Qt4 Designer Custom Widget Collection project. - Cet assistant génère un projet pour créer un widget personnalisé ou une collection de widgets personnalisés pour Qt4 Designer. - - - This wizard generates a Qt Designer Custom Widget or a Qt Designer Custom Widget Collection project. - lourd ? "contenant un widget ou une collection de widgets, personnalisé pour Qt Designer" ? - Cet assistant génère un projet contenant un widget ou une collection de widgets personnalisés pour Qt Designer. - - - Custom Widgets - Widgets personnalisés - - - Plugin Details - Détails du plug-in - - - Cannot open icon file %1. - Impossible d'ouvrir le fichier d'icône %1. - - - Creating multiple widget libraries (%1, %2) in one project (%3) is not supported. - Créer plusieurs bibliothèques de widgets (%1, %2) dans un même projet (%3) n'est pas supporté. - - - Cannot open %1: %2 - Imposible d'ouvrir %1 : %2 - - - - QtC::Welcome - - - QtC::QmakeProjectManager - - QtS60DeviceRunConfiguration - QtS60DeviceRunConfiguration - - - Could not parse %1. The QtS60 Device run configuration %2 can not be started. - Impossible d'analyser %1. La configuration d'appareil QtS60 %2 ne peut pas être démarrée. - - - %1 on Symbian Device - S60 device runconfiguration default display name, %1 is base pro-File name - %1 sur appareil Symbian - - - Run on Symbian device - S60 device runconfiguration default display name (no profile set) - Exécuter sur un périphérique Symbian - - - Device: - Appareil mobile : - - - Installation file: - Fichier d'installation : - - - Device on serial port: - Appareil mobile sur port série : - - - Install File: - Fichier d'installation : - - - Device on Serial Port: - Appareil mobile sur port série : - - - Queries the device for information - Inspecter l'appareil mobile pour mettre à jour les informations - - - Self-signed certificate - Certificat autosigné - - - Choose certificate file (.cer) - Choisir un fichier de certificat (.cer) - - - Custom certificate: - Certificat personnalisé : - - - Choose key file (.key / .pem) - Choisir le fichier contenant la clé (.key / .pem) - - - Key file: - Fichier contenant la clé : - - - <No Device> - Summary text of S60 device run configuration - <Aucun appareil mobile> - - - (custom certificate) - (certificat personnalisé) - - - (self-signed certificate) - (certificat autosigné) - - - Summary: Run on '%1' %2 - Résumé : fonctionne avec "%1" %2 - - - Connecting... - Connexion... - - - A timeout occurred while querying the device. Check whether Trk is running - right translation of timeout in this context? - L'appareil mobile ne répond pas. Veuillez vérifier sir TRK est lancé - - - Creating %1.sisx ... - Création de %1.sisx... - - - Executable file: %1 - Fichier exécutable : %1 - - - Debugger for Symbian Platform - Débogueur pour plateforme Symbian - - - %1 %2 - TODO: remove the tr() - %1 %2 - - - Could not read template package file '%1' - Impossible de lire le fichier de package de modèles "%1" - - - Could not write package file '%1' - Impossible d'écrire le fichier package "%1" - - - An error occurred while creating the package. - Une erreur est survenue lors de la création du package. - - - Package: %1 -Deploying application to '%2'... - Package : %1 -Déploiement de l'application sur '%2'... - - - Could not connect to phone on port '%1': %2 -Check if the phone is connected and the TRK application is running. - Impossible de se connecter au téléphone sur le port '%1' : %2 -Veuillez vérifier si le téléphone est connecté et que l'application TRK est lancée. - - - Unable to remove existing file '%1': %2 - Impossible de supprimer le fichier existant "%1" : %2 - - - Unable to rename file '%1' to '%2': %3 - Impossible de renommer le fichier "%1" en "%2" : %3 - - - Deploying - Déployer - - - There is no device plugged in. - Il n'y a aucun appareil mobile connecté. - - - Renaming new package '%1' to '%2' - Renommer le nouveau paquet "%1" en "%2" - - - Removing old package '%1' - Supprimer l'ancien paquet "%1" - - - Package file not found - Fichier du paquet non trouvé - - - Failed to find package '%1': %2 - Impossible de trouver le paquet "%1" : %2 - - - Could not connect to phone on port '%1': %2 -Check if the phone is connected and App TRK is running. - Impossible de connecter le téléphone sur le port '%1' : %2 -Veuillez vérifier que le téléphone est connecté et que App TRK est lancé. - - - Could not create file %1 on device: %2 - Impossible de créer le fichier %1 sur l'appareil mobile %2 - - - Could not write to file %1 on device: %2 - Impossible d'écrire le fichier %1 sur l'appareil mobile : %2 - - - Could not close file %1 on device: %2. It will be closed when App TRK is closed. - Impossible de fermer le fichier %1 sur l'appareil mobile %2. Il sera fermé lorsque App TRK sera fermé. - - - Could not connect to App TRK on device: %1. Restarting App TRK might help. - Impossible de se connecter à App TRK sur l'appareil mobile : %1. Redémarrer App TRK pourrait résoudre le problème. - - - Copying installation file... - Copier le fichier d'installation... - - - The device '%1' has been disconnected - L'appareil mobile "%1" a été déconnecté - - - Copying install file... - Copie le fichier d'installation... - - - %1% copied. - %1% copié. - - - Installing application... - Installation de l'application... - - - Could not install from package %1 on device: %2 - Impossible d'installer à partir du package %1 sur l'appareil mobile : %2 - - - Waiting for App TRK - En attente d'App TRK - - - Please start App TRK on %1. - Veuillez lancer App TRK sur %1. - - - Canceled. - Annulé. - - - Failed to start %1. - Échec du lancement de %1. - - - %1 has unexpectedly finished. - %1 s'est terminé de façon inattendue. - - - An error has occurred while running %1. - Une erreur s'est produite lors de l'exécution de %1. - - - Warning: Cannot locate the symbol file belonging to %1. - Attention : Impossible de trouver le fichier de symboles appartenant à %1. - - - Warning: Cannot locate the symbol file belonging to %1. - - Attention : impossible de trouver le fichier de symboles appartenant à %1. - - - Launching debugger... - - Lancement du débogueur... - - - Debug on Device - Déboguer sur l'appareil mobile - - - Debugging - Débogage - - - Launching debugger... - Lancement du débogueur... - - - Debugging finished. - Débogage terminé. - - - No Qt installed - Qt non installé - - - Summary: Run %1 in emulator - Sommaire : démarrer %1 sur l'émulateur - - - %1 in Symbian Emulator - S60 emulator run configuration default display name, %1 is base pro-File name ----------- -S60 emulator run configuration default display name, %1 is base pro-File name - %1 sur l'émulateur Symbian - - - Run on Symbian Emulator - S60 emulator run configuration default display name (no pro-file name) - Exécuter sur l'émulateur Symbian - - - Qt Symbian Emulator RunConfiguration - Configuration d'exécution de l'émulateur Qt Symbian - - - QtSymbianEmulatorRunConfiguration - QtSymbianEmulatorRunConfiguration - - - Could not parse %1. The Qt for Symbian emulator run configuration %2 can not be started. - Impossible d'analyser %1. Qt pour la configuration d'éxecution de l'émulateur Symbian %2 ne peut pas être démarré. - - - Starting %1... - Démarrage %1... - - - Starting %1... - - Démarrage de %1... - - - [Qt Message] - [Message Qt] - - - %1 exited with code %2 - - %1 a quitté avec le code %2 - - - %1 exited with code %2 - %1 a retourné le code %2 - - - Run in Emulator - Démarrer sur l'émulateur - - - Run on Device - Démarrer sur l'appareil - - - Using Default Qt Version - Utiliser la version de Qt par défaut - - - Using Qt Version "%1" - Utiliser la version Qt "%1" - - - New configuration - Nouvelle configuration - - - New Configuration Name: - Nom de la nouvelle configuration : - - - Qmake based build - Compilation basée sur qmake - - - New Configuration - Nouvelle configuration - - - New configuration name: - Nom de la nouvelle configuration : - - - %1 Debug - Debug build configuration. We recommend not translating it. - %1 Debug - - - %1 Release - Release build configuration. We recommend not translating it. - %1 Release - - - Debug - The name of the debug build configuration created by default for a qmake project. - Debug - - - Release - Release - - - - QtC::Subversion - - Checks out a project from a Subversion repository. - Vérifie un projet à partir d'un dépôt Subversion. - - - Checks out a Subversion repository and tries to load the contained project. - Importer le dépôt Subversion et essayer le charger le projet contenu. - - - Subversion Checkout - Import Subversion - - - Specify repository, checkout directory and path. - Spécifier le dépôt, le répertoire et le chemin de checkout. - - - Location - Emplacement - - - Specify repository URL, checkout directory and path. - Spécifie l'URL du dépôt, le répertoire et le chemin d'import. - - - Repository: - Dépôt : - - - - QtC::TextEditor Not a color scheme file. Pas sur ? Pas un fichier de jeu de couleur. - Customized - Personnalisé + Text Editor + Éditeur de texte - - - QtC::VcsBase - Cannot Open Project - Impossible d'ouvrir le projet + <html><head/><body><p>Highlight definitions are provided by the <a href="https://api.kde.org/frameworks/syntax-highlighting/html/index.html">KSyntaxHighlighting</a> engine.</p></body></html> + <html><head/><body><p>Les définitions des surlignages sont fournies par le fichier <a href="https://api.kde.org/frameworks/syntax-highlighting/html/index.html">KSyntaxHighlighting</a></p></body></html> - Failed to open project in '%1'. - Échec de l'ouverture du projet dans "%1". + Download missing and update existing syntax definition files. + Télécharger les fichiers de définition syntaxique manquants et mettre à jour les fichiers existants. - Could not find any project files matching (%1) in the directory '%2'. - Impossible de trouver un fichier de projet correspondant (%1) dans le répertoire "%2". + Reload Definitions + Recharger les définitions - The Project Explorer is not available. - L'explorateur de projets n'est pas disponible. + Reload externally modified definition files. + Recharger les fichiers de définition modifiés en externe. - '%1' does not exist. - "%1' n"existe pas. + Reset Remembered Definitions + Réinitialisation des définitions mémorisées - Unable to open the project '%1'. - Impossible d'ouvrir le projet "%1". + Reset definitions remembered for files that can be associated with more than one highlighter definition. + Réinitialiser les définitions mémorisées pour les fichiers qui peuvent être associés à plusieurs définitions de surlignage. - Unable to start %1: %2 - Impossible de démarrer "%1" : %2 + User Highlight Definition Files + Fichiers de définition de surlignage de l’utilisateur - The process terminated with exit code %1. - Le processus s'est terminé avec le code %1. + Download finished + Téléchargement terminé - The process returned exit code %1. - Le processus a retourné le code %1. + Generic Highlighter + Coloration syntaxique générique - The process terminated in an abnormal way. - Le processus s'est terminé d'une façon anormale. + Download Definitions + Télécharger des définitions - Stopping... - Arrêt... + No outline available + Aucun contour disponible - Checkout - Import + Synchronize with Editor + Synchroniser avec l’éditeur - No job running, please abort. - Aucun travail en cours, veuillez abandonner. + Filter tree + Filtrer l’arbre - Checkout started... - Import commencé... + Outline + Contour - Failed. - Échec. + Cursor position: %1 + Position du curseur : %1 - Succeeded. - Réussi. + Other annotations + Autres annotations - Open "%1" - Ouvrir "%1" + Print Document + Imprimer le document - Clear - Effacer + File Error + Erreur de fichier - Executing: %1 %2 - Exécution de : %1 %2 + <b>Error:</b> Could not decode "%1" with "%2"-encoding. Editing not possible. + <b>Erreur :</b> impossible de décoder « %1 » avec l’encodage « %2 ». L’édition est impossible. - Executing in %1: %2 %3 - Exécution dans %1 : %2 %3 + Select Encoding + Choisir l’encodage - Executing: %1 %2 - - Exécution de : %1 %2 - + Snippet Parse Error + Erreur d’analyse de l’extrait de code - Executing in %1: %2 %3 - - Exécution dans %1 : %2 %3 - + A highlight definition was not found for this file. Would you like to download additional highlight definition files? + Aucune définition de surlignage n’a été trouvée pour ce fichier. Souhaitez-vous télécharger d’autres fichiers de définition de surlignage ? - - - QtC::Welcome - News && Support - Nouveauté && Support + More than one highlight definition was found for this file. Which one should be used to highlight this file? + Plusieurs définitions de surlignage ont été trouvées pour ce fichier. Laquelle devrait être utilisée pour surligner ce fichier ? - - - MimeType - unknown - inconnue + Remember My Choice + Se rappeler de mon choix - CMake Project file - Fichier de projet CMake + Zoom: %1% + Zoom : %1 % - C Source file - Fichier source C + Delete UTF-8 BOM on Save + Supprimer le BOM UTF-8 à l’enregistrement - C Header file - Fichier d'en-tête C + Add UTF-8 BOM on Save + Ajouter le BOM UTF-8 à l’enregistrement - C++ Header file - Fichier d'en-tête C++ + The text is too large to be displayed (%1 MB). + Le texte est trop lourd pour être affiché (%1 Mo). - C++ header - En-tête C++ + Error + Erreur - C++ Source file - Fichier source C++ + Trigger + Déclencheur - C++ source code - Code source C++ + Trigger Variant + Déclencheur variable - Objective-C source code - Code source en objective-C + Error reverting snippet. + Erreur lors de la restauration de l’extrait de code. - CVS submit template - Modèle d'envoi de CVS + Group: + Groupe : - Qt Designer file - Fichier Qt designer + Snippets + Extraits de code - Generic Qt Creator Project file - Fichier de projet Qt Creator générique + Error While Saving Snippet Collection + Erreur lors de l’enregistrement de la collection d’extraits de code - Generic Project Files - Fichiers de projet génériques + No snippet selected. + Pas d’extrait de code sélectionné. - Generic Project Include Paths - Chemins d'inclusion de projet génériques + %1 of %2 + %1 de %2 - Generic Project Configuration File - Fichier de configuration de projet générique + Cannot create user snippet directory %1 + Impossible de créer le dossier utilisateur d’extraits de code %1 - Perforce submit template - Modèle d'envoi de Perforce + Copy Code Style + Copier le style de code - QML file - Fichier QML + Code style name: + Nom du style de code : - Qml Project file - Fichier de projet QML + %1 (Copy) + %1 (Copie) - Qt Project file - Fichier de projet Qt + Delete Code Style + Supprimer le style de code - Qt Project include file - Fichier d'inclusion de projet Qt + Are you sure you want to delete this code style permanently? + Êtes-vous sur de vouloir supprimer ce style de code ? - message catalog - Catalogue de messages + Import Code Style + Importer un style de code - Qt Script file - Fichier Qt Script + Code styles (*.xml);;All files (*) + Styles de code (*.xml);;Tous les fichiers (*) - Automake based Makefile - Makefile basé sur automake + Cannot import code style from "%1". + Impossible d’importer le style de code à partir de « %1 ». - ClearCase submit template - Modèle de proposition pour ClearCase + Export Code Style + Exporter le style de code - Objective-C++ source code - Code source Objective-C++ + %1 [proxy: %2] + %1 [proxy : %2] - Git Commit File - Fichier de soumission Git + %1 [built-in] + %1 [intégré] - GLSL Shader file - Fichier de shader GLSL + Edit preview contents to see how the current settings are applied to custom code snippets. Changes in the preview do not affect the current settings. + Modifier l’aperçu du contenu pour voir la manière dont les paramètres actuels sont appliqués dans l’extrait de code personnalisé. Les changements dans la zone d’aperçu n’affectent pas les paramètres actuels. - GLSL Fragment Shader file - Fichier de fragment shader GLSL + Files in File System + Fichiers dans le système de fichiers - GLSL/ES Fragment Shader file - Fichier de fragment shader GLSL/ES + %1 "%2": + %1 « %2 » : - GLSL Vertex Shader file - Fichier de vertex shader GLSL + Path: %1 +Filter: %2 +Excluding: %3 +%4 + the last arg is filled by BaseFileFind::runNewSearch + Chemin : %1 +Filtre : %2 +Exclus : %3 +%4 - GLSL/ES Vertex Shader file - Fichier de vertex shader GLSL/ES + Search engine: + Moteur de recherche : - GLSL/ES Geometry Shader file - Fichier de géométrie shader GLSL/ES + Director&y: + Réperto&ire : - BMP image - Image BMP + Directory to Search + Répertoire de recherche - GIF image - Image GIF + Typing + Frappe - ICO image - Image ICO + Enable automatic &indentation + Activer l’&indentation automatique - JPEG image - Image JPEG - - - MNG video - Video MNG - - - PBM image - Image PBM - - - PGM image - Image PGM - - - PNG image - Image PNG - - - PPM image - Image PPM - - - SVG image - Image SVG - - - TIFF image - Image TIFF - - - XBM image - Image XBM - - - XPM image - Image XPM - - - Python Source File - Fichier source Pyhton - - - Qt Build Suite file - Fichier de compilation Qt - - - Qt Creator Qt UI project file - Fichier de projet Qt UI de Qt Creator - - - JSON file - Fichier JSON - - - QML Project file - Fichier de projet QML - - - Qt Project feature file - fichier de caractéristiques de projet Qt - - - Qt Resource file - Fichier de ressource Qt - - - Subversion submit template - Modèle d'envoi de Subversion - - - Qt Creator task list file - Fichier de liste des tâches de Qt Creator - - - Plain text document - Document de text brut - - - XML document - Document XML - - - Assembler - Assembleur - - - Qt Creator Generic Assembler - Assembleur générique de Qt Creator - - - Differences between files - Différences entre fichiers - - - - QmlParser - - Illegal character - Caractère invalide - - - Unclosed string at end of line - Chaîne de caractère non terminée en fin de ligne - - - Illegal escape squence - Séquence d'échappement invalide - - - Illegal unicode escape sequence - trad illegal ? - Séquence d'échappement unicode invalide - - - Illegal escape sequence - Séquence d'échappement invalide - - - Unclosed comment at end of file - Commentaire non terminée en fin de ligne - - - Illegal syntax for exponential number - Syntaxe pour le nombre exponentiel invalide - - - Identifier cannot start with numeric literal - Trad numeric literal ? - Un identificateur ne peut pas commencer par un nombre - - - Unterminated regular expression literal - Expression régulière non terminée - - - Invalid regular expression flag '%0' - Expression régulière invalide flag "%0" - - - Stray newline in string literal - Retour à la ligne inopiné dans la chaîne littérale - - - Illegal hexadecimal escape sequence - La séquence d'échappement hexadécimale n'est pas correcte - - - Octal escape sequences are not allowed - Les séquences d'échappement octale ne sont pas autorisées - - - Decimal numbers can't start with '0' - Les nombres décimaux ne peuvet pas commencer par "0" - - - At least one hexadecimal digit is required after '0%1' - Au moins un chiffre hexadécimal est requis après "0%1" - - - Unterminated regular expression backslash sequence - Expression régulière non terminée contenant une séquence de backslash - - - Unterminated regular expression class - Classe d'expression régulière non terminée - - - Unexpected token `%1' - Symbole inattendu "%1" - - - Expected token `%1' - Symbole attendu "%1" - - - Unexpected token '%1' - Symbole inattendu "%1" - - - Expected token '%1' - Symbole attendu "%1" - - - Syntax error - Erreur de syntaxe - - - - QtC::QmakeProjectManager - - Id: - Id : - - - EPOC: - EPOC : - - - Tools: - Outils : - - - Qt: - Qt : - - - - trk::BluetoothListener - - %1: Stopping listener %2... - %1 : arrêt de l'observateur %2... - - - %1: Starting Bluetooth listener %2... - %1 : démarrage de l'observateur Bluetooth %2... - - - Unable to run '%1': %2 - Impossible de démarrer "%1" : %2 - - - %1: Bluetooth listener running (%2). - %1 : observateur Bluetooth en cours d'éxecution (%2). - - - %1: Process %2 terminated with exit code %3. - %1 : processus %2 terminé avec le code %3. - - - %1: Process %2 crashed. - %1 : processus %2 planté. - - - %1: Process error %2: %3 - %1 : erreur de processus %2 : %3 - - - - trk::promptStartCommunication - - Connection on %1 canceled. - Connexion sur %1 annulée. - - - Waiting for TRK - Attente de TRK - - - Waiting for TRK to start on %1... - Attente que TRK ai démarré sur %1... ??? [pierre: je plussoie] - Démarrage de TRK sur %1 en attente... - - - Waiting for App TRK - En attente d'App TRK - - - Waiting for App TRK to start on %1... - Démarrage d'App TRK sur %1 en attente... - - - Waiting for Bluetooth Connection - Attente d'une connexion Bluetooth - - - Connecting to %1... - Connexion à %1... - - - - trk::BaseCommunicationStarter - - %1: timed out after %n attempts using an interval of %2ms. - - %1 : interruption après %n tentative en utilisant un intervalle de %2ms. - %1 : interruption après %n tentatives en utilisant un intervalle de %2ms. - - - - %1: Connection attempt %2 succeeded. - %1 : tentative de connexion %2 réussie. - - - %1: Connection attempt %2 failed: %3 (retrying)... - %1 : tenative de connexion %2 echoué : %3 (nouvel essai)... - - - - QtC::Debugger - - Internal name - Nom interne - - - Full name - Nom complet - - - - QtC::ProjectExplorer - - Change build configuration && continue - Changer la configuration de compilation et continuer - - - - trk::Session - - CPU: v%1.%2%3%4 - CPU description of an S60 device %1 major verison, %2 minor version %3 real name of major verison, %4 real name of minor version - CPU : v%1.%2%3%4 - - - App TRK: v%1.%2 TRK protocol: v%3.%4 - App TRK : v%1.%2 protocole TRK : v%3.%4 - - - %1, %2%3%4, %5 - s60description description of an S60 device %1 CPU description, %2 endianness %3 default type size (if any), %4 float size (if any) %5 TRK version - %1, %2%3%4, %5 - - - big endian - gros-boutiste ?? - big endian - - - little endian - little endian - - - , type size: %1 - will be inserted into s60description - , taille du type : %1 - - - , float size: %1 - will be inserted into s60description - , taille d'un flottant : %1 - - - - QtC::Git - - Stashes - Remises - - - Name - Nom - - - Branch - Branche - - - Message - Message - - - Delete all... - Tout supprimer... - - - Show - Afficher - - - Restore... - Restauration... - - - Restore to branch... - Restore a git stash to new branch to be created - Restaurer la branche... - - - <No repository> - <Aucun dépôt> - - - Repository: %1 - Dépôt : %1 - - - Delete stashes - Supprimer les stashes - - - Do you want to delete all stashes? - Voulez-vous supprimer toutes les remises ? - - - Do you want to delete %n stash(es)? - - Voulez-vous effacer %n remise ? - Voulez-vous effacer %n remises ? - - - - Repository modified - Dépôt modifié - - - Delete All... - Tout supprimer... - - - Restore to Branch... - Restore a git stash to new branch to be created - Restaurer la branche... - - - Delete &All... - &Tout supprimer... - - - &Delete... - &Supprimer... - - - R&estore... - R&estaurer... - - - Restore to &Branch... - Restore a git stash to new branch to be created - Restaurer dans la &branche... - - - Delete Stashes - Supprimer les remises - - - Repository Modified - Dépôt modifié - - - %1 cannot be restored since the repository is modified. -You can choose between stashing the changes or discarding them. - %1 ne peut pas être restauré depuis que le dépôt a été modifié. -Vous pouvez choisir entre mettre les changements dans une remise ou de les abandonner. - - - Restore Stash to Branch - Restaurer la remise dans la branche - - - Stash Restore - Restauration de la remise - - - Would you like to restore %1? - Souhaitez-vous restaurer "%1" ? - - - Error restoring %1 - Erreur lors de la restauration de %1 - - - - QtC::Mercurial - - General Information - Informations générales - - - Repository: - Dépôt : - - - repository - dépôt - - - Branch: - Branche : - - - branch - branche - - - Commit Information - Informations de commit - - - Author: - Auteur : - - - Email: - Email : - - - Form - Formulaire - - - Configuration - Configuration - - - Command: - Commande : - - - User - Utilisateur - - - Username to use by default on commit. - Nom d'utilisateur à utiliser par défaut lors des commits. - - - Default username: - Nom d'utilisateur par défaut : - - - Email to use by default on commit. - Email à utiliser par défaut lors des commit. - - - Default email: - Email par défaut : - - - Miscellaneous - Divers - - - Log count: - Nombre de log : - - - The number of recent commit logs to show, choose 0 to see all enteries - Le nombre de logs de commit récents à afficher, mettez 0 pour tout afficher - - - Timeout: - Timeout : - - - s - s - - - Prompt on submit - Invite lors du submit - - - The number of recent commit logs to show, choose 0 to see all entries. - Le nombre de logs de commit récents à afficher, 0 pour tout afficher. - - - Revert - Rétablir - - - Specify a revision other than the default? - Spécifier une revision différente de celle par défaut ? - - - Revision: - Révision : - - - Dialog - Boîte de dialogue - - - Default Location - Emplacement par défaut - - - Local filesystem: - Système local de fichier : - - - e.g. https://[user[:pass]@]host[:port]/[path] - p. ex. https://[user[:pass]@]host[:port]/[path] - - - Specify Url: - Spécifier l'URL : - - - Specify URL: - Spécifier l'URL : - - - Prompt for credentials - Invite des certifications - - - - QtC::ProjectExplorer - - Add target - Ajouter une cible - - - Target: - Cible : - - - DoubleTabWidget - DoubleTabWidget - - - TargetSettingsWidget - TargetSettingsWidget - - - Add Kit - Ajouter un kit - - - Manage Kits... - Gérer les kits... - - - - BehaviorDialog - - Dialog - Boîte de dialogue - - - Type: - Type : - - - Id: - Id : - - - Property Name: - Nom de la propriété : - - - Animation - Animation - - - SpringFollow - SpringFollow - - - Settings - Paramètres - - - Duration: - Durée : - - - Curve: - Courbe : - - - easeNone - easeNone - - - Source: - Source : - - - Velocity: - Vitesse : - - - Spring: - Élasticité : - - - Damping: - Amortissement : - - - ID: - Id : - - - Property name: - Nom de la propriété : - - - - GradientDialog - - Edit Gradient - Éditer le dégradé - - - - GradientEditor - - Form - Formulaire - - - Gradient Editor - Éditeur de dégradé - - - This area shows a preview of the gradient being edited. It also allows you to edit parameters specific to the gradient's type such as start and final point, radius etc. by drag & drop. - Cette zone affiche un aperçu du dégradé en cours d'édition. Il vous permet également de modifier les paramètres spécifique au type de dégradé tels que le point de départ et le point final, le rayon, etc., par glisser-déposer. - - - 1 - 1 - - - 2 - 2 - - - 3 - 3 - - - 4 - 4 - - - 5 - 5 - - - Gradient Stops Editor - Éditeur de point d'arrêt du dégradé - - - This area allows you to edit gradient stops. Double click on the existing stop handle to duplicate it. Double click outside of the existing stop handles to create a new stop. Drag & drop the handle to reposition it. Use right mouse button to popup context menu with extra actions. - Cette zone vous permet de modifier les points d'arrêt du dégradé. Double-cliquez sur la poignée d'un point d'arrêt existant pour la dupliquer. Double-cliquez à l'extérieur des poignées des points d'arrêt existant pour créer un nouveau point d'arrêt. Glisser-déposer une poignée pour la repositionner. Utilisez le bouton droit de la souris pour faire apparaître le menu contextuel avec des actions supplémentaires. - - - Zoom - Zoom - - - Reset Zoom - Réinitialiser le zoom - - - Position - Position - - - Hue - Teinte - - - H - T - - - Saturation - Saturation - - - S - S - - - Sat - Sat - - - Value - Valeur - - - V - V - - - Val - Val - - - Alpha - Alpha - - - A - A - - - Type - Type - - - Spread - Séquence - - - Color - Couleur - - - Current stop's color - Couleur du point d'arrêt courant - - - Show HSV specification - Afficher les spécifications TSV - - - HSV - TSV - - - Show RGB specification - Afficher les spécifications RVB - - - RGB - RVB - - - Current stop's position - Position du point d'arrêt courant - - - % - % - - - Zoom In - Zoom avant - - - Zoom Out - Zoom arrière - - - Toggle details extension - Activer/désactiver les détails des extensions - - - > - > - - - Linear Type - Type linéaire - - - ... - ... - - - Radial Type - Type radial - - - Conical Type - Type conique - - - Pad Spread - Séquence par remplissage - - - Repeat Spread - Séquence répétée - - - Reflect Spread - Séquence en reflet - - - Start X - X initial - - - Start Y - Y initial - - - Final X - X final - - - Final Y - Y final - - - Central X - X central - - - Central Y - Y central - - - Focal X - Focale X - - - Focal Y - Focale Y - - - Radius - Rayon - - - Angle - Angle - - - Linear - Linéaire - - - Radial - Radial - - - Conical - Conique - - - Pad - Remplissage - - - Repeat - Répétition - - - Reflect - Reflet - - - - QtGradientDialog - - Edit Gradient - Éditer le dégradé - - - - QtGradientEditor - - Form - Formulaire - - - Gradient Editor - Éditeur de dégradé - - - This area shows a preview of the gradient being edited. It also allows you to edit parameters specific to the gradient's type such as start and final point, radius etc. by drag & drop. - Cette zone affiche un aperçu du dégradé en cours d'édition. Il vous permet également de modifier les paramètres spécifique au type de dégradé tels que le point de départ et le point final, le rayon, etc., par glisser-déposer. - - - 1 - 1 - - - 2 - 2 - - - 3 - 3 - - - 4 - 4 - - - 5 - 5 - - - Gradient Stops Editor - Éditeur de point d'arrêt du dégradé - - - This area allows you to edit gradient stops. Double click on the existing stop handle to duplicate it. Double click outside of the existing stop handles to create a new stop. Drag & drop the handle to reposition it. Use right mouse button to popup context menu with extra actions. - Cette zone vous permet de modifier les points d'arrêt du dégradé. Double-cliquez sur la poignée d'un point d'arrêt existant pour la dupliquer. Double-cliquez à l'extérieur des poignées des points d'arrêt existant pour créer un nouveau point d'arrêt. Glisser-déposer une poignée pour la repositionner. Utilisez le bouton droit de la souris pour faire apparaître le menu contextuel avec des actions supplémentaires. - - - Zoom - Zoom - - - Reset Zoom - Réinitialiser le zoom - - - Position - Position - - - Hue - Teinte - - - H - T - - - Saturation - Saturation - - - S - S - - - Sat - Sat - - - Value - Valeur - - - V - V - - - Val - Val - - - Alpha - Alpha - - - A - A - - - Type - Type - - - Spread - Séquence - - - Color - Couleur - - - Current stop's color - Couleur du point d'arrêt courant - - - Show HSV specification - Afficher les spécifications RVB - - - HSV - TSV - - - Show RGB specification - Afficher les spécifications TSV - - - RGB - RVB - - - Current stop's position - Position du point d'arrêt courant - - - % - % - - - Zoom In - Zoom avant - - - Zoom Out - Zoom arrière - - - Toggle details extension - Activer/désaciver les détails de l'extension - - - > - > - - - Linear Type - Type linéaire - - - ... - ... - - - Radial Type - Type radial - - - Conical Type - Type conique - - - Pad Spread - Séquence par remplissage - - - Repeat Spread - Séquence répétée - - - Reflect Spread - Séquence en reflet - - - Start X - X initial - - - Start Y - Y initial - - - Final X - X final - - - Final Y - Y final - - - Central X - X central - - - Central Y - Y central - - - Focal X - Focale X - - - Focal Y - Focale Y - - - Radius - Rayon - - - Angle - Angle - - - Linear - Linéaire - - - Radial - Radial - - - Conical - Conique - - - Pad - Remplissage - - - Repeat - Répéter - - - Reflect - Reflet - - - - QtGradientView - - Gradient View - Visualisation du dégradé - - - New... - Nouveau... - - - Edit... - Modifier... - - - Rename - Renommer - - - Remove - Supprimer - - - Grad - Grad - - - Remove Gradient - Supprimer le dégradé - - - Are you sure you want to remove the selected gradient? - Êtes-vous sur de vouloir supprimer le dégradé sélectionné ? - - - - QtGradientViewDialog - - Select Gradient - Choisir le dégradé - - - - QmlDesigner::Internal::SettingsPage - - Form - Formulaire - - - Snapping - pour être cohérents avec designer - Aimantation - - - Item spacing - Espacement entre les éléments - - - Snap margin - idem - Distance d'aimantation - - - Qt Quick Designer - Designer Qt Quick - - - Snap margin: - Distance d'aimantation : - - - Item spacing: - Espacement entre les éléments : - - - Canvas - Canevas - - - Width - Largeur - - - Height - Hauteur - - - Debugging - Débogage - - - Warn about QML features which are not properly supported by the Qt Quick Designer - Avertir à propos des fonctionnalités QML qui ne sont pas supportées complètement par Qt Quick Designer - - - Show the debugging view - Afficher la vue de débogage - - - Also warn in the code editor about QML features which are not properly supported by the Qt Quick Designer - Avertir aussi dans l'éditeur de code à propos des fonctionnalités QML qui ne sont pas supportées complètement par Qt Quick Designer - - - Enable the debugging view - Activer la vue de débogage - - - Warnings - Avertissements - - - Warn about unsupported features in the Qt Quick Designer - Avertir à propos des fonctionnalités non supportées dans Qt Quick Designer - - - Warn about unsupported features of Qt Quick Designer in the code editor - Avertir à propos des fonctionnalités non supportées de Qt Quick Designer dans l'éditeur de code - - - Parent item padding: - Décalage de l'élement parent : - - - Sibling item spacing: - Espacement avec les éléments frères : - - - - StartExternalQmlDialog - - Start Simultaneous QML and C++ Debugging - Démarrer simultanément le déboguage du QML et du C++ - - - Debugging address: - Addresse du débogeur : - - - Debugging port: - Port du débogueur : - - - 127.0.0.1 - 127.0.0.1 - - - Project: - Projet : - - - <No project> - <Aucun projet> - - - Viewer path: - Chemin du visualisateur : - - - Viewer arguments: - Arguments du visualisateur : - - - To switch languages while debugging, go to Debug->Language menu. - Pour changer de langage pendant le débogage, allez dans le menu Déboguage->Langage. - - - - MaemoConfigTestDialog - - Device Configuration Test - Test de la configuration du périphérique - - - - MaemoPackageCreationWidget - - Package contents: - Contenu du paquet : - - - Add File to Package - Ajouter un fichier au paquet - - - Remove File from Package - Supprimer un fichier du paquet - - - Check this if you want the files below to be deployed directly. - Cochez ceci si vous voulez que les fichiers ci-dessous soient déployés directement. - - - Skip packaging step - Sauter l'étape de packaging - - - Version number: - Numéro de version : - - - Major: - Majeur : - - - Minor: - Mineur : - - - Patch: - Patch : - - - Files to deploy: - Fichiers à déployer : - - - <b>Version number:</b> - <b>Numéro de version :</b> - - - <b>Adapt Debian file:</b> - <b>Adapter le fichier Debian :</b> - - - Edit - Éditer - - - <b>Package Manager icon:</b> - <b>Icône du gestionaire de paquet :</b> - - - Package name: - Nom du paquet : - - - Package version: - Version du paquet : - - - Short package description: - Description couret du paquet : - - - Name to be displayed in Package Manager: - Nom à afficher dans le gestionnaire de paquets : - - - Icon to be displayed in Package Manager: - Icône à afficher dans le gestionnaire de paquets : - - - Size is 48x48 pixels - La taille est de 48x48 pixels - - - Adapt Debian file: - Adapter le fichier Debian : - - - Edit spec file - Éditer le fichier de spécifications - - - Edit... - Modifier... - - - - QtC::QmakeProjectManager - - Not signed - Non signé - - - Create Smart Installer package - Créer un paquet Smart Installer - - - Resets saved passphrases for all used keys - Réinitialise les mots de passe pour toutes les clés utilisées - - - Reset Passphrases - Réinitialiser les mots de passe - - - Choose certificate file - Choisir le fichier de certificat - - - Certificate's details - Détails du certificat - - - Setup targets for your project - Installer les cibles pour votre projet - - - Qt Creator can set up the following targets: - Qt Creator peut mettre en place les cibles suivantes : - - - Qt Version - Version de Qt - - - Status - Status - - - Build Directory - Répertoire de compilation - - - Import Existing Shadow Build... - Importer un shadow build existant... - - - Import - Is this an import of an existing build or a new one? - Importer - - - New - Is this an import of an existing build or a new one? - Nouveau - - - Qt Creator can set up the following targets for project <b>%1</b>: - %1: Project name - Qt Creator peut mettre en place les cibles suivantes pour le projet <b>%1</b> : - - - Qt Creator can set up the following targets for<br>project <b>%1</b>: - %1: Project name - Qt Creator peut mettre en place les cibles suivantes pour le projet <b>%1</b> : - - - Choose a directory to scan for additional shadow builds - Choisir un répertoire pour rechercher des shadow builds supplémentaires - - - No builds found - Aucun shadow build trouvé - - - No builds for project file "%1" were found in the folder "%2". - %1: pro-file, %2: directory that was checked. - Aucun shadow build pour le fichier de projet "%1" n'a été trouvé dans le répertoire "%2". - - - Check All - Cocher tout - - - Check all Qt versions - myzu : check => cocher ou vérifier ? - john : vu qu'il y a uncheck je pense plutôt à cocher. - Cocher toutes les versions de Qt - - - Check only this version - Ne cocher que cette version - - - Check all versions - Cocher toutes les versions - - - Uncheck all versions - Décocher toutes les versions - - - debug and release - We are going to build debug and release - debug et release - - - debug - Debug build - debug - - - release - release build - release - - - <br>using %1 (%2) - %1: qmake used (incl. full path), %2: "debug", "release" or "debug and release" - <br>en utilisant %1 (%2) - - - Import - Is this an import of an existing build or a new one? - Importer - - - New - Is this an import of an existing build or a new one? - Nouveau - - - Uncheck all Qt versions - Décocher toutes les versions de Qt - - - Uncheck All - Décocher tout - - - <b>No valid qt versions found.</b><br> Please add a qt version in Tools/Options or via the maintenance tool of the SDK. - <b>Pas de version de Qt valide trouvée.</b><br>Veuillez ajouter une version de Qt dans Outils > Options ou par l'outil de maintenance du SDK. - - - <html><head/><body><p><b>No valid Qt versions found.</b></p><p>Please add a Qt version in <i>Tools/Options</i> or via the maintenance tool of the SDK.</p></body></html> - <html><head/><body><p><b>Pas de version de Qt valide trouvée.</b></p><p>Veuillez ajouter une version de Qt par <i>Outils > Options</i> ou par l'outil de maintenance du SDK.</p></body></html> - - - Set up Targets for Your Project - Définisser des cibles pour votre projet - - - <html><head/><body><p><span style=" font-weight:600;">No valid Qt versions found.</span></p><p>Please add a Qt version in <span style=" font-style:italic;">Tools &gt; Options &gt; Build &amp; Run</span> (<span style=" font-style:italic;">Qt Creator &gt; Preferences &gt; Build &amp; Run</span> on Mac OS) or via the maintenance tool of the SDK.</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Aucune versions de Qt valide trouvées.</span></p><p>Veuillez ajouter une version de Qt dans <span style=" font-style:italic;">Outils&gt; Options &gt; Compiler &amp; Exécuter</span> (<span style=" font-style:italic;">Qt Creator &gt; Préferences &gt; Compiler &amp; Exécuter</span> sur Mac OS) ou via l'outil de maintenance du SDK.</p></body></html> - - - Specify basic information about the test class for which you want to generate skeleton source code file. - Définit les informations de base des classes de test pour lesquelles vous souhaitez générer des fichiers squelettes de code source. - - - Class name: - Nom de la classe : - - - Type: - Type : - - - Test - Test - - - Benchmark - Benchmark - - - File: - Fichier : - - - Generate initialization and cleanup code - Génére le code d'initialisation et de nettoyage - - - Test slot: - Slot de test : - - - Requires QApplication - QApplication est nécessaire - - - Use a test data set - Utiliser un ensemble de données de test - - - Test Class Information - Information sur la classe de test - - - - HighlighterSettingsPage - - Form - Formulaire - - - Location: - Emplacement : - - - Reset to default - Restaurer les paramètres par défaut - - - R - R + Backspace indentation: + Indentation pour retour arrière : <html><head/><body> -<p>Highlight definitions are provided by the <a href="http://kate-editor.org/">Kate Text Editor</a>.</p></body></html> - highlight ? John : Coloration syntaxique - <html><head/><body> -<p>Les définitions de coloration syntaxique sont fournies par l'éditeur de texte <a href="http://kate-editor.org/">Kate</a>.</p></body></html> +Specifies how backspace interacts with indentation. + +<ul> +<li>None: No interaction at all. Regular plain backspace behavior. +</li> + +<li>Follows Previous Indents: In leading white space it will take the cursor back to the nearest indentation level used in previous lines. +</li> + +<li>Unindents: If the character behind the cursor is a space it behaves as a backtab. +</li> +</ul></body></html> + + <html><head/><body> +Spécifie comment retour arrière se comporte avec l’indentation. + +<ul> +<li>Aucune : aucune interaction. Comportement habituel de la touche retour arrière. +</li> + +<li>Suit l’indentation qui précède : dans des espaces de début de ligne, ramène le curseur au niveau d’indentation le plus proche utilisé dans les lignes précédentes. +</li> + +<li>Désindente : si le caractère après le curseur est une espace, se comporte comme une tabulation arrière. +</li> +</ul></body></html> + - - Syntax Highlight Definition Files - Fichiers de définition de colorationsyntaxique - - - Use fallback location - fallback ? => "de repli" ? "à défaut" ? [pnr] - Utiliser un emplacement de repli - - - Behavior - Comportement - - - Alert when a highlight definition is not found - Prévenir si une définition de coloration syntaxique n'est pas trouvée - - - Ignored file patterns: - Motifs de fichier ignorés : - - - - QtC::VcsBase - - The directory %1 could not be deleted. - Le répertoire %1 ne peut pas être supprimer. - - - The file %1 could not be deleted. - Le fichier %1 ne peut pas être supprimer. - - - There were errors when cleaning the repository %1: - Il y a eu des erreurs lors du nettoyage du dépôt %1 : - - - Delete... - Supprimer… - - - Repository: %1 - Dépôt : %1 - - - %n bytes, last modified %1 - - %n octet, dernière modification le %1 - %n octets, dernière modification le %1 - - - - %1 bytes, last modified %2 - %1 octets, dernière modification le %2 - - - Delete - Supprimer - - - Do you want to delete %n files? - - Voulez-vous supprimer %n fichier ? - Voulez-vous supprimer %n fichiers ? - - - - Cleaning %1 - Nettoyage de %1 - - - Submit message check script: - Script de vérification du message : - - - User/alias configuration file: - Fichier de configuration des alias utilisateur : - - - User fields configuration file: - Fichier de configuration des champs utilisateurs : - - - SSH prompt command: - Invite de commande SSH : - - - - BorderImageSpecifics - - Image - Image - - - Source - Source - - - Source Size - Taille de la source - - - Border Image - Image avec bordure - - - Border Left - Bordure à gauche - - - Border Right - Bordure à droite - - - Border Top - Bordure en haut - - - Border Bottom - Bordure en bas - - - Horizontal Fill mode - Mode de remplissage horizontal - - - Vertical Fill mode - Mode de remplissage vertical - - - Source size - Taille de la source - - - BorderImage - Bordure d'image - - - Left - Gauche - - - Right - Droite - - - Top - Haut - - - Bottom - Bas - - - - emptyPane - - none or multiple items selected - Aucun ou plusieurs éléments sélectionnés - - - None or multiple items selected. - Aucun ou plusieurs éléments sélectionnés. - - - - ExpressionEditor - - Expression - Expression - - - - Extended - - Effect - Effet - - - Blur Radius: - Rayon du flou : - - - Pixel Size: - Taille de pixel : - - - x Offset: - Décalage x : - - - y Offset: - Décalage y : - - - - ExtendedFunctionButton - - Reset - Réinitialiser - - - Set Expression - Définir l'expression - - - - FontGroupBox - - Font - Police - - - Size - Taille - - - Font style - Style de police - - - Font Style - Style de police - - - Style - Style - - - - Geometry - - Geometry - Géométrie - - - Position - Position - - - Size - Taille - - - Width - Largeur - - - Height - Hauteur - - - Lock aspect ratio - Vérouille le ratio de l'aspect - - - - ImageSpecifics - - Image - Image - - - Source - Source - - - Fill mode - Mode de remplissage - - - Source size - Taille de la source - - - Painted size - Taille de la zone de dessin - - - Fill Mode - Mode de remplissage - - - Aliasing - Aliasing - - - Smooth - Lissage - - - Source Size - Taille de la source - - - Painted Size - Taille de la zone de dessin - - - - Layout - - Layout - Layout - - - Anchors - Ancres - - - Set anchors - Définir les ancres - - - Setting anchors in states is not supported. - Définir les ancres dans des états non supportés. - - - Target - Cible - - - Margin - Marge - - - - Modifiers - - Manipulation - Manipulation - - - Rotation - Rotation - - - z - z - - - - RectangleColorGroupBox - - Colors - Couleurs - - - Stops - Points d'arrêt - - - Gradient stops - Points d'arrêt du dégradé - - - Gradient Stops - Points d'arrêt du dégradé - - - Rectangle - Rectangle - - - Border - Bordure - - - - RectangleSpecifics - - Rectangle - Rectangle - - - Border width - Largeur de la bordure - - - Border has to be solid to change width - La bordure doit être solide pour en changer la largeur - - - Border - Bordure - - - Radius - Rayon - - - Color - Couleur - - - Border Color - Couleur de la bordure - - - - StandardTextColorGroupBox - - Color - Couleur - - - Text - Texte - - - Style - Style - - - Selection - Sélection - - - Selected - Sélectionné - - - - StandardTextGroupBox - - Text - Texte - - - Wrap mode - Mode de limitation - - - Wrap Mode - Mode de limitation - - - Alignment - Alignement - - - - - - - Aliasing - Aliasing - - - Smooth - Lissage - - - - Switches - - special properties - Propriétés spéciales - - - layout and geometry - Disposition et géométrie - - - Geometry - Géométrie - - - layout - layout - - - Special properties - Propriétés spéciales - - - Layout - Layout - - - Advanced properties - Propriétés avancées - - - advanced properties - Propriétés avancées - - - Advanced - Avancé - - - - TextEditSpecifics - - Text Edit - Modifier le texte - - - Format - Format - - - Text Color - Couleur du texte - - - Selection Color - Couleur de la sélection - - - Text Input - Texte en entrée - - - - TextInputGroupBox - - Text Input - Texte en entrée - - - Input mask - Masque d'entrée - - - Echo mode - Mode d'affichage - - - Pass. char - Carac. masqué - - - Character displayed when users enter passwords. - Caractère affiché quand l'utilisateur entre des mots de passe. - - - Read only - Lecture seule - - - Cursor visible - Curseur visible - - - Active focus on press - Activer le focus à l'appui - - - Auto scroll - Défilement automatique - - - Input Mask - Masque d'entrée - - - Echo Mode - Mode d'affichage - - - Pass. Char - Carac. masqué - - - Password Character - Caractère masqué - - - Flags - TODO: ou laisser flags? homogénéiser -francis : ouai assez d'accord. - Flags - - - Read Only - Lecture seule - - - Cursor Visible - Curseur visible - - - Focus On Press - Focus à l'appui - - - Auto Scroll - Défilement auto - - - - Transformation - - Transformation - Transformation - - - Origin - Origine - - - Top Left - Haut Gauche - - - Top - Haut - - - Top Right - Haut Droite - - - Top left - Haut gauche - - - Top right - Haut droite - - - Left - Gauche - - - Center - Centre - - - Right - Droite - - - Bottom left - Bas gauche - - - Bottom right - Bas droite - - - Bottom Left - Bas Gauche - - - Bottom - Bas - - - Bottom Right - Bas Droite - - - Scale - Échelle - - - Rotation - Rotation - - - - Type - - Type - Type - - - Id - Id - - - - Visibility - - Visibility - Visibilité - - - Is visible - Est visible - - - Visible - Visible - - - isVisible - ?? - Est visible - - - Smooth - Lissage - - - Clip - Retailler - - - Opacity - Opacité - - - - WebViewSpecifics - - WebView - WebView - - - Url - Url - - - Title - Titre - - - URL - URL - - - Pref Width - Largeur préférée - - - Preferred Width - Largeur préférée - - - Pref Height - Hauteur préférée - - - Preferred Height - Hauteur préférée - - - Scale - Je suis pas d'accord, je dirais redimensionnement (original : échelle) - Redimensionnement - - - Contents Scale - Je dirais redimensionnement au contenu (dans le sens s'adapter au contenu) - Redimensionnement au contenu - - - Page Height - Hauteur de la page - - - - QtC::ExtensionSystem None Aucune - All - Tout + Follows Previous Indents + Suit l’indentation qui précède - Load on Startup - Charger au démarrage + Unindents + Désindente - Utilities - Utilitaires + Prefer single line comments + Préférer les commentaires d’une seule ligne + + + Skip clean whitespace for file types: + Ne pas tenir compte des espaces blancs pour les types de fichier: + + + For the file patterns listed, do not trim trailing whitespace. + Pour les motifs de fichiers énumérés, ne pas enlever les espaces blancs au début et à la fin. + + + List of wildcard-aware file patterns, separated by commas or semicolons. + Liste de motifs de fichiers avec des caractères joker, séparés par des virgules ou des points-virgules. + + + Always writes a newline character at the end of the file. + Écrit toujours un caractère de retour à la ligne à la fin du fichier. + + + Corrects leading whitespace according to tab settings. + Corrige les espaces blancs en fonction des paramètres de tabulation. + + + Cleans whitespace in entire document instead of only for changed parts. + Nettoie les espaces blancs dans l’ensemble du document et non pas uniquement dans les parties modifiées. + + + <html><head/><body> +<p>How text editors should deal with UTF-8 Byte Order Marks. The options are:</p> +<ul ><li><i>Add If Encoding Is UTF-8:</i> always add a BOM when saving a file in UTF-8 encoding. Note that this will not work if the encoding is <i>System</i>, as the text editor does not know what it actually is.</li> +<li><i>Keep If Already Present: </i>save the file with a BOM if it already had one when it was loaded.</li> +<li><i>Always Delete:</i> never write an UTF-8 BOM, possibly deleting a pre-existing one.</li></ul> +<p>Note that UTF-8 BOMs are uncommon and treated incorrectly by some editors, so it usually makes little sense to add any.</p> +<p>This setting does <b>not</b> influence the use of UTF-16 and UTF-32 BOMs.</p></body></html> + <html><head/><body> +<p>Comment les éditeurs de texte doivent traiter les indicateurs d’ordre des octets (BOM) UTF-8. Les options sont :</p> +<ul ><li><i>Ajouter si l’encodage est UTF-8 :</i> toujours ajouter un BOM lors de l’enregistrement d’un fichier en encodage UTF-8. Notez que cela ne fonctionnera pas si l’encodage est <i>Système</i>, car l’éditeur de texte ne sait pas ce qu’il est réellement.</li> +<li><i>Conserver si déjà présent : </i> enregistrer le fichier avec un BOM s’il en avait déjà un lorsqu’il a été chargé.</li> +<li><i>Toujours supprimer :</i> ne jamais écrire de BOM UTF-8, en supprimant éventuellement le BOM préexistant.</li></ul> +Notez que les BOM UTF-8 sont peu courants et traités de manière incorrecte par certains éditeurs, de sorte qu’il n’est généralement pas utile d’en ajouter.</p> +<p>Ce paramètre n’influence <b>pas</b> l’utilisation des BOMs UTF-16 et UTF-32.</p></body></html> + + + Hide mouse cursor while typing + Cacher le curseur de la souris pendant la frappe + + + Enable smart selection changing + Activer le changement de sélection intelligent + + + Using Select Block Up / Down actions will now provide smarter selections. + L’utilisation des actions Sélectionner le bloc au-dessus / en dessous permet désormais d’effectuer des sélections plus intelligentes. + + + Pressing Alt displays context-sensitive help or type information as tooltips. + Appuyer sur Alt permet d’afficher une aide contextuelle ou l’information du type sous forme d’infobulles. + + + Tab key performs auto-indent: + La touche tabulation active l’indentation automatique : + + + Displays context-sensitive help or type information on mouseover. + Affiche l’aide contextuelle ou l’information du type lors d’un survol de souris. + + + Displays context-sensitive help or type information on Shift+Mouseover. + Affiche l’aide contextuelle ou l’information du type lors d’un survol de souris + Maj. + + + Never + Jamais + + + Always + Toujours + + + In Leading White Space + Dans des espaces en début de ligne + + + Cleanup actions which are automatically performed right before the file is saved to disk. + Actions de nettoyage qui sont effectuées automatiquement avant d’enregistrer le fichier sur le disque. + + + Cleanups Upon Saving + Nettoyage à l’enregistrement + + + Removes trailing whitespace upon saving. + Supprime les caractères d’espacement à la fin des lignes lors de l’enregistrement. + + + &Clean whitespace + &Nettoyer les espaces + + + In entire &document + Dans tout le &document + + + Clean indentation + Nettoyer l’indentation + + + &Ensure newline at end of file + &Forcer un retour de ligne à la fin du fichier + + + File Encodings + Encodages des fichiers + + + Default encoding: + Encodage par défaut : + + + Add If Encoding Is UTF-8 + Ajouter si l’encodage est UTF-8 + + + Keep If Already Present + Conserver si déjà présent + + + Always Delete + Toujours supprimer + + + UTF-8 BOM: + UTF-8 BOM : + + + Mouse and Keyboard + Souris et clavier + + + Enable &mouse navigation + Activer la navigation à la &souris + + + Enable scroll &wheel zooming + Activer le zoom via la &molette + + + Enable built-in camel case &navigation + Activer la &navigation en Camel Case intégrée + + + On Mouseover + Au passage de la souris + + + On Shift+Mouseover + Au passage de la souris + Maj + + + Show help tooltips using keyboard shortcut (Alt) + Afficher les info-bulles d’aide en utilisant les raccourcis clavier (Alt) + + + Default line endings: + Fin de ligne par défaut : + + + Show help tooltips using the mouse: + Afficher les info-bulles d’aide en utilisant la souris : + + + Current settings: + Paramètres actuels : + + + Remove + Supprimer + + + Export... + Exporter… + + + Import... + Importer… + + + Display line &numbers + Afficher les &numéros de ligne + + + Highlight current &line + Surligner la &ligne actuelle + + + Display &folding markers + Afficher les marqueurs de &pliage + + + Highlight &blocks + Surligner les &blocs + + + Mark &text changes + Marquer les modifications de &texte + + + &Visualize whitespace + &Visualiser les espaces + + + &Animate matching parentheses + &Animer les parenthèses correspondantes + + + <i>Set <a href="font zoom">font line spacing</a> to 100% to enable text wrapping option.</i> + <i>Définir l’<a href="font zoom">espacement des lignes de la police</a> à 100 % pour activer l’option de retour à la ligne du texte.</i> + + + Tint whole margin area + Teinter toute la marge + + + Use context-specific margin + Utiliser une marge spécifique au contexte + + + If available, use a different margin. For example, the ColumnLimit from the ClangFormat plugin. + Si possible, utilisez une marge différente. Par exemple, la marge ColumnLimit du greffon ClangFormat. + + + Highlight search results on the scrollbar + Surligner les résultats de recherche sur la barre de défilement + + + Animate navigation within file + Animer la navigation dans le fichier + + + Auto-fold first &comment + reformulation à l'infinitif +francis : en effet, une erreur de ma part --> validé. + Replier automatiquement le premier &commentaire + + + Center &cursor on scroll + Centrer le &curseur sur la barre de défilement + + + Shows tabs and spaces. + Affiche les tabulations et les espaces. + + + Next to editor content + À côté du contenu de l’éditeur + + + Next to right margin + À côté de la marge de droite + + + Aligned at right side + Aligné à droite + + + Between lines + Entre les lignes + + + Line annotations + Annotations de ligne + + + Margin + Marge + + + Wrapping + Découpage du texte + + + Enable text &wrapping + Activer le &retour à la ligne automatique + + + Display right &margin at column: + Afficher une &marge à la colonne : + + + Visualize indent + Visualiser l’indentation + + + Display file line ending + Afficher la fin de ligne du fichier + + + &Highlight matching parentheses + &Surligner les parenthèses correspondantes + + + Always open links in another split + Toujours ouvrir les liens dans une nouvelle vue + + + Display file encoding + Afficher l’encodage du fichier + + + Syntax Highlight Definition Files + Fichiers de définition de coloration syntaxique + + + Ignored file patterns: + Motifs de fichier ignorés : + + + Add + Ajouter + + + Revert Built-in + Rétablir l’intégration + + + Not a valid trigger. A valid trigger can only contain letters, numbers, or underscores, where the first character is limited to letter or underscore. + Il ne s’agit pas d’un déclencheur valide. Un déclencheur valide ne peut contenir que des lettres, des chiffres ou des tirets bas (_), le premier caractère étant limité à une lettre ou à un tiret bas. + + + Restore Removed Built-ins + Rétablir les intégrations distantes + + + Reset All + Tout réinitialiser + + + Tabs And Indentation + Tabulation et indentation + + + Tab policy: + Politique de tabulation : + + + Spaces Only + Espaces seulement + + + Tabs Only + Tabulation seulement + + + Mixed + Mixte + + + Ta&b size: + Taille de &tabulation : + + + &Indent size: + Taille de l’&indentation : + + + Align continuation lines: + Aligner les lignes de continuation : + + + <html><head/><body> +Influences the indentation of continuation lines. + +<ul> +<li>Not At All: Do not align at all. Lines will only be indented to the current logical indentation depth. +<pre> +(tab)int i = foo(a, b +(tab)c, d); +</pre> +</li> + +<li>With Spaces: Always use spaces for alignment, regardless of the other indentation settings. +<pre> +(tab)int i = foo(a, b +(tab) c, d); +</pre> +</li> + +<li>With Regular Indent: Use tabs and/or spaces for alignment, as configured above. +<pre> +(tab)int i = foo(a, b +(tab)(tab)(tab) c, d); +</pre> +</li> +</ul></body></html> + <html><head/><body> +Influence l’indentation des lignes de continuation. +<ul> +<li>Pas du tout : ne pas aligner. Les lignes ne seront indentées que jusqu’à la profondeur d’indentation logique. +<pre> +(tab)int i = foo(a, b +(tab)c, d); +</pre> +</li> +<li>Avec espaces : toujours utiliser des espaces pour l’alignement, sans tenir compte des autres paramètres d’indentation. +<pre> +(tab)int i = foo(a, b +(tab) c, d); +</pre> +</li> +<li>Avec indentation régulière : utiliser des tabulations et/ou des espaces pour l’alignement, en fonction de la configuration. +<pre> +(tab)int i = foo(a, b +(tab)(tab)(tab) c, d); +</pre> +</li> +</ul></body></html> + + + Not At All + Pas du tout + + + With Spaces + Avec les espaces + + + With Regular Indent + Avec l’indentation régulière + + + The text editor indentation setting is used for non-code files only. See the C++ and Qt Quick coding style settings to configure indentation for code files. + Le paramètre d’indentation de l’éditeur de texte n’est utilisé que pour les fichiers autre que de code. Voir les paramètres du style de codage C++ et Qt Quick pour configurer l’indentation pour les fichiers de code. + + + <i>Code indentation is configured in <a href="C++">C++</a> and <a href="QtQuick">Qt Quick</a> settings.</i> + <i>L’indentation du code est configurée dans les paramètres <a href="C++">C++</a> et <a href="QtQuick">Qt Quick</a>.</i> + + + Open Documents + Documents ouverts + + + Open documents: + Documents ouverts : + + + Open Documents +%1 + Documents ouverts +%1 + + + Refactoring cannot be applied. + La refactorisation ne peut être appliquée. + + + derived from QObject + group:'C++' trigger:'class' + dérivé de QObject + + + derived from QWidget + group:'C++' trigger:'class' + dérivé de QWidget + + + template + group:'C++' trigger:'class' + modèle + + + with if + group:'C++' trigger:'else' + avec « if » + + + range-based + group:'C++' trigger:'for' + basé sur la plage + + + and else + group:'C++' trigger:'if' + et « else » + + + with closing brace comment + group:'C++' trigger:'namespace' + avec le commentaire de clôture de l’accolade + + + and catch + group:'C++' trigger:'try' + et « catch » + + + namespace + group:'C++' trigger:'using' + espace de nom + + + template + group:'C++' trigger:'struct' + template + + + (type name READ name WRITE setName NOTIFY nameChanged) + group:'C++' trigger:'Q_PROPERTY' + (saisir nom READ nom WRITE setNom NOTIFY nomChanged) + + + with targets + group:'QML' trigger:'NumberAnimation' + avec les cibles + + + with target + group:'QML' trigger:'NumberAnimation' + avec la cible + + + with targets + group:'QML' trigger:'PropertyAction' + avec les cibles + + + with target + group:'QML' trigger:'PropertyAction' + avec la cible + + + example + group:'Text' trigger:'global' + exemple + + + Copy to Clipboard + Copier dans le presse-papiers + + + Copy SHA1 to Clipboard + Copier le SHA1 dans le presse-papiers + + + Show Commit %1 + Afficher le commit %1 + + + Sort Alphabetically + Trier par ordre alphabétique + + + Unix (LF) + Unix (LF) + + + Windows (CRLF) + Windows (CRLF) + + + Unused variable + Variable inutilisée + + + Cannot create temporary file "%1": %2. + Impossible de créer le fichier temporaire « %1 » : %2. + + + TextEditor + Failed to format: %1. + Éditeur de texte + + + Cannot read file "%1": %2. + Impossible de lire le fichier « %1 » : %2. + + + Cannot call %1 or some other error occurred. Timeout reached while formatting file %2. + Impossible d’appeler %1 ou une autre erreur s’est produite. Le délai d’attente a été atteint lors du formatage du fichier %2. + + + TextEditor + Error in text formatting: %1 + Éditeur de texte + + + Could not format file %1. + Impossible de mettre en forme le fichier %1. + + + File %1 was closed. + Le fichier %1 a été fermé. + + + File was modified. + Le fichier a été modifié. + + + Highlighter updates: done + Mises à jour de la coloration syntaxique : fait + + + Highlighter updates: + Mises à jour de la coloration syntaxique : + + + Highlighter updates: starting + Mises à jour de la coloration syntaxique : lancement + + + Expected delimiter after mangler ID. + Délimiteur attendu après l’identifiant du gestionnaire. + + + Expected mangler ID "l" (lowercase), "u" (uppercase), or "c" (titlecase) after colon. + Identifiant du gestionnaire attendu « l » (minuscule), « u » (majuscule), ou « c » (majuscule de titre) après deux points. + + + Missing closing variable delimiter for: + Délimiteur de variable fermant manquant pour : + + + Diff Against Current File + Diff par rapport au fichier actuel + + + Opening File + Ouverture du fichier + + + Show inline annotations for %1 + Afficher les annotations dans le texte pour %1 + + + Temporarily hide inline annotations for %1 + Masquer temporairement les annotations dans le texte pour %1 + + + Show Diagnostic Settings + Afficher les paramètres de diagnostic - QtC::QmlJS + QtC::Todo - unknown value for enum - Valeur inconnue pour l'énumération + Keywords + Mots-clés - value might be 'undefined' - La valeur peut être "indéfinie" + Add + Ajouter - enum value is not a string or number - La valeur de l'énumération n'est pas une chaîne ou un nombre + Edit + Modifier - numerical value expected - Valeur numérique attendue + Remove + Supprimer - boolean value expected - Valeur binaire attendue + Reset + Réinitialiser - string value expected - Chaîne de caractères attendue + Scan the whole active project + Scanner la totalité du projet actif - not a valid url - pas une URL valide + Scan only the currently edited document + Scanner uniquement le document en cours d’édition - file or directory does not exist - le fichier ou le répertoire n'existe pas + Scan the current subproject + Scanner le sous-projet actuel - not a valid color - Pas une couleur valide + Scanning scope + Portée de la recherche - expected anchor line - Ancre de ligne attendue + Description + Description - declarations should be at the start of a function - les déclarations devraient être au début d'une fonction + File + Fichier - already a formal parameter - déjà un paramètre formel + Line + Ligne - already declared as function - déjà déclaré comme fonction + To-Do Entries + Fonctionnalités qui recherche les entrées "TODO" dans le code, à voir comment ça s'affiche en partique dans Qt Creator. [Pierre] ça je suis partisant de laisser TODO tel quel, c'est du jargon informatique... + Entrées TODO - duplicate declaration - déclaration dupliquée + Current Document + Document actuel - variable is used before being declared - la variable est utilisée avant d'être déclarée + Scan only the currently edited document. + Scanner uniquement le document en cours d’édition. - already declared as var - déjà déclaré comme variable + Active Project + Projet actif - function is used before being declared - la fonction est utilisée avant d'être déclarée + Scan the whole active project. + Scanner la totalité du projet actif. - properties can only be assigned once - les propriétés ne peuvent être assignées qu'une seule fois + Subproject + Sous-projet - unknown type - type inconnu + Scan the current subproject. + Scanner le sous-projet actuel. - could not resolve the prototype %1 of %2 - impossible de résoudre le prototype %1 de %2 + Show "%1" entries + Afficher « %1 » entrées - could not resolve the prototype of %1 - impossible de résoudre le prototype de %1 + To-Do + Quoi que l'on pourrait laisser TODO ? [Pierre] yep, je valide TODO + TODO - prototype cycle, the last non-repeated object is %1 - cycle de prototypes, le dernier objet non répété est %1 + Keyword + Mot-clé - expected id - identifiant attendu + Icon + Icône - using string literals for ids is discouraged - utiliser une chaîne littérale pour les identifiants est découragé + Color + Couleur - ids must be lower case or start with underscore - les identifiants doivent être en minuscules ou commencer avec un underscore + errorLabel + ... bah, je ne sais pas >> vraiment à traduire ? + errorLabel - ids must be unique - les identifiants doivent être uniques + Keyword cannot be empty, contain spaces, colons, slashes or asterisks. + Le mot-clé ne peut être vide, contenir des espaces, des virgules, des barres obliques ou des étoiles. - '%1' is not a valid property type - '%1' n'est pas un type de propriété valide + There is already a keyword with this name. + Il y a déjà un mot-clé avec ce nom. - unknown identifier - identifiant inconnu + <Enter regular expression to exclude> + <Saisir l’expression rationnelle pour exclure> - could not resolve - impossible de résoudre + Regular expressions for file paths to be excluded from scanning. + Expressions régulières pour les chemins d’accès aux fichiers à exclure de l’analyse. - does not have members - n'a pas de membre + Excluded Files + Fichiers exclus + + + + QtC::Tracing + + Selection + Sélection - unknown member - membre inconnu + Start + Démarrer - == and != perform type coercion, use === or !== instead to avoid - == et != effectuent une coercition de type, utilisez === ou !== à la place + End + Fin - blocks do not introduce a new scope, avoid - les blocs n'introduisent pas de nouvelle portée, à éviter + Duration + Durée - unintentional empty block, use ({}) for empty object literal - bloc vide involontaire, utilisez ({}) pour les objets vides + Close + Fermer - use of the with statement is not recommended, use a var instead - l'utilisation de l'instruction with n'est pas recommandée, utilisez var à la place + Jump to previous event. + Sauter à l’évènement précédent. - use of void is usually confusing and not recommended - l'utilisation de void est habituellement confuse et n'est pas recommandée + Jump to next event. + Sauter à l’évènement suivant. - avoid comma expressions - évitez les expressions virgule + Show zoom slider. + Afficher le curseur de zoom. - expression statements should be assignments, calls or delete expressions only - les définitions d'expression devraient être des expression d'assignation, d'appel ou de suppression uniquement + Select range. + Sélectionner l’intervalle. - avoid assignments in conditions - éviter l'assignement dans les conditions + View event information on mouseover. + Afficher les informations sur l’évènement au passage de la souris. - case is not terminated and not empty - le cas n'est pas terminé et n'est pas vide + Collapse category + Réduire la catégorie - case does not end with return, break, continue or throw - le cas ne se termine pas par return, break, continue ou throw + Expand category + Développer la catégorie - ids must be lower case - les identifiants doivent être en minuscule + others + autres - '%1' is not a valid property name - "%1" n'est pas un nom de propriété valide + unknown + inconnu - '%1' does not have members - "%1" n'a pas de membres + No data available + Aucune donnée n’est disponible - '%1' is not a member of '%2' - "%1" n'est pas un membre de "%2" + Edit note + Modifier la note - 'int' or 'real' - 'int' ou 'real' + Collapse + Réduire - The file is not module file. - Le fichier n'est pas un fichier de module. + Expand + Développer - Unexpected element <%1> in <%2> - Élément inattendu <%1> dans <%2> + [unknown] + [inconnu] - invalid value '%1' for attribute %2 in <%3> - valeur invalide "%1" pour l'attribut %2 dans <%3> + Could not open %1 for writing. + Impossible d’ouvrir %1 en écriture. - <%1> has no valid %2 attribute - <%1> n'a pas d'attribut %2 valide + Could not open %1 for reading. + Impossible d’ouvrir %1 en lecture. - %1: %2 - %1 : %2 + Could not re-read events from temporary trace file: %1 +The trace data is lost. + Impossible de relire les évènements du fichier de trace temporaire : %1 +Les données de la trace sont perdues. + + + + QtC::UpdateInfo + + Checking for Updates + Vérification des mises à jour - could not find file or directory - impossible de trouver le fichier ou le répertoire + %1 and other updates are available. Check the <a %2>Qt blog</a> for details. + %1 et d’autres mises à jour sont disponibles. Vérifier le <a %2>blog Qt</a> pour plus de détails. - package not found - paquet non trouvé + %1 is available. Check the <a %2>Qt blog</a> for details. + %1 est disponible. Vérifier le <a %2>blog Qt</a> pour plus de détails. - Library contains C++ plugins, type dump is in progress. - La bibliothèque contient des plug-ins C++, la récupération des types est en cours. + New updates are available. Start the update? + De nouvelles mises à jour sont disponibles. Lancer la mise à jour ? - file or directory not found - Fichier ou répertoire non trouvé + Open Settings + Ouvrir les préférences - QML module not found - -Import paths: -%1 - -For qmake projects, use the QML_IMPORT_PATH variable to add import paths. -For qmlproject projects, use the importPaths property to add import paths. - Module QML non trouvé - -Chemins d'importation : -%1 - -Pour les projets qmake , utilisez la variable QML_IMPORT_PATH pour ajouter les chemins d'importations. -Pour les projets qmlproject , utilisez la propriété importPaths pour ajouter les chemins d'importations. + Start Package Manager + Lancer le gestionnaire de paquets - QML module contains C++ plugins, currently reading type information... - Le module QML contient des modules C++, lectur des informations de type en cours... + Start Update + Lancer la mise à jour + + + %1 (%2) + Package name and version + %1 (%2) + + + Available updates: + Mises à jour disponibles : + + + No updates found. + Aucune mise à jour n’a été trouvée. + + + Could not determine location of maintenance tool. Please check your installation if you did not enable this plugin manually. + Impossible de déterminer l’emplacement de l’outil de maintenance. Veuillez vérifier votre installation si vous n’avez pas activé ce greffon manuellement. + + + The maintenance tool at "%1" is not an executable. Check your installation. + L’outil de maintenance à « %1 » n’est pas un exécutable. Vérifiez votre installation. + + + Qt Maintenance Tool + Outil de maintenance Qt + + + Check for Updates + Vérifier les mises à jour + + + Start Maintenance Tool + Lancer l’outil de maintenance + + + Automatic Check for Updates + Vérification automatique des mises à jour + + + Automatically runs a scheduled check for updates on a time interval basis. The automatic check for updates will be performed at the scheduled date, or the next startup following it. + Exécute automatiquement une vérification programmée des mises à jour sur la base d’un intervalle de temps. La vérification automatique des mises à jour sera effectuée à la date programmée ou au prochain démarrage. + + + Check for new Qt versions + Vérifier les nouvelles versions de Qt + + + Check interval basis: + Vérifier tou(te)s les : + + + Next check date: + Prochaine date de vérification : + + + Check Now + Vérifier maintenant + + + Last check date: + Dernière date de vérification : + + + Not checked yet + Pas encore vérifié + + + Daily + Jours + + + Weekly + Semaines + + + Monthly + Mois + + + New updates are available. + De nouvelles mises à jour sont disponibles. + + + No new updates are available. + Aucune nouvelle mise à jour n’est disponible. + + + Checking for updates... + Vérification des mises à jour… + + + Update + Mettre à jour + + + Configure Filters + Configurer les filtres QtC::Utils - Locked - Verrouillé + Do not ask again + Ne plus poser la question + + + Show Details... + Afficher les détails… + + + Hide Details... + Cacher les détails… + + + Do not &ask again + Ne plus &redemander + + + Do not &show again + Ne plus &afficher + + + The class name must not contain namespace delimiters. + Le nom de classe ne doit pas contenir de délimiteur d’espace de nommage. + + + Please enter a class name. + Veuillez saisir un nom de classe. + + + The class name contains invalid characters. + Le nom de classe contient des caractères invalides. + + + Cannot set up communication channel: %1 + Impossible d’établir le canal de communication : %1 + + + Press <RETURN> to close this window... + Appuyez sur <ENTRÉE> pour fermer cette fenêtre… + + + Cannot create temporary file: %1 + Impossible de créer un fichier temporaire : %1 + + + Cannot write temporary file. Disk full? + Impossible d’écrire le fichier temporaire. Disque plein ? + + + Cannot create temporary directory "%1": %2 + Impossible de créer le répertoire temporaire « %1 » : %2 + + + Cannot change to working directory "%1": %2 + Impossible de passer au répertoire de travail « %1 » : %2 + + + Cannot execute "%1": %2 + Impossible d’exécuter « %1 » : %2 + + + The process "%1" could not be started: %2 + Le processus « %1 » n’a pas pu être démarré : %2 + + + Cannot start the terminal emulator "%1", change the setting in the Environment preferences. (%2) + Impossible de démarrer l’émulateur de terminal « %1 », modifiez le paramètre dans les préférences de l’environnement. (%2) + + + Cannot create socket "%1": %2 + Impossible de créer la socket « %1 » : %2 + + + Unexpected output from helper program (%1). + Sortie imprévue du logiciel externe (%1). + + + Quoting error in command. + Erreur de guillemets dans la commande. + + + Debugging complex shell commands in a terminal is currently not supported. + Le débogage de commandes shell complexes dans un terminal n’est pas pris en charge actuellement. + + + Quoting error in terminal command. + Citer l’erreur dans la commande au terminal. + + + Terminal command may not be a shell command. + La commande terminal peut ne pas être une commande shell. + + + Cannot obtain a handle to the inferior: %1 + Impossible d’obtenir le descripteur du processus : %1 + + + Cannot obtain exit status from inferior: %1 + Impossible d’obtenir la valeur de retour du processus : %1 + + + Name is empty. + Le nom de fichier est vide. + + + Name contains white space. + Le nom contient des espaces. + + + Invalid character "%1". + Caractère invalide « %1 ». + + + Invalid characters "%1". + Caractères invalides « %1 ». + + + Name matches MS Windows device (CON, AUX, PRN, NUL, COM1, COM2, ..., COM9, LPT1, LPT2, ..., LPT9) + Le nom correspond au périphérique MS Windows (CON, AUX, PRN, NUL, COM1, COM2, …, COM9, LPT1, LPT2, …, LPT9) + + + File extension %1 is required: + L’extension de fichier %1 est nécessaire : + + + File extensions %1 are required: + Les extensions de fichier %1 sont nécessaires : + + + %1: canceled. %n occurrences found in %2 files. + + %1 : annulé. %n entrée trouvée dans %2 fichiers. + %1 : annulé. %n entrées trouvées dans %2 fichiers. + + + + %1: %n occurrences found in %2 files. + + %1 : %n occurrence trouvée dans %2 fichiers. + %1 : %n occurrences trouvées dans %2 fichiers. + + + + Fi&le pattern: + Mo&tif de fichier : + + + Excl&usion pattern: + Motif d’excl&usion : + + + List of comma separated wildcard filters. Files with file name or full file path matching any filter are included. + Liste de filtres de caractères joker séparés par des virgules. Les fichiers dont le nom ou le chemin d’accès complet correspond à l’un des filtres sont inclus. + + + Choose... + Sélectionner… + + + Browse... + Parcourir… + + + Local + Local + + + Remote + Distant + + + Choose Directory + Sélectionner un répertoire + + + Choose Executable + Sélectionner l’exécutable + + + Choose File + Sélectionner un fichier + + + The path "%1" expanded to an empty string. + Le chemin « %1 » s’est développé en une chaîne vide. + + + The path "%1" does not exist. + Le chemin « %1 » n’existe pas. + + + The path "%1" is not a directory. + Le chemin « %1 » n’est pas un répertoire. + + + The path "%1" is not a file. + Le chemin « %1 » n’est pas un fichier. + + + The directory "%1" does not exist. + Le répertoire « %1 » n’existe pas. + + + The path "%1" is not an executable file. + Le chemin « %1 » n’est pas un fichier exécutable. + + + Invalid path "%1". + Chemin invalide « %1 » + + + Cannot execute "%1". + Impossible d’exécuter « %1 » + + + Full path: "%1" + Chemin complet : « %1 » + + + The path must not be empty. + Le chemin ne peut pas être vide. + + + File name: + Nom du fichier : + + + Path: + Chemin : + + + The default suffix if you do not explicitly specify a file extension is ".%1". + Le suffixe par défaut si vous n’indiquez pas explicitement une extension de fichier est « .%1 ». + + + Insert... + Insérer… + + + Delete Line + Supprimer la ligne + + + Clear + Effacer tout + + + Enter project name + Saisir le nom du projet + + + Name: + Nom : + + + Create in: + Créer dans : + + + Directory "%1" will be created. + Le répertoire « %1 » sera créé. + + + Project name is invalid. + Le nom du projet est invalide. + + + Invalid character ".". + Caractère invalide « . ». + + + Invalid character "%1" found. + Le caractère invalide « %1 » a été trouvé. + + + The project already exists. + Le projet existe déjà. + + + A file with that name already exists. + Un fichier existe déjà avec ce nom. + + + Use as default project location + Utiliser comme emplacement par défaut pour les projets + + + Introduction and Project Location + Introduction et emplacement du projet + + + Choose the Location + Sélectionner l’emplacement + + + File Changed + Fichier modifié + + + Details + Détails + + + Central Widget + Widget central Reset to Default Layout Restaurer la disposition par défaut + + Automatically Hide View Title Bars + Masquer automatiquement les barres de titre des vues + Location Emplacement @@ -20091,7932 +51050,109 @@ Pour les projets qmlproject , utilisez la propriété importPaths pour ajouter l Effacer le texte - File has been removed - Le fichier a été supprimé + The unsaved file <i>%1</i> has been changed on disk. Do you want to reload it and discard your changes? + Le fichier non enregistré <i>%1</i> a été modifié sur le disque. Voulez-vous le recharger et annuler vos modifications ? - The file %1 has been removed outside Qt Creator. Do you want to save it under a different name, or close the editor? - Le fichier %1 a été supprimé en dehors de Qt Creator. Voulez-vous l'enregistrer sous un nom différent ou fermer l'éditeur ? + The file <i>%1</i> has been changed on disk. Do you want to reload it? + Le fichier <i>%1</i> a été modifié sur le disque. Voulez-vous le recharger ? - The file %1 was removed. Do you want to save it under a different name, or close the editor? - Le fichier %1 a été supprimé. Voulez-vous l'enregistrer sous un nom différent ou fermer l'éditeur ? + The default behavior can be set in %1 > Preferences > Environment > System. + macOS + Le comportement par défaut peut être défini dans %1 > Préférences > Environnement > Système. + + + The default behavior can be set in Edit > Preferences > Environment > System. + Le comportement par défaut peut être défini dans Édition > Préférences > Environnement > Système. &Close &Fermer + + No to All && &Diff + Non à tout et &diff + + + File Has Been Removed + Le fichier a été supprimé + + + The file %1 has been removed from disk. Do you want to save it under a different name, or close the editor? + Le fichier %1 a été supprimé du disque. Voulez-vous l’enregistrer sous un autre nom ou fermer l’éditeur ? + C&lose All - F&ermer tout + Tout f&ermer Save &as... - Enregistrer &sous... + Enregistrer &sous… &Save &Enregistrer + + &Show Details + &Afficher les détails + + + Do Not Show Again + Ne plus afficher + Close - Fermer - - - Save as... - Enregistrer sous... - - - Save - Enregistrer + Fermer <table border=1 cellspacing=0 cellpadding=3><tr><th>Variable</th><th>Expands to</th></tr><tr><td>%d</td><td>directory of current file</td></tr><tr><td>%f</td><td>file name (with full path)</td></tr><tr><td>%n</td><td>file name (without path)</td></tr><tr><td>%%</td><td>%</td></tr></table> - <table border=1 cellspacing=0 cellpadding=3><tr><th>Variable</th><th>Développer en</th></tr><tr><td>%d</td><td>répertoire du fichier courant</td></tr><tr><td>%f</td><td>nom du fichier (avec le chemin complet)</td></tr><tr><td>%n</td><td>nom du fichier (sans le chemin)</td></tr><tr><td>%%</td><td>%</td></tr></table> + <table border=1 cellspacing=0 cellpadding=3><tr><th>Variable</th><th>Remplacer par</th></tr><tr><td>%d</td><td>le répertoire du fichier actuel</td></tr><tr><td>%f</td><td>le nom du fichier (avec le chemin complet)</td></tr><tr><td>%n</td><td>le nom du fichier (sans le chemin)</td></tr><tr><td>%%</td><td>%</td></tr></table> ... - ... + - - - QtC::BinEditor - Decimal unsigned value (little endian): %1 -Decimal unsigned value (big endian): %2 -Decimal signed value (little endian): %3 -Decimal signed value (big endian): %4 - endian ? -cédric : heu faut traduire little-endian et big-endian ? Perso je n'aurais pas traduit, ce sont des conventions de codage des nombres, j'ai toujours vu en anglais moi ... - Valeur décimale non signée(little-endian) : %1 -Valeur décimale non signée((big endian) : %2 -Valeur décimale signéelittle-endian) : %3 -Valeur décimale signée((big endian) : %4 + The program "%1" does not exist or is not executable. + Le programme « %1 » n’existe pas ou n’est pas exécutable. - Previous decimal unsigned value (little endian): %1 -Previous decimal unsigned value (big endian): %2 -Previous decimal signed value (little endian): %3 -Previous decimal signed value (big endian): %4 - Valeur précédente au format décimal non signé (petit-boutiste) : %1 -Valeur précédente au format décimal non signé (gros-boutiste) : %2 -Valeur précédente au format décimal signé (petit-boutiste) : %3 -Valeur précédente au format décimal signé (gros-boutiste) : %4 - - - Image Viewer - Visualisateur d'image - - - - QtC::CMakeProjectManager - - Run CMake target - Exécuter la cible CMake - - - Run CMake kit - Exécuter le kit CMake - - - (disabled) - (désactivé) - - - The executable is not built by the current build configuration - L'exécutable n'est pas compilé pour la configuration de compilation courante - - - The executable is not built by the current buildconfiguration - L'exécutable n'a pas été compilé avec la configuration actuelle - - - (disabled) - (Désactivé) - - - Desktop - CMake Default target display name - Desktop - - - Make - CMakeProjectManager::MakeStep display name. - Make - - - Make - Default display name for the cmake make step. - Make - - - Qt Creator needs a compiler set up to build. Configure a compiler in the kit options. - Qt Creator requiert un compilateur. Configurez-en un dans les options de kits. - - - Configuration is faulty. Check the Issues view for details. - La configuration est défectueuse, veuillez vérifier la vue des problèmes pour les détails. - - - Make - Display name for CMakeProjectManager::MakeStep id. - Make - - - - QtC::Core - - Command - Commande - - - Label - Libellé - - - Qt - Qt - - - Environment - Environnement - - - All Files (*) - Tous les fichiers (*) - - - Clear Menu - Effacer le menu - - - Design - Design - - - Could not open url %1. - Impossible d'ouvrir l'url %1. - - - Copy Full Path to Clipboard - Copier le chemin complet dans le presse papier - - - Remove Split - Supprimer la séparation - - - File is writable - Le fichier est inscriptible - - - - GenericSshConnection - - Could not connect to host. - Impossible de se connecter à l'hôte. - - - Error in cryptography backend: %1 - pierre: a priori pas de traduction française courante... -francis : je ne vois pas non plus. Ou un truc du genre "Arriére plan cryptographique" Mais c'est bisarre - Erreur dans le backend cryptographique : %1 - - - - QtC::Core - - Error sending input - Erreur lors de l'envoi de l'entrée - - - Error setting up SFTP subsystem - Erreur lors de la configuration du sous-systeme SFTP - - - Could not open file '%1' - Impossible d'ouvrir le fichier "%1" - - - Could not uplodad file '%1' - Impossible d'envoyer le fichier "%1" - - - Could not copy remote file '%1' to local file '%2' - Impossible de copier le fichier distant "%1" dans le fichier local "%2" - - - Could not create remote directory - Impossible de créer le répertoire distant - - - Could not remove remote directory - Impossible de supprimer le répertoire distant - - - Could not get remote directory contents - Impossible de récupérer le contenu du répertoire distant - - - Could not remove remote file - Impossible de supprimer le fichier distant - - - Could not change remote working directory - Impossible de changer le répertoire de travail distant - - - - SshKeyGenerator - - Error creating temporary files. - Erreur lors de la création des fichiers temporaires. - - - Error generating keys: %1 - Erreur lors de la génération des clés : %1 - - - Error reading temporary files. - Erreur lors de la lecture des fichiers temporaires. - - - Error generating key: %1 - Erreur lors de la génération de la clé : %1 - - - Password for Private Key - Mot de passe pour la clé privée - - - It is recommended that you secure your private key -with a password, which you can enter below. - Il est recommandé que vous sécurisiez votre clé privée -avec un mot de passe, que vous pouvez renseigner ci-dessus. - - - Encrypt Key File - Chiffrer le fichier clé - - - Do Not Encrypt Key File - Ne pas chiffrer le fichier clé - - - Encrypt key file - Chiffrer le fichier clé - - - Do not encrypt key file - Ne pas chiffrer le fichier clé - - - - QtC::CodePaster - - Code Pasting - Collage de code - - - Cannot open %1: %2 - Imposible d'ouvrir %1 : %2 - - - %1 does not appear to be a paster file. - %1 ne semble pas être un fichier copiable. - - - Error in %1 at %2: %3 - Erreur dans %1 à la ligne %2 : %3 - - - Please configure a path. - Veuillez configurer un chemin. - - - Unable to open a file for writing in %1: %2 - Impossible d'ouvrir un fichier en écriture dans %1 : %2 - - - Pasted: %1 - Copié : %1 - - - Fileshare - Fileshare - - - <Comment> - <Commentaire> - - - Paste - Coller - - - %1 - Configuration Error - %1 - Erreur de configuration - - - Settings... - Paramètres... - - - - QtC::CppEditor - - Rewrite Using %1 - Réécrire en utilisant %1 - - - Swap Operands - Échanger les opérandes - - - Rewrite Condition Using || - Réécrire la condition en utilisant || - - - Split Declaration - Fractionner la déclaration - - - Add Curly Braces - Ajouter des accolades - - - Move Declaration out of Condition - Déplacer la déclaration en dehors de la condition - - - Split if Statement - aaaaaaaah ! Je n'avais pas tilté. - Fractionner la condition if - - - Enclose in %1(...) (Qt %2) - Encapsuler dans %1(...) (Qt %2) - - - Enclose in %1(...) - Encapsuler dans %1(...) - - - Convert to String Literal - Convertir en une chaîne littérale - - - Convert to Character Literal and Enclose in QLatin1Char(...) - Convertir en une chaîne littérale et l'insère dans QLatin1Char(...) - - - Convert to Character Literal - Convertir en un caractère littéral - - - Add #include %1 - Ajouter #include %1 - - - Switch with Previous Parameter - Interchanger avec le paramètre précédent - - - Switch with Next Parameter - Interchanger avec le paramètre suivant - - - Enclose in QLatin1Char(...) - Encapsuler dans QLatin1Char(...) - - - Enclose in QLatin1String(...) - Encapsuler dans QLatin1String(...) - - - Mark as Translatable - Marquer comme traduisible - - - Convert to Objective-C String Literal - Convertir en une chaîne littérale Objective-C - - - Convert to Hexadecimal - Convertir en hexadécimal - - - Convert to Octal - Convertir en octal - - - Convert to Decimal - Convertir en décimal - - - Add Local Declaration - Ajouter la déclaration locale - - - Convert to Camel Case - Convertir en Camel Case - - - Reformat to "%1" - Reformater en "%1" - - - Reformat Pointers or References - Reformater les pointeurs ou références - - - Complete Switch Statement - Terminer l'instruction switch - - - Extract Constant as Function Parameter - Extraire la constante comme paramètre de fonction - - - Assign to Local Variable - Affecter à la variable locale - - - Optimize for-Loop - Optimiser la boucle for - - - #include Header File - #include fichier d'en-tête - - - Add local Declaration - Ajouter une déclaration locale - - - Convert to Camel Case ... - Convertir en Camel Case... - - - Use Fast String Concatenation with % - Utiliser la concaténation rapide des chaînes avec % - - - - QtC::VcsBase - - CVS Commit Editor - Éditeur de commit pour CVS - - - CVS Command Log Editor - Éditeur de log de commande pour CVS - - - CVS File Log Editor - Éditeur de log de fichier pour CVS - - - CVS Annotation Editor - Éditeur d'annotation pour CVS - - - CVS Diff Editor - Éditeur de diff pour CVS - - - Git Command Log Editor - Éditeur de log de commande pour Git - - - Git File Log Editor - Éditeur de log de fichier pour Git - - - Git Annotation Editor - Éditeur d'annotation pour Git - - - Git Diff Editor - Éditeur de diff pour Git - - - Git Commit Editor - Éditeur de commit Git - - - Git Rebase Editor - Éditeur de rebasement Git - - - Git Submit Editor - Éditeur de soumission pour Git - - - Mercurial Command Log Editor - Éditeur de log de commande pour Mercurial - - - Mercurial File Log Editor - Éditeur de log de fichier pour Mercurial - - - Mercurial Annotation Editor - Éditeur d'annotation pour Mercurial - - - Mercurial Diff Editor - Éditeur de diff pour Mercurial - - - Mercurial Commit Log Editor - Éditeur de log de commi pour Mercurial - - - Perforce.SubmitEditor - Éditeur de soumission pour Perforce - - - Perforce CommandLog Editor - Éditeur de log de commande pour Perforce - - - Perforce Log Editor - Éditeur de log pour Perforce - - - Perforce Diff Editor - Éditeur de diff pour Perforce - - - Perforce Annotation Editor - Éditeur d'annotation pour Perforce - - - Subversion Editor - Éditeur pour Subversion - - - Subversion Commit Editor - Éditeur de commit pour Subversion - - - Subversion Command Log Editor - Éditeur de log de commande pour Subversion - - - Subversion File Log Editor - Éditeur de log de fichier pour Subversion - - - Subversion Annotation Editor - Éditeur d'annotation pour Subversion - - - Subversion Diff Editor - Éditeur de diff pour Subversion - - - Bazaar Command Log Editor - Éditeur de log de commande pour Bazaar - - - Bazaar File Log Editor - Éditeur de log de fichier pour Bazaar - - - Bazaar Annotation Editor - Éditeur d'annotation pour Bazaar - - - Bazaar Diff Editor - Éditeur de diff pour Bazaar - - - Bazaar Commit Log Editor - Éditeur de log de commit pour Bazaar - - - ClearCase Check In Editor - Éditeur de vérification pour ClearCase - - - ClearCase Command Log Editor - Éditeur de journal de commandes pour ClearCase - - - ClearCase File Log Editor - Éditeur de journal de fichiers pour ClearCase - - - ClearCase Annotation Editor - Éditeur d'annotations pour ClearCase - - - ClearCase Diff Editor - Éditeur de diff pour ClearCase - - - - QtC::CVS - - Annotate revision "%1" - Révision annotée "%1" - - - - QtC::Debugger - - CDB - CDB - - - Select Local Cache Folder - Sélectionner un dossier de cache local - - - Already Exists - Existe déjà - - - A file named '%1' already exists. - Un fichier nommé "%1" existe déjà. - - - Cannot Create - Impossible de créer - - - The folder '%1' could not be created. - Le dossier "%1' n"a pas pu être créé. - - - Running requested... - Exécution demandée… - - - Unable to start pdb '%1': %2 - Impossible de démarrer pdb "%1" : %2 - - - Python Error - Erreur Python - - - '%1' contains no identifier - "%1" ne contient pas d'identifiant - - - Pdb I/O Error - Erreur d'E/S Pdb - - - The Pdb process failed to start. Either the invoked program '%1' is missing, or you may have insufficient permissions to invoke the program. - Échec du démarrage du processus Pdb. Soit le programme "%1" est manquant, soit les droits sont insuffisants pour exécuter le programme. - - - The Pdb process crashed some time after starting successfully. - Le processus Pdb a crashé après avoir démarré correctement. - - - The last waitFor...() function timed out. The state of QProcess is unchanged, and you can try calling waitFor...() again. - La dernière fonction waitFor...() est arrivée à échéance. Le statut de QProcess est inchangé, vous pouvez essayer d'appeler waitFor...() à nouveau. - - - An error occurred when attempting to write to the Pdb process. For example, the process may not be running, or it may have closed its input channel. - Une erreur s'est produite lors d'une tentative d'écriture sur le processus Pdb. Le processus peut ne pas être démarré ou il peut avoir fermé son entrée standard. - - - An error occurred when attempting to read from the Pdb process. For example, the process may not be running. - Une erreur s'est produite lors d'une tentative de lecture depuis le processus Pdb. Le processus peut ne pas être en cours d'exécution. - - - An unknown error in the Pdb process occurred. - Une erreur inconnue est survenue dans le processus Pdb. - - - An unknown error in the Pdb process occurred. - Une erreur inconnue est survenue dans le processus Pdb. - - - %1. - %1. - - - - QtC::Designer - - This file can only be edited in <b>Design</b> mode. - Ce fichier ne peut être édité qu'en mode <b>Design</b>. - - - Switch mode - Changer de mode - - - Location - Emplacement - - - - QtC::FakeVim - - Recursive mapping - Construction de correspondance récursif - - - Type Alt-V, Alt-V to quit FakeVim mode. - Taper Alt-V, Alt-V pour quitter le mode FakeVim. - - - [New] - [Nouveau] - - - Not an editor command: %1 - Pas une commande de l'éditeur : %1 - - - Ex Command Mapping - Mappage des commandes Ex - - - Ex Trigger Expression - Expression d'activation Ex - - - Regular expression: - Expression régulière : - - - Ex Command - Commande Ex - - - - QtC::Core - - &Find/Replace - &Rechercher/Remplacer - - - Advanced Find - Recherche avancée - - - Open Advanced Find... - Ouvrir la recherche avancée... - - - Ctrl+Shift+F - Ctrl+Shift+F - - - - QtC::GenericProjectManager - - Make - Make - - - Qt Creator needs a compiler set up to build. Configure a compiler in the kit options. - Qt Creator requiert un compilateur. Configurez-en un dans les options du kit. - - - Configuration is faulty. Check the Issues view for details. - La configuration est défectueuse, veuillez vérifier la vue des problèmes pour les détails. - - - Make arguments: - Arguments de Make : - - - Targets: - Cibles : - - - Failed opening project '%1': Project already open - Échec de l'ouverture du projet "%1" : projet déjà ouvert - - - Failed opening project '%1': Project is not a file - Échec de l'ouverture du projet "%1" : le projet n'est pas un fichier - - - - QtC::Git - - (no branch) - (aucune banche) - - - Error: Git timed out after %1s. - Erreur :Git est arrivé à échéance après %1s. - - - Blame %1 - Blame %1 - - - Blame Parent Revision %1 - Blame la révision parente %1 - - - Chunk successfully staged - Le chunk a été ajouté avec succès - - - Stage Chunk... - Ajout du chunk... - - - Unstage Chunk... - Suppression du chunk... - - - Cherry-Pick Change %1 - Changement d'importation sélective %1 - - - Revert Change %1 - Changement de revert %1 - - - Blame parent revision %1 - Blame la révision parente %1 - - - - QtC::Help - - <title>about:blank</title> - <title>À propos : vide</title> - - - <html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Error 404...</title></head><body><div align="center"><br/><br/><h1>The page could not be found</h1><br/><h3>'%1'</h3></div></body></html> - <html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Erreur 404...</title></head><body><div align="center"><br/><br/><h1>La page n'a pas pu être trouvée</h1><br/><h3>'%1'</h3></div></body></html> - - - Error loading: %1 - Erreur lors du chargement : %1 - - - Unknown or unsupported Content! - Contenu inconnu ou non supporté ! - - - (Untitled) - (Sans titre) - - - Close %1 - Fermer %1 - - - Close All Except %1 - Fermer tout sauf %1 - - - - QtC::Mercurial - - Cloning - Cloner - - - Cloning started... - Début du clonage... - - - Clones a Mercurial repository and tries to load the contained project. - Clone un dépôt Mercurial et essaie de charger le projet contenu. - - - Mercurial Clone - Clone de Mercurial - - - Location - Emplacement - - - Specify repository URL, checkout directory and path. - Spécifie l'URL du dépôt, le répertoire et le chemin d'import. - - - Clone URL: - URL de clone : - - - Commit Editor - Faire un commit de l'éditeur - - - Unable to find parent revisions of %1 in %2: %3 - Impossible de trouver la révision parente de %1 dans %2 : %3 - - - Cannot parse output: %1 - Impossible d'analyser la sortie : %1 - - - Hg Annotate %1 - Hg Annotate %1 - - - Hg diff %1 - Hg diff %1 - - - Hg log %1 - Hg log %1 - - - Hg incoming %1 - Hg incoming %1 - - - Hg outgoing %1 - Hg outgoing %1 - - - Working... - Travail en cours... - - - Annotate %1 - Annoter %1 - - - Annotate parent revision %1 - Annoter la révision parente %1 - - - Executing: %1 %2 - - Exécution de : %1 %2 - - - - Unable to start mercurial process '%1': %2 - Impossible de démarrer le processus mercurial "%1" : %2 - - - Timed out after %1s waiting for mercurial process to finish. - Interruption après %1s d'attente que le processus mercurial se termine. - - - Mercurial - Mercurial - - - Me&rcurial - Me&rcurial - - - Annotate Current File - Annoter le fichier courant - - - Annotate "%1" - Annoter "%1" - - - Diff Current File - Réaliser un diff du fichier courant - - - Diff "%1" - Réaliser un diff de "%1" - - - Alt+H,Alt+D - Alt+H,Alt+D - - - Meta+H,Meta+D - Meta+H, Meta+D - - - Log Current File - Réaliser un log du fichier courant - - - Log "%1" - Réaliser un log de "%1" - - - Alt+H,Alt+L - Alt+H,Alt+L - - - Meta+H,Meta+L - Meta+H, Meta+L - - - Status Current File - Statut du fichier courant - - - Status "%1" - Statut "%1" - - - Alt+H,Alt+S - Alt+H,Alt+S - - - Meta+H,Meta+S - Meta+H, Meta+S - - - Add - Ajouter - - - Add "%1" - Ajouter "%1" - - - Delete... - Supprimer… - - - Delete "%1"... - Supprimer "%1"… - - - Revert Current File... - Rétablir le fichier courant... - - - Revert "%1"... - Rétablir "%1"... - - - Diff - Diff - - - Log - Log - - - Revert... - Rétablir... - - - Status - Statut - - - Pull... - Pull... - - - Push... - Push... - - - Update... - Mise à jour... - - - Import... - Importation... - - - Incoming... - Entrant... - - - Outgoing... - Sortant... - - - Commit... - Commit... - - - Alt+H,Alt+C - Alt+H,Alt+C - - - Meta+H,Meta+C - Meta+H, Meta+C - - - Create Repository... - Créer un dépôt... - - - Pull Source - Rappatrier la source - - - Push Destination - Envoyer la destination - - - Update - Mettre à jour - - - Incoming Source - Source entrante - - - Commit - Faire un commit - - - Diff &Selected Files - Faire un diff sur tous les fichiers &sélectionnés - - - Diff Selected Files - Faire un diff sur tous les fichiers sélectionnés - - - &Undo - Annu&ler - - - &Redo - &Rétablir - - - There are no changes to commit. - Il n'y a aucun changement à envoyer. - - - Unable to generate a temporary file for the commit editor. - Impossible de générer un fichier temporaire pour l'éditeur de commit. - - - Unable to create an editor for the commit. - Impossible d'ouvrir un éditeur pour le commit. - - - Unable to create a commit editor. - Impossible d'ouvrir un éditeur de commit. - - - Commit changes for "%1". - Soumettre les changements pour "%1". - - - Close commit editor - Fermer l'éditeur de commit - - - Do you want to commit the changes? - Voulez vous envoyer les changements ? - - - Close Commit Editor - Fermer l'éditeur de commit - - - Message check failed. Do you want to proceed? - Vérification du message échouée. Voulez-vous continuer ? - - - Mercurial Command - Commande Mercurial - - - - QtC::Perforce - - No executable specified - Aucun exécutable spécifié - - - "%1" timed out after %2ms. - "%1" arrivé à échéance après %2ms. - - - Unable to launch "%1": %2 - Impossible de lancer "%1" : %2 - - - "%1" crashed. - "%1" a crashé. - - - "%1" terminated with exit code %2: %3 - "%1" terminé avec le code %2 : %3 - - - The client does not seem to contain any mapped files. - Le client ne semble contenir aucun fichier correspondant. - - - Unable to determine the client root. - Unable to determine root of the p4 client installation - Impossible de déterminer la racine du client. - - - The repository "%1" does not exist. - Le dépôt "%1" n'existe pas. - - - Annotate change list "%1" - Annoter la liste des changements "%1" - - - - QtC::ProjectExplorer - - Location - Emplacement - - - untitled - File path suggestion for a new project. If you choose to translate it, make sure it is a valid path name without blanks and using only ascii chars. - sans_titre - - - Clean - Display name of the clean build step list. Used as part of the labels in the project window. - Nettoyer - - - Clear system environment - Nettoyer l'environnement système - - - Build Environment - Environnement de compilation - - - - BuildSettingsPanelFactory - - Build Settings - Paramètres de compilation - - - - BuildSettingsPanel - - Build Settings - Paramètres de compilation - - - - QtC::ProjectExplorer - - Details - Default short title for custom wizard page to be shown in the progress pane of the wizard. - Détails - - - Creates a C++ plugin that makes it possible to offer extensions that can be loaded dynamically into applications using the QDeclarativeEngine class. - Crée un plug-in C++ qui rend possible d'offrir des extensions qui peuvent être chargées dynamiquement dans des applications utilisant la classe QDeclarativeEngine. - - - Custom QML Extension Plugin - Plug-in d'extension QML personnalisé - - - QML Extension Plugin - Plug-in d'extension QML - - - Custom QML Extension Plugin Parameters - Paramètres du plug-in d'extension QML personnalisé - - - Object Class-name: - Nom de la classe d'objet : - - - URI: - URI : - - - The project name and the object class-name cannot be the same. - Le nom du projet et le nom de la classe d'objet ne peuvent pas être identiques. - - - Creates a custom Qt Creator plugin. - Crée un plug-in personnalisé pour Qt Creator. - - - Qt Creator plugin - Plug-in Qt Creator - - - Creates a plain C project using QMake, not using the Qt library. - Créer un projet C utilisant QMake mais pas la bibliothèque Qt. - - - Plain C Project - Projet C - - - Creates a plain C++ project using QMake, not using the Qt library. - Créer un projet C++ utilisant QMake mais pas la bibliothèque Qt. - - - Creates a plain C project using qmake, not using the Qt library. - Créer un projet C utilisant qmake mais pas la bibliothèque Qt. - - - Non-Qt Project - Projet non Qt - - - Creates a C++ plugin to load extensions dynamically into applications using the QQmlEngine class. Requires Qt 5.0 or newer. - Crée un plugin C++ pour charger des extensions dynamiquement dans une application en utilisant la classe QQmlEngine. Qt 5.0 ou plus récent est requis. - - - Creates a plain C project using CMake, not using the Qt library. - Créer un projet C utilisant CMake mais pas la bibliothèque Qt. - - - Plain C Project (CMake Build) - Projet C (compilation avec CMake) - - - Creates a plain C project using qbs. - Créer un projet C complet utilisant qbs. - - - Plain C Project (Qbs Build) - Projet C complet (compilation avec Qbs) - - - Creates a plain (non-Qt) C++ project using qbs. - Créer une projet C++ (non Qt) utilisant qbs. - - - Plain C++ Project (Qbs Build) - Projet C++ complet (compilation avec Qbs) - - - Creates a plain C++ project using qmake, not using the Qt library. - Créer un projet C++ utilisant qmake mais pas la bibliothèque Qt. - - - Plain C++ Project - Projet C++ - - - Creates a plain C++ project using CMake, not using the Qt library. - Créer un projet C++ utilisant CMake mais pas la bibliothèque Qt. - - - Plain C++ Project (CMake Build) - Projet C++ (compilation avec CMake) - - - Libraries - Bibliothèques - - - Qt Creator Plugin - Extension Qt Creator - - - Creates an application descriptor file. - Créer un fichier de description pour une application. - - - Application descriptor - Description pour une application - - - BlackBerry - BlackBerry - - - Creates a Cascades application for BlackBerry 10. - Créer une application Cascades pour BlackBerry 10. - - - BlackBerry Cascades Application - Application BlackBerry Cascades - - - Creates a Qt Gui application for BlackBerry. - Qt Gui, c'est pas le module (au lieu d'un mot à traduire) ? - Créer une application graphique avec Qt Gui pour BlackBerry. - - - BlackBerry Qt Gui Application - Cf. supra. - Application Qt Gui pour BlackBerry - - - Creates an Qt5 application descriptor file. - Créer un fichier de description pour une application Qt 5. - - - Qt5 Application descriptor - Description pour une application Qt 5 - - - Creates an experimental Qt 5 GUI application for BlackBerry 10. You need to provide your own build of Qt 5 for BlackBerry 10 since Qt 5 is not provided in the current BlackBerry 10 NDK and is not included in DevAlpha devices. - Créer une application Qt 5 GUI expérimentale pour BlackBerry 10. Vous devez fournir votre propre version de Qt 5 pour BlackBerry 10 car Qt 5 n'est pas disponible pour l'actuel NDK BlackBerry 10 et n'est pas inclut dans les périphériques DevAlpha. - - - BlackBerry Qt 5 GUI Application - Application Qt 5 GUI BlackBerry - - - Creates a qmake-based test project for which a code snippet can be entered. - Crée un projet test basé sur qmake dans lequel un morceau de code peut être inséré. - - - Code Snippet - Morceau de code - - - Other Projects - Autres projets - - - Snippet Parameters - Paramètres des snippets - - - Code: - Code : - - - Type: - Type : - - - Console application - Application console - - - Application bundle (Mac) - Application bundle (Mac) - - - Headless (QtCore) - Sans interface (Qt Core) - - - Gui application (QtCore, QtGui, QtWidgets) - Application Gui (Qt Core, Qt Gui, Qt Widgets) - - - Creates a C++ plugin to load extensions dynamically into applications using the QDeclarativeEngine class. Requires Qt 4.7.0 or newer. - Crée un plugin C++ pour charger des extensions dynamiquement dans une application en utilisant la classe QDeclarativeEngine. Qt 4.7.0 ou plus récent est requis. - - - Custom QML Extension Plugin Parameters - Paramètres du plugin d'extension QML personnalisé - - - Object class-name: - Nom de classe de l'objet : - - - Creates a C++ plugin to load extensions dynamically into applications using the QQmlEngine class.&lt;br&gt;&lt;br&gt;Requires &lt;b&gt;Qt 5.0&lt;/b&gt; or newer. - Créer un plug-in C++ pour charger des extensions dynamiquement dans les applications à l'aide de la classe QQmlEngine.&lt;br&gt;&lt;br&gt;Nécessite &lt;b&gt;Qt 5.0&lt;/b&gt; ou plus récent. - - - Creates an experimental Qt5 Gui application for BlackBerry 10. You need an own Qt5 build for BlackBerry 10 since Qt5 is not provided in the current BlackBerry 10 NDK and is not included in DevAlpha devices. - Cf. supra. - Crée une application Qt 5 Gui expérimentale pour BlackBerry 10. Vous avez besoin d'une version de Qt 5 compilée spécifiquement pour BlackBerry 10, puisque que Qt 5 n'est pas prévu dans le BlackBerry 10 NDK actuel et n'est pas inclus dans les appareils en DevAlpha. - - - BlackBerry Qt5 Gui Application - Cf. supra. - Application Qt 5 Gui pour BlackBerry - - - Creates an experimental Qt Quick 2 application for BlackBerry 10. You need an own Qt5 build for BlackBerry 10 since Qt5 is not provided in the current BlackBerry 10 NDK and is not included in DevAlpha devices. - Crée une application Qt Quick 2 expérimentale pour BlackBerry 10. Vous avez besoin d'une version de Qt 5 compilée spécifiquement pour BlackBerry 10, puisque que Qt 5 n'est pas prévu dans le BlackBerry 10 NDK actuel et n'est pas inclus dans les appareils en DevAlpha. - - - BlackBerry Qt Quick 2 Application - - Application Qt Quick 2 pour BlackBerry - - - Creates a Qt Quick application for BlackBerry. - Créer une application Qt Quick pour BlackBerry. - - - BlackBerry Qt Quick Application - Application Qt Quick pour BlackBerry - - - Plugin Information - Information sur le plug-in - - - Plugin name: - Nom du plug-in : - - - Vendor name: - Nom du vendeur : - - - Copyright: - Copyright : - - - License: - Licence : - - - Description: - Description : - - - URL: - URL : - - - Creates a C++ plugin to load extensions dynamically into applications using the QDeclarativeEngine class.&lt;br&gt;&lt;br&gt;Requires &lt;b&gt;Qt 4.7.0&lt;/b&gt; or newer. - Créer un plug-in C++ pour charger des extensions dynamiquement dans les applications à l'aide de la classe QDeclarativeEngine.&lt;br&gt;&lt;br&gt;Nécessite &lt;b&gt;Qt 4.7.0&lt;/b&gt; ou plus récent. - - - Qt Quick 1 Extension Plugin - Plug-in d'extension Qt Quick 1 - - - Creates a C++ plugin that makes it possible to offer extensions that can be loaded dynamically into applications using the QQmlEngine class. - Crée un plug-in C++ d'extension chargable dynamiquement dans des applications utilisant la classe QQmlEngine. - - - Qt Quick 2 Extension Plugin - Plug-in d'extension Qt Quick 2 - - - Url: - Url : - - - Qt Creator sources: - Sources de Qt Creator : - - - Qt Creator build: - Compilation de Qt Creator : - - - Deploy into: - Déploiement sur : - - - Qt Creator build - Compilation de Qt Creator - - - Local user settings - Paramètres utilisateurs locaux - - - Creates a C++ plugin to extend the funtionality of the QML runtime. - Crée un plug-in C++ pour étendre les fonctionnalités du runtime QML. - - - QML Runtime Plug-in - Plug-in runtime QML - - - QML Runtime Plug-in Parameters - Paramètres du plug-in runtime QML - - - Example Object Class-name: - Nom de classe de l'objet exemple : - - - The project %1 could not be opened. - Le projet %1 ne peut pas être ouvert. - - - Path: - Chemin : - - - <No other projects in this session> - <Pas d'autres projets dans cette session> - - - - DependenciesPanel - - Dependencies - Dépendances - - - - QtC::ProjectExplorer - - Dependencies - Dépendances - - - Editor - Éditeur - - - - EditorSettingsPanel - - Editor Settings - Paramètres de l'éditeur - - - Editor - Éditeur - - - - QtC::Core - - Open parent folder - Ouvrir le dossier parent - - - Open "%1" - Ouvrir "%1" - - - Open with - Ouvrir avec - - - Choose folder... - Choisir le répertoire... - - - Choose folder - Choisir le répertoire - - - Show in Explorer... - Afficher dans l'explorateur de fichier... - - - Show in Finder... - Afficher dans Finder... - - - Show containing folder... - Afficher le dossier parent... - - - Open Command Prompt here... - Ouvre une invite de commande ici... - - - Open Terminal here... - Ouvre un terminal ici... - - - Show Hidden Files - Afficher les fichiers cachés - - - Synchronize with Editor - Synchroniser avec l'éditeur - - - Open Parent Folder - Ouvrir le dossier parent - - - Choose Folder... - Choisir le dossier... - - - Choose Folder - Choisir le dossier - - - Find in this directory... - Chercher dans ce dossier... - - - - QtC::ProjectExplorer - - Select active build configuration - Sélectionner la configuration de compilation active - - - Select active run configuration - Sélectionner la configuration d'exécution active - - - Build: - Compilation : - - - Run: - Exécution : - - - Project - Projet - - - Target - Cible - - - Build - Compiler - - - Kit - Kit - - - Unconfigured - Non configuré - - - <b>Project:</b> %1 - <b>Projet :</b> %1 - - - <b>Path:</b> %1 - <b>Chemin :</b> %1 - - - <b>Kit:</b> %1 - <b>Kit :</b> %1 - - - Kit: <b>%1</b><br/> - Kit : <b>%1</b><br/> - - - <b>Target:</b> %1 - <b>Cible :</b> %1 - - - <b>Build:</b> %1 - <b>Compilation :</b> %1 - - - <b>Deploy:</b> %1 - <b>Déploiement :</b> %1 - - - <b>Run:</b> %1 - <b>Exécution :</b> %1 - - - <html><nobr>%1</html> - <html><nobr>%1</html> - - - Project: <b>%1</b><br/> - Projet : <b>%1</b><br/> - - - Target: <b>%1</b><br/> - Cible : <b>%1</b><br/> - - - Build: <b>%1</b><br/> - Compilation : <b>%1</b><br/> - - - Deploy: <b>%1</b><br/> - Déploiement : <b>%1</b><br/> - - - Run: <b>%1</b><br/> - Exécution : <b>%1</b><br/> - - - <style type=text/css>a:link {color: rgb(128, 128, 255, 240);}</style>The project <b>%1</b> is not yet configured<br/><br/>You can configure it in the <a href="projectmode">Projects mode</a><br/> - <style type=text/css>a:link {color: rgb(128, 128, 255, 240);}</style>Le projet <b>%1</b> n'est pas encore configuré<br/><br/>Vous pouvez le configurer dans le <a href="projectmode">mode Projets</a><br/> - - - Select active project - Sélectionner le projet actif - - - <html><nobr><b>Project:</b> %1<br/>%2%3<b>Run:</b> %4%5</html> - <html><nobr><b>Projet :</b> %1<br/>%2%3<b>Exécution :</b> %4%5</html> - - - <b>Target:</b> %1<br/> - <b>Cible :</b> %1<br/> - - - <b>Build:</b> %2<br/> - <b>Compilation :</b> %2<br/> - - - <br/>%1 - <br/>%1 - - - Clone of %1 - Clone de %1 - - - Build & Run - Compiler & Exécuter - - - Other Project - Autre projet - - - Applications - Applications - - - Import Project - Importer un projet - - - Qt Application - Application Qt - - - Targets - Cibles - - - Enter the name of the session: - Entrez le nom de la session : - - - Switch to - Basculer vers - - - No target defined. - Aucune cible définie. - - - Cancel Build && Remove Target - Annuler la compilation && supprimer la cible - - - No kit defined in this project. - Aucun kit n'est défini dans ce projet. - - - Incompatible Kit - Kit incompatible - - - Kit %1 is incompatible with kit %2. - Le kit %1 est incompatible avec le kit %2. - - - Build configurations: - - Configurations de compilation : - - - Deploy configurations: - - Configurations de déploiement : - - - Run configurations - Configurations d'exécution - - - Build configurations: - Configurations de compilation : - - - Deploy configurations: - Configurations de déploiement : - - - Run configurations - Configurations d'exécution - - - Partially Incompatible Kit - Kit partiellement incompatible - - - Some configurations could not be copied. - Certaines configurations n'ont pas pu être copiées. - - - Cancel Build && Remove Kit - Annuler la compilation et supprimer le kit - - - Remove Kit %1? - Supprimer le kit %1 ? - - - The kit <b>%1</b> is currently being built. - Le kit <b>%1</b> est actuellement en cours de compilation. - - - Do you want to cancel the build process and remove the kit anyway? - Voulez-vous annuler le processus de compilation et retirer le kit ? - - - Change Kit - Changer de kit - - - Copy to Kit - Copier vers le kit - - - Remove Kit - Retirer le kit - - - Do you want to cancel the build process and remove the Kit anyway? - Voulez-vous annuler le processus de compilation et supprimer le kit ? - - - Do you really want to remove the -"%1" kit? - Voulez-vous vraiment supprimer le kit "%1" ? - - - Remove Target %1? - Supprimer la cible %1 ? - - - The target <b>%1</b> is currently being built. - La cible <b>%1</b> est actuellement en cours de compilation. - - - Do you want to cancel the build process and remove the Target anyway? - Voulez-vous annuler le processus de compilation et supprimer la cible ? - - - Qt Creator - Qt Creator - - - - QtC::GenericProjectManager - - Desktop - Generic desktop target display name - Desktop - - - - QtC::QmakeProjectManager - - Desktop - Qt4 Desktop target display name - Bureau - - - Symbian Emulator - Qt4 Symbian Emulator target display name - Émulateur Symbian - - - Symbian Device - Qt4 Symbian Device target display name - Périphérique Symbian - - - Maemo Emulator - Qt4 Maemo Emulator target display name - Émulateur Maemo - - - Maemo Device - Qt4 Maemo Device target display name - Périphérique Maemo - - - Maemo - Qt4 Maemo target display name - Maemo - - - <b>Device:</b> Not connected - <b>Périphérique :</b>Non connecté - - - <b>Device:</b> %1 - <b>Périphérique :</b> %1 - - - <b>Device:</b> %1, %2 - <b>Périphérique :</b> %1, %2 - - - - QtC::QmlProjectManager - - QML Viewer - QML Viewer target display name - Visualisateur QML - - - - QmlDesigner::FormEditorWidget - - Snap to guides (E) - Aligner sur les guides (E) - - - Show bounding rectangles (A) - Montrer les rectangles englobants (A) - - - Show bounding rectangles and stripes for empty items (Press Key A) - Afficher les boîtes englobantes et des rayures pour les éléments vides (Appuyer touche A) - - - Only select items with content (S) - Sélectionner uniquement les éléments avec du contenu (S) - - - width - largeur - - - height - hauteur - - - Reset view (R) - Réinitialiser la vue (R) - - - No snapping (T). - Aucun alignement (T). - - - Snap to parent or sibling items and generate anchors (W). - Aligner sur le parent ou sur les éléments frères et générer les ancres (W). - - - Snap to parent or sibling items but do not generate anchors (E). - Aligner sur le parent ou sur les éléments frères mais ne pas générer d'ancres (E). - - - Show bounding rectangles and stripes for empty items (A). - Afficher les boîtes englobantes et des lignes d'ancrage pour les éléments vides (A). - - - Only select items with content (S). - Sélectionner uniquement les éléments avec du contenu (S). - - - Width - Largeur - - - Height - Hauteur - - - Reset view (R). - Réinitialiser la vue (R). - - - - QmlDesigner::ComponentView - - whole document - document entier - - - - QmlDesigner::DesignDocumentController - - -New Form- - -Nouveau formulaire- - - - Cannot save to file "%1": permission denied. - Impossible d'enregistrer le fichier "%1" : permission refusée. - - - Parent folder "%1" for file "%2" does not exist. - Le répertoire parent "%1" pour le fichier "%2" n'existe pas. - - - Error - Erreur - - - Cannot write file: "%1". - Impossible d'enregistrer le fichier : "%1". - - - - QmlDesigner::XUIFileDialog - - Open file - Ouvrir le fichier - - - Save file - Enregistrer le fichier - - - Open File - Ouvrir le fichier - - - Save File - Enregistrer le fichier - - - Declarative UI files (*.qml) - Fichiers de déclaration d'interface (*.qml) - - - All files (*) - Tous les fichiers (*) - - - - QmlDesigner::ItemLibrary - - Library - Title of library view - Bibliothèques - - - Items - Title of library items view - Éléments - - - Resources - Title of library resources view - Ressources - - - <Filter> - Library search input hint text - <Filtre> - - - - QmlDesigner::NavigatorTreeModel - - Unknown item: %1 - Item inconnu : %1 - - - Invalid Id - Identifiant invalide - - - %1 is an invalid id. - %1 n'est pas un identifiant valide. - - - %1 already exists. - %1 existe déjà. - - - %1 is an invalid id - %1 est un identifiant invalide - - - %1 already exists - %1 existe déjà - - - Warning - Avertissement - - - Reparenting the component %1 here will cause the component %2 to be deleted. Do you want to proceed? - Redéfinir ici le parent du composant %1 entrainera la supression du composant %2. Voulez-vous continuer ? - - - - QmlDesigner::NavigatorWidget - - Navigator - Title of navigator view - Navigateur - - - Become first sibling of parent (CTRL + Left) - Devenir le premier frère du parent (CTRL + Left) - - - Become child of first sibling (CTRL + Right) - Devenir l'enfant dy premier frère (CTRL + Right) - - - Move down (CTRL + Down) - Déplacer en dessous (CTRL + Down) - - - Move up (CTRL + Up) - Déplacer au-dessus (CTRL + Up) - - - - QmlDesigner::PluginManager - - About plugins - À propos des plug-ins - - - About Plugins - À propos des plug-ins - - - - WidgetPluginManager - - Failed to create instance. - Échec lors de la création de l'instance. - - - Not a QmlDesigner plugin. - N'est pas un module pour QmlDesigner. - - - Failed to create instance of file '%1': %2 - Échec lors de la création de l'instance du fichier "%1" : %2 - - - Failed to create instance of file '%1'. - Échec lors de la création de l'instance du fichier "%1". - - - File '%1' is not a QmlDesigner plugin. - Le fichier "%1' n"est pas un module pour QmlDesigner. - - - - QmlDesigner::AllPropertiesBox - - Properties - Title of properties view. - Propriétés - - - - QmlDesigner::PropertyEditor - - Properties - Propriétés - - - Invalid Id - Id invalide - - - %1 is an invalid id - %1 est un identifiant invalide - - - %1 already exists - %1 existe déjà - - - - qdesigner_internal::QtGradientStopsController - - H - Teinte (HSV color model) - T - - - S - Saturation (HSV color model) - S - - - V - Valeur (HSV color model) - V - - - Hue - Teinte (HSV color model) - Teinte - - - Sat - Saturation (HSV color model) - Sat - - - Val - Valeur (HSV color model) - Val - - - Saturation - HSV color model - Saturation - - - Value - HSV color model - Valeur - - - R - Rouge - R - - - G - Vert - V - - - B - Bleu - B - - - Red - Rouge - - - Green - Vert - - - Blue - Bleu - - - - QtGradientStopsWidget - - New Stop - Nouveau point d'arrêt - - - Delete - Supprimer - - - Flip All - Tout retourner - - - Select All - Tout sélectionner - - - Zoom In - Zoom avant - - - Zoom Out - Zoom arrière - - - Reset Zoom - Réinitialiser le zoom - - - - QmlDesigner::Internal::StatesEditorModel - - base state - Implicit default state - État de base - - - Invalid state name - Nom d'état invalide - - - The empty string as a name is reserved for the base state. - La chaîne vide comme nom est réservée à l'état de base. - - - Name already used in another state - Le nom est déjà utilisé dans un autre état - - - - QmlDesigner::Internal::StatesEditorWidgetPrivate - - base state - état de base - - - State%1 - Default name for newly created states - État%1 - - - - QmlDesigner::StatesEditorWidget - - States - Title of Editor widget - États - - - - QmlDesigner::InvalidArgumentException - - Failed to create item of type %1 - Échec lors de la création d'un élément de type %1 - - - - InvalidIdException - - Ids have to be unique: - Les identifiants doivent être uniques : - - - Invalid Id: - Identifiant invalide : - - - -Only alphanumeric characters and underscore allowed. -Ids must begin with a lowercase letter. - \nSeuls les caractères numériques et les tirets bas sont autorisés.\nL'identifiant doit commencé avec une lettre minuscule. - - - Only alphanumeric characters and underscore allowed. -Ids must begin with a lowercase letter. - Seuls les caractères numériques et les tirets bas sont autorisés.\nL'identifiant doit commencer avec une lettre minuscule. - - - Ids have to be unique. - Les identifiants doivent être uniques. - - - Invalid Id: %1 -%2 - Identifiant invalide : %1 -%2 - - - - QmlDesigner::Internal::SubComponentManagerPrivate - - QML Components - Composants QML - - - - QmlDesigner::Internal::ModelPrivate - - invalid type - type invalide - - - - QmlDesigner::QmlModelView - - Invalid Id - Indentifiant invalide - - - - QmlDesigner::RewriterView - - Error parsing - Erreur d'analyse syntaxique - - - Internal error - Erreur interne - - - "%1" - "%1" - - - line %1 - Ligne %1 - - - column %1 - Colonne %1 - - - - QmlDesigner::Internal::DocumentWarningWidget - - Placeholder - Placeholder - - - <a href="goToError">Go to error</a> - <a href="goToError">Aller à l'erreur</a> - - - %3 (%1:%2) - %3 (%1:%2) - - - Internal error (%1) - Erreur interne (%1) - - - - QmlDesigner::Internal::DesignModeWidget - - &Undo - &Annuler - - - &Redo - &Rétablir - - - Delete - Supprimer - - - Delete "%1" - Supprimer "%1" - - - Cu&t - Co&uper - - - Cut "%1" - Couper "%1" - - - &Copy - Co&pier - - - Copy "%1" - Copier "%1" - - - &Paste - C&oller - - - Paste "%1" - Coller "%1" - - - Select &All - Tout &sélectionner - - - Select All "%1" - Tout sélectionner "%1" - - - Toggle Full Screen - Basculer en plein écran - - - &Restore Default View - &Réstaurer la vue par défaut - - - &Go into Component - Aller dans le composant (&G) - - - Toggle &Left Sidebar - Basculer sur la barre latérale de &gauche - - - Toggle &Right Sidebar - Basculer sur la barre latérale de &droite - - - Projects - Projets - - - File System - Système de fichier - - - Open Documents - Documents ouverts - - - Qt Quick emulation layer crashed - Calque d'émulation de Qt Quick à planté - - - - QmlDesigner::Internal::BauhausPlugin - - Switch Text/Design - Basculer entre Texte/Design - - - Save %1 As... - Enregistrer %1 sous... - - - &Save %1 - Enregi&strer %1 - - - Revert %1 to Saved - Restaurer %1 à la version sauvegardée - - - Close %1 - Fermer %1 - - - Close All Except %1 - Fermer tout sauf %1 - - - Close Others - Fermer les autres éditeurs - - - - Qt Quick - - Qt Quick - Qt Quick - - - - Qml::Internal::QLineGraph - - Frame rate - Taux de rafraîchissement - - - - Qml::Internal::GraphWindow - - Total time elapsed (ms) - Temps total écoulé (ms) - - - - Qml::Internal::CanvasFrameRate - - Resolution: - Résolution : - - - Clear - Effacer - - - New Graph - Nouveau graphique - - - Enabled - Autorisé - - - - Qml::Internal::ExpressionQueryWidget - - <Type expression to evaluate> - <Type expression à évaluer> - - - Write and evaluate QtScript expressions. - Ecrire et évaluer des expressions QtScript. - - - Clear Output - Éffacer la sortie - - - Script Console - - Console de scripte - - - Expression queries - Expression des requêtes - - - Expression queries (using context for %1) - Selected object - Expression des requêtes (en utilisant le contexte de %1) - - - <%n items> - - <%n élément> - <%n éléments> - - - - - Qml::Internal::ObjectPropertiesView - - Name - Nom - - - Value - Valeur - - - Type - Type - - - &Watch expression - &Ajouter un point d'observation sur l'expression - - - &Remove watch - &Supprimer le point d'observation - - - Show &unwatchable properties - A&fficher les propriétés non observées - - - &Group by item type - &Grouper par type d'élément - - - <%n items> - - <%n élément> - <%n éléments> - - - - Watch expression '%1' - Ajouter un point d'observation sur l'expression "%1" - - - Hide unwatchable properties - Masquer les propriétés non observées - - - Show unwatchable properties - Afficher les propriétés non observées - - - - Qml::Internal::ObjectTree - - Add watch expression... - Ajouter un point d'observation sur l'expression... - - - Show uninspectable items - Montrer les éléments non inspectables - - - Go to file - Aller au fichier - - - Watch expression - Ajouter un point d'observation sur l'expression - - - Expression: - Expression : - - - - Qml::Internal::WatchTableModel - - Name - Nom - - - Value - Valeur - - - - Qml::Internal::WatchTableView - - Stop watching - Arrêter l'observation - - - - Qml::InspectorOutputWidget - - Output - Sortie - - - Clear - Effacer - - - - Qml::Internal::EngineComboBox - - Engine %1 - engine number - Engin %1 - - - - Qml::QmlInspector - - Failed to connect to debugger - Échec lors de la connection au débogeur - - - Could not connect to debugger server. - Impossible de se connecter au serveur de débogage. - - - Invalid project, debugging canceled. - Projet invalide, débogage annulé. - - - Cannot find project run configuration, debugging canceled. - Impossible de trouver la configuration d'exécution du projet, débogage annulé. - - - [Inspector] set to connect to debug server %1:%2 - [Inspecteur] configuré pour se connecter au serveur de débogage %1 : %2 - - - [Inspector] disconnected. - - - [Inspecteur] deconnecté. - - - - - [Inspector] resolving host... - [Inspecteur] résolution de l'hôte... - - - [Inspector] connecting to debug server... - [Inspecteur] connection au serveur de débogage... - - - [Inspector] connected. - - [Inspecteur] connecté. - - - - [Inspector] closing... - [Inspecteur] fermeture... - - - [Inspector] error: (%1) %2 - %1=error code, %2=error message - [Inspecteur] erreur : (%1) %2 - - - QML engine: - Moteur QML : - - - Object Tree - Arbre de l'objet - - - Properties and Watchers - Propriétés et observateurs - - - Script Console - Console de script - - - Output of the QML inspector, such as information on connecting to the server. - Sortie de l'inspecteur QML, telles que des informations sur la connexion au serveur. - - - Start Debugging C++ and QML Simultaneously... - Démarrer le débogage du C++ et du QML simultanément... - - - No project was found. - Aucun projet trouvé. - - - No run configurations were found for the project '%1'. - Aucune configuration d'exécution n'a été trouvée pour le projet "%1". - - - No valid run configuration was found for the project %1. Only locally runnable configurations are supported. -Please check your project settings. - Aucune configuration d'exécution valide n'a été trouvée pour le projet %1.Seules les configurations d'exécution locales sont prises en charge. -Merci de vérifier vos paramètres de projet. - - - A valid run control was not registered in Qt Creator for this project run configuration. - Un contrôle d'exécution valide n'a pas été enregistré dans Qt Creator pour cette configuration d'exécution du projet. - - - Debugging failed: could not start C++ debugger. - Échec du débogage : impossible de démarrer le débogueur C++. - - - - Qml::Internal::StartExternalQmlDialog - - <No project> - <Aucun projet> - - - - QtC::QmlJSEditor - - Rename... - Renommer... - - - New id: - Nouvel identifiant : - - - Rename id '%1'... - Renommer l'identifiant "%1"... - - - <Select Symbol> - <Selectionner un symbole> - - - Do you want to enable the experimental Qt Quick Designer? - Voulez-vous activer le designer expérimental pour Qt Quick ? - - - Enable Qt Quick Designer - Activer le designer pour Qt Quick - - - Qt Creator -> About Plugins... - Qt Creator -> À propos des modules... - - - Help -> About Plugins... - Aide -> À propos des modules... - - - Enable experimental Qt Quick Designer? - Activer le designer expérimental pour Qt Quick ? - - - Do you want to enable the experimental Qt Quick Designer? After enabling it, you can access the visual design capabilities by switching to Design Mode. This can affect the overall stability of Qt Creator. To disable Qt Quick Designer again, visit the menu '%1' and disable 'QmlDesigner'. - Voulez-vous activer le designer expérimental pour Qt Quick ? Après l'activation, vous pourrez accéder aux outils de conception visuelle en basculant dans le mode Design. Cela peut affecter la stabilité globale de Qt Creator. Pour désactiver le designer de Qt Creator, aller dans le menu "%1' et désactiver 'QmlDesigner". - - - Cancel - Annuler - - - Please restart Qt Creator - Veuillez redémarrer Qt Creator - - - Please restart Qt Creator to make the change effective. - Veuillez redémarrer Qt Creator pour rendre les changements actifs. - - - Creates a Qt QML file. - Créer un fichier QML. - - - Qt QML File - Fichier QML - - - Ctrl+Alt+R - Ctrl+Alt+R - - - Creates a QML file. - Créer un fichier QML. - - - QML File - Fichier QML - - - Creates a QML file with boilerplate code, starting with "import QtQuick 1.1". - Crée un fichier QML avec le code tout fait commençant par "import QtQuick 1.1". - - - QML File (Qt Quick 1) - Fichier QML (Qt Quick 1) - - - Creates a QML file with boilerplate code, starting with "import QtQuick 2.0". - Crée un fichier QML avec le code tout fait commençant par "import QtQuick 2.0". - - - QML File (Qt Quick 2) - Fichier QML (Qt Quick 2) - - - Creates a JavaScript file. - Crée un fichier JavaScript. - - - JS File - Fichier JS - - - Rename Symbol Under Cursor - Renommer le symbole sous le curseur - - - Ctrl+Shift+R - Ctrl+Shift+R - - - Run Checks - Exécuter les vérifications - - - Ctrl+Shift+C - Ctrl+Shift+C - - - Reformat File - Reformater le fichier - - - QML - QML - - - QML Analysis - Analyse QML - - - Follow Symbol Under Cursor - Suivre le symbole sous le curseur - - - Find Usages - Trouver les utilisations - - - Ctrl+Shift+U - Ctrl+Shift+U - - - Show Qt Quick Toolbar - Montrer la barre d'outils Qt Quick - - - Unfiltered - Sans filtre - - - Library at %1 - Bibliothèque à %1 - - - Dumped plugins successfully. - Création d'un dump des plug-ins avec succès. - - - Read typeinfo files successfully. - Lecture du fichier typeinfo avec succès. - - - Indexing - Indexation - - - Type dump of QML plugin in %0 failed. -Errors: -%1 - - pas sur de la traduction de dump... - Échec du collecteur de type pour le plug-in QML dans %0. -Erreurs : -%1 - - - - No file specified. - Aucun fichier spécifié. - - - Failed to preview Qt Quick file - Échec de la prévisualisation du fichier Qt Quick - - - Could not preview Qt Quick (QML) file. Reason: -%1 - Impossible de prévisualiser le fichier Qt Quick (QML). Raison : -%1 - - - Could not preview Qt Quick (QML) file. Reason: -%1 - Impossible de prévisualiser le fichier Qt Quick (QML). Raison : \n%1 - - - - QtC::QmlProjectManager - - Error while loading project file! - Erreur lors du chargement du fichier de projet ! - - - Error while loading project file %1. - du projet ? - Erreur lors du chargement du fichier de projet %1. - - - QML project: %1 - Projet QML : %1 - - - Warning while loading project file %1. - Avertissement lors du chargement du fichier de projet %1. - - - Qt version is too old. - La version de Qt est trop vieille. - - - File '%1' does not exist or is not readable. - Le fichier '%1' n'existe pas ou n'est pas lisible. - - - Device type is not desktop. - Le type d'appareil n'est pas "desktop". - - - No Qt version set in kit. - Pas de version de Qt définie dans le kit. - - - Qt QML Application - Application QML - - - Creates a Qt QML application project with a single QML file containing the main view. - -QML application projects are executed through the QML runtime and do not need to be built. - Créer un projet pour une application QML avec un seul fichier QML contenant la vue principale.\n\nLes applications QML sont exécutées sur le runtine QML et n'ont pas besoin d'être compilées. - - - Creates a Qt Quick UI project with a single QML file that contains the main view. - -You can review Qt Quick UI projects in the QML Viewer and you need not build them. You do not need to have the development environment installed on your computer to create and run this type of projects. - -Requires <b>Qt 4.7.4</b> or newer. - Crée un projet d'interface Qt Quick avec un seul fichier QML qui contient la vue principale. - -Vous pouvez voir le projet d'interface Qt Quick dans le visualiseur QML sans avoir à le compiler. Vous n'avez pas besoin d'avoir l'environnement de développement d'installé sur votre ordinateur pour créer et exécuter ce type de projet. - -Requiert <b>Qt 4.7.4</b> ou plus récent. - - - Creates a Qt Quick UI project with a single QML file that contains the main view. - -You can review Qt Quick UI projects in the QML Viewer and you need not build them. You do not need to have the development environment installed on your computer to create and run this type of projects. - Crée un projet d'interface Qt Quick avec un seul fichier QML qui contient la vue principale. - -Vous pouvez voir le projet d'interface Qt Quick dans le visualiseur QML sans avoir à le compiler. Vous n'avez pas besoin d'avoir l'environnement de développement d'installé sur votre ordinateur pour créer et exécuter ce type de projet. - - - File generated by QtCreator - qmlproject Template - Comment added to generated .qmlproject file - Fichier généré par Qt Creator - - - Qt Quick 2 UI - Interface utilisateur Qt Quick 2 - - - Creates a Qt Quick UI 2 project with a single QML file that contains the main view. - -You can review Qt Quick UI 2 projects in the QML Scene and you need not build them. You do not need to have the development environment installed on your computer to create and run this type of projects. - -Requires <b>Qt 5.0</b> or newer. - Crée un projet d'interface utilisateur Qt Quick 2 avec un seul fichier QML contenant la vue principale. - -Vous pouvez vérifier les projets d''interface utilisateur Qt Quick 2 dans le QML Scene, sans devoir les compiler. Il n'est pas nécessaire d'avoir un environnement de développement installé sur votre ordinateur pour créer et exécuter ce type de projets. - -Nécessite <b>Qt 5.0</b> ou plus récent. - - - Qt Quick 1 UI - Interface utilisateur Qt Quick 1 - - - Creates a Qt Quick UI 1 project with a single QML file that contains the main view. - -You can review Qt Quick UI 1 projects in the QML Viewer and you need not build them. You do not need to have the development environment installed on your computer to create and run this type of projects. - -Requires <b>Qt 4.8</b> or newer. - Crée un projet d'interface utilisateur Qt Quick 1 avec un seul fichier QML qui contient la vue principale. - -Vous pouvez vérifier les projets d''interface utilisateur Qt Quick 1 dans le QML Scene, sans devoir les compiler. Il n'est pas nécessaire d'avoir un environnement de développement installé sur votre ordinateur pour créer et exécuter ce type de projets. - -Nécessite <b>Qt 4.8</b> ou plus récent. - - - Qt Quick Project - Projet Qt Quick - - - Import Existing Qt QML Directory - Importer un répertoire Qt QML existant - - - Project Name and Location - Nom du projet et emplacement - - - Location - Emplacement - - - Include .qml, .js, and image files from current directory and subdirectories - qmlproject Template - Comment added to generated .qmlproject file - Inclure les fichiers .qml, .js et les images depuis le répertoire courant et ses sous-répertoires - - - List of plugin directories passed to QML runtime - qmlproject Template - Comment added to generated .qmlproject file - Liste des répertoires des plug-ins passée au runtime QML - - - Failed opening project '%1': Project already open - Échec de l'ouverture du projet "%1" : projet déjà ouvert - - - Failed opening project '%1': Project file is not a file - Échec de l'ouverture du projet '%1' : le fichier de projet n'est pas un fichier - - - Failed opening project '%1': Project is not a file - Échec de l'ouverture du projet "%1" : le projet n'est pas un fichier - - - No qmlviewer or qmlobserver found. - Pas de qmlviewer ou qmlobserver trouvé. - - - No qmlviewer or qmlscene found. - Pas de qmlviewer ou qmlscene trouvé. - - - QML Scene - QMLRunConfiguration display name. - QML Scene - - - QML Viewer - QMLRunConfiguration display name. - Visualisateur QML - - - Manage Qt versions - Gérer les versions de Qt - - - Qt version: - Version de Qt : - - - Debugger: - Débogueur : - - - Invalid Qt version - Version de Qt invalide - - - Debugging Address: - Addresse du débogeur : - - - Debugging Port: - Port du débogueur : - - - <Current File> - <Fichier courant> - - - Run QML Script - Executer le script QML - - - QML Viewer - QML Viewer - - - QML Scene - QML Scene - - - Starting %1 %2 - Démarrer %1 %2 - - - %1 exited with code %2 - %1 a quitté avec le code %2 - - - Run - Exécuter - - - Open Qt4 Options - Ouvrir les options de Qt4 - - - Cancel - Annuler - - - QML Observer could not be found. - L'observateur QML n'a pas pu être trouvé. - - - QML Observer is used to offer debugging features for QML applications, such as interactive debugging and inspection tools. It must be compiled for each used Qt version separately. On the Qt4 options page, select the current Qt installation and click Rebuild. - pour "telles": s'accorde avec fonctionnalités (cf http://home.ican.net/~galandor/grammair/fich_002.htm ) - L'observateur QML est utilisé pour offrir des fonctionnalités de débogage pour les applications QML, telles que des outils de débogage interactif et d'inspection. Il doit être compilé séparément pour chaque version de Qt utilisée. Sur la page d'options Qt4, séléctionner l'installation courante de Qt et cliquer sur recompiler. - - - QML - QML - - - - QtC::QmakeProjectManager - - Step 1 of 2: Choose GnuPoc folder - Étape 1 sur 2 : Choisir le répertoire GnuPoc - - - Step 2 of 2: Choose Qt folder - Étape 2 sur 2 : Choisir le répertoire Qt - - - Adding GnuPoc - Ajouter GnuPoc - - - GnuPoc and Qt folders must not be identical. - Les répertoires GnuPoc et Qt ne doivent pas être identiques. - - - - QtC::ProjectExplorer - - The Symbian SDK and the project sources must reside on the same drive. - Le SDK Symbian et les sources du projet doivent être situés sur le même disque. - - - The Symbian SDK was not found for Qt version %1. - Le SDK Symbian n'a pas été trouvé pour Qt version %1. - - - The "Open C/C++ plugin" is not installed in the Symbian SDK or the Symbian SDK path is misconfigured for Qt version %1. - Le "plug-in Open C/C++" n'est pas installé pour le SDK Symbian ou le répertoire du SDK Symbian est mal configuré pour la version de Qt %1. - - - The Symbian toolchain does not handle special characters in a project path well. - La chaîne de compilation Symbian ne gère correctement les caractères spéciaux dans le chemin d'un projet. - - - The Symbian tool chain does not handle spaces in the project path '%1'. - La chaîne de compilation Symbian ne gère pas les espaces dans le chemin du projet "%1". - - - The Symbian tool chain does not handle special characters in the project name '%1' well. - La chaîne de compilation Symbian ne gère pas bien les caractères spéciaux dans le chemin du projet "%1". - - - - QtC::QmakeProjectManager - - Evaluating - Évaluation - - - No Qt version set in kit. - Aucune version de Qt définie dans le kit. - - - The .pro file '%1' does not exist. - Le fichier .pro "%1" n'existe pas. - - - The .pro file '%1' is not part of the project. - Le fichier .pro "%1" ne fait pas partie du projet. - - - The .pro file '%1' could not be parsed. - Le fichier .pro "%1" ne peut pas être analysé. - - - Qt4 - Qt4 - - - Qt Versions - Versions de Qt - - - Qt Widget Project - Projet Qt Widget - - - Qt C++ Project - Projet Qt C++ - - - Maemo - Maemo - - - Linux Devices - Périphériques Linux - - - Unconfigured Project - Project non configuré - - - - QtC::QtSupport - - The Qt version is invalid: %1 - %1: Reason for being invalid - La version de Qt est invalide : %1 - - - The qmake command "%1" was not found or is not executable. - %1: Path to qmake executable - La commande qmake "%1" n'a pas été trouvée ou n'est pas exécutable. - - - - QtC::QmakeProjectManager - - Qmake does not support build directories below the source directory. - Qmake ne permet pas d'avoir des répertoires de compilation à un niveau en-dessous des répertoires sources. - - - The build directory needs to be at the same level as the source directory. - Le répertoire de compilation doit être au même niveau que celui des sources. - - - Warning: Cannot build QMLObserver; Qt version must be 4.7.1 or higher. - Avertissement : impossible de compiler QMLObserver ; la version de Qt doit être 4.7.1 ou plus. - - - Warning: Cannot build qmldump; Qt version must be 4.7.1 or higher. - Avertissement : impossible de compiler qmldump ; la version de Qt doit être 4.7.1 ou plus. - - - - QtC::QtSupport - - No qmake path set - Chemin de qmake non spécifié - - - qmake does not exist or is not executable - qmake n'existe pas ou n'est pas exécutable - - - Qt version has no name - La version de Qt n'a pas de nom - - - <unknown> - contexte ? - <inconnu> - - - System - Système - - - Qt %1 in PATH (%2) - Qt %1 dans le PATH (%2) - - - Qt %1 (%2) - Qt %1 (%2) - - - Qt version is not properly installed, please run make install - La version de Qt n'est pas correctement installée, veuillez exécuter make install - - - Could not determine the path to the binaries of the Qt installation, maybe the qmake path is wrong? - Impossible de déterminer le chemin vers les programmes de Qt, peut-être que le chemin vers qmake est faux ? - - - The default mkspec symlink is broken. - Le lien symbolique sur le mkspec par défaut est cassé. - - - ABI detection failed: Make sure to use a matching compiler when building. - La détection de l'ABI a échoué : vérifiez que vous utilisez un compilateur adéquat. - - - Non-installed -prefix build - for internal development only. - ? - Version de Qt compilée avec -prefix non installée – pour le développement interne uniquement. - - - Cannot start '%1': %2 - Impossible de démarrer "%1" : %2 - - - Timeout running '%1' (%2 ms). - Expiration de l'exécution de "%1" (%2 ms). - - - '%1' crashed. - "%1" a crashé. - - - qmake '%1' is not an executable. - qmake "%1" n'est pas un exécutable. - - - Failed to detect the ABI(s) used by the Qt version. - Impossible de détecter l'ABI utilisée par la version de Qt. - - - ABI detection failed: Make sure to use a matching tool chain when building. - La détection de l'ABI a échoué : vérifiez que vous utilisez une chaîne de compilation adéquate lors de la compilation. - - - No qmlscene installed. - Pas de qmlscene installé. - - - No qmlviewer installed. - Pas de qmlviewer installé. - - - The "Open C/C++ plugin" is not installed in the Symbian SDK or the Symbian SDK path is misconfigured - Le plug-in "Open C/C++" n'est pas installé dans le SDK Symbian ou le chemin du SDK Symbian n'est pas bien configuré - - - SBS was not found. - SBS non trouvé. - - - Desktop - Qt Version is meant for the desktop - Desktop - - - Symbian - Qt Version is meant for Symbian - Symbian - - - Maemo - Qt Version is meant for Maemo5 - Maemo - - - Harmattan - Qt Version is meant for Harmattan - Harmattan - - - MeeGo - Qt Version is meant for MeeGo - MeeGo - - - Meego - Qt Version is meant for Meego - Meego - - - Qt Simulator - Qt Version is meant for Qt Simulator - Simulateur Qt - - - unkown - No idea what this Qt Version is meant for! - inconnue - - - Qt version %1, using mkspec %2 (%3) - Qt en version %1, en utilisant le mkspec %2 (%3) - - - Cannot determine the installation path for Qt version '%1'. - Impossible de définir le chemin d'installation pour la version de Qt '%1'. - - - The Qt Version has no tool chain. - La version de Qt n'as pas de chaîne de compilation. - - - Building helper(s) with toolchain '%1' ... - - Compilation des assistants avec la chaîne de compilation "%1"... - - - - Building helper(s) with toolchain '%1'... - - Compilation des assistants avec la chaîne de compilation '%1'... - - - Build failed. - Compilation échoué. - - - Build succeeded. - Compilation réussi. - - - The Qt Version has no toolchain. - La version de Qt n'as pas de chaîne de compilation. - - - Qt for WinCE - Qt Version is meant for WinCE - Qt pour WinCE - - - Embedded Linux - Qt Version is used for embedded Linux development - Linux embarqué - - - - QtC::QmakeProjectManager - - Mobile Qt Application - Application Qt pour mobiles - - - Creates a Qt application optimized for mobile devices with a Qt Designer-based main window. - -Preselects Qt for Simulator and mobile targets if available - Créer une application Qt optimisée pour les mobiles avec une fenêtre principale conçue dans Qt Designer.\n\nPrésélectionne la version de Qt pour le simulateur et les mobiles si disponible - - - Modules - Modules - - - Kits - Kits - - - Qt Unit Test - Test unitaire Qt - - - Creates a QTestLib-based unit test for a feature or a class. Unit tests allow you to verify that the code is fit for use and that there are no regressions. - Créer un test unitaire basé sur QTestList pour une fonctionnalité ou une classe.Les tests unitaires vous permettent de vérifier que le code est utilisable et qu'il n'y a pas de régression. - - - This wizard generates a Qt unit test consisting of a single source file with a test class. - Cet assistant génère un test unitaire Qt consistant en un fichier source unique avec une classe de test. - - - - QtC::Subversion - - Annotate revision "%1" - Révision annotée "%1" - - - - QtC::TextEditor - - Text Editor - Éditeur de texte - - - Translate this string - Traduire cette chaîne de caractères - - - - QtC::VcsBase - - The file '%1' could not be deleted. - Le fichier "%1' n"a pas pu être supprimé. - - - Choose Repository Directory - Choisissez le répertoire pour le dépot - - - The directory '%1' is already managed by a version control system (%2). Would you like to specify another directory? - Le répertoire "%1" est déjà géré par un système de contrôle des versions (%2). Voulez-vous spécifier un autre répertoire ? - - - Repository already under version control - Le dépôt est déjà sous contrôle de version - - - Repository Created - Dépot créé - - - Repository Creation Failed - Échec lors de la création du dépôt - - - Error: Executable timed out after %1s. - Erreur: L'exécutable est arrivé à échéance après %1s. - - - There is no patch-command configured in the common 'Version Control' settings. - Il n'y a pas de commande patch configurée dans les paramètres communs de contrôle de version. - - - Unable to launch '%1': %2 - Impossible de lancer "%1" : %2 - - - A timeout occurred running '%1' - mouais - "%1" a expiré - - - '%1' crashed. - "%1" a crashé. - - - '%1' failed (exit code %2). - "%1" a échoué (code de retour %2). - - - Repository created - Dépot créé - - - A version control repository has been created in %1. - Un dépôt sous contrôle de version à été créé dans %1. - - - Repository creation failed - Échec lors de la création du dépôt - - - A version control repository could not be created in %1. - Un dépôt sous contrôle de version ne peut pas être créé dans %1. - - - - trk::Launcher - - Cannot open remote file '%1': %2 - Impossible d'ouvrir le fichier "%1" à distance : %2 - - - Cannot open '%1': %2 - Impossible d'ouvrir "%1" : %2 - - - No device is connected. Please connect a device and try again. - Pas de périphérique connecté. Veuillez connecter un périphérique et réessayer. - - - Unable to acquire a device for port '%1'. It appears to be in use. - Impossible d'acquérir un device pour le port "%1". Il semble être utilisé. - - - - AboutDialog - - About Bauhaus - AboutDialog - A propos de Bauhaus - - - - QtC::QmlEditorWidgets - - Text - Texte - - - Style - Style - - - Normal - Normal - - - Outline - Contour - - - Raised - Bombé - - - Sunken - Enfoncé - - - ... - ... - - - - QtC::Core - - Unfiltered - Sans filtre - - - - QmlDesigner::ContextPaneWidget - - Disable permanently - Désactiver de façon permanente - - - - QtC::QmlEditorWidgets - - Form - Formulaire - - - Stretch vertically. Scales the image to fit to the available area. - Étirer verticalement. Redimensionne l'image pour qu'elle occupe l'espace disponible. - - - Repeat vertically. Tiles the image until there is no more space. May crop the last image. - tronquée ? rognée ? john :rognée - Répéter verticalement. Répète l'image en utilisant tout l'espace disponible. Il se peut que la dernière image soit rognée. - - - Round. Like Repeat, but scales the images down to ensure that the last image is not cropped. - Arrondir. Comme répéter mais redimensionne les images afin de s'assurer que la dernière ne soit pas rognée. - - - Repeat horizontally. Tiles the image until there is no more space. May crop the last image. - Répéter horizontalement. Répète l'image en utilisant tout l'espace disponible. Il se peut que la dernière image soit rognée. - - - Stretch horizontally. Scales the image to fit to the available area. - Étirer horizontalement. Redimensionne l'image pour qu'elle occupe l'espace disponible. - - - The image is scaled to fit - L'image est redimensionnée pour être ajustée - - - The image is stretched horizontally and tiled vertically - L'image est étirée horizontalement et répétée verticalement - - - The image is stretched vertically and tiled horizontally - L'image est étirée verticalement et répétée horizontalement - - - The image is duplicated horizontally and vertically - L'image est dupliquée horizontalement et verticalement - - - The image is scaled uniformly to fit without cropping - L'image est étirée uniformément pour être ajustée sans rognage - - - The image is scaled uniformly to fill, cropping if necessary - L'image est étirée uniformément pour remplir, en étant rognée si nécessaire - - - 10 x 10 - wtf ? encore ? - 10 x 10 - - - Gradient - Dégradé - - - Color - Couleur - - - Border - Bordure - - - Dialog - Boîte de dialogue - - - Play simulation - Lancer la simulation - - - Easing - Amortissement - - - Type of easing curve - Type de la courbe d'amortissement - - - Subtype - Sous-type - - - Acceleration or deceleration of easing curve - Accélération ou décélération de la courbe d'amortissement - - - Duration - Durée - - - Duration of animation - Durée de l'animation - - - INVALID - INVALIDE - - - ms - ms - - - Amplitude - Amplitude - - - Amplitude of elastic and bounce easing curves - Amplitude des courbes d'amortissement élastiques et à rebonds - - - Period - Période - - - Easing period of an elastic curve - Période d'amortissement d'une courbe élastique - - - Overshoot - Dépasser - - - Easing overshoot for a back curve - Dépassement de l'amortissement pour le retour d'une courbe - - - - QtC::ClassView - - Form - Formulaire - - - Show Subprojects - Afficher les sous-projets - - - - QtC::Help - - Filter configuration - Configuration du filtre - - - Prefix: - Préfixe : - - - Limit to prefix - Limiter au préfixe - - - + - + - - - - - - - - - Double click to edit item. - Double-cliquez pour modifier l'élément. - - - Double-click to edit item. - Double-cliquez pour modifier l'élément. - - - Edit Filter Configuration - Éditer la configuration des filtres - - - - QtC::ImageViewer - - Image Viewer - Visualisateur d'image - - - Show background - Afficher l'arrière plan - - - Show outline - Afficher le contour - - - Fit image in the screen - Ajuster l'image à la taille de l'écran - - - Zoom In - Zoom avant - - - Zoom Out - Zoom arrière - - - Show Background - Afficher l'arrière plan - - - Show Outline - Affiche le contour - - - Fit to Screen - Ajuster à la taille de l'écran - - - Original Size - Taille réelle - - - - QtC::QmlJSEditor - - Dialog - Boîte de dialogue - - - Choose... - Choisir... - - - Form - Formulaire - - - Qt Quick Toolbars - Barres d'outils Qt Quick - - - Always show Qt Quick Toolbar - Toujours afficher la barre d'outils Qt Quick - - - If enabled, the toolbar will remain pinned to an absolute position. - restera attachée ? => épinglée - utilisé ailleurs [pnr] - Si disponible, la barre d'outils restera épinglée à une position absolue. - - - Pin Qt Quick Toolbar - "Pin" -> épingler (utilisé dans d'autres traductions) - Épingler la barre d'outils Qt Quick - - - Qt Quick ToolBar - Barre d'outils Qt Quick - - - - QtC::QmakeProjectManager - - Library: - Bibliothèque : - - - Library file: - Fichier de bibliothèque : - - - Include path: - Chemin d'inclusion : - - - Platform - Plateforme - - - Linux - Linux - - - Mac - Mac - - - Windows - Windows - - - Symbian - Symbian - - - Linkage: - Edition de liens : - - - Dynamic - Dynamique - - - Static - Statique - - - Mac: - Mac : - - - Library - Bibliothèque - - - Framework - Framework - - - Windows: - Windows : - - - Library inside "debug" or "release" subfolder - Bibliothèque dans le sous-répertoire "debug" ou "release" - - - Add "d" suffix for debug version - Ajouter le suffixe "d" pour la version debug - - - Remove "d" suffix for release version - Retirer le suffixe "d" pour la version release - - - Package: - Paquet : - - - - MaemoProFilesUpdateDialog - - Maemo Deployment Issue - Problème de déploiement Maemo - - - The project files listed below do not contain Maemo deployment information, which means the respective targets cannot be deployed to and/or run on a device. Qt Creator can add the missing information to these files. - La liste des fichiers de projet ci-dessous ne contient pas d'informations de déploiement Maemo, ce qui signifie que les cibles respectives ne peuvent pas être déployées et/ou executése sur un périphérique. Qt Creator peut ajouter les informations manquantes à ces fichiers. - - - Check all - Cocher tout - - - Uncheck All - Décocher tout - - - The project files listed below do not contain Maemo deployment information, which means the respective targets cannot be deployed to and/or run on a device. Qt Creator will add the missing information to these files if you check the respective rows below. - La liste des fichiers de projet ci-dessous ne contient pas d'informations de déploiement Maemo, ce qui signifie que les cibles respectives ne peuvent pas être déployées et/ou executées sur un périphérique. Qt Creator peut ajouter les informations manquantes à ces fichiers si vous vérifiez les lignes correspondantes ci-dessous. - - - &Check all - &Cocher tout - - - &Uncheck All - Décocher to&ut - - - - QtQuickAppWizardSourcesPage - - WizardPage - WizardPage - - - Main QML File - Fichier QML principal - - - Generate a main.qml file - Générer un fichier main.qml - - - Import an existing .qml file - Importer un fichier .qml existant - - - Note: All files and directories that reside in the same directory as the main QML file are deployed. You can modify the contents of the directory any time before deploying. - Note : tous les fichiers et répertoires qui sont dans le même répertoire que le fichier QML principal sont déployés. Vous pouvez modifier le contenu du répertoire n'importe quand avant le déploiement. - - - - ManageDefinitionsDialog - - Dialog - Boîte de dialogue - - - Definitions - Définitions - - - Select All - Tout sélectionner - - - Clear Selection - Effacer la sélection - - - Invert Selection - Inverser la sélection - - - Download Selected Definitions - Télécharger les définitions sélectionnées - - - - QtC::QmlEditorWidgets - - Hides this toolbar. - Cache cette barre d'outils. - - - Pin Toolbar - Épingler la barre d'outils - - - Show Always - Toujours montrer - - - Unpins the toolbar and moves it to the default position. - Détacher la barre d'outils et déplacer la à sa position par défaut. - - - Hides this toolbar. This toolbar can be permanently disabled in the options page or in the context menu. - Cache cette barre d'outils. Cette barre d'outils peut être désactivée définitivement dans la page des options ou dans le menu contextuel. - - - double click for preview - double-cliquez plutôt que cliquer deux fois - double-cliquez pour la prévisualisation - - - Open File - Ouvrir le fichier - - - - QtC::QmlJS - - expected two numbers separated by a dot - est attendu deux nombres séparés par un point - - - package import requires a version number - l'importation d'un paquet a besoin d'un numéro de version - - - - QtC::ProjectExplorer - - Cannot start process: %1 - Impossible de démarrer le processus : %1 - - - Timeout after %1s. - Échéance après %1s. - - - The process crashed. - Le processus a crashé. - - - The process returned exit code %1: -%2 - Le processus a retourné le code %1 : -%2 - - - Error running '%1' in %2: %3 - Erreur lors de l'exécution de "%1" dans %2 : %3 - - - Building helper '%1' in %2 - - Compilation de l'assistant "%1" dans %2 - - - Building helper library '%1' in %2 - - Compilation de la bibliothèque d'assistance '%1' dans %2 - - - - Running %1 %2... - - Exécute %1 %2... - - - - Running %1 %2 ... - - Exécute %1 %2... - - - - %1 not found in PATH - - %1 non trouvé dans le PATH - - - - - QtC::Utils - - C++ - C++ - - - QML - QML - - - Debug port: - Port du débogage : - - - <a href="qthelp://com.nokia.qtcreator/doc/creator-debugging-qml.html">What are the prerequisites?</a> - <a href="qthelp://com.nokia.qtcreator/doc/creator-debugging-qml.html">Quels sont les prérequis?</a> - - - The command '%1' finished successfully. - La commande "%1' s"est terminée avec succès. - - - The command '%1' terminated with exit code %2. - La commande "%1's"est terminée avec le code de sortie %2. - - - The command '%1' terminated abnormally. - La commande "%1' s"est terminée de façon anormale. - - - The command '%1' could not be started. - La commande "%1" ne peut pas être démarrée. - - - The command '%1' did not respond within the timeout limit (%2 ms). - La commande "%1' n"a pas répondu dans le temps imparti (%2ms). - - - Process not Responding - Le processus ne réponds pas + Process Not Responding + Le processus ne répond pas The process is not responding. - Le processus ne réponds pas. + Le processus ne répond pas. - The process '%1' is not responding. - Le processus "%1" ne réponds pas. + The process "%1" is not responding. + Le processus « %1 » ne répond pas. - Would you like to terminate it? - Voulez-vous le terminer ? + Terminate the process? + Terminer le processus ? - - - QtC::ClassView - Class View - Ou est-ce un rapport avec la Vue ? (graphics/view) - Affichage de la classe + The command "%1" finished successfully. + La commande « %1 » s’est terminée avec succès. - - - QtC::Core - Activate %1 Pane - Activer le panneau %1 + The command "%1" terminated with exit code %2. + La commande « %1 » s’est terminée avec le code de sortie %1. - Hide Sidebar - Masquer la barre latérale + The command "%1" terminated abnormally. + La commande « %1 » s’est terminée de manière anormale. - - - SshConnection - Server and client capabilities don't match. Client list was: %1. -Server list was %2. - Les capacités du serveur et du client ne correspondent pas. La liste du client était : %1. -La liste du serveur était %2. + The command "%1" could not be started. + La commande « %1 » n’a pas pu être lancée. - - - QtC::Core - Invalid channel id %1 - Identifiant %1 du canal invalide - - - SSH Protocol error: %1 - Erreur dans le protocole SSH : %1 - - - Botan library exception: %1 - Exception dans la bibliothèque Botan : %1 - - - Invalid protocol version: Expected '2.0', got '%1'. - Version du protocole invalide :'2.0' attendue, "%1" detectée. - - - Invalid server id '%1'. - Identifiant de serveur invalide "%1". - - - Unexpected packet of type %1. - Paquet inattendu du type %1. - - - Could not read private key file: %1 - Impossible de lire le fichier de la clé privée : %1 - - - Password expired. - Mot de passe expiré. - - - Server rejected password. - Le serveur a rejeté le mot de passe. - - - Server rejected key. - Le serveur a rejeté la clé. - - - Server closed connection: %1 - Le serveur a fermé la connexion : %1 - - - Connection closed unexpectedly. - La connexion a été fermée de façon inattendu. - - - Timeout waiting for reply from server. - Temps limite dépassé lors de l'attente de la réponse du serveur. - - - - QtC::CodePaster - - Checking connection - Vérification de la connexion - - - Connecting to %1... - Connexion à %1... - - - - QtC::CppEditor - - Add %1 Declaration - Ajouter la déclaration %1 - - - Add Definition in %1 - Ajouter la définition dans %1 - - - Add Definition Here - Ajouter une définition ici - - - Add Definition Inside Class - Ajouter une définition dans la classe - - - Add Definition Outside Class - Ajouter une définition en dehors de la classe - - - No type hierarchy available - Aucune hiérarchie de type disponible - - - Bases - Bases - - - Derived - Dérivé - - - Type Hierarchy - Hiérarchie de type - - - C++ Symbols - Symboles C++ - - - C++ Symbols: - Symboles C++ : - - - Classes - Classes - - - Methods - Méthodes - - - Functions - Fonctions - - - Enums - Énumérations - - - Declarations - Déclarations - - - Scope: %1 -Types: %2 -Flags: %3 - Contexte : %1 -Types : %2 -Indicateurs : %3 - - - All - Tout - - - Projects - Projets - - - , - , - - - Types: - Types : - - - Projects only - Projets uniquement - - - All files - Tous les fichiers - - - - QtC::Debugger - - File and Line Number - Fichier et numéro de ligne - - - Function Name - Nom de la fonction - - - Break when C++ Exception is Thrown - Arrêt quand une exception C++ est lancée - - - Break when C++ Exception is Caught - Arrêt quand une exception C++ est reçue - - - Break when Function "main()" Starts - Arrêt quand la fonction "main()" commence - - - Break when a new Process is Forked - Arrêt quand un nouveau processus est forké - - - Break when a new Process is Executed - Arrêt quand un nouveau processus est exécuté - - - Break when a System Call is Executed - Arrêt quand un appel système est exécuté - - - Break on Data Access (Watchpoint) - Arrêt sur accès aux données (point d'observation) - - - File name and line number - Nom de fichier et numéro de ligne - - - Function name - Nom de fonction - - - Break on memory address - Arrêt sur adresse mémoire - - - Break when C++ exception is thrown - Arrêt quand une exception C++ est lancée - - - Break when C++ exception is caught - Arrêt quand une exception C++ est attrapée - - - Break when function "main" starts - Arrêt quand la fonction "main" commence - - - Break when a new process is forked - Arrêt sur fork d'un nouveau processus - - - Break when a new process is executed - Arrêt quand un nouveau processus est exécuté - - - Break when a system call is executed - Arrêt quand un appel système est exécuté - - - Break on data access at fixed address - Arrêt sur accès aux données à une adresse fixée - - - Break on data access at address given by expression - Arrêt sur accès aux données à une adresse donnée par l'expression - - - Break on QML signal handler - Arrêter sur gestionnaire de signal QML - - - Break when JavaScript exception is thrown - Arrêter lors de l'envoi d'une exception JavaScript - - - Debugger command to be executed when the breakpoint is hit. -GDB allows for specifying a sequence of commands separated by the delimiter '\n'. - La commande du débogueur à exécuter quand un point d'arrêt est rencontré. GDB autorise la spécification d'une séquence de commandes délimitées par '\n'. - - - <html><head/><body><p>Determines how the path is specified when setting breakpoints:</p><ul><li><i>Use Engine Default</i>: Preferred setting of the debugger engine.</li><li><i>Use Full Path</i>: Pass full path, avoiding ambiguities should files of the same name exist in several modules. This is the engine default for CDB and LLDB.</li><li><i>Use File Name</i>: Pass the file name only. This is useful when using a source tree whose location does not match the one used when building the modules. It is the engine default for GDB as using full paths can be slow with this engine.</li></ul></body></html> - <html><head/><body><p>Détermine comment le chemin est spécifié lors de la mise en place des points d'ârret : </p><ul><li><i>Utiliser le moteur par défaut</i> : paramètre conseillé pour le moteur de débogueur ; </li><li><i>Utiliser le chemin complet</i> : donne le chemin complet, en évitant les ambiguïtés, des fichiers du meme nom peuvent exister dans plusieurs modules. Il s'agit de la valeur par défaut du moteur CDB et LLDB.</li><li><i>Utiliser le nom de fichier</i> : donne le nom de fichier uniquement. Cela est utile quand vous utilisez un arbre de source où les chemins ne correspondent pas à ceux utilisé quand vous compilez les modules. Il s'agit de la valeur par défaut du moteur GDB et utiliser des chemins complets peuvent ralentir l'utilisation de ce moteur.</li></ul></body></html> - - - Function "main()" - Fonction "main()" - - - Specifying the module (base name of the library or executable) -for function or file type breakpoints can significantly speed up -debugger start-up times (CDB, LLDB). - Spécifier le module (nom de base de la bibliothèque ou de l'exécutable) pour la fonction ou les points d'arrêt du type de fichier peut grandement améliorer les performances au démarrage du débogueur (CDB, LLDB). - - - Edit Breakpoint Properties - Editer les propriétés du point d'arrêt - - - Basic - Basique - - - Break on QML signal emit - Point d'arrêt sur l'émission d'un signal QML - - - Breakpoint &type: - &Types de points d'arrêt : - - - &File name: - Nom de &fichier : - - - &Line number: - Numéro de &ligne : - - - &Enabled: - Activ&é : - - - &Address: - &Adresse : - - - Fun&ction: - Fon&ction : - - - Advanced - Avancé - - - T&racepoint only: - Point de &traçage uniquement : - - - &One shot only: - &Un seul déclenchement : - - - Pat&h: - Che&min : - - - &Module: - &Module : - - - &Command: - &Commande : - - - Use Engine Default - Utiliser le moteur par défaut - - - Use Full Path - Utiliser le chemin complet - - - Use File Name - Utiliser le nom de fichier - - - Debugger commands to be executed when the breakpoint is hit. -This feature is only available for GDB. - Commandes du débogueur à exécuter lorsque le point d'arrêt est atteint. -Cette fonctionnalité n'est disponible que pour GDB. - - - &Commands: - &Commandes : - - - C&ondition: - C&ondition : - - - &Ignore count: - Nombre de passages à &ignorer : - - - &Thread specification: - Spécification de &thread : - - - &Expression: - &Expression : - - - &Message: - &Message : - - - The console process '%1' could not be started. - Le processus de la console "%1' n"a pas pu être démarré. - - - Debugger Error - Erreur du débogueur - - - Failed to Start the Debugger - Échec lors du démarrage du débogueur - - - Separate Window - Fenêtre séparée - - - Image - Image - - - There is no CDB executable specified. - Il n'y a pas d'exécutable CDB spécifié. - - - CDB crashed - CDB a crashé - - - CDB exited (%1) - CDB a fermé (%1) - - - Unable to add expression - Impossible d'ajouter une expression - - - Interrupting is not possible in remote sessions. - L'interruption n'est pas possible dans les session distantes. - - - Trace point %1 (%2) in thread %3 triggered. - Point de traçage %1 (%2) dans le thread %3. - - - Conditional breakpoint %1 (%2) in thread %3 triggered, examining expression '%4'. - Point d'arrêt conditionnel %1 (%2) dans le thread %3 déclenché, examination de l'expression "%4". - - - Malformed stop response received. - Réponse au stop malformée reçue. - - - Switching to main thread... - Basculer vers le thread principal... - - - Value %1 obtained from evaluating the condition of breakpoint %2, stopping. - Valeur %1 obtenue par l'évaluation de la condition du point d'arrêt %2, arrêt. - - - Value 0 obtained from evaluating the condition of breakpoint %1, continuing. - Valeur nulle obtenue de l'évaluation de la condition du point d'arrêt %1, suite. - - - "Select Widget to Watch": Please stop the application first. - "Sélectionner le widget à observer" : veuillez d'abord arrêter l'application. - - - "Select Widget to Watch": Not supported in state '%1'. - "Sélectionner le widget à observer" : non supporté dans l'état "%1". - - - Ignoring initial breakpoint... - Point d'arrêt initial ignoré… - - - Attempting to interrupt. - Tentative d'interruption. - - - Debugger Test - Test du débogueur - - - Launching - Lancement - - - %1 (explicitly set in the Debugger Options) - %1 (définie explicitement dans les options du débogueur) - - - This debugger cannot handle user input. - Ce débogueur ne peut pas gérer l'entrée utilisateur. - - - Watchpoint %1 (%2) at 0x%3 triggered. - Point d'observation %1 (%2) à 0x%3. - - - Internal watchpoint %1 at 0x%2 triggered. - Point d'observation interne %1 à 0x%2. - - - Watchpoint %1 (%2) at 0x%3 in thread %4 triggered. - Point d'observation %1 (%2) à 0x%3 dans le thread %4. - - - Internal watchpoint %1 at 0x%2 in thread %3 triggered. - Point d'observation interne %1 à 0x%2 dans le thread %3. - - - Data breakpoint %1 (%2) at %3 triggered. - Point d'arrêt sur les données %1 (%2) à %3. - - - Internal data breakpoint %1 at %2 triggered. - Point d'arrêt interne sur les données %1 à %2. - - - Data breakpoint %1 (%2) at %3 in thread %4 triggered. - Point d'arrêt sur les données %1 (%2) à %3.dans le thread %4. - - - Internal data breakpoint %1 at %2 in thread %3 triggered. - Point d'arrêt interne sur les données %1 à %2 dans le thread %3. - - - Data breakpoint %1 (%2) at 0x%3 triggered. - Point d'arrêt sur les données %1 (%2) à 0x%3. - - - Internal data breakpoint %1 at 0x%2 triggered. - Point d'arrêt interne sur les données %1 à 0x%2. - - - Data breakpoint %1 (%2) at 0x%3 in thread %4 triggered. - Point d'arrêt sur les données %1 (%2) à 0x%3.dans le thread %4. - - - Internal data breakpoint %1 at 0x%2 in thread %3 triggered. - Point d'arrêt interne sur les données %1 à 0x%2 dans le thread %3. - - - Stopped at breakpoint %1 (%2) in thread %3. - Arrêté au point d'arret %1 (%2) dans le thread %3. - - - Stopped at internal breakpoint %1 in thread %2. - Arrêté à un point d'arrêt interne %1 dans le thread %2. - - - <Unknown> - name - <Inconnu> - - - <Unknown> - meaning - <Inconnu> - - - <p>The inferior stopped because it received a signal from the Operating System.<p><table><tr><td>Signal name : </td><td>%1</td></tr><tr><td>Signal meaning : </td><td>%2</td></tr></table> - <p>L'inférieur a stoppé car il a reçu un signal du système d'exploitation.</p><table><tr><td>Nom du signal : </td><td>%1</td></tr><tr><td>Signification du signal : </td><td>%2</td></tr></table> - - - This does not seem to be a "Debug" build. -Setting breakpoints by file name and line number may fail. - Ceci ne semble pas être une compilation "Debug". -Mettre des points d'arrêt par nom de fichier et numéro de ligne pourrait échouer. - - - Setup failed. - L'installation a échouée. - - - Loading finished. - Le chargement est terminé. - - - Run failed. - Exécution a échouée. - - - Running. - Exécution. - - - Run requested... - Exécution démandée... - - - Stopped: "%1" - Arrêté : "%1" - - - Stopped: %1 (Signal %2). - Arrêté : %1 (signal %2). - - - Stopped in thread %1 by: %2. - Interrompu dans le thread %1 par : %2. - - - Interrupted. - Interrompu. - - - <Unknown> - name - <Inconnu> - - - <Unknown> - meaning - <Inconnu> - - - Signal received - Signal reçu - - - <p>The inferior stopped because it triggered an exception.<p>%1 - <p>L'inférieur s'est arrêté parce qu'il a rencontré une exception.</p><p>%1</p> - - - Exception Triggered - Exception déclenchée - - - Found. - Trouvé. - - - Not found. - Non trouvé. - - - -Section %1: %2 - -Section %1 : %2 - - - Taking notice of pid %1 - Pas sur de la traduction... - Prends note du pid %1 - - - Run to Address 0x%1 - Aller à l'adresse 0x%1 - - - Run to Line %1 - Aller à la ligne %1 - - - Jump to Address 0x%1 - Sauter à l'adresse 0x%1 - - - Jump to Line %1 - Sauter à la ligne %1 - - - Option '%1' is missing the parameter. - Option "%1" : le paramètre est manquant. - - - Only one executable allowed! - Seulement un exécutable autorisé ! - - - The parameter '%1' of option '%2' does not match the pattern <server:port>@<executable>@<architecture>. - Le paramètre '%1' de l'option "%2" ne correspond pas au motif <server:port>@<executable>@<architecture>. - - - The parameter '%1' of option '%2' does not match the pattern <handle>:<pid>. - Le paramètre '%1' de l'option "%2" ne correspond pas au motif <handle>:<pid>. - - - The parameter '%1' of option '%2' is not a number. - Le paramètre '%1' de l'option "%2' n"est pas un nombre. - - - Invalid debugger option: %1 - Option du débogueur invalide : %1 - - - The application requires the debugger engine '%1', which is disabled. - L'application nécessite le débogueur "%1" qui est desactivé. - - - Some breakpoints cannot be handled by the debugger languages currently active, and will be ignored. - Certains points d'arrêts ne peuvent pas être gérés par les langages du débogueur actif et seront ignorés. - - - Not enough free ports for QML debugging. - Pas assez de ports libres pour le débogage QML. - - - Not enough free ports for QML debugging. - Pas assez de ports disponibles pour le débogage QML. - - - The debugger engine '%1' is disabled. - Le moteur de débogage "%1" est désactivé. - - - The debugger engine '%1' required for debugging binaries of the type '%2' is not configured correctly. - Le moteur de débogage '%1' requis pour des binaires de type "%2' n"est pas configuré correctement. - - - None of the debugger engines '%1' capable of debugging binaries of the type '%2' is configured correctly. - Aucun des moteurs de débogage '%1' capable de déboguer des binaires de type "%2' n"est configuré correctement. - - - The preferred debugger engine for debugging binaries of type '%1' is not available. -The debugger engine '%2' will be used as a fallback. -Details: %3 - Le moteur de débogage préféré pour les binaires de type '%1' n'est pas disponible. Le moteur de débogage "%2" sera utilisé. Détails : %3 - - - Cannot debug '%1' (tool chain: '%2'): %3 - Impossible de déboguer '%1' (chaîne d'outils : "%2") : %3 - - - Starting debugger '%1' for tool chain '%2'... - Lancer le débogueur '%1' pour la chaîne d'outils "%2"... - - - No executable specified. - Aucun exécutable n'est spécifié. - - - &Show this message again. - &Montrer ce message de nouveau. - - - Debugging starts - Début du débogage - - - Debugging has failed - Échec du débogage - - - Debugging has finished - Le débogage est fini - - - No executable specified. - - Pas d'exécutable spécifié. - - - Debugging starts - - Début du débogage - - - - Debugging has failed - - Échec du débogage - - - - Debugging has finished - - Fin du débogage - - - - A debugging session is still in progress. Terminating the session in the current state can leave the target in an inconsistent state. Would you still like to terminate it? - Une session de débogage est en cours. Terminer la session dans l'état courant risque de laisser la cible dans un état incohérent. Êtes-vous sûr de vouloir terminer la session ? - - - Close Debugging Session - Fermer la session de débogage - - - Connection could not be established. - La connexion ne peut être établie. - - - Connection failure: %1. - Échec de la connexion : %1. - - - Could not create FIFO. - Impossible de créer le FIFO. - - - Application output reader unexpectedly finished. - Le lecteur de la sortie de l'application s'est terminé de façon inattendue. - - - Remote GDB failed to start. - Le GDB distant n'a pas pu démarrer. - - - Remote GDB crashed. - Le GDB distant a crashé. - - - Remote gdb failed to start. - Échec du lancement de gdb distant. - - - Remote gdb crashed. - Gdb distant a crashé. - - - Clear Contents - Effacer le contenu - - - Save Contents - Sauver le contenu - - - Reload Debugging Helpers - Recharger les aides au débogage - - - Write Failure - Échec de l'écriture - - - Unable to write log contents to '%1': %2 - Impossible d'écrire le contenu du journal d'événements dans "%1" : %2 - - - Type Ctrl-<Return> to execute a line. - Taper Ctrl-<Retour> pour exécuter une ligne. - - - Debugger Log - Journal de débogage - - - Repeat last command for debug reasons. - Répétition de la dernière commande pour des raisons de débogage. - - - Log File - Réaliser un log du fichier - - - Internal Name - Nom interne - - - Full Name - Nom complet - - - - QtC::Git - - Set the environment variable HOME to '%1' -(%2). -This causes msysgit to look for the SSH-keys in that location -instead of its installation directory when run outside git bash. - Définir la variable d'environnement HOME à '%1' -(%2). -Cela permet à msysgit de chercher les clés SSH à cet endroit -plutôt que dans le répertoire d'installation lors d'une exècution en dehors de la console git. - - - not currently set - Actuellement indéfini - - - currently set to '%1' - Actuellement défini à "%1" - - - Git Repository Browser Command - Commande de navigation du dépôt Git - - - - QtC::Help - - Qt Creator Offline Help - Aide hors ligne de Qt Creator - - - - QtC::Core - - Close Document - Fermer le document - - - - QtC::Help - - Copy Full Path to Clipboard - Copier le chemin complet dans le presse papier - - - Online Documentation - Documentation en ligne - - - Web Search - Recherche Internet - - - - QtC::ImageViewer - - Ctrl++ - Ctrl++ - - - Ctrl+- - Ctrl+- - - - Ctrl+0 - Ctrl+0 - - - Meta+0 - Meta+0 - - - Fit To Screen - Ajuster à la taille de l'écran - - - Ctrl+= - Ctrl+= - - - Switch Background - Basculer l'arrière-plan - - - Switch Outline - Basculer le contour - - - Toggle Animation - Activer/désactiver l'animation - - - Switch background - Basculer l'arrière-plan - - - Ctrl+[ - Ctrl+[ - - - Switch outline - Basculer le contour - - - Ctrl+] - Ctrl+] - - - - QtC::ProjectExplorer - - %1 Steps - %1 is the name returned by BuildStepList::displayName - Étapes %1 - - - No %1 Steps - Aucune étape %1 - - - Add %1 Step - Ajouter l'étape %1 - - - Move Up - Déplacer vers le haut - - - Disable - Désactiver - - - Move Down - Déplacer vers le bas - - - Remove Item - Supprimer l'élément - - - Removing Step failed - Échec de la suppression de l'étape - - - Cannot remove build step while building - Impossible de supprimer une étape de compilation pendant la compilation - - - No Build Steps - Aucune étape de compilation - - - error: - Task is of type error - erreur : - - - warning: - Task is of type warning - avertissement : - - - error: - Task is of type: error - erreur : - - - warning: - Task is of type: warning - avertissement : - - - &Copy - Name of the action triggering the copytaskhandler - &Copier - - - Copy task to clipboard - Copier la tâche dans le presse papier - - - error: - Task is of type: error - erreur : - - - warning: - Task is of type: warning - avertissement : - - - Deploy - Display name of the deploy build step list. Used as part of the labels in the project window. - Déploiement - - - Deploy locally - Default DeployConfiguration display name - Déployer localement - - - Application Still Running - Application toujours en cours d'exécution - - - %1 is still running. - %1 est toujours en cours d'exécution. - - - Force it to quit? - La forcer à quitter ? - - - PID %1 - PID %1 - - - Invalid - Invalid process handle. - Invalide - - - <html><head/><body><center><i>%1</i> is still running.<center/><center>Force it to quit?</center></body></html> - <html><head/><body><center><i>%1</i> fonctionne toujours.<center/><center>Le forcer à quitter ? </center></body></html> - - - Force Quit - Forcer quitter - - - Keep Running - Continuer l'exécution - - - Do not ask again - Ne plus me demander - - - &Show in editor - &Afficher dans l'éditeur - - - Show task location in an editor - Afficher la localisation de la tâche dans un édtieur - - - &Show in Editor - Montrer dans l'éditeur (&S) - - - Show in Editor - Afficher dans l'éditeur - - - Show task location in an editor. - Montre l'emplacement de la tâche dans un éditeur. - - - Show &Output - Afficher la s&ortie - - - Show output generating this issue. - Afficher la sortie qui a généré ce problème. - - - O - O - - - No deployment - Pas de déploiement - - - Deploy to Maemo device - myzu : le ou un ? john : un - Déployer sur un périphérique Maemo - - - Deploy to Symbian device - myzu : le ou un ? - Déployer sur un périphérique Symbian - - - &Annotate - &Annoter - - - Annotate using version control system - Annoter en utilisant le système de controle de version - - - - QmlDesigner::TextToModelMerger - - Unsupported import: -import QtQuick 1.0 use import Qt 4.7 instead - les "import xx" seraient-ils du code QML ? Oui, c'est du code QML - Import non supporté : -utilisez import Qt 4.7 au lieu de import QtQuick 1.0 - - - No import statements found - Pas de déclaration d'importation trouvée - - - Unsupported QtQuick version - Version de Qt Quick non supportée - - - This .qml file contains features which are not supported by Qt Quick Designer - Ce fichier .qml contient des fonctionnalités qui ne sont pas supportées par Qt Quick Designer - - - - QtC::QmlJSEditor - - Move Component into separate file - déplacer ou déplace ? John : Difficle sans context, allons pour déplace. dourouc : en voyant l'autre, le contexte doit être fort semblable, donc indicatif. - Déplace le composant dans un fichier séparé - - - Move Component into '%1.qml' - Déplace le composant dans "%1.qml" - - - Move Component into Separate File - Déplace le composant dans un fichier séparé - - - Choose a path - Choisir un chemin - - - Invalid component name - Nom de composant invalide - - - Invalid path - Chemin invalide - - - Component name: - Nom du composant : - - - Path: - Chemin : - - - QML/JS Usages: - Utilisations QML/JS : - - - Searching - Recherche - - - Show All Bindings - myzu : faut-il traduire binding ? John : Non - Montrer tous les bindings - - - Split initializer - Fractionner l'initialisation - - - Split Initializer - Fractionner l'initialisation - - - - QmlJSInspector::Internal::QmlInspectorToolbar - - Apply Changes on Save - Appliquer les changements à la sauvegarde - - - Observer Mode - Mode observateur - - - Play/Pause Animations - Lire/mettre en pause les animations - - - Select - Sélectionner - - - Zoom - Zoom - - - Color Picker - pas trouvé mieux que "sélecteur" :/ dourouc : c'est normal, il n'y a pas ! - Sélecteur de couleur - - - Live Preview Changes in QML Viewer - visualisateur ou visualiseur ? john : j'opte pour le second (feeling) - Aperçu en direrct des changements dans le visualiseur QML - - - Animation Speed - Vitesse de l'animation - - - 1x - 1x - - - 0.5x - 0.5x - - - 0.25x - 0.25x - - - 0.125x - 0.125x - - - 0.1x - 0.1x - - - Pause - Pause - - - - QmlJSInspector::Internal::ContextCrumblePath - - [no context] - [pas de contexte] - - - - QmlJSInspector::Internal::InspectorUi - - Context Path - ou du contexte ? - Chemin du contexte - - - QML Inspector - Inspecteur QML - - - QML Observer - Observateur QML - - - Filter properties - Propriétés du filtre - - - - QmlJSInspector::Internal::QmlJSLiveTextPreview - - You changed a QML file in Live Preview mode, which modifies the running QML application. In case of unexpected behavior, please reload the QML application. - Vous avez changé un fichier QML en mode aperçu en direct, ce qui modifie l'application QML en cours d'exécution. En cas de comportement inattendu, veuillez redémarrer l'application QML. - - - You changed a QML file in Live Preview mode, which modifies the running QML application. In case of unexpected behavior, please reload the QML application. - Vous avez changé un fichier QML en mode aperçu en direct, ce qui modifie l'application QML en cours d'exécution. En cas de comportement inattendu, veuillez redémarrer l'application QML. - - - Disable Live Preview - Désactiver l'aperçu en direct - - - The %1 attribute at line %2, column %3 cannot be changed without reloading the QML application. - L'attribut %1 à la ligne %2, colonne %3 ne peut pas être modifié sans redémarrer l'application QML. - - - The %1 element at line %2, column %3 cannot be changed without reloading the QML application. - L'élément %1 à la ligne %2, colonne %3 ne peut pas être modifié sans redémarrer l'application QML. - - - You can continue debugging, but behavior can be unexpected. - Le débogage peut continuer mais le comportement peut être inattendu. - - - Reload - Recharger - - - - QmlJSInspector::Internal::QmlJSObjectTree - - Go to file - Aller au fichier - - - Url: - Url : - - - - QmlJSInspector::ToolBarColorBox - - Copy Color - Copier la couleur - - - - QtC::QmakeProjectManager - - Add Library - Ajouter une bibliothèque - - - Summary - Résumé - - - Library Type - Type de bibliothèque - - - Choose the type of the library to link to - Choisir le type de bibliothèque pour l'édition de liens - - - System library - Bibliothèque système - - - Links to a system library. -Neither the path to the library nor the path to its includes is added to the .pro file. - Faire un lien vers une bibliothèque système. -Ni le chemin vers la bibliothèque, ni le chemin vers ses inclusion ne seront ajoutés au fichier .pro. - - - System package - Paquet système - - - Links to a system library using pkg-config. - Lie à une bibliothèque système en utilisant pkg-config. - - - External library - Bibliothèque externe - - - Links to a library that is not located in your build tree. -Adds the library and include paths to the .pro file. - Avant : Fait l'édition de liens avec une bibliothèque qui n'est pas dans votre arbre de compilation. -Ajoute la bibliothèque et les chemins d'inclusion dans le fichier .pro. - Faire un lien vers une bibliothèque qui n'est pas dans votre arbre de compilation. -Ajoute la bibliothèque et les chemins d'inclusion dans le fichier .pro. - - - Internal library - Bibliothèque interne - - - Links to a library that is located in your build tree. -Adds the library and include paths to the .pro file. - Faire un lien vers une bibliothèque localisée dans votre arbre de compilation. -Ajoute la bibliothèque et les chemins d'inclusion dans le fichier .pro. - - - System Library - Bibliothèque système - - - Specify the library to link to - Spécifier la bibliothèque vers laquelle faire un lien - - - System Package - Paquet système - - - Specify the package to link to - Spécifie le paquet à lier - - - External Library - Bibliothèque externe - - - Specify the library to link to and the includes path - Spécifier la bibliothèque vers laquelle faire un lien et les chemins d'inclusion - - - Internal Library - Bibliothèque interne - - - Choose the project file of the library to link to - Choisir le fichier projet de la bibliothèque vers laquelle faire un lien - - - The following snippet will be added to the<br><b>%1</b> file: - Le fragment de code suivant va être ajouté au <br> fichier <b>%1</b> : - - - %1 Dynamic - %1, c'est linkage(tr("Linkage:")), donc "edition de lien". - %1 dynamique - - - %1 Static - %1 statique - - - %1 Framework - traduire framework ? pas certain que ça ait un sens en français dans le context OSX. John : non on ne traduit pas - Framework %1 - - - %1 Library - On inverse l'ordre non ? - Bibliothèque %1 - - - Only available for Qt for Desktop and Qt for Qt Simulator. - Seulement disponible pour Qt for Desktop et Qt for Qt Simulator. - - - Only available for Qt 4.7.1 or newer. - Seulement disponible pour Qt 4.7.1 ou plus récent. - - - Not needed. - Non nécessaire. - - - Private headers are missing for this Qt version. - Les en-têtes privés de cette version de Qt sont manquants. - - - qmldump - nom de l'outil, donc on ne traduit pas - qmldump - - - - QtC::ProjectExplorer - - qmldump could not be built in any of the directories: -- %1 - -Reason: %2 - qmldump n'a pu être créé dans aucun des répertoires : -- %1 - -Raison : %2 - - - - QmlDumpBuildTask - - Building helper - Assistant de compilation - - - - QtC::QmakeProjectManager - - Only available for Qt for Desktop or Qt for Qt Simulator. - Seulement disponible pour Qt for Desktop et Qt for Qt Simulateur. - - - QMLObserver - QMLObserver - - - - QtC::ProjectExplorer - - QMLObserver could not be built in any of the directories: -- %1 - -Reason: %2 - QMLObserver ne peut être compilé dans aucun de ces répertoires : -- %1 - -Raison : %2 - - - - QtC::QmakeProjectManager - - Passphrase: - Terme anglais utilisé pour un mot de passe généralement long et plus sécurisé - Mot de passe : - - - Save passphrase - Enregistrer le mot de passe - - - This is an insecure option. The password will be saved as plain text. - Ceci est une option insécurisée. Le mot de passe sera envoyé en texte brut. - - - This is an insecure option. The password will be saved as a plain text. - Ceci est une option non sécurisée. Le mot de passe va être enregistré en texte brut. - - - Passphrase for %1 - Mot de passe pour %1 - - - Deploy %1 to Symbian device - Déployer %1 sur périphérique Symbian - - - Deploy to Symbian device - Déployer sur périphérique Symbian - - - Silent installation - Installation silencieuse - - - Serial: - Numéro de série : - - - WLAN: - WLAN : - - - TRK - TRK - - - CODA - CODA - - - <a href="qthelp://com.nokia.qtcreator/doc/creator-developing-symbian.html">What are the prerequisites?</a> - <a href="qthelp://com.nokia.qtcreator/doc/creator-developing-symbian.html">Quels sont les prérequis ?</a> - - - Silent installation is an installation mode that does not require user's intervention. In case it fails the non silent installation is launched. - L'installation silencieuse est un mode d'installation qui ne nécessite pas d'intervention d'un utilisateur. En cas d'échec, une installation non silencieuse est lancée. - - - Installation drive: - dourouc : disque ou partition (ou point de montage) ou... ? - Disque d'installation : - - - Device Agent - Agent de périphérique - - - Serial port: - Port série : - - - Communication Channel - Canal de communication - - - Address: - Adresse : - - - Connecting - Connexion - - - Unable to create CODA connection. Please try again. - Impossible de créer la connexion CODA. Veuillez réessayer. - - - Currently there is no information about the device for this connection type. - Actuellement, il n'y a pas d'information sur le périphérique pour ce type de connexion. - - - No device information available - Pas d'information sur le périphérique disponible - - - Qt version: - Version de Qt : - - - Not installed on device - Pas installé sur le périphérique - - - Unrecognised Symbian version 0x%1 - Version de Symbian non reconnue : 0x%1 - - - Unrecognised S60 version 0x%1 - Version de S60 non reconnue : 0x%1 - - - OS version: - Version de l'OS : - - - unknown - inconnue - - - ROM version: - Version de la ROM : - - - Release: - Sortie : - - - CODA version: - Version de CODA : - - - Error reading CODA version - Erreur lors de la lecture de la version de CODA - - - Qt Mobility version: - Version de Qt Mobility : - - - Error reading Qt Mobility version - Erreur à la lecture de la version de Qt Mobility - - - Qt Quick components version: - Version des composants Qt Quick : - - - Not installed - Non installés - - - QML Viewer version: - Version de QML Viewer : - - - QtMobility version: - Version de Qt Mobility : - - - Error reading QtMobility version - Erreur lors de la lecture de la version de Qt Mobility - - - Screen size: - Taille de l'écran : - - - Deploy - Qt4 Deploystep display name - Déployer - - - No package has been found. Please specify at least one installation package. - Pas de paquet trouvé. Veuillez spécifier au moins un paquet d'installation. - - - '%1': Package file not found - dourouc : du paquet ou de paquet ? - "%1" : fichier de paquet non trouvé - - - Failed to find package %1 - Impossible de trouver le paquet %1 - - - Deploying application to '%2'... - Déploiement de l'application sur "%2"... - - - Copying "%1"... - Copie de "%1"... - - - No device is connected. Please connect a device and try again. - Pas de périphérique connecté. Veuillez en connecter un et réessayer. - - - No address for a device has been defined. Please define an address and try again. - Pas d'adresse de périphérique définie. Veuillez en définir une et réessayer. - - - Deploy SIS Package - Qt4 Deploystep display name - Déployer le paquet SIS - - - No package has been found. Specify at least one installation package. - Pas de paquet trouvé. Spécifiez au moins un paquet d'installation. - - - No device is connected. Connect a device and try again. - Pas de périphérique connecté. Connectez un périphérique et réessayer. - - - No address for a device has been defined. Define an address and try again. - Pas d'adresse de périphérique définie. Veuillez en définir une et réessayer. - - - Deploying application to '%1'... - Déploiement de l'application sur "%1"... - - - No such port - Aucun port de ce type - - - Could not open serial device: %1 - Impossible d'ouvrir le périphérique en série : %1 - - - Connecting to %1:%2... - Connexion à %1 : %2... - - - Error: %1 - Erreur : %1 - - - Installing package "%1" on drive %2:... - Installation du paquet "%1" sur le disque %2... - - - Continue the installation on your device. - Continuez l'installation sur votre périphérique. - - - A timeout while deploying has occurred. CODA might not be responding. Try reconnecting the device. - Le délai d'attente a été dépassé pendant le déploiement. CODA peut ne pas répondre. Veuillez reconnecter le périphérique. - - - Please continue the installation on your device. - Veuillez continuer l'installation sur votre périphérique. - - - Could not open remote file: %1 - Impossible d'ouvrir le fichier distant : %1 - - - Internal error: No filehandle obtained - Erreur interne : aucun gestionnaire de fichier obtenu - - - Could not open local file %1: %2 - Impossible d'ouvrir le fichier local %1 : %2 - - - Installation has finished - L'installation s'est terminée - - - Installation failed: %1; see %2 for descriptions of the error codes - L'installation a échoué : %1, voir %2 pour les descriptions des codes d'erreur - - - Failed to close the remote file: %1 - Échec de la fermeture du fichier distant : %1 - - - Installation - Installation - - - Deployment has been cancelled. - Déployement annulé. - - - Copy progress: %1% - Copie en cours : %1 % - - - SBSv2 build log - Journal de compilation de SBSv2 - - - The file '%1' is not a SBSv2 log file. - Le fichier "%1' n"est pas un journal de compilation de SBSv2. - - - Running command: %1 - - Exécute la commande : %1 - - - - Recipe %1 failed with exit code %2. - %1 is the SBSv2 build recipe name, %2 the return code of the failed command - je vois vraiment pas ce que recipe (recette) viens faire ici... dourouc : certains parlent bien de spells, donc bon... une recette, c'ets une liste d'instructions à suivre, ça peut se comprendre mais pas vraiment se traduire tel quel... - Échec de %1 avec comme code de retour %2. - - - Deploy to Maemo device - Déployer sur périphérique Maemo - - - Could not open desktop file template - Impossible d'ouvrir le fichier template d'ordinateur de bureau - - - Could not open main.cpp template '%1'. - Impossible d'ouvrir le template main.cpp "%1". - - - Could not open project file template '%1'. - Impossible d'ouvrir le fichier template de projet "%1". - - - Could not open template file '%1'. - Impossible d'ouvrir le fichier template "%1". - - - Application Options - Options de l'application - - - - MobileAppWizard - - Mobile Qt Application - Application Qt pour mobiles - - - Creates a Qt application optimized for mobile devices with a Qt Designer-based main window. - -Preselects Qt for Simulator and mobile targets if available. - Crée une application Qt optimisée pour les mobiles avec une fenêtre principale conçue dans Qt Designer. - -Présélectionne la version de Qt pour le simulateur et les mobiles si disponible. - - - - QtC::QmakeProjectManager - - The file is not a valid image. - Le fichier n'est pas une image valide. - - - The icon has an invalid size. - L'icône a une taille invalide. - - - Icon unusable - Icône inutilisable - - - The QML import path '%1' cannot be found. - Le chemin d'import QML "%1" est introuvable. - - - The QML module '%1' cannot be found. - Le module QML "%1" est introuvable. - - - Invalid '%1' entry in '%2' of module '%3'. - Entrée '%1' invalide dans '%2' du module "%3". - - - No .pro file for plugin '%1' can be found. - Aucun fichier .pro n'a été trouvé pour le plug-in "%1". - - - No .pro file for plugin '%1' cannot be found. - Le fichier .pro du plug-in "%1" est introuvable. - - - Could not write file '%1'. - Impossible d'enregistrer le fichier "%1". - - - New Qt Quick Application - Nouvelle application Qt Quick - - - This wizard generates a Qt Quick application project. - Cet assistant génère un projet pour une application Qt Quick. - - - Component Set - Ensemble de composant - - - Select existing QML file - Sélectionner un fichier QML existant - - - Application Type - Type d'application - - - QML Sources - Sources QML - - - Qt Quick Application - Application Qt Quick - - - Creates a Qt Quick application project that can contain both QML and C++ code. - Créer un projet d'application Qt Quick qui peut contenir du code QML et C++. - - - - Creates a Qt Quick application project that can contain both QML and C++ code and includes a QDeclarativeView. - -You can build the application and deploy it on desktop and mobile target platforms. For example, you can create signed Symbian Installation System (SIS) packages for this type of projects. Moreover, you can select to use a set of premade UI components in your Qt Quick application. To utilize the components, Qt 4.7.3 or newer is required. - Crée un projet application Qt Quick, qui peut contenir du code QML ainsi que du code C++ et inclue une QDeclarativeView. - -Vous pouvez construire l'application et la déployer sur un ordinateur de bureau ou des plateformes mobiles. Par exemple, vous pouvez créer un paquet "Symbian Installation System" (SIS) signé avec ce type de projets. De plus, vous pouvez choisir d'utiliser un ensemble de composants d'interface préfabriqués dans votre application Qt Quick. Pour les utiliser, Qt 4.7.3 ou supérieur est requis. - - - Creates a Qt Quick application project that can contain both QML and C++ code and includes a QDeclarativeView. - -You can build the application and deploy it on desktop and mobile target platforms. For example, you can create signed Symbian Installation System (SIS) packages for this type of projects. - Crée un projet application Qt Quick, qui peut contenir du code QML ainsi que du code C++ et inclue une QDeclarativeView. - -Vous pouvez construire l'application et la déployer sur un ordinateur de bureau ou des plateformes mobiles. Par exemple, vous pouvez créer un paquet "Symbian Installation System" (SIS) signé avec ce type de projets. - - - Creates a Qt Quick application project that can contain both QML and C++ code and includes a QDeclarativeView. - - - Créer un projet d'application Qt Quick qui peut contenir du code QML et C++ et qui inclut une QDeclarativeView. - - - - - Qt Quick Application (Built-in Elements) - Application Qt Quick (éléments de base) - - - The built-in elements in the QtQuick namespace allow you to write cross-platform applications with a custom look and feel. - -Requires <b>Qt 4.7.0</b> or newer. - Les éléments de base dans l'espace de nommage QtQuick vous permettent d'écrire des applications multi-plateformes avec un aspect personnalisé. - -Requiert <b>Qt 4.7.0</b> ou plus récent. - - - Qt Quick Application for Symbian - Application Qt Quick pour Symbian - - - The Qt Quick Components for Symbian are a set of ready-made components that are designed with specific native appearance for the Symbian platform. - -Requires <b>Qt 4.7.4</b> or newer, and the component set installed for your Qt version. - Les composants Qt Quick pour Symbian constituent un ensemble de composants prêts à l'emploi qui sont conçus avec l'apparance native pour la plateforme Symbian. - -Requiert <b>Qt 4.7.4</b> ou plus récent et l'ensemble des composants d'installés pour votre version de Qt. - - - Qt Quick Application for MeeGo Harmattan - Application Qt Quick pour MeeGo Harmattan - - - Creates a Qt Quick 1 application project that can contain both QML and C++ code and includes a QDeclarativeView. - - - Créer un projet d'application Qt Quick 1 qui peut contenir du code QML et C++ et qui inclut une QDeclarativeView. - - - - - Qt Quick 1 Application (Built-in Elements) - Application Qt Quick 1 (éléments de base) - - - The built-in elements in the QtQuick 1 namespace allow you to write cross-platform applications with a custom look and feel. - -Requires <b>Qt 4.7.0</b> or newer. - Les éléments de base dans l'espace de noms QtQuick 1 permettent d'écrire des applications multiplateformes avec un aspect personnalisé. - -Requiert <b>Qt 4.7.0</b> ou plus récent. - - - Qt Quick 2 Application (Built-in Elements) - Application Qt Quick 2 (éléments de base) - - - Creates a Qt Quick 2 application project that can contain both QML and C++ code and includes a QQuickView. - -The built-in elements in the QtQuick 2 namespace allow you to write cross-platform applications with a custom look and feel. - -Requires <b>Qt 5.0</b> or newer. - Créer un projet d'application Qt Quick 1 qui peut contenir du code QML et C++ et qui inclut une QDeclarativeView. - -Les éléments de base dans l'espace de noms QtQuick 2 permettent d'écrire des applications multiplateformes avec un aspect personnalisé. - -Requiert <b>Qt 5.0</b> ou plus récent. - - - Creates a Qt Quick 2 application project that can contain both QML and C++ code and includes a QQuickView. - - - Créer un projet d'application Qt Quick 2 qui peut contenir du code QML et C++ et inclut une QQuickView. - - - - - Qt Quick 1 Application (Built-in Types) - Application Qt Quick 1 (Types de base) - - - The built-in QML types in the QtQuick 1 namespace allow you to write cross-platform applications with a custom look and feel. - -Requires <b>Qt 4.7.0</b> or newer. - Les éléments de base dans l'espace de noms Qt Quick 1 permettent d'écrire des applications multiplateformes avec un aspect personnalisé. - -Requiert <b>Qt 4.7.0</b> ou plus récent. - - - Qt Quick 2 Application (Built-in Types) - Application Qt Quick 2 (Types de base) - - - The built-in QML types in the QtQuick 2 namespace allow you to write cross-platform applications with a custom look and feel. - -Requires <b>Qt 5.0</b> or newer. - Les éléments de base dans l'espace de noms Qt Quick 2 permettent d'écrire des applications multiplateformes avec un aspect personnalisé. - -Requiert <b>Qt 5.0</b> ou plus récent. - - - Qt Quick 1 Application for MeeGo Harmattan - Application Qt Quick 1 pour MeeGo Harmattan - - - The Qt Quick Components for MeeGo Harmattan are a set of ready-made components that are designed with specific native appearance for the MeeGo Harmattan platform. - -Requires <b>Qt 4.7.4</b> or newer, and the component set installed for your Qt version. - Les composants Qt Quick pour MeeGo Harmattan constituent un ensemble de composants prêts à l'emploi qui sont conçus avec l'apparance native pour la plateforme MeeGo Harmattan. - -Requiert <b>Qt 4.7.4</b> ou plus récent et l'ensemble des composants d'installés pour votre version de Qt. - - - Qt Quick 1 Application (from Existing QML File) - Application Qt Quick 1 (à partir d'un fichier QML existant) - - - Qt Quick 2 Application (from Existing QML File) - Application Qt Quick 2 (à partir d'un fichier QML existant) - - - Creates a deployable Qt Quick application from existing QML files. All files and directories that reside in the same directory as the main .qml file are deployed. You can modify the contents of the directory any time before deploying. - -Requires <b>Qt 5.0</b> or newer. - Créer une application Qt Quick déployable à partir de fichiers QML existants. Tous les fichiers et répertoires qui sont dans le même répertoire que le fichier .qml principal seront déployés. Vous pouvez modifier le contenu du répertoire à n'importe quel moment avant le déploiement. - -Requiert <b>Qt 5.0</b> ou plus récent. - - - Qt Quick Application (from Existing QML File) - Application Qt Quick (à partir d'un fichier QML existant) - - - Creates a deployable Qt Quick application from existing QML files. All files and directories that reside in the same directory as the main .qml file are deployed. You can modify the contents of the directory any time before deploying. - -Requires <b>Qt 4.7.0</b> or newer. - Créer une application Qt Quick déployable à partir de fichiers QML existants. Tous les fichiers et répertoires qui sont dans le même répertoire que le fichier .qml principal sont déployés. Vous pouvez modifier le contenu du répertoire à n'importe quel moment avant le déploiement. - -Requiert <b>Qt 4.7.0</b> ou plus récent. - - - - QtC::ProjectExplorer - - Stop monitoring - Arrêter la surveillance - - - Stop Monitoring - Arrêter la surveillance - - - Stop monitoring task files. - Arrêter la surveillance des fichiers de tâches. - - - Task file reader - Lecteur de fichier de tâches - - - File Error - Erreur de fichier - - - Cannot open task file %1: %2 - Impossible d'ouvrir le fichier de tâche %1 : %2 - - - My Tasks - Mes tâches - - - - QtC::TextEditor - - Generic Highlighter - Coloration syntaxique générique - - - Download Definitions... - Téléchargement des définitions... - - - Autodetect - Autodétecter - - - Autodetect Definitions - Autodétection des définitions - - - No pre-installed definitions could be found. - Aucune définition pré-installée n'a pu être trouvée. - - - Error connecting to server. - Erreur lors de la connexion au serveur. - - - Not possible to retrieve data. - Impossile d'obtenir les données. - - - Name - Nom - - - Installed - "définitions", donc féminin pluriel - Installées - - - Available - "définitions", donc féminin pluriel - Disponibles - - - Download Definitions - Télécharger des définitions - - - Download Information - Télécharger des informations - - - There is already one download in progress. Please wait until it is finished. - Un téléchargement est déjà en cours. Merci d'attendre qu'il soit terminé. - - - Dialog - Boîte de dialogue - - - Definitions - Définitions - - - Select All - Tout sélectionner - - - Clear Selection - Effacer la sélection - - - Invert Selection - Inverser la sélection - - - Download Selected Definitions - Télécharger les définitions sélectionnées - - - Registering definitions - Enregistrement des définitions - - - Downloading definitions - Téléchargement des définitions - - - Error downloading selected definition(s). - Erreur lors du téléchargment de la ou des définitions sélectionnée(s). - - - Error downloading one or more definitions. - Erreur lors du téléchargement d'une ou plusieurs définitions. - - - -Please check the directory's access rights. - -Veuillez vérifier les droits d'accès du répertoire. - - - Download Error - Erreur lors du téléchargement - - - No outline available - Aucun contour disponible - - - Synchronize with Editor - Synchroniser avec l'éditeur - - - Filter tree - Filtrer l'arbre - - - Outline - Contour - - - A highlight definition was not found for this file. Would you like to try to find one? - Aucune définition de coloration syntaxique trouvée pour ce fichier. Voulez vous essayer d'en chercher une ? - - - Show highlighter options... - Afficher les options de coloration syntaxique... - - - Show highlighter options - Afficher les options de coloration syntaxique - - - - QtC::Bazaar - - General Information - Informations générales - - - Branch: - Branche : - - - Perform a local commit in a bound branch. -Local commits are not pushed to the master branch until a normal commit is performed - Effectue un commit local dans une branche liée. -Les commits locaux ne sont pas transmis à la branche principale avant qu'un commit normal ne soit effectué - - - Local commit - Commit local - - - Commit Information - Informations de commit - - - Author: - Auteur : - - - Email: - Email : - - - Fixed bugs: - Bogues fixés : - - - Perform a local commit in a bound branch. -Local commits are not pushed to the master branch until a normal commit is performed. - Effectue un commit local dans une branche liée. -Les commits locaux ne sont pas transmis à la branche principale avant qu'un commit normal ne soit effectué. - - - - QtC::Bazaar - - By default, branch will fail if the target directory exists, but does not already have a control directory. -This flag will allow branch to proceed - Par défaut, la branche va échouer si le répertoire cible existe, mais n'a pas déjà de répertoire de contrôle. Ce drapeau autorisera la branche à procéder - - - Create a stacked branch referring to the source branch. -The new branch will depend on the availability of the source branch for all operations - Créer une branche empilée se référant à la branche source. La nouvelle branche dépendra de la disponibilité de la branche source pour toutes les opérations - - - Stacked - Empilée - - - Do not use a shared repository, even if available - Ne pas utiliser de répertoire partagé, même si disponible - - - Standalone - Autonome - - - Bind new branch to source location - Lier la nouvelle branche à l'emplacement des sources - - - Switch the checkout in the current directory to the new branch - Basculer l'import du répertoire courrant à la nouvelle branche - - - Switch checkout - Basculer l'import - - - Hard-link working tree files where possible - Lier physiquement l'arbre de travail des fichiers où c'est possible - - - Hardlink - Lien dur - - - Create a branch without a working-tree - Créer une branche sans un arbre de travail - - - No working-tree - Pas d'arbre de travail - - - By default, branch will fail if the target directory exists, but does not already have a control directory. -This flag will allow branch to proceed. - Par défaut, la branche va échouer si le répertoire cible existe, mais n'a pas déjà de répertoire de contrôle. -Ce drapeau autorisera la branche à procéder. - - - Create a stacked branch referring to the source branch. -The new branch will depend on the availability of the source branch for all operations. - Créer une branche empilée se référant à la branche source. -La nouvelle branche dépendra de la disponibilité de la branche source pour toutes les opérations. - - - Do not use a shared repository, even if available. - Ne pas utiliser de répertoire partagé, même si disponible. - - - Switch the checkout in the current directory to the new branch. - Basculer l'import du répertoire courrant à la nouvelle branche. - - - Hard-link working tree files where possible. - Lier physiquement l'arbre de travail des fichiers où c'est possible. - - - Create a branch without a working-tree. - Créer une branche sans un arbre de travail. - - - - QtC::Bazaar - - Form - Formulaire - - - Configuration - Configuration - - - Command: - Commande : - - - User - Utilisateur - - - Username to use by default on commit. - Nom d'utilisateur à utiliser par défaut lors des commits. - - - Default username: - Nom d'utilisateur par défaut : - - - Email to use by default on commit. - Email à utiliser par défaut lors des commit. - - - Default email: - Email par défaut : - - - Miscellaneous - Divers - - - Log count: - Nombre d'entrées de log : - - - The number of recent commit logs to show, choose 0 to see all enteries - Le nombre de logs de commit récents à afficher, mettez 0 pour tout afficher - - - Timeout: - Timeout : - - - s - s - - - Prompt on submit - Invite lors du submit - - - The number of recent commit logs to show. Choose 0 to see all entries. - Le nombre de logs de commit récents à afficher, 0 pour tout afficher. - - - - QtC::Bazaar - - Dialog - Boîte de dialogue - - - Branch Location - Emplacement de la branche - - - Default location - Emplacement par défaut - - - Local filesystem: - Système local de fichier : - - - for example https://[user[:pass]@]host[:port]/[path] - par exemple, https://[user[:pass]@]host[:port]/[path] - - - Specify URL: - Spécifier l'URL : - - - Options - Options - - - Remember specified location as default - Se souvenir de l'emplcament par défaut - - - Ignore differences between branches and overwrite -unconditionally - Ignorer les différences entre les branches et toujours écraser - - - Overwrite - Écraser - - - By default, push will fail if the target directory exists, but does not already have a control directory. -This flag will allow push to proceed - Par défaut,le push va échouer si le répertoire cible existe, mais n'a pas déjà de répertoire de contrôle. -Ce drapeau autorisera le push à procéder - - - Use existing directory - Utiliser le répertoire existant - - - Create the path leading up to the branch if it does not already exist - Créer le chemin jusqu'à la branche s'il n'existe pas déjà - - - Create prefix - Créer le préfixe - - - Perform a local pull in a bound branch. -Local pulls are not applied to the master branch - Réalise un pull locale dans une branche limité. -Les pulls locaux ne sont pas appliqués à la branche maître - - - Local - Local - - - Pull Source - Rappatrier la source - - - Push Destination - ça semble plus cohérent - Destination de l'envoi - - - For example: https://[user[:pass]@]host[:port]/[path] - Par exemple, https://[user[:pass]@]host[:port]/[path] - - - Ignore differences between branches and overwrite -unconditionally. - Ignorer les différences entre les branches et toujours écraser sans condition. - - - By default, push will fail if the target directory exists, but does not already have a control directory. -This flag will allow push to proceed. - Par défaut,le push va échouer si le répertoire cible existe, mais n'a pas déjà de répertoire de contrôle. -Ce drapeau autorisera le push à procéder. - - - Create the path leading up to the branch if it does not already exist. - Créer le chemin jusqu'à la branche s'il n'existe pas déjà. - - - Perform a local pull in a bound branch. -Local pulls are not applied to the master branch. - Réalise un pull locale dans une branche limité. -Les pulls locaux ne sont pas appliqués à la branche maître. - - - - QtC::Bazaar - - Revert - Rétablir - - - Specify a revision other than the default? - Spécifier une revision différente de celle par défaut ? - - - Revision: - Révision : - - - - QtC::Core - - Form - Formulaire - - - Add tool - Ajouter un outil - - - Remove tool - Supprimer un outil - - - Revert tool to default - Rétablir l'outil par défaut - - - Description: - Description : - - - Executable: - Exécutable : - - - Arguments: - Arguments : - - - Working directory: - Répertoire de travail : - - - <html><head/><body> -<p>What to do with the executable's standard output. -<ul><li>Ignore: Do nothing with it</li><li>Show in pane: Show it in the general output pane</li><li>Replace selection: Replace the current selection in the current document with it</li></ul></p></body></html> - - <html><head/><body> -<p>Que faire avec la sortie standard de l'exécutable. -<ul><li>Ignorer : ne rien faire avec ; </li><li>Afficher dans le panneau : afficher le dans le panneau général de sortie ; </li><li>Remplacer la sélection : remplacer la sélection courante dans le document courant avec celui-ci.</li></ul></p></body></html> - - - Output: - Sortie : - - - Ignore - Ignorer - - - Show in Pane - Montrer dans le panneau - - - Replace Selection - Remplacer la sélection - - - <html><head><body> -<p >What to do with the executable's standard error output.</p> -<ul><li>Ignore: Do nothing with it</li> -<li>Show in pane: Show it in the general output pane</li> -<li>Replace selection: Replace the current selection in the current document with it</li> -</ul></body></html> - <html><head><body> -<p >Que faire avec la sortie standard de l'exécutable.</p> -<ul><li>Ignorer : ne rien faire avec ; </li> -<li>Afficher dans le panneau : afficher le dans le panneau général de sortie ; </li> -<li>Remplacer la sélection : remplacer la sélection courante dans le document courant avec celui-ci.</li> -</ul></body></html> - - - Error output: - Sortie d'erreur : - - - Text to pass to the executable via standard input. Leave empty if the executable should not receive any input. - Teste à passer à l'exécutable par l'entrée standard. Laisser vide si l'exécutable ne devrait pas recevoir d'entrée. - - - Input: - Entrée : - - - If the tool modifies the current document, set this flag to ensure that the document is saved before running the tool and is reloaded after the tool finished. - Si l'outil modifie le document courant, mettre ce drapeau pour s'asssurer que le document est sauvegardé avant de lancer l'outil et qu'il est rechargé après qu'il a fini. - - - Modifies current document - Modifie le document courant - - - Add Tool - Ajouter un outil - - - Add Category - Ajouter une catégorie - - - Insert variable - Insérer une variable - - - - QtC::Macros - - Form - Formulaire - - - Preferences - Préférences - - - Name - Nom - - - Description - Description - - - Shortcut - Raccourci - - - Remove - Supprimer - - - Macro - Macro - - - Description: - Description : - - - Save Macro - Sauver la macro - - - Name: - Nom : - - - - MemcheckConfigWidget - - Memory Analysis Options - Options d'analyse mémoire - - - Backtrace frame count: - Backtrace le nombre de frame : - - - Suppressions: - Suppressions : - - - Add - Ajouter - - - Remove - Supprimer - - - Track origins of uninitialized memory - Repérer les origines de mémoire non initialisée - - - - SuppressionDialog - - Dialog - Boîte de dialogue - - - Suppression File: - Fichier de suppression : - - - Suppression: - Suppression : - - - - QtC::ProjectExplorer - - Publishing Wizard Selection - Sélection de l'assistant de publication - - - Available Wizards: - Assistants disponibles : - - - Start Wizard - Démarrer l'assistant - - - Publishing is currently not possible for project '%1'. - La publication n'est pas actuellement possible pour le projet "%1". - - - - QtC::QmakeProjectManager - - Used to extract QML type information from library-based plugins. - Utilisé pour extraire le type d'information QML pour les plugins bibliothèques. - - - QML Dump: - Dump QML : - - - A modified version of qmlviewer with support for QML/JS debugging. - Un version modifiée de qmlviewer avec le support de débogage pourQML/JS. - - - QML Observer: - Observateur QML : - - - QML Debugging Library: - Bibliothèque de débogage QML : - - - Show compiler output of last build. - Montrer la sortie du compilateur lors de la dernière compilation. - - - Show Log - Montrer le journal d'événement - - - Compile debugging helpers that are checked. - Compiler les assistants de débogage qui sont cochés. - - - Build All - Tout compiler - - - Helps showing content of Qt types. Only used in older versions of GDB. - Aider à montrer le contenu des types Qt. Seulement utilisé dans les anciennes versions de GDB. - - - GDB Helper: - Assistant GDB : - - - - MaemoDeviceConfigWizardKeyCreationPage - - WizardPage - WizardPage - - - Qt Creator will now generate a new pair of keys. Please enter the directory to save the key files in and then press "Create Keys". - Qt Creator va maintenant générer une nouvelle paire de clés. Merci d'entrer le répertoire de sauvegarde des fichier clés et d'appuyer sur "Créer les clés". - - - Directory: - Répertoire : - - - Create Keys - Créer les clés - - - - MaemoDeviceConfigWizardKeyDeploymentPage - - WizardPage - WizardPage - - - Device address: - Adresse du périphérique : - - - Password: - Mot de passe : - - - Deploy Key - Déployer la clé - - - To deploy the public key to your device, please execute the following steps: -<ul> -<li>Connect the device to your computer (unless you plan to connect via WLAN).</li> -<li>On the device, start the "%%%maddev%%%" application.</li> -<li>In "%%%maddev%%%", configure the device's IP address to the one shown below (or edit the field below to match the address you have configured).</li> -<li>In "%%%maddev%%%", press "Developer Password" and enter it in the field below.</li> -<li>Click "Deploy Key"</li> - - Pour deployer la clé publique sur votre periphérique, merci d'exécuter les étapes suivantes : -<ul> -<li>Connectez le periphérique sur votre ordinateur (à moins que vous comptiez le connecté par WLAN).</li> -<li>Sur le periphérique, démarrez l'application "%%%maddev%%%".</li> -<li>Dans "%%%maddev%%%", configurez l'adresse IP du periphérique par celle affichée ci-dessous (ou éditez le champ dessous pour faire correspondre avec l'adresse que vous avez configuré).</li> -<li>Dans "%%%maddev%%%", cliquez sur "Mot de passe développeur" et entrer le dans le champ ci-dessous.</li> -<li>Cliquez "Déployer la clé"</li> - - - - MaemoDeviceConfigWizardCheckPreviousKeySetupPage - - WizardPage - WizardPage - - - Has a passwordless (key-based) login already been set up for this device? - Posséde déjà un de mot de passe (basé sur des clés) de connexion pour cet appareil ? - - - Yes, and the private key is located at - Oui, la clé privée est - - - No - Non - - - - MaemoDeviceConfigWizardReuseKeysCheckPage - - WizardPage - WizardPage - - - Do wou want to re-use an existing pair of keys or should a new one be created? - Voulez-vous réutiliser une pair de clés existante ou en créer une nouvelle ? - - - Re-use existing keys - Réutiliser les clés exitantes - - - File containing the public key: - Fichier contenant la clé publique : - - - File containing the private key: - Fichier contenant la clé privée : - - - Create new keys - Créer de nouvelles clés - - - Do you want to re-use an existing pair of keys or should a new one be created? - Voulez-vous réutiliser une paire de clés existante ou en créer une nouvelle ? - - - - MaemoDeviceConfigWizardStartPage - - WizardPage - WizardPage - - - The name to identify this configuration: - Le nom pour identifier cette configuration : - - - The system running on the device: - Le système exécuté sur ce périphérique : - - - Maemo 5 (Fremantle) - Maemo 5 (Fremantle) - - - Maemo 6 (Harmattan) - Maemo 6 (Harmattan) - - - Meego - Meego - - - The kind of device: - Le type de périphérique : - - - Emulator (Qemu) - Émulateur (Qemu) - - - Hardware Device - Périphérique matériel - - - The device's host name or IP address: - Le nom d'hôte du périphérique ou son adresse IP : - - - Emulator - Émulateur - - - The SSH server port: - Port du serveur SSH : - - - - MaemoPublishingWizardPageFremantleFree - - WizardPage - WizardPage - - - Choose build configuration: - Choisir la configuration de compilation : - - - Only create source package, do not upload - Ne créer que le paquet de sources, ne pas téléverser - - - - MaemoPublishingFileSelectionDialog - - Choose Package Contents - Choisir le contenu du paquet - - - <b>Please select the files you want to be included in the source tarball.</b> - - <b>Veuillez sélectionner les fichiers que vous voulez inclure dans le tarball des sources. </b> - - - - MaemoPublishingResultPageFremantleFree - - WizardPage - WizardPage - - - Progress - Avancement - - - - MaemoQemuSettingsWidget - - Form - Formulaire - - - OpenGL Mode - Mode OpenGL - - - &Hardware acceleration - Accélération matérielle (&H) - - - &Software rendering - Rendu logiciel (&S) - - - &Auto-detect - &Auto-détecter - - - - MaemoRemoteProcessesDialog - - List of Remote Processes - Liste des processus distants - - - &Filter by process name: - &Filtrer par nom de processus : - - - &Update List - Mettre à jo&ur la liste - - - &Kill Selected Process - Tuer les processus sélectionnés (&K) - - - - QtC::QmakeProjectManager - - ARM &version: - &Version ARM : - - - Version 5 - Version 5 - - - Version 6 - Version 6 - - - &Compiler path: - Chemin du &compilateur : - - - Environment Variables - Variables d'environnement - - - - S60CertificateDetailsDialog - - Details of Certificate - Détails du certificat - - - - S60PublishingBuildSettingsPageOvi - - Form - Formulaire - - - Choose a build configuration: - Choisir une configuration de compilation : - - - Only Qt versions above 4.6.3 are made available in this wizard. -Previous Qt versions have limitations in building suitable SIS files. - Seules les versions de Qt plus récentes que la 4.6.3 sont disponibles dans cet assistant. -Les version de Qt précédentes ont des limitations lors de la compilation des fichiers SIS. - - - Choose a tool chain: - Choisir une chaîne de compilation : - - - - S60PublishingResultsPageOvi - - Form - Formulaire - - - - S60PublishingSisSettingsPageOvi - - Form - Formulaire - - - Global vendor name: - Nom du vendeur global : - - - Qt version used in builds: - Version de Qt utilisée pour la compilation : - - - Current Qt Version - Version de Qt courante - - - Application UID: - UID de l'application : - - - Current UID3 - UID3 actuel - - - Capabilities: - Capacités : - - - Current set of capabilities - Ensemble actuel des capacités - - - Current Global Vendor Name - Nom global de vendeur actuel - - - Localised vendor names: - Noms de vendeur localisés : - - - Localised Vendor Names - Noms de vendeur localisés - - - Display name: - Nom d'affichage : - - - - QtC::QmakeProjectManager - - Dialog - Boîte de dialogue - - - Compiler path: - Chemin du compilateur : - - - System include path: - Chemin des includes système : - - - System library path: - Chemins des bibliothèques système : - - - SBS v2 directory: - Répertoire SBS v2 : - - - - Html5AppWizardSourcesPage - - WizardPage - WizardPage - - - Main HTML File - Fichier HTML principal - - - Generate an index.html file - Générer un fichier index.html - - - Import an existing .html file - Importer un fichier .html existant - - - Load a URL - Charger une URL - - - http:// - http:// - - - Note: Unless you chose to load a URL, all files and directories that reside in the same directory as the main HTML file are deployed. You can modify the contents of the directory any time before deploying. - Note : à moins de choisir de charger une URL, tous les fichiers et répertoires qui résident dans le même répertoire que le fichier HTML principal sont déployés. Vous pouvez modifier le contenu du répertoire à n'importe quel moment avant le déploiement. - - - Touch optimized navigation - Navigation optimisée pour le toucher - - - Enable touch optimized navigation - Activer la navigation optimisée pour le toucher - - - Touch optimized navigation will make the HTML page flickable and enlarge the area of touch sensitive elements. If you use a JavaScript framework which optimizes the touch interaction, leave the checkbox unchecked. - La navigation optimisée pour le toucher rendre la page HTML flickable et élargira la zone des éléments sensibles au toucher. Si vous utilisez un framework JavaScript qui optimise l'interaction au toucher, laissez cette case décochée. - - - - QtC::TextEditor - - Tabs and Indentation - Tabulation et indentation - - - Insert &spaces instead of tabs - Insérer des e&spaces au lieu de tabulations - - - Automatically determine based on the nearest indented line (previous line preferred over next line) - Déterminer automatiquement en se basant sur la ligne indentée la plus proche (ligne précédente préférée à la ligne suivante) - - - Based on the surrounding lines - Basé sur les lignes environnantes - - - Backspace will go back one indentation level instead of one space. - La touche retour reviendra un niveau d'indentation en arrière au lieux d'un caractère espace. - - - &Backspace follows indentation - La touche &retour arrière suit l'indentation - - - Block indentation style: - Style d'indentation de bloc : - - - Enable &tooltips only when Shift key is down - Activer les info-&bulles seulement lorsque la touche Shift est appuyée - - - - QtC::Valgrind - - Common Valgrind Options - Options communes de Valgrind - - - - QtC::QmlJS - - Errors while loading qmltypes from %1: -%2 - Erreurs lors du chargement de qmltypes depuis %1 : -%2 - - - Warnings while loading qmltypes from %1: -%2 - Avertissements lors du chargement de qmltypes depuis %1 : -%2 - - - Could not parse document. - Impossible d'analyser le document. - - - Expected a single import. - Un seul import est attendu. - - - Expected import of QtQuick.tooling. - Un import de QtQuick.tooling est attendu. - - - Expected version 1.1 or lower. - La version 1.1 ou inférieure est attendue. - - - Expected document to contain a Module {} member. - Un document contiennant un membre Modue {} est attendu. - - - Expected only Component and ModuleApi object definitions. - Seule des définitions d'objets de Component et de ModuleApi sont attendues. - - - Expected only Property, Method, Signal and Enum object definitions. - Seules des définitions d'objets Property, Method, Signal et Enum sont attendues. - - - Expected only name, prototype, defaultProperty, attachedType, exports and exportMetaObjectRevisions script bindings. - Seules des liaison de scripts de noms, prototypes, defautProperty, attachedType, exports et exportMetaObjectRevisions sont attendues. - - - Expected only script bindings and object definitions. - Seules des liaisons de scripts et des définitions d'objets sont attendues. - - - Component definition is missing a name binding. - Une liaison de nom est manquant dans la définition du composant. - - - Expected only uri, version and name script bindings. - Seule des liaisons de scripts de uri, version et nom sont attendues. - - - Expected only script bindings. - Seules des liaisons de scripts sont attendues. - - - ModuleApi definition has no or invalid version binding. - La définition du ModuleApi ne possède pas de liaison de version ou cellle-ci est invalide. - - - Expected only Parameter object definitions. - Seules des définitions d'objets Parameter sont attendues. - - - Expected only name and type script bindings. - Seules de liaisons de script de nom et de type sont attendues. - - - Method or signal is missing a name script binding. - Il manque une méthode ou un signal dans la liaison de scirpt de nom. - - - Expected script binding. - Une liaison de script est attendu. - - - Expected only type, name, revision, isPointer, isReadonly and isList script bindings. - Seules des liaison de scripts de type, nom, revision, isPointer, isReadonly et isList script bindings sont attendues. - - - Property object is missing a name or type script binding. - Il manque une liaison de script de nom ou de type dasn un objet propriété. - - - Expected only name and values script bindings. - Seules de liaisons de script de nom et de valeur sont attendues. - - - Expected string after colon. - Une chaîne est attendue après la virgule. - - - Expected boolean after colon. - Un booléen est attendu après la virgule. - - - Expected true or false after colon. - Vrai ou faux est attendu après la virgule. - - - Expected numeric literal after colon. - Un littéral numérique est attendu après la virgule. - - - Expected integer after colon. - Un entier est attendu après la virgule. - - - Expected array of strings after colon. - Un tableau de chaînes est attendu après la virgule. - - - Expected array literal with only string literal members. - Un littéral tableau contenant que des littérals chaînes est attendu. - - - Expected string literal to contain 'Package/Name major.minor' or 'Name major.minor'. - Un littéral chaîne qui contient "Package/Name major.minor" or "Name major.minor" est attendu. - - - Expected array of numbers after colon. - Un tableau de nombres est attendu après la virgule. - - - Expected array literal with only number literal members. - Un littéral tableau avec uniquement des membres littérals numérique est attendu. - - - Meta object revision without matching export. - Révision du méta-objet sans exportation correspondante. - - - Expected integer. - Un entier est attendu. - - - Expected object literal after colon. - Un littéral objet est attendu après la virgule. - - - Expected object literal to contain only 'string: number' elements. - Un littéral objet qui contient seulement des éléments "chaîne: nombre" est attendu. - - - Enum should not contain getter and setters, but only 'string: number' elements. - Une énumération ne doit pas contenir des accesseurs et mutateurs, mais seulement des éléments "chaîne: nombre". - - - - QtC::Utils - - Cannot retrieve debugging output. - Impossible d'obtenir la sortie du débogage. + The command "%1" did not respond within the timeout limit (%2 s). + La commande « %1 » n’a pas répondu dans le délai imparti (%2 s). <UNSET> @@ -28040,220 +51176,657 @@ Les version de Qt précédentes ont des limitations lors de la compilation des f Value when inserting a new variable <VALEUR> - - The IP address is not valid. - L'adresse IP est invalide. - Error in command line. Erreur dans la ligne de commande. - Server could not start sftp subsystem. - Le serveur ne peut démarrer le sous-système sftp. + copyFile is not implemented for "%1" + copyFile n’est pas implémenté pour « %1 » - Unexpected packet of type %1. - Paquet de type %1 inattendu. + Cannot copy from %1, it is not a directory. + Impossible de copier à partir de %1, ce n’est pas un répertoire. - Protocol version mismatch: Expected %1, got %2 - Conflit de version de protocole : %1 attendue, %2 detectée + Cannot copy %1 to %2, it is not a writable directory. + Impossible de copier %1 dans %2, ce n’est pas un répertoire accessible en écriture. - Unknown error. - Erreur inconnue. + Failed to copy recursively from "%1" to "%2" while trying to create tar archive from source: %3 + Échec de la copie récursive de « %1 » vers « %2 » lors de la création d’une archive tar à partir de la source : %3 - Created remote directory '%1'. - Création du répertoire distant "%1". + Failed to copy recursively from "%1" to "%2" while trying to extract tar archive to target: %3 + Échec de la copie récursive de « %1 » vers « %2 » lors de l’extraction de l’archive tar vers la cible : %3 - Remote directory '%1' already exists. - Le répertoire distant "%1" existe déjà. + fileContents is not implemented for "%1" + fileContents n’est pas implémenté pour « %1 » - Error creating directory '%1': %2 - Erreur lors de la création du répertoire "%1" : %2 + writeFileContents is not implemented for "%1" + writeFileContents n’est pas implémenté pour « %1 » - Could not open local file '%1': %2 - Impossible d'ouvrir le fichier local "%1" : %2 + createTempFile is not implemented for "%1" + createTempFile n’est pas implémenté pour « %1 » - Remote directory could not be opened for reading. - Le répertoire distant ne peut pas être ouvert pour lecture. + Refusing to remove root directory. + Impossible de supprimer le répertoire racine. - Failed to list remote directory contents. - Impossible de lister le contenu du répertoire distant. + Refusing to remove your home directory. + Impossible de supprimer le répertoire home. - Failed to close remote directory. - Impossible de fermer le répertoire distant. + Failed to remove directory "%1". + Échec de la suppression du répertoire « %1 ». - Failed to open remote file for reading. - Impossible d'ouvrir le fichier distant pour lecture. + Failed to remove file "%1". + Échec de la suppression du fichier « %1 ». - Failed retrieve information on the remote file ('stat' failed). - Impossible de récupérer les informations sur le fichier distant ('échec de 'stat'). + Failed to copy file "%1" to "%2". + Échec de la copie du fichier « %1 » vers « %2 ». - Failed to read remote file. - Impossible de lire le fichier distant. + File "%1" does not exist + Le fichier « %1 » n’existe pas - Failed to close remote file. - Impossible de fermer le fichier distant. + Could not open File "%1" + Impossible d’ouvrir le fichier « %1 » - Failed to open remote file for writing. - Impossible d'ouvrir le fichier distant pour écriture. + Cannot read "%1": %2 + Impossible de lire « %1 » : %2 - Failed to write remote file. - Impossible d'écrire sur le fichier distant. + Could not open file "%1" for writing + Impossible d’ouvrir le fichier « %1 » en écriture - Cannot append to remote file: Server does not support the file size attribute. - Impossible d'ajouter à la fin du fichier distant : le serveur ne supporte pas l'attribut taille du fichier. + Could not write to file "%1" (only %2 of %3 bytes written) + Impossible d’écrire dans le fichier « %1 » (seulement %2 des %3 octets écrits) - Server could not start session: %1 - Le serveur n'a pas pu démarrer la session : %1 + Could not create temporary file in "%1" (%2) + Impossible de créer le fichier temporaire dans « %1 » (%2) - Server could not start session. - Le serveur ne peut pas démarrer la session. + Failed to copy file "%1" to "%2": %3 + Échec de la copie du fichier « %1 » vers « %2 » : %3 - Error reading local file: %1 - Erreur lors de la lecture du fichier local : %1 + Failed reading file "%1": %2 + Échec de la lecture du fichier « %1 » : %2 - Invalid channel id %1 - Identifiant %1 du canal invalide + Failed writing file "%1": %2 + Échec de l’écriture du fichier « %1 » : %2 - SSH Protocol error: %1 - Erreur dans le protocole SSH : %1 + Failed creating temporary file "%1": %2 + Échec de la création du fichier temporaire « %1 » : %2 - Botan library exception: %1 - Exception dans la bibliothèque Botan : %1 + Failed creating temporary file "%1" (too many tries) + Échec de la création du fichier temporaire « %1 » (trop d’essais) - Invalid protocol version: Expected '2.0', got '%1'. - Version du protocole invalide :'2.0' attendue, "%1" detectée. + Cannot Save Workspace + Impossible d’enregistrer l’espace de travail - Invalid server id '%1'. - Identifiant de serveur invalide "%1". + Could not save workspace to file %1 + Impossible d’enregistrer l’espace de travail dans le fichier %1 - Could not read private key file: %1 - Impossible de lire le fichier de la clé privée : %1 + Delete Workspace + Supprimer l’espace de travail - Private key error: %1 - Erreur de clé privée : %1 + Delete Workspaces + Supprimer les espaces de travail - Password expired. - Mot de passe expiré. + Delete workspace %1? + Supprimer l’espace de travail %1 ? - Server rejected password. - Le serveur a rejeté le mot de passe. + Delete these workspaces? + %1 + Supprimer ces espaces de travail ? +…%1 - Server rejected key. - Le serveur a rejeté la clé. + File Error + Erreur de fichier - The server sent an unexpected SSH packet of type SSH_MSG_UNIMPLEMENTED. - Le serveur a envoyé un paquet SSH inattendu de type SSH_MSG_UNIMPLETED. + Cannot Restore Workspace + Impossible de restaurer l’espace de travail - Server closed connection: %1 - Le serveur a fermé la connexion : %1 + Could not restore workspace %1 + Impossible de restaurer l’espace de travail %1 - Connection closed unexpectedly. - La connexion a été fermée de façon inattendu. + Cannot write file %1: %2 + Impossible d’écrire dans le fichier %1 : %2 - Timeout waiting for reply from server. - Temps limite dépassé lors de l'attente de la réponse du serveur. + Cannot write file %1. Disk full? + Impossible d’écrire dans le fichier %1. Disque plein ? - No private key file given. - Aucune clé privée n'est fournit. + %1: Is a reserved filename on Windows. Cannot save. + %1 : c’est un nom de fichier réservé sous Windows. Impossible d’enregistrer. - Private key file error: %1 - Erreur du fichier de clé privée : %1 + Cannot overwrite file %1: %2 + L’écrasement du fichier %1 a échoué : %2 + + + Cannot create file %1: %2 + Impossible de créer le fichier %1 : %2 + + + Cannot create temporary file in %1: %2 + Impossible de créer un fichier temporaire dans %1 : %2 + + + Overwrite File? + Écraser le fichier ? + + + Overwrite existing file "%1"? + Écraser le fichier existant « %1 » ? + + + Could not copy file "%1" to "%2". + Impossible de copier le fichier « %1 » vers « %2 ». + + + Failed to create directory "%1". + Échec de la création du répertoire « %1 ». + + + Out of memory. + Mémoire insuffisante. + + + An encoding error was encountered. + Une erreur d’encodage a été rencontrée. + + + Add + Ajouter + + + Remove + Supprimer + + + Rename + Renommer + + + Do you really want to delete the configuration <b>%1</b>? + Voulez-vous vraiment supprimer la configuration <b>%1</b> ? + + + New name for configuration <b>%1</b>: + Nouveau nom pour la configuration <b>%1</b> : + + + Rename... + Renommer… + + + odd cpu architecture + architecture CPU étrange + + + "%1" is an invalid ELF object (%2) + « %1 » est un objet ELF non valide (%2) + + + "%1" is not an ELF object (file too small) + « %1 » n’est un objet ELF (fichier trop petit) + + + "%1" is not an ELF object + « %1 » n’est un objet ELF + + + odd endianness + boutisme étrange + + + unexpected e_shsize + e_shsize inattendue + + + unexpected e_shentsize + e_shentsize inattendue + + + announced %n sections, each %1 bytes, exceed file size + + %n section annoncée, chacun de %1 octets, dépassant la taille du fichier + %n sections annoncées, chacun de %1 octets, dépassant la taille du fichier + + + + string table seems to be at 0x%1 + La table des chaînes de caractères semble être située à 0x%1 + + + section name %1 of %2 behind end of file + Le nom de section %1 de %2 est après la fin du fichier + + + Delete + Suppression + + + Insert + Insertion + + + Equal + Équivalent + + + File format not supported. + Format de fichier non pris en charge. + + + Could not find any unarchiving executable in PATH (%1). + Impossible de trouver un exécutable de désarchivage dans PATH (%1). + + + Command failed. + Échec de la commande. + + + Running %1 +in "%2". + + + Running <cmd> in <workingdirectory> + Exécute %1 +dans « %2 ». + + + + + Reset + Réinitialiser + + + Enable + Activer + + + Disable + Désactiver + + + Leave at Default + Laisser par défaut + + + Show %1 Column + + + + Failed to retrieve clangd version: Unexpected clangd output. + Échec de la réception de la version de clangd : sortie de clangd inattendue. + + + The clangd version is %1, but %2 or greater is required. + La version de clangd est %1, mais %2 ou plus est nécessaire. + + + Edit Environment + Modifier l’environnement + + + Enter one environment variable per line. +To set or change a variable, use VARIABLE=VALUE. +To append to a variable, use VARIABLE+=VALUE. +To prepend to a variable, use VARIABLE=+VALUE. +Existing variables can be referenced in a VALUE with ${OTHER}. +To clear a variable, put its name on a line with nothing else on it. +To disable a variable, prefix the line with "#". + Saisir une variable d’environnement par ligne. +Pour définir ou modifier une variable, utiliser VARIABLE=VALEUR. +Pour ajouter une variable, utiliser VARIABLE+=VALEUR. +Pour ajouter une variable à l’avance, utiliser VARIABLE=+VALUE. +Les variables existantes peuvent être référencées dans une VALEUR avec ${AUTRE}. +Pour effacer une variable, placez son nom sur une ligne sans rien d’autre. +Pour désactiver une variable, préfixer la ligne par « # ». + + + %1 on %2 + File on device + %1 sur %2 + + + %1 %2 on %3 + File and args on device + %1 %2 sur %3 + + + Error while trying to copy file: %1 + + + + Could not copy file: %1 + Impossible de copier le fichier : %1 + + + Could not set permissions on "%1" + Impossible de définir les autorisations sur « %1 » + + + No "localSource" device hook set. + + + + My Computer + Mon ordinateur + + + Computer + Ordinateur + + + Name + Nom + + + Size + Taille + + + Kind + Match OS X Finder + Type + + + Type + All other platforms + Type + + + Date Modified + Date de modification + + + Cannot create OpenGL context. + Impossible de créer un contexte OpenGL. + + + Null + Null + + + Bool + Bool + + + Double + Double + + + String + Chaîne de caractères + + + Array + Tableau + + + Object + Objet + + + Undefined + Indéfini + + + %n Items + + %n élément + %n éléments + + + + Failed to start process launcher at "%1": %2 + Échec du démarrage du lanceur de processus à « %1 » : %2 + + + Process launcher closed unexpectedly: %1 + Le lanceur de processus s’est fermé de manière inattendue : %1 + + + Process launcher socket error. + Erreur de socket du lanceur de processus. + + + Internal socket error: %1 + Erreur de socket interne : %1 + + + Socket error: %1 + Erreur de socket : %1 + + + Internal protocol error: invalid packet size %1. + Erreur de protocole interne : taille de paquet invalide %1. + + + Internal protocol error: invalid packet type %1. + Erreur de protocole interne : type de paquet invalide %1. + + + Launcher socket closed unexpectedly. + La socket du lanceur s’est fermé de manière inattendue. + + + Infinite recursion error + Erreur de récursivité infinie + + + %1: Full path including file name. + %1 : chemin complet comprenant le nom du fichier. + + + %1: Full path excluding file name. + %1 : chemin complet sans le nom du fichier. + + + %1: Full path including file name, with native path separator (backslash on Windows). + %1 : chemin complet comprenant le nom du fichier, avec le séparateur de chemin natif (barre oblique inverse sous Windows). + + + %1: Full path excluding file name, with native path separator (backslash on Windows). + %1 : chemin complet excluant le nom du fichier, avec le séparateur de chemin natif (barre oblique inverse sous Windows). + + + %1: File name without path. + %1 : nom du fichier sans le chemin. + + + %1: File base name without path and suffix. + %1 : nom du fichier sans le chemin, ni le suffixe. + + + Global variables + Variables globales + + + Access environment variables. + Accéder aux variables d’environnement. + + + Minimize + Minimiser + + + &OK + &OK + + + &Cancel + &Annuler + + + Remove File + Supprimer le fichier + + + Remove Folder + Supprimer le dossier + + + &Delete file permanently + &Supprimer le fichier de façon permanente + + + &Remove from version control + &Supprimer du gestionnaire de versions + + + File to remove: + Fichier à supprimer : + + + Folder to remove: + Dossier à supprimer : + + + Failed to Read File + Échec de la lecture du fichier + + + Could not open "%1". + Impossible d’ouvrir « %1 ». + + + Failed to Write File + Échec de l’écriture du fichier + + + There was nothing to write. + Il n’y avait rien à écrire. + + + No Valid Settings Found + Aucun réglage valide n’a été trouvé + + + <p>No valid settings file could be found.</p><p>All settings files found in directory "%1" were unsuitable for the current version of %2, for instance because they were written by an incompatible version of %2, or because a different settings path was used.</p> + <p>Aucun fichier de configuration valide n’a pu être trouvé.</p><p>Tous les fichiers de configuration trouvés dans le répertoire « %1 » ne sont pas adaptés à la version actuelle de %2, par exemple parce qu’ils ont été écrits par une version incompatible de %2, ou parce qu’un chemin de configuration différent a été utilisé.</p> + + + <p>No valid settings file could be found.</p><p>All settings files found in directory "%1" were either too new or too old to be read.</p> + <p>Aucun fichier de configuration valide n’a pu être trouvé.</p><p>Tous les fichiers de configuration trouvés dans le répertoire « %1 » étaient soit trop récents, soit trop anciens pour être lus.</p> + + + Using Old Settings + Utilisation d’anciens réglages + + + <p>The versioned backup "%1" of the settings file is used, because the non-versioned file was created by an incompatible version of %2.</p><p>Settings changes made since the last time this version of %2 was used are ignored, and changes made now will <b>not</b> be propagated to the newer version.</p> + <p>L’enregistrement versionné « %1 » du fichier de paramètres est utilisé, parce que le fichier non-versionné a été créé avec une version incompatible de %2.</p><p>Les modifications apportées aux paramètres depuis la dernière utilisation de cette version de %2 sont ignorées, et les modifications apportées maintenant ne seront pas propagées vers la nouvelle version.</p> + + + Settings File for "%1" from a Different Environment? + Fichier de paramètres pour « %1 » provenant d’un environnement différent ? + + + <p>No settings file created by this instance of %1 was found.</p><p>Did you work with this project on another machine or using a different settings path before?</p><p>Do you still want to load the settings file "%2"?</p> + <p>Aucun fichier de paramètres créé par cette instance de %1 n’a été trouvé.</p><p>Avez-vous travaillé sur ce projet sur une autre machine ou en utilisant un chemin différent ?</p><p>Souhaitez-vous toujours charger le fichier de configuration « %2 » ?</p> + + + Unsupported Merge Settings File + Fichier de paramètres de fusion non pris en charge + + + "%1" is not supported by %2. Do you want to try loading it anyway? + « %1 » n’est pas pris en charge par %2. Voulez-vous quand même essayer de le charger ? + + + Elapsed time: %1. + Temps écoulé : %1. + + + Insert Variable + Insérer une variable + + + Current Value: %1 + Valeur actuelle : %1 + + + Insert Unexpanded Value + pas sûr de la traduction de « unexpanded » + Insérer une valeur non développée + + + Insert "%1" + Insérer « %1 » + + + Insert Expanded Value + pas sûr de la traduction de « expanded » + Insérer une valeur développée + + + Select a variable to insert. + Sélectionner une variable à insérer. + + + Variables + Variables + + + Invalid command + Commande invalide QtC::Valgrind - - No errors found - Aucune erreur trouvée - - - What - Quoi - Location Emplacement - - Unique - Unique - - - Thread ID - ID du Thread - - - Kind - Type - - - Leaked Blocks - Blocs perdus - - - Leaked Bytes - Octets perdus - - - Helgrind Thread ID - ID du thread Helgrind - Location: Emplacement : Instruction pointer: - Pointeur d'instruction : + Pointeur d’instruction : Could not parse hex number from "%1" (%2) - Impossible de parser le nombre hexadécimal depuis "%1" (%2) + Impossible de parser le nombre hexadécimal depuis « %1 » (%2) trying to read element text although current position is not start of element - essaie de lire le texte de l'élément même si la position courante n'est pas le début d'un élément + essaie de lire le texte de l’élément même si la position actuelle n’est pas le début d’un élément Unexpected child element while reading element text - Élément enfant non attendu lors de la lecture du texte de l'élément + Élément enfant non attendu lors de la lecture du texte de l’élément Unexpected token type %1 @@ -28261,35 +51834,35 @@ Les version de Qt précédentes ont des limitations lors de la compilation des f Could not parse protocol version from "%1" - Impossible de parser la version du protocole depuis "%1" + Impossible d’analyser la version du protocole depuis « %1 » XmlProtocol version %1 not supported (supported version: 4) - Version %1 de XmlProtocol non supportée (version supportée : 4) + Version %1 de XmlProtocol non prise en charge (version prise en charge : 4) Valgrind tool "%1" not supported - Outil Valgrind "%1" non supporté + Outil Valgrind « %1 » non pris en charge Unknown memcheck error kind "%1" - Type d'erreur de vérification mémoire inconnue %1 + Type d’erreur de vérification mémoire inconnue %1 Unknown helgrind error kind "%1" - Type d'erreur Helgrind inconnu "%1" + Type d’erreur Helgrind inconnu « %1 » Unknown ptrcheck error kind "%1" - Type d'erreur ptrcheck inconnu "%1" + Type d’erreur ptrcheck inconnu « %1 » Could not parse error kind, tool not yet set. - Impossible de parser le type d'erreur, outil pas encore défini. + Impossible de parser le type d’erreur, outil pas encore défini. Unknown state "%1" - État inconnu "%1" + État inconnu « %1 » Unexpected exception caught during parsing. @@ -28301,7 +51874,7 @@ Les version de Qt précédentes ont des limitations lors de la compilation des f Instruction Pointer - Pointeur d'instruction + Pointeur d’instruction Object @@ -28319,3584 +51892,29 @@ Les version de Qt précédentes ont des limitations lors de la compilation des f Line Ligne - - - QtC::Debugger - - Analyzer - Analyseur - - - - Analyzer::Internal::AnalyzerMode - - Analyze - Analyse - - - - Analyzer::AnalyzerManager - - Start &Analyzer - Démarrer l'&Analyseur - - - Start - Démarrer - - - Stop - Arrêter - - - Debug - Débogage - - - Release - Release - - - Run %1 in %2 Mode? - Lancer %1 en mode %2? - - - <html><head/><body><p>You are trying to run the tool '%1' on an application in %2 mode. The tool is designed to be used in %3 mode.</p><p>Do you want to continue and run it in %2 mode?</p></body></html> - <html><head/><body><p>Vous essayez d'éxécuter l'outil '%1 en mode %2 sur une application. Cette outil est prévue pour être utilisé en mode %3.</p><p>Voulez vous continuer et le lancer en mode %2?</p></body></html> - - - &Do not ask again - Ne plus re&demander - - - Tool '%1' started... - L'outil "%1" as démarré... - - - Tool '%1' finished, %n issues were found. - - L'outil '%1' s'est terminé; %n problème possible trouvé. - L'outil '%1' s'est terminé. %n problèmes possible trouvés. - - - - Tool '%1' finished, no issues were found. - L'outil "%1' s"est terminé. Aucun problèmes trouvés. - - - Tool "%1" started... - L'outil "%1" a démarré... - - - Tool "%1" finished, %n issues were found. - - L'outil "%1" a fini, %n problème a été trouvé. - L'outil "%1" a fini, %n problèmes ont été trouvés. - - - - Tool "%1" finished, no issues were found. - L'outil "%1" a fini, pas de problème trouvé. - - - - Analyzer::Internal::AnalyzerOutputPane - - No current analysis tool - Aucun outil d'analyse sélectionné - - - Analysis - Analyse - - - - Analyzer::Internal::AnalyzerPlugin - - Analyzer - Category under which Analyzer tasks are listed in Issues view - Analyseur - - - - Analyzer::Internal::AnalyzerRunConfigWidget - - Analyzer settings: - Réglages de l'Analyseur : - - - Analyzer Settings - Réglages de l'Analyseur - - - Available settings: %1 - Options diponible : %1 - - - - Analyzer::Internal::AnalyzerRunControlFactory - - Analyzer - Analyseur - - - No analyzer tool selected - Pas d'outil d'analyse sélectionné - - - - Analyzer::Internal::AnalyzerRunControl - - Build Issues - Problèmes de compilation - - - - Analyzer::AnalyzerProjectSettings - - Analyzer Settings - Réglages de l'Analyseur - - - - Analyzer::IAnalyzerTool - - Debug - Débogage - - - Release - Release - - - (Remote) - (Distant) - - - (External) - (externe) - - - Annotate %1 - Annoter %1 - - - Annotate parent revision %1 - Annoter la révision parente %1 - - - Bazaar - Bazaar - - - Annotate Current File - Annoter le fichier courant - - - Annotate "%1" - Annoter "%1" - - - Diff Current File - Faire un diff du fichier courant - - - Diff "%1" - Faire un diff de "%1" - - - Alt+Z,Alt+D - Alt+Z, Alt+D - - - Meta+Z,Meta+D - Meta+Z, Meta+D - - - Log Current File - Réaliser un log du fichier courant - - - Log "%1" - Réaliser un log de "%1" - - - Alt+Z,Alt+L - Alt+Z,Alt+L - - - Meta+Z,Meta+L - Meta+Z, Meta+L - - - Status Current File - Statut du fichier courant - - - Status "%1" - Statut "%1" - - - Alt+Z,Alt+S - Alt+Z,Alt+S - - - Meta+Z,Meta+S - Meta+Z, Meta+S - - - Add - Ajouter - - - Add "%1" - Ajouter "%1" - - - Delete... - Supprimer… - - - Delete "%1"... - Supprimer "%1"… - - - Revert Current File... - Rétablir le fichier courant... - - - Revert "%1"... - Rétablir "%1"... - - - Diff - Diff - - - Log - Log - - - Revert... - Rétablir... - - - Status - Statut - - - Pull... - Pull... - - - Push... - Push... - - - Update... - Mise à jour... - - - Commit... - Commit... - - - Alt+Z,Alt+C - Alt+Z,Alt+C - - - Meta+Z,Meta+C - Meta+Z, Meta+C - - - Create Repository... - Création du dépôt... - - - Update - Mettre à jour - - - Commit - Faire un commit - - - Diff &Selected Files - Faire un diff sur tous les fichiers &sélectionnés - - - Diff Selected Files - Faire un diff sur tous les fichiers sélectionnés - - - &Undo - Annu&ler - - - &Redo - &Refaire - - - There are no changes to commit. - Il n'y a aucun changement à envoyer. - - - Unable to generate a temporary file for the commit editor. - Impossible de générer un fichier temporaire pour l'éditeur de commit. - - - Unable to create an editor for the commit. - Impossible d'ouvrir un éditeur pour le commit. - - - Unable to create a commit editor. - Impossible d'ouvrir un éditeur de commit. - - - Commit changes for "%1". - Soumettre les changements pour "%1". - - - Close Commit Editor - Fermer l'éditeur de commit - - - Do you want to commit the changes? - Voulez vous envoyer les changements ? - - - Message check failed. Do you want to proceed? - Vérification du message échouée. Voulez-vous continuer ? - - - - QtC::Bazaar - - Cloning - Cloner - - - Cloning started... - Début du clonage... - - - Clones a Bazaar branch and tries to load the contained project. - Clone une branche Bazaar et essaye de charger le projet contenu. - - - Bazaar Clone (Or Branch) - Clone Bazaar (ou branche) - - - - QtC::Bazaar - - Location - Emplacement - - - Specify repository URL, clone directory and path. - Spécifie l'URL du dépôt, le répertoire du clone et le chemin. - - - Clone URL: - URL de clone : - - - - QtC::Bazaar - - Commit Editor - Faire un commit de l'éditeur - - - - QtC::Bazaar - - Bazaar Command - Commande Bazaar - - - - QtC::Core - - Uncategorized - Sans catégorie - - - Tools that will appear directly under the External Tools menu. - Outils qui apparaissent directement dans le menu Outils externes. - - - New Category - Nouvelle catégorie - - - New Tool - Nouvel outil - - - This tool prints a line of useful text - Cet outil affiche une ligne de texte utile - - - /c echo Useful text - /c echo texte utile - - - Useful text - Sample external tool text - Texte utile - - - Could not open tool specification %1 for reading: %2 - Impossible d'ouvrir les spécificatrions d'outil %1 pour lecture : %2 - - - Could not write tool specification %1: %2 - Impossible d'écrire les spécifications d'outil %1 : %2 - - - Creates qm translation files that can be used by an application from the translator's ts files - Crée un fichier de traduction qm utilisable par l'application à partir des fichiers ts du traducteur - - - Release Translations (lrelease) - Publier les traductions (lrelease) - - - Linguist - Linguist - - - Synchronizes translator's ts files with the program code - Synchroniser les fichiers ts de traduction avec le code source - - - Update Translations (lupdate) - Mettre à jour les traductions (lupdate) - - - Opens the current file in Notepad - Notepad, c'est pas très cross-platform - Ouvre le fichier courant avec Notepad - - - Edit with Notepad - Notepad, c'est pas très cross-platform - Éditer avec Notepad - - - Text - Texte - - - Runs the current QML file with qmlscene. This requires Qt 5. - Exécute le fichier QML courant avec qmlscene. Cela nécessite Qt 5. - - - Qt Quick 2 Preview (qmlscene) - Prévisualisation Qt Quick 2 (qmlscene) - - - Runs the current QML file with qmlviewer - Lancer le fichier QML courrant avec qmlviewer - - - Preview (qmlviewer) - Aperçu (qmlviewer) - - - Qt Quick - Qt Quick - - - Qt Quick 1 Preview (qmlviewer) - Prévisualisation Qt Quick 1 (qmlviewer) - - - Sorts the selected text - Ordonne le texte sélectionné - - - Sort Selection - Trier la sélection - - - Opens the current file in vi - Ouvre le fichier courrant avec vi - - - Edit with vi - Éditer avec vi - - - Error while parsing external tool %1: %2 - Erreur lors de l'analyse de l'outil externe %1 : %2 - - - Could not find executable for '%1' (expanded '%2') - - Impossible de trouver l'exécutable pour "%1" ("%2") - - - Could not find executable for '%1' (expanded '%2') - Impossible de trouver l'exécutable pour "%1" ("%2") - - - Starting external tool '%1' %2 - Lancement de l'outil externe "%1" %2 - - - '%1' finished - "%1" a fini - - - External - Externe - - - &External - &Externe - - - Error: External tool in %1 has duplicate id - Erreur : outil externe dans %1 a un identifiant dupliqué - - - Add Magic Header - Ajouter un en-tête magique - - - Error - Erreur - - - Not a valid byte pattern. - Pas un motif valide d'octets. - - - Dialog - Boîte de dialogue - - - Value: - Valeur : - - - Type - Type - - - String - Chaîne de caractères - - - Byte - Octet - - - Use Recommended - Utiliser le paramètre recommandé - - - Start range: - Début de l'intervalle : - - - End range: - Fin de l'intervalle : - - - Priority: - Priorité : - - - <i>Note: Wide range values might impact Qt Creator's performance when opening files.</i> - <i>Note : de grands intervalles pourraient avoir un impact sur les performances de Qt Creator à l'ouverture des fichiers. </i> - - - MIME Type - Type MIME - - - Handler - Gestionnaire - - - Undefined - Indéfini - - - Invalid MIME Type - Type MIME invalide - - - Conflicting pattern(s) will be discarded. - Le(s) motif(s) en conflit va (vont) être éliminé(s). - - - %n pattern(s) already in use. - Singulier -> 1 -> en toutes lettres - - Un motif déjà utilisé. - %n motifs déjà utilisés. - - - - No MIME type selected. - Pas de type MIME sélectionné. - - - No magic header selected. - Pas d'en-tête magique sélectionné. - - - MIME Types - Types MIME - - - Changes will take effect in the next time you start Qt Creator. - Les changements vont prendre effet au prochain démarrage de Qt Creator. - - - External Tools - Outils externes - - - %1 repository was detected but %1 is not configured. - Le dépôt %1 a été détecté mais %1 n'est pas configuré. - - - Configure - Configurer - - - Version Control - Gestion de versions - - - Would you like to remove this file from the version control system (%1)? -Note: This might remove the local file. - Voulez-vous retirer ce fichier du système de gestion de versions (%1) ? -Note : Ceci risque de supprimer le fichier du disque. - - - Add to Version Control - Ajouter au gestionnaire de version - - - Add the file -%1 -to version control (%2)? - Ajouter le fichier -%1 -au gestionnaire de version (%2) ? - - - Add the files -%1 -to version control (%2)? - Ajouter les fichiers -%1 -au gestionnaire de version (%2) ? - - - Adding to Version Control Failed - L'ajout au gestionnaire de version a échoué - - - Could not add the file -%1 -to version control (%2) - Impossible d'ajouter le fichier -%1 -au gestionnaire de version (%2) - - - Could not add the file -%1 -to version control (%2) - - Impossible d'ajouter le fichier -%1 -au gestionnaire de version (%2) - - - Could not add the following files to version control (%1) -%2 - Impossible d'ajouter les fichiers -%1 -au gestionnaire de version (%2) - - - - QtC::CppEditor - - Sort Alphabetically - Trier par ordre alphabétique - - - &Refactor - &Refactoriser - - - Unused variable - Variable non utilisée - - - Generate missing Q_PROPERTY members... - Générer les membre Q_PROPERTY manquant... - - - Expand All - Développer tout - - - Collapse All - Réduire tout - - - - QtC::Debugger - - &Condition: - &Condition : - - - <html><body><p>The remote CDB needs to load the matching Qt Creator CDB extension (<code>%1</code> or <code>%2</code>, respectively).</p><p>Copy it onto the remote machine and set the environment variable <code>%3</code> to point to its folder.</p><p>Launch the remote CDB as <code>%4 &lt;executable&gt;</code> to use TCP/IP as communication protocol.</p><p>Enter the connection parameters as:</p><pre>%5</pre></body></html> - <html><body><p>L'instance distante de CDB doit charger l'extension correspondante de Qt Creator (<code>%1</code> ou <code>%2</code>, respectivement).</p><p>Copiez-la sur la machine distante et définissez la variable d'environnement <code>%3</code> pour qu'elle pointe sur son dossier.</p><p>Lancez l'instance distante de CDB comme <code>%4 &lt;executable&gt;</code> pour utiliser TCP/IP comme protocole de communication.</p><p>Entrez les paramètres de connexion comme ceci : </p><pre>%5</pre></body></html> - - - Start a CDB Remote Session - Lancer une session CDB distante - - - &Connection: - &Connexion : - - - Memory... - Mémoire... - - - Debugger Toolbar - Barre d'outils du débogueur - - - No function selected. - Pas de fonction sélectionnée. - - - Running to function "%1". - Lancement de la fonction "%1". - - - Process %1 - Processus %1 - - - Attaching to local process %1. - Attacher au processus local %1. - - - Remote: "%1" - Distant : "%1" - - - Attaching to remote server %1. - Attachement au serveur distant %1. - - - Core file "%1" - Fichier core "%1" - - - Attaching to core file %1. - Attacher au fichier core %1. - - - Crashed process %1 - Processus %1 crashé - - - Attaching to crashed process %1 - Attacher au processus crashé %1 - - - Cannot attach to PID 0 - Impossible de s'attacher au PID 0 - - - 0x%1 hit - Message tracepoint: Address hit. - 0x%1 atteint - - - %1:%2 %3() hit - Message tracepoint: %1 file, %2 line %3 function hit. - %1 : %2 %3() atteinte - - - Add Message Tracepoint - Ajouter un message de traçage - - - Executable file "%1" - Fichier exécutable "%1" - - - Debugging file %1. - Fichier de débogage %1. - - - Cannot attach to process with PID 0 - Impossible de s'attacher au processus avec PID 0 - - - Remove Breakpoint %1 - Supprimer le point d'arrêt %1 - - - Disable Breakpoint %1 - Désactiver le point d'arrêt %1 - - - Enable Breakpoint %1 - Activer le point d'arrêt %1 - - - Edit Breakpoint %1... - Editer le point d'arrêt %1... - - - Set Breakpoint at 0x%1 - Placer un point d'arrêt à 0x%1 - - - Set Breakpoint at line %1 - Placer un point d'arrêt à la ligne %1 - - - Set Message Tracepoint at 0x%1... - Placer un message de traçage à 0x%1... - - - Set Message Tracepoint at line %1... - Placer un message de traçage à la ligne %1... - - - Start '%1' and break at function 'main()' - Lancer "%1" et s'arrêter à la fonction "main()" - - - Save Debugger Log - Sauvegarder le log du débogueur - - - User commands are not accepted in the current state. - Les commandes utilisateur ne sont pas acceptées dans l'état courant. - - - Debugger finished. - Débogage terminé. - - - Set Breakpoint at Line %1 - Définir un point d'arrêt à la ligne %1 - - - Set Message Tracepoint at Line %1... - Définir un message de traçage à la ligne %1... - - - Disassemble Function "%1" - Désassembler la fonction "%1" - - - Starting debugger "%1" for ABI "%2"... - Démarrage du débogueur "%1" pour l'ABI "%2"... - - - Continue - Continue - - - Exit Debugger - Quitter le débogueur - - - Interrupt - Interrompre - - - Debugger is Busy - Le débogeur est occupé - - - Abort Debugging - Annuler le débogage - - - Aborts debugging and resets the debugger to the initial state. - Annuler le débogage et réinitialiser le débogueur a son état initial. - - - Step Over - Passer - - - Step Into - Entrer dans - - - Step Out - Sortir de - - - Run to Line - Exécuter jusqu'à la ligne - - - Run to Selected Function - Exécuter jusqu'à la fonction sélectionnée - - - Immediately Return From Inner Function - Retourne immédiatement d'une fonction interne - - - Jump to Line - Sauter à la ligne - - - Toggle Breakpoint - Basculer le point d'arrêt - - - Add to Watch Window - Ajouter à la fenêtre d'observateurs - - - Reverse Direction - Inverser la direction - - - Move to Called Frame - Se déplacer sur la frame appelée - - - Move to Calling Frame - Se déplacer sur la frame appelante - - - Error evaluating command line arguments: %1 - Erreur durant l'évaluation des arguments de la ligne de commande : %1 - - - Start Debugging - Commencer le débogage - - - Start Debugging Without Deployment - Démarrer le débogage sans déploiement - - - Start and Debug External Application... - Déboguer une application externe... - - - Start and Debug External Application with External Engine... - Lancer et déboguer une application externe avec un moteur externe... - - - Attach to Running Local Application... - Attacher à une application locale en cours d'exécution... - - - Load Core File... - Charger un fichier core... - - - Attach to Running External Application... - Attacher à une application externe en cours d'éxecution... - - - Attach to Core... - Attacher au core... - - - Start and Debug Remote Application... - Déboguer une application distance... - - - Attach to Remote Debug Server... - Attacher à un serveur de débogage distant... - - - Start Remote Debug Server Attached to Process... - Démarrer un serveur de débogage distant attaché au processus... - - - Attach to Running Remote Process... - Attacher à un processus distant en cours d'exécution... - - - Attach to QML Port... - Attacher au port QML... - - - Attach to Running Tcf Agent... - Attacher à un agent Tcf en cours d'éxecution... - - - This attaches to a running 'Target Communication Framework' agent. - Ceci attache à un agent 'Target Communication Framework' en cours d'éxecution. - - - Start and Attach to Remote Application... - Démarrer et attacher sur une application à distance... - - - Attach to Remote CDB Session... - Attacher à une session CDB distante... - - - Detach Debugger - Détacher le débogueur - - - Start Gdbserver - Démarrer Gbdserver - - - Attach to Remote Process - Attacher à un processus distant - - - Interrupt Debugger - Interrompre le débogueur - - - Stop Debugger - Arrêter le débogueur - - - Debug Information - Information de débogage - - - Debugger Runtime - Exécution du débogueur - - - Process Already Under Debugger Control - Processus déjà sous contrôle d'un débogueur - - - The process %1 is already under the control of a debugger. -Qt Creator cannot attach to it. - Le processus %1 est déjà sous contrôle d'un débogueur. -Qt Creator ne peut pas s'y attacher. - - - Ctrl+Y - Ctrl+Y - - - F5 - F5 - - - Attach to Running Application... - Attacher à l'application en cours d'exécution... - - - Attach to Running Application - Attacher à l'application en cours d'exécution - - - Shift+Ctrl+Y - Maj+Ctrl+Y - - - Shift+F5 - Shift+F5 - - - Reset Debugger - Réinitialiser le débogueur - - - Ctrl+Shift+O - Ctrl+Maj+O - - - F10 - F10 - - - Ctrl+Shift+I - Ctrl+Maj+I - - - F11 - F11 - - - Ctrl+Shift+T - Ctrl+Maj+T - - - Shift+F11 - Maj+F11 - - - Shift+F8 - Maj+F8 - - - Ctrl+F10 - Ctrl+F10 - - - Ctrl+F6 - Ctrl+F6 - - - F12 - F12 - - - F8 - F8 - - - F9 - F9 - - - Apply Changes on Save - Appliquer les changements à la sauvegarde - - - Show Application on Top - Afficher l'application au premier plan - - - From - À partir de - - - To - Vers - - - Flags - Flags - - - Sections in "%1" - Sections dans "%1" - - - Show Application On Top - Montrer l'application en avant-plan - - - Select - Sélectionner - - - Zoom - Zoom - - - Threads: - Threads : - - - Symbol - Symbole - - - Address - Adresse - - - Code - Code - - - Section - Section - - - Symbols in "%1" - Symboles dans "%1" - - - <new source> - <nouvelle source> - - - <new target> - <nouvelle cible> - - - Source path - Chemin des sources - - - Target path - Chemin de destination - - - Add Qt sources... - Ajouter les sources de Qt... - - - Remove - Supprimer - - - Source Paths Mapping - Chemins de source du Mapping - - - <html><head/><body><p>Mappings of source file folders to be used in the debugger can be entered here.</p><p>This is useful when using a copy of the source tree at a location different from the one at which the modules where built, for example, while doing remote debugging.</body></html> - <html><head/><body><p>Le mapping des répertoire de fichier source à utilisez dans le débogueur peut être entré ici.</p><p>Cela est utile si vous utilisez une copie de l'arbre des sources à un emplacement différent de celui où est compilé le module, par exemple, si vous faites du débogage distant.</body></html> - - - Add a mapping for Qt's source folders when using an unpatched version of Qt. - Ajouter un mapping pour les répertoires des sources Qt quand vous utilisez une version de Qt non patché. - - - The source path contained in the debug information of the executable as reported by the debugger - Le chemin des sources contenu dans les informations de débogage de l'exécutable, comme reporté par le débogueur - - - The source path contained in the executable's debug information as reported by the debugger - Le chemin des sources contenu dans les informations de débogage de l'exécutable, comme reporté par le débogueur - - - &Source path: - Chemin des &sources : - - - The actual location of the source tree on the local machine - L'emplacement réel des sources sur la machine locale - - - &Target path: - Chemin de des&tination : - - - Qt Sources - Sources de Qt - - - %1 (%2) - %1 (%2) - - - <html><head/><body><table><tr><td>ABI:</td><td><i>%1</i></td></tr><tr><td>Debugger:</td><td>%2</td></tr> - <html><head/><body><table><tr><td>ABI :</td><td><i>%1</i></td></tr><tr><td>Débogueur :</td><td>%2</td></tr> - - - Debugging complex command lines is currently not supported under Windows - Débogueur des lignes de commande complexes n'est pas actuellement supporté sous Windows - - - Debugging complex command lines is currently not supported on Windows. - Débogueur des lignes de commande complexes n'est pas actuellement supporté sous Windows. - - - Fatal engine shutdown. Incompatible binary or IPC error. - Arrêt fatal du moteur. Erreur de compatibilité des binaires ou 'IPC. - - - qtcreator-lldb failed to start: %1 - qtcreator-lldb n'a pas pu démarrer : %1 - - - Fatal engine shutdown. Consult debugger log for details. - Arrêt fatal du moteur. Consulter le journal d'événement du débogueur pour plus de détails. - - - SSH connection error: %1 - Erreur de connexion SSH : %1 - - - LLDB - LLDB - - - Memory $ - Mémoire $ - - - No memory viewer available - Aucun visualiseur de mémoire disponible - - - Memory at 0x%1 - Mémoire à 0x%1 - - - No Memory Viewer Available - Aucun visualiseur de mémoire disponible - - - The memory contents cannot be shown as no viewer plugin for binary data has been loaded. - Le contenu de la mémoire ne peut pas être affiché car aucun éditeur pour des données binaires n'a pu être chargé. - - - The slave debugging engine required for combined QML/C++-Debugging could not be created: %1 - Le moteur de débogage esclave requis pour le débogage combiné QML/C++ n'a pas pu être créé : %1 - - - C++ debugger activated - Débogueur C++ activé - - - QML debugger activated - Débogueur QML activé - - - %1 debugger activated - Débogueur %1 activé - - - QML/C++ Debugging - Débogage QML/C++ - - - Cannot stop execution before QML engine is started. Skipping breakpoint. -Suggestions: Move the breakpoint after QmlApplicationViewer instantiation or switch to C++ only debugging. - Impossible d'arrêter l'exécution avant que le moteur QML est démarré. Le point d'arrêt est ignoré. -Suggestions : déplacer le point d'arrêt après l'instanciation de QmlApplicationViewer ou passer au débogage du code C++ exclusivement. - - - QML Debugger connected. - Débogueur QML connecté. - - - QML Debugger connecting... - Connexion du débogueur QML... - - - No application output received in time - Pas de sortie de l'application reçue à temps - - - Qt Creator - Qt Creator - - - Could not connect to the in-process QML debugger. -Do you want to retry? - Impossible de se connecter au processus du débogueur QML. Voulez-vous réessayer ? - - - Could not connect to the in-process QML debugger. -%1 - Impossible de se connecter au processus de débogage QML. %1 - - - QML Debugger: Remote host closed connection. - Débogueur QML : l'hôte distant a fermé la connexion. - - - QML Debugger: Could not connect to service '%1'. - Débogueur QML : impossible de se connecter au service "%1". - - - JS Source for %1 - Source JS pour %1 - - - QML debugging port not set: Unable to convert %1 to unsigned int. - Le port de débogage QML n'est pas défini : impossible de convertir %1 en unsigned int. - - - Run to line %1 (%2) requested... - Exécution jusqu'à la ligne %1 (%2) demandée... - - - Context: - Contexte : - - - Context: - Contexte : - - - The port seems to be in use. - Error message shown after 'Could not connect ... debugger:" - Le port semble déjà utilisé. - - - The application is not set up for QML/JS debugging. - Error message shown after 'Could not connect ... debugger:" - L'application n'est pas configurée pour du débogage QML/JS. - - - Starting %1 %2 - Démarrer %1 %2 - - - Application startup failed: %1 - Échec du démarrage de l'application : %1 - - - QML Debugger disconnected. - Débogueur QML déconnecté. - - - - QtC::Git - - Use the patience algorithm for calculating the diff - Utiliser l'algorithme patience pour calculer le diff - - - Use the patience algorithm for calculating the differences. - Utiliser l'algorithme patience pour calculer les différences. - - - Patience - Patience - - - Ignore whitespace only changes. - Ignorer les changement relatifs aux espaces. - - - Ignore whitespace only changes - Ignorer les changement relatifs aux espaces - - - Ignore Whitespace - Ignorer les espaces - - - Select the pretty printing format - Sélectionner le format d'affichage - - - Select the pretty printing format. - Sélectionner le format d'affichage. - - - oneline - en une ligne - - - short - court - - - medium - moyen - - - full - complet - - - fuller - plus complet - - - email - email - - - raw - brut - - - Do not show the date a change was made in the output - Ne pas afficher à qu'elle date un changement a été fait sur la sortie - - - Hide the date of a change from the output. - Cacher la date d'un changement de la sortie. - - - Omit Date - Omettre la date - - - - QtC::GlslEditor - - %1 of %2 - %1 de %2 - - - GLSL - GLSL sub-menu in the Tools menu - GLSL - - - Creates a fragment shader in the OpenGL/ES 2.0 Shading Language (GLSL/ES). Fragment shaders generate the final pixel colors for triangles, points and lines rendered with OpenGL. - Crée un fragment shader dans le langage de shaders d'OpenGL/ES 2.0 (GLSL/ES). Les fragment shaders génèrent la couleur finale des pixels pour les triangles, points et lignes rendues avec OpenGL. - - - Fragment Shader (OpenGL/ES 2.0) - Fragment shader (OpenGL/ES 2.0) - - - Creates a vertex shader in the OpenGL/ES 2.0 Shading Language (GLSL/ES). Vertex shaders transform the positions, normals and texture co-ordinates of triangles, points and lines rendered with OpenGL. - Crée un vertex shader dans le langage de shaders d'OpenGL/ES 2.0 (GLSL/ES). Les vertex shaders transforment les positions, normales et coordonnées des textures des triangles, points et lignes rendues avec OpenGL. - - - Vertex Shader (OpenGL/ES 2.0) - Vertex shader (OpenGL/ES 2.0) - - - Creates a fragment shader in the Desktop OpenGL Shading Language (GLSL). Fragment shaders generate the final pixel colors for triangles, points and lines rendered with OpenGL. - Crée un fragment shader dans le langage de shaders d'OpenGL (GLSL). Les fragment shaders génèrent la couleur finale des pixels pour les triangles, points et lignes rendues avec OpenGL. - - - Fragment Shader (Desktop OpenGL) - Fragment shader (OpenGL) - - - Creates a vertex shader in the Desktop OpenGL Shading Language (GLSL). Vertex shaders transform the positions, normals and texture co-ordinates of triangles, points and lines rendered with OpenGL. - Crée un vertex shader dans le langage de shaders d'OpenGL (GLSL). Les vertex shaders transforment les positions, normales et coordonnées des textures des triangles, points et lignes rendues avec OpenGL. - - - Vertex Shader (Desktop OpenGL) - Vertex shader (OpenGL) - - - New %1 - Nouveau %1 - - - - QtC::Macros - - Macros - Macros - - - Playing Macro - Lancer une macro - - - An error occured while replaying the macro, execution stopped. - Une erreur est apparue lors de l'exécution de la macro, exécution arrêtée. - - - An error occurred while replaying the macro, execution stopped. - Une erreur est apparue lors de l'exécution de la macro, exécution arrêtée. - - - Macro mode. Type "%1" to stop recording and "%2" to play it - Mode macro. Tapez "%1" pour arrêter l'enregistrement et "%2" pour le lancer - - - Stop Recording Macro - Arrêter d'enregistrer la macro - - - &Macros - &Macros - - - Record Macro - Enregistrer une macro - - - Ctrl+( - Ctrl+( - - - Alt+( - Alt+( - - - Ctrl+) - Ctrl+) - - - Alt+) - Alt+) - - - Play Last Macro - Lancer la dernière macro - - - Alt+R - Alt+R - - - Meta+R - Meta+R - - - Save Last Macro - Sauvegarder la dernière macro - - - - QtC::ProjectExplorer - - GCC - GCC - - - Platform codegen flags: - Flags de plateforme de la génération de code : - - - Platform linker flags: - Flags de plateforme de l'éditeur de liens : - - - MinGW - MinGW - - - Linux ICC - ICC Linux - - - MSVC - MSVC - - - Initialization: - Initialisation : - - - No CDB debugger detected (neither 32bit nor 64bit). - Aucun débogueur CDB trouvé (32bit ou 64bit). - - - No 64bit CDB debugger detected. - Aucune débogueur CDB 64bit trouvé. - - - The CDB debugger could not be found in %1 - Le débogueur CDB n'a pas pu être trouvé dans %1 - - - &Debugger: - &Débogueur : - - - mkspec: - mkspec : - - - All possible mkspecs separated by a semicolon (';'). - Tout les mkspecs possibles séparés par un point virgule (';'). - - - Name: - Nom : - - - Manual - Manuel - - - <nobr><b>ABI:</b> %1 - <nobr><b>ABI :</b> %1 - - - not up-to-date - pas à jour - - - Name - Nom - - - Type - Type - - - Duplicate Compilers Detected - Duplication de compilateurs détectée - - - The following compiler was already configured:<br> %1<br>It was not configured again. - Le compilateur suivant a déjà été configuré : <br> %1<br>Il n'a pas été configuré à nouveau. - - - The following compilers were already configured:<br> %1<br>They were not configured again. - Les compilateurs suivants ont déjà été configurés : <br> %1<br>Ils n'ont pas été configurés à nouveau. - - - Duplicate Tool Chain detected - Chaîne de compilation dupliquée détectée - - - The following tool chain was already configured:<br> %1<br>It was not configured again. - La chaîne de compilation suivante a déjà été configurée : <br/> %1<br/>Elle n'a pas été configurée à nouveau. - - - Duplicate Tool Chains detected - Chaînes de compilation dupliquées détectées - - - The following tool chains were already configured:<br> %1<br>They were not configured again. - Les chaînes de compilation suivantes ont déjà été configurées : <br/> %1<br/>Elles n'ont pas été configurées à nouveau. - - - Tool Chains - Chaînes de compilation - - - Compilers - Compilateurs - - - Clone - Cloner - - - - QmlDesigner::ItemLibraryWidget - - Library - Title of library view - Bibliothèque - - - Items - Title of library items view - Éléments - - - QML Types - Title of library QML types view - Types QML - - - Resources - Title of library resources view - Ressources - - - Imports - Title of library imports view - Importations - - - <Filter> - Library search input hint text - <Filtre> - - - I - I - - - Manage imports for components - Gérer les imports pour les composants - - - Basic Qt Quick only - Qt Quick basique seulement - - - Meego Components - Composants Meego - - - - QmlDesigner::StatesEditorModel - - base state - Implicit default state - état de base - - - Invalid state name. - Nom d'état invalide. - - - The empty string as a name is reserved for the base state. - La chaîne vide comme nom est réservée à l'état de base. - - - Name already used in another state. - Le nom est déjà utilisé dans un autre état. - - - - QmlDesigner::StatesEditorView - - State%1 - Default name for newly created states - État%1 - - - States Editor - Éditeur d'états - - - base state - état de base - - - - JsFileOptionsPage - - Options - Options - - - Stateless library - Bibliothèque sans état - - - Usually each QML component instance has a unique copy of -imported JavaScript libraries. Indicating that a library is -stateless means that a single instance will be shared among -all components. Stateless libraries will not be able to access -QML component instance objects and properties directly. - Généralement, chaque instance de composant QML possède une copie unique des bibliothèques JavaScript importées. Indiquer qu'une bibliothèque est sans état signifier qu'une seule instance peut être partagée pour tous les composants. Des bibliothèques sans état ne pourront pas accéder à des objets d'instances de composants QML et à leurs propriétés directement. - - - - QtC::QmlJSEditor - - New %1 - Nouveau %1 - - - Show Qt Quick ToolBar - Montrer la barre d'outils Qt Quick - - - Unused variable - Variable inutilisée - - - Refactoring - Refactoriser - - - Expand All - Développer tout - - - Collapse All - Réduire tout - - - - QmlJSInspector::Internal::QmlInspectorToolBar - - Apply Changes on Save - Appliquer les changements à la sauvegarde - - - Show application on top - Montrer l'application en avant-plan - - - Observer Mode - Mode observateur - - - Play/Pause Animations - Lire/mettre en pause les animations - - - Select - Sélectionner - - - Zoom - Zoom - - - Color Picker - Sélecteur de couleur - - - 1x - 1x - - - 0.5x - 0,5x - - - 0.25x - 0,25x - - - 0.125x - 0,125x - - - 0.1x - 0,1x - - - - QmlJSInspector::Internal::QmlJSPropertyInspector - - Enter expression - Entrer une expression - - - Choose color - Choisir une couleur - - - JavaScript expression for %1 - Expression JavaScript pour %1 - - - Color selection for %1 - Sélection de couleur pour %1 - - - - QtC::QmlJSTools - - Functions - Fonctions - - - Methods and functions - Méthodes et fonctions - - - Methods and Functions - Méthodes et fonctions - - - QML Methods and Functions - Méthodes et fonctions QML - - - QML Functions - Fonctions QML - - - Indexing - Indexation - - - Qml import scan - Analyse de l'import Qml - - - Type dump of QML plugin in %1 failed. -Errors: -%2 - - Échec du collecteur de type pour le plug-in QML dans %1. -Erreurs : -%2 - - - - Type dump of C++ plugin failed. -First 10 lines or errors: - -%1 -Check 'General Messages' output pane for details. - Échec du collecteur de type pour le plug-in C++. Les dix premières lignes des erreurs : -%1 -Vérifier le panneau de sortie Messages généraux pour les détails. - - - QML module does not contain information about components contained in plugins - -Module path: %1 -See "Using QML Modules with Plugins" in the documentation. - Le module QML ne contient pas d'informations à propos des composants contenus dans les plugins - -Chemin du module : %1 -Voir dans la documentation "Utilisation des modules QML avec les plugins". - - - Automatic type dump of QML module failed. -Errors: -%1 - - Échec du collecteur de type automatique du module QML. -Erreurs : -%1 - - - - Automatic type dump of QML module failed. -Errors: -%1 - Échec du collecteur de type automatique du module QML. -Erreurs : -%1 - - - Automatic type dump of QML module failed. -First 10 lines or errors: - -%1 -Check 'General Messages' output pane for details. - Échec du collecteur de type automatique du module QML. -10 premières lignes d'erreurs : - -%1 -Vérifiez 'Messages généraux' dans le panel de sortie pour plus de détails. - - - Warnings while parsing qmltypes information of %1: -%2 - Avertissements lors de l'analyse des informations de qmltypes de %1 : -%2 - - - "%1" failed to start: %2 - "%1" n'a pas pu démarrer : %2 - - - "%1" crashed. - "%1" a crashé. - - - "%1" timed out. - "%1" a expiré. - - - I/O error running "%1". - Erreur E/S lors de l'exécution de "%1". - - - "%1" returned exit code %2. - "%1" a retourné le code %2. - - - Arguments: %1 - Arguments : %1 - - - Errors while reading typeinfo files: - Erreurs lors de la lecture des fichiers d'informations sur les types : - - - Could not locate the helper application for dumping type information from C++ plugins. -Please build the qmldump application on the Qt version options page. - Impossible de trouver l'application d'aide pour la collecte des informations sur les types à partir des plugins C++. -Veuillez compiler l'application qmldump à partir de la page d'options à propos de la version de Qt. - - - Type dump of C++ plugin failed. Parse error: -'%1' - Échec du collecteur de type pour le plug-in C++.Erreur de parsage : %1 - - - - Could not open file '%1' for reading. - Impossible d'ouvrir le fichier "%1" pour lecture. - - - Failed to parse '%1'. -Error: %2 - Impossible de parser "%1". Erreur : %2 - - - Could not locate the helper application for dumping type information from C++ plugins. -Please build the debugging helpers on the Qt version options page. - Impossible de localiser l'application d'assistance pour les information de type des plug-ins C++. Veuillez compiler les assistants de débogage sur la page des options de version de Qt. - - - - QtC::QmlProjectManager - - Manage Qt versions... - Gestionnaire des versions de Qt... - - - Arguments: - Arguments : - - - Main QML file: - Fichier QML principal : - - - - QtC::QmakeProjectManager - - The target directory %1 could not be created. - Le dossier cible %1 n'a pas pu être créé. - - - QML Debugging library could not be built in any of the directories: -- %1 - -Reason: %2 - La bibliothèque de débogage QML n'a pas pu être compilée dans le moindre répertoire : -- %1 - -Raison : %2 - - - Maemo5 - Qt4 Maemo5 target display name - Maemo5 - - - Harmattan - Qt4 Harmattan target display name - Harmattan - - - MeeGo - Qt4 MeeGo target display name - MeeGo - - - Meego - Qt4 Meego target display name - Meego - - - GCCE - GCCE - - - GCCE from Qt version - GCCE de la version de Qt - - - GCCE (%1) - GCCE (%1) - - - <b>IP address:</b> %1:%2 - <b>adresse IP :</b> %1:%2 - - - ARMv5 - ARMv5 - - - ARMv6 - ARMv6 - - - RVCT - RVCT - - - RVCT (%1 %2.%3 Build %4) - %1 arm version, %2 major version, %3 minor version, %4 build number - RVCT (%1 %2.%3 Build %4) - - - The certificate "%1" has already expired and cannot be used. -Expiration date: %2. - Le certificat "%1" a déjà expiré et ne peut pas être utilisé. -Date d'expiration : %2. - - - The certificate "%1" is not yet valid. -Valid from: %2. - Le certificat "%1" n'est pas encore valide. Valide dès : %2. - - - The certificate "%1" is not a valid X.509 certificate. - Le certificat "%1" n'est pas un certificat X.509 valide. - - - Type: - Type : - - - Developer certificate - Certificat développeur - - - Self signed certificate - Certificat autosigné - - - Issued by: - Délivré par : - - - Issued to: - Délivré à : - - - Valid from: - Valide dès : - - - Valid to: - Valide jusque : - - - Capabilities: - Capacités : - - - Supporting %n device(s): - %n manquant au singulier, seule possibilité : 1. mieux en toutes lettres. - - Supportant un périphérique : - Supportant %n périphériques : - - - - The binary package '%1' was patched to be installable after being self-signed. -%2 -Use a developer certificate or any other signing option to prevent this patching from happening. - %1 package name, %2 will be replaced by a list of patching lines. - Le paquet binaire '%1' a été patché pour être installable après avoir été autosigné. -%2 -Utilisez un certificat développeur ou une autre option de signature pour éviter que ce patch apparaisse. - - - Cannot create Smart Installer package as the Smart Installer's base file is missing. Please ensure that it is located in the SDK. - Impossible de créer le paquet Smart Installer, puisque le fichier de base Smart Installer est manquant. Veuillez vous assurer qu'il est bien situé dans le SDK. - - - Created %1 - - %1 créé - - - Sis file not created due to previous errors - - Fichier SIS non créé à cause d'erreurs précédentes - - - Done! - - Fait ! - - - Sis file not created due to previous errors - - Fichier SIS non créé à cause d'erreurs précédentes - - - Freeze - Geler - - - Secondary clean - Deuxième nettoyage - - - Secondary qmake - Deuxième qmake - - - Secondary build - Deuxième compilation - - - Making SIS file - Construire le fichier SIS - - - Done. - - Fait. - - - SIS file not created due to previous errors. - - Fichier SIS non créé à cause d'erreurs précédentes. - - - Created %1. - - %1 créé. - - - WINSCW - WINSCW - - - WINSCW from Qt version - WINSCW depuis la version de Qt - - - - Qt4DefaultTargetSetupWidget - - <b>Error:</b> - Severity is Task::Error - <b>Erreur :</b> - - - <b>Warning:</b> - Severity is Task::Warning - <b>Alerte :</b> - - - - QtC::QmakeProjectManager - - Add build from: - Ajouter une compilation depuis : - - - Add Build - Ajouter une compilation - - - Create Build Configurations: - Créer des configurations de compilation : - - - Create build configurations: - Créer des configurations de compilation : - - - For Each Qt Version One Debug And One Release - Pour chaque version de Qt un debug et une release - - - For One Qt Version One Debug And One Release - Pour une version de Qt un debug et une release - - - Manually - Manuellement - - - None - Aucune - - - Shadow build - Shadow build - - - Incompatible Build Found - Compilation incompatible trouvée - - - The build found in %1 is incompatible with this target. - La compilation trouvée dans %1 est incompatible avec cette cible. - - - Already Imported Build - Compilation déjà importée - - - The build found in %1 is already imported. - La compilation trouvée dans %1 est déjà importée. - - - Import build from %1. - Importer la compilation depuis %1. - - - Use Shadow Building - Utiliser les shadow build - - - No build found - Pas de compilation trouvée - - - The build found in %1 is incompatible with this target - La compilation trouvée dans %1 est incompatible avec cette cible - - - No Build found in %1 matching project %2. - Pas de compilation trouvée dans %1 pour le projet %2 correspondant. - - - Incompatible build found - Compilation incompatible trouvée - - - The Build found in %1 is incompatible with this target - La compilation trouvée dans %1 est incompatible avec cette cible - - - Import build from %1 - Importer la compilation depuis %1 - - - Targets - Cibles - - - Mobile Options - Options mobiles - - - Maemo5 And MeeGo Specific - Spécifique à Maemo5 et MeeGo - - - Maemo5 And Meego Specific - Spécifique à Maemo5 et MeeGo - - - Harmattan Specific - Spécifique à Harmattan - - - Maemo Specific - Spécifique à Maemo - - - New HTML5 Application - Nouvelle application HTML5 - - - This wizard generates a HTML5 application project. - Cet assistant génère un projet d'application HTML5. - - - HTML Options - Options HTML - - - HTML5 Application - Application HTML5 - - - Creates an HTML5 application project that can contain both HTML5 and C++ code and includes a WebKit view. - -You can build the application and deploy it on desktop and mobile target platforms. - Crée un projet d'application HTML 5 qui peut contenir du code C++ et du code HTML 5 et inclut une vue WebKit. - -Vous pouvez construire l'application et la déployer sur les plateformes desktop et mobiles. - - - Creates an HTML5 application project that can contain both HTML5 and C++ code and includes a WebKit view. - -You can build the application and deploy it on desktop and mobile target platforms. For example, you can create signed Symbian Installation System (SIS) packages for this type of projects. - Crée un projet d'application HTML5 qui peut contenir du code C++ et HTML5 et inclure une vue WebKit. - -Voys pouvez compiler l'application et la déployer sur desktop et mobile. Par exemple, vous pouvez créer des paquest Symbian Installation System (SIS) pour ce type de projets. - - - Select HTML File - impératif ? - Sélectionner le fichier HTML - - - Automatically Rotate Orientation - Pivoter l'orientation automatiquement - - - Lock to Landscape Orientation - Verrouiller en orientation paysage - - - Lock to Portrait Orientation - Verrouiller en oriantation portrait - - - Orientation behavior: - Comportement de l'orientation : - - - Invalid Icon - Icône invalide - - - The icon needs to be %1x%2 pixels big, but is not. Do you want Creator to scale it? - L'icône doit faire %1x%2 pixels, mais elle ne remplit pas cette condition. Qt Creator doit-il la mettre à l'échelle ? - - - The icon needs to be 64x64 pixels big, but is not. Do you want Creator to scale it? - L'icône doit faire 64x64 pixels, mais elle ne remplit pas cette condition. Qt Creator doit-il la mettre à l'échelle ? - - - Could not copy icon file. - Impossible de copier le fichier de l'icône. - - - Application icon (64x64): - Icône de l'application (64x64) : - - - Subdirs Project - Projet de sous-répertoires - - - Creates a qmake-based subdirs project. This allows you to group your projects in a tree structure. - Crée un projet de sous-répertoires basé sur qmake. Ceci vous permet de grouper vos projets dans une structure arborescente. - - - Done && Add Subproject - Fait && Ajouter le sous-projet - - - Finish && Add Subproject - Terminé && Ajouter le sous-projet - - - New Subproject - Title of dialog - Nouveau sous-projet - - - This wizard generates a Qt4 subdirs project. Add subprojects to it later on by using the other wizards. - Cet assistant génère un projet Qt4 avec sous-répertoires. Ajoutez-y des sous-projets plus tard en utilisant d'autres assistants. - - - This wizard generates a Qt subdirs project. Add subprojects to it later on by using the other wizards. - Cet assistant génère un projet Qt avec des sous-répertoires. Ajoutez-y des sous-projets plus tard avec d'autres assistants. - - - Target Setup - Installation de la cible - - - <span style=" font-weight:600;">No valid kits found.</span> - <span style=" font-weight:600;">Aucun kit valide trouvé.</span> - - - Please add a kit in the <a href="buildandrun">options</a> or via the maintenance tool of the SDK. - Veuillez ajouter un kit dans le menu <a href="buildandrun">options</a> ou avec l'outil de maintenance du SDK. - - - Select Kits for Your Project - Selectionner un kit pour votre projet - - - Kit Selection - Sélection de kit - - - %1 - temporary - %1 – temporaire - - - Qt Creator can use the following kits for project <b>%1</b>: - %1: Project name - Qt Creator peut utiliser les kits suivant pour le projet <b>%1</> : - - - No Build Found - Pas de compilation trouvée - - - - QtC::TextEditor - - CTRL+D - Ctrl+D - - - Print Document - Imprimer le document - - - File Error - Erreur de fichier - - - <b>Error:</b> Could not decode "%1" with "%2"-encoding. Editing not possible. - <b>Erreur :</b> Impossible de décoder "%1" avec l'encodage "%2". L'édition est impossible. - - - Select Encoding - Choisir l'encodage - - - Delete UTF-8 BOM on Save - Supprimer le BOM UTF-8 à la sauvegarde - - - Add UTF-8 BOM on Save - Ajouter le BOM UTF-8 à la sauvegarde - - - The text is too large to be displayed (%1 MB). - Le texte est trop lourd pour être affiché (%1 Mo). - - - Error - Erreur - - - Not a valid trigger. - Pas un déclencheur valide. - - - Trigger - Déclencheur - - - Trigger Variant - Déclencheur variable - - - Error reverting snippet. - Erreur lors de la restauration du snippet. - - - Snippets - Extraits de code - - - Error While Saving Snippet Collection - Erreur lors de l'enregistrement de la collection de snippets - - - No snippet selected. - Pas de snippet sélectionné. - - - - QtC::VcsBase - - Unable to start process '%1': %2 - Impossible de démarrer le processus "%1" : %2 - - - Timed out after %1s waiting for the process %2 to finish. - Après %1 secondes d'attente, le processus %2 a été terminé. - - - Working... - Travail en cours... - - - Annotate "%1" - Annoter "%1" - - - Copy "%1" - Copier "%1" - - - Describe Change %1 - Décrivez le changement %1 - - - Send to CodePaster... - Envoyer à CodePaster... - - - Apply Chunk... - Appliquer le morceau... - - - Revert Chunk... - Rétablir le morceau... - - - Failed to retrieve data. - Échec de la collecte des données. - - - Unable to Paste - Impossible de coller - - - Code pasting services are not available. - Les services de collage de code ne sont pas disponibles. - - - Revert Chunk - Rétablir le morceau - - - Apply Chunk - Appliquer le morceau - - - Would you like to revert the chunk? - Souhaitez-vous rétabir le morceau ? - - - Would you like to apply the chunk? - Souhaitez-vous appliquer le morceau ? - - - - SymbianUtils::VirtualSerialDevice - - The port %1 could not be opened: %2 (POSIX error %3) - Le port %1 n'a pas pu être ouvert : %2 (erreur POSIX %3) - - - Unable to retrieve terminal settings of port %1: %2 (POSIX error %3) - Impossible de récupérer les paramètrse du terminal pour le port %1 : %2 (erreur POSIX %3) - - - Unable to apply terminal settings to port %1: %2 (POSIX error %3) - Impossible d'appliquer les paramètrse du terminal pour le port %1 : %2 (erreur POSIX %3) - - - Cannot write to port %1: %2 (POSIX error %3) - Impossible d'écrire sur le port %1 : %2 (erreur POSIX %3) - - - The function select() returned an error on port %1: %2 (POSIX error %3) - La fonction select() a retrouné une erreur sur le port %1 : %2 (erreur POSIX %3) - - - Port not found - Port non trouvé - - - Port in use - Port déjà utilisé - - - Timed out - Temps écoulé - - - Port unreachable - Port inaccessible - - - The port %1 could not be opened: %2 - Le port %1 n'a pas pu être ouvert : %2 - - - An error occurred while waiting for read notifications from %1: %2 - Une erreur est apparue lors de l'attente pour les notifications de lecture depuis %1 : %2 - - - An error occurred while reading from %1: %2 - Une erreur est apparue lors de la lecture depuis %1 : %2 - - - An error occurred while writing to %1: %2 - Une erreur est apparue lors de l'écriture sur %1 : %2 - - - An error occurred while syncing on waitForBytesWritten for %1: %2 - Une erreur est apparue lors de la synchronisation sur waitForBytesWritten pour %1 : %2 - - - - QtC::CMakeProjectManager - - Failed opening project '%1': Project is not a file - Échec de l'ouverture du projet "%1" : le projet n'est pas un fichier - - - - QtC::Macros - - - QtC::QmakeProjectManager - - <html><head/><body><table><tr><td>Path to MADDE:</td><td>%1</td></tr><tr><td>Path to MADDE target:</td><td>%2</td></tr><tr><td>Debugger:</td/><td>%3</td></tr></body></html> - <html><head/><body><table><tr><td>Chemin de MADDE :</td><td>%1</td></tr><tr><td>Chemin de la cible MADDE :</td><td>%2</td></tr><tr><td>Débogueur :</td/><td>%3</td></tr></body></html> - - - - AnchorButtons - - Set top anchor - Définir l'ancre en haut - - - Setting anchors in states is not supported. - Définir les ancres dans des états non supportés. - - - Set bottom anchor - Définir l'ancre en bas - - - Set left anchor - Définir l'ancre de gauche - - - Set right anchor - Définir l'ancre de droite - - - Fill to parent - Remplir jusqu'au parent - - - Set vertical anchor - Définir l'ancre verticale - - - Set horizontal anchor - Définir l'ancre horizontale - - - - ColorGroupBox - - Color editor - Éditeur de couleur - - - Hue - Teinte - - - Saturation - Saturation - - - Brightness - Éclat - - - Alpha - Alpha - - - - ColorTypeButtons - - Solid color - Couleur unie - - - Solid color (only editable in base state) - Couleur solide (éditable seulement à l'état de base) - - - Gradient - Dégradé - - - Gradient (only editable in base state) - Dégradé (éditable seulement à l'état de base) - - - Transparent - Transparent - - - Transparent (only editable in base state) - Transparent (éditable seulement à l'état de base) - - - - FlickableSpecifics - - Flickable - Défilable ?. - Flickable - - - Content Size - Taille du contenu - - - Flickable Direction - Flickable Direction - - - Bounds Behavior - Comportement des bords - - - Interactive - Interactive - - - Max. Velocity - Vitesse maximum - - - Maximum Flick Velocity - Vitesse de Flick maximum - - - Deceleration - Ralentissement - - - Flick Deceleration - Ralentissement du Flick - - - - Analyzer::StartRemoteDialog - - Start Debugger - Lancer le débogueur - - - Remote - Distant - - - Host: - Hôte : - - - User: - Utilisateur : - - - You need to pass either a password or an SSH key. - Vous devez passer soit un mot de passe, soit une clé SSH. - - - Password: - Mot de passe : - - - Port: - Port : - - - Private key: - Clé privée : - - - Target - Cible - - - Kit: - Kit : - - - Executable: - Exécutable : - - - Arguments: - Arguments : - - - Working directory: - Répertoire de travail : - - - Start Remote Analysis - Démarrer l'analyse distante - - - - QtC::CppEditor - - Form - Formulaire - - - General - Général - - - Content - Contenu - - - Indent - Indenter - - - "public", "protected" and -"private" within class body - "public", "protected" et "private" -dans le corps de la classe - - - Declarations relative to "public", -"protected" and "private" - Déclarations relatives à "public", -"protected" et "private" - - - Statements within method body - Déclarations dans le corps de la méthode - - - Statements within blocks - Déclarations dans les blocs - - - Declarations within -"namespace" definition - Déclarations dans la -définition de "namespace" - - - Braces - Accolades - - - Indent Braces - Indenter les accolades - - - Class declarations - Déclarations de classes - - - Namespace declarations - Déclarations d'espaces de noms - - - Enum declarations - Déclarations d'énumérations - - - Method declarations - Déclarations de méthodes - - - Blocks - Blocs - - - "switch" - "switch" - - - Indent within "switch" - Indenter à l'intérieur -de "switch" - - - "case" or "default" - "case" ou "default" - - - Statements relative to -"case" or "default" - Déclarations relatives à -"case" ou "default" - - - Blocks relative to -"case" or "default" - Blocs relatifs à -"case" ou "default" - - - "break" statement relative to -"case" or "default" - Déclarations "break" relatives -à "case" ou "default" - - - Alignment - Alignement - - - Align - Aligner - - - <html><head/><body> -Enables alignment to tokens after =, += etc. When the option is disabled, regular continuation line indentation will be used.<br> -<br> -With alignment: -<pre> -a = a + - b -</pre> -Without alignment: -<pre> -a = a + - b -</pre> -</body></html> - <html><head/><body> -Active l'alignement des jetons après =, +=, etc. Quand cette option est désactivée, l'indentation régulière de continuation de ligne sera utilisée.<br> -<br> -Avec alignement : -<pre> -a = a + - b -</pre> -Sans alignement : -<pre> -a = a + - b -</pre> -</body></html> - - - Align after assignments - Aligner après les assignations - - - <html><head/><body> -The extra padding usually only affects if statement conditions. Without extra padding: -<pre> -if (a && - b) - c; -</pre> -With extra padding: -<pre> -if (a && - b) - c; -</pre> -</body></html> - <html><head/><body> -La marge supplémentaire affecte en général seulement les conditions if. Sans marge supplémentaire : -<pre> -if (a && - b) - c; -</pre> -Avec marge supplémentaire : -<pre> -if (a && - b) - c; -</pre> -</body></html> - - - Add extra padding to conditions -if they would align to the next line - Ajoute une marge supplémentaire aux conditions -si elles devaient s'aligner sur la ligne suivante - - - <html><head/><body> -Adds an extra level of indentation to multiline conditions in the switch, if, while and foreach statements if they would otherwise have the same or less indentation than a nested statement. - -For four-spaces indentation only if statement conditions are affected. Without extra padding: -<pre> -if (a && - b) - c; -</pre> -With extra padding: -<pre> -if (a && - b) - c; -</pre> -</body></html> - <html><head/><body> -Ajoute un niveau supplémentaire d'indentation aux conditions multilignes dans les switch, if, while et foreach si elle avaient moins ou autant d'indentation qu'un code imbriqué. - -Pour les indentations à quatre espaces, seules les if sont affectés. Sans décalage supplémentaire : -<pre> -if (a && - b) - c; -</pre> -Avec du décalage supplémentaire : -<pre> -if (a && - b) - c; -</pre> -</body></html> - - - Pointers and References - Pointeurs et références - - - Bind '*' and '&&' in types/declarations to - Lier "*" et "&&" dans les types/déclarations de - - - <html><head/><body>This does not apply to the star and reference symbol in pointer/reference to functions and arrays, e.g.: -<pre> int (&rf)() = ...; - int (*pf)() = ...; - - int (&ra)[2] = ...; - int (*pa)[2] = ...; - -</pre></body></html> - <html><head/><body>Cela ne s'applique par à l'étoile et le symbole de la référence pour les pointeurs/références aux fonctions et tableaux, par exemple : -<pre> int (&rf)() = ...; - int (*pf)() = ...; - - int (&ra)[2] = ...; - int (*pa)[2] = ...; - -</pre></body></html> - - - Identifier - Identifiant - - - Type name - Nom du type - - - Left const/volatile - Const/volatile à gauche - - - This does not apply to references. - Cela ne s'applique pas aux références. - - - Right const/volatile - Const/volatile à droite - - - Statements within function body - Instructions dans le corps de la fonction - - - Function declarations - Déclarations de fonction - - - - QtC::Git - - Dialog - Boîte de dialogue - - - Branch Name: - Nom de la branche : - - - CheckBox - Case à cocher - - - Add Branch - Ajouter une branche - - - Rename Branch - Renommer une branche - - - Track remote branch '%1' - Pister la branche distante "%1" - - - Track local branch '%1' - Pister la branche locale "%1" - - - Add Remote - Ajouter distant - - - Name: - Nom : - - - URL: - URL : - - - Remotes - Distants - - - F&etch - Récupér&er - - - Delete Remote - Supprimer le distant - - - Would you like to delete the remote "%1"? - Voulez-vous supprimer le distant "%1" ? - - - &Push - &Envoyer - - - - text - - text - texte - - - Text - Texte - - - - textedit - - text edit - éditeur de texte - - - Text Edit - Modifier le texte - - - - textinput - - text - texte - - - Text - Texte - - - - TimeDisplay - - length: %1 - longueur : %1 - - - - QtC::QmlProfiler - - Dialog - Boîte de dialogue - - - Address: - Adresse : - - - 127.0.0.1 - 127.0.0.1 - - - Port: - Port : - - - QML Profiler - Profileur QML - - - &Host: - &Hôte : - - - localhost - localhost - - - &Port: - &Port : - - - Sys&root: - &Racine système : - - - Start QML Profiler - Démarrer le profileur QML - - - Kit: - Kit : - - - - QtQuickComponentSetOptionsPage - - Built-in elements only (for all platforms) - Seulement les éléments de base (pour toutes les plateformes) - - - Qt Quick Components for Symbian - Composants Qt Quick pour Symbian - - - Qt Quick Components for Meego/Harmattan - Composants Qt Quick pour Meego/Harmattan - - - Use an existing .qml file - Utiliser un fichier .qml existant - - - The built-in elements in the QtQuick namespace allow you to write cross-platform applications with a custom look and feel. - -Requires Qt 4.7.1 or newer. - Les éléments de base dans l'espace de noms Qt Quick permettent d'écrire des applications multiplateformes avec une ergonomie personnalisée. - - - The Qt Quick Components for Symbian are a set of ready-made components that are designed with specific native appearance for the Symbian platform. - -Requires Qt 4.7.3 or newer, and the component set installed for your Qt version. - Les composants Qt Quick pour Symbian sont un ensemble de composants préfabriques prévu pour une apparence spécifique native sur la plateforme Symbian. - -Ils requièrent Qt 4.7.3 ou supérieur et l'ensemble de composants installé pour votre version de Qt. - - - The Qt Quick Components for Meego/Harmattan are a set of ready-made components that are designed with specific native appearance for the Meego/Harmattan platform. - -Requires Qt 4.7.4 or newer, and the component set installed for your Qt version. - Les composants Qt Quick pour Meego/Harmattan sont un ensemble de composants préfabriques prévu pour une apparence spécifique native sur les plateformes Meego/Harmattan. - -Ils requièrent Qt 4.7.3 ou supérieur et l'ensemble de composants installé pour votre version de Qt. - - - All files and directories that reside in the same directory as the main QML file are deployed. You can modify the contents of the directory any time before deploying. - Tous les fichiers et répertoires qui résident dans le même répertoire que le fichier QML principal sont déployés. Vous pouvez en modifier le contenu avant le déploiement. - - - Qt Quick Components for MeeGo/Harmattan - Composants Qt Quick pour MeeGo/Harmattan - - - The Qt Quick Components for MeeGo/Harmattan are a set of ready-made components that are designed with specific native appearance for the MeeGo/Harmattan platform. - -Requires Qt 4.7.4 or newer, and the component set installed for your Qt version. - Les composants Qt Quick pour MeeGo/Harmattan sont un ensemble de composants préfabriqués prévu pour une apparence spécifique native sur les plateformes MeeGo/Harmattan. - -Ils requièrent Qt 4.7.4 ou supérieur et l'ensemble de composants installé pour votre version de Qt. - - - - QtC::QtSupport - - Used to extract QML type information from library-based plugins. - Utilisé pour extraire le type d'information QML pour les bibliothèques basées sur des plug-ins. - - - QML Dump: - Dump QML : - - - A modified version of qmlviewer with support for QML/JS debugging. - Un version modifiée de qmlviewer avec le support de débogage pour QML/JS. - - - QML Observer: - Observateur QML : - - - Build - Compilation - - - QML Debugging Library: - Bibliothèque de débogage QML : - - - Helps showing content of Qt types. Only used in older versions of GDB. - Aide à montrer le contenu des types Qt. Seulement utilisé dans les anciennes versions de GDB. - - - GDB Helper: - Assistant GDB : - - - Show compiler output of last build. - Montrer la sortie du compilateur lors de la dernière compilation. - - - Show Log - Montrer le journal des événements - - - Compile debugging helpers that are checked. - Compiler les assistants de débogage qui sont cochés. - - - Build All - Tout compiler - - - Tool Chain: - Chaîne de compilation : - - - Tool chain: - Chaîne de compilation : - - - Compiler: - Compilateur : - - - Version name: - Nom de version : - - - qmake location: - Emplacement de qmake : - - - Edit - Éditer - - - Name - Nom - - - qmake Location - Emplacement de qmake - - - Add - Ajouter - - - Remove - Supprimer - - - Clean up - Nettoyer - - - Add... - Ajouter... - - - - QtC::Valgrind - - Dialog - Boîte de dialogue - Suppression File: - Fichier de suppression : + Fichier de suppression : Suppression: - Suppression : + Suppression : Select Suppression File - Sélectionner le fichier de suppresion + Sélectionner le fichier de suppression Save Suppression - Sauvegarder la suppression - - - Generic Settings - Paramètres génériques + Enregistrer la suppression Valgrind executable: - Exécutable Valgrind : - - - Memory Analysis Options - Options d'analyse mémoire + Exécutable de Valgrind : Backtrace frame count: - Backtrace le nombre de frame : + Backtracer le nombre de trames : Suppression files: @@ -31904,27 +51922,31 @@ Ils requièrent Qt 4.7.4 ou supérieur et l'ensemble de composants install Add... - Ajouter... + Ajouter… Remove Supprimer + + Valgrind arguments: + Arguments de Valgrind : + + + Extra MemCheck arguments: + Arguments de MemCheck supplémentaires : + Track origins of uninitialized memory Repérer les origines de mémoire non initialisée - - Profiling Options - Options de profilage - Limits the amount of results the profiler gives you. A lower limit will likely increase performance. - Limiter le nombre de résultats donnés par le profileur. Une limite plus basse va probablement améliorer les performances. + Limiter le nombre de résultats donnés par le profileur. Une limite plus basse va probablement améliorer les performances. Result view: Minimum event cost: - Vue du résultat, coût d'événement minimal : + Vue du résultat, coût d’évènement minimal : % @@ -31932,76 +51954,27 @@ Ils requièrent Qt 4.7.4 ou supérieur et l'ensemble de composants install Show additional information for events in tooltips - Montrer des informations supplémentaires sur les événements dans les info-bulles - - - <html><head/><body> -<p>Does full cache simulation.</p> -<p>By default, only instruction read accesses will be counted ("Ir").</p> -<p> -With cache simulation, further event counters are enabled: -<ul><li>Cache misses on instruction reads ("I1mr"/"I2mr")</li> -<li>Data read accesses ("Dr") and related cache misses ("D1mr"/"D2mr")</li> -<li>Data write accesses ("Dw") and related cache misses ("D1mw"/"D2mw")</li></ul> -</p> - -</body></html> - hum... - <html><head/><body> -<p>Effectuer une simulation de cache complète. </p> -<p>Par défaut, seules les instructions d'accès en lecture sont comptées ("Ir").</p> -<p> -Avec la simulation de cache, d'autres compteurs d'événements sont activés : -<ul><li>ratages de cache sur les lectures d'instructions ("I1mr"/"I2mr") ; </li> -<li>accès en lecture aux données ("Dr") et ratages de cache associés ("D1mr"/"D2mr") ; </li> -<li>accès en écriture aux données ("Dw") et ratages de cache associés ("D1mw"/"D2mw").</li></ul> -</p> - -</body></html> + Montrer des informations supplémentaires sur les évènements dans les info-bulles Enable cache simulation Activer la simulation du cache - - <html><head/><body> -<p>Do branch prediction simulation.</p> -<p>Further event counters are enabled: </p> -<ul><li>Number of executed conditional branches and related predictor misses ( -"Bc"/"Bcm")</li> -<li>Executed indirect jumps and related misses of the jump address predictor ( -"Bi"/"Bim")</li></ul></body></html> - <html><head/><body> -<p>Effectue la simulation de prédiction de branche.</p> -<p>Les Compteurs d'événements supplémentaires sont activés : </p> -<ul><li>nombre de branches conditionelles exécutées et ratage du prédicteur associé ( -"Bc"/"Bcm") ; </li> -<li>sauts indirectement exécutés et ratage associés du saut de l'adresse du prédicteur ( -"Bi"/"Bim").</li></ul></body></html> - Enable branch prediction simulation Activer la simulation de prédiction de branche - - Collect information for system call times. - Collecter des informations pour les temps des appels système. - Collect system call time - Collecter les temps des appels système + Recevoir les temps des appels système Collect the number of global bus events that are executed. The event type "Ge" is used for these events. - Collecter le nombre d'événements de bus globaux exécutés. Le type d'événement "Ge" est utilisé. + Recevoir le nombre d’évènements de bus globaux exécutés. Le type d’évènement « Ge » est utilisé. Collect global bus events - Collecter les événements de bus global - - - Visualisation: Minimum event cost: - Visualisation, coût minimal d'événement : + Recevoir les évènements de bus global Valgrind Command @@ -32013,11 +51986,63 @@ Avec la simulation de cache, d'autres compteurs d'événements sont ac Valgrind Suppression File (*.supp);;All Files (*) - Fichier de suppression de Valgind (*.supp);;Tous les fichiers (*) + Fichier de suppression de Valgrind (*.supp);;Tous les fichiers (*) + + + KCachegrind executable: + Exécutable de KCachegrind : + + + KCachegrind Command + Commande de KCachegrind + + + Extra CallGrind arguments: + Arguments de CallGrind supplémentaires : + + + <p>Does full cache simulation.</p> +<p>By default, only instruction read accesses will be counted ("Ir").</p> +<p> +With cache simulation, further event counters are enabled: +<ul><li>Cache misses on instruction reads ("I1mr"/"I2mr").</li> +<li>Data read accesses ("Dr") and related cache misses ("D1mr"/"D2mr").</li> +<li>Data write accesses ("Dw") and related cache misses ("D1mw"/"D2mw").</li></ul> +</p> + <p>Effectue une simulation complète du cache.</p> +<p>Par défaut, seuls les accès en lecture d’instruction sont comptés (« Ir »).</p> +<p> +Avec la simulation du cache, d’autres compteurs d’évènements sont activés : +<ul><li>Manquements au cache lors de la lecture d’instructions (« I1mr »/« I2mr »).</li> +<li>Les accès en lecture de données (« Dr ») et les manquements de cache associés (« D1mr »/« D2mr »).</li> +<li>Accès en écriture de données ("Dw") et manquements de cache associés (« D1mw »/« D2mw »).</li></ul> +</p> + + + <p>Does branch prediction simulation.</p> +<p>Further event counters are enabled: </p> +<ul><li>Number of executed conditional branches and related predictor misses ( +"Bc"/"Bcm").</li> +<li>Executed indirect jumps and related misses of the jump address predictor ( +"Bi"/"Bim").)</li></ul> + <p>Effectue une simulation de prédiction de branche.</p> +<p>D’autres compteurs d’évènements sont activés :</p> +<ul><li>Nombre de branchements conditionnels exécutés et d’échecs du prédicteur correspondants ( +« Bc »/« Bcm »).</li> +<li>Nombre de sauts indirects exécutés et de sauts manqués du prédicteur d’adresse de saut ( +« Bi »/« Bim »).</li></ul> + + + Collects information for system call times. + Reçoit des informations sur les temps d’appel du système. Visualization: Minimum event cost: - Visualisation du coût minimal d'événement : + Visualisation du coût minimal d’évènement : + + + Remove template parameter lists when displaying function names. + Suppression des listes de paramètres des modèles lors de l’affichage des noms de fonctions. Detect self-modifying code: @@ -32027,25 +52052,13 @@ Avec la simulation de cache, d'autres compteurs d'événements sont ac No Non - - Only on Stack - Seulement dans la Pile - - - Everywhere - Partout - - - Everywhere Except in File-backend Mappings - Partout, sauf dans les mappings du File-backend - Show reachable and indirectly lost blocks Montrer les blocs accessibles et indirectement perdu Check for leaks on finish: - Vérification des fuites lorsque c'est fini : + Vérification des fuites lorsque c’est fini : Summary Only @@ -32053,2590 +52066,16 @@ Avec la simulation de cache, d'autres compteurs d'événements sont ac Full - Complet + il est question de la vérification des fuites + Complète - - - QtC::VcsBase - - Configure - Configurer - - - Configuration - Configuration - - - Please configure <b>%1</b> now. - Veuillez configurer <b>%1</b> maintenant. - - - Configure... - Configurer... - - - - FlickableGroupBox - - Flickable - Flickable - - - Content size - Taille du contenu - - - Flick direction - Direction du flick - - - Flickable direction - Direction flickable - - - Behavior - Comportement - - - Bounds behavior - Comportement des bords - - - Interactive - Interactive - - - Max. velocity - Vitesse maximum - - - Maximum flick velocity - Vitesse de flick maximale - - - Deceleration - Ralentissement - - - Flick deceleration - Ralentissement du flick - - - - FlowSpecifics - - Flow - Flux - - - Layout direction - Direction du layout - - - Spacing - Espacement - - - Layout Direction - Direction du layout - - - - GridSpecifics - - Grid - Grille - - - Columns - Colonnes - - - Rows - Lignes - - - Flow - Flux - - - Layout direction - Direction du layout - - - Spacing - Espacement - - - Layout Direction - Direction du layout - - - - GridViewSpecifics - - Grid View - Vue en grille - - - Cache - Cache - - - Cache buffer - Cache du buffer - - - Cell height - Hauteur de celulle - - - Cell width - Largeur de celulle - - - Flow - Flux - - - Resize wraps - ? - Redimensionner les encapsulations - - - Navigation wraps - Encapsulations de navigation - - - Determines whether the grid wraps key navigation. - Détermine si la grille encapsule la navigation par les touches. - - - Snap mode - Mode aimant - - - Determines how the view scrolling will settle following a drag or flick. - Détermine la façon dont le défilement de la vue défile se réglera à la suite d'un glissage ou feuilletage. - - - Grid View Highlight - Surlignage de la vue en grille - - - Range - Intervalle - - - Highlight range - Surlignage de l'intervalle - - - Move duration - Durée de déplacement - - - Move animation duration of the highlight delegate. - Durée de déplacement de l'animation de surlignage des délégués. - - - Move speed - Vitesse de déplacement - - - Move animation speed of the highlight delegate. - Durée de vitesse de l'animation de surlignage des délégués. - - - Preferred begin - Début préféré - - - Preferred highlight begin - must be smaller than Preferred end. - Début préféré de surlignage - doit être plus petit que la fin préférée. - - - Preferred end - Fin préférée - - - Preferred highlight end - must be larger than Preferred begin. - Fin préférée de surlignage - doit être plus grand que le début préféré. - - - Follows current - ? - Suit le courant - - - Determines whether the highlight is managed by the view. - Détermine si le surlignage est géré par la vue. - - - Cell Size - Taille de la cellule - - - Layout Direction - Direction du layout - - - - LineEdit - - Translate this string - Traduire cette chaîne de caractères - - - - ListViewSpecifics - - List View - Vue en liste - - - Cache - Cache - - - Cache buffer - Cache du buffer - - - Navigation wraps - Encapsulations de navigation - - - Determines whether the grid wraps key navigation. - Détermine si la grille encapsule la navigation par les touches. - - - Orientation - Orientation - - - Orientation of the list. - Orientation de la liste. - - - Snap mode - Mode aimant - - - Determines how the view scrolling will settle following a drag or flick. - Détermine comment le défilement de la vue se déroulera pour suivre un glisser ou un flick. - - - Spacing - Espacement - - - Spacing between items. - Espacement entre les éléments. - - - List View Highlight - Surlignage de la vue en liste - - - Range - Intervalle - - - Highlight range - Surlignage de l'intervalle - - - Move duration - Durée de déplacement - - - Move animation duration of the highlight delegate. - Durée de déplacement de l'animation de surlignage des délégués. - - - Move speed - Vitesse de déplacement - - - Move animation speed of the highlight delegate. - Vitesse de déplacement de surlignage des délégués. - - - Resize duration - Durée de redimensionnement - - - Resize animation duration of the highlight delegate. - Durée de redimensionnement de l'animation de surlignage des délégués. - - - Resize speed - Vitesse de redimensionnement - - - Resize animation speed of the highlight delegate. - Vitesse de redimensionnement de l'animation de surlignage des délégués. - - - Preferred begin - Début préféré - - - Preferred highlight begin - must be smaller than Preferred end. - Début préféré de surlignage - doit être plus petit que la fin préférée. - - - Preferred end - Fin préférée - - - Preferred highlight end - must be larger than Preferred begin. - Fin préférée de surlignage - doit être plus grand que le début préféré. - - - Follows current - Suit le courant - - - Determines whether the highlight is managed by the view. - Détermine si le surlignage est géré par la vue. - - - Layout Direction - Direction du layout - - - - MouseAreaSpecifics - - MouseArea - MouseArea - - - Enabled - Activé - - - This property holds whether the item accepts mouse events. - Cette propriété indique si l'item accepte les événements de souris. - - - Hover Enabled - Survol activé - - - This property holds whether hover events are handled. - Cette propriété indique si les événements de survol sont gérés. - - - Mouse Area - MouseArea - - - - PathViewSpecifics - - Path View - Vue en chemin - - - Drag margin - Glisser la marge - - - Flick deceleration - Ralentissement du flick - - - Follows current - Suit le courant - - - A user cannot drag or flick a PathView that is not interactive. - L'utilisateur ne peux pas glisser ou flicker une vue en chemin qui n'est pas interactive. - - - Offset - Décalage - - - Specifies how far along the path the items are from their initial positions. This is a real number that ranges from 0.0 to the count of items in the model. - Détermine la distance sur le chemin qui sépare les éléments avec leurs positions initiales.Il s'agit d'un nombre réel dont l'interval est entre 0.0 et le nombre d'éléments dans le modèle. - - - Item count - Nombre d'éléments - - - pathItemCount: number of items visible on the path at any one time. - pathItemCount : nombre d'éléments visible sur le cheminà n'importe quel moment. - - - Path View Highlight - Surlignage de la vue en chemin - - - Highlight range - Surlignage de l'intervalle - - - Move duration - Durée de déplacement - - - Move animation duration of the highlight delegate. - Durée de déplacement de l'animation de surlignage des délégués. - - - Preferred begin - Début préféré - - - Preferred highlight begin - must be smaller than Preferred end. - Début préféré de surlignage - doit être plus petit que la fin préférée. - - - Preferred end - Fin préférée - - - Preferred highlight end - must be larger than Preferred begin. - Fin préférée de surlignage - doit être plus grand que le début préféré. - - - Determines whether the highlight is managed by the view. - Détermine si le surlignage est géré par la vue. - - - Interactive - Interactive - - - Range - Intervalle - - - - RowSpecifics - - Row - Ligne - - - Layout direction - Direction du layout - - - Spacing - Espacement - - - Layout Direction - Direction du layout - - - - QtC::ProjectExplorer - - Manage Sessions... - Gestion des sessions... - - - Recent Projects - Projets récents - - - Open Project - Ouvrir le projet - - - Create Project - Créer un projet - - - - ExampleBrowser - - Search in Tutorials - Recherche dans les tutoriels - - - Search in Tutorials, Examples and Demos - Recherche dans les tutoriels, exemples et démos - - - Show Examples and Demos - Montrer les exemples et démos - - - Tag List - Liste de tags - - - - QtC::Core - - Tags: - Tags : - - - - FeaturedAndNewsListing - - Featured News - Nouvelles à la une - - - Latest News - Dernières nouvelles - - - - Feedback - - Feedback - Votre avis nous interesse - - - Help us make Qt Creator even better - Aidez-nous à améliorer Qt Creator - - - Search in Tutorials, Examples and Demos - Recherche dans les tutoriels, exemples et démos - - - Open Project... - Ouvrir le projet... - - - Create Project... - Créer un projet... - - - - NewsListing - - Click to read more... - Lire plus... - - - - QtC::ProjectExplorer - - Recently Edited Projects - Projets récemment édités - - - Recently Used Sessions - Sessions récemment utilisées - - - - TagBrowser - - Please choose a tag to filter for: - Veuillez choisir un tag pour filtrer : - - - - QtC::Utils - - Refusing to remove root directory. - Impossible de supprimer le répertoire racine. - - - Refusing to remove your home directory. - Impossible de supprimer le répertoire home. - - - Failed to remove directory '%1'. - Impossible de supprimer le dossier "%1". - - - Failed to remove file '%1'. - Impossible de supprimer le fichier "%1". - - - Failed to create directory '%1'. - Impossible de créer le dossier "%1". - - - Could not copy file '%1' to '%2'. - Impossible de copier le fichier "%1" à "%2". - - - Cannot open %1 for reading: %2 - Impossible d'ouvrir %1 en lecture : %2 - - - Cannot read %1: %2 - Impossible de lire %1 : %2 - - - File Error - Erreur de fichier - - - Cannot write file %1. Disk full? - Impossible d'écrire dans le fichier %1. Disque plein ? - - - Cannot overwrite file %1: %2 - L'écrasement du fichier %1 a échoué : %2 - - - Cannot create file %1: %2 - Impossible de créer le fichier %1 : %2 - - - Cannot create temporary file in %1: %2 - Impossible de créer un fichier temporaire dans %1 : %2 - - - - Analyzer::AnalyzerManagerPrivate - - &Analyze - &Analyser - - - Start - Démarrer - - - Stop - Arrêter - - - Analyzer Toolbar - Barre d'outils de l'analyseur - - - <html><head/><body><p>You are trying to run the tool "%1" on an application in %2 mode. The tool is designed to be used in %3 mode.</p><p>Debug and Release mode run-time characteristics differ significantly, analytical findings for one mode may or may not be relevant for the other.</p><p>Do you want to continue and run the tool in %2 mode?</p></body></html> - <html><head/><body><p>Vous essayez d'exécuter l'outil "%1" sur une application en mode %2. L'outil a été conçu pour être utilisé dans le mode %3.</p><p>Les modes Debug et Release ont des caratéristiques d'exécution très différentes, les suppositions analytiques d'un mode peuvent être ou ne pas être pertinentes pour un autre mode.</p><p>Souhaitez-vous continuer et exécuter l'outil dans le mode %2 ?</p></body></html> - - - <html><head/><body><center><i>%1</i> is still running. You have to quit the Analyzer before being able to run another instance.<center/><center>Force it to quit?</center></body></html> - <html><head/><body><center><i>%1</i> est toujours en cours d'exécution. Vous devez quitter l'analyseur avant de pouvoir exécuter une nouvelle instance.</center><center>Voulez-vous le forcer à quitter ?</center></body></html> - - - Analyzer Still Running - L'analyseur est toujours en cours d'exécution - - - Stop Active Run - Arrêter l'exécution active - - - Keep Running - Continuer l'exécution - - - Debug - Debug - - - Release - Release - - - Run %1 in %2 Mode? - Lancer %1 en mode %2? - - - <html><head/><body><p>You are trying to run the tool "%1" on an application in %2 mode. The tool is designed to be used in %3 mode.</p><p>Do you want to continue and run it in %2 mode?</p></body></html> - <html><head/><body><p>Vous essayez d'exécuter l'outil "%1" en mode %2 sur une application. Cette outil est prévu pour être utilisé en mode %3.</p><p>Voulez-vous continuer et le lancer en mode %2 ?</p></body></html> - - - &Do not ask again - Ne plus re&demander - - - An analysis is still in progress. - Une analyse est toujours en cours. - - - No analyzer tool selected. - Pas d'outil d'analyse sélectionné. - - - - Analyzer::AnalyzerRunConfigWidget - - Analyzer Settings - Réglages de l'analyseur - - - Available settings: %1 - Options diponibles : %1 - - - Use <strong>Customized Settings<strong> - Utiliser les <strong>paramètres personnalisés</strong> - - - Use <strong>Global Settings<strong> - Utiliser les <strong>paramètres globaux</strong> - - - - Analyzer::AnalyzerRunControl - - Build Issues - Problèmes de compilation - - - - QtC::Bazaar - - Ignore whitespace - Ignorer les espaces - - - Ignore blank lines - Ignorer les lignes vides - - - Ignore Whitespace - Ignorer les espaces - - - Ignore Blank Lines - Ignorer les lignes vides - - - - QtC::CMakeProjectManager - - Changes to cmake files are shown in the project tree after building. - Les changements aux fichiers CMake sont montrés dans l'arbre du projet après la compilation. - - - Build now - Compiler maintenant - - - - QtC::Core - - Overwrite Existing Files - Écraser les fichiers existants - - - The following files already exist in the folder -%1. -Would you like to overwrite them? - Les fichiers suivants existent déjà dans le dossier %1. Voulez-vous les écraser ? - - - File was restored from auto-saved copy. Use <i>Save</i> to confirm, or <i>Revert to Saved</i> to discard changes. - Le fichier a été restauré depuis une copie de sauvegarde automatique. Utilisez <i>Sauver</i> pour confirmer ou <i>Retour à la sauvegarde</i> pour effacer les changements. - - - Do not show again - Ne plus afficher - - - Additional output omitted - - Sortie supplémentaire omise - - - - Additional output omitted - Sortie supplémentaire omise - - - - QtC::CodePaster - - <Unknown> - Unknown user of paste. - <Inconnu> - - - - QtC::CppEditor - - Code style settings: - Paramètres de style de code : - - - Global C++ - Settings - Globaux C++ - - - Global - Settings - Globale - - - Qt - Qt - - - GNU - GNU - - - Old Creator - Ancien Creator - - - - QtC::CVS - - Ignore whitespace - Ignorer les espaces - - - Ignore blank lines - Ignorer les lignes vides - - - Ignore Whitespace - Ignorer les espaces - - - Ignore Blank Lines - Ignorer les lignes vides - - - - QtC::Debugger - - Previous - Précédent - - - Memory at Register '%1' (0x%2) - Mémoire au registre "%1" (0x%2) - - - Register '%1' - Registre "%1" - - - - QtC::FakeVim - - Action - Action - - - Command - Commande - - - User command #%1 - Commande utilisateur #%1 - - - User Command Mapping - Correspondance des commandes utilisateur - - - - QtC::GenericProjectManager - - Hide files matching: - Cacher les fichiers correspondant à : - - - Show files matching: - Afficher les fichiers correspondants : - - - Apply Filter - Appliquer le filtre - - - Edit Files... - Éditer les fichiers... - - - Edit Files - Éditer les fichiers - - - Generating file list... - -%1 - Génération de la liste des fichiers... - -%1 - - - Not showing %n files that are outside of the base directory. -These files are preserved. - avertissement ok - - Ne pas montrer le fichier en dehors du répertoire de base. Ces fichiers sont préservés. - Ne pas montrer les %n fichiers en dehors du répertoire de base. Ces fichiers sont préservés. - - - - - QtC::Git - - Local Branches - Branches locales - - - Remote Branches - Branches distantes - - - Tags - Tags - - - - QtC::ImageViewer - - Cannot open image file %1 - Impossible d'ouvrir le fichier d'image %1 - - - Cannot open image file %1. - Impossible d'ouvrir le fichier d'image %1. - - - Play Animation - Jouer l'animation - - - Pause Animation - Mettre en pause l'animation - - - - QtC::Mercurial - - Ignore whitespace - Ignorer les espaces - - - Ignore blank lines - Ignorer les lignes vides - - - Ignore Whitespace - Ignorer les espaces - - - Ignore Blank Lines - Ignorer les lignes vides - - - - QtC::Perforce - - Ignore whitespace - Ignorer l'espace blanc - - - Ignore Whitespace - Ignorer les espaces - - - - QtC::ProjectExplorer - - <custom> - <personnalisé> - - - Attach debugger to this process - Attacher le débogueur à ce processus - - - Attach debugger to %1 - Attacher le débogueur à %1 - - - Stop - Arrêter - - - Close Tab - Fermer l'oblet - - - Close All Tabs - Fermer tous les onglets - - - Close Other Tabs - Fermer tout les autres onglets - - - Re-run this run-configuration - Relancer cette configuration de lancement - - - Application Output - Sortie de l'application - - - Application Output Window - Fenêtre de sortie de l'application - - - Code Style Settings - Paramètres de style de code - - - Code Style - Style de code - - - - CodeStyleSettingsPanel - - Code Style Settings - Paramètres de style de code - - - Code Style - Style de code - - - - QtC::ProjectExplorer - - Project - Settings - Projet - - - Project %1 - Settings, %1 is a language (C++ or QML) - Projet %1 - - - Clang - Clang - - - - QtC::Welcome - - %1 (current session) - %1 (session courante) - - - - QmlDesigner::ComponentAction - - Edit sub components defined in this file - Éditer les sous-composants définis dans ce fichier - - - - QmlDesigner::NodeInstanceServerProxy - - Cannot Start QML Puppet Executable - Impossible de démarrer l'exécutable QML Puppet - - - The executable of the QML Puppet process (%1) cannot be started. Please check your installation. QML Puppet is a process which runs in the background to render the items. - L'exécutable du processus QML Puppet (%1) ne peut être démarré. Merci de vérifier votre installation. QML Pupper est un processus qui exécute en tâche de fond le rendu des éléments. - - - Cannot Find QML Puppet Executable - Impossible de trouver l'exécutable QML Puppet - - - The executable of the QML Puppet process (<code>%1</code>) cannot be found. Check your installation. QML Puppet is a process which runs in the background to render the items. - L'exécutable du processus QML Puppet (<code>%1</code>) ne peut être trouvé. Merci de vérifier votre installation. QML Pupper est un processus qui exécute en tâche de fond le rendu des éléments. - - - You can build <code>qml2puppet</code> yourself with Qt 5.0.1 or higher. The source can be found in <code>%1</code>. - Vous pouvez compiler <code>qml2pupper</code> vous-même avec Qt 5.0.1 ou supérieur. Les fichiers source peuvent être trouvés dans <code>%1</code>. - - - <code>qml2puppet</code> will be installed to the <code>bin</code> directory of your Qt version. Qt Quick Designer will check the <code>bin</code> directory of the currently active Qt version of your project. - <code>qml2puppet</code> sera installé dans le répertoire <code>bin</code> de votre version Qt. Qt Quick Designer vérifiera le répertoire <code>bin</code> de la version Qt active de votre projet. - - - QML Puppet Crashed - Le QML Puppet a planté - - - You are recording a puppet stream and the puppet crashed. It is recommended to reopen the Qt Quick Designer and start again. - Vous avez enregistré un flux du QML Puppet et celui-ci a planté. Il est recommandé de réouvrir le Qt Quick Designer et recommencer. - - - The executable of the QML Puppet process (%1) cannot be found. Please check your installation. QML Puppet is a process which runs in the background to render the items. - L'exécutable du processus QML Puppet (%1) ne peut être trouvé. Merci de vérifier votre installation. QML Pupper est un processus qui exécute en tâche de fond le rendu des éléments. - - - - QmlDesigner::ModelNodeContextMenu - - Selection - Sélection - - - Select parent: %1 - ? - Sélectionner le parent : %1 - - - Select: %1 - Sélectionner : %1 - - - Stack (z) - (z) -> ? - Pile (z) - - - To Front - À l'avant-plan - - - To Back - À l'arrière-plan - - - Raise - Augmenter - - - Lower - Baisser - - - Reset z property - Réinitialiser la propriété z - - - Edit - Éditer - - - Reset Position - Réinitialiser la position - - - Reset Size - Réinitialiser la taille - - - Visibility - Visibilité - - - Anchors - Ancres - - - Fill - Remplir - - - Reset - Réinitialiser - - - Layout - Layout - - - Layout in Row - Layout en ligne - - - Layout in Column - Layout en colonne - - - Layout in Grid - Layout en grille - - - Layout in Flow - Layout en flux - - - Go into Component - Aller dans le composant - - - - QmlDesigner::TextToModelMerger error message - - No import statements found - Pas de déclaration d'importation trouvée - - - Unsupported QtQuick version - Version de Qt Quick non supportée - - - - QmlJSInspector::Internal::QmlJsInspectorToolBar - - Apply Changes on Save - Appliquer les changements à la sauvegarde - - - Show application on top - Montrer l'application en avant-plan - - - Play/Pause Animations - Lire/mettre en pause les animations - - - Select - Sélectionner - - - Zoom - Zoom - - - Color Picker - Sélecteur de couleur - - - 1x - 1x - - - 0.5x - 0,5x - - - 0.25x - 0,25x - - - 0.125x - 0,125x - - - 0.1x - 0.1x - - - - QtC::QmlJSTools - - Code Style - Style de code - - - &QML/JS - &QML/JS - - - Reset Code Model - Restaurer le modèle de code - - - Global Qt Quick - Settings - Globaux Qt Quick - - - Global - Settings - Globale - - - Qt - Qt - - - Old Creator - Ancien Creator - - - - QtC::QmlProfiler - - Application finished before loading profiled data. - Please use the stop button instead. - L'application s'est terminée avant le chargement des données de profilage. Veuillez utiliser le bouton d'arrêt à la place. - - - The port seems to be in use. - Error message shown after 'Could not connect ... debugger:" - Le port semble déjà utilisé. - - - The application is not set up for QML/JS debugging. - Error message shown after 'Could not connect ... debugger:" - L'application n'est pas configurée pour le débogage QML/JS. - - - Qt Creator - Qt Creator - - - Could not connect to the in-process QML debugger: -%1 - %1 is detailed error message - Impossible de se connecter au processus de débogage QML : %1 - - - Source code not available - Code source non disponible - - - Calls - Appels - - - Time per Call - Temps par appel - - - The QML Profiler can be used to find performance bottlenecks in applications using QML. - Le profileur QML peut être utilisé pour trouver les goulots d'étranglement des applications QML. - - - Attach... - Attacher... - - - QML Profiler Options - Options de profilage pour QML - - - Load QML Trace - Charger une trace QML - - - Save QML Trace - Sauvegarder la trace QML - - - Application finished before loading profiled data. -Please use the stop button instead. - L'application s'est terminée avant le chargement des données de profilage. -Veuillez utiliser le bouton d'arrêt à la place. - - - The QML profiler requires Qt 4.7.4 or newer. -The Qt version configured in your active build configuration is too old. -Do you want to continue? - Le profileur QML nécessite Qt 4.7.4 ou supérieur. -La version de Qt configurée dans votre configuration de compilation active est trop ancienne. -Voulez vous continuer ? - - - %1 s - %1 s - - - Elapsed: %1 - Écoulé : %1 - - - QML traces (*%1) - Traces QML (*%1) - - - Callees - Appelés - - - Callers - Appeleurs - - - Discard data - Abandonner les données - - - Elapsed: 0 s - Écoulé : 0 s - - - Disable profiling - Désactiver le profilage - - - Enable profiling - Activer le profilage - - - Elapsed: %1 s - Écoulé : %1 s - - - Could not connect to the in-process QML profiler. -Do you want to retry? - Impossible de connecter au profileur QML du processus. -Souhaitez-vous réessayer ? - - - QML traces (%1) - Traces QML (%1) - - - Detach - Détacher - - - Gathering ports failed: %1 - Échec de la récupération des ports : %1 - - - Not enough free ports on device for analyzing. - - Pas assez de ports libres sur le périphérique pour l'analyse. - - - Starting remote process... - - Démarrer le processus distant... - - - Failure running remote process. - Échec d'exécution du processus distant. - - - Starting remote process ... - - Lancement des processus distants... - - - Finished running remote process. Exit code was %1. - - Fin de l'exécution des processus distants. Le code de retour était %1. - - - - QtC::Tracing - - Jump to previous event - Sauter à l'événement précédent - - - Jump to next event - Sauter à l'événement suivant - - - Show zoom slider - Afficher le curseur de zoom - - - Select range - Sélectionner l'interval - - - View event information on mouseover - Euh, j'ai fait une tirade, là :D - Afficher les informations sur l'événement lorsque du survol de la souris - - - Zoom in 10% - Zoom avant de 10 % - - - Zoom out 10% - Zoom arrière de 10 % - - - - QtC::QmlProjectManager - - Starting %1 %2 - - Démarrer %1 %2 - - - - %1 exited with code %2 - - %1 a quitté avec le code %2 - - - Not enough free ports for QML debugging. - Pas assez de ports disponibles pour le débogage QML. - - - - QtC::QmakeProjectManager - - No device is connected. Please connect a device and try again. - - Pas de périphérique connecté. Veuillez en connecter un et réessayer. - - - - Executable file: %1 - - Fichier exécutable : %1 - - - - Connecting to '%1'... - - Connexion à "%1"... - - - - Unable to create CODA connection. Please try again. - - Impossible de créer la connexion CODA. Veuillez réessayer. - - - Could not open serial device: %1 - - Impossible d'ouvrir le périphérique série : %1 - - - - Connecting to %1:%2... - - Connexion à %1 : %2... - - - - Error: %1 - - Erreur : %1 - - - - Connected. - - Connecté. - - - - Process has finished. - - Le processus a fini. - - - - Thread has crashed: %1 - - Thread crashé : %1 - - - - The process is already running on the device. Please first close it. - - Le processus est déjà en cours d'exécution sur le périphérique. Veuillez le fermer d'abord. - - - - Launching: %1 - - Lancement : %1 - - - - Launched. - - Lancé. - - - - Launch failed: %1 - - Le lancement a échoué : %1 - - - - Waiting for CODA - Attente de CODA - - - Qt Creator is waiting for the CODA application to connect.<br>Please make sure the application is running on your mobile phone and the right IP address and/or port are configured in the project settings. - Qt Creator attend que l'application CODA se connecte.<br>Veuillez vous assurer que l'application est lancée sur le téléphone mobile et que la bonne adresse IP et/ou port sont configurés dans les paramètres du projet. - - - Canceled. - - Annulé. - - - - The device '%1' has been disconnected. - - Le périphérique "%1" a été déconnecté. - - - - Running %1 - %1 is a name of the Publish Step i.e. Clean Step - Exécution de %1 - - - No valid Qt version has been detected.<br>Define a correct Qt version in "Options > Qt4" - Aucune version de Qt valide n'a été détecté. <br/> Définissez-en une correcte dans "Options > Qt4" - - - No valid tool chain has been detected.<br>Define a correct tool chain in "Options > Tool Chains" - Aucune chaîne de compilation valide n'a été détecté. <br/> Définissez-en une correcte dans "Options > Chaînes de compilation" - - - Choose a build configuration: - Choisir une configuration de compilation : - - - Choose a tool chain: - Choisir une chaîne de compilation : - - - Only Qt versions above 4.6.3 are made available in this wizard. -Previous Qt versions have limitations in building suitable SIS files. - Seules les versions de Qt plus récentes que la 4.6.3 sont disponibles dans cet assistant. -Les version de Qt précédentes ont des limitations lors de la compilation des fichiers SIS. - - - Parsing the .pro file - Analyse du fichier .pro - - - Error while parsing file %1. Giving up. - Erreur pendant l'analyse du fichier %1. Abandon. - - - Could not find .pro file for sub dir '%1' in '%2' - Impossible de trouver le fichier .pro pour le sous-répertoire '%1' dans "%2" - - - Select QML File - Sélectionner un fichier QML - - - Select Existing QML file - Sélectionner un fichier QML existant - - - Qt Quick Application Type - Unsure. - Type d'application Qt Quick - - - All files and directories that reside in the same directory as the main QML file are deployed. You can modify the contents of the directory any time before deploying. - Tous les fichiers et répertoires qui résident dans le même répertoire que le fichier QML principal sont déployés. Vous pouvez en modifier le contenu avant le déploiement. - - - - QtC::QtSupport - - The compiler '%1' (%2) cannot produce code for the Qt version '%3' (%4). - Le compilateur "%1" (%2) ne peut produire du code pour la version de Qt "%3" (%4). - - - The compiler '%1' (%2) may not produce code compatible with the Qt version '%3' (%4). - Le compilateur "%1" (%2) ne peut pas produire du code compatible avec la version de Qt "%3" (%4). - - - Name: - Nom : - - - Invalid Qt version - Version de Qt invalide - - - ABI: - ABI : - - - Source: - Source : - - - mkspec: - mkspec : - - - qmake: - qmake : - - - Default: - Par défaut : - - - Version: - Version : - - - No Qt version. - Pas de version de Qt. - - - Invalid Qt version. - Version de Qt invalide. - - - Requires Qt 4.8.0 or newer. - Requiert Qt 4.8.0 ou plus récent. - - - Requires Qt 4.7.1 or newer. - Requiert Qt 4.7.1 ou plus récent. - - - Library not available. <a href='compile'>Compile...</a> - Bibliothèque non disponible. <a href='compile'>Compiler...</a> - - - Building helpers - Aide à la compilation - - - <specify a name> - <spécifier un nom> - - - Auto-detected - Auto-détecté - - - Manual - Manuel - - - Remove invalid Qt Versions - Retirer les versions de Qt non valides - - - Do you want to remove all invalid Qt Versions?<br><ul><li>%1</li></ul><br>will be removed. - Voulez-vous retirer toutes les versions de Qt invalides ? <br/><ul><li>%1</li><br/> seront supprimées. - - - Qt version %1 for %2 - Qt %1 pour %2 - - - No tool chain can produce code for this Qt version. Please define one or more tool chains. - Aucune chaîne de compilation ne peut produire du code pour cette version de Qt. Veuillez définir une ou plusieurs chaînes. - - - Not all possible target environments can be supported due to missing tool chains. - Toutes les environnements cibles possibles ne peuvent être supportés à cause de chaînes de compilation manquantes. - - - The following ABIs are currently not supported:<ul><li>%1</li></ul> - Les ABI suivantes ne sont pas supportées : <ul><li>%1</li></ul> - - - Debugging Helper Build Log for '%1' - Journal de compilation de l'assistant de débogage pour "%1" - - - Select a qmake Executable - Sélectionner un exécutable qmake - - - Qt Version Already Known - Version de Qt déjà connue - - - Qmake Not Executable - Qmake n'est pas un exécutable - - - The qmake executable %1 could not be added: %2 - L'exécutable qmake %1 n'a pas pu être ajouté : %2 - - - Select a qmake executable - Sélectionner un exécutable qmake - - - The Qt version selected must match the device type. - La version de Qt sélectionnée doit correspondre au type de périphérique. - - - Qt versions incompatible - Versions de Qt incompatibles - - - The qt version selected must be for the same target. - La version de Qt sélectioonée doit être prévue pour la même cible. - - - Remove Invalid Qt Versions - Retirer les versions de Qt non valides - - - No compiler can produce code for this Qt version. Please define one or more compilers. - Aucun compilateur ne peut produire du code pour cette version de Qt. Veuillez définir un ou plusieurs compilateurs. - - - Not all possible target environments can be supported due to missing compilers. - Toutes les environnements cibles possibles ne peuvent être supportés à cause de compilateurs manquants. - - - Qt known - Qt connu - - - This Qt version was already registered as "%1". - Cette version de Qt a déjà été enregistré comme "%1". - - - Incompatible Qt Versions - Versions de Qt incompatibles - - - The Qt version selected must be for the same device type. - La version de Qt sélectionnée doit être prévue pour le même type de périphérique. - - - Helpers: None available - Assistants : aucun disponible - - - Helpers: %1. - %1 is list of tool names. - Assistants : %1. - - - <i>Not yet built.</i> - <i>Pas encore compilé.</i> - - - <i>Not needed.</i> - <i>Pas requis.</i> - - - <i>Cannot be compiled.</i> - <i>Ne peut pas être compilé.</i> - - - S60 SDK: - SDK S60 : - - - SBS v2 directory: - Répertoire SBS v2 : - - - MinGW from %1 - MinGW depuis %1 - - - - AbstractLinuxDeviceDeployStep - - No valid device set. - Pas de périphérique valide défini. - - - - QtC::RemoteLinux - - Operation canceled by user, cleaning up... - Opération annulée par l'utilisateur, nettoyage... - - - Cannot deploy: Still cleaning up from last time. - Impossible de déployer : le dernier nettoyage n'est pas encore terminé. - - - Cannot deploy: Qemu was not running. It has now been started up for you, but it will take a bit of time until it is ready. Please try again then. - Impossible de déployer : Qemu n'était pas lancé. Il a maintenant été démarré, mais il prendra un peu de temps avant d'être prêt. Veuillez réessayer alors. - - - Cannot deploy: You want to deploy to Qemu, but it is not enabled for this Qt version. - Impossible de déployer : vous voulez déployer sur Qemu, mais il n'est pas activé pour cette version de Qt. - - - All files up to date, no installation necessary. - Tous les fichiers sont à jour, aucune installation n'est nécessaire. - - - Connecting to device... - Connexion au périphérique... - - - Deployment failed. - Échec lors du déploiement. - - - Deployment finished. - Déploiement fini. - - - New Generic Linux Device Configuration Setup - Configuration d'un nouveau périphérique Linux générique - - - Connection Data - Données de connexion - - - Connection - Connexion - - - Choose a Private Key File - Choisir un fichier de clé privée - - - Generic Linux Device - Périphérique Linux générique - - - Setup Finished - Fin de l'installation - - - Summary - Résumé - - - The new device configuration will now be created. -In addition, device connectivity will be tested. - La configuration du nouveau périphérique va maintenant être créée. En plus, la connectivité du périphérique sera testée. - - - (default for %1) - (paramètre par défaut pour %1) - - - Start Wizard - Démarrer l'assistant - - - Device Configuration Wizard Selection - Sélection de l'assistant de configuration du périphérique - - - Available device types: - Types de périphérique disponibles : - - - All files copied. - Tous les fichiers ont été copiés. - - - Deploy files via UTFS mount - Déployer les fichiers par montage UTFS - - - Choose Icon (will be scaled to %1x%1 pixels, if necessary) - Choisir une icône (elle sera remise à l'échelle à %1x%1 pixels si nécessaire) - - - Invalid Icon - Icône invalide - - - Unable to read image - Impossible de lire l'image - - - Failed to Save Icon - Échec de la sauvegarde de l'icône - - - Could not save icon to '%1'. - Impossible d'enregistrer l'icône dans "%1". - - - General Information - Informations générales - - - Device Status Check - Vérification de l'état du périphérique - - - Existing Keys Check - Vérification des clés existantes - - - Key Creation - Création de clé - - - Cannot Create Keys - Impossible de créer des clés - - - The path you have entered is not a directory. - Le chemin entré n'est pas un répertoire. - - - The directory you have entered does not exist and cannot be created. - Le répertoire entré n'existe pas et ne peut pas être créé. - - - Creating keys ... - Création des clés... - - - Key creation failed: %1 - Échec lors de la création des clés : %1 - - - Could Not Save Key File - Impossible de sauver le fichier de la clé - - - Key Deployment - Déploiement de la clé - - - Deploying... - Déploiement... - - - Key Deployment Failure - Échec lors du déploiement de la clé - - - Key Deployment Success - Déploiement de la clé réussi - - - The key was successfully deployed. You may now close the "%1" application and continue. - La clé a été déployée avec succès. Vous pouvez maintenant fermer l'application "%1" et continuer. - - - Done. - Fait. - - - The new device configuration will now be created. - La configuration du nouveau périphérique va maintenant être créée. - - - New Device Configuration Setup - Configuration du nouveau périphérique - - - Cannot deploy to sysroot: No packaging step found. - Impossible de déployer à la racine système : pas d'étape de paquetage trouvée. - - - Cannot install to sysroot without build configuration. - Impossible d'installer à la racine système sans configuration de la compilation. - - - Cannot install package to sysroot without packaging step. - Impossible d'installer le paquet à la racine système sans une étape de paquetage. - - - Cannot install package to sysroot without a Qt version. - Impossible d'installer le paquet à la racine système sans une version de Qt. - - - Installing package to sysroot ... - Installation du paquet à racine système... - - - Installation to sysroot failed, continuing anyway. - Échec lors de l'installation à la racine système, l'installation continue néanmoins. - - - Install Debian package to sysroot - Installer le paquet Debian à la racine système - - - Install RPM package to sysroot - Installer le paquet RMP à la racine système - - - Cannot copy to sysroot without build configuration. - Impossible de copier les fichiers à la racine système sans configuration de la compilation. - - - Cannot copy to sysroot without valid Qt version. - Impossible de copier les fichiers à la racine système sans version de Qt valide. - - - Copying files to sysroot ... - Copie des fichiers vers la racine système en cours... - - - Sysroot installation failed: %1 - Continuing anyway. - L'installation à la racine système a échoué : %1. L'installation continue néanmoins. - - - Copy files to sysroot - Copie des fichiers à la racine système - - - Public key error: %1 - Erreur de clé publique : %1 - - - Key deployment failed: %1. - Échec lors du déploiement de la clé : %1. - - - Create Debian Package - Créer un paquet Debian - - - Create RPM Package - Créer un paquet RPM - - - Package up to date. - Paquet à jour. - - - Creating package file ... - Créer un fichier de paquet... - - - Package created. - Paquet créé. - - - Packaging error: No Qt version. - Erreur lors de la création du paquet : pas de version de Qt. - - - Package Creation: Running command '%1'. - Création du paquet : exécuter la commande "%1". - - - Packaging error: Could not start command '%1'. Reason: %2 - Erreur lors de la création du paquet : impossible d'exécuter la commande "%1". Raison : %2 - - - Packaging Error: Command '%1' failed. - Erreur lors de la création du paquet : échec de la commande "%1". - - - Reason: %1 - Raison : %1 - - - Exit code: %1 - Code de sortie : %1 - - - Size should be %1x%2 pixels - La taille devrait être de %1x%2 pixels - - - No Version Available. - Aucune version disponible. - - - Could not read icon - Impossible de lire l'icône - - - Images - Images - - - Choose Image (will be scaled to 48x48 pixels if necessary) - Choisir une image (sera redimensionnée à 48x48 pixels si nécessaire) - - - Could Not Set New Icon - Impossible de définir une nouvelle icône - - - File Error - Erreur de fichier - - - Could not set project name. - Impossible de définir le nom du projet. - - - Could not set package name for project manager. - Impossible de définir le nom du paquet pour le gestionnaire de paquets. - - - Could not set project description. - Impossible de définir la description du projet. - - - <b>Create Package:</b> - <b>Créer le paquet :</b> - - - Could Not Set Version Number - Impossible de définir le numéro de la version - - - Connection failure: %1 - Échec de la connexion : %1 - - - Installing package failed. - Échec lors de l'installation du paquet. - - - Installation failed: You tried to downgrade a package, which is not allowed. - Échec de l'installation. Vous avez essayé d'installer une version plus ancienne d'un paquet, ce qui n'est pas permis. - - - Choose directory to mount - Sélectionner un répertoire à monter - - - No local directories to be mounted on the device. - Aucun répertoire local à monter sur le périphérique. - - - One local directory to be mounted on the device. - Un répertoire local à monter sur le périphérique. - - - %n local directories to be mounted on the device. - Note: Only mountCount>1 will occur here as 0, 1 are handled above. - - %n répertoire local à monter sur le périphérique. - %n répertoires locaux à monter sur le périphérique. - - - - WARNING: You want to mount %1 directories, but your device has only %n free ports.<br>You will not be able to run this configuration. - - AVERTISSEMENT : vous voulez monter %1 répertoires mais votre périphérique n'a qu'un port de libre. <br>Vous n'êtes pas en mesure d'exécuter cette configuration. - AVERTISSEMENT : vous voulez monter %1 répertoires mais votre périphérique a uniquement %n ports de libre. <br>Vous n'êtes pas en mesure d'exécuter cette configuration. - - - - WARNING: You want to mount %1 directories, but only %n ports on the device will be available in debug mode. <br>You will not be able to debug your application with this configuration. - - AVERTISSEMENT : vous voulez monter %1 répertoires mais seul un port sera disponible en mode de débogage. <br>Vous n'êtes pas en mesure de déboguervotre application avec cette configuration. - AVERTISSEMENT : vous voulez monter %1 répertoires mais seulement %n ports seront disponibles en mode debug. <br>Vous n'êtes pas en mesure de déboguervotre application avec cette configuration. - - - - Run on device - Exécuter sur le périphérique - - - Qemu error - Erreur de Qemu - - - Qemu crashed. - Qemd a crashé. - - - Click here to change the OpenGL mode. - Cliquez ici pour changer le mode OpenGL. - - - You have configured Qemu to use OpenGL hardware acceleration, which might not be supported by your system. You could try using software rendering instead. - Vous avec configuré Qemu pour qu'il utilise l'accélération matérielle, ce qui pourrait ne pas être supporté par votre système. Vous pouvez essayer le rendu logiciel à la place. - - - Qemu is currently configured to auto-detect the OpenGL mode, which is known to not work in some cases. You might want to use software rendering instead. - Qemu est actuellement configuré pour autodétecter le mode OpenGL, qui est connu pour ne pas toujours fonctionner. Vous pourrize vouloir utiliser le rendu logiciel à la place. - - - Device Configurations - Configurations de périphériques - - - MeeGo Qemu Settings - Paramètres de Qemu pour MeeGo - - - Save Public Key File - Enregistrer le fichier de clé publique - - - Save Private Key File - Enregistrer le fichier de clé privée - - - Qemu was not running. It has now been started up for you, but it will take a bit of time until it is ready. Please try again then. - Qemu n'était pas en cours d'exécution. Il a maintenant été lancé mais pourrait prendre un peu de temps avant d'être prêt. Veuillez réessayer alors. - - - You want to run on Qemu, but it is not enabled for this Qt version. - Vous voulez lancer l'application sur Qemu, mais il n'est pas activé pour cette version de Qt. - - - Mounting host directories... - Montage du répertoire hôte... - - - Potentially unmounting left-over host directory mounts... - Démontage potentiel des répertoires hôtes montés restants... - - - Unmounting host directories... - Démontage des répertoires hôtes... - - - Maemo GCC - GCC pour Maemo - - - Maemo GCC for %1 - GCC pour Maemo pour %1 - - - %1 GCC (%2) - %1 GCC (%2) - - - <html><head/><body><table><tr><td>Path to MADDE:</td><td>%1</td></tr><tr><td>Path to MADDE target:</td><td>%2</td></tr><tr><td>Debugger:</td/><td>%3</td></tr></body></html> - <html><head/><body><table><tr><td>Chemin de MADDE :</td><td>%1</td></tr><tr><td>Chemin de la cible MADDE :</td><td>%2</td></tr><tr><td>Débogueur :</td/><td>%3</td></tr></body></html> - - - No matching packaging step found. - Pas d'étape de paquetage correspondante trouvée. - - - Deploy Debian package via SFTP upload - Déployer le paquet Debian par SFTP - - - Deploy RPM package via SFTP upload - Déployer le paquet RPM par SFTP - - - Could not start remote process: %1 - Impossible de démarrer le processus distant : %1 - - - Remote process crashed: %1 - Processus distant crashé : %1 - - - Remote process failed: %1 - Échec du processus distant : %1 - - - -Remote error output was: %1 - La sortie du processus distant était : %1 - - - Waiting for file name... - Attente du nom de fichier... - - - Choose Public Key File - Choisir le fichier de clé publique - - - Public Key Files (*.pub);;All Files (*) - Fichiers de clé publique (*.pub);;Tous les fichiers (*) - - - Deploying... - Déploiement... - - - Deployment finished successfully. - Le déploiement s'est déroulé avec succès. - - - Debian changelog file '%1' has unexpected format. - Le fichier de journal des changements Debian "%1" a un format inattendu. - - - Invalid icon data in Debian control file. - Données de l'icône invalides dans le contrôle de fichier Debian. - - - Could not read image file '%1'. - Impossible de lire le fichier image "%1". - - - Could not export image file '%1'. - Impossible d'exporter le fichier image "%1". - - - Unable to create Debian templates: No Qt version set - Impossible de créer des modèles Debian : pas de version de Qt définie - - - Unable to create Debian templates: dh_make failed (%1) - Impossible de créer des modèles Debian : échec de dh_make (%1) - - - Unable to create debian templates: dh_make failed (%1) - Impossible de créer des modèles Debian : échec de dh_make (%1) - - - Unable to move new debian directory to '%1'. - Impossible de déplacer le nouveau répertoire Debian dans "%1". - - - Don't know what to run. - bancal... - Ne sait pas ce qu'il faut lancer. - - - %1 (on Remote Device) - %1 (sur un périphérique distant) - - - Run on Remote Device - Remote Linux run configuration default display name - Lancer sur un périphérique distant - - - Run on remote device - Remote Linux run configuration default display name - Lancer sur un périphérique distant - - - (on Remote Generic Linux Host) - (sur hôte distant Linux générique) - - - (on Remote Generic Linux Host) - (sur un hôte distant Linux générique) - - - <a href="%1">Manage device configurations</a> - <a href="%1">Gérer les configurations des périphériques</a> - - - <a href="%1">Set Debugger</a> - <a href="%1">Définir le débogeur</a> - - - Executable on host: - Exécutable sur l'hôte : - - - Executable on device: - Exécutable sur le périphérique : - - - Use this command instead - Utilisez cette commande à la place - - - Alternate executable on device: - Eexécutable alternatif sur le périphérique : - - - Arguments: - Arguments : - - - <default> - Euh, une balise ? dois je traduire ? - <par défaut> - - - Working directory: - Répertoire de travail : - - - Unknown - Inconnue - - - Remote path not set - Chemin distant indéfini - - - Starting remote process... - - Démarrer le processus distant... - - - Finished running remote process. Exit code was %1. - - Fin de l'exécution du processus distant. Le code de retour était %1. - - - Remote Execution Failure - Échec lors de l'exécution à distance - - - Run on remote Linux device - Exécuter sur périphérique Linux distant - - - Cannot debug: Kit has no device. - Impossible de déboguer : le kit n'a pas de périphérique. - - - Cannot debug: Not enough free ports available. - Impossible de déboguer : pas assez de ports libres disponibles. - - - No analyzer tool selected. - Pas d'outil d'analyse sélectionné. - - - - QtC::Subversion - - Ignore whitespace - Ignorer les espaces - - - Ignore Whitespace - Ignorer les espaces - - - - QtC::TextEditor - - %1 of %2 - %1 de %2 - - - Settings: - Paramètres : - - - Custom - Personnalisé - - - Restore %1 - %1 is settings name (e.g. Global C++) - Restaurer %1 - - - Restore - Restaurer - - - Cannot create user snippet directory %1 - Impossible de créer le dossier utilisateur de snippets %1 - - - - QtC::Valgrind Profiling Profilage - - Profiling %1 - - Profilage de %1 - Valgrind Function Profiler - Profileur de fonction de Valgrind - - - Valgrind Profile uses the "callgrind" tool to record function calls when a program runs. - Le profileur Valgrind utilise l'outil "callgrind" pour enregistrer les appels de fonction quand un programme est lancé. - - - Profile Costs of this Function and its Callees - Profiler les coûts de cette fonction et de ses appelés + Profileur de fonctions de Valgrind Callers @@ -34651,6 +52090,14 @@ Remote error output was: %1 Callees Appelés + + Valgrind Function Profiler uses the Callgrind tool to record function calls when a program runs. + Le profileur de fonctions de Valgrind utilise l’outil Callgrind pour enregistrer les appels de fonction quand un programme est lancé. + + + Valgrind Function Profiler (External Application) + Profileur de fonctions de Valgrind (application externe) + Visualization Visualisation @@ -34660,28 +52107,40 @@ Remote error output was: %1 Charger un fichier de log XML externe - Request the dumping of profile information. This will update the callgrind visualization. - Demander la création du fichier dump des informations de profilage. Ceci mettra à jour la visualisation callgrind. + Load External Log File + Charger un fichier de log externe + + + Open results in KCachegrind. + Ouvrir les résultats dans KCachegrind. + + + Request the dumping of profile information. This will update the Callgrind visualization. + Demander la création du fichier dump des informations de profilage. Ceci mettra à jour la visualisation Callgrind. Reset all event counters. - Réinitialiser tous les compteurs d'événements. + Réinitialiser tous les compteurs d’évènements. Pause event logging. No events are counted which will speed up program execution during profiling. - Suspendre la mise en log des événements. Aucun événements ne sont comptés, ce qui accélera l'exécution du programme pendant le profilage. + Suspendre la mise en log des évènements. Aucun évènement n’est compté, ce qui accélérera l’exécution du programme pendant le profilage. + + + Discard Data + Abandonner les données Go back one step in history. This will select the previously selected item. - Retourner une étape en arrière dans l'historique. Ceci sélectionnera l'élément précédemment sélectionné. + Retourner une étape en arrière dans l’historique. Ceci sélectionnera l’élément précédemment sélectionné. Go forward one step in history. - Aller en avant d'une étape dans l'historique. + Aller en avant d’une étape dans l’historique. Selects which events from the profiling data are shown and visualized. - Sélectionner quels événements des données de profilage sont affichés et visualisés. + Sélectionner quels évènements des données de profilage sont affichés et visualisés. Absolute Costs @@ -34689,7 +52148,7 @@ Remote error output was: %1 Show costs as absolute numbers. - Montrer les coûts comme des nombres absolus. + Montrer les coûts comme des nombres absolus. Relative Costs @@ -34697,44 +52156,43 @@ Remote error output was: %1 Show costs relative to total inclusive cost. - Montrer les coûts relativement au coût inclusif total. + Montrer les coûts relativement au coût inclusif total. Relative Costs to Parent Coûts relatifs au parent - Show costs relative to parent functions inclusive cost. - Montrer les coûts relativement aux coût inclusif des fonctions parentes. + Show costs relative to parent function's inclusive cost. + Montrer les coûts relativement aux coût inclusif des fonctions parentes. + + + Select This Function in the Analyzer Output + Sélectionner cette fonction dans la sortie de l’analyseur + + + Open Callgrind Log File + Ouvrir un fichier de log Callgrind + + + Callgrind Output (callgrind.out*);;All Files (*) + Sortie de Callgrind (callgrind.out*);;Tous les fichiers (*) + + + Callgrind: Failed to open file for reading: %1 + Callgrind : échec de l’ouverture du fichier en lecture : %1 Cost Format Format de coût - - Open Callgrind XML Log File - Ouvrir un fichier de log XML de Callgrind - - - Internal Error - Erreur interne - Parsing Profile Data... - Analyse des données du profil... - - - Cycle Detection - Détection de cycle + Analyse des données de profilage… Enable cycle detection to properly handle recursive or circular function calls. - Activer la détection de cycle pour gérer correctement les appels de fonctions circulaires ou récursifs. - - - This removes template parameter lists when displaying function names. - Cela r > R ? - Cette opération retire les listes de paramètres templates lors de l'affichage des noms de fonctions. + Activer la détection de cycle pour gérer correctement les appels de fonctions circulaires ou récursifs. Show Project Costs Only @@ -34742,65 +52200,75 @@ Remote error output was: %1 Show only profiling info that originated from this project source. - Ne montrer que les informations de profilage qui proviennent de cette source du projet. + Ne montrer que les informations de profilage qui proviennent de cette source du projet. Filter... - Filtrer... + Filtrer… + + + A Valgrind Callgrind analysis is still in progress. + Une analyse Valgrind Callgrind est toujours en cours. + + + Start a Valgrind Callgrind analysis. + Lancer une analyse Valgrind Callgrind. Profiling aborted. - Abandon du profilage. + Abandon du profilage. Parsing finished, no data. - Analyse finie, pas de données. + Analyse finie, pas de données. Parsing finished, total cost of %1 reported. - Analyse finie, coût total de %1 reporté. + Analyse finie, coût total de %1 reporté. Parsing failed. - Échec de l'analyse. - - - Select this Function in the Analyzer Output - Sélectionner cette fonction dans la sortie de l'analyseur + Échec de l’analyse. Populating... - Remplissage... + Remplissage… All functions with an inclusive cost ratio higher than %1 (%2 are hidden) Toutes les fonctions avec un ratio de coût inclusif supérieur à %1 (%2 sont cachés) - Analyzing memory of %1 - - Analyse de la mémoire de %1 - + Issue + Problème + + + %1%2 + %1%2 in %1 dans %1 - Copy Selection - Copier la sélection + %1 in function %2 + %1 dans la fonction %2 Suppress Error Cacher les erreurs + + Memcheck + Memcheck + External Errors Erreurs externe Show issues originating outside currently opened projects. - Afficher les problèmes provenant de l'extérieur des projets actuellement ouverts. + Afficher les problèmes provenant de l’extérieur des projets actuellement ouverts. Suppressions @@ -34824,19 +52292,7 @@ Remote error output was: %1 Invalid Calls to "free()" - Appels invalides à "free()" - - - Failed to open file for reading: %1 - Échec lors de l'ouverture en lecture du fichier : %1 - - - Error occurred parsing Valgrind output: %1 - Erreur d'analyse de la sortie de Valgring : %1 - - - Valgrind Analyze Memory uses the "memcheck" tool to find memory leaks - L'analyseur de mémoire Valgrind utilise l'outil "memcheck" pour trouver les fuites mémoires + Appels invalides à « free() » Memory Issues @@ -34844,15 +52300,81 @@ Remote error output was: %1 Go to previous leak. - Aller à la fuite précédente. + Aller à la fuite précédente. Go to next leak. - Aller à la fuite suivante. + Aller à la fuite suivante. Error Filter - Filtre d'erreur + Filtre d’erreur + + + Valgrind Analyze Memory uses the Memcheck tool to find memory leaks. + L’analyseur de mémoire de Valgrind utilise l’outil Memcheck pour trouver des fuites mémoire. + + + Valgrind Memory Analyzer with GDB + Analyseur de mémoire de Valgrind avec GDB + + + Valgrind Analyze Memory with GDB uses the Memcheck tool to find memory leaks. +When a problem is detected, the application is interrupted and can be debugged. + L’analyseur de mémoire de Valgrind avec GDB utilise l’outil Memcheck pour trouver des fuites mémoire. +Lorsqu’un problème est détecté, l’application s’interrompt et peut être déboguée. + + + Heob + Heob + + + Ctrl+Alt+H + Ctrl+Alt+H + + + Valgrind Memory Analyzer (External Application) + Analyseur de mémoire de Valgrind (application externe) + + + Heob: No local run configuration available. + Heob : aucune configuration d’exécution locale n’est disponible. + + + Heob: No toolchain available. + Heob : aucune chaîne de compilation n’est disponible. + + + Heob: No executable set. + Heob : pas d’exécutable défini. + + + Heob: Cannot find %1. + Heob : impossible de trouver %1. + + + The %1 executables must be in the appropriate location. + Les exécutables %1 doivent se trouver à l’emplacement approprié. + + + Heob used with MinGW projects needs the %1 DLLs for proper stacktrace resolution. + Le Heob utilisé avec les projets MinGW a besoin des DLL %1 pour une résolution correcte de la trace d’appels. + + + Heob: Cannot create %1 process (%2). + Heob : impossible de créer le processus %1 (%2). + + + A Valgrind Memcheck analysis is still in progress. + Une analyse Valgrind Memcheck est toujours en cours. + + + Start a Valgrind Memcheck analysis. + Lancer une analyse Valgrind Memcheck. + + + Start a Valgrind Memcheck with GDB analysis. + Lancer une analyse Valgrind Memcheck avec GDB. Open Memcheck XML Log File @@ -34863,8 +52385,228 @@ Remote error output was: %1 Fichiers XML (*.xml);;Tous les fichiers (*) - Error occurred parsing valgrind output: %1 - Erreur d'analyse de la sortie de Valgring : %1 + Memcheck: Failed to open file for reading: %1 + Memcheck : échec de l’ouverture du fichier en lecture : %1 + + + Memcheck: Error occurred parsing Valgrind output: %1 + Memcheck : une erreur s’est produite lors de l’analyse de la sortie de Valgrind : %1 + + + Memory Analyzer Tool finished. %n issues were found. + + L’outil d’analyse de la mémoire a terminé. %n problème a été trouvé. + L’outil d’analyse de la mémoire a terminé. %n problèmes ont été trouvés. + + + + Log file processed. %n issues were found. + + Fichier journal traité. un problème a été trouvé. + Fichier journal traité. %n problèmes ont été trouvés. + + + + New + Nouveau + + + Delete + Supprimer + + + XML output file: + Fichier de sortie XML : + + + Handle exceptions: + Gérer les exceptions : + + + Off + Non + + + On + Oui + + + Only + Seulement + + + Page protection: + Protection de page : + + + After + Après + + + Before + Avant + + + Freed memory protection + Protection de la mémoire libérée + + + Raise breakpoint exception on error + Lever l’exception du point d’arrêt en cas d’erreur + + + Leak details: + Détails de la fuite : + + + None + concerne les détails de fuite mémoire + Aucun + + + Simple + Simple + + + Detect Leak Types + Détecter le type de fuite + + + Detect Leak Types (Show Reachable) + Détecter les types de fuites (afficher les accessibles) + + + Fuzzy Detect Leak Types + + + + Fuzzy Detect Leak Types (Show Reachable) + + + + Minimum leak size: + Taille minimale de la fuite : + + + Control leak recording: + Contrôle de l’enregistrement des fuites : + + + On (Start Disabled) + Actif (démarrage désactivé) + + + On (Start Enabled) + Actif (démarrage activé) + + + Run with debugger + Exécuter avec le débogueur + + + Extra arguments: + Arguments supplémentaires : + + + Heob path: + Chemin vers Heob : + + + The location of heob32.exe and heob64.exe. + L’emplacement de heob32.exe et heob64.exe. + + + Save current settings as default. + Enregistrer les paramètres actuels par défaut. + + + OK + OK + + + Default + Défaut + + + New Heob Profile + Nouveau profil Heob + + + Heob profile name: + Nom du profil Heob : + + + %1 (copy) + %1 (copie) + + + Delete Heob Profile + Supprimer le profil Heob + + + Are you sure you want to delete this profile permanently? + Voulez-vous vraiment supprimer définitivement ce profil ? + + + Process %1 + Processus %1 + + + Process finished with exit code %1 (0x%2). + Le processus s’est terminé avec le code %1 (0x%2). + + + Unknown argument: -%1 + Argument inconnu : %1 + + + Cannot create target process. + Impossible de créer le processus cible. + + + Wrong bitness. + pas sûr si il faut traduire « bitness », pour le moment, je propose « largeur de bits » ou éventuellement « largeur de bits (« bitness ») » + Mauvaise largeur de bits (« bitness »). + + + Process killed. + Processus tué. + + + Only works with dynamically linked CRT. + Ne fonctionne qu’avec les CRT liés dynamiquement. + + + Process stopped with unhandled exception code 0x%1. + Le processus s’est arrêté avec le code d’exception non géré 0x%1. + + + Not enough memory to keep track of allocations. + Pas assez de mémoire pour suivre les allocations. + + + Application stopped unexpectedly. + L’application s’est arrêtée de manière inattendue. + + + Extra console. + Console supplémentaire. + + + Unknown exit reason. + Raison de sortie inconnue. + + + Heob stopped unexpectedly. + Heob s’est arrêtée de manière inattendue. + + + Heob: %1 + Heob : %1 + + + Heob: Failure in process attach handshake (%1). + Callee @@ -34884,27 +52626,27 @@ Remote error output was: %1 Previous command has not yet finished. - La commande précédente n'a pas fini. + La commande précédente n’a pas fini. Dumping profile data... - Créer un dump des données de profilage... + Créer un dump des données de profilage… Resetting event counters... - Réinitialisation des compteurs d'événements... + Réinitialisation des compteurs d’évènements… Pausing instrumentation... - Pause de l'instrumentation... + Pause de l’instrumentation… Unpausing instrumentation... - Reprise de l'instrumentation... + Reprise de l’instrumentation… An error occurred while trying to run %1: %2 - Une erreur est apparue lors de l'exécution de %1 : %2 + Une erreur est apparue lors de l’exécution de %1 : %2 Callgrind dumped profiling info @@ -34912,11 +52654,11 @@ Remote error output was: %1 Callgrind unpaused. - Reprise de Callgrind. + Reprise de Callgrind. - Downloading remote profile data... - Téléchargement des données de profilage distante... + Failed opening temp file... + Échec de l’ouverture du fichier temporaire… Function: @@ -34924,15 +52666,15 @@ Remote error output was: %1 File: - Fichier : + Fichier : Object: - Objet : + Objet : Called: - Appelé : + Appelé : %n time(s) @@ -34944,7 +52686,7 @@ Remote error output was: %1 Events - Événements + Évènements Self costs @@ -35051,22 +52793,6 @@ Remote error output was: %1 Position: Position : - - No network interface found for remote analysis. - Pas d'interface réseau trouvée pour l'analyse à distance. - - - Select Network Interface - Sélectionner une interface réseau - - - More than one network interface was found on your machine. Please select the one you want to use for remote analysis. - Plus d'une interface réseau a été trouvée sur la machine. Veuillez sélectionner celle que vous souhaitez utiliser pour analyse distante. - - - No network interface was chosen for remote analysis. - Aucune inteface réseau a été choisie pour l'analyse distante. - XmlServer on %1: XmlServer sur %1 : @@ -35075,14 +52801,6 @@ Remote error output was: %1 LogServer on %1: LogServer sur %1 : - - More than one network interface was found on your machine. Please select which one you want to use for remote analysis. - Plus d'une interface réseau a été trouvée sur la machine. Veuillez sélectionner celle que vous souhaitez utiliser pour analyse distante. - - - No Network Interface was chosen for remote analysis - Aucune interface réseau n'a été choisie pour l'analyse distante - Valgrind options: %1 Options de Valgrind : %1 @@ -35092,2711 +52810,495 @@ Remote error output was: %1 Répertoire de travail : %1 - Command-line arguments: %1 - Arguments de la commande : %1 + Profiling %1 + Profilage de %1 - Commandline arguments: %1 - Arguments de la ligne de commande : %1 + Analyzing Memory + Analyse de la mémoire - ** Analyzing finished ** + Command line arguments: %1 + Arguments de la commande : %1 + + + Analyzing finished. + L’analyse est terminée. + + + Error: "%1" could not be started: %2 + Erreur : « %1 » ne peux pas démarrer : %2 + + + Error: no Valgrind executable set. + Erreur : aucun exécutable Valgrind est défini. + + + Process terminated. + Le processus s’est terminé. + + + Process exited with return value %1 - ** Analyse finie ** + Le processus s’est terminé avec la valeur de retour %1 + - ** Error: "%1" could not be started: %2 ** - - ** Erreur : "%1" n'a pas pu être démarré : %2 ** + Valgrind Generic Settings + Paramètres génériques de Valgrind - ** Error: no valgrind executable set ** - - ** Erreur : pas d'exécutable Valgrind défini ** + MemCheck Memory Analysis Options + Options d’analyse mémoire MemCheck - ** Process Terminated ** - - ** Processus terminé ** + CallGrind Profiling Options + Options de profilage CallGrind - Application Output - Sortie de l'application + Valgrind + Valgrind - Analyzer - Analyseur + Valgrind Memory Analyzer + Analyseur de mémoire de Valgrind + + + Profile Costs of This Function and Its Callees + Estimer les coûts de cette fonction et de fonctions qu’elle appelle + + + Valgrind Settings + Paramètres de Valgrind + + + Callgrind + Callgrind + + + %1 (Called: %2; Incl. Cost: %3) + %1 (appelé : %2 ; coût incl. : %3) QtC::VcsBase - Command used for reverting diff chunks - ?? - Commande utilisée pour annuler des morceaux de différences (diff chunks) - - - - Coda::Session - - CPU: v%1.%2%3%4 - CPU description of an S60 device %1 major verison, %2 minor version %3 real name of major verison, %4 real name of minor version - CPU : v%1.%2%3%4 - - - CODA: v%1.%2 CODA protocol: v%3.%4 - CODA : v%1. Protocole CODA %2 : v%3.%4 - - - %1, %2%3%4, %5 - s60description description of an S60 device %1 CPU description, %2 endianness %3 default type size (if any), %4 float size (if any) %5 Coda version - %1, %2%3%4, %5 - - - big endian - gros-boutiste - - - little endian - petit-boutiste - - - , type size: %1 - will be inserted into s60description - , taille du type : %1 - - - , float size: %1 - will be inserted into s60description - , taille d'un flottant : %1 - - - - QtC::QmlProjectManager - - Open Qt Versions - Ouvrir les versions de Qt - - - QML Observer Missing - L'observateur QML est manquant - - - QML Observer could not be found for this Qt version. - L'observateur QML n'a pas pu être trouvé pour cette version de Qt. - - - QML Observer is used to offer debugging features for Qt Quick UI projects in the Qt 4.7 series. - -To compile QML Observer, go to the Qt Versions page, select the current Qt version, and click Build in the Helpers section. - L'observateur QML est utiliser pour offrir des fonctionnalités de débogage aux projets d'interface Qt Quick dans la série Qt 4.7. - -Pour compiler l'observateur QML, allez à la page des versions de Qt, sélectionnez la versions actuelle de Qt et cliquez sur Construire dans la section Assistants. - - - - QtC::RemoteLinux - - Ignore missing files - Ignorer les fichiers manquants - - - Tarball creation not possible. - Création de l'archive tarball impossible. - - - Create tarball: - Créer un tarball : - - - - QtC::ExtensionSystem - - Qt Creator - Plugin loader messages - Qt Creator - messages du chargeur de plug-in - - - The following plugins have errors and cannot be loaded: - Les chemins suivant contiennent des erreurs et ne peuvent être chargés : - - - Details: - Détails : - - - - QtC::QmlProfiler - - Painting - Dessin - - - Compiling - Compilation - - - Creating - Création - - - Handling Signal - Gestion du signal - - - Signal Handler - Gestionnaire de signaux - - - - QtC::Tracing - - Details - Détails - - - Location - Emplacement - - - Duration: - Durée : - - - Details: - Détails : - - - Location: - Emplacement : - - - Binding loop detected - Boucle liées détectées - - - - MobileAppWizardHarmattanOptionsPage - - WizardPage - WizardPage - - - Application icon (80x80): - Icône de l'application (80x80) : - - - Generate code to speed up the launching on the device. - Générer du code pour accéler le lancement sur le périphérique. - - - Make application boostable - Créer une application boostable - - - - ProFilesUpdateDialog - - Maemo Deployment Issue - Problème de déploiement Maemo - - - The project files listed below do not contain deployment information, which means the respective targets cannot be deployed to and/or run on a device. Qt Creator will add the missing information to these files if you check the respective rows below. - La liste des fichiers de projet ci-dessous ne contient pas d'informations de déploiement, ce qui signifie que les cibles respectives ne peuvent pas être déployées et/ou executées sur un périphérique. Qt Creator peut ajouter les informations manquantes à ces fichiers si vous vérifiez les lignes correspondantes ci-dessous. - - - &Check all - &Cocher tout - - - &Uncheck All - Décocher to&ut - - - - SshKeyCreationDialog - - SSH Key Configuration - Configuration de la slé SSH - - - Options - Options - - - Key &size: - Taille de la clé (&S) : - - - Key algorithm: - Algorithme de la clé : - - - &RSA - &RSA - - - &DSA - &DSA - - - Key - Clé - - - &Generate SSH Key - &Générer une clé SSH - - - Save P&ublic Key... - Sauver la clé &publique... - - - Save Pr&ivate Key... - Sauver la clé p&rivée... - - - &Close - &Fermer - - - - StartGdbServerDialog - - List of Remote Processes - Liste des processus distants - - - Device: - Appareil mobile : - - - &Filter by process name: - &Filtrer par nom de processus : - - - &Attach to Selected Process - &Attacher au processus sélectionné - - - &Update List - Mettre à jo&ur la liste - - - - QtC::TextEditor - - Copy Code Style - Copier le style de code - - - Code style name: - Nom du style de code : - - - %1 (Copy) - %1 (Copie) - - - Delete Code Style - Supprimer le style de code - - - Are you sure you want to delete this code style permanently? - Êtes vous sur de vouloir supprimer ce style de code ? - - - Import Code Style - Importer un style de code - - - Code styles (*.xml);;All files (*) - Styles de code (*.xml);;Tous les fichiers (*) - - - Cannot import code style from "%1". - Impossible d'importer le style de code à partir de "%1". - - - Cannot import code style - Impossible d'importer le style de code - - - Export Code Style - Exporter le style de code - - - %1 [proxy: %2] - %1 [proxy : %2] - - - %1 [built-in] - %1 [intégré] - - - - ExampleLineEdit - - Show Examples and Demos - Montrer les exemples et démos - - - Search in Tutorials - Recherche dans les tutoriels - - - Search in Tutorials, Examples and Demos - Recherche dans les tutoriels, exemples et démos - - - Tag List - Liste de tags - - - - LinksBar - - Qt Creator - Qt Creator - - - - QmlJsDebugClient::QmlProfilerEventList - - <bytecode> - <bytecode> - - - Source code not available - Code source non disponible - - - <program> - Une autre balise, dois-je traduire ? oui oui, si ils les ont mis... C'est sans doute des placeHolders - <programme> - - - Main Program - Programme principal - - - Animation Timer Update - Mise à jour du timer d'animation - - - <Animation Update> - Balise ? dois je traduire ? - <Mise à jour Animation> - - - No data to save - Aucune donnée à enregistrer - - - Could not open %1 for writing - Impossible d'ouvrir %1 en écriture - - - Could not open %1 for reading - Impossible d'ouvrir le fichier %1 en lecture - - - Error while parsing %1 - Erreur lors de l'analyse de : %1 - - - Invalid version of QML Trace file. - Version invalide du fichier de traçage de QML. - - - %1 animations at %2 FPS - %1 animations à %2 FPS - - - - QtC::Utils - - Password Required - Mot de passe requis - - - Please enter the password for your private key. - Veuillez insérer votre mot de passe pour votre clé privée. - - - Out of memory. - Mémoire insuffisante. - - - An encoding error was encountered. - Une erreur d'encodage a été rencontrée. - - - - QtC::Bazaar - - Verbose - Journal - - - Show files changed in each revision - Afficher les fichiers modifiés pour chaque révision - - - Forward - Avancer - - - Show from oldest to newest - Afficher du plus vieux au plus récent - - - Include merges - Inclure les fusions - - - Show merged revisions - Afficher les révisions fusionnées - - - Detailed - Détaillé - - - Moderately short - Modérément court - - - One line - Une ligne - - - GNU ChangeLog - Journal de changement GNU - - - - QtC::Core - - Launching a file browser failed - Échec du lancement du navigateur de fichier - - - Unable to start the file manager: - -%1 - - - Impossible de démarrer le gestionnaire de fichiers : - -%1 - - - - - '%1' returned the following error: - -%2 - '%1' retourne l'erreur suivante : - -%2 - - - Launching Windows Explorer Failed - Échec du lancement de l'explorateur Windows - - - Could not find explorer.exe in path to launch Windows Explorer. - explorer.exe introuvable dans le chemin pour lancer Windows Explorer. - - - Find in This Directory... - Trouver dans le répertoire... - - - Show in Explorer - Afficher dans l'explorateur - - - Show in Finder - Afficher dans la recherche - - - Show Containing Folder - Afficher le dossier parent - - - Open Command Prompt Here - Ouvre une invite de commande ici - - - Open Terminal Here - Ouvre un terminal ici - - - Deleting File Failed - L'effacement de fichier a échoué - - - Could not delete file %1. - Impossible de supprimer le fichier %1. - - - Unable to create the directory %1. - Impossible de créer le répertoire %1. - - - - FunctionDeclDefLink - - Target file was changed, could not apply changes - Le fichier cible a été modifié, impossible d'appliquer les changements - - - Apply changes to definition - Appliquer les changements aux définitions - - - Apply changes to declaration - Appliquer les changements aux déclarations - - - Apply function signature changes - Appliquer les changements de signatures de fonctions - - - - QtC::Debugger - - C++ exception - Exception C++ - - - Thread creation - Création de thread - - - Thread exit - Sortie de thread - - - Load module: - Charger le module : - - - Unload module: - Décharger le module : - - - Output: - Sortie : - - - <p>An uncaught exception occurred:</p><p>%1</p> - <p>Une exception non gérée a eu lieu : </p><p>%1</p> - - - <p>An uncaught exception occurred in '%1':</p><p>%2</p> - <p>Une exception non gérée a eu lieu dans '%1' : </p><p>%2</p> - - - No Local Variables - Aucune variable locale - - - <p>An uncaught exception occurred in <i>%1</i>:</p><p>%2</p> - <p>Une exception non gérée a eu lieu dans <i>%1</i> : </p><p>%2</p> - - - Uncaught Exception - Exception non gérée - - - - QtC::Core - - Case sensitive - Sensible à la casse - - - Whole words - Mots entier - - - Regular expressions - Expressions régulière - - - Preserve case - Préserver la casse - - - Flags: %1 - Flags : %1 - - - None - Aucune - - - , - , - - - Search was canceled. - La recherche a été annulée. - - - Repeat the search with same parameters - Relancer la recherche avec les mêmes paramètres - - - Search again - Rechercher encore - - - Replace with: - Remplacer avec : - - - Replace all occurrences - Remplacer toutes les occurrences - - - This change cannot be undone. - Ce changement ne peut être annulé. - - - The search resulted in more than %n items, do you still want to continue? - - La recherche a trouvé plus de %n élément, souhaitez vous continuer ? - La recherche a trouvé plus de %n éléments, souhaitez vous continuer ? - - - - Continue - Continue - - - No matches found. - Aucun résultat. - - - %n matches found. - - %n résultat trouvé. - %n résultats trouvés. - - - - - QtC::ProjectExplorer - - <html><head/><body><p>A versioned backup of the .user settings file will be used, because the non-versioned file was created by an incompatible newer version of Qt Creator.</p><p>Project settings changes made since the last time this version of Qt Creator was used with this project are ignored, and changes made now will <b>not</b> be propagated to the newer version.</p></body></html> - <html><head/><body><p>Une sauvegarde versionnée du fichier de paramètres .user sera utilisée parce qu'un fichier non versionné a été créé par une version plus récente et incompatible de Qt Creator.</p><p>Les changements aux préférences du projet effectuées depuis la dernière fois que cette version de Qt Creator a été utilisée avec ce projet seront ignorés et les changements effectués dès maintenant ne seront <b>pas</b> propagés à la nouvelle version.</p></body></html> - - - No valid .user file found for '%1' - Aucun fichier .user valide trouvé pour "%1" - - - <p>No valid settings file could be found for this installation of Qt Creator.</p><p>All settings files were either too new or too old to be read.</p> - <p>Aucun fichier de configuration n'a pu être trouvé pour cette installation de Qt Creator.</p><p>Tous les fichiers de configuration étaient soit trop récents ou trops vieux pour être lus.</p> - - - Settings File for '%1' from a different Environment? - Fichier de configuration pour "%1" venant d'un autre environnement ? - - - <p>No .user settings file created by this instance of Qt Creator was found.</p><p>Did you work with this project on another machine or using a different settings path before?</p><p>Do you still want to load the settings file '%1'?</p> - <p>Aucun fichier de configuration .user crée par cette instance de Qt Creator n'a été trouvé.</p><p>Avez-vous travailler avec ce projet sur une autre machine ou utilisant un autre répertoire de configuration précédemment ?</p><p>Souhaitez-vous toujours charger le fichier de configuration "%1" ?</p> - - - Using Old Settings File for '%1' - Utiliser l'ancien fichier de paramètres pour "%1" - - - <p>The versioned backup '%1' of the .user settings file is used, because the non-versioned file was created by an incompatible version of Qt Creator.</p><p>Project settings changes made since the last time this version of Qt Creator was used with this project are ignored, and changes made now will <b>not</b> be propagated to the newer version.</p> - <p>La sauvegarde versionnée "%1" du fichier de paramètres .user est utilisée, car le fichier non versionné a été créer par une version incompatible de Qt Creator.</p><p>Les changements des paramètres du projet effectués depuis la dernière utilisation de cette version de Qt Creator avec ce projet sont ignorés et les changements actuels <b>ne</b> seront <b>pas</b> propagés dans la prochaine version.</p> - - - Unsupported Shared Settings File - Fichier de configuration partagé non supporté - - - The version of your .shared file is not supported by Qt Creator. Do you want to try loading it anyway? - La version de votre fichier .shared n'est pas supportée par Qt Creator. Souhaitez-vous le charger ? - - - The version of your .shared file is not supported by this Qt Creator version. Only settings that are still compatible will be taken into account. - -Do you want to try loading it? - La version de votre fichier .shared n'est pas supportée par cette version de Qt Creator. Seuls les paramètres compatibles seront pris en compte. - -Souhaitez-vous le charger ? - - - The version of your .shared file is not yet supported by this Qt Creator version. Only settings that are still compatible will be taken into account. - -Do you want to continue? - -If you choose not to continue Qt Creator will not try to load the .shared file. - La version de votre fichier partagé n'est pas encore supporté par cette version de Qt Creator. Seuls les paramètres toujours compatible seront pris en compte. - -Voulez vous continuez ? - -Si vous choisissez de ne pas continuer, Qt Creator n'essayera pas de charger le fichier partagé. - - - - QtC::QmlJSEditor - - Qt Quick - Burger King bientôt ? :P - Qt Quick - - - - QtC::QmlJS - - The type will only be available in Qt Creator's QML editors when the type name is a string literal - Le type sera disponible dans l'éditeur QML de Qt Creator lorsque le nom du type est une chaîne de caractères - - - The module URI cannot be determined by static analysis. The type will be available -globally in the QML editor. You can add a "// @uri My.Module.Uri" annotation to let -Qt Creator know about a likely URI. - Le module URI ne peut être déterminé par analyse statique. Le type ne sera pas disponible -globalement dans l'éditeur QML. Vous pouvez ajouter une annotation '// @uri My.Module.Uri" pour informer Qt Creator à propos d'une URI. - - - must be a string literal to be available in the QML editor - doit être une chaîne de caractères afin d'être disponible dans l'éditeur QML - - - - QtC::QmakeProjectManager - - Headers - En-têtes - - - Sources - Sources - - - Forms - Formulaires - - - Resources - Ressources - - - QML - QML - - - Other files - Autres fichiers - - - Cannot open the file for editing with VCS. - Impossible d'ouvrir le fichier pour édition avec le gestionnaire de versions. - - - There are unsaved changes for project file %1. - Des modifications n'ont pas été enregistrées pour le fichier de projet %1. - - - Failed! - Échec ! - - - Could not write project file %1. - Impossible d'écrire dans le fichier de projet %1. - - - File Error - Erreur de fichier - - - Wrong Icon Size - Mauvaise taille d'icône - - - The icon needs to be %1x%2 pixels big, but is not. Do you want Qt Creator to scale it? - L'icône doit être de la taille %1x%2, mais ne l'est pas. Souhaitez vous que Qt Creator la redimensionne ? - - - Could not copy icon file: %1 - Impossible de copier le fichier de l'icône : %1 - - - - QtC::RemoteLinux - - No deployment action necessary. Skipping. - Aucune action de déploiement nécessaire. Continuation. - - - No device configuration set. - Aucune configuration du périphérique définie. - - - Connection error: %1 - Erreur de connexion : %1 - - - Deployment failed: %1 - Échec du déploiement : %1 - - - Cannot deploy: %1 - Impossible de déployer : %1 - - - User requests deployment to stop; cleaning up. - L'utilisateur a demandé l'arrêt du déploiement; nettoyage en cours. - - - Deploy step failed. - Étape de déploiement échouée. - - - Deploy step finished. - Étape de déploiment effectuée. - - - Successfully uploaded package file. - Fichier de paquet envoyé avec succès. - - - Installing package to device... - Installation du paquet sur le périphérique en cours... - - - Package installed. - Paquet installé. - - - SFTP initialization failed: %1 - Échec de l'initialisation de SFTP : %1 - - - Upload of file '%1' failed: %2 - Échec lors de l'envoi du fichier "%1" : %2 - - - Upload of file '%1' failed. The server said: '%2'. - L'envoi du fichier '%1' a échoué. Le serveur a répondu : '%2'. - - - If '%1' is currently running on the remote host, you might need to stop it first. - Si '%1' est en cours d'exécution sur l'hôte distante, vous devez l'arrêter en premier. - - - Failed to upload file '%1'. - Échec lors de l'envoi du fichier "%1". - - - Failed to set executable flag. - Échec lors de la définition des paramètres de l'exécutable. - - - Failed to upload file '%1': Could not open for reading. - Échec lors de l'envoi du fichier "%1" : impossible de l'ouvrir en lecture. - - - All files successfully deployed. - Tous les fichiers ont été déployés avec succès. - - - Warning: No remote path set for local file '%1'. Skipping upload. - Attention: Aucun chemin distant de défini pour le fichier local '%1'. Continuation de l'envoie. - - - Incremental deployment - Déploiement incrémental - - - Command line: - Ligne de commande : - - - Upload files via SFTP - Envoi de fichiers par SFTP - - - Generic Linux - Linux générique - - - Test - Test - - - Remote Processes... - Processus distants... - - - Deploy Public Key... - Déployer la clé publique... - - - Remote Processes - Processus distants - - - Deploy Public Key - Déployer la clé publique - - - Linux Device Configurations - Configurations des périphériques Linux - - - &Configuration: - &Configuration : + Version Control + Gestion de versions General - Général + Général - &Name: - &Nom : + Name + Nom - OS type: - Type d'OS : + Alias + Alias - Device type: - Type de périphérique : + Email + Courriel - &Add... - &Ajouter... + Alias email + - &Remove - &Supprimer + State + État - Set As Default - Définir comme par défaut + File + Fichier - Click here if you do not have an SSH key yet. - Cliquez ici si vous n'avez pas encore de clé SSH. + Check Message + Contrôle du message - &Generate SSH Key... - &Générer une clé SSH... + Insert Name... + Insérez le nom… - Close - Fermer + Cannot %1%2. + %2 is an optional error message with ': ' prefix. Don't add space in front. + - Device test finished successfully. - Test du périphérique terminé avec succès. + Close %1 %2 Editor + - Device test failed. - Le test du périphérique a échoué. + Closing this editor will abort the %1. + - Connecting to host... - Connexion à l'hôte... + &Close + &Fermer - Checking kernel version... - Verification de la version du noyau... + &Keep Editing + - SSH connection failure: %1 - Échec de la connexion SSH : %1 + Submit Message Check Failed + La vérification du message de submit a échoué - uname failed: %1 - Échec d'uname : %1 + Executing %1 + Exécution de %1 - uname failed. - Échec d'uname. + Executing [%1] %2 + Exécution de [%1] %2 - Error gathering ports: %1 - Erreur lors de la récupération des ports : %1 + "data" is no JSON object in "VcsCommand" page. + - All specified ports are available. - Tous les ports spécifiés sont disponibles. + "%1" not set in "data" section of "VcsCommand" page. + - The following specified ports are currently in use: %1 - Les ports suivant sont actuellement en cours d'utilisation : %1 + "%1" in "data" section of "VcsCommand" page has unexpected type (unset, String or List). + - SSH connection failure: %1 - - Échec de connexion SSH: %1 - + "%1" in "data" section of "VcsCommand" page has unexpected type (unset or List). + - uname failed: %1 - - Échec d'uname : %1 - + Job in "VcsCommand" page is empty. + - uname failed. - - Échec d'uname. - + Job in "VcsCommand" page is not an object. + - Checking if specified ports are available... - Vérification si les ports spécifiés sont disponibles... + Job in "VcsCommand" page has no "%1" set. + - Error gathering ports: %1 - - Erreur lors de la récupération des ports : %1 - + Command started... + - All specified ports are available. - - Tous les ports spécifiés sont disponibles. + Checkout + Import - The following specified ports are currently in use: %1 - - Les ports suivant sont actuellement en cours d'utilisation : %1 - + "%1" (%2) not found. + - Preparing SFTP connection... - Préparation de la connexion SFTP... + Version control "%1" is not configured. + - SFTP error: %1 - Erreur SFTP : %1 + Version control "%1" does not support initial checkouts. + - Package upload failed: Could not open file. - Échec de l'envoi du paquet : impossible d'ouvrir le fichier. + "%1" is empty when trying to run checkout. + - Starting upload... - Lancement de l'upload... + "%1" (%2) does not exist. + - Failed to upload package: %2 - Échec de l'envoi du paquet : %2 + No job running, please abort. + Aucun travail en cours, veuillez abandonner. - Updateable Project Files - Fichiers de projet pouvant être mis à jour + Failed. + Échec. - Maemo Deployment Issue - Problème de déploiement Maemo + Succeeded. + Réussi. - The project files listed below do not contain deployment information, which means the respective targets cannot be deployed to and/or run on a device. Qt Creator will add the missing information to these files if you check the respective rows below. - La liste des fichiers de projet ci-dessous ne contient pas d'informations de déploiement, ce qui signifie que les cibles respectives ne peuvent pas être déployées et/ou executées sur un périphérique. Qt Creator peut ajouter les informations manquantes à ces fichiers si vous vérifiez les lignes correspondantes ci-dessous. + Open "%1" + Ouvrir « %1 » - &Check all - &Cocher tout + Clear + Effacer - &Uncheck All - Décocher to&ut + Running: %1 + - Run custom remote command - Exécuter une commande distante personnalisée + Running in %1: %2 + - No command line given. - Aucune ligne de commande donnée. + The directory %1 could not be deleted. + Le répertoire %1 ne peut pas être supprimer. - Starting remote command '%1'... - Démarage de la commande distante '%1'... + The file %1 could not be deleted. + Le fichier %1 ne peut pas être supprimer. - Remote process failed to start. - Échec de démarage du processus distant. + There were errors when cleaning the repository %1: + Il y a eu des erreurs lors du nettoyage du dépôt %1 : - Remote process was killed by a signal. - Processus distant tué par un signal. + Delete... + Supprimer… - Remote process finished with exit code %1. - Processus distant terminé avec le code de sortie %1. + Repository: %1 + Dépôt : %1 - - Remote command finished successfully. - Processus distant terminé avec succès. - - - Deploy to Remote Linux Host - Déploiement sur une hôte Linux distante - - - Linux Devices - Périphériques Linux - - - Unknown OS - OS inconnu - - - (No device) - (Pas de périphérique) - - - <b>%1 using device</b>: %2 - <b>%1 utilisant le périphérique</b> : %2 - - - Error running remote process: %1 - Erreur lors de l'exécution du processus à distance : %1 - - - Error: %1 - Erreur : %1 - - - Process exited with code %1. - Le processus s'est terminé avec le code de sortie %1. - - - Error running 'env': %1 - Erreur lors de l'exécution de "env" : %1 - - - -Remote stderr was: '%1' - Le stderr distant était : "%1" - - - Select Sysroot - Sélectionner la racine système - - - &Attach to Selected Process - &Attacher au processus sélectionné - - - Device: - Appareil mobile : - - - Sysroot: - Sysroot : - - - &Filter by process name: - &Filtrer par nom de processus : - - - List of Remote Processes - Liste des processus distants - - - Remote Error - Erreur distante - - - Process aborted - Processus abandonné - - - Could not retrieve list of free ports: - Impossible de récupérer la liste des ports disponibles : - - - Starting gdbserver... - Démarrage de gbdserver... - - - Port %1 is now accessible. - Port %1 est maintenant accessible. - - - Server started on %1 - Serveur démarré sur %1 - - - Process gdbserver finished. Status: %1 - Processus gbdserver terminé. Status: %1 - - - Running command: %1 - Exécute la commande : %1 - {1?} - - - Packaging finished successfully. - Paquetage terminé avec succès. - - - Packaging failed. - Échec lors de la création du paquet. - - - Creating tarball... - Création de l'archive tarball... - - - Tarball up to date, skipping packaging. - L'archive tarball est à jour, continuation. - - - Error: tar file %1 cannot be opened (%2). - Erreur : le fichier %1 n'a pas pu être ouvert (%2). - - - No remote path specified for file '%1', skipping. - Aucun chemin distant spécifié pour le fichier '%1', continuation. - - - Error writing tar file '%1': %2. - Erreur lors de l'écriture du fichier "%1" : %2. - - - Error reading file '%1': %2. - Erreur lors de la lecture du fichier "%1" : %2. - - - Adding file '%1' to tarball... - Ajout du fichier '%1' dans l'archive tarball... - - - Cannot add file '%1' to tar-archive: path too long. - Impossible d'ajouter le fichier "%1" à l'archive : chemin trop long. - - - Error writing tar file '%1': %2 - Erreur lors de l'écriture du fichier "%1" : %2 - - - Create tarball - Créer un tarball - - - (default) - (par défaut) - - - %1 (default) - %1 (par défaut) - - - No tarball creation step found. - Aucune étape de création d'archive tarball trouvée. - - - Deploy tarball via SFTP upload - Déployer l'archive par SFTP - - - - QtC::TextEditor - - Edit preview contents to see how the current settings are applied to custom code snippets. Changes in the preview do not affect the current settings. - Éditer le prévisualisation du contenu pour voir la manière dont les paramètres actuels sont appliqués dans le snippets de code personnalisé. Les changements dans la zone de prévisualisation n'affectent pas les paramètres actuels. - - - Edit Code Style - Editez le style de code - - - You cannot save changes to a built-in code style. Copy it first to create your own version. - Vous ne pouvez pas sauvegarder les changements dans un code de style préfabriqué. Copiez le d'abord pour créer votre propre version. - - - Copy Built-in Code Style - Copier le style de code préfabriqué - - - Files on File System - Fichiers dans le système de fichiers - - - Directory '%1': - Répertoire '%1' : - - - Path: %1 -Filter: %2 -%3 - %3 is filled by BaseFileFind::runNewSearch - Chemin : %1 -Filtre : %2 -%3 - - - Director&y: - Réperto&ire : - - - &Browse... - &Parcourir... - - - Fi&le pattern: - Pat&ron de fichier : - - - Directory to search - Dossier dans lequel effectuer la recherche - - - - QtC::UpdateInfo - - Could not determine location of maintenance tool. Please check your installation if you did not enable this plugin manually. - Impossible de déterminer l'emplacement de l'outil de maintenant. Veuillez vérifier votre installation si vous n'avez pas activé ce module manuellement. - - - Could not find maintenance tool at '%1'. Check your installation. - Impossible de trouver l'outil de maintenant dans '%1'. Vérifiez votre installation. - - - Start Updater - Démarrer l'outil de mise à jour - - - Updates available - Des mises à jour sont disponibles - - - Update - Mettre à jour - - - - QtC::VcsBase - - -'%1' failed (exit code %2). - - -'%1' échoué (code de retour %2). - - - - -'%1' completed (exit code %2). - - -'%1' terminé (code de retour %2). - - - - Error: VCS timed out after %1s. - Erreur : le délai d'attente du serveur de contrôle de donnée a expiré après %1s. - - - Unable to start process, binary is empty - Impossible de démarrer le processus, le binaire est vide - - - - Analyzer::Internal::StartRemoteDialog - - Start Remote Analysis - Démarrer l'analyse distante - - - Remote - Distant - - - Host: - Hôte : - - - User: - Utilisateur : - - - Port: - Port : - - - You need to pass either a password or an SSH key. - Vous devez passer soit un mot de passe, soit une clé SSH. - - - Password: - Mot de passe : - - - Private key: - Clé privée : - - - Target - Cible - - - Executable: - Exécutable : - - - Arguments: - Arguments : - - - Working directory: - Répertoire de travail : - - - - QtC::Core - - Command Mappings - Mappages de commandes - - - Target - Cible - - - Reset all to default - Restaurer tous les paramètres par défaut - - - Reset All - Tout réinitialiser - - - Import... - Importer... - - - Export... - Exporter... - - - Target Identifier - Identifiant de la cible - - - Target: - Cible : - - - Reset to default - Restaurer les paramètres par défaut - - - Registered MIME Types - Types MIME enregistrés - - - Reset all to default. - Restaurer tous les paramètres par défaut. - - - Patterns: - Motifs : - - - Magic Header - En-tête magique - - - Range - Intervalle - - - Priority - Priorité - - - Add... - Ajouter... - - - Edit... - Modifier... - - - Filter - Filtre - - - Select a variable to insert. - Sélectionner une variable à insérer. - - - - QtC::CodePaster - - Form - Formulaire - - - The fileshare-based paster protocol allows for sharing code snippets using simple files on a shared network drive. Files are never deleted. - Le protocole de collage basé sur le partage de fichier permet de partager des fragments de code en utilisant de simples fichiers sur un disque réseau partagé. Ces fichiers ne sont jamais effacés. - - - &Path: - Che&min : - - - &Display: - &Afficher : - - - entries - Entrées - - - <a href="http://pastebin.com">pastebin.com</a> allows for sending posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix. - <a href="http://pastebin.com">pastebin.com</a> permet d'envoyer d'envoyer des messages à des sous-domaines personnalisés (comme creator.pastebin.com). Remplissez le préfixe désiré. - - - Server prefix: - Préfixe du serveur : - - - <i>Note: The plugin will use this for posting as well as fetching.</i> - <i>Note : le plug-in utilisera ceci pour poster et récupérer. </i> - - - Protocol: - Protocole : - - - Paste: - Collage : - - - Send to Codepaster - Envoyer sur Codepaster - - - &Username: - &Utilisateur : - - - <Username> - <Utilisateur> - - - &Description: - &Description : - - - <Description> - <Description> - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;Comment&gt;</p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;Comment&gt;</p></body></html> - - - Parts to Send to Server - Parties à envoyer au serveur - - - Patch 1 - Patch 1 - - - Patch 2 - Patch 2 - - - Days - Jours - - - &Expires after: - &Expire après : - - - Display Output pane after sending a post - Afficher le résultat après publication - - - Copy-paste URL to clipboard - Copier l'URL dans le presse papier - - - Username: - Nom d'utilisateur : - - - Default protocol: - Protocole par défaut : - - - - QtC::CppEditor - - Header suffix: - Suffixe des fichier d'en-tête : - - - Source suffix: - Suffixe des fichiers source : - - - Lower case file names - Nom de fichiers en minuscule - - - License template: - Modèle de licence : - - - Headers - En-têtes - - - &Suffix: - &Suffixe : - - - S&earch paths: - &Chemins de la recherche : - - - Comma-separated list of header paths. - -Paths can be absolute or relative to the directory of the current open document. - -These paths are used in addition to current directory on Switch Header/Source. - Liste des chemins pour les fichiers d'en-tête (séparation par des virgules). - -Les chemins peuvent être donnés en absolus ou en relatifs au dossier contenant le document ouvert courant. - -Ces chemines sont utilisés en complément au répertoire courant pour basculer entre les fichiers d'en-tête et de source. - - - Sources - Sources - - - S&uffix: - S&uffixe : - - - Se&arch paths: - &Chemins de la recherche : - - - Comma-separated list of source paths. - -Paths can be absolute or relative to the directory of the current open document. - -These paths are used in addition to current directory on Switch Header/Source. - Liste des chemins pour les fichiers de source (séparation par des virgules). - -Les chemins peuvent être donnés en absolus ou en relatifs au dossier contenant le document ouvert courant. - -Ces chemines sont utilisés en complément au répertoire courant pour basculer entre les fichiers d'en-tête et de source. - - - &Lower case file names - &Noms des fichiers en minuscule - - - License &template: - &Modèle de licence : - - - - QtC::Debugger - - Start Debugger - Lancer le débogueur - - - Kit: - Kit : - - - &Port: - &Port : - - - Stop when %1() is called - Arrêt lorsque %1() est appelée - - - Always add a breakpoint on the <i>%1()</i> function. - Toujours ajouter un point d'arrêt sur la fonction <i>%1()</i>. - - - Enable LLDB - Activer LLDB - - - Use GDB Python dumpers - Utiliser les collecteurs Python GDB - - - Start Remote Engine - Démarrer le moteur distant - - - &Host: - &Hôte : - - - &Username: - &Utilisateur : - - - &Password: - Mot de &passe : - - - &Engine path: - Chemin du mot&eur : - - - &Inferior path: - Chemin &inférieur : - - - - QtC::RemoteLinux - - Has a passwordless (key-based) login already been set up for this device? - Posséde déjà un de mot de passe (basé sur des clés) de connexion pour cet appareil ? - - - Yes, and the private key is located at - Oui, la clé privée est - - - No - Non - - - Choose build configuration: - Choisir la configuration de compilation : - - - Only create source package, do not upload - Ne créer que le paquet de sources, ne pas téléverser - - - Choose Package Contents - Choisir le contenu du paquet - - - <b>Please select the files you want to be included in the source tarball.</b> - - <b>Veuillez sélectionner les fichiers que vous voulez inclure dans le tarball des sources. </b> - - - Progress - Avancement - - - OpenGL Mode - Mode OpenGL - - - &Hardware acceleration - Accélération matérielle (&H) - - - &Software rendering - Rendu logiciel (&S) - - - &Auto-detect - &Auto-détecter - - - - QtC::ProjectExplorer - - Form - Formulaire - - - Language: - Langue : - - - - QmlDesigner::Internal::BehaviorDialog - - Dialog - Boîte de dialogue - - - Type: - Type : - - - ID: - Id : - - - Property name: - Nom de la propriété : - - - Animation - Animation - - - SpringFollow - SpringFollow - - - Settings - Paramètres - - - Duration: - Durée : - - - Curve: - Courbe : - - - easeNone - easeNone - - - Source: - Source : - - - Velocity: - Vitesse : - - - Spring: - Élasticité : - - - Damping: - Amortissement : - - - - QtC::Tracing - - Selection - Sélection - - - Start - Démarrer - - - End - Fin - - - Duration - Durée - - - - QtC::QmakeProjectManager - - Make arguments: - Arguments de Make : - - - Override %1: - Écraser %1 : - - - qmake build configuration: - Configuration de qmake pour la compilation : - - - Additional arguments: - Arguments supplémentaires : - - - Link QML debugging library: - Lier les bibliothèques de débogage QML : - - - Effective qmake call: - Appels qmake : - - - Details of Certificate - Détails du certificat - - - Main HTML File - Fichier HTML principal - - - Generate an index.html file - Générer un fichier index.html - - - Import an existing .html file - Importer un fichier .html existant - - - Load a URL - Charger une URL - - - http:// - http:// - - - Note: Unless you chose to load a URL, all files and directories that reside in the same directory as the main HTML file are deployed. You can modify the contents of the directory any time before deploying. - Note : à moins de choisir de charger une URL, tous les fichiers et répertoires qui résident dans le même répertoire que le fichier HTML principal sont déployés. Vous pouvez modifier le contenu du répertoire à n'importe quel moment avant le déploiement. - - - Touch optimized navigation - Navigation optimisée pour le toucher - - - Enable touch optimized navigation - Activer la navigation optimisée pour le toucher - - - Touch optimized navigation will make the HTML page flickable and enlarge the area of touch sensitive elements. If you use a JavaScript framework which optimizes the touch interaction, leave the checkbox unchecked. - La navigation optimisée pour le toucher rendre la page HTML flickable et élargira la zone des éléments sensibles au toucher. Si vous utilisez un framework JavaScript qui optimise l'interaction au toucher, laissez cette case décochée. - - - Application icon (80x80): - Icône de l'application (80x80) : - - - Generate code to speed up the launching on the device. - Générer du code pour accéler le lancement sur le périphérique. - - - Make application boostable - Créer une application boostable - - - Application icon (.svg): - Icône de l'application (.svg) : - - - Target UID3: - Cible UID3 : - - - Enable network access - Activer l'accès réseau - - - Plugin's directory name: - Nom du répertoire du plug-in : - - - - QtC::QtSupport - - Debugging Helper Build Log - Journal de compilation de l'assistant de debogage - - - - QtC::RemoteLinux - - Form - Formulaire - - - Authentication type: - Type d'identification : - - - Password - Mot de passe - - - &Key - Clé (&K) - - - &Host name: - Nom de l'&hôte : - - - IP or host name of the device - IP ou nom de l'hôte du périphérique - - - &SSH port: - Port &SSH : - - - Free ports: - Ports libres : - - - You can enter lists and ranges like this: 1024,1026-1028,1030 - Vous pouvez entrer des listes et des intervalles comme ceci : 1024,1026-1028,1030 - - - Timeout: - Timeout : - - - s - s - - - &Username: - &Utilisateur : - - - &Password: - Mot de &passe : - - - Show password - Montrer le mot de passe - - - Private key file: - Fichier de clé privée : - - - Set as Default - Définir comme par défaut - - - Physical Device - Périphérique physique - - - Emulator - Émulateur - - - You will need at least one port. - Vous avez besoin d'au moins un port. - - - Create New... - Créer un nouveau... - - - Machine type: - Type de machine : - - - GDB server executable: - Exécutable du serveur GDB : - - - Leave empty to look up executable in $PATH - Laisser vide pour rechercher un exécutable dans le $PATH - - - WizardPage - WizardPage - - - The name to identify this configuration: - Le nom pour identifier cette configuration : - - - The device's host name or IP address: - Le nom d'hôte du périphérique ou son adresse IP : - - - The user name to log into the device: - Le nom d'utilisateur pour se connecter sur le périphérique : - - - The authentication type: - Le type d'authentification : - - - Key - Clé - - - The user's password: - Le mot de passe de l'utilisateur : - - - The file containing the user's private key: - Le fichier contenant la clé privée de l'utilisateur : - - - Device Test - Test de périphérique - - - Device configuration: - Configuration du périphérique : - - - <a href="irrelevant">Manage device configurations</a> - <a href="irrelevant">Gérer les configurations du périphérique</a> - - - These show the INSTALLS settings from the project file(s). - Affiches les paramètres INSTALLS du/des fichier(s) de projet. - - - Files to install for subproject: - Fichiers à installer pour le sous-projet : - - - Files to deploy: - Fichiers à déployer : - - - - QtC::TextEditor - - Form - Formulaire - - - Typing - Frappe - - - Enable automatic &indentation - Activer l'&indentation automatique - - - Backspace indentation: - Indentation pour retour arrière : - - - <html><head/><body> -Specifies how backspace interacts with indentation. - -<ul> -<li>None: No interaction at all. Regular plain backspace behavior. -</li> - -<li>Follows Previous Indents: In leading white space it will take the cursor back to the nearest indentation level used in previous lines. -</li> - -<li>Unindents: If the character behind the cursor is a space it behaves as a backtab. -</li> -</ul></body></html> - - <html><head/><body> -Specifie comment retour arrière se comporte avec l'indentation. - -<ul> -<li>Aucune: Aucune interaction. Comportement habituel de la touche retour arrière. -</li> - -<li>Suit l'indentation qui précède : dans des espaces de début de ligne, ramène le curseur au niveau d'indentation le plus proche utilisé dans les lignes précédentes. -</li> - -<li>Désindente : Si le caractère après le curseur est un espace, se comporte comme une tabulation arrière. -</li> -</ul></body></html> - - - - None - Aucune - - - Follows Previous Indents - Suit l'indentation qui précède - - - Unindents - Désindente - - - Tab key performs auto-indent: - La touche tabulation active l'identation automatique : - - - Never - Jamais - - - Always - Toujours - - - In Leading White Space - Dans des espaces en début de ligne - - - Cleanup actions which are automatically performed right before the file is saved to disk. - Actions de nettoyage qui sont effectuées automatiquement avant d'enregistrer le fichier sur le disque. - - - Cleanups Upon Saving - Nettoyage à la sauvegarde - - - Removes trailing whitespace upon saving. - Supprime les caractères d'espacement à la fin des lignes lors de la sauvegarde. - - - &Clean whitespace - &Nettoyer les espaces - - - Clean whitespace in entire document instead of only for changed parts. - Nettoyer les espaces dans tout le document au lieu de limiter le nettoyage aux parties modifiées. - - - In entire &document - Dans tout le &document - - - Correct leading whitespace according to tab settings. - Corriger les espaces à l'avant des lignes pour respecter la configuration des tabulations. - - - Clean indentation - Nettoyer l'indentation - - - Always write a newline character at the end of the file. - Toujours écrire une nouvelle ligne à la fin du fichier. - - - &Ensure newline at end of file - &Forcer un retour de ligne à la fin du fichier - - - File Encodings - Encodages de fichier - - - Default encoding: - Encodage par défaut : - - - <html><head/><body> -<p>How text editors should deal with UTF-8 Byte Order Marks. The options are:</p> -<ul ><li><i>Add If Encoding Is UTF-8:</i> always add a BOM when saving a file in UTF-8 encoding. Note that this will not work if the encoding is <i>System</i>, as Qt Creator does not know what it actually is.</li> -<li><i>Keep If Already Present: </i>save the file with a BOM if it already had one when it was loaded.</li> -<li><i>Always Delete:</i> never write an UTF-8 BOM, possibly deleting a pre-existing one.</li></ul> -<p>Note that UTF-8 BOMs are uncommon and treated incorrectly by some editors, so it usually makes little sense to add any.</p> -<p>This setting does <b>not</b> influence the use of UTF-16 and UTF-32 BOMs.</p></body></html> - <html><head/><body> -<p>Comment les éditeurs de textes devrait gérer les BOM UTF-8. Les options sont : </p> -<ul ><li><i>ajouter si l'encodage est UTF-8 :</i> toujours ajouter un BOM à la sauvegarde d'un fichier en UTF-8 ; notez que ceci ne fonctionnera pas si l'encodage est <i>System</i>, puisque Qt Creator ne sait pas ce qu'il en est réellement ; </li> -<li><i>garder si déjà présent :</i> sauvegarder le fichier avec un BOM s'il en avait déjà un au chargement ; </li> -<li><i>toujours supprimer :</i> ne jamais écrire de BOM, parfois en supprimant l'existant.</li></ul> -<p>Notez que les BOM UTF-8 ne sont pas courants et sont traités de manière incorrecte par certains éditeurs, cela n'a que rarement du sens que d'en ajouter un. </p> -<p>Ce paramètre n'influence <b>pas</b> l'utilisation des BOM UTF-16 et UTF-32.</p></body></html> - - - Add If Encoding Is UTF-8 - Ajouter si l'encodage est UTF-8 - - - Keep If Already Present - Garder si déjà présent - - - Always Delete - Toujours supprimer - - - UTF-8 BOM: - UTF-8 BOM : - - - Mouse and Keyboard - Souris et clavier - - - Enable &mouse navigation - Activer la navigation à la &souris - - - Enable scroll &wheel zooming - Activer le zoom via la &roulette - - - Enable built-in camel case &navigation - Activer la &navigation en Camel Case intégrée - - - Show help tooltips: - Afficher les bulles d'aide : - - - On Mouseover - Sur le passage de la souris - - - On Shift+Mouseover - Sur Maj + la passage de la souris - - - Press Alt to display context-sensitive help or type information as tooltips. - Appuyer sur Alt pour afficher l'aide selon le contexte ou les informations de type dans une bulle d'aide. - - - Using keyboard shortcut (Alt) - Utiliser le raccourci clavier (Alt) - - - Show help tooltips using keyboard shortcut (Alt) - Afficher les info-bulles d'aide en utilisant les raccourcis clavier (Alt) - - - Show help tooltips using the mouse: - Afficher les info-bulles d'aide en utilisant la souris : - - - Current settings: - Paramètres actuels : + + %n bytes, last modified %1. + + + + - Edit... - Modifier... + Cleaning "%1" + - Remove + Delete Supprimer - - Export... - Exporter... + + Do you want to delete %n files? + + Voulez-vous supprimer %n fichier ? + Voulez-vous supprimer %n fichiers ? + - Import... - Importer... + CVS Commit Editor + Éditeur de commit pour CVS - Display line &numbers - Afficher les &numéros de ligne + CVS Command Log Editor + Éditeur de log de commande pour CVS - Highlight current &line - Surligner la &ligne courante + CVS File Log Editor + Éditeur de log de fichier pour CVS - Display &folding markers - Affiche les marqueurs de &pliage + CVS Annotation Editor + Éditeur d’annotation pour CVS - Highlight &blocks - Surligner les &blocs + CVS Diff Editor + Éditeur de diff pour CVS - Mark &text changes - Marquer les modifications de &texte + Git Annotation Editor + Éditeur d’annotation pour Git - Show tabs and spaces. - Afficher les tabulations et espaces. + Git SVN Log Editor + - &Visualize whitespace - &Visualiser les espaces + Git Log Editor + - &Animate matching parentheses - &Animer les parenthèses correspondantes + Git Reflog Editor + - Auto-fold first &comment - reformulation à l'infinitif -francis : en effet, une erreur de ma part --> validé. - Replier automatiquement le premier &commentaire + Git Commit Editor + Éditeur de commit Git - Center &cursor on scroll - Centrer le &curseur sur le barre de défilement + Git Rebase Editor + Éditeur de rebasage Git - Text Wrapping - Retour à la ligne dynamique + Git Submit Editor + Éditeur de soumission pour Git - Enable text &wrapping - Activer le &retour à la ligne automatique + Mercurial File Log Editor + Éditeur de log de fichier pour Mercurial - Display right &margin at column: - Afficher une &marge à la colonne : + Mercurial Annotation Editor + Éditeur d’annotation pour Mercurial - &Highlight matching parentheses - &Surligner les parenthèses correspondantes + Mercurial Diff Editor + Éditeur de diff pour Mercurial - Always open links in another split - Toujours ouvrir les liens dans une nouvelle vue + Mercurial Commit Log Editor + Éditeur de log de commit pour Mercurial - Display file encoding - Afficher l'encodage du fichier + Perforce.SubmitEditor + Éditeur de soumission pour Perforce - <html><head/><body> -<p>Highlight definitions are provided by the <a href="http://kate-editor.org/">Kate Text Editor</a>.</p></body></html> - <html><head/><body> -<p>Les définitions de coloration syntaxique sont fournies par l'éditeur de texte <a href="http://kate-editor.org/">Kate</a>.</p></body></html> + Perforce Log Editor + Éditeur de log pour Perforce - Syntax Highlight Definition Files - Fichiers de définition de colorationsyntaxique + Perforce Diff Editor + Éditeur de diff pour Perforce - Location: - Emplacement : + Perforce Annotation Editor + Éditeur d’annotation pour Perforce - Use fallback location - Utiliser un emplacement de repli + Subversion Commit Editor + Éditeur de commit pour Subversion - Alert when a highlight definition is not found - Prévenir si une définition de coloration syntaxique n'est pas trouvée + Subversion File Log Editor + Éditeur de log de fichier pour Subversion - Ignored file patterns: - Motifs de fichier ignorés : + Subversion Annotation Editor + Éditeur d’annotation pour Subversion - Group: - Groupe : + Bazaar File Log Editor + Éditeur de log de fichier pour Bazaar - Add - Ajouter + Bazaar Annotation Editor + Éditeur d’annotation pour Bazaar - Revert Built-in - Rétablir l'intégration + Bazaar Diff Editor + Éditeur de diff pour Bazaar - Restore Removed Built-ins - Rétablir les intégrations distantes + Bazaar Commit Log Editor + Éditeur de log de commit pour Bazaar - Reset All - Tout réinitialiser + ClearCase Check In Editor + Éditeur de vérification pour ClearCase - Tabs And Indentation - Tabulation et indentation + ClearCase File Log Editor + Éditeur de journal de fichiers pour ClearCase - Tab policy: - Politique de tabulation : + ClearCase Annotation Editor + Éditeur d’annotations pour ClearCase - Spaces Only - Espaces seulement + ClearCase Diff Editor + Éditeur de diff pour ClearCase - Tabs Only - Tabulation seulement + Choose Repository Directory + Sélectionner le répertoire pour le dépôt - Mixed - Mixte + Commit + name of "commit" action of the VCS. + Faire un commit - Ta&b size: - Taille de &tabulation : + Save before %1? + - &Indent size: - Taille de l'in&dentation : + The file "%1" could not be deleted. + - Align continuation lines: - Aligner les lignes de continuation : + The directory "%1" is already managed by a version control system (%2). Would you like to specify another directory? + - <html><head/><body> -Influences the indentation of continuation lines. - -<ul> -<li>Not At All: Do not align at all. Lines will only be indented to the current logical indentation depth. -<pre> -(tab)int i = foo(a, b -(tab)c, d); -</pre> -</li> - -<li>With Spaces: Always use spaces for alignment, regardless of the other indentation settings. -<pre> -(tab)int i = foo(a, b -(tab) c, d); -</pre> -</li> - -<li>With Regular Indent: Use tabs and/or spaces for alignment, as configured above. -<pre> -(tab)int i = foo(a, b -(tab)(tab)(tab) c, d); -</pre> -</li> -</ul></body></html> - <html><head/><body> -Influence l'indentation des lignes de continuation. -<ul> -<li>Pas du tout : ne pas aligner. Les lignes ne seront indentées jusqu'à la profondeur d'indentation logique. -<pre> -(tab)int i = foo(a, b -(tab)c, d); -</pre> -</li> -<li>Avec espaces : toujours utiliser des espaces pour l'alignement, sans tenir compte des autres paramètres d'indentation. -<pre> -(tab)int i = foo(a, b -(tab) c, d); -</pre> -</li> -<li>Avec indentation régulière : utiliser des tabulations et/ou des espaces pour l'alignement, en fonction de la configuration. -<pre> -(tab)int i = foo(a, b -(tab)(tab)(tab) c, d); -</pre> -</li> -</ul></body></html> + Repository already under version control + Le dépôt est déjà sous gestion de versions - Not At All - Pas du tout + Repository Created + Dépôt créé - With Spaces - Avec espaces + Repository Creation Failed + Échec lors de la création du dépôt - With Regular Indent - Avec indentation régulière + A version control repository has been created in %1. + Un dépôt sous gestionnaire de versions à été créé dans %1. - The text editor indentation setting is used for non-code files only. See the C++ and Qt Quick coding style settings to configure indentation for code files. - Le paramètre d'indentation de l'éditeur de texte n'est utilisé que pour les fichiers autre que de code. Voir les paramètres du style de codage C++ et Qt Quick pour configurer l'indentation pour les fichiers de code. + A version control repository could not be created in %1. + Un dépôt sous gestionnaire de versions ne peut pas être créé dans %1. - <i>Code indentation is configured in <a href="C++">C++</a> and <a href="QtQuick">Qt Quick</a> settings.</i> - <i>L'indentation du code est configurée dans les paramètres <a href="C++">C++</a> et <a href="QtQuick">Qt Quick</a>.</i> - - - - QtC::Todo - - Form - Formulaire + Working... + Travail en cours… - Keywords - Mots clés + Annotate "%1" + Annoter « %1 » - Add - Ajouter + Copy "%1" + Copier « %1 » - Edit - Éditer + &Describe Change %1 + - Remove - Supprimer + Send to CodePaster... + Envoyer à CodePaster… - Reset - Réinitialiser + Apply Chunk... + Appliquer le morceau… - Scanning scope - Portée de la recherche - - - - QtC::VcsBase - - WizardPage - WizardPage + Revert Chunk... + Rétablir le morceau… - Repository - Dépôt + Failed to retrieve data. + Échec de la réception des données. - The remote repository to check out. - Le dépôt distant à importer. + Configuration + Configuration - Branch: - Branche : + No version control set on "VcsConfiguration" page. + Do not translate "VcsConfiguration", because it is the id of a page. + - The development branch in the remote repository to check out. - La branche de développement du dépôt distant à importer. + "vcsId" ("%1") is invalid for "VcsConfiguration" page. Possible values are: %2. + Do not translate "VcsConfiguration", because it is the id of a page. + - Retrieve list of branches in repository. - Récupérer la liste des branches du dépôt. + Please configure <b>%1</b> now. + Veuillez configurer <b>%1</b> maintenant. - ... - ... - - - Working Copy - Copie de travail - - - The path in which the directory containing the checkout will be created. - Le chemin dans lequel le répertoire contenant l'import sera effectué. - - - Checkout path: - Chemin d'import : - - - The local directory that will contain the code after the checkout. - Le répertoire local qui contiendra le code après l'importation. - - - Checkout directory: - Répertoire d'import : - - - Path: - Chemin : - - - Directory: - Répertoire : + No known version control selected. + Clean Repository @@ -37804,6 +53306,7 @@ Influence l'indentation des lignes de continuation. Select All + Check all for submit Tout sélectionner @@ -37816,17 +53319,24 @@ Influence l'indentation des lignes de continuation. An executable which is called with the submit message in a temporary file as first argument. It should return with an exit != 0 and a message on standard error to indicate failure. - Un exécutable est appelé avec le message soumis dans un fichier temporaire comme premier argument. Pour indiquer une erreur, il doit se terminer avec un code différent 0 et un message sur la sortie d'erreur standard. + Un exécutable est appelé avec le message soumis dans un fichier temporaire comme premier argument. Pour indiquer une erreur, il doit se terminer avec un code différent 0 et un message sur la sortie d’erreur standard. + + + A file listing nicknames in a 4-column mailmap format: +'name <email> alias <email>'. + Submit message &check script: Script de vérifi&cation du message : - A file listing user names and email addresses in a 4-column mailmap format: -name <email> alias <email> - Un fichier listant les noms d'utilisateur et leur adresse email dans le format 4 colonnes de mailmap : -nom <email> alias <email> + Reset VCS Cache + + + + Reset information about which version control system handles which directory. + User/&alias configuration file: @@ -37834,22 +53344,12 @@ nom <email> alias <email> A simple file containing lines with field names like "Reviewed-By:" which will be added below the submit editor. - Un fichier texte contenant des lignes telles que "Reviewed-By:", qui seront ajoutées à la fin dans l'éditeur de message. + Un fichier texte contenant des lignes telles que « Reviewed-By: », qui seront ajoutées à la fin dans l’éditeur de message. User &fields configuration file: &Fichier de configuration des champs utilisateurs : - - &Patch command: - Commande &Patch : - - - Specifies a command that is executed to graphically prompt for a password, -should a repository require SSH-authentication (see documentation on SSH and the environment variable SSH_ASKPASS). - Spéficie une commande qui est exécutée pour demander graphiquement un mot de passe -si un dépôt requiert une authentification SSH (voir la documentation sur SSH et la variable d'environnement SSH_ASKPASS). - &SSH prompt command: Invite de commande &SSH : @@ -37858,6588 +53358,946 @@ si un dépôt requiert une authentification SSH (voir la documentation sur SSH e Specifies a command that is executed to graphically prompt for a password, should a repository require SSH-authentication (see documentation on SSH and the environment variable SSH_ASKPASS). Spécifie une commande qui est exécutée pour demander graphiquement un mot de passe -si un dépôt requiert une authentification SSH (voir la documentation sur SSH et la variable d'environnement SSH_ASKPASS). +si un dépôt requiert une authentification SSH (voir la documentation sur SSH et la variable d’environnement SSH_ASKPASS). + + + Open URL in Browser... + Ouvrir l’URL dans le navigateur… + + + Copy URL Location + Copier l’URL + + + Send Email To... + Envoyer un courriel à… + + + Copy Email Address + Copier le courriel + + + Subversion Submit + Soumission Subversion + + + Descriptio&n + Descriptio&n + + + F&iles + F&ichiers + + + Select a&ll + Tout &sélectionner + + + %1 %2/%n File(s) + + %1 %2/%n fichier + %1 %2/%n fichiers + + + + Warning: The commit subject is very short. + + + + Warning: The commit subject is too long. + + + + Hint: Aim for a shorter commit subject. + + + + Hint: The second line of a commit message should be empty. + + + + <p>Writing good commit messages</p><ul><li>Avoid very short commit messages.</li><li>Consider the first line as subject (like in email) and keep it shorter than %n characters.</li><li>After an empty second line, a longer description can be added.</li><li>Describe why the change was done, not how it was done.</li></ul> + + + + + + + Update in progress + Mise à jour en cours + + + Description is empty + + + + No files checked + + + + &Commit + &Commit + + + Unselect All + Uncheck all for submit + Tout désélectionner + + + Fossil File Log Editor + + + + Fossil Annotation Editor + + + + Fossil Diff Editor + + + + Fossil Commit Log Editor + + + + &Undo + Ann&uler + + + &Redo + + + + Diff &Selected Files + Faire un diff sur tous les fichiers &sélectionnés + + + Log count: + Nombre d’entrées de log : + + + Timeout: + Délai d’attente : + + + s + s + + + Reload + Recharger + + + &Open "%1" + + + + &Copy to clipboard: "%1" + + + + Name of the version control system in use by the current project. + + + + The current version control topic (branch or tag) identification of the current project. + + + + The top level path to the repository the current project is in. + - QtC::QtSupport + QtC::WebAssembly - Examples - Exemples + Web Browser + Navigateur web - Search in Examples... - Recherche dans les exemples... + WebAssembly Runtime + Exécution de WebAssembly + + + Emscripten SDK path: + Chemin du SDK d’Emscripten : + + + Select the root directory of an installed %1. Ensure that the activated SDK version is compatible with the %2 or %3 version that you plan to develop against. + Sélectionnez le répertoire racine d’une %1 installée. Assurez-vous que la version activée du SDK est compatible avec la version %2 ou %3 pour laquelle vous prévoyez de développer. + + + Emscripten SDK environment: + Environnement SDK d’Emscripten : + + + Note: %1 supports Qt %2 for WebAssembly and higher. Your installed lower Qt version(s) are not supported. + Remarque : %1 prend en charge Qt %2 pour WebAssembly et les versions supérieures. Les versions inférieures de Qt que vous avez installées ne sont pas prises en charge. + + + Adding directories to PATH: + Ajout des répertoires à PATH : + + + Setting environment variables: + Définition des variables d’environnement : + + + The activated version %1 is not supported by %2. Activate version %3 or higher. + La version activée %1 n’est pas prise en charge par %2. Activez la version %3 ou une version supérieure. + + + Activated version: %1 + Version activée : %1 + + + WebAssembly + WebAssembly + + + Setup Emscripten SDK for WebAssembly? To do it later, select Edit > Preferences > Devices > WebAssembly. + Configurer le SDK d’Emscripten pour WebAssembly ? Pour le faire plus tard, sélectionnez Édition > Préférences > Périphériques > WebAssembly. + + + Setup Emscripten SDK + Configuration du SDK d’Emscripten + + + WebAssembly + Qt Version is meant for WebAssembly + WebAssembly + + + %1 does not support Qt for WebAssembly below version %2. + %1 ne prend pas en charge Qt pour WebAssembly en dessous de la version %2. + + + Effective emrun call: + Appel effectif d’emrun : + + + Default Browser + Navigateur par défaut + + + Web browser: + Navigateur web : + + + Emscripten Compiler + Compilateur d’Emscripten + + + Emscripten Compiler %1 for %2 + Compilateur d’Emscripten %1 pour %2 + + + Emscripten + Emscripten - gettingstarted + QtC::Welcome - Getting Started - Commencer + UI Tour + Visite guidée de l’interface utilisateur - To select a tutorial and learn how to develop applications. - Pour sélectionner un tutoriel et apprendre comment développer des applications. + New to Qt? + Nouveau sur Qt ? - Start Developing - Commencer le développement + Get Started + Démarrer - To check that the Qt SDK installation was successful, open an example application and run it. - Pour vérifier que l'installation du Qt SDK a réussit, ouvrez une application d'exemple et exécutez la. + Get Qt + Obtenir Qt - Building and Running an Example Application - Compiler et exécuter une application d'exemple - - - IDE Overview - Aperçu de l'EDI - - - To find out what kind of integrated environment (IDE) Qt Creator is. - Pour découvrir ce que l'on trouve dans l'environnement de développement intégré (EDI) Qt Creator. - - - To become familiar with the parts of the Qt Creator user interface and to learn how to use them. - Pour s'habituer aux différentes parties de l'interface de Qt Creator et apprendre à les utiliser. - - - Blogs - Blogs - - - To find out what kind of integrated enviroment (IDE) Qt Creator is. - Pour découvrir ce que l'on trouve dans l'environnement de développement intégré (EDI) Qt Creator. - - - To become familar with the parts of the Qt Creator user interface and to learn how to use them. - Pour s'habituer avec les différentes parties de l'interface de Qt Creator et pour apprendre à les utiliser. - - - User Interface - Interface utilisateur - - - User Guide - Guide utilisateur + Qt Account + Compte Qt Online Community Communauté en ligne - Labs - QtLabs + Blogs + Blogs + + + User Guide + Guide utilisateur + + + Welcome + il s'agit du mode, donc d'un écran d'accueil + Accueil + + + Open Project... + Ouvrir un projet… + + + Create Project... + Créer un projet… + + + Would you like to take a quick UI tour? This tour highlights important user interface elements and shows how they are used. To take the tour later, select Help > UI Tour. + Voulez-vous faire un tour rapide de l’interface utilisateur ? Cette visite met en évidence les éléments importants de l’interface utilisateur et montre comment ils sont utilisés. Pour effectuer cette visite ultérieurement, sélectionnez Aide > Visite guidée de l’interface utilisateur. + + + Take UI Tour + Visite guidée de l’interface utilisateur + + + Mode Selector + + + + Select different modes depending on the task at hand. + Sélectionner différents modes en fonction de la tâche à accomplir. + + + <p style="margin-top: 30px"><table><tr><td style="padding-right: 20px">Welcome:</td><td>Open examples, tutorials, and recent sessions and projects.</td></tr><tr><td>Edit:</td><td>Work with code and navigate your project.</td></tr><tr><td>Design:</td><td>Visually edit Widget-based user interfaces, state charts and UML models.</td></tr><tr><td>Debug:</td><td>Analyze your application with a debugger or other analyzers.</td></tr><tr><td>Projects:</td><td>Manage project settings.</td></tr><tr><td>Help:</td><td>Browse the help database.</td></tr></table></p> + <p style="margin-top: 30px"><table><tr><td style="padding-right: 20px">Accueil :</td><td>Ouvrez des exemples, des tutoriels et des sessions et projets récents.</td></tr><td>Modifier :</td><td>Travaillez avec le code et naviguez dans votre projet.</td></tr><tr><td>Design:</td><td>Modifiez visuellement des interfaces utilisateur basées sur des widgets, des diagrammes d’état et des modèles UML. </td></tr><ttr><td>Débogage :</td><td>Analysez votre application avec un débogueur ou d’autres analyseurs.</td></tr><tr><td>Projets :</td><td>Gérez les paramètres du projet.</td></tr><tr><td>Aide :</td><td>Parcourez la base de données d’aide.</td></tr></table></p> + + + Kit Selector + Sélecteur de kit + + + Select the active project or project configuration. + Sélectionnez le projet actif ou la configuration du projet. + + + Run Button + Bouton exécution + + + Run the active project. By default this builds the project first. + Exécute le projet actif. Par défaut, le projet est compilé en premier. + + + Debug Button + Bouton Débogage + + + Run the active project in a debugger. + Exécute le projet actif dans un débogueur. + + + Build Button + Bouton Compiler + + + Build the active project. + Compiler le projet actif. + + + Locator + Localisateur + + + Type here to open a file from any open project. + Tapez ici pour ouvrir un fichier à partir de n’importe quel projet ouvert. + + + Or:<ul><li>type <code>c&lt;space&gt;&lt;pattern&gt;</code> to jump to a class definition</li><li>type <code>f&lt;space&gt;&lt;pattern&gt;</code> to open a file from the file system</li><li>click on the magnifier icon for a complete list of possible options</li></ul> + Ou :<ul><li>taper <code>c&lt;espace&gt;&lt;motif&gt;</code> pour passer à la définition d’une classe</li><li>taper <code>f&lt;espace&gt;&lt;motif&gt;</code> afin d’ouvrir un fichier à partir du système de fichiers</li><li>cliquez sur l’icône de la loupe pour obtenir une liste complète des options possibles</li></ul> + + + Output + Sortie + + + Find compile and application output here, as well as a list of configuration and build issues, and the panel for global searches. + Vous y trouverez les résultats de la compilation et de l’application, ainsi qu’une liste des problèmes de configuration et de compilation, et le panneau des recherches générales. + + + Progress Indicator + Indicateur de progression + + + Progress information about running tasks is shown here. + Les informations sur l’état d’avancement des tâches en cours sont affichées ici. + + + Escape to Editor + S’échapper vers l’éditeur + + + Pressing the Escape key brings you back to the editor. Press it multiple times to also hide context help and output, giving the editor more space. + En appuyant sur la touche Échap, vous revenez à l’éditeur. Appuyez plusieurs fois sur cette touche pour masquer l’aide contextuelle et la sortie, ce qui donne plus d’espace à l’éditeur. + + + The End + La fin + + + You have now completed the UI tour. To learn more about the highlighted controls, see <a style="color: #41CD52" href="qthelp://org.qt-project.qtcreator/doc/creator-quick-tour.html">User Interface</a>. + Vous avez maintenant terminé la visite guidée de l’interface utilisateur +Pour en savoir plus sur les contrôles mis en évidence, voir l’<a style="color: #41CD52" href="qthelp://org.qt-project.qtcreator/doc/creator-quick-tour.html">interface utilisateur</a>. + + + UI Introduction %1/%2 > + Introduction à l’interface utilisateur %1/%2 > - QtC::QtSupport + QtC::qmt - Tutorials - Tutoriels + Change + - Search in Tutorials... - Recherche dans les tutoriels... - - - - Delegate - - 2D PAINTING EXAMPLE long description - EXEMPLE 2D PAINTING description longue + Add Object + - The 2D Painting example shows how QPainter and QGLWidget work together. - L'exemple 2D Painting montre comment QPainter et QGLWidget fonctionnent ensemble. + Remove Object + - The 2D Painting example shows how QPainter and QGLWidget. The 2D Painting example shows how QPainter and QGLWidget work together. - Erreur de copier-coller dans la source ? Arf, la boulette, vais voir si on peut corriger ça... - L'exemple 2D Painting montre comment utiliser QPainter et QGLWidget ensemble. + Cut + Couper - Tags: - Tags : - - - - SearchBar - - Search... - Recherche... - - - - QtC::ProjectExplorer - - Rename - Renommer + Paste + Coller Delete - Supprimer + - %1 (last session) - %1 (dernière session) + Show Definition + - %1 (current session) - %1 (session courante) - - - - QtC::QmlJS - - do not use '%1' as a constructor - ne pas utiliser '%1' comme un constructeur + Inheritance + - invalid value for enum - valeur invalide pour une énumération + Association + - enum value must be a string or a number - la valeur d'une énumération doit être une chaîne de caractères ou un nombre + Dependency + - number value expected - valeur numérique attendue + Open Diagram + - invalid URL - URL invalide - - - invalid color - couleur invalide - - - anchor line expected - ligne d'ancrage attendue - - - duplicate property binding - contexte ? pierre: un warning a priori... - liaison de propriété dupliquée - - - id expected - ID attendu - - - invalid id - ID invalide - - - duplicate id - ID dupliqué - - - invalid property name '%1' - nom de propriété '%1' invalide - - - assignment in condition - assignation dans une condition - - - unterminated non-empty case block - bloc case non vide et non terminé - - - do not use 'eval' - ne pas utiliser 'eval' - - - unreachable - inatteignable - - - do not use 'with' - ne pas utiliser 'with' - - - do not use comma expressions - ne pas utiliser les expressions séparées par des virgules - - - '%1' is already a formal parameter - '%1' est déjà un paramètre formel - - - unnecessary message suppression - suppression d'un message inutile - - - '%1' is already a function - '%1' est déjà une fonction - - - var '%1' is used before its declaration - la variable '%1' est utilisée avant sa déclaration - - - '%1' is already a var - '%1' est déjà une variable - - - '%1' is declared more than once - '%1' est déclaré plusieurs fois - - - function '%1' is used before its declaration - la function '%1' est utilisée avant sa déclaration - - - the 'function' keyword and the opening parenthesis should be separated by a single space - le mot-clé 'function' et la parenthèse ouvrante doivent être séparés par un seule espace - - - do not use stand-alone blocks - ne pas utiliser de blocs indépendants - - - do not use void expressions - ne pas utiliser les expressions void - - - confusing pluses - signe plus prêtant à confusion - - - confusing minuses - signe moins prêtant à confusion - - - declare all function vars on a single line - Déclarez toutes les variables de fonction sur une seule ligne - - - unnecessary parentheses - parenthèses non nécessaires - - - == and != may perform type coercion, use === or !== to avoid - == et != peuvent provoquer une coercition de type, utilisez === ou !== pour l'éviter - - - var declarations should be at the start of a function - la déclaration de variables doit être au début de la fonction - - - only use one statement per line - utiliser seulement une déclaration par ligne - - - unknown component - composant inconnu - - - could not resolve the prototype '%1' of '%2' - impossible de résoudre le prototype '%1' de '%2' - - - could not resolve the prototype '%1' - impossible de résoudre le prototype de '%1' - - - prototype cycle, the last non-repeated component is '%1' - dans le cycle de prototype, le dernier objet non répété est '%1' - - - invalid property type '%1' - type de propriété invalide '%1' - - - == and != perform type coercion, use === or !== to avoid - == et != effectuent une coercition de type, utilisez === ou !== pour l'éviter - - - calls of functions that start with an uppercase letter should use 'new' - les appels de fonctions qui commencent par une lettre majuscule devrait utiliser 'new' - - - 'new' should only be used with functions that start with an uppercase letter - 'new' ne devrait être utilisé qu'avec des fonctions qui commencent par une lettre majuscule - - - use spaces around binary operators - utilisez des espaces autour des opérateurs binaires - - - use %1 instead of 'var' or 'variant' to improve performance - utilisez %1 à la place de 'var' ou 'variant' pour améliorer les performances - - - missing property '%1' - propriété '%1' manquante - - - object value expected - valeur objet attendue - - - array value expected - valeur de tableau attendue - - - %1 value expected - valeur %1 attendue - - - maximum number value is %1 - la valeur maximale est %1 - - - minimum number value is %1 - la valeur minimale est %1 - - - maximum number value is exclusive - la valeur maximale est exclusive - - - minimum number value is exclusive - la valeur minimale est exclusive - - - string value does not match required pattern - la valeur de la chaîne de caractères ne correspond pas au format requis - - - minimum string value length is %1 - la longueur de la chaîne de caractères est d'au moins %1 - - - maximum string value length is %1 - la longueur de la chaîne de caractères est d'au plus %1 - - - %1 elements expected in array value - %1 éléments attendus dans la valeur du tableau - - - - QmlJsDebugClient::QDeclarativeOutputParser - - The port seems to be in use. - Error message shown after 'Could not connect ... debugger:" - Le port semble déjà utilisé. - - - The application is not set up for QML/JS debugging. - Error message shown after 'Could not connect ... debugger:" - L'application n'est pas configurée pour du débogage QML/JS. - - - - QtC::Utils - - Add - Ajouter + Create Diagram + Remove - Supprimer + Supprimer - Rename - Renommer + Align Objects + - Do you really want to delete the configuration <b>%1</b>? - Êtes-vous sûr de vouloir supprimer la configuration <b>%1</b> ? + Align Left + - New name for configuration <b>%1</b>: - Nouveau nom pour la configuration <b>%1</b> : + Center Vertically + - Rename... - Renommer... + Align Right + - File Type - Type du fichier + Align Top + - File Name - Nom du fichier + Center Horizontally + - Error getting 'stat' info about '%1': %2 - Erreur lors de la récupération de l'information 'stat' pour '%1' : %2 + Align Bottom + - Error listing contents of directory '%1': %2 - Erreur lors du listage du contenu du répertoire '%1' : %2 + Same Width + - Process killed by signal - Processus tué par un signal + Same Height + - Server sent invalid signal '%1' - Le serveur a envoyé un signal invalide '%1' + Same Size + - - - ZeroConf::Internal::ZConfLib - AvahiZConfLib could not load the native library '%1': %2 - AvahiZConfLib n'a pas pu charger la bibliothèque native '%1' : %2 + Layout Objects + - %1 cannot create a client. The daemon is probably not running. - %1 ne peut créer un client. Le démon n'est problement pas en cours d'exécution. + Equal Horizontal Distance + - cAvahiClient, server collision. - cAvahiClient, collision de serveurs. + Equal Vertical Distance + - cAvahiClient, an error occurred on the client side. - cAvahiClient, une erreur est survenue côté client. + Equal Horizontal Space + - cAvahiClient, still connecting, no server available. - cAvahiClient, en cours de connexion, aucun serveur disponible. + Equal Vertical Space + - Unexpected state %1 in cAvahiClientReply. - État inattendu %1 dans cAvahiClientReply. + Add Related Elements + - Unexpected state %1 in cAvahiBrowseReply. - État inattendu %1 dans cAvahiBrowseReply. + New Package + - %1 could not create a client (probably the daemon is not running) - %1 n'a pas pu créer un client (le démon n'est probablement pas en cours d'exécution) + New Class + - cAvahiClient, server collision - cAvahiClient, collision de serveur + New Component + - cAvahiClient, some kind of error happened on the client side - cAvahiClient, une erreur est apparue du coté du client + New Diagram + - cAvahiClient, still connecting, no server available - cAvahiClient, en cours de connexion, aucun serveur disponible + Unacceptable null object. + - Error: unexpected state %1 in cAvahiClientReply, ignoring it - Erreur : état inattendu %1 dans cAvahiClientReply, état ignoré + File not found. + - Error: unexpected state %1 in cAvahiBrowseReply, ignoring it - Erreur : état inattendu %1 dans cAvahiBrowseReply, état ignoré + Unable to create file. + - %1 failed starting embedded daemon at %2 - %1 a échoué lors du démarrage du démon embarqué dans %2 + Writing to file failed. + - %1 failed to kill other daemons with '%2'. - %1 a échoué pour tuer les autres démons avec "%2". + Reading from file failed. + - %1 detected a file at /tmp/mdnsd, daemon startup will probably fail. - %1 a détecté un fichier dans /tmp/mdnsd, le démarrage du démon échouera probablement. + Illegal XML file. + - %1: log of previous daemon run is: '%2'. - %1 : le journal de l'exécution précédente du démon est : "%2". + Unable to handle file version %1. + - %1: log of previous daemon run is: '%2'. - - %1 : le journal de l'exécution précédente du démon est : "%2". + Change Object + - %1 failed starting embedded daemon at %2. - %1 a échoué lors du démarrage du démon embarqué dans %2. + Change Relation + - - - ZeroConf - DnsSdZConfLib could not load native library - DnsSdZConfLib n'a pas pu charger la bibliothèque native + Move Object + - MainConnection giving up on non Ok lib %1 (%2) - MainConnection renonce à la bibliothèque non valide %1 (%2) + Move Relation + - MainConnection has no valid library, aborting connection - MainConnection n'a pas de bibliothèque valide, la connexion est abandonnée + Delete Object + - MainConnection giving up on lib %1, switching to lib %2 - MainConnection renonce à la bibliothèque %1, passage à la bibliothèque %2 + Add Relation + - MainConnection giving up on lib %1, no fallback provided, aborting connection - MainConnection renonce à la bibliothèque %1, pas de solution de repli prévue, abandon de la connexion + Delete Relation + - MainConnection using lib %1 failed the initialization of mainRef with error %2 - MainConnection en utilisant la bibliothèque %1 a échoué à l'initialisation de mainRef avec l'erreur %2 + [unnamed] + - MainConnection using lib %1 failed because no daemon is running - MainConnection utilisant la bibliothèque %1 a échoué car aucun démon n'est en cours d'exécution + Stereotypes: + - MainConnection using lib %1 daemon starting seem successful, continuing - MainConnection utilisant la bibliothèque %1 et le démarrage du démon semble avoir réussi, le processus continue - - - MainConnection using lib %1 failed getProperty call with error %2 - MainConnection utilisant la bibliothèque %1 a échoué, l'appel à getProperty retourne l'erreur %2 - - - MainConnection::handleEvents called with m_status != Starting, aborting - MainConnection::handleEvents appelé avec m_status != Starting, abandon - - - MainConnection::handleEvents unexpected return status of handleEvent - MainConnection::handleEvents retourne un status inattendu - - - MainConnection for [%1] accumulated %2 consecutive errors, aborting - MainConnection pour [%1] a accumulé %2 erreurs consécutives, abandon - - - could not load native library - Impossible de charger la bibliothèque native - - - skipping over avahi compatibility lib (or obsolete mdnsd) - bibliothèque de compatibilité avahi passée (ou mdnsd obsolète) - - - *WARNING* detected an obsolete version of Apple Bonjour, either disable/uninstall it or upgrade it, otherwise zeroconf will fail - *AVERTISSEMENT* : une version obsolète de Apple Bonjour a été détectée, désactivez/désinstallez-la ou mettez-la à jour, sinon zeroconf échouera - - - Zeroconf could not load a valid library, failing. - Zeroconf n'a pas pu charger une bibliothèque valide, échec. - - - Zeroconf giving up on non working %1 (%2). - Zeroconf abandonne sur le dysfonctionnement %1 (%2). - - - Zeroconf has no valid library, aborting connection. - Zeroconf n'a pas de bibliothèque valide, connexion annulée. - - - Zeroconf giving up on %1, switching to %2. - Zeroconf a abandonné sur %1, transition vers %2. - - - Zeroconf giving up on %1, no fallback provided, aborting connection. - Zeroconf a abandonné sur %1, aucun retour fourni, connexion annulée. - - - Trying %1... - Essai de %1... - - - Zeroconf using %1 failed the initialization of the main library connection with error %2. - Zeroconf a échoué en utilisant %1 lors de l'initialisation de la bibliothèque de connexion principale avec l'erreur %2. - - - Zeroconf using %1 failed because no daemon is running. - Zeroconf a échoué en utilisant %1, car aucun démon n'est en cours d'exécution. - - - Starting the Zeroconf daemon using %1 seems successful, continuing. - Le démarrage du démon Zeroconf en utilisant %1 semble réussi, le processus continue. - - - Zeroconf using %1 failed getProperty call with error %2. - Zeroconf en utilisant %1 a échoué son appel à getProperty avec l'erreur %2. - - - Succeeded using %1. - Réussite en utilisant %1. - - - MainConnection could successfully create a connection using %1. - MainConnection a créé avec succès une connexion en utilisant %1. - - - Zeroconf, unexpected start status, aborting. - Zeroconf, statut inattendue au démarrage, abandon. - - - Zeroconf detected an unexpected return status of handleEvent. - Zeroconf a détecté un statut de retour inattendu par handleEvent. - - - Zeroconf for [%1] accumulated %n consecutive errors, aborting. - - Zeroconf for [%1] a accumulé %n erreur consécutive, abandon. - Zeroconf for [%1] a accumulé %n erreurs consécutives, abandon. - - - - Could not load native library. - Impossible de charger la bibliothèque native. - - - Skipping over Avahi compatibility lib (or obsolete mdnsd). - Bibliothèque de compatibilité Avahi passée (ou mdnsd obsolète). - - - Warning: Detected an obsolete version of Apple Bonjour. Disable, uninstall, or upgrade it, or zeroconf will fail. - Avertissement : version de Apple Bonjour obsolète détectée. Désactivez, désinstallez ou mettez la à jour sinon zeroconf échouera. - - - - Analyzer::Internal::AnalyzerToolDetailWidget - - <strong>%1</strong> settings - <strong>%1</strong> paramètres - - - - Analyzer::AnalyzerRunConfigurationAspect - - Analyzer Settings - Paramètres de l'analyseur - - - - QtC::Android - - Autogen - Display name for AutotoolsProjectManager::AutogenStep id. - Autogen - - - Autogen - Autogen - - - Configuration unchanged, skipping autogen step. - Configuration inchangée, étape autogen ignorée. - - - Arguments: - Arguments : - - - Autogen - AutotoolsProjectManager::AutogenStepConfigWidget display name. - Autogen - - - Autoreconf - Display name for AutotoolsProjectManager::AutoreconfStep id. - Autoreconf - - - Autoreconf - Autoreconf - - - Configuration unchanged, skipping autoreconf step. - Configuration inchangée, étape autoreconf ignorée. - - - Autoreconf - AutotoolsProjectManager::AutoreconfStepConfigWidget display name. - Autoreconf - - - Default - The name of the build configuration created by default for a autotools project. - Défaut - - - Build - Compilation - - - New Configuration - Nouvelle configuration - - - New configuration name: - Nom de la nouvelle configuration : - - - Build directory: - Répertoire de compilation : - - - Autotools Manager - Gestionnaire pour Autotools - - - Tool chain: - Chaîne de compilation : - - - <Invalid tool chain> - <Chaîne d'outils invalide> - - - Failed opening project '%1': Project file does not exist - Échec de l'ouverture du projet "%1' : le fichier du projet n"existe pas - - - Failed opening project '%1': Project already open - Échec de l'ouverture du projet "%1" : projet déjà ouvert - - - Failed opening project '%1': Project is not a file - Échec de l'ouverture du projet "%1" : le projet n'est pas un fichier - - - Autotools Wizard - Assistant Autotools - - - Please enter the directory in which you want to build your project. Qt Creator recommends to not use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. - Veuillez spécifier le répertoire où vous voulez compiler votre projet. Qt Creator recommande de ne pas utiliser le répertoire source pour la compilation. Cela garantit que le répertoire source reste propre et permet des compilations multiples avec différents paramètres. - - - Build Location - Emplacement de compilation - - - Desktop - Autotools Default target display name - Desktop - - - Configure - Display name for AutotoolsProjectManager::ConfigureStep id. - Configurer - - - Configure - Configurer - - - Configuration unchanged, skipping configure step. - ignorée ? - Configuration inchangée, étape de configuration sautée. - - - Configure - AutotoolsProjectManager::ConfigureStepConfigWidget display name. - Configurer - - - Parsing %1 in directory %2 - Analyse, car c'est une action en court - Analyse %1 dans le répertoire %2 - - - Parsing directory %1 - Analyse du répertoire %1 - - - Make - Display name for AutotoolsProjectManager::MakeStep id. - Make - - - Make - Make - - - Qt Creator needs a compiler set up to build. Configure a compiler in the kit options. - Qt Creator nécessite un compilateur de défini pour compiler. Configurez-en un dans les options des kits. - - - Configuration is faulty. Check the Issues view for details. - La configuration est défectueuse, veuillez vérifier la vue des problèmes pour les détails. - - - Make - AutotoolsProjectManager::MakeStepConfigWidget display name. - Make - - - <b>Unknown tool chain</b> - <b>Chaîne de compilation inconnue</b> - - - - QtC::BinEditor - - The Binary Editor cannot open empty files. - L'éditeur binaire ne peut ouvrir des fichiers vides. - - - Cannot open %1: %2 - Imposible d'ouvrir %1 : %2 - - - File Error - Erreur de fichier - - - - QtC::CMakeProjectManager - - Build CMake target - Compiler la cible CMake - - - - QtC::Core - - Could not save the files. - error message - Impossible d'enregistrer les fichiers. - - - Error while saving file: %1 - Erreur lors de l'enregistrement du fichier : %1 - - - Overwrite? - Écraser ? - - - An item named '%1' already exists at this location. Do you want to overwrite it? - Un élément nommé "%1' existe déjà. Voulez-vous l"écraser ? - - - Save File As - Enregistrer sous - - - Open File - Ouvrir le fichier - - - File Is Read Only - Le fichier est en lecture seule - - - Make &Writable - Rendre &inscriptible - - - &Save As... - Enregistrer &sous... - - - Cannot reload %1 - Impossible de recharger %1 - - - File was restored from auto-saved copy. Select Save to confirm or Revert to Saved to discard changes. - Le fichier a été restauré depuis une copie de sauvegarde automatique. Sélectionnez Sauver pour confirmer ou Retour à la sauvegarde pour effacer les changements. - - - - QtC::CppEditor - - Extract Function - Extraire la fonction - - - Extract Function Refactoring - contexte ? [Pierre] là je cale... - Refactorisation de la fonction extraite - - - Enter function name - Entrer un nom de fonction - - - Invalid function name - Nom de fonction invalide - - - C++ Classes - Classes C++ - - - - QtC::Debugger - - Reset - Réinitialiser - - - Type Formats - Formats des types - - - Qt Types - Types Qt - - - Standard Types - Types standards - - - Misc Types - Types divers - - - Debugger Settings - Paramètres du débogueur - - - Enable C++ - Activer le C++ - - - Enable QML - Activer le QML - - - Debug port: - Port du débogage : - - - <a href="qthelp://org.qt-project.qtcreator/doc/creator-debugging-qml.html">What are the prerequisites?</a> - <a href="qthelp://org.qt-project.qtcreator/doc/creator-debugging-qml.html">Quels sont les prérequis ?</a> - - - Enable Debugging of Subprocesses - Activer le débogage des sous-processus - - - Anonymous Function - Fonction anonyme - - - Log - Log - - - Show debug, log, and info messages. - Montrer les messages de débogage, des journaux et d'informations. - - - Show warning messages. - Montrer les messages d'avertissement. - - - Show error and fatal messages. - Montrer les messages des erreurs et des erreurs fatales. - - - Clear Console - Effacer la console - - - - QtC::Git - - untracked - non suivi - - - staged + - contexte ? pierre: concept de la staging area (ou index), pas évident à traduire... - ajouté à l'index + - - - modified - modifié - - - added - ajouté - - - deleted - supprimé - - - renamed - renommé - - - copied - copié - - - by both - provenant des deux - - - by us - provenant de nous - - - by them - provenant d'eux - - - updated - mis à jour - - - Show Diff - Montrer les différences - - - Show difference. - Montre les différences. - - - Graph - Graphe - - - Show textual graph log. - Afficher le log textuel du graphe. - - - - QtC::Core - - Previous command is still running ('%1'). -Do you want to kill it? - La commande précédante est toujours active ('%1'). -Voulez-vous la tuer ? - - - Kill Previous Process? - Tuer les processus précédents ? - - - Command '%1' finished. - La commande "%1" s'est terminée. - - - Command '%1' failed. - La commande "%1" a échouée. - - - Could not start process: %1 - Impossible de démarrer le processus : %1 - - - finished - fini - - - failed - échoué - - - Could not find executable for '%1' - Impossible de trouver un exécutable pour '%1' - - - Starting command '%1' - Démarrage de la commande '%1' - - - Execute Custom Commands - Exécuter une commande personnalisée - - - - QtC::ProjectExplorer - - Edit Environment - Editer l'environnement - - - %1 (%2) - %1 (%2) - - - Debugger settings - Paramètres du débogueur - - - WinCE - WinCE - - - SDK: - SDK : - - - WinCE Version: - Version de WinCE : - - - ABI: - ABI : - - - - QtC::QmlJSEditor - - Add a comment to suppress this message - Ajouter un commentaire pour supprimer ce message - - - Add a Comment to Suppress This Message - Ajouter un commentaire pour supprimer ce message - - - Wrap Component in Loader - wrap en "enveloppez" = bof ; Component et Loader en majuscule = correspond à des noms de modules ? (et ne pas traduire alors ?) - Envelopper le composant dans un chargeur - - - // TODO: Move position bindings from the component to the Loader. -// Check all uses of 'parent' inside the root element of the component. - // À faire : Déplacer les liaisons de position du composant dans le Loader. -// Vérifier toutes les utilisations de "parent" à l'intérieur de l'élément racine du composant. - - - // Rename all outer uses of the id '%1' to '%2.item'. - // Renommer tous les usages extérieurs de l'identifiant "%1" pour "%2.item". - - - // TODO: Move position bindings from the component to the Loader. -// Check all uses of 'parent' inside the root element of the component. - - // À faire : Déplacer les liaisons de position du composant dans le Loader. -// Vérifier toutes les utilisations de 'parent' à l'intérieur de l'élément racine du composant. - - - // Rename all outer uses of the id '%1' to '%2.item'. - - // Renommer tous les usages extérieurs de l'id '%1' pour '%2.item'. - - - // Rename all outer uses of the id '%1' to '%2.item.%1'. - - // Renommer tous les usages extérieurs de l'id '%1' pour '%2.item.%1'. - - - - - QtC::QmlProfiler - - Trace information from the v8 JavaScript engine. Available only in Qt5 based applications - Suivre les informations à partir du moteur JavaScript V8. Disponible uniquement dans les applications basées sur Qt5 - - - Trace information from the v8 JavaScript engine. Available only in Qt5 based applications. - Suivre les informations à partir du moteur JavaScript V8. Disponible uniquement dans les applications basées sur Qt 5. - - - Copy Row - Copier la ligne - - - Copy Table - Copier la table - - - Extended Event Statistics - Statistiques d'événements étendues - - - Limit Events Pane to Current Range - Limiter le panneau d'événements à la portée actuelle - - - Reset Events Pane - Réinitialiser le panneau d'événements - - - Location - Emplacement - - - Type - Type - - - Time in Percent - Temps en pourcentage - - - Total Time - Temps total - - - Self Time in Percent - Contexte de "self" ? - Temps interne en pourcentage - - - Self Time - Contexte de "self" ? - Temps interne - - - Mean Time - Temps moyen - - - Median Time - Temps médian - - - Longest Time - Plus long temps - - - Shortest Time - Plus court temps - - - Details - Détails - - - (Opt) - (opt) - - - Binding is evaluated by the optimized engine. - La liaison est évaluée par le moteur optimisé. - - - Binding not optimized (e.g. has side effects or assignments, -references to elements in other files, loops, etc.) - La liaison n'est pas optimisée (par exemple, elle possède des effets de bords ou des affectation, -des références à des éléments dans d'autres fichiers, des boucles, etc.) - - - Binding loop detected. - Boucle de liaison détectée. - - - Binding loop detected - Boucle de liaison détectée - - - (Opt) - (Opt) - - - µs - µs - - - ms - ms - - - s - s - - - Paint - Peindre - - - Create - Créer - - - Binding - Vérifier le contexte - Liaison - - - Signal - Signal - - - Part of binding loop - Partie de boucle de liaison - - - Part of binding loop. - Partie d'une boucle de liaison. - - - Callee - Appelé - - - Caller - Appelant - - - Callee Description - Description de l'appelé - - - Caller Description - Description de l'appelant - - - - QtC::QmakeProjectManager - - Configure Project - Configurer le projet - - - Cancel - Annuler - - - The project <b>%1</b> is not yet configured.<br/>Qt Creator cannot parse the project, because no kit has been set up. - Le projet <b>%1</b> n'est pas encore configuré. <br/>Qt Creator ne peut analyser le projet, car aucun kit n'a été défini. - - - The project <b>%1</b> is not yet configured.<br/>Qt Creator uses the kit <b>%2</b> to parse the project. - Le projet <b>%1</b> n'est pas encore configuré.<br/>Qt Creator utilise le kit <b>%2</b> pour analyser le projet. - - - The project <b>%1</b> is not yet configured.<br/>Qt Creator uses the <b>invalid</b> kit <b>%2</b> to parse the project. - Le projet <b>%1</b> n'est pas encore configuré.<br/>Qt Creator utilise le kit <b>invalide</b> <b>%2</b> pour analyser le projet. - - - <p>The project <b>%1</b> is not yet configured.</p><p>Qt Creator uses the Qt version: <b>%2</b> and the tool chain: <b>%3</b> to parse the project. You can edit these in the <b><a href="edit">options.</a></b></p> - <p>Le projet <b>%1</b> n'est pas encore configuré.</p><p>Qt Creator utilise la version de Qt : <b>%2</b> et la chaîne de compilation : <b>%3</b> pour analyser le projet. Vous pouvez modifier ces paramètres dans la <b><a href="edit">configuration</a></b></p> - - - <p>The project <b>%1</b> is not yet configured.</p><p>Qt Creator uses the Qt version: <b>%2</b> and <b>no tool chain</b> to parse the project. You can edit these in the <b><a href="edit">settings</a></b></p> - <p>Le projet <b>%1</b> n'est pas encore configuré.</p><p>Qt Creator utilise la version de Qt : <b>%2</b> et <b>n'a aucune chaîne de compilation</b> pour analyser le projet. Vous pouvez modifier ces paramètres dans la <b><a href="edit">configuration</a></b></p> - - - <p>The project <b>%1</b> is not yet configured.</p><p>Qt Creator uses <b>no Qt version</b> and the tool chain: <b>%2</b> to parse the project. You can edit these in the <b><a href="edit">settings</a></b></p> - <p>Le projet <b>%1</b> n'est pas encore configuré.</p><p>Qt Creator n'utilise <b>aucune version de Qt</b> et la chaîne de compilation : <b>%2</b> pour analyser le projet. Vous pouvez modifier ces paramètres dans la <b><a href="edit">configuration</a></b></p> - - - <p>The project <b>%1</b> is not yet configured.</p><p>Qt Creator uses <b>no Qt version</b> and <b>no tool chain</b> to parse the project. You can edit these in the <b><a href="edit">settings</a></b></p> - <p>Le projet <b>%1</b> n'est pas encore configuré.</p><p>Qt Creator n'utilise <b>aucune version de Qt</b> et <b>aucune chaîne de compilation</b> pour analyser le projet. Vous pouvez modifier ces paramètres dans la <b><a href="edit">configuration</a></b></p> - - - Qt Creator can open qmake projects without configuring them for building. -The C++ and QML code models need a Qt version and tool chain to offer code completion. - - Qt Creator peut ouvrir des projets qmake sans les configurer pour la compilation. -Les modèles de code C++ et QML ont besoin d'une version de Qt et d'une chaîne de compilation pour proposer la complétion de code. - - - Tool Chain: - Chaîne de compilation : - - - - QtC::QtSupport - - Copy Project to writable Location? - Copier le projet à un emplacement accessible en écriture ? - - - <p>The project you are about to open is located in the write-protected location:</p><blockquote>%1</blockquote><p>Please select a writable location below and click "Copy Project and Open" to open a modifiable copy of the project or click "Keep Project and Open" to open the project in location.</p><p><b>Note:</b> You will not be able to alter or compile your project in the current location.</p> - <p>Le projet que vous vous apprêtez à ouvrir se trouve dans un emplacement accessible en lecture seule :</p><blockquote>%1</blockquote><p>Veuillez sélectionner un emplacement accessible en écriture et cliquer sur "Copier le projet et l'ouvrir" pour ouvrir une copie modifiable. Cliquez sur "Conserver le projet et l'ouvrir" pour ouvrir le projet à l'emplacement courant.</p><p><b>Note :</b> vous ne pourrez pas modifier ou compiler votre projet à l'emplacement courant.</p> - - - &Location: - &Emplacement : - - - &Copy Project and Open - &Copier le projet et l'ouvrir - - - &Keep Project and Open - &Conserver le projet et l'ouvrir - - - Cannot Use Location - Impossible d'utiliser l'emplacement - - - The specified location already exists. Please specify a valid location. - L'emplacement spécifié existe déjà. Veuillez spécifier un autre emplacement. - - - Cannot Copy Project - Impossible de copier le projet - - - Failed to Open Project - Échec d'ouverture du projet - - - MeeGo/Harmattan - MeeGo/Harmattan - - - Symbian - Symbian - - - Maemo/Fremantle - Maemo/Fremantle - - - Desktop - Nom de la version de Qt ("Qt Desktop") - Desktop - - - Embedded Linux - Linux embarqué - - - Windows CE - Windows CE - - - Android - Android - - - iOS - iOS - - - - QtC::RemoteLinux - - Embedded Linux - Linux embarqué - - - Double-click to edit the project file - Double-cliquez pour modifier le fichier de projet - - - - QtC::TextEditor - - %1 found - %1 élément(s) trouvé(s) - - - Open Documents - Documents ouverts - - - Open documents: - Documents ouverts : - - - Open Documents: - Documents ouverts : - - - Open Documents -%1 - Documents ouverts -%1 - - - - QtC::Todo - - Description - Description - - - File - Fichier - - - Line - Ligne - - - - QtC::Todo - - To-Do Entries - Fonctionnalités qui recherche les entrées "TODO" dans le code, à voir comment ça s'affiche en partique dans Qt Creator. [Pierre] ça je suis partisant de laisser TODO tel quel, c'est du jargon informatique... - Entrées TODO - - - Current File - Fichier courant - - - Scan in the current opened file - Analyser le fichier courant ouvert - - - Whole Project - Tout le projet - - - Scan in the whole project - Analyser l'ensemble du projet - - - - QtC::Todo - - To-Do - Quoi que l'on pourrait laisser TODO ? [Pierre] yep, je valide TODO - TODO - - - - QtC::VcsBase - - Open URL in browser... - Ouvrir l'URL dans le navigateur... - - - Copy URL location - Copier l'adresse de l'URL - - - Open URL in Browser... - Ouvrir l'URL dans le navigateur... - - - Copy URL Location - Copier l'URL - - - Send email to... - Envoyer un email à... - - - Copy email address - Copiez l'adresse email - - - Send Email To... - Envoyer un email à... - - - Copy Email Address - Copier l'adresse email - - - - QSsh::SshKeyCreationDialog - - SSH Key Configuration - Configuration de la slé SSH - - - Options - Options - - - Key algorithm: - Algorithme de la clé : - - - &RSA - &RSA - - - &DSA - &DSA - - - Key &size: - &Taille de la clé : - - - Private key file: - Fichier de clé privée : - - - Browse... - Parcourir... - - - Public key file: - Fichier de clé publique : - - - &Generate And Save Key Pair - &Générer et sauvegarder la paire de clés - - - &Cancel - &Annuler - - - Key Generation Failed - La génération de la clé a échoué - - - Choose Private Key File Name - Choisir un nom pour le fichier de clé privée - - - Cannot Save Key File - Impossible d'enregistrer le fichier de la clé - - - Failed to create directory: '%1'. - Impossible de créer le dossier "%1". - - - Cannot Save Private Key File - Impossible de sauvegarder le fichier de la clé privée - - - The private key file could not be saved: %1 - La clé privée n'a pas pu être sauvegardée : %1 - - - Cannot Save Public Key File - Impossible de sauvegarder la clé publique - - - The public key file could not be saved: %1 - Le fichier de la clé publique n'a pas pu être sauvegardé : %1 - - - File Exists - Le fichier existe - - - There already is a file of that name. Do you want to overwrite it? - Il y a déjà un fichier de ce nom. Souhaitez-vous écrire par-dessus ? - - - - QtC::Android - - Create new AVD - Créer un nouvel AVD - - - Name: - Nom : - - - Kit: - Kit : - - - SD card size: - Taille de la carte SD : - - - Create a keystore and a certificate - Crée un classeur de clés et un certificat - - - Keystore - Trousseau de clés - - - Password: - Mot de passe : - - - Retype password: - Retaper le mot de passe : - - - Show password - Montrer le mot de passe - - - <span style=" color:#ff0000;">Password is too short</span> - <span style=" color:#ff0000;">Mot de passe trop court</span> - - - Certificate - Certificat - - - Alias name: - Nom d'alias : - - - Aaaaaaaa; - ?? - Aaaaaaaa; - - - Keysize: - Taille de la clé : - - - Validity (days): - Validité (en jours) : - - - Certificate Distinguished Names - Noms distingués de certificats - - - First and last name: - Prénom et nom : - - - Organizational unit (e.g. Necessitas): - Unité d'organisation (par exemple, Necessitas) : - - - Organization (e.g. KDE): - Organisation (comme KDE) : - - - City or locality: - Ville ou localité : - - - State or province: - État ou province : - - - Two-letter country code for this unit (e.g. RO): - Code de pays sur deux lettres pour cette unité (comme RO) : - - - >AA; - >AA; - - - Use Keystore password - Utilise le mot de passe du trousseau de clés - - - Form - Formulaire - - - Use Qt libraries from device - Utiliser les bibliothèques Qt à partir du périphérique - - - Push local Qt libraries to device. -You must have Qt libraries compiled for that platform - Envoyer les bibliothèques locales Qt au périphérique. -Vous devez posséder les bibliothèques Qt compilées pour cette plateforme - - - Deploy local Qt libraries - Déployer les bibliothèques Qt locales - - - Check this option to force the application to use local Qt libraries instead of system libraries. - Cocher cette option pour forcer l'application à utiliser les bibliothèques Qt locales à la place des bibliothèques du système. - - - Use local Qt libraries - Utiliser les bibliothèques Qt locales - - - Edit Rules File - Éditer le fichier de règles - - - Choose and install Ministro system wide Qt shared libraries. -This option is useful when you want to try your application on devices which don't have Android Market (e.g. Android Emulator). - Je ne suis pas sur - Choisir et installer Ministo et les bibliothèques Qt partagées, indépendamment du système. -Cette option est utile lorsque vous voulez essayer votre applications sur les périphériques qui ne disposent pas de l'Android Market (par exemple, l'émulateur Android). - - - Install Ministro, system-wide Qt shared libraries installer - Installer Ministro, un installateur des bibliothèques Qt partagées indépendant du système - - - Choose APK - Choisir l'APK - - - Use Ministro service to install Qt - Utiliser le service Ministro pour installer Qt - - - Push local Qt libraries to device. You must have Qt libraries compiled for that platform. -The APK will not be usable on any other device. - Pousser les bibliothèques locales Qt sur le périphérique. Vous devez avoir les bibliothèques Qt compilés pour cette plateforme. -Le fichier APL ne sera pas utilisable sur d'autres périphériques. - - - Deploy local Qt libraries to temporary directory - Déployer les bibliothèques Qt locales dans un répertoire temporaire - - - Creates a standalone APK. - Créer un standalone APK. - - - Bundle Qt libraries in APK - Empaqueter les bibliothèques Qt dans le fichier APK - - - Advanced Actions - Actions avancées - - - Clean Temporary Libraries Directory on Device - Nettoyer le répertoire temporaire des bibliothèques sur le périphérique - - - Install Ministro from APK - Installer Ministro à partir du fichier APK - - - Reset Default Devices - Restaurer les périphériques par défaut - - - Manifest - Fichier manifest - - - <b>Android target SDK:</b> - <b>SDK Android cible :</b> - - - <b>Package name:</b> - <b>Nom du paquet :</b> - - - <p align="justify">Please choose a valid package name for your application (e.g. "org.example.myapplication").</p> -<p align="justify">Packages are usually defined using a hierarchical naming pattern, with levels in the hierarchy separated by periods (.) (pronounced "dot").</p> -<p align="justify">In general, a package name begins with the top level domain name of the organization and then the organization's domain and then any subdomains listed in reverse order. The organization can then choose a specific name for their package. Package names should be all lowercase characters whenever possible.</p> -<p align="justify">Complete conventions for disambiguating package names and rules for naming packages when the Internet domain name cannot be directly used as a package name are described in section 7.7 of the Java Language Specification.</p> - <p align="justify">Veuillez choisir un nom de paquet valide pour votre application (par exemple : "org.exemple.monapplication").</p> -<p align="justify">Les paquets sont généralement définis en suivant un schéma de nommage hiérarchique, où les niveaux de la hiérarchie sont séparés par des points . (dits "dot").</p> -<p align="justify">En général, un nom de paquet commence avec le nom du domaine de haut niveau de l'organisation (TLD) et le nom du domaine de l'organisation, puis les sous-domaines listés dans le sens inverse. L'organisation peut choisir un nom spécifique pour son paquet. Les noms de paquets ne doivent utiliser que des minuscules, autant que possible.</p> -<p align="justify">Les conventions complètes pour la désambiguïsation des noms de paquets et des règles de nommages des paquets lorsque le nom de domaine Internet ne peut être utilisé directement comme nom de paquet sont décrits dans la section 7.7 de la spécification du langage Java.</p> - - - <b>Version code:</b> - <b>Version du code :</b> - - - <b>Version name:</b> - <b>Nom de version :</b> - - - 1.0.0 - 1.0.0 - - - Application - Application - - - <b>Application name:</b> - <b>Nom de l'application :</b> - - - <b>Run:</b> - <b>Exécution :</b> - - - <b>Application icon:</b> - <b>Icône de l'application :</b> - - - Save - Enregistrer - - - Discard - Abandonner - - - Libraries - Bibliothèques - - - Automatically check required Qt libraries from compiled application - Vérifie automatiquement les bibliothèques Qt requises à partir de l'application compilée - - - Read information from application (must be compiled) - Lire les information de l'application (elle doit être compilée) - - - Required Qt libraries - Bibliothèques Qt requises - - - <center>Prebundled libraries</center> -<p align="justify">Please be aware that the order is very important: If library <i>A</i> depends on library <i>B</i>, <i>B</i> <b>must</b> go before <i>A</i>.</p> - <center>Bibliothèques empaquetées</center> -<p align="justify">Soyez conscient que l'ordre est très important : si une bibliothèque <i>A</i> dépend de la bibliothèque <i>B</i>, <i>B</i> <b>doit</> être placée avant <i>A</i>.</p> - - - Up - Monter - - - Down - Descendre - - - Sign package - Signature du paquet - - - Keystore: - Trousseau de clés : - - - Create - Créer - - - Browse - Parcourir - - - Open package location after is complete - Ouvrir l'emplacement du paquet après sa complétion - - - Certificate alias: - Alias de certificat : - - - Android Configuration - Configuration Android - - - Android SDK location: - Emplacement du SDK Android : - - - Android NDK location: - Emplacement du NDK Android : - - - Android NDK tool chain version: - Version de la chaîne de compilation du NDK Android : - - - Ant location: - Emplacement d'Ant : - - - ARM GDB location: - Emplacement de GDB pour ARM : - - - ARM GDB server location: - Emplacement du serveur GDB pour ARM : - - - x86 GDB location: - Emplacement de GDB pour x86 : - - - x86 GDB server location: - Emplacement du serveur GDB pour x86 : - - - OpenJDK location: - Emplacement d'OpenJDK : - - - Start - Démarrer - - - AVD Manager - Gestionnaire d'AVD - - - System/data partition size: - Taille de la partition système/données : - - - Mb - Mo - - - Start Android AVD Manager - Démarrer le gestionnaire Android d'AVD - - - Add - Ajouter - - - Remove - Supprimer - - - Automatically create kits for Android tool chains - Créer automatiquement les kits pour les chaînes de compilation Android - - - JDK location: - Emplacement du JDK : - - - - QtC::ClearCase - - Check Out - Importer - - - &Checkout comment: - Commentaire d'&importation : - - - &Reserved - &Réservé - - - &Unreserved if already reserved - &Non réservé si déjà réservé - - - &Preserve file modification time - &Préserver la date de modification du fichier - - - Use &Hijacked file - Hijack: Unset read-only flag without check-out. This is used for local changes which the user does not want to commit. - ça sent le dikkenek un peu tout ça: http://www.lembrouille.com/dikkenek/dikkenek-je-viens-de-me-faire-carjacker - Utiliser fichier &Hijacké - - - Configuration - Configuration - - - &Command: - &Commande : - - - Diff - Diff - - - &Graphical (Single file only) - &Graphique (un seul fichier) - - - &External - &Externe - - - Arg&uments: - Arg&uments : - - - Miscellaneous - Divers - - - &History count: - Pluriel ? - Compteur d'&historique : - - - &Timeout: - Pluriel ? - &Expiration : - - - s - s - - - &Automatically check out files on edit - Importer &automatiquement les fichiers à l'édition - - - Check this if you have a trigger that renames the activity automatically. You will not be prompted for activity name - ceci > ce paramètre ? - Vérifier ceci si vous avez un déclencheur qui renomme l'activité automatiquement. Vous ne verrez pas de boîte de dialogue pour le nom de l'activité - - - Aut&o assign activity names - Assigner aut&omatiquement les noms d'activité - - - &Prompt on check-in - Afficher lors d'une ex&portation - - - Di&sable indexer - Dé&sactiver l'indexeur - - - &Index only VOBs: - VOB: Versioned Object Base - &Indexer seuleument les VOB : - - - VOBs list, separated by comma. Indexer will only traverse the specified VOBs. If left blank, all active VOBs will be indexed - Liste de VOB, séparés par une virgule. L'indexeur traversera uniquement les VOB spécifiés. Si laissé vide, tous les VOB actifs seront indexés - - - ClearCase - ClearCase - - - Dialog - Boîte de dialogue - - - The file was changed. - Le fichier a été modifié. - - - &Save copy of the file with a '.keep' extension - &Sauvergarder une copie du fichier avec une extension ".keep" - - - Confirm Version to Check Out - Confirmer la version à importer - - - There are multiple versions of '%1' which can be considered for checkout. Please select version to checkout: - Plusieurs versions de "%1" peuvent être considérés pour cette importation. Veuillez sélectionner la version à importer : - - - &Loaded Version - Version &chargée - - - Created by: - Crée par : - - - Created on: - Date - Crée le : - - - Version after &update - Version après &mise à jour - - - <html><head/><body><p><b>NOTE: You will not be able to check in this file without merging the changes (not supported by the plugin)</b></p></body></html> - <html><head/><body><p><b>NOTE : vous ne pouvez pas exporter ce fichier sans fusionner les changements (non supporté par le plug-in)</b></p></body></html> - - - - QtC::Core - - Remove File - Supprimer le fichier - - - File to remove: - Fichier à supprimer : - - - &Delete file permanently - &Supprimer le fichier de façon permanente - - - &Remove from Version Control - &Supprimer du système de gestion de version - - - - QtC::ProjectExplorer - - Device Configuration Wizard Selection - Sélection de l'assistant de configuration du périphérique - - - Available device types: - Types de périphérique disponibles : - - - Linux Device Configurations - Configurations des périphériques Linux - - - &Device: - &Périphérique : - - - &Name: - &Nom : - - - Auto-detected: - Autodétecté : - - - Current state: - État actuel : - - - Type Specific - Type spécifique - - - &Add... - &Ajouter... - - - &Remove - &Supprimer - - - Set As Default - Définir comme valeur par défaut - - - Yes (id is "%1") - Yes (l'identifiant est "%1") - - - No - Non - - - Test - Test - - - Show Running Processes - Afficher les processus en cours d'exécution - - - Remote Processes - Processus distants - - - - QtC::Qnx - - Packages to deploy: - Paquets à déployer : - - - - QtC::Qnx - - &Device name: - &Nom du périphérique : - - - Device &password: - &Mot de passe du périphérique : - - - Show password - Montrer le mot de passe - - - Private key file: - Fichier de clé privée : - - - Connection log: - Log de connexion : - - - Upload - Envoi - - - Failed to upload debug token: - Échec de l'envoi du jeton de débogage : - - - Debug token successfully uploaded. - Jeton de débogage envoyé avec succès. - - - No route to host. - Aucune route pour l'hôte. - - - Authentication failed. - Échec de l'authentification. - - - Development mode is disabled on the device. - Le mode développeur est désactivé sur ce périphérique. - - - Failed to start inferior process. - Échec du démarrage du processus inférieur. - - - Inferior processes timed out. - Le processus inférieur a expiré. - - - Inferior process has crashed. - Le processus inférieur a crashé. - - - Failed to communicate with the inferior process. - Échec lors de la communication avec le processus inférieur. - - - An unknwon error has happened. - Une erreur inconnue s'est produite. - - - Invalid debug token path. - Le chemin du jeton de débogage est invalide. - - - Failed to upload debug token: - Échec de l'envoi du jeton de débogage : - - - Operation in Progress - Opération en cours - - - Uploading debug token - Envoi du jeton de débogage - - - - QtC::Qnx - - The name to identify this configuration: - Le nom pour identifier cette configuration : - - - The device's host name or IP address: - Le nom d'hôte du périphérique ou son adresse IP : - - - Device password: - Mot de passe du périphérique : - - - Device type: - Type de périphérique : - - - Physical device - Périphérique physique - - - Debug token: - Jeton de débogage : - - - Connection Details - Détails de connexion - - - Request - Requête - - - Device host name or IP address: - Nom d'hôte du périphérique ou adresse IP : - - - Connection - Connexion - - - Specify device manually - Spécifier le périphérique manuellement - - - Auto-detecting devices - please wait... - Autodétection des périphériques - veuillez attendre... - - - No device has been auto-detected. - Aucun périphérique n'a été autodétecté. - - - Device auto-detection is available in BB NDK 10.2. Make sure that your device is in Development Mode. - L'autodétection des périphériques est disponible dans le NDK BlackBerry 10.2. Soyez sûr que votre périphérique est en mode développement. - - - - QtC::Qnx - - WizardPage - Page d'assistant - - - Public key file: - Fichier de clé publique : - - - SSH Key Setup - Configuration de la clé SSH - - - Please select an existing <b>4096</b>-bit key or click <b>Generate</b> to create a new one. - Veuillez sélectionner une clé existante de <b>4096</b> bits ou cliquer sur <b>Générer</b> pour en créer une nouvelle. - - - Key Generation Failed - La génération de la clé a échoué - - - Choose Private Key File Name - Choisir un nom pour le fichier de clés privées - - - Generate... - Générer... - - - - QtC::Qnx - - Device: - Appareil mobile : - - - Package: - Paquet : - - - - QtC::Qnx - - SDK: - SDK : - - - - RemoteLinuxCheckForFreeDiskSpaceStepWidget - - Form - Formulaire - - - Remote path to check for free space: - Chemin distant pour vérifier l'espace disponible : - - - Required disk space: - Espace disque nécessaire : - - - - QtC::Todo - - Keyword - Mot-clé - - - Icon - Icône - - - Color - Couleur - - - errorLabel - ... bah, je ne sais pas >> vraiment à traduire ? - errorLabel - - - Keyword cannot be empty, contain spaces, colons, slashes or asterisks. - Le mot-clé ne peut être vide, contenir des espaces, des virgules, des barres obliques ou des étoiles. - - - There is already a keyword with this name. - Il y a déjà un mot-clé avec ce nom. - - - - QtC::QmlDebug - - The port seems to be in use. - Error message shown after 'Could not connect ... debugger:" - Le port semble déjà utilisé. - - - The application is not set up for QML/JS debugging. - Error message shown after 'Could not connect ... debugger:" - L'application n'est pas configurée pour du débogage QML/JS. - - - - QSsh::Internal::SftpChannelPrivate - - Server could not start SFTP subsystem. - Le serveur ne peut pas démarrer le sous-système SFTP. - - - Unexpected packet of type %1. - Paquet inattendu de type %1. - - - Protocol version mismatch: Expected %1, got %2 - Conflit de versions de protocole : %1 attendue, %2 detectée - - - Unknown error. - Erreur inconnue. - - - Created remote directory '%1'. - Création du répertoire distant "%1". - - - Remote directory '%1' already exists. - Le répertoire distant "%1" existe déjà. - - - Error creating directory '%1': %2 - Erreur lors de la création du répertoire "%1" : %2 - - - Could not open local file '%1': %2 - Impossible d'ouvrir le fichier local "%1" : %2 - - - Remote directory could not be opened for reading. - Le répertoire distant ne peut pas être ouvert en lecture. - - - Failed to list remote directory contents. - Impossible de lister le contenu du répertoire distant. - - - Failed to close remote directory. - Impossible de fermer le répertoire distant. - - - Failed to open remote file for reading. - Impossible d'ouvrir le fichier distant en lecture. - - - Failed to retrieve information on the remote file ('stat' failed). - Impossible de récupérer les informations sur le fichier distant (échec de "stat"). - - - Failed to read remote file. - Impossible de lire le fichier distant. - - - Failed to close remote file. - Impossible de fermer le fichier distant. - - - Failed to open remote file for writing. - Impossible d'ouvrir le fichier distant en écriture. - - - Failed to write remote file. - Impossible d'écrire sur le fichier distant. - - - Cannot append to remote file: Server does not support the file size attribute. - Impossible d'ajouter à la fin du fichier distant : le serveur ne supporte pas l'attribut taille du fichier. - - - SFTP channel closed unexpectedly. - Fermeture inattendue de la liaison avec SFTP. - - - Server could not start session: %1 - Le serveur n'a pas pu démarrer la session : %1 - - - Error reading local file: %1 - Erreur lors de la lecture du fichier local : %1 - - - - QSsh::SftpFileSystemModel - - File Type - Type du fichier - - - File Name - Nom du fichier - - - Error getting 'stat' info about '%1': %2 - Erreur lors de la récupération de l'information "stat" pour "%1" : %2 - - - Error listing contents of directory '%1': %2 - Erreur lors du listage du contenu du répertoire "%1" : %2 - - - - QSsh::Internal::SshChannelManager - - Invalid channel id %1 - Identifiant %1 de la liaison invalide - - - - QSsh::Internal::SshConnectionPrivate - - SSH Protocol error: %1 - Erreur dans le protocole SSH : %1 - - - Botan library exception: %1 - Exception dans la bibliothèque Botan : %1 - - - Server identification string is %n characters long, but the maximum allowed length is 255. - - La chaîne de caractères d'identification du serveur a une taille de %n caractère, mais le maximum permis est 255. - La chaîne de caractères d'identification du serveur a une taille de %n caractères, mais le maximum permis est 255. - - - - Server identification string contains illegal NUL character. - La chaîne d'identification du serveur contient des caractères NUL illégaux. - - - Server Identification string '%1' is invalid. - La chaîne d'identification du serveur "%1" est invalide. - - - Server protocol version is '%1', but needs to be 2.0 or 1.99. - La version du protocole du serveur est "%1", mais doit être 2.0 ou 1.99. - - - Server identification string is invalid (missing carriage return). - La chaîne d'identification du serveur est invalide (retour charriot manquant). - - - Server reports protocol version 1.99, but sends data before the identification string, which is not allowed. - Le serveur rapporte une version de protocole 1.99, mais envoie des données avant la chaîne d'identification, ce qui n'est pas permis. - - - Unexpected packet of type %1. - Paquet inattendu de type %1. - - - Password expired. - Mot de passe expiré. - - - Server rejected password. - Le serveur a rejeté le mot de passe. - - - Server rejected key. - Le serveur a rejeté la clé. - - - The server sent an unexpected SSH packet of type SSH_MSG_UNIMPLEMENTED. - Le serveur a envoyé un paquet SSH inattendu de type SSH_MSG_UNIMPLETED. - - - Server closed connection: %1 - Le serveur a fermé la connexion : %1 - - - Connection closed unexpectedly. - La connexion a été fermée de façon inattendue. - - - Timeout waiting for reply from server. - Temps limite dépassé lors de l'attente de la réponse du serveur. - - - No private key file given. - Aucune clé privée n'est fournie. - - - Private key file error: %1 - Erreur du fichier de clé privée : %1 - - - - QSsh::Ssh - - Password Required - Mot de passe requis - - - Please enter the password for your private key. - Veuillez insérer votre mot de passe pour votre clé privée. - - - - QSsh::Internal::SshRemoteProcessPrivate - - Process killed by signal - Processus tué par un signal - - - Server sent invalid signal '%1' - Le serveur a envoyé un signal invalide "%1" - - - - QtC::Utils - - Adjust Column Widths to Contents - Ajuster la largeur des colonnes au contenu - - - '%1' is an invalid ELF object (%2) - "%1" est un objet ELF invalide (%2) - - - '%1' is not an ELF object (file too small) - "%1" n'est pas un objet ELF (fichier trop petit) - - - '%1' is not an ELF object - "%1" n'est pas un objet ELF - - - odd cpu architecture - architecture CPU étrange - - - odd endianess - boutisme étrange - - - odd endianness - boutisme étrange - - - unexpected e_shsize - e_shsize inattendue - - - unexpected e_shentsize - e_shentsize inattendue - - - announced %n sections, each %1 bytes, exceed file size - - %n section annoncée, chacun de %1 octets, dépassant la taille du fichier - %n sections annoncées, chacun de %1 octets, dépassant la taille du fichier - - - - string table seems to be at 0x%1 - La table des chaînes de caractères semble être située à 0x%1 - - - section name %1 of %2 behind end of file - Le nom de section %1 de %2 est après la fin du fichier - - - - ZeroConf::ServiceBrowser - - Starting Zeroconf Browsing - Démarage de la navigation Zeroconf - - - - QtC::Android - - Could not run: %1 - Impossible de démarrer : %1 - - - No devices found in output of: %1 - Aucun périphérique n'a été trouvé dans la sortie de : %1 - - - Error Creating AVD - Erreur lors de la création d'AVD - - - Cannot create a new AVD. No sufficiently recent Android SDK available. -Please install an SDK of at least API version %1. - Impossible de créer un nouveau AVD. Aucun SDK Android suffisament récent n'est disponible. -Veuillez installer un SDK supérieur à la version %1. - - - Android Debugger for %1 - Débogueur Android pour %1 - - - Android for %1 (GCC %2, Qt %3) - Android pour %1 (GCC %2, Qt %3) - - - <span style=" color:#ff0000;">Passwords don't match</span> - <span style=" color:#ff0000;">Les mots de passe ne correspondent pas</span> - - - <span style=" color:#00ff00;">Password is ok</span> - <span style=" color:#00ff00;">Mot de passe correct</span> - - - Keystore password is too short. - Le mot de passe du trousseau de clés est trop court. - - - Keystore passwords do not match. - Les mots de passe du trousseau de clés ne correspondent pas. - - - Certificate password is too short. - Le mot de passe du certificat est manquant. - - - Certificate passwords do not match. - Les mots de passe du certificat ne correspondent pas. - - - Certificate alias is missing. - L'alias du certificat est manquant. - - - Invalid country code. - Le code de pays est invalide. - - - Keystore file name - Nom du fichier de trousseau de clés - - - Keystore files (*.keystore *.jks) - Fichier de trousseau de clés (*.keystore *.jks) - - - Error - Erreur - - - Deploy on Android - Déployer sur Android - - - Deploy to Android device - AndroidDeployStep default display name - Déployer sur périphérique Android - - - Please wait, searching for a suitable device for target:%1. - Veuillez patienter, recherche d'un périphérique approprié pour la cible : %1. - - - Cannot deploy: no devices or emulators found for your package. - Impossible de déployer : aucun périphérique ou émulateur trouvé pour votre paquet. - - - No Android toolchain selected. - Aucune chaîne de compilation Android sélectionnée. - - - Could not run adb. No device found. - Impossible d'exécuter adb. Aucun périphérique trouvé. - - - adb finished with exit code %1. - adb s'est terminé en retournant %1. - - - Packaging error: Could not start command '%1 %2'. Reason: %3 - ? - Erreur de paquetage : impossible de lancer la commande "%1 %2". Raison : %3 - - - Packaging Error: Command '%1 %2' failed. - Erreur de paquetage : la commande "%1 %2" a échoué. - - - Reason: %1 - Raison : %1 - - - Reason: %1 - Raison : %1 - - - Exit code: %1 - Code de sortie : %1 - - - Clean old Qt libraries - Nettoyage des anciennes bibliothèques Qt - - - Deploy Qt libraries. This may take some time, please wait. - Déploiement des bibliothèques Qt. Cela peut prendre du temps, veuillez patienter. - - - Qt Android smart installer installation failed - L'installation du Qt Android smart installer a échoué - - - Installing package onto %1. - Installation du paquet sur %1. - - - Package installation failed. - L'onstallation du paquet a échoué. - - - Pulling files necessary for debugging. - Envoie des fichiers nécessaires au débogage. - - - <b>Deploy configurations</b> - <b>Configurations de déploiement</b> - - - Qt Android Smart Installer - Qt Android Smart Installer - - - Android package (*.apk) - Paquet Android (*.apk) - - - Run on Android - Exécuter sur Android - - - Android Device - Périphérique Android - - - Error creating Android directory '%1'. - Error lors de la création du répertoire Android "%1". - - - No Qt for Android SDKs were found. -Please install at least one SDK. - Aucun Qt for Android SDK n'a été trouvé. -Veuillez installer au moins un SDK. - - - Warning - Avertissement - - - Android files have been updated automatically. - Les fichiers Android ont été mis à jour automatiquement. - - - Error creating Android templates. - Erreur lors de la création des modèles Android. - - - Cannot parse '%1'. - Impossible d'analyser "%1". - - - Cannot open '%1'. - Impossible d'ouvrir "%1". - - - Starting Android virtual device failed. - Le démarrage du périphérique virtuel Android a échoué. - - - Android files have been updated automatically - Les fichiers Android ont été mis à jour automatiquement - - - Error creating Android templates - template ? - Erreur lors de la création des modèles Android - - - Can't parse '%1' - Impossible d'analyser "%1" - - - Can't open '%1' - Impossible d'ouvrir "%1" - - - Create Android (.apk) Package - Créer un paquet Android (.apk) - - - Packaging for Android - Paquetage pour Android - - - Cannot create Android package: current build configuration is not Qt 4. - Impossible de créer le paquet Android : la configuration de compilation actuelle n'est pas Qt 4. - - - Cannot create Android package: No ANDROID_TARGET_ARCH set in make spec. - Impossible de créer un paquet Android : ANDROID_TARGET_ARCH n'est pas défini dans make spec. - - - Warning: Signing a debug package. - Avertissement : authentification d'un paquet Debug. - - - Cannot find ELF information - Impossible de trouver les informations ELF - - - Cannot find '%1'. -Please make sure your application is built successfully and is selected in Application tab ('Run option'). - Impossible de trouver "%1". -Veuillez vous assurer que votre application est compilée et sélectionnée dans l'onglet Application ("Option d'exécution"). - - - Failed to run keytool - Échec d'exécution de keytool - - - Invalid password - Mot de passe invalide - - - Copy Qt app & libs to Android package ... - Copie des applications et bibliothèques Qt dans le paquet Android... - - - Can't copy gdbserver from '%1' to '%2' - Impossible de copier gbdserver de "%1" vers "%2" - - - Creating package file ... - Créer un fichier de paquet... - - - Signing package ... - Authentification du paquet... - - - Failed, try again - Échec, essayez à nouveau - - - Release signed package created to %1 - Paquet signé pour publication créé dans %1 - - - Package created. - Paquet créé. - - - Package deploy: Running command '%1 %2'. - Déploiement du paquet : exécution de la commande "%1 %2". - - - Packaging failed. - Échec lors de la création du paquet. - - - Keystore password: - Mot de passe du trousseau de clés : - - - Certificate password (%1): - Mot de passe du certificat (%1) : - - - Invalid Package Name - Nom de paquet invalide - - - The package name '%1' is not valid. -Please choose a valid package name for your application (e.g. "org.example.myapplication"). - Le nom du paquet "%1" n'est pas valide. -Veuillez choisir un nom de paquet valide pour votre application (par exemple "org.exemple.monapplication"). - - - < Type or choose a permission > - < Tapez ou sélectionnez une permission > - - - <b>Package configurations</b> - <b>Configurations de paquet</b> - - - Select keystore file - Sélectionner un fichier de trousseau de clés - - - Deploy to device - Déployer sur le périphérique - - - Copy application data - Copie des données de l'application - - - Removing directory %1 - Supprimer le répertoire %1 - - - Failed to detect the ABIs used by the Qt version. - Échec de la détection de l'ABI utilisée par la version de Qt. - - - Android - Qt Version is meant for Android - Android - - - The .pro file '%1' is currently being parsed. - Le fichier de projet "%1" est en cours d'analyse. - - - Run on Android device - Exécuter sur le périphérique Android - - - Starting remote process. - Démarrage des processus distants. - - - Run on Android device or emulator. - Exécuter sur un périphérique Android ou un émulateur. - - - No free ports available on host for QML debugging. - Aucun port libre n'est disponible sur l'hôte pour le débogage.QML. - - - - -'%1' died. - Mort ? >> peut-être trop cru, mais plus cohérent avec la suite. - - -"%1" est mort. - - - Failed to forward C++ debugging ports. Reason: %1. - Échec du transfert des ports de débogage C++. Raison : %1. - - - Failed to forward C++ debugging ports. - Échec du transfert des ports de débogage C++. - - - Failed to forward QML debugging ports. Reason: %1. - Échec du transfert des ports de débogage QML. Raison : %1. - - - Failed to forward QML debugging ports. - Échec du transfert des ports de débogage QML. - - - Failed to start the activity. Reason: %1. - Échec du démarage de l'activitée. Raison %1. - - - Unable to start '%1'. - Impossible de démarrer "%1". - - - - -'%1' terminated. - - -"%1" s'est terminé. - - - Cannot find %1 process. - Impossible de trouver le processus %1. - - - - -'%1' killed. - - -"%1" tué. - - - Android Configurations - Configurations Android - - - AVD Name - AVD - Android Virtual Device - Nom d'AVD - - - AVD Target - Cible d'AVD - - - CPU/ABI - CPU/ABI - - - Android SDK Folder - Dossier du SDK Android - - - "%1" does not seem to be an Android SDK top folder. - dossier parent ou racine ? - "%1" ne semble pas être la racine du SDK Android. - - - "%1" does not seem to be an Android NDK top folder. - "%1" ne semble pas être la racine du du NDK Android. - - - Found %n toolchains for this NDK. - - %n chaîne de compilation trouvée pour ce NDK. - %n chaînes de compilation trouvées pour ce NDK. - - - - Qt version for architecture %1 is missing. - To add the Qt version, select Options > Build & Run > Qt Versions. - La version de Qt est manquante pour l'architecture %1. - Pour ajouter la version de Qt, sélectionnez Options > Compiler & Exécuter > Versions de Qt. - - - Qt versions for architectures %1 are missing. - To add the Qt versions, select Options > Build & Run > Qt Versions. - Les versions de Qt sont manquantes pour l'architecture %1. - Pour ajouter les versions de Qt, sélectionnez Options > Compiler & Exécuter > Versions de Qt. - - - Select Android SDK folder - Sélectionner le dossier du SDK Android - - - Select Android NDK folder - Sélectionner le dossier du NDK Android - - - Select ant Script - Sélectionner le script Ant - - - Select GDB Executable - Sélectionner l'exécutable GDB - - - Select GDB Server Android Executable - Sélectionner l'exécutable du serveur GDB pour Android - - - Select OpenJDK Path - Sélectionner le chemin d'OpenJDK - - - Android GCC - GCC Android - - - Android GCC for %1 - GCC Android pour %1 - - - Android GCC (%1-%2) - GCC Android (%1 %2) - - - NDK Root: - Racine du NDK : - - - - QtC::Bookmarks - - Alt+Meta+M - Alt+Meta+M - - - Alt+M - Alt+M - - - - QtC::ClearCase - - Select &activity: - Sélectionner une &activité : - - - Add - Ajouter - - - Keep item activity - Garder l'élément de l'activité - - - &Check Out - &Importer - - - Check &Out - &Importer - - - &Hijack - &Hijack - - - Annotate version "%1" - Annoter la version "%1" - - - C&learCase - C&learCase - - - Check Out... - Exporter... - - - Check &Out "%1"... - Exp&orter "%1"... - - - Meta+L,Meta+O - Meta+L, Meta+O - - - Alt+L,Alt+O - Alt+L, Alt+O - - - Check &In... - &Importer... - - - Check &In "%1"... - &Importer "%1"... - - - Meta+L,Meta+I - Meta+L, Meta+I - - - Alt+L,Alt+I - Alt+L, Alt+I - - - Undo Check Out - Défaire l'exportation - - - &Undo Check Out "%1" - Défaire l'exportation "%1" (&U) - - - Meta+L,Meta+U - Meta+L, Meta+U - - - Alt+L,Alt+U - Alt+L, Alt+U - - - Undo Hijack - Annuler Hijack - - - Undo Hi&jack "%1" - Annuler Hi&jack "%1" - - - Meta+L,Meta+R - Meta+L, Meta+R - - - Alt+L,Alt+R - Alt+L, Alt+R - - - Diff Current File - Diff du fichier courant - - - &Diff "%1" - &Diff de "%1" - - - Meta+L,Meta+D - Meta+L, Meta+D - - - Alt+L,Alt+D - Alt+L, Alt+D - - - History Current File - Historique du fichier courant - - - &History "%1" - &Historique de "%1" - - - Meta+L,Meta+H - Meta+L, Meta+H - - - Alt+L,Alt+H - Alt+L, Alt+H - - - Annotate Current File - Annoter le fichier courant - - - &Annotate "%1" - &Annoter "%1" - - - Meta+L,Meta+A - Meta+L, Meta+A - - - Alt+L,Alt+A - Alt+L, Alt+A - - - Add File... - Ajouter un fichier... - - - Add File "%1" - Ajouter le fichier "%1" - - - Diff A&ctivity... - Différence d'a&ctivité... - - - Ch&eck In Activity - &Importer l'activité - - - Chec&k In Activity "%1"... - Import&er l'activité "%1"... - - - Update Index - Mettre à jour l'indfex - - - Update View - Mettre à jour la vue - - - U&pdate View "%1" - Mettre à jour la vue "%1" (&P) - - - Check In All &Files... - Importer tous les &fichiers... - - - Meta+L,Meta+F - Meta+L, Meta+F - - - Alt+L,Alt+F - Alt+L, Alt+F - - - View &Status - Voir le &statut - - - Meta+L,Meta+S - Meta+L, Meta+S - - - Alt+L,Alt+S - Alt+L, Alt+S - - - Check In - Importer - - - Diff Selected Files - Faire un diff sur tous les fichiers sélectionnés - - - &Undo - &Annuler - - - &Redo - &Refaire - - - Closing ClearCase Editor - Fermeture de l'éditeur ClearCase - - - Do you want to check in the files? - Voulez-vous importer les fichiers ? - - - The comment check failed. Do you want to check in the files? - La vérification des commentaires a échoué. Voulez-vous importer les fichiers ? - - - Do you want to undo the check out of '%1'? - Voulez-vous défaire l'export de "%1" ? - - - Undo Hijack File - ils ont vraiment des concepts bizarres dans Clearcase, mais en general je trouve ce jargon specifique à un outil particulier assez intraduisible... -Oui :) - Annuler hijack du fichier - - - Do you want to undo hijack of '%1'? - Voulez vous annuler le hijack de "%1" ? - - - External diff is required to compare multiple files. - Un diff externe est nécessaire pour comparer plusieurs fichiers. - - - Enter Activity - Entrer l'activité - - - Activity Name - Nom d'activité - - - Check In Activity - Importer l'activité - - - Another check in is currently being executed. - Une autre vérification est actuellement en cours. - - - There are no modified files. - Aucun fichier n'a été modifié. - - - No ClearCase executable specified. - Aucun exécutable ClearCase spécifié. - - - ClearCase Checkout - Export ClearCase - - - File is already checked out. - Le fichier est déjà exporté. - - - Set current activity failed: %1 - La définition de l'activité actuelle a échoué : %1 - - - Enter &comment: - Entrer un &commentaire : - - - ClearCase Add File %1 - ClearCase Ajouter le fichier %1 - - - ClearCase Remove Element %1 - ClearCase Enlever l'élément %1 - - - This operation is irreversible. Are you sure? - Cette opération est irréversible. Voulez vous continuer ? - - - ClearCase Remove File %1 - ClearCase Enlever le fichier %1 - - - ClearCase Rename File %1 -> %2 - ClearCase Renommer le fichier de %1 vers %2 - - - Activity Headline - En-tête d'activité - - - Enter activity headline - Entrer l'en-tête d'activité - - - CC Indexing - CC Indexing - - - ClearCase Check In - Import ClearCase - - - Chec&k in even if identical to previous version - Importer même si identique à la version précédente (&K) - - - &Check In - Importer (&C) - - - ClearCase Command - Commande ClearCase - - - In order to use External diff, 'diff' command needs to be accessible. - Disponible ? - Pour utiliser un diff externe, la commande "diff" doit être accessible. - - - DiffUtils is available for free download <a href="http://gnuwin32.sourceforge.net/packages/diffutils.htm">here</a>. Please extract it to a directory in your PATH. - DiffUtils est disponible gratuitement <a href="http://gnuwin32.sourceforge.net/packages/diffutils.htm">ici</a>. Veuillez l'extraire dans un répertoire de votre PATH. - - - DiffUtils is available for free download <a href="http://gnuwin32.sourceforge.net/packages/diffutils.htm">here</a>. Please extract it to a directory in your PATH. - DiffUtils est disponible gratuitement <a href="http://gnuwin32.sourceforge.net/packages/diffutils.htm">sur le sit du projet GnuWin</a>. Veuillez l'extraire dans un répertoire de votre PATH. - - - - QtC::CMakeProjectManager - - cmake Executable: - Exécutable CMake : - - - Choose Cmake Executable - Choisir l'exécutable CMake - - - The cmake executable is valid. - L'exécutable CMake est valide. - - - Please specify the path to the cmake executable. No cmake executable was found in the path. - Veuillez spécifier l'emplacement de l'exécutable CMake. Aucun exécutable CMake n'a été trouvé dans le path. - - - The cmake executable (%1) does not exist. - L'exécutable CMake (%1) n'existe pas. - - - The path %1 is not a valid cmake. - %1 n'est pas une installation valide de CMake. - - - CMake Executable: - Exécutable CMake : - - - Choose CMake Executable - Choisir l'exécutable CMake - - - The CMake executable is valid. - L'exécutable CMake est valide. - - - Specify the path to the CMake executable. No CMake executable was found in the path. - Spécifier le chemin de l'exécutable CMake. Aucun exécutable CMake n'a été trouvé dans le chemin. - - - The CMake executable (%1) does not exist. - L'exécutable CMake (%1) n'existe pas. - - - The path %1 is not an executable. - Le chemin %1 n'est pas un exécutable. - - - The path %1 is not a valid CMake executable. - Le chemin %1 n'est pas un exécutable CMake valide. - - - The CMake executable (%1) does not exist. - L'exécutable CMake (%1) n'existe pas. - - - The path %1 is not an executable. - Le chemin %1 n'est pas un exécutable. - - - The path %1 is not a valid CMake executable. - Le chemin %1 n'est pas un exécutable CMake valide. - - - - QtC::Core - - Meta+O - Meta+O - - - Alt+O - Alt+O - - - Open with VCS (%1) - Ouvrir avec VCS (%1) - - - - QtC::CppEditor - - Target file was changed, could not apply changes - Le fichier cible a été modifié, impossible d'appliquer les changements - - - Apply changes to definition - Appliquer les changements aux définitions - - - Apply changes to declaration - Appliquer les changements aux déclarations - - - Apply Function Signature Changes - Pluriel ? - Appliquer les changements de signature de fonction - - - Only virtual methods can be marked `override' - Seules les méthodes virtuelles peuvent être marquée "override" - - - Only virtual methods can be marked `final' - Seules les méthodes virtuelles peuvent être marquées "final" - - - Only virtual methods can be marked 'override' - Seules les méthodes virtuelles peuvent être marqués "override" - - - Only virtual functions can be marked 'override' - Seules les fonctions virtuelles peuvent être marqués "override" - - - Only virtual methods can be marked 'final' - Seules les méthodes virtuelles peuvent être marqués "final" - - - Only virtual functions can be marked 'final' - Seules les fonctions virtuelles peuvent être marqués "final" - - - Expected a namespace-name - Un nom de d'espace de noms est attendu - - - Too many arguments - Trop d'arguments - - - - QtC::Debugger - - Delete Breakpoint - Supprimer le point d'arrêt - - - Delete All Breakpoints - Supprimer tous les points d'arrêt - - - Delete Breakpoints of "%1" - Supprimer les points d'arrêt de "%1" - - - Delete Breakpoints of File - Supprimer les points d'arrêt du fichier - - - Adjust Column Widths to Contents - Ajuster la largeur des colonnes au contenu - - - Edit Breakpoint... - Éditer le point d'arrêt... - - - Associate Breakpoint With All Threads - Associer le point d'arrêt à tous les threads - - - Associate Breakpoint With Thread %1 - Associer le point d'arrêt avec le thread %1 - - - Synchronize Breakpoints - Synchroniser les points d'arrêt - - - Disable Selected Breakpoints - Supprimer les points d'arrêt du fichier - - - Enable Selected Breakpoints - Activer les points d'arrêt sélectionnés - - - Disable Breakpoint - Désactiver le point d'arrêt - - - Enable Breakpoint - Activer le point d'arrêt - - - Add Breakpoint... - Ajouter un point d'arrêt... - - - Remove All Breakpoints - Retirer tous les points d'arrêt - - - Are you sure you want to remove all breakpoints from all files in the current session? - Êtes vous sur de vouloir retirer tous les points d'arrêt de tous les fichiers de la sesssion courante ? - - - Add Breakpoint - Ajouter un point d'arrêt - - - Select Executable - Sélectionner l'exécutable - - - Server port: - Port du serveur : - - - Override server address - Surcharge l'adresse du serveur - - - Select Working Directory - Sélectionner le répertoire de travail - - - Select Server Start Script - Sélectionner le script de démarrage du serveur - - - This option can be used to point to a script that will be used to start a debug server. If the field is empty, Qt Creator's default methods to set up debug servers will be used. - Cette option peut être utilisée pour indiquer un script qui sera utilisé pour démarrer le serveur de débogage. Si le champ est vide, la méthode par défaut de Qt Creator sera utilisée pour configuré les serveurs de débogage. - - - &Server start script: - &Script de démarrage du serveur : - - - Select Location of Debugging Information - Sélectionner l'emplacement des informations de débogage - - - Base path for external debug information and debug sources. If empty, $SYSROOT/usr/lib/debug will be chosen. - Chemin de base pour les informations de débogage externes et les sources de débogage. Si vide, $SYSROOT/usr/lib/debug sera choisi. - - - &Kit: - &Kit : - - - Local &executable: - &Exécutable local : - - - Command line &arguments: - &Arguments de la ligne de commande : - - - &Working directory: - &Répertoire de travail : - - - Run in &terminal: - Lancer en &terminal : - - - Break at "&main": - Arrêt à "&main" : - - - Debug &information: - &Information de débogage : - - - &Recent: - &Récent : - - - Manage... - Gérer... - - - The debugger to use for this kit. - Le débogueur à utiliser pour ce kit. - - - Auto-detect - Autodétection - - - Edit... - Modifier... - - - Debugger: - Débogueur : - - - Debugger for "%1" - Débogueur pour "%1" - - - &Engine: - &Moteur : - - - &Binary: - &Binaire : - - - <html><body><p>Specify the path to the <a href="%1">Windows Console Debugger executable</a> (%2) here.</p></body></html> - Label text for path configuration. %2 is "x-bit version". - <html><body><p>Spécifier le chemin à <a href="%1">l'exécutable du débogueur en console de Windows</a> (%2) ici.</p></body></html> - - - No debugger set up. - Aucun débogueur n'a été configuré. - - - Debugger '%1' not found. - Le débogueur "%1" est introuvable. - - - Debugger '%1' not executable. - Le débogueur "%1" n'est pas exécutable. - - - The debugger location must be given as an absolute path (%1). - L'emplacement du débogueur doit être un chemin absolu (%1). - - - No Debugger - Aucun débogueur - - - %1 Engine - Engin %1 - - - %1 <None> - Balise à traduire ? Yep (c'est ce qui est fait dans qtcreator_de.ts en tout cas) - %1 <None> - - - %1 using "%2" - %1 utilise "%2" - - - Debugger - Débogueur - - - GDB Engine - Moteur GDB - - - CDB Engine - Moteur CDB - - - LLDB Engine - Moteur LLDB - - - No kit found. - Pas de kit trouvé. - - - - QtC::ProjectExplorer - - &Attach to Process - &Attacher au processus - - - - QtC::Debugger - - Unable to create a debugger engine of the type '%1' - Impossible de créer un moteur de débogage du type "%1" - - - Install &Debug Information - Installation des informations de &débogage - - - Tries to install missing debug information. - Essayer d'installer les informations de débogage manquantes. - - - Attached to process %1. - Attaché au processus de PID %1. - - - Error Loading Core File - Core ? coeur ? Les anciennes chaînes utilisent core - Erreur lors du chargement du fichier core - - - The specified file does not appear to be a core file. - Le fichier spécifié ne semble pas être un fichier core. - - - Error Loading Symbols - Érreur de chargement des symboles - - - No executable to load symbols from specified core. - Pas d'exécutable pour charger les symboles du core spécifié. - - - Symbols found. - Symboles trouvés. - - - No symbols found in core file <i>%1</i>. - Pas de symbole trouvé dans le fichier core <i>%1</i>. - - - This can be caused by a path length limitation in the core file. - Cela peut être lié à une limitation de la taille du chemin dans le fichier core. - - - Try to specify the binary using the <i>Debug->Start Debugging->Attach to Core</i> dialog. - Essayez de spécifier le binaire avec la fenêtre <i>Débogage -> Démarrer le débogage -> Attacher au core</i>. - - - Attached to core. - Attaché au core. - - - Attach to core "%1" failed: - Échec de liaison au core "%1" : - - - Attach to core "%1" failed: - - Échec de liaison au core "%1" : - - - The upload process failed to start. Shell missing? - Le processus d'upload n'a pas pu démarrer. Shell manquant ? - - - The upload process crashed some time after starting successfully. - Le processus d'upload a crashé peu après avoir démarré avec succès. - - - An error occurred when attempting to write to the upload process. For example, the process may not be running, or it may have closed its input channel. - Une erreur est survenue lors d'une tentative d'écriture sur l'entrée du processus d'upload. Le processus peut ne pas être lancé ou il a fermé son entrée. - - - An error occurred when attempting to read from the upload process. For example, the process may not be running. - Une erreur est survenue lors d'une tentative de lecture du processus d'upload. Par exemple, le processus n'est peut-être pas en cours d'exécution. - - - An unknown error in the upload process occurred. This is the default return value of error(). - Une erreur inconnue est survenue dans le processus d'upload. Ceci est la valeur de retour par défaut de error(). - - - Error - Erreur - - - No symbol file given. - Pas de fichier de symboles donné. - - - Reading debug information failed: - La lecture des informations de débogage a échoué : - - - Reading debug information failed: - - La lecture des informations de débogage a échoué : - - - Interrupting not possible - Interruption impossible - - - Remote Error - Erreur distante - - - Could not retrieve list of free ports: - Impossible de récupérer la liste des ports disponibles : - - - Process aborted - Processus abandonné - - - Running command: %1 - Exécute la commande : %1 - - - Connection error: %1 - Erreur de connexion : %1 - - - Starting gdbserver... - Démarrage de gbdserver... - - - Port %1 is now accessible. - Le port %1 est maintenant accessible. - - - Server started on %1:%2 - Serveur démarré sur %1:%2 - - - Warning - Avertissement - - - Cannot find local executable for remote process "%1". - Impossible de trouver l'exécutable local pour le processus distant "%1". - - - Cannot find ABI for remote process "%1". - Impossible de trouver l'ABI pour le processus distant "%1". - - - Remote: "%1:%2" - Distant : "%1:%2" - - - Process gdbserver finished. Status: %1 - Processus gbdserver terminé. Statut : %1 - - - Download of remote file succeeded. - Téléchargement du fichier distant réussi. - - - Module Name - Nom du module - - - Module Path - Chemin du module - - - Symbols Read - Symboles lus - - - Symbols Type - Type des symboles - - - Start Address - Adresse de démarrage - - - End Address - Adresse de fin - - - Unknown - Inconnue - - - No - Non + Reverse engineered: + Yes Oui - None - Aucune + No + Non - Plain - Simple + Name: + - Fast - Rapide + Children: + - debuglnk - debuglnk + Relations: + - buildid - buildid + Model + - It is unknown whether this module contains debug information. -Use "Examine Symbols" from the context menu to initiate a check. - Qt Creator ne sait pas si le module contient des informations de débogage. -Utilisez "Examiner symboles" à partir du menu contextuel pour démarrer une vérification. - - - This module neither contains nor references debug information. -Stepping into the module or setting breakpoints by file and line will not work. - Ce module ne contient pas de références sur les informations de débogage. -Le pas à pas dans le module ou la définition de points d'arrêt par fichier et par ligne peut ne pas fonctionner. - - - This module contains debug information. -Stepping into the module or setting breakpoints by file and is expected to work. - Le module contient des informations de débogage. -Le pas à pas dans le module ou la définition de points d'arrêt par fichier devrait fonctionner. - - - This module does not contain debug information itself, but contains a reference to external debug information. - Le module ne contient pas d'information de débogage en lui même, mais contient des références vers des informations de débogage externes. - - - <unknown> - address - End address of loaded module - <inconnue> - - - Update Module List - Mettre à jour la liste des modules - - - Show Source Files for Module "%1" - Afficher les fichiers source du module "%1" - - - Load Symbols for All Modules - Charger les symboles pour tous les modules - - - Examine All Modules - Examiner tous les modules - - - Load Symbols for Module - Charcher les symboles pour le module - - - Edit File - Éditer le fichier - - - Show Symbols - Afficher les symboles - - - Show Sections - Afficher les sections - - - Show Dependencies - Montrer les dépendances - - - Load Symbols for Module "%1" - Charger les symboles pour le module "%1" - - - Edit File "%1" - Éditer le fichier "%1" - - - Show Symbols in File "%1" - Afficher les symboles dans le fichier "%1" - - - Show Sections in File "%1" - Afficher les sections dans le fichier "%1" - - - Show Dependencies of "%1" - Montrer les dépendances de "%1" - - - Connecting to debug server %1:%2 - Connexion au serveur de débogage %1:%2 - - - Error: (%1) %2 - %1=error code, %2=error message - Erreur : (%1) %2 - - - Disconnected. - Déconnecté. - - - Connected. - Connecté. - - - Disconnected. - - - Déconnecté. - - - - - Resolving host. - Résolution de l'hôte. - - - Connecting to debug server. - Connexion au serveur de débogage. - - - Connected. - - Connecté. - - - - Closing. - Fermeture. - - - Success: - Réussite : - - - Success: - Réussite : - - - Properties - Propriétés - - - The %1 attribute at line %2, column %3 cannot be changed without reloading the QML application. - L'attribut %1 à la ligne %2, colonne %3 ne peut pas être modifié sans redémarrer l'application QML. - - - The %1 element at line %2, column %3 cannot be changed without reloading the QML application. - L'élément %1 à la ligne %2, colonne %3 ne peut pas être modifié sans redémarrer l'application QML. - - - The changes in JavaScript cannot be applied without reloading the QML application. - Les modifications du code JavaScript ne peuvent pas être appliquées sans recharger l'application QML. - - - The changes made cannot be applied without reloading the QML application. - Ce changement ne peut pas être appliqué sans recharger l'application QML. - - - You can continue debugging, but behavior can be unexpected. - Le débogage peut continuer mais le comportement peut être inattendu. - - - Reload QML - Recharger le QML - - - Reload Register Listing - Recharger la liste des registres - - - Open Disassembler... - Ouvrir le désassembleur... - - - Open Memory Editor at 0x%1 - Ouvrir l'éditeur de mémoire à l'adresse 0x%1 - - - Open Memory View at Value of Register %1 0x%2 - Ouvrir la vue mémoire à la valeur du registre %1 0x%2 - - - Open Disassembler at 0x%1 - Ouvrir le désassembleur à l'adresse 0x%1 - - - Open Memory Editor - Ouvrir l'éditeur de mémoire - - - Open Memory View at Value of Register - Ouvrir la vue mémoire à la valeur du registre - - - Open Disassembler - Ouvrir le désassembleur - - - Hexadecimal - Hexadécimal - - - Decimal - Décimal - - - Octal - Octal - - - Binary - Binaire - - - Snapshots - Snapshots - - - Create Snapshot - Créer un snapshot - - - Remove Snapshot - Supprimer un snapshot - - - Reload Data - Recharger les données - - - Open File - Ouvrir le fichier - - - Open File "%1"' - Ouvrir le fichier "%1" - - - Function: - Fonction : - - - Disassemble Function - Désassembler la fonction - - - Copy Contents to Clipboard - Copier le contenu dans le presse-papier - - - Open Disassembler at Address... - Ouvrir le désassembleur à l'adresse... - - - Disassemble Function... - Désassembler la fonction... - - - Try to Load Unknown Symbols - Essayer de charger les symboles inconnus - - - Memory at Frame #%1 (%2) 0x%3 - Mémoire à la frame #%1 (%2) 0x%3 - - - Frame #%1 (%2) - Frame #%1 (%2) - - - <i>%1</i> %2 at #%3 - HTML tooltip of a variable in the memory editor - <i>%1</i> %2 à #%3 - - - <i>%1</i> %2 - HTML tooltip of a variable in the memory editor - <i>%1</i> %2 - - - Register <i>%1</i> - Registre <i>%1</i> - - - Memory at Pointer's Address "%1" (0x%2) - Mémoire à l'adresse du pointeur "%1" (0x%2) - - - Memory at Object's Address "%1" (0x%2) - Mémoire à l'adresse de l'objet "%1" (0x%2) - - - Cannot Display Stack Layout - Impossible d'afficher la disposition de la pile - - - Could not determine a suitable address range. - Impossible de déterminer une plage d'adresses convenable. - - - Memory Layout of Local Variables at 0x%1 - Disposition de la mémoire des variables locales à 0x%1 - - - Add Expression Evaluator - Ajouter un évaluateur d'expression - - - Add Expression Evaluator for "%1" - Ajouter un évaluateur d'expression pour "%1" - - - Remove Expression Evaluator - Retirer l'évaluateur d'expression - - - Remove Expression Evaluator for "%1" - Retirer l'évaluateur d'expression pour "%1" - - - Change Local Display Format... - Changer le format d'affichage local... - - - Treat All Characters as Printable - Traiter tous les caractères comme imprimables - - - Show Unprintable Characters as Escape Sequences - Montrer les caractères non imprimables comme des séquences d'échappement - - - Show Unprintable Characters as Octal - Montrer les caractères non imprimables comme octaux - - - Show Unprintable Characters as Hexadecimal - Montrer les caractères non imprimables comme hexadécimaux - - - Change Display for Object Named "%1": - Changer l'affichage de l'objet nommé "%1" : - - - Use Format for Type (Currently %1) - Utiliser le format pour le type (actuellement %1) - - - Use Display Format Based on Type - Utiliser le format d'affichage basé sur le type - - - Use Display Format Based on Type - Utiliser le format d'affichage basé sur le type - - - Change Display for Type "%1": - Changer l'affichage du type "%1" : - - - Automatic - Automatique - - - Change Display for Type or Item... - Changer l'affichage du type ou de l'item... - - - Add Data Breakpoint... - Ajouter un point d'arrêt sur les données... - - - Add Data Breakpoint at Object's Address (0x%1) - Ajouter un point d'arrêt sur les données à l'adresse de l'objet (0x%1) - - - Add Data Breakpoint at Pointer's Address (0x%1) - Ajouter un point d'arrêt de donnée à l'adresse du pointeur (0x%1) - - - Open Memory Editor at Pointer's Address (0x%1) - Ouvrir l'éditeur mémoire à l'adresse du pointeur (0x%1) - - - Open Memory View at Pointer's Address (0x%1) - Ouvrir la vue mémoire à l'adresse du pointeur (0x%1) - - - Open Memory Editor at Pointer's Address - Ouvrir l'éditeur mémoire à l'adresse du pointeur - - - Open Memory View at Pointer's Address - Ouvrir la vue mémoire à l'adresse du pointeur - - - Add Data Breakpoint at Referenced Address (0x%1) - Ajouter un point d'arrêt sur les données à l'adresse référencée (0x%1) - - - Add Data Breakpoint - Ajouter un point d'arrêt sur les données - - - Setting a data breakpoint on an address will cause the program to stop when the data at the address is modified. - Définir un point d'arrêt sur les données à une adresse fera que le programme s'arrêtera quand les données à cette adresse seront modifiées. - - - Add Data Breakpoint at Expression - Ajouter un point d'arrêt de donnée sur l'expression - - - Add Data Breakpoint at Expression "%1" - Ajouter un point d'arrêt sur les données à l'expression "%1" - - - Setting a data breakpoint on an expression will cause the program to stop when the data at the address given by the expression is modified. - Définir un point d'arrêt sur les données à une adresse fera que le programme s'arrêtera quand les données à cette adresse fournies par l'expression seront modifiées. - - - Insert New Expression Evaluator - Insérer un nouvel évaluateur d'expression - - - Select Widget to Add into Expression Evaluator - Sélectionner le widget à ajouter dans l'évaluateur d'expression - - - Remove All Expression Evaluators - Retirer tous les évaluateurs d'expression - - - Open Memory Editor... - Ouvrir l'éditeur de mémoire... - - - Open Memory Editor at Object's Address (0x%1) - Ouvrir l'éditeur de mémoire à l'adresse de l'objet (0x%1) - - - Open Memory View at Object's Address (0x%1) - Ouvrir la vue mémoire à l'adresse de l'objet (0x%1) - - - Open Memory Editor at Object's Address - Ouvrir l'éditeur mémoire à l'adresse de l'objet - - - Open Memory View at Object's Address - Ouvrir la vue mémoire à l'adresse de l'objet - - - Open Memory Editor at Referenced Address (0x%1) - Ouvrir l'éditeur de mémoire à l'adresse référencée (0x%1) - - - Open Memory Editor at Referenced Address - Ouvrir l'éditeur mémoire à l'adresse référencée - - - Open Memory Editor Showing Stack Layout - Ouvrir l'éditeur mémoire montrant la pile - - - Copy Value to Clipboard - Copier la valeur dans le presse-papier - - - Show View Contents in Editor - Ouvrir le contenu de la vue dans l'éditeur - - - Close Editor Tooltips - Fermer l'éditeur d'infobulles - - - Enter Expression for Evaluator - Entrer une expression pour l'évaluateur - - - Locals & Expressions - Locales et expressions - - - - QtC::Git - - Apply in: - Appliquer dans : - - - Apply in: - Appliquer dans : - - - Gerrit %1@%2 - Gerrit %1@%2 - - - Changes - Modifications - - - &Query: - &Requête : - - - Change #, SHA-1, tr:id, owner:email or reviewer:email - Vraiment traduire les %1:%2 ? Ça semble être des champs du truc machin bidule en ligne. Pierre: pas partisan de traduire, l'interface de gerrit est uniquement en anglais AFAICT. - Changer #, SHA-1, tr:id,owner:email ou reviewer:email - - - Details - Détails - - - &Refresh - &Rafraîchir - - - &Show... - &Afficher... - - - Cherry &Pick... - Im&porter la sélection... - - - &Checkout... - &Importer... - - - Cherry &Pick - Im&porter la sélection - - - &Checkout - Importer (&C) - - - Fetching "%1"... - Récupération de "%1"... - - - Diff... - Diff... - - - Apply... - Appliquer... - - - <html><head/><body><table><tr><td>Subject</td><td>%1</td></tr><tr><td>Number</td><td><a href="%11">%2</a></td></tr><tr><td>Owner</td><td>%3 <a href="mailto:%4">%4</a></td></tr><tr><td>Project</td><td>%5 (%6)</td></tr><tr><td>Status</td><td>%7, %8</td></tr><tr><td>Patch set</td><td>%9</td></tr>%10<tr><td>URL</td><td><a href="%11">%11</a></td></tr></table></body></html> - <html><head/><body><table><tr><td>Sujet</td><td>%1</td></tr><tr><td>Numéro</td><td><a href="%11">%2</a></td></tr><tr><td>Propriétaire</td><td>%3 <a href="mailto:%4">%4</a></td></tr><tr><td>Projet</td><td>%5 (%6)</td></tr><tr><td>Statut</td><td>%7, %8</td></tr><tr><td>Ensemble de patchs</td><td>%9</td></tr>%10<tr><td>URL</td><td><a href="%11">%11</a></td></tr></table></body></html> - - - Subject - Sujet - - - Owner - Propriétaire - - - Updated - Mis à jour - - - Project - Projet - - - Approvals - Approbations - - - Parse error: '%1' -> %2 - Erreur d'analyse : "%1" -> %2 - - - Parse error: '%1' - Erreur d'analyse : "%1" - - - Parse error in line '%1' - Erreur d'analyse à la ligne "%1" - - - Gerrit - Gerrit - - - Error running %1: %2 - Erreur lors de l'exécution de %1 : %2 - - - %1 crashed. - %1 a crashé. - - - %1 returned %2. - %1 a retourné %2. - - - Timeout - Expiration - - - The gerrit process has not responded within %1s. -Most likely this is caused by problems with SSH authentication. -Would you like to terminate it? - Le processus gerrit n'a pas répondu en %1s. -Souvent, cela se produit à cause de problèmes d'authentification SSH. -Souhaitez-vous le terminer ? - - - Terminate - Terminer - - - Keep Running - Continuer l'exécution - - - HTTPS - HTTPS - - - Always prompt for repository folder - Toujours afficher le dossier du dépôt - - - &Host: - &Hôte : - - - &User: - &Utilisateur : - - - &ssh: - Espace avant le : (protocole ?) ? - &ssh : - - - &Repository: - &Dépôt : - - - Default repository where patches will be applied. - Dépôt par défaut où les patchs seront appliqués. - - - Pr&ompt: - In&vite : - - - If checked, user will always be -asked to confirm the repository path. - Si coché, l'utilisateur devra toujours confirmer le chemin du dépôt. - - - &Port: - &Port : - - - P&rotocol: - P&rotocole : - - - Determines the protocol used to form a URL in case -"canonicalWebUrl" is not configured in the file -"gerrit.config". - Détermine si le protocole utilisé pour former une URL -dans le cas où "canonicalWebUrl" n'est pas configuré -dans le fichier "gerrit.config". - - - Gerrit Fetch - Traduire fetch ? - Gerrit fetch - - - Error writing to temporary file. - Erreur lors de l'écriture dans le fichier temporaire. - - - Writing %1... - Écriture de %1... - - - Cherry-picking %1... - Sélectionner %1... - - - Gerrit... - Gerrit... - - - Push to Gerrit... - Pousser sur Gerrit... - - - Initialization Failed - Initialisation échouée - - - Failed to initialize dialog. Aborting. - Échec d'initialisation du dialogue. Abandon. - - - Error - Erreur - - - Invalid Gerrit configuration. Host, user and ssh binary are mandatory. - La configuration de Gerrit est invalide. L'hôte, l'utilisateur et le binaire ssh sont demandés. - - - Git is not available. - Git n'est pas disponible. - - - Remote Not Verified - Dépôt distant non vérifié - - - Change host %1 -and project %2 - -were not verified among remotes in %3. Select different folder? - L'hôte %1 et le projet %2 n'ont pas été vérifiés auprès des dépôt distant dans %3. Sélectionner un autre dossier ? - - - Enter Local Repository for '%1' (%2) - Entrer un dépôt local pour "%1" (%2) - - - Detached HEAD - HEAD détachée - - - Select Change - Sélectionner le changement - - - &Commit only - Seulement &soumettre - - - Commit and &Push - Soumettre et &envoyer - - - Commit and Push to &Gerrit - Soumettre et &envoyer à Gerrit - - - &Commit and Push - &Soumettre et envoyer - - - &Commit and Push to Gerrit - &Soumettre et envoyer à Gerrit - - - &Commit - &Soumettre - - - Undo Changes to %1 - Annuler les changements jusqu'à %1 - - - - QtC::Perforce - - &Edit (%1) - &Éditer (%1) - - - &Edit - &Édition - - - &Hijack - &Hijack - - - - QtC::ProjectExplorer - - Run locally - Exécuter localement - - - Local PC - Local PC - - - Desktop - Desktop - - - Cannot run: Device is not able to create processes. - Impossible d'exécuter : le périphérique n'est pas capable de créer le processus. - - - User requested stop. Shutting down... - L'utilisateur a demandé l'arrêt. Arrêt en cours... - - - Application failed to start: %1 - Impossible de démarrer l'application : %1 - - - Application finished with exit code %1. - L'application s'est terminée avec le code de sortie %1. - - - Application finished with exit code 0. - L'application s'est terminée avec le code de sortie 0. - - - Cannot run: No device. - Impossible d'exécuter : aucun périphérique. - - - Connecting to device... - Connexion au périphérique... - - - SSH connection failed: %1 - La connexion SSH a échoué : %1 - - - Application did not finish in time, aborting. - L'application n'a pas fini à temps, abandon. - - - Remote application crashed: %1 - L'application distante a planté : %1 - - - Remote application finished with exit code %1. - L'application distante s'est terminée avec le code %1. - - - Remote application finished with exit code 0. - L'application distante s'est terminée avec le code 0. - - - %1 (default for %2) - %1 (défaut pour %2) - - - Kit: - Kit : - - - List of Processes - Liste de processus - - - Filter - Filtre - - - &Update List - Mettre à jo&ur la liste - - - &Kill Process - &Tuer processus - - - &Filter: - &Filtre : - - - Remote Error - Erreur distante - - - Process ID - ID du processus - - - Command Line - Ligne de commande - - - Devices - Périphériques - - - Connection error: %1 - Erreur de connexion : %1 - - - Could not start remote process: %1 - Impossible de démarrer le processus distant : %1 - - - Remote process crashed: %1 - Le processus distant a crashé : %1 - - - Remote process failed; exit code was %1. - Le processus distant a échoué ; le code de sortie était %1. - - - -Remote error output was: %1 - La sortie du processus distant était : %1 - - - Device - Périphérique - - - Cannot terminate process %1: %2 - Impossible de terminer le processus %1 : %2 - - - Cannot open process %1: %2 - Impossible d'ouvrir le processus %1 : %2 - - - Connection failure: %1 - Échec de la connexion : %1 - - - Error: Process listing command failed to start: %1 - Erreur : le processus listant les commandes n'a pas pu démarrer : %1 - - - Error: Process listing command crashed: %1 - Erreur : le processus listant les commandes a crashé : %1 - - - Process listing command failed with exit code %1. - Le processus listant les commandes a échoué en retournant le code %1. - - - Error: Kill process failed: %1 - Erreur : le processus kill a échoué : %1 - - - Error: Kill process failed to start: %1 - Erreur : le processus kill n'a pas pu démarrer : %1 - - - Error: Kill process crashed: %1 - Erreur : le processus kill a crashé : %1 - - - Kill process failed with exit code %1. - Le processus kill a échoué en retournant le code %1. - - - -Remote stderr was: %1 - Le stderr distant était : %1 - - - Unnamed - Sans nom - - - Error: - Erreur : - - - Warning: - Avertissement : - - - Sys Root "%1" is not a directory. - La racine du système "%1" n'est pas un répertoire. - - - Sys Root - Racine du système - - - Compiler - Compilateur - - - None - Aucune - - - No compiler set in kit. - Aucune compilateur défini dans le kit. - - - Unknown device type - Type de périphérique inconnu - - - Device type - Type de périphérique - - - Device does not match device type. - Le périphérique ne correspond pas au type de périphérique. - - - No Device set. - Pas de périphérique défini. - - - No device set. - Pas de périphérique défini. - - - The root directory of the system image to use.<br>Leave empty when building for the desktop. - Le répertoire racine du système image à utiliser.<br>Laisser vide lors d'une compilation sur desktop. - - - Sysroot: - Traduit plus haut - Racine du système : - - - The compiler to use for building.<br>Make sure the compiler will produce binaries compatible with the target device, Qt version and other libraries used. - Le compilateur à utiliser pour la compilation.<br>Assurez-vous que le compilateur génère des binaires compatibles avec le périphérique cible, la version de Qt et les autres bibliothèques utilisées. - - - Compiler: - Compilateur : - - - <No compiler available> - <Aucun compilateur disponible> - - - The type of device to run applications on. - Le type de périphérique sur lequel les applications sont exécutées. - - - Device type: - Type de périphérique : - - - Manage - Gérer - - - The device to run the applications on. - Le périphérique sur lequel les applications sont exécutées. - - - Manage... - Gérer... - - - Device: - Appareil mobile : - - - Kit name and icon. - Nom du kit et icône. - - - Mark as Mutable - Marquer comme mutable - - - Select Icon - Sélectionner une icône - - - Images (*.png *.xpm *.jpg) - Images (*.png *.xpm *.jpg) - - - Auto-detected - Autodétecté - - - %1 (default) - %1 (par défaut) - - - Kits - Kits - - - Make Default - Rendre par défaut - - - Unknown error. - Erreur inconnue. - - - Default build - Compilation par défaut - - - - QtC::QmlJSTools - - The type will only be available in Qt Creator's QML editors when the type name is a string literal - Le type sera disponible dans l'éditeur QML de Qt Creator lorsque le nom du type est une chaîne de caractères - - - The module URI cannot be determined by static analysis. The type will be available -globally in the QML editor. You can add a "// @uri My.Module.Uri" annotation to let -Qt Creator know about a likely URI. - Le module URI ne peut être déterminé par analyse statique. Le type ne sera pas disponible -globalement dans l'éditeur QML. Vous pouvez ajouter une annotation "// @uri My.Module.Uri" -pour donner un indice à Qt Creator à propos d'une URI probable. - - - must be a string literal to be available in the QML editor - doit être une chaîne de caractères afin d'être disponible dans l'éditeur QML - - - - QtC::QmlProfiler - - Source code not available. - Code source non disponible. - - - <bytecode> - <bytecode> - - - Animation Timer Update - Mise à jour du minuteur d'animation - - - <Animation Update> - <Mise à jour de l'animation> - - - <program> - <programme> - - - Main Program - Programme principal - - - %1 animations at %2 FPS. - %1 animations à %2 IPS. - - - Unexpected complete signal in data model. - Signal complet inattendu dans le modèle de données. - - - No data to save. - Aucune donnée à enregistrer. - - - Could not open %1 for writing. - Impossible d'ouvrir %1 en écriture. - - - Could not open %1 for reading. - Impossible d'ouvrir %1 en lecture. - - - Error while parsing %1. - Erreur lors de l'analyse de %1. - - - Trying to set unknown state in events list. - Tentative de définition d'état inconnu dans la liste d'évènements. - - - %1 animations at %2 FPS - %1 animations à %2 FPS - - - Unexpected complete signal in data model - Signal complet inattendu dans le modèle de données - - - No data to save - Aucune donnée à enregistrer - - - Could not open %1 for writing - Impossible d'ouvrir %1 en écriture - - - Could not open %1 for reading - Impossible d'ouvrir le fichier %1 en lecture - - - Error while parsing %1 - Erreur lors de l'analyse de : %1 - - - Invalid version of QML Trace file. - Version invalide du fichier de traçage de QML. - - - Trying to set unknown state in events list - Tentative de définition d'état inconnu dans la liste d'évènements - - - Loading data - Chargement des données - - - Profiling application - Profilage de l'application - - - No QML events recorded - Pas d'événement QML enregistré - - - Application stopped before loading all data - L'application a stoppé avant le chargement de toutes les données - - - Jump to previous event - Sauter à l'événement précédent - - - Jump to next event - Sauter à l'événement suivant - - - Show zoom slider - Afficher le curseur de zoom - - - Select range - Sélectionner l'intervalle - - - View event information on mouseover - Afficher les informations sur l'événement lorsque du survol de la souris - - - Reset Zoom - Réinitialiser le zoom - - - Events - Événements - - - Timeline - Ligne du temps - - - JavaScript - JavaScript - - - - QtC::Qnx - - Starting: "%1" %2 - Débute : "%1" %2 - - - - QtC::Qnx - - Launching application failed - Le démarrage de l'application a échoué - - - Cannot show debug output. Error: %1 - Impossible d'afficher la fenêtre de débogage. Erreur : %1 - - - - QtC::Qnx - - Create BAR packages - Créer les paquets BAR - - - Create packages - Créer des paquets - - - Could not find packager command '%1' in the build environment - Impossible de trouver la commande "%1" du créateur de paquet dans l'environnement de compilation - - - Application descriptor file not specified, please check deployment settings - Fichier de description d'application non spécifié, veuillez vérifier les paramètres de déploiement - - - No package specified, please check deployment settings - Aucun paquet de spécifié, veuillez vérifier les paramètres de déploiement - - - Could not create build directory '%1' - Impossible de créer le répertoire de compilation "%1" - - - Missing passwords for signing packages - Mots de passe manquants pour signer les paquets - - - Error preparing application descriptor file - Erreur lors de la préparation du fichier de description de l'application - - - Could not open '%1' for reading - Impossible d'ouvrir "%1" en lecture - - - Could not create prepared application descriptor file in '%1' - Impossible de créer le fichier de description d'application préparé dans "%1" - - - - QtC::Qnx - - <b>Create packages</b> - <b>Créer les paquets</b> - - - Sign packages - Signer les paquets - - - CSK password: - Mot de passe CSK : - - - Keystore password: - Mot de passe du trousseau de clés : - - - Note: This will store the passwords in a world-readable file. - Note : les mots de passe sont stockés dans un fichier lisible par tout le monde. - - - Save passwords - Enregistrer les mots de passe - - - Show passwords - Afficher les mots de passe - - - Package in development mode - Paquet en mode développeur - - - - QtC::Qnx - - Create BAR Packages - Créer les paquets BAR - - - - QtC::Qnx - - Deploy to BlackBerry Device - Déployer sur un périphérique BlackBerry - - - Setup Application Descriptor File - Configurer le fichier de description de l'application - - - You need to set up a bar descriptor file to enable packaging. -Do you want Qt Creator to generate it for your project? - Vous devez configurer un fichier de description bar pour activer le paquetage. -Voulez-vous que Qt Creator le génère pour votre projet ? - - - Don't ask again for this project - Ne plus demander pour ce projet - - - Cannot Set up Application Descriptor File - Impossible de configurer le fichier de description de l'application - - - Reading the bar descriptor template failed. - La lecture du modèle de fichier de description bar a échoué. - - - Writing the bar descriptor file failed. - L'écriture du fichier de description bar a échoué. - - - - QtC::Qnx - - Enabled - Activé - - - Application descriptor file - Fichier de description d'application + Models + Package - Paquet - - - - QtC::Qnx - - Deploy packages - Déployer les paquets + Paquet - Could not find deploy command '%1' in the build environment - Impossible de trouver la commande de déploiement "%1" dans l'environnement de compilation + Packages + - No packages enabled for deployment - Aucun paquet d'activé pour le déploiement + Class + Classe - Package '%1' does not exist. Create the package first. - Le paquet "%1" n'existe pas. Créez d'abord le paquet. - - - - QtC::Qnx - - <b>Deploy packages</b> - <b>Déployer les paquets</b> - - - - QtC::Qnx - - Deploy Package - Déployer le paquet - - - - QtC::Qnx - - Connect to device - Connecter au périphérique + Classes + Classes - Disconnect from device - Déconnecter du périphérique - - - - QtC::Qnx - - New BlackBerry Device Configuration Setup - Configuration d'un nouveau périphérique BlackBerry + Namespace: + - Failure to Save Key File - Impossible de sauvegarder le fichier de clé + Template: + - Failed to create directory: '%1'. - Impossible de créer le dossier : "%1". + Clean Up + - Private key file already exists: '%1' - Le fichier de clé privée existe déjà : "%1" + Members: + - Public key file already exists: '%1' - Le fichier de clé publique existe déjà : "%1" - - - - QtC::Qnx - - Setup Finished - Fin de l'installation + Component + - The new device configuration will now be created. - La configuration du nouveau périphérique va être créée maintenant. + Components + - Summary - Résumé + Diagram + - The new device configuration will be created now. - La configuration du nouveau périphérique va être créée maintenant. - - - - QtC::Qnx - - BlackBerry %1 - Qt Version is meant for BlackBerry - BlackBerry %1 + Diagrams + - BlackBerry - BlackBerry + Elements: + - BlackBerry Native SDK: - SDK BlackBerry natif : - - - - QtC::Qnx - - %1 on BlackBerry device - %1 sur périphérique BlackBerry + Canvas Diagram + - Run on BlackBerry device - Exécuter sur le périphérique BlackBerry - - - - QtC::Qnx - - %1 on BlackBerry Device - %1 sur le périphérique BlackBerry - - - - QtC::Qnx - - No active deploy configuration - Aucune configuration de déploiement active + Canvas Diagrams + - Device not connected - Périphérique non connecté + Item + - Run on BlackBerry Device - Exécuter sur le périphérique BlackBerry - - - - QtC::Qnx - - No SDK path set - Chemin du SDK non spécifié - - - - QtC::Qnx - - Deploy to QNX Device - Déployer sur un périphérique QNX - - - - QtC::Qnx - - New QNX Device Configuration Setup - Configuration du nouveau périphérique QNX - - - - QtC::Qnx - - QNX Device - Périphérique QNX - - - - QtC::Qnx - - QNX %1 - Qt Version is meant for QNX - QNX %1 + Items + Éléments - QNX - QNX + Variety: + - QNX Software Development Platform: - ou alors on traduit tout ? - SDK QNX : - - - - QtC::Qnx - - Path to Qt libraries on device: - Chemin sur le périphérique vers les bibliothèques Qt : - - - - QtC::Qnx - - %1 on QNX Device - %1 sur périphérique QNX - - - - QtC::Qnx - - Run on remote QNX device - Exécuter sur un périphérique QNX distant + End A: %1 + - No analyzer tool selected. - Aucun outil d'analyse sélectionné. - - - - QtC::QmakeProjectManager - - The mkspec to use when building the project with qmake.<br>This setting is ignored when using other build systems. - Le mkspec à utiliser lors de la compilation du projet avec qmake.<br>Ce paramètre est ignoré lors de l'utilisation avec d'autres systèmes de compilation. + End B: %1 + - Qt mkspec: - Qt mkspec : + Dependencies + Dépendances - No Qt version set, so mkspec is ignored. - Aucune version de Qt définie, mkspec est donc ignoré. + Direction: + - Mkspec not found for Qt version. - Aucun mkspec trouvé pour cette version de Qt. + Inheritances + - mkspec - mkspec + Derived class: %1 + - Manage... - Gérer... + Base class: %1 + - <b>Error:</b> - Severity is Task::Error - <b>Erreur :</b> + Associations + - <b>Warning:</b> - Severity is Task::Warning - <b>Alerte :</b> + Role: + - Import Build from... - Importer la compilation depuis... - - - - QtC::QtSupport - - Command: - Commande : + Cardinality: + - Executable: - Exécutable : + Navigable + - Arguments: - Arguments : + Aggregation + Agrégation - Working directory: - Répertoire de travail : + Composition + - Run in &terminal - Exécuter dans le &terminal - - - - CustomExecutableDialog - - Could not find the executable, please specify one. - Exécutable introuvable, veuillez en spécifier un. - - - - QtC::QtSupport - - No executable. - Pas d'exécutable. + Relationship: + - The executable -%1 -cannot be found in the path. - L'exécutable -%1 -n'a pas pu être trouvé dans le dossier. + Connection + Connexion - Custom Executable - Exécutable personnalisé + Connections + - Run %1 - Exécuter %1 + Position and size: + - The Qt library to use for all projects using this kit.<br>A Qt version is required for qmake-based projects and optional when using other build systems. - La bibliothèque Qt à utiliser pour tous les projets utilisant ce kit.<br>Une version de Qt est nécesaire pour les projets basés sur qmake et est optionnelle pour les autres systèmes de compilation. + Auto sized + - Manage... - Gérer... + Color: + Couleur : - Qt version: - Version de Qt : + Normal + Normal - %1 (invalid) - %1 (invalide) + Lighter + - Qt version - Version de Qt + Darker + + + + Soften + + + + Outline + Contour + + + Flat + + + + Emphasized + + + + Smart + None Aucune - - - QtC::RemoteLinux - Remote process crashed. - Le processus distant a crashé. + Label + - Unexpected output from remote process: '%1'. - Sortie imprévue du processus distant : "%1". - - - The remote file system has only %n megabytes of free space, but %1 megabytes are required. - - Le système de fichier distant ne possède que %n mégaoctet d'espace libre alors que %1 mégaoctets sont nécessaires. - Le système de fichier distant ne possède que %n mégaoctets d'espace libre alors que %1 mégaoctets sont nécessaires. - - - - The remote file system has %n megabytes of free space, going ahead. - going ahead ? - - Le système de fichier distant possède %n mégaoctet d'espace libre, le processus continue. - Le système de fichier distant possède %n mégaoctets d'espace libre, le processus continue. - - - - Cannot check for free disk space: '%1' is not an absolute path. - Impossible de vérifier l'espace libre du disque : "%1" n'est pas un chemin absolu. - - - MB - Mo - - - Check for free disk space - Vérification de l'espace disque disponible - - - Debugging failed. - Le débogage a échoué. - - - - QtC::ResourceEditor - - Add Files - Ajouter des fichiers - - - Add Prefix - Ajouter un préfixe - - - Invalid file location - Emplacement de fichier invalide - - - Copy - Copier - - - Abort - Abandonner - - - Skip - Passer - - - The file %1 is not in a subdirectory of the resource file. You now have the option to copy this file to a valid location. - Le fichier %1 n'est pas dans un sous-dossier du fichier de ressource. Vous avez maintenant la possibilité de le copier vers un emplacement valide. - - - Choose Copy Location - Choisir l'emplacement de copie - - - Overwriting Failed - Échec de l'écrasement - - - Could not overwrite file %1. - L'écrasement du fichier %1 a échoué. - - - Copying Failed - Échec de la copie - - - Could not copy the file to %1. - La copie du fichier dans "%1" a échoué. - - - The file name is empty. - Le nom de fichier est vide. - - - XML error on line %1, col %2: %3 - Erreur XML à la ligne %1, colonne %2 : %3 - - - The <RCC> root element is missing. - L'élement racine <RCC> est manquant. - - - Cannot write file. Disk full? - Impossible d'écrire le fichier. Disque plein ? - - - Open File - Ouvrir le fichier - - - All files (*) - Tous les fichiers (*) - - - - QtC::TextEditor - - Display context-sensitive help or type information on mouseover. - Afficher l'aide contextuelle ou l'information du type lors d'un survol de souris. - - - Display context-sensitive help or type information on Shift+Mouseover. - Afficher l'aide contextuelle ou l'information du type lors d'un survol de souris + Maj. - - - - QtC::Core - - Files Without Write Permissions - Fichiers sans permisions d'écriture - - - The following files have no write permissions. Do you want to change the permissions? - Les fichiers suivants n'ont pas de permission d'écriture. Souhaitez-vous changer les permissions ? - - - Open with VCS - Ouvrir avec VCS - - - Save As - Sauvegarder sous - - - Path - Chemin - - - Select all, if possible: - Sélectionner tout, si possible : - - - Mixed - Mixte - - - Failed to %1 File - Échec pour %1 le fichier - - - %1 file %2 from version control system %3 failed. - - %1 fichier %2 à partir du système de contrôle des versions %3 a échoué. - - - No Version Control System Found - Aucun système de contrôle de version trouvé - - - Cannot open file %1 from version control system. -No version control system found. - - Impossible d'ouvrir le fichier %1 à partir du système de contrôle de version. -Aucun système de contrôle de version trouvé. - - - Cannot Set Permissions - Impossible de définir les permissions - - - Cannot set permissions for %1 to writable. - - Impossible de définir les permissions pour rendre %1 inscriptible. - - - Cannot Save File - Impossible de sauvegarder le fichier - - - Cannot save file %1 - - Impossible d'enregistrer le fichier %1 - - - %1 file %2 from version control system %3 failed. - %1 fichier %2 à partir du système de contrôle des versions %3 a échoué. - - - Cannot open file %1 from version control system. -No version control system found. - Impossible d'ouvrir le fichier %1 à partir du système de contrôle de version. -Aucun système de contrôle de version trouvé. - - - Cannot set permissions for %1 to writable. - Impossible de définir les permissions pour rendre %1 inscriptible. - - - Cannot save file %1 - Impossible d'enregistrer le fichier %1 - - - Canceled Changing Permissions - Changement des permissions annulé - - - Could Not Change Permissions on Some Files - Impossible de changer la permissions sur certains fichiers - - - -See details for a complete list of files. - -Voir les détails pour une liste complète des fichiers. - - - &Change Permission - &Changer la permission - - - The following files are not checked out yet. -Do you want to check them out now? - Les fichiers suivants ne sont pas encore importés. -Souhaitez-vous les importer maintenant ? - - - - QtC::Debugger - - Dialog - Boîte de dialogue - - - <html><head/><body><p>The debugger is not configured to use the public Microsoft Symbol Server.<br/>This is recommended for retrieval of the symbols of the operating system libraries.</p><p><span style=" font-style:italic;">Note:</span> It is recommended, that if you use the Microsoft Symbol Server, to also use a local symbol cache.<br/>A fast internet connection is required for this to work smoothly,<br/>and a delay might occur when connecting for the first time and caching the symbols.</p><p>What would you like to set up?</p></body></html> - <html><head/><body><p>Le débogueur n'est pas configuré pour utiliser le serveur de symboles Microsoft publique.<br/>Cela est recommandé pour la récupération des symboles des bibliothèques du système d'exploitation.</p><p><span style=" font-style:italic;">Note :</span> Il est recommandé, si vous utilisez le serveur de symboles Microsoft, d'utiliser en complément un cache de symboles en local.<br/>Une connexion rapide à Internet est requise pour que cela fonctionne sans ralentissements<br/>et un délai peut apparaître lors de la première connexion et lors de la mise en cache des symboles.</p><p>Que souhaitez-vous configurer ?</p></body></html> - - - Use Local Symbol Cache - Utiliser le cache de symboles local - - - Use Microsoft Symbol Server - Utiliser le serveur de symbole Microsoft - - - Do not ask again - Ne plus demander - - - - QtC::Git - - Local Changes Found. Choose Action: - Changements locaux trouvés. Choisissez une action : - - - RadioButton - Bouton radio - - - Discard Local Changes - Annuler les changements locaux - - - Checkout branch "%1" - Importer la branche "%1" - - - Move Local Changes to "%1" - Déplacer les changements locaux vers "%1" - - - Pop Stash of "%1" - Sortir la remise de "%1" - - - Create Branch Stash for "%1" - Créer une branche remise pour "%1" - - - Create Branch Stash for Current Branch - Créer une branche remise pour la branche courante - - - Push to Gerrit - Pousser sur Gerrit - - - <b>Local repository:</b> - <b>Dépôt local :</b> - - - Destination: - Destination : - - - R&emote: - D&istant : - - - &Branch: - &Branche : - - - &Topic: - &Sujet : - - - &Draft - &Brouillon - - - Number of commits - Nombre de commits - - - &Push up to commit: - &Pousser pour commit : - - - Pushes the selected commit and all dependent commits. - Pousser le commit sélectionné et tous les commits dépendants. - - - &Reviewers: - &Relecteurs : - - - Comma-separated list of reviewers. - -Partial names can be used if they are unambiguous. - Liste des vérifieurs (séparation par des virgules). - -Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües. - - - <b>Local repository:</b> %1 - <b>Dépôt local :</b> %1 - - - Number of commits between HEAD and %1: %2 - Nombre de commits entre HEAD et %1 : %2 - - - ... Include older branches ... - ... Inclusion des anciennes branches ... - - - - QtC::Mercurial - - User name: - Nom d'utilisateur : - - - Password: - Mot de passe : - - - - QtC::ProjectExplorer - - Machine type: - Type de machine : - - - Free ports: - Ports libres : - - - Physical Device - Périphérique physique - - - You will need at least one port for QML debugging. - Vous avez besoin d'au moins un port pour le débogage QML. - - - - QtC::QbsProjectManager - - Build variant: - Variante de compilation : - - - Debug - Debug - - - Release - Release - - - jobs - jobs - - - Enable QML debugging: - Activer le débogage QML : - - - Properties: - Propriétés : - - - Dry run - Exécution à froid - - - Keep going - Continuer - - - <b>Qbs:</b> %1 - <b>Qbs :</b> %1 - - - Might make your application vulnerable. Only use in a safe environment. - Peut rendre l'application vulnérable. À n'utiliser qu'en environnement protégé. - - - Parallel Jobs: - Tâches parallèles : - - - Flags: - Flags : - - - Equivalent command line: - Ligne de commande équivalente : - - - Clean all artifacts - Nettoyer tous les artéfacts - - - Install root: - Racine de l'installation : - - - Remove first - Retirer en premier - - - Qbs Install Prefix - Préfixe d'installation Qbs - - - - DebugViewWidget - - Debug - Debug - - - Model Log - Log du modèle + Decoration + - Clear - Nettoyer + Icon + Icône - Instance Notifications - Notifications d'instance + Stereotype display: + - Instance Errors - Erreurs d'instance + Depth: + - Enabled - Activé + Box + - - - ButtonSpecifics - Button - Bouton + Angle Brackets + - Text - Texte + Template display: + - The text shown on the button - Le texte affiché sur le bouton + Show members + - Checked - Coché + Plain shape + - The state of the button - L'état du bouton + Shape: + - Checkable - Cochable + Intermediate points: + - Determines whether the button is checkable or not. - Détermine si le bouton est cochable ou non. + none + - Enabled - Activé + Annotation + - Determines whether the button is enabled or not. - Détermine si le bouton est activé ou non. + Annotations + - Default button - Bouton par défaut + Auto width + - Sets the button as the default button in a dialog. - Définit le bouton comme bouton par défaut dans la boite de dialogue. + Title + Titre - Tool tip - Info-bulle + Subtitle + - The tool tip shown for the button. - L'info-bulle affichée pour le bouton. + Footnote + - Focus on press - Focus à l'appui + Boundary + - Icon source - Source de l'icône + Boundaries + - The URL of an icon resource. - L'URL de la ressource pour l'icône. + Swimlane + - - - CheckBoxSpecifics - Check Box - Case à cocher + Swimlanes + - Text - Texte + Invalid syntax. + - The text shown on the check box - Le texte affiché par la boîte à cocher + Multi-Selection + - The state of the check box - L'état de la boîte à cocher + Missing file name. + - Determines whether the check box gets focus if pressed. - Déterminer si la boîte à cocher reçoit le focus lors d'un appui. + Project is modified. + - The text label for the check box - Le texte accompagnant la boite à cocher + Create Dependency + - Checked - Coché + Create Inheritance + - Determines whether the check box is checkable or not. - Détermine si la boite à cocher est cochable ou non. + Create Association + - Focus on press - Focus à l'appui + Create Connection + - - - ComboBoxSpecifics - Combo Box - Liste déroulante + Drop Element + - Tool tip - Info-bulle + Add Related Element + - The tool tip shown for the combobox. - L'info-bulle affichée par la liste déroulante. + Add Element + - Focus on press - Focus à l'appui + Relocate Relation + @@ -44453,20 +54311,1150 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües.Texte - The text label for the radio button - Le texte accompagnant le bouton radio + Text label for the radio button. + Le texte accompagnant le bouton radio. + + + Determines whether the radio button is checked or not. + Détermine si le bouton radio est coché ou non. + + + Determines whether the radio button gets focus if pressed. + Détermine si le bouton radio obtient le focus lorsqu’on appuie dessus. Checked Coché - Determines whether the radio button is checkable or not. - Détermine si le bouton radio est cochable ou non. + Focus on press + Focus à l’appui + + + + RadioDelegateSpecifics + + Radio Delegate + + + + + RangeSliderSpecifics + + Range Slider + - Focus on press - Focus à l'appui + Value 1 + + + + The value of the first range slider handle. + + + + Live + + + + Whether the range slider provides live value updates. + + + + Value 2 + + + + The value of the second range slider handle. + + + + From + À partir de + + + The starting value of the range slider range. + + + + To + Jusqu'à + + + The ending value of the range slider range. + + + + Step size + + + + The step size of the range slider. + + + + Drag threshold + + + + The threshold (in logical pixels) at which a drag event will be initiated. + + + + Snap mode + Mode aimant + + + The snap mode of the range slider. + + + + Orientation + Orientation + + + The orientation of the range slider. + + + + + RectangleSpecifics + + Rectangle + Rectangle + + + Fill color + + + + Border color + + + + Border width + Largeur de la bordure + + + Radius + Rayon + + + + RenameFolderDialog + + Rename Folder + Renommer le dossier + + + Folder name cannot be empty. + Le nom du dossier ne peut pas être vide. + + + Could not rename folder. Make sure no folder with the same name exists. + Impossible de renommer le dossier. Assurez-vous qu’il n’existe pas de dossier portant le même nom. + + + If the folder has assets in use, renaming it might cause the project to not work correctly. + + + + Rename + Renommer + + + Cancel + Annuler + + + + RepeaterSpecifics + + Repeater + + + + Model + + + + The model providing data for the repeater. This can simply specify the number of delegate instances to create or it can be bound to an actual model. + + + + Delegate + + + + The delegate provides a template defining each object instantiated by the repeater. + + + + + ResetEdit3DColorsAction + + Reset Colors + Réinitialiser les couleurs + + + Reset the background color and the color of the grid lines of the 3D view to the default values. + Réinitialiser la couleur d’arrière-plan et la couleur des lignes de la grille de la vue 3D. + + + + ResetView + + Reset View + Réinitialiser la vue + + + + RotateToolAction + + Activate Rotate Tool + + + + + RoundButtonSpecifics + + Round Button + + + + Appearance + + + + Whether the button is flat and/or highlighted. + + + + Flat + + + + Highlight + + + + Radius + Rayon + + + Radius of the button. + + + + + RowLayoutSpecifics + + Row Layout + + + + Row spacing + + + + Layout direction + Direction du layout + + + + RowSpecifics + + Row + Ligne + + + Layout direction + Direction du layout + + + Spacing + Espacement + + + + ScaleToolAction + + Activate Scale Tool + + + + + ScrollViewSpecifics + + Scroll View + + + + Content size + Taille du contenu + + + W + width + The width of the object + + + + Content width used for calculating the total implicit width. + + + + H + height + The height of the object + T + + + Content height used for calculating the total implicit height. + + + + Font Inheritance + + + + + SearchBox + + Search + Rechercher + + + + Section + + Expand All + Tout développer + + + Collapse All + Tout réduire + + + + SelectBackgroundColorAction + + Select Background Color + Sélectionner la couleur d’arrière-plan + + + Select a color for the background of the 3D view. + Sélectionner la couleur d’arrière-plan de la vue 3D. + + + + SelectGridColorAction + + Select Grid Color + Sélectionner la couleur de la grille + + + Select a color for the grid lines of the 3D view. + Sélectionner une couleur pour les lignes de la grille de la vue 3D. + + + + SelectionModeToggleAction + + Toggle Group/Single Selection Mode + Activer/désactiver le mode de sélection par groupe/seul + + + + ShowCameraFrustumAction + + Always Show Camera Frustums + + + + Toggle between always showing the camera frustum visualization and only showing it when the camera is selected. + + + + + ShowGridAction + + Show Grid + Afficher la grille + + + Toggle the visibility of the helper grid. + Activer/désactiver la visibilité de la grille d’aide. + + + + ShowIconGizmoAction + + Show Icon Gizmos + + + + Toggle the visibility of icon gizmos, such as light and camera icons. + + + + + ShowParticleEmitterAction + + Always Show Particle Emitters And Attractors + + + + Toggle between always showing the particle emitter and attractor visualizations and only showing them when the emitter or attractor is selected. + + + + + ShowSelectionBoxAction + + Show Selection Boxes + Afficher les boites de sélection + + + Toggle the visibility of selection boxes. + Activer/désactiver la visibilité des boites de sélection. + + + + SliderSpecifics + + Slider + + + + Value + Valeur + + + The current value of the slider. + + + + Live + + + + Whether the slider provides live value updates. + + + + From + À partir de + + + The starting value of the slider range. + + + + To + Jusqu'à + + + The ending value of the slider range. + + + + Step size + + + + The step size of the slider. + + + + Drag threshold + + + + The threshold (in logical pixels) at which a drag event will be initiated. + + + + Snap mode + Mode aimant + + + The snap mode of the slider. + + + + Orientation + Orientation + + + The orientation of the slider. + + + + Current value of the Slider. The default value is 0.0. + + + + Maximum value + + + + Maximum value of the slider. The default value is 1.0. + + + + Minimum value + + + + Minimum value of the slider. The default value is 0.0. + + + + Layout orientation of the slider. + + + + Indicates the slider step size. + + + + Active focus on press + Activer le focus à l’appui + + + Indicates whether the slider should receive active focus when pressed. + + + + Tick marks enabled + + + + Indicates whether the slider should display tick marks at step intervals. + + + + Update value while dragging + + + + Determines whether the current value should be updated while the user is moving the slider handle, or only when the button has been released. + + + + + SpinBoxSpecifics + + Spin Box + + + + Value + Valeur + + + The current value of the spin box. + + + + From + À partir de + + + The starting value of the spin box range. + + + + To + Jusqu'à + + + The ending value of the spin box range. + + + + Step size + + + + The step size of the spin box. + + + + Editable + + + + Whether the spin box is editable. + + + + Wrap + + + + Whether the spin box values wrap. + + + + + SplitViewSpecifics + + Split View + Vue scindée + + + Orientation + Orientation + + + Orientation of the split view. + Orientation de la vue scindée. + + + + StackLayoutSpecifics + + Stack Layout + + + + Current index + Indice actuel + + + + StackViewSpecifics + + Font Inheritance + Héritage des polices + + + + StandardTextGroupBox + + + + + + + StandardTextSection + + Text + Texte + + + Text color + Couleur du texte + + + Wrap mode + Mode de découpage du texte + + + Elide + Élider + + + Max line count + Nombre maximal de lignes + + + Limits the number of lines that the text component will show. + Limite le nombre de lignes que le composant texte affichera. + + + Alignment H + Alignement H + + + Alignment V + Alignement V + + + Format + Format + + + Render type + Type de rendu + + + Overrides the default rendering type for this component. + Remplace le type de rendu par défaut pour ce composant. + + + Size mode + Mode taille + + + Specifies how the font size of the displayed text is determined. + Indique comment la taille de la police du texte affiché est déterminée. + + + Min size + Taille minimum + + + Minimum font pixel size of scaled text. + Taille minimale en pixels du texte mis à l’échelle. + + + Minimum font point size of scaled text. + Taille minimale du texte mis à l’échelle. + + + Line height + Hauteur de ligne + + + Line height for the text. + La hauteur de ligne pour le texte. + + + Line height mode + Mode hauteur de ligne + + + Determines how the line height is specified. + Détermine la manière dont la hauteur de la ligne est indiquée. + + + + StateMenu + + Clone + Cloner + + + Delete + Supprimer + + + Show Thumbnail + Afficher les vignettes + + + Show Changes + Afficher les changements + + + Extend + Étendre + + + Reset when Condition + + + + Edit Annotation + Modifier l’annotation + + + Add Annotation + Ajouter une annotation + + + Remove Annotation + Supprimer l’annotation + + + + StateSpecifics + + State + État + + + When + Quand + + + Sets when the state should be applied. + Définit le moment où l’état doit être appliqué. + + + Name + Nom + + + The name of the state. + Le nom de l’état. + + + Extend + + + + The state that this state extends. + + + + + StateThumbnail + + Default + Défaut + + + Set State as default + + + + State Name + + + + Base State + + + + No Property Changes Available + + + + Target + Cible + + + Explicit + + + + Restore values + + + + When Condition + + + + + StatesDelegate + + Set when Condition + + + + Reset when Condition + + + + Set as Default + Définir comme par défaut + + + Reset Default + + + + Edit Annotation + + + + Add Annotation + + + + Remove Annotation + + + + Default + Défaut + + + + StatesList + + Add a new state. + Ajouter un nouvel état. + + + + StudioWelcome::Internal::ProjectModel + + Created with Qt Design Studio version: %1 + Créé avec Qt Design Studio version : %1 + + + Resolution: %1x%2 + Résolution : %1x%2 + + + Created: %1 + Date de création : %1 + + + Last Edited: %1 + Dernière modification : %1 + + + + StudioWelcome::Internal::StudioSettingsPage + + Build + Compiler + + + Debug + Déboguer + + + Analyze + Analyser + + + Hide top-level menus with advanced functionality to simplify the UI. <b>Build</b> is generally not required in the context of Qt Design Studio. <b>Debug</b> and <b>Analyze</b> are only required for debugging and profiling. + Cacher les menus de premier niveau avec des fonctionnalités avancées pour simplifier l’interface utilisateur. <b>Compiler</b> n’est généralement pas nécessaire dans le contexte de Qt Design Studio. <b>Déboguer</b> et <b>analyser</b> ne sont nécessaires que pour le débogage et le profilage. + + + Hide Menu + Cacher le menu + + + Examples + Exemples + + + Examples path: + Chemin des exemples : + + + Reset Path + Réinitialiser le chemin + + + The menu visibility change will take effect after restart. + Le changement de la visibilité du menu prendra effet après le redémarrage. + + + + StudioWelcome::Internal::StudioWelcomeSettingsPage + + Qt Design Studio Configuration + Configuration de Qt Design Studio + + + + StudioWelcome::Internal::UsageStatisticPluginModel + + The change will take effect after restart. + La modification prendra effet après le redémarrage. + + + + StudioWelcome::Internal::WelcomeMode + + Welcome + Accueil + + + + StudioWelcome::PresetModel + + Recents + Récents + + + Custom + Personnalisé + + + + StudioWelcome::QdsNewDialog + + New Project + Nouveau projet + + + Failed to initialize data. + Échec de l’initialisation des données. + + + Choose Directory + Sélectionner un répertoire + + + Save Preset + + + + A preset with this name already exists. + + + + + Styles + + Style + Style + + + All + Tous + + + Light + Light + + + Dark + Dark + + + + SubComponentManager::parseDirectory + + Invalid meta info + Méta-information invalide + + + + SwipeViewSpecifics + + Swipe View + + + + Interactive + + + + Whether the view is interactive. + + + + Orientation + Orientation + + + Orientation of the view. + + + + Font Inheritance + + + + + SyncEdit3DColorAction + + Use Scene Environment Color + Utiliser la couleur de l’environnement de la scène + + + Sets the 3D view to use the Scene Environment color as background color. + Règle la vue 3D pour qu’elle utilise la couleur de l’environnement de la scène comme couleur d’arrière-plan. + + + + TabBarSpecifics + + Tab Bar + + + + Position + Position + + + Position of the tab bar. + + + + Content size + Taille du contenu + + + Content width and height used for calculating the total implicit size. + + + + W + width + The width of the object + + + + Content width used for calculating the total implicit width. + + + + H + height + The height of the object + T + + + Content height used for calculating the total implicit height. + + + + + TabViewSpecifics + + Tab View + + + + Current index + + + + Frame visible + + + + Determines the visibility of the tab frame around contents. + + + + Tabs visible + + + + Determines the visibility of the tab bar. + + + + Tab position + + + + Determines the position of the tabs. + + + + + TabViewToolAction + + Add Tab... + Ajouter un onglet… + + + Step into Tab + Entrer dans l’onglet + + + + TemplateMerge + + Merge With Template + Fusionner avec le modèle + + + &Browse... + &Parcourir… + + + Template: + Modèle : + + + Browse Template + Parcourir les modèles @@ -44475,10 +55463,6 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües.Text Texte - - The text of the text area - Le texte de la zone de texte - Read only Lecture seule @@ -44491,41 +55475,29 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües.Color Couleur - - The color of the text - La couleur du texte - Document margins Marges du document - - The margins of the text area - Les marges de la zone de texte - - - Frame - Cadre - - - Determines whether the text area has a frame. - Détermine si la zone de texte possède un cadre. - Text Area Zone de texte - - The text shown on the text area - Le texte affiché par la zone de texte - Frame width Largeur du cadre - The width of the frame - La largeur du cadre + Text shown on the text area. + Texte affiché par la zone de texte. + + + Margins of the text area. + Marges de la zone de texte. + + + Width of the frame. + Largeur du cadre. Contents frame @@ -44557,11 +55529,90 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües. Focus on press - Focus à l'appui + Focus à l’appui Determines whether the text area gets focus if pressed. - Déterminer si la zone de texte reçoit le focus lors d'un appui. + Déterminer si la zone de texte reçoit le focus lors d’un appui. + + + + TextEditor::Internal::Snippets + + + Snippets are text fragments that can be inserted into an editor via the usual completion mechanics using a trigger text. The translated text (trigger variant) is used to disambiguate between snippets with the same trigger. + + + + + TextExtrasSection + + Text Extras + + + + Wrap mode + Mode de découpage du texte + + + Elide + Élider + + + Format + Format + + + Render type + Type de rendu + + + Overrides the default rendering type for this component. + Remplace le type de rendu par défaut pour ce composant. + + + Render type quality + Qualité du type de rendu + + + Overrides the default rendering type quality for this component. + Remplace la qualité du type de rendu par défaut pour ce composant. + + + Line height mode + Mode hauteur de ligne + + + Determines how the line height is specified. + Détermine la manière dont la hauteur de la ligne est indiquée. + + + Size mode + Mode taille + + + Specifies how the font size of the displayed text is determined. + Indique comment la taille de la police du texte affiché est déterminée. + + + Min size + Taille minimum + + + Minimum font pixel size of scaled text. + Taille minimale en pixels du texte mis à l’échelle. + + + Minimum font point size of scaled text. + Taille minimale du texte mis à l’échelle. + + + Max line count + Nombre maximal de lignes + + + Limits the number of lines that the text component will show. + Limite le nombre de lignes que le composant texte affichera. @@ -44574,18 +55625,10 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües.Text Texte - - The text shown on the text field - Le texte affiché par le champ de texte - Placeholder text texte affiché en gris lorsqu'il n'y a pas encore de texte entré ou pas le focus - Texte temporaire d'information - - - The placeholder text - Le texte temporaire d'information + Texte temporaire d’information Read only @@ -44596,16 +55639,16 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües.Détermine si le champ de texte est en lecture seule. - Password mode - Mode mot de passe + Text shown on the text field. + Texte affiché par le champ de texte. - Determines whether the text field is in password mode. - Détermine si le champ de texte est en mode mot de passe. + Placeholder text. + Texte temporaire d’information. Input mask - Masque d'entrée + Masque d’entrée Restricts the valid text in the text field. @@ -44613,7 +55656,7 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües. Echo mode - Mode d'affichage + Mode d’affichage Specifies how the text is displayed in the text field. @@ -44621,18 +55664,595 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües. - QmlWarningDialog + TextInputSection - Warning - Avertissement + Text Input + Texte en entrée - This QML file contains features which are not supported by Qt Quick Designer - Ce fichier QML contient des fonctionnalités qui ne sont pas supportées par Qt Quick Designer + Selection color + Couleur de la sélection - Warn about unsupported features - Avertir à propos des fonctionnalités non supportées + Selected text color + Couleur du texte sélectionné + + + Selection mode + Mode de sélection + + + Input mask + Masque d’entrée + + + Echo mode + Mode d’affichage + + + Password character + Caractères du mot de passe + + + Tab stop distance + + + + Default distance between tab stops in device units. + + + + Text margin + Marge du texte + + + Margin around the text in the Text Edit in pixels. + Marge autour du texte dans le texte en entrée en pixels. + + + Maximum length + Longueur maximum + + + Maximum permitted length of the text in the Text Input. + Longueur maximale autorisée du texte dans le texte en entrée. + + + Focus on press + Focus à l’appui + + + Overwrite mode + Mode d’écrasement + + + Persistent selection + Sélection permanente + + + Select by mouse + Sélectionner avec la souris + + + Select by keyboard + Sélectionner avec le clavier + + + Character displayed when users enter passwords. + Caractère affiché quand l’utilisateur entre des mots de passe. + + + Read only + Lecture seule + + + Cursor visible + Curseur visible + + + Auto scroll + Défilement automatique + + + + TextSection + + Text Area + Zone de texte + + + Placeholder text + Texte temporaire d’information + + + Placeholder text displayed when the editor is empty. + Texte temporaire d’information affiché lorsque l’éditeur est vide. + + + Placeholder color + Couleur du texte temporaire d’information + + + Placeholder text color. + Couleur du texte temporaire d’information. + + + Hover + Survol + + + Whether text area accepts hover events. + Si la zone de texte accepte les évènements de survol. + + + + TextTool + + Text Tool + + + + + TextureBrowserContextMenu + + Apply to selected model + Appliquer au modèle sélectionné + + + Apply to selected material + Appliquer au matériau sélectionné + + + Apply as light probe + Appliquer en tant que sonde de lumière + + + Duplicate + Dupliquer + + + Delete + Supprimer + + + Create New Texture + Créer une nouvelle texture + + + + TextureEditorToolBar + + Apply texture to selected model's material. + Appliquer la texture au matériau du modèle sélectionné. + + + Create new texture. + Créer une nouvelle texture. + + + Delete current texture. + Supprimer la texture en cours. + + + Open material browser. + Ouvrir le navigateur de matériaux. + + + + TimelineBarItem + + Range from %1 to %2 + Plage de %1 à %2 + + + Override Color + Écraser la couleur + + + Reset Color + Réinitialiser la couleur + + + + TimelineKeyframeItem + + Delete Keyframe + + + + Edit Easing Curve... + + + + Edit Keyframe... + + + + + TimerSpecifics + + Timer + Minuteur + + + Interval + Intervalle + + + Sets the interval between triggers, in milliseconds. + Définit l’intervalle entre chaque déclenchement, en millisecondes. + + + Repeat + Répéter + + + Sets whether the timer is triggered repeatedly at the specified interval or just once. + Définit si le minuteur est déclenché de manière répétée à l’intervalle spécifié ou une seule fois. + + + Running + En cours d’exécution + + + Sets whether the timer is running or not. + Définit si le minuteur est en cours ou non. + + + Triggered on start + Déclenché au démarrage + + + Sets the timer to trigger when started. + Règle le minuteur pour qu’il se déclenche au démarrage. + + + + ToolBarSpecifics + + Tool Bar + Barre d’outils + + + Position + Position + + + Position of the toolbar. + Position de la barre d’outils. + + + Font Inheritance + Héritage des polices + + + + ToolSeparatorSpecifics + + Tool Separator + + + + Orientation + Orientation + + + The orientation of the separator. + L’orientation du séparateur. + + + + TumblerSpecifics + + Tumbler + + + + Visible count + + + + The count of visible items. + + + + Current index + + + + The index of the current item. + + + + Wrap + + + + Whether the tumbler values wrap. + + + + + UnimportBundleMaterialDialog + + Bundle material might be in use + + + + If the material you are removing is in use, it might cause the project to malfunction. + +Are you sure you want to remove the material? + + + + Remove + Supprimer + + + Cancel + Annuler + + + + UrlChooser + + Built-in primitive + + + + + VideoSection + + Video + Vidéo + + + Source + Source + + + Fill mode + Mode de remplissage + + + Orientation + Orientation + + + + VisibilityTogglesAction + + Visibility Toggles + + + + + Welcome_splash + + Community Edition + Édition communautaire + + + Enterprise Edition + Édition Entreprise + + + Professional Edition + Édition professionnelle + + + Before we let you move on to your wonderful designs, help us make Qt Design Studio even better by letting us know how you're using it. To do this, we would like to turn on automatic collection of pseudonymized Analytics and Crash Report Data. + Avant que nous ne vous laissions poursuivre vos merveilleuses créations, aidez-nous à rendre Qt Design Studio encore meilleur en nous faisant savoir comment vous l’utilisez. Pour ce faire, nous aimerions activer la réception automatique de données d’analyse et de rapports de plantages pseudonymisés. + + + Turn Off + Désactiver + + + Turn On + Activer + + + Learn More + En savoir plus + + + Qt Design Studio + Qt Design Studio + + + + WidgetPluginManager + + Failed to create instance of file "%1": %2 + Échec lors de la création de l’instance du fichier « %1 » : %2 + + + Failed to create instance of file "%1". + Échec lors de la création de l’instance du fichier « %1 ». + + + File "%1" is not a Qt Quick Designer plugin. + Le fichier « %1 » n’est pas un greffon de Qt Quick Designer. + + + + WindowSpecifics + + Window + Fenêtre + + + Title + Titre + + + Position + Position + + + Size + Taille + + + W + width + The width of the object + L + + + H + height + The height of the object + H + + + Minimum size + Taille minimum + + + Minimum size of the window. + Taille minimum de la fenêtre. + + + Maximum size + Taille maximum + + + Maximum size of the window. + Taille maximum de la fenêtre. + + + Color + Couleur + + + Visible + Visible + + + Opacity + Opacité + + + Content orientation + Orientation du contenu + + + Flags + Flags + + + Modality + Modalité + + + Visibility + Visibilité + + + + emptyPane + + Select a component in the 2D, Navigator, or Code view to see its properties. + Sélectionnez un composant dans la vue 2D, LE Navigateur ou LE Code pour afficher ses propriétés. + + + + main + + Continue + Continuer + + + Start Download + Démarrer le téléchargement + + + Browse + Parcourir + + + Folder + Dossier + + + Cancel + Annuler + + + Open + Ouvrir + + + Details + Détails + + + Finish + Terminer + + + Download failed + Échec du téléchargement + + + Recent Projects + Projets récents + + + Examples + Exemples + + + Tutorials + Tutoriels + + + Welcome to + Bienvenue dans + + + Qt Design Studio + Qt Design Studio + + + Create New + Créer un nouveau + + + Open Project + Ouvrir un projet + + + Help + Aide + + + Community + Communauté + + + Blog + Blog + + + Community Edition + Édition communautaire + + + + text + + Text + Texte + + + + textedit + + Text Edit + Modifier le texte @@ -44642,6 +56262,13 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües.Éditeur de texte + + textinput + + Text + Texte + + textinputv2 @@ -44656,5537 +56283,4 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües.Texte - - QtC::Qnx - - Destination - Destination - - - Entry-Point - Point d'entrée - - - Select File to Add - Selectionner un fichier à ajouter - - - - QtC::Qnx - - Author ID: - Identifiant de l'auteur : - - - Set from debug token... - Définir le jeton de débogage... - - - Select Debug Token - Sélectionner le jeton de débogage - - - Error Reading Debug Token - Erreur lors de la lecture du jeton de débogage - - - There was a problem reading debug token. - Il y a eu un problème de lecture du jeton de débogage. - - - - QtC::Qnx - - Name: - Nom : - - - Description: - Description : - - - Icon: - Icône : - - - Clear - Nettoyer - - - Splash screens: - Écrans d'accueil : - - - Add... - Ajouter... - - - Images (*.jpg *.png) - Images (*.jpg *.png) - - - Select Splash Screen - Sélectionner un écran d'accueil - - - <font color="red">Could not open '%1' for reading.</font> - <font color="red">Impossible d'ouvrir "%1" en lecture.</font> - - - <font color="red">The selected image is too big (%1x%2). The maximum size is %3x%4 pixels.</font> - <font color="red">L'image sélectionnée est trop grande (%1x%2). La taille maximale est %3x%4 pixels.</font> - - - - QtC::Qnx - - Device Environment - Environnement du périphérique - - - - QtC::Qnx - - Orientation: - Orientation : - - - Chrome: - Chrome : - - - Transparent main window - Fenêtre principale transparante - - - Application Arguments: - Arguments de l'application : - - - Default - Défaut - - - Auto-orient - Orientation automatique - - - Landscape - Paysage - - - Portrait - Portrait - - - Standard - Standard - - - None - Aucune - - - - QtC::Qnx - - Package ID: - Identifiant de paquet : - - - Package version: - Version du paquet : - - - Package build ID: - Identifiante de création du paquet : - - - - QtC::Qnx - - Select All - Tout sélectionner - - - Deselect All - Déselectionner tout - - - - QtC::Qnx - - PKCS 12 archives (*.p12) - Archive PKCS 12 (*.p12) - - - Base directory does not exist. - Le répertoire de base n'existe pas. - - - Password must be at least 6 characters long. - Le mot de passe doit avoir au moins 6 caractères de long. - - - Are you sure? - Êtes-vous sûr ? - - - The blackberry-keytool process is already running. - Le processus blackberry-keytool est déjà en cours d'exécution. - - - The password entered is invalid. - Le mot de passe entré est invalide. - - - The password entered is too short. - Le mot de passe entré est trop court. - - - Invalid output format. - Le format de sortie est invalide. - - - An unknown error occurred. - Une erreur inconnue est survenue. - - - An unknown error occurred while creating the certificate. - Une erreur inconnue est apparue lors de la création du certificat. - - - Please be patient... - Veuillez être patient... - - - - QtC::Qnx - - Request Debug Token - Requête du jeton de débogage - - - Debug token path: - Chemin du jeton de débogage : - - - Keystore: - Trousseau de clés : - - - Device PIN: - Code PIN du périphérique : - - - BAR Files (*.bar) - Fichiers BAR (*.bar) - - - Requesting Device PIN... - Requête du code PIN du périphérique... - - - The file '%1' will be overwritten. Do you want to proceed? - Le fichier '%1' va être écrasé. Souhaitez-vous continuer ? - - - Not yet registered to request debug tokens. - Non enregistré pour effectuer des requêtes de jetons de débogage. - - - An unknwon error has occurred. - Une erreur inconnue est survenue. - - - Requesting debug token... - Requête en cours du jeton de débogage... - - - - QtC::Qnx - - Import Certificate - Importer un certificat - - - PKCS 12 Archives (*.p12) - Archives PKCS 12 (*.p12) - - - The keystore password is invalid. - Le mot de passe du trousseau de clés est invalide. - - - Error parsing inferior process output. - Échec de l'analyser de la sortie du processus inférieur. - - - An unknown error has occurred. - Une erreur inconnue est survenue. - - - - QtC::Qnx - - Form - Formulaire - - - BlackBerry Signing Authority - Autorité signataire BlackBerry - - - Registered: Yes - Inscrit : Oui - - - Register - S'inscrire - - - Unregister - Se désinscrire - - - Developer Certificate - Certificat développeur - - - Create - Créer - - - Import - Importer - - - Delete - Supprimer - - - Could not insert default certificate. - Impossible d'insérer le certificat par défaut. - - - Unregister Key - Désinscrire la clé - - - Do you really want to unregister your key? This action cannot be undone. - Souhaitez-vous réellement désinscrire votre clé ? Cette action ne peut être annulée. - - - Error storing certificate. - Erreur lors du stockage du certificat. - - - This certificate already exists. - Ce certificat existe déjà. - - - Delete Certificate - Supprimer le certificat - - - Are you sure you want to delete this certificate? - Êtes-vous sûr de vouloir supprimer ce certificat ? - - - Registered: No - Inscrit : Non - - - STATUS - STATUT - - - Path: - Chemin : - - - PATH - CHEMIN - - - Author: - Auteur : - - - LABEL - ÉTIQUETTE - - - No developer certificate has been found. - Aucun certificat développeur n'a été trouvé. - - - Open Certificate - Ouvrir le certificat - - - Clear Certificate - Effacer le certificat - - - Create Certificate - Créer un certificat - - - Invalid certificate password. Try again? - Le mot de passe du certificat est invalide. Essayer de nouveau ? - - - Error loading certificate. - Erreur de chargement du certificat. - - - This action cannot be undone. Would you like to continue? - Cette action ne peut pas être annulée. Voulez-vous continuer ? - - - Loading... - Chargement... - - - It appears you are using legacy key files. Please refer to the <a href="https://developer.blackberry.com/native/documentation/core/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/bbid_to_sa.html">BlackBerry website</a> to find out how to update your keys. - Il apparaît que vous utiliser des fichiers de clés existantes. Veuillez-vous référer au <a href="https://developer.blackberry.com/native/documentation/core/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/bbid_to_sa.html">site web de BlackBerry</a> pour trouver comment mettre à jour vos clés. - - - Your keys are ready to be used - Vos clés sont prêtes a être utilisées - - - No keys found. Please refer to the <a href="https://www.blackberry.com/SignedKeys/codesigning.html">BlackBerry website</a> to find out how to request your keys. - Aucune clé n'a été trouvée. Veuillez-vous référer au <a href="https://www.blackberry.com/SignedKeys/codesigning.html">site web de BlackBerry</a> pour trouver comment demander vos clés. - - - - QtC::Qnx - - Get started and configure your environment: - Démarrer et configurer votre environnement : - - - environment setup wizard - Assistant de configuration de l'environnement - - - BlackBerry NDK Path - Chemin du NDK BlackBerry - - - Remove - Supprimer - - - NDK Environment File - Fichier d'environnement NDK - - - Auto-Detected - Autodétecté - - - Manual - Manuel - - - Qt Creator - Qt Creator - - - It appears that your BlackBerry environment has already been configured. - Il apparaît que votre environnement BlackBerry a déjà été configuré. - - - Clean BlackBerry 10 Configuration - Nettoyer la configuration BlackBerry 10 - - - Are you sure you want to remove: - %1? - Êtes-vous sûr de vouloir supprimer : -%1 ? - - - Are you sure you want to uninstall %1? - Êtes-vous sûr de vouloir desinstaller %1 ? - - - Are you sure you want to remove the current BlackBerry configuration? - Êtes-vous sûr de vouloir supprimer la configuration actuelle de BlackBerry ? - - - Add - Ajouter - - - Activate - Activer - - - Deactivate - Désactiver - - - BlackBerry NDK Information - Information du NDK BlackBerry - - - <html><head/><body><p><span style=" font-weight:600;">NDK Base Name:</span></p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Nom de base du NDK :</span></p></body></html> - - - <html><head/><body><p><span style=" font-weight:600;">NDK Path:</span></p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Chemin du NDK :</span></p></body></html> - - - <html><head/><body><p><span style=" font-weight:600;">Version:</span></p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Version :</span></p></body></html> - - - <html><head/><body><p><span style=" font-weight:600;">Host:</span></p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Hôte :</span></p></body></html> - - - <html><head/><body><p><span style=" font-weight:600;">Target:</span></p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Chemin :</span></p></body></html> - - - - QtC::Qnx - - Register Key - Inscrire la clé - - - Confirm CSK password: - Confirmer le mot de passe CSK : - - - Generate developer certificate automatically - Générer un certificat développeur automatiquement - - - Show - Afficher - - - This is the PIN you entered when you requested the CSJ files. - Ceci est le code PIN que vous avez entré lorsque vous avez démandé les fichiers CSJ. - - - CSK passwords do not match. - Les mots de passe CSK ne correspondent pas. - - - Keystore password does not match. - Le mot de passe du trousseau de clés ne correspond pas. - - - - QtC::Qnx - - Device name: - Nom du périphérique : - - - IP or host name of the device - IP ou nom de l'hôte du périphérique - - - Device IP address: - Adresse IP du périphérique : - - - The password you use to unlock your device - Le mot de passe que vous utilisez pour débloquer votre périphérique - - - Simulator - Simulateur - - - Configure BlackBerry Device Connection - Configurer la connexion au périphérique BlackBerry - - - BlackBerry Device - Périphérique BlackBerry - - - - QtC::Qnx - - Your environment is ready to be configured. - Votre environnement est prêt à être configuré. - - - - QtC::Qnx - - <html><head/><body><p><span style=" font-weight:600;">Obtaining keys</span></p><p>You will need to order a pair of CSJ files from BlackBerry, by <a href="https://www.blackberry.com/SignedKeys/codesigning.html"><span style=" text-decoration: underline; color:#004f69;">visiting this page.</span></a></p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Obtention des clés</span></p><p>Vous devez commander une paire de fichiers CSJ à BlackBerry, en <a href="https://www.blackberry.com/SignedKeys/codesigning.html"><span style=" text-decoration: underline; color:#004f69;">visitant cette page.</span></a></p></body></html> - - - PBDT CSJ file: - Fichier PBDT CSJ : - - - RDK CSJ file: - Fichier RDK CSJ : - - - CSJ PIN: - Code PIN CSJ : - - - The PIN you provided on the key request website - Le code PIN que vous avez fourni sur le site de requête de clé - - - The password that will be used to access your keys and CSK files - Le mot de passe qui sera utilisé pour accéder à vos clés et fichiers CSK - - - Register Signing Keys - Inscrire des clés de signature - - - Passwords do not match. - Les mots de passe ne correspondent pas. - - - Setup Signing Keys - Installer les clés signées - - - This wizard will be closed and you will be taken to the BlackBerry key request web page. Do you want to continue? - L'assistant sera fermé et vous serez amené sur le site de requête de clé BlackBerry. Souhaitez-vous continuer ? - - - Browse CSJ File - Parcourcir les fichiers CSJ - - - CSJ files (*.csj) - Fichiers CSJ (*.csj) - - - <html><head/><body><p><span style=" font-weight:600;">Legacy keys detected</span></p><p>It appears you are using legacy key files. Please visit <a href="https://developer.blackberry.com/native/documentation/core/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/bbid_to_sa.html"><span style=" text-decoration: underline; color:#004f69;">this page</span></a> to upgrade your keys.</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Des clés existantes ont été détectée</span></p><p>Il apparaît que vous utiliser des fichiers de clés existantes. Merci de visiter <a href="https://developer.blackberry.com/native/documentation/core/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/bbid_to_sa.html"><span style=" text-decoration: underline; color:#004f69;">cette page</span></a> pour mettre à jour vos clés.</p></body></html> - - - <html><head/><body><p><span style=" font-weight:600;">Obtaining keys</span></p><p>You will need to order your signing keys from BlackBerry, by <a href="https://www.blackberry.com/SignedKeys/codesigning.html"><span style=" text-decoration: underline; color:#004f69;">visiting this page.</span></a></p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Obtention des clés</span></p><p>Vous devez commander vos clés signées à BlackBerry, en <a href="https://www.blackberry.com/SignedKeys/codesigning.html"><span style=" text-decoration: underline; color:#004f69;">visitant cette page.</span></a></p></body></html> - - - Your BlackBerry signing keys have already been installed. - Vos clés signées par BlackBerry ont déjà été installée. - - - - QtC::Qnx - - Package signing passwords - Mots de passe de signature des paquets - - - - QtC::VcsBase - - Subversion Submit - Soumission Subversion - - - Descriptio&n - Descriptio&n - - - F&iles - F&ichiers - - - Check a&ll - Coche&r tout - - - %1 %2/%n File(s) - - %1 %2/%n fichier - %1 %2/%n fichiers - - - - &Commit - &Commit - - - Check All - Check all for submit - Cocher tout - - - Uncheck All - Uncheck all for submit - Décocher tout - - - - ColorLineEdit - - Translate this string - Traduire cette chaîne de caractères - - - - WindowPane - - Window - Fenêtre - - - Title - Titre - - - - QtC::ExtensionSystem - - Continue - Continue - - - - QtC::QmlJS - - %1 seems not to be encoded in UTF8 or has a BOM. - %1 ne semble pas être encodé en UTF8 ou possède un BOM. - - - - QtC::Utils - - XML error on line %1, col %2: %3 - Erreur XML sur la ligne %1, colonne %2 : %3 - - - The <RCC> root element is missing. - L'élement racine <RCC> est manquant. - - - - QtC::QmlJS - - Cannot find file %1. - Impossible de trouver le fichier %1. - - - Expected document to contain a single object definition. - Le document ne devrait contenir qu'une seule définition d'objet. - - - Expected expression statement after colon. - Expression attendue après les deux points. - - - Expected expression statement to be a literal. - L'expression doit être littérale. - - - Property is defined twice. - Propriété définie deux fois. - - - Do not use '%1' as a constructor. - Ne pas utiliser '%1' comme un constructeur. - - - Invalid value for enum. - Valeur invalide pour une énumération. - - - Enum value must be a string or a number. - La valeur d'une énumération doit être une chaîne de caractères ou un nombre. - - - Number value expected. - Valeur numérique attendue. - - - Boolean value expected. - Valeur binaire attendue. - - - String value expected. - Chaîne de caractères attendue. - - - Invalid URL. - URL invalide. - - - File or directory does not exist. - Le fichier ou le répertoire n'existe pas. - - - Invalid color. - Couleur invalide. - - - Anchor line expected. - Ligne d'ancrage attendue. - - - Duplicate property binding. - Lien de propriété dupliquée. - - - Id expected. - Identifiant attendu. - - - Invalid id. - Identifiant invalide. - - - Duplicate id. - ID dupliqué. - - - Invalid property name '%1'. - Nom de propriété "%1" invalide. - - - '%1' does not have members. - "%1" n'a pas de membre. - - - '%1' is not a member of '%2'. - "%1" n'est pas un membre de "%2". - - - Assignment in condition. - Assignation dans une condition. - - - Unterminated non-empty case block. - Bloc case non vide et non terminé. - - - Do not use 'eval'. - Ne pas utiliser "eval". - - - Unreachable. - Inatteignable. - - - Do not use 'with'. - Ne pas utiliser "with". - - - Do not use comma expressions. - Ne pas utiliser les expressions séparées par des virgules. - - - '%1' already is a formal parameter. - "%1" est déjà un paramètre formel. - - - Unnecessary message suppression. - Suppression d'un message inutile. - - - '%1' already is a function. - "%1" est déjà une fonction. - - - var '%1' is used before its declaration. - La variable "%1" est utilisée avant sa déclaration. - - - '%1' already is a var. - "%1" est déjà une variable. - - - '%1' is declared more than once. - "%1" est déclaré plusieurs fois. - - - Function '%1' is used before its declaration. - La fonction "%1" est utilisée avant sa déclaration. - - - The 'function' keyword and the opening parenthesis should be separated by a single space. - Le mot-clé "function" et la parenthèse ouvrante doivent être séparés par un seule espace. - - - Do not use stand-alone blocks. - Ne pas utiliser de blocs indépendants. - - - Do not use void expressions. - Ne pas utiliser les expressions void. - - - Confusing pluses. - Signe plus prêtant à confusion. - - - Confusing minuses. - Signe moins prêtant à confusion. - - - Declare all function vars on a single line. - Déclarez toutes les variables de fonction sur une seule ligne. - - - Unnecessary parentheses. - Parenthèses non nécessaires. - - - == and != may perform type coercion, use === or !== to avoid it. - == et != peuvent provoquer une coercition de type, utilisez === ou !== pour l'éviter. - - - == and != perform type coercion, use === or !== to avoid it. - == et != provoquent une coercition de type, utilisez === ou !== pour l'éviter. - - - Expression statements should be assignments, calls or delete expressions only. - Les définitions d'expression devraient être des expression d'assignation, d'appel ou de suppression uniquement. - - - Place var declarations at the start of a function. - Les déclarations devraient être au début d'une fonction. - - - Use only one statement per line. - Utiliser seulement une déclaration par ligne. - - - Unknown component. - Composant inconnu. - - - Could not resolve the prototype '%1' of '%2'. - Impossible de résoudre le prototype "%1" de "%2". - - - Could not resolve the prototype '%1'. - Impossible de résoudre le prototype de "%1". - - - Prototype cycle, the last non-repeated component is '%1'. - Dans le cycle de prototype, le dernier objet non répété est "%1". - - - Invalid property type '%1'. - Type de propriété invalide "%1". - - - Calls of functions that start with an uppercase letter should use 'new'. - Les appels de fonctions qui commence par une lettre majuscule devrait utiliser "new". - - - Use 'new' only with functions that start with an uppercase letter. - "new" ne devrait être utilisé qu'avec des fonctions qui commence par une lettre majuscule. - - - Use spaces around binary operators. - Utilisez des espaces autour des opérateurs binaires. - - - Unintentional empty block, use ({}) for empty object literal. - Bloc vide involontaire, utilisez ({}) pour les objets vides. - - - Use %1 instead of 'var' or 'variant' to improve performance. - Utilisez %1 à la place de "var" ou "variant" pour améliorer les performances. - - - Missing property '%1'. - Propriété "%1" manquante. - - - Object value expected. - Valeur objet attendue. - - - Array value expected. - Valeur de tableau attendue. - - - %1 value expected. - Valeur %1 attendue. - - - Maximum number value is %1. - La valeur maximale est %1. - - - Minimum number value is %1. - La valeur minimale est %1. - - - Maximum number value is exclusive. - La valeur maximale est exclusive. - - - Minimum number value is exclusive. - La valeur minimale est exclusive. - - - String value does not match required pattern. - La valeur de la chaîne de caractères ne correspond pas au format requis. - - - Minimum string value length is %1. - La longueur de la chaîne de caractères est d'au moins %1. - - - Maximum string value length is %1. - La longueur de la chaîne de caractères est d'au plus %1. - - - %1 elements expected in array value. - %1 éléments attendus dans la valeur du tableau. - - - Imperative code is not supported in the Qt Quick Designer. - Le code impératif n'est pas supporté dans Qt Quick Designer. - - - This type is not supported in the Qt Quick Designer. - Ce type n'est pas supporté dans Qt Quick Designer. - - - Reference to parent item cannot be resolved correctly by the Qt Quick Designer. - La référence à l'élément parent ne peut être résolu correctement par Qt Quick Designer. - - - This visual property binding cannot be evaluated in the local context and might not show up in Qt Quick Designer as expected. - La liaison de la propriété visuelle ne peut être évaluée dans le contexte local et pourra ne pas être affiché dans Qt Quick Designer comme cela est attendu. - - - Qt Quick Designer only supports states in the root item. - Qt Quick Designer supporte uniquement les états dans l'élément racine. - - - Using Qt Quick 1 code model instead of Qt Quick 2. - Utiliser un modèle de code Qt Quick 1 au lieu de Qt Quick 2. - - - - QtC::Android - - No analyzer tool selected. - Pas d'outil d'analyse sélectionné. - - - GDB server - Serveur GDB - - - Manage... - Gérer... - - - Auto-detect - Autodétection - - - Edit... - Modifier... - - - Android GDB server - Serveur GDB Android - - - The GDB server to use for this kit. - Le serveur GDB à utiliser pour ce kit. - - - &Binary: - &Binaire : - - - GDB Server for "%1" - Le serveur GDB pour "%1" - - - General - Général - - - XML Source - Source XML - - - Android Manifest editor - Éditeur de manifest Android - - - Package - Paquet - - - <p align="justify">Please choose a valid package name for your application (e.g. "org.example.myapplication").</p><p align="justify">Packages are usually defined using a hierarchical naming pattern, with levels in the hierarchy separated by periods (.) (pronounced "dot").</p><p align="justify">In general, a package name begins with the top level domain name of the organization and then the organization's domain and then any subdomains listed in reverse order. The organization can then choose a specific name for their package. Package names should be all lowercase characters whenever possible.</p><p align="justify">Complete conventions for disambiguating package names and rules for naming packages when the Internet domain name cannot be directly used as a package name are described in section 7.7 of the Java Language Specification.</p> - <p align="justify">Veuillez choisir un nom de paquet valide pour votre application (par exemple : "org.exemple.monapplication").</p><p align="justify">Les paquets sont habituellement définis en utilisant un modèle hiérarchique de nommage, avec des niveaux dans la hiérarchie séparés par des points (.) (prononcé "dot").</p><p align="justify">En général, un nom de paquet commance avec le nom du domaine de premier niveau de l'organisation puis le domaine de l'organisation et ensuite les sous-domaines listés dans l'ordre inverse. L'oganisation peut alors choisir un nom spécifique pour leurs paquets. Les noms de paquets doivent être tout en minuscule autant que possible.</p><p align="justify">La convention complète pour les noms de paquets et les règles pour les nommer lorsque le nom de domaine internet ne peut être utilisé directement comme nom de paquet sont décrites dans la section 7.7 de la spécification du langage Java.</p> - - - <p align="justify">Please choose a valid package name for your application (for example, "org.example.myapplication").</p><p align="justify">Packages are usually defined using a hierarchical naming pattern, with levels in the hierarchy separated by periods (.) (pronounced "dot").</p><p align="justify">In general, a package name begins with the top level domain name of the organization and then the organization's domain and then any subdomains listed in reverse order. The organization can then choose a specific name for their package. Package names should be all lowercase characters whenever possible.</p><p align="justify">Complete conventions for disambiguating package names and rules for naming packages when the Internet domain name cannot be directly used as a package name are described in section 7.7 of the Java Language Specification.</p> - <p align="justify">Veuillez choisir un nom de paquet valide pour votre application (par exemple "org.exemple.monapplication").</p><p align="justify">Les paquets sont habituellement définis en utilisant un modèle hiérarchique de nommage, avec des niveaux dans la hiérarchie séparés par des points (.) (prononcé "dot").</p><p align="justify">En général, un nom de paquet commence avec le nom du domaine de premier niveau de l'organisation puis le domaine de l'organisation et ensuite les sous-domaines listés dans l'ordre inverse. L'oganisation peut alors choisir un nom spécifique pour leurs paquets. Les noms de paquets doivent tous être en minuscule autant que possible.</p><p align="justify">La convention complète pour les noms de paquets et les règles pour les nommer lorsque le nom de domaine internet ne peut être utilisé directement comme nom de paquet sont décrites dans la section 7.7 de la spécification du langage Java.</p> - - - Package name: - Nom du paquet : - - - The package name is not valid. - Le nom du paquet n'est pas valide. - - - Version code: - Version du code : - - - Version name: - Nom de version : - - - Sets the minimum required version on which this application can be run. - Définie la version minimale nécessaire sur laquelle cette application peut tourner. - - - Not set - Non défini - - - Minimum required SDK: - Version du SDK Minimale requise : - - - Sets the target SDK. Set this to the highest tested version.This disables compatibility behavior of the system for your application. - Définit le SDK cible. Réglez-le sur la version la plus élevée testée.Cela désactive le comportement de compatibilité du système pour votre application. - - - Target SDK: - SDK cible : - - - Application name: - Nom de l'application : - - - Run: - Exécution : - - - Select low DPI icon. - Sélectionner une icône basse résolution. - - - Select medium DPI icon. - Sélectionner une icône moyenne résolution. - - - Select high DPI icon. - Sélectionner une icône haute résolution. - - - The structure of the Android manifest file is corrupted. Expected a top level 'manifest' node. - La structure du fichier manifest Android est corrompue. Un nœud de premier niveau "manifest" est attendu. - - - The structure of the Android manifest file is corrupted. Expected an 'application' and 'activity' sub node. - La structure du fichier manifest Android est corrompue. Des sous-nœud "application" et "activity" sont attendus. - - - API %1: %2 - API %1 : %2 - - - Could not parse file: '%1'. - Impossible d'analyser le fichier : "%1". - - - %2: Could not parse file: '%1'. - %2 : impossible d'analyser le fichier : "%1". - - - Select low dpi icon - Sélectionner une icône basse résolution - - - Select medium dpi icon - Sélectionner une icône moyenne résolution - - - Select high dpi icon - Sélectionner une icône haute résolution - - - Application icon: - Icône de l'application : - - - Permissions - Permissions - - - The structure of the android manifest file is corrupt. Expected a top level 'manifest' node. - La structure du fichier manifest Android est corrompue. Un nœud de premier niveau "manifest" est attendu. - - - The structure of the Android manifest file is corrupt. Expected an 'application' and 'activity' sub node. - La structure du fichier manifest Android est corrompue. Des sous-nœud "application" et "activity" sont attendus. - - - Could not parse file: '%1' - Impossible d'analyser le fichier : "%1" - - - %2: Could not parse file: '%1' - %2 : impossible d'analyser le fichier : "%1" - - - Goto error - Aller à l'erreur - - - Choose Low DPI Icon - Choisir une icône basse résolution - - - PNG images (*.png) - Images PNG (*.png) - - - Choose Medium DPI Icon - Choisir une icône moyenne résolution - - - Choose High DPI Icon - Choisir une icône haute résolution - - - Android Manifest file - Fichier manifest Android - - - Could not add mime-type for AndroidManifest.xml editor. - Impossible d'ajouter le type mime pour l'éditeur de AndroidManifest.xml. - - - - QtC::BinEditor - - Memory at 0x%1 - Mémoire à 0x%1 - - - Decimal unsigned value: - Valeur décimale non signée : - - - Decimal signed value: - Valeur décimale signée : - - - Previous decimal unsigned value: - Valeur précédente décimale non signée : - - - Previous decimal signed value: - Valeur précédente décimale signée : - - - %1-bit Integer Type - Type d'entier sur %1 bits - - - Little Endian - remettre endian ? - Petit boutiste - - - Big Endian - Grand boutiste - - - Binary value: - Valeur binaire : - - - Octal value: - Valeur octale : - - - Previous binary value: - Valeur binaire précédente : - - - Previous octal value: - Valeur octale précédente : - - - <i>double</i> value: - Valeur <i>double</i> : - - - Previous <i>double</i> value: - Valeur <i>double</i> précédente : - - - <i>float</i> value: - Valeur <i>float</i> : - - - Previous <i>float</i> value: - Valeur <i>float</i> précédente : - - - Copying Failed - Échec de la copie - - - You cannot copy more than 4 MB of binary data. - Vous ne pouvez pas copier plus de 4 Mo de données binaires. - - - Copy Selection as ASCII Characters - Copier la séléction comme des caractères ASCII - - - Copy Selection as Hex Values - Copier la sélection comme des valeurs hexadécimales - - - Set Data Breakpoint on Selection - Ajouter un point d'arrêt sur la sélection - - - Jump to Address in This Window - Aller à l'adresse dans cette fenêtre - - - Jump to Address in New Window - Aller à l'adresse dans une nouvelle fenêtre - - - Jump to Address 0x%1 in This Window - Aller à l'adresse 0x%1 dans cette fenêtre - - - Jump to Address 0x%1 in New Window - Aller à l'adresse 0x%1 dans une nouvelle fenêtre - - - - QtC::Bookmarks - - Note text: - Note : - - - - QtC::CMakeProjectManager - - Ninja (%1) - Ninja (%1) - - - NMake Generator (%1) - Générateur NMake (%1) - - - MinGW Generator (%1) - Générateur MinGW (%1) - - - Unix Generator (%1) - Générateur UNIX (%1) - - - Show Options - Afficher les options - - - Check Kits - Vérifier les kits - - - There are compatible kits. - Il y a des kits compatibles. - - - Qt Creator has no kits that are suitable for CMake projects. Please configure a kit. - Qt Creator n'a pas de kits qui sont utilisables pour les projets CMake. Veuillez configurer un kit. - - - - QtC::Core - - (%1) - (%1) - - - Qt Creator %1%2 - Qt Creator %1%2 - - - Based on Qt %1 (%2, %3 bit) - Basé sur Qt %1 (%2, %3 bit) - - - Toggle Progress Details - Activer/désactiver les détails de la progression - - - Ctrl+Shift+0 - Ctrl+Shift+0 - - - Alt+Shift+0 - Alt+Shift+0 - - - %1: Full path including file name. - %1 : chemin complet incluant le nom du fichier. - - - %1: Full path excluding file name. - %1 : chemin complet sans le nom du fichier. - - - %1: File name without path. - %1 : nom du fichier sans le chemin. - - - %1: File base name without path and suffix. - %1 : nom du fichier sans le chemin, ni le suffixe. - - - - QtC::CppEditor - - C++ Class - Classe C++ - - - Creates a C++ header and a source file for a new class that you can add to a C++ project. - Crée les fichier d'en-tête et fichier source C++ pour une nouvelle classe que vous pouvez ajouter a votre projet C++. - - - Creates a C++ source file that you can add to a C++ project. - Crée un fichier source C++ que vous pouvez ajouter a votre projet C++. - - - C++ Source File - Fichier source C++ - - - Creates a C++ header file that you can add to a C++ project. - Crée un fichier d'en-tête C++ que vous pouvez ajouter a votre projet C++. - - - C++ Header File - Fichier d'en-tête C++ - - - Switch Between Method Declaration/Definition - Changer entre la définition et déclaration de la méthode - - - Shift+F2 - Shift+F2 - - - Open Method Declaration/Definition in Next Split - Ouvrir la déclaration/définition de la méthode dans une nouvelle vue - - - Additional Preprocessor Directives... - Directives supplémentaires pour le préprocesseur... - - - Switch Between Function Declaration/Definition - Changer entre la définition et déclaration de la fonction - - - Open Function Declaration/Definition in Next Split - Ouvrir la déclaration/définition de la fonction dans une nouvelle vue - - - Meta+E, Shift+F2 - Meta+E, Maj+F2 - - - Ctrl+E, Shift+F2 - Ctrl+E, Maj+F2 - - - Find Usages - Trouver les utilisations - - - Ctrl+Shift+U - Ctrl+Maj+U - - - Open Type Hierarchy - Ouvrir la hiérarchie de type - - - Meta+Shift+T - Meta+Maj+T - - - Ctrl+Shift+T - Ctrl+Maj+T - - - Open Include Hierarchy - Ouvrir la hiérarchie de l'include - - - Meta+Shift+I - Meta+Maj+I - - - Ctrl+Shift+I - Ctrl+Maj+I - - - Rename Symbol Under Cursor - Renommer le symbole sous le curseur - - - CTRL+SHIFT+R - Ctrl+Maj+R - - - Reparse Externally Changed Files - Réanalyser les fichiers modifiés en dehors de Qt Creator - - - Update Code Model - Mettre à jour le modèle de code - - - Create Getter and Setter Member Functions - Créer des fonctions membres accesseurs et mutateurs - - - Generate Missing Q_PROPERTY Members... - Générer les membres Q_PROPERTY manquants... - - - Move Definition Outside Class - Déplacer la définition en dehors de la classe - - - Move Definition to %1 - Déplacer la définition dans %1 - - - Move Definition to Class - Déplacer la définition dans la classe - - - Insert Virtual Functions of Base Classes - Insérer les fonctions virtuelles des classes de bases - - - Insert Virtual Functions - Insérer les fonctions virtuelles - - - &Functions to insert: - &Fonctions à insérer : - - - &Hide already implemented functions of current class - &Cacher les fonctions déjà implémentées de la classe courante - - - &Insertion options: - Options d'&insertion : - - - Insert only declarations - Insérer seulement les déclarations - - - Insert definitions inside class - Insérer les définitions dans la classe - - - Insert definitions outside class - Insérer les définitions en dehors de la classe - - - Insert definitions in implementation file - Insérer les définitions dans un fichier d'implémentation - - - &Add keyword 'virtual' to function declaration - &Ajouter le mot clés "virtual" à la déclaration de la fonction - - - Parsing - Analyse syntaxique - - - Too few arguments - Trop peu d'arguments - - - - QtC::CVS - - &Edit - &Édition - - - - QtC::Debugger - - Symbol Paths - Chemins des symboles - - - Source Paths - Chemin des sources - - - CDB Paths - Chemins CDB - - - Behavior - Comportement - - - Use alternating row colors in debug views - Alterner la couleur de ligne dans le débogueur visuel - - - Change the font size in the debugger views when the font size in the main editor changes. - Changer la taille de la police dans les vues du débogueur quand la taille de police est changée dans l'éditeur principal. - - - Debugger font size follows main editor - La taille de police du débogueur suit celle de l'éditeur principal - - - Use tooltips in main editor while debugging - Utiliser les info-bulles dans l'éditeur principal lors du débogage - - - Populate the source file view automatically. This might slow down debugger startup considerably. - Remplir la vue du fichier source automatiquement. Ceci pourrait ralentir considérablement le lancement du débogueur. - - - Populate source file view automatically - Peupler la vue du fichier source automatiquement - - - Close temporary views on debugger exit - Fermer temporaires les vues à la sortie du débogueur - - - Stopping and stepping in the debugger will automatically open source or disassembler views associated with the current location. Select this option to automatically close them when the debugger exits. - L'arrêt et le pas-à-pas du débogueur ouvrira automatiquement la source ou le désassembleur à la position actuelle. Sélectionner cette option pour les fermer automatiquement lorsque le débogueur quitte. - - - Switch to previous mode on debugger exit - Retourner au mode précédent à l'arrêt du débogueur - - - Bring Qt Creator to foreground when application interrupts - Afficher Qt Creator au premier plan lorsque l'application s'interrompt - - - Show QML object tree in Locals & Expressions when connected and not stepping. - Afficher l'arbre d'objets QML dans "Locales et expressions" lorsqu'il est connecté et non au pas-à-pas. - - - Show QML object tree - Afficher l'arbre d'objets QML - - - Enable a full file path in breakpoints by default also for GDB. - Activer aussi le chemin complet du fichier dans les points d'arrêt par défaut pour GDB. - - - Set breakpoints using a full absolute path - Définir les points d'arrêt en utilisant un chemin absolu complet - - - Register Qt Creator for debugging crashed applications. - Enregistrer Qt Creator pour déboguer les applications crashées. - - - Use Qt Creator for post-mortem debugging - Utiliser Qt Creator pour le débogage post-mortem - - - Warn when debugging "Release" builds - Avertir lors du débogage en mode "Release" - - - Show a warning when starting the debugger on a binary with insufficient debug information. - Afficher un avertissement lors du démarrage du débogueur sur un binaire ayant insuffisamment d'informations de débogage. - - - Maximum stack depth: - Profondeur maximale de la pile : - - - <unlimited> - <illimitée> - - - Maximum string length: - Longueur maximum de la chaîne de caractères : - - - Debugger settings - Paramètres du débogueur - - - GDB Extended - GDB étendu - - - - QtC::ImageViewer - - Color at %1,%2: red: %3 green: %4 blue: %5 alpha: %6 - Couleur à la position %1,%2 : rouge : %3 vert : %4 bleu : %5 alpha : %6 - - - Size: %1x%2, %3 byte, format: %4, depth: %5 - Taille : %1x%2, %3 octet, format : %4, profondeur : %5 - - - <Click to display color> - <Cliquer pour afficher la couleur> - - - Copy Image - Copier l'image - - - Open Image Viewer - Ouvrir un visualiseur d'image - - - - QtC::Debugger - - Unable to start lldb '%1': %2 - LLDB au lieu de lldb, comme sur le site http://lldb.llvm.org/ - Impossible de démarrer LLDB "%1" : %2 - - - Unable to start LLDB "%1": %2 - Impossible de démarrer LLDB "%1" : %2 - - - Interrupt requested... - Interruption demandée... - - - LLDB I/O Error - Erreur d'entrée/sortie de LLDB - - - The LLDB process failed to start. Either the invoked program "%1" is missing, or you may have insufficient permissions to invoke the program. - Échec du démarrage du processus LLDB. Soit le programme "%1" est manquant, soit les droits sont insuffisants pour exécuter le programme. - - - The LLDB process crashed some time after starting successfully. - Le processus LLDB a planté après avoir démarré correctement. - - - An error occurred when attempting to write to the LLDB process. For example, the process may not be running, or it may have closed its input channel. - Une erreur s'est produite lors d'une tentative d'écriture sur le processus LLDB. Par exemple, le processus peut ne pas être démarré ou avoir fermé son entrée standard. - - - An unknown error in the LLDB process occurred. - Une erreur inconnue est survenue dans le processus LLDB. - - - Adapter start failed - Le démarrage de l'adaptateur a échoué - - - String literal %1 - Chaîne de caractères %1 - - - Lldb I/O Error - Erreur d'E/S LLDB - - - The Lldb process failed to start. Either the invoked program '%1' is missing, or you may have insufficient permissions to invoke the program. - Échec du démarrage du processus LLDB. Soit le programme "%1" est manquant, soit les droits sont insuffisants pour exécuter le programme. - - - The Lldb process crashed some time after starting successfully. - Le processus LLDB a crashé après avoir démarré correctement. - - - An error occurred when attempting to write to the Lldb process. For example, the process may not be running, or it may have closed its input channel. - Une erreur s'est produite lors d'une tentative d'écriture sur le processus LLDB. Le processus peut ne pas être démarré ou avoir fermé son entrée standard. - - - An error occurred when attempting to read from the Lldb process. For example, the process may not be running. - Une erreur s'est produite lors d'une tentative de lecture depuis le processus LLDB. Le processus peut ne pas être en cours d'exécution. - - - An unknown error in the Lldb process occurred. - Une erreur inconnue est survenue dans le processus LLDB. - - - - QtC::DiffEditor - - Ignore Whitespace - Ignorer les espaces - - - Context Lines: - Lignes contextuelles : - - - Synchronize Horizontal Scroll Bars - Synchroniser les barre de défilement horizontale - - - [%1] vs. [%2] %3 - [%1] contre [%2] %3 - - - %1 vs. %2 - %1 contre %2 - - - [%1] %2 vs. [%3] %4 - [%1] %2 contre [%3] %4 - - - Diff Editor - Éditeur de différences - - - Diff... - Diff... - - - Select First File for Diff - Sélectionner le premier fichier pour Diff - - - Select Second File for Diff - Sélectionner le second fichier pour Diff - - - Diff "%1", "%2" - Editor title - Diff "%1", "%2" - - - No difference - Aucune différence - - - Skipped %n lines... - - Passer %n ligne... - Passer %n lignes... - - - - [%1] %2 - [%1] %2 - - - - QtC::Utils - - Delete - Supression - - - Insert - Insertion - - - Equal - Équivalent - - - - QtC::Git - - Working tree - Arbre de travail - - - Index - Index - - - Sha1 - SHA1 - - - Reset to: - Réinitaliser à : - - - Select change: - Sélectionner la modification : - - - Reset type: - Réinitialiser le type : - - - Mixed - Mixte - - - Hard - Hard - - - Soft - Soft - - - File input for the merge tool requires Git 1.7.8, or later. - Le fichier d'entrée pour l'outil de fusion nécessite Git 1.7.8 ou supérieur. - - - Normal - Normal - - - Submodule - Sous-module - - - Deleted - Supprimé - - - Symbolic link - Lien symbolique - - - Modified - Modifié - - - Created - Créé - - - Submodule commit %1 - Commit du sous-module %1 - - - Symbolic link -> %1 - Lien symbolique -> %1 - - - Merge Conflict - Conflit dans la fusion - - - %1 merge conflict for '%2' -Local: %3 -Remote: %4 - %1 conflit de fusion pour "%2" -Local : %3 -Distant : %4 - - - &Local - &Local - - - &Remote - &Distant - - - &Created - &Créé - - - &Modified - &Modifié - - - &Deleted - &Supprimé - - - Continue Merging - Continuer la fusion - - - Continue merging other unresolved paths? - Continuer la fusion pour les autres chemins non résolus ? - - - Merge tool process finished successully. - Le processus de l'outil de fusion s'est terminé avec succès. - - - Merge tool process terminated with exit code %1 - Le processus de l'outil de fusion s'est terminé en retournant %1 - - - - QtC::ProjectExplorer - - Custom - Personnalisé - - - %n entries - - %n entrée - %n entrées - - - - Empty - Vide - - - Custom Parser Settings... - Paramètres d'analyse personnalisés... - - - Each line defines a macro. Format is MACRO[=VALUE] - Chaque ligne définie une macro. Le format est MACRO[=VALUE] - - - Each line adds a global header lookup path. - Chaque ligne ajoute un chemin de correspondance d'en-tête global. - - - Comma-separated list of flags that turn on C++11 support. - Liste des flags séparés par des virgules qui active le support du C++11. - - - Comma-separated list of mkspecs. - Liste de mkspecs séparés par une virgule. - - - &Compiler path: - Chemin du &compilateur : - - - &Make path: - Chemin de &make : - - - &ABI: - &ABI : - - - &Predefined macros: - Macros &prédéfinies : - - - &Header paths: - Chemins des &en-têtes : - - - C++11 &flags: - &Flags C++11 : - - - &Qt mkspecs: - mkspecs de &Qt : - - - &Error parser: - &Erreur d'analyse syntaxique : - - - No device configured. - Aucun périphérique configuré. - - - Set Up Device - Configurer le périphérique - - - There is no device set up for this kit. Do you want to add a device? - Il n'y a pas de périphérique configuré pour ce kit. Souhaitez-vous ajouter un périphérique ? - - - Check for a configured device - Vérifier pour les périphériques configurés - - - Run Environment - Environnement d'exécution - - - Base environment for this run configuration: - Environnement de base pour cette configuration d'exécution : - - - %1 (%2 %3 in %4) - %1 (%2 %3 dans %4) - - - System Environment - Environnement du système - - - Clean Environment - Environnement vierge - - - Remove - Name of the action triggering the removetaskhandler - Supprimer - - - Remove task from the task list - Retirer la tâche de la liste des tâches - - - - QtC::Python - - Python source file - Fichier source Python - - - Creates an empty Python script with UTF-8 charset - Créer un script Python vide avec le jeu de caractères UTF-8 - - - New %1 - Nouveau %1 - - - Python class - Classe Python - - - Creates new Python class - Créer une nouvelle classe Python - - - C++ module for Python - Module C++ pour Python - - - Creates C++/Boost file with bindings for Python - Créer un fichier C++/Boost avec des liaisons pour Python - - - Enter Class Name - Entrer le nom de la classe - - - The source file name will be derived from the class name - Le nom du fichier source sera déterminé à partir du nom de la classe - - - Python Class Wizard - Assistant de classe Python - - - Details - Détails - - - - QtC::QbsProjectManager - - Parsing the Qbs project. - Analyse du projet Qbs. - - - Parsing of Qbs project has failed. - L'analyse du projet Qbs a échoué. - - - Qbs based build - Compilation basée sur Qbs - - - New Configuration - Nouvelle configuration - - - New configuration name: - Nom de la nouvelle configuration : - - - %1 Debug - Debug build configuration. We recommend not translating it. - %1 Debug - - - %1 Release - Release build configuration. We recommend not translating it. - %1 Release - - - Build - Compilation - - - Build directory: - Répertoire de compilation : - - - Qbs Build - Compilation Qbs - - - Qbs Clean - Nettoyage Qbs - - - Qbs Install - Installation Qbs - - - %1 in %2 - %1 dans %2 - - - Evaluating - Évaluation - - - Failed opening project '%1': Project is not a file - Échec de l'ouverture du projet "%1" : le projet n'est pas un fichier - - - Reparse Qbs - Recommencer l'analyse Qbs - - - Build File - Compiler le fichier - - - Build File "%1" - Compiler le fichier "%1" - - - Ctrl+Alt+B - Ctrl+Alt+B - - - Build Product - Compiler le produit - - - Build Product "%1" - Compiler le produit "%1" - - - Ctrl+Alt+Shift+B - Ctrl+Alt+Shift+B - - - Could not split properties. - Impossible de séparer les propriétés. - - - No ':' found in property definition. - Aucun ":" trouvé dans la définition de la propriété. - - - The .qbs files are currently being parsed. - Les fichier .qbs sont en cours d'analyse. - - - Parsing of .qbs files has failed. - L'analyser des fichiers .qbs a échoué. - - - Qbs Run Configuration - Configuration d'exécution Qbs - - - Executable: - Exécutable : - - - Arguments: - Arguments : - - - Select Working Directory - Sélectionner le répertoire de travail - - - Reset to default - Restaurer les paramètres par défaut - - - Working directory: - Répertoire de travail : - - - Run in terminal - Exécuter dans un terminal - - - - QmlDesignerContextMenu - - Selection - Sélection - - - Stack (z) - Pile (z) - - - Edit - Éditer - - - Anchors - Ancres - - - Layout - Organisation - - - Select Parent: %1 - Sélectionner parent : %1 - - - Select: %1 - Sélectionner : %1 - - - Deselect: - Déselectionner : - - - Cut - Couper - - - Copy - Copier - - - Paste - Coller - - - Delete Selection - Supprimer la sélection - - - To Front - À l'avant-plan - - - To Back - À l'arrière-plan - - - Raise - Augmenter - - - Lower - Baisser - - - Undo - Annuler - - - Redo - Refaire - - - Visibility - Visibilité - - - Reset Size - Réinitialiser la taille - - - Reset Position - Réinitialiser la position - - - Go into Component - Aller dans le composant - - - Set Id - Définir l'identifiant - - - Reset z Property - Réinitialiser la propriété z - - - Fill - Remplir - - - Reset - Réinitialiser - - - Layout in Column (Positioner) - Organiser avec Column (Positioner) - - - Layout in Row (Positioner) - Organiser avec Row (Positioner) - - - Layout in Grid (Positioner) - Organiser avec Grid (Positioner) - - - Layout in Flow (Positioner) - Organiser avec Flow (Positioner) - - - Layout in ColumnLayout - Organiser avec ColumnLayout - - - Layout in RowLayout - Organiser avec RowLayout - - - Layout in GridLayout - Organiser avec GridLayout - - - Fill Width - Remplir en largeur - - - Fill Height - Remplir en hauteur - - - Layout in Column - Organiser avec Column - - - Layout in Row - Organiser avec Row - - - Layout in Grid - Organiser avec Grid - - - Layout in Flow - Organiser avec Flow - - - Select parent: %1 - Sélectionner le parent : %1 - - - - QmlDesigner::Internal::DebugView - - Model attached - Modèle attaché - - - FileName %1 - Nom du fichier %1 - - - DebugView is enabled - La vue de débogage est activée - - - Model detached - Modèle détaché - - - Added imports: - Imports ajoutés : - - - Removed imports: - Imports retirés : - - - Imports changed: - Imports modifiés : - - - Node created: - Nœud créé : - - - Node removed: - Nœud supprimé : - - - New parent property: - Nouvelle propriété du parent : - - - Old parent property: - Ancienne propriété du parent : - - - PropertyChangeFlag - flag correspondant au signal lancé lors du changement d'une proporiété - PropertyChangeFlag - - - Node reparanted: - Nœud reparenté : - - - New Id: - Nouvel identifiant : - - - Old Id: - Ancien identifiant : - - - New Id: - Nouvel identifiant : - - - Old Id: - Ancien identifiant : - - - Node id changed: - Identifiant du nœud modifié : - - - VariantProperties changed: - VariantProperties modifiée : - - - BindingProperties changed: - BindingProperties modifiée : - - - SignalHandlerProperties changed: - SignalHandlerProperties modifiée : - - - Properties removed: - Propriétés supprimées : - - - Auxiliary Data Changed: - Donnée auxiliaire modifiée : - - - Begin rewriter transaction - Commencer la réécriture de la transaction - - - End rewriter transaction - Finir la réécriture de la transaction - - - Debug View - Vue de débogage - - - Instance property change - Changement d'instance de propriété - - - Instance Completed - Instance complétée - - - Custom Notification: - Notification personnalisée : - - - Node Source Changed: - Nœud source modifié : - - - - QmlDesigner::FormEditorView - - Form Editor - Éditeur d'interface graphique - - - - QmlDesigner::DesignDocument - - Error - Erreur - - - - QmlDesigner::ResetWidget - - Reset All Properties - Réinitialiser toutes les propriétés - - - - QmlDesigner::Internal::MetaInfoPrivate - - Invalid meta info - Méta-information invalide - - - - QmlDesigner::Internal::MetaInfoReader - - Illegal state while parsing - État illégal lors de l'analyse - - - No property definition allowed - Aucune définition de propriété permise - - - Invalid type %1 - Type invalide %1 - - - Unknown property for Type %1 - Propriété inconnue pour le type %1 - - - Unknown property for ItemLibraryEntry %1 - Propriété inconnue pour ItemLibraryEntry %1 - - - Unknown property for Property %1 - Propriété inconnue pour Property %1 - - - Unknown property for QmlSource %1 - Propriété inconnue pour QmlSource %1 - - - Invalid or duplicate item library entry %1 - Élement d'entrée de bibliothèque invalide ou dupliqué %1 - - - - SubComponentManager::parseDirectory - - Invalid meta info - Méta-information invalide - - - - QmlDesigner::QmlDesignerPlugin - - Switch Text/Design - Basculer entre Texte/Design - - - - QmlDesigner::ShortCutManager - - &Undo - Ann&uler - - - &Redo - &Refaire - - - Delete - Supprimer - - - Delete "%1" - Supprimer "%1" - - - Cu&t - Co&uper - - - Cut "%1" - Couper "%1" - - - &Copy - &Copier - - - Copy "%1" - Copier "%1" - - - &Paste - C&oller - - - Paste "%1" - Coller "%1" - - - Select &All - Tout &sélectionner - - - Select All "%1" - Tout sélectionner "%1" - - - Toggle Full Screen - Basculer en plein écran - - - &Restore Default View - &Restaurer la vue par défaut - - - Toggle &Left Sidebar - Basculer sur la barre latérale de &gauche - - - Toggle &Right Sidebar - Basculer sur la barre latérale de &droite - - - &Go into Component - Aller dans le composant (&G) - - - Save %1 As... - Enregistrer %1 sous... - - - &Save %1 - Enregi&strer %1 - - - Revert %1 to Saved - Restaurer %1 à la version sauvegardée - - - Close %1 - Fermer %1 - - - Close All Except %1 - Fermer tout sauf %1 - - - Close Others - Fermer les autres éditeurs - - - - QtC::QmlJSTools - - Cu&t - Co&uper - - - &Copy - &Copier - - - &Paste - C&oller - - - Select &All - Tout &sélectionner - - - C&lear - &Effacer - - - Can only evaluate during a QML debug session. - Ne peut être évalué que dans une session de débogage QML. - - - Show debug, log, and info messages. - Montrer les messages de débogage, de log et d'information. - - - QML/JS Console - Console QML/JS - - - &Show in Editor - Montrer dans l'éditeur (&S) - - - - QmlApplicationWizard - - Failed to read %1 template. - Impossible de lire le modèle %1. - - - Failed to read file %1. - Impossible de lire le fichier %1. - - - - QtC::QmlProjectManager - - New Qt Quick UI Project - Nouveau projet d'IHM Qt Quick - - - This wizard generates a Qt Quick UI project. - Cet assistant génère un projet UI Qt Quick. - - - Component Set - Ensemble de composants - - - Qt Quick Application - Application Qt Quick - - - Creates a Qt Quick application project. - Créé un projet d'application Qt Quick. - - - Qt Quick UI - Interface graphique Qt Quick - - - Creates a Qt Quick UI project. - Créé un projet d'interface graphique Qt Quick. - - - System Environment - Environnement du système - - - - QtC::Qnx - - %1 does not appear to be a valid application descriptor file - %1 ne semble pas être un fichier de description d'application valide - - - - QtC::Qnx - - Application - Application - - - XML Source - Source XML - - - - QtC::Qnx - - Bar descriptor editor - Éditeur de description Bar - - - - QtC::Qnx - - Entry-Point Text and Images - Point d'entrée pour les textes et images - - - Package Information - Information du paquet - - - Author Information - Information sur l'auteur - - - General - Général - - - Permissions - Permissions - - - Environment - Environnement - - - Assets - Ressources - - - - QtC::Qnx - - Permission - Permissions - - - BlackBerry Messenger - BlackBerry Messenger - - - <html><head/><body><p>Allows this app to connect to the BBM Social Platform to access BBM contact lists and user profiles, invite BBM contacts to download your app, initiate BBM chats and share content from within your app, or stream data between apps in real time.</p></body></html> - <html><head/><body><p>Permet à cette application de se connection à la plateforme sociale BBM pour accéder à la liste des contacts BBM et aux profils utilisateurs, inviter des contacts BBM à télécharger votre application, initier des discussions BBM et partager du contenu à partir de votre application ou streamer des données entre applications en temps réel.</p></body></html> - - - Calendar - Calendrier - - - <html><head/><body><p>Allows this app to access the calendar on the device. This access includes viewing, adding, and deleting calendar appointments.</p></body></html> - <html><head/><body><p>Permet à cette application d'accéder au calendrier du périphérique. L'accès inclut la visualisation, l'ajout et la suppression de rendez-vous du calendrier.</p></body></html> - - - Camera - Caméra - - - <html><head/><body><p>Allows this app to take pictures, record video, and use the flash.</p></body></html> - <html><head/><body><p>Permet à cette application de prendre des photos, enregistrer une vidéo et utiliser le flash.</p></body></html> - - - Contacts - Contacts - - - <html><head/><body><p>Allows this app to access the contacts stored on the device. This access includes viewing, creating, and deleting the contacts.</p></body></html> - <html><head/><body><p>Permet à cette application d'accéder aux contacts stockés sur le périphérique. Cette accès inclut la visualisation, la création et la suppression de contacts.</p></body></html> - - - Device Identifying Information - Information identifiant le périphérique - - - <html><head/><body><p>Allows this app to access device identifiers such as serial number and PIN.</p></body></html> - <html><head/><body><p>Permet à cette application d'accéder aux identifiants du périphérique tels que le numéro de série et le code PIN.</p></body></html> - - - Email and PIN Messages - Emails et messages PIN - - - <html><head/><body><p>Allows this app to access the email and PIN messages stored on the device. This access includes viewing, creating, sending, and deleting the messages.</p></body></html> - <html><head/><body><p>Permet à cette application d'accéder aux emails et aux messages PIN stockés sur un périphérique. Cet accès inclut la visualisation, la création, l'envoie et la suppression des messages.</p></body></html> - - - GPS Location - Emplacement GPS - - - <html><head/><body><p>Allows this app to access the current GPS location of the device.</p></body></html> - <html><head/><body><p>Permet à cette application d'accéder à l'emplacement actuel en utilisant le GPS du périphérique.</p></body></html> - - - Internet - Internet - - - <html><head/><body><p>Allows this app to use Wi-fi, wired, or other connections to a destination that is not local on the user's device.</p></body></html> - <html><head/><body><p>Permet à cette application d'utiliser le Wi-Fi, le cable ou d'autres connexions pour une destination qui n'est pas locale au périphérique de l'utilisateur.</p></body></html> - - - Location - Emplacement - - - <html><head/><body><p>Allows this app to access the device's current or saved locations.</p></body></html> - <html><head/><body><p>Permet à cette application d'accéder aux emplacements du périphérique actuel ou sauvegardés.</p></body></html> - - - Microphone - Microphone - - - <html><head/><body><p>Allows this app to record sound using the microphone.</p></body></html> - <html><head/><body><p>Permet à cette application d'enregistrer le son provenant du microphone.</p></body></html> - - - Notebooks - Carnet de notes - - - <html><head/><body><p>Allows this app to access the content stored in the notebooks on the device. This access includes adding and deleting entries and content.</p></body></html> - <html><head/><body><p>Permet à cette application d'accéder au contenu stocké dans le carnet de notes du périphérique. Cette accès inclut l'ajout et la suppression de contenu.</p></body></html> - - - Post Notifications - Envoi de notifications - - - <html><head/><body><p>Post a notification to the notifications area of the screen.</p></body></html> - <html><head/><body><p>Envoie une notification dans la zone de notification de l'écran.</p></body></html> - - - Push - Push - - - <html><head/><body><p>Allows this app to use the Push Service with the BlackBerry Internet Service. This access allows the app to receive and request push messages. To use the Push Service with the BlackBerry Internet Service, you must register with BlackBerry. When you register, you receive a confirmation email message that contains information that your application needs to receive and request push messages. For more information about registering, visit https://developer.blackberry.com/services/push/. If you're using the Push Service with the BlackBerry Enterprise Server or the BlackBerry Device Service, you don't need to register with BlackBerry.</p></body></html> - email !!!!!!! - <html><head/><body><p>Permet à cette application d'utiliser le service Push avec le service Internet BlackBerry. Cet accès permet à l'application de recevoir et envoyer des messages push. Pour utiliser le service Push avec le service Internet BlackBerry, vous devez être enregistré auprès de BlackBerry. Lors de votre inscription, vous recevrez un courriel de confirmation qui contient les informations que votre application à besoin pour recevoir et envoyer des messages push. Pour plus d'information sur l'enregistrement, allez sur la page https://developer.blackberry.com/services/push/. Si vous utilisez le service Push avec BlackBerry Enterprise Server ou BlackBerry Device Service, vous n'avez pas besoin de vous inscrire auprès de BlackBerry.</p></body></html> - - - Run When Backgrounded - Exécuter en arrière plan - - - <html><head/><body><p>Allows background processing. Without this permission, the app is stopped when the user switches focus to another app. Apps that use this permission are rigorously reviewed for acceptance to BlackBerry App World storefront for their use of power.</p></body></html> - <html><head/><body><p>Permet d'effectuer une tâche de fond. Sans cette permission, l'application est arrêtée lorsque l'utilisateur donne le focus à une autre application. Les application qui utilisent cette permission sont vérifiés rigoureusement au niveau d'utilisation de l'énergie lors de l'acceptation sur le store BlackBerry App World.</p></body></html> - - - Shared Files - Fichiers partagés - - - <html><head/><body><p>Allows this app to access pictures, music, documents, and other files stored on the user's device, at a remote storage provider, on a media card, or in the cloud.</p></body></html> - <html><head/><body><p>Permet à cette application d'accéder aux images, musiques, documents et autres fichiers stockés sur un périphérique de l'utilisateur, chez un fournisseur de stockage, sur une carde mémoire ou dans le cloud.</p></body></html> - - - Text Messages - Messages texte - - - <html><head/><body><p>Allows this app to access the text messages stored on the device. The access includes viewing, creating, sending, and deleting text messages.</p></body></html> - <html><head/><body><p>Permet cette application d'accéder aux messages texte stockés sur le périphérique. L'accès inclut la visualisation, la création, l'envoie et la suppression de messages texte.</p></body></html> - - - - QtC::Qnx - - Path - Chemin - - - Author - Auteur - - - Active - Actif - - - - QtC::Qnx - - Could not find command '%1' in the build environment - Impossible de trouver la commande "%1" dans l'environnement de compilation - - - No hostname specified for device - Aucun nom d'hôte définit pour le périphérique - - - - QtC::Qnx - - <b>Check development mode</b> - <b>Vérifier le mode développeur</b> - - - - QtC::Qnx - - Check Development Mode - Vérifier le mode développeur - - - - QtC::Qnx - - The following errors occurred while setting up BB10 Configuration: - Les erreurs suivantes sont apparues pendant la configuration de BB10 : - - - Qt %1 for %2 - Qt %1 pour %2 - - - QCC for %1 - QCC pour %1 - - - Debugger for %1 - Débogueur pour %1 - - - The following errors occurred while activating target: %1 - Les erreurs suivantes sont apparues pendant l'activation de la cible : %1 - - - - No Qt version found. - - Aucune version de Qt trouvée. - - - - No GCC compiler found. - - Aucun compilateur GCC trouvé. - - - - No GDB debugger found for BB10 Device. - - Aucun débogueur GDB trouvé pour le périphérique BB10. - - - - No GDB debugger found for BB10 Simulator. - - Aucun débogueur GDB trouvé pour le simulateur BB10. - - - Cannot Set up BB10 Configuration - Impossible de paramétrer une configuration BB10 - - - BlackBerry Device - %1 - Périphérique BlackBerry - %1 - - - BlackBerry Simulator - %1 - Simulateur BlackBerry - %1 - - - Qt Version Already Known - Version de Qt déjà connue - - - This Qt version was already registered. - Cette version de Qt avait déjà été enregistrée. - - - Invalid Qt Version - Version de Qt invalide - - - Unable to add BlackBerry Qt version. - Impossible d'ajouter une version de Qt BlackBerry. - - - Compiler Already Known - Compilateur déjà connu - - - This compiler was already registered. - Ce compilateur avait déjà été enregistré. - - - Kit Already Known - Kit déjà connu - - - This kit was already registered. - Ce kit avait déjà été enregistré. - - - BlackBerry 10 (%1) - Simulator - BlackBerry 10 (%1) - Simulateur - - - BlackBerry 10 (%1) - BlackBerry 10 (%1) - - - - QtC::Qnx - - Failed to start blackberry-signer process. - Échec de démarrage du processus de signature BlackBerry. - - - Process timed out. - Le processus a expiré. - - - Child process has crashed. - Le processus enfant a crashé. - - - Process I/O error. - Le processus a eu une erreur d'E/S. - - - Unknown process error. - Erreur inconnue du processus. - - - - QtC::Qnx - - Error connecting to device: java could not be found in the environment. - Erreur lors de la connexion au périphérique : Java n'a pas pu être trouvé dans l'environnement. - - - - QtC::Qnx - - Keys - Clés - - - - QtC::Qnx - - NDK - NDK - - - - QtC::Qnx - - Authentication failed. Please make sure the password for the device is correct. - Échec de l'authentification. Veuillez-vous assurer que le mot de passe pour le périphérique est correct. - - - - QtC::Qnx - - BlackBerry Development Environment Setup Wizard - Assistant de paramétrage de l'environnement de développement BlackBerry - - - Reading device PIN... - Lecture du code PIN du périphérique... - - - Registering CSJ keys... - Inscription des clés CSJ... - - - Generating developer certificate... - Génération du certificat développeur... - - - Generating SSH keys... - Génération des clés SSH... - - - Requesting a debug token for the device... - Requête du jeton de débogage pour le périphérique... - - - Now uploading the debug token... - Envoi du jeton de débogage... - - - Writing device information... - Écriture des informations du périphérique... - - - Error reading device PIN. Please make sure that the specified device IP address is correct. - Erreur lors de la lecture du code PIN. Veuillez-vous assurer que l'adresse IP du périphérique est correcte. - - - Error - Erreur - - - Error creating developer certificate. - Erreur lors de la création du certificat développeur. - - - Failed to request debug token: - Échec de la requête du jeton de débogage : - - - Failed to request debug token: - Échec de la requête du jeton de débogage : - - - Wrong CSK password. - Mauvais mot de passe CSK. - - - Wrong keystore password. - Mauvais mot de passe du trousseau de clés. - - - Network unreachable. - Réseau inaccessible. - - - Illegal device PIN. - Code PIN du périphérique illégal. - - - - QtC::Qnx - - Welcome to the BlackBerry Development Environment Setup Wizard. -This wizard will guide you through the essential steps to deploy a ready-to-go development environment for BlackBerry 10 devices. - Bienvenue dans l'assistant de configuration de l'environnement de développement BlackBerry. -Cet assistant vous guidera à travers les étapes essentielles pour déployez un environnement de développement prêt à l'emloi pour les périphériques BlackBerry 10. - - - BlackBerry Development Environment Setup - Configuration de l'environnement de développement BlackBerry - - - - QtC::Qnx - - Configure the NDK Path - Confirmer le chemin du NDK - - - - QtC::Qnx - - Not enough free ports on device for debugging. - Pas assez de ports disponibles sur le périphérique pour le débogage. - - - - QtC::Qnx - - Preparing remote side... - - Préparation de la partie distante... - - - - Preparing remote side... - Préparation de la partie distante... - - - The %1 process closed unexpectedly. - Le processus %1 s'est fermé de façon inattendue. - - - Initial setup failed: %1 - Échec de la configuration initialiale : %1 - - - - BlackBerry - - BlackBerry - BlackBerry - - - - QtC::Qnx - - %1 found. - - %1 trouvé. - - - - %1 not found. - - %1 introuvable. - - - - An error occurred checking for %1. - - Une erreur est survenue lors de la vérification de %1. - - - SSH connection error: %1 - - Erreur de connexion SSH : %1 - - - %1 found. - %1 trouvé. - - - %1 not found. - %1 introuvable. - - - An error occurred checking for %1. - Une erreur est survenue lors de la vérification de %1. - - - SSH connection error: %1 - Erreur de connexion SSH : %1 - - - Checking for %1... - Recherche de %1... - - - - QtC::Qnx - - Bar descriptor file (BlackBerry) - Fichier de description Bar (BlackBerry) - - - Could not add mime-type for bar-descriptor.xml editor. - Impossible d'ajouter le type mime pour l'éditeur de bar-descriptor.xml. - - - Bar Descriptor - Description de Bar - - - - QtC::QtSupport - - All Versions - Toutes les versions - - - Full path to the host bin directory of the current project's Qt version. - Chemin complet vers le répertoire bin d'origine de la version Qt actuelle du projet. - - - Full path to the target bin directory of the current project's Qt version. You probably want %1 instead. - Chemin complet vers le répertoire bin de destination de la version Qt actuelle du projet. Vous vouliez probablement dire %1 à la place. - - - No factory found for qmake: '%1' - Aucune fabrique trouvée pour qmake : "%1" - - - - QtC::RemoteLinux - - Not enough free ports on device for debugging. - Pas assez de ports disponibles sur le périphérique pour le débogage. - - - Checking available ports... - - Vérification des ports disponibles... - - - - Checking available ports... - Vérification des ports disponibles... - - - Failure running remote process. - Échec d'exécution du processus distant. - - - Initial setup failed: %1 - Échec lors de la configuration initiale : %1 - - - Local File Path - Chemin du fichier local - - - Remote Directory - Répertoire distant - - - Clean Environment - Environnement vierge - - - System Environment - Environnement du système - - - Fetch Device Environment - Récupérer l'environnement du périphérique - - - Cancel Fetch Operation - Annuler la récupération - - - Device Error - Erreur du périphérique - - - Fetching environment failed: %1 - Échec lors de la récupération de l'environnement : %1 - - - - QtC::TextEditor - - Refactoring cannot be applied. - La refactorisation ne peut être appliquée. - - - - QtC::QmlProjectManager - - Creates a Qt Quick 1 UI project with a single QML file that contains the main view.&lt;br/&gt;You can review Qt Quick 1 UI projects in the QML Viewer and you need not build them. You do not need to have the development environment installed on your computer to create and run this type of projects.&lt;br/&gt;&lt;br/&gt;Requires &lt;b&gt;Qt 4.8&lt;/b&gt; or newer. - Crée un projet d'interface utilisateur Qt Quick 1 contenant un seul fichier QML contenant la vue principale.&lt;br/&gt;Vous pouvez revoir les projets d'interface utilisateur Qt Quick 1 dans QML Viewer sans avoir besoin de les compiler. Vous n'avez pas besoin d'un environnement de développement installé sur votre ordinateur pour créer et exécuter ce type de projet.&lt;br/&gt;&lt;br/&gt;Nécessite &lt;b&gt;Qt 4.8&lt;/b&gt; ou supérieur. - - - Creates a Qt Quick 2 UI project with a single QML file that contains the main view.&lt;br/&gt;You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. You do not need to have the development environment installed on your computer to create and run this type of projects.&lt;br/&gt;&lt;br/&gt;Requires &lt;b&gt;Qt 5.0&lt;/b&gt; or newer. - Créé un projet d'interface utilisateur Qt Quick 2 contenant un seul fichier QML contenant la vue principale.&lt;br/&gt;Vous pouvez revoir les projets d'interface utilisateur Qt Quick 2 dans QML Scene sans avoir besoin de les compiler. Vous n'avez pas besoin d'un environnement de développement installé sur votre ordinateur pour créer et exécuter ce type de projet.&lt;br/&gt;&lt;br/&gt;Nécessite &lt;b&gt;Qt 5.0&lt;/b&gt; ou supérieur. - - - Creates a Qt Quick 2 UI project with a single QML file that contains the main view and uses Qt Quick Controls.&lt;br/&gt;You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. This project requires that you have installed Qt Quick Controls for your Qt version.&lt;br/&gt;&lt;br/&gt;Requires &lt;b&gt;Qt 5.1&lt;/b&gt; or newer. - Créé un projet d'interface utilisateur Qt Quick 2 contenant un seul fichier QML contenant la vue principale et utilisant Qt Quick Controls.&lt;br/&gt;Vous pouvez revoir les projets d'interface utilisateur Qt Quick 2 dans QML Scene sans avoir besoin de les compiler. Vous n'avez pas besoin d'un environnement de développement installé sur votre ordinateur pour créer et exécuter ce type de projet.&lt;br/&gt;&lt;br/&gt;Nécessite &lt;b&gt;Qt 5.1&lt;/b&gt; ou supérieur. - - - - QtC::Android - - Target API: - API cible : - - - MiB - Mio - - - ABI: - ABI : - - - Signing a debug package - Authentifier un paquet Debug - - - Open package location after build - Ouvrir l'emplacement du paquet après la compilation - - - Verbose output - Sortie détaillée - - - Create AndroidManifest.xml - Créer le fichier AndroidManifest.xml - - - Android target SDK: - SDK Android cible : - - - Input file for androiddeployqt: - Fichier d'entrée pour androiddeployqt : - - - Qt no longer uses the folder "android" in the project's source directory. - Qt n'utilise plus le répertoire "android" dans le répertoire des sources du projet. - - - Qt Deployment - Déploiement de Qt - - - Use the external Ministro application to download and maintain Qt libraries. - Utiliser l'application externe Ministro pour télécharger et mettre à jour les bibliothèques Qt. - - - Additional Libraries - Bibliothèques supplémentaires - - - List of extra libraries to include in Android package and load on startup. - Liste des bibliothèques supplémentaires à inclure dans le paquet Android et à charger au démarrage. - - - Select library to include in package. - Sélectionner la bibliothèque à inclure dans le paquet. - - - Remove currently selected library from list. - Supprimer de la liste la bibliothèque actuellement sélectionnée. - - - Select Android Device - Sélectionner un périphérique Android - - - Refresh Device List - Rafraîchir la liste des périphériques - - - Create Android Virtual Device - Créer un périphérique virtuel Android (AVD) - - - Always use this device for architecture %1 - Toujours utiliser ce périphérique pour l'architecture %1 - - - Compatible devices - Périphériques compatibles - - - Unauthorized. Please check the confirmation dialog on your device %1. - Non autorisé. Veuillez valider la fenêtre de confirmation sur votre périphérique %1. - - - ABI is incompatible, device supports ABIs: %1. - L'ABI est incompatible, le périphérique supporte les ABI : %1. - - - API Level of device is: %1. - Le niveau de l'API pour le périphérique est : %1. - - - Incompatible devices - Périphériques incompatibles - - - - QtC::BareMetal - - Form - Formulaire - - - GDB host: - Hôte GDB : - - - GDB port: - Port GDB : - - - GDB commands: - Commandes GDB : - - - Name: - Nom : - - - localhost - localhost - - - load -monitor reset - chargement -réinitialisation du moniteur - - - - QtC::Core - - Add the file to version control (%1) - Ajouter le fichier au contrôle de version (%1) - - - Add the files to version control (%1) - Ajouter les fichiers au contrôle de version (%1) - - - - QtC::CppEditor - - Additional C++ Preprocessor Directives - Directives supplémentaires pour le préprocesseur C++ - - - Project: - Projet : - - - Additional C++ Preprocessor Directives for %1: - Directives supplémentaires pour le préprocesseur C++ pour %1 : - - - Code Completion and Semantic Highlighting - Complétion du code et surlignage sémantique - - - C - C - - - Objective C - Objective C - - - Objective C++ - Objective C++ - - - Pre-compiled Headers - En-têtes précompilés - - - <html><head/><body><p>When pre-compiled headers are not ignored, the parsing for code completion and semantic highlighting will process the pre-compiled header before processing any file.</p></body></html> - <html><head/><body><p>Lorsque les en-têtes précompilés ne sont pas ignorés, l'analyse pour la complétion du code et le surlignage sémantique sera réalisée sur les en-têtes précompilés avant de l'être sur les autres fichiers.</p></body></html> - - - Ignore pre-compiled headers - Ignorer les en-têtes précompilés - - - - QtC::Ios - - Base arguments: - Arguments de base : - - - Reset Defaults - Restaurer les paramètres par défaut - - - Extra arguments: - Arguments supplémentaires : - - - xcodebuild - xcodebuild - - - Qt Creator needs a compiler set up to build. Configure a compiler in the kit preferences. - Qt Creator requiert un compilateur. Configurez-en un dans les options de kit. - - - Configuration is faulty. Check the Issues output pane for details. - La configuration est défectueuse. Veuillez vérifier la vue des problèmes pour les détails. - - - Form - Formulaire - - - Arguments: - Arguments : - - - Executable: - Exécutable : - - - iOS Configuration - Configuration iOS - - - Ask about devices not in developer mode - Demander pour les périphériques qui ne sont pas en mode développeur - - - - QtC::ProjectExplorer - - Custom Parser - Analyseur personnalisé - - - &Error message capture pattern: - &Motif de capture des messages d'erreur : - - - #error (.*):(\d+): (.*)$ - #erreur (.*):(\d+): (.*)$ - - - Capture Positions - Position des captures - - - &File name: - Nom de &fichier : - - - &Line number: - Numéro de &ligne : - - - &Message: - &Message : - - - E&rror message: - &Message d'erreur : - - - #error /home/user/src/test.c:891: Unknown identifier `test` - #erreur /home/user/src/test.c:891: Identifiant inconnu `test` - - - File name: - Nom du fichier : - - - TextLabel - Label de texte - - - Line number: - Numéro de ligne : - - - Message: - Message : - - - Not applicable: - Non applicable : - - - Pattern is empty. - Le motif est vide. - - - Pattern does not match the error message. - Le motif ne trouve pas de correspondance dans le message d'erreur. - - - Device Test - Test de périphérique - - - Close - Fermer - - - Device test finished successfully. - Le test du périphérique s'est terminé avec succès. - - - Device test failed. - Le test du périphérique a échoué. - - - - QmlDesigner::AddTabToTabViewDialog - - Dialog - Dialogue - - - Add tab: - Ajouter un onglet : - - - - QtC::Qnx - - Debug Token - Jeton de débogage - - - Location: - Emplacement : - - - Generate - Générer - - - Debug token is needed for deploying applications to BlackBerry devices. - Le jeton de débogage est nécessaire pour déployer des applications sur les périphériques BlackBerry. - - - Type: - Type : - - - Host name or IP address: - Nom de l'hôte ou adresse IP : - - - Configuration name: - Nom de la configuration : - - - Configuration - Configuration - - - - QtC::Qnx - - Device Information - Information sur le périphérique - - - Querying device information. Please wait... - Récupération des informations du périphérique. Veuillez patienter... - - - Cannot connect to the device. Check if the device is in development mode and has matching host name and password. - Impossible de se connecter au périphérique. Veuillez vérifier si le périphérique est en mode développement et que le nom de l'hôte et le mot de passe correspondent. - - - Generating SSH keys. Please wait... - Génération des clés SSH. Veuillez patienter... - - - Failed generating SSH key needed for securing connection to a device. Error: - Échec de la génération de la clé SSH, nécessaire pour la sécurité de la connexion à un périphérique. Erreur : - - - Failed saving SSH key needed for securing connection to a device. Error: - Échec de l'enregistrement de la clé SSH, nécessaire pour la sécurité de la connexion à un périphérique. Erreur : - - - Device information retrieved successfully. - Les informations du périphérique ont été retournée avec succès. - - - - QtC::Qnx - - Select Native SDK path: - Sélectionner le chemin du SDK natif : - - - Native SDK - SDK natif - - - Specify 10.2 NDK path manually - Spécifier manuellement le chemin du NDK 10.2 - - - - QtC::Qnx - - Please wait... - Veuillez patienter... - - - Uninstalling - Désinstallation - - - Installing - Installation - - - Uninstalling target: - Cible de la désinstallation : - - - Installing target: - Cible de l'installation : - - - - QtC::Qnx - - Please select target: - Veuillez sélectionner une cible : - - - Target - Cible - - - Version - Version - - - Querying available targets. Please wait... - Récupération des cibles disponnibles. Veuillez patienter... - - - - QtC::Qnx - - Password: - Mot de passe : - - - Confirm password: - Confirmer le mot de passe : - - - Status - Statut - - - Create Developer Certificate - Créer le certificat développeur - - - The entered passwords do not match. - Les mots de passe donnés ne correspondent pas. - - - - QtC::Qnx - - Choose the Location - Choisir l'emplacement - - - Project path: - Chemin du projet : - - - - QtC::UpdateInfo - - Configure Filters - Configurer les filtres - - - Qt Creator Update Settings - Paramètres de mise à jour de Qt Creator - - - Qt Creator automatically runs a scheduled update check on a daily basis. If Qt Creator is not in use on the scheduled time or maintenance is behind schedule, the automatic update check will be run next time Qt Creator starts. - Qt Creator exécute automatiquement un contrôle des mises à jour programmé quotidiennement. Si Qt Creator n'est pas en cours d'exécution à ce moment là ou si la maintenance est en retard, la vérification automatique des mises à jour sera exécutée la prochaine fois Qt Creator démarre. - - - Run update check daily at: - Lancer la recheche quotidienne de mise à jour à : - - - - FlickableSection - - Flickable - Flickable - - - Content size - Taille du contenu - - - Flick direction - Direction du flick - - - Behavior - Comportement - - - Bounds behavior - Comportement des bords - - - Interactive - Interactif - - - Max. velocity - Vitesse maximale - - - Maximum flick velocity - Vitesse de flick maximale - - - Deceleration - Ralentissement - - - Flick deceleration - Ralentissement du flick - - - - FontSection - - Font - Police - - - Size - Taille - - - Font style - Style de police - - - Style - Style - - - - StandardTextSection - - Text - Texte - - - Wrap mode - Mode de découpage du texte - - - Alignment - Alignement - - - - AdvancedSection - - Advanced - Avancé - - - Scale - Échelle - - - Rotation - Rotation - - - - ColumnSpecifics - - Column - Colonne - - - Spacing - Espacement - - - - FlipableSpecifics - - Flipable - Flipable - - - - GeometrySection - - Geometry - Géométrie - - - Position - Position - - - Size - Taille - - - - ItemPane - - Type - Type - - - id - identifiant - - - Visibility - Visibilité - - - Is Visible - Est visible - - - Clip - Retailler - - - Opacity - Opacité - - - Layout - Layout - - - Advanced - Avancé - - - - LayoutSection - - Layout - Layout - - - Anchors - Ancres - - - Target - Cible - - - Margin - Marge - - - - QtObjectPane - - Type - Type - - - id - identifiant - - - - TextInputSection - - Text Input - Texte en entrée - - - Input mask - Masque d'entrée - - - Echo mode - Mode d'affichage - - - Pass. char - Carac. masqué - - - Character displayed when users enter passwords. - Caractère affiché quand l'utilisateur entre des mots de passe. - - - Flags - Flags - - - Read only - Lecture seule - - - Cursor visible - Curseur visible - - - Active focus on press - Activer le focus à l'appui - - - Auto scroll - Défilement automatique - - - - TextInputSpecifics - - Text Color - Couleur du texte - - - Selection Color - Couleur de la sélection - - - - TextSpecifics - - Text Color - Couleur du texte - - - Style Color - Couleur du style - - - - WindowSpecifics - - Window - Fenêtre - - - Title - Titre - - - Size - Taille - - - - SideBar - - New to Qt? - Nouveau sur Qt ? - - - Learn how to develop your own applications and explore Qt Creator. - Apprendre comment développer vos propres applications et explorer Qt Creator. - - - Get Started Now - attention à la longueur du texte, doit reste petit - Démarrer - - - Online Community - Communauté en ligne - - - Blogs - Blogs - - - User Guide - Guide utilisateur - - - - QtC::Android - - Deploy to Android device or emulator - Déployer sur un périphérique Android ou un émulateur - - - Found old folder "android" in source directory. Qt 5.2 does not use that folder by default. - Un ancien dossier "android" a été trouvé dans le répertoire des sources. Qt 5.2 n'utilise plus ce dossier par défaut. - - - No Android arch set by the .pro file. - Aucun architecture Android n'est définie dans le fichier .pro. - - - Failed to run keytool. - Échec d'exécution de keytool. - - - Invalid password. - Mot de passe invalide. - - - Select additional libraries - Sélectionner les bibliothèques supplémentaires - - - Libraries (*.so) - Bibliothèques (*.so) - - - Android: SDK installation error 0x%1 - Android : erreur d'installation du SDK 0x%1 - - - Android: NDK installation error 0x%1 - Android : erreur d'installation du NDK 0x%1 - - - Android: Java installation error 0x%1 - Android : erreur d'installation de Java 0x%1 - - - Android: ant installation error 0x%1 - Android : erreur d'installation de ant 0x%1 - - - Android: adb installation error 0x%1 - Android : erreur d'installation de adb 0x%1 - - - Android: Device connection error 0x%1 - Android : erreur de connexion du périphérique 0x%1 - - - Android: Device permission error 0x%1 - Android : erreur de permission du périphérique 0x%1 - - - Android: Device authorization error 0x%1 - Android : Erreur d'autorisation du périphérique 0x%1 - - - Android: Device API level not supported: error 0x%1 - Android : le niveau d'API du périphérique n'est pas supporté : erreur 0x%1 - - - Android: Unknown error 0x%1 - Android : errreur inconnue 0x%1 - - - <b>Make install</b> - <b>Installation de make</b> - - - Make install - Installation de make - - - Qt Creator needs additional settings to enable Android support.You can configure those settings in the Options dialog. - Qt Creator a besoin de paramètres supplémentaires pour activer le support Android. Vous pouvez configurer ces paramètres dans le dialogue Options. - - - Open Settings - Ouvrir les préférences - - - No application .pro file found in this project. - Aucun fichier d'application .pro n'a été trouvé dans ce projet. - - - No Application .pro File - Aucun ficher d'application .pro - - - Select the .pro file for which you want to create an AndroidManifest.xml file. - Sélectionner un fichier .pro pour lequel vous souhaitez créer un fichier AndroidManifest.xml. - - - .pro file: - Fichier .pro : - - - Select a .pro File - Sélectionner un fichier .pro - - - Android package source directory: - Répertoire des sources du paquet Android : - - - Select the Android package source directory. The files in the Android package source directory are copied to the build directory's Android directory and the default files are overwritten. - Sélectionner le répertoire des sources du paquet Android. Les fichiers dans ce répertoire seront copiés dans le répertoire de compilation d'Android et les fichiers par défaut seront remplacés. - - - The Android manifest file will be created in the ANDROID_PACKAGE_SOURCE_DIR set in the .pro file. - Le fichier manifest Android sera créé dans le répertoire défini dans le fichier .pro par le paramètre ANDROID_PACKAGE_SOURCE_DIR. - - - Create Android Manifest Wizard - Créer l'assistant pour le manifest Android - - - Overwrite AndroidManifest.xml - Remplacer le fichier AndroidManifest.xml - - - Overwrite existing AndroidManifest.xml? - Remplacer le fichier existant AndroidManifest.xml ? - - - File Removal Error - Erreur de suppression du fichier - - - Could not remove file %1. - Impossible de supprimer le fichier %1. - - - File Creation Error - Erreur de création du fichier - - - Could not create file %1. - Impossible de créer le fichier %1. - - - Project File not Updated - Le fichier de projet n'a pas été mis à jour - - - Could not update the .pro file %1. - Impossible de mettre à jour le fichier .pro %1. - - - - QtC::BareMetal - - Bare Metal - Bare Metal - - - Bare Metal Device - Périphérique Bare Metal - - - New Bare Metal Device Configuration Setup - Nouveau paramètres de configuration du périphérique Bare Metal - - - Set up GDB Server or Hardware Debugger - Définir un serveur GDB ou un débogueur hardware - - - GDB commands - Commandes GDB - - - %1 (via GDB server or hardware debugger) - %1 (via le serveur GDB ou le débogueur hardware) - - - Run on GDB server or hardware debugger - Bare Metal run configuration default run name - Exécuter sur un serveur GDB ou un débogueur hardware - - - %1 (on GDB server or hardware debugger) - %1 (via le serveur GDB ou le débogueur hardware) - - - Executable: - Exécutable : - - - Arguments: - Arguments : - - - <default> - <par défaut> - - - Working directory: - Répertoire de travail : - - - Unknown - Inconnue - - - Cannot debug: Kit has no device. - Impossible de déboguer : le kit n'a pas de périphérique. - - - - QtC::Core - - <no document> - <aucun document> - - - No document is selected. - Aucun document est sélectionné. - - - - QtC::CppEditor - - No include hierarchy available - Aucune hiérarchie d'inclusion est disponible - - - Include Hierarchy - Hiérarchie d'inclusion - - - Includes - Inclusions - - - Included by - Inclut par - - - (none) - (aucun) - - - (cyclic) - (cyclique) - - - - QtC::TextEditor - - Create Getter and Setter Member Functions - Créer des fonctions membres accesseurs et mutateurs - - - Generate Missing Q_PROPERTY Members... - Générer les membre Q_PROPERTY manquant... - - - - QtC::CppEditor - - ...searching overrides - ... recherche des surcharges - - - - ModelManagerSupportInternal::displayName - - Qt Creator Built-in - Compilation Qt Creator - - - - QtC::Debugger - - Not recognized - Non reconnu - - - Debuggers - Débogueurs - - - Add - Ajouter - - - Clone - Cloner - - - Clone of %1 - Clone de %1 - - - New Debugger - Nouveau débogueur - - - Auto-detected CDB at %1 - Autodétection CDB à %1 - - - System %1 at %2 - %1: Debugger engine type (GDB, LLDB, CDB...), %2: Path - %1 du système à %2 - - - Extracted from Kit %1 - Extrait depuis le kit %1 - - - Auto-detected - Autodétecté - - - Manual - Manuel - - - Path - Chemin - - - Type - Type - - - Path: - Chemin : - - - ABIs: - ABI : - - - 64-bit version - Version 64 bits - - - 32-bit version - Version 32 bits - - - Open Qt Options - Ouvrir les options de Qt - - - Turn off Helper Usage - Arrêter l'utilisation de l'assistant - - - Continue Anyway - Continuer malgré tout - - - Debugging Helper Missing - L'assistance au débogage est manquante - - - The debugger could not load the debugging helper library. - Le débogueur n'a pas pu charger la bibliothèque d'assistance au débogage. - - - The debugging helper is used to nicely format the values of some Qt and Standard Library data types. It must be compiled for each used Qt version separately. In the Qt Creator Build and Run preferences page, select a Qt version, expand the Details section and click Build All. - L'assistant au débogage est utilisé pour formater correctement les valeurs selon les types de données fournit par Qt et les bibliothèques standards. Il doit être compilé pour chaque versions de Qt séparément. Dans la page de préférences Compiler et Exécuter de Qt Creator, sélectionnez une version de Qt, développez la section Détails et cliquez sur Tout Construire. - - - Starting executable failed: - Échec du lancement de l'exécutable : - - - Cannot set up communication with child process: %1 - Impossible de mettre en place la communication avec le processus enfant : %1 - - - - ShowEditor - - Show Editor - Afficher l'éditeur - - - - QtC::DiffEditor - - Hide Change Description - Masquer la description des changements - - - Show Change Description - Afficher la description des changements - - - - QtC::Git - - Switch to Text Diff Editor - Basculer vers l'éditeur texte de différences - - - Switch to Side By Side Diff Editor - Basculer vers l'éditeur de différences face à face - - - - QtC::Ios - - iOS build - iOS BuildStep display name. - Compilation iOS - - - %1 %2 - %1 %2 - - - Could not get debug server file descriptor. - Impossible de récupérer le fichier de description du serveur de débogage. - - - Got an invalid process id. - L'identifiant de processus est invalide. - - - Run failed unexpectedly. - L'exécution a échoué de façon inattendu. - - - Deploy to iOS - Déploiement sur iOS - - - Deploy on iOS - Déploiement sur iOS - - - Deploy to %1 - Déploiement sur %1 - - - Error: no device available, deploy failed. - Erreur : aucun périphérique n'est disponible, le déploiement a échoué. - - - Deployment failed. No iOS device found. - Échec lors du déploiement. Aucun périphérique iOS n'a été trouvé. - - - Deployment failed. The settings in the Organizer window of Xcode might be incorrect. - Échec lors du déploiement. Les paramètres dans le fenêtre Organizer de Xcode sont peut-être incorrecte. - - - Deployment failed. - Échec lors du déploiement. - - - The Info.plist might be incorrect. - Le fichier Info.plist est peut-être incorrecte. - - - Deploy to iOS device or emulator - Déploiement sur un périphérique iOS ou un émulateur - - - <b>Deploy to %1</b> - <b>Déploiement sur %1</b> - - - iOS Device - Périphérique iOS - - - Device name - Nom du périphérique - - - Developer status - Whether the device is in developer mode. - Statut du lmode développeur - - - Connected - Connecté - - - yes - oui - - - no - non - - - unknown - inconnu - - - An iOS device in user mode has been detected. - Un périphérique iOS en mode utilisateur a été détecté. - - - Do you want to see how to set it up for development? - Voulez-vous voir comment l'activer pour le développement ? - - - Failed to detect the ABIs used by the Qt version. - Échec de la détection des ABI utilisées par la version de Qt. - - - iOS - Qt Version is meant for Ios - iOS - - - Run on %1 - Exécuter sur %1 - - - iOS run settings - Paramètres d'exécution iOS - - - Starting remote process. - Démarrage des processus distants. - - - Run ended unexpectedly. - L'exécution s'est terminée de façon inattendu. - - - Run failed. The settings in the Organizer window of Xcode might be incorrect. - Échec lors de l'exécution. Les paramètres dans le fenêtre Organizer de Xcode sont peut-être incorrecte. - - - The device is locked, please unlock. - Le périphérique est verouillé, veuillez le dévérouiller. - - - iOS Configurations - Configurations iOS - - - iOS Simulator - Simulateur iOS - - - Subprocess Error %1 - Erreur du sous-processus %1 - - - iOS tool Error %1 - Erreur de l'outil iOS %1 - - - - QtC::Macros - - Macro mode. Type "%1" to stop recording and "%2" to play the macro. - Mode macro. Tapez "%1" pour arrêter l'enregistrement et "%2" pour le lancer. - - - - QtC::ProjectExplorer - - ICC - ICC - - - Cannot kill process with pid %1: %2 - Impossible de tuer le processus avec le pid %1 : %2 - - - Cannot interrupt process with pid %1: %2 - Impossible d'interrompre le processus avec le pid %1 : %2 - - - Cannot open process. - Impossible d'ouvrir le processus. - - - Invalid process id. - L'identifiant de processus est invalide. - - - Cannot open process: %1 - Impossible d'ouvrir le processus : %1 - - - DebugBreakProcess failed: - DebugBreakProcessus a échoué : - - - %1 does not exist. If you built Qt Creator yourself, check out http://qt.gitorious.org/qt-creator/binary-artifacts. - %1 n'existe pas. Si vous avez compilé Qt Creator vous même, vérifiez http://qt.gitorious.org/qt-creator/binary-artifacts. - - - Cannot start %1. Check src\tools\win64interrupt\win64interrupt.c for more information. - Impossible de démarrer %1. Vérifier src\tools\win64interrupt\win64interrupt.c pour plus d'information. - - - could not break the process. - Impossible d'interrompre le processus. - - - Failed to kill remote process: %1 - Impossible de tuer le processus distant : %1 - - - Timeout waiting for remote process to finish. - Le délai d'attente est dépassé pour processus distant pour terminer. - - - Terminated by request. - Terminé par une requête. - - - Import Build From... - Importer la compilation depuis... - - - Import - Importer - - - The process can not access the file because it is being used by another process. -Please close all running instances of your application before starting a build. - Le processus ne peut pas accéder au fichier parce que celui-ci est utilisé par un autre processus. -Veuillez fermer toutes les instances de votre application en cours d'exécution avant de lancer une compilation. - - - %1 - temporary - %1 – temporaire - - - <span style=" font-weight:600;">No valid kits found.</span> - <span style=" font-weight:600;">Aucun kit valide trouvé.</span> - - - Please add a kit in the <a href="buildandrun">options</a> or via the maintenance tool of the SDK. - Veuillez ajouter un kit dans le menu <a href="buildandrun">options</a> ou avec l'outil de maintenance du SDK. - - - Select Kits for Your Project - Selectionner un kit pour votre projet - - - Kit Selection - Sélection de kit - - - Qt Creator can use the following kits for project <b>%1</b>: - %1: Project name - Qt Creator peut utiliser les kits suivant pour le projet <b>%1</> : - - - <b>Error:</b> - Severity is Task::Error - <b>Erreur :</b> - - - <b>Warning:</b> - Severity is Task::Warning - <b>Avertissement :</b> - - - Configure Project - Configurer le projet - - - Cancel - Annuler - - - The project <b>%1</b> is not yet configured.<br/>Qt Creator cannot parse the project, because no kit has been set up. - Le projet <b>%1</b> n'est pas encore configuré. <br/>Qt Creator ne peut analyser le projet, car aucun kit n'a été défini. - - - The project <b>%1</b> is not yet configured.<br/>Qt Creator uses the kit <b>%2</b> to parse the project. - Le projet <b>%1</b> n'est pas encore configuré.<br/>Qt Creator utilise le kit <b>%2</b> pour analyser le projet. - - - The project <b>%1</b> is not yet configured.<br/>Qt Creator uses the <b>invalid</b> kit <b>%2</b> to parse the project. - Le projet <b>%1</b> n'est pas encore configuré.<br/>Qt Creator utilise le kit <b>invalide</b> <b>%2</b> pour analyser le projet. - - - - QtC::Python - - - QtC::QmakeProjectManager - - The .pro file '%1' is currently being parsed. - Le fichier de projet "%1" est en cours d'analyse. - - - Run on QVFb - Exécuter sur QVFb - - - Check this option to run the application on a Qt Virtual Framebuffer. - Cocher cette option pour exécuter l'application sur un framebuffer virtuel Qt. - - - No build found in %1 matching project %2. - Pas de compilation trouvée dans %1 pour le projet %2 correspondant. - - - Select Qt Quick Component Set - Sélectionner l'ensemble des composant Qt Quick - - - Qt Quick component set: - Ensemble de composants Qt Quick : - - - - TabViewToolAction - - Add Tab... - Ajouter un onglet... - - - - QmlDesigner::TabViewDesignerAction - - Naming Error - Erreur de nommage - - - Component already exists. - Le composant existe déjà. - - - - QmlDesigner::ImportLabel - - Remove Import - Supprimer l'importation - - - - ImportManagerComboBox - - Add new import - Ajouter une nouvelle importation - - - <Add Import> - <Ajouter l'importation> - - - - QmlDesigner::ImportsWidget - - Import Manager - Importer un gestionnaire - - - - FileResourcesModel - - Open File - Ouvrir le fichier - - - - QmlDesigner::PropertyEditorView - - Properties - Propriétés - - - Invalid Id - Identifiant invalide - - - %1 is an invalid id. - %1 n'est pas un identifiant valide. - - - %1 already exists. - %1 existe déjà. - - - - QtC::QmlProfiler - - No executable file to launch. - Pas de fichier d'exécutable à lancer. - - - QML Profiler (External) - QML Profiler (externe) - - - Animations - Animations - - - Error while parsing trace data file: %1 - Erreur pendant l'analyse le fichier de données de traçage : %1 - - - Compile - Compilation - - - - QtC::QmlProjectManager - - Invalid root element: %1 - L'élément racine est invalide : %1 - - - Select Qt Quick Component Set - Sélectionner l'ensemble des composant Qt Quick - - - Qt Quick component set: - Ensemble de composants Qt Quick : - - - - QtC::Qnx - - NDK Already Known - Le NDK est déjà connu - - - The NDK already has a configuration. - Le NDK a déjà une configuration. - - - - QtC::Qnx - - BlackBerry NDK Installation Wizard - Assistant d'installation du NDK BlackBerry - - - Confirmation - Confirmation - - - Are you sure you want to cancel? - Êtes-vous sûr de vouloir annuler ? - - - - QtC::Qnx - - Options - Options - - - Install New Target - Installer une nouvelle cible - - - Add Existing Target - Ajouter une cible existante - - - - QtC::Qnx - - An error has occurred while adding target from: - %1 - Une erreur est apparue lors de l'ajout d'une cible depuis : - %1 - - - Target is being added. - La cible a été ajoutée. - - - Target is already added. - La cible a déjà été ajoutée. - - - Finished uninstalling target: - %1 - L'installation de la cible ne s'est pas terminée : - %1 - - - Finished installing target: - %1 - L'installation de la cible s'est terminée : - %1 - - - An error has occurred while uninstalling target: - %1 - Une erreur est apparue lors de la désinstallation d'une cible : - %1 - - - An error has occurred while installing target: - %1 - Une erreur est apparue lors de l'installation d'une cible : - %1 - - - - QtC::Qnx - - Please provide your bbidtoken.csk PIN. - Veuillez fournir votre code PIN bbidtoken.csk. - - - Please enter your certificate password. - Veuillez entrer votre mot de passe du certificat. - - - - BarDescriptorConverter - - Setting asset path: %1 to %2 type: %3 entry point: %4 - Définir le chemin de l'asset : %1 à %2, type : %3, point d'entré : %4 - - - Removing asset path: %1 - Supprimer le chemin de l'asset : %1 - - - Replacing asset source path: %1 -> %2 - Remplacer le chemin source de l'asset : %1 -> %2 - - - Cannot find image asset definition: <%1> - Impossible de trouver la définition de l'image de l'asset : <%1> - - - Error parsing XML file '%1': %2 - Erreur d'analyse du fichier XML "%1" : %2 - - - - QtC::Qnx - - Import Existing Momentics Cascades Project - Importer un projet Momentics Cascades existant - - - Momentics Cascades Project Name and Location - Nom et emplacement du projet Momentics Cascades - - - Project Name and Location - Nom du projet et emplacement - - - Momentics - Momentics - - - - QtC::Qnx - - Momentics Cascades Project - Projet Momentics Cascades - - - Imports existing Cascades projects created within QNX Momentics IDE. This allows you to use the project in Qt Creator. - Importer un projet Cascades existant créé avec l'IDE QNX Momentics. Ceci vous permet d'utiliser le projet dans Qt Creator. - - - Error generating file '%1': %2 - Erreur lors de la génération du fichier "%1" : %2 - - - - FileConverter - - ===== Converting file: %1 - ===== Fichier de conversion : %1 - - - - ImportLogConverter - - Generated by cascades importer ver: %1, %2 - Généré par l'importateur Cascades : %1, %2 - - - - ProjectFileConverter - - File '%1' not listed in '%2' file, should it be? - Le fichier "%1" n'est pas listé dans le fichier "%2", devrait-il y être ? - - - - QtC::Qnx - - Warning: "slog2info" is not found on the device, debug output not available! - Avertissement : "slog2info" n'a pas été trouvé dans le périphérique, la sortie de débogage n'est pas disponible ! - - - - QtC::Qnx - - QCC - QCC - - - - QtC::Qnx - - &Compiler path: - Chemin du &compilateur : - - - NDK/SDP path: - SDP refers to 'Software Development Platform'. - Chemin du NDK/SDP : - - - &ABI: - &ABI : - - - - QtC::Qnx - - Cannot show slog2info output. Error: %1 - Impossible d'afficher la sortie de slog2info. Erreur : %1 - - - - QtC::QtSupport - - Qt Versions - Versions de Qt - - - - QtC::RemoteLinux - - Exit code is %1. stderr: - Le code de sortie %1. stderr : - - - - QtC::UpdateInfo - - - QtC::Valgrind - - Profiling %1 - Profilage de %1 - - - Analyzing Memory - Analyse de la mémoire - - - Analyzing memory of %1 - Analyse de la mémoire de %1 - - - - QtC::Debugger - - Memory Analyzer Tool finished, %n issues were found. - - L'outil Memory Analyzer est terminé, %n problème a été trouvé. - L'outil Memory Analyzer est terminé, %n problèmes ont été trouvés. - - - - Memory Analyzer Tool finished, no issues were found. - L'outil Memory Analyzer est terminé, auncu problème a été trouvé. - - - Log file processed, %n issues were found. - - Le fichier de log a été analysé, %n problème a été trouvé. - Le fichier de log a été analysé, %n problèmes ont été trouvés. - - - - Log file processed, no issues were found. - Le fichier de log a été analysé, aucun problème a été trouvé. - - - Debug - Debug - - - Release - Release - - - Tool - Outil - - - Run %1 in %2 Mode? - Lancer %1 en mode %2 ? - - - <html><head/><body><p>You are trying to run the tool "%1" on an application in %2 mode. The tool is designed to be used in %3 mode.</p><p>Debug and Release mode run-time characteristics differ significantly, analytical findings for one mode may or may not be relevant for the other.</p><p>Do you want to continue and run the tool in %2 mode?</p></body></html> - <html><head/><body><p>Vous essayez d'exécuter l'outil "%1" sur une application en mode %2. L'outil a été conçu pour être utilisé dans le mode %3.</p><p>Les modes Debug et Release ont des caratéristiques d'exécution très différentes, les résultats de l'analyse dans un mode peuvent être ou ne pas être pertinentes pour un autre mode.</p><p>Souhaitez-vous continuer et exécuter l'outil dans le mode %2 ?</p></body></html> - - - - QtC::Valgrind - - Command line arguments: %1 - Arguments de la commande : %1 - - - Analyzing finished. - L'analyse est terminée. - - - Error: "%1" could not be started: %2 - Erreur : "%1" ne peux pas démarrer : %2 - - - Error: no Valgrind executable set. - Erreur : aucun exécutable Valgring est défini. - - - Process terminated. - Le processus s'est terminé. - - - Valgrind - Valgrind - - - Valgrind Function Profile uses the "callgrind" tool to record function calls when a program runs. - Le profileur Valgrind utilise l'outil "callgrind" pour enregistrer les appels de fonction quand un programme est lancé. - - - Valgrind Analyze Memory uses the "memcheck" tool to find memory leaks. - L'analyseur de mémoire Valgrind utilise l'outil "memcheck" pour trouver les fuites mémoires. - - - Valgrind Memory Analyzer - Analyseur de mémoire Valgrind - - - Valgrind Memory Analyzer (Remote) - Analyseur de mémoire Valgrind (distant) - - - Valgrind Function Profiler (Remote) - Profileur de fonction de Valgrind (distant) - - - Profile Costs of This Function and Its Callees - Estimer les coûts de cette fonction et de fonctions qu'elle appelle - - - Could not determine remote PID. - Impossible de déterminer le PID distant. - - - Valgrind Settings - Paramètres de Valgrind - - - - QtC::QmlProjectManager - - Creates a Qt Quick 1 UI project with a single QML file that contains the main view. You can review Qt Quick 1 UI projects in the QML Viewer and you need not build them. You do not need to have the development environment installed on your computer to create and run this type of project. Requires Qt 4.8 or newer. - Crée un projet d'interface utilisateur Qt Quick 1 avec un seul fichier QML qui contient la vue principale. Vous pouvez vérifier les projets d''interface utilisateur Qt Quick 1 dans le QML Viewer, sans devoir les compiler. Il n'est pas nécessaire d'avoir un environnement de développement installé sur votre ordinateur pour créer et exécuter ce type de projets. Nécessite Qt 4.8 ou plus récent. - - - Qt Quick 1.1 - Qt Quick 1.1 - - - Creates a Qt Quick 2 UI project with a single QML file that contains the main view. You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. You do not need to have the development environment installed on your computer to create and run this type of project. Requires Qt 5.0 or newer. - Crée un projet d'interface utilisateur Qt Quick 2 avec un seul fichier QML qui contient la vue principale. Vous pouvez vérifier les projets d''interface utilisateur Qt Quick 2 dans le QML Scene, sans devoir les compiler. Il n'est pas nécessaire d'avoir un environnement de développement installé sur votre ordinateur pour créer et exécuter ce type de projets. Nécessite Qt 5.0 ou plus récent. - - - Qt Quick 2.0 - Qt Quick 2.0 - - - Creates a Qt Quick 2 UI project with a single QML file that contains the main view and uses Qt Quick Controls. You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. This project requires that you have installed Qt Quick Controls for your Qt version. Requires Qt 5.1 or newer. - Crée un projet d'interface utilisateur Qt Quick 2 avec un seul fichier QML qui contient la vue principale et qui utilise les Qt Quick Controls. Vous pouvez vérifier les projets d''interface utilisateur Qt Quick 2 dans le QML Scene, sans devoir les compiler. Ce projet nécessite que vous ayez installé les Qt Quick Controls pour votre version de Qt. Nécessite Qt 5.1 ou plus récent. - - - Qt Quick Controls 1.0 - Qt Quick Controls 1.0 - - - - QtC::QmakeProjectManager - - Creates a deployable Qt Quick 1 application using the QtQuick 1.1 import. Requires Qt 4.8 or newer. - Crée une application Qt Quick 1 déployable utilisant l'importation de QtQuick 1.1. Nécessite Qt 4.8 ou plus récent. - - - Qt Quick 1.1 - Qt Quick 1.1 - - - Creates a deployable Qt Quick 2 application using the QtQuick 2.0 import. Requires Qt 5.0 or newer. - Crée une application Qt Quick 2 déployable utilisant l'importation de QtQuick 2.0. Nécessite Qt 5.0 ou plus récent. - - - Qt Quick 2.0 - Qt Quick 2.0 - - - Creates a deployable Qt Quick 2 application using Qt Quick Controls. Requires Qt 5.1 or newer. - Crée une application Qt Quick 2 déployable utilisant les Qt Quick Controls. Nécessite Qt 5.1 ou plus récent. - - - Qt Quick Controls 1.0 - Qt Quick Controls 1.0 - - From 03aeee71f4cbadde997dd5d1c87d9629249832f2 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Fri, 16 Jun 2023 15:28:50 +0200 Subject: [PATCH 0032/1777] DAP: Add showing locals and stack trace Change-Id: I5298b4c2daf45ec4503d4a210e02b7025253c054 Reviewed-by: hjk --- src/plugins/debugger/dap/dapengine.cpp | 188 ++++++++++++------------- src/plugins/debugger/dap/dapengine.h | 14 +- 2 files changed, 99 insertions(+), 103 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 90c0e5d99a0..9be5fe84223 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -114,7 +114,7 @@ void DapEngine::setupEngine() { QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); - connect(&m_proc, &Process::started, this, &DapEngine::handleDabStarted); + connect(&m_proc, &Process::started, this, &DapEngine::handleDapStarted); connect(&m_proc, &Process::done, this, &DapEngine::handleDapDone); connect(&m_proc, &Process::readyReadStandardOutput, this, &DapEngine::readDapStandardOutput); connect(&m_proc, &Process::readyReadStandardError, this, &DapEngine::readDapStandardError); @@ -126,7 +126,7 @@ void DapEngine::setupEngine() m_proc.setEnvironment(rp.debugger.environment); m_proc.setCommand(cmd); m_proc.start(); - notifyEngineRunAndInferiorRunOk(); + notifyEngineSetupOk(); } // From the docs: @@ -140,9 +140,8 @@ void DapEngine::setupEngine() // * client sends other future configuration requests // * client sends one configurationDone request to indicate the end of the configuration. -void DapEngine::handleDabStarted() +void DapEngine::handleDapStarted() { - notifyEngineSetupOk(); QTC_ASSERT(state() == EngineRunRequested, qDebug() << state()); // CHECK_STATE(EngineRunRequested); @@ -156,10 +155,10 @@ void DapEngine::handleDabStarted() }} }); - qDebug() << "handleDabStarted"; + qDebug() << "handleDapStarted"; } -void DapEngine::handleDabConfigurationDone() +void DapEngine::handleDapConfigurationDone() { QTC_ASSERT(state() == EngineRunRequested, qDebug() << state()); @@ -167,11 +166,11 @@ void DapEngine::handleDabConfigurationDone() postDirectCommand({{"command", "configurationDone"}, {"type", "request"}}); - qDebug() << "handleDabConfigurationDone"; + qDebug() << "handleDapConfigurationDone"; } -void DapEngine::handleDabLaunch() +void DapEngine::handleDapLaunch() { QTC_ASSERT(state() == EngineRunRequested, qDebug() << state()); @@ -184,7 +183,7 @@ void DapEngine::handleDabLaunch() {"__restart", ""} }} }); - qDebug() << "handleDabLaunch"; + qDebug() << "handleDapLaunch"; } void DapEngine::interruptInferior() @@ -195,7 +194,7 @@ void DapEngine::interruptInferior() }); } -void DapEngine::dabStackTrace() +void DapEngine::dapStackTrace() { if (m_currentThreadId == -1) return; @@ -206,16 +205,39 @@ void DapEngine::dabStackTrace() {"arguments", QJsonObject{ {"threadId", m_currentThreadId}, {"startFrame", 0}, - {"levels", 1} + {"levels", 10} + }} + }); +} + +void DapEngine::dapScopes() +{ + postDirectCommand({ + {"command", "scopes"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"frameId", 0} }} }); } void DapEngine::threads() { - postDirectCommand( - {{"command", "threads"}, - {"type", "request"}}); + postDirectCommand({ + {"command", "threads"}, + {"type", "request"} + }); +} + +void DapEngine::dapVariables(int variablesReference) +{ + postDirectCommand({ + {"command", "variables"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"variablesReference", variablesReference} + }} + }); } void DapEngine::executeStepIn(bool) @@ -628,7 +650,7 @@ void DapEngine::handleOutput(const QJsonDocument &data) if (command == "configurationDone") { showMessage("configurationDone", LogDebug); qDebug() << "configurationDone success"; - notifyInferiorRunOk(); + notifyEngineRunAndInferiorRunOk(); return; } @@ -650,9 +672,32 @@ void DapEngine::handleOutput(const QJsonDocument &data) const int line = stackFrame.value("line").toInt(); qDebug() << "stackTrace success" << file << line; gotoLocation(Location(file, line)); + + refreshStack(stackFrames); + dapScopes(); return; } + if (command == "scopes") { + if (ob.value("success").toBool()) { + auto scopes = ob.value("body").toObject().value("scopes").toArray(); + for (auto scope : scopes) { + const QString name = scope.toObject().value("name").toString(); + const int variablesReference = scope.toObject().value("variablesReference").toInt(); + qDebug() << "scoped success" << name << variablesReference; + if (name == "Locals") + dapVariables(variablesReference); + } + } + } + + if (command == "variables") { + if (ob.value("success").toBool()) { + auto variables = ob.value("body").toObject().value("variables").toArray(); + refreshLocals(variables); + } + } + if (command == "stepIn" || command == "stepOut" || command == "next") { if (ob.value("success").toBool()) { showMessage(command, LogDebug); @@ -665,6 +710,7 @@ void DapEngine::handleOutput(const QJsonDocument &data) if (command == "threads") { QJsonArray threads = ob.value("body").toObject().value("threads").toArray(); + if (threads.isEmpty()) return; @@ -712,13 +758,12 @@ void DapEngine::handleOutput(const QJsonDocument &data) if (event == "initialized") { showMessage(event, LogDebug); qDebug() << "initialize success"; - handleDabLaunch(); - handleDabConfigurationDone(); + handleDapLaunch(); + handleDapConfigurationDone(); return; } if (event == "stopped") { - ThreadsHandler *handler = threadsHandler(); m_currentThreadId = body.value("threadId").toInt(); showMessage(event, LogDebug); if (body.value("reason").toString() == "breakpoint") { @@ -729,15 +774,12 @@ void DapEngine::handleOutput(const QJsonDocument &data) gotoLocation(Location(params.fileName, params.textPosition)); } - if (body.value("reason").toString() == "pause" - || body.value("reason").toString() == "step") { - dabStackTrace(); - } - if (state() == InferiorStopRequested) notifyInferiorStopOk(); else notifyInferiorSpontaneousStop(); + + dapStackTrace(); threads(); return; } @@ -760,7 +802,6 @@ void DapEngine::handleOutput(const QJsonDocument &data) if (body.value("reason").toString() == "new") { if (breakpoint.value("verified").toBool()) { -// bp->setPending(false); notifyBreakpointInsertOk(bp); qDebug() << "breakpoint inserted"; } else { @@ -790,38 +831,41 @@ void DapEngine::handleOutput(const QJsonDocument &data) showMessage("UNKNOWN TYPE:" + type); } -void DapEngine::refreshLocals(const GdbMi &vars) +void DapEngine::refreshLocals(const QJsonArray &variables) { - WatchHandler *handler = watchHandler(); - handler->resetValueCache(); - handler->insertItems(vars); - handler->notifyUpdateFinished(); - - updateToolTips(); + watchHandler()->notifyUpdateStarted(); + for (auto variable : variables) { + WatchItem *item = new WatchItem; + const QString name = variable.toObject().value("name").toString(); + item->iname = "local." + name; + item->name = name; + item->type = variable.toObject().value("type").toString(); + item->value = variable.toObject().value("value").toString(); + item->address = variable.toObject().value("address").toInt(); + item->type = variable.toObject().value("type").toString(); + qDebug() << "variable" << name << item->hexAddress(); + watchHandler()->insertItem(item); + } + watchHandler()->notifyUpdateFinished(); } -void DapEngine::refreshStack(const GdbMi &stack) +void DapEngine::refreshStack(const QJsonArray &stackFrames) { StackHandler *handler = stackHandler(); StackFrames frames; - for (const GdbMi &item : stack["frames"]) { + for (const auto &value : stackFrames) { StackFrame frame; - frame.level = item["level"].data(); - frame.file = FilePath::fromString(item["file"].data()); - frame.function = item["function"].data(); - frame.module = item["function"].data(); - frame.line = item["line"].toInt(); - frame.address = item["address"].toAddress(); - GdbMi usable = item["usable"]; - if (usable.isValid()) - frame.usable = usable.data().toInt(); - else - frame.usable = frame.file.isReadableFile(); + QJsonObject item = value.toObject(); + frame.level = item.value("id").toString(); + frame.function = item.value("name").toString(); + frame.line = item.value("line").toInt(); + QJsonObject source = item.value("source").toObject(); + frame.file = FilePath::fromString(source.value("path").toString()); + frame.address = item.value("instructionPointerReference").toInt(); + frame.usable = frame.file.isReadableFile(); frames.append(frame); } - bool canExpand = stack["hasmore"].toInt(); - //action(ExpandStack)->setEnabled(canExpand); - handler->setFrames(frames, canExpand); + handler->setFrames(frames, false); int index = stackHandler()->firstUsableIndex(); handler->setCurrentIndex(index); @@ -837,22 +881,6 @@ void DapEngine::updateAll() void DapEngine::updateLocals() { -// DebuggerCommand cmd("updateData"); -// cmd.arg("nativeMixed", isNativeMixedActive()); -// watchHandler()->appendFormatRequests(&cmd); -// watchHandler()->appendWatchersAndTooltipRequests(&cmd); - -// const bool alwaysVerbose = qtcEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE"); -// cmd.arg("passexceptions", alwaysVerbose); -// cmd.arg("fancy", debuggerSettings()->useDebuggingHelpers.value()); - -// //cmd.arg("resultvarname", m_resultVarName); -// //m_lastDebuggableCommand = cmd; -// //m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1"); -// cmd.arg("frame", stackHandler()->currentIndex()); - -// watchHandler()->notifyUpdateStarted(); -// runCommand(cmd); } bool DapEngine::hasCapability(unsigned cap) const @@ -866,40 +894,6 @@ void DapEngine::claimInitialBreakpoints() { BreakpointManager::claimBreakpointsForEngine(this); qDebug() << "claimInitialBreakpoints"; -// const Breakpoints bps = breakHandler()->breakpoints(); -// for (const Breakpoint &bp : bps) -// qDebug() << "breakpoit: " << bp->fileName() << bp->lineNumber(); -// qDebug() << "claimInitialBreakpoints end"; - -// const DebuggerRunParameters &rp = runParameters(); -// if (rp.startMode != AttachToCore) { -// showStatusMessage(Tr::tr("Setting breakpoints...")); -// showMessage(Tr::tr("Setting breakpoints...")); -// BreakpointManager::claimBreakpointsForEngine(this); - -// const DebuggerSettings &s = *debuggerSettings(); -// const bool onAbort = s.breakOnAbort.value(); -// const bool onWarning = s.breakOnWarning.value(); -// const bool onFatal = s.breakOnFatal.value(); -// if (onAbort || onWarning || onFatal) { -// DebuggerCommand cmd("createSpecialBreakpoints"); -// cmd.arg("breakonabort", onAbort); -// cmd.arg("breakonwarning", onWarning); -// cmd.arg("breakonfatal", onFatal); -// runCommand(cmd); -// } -// } - -// // It is ok to cut corners here and not wait for createSpecialBreakpoints()'s -// // response, as the command is synchronous from Creator's point of view, -// // and even if it fails (e.g. due to stripped binaries), continuing with -// // the start up is the best we can do. - -// if (!rp.commandsAfterConnect.isEmpty()) { -// const QString commands = expand(rp.commandsAfterConnect); -// for (const QString &command : commands.split('\n')) -// runCommand({command, NativeCommand}); -// } } DebuggerEngine *createDapEngine() diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 746a1be2844..b91c84c8b41 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -67,8 +67,8 @@ private: void postDirectCommand(const QJsonObject &ob); void refreshLocation(const GdbMi &reportedLocation); - void refreshStack(const GdbMi &stack); - void refreshLocals(const GdbMi &vars); + void refreshStack(const QJsonArray &stackFrames); + void refreshLocals(const QJsonArray &variables); void refreshModules(const GdbMi &modules); void refreshState(const GdbMi &reportedState); void refreshSymbols(const GdbMi &symbols); @@ -78,12 +78,14 @@ private: void claimInitialBreakpoints(); - void handleDabStarted(); - void handleDabLaunch(); - void handleDabConfigurationDone(); + void handleDapStarted(); + void handleDapLaunch(); + void handleDapConfigurationDone(); - void dabStackTrace(); + void dapStackTrace(); + void dapScopes(); void threads(); + void dapVariables(int variablesReference); void handleDapDone(); void readDapStandardOutput(); From 091b8530688442e5846c0f276f0a0b31c8fc4b7f Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 21 Jun 2023 18:13:56 +0200 Subject: [PATCH 0033/1777] Utils/Core: Make an aspect container layoutable Most aspect containers end in a widget at some time. Let them declare how. The optionspages don't need a layouter anymore when using their settings' one. There was only one case where there was none, fix that one (perforce). Change-Id: Ibd39bcd4af98c3eae1daafa59f6c1d6e7a571989 Reviewed-by: Alessandro Portale --- src/libs/utils/aspects.cpp | 11 ++ src/libs/utils/aspects.h | 3 + .../coreplugin/dialogs/ioptionspage.cpp | 16 +-- src/plugins/coreplugin/dialogs/ioptionspage.h | 1 - src/plugins/perforce/perforcesettings.cpp | 128 +++++++++--------- 5 files changed, 85 insertions(+), 74 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index f0868666c84..d8fdd9f6f3d 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -2430,6 +2430,7 @@ public: QList m_ownedItems; // Owned only. bool m_autoApply = true; QStringList m_settingsGroup; + std::function m_layouter; }; } // Internal @@ -2483,6 +2484,16 @@ AspectContainer::const_iterator AspectContainer::end() const return d->m_items.cend(); } +void AspectContainer::setLayouter(const std::function &layouter) +{ + d->m_layouter = layouter; +} + +std::function AspectContainer::layouter() const +{ + return d->m_layouter; +} + const QList &AspectContainer::aspects() const { return d->m_items; diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 22dcc9bb0df..3c69306214d 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -710,6 +710,9 @@ public: const_iterator begin() const; const_iterator end() const; + void setLayouter(const std::function &layouter); + std::function layouter() const; + signals: void applied(); void changed(); diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.cpp b/src/plugins/coreplugin/dialogs/ioptionspage.cpp index 4def6095a11..1e03ef2a582 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.cpp +++ b/src/plugins/coreplugin/dialogs/ioptionspage.cpp @@ -136,6 +136,13 @@ QWidget *IOptionsPage::widget() if (!m_widget) { if (m_widgetCreator) { m_widget = m_widgetCreator(); + } else if (m_settings) { + m_widget = new IOptionsPageWidget; + if (auto layouter = m_settings->layouter()) { + layouter().attachTo(m_widget); + } else { + QTC_CHECK(false); + } } else { QTC_CHECK(false); } @@ -199,15 +206,6 @@ void IOptionsPage::setSettings(AspectContainer *settings) m_settings = settings; } -void IOptionsPage::setLayouter(const std::function &layouter) -{ - m_widgetCreator = [layouter] { - auto widget = new IOptionsPageWidget; - layouter().attachTo(widget); - return widget; - }; -} - /*! \fn void Core::IOptionsPage::setId(Utils::Id id) diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index 4007a3219ef..c25ed35becc 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -74,7 +74,6 @@ protected: void setCategoryIcon(const Utils::Icon &categoryIcon) { m_categoryIcon = categoryIcon; } void setCategoryIconPath(const Utils::FilePath &categoryIconPath); void setSettings(Utils::AspectContainer *settings); - void setLayouter(const std::function &layouter); // Used in FontSettingsPage. FIXME? QPointer m_widget; // Used in conjunction with m_widgetCreator diff --git a/src/plugins/perforce/perforcesettings.cpp b/src/plugins/perforce/perforcesettings.cpp index 47ef5a03b35..6dff959d5f6 100644 --- a/src/plugins/perforce/perforcesettings.cpp +++ b/src/plugins/perforce/perforcesettings.cpp @@ -77,6 +77,70 @@ PerforceSettings::PerforceSettings() autoOpen.setSettingsKey("PromptToOpen"); autoOpen.setDefaultValue(true); autoOpen.setLabelText(Tr::tr("Automatically open files when editing")); + + setLayouter([this] { + using namespace Layouting; + + auto errorLabel = new InfoLabel({}, InfoLabel::None); + errorLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); + errorLabel->setFilled(true); + auto testButton = new QPushButton(Tr::tr("Test")); + QObject::connect(testButton, &QPushButton::clicked, errorLabel, + [this, errorLabel, testButton] { + testButton->setEnabled(false); + auto checker = new PerforceChecker(errorLabel); + checker->setUseOverideCursor(true); + QObject::connect(checker, &PerforceChecker::failed, errorLabel, + [errorLabel, testButton, checker](const QString &t) { + errorLabel->setType(InfoLabel::Error); + errorLabel->setText(t); + testButton->setEnabled(true); + checker->deleteLater(); + }); + QObject::connect(checker, &PerforceChecker::succeeded, errorLabel, + [errorLabel, testButton, checker](const FilePath &repo) { + errorLabel->setType(InfoLabel::Ok); + errorLabel->setText(Tr::tr("Test succeeded (%1).") + .arg(repo.toUserOutput())); + testButton->setEnabled(true); + checker->deleteLater(); + }); + + errorLabel->setType(InfoLabel::Information); + errorLabel->setText(Tr::tr("Testing...")); + + const FilePath p4Bin = FilePath::fromUserInput( + p4BinaryPath.volatileValue().toString()); + checker->start(p4Bin, {}, commonP4Arguments_volatile(), 10000); + }); + + Group config { + title(Tr::tr("Configuration")), + Row { p4BinaryPath } + }; + + Group environment { + title(Tr::tr("Environment Variables")), + customEnv.groupChecker(), + Row { p4Port, p4Client, p4User } + }; + + Group misc { + title(Tr::tr("Miscellaneous")), + Column { + Row { logCount, timeOutS, st }, + autoOpen + } + }; + + return Column { + config, + environment, + misc, + Row { errorLabel, st, testButton }, + st + }; + }); } // --------------------PerforceSettings @@ -216,70 +280,6 @@ PerforceSettingsPage::PerforceSettingsPage(PerforceSettings *settings) setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); setSettings(settings); - setLayouter([settings] { - PerforceSettings &s = *settings; - using namespace Layouting; - - auto errorLabel = new InfoLabel({}, InfoLabel::None); - errorLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); - errorLabel->setFilled(true); - auto testButton = new QPushButton(Tr::tr("Test")); - QObject::connect(testButton, &QPushButton::clicked, errorLabel, - [settings, errorLabel, testButton] { - testButton->setEnabled(false); - auto checker = new PerforceChecker(errorLabel); - checker->setUseOverideCursor(true); - QObject::connect(checker, &PerforceChecker::failed, errorLabel, - [errorLabel, testButton, checker](const QString &t) { - errorLabel->setType(InfoLabel::Error); - errorLabel->setText(t); - testButton->setEnabled(true); - checker->deleteLater(); - }); - QObject::connect(checker, &PerforceChecker::succeeded, errorLabel, - [errorLabel, testButton, checker](const FilePath &repo) { - errorLabel->setType(InfoLabel::Ok); - errorLabel->setText(Tr::tr("Test succeeded (%1).") - .arg(repo.toUserOutput())); - testButton->setEnabled(true); - checker->deleteLater(); - }); - - errorLabel->setType(InfoLabel::Information); - errorLabel->setText(Tr::tr("Testing...")); - - const FilePath p4Bin = FilePath::fromUserInput( - settings->p4BinaryPath.volatileValue().toString()); - checker->start(p4Bin, {}, settings->commonP4Arguments_volatile(), 10000); - }); - - Group config { - title(Tr::tr("Configuration")), - Row { s.p4BinaryPath } - }; - - Group environment { - title(Tr::tr("Environment Variables")), - s.customEnv.groupChecker(), - Row { s.p4Port, s.p4Client, s.p4User } - }; - - Group misc { - title(Tr::tr("Miscellaneous")), - Column { - Row { s.logCount, s.timeOutS, st }, - s.autoOpen - } - }; - - return Column { - config, - environment, - misc, - Row { errorLabel, st, testButton }, - st - }; - }); } } // Perforce::Internal From 0cf14773244bf84d4a90f75f978792a12f96ab57 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 30 May 2023 13:17:58 +0200 Subject: [PATCH 0034/1777] Debugger: Split out gdb related options into own page object Goal is to make option setup more similar to the other "simple" pages. The GdbOptionPage is now separated in the setup code, but aggregated into the old place and accessed there. The per-backend separation seem quite weak, a full split would currently need to have include gdb/* in several places now is an indication that the gdb/non-gdb split in the options is dubious at best. Change-Id: Iad210016739aa4a63645731e16825f546bdd5e8a Reviewed-by: Alessandro Portale Reviewed-by: --- src/plugins/debugger/CMakeLists.txt | 2 +- src/plugins/debugger/debugger.qbs | 2 +- src/plugins/debugger/debuggeractions.cpp | 208 +------------------ src/plugins/debugger/debuggeractions.h | 32 +-- src/plugins/debugger/debuggerplugin.cpp | 2 - src/plugins/debugger/gdb/gdbsettings.cpp | 254 +++++++++++++++++++++++ src/plugins/debugger/gdb/gdbsettings.h | 39 ++++ 7 files changed, 305 insertions(+), 234 deletions(-) create mode 100644 src/plugins/debugger/gdb/gdbsettings.cpp create mode 100644 src/plugins/debugger/gdb/gdbsettings.h diff --git a/src/plugins/debugger/CMakeLists.txt b/src/plugins/debugger/CMakeLists.txt index d06e82a27e1..4280af0235c 100644 --- a/src/plugins/debugger/CMakeLists.txt +++ b/src/plugins/debugger/CMakeLists.txt @@ -51,7 +51,7 @@ add_qtc_plugin(Debugger disassembleragent.cpp disassembleragent.h disassemblerlines.cpp disassemblerlines.h gdb/gdbengine.cpp gdb/gdbengine.h - gdb/gdboptionspage.cpp + gdb/gdbsettings.cpp gdb/gdbsettings.h imageviewer.cpp imageviewer.h enginemanager.cpp enginemanager.h lldb/lldbengine.cpp lldb/lldbengine.h diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index be2adfc04d9..1cc48186b64 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -104,7 +104,7 @@ Project { prefix: "gdb/" files: [ "gdbengine.cpp", "gdbengine.h", - "gdboptionspage.cpp", + "gdbsettings.cpp", "gdbsettings.h", ] } diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 907e626f4dc..afa7dd14598 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -108,14 +108,6 @@ DebuggerSettings::DebuggerSettings() "the font size in the main editor changes.")); fontSizeFollowsEditor.setLabelText(Tr::tr("Debugger font size follows main editor")); - useMessageBoxForSignals.setSettingsKey(debugModeGroup, "UseMessageBoxForSignals"); - useMessageBoxForSignals.setDefaultValue(true); - useMessageBoxForSignals.setLabelText(Tr::tr( - "Show a message box when receiving a signal")); - useMessageBoxForSignals.setToolTip(Tr::tr( - "Displays a message box as soon as your application\n" - "receives a signal like SIGSEGV during debugging.")); - logTimeStamps.setLabelText(Tr::tr("Log Time Stamps")); logTimeStamps.setSettingsKey(debugModeGroup, "LogTimeStamps"); @@ -239,121 +231,6 @@ DebuggerSettings::DebuggerSettings() // synchronizeBreakpoints.setLabelText(Tr::tr("Synchronize Breakpoints")); - adjustBreakpointLocations.setDisplayName(Tr::tr("Adjust Breakpoint Locations")); - adjustBreakpointLocations.setToolTip( - "

" - + Tr::tr("Not all source code lines generate " - "executable code. Putting a breakpoint on such a line acts as " - "if the breakpoint was set on the next line that generated code. " - "Selecting 'Adjust Breakpoint Locations' shifts the red " - "breakpoint markers in such cases to the location of the true " - "breakpoint.")); - adjustBreakpointLocations.setDefaultValue(true); - adjustBreakpointLocations.setSettingsKey(debugModeGroup, "AdjustBreakpointLocations"); - adjustBreakpointLocations.setLabelText(Tr::tr( - "Adjust breakpoint locations")); - adjustBreakpointLocations.setToolTip(Tr::tr( - "GDB allows setting breakpoints on source lines for which no code \n" - "was generated. In such situations the breakpoint is shifted to the\n" - "next source code line for which code was actually generated.\n" - "This option reflects such temporary change by moving the breakpoint\n" - "markers in the source code editor.")); - - - breakOnThrow.setLabelText(Tr::tr("Break on \"throw\"")); - breakOnThrow.setSettingsKey(debugModeGroup, "BreakOnThrow"); - - breakOnCatch.setLabelText(Tr::tr("Break on \"catch\"")); - breakOnCatch.setSettingsKey(debugModeGroup, "BreakOnCatch"); - - breakOnWarning.setLabelText(Tr::tr("Break on \"qWarning\"")); - breakOnWarning.setSettingsKey(debugModeGroup, "BreakOnWarning"); - // FIXME: Move to common settings page. - breakOnWarning.setLabelText(CommonOptionsPage::msgSetBreakpointAtFunction("qWarning")); - breakOnWarning.setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qWarning")); - - breakOnFatal.setLabelText(Tr::tr("Break on \"qFatal\"")); - breakOnFatal.setSettingsKey(debugModeGroup, "BreakOnFatal"); - breakOnFatal.setLabelText(CommonOptionsPage::msgSetBreakpointAtFunction("qFatal")); - breakOnFatal.setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qFatal")); - - breakOnAbort.setLabelText(Tr::tr("Break on \"abort\"")); - breakOnAbort.setSettingsKey(debugModeGroup, "BreakOnAbort"); - breakOnAbort.setLabelText(CommonOptionsPage::msgSetBreakpointAtFunction("abort")); - breakOnAbort.setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("abort")); - - // - // Settings - // - - loadGdbInit.setSettingsKey(debugModeGroup, "LoadGdbInit"); - loadGdbInit.setDefaultValue(true); - loadGdbInit.setLabelText(Tr::tr("Load .gdbinit file on startup")); - loadGdbInit.setToolTip(Tr::tr( - "Allows or inhibits reading the user's default\n" - ".gdbinit file on debugger startup.")); - - loadGdbDumpers.setSettingsKey(debugModeGroup, "LoadGdbDumpers2"); - loadGdbDumpers.setLabelText(Tr::tr("Load system GDB pretty printers")); - loadGdbDumpers.setToolTip(Tr::tr( - "Uses the default GDB pretty printers installed in your " - "system or linked to the libraries your application uses.")); - - autoEnrichParameters.setSettingsKey(debugModeGroup, "AutoEnrichParameters"); - autoEnrichParameters.setDefaultValue(true); - autoEnrichParameters.setLabelText(Tr::tr( - "Use common locations for debug information")); - autoEnrichParameters.setToolTip(Tr::tr( - "Adds common paths to locations " - "of debug information such as /usr/src/debug " - "when starting GDB.")); - - useDynamicType.setSettingsKey(debugModeGroup, "UseDynamicType"); - useDynamicType.setDefaultValue(true); - useDynamicType.setDisplayName(Tr::tr("Use Dynamic Object Type for Display")); - useDynamicType.setLabelText(Tr::tr( - "Use dynamic object type for display")); - useDynamicType.setToolTip(Tr::tr( - "Specifies whether the dynamic or the static type of objects will be " - "displayed. Choosing the dynamic type might be slower.")); - - targetAsync.setSettingsKey(debugModeGroup, "TargetAsync"); - targetAsync.setLabelText(Tr::tr( - "Use asynchronous mode to control the inferior")); - - warnOnReleaseBuilds.setSettingsKey(debugModeGroup, "WarnOnReleaseBuilds"); - warnOnReleaseBuilds.setDefaultValue(true); - warnOnReleaseBuilds.setLabelText(Tr::tr("Warn when debugging \"Release\" builds")); - warnOnReleaseBuilds.setToolTip(Tr::tr("Shows a warning when starting the debugger " - "on a binary with insufficient debug information.")); - - QString howToUsePython = Tr::tr( - "

To execute simple Python commands, prefix them with \"python\".

" - "

To execute sequences of Python commands spanning multiple lines " - "prepend the block with \"python\" on a separate line, and append " - "\"end\" on a separate line.

" - "

To execute arbitrary Python scripts, " - "use python execfile('/path/to/script.py').

"); - - gdbStartupCommands.setSettingsKey(debugModeGroup, "GdbStartupCommands"); - gdbStartupCommands.setDisplayStyle(StringAspect::TextEditDisplay); - gdbStartupCommands.setUseGlobalMacroExpander(); - gdbStartupCommands.setToolTip("

" + Tr::tr( - "GDB commands entered here will be executed after " - "GDB has been started, but before the debugged program is started or " - "attached, and before the debugging helpers are initialized.") + "

" - + howToUsePython + ""); - - gdbPostAttachCommands.setSettingsKey(debugModeGroup, "GdbPostAttachCommands"); - gdbPostAttachCommands.setDisplayStyle(StringAspect::TextEditDisplay); - gdbPostAttachCommands.setUseGlobalMacroExpander(); - gdbPostAttachCommands.setToolTip("

" + Tr::tr( - "GDB commands entered here will be executed after " - "GDB has successfully attached to remote targets.

" - "

You can add commands to further set up the target here, " - "such as \"monitor reset\" or \"load\".") + "

" - + howToUsePython + ""); - extraDumperCommands.setSettingsKey(debugModeGroup, "GdbCustomDumperCommands"); extraDumperCommands.setDisplayStyle(StringAspect::TextEditDisplay); extraDumperCommands.setUseGlobalMacroExpander(); @@ -395,16 +272,6 @@ DebuggerSettings::DebuggerSettings() autoQuit.setSettingsKey(debugModeGroup, "AutoQuit"); autoQuit.setLabelText(Tr::tr("Automatically Quit Debugger")); - multiInferior.setSettingsKey(debugModeGroup, "MultiInferior"); - multiInferior.setLabelText(Tr::tr("Debug all child processes")); - multiInferior.setToolTip(Tr::tr( - "Keeps debugging all children after a fork." - "")); - - intelFlavor.setSettingsKey(debugModeGroup, "IntelFlavor"); - intelFlavor.setLabelText(Tr::tr("Use Intel style disassembly")); - intelFlavor.setToolTip(Tr::tr("GDB shows by default AT&&T style disassembly.")); - useAnnotationsInMainEditor.setSettingsKey(debugModeGroup, "UseAnnotations"); useAnnotationsInMainEditor.setLabelText(Tr::tr("Use annotations in main editor when debugging")); useAnnotationsInMainEditor.setToolTip( @@ -413,17 +280,11 @@ DebuggerSettings::DebuggerSettings() "as annotations in the main editor during debugging.")); useAnnotationsInMainEditor.setDefaultValue(true); - usePseudoTracepoints.setSettingsKey(debugModeGroup, "UsePseudoTracepoints"); - usePseudoTracepoints.setLabelText(Tr::tr("Use pseudo message tracepoints")); - usePseudoTracepoints.setToolTip(Tr::tr("Uses Python to extend the ordinary GDB breakpoint class.")); - usePseudoTracepoints.setDefaultValue(true); - - useIndexCache.setSettingsKey(debugModeGroup, "UseIndexCache"); - useIndexCache.setLabelText(Tr::tr("Use automatic symbol cache")); - useIndexCache.setToolTip(Tr::tr("It is possible for GDB to automatically save a copy of " - "its symbol index in a cache on disk and retrieve it from there when loading the same " - "binary in the future.")); - useIndexCache.setDefaultValue(true); + warnOnReleaseBuilds.setSettingsKey(debugModeGroup, "WarnOnReleaseBuilds"); + warnOnReleaseBuilds.setDefaultValue(true); + warnOnReleaseBuilds.setLabelText(Tr::tr("Warn when debugging \"Release\" builds")); + warnOnReleaseBuilds.setToolTip(Tr::tr("Shows a warning when starting the debugger " + "on a binary with insufficient debug information.")); useToolTipsInMainEditor.setSettingsKey(debugModeGroup, "UseToolTips"); useToolTipsInMainEditor.setLabelText(Tr::tr("Use tooltips in main editor when debugging")); @@ -454,27 +315,6 @@ DebuggerSettings::DebuggerSettings() "view during debugging.")); useToolTipsInStackView.setDefaultValue(true); - skipKnownFrames.setSettingsKey(debugModeGroup, "SkipKnownFrames"); - skipKnownFrames.setDisplayName(Tr::tr("Skip Known Frames")); - skipKnownFrames.setLabelText(Tr::tr("Skip known frames when stepping")); - skipKnownFrames.setToolTip(Tr::tr( - "

" - "Allows Step Into to compress several steps into one step\n" - "for less noisy debugging. For example, the atomic reference\n" - "counting code is skipped, and a single Step Into for a signal\n" - "emission ends up directly in the slot connected to it.")); - - enableReverseDebugging.setSettingsKey(debugModeGroup, "EnableReverseDebugging"); - enableReverseDebugging.setIcon(Icons::REVERSE_MODE.icon()); - enableReverseDebugging.setDisplayName(Tr::tr("Enable Reverse Debugging")); - enableReverseDebugging.setLabelText(Tr::tr("Enable reverse debugging")); - enableReverseDebugging.setToolTip(Tr::tr( - "

Enables stepping backwards.

" - "Note: This feature is very slow and unstable on the GDB side. " - "It exhibits unpredictable behavior when going backwards over system " - "calls and is very likely to destroy your debugging session.

")); - - #ifdef Q_OS_WIN registerForPostMortem = new RegisterPostMortemAction; registerForPostMortem->setSettingsKey(debugModeGroup, "RegisterForPostMortem"); @@ -543,18 +383,6 @@ DebuggerSettings::DebuggerSettings() createFullBacktrace.setLabelText(Tr::tr("Create Full Backtrace")); - gdbWatchdogTimeout.setSettingsKey(debugModeGroup, "WatchdogTimeout"); - gdbWatchdogTimeout.setDefaultValue(20); - gdbWatchdogTimeout.setSuffix(Tr::tr("sec")); - gdbWatchdogTimeout.setRange(20, 1000000); - gdbWatchdogTimeout.setLabelText(Tr::tr("GDB timeout:")); - gdbWatchdogTimeout.setToolTip(Tr::tr( - "The number of seconds before a non-responsive GDB process is terminated.\n" - "The default value of 20 seconds should be sufficient for most\n" - "applications, but there are situations when loading big libraries or\n" - "listing source files takes much longer than that on slow machines.\n" - "In this case, the value should be increased.")); - // // QML Tools // @@ -586,27 +414,6 @@ DebuggerSettings::DebuggerSettings() page1.registerAspect(&sourcePathMap); - // Page 2 - page2.registerAspect(&gdbWatchdogTimeout); - page2.registerAspect(&skipKnownFrames); - page2.registerAspect(&useMessageBoxForSignals); - page2.registerAspect(&adjustBreakpointLocations); - page2.registerAspect(&useDynamicType); - page2.registerAspect(&loadGdbInit); - page2.registerAspect(&loadGdbDumpers); - page2.registerAspect(&intelFlavor); - page2.registerAspect(&usePseudoTracepoints); - page2.registerAspect(&useIndexCache); - page2.registerAspect(&gdbStartupCommands); - page2.registerAspect(&gdbPostAttachCommands); - page2.registerAspect(&targetAsync); - page2.registerAspect(&autoEnrichParameters); - page2.registerAspect(&breakOnWarning); - page2.registerAspect(&breakOnFatal); - page2.registerAspect(&breakOnAbort); - page2.registerAspect(&enableReverseDebugging); - page2.registerAspect(&multiInferior); - // Page 4 page4.registerAspect(&useDebuggingHelpers); page4.registerAspect(&useCodeModel); @@ -645,12 +452,9 @@ DebuggerSettings::DebuggerSettings() all.registerAspect(&useToolTipsInStackView); all.registerAspect(&logTimeStamps); all.registerAspect(&sortStructMembers); - all.registerAspect(&breakOnThrow); // ?? - all.registerAspect(&breakOnCatch); // ?? // Collect all all.registerAspects(page1); - all.registerAspects(page2); all.registerAspects(page4); all.registerAspects(page5); all.registerAspects(page6); @@ -671,11 +475,13 @@ DebuggerSettings::~DebuggerSettings() void DebuggerSettings::readSettings() { all.readSettings(Core::ICore::settings()); + GdbSettings::readSettings(Core::ICore::settings()); } void DebuggerSettings::writeSettings() const { all.writeSettings(Core::ICore::settings()); + GdbSettings::writeSettings(Core::ICore::settings()); } QString DebuggerSettings::dump() diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index a6fb497815f..df2560ed72f 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -3,13 +3,13 @@ #pragma once +#include + #include #include #include #include -#include - namespace Debugger::Internal { class SourcePathMapAspectPrivate; @@ -50,7 +50,7 @@ class GeneralSettings ~GeneralSettings(); }; -class DebuggerSettings +class DebuggerSettings : public GdbSettings { public: explicit DebuggerSettings(); @@ -77,31 +77,6 @@ public: SourcePathMapAspect sourcePathMap; - // Page 2: GDB - Utils::IntegerAspect gdbWatchdogTimeout; - Utils::BoolAspect skipKnownFrames; - Utils::BoolAspect useMessageBoxForSignals; - Utils::BoolAspect adjustBreakpointLocations; - Utils::BoolAspect useDynamicType; - Utils::BoolAspect loadGdbInit; - Utils::BoolAspect loadGdbDumpers; - Utils::BoolAspect intelFlavor; - Utils::BoolAspect usePseudoTracepoints; - Utils::BoolAspect useIndexCache; - Utils::StringAspect gdbStartupCommands; - Utils::StringAspect gdbPostAttachCommands; - - // Page 3: GDB Extended - Utils::BoolAspect targetAsync; - Utils::BoolAspect autoEnrichParameters; - Utils::BoolAspect breakOnThrow; - Utils::BoolAspect breakOnCatch; - Utils::BoolAspect breakOnWarning; - Utils::BoolAspect breakOnFatal; - Utils::BoolAspect breakOnAbort; - Utils::BoolAspect enableReverseDebugging; - Utils::BoolAspect multiInferior; - // Page 4: Locals and expressions Utils::BoolAspect useDebuggingHelpers; Utils::BoolAspect useCodeModel; @@ -163,7 +138,6 @@ public: Utils::AspectContainer all; // All Utils::AspectContainer page1; // General - Utils::AspectContainer page2; // GDB Utils::AspectContainer page4; // Locals & Expressions Utils::AspectContainer page5; // CDB Utils::AspectContainer page6; // CDB Paths diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index dffa503c456..4aa0f1b33c6 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -364,7 +364,6 @@ const char MENU_GROUP_SPECIAL[] = "Debugger.Group.Special"; const char MENU_GROUP_START_QML[] = "Debugger.Group.Start.Qml"; void addCdbOptionPages(QList *opts); -void addGdbOptionPages(QList *opts); static QIcon startIcon(bool toolBarStyle) { @@ -1126,7 +1125,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) // }); m_optionPages.append(new LocalsAndExpressionsOptionsPage); - addGdbOptionPages(&m_optionPages); addCdbOptionPages(&m_optionPages); connect(ModeManager::instance(), &ModeManager::currentModeAboutToChange, this, [] { diff --git a/src/plugins/debugger/gdb/gdbsettings.cpp b/src/plugins/debugger/gdb/gdbsettings.cpp new file mode 100644 index 00000000000..62f4dec40cf --- /dev/null +++ b/src/plugins/debugger/gdb/gdbsettings.cpp @@ -0,0 +1,254 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "gdbsettings.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include + +using namespace Core; +using namespace Utils; + +namespace Debugger::Internal { + +GdbSettings::GdbSettings() +{ + setId("M.Gdb"); + setDisplayName(Tr::tr("GDB")); + setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY); + setSettingsGroup("DebugMode"); + + useMessageBoxForSignals.setSettingsKey("UseMessageBoxForSignals"); + useMessageBoxForSignals.setDefaultValue(true); + useMessageBoxForSignals.setLabelText(Tr::tr( + "Show a message box when receiving a signal")); + useMessageBoxForSignals.setToolTip(Tr::tr( + "Displays a message box as soon as your application\n" + "receives a signal like SIGSEGV during debugging.")); + + adjustBreakpointLocations.setDisplayName(Tr::tr("Adjust Breakpoint Locations")); + adjustBreakpointLocations.setToolTip( + "

" + + Tr::tr("Not all source code lines generate " + "executable code. Putting a breakpoint on such a line acts as " + "if the breakpoint was set on the next line that generated code. " + "Selecting 'Adjust Breakpoint Locations' shifts the red " + "breakpoint markers in such cases to the location of the true " + "breakpoint.")); + adjustBreakpointLocations.setDefaultValue(true); + adjustBreakpointLocations.setSettingsKey("AdjustBreakpointLocations"); + adjustBreakpointLocations.setLabelText(Tr::tr( + "Adjust breakpoint locations")); + adjustBreakpointLocations.setToolTip(Tr::tr( + "GDB allows setting breakpoints on source lines for which no code \n" + "was generated. In such situations the breakpoint is shifted to the\n" + "next source code line for which code was actually generated.\n" + "This option reflects such temporary change by moving the breakpoint\n" + "markers in the source code editor.")); + + + breakOnThrow.setLabelText(Tr::tr("Break on \"throw\"")); + breakOnThrow.setSettingsKey("BreakOnThrow"); + + breakOnCatch.setLabelText(Tr::tr("Break on \"catch\"")); + breakOnCatch.setSettingsKey("BreakOnCatch"); + + breakOnWarning.setLabelText(Tr::tr("Break on \"qWarning\"")); + breakOnWarning.setSettingsKey("BreakOnWarning"); + // FIXME: Move to common settings page. + breakOnWarning.setLabelText(CommonOptionsPage::msgSetBreakpointAtFunction("qWarning")); + breakOnWarning.setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qWarning")); + + breakOnFatal.setLabelText(Tr::tr("Break on \"qFatal\"")); + breakOnFatal.setSettingsKey("BreakOnFatal"); + breakOnFatal.setLabelText(CommonOptionsPage::msgSetBreakpointAtFunction("qFatal")); + breakOnFatal.setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qFatal")); + + breakOnAbort.setLabelText(Tr::tr("Break on \"abort\"")); + breakOnAbort.setSettingsKey("BreakOnAbort"); + breakOnAbort.setLabelText(CommonOptionsPage::msgSetBreakpointAtFunction("abort")); + breakOnAbort.setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("abort")); + + loadGdbInit.setSettingsKey("LoadGdbInit"); + loadGdbInit.setDefaultValue(true); + loadGdbInit.setLabelText(Tr::tr("Load .gdbinit file on startup")); + loadGdbInit.setToolTip(Tr::tr( + "Allows or inhibits reading the user's default\n" + ".gdbinit file on debugger startup.")); + + loadGdbDumpers.setSettingsKey("LoadGdbDumpers2"); + loadGdbDumpers.setLabelText(Tr::tr("Load system GDB pretty printers")); + loadGdbDumpers.setToolTip(Tr::tr( + "Uses the default GDB pretty printers installed in your " + "system or linked to the libraries your application uses.")); + + autoEnrichParameters.setSettingsKey("AutoEnrichParameters"); + autoEnrichParameters.setDefaultValue(true); + autoEnrichParameters.setLabelText(Tr::tr( + "Use common locations for debug information")); + autoEnrichParameters.setToolTip(Tr::tr( + "Adds common paths to locations " + "of debug information such as /usr/src/debug " + "when starting GDB.")); + + useDynamicType.setSettingsKey("UseDynamicType"); + useDynamicType.setDefaultValue(true); + useDynamicType.setDisplayName(Tr::tr("Use Dynamic Object Type for Display")); + useDynamicType.setLabelText(Tr::tr( + "Use dynamic object type for display")); + useDynamicType.setToolTip(Tr::tr( + "Specifies whether the dynamic or the static type of objects will be " + "displayed. Choosing the dynamic type might be slower.")); + + targetAsync.setSettingsKey("TargetAsync"); + targetAsync.setLabelText(Tr::tr( + "Use asynchronous mode to control the inferior")); + + QString howToUsePython = Tr::tr( + "

To execute simple Python commands, prefix them with \"python\".

" + "

To execute sequences of Python commands spanning multiple lines " + "prepend the block with \"python\" on a separate line, and append " + "\"end\" on a separate line.

" + "

To execute arbitrary Python scripts, " + "use python execfile('/path/to/script.py').

"); + + gdbStartupCommands.setSettingsKey("GdbStartupCommands"); + gdbStartupCommands.setDisplayStyle(StringAspect::TextEditDisplay); + gdbStartupCommands.setUseGlobalMacroExpander(); + gdbStartupCommands.setToolTip("

" + Tr::tr( + "GDB commands entered here will be executed after " + "GDB has been started, but before the debugged program is started or " + "attached, and before the debugging helpers are initialized.") + "

" + + howToUsePython + ""); + + gdbPostAttachCommands.setSettingsKey("GdbPostAttachCommands"); + gdbPostAttachCommands.setDisplayStyle(StringAspect::TextEditDisplay); + gdbPostAttachCommands.setUseGlobalMacroExpander(); + gdbPostAttachCommands.setToolTip("

" + Tr::tr( + "GDB commands entered here will be executed after " + "GDB has successfully attached to remote targets.

" + "

You can add commands to further set up the target here, " + "such as \"monitor reset\" or \"load\".") + "

" + + howToUsePython + ""); + + multiInferior.setSettingsKey("MultiInferior"); + multiInferior.setLabelText(Tr::tr("Debug all child processes")); + multiInferior.setToolTip(Tr::tr( + "Keeps debugging all children after a fork." + "")); + + intelFlavor.setSettingsKey("IntelFlavor"); + intelFlavor.setLabelText(Tr::tr("Use Intel style disassembly")); + intelFlavor.setToolTip(Tr::tr("GDB shows by default AT&&T style disassembly.")); + + usePseudoTracepoints.setSettingsKey("UsePseudoTracepoints"); + usePseudoTracepoints.setLabelText(Tr::tr("Use pseudo message tracepoints")); + usePseudoTracepoints.setToolTip(Tr::tr("Uses Python to extend the ordinary GDB breakpoint class.")); + usePseudoTracepoints.setDefaultValue(true); + + useIndexCache.setSettingsKey("UseIndexCache"); + useIndexCache.setLabelText(Tr::tr("Use automatic symbol cache")); + useIndexCache.setToolTip(Tr::tr("It is possible for GDB to automatically save a copy of " + "its symbol index in a cache on disk and retrieve it from there when loading the same " + "binary in the future.")); + useIndexCache.setDefaultValue(true); + + skipKnownFrames.setSettingsKey("SkipKnownFrames"); + skipKnownFrames.setDisplayName(Tr::tr("Skip Known Frames")); + skipKnownFrames.setLabelText(Tr::tr("Skip known frames when stepping")); + skipKnownFrames.setToolTip(Tr::tr( + "

" + "Allows Step Into to compress several steps into one step\n" + "for less noisy debugging. For example, the atomic reference\n" + "counting code is skipped, and a single Step Into for a signal\n" + "emission ends up directly in the slot connected to it.")); + + enableReverseDebugging.setSettingsKey("EnableReverseDebugging"); + enableReverseDebugging.setIcon(Icons::REVERSE_MODE.icon()); + enableReverseDebugging.setDisplayName(Tr::tr("Enable Reverse Debugging")); + enableReverseDebugging.setLabelText(Tr::tr("Enable reverse debugging")); + enableReverseDebugging.setToolTip(Tr::tr( + "

Enables stepping backwards.

" + "Note: This feature is very slow and unstable on the GDB side. " + "It exhibits unpredictable behavior when going backwards over system " + "calls and is very likely to destroy your debugging session.

")); + + gdbWatchdogTimeout.setSettingsKey("WatchdogTimeout"); + gdbWatchdogTimeout.setDefaultValue(20); + gdbWatchdogTimeout.setSuffix(Tr::tr("sec")); + gdbWatchdogTimeout.setRange(20, 1000000); + gdbWatchdogTimeout.setLabelText(Tr::tr("GDB timeout:")); + gdbWatchdogTimeout.setToolTip(Tr::tr( + "The number of seconds before a non-responsive GDB process is terminated.\n" + "The default value of 20 seconds should be sufficient for most\n" + "applications, but there are situations when loading big libraries or\n" + "listing source files takes much longer than that on slow machines.\n" + "In this case, the value should be increased.")); + + + setLayouter([this] { + using namespace Layouting; + + auto labelDangerous = new QLabel("" + + Tr::tr("The options below give access to advanced
" + "or experimental functions of GDB.

" + "Enabling them may negatively impact
" + "your debugging experience.") + "
"); + + Group general { + title(Tr::tr("General")), + Column { + Row { gdbWatchdogTimeout, st }, + skipKnownFrames, + useMessageBoxForSignals, + adjustBreakpointLocations, + useDynamicType, + loadGdbInit, + loadGdbDumpers, + intelFlavor, + usePseudoTracepoints, + useIndexCache, + st + } + }; + + Group extended { + title(Tr::tr("Extended")), + Column { + labelDangerous, + targetAsync, + autoEnrichParameters, + breakOnWarning, + breakOnFatal, + breakOnAbort, + enableReverseDebugging, + multiInferior, + st + } + }; + + Group startup { + title(Tr::tr("Additional Startup Commands")), + Column { gdbStartupCommands } + }; + + Group attach { + title(Tr::tr("Additional Attach Commands")), + Column { gdbPostAttachCommands }, + }; + + return Grid { general, extended, br, startup, attach }; + }); + + readSettings(); +} + +} // Debugger::Internal diff --git a/src/plugins/debugger/gdb/gdbsettings.h b/src/plugins/debugger/gdb/gdbsettings.h new file mode 100644 index 00000000000..d04e89eb966 --- /dev/null +++ b/src/plugins/debugger/gdb/gdbsettings.h @@ -0,0 +1,39 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include + +namespace Debugger::Internal { + +class GdbSettings : public Core::PagedSettings +{ +public: + GdbSettings(); + + Utils::IntegerAspect gdbWatchdogTimeout{this}; + Utils::BoolAspect skipKnownFrames{this}; + Utils::BoolAspect useMessageBoxForSignals{this}; + Utils::BoolAspect adjustBreakpointLocations{this}; + Utils::BoolAspect useDynamicType{this}; + Utils::BoolAspect loadGdbInit{this}; + Utils::BoolAspect loadGdbDumpers{this}; + Utils::BoolAspect intelFlavor{this}; + Utils::BoolAspect usePseudoTracepoints{this}; + Utils::BoolAspect useIndexCache{this}; + Utils::StringAspect gdbStartupCommands{this}; + Utils::StringAspect gdbPostAttachCommands{this}; + + Utils::BoolAspect targetAsync{this}; + Utils::BoolAspect autoEnrichParameters{this}; + Utils::BoolAspect breakOnThrow{this}; + Utils::BoolAspect breakOnCatch{this}; + Utils::BoolAspect breakOnWarning{this}; + Utils::BoolAspect breakOnFatal{this}; + Utils::BoolAspect breakOnAbort{this}; + Utils::BoolAspect enableReverseDebugging{this}; + Utils::BoolAspect multiInferior{this}; +}; + +} // Debugger::Internal From ae83cc375b50b90f8e6d5e9d5a33b2a2a66b98e8 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 14 Jun 2023 22:05:44 +0200 Subject: [PATCH 0035/1777] QmlDesigner: Inline timelineform.ui Change-Id: I81e26b62fb289ca95d04b9f8a755de7251c52f6a Reviewed-by: hjk --- src/plugins/qmldesigner/CMakeLists.txt | 2 +- .../timelineeditor/timelineform.cpp | 106 ++++++-- .../components/timelineeditor/timelineform.h | 19 +- .../components/timelineeditor/timelineform.ui | 237 ------------------ 4 files changed, 92 insertions(+), 272 deletions(-) delete mode 100644 src/plugins/qmldesigner/components/timelineeditor/timelineform.ui diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index 08bde98beff..fa19266fdd5 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -973,7 +973,7 @@ extend_qtc_plugin(QmlDesigner timelineconstants.h timelinecontext.cpp timelinecontext.h timelinecontrols.cpp timelinecontrols.h - timelineform.cpp timelineform.h timelineform.ui + timelineform.cpp timelineform.h timelinegraphicslayout.cpp timelinegraphicslayout.h timelinegraphicsscene.cpp timelinegraphicsscene.h timelineicons.h diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineform.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelineform.cpp index 9068dd7be18..188bd496190 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineform.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineform.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "timelineform.h" -#include "ui_timelineform.h" #include #include @@ -15,22 +14,80 @@ #include #include +#include #include +#include +#include +#include +#include + namespace QmlDesigner { TimelineForm::TimelineForm(QWidget *parent) : QWidget(parent) - , ui(new Ui::TimelineForm) { - ui->setupUi(this); + constexpr int minimumLabelWidth = 160; + constexpr int spinBoxWidth = 80; - connect(ui->expressionBindingLineEdit, &QLineEdit::editingFinished, [this]() { + auto mainL = new QLabel(tr("Timeline Settings")); + QFont f = mainL->font(); + f.setBold(true); + mainL->setFont(f); + + auto idL = new QLabel(tr("Timeline ID:")); + idL->setToolTip(tr("Name for the timeline.")); + m_idLineEdit = new QLineEdit; + + auto startFrameL = new QLabel(tr("Start frame:")); + startFrameL->setToolTip(tr("First frame of the timeline. Negative numbers are allowed.")); + m_startFrame = new QSpinBox; + m_startFrame->setFixedWidth(spinBoxWidth); + m_startFrame->setRange(-100000, 100000); + + auto endFrameL = new QLabel(tr("End frame:")); + endFrameL->setToolTip(tr("Last frame of the timeline.")); + m_endFrame = new QSpinBox; + m_endFrame->setFixedWidth(spinBoxWidth); + m_endFrame->setRange(-100000, 100000); + + m_expressionBinding = new QRadioButton(tr("Expression binding")); + m_expressionBinding->setToolTip(tr("To create an expression binding animation, delete all animations from this timeline.")); + m_expressionBinding->setEnabled(false); + + m_animation = new QRadioButton(tr("Animation")); + m_animation->setEnabled(false); + m_animation->setChecked(true); + + QSizePolicy sp(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); + + auto expressionBindingL = new QLabel(tr("Expression binding:")); + expressionBindingL->setToolTip(tr("Sets the expression to bind the current keyframe to.")); + expressionBindingL->setMinimumWidth(minimumLabelWidth); + m_expressionBindingLineEdit = new QLineEdit; + m_expressionBindingLineEdit->setMinimumWidth(240); + sp.setHorizontalStretch(2); + m_expressionBindingLineEdit->setSizePolicy(sp); + + auto str = new QWidget; + sp.setHorizontalStretch(1); + str->setSizePolicy(sp); + + using namespace Layouting; + Grid { + Span(2, mainL), br, + idL, m_idLineEdit, br, + empty(), Row { startFrameL, m_startFrame, st(), endFrameL, m_endFrame }, str, br, + empty(), Row { m_expressionBinding, m_animation, st() }, br, + expressionBindingL, m_expressionBindingLineEdit, br, + }.attachTo(this); + + connect(m_expressionBindingLineEdit, &QLineEdit::editingFinished, [this]() { QTC_ASSERT(m_timeline.isValid(), return ); - const QString bindingText = ui->expressionBindingLineEdit->text(); + const QString bindingText = m_expressionBindingLineEdit->text(); if (bindingText.isEmpty()) { - ui->animation->setChecked(true); + m_animation->setChecked(true); try { m_timeline.modelNode().removeProperty("currentFrame"); } catch (const Exception &e) { @@ -39,7 +96,7 @@ TimelineForm::TimelineForm(QWidget *parent) return; } - ui->expressionBinding->setChecked(true); + m_expressionBinding->setChecked(true); try { m_timeline.modelNode() @@ -50,12 +107,12 @@ TimelineForm::TimelineForm(QWidget *parent) } }); - connect(ui->idLineEdit, &QLineEdit::editingFinished, [this]() { + connect(m_idLineEdit, &QLineEdit::editingFinished, [this]() { QTC_ASSERT(m_timeline.isValid(), return ); static QString lastString; - const QString newId = ui->idLineEdit->text(); + const QString newId = m_idLineEdit->text(); if (newId == lastString) return; @@ -81,37 +138,32 @@ TimelineForm::TimelineForm(QWidget *parent) if (error) { lastString.clear(); - ui->idLineEdit->setText(m_timeline.modelNode().id()); + m_idLineEdit->setText(m_timeline.modelNode().id()); } }); - connectSpinBox(ui->startFrame, "startFrame"); - connectSpinBox(ui->endFrame, "endFrame"); -} - -TimelineForm::~TimelineForm() -{ - delete ui; + connectSpinBox(m_startFrame, "startFrame"); + connectSpinBox(m_endFrame, "endFrame"); } void TimelineForm::setTimeline(const QmlTimeline &timeline) { m_timeline = timeline; - ui->expressionBindingLineEdit->clear(); + m_expressionBindingLineEdit->clear(); if (m_timeline.isValid()) { - ui->idLineEdit->setText(m_timeline.modelNode().displayName()); - ui->startFrame->setValue( + m_idLineEdit->setText(m_timeline.modelNode().displayName()); + m_startFrame->setValue( m_timeline.modelNode().variantProperty("startFrame").value().toInt()); - ui->endFrame->setValue(m_timeline.modelNode().variantProperty("endFrame").value().toInt()); + m_endFrame->setValue(m_timeline.modelNode().variantProperty("endFrame").value().toInt()); if (m_timeline.modelNode().hasBindingProperty("currentFrame")) { - ui->expressionBindingLineEdit->setText( + m_expressionBindingLineEdit->setText( m_timeline.modelNode().bindingProperty("currentFrame").expression()); - ui->expressionBinding->setChecked(true); + m_expressionBinding->setChecked(true); } else { - ui->expressionBinding->setChecked(false); + m_expressionBinding->setChecked(false); } } } @@ -123,9 +175,9 @@ QmlTimeline TimelineForm::timeline() const void TimelineForm::setHasAnimation(bool b) { - ui->expressionBinding->setChecked(!b); - ui->animation->setChecked(b); - ui->expressionBindingLineEdit->setDisabled(b); + m_expressionBinding->setChecked(!b); + m_animation->setChecked(b); + m_expressionBindingLineEdit->setDisabled(b); } void TimelineForm::setProperty(const PropertyName &propertyName, const QVariant &value) diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineform.h b/src/plugins/qmldesigner/components/timelineeditor/timelineform.h index 5e5f1b977bd..b025bbc2d62 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineform.h +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineform.h @@ -7,21 +7,20 @@ #include -QT_FORWARD_DECLARE_CLASS(QSpinBox) +QT_BEGIN_NAMESPACE +class QLineEdit; +class QRadioButton; +class QSpinBox; +QT_END_NAMESPACE namespace QmlDesigner { -namespace Ui { -class TimelineForm; -} - class TimelineForm : public QWidget { Q_OBJECT public: explicit TimelineForm(QWidget *parent); - ~TimelineForm() override; void setTimeline(const QmlTimeline &timeline); QmlTimeline timeline() const; void setHasAnimation(bool b); @@ -30,7 +29,13 @@ private: void setProperty(const PropertyName &propertyName, const QVariant &value); void connectSpinBox(QSpinBox *spinBox, const PropertyName &propertyName); - Ui::TimelineForm *ui; + QLineEdit *m_idLineEdit; + QSpinBox *m_startFrame; + QSpinBox *m_endFrame; + QRadioButton *m_expressionBinding; + QRadioButton *m_animation; + QLineEdit *m_expressionBindingLineEdit; + QmlTimeline m_timeline; }; diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineform.ui b/src/plugins/qmldesigner/components/timelineeditor/timelineform.ui deleted file mode 100644 index 53877b5695e..00000000000 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineform.ui +++ /dev/null @@ -1,237 +0,0 @@ - - - QmlDesigner::TimelineForm - - - - 0 - 0 - 641 - 170 - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 49 - 20 - - - - - - - - Qt::Horizontal - - - - 49 - 20 - - - - - - - - Last frame of the timeline. - - - End frame: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - First frame of the timeline. Negative numbers are allowed. - - - Start frame: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - -100000 - - - 100000 - - - - - - - false - - - To create an expression binding animation, delete all animations from this timeline. - - - Expression binding - - - - - - - Name for the timeline. - - - Timeline ID: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 160 - 0 - - - - - 75 - true - - - - Timeline Settings - - - - - - - false - - - Animation - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 49 - 20 - - - - - - - - Sets the expression to bind the current keyframe to. - - - Expression binding: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - -100000 - - - 100000 - - - - - - - - - - - - - - true - - - - 240 - 0 - - - - - - - - Qt::Horizontal - - - - 49 - 20 - - - - - - - - - From 22d5807799a9d24d6d5fc83c6936017a7faa36a4 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 13 Jun 2023 19:24:25 +0200 Subject: [PATCH 0036/1777] QmlDesigner: Inline timelineanimationform.ui Change-Id: I0f41837cf51c09ca753aae0c68bdc9775f66beeb Reviewed-by: hjk --- src/plugins/qmldesigner/CMakeLists.txt | 2 +- .../timelineeditor/timelineanimationform.cpp | 162 +++++--- .../timelineeditor/timelineanimationform.h | 22 +- .../timelineeditor/timelineanimationform.ui | 354 ------------------ 4 files changed, 132 insertions(+), 408 deletions(-) delete mode 100644 src/plugins/qmldesigner/components/timelineeditor/timelineanimationform.ui diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index fa19266fdd5..92d037e9b07 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -969,7 +969,7 @@ extend_qtc_plugin(QmlDesigner timeline.qrc timelineabstracttool.cpp timelineabstracttool.h timelineactions.cpp timelineactions.h - timelineanimationform.cpp timelineanimationform.h timelineanimationform.ui + timelineanimationform.cpp timelineanimationform.h timelineconstants.h timelinecontext.cpp timelinecontext.h timelinecontrols.cpp timelinecontrols.h diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineanimationform.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelineanimationform.cpp index 494674891ea..d7b700dde81 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineanimationform.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineanimationform.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "timelineanimationform.h" -#include "ui_timelineanimationform.h" #include #include @@ -18,42 +17,118 @@ #include #include +#include #include +#include +#include +#include +#include +#include + namespace QmlDesigner { TimelineAnimationForm::TimelineAnimationForm(QWidget *parent) : QWidget(parent) - , ui(new Ui::TimelineAnimationForm) { - ui->setupUi(this); + constexpr int minimumLabelWidth = 160; + constexpr int spinBoxWidth = 80; - connectSpinBox(ui->duration, "duration"); - connectSpinBox(ui->loops, "loops"); + auto mainL = new QLabel(tr("Animation Settings")); + QFont f = mainL->font(); + f.setBold(true); + mainL->setFont(f); - connectSpinBox(ui->startFrame, "from"); - connectSpinBox(ui->endFrame, "to"); + auto idL = new QLabel(tr("Animation ID:")); + idL->setToolTip(tr("Name for the animation.")); + idL->setMinimumWidth(minimumLabelWidth); + m_idLineEdit = new QLineEdit; - connect(ui->loops, &QSpinBox::valueChanged, this, [this] { - ui->continuous->setChecked(ui->loops->value() == -1); + auto runningL = new QLabel(tr("Running in base state")); + runningL->setToolTip( + tr("Runs the animation automatically when the base state is active.")); + m_running = new QCheckBox; + m_running->setEnabled(false); + + auto startFrameL = new QLabel(tr("Start frame:")); + startFrameL->setToolTip(tr("First frame of the animation.")); + m_startFrame = new QSpinBox; + m_startFrame->setFixedWidth(spinBoxWidth); + m_startFrame->setRange(-100000, 100000); + + auto endFrameL = new QLabel(tr("End frame:")); + endFrameL->setToolTip(tr("Last frame of the animation.")); + m_endFrame = new QSpinBox; + m_endFrame->setFixedWidth(spinBoxWidth); + m_endFrame->setRange(-100000, 100000); + + auto durationL = new QLabel(tr("Duration:")); + durationL->setToolTip(tr("Length of the animation in milliseconds. If you set a shorter duration than the number of frames, frames are left out from the end of the animation.")); + m_duration = new QSpinBox; + m_duration->setFixedWidth(spinBoxWidth); + m_duration->setRange(0, 100000); + + auto continuousL = new QLabel(tr("Continuous")); + continuousL->setToolTip(tr("Sets the animation to loop indefinitely.")); + m_continuous = new QCheckBox; + + auto loopsL = new QLabel(tr("Loops:")); + loopsL->setToolTip(tr("Number of times the animation runs before it stops.")); + m_loops = new QSpinBox; + m_loops->setFixedWidth(spinBoxWidth); + m_loops->setRange(-1, 1000); + + auto pingPongL = new QLabel(tr("Ping pong")); + pingPongL->setToolTip( + tr("Runs the animation backwards to the beginning when it reaches the end.")); + m_pingPong = new QCheckBox; + + auto transitionToStateL = new QLabel(tr("Finished:")); + transitionToStateL->setToolTip(tr("State to activate when the animation finishes.")); + m_transitionToState = new QComboBox; + m_transitionToState->addItem(tr("none")); + + auto str = new QWidget; + QSizePolicy sp(QSizePolicy::MinimumExpanding, QSizePolicy::Ignored); + sp.setHorizontalStretch(2); + str->setSizePolicy(sp); + + using namespace Layouting; + Grid { + Span(4, mainL), br, + empty(), br, + idL, Span(2, m_idLineEdit), Span(2, Row{ runningL, m_running }), br, + empty(), startFrameL, m_startFrame, endFrameL, m_endFrame, durationL, m_duration, br, + empty(), continuousL, m_continuous, loopsL, m_loops, pingPongL, m_pingPong, str, br, + tr("Transition to state:"), transitionToStateL, m_transitionToState, br, + }.attachTo(this); + + connectSpinBox(m_duration, "duration"); + connectSpinBox(m_loops, "loops"); + + connectSpinBox(m_startFrame, "from"); + connectSpinBox(m_endFrame, "to"); + + connect(m_loops, &QSpinBox::valueChanged, this, [this] { + m_continuous->setChecked(m_loops->value() == -1); }); - connect(ui->continuous, &QCheckBox::toggled, this, [this](bool checked) { + connect(m_continuous, &QCheckBox::toggled, this, [this](bool checked) { if (checked) { setProperty("loops", -1); - ui->loops->setValue(-1); + m_loops->setValue(-1); } else { setProperty("loops", 1); - ui->loops->setValue(1); + m_loops->setValue(1); } }); - connect(ui->idLineEdit, &QLineEdit::editingFinished, this, [this] { + connect(m_idLineEdit, &QLineEdit::editingFinished, this, [this] { QTC_ASSERT(m_timeline.isValid(), return ); static QString lastString; - const QString newId = ui->idLineEdit->text(); + const QString newId = m_idLineEdit->text(); if (lastString == newId) return; @@ -79,11 +154,11 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent) if (error) { lastString.clear(); - ui->idLineEdit->setText(animation().id()); + m_idLineEdit->setText(animation().id()); } }); - connect(ui->running, &QCheckBox::clicked, this, [this](bool checked) { + connect(m_running, &QCheckBox::clicked, this, [this](bool checked) { if (checked) { setProperty("running", true); } else { @@ -91,7 +166,7 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent) } }); - connect(ui->pingPong, &QCheckBox::clicked, this, [this](bool checked) { + connect(m_pingPong, &QCheckBox::clicked, this, [this](bool checked) { if (checked) { setProperty("pingPong", true); } else { @@ -99,7 +174,7 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent) } }); - connect(ui->transitionToState, &QComboBox::activated, this, [this](int index) { + connect(m_transitionToState, &QComboBox::activated, this, [this](int index) { if (!m_animation.isValid()) return; if (!m_animation.view()->rootModelNode().hasId()) @@ -116,16 +191,11 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent) } else { m_animation.signalHandlerProperty("onFinished") .setSource(rootNode.id() + ".state = \"" - + ui->transitionToState->currentText() + "\""); + + m_transitionToState->currentText() + "\""); } }); } -TimelineAnimationForm::~TimelineAnimationForm() -{ - delete ui; -} - void TimelineAnimationForm::setup(const ModelNode &animation) { m_timeline = QmlTimeline(animation.parentProperty().parentModelNode()); @@ -151,40 +221,40 @@ void TimelineAnimationForm::setupAnimation() if (m_animation.isValid()) { setEnabled(true); - ui->idLineEdit->setText(m_animation.id()); + m_idLineEdit->setText(m_animation.id()); if (m_animation.hasVariantProperty("duration")) - ui->duration->setValue(m_animation.variantProperty("duration").value().toInt()); + m_duration->setValue(m_animation.variantProperty("duration").value().toInt()); else - ui->duration->setValue(0); + m_duration->setValue(0); - ui->startFrame->setValue(m_animation.variantProperty("from").value().toInt()); - ui->endFrame->setValue(m_animation.variantProperty("to").value().toInt()); + m_startFrame->setValue(m_animation.variantProperty("from").value().toInt()); + m_endFrame->setValue(m_animation.variantProperty("to").value().toInt()); if (m_animation.hasVariantProperty("loops")) - ui->loops->setValue(m_animation.variantProperty("loops").value().toInt()); + m_loops->setValue(m_animation.variantProperty("loops").value().toInt()); else - ui->loops->setValue(0); + m_loops->setValue(0); if (m_animation.hasVariantProperty("running")) - ui->running->setChecked(m_animation.variantProperty("running").value().toBool()); + m_running->setChecked(m_animation.variantProperty("running").value().toBool()); else - ui->running->setChecked(false); + m_running->setChecked(false); if (m_animation.hasVariantProperty("pingPong")) - ui->pingPong->setChecked(m_animation.variantProperty("pingPong").value().toBool()); + m_pingPong->setChecked(m_animation.variantProperty("pingPong").value().toBool()); else - ui->pingPong->setChecked(false); + m_pingPong->setChecked(false); - ui->continuous->setChecked(ui->loops->value() == -1); + m_continuous->setChecked(m_loops->value() == -1); } populateStateComboBox(); - ui->duration->setEnabled(m_animation.isValid()); - ui->running->setEnabled(m_animation.isValid()); - ui->continuous->setEnabled(m_animation.isValid()); - ui->loops->setEnabled(m_animation.isValid()); + m_duration->setEnabled(m_animation.isValid()); + m_running->setEnabled(m_animation.isValid()); + m_continuous->setEnabled(m_animation.isValid()); + m_loops->setEnabled(m_animation.isValid()); } void TimelineAnimationForm::setProperty(const PropertyName &propertyName, const QVariant &value) @@ -207,15 +277,15 @@ void TimelineAnimationForm::connectSpinBox(QSpinBox *spinBox, const PropertyName void TimelineAnimationForm::populateStateComboBox() { - ui->transitionToState->clear(); - ui->transitionToState->addItem(tr("none")); - ui->transitionToState->addItem(tr("Base State")); + m_transitionToState->clear(); + m_transitionToState->addItem(tr("none")); + m_transitionToState->addItem(tr("Base State")); if (!m_animation.isValid()) return; QmlObjectNode rootNode = QmlObjectNode(m_animation.view()->rootModelNode()); if (rootNode.isValid() && rootNode.modelNode().hasId()) { for (const QmlModelState &state : QmlVisualNode(rootNode).states().allStates()) { - ui->transitionToState + m_transitionToState ->addItem(state.modelNode().variantProperty("name").value().toString(), QVariant::fromValue(state.modelNode())); } @@ -227,9 +297,9 @@ void TimelineAnimationForm::populateStateComboBox() name.chop(1); name.remove(0, 1); if (name.isEmpty()) - ui->transitionToState->setCurrentIndex(1); + m_transitionToState->setCurrentIndex(1); else - ui->transitionToState->setCurrentText(name); + m_transitionToState->setCurrentText(name); } } } diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineanimationform.h b/src/plugins/qmldesigner/components/timelineeditor/timelineanimationform.h index bc1fc08d0ca..8cdb4c1d5f0 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineanimationform.h +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineanimationform.h @@ -7,21 +7,21 @@ #include -QT_FORWARD_DECLARE_CLASS(QSpinBox) +QT_BEGIN_NAMESPACE +class QCheckBox; +class QComboBox; +class QLineEdit; +class QSpinBox; +QT_END_NAMESPACE namespace QmlDesigner { -namespace Ui { -class TimelineAnimationForm; -} - class TimelineAnimationForm : public QWidget { Q_OBJECT public: explicit TimelineAnimationForm(QWidget *parent); - ~TimelineAnimationForm() override; void setup(const ModelNode &animation); ModelNode animation() const; @@ -33,7 +33,15 @@ private: void connectSpinBox(QSpinBox *spinBox, const PropertyName &propertyName); void populateStateComboBox(); - Ui::TimelineAnimationForm *ui; + QLineEdit *m_idLineEdit; + QCheckBox *m_running; + QSpinBox *m_startFrame; + QSpinBox *m_endFrame; + QSpinBox *m_duration; + QCheckBox *m_continuous; + QSpinBox *m_loops; + QCheckBox *m_pingPong; + QComboBox *m_transitionToState; QmlTimeline m_timeline; ModelNode m_animation; diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineanimationform.ui b/src/plugins/qmldesigner/components/timelineeditor/timelineanimationform.ui deleted file mode 100644 index 3329d30af66..00000000000 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineanimationform.ui +++ /dev/null @@ -1,354 +0,0 @@ - - - QmlDesigner::TimelineAnimationForm - - - - 0 - 0 - 641 - 176 - - - - - - - Number of times the animation runs before it stops. - - - Loops: - - - - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - -1 - - - 1000 - - - - - - - Sets the animation to loop indefinitely. - - - Continuous - - - - - - - - - - - - - - - none - - - - - - - - - 160 - 0 - - - - - 75 - true - - - - Animation Settings - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 213 - 20 - - - - - - - - - 140 - 0 - - - - Name for the animation. - - - Animation ID: - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 213 - 20 - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 0 - - - 100000 - - - - - - - State to activate when the animation finishes. - - - Finished: - - - - - - - Runs the animation backwards to the beginning when it reaches the end. - - - Ping pong - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 213 - 20 - - - - - - - - - 140 - 0 - - - - Transition to state: - - - - - - - animation02 - - - - - - - true - - - Runs the animation automatically when the base state is active. - - - Running in base state - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - -100000 - - - 100000 - - - - - - - First frame of the animation. - - - Start frame: - - - - - - - false - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 213 - 20 - - - - - - - - Length of the animation in milliseconds. If you set a shorter duration than the number of frames, frames are left out from the end of the animation. - - - Duration: - - - - - - - Last frame of the animation. - - - End frame: - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - -100000 - - - 100000 - - - - - - - - From c9c029ebd4079babab66af1e4ffb4e59f0040d47 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 13 Jun 2023 15:24:12 +0200 Subject: [PATCH 0037/1777] QmlDesigner: Inline timelinesettingsdialog.ui Change-Id: Ib590944e3dcf8f1069bdeeb08b206a9ca9de5ce1 Reviewed-by: hjk --- src/plugins/qmldesigner/CMakeLists.txt | 3 +- .../timelineeditor/timelinesettingsdialog.cpp | 83 +++++++++++------- .../timelineeditor/timelinesettingsdialog.h | 15 ++-- .../timelineeditor/timelinesettingsdialog.ui | 84 ------------------- 4 files changed, 60 insertions(+), 125 deletions(-) delete mode 100644 src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.ui diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index 92d037e9b07..5935933f645 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -984,8 +984,7 @@ extend_qtc_plugin(QmlDesigner timelinepropertyitem.cpp timelinepropertyitem.h timelinesectionitem.cpp timelinesectionitem.h timelineselectiontool.cpp timelineselectiontool.h - timelinesettingsdialog.cpp - timelinesettingsdialog.h timelinesettingsdialog.ui + timelinesettingsdialog.cpp timelinesettingsdialog.h timelinesettingsmodel.cpp timelinesettingsmodel.h timelinetoolbar.cpp timelinetoolbar.h timelinetoolbutton.cpp timelinetoolbutton.h diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.cpp index bd4b1c23cdd..e07d394dc13 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "timelinesettingsdialog.h" -#include "ui_timelinesettingsdialog.h" #include "timelineanimationform.h" #include "timelineform.h" @@ -19,9 +18,15 @@ #include #include +#include #include +#include +#include #include +#include +#include +#include #include namespace QmlDesigner { @@ -75,12 +80,12 @@ static void setTabForAnimation(QTabWidget *tabWidget, const ModelNode &animation TimelineSettingsDialog::TimelineSettingsDialog(QWidget *parent, TimelineView *view) : QDialog(parent) - , ui(new Ui::TimelineSettingsDialog) , m_timelineView(view) { - m_timelineSettingsModel = new TimelineSettingsModel(this, view); + resize(520, 600); + setModal(true); - ui->setupUi(this); + m_timelineSettingsModel = new TimelineSettingsModel(this, view); auto *timelineCornerWidget = new QToolBar; @@ -93,7 +98,7 @@ TimelineSettingsDialog::TimelineSettingsDialog(QWidget *parent, TimelineView *vi }); connect(timelineRemoveAction, &QAction::triggered, this, [this]() { - QmlTimeline timeline = getTimelineFromTabWidget(ui->timelineTab); + QmlTimeline timeline = getTimelineFromTabWidget(m_timelineTab); if (timeline.isValid()) { timeline.destroy(); setupTimelines(QmlTimeline()); @@ -103,10 +108,10 @@ TimelineSettingsDialog::TimelineSettingsDialog(QWidget *parent, TimelineView *vi timelineCornerWidget->addAction(timelineAddAction); timelineCornerWidget->addAction(timelineRemoveAction); - ui->timelineTab->setCornerWidget(timelineCornerWidget, Qt::TopRightCorner); + m_timelineTab = new QTabWidget; + m_timelineTab->setCornerWidget(timelineCornerWidget, Qt::TopRightCorner); auto *animationCornerWidget = new QToolBar; - auto *animationAddAction = new QAction(TimelineIcons::ADD_TIMELINE.icon(), tr("Add Animation")); auto *animationRemoveAction = new QAction(TimelineIcons::REMOVE_TIMELINE.icon(), tr("Remove Animation")); @@ -119,21 +124,40 @@ TimelineSettingsDialog::TimelineSettingsDialog(QWidget *parent, TimelineView *vi }); connect(animationRemoveAction, &QAction::triggered, this, [this]() { - ModelNode node = getAnimationFromTabWidget(ui->animationTab); + ModelNode node = getAnimationFromTabWidget(m_animationTab); if (node.isValid()) { node.destroy(); setupAnimations(m_currentTimeline); } }); - ui->animationTab->setCornerWidget(animationCornerWidget, Qt::TopRightCorner); - ui->buttonBox->clearFocus(); + m_animationTab = new QTabWidget; + m_animationTab->setCornerWidget(animationCornerWidget, Qt::TopRightCorner); + + m_tableView = new QTableView; + QSizePolicy sp(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); + sp.setVerticalStretch(1); + m_tableView->setSizePolicy(sp); + + auto buttonBox = new QDialogButtonBox; + buttonBox->setStandardButtons(QDialogButtonBox::Close); + buttonBox->clearFocus(); + connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); + + using namespace Layouting; + Column { + m_timelineTab, + m_animationTab, + m_tableView, + buttonBox, + }.attachTo(this); setupTimelines(QmlTimeline()); setupAnimations(m_currentTimeline); - connect(ui->timelineTab, &QTabWidget::currentChanged, this, [this]() { - m_currentTimeline = getTimelineFromTabWidget(ui->timelineTab); + connect(m_timelineTab, &QTabWidget::currentChanged, this, [this]() { + m_currentTimeline = getTimelineFromTabWidget(m_timelineTab); setupAnimations(m_currentTimeline); }); setupTableView(); @@ -142,12 +166,7 @@ TimelineSettingsDialog::TimelineSettingsDialog(QWidget *parent, TimelineView *vi void TimelineSettingsDialog::setCurrentTimeline(const QmlTimeline &timeline) { m_currentTimeline = timeline; - setTabForTimeline(ui->timelineTab, m_currentTimeline); -} - -TimelineSettingsDialog::~TimelineSettingsDialog() -{ - delete ui; + setTabForTimeline(m_timelineTab, m_currentTimeline); } void TimelineSettingsDialog::keyPressEvent(QKeyEvent *event) @@ -165,17 +184,17 @@ void TimelineSettingsDialog::keyPressEvent(QKeyEvent *event) void TimelineSettingsDialog::setupTableView() { - ui->tableView->setModel(m_timelineSettingsModel); - m_timelineSettingsModel->setupDelegates(ui->tableView); - ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); - ui->tableView->verticalHeader()->hide(); - ui->tableView->setSelectionMode(QAbstractItemView::NoSelection); + m_tableView->setModel(m_timelineSettingsModel); + m_timelineSettingsModel->setupDelegates(m_tableView); + m_tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + m_tableView->verticalHeader()->hide(); + m_tableView->setSelectionMode(QAbstractItemView::NoSelection); m_timelineSettingsModel->resetModel(); } void TimelineSettingsDialog::setupTimelines(const QmlTimeline &timeline) { - deleteAllTabs(ui->timelineTab); + deleteAllTabs(m_timelineTab); const QList &timelines = m_timelineView->getTimelines(); @@ -183,7 +202,7 @@ void TimelineSettingsDialog::setupTimelines(const QmlTimeline &timeline) m_currentTimeline = QmlTimeline(); auto timelineForm = new TimelineForm(this); timelineForm->setDisabled(true); - ui->timelineTab->addTab(timelineForm, tr("No Timeline")); + m_timelineTab->addTab(timelineForm, tr("No Timeline")); return; } @@ -196,14 +215,14 @@ void TimelineSettingsDialog::setupTimelines(const QmlTimeline &timeline) m_currentTimeline = timelines.constFirst(); } - setTabForTimeline(ui->timelineTab, m_currentTimeline); + setTabForTimeline(m_timelineTab, m_currentTimeline); setupAnimations(m_currentTimeline); m_timelineSettingsModel->resetModel(); } void TimelineSettingsDialog::setupAnimations(const ModelNode &animation) { - deleteAllTabs(ui->animationTab); + deleteAllTabs(m_animationTab); const QList animations = m_timelineView->getAnimations(m_currentTimeline); @@ -213,7 +232,7 @@ void TimelineSettingsDialog::setupAnimations(const ModelNode &animation) if (animations.isEmpty()) { auto animationForm = new TimelineAnimationForm(this); animationForm->setDisabled(true); - ui->animationTab->addTab(animationForm, tr("No Animation")); + m_animationTab->addTab(animationForm, tr("No Animation")); if (currentTimelineForm()) currentTimelineForm()->setHasAnimation(false); } else { @@ -222,14 +241,14 @@ void TimelineSettingsDialog::setupAnimations(const ModelNode &animation) } if (animation.isValid()) - setTabForAnimation(ui->animationTab, animation); + setTabForAnimation(m_animationTab, animation); m_timelineSettingsModel->resetModel(); } void TimelineSettingsDialog::addTimelineTab(const QmlTimeline &node) { auto timelineForm = new TimelineForm(this); - ui->timelineTab->addTab(timelineForm, node.modelNode().displayName()); + m_timelineTab->addTab(timelineForm, node.modelNode().displayName()); timelineForm->setTimeline(node); setupAnimations(ModelNode()); } @@ -237,13 +256,13 @@ void TimelineSettingsDialog::addTimelineTab(const QmlTimeline &node) void TimelineSettingsDialog::addAnimationTab(const ModelNode &node) { auto timelineAnimationForm = new TimelineAnimationForm(this); - ui->animationTab->addTab(timelineAnimationForm, node.displayName()); + m_animationTab->addTab(timelineAnimationForm, node.displayName()); timelineAnimationForm->setup(node); } TimelineForm *TimelineSettingsDialog::currentTimelineForm() const { - return qobject_cast(ui->timelineTab->currentWidget()); + return qobject_cast(m_timelineTab->currentWidget()); } } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.h b/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.h index a1626bc4077..e31cc3f1e5a 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.h +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.h @@ -7,7 +7,11 @@ #include -QT_FORWARD_DECLARE_CLASS(QSpinBox) +QT_BEGIN_NAMESPACE +class QSpinBox; +class QTabWidget; +class QTableView; +QT_END_NAMESPACE namespace QmlDesigner { @@ -16,10 +20,6 @@ class TimelineAnimationForm; class TimelineView; class TimelineSettingsModel; -namespace Ui { -class TimelineSettingsDialog; -} - class TimelineSettingsDialog : public QDialog { Q_OBJECT @@ -27,7 +27,6 @@ class TimelineSettingsDialog : public QDialog public: explicit TimelineSettingsDialog(QWidget *parent, TimelineView *view); void setCurrentTimeline(const QmlTimeline &timeline); - ~TimelineSettingsDialog() override; protected: void keyPressEvent(QKeyEvent *event) override; @@ -42,7 +41,9 @@ private: TimelineForm *currentTimelineForm() const; - Ui::TimelineSettingsDialog *ui; + QTabWidget *m_timelineTab; + QTabWidget *m_animationTab; + QTableView *m_tableView; TimelineView *m_timelineView; QmlTimeline m_currentTimeline; diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.ui b/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.ui deleted file mode 100644 index f3dfa6f0947..00000000000 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.ui +++ /dev/null @@ -1,84 +0,0 @@ - - - QmlDesigner::TimelineSettingsDialog - - - - 0 - 0 - 519 - 582 - - - - Timeline Settings - - - true - - - - - - -1 - - - - - - - -1 - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close - - - - - - - - - buttonBox - accepted() - QmlDesigner::TimelineSettingsDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - QmlDesigner::TimelineSettingsDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - From eb7d0727e6f62d61d1fb81ce931aacf147b82794 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 22 Jun 2023 13:53:01 +0200 Subject: [PATCH 0038/1777] Copilot: Fix compile Change-Id: If9e2c6486e2ac9b80069947063e80336567fbdbe Reviewed-by: hjk --- src/plugins/copilot/copilotoptionspage.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/copilot/copilotoptionspage.cpp b/src/plugins/copilot/copilotoptionspage.cpp index f37042b2d12..2b7374846fc 100644 --- a/src/plugins/copilot/copilotoptionspage.cpp +++ b/src/plugins/copilot/copilotoptionspage.cpp @@ -47,9 +47,9 @@ public: "the plugin will find the agent.js file automatically.\n\n" "Otherwise you need to specify the path to the %2 " "file from the Copilot neovim plugin.", - "Markdown text for the copilot instruction label").arg( - "[README.md](https://github.com/github/copilot.vim)", - "[agent.js](https://github.com/github/copilot.vim/tree/release/copilot/dist)")); + "Markdown text for the copilot instruction label") + .arg("[README.md](https://github.com/github/copilot.vim)") + .arg("[agent.js](https://github.com/github/copilot.vim/tree/release/copilot/dist)")); Column { authWidget, br, From 428f62a7fe6ecfeaff02559b64f97b1b3c2a20ab Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 9 Jun 2023 14:43:47 +0200 Subject: [PATCH 0039/1777] Meson: Inline NativeFileGenerator into its only user Also, filepathify and simplify surrounding code a bit. Change-Id: I963bbc95a81d753918b6734870630b539378f03e Reviewed-by: Alessandro Portale --- .../mesonprojectmanager/CMakeLists.txt | 2 - .../machinefilemanager.cpp | 121 +++++++++--------- .../mesonprojectmanager/machinefilemanager.h | 12 +- .../mesonprojectmanager.qbs | 2 - .../nativefilegenerator.cpp | 46 ------- .../mesonprojectmanager/nativefilegenerator.h | 24 ---- 6 files changed, 62 insertions(+), 145 deletions(-) delete mode 100644 src/plugins/mesonprojectmanager/nativefilegenerator.cpp delete mode 100644 src/plugins/mesonprojectmanager/nativefilegenerator.h diff --git a/src/plugins/mesonprojectmanager/CMakeLists.txt b/src/plugins/mesonprojectmanager/CMakeLists.txt index 3c541a1219e..a9e46077418 100644 --- a/src/plugins/mesonprojectmanager/CMakeLists.txt +++ b/src/plugins/mesonprojectmanager/CMakeLists.txt @@ -49,8 +49,6 @@ add_qtc_plugin(MesonProjectManager mesontools.h mesonwrapper.cpp mesonwrapper.h - nativefilegenerator.cpp - nativefilegenerator.h ninjabuildstep.cpp ninjabuildstep.h ninjaparser.cpp diff --git a/src/plugins/mesonprojectmanager/machinefilemanager.cpp b/src/plugins/mesonprojectmanager/machinefilemanager.cpp index 2ecf7b70e3a..c340d7170e2 100644 --- a/src/plugins/mesonprojectmanager/machinefilemanager.cpp +++ b/src/plugins/mesonprojectmanager/machinefilemanager.cpp @@ -5,115 +5,110 @@ #include "kitdata.h" #include "kithelper.h" -#include "nativefilegenerator.h" #include -#include +#include +#include +#include +#include -#include -#include -#include +#include +#include #include -namespace MesonProjectManager { -namespace Internal { +using namespace ProjectExplorer; +using namespace Utils; + +namespace MesonProjectManager::Internal { const char MACHINE_FILE_PREFIX[] = "Meson-MachineFile-"; const char MACHINE_FILE_EXT[] = ".ini"; -template -bool withFile(const Utils::FilePath &path, const F &f) -{ - QFile file(path.toString()); - if (file.open(QIODevice::WriteOnly)) { - f(&file); - return file.flush(); - } - return false; -} - -Utils::FilePath MachineFilesDir() +static FilePath machineFilesDir() { return Core::ICore::userResourcePath("Meson-machine-files"); } MachineFileManager::MachineFileManager() { - using namespace ProjectExplorer; - connect(KitManager::instance(), - &KitManager::kitAdded, - this, - &MachineFileManager::addMachineFile); - connect(KitManager::instance(), - &KitManager::kitUpdated, - this, - &MachineFileManager::updateMachineFile); - connect(KitManager::instance(), - &KitManager::kitRemoved, - this, - &MachineFileManager::removeMachineFile); - connect(KitManager::instance(), - &KitManager::kitsLoaded, - this, - &MachineFileManager::cleanupMachineFiles); + connect(KitManager::instance(), &KitManager::kitAdded, + this, &MachineFileManager::addMachineFile); + connect(KitManager::instance(), &KitManager::kitUpdated, + this, &MachineFileManager::updateMachineFile); + connect(KitManager::instance(), &KitManager::kitRemoved, + this, &MachineFileManager::removeMachineFile); + connect(KitManager::instance(), &KitManager::kitsLoaded, + this, &MachineFileManager::cleanupMachineFiles); } -Utils::FilePath MachineFileManager::machineFile(const ProjectExplorer::Kit *kit) +FilePath MachineFileManager::machineFile(const Kit *kit) { QTC_ASSERT(kit, return {}); auto baseName = QString("%1%2%3").arg(MACHINE_FILE_PREFIX).arg(kit->id().toString()).arg(MACHINE_FILE_EXT); baseName = baseName.remove('{').remove('}'); - return MachineFilesDir().pathAppended(baseName); + return machineFilesDir().pathAppended(baseName); } -void MachineFileManager::addMachineFile(const ProjectExplorer::Kit *kit) +void MachineFileManager::addMachineFile(const Kit *kit) { - auto filePath = machineFile(kit); + FilePath filePath = machineFile(kit); QTC_ASSERT(!filePath.isEmpty(), return ); - auto data = KitHelper::kitData(kit); - QTC_ASSERT(withFile(filePath, - [&data](QFile *file) { NativeFileGenerator::makeNativeFile(file, data); }), - return ); + auto kitData = KitHelper::kitData(kit); + + auto entry = [](const QString &key, const QString &value) { + return QString("%1 = '%2'\n").arg(key).arg(value).toUtf8(); + }; + + QByteArray ba = "[binaries]\n"; + ba += entry("c", kitData.cCompilerPath); + ba += entry("cpp", kitData.cxxCompilerPath); + ba += entry("qmake", kitData.qmakePath); + if (kitData.qtVersion == QtMajorVersion::Qt4) + ba += entry("qmake-qt4", kitData.qmakePath); + else if (kitData.qtVersion == QtMajorVersion::Qt5) + ba += entry("qmake-qt5", kitData.qmakePath); + else if (kitData.qtVersion == QtMajorVersion::Qt6) + ba += entry("qmake-qt6", kitData.qmakePath); + ba += entry("cmake", kitData.cmakePath); + + filePath.writeFileContents(ba); } -void MachineFileManager::removeMachineFile(const ProjectExplorer::Kit *kit) +void MachineFileManager::removeMachineFile(const Kit *kit) { - auto filePath = machineFile(kit); + FilePath filePath = machineFile(kit); if (filePath.exists()) - QFile::remove(filePath.toString()); + filePath.removeFile(); } -void MachineFileManager::updateMachineFile(const ProjectExplorer::Kit *kit) +void MachineFileManager::updateMachineFile(const Kit *kit) { addMachineFile(kit); } void MachineFileManager::cleanupMachineFiles() { - const auto kits = ProjectExplorer::KitManager::kits(); - auto machineFilesDir = QDir(MachineFilesDir().toString()); - if (!machineFilesDir.exists()) { - machineFilesDir.mkdir(machineFilesDir.path()); - } - auto machineFiles = QDir(MachineFilesDir().toString()) - .entryList( - {QString("%1*%2").arg(MACHINE_FILE_PREFIX).arg(MACHINE_FILE_EXT)}); - QStringList expected; - for (auto const *kit : kits) { - QString fname = machineFile(kit).toString(); + FilePath dir = machineFilesDir(); + dir.ensureWritableDir(); + + const FileFilter filter = {{QString("%1*%2").arg(MACHINE_FILE_PREFIX).arg(MACHINE_FILE_EXT)}}; + const FilePaths machineFiles = dir.dirEntries(filter); + + FilePaths expected; + for (Kit const *kit : KitManager::kits()) { + const FilePath fname = machineFile(kit); expected.push_back(fname); if (!machineFiles.contains(fname)) addMachineFile(kit); } - for (const auto &file : machineFiles) { + for (const FilePath &file : machineFiles) { if (!expected.contains(file)) - QFile::remove(file); + file.removeFile(); } } -} // namespace Internal -} // namespace MesonProjectManager +} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/machinefilemanager.h b/src/plugins/mesonprojectmanager/machinefilemanager.h index e6cab231bbf..5a3a9a9bd71 100644 --- a/src/plugins/mesonprojectmanager/machinefilemanager.h +++ b/src/plugins/mesonprojectmanager/machinefilemanager.h @@ -3,17 +3,14 @@ #pragma once -#include -#include +#include -#include +namespace ProjectExplorer { class Kit; } -namespace MesonProjectManager { -namespace Internal { +namespace MesonProjectManager::Internal { class MachineFileManager final : public QObject { - Q_OBJECT public: MachineFileManager(); @@ -26,5 +23,4 @@ private: void cleanupMachineFiles(); }; -} // namespace Internal -} // namespace MesonProjectManager +} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs index c721ab2d207..15df062dfcc 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs +++ b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs @@ -31,8 +31,6 @@ Project { "kithelper.h", "machinefilemanager.cpp", "machinefilemanager.h", - "nativefilegenerator.cpp", - "nativefilegenerator.h", "mesonactionsmanager.cpp", "mesonactionsmanager.h", "buildoptions.h", diff --git a/src/plugins/mesonprojectmanager/nativefilegenerator.cpp b/src/plugins/mesonprojectmanager/nativefilegenerator.cpp deleted file mode 100644 index 9f920aa404d..00000000000 --- a/src/plugins/mesonprojectmanager/nativefilegenerator.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (C) 2020 Alexis Jeandet. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "nativefilegenerator.h" - -#include -#include -#include -#include - -#include -#include - -namespace MesonProjectManager { -namespace Internal { - -NativeFileGenerator::NativeFileGenerator() {} - -inline void addEntry(QIODevice *nativeFile, const QString &key, const QString &value) -{ - nativeFile->write(QString("%1 = '%2'\n").arg(key).arg(value).toUtf8()); -} - -void writeBinariesSection(QIODevice *nativeFile, const KitData &kitData) -{ - nativeFile->write("[binaries]\n"); - addEntry(nativeFile, "c", kitData.cCompilerPath); - addEntry(nativeFile, "cpp", kitData.cxxCompilerPath); - addEntry(nativeFile, "qmake", kitData.qmakePath); - if (kitData.qtVersion == Utils::QtMajorVersion::Qt4) - addEntry(nativeFile, QString{"qmake-qt4"}, kitData.qmakePath); - else if (kitData.qtVersion == Utils::QtMajorVersion::Qt5) - addEntry(nativeFile, QString{"qmake-qt5"}, kitData.qmakePath); - else if (kitData.qtVersion == Utils::QtMajorVersion::Qt6) - addEntry(nativeFile, QString{"qmake-qt6"}, kitData.qmakePath); - addEntry(nativeFile, "cmake", kitData.cmakePath); -} - -void NativeFileGenerator::makeNativeFile(QIODevice *nativeFile, const KitData &kitData) -{ - QTC_ASSERT(nativeFile, return ); - writeBinariesSection(nativeFile, kitData); -} - -} // namespace Internal -} // namespace MesonProjectManager diff --git a/src/plugins/mesonprojectmanager/nativefilegenerator.h b/src/plugins/mesonprojectmanager/nativefilegenerator.h deleted file mode 100644 index 21dba07ba19..00000000000 --- a/src/plugins/mesonprojectmanager/nativefilegenerator.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2020 Alexis Jeandet. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "kitdata.h" - -#include - -#include - -namespace MesonProjectManager { -namespace Internal { - -class NativeFileGenerator -{ - NativeFileGenerator(); - -public: - static void makeNativeFile(QIODevice *nativeFile, const KitData &kitData); -}; - -} // namespace Internal -} // namespace MesonProjectManager From 39a2145e435befb4df12af4a4ac2899d87dcd682 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 23 Jun 2023 08:42:03 +0200 Subject: [PATCH 0040/1777] Debugger: Fix compile Amends 0cf14773244bf84d4a90f75f978792a12f96ab57. Change-Id: I6f34277eb888ef29e8bf53e88bb670d1969f6cd2 Reviewed-by: hjk --- src/plugins/debugger/debuggeractions.h | 2 +- src/plugins/debugger/gdb/gdbsettings.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index df2560ed72f..843947ab905 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -3,7 +3,7 @@ #pragma once -#include +#include "gdb/gdbsettings.h" #include #include diff --git a/src/plugins/debugger/gdb/gdbsettings.cpp b/src/plugins/debugger/gdb/gdbsettings.cpp index 62f4dec40cf..2adeeb7931a 100644 --- a/src/plugins/debugger/gdb/gdbsettings.cpp +++ b/src/plugins/debugger/gdb/gdbsettings.cpp @@ -3,6 +3,7 @@ #include "gdbsettings.h" +#include #include #include #include @@ -12,8 +13,6 @@ #include -#include - using namespace Core; using namespace Utils; From 35e9b13e1517da51846f923d7bda7bd5ca5f36d5 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 22 Jun 2023 17:35:52 +0200 Subject: [PATCH 0041/1777] App: Fix a warning "QGuiApplication::setDesktopFileName: the specified desktop file name ends with .desktop. For compatibility reasons, the .desktop suffix will be removed. Please specify a desktop file name without .desktop suffix" Change-Id: I84fa4d6dbed9ab95f9f90b452915bdce290743f3 Reviewed-by: Eike Ziller Reviewed-by: --- src/app/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index d4c4a47b8c8..89bf5f74127 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -688,7 +688,7 @@ int main(int argc, char **argv) if (!overrideCodecForLocale.isEmpty()) QTextCodec::setCodecForLocale(QTextCodec::codecForName(overrideCodecForLocale)); - app.setDesktopFileName("org.qt-project.qtcreator.desktop"); + app.setDesktopFileName("org.qt-project.qtcreator"); // Make sure we honor the system's proxy settings QNetworkProxyFactory::setUseSystemConfiguration(true); From bf46b4d557deda0b88dd3b3a54c297d59720f4e9 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 22 Jun 2023 13:18:46 +0200 Subject: [PATCH 0042/1777] QmlProjectManager: Compile fix after Qt source compatibility break error: operands to '?:' have different types 'QStringBuilder' and 'QStringBuilder' Caused by af8f9a2a6e3dbc8. Change-Id: Ib3dfca2cb5f1cb1855f25d178f63898eb6745c46 Reviewed-by: Reviewed-by: Eike Ziller --- src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp b/src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp index a9f35c2c5e2..5a3bedf098a 100644 --- a/src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp +++ b/src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp @@ -360,8 +360,8 @@ void CmakeFileGenerator::generateImportCmake(const FilePath &dir, const QString continue; fileContent.append(QString(ADD_SUBDIR).arg(subDir.fileName())); QString prefix = modulePrefix.isEmpty() ? - modulePrefix % subDir.fileName() : - QString(modulePrefix + '.') + subDir.fileName(); + QString(modulePrefix % subDir.fileName()) : + QString(QString(modulePrefix + '.') + subDir.fileName()); if (getDirectoryQmls(subDir).isEmpty()) { generateImportCmake(subDir, prefix); } else { From ee2fa69defcd3d4f1feb80a4320431b4beb9ab68 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 22 Jun 2023 09:11:07 +0200 Subject: [PATCH 0043/1777] RemoteLinux: Generalize deploy step Instead of three different deploy steps we use only the RSyncDeployStep which can be configured to each of the three file transfer methods. The SupportsRSync constant is moved to projectexplorer so that it can be used by all devices. The RSyncDeployStep checks which transfer method is available based on source and target devices. An option is added for the user to force a different method in case of issues. Change-Id: I2b1eb39b5bd4a30d0f879d18317b7677d127f48f Reviewed-by: hjk --- .../boot2qt/qdbdeployconfigurationfactory.cpp | 5 +- .../devicesupport/desktopdevice.cpp | 10 ++++ .../devicesupport/desktopdevice.h | 2 + .../projectexplorerconstants.h | 4 ++ src/plugins/remotelinux/linuxdevicetester.cpp | 14 ++--- .../remotelinux/remotelinux_constants.h | 2 - .../remotelinuxdeployconfiguration.cpp | 31 +--------- src/plugins/remotelinux/rsyncdeploystep.cpp | 56 ++++++++++++++++++- 8 files changed, 82 insertions(+), 42 deletions(-) diff --git a/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp b/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp index 3abb700df1d..eb5a180500e 100644 --- a/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp +++ b/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -37,14 +38,14 @@ QdbDeployConfigurationFactory::QdbDeployConfigurationFactory() if (buildDevice && buildDevice->rootPath().needsDevice()) return false; return !device - || (device && device->extraData(RemoteLinux::Constants::SupportsRSync).toBool()); + || (device && device->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool()); }); addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) { auto device = DeviceKitAspect::device(target->kit()); auto buildDevice = BuildDeviceKitAspect::device(target->kit()); if (buildDevice && buildDevice->rootPath().needsDevice()) return false; - return device && !device->extraData(RemoteLinux::Constants::SupportsRSync).toBool(); + return device && !device->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool(); }); // This step is for: // a) A remote build device, as they do not support real rsync yet. diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 099040d6b24..33ed3287cf0 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -135,4 +135,14 @@ FilePath DesktopDevice::rootPath() const return IDevice::rootPath(); } +void DesktopDevice::fromMap(const QVariantMap &map) +{ + IDevice::fromMap(map); + + const FilePath rsync = FilePath::fromString("rsync").searchInPath(); + const FilePath sftp = FilePath::fromString("sftp").searchInPath(); + setExtraData(Constants::SUPPORTS_RSYNC, rsync.isExecutableFile()); + setExtraData(Constants::SUPPORTS_SFTP, sftp.isExecutableFile()); +} + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.h b/src/plugins/projectexplorer/devicesupport/desktopdevice.h index d9cafbfda9a..bc4c353b465 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.h @@ -37,6 +37,8 @@ public: Utils::FilePath rootPath() const override; Utils::FilePath filePath(const QString &pathOnDevice) const override; + void fromMap(const QVariantMap &map) override; + protected: DesktopDevice(); diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index 75054120a83..50bacef3a41 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -213,6 +213,10 @@ const char SESSION_TASKFILE_KEY[] = "TaskList.File"; const char CLEAR_SYSTEM_ENVIRONMENT_KEY[] = "ProjectExplorer.BuildConfiguration.ClearSystemEnvironment"; const char USER_ENVIRONMENT_CHANGES_KEY[] = "ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"; +// Called "RemoteLinux." for backwards compatibility +const char SUPPORTS_RSYNC[] = "RemoteLinux.SupportsRSync"; +const char SUPPORTS_SFTP[] = "RemoteLinux.SupportsSftp"; + // UI texts PROJECTEXPLORER_EXPORT QString msgAutoDetected(); PROJECTEXPLORER_EXPORT QString msgAutoDetectedToolTip(); diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp index 5392fb4245c..b001fb8654f 100644 --- a/src/plugins/remotelinux/linuxdevicetester.cpp +++ b/src/plugins/remotelinux/linuxdevicetester.cpp @@ -3,11 +3,11 @@ #include "linuxdevicetester.h" -#include "remotelinux_constants.h" #include "remotelinuxtr.h" #include #include +#include #include #include @@ -177,9 +177,9 @@ GroupItem GenericLinuxDeviceTesterPrivate::transferTask(FileTransferMethod metho const QString methodName = FileTransfer::transferMethodName(method); emit q->progressMessage(Tr::tr("\"%1\" is functional.\n").arg(methodName)); if (method == FileTransferMethod::Rsync) - m_device->setExtraData(Constants::SupportsRSync, true); + m_device->setExtraData(Constants::SUPPORTS_RSYNC, true); else if (method == FileTransferMethod::Sftp) - m_device->setExtraData(Constants::SupportsSftp, true); + m_device->setExtraData(Constants::SUPPORTS_SFTP, true); else storage->useGenericCopy = true; }; @@ -197,12 +197,12 @@ GroupItem GenericLinuxDeviceTesterPrivate::transferTask(FileTransferMethod metho } emit q->errorMessage(error); if (method == FileTransferMethod::Rsync) - m_device->setExtraData(Constants::SupportsRSync, false); + m_device->setExtraData(Constants::SUPPORTS_RSYNC, false); else if (method == FileTransferMethod::Sftp) - m_device->setExtraData(Constants::SupportsSftp, false); + m_device->setExtraData(Constants::SUPPORTS_SFTP, false); - const QVariant supportsRSync = m_device->extraData(Constants::SupportsRSync); - const QVariant supportsSftp = m_device->extraData(Constants::SupportsSftp); + const QVariant supportsRSync = m_device->extraData(Constants::SUPPORTS_RSYNC); + const QVariant supportsSftp = m_device->extraData(Constants::SUPPORTS_SFTP); if (supportsRSync.isValid() && !supportsRSync.toBool() && supportsSftp.isValid() && !supportsSftp.toBool()) { const QString generic = FileTransfer::transferMethodName(FileTransferMethod::GenericCopy); diff --git a/src/plugins/remotelinux/remotelinux_constants.h b/src/plugins/remotelinux/remotelinux_constants.h index 9c428650c73..24821c6f36a 100644 --- a/src/plugins/remotelinux/remotelinux_constants.h +++ b/src/plugins/remotelinux/remotelinux_constants.h @@ -19,8 +19,6 @@ const char RsyncDeployStepId[] = "RemoteLinux.RsyncDeployStep"; const char CustomCommandDeployStepId[] = "RemoteLinux.GenericRemoteLinuxCustomCommandDeploymentStep"; const char KillAppStepId[] = "RemoteLinux.KillAppStep"; -const char SupportsRSync[] = "RemoteLinux.SupportsRSync"; -const char SupportsSftp[] = "RemoteLinux.SupportsSftp"; const char SourceProfile[] = "RemoteLinux.SourceProfile"; const char LinkDevice[] = "RemoteLinux.LinkDevice"; diff --git a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp index 94bfbfb981f..7615a4ef553 100644 --- a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp @@ -17,24 +17,6 @@ using namespace ProjectExplorer; namespace RemoteLinux::Internal { -FileTransferMethod defaultTransferMethod(Kit *kit) -{ - auto runDevice = DeviceKitAspect::device(kit); - auto buildDevice = BuildDeviceKitAspect::device(kit); - - if (runDevice != buildDevice) { - // FIXME: That's not the full truth, we need support from the build - // device, too. - if (runDevice && runDevice->extraData(Constants::SupportsRSync).toBool()) - return FileTransferMethod::Rsync; - } - - if (runDevice && runDevice->extraData(Constants::SupportsSftp).toBool()) - return FileTransferMethod::Sftp; - - return FileTransferMethod::GenericCopy; -} - RemoteLinuxDeployConfigurationFactory::RemoteLinuxDeployConfigurationFactory() { setConfigBaseId(RemoteLinux::Constants::DeployToGenericLinux); @@ -58,17 +40,8 @@ RemoteLinuxDeployConfigurationFactory::RemoteLinuxDeployConfigurationFactory() addInitialStep(Constants::MakeInstallStepId, needsMakeInstall); addInitialStep(Constants::KillAppStepId); - // Todo: Check: Instead of having three different steps here, have one - // and shift the logic into the implementation there? - addInitialStep(Constants::RsyncDeployStepId, [](Target *target) { - return defaultTransferMethod(target->kit()) == FileTransferMethod::Rsync; - }); - addInitialStep(Constants::DirectUploadStepId, [](Target *target) { - return defaultTransferMethod(target->kit()) == FileTransferMethod::Sftp; - }); - addInitialStep(ProjectExplorer::Constants::COPY_FILE_STEP, [](Target *target) { - return defaultTransferMethod(target->kit()) == FileTransferMethod::GenericCopy; - }); + // TODO: Rename RsyncDeployStep to something more generic. + addInitialStep(Constants::RsyncDeployStepId); } } // RemoteLinux::Internal diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index 83d729108b2..0214f21576b 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -42,6 +43,7 @@ private: mutable FilesToTransfer m_files; bool m_ignoreMissingFiles = false; + FileTransferMethod m_preferredTransferMethod = FileTransferMethod::Rsync; QString m_flags; }; @@ -60,7 +62,14 @@ RsyncDeployStep::RsyncDeployStep(BuildStepList *bsl, Id id) BoolAspect::LabelPlacement::InExtraLabel); ignoreMissingFiles->setValue(false); - setInternalInitializer([this, ignoreMissingFiles, flags] { + auto method = addAspect(); + method->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + method->setDisplayName(Tr::tr("Transfer method:")); + method->addOption(Tr::tr("rsync"), Tr::tr("Use rsync if available.")); + method->addOption(Tr::tr("SFTP"), Tr::tr("Use sftp if available.")); + method->addOption(Tr::tr("Generic Copy"), Tr::tr("Use generic copy, most likely to succeed.")); + + setInternalInitializer([this, ignoreMissingFiles, flags, method] { if (BuildDeviceKitAspect::device(kit()) == DeviceKitAspect::device(kit())) { // rsync transfer on the same device currently not implemented // and typically not wanted. @@ -69,6 +78,13 @@ RsyncDeployStep::RsyncDeployStep(BuildStepList *bsl, Id id) } m_ignoreMissingFiles = ignoreMissingFiles->value(); m_flags = flags->value(); + if (method->value() == 0) + m_preferredTransferMethod = FileTransferMethod::Rsync; + else if (method->value() == 1) + m_preferredTransferMethod = FileTransferMethod::Sftp; + else + m_preferredTransferMethod = FileTransferMethod::GenericCopy; + return isDeploymentPossible(); }); @@ -127,10 +143,46 @@ GroupItem RsyncDeployStep::mkdirTask() return AsyncTask(onSetup, {}, onError); } +static FileTransferMethod supportedTransferMethodFor(const FileToTransfer &fileToTransfer) +{ + auto sourceDevice = ProjectExplorer::DeviceManager::deviceForPath(fileToTransfer.m_source); + auto targetDevice = ProjectExplorer::DeviceManager::deviceForPath(fileToTransfer.m_target); + + if (sourceDevice && targetDevice) { + // TODO: Check if the devices can reach each other via their ip + if (sourceDevice->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool() + && targetDevice->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool()) { + return FileTransferMethod::Rsync; + } + + if (sourceDevice->extraData(ProjectExplorer::Constants::SUPPORTS_SFTP).toBool() + && targetDevice->extraData(ProjectExplorer::Constants::SUPPORTS_SFTP).toBool()) { + return FileTransferMethod::Sftp; + } + } + + return FileTransferMethod::GenericCopy; +} + GroupItem RsyncDeployStep::transferTask() { const auto setupHandler = [this](FileTransfer &transfer) { - transfer.setTransferMethod(FileTransferMethod::Rsync); + FileTransferMethod transferMethod = m_preferredTransferMethod; + + if (transferMethod != FileTransferMethod::GenericCopy) { + for (const FileToTransfer &fileToTransfer : m_files) { + const FileTransferMethod supportedMethod = supportedTransferMethodFor( + fileToTransfer); + + if (supportedMethod != m_preferredTransferMethod) { + transferMethod = FileTransferMethod::GenericCopy; + break; + } + } + } + + transfer.setTransferMethod(transferMethod); + transfer.setRsyncFlags(m_flags); transfer.setFilesToTransfer(m_files); connect(&transfer, &FileTransfer::progress, From ae33199d046902bb9877810df2dbc590b083ef3c Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 22 Jun 2023 16:30:22 +0200 Subject: [PATCH 0044/1777] Debugger: Use CommandLine to set up debugger server To allow more complex actions in the command line, like parsing $SSH_CLIENT. Change-Id: Ifc48a74f1fe4e42cd7ceddfd3c308bd1636212a7 Reviewed-by: Marcus Tillmanns --- src/plugins/debugger/debuggerruncontrol.cpp | 32 ++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index ed4a34f3067..dc090bf30dc 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -1034,11 +1034,12 @@ DebugServerRunner::DebugServerRunner(RunControl *runControl, DebugServerPortsGat CommandLine cmd; - QStringList args = ProcessArgs::splitArgs(commandLine().arguments(), OsTypeLinux); if (isQmlDebugging) { - args.prepend(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices, - portsGatherer->qmlServer())); + cmd.addArg(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices, + portsGatherer->qmlServer())); } + cmd.addArgs(commandLine().arguments(), CommandLine::Raw); + if (isQmlDebugging && !isCppDebugging) { cmd.setExecutable(commandLine().executable()); // FIXME: Case should not happen? } else { @@ -1064,28 +1065,27 @@ DebugServerRunner::DebugServerRunner(RunControl *runControl, DebugServerPortsGat cmd.setExecutable(runControl->device()->filePath("gdbserver")); } } - args.clear(); + cmd.setArguments({}); if (cmd.executable().baseName().contains("lldb-server")) { - args.append("platform"); - args.append("--listen"); - args.append(QString("*:%1").arg(portsGatherer->gdbServer().port())); - args.append("--server"); + cmd.addArg("platform"); + cmd.addArg("--listen"); + cmd.addArg(QString("*:%1").arg(portsGatherer->gdbServer().port())); + cmd.addArg("--server"); } else if (cmd.executable().baseName() == "debugserver") { - args.append(QString("*:%1").arg(portsGatherer->gdbServer().port())); - args.append("--attach"); - args.append(QString::number(m_pid.pid())); + cmd.addArg(QString("*:%1").arg(portsGatherer->gdbServer().port())); + cmd.addArg("--attach"); + cmd.addArg(QString::number(m_pid.pid())); } else { // Something resembling gdbserver if (m_useMulti) - args.append("--multi"); + cmd.addArg("--multi"); if (m_pid.isValid()) - args.append("--attach"); - args.append(QString(":%1").arg(portsGatherer->gdbServer().port())); + cmd.addArg("--attach"); + cmd.addArg(QString(":%1").arg(portsGatherer->gdbServer().port())); if (m_pid.isValid()) - args.append(QString::number(m_pid.pid())); + cmd.addArg(QString::number(m_pid.pid())); } } - cmd.setArguments(ProcessArgs::joinArgs(args, OsTypeLinux)); setCommandLine(cmd); }); From cf6bd7e0124f31374f3a4abd05d14199d201961b Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 22 Jun 2023 14:58:11 +0200 Subject: [PATCH 0045/1777] Fix occurrences of the contains/insert anti-pattern Introduce and make use of Utils::insert() for QSet with a return value that indicates whether insertion actually happened. Change-Id: I655e4bc3553b74fea5ae8956205e4d8070118d63 Reviewed-by: hjk Reviewed-by: Eike Ziller --- src/libs/cplusplus/CppDocument.cpp | 4 +- src/libs/cplusplus/FastPreprocessor.cpp | 6 +-- src/libs/cplusplus/LookupContext.cpp | 38 ++++++------------- src/libs/cplusplus/ResolveExpression.cpp | 6 +-- src/libs/cplusplus/SnapshotSymbolVisitor.cpp | 6 +-- src/libs/cplusplus/TypeOfExpression.cpp | 6 +-- src/libs/extensionsystem/pluginmanager.cpp | 4 +- src/libs/qmljs/qmljslink.cpp | 6 +-- src/libs/qmljs/qmljsmodelmanagerinterface.cpp | 12 ++---- src/libs/utils/algorithm.h | 9 +++++ src/libs/utils/namevaluesdialog.cpp | 6 +-- src/plugins/autotest/testresultmodel.cpp | 9 ++--- src/plugins/bineditor/bineditorwidget.cpp | 4 +- .../cmakeprojectmanager/cmakebuildsystem.cpp | 3 +- .../editormanager/documentmodel.cpp | 6 +-- .../editormanager/openeditorswindow.cpp | 4 +- .../cppcheck/cppcheckdiagnosticsmodel.cpp | 7 ++-- src/plugins/cppeditor/cppchecksymbols.cpp | 7 +--- src/plugins/cppeditor/cppcompletionassist.cpp | 26 ++++--------- .../cppeditor/cppfollowsymbolundercursor.cpp | 5 +-- src/plugins/cppeditor/cppmodelmanager.cpp | 8 ++-- src/plugins/cppeditor/cppquickfixes.cpp | 3 +- src/plugins/cppeditor/cppsourceprocessor.cpp | 5 +-- .../cppeditor/typehierarchybuilder.cpp | 6 +-- src/plugins/fakevim/fakevimplugin.cpp | 6 +-- src/plugins/glsleditor/glsleditor.cpp | 4 +- .../semantichighlightsupport.cpp | 4 +- src/plugins/macros/actionmacrohandler.cpp | 5 ++- src/plugins/modeleditor/modelindexer.cpp | 10 ++--- src/plugins/projectexplorer/projectmodels.cpp | 7 +--- src/plugins/python/pythonproject.cpp | 9 ++--- .../qbsprojectmanager/qbsprojectimporter.cpp | 5 +-- .../qmljseditor/qmljscompletionassist.cpp | 4 +- .../qmljseditor/qmljsfindreferences.cpp | 3 +- src/plugins/qtsupport/qtoptionspage.cpp | 6 +-- src/plugins/squish/squishresultmodel.cpp | 4 +- src/plugins/texteditor/basefilefind.cpp | 3 +- .../codeassist/documentcontentcompletion.cpp | 3 +- src/plugins/texteditor/texteditor.cpp | 7 +--- 39 files changed, 107 insertions(+), 169 deletions(-) diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 07714c0fe2f..6dc59bf1bf1 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -774,10 +774,8 @@ QSet Snapshot::allIncludesForDocument(const FilePath &filePath) const if (Document::Ptr doc = document(file)) { const FilePaths includedFiles = doc->includedFiles(Document::Duplicates::Keep); for (const FilePath &inc : includedFiles) { - if (!result.contains(inc)) { - result.insert(inc); + if (Utils::insert(result, inc)) files.push(inc); - } } } } diff --git a/src/libs/cplusplus/FastPreprocessor.cpp b/src/libs/cplusplus/FastPreprocessor.cpp index b66d214ed27..580334d0744 100644 --- a/src/libs/cplusplus/FastPreprocessor.cpp +++ b/src/libs/cplusplus/FastPreprocessor.cpp @@ -6,6 +6,8 @@ #include #include +#include + #include using namespace Utils; @@ -65,9 +67,7 @@ void FastPreprocessor::sourceNeeded(int line, const FilePath &filePath, IncludeT void FastPreprocessor::mergeEnvironment(const FilePath &filePath) { - if (! _merged.contains(filePath)) { - _merged.insert(filePath); - + if (Utils::insert(_merged, filePath)) { if (Document::Ptr doc = _snapshot.document(filePath)) { const QList includes = doc->resolvedIncludes(); for (const Document::Include &i : includes) diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 64669409b52..d4bf5b970d5 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -78,8 +78,7 @@ static bool isNestedInstantiationEnclosingTemplate( { QSet processed; while (enclosingTemplateClassInstantiation - && !processed.contains(enclosingTemplateClassInstantiation)) { - processed.insert(enclosingTemplateClassInstantiation); + && Utils::insert(processed, enclosingTemplateClassInstantiation)) { if (enclosingTemplateClassInstantiation == nestedClassOrNamespaceInstantiation) return false; enclosingTemplateClassInstantiation = enclosingTemplateClassInstantiation->parent(); @@ -389,11 +388,10 @@ ClassOrNamespace *LookupContext::lookupType(const Name *name, Scope *scope, } if (const NamedType *namedTy = d->type()->asNamedType()) { // Stop on recursive typedef declarations - if (typedefsBeingResolved.contains(d)) + if (!Utils::insert(typedefsBeingResolved, d)) return nullptr; return lookupType(namedTy->name(), scope, nullptr, - QSet(typedefsBeingResolved) - << d); + typedefsBeingResolved); } } } @@ -504,9 +502,8 @@ QList LookupContext::lookup(const Name *name, Scope *scope) const // try find this name in parent class QSet processed; while (candidates.isEmpty() && (binding = binding->parent())) { - if (processed.contains(binding)) + if (!Utils::insert(processed, binding)) break; - processed.insert(binding); candidates = binding->find(name); } @@ -683,9 +680,8 @@ QList ClassOrNamespace::lookup_helper(const Name *name, bool searchI for (ClassOrNamespace *parentBinding = binding->parent(); parentBinding && !match; parentBinding = parentBinding->parent()) { - if (processed.contains(parentBinding)) + if (!Utils::insert(processed, parentBinding)) break; - processed.insert(parentBinding); match = parentBinding->lookupInScope(fullName); } @@ -704,9 +700,8 @@ QList ClassOrNamespace::lookup_helper(const Name *name, bool searchI QSet processedOwnParents; ClassOrNamespace *binding = this; do { - if (processedOwnParents.contains(binding)) + if (!Utils::insert(processedOwnParents, binding)) break; - processedOwnParents.insert(binding); lookup_helper(name, binding, &result, &processed, /*templateId = */ nullptr); binding = binding->_parent; } while (searchInEnclosingScope && binding); @@ -720,9 +715,7 @@ void ClassOrNamespace::lookup_helper(const Name *name, ClassOrNamespace *binding QSet *processed, const TemplateNameId *templateId) { - if (binding && ! processed->contains(binding)) { - processed->insert(binding); - + if (binding && Utils::insert(*processed, binding)) { const Identifier *nameId = name->identifier(); const QList symbols = binding->symbols(); @@ -902,9 +895,8 @@ ClassOrNamespace *ClassOrNamespace::findBlock_helper(Block *block, bool searchInEnclosingScope) { for (ClassOrNamespace *binding = this; binding; binding = binding->_parent) { - if (processed->contains(binding)) + if (!Utils::insert(*processed, binding)) break; - processed->insert(binding); binding->flush(); auto end = binding->_blocks.end(); auto citBlock = binding->_blocks.find(block); @@ -977,9 +969,7 @@ ClassOrNamespace *ClassOrNamespace::lookupType_helper(const Name *name, return nullptr; - } else if (! processed->contains(this)) { - processed->insert(this); - + } else if (Utils::insert(*processed, this)) { if (name->asNameId() || name->asTemplateNameId() || name->asAnonymousNameId()) { flush(); @@ -1260,9 +1250,8 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, QSet otherProcessed; while (!origin->_symbols.isEmpty() && origin->_symbols[0]->asBlock()) { - if (otherProcessed.contains(origin)) + if (!Utils::insert(otherProcessed, origin)) break; - otherProcessed.insert(origin); origin = origin->parent(); } @@ -1489,9 +1478,8 @@ void ClassOrNamespace::NestedClassInstantiator::instantiate(ClassOrNamespace *en { if (_alreadyConsideredNestedClassInstantiations.size() >= 3) return; - if (_alreadyConsideredNestedClassInstantiations.contains(enclosingTemplateClass)) + if (!Utils::insert(_alreadyConsideredNestedClassInstantiations, enclosingTemplateClass)) return; - _alreadyConsideredNestedClassInstantiations.insert(enclosingTemplateClass); ClassOrNamespace::Table::const_iterator cit = enclosingTemplateClass->_classOrNamespaces.begin(); for (; cit != enclosingTemplateClass->_classOrNamespaces.end(); ++cit) { const Name *nestedName = cit->first; @@ -1720,9 +1708,7 @@ void CreateBindings::process(Document::Ptr doc) return; if (Namespace *globalNamespace = doc->globalNamespace()) { - if (! _processed.contains(globalNamespace)) { - _processed.insert(globalNamespace); - + if (Utils::insert(_processed, globalNamespace)) { const QList includes = doc->resolvedIncludes(); for (const Document::Include &i : includes) { if (Document::Ptr incl = _snapshot.document(i.resolvedFileName())) diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp index 7d9ccf6891b..1ac35319bd1 100644 --- a/src/libs/cplusplus/ResolveExpression.cpp +++ b/src/libs/cplusplus/ResolveExpression.cpp @@ -6,7 +6,6 @@ #include "LookupContext.h" #include "Overview.h" #include "DeprecatedGenTemplateInstance.h" -#include "CppRewriter.h" #include "TypeOfExpression.h" #include @@ -20,6 +19,8 @@ #include #include +#include + #include #include #include @@ -142,9 +143,8 @@ private: for (const LookupItem &it : namedTypeItems) { Symbol *declaration = it.declaration(); if (declaration && declaration->isTypedef()) { - if (visited.contains(declaration)) + if (!Utils::insert(visited, declaration)) break; - visited.insert(declaration); // continue working with the typedefed type and scope if (type->type()->asPointerType()) { diff --git a/src/libs/cplusplus/SnapshotSymbolVisitor.cpp b/src/libs/cplusplus/SnapshotSymbolVisitor.cpp index 452c61531ad..512a4cffe7d 100644 --- a/src/libs/cplusplus/SnapshotSymbolVisitor.cpp +++ b/src/libs/cplusplus/SnapshotSymbolVisitor.cpp @@ -5,6 +5,8 @@ #include +#include + using namespace CPlusPlus; SnapshotSymbolVisitor::SnapshotSymbolVisitor(const Snapshot &snapshot) @@ -20,9 +22,7 @@ void SnapshotSymbolVisitor::accept(Document::Ptr doc) void SnapshotSymbolVisitor::accept(Document::Ptr doc, QSet *processed) { - if (doc && doc->globalNamespace() && ! processed->contains(doc->filePath().path())) { - processed->insert(doc->filePath().path()); - + if (doc && doc->globalNamespace() && Utils::insert(*processed, doc->filePath().path())) { const QList includes = doc->resolvedIncludes(); for (const Document::Include &i : includes) { if (Document::Ptr incl = _snapshot.document(i.resolvedFileName())) diff --git a/src/libs/cplusplus/TypeOfExpression.cpp b/src/libs/cplusplus/TypeOfExpression.cpp index 2776c19dd04..0cedec36b23 100644 --- a/src/libs/cplusplus/TypeOfExpression.cpp +++ b/src/libs/cplusplus/TypeOfExpression.cpp @@ -11,6 +11,8 @@ #include #include +#include + #include using namespace Utils; @@ -134,9 +136,7 @@ ExpressionAST *TypeOfExpression::expressionAST() const void TypeOfExpression::processEnvironment(Document::Ptr doc, Environment *env, QSet *processed) const { - if (doc && ! processed->contains(doc->filePath().path())) { - processed->insert(doc->filePath().path()); - + if (doc && Utils::insert(*processed, doc->filePath().path())) { const QList includes = doc->resolvedIncludes(); for (const Document::Include &incl : includes) processEnvironment(m_snapshot.document(incl.resolvedFileName()), env, processed); diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 45b9807958e..2da7065314d 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -373,10 +373,8 @@ const QSet PluginManager::pluginsRequiredByPlugin(PluginSpec *spec if (depIt.key().type != PluginDependency::Required) continue; PluginSpec *depSpec = depIt.value(); - if (!recursiveDependencies.contains(depSpec)) { - recursiveDependencies.insert(depSpec); + if (Utils::insert(recursiveDependencies, depSpec)) queue.push(depSpec); - } } } recursiveDependencies.remove(spec); diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp index ed1c506df73..7b99eb65de8 100644 --- a/src/libs/qmljs/qmljslink.cpp +++ b/src/libs/qmljs/qmljslink.cpp @@ -656,14 +656,12 @@ void LinkPrivate::loadQmldirComponents(ObjectValue *import, QSet importedTypes; const auto components = libraryInfo.components(); for (const QmlDirParser::Component &component : components) { - if (importedTypes.contains(component.typeName)) - continue; - ComponentVersion componentVersion(component.majorVersion, component.minorVersion); if (version < componentVersion) continue; - importedTypes.insert(component.typeName); + if (!Utils::insert(importedTypes, component.typeName)) + continue; if (Document::Ptr importedDoc = m_snapshot.document( libraryPath.pathAppended(component.fileName))) { if (ObjectValue *v = importedDoc->bind()->rootObjectValue()) diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index 66a670d1b8a..93b8ca35e71 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -734,10 +734,9 @@ static void findNewImplicitImports(const Document::Ptr &doc, // scan files that could be implicitly imported // it's important we also do this for JS files, otherwise the isEmpty check will fail if (snapshot.documentsInDirectory(doc->path()).isEmpty()) { - if (!scannedPaths->contains(doc->path())) { + if (Utils::insert(*scannedPaths, doc->path())) { *importedFiles += filesInDirectoryForLanguages(doc->path(), doc->language().companionLanguages()); - scannedPaths->insert(doc->path()); } } } @@ -757,11 +756,10 @@ static void findNewFileImports(const Document::Ptr &doc, *importedFiles += importPath; } else if (import.type() == ImportType::Directory) { if (snapshot.documentsInDirectory(importPath).isEmpty()) { - if (!scannedPaths->contains(importPath)) { + if (Utils::insert(*scannedPaths, importPath)) { *importedFiles += filesInDirectoryForLanguages(importPath, doc->language().companionLanguages()); - scannedPaths->insert(importPath); } } } else if (import.type() == ImportType::QrcFile) { @@ -890,10 +888,9 @@ static bool findNewQmlLibraryInPath(const Utils::FilePath &path, if (!component.fileName.isEmpty()) { const FilePath componentFile = path.pathAppended(component.fileName); const FilePath path = componentFile.absolutePath().cleanPath(); - if (!scannedPaths->contains(path)) { + if (Utils::insert(*scannedPaths, path)) { *importedFiles += filesInDirectoryForLanguages(path, Dialect(Dialect::AnyLanguage) .companionLanguages()); - scannedPaths->insert(path); } } } @@ -1110,10 +1107,9 @@ void ModelManagerInterface::importScanAsync(QPromise &promise, const Worki QMutexLocker l(&modelManager->m_mutex); for (const auto &path : paths) { Utils::FilePath cPath = path.path().cleanPath(); - if (!forceRescan && modelManager->m_scannedPaths.contains(cPath)) + if (!forceRescan && !Utils::insert(modelManager->m_scannedPaths, cPath)) continue; pathsToScan.append({cPath, 0, path.language()}); - modelManager->m_scannedPaths.insert(cPath); } } const int maxScanDepth = 5; diff --git a/src/libs/utils/algorithm.h b/src/libs/utils/algorithm.h index b75c0d5e4a0..ee280def034 100644 --- a/src/libs/utils/algorithm.h +++ b/src/libs/utils/algorithm.h @@ -1437,4 +1437,13 @@ void addToHash(QHash *result, const QHash &additionalContents) result->insert(additionalContents); } +// Workaround for missing information from QSet::insert() +// Return type could be a pair like for std::set, but we never use the iterator anyway. +template [[nodiscard]] bool insert(QSet &s, const U &v) +{ + const int oldSize = s.size(); + s.insert(v); + return s.size() > oldSize; +} + } // namespace Utils diff --git a/src/libs/utils/namevaluesdialog.cpp b/src/libs/utils/namevaluesdialog.cpp index 892702566f4..dfd64370770 100644 --- a/src/libs/utils/namevaluesdialog.cpp +++ b/src/libs/utils/namevaluesdialog.cpp @@ -3,7 +3,7 @@ #include "namevaluesdialog.h" -#include "environment.h" +#include "algorithm.h" #include "hostosinfo.h" #include "utilstr.h" @@ -29,10 +29,8 @@ static EnvironmentItems cleanUp(const EnvironmentItems &items) const QString &itemName = item.name; QString emptyName = itemName; emptyName.remove(QLatin1Char(' ')); - if (!emptyName.isEmpty() && !uniqueSet.contains(itemName)) { + if (!emptyName.isEmpty() && Utils::insert(uniqueSet, itemName)) uniqueItems.prepend(item); - uniqueSet.insert(itemName); - } } return uniqueItems; } diff --git a/src/plugins/autotest/testresultmodel.cpp b/src/plugins/autotest/testresultmodel.cpp index f686692faad..f03cd8c685a 100644 --- a/src/plugins/autotest/testresultmodel.cpp +++ b/src/plugins/autotest/testresultmodel.cpp @@ -10,6 +10,7 @@ #include "testtreemodel.h" #include +#include #include #include @@ -202,10 +203,7 @@ bool TestResultItem::updateDescendantTypes(ResultType t) if (t == ResultType::TestStart || t == ResultType::TestEnd) // these are special return false; - if (m_descendantsTypes.contains(t)) - return false; - m_descendantsTypes.insert(t); - return true; + return Utils::insert(m_descendantsTypes, t); } bool TestResultItem::descendantTypesContainsAnyOf(const QSet &types) const @@ -467,8 +465,7 @@ void TestResultFilterModel::enableAllResultTypes(bool enabled) void TestResultFilterModel::toggleTestResultType(ResultType type) { - if (m_enabled.contains(type)) { - m_enabled.remove(type); + if (m_enabled.remove(type)) { if (type == ResultType::MessageInternal) m_enabled.remove(ResultType::TestEnd); if (type == ResultType::MessageDebug) diff --git a/src/plugins/bineditor/bineditorwidget.cpp b/src/plugins/bineditor/bineditorwidget.cpp index bddcae36ed1..703f608ac11 100644 --- a/src/plugins/bineditor/bineditorwidget.cpp +++ b/src/plugins/bineditor/bineditorwidget.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -222,9 +223,8 @@ bool BinEditorWidget::requestDataAt(qint64 pos) const it = m_data.find(block); if (it != m_data.end()) return true; - if (m_requests.contains(block)) + if (!Utils::insert(m_requests, block)) return false; - m_requests.insert(block); d->fetchData((m_baseAddr / m_blockSize + block) * m_blockSize); return true; } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 9abb3597d15..6c5edc0ec90 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1301,9 +1301,8 @@ void CMakeBuildSystem::runCTest() std::function findAncestor = [&](int index){ const QJsonObject node = nodes.at(index).toObject(); const int parent = node.value("parent").toInt(-1); - if (seen.contains(parent) || parent < 0) + if (parent < 0 || !Utils::insert(seen, parent)) return node; - seen << parent; return findAncestor(parent); }; const QJsonObject btRef = findAncestor(bt); diff --git a/src/plugins/coreplugin/editormanager/documentmodel.cpp b/src/plugins/coreplugin/editormanager/documentmodel.cpp index 876b22b1281..090c7601e1d 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.cpp +++ b/src/plugins/coreplugin/editormanager/documentmodel.cpp @@ -470,10 +470,8 @@ void DocumentModelPrivate::removeAllSuspendedEntries(PinnedFileRemovalPolicy pin QSet displayNames; for (DocumentModel::Entry *entry : std::as_const(d->m_entries)) { const QString displayName = entry->plainDisplayName(); - if (displayNames.contains(displayName)) - continue; - displayNames.insert(displayName); - d->disambiguateDisplayNames(entry); + if (Utils::insert(displayNames, displayName)) + d->disambiguateDisplayNames(entry); } } diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index b3e119f3ad9..10127fc0e05 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -9,6 +9,7 @@ #include "../coreplugintr.h" #include "../idocument.h" +#include #include #include #include @@ -219,9 +220,8 @@ void OpenEditorsWindow::addItem(DocumentModel::Entry *entry, QSet &entriesDone, EditorView *view) { - if (entriesDone.contains(entry)) + if (!Utils::insert(entriesDone, entry)) return; - entriesDone.insert(entry); QString title = entry->displayName(); QTC_ASSERT(!title.isEmpty(), return); auto item = new QTreeWidgetItem(); diff --git a/src/plugins/cppcheck/cppcheckdiagnosticsmodel.cpp b/src/plugins/cppcheck/cppcheckdiagnosticsmodel.cpp index a2f87b8cd8b..e2bc8434fb6 100644 --- a/src/plugins/cppcheck/cppcheckdiagnosticsmodel.cpp +++ b/src/plugins/cppcheck/cppcheckdiagnosticsmodel.cpp @@ -7,6 +7,7 @@ #include +#include #include #include @@ -99,12 +100,10 @@ void DiagnosticsModel::clear() void DiagnosticsModel::add(const Diagnostic &diagnostic) { - if (m_diagnostics.contains(diagnostic)) + if (!Utils::insert(m_diagnostics, diagnostic)) return; - const auto hasData = !m_diagnostics.isEmpty(); - m_diagnostics.insert(diagnostic); - if (!hasData) + if (m_diagnostics.size() == 1) emit hasDataChanged(true); const QString filePath = diagnostic.fileName.toString(); diff --git a/src/plugins/cppeditor/cppchecksymbols.cpp b/src/plugins/cppeditor/cppchecksymbols.cpp index 7728ea308c1..e9334b0db29 100644 --- a/src/plugins/cppeditor/cppchecksymbols.cpp +++ b/src/plugins/cppeditor/cppchecksymbols.cpp @@ -73,9 +73,7 @@ protected: { if (!doc) return; - if (!processed->contains(doc->globalNamespace())) { - processed->insert(doc->globalNamespace()); - + if (Utils::insert(*processed, doc->globalNamespace())) { const QList includes = doc->resolvedIncludes(); for (const Document::Include &i : includes) process(_snapshot.document(i.resolvedFileName()), processed); @@ -806,8 +804,7 @@ bool CheckSymbols::hasVirtualDestructor(ClassOrNamespace *binding) const while (!todo.isEmpty()) { ClassOrNamespace *b = todo.takeFirst(); - if (b && !processed.contains(b)) { - processed.insert(b); + if (b && Utils::insert(processed, b)) { const QList symbols = b->symbols(); for (Symbol *s : symbols) { if (Class *k = s->asClass()) { diff --git a/src/plugins/cppeditor/cppcompletionassist.cpp b/src/plugins/cppeditor/cppcompletionassist.cpp index 4865f3dfedc..19ad8b5120c 100644 --- a/src/plugins/cppeditor/cppcompletionassist.cpp +++ b/src/plugins/cppeditor/cppcompletionassist.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -1459,9 +1460,8 @@ bool InternalCppCompletionAssistProcessor::globalCompletion(Scope *currentScope) QSet processed; for (; currentBinding; currentBinding = currentBinding->parent()) { - if (processed.contains(currentBinding)) + if (!Utils::insert(processed, currentBinding)) break; - processed.insert(currentBinding); const QList usings = currentBinding->usings(); for (ClassOrNamespace* u : usings) @@ -1598,10 +1598,9 @@ void InternalCppCompletionAssistProcessor::completeNamespace(ClassOrNamespace *b while (!bindingsToVisit.isEmpty()) { ClassOrNamespace *binding = bindingsToVisit.takeFirst(); - if (!binding || bindingsVisited.contains(binding)) + if (!binding || !Utils::insert(bindingsVisited, binding)) continue; - bindingsVisited.insert(binding); bindingsToVisit += binding->usings(); QList scopesToVisit; @@ -1619,11 +1618,9 @@ void InternalCppCompletionAssistProcessor::completeNamespace(ClassOrNamespace *b while (!scopesToVisit.isEmpty()) { Scope *scope = scopesToVisit.takeFirst(); - if (!scope || scopesVisited.contains(scope)) + if (!scope || !Utils::insert(scopesVisited, scope)) continue; - scopesVisited.insert(scope); - for (Scope::iterator it = scope->memberBegin(); it != scope->memberEnd(); ++it) { Symbol *member = *it; addCompletionItem(member); @@ -1640,10 +1637,9 @@ void InternalCppCompletionAssistProcessor::completeClass(ClassOrNamespace *b, bo while (!bindingsToVisit.isEmpty()) { ClassOrNamespace *binding = bindingsToVisit.takeFirst(); - if (!binding || bindingsVisited.contains(binding)) + if (!binding || !Utils::insert(bindingsVisited, binding)) continue; - bindingsVisited.insert(binding); bindingsToVisit += binding->usings(); QList scopesToVisit; @@ -1663,11 +1659,9 @@ void InternalCppCompletionAssistProcessor::completeClass(ClassOrNamespace *b, bo while (!scopesToVisit.isEmpty()) { Scope *scope = scopesToVisit.takeFirst(); - if (!scope || scopesVisited.contains(scope)) + if (!scope || !Utils::insert(scopesVisited, scope)) continue; - scopesVisited.insert(scope); - if (staticLookup) addCompletionItem(scope, InjectedClassNameOrder); // add a completion item for the injected class name. @@ -1737,9 +1731,7 @@ bool InternalCppCompletionAssistProcessor::completeQtMethod(const QList symbols = binding->symbols(); for (Symbol *s : symbols) if (Class *clazz = s->asClass()) @@ -1862,11 +1854,9 @@ void InternalCppCompletionAssistProcessor::addMacros_helper(const Snapshot &snap { Document::Ptr doc = snapshot.document(filePath); - if (!doc || processed->contains(doc->filePath())) + if (!doc || !Utils::insert(*processed, doc->filePath())) return; - processed->insert(doc->filePath()); - const QList includes = doc->resolvedIncludes(); for (const Document::Include &i : includes) addMacros_helper(snapshot, i.resolvedFileName(), processed, definedMacros); diff --git a/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp b/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp index 0353e16c302..c36a83a3f6b 100644 --- a/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp +++ b/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -181,9 +182,7 @@ Class *VirtualFunctionHelper::staticClassOfFunctionCallExpression_internal() con Link findMacroLink_helper(const QByteArray &name, Document::Ptr doc, const Snapshot &snapshot, QSet *processed) { - if (doc && !name.startsWith('<') && !processed->contains(doc->filePath().path())) { - processed->insert(doc->filePath().path()); - + if (doc && !name.startsWith('<') && Utils::insert(*processed, doc->filePath().path())) { for (const Macro ¯o : doc->definedMacros()) { if (macro.name() == name) { Link link; diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index 2b5d4e3fb82..4ea3e99edf4 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -60,6 +60,7 @@ #include +#include #include #include #include @@ -1060,10 +1061,8 @@ static void addUnique(const Macros &newMacros, Macros ¯os, QSet &alreadyIn) { for (const ProjectExplorer::Macro ¯o : newMacros) { - if (!alreadyIn.contains(macro)) { + if (Utils::insert(alreadyIn, macro)) macros += macro; - alreadyIn.insert(macro); - } } } @@ -1949,9 +1948,8 @@ void CppModelManager::GC() const FilePath filePath = todo.last(); todo.removeLast(); - if (reachableFiles.contains(filePath)) + if (!Utils::insert(reachableFiles, filePath)) continue; - reachableFiles.insert(filePath); if (Document::Ptr doc = currentSnapshot.document(filePath)) todo += doc->includedFiles(); diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index a7134169d62..77672a85699 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -8342,14 +8342,13 @@ private: QList includeLocationsOfDocument = refactoring.snapshot().includeLocationsOfDocument(filePath); for (Snapshot::IncludeLocation &loc : includeLocationsOfDocument) { - if (m_processed.contains(loc.first)) + if (!Utils::insert(m_processed, loc.first)) continue; CppRefactoringFilePtr file = refactoring.file(loc.first->filePath()); const bool noGlobalUsing = refactorFile(file, refactoring.snapshot(), file->position(loc.second, 1)); - m_processed.insert(loc.first); if (noGlobalUsing) processIncludes(refactoring, loc.first->filePath()); } diff --git a/src/plugins/cppeditor/cppsourceprocessor.cpp b/src/plugins/cppeditor/cppsourceprocessor.cpp index 55dc1f10e05..1c8c79a2c2c 100644 --- a/src/plugins/cppeditor/cppsourceprocessor.cpp +++ b/src/plugins/cppeditor/cppsourceprocessor.cpp @@ -9,6 +9,7 @@ #include +#include #include #include #include @@ -365,11 +366,9 @@ void CppSourceProcessor::mergeEnvironment(Document::Ptr doc) const QString fn = doc->filePath().path(); - if (m_processed.contains(fn)) + if (!Utils::insert(m_processed, fn)) return; - m_processed.insert(fn); - const QList includes = doc->resolvedIncludes(); for (const Document::Include &incl : includes) { const FilePath includedFile = incl.resolvedFileName(); diff --git a/src/plugins/cppeditor/typehierarchybuilder.cpp b/src/plugins/cppeditor/typehierarchybuilder.cpp index 889d0eacfc0..a4266955054 100644 --- a/src/plugins/cppeditor/typehierarchybuilder.cpp +++ b/src/plugins/cppeditor/typehierarchybuilder.cpp @@ -5,6 +5,8 @@ #include +#include + using namespace CPlusPlus; using namespace Utils; @@ -170,11 +172,9 @@ void TypeHierarchyBuilder::buildDerived(const std::optional> &futu QHash> &cache) { Symbol *symbol = typeHierarchy->_symbol; - if (_visited.contains(symbol)) + if (!Utils::insert(_visited, symbol)) return; - _visited.insert(symbol); - const QString &symbolName = _overview.prettyName(LookupContext::fullyQualifiedName(symbol)); DerivedHierarchyVisitor visitor(symbolName, cache); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 54ae4ca93f8..5b51cb5f969 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -944,9 +945,8 @@ public: QString found = sel.selectedText(); // Only add "real" completions. if (found.startsWith(needle) - && !seen.contains(found) - && sel.anchor() != basePosition) { - seen.insert(found); + && sel.anchor() != basePosition + && Utils::insert(seen, found)) { auto item = new FakeVimAssistProposalItem(m_provider); item->setText(found); items.append(item); diff --git a/src/plugins/glsleditor/glsleditor.cpp b/src/plugins/glsleditor/glsleditor.cpp index aecb7cf6545..2ade8fb4c74 100644 --- a/src/plugins/glsleditor/glsleditor.cpp +++ b/src/plugins/glsleditor/glsleditor.cpp @@ -269,11 +269,9 @@ void GlslEditorWidget::updateDocumentNow() for (const DiagnosticMessage &m : messages) { if (! m.line()) continue; - else if (errors.contains(m.line())) + if (!Utils::insert(errors, m.line())) continue; - errors.insert(m.line()); - QTextCursor cursor(document()->findBlockByNumber(m.line() - 1)); cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); diff --git a/src/plugins/languageclient/semantichighlightsupport.cpp b/src/plugins/languageclient/semantichighlightsupport.cpp index 919b04c20bc..472f55b4976 100644 --- a/src/plugins/languageclient/semantichighlightsupport.cpp +++ b/src/plugins/languageclient/semantichighlightsupport.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -165,9 +166,8 @@ void SemanticTokenSupport::updateSemanticTokensImpl(TextDocument *textDocument, void SemanticTokenSupport::queueDocumentReload(TextEditor::TextDocument *doc) { - if (m_docReloadQueue.contains(doc)) + if (!Utils::insert(m_docReloadQueue, doc)) return; - m_docReloadQueue << doc; connect( m_client, &Client::initialized, diff --git a/src/plugins/macros/actionmacrohandler.cpp b/src/plugins/macros/actionmacrohandler.cpp index 37274f68a65..0dc4fd95773 100644 --- a/src/plugins/macros/actionmacrohandler.cpp +++ b/src/plugins/macros/actionmacrohandler.cpp @@ -13,6 +13,8 @@ #include +#include + #include #include @@ -55,8 +57,7 @@ bool ActionMacroHandler::executeEvent(const MacroEvent ¯oEvent) void ActionMacroHandler::registerCommand(Id id) { - if (!m_commandIds.contains(id)) { - m_commandIds.insert(id); + if (Utils::insert(m_commandIds, id)) { const Command *command = ActionManager::command(id); if (QAction *action = command->action()) { connect(action, &QAction::triggered, this, [this, id, command]() { diff --git a/src/plugins/modeleditor/modelindexer.cpp b/src/plugins/modeleditor/modelindexer.cpp index d4471fe0ec6..163d0d60b53 100644 --- a/src/plugins/modeleditor/modelindexer.cpp +++ b/src/plugins/modeleditor/modelindexer.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -288,8 +289,7 @@ void ModelIndexer::IndexerThread::onFilesQueued() // collect all diagrams of model DiagramsCollectorVisitor visitor(indexedModel); project.rootPackage()->accept(&visitor); - if (m_indexer->d->defaultModelFiles.contains(queuedFile)) { - m_indexer->d->defaultModelFiles.remove(queuedFile); + if (m_indexer->d->defaultModelFiles.remove(queuedFile)) { // check if model has a diagram which could be opened qmt::FindRootDiagramVisitor diagramVisitor; project.rootPackage()->accept(&diagramVisitor); @@ -426,10 +426,9 @@ void ModelIndexer::scanProject(ProjectExplorer::Project *project) // queue files while (!filesQueue.isEmpty()) { QueuedFile queuedFile = filesQueue.takeFirst(); - if (!d->queuedFilesSet.contains(queuedFile)) { + if (Utils::insert(d->queuedFilesSet, queuedFile)) { QMT_CHECK(!d->filesQueue.contains(queuedFile)); d->filesQueue.append(queuedFile); - d->queuedFilesSet.insert(queuedFile); filesAreQueued = true; } } @@ -474,11 +473,10 @@ void ModelIndexer::forgetProject(ProjectExplorer::Project *project) const QString fileString = file.toString(); // remove file from queue QueuedFile queuedFile(fileString, project); - if (d->queuedFilesSet.contains(queuedFile)) { + if (d->queuedFilesSet.remove(queuedFile)) { QMT_CHECK(d->filesQueue.contains(queuedFile)); d->filesQueue.removeOne(queuedFile); QMT_CHECK(!d->filesQueue.contains(queuedFile)); - d->queuedFilesSet.remove(queuedFile); } removeModelFile(fileString, project); removeDiagramReferenceFile(fileString, project); diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 64fabcb30ab..9c04314da1b 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -521,8 +521,7 @@ void FlatModel::addFolderNode(WrapperNode *parent, FolderNode *folderNode, QSet< } } } - if (!isHidden && !seen->contains(subFolderNode)) { - seen->insert(subFolderNode); + if (!isHidden && Utils::insert(*seen, subFolderNode)) { auto node = new WrapperNode(subFolderNode); parent->appendChild(node); addFolderNode(node, subFolderNode, seen); @@ -531,10 +530,8 @@ void FlatModel::addFolderNode(WrapperNode *parent, FolderNode *folderNode, QSet< addFolderNode(parent, subFolderNode, seen); } } else if (FileNode *fileNode = node->asFileNode()) { - if (!seen->contains(fileNode)) { - seen->insert(fileNode); + if (Utils::insert(*seen, fileNode)) parent->appendChild(new WrapperNode(fileNode)); - } } } diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp index c9bb0f0b6ce..85110be4863 100644 --- a/src/plugins/python/pythonproject.cpp +++ b/src/plugins/python/pythonproject.cpp @@ -131,10 +131,9 @@ static QStringList readLines(const FilePath &projectFile) const QString line = stream.readLine(); if (line.isNull()) break; - if (visited.contains(line)) + if (!Utils::insert(visited, line)) continue; lines.append(line); - visited.insert(line); } } @@ -149,10 +148,8 @@ static QStringList readLinesJson(const FilePath &projectFile, QString *errorMess const QJsonObject obj = readObjJson(projectFile, errorMessage); for (const QJsonValue &file : obj.value("files").toArray()) { const QString fileName = file.toString(); - if (visited.contains(fileName)) - continue; - lines.append(fileName); - visited.insert(fileName); + if (Utils::insert(visited, fileName)) + lines.append(fileName); } return lines; diff --git a/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp b/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp index 33dc3013055..541cbbe5fb1 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -100,10 +101,8 @@ FilePaths QbsProjectImporter::importCandidates() for (Kit * const k : kits) { FilePath bdir = buildDir(projectFilePath(), k); const FilePath candidate = bdir.absolutePath(); - if (!seenCandidates.contains(candidate)) { - seenCandidates.insert(candidate); + if (Utils::insert(seenCandidates, candidate)) candidates << candidatesForDirectory(candidate); - } } qCDebug(qbsPmLog) << "build directory candidates:" << candidates; return candidates; diff --git a/src/plugins/qmljseditor/qmljscompletionassist.cpp b/src/plugins/qmljseditor/qmljscompletionassist.cpp index 0c11c625c5b..666f619dee3 100644 --- a/src/plugins/qmljseditor/qmljscompletionassist.cpp +++ b/src/plugins/qmljseditor/qmljscompletionassist.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -261,10 +262,9 @@ private: void processProperties(const ObjectValue *object) { - if (! object || _processed.contains(object)) + if (! object || !Utils::insert(_processed, object)) return; - _processed.insert(object); processProperties(object->prototype(_scopeChain->context())); _currentObject = object; diff --git a/src/plugins/qmljseditor/qmljsfindreferences.cpp b/src/plugins/qmljseditor/qmljsfindreferences.cpp index 5e72cd642b9..3f5d53d60f5 100644 --- a/src/plugins/qmljseditor/qmljsfindreferences.cpp +++ b/src/plugins/qmljseditor/qmljsfindreferences.cpp @@ -952,9 +952,8 @@ QList FindReferences::findUsageOfType(const Utils::FilePa QSet docDone; for (const QmlJS::Document::Ptr &doc : std::as_const(snapshot)) { Utils::FilePath sourceFile = modelManager->fileToSource(doc->fileName()); - if (docDone.contains(sourceFile)) + if (!Utils::insert(docDone, sourceFile)) continue; - docDone.insert(sourceFile); QmlJS::Document::Ptr sourceDoc = doc; if (sourceFile != doc->fileName()) sourceDoc = snapshot.document(sourceFile); diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index fba6b8154ff..d7418e1b316 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -533,10 +533,8 @@ QList QtOptionsPageWidget::toolChains(const QtVersion *version) for (const Abi &a : abis) { const Toolchains tcList = ToolChainManager::findToolChains(a); for (ToolChain *tc : tcList) { - if (ids.contains(tc->id())) - continue; - ids.insert(tc->id()); - toolChains.append(tc); + if (Utils::insert(ids, tc->id())) + toolChains.append(tc); } } diff --git a/src/plugins/squish/squishresultmodel.cpp b/src/plugins/squish/squishresultmodel.cpp index 15bca8d91ae..a5bba80bc0b 100644 --- a/src/plugins/squish/squishresultmodel.cpp +++ b/src/plugins/squish/squishresultmodel.cpp @@ -139,9 +139,7 @@ void SquishResultFilterModel::enableAllResultTypes() void SquishResultFilterModel::toggleResultType(Result::Type type) { - if (m_enabled.contains(type)) - m_enabled.remove(type); - else + if (!m_enabled.remove(type)) m_enabled.insert(type); invalidateFilter(); } diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 66e44e714b9..17bc9753810 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -570,9 +570,8 @@ FilePaths BaseFileFind::replaceAll(const QString &text, const SearchResultItems QSet> processed; for (const SearchResultItem &item : changeItems) { const QPair p{item.mainRange().begin.line, item.mainRange().begin.column}; - if (processed.contains(p)) + if (!Utils::insert(processed, p)) continue; - processed.insert(p); QString replacement; if (item.userData().canConvert() && !item.userData().toStringList().isEmpty()) { diff --git a/src/plugins/texteditor/codeassist/documentcontentcompletion.cpp b/src/plugins/texteditor/codeassist/documentcontentcompletion.cpp index 44506678e02..d994238f4a3 100644 --- a/src/plugins/texteditor/codeassist/documentcontentcompletion.cpp +++ b/src/plugins/texteditor/codeassist/documentcontentcompletion.cpp @@ -96,11 +96,10 @@ IAssistProposal *DocumentContentCompletionProcessor::performAsync() continue; } - if (!words.contains(word)) { + if (Utils::insert(words, word)) { auto item = new AssistProposalItem(); item->setText(word); items.append(item); - words.insert(word); } } diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 23c21c5df26..cbfc44d0355 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -4416,9 +4416,8 @@ void TextEditorWidgetPrivate::paintCurrentLineHighlight(const PaintEventData &da QSet seenLines; for (const QTextCursor &cursor : cursorsForBlock) { QTextLine line = data.block.layout()->lineForTextPosition(cursor.positionInBlock()); - if (seenLines.contains(line.lineNumber())) + if (!Utils::insert(seenLines, line.lineNumber())) continue; - seenLines << line.lineNumber(); QRectF lineRect = line.rect(); lineRect.moveTop(lineRect.top() + blockRect.top()); lineRect.setLeft(0); @@ -5657,10 +5656,8 @@ void TextEditorWidgetPrivate::slotUpdateBlockNotify(const QTextBlock &block) if (blockContainsFindScope) { QTextBlock b = block.document()->findBlock(scope.selectionStart()); do { - if (!updatedBlocks.contains(b.blockNumber())) { - updatedBlocks << b.blockNumber(); + if (Utils::insert(updatedBlocks, b.blockNumber())) emit q->requestBlockUpdate(b); - } b = b.next(); } while (b.isValid() && b.position() < scope.selectionEnd()); } From b0d0a5bca347fed3718bbf45926734e11327bcad Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 13 Jun 2023 14:07:24 +0200 Subject: [PATCH 0046/1777] Meson: De-noise Change-Id: I7ef49cbb29fc5429972abc24e9db5dbca506da0d Reviewed-by: Christian Stenger --- .../mesonprojectmanager/mesonprojectnodes.cpp | 29 ++++++++++--------- .../mesonprojectmanager/mesonprojectnodes.h | 11 +++---- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/plugins/mesonprojectmanager/mesonprojectnodes.cpp b/src/plugins/mesonprojectmanager/mesonprojectnodes.cpp index ad213ade0a3..d034e381be0 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectnodes.cpp +++ b/src/plugins/mesonprojectmanager/mesonprojectnodes.cpp @@ -10,38 +10,40 @@ #include #include -namespace MesonProjectManager { -namespace Internal { +using namespace ProjectExplorer; +using namespace Utils; -MesonProjectNode::MesonProjectNode(const Utils::FilePath &directory) - : ProjectExplorer::ProjectNode{directory} +namespace MesonProjectManager::Internal { + +MesonProjectNode::MesonProjectNode(const FilePath &directory) + : ProjectNode(directory) { setPriority(Node::DefaultProjectPriority + 1000); setIcon(Constants::Icons::MESON); setListInProject(false); } -MesonFileNode::MesonFileNode(const Utils::FilePath &file) - : ProjectExplorer::ProjectNode{file} +MesonFileNode::MesonFileNode(const FilePath &file) + : ProjectNode(file) { - setIcon(ProjectExplorer::DirectoryIcon(Constants::Icons::MESON)); + setIcon(DirectoryIcon(Constants::Icons::MESON)); setListInProject(true); } -MesonTargetNode::MesonTargetNode(const Utils::FilePath &directory, const QString &name) - : ProjectExplorer::ProjectNode{directory} - , m_name{name} +MesonTargetNode::MesonTargetNode(const FilePath &directory, const QString &name) + : ProjectNode(directory) + , m_name(name) { setPriority(Node::DefaultProjectPriority + 900); setIcon(":/projectexplorer/images/build.png"); setListInProject(false); setShowWhenEmpty(true); - setProductType(ProjectExplorer::ProductType::Other); + setProductType(ProductType::Other); } void MesonTargetNode::build() { - ProjectExplorer::Project *p = getProject(); + Project *p = getProject(); ProjectExplorer::Target *t = p ? p->activeTarget() : nullptr; if (t) static_cast(t->buildSystem())->mesonBuildConfiguration()->build(m_name); @@ -57,5 +59,4 @@ QString MesonTargetNode::buildKey() const return m_name; } -} // namespace Internal -} // namespace MesonProjectManager +} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/mesonprojectnodes.h b/src/plugins/mesonprojectmanager/mesonprojectnodes.h index 0a5cb919738..504a77b8dc4 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectnodes.h +++ b/src/plugins/mesonprojectmanager/mesonprojectnodes.h @@ -5,11 +5,7 @@ #include -#include -#include - -namespace MesonProjectManager { -namespace Internal { +namespace MesonProjectManager::Internal { class MesonProjectNode : public ProjectExplorer::ProjectNode { @@ -21,6 +17,7 @@ class MesonTargetNode : public ProjectExplorer::ProjectNode { public: MesonTargetNode(const Utils::FilePath &directory, const QString &name); + void build() override; QString tooltip() const final; QString buildKey() const final; @@ -33,6 +30,7 @@ class MesonFileNode : public ProjectExplorer::ProjectNode { public: MesonFileNode(const Utils::FilePath &file); + bool showInSimpleTree() const final { return false; } std::optional visibleAfterAddFileAction() const override { @@ -40,5 +38,4 @@ public: } }; -} // namespace Internal -} // namespace MesonProjectManager +} // MesonProjectManager:Internal From ffa52040a497efb2d699c6570a752c709c605e0d Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Fri, 23 Jun 2023 09:19:25 +0200 Subject: [PATCH 0047/1777] Docker: Fix ensureReachable ensureReachable for a path on the same device must return true. Change-Id: I5b6924795997758ec0ad31520fa971ecd2a9615c Reviewed-by: Reviewed-by: hjk --- src/plugins/docker/dockerdevice.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index b4cd5d3ca53..da05ff570f3 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -1232,6 +1232,9 @@ expected_str DockerDevicePrivate::localSource(const FilePath &other) c bool DockerDevicePrivate::ensureReachable(const FilePath &other) { + if (other.isSameDevice(q->rootPath())) + return true; + for (const QString &mount : m_data.mounts) { const FilePath fMount = FilePath::fromString(mount); if (other.isChildOf(fMount)) From 26ef8707610847b641d5831de0288dd4e9d66cc4 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jun 2023 13:20:27 +0200 Subject: [PATCH 0048/1777] Debugger: Somewhat more direct server command construction No need to set args just to delete them again. Change-Id: Ib97d327329a25cb907227feb22db2334908ef089 Reviewed-by: Marcus Tillmanns --- src/plugins/debugger/debuggerruncontrol.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index dc090bf30dc..20812bbee34 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -1034,14 +1034,12 @@ DebugServerRunner::DebugServerRunner(RunControl *runControl, DebugServerPortsGat CommandLine cmd; - if (isQmlDebugging) { + if (isQmlDebugging && !isCppDebugging) { + // FIXME: Case should not happen? + cmd.setExecutable(commandLine().executable()); cmd.addArg(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices, portsGatherer->qmlServer())); - } - cmd.addArgs(commandLine().arguments(), CommandLine::Raw); - - if (isQmlDebugging && !isCppDebugging) { - cmd.setExecutable(commandLine().executable()); // FIXME: Case should not happen? + cmd.addArgs(commandLine().arguments(), CommandLine::Raw); } else { cmd.setExecutable(runControl->device()->debugServerPath()); @@ -1065,7 +1063,6 @@ DebugServerRunner::DebugServerRunner(RunControl *runControl, DebugServerPortsGat cmd.setExecutable(runControl->device()->filePath("gdbserver")); } } - cmd.setArguments({}); if (cmd.executable().baseName().contains("lldb-server")) { cmd.addArg("platform"); cmd.addArg("--listen"); From 31c6ff495a6608254ee90f3a1a4baf44f2372df1 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Wed, 21 Jun 2023 16:38:41 +0200 Subject: [PATCH 0049/1777] Debugger: Fix remote debugging macosx apps Change-Id: I5328069ba9b82bb66dfa2c1e0d148a717d594a4b Reviewed-by: hjk --- share/qtcreator/debugger/lldbbridge.py | 40 ++++++++++++------- src/plugins/debugger/debuggerruncontrol.cpp | 10 +++-- .../remotelinux/remotelinuxdebugsupport.cpp | 7 +++- 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index bef97482af6..0d804a06043 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -971,20 +971,31 @@ class Dumper(DumperBase): self.debugger.GetListener(), self.remoteChannel_, None, error) else: - f = lldb.SBFileSpec() - f.SetFilename(self.executable_) + if self.platform_ == "remote-macosx": + DumperBase.warn("TARGET: %s" % self.target) - launchInfo = lldb.SBLaunchInfo(self.processArgs_) - #launchInfo.SetWorkingDirectory(self.workingDirectory_) - launchInfo.SetWorkingDirectory('/tmp') - if self.platform_ == 'remote-android': - launchInfo.SetWorkingDirectory('/data/local/tmp') - launchInfo.SetEnvironmentEntries(self.environment_, False) - launchInfo.SetExecutableFile(f, True) + self.process = self.target.ConnectRemote( + self.debugger.GetListener(), + "connect://" + self.remoteChannel_, None, error) - DumperBase.warn("TARGET: %s" % self.target) - self.process = self.target.Launch(launchInfo, error) - DumperBase.warn("PROCESS: %s" % self.process) + if self.breakOnMain_: + self.createBreakpointAtMain() + + DumperBase.warn("PROCESS: %s" % self.process) + else: + f = lldb.SBFileSpec() + f.SetFilename(self.executable_) + + launchInfo = lldb.SBLaunchInfo(self.processArgs_) + #launchInfo.SetWorkingDirectory(self.workingDirectory_) + launchInfo.SetWorkingDirectory('/tmp') + if self.platform_ == 'remote-android': + launchInfo.SetWorkingDirectory('/data/local/tmp') + launchInfo.SetEnvironmentEntries(self.environment_, False) + launchInfo.SetExecutableFile(f, True) + DumperBase.warn("TARGET: %s" % self.target) + self.process = self.target.Launch(launchInfo, error) + DumperBase.warn("PROCESS: %s" % self.process) if not error.Success(): self.report(self.describeError(error)) @@ -1479,8 +1490,9 @@ class Dumper(DumperBase): self.reportState("stopped") if self.firstStop_: self.firstStop_ = False - if self.useTerminal_: - # When using a terminal, the process will be interrupted on startup. + if self.useTerminal_ or self.platform_ == "remote-macosx": + # When using a terminal or remote debugging macosx apps, + # the process will be interrupted on startup. # We therefore need to continue it here. self.process.Continue() else: diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 20812bbee34..dc97966aa90 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -1069,9 +1069,13 @@ DebugServerRunner::DebugServerRunner(RunControl *runControl, DebugServerPortsGat cmd.addArg(QString("*:%1").arg(portsGatherer->gdbServer().port())); cmd.addArg("--server"); } else if (cmd.executable().baseName() == "debugserver") { - cmd.addArg(QString("*:%1").arg(portsGatherer->gdbServer().port())); - cmd.addArg("--attach"); - cmd.addArg(QString::number(m_pid.pid())); + const QString ipAndPort("`echo $SSH_CLIENT | cut -d ' ' -f 1`:%1"); + cmd.addArgs(ipAndPort.arg(portsGatherer->gdbServer().port()), CommandLine::Raw); + + if (m_pid.isValid()) + cmd.addArgs({"--attach", QString::number(m_pid.pid())}); + else + cmd.addCommandLineAsArgs(runControl->runnable().command); } else { // Something resembling gdbserver if (m_useMulti) diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index af476d48b94..d4cefc6394d 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp @@ -5,6 +5,7 @@ #include "remotelinux_constants.h" +#include #include #include @@ -37,7 +38,11 @@ public: setStartMode(AttachToRemoteServer); setCloseMode(KillAndExitMonitorAtClose); setUseExtendedRemote(true); - setLldbPlatform("remote-linux"); + + if (runControl->device()->osType() == Utils::OsTypeMac) + setLldbPlatform("remote-macosx"); + else + setLldbPlatform("remote-linux"); } }; From 4a17a26a6df1c020e286cb126459e046c7f6ae9e Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 21 Jun 2023 14:26:33 +0200 Subject: [PATCH 0050/1777] Python: Allow redirecting the display for remote setups Change-Id: I83baa9c74a1586590147668c9fea661018101776 Reviewed-by: David Schulz --- src/plugins/python/pythonrunconfiguration.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index e7c5b4dee14..42cd8a8e9ae 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -197,6 +197,14 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) addAspect(macroExpander(), nullptr); addAspect(); + if (HostOsInfo::isAnyUnixHost()) + addAspect(macroExpander()); + + setRunnableModifier([this](Runnable &r) { + if (const auto * const forwardingAspect = aspect()) + r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display()); + }); + setCommandLineGetter([bufferedAspect, interpreterAspect, argumentsAspect, scriptAspect] { CommandLine cmd{interpreterAspect->currentInterpreter().command}; if (!bufferedAspect->value()) From fd04d6afa4d530fc06783a817aea9d724087aff6 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 23 Jun 2023 10:15:47 +0200 Subject: [PATCH 0051/1777] ProjectExplorer: always map working directory path to command device Change-Id: I0d2d54df118b70c2874b77b4ec2792fb8e114416 Reviewed-by: hjk --- src/plugins/projectexplorer/runconfiguration.cpp | 2 +- src/plugins/python/pythonrunconfiguration.cpp | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 29b59ad8984..a38b8dfae05 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -400,7 +400,7 @@ Runnable RunConfiguration::runnable() const Runnable r; r.command = commandLine(); if (auto workingDirectoryAspect = aspect()) - r.workingDirectory = r.command.executable().withNewPath(workingDirectoryAspect->workingDirectory().path()); + r.workingDirectory = r.command.executable().withNewMappedPath(workingDirectoryAspect->workingDirectory()); if (auto environmentAspect = aspect()) r.environment = environmentAspect->environment(); if (m_runnableModifier) diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 42cd8a8e9ae..998a829bc91 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -226,10 +226,6 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) connect(target, &Target::buildSystemUpdated, this, [this]() { d->updateExtraCompilers(); }); currentInterpreterChanged(); - setRunnableModifier([](Runnable &r) { - r.workingDirectory = r.command.executable().withNewMappedPath(r.workingDirectory); // FIXME: Needed? - }); - connect(PySideInstaller::instance(), &PySideInstaller::pySideInstalled, this, [this](const FilePath &python) { if (python == aspect()->currentInterpreter().command) From d045d8dc60b89f2b596305b2550d1a0dc5ff946f Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 21 Jun 2023 16:54:11 +0200 Subject: [PATCH 0052/1777] ProjectExplorer: Merge DeviceProcessList into ProcessList The abstraction was not used anymore. Change-Id: I756ae65b9164d0032c3e6a26c3a123fc50f72a75 Reviewed-by: Christian Kandeler --- src/plugins/docker/dockerdevice.cpp | 2 +- src/plugins/docker/dockerdevice.h | 2 +- src/plugins/projectexplorer/CMakeLists.txt | 1 - .../devicesupport/desktopdevice.cpp | 3 +- .../devicesupport/desktopdevice.h | 2 +- .../devicesupport/deviceprocessesdialog.cpp | 10 +- .../devicesupport/deviceprocesslist.cpp | 146 ----------------- .../devicesupport/deviceprocesslist.h | 56 ------- .../projectexplorer/devicesupport/idevice.cpp | 4 +- .../projectexplorer/devicesupport/idevice.h | 4 +- .../devicesupport/processlist.cpp | 149 +++++++++++++++--- .../devicesupport/processlist.h | 36 +++-- .../projectexplorer/projectexplorer.qbs | 1 - src/plugins/remotelinux/linuxdevice.cpp | 2 +- src/plugins/remotelinux/linuxdevice.h | 2 +- 15 files changed, 166 insertions(+), 254 deletions(-) delete mode 100644 src/plugins/projectexplorer/devicesupport/deviceprocesslist.cpp delete mode 100644 src/plugins/projectexplorer/devicesupport/deviceprocesslist.h diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index da05ff570f3..05446d3760c 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -828,7 +828,7 @@ ProcessInterface *DockerDevice::createProcessInterface() const return new DockerProcessImpl(this->sharedFromThis(), d); } -DeviceProcessList *DockerDevice::createProcessListModel(QObject *parent) const +ProcessList *DockerDevice::createProcessListModel(QObject *parent) const { return new ProcessList(sharedFromThis(), parent); } diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index bd0ce29d9d4..e3e7bbf6b4b 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -74,7 +74,7 @@ public: Utils::ProcessInterface *createProcessInterface() const override; bool canCreateProcessModel() const override { return true; } - ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const override; + ProjectExplorer::ProcessList *createProcessListModel(QObject *parent) const override; bool hasDeviceTester() const override { return false; } ProjectExplorer::DeviceTester *createDeviceTester() const override; bool usableAsBuildDevice() const override; diff --git a/src/plugins/projectexplorer/CMakeLists.txt b/src/plugins/projectexplorer/CMakeLists.txt index d16e868a5cc..b9758fbfe7e 100644 --- a/src/plugins/projectexplorer/CMakeLists.txt +++ b/src/plugins/projectexplorer/CMakeLists.txt @@ -55,7 +55,6 @@ add_qtc_plugin(ProjectExplorer devicesupport/devicemanager.cpp devicesupport/devicemanager.h devicesupport/devicemanagermodel.cpp devicesupport/devicemanagermodel.h devicesupport/deviceprocessesdialog.cpp devicesupport/deviceprocessesdialog.h - devicesupport/deviceprocesslist.cpp devicesupport/deviceprocesslist.h devicesupport/devicesettingspage.cpp devicesupport/devicesettingspage.h devicesupport/devicesettingswidget.cpp devicesupport/devicesettingswidget.h devicesupport/devicetestdialog.cpp devicesupport/devicetestdialog.h diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 33ed3287cf0..bcd133488d7 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -6,7 +6,6 @@ #include "../projectexplorerconstants.h" #include "../projectexplorertr.h" #include "desktopprocesssignaloperation.h" -#include "deviceprocesslist.h" #include "processlist.h" #include @@ -90,7 +89,7 @@ bool DesktopDevice::canCreateProcessModel() const return true; } -DeviceProcessList *DesktopDevice::createProcessListModel(QObject *parent) const +ProcessList *DesktopDevice::createProcessListModel(QObject *parent) const { return new ProcessList(sharedFromThis(), parent); } diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.h b/src/plugins/projectexplorer/devicesupport/desktopdevice.h index bc4c353b465..bf5566d568c 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.h @@ -26,7 +26,7 @@ public: IDeviceWidget *createWidget() override; bool canCreateProcessModel() const override; - DeviceProcessList *createProcessListModel(QObject *parent) const override; + ProcessList *createProcessListModel(QObject *parent) const override; DeviceProcessSignalOperation::Ptr signalOperation() const override; QUrl toolControlChannel(const ControlChannelHint &) const override; bool usableAsBuildDevice() const override; diff --git a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp index 4c75ea39899..67545e6329c 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp @@ -3,8 +3,8 @@ #include "deviceprocessesdialog.h" -#include "deviceprocesslist.h" #include "idevice.h" +#include "processlist.h" #include "../kitchooser.h" #include "../kitinformation.h" #include "../projectexplorertr.h" @@ -84,7 +84,7 @@ public: ProcessInfo selectedProcess() const; QDialog *q; - std::unique_ptr processList; + std::unique_ptr processList; ProcessListFilterModel proxyModel; QLabel *kitLabel; KitChooser *kitChooser; @@ -191,11 +191,11 @@ void DeviceProcessesDialogPrivate::setDevice(const IDevice::ConstPtr &device) QTC_ASSERT(processList, return); proxyModel.setSourceModel(processList->model()); - connect(processList.get(), &DeviceProcessList::error, + connect(processList.get(), &ProcessList::error, this, &DeviceProcessesDialogPrivate::handleRemoteError); - connect(processList.get(), &DeviceProcessList::processListUpdated, + connect(processList.get(), &ProcessList::processListUpdated, this, &DeviceProcessesDialogPrivate::handleProcessListUpdated); - connect(processList.get(), &DeviceProcessList::processKilled, + connect(processList.get(), &ProcessList::processKilled, this, &DeviceProcessesDialogPrivate::handleProcessKilled, Qt::QueuedConnection); updateButtons(); diff --git a/src/plugins/projectexplorer/devicesupport/deviceprocesslist.cpp b/src/plugins/projectexplorer/devicesupport/deviceprocesslist.cpp deleted file mode 100644 index 6645a478ecb..00000000000 --- a/src/plugins/projectexplorer/devicesupport/deviceprocesslist.cpp +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "deviceprocesslist.h" - -#include "idevice.h" -#include "../projectexplorertr.h" - -#include -#include -#include - -using namespace Utils; - -namespace ProjectExplorer { -namespace Internal { - -enum State { Inactive, Listing, Killing }; - -class DeviceProcessTreeItem : public TreeItem -{ -public: - DeviceProcessTreeItem(const ProcessInfo &p, Qt::ItemFlags f) : process(p), fl(f) {} - - QVariant data(int column, int role) const final; - Qt::ItemFlags flags(int) const final { return fl; } - - ProcessInfo process; - Qt::ItemFlags fl; -}; - -class DeviceProcessListPrivate -{ -public: - DeviceProcessListPrivate(const IDevice::ConstPtr &device) - : device(device) - { } - - qint64 ownPid = -1; - const IDevice::ConstPtr device; - State state = Inactive; - TreeModel, DeviceProcessTreeItem> model; -}; - -} // namespace Internal - -using namespace Internal; - -DeviceProcessList::DeviceProcessList(const IDevice::ConstPtr &device, QObject *parent) - : QObject(parent), d(std::make_unique(device)) -{ - d->model.setHeader({Tr::tr("Process ID"), Tr::tr("Command Line")}); -} - -DeviceProcessList::~DeviceProcessList() = default; - -void DeviceProcessList::update() -{ - QTC_ASSERT(d->state == Inactive, return); - QTC_ASSERT(device(), return); - - d->model.clear(); - d->model.rootItem()->appendChild( - new DeviceProcessTreeItem( - {0, Tr::tr("Fetching process list. This might take a while."), ""}, - Qt::NoItemFlags)); - d->state = Listing; - doUpdate(); -} - -void DeviceProcessList::reportProcessListUpdated(const QList &processes) -{ - QTC_ASSERT(d->state == Listing, return); - setFinished(); - d->model.clear(); - for (const ProcessInfo &process : processes) { - Qt::ItemFlags fl; - if (process.processId != d->ownPid) - fl = Qt::ItemIsEnabled | Qt::ItemIsSelectable; - d->model.rootItem()->appendChild(new DeviceProcessTreeItem(process, fl)); - } - - emit processListUpdated(); -} - -void DeviceProcessList::killProcess(int row) -{ - QTC_ASSERT(row >= 0 && row < d->model.rootItem()->childCount(), return); - QTC_ASSERT(d->state == Inactive, return); - QTC_ASSERT(device(), return); - - d->state = Killing; - doKillProcess(at(row)); -} - -void DeviceProcessList::setOwnPid(qint64 pid) -{ - d->ownPid = pid; -} - -void DeviceProcessList::reportProcessKilled() -{ - QTC_ASSERT(d->state == Killing, return); - setFinished(); - emit processKilled(); -} - -ProcessInfo DeviceProcessList::at(int row) const -{ - return d->model.rootItem()->childAt(row)->process; -} - -QAbstractItemModel *DeviceProcessList::model() const -{ - return &d->model; -} - -QVariant DeviceProcessTreeItem::data(int column, int role) const -{ - if (role == Qt::DisplayRole || role == Qt::ToolTipRole) { - if (column == 0) - return process.processId ? process.processId : QVariant(); - else - return process.commandLine; - } - return QVariant(); -} - -void DeviceProcessList::setFinished() -{ - d->state = Inactive; -} - -IDevice::ConstPtr DeviceProcessList::device() const -{ - return d->device; -} - -void DeviceProcessList::reportError(const QString &message) -{ - QTC_ASSERT(d->state != Inactive, return); - setFinished(); - emit error(message); -} - -} // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/deviceprocesslist.h b/src/plugins/projectexplorer/devicesupport/deviceprocesslist.h deleted file mode 100644 index 1faa5c19881..00000000000 --- a/src/plugins/projectexplorer/devicesupport/deviceprocesslist.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "../projectexplorer_export.h" -#include "idevicefwd.h" - -#include -#include - -#include - -namespace Utils { class ProcessInfo; } - -namespace ProjectExplorer { - -namespace Internal { class DeviceProcessListPrivate; } - -class PROJECTEXPLORER_EXPORT DeviceProcessList : public QObject -{ - Q_OBJECT - -public: - DeviceProcessList(const IDeviceConstPtr &device, QObject *parent = nullptr); - ~DeviceProcessList() override; - - void update(); - void killProcess(int row); - void setOwnPid(qint64 pid); - - Utils::ProcessInfo at(int row) const; - QAbstractItemModel *model() const; - -signals: - void processListUpdated(); - void error(const QString &errorMsg); - void processKilled(); - -protected: - void reportError(const QString &message); - void reportProcessKilled(); - void reportProcessListUpdated(const QList &processes); - - IDeviceConstPtr device() const; - -private: - virtual void doUpdate() = 0; - virtual void doKillProcess(const Utils::ProcessInfo &process) = 0; - - void setFinished(); - - const std::unique_ptr d; -}; - -} // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 12ff8e3cac3..b35f8be9785 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -4,8 +4,8 @@ #include "idevice.h" #include "devicemanager.h" -#include "deviceprocesslist.h" #include "idevicefactory.h" +#include "processlist.h" #include "sshparameters.h" #include "../kit.h" @@ -393,7 +393,7 @@ PortsGatheringMethod IDevice::portsGatheringMethod() const &Port::parseFromCommandOutput}; }; -DeviceProcessList *IDevice::createProcessListModel(QObject *parent) const +ProcessList *IDevice::createProcessListModel(QObject *parent) const { Q_UNUSED(parent) QTC_ASSERT(false, qDebug("This should not have been called..."); return nullptr); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index e28f88aaf46..845acb94f83 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -41,7 +41,7 @@ class Process; namespace ProjectExplorer { -class DeviceProcessList; +class ProcessList; class FileTransferInterface; class FileTransferSetupData; class Kit; @@ -142,7 +142,7 @@ public: virtual PortsGatheringMethod portsGatheringMethod() const; virtual bool canCreateProcessModel() const { return false; } - virtual DeviceProcessList *createProcessListModel(QObject *parent = nullptr) const; + virtual ProcessList *createProcessListModel(QObject *parent = nullptr) const; virtual bool hasDeviceTester() const { return false; } virtual DeviceTester *createDeviceTester() const; diff --git a/src/plugins/projectexplorer/devicesupport/processlist.cpp b/src/plugins/projectexplorer/devicesupport/processlist.cpp index 11e0932832d..2d69fb404ec 100644 --- a/src/plugins/projectexplorer/devicesupport/processlist.cpp +++ b/src/plugins/projectexplorer/devicesupport/processlist.cpp @@ -3,8 +3,12 @@ #include "processlist.h" -#include +#include "idevice.h" +#include "../projectexplorertr.h" + #include +#include +#include #include @@ -17,45 +21,140 @@ using namespace Utils; namespace ProjectExplorer { +namespace Internal { + +enum State { Inactive, Listing, Killing }; + +class DeviceProcessTreeItem : public TreeItem +{ +public: + DeviceProcessTreeItem(const ProcessInfo &p, Qt::ItemFlags f) : process(p), fl(f) {} + + QVariant data(int column, int role) const final; + Qt::ItemFlags flags(int) const final { return fl; } + + ProcessInfo process; + Qt::ItemFlags fl; +}; + +class DeviceProcessListPrivate +{ +public: + DeviceProcessListPrivate(const IDevice::ConstPtr &device) + : device(device) + { + // FIXME: This should not be used for non-desktop cases. +#if defined(Q_OS_UNIX) + ownPid = getpid(); +#elif defined(Q_OS_WIN) + ownPid = GetCurrentProcessId(); +#endif + } + + qint64 ownPid = -1; + const IDevice::ConstPtr device; + State state = Inactive; + TreeModel, DeviceProcessTreeItem> model; + DeviceProcessSignalOperation::Ptr signalOperation; +}; + +} // namespace Internal + +using namespace Internal; ProcessList::ProcessList(const IDevice::ConstPtr &device, QObject *parent) - : DeviceProcessList(device, parent) + : QObject(parent), d(std::make_unique(device)) { -#if defined(Q_OS_UNIX) - setOwnPid(getpid()); -#elif defined(Q_OS_WIN) - setOwnPid(GetCurrentProcessId()); -#endif + d->model.setHeader({Tr::tr("Process ID"), Tr::tr("Command Line")}); } -void ProcessList::doKillProcess(const ProcessInfo &processInfo) +ProcessList::~ProcessList() = default; + +void ProcessList::update() { - m_signalOperation = device()->signalOperation(); - connect(m_signalOperation.data(), - &DeviceProcessSignalOperation::finished, - this, - &ProcessList::reportDelayedKillStatus); - m_signalOperation->killProcess(processInfo.processId); + QTC_ASSERT(d->state == Inactive, return); + QTC_ASSERT(d->device, return); + + d->model.clear(); + d->model.rootItem()->appendChild( + new DeviceProcessTreeItem( + {0, Tr::tr("Fetching process list. This might take a while."), ""}, + Qt::NoItemFlags)); + d->state = Listing; + + QTimer::singleShot(0, this, &ProcessList::handleUpdate); +} + +void ProcessList::killProcess(int row) +{ + QTC_ASSERT(row >= 0 && row < d->model.rootItem()->childCount(), return); + QTC_ASSERT(d->state == Inactive, return); + QTC_ASSERT(d->device, return); + + d->state = Killing; + + const ProcessInfo processInfo = at(row); + d->signalOperation = d->device->signalOperation(); + connect(d->signalOperation.data(), &DeviceProcessSignalOperation::finished, + this, &ProcessList::reportDelayedKillStatus); + d->signalOperation->killProcess(processInfo.processId); +} + +ProcessInfo ProcessList::at(int row) const +{ + return d->model.rootItem()->childAt(row)->process; +} + +QAbstractItemModel *ProcessList::model() const +{ + return &d->model; +} + +QVariant DeviceProcessTreeItem::data(int column, int role) const +{ + if (role == Qt::DisplayRole || role == Qt::ToolTipRole) { + if (column == 0) + return process.processId ? process.processId : QVariant(); + else + return process.commandLine; + } + return QVariant(); +} + +void ProcessList::setFinished() +{ + d->state = Inactive; } void ProcessList::handleUpdate() { - reportProcessListUpdated(ProcessInfo::processInfoList(DeviceProcessList::device()->rootPath())); -} + const QList processes = ProcessInfo::processInfoList(d->device->rootPath()); + QTC_ASSERT(d->state == Listing, return); + setFinished(); + d->model.clear(); + for (const ProcessInfo &process : processes) { + Qt::ItemFlags fl; + if (process.processId != d->ownPid) + fl = Qt::ItemIsEnabled | Qt::ItemIsSelectable; + d->model.rootItem()->appendChild(new DeviceProcessTreeItem(process, fl)); + } -void ProcessList::doUpdate() -{ - QTimer::singleShot(0, this, &ProcessList::handleUpdate); + emit processListUpdated(); } void ProcessList::reportDelayedKillStatus(const QString &errorMessage) { - if (errorMessage.isEmpty()) - reportProcessKilled(); - else - reportError(errorMessage); + if (errorMessage.isEmpty()) { + QTC_CHECK(d->state == Killing); + setFinished(); + emit processKilled(); + } else { + QTC_CHECK(d->state != Inactive); + setFinished(); + emit error(errorMessage); + } - m_signalOperation.reset(); + d->signalOperation.reset(); } -} // namespace ProjectExplorer +} // ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/processlist.h b/src/plugins/projectexplorer/devicesupport/processlist.h index caebaf22f97..6b9f9b9cc5f 100644 --- a/src/plugins/projectexplorer/devicesupport/processlist.h +++ b/src/plugins/projectexplorer/devicesupport/processlist.h @@ -3,28 +3,46 @@ #pragma once -#include "deviceprocesslist.h" -#include "idevice.h" +#include "../projectexplorer_export.h" +#include "idevicefwd.h" + +#include +#include + +#include + +namespace Utils { class ProcessInfo; } namespace ProjectExplorer { -class PROJECTEXPLORER_EXPORT ProcessList : public DeviceProcessList +namespace Internal { class DeviceProcessListPrivate; } + +class PROJECTEXPLORER_EXPORT ProcessList : public QObject { Q_OBJECT public: - explicit ProcessList(const IDeviceConstPtr &device, QObject *parent = nullptr); + ProcessList(const IDeviceConstPtr &device, QObject *parent = nullptr); + ~ProcessList() override; -private: - void doUpdate() override; - void doKillProcess(const Utils::ProcessInfo &process) override; + void update(); + void killProcess(int row); + + Utils::ProcessInfo at(int row) const; + QAbstractItemModel *model() const; + +signals: + void processListUpdated(); + void error(const QString &errorMsg); + void processKilled(); private: void handleUpdate(); void reportDelayedKillStatus(const QString &errorMessage); -private: - DeviceProcessSignalOperation::Ptr m_signalOperation; + void setFinished(); + + const std::unique_ptr d; }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index c955a485905..420296a306b 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -210,7 +210,6 @@ Project { "devicemanager.cpp", "devicemanager.h", "devicemanagermodel.cpp", "devicemanagermodel.h", "deviceprocessesdialog.cpp", "deviceprocessesdialog.h", - "deviceprocesslist.cpp", "deviceprocesslist.h", "devicesettingspage.cpp", "devicesettingspage.h", "devicesettingswidget.cpp", "devicesettingswidget.h", "devicetestdialog.cpp", "devicetestdialog.h", diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 61939f20954..a38f1c081a1 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -995,7 +995,7 @@ IDeviceWidget *LinuxDevice::createWidget() return new Internal::GenericLinuxDeviceConfigurationWidget(sharedFromThis()); } -DeviceProcessList *LinuxDevice::createProcessListModel(QObject *parent) const +ProcessList *LinuxDevice::createProcessListModel(QObject *parent) const { return new ProcessList(sharedFromThis(), parent); } diff --git a/src/plugins/remotelinux/linuxdevice.h b/src/plugins/remotelinux/linuxdevice.h index 2094b426b4c..36179c83ea8 100644 --- a/src/plugins/remotelinux/linuxdevice.h +++ b/src/plugins/remotelinux/linuxdevice.h @@ -23,7 +23,7 @@ public: ProjectExplorer::IDeviceWidget *createWidget() override; bool canCreateProcessModel() const override { return true; } - ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const override; + ProjectExplorer::ProcessList *createProcessListModel(QObject *parent) const override; bool hasDeviceTester() const override { return true; } ProjectExplorer::DeviceTester *createDeviceTester() const override; ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override; From a62fcb73ce2a36209964669667f05971a175a02b Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 21 Jun 2023 17:20:55 +0200 Subject: [PATCH 0053/1777] ProjectExplorer: Remove IDevice::createProcessListModel All re-implementations are the same nowadays. Change-Id: I954b3c9ca296967a99ea548ade6282fba188249f Reviewed-by: Reviewed-by: Qt CI Bot Reviewed-by: Christian Kandeler --- src/plugins/docker/dockerdevice.cpp | 5 ----- src/plugins/docker/dockerdevice.h | 1 - .../projectexplorer/devicesupport/desktopdevice.cpp | 5 ----- src/plugins/projectexplorer/devicesupport/desktopdevice.h | 1 - .../devicesupport/deviceprocessesdialog.cpp | 3 ++- src/plugins/projectexplorer/devicesupport/idevice.cpp | 7 ------- src/plugins/projectexplorer/devicesupport/idevice.h | 5 +---- src/plugins/remotelinux/linuxdevice.cpp | 5 ----- src/plugins/remotelinux/linuxdevice.h | 1 - 9 files changed, 3 insertions(+), 30 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 05446d3760c..565fde8b51c 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -828,11 +828,6 @@ ProcessInterface *DockerDevice::createProcessInterface() const return new DockerProcessImpl(this->sharedFromThis(), d); } -ProcessList *DockerDevice::createProcessListModel(QObject *parent) const -{ - return new ProcessList(sharedFromThis(), parent); -} - DeviceTester *DockerDevice::createDeviceTester() const { return nullptr; diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index e3e7bbf6b4b..596b047d0b8 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -74,7 +74,6 @@ public: Utils::ProcessInterface *createProcessInterface() const override; bool canCreateProcessModel() const override { return true; } - ProjectExplorer::ProcessList *createProcessListModel(QObject *parent) const override; bool hasDeviceTester() const override { return false; } ProjectExplorer::DeviceTester *createDeviceTester() const override; bool usableAsBuildDevice() const override; diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index bcd133488d7..98805597967 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -89,11 +89,6 @@ bool DesktopDevice::canCreateProcessModel() const return true; } -ProcessList *DesktopDevice::createProcessListModel(QObject *parent) const -{ - return new ProcessList(sharedFromThis(), parent); -} - DeviceProcessSignalOperation::Ptr DesktopDevice::signalOperation() const { return DeviceProcessSignalOperation::Ptr(new DesktopProcessSignalOperation()); diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.h b/src/plugins/projectexplorer/devicesupport/desktopdevice.h index bf5566d568c..f37c3f7f948 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.h @@ -26,7 +26,6 @@ public: IDeviceWidget *createWidget() override; bool canCreateProcessModel() const override; - ProcessList *createProcessListModel(QObject *parent) const override; DeviceProcessSignalOperation::Ptr signalOperation() const override; QUrl toolControlChannel(const ControlChannelHint &) const override; bool usableAsBuildDevice() const override; diff --git a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp index 67545e6329c..b5d138dfc9b 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp @@ -187,7 +187,8 @@ void DeviceProcessesDialogPrivate::setDevice(const IDevice::ConstPtr &device) if (!device) return; - processList.reset(device->createProcessListModel()); + processList.reset(new ProcessList(device->sharedFromThis(), this)); + QTC_ASSERT(processList, return); proxyModel.setSourceModel(processList->model()); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index b35f8be9785..65a7d11f815 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -391,13 +391,6 @@ PortsGatheringMethod IDevice::portsGatheringMethod() const return {filePath("netstat"), {"-a", "-n"}}; }, &Port::parseFromCommandOutput}; -}; - -ProcessList *IDevice::createProcessListModel(QObject *parent) const -{ - Q_UNUSED(parent) - QTC_ASSERT(false, qDebug("This should not have been called..."); return nullptr); - return nullptr; } DeviceTester *IDevice::createDeviceTester() const diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 845acb94f83..2f1d60d288e 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -32,16 +32,14 @@ namespace Utils { class CommandLine; class DeviceFileAccess; class Environment; -class Icon; class PortList; class Port; -class ProcessInterface; class Process; +class ProcessInterface; } // Utils namespace ProjectExplorer { -class ProcessList; class FileTransferInterface; class FileTransferSetupData; class Kit; @@ -142,7 +140,6 @@ public: virtual PortsGatheringMethod portsGatheringMethod() const; virtual bool canCreateProcessModel() const { return false; } - virtual ProcessList *createProcessListModel(QObject *parent = nullptr) const; virtual bool hasDeviceTester() const { return false; } virtual DeviceTester *createDeviceTester() const; diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index a38f1c081a1..5883af8a4ae 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -995,11 +995,6 @@ IDeviceWidget *LinuxDevice::createWidget() return new Internal::GenericLinuxDeviceConfigurationWidget(sharedFromThis()); } -ProcessList *LinuxDevice::createProcessListModel(QObject *parent) const -{ - return new ProcessList(sharedFromThis(), parent); -} - DeviceTester *LinuxDevice::createDeviceTester() const { return new GenericLinuxDeviceTester; diff --git a/src/plugins/remotelinux/linuxdevice.h b/src/plugins/remotelinux/linuxdevice.h index 36179c83ea8..d0a06219e8e 100644 --- a/src/plugins/remotelinux/linuxdevice.h +++ b/src/plugins/remotelinux/linuxdevice.h @@ -23,7 +23,6 @@ public: ProjectExplorer::IDeviceWidget *createWidget() override; bool canCreateProcessModel() const override { return true; } - ProjectExplorer::ProcessList *createProcessListModel(QObject *parent) const override; bool hasDeviceTester() const override { return true; } ProjectExplorer::DeviceTester *createDeviceTester() const override; ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override; From 8c9683a627dbc863c406de30afd1595e38fa266b Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 24 May 2023 15:27:03 +0200 Subject: [PATCH 0054/1777] FileSearch: Introduce oveload for findInFiles() taking FileContainer Handle gracefully pausing the search after exceeding the 200000 hits limit and continuing on user request. Change-Id: I4e9ea92cfdb5fa54706c862a654edb6169fce84a Reviewed-by: Reviewed-by: Eike Ziller Reviewed-by: Qt CI Bot --- src/libs/utils/filesearch.cpp | 131 +++++++++++++++++++++++++++++++++- src/libs/utils/filesearch.h | 3 + 2 files changed, 132 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index 7dd8951b91c..5d20d6a700f 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -4,6 +4,7 @@ #include "filesearch.h" #include "algorithm.h" +#include "async.h" #include "filepath.h" #include "mapreduce.h" #include "qtcassert.h" @@ -13,6 +14,7 @@ #include #include +#include #include #include @@ -331,9 +333,134 @@ void cleanUpFileSearch(QFutureInterface &futureInterface, } // namespace -QFuture Utils::findInFiles(const QString &searchTerm, FileIterator *files, - FindFlags flags, +static void fileSearch(QPromise &promise, + const FileContainerIterator::Item &item, const QString &searchTerm, + FindFlags flags, const QMap &fileToContentsMap) +{ + if (promise.isCanceled()) + return; + qCDebug(searchLog) << "Searching in" << item.filePath; + promise.setProgressRange(0, 1); + promise.setProgressValue(0); + QString contents; + if (!getFileContent(item.filePath, item.encoding, &contents, fileToContentsMap)) { + qCDebug(searchLog) << "- failed to get content for" << item.filePath; + promise.future().cancel(); // failure + return; + } + + const QFuture future(promise.future()); + const SearchResultItems results = searchInContents(future, searchTerm, flags, item.filePath, + contents); + if (!promise.isCanceled()) { + promise.addResult(results); + promise.setProgressValue(1); + } + qCDebug(searchLog) << "- finished searching in" << item.filePath; +} + +static void findInFilesImpl(QPromise &promise, const QString &searchTerm, + const FileContainer &container, FindFlags flags, + const QMap &fileToContentsMap) +{ + QEventLoop loop; + // The states transition exactly in this order: + enum State { BelowLimit, AboveLimit, Resumed }; + State state = BelowLimit; + int reportedItemsCount = 0; + int searchedFilesCount = 0; + + const int progressMaximum = container.progressMaximum(); + promise.setProgressRange(0, progressMaximum); + promise.setProgressValueAndText(0, msgFound(searchTerm, 0, 0)); + const int threadsCount = qMax(1, QThread::idealThreadCount() / 2); + QSet *> watchers; + FutureSynchronizer futureSynchronizer; + + const auto cleanup = qScopeGuard([&] { + qDeleteAll(watchers); + const QString message = promise.isCanceled() + ? msgCanceled(searchTerm, reportedItemsCount, searchedFilesCount) + : msgFound(searchTerm, reportedItemsCount, searchedFilesCount); + promise.setProgressValueAndText(progressMaximum, message); + }); + + FileContainerIterator it = container.begin(); + const FileContainerIterator itEnd = container.end(); + if (it == itEnd) + return; + + std::function scheduleNext; + scheduleNext = [&] { + if (promise.isCanceled() || (it == itEnd && watchers.isEmpty())) { + loop.quit(); + return; + } + if (it == itEnd) + return; + + if (state == AboveLimit) + return; + + if (watchers.size() == threadsCount) + return; + + const FileContainerIterator::Item item = *it; + const int progress = it.progressValue(); + ++it; + const QFuture future + = Utils::asyncRun(fileSearch, item, searchTerm, flags, fileToContentsMap); + QFutureWatcher *watcher = new QFutureWatcher; + QObject::connect(watcher, &QFutureWatcherBase::finished, &loop, + [watcher, progress, &searchTerm, &reportedItemsCount, &searchedFilesCount, &state, + &watchers, &promise, &scheduleNext] { + const QFuture future = watcher->future(); + if (future.resultCount()) { + const SearchResultItems items = future.result(); + reportedItemsCount += items.size(); + if (state == BelowLimit && reportedItemsCount > 200000) + state = AboveLimit; + if (!items.isEmpty()) + promise.addResult(items); + } + ++searchedFilesCount; + promise.setProgressValueAndText(progress, msgFound(searchTerm, reportedItemsCount, + searchedFilesCount)); + watcher->deleteLater(); + watchers.remove(watcher); + scheduleNext(); + }); + watcher->setFuture(future); + futureSynchronizer.addFuture(future); + watchers.insert(watcher); + scheduleNext(); + }; + + QFutureWatcher watcher; + QObject::connect(&watcher, &QFutureWatcherBase::canceled, &loop, &QEventLoop::quit); + QObject::connect(&watcher, &QFutureWatcherBase::resumed, &loop, [&state, &scheduleNext] { + state = Resumed; + scheduleNext(); + }); + + watcher.setFuture(QFuture(promise.future())); + + if (promise.isCanceled()) + return; + + QTimer::singleShot(0, &loop, scheduleNext); + loop.exec(QEventLoop::ExcludeUserInputEvents); +} + +QFuture Utils::findInFiles(const QString &searchTerm, + const FileContainer &container, FindFlags flags, const QMap &fileToContentsMap) +{ + return Utils::asyncRun(findInFilesImpl, searchTerm, container, flags, fileToContentsMap); +} + +QFuture Utils::findInFiles(const QString &searchTerm, FileIterator *files, + FindFlags flags, const QMap &fileToContentsMap) { return mapReduce(files->begin(), files->end(), [searchTerm, files](QFutureInterface &futureInterface) { diff --git a/src/libs/utils/filesearch.h b/src/libs/utils/filesearch.h index 81c5e2b8cd1..35724a8ec44 100644 --- a/src/libs/utils/filesearch.h +++ b/src/libs/utils/filesearch.h @@ -267,6 +267,9 @@ private: QList m_items; }; +QTCREATOR_UTILS_EXPORT QFuture findInFiles(const QString &searchTerm, + const FileContainer &container, FindFlags flags, const QMap &fileToContentsMap); + QTCREATOR_UTILS_EXPORT QFuture findInFiles(const QString &searchTerm, FileIterator *files, FindFlags flags, const QMap &fileToContentsMap); From 27302694ab794d8437b6feac4095ad34fa43ed24 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 24 May 2023 17:20:27 +0200 Subject: [PATCH 0055/1777] BaseFileFind: Reuse FileContainer Reuse it in BaseFileFind::files() and in InternalEngine::executeSearch(). Change-Id: I2fed4e6af37e83d76deaa8d847564aa4950fc223 Reviewed-by: Qt CI Bot Reviewed-by: Eike Ziller --- .../projectexplorer/allprojectsfind.cpp | 6 +++--- src/plugins/projectexplorer/allprojectsfind.h | 4 ++-- .../projectexplorer/currentprojectfind.cpp | 6 +++--- .../projectexplorer/currentprojectfind.h | 2 +- .../projectexplorer/filesinallprojectsfind.cpp | 8 +++----- .../projectexplorer/filesinallprojectsfind.h | 2 +- src/plugins/texteditor/basefilefind.cpp | 9 ++++----- src/plugins/texteditor/basefilefind.h | 7 ++----- src/plugins/texteditor/findincurrentfile.cpp | 15 ++++++++------- src/plugins/texteditor/findincurrentfile.h | 2 +- src/plugins/texteditor/findinfiles.cpp | 8 +++----- src/plugins/texteditor/findinfiles.h | 2 +- src/plugins/texteditor/findinopenfiles.cpp | 18 ++++++++++-------- src/plugins/texteditor/findinopenfiles.h | 2 +- 14 files changed, 43 insertions(+), 48 deletions(-) diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp index d61b1560523..53bc13cfef3 100644 --- a/src/plugins/projectexplorer/allprojectsfind.cpp +++ b/src/plugins/projectexplorer/allprojectsfind.cpp @@ -47,7 +47,7 @@ bool AllProjectsFind::isEnabled() const return BaseFileFind::isEnabled() && ProjectManager::hasProjects(); } -FileIterator *AllProjectsFind::files(const QStringList &nameFilters, +FileContainer AllProjectsFind::files(const QStringList &nameFilters, const QStringList &exclusionFilters, const QVariant &additionalParameters) const { @@ -55,7 +55,7 @@ FileIterator *AllProjectsFind::files(const QStringList &nameFilters, return filesForProjects(nameFilters, exclusionFilters, ProjectManager::projects()); } -FileIterator *AllProjectsFind::filesForProjects(const QStringList &nameFilters, +FileContainer AllProjectsFind::filesForProjects(const QStringList &nameFilters, const QStringList &exclusionFilters, const QList &projects) const { @@ -77,7 +77,7 @@ FileIterator *AllProjectsFind::filesForProjects(const QStringList &nameFilters, encodings.insert(fileName, codec); } } - return new FileListIterator(encodings.keys(), encodings.values()); + return FileListContainer(encodings.keys(), encodings.values()); } QVariant AllProjectsFind::additionalParameters() const diff --git a/src/plugins/projectexplorer/allprojectsfind.h b/src/plugins/projectexplorer/allprojectsfind.h index a66ab8d96a9..4752d8d28a3 100644 --- a/src/plugins/projectexplorer/allprojectsfind.h +++ b/src/plugins/projectexplorer/allprojectsfind.h @@ -30,10 +30,10 @@ public: void readSettings(QSettings *settings) override; protected: - Utils::FileIterator *files(const QStringList &nameFilters, + Utils::FileContainer files(const QStringList &nameFilters, const QStringList &exclusionFilters, const QVariant &additionalParameters) const override; - Utils::FileIterator *filesForProjects(const QStringList &nameFilters, + Utils::FileContainer filesForProjects(const QStringList &nameFilters, const QStringList &exclusionFilters, const QList &projects) const; diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index 3bde2bb62f2..fb688ae2d5d 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -57,17 +57,17 @@ QVariant CurrentProjectFind::additionalParameters() const return QVariant(); } -FileIterator *CurrentProjectFind::files(const QStringList &nameFilters, +FileContainer CurrentProjectFind::files(const QStringList &nameFilters, const QStringList &exclusionFilters, const QVariant &additionalParameters) const { - QTC_ASSERT(additionalParameters.isValid(), return new FileListIterator); + QTC_ASSERT(additionalParameters.isValid(), return {}); const FilePath projectFile = FilePath::fromVariant(additionalParameters); for (Project *project : ProjectManager::projects()) { if (project && projectFile == project->projectFilePath()) return filesForProjects(nameFilters, exclusionFilters, {project}); } - return new FileListIterator; + return {}; } QString CurrentProjectFind::label() const diff --git a/src/plugins/projectexplorer/currentprojectfind.h b/src/plugins/projectexplorer/currentprojectfind.h index 586d0b85b10..6554233d698 100644 --- a/src/plugins/projectexplorer/currentprojectfind.h +++ b/src/plugins/projectexplorer/currentprojectfind.h @@ -27,7 +27,7 @@ public: void readSettings(QSettings *settings) override; protected: - Utils::FileIterator *files(const QStringList &nameFilters, + Utils::FileContainer files(const QStringList &nameFilters, const QStringList &exclusionFilters, const QVariant &additionalParameters) const override; QVariant additionalParameters() const override; diff --git a/src/plugins/projectexplorer/filesinallprojectsfind.cpp b/src/plugins/projectexplorer/filesinallprojectsfind.cpp index 0f9d6c40e25..554b072f7b7 100644 --- a/src/plugins/projectexplorer/filesinallprojectsfind.cpp +++ b/src/plugins/projectexplorer/filesinallprojectsfind.cpp @@ -47,7 +47,7 @@ void FilesInAllProjectsFind::readSettings(QSettings *settings) settings->endGroup(); } -Utils::FileIterator *FilesInAllProjectsFind::files(const QStringList &nameFilters, +FileContainer FilesInAllProjectsFind::files(const QStringList &nameFilters, const QStringList &exclusionFilters, const QVariant &additionalParameters) const { @@ -55,10 +55,8 @@ Utils::FileIterator *FilesInAllProjectsFind::files(const QStringList &nameFilter const QSet dirs = Utils::transform(ProjectManager::projects(), [](Project *p) { return p->projectFilePath().parentDir(); }); - return new SubDirFileIterator(FilePaths(dirs.constBegin(), dirs.constEnd()), - nameFilters, - exclusionFilters, - Core::EditorManager::defaultTextCodec()); + return SubDirFileContainer(FilePaths(dirs.constBegin(), dirs.constEnd()), nameFilters, + exclusionFilters, Core::EditorManager::defaultTextCodec()); } QString FilesInAllProjectsFind::label() const diff --git a/src/plugins/projectexplorer/filesinallprojectsfind.h b/src/plugins/projectexplorer/filesinallprojectsfind.h index 613d1d2a2a9..ad09ff031db 100644 --- a/src/plugins/projectexplorer/filesinallprojectsfind.h +++ b/src/plugins/projectexplorer/filesinallprojectsfind.h @@ -20,7 +20,7 @@ public: void readSettings(QSettings *settings) override; protected: - Utils::FileIterator *files(const QStringList &nameFilters, + Utils::FileContainer files(const QStringList &nameFilters, const QStringList &exclusionFilters, const QVariant &additionalParameters) const override; QString label() const override; diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 17bc9753810..94b43964179 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -148,11 +148,10 @@ public: QFuture executeSearch(const TextEditor::FileFindParameters ¶meters, BaseFileFind *baseFileFind) override { - return Utils::findInFiles(parameters.text, - baseFileFind->files(parameters.nameFilters, - parameters.exclusionFilters, - parameters.additionalParameters), - parameters.flags, + const FileContainer container = baseFileFind->files(parameters.nameFilters, + parameters.exclusionFilters, + parameters.additionalParameters); + return Utils::findInFiles(parameters.text, container, parameters.flags, TextDocument::openedTextDocumentContents()); } diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index 538314c42f8..b5195947493 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -18,10 +18,7 @@ class IEditor; class SearchResult; } // namespace Core -namespace Utils { -class FileIterator; -class Process; -} +namespace Utils { class Process; } namespace TextEditor { @@ -98,7 +95,7 @@ public: /* returns the list of unique files that were passed in items */ static Utils::FilePaths replaceAll(const QString &txt, const Utils::SearchResultItems &items, bool preserveCase = false); - virtual Utils::FileIterator *files(const QStringList &nameFilters, + virtual Utils::FileContainer files(const QStringList &nameFilters, const QStringList &exclusionFilters, const QVariant &additionalParameters) const = 0; diff --git a/src/plugins/texteditor/findincurrentfile.cpp b/src/plugins/texteditor/findincurrentfile.cpp index 741225d31e7..ce471c1c12d 100644 --- a/src/plugins/texteditor/findincurrentfile.cpp +++ b/src/plugins/texteditor/findincurrentfile.cpp @@ -15,6 +15,8 @@ #include +using namespace Utils; + namespace TextEditor::Internal { FindInCurrentFile::FindInCurrentFile() @@ -34,19 +36,18 @@ QString FindInCurrentFile::displayName() const return Tr::tr("Current File"); } -Utils::FileIterator *FindInCurrentFile::files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const +FileContainer FindInCurrentFile::files(const QStringList &nameFilters, + const QStringList &exclusionFilters, + const QVariant &additionalParameters) const { Q_UNUSED(nameFilters) Q_UNUSED(exclusionFilters) - const auto fileName = Utils::FilePath::fromVariant(additionalParameters); - QMap openEditorEncodings - = TextDocument::openedTextDocumentEncodings(); + const auto fileName = FilePath::fromVariant(additionalParameters); + QMap openEditorEncodings = TextDocument::openedTextDocumentEncodings(); QTextCodec *codec = openEditorEncodings.value(fileName); if (!codec) codec = Core::EditorManager::defaultTextCodec(); - return new Utils::FileListIterator({fileName}, {codec}); + return FileListContainer({fileName}, {codec}); } QVariant FindInCurrentFile::additionalParameters() const diff --git a/src/plugins/texteditor/findincurrentfile.h b/src/plugins/texteditor/findincurrentfile.h index 3a77e1d30ac..c5f07eb8b9b 100644 --- a/src/plugins/texteditor/findincurrentfile.h +++ b/src/plugins/texteditor/findincurrentfile.h @@ -29,7 +29,7 @@ public: void readSettings(QSettings *settings) override; protected: - Utils::FileIterator *files(const QStringList &nameFilters, + Utils::FileContainer files(const QStringList &nameFilters, const QStringList &exclusionFilters, const QVariant &additionalParameters) const override; QVariant additionalParameters() const override; diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index 2f379014dbb..908e53d875b 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -58,14 +58,12 @@ QString FindInFiles::displayName() const return Tr::tr("Files in File System"); } -FileIterator *FindInFiles::files(const QStringList &nameFilters, +FileContainer FindInFiles::files(const QStringList &nameFilters, const QStringList &exclusionFilters, const QVariant &additionalParameters) const { - return new SubDirFileIterator({FilePath::fromVariant(additionalParameters)}, - nameFilters, - exclusionFilters, - EditorManager::defaultTextCodec()); + return SubDirFileContainer({FilePath::fromVariant(additionalParameters)}, nameFilters, + exclusionFilters, EditorManager::defaultTextCodec()); } QVariant FindInFiles::additionalParameters() const diff --git a/src/plugins/texteditor/findinfiles.h b/src/plugins/texteditor/findinfiles.h index f9aeb92e317..c7e923b9506 100644 --- a/src/plugins/texteditor/findinfiles.h +++ b/src/plugins/texteditor/findinfiles.h @@ -44,7 +44,7 @@ signals: void pathChanged(const Utils::FilePath &directory); protected: - Utils::FileIterator *files(const QStringList &nameFilters, + Utils::FileContainer files(const QStringList &nameFilters, const QStringList &exclusionFilters, const QVariant &additionalParameters) const override; QVariant additionalParameters() const override; diff --git a/src/plugins/texteditor/findinopenfiles.cpp b/src/plugins/texteditor/findinopenfiles.cpp index 12fb45eb3c9..6bfdd1b04ec 100644 --- a/src/plugins/texteditor/findinopenfiles.cpp +++ b/src/plugins/texteditor/findinopenfiles.cpp @@ -14,6 +14,8 @@ #include +using namespace Utils; + namespace TextEditor::Internal { FindInOpenFiles::FindInOpenFiles() @@ -34,20 +36,20 @@ QString FindInOpenFiles::displayName() const return Tr::tr("Open Documents"); } -Utils::FileIterator *FindInOpenFiles::files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const +FileContainer FindInOpenFiles::files(const QStringList &nameFilters, + const QStringList &exclusionFilters, + const QVariant &additionalParameters) const { Q_UNUSED(nameFilters) Q_UNUSED(exclusionFilters) Q_UNUSED(additionalParameters) - QMap openEditorEncodings + QMap openEditorEncodings = TextDocument::openedTextDocumentEncodings(); - Utils::FilePaths fileNames; + FilePaths fileNames; QList codecs; const QList entries = Core::DocumentModel::entries(); for (Core::DocumentModel::Entry *entry : entries) { - const Utils::FilePath fileName = entry->filePath(); + const FilePath fileName = entry->filePath(); if (!fileName.isEmpty()) { fileNames.append(fileName); QTextCodec *codec = openEditorEncodings.value(fileName); @@ -57,12 +59,12 @@ Utils::FileIterator *FindInOpenFiles::files(const QStringList &nameFilters, } } - return new Utils::FileListIterator(fileNames, codecs); + return FileListContainer(fileNames, codecs); } QVariant FindInOpenFiles::additionalParameters() const { - return QVariant(); + return {}; } QString FindInOpenFiles::label() const diff --git a/src/plugins/texteditor/findinopenfiles.h b/src/plugins/texteditor/findinopenfiles.h index 244c25f5965..3431331b5b2 100644 --- a/src/plugins/texteditor/findinopenfiles.h +++ b/src/plugins/texteditor/findinopenfiles.h @@ -22,7 +22,7 @@ public: void readSettings(QSettings *settings) override; protected: - Utils::FileIterator *files(const QStringList &nameFilters, + Utils::FileContainer files(const QStringList &nameFilters, const QStringList &exclusionFilters, const QVariant &additionalParameters) const override; QVariant additionalParameters() const override; From dff9e1463bfebe803af0c696222b6eeb04857c26 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 21 Jun 2023 15:12:46 +0200 Subject: [PATCH 0056/1777] Reduce usage of app_version header Most information is available via Q(Core|Gui)Application. Add an AppInfo structure for the things that are not. This avoids that the information ends up duplicated and hardcoded in the plugins, which is not needed or desired. Change-Id: I4d565e75c42a7b8facafa90c27096ea49359215d Reviewed-by: Alessandro Portale Reviewed-by: Qt CI Bot --- src/app/CMakeLists.txt | 6 -- src/app/main.cpp | 11 +++ .../qt-breakpad/qtcrashhandler/mainwidget.cpp | 4 +- src/libs/utils/CMakeLists.txt | 1 + src/libs/utils/appinfo.cpp | 20 ++++++ src/libs/utils/appinfo.h | 29 ++++++++ src/libs/utils/utils.qbs | 3 +- src/plugins/android/android.qbs | 1 - src/plugins/android/androidpotentialkit.cpp | 6 +- .../android/androidrunconfiguration.cpp | 2 - .../android/androidsdkmanagerwidget.cpp | 7 +- .../cmakeprojectmanager/cmakebuildsystem.cpp | 2 - .../cmakekitinformation.cpp | 7 +- .../cmakeprojectmanager.qbs | 1 - .../cmaketoolsettingsaccessor.cpp | 5 +- .../cmakeprojectmanager/fileapiparser.cpp | 9 ++- src/plugins/coco/CMakeLists.txt | 1 - src/plugins/coco/coco.qbs | 2 - src/plugins/coco/cocolanguageclient.cpp | 4 +- src/plugins/coreplugin/CMakeLists.txt | 2 +- .../coreplugin/actionmanager/commandsfile.cpp | 1 - src/plugins/coreplugin/corejsextensions.cpp | 5 +- src/plugins/coreplugin/coreplugin.cpp | 67 +++++++++++-------- src/plugins/coreplugin/coreplugin.qbs | 2 - .../editormanager/editormanager.cpp | 4 +- src/plugins/coreplugin/externaltool.cpp | 2 - src/plugins/coreplugin/icore.cpp | 33 +++++---- src/plugins/coreplugin/icore.h | 2 - src/plugins/coreplugin/mainwindow.cpp | 31 +++++---- src/plugins/coreplugin/plugindialog.cpp | 2 - .../coreplugin/plugininstallwizard.cpp | 26 +++---- src/plugins/coreplugin/systemsettings.cpp | 11 ++- src/plugins/coreplugin/versiondialog.cpp | 43 ++++++------ src/plugins/coreplugin/windowsupport.cpp | 5 +- .../cppbuiltinmodelmanagersupport.cpp | 1 - .../cppeditor/cppcodemodelinspectordumper.cpp | 1 - src/plugins/cppeditor/cppeditor.qbs | 2 - src/plugins/cppeditor/cppfilesettingspage.cpp | 5 +- src/plugins/debugger/cdb/cdbengine.cpp | 23 +++---- src/plugins/debugger/debugger.qbs | 1 - src/plugins/debugger/debuggeractions.cpp | 13 ++-- src/plugins/debugger/debuggerdialogs.cpp | 24 ++++--- src/plugins/debugger/debuggerplugin.cpp | 11 ++- src/plugins/debugger/gdb/gdbengine.cpp | 17 ++--- src/plugins/debugger/logwindow.cpp | 31 ++++----- src/plugins/debugger/procinterrupt.cpp | 6 +- src/plugins/debugger/qml/qmlengine.cpp | 7 +- src/plugins/debugger/watchhandler.cpp | 3 +- .../genericprojectmanager.qbs | 1 - .../genericprojectwizard.cpp | 8 +-- src/plugins/help/help.qbs | 2 - src/plugins/help/helpplugin.cpp | 4 +- src/plugins/help/localhelpmanager.cpp | 15 +++-- src/plugins/languageclient/CMakeLists.txt | 2 +- src/plugins/languageclient/client.cpp | 8 +-- src/plugins/languageclient/languageclient.qbs | 2 - src/plugins/macros/macro.cpp | 5 +- src/plugins/macros/macros.qbs | 2 - src/plugins/mcusupport/mcusupport.qbs | 1 - .../mesonprojectmanager.qbs | 1 - .../toolssettingsaccessor.cpp | 5 +- src/plugins/perfprofiler/perfprofiler.qbs | 1 - .../perfprofiler/perfprofilertracefile.cpp | 9 ++- .../desktopprocesssignaloperation.cpp | 10 ++- src/plugins/projectexplorer/extraabi.cpp | 5 +- .../projectexplorer/projectexplorer.cpp | 8 +-- .../projectexplorer/projectexplorer.qbs | 1 - .../projectexplorerconstants.cpp | 4 +- src/plugins/projectexplorer/projectmodels.cpp | 7 +- .../projectexplorer/simpleprojectwizard.cpp | 46 ++++++------- .../projectexplorer/targetsettingspanel.cpp | 2 - src/plugins/projectexplorer/task.cpp | 6 +- .../projectexplorer/toolchainoptionspage.cpp | 13 ++-- .../toolchainsettingsaccessor.cpp | 5 +- .../projectexplorer/userfileaccessor.cpp | 4 +- .../qbsprojectmanager/qbsprojectmanager.qbs | 1 - src/plugins/qbsprojectmanager/qbssession.cpp | 4 +- src/plugins/qbsprojectmanager/qbssettings.cpp | 5 +- .../qmakeprojectmanager.qbs | 1 - .../qmldesigner/puppetenvironmentbuilder.cpp | 2 - .../qmldesignerexternaldependencies.cpp | 1 - src/plugins/qmldesigner/qmldesignerplugin.cpp | 3 +- src/plugins/qmldesigner/settingspage.cpp | 11 ++- .../qmldesignerbase/qmldesignerbase.qbs | 1 - .../qmldesignerbase/utils/qmlpuppetpaths.cpp | 4 +- src/plugins/qmlprofiler/qmlprofiler.qbs | 1 - src/plugins/qmlprofiler/qmlprofilertool.cpp | 4 +- src/plugins/qtsupport/qtoptionspage.cpp | 14 ++-- src/plugins/qtsupport/qtsupport.qbs | 1 - src/plugins/scxmleditor/common/mainwidget.cpp | 2 - .../plugin_interface/scxmldocument.cpp | 8 +-- src/plugins/scxmleditor/scxmleditor.qbs | 2 - .../studiowelcome/studiowelcomeplugin.cpp | 8 +-- src/plugins/welcome/welcome.qbs | 1 - src/plugins/welcome/welcomeplugin.cpp | 5 +- src/tools/iostool/iostool.qbs | 1 - 96 files changed, 375 insertions(+), 384 deletions(-) create mode 100644 src/libs/utils/appinfo.cpp create mode 100644 src/libs/utils/appinfo.h diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 940ae30a596..2d39c219f99 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -4,12 +4,6 @@ if(NOT IS_ABSOLUTE "${IDE_ICON_PATH}") set(IDE_ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${IDE_ICON_PATH}") endif() -install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/app_version.h - DESTINATION ${IDE_HEADER_INSTALL_PATH}/src/app - COMPONENT Devel EXCLUDE_FROM_ALL -) - add_qtc_executable(qtcreator DEFINES IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\" DEPENDS Aggregation ExtensionSystem Qt::Core Qt::Widgets Utils shared_qtsingleapplication app_version diff --git a/src/app/main.cpp b/src/app/main.cpp index 89bf5f74127..c488a2d9be6 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -653,6 +654,16 @@ int main(int argc, char **argv) PluginManager::setGlobalSettings(globalSettings); PluginManager::setSettings(settings); + using namespace Core; + Utils::AppInfo info; + info.author = Constants::IDE_AUTHOR; + info.year = Constants::IDE_YEAR; + info.displayVersion = Constants::IDE_VERSION_DISPLAY; + info.id = Constants::IDE_ID; + info.revision = Constants::IDE_REVISION_STR; + info.revisionUrl = Constants::IDE_REVISION_URL; + Utils::Internal::setAppInfo(info); + QTranslator translator; QTranslator qtTranslator; QStringList uiLanguages = QLocale::system().uiLanguages(); diff --git a/src/libs/qt-breakpad/qtcrashhandler/mainwidget.cpp b/src/libs/qt-breakpad/qtcrashhandler/mainwidget.cpp index cdf921e8f16..e70e316a9d5 100644 --- a/src/libs/qt-breakpad/qtcrashhandler/mainwidget.cpp +++ b/src/libs/qt-breakpad/qtcrashhandler/mainwidget.cpp @@ -4,7 +4,6 @@ #include "mainwidget.h" #include "ui_mainwidget.h" -#include #include #include @@ -23,7 +22,8 @@ MainWidget::MainWidget(QWidget *parent) : { ui->setupUi(this); - ui->mainWidgetTopLabel.setText(tr("%1 has crashed").arg(Core::Constants::IDE_DISPLAY_NAME)); + const QString applicationName = QApplication::arguments().at(3); + ui->mainWidgetTopLabel.setText(tr("%1 has crashed").arg(applicationName)); connect(ui->restartButton, &QAbstractButton::clicked, this, &MainWidget::restartApplication); connect(ui->quitButton, &QAbstractButton::clicked, this, &MainWidget::quitApplication); diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index a0ec62ac244..78e530a6d58 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -9,6 +9,7 @@ add_qtc_library(Utils QtConcurrentTools algorithm.h ansiescapecodehandler.cpp ansiescapecodehandler.h + appinfo.cpp appinfo.h appmainwindow.cpp appmainwindow.h archive.cpp archive.h aspects.cpp aspects.h diff --git a/src/libs/utils/appinfo.cpp b/src/libs/utils/appinfo.cpp new file mode 100644 index 00000000000..465b3a46e46 --- /dev/null +++ b/src/libs/utils/appinfo.cpp @@ -0,0 +1,20 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "appinfo.h" + +Q_GLOBAL_STATIC(Utils::AppInfo, sAppInfo) + +namespace Utils { + +Utils::AppInfo appInfo() +{ + return *sAppInfo; +} + +void Internal::setAppInfo(const AppInfo &info) +{ + *sAppInfo = info; +} + +} // namespace Utils diff --git a/src/libs/utils/appinfo.h b/src/libs/utils/appinfo.h new file mode 100644 index 00000000000..2ce926f8b57 --- /dev/null +++ b/src/libs/utils/appinfo.h @@ -0,0 +1,29 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "utils_global.h" + +#include + +namespace Utils { + +class QTCREATOR_UTILS_EXPORT AppInfo +{ +public: + QString author; + QString year; + QString displayVersion; + QString id; + QString revision; + QString revisionUrl; +}; + +QTCREATOR_UTILS_EXPORT AppInfo appInfo(); + +namespace Internal { +QTCREATOR_UTILS_EXPORT void setAppInfo(const AppInfo &info); +} // namespace Internal + +} // namespace Utils diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index d117b7057cb..d992872b468 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -36,7 +36,6 @@ Project { Depends { name: "Qt"; submodules: ["concurrent", "core-private", "network", "qml", "widgets", "xml"] } Depends { name: "Qt.macextras"; condition: Qt.core.versionMajor < 6 && qbs.targetOS.contains("macos") } Depends { name: "Tasking" } - Depends { name: "app_version_header" } Depends { name: "ptyqt" } files: [ @@ -44,6 +43,8 @@ Project { "algorithm.h", "ansiescapecodehandler.cpp", "ansiescapecodehandler.h", + "appinfo.cpp", + "appinfo.h", "appmainwindow.cpp", "appmainwindow.h", "archive.cpp", diff --git a/src/plugins/android/android.qbs b/src/plugins/android/android.qbs index c6d1611636f..b187ed428fc 100644 --- a/src/plugins/android/android.qbs +++ b/src/plugins/android/android.qbs @@ -15,7 +15,6 @@ Project { Depends { name: "QtSupport" } Depends { name: "TextEditor" } Depends { name: "Utils" } - Depends { name: "app_version_header" } files: [ "android_global.h", "androidtr.h", diff --git a/src/plugins/android/androidpotentialkit.cpp b/src/plugins/android/androidpotentialkit.cpp index 4d95f485d0e..0529df10e1e 100644 --- a/src/plugins/android/androidpotentialkit.cpp +++ b/src/plugins/android/androidpotentialkit.cpp @@ -6,8 +6,6 @@ #include "androidpotentialkit.h" #include "androidtr.h" -#include - #include #include @@ -22,10 +20,10 @@ #include #include +#include #include #include - namespace Android::Internal { class AndroidPotentialKitWidget : public Utils::DetailsWidget @@ -83,7 +81,7 @@ AndroidPotentialKitWidget::AndroidPotentialKitWidget(QWidget *parent) auto label = new QLabel; label->setText(Tr::tr("%1 needs additional settings to enable Android support." " You can configure those settings in the Options dialog.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + .arg(QGuiApplication::applicationDisplayName())); label->setWordWrap(true); layout->addWidget(label, 0, 0, 1, 2); diff --git a/src/plugins/android/androidrunconfiguration.cpp b/src/plugins/android/androidrunconfiguration.cpp index 45f991ca747..157f6f5afca 100644 --- a/src/plugins/android/androidrunconfiguration.cpp +++ b/src/plugins/android/androidrunconfiguration.cpp @@ -7,8 +7,6 @@ #include "androidtoolchain.h" #include "androidtr.h" -#include - #include #include #include diff --git a/src/plugins/android/androidsdkmanagerwidget.cpp b/src/plugins/android/androidsdkmanagerwidget.cpp index 8627e0c64ed..d228cd46024 100644 --- a/src/plugins/android/androidsdkmanagerwidget.cpp +++ b/src/plugins/android/androidsdkmanagerwidget.cpp @@ -7,8 +7,6 @@ #include "androidsdkmodel.h" #include "androidtr.h" -#include - #include #include #include @@ -18,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -282,8 +281,8 @@ void AndroidSdkManagerWidget::installEssentials() Tr::tr("Android SDK Changes"), Tr::tr("%1 cannot find the following essential packages: \"%2\".\n" "Install them manually after the current operation is done.\n") - .arg(Core::Constants::IDE_DISPLAY_NAME) - .arg(m_sdkModel->missingEssentials().join("\", \""))); + .arg(QGuiApplication::applicationDisplayName(), + m_sdkModel->missingEssentials().join("\", \""))); } onApplyButton(Tr::tr("Android SDK installation is missing necessary packages. " "Do you want to install the missing packages?")); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 6c5edc0ec90..1ab8012d410 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -40,8 +40,6 @@ #include #include -#include - #include #include #include diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 54add7395f4..d461f110c3d 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -10,8 +10,6 @@ #include "cmaketool.h" #include "cmaketoolmanager.h" -#include - #include #include @@ -41,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -739,8 +738,8 @@ Tasks CMakeGeneratorKitAspect::validate(const Kit *k) const } if (!tool->hasFileApi()) { addWarning(Tr::tr("The selected CMake binary does not support file-api. " - "%1 will not be able to parse CMake projects.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + "%1 will not be able to parse CMake projects.") + .arg(QGuiApplication::applicationDisplayName())); } } diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs index 3597a948713..a7ec2612281 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs @@ -12,7 +12,6 @@ QtcPlugin { Depends { name: "ProjectExplorer" } Depends { name: "TextEditor" } Depends { name: "QtSupport" } - Depends { name: "app_version_header" } files: [ "builddirparameters.cpp", diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp index 05969b492e2..4b7a31e248f 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp @@ -9,12 +9,11 @@ #include -#include - #include #include #include +#include using namespace Utils; @@ -132,7 +131,7 @@ mergeTools(std::vector> &sdkTools, CMakeToolSettingsAccessor::CMakeToolSettingsAccessor() { setDocType("QtCreatorCMakeTools"); - setApplicationDisplayName(Core::Constants::IDE_DISPLAY_NAME); + setApplicationDisplayName(QGuiApplication::applicationDisplayName()); setBaseFilePath(Core::ICore::userResourcePath(CMAKE_TOOL_FILENAME)); addVersionUpgrader(std::make_unique()); diff --git a/src/plugins/cmakeprojectmanager/fileapiparser.cpp b/src/plugins/cmakeprojectmanager/fileapiparser.cpp index e4dca5c9b26..c64b921edeb 100644 --- a/src/plugins/cmakeprojectmanager/fileapiparser.cpp +++ b/src/plugins/cmakeprojectmanager/fileapiparser.cpp @@ -5,13 +5,13 @@ #include "cmakeprojectmanagertr.h" -#include #include #include #include #include +#include #include #include #include @@ -42,10 +42,9 @@ static FilePath cmakeReplyDirectory(const FilePath &buildDirectory) static void reportFileApiSetupFailure() { - Core::MessageManager::writeFlashing( - Tr::tr("Failed to set up CMake file API support. %1 cannot " - "extract project information.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + Core::MessageManager::writeFlashing(Tr::tr("Failed to set up CMake file API support. %1 cannot " + "extract project information.") + .arg(QGuiApplication::applicationDisplayName())); } static std::pair cmakeVersion(const QJsonObject &obj) diff --git a/src/plugins/coco/CMakeLists.txt b/src/plugins/coco/CMakeLists.txt index 43f4fd7c4a3..20e5132fffb 100644 --- a/src/plugins/coco/CMakeLists.txt +++ b/src/plugins/coco/CMakeLists.txt @@ -1,5 +1,4 @@ add_qtc_plugin(Coco - PUBLIC_DEPENDS app_version PLUGIN_DEPENDS Core LanguageClient SOURCES cocolanguageclient.cpp cocolanguageclient.h diff --git a/src/plugins/coco/coco.qbs b/src/plugins/coco/coco.qbs index 3a771f27175..70a072c3196 100644 --- a/src/plugins/coco/coco.qbs +++ b/src/plugins/coco/coco.qbs @@ -7,8 +7,6 @@ QtcPlugin { Depends { name: "LanguageClient" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } - Depends { name: "Qt"; submodules: ["widgets"] } files: [ diff --git a/src/plugins/coco/cocolanguageclient.cpp b/src/plugins/coco/cocolanguageclient.cpp index 56f3d20ee2c..83089cb751b 100644 --- a/src/plugins/coco/cocolanguageclient.cpp +++ b/src/plugins/coco/cocolanguageclient.cpp @@ -3,7 +3,6 @@ #include "cocolanguageclient.h" -#include #include #include #include @@ -17,6 +16,7 @@ #include #include +#include #include using namespace LanguageClient; @@ -52,7 +52,7 @@ CocoLanguageClient::CocoLanguageClient(const FilePath &coco, const FilePath &csm ClientInfo info; info.setName("CocoQtCreator"); - info.setVersion(Core::Constants::IDE_VERSION_DISPLAY); + info.setVersion(QGuiApplication::applicationDisplayName()); setClientInfo(info); initClientCapabilities(); diff --git a/src/plugins/coreplugin/CMakeLists.txt b/src/plugins/coreplugin/CMakeLists.txt index b262d0d7683..36c13206eed 100644 --- a/src/plugins/coreplugin/CMakeLists.txt +++ b/src/plugins/coreplugin/CMakeLists.txt @@ -5,7 +5,7 @@ configure_file(core_logo.qrc.cmakein core_logo_cmake.qrc) add_qtc_plugin(Core DEPENDS Qt::PrintSupport Qt::Qml Qt::Sql Qt::Gui Qt::GuiPrivate - PUBLIC_DEPENDS Aggregation ExtensionSystem Utils app_version + PUBLIC_DEPENDS Aggregation ExtensionSystem Utils SOURCES ${CMAKE_CURRENT_BINARY_DIR}/core_logo_cmake.qrc actionmanager/actioncontainer.cpp diff --git a/src/plugins/coreplugin/actionmanager/commandsfile.cpp b/src/plugins/coreplugin/actionmanager/commandsfile.cpp index 7b69e3da916..f4abce0eaa8 100644 --- a/src/plugins/coreplugin/actionmanager/commandsfile.cpp +++ b/src/plugins/coreplugin/actionmanager/commandsfile.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include diff --git a/src/plugins/coreplugin/corejsextensions.cpp b/src/plugins/coreplugin/corejsextensions.cpp index 52438f2d4af..cbbb71246ea 100644 --- a/src/plugins/coreplugin/corejsextensions.cpp +++ b/src/plugins/coreplugin/corejsextensions.cpp @@ -3,8 +3,7 @@ #include "corejsextensions.h" -#include - +#include #include #include #include @@ -27,7 +26,7 @@ QString UtilsJsExtension::qtVersion() const QString UtilsJsExtension::qtCreatorVersion() const { - return QLatin1String(Constants::IDE_VERSION_DISPLAY); + return appInfo().displayVersion; } QString UtilsJsExtension::toNativeSeparators(const QString &in) const diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 2d825dd3ae5..2e07d1c4cd1 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -43,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -191,18 +191,25 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) expander->registerVariable("Config:LastFileDialogDirectory", Tr::tr("The directory last visited in a file dialog."), [] { return DocumentManager::fileDialogLastVisitedDirectory().toString(); }); expander->registerVariable("HostOs:isWindows", - Tr::tr("Is %1 running on Windows?").arg(Constants::IDE_DISPLAY_NAME), - [] { return QVariant(Utils::HostOsInfo::isWindowsHost()).toString(); }); + Tr::tr("Is %1 running on Windows?") + .arg(QGuiApplication::applicationDisplayName()), + [] { + return QVariant(Utils::HostOsInfo::isWindowsHost()).toString(); + }); expander->registerVariable("HostOs:isOSX", - Tr::tr("Is %1 running on OS X?").arg(Constants::IDE_DISPLAY_NAME), + Tr::tr("Is %1 running on OS X?") + .arg(QGuiApplication::applicationDisplayName()), [] { return QVariant(Utils::HostOsInfo::isMacHost()).toString(); }); expander->registerVariable("HostOs:isLinux", - Tr::tr("Is %1 running on Linux?").arg(Constants::IDE_DISPLAY_NAME), + Tr::tr("Is %1 running on Linux?") + .arg(QGuiApplication::applicationDisplayName()), [] { return QVariant(Utils::HostOsInfo::isLinuxHost()).toString(); }); expander->registerVariable("HostOs:isUnix", Tr::tr("Is %1 running on any unix-based platform?") - .arg(Constants::IDE_DISPLAY_NAME), - [] { return QVariant(Utils::HostOsInfo::isAnyUnixHost()).toString(); }); + .arg(QGuiApplication::applicationDisplayName()), + [] { + return QVariant(Utils::HostOsInfo::isAnyUnixHost()).toString(); + }); expander->registerVariable("HostOs:PathListSeparator", Tr::tr("The path list separator for the platform."), [] { return QString(Utils::HostOsInfo::pathListSeparator()); }); @@ -211,7 +218,7 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) [] { return QString(Utils::HostOsInfo::withExecutableSuffix("")); }); expander->registerVariable("IDE:ResourcePath", Tr::tr("The directory where %1 finds its pre-installed resources.") - .arg(Constants::IDE_DISPLAY_NAME), + .arg(QGuiApplication::applicationDisplayName()), [] { return ICore::resourcePath().toString(); }); expander->registerPrefix("CurrentDate:", Tr::tr("The current date (QDate formatstring)."), [](const QString &fmt) { return QDate::currentDate().toString(fmt); }); @@ -396,9 +403,9 @@ void CorePlugin::checkSettings() const QFileInfo fi(userSettings->fileName()); if (fi.exists() && !fi.isWritable()) { const QString errorMsg = Tr::tr("The settings file \"%1\" is not writable.\n" - "You will not be able to store any %2 settings.") - .arg(QDir::toNativeSeparators(userSettings->fileName()), - QLatin1String(Core::Constants::IDE_DISPLAY_NAME)); + "You will not be able to store any %2 settings.") + .arg(QDir::toNativeSeparators(userSettings->fileName()), + QGuiApplication::applicationDisplayName()); showMsgBox(errorMsg, QMessageBox::Warning); } return; @@ -410,10 +417,12 @@ void CorePlugin::checkSettings() errorDetails = Tr::tr("The file is invalid."); break; } - const QString errorMsg = Tr::tr("Error reading settings file \"%1\": %2\n" - "You will likely experience further problems using this instance of %3.") - .arg(QDir::toNativeSeparators(userSettings->fileName()), errorDetails, - QLatin1String(Core::Constants::IDE_DISPLAY_NAME)); + const QString errorMsg + = Tr::tr("Error reading settings file \"%1\": %2\n" + "You will likely experience further problems using this instance of %3.") + .arg(QDir::toNativeSeparators(userSettings->fileName()), + errorDetails, + QGuiApplication::applicationDisplayName()); showMsgBox(errorMsg, QMessageBox::Critical); } @@ -429,10 +438,11 @@ void CorePlugin::warnAboutCrashReporing() "To enable this feature go to %2."); if (Utils::HostOsInfo::isMacHost()) { - warnStr = warnStr.arg(QLatin1String(Core::Constants::IDE_DISPLAY_NAME), - Core::Constants::IDE_DISPLAY_NAME + Tr::tr(" > Preferences > Environment > System")); + warnStr = warnStr.arg(QGuiApplication::applicationDisplayName(), + QGuiApplication::applicationDisplayName() + + Tr::tr(" > Preferences > Environment > System")); } else { - warnStr = warnStr.arg(QLatin1String(Core::Constants::IDE_DISPLAY_NAME), + warnStr = warnStr.arg(QGuiApplication::applicationDisplayName(), Tr::tr("Edit > Preferences > Environment > System")); } @@ -459,15 +469,18 @@ void CorePlugin::warnAboutCrashReporing() QString CorePlugin::msgCrashpadInformation() { return Tr::tr("%1 uses Google Crashpad for collecting crashes and sending them to our backend " - "for processing. Crashpad may capture arbitrary contents from crashed process’ " - "memory, including user sensitive information, URLs, and whatever other content " - "users have trusted %1 with. The collected crash reports are however only used " - "for the sole purpose of fixing bugs.").arg(Core::Constants::IDE_DISPLAY_NAME) - + "

" + Tr::tr("More information:") - + "
" + Tr::tr("Crashpad Overview") + "" - "
" + Tr::tr("%1 security policy").arg("Sentry.io") - + ""; + "for processing. Crashpad may capture arbitrary contents from crashed process’ " + "memory, including user sensitive information, URLs, and whatever other content " + "users have trusted %1 with. The collected crash reports are however only used " + "for the sole purpose of fixing bugs.") + .arg(QGuiApplication::applicationDisplayName()) + + "

" + Tr::tr("More information:") + + "
" + + Tr::tr("Crashpad Overview") + + "" + "
" + + Tr::tr("%1 security policy").arg("Sentry.io") + ""; } ExtensionSystem::IPlugin::ShutdownFlag CorePlugin::aboutToShutdown() diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index 096076877f3..61d1b21a90c 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -19,8 +19,6 @@ Project { Depends { name: "Utils" } Depends { name: "Aggregation" } - Depends { name: "app_version_header" } - cpp.dynamicLibraries: { if (qbs.targetOS.contains("windows")) return ["ole32", "user32"] diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index e617e98d1c7..09c7f4aa79a 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -35,8 +35,6 @@ #include "../settingsdatabase.h" #include "../vcsmanager.h" -#include - #include #include @@ -2161,7 +2159,7 @@ void EditorManagerPrivate::updateWindowTitleForDocument(IDocument *document, QWi if (!windowTitle.isEmpty()) windowTitle.append(dashSep); - windowTitle.append(Core::Constants::IDE_DISPLAY_NAME); + windowTitle.append(QGuiApplication::applicationDisplayName()); window->window()->setWindowTitle(windowTitle); window->window()->setWindowFilePath(filePath.path()); diff --git a/src/plugins/coreplugin/externaltool.cpp b/src/plugins/coreplugin/externaltool.cpp index 6cafa6ff887..c65cfe80882 100644 --- a/src/plugins/coreplugin/externaltool.cpp +++ b/src/plugins/coreplugin/externaltool.cpp @@ -11,8 +11,6 @@ #include "documentmanager.h" #include "editormanager/editormanager.h" -#include - #include #include #include diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 59224d48a5c..8716e21858f 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -7,11 +7,10 @@ #include "dialogs/settingsdialog.h" #include "windowsupport.h" -#include - #include #include +#include #include #include #include @@ -440,7 +439,7 @@ FilePath ICore::userResourcePath(const QString &rel) { // Create qtcreator dir if it doesn't yet exist const QString configDir = QFileInfo(settings(QSettings::UserScope)->fileName()).path(); - const QString urp = configDir + '/' + QLatin1String(Constants::IDE_ID); + const QString urp = configDir + '/' + appInfo().id; if (!QFileInfo::exists(urp + QLatin1Char('/'))) { QDir dir; @@ -467,7 +466,7 @@ FilePath ICore::cacheResourcePath(const QString &rel) FilePath ICore::installerResourcePath(const QString &rel) { return FilePath::fromString(settings(QSettings::SystemScope)->fileName()).parentDir() - / Constants::IDE_ID / rel; + / appInfo().id / rel; } /*! @@ -487,15 +486,18 @@ QString ICore::pluginPath() */ QString ICore::userPluginPath() { + const QVersionNumber appVersion = QVersionNumber::fromString( + QCoreApplication::applicationVersion()); QString pluginPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); if (Utils::HostOsInfo::isAnyUnixHost() && !Utils::HostOsInfo::isMacHost()) pluginPath += "/data"; - pluginPath += '/' + QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR) + '/'; - pluginPath += QLatin1String(Utils::HostOsInfo::isMacHost() ? Core::Constants::IDE_DISPLAY_NAME - : Core::Constants::IDE_ID); + pluginPath += '/' + QCoreApplication::organizationName() + '/'; + pluginPath += Utils::HostOsInfo::isMacHost() ? QGuiApplication::applicationDisplayName() + : appInfo().id; pluginPath += "/plugins/"; - pluginPath += QString::number(IDE_VERSION_MAJOR) + '.' + QString::number(IDE_VERSION_MINOR) - + '.' + QString::number(IDE_VERSION_RELEASE); + pluginPath += QString::number(appVersion.majorVersion()) + '.' + + QString::number(appVersion.minorVersion()) + '.' + + QString::number(appVersion.microVersion()); return pluginPath; } @@ -518,11 +520,6 @@ FilePath ICore::crashReportsPath() return libexecPath("crashpad_reports/reports"); } -QString ICore::ideDisplayName() -{ - return Constants::IDE_DISPLAY_NAME; -} - static QString clangIncludePath(const QString &clangVersion) { return "/lib/clang/" + clangVersion + "/include"; @@ -619,10 +616,10 @@ static QString compilerString() QString ICore::versionString() { QString ideVersionDescription; - if (QLatin1String(Constants::IDE_VERSION_LONG) != QLatin1String(Constants::IDE_VERSION_DISPLAY)) - ideVersionDescription = Tr::tr(" (%1)").arg(QLatin1String(Constants::IDE_VERSION_LONG)); - return Tr::tr("%1 %2%3").arg(QLatin1String(Constants::IDE_DISPLAY_NAME), - QLatin1String(Constants::IDE_VERSION_DISPLAY), + if (QCoreApplication::applicationVersion() != appInfo().displayVersion) + ideVersionDescription = Tr::tr(" (%1)").arg(QCoreApplication::applicationVersion()); + return Tr::tr("%1 %2%3").arg(QGuiApplication::applicationDisplayName(), + appInfo().displayVersion, ideVersionDescription); } diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index 1ecf6068536..0939356d4de 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -80,8 +80,6 @@ public: static Utils::FilePath libexecPath(const QString &rel = {}); static Utils::FilePath crashReportsPath(); - static QString ideDisplayName(); - static QString versionString(); static QMainWindow *mainWindow(); diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 846b5d9dea2..807070b383e 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -47,8 +47,6 @@ #include "versiondialog.h" #include "windowsupport.h" -#include - #include #include @@ -126,7 +124,7 @@ MainWindow::MainWindow() , m_lowPrioAdditionalContexts(Constants::C_GLOBAL) , m_settingsDatabase( new SettingsDatabase(QFileInfo(PluginManager::settings()->fileName()).path(), - QLatin1String(Constants::IDE_CASED_ID), + QCoreApplication::applicationName(), this)) , m_progressManager(new ProgressManagerPrivate) , m_jsExpander(JsExpander::createGlobalJsExpander()) @@ -145,7 +143,7 @@ MainWindow::MainWindow() HistoryCompleter::setSettings(PluginManager::settings()); - setWindowTitle(Constants::IDE_DISPLAY_NAME); + setWindowTitle(QGuiApplication::applicationDisplayName()); if (HostOsInfo::isLinuxHost()) QApplication::setWindowIcon(Icons::QTCREATORLOGO_BIG.icon()); QString baseName = QApplication::style()->objectName(); @@ -384,13 +382,13 @@ void MainWindow::closeEvent(QCloseEvent *event) return; } - if (m_askConfirmationBeforeExit && - (QMessageBox::question(this, - Tr::tr("Exit %1?").arg(Constants::IDE_DISPLAY_NAME), - Tr::tr("Exit %1?").arg(Constants::IDE_DISPLAY_NAME), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::No) - == QMessageBox::No)) { + if (m_askConfirmationBeforeExit + && (QMessageBox::question(this, + Tr::tr("Exit %1?").arg(QGuiApplication::applicationDisplayName()), + Tr::tr("Exit %1?").arg(QGuiApplication::applicationDisplayName()), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::No) + == QMessageBox::No)) { event->ignore(); return; } @@ -762,7 +760,7 @@ void MainWindow::registerDefaultActions() // Debug Qt Creator menu mtools->appendGroup(Constants::G_TOOLS_DEBUG); ActionContainer *mtoolsdebug = ActionManager::createMenu(Constants::M_TOOLS_DEBUG); - mtoolsdebug->menu()->setTitle(Tr::tr("Debug %1").arg(Constants::IDE_DISPLAY_NAME)); + mtoolsdebug->menu()->setTitle(Tr::tr("Debug %1").arg(QGuiApplication::applicationDisplayName())); mtools->addMenu(mtoolsdebug, Constants::G_TOOLS_DEBUG); m_loggerAction = new QAction(Tr::tr("Show Logs..."), this); @@ -867,9 +865,14 @@ void MainWindow::registerDefaultActions() // About IDE Action icon = QIcon::fromTheme(QLatin1String("help-about")); if (HostOsInfo::isMacHost()) - tmpaction = new QAction(icon, Tr::tr("About &%1").arg(Constants::IDE_DISPLAY_NAME), this); // it's convention not to add dots to the about menu + tmpaction = new QAction(icon, + Tr::tr("About &%1").arg(QGuiApplication::applicationDisplayName()), + this); // it's convention not to add dots to the about menu else - tmpaction = new QAction(icon, Tr::tr("About &%1...").arg(Constants::IDE_DISPLAY_NAME), this); + tmpaction + = new QAction(icon, + Tr::tr("About &%1...").arg(QGuiApplication::applicationDisplayName()), + this); tmpaction->setMenuRole(QAction::AboutRole); cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_QTCREATOR); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); diff --git a/src/plugins/coreplugin/plugindialog.cpp b/src/plugins/coreplugin/plugindialog.cpp index 24d8c8dff12..c7f7dab2311 100644 --- a/src/plugins/coreplugin/plugindialog.cpp +++ b/src/plugins/coreplugin/plugindialog.cpp @@ -8,8 +8,6 @@ #include "icore.h" #include "plugininstallwizard.h" -#include - #include #include #include diff --git a/src/plugins/coreplugin/plugininstallwizard.cpp b/src/plugins/coreplugin/plugininstallwizard.cpp index 11bad10ca44..9aa067a45ca 100644 --- a/src/plugins/coreplugin/plugininstallwizard.cpp +++ b/src/plugins/coreplugin/plugininstallwizard.cpp @@ -23,11 +23,10 @@ #include #include -#include - #include #include #include +#include #include #include #include @@ -164,14 +163,16 @@ void checkContents(QPromise &promise, const FilePath &tempDir) return; if (coreplugin->provides(found->name, found->version)) return; - promise.addResult(ArchiveIssue{ - Tr::tr("Plugin requires an incompatible version of %1 (%2).") - .arg(Constants::IDE_DISPLAY_NAME).arg(found->version), InfoLabel::Error}); + promise.addResult( + ArchiveIssue{Tr::tr("Plugin requires an incompatible version of %1 (%2).") + .arg(QGuiApplication::applicationDisplayName(), found->version), + InfoLabel::Error}); return; // successful / no error } } - promise.addResult(ArchiveIssue{Tr::tr("Did not find %1 plugin.") - .arg(Constants::IDE_DISPLAY_NAME), InfoLabel::Error}); + promise.addResult( + ArchiveIssue{Tr::tr("Did not find %1 plugin.").arg(QGuiApplication::applicationDisplayName()), + InfoLabel::Error}); } class CheckArchivePage : public WizardPage @@ -306,17 +307,16 @@ public: localInstall->setChecked(!m_data->installIntoApplication); auto localLabel = new QLabel(Tr::tr("The plugin will be available to all compatible %1 " "installations, but only for the current user.") - .arg(Constants::IDE_DISPLAY_NAME)); + .arg(QGuiApplication::applicationDisplayName())); localLabel->setWordWrap(true); localLabel->setAttribute(Qt::WA_MacSmallSize, true); auto appInstall = new QRadioButton( - Tr::tr("%1 installation").arg(Constants::IDE_DISPLAY_NAME)); + Tr::tr("%1 installation").arg(QGuiApplication::applicationDisplayName())); appInstall->setChecked(m_data->installIntoApplication); - auto appLabel = new QLabel( - Tr::tr("The plugin will be available only to this %1 " - "installation, but for all users that can access it.") - .arg(Constants::IDE_DISPLAY_NAME)); + auto appLabel = new QLabel(Tr::tr("The plugin will be available only to this %1 " + "installation, but for all users that can access it.") + .arg(QGuiApplication::applicationDisplayName())); appLabel->setWordWrap(true); appLabel->setAttribute(Qt::WA_MacSmallSize, true); diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index f6641bad08f..af34c668cf1 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -15,8 +15,6 @@ #include "patchtool.h" #include "vcsmanager.h" -#include - #include #include #include @@ -31,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -214,10 +213,10 @@ public: m_patchChooser->setFilePath(PatchTool::patchCommand()); m_autoSaveCheckBox->setChecked(EditorManagerPrivate::autoSaveEnabled()); m_autoSaveCheckBox->setToolTip(Tr::tr("Automatically creates temporary copies of " - "modified files. If %1 is restarted after " - "a crash or power failure, it asks whether to " - "recover the auto-saved content.") - .arg(Constants::IDE_DISPLAY_NAME)); + "modified files. If %1 is restarted after " + "a crash or power failure, it asks whether to " + "recover the auto-saved content.") + .arg(QGuiApplication::applicationDisplayName())); m_autoSaveRefactoringCheckBox->setChecked(EditorManager::autoSaveAfterRefactoring()); m_autoSaveRefactoringCheckBox->setToolTip( Tr::tr("Automatically saves all open files " diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp index 2846be849af..8c0e70186da 100644 --- a/src/plugins/coreplugin/versiondialog.cpp +++ b/src/plugins/coreplugin/versiondialog.cpp @@ -8,15 +8,15 @@ #include "coreicons.h" #include "icore.h" -#include - #include +#include #include #include #include #include #include +#include #include #include #include @@ -32,17 +32,18 @@ VersionDialog::VersionDialog(QWidget *parent) if (Utils::HostOsInfo::isLinuxHost()) setWindowIcon(Icons::QTCREATORLOGO_BIG.icon()); - setWindowTitle(Tr::tr("About %1").arg(Core::Constants::IDE_DISPLAY_NAME)); + setWindowTitle(Tr::tr("About %1").arg(QGuiApplication::applicationDisplayName())); auto layout = new QGridLayout(this); layout->setSizeConstraint(QLayout::SetFixedSize); + const Utils::AppInfo appInfo = Utils::appInfo(); QString ideRev; #ifdef IDE_REVISION - const QString revUrl = QString::fromLatin1(Constants::IDE_REVISION_URL); - const QString rev = QString::fromLatin1(Constants::IDE_REVISION_STR); ideRev = Tr::tr("
From revision %1
") - .arg(revUrl.isEmpty() ? rev - : QString::fromLatin1("%2").arg(revUrl, rev)); + .arg(appInfo.revisionUrl.isEmpty() + ? appInfo.revision + : QString::fromLatin1("%2") + .arg(appInfo.revisionUrl, appInfo.revision)); #endif QString buildDateInfo; #ifdef QTC_SHOW_BUILD_DATE @@ -56,27 +57,27 @@ VersionDialog::VersionDialog(QWidget *parent) const QString description = Tr::tr("

%1

" - "%2
" - "%3" - "%4" - "%5" - "
" - "Copyright 2008-%6 %7. All rights reserved.
" - "
" - "The program is provided AS IS with NO WARRANTY OF ANY KIND, " - "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " - "PARTICULAR PURPOSE.
") + "%2
" + "%3" + "%4" + "%5" + "
" + "Copyright 2008-%6 %7. All rights reserved.
" + "
" + "The program is provided AS IS with NO WARRANTY OF ANY KIND, " + "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " + "PARTICULAR PURPOSE.
") .arg(ICore::versionString(), ICore::buildCompatibilityString(), buildDateInfo, ideRev, additionalInfo.isEmpty() ? QString() : br + additionalInfo + br, - QLatin1String(Constants::IDE_YEAR), - QLatin1String(Constants::IDE_AUTHOR)) + appInfo.year, + appInfo.author) + "
" + Tr::tr("The Qt logo as well as Qt®, Qt Quick®, Built with Qt®, Boot to Qt®, " - "Qt Quick Compiler®, Qt Enterprise®, Qt Mobile® and Qt Embedded® are " - "registered trademarks of The Qt Company Ltd."); + "Qt Quick Compiler®, Qt Enterprise®, Qt Mobile® and Qt Embedded® are " + "registered trademarks of The Qt Company Ltd."); QLabel *copyRightLabel = new QLabel(description); copyRightLabel->setWordWrap(true); diff --git a/src/plugins/coreplugin/windowsupport.cpp b/src/plugins/coreplugin/windowsupport.cpp index 220df7fe5bc..4cbfb57d038 100644 --- a/src/plugins/coreplugin/windowsupport.cpp +++ b/src/plugins/coreplugin/windowsupport.cpp @@ -10,14 +10,13 @@ #include "coreplugintr.h" #include "icore.h" -#include - #include #include #include #include #include +#include #include #include #include @@ -188,7 +187,7 @@ void WindowList::updateTitle(QWidget *window) QTC_ASSERT(index >= 0, return); QTC_ASSERT(index < m_windowActions.size(), return); QString title = window->windowTitle(); - if (title.endsWith(QStringLiteral("- ") + Constants::IDE_DISPLAY_NAME)) + if (title.endsWith(QStringLiteral("- ") + QGuiApplication::applicationDisplayName())) title.chop(12); m_windowActions.at(index)->setText(Utils::quoteAmpersands(title.trimmed())); } diff --git a/src/plugins/cppeditor/cppbuiltinmodelmanagersupport.cpp b/src/plugins/cppeditor/cppbuiltinmodelmanagersupport.cpp index efcbd51569d..4cc69fe4392 100644 --- a/src/plugins/cppeditor/cppbuiltinmodelmanagersupport.cpp +++ b/src/plugins/cppeditor/cppbuiltinmodelmanagersupport.cpp @@ -13,7 +13,6 @@ #include "cpptoolsreuse.h" #include "symbolfinder.h" -#include #include #include #include diff --git a/src/plugins/cppeditor/cppcodemodelinspectordumper.cpp b/src/plugins/cppeditor/cppcodemodelinspectordumper.cpp index 2a6dfb6e1e8..e2c879b1835 100644 --- a/src/plugins/cppeditor/cppcodemodelinspectordumper.cpp +++ b/src/plugins/cppeditor/cppcodemodelinspectordumper.cpp @@ -8,7 +8,6 @@ #include "cpptoolsreuse.h" #include "cppworkingcopy.h" -#include #include #include #include diff --git a/src/plugins/cppeditor/cppeditor.qbs b/src/plugins/cppeditor/cppeditor.qbs index b7d2aea0314..4e36279580a 100644 --- a/src/plugins/cppeditor/cppeditor.qbs +++ b/src/plugins/cppeditor/cppeditor.qbs @@ -13,8 +13,6 @@ QtcPlugin { Depends { name: "TextEditor" } Depends { name: "ProjectExplorer" } - Depends { name: "app_version_header" } - pluginTestDepends: [ "QmakeProjectManager", "QbsProjectManager", diff --git a/src/plugins/cppeditor/cppfilesettingspage.cpp b/src/plugins/cppeditor/cppfilesettingspage.cpp index 21411577d35..6b9bad8c9c9 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.cpp +++ b/src/plugins/cppeditor/cppfilesettingspage.cpp @@ -6,7 +6,6 @@ #include "cppeditorplugin.h" #include "cppeditortr.h" -#include #include #include #include @@ -20,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -435,7 +435,8 @@ void CppFileSettingsWidget::slotEdit() if (path.isEmpty()) return; FileSaver saver(path, QIODevice::Text); - saver.write(Tr::tr(licenseTemplateTemplate).arg(Core::Constants::IDE_DISPLAY_NAME).toUtf8()); + saver.write( + Tr::tr(licenseTemplateTemplate).arg(QGuiApplication::applicationDisplayName()).toUtf8()); if (!saver.finalize(this)) return; setLicenseTemplatePath(path); diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index bb750f4753f..b049d76f973 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -7,8 +7,6 @@ #include "cdbparsehelpers.h" #include "stringinputstream.h" -#include - #include #include #include @@ -56,6 +54,7 @@ #include #include +#include #include #include @@ -333,16 +332,16 @@ void CdbEngine::setupEngine() const QFileInfo extensionFi(CdbEngine::extensionLibraryName(cdbIs64Bit, cdbIsArm)); if (!extensionFi.isFile()) { handleSetupFailure(Tr::tr("Internal error: The extension %1 cannot be found.\n" - "If you have updated %2 via Maintenance Tool, you may " - "need to rerun the Tool and select \"Add or remove components\" " - "and then select the " - "Qt > Tools > Qt Creator CDB Debugger Support component.\n" - "If you build %2 from sources and want to use a CDB executable " - "with another bitness than your %2 build, " - "you will need to build a separate CDB extension with the " - "same bitness as the CDB you want to use."). - arg(QDir::toNativeSeparators(extensionFi.absoluteFilePath()), - QString(Core::Constants::IDE_DISPLAY_NAME))); + "If you have updated %2 via Maintenance Tool, you may " + "need to rerun the Tool and select \"Add or remove components\" " + "and then select the " + "Qt > Tools > Qt Creator CDB Debugger Support component.\n" + "If you build %2 from sources and want to use a CDB executable " + "with another bitness than your %2 build, " + "you will need to build a separate CDB extension with the " + "same bitness as the CDB you want to use.") + .arg(QDir::toNativeSeparators(extensionFi.absoluteFilePath()), + QGuiApplication::applicationDisplayName())); return; } diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 1cc48186b64..1d6bb5022ed 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -17,7 +17,6 @@ Project { Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } pluginTestDepends: [ "QmakeProjectManager" diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index afa7dd14598..f83c6935818 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -12,8 +12,6 @@ #include "registerpostmortemaction.h" #endif -#include - #include #include @@ -21,6 +19,7 @@ #include #include +#include using namespace Utils; @@ -267,7 +266,7 @@ DebuggerSettings::DebuggerSettings() raiseOnInterrupt.setSettingsKey(debugModeGroup, "RaiseOnInterrupt"); raiseOnInterrupt.setDefaultValue(true); raiseOnInterrupt.setLabelText(Tr::tr("Bring %1 to foreground when application interrupts") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + .arg(QGuiApplication::applicationDisplayName())); autoQuit.setSettingsKey(debugModeGroup, "AutoQuit"); autoQuit.setLabelText(Tr::tr("Automatically Quit Debugger")); @@ -318,12 +317,10 @@ DebuggerSettings::DebuggerSettings() #ifdef Q_OS_WIN registerForPostMortem = new RegisterPostMortemAction; registerForPostMortem->setSettingsKey(debugModeGroup, "RegisterForPostMortem"); - registerForPostMortem->setToolTip( - Tr::tr("Registers %1 for debugging crashed applications.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + registerForPostMortem->setToolTip(Tr::tr("Registers %1 for debugging crashed applications.") + .arg(QGuiApplication::applicationDisplayName())); registerForPostMortem->setLabelText( - Tr::tr("Use %1 for post-mortem debugging") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + Tr::tr("Use %1 for post-mortem debugging").arg(QGuiApplication::applicationDisplayName())); #else // Some dummy. registerForPostMortem = new BoolAspect; diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index c382e91c175..9ddd7fa6f73 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -7,8 +7,6 @@ #include "debuggerruncontrol.h" #include "debuggertr.h" -#include - #include #include @@ -30,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -563,15 +562,18 @@ static QString cdbRemoteHelp() const QString ext32 = QDir::toNativeSeparators(CdbEngine::extensionLibraryName(false)); const QString ext64 = QDir::toNativeSeparators(CdbEngine::extensionLibraryName(true)); - return Tr::tr( - "

The remote CDB needs to load the matching %1 CDB extension " - "(%2 or %3, respectively).

Copy it onto the remote machine and set the " - "environment variable %4 to point to its folder.

" - "Launch the remote CDB as %5 <executable> " - "to use TCP/IP as communication protocol.

Enter the connection parameters as:

" - "
%6
") - .arg(QString(Core::Constants::IDE_DISPLAY_NAME), - ext32, ext64, QString("_NT_DEBUGGER_EXTENSION_PATH"), + return Tr:: + tr("

The remote CDB needs to load the matching %1 CDB extension " + "(%2 or %3, respectively).

Copy it onto the remote " + "machine and set the " + "environment variable %4 to point to its folder.

" + "Launch the remote CDB as %5 <executable> " + "to use TCP/IP as communication protocol.

Enter the connection parameters as:

" + "
%6
") + .arg(QGuiApplication::applicationDisplayName(), + ext32, + ext64, + QString("_NT_DEBUGGER_EXTENSION_PATH"), QString("cdb.exe -server tcp:port=1234"), QString(cdbConnectionSyntax)); } diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 4aa0f1b33c6..14dfbdfac3c 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -31,8 +31,6 @@ #include "analyzer/analyzerconstants.h" #include "analyzer/analyzermanager.h" -#include - #include #include #include @@ -1671,10 +1669,11 @@ RunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit, const bool isWindows = (tcAbi.os() == Abi::WindowsOS); if (isWindows && isWinProcessBeingDebugged(processInfo.processId)) { AsynchronousMessageBox::warning( - Tr::tr("Process Already Under Debugger Control"), - Tr::tr("The process %1 is already under the control of a debugger.\n" - "%2 cannot attach to it.").arg(processInfo.processId) - .arg(Core::Constants::IDE_DISPLAY_NAME)); + Tr::tr("Process Already Under Debugger Control"), + Tr::tr("The process %1 is already under the control of a debugger.\n" + "%2 cannot attach to it.") + .arg(processInfo.processId) + .arg(QGuiApplication::applicationDisplayName())); return nullptr; } diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index d52e2bc7104..910372f1937 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -34,7 +34,6 @@ #include #include -#include #include #include #include @@ -45,11 +44,12 @@ #include #include +#include +#include #include #include #include #include -#include using namespace Core; using namespace ProjectExplorer; @@ -1499,11 +1499,12 @@ void GdbEngine::handlePythonSetup(const DebuggerResponse &response) int pythonMajor = m_pythonVersion / 10000; int pythonMinor = (m_pythonVersion / 100) % 100; QString out = "

" - + Tr::tr("The selected build of GDB supports Python scripting, " - "but the used version %1.%2 is not sufficient for " - "%3. Supported versions are Python 2.7 and 3.x.") - .arg(pythonMajor).arg(pythonMinor) - .arg(Core::Constants::IDE_DISPLAY_NAME); + + Tr::tr("The selected build of GDB supports Python scripting, " + "but the used version %1.%2 is not sufficient for " + "%3. Supported versions are Python 2.7 and 3.x.") + .arg(pythonMajor) + .arg(pythonMinor) + .arg(QGuiApplication::applicationDisplayName()); showStatusMessage(out); AsynchronousMessageBox::critical(Tr::tr("Execution Error"), out); } @@ -1516,7 +1517,7 @@ void GdbEngine::handlePythonSetup(const DebuggerResponse &response) if (msg.contains("Python scripting is not supported in this copy of GDB.")) { QString out1 = "The selected build of GDB does not support Python scripting."; QString out2 = QStringLiteral("It cannot be used in %1.") - .arg(Core::Constants::IDE_DISPLAY_NAME); + .arg(QGuiApplication::applicationDisplayName()); showStatusMessage(out1 + ' ' + out2); AsynchronousMessageBox::critical(Tr::tr("Execution Error"), out1 + "
" + out2); } diff --git a/src/plugins/debugger/logwindow.cpp b/src/plugins/debugger/logwindow.cpp index a8b519aad05..3ff32f9df52 100644 --- a/src/plugins/debugger/logwindow.cpp +++ b/src/plugins/debugger/logwindow.cpp @@ -12,19 +12,18 @@ #include #include +#include +#include #include #include #include -#include #include #include -#include +#include #include #include -#include - #include #include #include @@ -438,17 +437,19 @@ LogWindow::LogWindow(DebuggerEngine *engine) setMinimumHeight(60); - showOutput(LogWarning, - Tr::tr("Note: This log contains possibly confidential information about your machine, " - "environment variables, in-memory data of the processes you are debugging, and more. " - "It is never transferred over the internet by %1, and only stored " - "to disk if you manually use the respective option from the context menu, or through " - "mechanisms that are not under the control of %1's Debugger plugin, " - "for instance in swap files, or other plugins you might use.\n" - "You may be asked to share the contents of this log when reporting bugs related " - "to debugger operation. In this case, make sure your submission does not " - "contain data you do not want to or you are not allowed to share.\n\n") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + showOutput( + LogWarning, + Tr::tr( + "Note: This log contains possibly confidential information about your machine, " + "environment variables, in-memory data of the processes you are debugging, and more. " + "It is never transferred over the internet by %1, and only stored " + "to disk if you manually use the respective option from the context menu, or through " + "mechanisms that are not under the control of %1's Debugger plugin, " + "for instance in swap files, or other plugins you might use.\n" + "You may be asked to share the contents of this log when reporting bugs related " + "to debugger operation. In this case, make sure your submission does not " + "contain data you do not want to or you are not allowed to share.\n\n") + .arg(QGuiApplication::applicationDisplayName())); } LogWindow::~LogWindow() diff --git a/src/plugins/debugger/procinterrupt.cpp b/src/plugins/debugger/procinterrupt.cpp index f8b010e2767..65d49055cb5 100644 --- a/src/plugins/debugger/procinterrupt.cpp +++ b/src/plugins/debugger/procinterrupt.cpp @@ -4,10 +4,8 @@ #include "procinterrupt.h" #include "debuggerconstants.h" -#include - -#include #include +#include #include // makes kill visible on Windows. using namespace Debugger::Internal; @@ -128,7 +126,7 @@ GDB 32bit | Api | Api | NA | Win32 "on your own, checkout " "https://code.qt.io/cgit/qt-creator/binary-artifacts.git/.") .arg(QDir::toNativeSeparators(executable), - QString(Core::Constants::IDE_DISPLAY_NAME)); + QGuiApplication::applicationDisplayName()); break; } switch (QProcess::execute(executable, QStringList(QString::number(pID)))) { diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 6c7962088a7..f1724f29798 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -36,8 +36,6 @@ #include #include -#include - #include #include #include @@ -48,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -386,7 +385,7 @@ void QmlEngine::connectionStartupFailed() auto infoBox = new QMessageBox(ICore::dialogParent()); infoBox->setIcon(QMessageBox::Critical); - infoBox->setWindowTitle(Core::Constants::IDE_DISPLAY_NAME); + infoBox->setWindowTitle(QGuiApplication::applicationDisplayName()); infoBox->setText(Tr::tr("Could not connect to the in-process QML debugger." "\nDo you want to retry?")); infoBox->setStandardButtons(QMessageBox::Retry | QMessageBox::Cancel | @@ -407,7 +406,7 @@ void QmlEngine::appStartupFailed(const QString &errorMessage) if (companionEngine()) { auto infoBox = new QMessageBox(ICore::dialogParent()); infoBox->setIcon(QMessageBox::Critical); - infoBox->setWindowTitle(Core::Constants::IDE_DISPLAY_NAME); + infoBox->setWindowTitle(QGuiApplication::applicationDisplayName()); infoBox->setText(error); infoBox->setStandardButtons(QMessageBox::Ok | QMessageBox::Help); infoBox->setDefaultButton(QMessageBox::Ok); diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 45a3277f702..f0ece852f4e 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -28,7 +28,6 @@ #include -#include #include #include #include @@ -269,7 +268,7 @@ public: this, &SeparatedView::tabBarContextMenuRequested); tabBar()->setContextMenuPolicy(Qt::CustomContextMenu); setWindowFlags(windowFlags() | Qt::Window); - setWindowTitle(Tr::tr("Debugger - %1").arg(Core::Constants::IDE_DISPLAY_NAME)); + setWindowTitle(Tr::tr("Debugger - %1").arg(QGuiApplication::applicationDisplayName())); QVariant geometry = SessionManager::value("DebuggerSeparateWidgetGeometry"); if (geometry.isValid()) { diff --git a/src/plugins/genericprojectmanager/genericprojectmanager.qbs b/src/plugins/genericprojectmanager/genericprojectmanager.qbs index db678bd9dcd..5ce959e9a64 100644 --- a/src/plugins/genericprojectmanager/genericprojectmanager.qbs +++ b/src/plugins/genericprojectmanager/genericprojectmanager.qbs @@ -11,7 +11,6 @@ QtcPlugin { Depends { name: "TextEditor" } Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } - Depends { name: "app_version_header" } pluginRecommends: [ "CppEditor" diff --git a/src/plugins/genericprojectmanager/genericprojectwizard.cpp b/src/plugins/genericprojectmanager/genericprojectwizard.cpp index 1f125ff321c..314c850b0d2 100644 --- a/src/plugins/genericprojectmanager/genericprojectwizard.cpp +++ b/src/plugins/genericprojectmanager/genericprojectwizard.cpp @@ -12,7 +12,6 @@ #include #include -#include #include #include #include @@ -97,9 +96,10 @@ GenericProjectWizard::GenericProjectWizard() setIcon(ProjectExplorer::Icons::WIZARD_IMPORT_AS_PROJECT.icon()); setDisplayName(Tr::tr("Import Existing Project")); setId("Z.Makefile"); - setDescription(Tr::tr("Imports existing projects that do not use qmake, CMake, Qbs, Meson, or Autotools. " - "This allows you to use %1 as a code editor.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + setDescription( + Tr::tr("Imports existing projects that do not use qmake, CMake, Qbs, Meson, or Autotools. " + "This allows you to use %1 as a code editor.") + .arg(QGuiApplication::applicationDisplayName())); setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY)); setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY)); setFlags(Core::IWizardFactory::PlatformIndependent); diff --git a/src/plugins/help/help.qbs b/src/plugins/help/help.qbs index d96cfa154e7..a5eefb620dd 100644 --- a/src/plugins/help/help.qbs +++ b/src/plugins/help/help.qbs @@ -16,8 +16,6 @@ Project { Depends { name: "Core" } Depends { name: "ProjectExplorer" } - Depends { name: "app_version_header" } - Depends { name: "qlitehtml"; required: false } cpp.defines: { diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 9ad90528676..a3c31c5c6be 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -20,8 +20,6 @@ #include "searchtaskhandler.h" #include "topicchooser.h" -#include - #include #include #include @@ -568,7 +566,7 @@ HelpViewer *HelpPluginPrivate::showHelpUrl(const QUrl &url, Core::HelpManager::H // QtHelp doesn't know about versions, add the version number and use that QUrl versioned = url; versioned.setHost(qtcreatorUnversionedID + "." - + QString::fromLatin1(Core::Constants::IDE_VERSION_LONG).remove('.')); + + QCoreApplication::applicationVersion().remove('.')); return showHelpUrl(versioned, location); } diff --git a/src/plugins/help/localhelpmanager.cpp b/src/plugins/help/localhelpmanager.cpp index f397a5db121..e8be2bfbe32 100644 --- a/src/plugins/help/localhelpmanager.cpp +++ b/src/plugins/help/localhelpmanager.cpp @@ -21,10 +21,10 @@ #include "macwebkithelpviewer.h" #endif -#include #include #include +#include #include #include #include @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -113,9 +114,12 @@ LocalHelpManager *LocalHelpManager::instance() QString LocalHelpManager::defaultHomePage() { + const auto version = QVersionNumber::fromString(QCoreApplication::applicationVersion()); static const QString url = QString::fromLatin1("qthelp://org.qt-project.qtcreator." - "%1%2%3/doc/index.html").arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR) - .arg(IDE_VERSION_RELEASE); + "%1%2%3/doc/index.html") + .arg(version.majorVersion()) + .arg(version.minorVersion()) + .arg(version.microVersion()); return url; } @@ -496,12 +500,13 @@ bool LocalHelpManager::canOpenOnlineHelp(const QUrl &url) bool LocalHelpManager::openOnlineHelp(const QUrl &url) { - static const QString unversionedLocalDomainName = QString("org.qt-project.%1").arg(Core::Constants::IDE_ID); + static const QString unversionedLocalDomainName + = QString("org.qt-project.%1").arg(Utils::appInfo().id); if (canOpenOnlineHelp(url)) { QString urlPrefix = "http://doc.qt.io/"; if (url.authority().startsWith(unversionedLocalDomainName)) { - urlPrefix.append(Core::Constants::IDE_ID); + urlPrefix.append(Utils::appInfo().id); } else { const auto host = url.host(); const auto dot = host.lastIndexOf('.'); diff --git a/src/plugins/languageclient/CMakeLists.txt b/src/plugins/languageclient/CMakeLists.txt index 5af221f7f86..03924f62052 100644 --- a/src/plugins/languageclient/CMakeLists.txt +++ b/src/plugins/languageclient/CMakeLists.txt @@ -5,7 +5,7 @@ elseif (MINGW) endif() add_qtc_plugin(LanguageClient - PUBLIC_DEPENDS LanguageServerProtocol Qt::Core app_version + PUBLIC_DEPENDS LanguageServerProtocol Qt::Core PLUGIN_DEPENDS ProjectExplorer Core TextEditor SOURCES callhierarchy.cpp callhierarchy.h diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 79e6b9a738c..2db13172c92 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -20,8 +20,6 @@ #include "progressmanager.h" #include "semantichighlightsupport.h" -#include - #include #include #include @@ -54,10 +52,12 @@ #include #include +#include #include #include #include +#include #include #include #include @@ -148,8 +148,8 @@ public: { using namespace ProjectExplorer; - m_clientInfo.setName(Core::Constants::IDE_DISPLAY_NAME); - m_clientInfo.setVersion(Core::Constants::IDE_VERSION_DISPLAY); + m_clientInfo.setName(QGuiApplication::applicationDisplayName()); + m_clientInfo.setVersion(Utils::appInfo().displayVersion); m_clientProviders.completionAssistProvider = new LanguageClientCompletionAssistProvider(q); m_clientProviders.functionHintProvider = new FunctionHintAssistProvider(q); diff --git a/src/plugins/languageclient/languageclient.qbs b/src/plugins/languageclient/languageclient.qbs index 286f319a3cc..f036c44e994 100644 --- a/src/plugins/languageclient/languageclient.qbs +++ b/src/plugins/languageclient/languageclient.qbs @@ -17,8 +17,6 @@ QtcPlugin { Depends { name: "Core" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } - files: [ "callhierarchy.cpp", "callhierarchy.h", diff --git a/src/plugins/macros/macro.cpp b/src/plugins/macros/macro.cpp index 46eaa7a8456..829cae5b72a 100644 --- a/src/plugins/macros/macro.cpp +++ b/src/plugins/macros/macro.cpp @@ -4,7 +4,6 @@ #include "macro.h" #include "macroevent.h" -#include #include #include @@ -35,8 +34,8 @@ public: QList events; }; -Macro::MacroPrivate::MacroPrivate() : - version(QLatin1String(Core::Constants::IDE_VERSION_LONG)) +Macro::MacroPrivate::MacroPrivate() + : version(QCoreApplication::applicationVersion()) { } diff --git a/src/plugins/macros/macros.qbs b/src/plugins/macros/macros.qbs index c975f756d7d..9aa7441b771 100644 --- a/src/plugins/macros/macros.qbs +++ b/src/plugins/macros/macros.qbs @@ -10,8 +10,6 @@ QtcPlugin { Depends { name: "Core" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } - files: [ "actionmacrohandler.cpp", "actionmacrohandler.h", diff --git a/src/plugins/mcusupport/mcusupport.qbs b/src/plugins/mcusupport/mcusupport.qbs index 173fe55e6e8..c9b09f81eda 100644 --- a/src/plugins/mcusupport/mcusupport.qbs +++ b/src/plugins/mcusupport/mcusupport.qbs @@ -7,7 +7,6 @@ QtcPlugin { Depends { name: "Qt.widgets" } Depends { name: "Qt.testlib"; condition: qtc.testsEnabled } Depends { name: "Utils" } - Depends { name: "app_version_header" } Depends { name: "Core" } Depends { name: "BareMetal" } diff --git a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs index 15df062dfcc..1c0ae3f9d4d 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs +++ b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs @@ -15,7 +15,6 @@ Project { Depends { name: "CppEditor" } Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } - Depends { name: "app_version_header" } cpp.includePaths: "." diff --git a/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp b/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp index a67175742bb..539e5c11243 100644 --- a/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp +++ b/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp @@ -6,11 +6,10 @@ #include "mesonpluginconstants.h" #include "mesonprojectmanagertr.h" -#include #include #include -#include +#include #include #include @@ -27,7 +26,7 @@ static QString entryName(int index) ToolsSettingsAccessor::ToolsSettingsAccessor() { setDocType("QtCreatorMesonTools"); - setApplicationDisplayName(Core::Constants::IDE_DISPLAY_NAME); + setApplicationDisplayName(QGuiApplication::applicationDisplayName()); setBaseFilePath(Core::ICore::userResourcePath(Constants::ToolsSettings::FILENAME)); } diff --git a/src/plugins/perfprofiler/perfprofiler.qbs b/src/plugins/perfprofiler/perfprofiler.qbs index 7a037e7fa47..68d8452ffc1 100644 --- a/src/plugins/perfprofiler/perfprofiler.qbs +++ b/src/plugins/perfprofiler/perfprofiler.qbs @@ -9,7 +9,6 @@ QtcPlugin { Depends { name: "QtSupport" } Depends { name: "Tracing" } Depends { name: "Utils" } - Depends { name: "app_version_header" } Depends { name: "Qt" diff --git a/src/plugins/perfprofiler/perfprofilertracefile.cpp b/src/plugins/perfprofiler/perfprofilertracefile.cpp index 50c519e7af5..9cc7befc4c9 100644 --- a/src/plugins/perfprofiler/perfprofilertracefile.cpp +++ b/src/plugins/perfprofiler/perfprofilertracefile.cpp @@ -6,9 +6,8 @@ #include "perfprofilertr.h" #include "perfprofilertracefile.h" -#include - #include +#include #include namespace PerfProfiler { @@ -250,9 +249,9 @@ void PerfProfilerTraceFile::readFromDevice() fail(Tr::tr("Invalid data format. The trace file's identification string is \"%1\". " "An acceptable trace file should have \"%2\". You cannot read trace files " "generated with older versions of %3.") - .arg(QString::fromLatin1(magic)) - .arg(QString::fromLatin1(Constants::PerfZqfileMagic)) - .arg(Core::Constants::IDE_DISPLAY_NAME)); + .arg(QString::fromLatin1(magic)) + .arg(QString::fromLatin1(Constants::PerfZqfileMagic)) + .arg(QGuiApplication::applicationDisplayName())); return; } diff --git a/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp b/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp index 36b502c5ad8..023dddb3375 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp @@ -5,14 +5,12 @@ #include "../projectexplorertr.h" -#include - #include #include #include -#include #include +#include #include #ifdef Q_OS_WIN @@ -168,10 +166,10 @@ GDB 32bit | Api | Api | N/A | Win32 if (!QFile::exists(executable)) { appendMsgCannotInterrupt(pid, Tr::tr("%1 does not exist. If you built %2 " - "yourself, check out https://code.qt.io/cgit/" - "qt-creator/binary-artifacts.git/.") + "yourself, check out https://code.qt.io/cgit/" + "qt-creator/binary-artifacts.git/.") .arg(QDir::toNativeSeparators(executable), - QString(Core::Constants::IDE_DISPLAY_NAME))); + QGuiApplication::applicationDisplayName())); } switch (QProcess::execute(executable, QStringList(QString::number(pid)))) { case -2: diff --git a/src/plugins/projectexplorer/extraabi.cpp b/src/plugins/projectexplorer/extraabi.cpp index 19f970b11a6..48a8b325e4f 100644 --- a/src/plugins/projectexplorer/extraabi.cpp +++ b/src/plugins/projectexplorer/extraabi.cpp @@ -11,9 +11,8 @@ #include #include -#include - #include +#include using namespace Utils; @@ -38,7 +37,7 @@ public: AbiFlavorAccessor() { setDocType("QtCreatorExtraAbi"); - setApplicationDisplayName(Core::Constants::IDE_DISPLAY_NAME); + setApplicationDisplayName(QGuiApplication::applicationDisplayName()); setBaseFilePath(Core::ICore::installerResourcePath("abi.xml")); addVersionUpgrader(std::make_unique()); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index d313cb433de..0b57384ea22 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -84,7 +84,6 @@ #include "projecttree.h" #include "projectwelcomepage.h" -#include #include #include #include @@ -2864,10 +2863,11 @@ bool ProjectExplorerPlugin::coreAboutToClose() QPushButton *closeAnyway = box.addButton(Tr::tr("Cancel Build && Close"), QMessageBox::AcceptRole); QPushButton *cancelClose = box.addButton(Tr::tr("Do Not Close"), QMessageBox::RejectRole); box.setDefaultButton(cancelClose); - box.setWindowTitle(Tr::tr("Close %1?").arg(Core::Constants::IDE_DISPLAY_NAME)); + box.setWindowTitle(Tr::tr("Close %1?").arg(QGuiApplication::applicationDisplayName())); box.setText(Tr::tr("A project is currently being built.")); - box.setInformativeText(Tr::tr("Do you want to cancel the build process and close %1 anyway?") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + box.setInformativeText( + Tr::tr("Do you want to cancel the build process and close %1 anyway?") + .arg(QGuiApplication::applicationDisplayName())); box.exec(); if (box.clickedButton() != closeAnyway) return false; diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 420296a306b..68e3c85d03d 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -10,7 +10,6 @@ Project { Depends { name: "Core" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } Depends { name: "libclang"; required: false } Depends { name: "clang_defines" } diff --git a/src/plugins/projectexplorer/projectexplorerconstants.cpp b/src/plugins/projectexplorer/projectexplorerconstants.cpp index 0481d82a020..0b1772c9cd5 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.cpp +++ b/src/plugins/projectexplorer/projectexplorerconstants.cpp @@ -5,7 +5,7 @@ #include "projectexplorertr.h" -#include +#include namespace ProjectExplorer { namespace Constants { @@ -18,7 +18,7 @@ QString msgAutoDetected() QString msgAutoDetectedToolTip() { return Tr::tr("Automatically managed by %1 or the installer.") - .arg(Core::ICore::ideDisplayName()); + .arg(QGuiApplication::applicationDisplayName()); } QString msgManual() diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 9c04314da1b..e8ef6139d7b 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -12,8 +12,6 @@ #include "projecttree.h" #include "target.h" -#include - #include #include #include @@ -35,11 +33,12 @@ #include #include #include +#include #include #include +#include #include #include -#include #include #include #include @@ -600,7 +599,7 @@ public: setWindowTitle(Tr::tr("Choose Drop Action")); const bool offerFileIo = !defaultTargetDir.isEmpty(); auto * const layout = new QVBoxLayout(this); - const QString idename(Core::Constants::IDE_DISPLAY_NAME); + const QString idename(QGuiApplication::applicationDisplayName()); layout->addWidget(new QLabel(Tr::tr("You just dragged some files from one project node to " "another.\nWhat should %1 do now?").arg(idename), this)); auto * const copyButton = new QRadioButton(this); diff --git a/src/plugins/projectexplorer/simpleprojectwizard.cpp b/src/plugins/projectexplorer/simpleprojectwizard.cpp index a73725daa19..455e253abea 100644 --- a/src/plugins/projectexplorer/simpleprojectwizard.cpp +++ b/src/plugins/projectexplorer/simpleprojectwizard.cpp @@ -6,8 +6,6 @@ #include "projectexplorerconstants.h" #include "projectexplorertr.h" -#include - #include #include @@ -151,11 +149,13 @@ SimpleProjectWizard::SimpleProjectWizard() setIcon(ProjectExplorer::Icons::WIZARD_IMPORT_AS_PROJECT.icon()); setDisplayName(Tr::tr("Import as qmake or CMake Project (Limited Functionality)")); setId("Z.DummyProFile"); - setDescription(Tr::tr("Imports existing projects that do not use qmake, CMake, Qbs, Meson, or Autotools.

" - "This creates a project file that allows you to use %1 as a code editor " - "and as a launcher for debugging and analyzing tools. " - "If you want to build the project, you might need to edit the generated project file.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + setDescription( + Tr::tr( + "Imports existing projects that do not use qmake, CMake, Qbs, Meson, or Autotools.

" + "This creates a project file that allows you to use %1 as a code editor " + "and as a launcher for debugging and analyzing tools. " + "If you want to build the project, you might need to edit the generated project file.") + .arg(QGuiApplication::applicationDisplayName())); setCategory(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY); setDisplayCategory(Tr::tr(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY)); setFlags(IWizardFactory::PlatformIndependent); @@ -217,16 +217,16 @@ GeneratedFiles generateQmakeFiles(const SimpleProjectWizardDialog *wizard, GeneratedFile generatedProFile(proFileName); generatedProFile.setAttributes(Core::GeneratedFile::OpenProjectAttribute); generatedProFile.setContents( - "# Created by and for " + QLatin1String(Core::Constants::IDE_DISPLAY_NAME) + "# Created by and for " + QGuiApplication::applicationDisplayName() + " This file was created for editing the project sources only.\n" - "# You may attempt to use it for building too, by modifying this file here.\n\n" - "#TARGET = " + projectName + "\n\n" - "QT = " + wizard->qtModules() + "\n\n" - + proHeaders + "\n\n" - + proSources + "\n\n" - + proIncludes + "\n\n" - "#DEFINES = \n\n" - ); + "# You may attempt to use it for building too, by modifying this file here.\n\n" + "#TARGET = " + + projectName + + "\n\n" + "QT = " + + wizard->qtModules() + "\n\n" + proHeaders + "\n\n" + proSources + "\n\n" + proIncludes + + "\n\n" + "#DEFINES = \n\n"); return GeneratedFiles{generatedProFile}; } @@ -290,22 +290,22 @@ GeneratedFiles generateCmakeFiles(const SimpleProjectWizardDialog *wizard, GeneratedFile generatedProFile(projectFileName); generatedProFile.setAttributes(Core::GeneratedFile::OpenProjectAttribute); generatedProFile.setContents( - "# Created by and for " + QLatin1String(Core::Constants::IDE_DISPLAY_NAME) + "# Created by and for " + QGuiApplication::applicationDisplayName() + " This file was created for editing the project sources only.\n" "# You may attempt to use it for building too, by modifying this file here.\n\n" "cmake_minimum_required(VERSION 3.5)\n" - "project("+ projectName +")\n\n" + "project(" + + projectName + + ")\n\n" "set(CMAKE_AUTOUIC ON)\n" "set(CMAKE_AUTOMOC ON)\n" "set(CMAKE_AUTORCC ON)\n" "set(CMAKE_CXX_STANDARD 11)\n" "set(CMAKE_CXX_STANDARD_REQUIRED ON)\n" - + components + "\n\n" - + includes + "\n\n" - + srcs + "\n\n" + + components + "\n\n" + includes + "\n\n" + srcs + + "\n\n" "add_executable(${CMAKE_PROJECT_NAME} ${SRCS})\n\n" - + libs - ); + + libs); return GeneratedFiles{generatedProFile}; } diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index d2fdc3b43a8..f17354bc5da 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -19,8 +19,6 @@ #include "targetsetuppage.h" #include "task.h" -#include - #include #include #include diff --git a/src/plugins/projectexplorer/task.cpp b/src/plugins/projectexplorer/task.cpp index 03c2a282be0..a16a7283446 100644 --- a/src/plugins/projectexplorer/task.cpp +++ b/src/plugins/projectexplorer/task.cpp @@ -7,7 +7,6 @@ #include "projectexplorerconstants.h" #include "projectexplorertr.h" -#include #include #include #include @@ -15,6 +14,7 @@ #include #include +#include #include using namespace Utils; @@ -61,8 +61,8 @@ Task Task::compilerMissingTask() { return BuildSystemTask(Task::Error, Tr::tr("%1 needs a compiler set up to build. " - "Configure a compiler in the kit options.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + "Configure a compiler in the kit options.") + .arg(QGuiApplication::applicationDisplayName())); } void Task::setMark(TextEditor::TextMark *mark) diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index e0717ab7804..99ac9f87745 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -10,7 +10,6 @@ #include "toolchainconfigwidget.h" #include "toolchainmanager.h" -#include #include #include @@ -117,10 +116,14 @@ public: const auto layout = new QVBoxLayout(this); m_detectX64AsX32CheckBox.setText(Tr::tr("Detect x86_64 GCC compilers " "as x86_64 and x86")); - m_detectX64AsX32CheckBox.setToolTip(Tr::tr("If checked, %1 will " - "set up two instances of each x86_64 compiler:\nOne for the native x86_64 target, and " - "one for a plain x86 target.\nEnable this if you plan to create 32-bit x86 binaries " - "without using a dedicated cross compiler.").arg(Core::Constants::IDE_DISPLAY_NAME)); + m_detectX64AsX32CheckBox.setToolTip( + Tr::tr("If checked, %1 will " + "set up two instances of each x86_64 compiler:\nOne for the native x86_64 " + "target, and " + "one for a plain x86 target.\nEnable this if you plan to create 32-bit x86 " + "binaries " + "without using a dedicated cross compiler.") + .arg(QGuiApplication::applicationDisplayName())); m_detectX64AsX32CheckBox.setChecked(settings.detectX64AsX32); layout->addWidget(&m_detectX64AsX32CheckBox); const auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index 35224e4d02a..9354f6e62db 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -10,11 +10,10 @@ #include -#include - #include #include +#include #include using namespace Utils; @@ -172,7 +171,7 @@ static ToolChainOperations mergeToolChainLists(const Toolchains &systemFileTcs, ToolChainSettingsAccessor::ToolChainSettingsAccessor() { setDocType("QtCreatorToolChains"); - setApplicationDisplayName(Core::Constants::IDE_DISPLAY_NAME); + setApplicationDisplayName(QGuiApplication::applicationDisplayName()); setBaseFilePath(Core::ICore::userResourcePath(TOOLCHAIN_FILENAME)); addVersionUpgrader(std::make_unique()); diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index 5a765cb537f..295bb2ea000 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -13,7 +13,6 @@ #include "kit.h" #include "kitmanager.h" -#include #include #include #include @@ -21,6 +20,7 @@ #include #include +#include #include using namespace Utils; @@ -288,7 +288,7 @@ UserFileAccessor::UserFileAccessor(Project *project) { setStrategy(std::make_unique(this)); setDocType("QtCreatorProject"); - setApplicationDisplayName(Core::Constants::IDE_DISPLAY_NAME); + setApplicationDisplayName(QGuiApplication::applicationDisplayName()); // Setup: const FilePath externalUser = externalUserFile(); diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs index 99c4345f452..727507dda13 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs +++ b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs @@ -16,7 +16,6 @@ QtcPlugin { Depends { name: "CppEditor" } Depends { name: "QtSupport" } Depends { name: "QmlJSTools" } - Depends { name: "app_version_header" } files: [ "customqbspropertiesdialog.h", diff --git a/src/plugins/qbsprojectmanager/qbssession.cpp b/src/plugins/qbsprojectmanager/qbssession.cpp index d2e5d130f0e..49d8b31b56f 100644 --- a/src/plugins/qbsprojectmanager/qbssession.cpp +++ b/src/plugins/qbsprojectmanager/qbssession.cpp @@ -8,7 +8,6 @@ #include "qbsprojectmanagertr.h" #include "qbssettings.h" -#include #include #include #include @@ -19,6 +18,7 @@ #include #include +#include #include #include #include @@ -243,7 +243,7 @@ QString QbsSession::errorString(QbsSession::Error error) //: %1 == "Qt Creator" or "Qt Design Studio" return Tr::tr("The qbs API level is not compatible with " "what %1 expects.") - .arg(Core::Constants::IDE_DISPLAY_NAME); + .arg(QGuiApplication::applicationDisplayName()); } return QString(); // For dumb compilers. } diff --git a/src/plugins/qbsprojectmanager/qbssettings.cpp b/src/plugins/qbsprojectmanager/qbssettings.cpp index 409ebcd88b0..d631f23ced8 100644 --- a/src/plugins/qbsprojectmanager/qbssettings.cpp +++ b/src/plugins/qbsprojectmanager/qbssettings.cpp @@ -6,7 +6,6 @@ #include "qbsprojectmanagerconstants.h" #include "qbsprojectmanagertr.h" -#include #include #include #include @@ -15,9 +14,9 @@ #include #include -#include #include #include +#include #include #include @@ -161,7 +160,7 @@ public: m_versionLabel.setText(getQbsVersionString()); //: %1 == "Qt Creator" or "Qt Design Studio" m_settingsDirCheckBox.setText(Tr::tr("Use %1 settings directory for Qbs") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + .arg(QGuiApplication::applicationDisplayName())); m_settingsDirCheckBox.setChecked(QbsSettings::useCreatorSettingsDirForQbs()); const auto layout = new QFormLayout(this); diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs index e4276322c75..599441a0a87 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs @@ -14,7 +14,6 @@ Project { Depends { name: "CppEditor" } Depends { name: "TextEditor" } Depends { name: "ResourceEditor" } - Depends { name: "app_version_header" } Group { name: "General" diff --git a/src/plugins/qmldesigner/puppetenvironmentbuilder.cpp b/src/plugins/qmldesigner/puppetenvironmentbuilder.cpp index e52c0c70581..e413d66ba29 100644 --- a/src/plugins/qmldesigner/puppetenvironmentbuilder.cpp +++ b/src/plugins/qmldesigner/puppetenvironmentbuilder.cpp @@ -7,8 +7,6 @@ #include -#include - #include #include #include diff --git a/src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp b/src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp index 1bd58991657..54549fa575f 100644 --- a/src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp +++ b/src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp @@ -5,7 +5,6 @@ #include "qmldesignerplugin.h" -#include #include #include #include diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp index a25bbb832b8..c83f830072c 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.cpp +++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp @@ -39,7 +39,6 @@ #include -#include #include #include #include @@ -244,7 +243,7 @@ bool QmlDesignerPlugin::initialize(const QStringList & /*arguments*/, QString *e ->addAction(cmd, Core::Constants::G_HELP_SUPPORT); connect(action, &QAction::triggered, this, [this] { - lauchFeedbackPopupInternal(Core::Constants::IDE_DISPLAY_NAME); + lauchFeedbackPopupInternal(QGuiApplication::applicationDisplayName()); }); if (!Utils::HostOsInfo::canCreateOpenGLContext(errorMessage)) diff --git a/src/plugins/qmldesigner/settingspage.cpp b/src/plugins/qmldesigner/settingspage.cpp index 8c3222d72c3..f5556e4d948 100644 --- a/src/plugins/qmldesigner/settingspage.cpp +++ b/src/plugins/qmldesigner/settingspage.cpp @@ -7,8 +7,6 @@ #include "qmldesignerexternaldependencies.h" #include "qmldesignerplugin.h" -#include - #include #include @@ -506,10 +504,11 @@ void SettingsPageWidget::apply() for (const char * const key : restartNecessaryKeys) { if (QmlDesignerPlugin::settings().value(key) != settings.value(key)) { - QMessageBox::information(Core::ICore::dialogParent(), tr("Restart Required"), - tr("The made changes will take effect after a " - "restart of the QML Emulation layer or %1.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + QMessageBox::information(Core::ICore::dialogParent(), + tr("Restart Required"), + tr("The made changes will take effect after a " + "restart of the QML Emulation layer or %1.") + .arg(QGuiApplication::applicationDisplayName())); break; } } diff --git a/src/plugins/qmldesignerbase/qmldesignerbase.qbs b/src/plugins/qmldesignerbase/qmldesignerbase.qbs index 98f4cdf5562..334bebe1964 100644 --- a/src/plugins/qmldesignerbase/qmldesignerbase.qbs +++ b/src/plugins/qmldesignerbase/qmldesignerbase.qbs @@ -6,7 +6,6 @@ QtcPlugin { Depends { name: "Core" } Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } - Depends { name: "app_version_header" } Depends { name: "Qt.quickwidgets" } files: [ diff --git a/src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp b/src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp index d73ea62ea97..0878dc04e2e 100644 --- a/src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp +++ b/src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp @@ -5,7 +5,6 @@ #include "designersettings.h" -#include #include #include #include @@ -19,7 +18,8 @@ namespace { Utils::FilePath qmlPuppetExecutablePath(const Utils::FilePath &workingDirectory) { - return workingDirectory.pathAppended(QString{"qml2puppet-"} + Core::Constants::IDE_VERSION_LONG) + return workingDirectory + .pathAppended(QString{"qml2puppet-"} + QCoreApplication::applicationVersion()) .withExecutableSuffix(); } diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index 56a1e00cd6a..359a9eb1cf2 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.qbs +++ b/src/plugins/qmlprofiler/qmlprofiler.qbs @@ -15,7 +15,6 @@ QtcPlugin { Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } Group { name: "General" diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index f003d5f0e40..42826cd13fd 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -15,8 +15,6 @@ #include "qmlprofilertr.h" #include "qmlprofilerviewmanager.h" -#include - #include #include #include @@ -333,7 +331,7 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker) runWorker, [this, runWorker]() { auto infoBox = new QMessageBox(ICore::dialogParent()); infoBox->setIcon(QMessageBox::Critical); - infoBox->setWindowTitle(Core::Constants::IDE_DISPLAY_NAME); + infoBox->setWindowTitle(QGuiApplication::applicationDisplayName()); const int interval = d->m_profilerConnections->retryInterval(); const int retries = d->m_profilerConnections->maximumRetries(); diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index d7418e1b316..60e58d78d6b 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -9,8 +9,6 @@ #include "qtversionmanager.h" #include "qtversionfactory.h" -#include - #include #include #include @@ -803,14 +801,14 @@ void QtOptionsPageWidget::updateWidgets() static QString settingsFile(const QString &baseDir) { - return baseDir + (baseDir.isEmpty() ? "" : "/") + Core::Constants::IDE_SETTINGSVARIANT_STR + '/' - + Core::Constants::IDE_CASED_ID + ".ini"; + return baseDir + (baseDir.isEmpty() ? "" : "/") + QCoreApplication::organizationName() + '/' + + QCoreApplication::applicationName() + ".ini"; } static QString qtVersionsFile(const QString &baseDir) { - return baseDir + (baseDir.isEmpty() ? "" : "/") + Core::Constants::IDE_SETTINGSVARIANT_STR + '/' - + Core::Constants::IDE_ID + '/' + "qtversion.xml"; + return baseDir + (baseDir.isEmpty() ? "" : "/") + QCoreApplication::organizationName() + '/' + + QCoreApplication::applicationName() + '/' + "qtversion.xml"; } static std::optional currentlyLinkedQtDir(bool *hasInstallSettings) @@ -847,12 +845,12 @@ static bool canLinkWithQt(QString *toolTip) if (!Core::ICore::resourcePath().isWritableDir()) { canLink = false; tip << Tr::tr("%1's resource directory is not writable.") - .arg(Core::Constants::IDE_DISPLAY_NAME); + .arg(QGuiApplication::applicationDisplayName()); } const FilePath link = installSettingsValue ? *installSettingsValue : FilePath(); if (!link.isEmpty()) tip << Tr::tr("%1 is currently linked to \"%2\".") - .arg(QString(Core::Constants::IDE_DISPLAY_NAME), link.toUserOutput()); + .arg(QGuiApplication::applicationDisplayName(), link.toUserOutput()); if (toolTip) *toolTip = tip.join("\n\n"); return canLink; diff --git a/src/plugins/qtsupport/qtsupport.qbs b/src/plugins/qtsupport/qtsupport.qbs index 526cf4a24fe..502f13f7588 100644 --- a/src/plugins/qtsupport/qtsupport.qbs +++ b/src/plugins/qtsupport/qtsupport.qbs @@ -6,7 +6,6 @@ Project { QtcPlugin { Depends { name: "Qt"; submodules: ["widgets", "xml"]; } Depends { name: "Utils" } - Depends { name: "app_version_header" } Depends { name: "Core" } Depends { name: "ProParser" } diff --git a/src/plugins/scxmleditor/common/mainwidget.cpp b/src/plugins/scxmleditor/common/mainwidget.cpp index 8cd7618944e..795e183bd67 100644 --- a/src/plugins/scxmleditor/common/mainwidget.cpp +++ b/src/plugins/scxmleditor/common/mainwidget.cpp @@ -51,8 +51,6 @@ #include #include -#include - #include #include diff --git a/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp b/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp index e85a516cf11..4ee7ebc6197 100644 --- a/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp +++ b/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp @@ -13,8 +13,6 @@ #include #include -#include - using namespace ScxmlEditor::PluginInterface; ScxmlDocument::ScxmlDocument(const QString &fileName, QObject *parent) @@ -62,7 +60,7 @@ void ScxmlDocument::clear(bool createRoot) if (createRoot) { pushRootTag(createScxmlTag()); - rootTag()->setAttribute("qt:editorversion", QLatin1String(Core::Constants::IDE_VERSION_LONG)); + rootTag()->setAttribute("qt:editorversion", QCoreApplication::applicationVersion()); auto ns = new ScxmlNamespace("qt", "http://www.qt.io/2015/02/scxml-ext"); ns->setTagVisibility("editorInfo", false); @@ -207,7 +205,7 @@ bool ScxmlDocument::load(QIODevice *io) // Check editorversion m_hasLayouted = rootTag()->hasAttribute("qt:editorversion"); - rootTag()->setAttribute("qt:editorversion", QLatin1String(Core::Constants::IDE_VERSION_LONG)); + rootTag()->setAttribute("qt:editorversion", QCoreApplication::applicationVersion()); } } @@ -363,7 +361,7 @@ void ScxmlDocument::load(const QString &fileName) // If loading doesn't work, create root tag here if (m_rootTags.isEmpty()) { pushRootTag(createScxmlTag()); - rootTag()->setAttribute("qt:editorversion", QLatin1String(Core::Constants::IDE_VERSION_LONG)); + rootTag()->setAttribute("qt:editorversion", QCoreApplication::applicationVersion()); } auto ns = new ScxmlNamespace("qt", "http://www.qt.io/2015/02/scxml-ext"); diff --git a/src/plugins/scxmleditor/scxmleditor.qbs b/src/plugins/scxmleditor/scxmleditor.qbs index 39340d8764c..d8457e6e1a3 100644 --- a/src/plugins/scxmleditor/scxmleditor.qbs +++ b/src/plugins/scxmleditor/scxmleditor.qbs @@ -11,8 +11,6 @@ QtcPlugin { Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } - Depends { name: "app_version_header" } - cpp.includePaths: base.concat([ ".", common.prefix, diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index b7a4725f814..7769f5f470e 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -6,8 +6,6 @@ #include "qdsnewdialog.h" -#include - #include #include #include @@ -39,6 +37,7 @@ #include +#include #include #include #include @@ -166,7 +165,7 @@ public: explicit UsageStatisticPluginModel(QObject *parent = nullptr) : QObject(parent) { - m_versionString = Core::Constants::IDE_VERSION_DISPLAY; + m_versionString = Utils::appInfo().displayVersion; setupModel(); } @@ -532,8 +531,7 @@ static bool showSplashScreen() const QString lastQDSVersion = settings->value(lastQDSVersionEntry).toString(); - - const QString currentVersion = Core::Constants::IDE_VERSION_DISPLAY; + const QString currentVersion = Utils::appInfo().displayVersion; if (currentVersion != lastQDSVersion) { settings->setValue(lastQDSVersionEntry, currentVersion); diff --git a/src/plugins/welcome/welcome.qbs b/src/plugins/welcome/welcome.qbs index 95acd8fe216..2811856c1f3 100644 --- a/src/plugins/welcome/welcome.qbs +++ b/src/plugins/welcome/welcome.qbs @@ -7,7 +7,6 @@ QtcPlugin { Depends { name: "Utils" } Depends { name: "Core" } - Depends { name: "app_version_header" } files: [ "introductionwidget.cpp", diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 915695dafa2..d4089de465a 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -7,8 +7,6 @@ #include #include -#include - #include #include #include @@ -30,6 +28,7 @@ #include #include +#include #include #include #include @@ -187,7 +186,7 @@ public: hbox->addSpacing(8); - auto ideNameLabel = new QLabel(Core::Constants::IDE_DISPLAY_NAME); + auto ideNameLabel = new QLabel(QGuiApplication::applicationDisplayName()); ideNameLabel->setFont(welcomeFont); ideNameLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); QPalette pal = palette(); diff --git a/src/tools/iostool/iostool.qbs b/src/tools/iostool/iostool.qbs index d45172e23f2..0da4b451c7c 100644 --- a/src/tools/iostool/iostool.qbs +++ b/src/tools/iostool/iostool.qbs @@ -8,7 +8,6 @@ QtcTool { Depends { name: "Qt.widgets" } Depends { name: "Qt.xml" } Depends { name: "Qt.network" } - Depends { name: "app_version_header" } files: [ "cfutils.h", From 6836caa14c247829bfd4edf47d31c87310d56211 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 22 Jun 2023 14:59:24 +0200 Subject: [PATCH 0057/1777] Do not compile PROJECT_USER_FILE_EXTENSION into plugins Set it in the app info in the main application and read it from there. Moves more branding information out of the plugins. Change-Id: I2f2e9fc96900793be15ac1907df70dda31c1b9c1 Reviewed-by: Qt CI Bot Reviewed-by: Alessandro Portale --- qbs/modules/qtc/qtc.qbs | 1 + src/app/app_version.h.cmakein | 3 +++ src/app/app_version_header.qbs | 2 ++ src/app/main.cpp | 1 + src/libs/utils/appinfo.h | 1 + src/plugins/projectexplorer/CMakeLists.txt | 5 ---- .../projectexplorer/userfileaccessor.cpp | 24 +++++++++---------- 7 files changed, 19 insertions(+), 18 deletions(-) diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 58ad299d3e3..8a78e329b07 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -26,6 +26,7 @@ Module { property string ide_id: 'qtcreator' property string ide_cased_id: 'QtCreator' property string ide_bundle_identifier: 'org.qt-project.qtcreator' + property string ide_user_file_extension: '.user' property string libDirName: "lib" property string ide_app_path: qbs.targetOS.contains("macos") ? "" : "bin" diff --git a/src/app/app_version.h.cmakein b/src/app/app_version.h.cmakein index 5b9098f056e..6c1fb9bb297 100644 --- a/src/app/app_version.h.cmakein +++ b/src/app/app_version.h.cmakein @@ -28,5 +28,8 @@ const char IDE_REVISION_URL[] = "${IDE_REVISION_URL}"; // changes the path where the settings are saved to const char IDE_SETTINGSVARIANT_STR[] = "${IDE_SETTINGSVARIANT}"; +// added extension for project user settings +const char IDE_PROJECT_USER_FILE_EXTENSION[] = "${PROJECT_USER_FILE_EXTENSION}"; + } // Constants } // Core diff --git a/src/app/app_version_header.qbs b/src/app/app_version_header.qbs index 59cd014df7c..110ec345403 100644 --- a/src/app/app_version_header.qbs +++ b/src/app/app_version_header.qbs @@ -57,6 +57,8 @@ Product { product.moduleProperty("qtc", "ide_id")); content = content.replace("$${IDE_CASED_ID}", product.moduleProperty("qtc", "ide_cased_id")); + content = content.replace("$${PROJECT_USER_FILE_EXTENSION}", + product.moduleProperty("qtc", "ide_user_file_extension")); file = new TextFile(output.filePath, TextFile.WriteOnly); file.truncate(); file.write(content); diff --git a/src/app/main.cpp b/src/app/main.cpp index c488a2d9be6..b2c10208a6f 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -662,6 +662,7 @@ int main(int argc, char **argv) info.id = Constants::IDE_ID; info.revision = Constants::IDE_REVISION_STR; info.revisionUrl = Constants::IDE_REVISION_URL; + info.userFileExtension = Constants::IDE_PROJECT_USER_FILE_EXTENSION; Utils::Internal::setAppInfo(info); QTranslator translator; diff --git a/src/libs/utils/appinfo.h b/src/libs/utils/appinfo.h index 2ce926f8b57..9fd5a3f35e8 100644 --- a/src/libs/utils/appinfo.h +++ b/src/libs/utils/appinfo.h @@ -18,6 +18,7 @@ public: QString id; QString revision; QString revisionUrl; + QString userFileExtension; }; QTCREATOR_UTILS_EXPORT AppInfo appInfo(); diff --git a/src/plugins/projectexplorer/CMakeLists.txt b/src/plugins/projectexplorer/CMakeLists.txt index b9758fbfe7e..dd3d2d1e995 100644 --- a/src/plugins/projectexplorer/CMakeLists.txt +++ b/src/plugins/projectexplorer/CMakeLists.txt @@ -182,11 +182,6 @@ add_qtc_plugin(ProjectExplorer xcodebuildparser.cpp xcodebuildparser.h ) -extend_qtc_plugin(ProjectExplorer - CONDITION PROJECT_USER_FILE_EXTENSION - DEFINES "PROJECT_USER_FILE_EXTENSION=${PROJECT_USER_FILE_EXTENSION}" -) - if (TARGET clangd) set(CLANG_BINDIR "$") endif() diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index 295bb2ea000..4a174cdf837 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -14,6 +14,8 @@ #include "kitmanager.h" #include + +#include #include #include #include @@ -29,22 +31,18 @@ using namespace ProjectExplorer::Internal; using StringVariantPair = std::pair; +static QString userFileExtension() +{ + const QString ext = Utils::appInfo().userFileExtension; + return ext.isEmpty() ? QLatin1String(".user") : ext; +} + namespace { const char OBSOLETE_VERSION_KEY[] = "ProjectExplorer.Project.Updater.FileVersion"; const char SHARED_SETTINGS[] = "SharedSettings"; const char USER_STICKY_KEYS_KEY[] = "UserStickyKeys"; -#ifdef PROJECT_USER_FILE_EXTENSION -#define STRINGIFY_INTERNAL(x) #x -#define STRINGIFY(x) STRINGIFY_INTERNAL(x) - -const char FILE_EXTENSION_STR[] = STRINGIFY(PROJECT_USER_FILE_EXTENSION); -#else -const char FILE_EXTENSION_STR[] = ".user"; - -#endif - // Version 14 Move builddir into BuildConfiguration class UserFileVersion14Upgrader : public VersionUpgrader { @@ -385,15 +383,15 @@ QVariant UserFileAccessor::retrieveSharedSettings() const FilePath UserFileAccessor::projectUserFile() const { static const QString qtcExt = qtcEnvironmentVariable("QTC_EXTENSION"); - return m_project->projectFilePath() - .stringAppended(generateSuffix(qtcExt.isEmpty() ? FILE_EXTENSION_STR : qtcExt)); + return m_project->projectFilePath().stringAppended( + generateSuffix(qtcExt.isEmpty() ? userFileExtension() : qtcExt)); } FilePath UserFileAccessor::externalUserFile() const { static const QString qtcExt = qtcEnvironmentVariable("QTC_EXTENSION"); return externalUserFilePath(m_project->projectFilePath(), - generateSuffix(qtcExt.isEmpty() ? FILE_EXTENSION_STR : qtcExt)); + generateSuffix(qtcExt.isEmpty() ? userFileExtension() : qtcExt)); } FilePath UserFileAccessor::sharedFile() const From 691c8148a3bf29fda53655fe3423fd18a0704d93 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 20 Jun 2023 09:27:47 +0200 Subject: [PATCH 0058/1777] ProjectExplorer/RemoteLinux: Consolidate X11ForwardingAspect handling Change-Id: I7e74f58ab50c84c74ba65f9f64aaa4d0ea73bbb6 Reviewed-by: Christian Kandeler Reviewed-by: --- src/plugins/projectexplorer/runconfiguration.cpp | 2 ++ src/plugins/python/pythonrunconfiguration.cpp | 5 ----- src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp | 2 -- .../remotelinux/remotelinuxcustomrunconfiguration.cpp | 5 ----- src/plugins/remotelinux/remotelinuxrunconfiguration.cpp | 5 ----- 5 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index a38b8dfae05..452d07c3599 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -403,6 +403,8 @@ Runnable RunConfiguration::runnable() const r.workingDirectory = r.command.executable().withNewMappedPath(workingDirectoryAspect->workingDirectory()); if (auto environmentAspect = aspect()) r.environment = environmentAspect->environment(); + if (auto forwardingAspect = aspect()) + r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display()); if (m_runnableModifier) m_runnableModifier(r); return r; diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 998a829bc91..a2ed429adbe 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -200,11 +200,6 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) if (HostOsInfo::isAnyUnixHost()) addAspect(macroExpander()); - setRunnableModifier([this](Runnable &r) { - if (const auto * const forwardingAspect = aspect()) - r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display()); - }); - setCommandLineGetter([bufferedAspect, interpreterAspect, argumentsAspect, scriptAspect] { CommandLine cmd{interpreterAspect->currentInterpreter().command}; if (!bufferedAspect->value()) diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index e2626402f60..9e9a29d35d1 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -171,8 +171,6 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) setRunnableModifier([this](Runnable &r) { const QmlBuildSystem *bs = static_cast(activeBuildSystem()); r.workingDirectory = bs->targetDirectory(); - if (const auto * const forwardingAspect = aspect()) - r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display()); }); setDisplayName(Tr::tr("QML Utility", "QMLRunConfiguration display name.")); diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp index fd6f75c0761..9b99d66923b 100644 --- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp @@ -52,11 +52,6 @@ RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *tar if (HostOsInfo::isAnyUnixHost()) addAspect(macroExpander()); - setRunnableModifier([this](Runnable &r) { - if (const auto * const forwardingAspect = aspect()) - r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display()); - }); - setDefaultDisplayName(runConfigDefaultDisplayName()); } diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 42e80aae41b..4ac92d237e2 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -73,11 +73,6 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Id id) libAspect->setEnabled(buildDevice == runDevice); }); - setRunnableModifier([this](Runnable &r) { - if (const auto * const forwardingAspect = aspect()) - r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display()); - }); - envAspect->addModifier([this, libAspect](Environment &env) { BuildTargetInfo bti = buildTargetInfo(); if (bti.runEnvModifier) From 68bc2136444f4b940a142c9a650a69c15d496c02 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 22 Jun 2023 15:07:50 +0200 Subject: [PATCH 0059/1777] Move app logo to main executable Moves more branding information out of the plugins. Change-Id: I71575f268dd8f2860f4da56101b0e3d9442df367 Reviewed-by: Reviewed-by: Alessandro Portale --- cmake/QtCreatorIDEBranding.cmake | 2 +- src/app/CMakeLists.txt | 16 ++++++++++++++++ src/app/app.qbs | 1 + .../core_logo.qrc => app/app_logo.qrc} | 0 .../app_logo.qrc.cmakein} | 0 .../images/logo/128/QtProject-qtcreator.png | Bin .../images/logo/16/QtProject-qtcreator.png | Bin .../images/logo/24/QtProject-qtcreator.png | Bin .../images/logo/256/QtProject-qtcreator.png | Bin .../images/logo/32/QtProject-qtcreator.png | Bin .../images/logo/48/QtProject-qtcreator.png | Bin .../images/logo/512/QtProject-qtcreator.png | Bin .../images/logo/64/QtProject-qtcreator.png | Bin .../coreplugin => app}/images/logo/logo.qbs | 0 src/plugins/coreplugin/CMakeLists.txt | 16 ---------------- src/plugins/coreplugin/coreplugin.qbs | 1 - src/plugins/plugins.qbs | 1 - src/src.qbs | 1 + 18 files changed, 19 insertions(+), 19 deletions(-) rename src/{plugins/coreplugin/core_logo.qrc => app/app_logo.qrc} (100%) rename src/{plugins/coreplugin/core_logo.qrc.cmakein => app/app_logo.qrc.cmakein} (100%) rename src/{plugins/coreplugin => app}/images/logo/128/QtProject-qtcreator.png (100%) rename src/{plugins/coreplugin => app}/images/logo/16/QtProject-qtcreator.png (100%) rename src/{plugins/coreplugin => app}/images/logo/24/QtProject-qtcreator.png (100%) rename src/{plugins/coreplugin => app}/images/logo/256/QtProject-qtcreator.png (100%) rename src/{plugins/coreplugin => app}/images/logo/32/QtProject-qtcreator.png (100%) rename src/{plugins/coreplugin => app}/images/logo/48/QtProject-qtcreator.png (100%) rename src/{plugins/coreplugin => app}/images/logo/512/QtProject-qtcreator.png (100%) rename src/{plugins/coreplugin => app}/images/logo/64/QtProject-qtcreator.png (100%) rename src/{plugins/coreplugin => app}/images/logo/logo.qbs (100%) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index 171b65ded2b..e5ef7a4b73d 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -16,6 +16,6 @@ set(IDE_DOC_FILE_ONLINE "qtcreator/qtcreator-online.qdocconf") # Absolute, or relative to /src/app # Should contain qtcreator.ico, qtcreator.xcassets set(IDE_ICON_PATH "") -# Absolute, or relative to /src/plugins/coreplugin +# Absolute, or relative to /src/app # Should contain images/logo/(16|24|32|48|64|128|256|512)/QtProject-qtcreator.png set(IDE_LOGO_PATH "") diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 2d39c219f99..8e19bacc680 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -4,11 +4,17 @@ if(NOT IS_ABSOLUTE "${IDE_ICON_PATH}") set(IDE_ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${IDE_ICON_PATH}") endif() +if (NOT IS_ABSOLUTE ${IDE_LOGO_PATH}) + set(IDE_LOGO_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${IDE_LOGO_PATH}") +endif() +configure_file(app_logo.qrc.cmakein app_logo_cmake.qrc) + add_qtc_executable(qtcreator DEFINES IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\" DEPENDS Aggregation ExtensionSystem Qt::Core Qt::Widgets Utils shared_qtsingleapplication app_version SOURCES main.cpp + ${CMAKE_CURRENT_BINARY_DIR}/app_logo_cmake.qrc ../tools/qtcreatorcrashhandler/crashhandlersetup.cpp ../tools/qtcreatorcrashhandler/crashhandlersetup.h PROPERTIES WIN32_EXECUTABLE ON @@ -145,3 +151,13 @@ if(BUILD_WITH_CRASHPAD) DESTINATION "${IDE_LIBEXEC_PATH}" ) endif() + +if ((NOT WIN32) AND (NOT APPLE)) + # install logo + foreach(size 16 24 32 48 64 128 256 512) + install( + FILES ${IDE_LOGO_PATH}/images/logo/${size}/QtProject-qtcreator.png + DESTINATION share/icons/hicolor/${size}x${size}/apps + ) + endforeach() +endif() diff --git a/src/app/app.qbs b/src/app/app.qbs index a0b30ae2ae4..8bce23f6424 100644 --- a/src/app/app.qbs +++ b/src/app/app.qbs @@ -52,6 +52,7 @@ QtcProduct { files: [ "app-Info.plist", + "app_logo.qrc", "main.cpp", "qtcreator.xcassets", "../shared/qtsingleapplication/qtsingleapplication.h", diff --git a/src/plugins/coreplugin/core_logo.qrc b/src/app/app_logo.qrc similarity index 100% rename from src/plugins/coreplugin/core_logo.qrc rename to src/app/app_logo.qrc diff --git a/src/plugins/coreplugin/core_logo.qrc.cmakein b/src/app/app_logo.qrc.cmakein similarity index 100% rename from src/plugins/coreplugin/core_logo.qrc.cmakein rename to src/app/app_logo.qrc.cmakein diff --git a/src/plugins/coreplugin/images/logo/128/QtProject-qtcreator.png b/src/app/images/logo/128/QtProject-qtcreator.png similarity index 100% rename from src/plugins/coreplugin/images/logo/128/QtProject-qtcreator.png rename to src/app/images/logo/128/QtProject-qtcreator.png diff --git a/src/plugins/coreplugin/images/logo/16/QtProject-qtcreator.png b/src/app/images/logo/16/QtProject-qtcreator.png similarity index 100% rename from src/plugins/coreplugin/images/logo/16/QtProject-qtcreator.png rename to src/app/images/logo/16/QtProject-qtcreator.png diff --git a/src/plugins/coreplugin/images/logo/24/QtProject-qtcreator.png b/src/app/images/logo/24/QtProject-qtcreator.png similarity index 100% rename from src/plugins/coreplugin/images/logo/24/QtProject-qtcreator.png rename to src/app/images/logo/24/QtProject-qtcreator.png diff --git a/src/plugins/coreplugin/images/logo/256/QtProject-qtcreator.png b/src/app/images/logo/256/QtProject-qtcreator.png similarity index 100% rename from src/plugins/coreplugin/images/logo/256/QtProject-qtcreator.png rename to src/app/images/logo/256/QtProject-qtcreator.png diff --git a/src/plugins/coreplugin/images/logo/32/QtProject-qtcreator.png b/src/app/images/logo/32/QtProject-qtcreator.png similarity index 100% rename from src/plugins/coreplugin/images/logo/32/QtProject-qtcreator.png rename to src/app/images/logo/32/QtProject-qtcreator.png diff --git a/src/plugins/coreplugin/images/logo/48/QtProject-qtcreator.png b/src/app/images/logo/48/QtProject-qtcreator.png similarity index 100% rename from src/plugins/coreplugin/images/logo/48/QtProject-qtcreator.png rename to src/app/images/logo/48/QtProject-qtcreator.png diff --git a/src/plugins/coreplugin/images/logo/512/QtProject-qtcreator.png b/src/app/images/logo/512/QtProject-qtcreator.png similarity index 100% rename from src/plugins/coreplugin/images/logo/512/QtProject-qtcreator.png rename to src/app/images/logo/512/QtProject-qtcreator.png diff --git a/src/plugins/coreplugin/images/logo/64/QtProject-qtcreator.png b/src/app/images/logo/64/QtProject-qtcreator.png similarity index 100% rename from src/plugins/coreplugin/images/logo/64/QtProject-qtcreator.png rename to src/app/images/logo/64/QtProject-qtcreator.png diff --git a/src/plugins/coreplugin/images/logo/logo.qbs b/src/app/images/logo/logo.qbs similarity index 100% rename from src/plugins/coreplugin/images/logo/logo.qbs rename to src/app/images/logo/logo.qbs diff --git a/src/plugins/coreplugin/CMakeLists.txt b/src/plugins/coreplugin/CMakeLists.txt index 36c13206eed..a37b2f216ca 100644 --- a/src/plugins/coreplugin/CMakeLists.txt +++ b/src/plugins/coreplugin/CMakeLists.txt @@ -1,13 +1,7 @@ -if (NOT IS_ABSOLUTE ${IDE_LOGO_PATH}) - set(IDE_LOGO_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${IDE_LOGO_PATH}") -endif() -configure_file(core_logo.qrc.cmakein core_logo_cmake.qrc) - add_qtc_plugin(Core DEPENDS Qt::PrintSupport Qt::Qml Qt::Sql Qt::Gui Qt::GuiPrivate PUBLIC_DEPENDS Aggregation ExtensionSystem Utils SOURCES - ${CMAKE_CURRENT_BINARY_DIR}/core_logo_cmake.qrc actionmanager/actioncontainer.cpp actionmanager/actioncontainer.h actionmanager/actioncontainer_p.h @@ -343,16 +337,6 @@ extend_qtc_plugin(Core DEFINES ENABLE_CRASHPAD ) -if ((NOT WIN32) AND (NOT APPLE)) - # install logo - foreach(size 16 24 32 48 64 128 256 512) - install( - FILES ${IDE_LOGO_PATH}/images/logo/${size}/QtProject-qtcreator.png - DESTINATION share/icons/hicolor/${size}x${size}/apps - ) - endforeach() -endif() - set(FONTS_BASE "${QtCreator_SOURCE_DIR}/src/share/3rdparty/studiofonts/") qt_add_resources(Core CoreWelcomeScreenFonts_rcc diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index 61d1b21a90c..1cd3fcb7b31 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -37,7 +37,6 @@ Project { "basefilewizardfactory.h", "core.qrc", "core_global.h", - "core_logo.qrc", "coreconstants.h", "coreicons.cpp", "coreicons.h", diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs index 6deee972959..9f4ab0a2fad 100644 --- a/src/plugins/plugins.qbs +++ b/src/plugins/plugins.qbs @@ -26,7 +26,6 @@ Project { "conan/conan.qbs", "copilot/copilot.qbs", "coreplugin/coreplugin.qbs", - "coreplugin/images/logo/logo.qbs", "cpaster/cpaster.qbs", "cpaster/frontend/frontend.qbs", "cppcheck/cppcheck.qbs", diff --git a/src/src.qbs b/src/src.qbs index b59d8843236..3d39fb7fcd6 100644 --- a/src/src.qbs +++ b/src/src.qbs @@ -8,6 +8,7 @@ Project { references: [ "app/app.qbs", "app/app_version_header.qbs", + "app/images/logo/logo.qbs", "libs/libs.qbs", "plugins/plugins.qbs", "tools/tools.qbs", From ac32f790f38eb91412183d5ced8caebdfd721a23 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 26 Jun 2023 10:55:09 +0200 Subject: [PATCH 0060/1777] Qbs build: Fix app_version generation Amends 6836caa14c247829bfd4edf47d31c87310d56211 which added a variable to app_version.h.cmake, but not to app_version.h.in. Fix by porting qbs to use app_version.h.cmake, which is the truth nowadays, instead of the app_version.h.in which originated from the qmake build. Change-Id: Ia9be53377a0bfded91ccd6ea1637eeda7fe9d5c8 Reviewed-by: Christian Stenger --- src/app/app_version.h.in | 54 ---------------------------------- src/app/app_version_header.qbs | 46 +++++++++++++---------------- 2 files changed, 21 insertions(+), 79 deletions(-) delete mode 100644 src/app/app_version.h.in diff --git a/src/app/app_version.h.in b/src/app/app_version.h.in deleted file mode 100644 index 605016b3762..00000000000 --- a/src/app/app_version.h.in +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -namespace Core { -namespace Constants { - -#define STRINGIFY_INTERNAL(x) #x -#define STRINGIFY(x) STRINGIFY_INTERNAL(x) - -const char IDE_DISPLAY_NAME[] = \"$${IDE_DISPLAY_NAME}\"; -const char IDE_ID[] = \"$${IDE_ID}\"; -const char IDE_CASED_ID[] = \"$${IDE_CASED_ID}\"; - -#define IDE_VERSION $${QTCREATOR_VERSION} -#define IDE_VERSION_STR STRINGIFY(IDE_VERSION) -#define IDE_VERSION_DISPLAY_DEF $${QTCREATOR_DISPLAY_VERSION} -#define IDE_VERSION_COMPAT_DEF $${QTCREATOR_COMPAT_VERSION} - -#define IDE_VERSION_MAJOR $$replace(QTCREATOR_VERSION, "^(\\d+)\\.\\d+\\.\\d+(-.*)?$", \\1) -#define IDE_VERSION_MINOR $$replace(QTCREATOR_VERSION, "^\\d+\\.(\\d+)\\.\\d+(-.*)?$", \\1) -#define IDE_VERSION_RELEASE $$replace(QTCREATOR_VERSION, "^\\d+\\.\\d+\\.(\\d+)(-.*)?$", \\1) - -const char IDE_VERSION_LONG[] = IDE_VERSION_STR; -const char IDE_VERSION_DISPLAY[] = STRINGIFY(IDE_VERSION_DISPLAY_DEF); -const char IDE_VERSION_COMPAT[] = STRINGIFY(IDE_VERSION_COMPAT_DEF); -const char IDE_AUTHOR[] = \"The Qt Company Ltd\"; -const char IDE_YEAR[] = \"$${QTCREATOR_COPYRIGHT_YEAR}\"; - -#ifdef IDE_REVISION -const char IDE_REVISION_STR[] = STRINGIFY(IDE_REVISION); -#else -const char IDE_REVISION_STR[] = \"\"; -#endif - -const char IDE_REVISION_URL[] = \"$${IDE_REVISION_URL}\"; - -// changes the path where the settings are saved to -#ifdef IDE_SETTINGSVARIANT -const char IDE_SETTINGSVARIANT_STR[] = STRINGIFY(IDE_SETTINGSVARIANT); -#else -const char IDE_SETTINGSVARIANT_STR[] = \"QtProject\"; -#endif - -#undef IDE_VERSION_COMPAT_DEF -#undef IDE_VERSION_DISPLAY_DEF -#undef IDE_VERSION -#undef IDE_VERSION_STR -#undef STRINGIFY -#undef STRINGIFY_INTERNAL - -} // Constants -} // Core diff --git a/src/app/app_version_header.qbs b/src/app/app_version_header.qbs index 110ec345403..4109f55f84b 100644 --- a/src/app/app_version_header.qbs +++ b/src/app/app_version_header.qbs @@ -6,15 +6,10 @@ Product { type: "hpp" Group { - files: ["app_version.h.in"] + files: ["app_version.h.cmakein"] fileTags: ["hpp.in"] } - Group { - name: "other" - files: "app_version.h.cmakein" - } - Depends { name: "qtc" } Rule { @@ -31,33 +26,34 @@ Product { cmd.sourceCode = function() { var file = new TextFile(input.filePath); var content = file.readAll(); - // replace quoted quotes - content = content.replace(/\\\"/g, '"'); // replace Windows line endings if (onWindows) content = content.replace(/\r\n/g, "\n"); // replace the magic qmake incantations - content = content.replace(/(\n#define IDE_VERSION_DISPLAY_DEF) .+\n/, "$1 " - + product.moduleProperty("qtc", "qtcreator_display_version") + "\n"); - content = content.replace(/(\n#define IDE_VERSION_COMPAT_DEF) .+\n/, "$1 " - + product.moduleProperty("qtc", "qtcreator_compat_version") + "\n"); - content = content.replace(/(\n#define IDE_VERSION) .+\n/, "$1 " - + product.moduleProperty("qtc", "qtcreator_version") + "\n"); - content = content.replace(/(\n#define IDE_VERSION_MAJOR) .+\n/, "$1 " - + product.moduleProperty("qtc", "ide_version_major") + "\n"); - content = content.replace(/(\n#define IDE_VERSION_MINOR) .+\n/, "$1 " - + product.moduleProperty("qtc", "ide_version_minor") + "\n"); - content = content.replace(/(\n#define IDE_VERSION_RELEASE) .+\n/, "$1 " - + product.moduleProperty("qtc", "ide_version_release") + "\n"); - content = content.replace("$${QTCREATOR_COPYRIGHT_YEAR}", + content = content.replace("${IDE_VERSION_DISPLAY}", + product.moduleProperty("qtc", "qtcreator_display_version")); + content = content.replace("${IDE_VERSION_COMPAT}", + product.moduleProperty("qtc", "qtcreator_compat_version")); + content = content.replace("${PROJECT_VERSION}", + product.moduleProperty("qtc", "qtcreator_version")); + content = content.replace("${PROJECT_VERSION_MAJOR}", + product.moduleProperty("qtc", "ide_version_major")); + content = content.replace("${PROJECT_VERSION_MINOR}", + product.moduleProperty("qtc", "ide_version_minor")); + content = content.replace("${PROJECT_VERSION_PATCH}", + product.moduleProperty("qtc", "ide_version_release")); + content = content.replace("${IDE_COPYRIGHT_YEAR}", product.moduleProperty("qtc", "qtcreator_copyright_year")); - content = content.replace("$${IDE_DISPLAY_NAME}", + content = content.replace("${IDE_DISPLAY_NAME}", product.moduleProperty("qtc", "ide_display_name")); - content = content.replace("$${IDE_ID}", + content = content.replace("${IDE_ID}", product.moduleProperty("qtc", "ide_id")); - content = content.replace("$${IDE_CASED_ID}", + content = content.replace("${IDE_CASED_ID}", product.moduleProperty("qtc", "ide_cased_id")); - content = content.replace("$${PROJECT_USER_FILE_EXTENSION}", + content = content.replace(/\n#cmakedefine IDE_REVISION\n/, ""); + content = content.replace("${IDE_REVISION_STR}", ""); + content = content.replace("${IDE_REVISION_URL}", ""); + content = content.replace("${PROJECT_USER_FILE_EXTENSION}", product.moduleProperty("qtc", "ide_user_file_extension")); file = new TextFile(output.filePath, TextFile.WriteOnly); file.truncate(); From 5bb49d4308868294910a972da2d88b8ef223d924 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 26 Jun 2023 17:17:49 +0200 Subject: [PATCH 0061/1777] qbs build: Consider IDE_SETTINGSVARIANT in app_version_header Amends ac32f790f38eb91412183d5ced8caebdfd721a23. Change-Id: Ifeb571daeb3006d6bea7c46a52e3f9526f33c3d0 Reviewed-by: Eike Ziller --- src/app/app_version_header.qbs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/app_version_header.qbs b/src/app/app_version_header.qbs index 4109f55f84b..dace34d4ede 100644 --- a/src/app/app_version_header.qbs +++ b/src/app/app_version_header.qbs @@ -55,6 +55,7 @@ Product { content = content.replace("${IDE_REVISION_URL}", ""); content = content.replace("${PROJECT_USER_FILE_EXTENSION}", product.moduleProperty("qtc", "ide_user_file_extension")); + content = content.replace("${IDE_SETTINGSVARIANT}", "QtProject"); file = new TextFile(output.filePath, TextFile.WriteOnly); file.truncate(); file.write(content); From 41fcca5cdd6b5e0e97aed20e99df8ab143110b17 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Jun 2023 13:38:23 +0200 Subject: [PATCH 0062/1777] Python: Hide some internals from PythonRunConfiguration API Change-Id: Ibed21265bf7099b06ea61751fb487b78e8071f34 Reviewed-by: Reviewed-by: David Schulz --- src/plugins/python/pythonrunconfiguration.cpp | 17 +++++++++-------- src/plugins/python/pythonrunconfiguration.h | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index a2ed429adbe..6fa59ba06a3 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -136,13 +136,14 @@ public: const Utils::FilePath &python, const QString &requestedPackageName); void updateExtraCompilers(); + void currentInterpreterChanged(); + Utils::FilePath m_pySideUicPath; PythonRunConfiguration *q; QList m_extraCompilers; QFutureWatcher m_watcher; QMetaObject::Connection m_watcherConnection; - }; PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) @@ -153,8 +154,8 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) interpreterAspect->setSettingsKey("PythonEditor.RunConfiguation.Interpreter"); interpreterAspect->setSettingsDialogId(Constants::C_PYTHONOPTIONS_PAGE_ID); - connect(interpreterAspect, &InterpreterAspect::changed, - this, &PythonRunConfiguration::currentInterpreterChanged); + connect(interpreterAspect, &InterpreterAspect::changed, this, + [this] { d->currentInterpreterChanged(); }); connect(PythonSettings::instance(), &PythonSettings::interpretersChanged, interpreterAspect, &InterpreterAspect::updateInterpreters); @@ -219,7 +220,7 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); connect(target, &Target::buildSystemUpdated, this, [this]() { d->updateExtraCompilers(); }); - currentInterpreterChanged(); + d->currentInterpreterChanged(); connect(PySideInstaller::instance(), &PySideInstaller::pySideInstalled, this, [this](const FilePath &python) { @@ -307,12 +308,12 @@ void PythonRunConfigurationPrivate::handlePySidePackageInfo(const PipPackageInfo pySideBuildStep->updatePySideProjectPath(pythonTools.pySideProjectPath); } -void PythonRunConfiguration::currentInterpreterChanged() +void PythonRunConfigurationPrivate::currentInterpreterChanged() { - const FilePath python = aspect()->currentInterpreter().command; - d->checkForPySide(python); + const FilePath python = q->aspect()->currentInterpreter().command; + checkForPySide(python); - for (FilePath &file : project()->files(Project::AllFiles)) { + for (FilePath &file : q->project()->files(Project::AllFiles)) { if (auto document = TextEditor::TextDocument::textDocumentForFilePath(file)) { if (document->mimeType() == Constants::C_PY_MIMETYPE || document->mimeType() == Constants::C_PY3_MIMETYPE) { diff --git a/src/plugins/python/pythonrunconfiguration.h b/src/plugins/python/pythonrunconfiguration.h index dc620ea898f..86d174af1a0 100644 --- a/src/plugins/python/pythonrunconfiguration.h +++ b/src/plugins/python/pythonrunconfiguration.h @@ -14,10 +14,11 @@ class PySideUicExtraCompiler; class PythonRunConfiguration : public ProjectExplorer::RunConfiguration { Q_OBJECT + public: PythonRunConfiguration(ProjectExplorer::Target *target, Utils::Id id); ~PythonRunConfiguration() override; - void currentInterpreterChanged(); + QList extraCompilers() const; private: From 646eb5118b216a3b43bded3496068ce84f0cff0b Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Tue, 27 Jun 2023 10:34:37 +0200 Subject: [PATCH 0063/1777] ClangFormat: Fix missing label in project settings Fixes: QTCREATORBUG-29323 Change-Id: Ia8c89ec6b8c745cac2bcb13a149667d9c3e08496 Reviewed-by: Christian Kandeler --- .../clangformat/clangformatglobalconfigwidget.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plugins/clangformat/clangformatglobalconfigwidget.cpp b/src/plugins/clangformat/clangformatglobalconfigwidget.cpp index bbca4c94007..0898109c1e8 100644 --- a/src/plugins/clangformat/clangformatglobalconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatglobalconfigwidget.cpp @@ -80,7 +80,6 @@ ClangFormatGlobalConfigWidget::ClangFormatGlobalConfigWidget( initFileSizeThresholdSpinBox(); if (project) { - m_formattingModeLabel->hide(); m_formatOnSave->hide(); m_formatWhileTyping->hide(); @@ -135,6 +134,11 @@ void ClangFormatGlobalConfigWidget::initUseGlobalSettingsCheckBox() const auto enableProjectSettings = [this] { const bool isDisabled = m_project && m_useGlobalSettings->isChecked(); m_indentingOrFormatting->setDisabled(isDisabled); + m_formattingModeLabel->setDisabled(isDisabled); + m_projectHasClangFormat->setDisabled( + isDisabled + || (m_indentingOrFormatting->currentIndex() + == static_cast(ClangFormatSettings::Mode::Disable))); m_overrideDefault->setDisabled(isDisabled || (m_indentingOrFormatting->currentIndex() == static_cast(ClangFormatSettings::Mode::Disable))); @@ -156,8 +160,10 @@ void ClangFormatGlobalConfigWidget::initFileSizeThresholdSpinBox() m_fileSizeThresholdSpinBox->setMaximum(std::numeric_limits::max()); m_fileSizeThresholdSpinBox->setSuffix(" KB"); m_fileSizeThresholdSpinBox->setValue(ClangFormatSettings::instance().fileSizeThreshold()); - if (m_project) + if (m_project) { m_fileSizeThresholdSpinBox->hide(); + m_fileSizeThresholdLabel->hide(); + } connect(m_indentingOrFormatting, &QComboBox::currentIndexChanged, this, [this](int index) { m_fileSizeThresholdLabel->setEnabled( @@ -198,6 +204,7 @@ void ClangFormatGlobalConfigWidget::initOverrideCheckBox() auto setEnableOverrideCheckBox = [this, setTemporarilyReadOnly](int index) { bool isDisable = index == static_cast(ClangFormatSettings::Mode::Disable); m_overrideDefault->setDisabled(isDisable); + m_projectHasClangFormat->setDisabled(isDisable); setTemporarilyReadOnly(); }; From a8cab6f5a19f1355e9de1d95354cb25baf62515d Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 5 Jun 2023 16:02:28 +0200 Subject: [PATCH 0064/1777] QmlEditorWidgets: Use LayoutBuilder in PreviewDialog Change-Id: Ic00c724e0787b51b3757b92d0d87dff8a6074c52 Reviewed-by: hjk --- .../contextpanewidgetimage.cpp | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp b/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp index 12ec4da3d51..38805264f93 100644 --- a/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp +++ b/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -901,11 +900,6 @@ PreviewDialog::PreviewDialog(QWidget *parent) : DragWidget(parent) setZoom(1); - QVBoxLayout *layout = new QVBoxLayout(this); - QHBoxLayout *horizontalLayout = new QHBoxLayout(); - QHBoxLayout *horizontalLayout2 = new QHBoxLayout(); - layout->setContentsMargins(2, 2, 2, 16); - layout->setSpacing(4); QToolButton *toolButton = new QToolButton(this); QIcon icon(style()->standardIcon(QStyle::SP_DockWidgetCloseButton)); toolButton->setIcon(icon); @@ -922,17 +916,14 @@ PreviewDialog::PreviewDialog(QWidget *parent) : DragWidget(parent) m_slider->setFixedWidth(80); m_zoomLabel->setFixedWidth(50); - horizontalLayout->addWidget(toolButton); - horizontalLayout->addSpacing(6); - horizontalLayout->addWidget(m_slider); - horizontalLayout->addSpacing(6); - horizontalLayout->addWidget(m_zoomLabel); - horizontalLayout->addStretch(1); - - layout->addLayout(horizontalLayout); - horizontalLayout2->addSpacing(24); - horizontalLayout2->addWidget(scrollArea); - layout->addLayout(horizontalLayout2); + using namespace Layouting; + Row { + Column { toolButton, st }, + Column { + Row { m_slider, m_zoomLabel, st }, + scrollArea, + } + }.attachTo(this); wheelFilter->setTarget(this); From ee143e0923bbac6cc33543779ea484870915c53f Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 27 Jun 2023 17:07:30 +0200 Subject: [PATCH 0065/1777] ProjectExplorer: Do not forbid removal of the last run configuration The presence of a run configuration is not technically required: E.g. if you disable auto-creation of run configurations in the settings, you won't have any in the first place. It therefore makes little sense to force users to keep at least one of them once they are there. Change-Id: I2ce0379ebc43f44326db53d324d4db9e9b92ef03 Reviewed-by: hjk --- src/plugins/projectexplorer/runsettingspropertiespage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index 43edee9b668..20b46f30544 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -144,7 +144,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target) : m_runConfigurationCombo->setModel(model); m_runConfigurationCombo->setCurrentIndex(model->indexFor(rc)); - m_removeRunToolButton->setEnabled(m_target->runConfigurations().size() > 1); + updateRemoveToolButton(); m_renameRunButton->setEnabled(rc); m_cloneRunButton->setEnabled(rc); @@ -188,7 +188,7 @@ void RunSettingsWidget::showAddRunConfigDialog() QTC_CHECK(newRC->id() == rci.factory->runConfigurationId()); m_target->addRunConfiguration(newRC); m_target->setActiveRunConfiguration(newRC); - m_removeRunToolButton->setEnabled(m_target->runConfigurations().size() > 1); + updateRemoveToolButton(); } void RunSettingsWidget::cloneRunConfiguration() @@ -226,7 +226,7 @@ void RunSettingsWidget::removeRunConfiguration() return; m_target->removeRunConfiguration(rc); - m_removeRunToolButton->setEnabled(m_target->runConfigurations().size() > 1); + updateRemoveToolButton(); m_renameRunButton->setEnabled(m_target->activeRunConfiguration()); m_cloneRunButton->setEnabled(m_target->activeRunConfiguration()); } @@ -370,7 +370,7 @@ void RunSettingsWidget::renameDeployConfiguration() void RunSettingsWidget::updateRemoveToolButton() { m_removeDeployToolButton->setEnabled(m_target->deployConfigurations().count() > 1); - m_removeRunToolButton->setEnabled(m_target->runConfigurations().size() > 1); + m_removeRunToolButton->setEnabled(!m_target->runConfigurations().isEmpty()); } void RunSettingsWidget::updateDeployConfiguration(DeployConfiguration *dc) From 4a51f57aa2c476ec31938654b9044f98a0ed7d96 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 26 Jun 2023 15:10:55 +0200 Subject: [PATCH 0066/1777] SearchResult: Get rid of requestEnabledCheck() Change-Id: Ide2cbda86caf28b41b6a2c7413f9a36ae4a8282d Reviewed-by: Eike Ziller Reviewed-by: Reviewed-by: Qt CI Bot --- src/plugins/coreplugin/find/searchresultwindow.cpp | 7 ------- src/plugins/coreplugin/find/searchresultwindow.h | 1 - src/plugins/texteditor/basefilefind.cpp | 3 +-- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp index e2a83a71a0e..5b3aa2ef457 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.cpp +++ b/src/plugins/coreplugin/find/searchresultwindow.cpp @@ -290,13 +290,6 @@ using namespace Core::Internal; This signal is emitted when the search status is set to \a paused. */ -/*! - \fn void Core::SearchResult::requestEnabledCheck() - - This signal is emitted when the enabled status of search results is - requested. -*/ - /*! \fn void Core::SearchResult::searchAgainRequested() diff --git a/src/plugins/coreplugin/find/searchresultwindow.h b/src/plugins/coreplugin/find/searchresultwindow.h index ae611926818..eb621ac43f9 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.h +++ b/src/plugins/coreplugin/find/searchresultwindow.h @@ -79,7 +79,6 @@ signals: void visibilityChanged(bool visible); void countChanged(int count); void searchAgainRequested(); - void requestEnabledCheck(); private: SearchResult(Internal::SearchResultWidget *widget); diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 94b43964179..5376c106176 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -333,8 +333,7 @@ void BaseFileFind::runNewSearch(const QString &txt, FindFlags findFlags, connect(search, &SearchResult::searchAgainRequested, this, [this, search] { searchAgain(search); }); - connect(this, &BaseFileFind::enabledChanged, search, &SearchResult::requestEnabledCheck); - connect(search, &SearchResult::requestEnabledCheck, this, [this, search] { + connect(this, &BaseFileFind::enabledChanged, search, [this, search] { recheckEnabled(search); }); From 9f6878ddabcffbe6f2083c3f0f3ffb0807d9e838 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 26 Jun 2023 16:01:57 +0200 Subject: [PATCH 0067/1777] CppEditor: Format code inserted by quickfixes Task-number: QTCREATORBUG-10807 Task-number: QTCREATORBUG-19158 Change-Id: Ieac52e1a1a10afad91fea56290e7dcfd1d302e7f Reviewed-by: Christian Kandeler Reviewed-by: David Schulz --- src/libs/utils/changeset.cpp | 6 +- .../cppeditor/cpprefactoringchanges.cpp | 9 +- src/plugins/texteditor/refactoringchanges.cpp | 97 ++++++++++++++++++- src/plugins/texteditor/refactoringchanges.h | 7 ++ 4 files changed, 112 insertions(+), 7 deletions(-) diff --git a/src/libs/utils/changeset.cpp b/src/libs/utils/changeset.cpp index fbdd45455d5..fa4e6696431 100644 --- a/src/libs/utils/changeset.cpp +++ b/src/libs/utils/changeset.cpp @@ -334,10 +334,8 @@ void ChangeSet::apply_helper() { // convert all ops to replace QList replaceList; - { - while (!m_operationList.isEmpty()) - convertToReplace(m_operationList.takeFirst(), &replaceList); - } + while (!m_operationList.isEmpty()) + convertToReplace(m_operationList.takeFirst(), &replaceList); // execute replaces if (m_cursor) diff --git a/src/plugins/cppeditor/cpprefactoringchanges.cpp b/src/plugins/cppeditor/cpprefactoringchanges.cpp index bb34174d06a..dcbb53f3b11 100644 --- a/src/plugins/cppeditor/cpprefactoringchanges.cpp +++ b/src/plugins/cppeditor/cpprefactoringchanges.cpp @@ -75,15 +75,20 @@ CppRefactoringFile::CppRefactoringFile(const FilePath &filePath, const QSharedPo { const Snapshot &snapshot = this->data()->m_snapshot; m_cppDocument = snapshot.document(filePath); + m_formattingEnabled = true; } CppRefactoringFile::CppRefactoringFile(QTextDocument *document, const FilePath &filePath) : RefactoringFile(document, filePath) -{ } +{ + m_formattingEnabled = true; +} CppRefactoringFile::CppRefactoringFile(TextEditor::TextEditorWidget *editor) : RefactoringFile(editor) -{ } +{ + m_formattingEnabled = true; +} Document::Ptr CppRefactoringFile::cppDocument() const { diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp index ba55628423d..dab0ebb41f2 100644 --- a/src/plugins/texteditor/refactoringchanges.cpp +++ b/src/plugins/texteditor/refactoringchanges.cpp @@ -340,12 +340,15 @@ bool RefactoringFile::apply() RefactoringChanges::rangesToSelections(doc, m_reindentRanges); m_reindentRanges.clear(); - // apply changes and reindent + // apply changes + setupFormattingRanges(m_changes.operationList()); m_changes.apply(&c); m_changes.clear(); + // Do indentation and formatting. indentOrReindent(indentSelections, Indent); indentOrReindent(reindentSelections, Reindent); + doFormatting(); c.endEditBlock(); @@ -391,6 +394,98 @@ void RefactoringFile::indentOrReindent(const RefactoringSelections &ranges, } } +void RefactoringFile::setupFormattingRanges(const QList &replaceList) +{ + if (!m_editor || !m_formattingEnabled) + return; + + for (const ChangeSet::EditOp &op : replaceList) { + QTextCursor cursor = m_editor->textCursor(); + switch (op.type) { + case ChangeSet::EditOp::Unset: + break; + case ChangeSet::EditOp::Replace: + case ChangeSet::EditOp::Insert: + case ChangeSet::EditOp::Remove: + cursor.setKeepPositionOnInsert(true); + cursor.setPosition(op.pos1 + op.length1); + cursor.setPosition(op.pos1, QTextCursor::KeepAnchor); + m_formattingCursors << cursor; + break; + case ChangeSet::EditOp::Flip: + case ChangeSet::EditOp::Move: + cursor.setKeepPositionOnInsert(true); + cursor.setPosition(op.pos1 + op.length1); + cursor.setPosition(op.pos1, QTextCursor::KeepAnchor); + m_formattingCursors << cursor; + cursor.setPosition(op.pos2 + op.length2); + cursor.setPosition(op.pos2, QTextCursor::KeepAnchor); + m_formattingCursors << cursor; + break; + case ChangeSet::EditOp::Copy: + cursor.setKeepPositionOnInsert(true); + cursor.setPosition(op.pos2, QTextCursor::KeepAnchor); + m_formattingCursors << cursor; + break; + } + } +} + +void RefactoringFile::doFormatting() +{ + if (m_formattingCursors.empty() || !m_editor) + return; + + RangesInLines formattingRanges; + + QTextCursor cursor = m_editor->textCursor(); + auto lineForPosition = [&](int pos) { + cursor.setPosition(pos); + return cursor.blockNumber() + 1; + }; + QList affectedLines; + for (const QTextCursor &formattingCursor : std::as_const(m_formattingCursors)) { + int startLine = lineForPosition(formattingCursor.selectionStart()); + int endLine = lineForPosition(formattingCursor.selectionEnd()); + for (int line = startLine; line <= endLine; ++line) { + const auto it = std::lower_bound(affectedLines.begin(), affectedLines.end(), line); + if (it == affectedLines.end() || *it > line) + affectedLines.insert(it, line); + } + } + + for (int line : std::as_const(affectedLines)) { + if (!formattingRanges.empty() && formattingRanges.back().endLine == line - 1) + formattingRanges.back().endLine = line; + else + formattingRanges.push_back({line, line}); + } + + static const QString clangFormatLineRemovalBlocker("// QTC_TEMP"); + for (const RangeInLines &r : std::as_const(formattingRanges)) { + QTextBlock b = m_editor->document()->findBlockByNumber(r.startLine - 1); + while (true) { + QTC_ASSERT(b.isValid(), break); + if (b.text().simplified().isEmpty()) + QTextCursor(b).insertText(clangFormatLineRemovalBlocker); + if (b.blockNumber() == r.endLine) + break; + b = b.next(); + } + } + m_editor->textDocument()->indenter()->format(formattingRanges); + for (QTextBlock b = m_editor->document()->findBlockByNumber( + formattingRanges.front().startLine - 1); b.isValid(); b = b.next()) { + QString blockText = b.text(); + if (blockText.remove(clangFormatLineRemovalBlocker) == b.text()) + continue; + QTextCursor c(b); + c.select(QTextCursor::LineUnderCursor); + c.removeSelectedText(); + c.insertText(blockText); + } +} + void RefactoringFile::fileChanged() { if (!m_filePath.isEmpty()) diff --git a/src/plugins/texteditor/refactoringchanges.h b/src/plugins/texteditor/refactoringchanges.h index bbe09d72754..f657095287a 100644 --- a/src/plugins/texteditor/refactoringchanges.h +++ b/src/plugins/texteditor/refactoringchanges.h @@ -3,6 +3,8 @@ #pragma once +#include "indenter.h" + #include #include #include @@ -75,6 +77,9 @@ protected: enum IndentType {Indent, Reindent}; void indentOrReindent(const RefactoringSelections &ranges, IndentType indent); + void setupFormattingRanges(const QList &replaceList); + void doFormatting(); + Utils::FilePath m_filePath; QSharedPointer m_data; mutable Utils::TextFileFormat m_textFileFormat; @@ -83,10 +88,12 @@ protected: Utils::ChangeSet m_changes; QList m_indentRanges; QList m_reindentRanges; + QList m_formattingCursors; bool m_openEditor = false; bool m_activateEditor = false; int m_editorCursorPosition = -1; bool m_appliedOnce = false; + bool m_formattingEnabled = false; friend class RefactoringChanges; // access to constructor }; From b5564b582089e2e75c5416785e48783bdc4a7a5e Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 24 May 2023 16:30:58 +0200 Subject: [PATCH 0068/1777] FileSearch: Add tests for findInFiles() taking FileContainer Change-Id: I752e8b443ac8a9c12b1fb209091727da6054a916 Reviewed-by: Eike Ziller --- tests/auto/filesearch/tst_filesearch.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/auto/filesearch/tst_filesearch.cpp b/tests/auto/filesearch/tst_filesearch.cpp index e4ce57b670f..f1a29339f0a 100644 --- a/tests/auto/filesearch/tst_filesearch.cpp +++ b/tests/auto/filesearch/tst_filesearch.cpp @@ -37,6 +37,7 @@ SearchResultItem searchResult(const FilePath &fileName, const QString &matchingL void test_helper(const FilePath &filePath, const SearchResultItems &expectedResults, const QString &term, Utils::FindFlags flags = {}) { + { FileIterator *it = new FileListIterator({filePath}, {QTextCodec::codecForLocale()}); QFutureWatcher watcher; QSignalSpy ready(&watcher, &QFutureWatcherBase::resultsReadyAt); @@ -48,6 +49,21 @@ void test_helper(const FilePath &filePath, const SearchResultItems &expectedResu QCOMPARE(results.count(), expectedResults.count()); for (int i = 0; i < expectedResults.size(); ++i) QCOMPARE(results.at(i), expectedResults.at(i)); + } + + { + const FileListContainer container({filePath}, {QTextCodec::codecForLocale()}); + QFutureWatcher watcher; + QSignalSpy ready(&watcher, &QFutureWatcherBase::resultsReadyAt); + watcher.setFuture(Utils::findInFiles(term, container, flags, {})); + watcher.future().waitForFinished(); + QTest::qWait(100); // process events + QCOMPARE(ready.count(), 1); + SearchResultItems results = watcher.resultAt(0); + QCOMPARE(results.count(), expectedResults.count()); + for (int i = 0; i < expectedResults.size(); ++i) + QCOMPARE(results.at(i), expectedResults.at(i)); + } } void tst_FileSearch::multipleResults() From b12ba08de0bd422659fe882ac4d5faf14d3fd207 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 19 Jun 2023 16:06:29 +0200 Subject: [PATCH 0069/1777] Build systems: Do not put qbs plugins under the qtcreator plugins dir Otherwise, the extension system will unnecessarily try to load them at start-up. Change-Id: I7a932904835cb387e3cf10924ca79a58e5f92b33 Reviewed-by: Eike Ziller --- cmake/QtCreatorAPIInternal.cmake | 2 +- qbs/modules/qbsbuildconfig/qbsbuildconfig.qbs | 7 +++++-- qbs/modules/qtc/qtc.qbs | 2 +- src/shared/CMakeLists.txt | 6 +++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index ecb6d17f360..0e990b58fbd 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -49,7 +49,7 @@ if (APPLE) set(_IDE_LIBRARY_BASE_PATH "Frameworks") set(_IDE_LIBRARY_PATH "${_IDE_OUTPUT_PATH}/${_IDE_LIBRARY_BASE_PATH}") - set(_IDE_PLUGIN_PATH "${_IDE_OUTPUT_PATH}/PlugIns") + set(_IDE_PLUGIN_PATH "${_IDE_OUTPUT_PATH}/PlugIns/qtcreator") set(_IDE_LIBEXEC_PATH "${_IDE_OUTPUT_PATH}/Resources/libexec") set(_IDE_DATA_PATH "${_IDE_OUTPUT_PATH}/Resources") set(_IDE_DOC_PATH "${_IDE_OUTPUT_PATH}/Resources/doc") diff --git a/qbs/modules/qbsbuildconfig/qbsbuildconfig.qbs b/qbs/modules/qbsbuildconfig/qbsbuildconfig.qbs index eca4f33508e..1ee8cef7a16 100644 --- a/qbs/modules/qbsbuildconfig/qbsbuildconfig.qbs +++ b/qbs/modules/qbsbuildconfig/qbsbuildconfig.qbs @@ -34,7 +34,10 @@ Module { ? ["@loader_path/" + FileInfo.relativePath('/' + appInstallDir, '/' + libInstallDir)] : ["$ORIGIN/..", "$ORIGIN/../" + qtc.ide_library_path] property string resourcesInstallDir: qtc.ide_data_path + "/qbs" - property string pluginsInstallDir: qtc.ide_plugin_path + "/qbs/plugins" + property string pluginsInstallBaseDir: qbs.targetOS.contains("darwin") + ? qtc.ide_plugin_path + "/.." + : qtc.ide_library_path + "/.." + property string pluginsInstallDir: pluginsInstallBaseDir + "/qbs/plugins" property string qmlTypeDescriptionsInstallDir: qtc.ide_data_path + "/qml-type-descriptions" property string appInstallDir: qtc.ide_bin_path property string libexecInstallDir: qtc.ide_libexec_path @@ -44,7 +47,7 @@ Module { property string relativeLibexecPath: FileInfo.relativePath('/' + appInstallDir, '/' + libexecInstallDir) property string relativePluginsPath: FileInfo.relativePath('/' + appInstallDir, - '/' + qtc.ide_plugin_path) + '/' + pluginsInstallBaseDir) property string relativeSearchPath: FileInfo.relativePath('/' + appInstallDir, '/' + resourcesInstallDir) } diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 8a78e329b07..75f85ab79dc 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -41,7 +41,7 @@ Module { } property string ide_plugin_path: { if (qbs.targetOS.contains("macos")) - return ide_app_target + ".app/Contents/PlugIns" + return ide_app_target + ".app/Contents/PlugIns/qtcreator" else if (qbs.targetOS.contains("windows")) return libDirName + "/qtcreator/plugins" else diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index 93409b0bf45..7dc20458d2d 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -19,7 +19,11 @@ if (BUILD_QBS) set(QBS_LIB_INSTALL_DIR "${IDE_LIBRARY_PATH}" CACHE STRING "" FORCE) set(QBS_DLL_INSTALL_DIR "${IDE_BIN_PATH}" CACHE STRING "" FORCE) set(QBS_LIBEXEC_INSTALL_DIR "${IDE_LIBEXEC_PATH}" CACHE STRING "" FORCE) - set(QBS_PLUGINS_INSTALL_BASE "${IDE_PLUGIN_PATH}" CACHE STRING "" FORCE) + if (APPLE) + set(QBS_PLUGINS_INSTALL_BASE "${IDE_PLUGIN_PATH}/../" CACHE STRING "" FORCE) + else() + set(QBS_PLUGINS_INSTALL_BASE "${_IDE_LIBRARY_BASE_PATH}/" CACHE STRING "" FORCE) + endif() set(QBS_RESOURCES_INSTALL_BASE "${IDE_DATA_PATH}/qbs" CACHE STRING "" FORCE) set(QBS_DOC_INSTALL_DIR "${IDE_DOC_PATH}" CACHE STRING "" FORCE) set(QBS_HEADERS_INSTALL_DIR "${IDE_DATA_PATH}/qbs/include/qbs" CACHE STRING "" FORCE) From 176ada90a8d5c286d12d8e85d087718d39fa5ba8 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 28 Jun 2023 09:55:53 +0200 Subject: [PATCH 0070/1777] BaseFileFind: Get rid of getAdditionalParameters() Remove recheckEnabled() and introduce setupSearch() virtual method. The latter is called just once per SearchResult instance (on first search), so we may store the additional parameter (current project file path) in lambda capture. Change-Id: I7683e818bec8f1d787bdb33c573248b252b47c78 Reviewed-by: Eike Ziller --- .../projectexplorer/currentprojectfind.cpp | 20 +++++++++++-------- .../projectexplorer/currentprojectfind.h | 2 +- src/plugins/texteditor/basefilefind.cpp | 17 +++++----------- src/plugins/texteditor/basefilefind.h | 3 +-- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index fb688ae2d5d..942a1dc6e70 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -83,16 +83,20 @@ void CurrentProjectFind::handleProjectChanged() emit displayNameChanged(); } -void CurrentProjectFind::recheckEnabled(Core::SearchResult *search) +void CurrentProjectFind::setupSearch(Core::SearchResult *search) { - const FilePath projectFile = FilePath::fromVariant(getAdditionalParameters(search)); - for (Project *project : ProjectManager::projects()) { - if (projectFile == project->projectFilePath()) { - search->setSearchAgainEnabled(true); - return; + Project *project = ProjectTree::currentProject(); + const FilePath projectFile = project ? project->projectFilePath() : FilePath(); + connect(this, &IFindFilter::enabledChanged, search, [search, projectFile] { + const QList projects = ProjectManager::projects(); + for (Project *project : projects) { + if (projectFile == project->projectFilePath()) { + search->setSearchAgainEnabled(true); + return; + } } - } - search->setSearchAgainEnabled(false); + search->setSearchAgainEnabled(false); + }); } void CurrentProjectFind::writeSettings(QSettings *settings) diff --git a/src/plugins/projectexplorer/currentprojectfind.h b/src/plugins/projectexplorer/currentprojectfind.h index 6554233d698..a2589bf2b9d 100644 --- a/src/plugins/projectexplorer/currentprojectfind.h +++ b/src/plugins/projectexplorer/currentprojectfind.h @@ -35,7 +35,7 @@ protected: private: void handleProjectChanged(); - void recheckEnabled(Core::SearchResult *search) override; + void setupSearch(Core::SearchResult *search) override; }; } // namespace Internal diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 5376c106176..efec7708720 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -313,6 +313,7 @@ void BaseFileFind::runNewSearch(const QString &txt, FindFlags findFlags, tooltip.arg(IFindFilter::descriptionForFindFlags(findFlags)), txt, searchMode, SearchResultWindow::PreserveCaseEnabled, QString::fromLatin1("TextEditor")); + setupSearch(search); search->setTextToReplace(txt); search->setSearchAgainSupported(true); FileFindParameters parameters; @@ -333,9 +334,6 @@ void BaseFileFind::runNewSearch(const QString &txt, FindFlags findFlags, connect(search, &SearchResult::searchAgainRequested, this, [this, search] { searchAgain(search); }); - connect(this, &BaseFileFind::enabledChanged, search, [this, search] { - recheckEnabled(search); - }); runSearch(search); } @@ -525,11 +523,11 @@ void BaseFileFind::searchAgain(SearchResult *search) runSearch(search); } -void BaseFileFind::recheckEnabled(SearchResult *search) +void BaseFileFind::setupSearch(SearchResult *search) { - if (!search) - return; - search->setSearchAgainEnabled(isEnabled()); + connect(this, &IFindFilter::enabledChanged, search, [this, search] { + search->setSearchAgainEnabled(isEnabled()); + }); } FilePaths BaseFileFind::replaceAll(const QString &text, const SearchResultItems &items, @@ -600,11 +598,6 @@ FilePaths BaseFileFind::replaceAll(const QString &text, const SearchResultItems return changes.keys(); } -QVariant BaseFileFind::getAdditionalParameters(SearchResult *search) -{ - return search->userData().value().additionalParameters; -} - QFuture BaseFileFind::executeSearch(const FileFindParameters ¶meters) { return d->m_searchEngines[parameters.searchEngineIndex]->executeSearch(parameters, this); diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index b5195947493..c92b857b577 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -101,7 +101,6 @@ public: protected: virtual QVariant additionalParameters() const = 0; - static QVariant getAdditionalParameters(Core::SearchResult *search); virtual QString label() const = 0; // see Core::SearchResultWindow::startNewSearch virtual QString toolTip() const = 0; // see Core::SearchResultWindow::startNewSearch, // add %1 placeholder where the find flags should be put @@ -126,7 +125,7 @@ private: void doReplace(const QString &txt, const Utils::SearchResultItems &items, bool preserveCase); void hideHighlightAll(bool visible); void searchAgain(Core::SearchResult *search); - virtual void recheckEnabled(Core::SearchResult *search); + virtual void setupSearch(Core::SearchResult *search); void runNewSearch(const QString &txt, Utils::FindFlags findFlags, Core::SearchResultWindow::SearchMode searchMode); From 0406f543eb584e07c3371fa4160c50d21fff397b Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 28 Jun 2023 16:11:16 +0200 Subject: [PATCH 0071/1777] ProjectExplorer: Allow users to remove all run configurations Change-Id: Ib70bb1a658edcd6996e98e391b9b938618747ed3 Reviewed-by: hjk --- .../runsettingspropertiespage.cpp | 46 ++++++++++++++----- .../runsettingspropertiespage.h | 4 +- src/plugins/projectexplorer/target.cpp | 14 ++++++ src/plugins/projectexplorer/target.h | 1 + 4 files changed, 52 insertions(+), 13 deletions(-) diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index 20b46f30544..1aeecabf956 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -53,6 +53,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target) : m_addRunToolButton = new QPushButton(Tr::tr("Add..."), this); m_removeRunToolButton = new QPushButton(Tr::tr("Remove"), this); + m_removeAllRunConfigsButton = new QPushButton(Tr::tr("Remove All"), this); m_renameRunButton = new QPushButton(Tr::tr("Rename..."), this); m_cloneRunButton = new QPushButton(Tr::tr("Clone..."), this); @@ -92,9 +93,10 @@ RunSettingsWidget::RunSettingsWidget(Target *target) : m_gridLayout->addWidget(m_runConfigurationCombo, 4, 1, 1, 1); m_gridLayout->addWidget(m_addRunToolButton, 4, 2, 1, 1); m_gridLayout->addWidget(m_removeRunToolButton, 4, 3, 1, 1); - m_gridLayout->addWidget(m_renameRunButton, 4, 4, 1, 1); - m_gridLayout->addWidget(m_cloneRunButton, 4, 5, 1, 1); - m_gridLayout->addItem(spacer1, 4, 6, 1, 1); + m_gridLayout->addWidget(m_removeAllRunConfigsButton, 4, 4, 1, 1); + m_gridLayout->addWidget(m_renameRunButton, 4, 5, 1, 1); + m_gridLayout->addWidget(m_cloneRunButton, 4, 6, 1, 1); + m_gridLayout->addItem(spacer1, 4, 7, 1, 1); m_gridLayout->addWidget(runWidget, 5, 0, 1, -1); m_gridLayout->addItem(spacer2, 6, 0, 1, 1); @@ -144,7 +146,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target) : m_runConfigurationCombo->setModel(model); m_runConfigurationCombo->setCurrentIndex(model->indexFor(rc)); - updateRemoveToolButton(); + updateRemoveToolButtons(); m_renameRunButton->setEnabled(rc); m_cloneRunButton->setEnabled(rc); @@ -156,20 +158,22 @@ RunSettingsWidget::RunSettingsWidget(Target *target) : this, &RunSettingsWidget::currentRunConfigurationChanged); connect(m_removeRunToolButton, &QAbstractButton::clicked, this, &RunSettingsWidget::removeRunConfiguration); + connect(m_removeAllRunConfigsButton, &QAbstractButton::clicked, + this, &RunSettingsWidget::removeAllRunConfigurations); connect(m_renameRunButton, &QAbstractButton::clicked, this, &RunSettingsWidget::renameRunConfiguration); connect(m_cloneRunButton, &QAbstractButton::clicked, this, &RunSettingsWidget::cloneRunConfiguration); connect(m_target, &Target::addedRunConfiguration, - this, &RunSettingsWidget::updateRemoveToolButton); + this, &RunSettingsWidget::updateRemoveToolButtons); connect(m_target, &Target::removedRunConfiguration, - this, &RunSettingsWidget::updateRemoveToolButton); + this, &RunSettingsWidget::updateRemoveToolButtons); connect(m_target, &Target::addedDeployConfiguration, - this, &RunSettingsWidget::updateRemoveToolButton); + this, &RunSettingsWidget::updateRemoveToolButtons); connect(m_target, &Target::removedDeployConfiguration, - this, &RunSettingsWidget::updateRemoveToolButton); + this, &RunSettingsWidget::updateRemoveToolButtons); connect(m_target, &Target::activeRunConfigurationChanged, this, &RunSettingsWidget::activeRunConfigurationChanged); @@ -188,7 +192,7 @@ void RunSettingsWidget::showAddRunConfigDialog() QTC_CHECK(newRC->id() == rci.factory->runConfigurationId()); m_target->addRunConfiguration(newRC); m_target->setActiveRunConfiguration(newRC); - updateRemoveToolButton(); + updateRemoveToolButtons(); } void RunSettingsWidget::cloneRunConfiguration() @@ -226,11 +230,27 @@ void RunSettingsWidget::removeRunConfiguration() return; m_target->removeRunConfiguration(rc); - updateRemoveToolButton(); + updateRemoveToolButtons(); m_renameRunButton->setEnabled(m_target->activeRunConfiguration()); m_cloneRunButton->setEnabled(m_target->activeRunConfiguration()); } +void RunSettingsWidget::removeAllRunConfigurations() +{ + QMessageBox msgBox(QMessageBox::Question, Tr::tr("Remove Run Configurations?"), + Tr::tr("Do you really want to delete all run configurations?"), + QMessageBox::Yes|QMessageBox::No, this); + msgBox.setDefaultButton(QMessageBox::No); + msgBox.setEscapeButton(QMessageBox::No); + if (msgBox.exec() == QMessageBox::No) + return; + + m_target->removeAllRunConfigurations(); + updateRemoveToolButtons(); + m_renameRunButton->setEnabled(false); + m_cloneRunButton->setEnabled(false); +} + void RunSettingsWidget::activeRunConfigurationChanged() { if (m_ignoreChanges.isLocked()) @@ -367,10 +387,12 @@ void RunSettingsWidget::renameDeployConfiguration() m_target->activeDeployConfiguration()->setDisplayName(name); } -void RunSettingsWidget::updateRemoveToolButton() +void RunSettingsWidget::updateRemoveToolButtons() { m_removeDeployToolButton->setEnabled(m_target->deployConfigurations().count() > 1); - m_removeRunToolButton->setEnabled(!m_target->runConfigurations().isEmpty()); + const bool hasRunConfigs = !m_target->runConfigurations().isEmpty(); + m_removeRunToolButton->setEnabled(hasRunConfigs); + m_removeAllRunConfigsButton->setEnabled(hasRunConfigs); } void RunSettingsWidget::updateDeployConfiguration(DeployConfiguration *dc) diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.h b/src/plugins/projectexplorer/runsettingspropertiespage.h index 00998e1817c..18db4568a45 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.h +++ b/src/plugins/projectexplorer/runsettingspropertiespage.h @@ -41,6 +41,7 @@ private: void showAddRunConfigDialog(); void cloneRunConfiguration(); void removeRunConfiguration(); + void removeAllRunConfigurations(); void activeRunConfigurationChanged(); void renameRunConfiguration(); void currentDeployConfigurationChanged(int index); @@ -49,7 +50,7 @@ private: void activeDeployConfigurationChanged(); void renameDeployConfiguration(); - void updateRemoveToolButton(); + void updateRemoveToolButtons(); QString uniqueDCName(const QString &name); QString uniqueRCName(const QString &name); @@ -82,6 +83,7 @@ private: QPushButton *m_removeDeployToolButton; QPushButton *m_addRunToolButton; QPushButton *m_removeRunToolButton; + QPushButton *m_removeAllRunConfigsButton; QPushButton *m_renameRunButton; QPushButton *m_cloneRunButton; QPushButton *m_renameDeployButton; diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index d2e59aab063..82d85f84e58 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -525,6 +525,20 @@ void Target::removeRunConfiguration(RunConfiguration *rc) delete rc; } +void Target::removeAllRunConfigurations() +{ + QList runConfigs = d->m_runConfigurations; + d->m_runConfigurations.clear(); + setActiveRunConfiguration(nullptr); + while (!runConfigs.isEmpty()) { + RunConfiguration * const rc = runConfigs.takeFirst(); + emit removedRunConfiguration(rc); + ProjectExplorerPlugin::targetSelector()->removedRunConfiguration(rc); + d->m_runConfigurationModel.removeProjectConfiguration(rc); + delete rc; + } +} + RunConfiguration *Target::activeRunConfiguration() const { return d->m_activeRunConfiguration; diff --git a/src/plugins/projectexplorer/target.h b/src/plugins/projectexplorer/target.h index aeca2fd9e0b..5cfb69eeca0 100644 --- a/src/plugins/projectexplorer/target.h +++ b/src/plugins/projectexplorer/target.h @@ -77,6 +77,7 @@ public: const QList runConfigurations() const; void addRunConfiguration(RunConfiguration *rc); void removeRunConfiguration(RunConfiguration *rc); + void removeAllRunConfigurations(); RunConfiguration *activeRunConfiguration() const; void setActiveRunConfiguration(RunConfiguration *rc); From 5867d986a8360dcf8d9d62678b3ce61de8bc4fbd Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jun 2023 10:48:37 +0200 Subject: [PATCH 0072/1777] Core: Drop Q_OBJECT from OptionsPopup Not needed. Also slim down header a bit. Change-Id: I6ac828fdfc42173e0b5aeca5d92e920745b424c9 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/find/optionspopup.cpp | 32 ++++++++++---------- src/plugins/coreplugin/find/optionspopup.h | 9 ------ 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/src/plugins/coreplugin/find/optionspopup.cpp b/src/plugins/coreplugin/find/optionspopup.cpp index af2e306037c..9f5f11ad2d0 100644 --- a/src/plugins/coreplugin/find/optionspopup.cpp +++ b/src/plugins/coreplugin/find/optionspopup.cpp @@ -18,6 +18,21 @@ using namespace Utils; namespace Core { +static QCheckBox *createCheckboxForCommand(QObject *owner, Id id) +{ + QAction *action = ActionManager::command(id)->action(); + QCheckBox *checkbox = new QCheckBox(action->text()); + checkbox->setToolTip(action->toolTip()); + checkbox->setChecked(action->isChecked()); + checkbox->setEnabled(action->isEnabled()); + checkbox->installEventFilter(owner); // enter key handling + QObject::connect(checkbox, &QCheckBox::clicked, action, &QAction::setChecked); + QObject::connect(action, &QAction::changed, checkbox, [action, checkbox] { + checkbox->setEnabled(action->isEnabled()); + }); + return checkbox; +} + /*! \class Core::OptionsPopup \inmodule QtCreator @@ -35,7 +50,7 @@ OptionsPopup::OptionsPopup(QWidget *parent, const QVector &commands) bool first = true; for (const Id &command : commands) { - QCheckBox *checkBox = createCheckboxForCommand(command); + QCheckBox *checkBox = createCheckboxForCommand(this, command); if (first) { checkBox->setFocus(); first = false; @@ -73,19 +88,4 @@ bool OptionsPopup::eventFilter(QObject *obj, QEvent *ev) return QWidget::eventFilter(obj, ev); } -QCheckBox *OptionsPopup::createCheckboxForCommand(Id id) -{ - QAction *action = ActionManager::command(id)->action(); - QCheckBox *checkbox = new QCheckBox(action->text()); - checkbox->setToolTip(action->toolTip()); - checkbox->setChecked(action->isChecked()); - checkbox->setEnabled(action->isEnabled()); - checkbox->installEventFilter(this); // enter key handling - QObject::connect(checkbox, &QCheckBox::clicked, action, &QAction::setChecked); - QObject::connect(action, &QAction::changed, checkbox, [action, checkbox] { - checkbox->setEnabled(action->isEnabled()); - }); - return checkbox; -} - } // namespace Core diff --git a/src/plugins/coreplugin/find/optionspopup.h b/src/plugins/coreplugin/find/optionspopup.h index 6331de8914f..3356dc50556 100644 --- a/src/plugins/coreplugin/find/optionspopup.h +++ b/src/plugins/coreplugin/find/optionspopup.h @@ -9,25 +9,16 @@ #include -QT_BEGIN_NAMESPACE -class QCheckBox; -QT_END_NAMESPACE - namespace Core { class CORE_EXPORT OptionsPopup : public QWidget { - Q_OBJECT - public: OptionsPopup(QWidget *parent, const QVector &commands); protected: bool event(QEvent *ev) override; bool eventFilter(QObject *obj, QEvent *ev) override; - -private: - QCheckBox *createCheckboxForCommand(Utils::Id id); }; } // namespace Core From 900ea82fd1a4a629768b71abaf9117f90b7fd951 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jun 2023 15:35:47 +0200 Subject: [PATCH 0073/1777] Core: Don't save settings on startup anymore Amends a68352f0135. This is getting in the way, it does not look needed, and it is lost in history why it ever was. Change-Id: I68ebdafc78e3259c73c64364607aef6eb74d2869 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/icore.cpp | 4 +--- src/plugins/coreplugin/icore.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 8716e21858f..2e9cf7657cc 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -192,9 +192,7 @@ ICore::ICore(MainWindow *mainwindow) { m_instance = this; m_mainwindow = mainwindow; - // Save settings once after all plugins are initialized: - connect(PluginManager::instance(), &PluginManager::initializationDone, - this, [] { ICore::saveSettings(ICore::InitializationDone); }); + connect(PluginManager::instance(), &PluginManager::testsFinished, this, [this](int failedTests) { emit coreAboutToClose(); diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index 0939356d4de..f595fb4ba88 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -117,7 +117,6 @@ public: static void restart(); enum SaveSettingsReason { - InitializationDone, SettingsDialogDone, ModeChanged, MainWindowClosing, From 379e7f906e6f1dd8656364f5a2cf4feed2127d0f Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Jun 2023 11:02:42 +0200 Subject: [PATCH 0074/1777] Utils: Rework aspect implementation This avoids some repetition and could be a step towards having type storage in (or rather accessible from) the base, so we can have aspects for more complex data (treemodels...) that are not easily converted to QVariant. Change-Id: I9797b3d5646195705212db1830d2b415291ac651 Reviewed-by: Christian Stenger --- src/libs/utils/aspects.cpp | 558 ++++++------------ src/libs/utils/aspects.h | 259 ++++---- src/plugins/autotest/gtest/gtestsettings.cpp | 6 +- .../clangformat/clangformatsettings.cpp | 2 +- .../cmakebuildconfiguration.cpp | 8 +- .../cmakebuildconfiguration.h | 1 - src/plugins/copilot/copilotoptionspage.cpp | 6 +- src/plugins/copilot/copilotplugin.cpp | 6 +- src/plugins/copilot/copilotsettings.cpp | 4 +- src/plugins/debugger/commonoptionspage.cpp | 2 +- src/plugins/debugger/console/console.cpp | 8 +- src/plugins/debugger/debuggeractions.cpp | 4 +- src/plugins/debugger/debuggeractions.h | 10 +- .../debuggersourcepathmappingwidget.cpp | 19 +- .../debugger/registerpostmortemaction.cpp | 2 +- src/plugins/fakevim/fakevimactions.cpp | 28 +- src/plugins/fakevim/fakevimactions.h | 58 +- src/plugins/fakevim/fakevimhandler.cpp | 8 +- src/plugins/fakevim/fakevimplugin.cpp | 12 +- src/plugins/git/gitplugin.cpp | 5 +- src/plugins/git/gitsettings.cpp | 4 +- src/plugins/nim/nimplugin.cpp | 7 +- src/plugins/perforce/perforcesettings.cpp | 11 +- src/plugins/perfprofiler/perfsettings.cpp | 4 +- .../buildpropertiessettings.cpp | 10 +- src/plugins/python/pythonwizardpage.cpp | 4 +- src/plugins/squish/squishsettings.cpp | 3 +- src/plugins/valgrind/memchecktool.cpp | 13 +- src/plugins/valgrind/valgrindsettings.cpp | 32 +- src/plugins/valgrind/valgrindsettings.h | 12 +- 30 files changed, 463 insertions(+), 643 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index d8fdd9f6f3d..5c1fd5cdb26 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -40,8 +40,6 @@ class BaseAspectPrivate { public: Id m_id; - QVariant m_value; - QVariant m_defaultValue; std::function m_toSettings; std::function m_fromSettings; @@ -99,7 +97,7 @@ BaseAspect::BaseAspect(AspectContainer *container) { if (container) container->registerAspect(this); - addDataExtractor(this, &BaseAspect::value, &Data::value); + addDataExtractor(this, &BaseAspect::variantValue, &Data::value); } /*! @@ -120,43 +118,49 @@ void BaseAspect::setId(Id id) d->m_id = id; } -QVariant BaseAspect::value() const +QVariant BaseAspect::variantValue() const { - return d->m_value; + return {}; } /*! Sets \a value. - Emits \c changed() if the value changed. + Prefer the typed setValue() of derived classes. */ -void BaseAspect::setValue(const QVariant &value) +void BaseAspect::setVariantValue(const QVariant &value) { - if (setValueQuietly(value)) { - emit changed(); - emitChangedValue(); - } + Q_UNUSED(value) + QTC_CHECK(false); +} + +void BaseAspect::setDefaultVariantValue(const QVariant &value) +{ + Q_UNUSED(value) + QTC_CHECK(false); } /*! - Sets \a value without emitting \c changed(). + \internal - Returns whether the value changed. + Sets \a value without emitting signals. + + Prefer the typed setValueQuietly() of derived classes. */ -bool BaseAspect::setValueQuietly(const QVariant &value) +void BaseAspect::setVariantValueQuietly(const QVariant &value) { - if (d->m_value == value) - return false; - d->m_value = value; - return true; + Q_UNUSED(value) + QTC_CHECK(false); } -QVariant BaseAspect::defaultValue() const +QVariant BaseAspect::defaultVariantValue() const { - return d->m_defaultValue; + return {}; } /*! + \fn TypedAspect::setDefaultValue(const ValueType &value) + Sets a default \a value and the current value for this aspect. \note The current value will be set silently to the same value. @@ -165,11 +169,6 @@ QVariant BaseAspect::defaultValue() const Default values will not be stored in settings. */ -void BaseAspect::setDefaultValue(const QVariant &value) -{ - d->m_defaultValue = value; - d->m_value = value; -} void BaseAspect::setDisplayName(const QString &displayName) { @@ -308,8 +307,12 @@ void BaseAspect::setEnabler(BoolAspect *checker) { QTC_ASSERT(checker, return); setEnabled(checker->value()); - connect(checker, &BoolAspect::volatileValueChanged, this, &BaseAspect::setEnabled); - connect(checker, &BoolAspect::valueChanged, this, &BaseAspect::setEnabled); + connect(checker, &BoolAspect::volatileValueChanged, this, [this, checker] { + BaseAspect::setEnabled(checker->volatileValue()); + }); + connect(checker, &BoolAspect::changed, this, [this, checker] { + BaseAspect::setEnabled(checker->volatileValue()); + }); } bool BaseAspect::isReadOnly() const @@ -442,15 +445,28 @@ void createItem(Layouting::LayoutItem *item, const BaseAspect *aspect) /*! Updates this aspect's value from user-initiated changes in the widget. - This has only an effect if \c isAutoApply is false. + Emits changed() if the value changed. */ void BaseAspect::apply() { - QTC_CHECK(!d->m_autoApply); - if (isDirty()) - setValue(volatileValue()); + if (silentApply()) { + if (hasAction()) + emit action()->triggered(variantValue().toBool()); + emit changed(); + } } +/*! + Updates this aspect's value from user-initiated changes in the widget. + + \returns whether the value changed. Does not emit signals. +*/ + +bool BaseAspect::silentApply() +{ + guiToInternal(); + return internalToExternal(); +} /*! Discard user changes in the widget and restore widget contents from aspect's value. @@ -459,9 +475,8 @@ void BaseAspect::apply() */ void BaseAspect::cancel() { - QTC_CHECK(!d->m_autoApply); - if (!d->m_subWidgets.isEmpty()) - setVolatileValue(d->m_value); + externalToInternal(); + internalToGui(); } void BaseAspect::finish() @@ -476,24 +491,9 @@ bool BaseAspect::hasAction() const return d->m_action != nullptr; } -bool BaseAspect::isDirty() const +bool BaseAspect::isDirty() { - QTC_CHECK(!isAutoApply()); - // Aspects that were never shown cannot contain unsaved user changes. - if (d->m_subWidgets.isEmpty()) - return false; - return volatileValue() != d->m_value; -} - -QVariant BaseAspect::volatileValue() const -{ - QTC_CHECK(!isAutoApply()); - return {}; -} - -void BaseAspect::setVolatileValue(const QVariant &val) -{ - Q_UNUSED(val); + return false; } void BaseAspect::registerSubWidget(QWidget *widget) @@ -534,8 +534,10 @@ void BaseAspect::saveToMap(QVariantMap &data, const QVariant &value, */ void BaseAspect::fromMap(const QVariantMap &map) { - const QVariant val = map.value(settingsKey(), toSettingsValue(defaultValue())); - setValue(fromSettingsValue(val)); + if (settingsKey().isEmpty()) + return; + const QVariant val = map.value(settingsKey(), toSettingsValue(defaultVariantValue())); + setVariantValue(fromSettingsValue(val)); } /*! @@ -543,7 +545,9 @@ void BaseAspect::fromMap(const QVariantMap &map) */ void BaseAspect::toMap(QVariantMap &map) const { - saveToMap(map, toSettingsValue(d->m_value), toSettingsValue(d->m_defaultValue), settingsKey()); + if (settingsKey().isEmpty()) + return; + saveToMap(map, toSettingsValue(variantValue()), toSettingsValue(defaultVariantValue()), settingsKey()); } void BaseAspect::readSettings(const QSettings *settings) @@ -551,7 +555,7 @@ void BaseAspect::readSettings(const QSettings *settings) if (settingsKey().isEmpty()) return; const QVariant &val = settings->value(settingsKey()); - setValue(val.isValid() ? fromSettingsValue(val) : defaultValue()); + setVariantValue(val.isValid() ? fromSettingsValue(val) : defaultVariantValue()); } void BaseAspect::writeSettings(QSettings *settings) const @@ -560,8 +564,8 @@ void BaseAspect::writeSettings(QSettings *settings) const return; QtcSettings::setValueWithDefault(settings, settingsKey(), - toSettingsValue(value()), - toSettingsValue(defaultValue())); + toSettingsValue(variantValue()), + toSettingsValue(defaultVariantValue())); } void BaseAspect::setFromSettingsTransformation(const SavedValueTransformation &transform) @@ -773,9 +777,8 @@ public: */ StringAspect::StringAspect(AspectContainer *container) - : BaseAspect(container), d(new Internal::StringAspectPrivate) + : TypedAspect(container), d(new Internal::StringAspectPrivate) { - setDefaultValue(QString()); setSpan(2, 1); // Default: Label + something addDataExtractor(this, &StringAspect::value, &Data::value); @@ -800,7 +803,7 @@ void StringAspect::setValueAcceptor(StringAspect::ValueAcceptor &&acceptor) */ QString StringAspect::value() const { - return BaseAspect::value().toString(); + return TypedAspect::value(); } /*! @@ -816,27 +819,13 @@ void StringAspect::setValue(const QString &val) if (d->m_valueAcceptor) { const std::optional tmp = d->m_valueAcceptor(value(), val); if (!tmp) { - update(); // Make sure the original value is retained in the UI + internalToGui(); // Make sure the original value is retained in the UI return; } processedValue = tmp.value(); } - if (BaseAspect::setValueQuietly(QVariant(processedValue))) { - update(); - emit changed(); - emit valueChanged(processedValue); - } -} - -QString StringAspect::defaultValue() const -{ - return BaseAspect::defaultValue().toString(); -} - -void StringAspect::setDefaultValue(const QString &val) -{ - BaseAspect::setDefaultValue(val); + TypedAspect::setValue(processedValue); } /*! @@ -845,7 +834,7 @@ void StringAspect::setDefaultValue(const QString &val) void StringAspect::fromMap(const QVariantMap &map) { if (!settingsKey().isEmpty()) - BaseAspect::setValueQuietly(map.value(settingsKey(), defaultValue())); + setValueQuietly(map.value(settingsKey(), defaultValue()).toString()); if (d->m_checker) d->m_checker->fromMap(map); } @@ -900,7 +889,7 @@ PathChooser *StringAspect::pathChooser() const void StringAspect::setShowToolTipOnLabel(bool show) { d->m_showToolTipOnLabel = show; - update(); + internalToGui(); } /*! @@ -1246,79 +1235,48 @@ void StringAspect::addToLayout(LayoutItem &parent) d->m_checker->addToLayout(parent); } -QVariant StringAspect::volatileValue() const -{ - switch (d->m_displayStyle) { - case PathChooserDisplay: - QTC_ASSERT(d->m_pathChooserDisplay, return {}); - if (d->m_pathChooserDisplay->filePath().isEmpty()) - return defaultValue(); - return d->m_pathChooserDisplay->filePath().toString(); - case LineEditDisplay: - QTC_ASSERT(d->m_lineEditDisplay, return {}); - if (d->m_lineEditDisplay->text().isEmpty()) - return defaultValue(); - return d->m_lineEditDisplay->text(); - case TextEditDisplay: - QTC_ASSERT(d->m_textEditDisplay, return {}); - if (d->m_textEditDisplay->document()->isEmpty()) - return defaultValue(); - return d->m_textEditDisplay->document()->toPlainText(); - case LabelDisplay: - break; - } - return {}; -} - -void StringAspect::setVolatileValue(const QVariant &val) +void StringAspect::guiToInternal() { switch (d->m_displayStyle) { case PathChooserDisplay: if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->setFilePath(FilePath::fromVariant(val)); + m_internal = d->m_pathChooserDisplay->lineEdit()->text(); break; case LineEditDisplay: if (d->m_lineEditDisplay) - d->m_lineEditDisplay->setText(val.toString()); + m_internal = d->m_lineEditDisplay->text(); break; case TextEditDisplay: if (d->m_textEditDisplay) - d->m_textEditDisplay->document()->setPlainText(val.toString()); - break; + m_internal = d->m_textEditDisplay->document()->toPlainText(); case LabelDisplay: break; } } -void StringAspect::emitChangedValue() +void StringAspect::internalToGui() { - emit valueChanged(value()); -} - -void StringAspect::update() -{ - const QString displayedString = d->m_displayFilter ? d->m_displayFilter(value()) : value(); - + const QString displayed = d->m_displayFilter ? d->m_displayFilter(m_internal) : m_internal; if (d->m_pathChooserDisplay) { - d->m_pathChooserDisplay->setFilePath(FilePath::fromUserInput(displayedString)); + d->m_pathChooserDisplay->lineEdit()->setText(displayed); d->updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data()); } if (d->m_lineEditDisplay) { - d->m_lineEditDisplay->setTextKeepingActiveCursor(displayedString); + d->m_lineEditDisplay->setTextKeepingActiveCursor(displayed); d->updateWidgetFromCheckStatus(this, d->m_lineEditDisplay.data()); } if (d->m_textEditDisplay) { const QString old = d->m_textEditDisplay->document()->toPlainText(); - if (displayedString != old) - d->m_textEditDisplay->setText(displayedString); + if (displayed != old) + d->m_textEditDisplay->setText(displayed); d->updateWidgetFromCheckStatus(this, d->m_textEditDisplay.data()); } if (d->m_labelDisplay) { - d->m_labelDisplay->setText(displayedString); - d->m_labelDisplay->setToolTip(d->m_showToolTipOnLabel ? displayedString : toolTip()); + d->m_labelDisplay->setText(displayed); + d->m_labelDisplay->setToolTip(d->m_showToolTipOnLabel ? displayed : toolTip()); } validateInput(); @@ -1342,11 +1300,11 @@ void StringAspect::makeCheckable(CheckBoxPlacement checkBoxPlacement, : BoolAspect::LabelPlacement::AtCheckBox); d->m_checker->setSettingsKey(checkerKey); - connect(d->m_checker.get(), &BoolAspect::changed, this, &StringAspect::update); + connect(d->m_checker.get(), &BoolAspect::changed, this, &StringAspect::internalToGui); connect(d->m_checker.get(), &BoolAspect::changed, this, &StringAspect::changed); connect(d->m_checker.get(), &BoolAspect::changed, this, &StringAspect::checkedChanged); - update(); + internalToGui(); } @@ -1384,12 +1342,10 @@ FilePathAspect::FilePathAspect(AspectContainer *container) */ ColorAspect::ColorAspect(AspectContainer *container) - : BaseAspect(container), d(new Internal::ColorAspectPrivate) + : TypedAspect(container), d(new Internal::ColorAspectPrivate) { setDefaultValue(QColor::fromRgb(0, 0, 0)); setSpan(1, 1); - - addDataExtractor(this, &ColorAspect::value, &Data::value); } ColorAspect::~ColorAspect() = default; @@ -1408,31 +1364,16 @@ void ColorAspect::addToLayout(Layouting::LayoutItem &parent) } } -QColor ColorAspect::value() const +void ColorAspect::internalToGui() { - return BaseAspect::value().value(); -} - -void ColorAspect::setValue(const QColor &value) -{ - if (BaseAspect::setValueQuietly(value)) - emit changed(); -} - -QVariant ColorAspect::volatileValue() const -{ - QTC_CHECK(!isAutoApply()); if (d->m_colorButton) - return d->m_colorButton->color(); - QTC_CHECK(false); - return {}; + m_internal = d->m_colorButton->color(); } -void ColorAspect::setVolatileValue(const QVariant &val) +void ColorAspect::guiToInternal() { - QTC_CHECK(!isAutoApply()); if (d->m_colorButton) - d->m_colorButton->setColor(val.value()); + d->m_colorButton->setColor(m_internal); } /*! @@ -1451,12 +1392,10 @@ void ColorAspect::setVolatileValue(const QVariant &val) BoolAspect::BoolAspect(AspectContainer *container) - : BaseAspect(container), d(new Internal::BoolAspectPrivate) + : TypedAspect(container), d(new Internal::BoolAspectPrivate) { setDefaultValue(false); setSpan(2, 1); - - addDataExtractor(this, &BoolAspect::value, &Data::value); } /*! @@ -1520,8 +1459,8 @@ std::function BoolAspect::groupChecker() QAction *BoolAspect::action() { if (hasAction()) - return BaseAspect::action(); - auto act = BaseAspect::action(); // Creates it. + return TypedAspect::action(); + auto act = TypedAspect::action(); // Creates it. act->setCheckable(true); act->setChecked(value()); act->setToolTip(toolTip()); @@ -1531,74 +1470,32 @@ QAction *BoolAspect::action() // in a menu like "Use FakeVim", isAutoApply() is false, and yet this // here can trigger. //QTC_CHECK(isAutoApply()); - setValue(newValue); + m_external = newValue; + externalToInternal(); + internalToGui(); }); return act; } -QVariant BoolAspect::volatileValue() const +void BoolAspect::guiToInternal() { if (d->m_button) - return d->m_button->isChecked(); - if (d->m_groupBox) - return d->m_groupBox->isChecked(); - QTC_CHECK(false); - return {}; -} - -void BoolAspect::setVolatileValue(const QVariant &val) -{ - if (d->m_button) - d->m_button->setChecked(val.toBool()); + m_internal = d->m_button->isChecked(); else if (d->m_groupBox) - d->m_groupBox->setChecked(val.toBool()); + m_internal = d->m_groupBox->isChecked(); } -void BoolAspect::emitChangedValue() +void BoolAspect::internalToGui() { - emit valueChanged(value()); -} - - -/*! - Returns the value of the boolean aspect as a boolean value. -*/ - -bool BoolAspect::value() const -{ - return BaseAspect::value().toBool(); -} - -void BoolAspect::setValue(bool value) -{ - if (BaseAspect::setValueQuietly(value)) { - if (d->m_button) - d->m_button->setChecked(value); - //qDebug() << "SetValue: Changing" << labelText() << " to " << value; - emit changed(); - //QTC_CHECK(!labelText().isEmpty()); - emit valueChanged(value); - //qDebug() << "SetValue: Changed" << labelText() << " to " << value; - if (hasAction()) { - //qDebug() << "SetValue: Triggering " << labelText() << "with" << value; - emit action()->triggered(value); - } - } -} - -bool BoolAspect::defaultValue() const -{ - return BaseAspect::defaultValue().toBool(); -} - -void BoolAspect::setDefaultValue(bool val) -{ - BaseAspect::setDefaultValue(val); + if (d->m_button) + d->m_button->setChecked(m_internal); + else if (d->m_groupBox) + d->m_groupBox->setChecked(m_internal); } void BoolAspect::setLabel(const QString &labelText, LabelPlacement labelPlacement) { - BaseAspect::setLabelText(labelText); + TypedAspect::setLabelText(labelText); d->m_labelPlacement = labelPlacement; } @@ -1627,7 +1524,7 @@ CheckableDecider BoolAspect::checkableDecider() */ SelectionAspect::SelectionAspect(AspectContainer *container) - : BaseAspect(container), d(new Internal::SelectionAspectPrivate) + : TypedAspect(container), d(new Internal::SelectionAspectPrivate) { setSpan(2, 1); } @@ -1683,25 +1580,26 @@ void SelectionAspect::addToLayout(Layouting::LayoutItem &parent) } } -QVariant SelectionAspect::volatileValue() const +void SelectionAspect::guiToInternal() { switch (d->m_displayStyle) { case DisplayStyle::RadioButtons: - QTC_ASSERT(d->m_buttonGroup, return {}); - return d->m_buttonGroup->checkedId(); + if (d->m_buttonGroup) + m_internal = d->m_buttonGroup->checkedId(); + break; case DisplayStyle::ComboBox: - QTC_ASSERT(d->m_comboBox, return {}); - return d->m_comboBox->currentIndex(); + if (d->m_comboBox) + m_internal = d->m_comboBox->currentIndex(); + break; } - return {}; } -void SelectionAspect::setVolatileValue(const QVariant &val) +void SelectionAspect::internalToGui() { switch (d->m_displayStyle) { case DisplayStyle::RadioButtons: { if (d->m_buttonGroup) { - QAbstractButton *button = d->m_buttonGroup->button(val.toInt()); + QAbstractButton *button = d->m_buttonGroup->button(m_internal); QTC_ASSERT(button, return); button->setChecked(true); } @@ -1709,7 +1607,7 @@ void SelectionAspect::setVolatileValue(const QVariant &val) } case DisplayStyle::ComboBox: if (d->m_comboBox) - d->m_comboBox->setCurrentIndex(val.toInt()); + d->m_comboBox->setCurrentIndex(m_internal); break; } } @@ -1727,22 +1625,6 @@ void SelectionAspect::setDisplayStyle(SelectionAspect::DisplayStyle style) d->m_displayStyle = style; } -int SelectionAspect::value() const -{ - return BaseAspect::value().toInt(); -} - -void SelectionAspect::setValue(int value) -{ - if (BaseAspect::setValueQuietly(value)) { - if (d->m_buttonGroup && 0 <= value && value < d->m_buttons.size()) - d->m_buttons.at(value)->setChecked(true); - else if (d->m_comboBox) - d->m_comboBox->setCurrentIndex(value); - emit changed(); - } -} - void SelectionAspect::setStringValue(const QString &val) { const int index = indexForDisplay(val); @@ -1750,20 +1632,15 @@ void SelectionAspect::setStringValue(const QString &val) setValue(index); } -int SelectionAspect::defaultValue() const -{ - return BaseAspect::defaultValue().toInt(); -} - void SelectionAspect::setDefaultValue(int val) { - BaseAspect::setDefaultValue(val); + TypedAspect::setDefaultValue(val); } // Note: This needs to be set after all options are added. void SelectionAspect::setDefaultValue(const QString &val) { - BaseAspect::setDefaultValue(indexForDisplay(val)); + TypedAspect::setDefaultValue(indexForDisplay(val)); } QString SelectionAspect::stringValue() const @@ -1830,7 +1707,7 @@ QVariant SelectionAspect::itemValueForIndex(int index) const */ MultiSelectionAspect::MultiSelectionAspect(AspectContainer *container) - : BaseAspect(container), d(new Internal::MultiSelectionAspectPrivate(this)) + : TypedAspect(container), d(new Internal::MultiSelectionAspectPrivate(this)) { setDefaultValue(QStringList()); setSpan(2, 1); @@ -1898,23 +1775,27 @@ void MultiSelectionAspect::setDisplayStyle(MultiSelectionAspect::DisplayStyle st d->m_displayStyle = style; } -QStringList MultiSelectionAspect::value() const +void MultiSelectionAspect::internalToGui() { - return BaseAspect::value().toStringList(); + if (d->m_listView) { + const int n = d->m_listView->count(); + QTC_CHECK(n == d->m_allValues.size()); + for (int i = 0; i != n; ++i) { + auto item = d->m_listView->item(i); + item->setCheckState(m_internal.contains(item->text()) ? Qt::Checked : Qt::Unchecked); + } + } } -void MultiSelectionAspect::setValue(const QStringList &value) +void MultiSelectionAspect::guiToInternal() { - if (BaseAspect::setValueQuietly(value)) { - if (d->m_listView) { - const int n = d->m_listView->count(); - QTC_CHECK(n == d->m_allValues.size()); - for (int i = 0; i != n; ++i) { - auto item = d->m_listView->item(i); - item->setCheckState(value.contains(item->text()) ? Qt::Checked : Qt::Unchecked); - } - } else { - emit changed(); + if (d->m_listView) { + m_internal.clear(); + for (const QString &val : std::as_const(d->m_allValues)) { + auto item = new QListWidgetItem(val, d->m_listView); + item->setFlags(item->flags() | Qt::ItemIsUserCheckable); + if (item->checkState() == Qt::Checked) + m_internal.append(item->text()); } } } @@ -1937,12 +1818,9 @@ void MultiSelectionAspect::setValue(const QStringList &value) // IntegerAspect IntegerAspect::IntegerAspect(AspectContainer *container) - : BaseAspect(container), d(new Internal::IntegerAspectPrivate) + : TypedAspect(container), d(new Internal::IntegerAspectPrivate) { - setDefaultValue(qint64(0)); setSpan(2, 1); - - addDataExtractor(this, &IntegerAspect::value, &Data::value); } /*! @@ -1974,41 +1852,16 @@ void IntegerAspect::addToLayout(Layouting::LayoutItem &parent) } } -QVariant IntegerAspect::volatileValue() const +void IntegerAspect::guiToInternal() { - QTC_CHECK(!isAutoApply()); - QTC_ASSERT(d->m_spinBox, return {}); - return d->m_spinBox->value() * d->m_displayScaleFactor; -} - -void IntegerAspect::setVolatileValue(const QVariant &val) -{ - QTC_CHECK(!isAutoApply()); if (d->m_spinBox) - d->m_spinBox->setValue(int(val.toLongLong() / d->m_displayScaleFactor)); + m_internal = d->m_spinBox->value() * d->m_displayScaleFactor; } -qint64 IntegerAspect::value() const +void IntegerAspect::internalToGui() { - return BaseAspect::value().toLongLong(); -} - -void IntegerAspect::setValue(qint64 value) -{ - if (BaseAspect::setValueQuietly(value)) { - if (d->m_spinBox) - d->m_spinBox->setValue(value / d->m_displayScaleFactor); - //qDebug() << "SetValue: Changing" << labelText() << " to " << value; - emit changed(); - //QTC_CHECK(!labelText().isEmpty()); - emit valueChanged(value); - //qDebug() << "SetValue: Changed" << labelText() << " to " << value; - } -} - -qint64 IntegerAspect::defaultValue() const -{ - return BaseAspect::defaultValue().toLongLong(); + if (d->m_spinBox) + d->m_spinBox->setValue(m_internal / d->m_displayScaleFactor); } void IntegerAspect::setRange(qint64 min, qint64 max) @@ -2042,11 +1895,6 @@ void IntegerAspect::setDisplayScaleFactor(qint64 factor) d->m_displayScaleFactor = factor; } -void IntegerAspect::setDefaultValue(qint64 defaultValue) -{ - BaseAspect::setDefaultValue(defaultValue); -} - void IntegerAspect::setSpecialValueText(const QString &specialText) { d->m_specialValueText = specialText; @@ -2073,7 +1921,7 @@ void IntegerAspect::setSingleStep(qint64 step) */ DoubleAspect::DoubleAspect(AspectContainer *container) - : BaseAspect(container), d(new Internal::DoubleAspectPrivate) + : TypedAspect(container), d(new Internal::DoubleAspectPrivate) { setDefaultValue(double(0)); setSpan(2, 1); @@ -2097,7 +1945,7 @@ void DoubleAspect::addToLayout(LayoutItem &builder) d->m_spinBox->setSpecialValueText(d->m_specialValueText); if (d->m_maximumValue && d->m_maximumValue) d->m_spinBox->setRange(d->m_minimumValue.value(), d->m_maximumValue.value()); - d->m_spinBox->setValue(value()); // Must happen after setRange()! + internalToGui(); // Must happen after setRange()! addLabeledItem(builder, d->m_spinBox); if (isAutoApply()) { @@ -2106,33 +1954,16 @@ void DoubleAspect::addToLayout(LayoutItem &builder) } } -QVariant DoubleAspect::volatileValue() const +void DoubleAspect::guiToInternal() { - QTC_CHECK(!isAutoApply()); - QTC_ASSERT(d->m_spinBox, return {}); - return d->m_spinBox->value(); -} - -void DoubleAspect::setVolatileValue(const QVariant &val) -{ - QTC_CHECK(!isAutoApply()); if (d->m_spinBox) - d->m_spinBox->setValue(val.toDouble()); + m_internal = d->m_spinBox->value(); } -double DoubleAspect::value() const +void DoubleAspect::internalToGui() { - return BaseAspect::value().toDouble(); -} - -void DoubleAspect::setValue(double value) -{ - BaseAspect::setValue(value); -} - -double DoubleAspect::defaultValue() const -{ - return BaseAspect::defaultValue().toDouble(); + if (d->m_spinBox) + d->m_spinBox->setValue(m_internal); } void DoubleAspect::setRange(double min, double max) @@ -2151,11 +1982,6 @@ void DoubleAspect::setSuffix(const QString &suffix) d->m_suffix = suffix; } -void DoubleAspect::setDefaultValue(double defaultValue) -{ - BaseAspect::setDefaultValue(defaultValue); -} - void DoubleAspect::setSpecialValueText(const QString &specialText) { d->m_specialValueText = specialText; @@ -2192,7 +2018,7 @@ TriStateAspect::TriStateAspect(AspectContainer *container, TriState TriStateAspect::value() const { - return TriState::fromVariant(BaseAspect::value()); + return TriState::fromInt(SelectionAspect::value()); } void TriStateAspect::setValue(TriState value) @@ -2202,12 +2028,12 @@ void TriStateAspect::setValue(TriState value) TriState TriStateAspect::defaultValue() const { - return TriState::fromVariant(BaseAspect::defaultValue()); + return TriState::fromInt(SelectionAspect::defaultValue()); } void TriStateAspect::setDefaultValue(TriState value) { - BaseAspect::setDefaultValue(value.toVariant()); + SelectionAspect::setDefaultValue(value.toInt()); } const TriState TriState::Enabled{TriState::EnabledValue}; @@ -2216,7 +2042,11 @@ const TriState TriState::Default{TriState::DefaultValue}; TriState TriState::fromVariant(const QVariant &variant) { - int v = variant.toInt(); + return fromInt(variant.toInt()); +} + +TriState TriState::fromInt(int v) +{ QTC_ASSERT(v == EnabledValue || v == DisabledValue || v == DefaultValue, v = DefaultValue); return TriState(Value(v)); } @@ -2231,7 +2061,7 @@ TriState TriState::fromVariant(const QVariant &variant) */ StringListAspect::StringListAspect(AspectContainer *container) - : BaseAspect(container), d(new Internal::StringListAspectPrivate) + : TypedAspect(container), d(new Internal::StringListAspectPrivate) { setDefaultValue(QStringList()); } @@ -2250,16 +2080,6 @@ void StringListAspect::addToLayout(LayoutItem &parent) // TODO - when needed. } -QStringList StringListAspect::value() const -{ - return BaseAspect::value().toStringList(); -} - -void StringListAspect::setValue(const QStringList &value) -{ - BaseAspect::setValue(value); -} - void StringListAspect::appendValue(const QString &s, bool allowDuplicates) { QStringList val = value(); @@ -2303,10 +2123,8 @@ void StringListAspect::removeValues(const QStringList &values) */ IntegersAspect::IntegersAspect(AspectContainer *container) - : BaseAspect(container) -{ - setDefaultValue({}); -} + : TypedAspect(container) +{} /*! \internal @@ -2322,33 +2140,6 @@ void IntegersAspect::addToLayout(Layouting::LayoutItem &parent) // TODO - when needed. } -void IntegersAspect::emitChangedValue() -{ - emit valueChanged(value()); -} - -QList IntegersAspect::value() const -{ - return transform(BaseAspect::value().toList(), - [](QVariant v) { return v.toInt(); }); -} - -void IntegersAspect::setValue(const QList &value) -{ - BaseAspect::setValue(transform(value, [](int i) { return QVariant::fromValue(i); })); -} - -QList IntegersAspect::defaultValue() const -{ - return transform(BaseAspect::defaultValue().toList(), - [](QVariant v) { return v.toInt(); }); -} - -void IntegersAspect::setDefaultValue(const QList &value) -{ - BaseAspect::setDefaultValue(transform(value, [](int i) { return QVariant::fromValue(i); })); -} - /*! \class Utils::TextDisplay @@ -2576,7 +2367,7 @@ void AspectContainer::finish() void AspectContainer::reset() { for (BaseAspect *aspect : std::as_const(d->m_items)) - aspect->setValueQuietly(aspect->defaultValue()); + aspect->setVariantValueQuietly(aspect->defaultVariantValue()); } void AspectContainer::setAutoApply(bool on) @@ -2633,6 +2424,41 @@ BaseAspect::Data::Ptr BaseAspect::extractData() const return Data::Ptr(data); } +/* + Mirrors the internal volatile value to the GUI element if they are already + created. + + No-op otherwise. +*/ +void BaseAspect::internalToGui() +{} + +/* + Mirrors the data stored in GUI element if they are already created to + the internal volatile value. + + No-op otherwise. +*/ +void BaseAspect::guiToInternal() +{} + +/* + Mirrors internal volatile value to the externally visible value. + This function is used for \c apply(). + + \returns whether the value changes. +*/ +bool BaseAspect::internalToExternal() +{ + return false; +} + +/* + Mirrors externally visible value to internal volatile value. +*/ +void BaseAspect::externalToInternal() +{} + void BaseAspect::addDataExtractorHelper(const DataExtractor &extractor) const { d->m_dataExtractors.append(extractor); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 3c69306214d..cc603edf545 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -51,12 +51,12 @@ public: Id id() const; void setId(Id id); - QVariant value() const; - void setValue(const QVariant &value); - bool setValueQuietly(const QVariant &value); + virtual QVariant variantValue() const; + virtual void setVariantValue(const QVariant &value); + virtual void setVariantValueQuietly(const QVariant &value); - QVariant defaultValue() const; - void setDefaultValue(const QVariant &value); + virtual QVariant defaultVariantValue() const; + virtual void setDefaultVariantValue(const QVariant &value); QString settingsKey() const; void setSettingsKey(const QString &settingsKey); @@ -100,10 +100,6 @@ public: virtual void addToLayout(Layouting::LayoutItem &parent); - virtual QVariant volatileValue() const; - virtual void setVolatileValue(const QVariant &val); - virtual void emitChangedValue() {} - virtual void readSettings(const QSettings *settings); virtual void writeSettings(QSettings *settings) const; @@ -114,9 +110,10 @@ public: QVariant fromSettingsValue(const QVariant &val) const; virtual void apply(); + virtual bool silentApply(); virtual void cancel(); virtual void finish(); - virtual bool isDirty() const; + virtual bool isDirty(); bool hasAction() const; class QTCREATOR_UTILS_EXPORT Data @@ -164,9 +161,15 @@ public: signals: void changed(); + void volatileValueChanged(); void labelLinkActivated(const QString &link); protected: + virtual void internalToGui(); + virtual void guiToInternal(); + virtual bool internalToExternal(); + virtual void externalToInternal(); + QLabel *label() const; void setupLabel(); void addLabeledItem(Layouting::LayoutItem &parent, QWidget *widget); @@ -208,7 +211,112 @@ private: QTCREATOR_UTILS_EXPORT void createItem(Layouting::LayoutItem *item, const BaseAspect &aspect); QTCREATOR_UTILS_EXPORT void createItem(Layouting::LayoutItem *item, const BaseAspect *aspect); -class QTCREATOR_UTILS_EXPORT BoolAspect : public BaseAspect +template +class TypedAspect : public BaseAspect +{ +public: + TypedAspect(AspectContainer *container = nullptr) + : BaseAspect(container) + { + addDataExtractor(this, &TypedAspect::value, &Data::value); + } + + struct Data : BaseAspect::Data + { + ValueType value; + }; + + ValueType operator()() const { return m_external; } + ValueType value() const { return m_external; } + ValueType defaultValue() const { return m_default; } + + void setDefaultValue(const ValueType &value) + { + m_default = value; + setValue(value); + } + + void setValue(const ValueType &value) + { + m_external = value; + if (isDirty()) { + externalToInternal(); + internalToGui(); + } + } + + void setValueQuietly(const ValueType &value) + { + m_external = value; + if (isDirty()) { + externalToInternal(); + internalToGui(); + } + } + + void setVolatileValue(const ValueType &value) + { + m_internal = value; + internalToGui(); + } + + ValueType volatileValue() const + { + const_cast(this)->guiToInternal(); + return m_internal; + } + +protected: + bool isDirty() override + { + guiToInternal(); + return m_internal != m_external; + } + + bool internalToExternal() override + { + if (m_external == m_internal) + return false; + m_external = m_internal; + return true; + } + + void externalToInternal() override + { + m_internal = m_external; + } + + QVariant variantValue() const override + { + return QVariant::fromValue(m_external); + } + + void setVariantValue(const QVariant &value) override + { + setValue(value.value()); + } + + void setVariantValueQuietly(const QVariant &value) override + { + setValueQuietly(value.value()); + } + + QVariant defaultVariantValue() const override + { + return QVariant::fromValue(m_default); + } + + void setDefaultVariantValue(const QVariant &value) override + { + m_default = value.value(); + } + + ValueType m_default{}; + ValueType m_external{}; + ValueType m_internal{}; +}; + +class QTCREATOR_UTILS_EXPORT BoolAspect : public TypedAspect { Q_OBJECT @@ -216,27 +324,12 @@ public: BoolAspect(AspectContainer *container = nullptr); ~BoolAspect() override; - struct Data : BaseAspect::Data - { - bool value; - }; - void addToLayout(Layouting::LayoutItem &parent) override; std::function groupChecker(); Utils::CheckableDecider checkableDecider(); QAction *action() override; - QVariant volatileValue() const override; - void setVolatileValue(const QVariant &val) override; - void emitChangedValue() override; - - bool operator()() const { return value(); } - bool value() const; - void setValue(bool val); - bool defaultValue() const; - void setDefaultValue(bool val); - enum class LabelPlacement { AtCheckBox, AtCheckBoxWithoutDummyLabel, InExtraLabel }; void setLabel(const QString &labelText, LabelPlacement labelPlacement = LabelPlacement::InExtraLabel); @@ -244,15 +337,14 @@ public: void adoptButton(QAbstractButton *button); -signals: - void valueChanged(bool newValue); - void volatileValueChanged(bool newValue); - private: + void internalToGui() override; + void guiToInternal() override; + std::unique_ptr d; }; -class QTCREATOR_UTILS_EXPORT ColorAspect : public BaseAspect +class QTCREATOR_UTILS_EXPORT ColorAspect : public TypedAspect { Q_OBJECT @@ -260,24 +352,16 @@ public: ColorAspect(AspectContainer *container = nullptr); ~ColorAspect() override; - struct Data : BaseAspect::Data - { - QColor value; - }; - void addToLayout(Layouting::LayoutItem &parent) override; - QColor value() const; - void setValue(const QColor &val); - - QVariant volatileValue() const override; - void setVolatileValue(const QVariant &val) override; - private: + void internalToGui() override; + void guiToInternal() override; + std::unique_ptr d; }; -class QTCREATOR_UTILS_EXPORT SelectionAspect : public BaseAspect +class QTCREATOR_UTILS_EXPORT SelectionAspect : public TypedAspect { Q_OBJECT @@ -286,20 +370,13 @@ public: ~SelectionAspect() override; void addToLayout(Layouting::LayoutItem &parent) override; - QVariant volatileValue() const override; - void setVolatileValue(const QVariant &val) override; void finish() override; - int operator()() const { return value(); } - int value() const; - void setValue(int val); - QString stringValue() const; void setStringValue(const QString &val); - int defaultValue() const; - void setDefaultValue(int val); void setDefaultValue(const QString &val); + void setDefaultValue(int val); QVariant itemValue() const; @@ -325,14 +402,15 @@ public: int indexForItemValue(const QVariant &value) const; QVariant itemValueForIndex(int index) const; -signals: - void volatileValueChanged(int newValue); +protected: + void internalToGui() override; + void guiToInternal() override; private: std::unique_ptr d; }; -class QTCREATOR_UTILS_EXPORT MultiSelectionAspect : public BaseAspect +class QTCREATOR_UTILS_EXPORT MultiSelectionAspect : public TypedAspect { Q_OBJECT @@ -345,17 +423,18 @@ public: enum class DisplayStyle { ListView }; void setDisplayStyle(DisplayStyle style); - QStringList value() const; - void setValue(const QStringList &val); - QStringList allValues() const; void setAllValues(const QStringList &val); +protected: + void internalToGui() override; + void guiToInternal() override; + private: std::unique_ptr d; }; -class QTCREATOR_UTILS_EXPORT StringAspect : public BaseAspect +class QTCREATOR_UTILS_EXPORT StringAspect : public TypedAspect { Q_OBJECT @@ -371,21 +450,13 @@ public: void addToLayout(Layouting::LayoutItem &parent) override; - QVariant volatileValue() const override; - void setVolatileValue(const QVariant &val) override; - void emitChangedValue() override; - // Hook between UI and StringAspect: using ValueAcceptor = std::function(const QString &, const QString &)>; void setValueAcceptor(ValueAcceptor &&acceptor); - QString operator()() const { return value(); } QString value() const; void setValue(const QString &val); - QString defaultValue() const; - void setDefaultValue(const QString &val); - void setShowToolTipOnLabel(bool show); void setDisplayFilter(const std::function &displayFilter); @@ -438,10 +509,10 @@ public: signals: void checkedChanged(); - void valueChanged(const QString &newValue); protected: - void update(); + void internalToGui() override; + void guiToInternal() override; std::unique_ptr d; }; @@ -454,7 +525,7 @@ public: FilePath operator()() const { return filePath(); } }; -class QTCREATOR_UTILS_EXPORT IntegerAspect : public BaseAspect +class QTCREATOR_UTILS_EXPORT IntegerAspect : public TypedAspect { Q_OBJECT @@ -464,16 +535,6 @@ public: void addToLayout(Layouting::LayoutItem &parent) override; - QVariant volatileValue() const override; - void setVolatileValue(const QVariant &val) override; - - qint64 operator()() const { return value(); } - qint64 value() const; - void setValue(qint64 val); - - qint64 defaultValue() const; - void setDefaultValue(qint64 defaultValue); - void setRange(qint64 min, qint64 max); void setLabel(const QString &label); // FIXME: Use setLabelText void setPrefix(const QString &prefix); @@ -485,14 +546,15 @@ public: struct Data : BaseAspect::Data { qint64 value = 0; }; -signals: - void valueChanged(int newValue); +protected: + void internalToGui() override; + void guiToInternal() override; private: std::unique_ptr d; }; -class QTCREATOR_UTILS_EXPORT DoubleAspect : public BaseAspect +class QTCREATOR_UTILS_EXPORT DoubleAspect : public TypedAspect { Q_OBJECT @@ -502,22 +564,16 @@ public: void addToLayout(Layouting::LayoutItem &parent) override; - QVariant volatileValue() const override; - void setVolatileValue(const QVariant &val) override; - - double operator()() const { return value(); } - double value() const; - void setValue(double val); - - double defaultValue() const; - void setDefaultValue(double defaultValue); - void setRange(double min, double max); void setPrefix(const QString &prefix); void setSuffix(const QString &suffix); void setSpecialValueText(const QString &specialText); void setSingleStep(double step); +protected: + void internalToGui() override; + void guiToInternal() override; + private: std::unique_ptr d; }; @@ -532,6 +588,7 @@ public: int toInt() const { return int(m_value); } QVariant toVariant() const { return int(m_value); } + static TriState fromInt(int value); static TriState fromVariant(const QVariant &variant); static const TriState Enabled; @@ -562,7 +619,7 @@ public: void setDefaultValue(TriState setting); }; -class QTCREATOR_UTILS_EXPORT StringListAspect : public BaseAspect +class QTCREATOR_UTILS_EXPORT StringListAspect : public TypedAspect { Q_OBJECT @@ -572,9 +629,6 @@ public: void addToLayout(Layouting::LayoutItem &parent) override; - QStringList value() const; - void setValue(const QStringList &val); - void appendValue(const QString &value, bool allowDuplicates = true); void removeValue(const QString &value); void appendValues(const QStringList &values, bool allowDuplicates = true); @@ -584,7 +638,7 @@ private: std::unique_ptr d; }; -class QTCREATOR_UTILS_EXPORT IntegersAspect : public BaseAspect +class QTCREATOR_UTILS_EXPORT IntegersAspect : public TypedAspect> { Q_OBJECT @@ -593,17 +647,6 @@ public: ~IntegersAspect() override; void addToLayout(Layouting::LayoutItem &parent) override; - void emitChangedValue() override; - - QList operator()() const { return value(); } - QList value() const; - void setValue(const QList &value); - - QList defaultValue() const; - void setDefaultValue(const QList &value); - -signals: - void valueChanged(const QList &values); }; class QTCREATOR_UTILS_EXPORT TextDisplay : public BaseAspect diff --git a/src/plugins/autotest/gtest/gtestsettings.cpp b/src/plugins/autotest/gtest/gtestsettings.cpp index 7fa1e534797..32afb9a4a6b 100644 --- a/src/plugins/autotest/gtest/gtestsettings.cpp +++ b/src/plugins/autotest/gtest/gtestsettings.cpp @@ -111,9 +111,9 @@ GTestSettings::GTestSettings(Id settingsId) return edit && GTestUtils::isValidGTestFilter(edit->text()); }); - QObject::connect(&groupMode, &SelectionAspect::volatileValueChanged, - >estFilter, [this](int val) { - gtestFilter.setEnabled(groupMode.itemValueForIndex(val) == GTest::Constants::GTestFilter); + QObject::connect(&groupMode, &SelectionAspect::volatileValueChanged, >estFilter, [this] { + gtestFilter.setEnabled(groupMode.itemValueForIndex(groupMode.volatileValue()) + == GTest::Constants::GTestFilter); }); QObject::connect(this, &AspectContainer::applied, this, [] { diff --git a/src/plugins/beautifier/clangformat/clangformatsettings.cpp b/src/plugins/beautifier/clangformat/clangformatsettings.cpp index 6a31667edb7..92e175ac5fb 100644 --- a/src/plugins/beautifier/clangformat/clangformatsettings.cpp +++ b/src/plugins/beautifier/clangformat/clangformatsettings.cpp @@ -246,7 +246,7 @@ public: configurations, predefinedStyleButton] { const bool predefSelected = styleButtonGroup->checkedButton() == predefinedStyleButton; predefinedBlob->setEnabled(predefSelected); - fallbackBlob->setEnabled(predefSelected && s.predefinedStyle.volatileValue().toInt() == 5); // File + fallbackBlob->setEnabled(predefSelected && s.predefinedStyle.volatileValue() == 5); // File configurations->setEnabled(!predefSelected); }; updateEnabled(); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 56701f1413b..aa175406848 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -2114,12 +2114,10 @@ QString CMakeBuildSystem::cmakeBuildType() const void CMakeBuildSystem::setCMakeBuildType(const QString &cmakeBuildType, bool quiet) { auto aspect = buildConfiguration()->aspect(); - if (quiet) { + if (quiet) aspect->setValueQuietly(cmakeBuildType); - aspect->update(); - } else { + else aspect->setValue(cmakeBuildType); - } } namespace Internal { @@ -2179,7 +2177,7 @@ void InitialCMakeArgumentsAspect::setAllValues(const QString &values, QStringLis // Display the unknown arguments in "Additional CMake Options" const QString additionalOptionsValue = ProcessArgs::joinArgs(additionalOptions); - BaseAspect::setValueQuietly(additionalOptionsValue); + setValueQuietly(additionalOptionsValue); } void InitialCMakeArgumentsAspect::setCMakeConfiguration(const CMakeConfig &config) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index ff166133988..6d709d58a2e 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -135,7 +135,6 @@ class BuildTypeAspect final : public Utils::StringAspect public: BuildTypeAspect(); - using Utils::StringAspect::update; }; class ConfigureEnvironmentAspect final: public ProjectExplorer::EnvironmentAspect diff --git a/src/plugins/copilot/copilotoptionspage.cpp b/src/plugins/copilot/copilotoptionspage.cpp index 1d9a516d662..61e6d085dc4 100644 --- a/src/plugins/copilot/copilotoptionspage.cpp +++ b/src/plugins/copilot/copilotoptionspage.cpp @@ -79,10 +79,8 @@ public: auto updateAuthWidget = [authWidget]() { authWidget->updateClient( - FilePath::fromUserInput( - CopilotSettings::instance().nodeJsPath.volatileValue().toString()), - FilePath::fromUserInput( - CopilotSettings::instance().distPath.volatileValue().toString())); + FilePath::fromUserInput(CopilotSettings::instance().nodeJsPath.volatileValue()), + FilePath::fromUserInput(CopilotSettings::instance().distPath.volatileValue())); }; connect(CopilotSettings::instance().nodeJsPath.pathChooser(), diff --git a/src/plugins/copilot/copilotplugin.cpp b/src/plugins/copilot/copilotplugin.cpp index 1a554e13977..48a4dc89e82 100644 --- a/src/plugins/copilot/copilotplugin.cpp +++ b/src/plugins/copilot/copilotplugin.cpp @@ -142,10 +142,8 @@ void CopilotPlugin::initialize() requestAction->setEnabled(enabled); }; - connect(&CopilotSettings::instance().enableCopilot, - &BoolAspect::valueChanged, - this, - updateActions); + connect(&CopilotSettings::instance().enableCopilot, &BaseAspect::changed, + this, updateActions); updateActions(); diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index 5bdd3a54c3f..ec4cf1f61dc 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -92,8 +92,8 @@ CopilotProjectSettings::CopilotProjectSettings(ProjectExplorer::Project *project QVariantMap map = project->namedSettings(Constants::COPILOT_PROJECT_SETTINGS_ID).toMap(); fromMap(map); - connect(&enableCopilot, &BoolAspect::valueChanged, this, [this, project] { save(project); }); - connect(&useGlobalSettings, &BoolAspect::valueChanged, this, [this, project] { save(project); }); + connect(&enableCopilot, &BaseAspect::changed, this, [this, project] { save(project); }); + connect(&useGlobalSettings, &BaseAspect::changed, this, [this, project] { save(project); }); } void CopilotProjectSettings::setUseGlobalSettings(bool useGlobal) diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 97e9442266e..a007e96f48f 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -32,7 +32,7 @@ public: setOnApply([&s] { const bool originalPostMortem = s.registerForPostMortem->value(); - const bool currentPostMortem = s.registerForPostMortem->volatileValue().toBool(); + const bool currentPostMortem = s.registerForPostMortem->volatileValue(); // explicitly trigger setValue() to override the setValueSilently() and trigger the registration if (originalPostMortem != currentPostMortem) s.registerForPostMortem->setValue(currentPostMortem); diff --git a/src/plugins/debugger/console/console.cpp b/src/plugins/debugger/console/console.cpp index b1c3767f0e9..57810ef62bf 100644 --- a/src/plugins/debugger/console/console.cpp +++ b/src/plugins/debugger/console/console.cpp @@ -87,8 +87,8 @@ Console::Console() m_showDebug.setToolTip(Tr::tr("Show debug, log, and info messages.")); m_showDebug.setValue(true); m_showDebug.action()->setIcon(Utils::Icons::INFO_TOOLBAR.icon()); - connect(&m_showDebug, &Utils::BoolAspect::valueChanged, - proxyModel, &ConsoleProxyModel::setShowLogs); + connect(&m_showDebug, &Utils::BoolAspect::changed, + proxyModel, [this, proxyModel] { proxyModel->setShowLogs(m_showDebug()); }); m_showDebugButton->setDefaultAction(m_showDebug.action()); m_showWarningButton = new QToolButton(m_consoleWidget); @@ -100,7 +100,7 @@ Console::Console() m_showWarning.setValue(true); m_showWarning.action()->setIcon(Utils::Icons::WARNING_TOOLBAR.icon()); connect(m_showWarning.action(), &QAction::toggled, - proxyModel, &ConsoleProxyModel::setShowWarnings); + proxyModel, [this, proxyModel] { proxyModel->setShowWarnings(m_showWarning()); }); m_showWarningButton->setDefaultAction(m_showWarning.action()); m_showErrorButton = new QToolButton(m_consoleWidget); @@ -112,7 +112,7 @@ Console::Console() m_showError.setValue(true); m_showError.action()->setIcon(Utils::Icons::CRITICAL_TOOLBAR.icon()); connect(m_showError.action(), &QAction::toggled, - proxyModel, &ConsoleProxyModel::setShowErrors); + proxyModel, [this, proxyModel] { proxyModel->setShowErrors(m_showError()); }); m_showErrorButton->setDefaultAction(m_showError.action()); m_spacer = new QWidget(m_consoleWidget); diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index f83c6935818..9997d3f58c9 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -490,8 +490,8 @@ QString DebuggerSettings::dump() const int pos = key.indexOf('/'); if (pos >= 0) key = key.mid(pos); - const QString current = aspect->value().toString(); - const QString default_ = aspect->defaultValue().toString(); + const QString current = aspect->variantValue().toString(); + const QString default_ = aspect->defaultVariantValue().toString(); QString setting = key + ": " + current + " (default: " + default_ + ')'; if (current != default_) setting += " ***"; diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index 843947ab905..1a27beae330 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -21,7 +21,7 @@ class SourcePathMapAspectPrivate; // Syntax: (/home/.*)/KnownSubdir -> /home/my/project using SourcePathMap = QMap; -class SourcePathMapAspect : public Utils::BaseAspect +class SourcePathMapAspect : public Utils::TypedAspect { public: SourcePathMapAspect(); @@ -32,15 +32,13 @@ public: void addToLayout(Layouting::LayoutItem &parent) override; - QVariant volatileValue() const override; - void setVolatileValue(const QVariant &val) override; - void readSettings(const QSettings *settings) override; void writeSettings(QSettings *settings) const override; - SourcePathMap value() const; - private: + void guiToInternal() override; + void internalToGui() override; + SourcePathMapAspectPrivate *d = nullptr; }; diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 0c98ba174b0..ad9aeb87391 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -470,29 +470,22 @@ void SourcePathMapAspect::addToLayout(Layouting::LayoutItem &parent) parent.addItem(d->m_widget.data()); } -QVariant SourcePathMapAspect::volatileValue() const +void SourcePathMapAspect::guiToInternal() { - QTC_CHECK(!isAutoApply()); - QTC_ASSERT(d->m_widget, return {}); - return QVariant::fromValue(d->m_widget->sourcePathMap()); + if (d->m_widget) + m_internal = d->m_widget->sourcePathMap(); } -void SourcePathMapAspect::setVolatileValue(const QVariant &val) +void SourcePathMapAspect::internalToGui() { - QTC_CHECK(!isAutoApply()); if (d->m_widget) - d->m_widget->setSourcePathMap(val.value()); + d->m_widget->setSourcePathMap(m_internal); } const char sourcePathMappingArrayNameC[] = "SourcePathMappings"; const char sourcePathMappingSourceKeyC[] = "Source"; const char sourcePathMappingTargetKeyC[] = "Target"; -SourcePathMap SourcePathMapAspect::value() const -{ - return BaseAspect::value().value(); -} - void SourcePathMapAspect::writeSettings(QSettings *s) const { const SourcePathMap sourcePathMap = value(); @@ -528,7 +521,7 @@ void SourcePathMapAspect::readSettings(const QSettings *settings) } } s->endArray(); - setValue(QVariant::fromValue(sourcePathMap)); + setValue(sourcePathMap); } } // Debugger::Internal diff --git a/src/plugins/debugger/registerpostmortemaction.cpp b/src/plugins/debugger/registerpostmortemaction.cpp index cc2f6fccf5d..4afd0989eed 100644 --- a/src/plugins/debugger/registerpostmortemaction.cpp +++ b/src/plugins/debugger/registerpostmortemaction.cpp @@ -46,7 +46,7 @@ void RegisterPostMortemAction::registerNow(bool value) RegisterPostMortemAction::RegisterPostMortemAction() { - connect(this, &BoolAspect::valueChanged, this, &RegisterPostMortemAction::registerNow); + connect(this, &BaseAspect::changed, this, [this] { registerNow(value()); }); } void RegisterPostMortemAction::readSettings(const QSettings *) diff --git a/src/plugins/fakevim/fakevimactions.cpp b/src/plugins/fakevim/fakevimactions.cpp index 916fea16097..2d4b5420328 100644 --- a/src/plugins/fakevim/fakevimactions.cpp +++ b/src/plugins/fakevim/fakevimactions.cpp @@ -28,30 +28,6 @@ using namespace Utils; namespace FakeVim::Internal { #ifdef FAKEVIM_STANDALONE -FvBaseAspect::FvBaseAspect() -{ -} - -void FvBaseAspect::setValue(const QVariant &value) -{ - m_value = value; -} - -QVariant FvBaseAspect::value() const -{ - return m_value; -} - -void FvBaseAspect::setDefaultValue(const QVariant &value) -{ - m_defaultValue = value; - m_value = value; -} - -QVariant FvBaseAspect::defaultValue() const -{ - return m_defaultValue; -} void FvBaseAspect::setSettingsKey(const QString &group, const QString &key) { @@ -294,7 +270,7 @@ QString FakeVimSettings::trySetValue(const QString &name, const QString &value) return Tr::tr("Argument must be positive: %1=%2") .arg(name).arg(value); } - aspect->setValue(value); + aspect->setVariantValue(value); return QString(); } @@ -305,7 +281,7 @@ void FakeVimSettings::setup(FvBaseAspect *aspect, const QString &labelText) { aspect->setSettingsKey("FakeVim", settingsKey); - aspect->setDefaultValue(value); + aspect->setDefaultVariantValue(value); #ifndef FAKEVIM_STANDALONE aspect->setLabelText(labelText); aspect->setAutoApply(false); diff --git a/src/plugins/fakevim/fakevimactions.h b/src/plugins/fakevim/fakevimactions.h index e3b14b0d47a..a3907dc117f 100644 --- a/src/plugins/fakevim/fakevimactions.h +++ b/src/plugins/fakevim/fakevimactions.h @@ -19,13 +19,14 @@ namespace FakeVim::Internal { class FvBaseAspect { public: - FvBaseAspect(); - virtual ~FvBaseAspect() {} + FvBaseAspect() = default; + virtual ~FvBaseAspect() = default; + + virtual void setVariantValue(const QVariant &value) = 0; + virtual void setDefaultVariantValue(const QVariant &value) = 0; + virtual QVariant variantValue() const = 0; + virtual QVariant defaultVariantValue() const = 0; - void setValue(const QVariant &value); - QVariant value() const; - void setDefaultValue(const QVariant &value); - QVariant defaultValue() const; void setSettingsKey(const QString &group, const QString &key); QString settingsKey() const; void setCheckable(bool) {} @@ -33,32 +34,41 @@ public: void setToolTip(const QString &) {} private: - QVariant m_value; - QVariant m_defaultValue; QString m_settingsGroup; QString m_settingsKey; }; -class FvBoolAspect : public FvBaseAspect +template +class FvTypedAspect : public FvBaseAspect { public: - bool value() const { return FvBaseAspect::value().toBool(); } - bool operator()() const { return value(); } + void setVariantValue(const QVariant &value) override + { + m_value = value.value(); + } + void setDefaultVariantValue(const QVariant &value) override + { + m_defaultValue = value.value(); + } + QVariant variantValue() const override + { + return QVariant::fromValue(m_value); + } + QVariant defaultVariantValue() const override + { + return QVariant::fromValue(m_defaultValue); + } + + ValueType value() const { return m_value; } + ValueType operator()() const { return m_value; } + + ValueType m_value; + ValueType m_defaultValue; }; -class FvIntegerAspect : public FvBaseAspect -{ -public: - qint64 value() const { return FvBaseAspect::value().toLongLong(); } - qint64 operator()() const { return value(); } -}; - -class FvStringAspect : public FvBaseAspect -{ -public: - QString value() const { return FvBaseAspect::value().toString(); } - QString operator()() const { return value(); } -}; +using FvBoolAspect = FvTypedAspect; +using FvIntegerAspect = FvTypedAspect; +using FvStringAspect = FvTypedAspect; class FvAspectContainer : public FvBaseAspect { diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index edfa315af98..bb3586b6329 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -6139,13 +6139,13 @@ bool FakeVimHandler::Private::handleExSetCommand(const ExCommand &cmd) FvBaseAspect *act = s.item(optionName); if (!act) { showMessage(MessageError, Tr::tr("Unknown option:") + ' ' + cmd.args); - } else if (act->defaultValue().type() == QVariant::Bool) { - bool oldValue = act->value().toBool(); + } else if (act->defaultVariantValue().type() == QVariant::Bool) { + bool oldValue = act->variantValue().toBool(); if (printOption) { showMessage(MessageInfo, QLatin1String(oldValue ? "" : "no") + act->settingsKey().toLower()); } else if (toggleOption || negateOption == oldValue) { - act->setValue(!oldValue); + act->setVariantValue(!oldValue); } } else if (negateOption && !printOption) { showMessage(MessageError, Tr::tr("Invalid argument:") + ' ' + cmd.args); @@ -6153,7 +6153,7 @@ bool FakeVimHandler::Private::handleExSetCommand(const ExCommand &cmd) showMessage(MessageError, Tr::tr("Trailing characters:") + ' ' + cmd.args); } else { showMessage(MessageInfo, act->settingsKey().toLower() + "=" - + act->value().toString()); + + act->variantValue().toString()); } } updateEditor(); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 5b51cb5f969..fb3049a7b06 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -1089,16 +1089,16 @@ void FakeVimPluginPrivate::initialize() this, &FakeVimPluginPrivate::documentRenamed); FakeVimSettings &s = settings(); - connect(&s.useFakeVim, &FvBoolAspect::valueChanged, - this, &FakeVimPluginPrivate::setUseFakeVim); + connect(&s.useFakeVim, &FvBoolAspect::changed, + this, [this, &s] { setUseFakeVim(s.useFakeVim()); }); connect(&s.readVimRc, &FvBaseAspect::changed, this, &FakeVimPluginPrivate::maybeReadVimRc); connect(&s.vimRcPath, &FvBaseAspect::changed, this, &FakeVimPluginPrivate::maybeReadVimRc); - connect(&s.relativeNumber, &FvBoolAspect::valueChanged, - this, &FakeVimPluginPrivate::setShowRelativeLineNumbers); - connect(&s.blinkingCursor, &FvBoolAspect::valueChanged, - this, &FakeVimPluginPrivate::setCursorBlinking); + connect(&s.relativeNumber, &FvBoolAspect::changed, + this, [this, &s] { setShowRelativeLineNumbers(s.relativeNumber()); }); + connect(&s.blinkingCursor, &FvBoolAspect::changed, + this, [this, &s] { setCursorBlinking(s.blinkingCursor()); }); // Delayed operations. connect(this, &FakeVimPluginPrivate::delayedQuitRequested, diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index c5f30fa036f..9ada18c1194 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -1466,9 +1466,8 @@ void GitPluginPrivate::setupInstantBlame() forceInstantBlame(); }; - connect(&settings().instantBlame, &BoolAspect::valueChanged, this, - [this, setupBlameForEditor](bool enabled) { - if (enabled) + connect(&settings().instantBlame, &BaseAspect::changed, this, [this, setupBlameForEditor] { + if (settings().instantBlame()) setupBlameForEditor(EditorManager::currentEditor()); else stopInstantBlame(); diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index 4ebf7debeed..4ef786c5354 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -146,8 +146,8 @@ GitSettings::GitSettings() st }; }); - connect(&binaryPath, &StringAspect::valueChanged, this, [this] { tryResolve = true; }); - connect(&path, &StringAspect::valueChanged, this, [this] { tryResolve = true; }); + connect(&binaryPath, &BaseAspect::changed, this, [this] { tryResolve = true; }); + connect(&path, &BaseAspect::changed, this, [this] { tryResolve = true; }); } FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const diff --git a/src/plugins/nim/nimplugin.cpp b/src/plugins/nim/nimplugin.cpp index b3ef6fc49f0..cdad3981ca9 100644 --- a/src/plugins/nim/nimplugin.cpp +++ b/src/plugins/nim/nimplugin.cpp @@ -42,9 +42,10 @@ public: NimPluginPrivate() { Suggest::NimSuggestCache::instance().setExecutablePath(settings.nimSuggestPath.value()); - QObject::connect(&settings.nimSuggestPath, &StringAspect::valueChanged, - &Suggest::NimSuggestCache::instance(), - &Suggest::NimSuggestCache::setExecutablePath); + QObject::connect(&settings.nimSuggestPath, &StringAspect::changed, + &Suggest::NimSuggestCache::instance(), [this] { + Suggest::NimSuggestCache::instance().setExecutablePath(settings.nimSuggestPath.value()); + }); } NimSettings settings; diff --git a/src/plugins/perforce/perforcesettings.cpp b/src/plugins/perforce/perforcesettings.cpp index 6dff959d5f6..42201b208a0 100644 --- a/src/plugins/perforce/perforcesettings.cpp +++ b/src/plugins/perforce/perforcesettings.cpp @@ -109,8 +109,7 @@ PerforceSettings::PerforceSettings() errorLabel->setType(InfoLabel::Information); errorLabel->setText(Tr::tr("Testing...")); - const FilePath p4Bin = FilePath::fromUserInput( - p4BinaryPath.volatileValue().toString()); + const FilePath p4Bin = FilePath::fromUserInput(p4BinaryPath.volatileValue()); checker->start(p4Bin, {}, commonP4Arguments_volatile(), 10000); }); @@ -166,14 +165,14 @@ QStringList PerforceSettings::commonP4Arguments() const QStringList PerforceSettings::commonP4Arguments_volatile() const { QStringList lst; - if (customEnv.volatileValue().toBool()) { - auto p4C = p4Client.volatileValue().toString(); + if (customEnv.volatileValue()) { + const QString p4C = p4Client.volatileValue(); if (!p4C.isEmpty()) lst << "-c" << p4C; - auto p4P = p4Port.volatileValue().toString(); + const QString p4P = p4Port.volatileValue(); if (!p4P.isEmpty()) lst << "-p" << p4P; - auto p4U = p4User.volatileValue().toString(); + const QString p4U = p4User.volatileValue(); if (!p4U.isEmpty()) lst << "-u" << p4U; } diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp index 59a753e5dde..8851b19d777 100644 --- a/src/plugins/perfprofiler/perfsettings.cpp +++ b/src/plugins/perfprofiler/perfsettings.cpp @@ -58,8 +58,8 @@ PerfSettings::PerfSettings(ProjectExplorer::Target *target) extraArguments.setLabelText(Tr::tr("Additional arguments:")); extraArguments.setSpan(4); - connect(&callgraphMode, &SelectionAspect::volatileValueChanged, this, [this](int index) { - stackSize.setEnabled(index == 0); + connect(&callgraphMode, &SelectionAspect::volatileValueChanged, this, [this] { + stackSize.setEnabled(callgraphMode.volatileValue() == 0); }); readGlobalSettings(); diff --git a/src/plugins/projectexplorer/buildpropertiessettings.cpp b/src/plugins/projectexplorer/buildpropertiessettings.cpp index 6df8fdd328e..aed8c5a8ba2 100644 --- a/src/plugins/projectexplorer/buildpropertiessettings.cpp +++ b/src/plugins/projectexplorer/buildpropertiessettings.cpp @@ -59,10 +59,12 @@ BuildPropertiesSettings::BuildPropertiesSettings() qtQuickCompiler.setSettingsKey("ProjectExplorer/Settings/QtQuickCompiler"); qtQuickCompiler.setLabelText(Tr::tr("Use qmlcachegen:")); - QObject::connect(&showQtSettings, &BoolAspect::valueChanged, - &qmlDebugging, &BaseAspect::setVisible); - QObject::connect(&showQtSettings, &BoolAspect::valueChanged, - &qtQuickCompiler, &BaseAspect::setVisible); + QObject::connect(&showQtSettings, &BaseAspect::changed, &qmlDebugging, [this] { + qmlDebugging.setVisible(showQtSettings()); + }); + QObject::connect(&showQtSettings, &BaseAspect::changed, &qtQuickCompiler, [this] { + qtQuickCompiler.setVisible(showQtSettings()); + }); } QString BuildPropertiesSettings::defaultBuildDirectoryTemplate() diff --git a/src/plugins/python/pythonwizardpage.cpp b/src/plugins/python/pythonwizardpage.cpp index 2216dbfa574..59ecebf688a 100644 --- a/src/plugins/python/pythonwizardpage.cpp +++ b/src/plugins/python/pythonwizardpage.cpp @@ -109,8 +109,8 @@ PythonWizardPage::PythonWizardPage(const QList> &pySide m_stateLabel->setWordWrap(true); m_stateLabel->setFilled(true); m_stateLabel->setType(InfoLabel::Error); - connect(&m_venvPath, &StringAspect::valueChanged, this, &PythonWizardPage::updateStateLabel); - connect(&m_createVenv, &BoolAspect::valueChanged, this, &PythonWizardPage::updateStateLabel); + connect(&m_venvPath, &BaseAspect::changed, this, &PythonWizardPage::updateStateLabel); + connect(&m_createVenv, &BaseAspect::changed, this, &PythonWizardPage::updateStateLabel); Grid { m_pySideVersion, br, diff --git a/src/plugins/squish/squishsettings.cpp b/src/plugins/squish/squishsettings.cpp index f7758a844d3..5b069f35fcb 100644 --- a/src/plugins/squish/squishsettings.cpp +++ b/src/plugins/squish/squishsettings.cpp @@ -87,7 +87,8 @@ SquishSettings::SquishSettings() minimizeIDE.setToolTip(Tr::tr("Minimize IDE automatically while running or recording test cases.")); minimizeIDE.setDefaultValue(true); - connect(&local, &BoolAspect::volatileValueChanged, this, [this](bool checked) { + connect(&local, &BoolAspect::volatileValueChanged, this, [this] { + const bool checked = local.volatileValue(); serverHost.setEnabled(!checked); serverPort.setEnabled(!checked); }); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index e2921603e98..5224b3c78c8 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -923,13 +923,12 @@ void MemcheckToolPrivate::updateFromSettings() m_filterProjectAction->setChecked(!m_settings->filterExternalIssues()); m_errorView->settingsChanged(m_settings); - connect(&m_settings->visibleErrorKinds, &IntegersAspect::valueChanged, - &m_errorProxyModel, &MemcheckErrorFilterProxyModel::setAcceptedKinds); - m_errorProxyModel.setAcceptedKinds(m_settings->visibleErrorKinds()); - - connect(&m_settings->filterExternalIssues, &BoolAspect::valueChanged, - &m_errorProxyModel, &MemcheckErrorFilterProxyModel::setFilterExternalIssues); - m_errorProxyModel.setFilterExternalIssues(m_settings->filterExternalIssues()); + connect(&m_settings->visibleErrorKinds, &BaseAspect::changed, &m_errorProxyModel, [this] { + m_errorProxyModel.setAcceptedKinds(m_settings->visibleErrorKinds()); + }); + connect(&m_settings->filterExternalIssues, &BaseAspect::changed, &m_errorProxyModel, [this] { + m_errorProxyModel.setFilterExternalIssues(m_settings->filterExternalIssues()); + }); } void MemcheckToolPrivate::maybeActiveRunConfigurationChanged() diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 4db2e39c3a5..55c6a3543ce 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -108,7 +108,7 @@ void SuppressionAspectPrivate::slotSuppressionSelectionChanged() // SuppressionAspect::SuppressionAspect(AspectContainer *container, bool global) - : BaseAspect(container) + : TypedAspect(container) { d = new SuppressionAspectPrivate(this, global); setSettingsKey("Analyzer.Valgrind.SuppressionFiles"); @@ -119,16 +119,6 @@ SuppressionAspect::~SuppressionAspect() delete d; } -FilePaths SuppressionAspect::value() const -{ - return FileUtils::toFilePathList(BaseAspect::value().toStringList()); -} - -void SuppressionAspect::setValue(const FilePaths &val) -{ - BaseAspect::setValue(Utils::transform(val, &FilePath::toString)); -} - void SuppressionAspect::addToLayout(Layouting::LayoutItem &parent) { QTC_CHECK(!d->addEntry); @@ -157,8 +147,6 @@ void SuppressionAspect::addToLayout(Layouting::LayoutItem &parent) Column { d->addEntry.data(), d->removeEntry.data(), st } }; parent.addItem(Span { 2, group }); - - setVolatileValue(BaseAspect::value()); } void SuppressionAspect::fromMap(const QVariantMap &map) @@ -171,22 +159,18 @@ void SuppressionAspect::toMap(QVariantMap &map) const BaseAspect::toMap(map); } -QVariant SuppressionAspect::volatileValue() const +void SuppressionAspect::guiToInternal() { - QStringList ret; - + m_internal.clear(); for (int i = 0; i < d->m_model.rowCount(); ++i) - ret << d->m_model.item(i)->text(); - - return ret; + m_internal.append(FilePath::fromUserInput(d->m_model.item(i)->text())); } -void SuppressionAspect::setVolatileValue(const QVariant &val) +void SuppressionAspect::internalToGui() { - const QStringList files = val.toStringList(); d->m_model.clear(); - for (const QString &file : files) - d->m_model.appendRow(new QStandardItem(file)); + for (const FilePath &file : m_internal) + d->m_model.appendRow(new QStandardItem(file.toUserOutput())); } ////////////////////////////////////////////////////////////////// @@ -388,7 +372,7 @@ QVariantMap ValgrindBaseSettings::defaultSettings() const { QVariantMap defaults; forEachAspect([&defaults](BaseAspect *aspect) { - defaults.insert(aspect->settingsKey(), aspect->defaultValue()); + defaults.insert(aspect->settingsKey(), aspect->defaultVariantValue()); }); return defaults; } diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index 29506b848f5..def8b793da7 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -12,7 +12,7 @@ const char ANALYZER_VALGRIND_SETTINGS[] = "Analyzer.Valgrind.Settings"; class SuppressionAspectPrivate; -class SuppressionAspect final : public Utils::BaseAspect +class SuppressionAspect final : public Utils::TypedAspect { Q_OBJECT @@ -20,21 +20,17 @@ public: SuppressionAspect(Utils::AspectContainer *container, bool global); ~SuppressionAspect() final; - Utils::FilePaths operator()() const { return value(); } - Utils::FilePaths value() const; - void setValue(const Utils::FilePaths &val); - void addToLayout(Layouting::LayoutItem &parent) final; void fromMap(const QVariantMap &map) final; void toMap(QVariantMap &map) const final; - QVariant volatileValue() const final; - void setVolatileValue(const QVariant &val) final; - void addSuppressionFile(const Utils::FilePath &suppressionFile); private: + void internalToGui() override; + void guiToInternal() override; + friend class ValgrindBaseSettings; SuppressionAspectPrivate *d = nullptr; }; From bcd49bafdd9432ce7abbd20cceabe853358231c8 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 28 Jun 2023 12:47:38 +0200 Subject: [PATCH 0075/1777] CppEditor: Add test case for quickfix formatting Also fixes an off-by-one error in the formatting code that was uncovered by the test. Change-Id: I013194e21cf37f318bb806bb60ea659b91b99fbf Reviewed-by: David Schulz Reviewed-by: Qt CI Bot Reviewed-by: --- src/plugins/cppeditor/cppquickfix_test.cpp | 65 ++++++++++++++++++- src/plugins/cppeditor/cppquickfix_test.h | 8 ++- src/plugins/cppeditor/cppquickfixes.cpp | 9 +++ src/plugins/cppeditor/cppquickfixes.h | 1 + src/plugins/texteditor/refactoringchanges.cpp | 2 +- 5 files changed, 78 insertions(+), 7 deletions(-) diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index a3a8111ee8f..9651ddb214f 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -13,6 +13,8 @@ #include "cppsourceprocessertesthelper.h" #include "cpptoolssettings.h" +#include +#include #include #include @@ -60,7 +62,8 @@ QList singleDocument(const QByteArray &original, } BaseQuickFixTestCase::BaseQuickFixTestCase(const QList &testDocuments, - const ProjectExplorer::HeaderPaths &headerPaths) + const ProjectExplorer::HeaderPaths &headerPaths, + const QByteArray &clangFormatSettings) : m_testDocuments(testDocuments) , m_cppCodeStylePreferences(0) , m_restoreHeaderPaths(false) @@ -85,6 +88,10 @@ BaseQuickFixTestCase::BaseQuickFixTestCase(const QList &testDoc document->writeToDisk(); } + // Create .clang-format file + if (!clangFormatSettings.isEmpty()) + m_temporaryDirectory->createFile(".clang-format", clangFormatSettings); + // Set appropriate include paths if (!headerPaths.isEmpty()) { m_restoreHeaderPaths = true; @@ -182,8 +189,9 @@ QuickFixOperationTest::QuickFixOperationTest(const QList &testD CppQuickFixFactory *factory, const ProjectExplorer::HeaderPaths &headerPaths, int operationIndex, - const QByteArray &expectedFailMessage) - : BaseQuickFixTestCase(testDocuments, headerPaths) + const QByteArray &expectedFailMessage, + const QByteArray &clangFormatSettings) + : BaseQuickFixTestCase(testDocuments, headerPaths, clangFormatSettings) { QVERIFY(succeededSoFar()); @@ -5336,6 +5344,57 @@ void QuickfixTest::testInsertDefsFromDecls() QuickFixOperationTest(testDocuments, &factory); } +void QuickfixTest::testInsertAndFormatDefsFromDecls() +{ + static const auto isClangFormatPresent = [] { + using namespace ExtensionSystem; + return Utils::contains(PluginManager::plugins(), [](const PluginSpec *plugin) { + return plugin->name() == "ClangFormat" && plugin->isEffectivelyEnabled(); + }); + }; + if (!isClangFormatPresent()) + QSKIP("This test reqires ClangFormat"); + + const QByteArray origHeader = R"( +class @C +{ +public: + void func1 (int const &i); + void func2 (double const d); +}; +)"; + const QByteArray origSource = R"( +#include "file.h" +)"; + + const QByteArray expectedSource = R"( +#include "file.h" + +void C::func1 (int const &i) +{ + +} + +void C::func2 (double const d) +{ + +} +)"; + + const QByteArray clangFormatSettings = R"( +BreakBeforeBraces: Allman +QualifierAlignment: Right +SpaceBeforeParens: Always +)"; + + const QList testDocuments({ + CppTestDocument::create("file.h", origHeader, origHeader), + CppTestDocument::create("file.cpp", origSource, expectedSource)}); + InsertDefsFromDecls factory; + factory.setMode(InsertDefsFromDecls::Mode::Impl); + QuickFixOperationTest(testDocuments, &factory, {}, {}, {}, clangFormatSettings); +} + // Function for one of InsertDeclDef section cases void insertToSectionDeclFromDef(const QByteArray §ion, int sectionIndex) { diff --git a/src/plugins/cppeditor/cppquickfix_test.h b/src/plugins/cppeditor/cppquickfix_test.h index 2d0dd0ebc9d..53926630cab 100644 --- a/src/plugins/cppeditor/cppquickfix_test.h +++ b/src/plugins/cppeditor/cppquickfix_test.h @@ -26,8 +26,8 @@ public: /// Exactly one QuickFixTestDocument must contain the cursor position marker '@' /// or "@{start}" and "@{end}" BaseQuickFixTestCase(const QList &testDocuments, - const ProjectExplorer::HeaderPaths &headerPaths - = ProjectExplorer::HeaderPaths()); + const ProjectExplorer::HeaderPaths &headerPaths, + const QByteArray &clangFormatSettings = {}); ~BaseQuickFixTestCase(); @@ -54,7 +54,8 @@ public: const ProjectExplorer::HeaderPaths &headerPaths = ProjectExplorer::HeaderPaths(), int operationIndex = 0, - const QByteArray &expectedFailMessage = QByteArray()); + const QByteArray &expectedFailMessage = {}, + const QByteArray &clangFormatSettings = {}); static void run(const QList &testDocuments, CppQuickFixFactory *factory, @@ -139,6 +140,7 @@ private slots: void testInsertDefFromDeclAliasTemplateAsReturnType(); void testInsertDefsFromDecls_data(); void testInsertDefsFromDecls(); + void testInsertAndFormatDefsFromDecls(); void testInsertDeclFromDef(); void testInsertDeclFromDefTemplateFuncTypename(); diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 77672a85699..93596f5ec43 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -3478,6 +3478,15 @@ private: settings = dlg.settings(); break; } + case InsertDefsFromDecls::Mode::Impl: { + for (Symbol * const func : std::as_const(unimplemented)) { + MemberFunctionImplSetting setting; + setting.func = func; + setting.defPos = DefPosImplementationFile; + settings << setting; + } + break; + } case InsertDefsFromDecls::Mode::Alternating: { int defPos = DefPosImplementationFile; const auto incDefPos = [&defPos] { diff --git a/src/plugins/cppeditor/cppquickfixes.h b/src/plugins/cppeditor/cppquickfixes.h index 61db3ebf53d..1b19c23b60d 100644 --- a/src/plugins/cppeditor/cppquickfixes.h +++ b/src/plugins/cppeditor/cppquickfixes.h @@ -402,6 +402,7 @@ public: enum class Mode { Off, // Testing: simulates user canceling the dialog + Impl, // Testing: simulates user choosing cpp file for every function Alternating, // Testing: simulates user choosing a different DefPos for every function User // Normal interactive mode }; diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp index dab0ebb41f2..1b03a07e01f 100644 --- a/src/plugins/texteditor/refactoringchanges.cpp +++ b/src/plugins/texteditor/refactoringchanges.cpp @@ -468,7 +468,7 @@ void RefactoringFile::doFormatting() QTC_ASSERT(b.isValid(), break); if (b.text().simplified().isEmpty()) QTextCursor(b).insertText(clangFormatLineRemovalBlocker); - if (b.blockNumber() == r.endLine) + if (b.blockNumber() == r.endLine - 1) break; b = b.next(); } From 3cfa1902c6173c951add5884d4371b88e99ee3bf Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 29 Jun 2023 09:22:58 +0200 Subject: [PATCH 0076/1777] AutoTest: simplify TestVisitor::visit Change-Id: I26e8eb8788da80afbfbd266f01828b860fc0622a Reviewed-by: Christian Stenger --- src/plugins/autotest/qtest/qttestvisitors.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/plugins/autotest/qtest/qttestvisitors.cpp b/src/plugins/autotest/qtest/qttestvisitors.cpp index 6f615c99321..318691db94f 100644 --- a/src/plugins/autotest/qtest/qttestvisitors.cpp +++ b/src/plugins/autotest/qtest/qttestvisitors.cpp @@ -51,17 +51,11 @@ bool TestVisitor::visit(Class *symbol) Function *functionDefinition = m_symbolFinder.findMatchingDefinition( func, m_snapshot, true); - if (functionDefinition && functionDefinition->fileId()) { - locationAndType.m_filePath = FilePath::fromString( - QString::fromUtf8(functionDefinition->fileName())); - locationAndType.m_line = functionDefinition->line(); - locationAndType.m_column = functionDefinition->column() - 1; - } else { // if we cannot find the definition use declaration as fallback - locationAndType.m_filePath = FilePath::fromString( - QString::fromUtf8(member->fileName())); - locationAndType.m_line = member->line(); - locationAndType.m_column = member->column() - 1; - } + if (functionDefinition && functionDefinition->fileId()) + member = functionDefinition; + locationAndType.m_filePath = FilePath::fromUtf8(member->fileName()); + locationAndType.m_line = member->line(); + locationAndType.m_column = member->column() - 1; if (specialFunctions.contains(name)) locationAndType.m_type = TestTreeItem::TestSpecialFunction; else if (name.endsWith("_data")) From a99845633872c33c4ecb5f85ec034bb6133514de Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jun 2023 16:40:03 +0200 Subject: [PATCH 0077/1777] Perforce: Use a FilePathAspect for the p4 binary Change-Id: I9bdb04192887f72d37bee04d13450cb9f85f9bc2 Reviewed-by: Reviewed-by: Orgad Shaneh --- src/plugins/perforce/perforcesettings.cpp | 1 - src/plugins/perforce/perforcesettings.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/perforce/perforcesettings.cpp b/src/plugins/perforce/perforcesettings.cpp index 42201b208a0..dc5036bbbba 100644 --- a/src/plugins/perforce/perforcesettings.cpp +++ b/src/plugins/perforce/perforcesettings.cpp @@ -35,7 +35,6 @@ PerforceSettings::PerforceSettings() setSettingsGroup("Perforce"); setAutoApply(false); - p4BinaryPath.setDisplayStyle(StringAspect::PathChooserDisplay); p4BinaryPath.setSettingsKey("Command"); p4BinaryPath.setDefaultValue( Environment::systemEnvironment().searchInPath(defaultCommand()).toString()); diff --git a/src/plugins/perforce/perforcesettings.h b/src/plugins/perforce/perforcesettings.h index 0801c310907..bbd8e43ef65 100644 --- a/src/plugins/perforce/perforcesettings.h +++ b/src/plugins/perforce/perforcesettings.h @@ -68,7 +68,7 @@ public: void clearTopLevel(); - Utils::StringAspect p4BinaryPath{this}; + Utils::FilePathAspect p4BinaryPath{this}; Utils::StringAspect p4Port{this}; Utils::StringAspect p4Client{this}; Utils::StringAspect p4User{this}; From 569e73c5edfe07a471b8889bf7c106e5f1dfe2cc Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jun 2023 18:18:04 +0200 Subject: [PATCH 0078/1777] Perforce: Some more direct FilePath use Change-Id: I78e28714fef577a9129e39b03273f3651de8adcc Reviewed-by: Orgad Shaneh --- src/plugins/perforce/perforceplugin.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index ae61d12d342..82ee2f43d4d 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -1199,9 +1199,10 @@ QString PerforcePluginPrivate::vcsMakeWritableText() const // Run messages -static QString msgNotStarted(const QString &cmd) +static QString msgNotStarted(const FilePath &cmd) { - return Tr::tr("Could not start perforce \"%1\". Please check your settings in the preferences.").arg(cmd); + return Tr::tr("Could not start perforce \"%1\". Please check your settings in the preferences.") + .arg(cmd.toUserOutput()); } static QString msgTimeout(int timeOutS) @@ -1251,7 +1252,7 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki process.setStdOutCallback([](const QString &lines) { VcsOutputWindow::append(lines); }); } process.setTimeOutMessageBoxEnabled(true); - process.setCommand({m_settings.p4BinaryPath.filePath(), args}); + process.setCommand({m_settings.p4BinaryPath(), args}); process.runBlocking(EventLoopMode::On); PerforceResponse response; @@ -1271,7 +1272,7 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki response.message = msgCrash(); break; case ProcessResult::StartFailed: - response.message = msgNotStarted(m_settings.p4BinaryPath.value()); + response.message = msgNotStarted(m_settings.p4BinaryPath()); break; case ProcessResult::Hang: response.message = msgCrash(); @@ -1295,13 +1296,13 @@ PerforceResponse PerforcePluginPrivate::fullySynchronousProcess(const FilePath & process.setWorkingDirectory(workingDir); PerforceResponse response; - process.setCommand({m_settings.p4BinaryPath.filePath(), args}); + process.setCommand({m_settings.p4BinaryPath(), args}); process.setWriteData(stdInput); process.start(); if (!process.waitForStarted(3000)) { response.error = true; - response.message = msgNotStarted(m_settings.p4BinaryPath.value()); + response.message = msgNotStarted(m_settings.p4BinaryPath()); return response; } @@ -1364,7 +1365,7 @@ PerforceResponse PerforcePluginPrivate::runP4Cmd(const FilePath &workingDir, actualArgs.append(args); if (flags & CommandToWindow) - VcsOutputWindow::appendCommand(workingDir, {m_settings.p4BinaryPath.filePath(), actualArgs}); + VcsOutputWindow::appendCommand(workingDir, {m_settings.p4BinaryPath(), actualArgs}); if (flags & ShowBusyCursor) QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); @@ -1699,7 +1700,7 @@ void PerforcePluginPrivate::getTopLevel(const FilePath &workingDirectory, bool i connect(checker, &PerforceChecker::succeeded, dd, &PerforcePluginPrivate::setTopLevel); connect(checker, &PerforceChecker::succeeded,checker, &QObject::deleteLater); - checker->start(m_settings.p4BinaryPath.filePath(), workingDirectory, + checker->start(m_settings.p4BinaryPath(), workingDirectory, m_settings.commonP4Arguments(QString()), 30000); if (isSync) From 83111bb3f6a8bd41830a78ee7371a39d5ddf8d5b Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 29 Jun 2023 08:23:45 +0200 Subject: [PATCH 0079/1777] Utils: Make validation async Changes FancyLineEdit to accept two types of validation functions: AsyncValidationFunction, which returns a QFuture and takes the new text, or SynchronousValidationFunction. Especially PathChooser is changed to use async validation function to improve snappyness of settings pages that do heavy validation, for instance the Debugger page. Change-Id: I1677e7d8acc29e36c69a867850304b7913e6ae7e Reviewed-by: Eike Ziller Reviewed-by: hjk --- src/libs/utils/CMakeLists.txt | 2 +- src/libs/utils/aspects.cpp | 12 +- src/libs/utils/fancylineedit.cpp | 149 ++++++++++++++---- src/libs/utils/fancylineedit.h | 13 +- src/libs/utils/layoutbuilder.cpp | 12 ++ src/libs/utils/layoutbuilder.h | 3 + src/libs/utils/pathchooser.cpp | 118 +++++++------- src/libs/utils/pathchooser.h | 3 +- src/libs/utils/projectintropage.cpp | 2 + src/plugins/debugger/debuggeritemmanager.cpp | 128 ++++++++------- .../modeleditor/extpropertiesmview.cpp | 3 - src/plugins/projectexplorer/buildaspects.cpp | 19 +-- .../qmakeprojectmanager/addlibrarywizard.cpp | 30 ++-- src/plugins/qtsupport/qtoptionspage.cpp | 41 ++--- src/plugins/squish/squishsettings.cpp | 28 ++-- 15 files changed, 350 insertions(+), 213 deletions(-) diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 78e530a6d58..883727de72d 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -1,5 +1,5 @@ add_qtc_library(Utils - DEPENDS Tasking Qt::Qml Qt::Xml + DEPENDS Tasking Qt::Qml Qt::Xml Spinner PUBLIC_DEPENDS Qt::Concurrent Qt::Core Qt::Network Qt::Gui Qt::Widgets Qt::Core5Compat diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 5c1fd5cdb26..a97424a6e91 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -662,7 +662,7 @@ public: MacroExpanderProvider m_expanderProvider; FilePath m_baseFileName; StringAspect::ValueAcceptor m_valueAcceptor; - FancyLineEdit::ValidationFunction m_validator; + std::optional m_validator; std::function m_openTerminal; bool m_undoRedoEnabled = true; @@ -1066,9 +1066,9 @@ void StringAspect::setValidationFunction(const FancyLineEdit::ValidationFunction { d->m_validator = validator; if (d->m_lineEditDisplay) - d->m_lineEditDisplay->setValidationFunction(d->m_validator); + d->m_lineEditDisplay->setValidationFunction(*d->m_validator); else if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->setValidationFunction(d->m_validator); + d->m_pathChooserDisplay->setValidationFunction(*d->m_validator); } void StringAspect::setOpenTerminalHandler(const std::function &openTerminal) @@ -1119,8 +1119,9 @@ void StringAspect::addToLayout(LayoutItem &parent) d->m_pathChooserDisplay->setExpectedKind(d->m_expectedKind); if (!d->m_historyCompleterKey.isEmpty()) d->m_pathChooserDisplay->setHistoryCompleter(d->m_historyCompleterKey); + if (d->m_validator) - d->m_pathChooserDisplay->setValidationFunction(d->m_validator); + d->m_pathChooserDisplay->setValidationFunction(*d->m_validator); d->m_pathChooserDisplay->setEnvironment(d->m_environment); d->m_pathChooserDisplay->setBaseDirectory(d->m_baseFileName); d->m_pathChooserDisplay->setOpenTerminalHandler(d->m_openTerminal); @@ -1163,8 +1164,9 @@ void StringAspect::addToLayout(LayoutItem &parent) d->m_lineEditDisplay->setPlaceholderText(d->m_placeHolderText); if (!d->m_historyCompleterKey.isEmpty()) d->m_lineEditDisplay->setHistoryCompleter(d->m_historyCompleterKey); + if (d->m_validator) - d->m_lineEditDisplay->setValidationFunction(d->m_validator); + d->m_lineEditDisplay->setValidationFunction(*d->m_validator); d->m_lineEditDisplay->setTextKeepingActiveCursor(displayedString); d->m_lineEditDisplay->setReadOnly(isReadOnly()); d->m_lineEditDisplay->setValidatePlaceHolder(d->m_validatePlaceHolder); diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index 2bf50a70fa1..e46ca6b8460 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -11,15 +11,19 @@ #include "utilsicons.h" #include "utilstr.h" +#include + #include +#include #include #include #include -#include -#include #include +#include #include #include +#include +#include #include #include @@ -45,8 +49,7 @@ \li A history completer. - \li The ability to validate the contents of the text field by overriding - virtual \c validate() function in derived clases. + \li The ability to validate the contents of the text field by setting the \a validationFunction. \endlist When invalid, the text color will turn red and a tooltip will @@ -120,17 +123,29 @@ public: const QColor m_errorTextColor; const QColor m_placeholderTextColor; QString m_errorMessage; + + SpinnerSolution::Spinner *m_spinner = nullptr; + QTimer m_spinnerDelayTimer; + + std::unique_ptr> m_validatorWatcher; }; -FancyLineEditPrivate::FancyLineEditPrivate(FancyLineEdit *parent) : - QObject(parent), - m_lineEdit(parent), - m_completionShortcut(completionShortcut()->key(), parent), - m_okTextColor(creatorTheme()->color(Theme::TextColorNormal)), - m_errorTextColor(creatorTheme()->color(Theme::TextColorError)), - m_placeholderTextColor(QApplication::palette().color(QPalette::PlaceholderText)) - +FancyLineEditPrivate::FancyLineEditPrivate(FancyLineEdit *parent) + : QObject(parent) + , m_lineEdit(parent) + , m_completionShortcut(completionShortcut()->key(), parent) + , m_okTextColor(creatorTheme()->color(Theme::TextColorNormal)) + , m_errorTextColor(creatorTheme()->color(Theme::TextColorError)) + , m_placeholderTextColor(QApplication::palette().color(QPalette::PlaceholderText)) + , m_spinner(new SpinnerSolution::Spinner(SpinnerSolution::SpinnerSize::Small, m_lineEdit)) { + m_spinner->setVisible(false); + m_spinnerDelayTimer.setInterval(200); + m_spinnerDelayTimer.setSingleShot(true); + connect(&m_spinnerDelayTimer, &QTimer::timeout, m_spinner, [spinner = m_spinner] { + spinner->setVisible(true); + }); + m_completionShortcut.setContext(Qt::WidgetShortcut); connect(completionShortcut(), &CompletionShortcut::keyChanged, &m_completionShortcut, &QShortcut::setKey); @@ -475,21 +490,20 @@ void FancyLineEdit::setValidatePlaceHolder(bool on) d->m_validatePlaceHolder = on; } -void FancyLineEdit::validate() +void FancyLineEdit::handleValidationResult(AsyncValidationResult result, const QString &oldText) { - const QString t = text(); + d->m_spinner->setVisible(false); + d->m_spinnerDelayTimer.stop(); - if (d->m_isFiltering){ - if (t != d->m_lastFilterText) { - d->m_lastFilterText = t; - emit filterChanged(t); - } - } + const QString newText = result ? *result : oldText; + if (!result) + d->m_errorMessage = result.error(); + else + d->m_errorMessage.clear(); - d->m_errorMessage.clear(); // Are we displaying the placeholder text? - const bool isDisplayingPlaceholderText = !placeholderText().isEmpty() && t.isEmpty(); - const bool validates = d->m_validationFunction(this, &d->m_errorMessage); + const bool isDisplayingPlaceholderText = !placeholderText().isEmpty() && newText.isEmpty(); + const bool validates = result.has_value(); const State newState = isDisplayingPlaceholderText ? DisplayingPlaceholderText : (validates ? Valid : Invalid); if (!validates || d->m_toolTipSet) { @@ -504,18 +518,20 @@ void FancyLineEdit::validate() d->m_firstChange = false; QPalette p = palette(); - p.setColor(QPalette::Active, QPalette::Text, - newState == Invalid ? d->m_errorTextColor : d->m_okTextColor); - p.setColor(QPalette::Active, QPalette::PlaceholderText, - validates || !d->m_validatePlaceHolder - ? d->m_placeholderTextColor : d->m_errorTextColor); + p.setColor(QPalette::Active, + QPalette::Text, + newState == Invalid ? d->m_errorTextColor : d->m_okTextColor); + p.setColor(QPalette::Active, + QPalette::PlaceholderText, + validates || !d->m_validatePlaceHolder ? d->m_placeholderTextColor + : d->m_errorTextColor); setPalette(p); if (validHasChanged) emit validChanged(newState == Valid); } - const QString fixedString = fixInputString(t); - if (t != fixedString) { + const QString fixedString = fixInputString(newText); + if (newText != fixedString) { const int cursorPos = cursorPosition(); QSignalBlocker blocker(this); setText(fixedString); @@ -523,15 +539,80 @@ void FancyLineEdit::validate() } // Check buttons. - if (d->m_oldText.isEmpty() || t.isEmpty()) { + if (d->m_oldText.isEmpty() || newText.isEmpty()) { for (auto &button : std::as_const(d->m_iconbutton)) { if (button->hasAutoHide()) - button->animateShow(!t.isEmpty()); + button->animateShow(!newText.isEmpty()); } - d->m_oldText = t; + d->m_oldText = newText; } - handleChanged(t); + handleChanged(newText); +} + +void FancyLineEdit::validate() +{ + if (d->m_validationFunction.index() == 0) { + AsyncValidationFunction &validationFunction = std::get<0>(d->m_validationFunction); + if (!validationFunction) + return; + + if (d->m_validatorWatcher) + d->m_validatorWatcher->cancel(); + + const QString oldText = text(); + + if (d->m_isFiltering) { + if (oldText != d->m_lastFilterText) { + d->m_lastFilterText = oldText; + emit filterChanged(oldText); + } + } + + d->m_validatorWatcher = std::make_unique>(); + connect(d->m_validatorWatcher.get(), + &QFutureWatcher::finished, + this, + [this, oldText]() { + FancyLineEdit::AsyncValidationResult result = d->m_validatorWatcher->result(); + + handleValidationResult(result, oldText); + }); + + d->m_state = Validating; + d->m_spinnerDelayTimer.start(); + + AsyncValidationFuture future = validationFunction(text()); + d->m_validatorWatcher->setFuture(future); + + return; + } + + if (d->m_validationFunction.index() == 1) { + auto &validationFunction = std::get<1>(d->m_validationFunction); + if (!validationFunction) + return; + + const QString t = text(); + + if (d->m_isFiltering) { + if (t != d->m_lastFilterText) { + d->m_lastFilterText = t; + emit filterChanged(t); + } + } + + QString error; + const bool validates = validationFunction(this, &error); + expected_str result; + + if (validates) + result = t; + else + result = make_unexpected(error); + + handleValidationResult(result, t); + } } QString FancyLineEdit::fixInputString(const QString &string) diff --git a/src/libs/utils/fancylineedit.h b/src/libs/utils/fancylineedit.h index eb54bc8d866..27a36974e44 100644 --- a/src/libs/utils/fancylineedit.h +++ b/src/libs/utils/fancylineedit.h @@ -6,8 +6,10 @@ #include "utils_global.h" #include "completinglineedit.h" +#include "expected.h" #include +#include #include @@ -98,8 +100,13 @@ public: // Validation // line edit, (out)errorMessage -> valid? - using ValidationFunction = std::function; - enum State { Invalid, DisplayingPlaceholderText, Valid }; + using AsyncValidationResult = Utils::expected_str; + using AsyncValidationFuture = QFuture; + using AsyncValidationFunction = std::function; + using SynchronousValidationFunction = std::function; + using ValidationFunction = std::variant; + + enum State { Invalid, DisplayingPlaceholderText, Valid, Validating }; State state() const; bool isValid() const; @@ -138,6 +145,8 @@ protected: private: void iconClicked(FancyLineEdit::Side); + void handleValidationResult(AsyncValidationResult result, const QString &oldText); + static bool validateWithValidator(FancyLineEdit *edit, QString *errorMessage); // Unimplemented, to force the user to make a decision on // whether to use setHistoryCompleter() or setSpecialCompleter(). diff --git a/src/libs/utils/layoutbuilder.cpp b/src/libs/utils/layoutbuilder.cpp index 881dc613587..1fceaf11b87 100644 --- a/src/libs/utils/layoutbuilder.cpp +++ b/src/libs/utils/layoutbuilder.cpp @@ -888,6 +888,18 @@ LayoutItem columnStretch(int column, int stretch) }; } +LayoutItem fieldGrowthPolicy(QFormLayout::FieldGrowthPolicy policy) +{ + return [policy](QObject *target) { + if (auto form = qobject_cast(target)) { + form->setFieldGrowthPolicy(policy); + } else { + QTC_CHECK(false); + } + }; +} + + // Id based setters LayoutItem id(ID &out) diff --git a/src/libs/utils/layoutbuilder.h b/src/libs/utils/layoutbuilder.h index 4a756139897..72fefc1b781 100644 --- a/src/libs/utils/layoutbuilder.h +++ b/src/libs/utils/layoutbuilder.h @@ -6,6 +6,7 @@ #include #include #include +#include #include @@ -215,6 +216,8 @@ QTCREATOR_UTILS_EXPORT LayoutItem resize(int, int); QTCREATOR_UTILS_EXPORT LayoutItem columnStretch(int column, int stretch); QTCREATOR_UTILS_EXPORT LayoutItem spacing(int); QTCREATOR_UTILS_EXPORT LayoutItem windowTitle(const QString &windowTitle); +QTCREATOR_UTILS_EXPORT LayoutItem fieldGrowthPolicy(QFormLayout::FieldGrowthPolicy policy); + // "Getters" diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 1fe1e962560..a13471ef07f 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -3,6 +3,7 @@ #include "pathchooser.h" +#include "async.h" #include "commandline.h" #include "environment.h" #include "fileutils.h" @@ -15,6 +16,7 @@ #include "utilstr.h" #include +#include #include #include #include @@ -531,100 +533,73 @@ void PathChooser::setToolTip(const QString &toolTip) d->m_lineEdit->setToolTip(toolTip); } -FancyLineEdit::ValidationFunction PathChooser::defaultValidationFunction() const +static FancyLineEdit::AsyncValidationResult validatePath(FilePath filePath, + const QString &defaultValue, + PathChooser::Kind kind) { - return std::bind(&PathChooser::validatePath, this, std::placeholders::_1, std::placeholders::_2); -} - -bool PathChooser::validatePath(FancyLineEdit *edit, QString *errorMessage) const -{ - QString input = edit->text(); - - if (input.isEmpty()) { - if (!d->m_defaultValue.isEmpty()) { - input = d->m_defaultValue; - } else { - if (errorMessage) - *errorMessage = Tr::tr("The path must not be empty."); - return false; - } - } - - const FilePath filePath = d->expandedPath(FilePath::fromUserInput(input)); if (filePath.isEmpty()) { - if (errorMessage) - *errorMessage = Tr::tr("The path \"%1\" expanded to an empty string.").arg(input); - return false; + if (!defaultValue.isEmpty()) { + filePath = FilePath::fromUserInput(defaultValue); + } else { + return make_unexpected(Tr::tr("The path must not be empty.")); + } } // Check if existing - switch (d->m_acceptingKind) { + switch (kind) { case PathChooser::ExistingDirectory: if (!filePath.exists()) { - if (errorMessage) - *errorMessage = Tr::tr("The path \"%1\" does not exist.").arg(filePath.toUserOutput()); - return false; + return make_unexpected( + Tr::tr("The path \"%1\" does not exist.").arg(filePath.toUserOutput())); } if (!filePath.isDir()) { - if (errorMessage) - *errorMessage = Tr::tr("The path \"%1\" is not a directory.").arg(filePath.toUserOutput()); - return false; + return make_unexpected( + Tr::tr("The path \"%1\" is not a directory.").arg(filePath.toUserOutput())); } break; case PathChooser::File: if (!filePath.exists()) { - if (errorMessage) - *errorMessage = Tr::tr("The path \"%1\" does not exist.").arg(filePath.toUserOutput()); - return false; + return make_unexpected( + Tr::tr("The path \"%1\" does not exist.").arg(filePath.toUserOutput())); } if (!filePath.isFile()) { - if (errorMessage) - *errorMessage = Tr::tr("The path \"%1\" is not a file.").arg(filePath.toUserOutput()); - return false; + return make_unexpected( + Tr::tr("The path \"%1\" is not a file.").arg(filePath.toUserOutput())); } break; case PathChooser::SaveFile: if (!filePath.parentDir().exists()) { - if (errorMessage) - *errorMessage = Tr::tr("The directory \"%1\" does not exist.").arg(filePath.toUserOutput()); - return false; + return make_unexpected( + Tr::tr("The directory \"%1\" does not exist.").arg(filePath.toUserOutput())); } if (filePath.exists() && filePath.isDir()) { - if (errorMessage) - *errorMessage = Tr::tr("The path \"%1\" is not a file.").arg(filePath.toUserOutput()); - return false; + return make_unexpected( + Tr::tr("The path \"%1\" is not a file.").arg(filePath.toUserOutput())); } break; case PathChooser::ExistingCommand: if (!filePath.exists()) { - if (errorMessage) - *errorMessage = Tr::tr("The path \"%1\" does not exist.").arg(filePath.toUserOutput()); - return false; + return make_unexpected( + Tr::tr("The path \"%1\" does not exist.").arg(filePath.toUserOutput())); } if (!filePath.isExecutableFile()) { - if (errorMessage) - *errorMessage = Tr::tr("The path \"%1\" is not an executable file.").arg(filePath.toUserOutput()); - return false; + return make_unexpected( + Tr::tr("The path \"%1\" is not an executable file.").arg(filePath.toUserOutput())); } break; case PathChooser::Directory: if (filePath.exists() && !filePath.isDir()) { - if (errorMessage) - *errorMessage = Tr::tr("The path \"%1\" is not a directory.").arg(filePath.toUserOutput()); - return false; + return make_unexpected( + Tr::tr("The path \"%1\" is not a directory.").arg(filePath.toUserOutput())); } if (filePath.osType() == OsTypeWindows && !filePath.startsWithDriveLetter() && !filePath.startsWith("\\\\") && !filePath.startsWith("//")) { - if (errorMessage) - *errorMessage = Tr::tr("Invalid path \"%1\".").arg(filePath.toUserOutput()); - return false; + return make_unexpected(Tr::tr("Invalid path \"%1\".").arg(filePath.toUserOutput())); } break; case PathChooser::Command: if (filePath.exists() && !filePath.isExecutableFile()) { - if (errorMessage) - *errorMessage = Tr::tr("Cannot execute \"%1\".").arg(filePath.toUserOutput()); - return false; + return make_unexpected(Tr::tr("Cannot execute \"%1\".").arg(filePath.toUserOutput())); } break; @@ -632,9 +607,34 @@ bool PathChooser::validatePath(FancyLineEdit *edit, QString *errorMessage) const ; } - if (errorMessage) - *errorMessage = Tr::tr("Full path: \"%1\"").arg(filePath.toUserOutput()); - return true; + return filePath.toUserOutput(); +} + +FancyLineEdit::AsyncValidationFunction PathChooser::defaultValidationFunction() const +{ + return [this](const QString &text) -> FancyLineEdit::AsyncValidationFuture { + if (text.isEmpty()) { + return QtFuture::makeReadyFuture((Utils::expected_str( + make_unexpected(Tr::tr("The path must not be empty."))))); + } + + const FilePath expanded = d->expandedPath(FilePath::fromUserInput(text)); + + if (expanded.isEmpty()) { + return QtFuture::makeReadyFuture((Utils::expected_str( + make_unexpected(Tr::tr("The path \"%1\" expanded to an empty string.") + .arg(expanded.toUserOutput()))))); + } + + return Utils::asyncRun( + [expanded, + defVal = d->m_defaultValue, + kind = d->m_acceptingKind, + env = d->m_environment, + baseDirectory = d->m_baseDirectory]() -> FancyLineEdit::AsyncValidationResult { + return validatePath(expanded, defVal, kind); + }); + }; } void PathChooser::setValidationFunction(const FancyLineEdit::ValidationFunction &fn) diff --git a/src/libs/utils/pathchooser.h b/src/libs/utils/pathchooser.h index 62a370185da..45930a61270 100644 --- a/src/libs/utils/pathchooser.h +++ b/src/libs/utils/pathchooser.h @@ -80,7 +80,7 @@ public: /** Returns the suggested label title when used in a form layout. */ static QString label(); - FancyLineEdit::ValidationFunction defaultValidationFunction() const; + FancyLineEdit::AsyncValidationFunction defaultValidationFunction() const; void setValidationFunction(const FancyLineEdit::ValidationFunction &fn); /** Return the home directory, which needs some fixing under Windows. */ @@ -153,7 +153,6 @@ private: // Use filePath().toString() or better suitable conversions. QString path() const { return filePath().toString(); } - bool validatePath(FancyLineEdit *edit, QString *errorMessage) const; // Returns overridden title or the one from QString makeDialogTitle(const QString &title); void slotBrowse(bool remote); diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index 0b1a0a63557..8452f48c50b 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -212,6 +212,8 @@ bool ProjectIntroPage::validate() return false; case FancyLineEdit::Valid: break; + case FancyLineEdit::Validating: + break; } // Check existence of the directory diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index 2c97bdc8456..c672cf4b94d 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -14,10 +14,12 @@ #include <projectexplorer/projectexplorericons.h> #include <utils/algorithm.h> +#include <utils/async.h> #include <utils/detailswidget.h> #include <utils/environment.h> #include <utils/fileutils.h> #include <utils/hostosinfo.h> +#include <utils/layoutbuilder.h> #include <utils/pathchooser.h> #include <utils/persistentsettings.h> #include <utils/process.h> @@ -29,6 +31,7 @@ #include <QDir> #include <QFileInfo> #include <QFormLayout> +#include <QFutureWatcher> #include <QHeaderView> #include <QLabel> #include <QLineEdit> @@ -101,7 +104,6 @@ private: void setAbis(const QStringList &abiNames); QLineEdit *m_displayNameLineEdit; - QLineEdit *m_typeLineEdit; QLabel *m_cdbLabel; PathChooser *m_binaryChooser; bool m_autodetected = false; @@ -109,12 +111,12 @@ private: DebuggerEngineType m_engineType = NoEngineType; QVariant m_id; - QLabel *m_abisLabel; - QLineEdit *m_abis; - QLabel *m_versionLabel; - QLineEdit *m_version; - QLabel *m_workingDirectoryLabel; + QLabel *m_abis; + QLabel *m_version; + QLabel *m_type; + PathChooser *m_workingDirectoryChooser; + QFutureWatcher<DebuggerItem> m_updateWatcher; }; // -------------------------------------------------------------------------- @@ -311,52 +313,47 @@ DebuggerItemConfigWidget::DebuggerItemConfigWidget() { m_displayNameLineEdit = new QLineEdit(this); - m_typeLineEdit = new QLineEdit(this); - m_typeLineEdit->setEnabled(false); - m_binaryChooser = new PathChooser(this); m_binaryChooser->setExpectedKind(PathChooser::ExistingCommand); m_binaryChooser->setMinimumWidth(400); m_binaryChooser->setHistoryCompleter("DebuggerPaths"); - m_binaryChooser->setValidationFunction([this](FancyLineEdit *edit, QString *errorMessage) { - if (!m_binaryChooser->defaultValidationFunction()(edit, errorMessage)) - return false; - DebuggerItem item; - item.setCommand(m_binaryChooser->filePath()); - errorMessage->clear(); - item.reinitializeFromFile(errorMessage); - return errorMessage->isEmpty(); - }); + m_binaryChooser->setValidationFunction( + [this](const QString &text) -> FancyLineEdit::AsyncValidationFuture { + return m_binaryChooser->defaultValidationFunction()(text).then( + [](const FancyLineEdit::AsyncValidationResult &result) + -> FancyLineEdit::AsyncValidationResult { + if (!result) + return result; + + DebuggerItem item; + item.setCommand(FilePath::fromUserInput(result.value())); + QString errorMessage; + item.reinitializeFromFile(&errorMessage); + + if (!errorMessage.isEmpty()) + return make_unexpected(errorMessage); + + return result.value(); + }); + }); m_binaryChooser->setAllowPathFromDevice(true); - m_workingDirectoryLabel = new QLabel(Tr::tr("ABIs:")); m_workingDirectoryChooser = new PathChooser(this); m_workingDirectoryChooser->setExpectedKind(PathChooser::Directory); m_workingDirectoryChooser->setMinimumWidth(400); m_workingDirectoryChooser->setHistoryCompleter("DebuggerPaths"); - m_cdbLabel = new QLabel(this); - m_cdbLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); - m_cdbLabel->setOpenExternalLinks(true); + auto makeInteractiveLabel = []() { + auto label = new QLabel; + label->setTextInteractionFlags(Qt::TextEditorInteraction | Qt::TextBrowserInteraction); + label->setOpenExternalLinks(true); + return label; + }; - m_versionLabel = new QLabel(Tr::tr("Version:")); - m_version = new QLineEdit(this); - m_version->setPlaceholderText(Tr::tr("Unknown")); - m_version->setEnabled(false); - - m_abisLabel = new QLabel(Tr::tr("Working directory:")); - m_abis = new QLineEdit(this); - m_abis->setEnabled(false); - - auto formLayout = new QFormLayout(this); - formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); - formLayout->addRow(new QLabel(Tr::tr("Name:")), m_displayNameLineEdit); - formLayout->addRow(m_cdbLabel); - formLayout->addRow(new QLabel(Tr::tr("Path:")), m_binaryChooser); - formLayout->addRow(new QLabel(Tr::tr("Type:")), m_typeLineEdit); - formLayout->addRow(m_abisLabel, m_abis); - formLayout->addRow(m_versionLabel, m_version); - formLayout->addRow(m_workingDirectoryLabel, m_workingDirectoryChooser); + m_cdbLabel = makeInteractiveLabel(); + m_version = makeInteractiveLabel(); + m_abis = makeInteractiveLabel(); + m_type = makeInteractiveLabel(); connect(m_binaryChooser, &PathChooser::textChanged, this, &DebuggerItemConfigWidget::binaryPathHasChanged); @@ -364,6 +361,30 @@ DebuggerItemConfigWidget::DebuggerItemConfigWidget() this, &DebuggerItemConfigWidget::store); connect(m_displayNameLineEdit, &QLineEdit::textChanged, this, &DebuggerItemConfigWidget::store); + + connect(&m_updateWatcher, &QFutureWatcher<DebuggerItem>::finished, this, [this] { + if (m_updateWatcher.future().resultCount() > 0) { + DebuggerItem tmp = m_updateWatcher.result(); + setAbis(tmp.abiNames()); + m_version->setText(tmp.version()); + m_engineType = tmp.engineType(); + m_type->setText(tmp.engineTypeName()); + } + }); + + // clang-format off + using namespace Layouting; + Form { + fieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow), + Tr::tr("Name:"), m_displayNameLineEdit, br, + Tr::tr("Path:"), m_binaryChooser, br, + m_cdbLabel, br, + Tr::tr("Type:"), m_type, br, + Tr::tr("ABIs:"), m_abis, br, + Tr::tr("Version:"), m_version, br, + Tr::tr("Working directory:"), m_workingDirectoryChooser, br, + }.attachTo(this); + // clang-format on } DebuggerItem DebuggerItemConfigWidget::item() const @@ -413,20 +434,12 @@ void DebuggerItemConfigWidget::load(const DebuggerItem *item) m_displayNameLineEdit->setEnabled(!item->isAutoDetected()); m_displayNameLineEdit->setText(item->unexpandedDisplayName()); - m_typeLineEdit->setText(item->engineTypeName()); + m_type->setText(item->engineTypeName()); m_binaryChooser->setReadOnly(item->isAutoDetected()); m_binaryChooser->setFilePath(item->command()); m_binaryChooser->setExpectedKind(m_generic ? PathChooser::Any : PathChooser::ExistingCommand); - m_abisLabel->setVisible(!m_generic); - m_abis->setVisible(!m_generic); - m_versionLabel->setVisible(!m_generic); - m_version->setVisible(!m_generic); - m_workingDirectoryLabel->setVisible(!m_generic); - m_workingDirectoryChooser->setVisible(!m_generic); - - m_workingDirectoryChooser->setReadOnly(item->isAutoDetected()); m_workingDirectoryChooser->setFilePath(item->workingDirectory()); @@ -462,16 +475,21 @@ void DebuggerItemConfigWidget::binaryPathHasChanged() return; if (!m_generic) { + m_updateWatcher.cancel(); + DebuggerItem tmp; if (m_binaryChooser->filePath().isExecutableFile()) { tmp = item(); - tmp.reinitializeFromFile(); + m_updateWatcher.setFuture(Utils::asyncRun([tmp]() mutable { + tmp.reinitializeFromFile(); + return tmp; + })); + } else { + setAbis(tmp.abiNames()); + m_version->setText(tmp.version()); + m_engineType = tmp.engineType(); + m_type->setText(tmp.engineTypeName()); } - - setAbis(tmp.abiNames()); - m_version->setText(tmp.version()); - m_engineType = tmp.engineType(); - m_typeLineEdit->setText(tmp.engineTypeName()); } store(); diff --git a/src/plugins/modeleditor/extpropertiesmview.cpp b/src/plugins/modeleditor/extpropertiesmview.cpp index 4977d816b18..b57d1bc2a96 100644 --- a/src/plugins/modeleditor/extpropertiesmview.cpp +++ b/src/plugins/modeleditor/extpropertiesmview.cpp @@ -41,9 +41,6 @@ void ExtPropertiesMView::visitMPackage(const qmt::MPackage *package) m_configPath = new Utils::PathChooser(m_topWidget); m_configPath->setPromptDialogTitle(Tr::tr("Select Custom Configuration Folder")); m_configPath->setExpectedKind(Utils::PathChooser::ExistingDirectory); - m_configPath->setValidationFunction([=](Utils::FancyLineEdit *edit, QString *errorMessage) { - return edit->text().isEmpty() || m_configPath->defaultValidationFunction()(edit, errorMessage); - }); m_configPath->setInitialBrowsePathBackup( Utils::FilePath::fromString(project->fileName()).absolutePath()); addRow(Tr::tr("Config path:"), m_configPath, "configpath"); diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index 606911654fd..071e8b5f586 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -42,22 +42,23 @@ BuildDirectoryAspect::BuildDirectoryAspect(const BuildConfiguration *bc) setSettingsKey("ProjectExplorer.BuildConfiguration.BuildDirectory"); setLabelText(Tr::tr("Build directory:")); setExpectedKind(Utils::PathChooser::Directory); - setValidationFunction([this](FancyLineEdit *edit, QString *error) { - const FilePath fixedDir = fixupDir(FilePath::fromUserInput(edit->text())); - if (!fixedDir.isEmpty()) - edit->setText(fixedDir.toUserOutput()); - const FilePath newPath = FilePath::fromUserInput(edit->text()); + setValidationFunction([this](QString text) -> FancyLineEdit::AsyncValidationFuture { + const FilePath fixedDir = fixupDir(FilePath::fromUserInput(text)); + if (!fixedDir.isEmpty()) + text = fixedDir.toUserOutput(); + + const FilePath newPath = FilePath::fromUserInput(text); const auto buildDevice = BuildDeviceKitAspect::device(d->target->kit()); if (buildDevice && buildDevice->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE && !buildDevice->rootPath().ensureReachable(newPath)) { - *error = Tr::tr("The build directory is not reachable from the build device."); - return false; + return QtFuture::makeReadyFuture((Utils::expected_str<QString>(make_unexpected( + Tr::tr("The build directory is not reachable from the build device."))))); } - - return pathChooser() ? pathChooser()->defaultValidationFunction()(edit, error) : true; + return pathChooser()->defaultValidationFunction()(text); }); + setOpenTerminalHandler([this, bc] { Core::FileUtils::openTerminal(FilePath::fromString(value()), bc->environment()); }); diff --git a/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp b/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp index ff74701cf71..856c5fdd1d4 100644 --- a/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp +++ b/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp @@ -40,13 +40,12 @@ static QStringList qt_clean_filter_list(const QString &filter) return f.split(QLatin1Char(' '), Qt::SkipEmptyParts); } -static bool validateLibraryPath(const FilePath &filePath, - const PathChooser *pathChooser, - QString *errorMessage) +static FancyLineEdit::AsyncValidationResult validateLibraryPath(const QString &input, + const QString &promptDialogFilter) { - Q_UNUSED(errorMessage) + const FilePath filePath = FilePath::fromUserInput(input); if (!filePath.exists()) - return false; + return make_unexpected(Tr::tr("File does not exist.")); const QString fileName = filePath.fileName(); @@ -55,14 +54,14 @@ static bool validateLibraryPath(const FilePath &filePath, ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption; - const QStringList filters = qt_clean_filter_list(pathChooser->promptDialogFilter()); + const QStringList filters = qt_clean_filter_list(promptDialogFilter); for (const QString &filter : filters) { QString pattern = QRegularExpression::wildcardToRegularExpression(filter); QRegularExpression regExp(pattern, option); if (regExp.match(fileName).hasMatch()) - return true; - } - return false; + return input; + } + return make_unexpected(Tr::tr("File does not match filter.")); } AddLibraryWizard::AddLibraryWizard(const FilePath &proFile, QWidget *parent) @@ -182,10 +181,15 @@ DetailsPage::DetailsPage(AddLibraryWizard *parent) PathChooser * const libPathChooser = m_libraryDetailsWidget->libraryPathChooser; libPathChooser->setHistoryCompleter("Qmake.LibDir.History"); - const auto pathValidator = [libPathChooser](FancyLineEdit *edit, QString *errorMessage) { - return libPathChooser->defaultValidationFunction()(edit, errorMessage) - && validateLibraryPath(libPathChooser->filePath(), - libPathChooser, errorMessage); + const auto pathValidator = + [libPathChooser](const QString &text) -> FancyLineEdit::AsyncValidationFuture { + return libPathChooser->defaultValidationFunction()(text).then( + [pDialogFilter = libPathChooser->promptDialogFilter()]( + const FancyLineEdit::AsyncValidationResult &result) { + if (!result) + return result; + return validateLibraryPath(result.value(), pDialogFilter); + }); }; libPathChooser->setValidationFunction(pathValidator); setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Details")); diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 60e58d78d6b..4b4442ff13a 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -934,21 +934,19 @@ static std::optional<FilePath> settingsDirForQtDir(const FilePath &baseDirectory return {}; } -static bool validateQtInstallDir(PathChooser *input, QString *errorString) +static FancyLineEdit::AsyncValidationResult validateQtInstallDir(const QString &input, + const FilePath &baseDirectory) { - const FilePath qtDir = input->rawFilePath(); - if (!settingsDirForQtDir(input->baseDirectory(), qtDir)) { - if (errorString) { - const QStringList filesToCheck = settingsFilesToCheck() + qtversionFilesToCheck(); - *errorString = "<html><body>" - + Tr::tr("Qt installation information was not found in \"%1\". " - "Choose a directory that contains one of the files %2") - .arg(qtDir.toUserOutput(), - "<pre>" + filesToCheck.join('\n') + "</pre>"); - } - return false; + const FilePath qtDir = FilePath::fromUserInput(input); + if (!settingsDirForQtDir(baseDirectory, qtDir)) { + const QStringList filesToCheck = settingsFilesToCheck() + qtversionFilesToCheck(); + return make_unexpected( + "<html><body>" + + Tr::tr("Qt installation information was not found in \"%1\". " + "Choose a directory that contains one of the files %2") + .arg(qtDir.toUserOutput(), "<pre>" + filesToCheck.join('\n') + "</pre>")); } - return true; + return input; } static FilePath defaultQtInstallationPath() @@ -976,12 +974,17 @@ void QtOptionsPageWidget::linkWithQt() pathInput->setBaseDirectory(FilePath::fromString(QCoreApplication::applicationDirPath())); pathInput->setPromptDialogTitle(title); pathInput->setMacroExpander(nullptr); - pathInput->setValidationFunction([pathInput](FancyLineEdit *input, QString *errorString) { - if (pathInput->defaultValidationFunction() - && !pathInput->defaultValidationFunction()(input, errorString)) - return false; - return validateQtInstallDir(pathInput, errorString); - }); + pathInput->setValidationFunction( + [pathInput](const QString &input) -> FancyLineEdit::AsyncValidationFuture { + return pathInput->defaultValidationFunction()(input).then( + [baseDir = pathInput->baseDirectory()]( + const FancyLineEdit::AsyncValidationResult &result) + -> FancyLineEdit::AsyncValidationResult { + if (!result) + return result; + return validateQtInstallDir(result.value(), baseDir); + }); + }); const std::optional<FilePath> currentLink = currentlyLinkedQtDir(nullptr); pathInput->setFilePath(currentLink ? *currentLink : defaultQtInstallationPath()); pathInput->setAllowPathFromDevice(true); diff --git a/src/plugins/squish/squishsettings.cpp b/src/plugins/squish/squishsettings.cpp index 5b069f35fcb..597b292a901 100644 --- a/src/plugins/squish/squishsettings.cpp +++ b/src/plugins/squish/squishsettings.cpp @@ -46,17 +46,23 @@ SquishSettings::SquishSettings() squishPath.setLabelText(Tr::tr("Squish path:")); squishPath.setExpectedKind(PathChooser::ExistingDirectory); squishPath.setPlaceHolderText(Tr::tr("Path to Squish installation")); - squishPath.setValidationFunction([this](FancyLineEdit *edit, QString *error) { - QTC_ASSERT(edit, return false); - if (!squishPath.pathChooser()->defaultValidationFunction()(edit, error)) - return false; - const FilePath squishServer = FilePath::fromUserInput(edit->text()) - .pathAppended(HostOsInfo::withExecutableSuffix("bin/squishserver")); - const bool valid = squishServer.isExecutableFile(); - if (!valid && error) - *error = Tr::tr("Path does not contain server executable at its default location."); - return valid; - }); + squishPath.setValidationFunction( + [this](const QString &text) -> FancyLineEdit::AsyncValidationFuture { + return squishPath.pathChooser()->defaultValidationFunction()(text).then( + [](const FancyLineEdit::AsyncValidationResult &result) + -> FancyLineEdit::AsyncValidationResult { + if (!result) + return result; + + const FilePath squishServer + = FilePath::fromUserInput(result.value()) + .pathAppended(HostOsInfo::withExecutableSuffix("bin/squishserver")); + if (!squishServer.isExecutableFile()) + return make_unexpected(Tr::tr( + "Path does not contain server executable at its default location.")); + return result.value(); + }); + }); licensePath.setSettingsKey("LicensePath"); licensePath.setLabelText(Tr::tr("License path:")); From 32dc43693fbc1e9d5301653da9310dcccfb83bcc Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 17:09:39 +0200 Subject: [PATCH 0080/1777] CMake: Use a FilePathAspect as base for SourceDirectoryAspect Closer to its true nature. Change-Id: I96b86690eb138814009aef0f06c87fca8451cfe9 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index 6d709d58a2e..bf7ff14c74b 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -121,7 +121,7 @@ public: AdditionalCMakeOptionsAspect(); }; -class SourceDirectoryAspect final : public Utils::StringAspect +class SourceDirectoryAspect final : public Utils::FilePathAspect { Q_OBJECT From b98a08587e8b4a3fd4d284d54d7a390f2f894825 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 16:27:46 +0200 Subject: [PATCH 0081/1777] Vcs: Use a FilePathAspect for VcsBaseSettings::path Change-Id: Ic92ef43514f7f4004774ebbd9bb49c026dc735ba Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/git/gitclient.cpp | 6 +++--- src/plugins/git/gitsettings.cpp | 4 ++-- src/plugins/vcsbase/vcsbaseclientsettings.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 70954ff4214..764feb0d08b 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -2108,8 +2108,8 @@ bool GitClient::synchronousApplyPatch(const FilePath &workingDirectory, Environment GitClient::processEnvironment() const { Environment environment = VcsBaseClientImpl::processEnvironment(); - const QString gitPath = settings().path.value(); - environment.prependOrSetPath(FilePath::fromUserInput(gitPath)); + const FilePath gitPath = settings().path(); + environment.prependOrSetPath(gitPath); if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment.value()) { QString homePath; if (qtcEnvironmentVariableIsEmpty("HOMESHARE")) { @@ -2457,7 +2457,7 @@ void GitClient::tryLaunchingGitK(const Environment &env, // This should always use Process::startDetached (as not to kill // the child), but that does not have an environment parameter. - if (!settings().path.value().isEmpty()) { + if (!settings().path().isEmpty()) { auto process = new Process(const_cast<GitClient*>(this)); process->setWorkingDirectory(workingDirectory); process->setEnvironment(env); diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index 4ef786c5354..6c4bd4a480e 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -161,7 +161,7 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const if (tryResolve) { resolvedBinPath = binaryPath(); if (!resolvedBinPath.isAbsolutePath()) - resolvedBinPath = resolvedBinPath.searchInPath({path.filePath()}, FilePath::PrependToPath); + resolvedBinPath = resolvedBinPath.searchInPath({path()}, FilePath::PrependToPath); tryResolve = false; } @@ -170,7 +170,7 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const *ok = false; if (errorMessage) *errorMessage = Tr::tr("The binary \"%1\" could not be located in the path \"%2\"") - .arg(binaryPath.value(), path.value()); + .arg(binaryPath.value(), path().toUserOutput()); } return resolvedBinPath; } diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.h b/src/plugins/vcsbase/vcsbaseclientsettings.h index 6e1f227f218..77aa9770b0f 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.h +++ b/src/plugins/vcsbase/vcsbaseclientsettings.h @@ -20,7 +20,7 @@ public: Utils::StringAspect userEmail{this}; Utils::IntegerAspect logCount{this}; Utils::IntegerAspect timeout{this}; // Seconds - Utils::StringAspect path{this}; + Utils::FilePathAspect path{this}; Utils::FilePaths searchPathList() const; }; From f8366c5ef2ea8cc9b7071bc2388c0322ef41a157 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 30 Jun 2023 07:39:37 +0200 Subject: [PATCH 0082/1777] Utils: Fix Qbs build Change-Id: Ie89a4a6882cae7be9da8ff0a2547d874b12ddf61 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/utils.qbs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index d992872b468..c39aef1cdef 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -35,6 +35,7 @@ Project { Depends { name: "Qt"; submodules: ["concurrent", "core-private", "network", "qml", "widgets", "xml"] } Depends { name: "Qt.macextras"; condition: Qt.core.versionMajor < 6 && qbs.targetOS.contains("macos") } + Depends { name: "Spinner" } Depends { name: "Tasking" } Depends { name: "ptyqt" } From 5237998e5e5bc4f77fa46fe7d34333597882a3ce Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 11:11:51 +0200 Subject: [PATCH 0083/1777] ProjectExplorer: Merge device settings file pair, part 1 Step #1 into the "wrong" file to keep the change small. Step #2 will rename the files Change-Id: I2bdcc9e2149ca764f0bbebffb3ec520da72f8098 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/CMakeLists.txt | 1 - .../devicesupport/devicesettingspage.cpp | 26 ----- .../devicesupport/devicesettingspage.h | 18 ---- .../devicesupport/devicesettingswidget.cpp | 96 +++++++++++++++---- .../devicesupport/devicesettingswidget.h | 77 +-------------- .../projectexplorer/projectexplorer.cpp | 2 +- .../projectexplorer/projectexplorer.qbs | 1 - 7 files changed, 80 insertions(+), 141 deletions(-) delete mode 100644 src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp delete mode 100644 src/plugins/projectexplorer/devicesupport/devicesettingspage.h diff --git a/src/plugins/projectexplorer/CMakeLists.txt b/src/plugins/projectexplorer/CMakeLists.txt index dd3d2d1e995..9c6d81eaa18 100644 --- a/src/plugins/projectexplorer/CMakeLists.txt +++ b/src/plugins/projectexplorer/CMakeLists.txt @@ -55,7 +55,6 @@ add_qtc_plugin(ProjectExplorer devicesupport/devicemanager.cpp devicesupport/devicemanager.h devicesupport/devicemanagermodel.cpp devicesupport/devicemanagermodel.h devicesupport/deviceprocessesdialog.cpp devicesupport/deviceprocessesdialog.h - devicesupport/devicesettingspage.cpp devicesupport/devicesettingspage.h devicesupport/devicesettingswidget.cpp devicesupport/devicesettingswidget.h devicesupport/devicetestdialog.cpp devicesupport/devicetestdialog.h devicesupport/deviceusedportsgatherer.cpp devicesupport/deviceusedportsgatherer.h diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp b/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp deleted file mode 100644 index 6fdb19f38d1..00000000000 --- a/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "devicesettingspage.h" - -#include "devicesettingswidget.h" -#include "../projectexplorerconstants.h" -#include "../projectexplorertr.h" - -#include <QCoreApplication> - -namespace ProjectExplorer { -namespace Internal { - -DeviceSettingsPage::DeviceSettingsPage() -{ - setId(Constants::DEVICE_SETTINGS_PAGE_ID); - setDisplayName(Tr::tr("Devices")); - setCategory(Constants::DEVICE_SETTINGS_CATEGORY); - setDisplayCategory(Tr::tr("Devices")); - setCategoryIconPath(":/projectexplorer/images/settingscategory_devices.png"); - setWidgetCreator([] { return new DeviceSettingsWidget; }); -} - -} // namespace Internal -} // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingspage.h b/src/plugins/projectexplorer/devicesupport/devicesettingspage.h deleted file mode 100644 index 202f5010815..00000000000 --- a/src/plugins/projectexplorer/devicesupport/devicesettingspage.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <coreplugin/dialogs/ioptionspage.h> - -namespace ProjectExplorer { -namespace Internal { - -class DeviceSettingsPage final : public Core::IOptionsPage -{ -public: - DeviceSettingsPage(); -}; - -} // namespace Internal -} // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp index 280b6139f87..61db581ed4e 100644 --- a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp @@ -11,6 +11,7 @@ #include "idevice.h" #include "idevicefactory.h" #include "idevicewidget.h" +#include "../projectexplorerconstants.h" #include "../projectexplorericons.h" #include "../projectexplorertr.h" @@ -38,8 +39,8 @@ using namespace Core; using namespace Utils; -namespace ProjectExplorer { -namespace Internal { +namespace ProjectExplorer::Internal { + const char LastDeviceIndexKey[] = "LastDisplayedMaemoDeviceConfig"; class NameValidator : public QValidator @@ -72,24 +73,65 @@ private: const DeviceManager * const m_deviceManager; }; +class DeviceSettingsWidget final : public Core::IOptionsPageWidget +{ +public: + DeviceSettingsWidget(); + ~DeviceSettingsWidget() final + { + DeviceManager::removeClonedInstance(); + delete m_configWidget; + } + +private: + void apply() final { saveSettings(); } + + void saveSettings(); + + void handleDeviceUpdated(Utils::Id id); + void currentDeviceChanged(int index); + void addDevice(); + void removeDevice(); + void deviceNameEditingFinished(); + void setDefaultDevice(); + void testDevice(); + void handleProcessListRequested(); + + void initGui(); + void displayCurrent(); + void setDeviceInfoWidgetsEnabled(bool enable); + IDeviceConstPtr currentDevice() const; + int currentIndex() const; + void clearDetails(); + QString parseTestOutput(); + void fillInValues(); + void updateDeviceFromUi(); + + DeviceManager * const m_deviceManager; + DeviceManagerModel * const m_deviceManagerModel; + NameValidator * const m_nameValidator; + QList<QPushButton *> m_additionalActionButtons; + IDeviceWidget *m_configWidget; + + QLabel *m_configurationLabel; + QComboBox *m_configurationComboBox; + QGroupBox *m_generalGroupBox; + QLineEdit *m_nameLineEdit; + QLabel *m_osTypeValueLabel; + QLabel *m_autoDetectionLabel; + QLabel *m_deviceStateIconLabel; + QLabel *m_deviceStateTextLabel; + QGroupBox *m_osSpecificGroupBox; + QPushButton *m_removeConfigButton; + QPushButton *m_defaultDeviceButton; + QVBoxLayout *m_buttonsLayout; +}; + DeviceSettingsWidget::DeviceSettingsWidget() : m_deviceManager(DeviceManager::cloneInstance()), m_deviceManagerModel(new DeviceManagerModel(m_deviceManager, this)), m_nameValidator(new NameValidator(m_deviceManager, this)), m_configWidget(nullptr) -{ - initGui(); - connect(m_deviceManager, &DeviceManager::deviceUpdated, - this, &DeviceSettingsWidget::handleDeviceUpdated); -} - -DeviceSettingsWidget::~DeviceSettingsWidget() -{ - DeviceManager::removeClonedInstance(); - delete m_configWidget; -} - -void DeviceSettingsWidget::initGui() { m_configurationLabel = new QLabel(Tr::tr("&Device:")); m_configurationComboBox = new QComboBox; @@ -185,6 +227,7 @@ void DeviceSettingsWidget::initGui() lastIndex = 0; if (lastIndex < m_configurationComboBox->count()) m_configurationComboBox->setCurrentIndex(lastIndex); + connect(m_configurationComboBox, &QComboBox::currentIndexChanged, this, &DeviceSettingsWidget::currentDeviceChanged); currentDeviceChanged(currentIndex()); @@ -192,10 +235,10 @@ void DeviceSettingsWidget::initGui() this, &DeviceSettingsWidget::setDefaultDevice); connect(m_removeConfigButton, &QAbstractButton::clicked, this, &DeviceSettingsWidget::removeDevice); - connect(m_nameLineEdit, - &QLineEdit::editingFinished, - this, - &DeviceSettingsWidget::deviceNameEditingFinished); + connect(m_nameLineEdit, &QLineEdit::editingFinished, + this, &DeviceSettingsWidget::deviceNameEditingFinished); + connect(m_deviceManager, &DeviceManager::deviceUpdated, + this, &DeviceSettingsWidget::handleDeviceUpdated); } void DeviceSettingsWidget::addDevice() @@ -408,5 +451,16 @@ void DeviceSettingsWidget::handleProcessListRequested() dlg.exec(); } -} // namespace Internal -} // namespace ProjectExplorer +// DeviceSettingsPage + +DeviceSettingsPage::DeviceSettingsPage() +{ + setId(Constants::DEVICE_SETTINGS_PAGE_ID); + setDisplayName(Tr::tr("Devices")); + setCategory(Constants::DEVICE_SETTINGS_CATEGORY); + setDisplayCategory(Tr::tr("Devices")); + setCategoryIconPath(":/projectexplorer/images/settingscategory_devices.png"); + setWidgetCreator([] { return new DeviceSettingsWidget; }); +} + +} // ProjectExplorer::Internal diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.h b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.h index 207b60cf749..f154d91ce57 100644 --- a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.h +++ b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.h @@ -3,83 +3,14 @@ #pragma once -#include "idevicefwd.h" - -#include <QList> -#include <QString> -#include <QWidget> - #include <coreplugin/dialogs/ioptionspage.h> -QT_BEGIN_NAMESPACE -class QComboBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QVBoxLayout; -QT_END_NAMESPACE +namespace ProjectExplorer::Internal { -namespace ProjectExplorer { -class DeviceManager; -class DeviceManagerModel; -class IDeviceWidget; - -namespace Internal { -namespace Ui { class DeviceSettingsWidget; } -class NameValidator; - -class DeviceSettingsWidget final : public Core::IOptionsPageWidget +class DeviceSettingsPage final : public Core::IOptionsPage { - Q_OBJECT public: - DeviceSettingsWidget(); - ~DeviceSettingsWidget() final; - -private: - void apply() final { saveSettings(); } - - void saveSettings(); - - void handleDeviceUpdated(Utils::Id id); - void currentDeviceChanged(int index); - void addDevice(); - void removeDevice(); - void deviceNameEditingFinished(); - void setDefaultDevice(); - void testDevice(); - void handleProcessListRequested(); - - void initGui(); - void displayCurrent(); - void setDeviceInfoWidgetsEnabled(bool enable); - IDeviceConstPtr currentDevice() const; - int currentIndex() const; - void clearDetails(); - QString parseTestOutput(); - void fillInValues(); - void updateDeviceFromUi(); - - Ui::DeviceSettingsWidget *m_ui; - DeviceManager * const m_deviceManager; - DeviceManagerModel * const m_deviceManagerModel; - NameValidator * const m_nameValidator; - QList<QPushButton *> m_additionalActionButtons; - IDeviceWidget *m_configWidget; - - QLabel *m_configurationLabel; - QComboBox *m_configurationComboBox; - QGroupBox *m_generalGroupBox; - QLineEdit *m_nameLineEdit; - QLabel *m_osTypeValueLabel; - QLabel *m_autoDetectionLabel; - QLabel *m_deviceStateIconLabel; - QLabel *m_deviceStateTextLabel; - QGroupBox *m_osSpecificGroupBox; - QPushButton *m_removeConfigButton; - QPushButton *m_defaultDeviceButton; - QVBoxLayout *m_buttonsLayout; + DeviceSettingsPage(); }; -} // namespace Internal -} // namespace ProjectExplorer +} // ProjectExplorer::Internal diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 0b57384ea22..85f768913a7 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -37,7 +37,7 @@ #include "devicesupport/desktopdevicefactory.h" #include "devicesupport/devicecheckbuildstep.h" #include "devicesupport/devicemanager.h" -#include "devicesupport/devicesettingspage.h" +#include "devicesupport/devicesettingswidget.h" #include "devicesupport/sshsettings.h" #include "devicesupport/sshsettingspage.h" #include "editorsettingspropertiespage.h" diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 68e3c85d03d..3fa62265613 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -209,7 +209,6 @@ Project { "devicemanager.cpp", "devicemanager.h", "devicemanagermodel.cpp", "devicemanagermodel.h", "deviceprocessesdialog.cpp", "deviceprocessesdialog.h", - "devicesettingspage.cpp", "devicesettingspage.h", "devicesettingswidget.cpp", "devicesettingswidget.h", "devicetestdialog.cpp", "devicetestdialog.h", "deviceusedportsgatherer.cpp", "deviceusedportsgatherer.h", From ca9e6a6e0e928387596b3eae573cd9d1e752290c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 11:19:28 +0200 Subject: [PATCH 0084/1777] ProjectExplorer: Merge device settings file pair, part 2 Change-Id: I21d0d077f3586316b9238b6aa050e9597afb5976 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/CMakeLists.txt | 2 +- .../{devicesettingswidget.cpp => devicesettingspage.cpp} | 2 +- .../{devicesettingswidget.h => devicesettingspage.h} | 0 src/plugins/projectexplorer/projectexplorer.cpp | 2 +- src/plugins/projectexplorer/projectexplorer.qbs | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename src/plugins/projectexplorer/devicesupport/{devicesettingswidget.cpp => devicesettingspage.cpp} (99%) rename src/plugins/projectexplorer/devicesupport/{devicesettingswidget.h => devicesettingspage.h} (100%) diff --git a/src/plugins/projectexplorer/CMakeLists.txt b/src/plugins/projectexplorer/CMakeLists.txt index 9c6d81eaa18..eccfecea050 100644 --- a/src/plugins/projectexplorer/CMakeLists.txt +++ b/src/plugins/projectexplorer/CMakeLists.txt @@ -55,7 +55,7 @@ add_qtc_plugin(ProjectExplorer devicesupport/devicemanager.cpp devicesupport/devicemanager.h devicesupport/devicemanagermodel.cpp devicesupport/devicemanagermodel.h devicesupport/deviceprocessesdialog.cpp devicesupport/deviceprocessesdialog.h - devicesupport/devicesettingswidget.cpp devicesupport/devicesettingswidget.h + devicesupport/devicesettingspage.cpp devicesupport/devicesettingspage.h devicesupport/devicetestdialog.cpp devicesupport/devicetestdialog.h devicesupport/deviceusedportsgatherer.cpp devicesupport/deviceusedportsgatherer.h devicesupport/filetransfer.cpp devicesupport/filetransfer.h diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp b/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp similarity index 99% rename from src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp rename to src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp index 61db581ed4e..4e40255b468 100644 --- a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "devicesettingswidget.h" +#include "devicesettingspage.h" #include "devicefactoryselectiondialog.h" #include "devicemanager.h" diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.h b/src/plugins/projectexplorer/devicesupport/devicesettingspage.h similarity index 100% rename from src/plugins/projectexplorer/devicesupport/devicesettingswidget.h rename to src/plugins/projectexplorer/devicesupport/devicesettingspage.h diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 85f768913a7..0b57384ea22 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -37,7 +37,7 @@ #include "devicesupport/desktopdevicefactory.h" #include "devicesupport/devicecheckbuildstep.h" #include "devicesupport/devicemanager.h" -#include "devicesupport/devicesettingswidget.h" +#include "devicesupport/devicesettingspage.h" #include "devicesupport/sshsettings.h" #include "devicesupport/sshsettingspage.h" #include "editorsettingspropertiespage.h" diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 3fa62265613..0b3cbe5fe01 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -209,7 +209,7 @@ Project { "devicemanager.cpp", "devicemanager.h", "devicemanagermodel.cpp", "devicemanagermodel.h", "deviceprocessesdialog.cpp", "deviceprocessesdialog.h", - "devicesettingswidget.cpp", "devicesettingswidget.h", + "devicesettingspage.cpp", "devicesettingspage.h", "devicetestdialog.cpp", "devicetestdialog.h", "deviceusedportsgatherer.cpp", "deviceusedportsgatherer.h", "filetransfer.cpp", "filetransfer.h", From 9e7d874bc22a5d36b79063ffe7fdfd7d97d18106 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 28 Jun 2023 12:49:50 +0200 Subject: [PATCH 0085/1777] File system index locator: Make sorting results optional Some tools have sorting options of their own, and this gives users the chance to keep that order. Fixes: QTCREATORBUG-27789 Change-Id: I1577de9ee36b5c51e1e588f371f6bbc78a3ec22a Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- .../locator/spotlightlocatorfilter.cpp | 38 ++++++++++++++----- .../locator/spotlightlocatorfilter.h | 1 + 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp b/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp index d89bec2263b..a7c18867ff9 100644 --- a/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp @@ -21,6 +21,7 @@ #include <utils/stringutils.h> #include <utils/variablechooser.h> +#include <QCheckBox> #include <QFormLayout> #include <QJsonObject> #include <QRegularExpression> @@ -59,9 +60,12 @@ static QString defaultArguments(Qt::CaseSensitivity sens = Qt::CaseInsensitive) .arg(sens == Qt::CaseInsensitive ? QString() : "-i "); } +const bool kSortResultsDefault = true; + const char kCommandKey[] = "command"; const char kArgumentsKey[] = "arguments"; const char kCaseSensitiveKey[] = "caseSensitive"; +const char kSortResultsKey[] = "sortResults"; static QString escaped(const QString &query) { @@ -112,8 +116,10 @@ SpotlightLocatorFilter::SpotlightLocatorFilter() m_caseSensitiveArguments = defaultArguments(Qt::CaseSensitive); } -static void matches(QPromise<void> &promise, const LocatorStorage &storage, - const CommandLine &command) +static void matches(QPromise<void> &promise, + const LocatorStorage &storage, + const CommandLine &command, + bool sortResults) { // If search string contains spaces, treat them as wildcard '*' and search in full path const QString wildcardInput = QDir::fromNativeSeparators(storage.input()).replace(' ', '*'); @@ -156,11 +162,13 @@ static void matches(QPromise<void> &promise, const LocatorStorage &storage, process.start(); loop.exec(); - for (auto &entry : entries) { - if (promise.isCanceled()) - return; - if (entry.size() < 1000) - Utils::sort(entry, LocatorFilterEntry::compareLexigraphically); + if (sortResults) { + for (auto &entry : entries) { + if (promise.isCanceled()) + return; + if (entry.size() < 1000) + Utils::sort(entry, LocatorFilterEntry::compareLexigraphically); + } } if (promise.isCanceled()) return; @@ -174,8 +182,11 @@ LocatorMatcherTasks SpotlightLocatorFilter::matchers() TreeStorage<LocatorStorage> storage; - const auto onSetup = [storage, command = m_command, insensArgs = m_arguments, - sensArgs = m_caseSensitiveArguments](Async<void> &async) { + const auto onSetup = [storage, + command = m_command, + insensArgs = m_arguments, + sensArgs = m_caseSensitiveArguments, + sortResults = m_sortResults](Async<void> &async) { const Link link = Link::fromString(storage->input(), true); const FilePath input = link.targetFilePath; if (input.isEmpty()) @@ -188,7 +199,7 @@ LocatorMatcherTasks SpotlightLocatorFilter::matchers() const CommandLine cmd(FilePath::fromString(command), expander->expand(args), CommandLine::Raw); async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer()); - async.setConcurrentCallData(matches, *storage, cmd); + async.setConcurrentCallData(matches, *storage, cmd, sortResults); return SetupResult::Continue; }; @@ -210,9 +221,12 @@ bool SpotlightLocatorFilter::openConfigDialog(QWidget *parent, bool &needsRefres argumentsEdit->setText(m_arguments); FancyLineEdit *caseSensitiveArgumentsEdit = new FancyLineEdit; caseSensitiveArgumentsEdit->setText(m_caseSensitiveArguments); + auto sortResults = new QCheckBox(Tr::tr("Sort results")); + sortResults->setChecked(m_sortResults); layout->addRow(Tr::tr("Executable:"), commandEdit); layout->addRow(Tr::tr("Arguments:"), argumentsEdit); layout->addRow(Tr::tr("Case sensitive:"), caseSensitiveArgumentsEdit); + layout->addRow({}, sortResults); std::unique_ptr<MacroExpander> expander(createMacroExpander("")); auto chooser = new VariableChooser(&configWidget); chooser->addMacroExpanderProvider([expander = expander.get()] { return expander; }); @@ -223,6 +237,7 @@ bool SpotlightLocatorFilter::openConfigDialog(QWidget *parent, bool &needsRefres m_command = commandEdit->rawFilePath().toString(); m_arguments = argumentsEdit->text(); m_caseSensitiveArguments = caseSensitiveArgumentsEdit->text(); + m_sortResults = sortResults->isChecked(); } return accepted; } @@ -235,6 +250,8 @@ void SpotlightLocatorFilter::saveState(QJsonObject &obj) const obj.insert(kArgumentsKey, m_arguments); if (m_caseSensitiveArguments != defaultArguments(Qt::CaseSensitive)) obj.insert(kCaseSensitiveKey, m_caseSensitiveArguments); + if (m_sortResults != kSortResultsDefault) + obj.insert(kSortResultsKey, m_sortResults); } void SpotlightLocatorFilter::restoreState(const QJsonObject &obj) @@ -242,6 +259,7 @@ void SpotlightLocatorFilter::restoreState(const QJsonObject &obj) m_command = obj.value(kCommandKey).toString(defaultCommand()); m_arguments = obj.value(kArgumentsKey).toString(defaultArguments()); m_caseSensitiveArguments = obj.value(kCaseSensitiveKey).toString(defaultArguments(Qt::CaseSensitive)); + m_sortResults = obj.value(kSortResultsKey).toBool(kSortResultsDefault); } } // namespace Core::Internal diff --git a/src/plugins/coreplugin/locator/spotlightlocatorfilter.h b/src/plugins/coreplugin/locator/spotlightlocatorfilter.h index 06114d4e264..65570cc95d4 100644 --- a/src/plugins/coreplugin/locator/spotlightlocatorfilter.h +++ b/src/plugins/coreplugin/locator/spotlightlocatorfilter.h @@ -24,6 +24,7 @@ private: QString m_command; QString m_arguments; QString m_caseSensitiveArguments; + bool m_sortResults = true; }; } // namespace Core::Internal From b63d36218063b70c74b43aa2758dd12530931967 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 29 Jun 2023 14:05:22 +0200 Subject: [PATCH 0086/1777] SettingsDialog: Add Sort Categories check box Change-Id: I06c343ecb8df1d9badb2f760045a71c9344ed820 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../coreplugin/dialogs/settingsdialog.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index f429994edd9..9a9de241ab4 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -14,6 +14,7 @@ #include <utils/qtcassert.h> #include <QApplication> +#include <QCheckBox> #include <QDialog> #include <QDialogButtonBox> #include <QEventLoop> @@ -41,6 +42,7 @@ const int kMaxMinimumWidth = 250; const int kMaxMinimumHeight = 250; static const char pageKeyC[] = "General/LastPreferencePage"; +static const char sortKeyC[] = "General/SortCategories"; const int categoryIconSize = 24; using namespace Utils; @@ -441,6 +443,7 @@ private: Id m_currentPage; QStackedLayout *m_stackedLayout; Utils::FancyLineEdit *m_filterLineEdit; + QCheckBox *m_sortCheckBox; QListView *m_categoryList; QLabel *m_headerLabel; std::vector<QEventLoop *> m_eventLoops; @@ -456,6 +459,7 @@ SettingsDialog::SettingsDialog(QWidget *parent) : m_pages(sortedOptionsPages()), m_stackedLayout(new QStackedLayout), m_filterLineEdit(new Utils::FancyLineEdit), + m_sortCheckBox(new QCheckBox(Tr::tr("Sort Categories"))), m_categoryList(new CategoryListView), m_headerLabel(new QLabel) { @@ -473,6 +477,12 @@ SettingsDialog::SettingsDialog(QWidget *parent) : m_categoryList->setSelectionMode(QAbstractItemView::SingleSelection); m_categoryList->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); + connect(m_sortCheckBox, &QAbstractButton::toggled, this, [this](bool checked) { + m_proxyModel.sort(checked ? 0 : -1); + }); + QSettings *settings = ICore::settings(); + m_sortCheckBox->setChecked(settings->value(QLatin1String(sortKeyC), false).toBool()); + connect(m_categoryList->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &SettingsDialog::currentChanged); @@ -581,8 +591,9 @@ void SettingsDialog::createGui() mainGridLayout->addWidget(m_filterLineEdit, 0, 0, 1, 1); mainGridLayout->addLayout(headerHLayout, 0, 1, 1, 1); mainGridLayout->addWidget(m_categoryList, 1, 0, 1, 1); - mainGridLayout->addLayout(m_stackedLayout, 1, 1, 1, 1); - mainGridLayout->addWidget(buttonBox, 2, 0, 1, 2); + mainGridLayout->addWidget(m_sortCheckBox, 2, 0, 1, 1); + mainGridLayout->addLayout(m_stackedLayout, 1, 1, 2, 1); + mainGridLayout->addWidget(buttonBox, 3, 0, 1, 2); mainGridLayout->setColumnStretch(1, 4); setLayout(mainGridLayout); @@ -733,6 +744,7 @@ void SettingsDialog::done(int val) { QSettings *settings = ICore::settings(); settings->setValue(QLatin1String(pageKeyC), m_currentPage.toSetting()); + settings->setValue(QLatin1String(sortKeyC), m_sortCheckBox->isChecked()); ICore::saveSettings(ICore::SettingsDialogDone); // save all settings From 72f269bf6a87d94d016f9f467139b70192bb5d82 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 16:38:49 +0200 Subject: [PATCH 0087/1777] Utils: Add FilePathAspect::setValue Phasing out StringPathAspect::setFilePath Change-Id: If74d6b521ce6d558da83ab526057b32e8c37c243 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 5 +++++ src/libs/utils/aspects.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index a97424a6e91..479e38ccf48 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1332,6 +1332,11 @@ FilePathAspect::FilePathAspect(AspectContainer *container) setDisplayStyle(PathChooserDisplay); } +void FilePathAspect::setValue(const FilePath &filePath) +{ + StringAspect::setValue(filePath.toUserOutput()); +} + /*! \class Utils::ColorAspect \inmodule QtCreator diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index cc603edf545..9a32ce3a002 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -523,6 +523,7 @@ public: FilePathAspect(AspectContainer *container = nullptr); FilePath operator()() const { return filePath(); } + void setValue(const FilePath &filePath); }; class QTCREATOR_UTILS_EXPORT IntegerAspect : public TypedAspect<qint64> From 98bba063b6083832e14f63d55aba212702550ccb Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 16:45:11 +0200 Subject: [PATCH 0088/1777] Utils: Use FilePathAspect::setDefaultValue ... instead of StringAspect::setDefaultFilePath. Closer to the intended uniform access. Task-number: QTCREATORBUG-29167 Change-Id: I87df385ef98873a0955010149a9a9b09a5f29daf Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 10 +++++----- src/libs/utils/aspects.h | 2 +- src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | 2 +- src/plugins/conan/conansettings.cpp | 2 +- src/plugins/copilot/copilotsettings.cpp | 4 ++-- src/plugins/cpaster/fileshareprotocolsettingspage.cpp | 2 +- src/plugins/cppcheck/cppcheckoptions.cpp | 2 +- src/plugins/docker/dockersettings.cpp | 2 +- src/plugins/haskell/haskellsettings.cpp | 2 +- src/plugins/perforce/perforcesettings.cpp | 3 +-- src/plugins/terminal/terminalsettings.cpp | 11 +++++------ src/plugins/vcpkg/vcpkgsettings.cpp | 11 +++++++---- src/plugins/vcsbase/commonvcssettings.cpp | 2 +- src/plugins/webassembly/webassemblysettings.cpp | 2 +- 14 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 479e38ccf48..b058c9d365b 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -873,11 +873,6 @@ void StringAspect::setFilePath(const FilePath &value) setValue(value.toUserOutput()); } -void StringAspect::setDefaultFilePath(const FilePath &value) -{ - setDefaultValue(value.toUserOutput()); -} - PathChooser *StringAspect::pathChooser() const { return d->m_pathChooserDisplay.data(); @@ -1337,6 +1332,11 @@ void FilePathAspect::setValue(const FilePath &filePath) StringAspect::setValue(filePath.toUserOutput()); } +void FilePathAspect::setDefaultValue(const FilePath &filePath) +{ + StringAspect::setDefaultValue(filePath.toUserOutput()); +} + /*! \class Utils::ColorAspect \inmodule QtCreator diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 9a32ce3a002..bbd9e36ed22 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -503,7 +503,6 @@ public: FilePath filePath() const; void setFilePath(const FilePath &value); - void setDefaultFilePath(const FilePath &value); PathChooser *pathChooser() const; // Avoid to use. @@ -524,6 +523,7 @@ public: FilePath operator()() const { return filePath(); } void setValue(const FilePath &filePath); + void setDefaultValue(const FilePath &filePath); }; class QTCREATOR_UTILS_EXPORT IntegerAspect : public TypedAspect<qint64> diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 9e4a705fb54..60c3855a63b 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -209,7 +209,7 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Id id) : m_stagingDir = addAspect<FilePathAspect>(); m_stagingDir->setSettingsKey(STAGING_DIR_KEY); m_stagingDir->setLabelText(Tr::tr("Staging directory:")); - m_stagingDir->setDefaultValue(initialStagingDir(kit())); + m_stagingDir->setDefaultValue(FilePath::fromUserInput(initialStagingDir(kit()))); Kit *kit = buildConfiguration()->kit(); if (CMakeBuildConfiguration::isIos(kit)) { diff --git a/src/plugins/conan/conansettings.cpp b/src/plugins/conan/conansettings.cpp index 50373c764b6..f7de5b01ea8 100644 --- a/src/plugins/conan/conansettings.cpp +++ b/src/plugins/conan/conansettings.cpp @@ -24,7 +24,7 @@ ConanSettings::ConanSettings() conanFilePath.setSettingsKey("ConanFilePath"); conanFilePath.setExpectedKind(PathChooser::ExistingCommand); - conanFilePath.setDefaultValue(HostOsInfo::withExecutableSuffix("conan")); + conanFilePath.setDefaultValue(FilePath::fromString(HostOsInfo::withExecutableSuffix("conan"))); readSettings(Core::ICore::settings()); } diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index ec4cf1f61dc..6fadfb109cd 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -47,7 +47,7 @@ CopilotSettings::CopilotSettings() const FilePath distFromVim = findOrDefault(searchDirs, &FilePath::exists); nodeJsPath.setExpectedKind(PathChooser::ExistingCommand); - nodeJsPath.setDefaultFilePath(nodeFromPath); + nodeJsPath.setDefaultValue(nodeFromPath); nodeJsPath.setSettingsKey("Copilot.NodeJsPath"); nodeJsPath.setLabelText(Tr::tr("Node.js path:")); nodeJsPath.setHistoryCompleter("Copilot.NodePath.History"); @@ -58,7 +58,7 @@ CopilotSettings::CopilotSettings() "for installation instructions.")); distPath.setExpectedKind(PathChooser::File); - distPath.setDefaultFilePath(distFromVim); + distPath.setDefaultValue(distFromVim); distPath.setSettingsKey("Copilot.DistPath"); distPath.setLabelText(Tr::tr("Path to agent.js:")); distPath.setHistoryCompleter("Copilot.DistPath.History"); diff --git a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp index 99599a3cd80..6d26f630791 100644 --- a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp +++ b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp @@ -22,7 +22,7 @@ FileShareProtocolSettings::FileShareProtocolSettings() path.setSettingsKey("Path"); path.setExpectedKind(PathChooser::ExistingDirectory); - path.setDefaultValue(TemporaryDirectory::masterDirectoryPath()); + path.setDefaultValue(TemporaryDirectory::masterDirectoryFilePath()); path.setLabelText(Tr::tr("&Path:")); displayCount.setSettingsKey("DisplayCount"); diff --git a/src/plugins/cppcheck/cppcheckoptions.cpp b/src/plugins/cppcheck/cppcheckoptions.cpp index 1289ba0e0e2..214d4b3c229 100644 --- a/src/plugins/cppcheck/cppcheckoptions.cpp +++ b/src/plugins/cppcheck/cppcheckoptions.cpp @@ -44,7 +44,7 @@ CppcheckOptions::CppcheckOptions() FilePath programFiles = FilePath::fromUserInput(qtcEnvironmentVariable("PROGRAMFILES")); if (programFiles.isEmpty()) programFiles = "C:/Program Files"; - binary.setDefaultValue(programFiles.pathAppended("Cppcheck/cppcheck.exe").toString()); + binary.setDefaultValue(programFiles.pathAppended("Cppcheck/cppcheck.exe")); } warning.setSettingsKey("warning"); diff --git a/src/plugins/docker/dockersettings.cpp b/src/plugins/docker/dockersettings.cpp index 0643cb3a31a..1057a066644 100644 --- a/src/plugins/docker/dockersettings.cpp +++ b/src/plugins/docker/dockersettings.cpp @@ -42,7 +42,7 @@ DockerSettings::DockerSettings() additionalPaths.append("/usr/local/bin"); dockerBinaryPath.setExpectedKind(PathChooser::ExistingCommand); - dockerBinaryPath.setDefaultFilePath( + dockerBinaryPath.setDefaultValue( FilePath::fromString("docker").searchInPath(additionalPaths)); dockerBinaryPath.setDisplayName(Tr::tr("Docker CLI")); dockerBinaryPath.setHistoryCompleter("Docker.Command.History"); diff --git a/src/plugins/haskell/haskellsettings.cpp b/src/plugins/haskell/haskellsettings.cpp index 7b2bbc7fd38..2b58a30af0a 100644 --- a/src/plugins/haskell/haskellsettings.cpp +++ b/src/plugins/haskell/haskellsettings.cpp @@ -37,7 +37,7 @@ HaskellSettings::HaskellSettings() // stack from brew or the installer script from https://docs.haskellstack.org // install to /usr/local/bin. - stackPath.setDefaultFilePath(HostOsInfo::isAnyUnixHost() + stackPath.setDefaultValue(HostOsInfo::isAnyUnixHost() ? FilePath::fromString("/usr/local/bin/stack") : FilePath::fromString("stack")); diff --git a/src/plugins/perforce/perforcesettings.cpp b/src/plugins/perforce/perforcesettings.cpp index dc5036bbbba..915c4777ddd 100644 --- a/src/plugins/perforce/perforcesettings.cpp +++ b/src/plugins/perforce/perforcesettings.cpp @@ -36,8 +36,7 @@ PerforceSettings::PerforceSettings() setAutoApply(false); p4BinaryPath.setSettingsKey("Command"); - p4BinaryPath.setDefaultValue( - Environment::systemEnvironment().searchInPath(defaultCommand()).toString()); + p4BinaryPath.setDefaultValue(Environment::systemEnvironment().searchInPath(defaultCommand())); p4BinaryPath.setHistoryCompleter("Perforce.Command.History"); p4BinaryPath.setExpectedKind(PathChooser::Command); p4BinaryPath.setDisplayName(Tr::tr("Perforce Command")); diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index bb90e24bec8..f0b9f201784 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -49,17 +49,16 @@ static int defaultFontSize() return 10; } -static QString defaultShell() +static FilePath defaultShell() { if (HostOsInfo::isWindowsHost()) - return qtcEnvironmentVariable("COMSPEC"); + return FilePath::fromUserInput(qtcEnvironmentVariable("COMSPEC")); - QString defaultShell = qtcEnvironmentVariable("SHELL"); - if (FilePath::fromUserInput(defaultShell).isExecutableFile()) + FilePath defaultShell = FilePath::fromUserInput(qtcEnvironmentVariable("SHELL")); + if (defaultShell.isExecutableFile()) return defaultShell; - Utils::FilePath shPath = Utils::Environment::systemEnvironment().searchInPath("sh"); - return shPath.nativePath(); + return Environment::systemEnvironment().searchInPath("sh"); } void setupColor(TerminalSettings *settings, diff --git a/src/plugins/vcpkg/vcpkgsettings.cpp b/src/plugins/vcpkg/vcpkgsettings.cpp index 3542ec47910..7c26af9fda3 100644 --- a/src/plugins/vcpkg/vcpkgsettings.cpp +++ b/src/plugins/vcpkg/vcpkgsettings.cpp @@ -15,6 +15,8 @@ #include <QDesktopServices> #include <QToolButton> +using namespace Utils; + namespace Vcpkg::Internal { static VcpkgSettings *theSettings = nullptr; @@ -34,13 +36,14 @@ VcpkgSettings::VcpkgSettings() setCategory(CMakeProjectManager::Constants::Settings::CATEGORY); vcpkgRoot.setSettingsKey("VcpkgRoot"); - vcpkgRoot.setExpectedKind(Utils::PathChooser::ExistingDirectory); - vcpkgRoot.setDefaultValue(Utils::qtcEnvironmentVariable(Constants::ENVVAR_VCPKG_ROOT)); + vcpkgRoot.setExpectedKind(PathChooser::ExistingDirectory); + vcpkgRoot.setDefaultValue( + FilePath::fromUserInput(qtcEnvironmentVariable(Constants::ENVVAR_VCPKG_ROOT))); setLayouter([this] { using namespace Layouting; auto websiteButton = new QToolButton; - websiteButton->setIcon(Utils::Icons::ONLINE.icon()); + websiteButton->setIcon(Icons::ONLINE.icon()); websiteButton->setToolTip(Constants::WEBSITE_URL); connect(websiteButton, &QAbstractButton::clicked, [] { @@ -53,7 +56,7 @@ VcpkgSettings::VcpkgSettings() Group { title(Tr::tr("Vcpkg installation")), Form { - Utils::PathChooser::label(), + PathChooser::label(), Span { 2, Row { vcpkgRoot, websiteButton } }, }, }, diff --git a/src/plugins/vcsbase/commonvcssettings.cpp b/src/plugins/vcsbase/commonvcssettings.cpp index e0c4ba4af62..faa119697b1 100644 --- a/src/plugins/vcsbase/commonvcssettings.cpp +++ b/src/plugins/vcsbase/commonvcssettings.cpp @@ -72,7 +72,7 @@ CommonVcsSettings::CommonVcsSettings() sshPasswordPrompt.setSettingsKey("SshPasswordPrompt"); sshPasswordPrompt.setExpectedKind(PathChooser::ExistingCommand); sshPasswordPrompt.setHistoryCompleter("Vcs.SshPrompt.History"); - sshPasswordPrompt.setDefaultValue(sshPasswordPromptDefault()); + sshPasswordPrompt.setDefaultValue(FilePath::fromUserInput(sshPasswordPromptDefault())); sshPasswordPrompt.setLabelText(Tr::tr("&SSH prompt command:")); sshPasswordPrompt.setToolTip(Tr::tr("Specifies a command that is executed to graphically prompt " "for a password,\nshould a repository require SSH-authentication " diff --git a/src/plugins/webassembly/webassemblysettings.cpp b/src/plugins/webassembly/webassemblysettings.cpp index fb9293f2c84..b49c1628654 100644 --- a/src/plugins/webassembly/webassemblysettings.cpp +++ b/src/plugins/webassembly/webassemblysettings.cpp @@ -63,7 +63,7 @@ WebAssemblySettings::WebAssemblySettings() registerAspect(&emSdk); emSdk.setSettingsKey("EmSdk"); emSdk.setExpectedKind(Utils::PathChooser::ExistingDirectory); - emSdk.setDefaultFilePath(FileUtils::homePath()); + emSdk.setDefaultValue(FileUtils::homePath()); connect(this, &Utils::AspectContainer::applied, &WebAssemblyToolChain::registerToolChains); From 7e5f7a0e3f196cd08bf2b3086f3e0a4732840e7f Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 24 May 2023 16:40:38 +0200 Subject: [PATCH 0089/1777] DirectoryFilter: Reuse SubDirFileContainer Change-Id: I74cdf48927e151674e3730b51c1a6c0249cb7966 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> --- .../coreplugin/locator/directoryfilter.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/coreplugin/locator/directoryfilter.cpp b/src/plugins/coreplugin/locator/directoryfilter.cpp index 6acdb74720a..4a0f11d3877 100644 --- a/src/plugins/coreplugin/locator/directoryfilter.cpp +++ b/src/plugins/coreplugin/locator/directoryfilter.cpp @@ -50,21 +50,21 @@ static void refresh(QPromise<FilePaths> &promise, const FilePaths &directories, const QStringList &filters, const QStringList &exclusionFilters, const QString &displayName) { - SubDirFileIterator subDirIterator(directories, filters, exclusionFilters); - promise.setProgressRange(0, subDirIterator.maxProgress()); + SubDirFileContainer fileContainer(directories, filters, exclusionFilters); + promise.setProgressRange(0, fileContainer.progressMaximum()); FilePaths files; - const auto end = subDirIterator.end(); - for (auto it = subDirIterator.begin(); it != end; ++it) { + const auto end = fileContainer.end(); + for (auto it = fileContainer.begin(); it != end; ++it) { if (promise.isCanceled()) { - promise.setProgressValueAndText(subDirIterator.currentProgress(), + promise.setProgressValueAndText(it.progressValue(), Tr::tr("%1 filter update: canceled").arg(displayName)); return; } - files << (*it).filePath; - promise.setProgressValueAndText(subDirIterator.currentProgress(), - Tr::tr("%1 filter update: %n files", nullptr, files.size()).arg(displayName)); + files << it->filePath; + promise.setProgressValueAndText(it.progressValue(), + Tr::tr("%1 filter update: %n files", nullptr, files.size()).arg(displayName)); } - promise.setProgressValue(subDirIterator.maxProgress()); + promise.setProgressValue(fileContainer.progressMaximum()); promise.addResult(files); } From 5e86d20faec78759e00e184ef174344a483548b5 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 15:28:50 +0200 Subject: [PATCH 0090/1777] CPaster: Avoid some FilePathAspect::value() uses Get in the way of splitting FilePathAspect from StringAspect. Change-Id: Ie2e55847a9242fa4042f37597321b8d77df7e8ad Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/cpaster/fileshareprotocol.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/cpaster/fileshareprotocol.cpp b/src/plugins/cpaster/fileshareprotocol.cpp index e9b85ee1af1..e67eac346a9 100644 --- a/src/plugins/cpaster/fileshareprotocol.cpp +++ b/src/plugins/cpaster/fileshareprotocol.cpp @@ -100,7 +100,7 @@ static bool parse(const QString &fileName, bool FileShareProtocol::checkConfiguration(QString *errorMessage) { - if (m_settings.path.value().isEmpty()) { + if (m_settings.path().isEmpty()) { if (errorMessage) *errorMessage = Tr::tr("Please configure a path."); return false; @@ -113,7 +113,7 @@ void FileShareProtocol::fetch(const QString &id) // Absolute or relative path name. QFileInfo fi(id); if (fi.isRelative()) - fi = QFileInfo(m_settings.path.value() + '/' + id); + fi = m_settings.path().pathAppended(id).toFileInfo(); QString errorMessage; QString text; if (parse(fi.absoluteFilePath(), &errorMessage, nullptr, nullptr, &text)) @@ -125,7 +125,7 @@ void FileShareProtocol::fetch(const QString &id) void FileShareProtocol::list() { // Read out directory, display by date (latest first) - QDir dir(m_settings.path.value(), tempGlobPatternC, + QDir dir(m_settings.path().toFSPathString(), tempGlobPatternC, QDir::Time, QDir::Files|QDir::NoDotAndDotDot|QDir::Readable); QStringList entries; QString user; @@ -160,7 +160,7 @@ void FileShareProtocol::paste( ) { // Write out temp XML file - Utils::TempFileSaver saver(m_settings.path.value() + '/' + tempPatternC); + Utils::TempFileSaver saver(m_settings.path().pathAppended(tempPatternC).toFSPathString()); saver.setAutoRemove(false); if (!saver.hasError()) { // Flat text sections embedded into pasterElement From 2f7ecdaf06ad99d31b6f93180f7752d194e2174e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 28 Jun 2023 16:47:54 +0200 Subject: [PATCH 0091/1777] FakeVim: Use a FilePathAspect for .vimrc Even if it's not used as such, it would be the right thing to use. Change-Id: I7f8931b581af6a97231c49c20e7adc56ad2efff6 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/fakevim/fakevimactions.cpp | 1 - src/plugins/fakevim/fakevimactions.h | 12 ++++++++++-- src/plugins/fakevim/fakevimplugin.cpp | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/plugins/fakevim/fakevimactions.cpp b/src/plugins/fakevim/fakevimactions.cpp index 2d4b5420328..de1f06f9133 100644 --- a/src/plugins/fakevim/fakevimactions.cpp +++ b/src/plugins/fakevim/fakevimactions.cpp @@ -134,7 +134,6 @@ FakeVimSettings::FakeVimSettings() vimRcPath.setToolTip(Tr::tr("Keep empty to use the default path, i.e. " "%USERPROFILE%\\_vimrc on Windows, ~/.vimrc otherwise.")); vimRcPath.setPlaceHolderText(Tr::tr("Default: %1").arg(vimrcDefault)); - vimRcPath.setDisplayStyle(FvStringAspect::PathChooserDisplay); setLayouter([this] { using namespace Layouting; diff --git a/src/plugins/fakevim/fakevimactions.h b/src/plugins/fakevim/fakevimactions.h index a3907dc117f..eea53f50c1a 100644 --- a/src/plugins/fakevim/fakevimactions.h +++ b/src/plugins/fakevim/fakevimactions.h @@ -4,7 +4,13 @@ #pragma once #ifndef FAKEVIM_STANDALONE -# include <coreplugin/dialogs/ioptionspage.h> + +#include <coreplugin/dialogs/ioptionspage.h> + +#else + +namespace Utils { class FilePath {}; } + #endif #include <QCoreApplication> @@ -69,6 +75,7 @@ public: using FvBoolAspect = FvTypedAspect<bool>; using FvIntegerAspect = FvTypedAspect<qint64>; using FvStringAspect = FvTypedAspect<QString>; +using FvFilePathAspect = FvTypedAspect<Utils::FilePath>; class FvAspectContainer : public FvBaseAspect { @@ -82,6 +89,7 @@ using FvBaseAspect = Utils::BaseAspect; using FvBoolAspect = Utils::BoolAspect; using FvIntegerAspect = Utils::IntegerAspect; using FvStringAspect = Utils::StringAspect; +using FvFilePathAspect = Utils::FilePathAspect; #endif @@ -96,7 +104,7 @@ public: FvBoolAspect useFakeVim; FvBoolAspect readVimRc; - FvStringAspect vimRcPath; + FvFilePathAspect vimRcPath; FvBoolAspect startOfLine; FvIntegerAspect tabStop; diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index fb3049a7b06..fac40d951a6 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -1183,7 +1183,7 @@ void FakeVimPluginPrivate::maybeReadVimRc() //qDebug() << theFakeVimSetting(ConfigShiftWidth)->value(); if (!settings().readVimRc()) return; - QString fileName = settings().vimRcPath(); + QString fileName = settings().vimRcPath().path(); if (fileName.isEmpty()) { fileName = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + QLatin1String(HostOsInfo::isWindowsHost() ? "/_vimrc" : "/.vimrc"); From 80326d8743d82f7df06bbcbd47b011c9dcc6083f Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 24 May 2023 17:40:40 +0200 Subject: [PATCH 0092/1777] FileSearch: Remove FileIterator and subclasses Rename tst_SubDirFileIterator into tst_SubDirFileContainer. Change-Id: I0907ff93f1d6537d200fdc9f5783cfd2a8eb0aa9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/libs/utils/filesearch.cpp | 319 +----------------- src/libs/utils/filesearch.h | 114 ------- tests/auto/filesearch/tst_filesearch.cpp | 16 - tests/manual/CMakeLists.txt | 2 +- tests/manual/manual.qbs | 2 +- .../CMakeLists.txt | 4 +- .../subdirfilecontainer.qbs} | 4 +- .../tst_subdirfilecontainer.cpp} | 29 +- 8 files changed, 25 insertions(+), 465 deletions(-) rename tests/manual/{subdirfileiterator => subdirfilecontainer}/CMakeLists.txt (80%) rename tests/manual/{subdirfileiterator/subdirfileiterator.qbs => subdirfilecontainer/subdirfilecontainer.qbs} (87%) rename tests/manual/{subdirfileiterator/tst_subdirfileiterator.cpp => subdirfilecontainer/tst_subdirfilecontainer.cpp} (91%) diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index 5d20d6a700f..6340d5e1191 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -5,10 +5,7 @@ #include "algorithm.h" #include "async.h" -#include "filepath.h" -#include "mapreduce.h" #include "qtcassert.h" -#include "searchresultitem.h" #include "stringutils.h" #include "utilstr.h" @@ -17,11 +14,9 @@ #include <QScopeGuard> #include <QTextCodec> -#include <cctype> - Q_LOGGING_CATEGORY(searchLog, "qtc.utils.filesearch", QtWarningMsg) -using namespace Utils; +namespace Utils { const int MAX_LINE_SIZE = 400; @@ -32,7 +27,7 @@ static QString clippedText(const QString &text, int maxLength) return text; } -QTextDocument::FindFlags Utils::textDocumentFlagsForFindFlags(FindFlags flags) +QTextDocument::FindFlags textDocumentFlagsForFindFlags(FindFlags flags) { QTextDocument::FindFlags textDocFlags; if (flags & FindBackward) @@ -195,8 +190,8 @@ static SearchResultItems searchInContents(const QFuture<void> &future, const QSt return searchWithoutRegExp(future, searchTerm, flags, filePath, contents); } -void Utils::searchInContents(QPromise<SearchResultItems> &promise, const QString &searchTerm, - FindFlags flags, const FilePath &filePath, const QString &contents) +void searchInContents(QPromise<SearchResultItems> &promise, const QString &searchTerm, + FindFlags flags, const FilePath &filePath, const QString &contents) { const QFuture<void> future(promise.future()); const SearchResultItems results = searchInContents(future, searchTerm, flags, filePath, @@ -217,12 +212,8 @@ static inline QString msgFound(const QString &searchTerm, int numMatches, int nu nullptr, numMatches).arg(searchTerm).arg(numFilesSearched); } -namespace { - -static bool getFileContent(const FilePath &filePath, - QTextCodec *encoding, - QString *tempString, - const QMap<FilePath, QString> &fileToContentsMap) +static bool getFileContent(const FilePath &filePath, QTextCodec *encoding, + QString *tempString, const QMap<FilePath, QString> &fileToContentsMap) { if (fileToContentsMap.contains(filePath)) { *tempString = fileToContentsMap.value(filePath); @@ -236,103 +227,6 @@ static bool getFileContent(const FilePath &filePath, return true; } -class FileSearch -{ -public: - void operator()(QFutureInterface<SearchResultItems> &futureInterface, - const FileIterator::Item &item) const; - const QString m_searchTerm; - const FindFlags m_flags; - const QMap<FilePath, QString> m_fileToContentsMap; -}; - -void FileSearch::operator()(QFutureInterface<SearchResultItems> &futureInterface, - const FileIterator::Item &item) const -{ - if (futureInterface.isCanceled()) - return; - qCDebug(searchLog) << "Searching in" << item.filePath; - futureInterface.setProgressRange(0, 1); - futureInterface.setProgressValue(0); - QString contents; - if (!getFileContent(item.filePath, item.encoding, &contents, m_fileToContentsMap)) { - qCDebug(searchLog) << "- failed to get content for" << item.filePath; - futureInterface.cancel(); // failure - return; - } - - const QFuture<void> future(futureInterface.future()); - const SearchResultItems results = searchInContents(future, m_searchTerm, m_flags, item.filePath, - contents); - if (!futureInterface.isCanceled()) { - futureInterface.reportResult(results); - futureInterface.setProgressValue(1); - } - qCDebug(searchLog) << "- finished searching in" << item.filePath; -} - -struct SearchState -{ - SearchState(const QString &term, FileIterator *iterator) : searchTerm(term), files(iterator) {} - QString searchTerm; - FileIterator *files = nullptr; - SearchResultItems cachedResults; - int numFilesSearched = 0; - int numMatches = 0; -}; - -SearchState initFileSearch(QFutureInterface<SearchResultItems> &futureInterface, - const QString &searchTerm, FileIterator *files) -{ - futureInterface.setProgressRange(0, files->maxProgress()); - futureInterface.setProgressValueAndText(files->currentProgress(), msgFound(searchTerm, 0, 0)); - return SearchState(searchTerm, files); -} - -void collectSearchResults(QFutureInterface<SearchResultItems> &futureInterface, - SearchState &state, - const SearchResultItems &results) -{ - state.numMatches += results.size(); - state.cachedResults << results; - state.numFilesSearched += 1; - if (futureInterface.isProgressUpdateNeeded() - || futureInterface.progressValue() == 0 /*workaround for regression in Qt*/) { - if (!state.cachedResults.isEmpty()) { - futureInterface.reportResult(state.cachedResults); - state.cachedResults.clear(); - } - futureInterface.setProgressRange(0, state.files->maxProgress()); - futureInterface.setProgressValueAndText(state.files->currentProgress(), - msgFound(state.searchTerm, - state.numMatches, - state.numFilesSearched)); - } -} - -void cleanUpFileSearch(QFutureInterface<SearchResultItems> &futureInterface, - SearchState &state) -{ - if (!state.cachedResults.isEmpty()) { - futureInterface.reportResult(state.cachedResults); - state.cachedResults.clear(); - } - if (futureInterface.isCanceled()) { - futureInterface.setProgressValueAndText(state.files->currentProgress(), - msgCanceled(state.searchTerm, - state.numMatches, - state.numFilesSearched)); - } else { - futureInterface.setProgressValueAndText(state.files->currentProgress(), - msgFound(state.searchTerm, - state.numMatches, - state.numFilesSearched)); - } - delete state.files; -} - -} // namespace - static void fileSearch(QPromise<SearchResultItems> &promise, const FileContainerIterator::Item &item, const QString &searchTerm, FindFlags flags, const QMap<FilePath, QString> &fileToContentsMap) @@ -452,26 +346,14 @@ static void findInFilesImpl(QPromise<SearchResultItems> &promise, const QString loop.exec(QEventLoop::ExcludeUserInputEvents); } -QFuture<SearchResultItems> Utils::findInFiles(const QString &searchTerm, - const FileContainer &container, FindFlags flags, - const QMap<FilePath, QString> &fileToContentsMap) +QFuture<SearchResultItems> findInFiles(const QString &searchTerm, const FileContainer &container, + FindFlags flags, + const QMap<FilePath, QString> &fileToContentsMap) { return Utils::asyncRun(findInFilesImpl, searchTerm, container, flags, fileToContentsMap); } -QFuture<SearchResultItems> Utils::findInFiles(const QString &searchTerm, FileIterator *files, - FindFlags flags, const QMap<FilePath, QString> &fileToContentsMap) -{ - return mapReduce(files->begin(), files->end(), - [searchTerm, files](QFutureInterface<SearchResultItems> &futureInterface) { - return initFileSearch(futureInterface, searchTerm, files); - }, - FileSearch{searchTerm, flags, fileToContentsMap}, - &collectSearchResults, - &cleanUpFileSearch); -} - -QString Utils::expandRegExpReplacement(const QString &replaceText, const QStringList &capturedTexts) +QString expandRegExpReplacement(const QString &replaceText, const QStringList &capturedTexts) { // handles \1 \\ \& \t \n $1 $$ $& QString result; @@ -520,9 +402,7 @@ QString Utils::expandRegExpReplacement(const QString &replaceText, const QString return result; } -namespace Utils { -namespace Internal { -QString matchCaseReplacement(const QString &originalText, const QString &replaceText) +static QString matchCaseReplacementHelper(const QString &originalText, const QString &replaceText) { if (originalText.isEmpty() || replaceText.isEmpty()) return replaceText; @@ -557,7 +437,6 @@ QString matchCaseReplacement(const QString &originalText, const QString &replace return replaceText; // mixed } } -} // namespace static QList<QRegularExpression> filtersToRegExps(const QStringList &filters) { @@ -604,7 +483,6 @@ QStringList splitFilterUiText(const QString &text) return Utils::filtered(trimmedPortableParts, [](const QString &s) { return !s.isEmpty(); }); } - QString msgFilePatternLabel() { return Tr::tr("Fi&le pattern:"); @@ -644,39 +522,11 @@ QString matchCaseReplacement(const QString &originalText, const QString &replace //keep prefix and suffix, and do actual replacement on the 'middle' of the string return originalText.left(prefixLen) - + Internal::matchCaseReplacement(originalText.mid(prefixLen, originalTextLen - prefixLen - suffixLen), - replaceText.mid(prefixLen, replaceTextLen - prefixLen - suffixLen)) + + matchCaseReplacementHelper(originalText.mid(prefixLen, originalTextLen - prefixLen - suffixLen), + replaceText.mid(prefixLen, replaceTextLen - prefixLen - suffixLen)) + originalText.right(suffixLen); - } -// #pragma mark -- FileIterator - -void FileIterator::advance(FileIterator::const_iterator *it) const -{ - if (it->m_index < 0) // == end - return; - ++it->m_index; - const_cast<FileIterator *>(this)->update(it->m_index); - if (it->m_index >= currentFileCount()) - it->m_index = -1; // == end -} - -FileIterator::const_iterator FileIterator::begin() const -{ - const_cast<FileIterator *>(this)->update(0); - if (currentFileCount() == 0) - return end(); - return FileIterator::const_iterator(this, 0/*index*/); -} - -FileIterator::const_iterator FileIterator::end() const -{ - return FileIterator::const_iterator(this, -1/*end*/); -} - -// #pragma mark -- FileListIterator - void FileContainerIterator::operator++() { QTC_ASSERT(m_data.m_container, return); @@ -867,145 +717,4 @@ SubDirFileContainer::SubDirFileContainer(const FilePaths &directories, const QSt : FileContainer(subDirAdvancerProvider(directories, filters, exclusionFilters, encoding), s_progressMaximum) {} -QList<FileIterator::Item> constructItems(const FilePaths &fileList, - const QList<QTextCodec *> &encodings) -{ - QList<FileIterator::Item> items; - items.reserve(fileList.size()); - QTextCodec *defaultEncoding = QTextCodec::codecForLocale(); - for (int i = 0; i < fileList.size(); ++i) - items.append(FileIterator::Item(fileList.at(i), encodings.value(i, defaultEncoding))); - return items; -} - -FileListIterator::FileListIterator(const FilePaths &fileList, const QList<QTextCodec *> &encodings) - : m_items(constructItems(fileList, encodings)) -{ -} - -void FileListIterator::update(int requestedIndex) -{ - if (requestedIndex > m_maxIndex) - m_maxIndex = requestedIndex; -} - -int FileListIterator::currentFileCount() const -{ - return m_items.size(); -} - -const FileIterator::Item &FileListIterator::itemAt(int index) const -{ - return m_items.at(index); -} - -int FileListIterator::maxProgress() const -{ - return m_items.size(); -} - -int FileListIterator::currentProgress() const -{ - return m_maxIndex + 1; -} - -// #pragma mark -- SubDirFileIterator - -SubDirFileIterator::SubDirFileIterator(const FilePaths &directories, - const QStringList &filters, - const QStringList &exclusionFilters, - QTextCodec *encoding) - : m_filterFiles(filterFilesFunction(filters, exclusionFilters)) - , m_progress(0) -{ - m_encoding = (encoding == nullptr ? QTextCodec::codecForLocale() : encoding); - qreal maxPer = qreal(s_progressMaximum) / directories.count(); - for (const FilePath &directoryEntry : directories) { - if (!directoryEntry.isEmpty()) { - const FilePath canonicalPath = directoryEntry.canonicalPath(); - if (!canonicalPath.isEmpty() && directoryEntry.exists()) { - m_dirs.push(directoryEntry); - m_knownDirs.insert(canonicalPath); - m_progressValues.push(maxPer); - m_processedValues.push(false); - } - } - } -} - -SubDirFileIterator::~SubDirFileIterator() -{ - qDeleteAll(m_items); -} - -void SubDirFileIterator::update(int index) -{ - if (index < m_items.size()) - return; - // collect files from the directories until we have enough for the given index - while (!m_dirs.isEmpty() && index >= m_items.size()) { - FilePath dir = m_dirs.pop(); - const qreal dirProgressMax = m_progressValues.pop(); - const bool processed = m_processedValues.pop(); - if (dir.exists()) { - using Dir = FilePath; - using CanonicalDir = FilePath; - std::vector<std::pair<Dir, CanonicalDir>> subDirs; - if (!processed) { - for (const FilePath &entry : - dir.dirEntries(QDir::Dirs | QDir::Hidden | QDir::NoDotAndDotDot)) { - const FilePath canonicalDir = entry.canonicalPath(); - if (!m_knownDirs.contains(canonicalDir)) - subDirs.emplace_back(entry, canonicalDir); - } - } - if (subDirs.empty()) { - const FilePaths allFilePaths = dir.dirEntries(QDir::Files | QDir::Hidden); - const FilePaths filePaths = m_filterFiles(allFilePaths); - m_items.reserve(m_items.size() + filePaths.size()); - Utils::reverseForeach(filePaths, [this](const FilePath &file) { - m_items.append(new Item(file, m_encoding)); - }); - m_progress += dirProgressMax; - } else { - qreal subProgress = dirProgressMax/(subDirs.size()+1); - m_dirs.push(dir); - m_progressValues.push(subProgress); - m_processedValues.push(true); - Utils::reverseForeach(subDirs, - [this, subProgress](const std::pair<Dir, CanonicalDir> &dir) { - m_dirs.push(dir.first); - m_knownDirs.insert(dir.second); - m_progressValues.push(subProgress); - m_processedValues.push(false); - }); - } - } else { - m_progress += dirProgressMax; - } - } - if (index >= m_items.size()) - m_progress = s_progressMaximum; -} - -int SubDirFileIterator::currentFileCount() const -{ - return m_items.size(); -} - -const FileIterator::Item &SubDirFileIterator::itemAt(int index) const -{ - return *m_items.at(index); -} - -int SubDirFileIterator::maxProgress() const -{ - return s_progressMaximum; -} - -int SubDirFileIterator::currentProgress() const -{ - return qMin(qRound(m_progress), s_progressMaximum); -} - -} +} // namespace Utils diff --git a/src/libs/utils/filesearch.h b/src/libs/utils/filesearch.h index 35724a8ec44..2d2155a723c 100644 --- a/src/libs/utils/filesearch.h +++ b/src/libs/utils/filesearch.h @@ -10,8 +10,6 @@ #include <QMap> #include <QPromise> -#include <QSet> -#include <QStack> #include <QTextDocument> #include <functional> @@ -158,121 +156,9 @@ public: QTextCodec *encoding = nullptr); }; -class QTCREATOR_UTILS_EXPORT FileIterator -{ -public: - class Item - { - public: - Item() = default; - Item(const FilePath &path, QTextCodec *codec) - : filePath(path) - , encoding(codec) - {} - FilePath filePath; - QTextCodec *encoding = nullptr; - }; - - using value_type = Item; - - class const_iterator - { - public: - using iterator_category = std::forward_iterator_tag; - using value_type = Item; - using difference_type = std::ptrdiff_t; - using pointer = const value_type*; - using reference = const value_type&; - - const_iterator() = default; - const_iterator(const FileIterator *parent, int id) - : m_parent(parent), m_index(id) - {} - const_iterator(const const_iterator &) = default; - const_iterator &operator=(const const_iterator &) = default; - - reference operator*() const { return m_parent->itemAt(m_index); } - pointer operator->() const { return &m_parent->itemAt(m_index); } - void operator++() { m_parent->advance(this); } - bool operator==(const const_iterator &other) const - { - return m_parent == other.m_parent && m_index == other.m_index; - } - bool operator!=(const const_iterator &other) const { return !operator==(other); } - - const FileIterator *m_parent = nullptr; - int m_index = -1; // -1 == end - }; - - virtual ~FileIterator() = default; - const_iterator begin() const; - const_iterator end() const; - - virtual int maxProgress() const = 0; - virtual int currentProgress() const = 0; - - void advance(const_iterator *it) const; - virtual const Item &itemAt(int index) const = 0; - -protected: - virtual void update(int requestedIndex) = 0; - virtual int currentFileCount() const = 0; -}; - -class QTCREATOR_UTILS_EXPORT FileListIterator : public FileIterator -{ -public: - explicit FileListIterator(const FilePaths &fileList = {}, - const QList<QTextCodec *> &encodings = {}); - - int maxProgress() const override; - int currentProgress() const override; - -protected: - void update(int requestedIndex) override; - int currentFileCount() const override; - const Item &itemAt(int index) const override; - -private: - const QList<Item> m_items; - int m_maxIndex = -1; -}; - -class QTCREATOR_UTILS_EXPORT SubDirFileIterator : public FileIterator -{ -public: - SubDirFileIterator(const FilePaths &directories, - const QStringList &filters, - const QStringList &exclusionFilters, - QTextCodec *encoding = nullptr); - ~SubDirFileIterator() override; - - int maxProgress() const override; - int currentProgress() const override; - -protected: - void update(int requestedIndex) override; - int currentFileCount() const override; - const Item &itemAt(int index) const override; - -private: - std::function<FilePaths(const FilePaths &)> m_filterFiles; - QTextCodec *m_encoding; - QStack<FilePath> m_dirs; - QSet<FilePath> m_knownDirs; - QStack<qreal> m_progressValues; - QStack<bool> m_processedValues; - qreal m_progress; - // Use heap allocated objects directly because we want references to stay valid even after resize - QList<Item *> m_items; -}; - QTCREATOR_UTILS_EXPORT QFuture<SearchResultItems> findInFiles(const QString &searchTerm, const FileContainer &container, FindFlags flags, const QMap<FilePath, QString> &fileToContentsMap); -QTCREATOR_UTILS_EXPORT QFuture<SearchResultItems> findInFiles(const QString &searchTerm, - FileIterator *files, FindFlags flags, const QMap<FilePath, QString> &fileToContentsMap); - QTCREATOR_UTILS_EXPORT QString expandRegExpReplacement(const QString &replaceText, const QStringList &capturedTexts); QTCREATOR_UTILS_EXPORT QString matchCaseReplacement(const QString &originalText, diff --git a/tests/auto/filesearch/tst_filesearch.cpp b/tests/auto/filesearch/tst_filesearch.cpp index f1a29339f0a..b2c09064c92 100644 --- a/tests/auto/filesearch/tst_filesearch.cpp +++ b/tests/auto/filesearch/tst_filesearch.cpp @@ -37,21 +37,6 @@ SearchResultItem searchResult(const FilePath &fileName, const QString &matchingL void test_helper(const FilePath &filePath, const SearchResultItems &expectedResults, const QString &term, Utils::FindFlags flags = {}) { - { - FileIterator *it = new FileListIterator({filePath}, {QTextCodec::codecForLocale()}); - QFutureWatcher<SearchResultItems> watcher; - QSignalSpy ready(&watcher, &QFutureWatcherBase::resultsReadyAt); - watcher.setFuture(Utils::findInFiles(term, it, flags, {})); - watcher.future().waitForFinished(); - QTest::qWait(100); // process events - QCOMPARE(ready.count(), 1); - SearchResultItems results = watcher.resultAt(0); - QCOMPARE(results.count(), expectedResults.count()); - for (int i = 0; i < expectedResults.size(); ++i) - QCOMPARE(results.at(i), expectedResults.at(i)); - } - - { const FileListContainer container({filePath}, {QTextCodec::codecForLocale()}); QFutureWatcher<SearchResultItems> watcher; QSignalSpy ready(&watcher, &QFutureWatcherBase::resultsReadyAt); @@ -63,7 +48,6 @@ void test_helper(const FilePath &filePath, const SearchResultItems &expectedResu QCOMPARE(results.count(), expectedResults.count()); for (int i = 0; i < expectedResults.size(); ++i) QCOMPARE(results.at(i), expectedResults.at(i)); - } } void tst_FileSearch::multipleResults() diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt index 37d302c4424..de324714a2b 100644 --- a/tests/manual/CMakeLists.txt +++ b/tests/manual/CMakeLists.txt @@ -17,6 +17,6 @@ add_subdirectory(proparser) # add_subdirectory(search) add_subdirectory(shootout) add_subdirectory(spinner) -add_subdirectory(subdirfileiterator) +add_subdirectory(subdirfilecontainer) add_subdirectory(tasking) add_subdirectory(widgets) diff --git a/tests/manual/manual.qbs b/tests/manual/manual.qbs index 923f0fe5f0e..ecf0a6d2f87 100644 --- a/tests/manual/manual.qbs +++ b/tests/manual/manual.qbs @@ -14,7 +14,7 @@ Project { "proparser/testreader.qbs", "shootout/shootout.qbs", "spinner/spinner.qbs", - "subdirfileiterator/subdirfileiterator.qbs", + "subdirfilecontainer/subdirfilecontainer.qbs", "tasking/demo/demo.qbs", "tasking/imagescaling/imagescaling.qbs", "widgets/widgets.qbs", diff --git a/tests/manual/subdirfileiterator/CMakeLists.txt b/tests/manual/subdirfilecontainer/CMakeLists.txt similarity index 80% rename from tests/manual/subdirfileiterator/CMakeLists.txt rename to tests/manual/subdirfilecontainer/CMakeLists.txt index 9613e197b77..ace5958396c 100644 --- a/tests/manual/subdirfileiterator/CMakeLists.txt +++ b/tests/manual/subdirfilecontainer/CMakeLists.txt @@ -1,10 +1,10 @@ file(RELATIVE_PATH RELATIVE_TEST_PATH "${PROJECT_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}") file(RELATIVE_PATH TEST_RELATIVE_LIBEXEC_PATH "/${RELATIVE_TEST_PATH}" "/${IDE_LIBEXEC_PATH}") -add_qtc_test(tst_manual_subdirfileiterator +add_qtc_test(tst_manual_subdirfilecontainer MANUALTEST DEFINES "TEST_RELATIVE_LIBEXEC_PATH=\"${TEST_RELATIVE_LIBEXEC_PATH}\"" DEPENDS Utils app_version SOURCES - tst_subdirfileiterator.cpp + tst_subdirfilecontainer.cpp ) diff --git a/tests/manual/subdirfileiterator/subdirfileiterator.qbs b/tests/manual/subdirfilecontainer/subdirfilecontainer.qbs similarity index 87% rename from tests/manual/subdirfileiterator/subdirfileiterator.qbs rename to tests/manual/subdirfilecontainer/subdirfilecontainer.qbs index 852fb9b545b..8fde030160a 100644 --- a/tests/manual/subdirfileiterator/subdirfileiterator.qbs +++ b/tests/manual/subdirfilecontainer/subdirfilecontainer.qbs @@ -1,14 +1,14 @@ import qbs.FileInfo QtcManualtest { - name: "Manual SubDirFileIterator test" + name: "Manual SubDirFileContainer test" type: ["application"] Depends { name: "Utils" } Depends { name: "app_version_header" } files: [ - "tst_subdirfileiterator.cpp", + "tst_subdirfilecontainer.cpp", ] cpp.defines: { diff --git a/tests/manual/subdirfileiterator/tst_subdirfileiterator.cpp b/tests/manual/subdirfilecontainer/tst_subdirfilecontainer.cpp similarity index 91% rename from tests/manual/subdirfileiterator/tst_subdirfileiterator.cpp rename to tests/manual/subdirfilecontainer/tst_subdirfilecontainer.cpp index e3f81388a32..89993b6a2b6 100644 --- a/tests/manual/subdirfileiterator/tst_subdirfileiterator.cpp +++ b/tests/manual/subdirfilecontainer/tst_subdirfilecontainer.cpp @@ -104,7 +104,7 @@ static void generateCopy(QPromise<void> &promise, const QString &sourcePath, promise.future().cancel(); } -class tst_SubDirFileIterator : public QObject +class tst_SubDirFileContainer : public QObject { Q_OBJECT @@ -118,8 +118,8 @@ private slots: + QLatin1String(TEST_RELATIVE_LIBEXEC_PATH)); LauncherInterface::setPathToLauncher(libExecPath); - qDebug() << "This manual test compares the performance of the SubDirFileIterator with " - "a manually written iterator using QDir::entryInfoList()."; + qDebug() << "This manual test compares the performance of the SubDirFileContainer with a " + "manually written iterator using QDir::entryInfoList() and with QDirIterator."; QTC_SCOPED_TIMER("GENERATING TEMPORARY FILES TREE"); m_threadsCount = threadsCount(); m_filesCount = expectedFilesCount(); @@ -183,25 +183,6 @@ private slots: Singleton::deleteAll(); } - void testSubDirFileIterator() - { - QTC_SCOPED_TIMER("ITERATING with SubDirFileIterator"); - int filesCount = 0; - { - const FilePath root(FilePath::fromString(m_tempDir->path())); - SubDirFileIterator it({root}, {}, {}); - auto i = it.begin(); - const auto e = it.end(); - while (i != e) { - ++filesCount; - ++i; - if (filesCount % 100000 == 0) - qDebug() << filesCount << '/' << m_filesCount << "files visited so far..."; - } - } - QCOMPARE(filesCount, m_filesCount); - } - void testSubDirFileContainer() { QTC_SCOPED_TIMER("ITERATING with FileContainer"); @@ -292,6 +273,6 @@ private: std::unique_ptr<QTemporaryDir> m_tempDir; }; -QTEST_GUILESS_MAIN(tst_SubDirFileIterator) +QTEST_GUILESS_MAIN(tst_SubDirFileContainer) -#include "tst_subdirfileiterator.moc" +#include "tst_subdirfilecontainer.moc" From 1cbd41790691c880794a07ec7b0a192d6cb0e7d8 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 24 May 2023 18:06:54 +0200 Subject: [PATCH 0093/1777] Utils: Remove functiontraits.h, mapreduce.h and runextensions.h Change-Id: I61d0f95d4120c0de0045c1a817fd13a09eeb5402 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/libs/utils/CMakeLists.txt | 4 - src/libs/utils/QtConcurrentTools | 4 - src/libs/utils/functiontraits.h | 169 ----- src/libs/utils/mapreduce.h | 594 ------------------ src/libs/utils/runextensions.cpp | 23 - src/libs/utils/runextensions.h | 479 -------------- src/libs/utils/utils.qbs | 5 - src/plugins/projectexplorer/buildstep.cpp | 2 +- .../qmakeprojectmanager/qmakeparsernodes.cpp | 1 - tests/auto/CMakeLists.txt | 2 - tests/auto/auto.qbs | 1 - tests/auto/mapreduce/CMakeLists.txt | 4 - tests/auto/mapreduce/mapreduce.qbs | 10 - tests/auto/mapreduce/tst_mapreduce.cpp | 345 ---------- tests/auto/runextensions/CMakeLists.txt | 4 - tests/auto/runextensions/runextensions.qbs | 10 - .../auto/runextensions/tst_runextensions.cpp | 540 ---------------- 17 files changed, 1 insertion(+), 2196 deletions(-) delete mode 100644 src/libs/utils/QtConcurrentTools delete mode 100644 src/libs/utils/functiontraits.h delete mode 100644 src/libs/utils/mapreduce.h delete mode 100644 src/libs/utils/runextensions.cpp delete mode 100644 src/libs/utils/runextensions.h delete mode 100644 tests/auto/mapreduce/CMakeLists.txt delete mode 100644 tests/auto/mapreduce/mapreduce.qbs delete mode 100644 tests/auto/mapreduce/tst_mapreduce.cpp delete mode 100644 tests/auto/runextensions/CMakeLists.txt delete mode 100644 tests/auto/runextensions/runextensions.qbs delete mode 100644 tests/auto/runextensions/tst_runextensions.cpp diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 883727de72d..1e9affd09fd 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -6,7 +6,6 @@ add_qtc_library(Utils SOURCES ../3rdparty/span/span.hpp ../3rdparty/tl_expected/include/tl/expected.hpp - QtConcurrentTools algorithm.h ansiescapecodehandler.cpp ansiescapecodehandler.h appinfo.cpp appinfo.h @@ -66,7 +65,6 @@ add_qtc_library(Utils flowlayout.cpp flowlayout.h fsengine/fsengine.cpp fsengine/fsengine.h fsengine/fileiconprovider.cpp fsengine/fileiconprovider.h - functiontraits.h futuresynchronizer.cpp futuresynchronizer.h fuzzymatcher.cpp fuzzymatcher.h genericconstants.h @@ -93,7 +91,6 @@ add_qtc_library(Utils listmodel.h listutils.h macroexpander.cpp macroexpander.h - mapreduce.h mathutils.cpp mathutils.h mimeutils.h minimizableinfobars.cpp @@ -143,7 +140,6 @@ add_qtc_library(Utils ranges.h reloadpromptutils.cpp reloadpromptutils.h removefiledialog.cpp removefiledialog.h - runextensions.cpp runextensions.h savefile.cpp savefile.h scopedswap.h scopedtimer.cpp scopedtimer.h diff --git a/src/libs/utils/QtConcurrentTools b/src/libs/utils/QtConcurrentTools deleted file mode 100644 index bbec0a89f09..00000000000 --- a/src/libs/utils/QtConcurrentTools +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "runextensions.h" diff --git a/src/libs/utils/functiontraits.h b/src/libs/utils/functiontraits.h deleted file mode 100644 index 8b052d3e882..00000000000 --- a/src/libs/utils/functiontraits.h +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <tuple> - -namespace Utils { - -/* - struct functionTraits<Function> - { - using ResultType; // Return type of Function - struct argument<unsigned index> - { - using type; // type of Function argument at index (starting with 0) - } - } - - struct functionTakesArgument<Function, unsigned index, ArgumentType>; - - Is derived from std::true_type if Function takes an argument of type ArgumentType at index. - Otherwise derived from std::false_type. -*/ - -//////////////////// -// functionTraits -//////////////////// - -// for callables. defined below. -template <typename Callable> -struct functionTraits; - -// function -template <typename Result, typename... Args> -struct functionTraits<Result(Args...)> -{ - using ResultType = Result; - static const unsigned arity = sizeof...(Args); // TODO const -> constexpr with MSVC2015 - - template <unsigned i> - struct argument - { - using type = typename std::tuple_element<i, std::tuple<Args...>>::type; - }; -}; - -// function pointer -template <typename Result, typename... Args> -struct functionTraits<Result(*)(Args...)> : public functionTraits<Result(Args...)> -{ -}; - -// const function pointer -template <typename Result, typename... Args> -struct functionTraits<Result(* const)(Args...)> : public functionTraits<Result(Args...)> -{ -}; - -// member function -template <typename Type, typename Result, typename... Args> -struct functionTraits<Result(Type::*)(Args...)> : public functionTraits<Result(Type&,Args...)> -{ -}; - -// const member function -template <typename Type, typename Result, typename... Args> -struct functionTraits<Result(Type::*)(Args...) const> : public functionTraits<Result(Type&,Args...)> -{ -}; - -// const pointer to member function -template <typename Type, typename Result, typename... Args> -struct functionTraits<Result(Type::* const)(Args...)> : public functionTraits<Result(Type&,Args...)> -{ -}; - -// const pointer to const member function -template <typename Type, typename Result, typename... Args> -struct functionTraits<Result(Type::* const)(Args...) const> : public functionTraits<Result(Type&,Args...)> -{ -}; - -// TODO: enable lvalue and rvalue ref member function later (MSVC 2015?) -//// lvalue ref member function -//template <typename Type, typename Result, typename... Args> -//struct functionTraits<Result(Type::*)(Args...) &> : public functionTraits<Result(Type&,Args...)> -//{ -//}; - -//// const lvalue ref member function -//template <typename Type, typename Result, typename... Args> -//struct functionTraits<Result(Type::*)(Args...) const &> : public functionTraits<Result(Type&,Args...)> -//{ -//}; - -//// rvalue ref member function -//template <typename Type, typename Result, typename... Args> -//struct functionTraits<Result(Type::*)(Args...) &&> : public functionTraits<Result(Type&,Args...)> -//{ -//}; - -// callables. only works if operator() is not overloaded. -template <typename Callable> -struct functionTraits -{ - using callableTraits = functionTraits<decltype(&Callable::operator())>; - using ResultType = typename callableTraits::ResultType; - static const unsigned arity = callableTraits::arity - 1; // ignore object pointer arg // TODO const -> constexpr with MSVC2015 - - template <unsigned i> - struct argument - { - using type = typename callableTraits::template argument<i+1>::type; // ignore object pointer arg - }; -}; - -// lvalue ref callables -template <typename Callable> -struct functionTraits<Callable&> : public functionTraits<Callable> -{ -}; - -// const lvalue ref callables -template <typename Callable> -struct functionTraits<const Callable&> : public functionTraits<Callable> -{ -}; - -// rvalue ref callables -template <typename Callable> -struct functionTraits<Callable&&> : public functionTraits<Callable> -{ -}; - -template <typename F> -using functionResult_t = typename functionTraits<F>::ResultType; - -//////////////////// -// functionTakesArgument -//////////////////// -namespace Internal { - -template <typename HasArity/*true_type or false_type*/, - typename Function, unsigned index, typename T> -struct functionTakesArgumentArityDispatch; - -template <typename Function, unsigned index, typename T> -struct functionTakesArgumentArityDispatch<std::false_type, Function, index, T> - : public std::false_type -{ -}; - -template <typename Function, unsigned index, typename T> -struct functionTakesArgumentArityDispatch<std::true_type, Function, index, T> - : public std::is_same<T, typename functionTraits<Function>::template argument<index>::type> -{ -}; - -} // Internal - -template <typename Function, unsigned index, typename T> -struct functionTakesArgument : public Internal::functionTakesArgumentArityDispatch< - std::integral_constant<bool, (functionTraits<Function>::arity > index)>, - Function, index, T> -{ -}; - -} // Utils diff --git a/src/libs/utils/mapreduce.h b/src/libs/utils/mapreduce.h deleted file mode 100644 index 891f0083c52..00000000000 --- a/src/libs/utils/mapreduce.h +++ /dev/null @@ -1,594 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "utils_global.h" - -#include "algorithm.h" -#include "runextensions.h" - -#include <QFutureWatcher> - -#include <iterator> - -namespace Utils { - -enum class MapReduceOption -{ - Ordered, - Unordered -}; - -namespace Internal { - -class QTCREATOR_UTILS_EXPORT MapReduceObject : public QObject -{ - Q_OBJECT -}; - -template <typename ForwardIterator, typename MapResult, typename MapFunction, typename State, typename ReduceResult, typename ReduceFunction> -class MapReduceBase : public MapReduceObject -{ -protected: - static const int MAX_PROGRESS = 1000000; - // either const or non-const reference wrapper for items from the iterator - using ItemReferenceWrapper = std::reference_wrapper< - std::remove_reference_t<typename std::iterator_traits<ForwardIterator>::reference>>; - -public: - MapReduceBase(QFutureInterface<ReduceResult> &futureInterface, ForwardIterator begin, ForwardIterator end, - MapFunction &&map, State &state, ReduceFunction &&reduce, - MapReduceOption option, QThreadPool *pool, int size) - : m_futureInterface(futureInterface), - m_iterator(begin), - m_end(end), - m_map(std::forward<MapFunction>(map)), - m_state(state), - m_reduce(std::forward<ReduceFunction>(reduce)), - m_threadPool(pool), - m_handleProgress(size >= 0), - m_size(size), - m_option(option) - { - if (!m_threadPool) - m_threadPool = new QThreadPool(this); - if (m_handleProgress) // progress is handled by us - m_futureInterface.setProgressRange(0, MAX_PROGRESS); - connect(&m_selfWatcher, &QFutureWatcher<void>::canceled, - this, &MapReduceBase::cancelAll); - m_selfWatcher.setFuture(QFuture<void>(futureInterface.future())); - } - - void exec() - { - // do not enter event loop for empty containers or if already canceled - if (!m_futureInterface.isCanceled() && schedule()) - m_loop.exec(); - } - -protected: - virtual void reduce(QFutureWatcher<MapResult> *watcher, int index) = 0; - - bool schedule() - { - bool didSchedule = false; - while (m_iterator != m_end - && m_mapWatcher.size() < std::max(m_threadPool->maxThreadCount(), 1)) { - didSchedule = true; - auto watcher = new QFutureWatcher<MapResult>(); - connect(watcher, &QFutureWatcher<MapResult>::finished, this, [this, watcher] { - mapFinished(watcher); - }); - if (m_handleProgress) { - connect(watcher, &QFutureWatcher<MapResult>::progressValueChanged, - this, &MapReduceBase::updateProgress); - connect(watcher, &QFutureWatcher<MapResult>::progressRangeChanged, - this, &MapReduceBase::updateProgress); - } - m_mapWatcher.append(watcher); - m_watcherIndex.append(m_currentIndex); - ++m_currentIndex; - watcher->setFuture(runAsync(m_threadPool, std::cref(m_map), - ItemReferenceWrapper(*m_iterator))); - ++m_iterator; - } - return didSchedule; - } - - void mapFinished(QFutureWatcher<MapResult> *watcher) - { - int index = m_mapWatcher.indexOf(watcher); - int watcherIndex = m_watcherIndex.at(index); - m_mapWatcher.removeAt(index); // remove so we can schedule next one - m_watcherIndex.removeAt(index); - bool didSchedule = false; - if (!m_futureInterface.isCanceled()) { - // first schedule the next map... - didSchedule = schedule(); - ++m_successfullyFinishedMapCount; - updateProgress(); - // ...then reduce - reduce(watcher, watcherIndex); - } - delete watcher; - if (!didSchedule && m_mapWatcher.isEmpty()) - m_loop.quit(); - } - - void updateProgress() - { - if (!m_handleProgress) // cannot compute progress - return; - if (m_size == 0 || m_successfullyFinishedMapCount == m_size) { - m_futureInterface.setProgressValue(MAX_PROGRESS); - return; - } - if (!m_futureInterface.isProgressUpdateNeeded()) - return; - const double progressPerMap = MAX_PROGRESS / double(m_size); - double progress = m_successfullyFinishedMapCount * progressPerMap; - for (const QFutureWatcher<MapResult> *watcher : std::as_const(m_mapWatcher)) { - if (watcher->progressMinimum() != watcher->progressMaximum()) { - const double range = watcher->progressMaximum() - watcher->progressMinimum(); - progress += (watcher->progressValue() - watcher->progressMinimum()) / range * progressPerMap; - } - } - m_futureInterface.setProgressValue(int(progress)); - } - - void cancelAll() - { - for (QFutureWatcher<MapResult> *watcher : std::as_const(m_mapWatcher)) - watcher->cancel(); - } - - QFutureWatcher<void> m_selfWatcher; - QFutureInterface<ReduceResult> &m_futureInterface; - ForwardIterator m_iterator; - const ForwardIterator m_end; - MapFunction m_map; - State &m_state; - ReduceFunction m_reduce; - QEventLoop m_loop; - QThreadPool *m_threadPool; // for reusing threads - QList<QFutureWatcher<MapResult> *> m_mapWatcher; - QList<int> m_watcherIndex; - int m_currentIndex = 0; - const bool m_handleProgress; - const int m_size; - int m_successfullyFinishedMapCount = 0; - MapReduceOption m_option; -}; - -// non-void result of map function. -template <typename ForwardIterator, typename MapResult, typename MapFunction, typename State, typename ReduceResult, typename ReduceFunction> -class MapReduce : public MapReduceBase<ForwardIterator, MapResult, MapFunction, State, ReduceResult, ReduceFunction> -{ - using BaseType = MapReduceBase<ForwardIterator, MapResult, MapFunction, State, ReduceResult, ReduceFunction>; -public: - MapReduce(QFutureInterface<ReduceResult> &futureInterface, ForwardIterator begin, ForwardIterator end, - MapFunction &&map, State &state, ReduceFunction &&reduce, MapReduceOption option, - QThreadPool *pool, int size) - : BaseType(futureInterface, begin, end, std::forward<MapFunction>(map), state, - std::forward<ReduceFunction>(reduce), option, pool, size) - { - } - -protected: - void reduce(QFutureWatcher<MapResult> *watcher, int index) override - { - if (BaseType::m_option == MapReduceOption::Unordered) { - reduceOne(watcher->future().results()); - } else { - if (m_nextIndex == index) { - // handle this result and all directly following - reduceOne(watcher->future().results()); - ++m_nextIndex; - while (!m_pendingResults.isEmpty() && m_pendingResults.firstKey() == m_nextIndex) { - reduceOne(m_pendingResults.take(m_nextIndex)); - ++m_nextIndex; - } - } else { - // add result to pending results - m_pendingResults.insert(index, watcher->future().results()); - } - } - } - -private: - void reduceOne(const QList<MapResult> &results) - { - const int resultCount = results.size(); - for (int i = 0; i < resultCount; ++i) { - Internal::runAsyncImpl(BaseType::m_futureInterface, BaseType::m_reduce, - BaseType::m_state, results.at(i)); - } - } - - QMap<int, QList<MapResult>> m_pendingResults; - int m_nextIndex = 0; -}; - -// specialization for void result of map function. Reducing is a no-op. -template <typename ForwardIterator, typename MapFunction, typename State, typename ReduceResult, typename ReduceFunction> -class MapReduce<ForwardIterator, void, MapFunction, State, ReduceResult, ReduceFunction> : public MapReduceBase<ForwardIterator, void, MapFunction, State, ReduceResult, ReduceFunction> -{ - using BaseType = MapReduceBase<ForwardIterator, void, MapFunction, State, ReduceResult, ReduceFunction>; -public: - MapReduce(QFutureInterface<ReduceResult> &futureInterface, ForwardIterator begin, ForwardIterator end, - MapFunction &&map, State &state, ReduceFunction &&reduce, MapReduceOption option, - QThreadPool *pool, int size) - : BaseType(futureInterface, begin, end, std::forward<MapFunction>(map), state, - std::forward<ReduceFunction>(reduce), option, pool, size) - { - } - -protected: - void reduce(QFutureWatcher<void> *, int) override - { - } - -}; - -template <typename ResultType, typename Function, typename... Args> -functionResult_t<Function> -callWithMaybeFutureInterfaceDispatch(std::false_type, QFutureInterface<ResultType> &, - Function &&function, Args&&... args) -{ - return function(std::forward<Args>(args)...); -} - -template <typename ResultType, typename Function, typename... Args> -functionResult_t<Function> -callWithMaybeFutureInterfaceDispatch(std::true_type, QFutureInterface<ResultType> &futureInterface, - Function &&function, Args&&... args) -{ - return function(futureInterface, std::forward<Args>(args)...); -} - -template <typename ResultType, typename Function, typename... Args> -functionResult_t<Function> -callWithMaybeFutureInterface(QFutureInterface<ResultType> &futureInterface, - Function &&function, Args&&... args) -{ - return callWithMaybeFutureInterfaceDispatch( - functionTakesArgument<Function, 0, QFutureInterface<ResultType>&>(), - futureInterface, std::forward<Function>(function), std::forward<Args>(args)...); -} - -template <typename ForwardIterator, typename InitFunction, typename MapFunction, typename ReduceResult, - typename ReduceFunction, typename CleanUpFunction> -void blockingIteratorMapReduce(QFutureInterface<ReduceResult> &futureInterface, ForwardIterator begin, ForwardIterator end, - InitFunction &&init, MapFunction &&map, - ReduceFunction &&reduce, CleanUpFunction &&cleanup, - MapReduceOption option, QThreadPool *pool, int size) -{ - auto state = callWithMaybeFutureInterface<ReduceResult, InitFunction> - (futureInterface, std::forward<InitFunction>(init)); - MapReduce<ForwardIterator, typename Internal::resultType<MapFunction>::type, MapFunction, decltype(state), ReduceResult, ReduceFunction> - mr(futureInterface, begin, end, std::forward<MapFunction>(map), state, - std::forward<ReduceFunction>(reduce), option, pool, size); - mr.exec(); - callWithMaybeFutureInterface<ReduceResult, CleanUpFunction, std::remove_reference_t<decltype(state)>&> - (futureInterface, std::forward<CleanUpFunction>(cleanup), state); -} - -template <typename Container, typename InitFunction, typename MapFunction, typename ReduceResult, - typename ReduceFunction, typename CleanUpFunction> -void blockingContainerMapReduce(QFutureInterface<ReduceResult> &futureInterface, Container &&container, - InitFunction &&init, MapFunction &&map, - ReduceFunction &&reduce, CleanUpFunction &&cleanup, - MapReduceOption option, QThreadPool *pool) -{ - blockingIteratorMapReduce(futureInterface, std::begin(container), std::end(container), - std::forward<InitFunction>(init), std::forward<MapFunction>(map), - std::forward<ReduceFunction>(reduce), - std::forward<CleanUpFunction>(cleanup), - option, pool, static_cast<int>(container.size())); -} - -template <typename Container, typename InitFunction, typename MapFunction, typename ReduceResult, - typename ReduceFunction, typename CleanUpFunction> -void blockingContainerRefMapReduce(QFutureInterface<ReduceResult> &futureInterface, - std::reference_wrapper<Container> containerWrapper, - InitFunction &&init, MapFunction &&map, - ReduceFunction &&reduce, CleanUpFunction &&cleanup, - MapReduceOption option, QThreadPool *pool) -{ - blockingContainerMapReduce(futureInterface, containerWrapper.get(), - std::forward<InitFunction>(init), std::forward<MapFunction>(map), - std::forward<ReduceFunction>(reduce), - std::forward<CleanUpFunction>(cleanup), - option, pool); -} - -template <typename ReduceResult> -static void *dummyInit() { return nullptr; } - -// copies or moves state to member, and then moves it to the result of the call operator -template <typename State> -struct StateWrapper { - using StateResult = std::decay_t<State>; // State is const& or & for lvalues - StateWrapper(State &&state) : m_state(std::forward<State>(state)) { } - StateResult operator()() - { - return std::move(m_state); // invalidates m_state - } - - StateResult m_state; -}; - -// copies or moves reduce function to member, calls the reduce function with state and mapped value -template <typename StateResult, typename MapResult, typename ReduceFunction> -struct ReduceWrapper { - using Reduce = std::decay_t<ReduceFunction>; - ReduceWrapper(ReduceFunction &&reduce) : m_reduce(std::forward<ReduceFunction>(reduce)) { } - void operator()(QFutureInterface<StateResult> &, StateResult &state, const MapResult &mapResult) - { - m_reduce(state, mapResult); - } - - Reduce m_reduce; -}; - -template <typename MapResult> -struct DummyReduce { - MapResult operator()(void *, const MapResult &result) const { return result; } -}; -template <> -struct DummyReduce<void> { - void operator()() const { } // needed for resultType<DummyReduce> with MSVC2013 -}; - -template <typename ReduceResult> -static void dummyCleanup(void *) { } - -template <typename StateResult> -static void cleanupReportingState(QFutureInterface<StateResult> &fi, StateResult &state) -{ - fi.reportResult(state); -} - -} // Internal - -template <typename ForwardIterator, typename InitFunction, typename MapFunction, - typename ReduceFunction, typename CleanUpFunction, - typename ReduceResult = typename Internal::resultType<ReduceFunction>::type> -QFuture<ReduceResult> -mapReduce(ForwardIterator begin, ForwardIterator end, InitFunction &&init, MapFunction &&map, - ReduceFunction &&reduce, CleanUpFunction &&cleanup, - MapReduceOption option = MapReduceOption::Unordered, - QThreadPool *pool = nullptr, QThread::Priority priority = QThread::InheritPriority, - int size = -1) -{ - return runAsync(priority, - Internal::blockingIteratorMapReduce< - ForwardIterator, - std::decay_t<InitFunction>, - std::decay_t<MapFunction>, - std::decay_t<ReduceResult>, - std::decay_t<ReduceFunction>, - std::decay_t<CleanUpFunction>>, - begin, end, std::forward<InitFunction>(init), std::forward<MapFunction>(map), - std::forward<ReduceFunction>(reduce), std::forward<CleanUpFunction>(cleanup), - option, pool, size); -} - -/*! - Calls the map function on all items in \a container in parallel through Utils::runAsync. - - The reduce function is called in the mapReduce thread with each of the reported results from - the map function, in arbitrary order, but never in parallel. - It gets passed a reference to a user defined state object, and a result from the map function. - If it takes a QFutureInterface reference as its first argument, it can report results - for the mapReduce operation through that. Otherwise, any values returned by the reduce function - are reported as results of the mapReduce operation. - - The init function is called in the mapReduce thread before the actual mapping starts, - and must return the initial state object for the reduce function. It gets the QFutureInterface - of the mapReduce operation passed as an argument. - - The cleanup function is called in the mapReduce thread after all map and reduce calls have - finished, with the QFutureInterface of the mapReduce operation and the final state object - as arguments, and can be used to clean up any resources, or report a final result of the - mapReduce. - - Container<ItemType> - - StateType InitFunction(QFutureInterface<ReduceResultType>&) - or - StateType InitFunction() - - void MapFunction(QFutureInterface<MapResultType>&, const ItemType&) - or - MapResultType MapFunction(const ItempType&) - - void ReduceFunction(QFutureInterface<ReduceResultType>&, StateType&, const MapResultType&) - or - ReduceResultType ReduceFunction(StateType&, const MapResultType&) - - void CleanUpFunction(QFutureInterface<ReduceResultType>&, StateType&) - or - void CleanUpFunction(StateType&) - - Notes: - \list - \li Container can be a move-only type or a temporary. If it is a lvalue reference, it will - be copied to the mapReduce thread. You can avoid that by using - the version that takes iterators, or by using std::ref/cref to pass a reference_wrapper. - \li ItemType can be a move-only type, if the map function takes (const) references to ItemType. - \li StateType can be a move-only type. - \li The init, map, reduce and cleanup functions can be move-only types and are moved to the - mapReduce thread if they are rvalues. - \endlist - - */ -template <typename Container, typename InitFunction, typename MapFunction, - typename ReduceFunction, typename CleanUpFunction, - typename ReduceResult = typename Internal::resultType<ReduceFunction>::type> -QFuture<ReduceResult> -mapReduce(Container &&container, InitFunction &&init, MapFunction &&map, - ReduceFunction &&reduce, CleanUpFunction &&cleanup, - MapReduceOption option = MapReduceOption::Unordered, - QThreadPool *pool = nullptr, QThread::Priority priority = QThread::InheritPriority) -{ - return runAsync(priority, - Internal::blockingContainerMapReduce< - std::decay_t<Container>, - std::decay_t<InitFunction>, - std::decay_t<MapFunction>, - std::decay_t<ReduceResult>, - std::decay_t<ReduceFunction>, - std::decay_t<CleanUpFunction>>, - std::forward<Container>(container), - std::forward<InitFunction>(init), std::forward<MapFunction>(map), - std::forward<ReduceFunction>(reduce), std::forward<CleanUpFunction>(cleanup), - option, pool); -} - -template <typename Container, typename InitFunction, typename MapFunction, - typename ReduceFunction, typename CleanUpFunction, - typename ReduceResult = typename Internal::resultType<ReduceFunction>::type> -QFuture<ReduceResult> -mapReduce(std::reference_wrapper<Container> containerWrapper, InitFunction &&init, MapFunction &&map, - ReduceFunction &&reduce, CleanUpFunction &&cleanup, - MapReduceOption option = MapReduceOption::Unordered, - QThreadPool *pool = nullptr, QThread::Priority priority = QThread::InheritPriority) -{ - return runAsync(priority, - Internal::blockingContainerRefMapReduce< - Container, - std::decay_t<InitFunction>, - std::decay_t<MapFunction>, - std::decay_t<ReduceResult>, - std::decay_t<ReduceFunction>, - std::decay_t<CleanUpFunction>>, - containerWrapper, - std::forward<InitFunction>(init), std::forward<MapFunction>(map), - std::forward<ReduceFunction>(reduce), std::forward<CleanUpFunction>(cleanup), - option, pool); -} - -template <typename ForwardIterator, typename MapFunction, typename State, typename ReduceFunction, - typename StateResult = std::decay_t<State>, // State = T& or const T& for lvalues, so decay that away - typename MapResult = typename Internal::resultType<MapFunction>::type> -QFuture<StateResult> -mapReduce(ForwardIterator begin, ForwardIterator end, MapFunction &&map, State &&initialState, - ReduceFunction &&reduce, MapReduceOption option = MapReduceOption::Unordered, - QThreadPool *pool = nullptr, QThread::Priority priority = QThread::InheritPriority, - int size = -1) -{ - return mapReduce(begin, end, - Internal::StateWrapper<State>(std::forward<State>(initialState)), - std::forward<MapFunction>(map), - Internal::ReduceWrapper<StateResult, MapResult, ReduceFunction>(std::forward<ReduceFunction>(reduce)), - &Internal::cleanupReportingState<StateResult>, - option, pool, priority, size); -} - -template <typename Container, typename MapFunction, typename State, typename ReduceFunction, - typename StateResult = std::decay_t<State>, // State = T& or const T& for lvalues, so decay that away - typename MapResult = typename Internal::resultType<MapFunction>::type> -QFuture<StateResult> -mapReduce(Container &&container, MapFunction &&map, State &&initialState, ReduceFunction &&reduce, - MapReduceOption option = MapReduceOption::Unordered, - QThreadPool *pool = nullptr, QThread::Priority priority = QThread::InheritPriority) -{ - return mapReduce(std::forward<Container>(container), - Internal::StateWrapper<State>(std::forward<State>(initialState)), - std::forward<MapFunction>(map), - Internal::ReduceWrapper<StateResult, MapResult, ReduceFunction>(std::forward<ReduceFunction>(reduce)), - &Internal::cleanupReportingState<StateResult>, - option, pool, priority); -} - -template <typename ForwardIterator, typename MapFunction, typename State, typename ReduceFunction, - typename StateResult = std::decay_t<State>, // State = T& or const T& for lvalues, so decay that away - typename MapResult = typename Internal::resultType<MapFunction>::type> -Q_REQUIRED_RESULT -StateResult -mappedReduced(ForwardIterator begin, ForwardIterator end, MapFunction &&map, State &&initialState, - ReduceFunction &&reduce, MapReduceOption option = MapReduceOption::Unordered, - QThreadPool *pool = nullptr, QThread::Priority priority = QThread::InheritPriority, - int size = -1) -{ - return mapReduce(begin, end, - std::forward<MapFunction>(map), std::forward<State>(initialState), - std::forward<ReduceFunction>(reduce), - option, pool, priority, size).result(); -} - -template <typename Container, typename MapFunction, typename State, typename ReduceFunction, - typename StateResult = std::decay_t<State>, // State = T& or const T& for lvalues, so decay that away - typename MapResult = typename Internal::resultType<MapFunction>::type> -Q_REQUIRED_RESULT -StateResult -mappedReduced(Container &&container, MapFunction &&map, State &&initialState, ReduceFunction &&reduce, - MapReduceOption option = MapReduceOption::Unordered, - QThreadPool *pool = nullptr, QThread::Priority priority = QThread::InheritPriority) -{ - return mapReduce(std::forward<Container>(container), std::forward<MapFunction>(map), - std::forward<State>(initialState), std::forward<ReduceFunction>(reduce), - option, pool, priority).result(); -} - -template <typename ForwardIterator, typename MapFunction, - typename MapResult = typename Internal::resultType<MapFunction>::type> -QFuture<MapResult> -map(ForwardIterator begin, ForwardIterator end, MapFunction &&map, - MapReduceOption option = MapReduceOption::Ordered, - QThreadPool *pool = nullptr, QThread::Priority priority = QThread::InheritPriority, - int size = -1) -{ - return mapReduce(begin, end, - &Internal::dummyInit<MapResult>, - std::forward<MapFunction>(map), - Internal::DummyReduce<MapResult>(), - &Internal::dummyCleanup<MapResult>, - option, pool, priority, size); -} - -template <typename Container, typename MapFunction, - typename MapResult = typename Internal::resultType<MapFunction>::type> -QFuture<MapResult> -map(Container &&container, MapFunction &&map, MapReduceOption option = MapReduceOption::Ordered, - QThreadPool *pool = nullptr, QThread::Priority priority = QThread::InheritPriority) -{ - return mapReduce(std::forward<Container>(container), - Internal::dummyInit<MapResult>, - std::forward<MapFunction>(map), - Internal::DummyReduce<MapResult>(), - Internal::dummyCleanup<MapResult>, - option, pool, priority); -} - -template <template<typename> class ResultContainer, typename ForwardIterator, typename MapFunction, - typename MapResult = typename Internal::resultType<MapFunction>::type> -Q_REQUIRED_RESULT -ResultContainer<MapResult> -mapped(ForwardIterator begin, ForwardIterator end, MapFunction &&mapFun, - MapReduceOption option = MapReduceOption::Ordered, - QThreadPool *pool = nullptr, QThread::Priority priority = QThread::InheritPriority, int size = -1) -{ - return Utils::transform<ResultContainer>(map(begin, end, - std::forward<MapFunction>(mapFun), - option, pool, priority, size).results(), - [](const MapResult &r) { return r; }); -} - -template <template<typename> class ResultContainer, typename Container, typename MapFunction, - typename MapResult = typename Internal::resultType<MapFunction>::type> -Q_REQUIRED_RESULT -ResultContainer<MapResult> -mapped(Container &&container, MapFunction &&mapFun, - MapReduceOption option = MapReduceOption::Ordered, - QThreadPool *pool = nullptr, QThread::Priority priority = QThread::InheritPriority) -{ - return Utils::transform<ResultContainer>(map(container, - std::forward<MapFunction>(mapFun), - option, pool, priority).results(), - [](const MapResult &r) { return r; }); -} - -} // Utils diff --git a/src/libs/utils/runextensions.cpp b/src/libs/utils/runextensions.cpp deleted file mode 100644 index efcd73a643e..00000000000 --- a/src/libs/utils/runextensions.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "runextensions.h" - -namespace Utils { -namespace Internal { - -RunnableThread::RunnableThread(QRunnable *runnable, QObject *parent) - : QThread(parent), - m_runnable(runnable) -{ -} - -void RunnableThread::run() -{ - m_runnable->run(); - if (m_runnable->autoDelete()) - delete m_runnable; -} - -} // Internal -} // Utils diff --git a/src/libs/utils/runextensions.h b/src/libs/utils/runextensions.h deleted file mode 100644 index 6505b12a9cf..00000000000 --- a/src/libs/utils/runextensions.h +++ /dev/null @@ -1,479 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "utils_global.h" - -#include "functiontraits.h" - -#include <QCoreApplication> -#include <QFuture> -#include <QFutureInterface> -#include <QFutureWatcher> -#include <QRunnable> -#include <QThread> -#include <QThreadPool> - -#include <functional> - -// hasCallOperator & Co must be outside of any namespace -// because of internal compiler error with MSVC2015 Update 2 - -using testCallOperatorYes = char; -using testCallOperatorNo = struct { char foo[2]; }; - -template<typename C> -static testCallOperatorYes testCallOperator(decltype(&C::operator())); - -template<typename> -static testCallOperatorNo testCallOperator(...); - -template<typename T> -struct hasCallOperator -{ - static const bool value = (sizeof(testCallOperator<T>(nullptr)) == sizeof(testCallOperatorYes)); -}; - -namespace Utils { - -namespace Internal { - -/* - resultType<F>::type - - Returns the type of results that would be reported by a callable of type F - when called through the runAsync methods. I.e. the ResultType in - - void f(QFutureInterface<Result> &fi, ...) - ResultType f(...) - - Returns void if F is not callable, and if F is a callable that does not take - a QFutureInterface& as its first parameter and returns void. -*/ - -template <typename Function> -struct resultType; - -template <typename Function, typename Arg> -struct resultTypeWithArgument; - -template <typename Function, int index, bool> -struct resultTypeTakesArguments; - -template <typename Function, bool> -struct resultTypeIsMemberFunction; - -template <typename Function, bool> -struct resultTypeIsFunctionLike; - -template <typename Function, bool> -struct resultTypeHasCallOperator; - -template <typename Function, typename ResultType> -struct resultTypeWithArgument<Function, QFutureInterface<ResultType>&> -{ - using type = ResultType; -}; - -template <typename Function, typename Arg> -struct resultTypeWithArgument -{ - using type = functionResult_t<Function>; -}; - -template <typename Function, int index> -struct resultTypeTakesArguments<Function, index, true> - : public resultTypeWithArgument<Function, typename functionTraits<Function>::template argument<index>::type> -{ -}; - -template <typename Function, int index> -struct resultTypeTakesArguments<Function, index, false> -{ - using type = functionResult_t<Function>; -}; - -template <typename Function> -struct resultTypeIsFunctionLike<Function, true> - : public resultTypeTakesArguments<Function, 0, (functionTraits<Function>::arity > 0)> -{ -}; - -template <typename Function> -struct resultTypeIsMemberFunction<Function, true> - : public resultTypeTakesArguments<Function, 1, (functionTraits<Function>::arity > 1)> -{ -}; - -template <typename Function> -struct resultTypeIsMemberFunction<Function, false> -{ - using type = void; -}; - -template <typename Function> -struct resultTypeIsFunctionLike<Function, false> - : public resultTypeIsMemberFunction<Function, std::is_member_function_pointer<Function>::value> -{ -}; - -template <typename Function> -struct resultTypeHasCallOperator<Function, false> - : public resultTypeIsFunctionLike<Function, std::is_function<std::remove_pointer_t<std::decay_t<Function>>>::value> -{ -}; - -template <typename Callable> -struct resultTypeHasCallOperator<Callable, true> - : public resultTypeTakesArguments<Callable, 0, (functionTraits<Callable>::arity > 0)> -{ -}; - -template <typename Function> -struct resultType - : public resultTypeHasCallOperator<Function, hasCallOperator<Function>::value> -{ -}; - -template <typename Function> -struct resultType<Function&> : public resultType<Function> -{ -}; - -template <typename Function> -struct resultType<const Function&> : public resultType<Function> -{ -}; - -template <typename Function> -struct resultType<Function &&> : public resultType<Function> -{ -}; - -template <typename Function> -struct resultType<std::reference_wrapper<Function>> : public resultType<Function> -{ -}; -template <typename Function> -struct resultType<std::reference_wrapper<const Function>> : public resultType<Function> -{ -}; - -/* - Callable object that wraps a member function pointer with the object it - will be called on. -*/ - -template <typename Function> -class MemberCallable; - -template <typename Result, typename Obj, typename... Args> -class MemberCallable<Result(Obj::*)(Args...) const> -{ -public: - MemberCallable(Result(Obj::* function)(Args...) const, const Obj *obj) - : m_function(function), - m_obj(obj) - { - } - - Result operator()(Args&&... args) const - { - return ((*m_obj).*m_function)(std::forward<Args>(args)...); - } - -private: - Result(Obj::* m_function)(Args...) const; - const Obj *m_obj; -}; - -template <typename Result, typename Obj, typename... Args> -class MemberCallable<Result(Obj::*)(Args...)> -{ -public: - MemberCallable(Result(Obj::* function)(Args...), Obj *obj) - : m_function(function), - m_obj(obj) - { - } - - Result operator()(Args&&... args) const - { - return ((*m_obj).*m_function)(std::forward<Args>(args)...); - } - -private: - Result(Obj::* m_function)(Args...); - Obj *m_obj; -}; - -/* - Helper functions for runAsync that run in the started thread. -*/ - -// void function that does not take QFutureInterface -template <typename ResultType, typename Function, typename... Args> -void runAsyncReturnVoidDispatch(std::true_type, QFutureInterface<ResultType> &, Function &&function, Args&&... args) -{ - function(std::forward<Args>(args)...); -} - -// non-void function that does not take QFutureInterface -template <typename ResultType, typename Function, typename... Args> -void runAsyncReturnVoidDispatch(std::false_type, QFutureInterface<ResultType> &futureInterface, Function &&function, Args&&... args) -{ - futureInterface.reportResult(function(std::forward<Args>(args)...)); -} - -// function that takes QFutureInterface -template <typename ResultType, typename Function, typename... Args> -void runAsyncQFutureInterfaceDispatch(std::true_type, QFutureInterface<ResultType> &futureInterface, Function &&function, Args&&... args) -{ - function(futureInterface, std::forward<Args>(args)...); -} - -// function that does not take QFutureInterface -template <typename ResultType, typename Function, typename... Args> -void runAsyncQFutureInterfaceDispatch(std::false_type, QFutureInterface<ResultType> &futureInterface, Function &&function, Args&&... args) -{ - runAsyncReturnVoidDispatch(std::is_void<std::invoke_result_t<Function, Args...>>(), - futureInterface, std::forward<Function>(function), std::forward<Args>(args)...); -} - -// function, function pointer, or other callable object that is no member pointer -template <typename ResultType, typename Function, typename... Args, - typename = std::enable_if_t<!std::is_member_pointer<std::decay_t<Function>>::value> - > -void runAsyncMemberDispatch(QFutureInterface<ResultType> &futureInterface, Function &&function, Args&&... args) -{ - runAsyncQFutureInterfaceDispatch(functionTakesArgument<Function, 0, QFutureInterface<ResultType>&>(), - futureInterface, std::forward<Function>(function), std::forward<Args>(args)...); -} - -// Function = member function -template <typename ResultType, typename Function, typename Obj, typename... Args, - typename = std::enable_if_t<std::is_member_pointer<std::decay_t<Function>>::value> - > -void runAsyncMemberDispatch(QFutureInterface<ResultType> &futureInterface, Function &&function, Obj &&obj, Args&&... args) -{ - // Wrap member function with object into callable - runAsyncImpl(futureInterface, - MemberCallable<std::decay_t<Function>>(std::forward<Function>(function), std::forward<Obj>(obj)), - std::forward<Args>(args)...); -} - -// cref to function/callable -template <typename ResultType, typename Function, typename... Args> -void runAsyncImpl(QFutureInterface<ResultType> &futureInterface, - std::reference_wrapper<Function> functionWrapper, Args&&... args) -{ - runAsyncMemberDispatch(futureInterface, functionWrapper.get(), std::forward<Args>(args)...); -} - -// function/callable, no cref -template <typename ResultType, typename Function, typename... Args> -void runAsyncImpl(QFutureInterface<ResultType> &futureInterface, - Function &&function, Args&&... args) -{ - runAsyncMemberDispatch(futureInterface, std::forward<Function>(function), - std::forward<Args>(args)...); -} -/* - AsyncJob is a QRunnable that wraps a function with the - arguments that are passed to it when it is run in a thread. -*/ - -template <class T> -std::decay_t<T> -decayCopy(T&& v) -{ - return std::forward<T>(v); -} - -template <typename ResultType, typename Function, typename... Args> -class AsyncJob : public QRunnable -{ -public: - AsyncJob(Function &&function, Args&&... args) - // decay copy like std::thread - : data(decayCopy(std::forward<Function>(function)), decayCopy(std::forward<Args>(args))...) - { - // we need to report it as started even though it isn't yet, because someone might - // call waitForFinished on the future, which does _not_ block if the future is not started - futureInterface.setRunnable(this); - futureInterface.reportStarted(); - } - - ~AsyncJob() override - { - // QThreadPool can delete runnables even if they were never run (e.g. QThreadPool::clear). - // Since we reported them as started, we make sure that we always report them as finished. - // reportFinished only actually sends the signal if it wasn't already finished. - futureInterface.reportFinished(); - } - - QFuture<ResultType> future() { return futureInterface.future(); } - - void run() override - { - if (priority != QThread::InheritPriority) - if (QThread *thread = QThread::currentThread()) - if (thread != qApp->thread()) - thread->setPriority(priority); - if (futureInterface.isCanceled()) { - futureInterface.reportFinished(); - return; - } - runHelper(std::make_index_sequence<std::tuple_size<Data>::value>()); - } - - void setThreadPool(QThreadPool *pool) - { - futureInterface.setThreadPool(pool); - } - - void setThreadPriority(QThread::Priority p) - { - priority = p; - } - -private: - using Data = std::tuple<std::decay_t<Function>, std::decay_t<Args>...>; - - template <std::size_t... index> - void runHelper(std::index_sequence<index...>) - { - // invalidates data, which is moved into the call - runAsyncImpl(futureInterface, std::move(std::get<index>(data))...); - if (futureInterface.isPaused()) - futureInterface.waitForResume(); - futureInterface.reportFinished(); - } - - Data data; - QFutureInterface<ResultType> futureInterface; - QThread::Priority priority = QThread::InheritPriority; -}; - -class QTCREATOR_UTILS_EXPORT RunnableThread : public QThread -{ -public: - explicit RunnableThread(QRunnable *runnable, QObject *parent = nullptr); - -protected: - void run() override; - -private: - QRunnable *m_runnable; -}; - -template<typename Function, - typename... Args, - typename ResultType = typename Internal::resultType<Function>::type> -QFuture<ResultType> runAsync_internal(QThreadPool *pool, - QThread::Priority priority, - Function &&function, - Args &&... args) -{ - auto job = new Internal::AsyncJob<ResultType,Function,Args...> - (std::forward<Function>(function), std::forward<Args>(args)...); - job->setThreadPriority(priority); - QFuture<ResultType> future = job->future(); - if (pool) { - job->setThreadPool(pool); - pool->start(job); - } else { - auto thread = new Internal::RunnableThread(job); - thread->moveToThread(qApp->thread()); // make sure thread gets deleteLater on main thread - QObject::connect(thread, &QThread::finished, thread, &QObject::deleteLater); - thread->start(priority); - } - return future; -} - -} // Internal - -/*! - The interface of \c {runAsync} is similar to the std::thread constructor and \c {std::invoke}. - - The \a function argument can be a member function, - an object with \c {operator()} (with no overloads), - a \c {std::function}, lambda, function pointer or function reference. - The \a args are passed to the function call after they are copied/moved to the thread. - - The \a function can take a \c {QFutureInterface<ResultType>&} as its first argument, followed by - other custom arguments which need to be passed to this function. - If it does not take a \c {QFutureInterface<ResultType>&} as its first argument - and its return type is not void, the function call's result is reported to the QFuture. - If \a function is a (non-static) member function, the first argument in \a args is expected - to be the object that the function is called on. - - If a thread \a pool is given, the function is run there. Otherwise a new, independent thread - is started. - - \sa std::thread - \sa std::invoke - \sa QThreadPool - \sa QThread::Priority - */ -template <typename Function, typename... Args, - typename ResultType = typename Internal::resultType<Function>::type> -QFuture<ResultType> -runAsync(QThreadPool *pool, QThread::Priority priority, Function &&function, Args&&... args) -{ - return Internal::runAsync_internal(pool, - priority, - std::forward<Function>(function), - std::forward<Args>(args)...); -} - -/*! - Runs \a function with \a args in a new thread with given thread \a priority. - \sa runAsync(QThreadPool*,QThread::Priority,Function&&,Args&&...) - \sa QThread::Priority - */ -template <typename Function, typename... Args, - typename ResultType = typename Internal::resultType<Function>::type> -QFuture<ResultType> -runAsync(QThread::Priority priority, Function &&function, Args&&... args) -{ - return runAsync(static_cast<QThreadPool *>(nullptr), priority, - std::forward<Function>(function), std::forward<Args>(args)...); -} - -/*! - Runs \a function with \a args in a new thread with thread priority QThread::InheritPriority. - \sa runAsync(QThreadPool*,QThread::Priority,Function&&,Args&&...) - \sa QThread::Priority - */ -template <typename Function, typename... Args, - typename = std::enable_if_t< - !std::is_same<std::decay_t<Function>, QThreadPool>::value - && !std::is_same<std::decay_t<Function>, QThread::Priority>::value - >, - typename ResultType = typename Internal::resultType<Function>::type> -QFuture<ResultType> -runAsync(Function &&function, Args&&... args) -{ - return runAsync(static_cast<QThreadPool *>(nullptr), - QThread::InheritPriority, std::forward<Function>(function), - std::forward<Args>(args)...); -} - -/*! - Runs \a function with \a args in a thread \a pool with thread priority QThread::InheritPriority. - \sa runAsync(QThreadPool*,QThread::Priority,Function&&,Args&&...) - \sa QThread::Priority - */ -template <typename Function, typename... Args, - typename = std::enable_if_t<!std::is_same<std::decay_t<Function>, QThread::Priority>::value>, - typename ResultType = typename Internal::resultType<Function>::type> -QFuture<ResultType> -runAsync(QThreadPool *pool, Function &&function, Args&&... args) -{ - return runAsync(pool, QThread::InheritPriority, std::forward<Function>(function), - std::forward<Args>(args)...); -} - -} // namespace Utils diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index c39aef1cdef..f9e22e82bfd 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -40,7 +40,6 @@ Project { Depends { name: "ptyqt" } files: [ - "QtConcurrentTools", "algorithm.h", "ansiescapecodehandler.cpp", "ansiescapecodehandler.h", @@ -147,7 +146,6 @@ Project { "fixedsizeclicklabel.h", "flowlayout.cpp", "flowlayout.h", - "functiontraits.h", "futuresynchronizer.cpp", "futuresynchronizer.h", "fuzzymatcher.cpp", @@ -193,7 +191,6 @@ Project { "listutils.h", "macroexpander.cpp", "macroexpander.h", - "mapreduce.h", "mathutils.cpp", "mathutils.h", "mimeutils.h", @@ -270,8 +267,6 @@ Project { "reloadpromptutils.h", "removefiledialog.cpp", "removefiledialog.h", - "runextensions.cpp", - "runextensions.h", "savefile.cpp", "savefile.h", "scopedswap.h", diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index d896836a500..5e6f3bcd781 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -39,7 +39,7 @@ \c init() is called in the GUI thread and can be used to query the project for any information you need. - \c run() is run via Utils::runAsync in a separate thread. If you need an + \c run() is run via Utils::asyncRun in a separate thread. If you need an event loop, you need to create it yourself. */ diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp index 31a55faab01..f3e234b02d8 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp @@ -28,7 +28,6 @@ #include <texteditor/tabsettings.h> #include <texteditor/texteditorsettings.h> -#include <utils/QtConcurrentTools> #include <utils/algorithm.h> #include <utils/async.h> #include <utils/filesystemwatcher.h> diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 5dcd026a7af..7b53a20004d 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -13,11 +13,9 @@ add_subdirectory(filesearch) add_subdirectory(haskell) add_subdirectory(json) add_subdirectory(languageserverprotocol) -add_subdirectory(mapreduce) add_subdirectory(pointeralgorithm) add_subdirectory(profilewriter) add_subdirectory(qml) -add_subdirectory(runextensions) add_subdirectory(sdktool) add_subdirectory(solutions) add_subdirectory(texteditor) diff --git a/tests/auto/auto.qbs b/tests/auto/auto.qbs index 603b5cd1b15..a21b61fc0cd 100644 --- a/tests/auto/auto.qbs +++ b/tests/auto/auto.qbs @@ -20,7 +20,6 @@ Project { "languageserverprotocol/languageserverprotocol.qbs", "profilewriter/profilewriter.qbs", "qml/qml.qbs", - "runextensions/runextensions.qbs", "sdktool/sdktool.qbs", "solutions/solutions.qbs", "texteditor/texteditor.qbs", diff --git a/tests/auto/mapreduce/CMakeLists.txt b/tests/auto/mapreduce/CMakeLists.txt deleted file mode 100644 index 5a57f3c6761..00000000000 --- a/tests/auto/mapreduce/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_qtc_test(tst_mapreduce - DEPENDS Utils - SOURCES tst_mapreduce.cpp -) diff --git a/tests/auto/mapreduce/mapreduce.qbs b/tests/auto/mapreduce/mapreduce.qbs deleted file mode 100644 index 63502117b02..00000000000 --- a/tests/auto/mapreduce/mapreduce.qbs +++ /dev/null @@ -1,10 +0,0 @@ -import qbs - -QtcAutotest { - name: "Map reduce autotest" - Depends { name: "Utils" } - - files: [ - "tst_mapreduce.cpp", - ] -} diff --git a/tests/auto/mapreduce/tst_mapreduce.cpp b/tests/auto/mapreduce/tst_mapreduce.cpp deleted file mode 100644 index df1f8e1986b..00000000000 --- a/tests/auto/mapreduce/tst_mapreduce.cpp +++ /dev/null @@ -1,345 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include <utils/algorithm.h> -#include <utils/mapreduce.h> - -#include <QThreadPool> -#include <QtTest> - -#if !defined(Q_CC_MSVC) || _MSC_VER >= 1900 // MSVC2015 -#define SUPPORTS_MOVE -#endif - -class tst_MapReduce : public QObject -{ - Q_OBJECT - -private slots: - void mapReduce(); - void mapReduceRvalueContainer(); - void map(); - void orderedMapReduce(); -#ifdef SUPPORTS_MOVE - void moveOnlyType(); -#endif -}; - -static int returnxx(int x) -{ - return x*x; -} - -static void returnxxThroughFutureInterface(QFutureInterface<int> &fi, int x) -{ - fi.reportResult(x*x); -} - -void tst_MapReduce::mapReduce() -{ - QThreadPool pool; - const auto initWithFutureInterface = [](QFutureInterface<double> &fi) -> double { - fi.reportResult(0.); - return 0.; - }; - const auto reduceWithFutureInterface = [](QFutureInterface<double> &fi, double &state, int value) { - state += value; - fi.reportResult(value); - }; - const auto reduceWithReturn = [](double &state, int value) -> double { - state += value; - return value; - }; - const auto cleanupWithFutureInterface = [](QFutureInterface<double> &fi, double &state) { - state /= 2.; - fi.reportResult(state); - }; - - { - // map without future interface - QList<double> results = Utils::mapReduce(QVector<int>({1, 2, 3, 4, 5}), - initWithFutureInterface, - returnxx, - reduceWithFutureInterface, - cleanupWithFutureInterface) - .results(); - Utils::sort(results); // mapping order is undefined - QCOMPARE(results, QList<double>({0., 1., 4., 9., 16., 25., 27.5})); - } - { - // map with future interface - QList<double> results = Utils::mapReduce(QList<int>({1, 2, 3, 4, 5}), - initWithFutureInterface, returnxxThroughFutureInterface, - reduceWithFutureInterface, cleanupWithFutureInterface) - .results(); - Utils::sort(results); // mapping order is undefined - QCOMPARE(results, QList<double>({0., 1., 4., 9., 16., 25., 27.5})); - } - { - // reduce without future interface - QList<double> results = Utils::mapReduce(QList<int>({1, 2, 3, 4, 5}), - initWithFutureInterface, returnxx, - reduceWithReturn, cleanupWithFutureInterface) - .results(); - Utils::sort(results); // mapping order is undefined - QCOMPARE(results, QList<double>({0., 1., 4., 9., 16., 25., 27.5})); - } - { - // reduce with threadpool - QList<double> results = Utils::mapReduce(QList<int>({1, 2, 3, 4, 5}), - initWithFutureInterface, returnxx, - reduceWithReturn, cleanupWithFutureInterface, - Utils::MapReduceOption::Unordered, &pool) - .results(); - Utils::sort(results); // mapping order is undefined - QCOMPARE(results, QList<double>({0., 1., 4., 9., 16., 25., 27.5})); - } - { - // lvalue ref container - QList<int> container({1, 2, 3, 4, 5}); - QList<double> results = Utils::mapReduce(container, - initWithFutureInterface, returnxx, - reduceWithReturn, cleanupWithFutureInterface) - .results(); - Utils::sort(results); // mapping order is undefined - QCOMPARE(results, QList<double>({0., 1., 4., 9., 16., 25., 27.5})); - } - { - // std::cref - QList<int> container({1, 2, 3, 4, 5}); - QCOMPARE(Utils::mapReduce(std::cref(container), - initWithFutureInterface, returnxx, - reduceWithReturn, cleanupWithFutureInterface, - Utils::MapReduceOption::Ordered).results(), - QList<double>({0., 1., 4., 9., 16., 25., 27.5})); - } - { - // std::cref with threadpool - QList<int> container({1, 2, 3, 4, 5}); - QCOMPARE(Utils::mapReduce(std::cref(container), - initWithFutureInterface, returnxx, - reduceWithReturn, cleanupWithFutureInterface, - Utils::MapReduceOption::Ordered, &pool).results(), - QList<double>({0., 1., 4., 9., 16., 25., 27.5})); - } - { - // std::ref - QList<int> container({1, 2, 3, 4, 5}); - QCOMPARE(Utils::mapReduce(std::ref(container), - initWithFutureInterface, returnxx, - reduceWithReturn, cleanupWithFutureInterface, - Utils::MapReduceOption::Ordered).results(), - QList<double>({0., 1., 4., 9., 16., 25., 27.5})); - } - { - // init and cleanup without future interface - QCOMPARE(Utils::mapReduce(QList<int>({1, 2, 3}), - []() { return 0.; }, - [](int v) { return v*2; }, - [](double &state, int v) { return state += v/4.; }, - [](double &) { }, - Utils::MapReduceOption::Ordered).results(), - QList<double>({.5, 1.5, 3.})); - } - { - // simplified map reduce without init and cleanup - QCOMPARE(Utils::mapReduce(QList<QString>({QLatin1String("blubb"), QLatin1String("foo"), QLatin1String("blah")}), - [](const QString &val) { return val.size(); }, - 90., - [](double &state, int val) { - state /= double(val); - }, - Utils::MapReduceOption::Ordered).result(), - 1.5); - } - { - // simplified map reduce without init and cleanup with threadpool - QCOMPARE(Utils::mapReduce(QList<QString>({QLatin1String("blubb"), QLatin1String("foo"), QLatin1String("blah")}), - [](const QString &val) { return val.size(); }, - 90., - [](double &state, int val) { - state /= double(val); - }, - Utils::MapReduceOption::Ordered, &pool).result(), - 1.5); - } - { - // simplified map reduce - // std::cref - QList<int> container({1, 2, 3}); - QCOMPARE(Utils::mapReduce(std::cref(container), [](int val) { return 2*val; }, 10, - [](int &state, int val) { state += val; }).result(), - 22); - } - { - // simplified map reduce - // std::cref with threadpool - QList<int> container({1, 2, 3}); - QCOMPARE(Utils::mapReduce(std::cref(container), [](int val) { return 2*val; }, 10, - [](int &state, int val) { state += val; }, - Utils::MapReduceOption::Unordered, &pool).result(), - 22); - } - { - // simplified map reduce - // std::ref - QList<int> container({1, 2, 3}); - QCOMPARE(Utils::mapReduce(std::ref(container), [](int &val) { return 2*val; }, 10, - [](int &state, int val) { state += val; }).result(), - 22); - } - { - // blocking mapReduce = mappedReduced - QCOMPARE(Utils::mappedReduced(QList<int>({1, 2, 3}), [](int &val) { return 2*val; }, 10, - [](int &state, int val) { state += val; }), - 22); - } - { - // blocking mapReduce = mappedReduced - // with threadpool - QCOMPARE(Utils::mappedReduced(QList<int>({1, 2, 3}), [](int &val) { return 2*val; }, 10, - [](int &state, int val) { state += val; }, - Utils::MapReduceOption::Unordered, &pool), - 22); - } -} - -void tst_MapReduce::mapReduceRvalueContainer() -{ - { - QFuture<int> future = Utils::mapReduce(QList<int>({1, 2, 3, 4, 5}), - []() { return 0; }, - [](int value) { return value; }, - [](QFutureInterface<int> &, int &state, int value) { state += value; }, - [](QFutureInterface<int> &fi, int &state) { fi.reportResult(state); }); - // here, lifetime of the QList temporary ends - QCOMPARE(future.results(), QList<int>({15})); - } -} - -void tst_MapReduce::map() -{ - QCOMPARE(Utils::map(QList<int>({2, 5, 1}), [](int x) { return x*2.5; }).results(), - QList<double>({5., 12.5, 2.5})); - { - // void result - QList<int> results; - QMutex mutex; - Utils::map( - // container - QList<int>({2, 5, 1}), - // map - [&mutex, &results](int x) { QMutexLocker l(&mutex); results.append(x); } - ).waitForFinished(); - // Utils::map is "ordered" by default, but that means that result reporting is ordered, - // the map function is still called out-of-order - Utils::sort(results); - QCOMPARE(results, QList<int>({1, 2, 5})); - } - { - // inplace editing - QList<int> container({2, 5, 1}); - Utils::map(std::ref(container), [](int &x) { x *= 2; }).waitForFinished(); - QCOMPARE(container, QList<int>({4, 10, 2})); - - Utils::map(container.begin(), container.end(), [](int &x) { x *= 2; }, - Utils::MapReduceOption::Unordered, - nullptr, QThread::InheritPriority, 3).waitForFinished(); - QCOMPARE(container, QList<int>({8, 20, 4})); - } - - // blocking map = mapped - { - const QSet<qsizetype> sizes = Utils::mapped<QSet>( - QStringList({QLatin1String("foo"), QLatin1String("bar"), QLatin1String("blah")}), - [](const QString &s) { return s.size(); }); - QList<qsizetype> vals = sizes.values(); - Utils::sort(vals); - QCOMPARE(vals, QList<qsizetype>({3, 4})); - } - { - const QStringList list({QLatin1String("foo"), QLatin1String("bar"), QLatin1String("blah")}); - const QSet<qsizetype> sizes = Utils::mapped<QSet>(list.cbegin(), - list.cend(), - [](const QString &s) { - return s.size(); - }); - QList<qsizetype> vals = sizes.values(); - Utils::sort(vals); - QCOMPARE(vals, QList<qsizetype>({3, 4})); - } -} - -void tst_MapReduce::orderedMapReduce() -{ - QCOMPARE(Utils::mapReduce(QList<int>({1, 2, 3, 4}), - []() { return 0; }, - [](int i) { return i*2; }, - [](int &state, int val) { state += val; return state; }, - [](int &) { }, - Utils::MapReduceOption::Ordered).results(), - QList<int>({2, 6, 12, 20})); -} - -#ifdef SUPPORTS_MOVE - -class MoveOnlyType -{ -public: - MoveOnlyType() noexcept {} // <- with GCC 5 the defaulted one is noexcept(false) - MoveOnlyType(const MoveOnlyType &) = delete; - MoveOnlyType(MoveOnlyType &&) = default; - MoveOnlyType &operator=(const MoveOnlyType &) = delete; - MoveOnlyType &operator=(MoveOnlyType &&) = default; -}; - -class MoveOnlyState : public MoveOnlyType -{ -public: - int count = 0; -}; - -class MoveOnlyInit : public MoveOnlyType -{ -public: - MoveOnlyState operator()(QFutureInterface<int> &) const { return MoveOnlyState(); } -}; - -class MoveOnlyMap : public MoveOnlyType -{ -public: - int operator()(const MoveOnlyType &) const { return 1; } -}; - -class MoveOnlyReduce : public MoveOnlyType -{ -public: - void operator()(QFutureInterface<int> &, MoveOnlyState &state, int) { ++state.count; } -}; - -class MoveOnlyList : public std::vector<MoveOnlyType> -{ -public: - MoveOnlyList() { emplace_back(MoveOnlyType()); emplace_back(MoveOnlyType()); } - MoveOnlyList(const MoveOnlyList &) = delete; - MoveOnlyList(MoveOnlyList &&) = default; - MoveOnlyList &operator=(const MoveOnlyList &) = delete; - MoveOnlyList &operator=(MoveOnlyList &&) = default; -}; - -void tst_MapReduce::moveOnlyType() -{ - QCOMPARE(Utils::mapReduce(MoveOnlyList(), - MoveOnlyInit(), - MoveOnlyMap(), - MoveOnlyReduce(), - [](QFutureInterface<int> &fi, MoveOnlyState &state) { fi.reportResult(state.count); } - ).results(), - QList<int>({2})); -} - -#endif - -QTEST_GUILESS_MAIN(tst_MapReduce) - -#include "tst_mapreduce.moc" diff --git a/tests/auto/runextensions/CMakeLists.txt b/tests/auto/runextensions/CMakeLists.txt deleted file mode 100644 index 73455f75185..00000000000 --- a/tests/auto/runextensions/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_qtc_test(tst_runextensions - DEPENDS Utils - SOURCES tst_runextensions.cpp -) diff --git a/tests/auto/runextensions/runextensions.qbs b/tests/auto/runextensions/runextensions.qbs deleted file mode 100644 index 26e6bf5d84a..00000000000 --- a/tests/auto/runextensions/runextensions.qbs +++ /dev/null @@ -1,10 +0,0 @@ -import qbs - -QtcAutotest { - name: "Run extensions autotest" - Depends { name: "Utils" } - - files: [ - "tst_runextensions.cpp", - ] -} diff --git a/tests/auto/runextensions/tst_runextensions.cpp b/tests/auto/runextensions/tst_runextensions.cpp deleted file mode 100644 index 4ffee270025..00000000000 --- a/tests/auto/runextensions/tst_runextensions.cpp +++ /dev/null @@ -1,540 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include <utils/runextensions.h> - -#include <QtTest> - -#if !defined(Q_CC_MSVC) || _MSC_VER >= 1900 // MSVC2015 -#define SUPPORTS_MOVE -#endif - -class tst_RunExtensions : public QObject -{ - Q_OBJECT - -private slots: - void runAsync(); - void runInThreadPool(); -#ifdef SUPPORTS_MOVE - void moveOnlyType(); -#endif - void threadPriority(); - void runAsyncNoFutureInterface(); - void crefFunction(); -}; - -void report3(QFutureInterface<int> &fi) -{ - fi.reportResults({0, 2, 1}); -} - -void reportN(QFutureInterface<double> &fi, int n) -{ - fi.reportResults(QVector<double>(n, 0)); -} - -void reportString1(QFutureInterface<QString> &fi, const QString &s) -{ - fi.reportResult(s); -} - -void reportString2(QFutureInterface<QString> &fi, QString s) -{ - fi.reportResult(s); -} - -class Callable { -public: - void operator()(QFutureInterface<double> &fi, int n) const - { - fi.reportResults(QVector<double>(n, 0)); - } -}; - -class MyObject { -public: - static void staticMember0(QFutureInterface<double> &fi) - { - fi.reportResults({0, 2, 1}); - } - - static void staticMember1(QFutureInterface<double> &fi, int n) - { - fi.reportResults(QVector<double>(n, 0)); - } - - void member0(QFutureInterface<double> &fi) const - { - fi.reportResults({0, 2, 1}); - } - - void member1(QFutureInterface<double> &fi, int n) const - { - fi.reportResults(QVector<double>(n, 0)); - } - - void memberString1(QFutureInterface<QString> &fi, const QString &s) const - { - fi.reportResult(s); - } - - void memberString2(QFutureInterface<QString> &fi, QString s) const - { - fi.reportResult(s); - } - - void nonConstMember(QFutureInterface<double> &fi) - { - fi.reportResults({0, 2, 1}); - } -}; - -void voidFunction(bool *value) // can be useful to get QFuture for watching when it is finished -{ - *value = true; -} - -int one() -{ - return 1; -} - -int identity(int input) -{ - return input; -} - -QString stringIdentity1(const QString &s) -{ - return s; -} - -QString stringIdentity2(QString s) -{ - return s; -} - -class CallableWithoutQFutureInterface { -public: - void operator()(bool *value) const - { - *value = true; - } -}; - -class MyObjectWithoutQFutureInterface { -public: - static void staticMember0(bool *value) - { - *value = true; - } - - static double staticMember1(int n) - { - return n; - } - - void member0(bool *value) const - { - *value = true; - } - - double member1(int n) const - { - return n; - } - - QString memberString1(const QString &s) const - { - return s; - } - - QString memberString2(QString s) const - { - return s; - } - - double nonConstMember(int n) - { - return n; - } -}; - -void tst_RunExtensions::runAsync() -{ - // free function pointer - QCOMPARE(Utils::runAsync(&report3).results(), - QList<int>({0, 2, 1})); - QCOMPARE(Utils::runAsync(report3).results(), - QList<int>({0, 2, 1})); - - QCOMPARE(Utils::runAsync(reportN, 4).results(), - QList<double>({0, 0, 0, 0})); - QCOMPARE(Utils::runAsync(reportN, 2).results(), - QList<double>({0, 0})); - - QString s = QLatin1String("string"); - const QString &crs = QLatin1String("cr string"); - const QString cs = QLatin1String("c string"); - - QCOMPARE(Utils::runAsync(reportString1, s).results(), - QList<QString>({s})); - QCOMPARE(Utils::runAsync(reportString1, crs).results(), - QList<QString>({crs})); - QCOMPARE(Utils::runAsync(reportString1, cs).results(), - QList<QString>({cs})); - QCOMPARE(Utils::runAsync(reportString1, QString(QLatin1String("rvalue"))).results(), - QList<QString>({QString(QLatin1String("rvalue"))})); - - QCOMPARE(Utils::runAsync(reportString2, s).results(), - QList<QString>({s})); - QCOMPARE(Utils::runAsync(reportString2, crs).results(), - QList<QString>({crs})); - QCOMPARE(Utils::runAsync(reportString2, cs).results(), - QList<QString>({cs})); - QCOMPARE(Utils::runAsync(reportString2, QString(QLatin1String("rvalue"))).results(), - QList<QString>({QString(QLatin1String("rvalue"))})); - - // lambda - QCOMPARE(Utils::runAsync([](QFutureInterface<double> &fi, int n) { - fi.reportResults(QVector<double>(n, 0)); - }, 3).results(), - QList<double>({0, 0, 0})); - - // std::function - const std::function<void(QFutureInterface<double>&,int)> fun = [](QFutureInterface<double> &fi, int n) { - fi.reportResults(QVector<double>(n, 0)); - }; - QCOMPARE(Utils::runAsync(fun, 2).results(), - QList<double>({0, 0})); - - // operator() - QCOMPARE(Utils::runAsync(Callable(), 3).results(), - QList<double>({0, 0, 0})); - const Callable c{}; - QCOMPARE(Utils::runAsync(c, 2).results(), - QList<double>({0, 0})); - - // static member functions - QCOMPARE(Utils::runAsync(&MyObject::staticMember0).results(), - QList<double>({0, 2, 1})); - QCOMPARE(Utils::runAsync(&MyObject::staticMember1, 2).results(), - QList<double>({0, 0})); - - // member functions - const MyObject obj{}; - QCOMPARE(Utils::runAsync(&MyObject::member0, &obj).results(), - QList<double>({0, 2, 1})); - QCOMPARE(Utils::runAsync(&MyObject::member1, &obj, 4).results(), - QList<double>({0, 0, 0, 0})); - QCOMPARE(Utils::runAsync(&MyObject::memberString1, &obj, s).results(), - QList<QString>({s})); - QCOMPARE(Utils::runAsync(&MyObject::memberString1, &obj, crs).results(), - QList<QString>({crs})); - QCOMPARE(Utils::runAsync(&MyObject::memberString1, &obj, cs).results(), - QList<QString>({cs})); - QCOMPARE(Utils::runAsync(&MyObject::memberString1, &obj, QString(QLatin1String("rvalue"))).results(), - QList<QString>({QString(QLatin1String("rvalue"))})); - QCOMPARE(Utils::runAsync(&MyObject::memberString2, &obj, s).results(), - QList<QString>({s})); - QCOMPARE(Utils::runAsync(&MyObject::memberString2, &obj, crs).results(), - QList<QString>({crs})); - QCOMPARE(Utils::runAsync(&MyObject::memberString2, &obj, cs).results(), - QList<QString>({cs})); - QCOMPARE(Utils::runAsync(&MyObject::memberString2, &obj, QString(QLatin1String("rvalue"))).results(), - QList<QString>({QString(QLatin1String("rvalue"))})); - MyObject nonConstObj{}; - QCOMPARE(Utils::runAsync(&MyObject::nonConstMember, &nonConstObj).results(), - QList<double>({0, 2, 1})); -} - -void tst_RunExtensions::runInThreadPool() -{ - QScopedPointer<QThreadPool> pool(new QThreadPool); - // free function pointer - QCOMPARE(Utils::runAsync(pool.data(), &report3).results(), - QList<int>({0, 2, 1})); - QCOMPARE(Utils::runAsync(pool.data(), report3).results(), - QList<int>({0, 2, 1})); - - QCOMPARE(Utils::runAsync(pool.data(), reportN, 4).results(), - QList<double>({0, 0, 0, 0})); - QCOMPARE(Utils::runAsync(pool.data(), reportN, 2).results(), - QList<double>({0, 0})); - - QString s = QLatin1String("string"); - const QString &crs = QLatin1String("cr string"); - const QString cs = QLatin1String("c string"); - - QCOMPARE(Utils::runAsync(pool.data(), reportString1, s).results(), - QList<QString>({s})); - QCOMPARE(Utils::runAsync(pool.data(), reportString1, crs).results(), - QList<QString>({crs})); - QCOMPARE(Utils::runAsync(pool.data(), reportString1, cs).results(), - QList<QString>({cs})); - QCOMPARE(Utils::runAsync(pool.data(), reportString1, QString(QLatin1String("rvalue"))).results(), - QList<QString>({QString(QLatin1String("rvalue"))})); - - QCOMPARE(Utils::runAsync(pool.data(), reportString2, s).results(), - QList<QString>({s})); - QCOMPARE(Utils::runAsync(pool.data(), reportString2, crs).results(), - QList<QString>({crs})); - QCOMPARE(Utils::runAsync(pool.data(), reportString2, cs).results(), - QList<QString>({cs})); - QCOMPARE(Utils::runAsync(pool.data(), reportString2, QString(QLatin1String("rvalue"))).results(), - QList<QString>({QString(QLatin1String("rvalue"))})); - - // lambda - QCOMPARE(Utils::runAsync(pool.data(), [](QFutureInterface<double> &fi, int n) { - fi.reportResults(QVector<double>(n, 0)); - }, 3).results(), - QList<double>({0, 0, 0})); - - // std::function - const std::function<void(QFutureInterface<double>&,int)> fun = [](QFutureInterface<double> &fi, int n) { - fi.reportResults(QVector<double>(n, 0)); - }; - QCOMPARE(Utils::runAsync(pool.data(), fun, 2).results(), - QList<double>({0, 0})); - - // operator() - QCOMPARE(Utils::runAsync(pool.data(), Callable(), 3).results(), - QList<double>({0, 0, 0})); - const Callable c{}; - QCOMPARE(Utils::runAsync(pool.data(), c, 2).results(), - QList<double>({0, 0})); - - // static member functions - QCOMPARE(Utils::runAsync(pool.data(), &MyObject::staticMember0).results(), - QList<double>({0, 2, 1})); - QCOMPARE(Utils::runAsync(pool.data(), &MyObject::staticMember1, 2).results(), - QList<double>({0, 0})); - - // member functions - const MyObject obj{}; - QCOMPARE(Utils::runAsync(pool.data(), &MyObject::member0, &obj).results(), - QList<double>({0, 2, 1})); - QCOMPARE(Utils::runAsync(pool.data(), &MyObject::member1, &obj, 4).results(), - QList<double>({0, 0, 0, 0})); - QCOMPARE(Utils::runAsync(pool.data(), &MyObject::memberString1, &obj, s).results(), - QList<QString>({s})); - QCOMPARE(Utils::runAsync(pool.data(), &MyObject::memberString1, &obj, crs).results(), - QList<QString>({crs})); - QCOMPARE(Utils::runAsync(pool.data(), &MyObject::memberString1, &obj, cs).results(), - QList<QString>({cs})); - QCOMPARE(Utils::runAsync(pool.data(), &MyObject::memberString1, &obj, QString(QLatin1String("rvalue"))).results(), - QList<QString>({QString(QLatin1String("rvalue"))})); - QCOMPARE(Utils::runAsync(pool.data(), &MyObject::memberString2, &obj, s).results(), - QList<QString>({s})); - QCOMPARE(Utils::runAsync(pool.data(), &MyObject::memberString2, &obj, crs).results(), - QList<QString>({crs})); - QCOMPARE(Utils::runAsync(pool.data(), &MyObject::memberString2, &obj, cs).results(), - QList<QString>({cs})); - QCOMPARE(Utils::runAsync(pool.data(), &MyObject::memberString2, &obj, QString(QLatin1String("rvalue"))).results(), - QList<QString>({QString(QLatin1String("rvalue"))})); -} - -#ifdef SUPPORTS_MOVE - -class MoveOnlyType -{ -public: - MoveOnlyType() = default; - MoveOnlyType(const MoveOnlyType &) = delete; - MoveOnlyType(MoveOnlyType &&) = default; - MoveOnlyType &operator=(const MoveOnlyType &) = delete; - MoveOnlyType &operator=(MoveOnlyType &&) = default; -}; - -class MoveOnlyCallable : public MoveOnlyType -{ -public: - void operator()(QFutureInterface<int> &fi, const MoveOnlyType &) - { - fi.reportResult(1); - } -}; - -void tst_RunExtensions::moveOnlyType() -{ - QCOMPARE(Utils::runAsync(MoveOnlyCallable(), MoveOnlyType()).results(), - QList<int>({1})); -} - -#endif - -void tst_RunExtensions::threadPriority() -{ - QScopedPointer<QThreadPool> pool(new QThreadPool); - // with pool - QCOMPARE(Utils::runAsync(pool.data(), QThread::LowestPriority, &report3).results(), - QList<int>({0, 2, 1})); - - // without pool - QCOMPARE(Utils::runAsync(QThread::LowestPriority, report3).results(), - QList<int>({0, 2, 1})); -} - -void tst_RunExtensions::runAsyncNoFutureInterface() -{ - // free function pointer - bool value = false; - Utils::runAsync(voidFunction, &value).waitForFinished(); - QCOMPARE(value, true); - - QCOMPARE(Utils::runAsync(one).results(), - QList<int>({1})); - QCOMPARE(Utils::runAsync(identity, 5).results(), - QList<int>({5})); - - QString s = QLatin1String("string"); - const QString &crs = QLatin1String("cr string"); - const QString cs = QLatin1String("c string"); - - QCOMPARE(Utils::runAsync(stringIdentity1, s).results(), - QList<QString>({s})); - QCOMPARE(Utils::runAsync(stringIdentity1, crs).results(), - QList<QString>({crs})); - QCOMPARE(Utils::runAsync(stringIdentity1, cs).results(), - QList<QString>({cs})); - QCOMPARE(Utils::runAsync(stringIdentity1, QString(QLatin1String("rvalue"))).results(), - QList<QString>({QString(QLatin1String("rvalue"))})); - QCOMPARE(Utils::runAsync(stringIdentity2, s).results(), - QList<QString>({s})); - QCOMPARE(Utils::runAsync(stringIdentity2, crs).results(), - QList<QString>({crs})); - QCOMPARE(Utils::runAsync(stringIdentity2, cs).results(), - QList<QString>({cs})); - QCOMPARE(Utils::runAsync(stringIdentity2, QString(QLatin1String("rvalue"))).results(), - QList<QString>({QString(QLatin1String("rvalue"))})); - - // lambda - QCOMPARE(Utils::runAsync([](int n) -> double { - return n + 1; - }, 3).results(), - QList<double>({4})); - - // std::function - const std::function<double(int)> fun = [](int n) { - return n + 1; - }; - QCOMPARE(Utils::runAsync(fun, 2).results(), - QList<double>({3})); - - // operator() - value = false; - Utils::runAsync(CallableWithoutQFutureInterface(), &value).waitForFinished(); - QCOMPARE(value, true); - value = false; - const CallableWithoutQFutureInterface c{}; - Utils::runAsync(c, &value).waitForFinished(); - QCOMPARE(value, true); - - // static member functions - value = false; - Utils::runAsync(&MyObjectWithoutQFutureInterface::staticMember0, &value).waitForFinished(); - QCOMPARE(value, true); - QCOMPARE(Utils::runAsync(&MyObjectWithoutQFutureInterface::staticMember1, 2).results(), - QList<double>({2})); - - // member functions - const MyObjectWithoutQFutureInterface obj{}; - value = false; - Utils::runAsync(&MyObjectWithoutQFutureInterface::member0, &obj, &value).waitForFinished(); - QCOMPARE(value, true); - QCOMPARE(Utils::runAsync(&MyObjectWithoutQFutureInterface::member1, &obj, 4).results(), - QList<double>({4})); - QCOMPARE(Utils::runAsync(&MyObjectWithoutQFutureInterface::memberString1, &obj, s).results(), - QList<QString>({s})); - QCOMPARE(Utils::runAsync(&MyObjectWithoutQFutureInterface::memberString1, &obj, crs).results(), - QList<QString>({crs})); - QCOMPARE(Utils::runAsync(&MyObjectWithoutQFutureInterface::memberString1, &obj, cs).results(), - QList<QString>({cs})); - QCOMPARE(Utils::runAsync(&MyObjectWithoutQFutureInterface::memberString1, &obj, QString(QLatin1String("rvalue"))).results(), - QList<QString>({QString(QLatin1String("rvalue"))})); - QCOMPARE(Utils::runAsync(&MyObjectWithoutQFutureInterface::memberString2, &obj, s).results(), - QList<QString>({s})); - QCOMPARE(Utils::runAsync(&MyObjectWithoutQFutureInterface::memberString2, &obj, crs).results(), - QList<QString>({crs})); - QCOMPARE(Utils::runAsync(&MyObjectWithoutQFutureInterface::memberString2, &obj, cs).results(), - QList<QString>({cs})); - QCOMPARE(Utils::runAsync(&MyObjectWithoutQFutureInterface::memberString2, &obj, QString(QLatin1String("rvalue"))).results(), - QList<QString>({QString(QLatin1String("rvalue"))})); - MyObjectWithoutQFutureInterface nonConstObj{}; - QCOMPARE(Utils::runAsync(&MyObjectWithoutQFutureInterface::nonConstMember, &nonConstObj, 4).results(), - QList<double>({4})); -} - -void tst_RunExtensions::crefFunction() -{ - // free function pointer with future interface - auto fun = &report3; - QCOMPARE(Utils::runAsync(std::cref(fun)).results(), - QList<int>({0, 2, 1})); - - // lambda with future interface - auto lambda = [](QFutureInterface<double> &fi, int n) { - fi.reportResults(QVector<double>(n, 0)); - }; - QCOMPARE(Utils::runAsync(std::cref(lambda), 3).results(), - QList<double>({0, 0, 0})); - - // std::function with future interface - const std::function<void(QFutureInterface<double>&,int)> funObj = [](QFutureInterface<double> &fi, int n) { - fi.reportResults(QVector<double>(n, 0)); - }; - QCOMPARE(Utils::runAsync(std::cref(funObj), 2).results(), - QList<double>({0, 0})); - - // callable with future interface - const Callable c{}; - QCOMPARE(Utils::runAsync(std::cref(c), 2).results(), - QList<double>({0, 0})); - - // member functions with future interface - auto member = &MyObject::member0; - const MyObject obj{}; - QCOMPARE(Utils::runAsync(std::cref(member), &obj).results(), - QList<double>({0, 2, 1})); - - // free function pointer without future interface - bool value = false; - auto voidFun = &voidFunction; - Utils::runAsync(std::cref(voidFun), &value).waitForFinished(); - QCOMPARE(value, true); - - auto oneFun = &one; - QCOMPARE(Utils::runAsync(std::cref(oneFun)).results(), - QList<int>({1})); - - // lambda without future interface - auto lambda2 = [](int n) -> double { - return n + 1; - }; - QCOMPARE(Utils::runAsync(std::cref(lambda2), 3).results(), - QList<double>({4})); - - // std::function - const std::function<double(int)> funObj2 = [](int n) { - return n + 1; - }; - QCOMPARE(Utils::runAsync(std::cref(funObj2), 2).results(), - QList<double>({3})); - - // callable without future interface - const CallableWithoutQFutureInterface c2{}; - Utils::runAsync(std::cref(c2), &value).waitForFinished(); - QCOMPARE(value, true); - - // member functions without future interface - const MyObjectWithoutQFutureInterface obj2{}; - auto member2 = &MyObjectWithoutQFutureInterface::member0; - value = false; - Utils::runAsync(std::cref(member2), &obj2, &value).waitForFinished(); - QCOMPARE(value, true); -} - -QTEST_GUILESS_MAIN(tst_RunExtensions) - -#include "tst_runextensions.moc" From b1876052bd401bccc816b54f12072548670d5df8 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 27 Jun 2023 16:26:56 +0200 Subject: [PATCH 0094/1777] ProjectExplorer: Do not auto-remove customized run configurations Until now, it could easily happen that a user's carefully fine-tuned run configurations disappeared just because of e.g. a temporarily broken build system file or simply a switch to a different build configuration. As this is clearly not acceptable, we now make sure customized run configurations are not thrown away even when there is currently no matching factory for them. Fixes: QTCREATORBUG-23163 Fixes: QTCREATORBUG-28273 Change-Id: Ic011a650d15a2897108df986c7e9fe410852e926 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/displayname.cpp | 2 +- src/libs/utils/displayname.h | 2 + .../projectexplorer/projectconfiguration.h | 1 + .../projectconfigurationmodel.cpp | 22 ++++++---- .../projectexplorer/runconfiguration.cpp | 41 ++++++++++++++++++- .../projectexplorer/runconfiguration.h | 6 +++ src/plugins/projectexplorer/target.cpp | 4 +- src/plugins/projectexplorer/target.h | 1 + 8 files changed, 69 insertions(+), 10 deletions(-) diff --git a/src/libs/utils/displayname.cpp b/src/libs/utils/displayname.cpp index b4082a60922..b8402c94021 100644 --- a/src/libs/utils/displayname.cpp +++ b/src/libs/utils/displayname.cpp @@ -37,7 +37,7 @@ bool DisplayName::usesDefaultValue() const void DisplayName::toMap(QVariantMap &map, const QString &key) const { - if (!usesDefaultValue()) + if (m_forceSerialization || !usesDefaultValue()) map.insert(key, m_value); } diff --git a/src/libs/utils/displayname.h b/src/libs/utils/displayname.h index c1e7f7b10a3..b7a9b5f90d0 100644 --- a/src/libs/utils/displayname.h +++ b/src/libs/utils/displayname.h @@ -22,6 +22,7 @@ public: QString value() const; QString defaultValue() const { return m_defaultValue; } bool usesDefaultValue() const; + void forceSerialization() { m_forceSerialization = true; } void toMap(QVariantMap &map, const QString &key) const; void fromMap(const QVariantMap &map, const QString &key); @@ -29,6 +30,7 @@ public: private: QString m_value; QString m_defaultValue; + bool m_forceSerialization = false; }; bool QTCREATOR_UTILS_EXPORT operator==(const DisplayName &dn1, const DisplayName &dn2); diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h index 790d9ebf6b5..713c187c83f 100644 --- a/src/plugins/projectexplorer/projectconfiguration.h +++ b/src/plugins/projectexplorer/projectconfiguration.h @@ -38,6 +38,7 @@ public: bool usesDefaultDisplayName() const { return m_displayName.usesDefaultValue(); } void setDisplayName(const QString &name); void setDefaultDisplayName(const QString &name); + void forceDisplayNameSerialization() { m_displayName.forceSerialization(); } void setToolTip(const QString &text); QString toolTip() const; diff --git a/src/plugins/projectexplorer/projectconfigurationmodel.cpp b/src/plugins/projectexplorer/projectconfigurationmodel.cpp index 61e608dc4b4..23b790a4943 100644 --- a/src/plugins/projectexplorer/projectconfigurationmodel.cpp +++ b/src/plugins/projectexplorer/projectconfigurationmodel.cpp @@ -5,9 +5,10 @@ #include "buildconfiguration.h" #include "deployconfiguration.h" +#include "projectconfiguration.h" +#include "projectexplorertr.h" #include "runconfiguration.h" #include "target.h" -#include "projectconfiguration.h" #include <utils/algorithm.h> #include <utils/stringutils.h> @@ -30,6 +31,9 @@ static bool isOrderedBefore(const ProjectConfiguration *a, const ProjectConfigur ProjectConfigurationModel::ProjectConfigurationModel(Target *target) : m_target(target) { + connect(target, &Target::runConfigurationsUpdated, this, [this] { + emit dataChanged(index(0, 0), index(rowCount(), 0)); + }); } int ProjectConfigurationModel::rowCount(const QModelIndex &parent) const @@ -87,13 +91,17 @@ void ProjectConfigurationModel::displayNameChanged(ProjectConfiguration *pc) QVariant ProjectConfigurationModel::data(const QModelIndex &index, int role) const { - if (role == Qt::DisplayRole) { - const int row = index.row(); - if (row < m_projectConfigurations.size()) - return m_projectConfigurations.at(row)->expandedDisplayName(); - } + if (index.row() >= m_projectConfigurations.size()) + return {}; + ProjectConfiguration * const config = m_projectConfigurations.at(index.row()); - return QVariant(); + if (role == Qt::DisplayRole) { + QString displayName = config->expandedDisplayName(); + if (const auto rc = qobject_cast<RunConfiguration *>(config); rc && !rc->hasCreator()) + displayName += QString(" [%1]").arg(Tr::tr("unavailable")); + return displayName; + } + return {}; } ProjectConfiguration *ProjectConfigurationModel::projectConfigurationAt(int i) const diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 452d07c3599..ab6e4fc32fd 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -45,6 +45,7 @@ using namespace ProjectExplorer::Internal; namespace ProjectExplorer { const char BUILD_KEY[] = "ProjectExplorer.RunConfiguration.BuildKey"; +const char CUSTOMIZED_KEY[] = "ProjectExplorer.RunConfiguration.Customized"; /////////////////////////////////////////////////////////////////////// // @@ -162,6 +163,7 @@ RunConfiguration::RunConfiguration(Target *target, Utils::Id id) : ProjectConfiguration(target, id) { QTC_CHECK(target && target == this->target()); + forceDisplayNameSerialization(); connect(target, &Target::parsingFinished, this, &RunConfiguration::update); m_expander.setDisplayName(Tr::tr("Run Settings")); @@ -239,6 +241,34 @@ bool RunConfiguration::isConfigured() const return !Utils::anyOf(checkForIssues(), [](const Task &t) { return t.type == Task::Error; }); } +bool RunConfiguration::isCustomized() const +{ + if (m_customized) + return true; + QVariantMap state = toMapSimple(); + + // TODO: Why do we save this at all? It's a computed value. + state.remove("RunConfiguration.WorkingDirectory.default"); + + return state != m_pristineState; +} + +bool RunConfiguration::hasCreator() const +{ + return Utils::contains(RunConfigurationFactory::creatorsForTarget(target()), + [this](const RunConfigurationCreationInfo &info) { + return info.factory->runConfigurationId() == id() && info.buildKey == buildKey(); + }); +} + +void RunConfiguration::setPristineState() +{ + if (!m_customized) { + m_pristineState = toMapSimple(); + m_pristineState.remove("RunConfiguration.WorkingDirectory.default"); + } +} + void RunConfiguration::addAspectFactory(const AspectFactory &aspectFactory) { theAspectFactories.push_back(aspectFactory); @@ -277,8 +307,14 @@ Task RunConfiguration::createConfigurationIssue(const QString &description) cons QVariantMap RunConfiguration::toMap() const { - QVariantMap map = ProjectConfiguration::toMap(); + QVariantMap map = toMapSimple(); + map.insert(CUSTOMIZED_KEY, isCustomized()); + return map; +} +QVariantMap RunConfiguration::toMapSimple() const +{ + QVariantMap map = ProjectConfiguration::toMap(); map.insert(BUILD_KEY, m_buildKey); // FIXME: Remove this id mangling, e.g. by using a separate entry for the build key. @@ -344,6 +380,7 @@ bool RunConfiguration::fromMap(const QVariantMap &map) if (!ProjectConfiguration::fromMap(map)) return false; + m_customized = m_customized || map.value(CUSTOMIZED_KEY, false).toBool(); m_buildKey = map.value(BUILD_KEY).toString(); if (m_buildKey.isEmpty()) { @@ -584,6 +621,7 @@ RunConfiguration *RunConfigurationCreationInfo::create(Target *target) const rc->m_buildKey = buildKey; rc->update(); rc->setDisplayName(displayName); + rc->setPristineState(); return rc; } @@ -597,6 +635,7 @@ RunConfiguration *RunConfigurationFactory::restore(Target *parent, const QVarian RunConfiguration *rc = factory->create(parent); if (rc->fromMap(map)) { rc->update(); + rc->setPristineState(); return rc; } delete rc; diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 59704141562..9d9a55120bb 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -111,7 +111,10 @@ public: QWidget *createConfigurationWidget(); bool isConfigured() const; + bool isCustomized() const; + bool hasCreator() const; virtual Tasks checkForIssues() const { return {}; } + void setPristineState(); using CommandLineGetter = std::function<Utils::CommandLine()>; void setCommandLineGetter(const CommandLineGetter &cmdGetter); @@ -170,6 +173,7 @@ private: // Any additional data should be handled by aspects. bool fromMap(const QVariantMap &map) final; QVariantMap toMap() const final; + QVariantMap toMapSimple() const; static void addAspectFactory(const AspectFactory &aspectFactory); @@ -182,6 +186,8 @@ private: RunnableModifier m_runnableModifier; Updater m_updater; Utils::MacroExpander m_expander; + QVariantMap m_pristineState; + bool m_customized = false; }; class RunConfigurationCreationInfo diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index 82d85f84e58..d2f6b3535e4 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -706,7 +706,7 @@ void Target::updateDefaultRunConfigurations() present = true; } } - if (!present) + if (!present && !rc->isCustomized()) toRemove.append(rc); } configuredCount -= toRemove.count(); @@ -797,6 +797,8 @@ void Target::updateDefaultRunConfigurations() // Remove the RCs that are no longer needed: for (RunConfiguration *rc : std::as_const(removalList)) removeRunConfiguration(rc); + + emit runConfigurationsUpdated(); } QVariant Target::namedSettings(const QString &name) const diff --git a/src/plugins/projectexplorer/target.h b/src/plugins/projectexplorer/target.h index 5cfb69eeca0..6e4f06abd04 100644 --- a/src/plugins/projectexplorer/target.h +++ b/src/plugins/projectexplorer/target.h @@ -131,6 +131,7 @@ signals: void removedRunConfiguration(ProjectExplorer::RunConfiguration *rc); void addedRunConfiguration(ProjectExplorer::RunConfiguration *rc); void activeRunConfigurationChanged(ProjectExplorer::RunConfiguration *rc); + void runConfigurationsUpdated(); void removedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc); void addedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc); From 297ff3b9b1106b763bc40e5b2e99878a7dada2f5 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 30 Jun 2023 16:00:53 +0200 Subject: [PATCH 0095/1777] AndroidRunnerWorker: Remove no-op code Since there is no call to recordData() with ANDROID_PRESTARTSHELLCMDLIST or with ANDROID_POSTFINISHSHELLCMDLIST, the recordedData() will always return empty variant. Change-Id: I2d96ddee12181c614a0282f5103fba3fc06b6486 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/android/androidrunnerworker.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index c50129aac25..96b79989f39 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -277,9 +277,6 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa for (const QString &shellCmd : commands) m_beforeStartAdbCommands.append(QString("shell %1").arg(shellCmd)); } - const auto preStartCmdList = runner->recordedData(Constants::ANDROID_PRESTARTSHELLCMDLIST); - for (const QString &shellCmd : preStartCmdList.toStringList()) - m_beforeStartAdbCommands.append(QString("shell %1").arg(shellCmd)); if (const QVariantMap sd = runControl->settingsData(Constants::ANDROID_POSTFINISHSHELLCMDLIST); !sd.values().isEmpty()) { @@ -288,9 +285,6 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa for (const QString &shellCmd : commands) m_afterFinishAdbCommands.append(QString("shell %1").arg(shellCmd)); } - const auto postFinishCmdList = runner->recordedData(Constants::ANDROID_POSTFINISHSHELLCMDLIST); - for (const QString &shellCmd : postFinishCmdList.toStringList()) - m_afterFinishAdbCommands.append(QString("shell %1").arg(shellCmd)); m_debugServerPath = debugServer(m_useLldb, target); qCDebug(androidRunWorkerLog).noquote() << "Device Serial:" << m_deviceSerialNumber From 64c8c37bd479a4d1d284e552e5c02e47a288ff0a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 30 Jun 2023 17:22:25 +0200 Subject: [PATCH 0096/1777] Aspect: Fix recent regression in signal emission Amends 379e7f906 Change-Id: Ia1599613e3c2575c7406cf49f3dd9487c9a1284a Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/aspects.cpp | 13 ++++++++++--- src/libs/utils/aspects.h | 15 +++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index b058c9d365b..900e9f86866 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1297,9 +1297,16 @@ void StringAspect::makeCheckable(CheckBoxPlacement checkBoxPlacement, : BoolAspect::LabelPlacement::AtCheckBox); d->m_checker->setSettingsKey(checkerKey); - connect(d->m_checker.get(), &BoolAspect::changed, this, &StringAspect::internalToGui); - connect(d->m_checker.get(), &BoolAspect::changed, this, &StringAspect::changed); - connect(d->m_checker.get(), &BoolAspect::changed, this, &StringAspect::checkedChanged); + connect(d->m_checker.get(), &BoolAspect::changed, this, [this] { + internalToGui(); + emit changed(); + checkedChanged(); + }); + + connect(d->m_checker.get(), &BoolAspect::volatileValueChanged, this, [this] { + internalToGui(); + checkedChanged(); + }); internalToGui(); } diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index bbd9e36ed22..f36a96cc196 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -239,19 +239,18 @@ public: void setValue(const ValueType &value) { m_external = value; - if (isDirty()) { - externalToInternal(); - internalToGui(); - } + const bool emitSignal = m_external != m_internal; + externalToInternal(); + internalToGui(); + if (emitSignal) + emit changed(); } void setValueQuietly(const ValueType &value) { m_external = value; - if (isDirty()) { - externalToInternal(); - internalToGui(); - } + externalToInternal(); + internalToGui(); } void setVolatileValue(const ValueType &value) From a39119669c3c040c612416fb88a0366e0852f2f3 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 30 Jun 2023 15:16:28 +0200 Subject: [PATCH 0097/1777] CppEditor: Format quickfix code only if formatting is enabled ... in the ClangFormat settings (rather than the default of just indenting). As opposed to files generated by the wizard, quickfixes are often touching existing code, and since ClangFormat works on line granularity, users will experience unexpected re-formattings when ClangFormat is in indent- only mode. Therefore, do the formatting only if the user has enabled it in the ClangFormat settings. Change-Id: Icb30f166f2b6fb94113a8f25c4a5f92ff8bca9b0 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/clangformat/clangformatbaseindenter.cpp | 11 ++++++++++- src/plugins/clangformat/clangformatbaseindenter.h | 3 ++- src/plugins/clangformat/clangformatindenter.cpp | 4 ++-- src/plugins/clangformat/clangformatindenter.h | 3 ++- src/plugins/cppeditor/cppcodestylesettings.cpp | 3 +++ src/plugins/cppeditor/cppcodestylesettings.h | 4 ++++ src/plugins/cppeditor/cppeditordocument.cpp | 2 +- src/plugins/cppeditor/cppquickfix_test.cpp | 6 ++++++ src/plugins/texteditor/indenter.h | 4 +++- src/plugins/texteditor/refactoringchanges.cpp | 8 +++++++- 10 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/plugins/clangformat/clangformatbaseindenter.cpp b/src/plugins/clangformat/clangformatbaseindenter.cpp index 92dd9aea4d5..76979bda123 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.cpp +++ b/src/plugins/clangformat/clangformatbaseindenter.cpp @@ -8,6 +8,7 @@ #include <coreplugin/icore.h> #include <cppeditor/cppcodestylepreferences.h> +#include <cppeditor/cpptoolssettings.h> #include <projectexplorer/editorconfiguration.h> #include <projectexplorer/project.h> @@ -538,8 +539,16 @@ Utils::Text::Replacements ClangFormatBaseIndenter::replacements(QByteArray buffe } Utils::Text::Replacements ClangFormatBaseIndenter::format( - const TextEditor::RangesInLines &rangesInLines) + const TextEditor::RangesInLines &rangesInLines, FormattingMode mode) { + bool doFormatting = mode == FormattingMode::Forced || formatCodeInsteadOfIndent(); +#ifdef WITH_TESTS + doFormatting = doFormatting || CppEditor::CppToolsSettings::instance()->cppCodeStyle() + ->codeStyleSettings().forceFormatting; +#endif + if (!doFormatting) + return {}; + QTC_ASSERT(!m_fileName.isEmpty(), return {}); if (rangesInLines.empty()) return Utils::Text::Replacements(); diff --git a/src/plugins/clangformat/clangformatbaseindenter.h b/src/plugins/clangformat/clangformatbaseindenter.h index 1f0674dec57..6330d757290 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.h +++ b/src/plugins/clangformat/clangformatbaseindenter.h @@ -31,7 +31,8 @@ public: void autoIndent(const QTextCursor &cursor, const TextEditor::TabSettings &tabSettings, int cursorPositionInEditor = -1) override; - Utils::Text::Replacements format(const TextEditor::RangesInLines &rangesInLines) override; + Utils::Text::Replacements format(const TextEditor::RangesInLines &rangesInLines, + FormattingMode mode = FormattingMode::Forced) override; void indentBlock(const QTextBlock &block, const QChar &typedChar, diff --git a/src/plugins/clangformat/clangformatindenter.cpp b/src/plugins/clangformat/clangformatindenter.cpp index f9cb80cd26d..2da8a95ad36 100644 --- a/src/plugins/clangformat/clangformatindenter.cpp +++ b/src/plugins/clangformat/clangformatindenter.cpp @@ -174,9 +174,9 @@ void ClangFormatForwardingIndenter::autoIndent(const QTextCursor &cursor, } Utils::Text::Replacements ClangFormatForwardingIndenter::format( - const TextEditor::RangesInLines &rangesInLines) + const TextEditor::RangesInLines &rangesInLines, FormattingMode mode) { - return currentIndenter()->format(rangesInLines); + return currentIndenter()->format(rangesInLines, mode); } diff --git a/src/plugins/clangformat/clangformatindenter.h b/src/plugins/clangformat/clangformatindenter.h index d0f460aec0d..5e6aca135ef 100644 --- a/src/plugins/clangformat/clangformatindenter.h +++ b/src/plugins/clangformat/clangformatindenter.h @@ -40,7 +40,8 @@ public: void autoIndent(const QTextCursor &cursor, const TextEditor::TabSettings &tabSettings, int cursorPositionInEditor = -1) override; - Utils::Text::Replacements format(const TextEditor::RangesInLines &rangesInLines) override; + Utils::Text::Replacements format(const TextEditor::RangesInLines &rangesInLines, + FormattingMode mode) override; bool formatOnSave() const override; TextEditor::IndentationForBlock indentationForBlocks(const QVector<QTextBlock> &blocks, const TextEditor::TabSettings &tabSettings, diff --git a/src/plugins/cppeditor/cppcodestylesettings.cpp b/src/plugins/cppeditor/cppcodestylesettings.cpp index 3a705091411..0fafad5a071 100644 --- a/src/plugins/cppeditor/cppcodestylesettings.cpp +++ b/src/plugins/cppeditor/cppcodestylesettings.cpp @@ -128,6 +128,9 @@ bool CppCodeStyleSettings::equals(const CppCodeStyleSettings &rhs) const && extraPaddingForConditionsIfConfusingAlign == rhs.extraPaddingForConditionsIfConfusingAlign && alignAssignments == rhs.alignAssignments && preferGetterNameWithoutGetPrefix == rhs.preferGetterNameWithoutGetPrefix +#ifdef WITH_TESTS + && forceFormatting == rhs.forceFormatting +#endif ; } diff --git a/src/plugins/cppeditor/cppcodestylesettings.h b/src/plugins/cppeditor/cppcodestylesettings.h index 08f1dc1ff26..74de7df83af 100644 --- a/src/plugins/cppeditor/cppcodestylesettings.h +++ b/src/plugins/cppeditor/cppcodestylesettings.h @@ -62,6 +62,10 @@ public: // CppEditor/QuickFixSetting. Remove in 4.16 bool preferGetterNameWithoutGetPrefix = true; +#ifdef WITH_TESTS + bool forceFormatting = false; +#endif + QVariantMap toMap() const; void fromMap(const QVariantMap &map); diff --git a/src/plugins/cppeditor/cppeditordocument.cpp b/src/plugins/cppeditor/cppeditordocument.cpp index 0398674941c..9e7856b74b2 100644 --- a/src/plugins/cppeditor/cppeditordocument.cpp +++ b/src/plugins/cppeditor/cppeditordocument.cpp @@ -467,7 +467,7 @@ bool CppEditorDocument::saveImpl(QString *errorString, const FilePath &filePath, if (!editedRanges.empty()) { QTextCursor cursor(document()); cursor.joinPreviousEditBlock(); - indenter()->format(editedRanges); + indenter()->format(editedRanges, Indenter::FormattingMode::Forced); cursor.endEditBlock(); } diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 9651ddb214f..369e07a1348 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -5392,7 +5392,13 @@ SpaceBeforeParens: Always CppTestDocument::create("file.cpp", origSource, expectedSource)}); InsertDefsFromDecls factory; factory.setMode(InsertDefsFromDecls::Mode::Impl); + CppCodeStylePreferences * const prefs = CppToolsSettings::instance()->cppCodeStyle(); + const CppCodeStyleSettings settings = prefs->codeStyleSettings(); + CppCodeStyleSettings tempSettings = settings; + tempSettings.forceFormatting = true; + prefs->setCodeStyleSettings(tempSettings); QuickFixOperationTest(testDocuments, &factory, {}, {}, {}, clangFormatSettings); + prefs->setCodeStyleSettings(settings); } // Function for one of InsertDeclDef section cases diff --git a/src/plugins/texteditor/indenter.h b/src/plugins/texteditor/indenter.h index 80c2aa5d16f..11c6aa87d8b 100644 --- a/src/plugins/texteditor/indenter.h +++ b/src/plugins/texteditor/indenter.h @@ -70,7 +70,9 @@ public: indent(cursor, QChar::Null, tabSettings, cursorPositionInEditor); } - virtual Utils::Text::Replacements format(const RangesInLines & /*rangesInLines*/) + enum class FormattingMode { Forced, Settings }; + virtual Utils::Text::Replacements format(const RangesInLines &, + FormattingMode = FormattingMode::Forced) { return Utils::Text::Replacements(); } diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp index 1b03a07e01f..c432e224302 100644 --- a/src/plugins/texteditor/refactoringchanges.cpp +++ b/src/plugins/texteditor/refactoringchanges.cpp @@ -473,7 +473,13 @@ void RefactoringFile::doFormatting() b = b.next(); } } - m_editor->textDocument()->indenter()->format(formattingRanges); + + // TODO: The proper solution seems to be to call formatOrIndent() here (and not + // use hardcoded indent regions anymore), but that would require intrusive changes + // to the C++ quickfixes and tests, where we rely on the built-in indenter behavior. + m_editor->textDocument()->indenter()->format(formattingRanges, + Indenter::FormattingMode::Settings); + for (QTextBlock b = m_editor->document()->findBlockByNumber( formattingRanges.front().startLine - 1); b.isValid(); b = b.next()) { QString blockText = b.text(); From 61fc1fd45262a8f78c49bc2fb2a7777bdfa02845 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 30 Jun 2023 16:03:52 +0200 Subject: [PATCH 0098/1777] ClangFormat: remove identical prefix and suffix from replacement text To reduce the changes done to the document iterate from the start and back of the replacement text and check whether the document already contains the proposed changes. This also fixes the misplaced snippet part in the if else snippet. Change-Id: I4519ed101cc03e7c49b3a9b775087361c3fd158d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../clangformat/clangformatbaseindenter.cpp | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/src/plugins/clangformat/clangformatbaseindenter.cpp b/src/plugins/clangformat/clangformatbaseindenter.cpp index 76979bda123..cf04958d28a 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.cpp +++ b/src/plugins/clangformat/clangformatbaseindenter.cpp @@ -382,16 +382,37 @@ Utils::Text::Replacements utf16Replacements(const QTextDocument *doc, continue; lineColUtf16.column = std::min(lineColUtf16.column, int(lineText.length())); - const int utf16Offset = Utils::Text::positionInText(doc, - lineColUtf16.line, - lineColUtf16.column + 1); - const int utf16Length = QString::fromUtf8( - utf8Buffer.mid(static_cast<int>(replacement.getOffset()), - static_cast<int>(replacement.getLength()))) - .size(); - convertedReplacements.emplace_back(utf16Offset, - utf16Length, - QString::fromStdString(replacement.getReplacementText().str())); + int utf16Offset = Utils::Text::positionInText(doc, + lineColUtf16.line, + lineColUtf16.column + 1); + int utf16Length = QString::fromUtf8( + utf8Buffer.mid(static_cast<int>(replacement.getOffset()), + static_cast<int>(replacement.getLength()))) + .size(); + + QString replacementText = QString::fromStdString(replacement.getReplacementText().str()); + auto sameCharAt = [&](int replacementOffset) { + if (replacementText.size() <= replacementOffset || replacementOffset < 0) + return false; + const QChar docChar = doc->characterAt(utf16Offset + replacementOffset); + const QChar replacementChar = replacementText.at(replacementOffset); + return docChar == replacementChar + || (docChar == QChar::ParagraphSeparator && replacementChar == '\n'); + }; + // remove identical prefix from replacement text + while (sameCharAt(0)) { + ++utf16Offset; + --utf16Length; + replacementText = replacementText.mid(1); + } + // remove identical suffix from replacement text + while (sameCharAt(utf16Length - 1)) { + --utf16Length; + replacementText.chop(1); + } + + if (!replacementText.isEmpty() || utf16Length > 0) + convertedReplacements.emplace_back(utf16Offset, utf16Length, replacementText); } return convertedReplacements; From d222cc2dbdf58b0a0a3aa5f0034f6ee56ecb1fd2 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 3 Jul 2023 08:13:41 +0200 Subject: [PATCH 0099/1777] AndroidRunSupport: Remove unneeded overloads Change-Id: Id6a8a5a387acb4f33752ad61ab27893a138bac9b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/android/androidruncontrol.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/plugins/android/androidruncontrol.cpp b/src/plugins/android/androidruncontrol.cpp index 16a20b627ad..4dc0aea4296 100644 --- a/src/plugins/android/androidruncontrol.cpp +++ b/src/plugins/android/androidruncontrol.cpp @@ -22,9 +22,6 @@ public: explicit AndroidRunSupport(ProjectExplorer::RunControl *runControl, const QString &intentName = QString()); ~AndroidRunSupport() override; - - void start() override; - void stop() override; }; AndroidRunSupport::AndroidRunSupport(RunControl *runControl, const QString &intentName) @@ -38,16 +35,6 @@ AndroidRunSupport::~AndroidRunSupport() stop(); } -void AndroidRunSupport::start() -{ - AndroidRunner::start(); -} - -void AndroidRunSupport::stop() -{ - AndroidRunner::stop(); -} - AndroidRunWorkerFactory::AndroidRunWorkerFactory() { setProduct<AndroidRunSupport>(); From ce082bb09f5f9aa2612ca6e6c664cadaca51d262 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh <orgad.shaneh@audiocodes.com> Date: Mon, 3 Jul 2023 14:24:10 +0300 Subject: [PATCH 0100/1777] Terminal: Simplify OpenTerminalParameters construction Change-Id: I4dcc2146f227e4a408c88de62f7594953c8ccb66 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/terminalhooks.h | 14 ++++++++++++++ src/plugins/coreplugin/fileutils.cpp | 2 +- src/plugins/projectexplorer/projectexplorer.cpp | 6 +++--- src/plugins/terminal/shellmodel.cpp | 2 +- src/plugins/terminal/terminalprocessimpl.cpp | 8 +++----- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/libs/utils/terminalhooks.h b/src/libs/utils/terminalhooks.h index b37c51517c0..dbc42dea511 100644 --- a/src/libs/utils/terminalhooks.h +++ b/src/libs/utils/terminalhooks.h @@ -41,6 +41,20 @@ enum class ExitBehavior { Close, Restart, Keep }; struct OpenTerminalParameters { + OpenTerminalParameters() = default; + OpenTerminalParameters(const CommandLine &commandLine) : shellCommand(commandLine) {} + OpenTerminalParameters(const FilePath &directory, std::optional<Environment> env) : + workingDirectory(directory), + environment(env) + {} + OpenTerminalParameters(const CommandLine &commandLine, + const FilePath &directory, + std::optional<Environment> env) : + shellCommand(commandLine), + workingDirectory(directory), + environment(env) + {} + std::optional<CommandLine> shellCommand; std::optional<FilePath> workingDirectory; std::optional<Environment> environment; diff --git a/src/plugins/coreplugin/fileutils.cpp b/src/plugins/coreplugin/fileutils.cpp index 3df3309c318..8b1a5122d35 100644 --- a/src/plugins/coreplugin/fileutils.cpp +++ b/src/plugins/coreplugin/fileutils.cpp @@ -106,7 +106,7 @@ void FileUtils::showInFileSystemView(const FilePath &path) void FileUtils::openTerminal(const FilePath &path, const Environment &env) { - Terminal::Hooks::instance().openTerminal({std::nullopt, path, env}); + Terminal::Hooks::instance().openTerminal({path, env}); } QString FileUtils::msgFindInDirectory() diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 0b57384ea22..b68121ca02e 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -3630,7 +3630,7 @@ void ProjectExplorerPluginPrivate::openTerminalHere(const EnvironmentGetter &env BuildConfiguration *bc = activeBuildConfiguration(ProjectTree::projectForNode(currentNode)); if (!bc) { - Terminal::Hooks::instance().openTerminal({{}, currentNode->directory(), environment}); + Terminal::Hooks::instance().openTerminal({currentNode->directory(), environment}); return; } @@ -3649,7 +3649,7 @@ void ProjectExplorerPluginPrivate::openTerminalHere(const EnvironmentGetter &env if (!shell.isEmpty() && buildDevice->rootPath().needsDevice()) { Terminal::Hooks::instance().openTerminal({CommandLine{shell, {}}, workingDir, environment}); } else { - Terminal::Hooks::instance().openTerminal({std::nullopt, workingDir, environment}); + Terminal::Hooks::instance().openTerminal({workingDir, environment}); } } @@ -3684,7 +3684,7 @@ void ProjectExplorerPluginPrivate::openTerminalHereWithRunEnv() Terminal::Hooks::instance().openTerminal( {CommandLine{shell, {}}, workingDir, runnable.environment}); } else { - Terminal::Hooks::instance().openTerminal({std::nullopt, workingDir, runnable.environment}); + Terminal::Hooks::instance().openTerminal({workingDir, runnable.environment}); } } diff --git a/src/plugins/terminal/shellmodel.cpp b/src/plugins/terminal/shellmodel.cpp index 0b13b0f8863..d5caa415dd3 100644 --- a/src/plugins/terminal/shellmodel.cpp +++ b/src/plugins/terminal/shellmodel.cpp @@ -162,7 +162,7 @@ QList<ShellModelItem> ShellModel::remote() const const QList<ShellModelItem> deviceItems = Utils::transform( deviceCmds, [](const Utils::Terminal::NameAndCommandLine &item) -> ShellModelItem { - return ShellModelItem{item.name, {}, {item.commandLine, std::nullopt, std::nullopt}}; + return ShellModelItem{item.name, {}, {item.commandLine}}; }); return deviceItems; diff --git a/src/plugins/terminal/terminalprocessimpl.cpp b/src/plugins/terminal/terminalprocessimpl.cpp index b5d116ec48b..f26383dfade 100644 --- a/src/plugins/terminal/terminalprocessimpl.cpp +++ b/src/plugins/terminal/terminalprocessimpl.cpp @@ -40,11 +40,9 @@ public: TerminalWidget *terminal = m_terminalPane->stoppedTerminalWithId(id); - const OpenTerminalParameters openParameters{setup.m_commandLine, - std::nullopt, - std::nullopt, - ExitBehavior::Keep, - id}; + OpenTerminalParameters openParameters{setup.m_commandLine}; + openParameters.m_exitBehavior = ExitBehavior::Keep; + openParameters.identifier = id; if (!terminal) { terminal = new TerminalWidget(nullptr, openParameters); From f38d08fc42de985f290eedaa7a21127aae633fe3 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 27 Jun 2023 16:49:59 +0200 Subject: [PATCH 0101/1777] Qmake: Rudimentary support for prompt() in .pro file This is good enough to open Qt5's toplevel .pro, but not much more. Ideally, prompt() should not be used in files that are meant to be used non-interactively. Task-number: QTCREATORBUG-18220 Change-Id: I842d3c1a8c742d55cbe89a8d0980f34d179ec011 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/qtsupport/qtsupportplugin.cpp | 32 +++++++++++++++++ src/shared/proparser/qmakebuiltins.cpp | 44 +++++++++++++++++------ src/shared/proparser/qmakeevaluator.h | 5 +++ 3 files changed, 70 insertions(+), 11 deletions(-) diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index 41c88d18e36..497390045b5 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -35,6 +35,8 @@ #include <utils/macroexpander.h> #include <utils/process.h> +#include <QInputDialog> + using namespace Core; using namespace Utils; using namespace ProjectExplorer; @@ -94,6 +96,36 @@ void QtSupportPlugin::initialize() { theProcessRunner() = processRunnerCallback; + thePrompter() = [this](const QString &msg, const QStringList &context) -> std::optional<QString> { + std::optional<QString> res; + QEventLoop loop; + + QMetaObject::invokeMethod(this, [msg, context, &res, &loop] { + QString text; + if (!context.isEmpty()) { + text = "Preceding lines:<i><br>   ..." + + context.join("<br>   ") + + "</i><p>"; + } + text += msg; + bool ok = false; + const QString line = QInputDialog::getText( + ICore::dialogParent(), + /*title*/ "QMake Prompt", + /*label*/ text, + /*echo mode*/ QLineEdit::Normal, + /*text*/ QString(), + /*ok*/ &ok, + /*flags*/ Qt::WindowFlags(), + /*QInputMethodHints*/ Qt::ImhNone); + if (ok) + res = line; + loop.quit(); + }, Qt::QueuedConnection); + loop.exec(QEventLoop::ExcludeUserInputEvents); + return res; + }; + QMakeParser::initialize(); ProFileEvaluator::initialize(); new ProFileCacheManager(this); diff --git a/src/shared/proparser/qmakebuiltins.cpp b/src/shared/proparser/qmakebuiltins.cpp index 87707106e61..505b4cf9895 100644 --- a/src/shared/proparser/qmakebuiltins.cpp +++ b/src/shared/proparser/qmakebuiltins.cpp @@ -441,6 +441,13 @@ QMAKE_EXPORT std::function<void(ProcessData *data)> &theProcessRunner() return runner; } +QMAKE_EXPORT std::function<std::optional<QString>(const QString &, const QStringList &)> + &thePrompter() +{ + static std::function<std::optional<QString>(const QString &, const QStringList &)> prompter; + return prompter; +} + void QMakeEvaluator::runProcessHelper(ProcessData *data) const { const QString root = deviceRoot(); @@ -1161,12 +1168,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand( } } break; -#ifdef PROEVALUATOR_FULL +//#ifdef PROEVALUATOR_FULL case E_PROMPT: { if (args.count() != 1 && args.count() != 2) { evalError(fL1S("prompt(question, [decorate=true]) requires one or two arguments.")); -// } else if (currentFileName() == QLatin1String("-")) { -// evalError(fL1S("prompt(question) cannot be used when '-o -' is used")); + } else if (currentFileName() == QLatin1String("-")) { + evalError(fL1S("prompt(question) cannot be used when '-o -' is used")); } else { QString msg = m_option->expandEnvVars(args.at(0).toQString(m_tmp1)); bool decorate = true; @@ -1179,20 +1186,32 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand( } else { fputs(qPrintable(msg), stderr); } - QFile qfile; - if (qfile.open(stdin, QIODevice::ReadOnly)) { - QTextStream t(&qfile); - const QString &line = t.readLine(); - if (t.atEnd()) { + + if (thePrompter()) { + std::optional<QString> line = thePrompter()(msg, m_logBuffer); + m_logBuffer.clear(); + if (!line) { fputs("\n", stderr); evalError(fL1S("Unexpected EOF.")); return ReturnError; } - ret = split_value_list(QStringView(line)); - } + ret = split_value_list(QStringView(*line)); + } else { + QFile qfile; + if (qfile.open(stdin, QIODevice::ReadOnly)) { + QTextStream t(&qfile); + const QString &line = t.readLine(); + if (t.atEnd()) { + fputs("\n", stderr); + evalError(fL1S("Unexpected EOF.")); + return ReturnError; + } + ret = split_value_list(QStringView(line)); + } + } } break; } -#endif +//#endif case E_REPLACE: if (args.count() != 3 ) { evalError(fL1S("replace(var, before, after) requires three arguments.")); @@ -1827,6 +1846,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( const QString &msg = m_option->expandEnvVars(args.at(0).toQString(m_tmp2)); if (!m_skipLevel) { if (func_t == T_LOG) { + m_logBuffer.append(msg); + if (m_logBuffer.size() > 15) + m_logBuffer.takeFirst(); #ifdef PROEVALUATOR_FULL fputs(msg.toLatin1().constData(), stderr); #endif diff --git a/src/shared/proparser/qmakeevaluator.h b/src/shared/proparser/qmakeevaluator.h index da681b3bbe6..a3d7438d829 100644 --- a/src/shared/proparser/qmakeevaluator.h +++ b/src/shared/proparser/qmakeevaluator.h @@ -48,6 +48,10 @@ public: QT_BEGIN_NAMESPACE QMAKE_EXPORT std::function<void(ProcessData *data)> &theProcessRunner(); + +QMAKE_EXPORT std::function<std::optional<QString>(const QString &, const QStringList &)> & + thePrompter(); + QMAKE_EXPORT QString removeHostAndScheme(const QString &remotePath); class QMakeGlobals; @@ -296,6 +300,7 @@ public: QStringList m_qmakepath; QStringList m_qmakefeatures; QStringList m_mkspecPaths; + QStringList m_logBuffer; QExplicitlySharedDataPointer<QMakeFeatureRoots> m_featureRoots; ProString m_dirSep; ProFunctionDefs m_functionDefs; From 6e59fa4305a46930c68d48cb8911a324d6c9a608 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Date: Fri, 28 Apr 2023 20:34:04 +0900 Subject: [PATCH 0102/1777] Remove unimplimented method declaration Change-Id: Idea9e31ccca7de4a00a8cd9cde5c40491ae1dcbc Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 4bbe75b77c0..f2fb0a18f4c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -92,7 +92,6 @@ public: ~CMakeEditorWidget() final = default; private: - bool save(const QString &fileName = QString()); void findLinkAt(const QTextCursor &cursor, const Utils::LinkHandler &processLinkCallback, bool resolveTarget = true, From 3f6dcf6ad1d8c3410944615d77e870e269845de3 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 3 Jul 2023 11:41:12 +0200 Subject: [PATCH 0103/1777] RunControl: Remove unused isStopping() Change-Id: Ib294a3728bbd106665dc237623deff7ee8cd4bd5 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/runcontrol.cpp | 5 ----- src/plugins/projectexplorer/runcontrol.h | 1 - 2 files changed, 6 deletions(-) diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 21f944989b8..31294f47f1c 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1029,11 +1029,6 @@ bool RunControl::isStarting() const return d->state == RunControlState::Starting; } -bool RunControl::isStopping() const -{ - return d->state == RunControlState::Stopping; -} - bool RunControl::isStopped() const { return d->state == RunControlState::Stopped; diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index 84a5b5c1667..799ec538dd3 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -172,7 +172,6 @@ public: bool isRunning() const; bool isStarting() const; - bool isStopping() const; bool isStopped() const; void setIcon(const Utils::Icon &icon); From 3c051a8b88733a34c8c15d95280cbf04426a1dbb Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Mon, 3 Jul 2023 11:38:45 +0200 Subject: [PATCH 0104/1777] LSP: remove unused functions Change-Id: I56d4fbe09897b920e9a987ceb081f1da6c1706bc Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/languageserverprotocol/lsptypes.cpp | 8 -------- src/libs/languageserverprotocol/lsptypes.h | 2 -- 2 files changed, 10 deletions(-) diff --git a/src/libs/languageserverprotocol/lsptypes.cpp b/src/libs/languageserverprotocol/lsptypes.cpp index 6f0b57c1e35..7f781f8e6df 100644 --- a/src/libs/languageserverprotocol/lsptypes.cpp +++ b/src/libs/languageserverprotocol/lsptypes.cpp @@ -413,12 +413,4 @@ LanguageServerProtocol::MarkupKind::operator QJsonValue() const return {}; } -Utils::Text::Replacement TextEdit::toReplacement(QTextDocument *document) const -{ - const Range &range = this->range(); - const int start = range.start().toPositionInDocument(document); - const int end = range.end().toPositionInDocument(document); - return Utils::Text::Replacement(start, end - start, newText()); -} - } // namespace LanguageServerProtocol diff --git a/src/libs/languageserverprotocol/lsptypes.h b/src/libs/languageserverprotocol/lsptypes.h index 3a9adb1b0d8..c4a4e7a0bc8 100644 --- a/src/libs/languageserverprotocol/lsptypes.h +++ b/src/libs/languageserverprotocol/lsptypes.h @@ -228,8 +228,6 @@ public: QString newText() const { return typedValue<QString>(newTextKey); } void setNewText(const QString &text) { insert(newTextKey, text); } - Utils::Text::Replacement toReplacement(QTextDocument *document) const; - bool isValid() const override { return contains(rangeKey) && contains(newTextKey); } }; From 56772fbcc609cff912cc3d27f0d897c09381d613 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Mon, 3 Jul 2023 12:51:23 +0200 Subject: [PATCH 0105/1777] ClangTools: filepathify replacements Change-Id: I22b6f4786cda39c79cf332dba4a6a7952fd5c8b7 Reviewed-by: hjk <hjk@qt.io> --- .../clangfixitsrefactoringchanges.cpp | 36 +++++++++---------- .../clangfixitsrefactoringchanges.h | 12 +++---- src/plugins/clangtools/clangtool.cpp | 10 +++--- .../clangtools/clangtoolsdiagnosticmodel.cpp | 18 +++++----- .../clangtools/clangtoolsdiagnosticmodel.h | 7 ++-- 5 files changed, 40 insertions(+), 43 deletions(-) diff --git a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp index c1702f1183f..d1094d0dac8 100644 --- a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp +++ b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp @@ -31,7 +31,7 @@ using namespace Utils; namespace ClangTools { namespace Internal { -int FixitsRefactoringFile::position(const QString &filePath, unsigned line, unsigned column) const +int FixitsRefactoringFile::position(const FilePath &filePath, unsigned line, unsigned column) const { QTC_ASSERT(line != 0, return -1); QTC_ASSERT(column != 0, return -1); @@ -66,10 +66,8 @@ bool FixitsRefactoringFile::apply() if (!op.apply) continue; - const FilePath filePath = FilePath::fromString(op.fileName); - // Check for permissions - if (!filePath.isWritableFile()) + if (!op.filePath.isWritableFile()) return false; qCDebug(fixitsLog) << " " << i << "Applying" << op; @@ -78,19 +76,19 @@ bool FixitsRefactoringFile::apply() shiftAffectedReplacements(op, i + 1); // Apply - QTextDocument * const doc = document(op.fileName); + QTextDocument * const doc = document(op.filePath); QTextCursor cursor(doc); cursor.setPosition(op.pos); cursor.setPosition(op.pos + op.length, QTextCursor::KeepAnchor); cursor.insertText(op.text); - auto &opsForFile = operationsByFile[filePath]; + auto &opsForFile = operationsByFile[op.filePath]; opsForFile.first.push_back(&op); opsForFile.second = i; } // Format for (auto it = operationsByFile.cbegin(); it != operationsByFile.cend(); ++it) { - QTextDocument * const doc = document(it.key().toString()); + QTextDocument * const doc = document(it.key()); const std::unique_ptr<TextEditor::Indenter> indenter(factory->createIndenter(doc)); if (!indenter) continue; @@ -104,9 +102,7 @@ bool FixitsRefactoringFile::apply() QString error; for (auto it = m_documents.begin(); it != m_documents.end(); ++it) { - if (!m_textFileFormat.writeFile(FilePath::fromString(it.key()), - it.value()->toPlainText(), - &error)) { + if (!m_textFileFormat.writeFile(it.key(), it.value()->toPlainText(), &error)) { qCDebug(fixitsLog) << "ERROR: Could not write file" << it.key() << ":" << error; return false; // Error writing file } @@ -135,26 +131,26 @@ void FixitsRefactoringFile::format(TextEditor::Indenter &indenter, if (replacements.empty()) return; - shiftAffectedReplacements(operationsForFile.front()->fileName, + shiftAffectedReplacements(operationsForFile.front()->filePath, replacements, firstOperationIndex + 1); } -QTextDocument *FixitsRefactoringFile::document(const QString &filePath) const +QTextDocument *FixitsRefactoringFile::document(const FilePath &filePath) const { if (m_documents.find(filePath) == m_documents.end()) { QString fileContents; if (!filePath.isEmpty()) { QString error; QTextCodec *defaultCodec = Core::EditorManager::defaultTextCodec(); - TextFileFormat::ReadResult result = TextFileFormat::readFile(FilePath::fromString( - filePath), + TextFileFormat::ReadResult result = TextFileFormat::readFile(filePath, defaultCodec, &fileContents, &m_textFileFormat, &error); if (result != TextFileFormat::ReadSuccess) { - qCDebug(fixitsLog) << "ERROR: Could not read " << filePath << ":" << error; + qCDebug(fixitsLog) + << "ERROR: Could not read " << filePath.toUserOutput() << ":" << error; m_textFileFormat.codec = nullptr; } } @@ -168,7 +164,7 @@ void FixitsRefactoringFile::shiftAffectedReplacements(const ReplacementOperation { for (int i = startIndex; i < m_replacementOperations.size(); ++i) { ReplacementOperation ¤t = *m_replacementOperations[i]; - if (op.fileName != current.fileName) + if (op.filePath != current.filePath) continue; ReplacementOperation before = current; @@ -182,13 +178,13 @@ void FixitsRefactoringFile::shiftAffectedReplacements(const ReplacementOperation } } -bool FixitsRefactoringFile::hasIntersection(const QString &fileName, +bool FixitsRefactoringFile::hasIntersection(const FilePath &filePath, const Text::Replacements &replacements, int startIndex) const { for (int i = startIndex; i < m_replacementOperations.size(); ++i) { const ReplacementOperation ¤t = *m_replacementOperations[i]; - if (fileName != current.fileName) + if (filePath != current.filePath) continue; // Usually the number of replacements is from 1 to 3. @@ -205,13 +201,13 @@ bool FixitsRefactoringFile::hasIntersection(const QString &fileName, return false; } -void FixitsRefactoringFile::shiftAffectedReplacements(const QString &fileName, +void FixitsRefactoringFile::shiftAffectedReplacements(const FilePath &filePath, const Text::Replacements &replacements, int startIndex) { for (int i = startIndex; i < m_replacementOperations.size(); ++i) { ReplacementOperation ¤t = *m_replacementOperations[i]; - if (fileName != current.fileName) + if (filePath != current.filePath) continue; for (const auto &replacement : replacements) { diff --git a/src/plugins/clangtools/clangfixitsrefactoringchanges.h b/src/plugins/clangtools/clangfixitsrefactoringchanges.h index 305453a4bfd..31f4412236a 100644 --- a/src/plugins/clangtools/clangfixitsrefactoringchanges.h +++ b/src/plugins/clangtools/clangfixitsrefactoringchanges.h @@ -21,7 +21,7 @@ public: int pos = -1; int length = -1; QString text; - QString fileName; + Utils::FilePath filePath; bool apply = false; }; using ReplacementOperations = QVector<ReplacementOperation *>; @@ -34,28 +34,28 @@ public: FixitsRefactoringFile() = default; ~FixitsRefactoringFile() { qDeleteAll(m_documents); } - int position(const QString &filePath, unsigned line, unsigned column) const; + int position(const Utils::FilePath &filePath, unsigned line, unsigned column) const; void setReplacements(const ReplacementOperations &ops) { m_replacementOperations = ops; } bool apply(); private: - QTextDocument *document(const QString &filePath) const; + QTextDocument *document(const Utils::FilePath &filePath) const; void shiftAffectedReplacements(const ReplacementOperation &op, int startIndex); void format(TextEditor::Indenter &indenter, QTextDocument *doc, const ReplacementOperations &operationsForFile, int firstOperationIndex); - void shiftAffectedReplacements(const QString &fileName, + void shiftAffectedReplacements(const Utils::FilePath &filePath, const Utils::Text::Replacements &replacements, int startIndex); - bool hasIntersection(const QString &fileName, + bool hasIntersection(const Utils::FilePath &filePath, const Utils::Text::Replacements &replacements, int startIndex) const; mutable Utils::TextFileFormat m_textFileFormat; - mutable QHash<QString, QTextDocument *> m_documents; + mutable QHash<Utils::FilePath, QTextDocument *> m_documents; ReplacementOperations m_replacementOperations; // Not owned. }; diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index d5a3e6f202f..2062c4cb5c8 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -221,14 +221,14 @@ public: const Debugger::DiagnosticLocation start = step.ranges.first(); const Debugger::DiagnosticLocation end = step.ranges.last(); - const int startPos = file.position(start.filePath.toString(), start.line, start.column); - const int endPos = file.position(start.filePath.toString(), end.line, end.column); + const int startPos = file.position(start.filePath, start.line, start.column); + const int endPos = file.position(start.filePath, end.line, end.column); auto op = new ReplacementOperation; op->pos = startPos; op->length = endPos - startPos; op->text = step.message; - op->fileName = start.filePath.toString(); + op->filePath = start.filePath; op->apply = apply; replacements += op; @@ -278,14 +278,14 @@ public: QVector<DiagnosticItem *> itemsInvalidated; fileInfo.file.setReplacements(ops); - model->removeWatchedPath(ops.first()->fileName); + model->removeWatchedPath(ops.first()->filePath); if (fileInfo.file.apply()) { itemsApplied = itemsScheduled; } else { itemsFailedToApply = itemsScheduled; itemsInvalidated = itemsSchedulable; } - model->addWatchedPath(ops.first()->fileName); + model->addWatchedPath(ops.first()->filePath); // Update DiagnosticItem state for (DiagnosticItem *diagnosticItem : std::as_const(itemsScheduled)) diff --git a/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp b/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp index e0b797a1e0a..5323f998da2 100644 --- a/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp +++ b/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp @@ -64,7 +64,7 @@ private: ClangToolsDiagnosticModel::ClangToolsDiagnosticModel(QObject *parent) : ClangToolsDiagnosticModelBase(parent) - , m_filesWatcher(std::make_unique<QFileSystemWatcher>()) + , m_filesWatcher(std::make_unique<Utils::FileSystemWatcher>()) { setRootItem(new Utils::StaticTreeItem(QString())); connectFileWatcher(); @@ -104,7 +104,7 @@ void ClangToolsDiagnosticModel::addDiagnostics(const Diagnostics &diagnostics, b if (!filePathItem) { filePathItem = new FilePathItem(filePath); rootItem()->appendChild(filePathItem); - addWatchedPath(filePath.toString()); + addWatchedPath(filePath); } // Add to file path item @@ -149,14 +149,14 @@ void ClangToolsDiagnosticModel::updateItems(const DiagnosticItem *changedItem) void ClangToolsDiagnosticModel::connectFileWatcher() { connect(m_filesWatcher.get(), - &QFileSystemWatcher::fileChanged, + &Utils::FileSystemWatcher::fileChanged, this, &ClangToolsDiagnosticModel::onFileChanged); } void ClangToolsDiagnosticModel::clearAndSetupCache() { - m_filesWatcher = std::make_unique<QFileSystemWatcher>(); + m_filesWatcher = std::make_unique<Utils::FileSystemWatcher>(); connectFileWatcher(); stepsToItemsCache.clear(); } @@ -167,17 +167,17 @@ void ClangToolsDiagnosticModel::onFileChanged(const QString &path) if (item->diagnostic().location.filePath == Utils::FilePath::fromString(path)) item->setFixItStatus(FixitStatus::Invalidated); }); - removeWatchedPath(path); + m_filesWatcher->removeFile(path); } -void ClangToolsDiagnosticModel::removeWatchedPath(const QString &path) +void ClangToolsDiagnosticModel::removeWatchedPath(const Utils::FilePath &path) { - m_filesWatcher->removePath(path); + m_filesWatcher->removeFile(path); } -void ClangToolsDiagnosticModel::addWatchedPath(const QString &path) +void ClangToolsDiagnosticModel::addWatchedPath(const Utils::FilePath &path) { - m_filesWatcher->addPath(path); + m_filesWatcher->addFile(path, Utils::FileSystemWatcher::WatchAllChanges); } static QString lineColumnString(const Debugger::DiagnosticLocation &location) diff --git a/src/plugins/clangtools/clangtoolsdiagnosticmodel.h b/src/plugins/clangtools/clangtoolsdiagnosticmodel.h index 55aa165d347..cf1a08aab16 100644 --- a/src/plugins/clangtools/clangtoolsdiagnosticmodel.h +++ b/src/plugins/clangtools/clangtoolsdiagnosticmodel.h @@ -9,6 +9,7 @@ #include "clangtoolsutils.h" #include <debugger/analyzer/detailederrorview.h> +#include <utils/filesystemwatcher.h> #include <utils/fileutils.h> #include <utils/treemodel.h> @@ -104,8 +105,8 @@ public: QSet<QString> allChecks() const; void clear(); - void removeWatchedPath(const QString &path); - void addWatchedPath(const QString &path); + void removeWatchedPath(const Utils::FilePath &path); + void addWatchedPath(const Utils::FilePath &path); signals: void fixitStatusChanged(const QModelIndex &index, FixitStatus oldStatus, FixitStatus newStatus); @@ -120,7 +121,7 @@ private: QHash<Utils::FilePath, FilePathItem *> m_filePathToItem; QSet<Diagnostic> m_diagnostics; std::map<QVector<ExplainingStep>, QVector<DiagnosticItem *>> stepsToItemsCache; - std::unique_ptr<QFileSystemWatcher> m_filesWatcher; + std::unique_ptr<Utils::FileSystemWatcher> m_filesWatcher; }; class FilterOptions { From e38cd151cf354073f0eafd326a8167590fc87986 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 30 Jun 2023 10:53:08 +0200 Subject: [PATCH 0106/1777] AutoTest: Make scan thread limit customizable Allow users to specify the tread limit used when scanning for tests. By default we continue to use a fourth of the available logical CPUs. Task-number: QTCREATORBUG-29301 Change-Id: Ic92a4d0908093c0664aa1ba924e0c17dfd0082f9 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/autotest/testcodeparser.cpp | 7 ++++++- src/plugins/autotest/testsettings.cpp | 6 ++++++ src/plugins/autotest/testsettings.h | 1 + src/plugins/autotest/testsettingspage.cpp | 3 +++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index e78be579651..ec4a3080cc3 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -5,6 +5,7 @@ #include "autotestconstants.h" #include "autotesttr.h" +#include "testsettings.h" #include "testtreemodel.h" #include <coreplugin/editormanager/editormanager.h> @@ -360,7 +361,11 @@ void TestCodeParser::scanForTests(const QSet<FilePath> &filePaths, using namespace Tasking; - QList<GroupItem> tasks{parallelLimit(std::max(QThread::idealThreadCount() / 4, 1))}; + int limit = TestSettings::instance()->scanThreadLimit(); + if (limit == 0) + limit = std::max(QThread::idealThreadCount() / 4, 1); + qCDebug(LOG) << "Using" << limit << "threads for scan."; + QList<GroupItem> tasks{parallelLimit(limit)}; for (const FilePath &file : filteredFiles) { const auto setup = [this, codeParsers, file](Async<TestParseResultPtr> &async) { async.setConcurrentCallData(parseFileForTests, codeParsers, file); diff --git a/src/plugins/autotest/testsettings.cpp b/src/plugins/autotest/testsettings.cpp index b4507a9d9ab..3c911202f1e 100644 --- a/src/plugins/autotest/testsettings.cpp +++ b/src/plugins/autotest/testsettings.cpp @@ -28,6 +28,12 @@ TestSettings::TestSettings() setSettingsGroup(Constants::SETTINGSGROUP); + scanThreadLimit.setSettingsKey("ScanThreadLimit"); + scanThreadLimit.setDefaultValue(0); + scanThreadLimit.setRange(0, QThread::idealThreadCount()); + scanThreadLimit.setSpecialValueText("Automatic"); + scanThreadLimit.setToolTip(Tr::tr("Number of worker threads used when scanning for tests.")); + timeout.setSettingsKey("Timeout"); timeout.setDefaultValue(defaultTimeout); timeout.setRange(5000, 36'000'000); // 36 Mio ms = 36'000 s = 10 h diff --git a/src/plugins/autotest/testsettings.h b/src/plugins/autotest/testsettings.h index 1e33269bd4f..fbcc4602914 100644 --- a/src/plugins/autotest/testsettings.h +++ b/src/plugins/autotest/testsettings.h @@ -32,6 +32,7 @@ public: void toSettings(QSettings *s) const; void fromSettings(QSettings *s); + Utils::IntegerAspect scanThreadLimit{this}; Utils::IntegerAspect timeout{this}; Utils::BoolAspect omitInternalMsg{this}; Utils::BoolAspect omitRunConfigWarn{this}; diff --git a/src/plugins/autotest/testsettingspage.cpp b/src/plugins/autotest/testsettingspage.cpp index 6c9850bc2ac..407b386052a 100644 --- a/src/plugins/autotest/testsettingspage.cpp +++ b/src/plugins/autotest/testsettingspage.cpp @@ -51,6 +51,8 @@ TestSettingsWidget::TestSettingsWidget() { auto timeoutLabel = new QLabel(Tr::tr("Timeout:")); timeoutLabel->setToolTip(Tr::tr("Timeout used when executing each test case.")); + auto scanThreadLabel = new QLabel(Tr::tr("Scan threads:")); + scanThreadLabel->setToolTip("Number of worker threads used when scanning for tests."); m_frameworkTreeWidget = new QTreeWidget; m_frameworkTreeWidget->setRootIsDecorated(false); @@ -83,6 +85,7 @@ TestSettingsWidget::TestSettingsWidget() Group generalGroup { title(Tr::tr("General")), Column { + Row { scanThreadLabel, s.scanThreadLimit, st }, s.omitInternalMsg, s.omitRunConfigWarn, s.limitResultOutput, From f2aaf68b0c8cea30423de68dbb7cc685e49a1c28 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 28 Jun 2023 17:14:43 +0200 Subject: [PATCH 0107/1777] ProjectExplorer: Use FilePathAspect(s) in ExecutableAspect In the read-only case, make it look like the previously used StringAspect with LabelDisplay. Change-Id: Ica76c1ba23bf9b3946c227e303cc1336f3f8d5b4 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/utils/aspects.cpp | 44 +++++++------------ src/libs/utils/aspects.h | 1 - src/libs/utils/pathchooser.cpp | 3 +- .../baremetal/baremetalrunconfiguration.cpp | 3 +- src/plugins/ios/iosrunconfiguration.cpp | 1 - .../customexecutablerunconfiguration.cpp | 2 +- .../runconfigurationaspects.cpp | 13 ++---- .../projectexplorer/runconfigurationaspects.h | 6 +-- src/plugins/remotelinux/makeinstallstep.cpp | 2 +- .../remotelinuxcustomrunconfiguration.cpp | 2 +- 10 files changed, 30 insertions(+), 47 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 456010c78d8..8571bffe3c3 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -329,6 +329,8 @@ void BaseAspect::setReadOnly(bool readOnly) lineEdit->setReadOnly(readOnly); else if (auto textEdit = qobject_cast<QTextEdit *>(w)) textEdit->setReadOnly(readOnly); + else if (auto pathChooser = qobject_cast<PathChooser *>(w)) + pathChooser->setReadOnly(readOnly); } } @@ -806,28 +808,6 @@ QString StringAspect::value() const return TypedAspect::value(); } -/*! - Sets the value, \a val, of this StringAspect from an ordinary \c QString. -*/ -void StringAspect::setValue(const QString &val) -{ - const bool isSame = val == value(); - if (isSame) - return; - - QString processedValue = val; - if (d->m_valueAcceptor) { - const std::optional<QString> tmp = d->m_valueAcceptor(value(), val); - if (!tmp) { - internalToGui(); // Make sure the original value is retained in the UI - return; - } - processedValue = tmp.value(); - } - - TypedAspect::setValue(processedValue); -} - /*! \reimp */ @@ -1124,6 +1104,7 @@ void StringAspect::addToLayout(LayoutItem &parent) d->m_pathChooserDisplay->setPromptDialogTitle(d->m_prompDialogTitle); d->m_pathChooserDisplay->setCommandVersionArguments(d->m_commandVersionArguments); d->m_pathChooserDisplay->setAllowPathFromDevice(d->m_allowPathFromDevice); + d->m_pathChooserDisplay->setReadOnly(isReadOnly()); d->m_pathChooserDisplay->lineEdit()->setValidatePlaceHolder(d->m_validatePlaceHolder); if (defaultValue() == value()) d->m_pathChooserDisplay->setDefaultValue(defaultValue()); @@ -1141,7 +1122,7 @@ void StringAspect::addToLayout(LayoutItem &parent) if (d->m_blockAutoApply) return; d->m_blockAutoApply = true; - setValueQuietly(d->m_pathChooserDisplay->filePath().toString()); + setValue(d->m_pathChooserDisplay->filePath().toString()); d->m_blockAutoApply = false; }; connect(d->m_pathChooserDisplay, &PathChooser::editingFinished, this, setPathChooserValue); @@ -1149,7 +1130,7 @@ void StringAspect::addToLayout(LayoutItem &parent) } else { connect(d->m_pathChooserDisplay, &PathChooser::textChanged, this, [this](const QString &path) { - setValueQuietly(path); + setValue(path); }); } } @@ -1234,21 +1215,30 @@ void StringAspect::addToLayout(LayoutItem &parent) void StringAspect::guiToInternal() { + QString val; switch (d->m_displayStyle) { case PathChooserDisplay: if (d->m_pathChooserDisplay) - m_internal = d->m_pathChooserDisplay->lineEdit()->text(); + val = d->m_pathChooserDisplay->lineEdit()->text(); break; case LineEditDisplay: if (d->m_lineEditDisplay) - m_internal = d->m_lineEditDisplay->text(); + val = d->m_lineEditDisplay->text(); break; case TextEditDisplay: if (d->m_textEditDisplay) - m_internal = d->m_textEditDisplay->document()->toPlainText(); + val = d->m_textEditDisplay->document()->toPlainText(); case LabelDisplay: break; } + + if (d->m_valueAcceptor) { + const std::optional<QString> tmp = d->m_valueAcceptor(m_internal, val); + if (tmp) + m_internal = *tmp; + } else { + m_internal = val; + } } void StringAspect::internalToGui() diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index eafceeddb32..8d9307e6685 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -456,7 +456,6 @@ public: void setValueAcceptor(ValueAcceptor &&acceptor); QString value() const; - void setValue(const QString &val); void setShowToolTipOnLabel(bool show); diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index a13471ef07f..c3054ec3cac 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -377,9 +377,10 @@ bool PathChooser::isReadOnly() const void PathChooser::setReadOnly(bool b) { d->m_lineEdit->setReadOnly(b); + d->m_lineEdit->setFrame(!b); const auto buttons = d->m_buttons; for (QAbstractButton *button : buttons) - button->setEnabled(!b); + button->setVisible(!b); } void PathChooser::slotBrowse(bool remote) diff --git a/src/plugins/baremetal/baremetalrunconfiguration.cpp b/src/plugins/baremetal/baremetalrunconfiguration.cpp index 4fe6b090246..bc880467903 100644 --- a/src/plugins/baremetal/baremetalrunconfiguration.cpp +++ b/src/plugins/baremetal/baremetalrunconfiguration.cpp @@ -26,7 +26,6 @@ public: : RunConfiguration(target, id) { const auto exeAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); - exeAspect->setDisplayStyle(StringAspect::LabelDisplay); exeAspect->setPlaceHolderText(Tr::tr("Unknown")); addAspect<ArgumentsAspect>(macroExpander()); @@ -50,7 +49,7 @@ public: const auto exeAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); exeAspect->setSettingsKey("BareMetal.CustomRunConfig.Executable"); exeAspect->setPlaceHolderText(Tr::tr("Unknown")); - exeAspect->setDisplayStyle(StringAspect::PathChooserDisplay); + exeAspect->setReadOnly(false); exeAspect->setHistoryCompleter("BareMetal.CustomRunConfig.History"); exeAspect->setExpectedKind(PathChooser::Any); diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index 8a0a3e62dcf..d10ddbe4d80 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -59,7 +59,6 @@ IosRunConfiguration::IosRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { auto executableAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); - executableAspect->setDisplayStyle(StringAspect::LabelDisplay); addAspect<ArgumentsAspect>(macroExpander()); diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index 00f7225d0df..1673c874d53 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -28,7 +28,7 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *targe auto exeAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::HostDevice); exeAspect->setSettingsKey("ProjectExplorer.CustomExecutableRunConfiguration.Executable"); - exeAspect->setDisplayStyle(StringAspect::PathChooserDisplay); + exeAspect->setReadOnly(false); exeAspect->setHistoryCompleter("Qt.CustomExecutable.History"); exeAspect->setExpectedKind(PathChooser::ExistingCommand); exeAspect->setEnvironment(envAspect->environment()); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 52b594d0a14..5d44872439e 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -500,11 +500,11 @@ ExecutableAspect::ExecutableAspect(Target *target, ExecutionDeviceSelector selec { setDisplayName(Tr::tr("Executable")); setId("ExecutableAspect"); + setReadOnly(true); addDataExtractor(this, &ExecutableAspect::executable, &Data::executable); m_executable.setPlaceHolderText(Tr::tr("Enter the path to the executable")); m_executable.setLabelText(Tr::tr("Executable:")); - m_executable.setDisplayStyle(StringAspect::LabelDisplay); updateDevice(); @@ -579,14 +579,9 @@ void ExecutableAspect::setEnvironment(const Environment &env) m_alternativeExecutable->setEnvironment(env); } -/*! - Sets the display \a style for aspect. - - \sa Utils::StringAspect::setDisplayStyle() -*/ -void ExecutableAspect::setDisplayStyle(StringAspect::DisplayStyle style) +void ExecutableAspect::setReadOnly(bool readOnly) { - m_executable.setDisplayStyle(style); + m_executable.setReadOnly(readOnly); } /*! @@ -601,7 +596,7 @@ void ExecutableAspect::setDisplayStyle(StringAspect::DisplayStyle style) void ExecutableAspect::makeOverridable(const QString &overridingKey, const QString &useOverridableKey) { QTC_ASSERT(!m_alternativeExecutable, return); - m_alternativeExecutable = new StringAspect; + m_alternativeExecutable = new FilePathAspect; m_alternativeExecutable->setDisplayStyle(StringAspect::LineEditDisplay); m_alternativeExecutable->setLabelText(Tr::tr("Alternate executable on device:")); m_alternativeExecutable->setSettingsKey(overridingKey); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index 9fc7364772d..f7e3e4c4211 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -169,7 +169,7 @@ public: void setHistoryCompleter(const QString &historyCompleterKey); void setExpectedKind(const Utils::PathChooser::Kind expectedKind); void setEnvironment(const Utils::Environment &env); - void setDisplayStyle(Utils::StringAspect::DisplayStyle style); + void setReadOnly(bool readOnly); struct Data : BaseAspect::Data { @@ -184,8 +184,8 @@ private: QString executableText() const; void updateDevice(); - Utils::StringAspect m_executable; - Utils::StringAspect *m_alternativeExecutable = nullptr; + Utils::FilePathAspect m_executable; + Utils::FilePathAspect *m_alternativeExecutable = nullptr; Target *m_target = nullptr; ExecutionDeviceSelector m_selector = RunDevice; }; diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index a93fccba41b..13465b57254 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -65,7 +65,7 @@ MakeInstallStep::MakeInstallStep(BuildStepList *parent, Id id) : MakeStep(parent ExecutableAspect::BuildDevice); makeAspect->setId(MakeAspectId); makeAspect->setSettingsKey(MakeAspectId); - makeAspect->setDisplayStyle(StringAspect::PathChooserDisplay); + makeAspect->setReadOnly(false); makeAspect->setLabelText(Tr::tr("Command:")); connect(makeAspect, &ExecutableAspect::changed, this, &MakeInstallStep::updateCommandFromAspect); diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp index 9b99d66923b..f431cdf2d3b 100644 --- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp @@ -37,7 +37,7 @@ RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *tar auto exeAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); exeAspect->setSettingsKey("RemoteLinux.CustomRunConfig.RemoteExecutable"); exeAspect->setLabelText(Tr::tr("Remote executable:")); - exeAspect->setDisplayStyle(StringAspect::LineEditDisplay); + exeAspect->setReadOnly(false); exeAspect->setHistoryCompleter("RemoteLinux.CustomExecutable.History"); exeAspect->setExpectedKind(PathChooser::Any); From 1e6eb1ba282b233d39677287bf831d65a1e4196f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 3 Jul 2023 17:09:00 +0200 Subject: [PATCH 0108/1777] RemoteLinux: Un-publish MakeInstallStep ... and move definition into .cpp. It is by now only needed there, and we don't want to encourge re-using bits and pieces of step implementation by inheritance. Change-Id: I12899c5e6a6c94cc9cfb23a2756621a4213f5dae Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/remotelinux/makeinstallstep.cpp | 30 ++++++++++++++++++-- src/plugins/remotelinux/makeinstallstep.h | 31 +-------------------- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 13465b57254..56c22d4ff80 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -12,6 +12,7 @@ #include <projectexplorer/deployconfiguration.h> #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/kitinformation.h> +#include <projectexplorer/makestep.h> #include <projectexplorer/processparameters.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runconfigurationaspects.h> @@ -23,8 +24,6 @@ #include <utils/process.h> #include <utils/qtcassert.h> -#include <QDirIterator> -#include <QFileInfo> #include <QSet> #include <QTemporaryDir> @@ -39,6 +38,33 @@ const char CleanInstallRootAspectId[] = "RemoteLinux.MakeInstall.CleanInstallRoo const char FullCommandLineAspectId[] = "RemoteLinux.MakeInstall.FullCommandLine"; const char CustomCommandLineAspectId[] = "RemoteLinux.MakeInstall.CustomCommandLine"; +class MakeInstallStep : public MakeStep +{ +public: + MakeInstallStep(BuildStepList *parent, Id id); + +private: + bool fromMap(const QVariantMap &map) override; + QWidget *createConfigWidget() override; + bool init() override; + void finish(ProcessResult result) override; + bool isJobCountSupported() const override { return false; } + + FilePath installRoot() const; + bool cleanInstallRoot() const; + + void updateCommandFromAspect(); + void updateArgsFromAspect(); + void updateFullCommandLine(); + void updateFromCustomCommandLineAspect(); + + StringAspect *customCommandLineAspect() const; + + DeploymentData m_deploymentData; + bool m_noInstallTarget = false; + bool m_isCmakeProject = false; +}; + MakeInstallStep::MakeInstallStep(BuildStepList *parent, Id id) : MakeStep(parent, id) { m_makeCommandAspect.setVisible(false); diff --git a/src/plugins/remotelinux/makeinstallstep.h b/src/plugins/remotelinux/makeinstallstep.h index 3be2d5df979..564a262abcd 100644 --- a/src/plugins/remotelinux/makeinstallstep.h +++ b/src/plugins/remotelinux/makeinstallstep.h @@ -5,39 +5,10 @@ #include "remotelinux_export.h" -#include <projectexplorer/deploymentdata.h> -#include <projectexplorer/makestep.h> +#include <projectexplorer/buildstep.h> namespace RemoteLinux { -class REMOTELINUX_EXPORT MakeInstallStep : public ProjectExplorer::MakeStep -{ - Q_OBJECT -public: - MakeInstallStep(ProjectExplorer::BuildStepList *parent, Utils::Id id); - -private: - bool fromMap(const QVariantMap &map) override; - QWidget *createConfigWidget() override; - bool init() override; - void finish(Utils::ProcessResult result) override; - bool isJobCountSupported() const override { return false; } - - Utils::FilePath installRoot() const; - bool cleanInstallRoot() const; - - void updateCommandFromAspect(); - void updateArgsFromAspect(); - void updateFullCommandLine(); - void updateFromCustomCommandLineAspect(); - - Utils::StringAspect *customCommandLineAspect() const; - - ProjectExplorer::DeploymentData m_deploymentData; - bool m_noInstallTarget = false; - bool m_isCmakeProject = false; -}; - class REMOTELINUX_EXPORT MakeInstallStepFactory : public ProjectExplorer::BuildStepFactory { From b721d9847664971a14995c280d08577cb3c0cb86 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 30 Jun 2023 10:37:53 +0200 Subject: [PATCH 0109/1777] Editor: optimize annotation cache cleanup Looking up the last visible block is not for free since it calculates the bounding rects for all blocks between the first and last visible block. Avoid one calculation by postponing the annotation cleanup after the paint event and only if we reach a certain amount of cached entries. Change-Id: Ibfab49301f82237e16d5a69ce1531539907e7ed8 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/texteditor/texteditor.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index e6160b3e547..ac0d3ebee42 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -449,6 +449,7 @@ struct PaintEventData , textCursorBlock(textCursor.block()) , isEditable(!editor->isReadOnly()) , fontSettings(editor->textDocument()->fontSettings()) + , lineSpacing(fontSettings.lineSpacing()) , searchScopeFormat(fontSettings.toTextCharFormat(C_SEARCH_SCOPE)) , searchResultFormat(fontSettings.toTextCharFormat(C_SEARCH_RESULT)) , visualWhitespaceFormat(fontSettings.toTextCharFormat(C_VISUAL_WHITESPACE)) @@ -469,6 +470,7 @@ struct PaintEventData const QTextBlock textCursorBlock; const bool isEditable; const FontSettings fontSettings; + const int lineSpacing; const QTextCharFormat searchScopeFormat; const QTextCharFormat searchResultFormat; const QTextCharFormat visualWhitespaceFormat; @@ -561,6 +563,7 @@ public: QPainter &painter, const PaintEventBlockData &blockData) const; QTextBlock nextVisibleBlock(const QTextBlock &block) const; + void scheduleCleanupAnnotationCache(); void cleanupAnnotationCache(); // extra area paint methods @@ -706,6 +709,7 @@ public: friend bool operator==(const AnnotationRect &a, const AnnotationRect &b) { return a.mark == b.mark && a.rect == b.rect; } }; + bool cleanupAnnotationRectsScheduled = false; QMap<int, QList<AnnotationRect>> m_annotationRects; QRectF getLastLineLineRect(const QTextBlock &block); @@ -4225,6 +4229,9 @@ void TextEditorWidgetPrivate::updateLineAnnotation(const PaintEventData &data, q->viewport()->update(annotationRect.rect.toAlignedRect()); } m_annotationRects[data.block.blockNumber()] = newRects; + const int maxVisibleLines = data.viewportRect.height() / data.lineSpacing; + if (m_annotationRects.size() >= maxVisibleLines * 2) + scheduleCleanupAnnotationCache(); } QColor blendRightMarginColor(const FontSettings &settings, bool areaColor) @@ -4892,8 +4899,19 @@ QTextBlock TextEditorWidgetPrivate::nextVisibleBlock(const QTextBlock &block) co return TextEditor::nextVisibleBlock(block, q->document()); } +void TextEditorWidgetPrivate::scheduleCleanupAnnotationCache() +{ + if (cleanupAnnotationRectsScheduled) + return; + QMetaObject::invokeMethod(this, + &TextEditorWidgetPrivate::cleanupAnnotationCache, + Qt::QueuedConnection); + cleanupAnnotationRectsScheduled = true; +} + void TextEditorWidgetPrivate::cleanupAnnotationCache() { + cleanupAnnotationRectsScheduled = false; const int firstVisibleBlock = q->firstVisibleBlockNumber(); const int lastVisibleBlock = q->lastVisibleBlockNumber(); auto lineIsVisble = [&](int blockNumber){ @@ -5015,8 +5033,6 @@ void TextEditorWidget::paintEvent(QPaintEvent *e) } } - d->cleanupAnnotationCache(); - painter.setPen(data.context.palette.text().color()); d->updateAnimator(d->m_bracketsAnimator, painter); From 1d1eb9c3a219223d44a93d4cf71f4a6cd0af8cbb Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 4 Jul 2023 08:29:37 +0200 Subject: [PATCH 0110/1777] Templates: Use C++17 compact namespaces in the plugin template Change-Id: If4c8540e4d1d9b42efcd1c039c28f85bd0fb98fd Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../templates/wizards/qtcreatorplugin/myplugin.cpp | 6 ++---- .../qtcreator/templates/wizards/qtcreatorplugin/myplugin.h | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp index 47ab9ebcc50..ae3082c357d 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp @@ -13,8 +13,7 @@ #include <QMainWindow> #include <QMenu> -namespace %{PluginName} { -namespace Internal { +namespace %{PluginName}::Internal { %{CN}::%{CN}() { @@ -75,5 +74,4 @@ void %{CN}::triggerAction() tr("This is an action from %{PluginName}.")); } -} // namespace Internal -} // namespace %{PluginName} +} // namespace %{PluginName}::Internal diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h index 3851fa7c657..6644f4685fd 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h @@ -9,8 +9,7 @@ #include <extensionsystem/iplugin.h> -namespace %{PluginName} { -namespace Internal { +namespace %{PluginName}::Internal { class %{CN} : public ExtensionSystem::IPlugin { @@ -29,8 +28,7 @@ private: void triggerAction(); }; -} // namespace Internal -} // namespace %{PluginName} +} // namespace %{PluginName}::Internal @if ! '%{Cpp:PragmaOnce}' #endif // %{GUARD} From 418482b3e299840254c8d028597387a2fe4c7aac Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 4 Jul 2023 08:18:23 +0200 Subject: [PATCH 0111/1777] FakeVim: Assume UTF-8 for source also on Windows by default ... but make it configurable. Fixes: QTCREATORBUG-29320 Change-Id: Ib377c78e51afb7d06167c66306250a281aa9279c Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/fakevim/fakevimactions.cpp | 4 +++- src/plugins/fakevim/fakevimactions.h | 1 + src/plugins/fakevim/fakevimhandler.cpp | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/fakevim/fakevimactions.cpp b/src/plugins/fakevim/fakevimactions.cpp index de1f06f9133..a6dc84b9b27 100644 --- a/src/plugins/fakevim/fakevimactions.cpp +++ b/src/plugins/fakevim/fakevimactions.cpp @@ -94,6 +94,7 @@ FakeVimSettings::FakeVimSettings() setup(&showCmd, true, "ShowCmd", "sc", Tr::tr("Show partial command")); setup(&relativeNumber, false, "RelativeNumber", "rnu", Tr::tr("Show line numbers relative to cursor")); setup(&blinkingCursor, false, "BlinkingCursor", "bc", Tr::tr("Blinking cursor")); + setup(&systemEncoding, false, "SystemEncoding", {}, Tr::tr("Use system encoding for :source")); setup(&scrollOff, 0, "ScrollOff", "so", Tr::tr("Scroll offset:")); setup(&backspace, "indent,eol,start", "Backspace", "bs", Tr::tr("Backspace:")); @@ -149,7 +150,8 @@ FakeVimSettings::FakeVimSettings() showCmd, startOfLine, passKeys, - blinkingCursor + blinkingCursor, + HostOsInfo::isWindowsHost() ? LayoutItem(systemEncoding) : empty }, Column { incSearch, diff --git a/src/plugins/fakevim/fakevimactions.h b/src/plugins/fakevim/fakevimactions.h index eea53f50c1a..94ba02a7f3a 100644 --- a/src/plugins/fakevim/fakevimactions.h +++ b/src/plugins/fakevim/fakevimactions.h @@ -151,6 +151,7 @@ public: FvBoolAspect emulateSurround; FvBoolAspect blinkingCursor; + FvBoolAspect systemEncoding; private: void setup(FvBaseAspect *aspect, const QVariant &value, diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index bb3586b6329..8a9adac4415 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -6625,7 +6625,8 @@ bool FakeVimHandler::Private::handleExSourceCommand(const ExCommand &cmd) } else if (!line.isEmpty() && !inFunction) { //qDebug() << "EXECUTING: " << line; ExCommand cmd; - QString commandLine = QString::fromLocal8Bit(line); + QString commandLine = s.systemEncoding() ? QString::fromLocal8Bit(line) + : QString::fromUtf8(line); while (parseExCommand(&commandLine, &cmd)) { if (!handleExCommandHelper(cmd)) break; From c1f6d7044589f7842d19fc7b44574152ce72a20f Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 3 Jul 2023 14:27:45 +0200 Subject: [PATCH 0112/1777] RunControl: Remove initiateFinish() / finished() The only difference between initiateFinish() and initiateStop() is that the initiateFinish() deletes the RunControl automatically after the final state was reached. Add setAutoDeleteOnStop() property and reuse initiateStop() and stopped() instead. Change-Id: I8e842978831b19587a8658b4443c96a04eb7a6df Reviewed-by: hjk <hjk@qt.io> --- src/plugins/autotest/testrunner.cpp | 2 - src/plugins/autotest/testrunner.h | 1 - src/plugins/debugger/debuggerruncontrol.cpp | 19 +++-- .../perfprofiler/perfprofilerruncontrol.cpp | 2 - src/plugins/projectexplorer/appoutputpane.cpp | 12 ++- src/plugins/projectexplorer/runcontrol.cpp | 74 ++++++------------- src/plugins/projectexplorer/runcontrol.h | 4 +- src/plugins/qmlprofiler/qmlprofilertool.cpp | 10 +-- .../tests/localqmlprofilerrunner_test.cpp | 16 ++-- 9 files changed, 56 insertions(+), 84 deletions(-) diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index d355317b5eb..d3b62afcbfb 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -589,7 +589,6 @@ void TestRunner::debugTests() runControl, &RunControl::initiateStop); connect(runControl, &RunControl::stopped, this, &TestRunner::onFinished); - m_finishDebugConnect = connect(runControl, &RunControl::finished, this, &TestRunner::onFinished); ProjectExplorerPlugin::startRunControl(runControl); if (useOutputProcessor && TestSettings::instance()->popupOnStart()) AutotestPlugin::popupResultsPane(); @@ -705,7 +704,6 @@ void TestRunner::onFinished() if (m_taskTree) m_taskTree.release()->deleteLater(); disconnect(m_stopDebugConnect); - disconnect(m_finishDebugConnect); disconnect(m_targetConnect); qDeleteAll(m_selectedTests); m_selectedTests.clear(); diff --git a/src/plugins/autotest/testrunner.h b/src/plugins/autotest/testrunner.h index 25c65f89851..8d0aac6d811 100644 --- a/src/plugins/autotest/testrunner.h +++ b/src/plugins/autotest/testrunner.h @@ -79,7 +79,6 @@ private: QMetaObject::Connection m_buildConnect; // temporarily used when debugging QMetaObject::Connection m_stopDebugConnect; - QMetaObject::Connection m_finishDebugConnect; // temporarily used for handling of switching the current target QMetaObject::Connection m_targetConnect; QTimer m_cancelTimer; diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index dc97966aa90..498f54d37dc 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -545,10 +545,12 @@ void DebuggerRunTool::start() m_engine->setRunId(d->runId); m_engine->setRunTool(this); m_engine->setCompanionEngine(m_engine2); - connect(m_engine, &DebuggerEngine::requestRunControlFinish, - runControl(), &RunControl::initiateFinish); - connect(m_engine, &DebuggerEngine::requestRunControlStop, - runControl(), &RunControl::initiateStop); + auto rc = runControl(); + connect(m_engine, &DebuggerEngine::requestRunControlFinish, rc, [rc] { + rc->setAutoDeleteOnStop(true); + rc->initiateStop(); + }, Qt::QueuedConnection); + connect(m_engine, &DebuggerEngine::requestRunControlStop, rc, &RunControl::initiateStop); connect(m_engine, &DebuggerEngine::engineStarted, this, [this] { handleEngineStarted(m_engine); }); connect(m_engine, &DebuggerEngine::engineFinished, @@ -575,10 +577,11 @@ void DebuggerRunTool::start() m_engine2->setRunTool(this); m_engine2->setCompanionEngine(m_engine); m_engine2->setSecondaryEngine(); - connect(m_engine2, &DebuggerEngine::requestRunControlFinish, - runControl(), &RunControl::initiateFinish); - connect(m_engine2, &DebuggerEngine::requestRunControlStop, - runControl(), &RunControl::initiateStop); + connect(m_engine2, &DebuggerEngine::requestRunControlFinish, rc, [rc] { + rc->setAutoDeleteOnStop(true); + rc->initiateStop(); + }, Qt::QueuedConnection); + connect(m_engine2, &DebuggerEngine::requestRunControlStop, rc, &RunControl::initiateStop); connect(m_engine2, &DebuggerEngine::engineStarted, this, [this] { handleEngineStarted(m_engine2); }); connect(m_engine2, &DebuggerEngine::engineFinished, diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp index 3d633160133..4368c713933 100644 --- a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp +++ b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp @@ -185,8 +185,6 @@ void PerfProfilerRunner::start() &PerfProfilerTool::onRunControlStarted); connect(runControl(), &RunControl::stopped, PerfProfilerTool::instance(), &PerfProfilerTool::onRunControlFinished); - connect(runControl(), &RunControl::finished, PerfProfilerTool::instance(), - &PerfProfilerTool::onRunControlFinished); PerfDataReader *reader = m_perfParserWorker->reader(); if (auto prw = qobject_cast<LocalPerfRecordWorker *>(m_perfRecordWorker)) { diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index b8ce9417e70..099430b94a6 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -406,8 +406,10 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) }); if (tab != m_runControlTabs.end()) { // Reuse this tab - if (tab->runControl) - tab->runControl->initiateFinish(); + if (tab->runControl) { + tab->runControl->setAutoDeleteOnStop(true); + tab->runControl->initiateStop(); + } tab->runControl = rc; tab->window->reset(); rc->setupFormatter(tab->window->outputFormatter()); @@ -642,8 +644,10 @@ void AppOutputPane::closeTab(int tabIndex, CloseTabMode closeTabMode) m_tabWidget->removeTab(tabIndex); delete window; - if (runControl) - runControl->initiateFinish(); // Will self-destruct. + if (runControl) { + runControl->setAutoDeleteOnStop(true); + runControl->initiateStop(); + } Utils::erase(m_runControlTabs, [tab](const RunControlTab &t) { return t.runControl == tab->runControl; }); updateCloseActions(); diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 31294f47f1c..e89587a660d 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -211,9 +211,7 @@ enum class RunControlState Starting, // Actual process/tool starts. Running, // All good and running. Stopping, // initiateStop() was called, stop application/tool - Stopped, // all good, but stopped. Can possibly be re-started - Finishing, // Application tab manually closed - Finished // Final state, will self-destruct with deleteLater() + Stopped // all good, but stopped. Can possibly be re-started }; static QString stateName(RunControlState s) @@ -225,8 +223,6 @@ static QString stateName(RunControlState s) SN(RunControlState::Running) SN(RunControlState::Stopping) SN(RunControlState::Stopped) - SN(RunControlState::Finishing) - SN(RunControlState::Finished) } return QString("<unknown: %1>").arg(int(s)); # undef SN @@ -259,6 +255,7 @@ public: QList<QPointer<RunWorker>> m_workers; RunControlState state = RunControlState::Initialized; bool printEnvironment = false; + bool autoDelete = false; }; class RunControlPrivate : public QObject, public RunControlPrivateData @@ -274,7 +271,7 @@ public: ~RunControlPrivate() override { - QTC_CHECK(state == RunControlState::Finished || state == RunControlState::Initialized); + QTC_CHECK(state == RunControlState::Stopped || state == RunControlState::Initialized); disconnect(); q = nullptr; qDeleteAll(m_workers); @@ -407,6 +404,11 @@ RunControl::~RunControl() #endif } +void RunControl::setAutoDeleteOnStop(bool autoDelete) +{ + d->autoDelete = autoDelete; +} + void RunControl::initiateStart() { emit aboutToStart(); @@ -429,11 +431,6 @@ void RunControl::forceStop() d->forceStop(); } -void RunControl::initiateFinish() -{ - QTimer::singleShot(0, d.get(), &RunControlPrivate::initiateFinish); -} - RunWorker *RunControl::createWorker(Id workerId) { const Id deviceType = DeviceTypeKitAspect::deviceTypeId(d->kit); @@ -542,7 +539,7 @@ void RunControlPrivate::continueStart() void RunControlPrivate::initiateStop() { - if (state != RunControlState::Starting && state != RunControlState::Running) + if (state == RunControlState::Initialized) qDebug() << "Unexpected initiateStop() in state" << stateName(state); setState(RunControlState::Stopping); @@ -596,12 +593,8 @@ void RunControlPrivate::continueStopOrFinish() } RunControlState targetState; - if (state == RunControlState::Finishing) { - targetState = RunControlState::Finished; - } else { - checkState(RunControlState::Stopping); + if (state == RunControlState::Stopping) targetState = RunControlState::Stopped; - } if (allDone) { debugMessage("All Stopped"); @@ -613,7 +606,7 @@ void RunControlPrivate::continueStopOrFinish() void RunControlPrivate::forceStop() { - if (state == RunControlState::Finished) { + if (state == RunControlState::Stopped) { debugMessage("Was finished, too late to force Stop"); return; } @@ -648,14 +641,6 @@ void RunControlPrivate::forceStop() debugMessage("All Stopped"); } -void RunControlPrivate::initiateFinish() -{ - setState(RunControlState::Finishing); - debugMessage("Ramping down"); - - continueStopOrFinish(); -} - void RunControlPrivate::onWorkerStarted(RunWorker *worker) { worker->d->state = RunWorkerState::Running; @@ -688,11 +673,9 @@ void RunControlPrivate::onWorkerFailed(RunWorker *worker, const QString &msg) initiateStop(); break; case RunControlState::Stopping: - case RunControlState::Finishing: continueStopOrFinish(); break; case RunControlState::Stopped: - case RunControlState::Finished: QTC_CHECK(false); // Should not happen. continueStopOrFinish(); break; @@ -723,7 +706,7 @@ void RunControlPrivate::onWorkerStopped(RunWorker *worker) break; } - if (state == RunControlState::Finishing || state == RunControlState::Stopping) { + if (state == RunControlState::Stopping) { continueStopOrFinish(); return; } else if (worker->isEssential()) { @@ -1078,26 +1061,15 @@ bool RunControlPrivate::isAllowedTransition(RunControlState from, RunControlStat { switch (from) { case RunControlState::Initialized: - return to == RunControlState::Starting - || to == RunControlState::Finishing; + return to == RunControlState::Starting; case RunControlState::Starting: - return to == RunControlState::Running - || to == RunControlState::Stopping - || to == RunControlState::Finishing; + return to == RunControlState::Running || to == RunControlState::Stopping; case RunControlState::Running: - return to == RunControlState::Stopping - || to == RunControlState::Stopped - || to == RunControlState::Finishing; + return to == RunControlState::Stopping || to == RunControlState::Stopped; case RunControlState::Stopping: - return to == RunControlState::Stopped - || to == RunControlState::Finishing; + return to == RunControlState::Stopped; case RunControlState::Stopped: - return to == RunControlState::Starting - || to == RunControlState::Finishing; - case RunControlState::Finishing: - return to == RunControlState::Finished; - case RunControlState::Finished: - return false; + return to != RunControlState::Initialized; } return false; } @@ -1125,14 +1097,14 @@ void RunControlPrivate::setState(RunControlState newState) emit q->started(); break; case RunControlState::Stopped: - q->setApplicationProcessHandle(Utils::ProcessHandle()); + if (autoDelete) { + debugMessage("All finished. Deleting myself"); + q->deleteLater(); + } else { + q->setApplicationProcessHandle(Utils::ProcessHandle()); + } emit q->stopped(); break; - case RunControlState::Finished: - emit q->finished(); - debugMessage("All finished. Deleting myself"); - q->deleteLater(); - break; default: break; } diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index 799ec538dd3..5955e778710 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -156,11 +156,12 @@ public: void copyDataFromRunConfiguration(RunConfiguration *runConfig); void copyDataFromRunControl(RunControl *runControl); + void setAutoDeleteOnStop(bool autoDelete); + void initiateStart(); void initiateReStart(); void initiateStop(); void forceStop(); - void initiateFinish(); bool promptToStop(bool *optionalPrompt = nullptr) const; void setPromptToStop(const std::function<bool(bool *)> &promptToStop); @@ -237,7 +238,6 @@ signals: void aboutToStart(); void started(); void stopped(); - void finished(); void applicationProcessHandleChanged(QPrivateSignal); // Use setApplicationProcessHandle private: diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 42826cd13fd..4d67d7a1fd6 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -297,7 +297,10 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker) } } - auto handleStop = [this, runControl]() { + auto handleStop = [this, runControl] { + if (!d->m_toolBusy) + return; + d->m_toolBusy = false; updateRunActions(); disconnect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::initiateStop); @@ -311,11 +314,6 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker) }; connect(runControl, &RunControl::stopped, this, handleStop); - connect(runControl, &RunControl::finished, this, [this, handleStop] { - if (d->m_toolBusy) - handleStop(); - }); - connect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::initiateStop); updateRunActions(); diff --git a/src/plugins/qmlprofiler/tests/localqmlprofilerrunner_test.cpp b/src/plugins/qmlprofiler/tests/localqmlprofilerrunner_test.cpp index 406b8dd4191..33c0eb7388d 100644 --- a/src/plugins/qmlprofiler/tests/localqmlprofilerrunner_test.cpp +++ b/src/plugins/qmlprofiler/tests/localqmlprofilerrunner_test.cpp @@ -66,10 +66,6 @@ void LocalQmlProfilerRunnerTest::testRunner() running = false; started = false; }); - connect(runControl, &RunControl::finished, this, [&]{ - running = false; - started = false; - }); }; connectRunner(); @@ -84,7 +80,8 @@ void LocalQmlProfilerRunnerTest::testRunner() QCOMPARE(stopCount, 1); QCOMPARE(runCount, 0); - runControl->initiateFinish(); + runControl->setAutoDeleteOnStop(true); + runControl->initiateStop(); QTRY_VERIFY(runControl.isNull()); QVERIFY(profiler.isNull()); @@ -104,7 +101,8 @@ void LocalQmlProfilerRunnerTest::testRunner() QCOMPARE(stopCount, 2); QCOMPARE(runCount, 1); - runControl->initiateFinish(); + runControl->setAutoDeleteOnStop(true); + runControl->initiateStop(); QTRY_VERIFY(runControl.isNull()); QVERIFY(profiler.isNull()); @@ -123,7 +121,8 @@ void LocalQmlProfilerRunnerTest::testRunner() QCOMPARE(stopCount, 3); QCOMPARE(runCount, 2); - runControl->initiateFinish(); + runControl->setAutoDeleteOnStop(true); + runControl->initiateStop(); QTRY_VERIFY(runControl.isNull()); QVERIFY(profiler.isNull()); @@ -146,7 +145,8 @@ void LocalQmlProfilerRunnerTest::testRunner() QCOMPARE(stopCount, 4); QCOMPARE(runCount, 3); - runControl->initiateFinish(); + runControl->setAutoDeleteOnStop(true); + runControl->initiateStop(); QTRY_VERIFY(runControl.isNull()); QVERIFY(profiler.isNull()); } From 3f61223c0fee176bda8cde71c2eb754516afa5bd Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 3 Jul 2023 12:27:26 +0200 Subject: [PATCH 0113/1777] CppEditor: Adapt some test data ... so that the tests pass with both the built-in indenter and ClangFormat. Change-Id: I0f870c507dabd80ccfc35f1d3021b2ddabe422d2 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/cppeditor/cppquickfix_test.cpp | 120 ++++++++++----------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 369e07a1348..f6a5b2b7acc 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -2746,15 +2746,15 @@ void QuickfixTest::testGenerateGetterSetterCustomTemplate() const _ customTypeDecl = R"--( namespace N1 { - namespace N2 { - struct test{}; - } - template<typename T> - struct custom { - void assign(const custom<T>&); - bool equals(const custom<T>&); - T* get(); - }; +namespace N2 { +struct test{}; +} +template<typename T> +struct custom { + void assign(const custom<T>&); + bool equals(const custom<T>&); + T* get(); +}; )--"; // Header File original = customTypeDecl + R"--( @@ -5210,77 +5210,77 @@ void QuickfixTest::testInsertDefsFromDecls_data() QTest::addColumn<int>("mode"); QByteArray origHeader = R"( - namespace N { - class @C - { - public: - friend void ignoredFriend(); - void ignoredImplemented() {}; - void ignoredImplemented2(); // Below - void ignoredImplemented3(); // In cpp file - void funcNotSelected(); - void funcInline(); - void funcBelow(); - void funcCppFile(); +namespace N { +class @C +{ +public: + friend void ignoredFriend(); + void ignoredImplemented() {}; + void ignoredImplemented2(); // Below + void ignoredImplemented3(); // In cpp file + void funcNotSelected(); + void funcInline(); + void funcBelow(); + void funcCppFile(); - signals: - void ignoredSignal(); - }; +signals: + void ignoredSignal(); +}; - inline void C::ignoredImplemented2() {} +inline void C::ignoredImplemented2() {} - } // namespace N)"; +} // namespace N)"; QByteArray origSource = R"( - #include "file.h" +#include "file.h" - namespace N { +namespace N { - void C::ignoredImplemented3() {} +void C::ignoredImplemented3() {} - } // namespace N)"; +} // namespace N)"; QByteArray expectedHeader = R"( - namespace N { - class C - { - public: - friend void ignoredFriend(); - void ignoredImplemented() {}; - void ignoredImplemented2(); // Below - void ignoredImplemented3(); // In cpp file - void funcNotSelected(); - void funcInline() - { +namespace N { +class C +{ +public: + friend void ignoredFriend(); + void ignoredImplemented() {}; + void ignoredImplemented2(); // Below + void ignoredImplemented3(); // In cpp file + void funcNotSelected(); + void funcInline() + { - } - void funcBelow(); - void funcCppFile(); + } + void funcBelow(); + void funcCppFile(); - signals: - void ignoredSignal(); - }; +signals: + void ignoredSignal(); +}; - inline void C::ignoredImplemented2() {} +inline void C::ignoredImplemented2() {} - inline void C::funcBelow() - { +inline void C::funcBelow() +{ - } +} - } // namespace N)"; +} // namespace N)"; QByteArray expectedSource = R"( - #include "file.h" +#include "file.h" - namespace N { +namespace N { - void C::ignoredImplemented3() {} +void C::ignoredImplemented3() {} - void C::funcCppFile() - { +void C::funcCppFile() +{ - } +} - } // namespace N)"; +} // namespace N)"; QTest::addRow("normal case") << QByteArrayList{origHeader, expectedHeader} << QByteArrayList{origSource, expectedSource} @@ -6885,7 +6885,7 @@ void QuickfixTest::testMoveFuncDefOutsideMemberFuncOutsideWithNs() "\n" "int Foo::number() const\n" "{\n" - " return 5;\n" + " return 5;\n" "}\n" "\n}\n"; From 5aa3e6655cb11ed244fc4b4fcfc54981c47f18fb Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 30 Jun 2023 18:42:11 +0200 Subject: [PATCH 0114/1777] IosRunner: Do some cleanup Move some public methods into private section. Remove unused / no-op functions. Make some functions const. Change-Id: Iffcac68aef12db939bfc60b3a01272cf07c67c89 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/ios/iosrunner.cpp | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index 9b1f2d04869..8237a19c43a 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -81,26 +81,21 @@ public: void setCppDebugging(bool cppDebug); void setQmlDebugging(QmlDebug::QmlDebugServicesPreset qmlDebugServices); - Utils::FilePath bundlePath() const; - QString deviceId(); - IosToolHandler::RunKind runType(); - bool cppDebug() const; - bool qmlDebug() const; - QmlDebug::QmlDebugServicesPreset qmlDebugServices() const; - void start() override; void stop() final; - virtual void appOutput(const QString &/*output*/) {} - virtual void errorMsg(const QString &/*msg*/) {} - virtual void onStart() { reportStarted(); } - Port qmlServerPort() const; Port gdbServerPort() const; qint64 pid() const; bool isAppRunning() const; private: + Utils::FilePath bundlePath() const; + QString deviceId() const; + IosToolHandler::RunKind runType() const; + bool cppDebug() const; + bool qmlDebug() const; + void handleGotServerPorts(Ios::IosToolHandler *handler, const FilePath &bundlePath, const QString &deviceId, Port gdbPort, Port qmlPort); void handleGotInferiorPid(Ios::IosToolHandler *handler, const FilePath &bundlePath, @@ -155,7 +150,7 @@ FilePath IosRunner::bundlePath() const return m_bundleDir; } -QString IosRunner::deviceId() +QString IosRunner::deviceId() const { IosDevice::ConstPtr dev = m_device.dynamicCast<const IosDevice>(); if (!dev) @@ -163,7 +158,7 @@ QString IosRunner::deviceId() return dev->uniqueDeviceID(); } -IosToolHandler::RunKind IosRunner::runType() +IosToolHandler::RunKind IosRunner::runType() const { if (m_cppDebug) return IosToolHandler::DebugRun; @@ -180,11 +175,6 @@ bool IosRunner::qmlDebug() const return m_qmlDebugServices != QmlDebug::NoQmlDebugServices; } -QmlDebug::QmlDebugServicesPreset IosRunner::qmlDebugServices() const -{ - return m_qmlDebugServices; -} - void IosRunner::start() { if (m_toolHandler && isAppRunning()) @@ -315,7 +305,6 @@ void IosRunner::handleAppOutput(IosToolHandler *handler, const QString &output) if (match.hasMatch() && m_qmlServerPort.isValid()) res.replace(match.captured(1), QString::number(m_qmlServerPort.number())); appendMessage(output, StdOutFormat); - appOutput(res); } void IosRunner::handleErrorMsg(IosToolHandler *handler, const QString &msg) @@ -337,7 +326,6 @@ void IosRunner::handleErrorMsg(IosToolHandler *handler, const QString &msg) res.replace(match.captured(1), QString::number(m_qmlServerPort.number())); appendMessage(res, StdErrFormat); - errorMsg(res); } void IosRunner::handleToolExited(IosToolHandler *handler, int code) @@ -389,8 +377,6 @@ public: explicit IosRunSupport(RunControl *runControl); ~IosRunSupport() override; - void didStartApp(IosToolHandler::OpStatus status); - private: void start() override; }; @@ -400,8 +386,8 @@ IosRunSupport::IosRunSupport(RunControl *runControl) { setId("IosRunSupport"); runControl->setIcon(Icons::RUN_SMALL_TOOLBAR); - QString displayName = QString("Run on %1").arg(device().isNull() ? QString() : device()->displayName()); - runControl->setDisplayName(displayName); + runControl->setDisplayName(QString("Run on %1") + .arg(device().isNull() ? QString() : device()->displayName())); } IosRunSupport::~IosRunSupport() From 4eceb76bd5ba905dbbb684aecbe04c261706fdd9 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 4 Jul 2023 10:34:24 +0200 Subject: [PATCH 0115/1777] ClangTools: remove unused function Change-Id: I7551f30b6b9c925290837f53b9ad4ceca66b5fab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../clangfixitsrefactoringchanges.cpp | 23 ------------------- .../clangfixitsrefactoringchanges.h | 3 --- 2 files changed, 26 deletions(-) diff --git a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp index d1094d0dac8..5f5102d7944 100644 --- a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp +++ b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp @@ -178,29 +178,6 @@ void FixitsRefactoringFile::shiftAffectedReplacements(const ReplacementOperation } } -bool FixitsRefactoringFile::hasIntersection(const FilePath &filePath, - const Text::Replacements &replacements, - int startIndex) const -{ - for (int i = startIndex; i < m_replacementOperations.size(); ++i) { - const ReplacementOperation ¤t = *m_replacementOperations[i]; - if (filePath != current.filePath) - continue; - - // Usually the number of replacements is from 1 to 3. - if (std::any_of(replacements.begin(), - replacements.end(), - [¤t](const Text::Replacement &replacement) { - return replacement.offset + replacement.length > current.pos - && replacement.offset < current.pos + current.length; - })) { - return true; - } - } - - return false; -} - void FixitsRefactoringFile::shiftAffectedReplacements(const FilePath &filePath, const Text::Replacements &replacements, int startIndex) diff --git a/src/plugins/clangtools/clangfixitsrefactoringchanges.h b/src/plugins/clangtools/clangfixitsrefactoringchanges.h index 31f4412236a..7a1eecc9fc9 100644 --- a/src/plugins/clangtools/clangfixitsrefactoringchanges.h +++ b/src/plugins/clangtools/clangfixitsrefactoringchanges.h @@ -50,9 +50,6 @@ private: void shiftAffectedReplacements(const Utils::FilePath &filePath, const Utils::Text::Replacements &replacements, int startIndex); - bool hasIntersection(const Utils::FilePath &filePath, - const Utils::Text::Replacements &replacements, - int startIndex) const; mutable Utils::TextFileFormat m_textFileFormat; mutable QHash<Utils::FilePath, QTextDocument *> m_documents; From e1c97d4e4796e87bc1acc782f430f67000151e67 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 4 Jul 2023 11:05:58 +0200 Subject: [PATCH 0116/1777] Debugger: Remove some path mapping This reverts 67607e4bc60ada2926825dd34ac18856c9f4a841, which seems not needed anymore. Change-Id: I7c995fc158bb26acf3b4a8ad4b810fa427fcf009 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/debugger/debuggerruncontrol.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 498f54d37dc..dc7fb018930 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -892,9 +892,6 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm } Runnable inferior = runControl->runnable(); - const FilePath &debuggerExecutable = m_runParameters.debugger.command.executable(); - inferior.command.setExecutable(debuggerExecutable.withNewMappedPath(inferior.command.executable())); - inferior.workingDirectory = debuggerExecutable.withNewMappedPath(inferior.workingDirectory); // Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...) inferior.workingDirectory = inferior.workingDirectory.normalizedPathName(); m_runParameters.inferior = inferior; From 81e8c67686f634a56ef58ad736e9ea72cedfbbab Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 4 Jul 2023 11:15:26 +0200 Subject: [PATCH 0117/1777] Utils: add convenience function to ChangeSet Creating a QTextCursor just for the ChangeSet gives no benefit for the calling code, but reduces the readability. Change-Id: I34acb6083b6f7ab54fce042e29cd6e80498338ef Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/utils/changeset.cpp | 6 ++++++ src/libs/utils/changeset.h | 2 ++ src/plugins/cppeditor/cppcodestylesettingspage.cpp | 3 +-- src/plugins/cppeditor/cppcompletion_test.cpp | 3 +-- .../cppeditor/cpppointerdeclarationformatter_test.cpp | 3 +-- src/plugins/qmljseditor/quicktoolbar.cpp | 3 +-- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/libs/utils/changeset.cpp b/src/libs/utils/changeset.cpp index fa4e6696431..b5d3dc2f93a 100644 --- a/src/libs/utils/changeset.cpp +++ b/src/libs/utils/changeset.cpp @@ -318,6 +318,12 @@ void ChangeSet::apply(QTextCursor *textCursor) m_cursor = nullptr; } +void ChangeSet::apply(QTextDocument *document) +{ + QTextCursor c(document); + apply(&c); +} + QString ChangeSet::textAt(int pos, int length) { if (m_string) { diff --git a/src/libs/utils/changeset.h b/src/libs/utils/changeset.h index a6853c75f5d..915cee3778d 100644 --- a/src/libs/utils/changeset.h +++ b/src/libs/utils/changeset.h @@ -10,6 +10,7 @@ QT_BEGIN_NAMESPACE class QTextCursor; +class QTextDocument; QT_END_NAMESPACE namespace Utils { @@ -76,6 +77,7 @@ public: void apply(QString *s); void apply(QTextCursor *textCursor); + void apply(QTextDocument *document); private: // length-based API. diff --git a/src/plugins/cppeditor/cppcodestylesettingspage.cpp b/src/plugins/cppeditor/cppcodestylesettingspage.cpp index 84573bdeed5..88be950193b 100644 --- a/src/plugins/cppeditor/cppcodestylesettingspage.cpp +++ b/src/plugins/cppeditor/cppcodestylesettingspage.cpp @@ -76,8 +76,7 @@ static void applyRefactorings(QTextDocument *textDocument, TextEditorWidget *edi Utils::ChangeSet change = formatter.format(cppDocument->translationUnit()->ast()); // Apply change - QTextCursor cursor(textDocument); - change.apply(&cursor); + change.apply(textDocument); } // ------------------ CppCodeStyleSettingsWidget diff --git a/src/plugins/cppeditor/cppcompletion_test.cpp b/src/plugins/cppeditor/cppcompletion_test.cpp index 1e212dde609..a61f0707ec3 100644 --- a/src/plugins/cppeditor/cppcompletion_test.cpp +++ b/src/plugins/cppeditor/cppcompletion_test.cpp @@ -135,8 +135,7 @@ public: { Utils::ChangeSet change; change.insert(m_position, QLatin1String(text)); - QTextCursor cursor(m_textDocument); - change.apply(&cursor); + change.apply(m_textDocument); m_position += text.length(); } diff --git a/src/plugins/cppeditor/cpppointerdeclarationformatter_test.cpp b/src/plugins/cppeditor/cpppointerdeclarationformatter_test.cpp index 9072938b0f7..22fb303c476 100644 --- a/src/plugins/cppeditor/cpppointerdeclarationformatter_test.cpp +++ b/src/plugins/cppeditor/cpppointerdeclarationformatter_test.cpp @@ -107,8 +107,7 @@ public: Utils::ChangeSet change = formatter.format(ast); // ChangeSet may be empty. // Apply change - QTextCursor changeCursor(qtextDocument); - change.apply(&changeCursor); + change.apply(qtextDocument); // Compare QCOMPARE(qtextDocument->toPlainText(), expectedSource); diff --git a/src/plugins/qmljseditor/quicktoolbar.cpp b/src/plugins/qmljseditor/quicktoolbar.cpp index cce60c03cf9..4d95818d838 100644 --- a/src/plugins/qmljseditor/quicktoolbar.cpp +++ b/src/plugins/qmljseditor/quicktoolbar.cpp @@ -318,8 +318,7 @@ void QuickToolBar::removeProperty(const QString &propertyName) Utils::ChangeSet changeSet; Rewriter rewriter(m_doc->source(), &changeSet, m_propertyOrder); rewriter.removeBindingByName(initializer, propertyName); - QTextCursor tc(m_editorWidget->document()); - changeSet.apply(&tc); + changeSet.apply(m_editorWidget->document()); } } } From 4743724d4cf696848635439196cdaa0e0b5572b5 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 4 Jul 2023 10:05:33 +0200 Subject: [PATCH 0118/1777] Editor: replace Utils::Text::Replacement with Utils::ChangeSet::EditOp for formatting Removes the last usage of Utils::Text::Replacement with a more commonly used pattern. Change-Id: I0912bf61388a58ddaba424380ec139f9aa15fc4c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/utils/changeset.h | 2 + .../clangformat/clangformatbaseindenter.cpp | 80 +++++++++---------- .../clangformat/clangformatbaseindenter.h | 28 +++---- .../clangformat/clangformatindenter.cpp | 2 +- src/plugins/clangformat/clangformatindenter.h | 4 +- .../clangfixitsrefactoringchanges.cpp | 13 +-- .../clangfixitsrefactoringchanges.h | 2 +- .../clangtools/documentquickfixfactory.cpp | 1 + .../cmakeprojectmanager/cmakeeditor.cpp | 1 + .../languageclientformatter.cpp | 2 +- src/plugins/texteditor/indenter.h | 8 +- 11 files changed, 74 insertions(+), 69 deletions(-) diff --git a/src/libs/utils/changeset.h b/src/libs/utils/changeset.h index 915cee3778d..4afaefab463 100644 --- a/src/libs/utils/changeset.h +++ b/src/libs/utils/changeset.h @@ -103,6 +103,8 @@ private: bool m_error; }; +using EditOperations = QList<ChangeSet::EditOp>; + inline bool operator<(const ChangeSet::Range &r1, const ChangeSet::Range &r2) { return r1.start < r2.start; diff --git a/src/plugins/clangformat/clangformatbaseindenter.cpp b/src/plugins/clangformat/clangformatbaseindenter.cpp index cf04958d28a..8e8d6013253 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.cpp +++ b/src/plugins/clangformat/clangformatbaseindenter.cpp @@ -361,12 +361,11 @@ static Utils::Text::Position utf16LineColumn(const QByteArray &utf8Buffer, int u utf8Offset - startOfLineOffset)).length(); return position; } -Utils::Text::Replacements utf16Replacements(const QTextDocument *doc, - const QByteArray &utf8Buffer, - const clang::tooling::Replacements &replacements) +Utils::ChangeSet convertReplacements(const QTextDocument *doc, + const QByteArray &utf8Buffer, + const clang::tooling::Replacements &replacements) { - Utils::Text::Replacements convertedReplacements; - convertedReplacements.reserve(replacements.size()); + Utils::ChangeSet convertedReplacements; for (const clang::tooling::Replacement &replacement : replacements) { Utils::Text::Position lineColUtf16 = utf16LineColumn( @@ -412,7 +411,7 @@ Utils::Text::Replacements utf16Replacements(const QTextDocument *doc, } if (!replacementText.isEmpty() || utf16Length > 0) - convertedReplacements.emplace_back(utf16Offset, utf16Length, replacementText); + convertedReplacements.replace(utf16Offset, utf16Offset + utf16Length, replacementText); } return convertedReplacements; @@ -427,19 +426,21 @@ QString selectedLines(QTextDocument *doc, const QTextBlock &startBlock, const QT - startBlock.position() - 1)); } -int indentationForBlock(const Utils::Text::Replacements &toReplace, +int indentationForBlock(const Utils::ChangeSet &toReplace, const QByteArray &buffer, const QTextBlock ¤tBlock) { const int utf8Offset = Utils::Text::utf8NthLineOffset(currentBlock.document(), buffer, currentBlock.blockNumber() + 1); - auto replacementIt = std::find_if(toReplace.begin(), - toReplace.end(), - [utf8Offset](const Utils::Text::Replacement &replacement) { - return replacement.offset == utf8Offset - 1; - }); - if (replacementIt == toReplace.end()) + auto ops = toReplace.operationList(); + + auto replacementIt + = std::find_if(ops.begin(), ops.end(), [utf8Offset](const Utils::ChangeSet::EditOp &op) { + QTC_ASSERT(op.type == Utils::ChangeSet::EditOp::Replace, return false); + return op.pos1 == utf8Offset - 1; + }); + if (replacementIt == ops.end()) return -1; int afterLineBreak = replacementIt->text.lastIndexOf('\n'); @@ -493,20 +494,20 @@ ClangFormatBaseIndenter::ClangFormatBaseIndenter(QTextDocument *doc) : TextEditor::Indenter(doc) {} -Utils::Text::Replacements ClangFormatBaseIndenter::replacements(QByteArray buffer, - const QTextBlock &startBlock, - const QTextBlock &endBlock, - int cursorPositionInEditor, - ReplacementsToKeep replacementsToKeep, - const QChar &typedChar, - bool secondTry) const +Utils::ChangeSet ClangFormatBaseIndenter::replacements(QByteArray buffer, + const QTextBlock &startBlock, + const QTextBlock &endBlock, + int cursorPositionInEditor, + ReplacementsToKeep replacementsToKeep, + const QChar &typedChar, + bool secondTry) const { - QTC_ASSERT(replacementsToKeep != ReplacementsToKeep::All, return Utils::Text::Replacements()); + QTC_ASSERT(replacementsToKeep != ReplacementsToKeep::All, return Utils::ChangeSet()); QTC_ASSERT(!m_fileName.isEmpty(), return {}); QByteArray originalBuffer = buffer; int utf8Offset = Utils::Text::utf8NthLineOffset(m_doc, buffer, startBlock.blockNumber() + 1); - QTC_ASSERT(utf8Offset >= 0, return Utils::Text::Replacements();); + QTC_ASSERT(utf8Offset >= 0, return Utils::ChangeSet();); int utf8Length = selectedLines(m_doc, startBlock, endBlock).toUtf8().size(); int rangeStart = 0; @@ -556,11 +557,11 @@ Utils::Text::Replacements ClangFormatBaseIndenter::replacements(QByteArray buffe true); } - return utf16Replacements(m_doc, buffer, filtered); + return convertReplacements(m_doc, buffer, filtered); } -Utils::Text::Replacements ClangFormatBaseIndenter::format( - const TextEditor::RangesInLines &rangesInLines, FormattingMode mode) +Utils::EditOperations ClangFormatBaseIndenter::format(const TextEditor::RangesInLines &rangesInLines, + FormattingMode mode) { bool doFormatting = mode == FormattingMode::Forced || formatCodeInsteadOfIndent(); #ifdef WITH_TESTS @@ -572,7 +573,7 @@ Utils::Text::Replacements ClangFormatBaseIndenter::format( QTC_ASSERT(!m_fileName.isEmpty(), return {}); if (rangesInLines.empty()) - return Utils::Text::Replacements(); + return {}; const QByteArray buffer = m_doc->toPlainText().toUtf8(); std::vector<clang::tooling::Range> ranges; @@ -598,7 +599,7 @@ Utils::Text::Replacements ClangFormatBaseIndenter::format( auto changedCode = clang::tooling::applyAllReplacements(buffer.data(), clangReplacements); QTC_ASSERT(changedCode, { qDebug() << QString::fromStdString(llvm::toString(changedCode.takeError())); - return Utils::Text::Replacements(); + return {}; }); ranges = clang::tooling::calculateRangesAfterReplacements(clangReplacements, ranges); @@ -610,13 +611,14 @@ Utils::Text::Replacements ClangFormatBaseIndenter::format( &status); clangReplacements = clangReplacements.merge(formatReplacements); - const Utils::Text::Replacements toReplace = utf16Replacements(m_doc, buffer, clangReplacements); - Utils::Text::applyReplacements(m_doc, toReplace); + Utils::ChangeSet changeSet = convertReplacements(m_doc, buffer, clangReplacements); + const Utils::EditOperations editOperations = changeSet.operationList(); + changeSet.apply(m_doc); - return toReplace; + return editOperations; } -Utils::Text::Replacements ClangFormatBaseIndenter::indentsFor(QTextBlock startBlock, +Utils::ChangeSet ClangFormatBaseIndenter::indentsFor(QTextBlock startBlock, const QTextBlock &endBlock, const QChar &typedChar, int cursorPositionInEditor, @@ -625,7 +627,7 @@ Utils::Text::Replacements ClangFormatBaseIndenter::indentsFor(QTextBlock startBl if (typedChar != QChar::Null && cursorPositionInEditor > 0 && m_doc->characterAt(cursorPositionInEditor - 1) == typedChar && doNotIndentInContext(m_doc, cursorPositionInEditor - 1)) { - return Utils::Text::Replacements(); + return Utils::ChangeSet(); } startBlock = reverseFindLastEmptyBlock(startBlock); @@ -664,7 +666,8 @@ void ClangFormatBaseIndenter::indentBlocks(const QTextBlock &startBlock, const QChar &typedChar, int cursorPositionInEditor) { - applyReplacements(m_doc, indentsFor(startBlock, endBlock, typedChar, cursorPositionInEditor)); + Utils::ChangeSet changeset = indentsFor(startBlock, endBlock, typedChar, cursorPositionInEditor); + changeset.apply(m_doc); } void ClangFormatBaseIndenter::indent(const QTextCursor &cursor, @@ -708,12 +711,9 @@ int ClangFormatBaseIndenter::indentFor(const QTextBlock &block, const TextEditor::TabSettings & /*tabSettings*/, int cursorPositionInEditor) { - Utils::Text::Replacements toReplace = indentsFor(block, - block, - QChar::Null, - cursorPositionInEditor, - false); - if (toReplace.empty()) + Utils::ChangeSet toReplace + = indentsFor(block, block, QChar::Null, cursorPositionInEditor, false); + if (toReplace.isEmpty()) return -1; const QByteArray buffer = m_doc->toPlainText().toUtf8(); @@ -728,7 +728,7 @@ TextEditor::IndentationForBlock ClangFormatBaseIndenter::indentationForBlocks( TextEditor::IndentationForBlock ret; if (blocks.isEmpty()) return ret; - Utils::Text::Replacements toReplace = indentsFor(blocks.front(), + Utils::ChangeSet toReplace = indentsFor(blocks.front(), blocks.back(), QChar::Null, cursorPositionInEditor); diff --git a/src/plugins/clangformat/clangformatbaseindenter.h b/src/plugins/clangformat/clangformatbaseindenter.h index 6330d757290..e20470321d8 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.h +++ b/src/plugins/clangformat/clangformatbaseindenter.h @@ -31,8 +31,8 @@ public: void autoIndent(const QTextCursor &cursor, const TextEditor::TabSettings &tabSettings, int cursorPositionInEditor = -1) override; - Utils::Text::Replacements format(const TextEditor::RangesInLines &rangesInLines, - FormattingMode mode = FormattingMode::Forced) override; + Utils::EditOperations format(const TextEditor::RangesInLines &rangesInLines, + FormattingMode mode = FormattingMode::Forced) override; void indentBlock(const QTextBlock &block, const QChar &typedChar, @@ -60,18 +60,18 @@ private: const QTextBlock &endBlock, const QChar &typedChar, int cursorPositionInEditor); - Utils::Text::Replacements indentsFor(QTextBlock startBlock, - const QTextBlock &endBlock, - const QChar &typedChar, - int cursorPositionInEditor, - bool trimTrailingWhitespace = true); - Utils::Text::Replacements replacements(QByteArray buffer, - const QTextBlock &startBlock, - const QTextBlock &endBlock, - int cursorPositionInEditor, - ReplacementsToKeep replacementsToKeep, - const QChar &typedChar = QChar::Null, - bool secondTry = false) const; + Utils::ChangeSet indentsFor(QTextBlock startBlock, + const QTextBlock &endBlock, + const QChar &typedChar, + int cursorPositionInEditor, + bool trimTrailingWhitespace = true); + Utils::ChangeSet replacements(QByteArray buffer, + const QTextBlock &startBlock, + const QTextBlock &endBlock, + int cursorPositionInEditor, + ReplacementsToKeep replacementsToKeep, + const QChar &typedChar = QChar::Null, + bool secondTry = false) const; struct CachedStyle { clang::format::FormatStyle style = clang::format::getNoStyle(); diff --git a/src/plugins/clangformat/clangformatindenter.cpp b/src/plugins/clangformat/clangformatindenter.cpp index 2da8a95ad36..821a434f11c 100644 --- a/src/plugins/clangformat/clangformatindenter.cpp +++ b/src/plugins/clangformat/clangformatindenter.cpp @@ -173,7 +173,7 @@ void ClangFormatForwardingIndenter::autoIndent(const QTextCursor &cursor, currentIndenter()->autoIndent(cursor, tabSettings, cursorPositionInEditor); } -Utils::Text::Replacements ClangFormatForwardingIndenter::format( +Utils::EditOperations ClangFormatForwardingIndenter::format( const TextEditor::RangesInLines &rangesInLines, FormattingMode mode) { return currentIndenter()->format(rangesInLines, mode); diff --git a/src/plugins/clangformat/clangformatindenter.h b/src/plugins/clangformat/clangformatindenter.h index 5e6aca135ef..be3d54e6c8d 100644 --- a/src/plugins/clangformat/clangformatindenter.h +++ b/src/plugins/clangformat/clangformatindenter.h @@ -40,8 +40,8 @@ public: void autoIndent(const QTextCursor &cursor, const TextEditor::TabSettings &tabSettings, int cursorPositionInEditor = -1) override; - Utils::Text::Replacements format(const TextEditor::RangesInLines &rangesInLines, - FormattingMode mode) override; + Utils::EditOperations format(const TextEditor::RangesInLines &rangesInLines, + FormattingMode mode) override; bool formatOnSave() const override; TextEditor::IndentationForBlock indentationForBlocks(const QVector<QTextBlock> &blocks, const TextEditor::TabSettings &tabSettings, diff --git a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp index 5f5102d7944..4eeb72f94f1 100644 --- a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp +++ b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp @@ -126,9 +126,9 @@ void FixitsRefactoringFile::format(TextEditor::Indenter &indenter, const int end = doc->findBlock(op.pos + op.length).blockNumber() + 1; ranges.push_back({start, end}); } - const Text::Replacements replacements = indenter.format(ranges); + const EditOperations replacements = indenter.format(ranges); - if (replacements.empty()) + if (replacements.isEmpty()) return; shiftAffectedReplacements(operationsForFile.front()->filePath, @@ -179,7 +179,7 @@ void FixitsRefactoringFile::shiftAffectedReplacements(const ReplacementOperation } void FixitsRefactoringFile::shiftAffectedReplacements(const FilePath &filePath, - const Text::Replacements &replacements, + const EditOperations &replacements, int startIndex) { for (int i = startIndex; i < m_replacementOperations.size(); ++i) { @@ -187,10 +187,11 @@ void FixitsRefactoringFile::shiftAffectedReplacements(const FilePath &filePath, if (filePath != current.filePath) continue; - for (const auto &replacement : replacements) { - if (replacement.offset > current.pos) + for (const auto &op : replacements) { + QTC_ASSERT(op.type == ChangeSet::EditOp::Replace, continue); + if (op.pos1 > current.pos) break; - current.pos += replacement.text.size() - replacement.length; + current.pos += op.text.size() - op.length1; } } } diff --git a/src/plugins/clangtools/clangfixitsrefactoringchanges.h b/src/plugins/clangtools/clangfixitsrefactoringchanges.h index 7a1eecc9fc9..30c1f819dfe 100644 --- a/src/plugins/clangtools/clangfixitsrefactoringchanges.h +++ b/src/plugins/clangtools/clangfixitsrefactoringchanges.h @@ -48,7 +48,7 @@ private: const ReplacementOperations &operationsForFile, int firstOperationIndex); void shiftAffectedReplacements(const Utils::FilePath &filePath, - const Utils::Text::Replacements &replacements, + const Utils::EditOperations &replacements, int startIndex); mutable Utils::TextFileFormat m_textFileFormat; diff --git a/src/plugins/clangtools/documentquickfixfactory.cpp b/src/plugins/clangtools/documentquickfixfactory.cpp index c9875b0180c..e9807a8bcba 100644 --- a/src/plugins/clangtools/documentquickfixfactory.cpp +++ b/src/plugins/clangtools/documentquickfixfactory.cpp @@ -9,6 +9,7 @@ #include <texteditor/refactoringchanges.h> #include <utils/qtcassert.h> +#include <utils/textutils.h> namespace ClangTools { namespace Internal { diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index f2fb0a18f4c..0f2dbe39d54 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -13,6 +13,7 @@ #include <coreplugin/coreplugintr.h> #include <texteditor/textdocument.h> #include <texteditor/texteditoractionhandler.h> +#include <utils/textutils.h> #include <QDir> #include <QTextDocument> diff --git a/src/plugins/languageclient/languageclientformatter.cpp b/src/plugins/languageclient/languageclientformatter.cpp index e0dc144dc00..c3790e42cb5 100644 --- a/src/plugins/languageclient/languageclientformatter.cpp +++ b/src/plugins/languageclient/languageclientformatter.cpp @@ -93,7 +93,7 @@ QFutureWatcher<ChangeSet> *LanguageClientFormatter::format( m_ignoreCancel = true; m_progress.reportStarted(); auto watcher = new QFutureWatcher<ChangeSet>(); - QObject::connect(watcher, &QFutureWatcher<Text::Replacements>::canceled, [this]() { + QObject::connect(watcher, &QFutureWatcher<ChangeSet>::canceled, [this]() { cancelCurrentRequest(); }); watcher->setFuture(m_progress.future()); diff --git a/src/plugins/texteditor/indenter.h b/src/plugins/texteditor/indenter.h index 11c6aa87d8b..042724d3bf3 100644 --- a/src/plugins/texteditor/indenter.h +++ b/src/plugins/texteditor/indenter.h @@ -3,8 +3,8 @@ #pragma once +#include <utils/changeset.h> #include <utils/fileutils.h> -#include <utils/textutils.h> #include <QMap> #include <QTextBlock> @@ -71,10 +71,10 @@ public: } enum class FormattingMode { Forced, Settings }; - virtual Utils::Text::Replacements format(const RangesInLines &, - FormattingMode = FormattingMode::Forced) + virtual Utils::EditOperations format(const RangesInLines &, + FormattingMode = FormattingMode::Forced) { - return Utils::Text::Replacements(); + return Utils::EditOperations(); } virtual bool formatOnSave() const { return false; } From 13ccc24a353262dd8bd9838cb70773af65d3d7b9 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 4 Jul 2023 10:56:11 +0200 Subject: [PATCH 0119/1777] Utils: remove now unused Utils::Text::Replacement They have been completely replaced by Utils::ChangeSet. Change-Id: I857816c1b2730699ba481da2e271dde358f394f3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/utils/textutils.cpp | 20 -------------------- src/libs/utils/textutils.h | 19 ------------------- 2 files changed, 39 deletions(-) diff --git a/src/libs/utils/textutils.cpp b/src/libs/utils/textutils.cpp index 28a9e12e1bb..bd750d14466 100644 --- a/src/libs/utils/textutils.cpp +++ b/src/libs/utils/textutils.cpp @@ -252,26 +252,6 @@ bool utf8AdvanceCodePoint(const char *¤t) return true; } -void applyReplacements(QTextDocument *doc, const Replacements &replacements) -{ - if (replacements.empty()) - return; - - int fullOffsetShift = 0; - QTextCursor editCursor(doc); - editCursor.beginEditBlock(); - for (const Text::Replacement &replacement : replacements) { - editCursor.setPosition(replacement.offset + fullOffsetShift); - editCursor.movePosition(QTextCursor::NextCharacter, - QTextCursor::KeepAnchor, - replacement.length); - editCursor.removeSelectedText(); - editCursor.insertText(replacement.text); - fullOffsetShift += replacement.text.length() - replacement.length; - } - editCursor.endEditBlock(); -} - QDebug &operator<<(QDebug &stream, const Position &pos) { stream << "line: " << pos.line << ", column: " << pos.column; diff --git a/src/libs/utils/textutils.h b/src/libs/utils/textutils.h index 80e4150c1d2..36bd042e444 100644 --- a/src/libs/utils/textutils.h +++ b/src/libs/utils/textutils.h @@ -49,25 +49,6 @@ public: bool operator!=(const Range &other) const { return !(operator==(other)); } }; -struct Replacement -{ - Replacement() = default; - Replacement(int offset, int length, const QString &text) - : offset(offset) - , length(length) - , text(text) - {} - - int offset = -1; - int length = -1; - QString text; - - bool isValid() const { return offset >= 0 && length >= 0; } -}; -using Replacements = std::vector<Replacement>; - -QTCREATOR_UTILS_EXPORT void applyReplacements(QTextDocument *doc, const Replacements &replacements); - // line is 1-based, column is 0-based QTCREATOR_UTILS_EXPORT bool convertPosition(const QTextDocument *document, int pos, From 8e257dca2c3e5359c1583b3d31a27397299c31dd Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 17:18:26 +0200 Subject: [PATCH 0120/1777] Utils: Replace StringAspect::setFilePath() ... by FilePathAspect::setValue(). Closer to the intented uniform API. Task-number: QTCREATORBUG-29167 Change-Id: Ife26046eaeef2e49108e42a31a2d32e453883e3c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/aspects.cpp | 19 +++++++------------ src/libs/utils/aspects.h | 1 - src/plugins/axivion/axivionsettings.cpp | 2 +- src/plugins/boot2qt/qdbrunconfiguration.cpp | 2 +- .../cmakebuildconfiguration.cpp | 2 +- src/plugins/conan/conaninstallstep.cpp | 2 +- src/plugins/gitlab/gitlaboptionspage.cpp | 2 +- src/plugins/mcusupport/mcubuildstep.cpp | 2 +- .../nim/project/nimcompilercleanstep.cpp | 4 ++-- src/plugins/projectexplorer/buildaspects.cpp | 6 +++--- .../projectexplorer/buildconfiguration.cpp | 4 ++-- src/plugins/projectexplorer/makestep.cpp | 2 +- .../runconfigurationaspects.cpp | 2 +- .../projectexplorer/runconfigurationaspects.h | 2 +- .../python/pysidebuildconfiguration.cpp | 4 ++-- src/plugins/python/pythonwizardpage.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilersettings.h | 2 +- src/plugins/qmlprofiler/qmlprofilertool.cpp | 2 +- src/plugins/qnx/qnxrunconfiguration.cpp | 2 +- src/plugins/remotelinux/makeinstallstep.cpp | 2 +- .../remotelinuxrunconfiguration.cpp | 2 +- src/plugins/valgrind/valgrindsettings.cpp | 2 +- src/plugins/valgrind/valgrindsettings.h | 2 +- 23 files changed, 33 insertions(+), 39 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 8571bffe3c3..b84a2abc73c 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -841,18 +841,6 @@ FilePath StringAspect::filePath() const return FilePath::fromUserInput(value()); } -/*! - Sets the value of this string aspect to \a value. - - \note This simply uses \c FilePath::toUserOutput() for the - conversion. It does not use any check that the value is actually - a file path. -*/ -void StringAspect::setFilePath(const FilePath &value) -{ - setValue(value.toUserOutput()); -} - PathChooser *StringAspect::pathChooser() const { return d->m_pathChooserDisplay.data(); @@ -1324,6 +1312,13 @@ FilePathAspect::FilePathAspect(AspectContainer *container) setDisplayStyle(PathChooserDisplay); } +/*! + Sets the value of this file path aspect to \a value. + + \note This does not use any check that the value is actually + a file path. +*/ + void FilePathAspect::setValue(const FilePath &filePath) { StringAspect::setValue(filePath.toUserOutput()); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 8d9307e6685..72c35d4c5a0 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -502,7 +502,6 @@ public: void toMap(QVariantMap &map) const override; FilePath filePath() const; - void setFilePath(const FilePath &value); PathChooser *pathChooser() const; // Avoid to use. diff --git a/src/plugins/axivion/axivionsettings.cpp b/src/plugins/axivion/axivionsettings.cpp index 4a183631633..c3ecba69c13 100644 --- a/src/plugins/axivion/axivionsettings.cpp +++ b/src/plugins/axivion/axivionsettings.cpp @@ -124,7 +124,7 @@ void AxivionSettings::fromSettings(QSettings *s) const QString curlPath = QStandardPaths::findExecutable( Utils::HostOsInfo::withExecutableSuffix("curl")); if (!curlPath.isEmpty()) - curl.setFilePath(Utils::FilePath::fromString(curlPath)); + curl.setValue(Utils::FilePath::fromString(curlPath)); } } diff --git a/src/plugins/boot2qt/qdbrunconfiguration.cpp b/src/plugins/boot2qt/qdbrunconfiguration.cpp index d288289dfa7..e936d3ebc68 100644 --- a/src/plugins/boot2qt/qdbrunconfiguration.cpp +++ b/src/plugins/boot2qt/qdbrunconfiguration.cpp @@ -92,7 +92,7 @@ QdbRunConfiguration::QdbRunConfiguration(Target *target, Id id) IDevice::ConstPtr dev = DeviceKitAspect::device(target->kit()); QTC_ASSERT(dev, return); exeAspect->setExecutable(dev->filePath(depFile.remoteFilePath())); - symbolsAspect->setFilePath(localExecutable); + symbolsAspect->setValue(localExecutable); }); connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 3bb546fc066..76261a01dd7 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -2042,7 +2042,7 @@ BuildSystem *CMakeBuildConfiguration::buildSystem() const void CMakeBuildConfiguration::setSourceDirectory(const FilePath &path) { - aspect<SourceDirectoryAspect>()->setFilePath(path); + aspect<SourceDirectoryAspect>()->setValue(path); } FilePath CMakeBuildConfiguration::sourceDirectory() const diff --git a/src/plugins/conan/conaninstallstep.cpp b/src/plugins/conan/conaninstallstep.cpp index 2a634190365..7d03398205d 100644 --- a/src/plugins/conan/conaninstallstep.cpp +++ b/src/plugins/conan/conaninstallstep.cpp @@ -72,7 +72,7 @@ ConanInstallStep::ConanInstallStep(BuildStepList *bsl, Id id) auto conanFile = addAspect<FilePathAspect>(); conanFile->setSettingsKey("ConanPackageManager.InstallStep.ConanFile"); - conanFile->setFilePath(conanFilePath(project(), + conanFile->setValue(conanFilePath(project(), project()->projectDirectory() / "conanfile.txt")); conanFile->setLabelText(Tr::tr("Conan file:")); conanFile->setToolTip(Tr::tr("Enter location of conanfile.txt or conanfile.py.")); diff --git a/src/plugins/gitlab/gitlaboptionspage.cpp b/src/plugins/gitlab/gitlaboptionspage.cpp index 4660cc92bb5..48ec0fda00d 100644 --- a/src/plugins/gitlab/gitlaboptionspage.cpp +++ b/src/plugins/gitlab/gitlaboptionspage.cpp @@ -178,7 +178,7 @@ GitLabOptionsWidget::GitLabOptionsWidget(GitLabParameters *params) }, Column { m_add, m_edit, m_remove, st }, }.attachTo(this); - m_curl.setFilePath(params->curl); + m_curl.setValue(params->curl); for (const auto &gitLabServer : params->gitLabServers) { m_defaultGitLabServer->addItem(gitLabServer.displayString(), diff --git a/src/plugins/mcusupport/mcubuildstep.cpp b/src/plugins/mcusupport/mcubuildstep.cpp index 3b0c639df5e..dc3812d0423 100644 --- a/src/plugins/mcusupport/mcubuildstep.cpp +++ b/src/plugins/mcusupport/mcubuildstep.cpp @@ -78,7 +78,7 @@ DeployMcuProcessStep::DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, U cmd->setSettingsKey("QmlProject.Mcu.ProcessStep.Command"); cmd->setExpectedKind(Utils::PathChooser::Command); cmd->setLabelText(QmlProjectManager::Tr::tr("Command:")); - cmd->setFilePath(rootPath.pathAppended("/bin/qmlprojectexporter")); + cmd->setValue(rootPath.pathAppended("/bin/qmlprojectexporter")); const char *importPathConstant = QtSupport::Constants::KIT_QML_IMPORT_PATH; Utils::FilePath projectDir = buildSystem()->projectDirectory(); diff --git a/src/plugins/nim/project/nimcompilercleanstep.cpp b/src/plugins/nim/project/nimcompilercleanstep.cpp index 8e13c068131..798ba4f8a0c 100644 --- a/src/plugins/nim/project/nimcompilercleanstep.cpp +++ b/src/plugins/nim/project/nimcompilercleanstep.cpp @@ -39,12 +39,12 @@ private: NimCompilerCleanStep::NimCompilerCleanStep(BuildStepList *parentList, Id id) : BuildStep(parentList, id) { - auto workingDirectory = addAspect<StringAspect>(); + auto workingDirectory = addAspect<FilePathAspect>(); workingDirectory->setLabelText(Tr::tr("Working directory:")); workingDirectory->setDisplayStyle(StringAspect::LineEditDisplay); setSummaryUpdater([this, workingDirectory] { - workingDirectory->setFilePath(buildDirectory()); + workingDirectory->setValue(buildDirectory()); return displayName(); }); } diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index 3f161867ef9..2ffcbc7ac8a 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -102,7 +102,7 @@ void BuildDirectoryAspect::fromMap(const QVariantMap &map) if (!d->sourceDir.isEmpty()) { d->savedShadowBuildDir = FilePath::fromSettings(map.value(settingsKey() + ".shadowDir")); if (d->savedShadowBuildDir.isEmpty()) - setFilePath(d->sourceDir); + setValue(d->sourceDir); setChecked(d->sourceDir != filePath()); } } @@ -117,11 +117,11 @@ void BuildDirectoryAspect::addToLayout(Layouting::LayoutItem &parent) if (!d->sourceDir.isEmpty()) { connect(this, &StringAspect::checkedChanged, this, [this] { if (isChecked()) { - setFilePath(d->savedShadowBuildDir.isEmpty() + setValue(d->savedShadowBuildDir.isEmpty() ? d->sourceDir : d->savedShadowBuildDir); } else { d->savedShadowBuildDir = filePath(); - setFilePath(d->sourceDir); + setValue(d->sourceDir); } }); } diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index a1e440d7c4e..3a7d0b4a2a0 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -246,10 +246,10 @@ void BuildConfiguration::setBuildDirectory(const FilePath &dir) { if (dir == d->m_buildDirectoryAspect->filePath()) return; - d->m_buildDirectoryAspect->setFilePath(dir); + d->m_buildDirectoryAspect->setValue(dir); const FilePath fixedDir = BuildDirectoryAspect::fixupDir(buildDirectory()); if (!fixedDir.isEmpty()) - d->m_buildDirectoryAspect->setFilePath(fixedDir); + d->m_buildDirectoryAspect->setValue(fixedDir); emitBuildDirectoryChanged(); } diff --git a/src/plugins/projectexplorer/makestep.cpp b/src/plugins/projectexplorer/makestep.cpp index 028706fa2db..cd8ef6120ec 100644 --- a/src/plugins/projectexplorer/makestep.cpp +++ b/src/plugins/projectexplorer/makestep.cpp @@ -252,7 +252,7 @@ Environment MakeStep::makeEnvironment() const void MakeStep::setMakeCommand(const FilePath &command) { - m_makeCommandAspect.setFilePath(command); + m_makeCommandAspect.setValue(command); } int MakeStep::defaultJobCount() diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 5d44872439e..a2bee30265f 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -662,7 +662,7 @@ void ExecutableAspect::setPlaceHolderText(const QString &placeHolderText) */ void ExecutableAspect::setExecutable(const FilePath &executable) { - m_executable.setFilePath(executable); + m_executable.setValue(executable); m_executable.setShowToolTipOnLabel(true); } diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index f7e3e4c4211..6c58a660722 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -190,7 +190,7 @@ private: ExecutionDeviceSelector m_selector = RunDevice; }; -class PROJECTEXPLORER_EXPORT SymbolFileAspect : public Utils::StringAspect +class PROJECTEXPLORER_EXPORT SymbolFileAspect : public Utils::FilePathAspect { Q_OBJECT diff --git a/src/plugins/python/pysidebuildconfiguration.cpp b/src/plugins/python/pysidebuildconfiguration.cpp index 5f6f7dadea5..51c97bd40bd 100644 --- a/src/plugins/python/pysidebuildconfiguration.cpp +++ b/src/plugins/python/pysidebuildconfiguration.cpp @@ -42,7 +42,7 @@ PySideBuildStep::PySideBuildStep(BuildStepList *bsl, Id id) const FilePath pySideProjectPath = FilePath("pyside6-project").searchInPath(); if (pySideProjectPath.isExecutableFile()) - m_pysideProject.setFilePath(pySideProjectPath); + m_pysideProject.setValue(pySideProjectPath); setCommandLineProvider([this] { return CommandLine(m_pysideProject(), {"build"}); }); setWorkingDirectoryProvider([this] { @@ -55,7 +55,7 @@ PySideBuildStep::PySideBuildStep(BuildStepList *bsl, Id id) void PySideBuildStep::updatePySideProjectPath(const FilePath &pySideProjectPath) { - m_pysideProject.setFilePath(pySideProjectPath); + m_pysideProject.setValue(pySideProjectPath); } void PySideBuildStep::doRun() diff --git a/src/plugins/python/pythonwizardpage.cpp b/src/plugins/python/pythonwizardpage.cpp index 59ecebf688a..4a8fb800c70 100644 --- a/src/plugins/python/pythonwizardpage.cpp +++ b/src/plugins/python/pythonwizardpage.cpp @@ -133,7 +133,7 @@ void PythonWizardPage::initializePage() const FilePath projectDir = FilePath::fromString(wiz->property("ProjectDirectory").toString()); m_createVenv.setValue(!projectDir.isEmpty()); if (m_venvPath.filePath().isEmpty()) - m_venvPath.setFilePath(projectDir.isEmpty() ? FilePath{} : projectDir / "venv"); + m_venvPath.setValue(projectDir.isEmpty() ? FilePath{} : projectDir / "venv"); updateInterpreters(); updateStateLabel(); diff --git a/src/plugins/qmlprofiler/qmlprofilersettings.h b/src/plugins/qmlprofiler/qmlprofilersettings.h index 14e35676215..b53622cabc5 100644 --- a/src/plugins/qmlprofiler/qmlprofilersettings.h +++ b/src/plugins/qmlprofiler/qmlprofilersettings.h @@ -18,7 +18,7 @@ public: Utils::BoolAspect flushEnabled; Utils::IntegerAspect flushInterval; - Utils::StringAspect lastTraceFile; + Utils::FilePathAspect lastTraceFile; Utils::BoolAspect aggregateTraces; }; diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 4d67d7a1fd6..e84a27531af 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -568,7 +568,7 @@ static void saveLastTraceFile(const FilePath &filePath) { QmlProfilerSettings *settings = QmlProfilerPlugin::globalSettings(); if (filePath != settings->lastTraceFile.filePath()) { - settings->lastTraceFile.setFilePath(filePath); + settings->lastTraceFile.setValue(filePath); settings->writeGlobalSettings(); } } diff --git a/src/plugins/qnx/qnxrunconfiguration.cpp b/src/plugins/qnx/qnxrunconfiguration.cpp index e80c4d2c2ae..3367250969b 100644 --- a/src/plugins/qnx/qnxrunconfiguration.cpp +++ b/src/plugins/qnx/qnxrunconfiguration.cpp @@ -59,7 +59,7 @@ QnxRunConfiguration::QnxRunConfiguration(Target *target, Id id) const DeployableFile depFile = target->deploymentData() .deployableForLocalFile(localExecutable); exeAspect->setExecutable(FilePath::fromString(depFile.remoteFilePath())); - symbolsAspect->setFilePath(localExecutable); + symbolsAspect->setValue(localExecutable); }); setRunnableModifier([libAspect](Runnable &r) { diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 56c22d4ff80..5a156329eb5 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -101,7 +101,7 @@ MakeInstallStep::MakeInstallStep(BuildStepList *parent, Id id) : MakeStep(parent installRootAspect->setSettingsKey(InstallRootAspectId); installRootAspect->setExpectedKind(PathChooser::Directory); installRootAspect->setLabelText(Tr::tr("Install root:")); - installRootAspect->setFilePath(rootPath); + installRootAspect->setValue(rootPath); connect(installRootAspect, &StringAspect::changed, this, &MakeInstallStep::updateArgsFromAspect); diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 4ac92d237e2..32948f7c9f8 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -69,7 +69,7 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Id id) const DeployableFile depFile = deploymentData.deployableForLocalFile(localExecutable); exeAspect->setExecutable(runDevice->filePath(depFile.remoteFilePath())); - symbolsAspect->setFilePath(localExecutable); + symbolsAspect->setValue(localExecutable); libAspect->setEnabled(buildDevice == runDevice); }); diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 55c6a3543ce..1dbcef72035 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -70,7 +70,7 @@ void SuppressionAspectPrivate::slotAddSuppression() if (!files.isEmpty()) { for (const FilePath &file : files) m_model.appendRow(new QStandardItem(file.toString())); - conf->lastSuppressionDirectory.setFilePath(files.at(0).absolutePath()); + conf->lastSuppressionDirectory.setValue(files.at(0).absolutePath()); //conf->setLastSuppressionDialogHistory(dialog.history()); if (!isGlobal) q->apply(); diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index def8b793da7..92ac467a015 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -120,7 +120,7 @@ public: void writeSettings() const; void readSettings(); - Utils::StringAspect lastSuppressionDirectory{this}; + Utils::FilePathAspect lastSuppressionDirectory{this}; Utils::StringAspect lastSuppressionHistory{this}; From 6e16512eba2c39baa714fa253843b2171ba24f47 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 4 Jul 2023 10:55:37 +0200 Subject: [PATCH 0121/1777] AppOutputPane: Ensure the window exists before flushing Amends c1f6d7044589f7842d19fc7b44574152ce72a20f Change-Id: I5fbb6efced18682b62cd7c905653e23419a3a522 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/appoutputpane.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 099430b94a6..c69aeaf828c 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -380,7 +380,8 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) QTimer::singleShot(0, this, [this, rc] { runControlFinished(rc); }); for (const RunControlTab &t : std::as_const(m_runControlTabs)) { if (t.runControl == rc) { - t.window->flush(); + if (t.window) + t.window->flush(); break; } } From de5efffeff8a2adebc77fd2b6888047abf8530a5 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 28 Jun 2023 17:03:58 +0200 Subject: [PATCH 0122/1777] BaseFileFind: Replace files() with fileContainerProvider() The fileContainerProvider() is called only once per SearchResult instance, and the result (the provider) is stored inside FileFindParameters. In this way the extra data, like the name filters or the search directory, are set just once. Whenever the search is started (or started again), the stored provider recreates the FileContainer according to the data that has been captured by the lambda when the provider was created. This patch eliminates the need for retrieving the custom data from QVariant. It also eliminates the set of arbitrary arguments for the removed files() method. Remove the BaseFileFind * argument from the SearchEngine::executeSearch() method. Change-Id: I7211f503f82db12b5a99c9d342466daaaae0839f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/git/gitgrep.cpp | 3 +- src/plugins/git/gitgrep.h | 3 +- .../projectexplorer/allprojectsfind.cpp | 11 +++--- src/plugins/projectexplorer/allprojectsfind.h | 10 ++--- .../projectexplorer/currentprojectfind.cpp | 28 +++++++------ .../projectexplorer/currentprojectfind.h | 4 +- .../filesinallprojectsfind.cpp | 18 ++++----- .../projectexplorer/filesinallprojectsfind.h | 4 +- .../findinfilessilversearcher.cpp | 2 +- .../findinfilessilversearcher.h | 2 +- src/plugins/texteditor/basefilefind.cpp | 14 +++---- src/plugins/texteditor/basefilefind.h | 9 +++-- src/plugins/texteditor/findincurrentfile.cpp | 19 ++++----- src/plugins/texteditor/findincurrentfile.h | 4 +- src/plugins/texteditor/findinfiles.cpp | 11 +++--- src/plugins/texteditor/findinfiles.h | 4 +- src/plugins/texteditor/findinopenfiles.cpp | 39 ++++++++----------- src/plugins/texteditor/findinopenfiles.h | 4 +- 18 files changed, 85 insertions(+), 104 deletions(-) diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index f6324f152de..8f404c8f380 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -264,8 +264,7 @@ void GitGrep::writeSettings(QSettings *settings) const settings->setValue(GitGrepRef, m_treeLineEdit->text()); } -QFuture<SearchResultItems> GitGrep::executeSearch(const FileFindParameters ¶meters, - BaseFileFind *) +QFuture<SearchResultItems> GitGrep::executeSearch(const FileFindParameters ¶meters) { return Utils::asyncRun(runGitGrep, parameters); } diff --git a/src/plugins/git/gitgrep.h b/src/plugins/git/gitgrep.h index fda6fe56ebd..f2a4b812c5f 100644 --- a/src/plugins/git/gitgrep.h +++ b/src/plugins/git/gitgrep.h @@ -28,8 +28,7 @@ public: void readSettings(QSettings *settings) override; void writeSettings(QSettings *settings) const override; QFuture<Utils::SearchResultItems> executeSearch( - const TextEditor::FileFindParameters ¶meters, - TextEditor::BaseFileFind *baseFileFind) override; + const TextEditor::FileFindParameters ¶meters) override; Core::IEditor *openEditor(const Utils::SearchResultItem &item, const TextEditor::FileFindParameters ¶meters) override; diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp index 53bc13cfef3..c9fdcb11225 100644 --- a/src/plugins/projectexplorer/allprojectsfind.cpp +++ b/src/plugins/projectexplorer/allprojectsfind.cpp @@ -47,17 +47,16 @@ bool AllProjectsFind::isEnabled() const return BaseFileFind::isEnabled() && ProjectManager::hasProjects(); } -FileContainer AllProjectsFind::files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const +FileContainerProvider AllProjectsFind::fileContainerProvider() const { - Q_UNUSED(additionalParameters) - return filesForProjects(nameFilters, exclusionFilters, ProjectManager::projects()); + return [nameFilters = fileNameFilters(), exclusionFilters = fileExclusionFilters()] { + return filesForProjects(nameFilters, exclusionFilters, ProjectManager::projects()); + }; } FileContainer AllProjectsFind::filesForProjects(const QStringList &nameFilters, const QStringList &exclusionFilters, - const QList<Project *> &projects) const + const QList<Project *> &projects) { std::function<FilePaths(const FilePaths &)> filterFiles = Utils::filterFilesFunction(nameFilters, exclusionFilters); diff --git a/src/plugins/projectexplorer/allprojectsfind.h b/src/plugins/projectexplorer/allprojectsfind.h index 4752d8d28a3..c4d70e1a1c5 100644 --- a/src/plugins/projectexplorer/allprojectsfind.h +++ b/src/plugins/projectexplorer/allprojectsfind.h @@ -30,18 +30,16 @@ public: void readSettings(QSettings *settings) override; protected: - Utils::FileContainer files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const override; - Utils::FileContainer filesForProjects(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QList<Project *> &projects) const; + static Utils::FileContainer filesForProjects(const QStringList &nameFilters, + const QStringList &exclusionFilters, + const QList<Project *> &projects); QVariant additionalParameters() const override; QString label() const override; QString toolTip() const override; private: + TextEditor::FileContainerProvider fileContainerProvider() const override; void handleFileListChanged(); QPointer<QWidget> m_configWidget; diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index 942a1dc6e70..7bd8bd332c9 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -57,17 +57,22 @@ QVariant CurrentProjectFind::additionalParameters() const return QVariant(); } -FileContainer CurrentProjectFind::files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const +static FilePath currentProjectFilePath() { - QTC_ASSERT(additionalParameters.isValid(), return {}); - const FilePath projectFile = FilePath::fromVariant(additionalParameters); - for (Project *project : ProjectManager::projects()) { - if (project && projectFile == project->projectFilePath()) - return filesForProjects(nameFilters, exclusionFilters, {project}); - } - return {}; + Project *project = ProjectTree::currentProject(); + return project ? project->projectFilePath() : FilePath(); +} + +FileContainerProvider CurrentProjectFind::fileContainerProvider() const +{ + return [nameFilters = fileNameFilters(), exclusionFilters = fileExclusionFilters(), + projectFile = currentProjectFilePath()] { + for (Project *project : ProjectManager::projects()) { + if (project && projectFile == project->projectFilePath()) + return filesForProjects(nameFilters, exclusionFilters, {project}); + } + return FileContainer(); + }; } QString CurrentProjectFind::label() const @@ -85,8 +90,7 @@ void CurrentProjectFind::handleProjectChanged() void CurrentProjectFind::setupSearch(Core::SearchResult *search) { - Project *project = ProjectTree::currentProject(); - const FilePath projectFile = project ? project->projectFilePath() : FilePath(); + const FilePath projectFile = currentProjectFilePath(); connect(this, &IFindFilter::enabledChanged, search, [search, projectFile] { const QList<Project *> projects = ProjectManager::projects(); for (Project *project : projects) { diff --git a/src/plugins/projectexplorer/currentprojectfind.h b/src/plugins/projectexplorer/currentprojectfind.h index a2589bf2b9d..4ac5e4eeb30 100644 --- a/src/plugins/projectexplorer/currentprojectfind.h +++ b/src/plugins/projectexplorer/currentprojectfind.h @@ -27,13 +27,11 @@ public: void readSettings(QSettings *settings) override; protected: - Utils::FileContainer files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const override; QVariant additionalParameters() const override; QString label() const override; private: + TextEditor::FileContainerProvider fileContainerProvider() const override; void handleProjectChanged(); void setupSearch(Core::SearchResult *search) override; }; diff --git a/src/plugins/projectexplorer/filesinallprojectsfind.cpp b/src/plugins/projectexplorer/filesinallprojectsfind.cpp index 554b072f7b7..5b8e6eaa684 100644 --- a/src/plugins/projectexplorer/filesinallprojectsfind.cpp +++ b/src/plugins/projectexplorer/filesinallprojectsfind.cpp @@ -13,6 +13,7 @@ #include <QSettings> +using namespace TextEditor; using namespace Utils; namespace ProjectExplorer { @@ -47,16 +48,15 @@ void FilesInAllProjectsFind::readSettings(QSettings *settings) settings->endGroup(); } -FileContainer FilesInAllProjectsFind::files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const +FileContainerProvider FilesInAllProjectsFind::fileContainerProvider() const { - Q_UNUSED(additionalParameters) - const QSet<FilePath> dirs = Utils::transform<QSet>(ProjectManager::projects(), [](Project *p) { - return p->projectFilePath().parentDir(); - }); - return SubDirFileContainer(FilePaths(dirs.constBegin(), dirs.constEnd()), nameFilters, - exclusionFilters, Core::EditorManager::defaultTextCodec()); + return [nameFilters = fileNameFilters(), exclusionFilters = fileExclusionFilters()] { + const QSet<FilePath> dirs = Utils::transform<QSet>(ProjectManager::projects(), [](Project *p) { + return p->projectFilePath().parentDir(); + }); + return SubDirFileContainer(FilePaths(dirs.constBegin(), dirs.constEnd()), nameFilters, + exclusionFilters, Core::EditorManager::defaultTextCodec()); + }; } QString FilesInAllProjectsFind::label() const diff --git a/src/plugins/projectexplorer/filesinallprojectsfind.h b/src/plugins/projectexplorer/filesinallprojectsfind.h index ad09ff031db..1e27b06a309 100644 --- a/src/plugins/projectexplorer/filesinallprojectsfind.h +++ b/src/plugins/projectexplorer/filesinallprojectsfind.h @@ -20,9 +20,7 @@ public: void readSettings(QSettings *settings) override; protected: - Utils::FileContainer files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const override; + TextEditor::FileContainerProvider fileContainerProvider() const override; QString label() const override; }; diff --git a/src/plugins/silversearcher/findinfilessilversearcher.cpp b/src/plugins/silversearcher/findinfilessilversearcher.cpp index 6cf428bb64f..f607ae51498 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.cpp +++ b/src/plugins/silversearcher/findinfilessilversearcher.cpp @@ -165,7 +165,7 @@ void FindInFilesSilverSearcher::writeSettings(QSettings *settings) const } QFuture<SearchResultItems> FindInFilesSilverSearcher::executeSearch( - const FileFindParameters ¶meters, BaseFileFind * /*baseFileFind*/) + const FileFindParameters ¶meters) { return Utils::asyncRun(runSilverSeacher, parameters); } diff --git a/src/plugins/silversearcher/findinfilessilversearcher.h b/src/plugins/silversearcher/findinfilessilversearcher.h index bc5e224c21f..b70684f6ec8 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.h +++ b/src/plugins/silversearcher/findinfilessilversearcher.h @@ -32,7 +32,7 @@ public: void readSettings(QSettings *settings) override; void writeSettings(QSettings *settings) const override; QFuture<Utils::SearchResultItems> executeSearch( - const TextEditor::FileFindParameters ¶meters, TextEditor::BaseFileFind *) override; + const TextEditor::FileFindParameters ¶meters) override; Core::IEditor *openEditor(const Utils::SearchResultItem &item, const TextEditor::FileFindParameters ¶meters) override; diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index efec7708720..23ef9c75d74 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -145,14 +145,10 @@ public: QVariant parameters() const override { return {}; } void readSettings(QSettings * /*settings*/) override {} void writeSettings(QSettings * /*settings*/) const override {} - QFuture<SearchResultItems> executeSearch(const TextEditor::FileFindParameters ¶meters, - BaseFileFind *baseFileFind) override + QFuture<SearchResultItems> executeSearch(const FileFindParameters ¶meters) override { - const FileContainer container = baseFileFind->files(parameters.nameFilters, - parameters.exclusionFilters, - parameters.additionalParameters); - return Utils::findInFiles(parameters.text, container, parameters.flags, - TextDocument::openedTextDocumentContents()); + return Utils::findInFiles(parameters.text, parameters.fileContainerProvider(), + parameters.flags, TextDocument::openedTextDocumentContents()); } Core::IEditor *openEditor(const SearchResultItem &/*item*/, @@ -324,6 +320,8 @@ void BaseFileFind::runNewSearch(const QString &txt, FindFlags findFlags, parameters.additionalParameters = additionalParameters(); parameters.searchEngineParameters = currentSearchEngine()->parameters(); parameters.searchEngineIndex = d->m_currentSearchEngineIndex; + parameters.fileContainerProvider = fileContainerProvider(); + search->setUserData(QVariant::fromValue(parameters)); connect(search, &SearchResult::activated, this, [this, search](const SearchResultItem &item) { openEditor(search, item); @@ -600,7 +598,7 @@ FilePaths BaseFileFind::replaceAll(const QString &text, const SearchResultItems QFuture<SearchResultItems> BaseFileFind::executeSearch(const FileFindParameters ¶meters) { - return d->m_searchEngines[parameters.searchEngineIndex]->executeSearch(parameters, this); + return d->m_searchEngines[parameters.searchEngineIndex]->executeSearch(parameters); } namespace Internal { diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index c92b857b577..95226730d6e 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -27,6 +27,8 @@ class BaseFileFindPrivate; class SearchEnginePrivate; } // Internal +using FileContainerProvider = std::function<Utils::FileContainer()>; + class TEXTEDITOR_EXPORT FileFindParameters { public: @@ -37,6 +39,7 @@ public: QVariant searchEngineParameters; int searchEngineIndex; Utils::FindFlags flags; + FileContainerProvider fileContainerProvider = {}; }; using ProcessSetupHandler = std::function<void(Utils::Process &)>; @@ -65,7 +68,7 @@ public: virtual void readSettings(QSettings *settings) = 0; virtual void writeSettings(QSettings *settings) const = 0; virtual QFuture<Utils::SearchResultItems> executeSearch( - const FileFindParameters ¶meters, BaseFileFind *baseFileFind) = 0; + const FileFindParameters ¶meters) = 0; virtual Core::IEditor *openEditor(const Utils::SearchResultItem &item, const FileFindParameters ¶meters) = 0; bool isEnabled() const; @@ -95,9 +98,6 @@ public: /* returns the list of unique files that were passed in items */ static Utils::FilePaths replaceAll(const QString &txt, const Utils::SearchResultItems &items, bool preserveCase = false); - virtual Utils::FileContainer files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const = 0; protected: virtual QVariant additionalParameters() const = 0; @@ -121,6 +121,7 @@ signals: void currentSearchEngineChanged(); private: + virtual FileContainerProvider fileContainerProvider() const = 0; void openEditor(Core::SearchResult *result, const Utils::SearchResultItem &item); void doReplace(const QString &txt, const Utils::SearchResultItems &items, bool preserveCase); void hideHighlightAll(bool visible); diff --git a/src/plugins/texteditor/findincurrentfile.cpp b/src/plugins/texteditor/findincurrentfile.cpp index ce471c1c12d..197d02f53e6 100644 --- a/src/plugins/texteditor/findincurrentfile.cpp +++ b/src/plugins/texteditor/findincurrentfile.cpp @@ -36,18 +36,15 @@ QString FindInCurrentFile::displayName() const return Tr::tr("Current File"); } -FileContainer FindInCurrentFile::files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const +FileContainerProvider FindInCurrentFile::fileContainerProvider() const { - Q_UNUSED(nameFilters) - Q_UNUSED(exclusionFilters) - const auto fileName = FilePath::fromVariant(additionalParameters); - QMap<FilePath, QTextCodec *> openEditorEncodings = TextDocument::openedTextDocumentEncodings(); - QTextCodec *codec = openEditorEncodings.value(fileName); - if (!codec) - codec = Core::EditorManager::defaultTextCodec(); - return FileListContainer({fileName}, {codec}); + return [fileName = m_currentDocument->filePath()] { + const QMap<FilePath, QTextCodec *> encodings = TextDocument::openedTextDocumentEncodings(); + QTextCodec *codec = encodings.value(fileName); + if (!codec) + codec = Core::EditorManager::defaultTextCodec(); + return FileListContainer({fileName}, {codec}); + }; } QVariant FindInCurrentFile::additionalParameters() const diff --git a/src/plugins/texteditor/findincurrentfile.h b/src/plugins/texteditor/findincurrentfile.h index c5f07eb8b9b..5eb75de05b0 100644 --- a/src/plugins/texteditor/findincurrentfile.h +++ b/src/plugins/texteditor/findincurrentfile.h @@ -29,14 +29,12 @@ public: void readSettings(QSettings *settings) override; protected: - Utils::FileContainer files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const override; QVariant additionalParameters() const override; QString label() const override; QString toolTip() const override; private: + FileContainerProvider fileContainerProvider() const override; void handleFileChange(Core::IEditor *editor); QPointer<Core::IDocument> m_currentDocument; diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index 908e53d875b..3f073f82296 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -58,12 +58,13 @@ QString FindInFiles::displayName() const return Tr::tr("Files in File System"); } -FileContainer FindInFiles::files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const +FileContainerProvider FindInFiles::fileContainerProvider() const { - return SubDirFileContainer({FilePath::fromVariant(additionalParameters)}, nameFilters, - exclusionFilters, EditorManager::defaultTextCodec()); + return [nameFilters = fileNameFilters(), exclusionFilters = fileExclusionFilters(), + filePath = path()] { + return SubDirFileContainer({filePath}, nameFilters, exclusionFilters, + EditorManager::defaultTextCodec()); + }; } QVariant FindInFiles::additionalParameters() const diff --git a/src/plugins/texteditor/findinfiles.h b/src/plugins/texteditor/findinfiles.h index c7e923b9506..3713ab0b1d7 100644 --- a/src/plugins/texteditor/findinfiles.h +++ b/src/plugins/texteditor/findinfiles.h @@ -44,15 +44,13 @@ signals: void pathChanged(const Utils::FilePath &directory); protected: - Utils::FileContainer files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const override; QVariant additionalParameters() const override; QString label() const override; QString toolTip() const override; void syncSearchEngineCombo(int selectedSearchEngineIndex) override; private: + FileContainerProvider fileContainerProvider() const override; void setValid(bool valid); void searchEnginesSelectionChanged(int index); Utils::FilePath path() const; diff --git a/src/plugins/texteditor/findinopenfiles.cpp b/src/plugins/texteditor/findinopenfiles.cpp index 6bfdd1b04ec..6b3e7dbe9cb 100644 --- a/src/plugins/texteditor/findinopenfiles.cpp +++ b/src/plugins/texteditor/findinopenfiles.cpp @@ -36,30 +36,25 @@ QString FindInOpenFiles::displayName() const return Tr::tr("Open Documents"); } -FileContainer FindInOpenFiles::files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const +FileContainerProvider FindInOpenFiles::fileContainerProvider() const { - Q_UNUSED(nameFilters) - Q_UNUSED(exclusionFilters) - Q_UNUSED(additionalParameters) - QMap<FilePath, QTextCodec *> openEditorEncodings - = TextDocument::openedTextDocumentEncodings(); - FilePaths fileNames; - QList<QTextCodec *> codecs; - const QList<Core::DocumentModel::Entry *> entries = Core::DocumentModel::entries(); - for (Core::DocumentModel::Entry *entry : entries) { - const FilePath fileName = entry->filePath(); - if (!fileName.isEmpty()) { - fileNames.append(fileName); - QTextCodec *codec = openEditorEncodings.value(fileName); - if (!codec) - codec = Core::EditorManager::defaultTextCodec(); - codecs.append(codec); + return [] { + const QMap<FilePath, QTextCodec *> encodings = TextDocument::openedTextDocumentEncodings(); + FilePaths fileNames; + QList<QTextCodec *> codecs; + const QList<Core::DocumentModel::Entry *> entries = Core::DocumentModel::entries(); + for (Core::DocumentModel::Entry *entry : entries) { + const FilePath fileName = entry->filePath(); + if (!fileName.isEmpty()) { + fileNames.append(fileName); + QTextCodec *codec = encodings.value(fileName); + if (!codec) + codec = Core::EditorManager::defaultTextCodec(); + codecs.append(codec); + } } - } - - return FileListContainer(fileNames, codecs); + return FileListContainer(fileNames, codecs); + }; } QVariant FindInOpenFiles::additionalParameters() const diff --git a/src/plugins/texteditor/findinopenfiles.h b/src/plugins/texteditor/findinopenfiles.h index 3431331b5b2..a96cd4f0611 100644 --- a/src/plugins/texteditor/findinopenfiles.h +++ b/src/plugins/texteditor/findinopenfiles.h @@ -22,14 +22,12 @@ public: void readSettings(QSettings *settings) override; protected: - Utils::FileContainer files(const QStringList &nameFilters, - const QStringList &exclusionFilters, - const QVariant &additionalParameters) const override; QVariant additionalParameters() const override; QString label() const override; QString toolTip() const override; private: + FileContainerProvider fileContainerProvider() const override; void updateEnabledState(); }; From 858ecf3e784f60404af458dc1fb85461334ffea8 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 28 Jun 2023 18:25:42 +0200 Subject: [PATCH 0123/1777] SearchEngine: Replace openEditor() with editorOpener() Change-Id: I45da343f4df3cf634c24bbb518703c856fbb4d90 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/git/gitgrep.cpp | 28 ++++++++++--------- src/plugins/git/gitgrep.h | 3 +- .../findinfilessilversearcher.cpp | 6 ---- .../findinfilessilversearcher.h | 2 -- src/plugins/texteditor/basefilefind.cpp | 10 ++----- src/plugins/texteditor/basefilefind.h | 8 ++++-- 6 files changed, 25 insertions(+), 32 deletions(-) diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index 8f404c8f380..b0bc3549776 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -269,20 +269,22 @@ QFuture<SearchResultItems> GitGrep::executeSearch(const FileFindParameters ¶ return Utils::asyncRun(runGitGrep, parameters); } -IEditor *GitGrep::openEditor(const SearchResultItem &item, - const FileFindParameters ¶meters) +EditorOpener GitGrep::editorOpener() const { - const GitGrepParameters params = parameters.searchEngineParameters.value<GitGrepParameters>(); - const QStringList &itemPath = item.path(); - if (params.ref.isEmpty() || itemPath.isEmpty()) - return nullptr; - const FilePath path = FilePath::fromUserInput(itemPath.first()); - const FilePath topLevel = FilePath::fromString(parameters.additionalParameters.toString()); - IEditor *editor = m_client->openShowEditor(topLevel, params.ref, path, - GitClient::ShowEditor::OnlyIfDifferent); - if (editor) - editor->gotoLine(item.mainRange().begin.line, item.mainRange().begin.column); - return editor; + return [](const Utils::SearchResultItem &item, + const FileFindParameters ¶meters) -> IEditor * { + const GitGrepParameters params = parameters.searchEngineParameters.value<GitGrepParameters>(); + const QStringList &itemPath = item.path(); + if (params.ref.isEmpty() || itemPath.isEmpty()) + return nullptr; + const FilePath path = FilePath::fromUserInput(itemPath.first()); + const FilePath topLevel = FilePath::fromString(parameters.additionalParameters.toString()); + IEditor *editor = GitClient::instance()->openShowEditor( + topLevel, params.ref, path, GitClient::ShowEditor::OnlyIfDifferent); + if (editor) + editor->gotoLine(item.mainRange().begin.line, item.mainRange().begin.column); + return editor; + }; } } // Git::Internal diff --git a/src/plugins/git/gitgrep.h b/src/plugins/git/gitgrep.h index f2a4b812c5f..d4ef451d6ea 100644 --- a/src/plugins/git/gitgrep.h +++ b/src/plugins/git/gitgrep.h @@ -29,8 +29,7 @@ public: void writeSettings(QSettings *settings) const override; QFuture<Utils::SearchResultItems> executeSearch( const TextEditor::FileFindParameters ¶meters) override; - Core::IEditor *openEditor(const Utils::SearchResultItem &item, - const TextEditor::FileFindParameters ¶meters) override; + TextEditor::EditorOpener editorOpener() const override; private: GitClient *m_client; diff --git a/src/plugins/silversearcher/findinfilessilversearcher.cpp b/src/plugins/silversearcher/findinfilessilversearcher.cpp index f607ae51498..61fe860a1db 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.cpp +++ b/src/plugins/silversearcher/findinfilessilversearcher.cpp @@ -170,12 +170,6 @@ QFuture<SearchResultItems> FindInFilesSilverSearcher::executeSearch( return Utils::asyncRun(runSilverSeacher, parameters); } -IEditor *FindInFilesSilverSearcher::openEditor(const SearchResultItem & /*item*/, - const FileFindParameters & /*parameters*/) -{ - return nullptr; -} - void FindInFilesSilverSearcher::readSettings(QSettings *settings) { m_searchOptionsLineEdit->setText(settings->value(s_searchOptionsString).toString()); diff --git a/src/plugins/silversearcher/findinfilessilversearcher.h b/src/plugins/silversearcher/findinfilessilversearcher.h index b70684f6ec8..dcb6873d18d 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.h +++ b/src/plugins/silversearcher/findinfilessilversearcher.h @@ -33,8 +33,6 @@ public: void writeSettings(QSettings *settings) const override; QFuture<Utils::SearchResultItems> executeSearch( const TextEditor::FileFindParameters ¶meters) override; - Core::IEditor *openEditor(const Utils::SearchResultItem &item, - const TextEditor::FileFindParameters ¶meters) override; private: QPointer<Core::IFindSupport> m_currentFindSupport; diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 23ef9c75d74..8d935494f43 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -151,11 +151,6 @@ public: parameters.flags, TextDocument::openedTextDocumentContents()); } - Core::IEditor *openEditor(const SearchResultItem &/*item*/, - const TextEditor::FileFindParameters &/*parameters*/) override - { - return nullptr; - } private: QWidget *m_widget; @@ -321,6 +316,7 @@ void BaseFileFind::runNewSearch(const QString &txt, FindFlags findFlags, parameters.searchEngineParameters = currentSearchEngine()->parameters(); parameters.searchEngineIndex = d->m_currentSearchEngineIndex; parameters.fileContainerProvider = fileContainerProvider(); + parameters.editorOpener = currentSearchEngine()->editorOpener(); search->setUserData(QVariant::fromValue(parameters)); connect(search, &SearchResult::activated, this, [this, search](const SearchResultItem &item) { @@ -493,8 +489,8 @@ void BaseFileFind::readCommonSettings(QSettings *settings, const QString &defaul void BaseFileFind::openEditor(SearchResult *result, const SearchResultItem &item) { const FileFindParameters parameters = result->userData().value<FileFindParameters>(); - IEditor *openedEditor = - d->m_searchEngines[parameters.searchEngineIndex]->openEditor(item, parameters); + IEditor *openedEditor = parameters.editorOpener ? parameters.editorOpener(item, parameters) + : nullptr; if (!openedEditor) EditorManager::openEditorAtSearchResult(item, Id(), EditorManager::DoNotSwitchToDesignMode); if (d->m_currentFindSupport) diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index 95226730d6e..f52a9983d2c 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -27,7 +27,11 @@ class BaseFileFindPrivate; class SearchEnginePrivate; } // Internal +class FileFindParameters; + using FileContainerProvider = std::function<Utils::FileContainer()>; +using EditorOpener = std::function<Core::IEditor *(const Utils::SearchResultItem &, + const FileFindParameters &)>; class TEXTEDITOR_EXPORT FileFindParameters { @@ -40,6 +44,7 @@ public: int searchEngineIndex; Utils::FindFlags flags; FileContainerProvider fileContainerProvider = {}; + EditorOpener editorOpener = {}; }; using ProcessSetupHandler = std::function<void(Utils::Process &)>; @@ -69,8 +74,7 @@ public: virtual void writeSettings(QSettings *settings) const = 0; virtual QFuture<Utils::SearchResultItems> executeSearch( const FileFindParameters ¶meters) = 0; - virtual Core::IEditor *openEditor(const Utils::SearchResultItem &item, - const FileFindParameters ¶meters) = 0; + virtual EditorOpener editorOpener() const { return {}; } bool isEnabled() const; void setEnabled(bool enabled); From 6f819c07cd8744c501df986b5f9154ac8cedaf92 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 28 Jun 2023 18:42:31 +0200 Subject: [PATCH 0124/1777] GitGrep: Pass GitGrepParameters through the lambda capture Instead of using QVariant searchEngineParameters. Change-Id: I30b2bf06fb16586b11e22410e1662d3127ae97be Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/git/gitgrep.cpp | 16 ++++++++-------- src/plugins/git/gitgrep.h | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index b0bc3549776..56ff5bd098e 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -245,13 +245,14 @@ QWidget *GitGrep::widget() const return m_widget; } +GitGrepParameters GitGrep::gitParameters() const +{ + return {m_treeLineEdit->text(), m_recurseSubmodules && m_recurseSubmodules->isChecked()}; +} + QVariant GitGrep::parameters() const { - GitGrepParameters params; - params.ref = m_treeLineEdit->text(); - if (m_recurseSubmodules) - params.recurseSubmodules = m_recurseSubmodules->isChecked(); - return QVariant::fromValue(params); + return QVariant::fromValue(gitParameters()); } void GitGrep::readSettings(QSettings *settings) @@ -271,9 +272,8 @@ QFuture<SearchResultItems> GitGrep::executeSearch(const FileFindParameters ¶ EditorOpener GitGrep::editorOpener() const { - return [](const Utils::SearchResultItem &item, - const FileFindParameters ¶meters) -> IEditor * { - const GitGrepParameters params = parameters.searchEngineParameters.value<GitGrepParameters>(); + return [params = gitParameters()](const Utils::SearchResultItem &item, + const FileFindParameters ¶meters) -> IEditor * { const QStringList &itemPath = item.path(); if (params.ref.isEmpty() || itemPath.isEmpty()) return nullptr; diff --git a/src/plugins/git/gitgrep.h b/src/plugins/git/gitgrep.h index d4ef451d6ea..1c905f3667d 100644 --- a/src/plugins/git/gitgrep.h +++ b/src/plugins/git/gitgrep.h @@ -14,6 +14,7 @@ namespace Utils { class FancyLineEdit; } namespace Git::Internal { class GitClient; +class GitGrepParameters; class GitGrep : public TextEditor::SearchEngine { @@ -32,6 +33,7 @@ public: TextEditor::EditorOpener editorOpener() const override; private: + GitGrepParameters gitParameters() const; GitClient *m_client; QWidget *m_widget; Utils::FancyLineEdit *m_treeLineEdit; From 914bc626e70a704d461d7f55db638e868b0c3d26 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 23 Jun 2023 13:58:46 +0200 Subject: [PATCH 0125/1777] Python: Use a separate PythonInterpreterAspect ... and move interpreter related code there. Change-Id: I108a4bdfa7c3f2078da164ce13e897a18ebdadde Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/python/pythonrunconfiguration.cpp | 62 +++++++++---------- src/plugins/python/pythonrunconfiguration.h | 4 -- 2 files changed, 30 insertions(+), 36 deletions(-) diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 6fa59ba06a3..151895449b3 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -119,26 +119,38 @@ private: //////////////////////////////////////////////////////////////// -class PythonRunConfigurationPrivate +class PythonInterpreterAspect final : public InterpreterAspect { public: - PythonRunConfigurationPrivate(PythonRunConfiguration *rc) + PythonInterpreterAspect(PythonRunConfiguration *rc) : q(rc) - {} - ~PythonRunConfigurationPrivate() + { + connect(this, &InterpreterAspect::changed, + this, &PythonInterpreterAspect::currentInterpreterChanged); + currentInterpreterChanged(); + + connect(PySideInstaller::instance(), &PySideInstaller::pySideInstalled, this, + [this](const FilePath &python) { + if (python == currentInterpreter().command) + checkForPySide(python); + } + ); + } + + ~PythonInterpreterAspect() { qDeleteAll(m_extraCompilers); } - void checkForPySide(const Utils::FilePath &python); - void checkForPySide(const Utils::FilePath &python, const QString &pySidePackageName); + void checkForPySide(const FilePath &python); + void checkForPySide(const FilePath &python, const QString &pySidePackageName); void handlePySidePackageInfo(const PipPackageInfo &pySideInfo, - const Utils::FilePath &python, + const FilePath &python, const QString &requestedPackageName); void updateExtraCompilers(); void currentInterpreterChanged(); - Utils::FilePath m_pySideUicPath; + FilePath m_pySideUicPath; PythonRunConfiguration *q; QList<PySideUicExtraCompiler *> m_extraCompilers; @@ -148,15 +160,11 @@ public: PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) - , d(new PythonRunConfigurationPrivate(this)) { - auto interpreterAspect = addAspect<InterpreterAspect>(); + auto interpreterAspect = addAspect<PythonInterpreterAspect>(this); interpreterAspect->setSettingsKey("PythonEditor.RunConfiguation.Interpreter"); interpreterAspect->setSettingsDialogId(Constants::C_PYTHONOPTIONS_PAGE_ID); - connect(interpreterAspect, &InterpreterAspect::changed, this, - [this] { d->currentInterpreterChanged(); }); - connect(PythonSettings::instance(), &PythonSettings::interpretersChanged, interpreterAspect, &InterpreterAspect::updateInterpreters); @@ -219,27 +227,17 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) }); connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); - connect(target, &Target::buildSystemUpdated, this, [this]() { d->updateExtraCompilers(); }); - d->currentInterpreterChanged(); - - connect(PySideInstaller::instance(), &PySideInstaller::pySideInstalled, this, - [this](const FilePath &python) { - if (python == aspect<InterpreterAspect>()->currentInterpreter().command) - d->checkForPySide(python); - }); + connect(target, &Target::buildSystemUpdated, this, [this, interpreterAspect] { interpreterAspect->updateExtraCompilers(); }); } -PythonRunConfiguration::~PythonRunConfiguration() -{ - delete d; -} +PythonRunConfiguration::~PythonRunConfiguration() = default; -void PythonRunConfigurationPrivate::checkForPySide(const FilePath &python) +void PythonInterpreterAspect::checkForPySide(const FilePath &python) { checkForPySide(python, "PySide6-Essentials"); } -void PythonRunConfigurationPrivate::checkForPySide(const FilePath &python, +void PythonInterpreterAspect::checkForPySide(const FilePath &python, const QString &pySidePackageName) { const PipPackage package(pySidePackageName); @@ -252,7 +250,7 @@ void PythonRunConfigurationPrivate::checkForPySide(const FilePath &python, ExtensionSystem::PluginManager::futureSynchronizer()->addFuture(future); } -void PythonRunConfigurationPrivate::handlePySidePackageInfo(const PipPackageInfo &pySideInfo, +void PythonInterpreterAspect::handlePySidePackageInfo(const PipPackageInfo &pySideInfo, const Utils::FilePath &python, const QString &requestedPackageName) { @@ -308,9 +306,9 @@ void PythonRunConfigurationPrivate::handlePySidePackageInfo(const PipPackageInfo pySideBuildStep->updatePySideProjectPath(pythonTools.pySideProjectPath); } -void PythonRunConfigurationPrivate::currentInterpreterChanged() +void PythonInterpreterAspect::currentInterpreterChanged() { - const FilePath python = q->aspect<InterpreterAspect>()->currentInterpreter().command; + const FilePath python = currentInterpreter().command; checkForPySide(python); for (FilePath &file : q->project()->files(Project::AllFiles)) { @@ -326,10 +324,10 @@ void PythonRunConfigurationPrivate::currentInterpreterChanged() QList<PySideUicExtraCompiler *> PythonRunConfiguration::extraCompilers() const { - return d->m_extraCompilers; + return static_cast<PythonInterpreterAspect *>(aspect<InterpreterAspect>())->m_extraCompilers; } -void PythonRunConfigurationPrivate::updateExtraCompilers() +void PythonInterpreterAspect::updateExtraCompilers() { QList<PySideUicExtraCompiler *> oldCompilers = m_extraCompilers; m_extraCompilers.clear(); diff --git a/src/plugins/python/pythonrunconfiguration.h b/src/plugins/python/pythonrunconfiguration.h index 86d174af1a0..81b6a851ce9 100644 --- a/src/plugins/python/pythonrunconfiguration.h +++ b/src/plugins/python/pythonrunconfiguration.h @@ -8,7 +8,6 @@ namespace Python::Internal { -class PythonRunConfigurationPrivate; class PySideUicExtraCompiler; class PythonRunConfiguration : public ProjectExplorer::RunConfiguration @@ -20,9 +19,6 @@ public: ~PythonRunConfiguration() override; QList<PySideUicExtraCompiler *> extraCompilers() const; - -private: - PythonRunConfigurationPrivate *d = nullptr; }; class PythonRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory From 2cc4967451fabfad210935b35471ddd9d092d38e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 17:45:09 +0200 Subject: [PATCH 0126/1777] ProjectExplorer: Replace unusual ExecutableAspect constructor ... by an (only) slightly less weird setter. Helps with a more uniform aspect API. Task-number: QTCREATORBUG-29168 Change-Id: I40d2e878987ed7b817e08d250566bc548712749d Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../baremetal/baremetalrunconfiguration.cpp | 6 +- src/plugins/boot2qt/qdbrunconfiguration.cpp | 3 +- src/plugins/ios/iosrunconfiguration.cpp | 3 +- .../mesonrunconfiguration.cpp | 4 +- .../nim/project/nimblerunconfiguration.cpp | 10 +- .../nim/project/nimrunconfiguration.cpp | 4 +- .../customexecutablerunconfiguration.cpp | 3 +- .../desktoprunconfiguration.cpp | 4 +- .../runconfigurationaspects.cpp | 11 ++- .../projectexplorer/runconfigurationaspects.h | 4 +- src/plugins/qnx/qnxrunconfiguration.cpp | 97 ++++++++++--------- src/plugins/remotelinux/makeinstallstep.cpp | 4 +- .../remotelinuxcustomrunconfiguration.cpp | 3 +- .../remotelinuxrunconfiguration.cpp | 3 +- 14 files changed, 89 insertions(+), 70 deletions(-) diff --git a/src/plugins/baremetal/baremetalrunconfiguration.cpp b/src/plugins/baremetal/baremetalrunconfiguration.cpp index bc880467903..b4a10baaf5a 100644 --- a/src/plugins/baremetal/baremetalrunconfiguration.cpp +++ b/src/plugins/baremetal/baremetalrunconfiguration.cpp @@ -25,7 +25,8 @@ public: explicit BareMetalRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - const auto exeAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); + const auto exeAspect = addAspect<ExecutableAspect>(); + exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); exeAspect->setPlaceHolderText(Tr::tr("Unknown")); addAspect<ArgumentsAspect>(macroExpander()); @@ -46,7 +47,8 @@ public: explicit BareMetalCustomRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - const auto exeAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); + const auto exeAspect = addAspect<ExecutableAspect>(); + exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); exeAspect->setSettingsKey("BareMetal.CustomRunConfig.Executable"); exeAspect->setPlaceHolderText(Tr::tr("Unknown")); exeAspect->setReadOnly(false); diff --git a/src/plugins/boot2qt/qdbrunconfiguration.cpp b/src/plugins/boot2qt/qdbrunconfiguration.cpp index e936d3ebc68..28853877642 100644 --- a/src/plugins/boot2qt/qdbrunconfiguration.cpp +++ b/src/plugins/boot2qt/qdbrunconfiguration.cpp @@ -67,7 +67,8 @@ private: QdbRunConfiguration::QdbRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto exeAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); + auto exeAspect = addAspect<ExecutableAspect>(); + exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); exeAspect->setSettingsKey("QdbRunConfig.RemoteExecutable"); exeAspect->setLabelText(Tr::tr("Executable on device:")); exeAspect->setPlaceHolderText(Tr::tr("Remote path not set")); diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index d10ddbe4d80..15e774248ea 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -58,7 +58,8 @@ static IosDeviceType toIosDeviceType(const SimulatorInfo &device) IosRunConfiguration::IosRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto executableAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); + auto executableAspect = addAspect<ExecutableAspect>(); + executableAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); addAspect<ArgumentsAspect>(macroExpander()); diff --git a/src/plugins/mesonprojectmanager/mesonrunconfiguration.cpp b/src/plugins/mesonprojectmanager/mesonrunconfiguration.cpp index 74919a49696..e75d4c83f7a 100644 --- a/src/plugins/mesonprojectmanager/mesonrunconfiguration.cpp +++ b/src/plugins/mesonprojectmanager/mesonrunconfiguration.cpp @@ -26,7 +26,9 @@ public: auto envAspect = addAspect<EnvironmentAspect>(); envAspect->setSupportForBuildEnvironment(target); - addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); + auto exeAspect = addAspect<ExecutableAspect>(); + exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); + addAspect<ArgumentsAspect>(macroExpander()); addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); addAspect<TerminalAspect>(); diff --git a/src/plugins/nim/project/nimblerunconfiguration.cpp b/src/plugins/nim/project/nimblerunconfiguration.cpp index 8fa24ee33e4..baf4e001975 100644 --- a/src/plugins/nim/project/nimblerunconfiguration.cpp +++ b/src/plugins/nim/project/nimblerunconfiguration.cpp @@ -29,7 +29,9 @@ public: auto envAspect = addAspect<EnvironmentAspect>(); envAspect->setSupportForBuildEnvironment(target); - addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); + auto exeAspect = addAspect<ExecutableAspect>(); + exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); + addAspect<ArgumentsAspect>(macroExpander()); addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); addAspect<TerminalAspect>(); @@ -64,8 +66,10 @@ public: NimbleTestConfiguration(ProjectExplorer::Target *target, Utils::Id id) : RunConfiguration(target, id) { - addAspect<ExecutableAspect>(target, ExecutableAspect::BuildDevice) - ->setExecutable(Nim::nimblePathFromKit(target->kit())); + auto exeAspect = addAspect<ExecutableAspect>(); + exeAspect->setDeviceSelector(target, ExecutableAspect::BuildDevice); + exeAspect->setExecutable(Nim::nimblePathFromKit(target->kit())); + addAspect<ArgumentsAspect>(macroExpander())->setArguments("test"); addAspect<WorkingDirectoryAspect>(macroExpander(), nullptr) ->setDefaultWorkingDirectory(project()->projectDirectory()); diff --git a/src/plugins/nim/project/nimrunconfiguration.cpp b/src/plugins/nim/project/nimrunconfiguration.cpp index 79eeeb898dd..790557c2117 100644 --- a/src/plugins/nim/project/nimrunconfiguration.cpp +++ b/src/plugins/nim/project/nimrunconfiguration.cpp @@ -29,7 +29,9 @@ public: auto envAspect = addAspect<EnvironmentAspect>(); envAspect->setSupportForBuildEnvironment(target); - addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); + auto exeAspect = addAspect<ExecutableAspect>(); + exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); + addAspect<ArgumentsAspect>(macroExpander()); addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); addAspect<TerminalAspect>(); diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index 1673c874d53..c8f4a5a42dc 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -26,7 +26,8 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *targe auto envAspect = addAspect<EnvironmentAspect>(); envAspect->setSupportForBuildEnvironment(target); - auto exeAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::HostDevice); + auto exeAspect = addAspect<ExecutableAspect>(); + exeAspect->setDeviceSelector(target, ExecutableAspect::HostDevice); exeAspect->setSettingsKey("ProjectExplorer.CustomExecutableRunConfiguration.Executable"); exeAspect->setReadOnly(false); exeAspect->setHistoryCompleter("Qt.CustomExecutable.History"); diff --git a/src/plugins/projectexplorer/desktoprunconfiguration.cpp b/src/plugins/projectexplorer/desktoprunconfiguration.cpp index 8b8cdf2b793..8d7329a1d54 100644 --- a/src/plugins/projectexplorer/desktoprunconfiguration.cpp +++ b/src/plugins/projectexplorer/desktoprunconfiguration.cpp @@ -45,7 +45,9 @@ DesktopRunConfiguration::DesktopRunConfiguration(Target *target, Id id, Kind kin auto envAspect = addAspect<EnvironmentAspect>(); envAspect->setSupportForBuildEnvironment(target); - addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); + auto exeAspect = addAspect<ExecutableAspect>(); + exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); + addAspect<ArgumentsAspect>(macroExpander()); addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); addAspect<TerminalAspect>(); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index a2bee30265f..ed7b2cb8273 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -495,8 +495,8 @@ void ArgumentsAspect::addToLayout(LayoutItem &builder) by the build system's parsing results with an optional manual override. */ -ExecutableAspect::ExecutableAspect(Target *target, ExecutionDeviceSelector selector) - : m_target(target), m_selector(selector) +ExecutableAspect::ExecutableAspect(AspectContainer *container) + : BaseAspect(container) { setDisplayName(Tr::tr("Executable")); setId("ExecutableAspect"); @@ -506,8 +506,6 @@ ExecutableAspect::ExecutableAspect(Target *target, ExecutionDeviceSelector selec m_executable.setPlaceHolderText(Tr::tr("Enter the path to the executable")); m_executable.setLabelText(Tr::tr("Executable:")); - updateDevice(); - connect(&m_executable, &StringAspect::changed, this, &ExecutableAspect::changed); } @@ -533,8 +531,11 @@ ExecutableAspect::~ExecutableAspect() m_alternativeExecutable = nullptr; } -void ExecutableAspect::updateDevice() +void ExecutableAspect::setDeviceSelector(Target *target, ExecutionDeviceSelector selector) { + m_target = target; + m_selector = selector; + const IDevice::ConstPtr dev = executionDevice(m_target, m_selector); const OsType osType = dev ? dev->osType() : HostOsInfo::hostOs(); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index 6c58a660722..35081838934 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -155,12 +155,13 @@ class PROJECTEXPLORER_EXPORT ExecutableAspect : public Utils::BaseAspect public: enum ExecutionDeviceSelector { HostDevice, BuildDevice, RunDevice }; - explicit ExecutableAspect(Target *target, ExecutionDeviceSelector selector); + explicit ExecutableAspect(Utils::AspectContainer *container = nullptr); ~ExecutableAspect() override; Utils::FilePath executable() const; void setExecutable(const Utils::FilePath &executable); + void setDeviceSelector(Target *target, ExecutionDeviceSelector selector); void setSettingsKey(const QString &key); void makeOverridable(const QString &overridingKey, const QString &useOverridableKey); void addToLayout(Layouting::LayoutItem &parent) override; @@ -182,7 +183,6 @@ protected: private: QString executableText() const; - void updateDevice(); Utils::FilePathAspect m_executable; Utils::FilePathAspect *m_alternativeExecutable = nullptr; diff --git a/src/plugins/qnx/qnxrunconfiguration.cpp b/src/plugins/qnx/qnxrunconfiguration.cpp index 3367250969b..3b389049cf0 100644 --- a/src/plugins/qnx/qnxrunconfiguration.cpp +++ b/src/plugins/qnx/qnxrunconfiguration.cpp @@ -22,59 +22,60 @@ using namespace Utils; namespace Qnx::Internal { -class QnxRunConfiguration final : public ProjectExplorer::RunConfiguration +class QnxRunConfiguration final : public RunConfiguration { public: - QnxRunConfiguration(ProjectExplorer::Target *target, Utils::Id id); + QnxRunConfiguration(Target *target, Id id) + : RunConfiguration(target, id) + { + auto exeAspect = addAspect<ExecutableAspect>(); + exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); + exeAspect->setLabelText(Tr::tr("Executable on device:")); + exeAspect->setPlaceHolderText(Tr::tr("Remote path not set")); + exeAspect->makeOverridable("RemoteLinux.RunConfig.AlternateRemoteExecutable", + "RemoteLinux.RunConfig.UseAlternateRemoteExecutable"); + exeAspect->setHistoryCompleter("RemoteLinux.AlternateExecutable.History"); + + auto symbolsAspect = addAspect<SymbolFileAspect>(); + symbolsAspect->setLabelText(Tr::tr("Executable on host:")); + symbolsAspect->setDisplayStyle(SymbolFileAspect::LabelDisplay); + + auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(target); + + addAspect<ArgumentsAspect>(macroExpander()); + addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); + addAspect<TerminalAspect>(); + + auto libAspect = addAspect<StringAspect>(); + libAspect->setSettingsKey("Qt4ProjectManager.QnxRunConfiguration.QtLibPath"); + libAspect->setLabelText(Tr::tr("Path to Qt libraries on device")); + libAspect->setDisplayStyle(StringAspect::LineEditDisplay); + + setUpdater([this, target, exeAspect, symbolsAspect] { + const BuildTargetInfo bti = buildTargetInfo(); + const FilePath localExecutable = bti.targetFilePath; + const DeployableFile depFile = target->deploymentData() + .deployableForLocalFile(localExecutable); + exeAspect->setExecutable(FilePath::fromString(depFile.remoteFilePath())); + symbolsAspect->setValue(localExecutable); + }); + + setRunnableModifier([libAspect](Runnable &r) { + QString libPath = libAspect->value(); + if (!libPath.isEmpty()) { + r.environment.appendOrSet("LD_LIBRARY_PATH", libPath + "/lib:$LD_LIBRARY_PATH"); + r.environment.appendOrSet("QML_IMPORT_PATH", libPath + "/imports:$QML_IMPORT_PATH"); + r.environment.appendOrSet("QML2_IMPORT_PATH", libPath + "/qml:$QML2_IMPORT_PATH"); + r.environment.appendOrSet("QT_PLUGIN_PATH", libPath + "/plugins:$QT_PLUGIN_PATH"); + r.environment.set("QT_QPA_FONTDIR", libPath + "/lib/fonts"); + } + }); + + connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); + } }; -QnxRunConfiguration::QnxRunConfiguration(Target *target, Id id) - : RunConfiguration(target, id) -{ - auto exeAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); - exeAspect->setLabelText(Tr::tr("Executable on device:")); - exeAspect->setPlaceHolderText(Tr::tr("Remote path not set")); - exeAspect->makeOverridable("RemoteLinux.RunConfig.AlternateRemoteExecutable", - "RemoteLinux.RunConfig.UseAlternateRemoteExecutable"); - exeAspect->setHistoryCompleter("RemoteLinux.AlternateExecutable.History"); - auto symbolsAspect = addAspect<SymbolFileAspect>(); - symbolsAspect->setLabelText(Tr::tr("Executable on host:")); - symbolsAspect->setDisplayStyle(SymbolFileAspect::LabelDisplay); - - auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(target); - - addAspect<ArgumentsAspect>(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); - addAspect<TerminalAspect>(); - - auto libAspect = addAspect<StringAspect>(); - libAspect->setSettingsKey("Qt4ProjectManager.QnxRunConfiguration.QtLibPath"); - libAspect->setLabelText(Tr::tr("Path to Qt libraries on device")); - libAspect->setDisplayStyle(StringAspect::LineEditDisplay); - - setUpdater([this, target, exeAspect, symbolsAspect] { - const BuildTargetInfo bti = buildTargetInfo(); - const FilePath localExecutable = bti.targetFilePath; - const DeployableFile depFile = target->deploymentData() - .deployableForLocalFile(localExecutable); - exeAspect->setExecutable(FilePath::fromString(depFile.remoteFilePath())); - symbolsAspect->setValue(localExecutable); - }); - - setRunnableModifier([libAspect](Runnable &r) { - QString libPath = libAspect->value(); - if (!libPath.isEmpty()) { - r.environment.appendOrSet("LD_LIBRARY_PATH", libPath + "/lib:$LD_LIBRARY_PATH"); - r.environment.appendOrSet("QML_IMPORT_PATH", libPath + "/imports:$QML_IMPORT_PATH"); - r.environment.appendOrSet("QML2_IMPORT_PATH", libPath + "/qml:$QML2_IMPORT_PATH"); - r.environment.appendOrSet("QT_PLUGIN_PATH", libPath + "/plugins:$QT_PLUGIN_PATH"); - r.environment.set("QT_QPA_FONTDIR", libPath + "/lib/fonts"); - } - }); - - connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); -} // QnxRunConfigurationFactory diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 5a156329eb5..b11b9b82f63 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -87,8 +87,8 @@ MakeInstallStep::MakeInstallStep(BuildStepList *parent, Id id) : MakeStep(parent rootPath = FilePath::fromString(tmpDir.path()); } - const auto makeAspect = addAspect<ExecutableAspect>(parent->target(), - ExecutableAspect::BuildDevice); + const auto makeAspect = addAspect<ExecutableAspect>(); + makeAspect->setDeviceSelector(parent->target(), ExecutableAspect::BuildDevice); makeAspect->setId(MakeAspectId); makeAspect->setSettingsKey(MakeAspectId); makeAspect->setReadOnly(false); diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp index f431cdf2d3b..a2707180260 100644 --- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp @@ -34,7 +34,8 @@ RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *tar { auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(target); - auto exeAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); + auto exeAspect = addAspect<ExecutableAspect>(); + exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); exeAspect->setSettingsKey("RemoteLinux.CustomRunConfig.RemoteExecutable"); exeAspect->setLabelText(Tr::tr("Remote executable:")); exeAspect->setReadOnly(false); diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 32948f7c9f8..8dcb286589c 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -35,7 +35,8 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Id id) { auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(target); - auto exeAspect = addAspect<ExecutableAspect>(target, ExecutableAspect::RunDevice); + auto exeAspect = addAspect<ExecutableAspect>(); + exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); exeAspect->setLabelText(Tr::tr("Executable on device:")); exeAspect->setPlaceHolderText(Tr::tr("Remote path not set")); exeAspect->makeOverridable("RemoteLinux.RunConfig.AlternateRemoteExecutable", From d0d1e1af1f148c820637ae3d79d9632659b13fbe Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 17:21:18 +0200 Subject: [PATCH 0127/1777] A few more direct FilePathAspect value accesses Task-number: QTCREATORBUG-29167 Change-Id: I8eba582303c16dddbdb5cea5bce43f048bac06b7 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/python/pythonwizardpage.cpp | 4 ++-- src/plugins/qmlprofiler/qmlprofilertool.cpp | 6 +++--- src/plugins/terminal/terminalwidget.cpp | 2 +- src/plugins/valgrind/valgrindsettings.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/python/pythonwizardpage.cpp b/src/plugins/python/pythonwizardpage.cpp index 4a8fb800c70..f74e5a90b72 100644 --- a/src/plugins/python/pythonwizardpage.cpp +++ b/src/plugins/python/pythonwizardpage.cpp @@ -132,7 +132,7 @@ void PythonWizardPage::initializePage() const FilePath projectDir = FilePath::fromString(wiz->property("ProjectDirectory").toString()); m_createVenv.setValue(!projectDir.isEmpty()); - if (m_venvPath.filePath().isEmpty()) + if (m_venvPath().isEmpty()) m_venvPath.setValue(projectDir.isEmpty() ? FilePath{} : projectDir / "venv"); updateInterpreters(); @@ -171,7 +171,7 @@ void PythonWizardPage::setupProject(const JsonWizard::GeneratorFiles &files) } } }; - PythonSettings::createVirtualEnvironment(m_venvPath.filePath(), + PythonSettings::createVirtualEnvironment(m_venvPath(), interpreter, openProjectWithInterpreter, project ? project->displayName() diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index e84a27531af..c87562e3f9b 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -567,7 +567,7 @@ void QmlProfilerTool::showErrorDialog(const QString &error) static void saveLastTraceFile(const FilePath &filePath) { QmlProfilerSettings *settings = QmlProfilerPlugin::globalSettings(); - if (filePath != settings->lastTraceFile.filePath()) { + if (filePath != settings->lastTraceFile()) { settings->lastTraceFile.setValue(filePath); settings->writeGlobalSettings(); } @@ -579,7 +579,7 @@ void QmlProfilerTool::showSaveDialog() QLatin1String zFile(QztFileExtension); FilePath filePath = FileUtils::getSaveFilePath( nullptr, Tr::tr("Save QML Trace"), - QmlProfilerPlugin::globalSettings()->lastTraceFile.filePath(), + QmlProfilerPlugin::globalSettings()->lastTraceFile(), Tr::tr("QML traces (*%1 *%2)").arg(zFile).arg(tFile)); if (!filePath.isEmpty()) { if (!filePath.endsWith(zFile) && !filePath.endsWith(tFile)) @@ -603,7 +603,7 @@ void QmlProfilerTool::showLoadDialog() QLatin1String zFile(QztFileExtension); FilePath filePath = FileUtils::getOpenFilePath( nullptr, Tr::tr("Load QML Trace"), - QmlProfilerPlugin::globalSettings()->lastTraceFile.filePath(), + QmlProfilerPlugin::globalSettings()->lastTraceFile(), Tr::tr("QML traces (*%1 *%2)").arg(zFile).arg(tFile)); if (!filePath.isEmpty()) { diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 4b6442753e1..de464b326cb 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -142,7 +142,7 @@ void TerminalWidget::setupPty() m_process = std::make_unique<Process>(); CommandLine shellCommand = m_openParameters.shellCommand.value_or( - CommandLine{TerminalSettings::instance().shell.filePath(), + CommandLine{TerminalSettings::instance().shell(), TerminalSettings::instance().shellArguments.value(), CommandLine::Raw}); diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 1dbcef72035..6140760b283 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -64,7 +64,7 @@ void SuppressionAspectPrivate::slotAddSuppression() const FilePaths files = FileUtils::getOpenFilePaths(nullptr, Tr::tr("Valgrind Suppression Files"), - conf->lastSuppressionDirectory.filePath(), + conf->lastSuppressionDirectory(), Tr::tr("Valgrind Suppression File (*.supp);;All Files (*)")); //dialog.setHistory(conf->lastSuppressionDialogHistory()); if (!files.isEmpty()) { From 941c99c893837485ab97fbe711063683dd943b94 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 18:12:48 +0200 Subject: [PATCH 0128/1777] Boot2Qt: Use direct aspect registration in QdbMakeDefaultAppStep Task-number: QTCREATORBUG-29168 Change-Id: I06c28f864cc9a517cfb8183ef2dfa366310438df Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/boot2qt/qdbmakedefaultappstep.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/plugins/boot2qt/qdbmakedefaultappstep.cpp b/src/plugins/boot2qt/qdbmakedefaultappstep.cpp index ae5806deb95..b02beff5307 100644 --- a/src/plugins/boot2qt/qdbmakedefaultappstep.cpp +++ b/src/plugins/boot2qt/qdbmakedefaultappstep.cpp @@ -28,15 +28,11 @@ public: QdbMakeDefaultAppStep(BuildStepList *bsl, Id id) : AbstractRemoteLinuxDeployStep(bsl, id) { - auto selection = addAspect<SelectionAspect>(); - selection->setSettingsKey("QdbMakeDefaultDeployStep.MakeDefault"); - selection->addOption(Tr::tr("Set this application to start by default")); - selection->addOption(Tr::tr("Reset default application")); + selection.setSettingsKey("QdbMakeDefaultDeployStep.MakeDefault"); + selection.addOption(Tr::tr("Set this application to start by default")); + selection.addOption(Tr::tr("Reset default application")); - setInternalInitializer([this, selection] { - m_makeDefault = selection->value() == 0; - return isDeploymentPossible(); - }); + setInternalInitializer([this] { return isDeploymentPossible(); }); } private: @@ -49,7 +45,7 @@ private: remoteExe = exeAspect->executable().nativePath(); } CommandLine cmd{deviceConfiguration()->filePath(Constants::AppcontrollerFilepath)}; - if (m_makeDefault && !remoteExe.isEmpty()) + if (selection() == 0 && !remoteExe.isEmpty()) cmd.addArgs({"--make-default", remoteExe}); else cmd.addArg("--remove-default"); @@ -60,7 +56,7 @@ private: }); }; const auto doneHandler = [this](const Process &) { - if (m_makeDefault) + if (selection() == 0) addProgressMessage(Tr::tr("Application set as the default one.")); else addProgressMessage(Tr::tr("Reset the default application.")); @@ -71,7 +67,7 @@ private: return Group { ProcessTask(setupHandler, doneHandler, errorHandler) }; } - bool m_makeDefault = true; + SelectionAspect selection{this}; }; // QdbMakeDefaultAppStepFactory From e53bc1630a503848236ddc3f26919bd031b848b0 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 18:00:06 +0200 Subject: [PATCH 0129/1777] AutoTools: Use direct aspect registration in AutoreconfStep Task-number: QTCREATORBUG-29168 Change-Id: I886e84a752031cabb8bf235dc4e83c8f78ae88cb Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../autoreconfstep.cpp | 90 +++++++++---------- 1 file changed, 43 insertions(+), 47 deletions(-) diff --git a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp index a238f41b688..a32191be83b 100644 --- a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp @@ -11,7 +11,6 @@ #include <projectexplorer/processparameters.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/target.h> #include <utils/aspects.h> @@ -34,58 +33,55 @@ namespace AutotoolsProjectManager::Internal { class AutoreconfStep final : public AbstractProcessStep { public: - AutoreconfStep(BuildStepList *bsl, Id id); + AutoreconfStep(BuildStepList *bsl, Id id) + : AbstractProcessStep(bsl, id) + { + arguments.setSettingsKey("AutotoolsProjectManager.AutoreconfStep.AdditionalArguments"); + arguments.setLabelText(Tr::tr("Arguments:")); + arguments.setValue("--force --install"); + arguments.setDisplayStyle(StringAspect::LineEditDisplay); + arguments.setHistoryCompleter("AutotoolsPM.History.AutoreconfStepArgs"); - void doRun() override; + connect(&arguments, &BaseAspect::changed, this, [this] { m_runAutoreconf = true; }); + + setCommandLineProvider([this] { + return CommandLine("autoreconf", arguments(), CommandLine::Raw); + }); + + setWorkingDirectoryProvider([this] { + return project()->projectDirectory(); + }); + + setSummaryUpdater([this] { + ProcessParameters param; + setupProcessParameters(¶m); + return param.summary(displayName()); + }); + } + + void doRun() override + { + // Check whether we need to run autoreconf + const FilePath configure = project()->projectDirectory() / "configure"; + if (!configure.exists()) + m_runAutoreconf = true; + + if (!m_runAutoreconf) { + emit addOutput(Tr::tr("Configuration unchanged, skipping autoreconf step."), + OutputFormat::NormalMessage); + emit finished(true); + return; + } + + m_runAutoreconf = false; + AbstractProcessStep::doRun(); + } private: bool m_runAutoreconf = false; + StringAspect arguments{this}; }; -AutoreconfStep::AutoreconfStep(BuildStepList *bsl, Id id) - : AbstractProcessStep(bsl, id) -{ - auto arguments = addAspect<StringAspect>(); - arguments->setSettingsKey("AutotoolsProjectManager.AutoreconfStep.AdditionalArguments"); - arguments->setLabelText(Tr::tr("Arguments:")); - arguments->setValue("--force --install"); - arguments->setDisplayStyle(StringAspect::LineEditDisplay); - arguments->setHistoryCompleter("AutotoolsPM.History.AutoreconfStepArgs"); - - connect(arguments, &BaseAspect::changed, this, [this] { - m_runAutoreconf = true; - }); - - setCommandLineProvider([arguments] { - return CommandLine("autoreconf", arguments->value(), CommandLine::Raw); - }); - - setWorkingDirectoryProvider([this] { return project()->projectDirectory(); }); - - setSummaryUpdater([this] { - ProcessParameters param; - setupProcessParameters(¶m); - return param.summary(displayName()); - }); -} - -void AutoreconfStep::doRun() -{ - // Check whether we need to run autoreconf - const FilePath configure = project()->projectDirectory() / "configure"; - if (!configure.exists()) - m_runAutoreconf = true; - - if (!m_runAutoreconf) { - emit addOutput(Tr::tr("Configuration unchanged, skipping autoreconf step."), - OutputFormat::NormalMessage); - emit finished(true); - return; - } - - m_runAutoreconf = false; - AbstractProcessStep::doRun(); -} // AutoreconfStepFactory From ae7e72cca51e309b50056fa095f3e913906f367c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 18:24:01 +0200 Subject: [PATCH 0130/1777] RemoteLinux: More direct aspect use in CustomCommandDeployStep Change-Id: I5c5d993e97396bfa2bf52e6c2a01801703071929 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../remotelinux/customcommanddeploystep.cpp | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/plugins/remotelinux/customcommanddeploystep.cpp b/src/plugins/remotelinux/customcommanddeploystep.cpp index 32076d34f27..7fd74a94909 100644 --- a/src/plugins/remotelinux/customcommanddeploystep.cpp +++ b/src/plugins/remotelinux/customcommanddeploystep.cpp @@ -25,16 +25,12 @@ public: CustomCommandDeployStep(BuildStepList *bsl, Id id) : AbstractRemoteLinuxDeployStep(bsl, id) { - auto commandLine = addAspect<StringAspect>(); - commandLine->setSettingsKey("RemoteLinuxCustomCommandDeploymentStep.CommandLine"); - commandLine->setLabelText(Tr::tr("Command line:")); - commandLine->setDisplayStyle(StringAspect::LineEditDisplay); - commandLine->setHistoryCompleter("RemoteLinuxCustomCommandDeploymentStep.History"); + commandLine.setSettingsKey("RemoteLinuxCustomCommandDeploymentStep.CommandLine"); + commandLine.setLabelText(Tr::tr("Command line:")); + commandLine.setDisplayStyle(StringAspect::LineEditDisplay); + commandLine.setHistoryCompleter("RemoteLinuxCustomCommandDeploymentStep.History"); - setInternalInitializer([this, commandLine] { - m_commandLine = commandLine->value().trimmed(); - return isDeploymentPossible(); - }); + setInternalInitializer([this] { return isDeploymentPossible(); }); addMacroExpander(); } @@ -44,12 +40,12 @@ public: private: Group deployRecipe() final; - QString m_commandLine; + StringAspect commandLine{this}; }; CheckResult CustomCommandDeployStep::isDeploymentPossible() const { - if (m_commandLine.isEmpty()) + if (commandLine().isEmpty()) return CheckResult::failure(Tr::tr("No command line given.")); return AbstractRemoteLinuxDeployStep::isDeploymentPossible(); @@ -58,9 +54,9 @@ CheckResult CustomCommandDeployStep::isDeploymentPossible() const Group CustomCommandDeployStep::deployRecipe() { const auto setupHandler = [this](Process &process) { - addProgressMessage(Tr::tr("Starting remote command \"%1\"...").arg(m_commandLine)); + addProgressMessage(Tr::tr("Starting remote command \"%1\"...").arg(commandLine())); process.setCommand({deviceConfiguration()->filePath("/bin/sh"), - {"-c", m_commandLine}}); + {"-c", commandLine()}}); Process *proc = &process; connect(proc, &Process::readyReadStandardOutput, this, [this, proc] { handleStdOutData(proc->readAllStandardOutput()); From ce3530033d2618ee368b4dd649c25706118c20d5 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@gmail.com> Date: Mon, 3 Jul 2023 16:45:17 +0200 Subject: [PATCH 0131/1777] Vcpkg: Detect vcpkg root from path Change-Id: Ieff796b228fba9cb5bddc6a012da0eacb1bfa43f Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/vcpkg/vcpkgconstants.h | 1 + src/plugins/vcpkg/vcpkgsettings.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/vcpkg/vcpkgconstants.h b/src/plugins/vcpkg/vcpkgconstants.h index 644dfab95f9..19136ba9f53 100644 --- a/src/plugins/vcpkg/vcpkgconstants.h +++ b/src/plugins/vcpkg/vcpkgconstants.h @@ -8,6 +8,7 @@ namespace Vcpkg::Constants { const char TOOLSSETTINGSPAGE_ID[] = "Vcpkg.VcpkgSettings"; const char WEBSITE_URL[] = "https://vcpkg.io/"; const char ENVVAR_VCPKG_ROOT[] = "VCPKG_ROOT"; +const char VCPKG_COMMAND[] = "vcpkg"; const char VCPKGMANIFEST_EDITOR_ID[] = "Vcpkg.VcpkgManifestEditor"; const char VCPKGMANIFEST_MIMETYPE[] = "application/vcpkg.manifest+json"; diff --git a/src/plugins/vcpkg/vcpkgsettings.cpp b/src/plugins/vcpkg/vcpkgsettings.cpp index 7c26af9fda3..aa223651cf2 100644 --- a/src/plugins/vcpkg/vcpkgsettings.cpp +++ b/src/plugins/vcpkg/vcpkgsettings.cpp @@ -37,8 +37,12 @@ VcpkgSettings::VcpkgSettings() vcpkgRoot.setSettingsKey("VcpkgRoot"); vcpkgRoot.setExpectedKind(PathChooser::ExistingDirectory); - vcpkgRoot.setDefaultValue( - FilePath::fromUserInput(qtcEnvironmentVariable(Constants::ENVVAR_VCPKG_ROOT))); + FilePath defaultPath = Environment::systemEnvironment().searchInPath(Constants::VCPKG_COMMAND) + .parentDir(); + if (!defaultPath.isDir()) + defaultPath = FilePath::fromUserInput(qtcEnvironmentVariable(Constants::ENVVAR_VCPKG_ROOT)); + if (defaultPath.isDir()) + vcpkgRoot.setDefaultValue(defaultPath); setLayouter([this] { using namespace Layouting; From f6fb693b3844ca4bfaf4cd5df367313044730b5f Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 4 Jul 2023 15:12:05 +0200 Subject: [PATCH 0132/1777] Utils: fix emitting FancyLineEdit::validChanged after delayed validation Change-Id: I0688f21020517ccf45011f8e0b1a5aeb8b1b4f2c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/fancylineedit.cpp | 1 - src/libs/utils/fancylineedit.h | 2 +- src/libs/utils/projectintropage.cpp | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index e46ca6b8460..2ed8beabc5e 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -579,7 +579,6 @@ void FancyLineEdit::validate() handleValidationResult(result, oldText); }); - d->m_state = Validating; d->m_spinnerDelayTimer.start(); AsyncValidationFuture future = validationFunction(text()); diff --git a/src/libs/utils/fancylineedit.h b/src/libs/utils/fancylineedit.h index 27a36974e44..9f1e1693984 100644 --- a/src/libs/utils/fancylineedit.h +++ b/src/libs/utils/fancylineedit.h @@ -106,7 +106,7 @@ public: using SynchronousValidationFunction = std::function<bool(FancyLineEdit *, QString *)>; using ValidationFunction = std::variant<AsyncValidationFunction, SynchronousValidationFunction>; - enum State { Invalid, DisplayingPlaceholderText, Valid, Validating }; + enum State { Invalid, DisplayingPlaceholderText, Valid }; State state() const; bool isValid() const; diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index 8452f48c50b..0b1a0a63557 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -212,8 +212,6 @@ bool ProjectIntroPage::validate() return false; case FancyLineEdit::Valid: break; - case FancyLineEdit::Validating: - break; } // Check existence of the directory From 52bc1578e52b538654f1526f8d175903c843aff0 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 5 Jul 2023 07:37:22 +0200 Subject: [PATCH 0133/1777] QmlPuppet: Fix build Change-Id: Ieb459d5dbab7ceba3965a1657b2411cbacac258a Reviewed-by: hjk <hjk@qt.io> --- .../qml2puppet/instances/qt5informationnodeinstanceserver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/qml2puppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/src/tools/qml2puppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index b4c47a0a2a9..c5b3c184838 100644 --- a/src/tools/qml2puppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/src/tools/qml2puppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -2367,6 +2367,8 @@ QVariantList Qt5InformationNodeInstanceServer::alignCameraList() const } return cameras; +#else + return {}; #endif } From 1fc0ca527733f64250563373d576f6ee5d3bc5bc Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Tue, 27 Jun 2023 16:57:51 +0200 Subject: [PATCH 0134/1777] DAP: Add CMake support to DAP engine Added CMake support to the DAP engine in Qt Creator. This feature can be enabled by setting the environment variable QTC_USE_CMAKE_DEBUGGER. CMake debug session can be started by clicking "Run CMake" or "Run". Note: Doesn't work with "Run debugging" in this patch. Works only with cmake 3.27.0 and newer. Change-Id: I756ea57f507aa4a6621ad62a8c0ef52c44a5185d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- .../cmakeprojectmanager/cmakeprocess.cpp | 24 ++ src/plugins/debugger/dap/dapengine.cpp | 262 +++++++++++++----- src/plugins/debugger/dap/dapengine.h | 28 +- src/plugins/debugger/debuggerengine.h | 1 + src/plugins/debugger/debuggerplugin.cpp | 15 + src/plugins/debugger/debuggerplugin.h | 2 + src/plugins/debugger/debuggerruncontrol.cpp | 8 + src/plugins/debugger/debuggerruncontrol.h | 1 + 8 files changed, 272 insertions(+), 69 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index 1455cbf88b9..809d508f46a 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -13,8 +13,14 @@ #include <projectexplorer/buildsystem.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/taskhub.h> +#include <projectexplorer/kitchooser.h> +#include <projectexplorer/runcontrol.h> + +#include <extensionsystem/invoker.h> +#include <extensionsystem/pluginmanager.h> #include <utils/process.h> +#include <utils/processinfo.h> #include <utils/processinterface.h> #include <utils/stringutils.h> @@ -40,6 +46,11 @@ CMakeProcess::~CMakeProcess() static const int failedToStartExitCode = 0xFF; // See ProcessPrivate::handleDone() impl +static QObject *debuggerPlugin() +{ + return ExtensionSystem::PluginManager::getObjectByName("DebuggerPlugin"); +} + void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList &arguments) { QTC_ASSERT(!m_process, return); @@ -128,6 +139,19 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & commandLine.addArgs({"-S", sourceDirectory.path(), "-B", buildDirectory.path()}); commandLine.addArgs(arguments); + if (qEnvironmentVariableIsSet("QTC_USE_CMAKE_DEBUGGER")) { + FilePath file = FilePath::fromString("/tmp/cmake-dap.sock"); + file.removeFile(); + commandLine.addArgs({"--debugger", "--debugger-pipe=/tmp/cmake-dap.sock"}); + connect(m_process.get(), &Process::started, this, [this, cmakeExecutable] { + QMetaObject::invokeMethod(debuggerPlugin(), + "attachToProcess", + Qt::QueuedConnection, + Q_ARG(qint64, m_process->processId()), + Q_ARG(const Utils::FilePath &, cmakeExecutable)); + }); + } + TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); BuildSystem::startNewBuildSystemOutput(::CMakeProjectManager::Tr::tr("Running %1 in %2.") diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 9be5fe84223..3cddfa9dc81 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -35,17 +35,109 @@ #include <QDebug> #include <QDir> #include <QFileInfo> -#include <QTimer> -#include <QVariant> #include <QJsonArray> #include <QJsonDocument> +#include <QLocalSocket> #include <QThread> +#include <QTimer> +#include <QVariant> using namespace Core; using namespace Utils; +static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengin", QtWarningMsg) + namespace Debugger::Internal { +class ProcessDataProvider : public IDataProvider +{ +public: + ProcessDataProvider(const DebuggerRunParameters &rp, const CommandLine &cmd) + : m_runParameters(rp) + , m_cmd(cmd) + { + connect(&m_proc, &Process::started, this, &IDataProvider::started); + connect(&m_proc, &Process::done, this, &IDataProvider::done); + connect(&m_proc, + &Process::readyReadStandardOutput, + this, + &IDataProvider::readyReadStandardOutput); + connect(&m_proc, + &Process::readyReadStandardError, + this, + &IDataProvider::readyReadStandardError); + } + + ~ProcessDataProvider() + { + m_proc.kill(); + m_proc.waitForFinished(); + } + + void start() override + { + m_proc.setProcessMode(ProcessMode::Writer); + m_proc.setEnvironment(m_runParameters.debugger.environment); + m_proc.setCommand(m_cmd); + m_proc.start(); + } + + bool isRunning() const override { return m_proc.isRunning(); } + void writeRaw(const QByteArray &data) override { m_proc.writeRaw(data); } + void kill() override { m_proc.kill(); } + QByteArray readAllStandardOutput() override { return m_proc.readAllStandardOutput().toUtf8(); } + QString readAllStandardError() override { return m_proc.readAllStandardError(); } + int exitCode() const override { return m_proc.exitCode(); } + QString executable() const override { return m_proc.commandLine().executable().toUserOutput(); } + + QProcess::ExitStatus exitStatus() const override { return m_proc.exitStatus(); } + QProcess::ProcessError error() const override { return m_proc.error(); } + Utils::ProcessResult result() const override { return m_proc.result(); } + QString exitMessage() const override { return m_proc.exitMessage(); }; + +private: + Utils::Process m_proc; + const DebuggerRunParameters m_runParameters; + const CommandLine m_cmd; +}; + +class LocalSocketDataProvider : public IDataProvider +{ +public: + LocalSocketDataProvider(const QString &socketName) + : m_socketName(socketName) + { + connect(&m_socket, &QLocalSocket::connected, this, &IDataProvider::started); + connect(&m_socket, &QLocalSocket::disconnected, this, &IDataProvider::done); + connect(&m_socket, &QLocalSocket::readyRead, this, &IDataProvider::readyReadStandardOutput); + connect(&m_socket, + &QLocalSocket::errorOccurred, + this, + &IDataProvider::readyReadStandardError); + } + + ~LocalSocketDataProvider() { m_socket.disconnectFromServer(); } + + void start() override { m_socket.connectToServer(m_socketName, QIODevice::ReadWrite); } + + bool isRunning() const override { return m_socket.isOpen(); } + void writeRaw(const QByteArray &data) override { m_socket.write(data); } + void kill() override { m_socket.disconnectFromServer(); } + QByteArray readAllStandardOutput() override { return m_socket.readAll(); } + QString readAllStandardError() override { return QString(); } + int exitCode() const override { return 0; } + QString executable() const override { return m_socket.serverName(); } + + QProcess::ExitStatus exitStatus() const override { return QProcess::NormalExit; } + QProcess::ProcessError error() const override { return QProcess::UnknownError; } + Utils::ProcessResult result() const override { return ProcessResult::FinishedWithSuccess; } + QString exitMessage() const override { return QString(); }; + +private: + QLocalSocket m_socket; + const QString m_socketName; +}; + DapEngine::DapEngine() { setObjectName("DapEngine"); @@ -54,7 +146,7 @@ DapEngine::DapEngine() void DapEngine::executeDebuggerCommand(const QString &/*command*/) { - QTC_ASSERT(state() == InferiorStopOk, qDebug() << state()); + QTC_ASSERT(state() == InferiorStopOk, qCDebug(dapEngineLog) << state()); // if (state() == DebuggerNotReady) { // showMessage("DAP PROCESS NOT RUNNING, PLAIN CMD IGNORED: " + command); // return; @@ -71,9 +163,9 @@ void DapEngine::postDirectCommand(const QJsonObject &ob) const QByteArray data = QJsonDocument(obseq).toJson(QJsonDocument::Compact); const QByteArray msg = "Content-Length: " + QByteArray::number(data.size()) + "\r\n\r\n" + data; - qDebug() << msg; + qCDebug(dapEngineLog) << msg; - m_proc.writeRaw(msg); + m_dataGenerator->writeRaw(msg); showMessage(QString::fromUtf8(msg), LogInput); } @@ -84,7 +176,7 @@ void DapEngine::runCommand(const DebuggerCommand &cmd) showMessage("IGNORED COMMAND: " + cmd.function); return; } - QTC_ASSERT(m_proc.isRunning(), notifyEngineIll()); + QTC_ASSERT(m_dataGenerator->isRunning(), notifyEngineIll()); // postDirectCommand(cmd.args.toObject()); // const QByteArray data = QJsonDocument(cmd.args.toObject()).toJson(QJsonDocument::Compact); // m_proc.writeRaw("Content-Length: " + QByteArray::number(data.size()) + "\r\n" + data + "\r\n"); @@ -94,38 +186,56 @@ void DapEngine::runCommand(const DebuggerCommand &cmd) void DapEngine::shutdownInferior() { - QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state()); - postDirectCommand({{"command", "terminate"}, - {"type", "request"}}); + QTC_ASSERT(state() == InferiorShutdownRequested, qCDebug(dapEngineLog) << state()); - qDebug() << "DapEngine::shutdownInferior()"; + postDirectCommand({ + {"command", "disconnect"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"restart", false}, + {"terminateDebuggee", true} + }} + }); + + qCDebug(dapEngineLog) << "DapEngine::shutdownInferior()"; notifyInferiorShutdownFinished(); } void DapEngine::shutdownEngine() { - QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << state()); + QTC_ASSERT(state() == EngineShutdownRequested, qCDebug(dapEngineLog) << state()); - qDebug() << "DapEngine::shutdownEngine()"; - m_proc.kill(); + postDirectCommand({ + {"command", "terminate"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"restart", false} + }} + }); + + qCDebug(dapEngineLog) << "DapEngine::shutdownEngine()"; + m_dataGenerator->kill(); } void DapEngine::setupEngine() { - QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); + QTC_ASSERT(state() == EngineSetupRequested, qCDebug(dapEngineLog) << state()); - connect(&m_proc, &Process::started, this, &DapEngine::handleDapStarted); - connect(&m_proc, &Process::done, this, &DapEngine::handleDapDone); - connect(&m_proc, &Process::readyReadStandardOutput, this, &DapEngine::readDapStandardOutput); - connect(&m_proc, &Process::readyReadStandardError, this, &DapEngine::readDapStandardError); + if (qEnvironmentVariableIsSet("QTC_USE_CMAKE_DEBUGGER")) { + m_dataGenerator = std::make_unique<LocalSocketDataProvider>("/tmp/cmake-dap.sock"); + } else { + const DebuggerRunParameters &rp = runParameters(); + const CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}}; + m_dataGenerator = std::make_unique<ProcessDataProvider>(rp, cmd); + } + + connect(m_dataGenerator.get(), &IDataProvider::started, this, &DapEngine::handleDapStarted); + connect(m_dataGenerator.get(), &IDataProvider::done, this, &DapEngine::handleDapDone); + connect(m_dataGenerator.get(), &IDataProvider::readyReadStandardOutput, this, &DapEngine::readDapStandardOutput); + connect(m_dataGenerator.get(), &IDataProvider::readyReadStandardError, this, &DapEngine::readDapStandardError); + + m_dataGenerator->start(); - const DebuggerRunParameters &rp = runParameters(); - const CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}}; - showMessage("STARTING " + cmd.toUserOutput()); - m_proc.setProcessMode(ProcessMode::Writer); - m_proc.setEnvironment(rp.debugger.environment); - m_proc.setCommand(cmd); - m_proc.start(); notifyEngineSetupOk(); } @@ -142,7 +252,7 @@ void DapEngine::setupEngine() void DapEngine::handleDapStarted() { - QTC_ASSERT(state() == EngineRunRequested, qDebug() << state()); + QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); // CHECK_STATE(EngineRunRequested); @@ -151,28 +261,33 @@ void DapEngine::handleDapStarted() {"type", "request"}, {"arguments", QJsonObject { {"clientID", "QtCreator"}, // The ID of the client using this adapter. - {"clientName", "QtCreator"} // The human-readable name of the client using this adapter. + {"clientName", "QtCreator"}, // The human-readable name of the client using this adapter. + {"adapterID", "cmake"}, + {"pathFormat", "path"} }} }); - qDebug() << "handleDapStarted"; + qCDebug(dapEngineLog) << "handleDapStarted"; } void DapEngine::handleDapConfigurationDone() { - QTC_ASSERT(state() == EngineRunRequested, qDebug() << state()); + QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); // CHECK_STATE(EngineRunRequested); - postDirectCommand({{"command", "configurationDone"}, {"type", "request"}}); + postDirectCommand({ + {"command", "configurationDone"}, + {"type", "request"} + }); - qDebug() << "handleDapConfigurationDone"; + qCDebug(dapEngineLog) << "handleDapConfigurationDone"; } void DapEngine::handleDapLaunch() { - QTC_ASSERT(state() == EngineRunRequested, qDebug() << state()); + QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); postDirectCommand({ {"command", "launch"}, @@ -183,7 +298,7 @@ void DapEngine::handleDapLaunch() {"__restart", ""} }} }); - qDebug() << "handleDapLaunch"; + qCDebug(dapEngineLog) << "handleDapLaunch"; } void DapEngine::interruptInferior() @@ -387,7 +502,7 @@ void DapEngine::insertBreakpoint(const Breakpoint &bp) }} }); - qDebug() << "insertBreakpoint" << bp->modelId() << bp->responseId(); + qCDebug(dapEngineLog) << "insertBreakpoint" << bp->modelId() << bp->responseId(); } void DapEngine::updateBreakpoint(const Breakpoint &bp) @@ -439,7 +554,7 @@ void DapEngine::removeBreakpoint(const Breakpoint &bp) }} }); - qDebug() << "removeBreakpoint" << bp->modelId() << bp->responseId(); + qCDebug(dapEngineLog) << "removeBreakpoint" << bp->modelId() << bp->responseId(); } void DapEngine::loadSymbols(const Utils::FilePath &/*moduleName*/) @@ -469,7 +584,7 @@ void DapEngine::refreshModules(const GdbMi &modules) if (path.size() >= 2) path.chop(2); } else if (path.startsWith("<module '") - && path.endsWith("' (built-in)>")) { + && path.endsWith("' (built-in)>")) { path = "(builtin)"; } module.modulePath = FilePath::fromString(path); @@ -533,7 +648,7 @@ void DapEngine::assignValueInDebugger(WatchItem *, const QString &/*expression*/ //cmd.arg("expression", expression); //cmd.arg("value", value.toString()); //runCommand(cmd); -// postDirectCommand("global " + expression + ';' + expression + "=" + value.toString()); + // postDirectCommand("global " + expression + ';' + expression + "=" + value.toString()); updateLocals(); } @@ -550,7 +665,7 @@ QString DapEngine::errorMessage(QProcess::ProcessError error) const return Tr::tr("The DAP process failed to start. Either the " "invoked program \"%1\" is missing, or you may have insufficient " "permissions to invoke the program.") - .arg(m_proc.commandLine().executable().toUserOutput()); + .arg(m_dataGenerator->executable()); case QProcess::Crashed: return Tr::tr("The DAP process crashed some time after starting " "successfully."); @@ -572,14 +687,14 @@ QString DapEngine::errorMessage(QProcess::ProcessError error) const void DapEngine::handleDapDone() { - if (m_proc.result() == ProcessResult::StartFailed) { + if (m_dataGenerator->result() == ProcessResult::StartFailed) { notifyEngineSetupFailed(); showMessage("ADAPTER START FAILED"); - ICore::showWarningWithOptions(Tr::tr("Adapter start failed"), m_proc.exitMessage()); + ICore::showWarningWithOptions(Tr::tr("Adapter start failed"), m_dataGenerator->exitMessage()); return; } - const QProcess::ProcessError error = m_proc.error(); + const QProcess::ProcessError error = m_dataGenerator->error(); if (error != QProcess::UnknownError) { showMessage("HANDLE DAP ERROR"); if (error != QProcess::Crashed) @@ -588,13 +703,14 @@ void DapEngine::handleDapDone() return; } showMessage(QString("DAP PROCESS FINISHED, status %1, code %2") - .arg(m_proc.exitStatus()).arg(m_proc.exitCode())); + .arg(m_dataGenerator->exitStatus()).arg(m_dataGenerator->exitCode())); notifyEngineSpontaneousShutdown(); } void DapEngine::readDapStandardError() { - QString err = m_proc.readAllStandardError(); + QString err = m_dataGenerator->readAllStandardError(); + qCDebug(dapEngineLog) << "DAP STDERR:" << err; //qWarning() << "Unexpected DAP stderr:" << err; showMessage("Unexpected DAP stderr: " + err); //handleOutput(err); @@ -602,8 +718,9 @@ void DapEngine::readDapStandardError() void DapEngine::readDapStandardOutput() { - m_inbuffer.append(m_proc.readAllStandardOutput().toUtf8()); -// qDebug() << m_inbuffer; + m_inbuffer.append(m_dataGenerator->readAllStandardOutput()); + + qCDebug(dapEngineLog) << m_inbuffer; while (true) { // Something like @@ -643,20 +760,20 @@ void DapEngine::handleOutput(const QJsonDocument &data) const QJsonValue t = ob.value("type"); const QString type = t.toString(); - qDebug() << "response" << ob; + qCDebug(dapEngineLog) << "response" << ob; if (type == "response") { const QString command = ob.value("command").toString(); if (command == "configurationDone") { showMessage("configurationDone", LogDebug); - qDebug() << "configurationDone success"; + qCDebug(dapEngineLog) << "configurationDone success"; notifyEngineRunAndInferiorRunOk(); return; } if (command == "continue") { showMessage("continue", LogDebug); - qDebug() << "continue success"; + qCDebug(dapEngineLog) << "continue success"; notifyInferiorRunOk(); return; } @@ -670,7 +787,7 @@ void DapEngine::handleOutput(const QJsonDocument &data) const FilePath file = FilePath::fromString( stackFrame.value("source").toObject().value("path").toString()); const int line = stackFrame.value("line").toInt(); - qDebug() << "stackTrace success" << file << line; + qCDebug(dapEngineLog) << "stackTrace success" << file << line; gotoLocation(Location(file, line)); refreshStack(stackFrames); @@ -684,7 +801,7 @@ void DapEngine::handleOutput(const QJsonDocument &data) for (auto scope : scopes) { const QString name = scope.toObject().value("name").toString(); const int variablesReference = scope.toObject().value("variablesReference").toInt(); - qDebug() << "scoped success" << name << variablesReference; + qCDebug(dapEngineLog) << "scoped success" << name << variablesReference; if (name == "Locals") dapVariables(variablesReference); } @@ -727,8 +844,6 @@ void DapEngine::handleOutput(const QJsonDocument &data) threadsHandler()->threadForId(QString::number(m_currentThreadId))); return; } - - } if (type == "event") { @@ -736,8 +851,16 @@ void DapEngine::handleOutput(const QJsonDocument &data) const QJsonObject body = ob.value("body").toObject(); if (event == "exited") { + postDirectCommand({ + {"command", "disconnect"}, + {"type", "request"}, + {"arguments", QJsonObject{ + {"restart", false}, + {"terminateDebuggee", true} + }} + }); + notifyInferiorExited(); - m_proc.kill(); showMessage("exited", LogDebug); return; } @@ -753,11 +876,11 @@ void DapEngine::handleOutput(const QJsonDocument &data) showMessage(output, LogDebug); return; } - qDebug() << data; + qCDebug(dapEngineLog) << data; if (event == "initialized") { showMessage(event, LogDebug); - qDebug() << "initialize success"; + qCDebug(dapEngineLog) << "initialize success"; handleDapLaunch(); handleDapConfigurationDone(); return; @@ -769,9 +892,12 @@ void DapEngine::handleOutput(const QJsonDocument &data) if (body.value("reason").toString() == "breakpoint") { QString id = QString::number( body.value("hitBreakpointIds").toArray().first().toInteger()); - const BreakpointParameters ¶ms - = breakHandler()->findBreakpointByResponseId(id)->requestedParameters(); - gotoLocation(Location(params.fileName, params.textPosition)); + + Breakpoint bp = breakHandler()->findBreakpointByResponseId(id); + if (bp) { + const BreakpointParameters ¶ms = bp->requestedParameters(); + gotoLocation(Location(params.fileName, params.textPosition)); + } } if (state() == InferiorStopRequested) @@ -785,7 +911,7 @@ void DapEngine::handleOutput(const QJsonDocument &data) } if (event == "thread") { - threads(); + // threads(); // breaks cmake debugging for now showMessage(event, LogDebug); if (body.value("reason").toString() == "started" && body.value("threadId").toInt() == 1) @@ -798,15 +924,15 @@ void DapEngine::handleOutput(const QJsonDocument &data) QJsonObject breakpoint = body.value("breakpoint").toObject(); Breakpoint bp = breakHandler()->findBreakpointByResponseId( QString::number(breakpoint.value("id").toInt())); - qDebug() << "breakpoint id :" << breakpoint.value("id").toInt(); + qCDebug(dapEngineLog) << "breakpoint id :" << breakpoint.value("id").toInt(); if (body.value("reason").toString() == "new") { if (breakpoint.value("verified").toBool()) { notifyBreakpointInsertOk(bp); - qDebug() << "breakpoint inserted"; + qCDebug(dapEngineLog) << "breakpoint inserted"; } else { notifyBreakpointInsertFailed(bp); - qDebug() << "breakpoint insertion failed"; + qCDebug(dapEngineLog) << "breakpoint insertion failed"; } return; } @@ -814,10 +940,10 @@ void DapEngine::handleOutput(const QJsonDocument &data) if (body.value("reason").toString() == "removed") { if (breakpoint.value("verified").toBool()) { notifyBreakpointRemoveOk(bp); - qDebug() << "breakpoint removed"; + qCDebug(dapEngineLog) << "breakpoint removed"; } else { notifyBreakpointRemoveFailed(bp); - qDebug() << "breakpoint remove failed"; + qCDebug(dapEngineLog) << "breakpoint remove failed"; } return; } @@ -843,7 +969,7 @@ void DapEngine::refreshLocals(const QJsonArray &variables) item->value = variable.toObject().value("value").toString(); item->address = variable.toObject().value("address").toInt(); item->type = variable.toObject().value("type").toString(); - qDebug() << "variable" << name << item->hexAddress(); + qCDebug(dapEngineLog) << "variable" << name << item->hexAddress(); watchHandler()->insertItem(item); } watchHandler()->notifyUpdateFinished(); @@ -886,14 +1012,14 @@ void DapEngine::updateLocals() bool DapEngine::hasCapability(unsigned cap) const { return cap & (ReloadModuleCapability - | BreakConditionCapability - | ShowModuleSymbolsCapability); + | BreakConditionCapability + | ShowModuleSymbolsCapability); } void DapEngine::claimInitialBreakpoints() { BreakpointManager::claimBreakpointsForEngine(this); - qDebug() << "claimInitialBreakpoints"; + qCDebug(dapEngineLog) << "claimInitialBreakpoints"; } DebuggerEngine *createDapEngine() diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index b91c84c8b41..7402385943d 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -17,6 +17,31 @@ class GdbMi; * A debugger engine for the debugger adapter protocol. */ +class IDataProvider : public QObject +{ + Q_OBJECT +public: + virtual void start() = 0; + virtual bool isRunning() const = 0; + virtual void writeRaw(const QByteArray &input) = 0; + virtual void kill() = 0; + virtual QByteArray readAllStandardOutput() = 0; + virtual QString readAllStandardError() = 0; + virtual int exitCode() const = 0; + virtual QString executable() const = 0; + + virtual QProcess::ExitStatus exitStatus() const = 0; + virtual QProcess::ProcessError error() const = 0; + virtual Utils::ProcessResult result() const = 0; + virtual QString exitMessage() const = 0; + +signals: + void started(); + void done(); + void readyReadStandardOutput(); + void readyReadStandardError(); +}; + class DapEngine : public DebuggerEngine { public: @@ -96,7 +121,8 @@ private: void updateLocals() override; QByteArray m_inbuffer; - Utils::Process m_proc; + std::unique_ptr<IDataProvider> m_dataGenerator = nullptr; + int m_nextBreakpointId = 1; int m_currentThreadId = -1; }; diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index cc6baf32d28..6e48f8c02b6 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -150,6 +150,7 @@ public: bool multiProcess = false; // Whether to set detach-on-fork off. bool useTerminal = false; bool runAsRoot = false; + bool cmakeDapDebugging = false; ProjectExplorer::Runnable debugger; Utils::FilePath overrideStartScript; // Used in attach to core and remote debugging diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 14dfbdfac3c..6156d40b34a 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1693,12 +1693,27 @@ RunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit, debugger->setStartMode(AttachToLocalProcess); debugger->setCloseMode(DetachAtClose); debugger->setContinueAfterAttach(contAfterAttach); + debugger->setCmakeDapDebugging(processInfo.executable.endsWith(QLatin1String("cmake"))); debugger->startRunControl(); return debugger->runControl(); } +void DebuggerPlugin::attachToProcess(const qint64 processId, const Utils::FilePath &executable) +{ + ProcessInfo processInfo; + processInfo.processId = processId; + processInfo.executable = executable.toString(); + + auto kitChooser = new KitChooser; + kitChooser->setShowIcons(true); + kitChooser->populate(); + Kit *kit = kitChooser->currentKit(); + + dd->attachToRunningProcess(kit, processInfo, false); +} + void DebuggerPlugin::attachExternalApplication(RunControl *rc) { ProcessHandle pid = rc->applicationProcessHandle(); diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h index 209bd0454c4..fde9c2b462b 100644 --- a/src/plugins/debugger/debuggerplugin.h +++ b/src/plugins/debugger/debuggerplugin.h @@ -40,6 +40,8 @@ private: QString *logMessage); Q_SLOT void removeDetectedDebuggers(const QString &detectionId, QString *logMessage); Q_SLOT void listDetectedDebuggers(const QString &detectionId, QString *logMessage); + + Q_SLOT void attachToProcess(const qint64 processId, const Utils::FilePath &executable); }; } // Debugger::Internal diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index dc7fb018930..480a2cedda1 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -310,6 +310,11 @@ void DebuggerRunTool::setRunAsRoot(bool on) m_runParameters.runAsRoot = on; } +void DebuggerRunTool::setCmakeDapDebugging(bool on) +{ + m_runParameters.cmakeDapDebugging = on; +} + void DebuggerRunTool::setCommandsAfterConnect(const QString &commands) { m_runParameters.commandsAfterConnect = commands; @@ -487,6 +492,9 @@ void DebuggerRunTool::start() runControl()->setDisplayName(m_runParameters.displayName); + if (!m_engine && m_runParameters.cmakeDapDebugging) + m_engine = createDapEngine(); + if (!m_engine) { if (m_runParameters.isCppDebugging()) { switch (m_runParameters.cppEngineType) { diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index 2bd18508c6a..44870382732 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -84,6 +84,7 @@ public: void setBreakOnMain(bool on); void setUseTerminal(bool on); void setRunAsRoot(bool on); + void setCmakeDapDebugging(bool on); void setCommandsAfterConnect(const QString &commands); void setCommandsForReset(const QString &commands); From 1bd2e84f9aa6cc0ab2e407d53fd2905d820bf2af Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 13 Jun 2023 14:51:48 +0200 Subject: [PATCH 0135/1777] Meson: Filepathify some parsers Change-Id: I403a78e6a05a531b7ab8b5779fe9f87b0e01fc1d Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../mesonprojectmanager/buildoptionsparser.h | 11 +++---- .../buildsystemfilesparser.h | 8 ++--- src/plugins/mesonprojectmanager/infoparser.h | 14 +++------ .../mesonprojectmanager/mesoninfoparser.h | 7 +++-- .../mesonprojectparser.cpp | 4 +-- .../mesonprojectmanager/targetparser.h | 8 ++--- .../tests/testmesoninfoparser.cpp | 29 +++++++++---------- 7 files changed, 35 insertions(+), 46 deletions(-) diff --git a/src/plugins/mesonprojectmanager/buildoptionsparser.h b/src/plugins/mesonprojectmanager/buildoptionsparser.h index ce2c927118f..4564269f12f 100644 --- a/src/plugins/mesonprojectmanager/buildoptionsparser.h +++ b/src/plugins/mesonprojectmanager/buildoptionsparser.h @@ -7,6 +7,8 @@ #include "common.h" #include "mesonpluginconstants.h" +#include <utils/filepath.h> + #include <QFile> #include <QJsonArray> #include <QJsonDocument> @@ -72,15 +74,14 @@ class BuildOptionsParser std::vector<std::unique_ptr<BuildOption>> m_buildOptions; public: - BuildOptionsParser(const QString &buildDir) + BuildOptionsParser(const Utils::FilePath &buildDir) { - auto arr = load<QJsonArray>(QString("%1/%2/%3") - .arg(buildDir) - .arg(Constants::MESON_INFO_DIR) - .arg(Constants::MESON_INTRO_BUIDOPTIONS)); + Utils::FilePath path = buildDir / Constants::MESON_INFO_DIR / Constants::MESON_INTRO_BUIDOPTIONS; + auto arr = load<QJsonArray>(path.toFSPathString()); if (arr) m_buildOptions = load_options(*arr); } + BuildOptionsParser(const QJsonDocument &js) { auto obj = get<QJsonArray>(js.object(), "buildoptions"); diff --git a/src/plugins/mesonprojectmanager/buildsystemfilesparser.h b/src/plugins/mesonprojectmanager/buildsystemfilesparser.h index 3bd8249c3ab..a64dd0c63c7 100644 --- a/src/plugins/mesonprojectmanager/buildsystemfilesparser.h +++ b/src/plugins/mesonprojectmanager/buildsystemfilesparser.h @@ -32,12 +32,10 @@ class BuildSystemFilesParser } public: - BuildSystemFilesParser(const QString &buildDir) + BuildSystemFilesParser(const Utils::FilePath &buildDir) { - auto arr = load<QJsonArray>(QString("%1/%2/%3") - .arg(buildDir) - .arg(Constants::MESON_INFO_DIR) - .arg(Constants::MESON_INTRO_BUILDSYSTEM_FILES)); + Utils::FilePath path = buildDir / Constants::MESON_INFO_DIR / Constants::MESON_INTRO_BUILDSYSTEM_FILES; + auto arr = load<QJsonArray>(path.toFSPathString()); appendFiles(arr, m_files); } diff --git a/src/plugins/mesonprojectmanager/infoparser.h b/src/plugins/mesonprojectmanager/infoparser.h index 27845a51490..6aca6211ea4 100644 --- a/src/plugins/mesonprojectmanager/infoparser.h +++ b/src/plugins/mesonprojectmanager/infoparser.h @@ -30,20 +30,14 @@ class InfoParser MesonInfo m_info; public: - InfoParser(const QString &buildDir) - /*: AbstractParser(jsonFile(buildDir))*/ + InfoParser(const Utils::FilePath &buildDir) { - auto obj = load<QJsonObject>(jsonFile(buildDir)); + Utils::FilePath jsonFile = buildDir / Constants::MESON_INFO_DIR / Constants::MESON_INFO; + auto obj = load<QJsonObject>(jsonFile.toFSPathString()); if (obj) m_info = load_info(*obj); } - static inline QString jsonFile(const QString &buildDir) - { - return QString("%1/%2/%3") - .arg(buildDir) - .arg(Constants::MESON_INFO_DIR) - .arg(Constants::MESON_INFO); - } + MesonInfo info() { return m_info; } }; diff --git a/src/plugins/mesonprojectmanager/mesoninfoparser.h b/src/plugins/mesonprojectmanager/mesoninfoparser.h index f32220f48b5..768ed13cf2e 100644 --- a/src/plugins/mesonprojectmanager/mesoninfoparser.h +++ b/src/plugins/mesonprojectmanager/mesoninfoparser.h @@ -11,7 +11,7 @@ #include "target.h" #include "targetparser.h" -#include <utils/fileutils.h> +#include <utils/filepath.h> #include <optional> @@ -30,7 +30,7 @@ struct Result std::optional<MesonInfo> mesonInfo; }; -inline Result parse(const QString &buildDir) +inline Result parse(const Utils::FilePath &buildDir) { return {TargetParser{buildDir}.targetList(), BuildOptionsParser{buildDir}.takeBuildOptions(), @@ -58,7 +58,8 @@ inline Result parse(QIODevice *introFile) } return {}; } -inline std::optional<MesonInfo> mesonInfo(const QString &buildDir) + +inline std::optional<MesonInfo> mesonInfo(const Utils::FilePath &buildDir) { return InfoParser{buildDir}.info(); } diff --git a/src/plugins/mesonprojectmanager/mesonprojectparser.cpp b/src/plugins/mesonprojectmanager/mesonprojectparser.cpp index c84b5e4b3d6..20f3316d904 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectparser.cpp +++ b/src/plugins/mesonprojectmanager/mesonprojectparser.cpp @@ -200,7 +200,7 @@ bool MesonProjectParser::startParser() m_parserFutureResult = Utils::asyncRun( ProjectExplorer::ProjectExplorerPlugin::sharedThreadPool(), [processOutput = m_process.stdOut(), introType = m_introType, - buildDir = m_buildDir.toString(), srcDir = m_srcDir] { + buildDir = m_buildDir, srcDir = m_srcDir] { if (introType == IntroDataType::file) return extractParserResults(srcDir, MesonInfoParser::parse(buildDir)); else @@ -323,7 +323,7 @@ bool MesonProjectParser::matchesKit(const KitData &kit) bool MesonProjectParser::usesSameMesonVersion(const Utils::FilePath &buildPath) { - auto info = MesonInfoParser::mesonInfo(buildPath.toString()); + auto info = MesonInfoParser::mesonInfo(buildPath); auto meson = MesonTools::mesonWrapper(m_meson); return info && meson && info->mesonVersion == meson->version(); } diff --git a/src/plugins/mesonprojectmanager/targetparser.h b/src/plugins/mesonprojectmanager/targetparser.h index 2b31083ba26..9c88b12b267 100644 --- a/src/plugins/mesonprojectmanager/targetparser.h +++ b/src/plugins/mesonprojectmanager/targetparser.h @@ -63,12 +63,10 @@ class TargetParser } public: - TargetParser(const QString &buildDir) + TargetParser(const Utils::FilePath &buildDir) { - auto arr = load<QJsonArray>(QString("%1/%2/%3") - .arg(buildDir) - .arg(Constants::MESON_INFO_DIR) - .arg(Constants::MESON_INTRO_TARGETS)); + Utils::FilePath path = buildDir / Constants::MESON_INFO_DIR / Constants::MESON_INTRO_TARGETS; + auto arr = load<QJsonArray>(path.toFSPathString()); if (arr) m_targets = load_targets(*arr); } diff --git a/src/plugins/mesonprojectmanager/tests/testmesoninfoparser.cpp b/src/plugins/mesonprojectmanager/tests/testmesoninfoparser.cpp index f45b59c86f3..37051b7ecdc 100644 --- a/src/plugins/mesonprojectmanager/tests/testmesoninfoparser.cpp +++ b/src/plugins/mesonprojectmanager/tests/testmesoninfoparser.cpp @@ -19,6 +19,7 @@ #include <iostream> using namespace MesonProjectManager::Internal; +using namespace Utils; struct projectData { @@ -27,22 +28,9 @@ struct projectData QStringList targets; }; -namespace { static const QList<projectData> projectList{ {"Simple C Project", "simplecproject", {"SimpleCProject"}}}; -} // namespace -#define WITH_CONFIGURED_PROJECT(_source_dir, _build_dir, ...) \ - { \ - QTemporaryDir _build_dir{"test-meson"}; \ - const auto tool = MesonWrapper::find(); \ - QVERIFY(tool.has_value()); \ - const auto _meson = MesonWrapper("name", *tool); \ - run_meson(_meson.setup(Utils::FilePath::fromString(_source_dir), \ - Utils::FilePath::fromString(_build_dir.path()))); \ - QVERIFY(isSetup(Utils::FilePath::fromString(_build_dir.path()))); \ - __VA_ARGS__ \ - } #define WITH_UNCONFIGURED_PROJECT(_source_dir, _intro_file, ...) \ { \ @@ -86,15 +74,24 @@ private slots: { QFETCH(QString, src_dir); QFETCH(QStringList, expectedTargets); - WITH_CONFIGURED_PROJECT(src_dir, build_dir, { - auto result = MesonInfoParser::parse(build_dir.path()); + + { + QTemporaryDir build_dir{"test-meson"}; + FilePath buildDir = FilePath::fromString(build_dir.path()); + const auto tool = MesonWrapper::find(); + QVERIFY(tool.has_value()); + MesonWrapper meson("name", *tool); + run_meson(meson.setup(FilePath::fromString(src_dir), buildDir)); + QVERIFY(isSetup(buildDir)); + + auto result = MesonInfoParser::parse(buildDir); QStringList targetsNames; std::transform(std::cbegin(result.targets), std::cend(result.targets), std::back_inserter(targetsNames), [](const auto &target) { return target.name; }); QVERIFY(targetsNames == expectedTargets); - }) + } WITH_UNCONFIGURED_PROJECT(src_dir, introFile, { auto result = MesonInfoParser::parse(&introFile); From 9a7f45cc460e178d983287bd1cb3c45efe1d8c3c Mon Sep 17 00:00:00 2001 From: Orgad Shaneh <orgad.shaneh@audiocodes.com> Date: Mon, 3 Jul 2023 12:21:30 +0300 Subject: [PATCH 0136/1777] Terminal: Allow the underlying application to set title Change-Id: I3530d645f16047df2546902d900e5e2fee8d071c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/terminal/terminalpane.cpp | 14 +++----------- src/plugins/terminal/terminalsurface.cpp | 1 + src/plugins/terminal/terminalsurface.h | 1 + src/plugins/terminal/terminalwidget.cpp | 23 +++++++++++++++++++++++ src/plugins/terminal/terminalwidget.h | 3 +++ src/plugins/terminal/tests/title | 4 ++++ 6 files changed, 35 insertions(+), 11 deletions(-) create mode 100755 src/plugins/terminal/tests/title diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index d30d7f79357..196a9acd3da 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -219,23 +219,15 @@ void TerminalPane::setupTerminalWidget(TerminalWidget *terminal) if (!terminal) return; - const auto setTabText = [this, terminal]() { + const auto setTabText = [this, terminal] { const int index = m_tabWidget.indexOf(terminal); - const FilePath cwd = terminal->cwd(); - - const QString exe = terminal->currentCommand().isEmpty() - ? terminal->shellName() - : terminal->currentCommand().executable().fileName(); - - if (cwd.isEmpty()) - m_tabWidget.setTabText(index, exe); - else - m_tabWidget.setTabText(index, exe + " - " + cwd.fileName()); + m_tabWidget.setTabText(index, terminal->title()); }; connect(terminal, &TerminalWidget::started, this, setTabText); connect(terminal, &TerminalWidget::cwdChanged, this, setTabText); connect(terminal, &TerminalWidget::commandChanged, this, setTabText); + connect(terminal, &TerminalWidget::titleChanged, this, setTabText); if (!terminal->shellName().isEmpty()) setTabText(); diff --git a/src/plugins/terminal/terminalsurface.cpp b/src/plugins/terminal/terminalsurface.cpp index ea994302318..3bd355fa552 100644 --- a/src/plugins/terminal/terminalsurface.cpp +++ b/src/plugins/terminal/terminalsurface.cpp @@ -249,6 +249,7 @@ struct TerminalSurfacePrivate case VTERM_PROP_ICONNAME: break; case VTERM_PROP_TITLE: + emit q->titleChanged(QString::fromUtf8(val->string.str, val->string.len)); break; case VTERM_PROP_ALTSCREEN: m_altscreen = val->boolean; diff --git a/src/plugins/terminal/terminalsurface.h b/src/plugins/terminal/terminalsurface.h index a6fc7425d48..f6e463ac8dd 100644 --- a/src/plugins/terminal/terminalsurface.h +++ b/src/plugins/terminal/terminalsurface.h @@ -103,6 +103,7 @@ signals: void altscreenChanged(bool altScreen); void unscroll(); void bell(); + void titleChanged(const QString &title); private: std::unique_ptr<TerminalSurfacePrivate> d; diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index de464b326cb..d232bfee277 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -399,6 +399,18 @@ void TerminalWidget::setupSurface() if (TerminalSettings::instance().audibleBell.value()) QApplication::beep(); }); + connect(m_surface.get(), + &Internal::TerminalSurface::titleChanged, + this, + [this](const QString &title) { + const FilePath titleFile = FilePath::fromUserInput(title); + if (!m_title.isEmpty() + || m_openParameters.shellCommand.value_or(CommandLine{}).executable() + != titleFile) { + m_title = titleFile.isFile() ? titleFile.baseName() : title; + } + emit titleChanged(); + }); if (m_shellIntegration) { connect(m_shellIntegration.get(), @@ -442,6 +454,17 @@ QColor TerminalWidget::toQColor(std::variant<int, QColor> color) const return std::get<QColor>(color); } +QString TerminalWidget::title() const +{ + const FilePath dir = cwd(); + QString title = m_title; + if (title.isEmpty()) + title = currentCommand().isEmpty() ? shellName() : currentCommand().executable().fileName(); + if (dir.isEmpty()) + return title; + return title + " - " + dir.fileName(); +} + void TerminalWidget::updateCopyState() { if (!hasFocus()) diff --git a/src/plugins/terminal/terminalwidget.h b/src/plugins/terminal/terminalwidget.h index 11cd9335cc9..66f721df5da 100644 --- a/src/plugins/terminal/terminalwidget.h +++ b/src/plugins/terminal/terminalwidget.h @@ -82,6 +82,7 @@ public: void setShellName(const QString &shellName); QString shellName() const; + QString title() const; Utils::FilePath cwd() const; Utils::CommandLine currentCommand() const; @@ -98,6 +99,7 @@ signals: void started(qint64 pid); void cwdChanged(const Utils::FilePath &cwd); void commandChanged(const Utils::CommandLine &cmd); + void titleChanged(); protected: void paintEvent(QPaintEvent *event) override; @@ -207,6 +209,7 @@ private: bool m_ignoreScroll{false}; QString m_preEditString; + QString m_title; std::optional<Selection> m_selection; std::optional<LinkSelection> m_linkSelection; diff --git a/src/plugins/terminal/tests/title b/src/plugins/terminal/tests/title new file mode 100755 index 00000000000..d6dc5193125 --- /dev/null +++ b/src/plugins/terminal/tests/title @@ -0,0 +1,4 @@ +#!/bin/bash + +echo -e "\033[1m ⎆ The terminal title should have changed to 'Test Title'\033[0m" +echo -e "\033]0;Test Title\007" From 2f6f9d2d33aa1ecac6f527282e29641368a86e6c Mon Sep 17 00:00:00 2001 From: Orgad Shaneh <orgad.shaneh@audiocodes.com> Date: Mon, 3 Jul 2023 14:33:21 +0300 Subject: [PATCH 0137/1777] Terminal: Add icons to tabs Change-Id: Id219366de16944daf83c3eb154d6b087c79b7fd9 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/terminalhooks.h | 3 +++ src/plugins/terminal/shellmodel.cpp | 31 +++++++++++++++------------ src/plugins/terminal/shellmodel.h | 1 - src/plugins/terminal/terminalpane.cpp | 16 ++++++++++++-- 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/libs/utils/terminalhooks.h b/src/libs/utils/terminalhooks.h index dbc42dea511..02e37e84972 100644 --- a/src/libs/utils/terminalhooks.h +++ b/src/libs/utils/terminalhooks.h @@ -8,6 +8,8 @@ #include "filepath.h" #include "id.h" +#include <QIcon> + #include <functional> #include <memory> @@ -58,6 +60,7 @@ struct OpenTerminalParameters std::optional<CommandLine> shellCommand; std::optional<FilePath> workingDirectory; std::optional<Environment> environment; + QIcon icon; ExitBehavior m_exitBehavior{ExitBehavior::Close}; std::optional<Id> identifier{std::nullopt}; }; diff --git a/src/plugins/terminal/shellmodel.cpp b/src/plugins/terminal/shellmodel.cpp index d5caa415dd3..0cc58f1fe6c 100644 --- a/src/plugins/terminal/shellmodel.cpp +++ b/src/plugins/terminal/shellmodel.cpp @@ -16,11 +16,13 @@ using namespace Utils; struct ShellItemBuilder { - explicit ShellItemBuilder(const CommandLine &value) + explicit ShellItemBuilder(const QFileIconProvider &iconProvider, const CommandLine &value) : + iconProvider(iconProvider) { m_item.openParameters.shellCommand = value; } - explicit ShellItemBuilder(const FilePath &value) + explicit ShellItemBuilder(const QFileIconProvider &iconProvider, const FilePath &value) : + iconProvider(iconProvider) { m_item.openParameters.shellCommand = CommandLine(value); } @@ -31,8 +33,7 @@ struct ShellItemBuilder } ShellItemBuilder &icon(const FilePath &value) { - static QFileIconProvider iconProvider; - m_item.icon = iconProvider.icon(value.toFileInfo()); + m_item.openParameters.icon = iconProvider.icon(value.toFileInfo()); return *this; } @@ -41,13 +42,14 @@ struct ShellItemBuilder { if (m_item.name.isEmpty()) m_item.name = m_item.openParameters.shellCommand->executable().toUserOutput(); - if (m_item.icon.isNull()) + if (m_item.openParameters.icon.isNull()) icon(m_item.openParameters.shellCommand->executable()); return m_item; } private: ShellModelItem m_item; + const QFileIconProvider &iconProvider; }; static QSet<FilePath> msysPaths() @@ -74,31 +76,32 @@ struct ShellModelPrivate ShellModelPrivate::ShellModelPrivate() { + QFileIconProvider iconProvider; if (Utils::HostOsInfo::isWindowsHost()) { const FilePath comspec = FilePath::fromUserInput(qtcEnvironmentVariable("COMSPEC")); - localShells << ShellItemBuilder(comspec); + localShells << ShellItemBuilder(iconProvider, comspec); if (comspec.fileName() != "cmd.exe") { FilePath cmd = FilePath::fromUserInput(QStandardPaths::findExecutable("cmd.exe")); - localShells << ShellItemBuilder(cmd); + localShells << ShellItemBuilder(iconProvider, cmd); } const FilePath powershell = FilePath::fromUserInput( QStandardPaths::findExecutable("powershell.exe")); if (powershell.exists()) - localShells << ShellItemBuilder(powershell); + localShells << ShellItemBuilder(iconProvider, powershell); const FilePath sys_bash = FilePath::fromUserInput(QStandardPaths::findExecutable("bash.exe")); if (sys_bash.exists()) - localShells << ShellItemBuilder({sys_bash, {"--login"}}); + localShells << ShellItemBuilder(iconProvider, {sys_bash, {"--login"}}); const FilePath git_exe = FilePath::fromUserInput(QStandardPaths::findExecutable("git.exe")); if (git_exe.exists()) { FilePath git_bash = git_exe.parentDir().parentDir().pathAppended("bin/bash.exe"); if (git_bash.exists()) { - localShells << ShellItemBuilder({git_bash, {"--login"}}) + localShells << ShellItemBuilder(iconProvider, {git_bash, {"--login"}}) .icon(git_bash.parentDir().parentDir().pathAppended("git-bash.exe")); } } @@ -111,7 +114,7 @@ ShellModelPrivate::ShellModelPrivate() QDirIterator it(type.path().replace(".ico", "/bin"), QDir::Files); if (!it.hasNext()) continue; - localShells << ShellItemBuilder( + localShells << ShellItemBuilder(iconProvider, {msys2_cmd, msys2_args + QStringList{"-" + type.baseName()}}) .icon(type) .name(type.toUserOutput().replace(".ico", ".exe")); @@ -137,8 +140,8 @@ ShellModelPrivate::ShellModelPrivate() // ... and filter out non-existing shells. localShells = Utils::transform( Utils::filtered(shells, [](const FilePath &shell) {return shell.exists(); }), - [](const FilePath &shell) { - return ShellItemBuilder(shell).item(); + [&iconProvider](const FilePath &shell) { + return ShellItemBuilder(iconProvider, shell).item(); }); } } @@ -162,7 +165,7 @@ QList<ShellModelItem> ShellModel::remote() const const QList<ShellModelItem> deviceItems = Utils::transform( deviceCmds, [](const Utils::Terminal::NameAndCommandLine &item) -> ShellModelItem { - return ShellModelItem{item.name, {}, {item.commandLine}}; + return ShellModelItem{item.name, {item.commandLine}}; }); return deviceItems; diff --git a/src/plugins/terminal/shellmodel.h b/src/plugins/terminal/shellmodel.h index 272f3fcd394..8b1b1c8e656 100644 --- a/src/plugins/terminal/shellmodel.h +++ b/src/plugins/terminal/shellmodel.h @@ -17,7 +17,6 @@ struct ShellModelPrivate; struct ShellModelItem { QString name; - QIcon icon; Utils::Terminal::OpenTerminalParameters openParameters; }; diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index 196a9acd3da..279786cac85 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -25,6 +25,7 @@ #include <utils/terminalhooks.h> #include <utils/utilsicons.h> +#include <QFileIconProvider> #include <QMenu> #include <QStandardPaths> #include <QToolButton> @@ -134,7 +135,18 @@ void TerminalPane::openTerminal(const OpenTerminalParameters ¶meters) terminalWidget->unlockGlobalAction(NEXTTERMINAL); terminalWidget->unlockGlobalAction(PREVTERMINAL); - m_tabWidget.setCurrentIndex(m_tabWidget.addTab(terminalWidget, Tr::tr("Terminal"))); + QIcon icon; + if (HostOsInfo::isWindowsHost()) { + icon = parametersCopy.icon; + if (icon.isNull()) { + QFileIconProvider iconProvider; + const FilePath command = parametersCopy.shellCommand + ? parametersCopy.shellCommand->executable() + : TerminalSettings::instance().shell.filePath(); + icon = iconProvider.icon(command.toFileInfo()); + } + } + m_tabWidget.setCurrentIndex(m_tabWidget.addTab(terminalWidget, icon, Tr::tr("Terminal"))); setupTerminalWidget(terminalWidget); if (!m_isVisible) @@ -306,7 +318,7 @@ void TerminalPane::createShellMenu() const auto addItems = [this](const QList<Internal::ShellModelItem> &items) { for (const Internal::ShellModelItem &item : items) { - QAction *action = new QAction(item.icon, item.name, &m_shellMenu); + QAction *action = new QAction(item.openParameters.icon, item.name, &m_shellMenu); connect(action, &QAction::triggered, action, [item, this]() { openTerminal(item.openParameters); From ae7b6b8ecf1fca93262240a3db82053180d2ff16 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 4 Jul 2023 17:09:05 +0200 Subject: [PATCH 0138/1777] CppEditor: Fix test Amends 3f61223c0fee176bda8cde71c2eb754516afa5bd. Change-Id: If5b0ed3c1c93914ebdd684f75e2900653ecaf7d7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/cppeditor/cppquickfix_test.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index f6a5b2b7acc..048ec9915e2 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -6872,20 +6872,20 @@ void QuickfixTest::testMoveFuncDefOutsideMemberFuncOutsideWithNs() QByteArray original = "namespace MyNs {\n" "class Foo {\n" - " inline int numbe@r() const\n" - " {\n" - " return 5;\n" - " }\n" + " inline int numbe@r() const\n" + " {\n" + " return 5;\n" + " }\n" "};}\n"; QByteArray expected = "namespace MyNs {\n" "class Foo {\n" - " int number() const;\n" + " int number() const;\n" "};\n" "\n" "int Foo::number() const\n" "{\n" - " return 5;\n" + " return 5;\n" "}\n" "\n}\n"; From c6a8a76be0eca59acf3161c28500b47e6ba997d3 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 5 Jul 2023 07:16:32 +0200 Subject: [PATCH 0139/1777] Fix Qbs build Change-Id: Ic02f12a08990bfa9eb3f0131141407373248bae1 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- qbs/modules/qtc_gtest_gmock/qtc_gtest_gmock.qbs | 2 +- tests/auto/qml/qml.qbs | 1 - tests/unit/unit.qbs | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 tests/unit/unit.qbs diff --git a/qbs/modules/qtc_gtest_gmock/qtc_gtest_gmock.qbs b/qbs/modules/qtc_gtest_gmock/qtc_gtest_gmock.qbs index 7b1d663cf0e..4a8299ba516 100644 --- a/qbs/modules/qtc_gtest_gmock/qtc_gtest_gmock.qbs +++ b/qbs/modules/qtc_gtest_gmock/qtc_gtest_gmock.qbs @@ -19,7 +19,7 @@ Module { property bool hasRepo configure: { - repoDir = FileInfo.cleanPath(path + "/../../../tests/unit/3rdparty/googletest"); + repoDir = FileInfo.cleanPath(path + "/../../../src/libs/3rdparty/googletest"); gtestDir = FileInfo.joinPaths(repoDir, "googletest"); gmockDir = FileInfo.joinPaths(repoDir, "googlemock"); hasRepo = File.exists(gtestDir); diff --git a/tests/auto/qml/qml.qbs b/tests/auto/qml/qml.qbs index 76659a5256b..46b3557c68a 100644 --- a/tests/auto/qml/qml.qbs +++ b/tests/auto/qml/qml.qbs @@ -7,7 +7,6 @@ Project { // "qmldesigner/qmldesigner.qbs", "qmleditor/qmleditor.qbs", "qmljssimplereader/qmljssimplereader.qbs", - "qmlprojectmanager/qmlprojectmanager.qbs", "qrcparser/qrcparser.qbs", "reformatter/reformatter.qbs", "persistenttrie/persistenttrie.qbs" diff --git a/tests/unit/unit.qbs b/tests/unit/unit.qbs new file mode 100644 index 00000000000..b263b933f8f --- /dev/null +++ b/tests/unit/unit.qbs @@ -0,0 +1,4 @@ +Product { + name: "QmlDesigner unit tests" + files: ["*", "**/*"] +} From 886ef1e2620b57facfef7b9459e2ac25f4c8a892 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 5 Jul 2023 09:47:53 +0200 Subject: [PATCH 0140/1777] RemoteLinux: Use aspects more directly in GenericDirectUploadStep Change-Id: I3e9070eaf0ec0eef6a706e06a87083bd214d652e Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../remotelinux/genericdirectuploadstep.cpp | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/plugins/remotelinux/genericdirectuploadstep.cpp b/src/plugins/remotelinux/genericdirectuploadstep.cpp index 62dd58467ed..7797afc3c89 100644 --- a/src/plugins/remotelinux/genericdirectuploadstep.cpp +++ b/src/plugins/remotelinux/genericdirectuploadstep.cpp @@ -39,26 +39,21 @@ enum class IncrementalDeployment { Enabled, Disabled, NotSupported }; class GenericDirectUploadStep : public AbstractRemoteLinuxDeployStep { public: - GenericDirectUploadStep(ProjectExplorer::BuildStepList *bsl, Id id) + GenericDirectUploadStep(BuildStepList *bsl, Id id) : AbstractRemoteLinuxDeployStep(bsl, id) { - auto incremental = addAspect<BoolAspect>(); - incremental->setSettingsKey("RemoteLinux.GenericDirectUploadStep.Incremental"); - incremental->setLabel(Tr::tr("Incremental deployment"), - BoolAspect::LabelPlacement::AtCheckBox); - incremental->setValue(true); - incremental->setDefaultValue(true); + incremental.setSettingsKey("RemoteLinux.GenericDirectUploadStep.Incremental"); + incremental.setLabelText(Tr::tr("Incremental deployment")); + incremental.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); + incremental.setDefaultValue(true); - auto ignoreMissingFiles = addAspect<BoolAspect>(); - ignoreMissingFiles->setSettingsKey("RemoteLinux.GenericDirectUploadStep.IgnoreMissingFiles"); - ignoreMissingFiles->setLabel(Tr::tr("Ignore missing files"), - BoolAspect::LabelPlacement::AtCheckBox); - ignoreMissingFiles->setValue(false); + ignoreMissingFiles.setSettingsKey("RemoteLinux.GenericDirectUploadStep.IgnoreMissingFiles"); + ignoreMissingFiles.setLabelText(Tr::tr("Ignore missing files")); + ignoreMissingFiles.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); - setInternalInitializer([this, incremental, ignoreMissingFiles] { - m_incremental = incremental->value() + setInternalInitializer([this] { + m_incremental = incremental() ? IncrementalDeployment::Enabled : IncrementalDeployment::Disabled; - m_ignoreMissingFiles = ignoreMissingFiles->value(); return isDeploymentPossible(); }); @@ -84,8 +79,10 @@ public: GroupItem chmodTree(const TreeStorage<UploadStorage> &storage); IncrementalDeployment m_incremental = IncrementalDeployment::NotSupported; - bool m_ignoreMissingFiles = false; mutable QList<DeployableFile> m_deployableFiles; + + BoolAspect incremental{this}; + BoolAspect ignoreMissingFiles{this}; }; static QList<DeployableFile> collectFilesToUpload(const DeployableFile &deployable) @@ -203,7 +200,7 @@ GroupItem GenericDirectUploadStep::uploadTask(const TreeStorage<UploadStorage> & if (!file.localFilePath().exists()) { const QString message = Tr::tr("Local file \"%1\" does not exist.") .arg(file.localFilePath().toUserOutput()); - if (m_ignoreMissingFiles) { + if (ignoreMissingFiles()) { addWarningMessage(message); continue; } From ada4429bcb221de860b2c6411ffa6938534981b1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 5 Jul 2023 09:52:05 +0200 Subject: [PATCH 0141/1777] RemoteLinux: Simplify GenericDirectUploadStep The IncrementalDeployment::NotSupported was alwasy overridden with Enabled or Disabled before actual action started, so it was not more than a bool. Change-Id: Ia4e986d08cdd10e20a741868ecb43e0c7ed4bf33 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/remotelinux/genericdirectuploadstep.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/plugins/remotelinux/genericdirectuploadstep.cpp b/src/plugins/remotelinux/genericdirectuploadstep.cpp index 7797afc3c89..b11ce62e9f1 100644 --- a/src/plugins/remotelinux/genericdirectuploadstep.cpp +++ b/src/plugins/remotelinux/genericdirectuploadstep.cpp @@ -34,8 +34,6 @@ struct UploadStorage QList<DeployableFile> filesToUpload; }; -enum class IncrementalDeployment { Enabled, Disabled, NotSupported }; - class GenericDirectUploadStep : public AbstractRemoteLinuxDeployStep { public: @@ -52,8 +50,6 @@ public: ignoreMissingFiles.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); setInternalInitializer([this] { - m_incremental = incremental() - ? IncrementalDeployment::Enabled : IncrementalDeployment::Disabled; return isDeploymentPossible(); }); @@ -78,7 +74,6 @@ public: GroupItem chmodTask(const DeployableFile &file); GroupItem chmodTree(const TreeStorage<UploadStorage> &storage); - IncrementalDeployment m_incremental = IncrementalDeployment::NotSupported; mutable QList<DeployableFile> m_deployableFiles; BoolAspect incremental{this}; @@ -268,12 +263,10 @@ Group GenericDirectUploadStep::deployRecipe() const auto preFilesToStat = [this](UploadStorage *storage) { QList<DeployableFile> filesToStat; for (const DeployableFile &file : std::as_const(m_deployableFiles)) { - if (m_incremental != IncrementalDeployment::Enabled || hasLocalFileChanged(file)) { + if (!incremental() || hasLocalFileChanged(file)) { storage->filesToUpload.append(file); continue; } - if (m_incremental == IncrementalDeployment::NotSupported) - continue; filesToStat << file; } return filesToStat; @@ -285,8 +278,7 @@ Group GenericDirectUploadStep::deployRecipe() }; const auto postFilesToStat = [this](UploadStorage *storage) { - return m_incremental == IncrementalDeployment::NotSupported - ? QList<DeployableFile>() : storage->filesToUpload; + return storage->filesToUpload; }; const auto postStatEndHandler = [this](UploadStorage *storage, const DeployableFile &file, const QDateTime ×tamp) { From 79bf7873bdc7452f603ea035a86b30fa275f098b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 5 Jul 2023 11:39:10 +0200 Subject: [PATCH 0142/1777] RemoteLinux: More direct aspect use in RsyncDeployStep Change-Id: Iaa34dba82189f78e88dd09585ada9b36ec3f2852 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/remotelinux/rsyncdeploystep.cpp | 108 +++++++++----------- 1 file changed, 51 insertions(+), 57 deletions(-) diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index 0214f21576b..fe423de3e69 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -33,7 +33,41 @@ namespace RemoteLinux { class RsyncDeployStep : public AbstractRemoteLinuxDeployStep { public: - RsyncDeployStep(BuildStepList *bsl, Id id); + RsyncDeployStep(BuildStepList *bsl, Id id) + : AbstractRemoteLinuxDeployStep(bsl, id) + { + flags.setDisplayStyle(StringAspect::LineEditDisplay); + flags.setSettingsKey("RemoteLinux.RsyncDeployStep.Flags"); + flags.setLabelText(Tr::tr("Flags:")); + flags.setValue(FileTransferSetupData::defaultRsyncFlags()); + + ignoreMissingFiles.setSettingsKey("RemoteLinux.RsyncDeployStep.IgnoreMissingFiles"); + ignoreMissingFiles.setLabelText(Tr::tr("Ignore missing files:")); + ignoreMissingFiles.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); + + method.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + method.setDisplayName(Tr::tr("Transfer method:")); + method.addOption(Tr::tr("rsync"), Tr::tr("Use rsync if available.")); + method.addOption(Tr::tr("SFTP"), Tr::tr("Use sftp if available.")); + method.addOption(Tr::tr("Generic Copy"), Tr::tr("Use generic copy, most likely to succeed.")); + + setInternalInitializer([this] { + if (BuildDeviceKitAspect::device(kit()) == DeviceKitAspect::device(kit())) { + // rsync transfer on the same device currently not implemented + // and typically not wanted. + return CheckResult::failure( + Tr::tr("rsync is only supported for transfers between different devices.")); + } + return isDeploymentPossible(); + }); + + setRunPreparer([this] { + const QList<DeployableFile> files = target()->deploymentData().allFiles(); + m_files.clear(); + for (const DeployableFile &f : files) + m_files.append({f.localFilePath(), deviceConfiguration()->filePath(f.remoteFilePath())}); + }); + } private: bool isDeploymentNecessary() const final; @@ -41,64 +75,16 @@ private: GroupItem mkdirTask(); GroupItem transferTask(); + StringAspect flags{this}; + BoolAspect ignoreMissingFiles{this}; + SelectionAspect method{this}; + mutable FilesToTransfer m_files; - bool m_ignoreMissingFiles = false; - FileTransferMethod m_preferredTransferMethod = FileTransferMethod::Rsync; - QString m_flags; }; -RsyncDeployStep::RsyncDeployStep(BuildStepList *bsl, Id id) - : AbstractRemoteLinuxDeployStep(bsl, id) -{ - auto flags = addAspect<StringAspect>(); - flags->setDisplayStyle(StringAspect::LineEditDisplay); - flags->setSettingsKey("RemoteLinux.RsyncDeployStep.Flags"); - flags->setLabelText(Tr::tr("Flags:")); - flags->setValue(FileTransferSetupData::defaultRsyncFlags()); - - auto ignoreMissingFiles = addAspect<BoolAspect>(); - ignoreMissingFiles->setSettingsKey("RemoteLinux.RsyncDeployStep.IgnoreMissingFiles"); - ignoreMissingFiles->setLabel(Tr::tr("Ignore missing files:"), - BoolAspect::LabelPlacement::InExtraLabel); - ignoreMissingFiles->setValue(false); - - auto method = addAspect<SelectionAspect>(); - method->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - method->setDisplayName(Tr::tr("Transfer method:")); - method->addOption(Tr::tr("rsync"), Tr::tr("Use rsync if available.")); - method->addOption(Tr::tr("SFTP"), Tr::tr("Use sftp if available.")); - method->addOption(Tr::tr("Generic Copy"), Tr::tr("Use generic copy, most likely to succeed.")); - - setInternalInitializer([this, ignoreMissingFiles, flags, method] { - if (BuildDeviceKitAspect::device(kit()) == DeviceKitAspect::device(kit())) { - // rsync transfer on the same device currently not implemented - // and typically not wanted. - return CheckResult::failure( - Tr::tr("rsync is only supported for transfers between different devices.")); - } - m_ignoreMissingFiles = ignoreMissingFiles->value(); - m_flags = flags->value(); - if (method->value() == 0) - m_preferredTransferMethod = FileTransferMethod::Rsync; - else if (method->value() == 1) - m_preferredTransferMethod = FileTransferMethod::Sftp; - else - m_preferredTransferMethod = FileTransferMethod::GenericCopy; - - return isDeploymentPossible(); - }); - - setRunPreparer([this] { - const QList<DeployableFile> files = target()->deploymentData().allFiles(); - m_files.clear(); - for (const DeployableFile &f : files) - m_files.append({f.localFilePath(), deviceConfiguration()->filePath(f.remoteFilePath())}); - }); -} - bool RsyncDeployStep::isDeploymentNecessary() const { - if (m_ignoreMissingFiles) + if (ignoreMissingFiles()) Utils::erase(m_files, [](const FileToTransfer &file) { return !file.m_source.exists(); }); return !m_files.empty(); } @@ -167,14 +153,22 @@ static FileTransferMethod supportedTransferMethodFor(const FileToTransfer &fileT GroupItem RsyncDeployStep::transferTask() { const auto setupHandler = [this](FileTransfer &transfer) { - FileTransferMethod transferMethod = m_preferredTransferMethod; + FileTransferMethod preferredTransferMethod = FileTransferMethod::Rsync; + if (method() == 0) + preferredTransferMethod = FileTransferMethod::Rsync; + else if (method() == 1) + preferredTransferMethod = FileTransferMethod::Sftp; + else + preferredTransferMethod = FileTransferMethod::GenericCopy; + + FileTransferMethod transferMethod = preferredTransferMethod; if (transferMethod != FileTransferMethod::GenericCopy) { for (const FileToTransfer &fileToTransfer : m_files) { const FileTransferMethod supportedMethod = supportedTransferMethodFor( fileToTransfer); - if (supportedMethod != m_preferredTransferMethod) { + if (supportedMethod != preferredTransferMethod) { transferMethod = FileTransferMethod::GenericCopy; break; } @@ -183,7 +177,7 @@ GroupItem RsyncDeployStep::transferTask() transfer.setTransferMethod(transferMethod); - transfer.setRsyncFlags(m_flags); + transfer.setRsyncFlags(flags()); transfer.setFilesToTransfer(m_files); connect(&transfer, &FileTransfer::progress, this, &AbstractRemoteLinuxDeployStep::handleStdOutData); From 7e0534c301d1b749c6c6af725afbb8a651022eb9 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 5 Jul 2023 11:41:40 +0200 Subject: [PATCH 0143/1777] ClangToolRunWorker: Remove unused fields Change-Id: I599196e436d1648dff386555ec5537a21de9fc35 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/clangtools/clangtoolruncontrol.cpp | 5 ----- src/plugins/clangtools/clangtoolruncontrol.h | 2 -- 2 files changed, 7 deletions(-) diff --git a/src/plugins/clangtools/clangtoolruncontrol.cpp b/src/plugins/clangtools/clangtoolruncontrol.cpp index aaf20741a7f..f04dd67e52a 100644 --- a/src/plugins/clangtools/clangtoolruncontrol.cpp +++ b/src/plugins/clangtools/clangtoolruncontrol.cpp @@ -113,11 +113,6 @@ ClangToolRunWorker::ClangToolRunWorker(ClangTool *tool, RunControl *runControl, BuildConfiguration *buildConfiguration = target->activeBuildConfiguration(); QTC_ASSERT(buildConfiguration, return); m_environment = buildConfiguration->environment(); - - ToolChain *toolChain = ToolChainKitAspect::cxxToolChain(target->kit()); - QTC_ASSERT(toolChain, return); - m_targetTriple = toolChain->originalTargetTriple(); - m_toolChainType = toolChain->typeId(); } ClangToolRunWorker::~ClangToolRunWorker() = default; diff --git a/src/plugins/clangtools/clangtoolruncontrol.h b/src/plugins/clangtools/clangtoolruncontrol.h index e6204da4ff2..dc7ebc9ef1c 100644 --- a/src/plugins/clangtools/clangtoolruncontrol.h +++ b/src/plugins/clangtools/clangtoolruncontrol.h @@ -64,8 +64,6 @@ private: CppEditor::ProjectInfo::ConstPtr m_projectInfoBeforeBuild; CppEditor::ProjectInfo::ConstPtr m_projectInfo; - QString m_targetTriple; - Utils::Id m_toolChainType; std::unique_ptr<Tasking::TaskTree> m_taskTree; QSet<Utils::FilePath> m_projectFiles; From 739f835ef17bec651deb3f25995fdceb27e5f4f1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 5 Jul 2023 08:56:05 +0200 Subject: [PATCH 0144/1777] ProjectExplorer: Remove unusual {Arguments,WorkingDir}Aspect Follows suite to 2cc4967 to have the user side code more uniform. Most of the extra verbosity (setMacroExpander) can go away again when distributing the expander via the "owning" AspectContainer. Change-Id: I9e80cb235f0a4a9ebee601dd638aefbaa41efc1b Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../android/androidrunconfiguration.cpp | 3 ++- .../baremetal/baremetalrunconfiguration.cpp | 14 +++++++--- src/plugins/boot2qt/qdbrunconfiguration.cpp | 10 +++++-- .../haskell/haskellrunconfiguration.cpp | 8 ++++-- src/plugins/ios/iosrunconfiguration.cpp | 3 ++- .../mesonrunconfiguration.cpp | 9 +++++-- src/plugins/nim/project/nimblebuildstep.cpp | 3 ++- .../nim/project/nimblerunconfiguration.cpp | 19 +++++++++---- .../nim/project/nimrunconfiguration.cpp | 8 ++++-- .../customexecutablerunconfiguration.cpp | 9 +++++-- .../desktoprunconfiguration.cpp | 9 +++++-- .../runconfigurationaspects.cpp | 27 ++++++++++++++----- .../projectexplorer/runconfigurationaspects.h | 10 ++++--- src/plugins/python/pythonrunconfiguration.cpp | 7 +++-- src/plugins/qmakeprojectmanager/qmakestep.cpp | 3 ++- .../qmlprojectrunconfiguration.cpp | 3 ++- src/plugins/qnx/qnxrunconfiguration.cpp | 11 +++++--- .../remotelinuxcustomrunconfiguration.cpp | 9 +++++-- .../remotelinuxrunconfiguration.cpp | 9 +++++-- 19 files changed, 128 insertions(+), 46 deletions(-) diff --git a/src/plugins/android/androidrunconfiguration.cpp b/src/plugins/android/androidrunconfiguration.cpp index 157f6f5afca..e481f1eda44 100644 --- a/src/plugins/android/androidrunconfiguration.cpp +++ b/src/plugins/android/androidrunconfiguration.cpp @@ -53,7 +53,8 @@ public: auto envAspect = addAspect<EnvironmentAspect>(); envAspect->addSupportedBaseEnvironment(Tr::tr("Clean Environment"), {}); - auto extraAppArgsAspect = addAspect<ArgumentsAspect>(macroExpander()); + auto extraAppArgsAspect = addAspect<ArgumentsAspect>(); + extraAppArgsAspect->setMacroExpander(macroExpander()); connect(extraAppArgsAspect, &BaseAspect::changed, this, [target, extraAppArgsAspect] { if (target->buildConfigurations().first()->buildType() == BuildConfiguration::BuildType::Release) { diff --git a/src/plugins/baremetal/baremetalrunconfiguration.cpp b/src/plugins/baremetal/baremetalrunconfiguration.cpp index b4a10baaf5a..8d3f042a713 100644 --- a/src/plugins/baremetal/baremetalrunconfiguration.cpp +++ b/src/plugins/baremetal/baremetalrunconfiguration.cpp @@ -29,8 +29,11 @@ public: exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); exeAspect->setPlaceHolderText(Tr::tr("Unknown")); - addAspect<ArgumentsAspect>(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), nullptr); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); setUpdater([this, exeAspect] { const BuildTargetInfo bti = buildTargetInfo(); @@ -55,8 +58,11 @@ public: exeAspect->setHistoryCompleter("BareMetal.CustomRunConfig.History"); exeAspect->setExpectedKind(PathChooser::Any); - addAspect<ArgumentsAspect>(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), nullptr); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); setDefaultDisplayName(RunConfigurationFactory::decoratedTargetName( Tr::tr("Custom Executable"), target)); diff --git a/src/plugins/boot2qt/qdbrunconfiguration.cpp b/src/plugins/boot2qt/qdbrunconfiguration.cpp index 28853877642..efc4886b3bf 100644 --- a/src/plugins/boot2qt/qdbrunconfiguration.cpp +++ b/src/plugins/boot2qt/qdbrunconfiguration.cpp @@ -82,8 +82,14 @@ QdbRunConfiguration::QdbRunConfiguration(Target *target, Id id) auto envAspect = addAspect<RemoteLinux::RemoteLinuxEnvironmentAspect>(target); - addAspect<ArgumentsAspect>(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); + + workingDirAspect->setEnvironment(envAspect); + addAspect<FullCommandLineAspect>(this); setUpdater([this, target, exeAspect, symbolsAspect] { diff --git a/src/plugins/haskell/haskellrunconfiguration.cpp b/src/plugins/haskell/haskellrunconfiguration.cpp index 76d25e557c3..fec7f73e966 100644 --- a/src/plugins/haskell/haskellrunconfiguration.cpp +++ b/src/plugins/haskell/haskellrunconfiguration.cpp @@ -38,9 +38,13 @@ HaskellRunConfiguration::HaskellRunConfiguration(Target *target, Utils::Id id) envAspect->setSupportForBuildEnvironment(target); addAspect<HaskellExecutableAspect>(); - addAspect<ArgumentsAspect>(macroExpander()); - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); + workingDirAspect->setEnvironment(envAspect); workingDirAspect->setDefaultWorkingDirectory(target->project()->projectDirectory()); workingDirAspect->setVisible(false); diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index 15e774248ea..dda93209270 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -61,7 +61,8 @@ IosRunConfiguration::IosRunConfiguration(Target *target, Id id) auto executableAspect = addAspect<ExecutableAspect>(); executableAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); - addAspect<ArgumentsAspect>(macroExpander()); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); m_deviceTypeAspect = addAspect<IosDeviceTypeAspect>(this); diff --git a/src/plugins/mesonprojectmanager/mesonrunconfiguration.cpp b/src/plugins/mesonprojectmanager/mesonrunconfiguration.cpp index e75d4c83f7a..fee6f100ee7 100644 --- a/src/plugins/mesonprojectmanager/mesonrunconfiguration.cpp +++ b/src/plugins/mesonprojectmanager/mesonrunconfiguration.cpp @@ -29,8 +29,13 @@ public: auto exeAspect = addAspect<ExecutableAspect>(); exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); - addAspect<ArgumentsAspect>(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); + workingDirAspect->setEnvironment(envAspect); + addAspect<TerminalAspect>(); auto libAspect = addAspect<UseLibraryPathsAspect>(); diff --git a/src/plugins/nim/project/nimblebuildstep.cpp b/src/plugins/nim/project/nimblebuildstep.cpp index d432db5154e..ca9b5a4b2a8 100644 --- a/src/plugins/nim/project/nimblebuildstep.cpp +++ b/src/plugins/nim/project/nimblebuildstep.cpp @@ -32,7 +32,8 @@ private: NimbleBuildStep::NimbleBuildStep(BuildStepList *parentList, Id id) : AbstractProcessStep(parentList, id) { - auto arguments = addAspect<ArgumentsAspect>(macroExpander()); + auto arguments = addAspect<ArgumentsAspect>(); + arguments->setMacroExpander(macroExpander()); arguments->setSettingsKey(Constants::C_NIMBLEBUILDSTEP_ARGUMENTS); arguments->setResetter([this] { return defaultArguments(); }); arguments->setArguments(defaultArguments()); diff --git a/src/plugins/nim/project/nimblerunconfiguration.cpp b/src/plugins/nim/project/nimblerunconfiguration.cpp index baf4e001975..97b4e3c82a0 100644 --- a/src/plugins/nim/project/nimblerunconfiguration.cpp +++ b/src/plugins/nim/project/nimblerunconfiguration.cpp @@ -32,8 +32,12 @@ public: auto exeAspect = addAspect<ExecutableAspect>(); exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); - addAspect<ArgumentsAspect>(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); + addAspect<TerminalAspect>(); setUpdater([this] { @@ -70,9 +74,14 @@ public: exeAspect->setDeviceSelector(target, ExecutableAspect::BuildDevice); exeAspect->setExecutable(Nim::nimblePathFromKit(target->kit())); - addAspect<ArgumentsAspect>(macroExpander())->setArguments("test"); - addAspect<WorkingDirectoryAspect>(macroExpander(), nullptr) - ->setDefaultWorkingDirectory(project()->projectDirectory()); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + argsAspect->setArguments("test"); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); + workingDirAspect->setDefaultWorkingDirectory(project()->projectDirectory()); + addAspect<TerminalAspect>(); setDisplayName(Tr::tr("Nimble Test")); diff --git a/src/plugins/nim/project/nimrunconfiguration.cpp b/src/plugins/nim/project/nimrunconfiguration.cpp index 790557c2117..fa60694be24 100644 --- a/src/plugins/nim/project/nimrunconfiguration.cpp +++ b/src/plugins/nim/project/nimrunconfiguration.cpp @@ -32,8 +32,12 @@ public: auto exeAspect = addAspect<ExecutableAspect>(); exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); - addAspect<ArgumentsAspect>(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); + addAspect<TerminalAspect>(); setDisplayName(Tr::tr("Current Build Target")); diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index c8f4a5a42dc..37b112ac8fe 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -34,8 +34,13 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *targe exeAspect->setExpectedKind(PathChooser::ExistingCommand); exeAspect->setEnvironment(envAspect->environment()); - addAspect<ArgumentsAspect>(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); + workingDirAspect->setEnvironment(envAspect); + addAspect<TerminalAspect>(); connect(envAspect, &EnvironmentAspect::environmentChanged, this, [exeAspect, envAspect] { diff --git a/src/plugins/projectexplorer/desktoprunconfiguration.cpp b/src/plugins/projectexplorer/desktoprunconfiguration.cpp index 8d7329a1d54..ce7c6ed0f69 100644 --- a/src/plugins/projectexplorer/desktoprunconfiguration.cpp +++ b/src/plugins/projectexplorer/desktoprunconfiguration.cpp @@ -48,8 +48,13 @@ DesktopRunConfiguration::DesktopRunConfiguration(Target *target, Id id, Kind kin auto exeAspect = addAspect<ExecutableAspect>(); exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); - addAspect<ArgumentsAspect>(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); + workingDirAspect->setEnvironment(envAspect); + addAspect<TerminalAspect>(); auto libAspect = addAspect<UseLibraryPathsAspect>(); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index ed7b2cb8273..59e814a56b6 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -47,7 +47,8 @@ namespace ProjectExplorer { The initial value is provided as a hint from the build systems. */ -TerminalAspect::TerminalAspect() +TerminalAspect::TerminalAspect(AspectContainer *container) + : BaseAspect(container) { setDisplayName(Tr::tr("Terminal")); setId("TerminalAspect"); @@ -152,15 +153,24 @@ bool TerminalAspect::isUserSet() const working directory for running the executable. */ -WorkingDirectoryAspect::WorkingDirectoryAspect(const MacroExpander *expander, - EnvironmentAspect *envAspect) - : m_envAspect(envAspect), m_macroExpander(expander) +WorkingDirectoryAspect::WorkingDirectoryAspect(AspectContainer *container) + : BaseAspect(container) { setDisplayName(Tr::tr("Working Directory")); setId("WorkingDirectoryAspect"); setSettingsKey("RunConfiguration.WorkingDirectory"); } +void WorkingDirectoryAspect::setMacroExpander(const MacroExpander *expander) +{ + m_macroExpander = expander; +} + +void WorkingDirectoryAspect::setEnvironment(EnvironmentAspect *envAspect) +{ + m_envAspect = envAspect; +} + /*! \reimp */ @@ -297,8 +307,8 @@ PathChooser *WorkingDirectoryAspect::pathChooser() const arguments for an executable. */ -ArgumentsAspect::ArgumentsAspect(const MacroExpander *macroExpander) - : m_macroExpander(macroExpander) +ArgumentsAspect::ArgumentsAspect(AspectContainer *container) + : BaseAspect(container) { setDisplayName(Tr::tr("Arguments")); setId("ArgumentsAspect"); @@ -309,6 +319,11 @@ ArgumentsAspect::ArgumentsAspect(const MacroExpander *macroExpander) m_labelText = Tr::tr("Command line arguments:"); } +void ArgumentsAspect::setMacroExpander(const MacroExpander *expander) +{ + m_macroExpander = expander; +} + /*! Returns the main value of this aspect. diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index 35081838934..80b89cf7b72 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -27,7 +27,7 @@ class PROJECTEXPLORER_EXPORT TerminalAspect : public Utils::BaseAspect Q_OBJECT public: - TerminalAspect(); + explicit TerminalAspect(Utils::AspectContainer *container = nullptr); void addToLayout(Layouting::LayoutItem &parent) override; @@ -59,8 +59,7 @@ class PROJECTEXPLORER_EXPORT WorkingDirectoryAspect : public Utils::BaseAspect Q_OBJECT public: - explicit WorkingDirectoryAspect(const Utils::MacroExpander *expander, - EnvironmentAspect *envAspect); + explicit WorkingDirectoryAspect(Utils::AspectContainer *container = nullptr); void addToLayout(Layouting::LayoutItem &parent) override; @@ -69,6 +68,8 @@ public: Utils::FilePath unexpandedWorkingDirectory() const; void setDefaultWorkingDirectory(const Utils::FilePath &defaultWorkingDirectory); Utils::PathChooser *pathChooser() const; + void setMacroExpander(const Utils::MacroExpander *expander); + void setEnvironment(EnvironmentAspect *envAspect); private: void fromMap(const QVariantMap &map) override; @@ -89,7 +90,7 @@ class PROJECTEXPLORER_EXPORT ArgumentsAspect : public Utils::BaseAspect Q_OBJECT public: - explicit ArgumentsAspect(const Utils::MacroExpander *macroExpander); + explicit ArgumentsAspect(Utils::AspectContainer *container = nullptr); void addToLayout(Layouting::LayoutItem &parent) override; @@ -100,6 +101,7 @@ public: void setLabelText(const QString &labelText); void setResetter(const std::function<QString()> &resetter); void resetArguments(); + void setMacroExpander(const Utils::MacroExpander *macroExpander); struct Data : BaseAspect::Data { diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 151895449b3..267036e63e2 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -201,9 +201,12 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) auto envAspect = addAspect<EnvironmentAspect>(); envAspect->setSupportForBuildEnvironment(target); - auto argumentsAspect = addAspect<ArgumentsAspect>(macroExpander()); + auto argumentsAspect = addAspect<ArgumentsAspect>(); + argumentsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), nullptr); addAspect<TerminalAspect>(); if (HostOsInfo::isAnyUnixHost()) diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 27e29e497e8..4821b398382 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -69,7 +69,8 @@ QMakeStep::QMakeStep(BuildStepList *bsl, Id id) m_buildType->addOption(Tr::tr("Debug")); m_buildType->addOption(Tr::tr("Release")); - m_userArgs = addAspect<ArgumentsAspect>(macroExpander()); + m_userArgs = addAspect<ArgumentsAspect>(); + m_userArgs->setMacroExpander(macroExpander()); m_userArgs->setSettingsKey(QMAKE_ARGUMENTS_KEY); m_userArgs->setLabelText(Tr::tr("Additional arguments:")); diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index e64ebccf006..06b6f35c078 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -77,7 +77,8 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) m_qmlViewerAspect->setHistoryCompleter("QmlProjectManager.viewer.history"); m_qmlViewerAspect->setSettingsKey(Constants::QML_VIEWER_KEY); - auto argumentAspect = addAspect<ArgumentsAspect>(macroExpander()); + auto argumentAspect = addAspect<ArgumentsAspect>(); + argumentAspect->setMacroExpander(macroExpander()); argumentAspect->setSettingsKey(Constants::QML_VIEWER_ARGUMENTS_KEY); setCommandLineGetter([this, target] { diff --git a/src/plugins/qnx/qnxrunconfiguration.cpp b/src/plugins/qnx/qnxrunconfiguration.cpp index 3b389049cf0..96245e95017 100644 --- a/src/plugins/qnx/qnxrunconfiguration.cpp +++ b/src/plugins/qnx/qnxrunconfiguration.cpp @@ -42,8 +42,13 @@ public: auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(target); - addAspect<ArgumentsAspect>(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); + workingDirAspect->setEnvironment(envAspect); + addAspect<TerminalAspect>(); auto libAspect = addAspect<StringAspect>(); @@ -75,8 +80,6 @@ public: } }; - - // QnxRunConfigurationFactory QnxRunConfigurationFactory::QnxRunConfigurationFactory() diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp index a2707180260..4d124a6be55 100644 --- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp @@ -46,8 +46,13 @@ RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *tar symbolsAspect->setSettingsKey("RemoteLinux.CustomRunConfig.LocalExecutable"); symbolsAspect->setLabelText(Tr::tr("Local executable:")); - addAspect<ArgumentsAspect>(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); + workingDirAspect->setEnvironment(envAspect); + if (HostOsInfo::isAnyUnixHost()) addAspect<TerminalAspect>(); if (HostOsInfo::isAnyUnixHost()) diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 8dcb286589c..9ea2618c09c 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -47,8 +47,13 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Id id) symbolsAspect->setLabelText(Tr::tr("Executable on host:")); symbolsAspect->setDisplayStyle(SymbolFileAspect::LabelDisplay); - addAspect<ArgumentsAspect>(macroExpander()); - addAspect<WorkingDirectoryAspect>(macroExpander(), envAspect); + auto argsAspect = addAspect<ArgumentsAspect>(); + argsAspect->setMacroExpander(macroExpander()); + + auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); + workingDirAspect->setMacroExpander(macroExpander()); + workingDirAspect->setEnvironment(envAspect); + if (HostOsInfo::isAnyUnixHost()) addAspect<TerminalAspect>(); if (HostOsInfo::isAnyUnixHost()) From f373297af2f3403762852e2282f3b6fcee96215b Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 5 Jul 2023 14:51:02 +0200 Subject: [PATCH 0145/1777] Vcpkg: Polish search/add package dialog strings ...as suggested after UX review. Change-Id: I9f96d919a46c9e1a33e3396aca878bb520464f33 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/vcpkg/vcpkgmanifesteditor.cpp | 2 +- src/plugins/vcpkg/vcpkgsearch.cpp | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp index 40e4837cf77..0c22f944256 100644 --- a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp +++ b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp @@ -24,7 +24,7 @@ public: VcpkgManifestEditorWidget() { m_searchPkgAction = toolBar()->addAction(Utils::Icons::ZOOM_TOOLBAR.icon(), - Tr::tr("Search package...")); + Tr::tr("Add vcpkg package...")); connect(m_searchPkgAction, &QAction::triggered, this, [this] { const Search::VcpkgManifest package = Search::showVcpkgPackageSearchDialog(); if (!package.name.isEmpty()) diff --git a/src/plugins/vcpkg/vcpkgsearch.cpp b/src/plugins/vcpkg/vcpkgsearch.cpp index b9315ec540c..1ed757dd975 100644 --- a/src/plugins/vcpkg/vcpkgsearch.cpp +++ b/src/plugins/vcpkg/vcpkgsearch.cpp @@ -53,6 +53,7 @@ VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(QWidget *parent) : QDialog(parent) { resize(920, 400); + setWindowTitle(Tr::tr("Add vcpkg package")); m_packagesFilter = new FancyLineEdit; m_packagesFilter->setFiltering(true); @@ -81,15 +82,19 @@ VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(QWidget *parent) Row { Column { m_packagesFilter, + Tr::tr("Packages:"), m_packagesList, }, - Form { - Tr::tr("Name:"), m_vcpkgName, br, - Tr::tr("Version:"), m_vcpkgVersion, br, - Tr::tr("License:"), m_vcpkgLicense, br, - Tr::tr("Description:"), m_vcpkgDescription, br, - Tr::tr("Homepage:"), m_vcpkgHomepage, br, - }, + Group { + title(Tr::tr("Package details")), + Form { + Tr::tr("Name:"), m_vcpkgName, br, + Tr::tr("Version:"), m_vcpkgVersion, br, + Tr::tr("License:"), m_vcpkgLicense, br, + Tr::tr("Description:"), m_vcpkgDescription, br, + Tr::tr("Homepage:"), m_vcpkgHomepage, br, + }, + } }, m_buttonBox, }.attachTo(this); From 02ac595a2ec1c7d91f59b938f08e16418a92b90a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 3 Jul 2023 09:51:47 +0200 Subject: [PATCH 0146/1777] LayoutBuilder: Add some playground for potential implementations Change-Id: I0955c503dc03f9e4d81d6cfe4df7af63cf86a638 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../layoutbuilder/experimental/CMakeLists.txt | 8 + .../layoutbuilder/experimental/main.cpp | 170 ++++++++++++++++++ 2 files changed, 178 insertions(+) create mode 100644 tests/manual/layoutbuilder/experimental/CMakeLists.txt create mode 100644 tests/manual/layoutbuilder/experimental/main.cpp diff --git a/tests/manual/layoutbuilder/experimental/CMakeLists.txt b/tests/manual/layoutbuilder/experimental/CMakeLists.txt new file mode 100644 index 00000000000..6d2568d7cf4 --- /dev/null +++ b/tests/manual/layoutbuilder/experimental/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.5) + +project(experimental LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_executable(experimental main.cpp) diff --git a/tests/manual/layoutbuilder/experimental/main.cpp b/tests/manual/layoutbuilder/experimental/main.cpp new file mode 100644 index 00000000000..b9c9a2bb8a4 --- /dev/null +++ b/tests/manual/layoutbuilder/experimental/main.cpp @@ -0,0 +1,170 @@ +// Copyright (C) 2023 André Pönitz +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include <array> +#include <initializer_list> +#include <tuple> + +#include <stdio.h> +#include <string.h> + +using namespace std; + +// std::tuple implementations are quite fat, we might want to use a cut-down version of it. +template <typename ...Args> +using Tuple = std::tuple<Args...>; + + +// The main dispatcher(s) + +auto doit_tuple(auto x, auto t); // Tuple-based + +auto doit(auto x, auto ...a); // Args expanded. + + +// Convenience for the setter implementors. Removes the need to use get<n> +// in the setters explicitly. +template <typename X, typename Id, typename Arg1> +void doit_tuple(X *x, const Tuple<Id, Arg1> *a) +{ + doit(x, get<0>(*a), get<1>(*a)); +} + +template <typename X, typename Id, typename Arg1, typename Arg2> +void doit_tuple(X *x, const Tuple<Id, Arg1, Arg2> *a) +{ + doit(x, get<0>(*a), get<1>(*a), get<2>(*a)); +} + + +// "Builder base". + +template <typename X> +struct B +{ +private: + template <typename ...Args> + struct Doer + { + static void doit(X *x, const Tuple<Args...> *args) + { + doit_tuple(x, args); + } + }; + +public: + struct I + { + template <typename ...Args> + I(const Tuple<Args...> &p) + { + auto f = &Doer<Args...>::doit; + memcpy(&f_, &f, sizeof(f_)); + p_ = &p; + } + + void (*f_)(X *, const void *); + const void *p_; + }; + + B(initializer_list<I> ps) { + for (auto && p : ps) + (*p.f_)(static_cast<X *>(this), p.p_); + } +}; + + +////////////////////////////////////////////// + + +// Builder Classes preparation + +// We need one class for each user visible Builder type. +// This is usually wrappeng one "backend" type, e.g. there +// could be a PushButton wrapping QPushButton. + +struct D : B<D> { using B<D>::B; }; + +struct E : B<E> { using B<E>::B; }; + + +// "Setters" preparation + +// We need one 'Id' (and a corresponding function wrapping arguments into a +// tuple marked by this id) per 'name' of "backend" setter member function, +// i.e. one 'text' is sufficient for QLabel::setText, QLineEdit::setText. +// The name of the Id does not have to match the backend names as it +// is mapped per-backend-type in the respective setter implementation +// but we assume that it generally makes sense to stay close to the +// wrapped API name-wise. + +struct TextId {}; +auto text(auto ...x) { return Tuple{TextId{}, x...}; } + +struct SumId {}; +auto sum(auto ...x) { return Tuple{SumId{}, x...}; } + +struct OtherId {}; +auto other(auto ...x) { return Tuple{OtherId{}, x...}; } + +struct LargeId {}; +auto large(auto ...x) { return Tuple{LargeId{}, x...}; } + +struct Large { + Large() { for (int i = 0; i < 100; ++i) x[i] = i; } + int x[100]; +}; + + +// Setter implementation + +// These are free functions overloaded on the type of builder object +// and setter id. The function implementations are independent, but +// the base expectation is that they will forwards to the backend +// type's setter. + +void doit(D *, TextId, const char *t) +{ + printf("D text: %s\n", t); +} + +void doit(D *, OtherId, int t) +{ + printf("D other: %d\n", t); +} + +void doit(D *, OtherId, double t) +{ + printf("D other: %f\n", t); +} + +void doit(D *, LargeId, Large t) +{ + printf("D other: %d\n", t.x[50]); +} + +void doit(E *, OtherId, double t) +{ + printf("E other: %f\n", t); +} + +void doit(E *, SumId, int a, int b) +{ + printf("E sum: %d + %d = %d\n", a, b, a + b); +} + + +int main() +{ + E { + other(4.55), + sum(1, 2) + }; + D { + //other(5), + other(5.5), // - does not compile as there is no doit(D*, OtherId, double) + text("abc"), + large(Large()) + }; +} From f02d0354c481f00fc23c92e71afbaf62736912c9 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 4 Jul 2023 09:22:30 +0200 Subject: [PATCH 0147/1777] Terminal: Dont show process exit code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Show it as a "flashing" message instead Fixes: QTCREATORBUG-29373 Change-Id: Ib9e7280a1b80cc52835aecb954f80e9daa80f7ca Reviewed-by: Robert Löhning <robert.loehning@qt.io> --- src/plugins/terminal/terminalwidget.cpp | 29 +++++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index d232bfee277..98877b841f0 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -15,6 +15,7 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/fileutils.h> #include <coreplugin/icore.h> +#include <coreplugin/messagemanager.h> #include <utils/algorithm.h> #include <utils/environment.h> @@ -170,18 +171,15 @@ void TerminalWidget::setupPty() }); connect(m_process.get(), &Process::done, this, [this] { + QString errorMessage; + if (m_process) { if (m_process->exitCode() != 0) { - QByteArray msg = QString("\r\n\033[31mProcess exited with code: %1") - .arg(m_process->exitCode()) - .toUtf8(); + errorMessage + = Tr::tr("Terminal process exited with code %1").arg(m_process->exitCode()); if (!m_process->errorString().isEmpty()) - msg += QString(" (%1)").arg(m_process->errorString()).toUtf8(); - - m_surface->dataFromPty(msg); - - return; + errorMessage += QString(" (%1)").arg(m_process->errorString()); } } @@ -200,11 +198,18 @@ void TerminalWidget::setupPty() deleteLater(); if (m_openParameters.m_exitBehavior == ExitBehavior::Keep) { - QByteArray msg = QString("\r\nProcess exited with code: %1") - .arg(m_process ? m_process->exitCode() : -1) - .toUtf8(); + if (!errorMessage.isEmpty()) { + QByteArray msg = QString("\r\n\033[31m%1").arg(errorMessage).toUtf8(); - m_surface->dataFromPty(msg); + m_surface->dataFromPty(msg); + } else { + QString exitMsg = Tr::tr("Process exited with code: %1") + .arg(m_process ? m_process->exitCode() : -1); + QByteArray msg = QString("\r\n%1").arg(exitMsg).toUtf8(); + m_surface->dataFromPty(msg); + } + } else if (!errorMessage.isEmpty()) { + Core::MessageManager::writeFlashing(errorMessage); } }); From 135a7682f5e34a1a4789a0c8e803a993f129a54b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 5 Jul 2023 16:30:42 +0200 Subject: [PATCH 0148/1777] ProjectExplorer: Make more aspects directly usable in AspectContainers Change-Id: I6634c27c8d516411ad84e6cb7c361262ead53124 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../projectexplorer/environmentaspect.cpp | 3 +- .../projectexplorer/environmentaspect.h | 2 +- .../runconfigurationaspects.cpp | 39 ++++++++++++++++--- .../projectexplorer/runconfigurationaspects.h | 16 ++++---- src/plugins/python/pythonrunconfiguration.cpp | 6 ++- .../qmlprojectrunconfiguration.cpp | 6 ++- .../remotelinuxcustomrunconfiguration.cpp | 7 +++- .../remotelinuxrunconfiguration.cpp | 7 +++- 8 files changed, 63 insertions(+), 23 deletions(-) diff --git a/src/plugins/projectexplorer/environmentaspect.cpp b/src/plugins/projectexplorer/environmentaspect.cpp index 09bfeb9c80d..e55e95156da 100644 --- a/src/plugins/projectexplorer/environmentaspect.cpp +++ b/src/plugins/projectexplorer/environmentaspect.cpp @@ -21,7 +21,8 @@ const char PRINT_ON_RUN_KEY[] = "PE.EnvironmentAspect.PrintOnRun"; // EnvironmentAspect: // -------------------------------------------------------------------- -EnvironmentAspect::EnvironmentAspect() +EnvironmentAspect::EnvironmentAspect(AspectContainer *container) + : BaseAspect(container) { setDisplayName(Tr::tr("Environment")); setId("EnvironmentAspect"); diff --git a/src/plugins/projectexplorer/environmentaspect.h b/src/plugins/projectexplorer/environmentaspect.h index 97ce26f017d..1de5641f6b0 100644 --- a/src/plugins/projectexplorer/environmentaspect.h +++ b/src/plugins/projectexplorer/environmentaspect.h @@ -20,7 +20,7 @@ class PROJECTEXPLORER_EXPORT EnvironmentAspect : public Utils::BaseAspect Q_OBJECT public: - EnvironmentAspect(); + EnvironmentAspect(Utils::AspectContainer *container = nullptr); // The environment including the user's modifications. Utils::Environment environment() const; diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 59e814a56b6..5c0242d4a64 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -724,7 +724,8 @@ void ExecutableAspect::toMap(QVariantMap &map) const on Windows and LD_LIBRARY_PATH everywhere else. */ -UseLibraryPathsAspect::UseLibraryPathsAspect() +UseLibraryPathsAspect::UseLibraryPathsAspect(AspectContainer *container) + : BoolAspect(container) { setId("UseLibraryPath"); setSettingsKey("RunConfiguration.UseLibrarySearchPath"); @@ -749,7 +750,8 @@ UseLibraryPathsAspect::UseLibraryPathsAspect() DYLD_IMAGE_SUFFIX environment variable should be used on Mac. */ -UseDyldSuffixAspect::UseDyldSuffixAspect() +UseDyldSuffixAspect::UseDyldSuffixAspect(AspectContainer *container) + : BoolAspect(container) { setId("UseDyldSuffix"); setSettingsKey("RunConfiguration.UseDyldImageSuffix"); @@ -765,7 +767,8 @@ UseDyldSuffixAspect::UseDyldSuffixAspect() application should run with root permissions. */ -RunAsRootAspect::RunAsRootAspect() +RunAsRootAspect::RunAsRootAspect(AspectContainer *container) + : BoolAspect(container) { setId("RunAsRoot"); setSettingsKey("RunConfiguration.RunAsRoot"); @@ -794,7 +797,8 @@ Interpreter::Interpreter(const QString &_id, to use with files or projects using an interpreted language. */ -InterpreterAspect::InterpreterAspect() +InterpreterAspect::InterpreterAspect(AspectContainer *container) + : BaseAspect(container) { addDataExtractor(this, &InterpreterAspect::currentInterpreter, &Data::interpreter); } @@ -904,8 +908,8 @@ static QString defaultDisplay() return qtcEnvironmentVariable("DISPLAY"); } -X11ForwardingAspect::X11ForwardingAspect(const MacroExpander *expander) - : m_macroExpander(expander) +X11ForwardingAspect::X11ForwardingAspect(AspectContainer *container) + : StringAspect(container) { setLabelText(Tr::tr("X11 Forwarding:")); setDisplayStyle(LineEditDisplay); @@ -918,10 +922,33 @@ X11ForwardingAspect::X11ForwardingAspect(const MacroExpander *expander) addDataExtractor(this, &X11ForwardingAspect::display, &Data::display); } +void X11ForwardingAspect::setMacroExpander(const MacroExpander *expander) +{ + m_macroExpander = expander; +} + QString X11ForwardingAspect::display() const { QTC_ASSERT(m_macroExpander, return value()); return !isChecked() ? QString() : m_macroExpander->expandProcessArgs(value()); } + +/*! + \class ProjectExplorer::SymbolFileAspect + \inmodule QtCreator + + \brief The SymbolFileAspect class lets a user specify a symbol file + for debugging. +*/ + + +SymbolFileAspect::SymbolFileAspect(AspectContainer *container) + : FilePathAspect(container) +{} + +MainScriptAspect::MainScriptAspect(AspectContainer *container) + : StringAspect(container) +{} + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index 80b89cf7b72..384181be730 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -131,7 +131,7 @@ class PROJECTEXPLORER_EXPORT UseLibraryPathsAspect : public Utils::BoolAspect Q_OBJECT public: - UseLibraryPathsAspect(); + UseLibraryPathsAspect(Utils::AspectContainer *container = nullptr); }; class PROJECTEXPLORER_EXPORT UseDyldSuffixAspect : public Utils::BoolAspect @@ -139,7 +139,7 @@ class PROJECTEXPLORER_EXPORT UseDyldSuffixAspect : public Utils::BoolAspect Q_OBJECT public: - UseDyldSuffixAspect(); + UseDyldSuffixAspect(Utils::AspectContainer *container = nullptr); }; class PROJECTEXPLORER_EXPORT RunAsRootAspect : public Utils::BoolAspect @@ -147,7 +147,7 @@ class PROJECTEXPLORER_EXPORT RunAsRootAspect : public Utils::BoolAspect Q_OBJECT public: - RunAsRootAspect(); + RunAsRootAspect(Utils::AspectContainer *container = nullptr); }; class PROJECTEXPLORER_EXPORT ExecutableAspect : public Utils::BaseAspect @@ -197,7 +197,7 @@ class PROJECTEXPLORER_EXPORT SymbolFileAspect : public Utils::FilePathAspect Q_OBJECT public: - SymbolFileAspect() = default; + SymbolFileAspect(Utils::AspectContainer *container = nullptr); }; class PROJECTEXPLORER_EXPORT Interpreter @@ -227,7 +227,7 @@ class PROJECTEXPLORER_EXPORT InterpreterAspect : public Utils::BaseAspect Q_OBJECT public: - InterpreterAspect(); + InterpreterAspect(Utils::AspectContainer *container = nullptr); Interpreter currentInterpreter() const; void updateInterpreters(const QList<Interpreter> &interpreters); @@ -256,7 +256,7 @@ class PROJECTEXPLORER_EXPORT MainScriptAspect : public Utils::StringAspect Q_OBJECT public: - MainScriptAspect() = default; + MainScriptAspect(Utils::AspectContainer *container = nullptr); }; class PROJECTEXPLORER_EXPORT X11ForwardingAspect : public Utils::StringAspect @@ -264,7 +264,9 @@ class PROJECTEXPLORER_EXPORT X11ForwardingAspect : public Utils::StringAspect Q_OBJECT public: - X11ForwardingAspect(const Utils::MacroExpander *macroExpander); + X11ForwardingAspect(Utils::AspectContainer *container = nullptr); + + void setMacroExpander(const Utils::MacroExpander *macroExpander); struct Data : StringAspect::Data { QString display; }; diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 267036e63e2..04210a8b751 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -209,8 +209,10 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) addAspect<TerminalAspect>(); - if (HostOsInfo::isAnyUnixHost()) - addAspect<X11ForwardingAspect>(macroExpander()); + if (HostOsInfo::isAnyUnixHost()) { + auto x11Forwarding = addAspect<X11ForwardingAspect>(); + x11Forwarding->setMacroExpander(macroExpander()); + } setCommandLineGetter([bufferedAspect, interpreterAspect, argumentsAspect, scriptAspect] { CommandLine cmd{interpreterAspect->currentInterpreter().command}; diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 06b6f35c078..4b64440c5fc 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -166,8 +166,10 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) return envModifier(environment); }); - if (HostOsInfo::isAnyUnixHost()) - addAspect<X11ForwardingAspect>(macroExpander()); + if (HostOsInfo::isAnyUnixHost()) { + auto x11Forwarding = addAspect<X11ForwardingAspect>(); + x11Forwarding->setMacroExpander(macroExpander()); + } setRunnableModifier([this](Runnable &r) { const QmlBuildSystem *bs = static_cast<QmlBuildSystem *>(activeBuildSystem()); diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp index 4d124a6be55..cbafc2423b5 100644 --- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp @@ -55,8 +55,11 @@ RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *tar if (HostOsInfo::isAnyUnixHost()) addAspect<TerminalAspect>(); - if (HostOsInfo::isAnyUnixHost()) - addAspect<X11ForwardingAspect>(macroExpander()); + + if (HostOsInfo::isAnyUnixHost()) { + auto x11Forwarding = addAspect<X11ForwardingAspect>(); + x11Forwarding->setMacroExpander(macroExpander()); + } setDefaultDisplayName(runConfigDefaultDisplayName()); } diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 9ea2618c09c..4234afaf745 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -56,8 +56,11 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Id id) if (HostOsInfo::isAnyUnixHost()) addAspect<TerminalAspect>(); - if (HostOsInfo::isAnyUnixHost()) - addAspect<X11ForwardingAspect>(macroExpander()); + + if (HostOsInfo::isAnyUnixHost()) { + auto x11Forwarding = addAspect<X11ForwardingAspect>(); + x11Forwarding->setMacroExpander(macroExpander()); + } auto libAspect = addAspect<UseLibraryPathsAspect>(); libAspect->setValue(false); From 29aba317416e5d6999b8e0ce8f685e8859c54747 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 07:36:37 +0200 Subject: [PATCH 0149/1777] Meson: Use Aspects more directly in MesonRunConfiguration Change-Id: I6553d5651ba7006e683bd74c8e48fa3acd8d5246 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../mesonrunconfiguration.cpp | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/src/plugins/mesonprojectmanager/mesonrunconfiguration.cpp b/src/plugins/mesonprojectmanager/mesonrunconfiguration.cpp index fee6f100ee7..64d9cb3eeb0 100644 --- a/src/plugins/mesonprojectmanager/mesonrunconfiguration.cpp +++ b/src/plugins/mesonprojectmanager/mesonrunconfiguration.cpp @@ -23,39 +23,33 @@ public: MesonRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto envAspect = addAspect<EnvironmentAspect>(); - envAspect->setSupportForBuildEnvironment(target); + environment.setSupportForBuildEnvironment(target); - auto exeAspect = addAspect<ExecutableAspect>(); - exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); + executable.setDeviceSelector(target, ExecutableAspect::RunDevice); - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); + arguments.setMacroExpander(macroExpander()); - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); - workingDirAspect->setEnvironment(envAspect); + workingDir.setMacroExpander(macroExpander()); + workingDir.setEnvironment(&environment); - addAspect<TerminalAspect>(); - - auto libAspect = addAspect<UseLibraryPathsAspect>(); - connect(libAspect, &UseLibraryPathsAspect::changed, - envAspect, &EnvironmentAspect::environmentChanged); + connect(&useLibraryPaths, &BaseAspect::changed, + &environment, &EnvironmentAspect::environmentChanged); if (HostOsInfo::isMacHost()) { - auto dyldAspect = addAspect<UseDyldSuffixAspect>(); - connect(dyldAspect, &UseLibraryPathsAspect::changed, - envAspect, &EnvironmentAspect::environmentChanged); - envAspect->addModifier([dyldAspect](Utils::Environment &env) { - if (dyldAspect->value()) + connect(&useDyldSuffix, &BaseAspect::changed, + &environment, &EnvironmentAspect::environmentChanged); + environment.addModifier([this](Environment &env) { + if (useDyldSuffix()) env.set(QLatin1String("DYLD_IMAGE_SUFFIX"), QLatin1String("_debug")); }); + } else { + useDyldSuffix.setVisible(false); } - envAspect->addModifier([this, libAspect](Environment &env) { + environment.addModifier([this](Environment &env) { BuildTargetInfo bti = buildTargetInfo(); if (bti.runEnvModifier) - bti.runEnvModifier(env, libAspect->value()); + bti.runEnvModifier(env, useLibraryPaths()); }); setUpdater([this] { @@ -63,14 +57,22 @@ public: return; BuildTargetInfo bti = buildTargetInfo(); - aspect<TerminalAspect>()->setUseTerminalHint(bti.usesTerminal); - aspect<ExecutableAspect>()->setExecutable(bti.targetFilePath); - aspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(bti.workingDirectory); - emit aspect<EnvironmentAspect>()->environmentChanged(); + terminal.setUseTerminalHint(bti.usesTerminal); + executable.setExecutable(bti.targetFilePath); + workingDir.setDefaultWorkingDirectory(bti.workingDirectory); + emit environment.environmentChanged(); }); connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); } + + EnvironmentAspect environment{this}; + ExecutableAspect executable{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; + TerminalAspect terminal{this}; + UseLibraryPathsAspect useLibraryPaths{this}; + UseDyldSuffixAspect useDyldSuffix{this}; }; MesonRunConfigurationFactory::MesonRunConfigurationFactory() From 10d96d8e220febc5176233b7cb57ad21dec3add5 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 4 Jul 2023 16:12:47 +0200 Subject: [PATCH 0150/1777] AppOutputPane: Make appendMessage() private Change-Id: Ib9ac2a62a1ea64fcbc61b8a425c5c1061247a8ba Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/appoutputpane.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/appoutputpane.h b/src/plugins/projectexplorer/appoutputpane.h index f0f4b56eb90..059d78bff19 100644 --- a/src/plugins/projectexplorer/appoutputpane.h +++ b/src/plugins/projectexplorer/appoutputpane.h @@ -71,13 +71,12 @@ public: // ApplicationOutput specifics void projectRemoved(); - void appendMessage(ProjectExplorer::RunControl *rc, const QString &out, - Utils::OutputFormat format); - const AppOutputSettings &settings() const { return m_settings; } void setSettings(const AppOutputSettings &settings); private: + void appendMessage(ProjectExplorer::RunControl *rc, const QString &out, + Utils::OutputFormat format); void reRunRunControl(); void stopRunControl(); void attachToRunControl(); From 890cc2ba768c31c8b4ef1201317f5c57831b5edc Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 5 Jul 2023 12:20:59 +0200 Subject: [PATCH 0151/1777] Autotools: Streamline plugin setup Change-Id: I1a2ac742a3ac055c313d3af0a7173e380ca6070a Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../autotoolsprojectmanager/CMakeLists.txt | 2 +- .../autotoolsprojectmanager.qbs | 1 - .../autotoolsprojectplugin.cpp | 74 ++++++++++++------- .../autotoolsprojectplugin.h | 51 ------------- 4 files changed, 50 insertions(+), 78 deletions(-) delete mode 100644 src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h diff --git a/src/plugins/autotoolsprojectmanager/CMakeLists.txt b/src/plugins/autotoolsprojectmanager/CMakeLists.txt index 0536178881e..261403ce8c5 100644 --- a/src/plugins/autotoolsprojectmanager/CMakeLists.txt +++ b/src/plugins/autotoolsprojectmanager/CMakeLists.txt @@ -8,7 +8,7 @@ add_qtc_plugin(AutotoolsProjectManager autotoolsbuildsystem.cpp autotoolsbuildsystem.h autotoolsprojectconstants.h autotoolsprojectmanagertr.h - autotoolsprojectplugin.cpp autotoolsprojectplugin.h + autotoolsprojectplugin.cpp configurestep.cpp configurestep.h makefileparser.cpp makefileparser.h makefileparserthread.cpp makefileparserthread.h diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs index ffe9690a35c..d9da0c1af9d 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs @@ -23,7 +23,6 @@ QtcPlugin { "autotoolsprojectconstants.h", "autotoolsprojectmanagertr.h", "autotoolsprojectplugin.cpp", - "autotoolsprojectplugin.h", "configurestep.cpp", "configurestep.h", "makefileparser.cpp", diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp index 4a338024731..8649236e152 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp @@ -1,8 +1,6 @@ // Copyright (C) 2016 Openismus GmbH. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "autotoolsprojectplugin.h" - #include "autogenstep.h" #include "autoreconfstep.h" #include "autotoolsbuildconfiguration.h" @@ -18,6 +16,10 @@ #include <projectexplorer/projectmanager.h> #include <projectexplorer/target.h> +#include <extensionsystem/iplugin.h> + +using namespace ProjectExplorer; + namespace AutotoolsProjectManager::Internal { /** @@ -28,7 +30,7 @@ namespace AutotoolsProjectManager::Internal { * It is responsible to parse the Makefile.am files and do trigger project * updates if a Makefile.am file or a configure.ac file has been changed. */ -class AutotoolsProject : public ProjectExplorer::Project +class AutotoolsProject : public Project { public: explicit AutotoolsProject(const Utils::FilePath &fileName) @@ -40,33 +42,55 @@ public: setHasMakeInstallEquivalent(true); - setBuildSystemCreator([](ProjectExplorer::Target *t) { return new AutotoolsBuildSystem(t); }); + setBuildSystemCreator([](Target *t) { return new AutotoolsBuildSystem(t); }); } }; +/** + * @brief Implementation of the ExtensionsSystem::IPlugin interface. + * + * The plugin creates the following components: + * + * - AutotoolsManager: Will manage the new autotools project and + * tell QtCreator for which MIME types the autotools project should + * be instantiated. + * + * - MakeStepFactory: This factory is used to create make steps. + * + * - AutogenStepFactory: This factory is used to create autogen steps. + * + * - AutoreconfStepFactory: This factory is used to create autoreconf + * steps. + * + * - ConfigureStepFactory: This factory is used to create configure steps. + * + * - MakefileEditorFactory: Provides a specialized editor with automatic + * syntax highlighting for Makefile.am files. + * + * - AutotoolsTargetFactory: Our current target is desktop. + * + * - AutotoolsBuildConfigurationFactory: Creates build configurations that + * contain the steps (make, autogen, autoreconf or configure) that will + * be executed in the build process) + */ -class AutotoolsProjectPluginPrivate +class AutotoolsProjectPlugin final : public ExtensionSystem::IPlugin { -public: - AutotoolsBuildConfigurationFactory buildConfigurationFactory; - MakeStepFactory makeStepFaactory; - AutogenStepFactory autogenStepFactory; - ConfigureStepFactory configureStepFactory; - AutoreconfStepFactory autoreconfStepFactory; + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "AutotoolsProjectManager.json") + + void initialize() final + { + ProjectManager::registerProjectType<AutotoolsProject>(Constants::MAKEFILE_MIMETYPE); + + addManaged<AutotoolsBuildConfigurationFactory>(); + addManaged<MakeStepFactory>(); + addManaged<AutogenStepFactory>(); + addManaged<ConfigureStepFactory>(); + addManaged<AutoreconfStepFactory>(); + } }; -AutotoolsProjectPlugin::~AutotoolsProjectPlugin() -{ - delete d; -} - -void AutotoolsProjectPlugin::extensionsInitialized() -{ } - -void AutotoolsProjectPlugin::initialize() -{ - d = new AutotoolsProjectPluginPrivate; - ProjectExplorer::ProjectManager::registerProjectType<AutotoolsProject>(Constants::MAKEFILE_MIMETYPE); -} - } // AutotoolsProjectManager::Internal + +#include "autotoolsprojectplugin.moc" diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h deleted file mode 100644 index a705da891d5..00000000000 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) 2016 Openismus GmbH. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <extensionsystem/iplugin.h> - -namespace AutotoolsProjectManager::Internal { - -/** - * @brief Implementation of the ExtensionsSystem::IPlugin interface. - * - * The plugin creates the following components: - * - * - AutotoolsManager: Will manage the new autotools project and - * tell QtCreator for which MIME types the autotools project should - * be instantiated. - * - * - MakeStepFactory: This factory is used to create make steps. - * - * - AutogenStepFactory: This factory is used to create autogen steps. - * - * - AutoreconfStepFactory: This factory is used to create autoreconf - * steps. - * - * - ConfigureStepFactory: This factory is used to create configure steps. - * - * - MakefileEditorFactory: Provides a specialized editor with automatic - * syntax highlighting for Makefile.am files. - * - * - AutotoolsTargetFactory: Our current target is desktop. - * - * - AutotoolsBuildConfigurationFactory: Creates build configurations that - * contain the steps (make, autogen, autoreconf or configure) that will - * be executed in the build process) - */ - -class AutotoolsProjectPlugin final : public ExtensionSystem::IPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "AutotoolsProjectManager.json") - - ~AutotoolsProjectPlugin() final; - - void extensionsInitialized() final; - void initialize() final; - - class AutotoolsProjectPluginPrivate *d; -}; - -} // AutotoolsProjectManager::Internal From c4294bea230180fa0ef204e669a9ce7bda68ed14 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 09:18:25 +0200 Subject: [PATCH 0152/1777] Core: Add the IOptionsPage::setSettingsProvider This allows creating the options page without having the settings object already present, potentially delaying its creation until its first truly necessary use. Task-number: QTCREATORBUG-29167 Change-Id: I004fb19f0ea2b7e500747b3905283d74f749cd78 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../coreplugin/dialogs/ioptionspage.cpp | 39 ++++++++++++------- src/plugins/coreplugin/dialogs/ioptionspage.h | 5 ++- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.cpp b/src/plugins/coreplugin/dialogs/ioptionspage.cpp index 9715c1c89f5..8cbbd7eac42 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.cpp +++ b/src/plugins/coreplugin/dialogs/ioptionspage.cpp @@ -134,9 +134,10 @@ QWidget *IOptionsPage::widget() if (!m_widget) { if (m_widgetCreator) { m_widget = m_widgetCreator(); - } else if (m_settings) { + } else if (m_settingsProvider) { m_widget = new IOptionsPageWidget; - if (auto layouter = m_settings->layouter()) { + AspectContainer *container = m_settingsProvider(); + if (auto layouter = container->layouter()) { layouter().attachTo(m_widget); } else { QTC_CHECK(false); @@ -162,10 +163,11 @@ void IOptionsPage::apply() if (auto widget = qobject_cast<IOptionsPageWidget *>(m_widget)) widget->apply(); - if (m_settings) { - if (m_settings->isDirty()) { - m_settings->apply(); - m_settings->writeSettings(ICore::settings()); + if (m_settingsProvider) { + AspectContainer *container = m_settingsProvider(); + if (container->isDirty()) { + container->apply(); + container->writeSettings(ICore::settings()); } } } @@ -184,8 +186,10 @@ void IOptionsPage::finish() if (auto widget = qobject_cast<IOptionsPageWidget *>(m_widget)) widget->finish(); - if (m_settings) - m_settings->finish(); + if (m_settingsProvider) { + AspectContainer *container = m_settingsProvider(); + container->finish(); + } delete m_widget; } @@ -201,7 +205,12 @@ void IOptionsPage::setCategoryIconPath(const FilePath &categoryIconPath) void IOptionsPage::setSettings(AspectContainer *settings) { - m_settings = settings; + m_settingsProvider = [settings] { return settings; }; +} + +void IOptionsPage::setSettingsProvider(const std::function<AspectContainer *()> &provider) +{ + m_settingsProvider = provider; } /*! @@ -234,7 +243,11 @@ void IOptionsPage::setSettings(AspectContainer *settings) Sets \a categoryIcon as the category icon of the options page. */ -static QList<IOptionsPage *> g_optionsPages; +static QList<IOptionsPage *> &optionsPages() +{ + static QList<IOptionsPage *> thePages; + return thePages; +} /*! Constructs an options page and registers it @@ -243,7 +256,7 @@ static QList<IOptionsPage *> g_optionsPages; IOptionsPage::IOptionsPage(bool registerGlobally) { if (registerGlobally) - g_optionsPages.append(this); + optionsPages().append(this); } /*! @@ -251,7 +264,7 @@ IOptionsPage::IOptionsPage(bool registerGlobally) */ IOptionsPage::~IOptionsPage() { - g_optionsPages.removeOne(this); + optionsPages().removeOne(this); } /*! @@ -259,7 +272,7 @@ IOptionsPage::~IOptionsPage() */ const QList<IOptionsPage *> IOptionsPage::allOptionsPages() { - return g_optionsPages; + return optionsPages(); } /*! diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index 98275e76268..2c46fea9fdf 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -74,7 +74,8 @@ protected: void setDisplayCategory(const QString &displayCategory) { m_displayCategory = displayCategory; } void setCategoryIcon(const Utils::Icon &categoryIcon) { m_categoryIcon = categoryIcon; } void setCategoryIconPath(const Utils::FilePath &categoryIconPath); - void setSettings(Utils::AspectContainer *settings); + void setSettings(Utils::AspectContainer *settings); // FIXME: Remove. + void setSettingsProvider(const std::function<Utils::AspectContainer *()> &provider); // Used in FontSettingsPage. FIXME? QPointer<QWidget> m_widget; // Used in conjunction with m_widgetCreator @@ -90,7 +91,7 @@ private: mutable bool m_keywordsInitialized = false; mutable QStringList m_keywords; - Utils::AspectContainer *m_settings = nullptr; + std::function<Utils::AspectContainer *()> m_settingsProvider; }; /* From 3fab8be4b1d4e63a0b536d94e2c39cb004fa25bc Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 09:18:40 +0200 Subject: [PATCH 0153/1777] QmakeProjectManager: Delay settings creation until first use The guinea pig. Task-number: QTCREATORBUG-29167 Change-Id: Id0cbe77a5d7fcebbec71cd85cd017a71a0cba8ee Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../qmakeprojectmanagerplugin.cpp | 3 -- .../qmakeprojectmanager/qmakesettings.cpp | 33 ++++++++++++++----- .../qmakeprojectmanager/qmakesettings.h | 4 +-- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp index 61493bf05c3..c9665280b4d 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp @@ -13,7 +13,6 @@ #include "qmakeproject.h" #include "qmakeprojectmanagerconstants.h" #include "qmakeprojectmanagertr.h" -#include "qmakesettings.h" #include "qmakestep.h" #include "wizards/subdirsprojectwizard.h" @@ -80,8 +79,6 @@ public: ProFileEditorFactory profileEditorFactory; - QmakeSettings settings; - QmakeProject *m_previousStartupProject = nullptr; Target *m_previousTarget = nullptr; diff --git a/src/plugins/qmakeprojectmanager/qmakesettings.cpp b/src/plugins/qmakeprojectmanager/qmakesettings.cpp index e69526901f0..c5bb6a2890a 100644 --- a/src/plugins/qmakeprojectmanager/qmakesettings.cpp +++ b/src/plugins/qmakeprojectmanager/qmakesettings.cpp @@ -4,6 +4,9 @@ #include "qmakesettings.h" #include "qmakeprojectmanagertr.h" +#include <coreplugin/dialogs/ioptionspage.h> +#include <coreplugin/icore.h> + #include <projectexplorer/projectexplorerconstants.h> #include <utils/hostosinfo.h> @@ -13,17 +16,15 @@ using namespace Utils; namespace QmakeProjectManager::Internal { -static QmakeSettings *theSettings; - -QmakeSettings &settings() { return *theSettings; } +QmakeSettings &settings() +{ + static QmakeSettings theSettings; + return theSettings; +} QmakeSettings::QmakeSettings() { - theSettings = this; - - setId("K.QmakeProjectManager.QmakeSettings"); - setDisplayName(Tr::tr("Qmake")); - setCategory(ProjectExplorer::Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); + setAutoApply(false); setSettingsGroup("QmakeProjectManager"); warnAgainstUnalignedBuildDir.setSettingsKey("WarnAgainstUnalignedBuildDir"); @@ -58,7 +59,21 @@ QmakeSettings::QmakeSettings() }; }); - readSettings(); + readSettings(Core::ICore::settings()); } +class QmakeSettingsPage : public Core::IOptionsPage +{ +public: + QmakeSettingsPage() + { + setId("K.QmakeProjectManager.QmakeSettings"); + setDisplayName(Tr::tr("Qmake")); + setCategory(ProjectExplorer::Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); + setSettingsProvider([] { return &settings(); }); + } +}; + +static const QmakeSettingsPage settingsPage; + } // QmakeProjectManager::Internal diff --git a/src/plugins/qmakeprojectmanager/qmakesettings.h b/src/plugins/qmakeprojectmanager/qmakesettings.h index 9c2b277f538..90d08eafdc8 100644 --- a/src/plugins/qmakeprojectmanager/qmakesettings.h +++ b/src/plugins/qmakeprojectmanager/qmakesettings.h @@ -3,11 +3,11 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> namespace QmakeProjectManager::Internal { -class QmakeSettings : public Core::PagedSettings +class QmakeSettings : public Utils::AspectContainer { public: QmakeSettings(); From 596a687b4145926b32f6a35e3c61f7ccacec79e7 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 4 Jul 2023 20:04:30 +0200 Subject: [PATCH 0154/1777] RunControl: Add postMessage() Get rid of RunWorker::appendMessageChunk(). Reuse postMessage() in RunWorker::appendMessage(). Reuse it also in ClangTool and RunControlPrivate::showError(). Change-Id: I719a97385e675e7ee3075fcd5343dbcaab68bef7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/clangtools/clangtool.cpp | 4 ++-- src/plugins/projectexplorer/runcontrol.cpp | 21 +++++++++------------ src/plugins/projectexplorer/runcontrol.h | 2 +- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index 2062c4cb5c8..21130399c89 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -638,8 +638,8 @@ void ClangTool::startTool(ClangTool::FileSelection fileSelection, m_runControl->setTarget(project->activeTarget()); m_stopAction->disconnect(); connect(m_stopAction, &QAction::triggered, m_runControl, [this] { - emit m_runControl->appendMessage(Tr::tr("%1 tool stopped by user.").arg(m_name), - NormalMessageFormat); + m_runControl->postMessage(Tr::tr("%1 tool stopped by user.").arg(m_name), + NormalMessageFormat); m_runControl->initiateStop(); setState(State::StoppedByUser); }); diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index e89587a660d..05d5f77894d 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -469,6 +469,11 @@ bool RunControl::canRun(Id runMode, Id deviceType, Utils::Id runConfigId) return false; } +void RunControl::postMessage(const QString &msg, Utils::OutputFormat format, bool appendNewLine) +{ + emit appendMessage((appendNewLine && !msg.endsWith('\n')) ? msg + '\n': msg, format); +} + void RunControlPrivate::initiateStart() { checkState(RunControlState::Initialized); @@ -776,7 +781,7 @@ void RunControlPrivate::onWorkerStopped(RunWorker *worker) void RunControlPrivate::showError(const QString &msg) { if (!msg.isEmpty()) - emit q->appendMessage(msg + '\n', ErrorMessageFormat); + q->postMessage(msg + '\n', ErrorMessageFormat); } void RunControl::setupFormatter(OutputFormatter *formatter) const @@ -1269,7 +1274,7 @@ void SimpleTargetRunnerPrivate::handleStandardOutput() const QByteArray data = m_process.readAllRawStandardOutput(); const QString msg = m_outputCodec->toUnicode( data.constData(), data.length(), &m_outputCodecState); - q->appendMessageChunk(msg, StdOutFormat); + q->appendMessage(msg, StdOutFormat, false); } void SimpleTargetRunnerPrivate::handleStandardError() @@ -1277,7 +1282,7 @@ void SimpleTargetRunnerPrivate::handleStandardError() const QByteArray data = m_process.readAllRawStandardError(); const QString msg = m_outputCodec->toUnicode( data.constData(), data.length(), &m_errorCodecState); - q->appendMessageChunk(msg, StdErrFormat); + q->appendMessage(msg, StdErrFormat, false); } void SimpleTargetRunnerPrivate::start() @@ -1637,15 +1642,7 @@ void RunWorker::reportFailure(const QString &msg) */ void RunWorker::appendMessage(const QString &msg, OutputFormat format, bool appendNewLine) { - if (!appendNewLine || msg.endsWith('\n')) - emit d->runControl->appendMessage(msg, format); - else - emit d->runControl->appendMessage(msg + '\n', format); -} - -void RunWorker::appendMessageChunk(const QString &msg, OutputFormat format) -{ - emit d->runControl->appendMessage(msg, format); + d->runControl->postMessage(msg, format, appendNewLine); } IDevice::ConstPtr RunWorker::device() const diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index 5955e778710..f0ef7736ec8 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -68,7 +68,6 @@ public: // Part of read-only interface of RunControl for convenience. void appendMessage(const QString &msg, Utils::OutputFormat format, bool appendNewLine = true); - void appendMessageChunk(const QString &msg, Utils::OutputFormat format); IDeviceConstPtr device() const; // States @@ -232,6 +231,7 @@ public: bool createMainWorker(); static bool canRun(Utils::Id runMode, Utils::Id deviceType, Utils::Id runConfigId); + void postMessage(const QString &msg, Utils::OutputFormat format, bool appendNewLine = true); signals: void appendMessage(const QString &msg, Utils::OutputFormat format); From c58bf7f5b84c0d0710563b38407b26714dc1f3d1 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 6 Jul 2023 12:54:28 +0200 Subject: [PATCH 0155/1777] Editor: avoid accessing the widget from the FontSettingsPage Change-Id: I51dbf4d1c7384f460b84da9602c10667addabebb Reviewed-by: hjk <hjk@qt.io> --- src/plugins/texteditor/fontsettingspage.cpp | 14 ++++++++------ src/plugins/texteditor/texteditorsettings.cpp | 1 - 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index b57e23f35b8..44889864059 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -202,6 +202,8 @@ public: this, &FontSettingsPageWidget::importScheme); connect(exportButton, &QPushButton::clicked, this, &FontSettingsPageWidget::exportScheme); + connect(TextEditorSettings::instance(), &TextEditorSettings::fontSettingsChanged, + this, &FontSettingsPageWidget::updateFontZoom); updatePointSizes(); refreshColorSchemeList(); @@ -226,6 +228,7 @@ public: void maybeSaveColorScheme(); void updatePointSizes(); + void updateFontZoom(const FontSettings &fontSettings); QList<int> pointSizesForSelectedFont() const; void refreshColorSchemeList(); @@ -449,6 +452,11 @@ void FontSettingsPageWidget::updatePointSizes() m_sizeComboBox->setCurrentIndex(idx); } +void FontSettingsPageWidget::updateFontZoom(const FontSettings &fontSettings) +{ + m_zoomSpinBox->setValue(fontSettings.fontZoom()); +} + QList<int> FontSettingsPageWidget::pointSizesForSelectedFont() const { QFontDatabase db; @@ -774,10 +782,4 @@ FontSettingsPage::FontSettingsPage(FontSettings *fontSettings, const FormatDescr setWidgetCreator([this, fontSettings, fd] { return new FontSettingsPageWidget(this, fd, fontSettings); }); } -void FontSettingsPage::setFontZoom(int zoom) -{ - if (m_widget) - static_cast<FontSettingsPageWidget *>(m_widget.data())->m_zoomSpinBox->setValue(zoom); -} - } // TextEditor diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index 5e99fcf582f..6b3ee6e7b50 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -583,7 +583,6 @@ Utils::Id TextEditorSettings::languageId(const QString &mimeType) static void setFontZoom(int zoom) { - d->m_fontSettingsPage.setFontZoom(zoom); d->m_fontSettings.setFontZoom(zoom); d->m_fontSettings.toSettings(Core::ICore::settings()); emit m_instance->fontSettingsChanged(d->m_fontSettings); From a5ecc6207bdc657cc323119114d25e21372d42cd Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 4 Jul 2023 16:03:30 +0200 Subject: [PATCH 0156/1777] RunControl: Integrate alternative task tree mode Task-number: QTCREATORBUG-29168 Change-Id: Ida6d84b83b0f66b6f22701912b0d2c2d0cfb25d4 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/runcontrol.cpp | 70 ++++++++++++++++++++-- src/plugins/projectexplorer/runcontrol.h | 8 ++- 2 files changed, 71 insertions(+), 7 deletions(-) diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 05d5f77894d..f046764617c 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -21,6 +21,8 @@ #include <coreplugin/icore.h> +#include <solutions/tasking/tasktree.h> + #include <utils/algorithm.h> #include <utils/checkablemessagebox.h> #include <utils/fileinprojectfinder.h> @@ -256,6 +258,8 @@ public: RunControlState state = RunControlState::Initialized; bool printEnvironment = false; bool autoDelete = false; + bool m_supportsReRunning = true; + std::optional<Tasking::Group> m_runRecipe; }; class RunControlPrivate : public QObject, public RunControlPrivateData @@ -303,9 +307,12 @@ public: static bool isAllowedTransition(RunControlState from, RunControlState to); bool supportsReRunning() const; + bool isUsingTaskTree() const { return bool(m_runRecipe); } + void startTaskTree(); RunControl *q; Id runMode; + std::unique_ptr<Tasking::TaskTree> m_taskTree; }; } // Internal @@ -409,26 +416,49 @@ void RunControl::setAutoDeleteOnStop(bool autoDelete) d->autoDelete = autoDelete; } +void RunControl::setRunRecipe(const Tasking::Group &group) +{ + d->m_runRecipe = group; +} + void RunControl::initiateStart() { - emit aboutToStart(); - d->initiateStart(); + if (d->isUsingTaskTree()) { + d->startTaskTree(); + } else { + emit aboutToStart(); + d->initiateStart(); + } } void RunControl::initiateReStart() { - emit aboutToStart(); - d->initiateReStart(); + if (d->isUsingTaskTree()) { + d->startTaskTree(); + } else { + emit aboutToStart(); + d->initiateReStart(); + } } void RunControl::initiateStop() { - d->initiateStop(); + if (d->isUsingTaskTree()) { + d->m_taskTree.reset(); + emit stopped(); + } else { + d->initiateStop(); + } } void RunControl::forceStop() { - d->forceStop(); + if (d->isUsingTaskTree()) { + d->m_taskTree.reset(); + emit stopped(); + } else { + d->forceStop(); + } } RunWorker *RunControl::createWorker(Id workerId) @@ -991,8 +1021,15 @@ void RunControl::setPromptToStop(const std::function<bool (bool *)> &promptToSto d->promptToStop = promptToStop; } +void RunControl::setSupportsReRunning(bool reRunningSupported) +{ + d->m_supportsReRunning = reRunningSupported; +} + bool RunControl::supportsReRunning() const { + if (d->isUsingTaskTree()) + return d->m_supportsReRunning; return d->supportsReRunning(); } @@ -1007,18 +1044,39 @@ bool RunControlPrivate::supportsReRunning() const return true; } +void RunControlPrivate::startTaskTree() +{ + using namespace Tasking; + + m_taskTree.reset(new TaskTree(*m_runRecipe)); + connect(m_taskTree.get(), &TaskTree::started, q, &RunControl::started); + const auto finalize = [this] { + m_taskTree.release()->deleteLater(); + emit q->stopped(); + }; + connect(m_taskTree.get(), &TaskTree::done, this, finalize); + connect(m_taskTree.get(), &TaskTree::errorOccurred, this, finalize); + m_taskTree->start(); +} + bool RunControl::isRunning() const { + if (d->isUsingTaskTree()) + return d->m_taskTree.get(); return d->state == RunControlState::Running; } bool RunControl::isStarting() const { + if (d->isUsingTaskTree()) + return false; return d->state == RunControlState::Starting; } bool RunControl::isStopped() const { + if (d->isUsingTaskTree()) + return !d->m_taskTree.get(); return d->state == RunControlState::Stopped; } diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index f0ef7736ec8..5a31af66efe 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -19,6 +19,8 @@ #include <functional> #include <memory> +namespace Tasking { class Group; } + namespace Utils { class Icon; class MacroExpander; @@ -157,6 +159,8 @@ public: void setAutoDeleteOnStop(bool autoDelete); + void setRunRecipe(const Tasking::Group &group); + void initiateStart(); void initiateReStart(); void initiateStop(); @@ -165,6 +169,8 @@ public: bool promptToStop(bool *optionalPrompt = nullptr) const; void setPromptToStop(const std::function<bool(bool *)> &promptToStop); + // Note: Works only in the task tree mode + void setSupportsReRunning(bool reRunningSupported); bool supportsReRunning() const; QString displayName() const; @@ -238,7 +244,7 @@ signals: void aboutToStart(); void started(); void stopped(); - void applicationProcessHandleChanged(QPrivateSignal); // Use setApplicationProcessHandle + void applicationProcessHandleChanged(QPrivateSignal); private: void setDevice(const IDeviceConstPtr &device); From b196f5f0321b60773c22b4a5bd8ac9c5996b46ef Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 10:21:07 +0200 Subject: [PATCH 0157/1777] ProjectExplorer: Add a some convenience *Aspect::operator()() Similar to TypedAspect::operator()(). Task-number: QTCREATORBUG-29168 Change-Id: If8d5ad90e30e66309c4a4a06d9f96011efd00066 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/projectexplorer/runconfigurationaspects.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index 384181be730..7b2e453ad88 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -63,6 +63,7 @@ public: void addToLayout(Layouting::LayoutItem &parent) override; + Utils::FilePath operator()() const { return workingDirectory(); } Utils::FilePath workingDirectory() const; Utils::FilePath defaultWorkingDirectory() const; Utils::FilePath unexpandedWorkingDirectory() const; @@ -94,6 +95,7 @@ public: void addToLayout(Layouting::LayoutItem &parent) override; + QString operator()() const { return arguments(); } QString arguments() const; QString unexpandedArguments() const; @@ -160,6 +162,7 @@ public: explicit ExecutableAspect(Utils::AspectContainer *container = nullptr); ~ExecutableAspect() override; + Utils::FilePath operator()() const { return executable(); } Utils::FilePath executable() const; void setExecutable(const Utils::FilePath &executable); From c5a0ae6f34287ca0fb6a03adf2828038a2c4096e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= <robert.loehning@qt.io> Date: Thu, 6 Apr 2023 13:08:03 +0200 Subject: [PATCH 0158/1777] SquishTests: Require Python3 Change-Id: I6e53b3bf90d4d125315e4fa8d0877e8b76b6b3c5 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- tests/system/README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/system/README b/tests/system/README index a23c5001fdd..9e5843da25b 100644 --- a/tests/system/README +++ b/tests/system/README @@ -2,7 +2,8 @@ Prerequisites - general information ----------------------------------- Squish tests inside this folder have several prerequisites to get them running. -First - and most important - you have to own a valid Squish license. At least Squish 6.0 is required. +First - and most important - you have to own a valid Squish license. At least Squish 6.0 is +required. It must be configured to run tests written in Python3. Second - some of the test suites/test cases expect Qt versions to be installed in their default locations. For Qt5, this is ~/Qt5.x.1 on Linux/macOS or C:\Qt\Qt5.x.1 on Windows. For Qt6, this is From 09c3413cf372091a4b222ab508b10f9639b02dfd Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 4 Jul 2023 15:13:27 +0200 Subject: [PATCH 0159/1777] Utils: emit validChanged for the delayed valid check of FancyLineEdit and PathChooser Change-Id: I9719d32928d8166dfae7844af4eefc94ca143eb1 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 2 ++ src/libs/utils/aspects.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index b84a2abc73c..c58712ab008 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1122,6 +1122,7 @@ void StringAspect::addToLayout(LayoutItem &parent) }); } } + connect(d->m_pathChooserDisplay, &PathChooser::validChanged, this, &StringAspect::validChanged); break; case LineEditDisplay: d->m_lineEditDisplay = createSubWidget<FancyLineEdit>(); @@ -1167,6 +1168,7 @@ void StringAspect::addToLayout(LayoutItem &parent) }); parent.addItem(resetButton); } + connect(d->m_lineEditDisplay, &FancyLineEdit::validChanged, this, &StringAspect::validChanged); break; case TextEditDisplay: d->m_textEditDisplay = createSubWidget<QTextEdit>(); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 72c35d4c5a0..976aa259d46 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -507,6 +507,7 @@ public: signals: void checkedChanged(); + void validChanged(bool validState); protected: void internalToGui() override; From e7e3da08933f9ee6a20475a8d2c593d6b9d5c53a Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 4 Jul 2023 15:14:04 +0200 Subject: [PATCH 0160/1777] Python: Fix updating the python venv chooser state label Change-Id: I45aa1495388dc58b541814430d1b4dfbd80ec677 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/python/pythonwizardpage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/python/pythonwizardpage.cpp b/src/plugins/python/pythonwizardpage.cpp index f74e5a90b72..97e772fc237 100644 --- a/src/plugins/python/pythonwizardpage.cpp +++ b/src/plugins/python/pythonwizardpage.cpp @@ -109,7 +109,7 @@ PythonWizardPage::PythonWizardPage(const QList<QPair<QString, QVariant>> &pySide m_stateLabel->setWordWrap(true); m_stateLabel->setFilled(true); m_stateLabel->setType(InfoLabel::Error); - connect(&m_venvPath, &BaseAspect::changed, this, &PythonWizardPage::updateStateLabel); + connect(&m_venvPath, &StringAspect::validChanged, this, &PythonWizardPage::updateStateLabel); connect(&m_createVenv, &BaseAspect::changed, this, &PythonWizardPage::updateStateLabel); Grid { From 573f3e7185d8ef3e426ab677f963d4ae1a098cd0 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 11:05:43 +0200 Subject: [PATCH 0161/1777] Vcpkg: Delay VcpkgSettings creation until first use Task-number: QTCREATORBUG-29167 Change-Id: I249aed1661a6435d9c4bf1e1be1f7750cca4fce8 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/vcpkg/vcpkgplugin.cpp | 2 -- src/plugins/vcpkg/vcpkgsettings.cpp | 26 ++++++++++++++++++-------- src/plugins/vcpkg/vcpkgsettings.h | 4 ++-- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/plugins/vcpkg/vcpkgplugin.cpp b/src/plugins/vcpkg/vcpkgplugin.cpp index 4ef89499a76..d6d323d7372 100644 --- a/src/plugins/vcpkg/vcpkgplugin.cpp +++ b/src/plugins/vcpkg/vcpkgplugin.cpp @@ -7,7 +7,6 @@ #include "vcpkg_test.h" #endif // WITH_TESTS #include "vcpkgmanifesteditor.h" -#include "vcpkgsettings.h" #include <projectexplorer/jsonwizard/jsonwizardfactory.h> @@ -17,7 +16,6 @@ class VcpkgPluginPrivate { public: VcpkgManifestEditorFactory manifestEditorFactory; - VcpkgSettings settings; }; VcpkgPlugin::~VcpkgPlugin() diff --git a/src/plugins/vcpkg/vcpkgsettings.cpp b/src/plugins/vcpkg/vcpkgsettings.cpp index aa223651cf2..21d3b239dd1 100644 --- a/src/plugins/vcpkg/vcpkgsettings.cpp +++ b/src/plugins/vcpkg/vcpkgsettings.cpp @@ -6,6 +6,8 @@ #include "vcpkgconstants.h" #include "vcpkgtr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <cmakeprojectmanager/cmakeprojectconstants.h> #include <utils/environment.h> @@ -19,21 +21,15 @@ using namespace Utils; namespace Vcpkg::Internal { -static VcpkgSettings *theSettings = nullptr; - VcpkgSettings &settings() { - return *theSettings; + static VcpkgSettings theSettings; + return theSettings; } VcpkgSettings::VcpkgSettings() { - theSettings = this; - setSettingsGroup("Vcpkg"); - setId(Constants::TOOLSSETTINGSPAGE_ID); - setDisplayName("Vcpkg"); - setCategory(CMakeProjectManager::Constants::Settings::CATEGORY); vcpkgRoot.setSettingsKey("VcpkgRoot"); vcpkgRoot.setExpectedKind(PathChooser::ExistingDirectory); @@ -72,4 +68,18 @@ VcpkgSettings::VcpkgSettings() readSettings(); } +class VcpkgSettingsPage : public Core::IOptionsPage +{ +public: + VcpkgSettingsPage() + { + setId(Constants::TOOLSSETTINGSPAGE_ID); + setDisplayName("Vcpkg"); + setCategory(CMakeProjectManager::Constants::Settings::CATEGORY); + setSettingsProvider([] { return &settings(); }); + } +}; + +static const VcpkgSettingsPage settingsPage; + } // Vcpkg::Internal diff --git a/src/plugins/vcpkg/vcpkgsettings.h b/src/plugins/vcpkg/vcpkgsettings.h index 6a00fd506f7..dd266ad3716 100644 --- a/src/plugins/vcpkg/vcpkgsettings.h +++ b/src/plugins/vcpkg/vcpkgsettings.h @@ -3,11 +3,11 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> namespace Vcpkg::Internal { -class VcpkgSettings : public Core::PagedSettings +class VcpkgSettings : public Utils::AspectContainer { public: VcpkgSettings(); From b1f001dbd407196efca68adb3ea04674c354f657 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 11:13:52 +0200 Subject: [PATCH 0162/1777] Vcpgk: Consolidate plugin setup code Change-Id: If698d9e28ba86f536416fda6090b297c16159a72 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/vcpkg/CMakeLists.txt | 2 +- src/plugins/vcpkg/vcpkg.qbs | 1 - src/plugins/vcpkg/vcpkgplugin.cpp | 31 +++++++++++++++---------------- src/plugins/vcpkg/vcpkgplugin.h | 26 -------------------------- 4 files changed, 16 insertions(+), 44 deletions(-) delete mode 100644 src/plugins/vcpkg/vcpkgplugin.h diff --git a/src/plugins/vcpkg/CMakeLists.txt b/src/plugins/vcpkg/CMakeLists.txt index d3fb8d00ed8..ba5f156a4ee 100644 --- a/src/plugins/vcpkg/CMakeLists.txt +++ b/src/plugins/vcpkg/CMakeLists.txt @@ -4,7 +4,7 @@ add_qtc_plugin(Vcpkg vcpkg.qrc vcpkgconstants.h vcpkgmanifesteditor.cpp vcpkgmanifesteditor.h - vcpkgplugin.cpp vcpkgplugin.h + vcpkgplugin.cpp vcpkgsearch.cpp vcpkgsearch.h vcpkgsettings.cpp vcpkgsettings.h ) diff --git a/src/plugins/vcpkg/vcpkg.qbs b/src/plugins/vcpkg/vcpkg.qbs index dff796ab917..95bcc1e71d7 100644 --- a/src/plugins/vcpkg/vcpkg.qbs +++ b/src/plugins/vcpkg/vcpkg.qbs @@ -16,7 +16,6 @@ QtcPlugin { "vcpkgmanifesteditor.cpp", "vcpkgmanifesteditor.h", "vcpkgplugin.cpp", - "vcpkgplugin.h", "vcpkgsearch.cpp", "vcpkgsearch.h", "vcpkgsettings.cpp", diff --git a/src/plugins/vcpkg/vcpkgplugin.cpp b/src/plugins/vcpkg/vcpkgplugin.cpp index d6d323d7372..0da92e723c1 100644 --- a/src/plugins/vcpkg/vcpkgplugin.cpp +++ b/src/plugins/vcpkg/vcpkgplugin.cpp @@ -1,36 +1,35 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "vcpkgplugin.h" - #ifdef WITH_TESTS #include "vcpkg_test.h" #endif // WITH_TESTS #include "vcpkgmanifesteditor.h" +#include <extensionsystem/iplugin.h> + #include <projectexplorer/jsonwizard/jsonwizardfactory.h> namespace Vcpkg::Internal { -class VcpkgPluginPrivate +class VcpkgPlugin final : public ExtensionSystem::IPlugin { + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Vcpkg.json") + public: - VcpkgManifestEditorFactory manifestEditorFactory; -}; + void initialize() final + { + ProjectExplorer::JsonWizardFactory::addWizardPath(":/vcpkg/wizards/"); -VcpkgPlugin::~VcpkgPlugin() -{ - delete d; -} - -void VcpkgPlugin::initialize() -{ - d = new VcpkgPluginPrivate; - ProjectExplorer::JsonWizardFactory::addWizardPath(":/vcpkg/wizards/"); + addManaged<VcpkgManifestEditorFactory>(); #ifdef WITH_TESTS - addTest<VcpkgSearchTest>(); + addTest<VcpkgSearchTest>(); #endif -} + } +}; } // namespace Vcpkg::Internal + +#include "vcpkgplugin.moc" diff --git a/src/plugins/vcpkg/vcpkgplugin.h b/src/plugins/vcpkg/vcpkgplugin.h deleted file mode 100644 index 797083ea956..00000000000 --- a/src/plugins/vcpkg/vcpkgplugin.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <extensionsystem/iplugin.h> - -namespace ProjectExplorer { class Project; } - -namespace Vcpkg::Internal { - -class VcpkgPlugin final : public ExtensionSystem::IPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Vcpkg.json") - -public: - ~VcpkgPlugin(); - - void initialize() final; - -private: - class VcpkgPluginPrivate *d = nullptr; -}; - -} // namespace Vcpkg::Internal From bff07c9ef6ae6cfb190ecc73c9d0d3d8cfde0fbc Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 2 Jun 2023 15:12:29 +0200 Subject: [PATCH 0163/1777] Core: Use LayoutBuilder for OutputPaneManager Change-Id: I071491c69bc4aad9b629d9b275f256521205c8cf Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/outputpanemanager.cpp | 68 ++++++++++---------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index 037779f0bfb..faa858a6128 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -20,10 +20,11 @@ #include <utils/algorithm.h> #include <utils/hostosinfo.h> -#include <utils/styledbar.h> -#include <utils/stylehelper.h> +#include <utils/layoutbuilder.h> #include <utils/proxyaction.h> #include <utils/qtcassert.h> +#include <utils/styledbar.h> +#include <utils/stylehelper.h> #include <utils/theme/theme.h> #include <utils/utilsicons.h> @@ -32,14 +33,14 @@ #include <QComboBox> #include <QDebug> #include <QFocusEvent> -#include <QHBoxLayout> #include <QLabel> +#include <QLayout> #include <QMenu> #include <QPainter> -#include <QStyle> #include <QStackedWidget> -#include <QToolButton> +#include <QStyle> #include <QTimeLine> +#include <QToolButton> using namespace Utils; using namespace Core::Internal; @@ -341,35 +342,37 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) : connect(ICore::instance(), &ICore::saveSettingsRequested, this, &OutputPaneManager::saveSettings); - auto mainlayout = new QVBoxLayout; - mainlayout->setSpacing(0); - mainlayout->setContentsMargins(0, 0, 0, 0); m_toolBar = new StyledBar; - auto toolLayout = new QHBoxLayout(m_toolBar); - toolLayout->setContentsMargins(0, 0, 0, 0); - toolLayout->setSpacing(0); - toolLayout->addWidget(m_titleLabel); - toolLayout->addWidget(new StyledSeparator); m_clearButton = new QToolButton; - toolLayout->addWidget(m_clearButton); m_prevToolButton = new QToolButton; - toolLayout->addWidget(m_prevToolButton); m_nextToolButton = new QToolButton; - toolLayout->addWidget(m_nextToolButton); - toolLayout->addWidget(m_opToolBarWidgets); - toolLayout->addWidget(m_minMaxButton); - toolLayout->addWidget(m_closeButton); - mainlayout->addWidget(m_toolBar); - mainlayout->addWidget(m_outputWidgetPane, 10); - mainlayout->addWidget(new FindToolBarPlaceHolder(this)); - setLayout(mainlayout); m_buttonsWidget = new QWidget; m_buttonsWidget->setObjectName("OutputPaneButtons"); // used for UI introduction - m_buttonsWidget->setLayout(new QHBoxLayout); - m_buttonsWidget->layout()->setContentsMargins(5,0,0,0); - m_buttonsWidget->layout()->setSpacing( - creatorTheme()->flag(Theme::FlatToolBars) ? 9 : 4); + + using namespace Layouting; + Row { + m_titleLabel, + new StyledSeparator, + m_clearButton, + m_prevToolButton, + m_nextToolButton, + m_opToolBarWidgets, + m_minMaxButton, + m_closeButton, + spacing(0), noMargin(), + }.attachTo(m_toolBar); + + Column { + m_toolBar, + m_outputWidgetPane, + new FindToolBarPlaceHolder(this), + spacing(0), noMargin(), + }.attachTo(this); + + Row { + spacing(creatorTheme()->flag(Theme::FlatToolBars) ? 9 : 4), customMargin({5, 0, 0, 0}), + }.attachTo(m_buttonsWidget); StatusBarManager::addStatusBarWidget(m_buttonsWidget, StatusBarManager::Second); @@ -452,14 +455,13 @@ void OutputPaneManager::initialize() }); QWidget *toolButtonsContainer = new QWidget(m_instance->m_opToolBarWidgets); - auto toolButtonsLayout = new QHBoxLayout; - toolButtonsLayout->setContentsMargins(0, 0, 0, 0); - toolButtonsLayout->setSpacing(0); + using namespace Layouting; + Row toolButtonsRow { spacing(0), noMargin() }; const QList<QWidget *> toolBarWidgets = outPane->toolBarWidgets(); for (QWidget *toolButton : toolBarWidgets) - toolButtonsLayout->addWidget(toolButton); - toolButtonsLayout->addStretch(5); - toolButtonsContainer->setLayout(toolButtonsLayout); + toolButtonsRow.addItem(toolButton); + toolButtonsRow.addItem(st); + toolButtonsRow.attachTo(toolButtonsContainer); m_instance->m_opToolBarWidgets->addWidget(toolButtonsContainer); From a255ec3c845eb02779ec7adc9eb305046e886f1a Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 2 Jun 2023 16:11:24 +0200 Subject: [PATCH 0164/1777] Core: Cleanup OutputPaneManager class declaration a bit Some members were only accessed locally. Change-Id: I217da1028d7365b8ed5c188136eea1b56175d715 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/outputpanemanager.cpp | 62 ++++++++++---------- src/plugins/coreplugin/outputpanemanager.h | 10 ---- 2 files changed, 30 insertions(+), 42 deletions(-) diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index faa858a6128..7f46e63f29c 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -285,10 +285,12 @@ void OutputPaneManager::updateStatusButtons(bool visible) void OutputPaneManager::updateMaximizeButton(bool maximized) { if (maximized) { - m_instance->m_minMaxAction->setIcon(m_instance->m_minimizeIcon); + static const QIcon icon = Utils::Icons::ARROW_DOWN.icon(); + m_instance->m_minMaxAction->setIcon(icon); m_instance->m_minMaxAction->setText(Tr::tr("Minimize")); } else { - m_instance->m_minMaxAction->setIcon(m_instance->m_maximizeIcon); + static const QIcon icon = Utils::Icons::ARROW_UP.icon(); + m_instance->m_minMaxAction->setIcon(icon); m_instance->m_minMaxAction->setText(Tr::tr("Maximize")); } } @@ -307,21 +309,17 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) : QWidget(parent), m_titleLabel(new QLabel), m_manageButton(new OutputPaneManageButton), - m_closeButton(new QToolButton), - m_minMaxButton(new QToolButton), m_outputWidgetPane(new QStackedWidget), - m_opToolBarWidgets(new QStackedWidget), - m_minimizeIcon(Utils::Icons::ARROW_DOWN.icon()), - m_maximizeIcon(Utils::Icons::ARROW_UP.icon()) + m_opToolBarWidgets(new QStackedWidget) { setWindowTitle(Tr::tr("Output")); m_titleLabel->setContentsMargins(5, 0, 5, 0); - m_clearAction = new QAction(this); - m_clearAction->setIcon(Utils::Icons::CLEAN.icon()); - m_clearAction->setText(Tr::tr("Clear")); - connect(m_clearAction, &QAction::triggered, this, &OutputPaneManager::clearPage); + auto clearAction = new QAction(this); + clearAction->setIcon(Utils::Icons::CLEAN.icon()); + clearAction->setText(Tr::tr("Clear")); + connect(clearAction, &QAction::triggered, this, &OutputPaneManager::clearPage); m_nextAction = new QAction(this); m_nextAction->setIcon(Utils::Icons::ARROW_DOWN_TOOLBAR.icon()); @@ -334,18 +332,18 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) : connect(m_prevAction, &QAction::triggered, this, &OutputPaneManager::slotPrev); m_minMaxAction = new QAction(this); - m_minMaxAction->setIcon(m_maximizeIcon); - m_minMaxAction->setText(Tr::tr("Maximize")); - m_closeButton->setIcon(Icons::CLOSE_SPLIT_BOTTOM.icon()); - connect(m_closeButton, &QAbstractButton::clicked, this, &OutputPaneManager::slotHide); + auto closeButton = new QToolButton; + closeButton->setIcon(Icons::CLOSE_SPLIT_BOTTOM.icon()); + connect(closeButton, &QAbstractButton::clicked, this, &OutputPaneManager::slotHide); connect(ICore::instance(), &ICore::saveSettingsRequested, this, &OutputPaneManager::saveSettings); - m_toolBar = new StyledBar; - m_clearButton = new QToolButton; - m_prevToolButton = new QToolButton; - m_nextToolButton = new QToolButton; + auto toolBar = new StyledBar; + auto clearButton = new QToolButton; + auto prevToolButton = new QToolButton; + auto nextToolButton = new QToolButton; + auto minMaxButton = new QToolButton; m_buttonsWidget = new QWidget; m_buttonsWidget->setObjectName("OutputPaneButtons"); // used for UI introduction @@ -354,17 +352,17 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) : Row { m_titleLabel, new StyledSeparator, - m_clearButton, - m_prevToolButton, - m_nextToolButton, + clearButton, + prevToolButton, + nextToolButton, m_opToolBarWidgets, - m_minMaxButton, - m_closeButton, + minMaxButton, + closeButton, spacing(0), noMargin(), - }.attachTo(m_toolBar); + }.attachTo(toolBar); Column { - m_toolBar, + toolBar, m_outputWidgetPane, new FindToolBarPlaceHolder(this), spacing(0), noMargin(), @@ -387,19 +385,19 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) : Command *cmd; - cmd = ActionManager::registerAction(m_clearAction, Constants::OUTPUTPANE_CLEAR); - m_clearButton->setDefaultAction( - ProxyAction::proxyActionWithIcon(m_clearAction, Utils::Icons::CLEAN_TOOLBAR.icon())); + cmd = ActionManager::registerAction(clearAction, Constants::OUTPUTPANE_CLEAR); + clearButton->setDefaultAction( + ProxyAction::proxyActionWithIcon(clearAction, Utils::Icons::CLEAN_TOOLBAR.icon())); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); cmd = ActionManager::registerAction(m_prevAction, "Coreplugin.OutputPane.previtem"); cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Shift+F6"))); - m_prevToolButton->setDefaultAction( + prevToolButton->setDefaultAction( ProxyAction::proxyActionWithIcon(m_prevAction, Utils::Icons::ARROW_UP_TOOLBAR.icon())); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); cmd = ActionManager::registerAction(m_nextAction, "Coreplugin.OutputPane.nextitem"); - m_nextToolButton->setDefaultAction( + nextToolButton->setDefaultAction( ProxyAction::proxyActionWithIcon(m_nextAction, Utils::Icons::ARROW_DOWN_TOOLBAR.icon())); cmd->setDefaultKeySequence(QKeySequence(Tr::tr("F6"))); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); @@ -410,7 +408,7 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) : cmd->setAttribute(Command::CA_UpdateIcon); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); connect(m_minMaxAction, &QAction::triggered, this, &OutputPaneManager::toggleMaximized); - m_minMaxButton->setDefaultAction(cmd->action()); + minMaxButton->setDefaultAction(cmd->action()); mpanes->addSeparator("Coreplugin.OutputPane.ActionsGroup"); } diff --git a/src/plugins/coreplugin/outputpanemanager.h b/src/plugins/coreplugin/outputpanemanager.h index 7dc7085d534..f3e62d026f0 100644 --- a/src/plugins/coreplugin/outputpanemanager.h +++ b/src/plugins/coreplugin/outputpanemanager.h @@ -67,24 +67,14 @@ private: QLabel *m_titleLabel = nullptr; OutputPaneManageButton *m_manageButton = nullptr; - QAction *m_clearAction = nullptr; - QToolButton *m_clearButton = nullptr; - QToolButton *m_closeButton = nullptr; QAction *m_minMaxAction = nullptr; - QToolButton *m_minMaxButton = nullptr; - QAction *m_nextAction = nullptr; QAction *m_prevAction = nullptr; - QToolButton *m_prevToolButton = nullptr; - QToolButton *m_nextToolButton = nullptr; - QWidget *m_toolBar = nullptr; QStackedWidget *m_outputWidgetPane = nullptr; QStackedWidget *m_opToolBarWidgets = nullptr; QWidget *m_buttonsWidget = nullptr; - QIcon m_minimizeIcon; - QIcon m_maximizeIcon; int m_outputPaneHeightSetting = 0; }; From fd83aa0bf76600f8227bd85e387944111db69727 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 15:28:46 +0200 Subject: [PATCH 0165/1777] CMake: Don't guess at build config when not needed Change-Id: I0d7fb0a25103d2cf5bfb9b2d54bae18a91010c49 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../cmakebuildconfiguration.cpp | 15 +++++---------- .../cmakeprojectmanager/cmakebuildconfiguration.h | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 76261a01dd7..4b11176e73a 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1441,7 +1441,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) addAspect<BuildTypeAspect>(); addAspect<QtSupport::QmlDebuggingAspect>(this); - addAspect<ConfigureEnvironmentAspect>(target); + addAspect<ConfigureEnvironmentAspect>(this); setInitialBuildAndCleanSteps(target); @@ -2254,8 +2254,9 @@ public: } }; -ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(ProjectExplorer::Target *target) +ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(BuildConfiguration *bc) { + Target *target = bc->target(); setIsLocal(true); setAllowPrintOnRun(false); setConfigWidgetCreator( @@ -2268,14 +2269,8 @@ ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(ProjectExplorer::Target * return device ? device->systemEnvironment() : Environment::systemEnvironment(); }); - const int buildEnvIndex = addSupportedBaseEnvironment(Tr::tr("Build Environment"), [target] { - Environment env; - if (BuildConfiguration *bc = target->activeBuildConfiguration()) { - env = bc->environment(); - } else { // Fallback for targets without buildconfigurations: - env = target->kit()->buildEnvironment(); - } - return env; + const int buildEnvIndex = addSupportedBaseEnvironment(Tr::tr("Build Environment"), [bc] { + return bc->environment(); }); connect(target, diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index bf7ff14c74b..ae0913f23d1 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -142,7 +142,7 @@ class ConfigureEnvironmentAspect final: public ProjectExplorer::EnvironmentAspec Q_OBJECT public: - ConfigureEnvironmentAspect(ProjectExplorer::Target *target); + explicit ConfigureEnvironmentAspect(ProjectExplorer::BuildConfiguration *buildConfig); void fromMap(const QVariantMap &map); void toMap(QVariantMap &map) const; From 77edffe3cf80de99b4330ca1cf942556b48c02e4 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 23 Jun 2023 09:14:05 +0200 Subject: [PATCH 0166/1777] Debugger: Support linux remote debugging with LLDB Adds support for Linux remote debugging with lldb-server Change-Id: I3ee08704a3116030111df75273a46a2e4888f98e Reviewed-by: hjk <hjk@qt.io> --- share/qtcreator/debugger/lldbbridge.py | 46 ++++++++++++++++----- src/plugins/debugger/debuggerruncontrol.cpp | 21 +++++++++- src/plugins/debugger/lldb/lldbengine.cpp | 1 - 3 files changed, 56 insertions(+), 12 deletions(-) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index b1d7ee3549a..4c5cec7a0ed 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -972,30 +972,56 @@ class Dumper(DumperBase): self.remoteChannel_, None, error) else: if self.platform_ == "remote-macosx": - DumperBase.warn("TARGET: %s" % self.target) - + self.report("Connecting to remote target: connect://%s" % self.remoteChannel_) self.process = self.target.ConnectRemote( self.debugger.GetListener(), "connect://" + self.remoteChannel_, None, error) + if not error.Success(): + self.report("Failed to connect to remote target: %s" % error.GetCString()) + self.reportState('enginerunfailed') + return + if self.breakOnMain_: self.createBreakpointAtMain() - DumperBase.warn("PROCESS: %s" % self.process) - else: + DumperBase.warn("PROCESS: %s (%s)" % (self.process, error.Success() and "Success" or error.GetCString())) + elif self.platform_ == "remote-linux": + self.report("Connecting to remote target: connect://%s" % self.remoteChannel_) + + platform = self.target.GetPlatform() + url = "connect://" + self.remoteChannel_ + conOptions = lldb.SBPlatformConnectOptions(url) + error = platform.ConnectRemote(conOptions) + + if not error.Success(): + self.report("Failed to connect to remote target (%s): %s" % (url, error.GetCString())) + self.reportState('enginerunfailed') + return + f = lldb.SBFileSpec() f.SetFilename(self.executable_) - launchInfo = lldb.SBLaunchInfo(self.processArgs_) - #launchInfo.SetWorkingDirectory(self.workingDirectory_) + launchInfo.SetWorkingDirectory(self.workingDirectory_) launchInfo.SetWorkingDirectory('/tmp') - if self.platform_ == 'remote-android': - launchInfo.SetWorkingDirectory('/data/local/tmp') launchInfo.SetEnvironmentEntries(self.environment_, False) launchInfo.SetExecutableFile(f, True) - DumperBase.warn("TARGET: %s" % self.target) self.process = self.target.Launch(launchInfo, error) - DumperBase.warn("PROCESS: %s" % self.process) + + if not error.Success(): + self.report("Failed to launch remote target: %s" % (error.GetCString())) + self.reportState('enginerunfailed') + return + else: + self.report("Process has launched.") + + if self.breakOnMain_: + self.createBreakpointAtMain() + + else: + self.report("Unsupported platform: %s" % self.platform_) + self.reportState('enginerunfailed') + return if not error.Success(): self.report(self.describeError(error)) diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 480a2cedda1..fa2aa3da693 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -1068,7 +1068,26 @@ DebugServerRunner::DebugServerRunner(RunControl *runControl, DebugServerPortsGat cmd.setExecutable(lldbserver); } } else { - cmd.setExecutable(runControl->device()->filePath("gdbserver")); + const FilePath gdbServerPath + = runControl->device()->filePath("gdbserver").searchInPath(); + FilePath lldbServerPath + = runControl->device()->filePath("lldb-server").searchInPath(); + + // TODO: Which one should we prefer? + if (gdbServerPath.isExecutableFile()) + cmd.setExecutable(gdbServerPath); + else if (lldbServerPath.isExecutableFile()) { + // lldb-server will fail if we start it through a link. + // see: https://github.com/llvm/llvm-project/issues/61955 + // + // So we first search for the real executable. + + // This is safe because we already checked that the file is executable. + while (lldbServerPath.isSymLink()) + lldbServerPath = lldbServerPath.symLinkTarget(); + + cmd.setExecutable(lldbServerPath); + } } } if (cmd.executable().baseName().contains("lldb-server")) { diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index f7667e40e29..d46b86fa871 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -295,7 +295,6 @@ void LldbEngine::handleLldbStarted() cmd2.arg("remotechannel", ((rp.startMode == AttachToRemoteProcess || rp.startMode == AttachToRemoteServer) ? rp.remoteChannel : QString())); - cmd2.arg("platform", rp.platform); QTC_CHECK(!rp.continueAfterAttach || (rp.startMode == AttachToRemoteProcess || rp.startMode == AttachToLocalProcess || rp.startMode == AttachToRemoteServer)); From 552b325072d0bde61ae0095eabfb15d757ba6a7b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 16:25:01 +0200 Subject: [PATCH 0167/1777] Vcpkg: Compile fix Amends 573f3e7185d8 which went in too early. Change-Id: Ied93fd585aa26cb931f3acf13b55fbf7dbe0c163 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/vcpkg/vcpkgsettings.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/vcpkg/vcpkgsettings.cpp b/src/plugins/vcpkg/vcpkgsettings.cpp index 21d3b239dd1..ac7bf8ba32c 100644 --- a/src/plugins/vcpkg/vcpkgsettings.cpp +++ b/src/plugins/vcpkg/vcpkgsettings.cpp @@ -7,6 +7,7 @@ #include "vcpkgtr.h" #include <coreplugin/dialogs/ioptionspage.h> +#include <coreplugin/icore.h> #include <cmakeprojectmanager/cmakeprojectconstants.h> @@ -65,7 +66,7 @@ VcpkgSettings::VcpkgSettings() // clang-format on }); - readSettings(); + readSettings(Core::ICore::settings()); } class VcpkgSettingsPage : public Core::IOptionsPage From f9fb3f48723f99159925ec9f2b0d940b522fcba4 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 5 Jul 2023 18:36:21 +0200 Subject: [PATCH 0168/1777] ClangTool: Transform ClangToolRunWorker into runRecipe Task-number: QTCREATORBUG-29168 Change-Id: I1b42de2d148c84393b44c84730c8535a1d2a389c Reviewed-by: hjk <hjk@qt.io> --- src/plugins/clangtools/clangtool.cpp | 290 ++++++++++++++++++++++----- src/plugins/clangtools/clangtool.h | 42 +--- 2 files changed, 249 insertions(+), 83 deletions(-) diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index 21130399c89..c66f4faf41b 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -5,7 +5,7 @@ #include "clangfixitsrefactoringchanges.h" #include "clangselectablefilesdialog.h" -#include "clangtoolruncontrol.h" +#include "clangtoolrunner.h" #include "clangtoolsconstants.h" #include "clangtoolsdiagnostic.h" #include "clangtoolsdiagnosticmodel.h" @@ -15,6 +15,7 @@ #include "clangtoolssettings.h" #include "clangtoolstr.h" #include "clangtoolsutils.h" +#include "executableinfo.h" #include "filterdialog.h" #include <coreplugin/actionmanager/actioncontainer.h> @@ -23,6 +24,7 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/icore.h> #include <coreplugin/messagebox.h> +#include <coreplugin/progressmanager/taskprogress.h> #include <cppeditor/clangdiagnosticconfigsmodel.h> #include <cppeditor/cppmodelmanager.h> @@ -30,14 +32,18 @@ #include <debugger/analyzer/analyzermanager.h> #include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/buildmanager.h> #include <projectexplorer/kitinformation.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorericons.h> #include <projectexplorer/projectmanager.h> +#include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> #include <projectexplorer/taskhub.h> +#include <solutions/tasking/tasktree.h> + #include <texteditor/textdocument.h> #include <utils/algorithm.h> @@ -47,6 +53,8 @@ #include <utils/infolabel.h> #include <utils/progressindicator.h> #include <utils/proxyaction.h> +#include <utils/stringutils.h> +#include <utils/temporarydirectory.h> #include <utils/utilsicons.h> #include <QAction> @@ -54,6 +62,7 @@ #include <QDesktopServices> #include <QHBoxLayout> #include <QLabel> +#include <QLoggingCategory> #include <QToolButton> using namespace Core; @@ -62,8 +71,42 @@ using namespace Debugger; using namespace ProjectExplorer; using namespace Utils; -namespace ClangTools { -namespace Internal { +static Q_LOGGING_CATEGORY(LOG, "qtc.clangtools.runcontrol", QtWarningMsg) + +namespace ClangTools::Internal { + +class ProjectBuilderTaskAdapter : public Tasking::TaskAdapter<QPointer<Target>> +{ +public: + void start() final { + connect(BuildManager::instance(), &BuildManager::buildQueueFinished, + this, &TaskInterface::done); + Target *target = *task(); + QTC_ASSERT(target, emit done(false); return); + if (!BuildManager::isBuilding(target)) + BuildManager::buildProjectWithDependencies(target->project()); + } +}; + +} // namespace ClangTools::Internal + +TASKING_DECLARE_TASK(ProjectBuilderTask, ClangTools::Internal::ProjectBuilderTaskAdapter); + +namespace ClangTools::Internal { + +static QDebug operator<<(QDebug debug, const Utils::Environment &environment) +{ + for (const QString &entry : environment.toStringList()) + debug << "\n " << entry; + return debug; +} + +static QDebug operator<<(QDebug debug, const AnalyzeUnits &analyzeUnits) +{ + for (const AnalyzeUnit &unit : analyzeUnits) + debug << "\n " << unit.file; + return debug; +} static QString makeLink(const QString &text) { @@ -606,6 +649,187 @@ static bool continueDespiteReleaseBuild(const QString &toolName) == QMessageBox::Yes; } +Tasking::Group ClangTool::runRecipe(const RunSettings &runSettings, + const ClangDiagnosticConfig &diagnosticConfig, + const FileInfos &fileInfos, bool buildBeforeAnalysis) +{ + m_filesCount = fileInfos.size(); + + using namespace Tasking; + + struct ClangStorage { + ClangStorage() { m_timer.start(); } + ~ClangStorage() { + if (m_elapsedHandler) + m_elapsedHandler(m_timer.elapsed()); + } + QElapsedTimer m_timer; + std::function<void(qint64 elapsedTime)> m_elapsedHandler = {}; + }; + const TreeStorage<ClangStorage> storage; + + std::shared_ptr<TemporaryDirectory> tempDir(new TemporaryDirectory("clangtools-XXXXXX")); + tempDir->setAutoRemove(qtcEnvironmentVariable("QTC_CLANG_DONT_DELETE_OUTPUT_FILES") != "1"); + + Target *target = m_runControl->target(); + BuildConfiguration *buildConfiguration = target->activeBuildConfiguration(); + QTC_ASSERT(buildConfiguration, return {}); + const Environment environment = buildConfiguration->environment(); + + const auto onTopSetup = [this, tempDir] { + if (tempDir->isValid()) + return SetupResult::Continue; + m_infoBarWidget->setError(InfoBarWidget::Error, + makeLink(Tr::tr("Failed to start the analyzer.")), + [this] { showOutputPane(); }); + m_runControl->postMessage(Tr::tr("Failed to create temporary directory: %1.") + .arg(tempDir->errorString()), ErrorMessageFormat); + setState(State::PreparationFailed); + return SetupResult::StopWithError; + }; + + QList<GroupItem> topTasks { onGroupSetup(onTopSetup) }; + + if (buildBeforeAnalysis) { + const auto onSetup = [target](QPointer<Target> &buildTarget) { + buildTarget = target; + }; + const auto onError = [this](const QPointer<Target> &) { + const QString message(Tr::tr("Failed to build the project.")); + m_infoBarWidget->setError(InfoBarWidget::Error, message, [this] { showOutputPane(); }); + m_runControl->postMessage(message, ErrorMessageFormat); + setState(State::PreparationFailed); + }; + topTasks.append(ProjectBuilderTask(onSetup, {}, onError)); + } + + const ProjectInfo::ConstPtr projectInfoBeforeBuild + = CppModelManager::instance()->projectInfo(target->project()); + + const auto onTreeSetup = [this, storage, runSettings, diagnosticConfig, fileInfos, tempDir, + environment, projectInfoBeforeBuild](TaskTree &taskTree) { + storage->m_elapsedHandler = [this](qint64 elapsedTime) { + m_runControl->postMessage(Utils::formatElapsedTime(elapsedTime), NormalMessageFormat); + }; + auto progress = new TaskProgress(&taskTree); + progress->setDisplayName(Tr::tr("Analyzing")); + + const QString failedMessage = makeLink(Tr::tr("Failed to start the analyzer.")); + + ProjectExplorerPlugin::saveModifiedFiles(); + + Project *project = m_runControl->project(); + const ProjectInfo::ConstPtr projectInfo = CppModelManager::instance()->projectInfo(project); + if (!projectInfo) { + m_infoBarWidget->setError(InfoBarWidget::Error, failedMessage, + [this] { showOutputPane(); }); + m_runControl->postMessage(Tr::tr("No code model data available for project."), + ErrorMessageFormat); + setState(State::PreparationFailed); + return SetupResult::StopWithError; + } + + // Project changed in the mean time? + if (projectInfo->configurationOrFilesChanged(*projectInfoBeforeBuild)) { + // If it's more than a release/debug build configuration change, e.g. + // a version control checkout, files might be not valid C++ anymore + // or even gone, so better stop here. + m_infoBarWidget->setError(InfoBarWidget::Error, failedMessage, + [this] { showOutputPane(); }); + m_runControl->postMessage(Tr::tr("The project configuration changed since the start of " + "the %1. Please re-run with current configuration.") + .arg(name()), ErrorMessageFormat); + setState(State::PreparationFailed); + return SetupResult::StopWithError; + } + + setState(State::AnalyzerRunning); + + const FilePath projectFile = projectInfo->projectFilePath(); + m_runControl->postMessage(Tr::tr("Running %1 on %2 with configuration \"%3\".") + .arg(name(), projectFile.toUserOutput(), diagnosticConfig.displayName()), + NormalMessageFormat); + + const ClangToolType tool = this == ClangTidyTool::instance() ? ClangToolType::Tidy + : ClangToolType::Clazy; + const FilePath executable = toolExecutable(tool); + const auto [includeDir, clangVersion] = getClangIncludeDirAndVersion(executable); + // Collect files + AnalyzeUnits unitsToProcess; + for (const FileInfo &fileInfo : fileInfos) + unitsToProcess.append({fileInfo, includeDir, clangVersion}); + + qCDebug(LOG) << Q_FUNC_INFO << executable << includeDir << clangVersion; + qCDebug(LOG) << "Files to process:" << unitsToProcess; + qCDebug(LOG) << "Environment:" << environment; + + QList<GroupItem> tasks{parallelLimit(qMax(1, runSettings.parallelJobs()))}; + for (const AnalyzeUnit &unit : std::as_const(unitsToProcess)) { + if (!diagnosticConfig.isEnabled(tool) && !runSettings.hasConfigFileForSourceFile(unit.file)) + continue; + + const auto setupHandler = [this, unit, tool] { + const QString filePath = unit.file.toUserOutput(); + m_runControl->postMessage(Tr::tr("Analyzing \"%1\" [%2].") + .arg(filePath, clangToolName(tool)), StdOutFormat); + return true; + }; + const AnalyzeInputData input{tool, runSettings, diagnosticConfig, tempDir->path(), + environment, unit}; + const auto outputHandler = [this, runSettings](const AnalyzeOutputData &output) { + if (!output.success) { + qCDebug(LOG).noquote() << "Clang tool task finished with an error:" + << output.errorMessage << '\n' << output.errorDetails; + ++m_filesFailed; + + const QString message = Tr::tr("Failed to analyze \"%1\": %2") + .arg(output.fileToAnalyze.toUserOutput(), output.errorMessage); + // TODO: postMessage() instead + m_runControl->postMessage(message, StdErrFormat); + m_runControl->postMessage(output.errorDetails, StdErrFormat); + } else { + qCDebug(LOG) << "Clang tool task finished with success:" + << output.outputFilePath; + ++m_filesSucceeded; + + const Diagnostics diagnostics = output.diagnostics; + if (!diagnostics.isEmpty()) { + // do not generate marks when we always analyze open files since marks from that + // analysis should be more up to date + const bool generateMarks = !runSettings.analyzeOpenFiles(); + onNewDiagnosticsAvailable(diagnostics, generateMarks); + } + } + updateForCurrentState(); + }; + tasks.append(clangToolTask(input, setupHandler, outputHandler)); + } + taskTree.setRecipe(tasks); + return SetupResult::Continue; + }; + + const auto onTreeDone = [this, target, runSettings](const TaskTree &) { + if (m_filesFailed != 0) { + m_runControl->postMessage(Tr::tr("Error: Failed to analyze %n files.", nullptr, + m_filesFailed), ErrorMessageFormat); + if (target && target->activeBuildConfiguration() + && !target->activeBuildConfiguration()->buildDirectory().exists() + && !runSettings.buildBeforeAnalysis()) { + m_runControl->postMessage( + Tr::tr("Note: You might need to build the project to generate or update " + "source files. To build automatically, enable " + "\"Build the project before analysis\"."), NormalMessageFormat); + } + } + m_runControl->postMessage(Tr::tr("%1 finished: Processed %2 files successfully, %3 failed.") + .arg(name()).arg(m_filesSucceeded).arg(m_filesFailed), + NormalMessageFormat); + }; + + topTasks.append(Group { Storage(storage), TaskTreeTask(onTreeSetup, onTreeDone) }); + return {topTasks}; +} + void ClangTool::startTool(ClangTool::FileSelection fileSelection, const RunSettings &runSettings, const CppEditor::ClangDiagnosticConfig &diagnosticConfig) @@ -636,6 +860,7 @@ void ClangTool::startTool(ClangTool::FileSelection fileSelection, m_runControl->setDisplayName(m_name); m_runControl->setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR); m_runControl->setTarget(project->activeTarget()); + m_runControl->setSupportsReRunning(false); m_stopAction->disconnect(); connect(m_stopAction, &QAction::triggered, m_runControl, [this] { m_runControl->postMessage(Tr::tr("%1 tool stopped by user.").arg(m_name), @@ -643,29 +868,18 @@ void ClangTool::startTool(ClangTool::FileSelection fileSelection, m_runControl->initiateStop(); setState(State::StoppedByUser); }); - connect(m_runControl, &RunControl::stopped, this, &ClangTool::onRunControlStopped); + connect(m_runControl, &RunControl::stopped, this, [this] { + if (m_state != State::StoppedByUser && m_state != State::PreparationFailed) + setState(State::AnalyzerFinished); + emit finished(m_infoBarWidget->errorText()); + }); - // Run worker const bool preventBuild = std::holds_alternative<FilePath>(fileSelection) || std::get<FileSelectionType>(fileSelection) == FileSelectionType::CurrentFile; const bool buildBeforeAnalysis = !preventBuild && runSettings.buildBeforeAnalysis(); - m_runWorker = new ClangToolRunWorker(this, - m_runControl, - runSettings, - diagnosticConfig, - fileInfos, - buildBeforeAnalysis); - connect(m_runWorker, &ClangToolRunWorker::buildFailed,this, &ClangTool::onBuildFailed); - connect(m_runWorker, &ClangToolRunWorker::startFailed, this, &ClangTool::onStartFailed); - connect(m_runWorker, &ClangToolRunWorker::started, this, &ClangTool::onStarted); - connect(m_runWorker, &ClangToolRunWorker::runnerFinished, this, [this] { - m_filesCount = m_runWorker->totalFilesToAnalyze(); - m_filesSucceeded = m_runWorker->filesAnalyzed(); - m_filesFailed = m_runWorker->filesNotAnalyzed(); - updateForCurrentState(); - }); - + m_runControl->setRunRecipe(runRecipe(runSettings, diagnosticConfig, fileInfos, + buildBeforeAnalysis)); // More init and UI update m_diagnosticFilterModel->setProject(project); m_perspective.select(); @@ -673,7 +887,6 @@ void ClangTool::startTool(ClangTool::FileSelection fileSelection, m_infoBarWidget->setInfoText("Waiting for build to finish..."); setState(State::PreparationStarted); - // Start ProjectExplorerPlugin::startRunControl(m_runControl); } @@ -807,7 +1020,6 @@ void ClangTool::reset() m_state = State::Initial; m_runControl = nullptr; - m_runWorker = nullptr; m_filesCount = 0; m_filesSucceeded = 0; @@ -952,32 +1164,6 @@ void ClangTool::filterOutCurrentKind() } } -void ClangTool::onBuildFailed() -{ - m_infoBarWidget->setError(InfoBarWidget::Error, Tr::tr("Failed to build the project."), - [this] { showOutputPane(); }); - setState(State::PreparationFailed); -} - -void ClangTool::onStartFailed() -{ - m_infoBarWidget->setError(InfoBarWidget::Error, makeLink(Tr::tr("Failed to start the analyzer.")), - [this] { showOutputPane(); }); - setState(State::PreparationFailed); -} - -void ClangTool::onStarted() -{ - setState(State::AnalyzerRunning); -} - -void ClangTool::onRunControlStopped() -{ - if (m_state != State::StoppedByUser && m_state != State::PreparationFailed) - setState(State::AnalyzerFinished); - emit finished(m_infoBarWidget->errorText()); -} - void ClangTool::update() { updateForInitialState(); @@ -1119,7 +1305,7 @@ void ClangTool::updateForCurrentState() break; case State::AnalyzerRunning: showProgressIcon = true; - if (m_filesCount == 0) { + if (m_filesSucceeded + m_filesFailed == 0) { infoText = Tr::tr("Analyzing..."); // Not yet fully started/initialized } else { infoText = Tr::tr("Analyzing... %1 of %n file(s) processed.", nullptr, m_filesCount) @@ -1167,12 +1353,12 @@ ClangTidyTool::ClangTidyTool() : ClangTool(Tr::tr("Clang-Tidy"), "ClangTidy.Pers { m_instance = this; } + ClazyTool::ClazyTool() : ClangTool(Tr::tr("Clazy"), "Clazy.Perspective", ClangToolType::Clazy) { m_instance = this; } -} // namespace Internal -} // namespace ClangTools +} // namespace ClangTools::Internal #include "clangtool.moc" diff --git a/src/plugins/clangtools/clangtool.h b/src/plugins/clangtools/clangtool.h index 87497e87066..75db785dae3 100644 --- a/src/plugins/clangtools/clangtool.h +++ b/src/plugins/clangtools/clangtool.h @@ -9,36 +9,20 @@ #include <debugger/debuggermainwindow.h> -#include <projectexplorer/runconfiguration.h> -#include <cppeditor/projectinfo.h> - #include <variant> QT_BEGIN_NAMESPACE -class QFrame; class QToolButton; QT_END_NAMESPACE -namespace CppEditor { -class ClangDiagnosticConfig; -} -namespace Debugger { -class DetailedErrorView; -} -namespace ProjectExplorer { -class RunControl; -} -namespace Utils { -class FilePath; -class FancyLineEdit; -} // namespace Utils +namespace CppEditor { class ClangDiagnosticConfig; } +namespace ProjectExplorer { class RunControl; } +namespace Tasking { class Group; } +namespace Utils { class FilePath; } -namespace ClangTools { -namespace Internal { +namespace ClangTools::Internal { class InfoBarWidget; -class ClangToolsDiagnosticModel; -class ClangToolRunWorker; class Diagnostic; class DiagnosticFilterModel; class DiagnosticView; @@ -61,8 +45,7 @@ public: using FileSelection = std::variant<FileSelectionType, Utils::FilePath>; void startTool(FileSelection fileSelection); - void startTool(FileSelection fileSelection, - const RunSettings &runSettings, + void startTool(FileSelection fileSelection, const RunSettings &runSettings, const CppEditor::ClangDiagnosticConfig &diagnosticConfig); FileInfos collectFileInfos(ProjectExplorer::Project *project, @@ -85,6 +68,10 @@ protected: ClangTool(const QString &name, Utils::Id id, CppEditor::ClangToolType type); private: + Tasking::Group runRecipe(const RunSettings &runSettings, + const CppEditor::ClangDiagnosticConfig &diagnosticConfig, + const FileInfos &fileInfos, bool buildBeforeAnalysis); + enum class State { Initial, PreparationStarted, @@ -107,11 +94,6 @@ private: void filterOutCurrentKind(); void setFilterOptions(const OptionalFilterOptions &filterOptions); - void onBuildFailed(); - void onStartFailed(); - void onStarted(); - void onRunControlStopped(); - void initDiagnosticView(); void loadDiagnosticsFromFiles(); @@ -126,7 +108,6 @@ private: const QString m_name; ClangToolsDiagnosticModel *m_diagnosticModel = nullptr; ProjectExplorer::RunControl *m_runControl = nullptr; - ClangToolRunWorker *m_runWorker = nullptr; InfoBarWidget *m_infoBarWidget = nullptr; DiagnosticView *m_diagnosticView = nullptr;; @@ -177,5 +158,4 @@ private: static inline ClangTool *m_instance = nullptr; }; -} // namespace Internal -} // namespace ClangTools +} // namespace ClangTools::Internal From e5ed299fa98b3cea4f5f99ed961105dcf262c878 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 6 Jul 2023 13:22:31 +0200 Subject: [PATCH 0169/1777] ClangTool: Some cleanup Change-Id: I60258c79262a33062617ac0179147fc4ef1b1a6e Reviewed-by: hjk <hjk@qt.io> --- src/plugins/clangtools/clangtool.cpp | 80 ++++++++++++---------------- 1 file changed, 34 insertions(+), 46 deletions(-) diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index c66f4faf41b..b9e9e7115ed 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -3,14 +3,10 @@ #include "clangtool.h" -#include "clangfixitsrefactoringchanges.h" #include "clangselectablefilesdialog.h" #include "clangtoolrunner.h" #include "clangtoolsconstants.h" -#include "clangtoolsdiagnostic.h" -#include "clangtoolsdiagnosticmodel.h" #include "clangtoolsdiagnosticview.h" -#include "clangtoolslogfilereader.h" #include "clangtoolsprojectsettings.h" #include "clangtoolssettings.h" #include "clangtoolstr.h" @@ -20,13 +16,11 @@ #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> -#include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/icore.h> #include <coreplugin/messagebox.h> #include <coreplugin/progressmanager/taskprogress.h> -#include <cppeditor/clangdiagnosticconfigsmodel.h> #include <cppeditor/cppmodelmanager.h> #include <debugger/analyzer/analyzermanager.h> @@ -94,7 +88,7 @@ TASKING_DECLARE_TASK(ProjectBuilderTask, ClangTools::Internal::ProjectBuilderTas namespace ClangTools::Internal { -static QDebug operator<<(QDebug debug, const Utils::Environment &environment) +static QDebug operator<<(QDebug debug, const Environment &environment) { for (const QString &entry : environment.toStringList()) debug << "\n " << entry; @@ -119,7 +113,7 @@ class InfoBarWidget : public QFrame public: InfoBarWidget() - : m_progressIndicator(new Utils::ProgressIndicator(ProgressIndicatorSize::Small)) + : m_progressIndicator(new ProgressIndicator(ProgressIndicatorSize::Small)) , m_info(new InfoLabel({}, InfoLabel::Information)) , m_error(new InfoLabel({}, InfoLabel::Warning)) , m_diagStats(new QLabel) @@ -139,8 +133,8 @@ public: setLayout(layout); QPalette pal; - pal.setColor(QPalette::Window, Utils::creatorTheme()->color(Utils::Theme::InfoBarBackground)); - pal.setColor(QPalette::WindowText, Utils::creatorTheme()->color(Utils::Theme::InfoBarText)); + pal.setColor(QPalette::Window, Utils::creatorTheme()->color(Theme::InfoBarBackground)); + pal.setColor(QPalette::WindowText, Utils::creatorTheme()->color(Theme::InfoBarText)); setPalette(pal); setAutoFillBackground(true); @@ -197,7 +191,7 @@ public: } private: - Utils::ProgressIndicator *m_progressIndicator; + ProgressIndicator *m_progressIndicator; InfoLabel *m_info; InfoLabel *m_error; QLabel *m_diagStats; @@ -228,7 +222,7 @@ public: ApplyFixIts(const QVector<DiagnosticItem *> &diagnosticItems) { for (DiagnosticItem *diagnosticItem : diagnosticItems) { - const Utils::FilePath &filePath = diagnosticItem->diagnostic().location.filePath; + const FilePath &filePath = diagnosticItem->diagnostic().location.filePath; QTC_ASSERT(!filePath.isEmpty(), continue); // Get or create refactoring file @@ -262,8 +256,8 @@ public: if (!step.isFixIt) continue; - const Debugger::DiagnosticLocation start = step.ranges.first(); - const Debugger::DiagnosticLocation end = step.ranges.last(); + const DiagnosticLocation start = step.ranges.first(); + const DiagnosticLocation end = step.ranges.last(); const int startPos = file.position(start.filePath, start.line, start.column); const int endPos = file.position(start.filePath, end.line, end.column); @@ -341,28 +335,27 @@ public: } private: - QMap<Utils::FilePath, RefactoringFileInfo> m_refactoringFileInfos; + QMap<FilePath, RefactoringFileInfo> m_refactoringFileInfos; }; -static FileInfos sortedFileInfos(const QVector<CppEditor::ProjectPart::ConstPtr> &projectParts) +static FileInfos sortedFileInfos(const QVector<ProjectPart::ConstPtr> &projectParts) { FileInfos fileInfos; - for (const CppEditor::ProjectPart::ConstPtr &projectPart : projectParts) { + for (const ProjectPart::ConstPtr &projectPart : projectParts) { QTC_ASSERT(projectPart, continue); if (!projectPart->selectedForBuilding) continue; - for (const CppEditor::ProjectFile &file : std::as_const(projectPart->files)) { - QTC_ASSERT(file.kind != CppEditor::ProjectFile::Unclassified, continue); - QTC_ASSERT(file.kind != CppEditor::ProjectFile::Unsupported, continue); - if (file.path == CppEditor::CppModelManager::configurationFileName()) + for (const ProjectFile &file : std::as_const(projectPart->files)) { + QTC_ASSERT(file.kind != ProjectFile::Unclassified, continue); + QTC_ASSERT(file.kind != ProjectFile::Unsupported, continue); + if (file.path == CppModelManager::configurationFileName()) continue; - if (file.active - && (CppEditor::ProjectFile::isSource(file.kind) - || CppEditor::ProjectFile::isHeader(file.kind))) { - ProjectFile::Kind sourceKind = CppEditor::ProjectFile::sourceKind(file.kind); + if (file.active && (ProjectFile::isSource(file.kind) + || ProjectFile::isHeader(file.kind))) { + ProjectFile::Kind sourceKind = ProjectFile::sourceKind(file.kind); fileInfos.emplace_back(file.path, sourceKind, projectPart); } } @@ -393,7 +386,7 @@ static RunSettings runSettings() return ClangToolsSettings::instance()->runSettings(); } -ClangTool::ClangTool(const QString &name, Utils::Id id, ClangToolType type) +ClangTool::ClangTool(const QString &name, Id id, ClangToolType type) : m_name(name), m_perspective{id.toString(), name}, m_type(type) { setObjectName(name); @@ -419,8 +412,7 @@ ClangTool::ClangTool(const QString &name, Utils::Id id, ClangToolType type) initDiagnosticView(); m_diagnosticView->setModel(m_diagnosticFilterModel); m_diagnosticView->setSortingEnabled(true); - m_diagnosticView->sortByColumn(Debugger::DetailedErrorView::DiagnosticColumn, - Qt::AscendingOrder); + m_diagnosticView->sortByColumn(DetailedErrorView::DiagnosticColumn, Qt::AscendingOrder); connect(m_diagnosticView, &DiagnosticView::showHelp, this, &ClangTool::help); connect(m_diagnosticView, &DiagnosticView::showFilter, @@ -497,8 +489,7 @@ ClangTool::ClangTool(const QString &name, Utils::Id id, ClangToolType type) // Filter button action = m_showFilter = new QAction(this); - action->setIcon( - Utils::Icon({{":/utils/images/filtericon.png", Utils::Theme::IconsBaseColor}}).icon()); + action->setIcon(Utils::Icon({{":/utils/images/filtericon.png", Theme::IconsBaseColor}}).icon()); action->setToolTip(Tr::tr("Filter Diagnostics")); action->setCheckable(true); connect(action, &QAction::triggered, this, &ClangTool::filter); @@ -618,7 +609,7 @@ void ClangTool::selectPerspective() m_perspective.select(); } -void ClangTool::startTool(ClangTool::FileSelection fileSelection) +void ClangTool::startTool(FileSelection fileSelection) { const RunSettings theRunSettings = runSettings(); startTool(fileSelection, theRunSettings, diagnosticConfig(theRunSettings.diagnosticConfigId())); @@ -830,9 +821,8 @@ Tasking::Group ClangTool::runRecipe(const RunSettings &runSettings, return {topTasks}; } -void ClangTool::startTool(ClangTool::FileSelection fileSelection, - const RunSettings &runSettings, - const CppEditor::ClangDiagnosticConfig &diagnosticConfig) +void ClangTool::startTool(FileSelection fileSelection, const RunSettings &runSettings, + const ClangDiagnosticConfig &diagnosticConfig) { Project *project = ProjectManager::startupProject(); QTC_ASSERT(project, return); @@ -902,7 +892,7 @@ FileInfos ClangTool::collectFileInfos(Project *project, FileSelection fileSelect return {}; } - const auto projectInfo = CppEditor::CppModelManager::instance()->projectInfo(project); + const auto projectInfo = CppModelManager::instance()->projectInfo(project); QTC_ASSERT(projectInfo, return FileInfos()); const FileInfos allFileInfos = sortedFileInfos(projectInfo->projectParts()); @@ -1029,8 +1019,8 @@ void ClangTool::reset() static bool canAnalyzeProject(Project *project) { if (const Target *target = project->activeTarget()) { - const Utils::Id c = ProjectExplorer::Constants::C_LANGUAGE_ID; - const Utils::Id cxx = ProjectExplorer::Constants::CXX_LANGUAGE_ID; + const Id c = ProjectExplorer::Constants::C_LANGUAGE_ID; + const Id cxx = ProjectExplorer::Constants::CXX_LANGUAGE_ID; const bool projectSupportsLanguage = project->projectLanguages().contains(c) || project->projectLanguages().contains(cxx); return projectSupportsLanguage @@ -1170,13 +1160,13 @@ void ClangTool::update() updateForCurrentState(); } -using DocumentPredicate = std::function<bool(Core::IDocument *)>; +using DocumentPredicate = std::function<bool(IDocument *)>; static FileInfos fileInfosMatchingDocuments(const FileInfos &fileInfos, const DocumentPredicate &predicate) { - QSet<Utils::FilePath> documentPaths; - for (const Core::DocumentModel::Entry *e : Core::DocumentModel::entries()) { + QSet<FilePath> documentPaths; + for (const DocumentModel::Entry *e : DocumentModel::entries()) { if (predicate(e->document)) documentPaths.insert(e->filePath()); } @@ -1189,20 +1179,19 @@ static FileInfos fileInfosMatchingDocuments(const FileInfos &fileInfos, static FileInfos fileInfosMatchingOpenedDocuments(const FileInfos &fileInfos) { // Note that (initially) suspended text documents are still IDocuments, not yet TextDocuments. - return fileInfosMatchingDocuments(fileInfos, [](Core::IDocument *) { return true; }); + return fileInfosMatchingDocuments(fileInfos, [](IDocument *) { return true; }); } static FileInfos fileInfosMatchingEditedDocuments(const FileInfos &fileInfos) { - return fileInfosMatchingDocuments(fileInfos, [](Core::IDocument *document) { + return fileInfosMatchingDocuments(fileInfos, [](IDocument *document) { if (auto textDocument = qobject_cast<TextEditor::TextDocument*>(document)) return textDocument->document()->revision() > 1; return false; }); } -FileInfoProviders ClangTool::fileInfoProviders(ProjectExplorer::Project *project, - const FileInfos &allFileInfos) +FileInfoProviders ClangTool::fileInfoProviders(Project *project, const FileInfos &allFileInfos) { const QSharedPointer<ClangToolsProjectSettings> s = ClangToolsProjectSettings::getSettings(project); static FileInfoSelection openedFilesSelection; @@ -1232,7 +1221,7 @@ FileInfoProviders ClangTool::fileInfoProviders(ProjectExplorer::Project *project }; } -void ClangTool::setState(ClangTool::State state) +void ClangTool::setState(State state) { m_state = state; updateForCurrentState(); @@ -1241,7 +1230,6 @@ void ClangTool::setState(ClangTool::State state) QSet<Diagnostic> ClangTool::diagnostics() const { return Utils::filtered(m_diagnosticModel->diagnostics(), [](const Diagnostic &diagnostic) { - using CppEditor::ProjectFile; return ProjectFile::isSource(ProjectFile::classify(diagnostic.location.filePath.toString())); }); } From 619c49958cc7d5cdc1af40b490ccaeabbf090630 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 6 Jul 2023 13:49:48 +0200 Subject: [PATCH 0170/1777] ClangTools: Get rid of ClangToolRunWorker Task-number: QTCREATORBUG-29168 Change-Id: I07ae5cd23124e43878d2f929d7dcb4fe84e8b28c Reviewed-by: hjk <hjk@qt.io> --- src/plugins/clangtools/CMakeLists.txt | 1 - .../clangtools/clangtoolruncontrol.cpp | 281 ------------------ src/plugins/clangtools/clangtoolruncontrol.h | 77 ----- src/plugins/clangtools/clangtools.qbs | 2 - 4 files changed, 361 deletions(-) delete mode 100644 src/plugins/clangtools/clangtoolruncontrol.cpp delete mode 100644 src/plugins/clangtools/clangtoolruncontrol.h diff --git a/src/plugins/clangtools/CMakeLists.txt b/src/plugins/clangtools/CMakeLists.txt index e8d403ce187..c74b4702682 100644 --- a/src/plugins/clangtools/CMakeLists.txt +++ b/src/plugins/clangtools/CMakeLists.txt @@ -19,7 +19,6 @@ add_qtc_plugin(ClangTools clangfixitsrefactoringchanges.cpp clangfixitsrefactoringchanges.h clangselectablefilesdialog.cpp clangselectablefilesdialog.h clangtool.cpp clangtool.h - clangtoolruncontrol.cpp clangtoolruncontrol.h clangtoolrunner.cpp clangtoolrunner.h clangtools_global.h clangtoolstr.h diff --git a/src/plugins/clangtools/clangtoolruncontrol.cpp b/src/plugins/clangtools/clangtoolruncontrol.cpp deleted file mode 100644 index f04dd67e52a..00000000000 --- a/src/plugins/clangtools/clangtoolruncontrol.cpp +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "clangtoolruncontrol.h" - -#include "clangtool.h" -#include "clangtoolrunner.h" -#include "clangtoolstr.h" -#include "executableinfo.h" - -#include <coreplugin/progressmanager/taskprogress.h> - -#include <cppeditor/cppmodelmanager.h> - -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/buildmanager.h> -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/project.h> -#include <projectexplorer/projectexplorer.h> -#include <projectexplorer/target.h> -#include <projectexplorer/toolchain.h> - -#include <utils/algorithm.h> -#include <utils/process.h> -#include <utils/stringutils.h> - -#include <QLoggingCategory> - -using namespace CppEditor; -using namespace ProjectExplorer; -using namespace Tasking; -using namespace Utils; - -static Q_LOGGING_CATEGORY(LOG, "qtc.clangtools.runcontrol", QtWarningMsg) - -namespace ClangTools { -namespace Internal { - -class ProjectBuilder : public RunWorker -{ -public: - ProjectBuilder(RunControl *runControl) - : RunWorker(runControl) - { - setId("ProjectBuilder"); - } - - bool success() const { return m_success; } - -private: - void start() final - { - Target *target = runControl()->target(); - QTC_ASSERT(target, reportFailure(); return); - - connect(BuildManager::instance(), &BuildManager::buildQueueFinished, - this, &ProjectBuilder::onBuildFinished, Qt::QueuedConnection); - if (!BuildManager::isBuilding(target)) - BuildManager::buildProjectWithDependencies(target->project()); - } - - void onBuildFinished(bool success) - { - disconnect(BuildManager::instance(), &BuildManager::buildQueueFinished, - this, &ProjectBuilder::onBuildFinished); - m_success = success; - reportDone(); - } - -private: - bool m_success = false; -}; - -static QDebug operator<<(QDebug debug, const Utils::Environment &environment) -{ - for (const QString &entry : environment.toStringList()) - debug << "\n " << entry; - return debug; -} - -static QDebug operator<<(QDebug debug, const AnalyzeUnits &analyzeUnits) -{ - for (const AnalyzeUnit &unit : analyzeUnits) - debug << "\n " << unit.file; - return debug; -} - -ClangToolRunWorker::ClangToolRunWorker(ClangTool *tool, RunControl *runControl, - const RunSettings &runSettings, - const CppEditor::ClangDiagnosticConfig &diagnosticConfig, - const FileInfos &fileInfos, - bool buildBeforeAnalysis) - : RunWorker(runControl) - , m_tool(tool) - , m_runSettings(runSettings) - , m_diagnosticConfig(diagnosticConfig) - , m_fileInfos(fileInfos) - , m_temporaryDir("clangtools-XXXXXX") -{ - m_temporaryDir.setAutoRemove(qtcEnvironmentVariable("QTC_CLANG_DONT_DELETE_OUTPUT_FILES") - != "1"); - setId("ClangTidyClazyRunner"); - setSupportsReRunning(false); - - if (buildBeforeAnalysis) { - m_projectBuilder = new ProjectBuilder(runControl); - addStartDependency(m_projectBuilder); - } - - Target *target = runControl->target(); - m_projectInfoBeforeBuild = CppEditor::CppModelManager::instance()->projectInfo(target->project()); - - BuildConfiguration *buildConfiguration = target->activeBuildConfiguration(); - QTC_ASSERT(buildConfiguration, return); - m_environment = buildConfiguration->environment(); -} - -ClangToolRunWorker::~ClangToolRunWorker() = default; - -void ClangToolRunWorker::start() -{ - ProjectExplorerPlugin::saveModifiedFiles(); - - if (m_projectBuilder && !m_projectBuilder->success()) { - emit buildFailed(); - reportFailure(Tr::tr("Failed to build the project.")); - return; - } - - const QString &toolName = m_tool->name(); - Project *project = runControl()->project(); - m_projectInfo = CppEditor::CppModelManager::instance()->projectInfo(project); - if (!m_projectInfo) { - reportFailure(Tr::tr("No code model data available for project.")); - return; - } - m_projectFiles = Utils::toSet(project->files(Project::AllFiles)); - - // Project changed in the mean time? - if (m_projectInfo->configurationOrFilesChanged(*m_projectInfoBeforeBuild)) { - // If it's more than a release/debug build configuration change, e.g. - // a version control checkout, files might be not valid C++ anymore - // or even gone, so better stop here. - reportFailure(Tr::tr("The project configuration changed since the start of " - "the %1. Please re-run with current configuration.") - .arg(toolName)); - emit startFailed(); - return; - } - - // Create log dir - if (!m_temporaryDir.isValid()) { - reportFailure( - Tr::tr("Failed to create temporary directory: %1.").arg(m_temporaryDir.errorString())); - emit startFailed(); - return; - } - - const Utils::FilePath projectFile = m_projectInfo->projectFilePath(); - appendMessage(Tr::tr("Running %1 on %2 with configuration \"%3\".") - .arg(toolName, projectFile.toUserOutput(), m_diagnosticConfig.displayName()), - Utils::NormalMessageFormat); - - const ClangToolType tool = m_tool == ClangTidyTool::instance() ? ClangToolType::Tidy - : ClangToolType::Clazy; - const FilePath executable = toolExecutable(tool); - const auto [includeDir, clangVersion] = getClangIncludeDirAndVersion(executable); - - // Collect files - AnalyzeUnits unitsToProcess; - for (const FileInfo &fileInfo : m_fileInfos) - unitsToProcess.append({fileInfo, includeDir, clangVersion}); - - qCDebug(LOG) << Q_FUNC_INFO << executable << includeDir << clangVersion; - qCDebug(LOG) << "Files to process:" << unitsToProcess; - qCDebug(LOG) << "Environment:" << m_environment; - - m_filesAnalyzed.clear(); - m_filesNotAnalyzed.clear(); - - QList<GroupItem> tasks{parallelLimit(qMax(1, m_runSettings.parallelJobs()))}; - for (const AnalyzeUnit &unit : std::as_const(unitsToProcess)) { - if (!m_diagnosticConfig.isEnabled(tool) - && !m_runSettings.hasConfigFileForSourceFile(unit.file)) { - continue; - } - const AnalyzeInputData input{tool, m_runSettings, m_diagnosticConfig, m_temporaryDir.path(), - m_environment, unit}; - const auto setupHandler = [this, unit, tool] { - const QString filePath = unit.file.toUserOutput(); - appendMessage(Tr::tr("Analyzing \"%1\" [%2].").arg(filePath, clangToolName(tool)), - Utils::StdOutFormat); - return true; - }; - const auto outputHandler = [this](const AnalyzeOutputData &output) { onDone(output); }; - tasks.append(clangToolTask(input, setupHandler, outputHandler)); - } - - m_taskTree.reset(new TaskTree(tasks)); - connect(m_taskTree.get(), &TaskTree::done, this, &ClangToolRunWorker::finalize); - connect(m_taskTree.get(), &TaskTree::errorOccurred, this, &ClangToolRunWorker::finalize); - auto progress = new Core::TaskProgress(m_taskTree.get()); - progress->setDisplayName(Tr::tr("Analyzing")); - reportStarted(); - m_elapsed.start(); - m_taskTree->start(); -} - -void ClangToolRunWorker::stop() -{ - m_taskTree.reset(); - m_projectFiles.clear(); - - reportStopped(); - - // Print elapsed time since start - const QString elapsedTime = Utils::formatElapsedTime(m_elapsed.elapsed()); - appendMessage(elapsedTime, NormalMessageFormat); -} - -void ClangToolRunWorker::onDone(const AnalyzeOutputData &output) -{ - emit runnerFinished(); - - if (!output.success) { - qCDebug(LOG).noquote() << "onRunnerFinishedWithFailure:" << output.errorMessage << '\n' - << output.errorDetails; - m_filesAnalyzed.remove(output.fileToAnalyze); - m_filesNotAnalyzed.insert(output.fileToAnalyze); - - const QString message = Tr::tr("Failed to analyze \"%1\": %2") - .arg(output.fileToAnalyze.toUserOutput(), output.errorMessage); - appendMessage(message, Utils::StdErrFormat); - appendMessage(output.errorDetails, Utils::StdErrFormat); - return; - } - - qCDebug(LOG) << "onRunnerFinishedWithSuccess:" << output.outputFilePath; - - const Diagnostics diagnostics = output.diagnostics; - - if (!m_filesNotAnalyzed.contains(output.fileToAnalyze)) - m_filesAnalyzed.insert(output.fileToAnalyze); - if (!diagnostics.isEmpty()) { - // do not generate marks when we always analyze open files since marks from that - // analysis should be more up to date - const bool generateMarks = !m_runSettings.analyzeOpenFiles(); - m_tool->onNewDiagnosticsAvailable(diagnostics, generateMarks); - } -} - -void ClangToolRunWorker::finalize() -{ - if (m_taskTree) - m_taskTree.release()->deleteLater(); - const QString toolName = m_tool->name(); - if (m_filesNotAnalyzed.size() != 0) { - appendMessage(Tr::tr("Error: Failed to analyze %n files.", nullptr, m_filesNotAnalyzed.size()), - ErrorMessageFormat); - Target *target = runControl()->target(); - if (target && target->activeBuildConfiguration() && !target->activeBuildConfiguration()->buildDirectory().exists() - && !m_runSettings.buildBeforeAnalysis()) { - appendMessage( - Tr::tr("Note: You might need to build the project to generate or update source " - "files. To build automatically, enable \"Build the project before analysis\"."), - NormalMessageFormat); - } - } - - appendMessage(Tr::tr("%1 finished: " - "Processed %2 files successfully, %3 failed.") - .arg(toolName) - .arg(m_filesAnalyzed.size()) - .arg(m_filesNotAnalyzed.size()), - Utils::NormalMessageFormat); - - runControl()->initiateStop(); -} - -} // namespace Internal -} // namespace ClangTools diff --git a/src/plugins/clangtools/clangtoolruncontrol.h b/src/plugins/clangtools/clangtoolruncontrol.h deleted file mode 100644 index dc7ebc9ef1c..00000000000 --- a/src/plugins/clangtools/clangtoolruncontrol.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "clangfileinfo.h" -#include "clangtoolssettings.h" - -#include <cppeditor/clangdiagnosticconfig.h> -#include <cppeditor/projectinfo.h> -#include <projectexplorer/runcontrol.h> -#include <utils/environment.h> -#include <utils/temporarydirectory.h> - -#include <QElapsedTimer> -#include <QSet> - -namespace Tasking { class TaskTree; } - -namespace ClangTools { -namespace Internal { - -struct AnalyzeOutputData; -class ClangTool; -class ProjectBuilder; - -class ClangToolRunWorker : public ProjectExplorer::RunWorker -{ - Q_OBJECT - -public: - ClangToolRunWorker(ClangTool *tool, - ProjectExplorer::RunControl *runControl, - const RunSettings &runSettings, - const CppEditor::ClangDiagnosticConfig &diagnosticConfig, - const FileInfos &fileInfos, - bool buildBeforeAnalysis); - ~ClangToolRunWorker(); - - int filesAnalyzed() const { return m_filesAnalyzed.size(); } - int filesNotAnalyzed() const { return m_filesNotAnalyzed.size(); } - int totalFilesToAnalyze() const { return int(m_fileInfos.size()); } - -signals: - void buildFailed(); - void runnerFinished(); - void startFailed(); - -private: - void start() final; - void stop() final; - void onDone(const AnalyzeOutputData &output); - void finalize(); - -private: - ClangTool * const m_tool; - RunSettings m_runSettings; - CppEditor::ClangDiagnosticConfig m_diagnosticConfig; - FileInfos m_fileInfos; - - ProjectBuilder *m_projectBuilder = nullptr; - Utils::Environment m_environment; - Utils::TemporaryDirectory m_temporaryDir; - - CppEditor::ProjectInfo::ConstPtr m_projectInfoBeforeBuild; - CppEditor::ProjectInfo::ConstPtr m_projectInfo; - - std::unique_ptr<Tasking::TaskTree> m_taskTree; - QSet<Utils::FilePath> m_projectFiles; - QSet<Utils::FilePath> m_filesAnalyzed; - QSet<Utils::FilePath> m_filesNotAnalyzed; - - QElapsedTimer m_elapsed; -}; - -} // namespace Internal -} // namespace ClangTools diff --git a/src/plugins/clangtools/clangtools.qbs b/src/plugins/clangtools/clangtools.qbs index ad8543bf611..5aba1655197 100644 --- a/src/plugins/clangtools/clangtools.qbs +++ b/src/plugins/clangtools/clangtools.qbs @@ -30,8 +30,6 @@ QtcPlugin { "clangselectablefilesdialog.h", "clangtool.cpp", "clangtool.h", - "clangtoolruncontrol.cpp", - "clangtoolruncontrol.h", "clangtoolrunner.cpp", "clangtoolrunner.h", "clangtools_global.h", "clangtoolstr.h", From 2df86fee6ab2086535d08f2a6b188a5e500d563f Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 6 Jul 2023 17:05:46 +0200 Subject: [PATCH 0171/1777] Vcpkg: Parse dependencies from vcpkg.json manifest Also, extend the tests accordingly. Task-number: QTCREATORBUG-29333 Change-Id: I24104b6b0bdbbd47c36cc4d43f4647169fa619d8 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/vcpkg/vcpkg_test.cpp | 7 +++++++ src/plugins/vcpkg/vcpkgsearch.cpp | 9 +++++++++ src/plugins/vcpkg/vcpkgsearch.h | 1 + 3 files changed, 17 insertions(+) diff --git a/src/plugins/vcpkg/vcpkg_test.cpp b/src/plugins/vcpkg/vcpkg_test.cpp index 65079b96a4e..c48e6ec3881 100644 --- a/src/plugins/vcpkg/vcpkg_test.cpp +++ b/src/plugins/vcpkg/vcpkg_test.cpp @@ -21,6 +21,7 @@ void VcpkgSearchTest::testVcpkgJsonParser_data() QTest::addColumn<QString>("name"); QTest::addColumn<QString>("version"); QTest::addColumn<QString>("license"); + QTest::addColumn<QStringList>("dependencies"); QTest::addColumn<QString>("shortDescription"); QTest::addColumn<QStringList>("description"); QTest::addColumn<QUrl>("homepage"); @@ -33,6 +34,7 @@ void VcpkgSearchTest::testVcpkgJsonParser_data() "description": "The CImg Library is a small, open-source, and modern C++ toolkit for image processing", "homepage": "https://github.com/dtschump/CImg", "dependencies": [ + "fmt", { "name": "vcpkg-cmake", "host": true @@ -42,6 +44,7 @@ void VcpkgSearchTest::testVcpkgJsonParser_data() << "cimg" << "2.9.9" << "" + << QStringList({"fmt", "vcpkg-cmake"}) << "The CImg Library is a small, open-source, and modern C++ toolkit for image processing" << QStringList() << QUrl::fromUserInput("https://github.com/dtschump/CImg") @@ -62,6 +65,7 @@ void VcpkgSearchTest::testVcpkgJsonParser_data() << "catch-classic" << "1.12.2" << "" + << QStringList() << "A modern, header-only test framework for unit tests" << QStringList({"This is specifically the legacy 1.x branch provided for compatibility", "with older compilers."}) @@ -77,6 +81,7 @@ void VcpkgSearchTest::testVcpkgJsonParser_data() << "" << "1.0" << "WTFPL" + << QStringList() << "foo" << QStringList() << QUrl() @@ -89,6 +94,7 @@ void VcpkgSearchTest::testVcpkgJsonParser() QFETCH(QString, name); QFETCH(QString, version); QFETCH(QString, license); + QFETCH(QStringList, dependencies); QFETCH(QString, shortDescription); QFETCH(QStringList, description); QFETCH(QUrl, homepage); @@ -101,6 +107,7 @@ void VcpkgSearchTest::testVcpkgJsonParser() QCOMPARE(mf.name, name); QCOMPARE(mf.version, version); QCOMPARE(mf.license, license); + QCOMPARE(mf.dependencies, dependencies); QCOMPARE(mf.shortDescription, shortDescription); QCOMPARE(mf.description, description); QCOMPARE(mf.homepage, homepage); diff --git a/src/plugins/vcpkg/vcpkgsearch.cpp b/src/plugins/vcpkg/vcpkgsearch.cpp index 1ed757dd975..175e889a888 100644 --- a/src/plugins/vcpkg/vcpkgsearch.cpp +++ b/src/plugins/vcpkg/vcpkgsearch.cpp @@ -169,6 +169,15 @@ VcpkgManifest parseVcpkgManifest(const QByteArray &vcpkgManifestJsonData, bool * } if (const QJsonValue license = jsonObject.value("license"); !license.isUndefined()) result.license = license.toString(); + if (const QJsonValue deps = jsonObject.value("dependencies"); !deps.isUndefined()) { + const QJsonArray dependencies = deps.toArray(); + for (const QJsonValue &dependency : dependencies) { + if (dependency.isString()) + result.dependencies.append(dependency.toString()); + else if (const QJsonValue name = dependency.toObject().value("name"); name.isString()) + result.dependencies.append(name.toString()); + } + } if (const QJsonValue description = jsonObject.value("description"); !description.isUndefined()) { if (description.isArray()) { const QJsonArray descriptionLines = description.toArray(); diff --git a/src/plugins/vcpkg/vcpkgsearch.h b/src/plugins/vcpkg/vcpkgsearch.h index bb2d568a00c..2f9242257e6 100644 --- a/src/plugins/vcpkg/vcpkgsearch.h +++ b/src/plugins/vcpkg/vcpkgsearch.h @@ -15,6 +15,7 @@ struct VcpkgManifest QString name; QString version; QString license; + QStringList dependencies; QString shortDescription; QStringList description; QUrl homepage; From e02e122991213301ccc16c0d65c5a7f927c26a0a Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 5 Jul 2023 21:15:14 +0200 Subject: [PATCH 0172/1777] Vcpkg: Generate CMakeLists.txt code Provide the contents of the "usage" file for copy & pasting into CMakeLists.txt. If the "usage" file is not available, provide the same heuristic code that vcpkg generates. Task-number: QTCREATORBUG-29333 Change-Id: I3daba7616451a43f93fd8f2e0353542ec5a2c48b Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/vcpkg/images/cmakeicon.png | Bin 0 -> 227 bytes src/plugins/vcpkg/images/cmakeicon@2x.png | Bin 0 -> 460 bytes src/plugins/vcpkg/vcpkg.qrc | 2 + src/plugins/vcpkg/vcpkgmanifesteditor.cpp | 89 +++++++++++++++++++++- src/tools/icons/qtcreatoricons.svg | 42 +++++++--- 5 files changed, 121 insertions(+), 12 deletions(-) create mode 100644 src/plugins/vcpkg/images/cmakeicon.png create mode 100644 src/plugins/vcpkg/images/cmakeicon@2x.png diff --git a/src/plugins/vcpkg/images/cmakeicon.png b/src/plugins/vcpkg/images/cmakeicon.png new file mode 100644 index 0000000000000000000000000000000000000000..1e2403a18fb0cc9b9a8196b5dc3e8fbe9b906f1d GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4h9AW2CEqh_A)Rqtnzem43P*={=v_9-_BW* zC!p#%Ye-|cW_A1mjwx2LXPm_<jxGJ$^j2<?16%V8`DZRI2W-vQmfcS}6aJ7XkcWro ze2HXJBGdF45)xkjt&9!kwQ>D0Dp>RDo9v1+yh;U=0-v4g|9_vm@z=K|R++W)<$wPC z8Lu92;EjAhLi(xW6>N=fqTj2%GBU{dbN)mA#o%H#feY^{iq-D_(m%ZT@g$yr1CrGb fKD*Ayf5^aav3YaIgZ@cIAlG}k`njxgN@xNAAX8l# literal 0 HcmV?d00001 diff --git a/src/plugins/vcpkg/images/cmakeicon@2x.png b/src/plugins/vcpkg/images/cmakeicon@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..89f5c4cc5fc69d2c68a12f7480991518eca18e5f GIT binary patch literal 460 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4h9AWhA=@@4F(3r$(}BbAr}6vm#sZ!CyE^V zxPOt`2Q!W?uNJ4)AdMjJr5dj6?TcPa6O&nMC03Hjy3vW9RgjBM=;f0KqFk-7l(wz7 zdQz{c;^0E1r0xZodsupZ%C&ztKK9=G%;vepbszQ}w$$(}xU#T7NTB43--a#gu2ws~ z<*)6!!<;4&{yrip!S?CqHu*R;7U2s^*Z&Z1T<v~gQEJzDp$5SPj@AYO@-2G~6wh_| z_kTx%z=DudP4g-qEMYj1{E{){e=oBglY@hP1E0CY8Pf!BUx#PwxJzbPc4skHyk@DM znRZVk#N6T5GUhFe6E4Y4Y-6aX70+4DoZ|0&Y0Ad^?;Fe+;x=<}Kie3-F+o?f;^+A- zW^dpB>tXzQVE61?n@x^ibt9P0i@QGFc=Wr*ilrH@VfWi}nfI7g2yHy5GxfLCS4Xe2 zFLo}ejBgW6W{VI#`}|gQT2<xS{VKA*Pcxp<Q(bbhE_36A47u;}UQxN{8TYrWo2FWC zwejPRXF8fDq2WbpA{Sh>*HzsAKXJ=Og+o>=iq1D~IhLQO`DBl8_@t)nR?!QNul@)B P14WaktDnm{r-UW|bri`> literal 0 HcmV?d00001 diff --git a/src/plugins/vcpkg/vcpkg.qrc b/src/plugins/vcpkg/vcpkg.qrc index a377b736db3..af1c2d1f8c6 100644 --- a/src/plugins/vcpkg/vcpkg.qrc +++ b/src/plugins/vcpkg/vcpkg.qrc @@ -2,5 +2,7 @@ <qresource prefix="/vcpkg"> <file>wizards/manifest/vcpkg.json.tpl</file> <file>wizards/manifest/wizard.json</file> + <file>images/cmakeicon.png</file> + <file>images/cmakeicon@2x.png</file> </qresource> </RCC> diff --git a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp index 0c22f944256..917ef780923 100644 --- a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp +++ b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp @@ -10,27 +10,106 @@ #include <coreplugin/icore.h> +#include <utils/icon.h> +#include <utils/layoutbuilder.h> +#include <utils/stringutils.h> #include <utils/utilsicons.h> +#include <texteditor/fontsettings.h> #include <texteditor/textdocument.h> +#include <texteditor/texteditorsettings.h> +#include <QDialogButtonBox> +#include <QPlainTextEdit> #include <QToolBar> namespace Vcpkg::Internal { +class CMakeCodeDialog : public QDialog +{ +public: + explicit CMakeCodeDialog(const QStringList &packages, QWidget *parent = nullptr); + +private: + static QString cmakeCodeForPackage(const QString &package); + static QString cmakeCodeForPackages(const QStringList &packages); +}; + +CMakeCodeDialog::CMakeCodeDialog(const QStringList &packages, QWidget *parent) + : QDialog(parent) +{ + resize(600, 600); + + auto codeBrowser = new QPlainTextEdit; + const TextEditor::FontSettings &fs = TextEditor::TextEditorSettings::fontSettings(); + codeBrowser->setFont(fs.font()); + codeBrowser->setPlainText(cmakeCodeForPackages(packages)); + + auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); + + using namespace Layouting; + Column { + Tr::tr("Copy paste the required lines into your CMakeLists.txt:"), + codeBrowser, + buttonBox, + }.attachTo(this); + + connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); +} + +QString CMakeCodeDialog::cmakeCodeForPackage(const QString &package) +{ + QString result; + + const Utils::FilePath usageFile = settings().vcpkgRoot() / "ports" / package / "usage"; + if (usageFile.exists()) { + Utils::FileReader reader; + if (reader.fetch(usageFile)) + result = QString::fromUtf8(reader.data()); + } else { + result = QString( +R"(The package %1 provides CMake targets: + + # this is heuristically generated, and may not be correct + find_package(%1 CONFIG REQUIRED) + target_link_libraries(main PRIVATE %1::%1))" + ).arg(package); + } + + return result; +} + +QString CMakeCodeDialog::cmakeCodeForPackages(const QStringList &packages) +{ + QString result; + for (const QString &package : packages) + result.append(cmakeCodeForPackage(package) + "\n\n"); + return result; +} + class VcpkgManifestEditorWidget : public TextEditor::TextEditorWidget { public: VcpkgManifestEditorWidget() { m_searchPkgAction = toolBar()->addAction(Utils::Icons::ZOOM_TOOLBAR.icon(), - Tr::tr("Add vcpkg package...")); + Tr::tr("Add vcpkg package...")); connect(m_searchPkgAction, &QAction::triggered, this, [this] { const Search::VcpkgManifest package = Search::showVcpkgPackageSearchDialog(); if (!package.name.isEmpty()) textCursor().insertText(package.name); }); - updateToolBar(); + + const QIcon cmakeIcon = Utils::Icon({{":/vcpkg/images/cmakeicon.png", + Utils::Theme::IconsBaseColor}}).icon(); + m_cmakeCodeAction = toolBar()->addAction(cmakeIcon, Tr::tr("CMake code...")); + connect(m_cmakeCodeAction, &QAction::triggered, this, [this] { + bool ok = false; + const Search::VcpkgManifest manifest = + Search::parseVcpkgManifest(textDocument()->contents(), &ok); + CMakeCodeDialog dlg(manifest.dependencies); + dlg.exec(); + }); QAction *optionsAction = toolBar()->addAction(Utils::Icons::SETTINGS_TOOLBAR.icon(), Core::ICore::msgShowOptionsDialog()); @@ -38,6 +117,7 @@ public: Core::ICore::showOptionsDialog(Constants::TOOLSSETTINGSPAGE_ID); }); + updateToolBar(); connect(&settings().vcpkgRoot, &Utils::BaseAspect::changed, this, &VcpkgManifestEditorWidget::updateToolBar); } @@ -45,11 +125,14 @@ public: void updateToolBar() { Utils::FilePath vcpkg = settings().vcpkgRoot().pathAppended("vcpkg").withExecutableSuffix(); - m_searchPkgAction->setEnabled(vcpkg.isExecutableFile()); + const bool vcpkgEncabled = vcpkg.isExecutableFile(); + m_searchPkgAction->setEnabled(vcpkgEncabled); + m_cmakeCodeAction->setEnabled(vcpkgEncabled); } private: QAction *m_searchPkgAction; + QAction *m_cmakeCodeAction; }; static TextEditor::TextDocument *createVcpkgManifestDocument() diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg index 13a4fe5b918..a87a018dcd5 100644 --- a/src/tools/icons/qtcreatoricons.svg +++ b/src/tools/icons/qtcreatoricons.svg @@ -3145,15 +3145,18 @@ height="100%" transform="translate(1090,64)" style="display:inline;fill:none" /> - <path - id="path4544-1" - style="fill:#000000" - d="m 1078,478.85 -8.5,16.15 h 17 z m 0.7724,8.61732 0.4208,4.69491 -4.1948,-1.62916 z" /> - <path - id="path6034" - style="fill:none;stroke:#ffffff" - d="m 1078,478.85469 1.189,13.30208 m -4.1861,-1.62746 L 1086.5,495 m -17,0 9.272,-7.52758" - sodipodi:nodetypes="cccccc" /> + <g + id="CMakeLogo"> + <path + id="path4544-1" + style="fill:#000000" + d="m 1078,478.85 -8.5,16.15 h 17 z m 0.7724,8.61732 0.4208,4.69491 -4.1948,-1.62916 z" /> + <path + id="path6034" + style="fill:none;stroke:#ffffff;stroke-width:1.2" + d="m 1078,478.85469 1.189,13.30208 m -4.1861,-1.62746 L 1086.5,495 m -17,0 9.272,-7.52758" + sodipodi:nodetypes="cccccc" /> + </g> </g> <g id="src/plugins/terminal/images/settingscategory_terminal"> @@ -3640,6 +3643,27 @@ inkscape:connector-curvature="0" sodipodi:nodetypes="cczczcc" /> </g> + <g + id="src/plugins/vcpkg/images/cmakeicon" + transform="translate(862,88.5)" + style="display:inline"> + <use + style="display:inline" + transform="translate(1137,43.5)" + height="100%" + width="100%" + id="use1952-7-6" + xlink:href="#backgroundRect" + y="0" + x="0" /> + <use + x="0" + y="0" + xlink:href="#CMakeLogo" + id="use2008" + style="display:inline" + transform="matrix(0.89482687,0,0,0.89482687,164.39232,51.559627)" /> + </g> </g> <g inkscape:groupmode="layer" From 731f61c30d56752b916cedbc5f48e15255758a8a Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 28 Jun 2023 19:14:50 +0200 Subject: [PATCH 0173/1777] SearchEngine: Replace executeSearch() with searchExecutor() Change-Id: Icce615d0cedef35ff4278f9ecfffa415b1aa0386 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/git/gitgrep.cpp | 6 ++++-- src/plugins/git/gitgrep.h | 3 +-- .../findinfilessilversearcher.cpp | 7 ++++--- .../silversearcher/findinfilessilversearcher.h | 3 +-- src/plugins/texteditor/basefilefind.cpp | 17 ++++++++++------- src/plugins/texteditor/basefilefind.h | 5 +++-- 6 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index 56ff5bd098e..3ecf90b7ac7 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -265,9 +265,11 @@ void GitGrep::writeSettings(QSettings *settings) const settings->setValue(GitGrepRef, m_treeLineEdit->text()); } -QFuture<SearchResultItems> GitGrep::executeSearch(const FileFindParameters ¶meters) +SearchExecutor GitGrep::searchExecutor() const { - return Utils::asyncRun(runGitGrep, parameters); + return [](const FileFindParameters ¶meters) { + return Utils::asyncRun(runGitGrep, parameters); + }; } EditorOpener GitGrep::editorOpener() const diff --git a/src/plugins/git/gitgrep.h b/src/plugins/git/gitgrep.h index 1c905f3667d..6539a5adc4d 100644 --- a/src/plugins/git/gitgrep.h +++ b/src/plugins/git/gitgrep.h @@ -28,8 +28,7 @@ public: QVariant parameters() const override; void readSettings(QSettings *settings) override; void writeSettings(QSettings *settings) const override; - QFuture<Utils::SearchResultItems> executeSearch( - const TextEditor::FileFindParameters ¶meters) override; + TextEditor::SearchExecutor searchExecutor() const override; TextEditor::EditorOpener editorOpener() const override; private: diff --git a/src/plugins/silversearcher/findinfilessilversearcher.cpp b/src/plugins/silversearcher/findinfilessilversearcher.cpp index 61fe860a1db..5782ece0333 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.cpp +++ b/src/plugins/silversearcher/findinfilessilversearcher.cpp @@ -164,10 +164,11 @@ void FindInFilesSilverSearcher::writeSettings(QSettings *settings) const settings->setValue(s_searchOptionsString, m_searchOptionsLineEdit->text()); } -QFuture<SearchResultItems> FindInFilesSilverSearcher::executeSearch( - const FileFindParameters ¶meters) +SearchExecutor FindInFilesSilverSearcher::searchExecutor() const { - return Utils::asyncRun(runSilverSeacher, parameters); + return [](const FileFindParameters ¶meters) { + return Utils::asyncRun(runSilverSeacher, parameters); + }; } void FindInFilesSilverSearcher::readSettings(QSettings *settings) diff --git a/src/plugins/silversearcher/findinfilessilversearcher.h b/src/plugins/silversearcher/findinfilessilversearcher.h index dcb6873d18d..2905794e56d 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.h +++ b/src/plugins/silversearcher/findinfilessilversearcher.h @@ -31,8 +31,7 @@ public: QVariant parameters() const override; void readSettings(QSettings *settings) override; void writeSettings(QSettings *settings) const override; - QFuture<Utils::SearchResultItems> executeSearch( - const TextEditor::FileFindParameters ¶meters) override; + TextEditor::SearchExecutor searchExecutor() const override; private: QPointer<Core::IFindSupport> m_currentFindSupport; diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 8d935494f43..c44c78f0768 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -145,11 +145,12 @@ public: QVariant parameters() const override { return {}; } void readSettings(QSettings * /*settings*/) override {} void writeSettings(QSettings * /*settings*/) const override {} - QFuture<SearchResultItems> executeSearch(const FileFindParameters ¶meters) override + SearchExecutor searchExecutor() const override { - return Utils::findInFiles(parameters.text, parameters.fileContainerProvider(), - parameters.flags, TextDocument::openedTextDocumentContents()); - + return [](const FileFindParameters ¶meters) { + return Utils::findInFiles(parameters.text, parameters.fileContainerProvider(), + parameters.flags, TextDocument::openedTextDocumentContents()); + }; } private: @@ -307,16 +308,18 @@ void BaseFileFind::runNewSearch(const QString &txt, FindFlags findFlags, setupSearch(search); search->setTextToReplace(txt); search->setSearchAgainSupported(true); + SearchEngine *searchEngine = currentSearchEngine(); FileFindParameters parameters; parameters.text = txt; parameters.flags = findFlags; parameters.nameFilters = fileNameFilters(); parameters.exclusionFilters = fileExclusionFilters(); parameters.additionalParameters = additionalParameters(); - parameters.searchEngineParameters = currentSearchEngine()->parameters(); + parameters.searchEngineParameters = searchEngine->parameters(); parameters.searchEngineIndex = d->m_currentSearchEngineIndex; parameters.fileContainerProvider = fileContainerProvider(); - parameters.editorOpener = currentSearchEngine()->editorOpener(); + parameters.editorOpener = searchEngine->editorOpener(); + parameters.searchExecutor = searchEngine->searchExecutor(); search->setUserData(QVariant::fromValue(parameters)); connect(search, &SearchResult::activated, this, [this, search](const SearchResultItem &item) { @@ -594,7 +597,7 @@ FilePaths BaseFileFind::replaceAll(const QString &text, const SearchResultItems QFuture<SearchResultItems> BaseFileFind::executeSearch(const FileFindParameters ¶meters) { - return d->m_searchEngines[parameters.searchEngineIndex]->executeSearch(parameters); + return parameters.searchExecutor(parameters); } namespace Internal { diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index f52a9983d2c..2d00e2e6279 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -32,6 +32,7 @@ class FileFindParameters; using FileContainerProvider = std::function<Utils::FileContainer()>; using EditorOpener = std::function<Core::IEditor *(const Utils::SearchResultItem &, const FileFindParameters &)>; +using SearchExecutor = std::function<QFuture<Utils::SearchResultItems>(const FileFindParameters &)>; class TEXTEDITOR_EXPORT FileFindParameters { @@ -45,6 +46,7 @@ public: Utils::FindFlags flags; FileContainerProvider fileContainerProvider = {}; EditorOpener editorOpener = {}; + SearchExecutor searchExecutor = {}; }; using ProcessSetupHandler = std::function<void(Utils::Process &)>; @@ -72,8 +74,7 @@ public: virtual QVariant parameters() const = 0; virtual void readSettings(QSettings *settings) = 0; virtual void writeSettings(QSettings *settings) const = 0; - virtual QFuture<Utils::SearchResultItems> executeSearch( - const FileFindParameters ¶meters) = 0; + virtual SearchExecutor searchExecutor() const = 0; virtual EditorOpener editorOpener() const { return {}; } bool isEnabled() const; void setEnabled(bool enabled); From 51beff5644a9c11d02e22783c4f5fcad9ca2552f Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 28 Jun 2023 19:17:16 +0200 Subject: [PATCH 0174/1777] FileFindParameters: Get rid of searchEngineIndex field Change-Id: I75301de5fff471cf914da1bbbf8a2f526810ab0e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/texteditor/basefilefind.cpp | 1 - src/plugins/texteditor/basefilefind.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index c44c78f0768..845d82f5a06 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -316,7 +316,6 @@ void BaseFileFind::runNewSearch(const QString &txt, FindFlags findFlags, parameters.exclusionFilters = fileExclusionFilters(); parameters.additionalParameters = additionalParameters(); parameters.searchEngineParameters = searchEngine->parameters(); - parameters.searchEngineIndex = d->m_currentSearchEngineIndex; parameters.fileContainerProvider = fileContainerProvider(); parameters.editorOpener = searchEngine->editorOpener(); parameters.searchExecutor = searchEngine->searchExecutor(); diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index 2d00e2e6279..b284eeabc03 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -42,7 +42,6 @@ public: QStringList exclusionFilters; QVariant additionalParameters; QVariant searchEngineParameters; - int searchEngineIndex; Utils::FindFlags flags; FileContainerProvider fileContainerProvider = {}; EditorOpener editorOpener = {}; From 453452864f227bc0b13975de76a8ed6865cb5474 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 28 Jun 2023 19:25:24 +0200 Subject: [PATCH 0175/1777] FileFindParameters: Get rid of searchEngineParameters field Get rid of ambiguous searchEngineParameters QVariant. Pass the custom parameters through the lambda captures of the SearchEngine::searchExecutor() overloads. Change-Id: I971a3871199a17200ec662392dfd7095a7a56a50 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/git/gitgrep.cpp | 16 +++------- src/plugins/git/gitgrep.h | 1 - .../findinfilessilversearcher.cpp | 29 ++++--------------- .../findinfilessilversearcher.h | 1 - src/plugins/texteditor/basefilefind.cpp | 2 -- src/plugins/texteditor/basefilefind.h | 2 -- 6 files changed, 10 insertions(+), 41 deletions(-) diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index 3ecf90b7ac7..ccd9ac5af91 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -131,11 +131,10 @@ static SearchResultItems parse(const QFuture<void> &future, const QString &input return items; } -static void runGitGrep(QPromise<SearchResultItems> &promise, const FileFindParameters ¶meters) +static void runGitGrep(QPromise<SearchResultItems> &promise, const FileFindParameters ¶meters, + const GitGrepParameters &gitParameters) { const FilePath directory = FilePath::fromString(parameters.additionalParameters.toString()); - const GitGrepParameters gitParameters - = parameters.searchEngineParameters.value<GitGrepParameters>(); const QString ref = gitParameters.ref.isEmpty() ? QString() : gitParameters.ref + ':'; const auto setupProcess = [&](Process &process) { @@ -250,11 +249,6 @@ GitGrepParameters GitGrep::gitParameters() const return {m_treeLineEdit->text(), m_recurseSubmodules && m_recurseSubmodules->isChecked()}; } -QVariant GitGrep::parameters() const -{ - return QVariant::fromValue(gitParameters()); -} - void GitGrep::readSettings(QSettings *settings) { m_treeLineEdit->setText(settings->value(GitGrepRef).toString()); @@ -267,8 +261,8 @@ void GitGrep::writeSettings(QSettings *settings) const SearchExecutor GitGrep::searchExecutor() const { - return [](const FileFindParameters ¶meters) { - return Utils::asyncRun(runGitGrep, parameters); + return [gitParameters = gitParameters()](const FileFindParameters ¶meters) { + return Utils::asyncRun(runGitGrep, parameters, gitParameters); }; } @@ -290,5 +284,3 @@ EditorOpener GitGrep::editorOpener() const } } // Git::Internal - -Q_DECLARE_METATYPE(Git::Internal::GitGrepParameters) diff --git a/src/plugins/git/gitgrep.h b/src/plugins/git/gitgrep.h index 6539a5adc4d..6563f5bcaad 100644 --- a/src/plugins/git/gitgrep.h +++ b/src/plugins/git/gitgrep.h @@ -25,7 +25,6 @@ public: QString title() const override; QString toolTip() const override; QWidget *widget() const override; - QVariant parameters() const override; void readSettings(QSettings *settings) override; void writeSettings(QSettings *settings) const override; TextEditor::SearchExecutor searchExecutor() const override; diff --git a/src/plugins/silversearcher/findinfilessilversearcher.cpp b/src/plugins/silversearcher/findinfilessilversearcher.cpp index 5782ece0333..a339b671398 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.cpp +++ b/src/plugins/silversearcher/findinfilessilversearcher.cpp @@ -24,12 +24,6 @@ namespace { const QLatin1String s_metaCharacters = QLatin1String("+()^$.{}[]|\\"); const QLatin1String s_searchOptionsString = QLatin1String("SearchOptionsString"); -class SilverSearcherSearchOptions -{ -public: - QString searchOptions; -}; - static QString convertWildcardToRegex(const QString &wildcard) { QString regex; @@ -60,9 +54,9 @@ static bool isSilverSearcherAvailable() } static void runSilverSeacher(QPromise<SearchResultItems> &promise, - const FileFindParameters ¶meters) + const FileFindParameters ¶meters, const QString &searchOptions) { - const auto setupProcess = [parameters](Process &process) { + const auto setupProcess = [parameters, searchOptions](Process &process) { const FilePath directory = FilePath::fromUserInput(parameters.additionalParameters.toString()); QStringList arguments = {"--parallel", "--ackmate"}; @@ -88,10 +82,8 @@ static void runSilverSeacher(QPromise<SearchResultItems> &promise, arguments << "-G" << nameFiltersAsRegExp; - const SilverSearcherSearchOptions params = parameters.searchEngineParameters - .value<SilverSearcherSearchOptions>(); - if (!params.searchOptions.isEmpty()) - arguments << params.searchOptions.split(' '); + if (!searchOptions.isEmpty()) + arguments << searchOptions.split(' '); arguments << "--" << parameters.text << directory.normalizedPathName().toString(); process.setCommand({"ag", arguments}); @@ -108,8 +100,6 @@ static void runSilverSeacher(QPromise<SearchResultItems> &promise, } // namespace -Q_DECLARE_METATYPE(SilverSearcherSearchOptions) - namespace SilverSearcher { FindInFilesSilverSearcher::FindInFilesSilverSearcher(QObject *parent) @@ -137,13 +127,6 @@ FindInFilesSilverSearcher::FindInFilesSilverSearcher(QObject *parent) } } -QVariant FindInFilesSilverSearcher::parameters() const -{ - SilverSearcherSearchOptions silverSearcherSearchOptions; - silverSearcherSearchOptions.searchOptions = m_searchOptionsLineEdit->text(); - return QVariant::fromValue(silverSearcherSearchOptions); -} - QString FindInFilesSilverSearcher::title() const { return "Silver Searcher"; @@ -166,8 +149,8 @@ void FindInFilesSilverSearcher::writeSettings(QSettings *settings) const SearchExecutor FindInFilesSilverSearcher::searchExecutor() const { - return [](const FileFindParameters ¶meters) { - return Utils::asyncRun(runSilverSeacher, parameters); + return [searchOptions = m_searchOptionsLineEdit->text()](const FileFindParameters ¶meters) { + return Utils::asyncRun(runSilverSeacher, parameters, searchOptions); }; } diff --git a/src/plugins/silversearcher/findinfilessilversearcher.h b/src/plugins/silversearcher/findinfilessilversearcher.h index 2905794e56d..82c32f1422d 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.h +++ b/src/plugins/silversearcher/findinfilessilversearcher.h @@ -28,7 +28,6 @@ public: QString title() const override; QString toolTip() const override; QWidget *widget() const override; - QVariant parameters() const override; void readSettings(QSettings *settings) override; void writeSettings(QSettings *settings) const override; TextEditor::SearchExecutor searchExecutor() const override; diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 845d82f5a06..92ec095fd9a 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -142,7 +142,6 @@ public: QString title() const override { return Tr::tr("Internal"); } QString toolTip() const override { return {}; } QWidget *widget() const override { return m_widget; } - QVariant parameters() const override { return {}; } void readSettings(QSettings * /*settings*/) override {} void writeSettings(QSettings * /*settings*/) const override {} SearchExecutor searchExecutor() const override @@ -315,7 +314,6 @@ void BaseFileFind::runNewSearch(const QString &txt, FindFlags findFlags, parameters.nameFilters = fileNameFilters(); parameters.exclusionFilters = fileExclusionFilters(); parameters.additionalParameters = additionalParameters(); - parameters.searchEngineParameters = searchEngine->parameters(); parameters.fileContainerProvider = fileContainerProvider(); parameters.editorOpener = searchEngine->editorOpener(); parameters.searchExecutor = searchEngine->searchExecutor(); diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index b284eeabc03..02c8a78ad74 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -41,7 +41,6 @@ public: QStringList nameFilters; QStringList exclusionFilters; QVariant additionalParameters; - QVariant searchEngineParameters; Utils::FindFlags flags; FileContainerProvider fileContainerProvider = {}; EditorOpener editorOpener = {}; @@ -70,7 +69,6 @@ public: virtual QString title() const = 0; virtual QString toolTip() const = 0; // add %1 placeholder where the find flags should be put virtual QWidget *widget() const = 0; - virtual QVariant parameters() const = 0; virtual void readSettings(QSettings *settings) = 0; virtual void writeSettings(QSettings *settings) const = 0; virtual SearchExecutor searchExecutor() const = 0; From cf7a41e963d8763640eb0ff76538c7e30dfff784 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 28 Jun 2023 19:37:32 +0200 Subject: [PATCH 0176/1777] BaseFileFind: Get rid of executeSearch() Use FileFindParameters::searchExecutor directly instead. Change-Id: I03e5018c8094b69d3b21a4630956514b3abc7a1d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/texteditor/basefilefind.cpp | 7 +------ src/plugins/texteditor/basefilefind.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 92ec095fd9a..7435d00b264 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -353,7 +353,7 @@ void BaseFileFind::runSearch(SearchResult *search) connect(watcher, &QFutureWatcherBase::finished, search, [watcher, search]() { search->finishSearch(watcher->isCanceled()); }); - QFuture<SearchResultItems> future = executeSearch(parameters); + QFuture<SearchResultItems> future = parameters.searchExecutor(parameters); watcher->setFuture(future); d->m_futureSynchronizer.addFuture(future); FutureProgress *progress = ProgressManager::addTask(future, @@ -592,11 +592,6 @@ FilePaths BaseFileFind::replaceAll(const QString &text, const SearchResultItems return changes.keys(); } -QFuture<SearchResultItems> BaseFileFind::executeSearch(const FileFindParameters ¶meters) -{ - return parameters.searchExecutor(parameters); -} - namespace Internal { } // namespace Internal diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index 02c8a78ad74..58a51263cae 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -106,7 +106,6 @@ protected: virtual QString label() const = 0; // see Core::SearchResultWindow::startNewSearch virtual QString toolTip() const = 0; // see Core::SearchResultWindow::startNewSearch, // add %1 placeholder where the find flags should be put - QFuture<Utils::SearchResultItems> executeSearch(const FileFindParameters ¶meters); void writeCommonSettings(QSettings *settings); void readCommonSettings(QSettings *settings, const QString &defaultFilter, const QString &defaultExclusionFilter); From bf09d179928c29983b4d18d1eef506615ac24234 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 28 Jun 2023 22:42:22 +0200 Subject: [PATCH 0177/1777] BaseFileFind: Replace additionalParameters() with searchDir() The FileFindParameters::additionalParameters, holding QVariant, was ambiguous. Since GitGrep and SilverSearcher need a search directory input unconditionally, replace the additionalParameters field with searchDir of FilePath type. For Internal search engine, this field isn't used - the searchDir is already passed in FindInFiles::fileContainerProvider() with lambda capture; for other BaseFileFind subclasses, not combined with non-Internal search engine, the field isn't used anyway. This change closes the chain of patches to eliminate the usage of ambiguous QVariant type inside FileFindParameters. Change-Id: Icddd1cfe46e86ea892221862d9d267f9c9fa173c Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/git/gitgrep.cpp | 15 ++++++--------- src/plugins/projectexplorer/allprojectsfind.cpp | 5 ----- src/plugins/projectexplorer/allprojectsfind.h | 2 -- .../projectexplorer/currentprojectfind.cpp | 8 -------- src/plugins/projectexplorer/currentprojectfind.h | 1 - .../silversearcher/findinfilessilversearcher.cpp | 4 +--- src/plugins/texteditor/basefilefind.cpp | 2 +- src/plugins/texteditor/basefilefind.h | 4 ++-- src/plugins/texteditor/findincurrentfile.cpp | 5 ----- src/plugins/texteditor/findincurrentfile.h | 1 - src/plugins/texteditor/findinfiles.cpp | 13 ++++--------- src/plugins/texteditor/findinfiles.h | 3 +-- src/plugins/texteditor/findinopenfiles.cpp | 5 ----- src/plugins/texteditor/findinopenfiles.h | 1 - 14 files changed, 15 insertions(+), 54 deletions(-) diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index ccd9ac5af91..8961f45c77a 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -134,10 +134,7 @@ static SearchResultItems parse(const QFuture<void> &future, const QString &input static void runGitGrep(QPromise<SearchResultItems> &promise, const FileFindParameters ¶meters, const GitGrepParameters &gitParameters) { - const FilePath directory = FilePath::fromString(parameters.additionalParameters.toString()); - const QString ref = gitParameters.ref.isEmpty() ? QString() : gitParameters.ref + ':'; - - const auto setupProcess = [&](Process &process) { + const auto setupProcess = [¶meters, gitParameters](Process &process) { const FilePath vcsBinary = GitClient::instance()->vcsBinary(); const Environment environment = GitClient::instance()->processEnvironment(); @@ -173,12 +170,13 @@ static void runGitGrep(QPromise<SearchResultItems> &promise, const FileFindParam process.setEnvironment(environment); process.setCommand({vcsBinary, arguments}); - process.setWorkingDirectory(directory); + process.setWorkingDirectory(parameters.searchDir); }; - const auto outputParser = [&ref, &directory](const QFuture<void> &future, const QString &input, + const QString ref = gitParameters.ref.isEmpty() ? QString() : gitParameters.ref + ':'; + const auto outputParser = [&ref, ¶meters](const QFuture<void> &future, const QString &input, const std::optional<QRegularExpression> ®Exp) { - return parse(future, input, regExp, ref, directory); + return parse(future, input, regExp, ref, parameters.searchDir); }; TextEditor::searchInProcessOutput(promise, parameters, setupProcess, outputParser); @@ -274,9 +272,8 @@ EditorOpener GitGrep::editorOpener() const if (params.ref.isEmpty() || itemPath.isEmpty()) return nullptr; const FilePath path = FilePath::fromUserInput(itemPath.first()); - const FilePath topLevel = FilePath::fromString(parameters.additionalParameters.toString()); IEditor *editor = GitClient::instance()->openShowEditor( - topLevel, params.ref, path, GitClient::ShowEditor::OnlyIfDifferent); + parameters.searchDir, params.ref, path, GitClient::ShowEditor::OnlyIfDifferent); if (editor) editor->gotoLine(item.mainRange().begin.line, item.mainRange().begin.column); return editor; diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp index c9fdcb11225..0f99b2db00e 100644 --- a/src/plugins/projectexplorer/allprojectsfind.cpp +++ b/src/plugins/projectexplorer/allprojectsfind.cpp @@ -79,11 +79,6 @@ FileContainer AllProjectsFind::filesForProjects(const QStringList &nameFilters, return FileListContainer(encodings.keys(), encodings.values()); } -QVariant AllProjectsFind::additionalParameters() const -{ - return QVariant(); -} - QString AllProjectsFind::label() const { return Tr::tr("All Projects:"); diff --git a/src/plugins/projectexplorer/allprojectsfind.h b/src/plugins/projectexplorer/allprojectsfind.h index c4d70e1a1c5..d3fcd536d57 100644 --- a/src/plugins/projectexplorer/allprojectsfind.h +++ b/src/plugins/projectexplorer/allprojectsfind.h @@ -33,8 +33,6 @@ protected: static Utils::FileContainer filesForProjects(const QStringList &nameFilters, const QStringList &exclusionFilters, const QList<Project *> &projects); - - QVariant additionalParameters() const override; QString label() const override; QString toolTip() const override; diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index 7bd8bd332c9..4cece1f5b6f 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -49,14 +49,6 @@ bool CurrentProjectFind::isEnabled() const return ProjectTree::currentProject() != nullptr && BaseFileFind::isEnabled(); } -QVariant CurrentProjectFind::additionalParameters() const -{ - Project *project = ProjectTree::currentProject(); - if (project) - return project->projectFilePath().toVariant(); - return QVariant(); -} - static FilePath currentProjectFilePath() { Project *project = ProjectTree::currentProject(); diff --git a/src/plugins/projectexplorer/currentprojectfind.h b/src/plugins/projectexplorer/currentprojectfind.h index 4ac5e4eeb30..c9ed8cdba33 100644 --- a/src/plugins/projectexplorer/currentprojectfind.h +++ b/src/plugins/projectexplorer/currentprojectfind.h @@ -27,7 +27,6 @@ public: void readSettings(QSettings *settings) override; protected: - QVariant additionalParameters() const override; QString label() const override; private: diff --git a/src/plugins/silversearcher/findinfilessilversearcher.cpp b/src/plugins/silversearcher/findinfilessilversearcher.cpp index a339b671398..728367d1e5e 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.cpp +++ b/src/plugins/silversearcher/findinfilessilversearcher.cpp @@ -57,8 +57,6 @@ static void runSilverSeacher(QPromise<SearchResultItems> &promise, const FileFindParameters ¶meters, const QString &searchOptions) { const auto setupProcess = [parameters, searchOptions](Process &process) { - const FilePath directory - = FilePath::fromUserInput(parameters.additionalParameters.toString()); QStringList arguments = {"--parallel", "--ackmate"}; if (parameters.flags & FindCaseSensitively) @@ -85,7 +83,7 @@ static void runSilverSeacher(QPromise<SearchResultItems> &promise, if (!searchOptions.isEmpty()) arguments << searchOptions.split(' '); - arguments << "--" << parameters.text << directory.normalizedPathName().toString(); + arguments << "--" << parameters.text << parameters.searchDir.normalizedPathName().toString(); process.setCommand({"ag", arguments}); }; diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 7435d00b264..4372abba6b0 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -313,7 +313,7 @@ void BaseFileFind::runNewSearch(const QString &txt, FindFlags findFlags, parameters.flags = findFlags; parameters.nameFilters = fileNameFilters(); parameters.exclusionFilters = fileExclusionFilters(); - parameters.additionalParameters = additionalParameters(); + parameters.searchDir = searchDir(); parameters.fileContainerProvider = fileContainerProvider(); parameters.editorOpener = searchEngine->editorOpener(); parameters.searchExecutor = searchEngine->searchExecutor(); diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index 58a51263cae..da740d15bc5 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -40,7 +40,7 @@ public: QString text; QStringList nameFilters; QStringList exclusionFilters; - QVariant additionalParameters; + Utils::FilePath searchDir; Utils::FindFlags flags; FileContainerProvider fileContainerProvider = {}; EditorOpener editorOpener = {}; @@ -102,7 +102,7 @@ public: bool preserveCase = false); protected: - virtual QVariant additionalParameters() const = 0; + virtual Utils::FilePath searchDir() const { return {}; } virtual QString label() const = 0; // see Core::SearchResultWindow::startNewSearch virtual QString toolTip() const = 0; // see Core::SearchResultWindow::startNewSearch, // add %1 placeholder where the find flags should be put diff --git a/src/plugins/texteditor/findincurrentfile.cpp b/src/plugins/texteditor/findincurrentfile.cpp index 197d02f53e6..2a61602569a 100644 --- a/src/plugins/texteditor/findincurrentfile.cpp +++ b/src/plugins/texteditor/findincurrentfile.cpp @@ -47,11 +47,6 @@ FileContainerProvider FindInCurrentFile::fileContainerProvider() const }; } -QVariant FindInCurrentFile::additionalParameters() const -{ - return m_currentDocument->filePath().toVariant(); -} - QString FindInCurrentFile::label() const { return Tr::tr("File \"%1\":").arg(m_currentDocument->filePath().fileName()); diff --git a/src/plugins/texteditor/findincurrentfile.h b/src/plugins/texteditor/findincurrentfile.h index 5eb75de05b0..7b0b17712c8 100644 --- a/src/plugins/texteditor/findincurrentfile.h +++ b/src/plugins/texteditor/findincurrentfile.h @@ -29,7 +29,6 @@ public: void readSettings(QSettings *settings) override; protected: - QVariant additionalParameters() const override; QString label() const override; QString toolTip() const override; diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index 3f073f82296..89a4c0763b0 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -61,23 +61,18 @@ QString FindInFiles::displayName() const FileContainerProvider FindInFiles::fileContainerProvider() const { return [nameFilters = fileNameFilters(), exclusionFilters = fileExclusionFilters(), - filePath = path()] { + filePath = searchDir()] { return SubDirFileContainer({filePath}, nameFilters, exclusionFilters, EditorManager::defaultTextCodec()); }; } -QVariant FindInFiles::additionalParameters() const -{ - return path().toVariant(); -} - QString FindInFiles::label() const { QString title = currentSearchEngine()->title(); const QChar slash = QLatin1Char('/'); - const QStringList &nonEmptyComponents = path().toFileInfo().absoluteFilePath() + const QStringList &nonEmptyComponents = searchDir().toFileInfo().absoluteFilePath() .split(slash, Qt::SkipEmptyParts); return Tr::tr("%1 \"%2\":") .arg(title) @@ -88,7 +83,7 @@ QString FindInFiles::toolTip() const { //: the last arg is filled by BaseFileFind::runNewSearch QString tooltip = Tr::tr("Path: %1\nFilter: %2\nExcluding: %3\n%4") - .arg(path().toUserOutput()) + .arg(searchDir().toUserOutput()) .arg(fileNameFilters().join(',')) .arg(fileExclusionFilters().join(',')); @@ -186,7 +181,7 @@ QWidget *FindInFiles::createConfigWidget() return m_configWidget; } -FilePath FindInFiles::path() const +FilePath FindInFiles::searchDir() const { return m_directory->filePath(); } diff --git a/src/plugins/texteditor/findinfiles.h b/src/plugins/texteditor/findinfiles.h index 3713ab0b1d7..d874e110383 100644 --- a/src/plugins/texteditor/findinfiles.h +++ b/src/plugins/texteditor/findinfiles.h @@ -44,7 +44,7 @@ signals: void pathChanged(const Utils::FilePath &directory); protected: - QVariant additionalParameters() const override; + Utils::FilePath searchDir() const override; QString label() const override; QString toolTip() const override; void syncSearchEngineCombo(int selectedSearchEngineIndex) override; @@ -53,7 +53,6 @@ private: FileContainerProvider fileContainerProvider() const override; void setValid(bool valid); void searchEnginesSelectionChanged(int index); - Utils::FilePath path() const; QPointer<QWidget> m_configWidget; QPointer<Utils::PathChooser> m_directory; diff --git a/src/plugins/texteditor/findinopenfiles.cpp b/src/plugins/texteditor/findinopenfiles.cpp index 6b3e7dbe9cb..2f2ee8de1d4 100644 --- a/src/plugins/texteditor/findinopenfiles.cpp +++ b/src/plugins/texteditor/findinopenfiles.cpp @@ -57,11 +57,6 @@ FileContainerProvider FindInOpenFiles::fileContainerProvider() const }; } -QVariant FindInOpenFiles::additionalParameters() const -{ - return {}; -} - QString FindInOpenFiles::label() const { return Tr::tr("Open documents:"); diff --git a/src/plugins/texteditor/findinopenfiles.h b/src/plugins/texteditor/findinopenfiles.h index a96cd4f0611..969a5ea5318 100644 --- a/src/plugins/texteditor/findinopenfiles.h +++ b/src/plugins/texteditor/findinopenfiles.h @@ -22,7 +22,6 @@ public: void readSettings(QSettings *settings) override; protected: - QVariant additionalParameters() const override; QString label() const override; QString toolTip() const override; From 7a28ed76b83f66e0b08290ac10bd40ebe92d1972 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 28 Jun 2023 23:55:16 +0200 Subject: [PATCH 0178/1777] BaseFileFind: Make searchDir() non-virtual Replace FindInFiles::pathChanged() with BaseFileFind::searchDirChanged(). Change-Id: I3cbe507968391fe45f513490424a7fe6fbbffee1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/git/gitgrep.cpp | 2 +- src/plugins/texteditor/basefilefind.cpp | 14 ++++++++++++++ src/plugins/texteditor/basefilefind.h | 4 +++- src/plugins/texteditor/findinfiles.cpp | 20 +++----------------- src/plugins/texteditor/findinfiles.h | 5 ----- 5 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index 8961f45c77a..890d9fe99c0 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -212,7 +212,7 @@ GitGrep::GitGrep(GitClient *client) }); FindInFiles *findInFiles = FindInFiles::instance(); QTC_ASSERT(findInFiles, return); - connect(findInFiles, &FindInFiles::pathChanged, m_widget, [this](const FilePath &path) { + connect(findInFiles, &FindInFiles::searchDirChanged, m_widget, [this](const FilePath &path) { setEnabled(isGitDirectory(path)); }); connect(this, &SearchEngine::enabledChanged, m_widget, &QWidget::setEnabled); diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 4372abba6b0..49b506ff501 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -187,6 +187,7 @@ public: QVector<SearchEngine *> m_searchEngines; InternalEngine m_internalSearchEngine; int m_currentSearchEngineIndex = -1; + FilePath m_searchDir; }; } // namespace Internal @@ -433,6 +434,19 @@ QList<QPair<QWidget *, QWidget *>> BaseFileFind::createPatternWidgets() return {{filterLabel, d->m_filterCombo}, {exclusionLabel, d->m_exclusionCombo}}; } +void BaseFileFind::setSearchDir(const FilePath &dir) +{ + if (dir == d->m_searchDir) + return; + d->m_searchDir = dir; + emit searchDirChanged(d->m_searchDir); +} + +FilePath BaseFileFind::searchDir() const +{ + return d->m_searchDir; +} + void BaseFileFind::writeCommonSettings(QSettings *settings) { const auto fromNativeSeparators = [](const QStringList &files) -> QStringList { diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index da740d15bc5..c7d53f80338 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -102,7 +102,8 @@ public: bool preserveCase = false); protected: - virtual Utils::FilePath searchDir() const { return {}; } + void setSearchDir(const Utils::FilePath &dir); + Utils::FilePath searchDir() const; virtual QString label() const = 0; // see Core::SearchResultWindow::startNewSearch virtual QString toolTip() const = 0; // see Core::SearchResultWindow::startNewSearch, // add %1 placeholder where the find flags should be put @@ -120,6 +121,7 @@ protected: signals: void currentSearchEngineChanged(); + void searchDirChanged(const Utils::FilePath &dir); private: virtual FileContainerProvider fileContainerProvider() const = 0; diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index 89a4c0763b0..29c769d2d3b 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -147,7 +147,8 @@ QWidget *FindInFiles::createConfigWidget() m_directory->setExpectedKind(PathChooser::ExistingDirectory); m_directory->setPromptDialogTitle(Tr::tr("Directory to Search")); connect(m_directory.data(), &PathChooser::textChanged, this, - [this] { pathChanged(m_directory->filePath()); }); + [this] { setSearchDir(m_directory->filePath()); }); + connect(this, &BaseFileFind::searchDirChanged, m_directory, &PathChooser::setFilePath); m_directory->setHistoryCompleter(QLatin1String(HistoryKey), /*restoreLastItemFromHistory=*/ true); if (!HistoryCompleter::historyExistsFor(QLatin1String(HistoryKey))) { @@ -181,11 +182,6 @@ QWidget *FindInFiles::createConfigWidget() return m_configWidget; } -FilePath FindInFiles::searchDir() const -{ - return m_directory->filePath(); -} - void FindInFiles::writeSettings(QSettings *settings) { settings->beginGroup(QLatin1String("FindInFiles")); @@ -200,27 +196,17 @@ void FindInFiles::readSettings(QSettings *settings) settings->endGroup(); } -void FindInFiles::setDirectory(const FilePath &directory) -{ - m_directory->setFilePath(directory); -} - void FindInFiles::setBaseDirectory(const FilePath &directory) { m_directory->setBaseDirectory(directory); } -FilePath FindInFiles::directory() const -{ - return m_directory->filePath(); -} - void FindInFiles::findOnFileSystem(const QString &path) { QTC_ASSERT(m_instance, return); const QFileInfo fi(path); const QString folder = fi.isDir() ? fi.absoluteFilePath() : fi.absolutePath(); - m_instance->setDirectory(FilePath::fromString(folder)); + m_instance->setSearchDir(FilePath::fromString(folder)); Find::openFindDialog(m_instance); } diff --git a/src/plugins/texteditor/findinfiles.h b/src/plugins/texteditor/findinfiles.h index d874e110383..5a1a2258a23 100644 --- a/src/plugins/texteditor/findinfiles.h +++ b/src/plugins/texteditor/findinfiles.h @@ -36,15 +36,10 @@ public: void setDirectory(const Utils::FilePath &directory); void setBaseDirectory(const Utils::FilePath &directory); - Utils::FilePath directory() const; static void findOnFileSystem(const QString &path); static FindInFiles *instance(); -signals: - void pathChanged(const Utils::FilePath &directory); - protected: - Utils::FilePath searchDir() const override; QString label() const override; QString toolTip() const override; void syncSearchEngineCombo(int selectedSearchEngineIndex) override; From b3df9a4fcf4cb13ef9125a7286ea1d96b445cf00 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 5 Jul 2023 09:30:51 +0200 Subject: [PATCH 0179/1777] Python: Centralize interpreter specific function in the aspect ... and expose that instead of the PythonRunConfiguration. This makes the PythonRunConfiguration more the container of aspects, similar to where the other runconfigs move. Change-Id: Ibc76b706f2d4d334640ea8f3b91343f9e7c0f566 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/python/pythonlanguageclient.cpp | 5 +- src/plugins/python/pythonrunconfiguration.cpp | 79 +++++++++++-------- src/plugins/python/pythonrunconfiguration.h | 12 ++- 3 files changed, 59 insertions(+), 37 deletions(-) diff --git a/src/plugins/python/pythonlanguageclient.cpp b/src/plugins/python/pythonlanguageclient.cpp index eecfb35c97f..1006eea3e82 100644 --- a/src/plugins/python/pythonlanguageclient.cpp +++ b/src/plugins/python/pythonlanguageclient.cpp @@ -207,8 +207,9 @@ void PyLSClient::openDocument(TextEditor::TextDocument *document) const FilePath documentPath = document->filePath(); if (PythonProject *project = pythonProjectForFile(documentPath)) { if (Target *target = project->activeTarget()) { - if (auto rc = qobject_cast<PythonRunConfiguration *>(target->activeRunConfiguration())) - updateExtraCompilers(project, rc->extraCompilers()); + if (RunConfiguration *rc = target->activeRunConfiguration()) + if (auto aspect = rc->aspect<PythonInterpreterAspect>()) + updateExtraCompilers(project, aspect->extraCompilers()); } } else if (isSupportedDocument(document)) { const FilePath workspacePath = documentPath.parentDir(); diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 04210a8b751..43a182900e5 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -119,28 +119,25 @@ private: //////////////////////////////////////////////////////////////// -class PythonInterpreterAspect final : public InterpreterAspect +class PythonInterpreterAspectPrivate : public QObject { public: - PythonInterpreterAspect(PythonRunConfiguration *rc) - : q(rc) + PythonInterpreterAspectPrivate(PythonInterpreterAspect *parent, PythonRunConfiguration *rc) + : q(parent), rc(rc) { - connect(this, &InterpreterAspect::changed, - this, &PythonInterpreterAspect::currentInterpreterChanged); + connect(q, &InterpreterAspect::changed, + this, &PythonInterpreterAspectPrivate::currentInterpreterChanged); currentInterpreterChanged(); connect(PySideInstaller::instance(), &PySideInstaller::pySideInstalled, this, [this](const FilePath &python) { - if (python == currentInterpreter().command) + if (python == q->currentInterpreter().command) checkForPySide(python); } ); } - ~PythonInterpreterAspect() - { - qDeleteAll(m_extraCompilers); - } + ~PythonInterpreterAspectPrivate() { qDeleteAll(m_extraCompilers); } void checkForPySide(const FilePath &python); void checkForPySide(const FilePath &python, const QString &pySidePackageName); @@ -152,12 +149,28 @@ public: FilePath m_pySideUicPath; - PythonRunConfiguration *q; + PythonInterpreterAspect *q; + PythonRunConfiguration *rc; QList<PySideUicExtraCompiler *> m_extraCompilers; QFutureWatcher<PipPackageInfo> m_watcher; QMetaObject::Connection m_watcherConnection; }; +PythonInterpreterAspect::PythonInterpreterAspect(PythonRunConfiguration *rc) + : d(new PythonInterpreterAspectPrivate(this, rc)) +{} + +PythonInterpreterAspect::~PythonInterpreterAspect() +{ + delete d; +} + +class PythonRunConfiguration : public ProjectExplorer::RunConfiguration +{ +public: + PythonRunConfiguration(ProjectExplorer::Target *target, Utils::Id id); +}; + PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { @@ -232,18 +245,18 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) }); connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); - connect(target, &Target::buildSystemUpdated, this, [this, interpreterAspect] { interpreterAspect->updateExtraCompilers(); }); + connect(target, &Target::buildSystemUpdated, this, [this, interpreterAspect] { + interpreterAspect->d->updateExtraCompilers(); + }); } -PythonRunConfiguration::~PythonRunConfiguration() = default; - -void PythonInterpreterAspect::checkForPySide(const FilePath &python) +void PythonInterpreterAspectPrivate::checkForPySide(const FilePath &python) { checkForPySide(python, "PySide6-Essentials"); } -void PythonInterpreterAspect::checkForPySide(const FilePath &python, - const QString &pySidePackageName) +void PythonInterpreterAspectPrivate::checkForPySide(const FilePath &python, + const QString &pySidePackageName) { const PipPackage package(pySidePackageName); QObject::disconnect(m_watcherConnection); @@ -255,9 +268,9 @@ void PythonInterpreterAspect::checkForPySide(const FilePath &python, ExtensionSystem::PluginManager::futureSynchronizer()->addFuture(future); } -void PythonInterpreterAspect::handlePySidePackageInfo(const PipPackageInfo &pySideInfo, - const Utils::FilePath &python, - const QString &requestedPackageName) +void PythonInterpreterAspectPrivate::handlePySidePackageInfo(const PipPackageInfo &pySideInfo, + const FilePath &python, + const QString &requestedPackageName) { struct PythonTools { @@ -266,7 +279,7 @@ void PythonInterpreterAspect::handlePySidePackageInfo(const PipPackageInfo &pySi }; BuildStepList *buildSteps = nullptr; - if (Target *target = q->target()) { + if (Target *target = rc->target()) { if (auto buildConfiguration = target->activeBuildConfiguration()) buildSteps = buildConfiguration->buildSteps(); } @@ -311,12 +324,12 @@ void PythonInterpreterAspect::handlePySidePackageInfo(const PipPackageInfo &pySi pySideBuildStep->updatePySideProjectPath(pythonTools.pySideProjectPath); } -void PythonInterpreterAspect::currentInterpreterChanged() +void PythonInterpreterAspectPrivate::currentInterpreterChanged() { - const FilePath python = currentInterpreter().command; + const FilePath python = q->currentInterpreter().command; checkForPySide(python); - for (FilePath &file : q->project()->files(Project::AllFiles)) { + for (FilePath &file : rc->project()->files(Project::AllFiles)) { if (auto document = TextEditor::TextDocument::textDocumentForFilePath(file)) { if (document->mimeType() == Constants::C_PY_MIMETYPE || document->mimeType() == Constants::C_PY3_MIMETYPE) { @@ -327,12 +340,12 @@ void PythonInterpreterAspect::currentInterpreterChanged() } } -QList<PySideUicExtraCompiler *> PythonRunConfiguration::extraCompilers() const +QList<PySideUicExtraCompiler *> PythonInterpreterAspect::extraCompilers() const { - return static_cast<PythonInterpreterAspect *>(aspect<InterpreterAspect>())->m_extraCompilers; + return d->m_extraCompilers; } -void PythonInterpreterAspect::updateExtraCompilers() +void PythonInterpreterAspectPrivate::updateExtraCompilers() { QList<PySideUicExtraCompiler *> oldCompilers = m_extraCompilers; m_extraCompilers.clear(); @@ -343,21 +356,21 @@ void PythonInterpreterAspect::updateExtraCompilers() return fileNode->fileType() == ProjectExplorer::FileType::Form; return false; }; - const FilePaths uiFiles = q->project()->files(uiMatcher); + const FilePaths uiFiles = rc->project()->files(uiMatcher); for (const FilePath &uiFile : uiFiles) { FilePath generated = uiFile.parentDir(); generated = generated.pathAppended("/ui_" + uiFile.baseName() + ".py"); int index = Utils::indexOf(oldCompilers, [&](PySideUicExtraCompiler *oldCompiler) { return oldCompiler->pySideUicPath() == m_pySideUicPath - && oldCompiler->project() == q->project() && oldCompiler->source() == uiFile + && oldCompiler->project() == rc->project() && oldCompiler->source() == uiFile && oldCompiler->targets() == FilePaths{generated}; }); if (index < 0) { m_extraCompilers << new PySideUicExtraCompiler(m_pySideUicPath, - q->project(), + rc->project(), uiFile, {generated}, - q); + this); } else { m_extraCompilers << oldCompilers.takeAt(index); } @@ -365,11 +378,13 @@ void PythonInterpreterAspect::updateExtraCompilers() } for (LanguageClient::Client *client : LanguageClient::LanguageClientManager::clients()) { if (auto pylsClient = qobject_cast<PyLSClient *>(client)) - pylsClient->updateExtraCompilers(q->project(), m_extraCompilers); + pylsClient->updateExtraCompilers(rc->project(), m_extraCompilers); } qDeleteAll(oldCompilers); } +// Factories + PythonRunConfigurationFactory::PythonRunConfigurationFactory() { registerRunConfiguration<PythonRunConfiguration>(Constants::C_PYTHONRUNCONFIGURATION_ID); diff --git a/src/plugins/python/pythonrunconfiguration.h b/src/plugins/python/pythonrunconfiguration.h index 81b6a851ce9..54c912f6879 100644 --- a/src/plugins/python/pythonrunconfiguration.h +++ b/src/plugins/python/pythonrunconfiguration.h @@ -4,21 +4,27 @@ #pragma once #include <projectexplorer/runconfiguration.h> +#include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/runcontrol.h> namespace Python::Internal { class PySideUicExtraCompiler; +class PythonRunConfiguration; -class PythonRunConfiguration : public ProjectExplorer::RunConfiguration +class PythonInterpreterAspect final : public ProjectExplorer::InterpreterAspect { Q_OBJECT public: - PythonRunConfiguration(ProjectExplorer::Target *target, Utils::Id id); - ~PythonRunConfiguration() override; + explicit PythonInterpreterAspect(PythonRunConfiguration *rc); + ~PythonInterpreterAspect() final; QList<PySideUicExtraCompiler *> extraCompilers() const; + +private: + friend class PythonRunConfiguration; + class PythonInterpreterAspectPrivate *d = nullptr; }; class PythonRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory From 5bd2cd01150ec78800bf0195e1709da31303218f Mon Sep 17 00:00:00 2001 From: Orgad Shaneh <orgad.shaneh@audiocodes.com> Date: Fri, 9 Jun 2023 19:02:42 +0300 Subject: [PATCH 0180/1777] Git: Fix crash when fetch is done while context menu is active Blind shot. Task-number: QTCREATORBUG-29266 Change-Id: Ie9e8be9e6ead7a3c49cdde7c3b80b4735f7b19af Reviewed-by: hjk <hjk@qt.io> --- src/plugins/git/branchview.cpp | 16 +++++++++++----- src/plugins/git/branchview.h | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/plugins/git/branchview.cpp b/src/plugins/git/branchview.cpp index c3daf9d5a88..857d3996a61 100644 --- a/src/plugins/git/branchview.cpp +++ b/src/plugins/git/branchview.cpp @@ -132,12 +132,15 @@ BranchView::BranchView() m_branchView->selectionModel()->clear(); m_repository = GitPlugin::currentState().topLevel(); - refreshCurrentRepository(); } void BranchView::refreshIfSame(const FilePath &repository) { - if (m_repository == repository) + if (m_repository != repository) + return; + if (m_blockRefresh) + m_postponedRefresh = true; + else refreshCurrentRepository(); } @@ -228,6 +231,7 @@ void BranchView::slotCustomContextMenu(const QPoint &point) std::unique_ptr<TaskTree> taskTree; QAction *mergeAction = nullptr; + SetInContext block(m_blockRefresh); QMenu contextMenu; contextMenu.addAction(Tr::tr("&Add..."), this, &BranchView::add); const std::optional<QString> remote = m_model->remoteName(index); @@ -256,10 +260,8 @@ void BranchView::slotCustomContextMenu(const QPoint &point) contextMenu.addSeparator(); contextMenu.addAction(Tr::tr("&Diff"), this, [this] { const QString fullName = m_model->fullName(selectedIndex(), true); - if (!fullName.isEmpty()) { - SetInContext block(m_blockRefresh); + if (!fullName.isEmpty()) GitClient::instance()->diffBranch(m_repository, fullName); - } }); contextMenu.addAction(Tr::tr("&Log"), this, [this] { log(selectedIndex()); }); contextMenu.addAction(Tr::tr("Reflo&g"), this, [this] { reflog(selectedIndex()); }); @@ -303,6 +305,10 @@ void BranchView::slotCustomContextMenu(const QPoint &point) } } contextMenu.exec(m_branchView->viewport()->mapToGlobal(point)); + if (m_postponedRefresh) { + refreshCurrentRepository(); + m_postponedRefresh = false; + } } void BranchView::expandAndResize() diff --git a/src/plugins/git/branchview.h b/src/plugins/git/branchview.h index d272a5e2194..5c16af16d5b 100644 --- a/src/plugins/git/branchview.h +++ b/src/plugins/git/branchview.h @@ -75,6 +75,7 @@ private: BranchFilterModel *m_filterModel = nullptr; Utils::FilePath m_repository; bool m_blockRefresh = false; + bool m_postponedRefresh = false; }; class BranchViewFactory : public Core::INavigationWidgetFactory From 78630dac07fcd7ace6de7b9f3facdf6fab808f22 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 6 Jul 2023 09:19:47 +0200 Subject: [PATCH 0181/1777] Editor: simplify RefactoringChanges::openEditor Change-Id: Ia095ab3d24f8f5822954976db5353c925f0b4256 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/texteditor/refactoringchanges.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp index c432e224302..1398d55bcaa 100644 --- a/src/plugins/texteditor/refactoringchanges.cpp +++ b/src/plugins/texteditor/refactoringchanges.cpp @@ -113,10 +113,7 @@ TextEditorWidget *RefactoringChanges::openEditor(const FilePath &filePath, } IEditor *editor = EditorManager::openEditorAt(Link{filePath, line, column}, Id(), flags); - if (editor) - return TextEditorWidget::fromEditor(editor); - else - return nullptr; + return TextEditorWidget::fromEditor(editor); } RefactoringFilePtr RefactoringChanges::file(TextEditorWidget *editor) From 2a617362640600bfc4bda53c67b07639dfe3fd3f Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 6 Jul 2023 09:33:53 +0200 Subject: [PATCH 0182/1777] Utils: make select at column 0-based Change-Id: I514611cbd887eec6e46c80e5a2964c04ad05fdf2 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/textutils.cpp | 6 +++--- src/libs/utils/textutils.h | 1 + src/plugins/cppeditor/cppeditorwidget.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/textutils.cpp b/src/libs/utils/textutils.cpp index bd750d14466..e486ca1b2b9 100644 --- a/src/libs/utils/textutils.cpp +++ b/src/libs/utils/textutils.cpp @@ -139,10 +139,10 @@ QTextCursor selectAt(QTextCursor textCursor, int line, int column, uint length) if (line < 1) line = 1; - if (column < 1) - column = 1; + if (column < 0) + column = 0; - const int anchorPosition = positionInText(textCursor.document(), line, column); + const int anchorPosition = positionInText(textCursor.document(), line, column + 1); textCursor.setPosition(anchorPosition); textCursor.setPosition(anchorPosition + int(length), QTextCursor::KeepAnchor); diff --git a/src/libs/utils/textutils.h b/src/libs/utils/textutils.h index 36bd042e444..3394e45054b 100644 --- a/src/libs/utils/textutils.h +++ b/src/libs/utils/textutils.h @@ -59,6 +59,7 @@ QTCREATOR_UTILS_EXPORT int positionInText(const QTextDocument *textDocument, int QTCREATOR_UTILS_EXPORT QString textAt(QTextCursor tc, int pos, int length); +// line is 1-based, column is 0-based QTCREATOR_UTILS_EXPORT QTextCursor selectAt(QTextCursor textCursor, int line, int column, uint length); QTCREATOR_UTILS_EXPORT QTextCursor flippedCursor(const QTextCursor &cursor); diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index a6daf681db5..e8bf8750110 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -816,7 +816,7 @@ QList<QTextEdit::ExtraSelection> sourceLocationsToExtraSelections( selection.cursor = selectAt(cppEditorWidget->textCursor(), sourceLocation.targetLine, - sourceLocation.targetColumn + 1, + sourceLocation.targetColumn, selectionLength); selection.format = textCharFormat; From d18768b53a82ed78496fe2e1d39fd82d863705c6 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 20 Jun 2023 15:00:35 +0200 Subject: [PATCH 0183/1777] CMakeProjectManager: Use more FilePath Change-Id: Ifa3e754c224cd6ec315d49cd825aa78ac59b5ad9 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 60c3855a63b..67ceb0002a4 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -772,17 +772,20 @@ void CMakeBuildStep::updateDeploymentData() DeploymentData deploymentData; deploymentData.setLocalInstallRoot(rootDir); - const int startPos = rootDir.path().length(); + IDeviceConstPtr device = BuildDeviceKitAspect::device(buildSystem()->kit()); const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(), [](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); }); - auto handleFile = [&appFileNames, startPos, &deploymentData](const FilePath &filePath) { + auto handleFile = [&appFileNames, rootDir, &deploymentData, device](const FilePath &filePath) { const DeployableFile::Type type = appFileNames.contains(filePath.fileName()) ? DeployableFile::TypeExecutable : DeployableFile::TypeNormal; - const QString targetDir = filePath.parentDir().path().mid(startPos); - deploymentData.addFile(filePath, targetDir, type); + + FilePath targetDirPath = filePath.parentDir().relativePathFrom(rootDir); + + const FilePath targetDir = device->rootPath().pathAppended(targetDirPath.path()); + deploymentData.addFile(filePath, targetDir.nativePath(), type); return IterationPolicy::Continue; }; From a98e6f63b7416a84f5beb8a2a83dbef72f6c222d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 18:00:40 +0200 Subject: [PATCH 0184/1777] BareMetal: Adapt DebugServerProvidersSettingsPage to latest changes Task-number: QTCREATORBUG-29167 Change-Id: I14c7330b3ede0fc550291412791cb69fedefe62c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/baremetal/baremetalplugin.cpp | 2 -- .../debugserverproviderssettingspage.cpp | 21 ++++++++++++------- .../debugserverproviderssettingspage.h | 20 ------------------ 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/src/plugins/baremetal/baremetalplugin.cpp b/src/plugins/baremetal/baremetalplugin.cpp index f97bf1b40c6..b8383c65b9d 100644 --- a/src/plugins/baremetal/baremetalplugin.cpp +++ b/src/plugins/baremetal/baremetalplugin.cpp @@ -11,7 +11,6 @@ #include "baremetaltr.h" #include "debugserverprovidermanager.h" -#include "debugserverproviderssettingspage.h" #include "iarewtoolchain.h" #include "keiltoolchain.h" @@ -53,7 +52,6 @@ public: BareMetalDeviceFactory deviceFactory; BareMetalRunConfigurationFactory runConfigurationFactory; BareMetalCustomRunConfigurationFactory customRunConfigurationFactory; - DebugServerProvidersSettingsPage debugServerProviderSettinsPage; DebugServerProviderManager debugServerProviderManager; BareMetalDeployConfigurationFactory deployConfigurationFactory; BareMetalDebugSupportFactory runWorkerFactory; diff --git a/src/plugins/baremetal/debugserverproviderssettingspage.cpp b/src/plugins/baremetal/debugserverproviderssettingspage.cpp index 58af3578a96..9fa9db95418 100644 --- a/src/plugins/baremetal/debugserverproviderssettingspage.cpp +++ b/src/plugins/baremetal/debugserverproviderssettingspage.cpp @@ -8,8 +8,9 @@ #include "debugserverprovidermanager.h" #include "idebugserverprovider.h" +#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icore.h> -#include <extensionsystem/pluginmanager.h> + #include <projectexplorer/projectexplorerconstants.h> #include <utils/algorithm.h> @@ -427,12 +428,18 @@ QModelIndex DebugServerProvidersSettingsWidget::currentIndex() const // DebugServerProvidersSettingsPage -DebugServerProvidersSettingsPage::DebugServerProvidersSettingsPage() +class DebugServerProvidersSettingsPage final : public Core::IOptionsPage { - setId(Constants::DEBUG_SERVER_PROVIDERS_SETTINGS_ID); - setDisplayName(Tr::tr("Bare Metal")); - setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY); - setWidgetCreator([] { return new DebugServerProvidersSettingsWidget; }); -} +public: + DebugServerProvidersSettingsPage() + { + setId(Constants::DEBUG_SERVER_PROVIDERS_SETTINGS_ID); + setDisplayName(Tr::tr("Bare Metal")); + setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY); + setWidgetCreator([] { return new DebugServerProvidersSettingsWidget; }); + } +}; + +static const DebugServerProvidersSettingsPage settingsPage; } // BareMetal::Internal diff --git a/src/plugins/baremetal/debugserverproviderssettingspage.h b/src/plugins/baremetal/debugserverproviderssettingspage.h index 11ffd18383a..80586d727b5 100644 --- a/src/plugins/baremetal/debugserverproviderssettingspage.h +++ b/src/plugins/baremetal/debugserverproviderssettingspage.h @@ -3,25 +3,13 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> - #include <utils/treemodel.h> -QT_BEGIN_NAMESPACE -class QItemSelectionModel; -class QPushButton; -class QTreeView; -QT_END_NAMESPACE - -namespace Utils { class DetailsWidget; } - namespace BareMetal::Internal { class DebugServerProviderNode; -class DebugServerProvidersSettingsWidget; class IDebugServerProvider; class IDebugServerProviderConfigWidget; -class IDebugServerProviderFactory; // DebugServerProviderModel @@ -57,12 +45,4 @@ private: QList<IDebugServerProvider *> m_providersToRemove; }; -// DebugServerProvidersSettingsPage - -class DebugServerProvidersSettingsPage final : public Core::IOptionsPage -{ -public: - DebugServerProvidersSettingsPage(); -}; - } // BareMetal::Internal From 382e003debfb8b2430ce09285e931ae66768c7d5 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 5 Jul 2023 17:15:09 +0200 Subject: [PATCH 0185/1777] BareMetal: Use aspects more directly in run configurations Task-number: QTCREATORBUG-29168 Change-Id: I28c90ab76a34e652f6cc8d56aa326b7ee8634cb2 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../baremetal/baremetalrunconfiguration.cpp | 63 ++++++++++--------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/src/plugins/baremetal/baremetalrunconfiguration.cpp b/src/plugins/baremetal/baremetalrunconfiguration.cpp index 8d3f042a713..8b805732974 100644 --- a/src/plugins/baremetal/baremetalrunconfiguration.cpp +++ b/src/plugins/baremetal/baremetalrunconfiguration.cpp @@ -25,23 +25,24 @@ public: explicit BareMetalRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - const auto exeAspect = addAspect<ExecutableAspect>(); - exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); - exeAspect->setPlaceHolderText(Tr::tr("Unknown")); + executable.setDeviceSelector(target, ExecutableAspect::RunDevice); + executable.setPlaceHolderText(Tr::tr("Unknown")); - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); + arguments.setMacroExpander(macroExpander()); - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); + workingDir.setMacroExpander(macroExpander()); - setUpdater([this, exeAspect] { + setUpdater([this] { const BuildTargetInfo bti = buildTargetInfo(); - exeAspect->setExecutable(bti.targetFilePath); + executable.setExecutable(bti.targetFilePath); }); connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); } + + ExecutableAspect executable{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; }; class BareMetalCustomRunConfiguration final : public RunConfiguration @@ -50,37 +51,37 @@ public: explicit BareMetalCustomRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - const auto exeAspect = addAspect<ExecutableAspect>(); - exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); - exeAspect->setSettingsKey("BareMetal.CustomRunConfig.Executable"); - exeAspect->setPlaceHolderText(Tr::tr("Unknown")); - exeAspect->setReadOnly(false); - exeAspect->setHistoryCompleter("BareMetal.CustomRunConfig.History"); - exeAspect->setExpectedKind(PathChooser::Any); + executable.setDeviceSelector(target, ExecutableAspect::RunDevice); + executable.setSettingsKey("BareMetal.CustomRunConfig.Executable"); + executable.setPlaceHolderText(Tr::tr("Unknown")); + executable.setReadOnly(false); + executable.setHistoryCompleter("BareMetal.CustomRunConfig.History"); + executable.setExpectedKind(PathChooser::Any); - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); + arguments.setMacroExpander(macroExpander()); - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); + workingDir.setMacroExpander(macroExpander()); setDefaultDisplayName(RunConfigurationFactory::decoratedTargetName( - Tr::tr("Custom Executable"), target)); + Tr::tr("Custom Executable"), target)); } public: - Tasks checkForIssues() const final; + Tasks checkForIssues() const final + { + Tasks tasks; + if (executable.executable().isEmpty()) { + tasks << createConfigurationIssue(Tr::tr("The remote executable must be set in order to " + "run a custom remote run configuration.")); + } + return tasks; + } + + ExecutableAspect executable{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; }; -Tasks BareMetalCustomRunConfiguration::checkForIssues() const -{ - Tasks tasks; - if (aspect<ExecutableAspect>()->executable().isEmpty()) { - tasks << createConfigurationIssue(Tr::tr("The remote executable must be set in order to " - "run a custom remote run configuration.")); - } - return tasks; -} // BareMetalRunConfigurationFactory From e75b81b0a898062e61c2231508cca06568d57665 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 15:21:38 +0200 Subject: [PATCH 0186/1777] QtSupport: Use current aspect ctor pattern for Qml related aspect Task-number: QTCREATORBUG-29168 Change-Id: I3779ed4075dc98ccafc2490009d1217e908ad83c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../cmakebuildconfiguration.cpp | 4 +++- .../qbsbuildconfiguration.cpp | 6 ++++-- .../qmakebuildconfiguration.cpp | 6 ++++-- src/plugins/qtsupport/qtbuildaspects.cpp | 18 ++++++++++++++---- src/plugins/qtsupport/qtbuildaspects.h | 10 +++++++--- 5 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 4b11176e73a..93cb3f88cd0 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1439,7 +1439,9 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) addAspect<SourceDirectoryAspect>(); addAspect<BuildTypeAspect>(); - addAspect<QtSupport::QmlDebuggingAspect>(this); + + auto qmlDebuggingAspect = addAspect<QtSupport::QmlDebuggingAspect>(); + qmlDebuggingAspect->setBuildConfiguration(this); addAspect<ConfigureEnvironmentAspect>(this); diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index 41ae75d8b9b..52dd6fb9933 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -118,11 +118,13 @@ QbsBuildConfiguration::QbsBuildConfiguration(Target *target, Utils::Id id) connect(separateDebugInfoAspect, &SeparateDebugInfoAspect::changed, this, &QbsBuildConfiguration::qbsConfigurationChanged); - const auto qmlDebuggingAspect = addAspect<QtSupport::QmlDebuggingAspect>(this); + const auto qmlDebuggingAspect = addAspect<QtSupport::QmlDebuggingAspect>(); + qmlDebuggingAspect->setBuildConfiguration(this); connect(qmlDebuggingAspect, &QtSupport::QmlDebuggingAspect::changed, this, &QbsBuildConfiguration::qbsConfigurationChanged); - const auto qtQuickCompilerAspect = addAspect<QtSupport::QtQuickCompilerAspect>(this); + const auto qtQuickCompilerAspect = addAspect<QtSupport::QtQuickCompilerAspect>(); + qtQuickCompilerAspect->setBuildConfiguration(this); connect(qtQuickCompilerAspect, &QtSupport::QtQuickCompilerAspect::changed, this, &QbsBuildConfiguration::qbsConfigurationChanged); diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index c494f5544a6..f4a56b6b170 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -173,14 +173,16 @@ QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Id id) qmakeBuildSystem()->scheduleUpdateAllNowOrLater(); }); - const auto qmlDebuggingAspect = addAspect<QmlDebuggingAspect>(this); + const auto qmlDebuggingAspect = addAspect<QmlDebuggingAspect>(); + qmlDebuggingAspect->setBuildConfiguration(this); connect(qmlDebuggingAspect, &QmlDebuggingAspect::changed, this, [this] { emit qmlDebuggingChanged(); emit qmakeBuildConfigurationChanged(); qmakeBuildSystem()->scheduleUpdateAllNowOrLater(); }); - const auto qtQuickCompilerAspect = addAspect<QtQuickCompilerAspect>(this); + const auto qtQuickCompilerAspect = addAspect<QtQuickCompilerAspect>(); + qtQuickCompilerAspect->setBuildConfiguration(this); connect(qtQuickCompilerAspect, &QtQuickCompilerAspect::changed, this, [this] { emit useQtQuickCompilerChanged(); emit qmakeBuildConfigurationChanged(); diff --git a/src/plugins/qtsupport/qtbuildaspects.cpp b/src/plugins/qtsupport/qtbuildaspects.cpp index 210ea58ee5a..55f47d8ac50 100644 --- a/src/plugins/qtsupport/qtbuildaspects.cpp +++ b/src/plugins/qtsupport/qtbuildaspects.cpp @@ -22,8 +22,8 @@ using namespace Utils; namespace QtSupport { -QmlDebuggingAspect::QmlDebuggingAspect(BuildConfiguration *buildConfig) - : m_buildConfig(buildConfig) +QmlDebuggingAspect::QmlDebuggingAspect(AspectContainer *container) + : TriStateAspect(container) { setSettingsKey("EnableQmlDebugging"); setDisplayName(Tr::tr("QML debugging and profiling:")); @@ -59,14 +59,24 @@ void QmlDebuggingAspect::addToLayout(Layouting::LayoutItem &parent) changeHandler(); } -QtQuickCompilerAspect::QtQuickCompilerAspect(BuildConfiguration *buildConfig) - : m_buildConfig(buildConfig) +void QmlDebuggingAspect::setBuildConfiguration(const BuildConfiguration *buildConfig) +{ + m_buildConfig = buildConfig; +} + +QtQuickCompilerAspect::QtQuickCompilerAspect(AspectContainer *container) + : TriStateAspect(container) { setSettingsKey("QtQuickCompiler"); setDisplayName(Tr::tr("Qt Quick Compiler:")); setValue(ProjectExplorerPlugin::buildPropertiesSettings().qtQuickCompiler.value()); } +void QtQuickCompilerAspect::setBuildConfiguration(const BuildConfiguration *buildConfig) +{ + m_buildConfig = buildConfig; +} + void QtQuickCompilerAspect::addToLayout(Layouting::LayoutItem &parent) { SelectionAspect::addToLayout(parent); diff --git a/src/plugins/qtsupport/qtbuildaspects.h b/src/plugins/qtsupport/qtbuildaspects.h index e5e0b3332e6..873daf000d2 100644 --- a/src/plugins/qtsupport/qtbuildaspects.h +++ b/src/plugins/qtsupport/qtbuildaspects.h @@ -16,11 +16,13 @@ class QTSUPPORT_EXPORT QmlDebuggingAspect : public Utils::TriStateAspect Q_OBJECT public: - explicit QmlDebuggingAspect(ProjectExplorer::BuildConfiguration *buildConfig); + explicit QmlDebuggingAspect(Utils::AspectContainer *container = nullptr); - void addToLayout(Layouting::LayoutItem &parent) override; + void setBuildConfiguration(const ProjectExplorer::BuildConfiguration *newBuildConfig); private: + void addToLayout(Layouting::LayoutItem &parent) override; + const ProjectExplorer::BuildConfiguration *m_buildConfig = nullptr; }; @@ -29,7 +31,9 @@ class QTSUPPORT_EXPORT QtQuickCompilerAspect : public Utils::TriStateAspect Q_OBJECT public: - QtQuickCompilerAspect(ProjectExplorer::BuildConfiguration *buildConfig); + QtQuickCompilerAspect(Utils::AspectContainer *container = nullptr); + + void setBuildConfiguration(const ProjectExplorer::BuildConfiguration *newBuildConfig); private: void addToLayout(Layouting::LayoutItem &parent) override; From 5bf78e9955b8f2766713b977ef315e4a0a9c567b Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 6 Jul 2023 09:40:13 +0200 Subject: [PATCH 0187/1777] Utils: simplify Text::textAt Change-Id: Ibada4af8b7bf76bb61fa45b00ac37bb8ed8a56b2 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/textutils.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/textutils.cpp b/src/libs/utils/textutils.cpp index e486ca1b2b9..252152415f8 100644 --- a/src/libs/utils/textutils.cpp +++ b/src/libs/utils/textutils.cpp @@ -124,11 +124,10 @@ QString textAt(QTextCursor tc, int pos, int length) if (pos < 0) pos = 0; tc.movePosition(QTextCursor::End); - if (pos + length > tc.position()) - length = tc.position() - pos; + const int end = std::min(pos + length, tc.position()); tc.setPosition(pos); - tc.setPosition(pos + length, QTextCursor::KeepAnchor); + tc.setPosition(end, QTextCursor::KeepAnchor); // selectedText() returns U+2029 (PARAGRAPH SEPARATOR) instead of newline return tc.selectedText().replace(QChar::ParagraphSeparator, QLatin1Char('\n')); From 714b5963f79570b5dc10eb62aeb65bc8bb7bb4b4 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 29 Jun 2023 12:41:10 +0200 Subject: [PATCH 0188/1777] BaseFileFind: Some cleanup, also in derived classes Change-Id: I1fb3d3937543f9c4fd8ca723410494cfc76322ee Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/git/gitgrep.cpp | 2 +- .../projectexplorer/allprojectsfind.cpp | 3 --- .../projectexplorer/currentprojectfind.cpp | 4 +--- .../filesinallprojectsfind.cpp | 1 - src/plugins/texteditor/basefilefind.cpp | 24 ++++++++----------- src/plugins/texteditor/findincurrentfile.cpp | 4 ---- src/plugins/texteditor/findinfiles.cpp | 9 +------ src/plugins/texteditor/findinfiles.h | 3 --- src/plugins/texteditor/findinopenfiles.cpp | 3 --- 9 files changed, 13 insertions(+), 40 deletions(-) diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index 890d9fe99c0..4e581b965ff 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -266,7 +266,7 @@ SearchExecutor GitGrep::searchExecutor() const EditorOpener GitGrep::editorOpener() const { - return [params = gitParameters()](const Utils::SearchResultItem &item, + return [params = gitParameters()](const SearchResultItem &item, const FileFindParameters ¶meters) -> IEditor * { const QStringList &itemPath = item.path(); if (params.ref.isEmpty() || itemPath.isEmpty()) diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp index 0f99b2db00e..a4163193994 100644 --- a/src/plugins/projectexplorer/allprojectsfind.cpp +++ b/src/plugins/projectexplorer/allprojectsfind.cpp @@ -11,14 +11,11 @@ #include <coreplugin/editormanager/editormanager.h> -#include <texteditor/texteditor.h> #include <texteditor/textdocument.h> -#include <utils/filesearch.h> #include <utils/algorithm.h> #include <QGridLayout> -#include <QLabel> #include <QSettings> using namespace ProjectExplorer; diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index 4cece1f5b6f..43d709d7661 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -9,9 +9,7 @@ #include "projecttree.h" #include <utils/qtcassert.h> -#include <utils/filesearch.h> -#include <QDebug> #include <QSettings> using namespace ProjectExplorer; @@ -24,7 +22,7 @@ CurrentProjectFind::CurrentProjectFind() connect(ProjectTree::instance(), &ProjectTree::currentProjectChanged, this, &CurrentProjectFind::handleProjectChanged); connect(ProjectManager::instance(), &ProjectManager::projectDisplayNameChanged, - this, [this](ProjectExplorer::Project *p) { + this, [this](Project *p) { if (p == ProjectTree::currentProject()) emit displayNameChanged(); }); diff --git a/src/plugins/projectexplorer/filesinallprojectsfind.cpp b/src/plugins/projectexplorer/filesinallprojectsfind.cpp index 5b8e6eaa684..c5e8412572f 100644 --- a/src/plugins/projectexplorer/filesinallprojectsfind.cpp +++ b/src/plugins/projectexplorer/filesinallprojectsfind.cpp @@ -9,7 +9,6 @@ #include <coreplugin/editormanager/editormanager.h> #include <utils/algorithm.h> -#include <utils/filesearch.h> #include <QSettings> diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 49b506ff501..24b802857bf 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -19,22 +19,19 @@ #include <utils/algorithm.h> #include <utils/fadingindicator.h> -#include <utils/filesearch.h> #include <utils/futuresynchronizer.h> #include <utils/process.h> #include <utils/qtcassert.h> -#include <utils/stylehelper.h> -#include <QDebug> -#include <QSettings> -#include <QHash> -#include <QPair> -#include <QPromise> -#include <QStringListModel> -#include <QFutureWatcher> -#include <QPointer> #include <QComboBox> +#include <QFutureWatcher> +#include <QHash> #include <QLabel> +#include <QPair> +#include <QPointer> +#include <QPromise> +#include <QSettings> +#include <QStringListModel> using namespace Utils; using namespace Core; @@ -389,9 +386,8 @@ void BaseFileFind::doReplace(const QString &text, const SearchResultItems &items { const FilePaths files = replaceAll(text, items, preserveCase); if (!files.isEmpty()) { - Utils::FadingIndicator::showText(ICore::dialogParent(), - Tr::tr("%n occurrences replaced.", nullptr, items.size()), - Utils::FadingIndicator::SmallText); + FadingIndicator::showText(ICore::dialogParent(), + Tr::tr("%n occurrences replaced.", nullptr, items.size()), FadingIndicator::SmallText); DocumentManager::notifyFilesChangedInternally(files); SearchResultWindow::instance()->hide(); } @@ -428,7 +424,7 @@ QList<QPair<QWidget *, QWidget *>> BaseFileFind::createPatternWidgets() syncComboWithSettings(d->m_filterCombo, d->m_filterSetting); QLabel *exclusionLabel = createLabel(msgExclusionPatternLabel()); d->m_exclusionCombo = createCombo(&d->m_exclusionStrings); - d->m_exclusionCombo->setToolTip(msgFilePatternToolTip(Utils::InclusionType::Excluded)); + d->m_exclusionCombo->setToolTip(msgFilePatternToolTip(InclusionType::Excluded)); exclusionLabel->setBuddy(d->m_exclusionCombo); syncComboWithSettings(d->m_exclusionCombo, d->m_exclusionSetting); return {{filterLabel, d->m_filterCombo}, {exclusionLabel, d->m_exclusionCombo}}; diff --git a/src/plugins/texteditor/findincurrentfile.cpp b/src/plugins/texteditor/findincurrentfile.cpp index 2a61602569a..d26b3cea2b4 100644 --- a/src/plugins/texteditor/findincurrentfile.cpp +++ b/src/plugins/texteditor/findincurrentfile.cpp @@ -6,13 +6,9 @@ #include "textdocument.h" #include "texteditortr.h" -#include <coreplugin/icore.h> #include <coreplugin/editormanager/ieditor.h> #include <coreplugin/editormanager/editormanager.h> -#include <utils/filesearch.h> -#include <utils/fileutils.h> - #include <QSettings> using namespace Utils; diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index 29c769d2d3b..64b2a78fb76 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -9,20 +9,13 @@ #include <coreplugin/find/findplugin.h> #include <coreplugin/icore.h> -#include <utils/filesearch.h> -#include <utils/fileutils.h> #include <utils/historycompleter.h> #include <utils/pathchooser.h> #include <utils/qtcassert.h> -#include <utils/stringutils.h> #include <QComboBox> -#include <QDebug> -#include <QDir> -#include <QFileDialog> #include <QGridLayout> #include <QLabel> -#include <QPushButton> #include <QSettings> #include <QStackedWidget> @@ -153,7 +146,7 @@ QWidget *FindInFiles::createConfigWidget() /*restoreLastItemFromHistory=*/ true); if (!HistoryCompleter::historyExistsFor(QLatin1String(HistoryKey))) { auto completer = static_cast<HistoryCompleter *>(m_directory->lineEdit()->completer()); - const QStringList legacyHistory = Core::ICore::settings()->value( + const QStringList legacyHistory = ICore::settings()->value( QLatin1String("Find/FindInFiles/directories")).toStringList(); for (const QString &dir: legacyHistory) completer->addEntry(dir); diff --git a/src/plugins/texteditor/findinfiles.h b/src/plugins/texteditor/findinfiles.h index 5a1a2258a23..8510d99a51f 100644 --- a/src/plugins/texteditor/findinfiles.h +++ b/src/plugins/texteditor/findinfiles.h @@ -5,10 +5,7 @@ #include "basefilefind.h" -#include <utils/fileutils.h> - #include <QPointer> -#include <QStringListModel> QT_BEGIN_NAMESPACE class QComboBox; diff --git a/src/plugins/texteditor/findinopenfiles.cpp b/src/plugins/texteditor/findinopenfiles.cpp index 2f2ee8de1d4..f4449ea3fc7 100644 --- a/src/plugins/texteditor/findinopenfiles.cpp +++ b/src/plugins/texteditor/findinopenfiles.cpp @@ -6,12 +6,9 @@ #include "textdocument.h" #include "texteditortr.h" -#include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/documentmodel.h> -#include <utils/filesearch.h> - #include <QSettings> using namespace Utils; From 9f1b56e91aa34bb706bf2887d1cd06ca5d5ed376 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 6 Jul 2023 18:16:59 +0200 Subject: [PATCH 0189/1777] ProjectExplorerPlugin: Use expected_str for canRunStartupProject() Change-Id: Iddc9abcb1b9ef02c6a8188d2eb82cc30a0ba4c22 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/debugger/debuggerplugin.cpp | 19 +++-- src/plugins/perfprofiler/perfprofilertool.cpp | 9 ++- .../projectexplorer/projectexplorer.cpp | 72 +++++++------------ src/plugins/projectexplorer/projectexplorer.h | 3 +- src/plugins/qmlprofiler/qmlprofilertool.cpp | 10 +-- src/plugins/valgrind/callgrindtool.cpp | 8 +-- src/plugins/valgrind/memchecktool.cpp | 17 ++--- 7 files changed, 58 insertions(+), 80 deletions(-) diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 6156d40b34a..2390096a3fb 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1393,9 +1393,8 @@ void DebuggerPluginPrivate::updatePresetState() RunConfiguration *startupRunConfig = ProjectManager::startupRunConfiguration(); DebuggerEngine *currentEngine = EngineManager::currentEngine(); - QString whyNot; - const bool canRun = - ProjectExplorerPlugin::canRunStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE, &whyNot); + const auto canRun = ProjectExplorerPlugin::canRunStartupProject( + ProjectExplorer::Constants::DEBUG_RUN_MODE); QString startupRunConfigName; if (startupRunConfig) @@ -1404,8 +1403,8 @@ void DebuggerPluginPrivate::updatePresetState() startupRunConfigName = startupProject->displayName(); // Restrict width, otherwise Creator gets too wide, see QTCREATORBUG-21885 - const QString startToolTip = - canRun ? Tr::tr("Start debugging of startup project") : whyNot; + const QString startToolTip = canRun ? Tr::tr("Start debugging of startup project") + : canRun.error(); m_startAction.setToolTip(startToolTip); m_startAction.setText(Tr::tr("Start Debugging of Startup Project")); @@ -1413,11 +1412,11 @@ void DebuggerPluginPrivate::updatePresetState() if (!currentEngine) { // No engine running -- or -- we have a running engine but it does not // correspond to the current start up project. - m_startAction.setEnabled(canRun); + m_startAction.setEnabled(bool(canRun)); m_startAction.setIcon(startIcon(true)); m_startAction.setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_startAction.setVisible(true); - m_debugWithoutDeployAction.setEnabled(canRun); + m_debugWithoutDeployAction.setEnabled(bool(canRun)); m_visibleStartAction.setAction(&m_startAction); m_hiddenStopAction.setAction(&m_undisturbableAction); return; @@ -1431,7 +1430,7 @@ void DebuggerPluginPrivate::updatePresetState() m_startAction.setEnabled(false); m_startAction.setVisible(false); - m_debugWithoutDeployAction.setEnabled(canRun); + m_debugWithoutDeployAction.setEnabled(bool(canRun)); const DebuggerState state = currentEngine->state(); @@ -1449,8 +1448,8 @@ void DebuggerPluginPrivate::updatePresetState() m_hiddenStopAction.setAction(ActionManager::command(Constants::INTERRUPT)->action()); } else if (state == DebuggerFinished) { // We don't want to do anything anymore. - m_startAction.setEnabled(canRun); - m_debugWithoutDeployAction.setEnabled(canRun); + m_startAction.setEnabled(bool(canRun)); + m_debugWithoutDeployAction.setEnabled(bool(canRun)); m_visibleStartAction.setAction(ActionManager::command(DEBUGGER_START)->action()); m_hiddenStopAction.setAction(&m_undisturbableAction); } else if (state == InferiorUnrunnable) { diff --git a/src/plugins/perfprofiler/perfprofilertool.cpp b/src/plugins/perfprofiler/perfprofilertool.cpp index 60bbcc3ae31..d4a06a249e3 100644 --- a/src/plugins/perfprofiler/perfprofilertool.cpp +++ b/src/plugins/perfprofiler/perfprofilertool.cpp @@ -449,11 +449,10 @@ void PerfProfilerTool::updateRunActions() m_loadPerfData->setEnabled(false); m_loadTrace->setEnabled(false); } else { - QString whyNot = Tr::tr("Start a performance analysis."); - bool canRun = ProjectExplorerPlugin::canRunStartupProject( - ProjectExplorer::Constants::PERFPROFILER_RUN_MODE, &whyNot); - m_startAction->setToolTip(whyNot); - m_startAction->setEnabled(canRun); + const auto canRun = ProjectExplorerPlugin::canRunStartupProject( + ProjectExplorer::Constants::PERFPROFILER_RUN_MODE); + m_startAction->setToolTip(canRun ? Tr::tr("Start a performance analysis.") : canRun.error()); + m_startAction->setEnabled(bool(canRun)); m_loadPerfData->setEnabled(true); m_loadTrace->setEnabled(true); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index b68121ca02e..26c6ed8827d 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -3032,85 +3032,63 @@ void ProjectExplorerPluginPrivate::updateDeployActions() doUpdateRunActions(); } -bool ProjectExplorerPlugin::canRunStartupProject(Id runMode, QString *whyNot) +expected_str<void> ProjectExplorerPlugin::canRunStartupProject(Utils::Id runMode) { Project *project = ProjectManager::startupProject(); - if (!project) { - if (whyNot) - *whyNot = Tr::tr("No active project."); - return false; - } + if (!project) + return make_unexpected(Tr::tr("No active project.")); if (project->needsConfiguration()) { - if (whyNot) - *whyNot = Tr::tr("The project \"%1\" is not configured.").arg(project->displayName()); - return false; + return make_unexpected(Tr::tr("The project \"%1\" is not configured.") + .arg(project->displayName())); } Target *target = project->activeTarget(); if (!target) { - if (whyNot) - *whyNot = Tr::tr("The project \"%1\" has no active kit.").arg(project->displayName()); - return false; + return make_unexpected(Tr::tr("The project \"%1\" has no active kit.") + .arg(project->displayName())); } RunConfiguration *activeRC = target->activeRunConfiguration(); if (!activeRC) { - if (whyNot) - *whyNot = Tr::tr("The kit \"%1\" for the project \"%2\" has no active run configuration.") - .arg(target->displayName(), project->displayName()); - return false; + return make_unexpected( + Tr::tr("The kit \"%1\" for the project \"%2\" has no active run configuration.") + .arg(target->displayName(), project->displayName())); } - if (!activeRC->isEnabled()) { - if (whyNot) - *whyNot = activeRC->disabledReason(); - return false; - } + if (!activeRC->isEnabled()) + return make_unexpected(activeRC->disabledReason()); if (dd->m_projectExplorerSettings.buildBeforeDeploy != BuildBeforeRunMode::Off && dd->m_projectExplorerSettings.deployBeforeRun && !BuildManager::isBuilding(project) && hasBuildSettings(project)) { QPair<bool, QString> buildState = dd->buildSettingsEnabled(project); - if (!buildState.first) { - if (whyNot) - *whyNot = buildState.second; - return false; - } + if (!buildState.first) + return make_unexpected(buildState.second); - if (BuildManager::isBuilding()) { - if (whyNot) - *whyNot = Tr::tr("A build is still in progress."); - return false; - } + if (BuildManager::isBuilding()) + return make_unexpected(Tr::tr("A build is still in progress.")); } // shouldn't actually be shown to the user... - if (!RunControl::canRun(runMode, - DeviceTypeKitAspect::deviceTypeId(target->kit()), + if (!RunControl::canRun(runMode, DeviceTypeKitAspect::deviceTypeId(target->kit()), activeRC->id())) { - if (whyNot) - *whyNot = Tr::tr("Cannot run \"%1\".").arg(activeRC->displayName()); - return false; + return make_unexpected(Tr::tr("Cannot run \"%1\".").arg(activeRC->displayName())); } - if (dd->m_delayedRunConfiguration && dd->m_delayedRunConfiguration->project() == project) { - if (whyNot) - *whyNot = Tr::tr("A run action is already scheduled for the active project."); - return false; - } + if (dd->m_delayedRunConfiguration && dd->m_delayedRunConfiguration->project() == project) + return make_unexpected(Tr::tr("A run action is already scheduled for the active project.")); - return true; + return {}; } void ProjectExplorerPluginPrivate::doUpdateRunActions() { - QString whyNot; - const bool state = ProjectExplorerPlugin::canRunStartupProject(Constants::NORMAL_RUN_MODE, &whyNot); - m_runAction->setEnabled(state); - m_runAction->setToolTip(whyNot); - m_runWithoutDeployAction->setEnabled(state); + const auto canRun = ProjectExplorerPlugin::canRunStartupProject(Constants::NORMAL_RUN_MODE); + m_runAction->setEnabled(bool(canRun)); + m_runAction->setToolTip(canRun ? QString() : canRun.error()); + m_runWithoutDeployAction->setEnabled(bool(canRun)); emit m_instance->runActionsUpdated(); } diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index 0b87f53310b..c472094a987 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -7,6 +7,7 @@ #include <extensionsystem/iplugin.h> +#include <utils/expected.h> #include <utils/filepath.h> #include <utils/id.h> @@ -138,7 +139,7 @@ public: static void renameFilesForSymbol(const QString &oldSymbolName, const QString &newSymbolName, const Utils::FilePaths &files, bool preferLowerCaseFileNames); - static bool canRunStartupProject(Utils::Id runMode, QString *whyNot = nullptr); + static Utils::expected_str<void> canRunStartupProject(Utils::Id runMode); static void runProject(Project *pro, Utils::Id, const bool forceSkipDeploy = false); static void runStartupProject(Utils::Id runMode, bool forceSkipDeploy = false); static void runRunConfiguration(RunConfiguration *rc, Utils::Id runMode, diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index c87562e3f9b..59a740e3b5d 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -276,11 +276,11 @@ void QmlProfilerTool::updateRunActions() d->m_startAction->setToolTip(Tr::tr("A QML Profiler analysis is still in progress.")); d->m_stopAction->setEnabled(true); } else { - QString tooltip = Tr::tr("Start QML Profiler analysis."); - bool canRun = ProjectExplorerPlugin::canRunStartupProject - (ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, &tooltip); - d->m_startAction->setToolTip(tooltip); - d->m_startAction->setEnabled(canRun); + const auto canRun = ProjectExplorerPlugin::canRunStartupProject( + ProjectExplorer::Constants::QML_PROFILER_RUN_MODE); + d->m_startAction->setToolTip(canRun ? Tr::tr("Start QML Profiler analysis.") + : canRun.error()); + d->m_startAction->setEnabled(bool(canRun)); d->m_stopAction->setEnabled(false); } } diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index ab5b0e55602..d2dfc469e03 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -770,10 +770,10 @@ void CallgrindToolPrivate::updateRunActions() m_startAction->setToolTip(Tr::tr("A Valgrind Callgrind analysis is still in progress.")); m_stopAction->setEnabled(true); } else { - QString whyNot = Tr::tr("Start a Valgrind Callgrind analysis."); - bool canRun = ProjectExplorerPlugin::canRunStartupProject(CALLGRIND_RUN_MODE, &whyNot); - m_startAction->setToolTip(whyNot); - m_startAction->setEnabled(canRun); + const auto canRun = ProjectExplorerPlugin::canRunStartupProject(CALLGRIND_RUN_MODE); + m_startAction->setToolTip(canRun ? Tr::tr("Start a Valgrind Callgrind analysis.") + : canRun.error()); + m_startAction->setEnabled(bool(canRun)); m_stopAction->setEnabled(false); } } diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 5224b3c78c8..e179e8c4f55 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -888,14 +888,15 @@ void MemcheckToolPrivate::updateRunActions() m_startWithGdbAction->setToolTip(Tr::tr("A Valgrind Memcheck analysis is still in progress.")); m_stopAction->setEnabled(true); } else { - QString whyNot = Tr::tr("Start a Valgrind Memcheck analysis."); - bool canRun = ProjectExplorerPlugin::canRunStartupProject(MEMCHECK_RUN_MODE, &whyNot); - m_startAction->setToolTip(whyNot); - m_startAction->setEnabled(canRun); - whyNot = Tr::tr("Start a Valgrind Memcheck with GDB analysis."); - canRun = ProjectExplorerPlugin::canRunStartupProject(MEMCHECK_WITH_GDB_RUN_MODE, &whyNot); - m_startWithGdbAction->setToolTip(whyNot); - m_startWithGdbAction->setEnabled(canRun); + const auto canRun = ProjectExplorerPlugin::canRunStartupProject(MEMCHECK_RUN_MODE); + m_startAction->setToolTip(canRun ? Tr::tr("Start a Valgrind Memcheck analysis.") + : canRun.error()); + m_startAction->setEnabled(bool(canRun)); + const auto canRunGdb = ProjectExplorerPlugin::canRunStartupProject( + MEMCHECK_WITH_GDB_RUN_MODE); + m_startWithGdbAction->setToolTip( + canRunGdb ? Tr::tr("Start a Valgrind Memcheck with GDB analysis.") : canRunGdb.error()); + m_startWithGdbAction->setEnabled(bool(canRunGdb)); m_stopAction->setEnabled(false); } } From 91513a53ddfcd20beb219a235da9f603fafff742 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 09:57:16 +0200 Subject: [PATCH 0190/1777] Utils: Make aspect settings access implicit Generally, aspects should use fromMap/toMap, but some older pages use {from,to}Settings with always the same ICore::settings(). To make that less intrusive on the user code side, make that globally implicit. Task-number: QTCREATORBUG-29167 Change-Id: I29a8e23a31eb8061bb143e93931a07c6741eb7f9 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/app/main.cpp | 3 ++ src/libs/utils/aspects.cpp | 39 +++++++++++++------ src/libs/utils/aspects.h | 11 ++++-- src/plugins/autotest/autotestplugin.cpp | 3 +- src/plugins/autotest/testframeworkmanager.cpp | 10 ++--- src/plugins/autotest/testframeworkmanager.h | 6 +-- src/plugins/autotest/testsettings.cpp | 10 +++-- src/plugins/autotest/testsettings.h | 4 +- src/plugins/autotest/testsettingspage.cpp | 3 +- src/plugins/axivion/axivionplugin.cpp | 2 +- src/plugins/axivion/axivionsettings.cpp | 18 +++++---- src/plugins/axivion/axivionsettings.h | 5 +-- src/plugins/axivion/axivionsettingspage.cpp | 3 +- src/plugins/beautifier/abstractsettings.cpp | 7 +--- .../cmakebuildconfiguration.cpp | 2 +- .../cmakeprojectmanager/cmaketoolmanager.cpp | 2 +- src/plugins/conan/conansettings.cpp | 4 +- src/plugins/copilot/copilotoptionspage.cpp | 4 +- src/plugins/copilot/copilotplugin.cpp | 3 +- .../coreplugin/dialogs/ioptionspage.cpp | 9 +---- src/plugins/coreplugin/dialogs/ioptionspage.h | 3 -- src/plugins/cpaster/cpasterplugin.cpp | 6 +-- src/plugins/debugger/cdb/cdboptionspage.cpp | 7 ++-- src/plugins/debugger/commonoptionspage.cpp | 6 +-- src/plugins/debugger/console/console.cpp | 14 +++---- src/plugins/debugger/debuggeractions.cpp | 9 ++--- src/plugins/debugger/debuggeractions.h | 4 +- .../debuggersourcepathmappingwidget.cpp | 8 ++-- .../debugger/registerpostmortemaction.cpp | 2 +- .../debugger/registerpostmortemaction.h | 4 +- src/plugins/perforce/perforceplugin.cpp | 4 +- .../projectexplorer/projectexplorer.cpp | 4 +- .../qmakeprojectmanager/qmakesettings.cpp | 3 +- .../qmlprofiler/qmlprofilersettings.cpp | 6 +-- src/plugins/terminal/terminalpane.cpp | 2 +- src/plugins/vcpkg/vcpkgsettings.cpp | 2 +- src/plugins/vcsbase/vcsbaseclient.cpp | 2 +- 37 files changed, 111 insertions(+), 123 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index b2c10208a6f..540b5125613 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -12,6 +12,7 @@ #include <utils/algorithm.h> #include <utils/appinfo.h> +#include <utils/aspects.h> #include <utils/environment.h> #include <utils/fileutils.h> #include <utils/fsengine/fsengine.h> @@ -654,6 +655,8 @@ int main(int argc, char **argv) PluginManager::setGlobalSettings(globalSettings); PluginManager::setSettings(settings); + Utils::BaseAspect::setGlobalSettings(globalSettings); + using namespace Core; Utils::AppInfo info; info.author = Constants::IDE_AUTHOR; diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index c58712ab008..a7007cccc5f 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -34,6 +34,19 @@ using namespace Layouting; namespace Utils { + +static QSettings *theSettings = nullptr; + +void BaseAspect::setGlobalSettings(QSettings *settings) +{ + theSettings = settings; +} + +QSettings *BaseAspect::settings() +{ + return theSettings; +} + namespace Internal { class BaseAspectPrivate @@ -552,19 +565,19 @@ void BaseAspect::toMap(QVariantMap &map) const saveToMap(map, toSettingsValue(variantValue()), toSettingsValue(defaultVariantValue()), settingsKey()); } -void BaseAspect::readSettings(const QSettings *settings) +void BaseAspect::readSettings() { if (settingsKey().isEmpty()) return; - const QVariant &val = settings->value(settingsKey()); + const QVariant val = settings()->value(settingsKey()); setVariantValue(val.isValid() ? fromSettingsValue(val) : defaultVariantValue()); } -void BaseAspect::writeSettings(QSettings *settings) const +void BaseAspect::writeSettings() const { if (settingsKey().isEmpty()) return; - QtcSettings::setValueWithDefault(settings, + QtcSettings::setValueWithDefault(settings(), settingsKey(), toSettingsValue(variantValue()), toSettingsValue(defaultVariantValue())); @@ -2314,28 +2327,30 @@ void AspectContainer::toMap(QVariantMap &map) const aspect->toMap(map); } -void AspectContainer::readSettings(QSettings *settings) +void AspectContainer::readSettings() { + QTC_ASSERT(theSettings, return); for (const QString &group : d->m_settingsGroup) - settings->beginGroup(group); + theSettings->beginGroup(group); for (BaseAspect *aspect : std::as_const(d->m_items)) - aspect->readSettings(settings); + aspect->readSettings(); for (int i = 0; i != d->m_settingsGroup.size(); ++i) - settings->endGroup(); + theSettings->endGroup(); } -void AspectContainer::writeSettings(QSettings *settings) const +void AspectContainer::writeSettings() const { + QTC_ASSERT(theSettings, return); for (const QString &group : d->m_settingsGroup) - settings->beginGroup(group); + theSettings->beginGroup(group); for (BaseAspect *aspect : std::as_const(d->m_items)) - aspect->writeSettings(settings); + aspect->writeSettings(); for (int i = 0; i != d->m_settingsGroup.size(); ++i) - settings->endGroup(); + theSettings->endGroup(); } void AspectContainer::setSettingsGroup(const QString &groupKey) diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 976aa259d46..0441c77399c 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -100,8 +100,8 @@ public: virtual void addToLayout(Layouting::LayoutItem &parent); - virtual void readSettings(const QSettings *settings); - virtual void writeSettings(QSettings *settings) const; + virtual void readSettings(); + virtual void writeSettings() const; using SavedValueTransformation = std::function<QVariant(const QVariant &)>; void setFromSettingsTransformation(const SavedValueTransformation &transform); @@ -159,6 +159,9 @@ public: Data::Ptr extractData() const; + static void setGlobalSettings(QSettings *settings); + static QSettings *settings(); + signals: void changed(); void volatileValueChanged(); @@ -713,8 +716,8 @@ public: void fromMap(const QVariantMap &map); void toMap(QVariantMap &map) const; - void readSettings(QSettings *settings); - void writeSettings(QSettings *settings) const; + void readSettings(); + void writeSettings() const; void setSettingsGroup(const QString &groupKey); void setSettingsGroups(const QString &groupKey, const QString &subGroupKey); diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index 91c058cec77..f18f30c14e5 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -30,7 +30,6 @@ #include <coreplugin/actionmanager/command.h> #include <coreplugin/coreconstants.h> #include <coreplugin/icontext.h> -#include <coreplugin/icore.h> #include <coreplugin/messagemanager.h> #include <cplusplus/CppDocument.h> @@ -138,7 +137,7 @@ AutotestPluginPrivate::AutotestPluginPrivate() m_frameworkManager.registerTestTool(new CTestTool); - m_frameworkManager.synchronizeSettings(ICore::settings()); + m_frameworkManager.synchronizeSettings(); m_resultsPane = TestResultsPane::instance(); auto panelFactory = new ProjectExplorer::ProjectPanelFactory(); diff --git a/src/plugins/autotest/testframeworkmanager.cpp b/src/plugins/autotest/testframeworkmanager.cpp index 3c6aff581db..9b426abf28e 100644 --- a/src/plugins/autotest/testframeworkmanager.cpp +++ b/src/plugins/autotest/testframeworkmanager.cpp @@ -9,8 +9,6 @@ #include <utils/algorithm.h> #include <utils/qtcassert.h> -#include <QSettings> - using namespace Utils; namespace Autotest { @@ -95,16 +93,16 @@ ITestTool *TestFrameworkManager::testToolForBuildSystemId(Id buildSystemId) }); } -void TestFrameworkManager::synchronizeSettings(QSettings *s) +void TestFrameworkManager::synchronizeSettings() { - Internal::TestSettings::instance()->fromSettings(s); + Internal::TestSettings::instance()->fromSettings(); for (ITestFramework *framework : std::as_const(m_registeredFrameworks)) { if (ITestSettings *fSettings = framework->testSettings()) - fSettings->readSettings(s); + fSettings->readSettings(); } for (ITestTool *testTool : std::as_const(m_registeredTestTools)) { if (ITestSettings *tSettings = testTool->testSettings()) - tSettings->readSettings(s); + tSettings->readSettings(); } } diff --git a/src/plugins/autotest/testframeworkmanager.h b/src/plugins/autotest/testframeworkmanager.h index 73dfd96ff96..62bb19d9474 100644 --- a/src/plugins/autotest/testframeworkmanager.h +++ b/src/plugins/autotest/testframeworkmanager.h @@ -5,10 +5,6 @@ #include "itestframework.h" -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - namespace Autotest { namespace Internal { class TestSettings; @@ -23,7 +19,7 @@ public: bool registerTestFramework(ITestFramework *framework); bool registerTestTool(ITestTool *testTool); - void synchronizeSettings(QSettings *s); + void synchronizeSettings(); static ITestFramework *frameworkForId(Utils::Id frameworkId); static ITestTool *testToolForId(Utils::Id testToolId); diff --git a/src/plugins/autotest/testsettings.cpp b/src/plugins/autotest/testsettings.cpp index 3c911202f1e..f2e63c4ea89 100644 --- a/src/plugins/autotest/testsettings.cpp +++ b/src/plugins/autotest/testsettings.cpp @@ -108,10 +108,11 @@ TestSettings::TestSettings() runAfterBuild.addOption(Tr::tr("Selected")); } -void TestSettings::toSettings(QSettings *s) const +void TestSettings::toSettings() const { - AspectContainer::writeSettings(s); + AspectContainer::writeSettings(); + QSettings *s = Utils::BaseAspect::settings(); s->beginGroup(Constants::SETTINGSGROUP); // store frameworks and their current active and grouping state @@ -126,10 +127,11 @@ void TestSettings::toSettings(QSettings *s) const s->endGroup(); } -void TestSettings::fromSettings(QSettings *s) +void TestSettings::fromSettings() { - AspectContainer::readSettings(s); + AspectContainer::readSettings(); + QSettings *s = Utils::BaseAspect::settings(); s->beginGroup(Constants::SETTINGSGROUP); // try to get settings for registered frameworks diff --git a/src/plugins/autotest/testsettings.h b/src/plugins/autotest/testsettings.h index fbcc4602914..c89f85d06c9 100644 --- a/src/plugins/autotest/testsettings.h +++ b/src/plugins/autotest/testsettings.h @@ -29,8 +29,8 @@ public: static TestSettings *instance(); - void toSettings(QSettings *s) const; - void fromSettings(QSettings *s); + void toSettings() const; + void fromSettings(); Utils::IntegerAspect scanThreadLimit{this}; Utils::IntegerAspect timeout{this}; diff --git a/src/plugins/autotest/testsettingspage.cpp b/src/plugins/autotest/testsettingspage.cpp index 407b386052a..980662cdc39 100644 --- a/src/plugins/autotest/testsettingspage.cpp +++ b/src/plugins/autotest/testsettingspage.cpp @@ -10,7 +10,6 @@ #include "testsettings.h" #include "testtreemodel.h" -#include <coreplugin/icore.h> #include <utils/algorithm.h> #include <utils/id.h> #include <utils/infolabel.h> @@ -137,7 +136,7 @@ TestSettingsWidget::TestSettingsWidget() testSettings(s); testToolsSettings(s); - s.toSettings(Core::ICore::settings()); + s.toSettings(); for (ITestFramework *framework : TestFrameworkManager::registeredFrameworks()) { framework->setActive(s.frameworks.value(framework->id(), false)); diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index 7648448132a..40b2cb6590f 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -117,7 +117,7 @@ bool AxivionPlugin::initialize(const QStringList &arguments, QString *errorMessa Q_UNUSED(errorMessage) dd = new AxivionPluginPrivate; - dd->m_axivionSettings.fromSettings(Core::ICore::settings()); + dd->m_axivionSettings.fromSettings(); auto panelFactory = new ProjectExplorer::ProjectPanelFactory; panelFactory->setPriority(250); diff --git a/src/plugins/axivion/axivionsettings.cpp b/src/plugins/axivion/axivionsettings.cpp index c3ecba69c13..c6d3f310105 100644 --- a/src/plugins/axivion/axivionsettings.cpp +++ b/src/plugins/axivion/axivionsettings.cpp @@ -5,6 +5,8 @@ #include "axiviontr.h" +#include <coreplugin/icore.h> + #include <utils/filepath.h> #include <utils/hostosinfo.h> @@ -81,9 +83,9 @@ AxivionSettings::AxivionSettings() curl.setExpectedKind(Utils::PathChooser::ExistingCommand); } -static Utils::FilePath tokensFilePath(const QSettings *s) +static Utils::FilePath tokensFilePath() { - return Utils::FilePath::fromString(s->fileName()).parentDir() + return Utils::FilePath::fromString(Core::ICore::settings()->fileName()).parentDir() .pathAppended("qtcreator/axivion.json"); } @@ -109,16 +111,16 @@ static AxivionServer readTokenFile(const Utils::FilePath &filePath) return AxivionServer::fromJson(doc.object()); } -void AxivionSettings::toSettings(QSettings *s) const +void AxivionSettings::toSettings() const { - writeTokenFile(tokensFilePath(s), server); - Utils::AspectContainer::writeSettings(s); + writeTokenFile(tokensFilePath(), server); + Utils::AspectContainer::writeSettings(); } -void AxivionSettings::fromSettings(QSettings *s) +void AxivionSettings::fromSettings() { - Utils::AspectContainer::readSettings(s); - server = readTokenFile(tokensFilePath(s)); + Utils::AspectContainer::readSettings(); + server = readTokenFile(tokensFilePath()); if (curl().isEmpty() || !curl().exists()) { const QString curlPath = QStandardPaths::findExecutable( diff --git a/src/plugins/axivion/axivionsettings.h b/src/plugins/axivion/axivionsettings.h index 0df1746387f..81413732592 100644 --- a/src/plugins/axivion/axivionsettings.h +++ b/src/plugins/axivion/axivionsettings.h @@ -10,7 +10,6 @@ QT_BEGIN_NAMESPACE class QJsonObject; -class QSettings; QT_END_NAMESPACE namespace Axivion::Internal { @@ -41,8 +40,8 @@ class AxivionSettings : public Utils::AspectContainer { public: AxivionSettings(); - void toSettings(QSettings *s) const; - void fromSettings(QSettings *s); + void toSettings() const; + void fromSettings(); AxivionServer server; // shall we have more than one? Utils::FilePathAspect curl{this}; diff --git a/src/plugins/axivion/axivionsettingspage.cpp b/src/plugins/axivion/axivionsettingspage.cpp index e837d71598d..e869b51d09b 100644 --- a/src/plugins/axivion/axivionsettingspage.cpp +++ b/src/plugins/axivion/axivionsettingspage.cpp @@ -7,7 +7,6 @@ #include "axivionsettings.h" #include "axiviontr.h" -#include <coreplugin/icore.h> #include <utils/aspects.h> #include <utils/id.h> #include <utils/layoutbuilder.h> @@ -170,7 +169,7 @@ AxivionSettingsWidget::AxivionSettingsWidget(AxivionSettings *settings) void AxivionSettingsWidget::apply() { m_settings->server = m_dashboardDisplay->dashboardServer(); - m_settings->toSettings(Core::ICore::settings()); + m_settings->toSettings(); emit AxivionPlugin::instance()->settingsChanged(); } diff --git a/src/plugins/beautifier/abstractsettings.cpp b/src/plugins/beautifier/abstractsettings.cpp index 362a2481538..3661720ae37 100644 --- a/src/plugins/beautifier/abstractsettings.cpp +++ b/src/plugins/beautifier/abstractsettings.cpp @@ -228,9 +228,7 @@ QString AbstractSettings::documentation(const QString &option) const void AbstractSettings::save() { // Save settings, except styles - QSettings *s = Core::ICore::settings(); - - AspectContainer::writeSettings(s); + AspectContainer::writeSettings(); // Save styles if (m_stylesToRemove.isEmpty() && m_styles.isEmpty()) @@ -287,8 +285,7 @@ void AbstractSettings::createDocumentationFile() const void AbstractSettings::read() { // Read settings, except styles - QSettings *s = Core::ICore::settings(); - AspectContainer::readSettings(s); + AspectContainer::readSettings(); m_styles.clear(); m_changedStyles.clear(); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 93cb3f88cd0..741d91efb66 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -598,7 +598,7 @@ void CMakeBuildSettingsWidget::reconfigureWithInitialParameters() QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); - settings->writeSettings(Core::ICore::settings()); + settings->writeSettings(); if (reply != QMessageBox::Yes) { return; diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index 7e4c777317d..2892f78a7e8 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -146,7 +146,7 @@ void CMakeToolManager::restoreCMakeTools() if (settings->autorunCMake.value() == settings->autorunCMake.defaultValue()) { CMakeTool *cmake = defaultCMakeTool(); settings->autorunCMake.setValue(cmake ? cmake->isAutoRun() : true); - settings->writeSettings(Core::ICore::settings()); + settings->writeSettings(); } } diff --git a/src/plugins/conan/conansettings.cpp b/src/plugins/conan/conansettings.cpp index f7de5b01ea8..db88a242be2 100644 --- a/src/plugins/conan/conansettings.cpp +++ b/src/plugins/conan/conansettings.cpp @@ -3,8 +3,6 @@ #include "conansettings.h" -#include <coreplugin/icore.h> - #include <utils/hostosinfo.h> using namespace Utils; @@ -26,7 +24,7 @@ ConanSettings::ConanSettings() conanFilePath.setExpectedKind(PathChooser::ExistingCommand); conanFilePath.setDefaultValue(FilePath::fromString(HostOsInfo::withExecutableSuffix("conan"))); - readSettings(Core::ICore::settings()); + readSettings(); } } // Conan::Internal diff --git a/src/plugins/copilot/copilotoptionspage.cpp b/src/plugins/copilot/copilotoptionspage.cpp index 61e6d085dc4..07e21bf91e3 100644 --- a/src/plugins/copilot/copilotoptionspage.cpp +++ b/src/plugins/copilot/copilotoptionspage.cpp @@ -8,8 +8,6 @@ #include "copilotsettings.h" #include "copilottr.h" -#include <coreplugin/icore.h> - #include <utils/layoutbuilder.h> #include <utils/pathchooser.h> @@ -95,7 +93,7 @@ public: setOnApply([] { CopilotSettings::instance().apply(); - CopilotSettings::instance().writeSettings(Core::ICore::settings()); + CopilotSettings::instance().writeSettings(); }); } }; diff --git a/src/plugins/copilot/copilotplugin.cpp b/src/plugins/copilot/copilotplugin.cpp index 48a4dc89e82..be8f4420162 100644 --- a/src/plugins/copilot/copilotplugin.cpp +++ b/src/plugins/copilot/copilotplugin.cpp @@ -14,7 +14,6 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/editormanager/editormanager.h> -#include <coreplugin/icore.h> #include <coreplugin/statusbarmanager.h> #include <languageclient/languageclientmanager.h> @@ -58,7 +57,7 @@ void cycleSuggestion(TextEditor::TextEditorWidget *editor, Direction direction) void CopilotPlugin::initialize() { - CopilotSettings::instance().readSettings(ICore::settings()); + CopilotSettings::instance().readSettings(); restartClient(); diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.cpp b/src/plugins/coreplugin/dialogs/ioptionspage.cpp index 8cbbd7eac42..bd94fca9b97 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.cpp +++ b/src/plugins/coreplugin/dialogs/ioptionspage.cpp @@ -6,8 +6,6 @@ #include "ioptionspage.h" -#include <coreplugin/icore.h> - #include <utils/algorithm.h> #include <utils/aspects.h> #include <utils/layoutbuilder.h> @@ -167,7 +165,7 @@ void IOptionsPage::apply() AspectContainer *container = m_settingsProvider(); if (container->isDirty()) { container->apply(); - container->writeSettings(ICore::settings()); + container->writeSettings(); } } } @@ -323,9 +321,4 @@ PagedSettings::PagedSettings() setAutoApply(false); } -void PagedSettings::readSettings() -{ - return AspectContainer::readSettings(Core::ICore::settings()); -} - } // Core diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index 2c46fea9fdf..b63da5710c8 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -133,9 +133,6 @@ class CORE_EXPORT PagedSettings : public Utils::AspectContainer, public IOptions { public: PagedSettings(); - - using AspectContainer::readSettings; // FIXME: Remove. - void readSettings(); // Intentionally hides AspectContainer::readSettings() }; } // namespace Core diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index a18b454c860..2a33dcfccb9 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -132,7 +132,7 @@ CodePasterPluginPrivate::CodePasterPluginPrivate() } // Create the settings Page - m_settings.readSettings(ICore::settings()); + m_settings.readSettings(); connect(&m_urlOpen, &Protocol::fetchDone, this, &CodePasterPluginPrivate::finishFetch); @@ -251,7 +251,7 @@ void CodePasterPluginPrivate::post(QString data, const QString &mimeType) // Save new protocol in case user changed it. if (dialogResult == QDialog::Accepted && m_settings.protocols.value() != view.protocol()) { m_settings.protocols.setValue(view.protocol()); - m_settings.writeSettings(ICore::settings()); + m_settings.writeSettings(); } } @@ -282,7 +282,7 @@ void CodePasterPluginPrivate::fetch() // Save new protocol in case user changed it. if (m_settings.protocols.value() != dialog.protocol()) { m_settings.protocols.setValue(dialog.protocol()); - m_settings.writeSettings(ICore::settings()); + m_settings.writeSettings(); } const QString pasteID = dialog.pasteId(); diff --git a/src/plugins/debugger/cdb/cdboptionspage.cpp b/src/plugins/debugger/cdb/cdboptionspage.cpp index 8f21d670964..f47e275fd15 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.cpp +++ b/src/plugins/debugger/cdb/cdboptionspage.cpp @@ -10,8 +10,6 @@ #include <debugger/debuggertr.h> #include <debugger/shared/cdbsymbolpathlisteditor.h> -#include <coreplugin/icore.h> - #include <utils/aspects.h> #include <utils/layoutbuilder.h> @@ -215,7 +213,8 @@ CdbOptionsPageWidget::CdbOptionsPageWidget() void CdbOptionsPageWidget::apply() { - m_group.apply(); m_group.writeSettings(Core::ICore::settings()); + m_group.apply(); + m_group.writeSettings(); debuggerSettings()->cdbBreakEvents.setValue(m_breakEventWidget->breakEvents()); } @@ -269,7 +268,7 @@ void CdbPathsPageWidget::apply() { debuggerSettings()->cdbSymbolPaths.setValue(m_symbolPaths->pathList()); debuggerSettings()->cdbSourcePaths.setValue(m_sourcePaths->pathList()); - m_group.writeSettings(Core::ICore::settings()); + m_group.writeSettings(); } void CdbPathsPageWidget::finish() diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index a007e96f48f..7dd6950f0f9 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -7,8 +7,6 @@ #include "debuggerinternalconstants.h" #include "debuggertr.h" -#include <coreplugin/icore.h> - #include <utils/layoutbuilder.h> using namespace Core; @@ -37,7 +35,7 @@ public: if (originalPostMortem != currentPostMortem) s.registerForPostMortem->setValue(currentPostMortem); s.page1.apply(); - s.page1.writeSettings(ICore::settings()); + s.page1.writeSettings(); }); setOnFinish([&s] { s.page1.finish(); }); @@ -116,7 +114,7 @@ public: LocalsAndExpressionsOptionsPageWidget() { DebuggerSettings &s = *debuggerSettings(); - setOnApply([&s] { s.page4.apply(); s.page4.writeSettings(ICore::settings()); }); + setOnApply([&s] { s.page4.apply(); s.page4.writeSettings(); }); setOnFinish([&s] { s.page4.finish(); }); auto label = new QLabel; //(useHelperGroup); diff --git a/src/plugins/debugger/console/console.cpp b/src/plugins/debugger/console/console.cpp index 57810ef62bf..3535e9d01f2 100644 --- a/src/plugins/debugger/console/console.cpp +++ b/src/plugins/debugger/console/console.cpp @@ -202,10 +202,9 @@ bool Console::canNavigate() const void Console::readSettings() { - QSettings *settings = Core::ICore::settings(); - m_showDebug.readSettings(settings); - m_showWarning.readSettings(settings); - m_showError.readSettings(settings); + m_showDebug.readSettings(); + m_showWarning.readSettings(); + m_showError.readSettings(); } void Console::setContext(const QString &context) @@ -215,10 +214,9 @@ void Console::setContext(const QString &context) void Console::writeSettings() const { - QSettings *settings = Core::ICore::settings(); - m_showDebug.writeSettings(settings); - m_showWarning.writeSettings(settings); - m_showError.writeSettings(settings); + m_showDebug.writeSettings(); + m_showWarning.writeSettings(); + m_showError.writeSettings(); } void Console::setScriptEvaluator(const ScriptEvaluator &evaluator) diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 9997d3f58c9..63c2268734d 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -13,7 +13,6 @@ #endif #include <coreplugin/coreconstants.h> -#include <coreplugin/icore.h> #include <utils/hostosinfo.h> #include <utils/qtcassert.h> @@ -471,14 +470,14 @@ DebuggerSettings::~DebuggerSettings() void DebuggerSettings::readSettings() { - all.readSettings(Core::ICore::settings()); - GdbSettings::readSettings(Core::ICore::settings()); + all.readSettings(); + GdbSettings::readSettings(); } void DebuggerSettings::writeSettings() const { - all.writeSettings(Core::ICore::settings()); - GdbSettings::writeSettings(Core::ICore::settings()); + all.writeSettings(); + GdbSettings::writeSettings(); } QString DebuggerSettings::dump() diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index 1a27beae330..e59b6356f1c 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -32,8 +32,8 @@ public: void addToLayout(Layouting::LayoutItem &parent) override; - void readSettings(const QSettings *settings) override; - void writeSettings(QSettings *settings) const override; + void readSettings() override; + void writeSettings() const override; private: void guiToInternal() override; diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index ad9aeb87391..023918fe7f8 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -486,9 +486,10 @@ const char sourcePathMappingArrayNameC[] = "SourcePathMappings"; const char sourcePathMappingSourceKeyC[] = "Source"; const char sourcePathMappingTargetKeyC[] = "Target"; -void SourcePathMapAspect::writeSettings(QSettings *s) const +void SourcePathMapAspect::writeSettings() const { const SourcePathMap sourcePathMap = value(); + QSettings *s = settings(); s->beginWriteArray(sourcePathMappingArrayNameC); if (!sourcePathMap.isEmpty()) { const QString sourcePathMappingSourceKey(sourcePathMappingSourceKeyC); @@ -505,10 +506,9 @@ void SourcePathMapAspect::writeSettings(QSettings *s) const s->endArray(); } -void SourcePathMapAspect::readSettings(const QSettings *settings) +void SourcePathMapAspect::readSettings() { - // Eeks. But legitimate, this operates on ICore::settings(); - QSettings *s = const_cast<QSettings *>(settings); + QSettings *s = settings(); SourcePathMap sourcePathMap; if (const int count = s->beginReadArray(sourcePathMappingArrayNameC)) { const QString sourcePathMappingSourceKey(sourcePathMappingSourceKeyC); diff --git a/src/plugins/debugger/registerpostmortemaction.cpp b/src/plugins/debugger/registerpostmortemaction.cpp index 4afd0989eed..a7f68083180 100644 --- a/src/plugins/debugger/registerpostmortemaction.cpp +++ b/src/plugins/debugger/registerpostmortemaction.cpp @@ -49,7 +49,7 @@ RegisterPostMortemAction::RegisterPostMortemAction() connect(this, &BaseAspect::changed, this, [this] { registerNow(value()); }); } -void RegisterPostMortemAction::readSettings(const QSettings *) +void RegisterPostMortemAction::readSettings() { Q_UNUSED(debuggerRegistryValueNameC) // avoid warning from MinGW diff --git a/src/plugins/debugger/registerpostmortemaction.h b/src/plugins/debugger/registerpostmortemaction.h index 99d104165b0..d981ea14ccb 100644 --- a/src/plugins/debugger/registerpostmortemaction.h +++ b/src/plugins/debugger/registerpostmortemaction.h @@ -12,8 +12,8 @@ class RegisterPostMortemAction : public Utils::BoolAspect { public: RegisterPostMortemAction(); - void readSettings(const QSettings *settings = nullptr) override; - void writeSettings(QSettings *) const override {} + void readSettings() override; + void writeSettings() const override {} private: void registerNow(bool value); diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 82ee2f43d4d..5e6a7b18478 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -379,7 +379,7 @@ PerforcePluginPrivate::PerforcePluginPrivate() dd = this; - m_settings.readSettings(ICore::settings()); + m_settings.readSettings(); const QString prefix = QLatin1String("p4"); m_commandLocator = new CommandLocator("Perforce", prefix, prefix, this); @@ -1678,7 +1678,7 @@ void PerforcePluginPrivate::setTopLevel(const FilePath &topLevel) void PerforcePluginPrivate::applySettings() { - m_settings.writeSettings(ICore::settings()); + m_settings.writeSettings(); m_managedDirectoryCache.clear(); getTopLevel(); emit configurationChanged(); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 26c6ed8827d..a143f91b704 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1681,7 +1681,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er = s->value(Constants::LOW_BUILD_PRIORITY_SETTINGS_KEY, defaultSettings.lowBuildPriority) .toBool(); - dd->m_buildPropertiesSettings.readSettings(s); + dd->m_buildPropertiesSettings.readSettings(); const int customParserCount = s->value(Constants::CUSTOM_PARSER_COUNT_KEY).toInt(); for (int i = 0; i < customParserCount; ++i) { @@ -2255,7 +2255,7 @@ void ProjectExplorerPluginPrivate::savePersistentSettings() int(dd->m_projectExplorerSettings.stopBeforeBuild), int(defaultSettings.stopBeforeBuild)); - dd->m_buildPropertiesSettings.writeSettings(s); + dd->m_buildPropertiesSettings.writeSettings(); s->setValueWithDefault(Constants::CUSTOM_PARSER_COUNT_KEY, int(dd->m_customParsers.count()), 0); for (int i = 0; i < dd->m_customParsers.count(); ++i) { diff --git a/src/plugins/qmakeprojectmanager/qmakesettings.cpp b/src/plugins/qmakeprojectmanager/qmakesettings.cpp index c5bb6a2890a..e0ab9a47082 100644 --- a/src/plugins/qmakeprojectmanager/qmakesettings.cpp +++ b/src/plugins/qmakeprojectmanager/qmakesettings.cpp @@ -5,7 +5,6 @@ #include "qmakeprojectmanagertr.h" #include <coreplugin/dialogs/ioptionspage.h> -#include <coreplugin/icore.h> #include <projectexplorer/projectexplorerconstants.h> @@ -59,7 +58,7 @@ QmakeSettings::QmakeSettings() }; }); - readSettings(Core::ICore::settings()); + readSettings(); } class QmakeSettingsPage : public Core::IOptionsPage diff --git a/src/plugins/qmlprofiler/qmlprofilersettings.cpp b/src/plugins/qmlprofiler/qmlprofilersettings.cpp index 1002479baae..17ae29c28b9 100644 --- a/src/plugins/qmlprofiler/qmlprofilersettings.cpp +++ b/src/plugins/qmlprofiler/qmlprofilersettings.cpp @@ -6,8 +6,6 @@ #include "qmlprofilersettings.h" #include "qmlprofilertr.h" -#include <coreplugin/icore.h> - #include <debugger/analyzer/analyzericons.h> #include <debugger/debuggertr.h> @@ -76,12 +74,12 @@ QmlProfilerSettings::QmlProfilerSettings() "the program.")); // Read stored values - readSettings(Core::ICore::settings()); + readSettings(); } void QmlProfilerSettings::writeGlobalSettings() const { - writeSettings(Core::ICore::settings()); + writeSettings(); } // QmlProfilerOptionsPage diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index 279786cac85..d8144818fe6 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -94,7 +94,7 @@ TerminalPane::TerminalPane(QObject *parent) connect(m_escSettingButton, &QToolButton::toggled, this, [this, updateEscButton] { TerminalSettings::instance().sendEscapeToTerminal.setValue(m_escSettingButton->isChecked()); - TerminalSettings::instance().writeSettings(ICore::settings()); + TerminalSettings::instance().writeSettings(); updateEscButton(); }); diff --git a/src/plugins/vcpkg/vcpkgsettings.cpp b/src/plugins/vcpkg/vcpkgsettings.cpp index ac7bf8ba32c..8f026c5654a 100644 --- a/src/plugins/vcpkg/vcpkgsettings.cpp +++ b/src/plugins/vcpkg/vcpkgsettings.cpp @@ -66,7 +66,7 @@ VcpkgSettings::VcpkgSettings() // clang-format on }); - readSettings(Core::ICore::settings()); + readSettings(); } class VcpkgSettingsPage : public Core::IOptionsPage diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index ffa19b24f78..de3565dd531 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -246,7 +246,7 @@ VcsBaseEditorWidget *VcsBaseClientImpl::createVcsEditor(Id kind, QString title, void VcsBaseClientImpl::saveSettings() { - m_baseSettings->writeSettings(ICore::settings()); + m_baseSettings->writeSettings(); } VcsBaseClient::VcsBaseClient(VcsBaseSettings *baseSettings) From 9888e1982e18ebed274c9ac7b7c4ba131641aa57 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 5 Jul 2023 17:08:55 +0200 Subject: [PATCH 0191/1777] Haskell: Use aspects more directly in HaskellRunConfiguration Task-number: QTCREATORBUG-29168 Change-Id: I7b10c001d1a4cc03d69298e59c4eb1097930816a Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/haskell/haskellplugin.cpp | 5 +- .../haskell/haskellrunconfiguration.cpp | 115 +++++++++--------- src/plugins/haskell/haskellrunconfiguration.h | 30 +---- 3 files changed, 66 insertions(+), 84 deletions(-) diff --git a/src/plugins/haskell/haskellplugin.cpp b/src/plugins/haskell/haskellplugin.cpp index 84a86f7db48..1afa8cd175f 100644 --- a/src/plugins/haskell/haskellplugin.cpp +++ b/src/plugins/haskell/haskellplugin.cpp @@ -16,8 +16,11 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/icore.h> -#include <projectexplorer/projectmanager.h> + #include <projectexplorer/jsonwizard/jsonwizardfactory.h> +#include <projectexplorer/projectmanager.h> +#include <projectexplorer/runcontrol.h> + #include <texteditor/snippets/snippetprovider.h> #include <QAction> diff --git a/src/plugins/haskell/haskellrunconfiguration.cpp b/src/plugins/haskell/haskellrunconfiguration.cpp index fec7f73e966..ef97ee4d4f0 100644 --- a/src/plugins/haskell/haskellrunconfiguration.cpp +++ b/src/plugins/haskell/haskellrunconfiguration.cpp @@ -4,19 +4,74 @@ #include "haskellrunconfiguration.h" #include "haskellconstants.h" -#include "haskellproject.h" #include "haskelltr.h" #include "haskellsettings.h" #include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/project.h> +#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> using namespace ProjectExplorer; +using namespace Utils; -namespace Haskell { -namespace Internal { +namespace Haskell::Internal { + +class HaskellRunConfiguration : public RunConfiguration +{ +public: + HaskellRunConfiguration(Target *target, Id id) + : RunConfiguration(target, id) + { + environment.setSupportForBuildEnvironment(target); + + executable.setSettingsKey("Haskell.Executable"); + executable.setLabelText(Tr::tr("Executable")); + + arguments.setMacroExpander(macroExpander()); + + workingDir.setMacroExpander(macroExpander()); + workingDir.setEnvironment(&environment); + workingDir.setDefaultWorkingDirectory(project()->projectDirectory()); + workingDir.setVisible(false); + + setUpdater([this] { executable.setValue(buildTargetInfo().buildKey); }); + + connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); + update(); + } + +private: + ProjectExplorer::Runnable runnable() const final + { + const FilePath projectDirectory = project()->projectDirectory(); + Runnable r; + QStringList args; + if (BuildConfiguration *buildConfiguration = target()->activeBuildConfiguration()) { + args << "--work-dir" + << QDir(projectDirectory.toString()).relativeFilePath( + buildConfiguration->buildDirectory().toString()); + } + args << "exec" << executable(); + if (!arguments.arguments().isEmpty()) + args << "--" << arguments.arguments(); + + r.workingDirectory = projectDirectory; + r.environment = environment.environment(); + r.command = {r.environment.searchInPath(settings().stackPath().path()), args}; + return r; + } + + EnvironmentAspect environment{this}; + StringAspect executable{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; + TerminalAspect terminal{this}; +}; + +// Factory HaskellRunConfigurationFactory::HaskellRunConfigurationFactory() { @@ -25,56 +80,4 @@ HaskellRunConfigurationFactory::HaskellRunConfigurationFactory() addSupportedTargetDeviceType(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE); } -HaskellExecutableAspect::HaskellExecutableAspect() -{ - setSettingsKey("Haskell.Executable"); - setLabelText(Tr::tr("Executable")); -} - -HaskellRunConfiguration::HaskellRunConfiguration(Target *target, Utils::Id id) - : RunConfiguration(target, id) -{ - auto envAspect = addAspect<EnvironmentAspect>(); - envAspect->setSupportForBuildEnvironment(target); - - addAspect<HaskellExecutableAspect>(); - - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); - - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); - workingDirAspect->setEnvironment(envAspect); - workingDirAspect->setDefaultWorkingDirectory(target->project()->projectDirectory()); - workingDirAspect->setVisible(false); - - addAspect<TerminalAspect>(); - - setUpdater([this] { aspect<HaskellExecutableAspect>()->setValue(buildTargetInfo().buildKey); }); - connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); - update(); -} - -Runnable HaskellRunConfiguration::runnable() const -{ - const Utils::FilePath projectDirectory = target()->project()->projectDirectory(); - Runnable r; - QStringList args; - if (BuildConfiguration *buildConfiguration = target()->activeBuildConfiguration()) { - args << "--work-dir" - << QDir(projectDirectory.toString()).relativeFilePath( - buildConfiguration->buildDirectory().toString()); - } - args << "exec" << aspect<HaskellExecutableAspect>()->value(); - const QString arguments = aspect<ArgumentsAspect>()->arguments(); - if (!arguments.isEmpty()) - args << "--" << arguments; - - r.workingDirectory = projectDirectory; - r.environment = aspect<EnvironmentAspect>()->environment(); - r.command = {r.environment.searchInPath(settings().stackPath().path()), args}; - return r; -} - -} // namespace Internal -} // namespace Haskell +} // Haskell::Internal diff --git a/src/plugins/haskell/haskellrunconfiguration.h b/src/plugins/haskell/haskellrunconfiguration.h index c0c0423d2a0..579f8110a75 100644 --- a/src/plugins/haskell/haskellrunconfiguration.h +++ b/src/plugins/haskell/haskellrunconfiguration.h @@ -3,24 +3,9 @@ #pragma once -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/runconfigurationaspects.h> -#include <projectexplorer/runcontrol.h> -#include <utils/aspects.h> +#include <projectexplorer/runconfiguration.h> -namespace Haskell { -namespace Internal { - -class HaskellRunConfiguration : public ProjectExplorer::RunConfiguration -{ - Q_OBJECT - -public: - HaskellRunConfiguration(ProjectExplorer::Target *target, Utils::Id id); - -private: - ProjectExplorer::Runnable runnable() const final; -}; +namespace Haskell::Internal { class HaskellRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory { @@ -28,13 +13,4 @@ public: HaskellRunConfigurationFactory(); }; -class HaskellExecutableAspect : public Utils::StringAspect -{ - Q_OBJECT - -public: - HaskellExecutableAspect(); -}; - -} // namespace Internal -} // namespace Haskell +} // Haskell::Internal From 04162ba29129e3e17711e7d078ac1d555e63d3b8 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 14:53:26 +0200 Subject: [PATCH 0192/1777] Utils: Move some FilePath specific functions ... from StringAspect to FilePathAspect. Task-number: QTCREATORBUG-29167 Change-Id: I6fc3bc22f905825443ebc31ebe44e7c27fdbcb56 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 12 ++++++------ src/libs/utils/aspects.h | 13 +++++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index a7007cccc5f..ab245890e84 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -923,35 +923,35 @@ void StringAspect::setPlaceHolderText(const QString &placeHolderText) d->m_textEditDisplay->setPlaceholderText(placeHolderText); } -void StringAspect::setPromptDialogFilter(const QString &filter) +void FilePathAspect::setPromptDialogFilter(const QString &filter) { d->m_prompDialogFilter = filter; if (d->m_pathChooserDisplay) d->m_pathChooserDisplay->setPromptDialogFilter(filter); } -void StringAspect::setPromptDialogTitle(const QString &title) +void FilePathAspect::setPromptDialogTitle(const QString &title) { d->m_prompDialogTitle = title; if (d->m_pathChooserDisplay) d->m_pathChooserDisplay->setPromptDialogTitle(title); } -void StringAspect::setCommandVersionArguments(const QStringList &arguments) +void FilePathAspect::setCommandVersionArguments(const QStringList &arguments) { d->m_commandVersionArguments = arguments; if (d->m_pathChooserDisplay) d->m_pathChooserDisplay->setCommandVersionArguments(arguments); } -void StringAspect::setAllowPathFromDevice(bool allowPathFromDevice) +void FilePathAspect::setAllowPathFromDevice(bool allowPathFromDevice) { d->m_allowPathFromDevice = allowPathFromDevice; if (d->m_pathChooserDisplay) d->m_pathChooserDisplay->setAllowPathFromDevice(allowPathFromDevice); } -void StringAspect::setValidatePlaceHolder(bool validatePlaceHolder) +void FilePathAspect::setValidatePlaceHolder(bool validatePlaceHolder) { d->m_validatePlaceHolder = validatePlaceHolder; if (d->m_pathChooserDisplay) @@ -1047,7 +1047,7 @@ void StringAspect::setValidationFunction(const FancyLineEdit::ValidationFunction d->m_pathChooserDisplay->setValidationFunction(*d->m_validator); } -void StringAspect::setOpenTerminalHandler(const std::function<void ()> &openTerminal) +void FilePathAspect::setOpenTerminalHandler(const std::function<void ()> &openTerminal) { d->m_openTerminal = openTerminal; if (d->m_pathChooserDisplay) diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 0441c77399c..fc3500dd747 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -464,9 +464,6 @@ public: void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter); void setPlaceHolderText(const QString &placeHolderText); - void setPromptDialogFilter(const QString &filter); - void setPromptDialogTitle(const QString &title); - void setCommandVersionArguments(const QStringList &arguments); void setHistoryCompleter(const QString &historyCompleterKey); void setExpectedKind(const PathChooser::Kind expectedKind); void setEnvironment(const Environment &env); @@ -477,11 +474,8 @@ public: void setUseGlobalMacroExpander(); void setUseResetButton(); void setValidationFunction(const FancyLineEdit::ValidationFunction &validator); - void setOpenTerminalHandler(const std::function<void()> &openTerminal); void setAutoApplyOnEditingFinished(bool applyOnEditingFinished); void setElideMode(Qt::TextElideMode elideMode); - void setAllowPathFromDevice(bool allowPathFromDevice); - void setValidatePlaceHolder(bool validatePlaceHolder); void validateInput(); @@ -527,6 +521,13 @@ public: FilePath operator()() const { return filePath(); } void setValue(const FilePath &filePath); void setDefaultValue(const FilePath &filePath); + + void setPromptDialogFilter(const QString &filter); + void setPromptDialogTitle(const QString &title); + void setCommandVersionArguments(const QStringList &arguments); + void setAllowPathFromDevice(bool allowPathFromDevice); + void setValidatePlaceHolder(bool validatePlaceHolder); + void setOpenTerminalHandler(const std::function<void()> &openTerminal); }; class QTCREATOR_UTILS_EXPORT IntegerAspect : public TypedAspect<qint64> From 01d6afbcf657cb581a43786cbb73da99f1cfb188 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 7 Jul 2023 12:15:37 +0200 Subject: [PATCH 0193/1777] Haskell: Fix missing include Amends 9888e1982e18ebed274c9ac7b7c4ba131641aa57. Change-Id: Idef1f1e8cf4922d72e3894da0cee626551e369ab Reviewed-by: hjk <hjk@qt.io> --- src/plugins/haskell/haskellrunconfiguration.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/haskell/haskellrunconfiguration.cpp b/src/plugins/haskell/haskellrunconfiguration.cpp index ef97ee4d4f0..fbcf9589aeb 100644 --- a/src/plugins/haskell/haskellrunconfiguration.cpp +++ b/src/plugins/haskell/haskellrunconfiguration.cpp @@ -8,6 +8,7 @@ #include "haskellsettings.h" #include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/buildsystem.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runconfigurationaspects.h> From 4c8c793c06a70bd178ebc01892c710e1e48e3cfa Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 5 Jul 2023 16:53:58 +0200 Subject: [PATCH 0194/1777] ProjectExplorer: Use aspects more directly in desktop runconfigs Task-number: QTCREATORBUG-29168 Change-Id: Ib191270e0cc1d192a25bf9f41e3315a6e6e79e24 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../desktoprunconfiguration.cpp | 105 ++++++++---------- .../projectexplorer/desktoprunconfiguration.h | 6 +- 2 files changed, 50 insertions(+), 61 deletions(-) diff --git a/src/plugins/projectexplorer/desktoprunconfiguration.cpp b/src/plugins/projectexplorer/desktoprunconfiguration.cpp index ce7c6ed0f69..afcfe3607c5 100644 --- a/src/plugins/projectexplorer/desktoprunconfiguration.cpp +++ b/src/plugins/projectexplorer/desktoprunconfiguration.cpp @@ -14,22 +14,53 @@ #include <qbsprojectmanager/qbsprojectmanagerconstants.h> #include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> -#include <utils/fileutils.h> -#include <utils/pathchooser.h> -#include <utils/qtcassert.h> -#include <utils/stringutils.h> - using namespace Utils; -namespace ProjectExplorer { -namespace Internal { +namespace ProjectExplorer::Internal { class DesktopRunConfiguration : public RunConfiguration { protected: enum Kind { Qmake, Qbs, CMake }; // FIXME: Remove - DesktopRunConfiguration(Target *target, Id id, Kind kind); + DesktopRunConfiguration(Target *target, Id id, Kind kind) + : RunConfiguration(target, id), m_kind(kind) + { + environment.setSupportForBuildEnvironment(target); + + executable.setDeviceSelector(target, ExecutableAspect::RunDevice); + + arguments.setMacroExpander(macroExpander()); + + workingDir.setMacroExpander(macroExpander()); + workingDir.setEnvironment(&environment); + + connect(&useLibraryPaths, &UseLibraryPathsAspect::changed, + &environment, &EnvironmentAspect::environmentChanged); + + if (HostOsInfo::isMacHost()) { + connect(&useDyldSuffix, &UseLibraryPathsAspect::changed, + &environment, &EnvironmentAspect::environmentChanged); + environment.addModifier([this](Environment &env) { + if (useDyldSuffix()) + env.set(QLatin1String("DYLD_IMAGE_SUFFIX"), QLatin1String("_debug")); + }); + } else { + useDyldSuffix.setVisible(false); + } + + runAsRoot.setVisible(HostOsInfo::isAnyUnixHost()); + + environment.addModifier([this](Environment &env) { + BuildTargetInfo bti = buildTargetInfo(); + if (bti.runEnvModifier) + bti.runEnvModifier(env, useLibraryPaths()); + }); + + setUpdater([this] { updateTargetInformation(); }); + + connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); + } private: void updateTargetInformation(); @@ -37,55 +68,16 @@ private: FilePath executableToRun(const BuildTargetInfo &targetInfo) const; const Kind m_kind; + EnvironmentAspect environment{this}; + ExecutableAspect executable{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; + TerminalAspect terminal{this}; + UseDyldSuffixAspect useDyldSuffix{this}; + UseLibraryPathsAspect useLibraryPaths{this}; + RunAsRootAspect runAsRoot{this}; }; -DesktopRunConfiguration::DesktopRunConfiguration(Target *target, Id id, Kind kind) - : RunConfiguration(target, id), m_kind(kind) -{ - auto envAspect = addAspect<EnvironmentAspect>(); - envAspect->setSupportForBuildEnvironment(target); - - auto exeAspect = addAspect<ExecutableAspect>(); - exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); - - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); - - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); - workingDirAspect->setEnvironment(envAspect); - - addAspect<TerminalAspect>(); - - auto libAspect = addAspect<UseLibraryPathsAspect>(); - connect(libAspect, &UseLibraryPathsAspect::changed, - envAspect, &EnvironmentAspect::environmentChanged); - - if (HostOsInfo::isMacHost()) { - auto dyldAspect = addAspect<UseDyldSuffixAspect>(); - connect(dyldAspect, &UseLibraryPathsAspect::changed, - envAspect, &EnvironmentAspect::environmentChanged); - envAspect->addModifier([dyldAspect](Environment &env) { - if (dyldAspect->value()) - env.set(QLatin1String("DYLD_IMAGE_SUFFIX"), QLatin1String("_debug")); - }); - } - - if (HostOsInfo::isAnyUnixHost()) - addAspect<RunAsRootAspect>(); - - envAspect->addModifier([this, libAspect](Environment &env) { - BuildTargetInfo bti = buildTargetInfo(); - if (bti.runEnvModifier) - bti.runEnvModifier(env, libAspect->value()); - }); - - - setUpdater([this] { updateTargetInformation(); }); - - connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); -} - void DesktopRunConfiguration::updateTargetInformation() { if (!activeBuildSystem()) @@ -204,5 +196,4 @@ DesktopQmakeRunConfigurationFactory::DesktopQmakeRunConfigurationFactory() addSupportedTargetDeviceType(Docker::Constants::DOCKER_DEVICE_TYPE); } -} // namespace Internal -} // namespace ProjectExplorer +} // ProjectExplorer::Internal diff --git a/src/plugins/projectexplorer/desktoprunconfiguration.h b/src/plugins/projectexplorer/desktoprunconfiguration.h index 2a0d00f7a29..6a2203cace4 100644 --- a/src/plugins/projectexplorer/desktoprunconfiguration.h +++ b/src/plugins/projectexplorer/desktoprunconfiguration.h @@ -5,8 +5,7 @@ #include "runconfiguration.h" -namespace ProjectExplorer { -namespace Internal { +namespace ProjectExplorer::Internal { class DesktopQmakeRunConfigurationFactory final : public RunConfigurationFactory { @@ -26,5 +25,4 @@ public: CMakeRunConfigurationFactory(); }; -} // namespace Internal -} // namespace ProjectExplorer +} // ProjectExplorer::Internal From f0bb7e8bfa9f9880a09872160c7765be1e44a594 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 5 Jul 2023 14:40:41 +0200 Subject: [PATCH 0195/1777] Editor: modernize line column label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change contains various adjustments to the line column label: - Display the number of selected characters - Show the number of cursors instead of the position when multiple text cursors are present in the current editor - show detailed information for each cursor in the line column tooltip Fixes: QTCREATORBUG-29381 Change-Id: Ib4f36b290797f1d84f268deeb9556e78ae921c37 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: André Hartmann <aha_1980@gmx.de> --- src/plugins/texteditor/texteditor.cpp | 79 +++++++++++++++++++++++---- 1 file changed, 67 insertions(+), 12 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index ac0d3ebee42..8d16d57922e 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -157,7 +157,6 @@ public: : FixedSizeClickLabel(parent) , m_editor(parent) { - setMaxText(Tr::tr("Line: 9999, Col: 999")); connect(m_editor, &QPlainTextEdit::cursorPositionChanged, this, &LineColumnLabel::update); connect(this, &FixedSizeClickLabel::clicked, ActionManager::instance(), [this] { emit m_editor->activateEditor(EditorManager::IgnoreNavigationHistory); @@ -173,18 +172,74 @@ public: private: void update() { - const QTextCursor cursor = m_editor->textCursor(); - const QTextBlock block = cursor.block(); - const int line = block.blockNumber() + 1; + const Utils::MultiTextCursor &cursors = m_editor->multiTextCursor(); + QString text; + if (cursors.hasMultipleCursors()) { + text = Tr::tr("Cursors: %2").arg(cursors.cursorCount()); + } else { + const QTextCursor cursor = cursors.mainCursor(); + const QTextBlock block = cursor.block(); + const int line = block.blockNumber() + 1; + const TabSettings &tabSettings = m_editor->textDocument()->tabSettings(); + const int column = tabSettings.columnAt(block.text(), cursor.positionInBlock()) + 1; + text = Tr::tr("Line: %1, Col: %2").arg(line).arg(column); + const QString toolTipText = Tr::tr("Cursor position: %1"); + setToolTip(toolTipText.arg(cursor.position())); + } + int selection = 0; + for (const QTextCursor &cursor : cursors) + selection += cursor.selectionEnd() - cursor.selectionStart(); + if (selection > 0) + text += " " + Tr::tr("(Sel: %1)").arg(selection); + setText(text); + } + + bool event(QEvent *event) override + { + if (event->type() != QEvent::ToolTip) + return FixedSizeClickLabel::event(event); + + QString tooltipText = "<table cellpadding='2'>\n"; + + const MultiTextCursor multiCursor = m_editor->multiTextCursor(); + const QList<QTextCursor> cursors = multiCursor.cursors().mid(0, 15); + + tooltipText += "<tr>"; + tooltipText += QString("<th align='left'>%1</th>").arg(Tr::tr("Cursors:")); + tooltipText += QString("<td>%1</td>").arg(multiCursor.cursorCount()); + tooltipText += "</tr>\n"; + + auto addRow = [&](const QString header, auto cellText) { + tooltipText += "<tr>"; + tooltipText += QString("<th align='left'>%1</th>").arg(header); + for (const QTextCursor &c : cursors) + tooltipText += QString("<td>%1</td>").arg(cellText(c)); + if (multiCursor.cursorCount() > cursors.count()) + tooltipText += QString("<td>...</td>"); + tooltipText += "</tr>\n"; + }; + + addRow(Tr::tr("Line:"), [](const QTextCursor &c) { return c.blockNumber() + 1; }); + const TabSettings &tabSettings = m_editor->textDocument()->tabSettings(); - const int column = tabSettings.columnAt(block.text(), cursor.positionInBlock()) + 1; - const QString text = Tr::tr("Line: %1, Col: %2"); - setText(text.arg(line).arg(column)); - const QString toolTipText = Tr::tr("Cursor position: %1"); - setToolTip(toolTipText.arg(QString::number(cursor.position()))); - QFont f = font(); - f.setItalic(m_editor->multiTextCursor().hasMultipleCursors()); - setFont(f); + addRow(Tr::tr("Column:"), [&](const QTextCursor &c) { + return tabSettings.columnAt(c.block().text(), c.positionInBlock()) + 1; + }); + + addRow(Tr::tr("Selection length:"), + [](const QTextCursor &c) { return c.selectionEnd() - c.selectionStart(); }); + + addRow(Tr::tr("Position in document:"), [](const QTextCursor &c) { return c.position(); }); + + addRow(Tr::tr("Anchor:"), [](const QTextCursor &c) { return c.anchor(); }); + + tooltipText += "</table>\n"; + + ToolTip::show(static_cast<const QHelpEvent *>(event)->globalPos(), + tooltipText, + Qt::RichText); + event->accept(); + return true; } TextEditorWidget *m_editor; From 57b6b8630c33df11a1bc5965037a7979ed8834d5 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 13:49:47 +0200 Subject: [PATCH 0196/1777] Core: Make IOptionPage::m_widget private The last irregular use was removed with e1e491d08. Change-Id: I2e483bd40c31c3d88ab28d7c8be0caad3b89ef0d Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/coreplugin/dialogs/ioptionspage.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index b63da5710c8..5b856f18056 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -77,9 +77,6 @@ protected: void setSettings(Utils::AspectContainer *settings); // FIXME: Remove. void setSettingsProvider(const std::function<Utils::AspectContainer *()> &provider); - // Used in FontSettingsPage. FIXME? - QPointer<QWidget> m_widget; // Used in conjunction with m_widgetCreator - private: Utils::Id m_id; Utils::Id m_category; @@ -87,6 +84,7 @@ private: QString m_displayCategory; Utils::Icon m_categoryIcon; WidgetCreator m_widgetCreator; + QPointer<QWidget> m_widget; // Used in conjunction with m_widgetCreator mutable bool m_keywordsInitialized = false; mutable QStringList m_keywords; From 2a731003cf7b6a85762c4e94d64c49dfa77be325 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 13:08:45 +0200 Subject: [PATCH 0197/1777] Core: Guard against pages that forgot to create their widgets This should not happen, but when it happens, the resulting crash is quite cryptic. Make it a bit more obvious. Change-Id: Icbe40206cfdbae93ccb072d7027fcaf109f2f39f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/coreplugin/dialogs/ioptionspage.cpp | 1 + src/plugins/coreplugin/dialogs/settingsdialog.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.cpp b/src/plugins/coreplugin/dialogs/ioptionspage.cpp index bd94fca9b97..31bf0069b9e 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.cpp +++ b/src/plugins/coreplugin/dialogs/ioptionspage.cpp @@ -132,6 +132,7 @@ QWidget *IOptionsPage::widget() if (!m_widget) { if (m_widgetCreator) { m_widget = m_widgetCreator(); + QTC_CHECK(m_widget); } else if (m_settingsProvider) { m_widget = new IOptionsPageWidget; AspectContainer *container = m_settingsProvider(); diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 9a9de241ab4..d4ff3250c4d 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -345,9 +345,12 @@ private: void showEvent(QShowEvent *event) final { if (!widget()) { - QWidget *inner = m_page->widget(); - setWidget(inner); - inner->setAutoFillBackground(false); + if (QWidget *inner = m_page->widget()) { + setWidget(inner); + inner->setAutoFillBackground(false); + } else { + QTC_CHECK(false); + } } QScrollArea::showEvent(event); From dbb1e04c779785416debb6f0e04c0ae104e3a2eb Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 11:33:41 +0200 Subject: [PATCH 0198/1777] Terminal: Use new settings creation pattern Does not delay much yet, as settings() is accessed in Plugin::extensionInitialized() Task-number: QTCREATORBUG-29167 Change-Id: I8f7c7fbef78c4ce0f92302e57a81f6216456c27b Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/terminal/terminalpane.cpp | 18 +-- src/plugins/terminal/terminalplugin.cpp | 8 +- src/plugins/terminal/terminalsettings.cpp | 150 ++++++++++++---------- src/plugins/terminal/terminalsettings.h | 8 +- src/plugins/terminal/terminalwidget.cpp | 32 ++--- 5 files changed, 111 insertions(+), 105 deletions(-) diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index d8144818fe6..1f6c87abbe2 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -72,13 +72,13 @@ TerminalPane::TerminalPane(QObject *parent) }); const auto updateEscButton = [this] { - m_escSettingButton->setChecked(TerminalSettings::instance().sendEscapeToTerminal()); + m_escSettingButton->setChecked(settings().sendEscapeToTerminal()); static const QString escKey = QKeySequence(Qt::Key_Escape).toString(QKeySequence::NativeText); static const QString shiftEsc = QKeySequence( QKeyCombination(Qt::ShiftModifier, Qt::Key_Escape)) .toString(QKeySequence::NativeText); - if (TerminalSettings::instance().sendEscapeToTerminal.value()) { + if (settings().sendEscapeToTerminal.value()) { m_escSettingButton->setText(escKey); m_escSettingButton->setToolTip(Tr::tr("Sends Esc to terminal instead of Qt Creator.")); } else { @@ -93,12 +93,12 @@ TerminalPane::TerminalPane(QObject *parent) updateEscButton(); connect(m_escSettingButton, &QToolButton::toggled, this, [this, updateEscButton] { - TerminalSettings::instance().sendEscapeToTerminal.setValue(m_escSettingButton->isChecked()); - TerminalSettings::instance().writeSettings(); + settings().sendEscapeToTerminal.setValue(m_escSettingButton->isChecked()); + settings().writeSettings(); updateEscButton(); }); - connect(&TerminalSettings::instance(), &TerminalSettings::applied, this, updateEscButton); + connect(&settings(), &TerminalSettings::applied, this, updateEscButton); } TerminalPane::~TerminalPane() {} @@ -142,7 +142,7 @@ void TerminalPane::openTerminal(const OpenTerminalParameters ¶meters) QFileIconProvider iconProvider; const FilePath command = parametersCopy.shellCommand ? parametersCopy.shellCommand->executable() - : TerminalSettings::instance().shell.filePath(); + : settings().shell.filePath(); icon = iconProvider.icon(command.toFileInfo()); } } @@ -250,10 +250,10 @@ void TerminalPane::initActions() createShellMenu(); lockKeyboard.setCheckable(true); - lockKeyboard.setChecked(TerminalSettings::instance().lockKeyboard()); + lockKeyboard.setChecked(settings().lockKeyboard()); auto updateLockKeyboard = [this](bool locked) { - TerminalSettings::instance().lockKeyboard.setValue(locked); + settings().lockKeyboard.setValue(locked); if (locked) { lockKeyboard.setIcon(LOCK_KEYBOARD_ICON.icon()); lockKeyboard.setToolTip(Tr::tr("Sends keyboard shortcuts to Terminal.")); @@ -263,7 +263,7 @@ void TerminalPane::initActions() } }; - updateLockKeyboard(TerminalSettings::instance().lockKeyboard()); + updateLockKeyboard(settings().lockKeyboard()); connect(&lockKeyboard, &QAction::toggled, this, updateLockKeyboard); newTerminal.setText(Tr::tr("New Terminal")); diff --git a/src/plugins/terminal/terminalplugin.cpp b/src/plugins/terminal/terminalplugin.cpp index 38b58b1722f..7940fb712b9 100644 --- a/src/plugins/terminal/terminalplugin.cpp +++ b/src/plugins/terminal/terminalplugin.cpp @@ -39,8 +39,6 @@ public: m_terminalPane = nullptr; } - void initialize() final { addManaged<TerminalSettings>(); } - void extensionsInitialized() final { m_terminalPane = new TerminalPane; @@ -61,8 +59,8 @@ public: static bool isEnabled = false; auto settingsChanged = [enable, disable] { - if (isEnabled != TerminalSettings::instance().enableTerminal()) { - isEnabled = TerminalSettings::instance().enableTerminal(); + if (isEnabled != settings().enableTerminal()) { + isEnabled = settings().enableTerminal(); if (isEnabled) enable(); else @@ -70,7 +68,7 @@ public: } }; - QObject::connect(&TerminalSettings::instance(), + QObject::connect(&settings(), &Utils::AspectContainer::applied, this, settingsChanged); diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index f0b9f201784..47811b230a7 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -6,6 +6,7 @@ #include "terminaltr.h" #include <coreplugin/icore.h> +#include <coreplugin/dialogs/ioptionspage.h> #include <utils/dropsupport.h> #include <utils/environment.h> @@ -90,13 +91,13 @@ static expected_str<void> loadXdefaults(const FilePath &path) const QString colorName = match.captured(1); const QColor color(match.captured(2)); if (colorName == "foreground") { - TerminalSettings::instance().foregroundColor.setVolatileValue(color); + settings().foregroundColor.setVolatileValue(color); } else if (colorName == "background") { - TerminalSettings::instance().backgroundColor.setVolatileValue(color); + settings().backgroundColor.setVolatileValue(color); } else { const int colorIndex = colorName.mid(5).toInt(); if (colorIndex >= 0 && colorIndex < 16) - TerminalSettings::instance().colors[colorIndex].setVolatileValue(color); + settings().colors[colorIndex].setVolatileValue(color); } } } @@ -152,14 +153,14 @@ static expected_str<void> loadItermColors(const FilePath &path) const auto c = colorName.mid(5, 2); const int colorIndex = c.toInt(); if (colorIndex >= 0 && colorIndex < 16) - TerminalSettings::instance().colors[colorIndex].setVolatileValue( + settings().colors[colorIndex].setVolatileValue( color); } else if (colorName == "Foreground Color") { - TerminalSettings::instance().foregroundColor.setVolatileValue(color); + settings().foregroundColor.setVolatileValue(color); } else if (colorName == "Background Color") { - TerminalSettings::instance().backgroundColor.setVolatileValue(color); + settings().backgroundColor.setVolatileValue(color); } else if (colorName == "Selection Color") { - TerminalSettings::instance().selectionColor.setVolatileValue(color); + settings().selectionColor.setVolatileValue(color); } } } @@ -196,33 +197,33 @@ static expected_str<void> loadVsCodeColors(const FilePath &path) // clang-format off const QList<QPair<QStringView, ColorAspect *>> colorKeys = { - qMakePair(u"editor.background", &TerminalSettings::instance().backgroundColor), - qMakePair(u"terminal.foreground", &TerminalSettings::instance().foregroundColor), - qMakePair(u"terminal.selectionBackground", &TerminalSettings::instance().selectionColor), + qMakePair(u"editor.background", &settings().backgroundColor), + qMakePair(u"terminal.foreground", &settings().foregroundColor), + qMakePair(u"terminal.selectionBackground", &settings().selectionColor), - qMakePair(u"terminal.ansiBlack", &TerminalSettings::instance().colors[0]), - qMakePair(u"terminal.ansiBrightBlack", &TerminalSettings::instance().colors[8]), + qMakePair(u"terminal.ansiBlack", &settings().colors[0]), + qMakePair(u"terminal.ansiBrightBlack", &settings().colors[8]), - qMakePair(u"terminal.ansiRed", &TerminalSettings::instance().colors[1]), - qMakePair(u"terminal.ansiBrightRed", &TerminalSettings::instance().colors[9]), + qMakePair(u"terminal.ansiRed", &settings().colors[1]), + qMakePair(u"terminal.ansiBrightRed", &settings().colors[9]), - qMakePair(u"terminal.ansiGreen", &TerminalSettings::instance().colors[2]), - qMakePair(u"terminal.ansiBrightGreen", &TerminalSettings::instance().colors[10]), + qMakePair(u"terminal.ansiGreen", &settings().colors[2]), + qMakePair(u"terminal.ansiBrightGreen", &settings().colors[10]), - qMakePair(u"terminal.ansiYellow", &TerminalSettings::instance().colors[3]), - qMakePair(u"terminal.ansiBrightYellow", &TerminalSettings::instance().colors[11]), + qMakePair(u"terminal.ansiYellow", &settings().colors[3]), + qMakePair(u"terminal.ansiBrightYellow", &settings().colors[11]), - qMakePair(u"terminal.ansiBlue", &TerminalSettings::instance().colors[4]), - qMakePair(u"terminal.ansiBrightBlue", &TerminalSettings::instance().colors[12]), + qMakePair(u"terminal.ansiBlue", &settings().colors[4]), + qMakePair(u"terminal.ansiBrightBlue", &settings().colors[12]), - qMakePair(u"terminal.ansiMagenta", &TerminalSettings::instance().colors[5]), - qMakePair(u"terminal.ansiBrightMagenta", &TerminalSettings::instance().colors[13]), + qMakePair(u"terminal.ansiMagenta", &settings().colors[5]), + qMakePair(u"terminal.ansiBrightMagenta", &settings().colors[13]), - qMakePair(u"terminal.ansiCyan", &TerminalSettings::instance().colors[6]), - qMakePair(u"terminal.ansiBrightCyan", &TerminalSettings::instance().colors[14]), + qMakePair(u"terminal.ansiCyan", &settings().colors[6]), + qMakePair(u"terminal.ansiBrightCyan", &settings().colors[14]), - qMakePair(u"terminal.ansiWhite", &TerminalSettings::instance().colors[7]), - qMakePair(u"terminal.ansiBrightWhite", &TerminalSettings::instance().colors[15]) + qMakePair(u"terminal.ansiWhite", &settings().colors[7]), + qMakePair(u"terminal.ansiBrightWhite", &settings().colors[15]) }; // clang-format on @@ -247,8 +248,6 @@ static expected_str<void> loadVsCodeColors(const FilePath &path) static expected_str<void> loadKonsoleColorScheme(const FilePath &path) { - QSettings settings(path.toFSPathString(), QSettings::IniFormat); - auto parseColor = [](const QStringList &parts) -> expected_str<QColor> { if (parts.size() != 3 && parts.size() != 4) return make_unexpected(Tr::tr("Invalid color format.")); @@ -257,39 +256,41 @@ static expected_str<void> loadKonsoleColorScheme(const FilePath &path) }; // clang-format off - const QList<QPair<QString, ColorAspect *>> colorKeys = { - qMakePair(QLatin1String("Background/Color"), &TerminalSettings::instance().backgroundColor), - qMakePair(QLatin1String("Foreground/Color"), &TerminalSettings::instance().foregroundColor), + TerminalSettings &s = settings(); + const QPair<QString, ColorAspect *> colorKeys[] = { + { "Background/Color", &s.backgroundColor }, + { "Foreground/Color", &s.foregroundColor}, - qMakePair(QLatin1String("Color0/Color"), &TerminalSettings::instance().colors[0]), - qMakePair(QLatin1String("Color0Intense/Color"), &TerminalSettings::instance().colors[8]), + { "Color0/Color", &s.colors[0] }, + { "Color0Intense/Color", &s.colors[8] }, - qMakePair(QLatin1String("Color1/Color"), &TerminalSettings::instance().colors[1]), - qMakePair(QLatin1String("Color1Intense/Color"), &TerminalSettings::instance().colors[9]), + { "Color1/Color", &s.colors[1] }, + { "Color1Intense/Color", &s.colors[9] }, - qMakePair(QLatin1String("Color2/Color"), &TerminalSettings::instance().colors[2]), - qMakePair(QLatin1String("Color2Intense/Color"), &TerminalSettings::instance().colors[10]), + { "Color2/Color", &s.colors[2] }, + { "Color2Intense/Color", &s.colors[10] }, - qMakePair(QLatin1String("Color3/Color"), &TerminalSettings::instance().colors[3]), - qMakePair(QLatin1String("Color3Intense/Color"), &TerminalSettings::instance().colors[11]), + { "Color3/Color", &s.colors[3] }, + { "Color3Intense/Color", &s.colors[11] }, - qMakePair(QLatin1String("Color4/Color"), &TerminalSettings::instance().colors[4]), - qMakePair(QLatin1String("Color4Intense/Color"), &TerminalSettings::instance().colors[12]), + { "Color4/Color", &s.colors[4] }, + { "Color4Intense/Color", &s.colors[12] }, - qMakePair(QLatin1String("Color5/Color"), &TerminalSettings::instance().colors[5]), - qMakePair(QLatin1String("Color5Intense/Color"), &TerminalSettings::instance().colors[13]), + { "Color5/Color", &s.colors[5] }, + { "Color5Intense/Color", &s.colors[13] }, - qMakePair(QLatin1String("Color6/Color"), &TerminalSettings::instance().colors[6]), - qMakePair(QLatin1String("Color6Intense/Color"), &TerminalSettings::instance().colors[14]), + { "Color6/Color", &s.colors[6] }, + { "Color6Intense/Color", &s.colors[14] }, - qMakePair(QLatin1String("Color7/Color"), &TerminalSettings::instance().colors[7]), - qMakePair(QLatin1String("Color7Intense/Color"), &TerminalSettings::instance().colors[15]) + { "Color7/Color", &s.colors[7] }, + { "Color7Intense/Color", &s.colors[15] } }; // clang-format on + QSettings ini(path.toFSPathString(), QSettings::IniFormat); for (const auto &colorKey : colorKeys) { - if (settings.contains(colorKey.first)) { - const auto color = parseColor(settings.value(colorKey.first).toStringList()); + if (ini.contains(colorKey.first)) { + const auto color = parseColor(ini.value(colorKey.first).toStringList()); if (!color) return make_unexpected(color.error()); @@ -313,26 +314,25 @@ static expected_str<void> loadXFCE4ColorScheme(const FilePath &path) f.write(*arr); f.close(); - QSettings settings(f.fileName(), QSettings::IniFormat); + QSettings ini(f.fileName(), QSettings::IniFormat); + TerminalSettings &s = settings(); // clang-format off - const QList<QPair<QString, ColorAspect *>> colorKeys = { - qMakePair(QLatin1String("Scheme/ColorBackground"), &TerminalSettings::instance().backgroundColor), - qMakePair(QLatin1String("Scheme/ColorForeground"), &TerminalSettings::instance().foregroundColor), + const QPair<QString, ColorAspect *> colorKeys[] = { + { "Scheme/ColorBackground", &s.backgroundColor }, + { "Scheme/ColorForeground", &s.foregroundColor } }; // clang-format on for (const auto &colorKey : colorKeys) { - if (settings.contains(colorKey.first)) { - colorKey.second->setVolatileValue(QColor(settings.value(colorKey.first).toString())); - } + if (ini.contains(colorKey.first)) + colorKey.second->setVolatileValue(QColor(ini.value(colorKey.first).toString())); } - QStringList colors = settings.value(QLatin1String("Scheme/ColorPalette")).toStringList(); + QStringList colors = ini.value(QLatin1String("Scheme/ColorPalette")).toStringList(); int i = 0; - for (const auto &color : colors) { - TerminalSettings::instance().colors[i++].setVolatileValue(QColor(color)); - } + for (const QString &color : colors) + s.colors[i++].setVolatileValue(QColor(color)); return {}; } @@ -353,23 +353,15 @@ static expected_str<void> loadColorScheme(const FilePath &path) return make_unexpected(Tr::tr("Unknown color scheme format.")); } -static TerminalSettings *s_instance; - -TerminalSettings &TerminalSettings::instance() +TerminalSettings &settings() { - return *s_instance; + static TerminalSettings theSettings; + return theSettings; } TerminalSettings::TerminalSettings() { - s_instance = this; - setSettingsGroup("Terminal"); - setId("Terminal.General"); - setDisplayName("Terminal"); - setCategory("ZY.Terminal"); - setDisplayCategory("Terminal"); - setCategoryIconPath(":/terminal/images/settingscategory_terminal.png"); enableTerminal.setSettingsKey("EnableTerminal"); enableTerminal.setLabelText(Tr::tr("Use internal terminal")); @@ -587,4 +579,20 @@ TerminalSettings::TerminalSettings() readSettings(); } +class TerminalSettingsPage final : public Core::IOptionsPage +{ +public: + TerminalSettingsPage() + { + setId("Terminal.General"); + setDisplayName("Terminal"); + setCategory("ZY.Terminal"); + setDisplayCategory("Terminal"); + setCategoryIconPath(":/terminal/images/settingscategory_terminal.png"); + setSettingsProvider([] { return &settings(); }); + } +}; + +const TerminalSettingsPage settingsPage; + } // Terminal diff --git a/src/plugins/terminal/terminalsettings.h b/src/plugins/terminal/terminalsettings.h index 1c07f9ab033..e253abf69e8 100644 --- a/src/plugins/terminal/terminalsettings.h +++ b/src/plugins/terminal/terminalsettings.h @@ -3,17 +3,15 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> namespace Terminal { -class TerminalSettings : public Core::PagedSettings +class TerminalSettings : public Utils::AspectContainer { public: TerminalSettings(); - static TerminalSettings &instance(); - Utils::BoolAspect enableTerminal{this}; Utils::StringAspect font{this}; @@ -35,4 +33,6 @@ public: Utils::BoolAspect lockKeyboard{this}; }; +TerminalSettings &settings(); + } // Terminal diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 98877b841f0..4e88071a94f 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -126,7 +126,7 @@ TerminalWidget::TerminalWidget(QWidget *parent, const OpenTerminalParameters &op verticalScrollBar()->triggerAction(QAbstractSlider::SliderSingleStepAdd); }); - connect(&TerminalSettings::instance(), &AspectContainer::applied, this, [this] { + connect(&settings(), &AspectContainer::applied, this, [this] { // Setup colors first, as setupFont will redraw the screen. setupColors(); setupFont(); @@ -143,8 +143,8 @@ void TerminalWidget::setupPty() m_process = std::make_unique<Process>(); CommandLine shellCommand = m_openParameters.shellCommand.value_or( - CommandLine{TerminalSettings::instance().shell(), - TerminalSettings::instance().shellArguments.value(), + CommandLine{settings().shell(), + settings().shellArguments.value(), CommandLine::Raw}); Environment env = m_openParameters.environment.value_or(Environment{}) @@ -230,8 +230,8 @@ void TerminalWidget::setupFont() { QFont f; f.setFixedPitch(true); - f.setFamily(TerminalSettings::instance().font.value()); - f.setPointSize(TerminalSettings::instance().fontSize.value()); + f.setFamily(settings().font.value()); + f.setPointSize(settings().fontSize.value()); setFont(f); } @@ -241,12 +241,12 @@ void TerminalWidget::setupColors() // Check if the colors have changed. std::array<QColor, 20> newColors; for (int i = 0; i < 16; ++i) { - newColors[i] = TerminalSettings::instance().colors[i].value(); + newColors[i] = settings().colors[i].value(); } - newColors[ColorIndex::Background] = TerminalSettings::instance().backgroundColor.value(); - newColors[ColorIndex::Foreground] = TerminalSettings::instance().foregroundColor.value(); - newColors[ColorIndex::Selection] = TerminalSettings::instance().selectionColor.value(); - newColors[ColorIndex::FindMatch] = TerminalSettings::instance().findMatchColor.value(); + newColors[ColorIndex::Background] = settings().backgroundColor.value(); + newColors[ColorIndex::Foreground] = settings().foregroundColor.value(); + newColors[ColorIndex::Selection] = settings().selectionColor.value(); + newColors[ColorIndex::FindMatch] = settings().findMatchColor.value(); if (m_currentColors == newColors) return; @@ -401,7 +401,7 @@ void TerminalWidget::setupSurface() verticalScrollBar()->setValue(verticalScrollBar()->maximum()); }); connect(m_surface.get(), &Internal::TerminalSurface::bell, this, [] { - if (TerminalSettings::instance().audibleBell.value()) + if (settings().audibleBell.value()) QApplication::beep(); }); connect(m_surface.get(), @@ -438,7 +438,7 @@ void TerminalWidget::setupSurface() void TerminalWidget::configBlinkTimer() { bool shouldRun = m_cursor.visible && m_cursor.blink && hasFocus() - && TerminalSettings::instance().allowBlinkingCursor.value(); + && settings().allowBlinkingCursor.value(); if (shouldRun != m_cursorBlinkTimer.isActive()) { if (shouldRun) m_cursorBlinkTimer.start(); @@ -1006,7 +1006,7 @@ void TerminalWidget::paintCursor(QPainter &p) const cursor.shape = Internal::Cursor::Shape::Underline; const bool blinkState = !cursor.blink || m_cursorBlinkState - || !TerminalSettings::instance().allowBlinkingCursor.value(); + || !settings().allowBlinkingCursor.value(); if (cursor.visible && blinkState) { const int cursorCellWidth = m_surface->cellWidthAt(cursor.position.x(), cursor.position.y()); @@ -1162,7 +1162,7 @@ void TerminalWidget::keyPressEvent(QKeyEvent *event) } if (event->key() == Qt::Key_Escape) { - bool sendToTerminal = TerminalSettings::instance().sendEscapeToTerminal.value(); + bool sendToTerminal = settings().sendEscapeToTerminal.value(); bool send = false; if (sendToTerminal && event->modifiers() == Qt::NoModifier) send = true; @@ -1570,7 +1570,7 @@ void TerminalWidget::showEvent(QShowEvent *event) bool TerminalWidget::event(QEvent *event) { - if (TerminalSettings::instance().lockKeyboard() && event->type() == QEvent::ShortcutOverride) { + if (settings().lockKeyboard() && event->type() == QEvent::ShortcutOverride) { event->accept(); return true; } @@ -1584,7 +1584,7 @@ bool TerminalWidget::event(QEvent *event) if (event->type() == QEvent::KeyPress) { auto k = static_cast<QKeyEvent *>(event); - if (TerminalSettings::instance().lockKeyboard() && m_shortcutMap.tryShortcut(k)) + if (settings().lockKeyboard() && m_shortcutMap.tryShortcut(k)) return true; keyPressEvent(k); From 299fdb9b80391afe90212874ffe156430ffe2d94 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 5 Jul 2023 17:30:03 +0200 Subject: [PATCH 0199/1777] Nim: Use aspects more directly in nimble related runconfigs Task-number: QTCREATORBUG-29168 Change-Id: Ib5ee6d3941903d600adda628ff856b072c8fee4d Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../nim/project/nimblerunconfiguration.cpp | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/src/plugins/nim/project/nimblerunconfiguration.cpp b/src/plugins/nim/project/nimblerunconfiguration.cpp index 97b4e3c82a0..e23942f8c4f 100644 --- a/src/plugins/nim/project/nimblerunconfiguration.cpp +++ b/src/plugins/nim/project/nimblerunconfiguration.cpp @@ -11,10 +11,8 @@ #include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/target.h> -#include <utils/algorithm.h> -#include <utils/environment.h> - using namespace ProjectExplorer; +using namespace Utils; namespace Nim { @@ -23,34 +21,34 @@ namespace Nim { class NimbleRunConfiguration : public RunConfiguration { public: - NimbleRunConfiguration(Target *target, Utils::Id id) + NimbleRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto envAspect = addAspect<EnvironmentAspect>(); - envAspect->setSupportForBuildEnvironment(target); + environment.setSupportForBuildEnvironment(target); - auto exeAspect = addAspect<ExecutableAspect>(); - exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); + executable.setDeviceSelector(target, ExecutableAspect::RunDevice); - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); + arguments.setMacroExpander(macroExpander()); - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); - - addAspect<TerminalAspect>(); + workingDir.setMacroExpander(macroExpander()); setUpdater([this] { BuildTargetInfo bti = buildTargetInfo(); setDisplayName(bti.displayName); setDefaultDisplayName(bti.displayName); - aspect<ExecutableAspect>()->setExecutable(bti.targetFilePath); - aspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(bti.workingDirectory); + executable.setExecutable(bti.targetFilePath); + workingDir.setDefaultWorkingDirectory(bti.workingDirectory); }); connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); update(); } + + EnvironmentAspect environment{this}; + ExecutableAspect executable{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; + TerminalAspect terminal{this}; }; NimbleRunConfigurationFactory::NimbleRunConfigurationFactory() @@ -67,26 +65,26 @@ NimbleRunConfigurationFactory::NimbleRunConfigurationFactory() class NimbleTestConfiguration : public RunConfiguration { public: - NimbleTestConfiguration(ProjectExplorer::Target *target, Utils::Id id) + NimbleTestConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto exeAspect = addAspect<ExecutableAspect>(); - exeAspect->setDeviceSelector(target, ExecutableAspect::BuildDevice); - exeAspect->setExecutable(Nim::nimblePathFromKit(target->kit())); - - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); - argsAspect->setArguments("test"); - - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); - workingDirAspect->setDefaultWorkingDirectory(project()->projectDirectory()); - - addAspect<TerminalAspect>(); - setDisplayName(Tr::tr("Nimble Test")); setDefaultDisplayName(Tr::tr("Nimble Test")); + + executable.setDeviceSelector(target, ExecutableAspect::BuildDevice); + executable.setExecutable(Nim::nimblePathFromKit(kit())); + + arguments.setMacroExpander(macroExpander()); + arguments.setArguments("test"); + + workingDir.setMacroExpander(macroExpander()); + workingDir.setDefaultWorkingDirectory(project()->projectDirectory()); } + + ExecutableAspect executable{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; + TerminalAspect terminal{this}; }; NimbleTestConfigurationFactory::NimbleTestConfigurationFactory() From 20700feb84d16b59456031d69c460f52c3db159a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 14:06:00 +0200 Subject: [PATCH 0200/1777] VcsBase: Proliferate FilePath use a tiny bit Change-Id: I78929f6036702fe0b5384f4324f6283c2129d91b Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/vcsbase/vcsbasesubmiteditor.cpp | 14 +++++++------- src/plugins/vcsbase/vcsbasesubmiteditor.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index 03eaa49c857..7d18d1de851 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -521,7 +521,7 @@ void VcsBaseSubmitEditor::slotCheckSubmitMessage() bool VcsBaseSubmitEditor::checkSubmitMessage(QString *errorMessage) const { - const QString checkScript = commonSettings().submitMessageCheckScript.value(); + const FilePath checkScript = commonSettings().submitMessageCheckScript(); if (checkScript.isEmpty()) return true; QApplication::setOverrideCursor(Qt::WaitCursor); @@ -530,17 +530,17 @@ bool VcsBaseSubmitEditor::checkSubmitMessage(QString *errorMessage) const return rc; } -static QString msgCheckScript(const FilePath &workingDir, const QString &cmd) +static QString msgCheckScript(const FilePath &workingDir, const FilePath &cmd) { - const QString nativeCmd = QDir::toNativeSeparators(cmd); + const QString nativeCmd = cmd.toUserOutput(); return workingDir.isEmpty() ? Tr::tr("Executing %1").arg(nativeCmd) : - Tr::tr("Executing [%1] %2"). - arg(workingDir.toUserOutput(), nativeCmd); + Tr::tr("Executing [%1] %2").arg(workingDir.toUserOutput(), nativeCmd); } -bool VcsBaseSubmitEditor::runSubmitMessageCheckScript(const QString &checkScript, QString *errorMessage) const +bool VcsBaseSubmitEditor::runSubmitMessageCheckScript(const FilePath &checkScript, QString *errorMessage) const { + QTC_ASSERT(!checkScript.needsDevice(), return false); // Not supported below. // Write out message TempFileSaver saver(TemporaryDirectory::masterDirectoryPath() + "/msgXXXXXX.txt"); saver.write(fileContents()); @@ -552,7 +552,7 @@ bool VcsBaseSubmitEditor::runSubmitMessageCheckScript(const QString &checkScript Process checkProcess; if (!d->m_checkScriptWorkingDirectory.isEmpty()) checkProcess.setWorkingDirectory(d->m_checkScriptWorkingDirectory); - checkProcess.setCommand({FilePath::fromString(checkScript), {saver.filePath().toString()}}); + checkProcess.setCommand({checkScript, {saver.filePath().path()}}); checkProcess.start(); const bool succeeded = checkProcess.waitForFinished(); diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.h b/src/plugins/vcsbase/vcsbasesubmiteditor.h index 38540386664..5277b3efcf6 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.h +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.h @@ -116,7 +116,7 @@ private: void createUserFields(const QString &fieldConfigFile); bool checkSubmitMessage(QString *errorMessage) const; - bool runSubmitMessageCheckScript(const QString &script, QString *errorMessage) const; + bool runSubmitMessageCheckScript(const Utils::FilePath &script, QString *errorMessage) const; QString promptForNickName(); void close(); From 5330e4bc317dd0fde28ef0f101ede1017df87b91 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 10:15:53 +0200 Subject: [PATCH 0201/1777] Autotools: Use string aspect directly in configure step Task-number: QTCREATORBUG-29168 Change-Id: I5c9a69fff51f01d5498eba6bbdf676be22fe5e82 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../autotoolsprojectmanager/configurestep.cpp | 60 +++++++++---------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/src/plugins/autotoolsprojectmanager/configurestep.cpp b/src/plugins/autotoolsprojectmanager/configurestep.cpp index 6975a1cd91a..2eaf905f5a6 100644 --- a/src/plugins/autotoolsprojectmanager/configurestep.cpp +++ b/src/plugins/autotoolsprojectmanager/configurestep.cpp @@ -37,48 +37,42 @@ namespace AutotoolsProjectManager::Internal { class ConfigureStep final : public AbstractProcessStep { public: - ConfigureStep(BuildStepList *bsl, Id id); + ConfigureStep(BuildStepList *bsl, Id id) + : AbstractProcessStep(bsl, id) + { + arguments.setDisplayStyle(StringAspect::LineEditDisplay); + arguments.setSettingsKey("AutotoolsProjectManager.ConfigureStep.AdditionalArguments"); + arguments.setLabelText(Tr::tr("Arguments:")); + arguments.setHistoryCompleter("AutotoolsPM.History.ConfigureArgs"); - void setAdditionalArguments(const QString &list); + connect(&arguments, &BaseAspect::changed, this, [this] { + m_runConfigure = true; + }); + + setCommandLineProvider([this] { + return getCommandLine(arguments()); + }); + + setSummaryUpdater([this] { + ProcessParameters param; + setupProcessParameters(¶m); + + return param.summaryInWorkdir(displayName()); + }); + } private: void doRun() final; - CommandLine getCommandLine(const QString &arguments); + CommandLine getCommandLine(const QString &arguments) + { + return {project()->projectDirectory() / "configure", arguments, CommandLine::Raw}; + } bool m_runConfigure = false; + StringAspect arguments{this}; }; -ConfigureStep::ConfigureStep(BuildStepList *bsl, Id id) - : AbstractProcessStep(bsl, id) -{ - auto arguments = addAspect<StringAspect>(); - arguments->setDisplayStyle(StringAspect::LineEditDisplay); - arguments->setSettingsKey("AutotoolsProjectManager.ConfigureStep.AdditionalArguments"); - arguments->setLabelText(Tr::tr("Arguments:")); - arguments->setHistoryCompleter("AutotoolsPM.History.ConfigureArgs"); - - connect(arguments, &BaseAspect::changed, this, [this] { - m_runConfigure = true; - }); - - setCommandLineProvider([this, arguments] { - return getCommandLine(arguments->value()); - }); - - setSummaryUpdater([this] { - ProcessParameters param; - setupProcessParameters(¶m); - - return param.summaryInWorkdir(displayName()); - }); -} - -CommandLine ConfigureStep::getCommandLine(const QString &arguments) -{ - return {project()->projectDirectory() / "configure", arguments, CommandLine::Raw}; -} - void ConfigureStep::doRun() { // Check whether we need to run configure From 3057fa40494147283be21cadcf69800af7ecfe17 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 10:19:17 +0200 Subject: [PATCH 0202/1777] Nim: Use arguments aspect directly in NimbleBuildStep Task-number: QTCREATORBUG-29168 Change-Id: I26a343cd9b88f3b199cfecbd6020aed67a5db33b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/nim/project/nimblebuildstep.cpp | 76 ++++++++++----------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/src/plugins/nim/project/nimblebuildstep.cpp b/src/plugins/nim/project/nimblebuildstep.cpp index ca9b5a4b2a8..0177ce2d1b8 100644 --- a/src/plugins/nim/project/nimblebuildstep.cpp +++ b/src/plugins/nim/project/nimblebuildstep.cpp @@ -18,47 +18,51 @@ using namespace Utils; namespace Nim { -class NimbleBuildStep : public AbstractProcessStep +class NimbleBuildStep final : public AbstractProcessStep { public: - NimbleBuildStep(BuildStepList *parentList, Id id); + NimbleBuildStep(BuildStepList *parentList, Id id) + : AbstractProcessStep(parentList, id) + { + arguments.setMacroExpander(macroExpander()); + arguments.setSettingsKey(Constants::C_NIMBLEBUILDSTEP_ARGUMENTS); + arguments.setResetter([this] { return defaultArguments(); }); + arguments.setArguments(defaultArguments()); + + setCommandLineProvider([this] { + return CommandLine(Nim::nimblePathFromKit(kit()), {"build", arguments.arguments()}); + }); + setWorkingDirectoryProvider([this] { return project()->projectDirectory(); }); + setEnvironmentModifier([this](Environment &env) { + env.appendOrSetPath(Nim::nimPathFromKit(kit())); + }); + + setSummaryUpdater([this] { + ProcessParameters param; + setupProcessParameters(¶m); + return param.summary(displayName()); + }); + + QTC_ASSERT(buildConfiguration(), return); + QObject::connect(buildConfiguration(), &BuildConfiguration::buildTypeChanged, + &arguments, &ArgumentsAspect::resetArguments); + QObject::connect(&arguments, &BaseAspect::changed, + this, &AbstractProcessStep::updateSummary); + } void setupOutputFormatter(OutputFormatter *formatter) final; private: - QString defaultArguments() const; + QString defaultArguments() const + { + if (buildType() == BuildConfiguration::Debug) + return {"--debugger:native"}; + return {}; + } + + ArgumentsAspect arguments{this}; }; -NimbleBuildStep::NimbleBuildStep(BuildStepList *parentList, Id id) - : AbstractProcessStep(parentList, id) -{ - auto arguments = addAspect<ArgumentsAspect>(); - arguments->setMacroExpander(macroExpander()); - arguments->setSettingsKey(Constants::C_NIMBLEBUILDSTEP_ARGUMENTS); - arguments->setResetter([this] { return defaultArguments(); }); - arguments->setArguments(defaultArguments()); - - setCommandLineProvider([this, arguments] { - return CommandLine(Nim::nimblePathFromKit(kit()), {"build", arguments->arguments()}); - }); - setWorkingDirectoryProvider([this] { return project()->projectDirectory(); }); - setEnvironmentModifier([this](Environment &env) { - env.appendOrSetPath(Nim::nimPathFromKit(kit())); - }); - - setSummaryUpdater([this] { - ProcessParameters param; - setupProcessParameters(¶m); - return param.summary(displayName()); - }); - - QTC_ASSERT(buildConfiguration(), return); - QObject::connect(buildConfiguration(), &BuildConfiguration::buildTypeChanged, - arguments, &ArgumentsAspect::resetArguments); - QObject::connect(arguments, &ArgumentsAspect::changed, - this, &AbstractProcessStep::updateSummary); -} - void NimbleBuildStep::setupOutputFormatter(OutputFormatter *formatter) { const auto parser = new NimParser(); @@ -67,12 +71,6 @@ void NimbleBuildStep::setupOutputFormatter(OutputFormatter *formatter) AbstractProcessStep::setupOutputFormatter(formatter); } -QString NimbleBuildStep::defaultArguments() const -{ - if (buildType() == BuildConfiguration::Debug) - return {"--debugger:native"}; - return {}; -} NimbleBuildStepFactory::NimbleBuildStepFactory() { From 0822f28998850db65b0398cf480f59dfdbd765bf Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 4 Jul 2023 14:31:15 +0200 Subject: [PATCH 0203/1777] Python: improve python interpreter wizard page Change-Id: I38215f1aaefbccc4e8c22957bf85c01e68df3c1a Reviewed-by: hjk <hjk@qt.io> --- src/plugins/python/pythonwizardpage.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/plugins/python/pythonwizardpage.cpp b/src/plugins/python/pythonwizardpage.cpp index 97e772fc237..bfd7359fafb 100644 --- a/src/plugins/python/pythonwizardpage.cpp +++ b/src/plugins/python/pythonwizardpage.cpp @@ -112,13 +112,12 @@ PythonWizardPage::PythonWizardPage(const QList<QPair<QString, QVariant>> &pySide connect(&m_venvPath, &StringAspect::validChanged, this, &PythonWizardPage::updateStateLabel); connect(&m_createVenv, &BaseAspect::changed, this, &PythonWizardPage::updateStateLabel); - Grid { - m_pySideVersion, br, - m_interpreter, br, - m_createVenv, br, + Form { + m_pySideVersion, st, br, + m_interpreter, st, br, + m_createVenv, st, br, m_venvPath, br, - m_stateLabel, br, - noMargin + m_stateLabel, br }.attachTo(this); } From 3e155919ebe3b82eb6e64815c345e7c6e6eca431 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 17:06:20 +0200 Subject: [PATCH 0204/1777] CMake: Use current pattern to access main settings page Change-Id: I95c556bebe1d583879b6702f727d9a859b9a4bcb Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../cmakebuildconfiguration.cpp | 20 +++++------- .../cmakeprojectmanager/cmakebuildsystem.cpp | 3 +- .../cmakekitinformation.cpp | 3 +- .../cmakeprojectmanager/cmakeprocess.cpp | 2 +- .../cmakeprojectmanager.cpp | 4 +-- .../cmakeprojectplugin.cpp | 2 -- .../cmakespecificsettings.cpp | 31 ++++++++++++------- .../cmakespecificsettings.h | 8 ++--- .../cmakeprojectmanager/cmaketoolmanager.cpp | 8 ++--- .../cmaketoolsettingsaccessor.cpp | 4 +-- .../fileapidataextractor.cpp | 3 +- .../cmakeprojectmanager/fileapireader.cpp | 3 +- 12 files changed, 43 insertions(+), 48 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 741d91efb66..3941f9254a4 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -299,9 +299,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : m_batchEditButton->setToolTip(Tr::tr("Set or reset multiple values in the CMake configuration.")); m_showAdvancedCheckBox = new QCheckBox(Tr::tr("Advanced")); - - auto settings = CMakeSpecificSettings::instance(); - m_showAdvancedCheckBox->setChecked(settings->showAdvancedOptionsByDefault.value()); + m_showAdvancedCheckBox->setChecked(settings().showAdvancedOptionsByDefault()); connect(m_configView->selectionModel(), &QItemSelectionModel::selectionChanged, this, [this](const QItemSelection &, const QItemSelection &) { @@ -589,20 +587,18 @@ void CMakeBuildSettingsWidget::batchEditConfiguration() void CMakeBuildSettingsWidget::reconfigureWithInitialParameters() { - auto settings = CMakeSpecificSettings::instance(); QMessageBox::StandardButton reply = CheckableMessageBox::question( Core::ICore::dialogParent(), Tr::tr("Re-configure with Initial Parameters"), Tr::tr("Clear CMake configuration and configure with initial parameters?"), - settings->askBeforeReConfigureInitialParams.askAgainCheckableDecider(), + settings().askBeforeReConfigureInitialParams.askAgainCheckableDecider(), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); - settings->writeSettings(); + settings().writeSettings(); - if (reply != QMessageBox::Yes) { + if (reply != QMessageBox::Yes) return; - } m_buildSystem->clearCMakeCache(); @@ -1135,7 +1131,7 @@ static CommandLine defaultInitialCMakeCommand(const Kit *k, const QString buildT cmd.addArg("-DCMAKE_BUILD_TYPE:STRING=" + buildType); // Package manager auto setup - if (Internal::CMakeSpecificSettings::instance()->packageManagerAutoSetup.value()) { + if (settings().packageManagerAutoSetup()) { cmd.addArg(QString("-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=" "%{BuildConfig:BuildDirectory:NativeFilePath}/%1/auto-setup.cmake") .arg(Constants::PACKAGE_MANAGER_DIR)); @@ -2059,11 +2055,9 @@ void CMakeBuildConfiguration::addToEnvironment(Utils::Environment &env) const if (tool && tool->cmakeExecutable().needsDevice()) return; - auto settings = CMakeSpecificSettings::instance(); - if (!settings->ninjaPath().isEmpty()) { - const Utils::FilePath ninja = settings->ninjaPath(); + const FilePath ninja = settings().ninjaPath(); + if (!ninja.isEmpty()) env.appendOrSetPath(ninja.isFile() ? ninja.parentDir() : ninja); - } } Environment CMakeBuildConfiguration::configureEnvironment() const diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 1ab8012d410..ebe650581b1 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1190,8 +1190,7 @@ void CMakeBuildSystem::wireUpConnections() connect(project(), &Project::projectFileIsDirty, this, [this] { if (buildConfiguration()->isActive() && !isParsing()) { - auto settings = CMakeSpecificSettings::instance(); - if (settings->autorunCMake.value()) { + if (settings().autorunCMake()) { qCDebug(cmakeBuildSystemLog) << "Requesting parse due to dirty project file"; reparse(CMakeBuildSystem::REPARSE_FORCE_CMAKE_RUN); } diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index d461f110c3d..14ee7fa6a8b 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -648,8 +648,7 @@ QVariant CMakeGeneratorKitAspect::defaultValue(const Kit *k) const }); if (it != known.constEnd()) { const bool hasNinja = [k, tool] { - auto settings = Internal::CMakeSpecificSettings::instance(); - if (settings->ninjaPath().isEmpty()) { + if (Internal::settings().ninjaPath().isEmpty()) { auto findNinja = [](const Environment &env) -> bool { return !env.searchInPath("ninja").isEmpty(); }; diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index 809d508f46a..b9eb017b94b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -101,7 +101,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & } // Copy the "package-manager" CMake code from the ${IDE:ResourcePath} to the build directory - if (Internal::CMakeSpecificSettings::instance()->packageManagerAutoSetup.value()) { + if (settings().packageManagerAutoSetup()) { const FilePath localPackageManagerDir = buildDirectory.pathAppended(Constants::PACKAGE_MANAGER_DIR); const FilePath idePackageManagerDir = FilePath::fromString( parameters.expander->expand(QStringLiteral("%{IDE:ResourcePath}/package-manager"))); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 88cb4e168a7..1f16494fcae 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -231,14 +231,12 @@ void CMakeManager::enableBuildFileMenus(Node *node) void CMakeManager::reloadCMakePresets() { - auto settings = CMakeSpecificSettings::instance(); - QMessageBox::StandardButton clickedButton = CheckableMessageBox::question( Core::ICore::dialogParent(), Tr::tr("Reload CMake Presets"), Tr::tr("Re-generates the kits that were created for CMake presets. All manual " "modifications to the CMake project settings will be lost."), - settings->askBeforePresetsReload.askAgainCheckableDecider(), + settings().askBeforePresetsReload.askAgainCheckableDecider(), QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::Yes, diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index 39e3ec29269..fcccab85d94 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -17,7 +17,6 @@ #include "cmakeprojectmanagertr.h" #include "cmakeprojectnodes.h" #include "cmakesettingspage.h" -#include "cmakespecificsettings.h" #include "cmaketoolmanager.h" #include <coreplugin/actionmanager/actioncontainer.h> @@ -54,7 +53,6 @@ public: }; CMakeSettingsPage settingsPage; - CMakeSpecificSettings specificSettings; CMakeManager manager; CMakeBuildStepFactory buildStepFactory; diff --git a/src/plugins/cmakeprojectmanager/cmakespecificsettings.cpp b/src/plugins/cmakeprojectmanager/cmakespecificsettings.cpp index 1fe948cc72a..bd8c6882a3d 100644 --- a/src/plugins/cmakeprojectmanager/cmakespecificsettings.cpp +++ b/src/plugins/cmakeprojectmanager/cmakespecificsettings.cpp @@ -7,6 +7,8 @@ #include "cmakeprojectmanagertr.h" #include <coreplugin/icore.h> +#include <coreplugin/dialogs/ioptionspage.h> + #include <projectexplorer/projectexplorerconstants.h> #include <utils/layoutbuilder.h> @@ -15,23 +17,14 @@ using namespace Utils; namespace CMakeProjectManager::Internal { -static CMakeSpecificSettings *theSettings; - -CMakeSpecificSettings *CMakeSpecificSettings::instance() +CMakeSpecificSettings &settings() { + static CMakeSpecificSettings theSettings; return theSettings; } CMakeSpecificSettings::CMakeSpecificSettings() { - theSettings = this; - - setId(Constants::Settings::GENERAL_ID); - setDisplayName(::CMakeProjectManager::Tr::tr("General")); - setDisplayCategory("CMake"); - setCategory(Constants::Settings::CATEGORY); - setCategoryIconPath(Constants::Icons::SETTINGS_CATEGORY); - setLayouter([this] { using namespace Layouting; return Column { @@ -91,4 +84,20 @@ CMakeSpecificSettings::CMakeSpecificSettings() readSettings(); } +class CMakeSpecificSettingsPage final : public Core::IOptionsPage +{ +public: + CMakeSpecificSettingsPage() + { + setId(Constants::Settings::GENERAL_ID); + setDisplayName(::CMakeProjectManager::Tr::tr("General")); + setDisplayCategory("CMake"); + setCategory(Constants::Settings::CATEGORY); + setCategoryIconPath(Constants::Icons::SETTINGS_CATEGORY); + setSettingsProvider([] { return &settings(); }); + } +}; + +const CMakeSpecificSettingsPage settingsPage; + } // CMakeProjectManager::Internal diff --git a/src/plugins/cmakeprojectmanager/cmakespecificsettings.h b/src/plugins/cmakeprojectmanager/cmakespecificsettings.h index a9c2758e190..d75ba5abd13 100644 --- a/src/plugins/cmakeprojectmanager/cmakespecificsettings.h +++ b/src/plugins/cmakeprojectmanager/cmakespecificsettings.h @@ -3,17 +3,15 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> namespace CMakeProjectManager::Internal { -class CMakeSpecificSettings final : public Core::PagedSettings +class CMakeSpecificSettings final : public Utils::AspectContainer { public: CMakeSpecificSettings(); - static CMakeSpecificSettings *instance(); - Utils::BoolAspect autorunCMake{this}; Utils::FilePathAspect ninjaPath{this}; Utils::BoolAspect packageManagerAutoSetup{this}; @@ -23,4 +21,6 @@ public: Utils::BoolAspect showAdvancedOptionsByDefault{this}; }; +CMakeSpecificSettings &settings(); + } // CMakeProjectManager::Internal diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index 2892f78a7e8..08348a548a2 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -142,11 +142,11 @@ void CMakeToolManager::restoreCMakeTools() // Store the default CMake tool "Autorun CMake" value globally // TODO: Remove in Qt Creator 13 - auto settings = Internal::CMakeSpecificSettings::instance(); - if (settings->autorunCMake.value() == settings->autorunCMake.defaultValue()) { + Internal::CMakeSpecificSettings &s = Internal::settings(); + if (s.autorunCMake() == s.autorunCMake.defaultValue()) { CMakeTool *cmake = defaultCMakeTool(); - settings->autorunCMake.setValue(cmake ? cmake->isAutoRun() : true); - settings->writeSettings(); + s.autorunCMake.setValue(cmake ? cmake->isAutoRun() : true); + s.writeSettings(); } } diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp index 4b7a31e248f..5b7b6aec9b3 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp @@ -174,13 +174,13 @@ void CMakeToolSettingsAccessor::saveCMakeTools(const QList<CMakeTool *> &cmakeTo data.insert(QLatin1String(CMAKE_TOOL_DEFAULT_KEY), defaultId.toSetting()); int count = 0; + const bool autoRun = settings().autorunCMake(); for (CMakeTool *item : cmakeTools) { Utils::FilePath fi = item->cmakeExecutable(); // Gobal Autorun value will be set for all tools // TODO: Remove in Qt Creator 13 - const auto settings = CMakeSpecificSettings::instance(); - item->setAutorun(settings->autorunCMake.value()); + item->setAutorun(autoRun); if (fi.needsDevice() || fi.isExecutableFile()) { // be graceful for device related stuff QVariantMap tmp = item->toMap(); diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 16b2a5875bf..d39a95fccf6 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -540,10 +540,9 @@ void addCompileGroups(ProjectNode *targetRoot, const Utils::FilePath &buildDirectory, const TargetDetails &td) { - const bool showSourceFolders = CMakeSpecificSettings::instance()->showSourceSubFolders.value(); + const bool showSourceFolders = settings().showSourceSubFolders(); const bool inSourceBuild = (sourceDirectory == buildDirectory); - std::vector<std::unique_ptr<FileNode>> toList; QSet<Utils::FilePath> alreadyListed; // Files already added by other configurations: diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp index fd507f7bf71..f680cdc0a38 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.cpp +++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp @@ -107,8 +107,7 @@ void FileApiReader::parse(bool forceCMakeRun, // * A query file is newer than the reply file const bool hasArguments = !args.isEmpty(); const bool replyFileMissing = !replyFile.exists(); - const auto settings = CMakeSpecificSettings::instance(); - const bool cmakeFilesChanged = m_parameters.cmakeTool() && settings->autorunCMake.value() + const bool cmakeFilesChanged = m_parameters.cmakeTool() && settings().autorunCMake() && anyOf(m_cmakeFiles, [&replyFile](const CMakeFileInfo &info) { return !info.isGenerated && info.path.lastModified() > replyFile.lastModified(); From 6f17409b53d3fb5d220ce4ad9026eb5a04fc4189 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 14:34:35 +0200 Subject: [PATCH 0205/1777] ProjectExplorer: Code cosmetics in toolchain.cpp Mostly namespaces, but also centralize access to the factory list for better debugging. Change-Id: Ic8b19b8c110dc925e0f7ae27af1da2b9e1ec6086 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/toolchain.cpp | 102 +++++++++++----------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 8b8cfce2c80..f1a8f80c22d 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -14,7 +14,6 @@ #include <utils/qtcassert.h> #include <QCoreApplication> -#include <QDir> #include <QFileInfo> #include <QUuid> @@ -22,18 +21,22 @@ using namespace Utils; -static const char ID_KEY[] = "ProjectExplorer.ToolChain.Id"; -static const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ToolChain.DisplayName"; -static const char AUTODETECT_KEY[] = "ProjectExplorer.ToolChain.Autodetect"; -static const char DETECTION_SOURCE_KEY[] = "ProjectExplorer.ToolChain.DetectionSource"; -static const char LANGUAGE_KEY_V1[] = "ProjectExplorer.ToolChain.Language"; // For QtCreator <= 4.2 -static const char LANGUAGE_KEY_V2[] = "ProjectExplorer.ToolChain.LanguageV2"; // For QtCreator > 4.2 -const char CODE_MODEL_TRIPLE_KEY[] = "ExplicitCodeModelTargetTriple"; - namespace ProjectExplorer { namespace Internal { -static QList<ToolChainFactory *> g_toolChainFactories; +const char ID_KEY[] = "ProjectExplorer.ToolChain.Id"; +const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ToolChain.DisplayName"; +const char AUTODETECT_KEY[] = "ProjectExplorer.ToolChain.Autodetect"; +const char DETECTION_SOURCE_KEY[] = "ProjectExplorer.ToolChain.DetectionSource"; +const char LANGUAGE_KEY_V1[] = "ProjectExplorer.ToolChain.Language"; // For QtCreator <= 4.2 +const char LANGUAGE_KEY_V2[] = "ProjectExplorer.ToolChain.LanguageV2"; // For QtCreator > 4.2 +const char CODE_MODEL_TRIPLE_KEY[] = "ExplicitCodeModelTargetTriple"; + +QList<ToolChainFactory *> &toolChainFactories() +{ + static QList<ToolChainFactory *> theToolChainFactories; + return theToolChainFactories; +} // -------------------------------------------------------------------------- // ToolChainPrivate @@ -44,7 +47,7 @@ class ToolChainPrivate public: using Detection = ToolChain::Detection; - explicit ToolChainPrivate(Utils::Id typeId) : + explicit ToolChainPrivate(Id typeId) : m_id(QUuid::createUuid().toByteArray()), m_typeId(typeId), m_predefinedMacrosCache(new ToolChain::MacrosCache::element_type()), @@ -59,11 +62,11 @@ public: QString m_compilerCommandKey; Abi m_targetAbi; QString m_targetAbiKey; - QSet<Utils::Id> m_supportedLanguages; + QSet<Id> m_supportedLanguages; mutable QString m_displayName; QString m_typeDisplayName; - Utils::Id m_typeId; - Utils::Id m_language; + Id m_typeId; + Id m_language; Detection m_detection = ToolChain::UninitializedDetection; QString m_detectionSource; QString m_explicitCodeModelTargetTriple; @@ -76,24 +79,24 @@ public: // Deprecated used from QtCreator <= 4.2 -Utils::Id fromLanguageV1(int language) +Id fromLanguageV1(int language) { switch (language) { case Deprecated::Toolchain::C : - return Utils::Id(Constants::C_LANGUAGE_ID); + return Id(Constants::C_LANGUAGE_ID); case Deprecated::Toolchain::Cxx: - return Utils::Id(Constants::CXX_LANGUAGE_ID); + return Id(Constants::CXX_LANGUAGE_ID); case Deprecated::Toolchain::None: default: - return Utils::Id(); + return Id(); } } } // namespace Internal -namespace Deprecated { -namespace Toolchain { +namespace Deprecated::Toolchain { + QString languageId(Language l) { switch (l) { @@ -106,8 +109,10 @@ QString languageId(Language l) }; return QString(); } -} // namespace Toolchain -} // namespace Deprecated + +} // namespace Deprecated::ToolChain + +using namespace Internal; /*! \class ProjectExplorer::ToolChain @@ -117,12 +122,12 @@ QString languageId(Language l) // -------------------------------------------------------------------------- -ToolChain::ToolChain(Utils::Id typeId) : - d(std::make_unique<Internal::ToolChainPrivate>(typeId)) +ToolChain::ToolChain(Id typeId) : + d(std::make_unique<ToolChainPrivate>(typeId)) { } -void ToolChain::setLanguage(Utils::Id language) +void ToolChain::setLanguage(Id language) { QTC_ASSERT(!d->m_language.isValid() || isAutoDetected(), return); QTC_ASSERT(language.isValid(), return); @@ -174,7 +179,7 @@ QStringList ToolChain::suggestedMkspecList() const return {}; } -Utils::Id ToolChain::typeId() const +Id ToolChain::typeId() const { return d->m_typeId; } @@ -199,7 +204,7 @@ FilePaths ToolChain::includedFiles(const QStringList &flags, const FilePath &dir return {}; } -Utils::Id ToolChain::language() const +Id ToolChain::language() const { return d->m_language; } @@ -217,7 +222,7 @@ bool ToolChain::operator == (const ToolChain &tc) const ToolChain *ToolChain::clone() const { - for (ToolChainFactory *f : std::as_const(Internal::g_toolChainFactories)) { + for (ToolChainFactory *f : std::as_const(toolChainFactories())) { if (f->supportedToolChainType() == d->m_typeId) { ToolChain *tc = f->create(); QTC_ASSERT(tc, return nullptr); @@ -354,7 +359,7 @@ bool ToolChain::fromMap(const QVariantMap &data) const QString id = data.value(QLatin1String(ID_KEY)).toString(); int pos = id.indexOf(QLatin1Char(':')); QTC_ASSERT(pos > 0, return false); - d->m_typeId = Utils::Id::fromString(id.left(pos)); + d->m_typeId = Id::fromString(id.left(pos)); d->m_id = id.mid(pos + 1).toUtf8(); const bool autoDetect = data.value(QLatin1String(AUTODETECT_KEY), false).toBool(); @@ -369,15 +374,15 @@ bool ToolChain::fromMap(const QVariantMap &data) const QString langId = data.value(QLatin1String(LANGUAGE_KEY_V2)).toString(); const int pos = langId.lastIndexOf('.'); if (pos >= 0) - d->m_language = Utils::Id::fromString(langId.mid(pos + 1)); + d->m_language = Id::fromString(langId.mid(pos + 1)); else - d->m_language = Utils::Id::fromString(langId); + d->m_language = Id::fromString(langId); } else if (data.contains(LANGUAGE_KEY_V1)) { // Import from old settings d->m_language = Internal::fromLanguageV1(data.value(QLatin1String(LANGUAGE_KEY_V1)).toInt()); } if (!d->m_language.isValid()) - d->m_language = Utils::Id(Constants::CXX_LANGUAGE_ID); + d->m_language = Id(Constants::CXX_LANGUAGE_ID); if (!d->m_targetAbiKey.isEmpty()) d->m_targetAbi = Abi::fromString(data.value(d->m_targetAbiKey).toString()); @@ -410,9 +415,8 @@ static long toLanguageVersionAsLong(QByteArray dateAsByteArray) return result; } -Utils::LanguageVersion ToolChain::cxxLanguageVersion(const QByteArray &cplusplusMacroValue) +LanguageVersion ToolChain::cxxLanguageVersion(const QByteArray &cplusplusMacroValue) { - using Utils::LanguageVersion; const long version = toLanguageVersionAsLong(cplusplusMacroValue); if (version > 201703L) @@ -427,10 +431,8 @@ Utils::LanguageVersion ToolChain::cxxLanguageVersion(const QByteArray &cplusplus return LanguageVersion::CXX03; } -Utils::LanguageVersion ToolChain::languageVersion(const Utils::Id &language, const Macros ¯os) +LanguageVersion ToolChain::languageVersion(const Id &language, const Macros ¯os) { - using Utils::LanguageVersion; - if (language == Constants::CXX_LANGUAGE_ID) { for (const ProjectExplorer::Macro ¯o : macros) { if (macro.key == "__cplusplus") // Check for the C++ identifying macro @@ -548,17 +550,17 @@ void ToolChain::setExplicitCodeModelTargetTriple(const QString &triple) ToolChainFactory::ToolChainFactory() { - Internal::g_toolChainFactories.append(this); + toolChainFactories().append(this); } ToolChainFactory::~ToolChainFactory() { - Internal::g_toolChainFactories.removeOne(this); + toolChainFactories().removeOne(this); } const QList<ToolChainFactory *> ToolChainFactory::allToolChainFactories() { - return Internal::g_toolChainFactories; + return toolChainFactories(); } Toolchains ToolChainFactory::autoDetect(const ToolchainDetector &detector) const @@ -611,9 +613,9 @@ QByteArray ToolChainFactory::idFromMap(const QVariantMap &data) return rawIdData(data).second.toUtf8(); } -Utils::Id ToolChainFactory::typeIdFromMap(const QVariantMap &data) +Id ToolChainFactory::typeIdFromMap(const QVariantMap &data) { - return Utils::Id::fromString(rawIdData(data).first); + return Id::fromString(rawIdData(data).first); } void ToolChainFactory::autoDetectionToMap(QVariantMap &data, bool detected) @@ -621,9 +623,9 @@ void ToolChainFactory::autoDetectionToMap(QVariantMap &data, bool detected) data.insert(QLatin1String(AUTODETECT_KEY), detected); } -ToolChain *ToolChainFactory::createToolChain(Utils::Id toolChainType) +ToolChain *ToolChainFactory::createToolChain(Id toolChainType) { - for (ToolChainFactory *factory : std::as_const(Internal::g_toolChainFactories)) { + for (ToolChainFactory *factory : std::as_const(toolChainFactories())) { if (factory->m_supportedToolChainType == toolChainType) { if (ToolChain *tc = factory->create()) { tc->d->m_typeId = toolChainType; @@ -634,22 +636,22 @@ ToolChain *ToolChainFactory::createToolChain(Utils::Id toolChainType) return nullptr; } -QList<Utils::Id> ToolChainFactory::supportedLanguages() const +QList<Id> ToolChainFactory::supportedLanguages() const { return m_supportsAllLanguages ? ToolChainManager::allLanguages() : m_supportedLanguages; } -Utils::Id ToolChainFactory::supportedToolChainType() const +Id ToolChainFactory::supportedToolChainType() const { return m_supportedToolChainType; } -void ToolChainFactory::setSupportedToolChainType(const Utils::Id &supportedToolChain) +void ToolChainFactory::setSupportedToolChainType(const Id &supportedToolChain) { m_supportedToolChainType = supportedToolChain; } -void ToolChainFactory::setSupportedLanguages(const QList<Utils::Id> &supportedLanguages) +void ToolChainFactory::setSupportedLanguages(const QList<Id> &supportedLanguages) { m_supportedLanguages = supportedLanguages; } @@ -678,11 +680,11 @@ ToolchainDetector::ToolchainDetector(const Toolchains &alreadyKnown, QTC_CHECK(device); } -BadToolchain::BadToolchain(const Utils::FilePath &filePath) +BadToolchain::BadToolchain(const FilePath &filePath) : BadToolchain(filePath, filePath.symLinkTarget(), filePath.lastModified()) {} -BadToolchain::BadToolchain(const Utils::FilePath &filePath, const Utils::FilePath &symlinkTarget, +BadToolchain::BadToolchain(const FilePath &filePath, const FilePath &symlinkTarget, const QDateTime ×tamp) : filePath(filePath), symlinkTarget(symlinkTarget), timestamp(timestamp) {} From c1c62d0d9e55d4069ee9e0d7dafb1487e94b6cc9 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 14:10:06 +0200 Subject: [PATCH 0206/1777] ProjectExplorer: Add a comment about potentially unexpected expansions Change-Id: Ie476a7c127c457e7a12336827876768432ffd658 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/buildconfiguration.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 3a7d0b4a2a0..18a22a421af 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -229,6 +229,9 @@ FilePath BuildConfiguration::buildDirectory() const { FilePath path = FilePath::fromUserInput( environment().expandVariables(d->m_buildDirectoryAspect->value().trimmed())); + // FIXME: If the macro expander is expected to be able to do some + // structual changes, the fromUserInput() above might already have + // mis-parsed. Should this here be encapsulated in the FilePathAspect? path = macroExpander()->expand(path); path = path.cleanPath(); From 243341df46641bd40f0c89eb3278dc9f59462aec Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 7 Jul 2023 11:40:12 +0200 Subject: [PATCH 0207/1777] AbstractRemoteLinuxDeployStep: Get rid of CheckResult Use expected_str<void> instead. Change-Id: I93518da9ba9393a3db84aefeb9edd164cd830d42 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../abstractremotelinuxdeploystep.cpp | 23 ++++++++++--------- .../abstractremotelinuxdeploystep.h | 20 ++-------------- .../remotelinux/customcommanddeploystep.cpp | 6 ++--- src/plugins/remotelinux/killappstep.cpp | 6 ++--- src/plugins/remotelinux/rsyncdeploystep.cpp | 4 ++-- .../remotelinux/tarpackagedeploystep.cpp | 4 ++-- 6 files changed, 24 insertions(+), 39 deletions(-) diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index afd4e0e96a2..f9cf02a30c2 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -30,7 +30,7 @@ class AbstractRemoteLinuxDeployStepPrivate { public: bool hasError; - std::function<CheckResult()> internalInit; + std::function<expected_str<void>()> internalInit; std::function<void()> runPreparer; DeploymentTimeInfo deployTimes; @@ -73,14 +73,15 @@ bool AbstractRemoteLinuxDeployStep::hasRemoteFileChanged( return d->deployTimes.hasRemoteFileChanged(deployableFile, kit(), remoteTimestamp); } -CheckResult AbstractRemoteLinuxDeployStep::isDeploymentPossible() const +expected_str<void> AbstractRemoteLinuxDeployStep::isDeploymentPossible() const { if (!deviceConfiguration()) - return CheckResult::failure(Tr::tr("No device configuration set.")); - return CheckResult::success(); + return make_unexpected(Tr::tr("No device configuration set.")); + return {}; } -void AbstractRemoteLinuxDeployStep::setInternalInitializer(const std::function<CheckResult ()> &init) +void AbstractRemoteLinuxDeployStep::setInternalInitializer( + const std::function<expected_str<void>()> &init) { d->internalInit = init; } @@ -108,12 +109,12 @@ QVariantMap AbstractRemoteLinuxDeployStep::toMap() const bool AbstractRemoteLinuxDeployStep::init() { QTC_ASSERT(d->internalInit, return false); - const CheckResult canDeploy = d->internalInit(); + const auto canDeploy = d->internalInit(); if (!canDeploy) { - emit addOutput(Tr::tr("Cannot deploy: %1").arg(canDeploy.errorMessage()), + emit addOutput(Tr::tr("Cannot deploy: %1").arg(canDeploy.error()), OutputFormat::ErrorMessage); } - return canDeploy; + return bool(canDeploy); } void AbstractRemoteLinuxDeployStep::doRun() @@ -125,9 +126,9 @@ void AbstractRemoteLinuxDeployStep::doRun() QTC_ASSERT(!d->m_taskTree, return); - const CheckResult check = isDeploymentPossible(); - if (!check) { - addErrorMessage(check.errorMessage()); + const auto canDeploy = isDeploymentPossible(); + if (!canDeploy) { + addErrorMessage(canDeploy.error()); handleFinished(); return; } diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h index b0af97f5d2b..42f5b8c0cc1 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h @@ -17,22 +17,6 @@ namespace RemoteLinux { namespace Internal { class AbstractRemoteLinuxDeployStepPrivate; } -class REMOTELINUX_EXPORT CheckResult -{ -public: - static CheckResult success() { return {true, {}}; } - static CheckResult failure(const QString &error = {}) { return {false, error}; } - - operator bool() const { return m_ok; } - QString errorMessage() const { return m_error; } - -private: - CheckResult(bool ok, const QString &error) : m_ok(ok), m_error(error) {} - - bool m_ok = false; - QString m_error; -}; - class REMOTELINUX_EXPORT AbstractRemoteLinuxDeployStep : public ProjectExplorer::BuildStep { public: @@ -41,7 +25,7 @@ public: ProjectExplorer::IDeviceConstPtr deviceConfiguration() const; - virtual CheckResult isDeploymentPossible() const; + virtual Utils::expected_str<void> isDeploymentPossible() const; void handleStdOutData(const QString &data); void handleStdErrData(const QString &data); @@ -53,7 +37,7 @@ protected: void doRun() final; void doCancel() override; - void setInternalInitializer(const std::function<CheckResult()> &init); + void setInternalInitializer(const std::function<Utils::expected_str<void>()> &init); void setRunPreparer(const std::function<void()> &prep); void saveDeploymentTimeStamp(const ProjectExplorer::DeployableFile &deployableFile, diff --git a/src/plugins/remotelinux/customcommanddeploystep.cpp b/src/plugins/remotelinux/customcommanddeploystep.cpp index 7fd74a94909..995be652668 100644 --- a/src/plugins/remotelinux/customcommanddeploystep.cpp +++ b/src/plugins/remotelinux/customcommanddeploystep.cpp @@ -35,7 +35,7 @@ public: addMacroExpander(); } - CheckResult isDeploymentPossible() const final; + expected_str<void> isDeploymentPossible() const final; private: Group deployRecipe() final; @@ -43,10 +43,10 @@ private: StringAspect commandLine{this}; }; -CheckResult CustomCommandDeployStep::isDeploymentPossible() const +expected_str<void> CustomCommandDeployStep::isDeploymentPossible() const { if (commandLine().isEmpty()) - return CheckResult::failure(Tr::tr("No command line given.")); + return make_unexpected(Tr::tr("No command line given.")); return AbstractRemoteLinuxDeployStep::isDeploymentPossible(); } diff --git a/src/plugins/remotelinux/killappstep.cpp b/src/plugins/remotelinux/killappstep.cpp index d3ec72e8895..e59088bb9c7 100644 --- a/src/plugins/remotelinux/killappstep.cpp +++ b/src/plugins/remotelinux/killappstep.cpp @@ -27,12 +27,12 @@ public: { setWidgetExpandedByDefault(false); - setInternalInitializer([this] { + setInternalInitializer([this]() -> expected_str<void> { Target * const theTarget = target(); - QTC_ASSERT(theTarget, return CheckResult::failure()); + QTC_ASSERT(theTarget, return make_unexpected(QString())); RunConfiguration * const rc = theTarget->activeRunConfiguration(); m_remoteExecutable = rc ? rc->runnable().command.executable() : FilePath(); - return CheckResult::success(); + return {}; }); } diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index fe423de3e69..8accb0a54b3 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -51,11 +51,11 @@ public: method.addOption(Tr::tr("SFTP"), Tr::tr("Use sftp if available.")); method.addOption(Tr::tr("Generic Copy"), Tr::tr("Use generic copy, most likely to succeed.")); - setInternalInitializer([this] { + setInternalInitializer([this]() -> expected_str<void> { if (BuildDeviceKitAspect::device(kit()) == DeviceKitAspect::device(kit())) { // rsync transfer on the same device currently not implemented // and typically not wanted. - return CheckResult::failure( + return make_unexpected( Tr::tr("rsync is only supported for transfers between different devices.")); } return isDeploymentPossible(); diff --git a/src/plugins/remotelinux/tarpackagedeploystep.cpp b/src/plugins/remotelinux/tarpackagedeploystep.cpp index 6deaea90662..eb2fd4b588a 100644 --- a/src/plugins/remotelinux/tarpackagedeploystep.cpp +++ b/src/plugins/remotelinux/tarpackagedeploystep.cpp @@ -31,7 +31,7 @@ public: { setWidgetExpandedByDefault(false); - setInternalInitializer([this] { + setInternalInitializer([this]() -> expected_str<void> { const BuildStep *tarCreationStep = nullptr; for (BuildStep *step : deployConfiguration()->stepList()->steps()) { @@ -43,7 +43,7 @@ public: } } if (!tarCreationStep) - return CheckResult::failure(Tr::tr("No tarball creation step found.")); + return make_unexpected(Tr::tr("No tarball creation step found.")); m_packageFilePath = FilePath::fromVariant(tarCreationStep->data(Constants::TarPackageFilePathId)); From a1192427713f989881bcd8eb0253466814761800 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 7 Jul 2023 12:16:29 +0200 Subject: [PATCH 0208/1777] AbstractRemoteLinuxDeployStep: Get rid of run preparer Make it a part of isDeploymentNecessary() instead. Change-Id: I73bda4f75b94222b6e9475b13a373f7237969999 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../remotelinux/abstractremotelinuxdeploystep.cpp | 9 --------- .../remotelinux/abstractremotelinuxdeploystep.h | 1 - src/plugins/remotelinux/genericdirectuploadstep.cpp | 7 ++----- src/plugins/remotelinux/rsyncdeploystep.cpp | 11 ++++------- 4 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index f9cf02a30c2..64bf07538c5 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -31,7 +31,6 @@ class AbstractRemoteLinuxDeployStepPrivate public: bool hasError; std::function<expected_str<void>()> internalInit; - std::function<void()> runPreparer; DeploymentTimeInfo deployTimes; std::unique_ptr<TaskTree> m_taskTree; @@ -86,11 +85,6 @@ void AbstractRemoteLinuxDeployStep::setInternalInitializer( d->internalInit = init; } -void AbstractRemoteLinuxDeployStep::setRunPreparer(const std::function<void ()> &prep) -{ - d->runPreparer = prep; -} - bool AbstractRemoteLinuxDeployStep::fromMap(const QVariantMap &map) { if (!BuildStep::fromMap(map)) @@ -119,9 +113,6 @@ bool AbstractRemoteLinuxDeployStep::init() void AbstractRemoteLinuxDeployStep::doRun() { - if (d->runPreparer) - d->runPreparer(); - d->hasError = false; QTC_ASSERT(!d->m_taskTree, return); diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h index 42f5b8c0cc1..f83a3215a79 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h @@ -38,7 +38,6 @@ protected: void doCancel() override; void setInternalInitializer(const std::function<Utils::expected_str<void>()> &init); - void setRunPreparer(const std::function<void()> &prep); void saveDeploymentTimeStamp(const ProjectExplorer::DeployableFile &deployableFile, const QDateTime &remoteTimestamp); diff --git a/src/plugins/remotelinux/genericdirectuploadstep.cpp b/src/plugins/remotelinux/genericdirectuploadstep.cpp index b11ce62e9f1..a85d16f7e1f 100644 --- a/src/plugins/remotelinux/genericdirectuploadstep.cpp +++ b/src/plugins/remotelinux/genericdirectuploadstep.cpp @@ -52,10 +52,6 @@ public: setInternalInitializer([this] { return isDeploymentPossible(); }); - - setRunPreparer([this] { - m_deployableFiles = target()->deploymentData().allFiles(); - }); } bool isDeploymentNecessary() const final; @@ -97,6 +93,7 @@ static QList<DeployableFile> collectFilesToUpload(const DeployableFile &deployab bool GenericDirectUploadStep::isDeploymentNecessary() const { + m_deployableFiles = target()->deploymentData().allFiles(); QList<DeployableFile> collected; for (int i = 0; i < m_deployableFiles.count(); ++i) collected.append(collectFilesToUpload(m_deployableFiles.at(i))); @@ -277,7 +274,7 @@ Group GenericDirectUploadStep::deployRecipe() storage->filesToUpload.append(file); }; - const auto postFilesToStat = [this](UploadStorage *storage) { + const auto postFilesToStat = [](UploadStorage *storage) { return storage->filesToUpload; }; const auto postStatEndHandler = [this](UploadStorage *storage, const DeployableFile &file, diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index 8accb0a54b3..8f8da906107 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -60,13 +60,6 @@ public: } return isDeploymentPossible(); }); - - setRunPreparer([this] { - const QList<DeployableFile> files = target()->deploymentData().allFiles(); - m_files.clear(); - for (const DeployableFile &f : files) - m_files.append({f.localFilePath(), deviceConfiguration()->filePath(f.remoteFilePath())}); - }); } private: @@ -84,6 +77,10 @@ private: bool RsyncDeployStep::isDeploymentNecessary() const { + const QList<DeployableFile> files = target()->deploymentData().allFiles(); + m_files.clear(); + for (const DeployableFile &f : files) + m_files.append({f.localFilePath(), deviceConfiguration()->filePath(f.remoteFilePath())}); if (ignoreMissingFiles()) Utils::erase(m_files, [](const FileToTransfer &file) { return !file.m_source.exists(); }); return !m_files.empty(); From 1d8c0c83193c99dffbaee571f582999e9540ec86 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 7 Jul 2023 14:46:24 +0200 Subject: [PATCH 0209/1777] BuildManager: Introduce BuildItem helper struct Don't keep 3 separate lists for build steps, enabled states and build step names. Use just one list with BuildItem struct. This quarantees the lists don't get out of sync. This fixes a possible issue in case when abortBuildAllOnError is false. It could happen that the front build step was removed from the m_buildQueue, but the front items from the m_enabledState and m_stepNames lists stayed there. Change-Id: I9dc27a94b2961d3a190f1acfb6241bcdd1c41d1c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/buildmanager.cpp | 44 ++++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 888cc7f14df..5d4e7f5837a 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -213,6 +213,11 @@ static int queue(const QList<Project *> &projects, const QList<Id> &stepIds, return stepLists.count(); } +struct BuildItem { + BuildStep *buildStep = nullptr; + bool enabled = true; + QString name; +}; class BuildManagerPrivate { @@ -221,9 +226,7 @@ public: Internal::TaskWindow *m_taskWindow = nullptr; QMetaObject::Connection m_scheduledBuild; - QList<BuildStep *> m_buildQueue; - QList<bool> m_enabledState; - QStringList m_stepNames; + QList<BuildItem> m_buildQueue; int m_progress = 0; int m_maxProgress = 0; bool m_poppedUpTaskWindow = false; @@ -500,14 +503,12 @@ void BuildManager::emitCancelMessage() void BuildManager::clearBuildQueue() { - for (BuildStep *bs : std::as_const(d->m_buildQueue)) { - decrementActiveBuildSteps(bs); - disconnectOutput(bs); + for (const BuildItem &item : std::as_const(d->m_buildQueue)) { + decrementActiveBuildSteps(item.buildStep); + disconnectOutput(item.buildStep); } - d->m_stepNames.clear(); d->m_buildQueue.clear(); - d->m_enabledState.clear(); d->m_running = false; d->m_poppedUpTaskWindow = false; d->m_isDeploying = false; @@ -561,7 +562,7 @@ void BuildManager::startBuildQueue() // Delay if any of the involved build systems are currently parsing. const auto buildSystems = transform<QSet<BuildSystem *>>(d->m_buildQueue, - [](const BuildStep *bs) { return bs->buildSystem(); }); + [](const BuildItem &item) { return item.buildStep->buildSystem(); }); for (const BuildSystem * const bs : buildSystems) { if (!bs || !bs->isParsing()) continue; @@ -681,8 +682,8 @@ void BuildManager::nextBuildQueue() bool abort = ProjectExplorerPlugin::projectExplorerSettings().abortBuildAllOnError; if (!abort) { while (!d->m_buildQueue.isEmpty() - && d->m_buildQueue.front()->target() == t) { - BuildStep * const nextStepForFailedTarget = d->m_buildQueue.takeFirst(); + && d->m_buildQueue.front().buildStep->target() == t) { + BuildStep * const nextStepForFailedTarget = d->m_buildQueue.takeFirst().buildStep; disconnectOutput(nextStepForFailedTarget); decrementActiveBuildSteps(nextStepForFailedTarget); } @@ -711,12 +712,11 @@ void BuildManager::progressChanged(int percent, const QString &text) void BuildManager::nextStep() { if (!d->m_buildQueue.empty()) { - d->m_currentBuildStep = d->m_buildQueue.front(); - d->m_buildQueue.pop_front(); - QString name = d->m_stepNames.takeFirst(); - d->m_skipDisabled = !d->m_enabledState.takeFirst(); + const BuildItem item = d->m_buildQueue.takeFirst(); + d->m_currentBuildStep = item.buildStep; + d->m_skipDisabled = !item.enabled; if (d->m_futureProgress) - d->m_futureProgress.data()->setTitle(name); + d->m_futureProgress.data()->setTitle(item.name); if (d->m_currentBuildStep->project() != d->m_previousBuildStepProject) { const QString projectName = d->m_currentBuildStep->project()->displayName(); @@ -805,13 +805,12 @@ bool BuildManager::buildQueueAppend(const QList<BuildStep *> &steps, QStringList // Everthing init() well for (i = 0; i < count; ++i) { - d->m_buildQueue.append(steps.at(i)); - d->m_stepNames.append(names.at(i)); - bool enabled = steps.at(i)->enabled(); - d->m_enabledState.append(enabled); + BuildStep *buildStep = steps.at(i); + const bool enabled = buildStep->enabled(); + d->m_buildQueue.append({buildStep, enabled, names.at(i)}); if (enabled) ++d->m_maxProgress; - incrementActiveBuildSteps(steps.at(i)); + incrementActiveBuildSteps(buildStep); } return true; } @@ -890,7 +889,8 @@ bool BuildManager::isBuilding(const ProjectConfiguration *p) bool BuildManager::isBuilding(BuildStep *step) { - return (d->m_currentBuildStep == step) || d->m_buildQueue.contains(step); + return (d->m_currentBuildStep == step) || Utils::anyOf( + d->m_buildQueue, [step](const BuildItem &item) { return item.buildStep == step; }); } template <class T> bool increment(QHash<T *, int> &hash, T *key) From 9039ede0340b93a15cfa3fe5996a89929e269111 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sun, 4 Jun 2023 22:01:52 +0200 Subject: [PATCH 0210/1777] FileExtractor: Remove Utils namespace specifier In order to limit the verbosity: add using namespace Utils instead. Remove some unneeded includes. Change-Id: I446da2324803fd4ac6fb854ce7626d497f9797f3 Reviewed-by: hjk <hjk@qt.io> --- .../qmldesigner/utils/fileextractor.cpp | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/plugins/qmldesigner/utils/fileextractor.cpp b/src/plugins/qmldesigner/utils/fileextractor.cpp index e2ba28e8876..cb9f35fdd74 100644 --- a/src/plugins/qmldesigner/utils/fileextractor.cpp +++ b/src/plugins/qmldesigner/utils/fileextractor.cpp @@ -2,18 +2,18 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "fileextractor.h" -#include <QQmlEngine> #include <QRandomGenerator> #include <QStorageInfo> #include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginspec.h> -#include <utils/algorithm.h> #include <utils/archive.h> #include <utils/fileutils.h> #include <utils/qtcassert.h> +using namespace Utils; + namespace QmlDesigner { FileExtractor::FileExtractor(QObject *parent) @@ -22,7 +22,7 @@ FileExtractor::FileExtractor(QObject *parent) m_timer.setInterval(100); m_timer.setSingleShot(false); - QObject::connect(this, &FileExtractor::targetFolderExistsChanged, this, [this]() { + QObject::connect(this, &FileExtractor::targetFolderExistsChanged, this, [this] { if (targetFolderExists()) m_birthTime = QFileInfo(m_targetPath.toString() + "/" + m_archiveName).birthTime(); else @@ -32,7 +32,7 @@ FileExtractor::FileExtractor(QObject *parent) }); QObject::connect( - &m_timer, &QTimer::timeout, this, [this]() { + &m_timer, &QTimer::timeout, this, [this] { static QHash<QString, int> hash; QDirIterator it(m_targetFolder, {"*.*"}, QDir::Files, QDirIterator::Subdirectories); @@ -74,7 +74,7 @@ FileExtractor::~FileExtractor() {} void FileExtractor::changeTargetPath(const QString &path) { - m_targetPath = Utils::FilePath::fromString(path); + m_targetPath = FilePath::fromString(path); emit targetPathChanged(); emit targetFolderExistsChanged(); } @@ -86,7 +86,7 @@ QString FileExtractor::targetPath() const void FileExtractor::setTargetPath(const QString &path) { - m_targetPath = Utils::FilePath::fromString(path); + m_targetPath = FilePath::fromString(path); QDir dir(m_targetPath.toString()); @@ -99,9 +99,8 @@ void FileExtractor::setTargetPath(const QString &path) void FileExtractor::browse() { - const Utils::FilePath path = - Utils::FileUtils::getExistingDirectory(nullptr, tr("Choose Directory"), m_targetPath); - + const FilePath path = FileUtils::getExistingDirectory(nullptr, tr("Choose Directory"), + m_targetPath); if (!path.isEmpty()) m_targetPath = path; @@ -111,7 +110,7 @@ void FileExtractor::browse() void FileExtractor::setSourceFile(const QString &sourceFilePath) { - m_sourceFile = Utils::FilePath::fromString(sourceFilePath); + m_sourceFile = FilePath::fromString(sourceFilePath); emit targetFolderExistsChanged(); } @@ -203,7 +202,7 @@ void FileExtractor::extract() auto uniqueText = QByteArray::number(QRandomGenerator::global()->generate(), 16); QString tempFileName = QDir::tempPath() + "/.qds_" + uniqueText + "_extract_" + m_archiveName + "_dir"; - m_targetPath = Utils::FilePath::fromString(tempFileName); + m_targetPath = FilePath::fromString(tempFileName); } m_targetFolder = m_targetPath.toString() + "/" + m_archiveName; @@ -218,7 +217,7 @@ void FileExtractor::extract() targetDir.mkdir(m_targetFolder); } - Utils::Archive *archive = new Utils::Archive(m_sourceFile, m_targetPath); + Archive *archive = new Archive(m_sourceFile, m_targetPath); QTC_ASSERT(archive->isValid(), delete archive; return); m_timer.start(); @@ -227,12 +226,12 @@ void FileExtractor::extract() if (m_compressedSize <= 0) qWarning() << "Compressed size for file '" << m_sourceFile << "' is zero or invalid: " << m_compressedSize; - QObject::connect(archive, &Utils::Archive::outputReceived, this, [this](const QString &output) { + QObject::connect(archive, &Archive::outputReceived, this, [this](const QString &output) { m_detailedText += output; emit detailedTextChanged(); }); - QObject::connect(archive, &Utils::Archive::finished, this, [this, archive](bool ret) { + QObject::connect(archive, &Archive::finished, this, [this, archive](bool ret) { archive->deleteLater(); m_finished = ret; m_timer.stop(); From c8d9b6f5aa37a93f6e4a5fa444cf05f6054d897a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 07:12:46 +0200 Subject: [PATCH 0211/1777] Beautifier: Merge Artistic style file pairs ... to prepare moving the "unusual" functions off the settings/ AbstractSettings base. Change-Id: I4875bae9f3cec2105eb6d29493d6a6e706c414a7 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/beautifier/CMakeLists.txt | 1 - .../artisticstyle/artisticstyle.cpp | 237 +++++++++++++++++- .../beautifier/artisticstyle/artisticstyle.h | 6 +- .../artisticstyle/artisticstylesettings.cpp | 201 --------------- .../artisticstyle/artisticstylesettings.h | 31 --- src/plugins/beautifier/beautifier.qbs | 2 - 6 files changed, 228 insertions(+), 250 deletions(-) delete mode 100644 src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp delete mode 100644 src/plugins/beautifier/artisticstyle/artisticstylesettings.h diff --git a/src/plugins/beautifier/CMakeLists.txt b/src/plugins/beautifier/CMakeLists.txt index 4e921342b7a..050be358e7e 100644 --- a/src/plugins/beautifier/CMakeLists.txt +++ b/src/plugins/beautifier/CMakeLists.txt @@ -5,7 +5,6 @@ add_qtc_plugin(Beautifier abstractsettings.cpp abstractsettings.h artisticstyle/artisticstyle.cpp artisticstyle/artisticstyle.h artisticstyle/artisticstyleconstants.h - artisticstyle/artisticstylesettings.cpp artisticstyle/artisticstylesettings.h beautifier.qrc beautifierabstracttool.h beautifierconstants.h diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp index 1f063829944..dfc05296b10 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp @@ -6,10 +6,11 @@ #include "artisticstyle.h" #include "artisticstyleconstants.h" - +#include "../abstractsettings.h" #include "../beautifierconstants.h" #include "../beautifierplugin.h" #include "../beautifiertr.h" +#include "../configurationpanel.h" #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> @@ -17,6 +18,7 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/ieditor.h> +#include <coreplugin/icore.h> #include <coreplugin/idocument.h> #include <projectexplorer/project.h> @@ -27,16 +29,227 @@ #include <utils/fileutils.h> #include <utils/hostosinfo.h> +#include <utils/layoutbuilder.h> +#include <utils/pathchooser.h> +#include <utils/process.h> #include <utils/stringutils.h> #include <QAction> +#include <QApplication> +#include <QDateTime> +#include <QFile> +#include <QFileInfo> +#include <QGroupBox> #include <QMenu> +#include <QRegularExpression> #include <QVersionNumber> +#include <QXmlStreamWriter> using namespace TextEditor; +using namespace Utils; namespace Beautifier::Internal { +// Settings + +const char SETTINGS_NAME[] = "artisticstyle"; + +class ArtisticStyleSettings : public AbstractSettings +{ +public: + ArtisticStyleSettings() + : AbstractSettings(SETTINGS_NAME, ".astyle") + { + setVersionRegExp(QRegularExpression("([2-9]{1})\\.([0-9]{1,2})(\\.[1-9]{1})?$")); + command.setLabelText(Tr::tr("Artistic Style command:")); + command.setDefaultValue("astyle"); + command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle( + Tr::tr(Constants::ARTISTICSTYLE_DISPLAY_NAME))); + + useOtherFiles.setSettingsKey("useOtherFiles"); + useOtherFiles.setLabelText(Tr::tr("Use file *.astylerc defined in project files")); + useOtherFiles.setDefaultValue(true); + + useSpecificConfigFile.setSettingsKey("useSpecificConfigFile"); + useSpecificConfigFile.setLabelText(Tr::tr("Use specific config file:")); + + specificConfigFile.setSettingsKey("specificConfigFile"); + specificConfigFile.setExpectedKind(PathChooser::File); + specificConfigFile.setPromptDialogFilter(Tr::tr("AStyle (*.astylerc)")); + + useHomeFile.setSettingsKey("useHomeFile"); + useHomeFile.setLabelText(Tr::tr("Use file .astylerc or astylerc in HOME"). + replace("HOME", QDir::toNativeSeparators(QDir::home().absolutePath()))); + + useCustomStyle.setSettingsKey("useCustomStyle"); + useCustomStyle.setLabelText(Tr::tr("Use customized style:")); + + customStyle.setSettingsKey("customStyle"); + + documentationFilePath = + Core::ICore::userResourcePath(Beautifier::Constants::SETTINGS_DIRNAME) + .pathAppended(Beautifier::Constants::DOCUMENTATION_DIRNAME) + .pathAppended(SETTINGS_NAME) + .stringAppended(".xml"); + + read(); + } + + void createDocumentationFile() const override + { + Process process; + process.setTimeoutS(2); + process.setCommand({command(), {"-h"}}); + process.runBlocking(); + if (process.result() != ProcessResult::FinishedWithSuccess) + return; + + if (!documentationFilePath.exists()) + documentationFilePath.parentDir().ensureWritableDir(); + + QFile file(documentationFilePath.toFSPathString()); + if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) + return; + + bool contextWritten = false; + QXmlStreamWriter stream(&file); + stream.setAutoFormatting(true); + stream.writeStartDocument("1.0", true); + stream.writeComment("Created " + QDateTime::currentDateTime().toString(Qt::ISODate)); + stream.writeStartElement(Constants::DOCUMENTATION_XMLROOT); + + // astyle writes its output to 'error'... + const QStringList lines = process.cleanedStdErr().split(QLatin1Char('\n')); + QStringList keys; + QStringList docu; + for (QString line : lines) { + line = line.trimmed(); + if ((line.startsWith("--") && !line.startsWith("---")) || line.startsWith("OR ")) { + const QStringList rawKeys = line.split(" OR ", Qt::SkipEmptyParts); + for (QString k : rawKeys) { + k = k.trimmed(); + k.remove('#'); + keys << k; + if (k.startsWith("--")) + keys << k.right(k.size() - 2); + } + } else { + if (line.isEmpty()) { + if (!keys.isEmpty()) { + // Write entry + stream.writeStartElement(Constants::DOCUMENTATION_XMLENTRY); + stream.writeStartElement(Constants::DOCUMENTATION_XMLKEYS); + for (const QString &key : std::as_const(keys)) + stream.writeTextElement(Constants::DOCUMENTATION_XMLKEY, key); + stream.writeEndElement(); + const QString text = "<p><span class=\"option\">" + + keys.filter(QRegularExpression("^\\-")).join(", ") + "</span></p><p>" + + (docu.join(' ').toHtmlEscaped()) + "</p>"; + stream.writeTextElement(Constants::DOCUMENTATION_XMLDOC, text); + stream.writeEndElement(); + contextWritten = true; + } + keys.clear(); + docu.clear(); + } else if (!keys.isEmpty()) { + docu << line; + } + } + } + + stream.writeEndElement(); + stream.writeEndDocument(); + + // An empty file causes error messages and a contextless file preventing this function to run + // again in order to generate the documentation successfully. Thus delete the file. + if (!contextWritten) { + file.close(); + file.remove(); + } + } + + BoolAspect useOtherFiles{this}; + BoolAspect useSpecificConfigFile{this}; + FilePathAspect specificConfigFile{this}; + BoolAspect useHomeFile{this}; + BoolAspect useCustomStyle{this}; + StringAspect customStyle{this}; +}; + +static ArtisticStyleSettings &settings() +{ + static ArtisticStyleSettings theSettings; + return theSettings; +} + +// ArtisticStyleOptionsPage + +class ArtisticStyleOptionsPageWidget : public Core::IOptionsPageWidget +{ +public: + ArtisticStyleOptionsPageWidget() + { + QGroupBox *options = nullptr; + + auto configurations = new ConfigurationPanel(this); + configurations->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + configurations->setSettings(&settings()); + configurations->setCurrentConfiguration(settings().customStyle()); + + using namespace Layouting; + + ArtisticStyleSettings &s = settings(); + + Column { + Group { + title(Tr::tr("Configuration")), + Form { + s.command, br, + s.supportedMimeTypes + } + }, + Group { + title(Tr::tr("Options")), + bindTo(&options), + Column { + s.useOtherFiles, + Row { s.useSpecificConfigFile, s.specificConfigFile }, + s.useHomeFile, + Row { s.useCustomStyle, configurations }, + } + }, + st + }.attachTo(this); + + setOnApply([&s, configurations] { + s.customStyle.setValue(configurations->currentConfiguration()); + s.save(); + }); + + s.read(); + + connect(s.command.pathChooser(), &PathChooser::validChanged, options, &QWidget::setEnabled); + options->setEnabled(s.command.pathChooser()->isValid()); + } +}; + +class ArtisticStyleOptionsPage final : public Core::IOptionsPage +{ +public: + ArtisticStyleOptionsPage() + { + setId("ArtisticStyle"); + setDisplayName(Tr::tr("Artistic Style")); + setCategory(Constants::OPTION_CATEGORY); + setWidgetCreator([] { return new ArtisticStyleOptionsPageWidget; }); + } +}; + +const ArtisticStyleOptionsPage settingsPage; + + +// Style + ArtisticStyle::ArtisticStyle() { Core::ActionContainer *menu = Core::ActionManager::createMenu("ArtisticStyle.Menu"); @@ -48,7 +261,7 @@ ArtisticStyle::ArtisticStyle() Core::ActionManager::actionContainer(Constants::MENU_ID)->addMenu(menu); - connect(&m_settings.supportedMimeTypes, &Utils::BaseAspect::changed, + connect(&settings().supportedMimeTypes, &Utils::BaseAspect::changed, this, [this] { updateActions(Core::EditorManager::currentEditor()); }); } @@ -59,7 +272,7 @@ QString ArtisticStyle::id() const void ArtisticStyle::updateActions(Core::IEditor *editor) { - m_formatFile->setEnabled(editor && m_settings.isApplicable(editor->document())); + m_formatFile->setEnabled(editor && settings().isApplicable(editor->document())); } void ArtisticStyle::formatFile() @@ -75,10 +288,10 @@ void ArtisticStyle::formatFile() QString ArtisticStyle::configurationFile() const { - if (m_settings.useCustomStyle()) - return m_settings.styleFileName(m_settings.customStyle()); + if (settings().useCustomStyle()) + return settings().styleFileName(settings().customStyle()); - if (m_settings.useOtherFiles()) { + if (settings().useOtherFiles()) { if (const ProjectExplorer::Project *project = ProjectExplorer::ProjectTree::currentProject()) { const Utils::FilePaths astyleRcfiles = project->files( @@ -91,13 +304,13 @@ QString ArtisticStyle::configurationFile() const } } - if (m_settings.useSpecificConfigFile()) { - const Utils::FilePath file = m_settings.specificConfigFile(); + if (settings().useSpecificConfigFile()) { + const Utils::FilePath file = settings().specificConfigFile(); if (file.exists()) return file.toUserOutput(); } - if (m_settings.useHomeFile()) { + if (settings().useHomeFile()) { const QDir homeDirectory = QDir::home(); QString file = homeDirectory.filePath(".astylerc"); if (QFile::exists(file)) @@ -118,17 +331,17 @@ Command ArtisticStyle::command() const bool ArtisticStyle::isApplicable(const Core::IDocument *document) const { - return m_settings.isApplicable(document); + return settings().isApplicable(document); } Command ArtisticStyle::command(const QString &cfgFile) const { Command command; - command.setExecutable(m_settings.command()); + command.setExecutable(settings().command()); command.addOption("-q"); command.addOption("--options=" + cfgFile); - const QVersionNumber version = m_settings.version(); + const QVersionNumber version = settings().version(); if (version > QVersionNumber(2, 3)) { command.setProcessing(Command::PipeProcessing); if (version == QVersionNumber(2, 4)) diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.h b/src/plugins/beautifier/artisticstyle/artisticstyle.h index 3f3f15946af..2f920924266 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.h +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.h @@ -5,7 +5,9 @@ #include "../beautifierabstracttool.h" -#include "artisticstylesettings.h" +QT_BEGIN_NAMESPACE +class QAction; +QT_END_NAMESPACE namespace Beautifier::Internal { @@ -25,8 +27,6 @@ private: TextEditor::Command command(const QString &cfgFile) const; QAction *m_formatFile = nullptr; - ArtisticStyleSettings m_settings; - ArtisticStyleOptionsPage m_page{&m_settings}; }; } // Beautifier::Internal diff --git a/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp b/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp deleted file mode 100644 index 3117269f0fa..00000000000 --- a/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (C) 2016 Lorenz Haas -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "artisticstylesettings.h" - -#include "artisticstyleconstants.h" -#include "../beautifierconstants.h" -#include "../beautifierplugin.h" -#include "../beautifiertr.h" -#include "../configurationpanel.h" - -#include <coreplugin/icore.h> - -#include <utils/layoutbuilder.h> -#include <utils/pathchooser.h> -#include <utils/process.h> -#include <utils/stringutils.h> - -#include <QApplication> -#include <QDateTime> -#include <QFile> -#include <QFileInfo> -#include <QGroupBox> -#include <QRegularExpression> -#include <QXmlStreamWriter> - -using namespace Utils; - -namespace Beautifier::Internal { - -const char SETTINGS_NAME[] = "artisticstyle"; - -ArtisticStyleSettings::ArtisticStyleSettings() - : AbstractSettings(SETTINGS_NAME, ".astyle") -{ - setVersionRegExp(QRegularExpression("([2-9]{1})\\.([0-9]{1,2})(\\.[1-9]{1})?$")); - command.setLabelText(Tr::tr("Artistic Style command:")); - command.setDefaultValue("astyle"); - command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle( - Tr::tr(Constants::ARTISTICSTYLE_DISPLAY_NAME))); - - useOtherFiles.setSettingsKey("useOtherFiles"); - useOtherFiles.setLabelText(Tr::tr("Use file *.astylerc defined in project files")); - useOtherFiles.setDefaultValue(true); - - useSpecificConfigFile.setSettingsKey("useSpecificConfigFile"); - useSpecificConfigFile.setLabelText(Tr::tr("Use specific config file:")); - - specificConfigFile.setSettingsKey("specificConfigFile"); - specificConfigFile.setExpectedKind(PathChooser::File); - specificConfigFile.setPromptDialogFilter(Tr::tr("AStyle (*.astylerc)")); - - useHomeFile.setSettingsKey("useHomeFile"); - useHomeFile.setLabelText(Tr::tr("Use file .astylerc or astylerc in HOME"). - replace("HOME", QDir::toNativeSeparators(QDir::home().absolutePath()))); - - useCustomStyle.setSettingsKey("useCustomStyle"); - useCustomStyle.setLabelText(Tr::tr("Use customized style:")); - - customStyle.setSettingsKey("customStyle"); - - documentationFilePath = - Core::ICore::userResourcePath(Beautifier::Constants::SETTINGS_DIRNAME) - .pathAppended(Beautifier::Constants::DOCUMENTATION_DIRNAME) - .pathAppended(SETTINGS_NAME) - .stringAppended(".xml"); - - read(); -} - -void ArtisticStyleSettings::createDocumentationFile() const -{ - Process process; - process.setTimeoutS(2); - process.setCommand({command(), {"-h"}}); - process.runBlocking(); - if (process.result() != ProcessResult::FinishedWithSuccess) - return; - - if (!documentationFilePath.exists()) - documentationFilePath.parentDir().ensureWritableDir(); - - QFile file(documentationFilePath.toFSPathString()); - if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) - return; - - bool contextWritten = false; - QXmlStreamWriter stream(&file); - stream.setAutoFormatting(true); - stream.writeStartDocument("1.0", true); - stream.writeComment("Created " + QDateTime::currentDateTime().toString(Qt::ISODate)); - stream.writeStartElement(Constants::DOCUMENTATION_XMLROOT); - - // astyle writes its output to 'error'... - const QStringList lines = process.cleanedStdErr().split(QLatin1Char('\n')); - QStringList keys; - QStringList docu; - for (QString line : lines) { - line = line.trimmed(); - if ((line.startsWith("--") && !line.startsWith("---")) || line.startsWith("OR ")) { - const QStringList rawKeys = line.split(" OR ", Qt::SkipEmptyParts); - for (QString k : rawKeys) { - k = k.trimmed(); - k.remove('#'); - keys << k; - if (k.startsWith("--")) - keys << k.right(k.size() - 2); - } - } else { - if (line.isEmpty()) { - if (!keys.isEmpty()) { - // Write entry - stream.writeStartElement(Constants::DOCUMENTATION_XMLENTRY); - stream.writeStartElement(Constants::DOCUMENTATION_XMLKEYS); - for (const QString &key : std::as_const(keys)) - stream.writeTextElement(Constants::DOCUMENTATION_XMLKEY, key); - stream.writeEndElement(); - const QString text = "<p><span class=\"option\">" - + keys.filter(QRegularExpression("^\\-")).join(", ") + "</span></p><p>" - + (docu.join(' ').toHtmlEscaped()) + "</p>"; - stream.writeTextElement(Constants::DOCUMENTATION_XMLDOC, text); - stream.writeEndElement(); - contextWritten = true; - } - keys.clear(); - docu.clear(); - } else if (!keys.isEmpty()) { - docu << line; - } - } - } - - stream.writeEndElement(); - stream.writeEndDocument(); - - // An empty file causes error messages and a contextless file preventing this function to run - // again in order to generate the documentation successfully. Thus delete the file. - if (!contextWritten) { - file.close(); - file.remove(); - } -} - -class ArtisticStyleOptionsPageWidget : public Core::IOptionsPageWidget -{ -public: - explicit ArtisticStyleOptionsPageWidget(ArtisticStyleSettings *settings) - { - QGroupBox *options = nullptr; - - auto configurations = new ConfigurationPanel(this); - configurations->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - configurations->setSettings(settings); - configurations->setCurrentConfiguration(settings->customStyle()); - - using namespace Layouting; - - ArtisticStyleSettings &s = *settings; - - Column { - Group { - title(Tr::tr("Configuration")), - Form { - s.command, br, - s.supportedMimeTypes - } - }, - Group { - title(Tr::tr("Options")), - bindTo(&options), - Column { - s.useOtherFiles, - Row { s.useSpecificConfigFile, s.specificConfigFile }, - s.useHomeFile, - Row { s.useCustomStyle, configurations }, - } - }, - st - }.attachTo(this); - - setOnApply([&s, configurations] { - s.customStyle.setValue(configurations->currentConfiguration()); - s.save(); - }); - - s.read(); - - connect(s.command.pathChooser(), &PathChooser::validChanged, options, &QWidget::setEnabled); - options->setEnabled(s.command.pathChooser()->isValid()); - } -}; - -ArtisticStyleOptionsPage::ArtisticStyleOptionsPage(ArtisticStyleSettings *settings) -{ - setId("ArtisticStyle"); - setDisplayName(Tr::tr("Artistic Style")); - setCategory(Constants::OPTION_CATEGORY); - setWidgetCreator([settings] { return new ArtisticStyleOptionsPageWidget(settings); }); -} - -} // Beautifier::Internal diff --git a/src/plugins/beautifier/artisticstyle/artisticstylesettings.h b/src/plugins/beautifier/artisticstyle/artisticstylesettings.h deleted file mode 100644 index 25932cf8db8..00000000000 --- a/src/plugins/beautifier/artisticstyle/artisticstylesettings.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2016 Lorenz Haas -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "../abstractsettings.h" - -namespace Beautifier::Internal { - -class ArtisticStyleSettings : public AbstractSettings -{ -public: - ArtisticStyleSettings(); - - Utils::BoolAspect useOtherFiles{this}; - Utils::BoolAspect useSpecificConfigFile{this}; - Utils::FilePathAspect specificConfigFile{this}; - Utils::BoolAspect useHomeFile{this}; - Utils::BoolAspect useCustomStyle{this}; - Utils::StringAspect customStyle{this}; - - void createDocumentationFile() const override; -}; - -class ArtisticStyleOptionsPage final : public Core::IOptionsPage -{ -public: - explicit ArtisticStyleOptionsPage(ArtisticStyleSettings *settings); -}; - -} // Beautifier::Internal diff --git a/src/plugins/beautifier/beautifier.qbs b/src/plugins/beautifier/beautifier.qbs index 24fecd671f1..bf8cd8c6749 100644 --- a/src/plugins/beautifier/beautifier.qbs +++ b/src/plugins/beautifier/beautifier.qbs @@ -36,8 +36,6 @@ QtcPlugin { "artisticstyle.cpp", "artisticstyle.h", "artisticstyleconstants.h", - "artisticstylesettings.cpp", - "artisticstylesettings.h" ] } From 60fb0fd902f5a37e829db1253e475f16d6b22235 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 07:26:26 +0200 Subject: [PATCH 0212/1777] Beautifier: Merge Uncrustify style file pairs Follow ArtisticStyle. Change-Id: I599e70912a5895ce8c59a5b2df2f3ccb4b291d01 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/beautifier/CMakeLists.txt | 1 - src/plugins/beautifier/beautifier.qbs | 2 - .../beautifier/uncrustify/uncrustify.cpp | 235 +++++++++++++++++- .../beautifier/uncrustify/uncrustify.h | 6 +- .../uncrustify/uncrustifysettings.cpp | 197 --------------- .../uncrustify/uncrustifysettings.h | 34 --- 6 files changed, 225 insertions(+), 250 deletions(-) delete mode 100644 src/plugins/beautifier/uncrustify/uncrustifysettings.cpp delete mode 100644 src/plugins/beautifier/uncrustify/uncrustifysettings.h diff --git a/src/plugins/beautifier/CMakeLists.txt b/src/plugins/beautifier/CMakeLists.txt index 050be358e7e..48de96ce576 100644 --- a/src/plugins/beautifier/CMakeLists.txt +++ b/src/plugins/beautifier/CMakeLists.txt @@ -19,5 +19,4 @@ add_qtc_plugin(Beautifier generalsettings.cpp generalsettings.h uncrustify/uncrustify.cpp uncrustify/uncrustify.h uncrustify/uncrustifyconstants.h - uncrustify/uncrustifysettings.cpp uncrustify/uncrustifysettings.h ) diff --git a/src/plugins/beautifier/beautifier.qbs b/src/plugins/beautifier/beautifier.qbs index bf8cd8c6749..178a5055fab 100644 --- a/src/plugins/beautifier/beautifier.qbs +++ b/src/plugins/beautifier/beautifier.qbs @@ -58,8 +58,6 @@ QtcPlugin { "uncrustify.cpp", "uncrustify.h", "uncrustifyconstants.h", - "uncrustifysettings.cpp", - "uncrustifysettings.h" ] } } diff --git a/src/plugins/beautifier/uncrustify/uncrustify.cpp b/src/plugins/beautifier/uncrustify/uncrustify.cpp index 7079d4665ba..da29e7aeabd 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustify.cpp @@ -7,9 +7,11 @@ #include "uncrustifyconstants.h" +#include "../abstractsettings.h" #include "../beautifierconstants.h" #include "../beautifierplugin.h" #include "../beautifiertr.h" +#include "../configurationpanel.h" #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> @@ -17,6 +19,7 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/ieditor.h> +#include <coreplugin/icore.h> #include <coreplugin/idocument.h> #include <projectexplorer/project.h> @@ -26,17 +29,223 @@ #include <texteditor/formattexteditor.h> #include <texteditor/texteditor.h> -#include <utils/filepath.h> +#include <utils/aspects.h> +#include <utils/layoutbuilder.h> +#include <utils/pathchooser.h> +#include <utils/process.h> #include <QAction> +#include <QCheckBox> +#include <QDateTime> +#include <QFile> +#include <QFileInfo> +#include <QGroupBox> +#include <QLabel> +#include <QLineEdit> #include <QMenu> +#include <QRegularExpression> #include <QVersionNumber> +#include <QXmlStreamWriter> using namespace TextEditor; using namespace Utils; namespace Beautifier::Internal { +const char SETTINGS_NAME[] = "uncrustify"; + +class UncrustifySettings : public AbstractSettings +{ +public: + UncrustifySettings() + : AbstractSettings(SETTINGS_NAME, ".cfg") + { + setVersionRegExp(QRegularExpression("([0-9]{1})\\.([0-9]{2})")); + + command.setDefaultValue("uncrustify"); + command.setLabelText(Tr::tr("Uncrustify command:")); + command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle( + Tr::tr(Constants::UNCRUSTIFY_DISPLAY_NAME))); + + useOtherFiles.setSettingsKey("useOtherFiles"); + useOtherFiles.setDefaultValue(true); + useOtherFiles.setLabelText(Tr::tr("Use file uncrustify.cfg defined in project files")); + + useHomeFile.setSettingsKey("useHomeFile"); + useHomeFile.setLabelText(Tr::tr("Use file uncrustify.cfg in HOME") + .replace( "HOME", QDir::toNativeSeparators(QDir::home().absolutePath()))); + + useCustomStyle.setSettingsKey("useCustomStyle"); + useCustomStyle.setLabelText(Tr::tr("Use customized style:")); + + useSpecificConfigFile.setSettingsKey("useSpecificConfigFile"); + useSpecificConfigFile.setLabelText(Tr::tr("Use file specific uncrustify.cfg")); + + customStyle.setSettingsKey("customStyle"); + + formatEntireFileFallback.setSettingsKey("formatEntireFileFallback"); + formatEntireFileFallback.setDefaultValue(true); + formatEntireFileFallback.setLabelText(Tr::tr("Format entire file if no text was selected")); + formatEntireFileFallback.setToolTip(Tr::tr("For action Format Selected Text")); + + specificConfigFile.setSettingsKey("specificConfigFile"); + specificConfigFile.setExpectedKind(Utils::PathChooser::File); + specificConfigFile.setPromptDialogFilter(Tr::tr("Uncrustify file (*.cfg)")); + + documentationFilePath = Core::ICore::userResourcePath(Constants::SETTINGS_DIRNAME) + .pathAppended(Constants::DOCUMENTATION_DIRNAME) + .pathAppended(SETTINGS_NAME).stringAppended(".xml"); + + read(); + } + + void createDocumentationFile() const override + { + Process process; + process.setTimeoutS(2); + process.setCommand({command(), {"--show-config"}}); + process.runBlocking(); + if (process.result() != ProcessResult::FinishedWithSuccess) + return; + + QFile file(documentationFilePath.toFSPathString()); + const QFileInfo fi(file); + if (!fi.exists()) + fi.dir().mkpath(fi.absolutePath()); + if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) + return; + + bool contextWritten = false; + QXmlStreamWriter stream(&file); + stream.setAutoFormatting(true); + stream.writeStartDocument("1.0", true); + stream.writeComment("Created " + QDateTime::currentDateTime().toString(Qt::ISODate)); + stream.writeStartElement(Constants::DOCUMENTATION_XMLROOT); + + const QStringList lines = process.allOutput().split(QLatin1Char('\n')); + const int totalLines = lines.count(); + for (int i = 0; i < totalLines; ++i) { + const QString &line = lines.at(i); + if (line.startsWith('#') || line.trimmed().isEmpty()) + continue; + + const int firstSpace = line.indexOf(' '); + const QString keyword = line.left(firstSpace); + const QString options = line.right(line.size() - firstSpace).trimmed(); + QStringList docu; + while (++i < totalLines) { + const QString &subline = lines.at(i); + if (line.startsWith('#') || subline.trimmed().isEmpty()) { + const QString text = "<p><span class=\"option\">" + keyword + + "</span> <span class=\"param\">" + options + + "</span></p><p>" + docu.join(' ').toHtmlEscaped() + "</p>"; + stream.writeStartElement(Constants::DOCUMENTATION_XMLENTRY); + stream.writeTextElement(Constants::DOCUMENTATION_XMLKEY, keyword); + stream.writeTextElement(Constants::DOCUMENTATION_XMLDOC, text); + stream.writeEndElement(); + contextWritten = true; + break; + } else { + docu << subline; + } + } + } + + stream.writeEndElement(); + stream.writeEndDocument(); + + // An empty file causes error messages and a contextless file preventing this function to run + // again in order to generate the documentation successfully. Thus delete the file. + if (!contextWritten) { + file.close(); + file.remove(); + } + } + + BoolAspect useOtherFiles{this}; + BoolAspect useHomeFile{this}; + BoolAspect useCustomStyle{this}; + + StringAspect customStyle{this}; + BoolAspect formatEntireFileFallback{this}; + + FilePathAspect specificConfigFile{this}; + BoolAspect useSpecificConfigFile{this}; +}; + +static UncrustifySettings &settings() +{ + static UncrustifySettings theSettings; + return theSettings; +} + +class UncrustifyOptionsPageWidget : public Core::IOptionsPageWidget +{ +public: + explicit UncrustifyOptionsPageWidget() + { + UncrustifySettings &s = settings(); + + auto configurations = new ConfigurationPanel(this); + configurations->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + configurations->setSettings(&settings()); + configurations->setCurrentConfiguration(settings().customStyle()); + + QGroupBox *options = nullptr; + + using namespace Layouting; + + Column { + Group { + title(Tr::tr("Configuration")), + Form { + s.command, br, + s.supportedMimeTypes, + } + }, + Group { + title(Tr::tr("Options")), + bindTo(&options), + Column { + s.useOtherFiles, + Row { s.useSpecificConfigFile, s.specificConfigFile }, + s.useHomeFile, + Row { s.useCustomStyle, configurations }, + s.formatEntireFileFallback + }, + }, + st + }.attachTo(this); + + s.read(); + + connect(s.command.pathChooser(), &PathChooser::validChanged, options, &QWidget::setEnabled); + options->setEnabled(s.command.pathChooser()->isValid()); + + setOnApply([&s, configurations] { + s.customStyle.setValue(configurations->currentConfiguration()); + s.save(); + }); + } +}; + +class UncrustifyOptionsPage final : public Core::IOptionsPage +{ +public: + UncrustifyOptionsPage() + { + setId("Uncrustify"); + setDisplayName(Tr::tr("Uncrustify")); + setCategory(Constants::OPTION_CATEGORY); + setWidgetCreator([] { return new UncrustifyOptionsPageWidget; }); + } +}; + +const UncrustifyOptionsPage settingsPage; + + +// Uncrustify + Uncrustify::Uncrustify() { Core::ActionContainer *menu = Core::ActionManager::createMenu("Uncrustify.Menu"); @@ -55,7 +264,7 @@ Uncrustify::Uncrustify() Core::ActionManager::actionContainer(Constants::MENU_ID)->addMenu(menu); - connect(&m_settings.supportedMimeTypes, &Utils::BaseAspect::changed, + connect(&settings().supportedMimeTypes, &Utils::BaseAspect::changed, this, [this] { updateActions(Core::EditorManager::currentEditor()); }); } @@ -66,7 +275,7 @@ QString Uncrustify::id() const void Uncrustify::updateActions(Core::IEditor *editor) { - const bool enabled = editor && m_settings.isApplicable(editor->document()); + const bool enabled = editor && settings().isApplicable(editor->document()); m_formatFile->setEnabled(enabled); m_formatRange->setEnabled(enabled); } @@ -108,17 +317,17 @@ void Uncrustify::formatSelectedText() tc.movePosition(QTextCursor::EndOfLine); const int endPos = tc.position(); formatCurrentFile(command(cfgFileName, true), startPos, endPos); - } else if (m_settings.formatEntireFileFallback()) { + } else if (settings().formatEntireFileFallback()) { formatFile(); } } FilePath Uncrustify::configurationFile() const { - if (m_settings.useCustomStyle()) - return FilePath::fromUserInput(m_settings.styleFileName(m_settings.customStyle())); + if (settings().useCustomStyle()) + return FilePath::fromUserInput(settings().styleFileName(settings().customStyle())); - if (m_settings.useOtherFiles()) { + if (settings().useOtherFiles()) { using namespace ProjectExplorer; if (const Project *project = ProjectTree::currentProject()) { const FilePaths files = project->files([](const Node *n) { @@ -130,13 +339,13 @@ FilePath Uncrustify::configurationFile() const } } - if (m_settings.useSpecificConfigFile()) { - const FilePath file = m_settings.specificConfigFile(); + if (settings().useSpecificConfigFile()) { + const FilePath file = settings().specificConfigFile(); if (file.exists()) return file; } - if (m_settings.useHomeFile()) { + if (settings().useHomeFile()) { const FilePath file = FileUtils::homePath() / "uncrustify.cfg"; if (file.exists()) return file; @@ -153,15 +362,15 @@ Command Uncrustify::command() const bool Uncrustify::isApplicable(const Core::IDocument *document) const { - return m_settings.isApplicable(document); + return settings().isApplicable(document); } Command Uncrustify::command(const FilePath &cfgFile, bool fragment) const { Command command; - command.setExecutable(m_settings.command()); + command.setExecutable(settings().command()); command.setProcessing(Command::PipeProcessing); - if (m_settings.version() >= QVersionNumber(0, 62)) { + if (settings().version() >= QVersionNumber(0, 62)) { command.addOption("--assume"); command.addOption("%file"); } else { diff --git a/src/plugins/beautifier/uncrustify/uncrustify.h b/src/plugins/beautifier/uncrustify/uncrustify.h index 774a400017e..09f6c2273d1 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.h +++ b/src/plugins/beautifier/uncrustify/uncrustify.h @@ -5,7 +5,9 @@ #include "../beautifierabstracttool.h" -#include "uncrustifysettings.h" +QT_BEGIN_NAMESPACE +class QAction; +QT_END_NAMESPACE namespace Beautifier::Internal { @@ -27,8 +29,6 @@ private: QAction *m_formatFile = nullptr; QAction *m_formatRange = nullptr; - UncrustifySettings m_settings; - UncrustifyOptionsPage m_page{&m_settings}; }; } // Beautifier::Internal diff --git a/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp b/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp deleted file mode 100644 index 1aa9e8502c6..00000000000 --- a/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (C) 2016 Lorenz Haas -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "uncrustifysettings.h" - -#include "uncrustifyconstants.h" -#include "../beautifierconstants.h" -#include "../beautifierplugin.h" -#include "../beautifiertr.h" -#include "../configurationpanel.h" - -#include <coreplugin/icore.h> - -#include <utils/layoutbuilder.h> -#include <utils/pathchooser.h> -#include <utils/process.h> - -#include <QCheckBox> -#include <QDateTime> -#include <QFile> -#include <QFileInfo> -#include <QGroupBox> -#include <QLabel> -#include <QLineEdit> -#include <QRegularExpression> -#include <QXmlStreamWriter> - -using namespace Utils; - -namespace Beautifier::Internal { - -const char SETTINGS_NAME[] = "uncrustify"; - -UncrustifySettings::UncrustifySettings() - : AbstractSettings(SETTINGS_NAME, ".cfg") -{ - setVersionRegExp(QRegularExpression("([0-9]{1})\\.([0-9]{2})")); - - command.setDefaultValue("uncrustify"); - command.setLabelText(Tr::tr("Uncrustify command:")); - command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle( - Tr::tr(Constants::UNCRUSTIFY_DISPLAY_NAME))); - - useOtherFiles.setSettingsKey("useOtherFiles"); - useOtherFiles.setDefaultValue(true); - useOtherFiles.setLabelText(Tr::tr("Use file uncrustify.cfg defined in project files")); - - useHomeFile.setSettingsKey("useHomeFile"); - useHomeFile.setLabelText(Tr::tr("Use file uncrustify.cfg in HOME") - .replace( "HOME", QDir::toNativeSeparators(QDir::home().absolutePath()))); - - useCustomStyle.setSettingsKey("useCustomStyle"); - useCustomStyle.setLabelText(Tr::tr("Use customized style:")); - - useSpecificConfigFile.setSettingsKey("useSpecificConfigFile"); - useSpecificConfigFile.setLabelText(Tr::tr("Use file specific uncrustify.cfg")); - - customStyle.setSettingsKey("customStyle"); - - formatEntireFileFallback.setSettingsKey("formatEntireFileFallback"); - formatEntireFileFallback.setDefaultValue(true); - formatEntireFileFallback.setLabelText(Tr::tr("Format entire file if no text was selected")); - formatEntireFileFallback.setToolTip(Tr::tr("For action Format Selected Text")); - - specificConfigFile.setSettingsKey("specificConfigFile"); - specificConfigFile.setExpectedKind(Utils::PathChooser::File); - specificConfigFile.setPromptDialogFilter(Tr::tr("Uncrustify file (*.cfg)")); - - documentationFilePath = Core::ICore::userResourcePath(Constants::SETTINGS_DIRNAME) - .pathAppended(Constants::DOCUMENTATION_DIRNAME) - .pathAppended(SETTINGS_NAME).stringAppended(".xml"); - - read(); -} - -void UncrustifySettings::createDocumentationFile() const -{ - Process process; - process.setTimeoutS(2); - process.setCommand({command(), {"--show-config"}}); - process.runBlocking(); - if (process.result() != ProcessResult::FinishedWithSuccess) - return; - - QFile file(documentationFilePath.toFSPathString()); - const QFileInfo fi(file); - if (!fi.exists()) - fi.dir().mkpath(fi.absolutePath()); - if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) - return; - - bool contextWritten = false; - QXmlStreamWriter stream(&file); - stream.setAutoFormatting(true); - stream.writeStartDocument("1.0", true); - stream.writeComment("Created " + QDateTime::currentDateTime().toString(Qt::ISODate)); - stream.writeStartElement(Constants::DOCUMENTATION_XMLROOT); - - const QStringList lines = process.allOutput().split(QLatin1Char('\n')); - const int totalLines = lines.count(); - for (int i = 0; i < totalLines; ++i) { - const QString &line = lines.at(i); - if (line.startsWith('#') || line.trimmed().isEmpty()) - continue; - - const int firstSpace = line.indexOf(' '); - const QString keyword = line.left(firstSpace); - const QString options = line.right(line.size() - firstSpace).trimmed(); - QStringList docu; - while (++i < totalLines) { - const QString &subline = lines.at(i); - if (line.startsWith('#') || subline.trimmed().isEmpty()) { - const QString text = "<p><span class=\"option\">" + keyword - + "</span> <span class=\"param\">" + options - + "</span></p><p>" + docu.join(' ').toHtmlEscaped() + "</p>"; - stream.writeStartElement(Constants::DOCUMENTATION_XMLENTRY); - stream.writeTextElement(Constants::DOCUMENTATION_XMLKEY, keyword); - stream.writeTextElement(Constants::DOCUMENTATION_XMLDOC, text); - stream.writeEndElement(); - contextWritten = true; - break; - } else { - docu << subline; - } - } - } - - stream.writeEndElement(); - stream.writeEndDocument(); - - // An empty file causes error messages and a contextless file preventing this function to run - // again in order to generate the documentation successfully. Thus delete the file. - if (!contextWritten) { - file.close(); - file.remove(); - } -} - -class UncrustifyOptionsPageWidget : public Core::IOptionsPageWidget -{ -public: - explicit UncrustifyOptionsPageWidget(UncrustifySettings *settings) - { - UncrustifySettings &s = *settings; - - auto configurations = new ConfigurationPanel(this); - configurations->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - configurations->setSettings(settings); - configurations->setCurrentConfiguration(settings->customStyle()); - - QGroupBox *options = nullptr; - - using namespace Layouting; - - Column { - Group { - title(Tr::tr("Configuration")), - Form { - s.command, br, - s.supportedMimeTypes, - } - }, - Group { - title(Tr::tr("Options")), - bindTo(&options), - Column { - s.useOtherFiles, - Row { s.useSpecificConfigFile, s.specificConfigFile }, - s.useHomeFile, - Row { s.useCustomStyle, configurations }, - s.formatEntireFileFallback - }, - }, - st - }.attachTo(this); - - s.read(); - - connect(s.command.pathChooser(), &PathChooser::validChanged, options, &QWidget::setEnabled); - options->setEnabled(s.command.pathChooser()->isValid()); - - setOnApply([&s, configurations] { - s.customStyle.setValue(configurations->currentConfiguration()); - s.save(); - }); - } -}; - -UncrustifyOptionsPage::UncrustifyOptionsPage(UncrustifySettings *settings) -{ - setId("Uncrustify"); - setDisplayName(Tr::tr("Uncrustify")); - setCategory(Constants::OPTION_CATEGORY); - setWidgetCreator([settings] { return new UncrustifyOptionsPageWidget(settings); }); -} - -} // Beautifier::Internal diff --git a/src/plugins/beautifier/uncrustify/uncrustifysettings.h b/src/plugins/beautifier/uncrustify/uncrustifysettings.h deleted file mode 100644 index 3911cfa9e94..00000000000 --- a/src/plugins/beautifier/uncrustify/uncrustifysettings.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2016 Lorenz Haas -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "../abstractsettings.h" - -namespace Beautifier::Internal { - -class UncrustifySettings : public AbstractSettings -{ -public: - UncrustifySettings(); - - void createDocumentationFile() const override; - - Utils::BoolAspect useOtherFiles{this}; - Utils::BoolAspect useHomeFile{this}; - Utils::BoolAspect useCustomStyle{this}; - - Utils::StringAspect customStyle{this}; - Utils::BoolAspect formatEntireFileFallback{this}; - - Utils::FilePathAspect specificConfigFile{this}; - Utils::BoolAspect useSpecificConfigFile{this}; -}; - -class UncrustifyOptionsPage final : public Core::IOptionsPage -{ -public: - explicit UncrustifyOptionsPage(UncrustifySettings *settings); -}; - -} // Beautifier::Internal From 694d81ad63e7781f496005077982f8af150785df Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 17:46:57 +0200 Subject: [PATCH 0213/1777] Autotest: Adapt to changed settings access pattern again Settings are created on first access now, even though this doesn't matter much here as this happens unconditionally in AutotestPluginPrivate ctor via m_frameworkManager.synchronizeSettings() Change-Id: I340927cf107d7e4b2268e842d23f1a89898e8a92 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/autotest/autotestplugin.cpp | 3 +-- .../autotest/boost/boosttestconfiguration.cpp | 16 ++++++++-------- .../autotest/catch/catchconfiguration.cpp | 2 +- src/plugins/autotest/ctest/ctesttreeitem.cpp | 2 +- .../autotest/gtest/gtestconfiguration.cpp | 2 +- src/plugins/autotest/qtest/qttest_utils.cpp | 2 +- .../autotest/qtest/qttestconfiguration.cpp | 2 +- .../autotest/quick/quicktestconfiguration.cpp | 2 +- src/plugins/autotest/testcodeparser.cpp | 2 +- src/plugins/autotest/testframeworkmanager.cpp | 12 ++++++------ src/plugins/autotest/testframeworkmanager.h | 5 +---- src/plugins/autotest/testresultdelegate.cpp | 6 +++--- src/plugins/autotest/testresultmodel.cpp | 2 +- src/plugins/autotest/testresultspane.cpp | 7 +++---- src/plugins/autotest/testrunner.cpp | 12 ++++++------ src/plugins/autotest/testsettings.cpp | 9 +++------ src/plugins/autotest/testsettings.h | 4 ++-- src/plugins/autotest/testsettingspage.cpp | 4 ++-- 18 files changed, 43 insertions(+), 51 deletions(-) diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index f18f30c14e5..cb318c96b6a 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -94,7 +94,6 @@ public: void onRunFileTriggered(); void onRunUnderCursorTriggered(TestRunMode mode); - TestSettings m_settings; TestSettingsPage m_testSettingPage; TestCodeParser m_testCodeParser; @@ -149,7 +148,7 @@ AutotestPluginPrivate::AutotestPluginPrivate() }); ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory); - TestFrameworkManager::activateFrameworksAndToolsFromSettings(&m_settings); + TestFrameworkManager::activateFrameworksAndToolsFromSettings(); m_testTreeModel.synchronizeTestFrameworks(); m_testTreeModel.synchronizeTestTools(); diff --git a/src/plugins/autotest/boost/boosttestconfiguration.cpp b/src/plugins/autotest/boost/boosttestconfiguration.cpp index 768161a5c0c..088506199c8 100644 --- a/src/plugins/autotest/boost/boosttestconfiguration.cpp +++ b/src/plugins/autotest/boost/boosttestconfiguration.cpp @@ -88,17 +88,17 @@ QStringList BoostTestConfiguration::argumentsForTestRunner(QStringList *omitted) { auto boostSettings = static_cast<BoostTestSettings *>(framework()->testSettings()); QStringList arguments; - arguments << "-l" << BoostTestSettings::logLevelToOption(LogLevel(boostSettings->logLevel.value())); - arguments << "-r" << BoostTestSettings::reportLevelToOption(ReportLevel(boostSettings->reportLevel.value())); + arguments << "-l" << BoostTestSettings::logLevelToOption(LogLevel(boostSettings->logLevel())); + arguments << "-r" << BoostTestSettings::reportLevelToOption(ReportLevel(boostSettings->reportLevel())); - if (boostSettings->randomize.value()) - arguments << QString("--random=").append(QString::number(boostSettings->seed.value())); + if (boostSettings->randomize()) + arguments << QString("--random=").append(QString::number(boostSettings->seed())); - if (boostSettings->systemErrors.value()) + if (boostSettings->systemErrors()) arguments << "-s"; - if (boostSettings->fpExceptions.value()) + if (boostSettings->fpExceptions()) arguments << "--detect_fp_exceptions"; - if (!boostSettings->memLeaks.value()) + if (!boostSettings->memLeaks()) arguments << "--detect_memory_leaks=0"; // TODO improve the test case gathering and arguments building to avoid too long command lines @@ -110,7 +110,7 @@ QStringList BoostTestConfiguration::argumentsForTestRunner(QStringList *omitted) arguments << "-t" << "\"" + test + "\""; } - if (TestSettings::instance()->processArgs()) { + if (testSettings().processArgs()) { arguments << filterInterfering(runnable().command.arguments().split( ' ', Qt::SkipEmptyParts), omitted); } diff --git a/src/plugins/autotest/catch/catchconfiguration.cpp b/src/plugins/autotest/catch/catchconfiguration.cpp index a5036398688..0cb9aef7c5c 100644 --- a/src/plugins/autotest/catch/catchconfiguration.cpp +++ b/src/plugins/autotest/catch/catchconfiguration.cpp @@ -79,7 +79,7 @@ QStringList CatchConfiguration::argumentsForTestRunner(QStringList *omitted) con arguments << "\"" + testCases().join("\", \"") + "\""; arguments << "--reporter" << "xml"; - if (TestSettings::instance()->processArgs()) { + if (testSettings().processArgs()) { arguments << filterInterfering(runnable().command.arguments().split( ' ', Qt::SkipEmptyParts), omitted); } diff --git a/src/plugins/autotest/ctest/ctesttreeitem.cpp b/src/plugins/autotest/ctest/ctesttreeitem.cpp index 9ffc06b028e..d95838a5a79 100644 --- a/src/plugins/autotest/ctest/ctesttreeitem.cpp +++ b/src/plugins/autotest/ctest/ctesttreeitem.cpp @@ -88,7 +88,7 @@ QList<ITestConfiguration *> CTestTreeItem::testConfigurationsFor(const QStringLi return {}; const ProjectExplorer::BuildSystem *buildSystem = target->buildSystem(); - QStringList options{"--timeout", QString::number(TestSettings::instance()->timeout() / 1000)}; + QStringList options{"--timeout", QString::number(testSettings().timeout() / 1000)}; auto ctestSettings = static_cast<CTestSettings *>(testBase()->testSettings()); options << ctestSettings->activeSettingsAsOptions(); CommandLine command = buildSystem->commandLineForTests(selected, options); diff --git a/src/plugins/autotest/gtest/gtestconfiguration.cpp b/src/plugins/autotest/gtest/gtestconfiguration.cpp index 8680da1fcaf..c2a6b4c0d08 100644 --- a/src/plugins/autotest/gtest/gtestconfiguration.cpp +++ b/src/plugins/autotest/gtest/gtestconfiguration.cpp @@ -54,7 +54,7 @@ QStringList filterInterfering(const QStringList &provided, QStringList *omitted) QStringList GTestConfiguration::argumentsForTestRunner(QStringList *omitted) const { QStringList arguments; - if (TestSettings::instance()->processArgs()) { + if (testSettings().processArgs()) { arguments << filterInterfering(runnable().command.arguments().split( ' ', Qt::SkipEmptyParts), omitted); } diff --git a/src/plugins/autotest/qtest/qttest_utils.cpp b/src/plugins/autotest/qtest/qttest_utils.cpp index 9bedaa64c37..e40f50448c3 100644 --- a/src/plugins/autotest/qtest/qttest_utils.cpp +++ b/src/plugins/autotest/qtest/qttest_utils.cpp @@ -137,7 +137,7 @@ Environment prepareBasicEnvironment(const Environment &env) result.set("QT_FORCE_STDERR_LOGGING", "1"); result.set("QT_LOGGING_TO_CONSOLE", "1"); } - const int timeout = TestSettings::instance()->timeout(); + const int timeout = testSettings().timeout(); if (timeout > 5 * 60 * 1000) // Qt5.5 introduced hard limit, Qt5.6.1 added env var to raise this result.set("QTEST_FUNCTION_TIMEOUT", QString::number(timeout)); return result; diff --git a/src/plugins/autotest/qtest/qttestconfiguration.cpp b/src/plugins/autotest/qtest/qttestconfiguration.cpp index 5dcf59a48e1..9648e69d547 100644 --- a/src/plugins/autotest/qtest/qttestconfiguration.cpp +++ b/src/plugins/autotest/qtest/qttestconfiguration.cpp @@ -39,7 +39,7 @@ TestOutputReader *QtTestConfiguration::createOutputReader(Process *app) const QStringList QtTestConfiguration::argumentsForTestRunner(QStringList *omitted) const { QStringList arguments; - if (TestSettings::instance()->processArgs()) { + if (testSettings().processArgs()) { arguments.append(QTestUtils::filterInterfering( runnable().command.arguments().split(' ', Qt::SkipEmptyParts), omitted, false)); diff --git a/src/plugins/autotest/quick/quicktestconfiguration.cpp b/src/plugins/autotest/quick/quicktestconfiguration.cpp index e37b208ac44..f757dfb0255 100644 --- a/src/plugins/autotest/quick/quicktestconfiguration.cpp +++ b/src/plugins/autotest/quick/quicktestconfiguration.cpp @@ -32,7 +32,7 @@ TestOutputReader *QuickTestConfiguration::createOutputReader(Process *app) const QStringList QuickTestConfiguration::argumentsForTestRunner(QStringList *omitted) const { QStringList arguments; - if (TestSettings::instance()->processArgs()) { + if (testSettings().processArgs()) { arguments.append(QTestUtils::filterInterfering (runnable().command.arguments().split(' ', Qt::SkipEmptyParts), omitted, true)); diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index ec4a3080cc3..2648d63cd03 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -361,7 +361,7 @@ void TestCodeParser::scanForTests(const QSet<FilePath> &filePaths, using namespace Tasking; - int limit = TestSettings::instance()->scanThreadLimit(); + int limit = testSettings().scanThreadLimit(); if (limit == 0) limit = std::max(QThread::idealThreadCount() / 4, 1); qCDebug(LOG) << "Using" << limit << "threads for scan."; diff --git a/src/plugins/autotest/testframeworkmanager.cpp b/src/plugins/autotest/testframeworkmanager.cpp index 9b426abf28e..26f455cf9b5 100644 --- a/src/plugins/autotest/testframeworkmanager.cpp +++ b/src/plugins/autotest/testframeworkmanager.cpp @@ -45,15 +45,15 @@ bool TestFrameworkManager::registerTestTool(ITestTool *testTool) return true; } -void TestFrameworkManager::activateFrameworksAndToolsFromSettings( - const Internal::TestSettings *settings) +void TestFrameworkManager::activateFrameworksAndToolsFromSettings() { + const Internal::TestSettings &settings = Internal::testSettings(); for (ITestFramework *framework : std::as_const(s_instance->m_registeredFrameworks)) { - framework->setActive(settings->frameworks.value(framework->id(), false)); - framework->setGrouping(settings->frameworksGrouping.value(framework->id(), false)); + framework->setActive(settings.frameworks.value(framework->id(), false)); + framework->setGrouping(settings.frameworksGrouping.value(framework->id(), false)); } for (ITestTool *testTool : std::as_const(s_instance->m_registeredTestTools)) - testTool->setActive(settings->tools.value(testTool->id(), false)); + testTool->setActive(settings.tools.value(testTool->id(), false)); } const TestFrameworks TestFrameworkManager::registeredFrameworks() @@ -95,7 +95,7 @@ ITestTool *TestFrameworkManager::testToolForBuildSystemId(Id buildSystemId) void TestFrameworkManager::synchronizeSettings() { - Internal::TestSettings::instance()->fromSettings(); + Internal::testSettings().fromSettings(); for (ITestFramework *framework : std::as_const(m_registeredFrameworks)) { if (ITestSettings *fSettings = framework->testSettings()) fSettings->readSettings(); diff --git a/src/plugins/autotest/testframeworkmanager.h b/src/plugins/autotest/testframeworkmanager.h index 62bb19d9474..e42001dc2d4 100644 --- a/src/plugins/autotest/testframeworkmanager.h +++ b/src/plugins/autotest/testframeworkmanager.h @@ -6,9 +6,6 @@ #include "itestframework.h" namespace Autotest { -namespace Internal { -class TestSettings; -} class TestFrameworkManager final { @@ -24,7 +21,7 @@ public: static ITestFramework *frameworkForId(Utils::Id frameworkId); static ITestTool *testToolForId(Utils::Id testToolId); static ITestTool *testToolForBuildSystemId(Utils::Id buildSystemId); - static void activateFrameworksAndToolsFromSettings(const Internal::TestSettings *settings); + static void activateFrameworksAndToolsFromSettings(); static const TestFrameworks registeredFrameworks(); static const TestTools registeredTestTools(); diff --git a/src/plugins/autotest/testresultdelegate.cpp b/src/plugins/autotest/testresultdelegate.cpp index c14b6c17032..14fe1f646f9 100644 --- a/src/plugins/autotest/testresultdelegate.cpp +++ b/src/plugins/autotest/testresultdelegate.cpp @@ -161,10 +161,10 @@ void TestResultDelegate::clearCache() void TestResultDelegate::limitTextOutput(QString &output) const { - int maxLineCount = Internal::TestSettings::instance()->resultDescriptionMaxSize(); + int maxLineCount = testSettings().resultDescriptionMaxSize(); bool limited = false; - if (Internal::TestSettings::instance()->limitResultDescription() && maxLineCount > 0) { + if (testSettings().limitResultDescription() && maxLineCount > 0) { int index = -1; int lastChar = output.size() - 1; @@ -182,7 +182,7 @@ void TestResultDelegate::limitTextOutput(QString &output) const } } - if (TestSettings::instance()->limitResultOutput() && output.length() > outputLimit) { + if (testSettings().limitResultOutput() && output.length() > outputLimit) { output = output.left(outputLimit); limited = true; } diff --git a/src/plugins/autotest/testresultmodel.cpp b/src/plugins/autotest/testresultmodel.cpp index 05e3c979234..bca407b0375 100644 --- a/src/plugins/autotest/testresultmodel.cpp +++ b/src/plugins/autotest/testresultmodel.cpp @@ -284,7 +284,7 @@ void TestResultModel::addTestResult(const TestResult &testResult, bool autoExpan TestResultItem *newItem = new TestResultItem(testResult); TestResultItem *root = nullptr; - if (TestSettings::instance()->displayApplication()) { + if (testSettings().displayApplication()) { const QString application = testResult.id(); if (!application.isEmpty()) { root = rootItem()->findFirstLevelChild([&application](TestResultItem *child) { diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index 457b273a4a1..7fdbcd6dac3 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -291,7 +291,7 @@ void TestResultsPane::clearContents() setIconBadgeNumber(0); navigateStateChanged(); m_summaryWidget->setVisible(false); - m_autoScroll = TestSettings::instance()->autoScroll(); + m_autoScroll = testSettings().autoScroll(); connect(m_treeView->verticalScrollBar(), &QScrollBar::rangeChanged, this, &TestResultsPane::onScrollBarRangeChanged, Qt::UniqueConnection); m_textOutput->clear(); @@ -437,7 +437,7 @@ void TestResultsPane::onRunSelectedTriggered() void TestResultsPane::initializeFilterMenu() { - const bool omitIntern = TestSettings::instance()->omitInternalMsg(); + const bool omitIntern = testSettings().omitInternalMsg(); // FilterModel has all messages enabled by default if (omitIntern) m_filterModel->toggleTestResultType(ResultType::MessageInternal); @@ -553,8 +553,7 @@ void TestResultsPane::onTestRunFinished() m_model->removeCurrentTestMessage(); disconnect(m_treeView->verticalScrollBar(), &QScrollBar::rangeChanged, this, &TestResultsPane::onScrollBarRangeChanged); - if (TestSettings::instance()->popupOnFinish() - && (!TestSettings::instance()->popupOnFail() || hasFailedTests(m_model))) { + if (testSettings().popupOnFinish() && (!testSettings().popupOnFail() || hasFailedTests(m_model))) { popup(IOutputPane::NoModeSwitch); } createMarks(); diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index d3b62afcbfb..f1a878a23cc 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -258,7 +258,7 @@ static RunConfiguration *getRunConfiguration(const QString &buildTargetKey) int TestRunner::precheckTestConfigurations() { - const bool omitWarnings = TestSettings::instance()->omitRunConfigWarn(); + const bool omitWarnings = testSettings().omitRunConfigWarn(); int testCaseCount = 0; for (ITestConfiguration *itc : std::as_const(m_selectedTests)) { if (itc->testBase()->type() == ITestBase::Tool) { @@ -402,7 +402,7 @@ void TestRunner::runTestsHelper() } process.setEnvironment(environment); - m_cancelTimer.setInterval(TestSettings::instance()->timeout()); + m_cancelTimer.setInterval(testSettings().timeout()); m_cancelTimer.start(); qCInfo(runnerLog) << "Command:" << process.commandLine().executable(); @@ -468,7 +468,7 @@ void TestRunner::runTestsHelper() cancelCurrent(UserCanceled); }); - if (TestSettings::instance()->popupOnStart()) + if (testSettings().popupOnStart()) AutotestPlugin::popupResultsPane(); m_taskTree->start(); @@ -590,7 +590,7 @@ void TestRunner::debugTests() connect(runControl, &RunControl::stopped, this, &TestRunner::onFinished); ProjectExplorerPlugin::startRunControl(runControl); - if (useOutputProcessor && TestSettings::instance()->popupOnStart()) + if (useOutputProcessor && testSettings().popupOnStart()) AutotestPlugin::popupResultsPane(); } @@ -671,10 +671,10 @@ static RunAfterBuildMode runAfterBuild() return RunAfterBuildMode::None; if (!project->namedSettings(Constants::SK_USE_GLOBAL).isValid()) - return TestSettings::instance()->runAfterBuildMode(); + return testSettings().runAfterBuildMode(); TestProjectSettings *projectSettings = AutotestPlugin::projectSettings(project); - return projectSettings->useGlobalSettings() ? TestSettings::instance()->runAfterBuildMode() + return projectSettings->useGlobalSettings() ? testSettings().runAfterBuildMode() : projectSettings->runAfterBuild(); } diff --git a/src/plugins/autotest/testsettings.cpp b/src/plugins/autotest/testsettings.cpp index f2e63c4ea89..e6e101343d5 100644 --- a/src/plugins/autotest/testsettings.cpp +++ b/src/plugins/autotest/testsettings.cpp @@ -15,17 +15,14 @@ static const char groupSuffix[] = ".group"; constexpr int defaultTimeout = 60000; -static TestSettings *s_instance; - -TestSettings *TestSettings::instance() +TestSettings &testSettings() { - return s_instance; + static TestSettings theSettings; + return theSettings; } TestSettings::TestSettings() { - s_instance = this; - setSettingsGroup(Constants::SETTINGSGROUP); scanThreadLimit.setSettingsKey("ScanThreadLimit"); diff --git a/src/plugins/autotest/testsettings.h b/src/plugins/autotest/testsettings.h index c89f85d06c9..d73f3d3454b 100644 --- a/src/plugins/autotest/testsettings.h +++ b/src/plugins/autotest/testsettings.h @@ -27,8 +27,6 @@ class TestSettings : public Utils::AspectContainer, public NonAspectSettings public: TestSettings(); - static TestSettings *instance(); - void toSettings() const; void fromSettings(); @@ -50,4 +48,6 @@ public: RunAfterBuildMode runAfterBuildMode() const; }; +TestSettings &testSettings(); + } // Autotest::Internal diff --git a/src/plugins/autotest/testsettingspage.cpp b/src/plugins/autotest/testsettingspage.cpp index 980662cdc39..985206238fd 100644 --- a/src/plugins/autotest/testsettingspage.cpp +++ b/src/plugins/autotest/testsettingspage.cpp @@ -80,7 +80,7 @@ TestSettingsWidget::TestSettingsWidget() onClicked([] { AutotestPlugin::clearChoiceCache(); }, this) }; - TestSettings &s = *TestSettings::instance(); + TestSettings &s = Internal::testSettings(); Group generalGroup { title(Tr::tr("General")), Column { @@ -123,7 +123,7 @@ TestSettingsWidget::TestSettingsWidget() populateFrameworksListWidget(s.frameworks, s.tools); setOnApply([this] { - TestSettings &s = *TestSettings::instance(); + TestSettings &s = Internal::testSettings(); NonAspectSettings tmp; testSettings(tmp); From 6a068a650908bfbe28708ae88630911b4ce22a69 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 07:48:57 +0200 Subject: [PATCH 0214/1777] Beautifier: Merge ClangFormat style file pairs Follow ArtisticStyle. Change-Id: Ie4e1ce260ce0cf451ad6e01ad5284b848bca206e Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/beautifier/CMakeLists.txt | 1 - src/plugins/beautifier/beautifier.qbs | 2 - .../beautifier/clangformat/clangformat.cpp | 313 +++++++++++++++++- .../beautifier/clangformat/clangformat.h | 6 +- .../clangformat/clangformatsettings.cpp | 277 ---------------- .../clangformat/clangformatsettings.h | 36 -- 6 files changed, 308 insertions(+), 327 deletions(-) delete mode 100644 src/plugins/beautifier/clangformat/clangformatsettings.cpp delete mode 100644 src/plugins/beautifier/clangformat/clangformatsettings.h diff --git a/src/plugins/beautifier/CMakeLists.txt b/src/plugins/beautifier/CMakeLists.txt index 48de96ce576..276b1a7a45a 100644 --- a/src/plugins/beautifier/CMakeLists.txt +++ b/src/plugins/beautifier/CMakeLists.txt @@ -12,7 +12,6 @@ add_qtc_plugin(Beautifier beautifiertr.h clangformat/clangformat.cpp clangformat/clangformat.h clangformat/clangformatconstants.h - clangformat/clangformatsettings.cpp clangformat/clangformatsettings.h configurationdialog.cpp configurationdialog.h configurationeditor.cpp configurationeditor.h configurationpanel.cpp configurationpanel.h diff --git a/src/plugins/beautifier/beautifier.qbs b/src/plugins/beautifier/beautifier.qbs index 178a5055fab..4e8fc310928 100644 --- a/src/plugins/beautifier/beautifier.qbs +++ b/src/plugins/beautifier/beautifier.qbs @@ -46,8 +46,6 @@ QtcPlugin { "clangformat.cpp", "clangformat.h", "clangformatconstants.h", - "clangformatsettings.cpp", - "clangformatsettings.h" ] } diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index 92c8c7f454d..634c4415760 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -7,9 +7,11 @@ #include "clangformatconstants.h" +#include "../abstractsettings.h" #include "../beautifierconstants.h" #include "../beautifierplugin.h" #include "../beautifiertr.h" +#include "../configurationpanel.h" #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> @@ -17,22 +19,317 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/ieditor.h> +#include <coreplugin/icore.h> #include <coreplugin/idocument.h> + #include <texteditor/formattexteditor.h> #include <texteditor/textdocument.h> #include <texteditor/texteditor.h> + #include <utils/algorithm.h> +#include <utils/aspects.h> #include <utils/fileutils.h> +#include <utils/layoutbuilder.h> +#include <utils/pathchooser.h> #include <QAction> +#include <QButtonGroup> +#include <QComboBox> +#include <QDateTime> +#include <QGroupBox> #include <QMenu> +#include <QRadioButton> #include <QTextBlock> #include <QTextCodec> +#include <QXmlStreamWriter> using namespace TextEditor; +using namespace Utils; namespace Beautifier::Internal { +const char SETTINGS_NAME[] = "clangformat"; + +class ClangFormatSettings : public AbstractSettings +{ +public: + explicit ClangFormatSettings() + : AbstractSettings(SETTINGS_NAME, ".clang-format") + { + command.setDefaultValue("clang-format"); + command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle("Clang Format")); + command.setLabelText(Tr::tr("Clang Format command:")); + + usePredefinedStyle.setSettingsKey("usePredefinedStyle"); + usePredefinedStyle.setLabelText(Tr::tr("Use predefined style:")); + usePredefinedStyle.setDefaultValue(true); + + predefinedStyle.setSettingsKey("predefinedStyle"); + predefinedStyle.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + predefinedStyle.addOption("LLVM"); + predefinedStyle.addOption("Google"); + predefinedStyle.addOption("Chromium"); + predefinedStyle.addOption("Mozilla"); + predefinedStyle.addOption("WebKit"); + predefinedStyle.addOption("File"); + predefinedStyle.setDefaultValue("LLVM"); + + fallbackStyle.setSettingsKey("fallbackStyle"); + fallbackStyle.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + fallbackStyle.addOption("Default"); + fallbackStyle.addOption("None"); + fallbackStyle.addOption("LLVM"); + fallbackStyle.addOption("Google"); + fallbackStyle.addOption("Chromium"); + fallbackStyle.addOption("Mozilla"); + fallbackStyle.addOption("WebKit"); + fallbackStyle.setDefaultValue("Default"); + + predefinedStyle.setSettingsKey("predefinedStyle"); + predefinedStyle.setDefaultValue("LLVM"); + + customStyle.setSettingsKey("customStyle"); + + documentationFilePath = Core::ICore::userResourcePath(Constants::SETTINGS_DIRNAME) + .pathAppended(Constants::DOCUMENTATION_DIRNAME) + .pathAppended(SETTINGS_NAME).stringAppended(".xml"); + + read(); + } + + void createDocumentationFile() const override; + + QStringList completerWords() override; + + BoolAspect usePredefinedStyle{this}; + SelectionAspect predefinedStyle{this}; + SelectionAspect fallbackStyle{this}; + StringAspect customStyle{this}; + + QString styleFileName(const QString &key) const override; + +private: + void readStyles() override; +}; + +void ClangFormatSettings::createDocumentationFile() const +{ + QFile file(documentationFilePath.toFSPathString()); + const QFileInfo fi(file); + if (!fi.exists()) + fi.dir().mkpath(fi.absolutePath()); + if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) + return; + + QXmlStreamWriter stream(&file); + stream.setAutoFormatting(true); + stream.writeStartDocument("1.0", true); + stream.writeComment("Created " + QDateTime::currentDateTime().toString(Qt::ISODate)); + stream.writeStartElement(Constants::DOCUMENTATION_XMLROOT); + + const QStringList lines = { + "BasedOnStyle {string: LLVM, Google, Chromium, Mozilla, WebKit}", + "AccessModifierOffset {int}", + "AlignEscapedNewlinesLeft {bool}", + "AlignTrailingComments {bool}", + "AllowAllParametersOfDeclarationOnNextLine {bool}", + "AllowShortFunctionsOnASingleLine {bool}", + "AllowShortIfStatementsOnASingleLine {bool}", + "AllowShortLoopsOnASingleLine {bool}", + "AlwaysBreakBeforeMultilineStrings {bool}", + "AlwaysBreakTemplateDeclarations {bool}", + "BinPackParameters {bool}", + "BreakBeforeBinaryOperators {bool}", + "BreakBeforeBraces {BraceBreakingStyle: BS_Attach, BS_Linux, BS_Stroustrup, BS_Allman, BS_GNU}", + "BreakBeforeTernaryOperators {bool}", + "BreakConstructorInitializersBeforeComma {bool}", + "ColumnLimit {unsigned}", + "CommentPragmas {string}", + "ConstructorInitializerAllOnOneLineOrOnePerLine {bool}", + "ConstructorInitializerIndentWidth {unsigned}", + "ContinuationIndentWidth {unsigned}", + "Cpp11BracedListStyle {bool}", + "IndentCaseLabels {bool}", + "IndentFunctionDeclarationAfterType {bool}", + "IndentWidth {unsigned}", + "Language {LanguageKind: LK_None, LK_Cpp, LK_JavaScript, LK_Proto}", + "MaxEmptyLinesToKeep {unsigned}", + "NamespaceIndentation {NamespaceIndentationKind: NI_None, NI_Inner, NI_All}", + "ObjCSpaceAfterProperty {bool}", + "ObjCSpaceBeforeProtocolList {bool}", + "PenaltyBreakBeforeFirstCallParameter {unsigned}", + "PenaltyBreakComment {unsigned}", + "PenaltyBreakFirstLessLess {unsigned}", + "PenaltyBreakString {unsigned}", + "PenaltyExcessCharacter {unsigned}", + "PenaltyReturnTypeOnItsOwnLine {unsigned}", + "PointerBindsToType {bool}", + "SpaceBeforeAssignmentOperators {bool}", + "SpaceBeforeParens {SpaceBeforeParensOptions: SBPO_Never, SBPO_ControlStatements, SBPO_Always}", + "SpaceInEmptyParentheses {bool}", + "SpacesBeforeTrailingComments {unsigned}", + "SpacesInAngles {bool}", + "SpacesInCStyleCastParentheses {bool}", + "SpacesInContainerLiterals {bool}", + "SpacesInParentheses {bool}", + "Standard {LanguageStandard: LS_Cpp03, LS_Cpp11, LS_Auto}", + "TabWidth {unsigned}", + "UseTab {UseTabStyle: UT_Never, UT_ForIndentation, UT_Always}" + }; + + for (const QString& line : lines) { + const int firstSpace = line.indexOf(' '); + const QString keyword = line.left(firstSpace); + const QString options = line.right(line.size() - firstSpace).trimmed(); + const QString text = "<p><span class=\"option\">" + keyword + + "</span> <span class=\"param\">" + options + + "</span></p><p>" + Tr::tr("No description available.") + "</p>"; + stream.writeStartElement(Constants::DOCUMENTATION_XMLENTRY); + stream.writeTextElement(Constants::DOCUMENTATION_XMLKEY, keyword); + stream.writeTextElement(Constants::DOCUMENTATION_XMLDOC, text); + stream.writeEndElement(); + } + + stream.writeEndElement(); + stream.writeEndDocument(); +} + +QStringList ClangFormatSettings::completerWords() +{ + return { + "LLVM", + "Google", + "Chromium", + "Mozilla", + "WebKit", + "BS_Attach", + "BS_Linux", + "BS_Stroustrup", + "BS_Allman", + "NI_None", + "NI_Inner", + "NI_All", + "LS_Cpp03", + "LS_Cpp11", + "LS_Auto", + "UT_Never", + "UT_ForIndentation", + "UT_Always" + }; +} + +QString ClangFormatSettings::styleFileName(const QString &key) const +{ + return m_styleDir.absolutePath() + '/' + key + '/' + m_ending; +} + +void ClangFormatSettings::readStyles() +{ + const QStringList dirs = m_styleDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); + for (const QString &dir : dirs) { + QFile file(m_styleDir.absoluteFilePath(dir + '/' + m_ending)); + if (file.open(QIODevice::ReadOnly)) + m_styles.insert(dir, QString::fromLocal8Bit(file.readAll())); + } +} + +static ClangFormatSettings &settings() +{ + static ClangFormatSettings theSettings; + return theSettings; +} + +class ClangFormatOptionsPageWidget : public Core::IOptionsPageWidget +{ +public: + explicit ClangFormatOptionsPageWidget() + { + ClangFormatSettings &s = settings(); + QGroupBox *options = nullptr; + + auto predefinedStyleButton = new QRadioButton; + s.usePredefinedStyle.adoptButton(predefinedStyleButton); + + auto customizedStyleButton = new QRadioButton(Tr::tr("Use customized style:")); + + auto styleButtonGroup = new QButtonGroup; + styleButtonGroup->addButton(predefinedStyleButton); + styleButtonGroup->addButton(customizedStyleButton); + + auto configurations = new ConfigurationPanel(this); + configurations->setSettings(&s); + configurations->setCurrentConfiguration(s.customStyle()); + + using namespace Layouting; + + auto fallbackBlob = Row { noMargin, Tr::tr("Fallback style:"), s.fallbackStyle }.emerge(); + + auto predefinedBlob = Column { noMargin, s.predefinedStyle, fallbackBlob }.emerge(); + + Column { + Group { + title(Tr::tr("Configuration")), + Form { + s.command, br, + s.supportedMimeTypes + } + }, + Group { + title(Tr::tr("Options")), + bindTo(&options), + Form { + s.usePredefinedStyle, predefinedBlob, br, + customizedStyleButton, configurations, + }, + }, + st + }.attachTo(this); + + if (s.usePredefinedStyle.value()) + predefinedStyleButton->click(); + else + customizedStyleButton->click(); + + const auto updateEnabled = [&s, styleButtonGroup, predefinedBlob, fallbackBlob, + configurations, predefinedStyleButton] { + const bool predefSelected = styleButtonGroup->checkedButton() == predefinedStyleButton; + predefinedBlob->setEnabled(predefSelected); + fallbackBlob->setEnabled(predefSelected && s.predefinedStyle.volatileValue() == 5); // File + configurations->setEnabled(!predefSelected); + }; + updateEnabled(); + connect(styleButtonGroup, &QButtonGroup::buttonClicked, this, updateEnabled); + connect(&s.predefinedStyle, &SelectionAspect::volatileValueChanged, this, updateEnabled); + + setOnApply([configurations] { + settings().customStyle.setValue(configurations->currentConfiguration()); + settings().save(); + }); + + s.read(); + + connect(s.command.pathChooser(), &PathChooser::validChanged, options, &QWidget::setEnabled); + options->setEnabled(s.command.pathChooser()->isValid()); + } +}; + +class ClangFormatOptionsPage final : public Core::IOptionsPage +{ +public: + ClangFormatOptionsPage() + { + setId("ClangFormat"); + setDisplayName(Tr::tr("Clang Format")); + setCategory(Constants::OPTION_CATEGORY); + setWidgetCreator([] { return new ClangFormatOptionsPageWidget; }); + } +}; + +const ClangFormatOptionsPage settingsPage; + + +// ClangFormat + ClangFormat::ClangFormat() { Core::ActionContainer *menu = Core::ActionManager::createMenu("ClangFormat.Menu"); @@ -64,7 +361,7 @@ ClangFormat::ClangFormat() Core::ActionManager::actionContainer(Constants::MENU_ID)->addMenu(menu); - connect(&m_settings.supportedMimeTypes, &Utils::BaseAspect::changed, + connect(&settings().supportedMimeTypes, &BaseAspect::changed, this, [this] { updateActions(Core::EditorManager::currentEditor()); }); } @@ -75,7 +372,7 @@ QString ClangFormat::id() const void ClangFormat::updateActions(Core::IEditor *editor) { - const bool enabled = editor && m_settings.isApplicable(editor->document()); + const bool enabled = editor && settings().isApplicable(editor->document()); m_formatFile->setEnabled(enabled); m_formatRange->setEnabled(enabled); } @@ -187,14 +484,14 @@ void ClangFormat::disableFormattingSelectedText() Command ClangFormat::command() const { Command command; - command.setExecutable(m_settings.command()); + command.setExecutable(settings().command()); command.setProcessing(Command::PipeProcessing); - if (m_settings.usePredefinedStyle()) { - const QString predefinedStyle = m_settings.predefinedStyle.stringValue(); + if (settings().usePredefinedStyle()) { + const QString predefinedStyle = settings().predefinedStyle.stringValue(); command.addOption("-style=" + predefinedStyle); if (predefinedStyle == "File") { - const QString fallbackStyle = m_settings.fallbackStyle.stringValue(); + const QString fallbackStyle = settings().fallbackStyle.stringValue(); if (fallbackStyle != "Default") command.addOption("-fallback-style=" + fallbackStyle); } @@ -203,7 +500,7 @@ Command ClangFormat::command() const } else { command.addOption("-style=file"); const QString path = - QFileInfo(m_settings.styleFileName(m_settings.customStyle())).absolutePath(); + QFileInfo(settings().styleFileName(settings().customStyle())).absolutePath(); command.addOption("-assume-filename=" + path + QDir::separator() + "%filename"); } @@ -212,7 +509,7 @@ Command ClangFormat::command() const bool ClangFormat::isApplicable(const Core::IDocument *document) const { - return m_settings.isApplicable(document); + return settings().isApplicable(document); } Command ClangFormat::command(int offset, int length) const diff --git a/src/plugins/beautifier/clangformat/clangformat.h b/src/plugins/beautifier/clangformat/clangformat.h index 65fd23a43f1..22b8ce2a093 100644 --- a/src/plugins/beautifier/clangformat/clangformat.h +++ b/src/plugins/beautifier/clangformat/clangformat.h @@ -5,7 +5,9 @@ #include "../beautifierabstracttool.h" -#include "clangformatsettings.h" +QT_BEGIN_NAMESPACE +class QAction; +QT_END_NAMESPACE namespace Beautifier::Internal { @@ -31,8 +33,6 @@ private: QAction *m_formatLines = nullptr; QAction *m_formatRange = nullptr; QAction *m_disableFormattingSelectedText = nullptr; - ClangFormatSettings m_settings; - ClangFormatOptionsPage m_page{&m_settings}; }; } // Beautifier::Internal diff --git a/src/plugins/beautifier/clangformat/clangformatsettings.cpp b/src/plugins/beautifier/clangformat/clangformatsettings.cpp deleted file mode 100644 index ab1363eea82..00000000000 --- a/src/plugins/beautifier/clangformat/clangformatsettings.cpp +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (C) 2016 Lorenz Haas -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "clangformatsettings.h" - -#include "../beautifierconstants.h" -#include "../beautifierplugin.h" -#include "../beautifiertr.h" -#include "../configurationpanel.h" - -#include <coreplugin/icore.h> - -#include <utils/layoutbuilder.h> -#include <utils/pathchooser.h> - -#include <QDateTime> -#include <QXmlStreamWriter> -#include <QButtonGroup> -#include <QComboBox> -#include <QGroupBox> -#include <QRadioButton> - -using namespace Utils; - -namespace Beautifier::Internal { - -const char SETTINGS_NAME[] = "clangformat"; - -ClangFormatSettings::ClangFormatSettings() - : AbstractSettings(SETTINGS_NAME, ".clang-format") -{ - command.setDefaultValue("clang-format"); - command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle("Clang Format")); - command.setLabelText(Tr::tr("Clang Format command:")); - - usePredefinedStyle.setSettingsKey("usePredefinedStyle"); - usePredefinedStyle.setLabelText(Tr::tr("Use predefined style:")); - usePredefinedStyle.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); - usePredefinedStyle.setDefaultValue(true); - - predefinedStyle.setSettingsKey("predefinedStyle"); - predefinedStyle.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - predefinedStyle.addOption("LLVM"); - predefinedStyle.addOption("Google"); - predefinedStyle.addOption("Chromium"); - predefinedStyle.addOption("Mozilla"); - predefinedStyle.addOption("WebKit"); - predefinedStyle.addOption("File"); - predefinedStyle.setDefaultValue("LLVM"); - - fallbackStyle.setSettingsKey("fallbackStyle"); - fallbackStyle.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - fallbackStyle.addOption("Default"); - fallbackStyle.addOption("None"); - fallbackStyle.addOption("LLVM"); - fallbackStyle.addOption("Google"); - fallbackStyle.addOption("Chromium"); - fallbackStyle.addOption("Mozilla"); - fallbackStyle.addOption("WebKit"); - fallbackStyle.setDefaultValue("Default"); - - predefinedStyle.setSettingsKey("predefinedStyle"); - predefinedStyle.setDefaultValue("LLVM"); - - customStyle.setSettingsKey("customStyle"); - - documentationFilePath = Core::ICore::userResourcePath(Constants::SETTINGS_DIRNAME) - .pathAppended(Constants::DOCUMENTATION_DIRNAME) - .pathAppended(SETTINGS_NAME).stringAppended(".xml"); - - read(); -} - -void ClangFormatSettings::createDocumentationFile() const -{ - QFile file(documentationFilePath.toFSPathString()); - const QFileInfo fi(file); - if (!fi.exists()) - fi.dir().mkpath(fi.absolutePath()); - if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) - return; - - QXmlStreamWriter stream(&file); - stream.setAutoFormatting(true); - stream.writeStartDocument("1.0", true); - stream.writeComment("Created " + QDateTime::currentDateTime().toString(Qt::ISODate)); - stream.writeStartElement(Constants::DOCUMENTATION_XMLROOT); - - const QStringList lines = { - "BasedOnStyle {string: LLVM, Google, Chromium, Mozilla, WebKit}", - "AccessModifierOffset {int}", - "AlignEscapedNewlinesLeft {bool}", - "AlignTrailingComments {bool}", - "AllowAllParametersOfDeclarationOnNextLine {bool}", - "AllowShortFunctionsOnASingleLine {bool}", - "AllowShortIfStatementsOnASingleLine {bool}", - "AllowShortLoopsOnASingleLine {bool}", - "AlwaysBreakBeforeMultilineStrings {bool}", - "AlwaysBreakTemplateDeclarations {bool}", - "BinPackParameters {bool}", - "BreakBeforeBinaryOperators {bool}", - "BreakBeforeBraces {BraceBreakingStyle: BS_Attach, BS_Linux, BS_Stroustrup, BS_Allman, BS_GNU}", - "BreakBeforeTernaryOperators {bool}", - "BreakConstructorInitializersBeforeComma {bool}", - "ColumnLimit {unsigned}", - "CommentPragmas {string}", - "ConstructorInitializerAllOnOneLineOrOnePerLine {bool}", - "ConstructorInitializerIndentWidth {unsigned}", - "ContinuationIndentWidth {unsigned}", - "Cpp11BracedListStyle {bool}", - "IndentCaseLabels {bool}", - "IndentFunctionDeclarationAfterType {bool}", - "IndentWidth {unsigned}", - "Language {LanguageKind: LK_None, LK_Cpp, LK_JavaScript, LK_Proto}", - "MaxEmptyLinesToKeep {unsigned}", - "NamespaceIndentation {NamespaceIndentationKind: NI_None, NI_Inner, NI_All}", - "ObjCSpaceAfterProperty {bool}", - "ObjCSpaceBeforeProtocolList {bool}", - "PenaltyBreakBeforeFirstCallParameter {unsigned}", - "PenaltyBreakComment {unsigned}", - "PenaltyBreakFirstLessLess {unsigned}", - "PenaltyBreakString {unsigned}", - "PenaltyExcessCharacter {unsigned}", - "PenaltyReturnTypeOnItsOwnLine {unsigned}", - "PointerBindsToType {bool}", - "SpaceBeforeAssignmentOperators {bool}", - "SpaceBeforeParens {SpaceBeforeParensOptions: SBPO_Never, SBPO_ControlStatements, SBPO_Always}", - "SpaceInEmptyParentheses {bool}", - "SpacesBeforeTrailingComments {unsigned}", - "SpacesInAngles {bool}", - "SpacesInCStyleCastParentheses {bool}", - "SpacesInContainerLiterals {bool}", - "SpacesInParentheses {bool}", - "Standard {LanguageStandard: LS_Cpp03, LS_Cpp11, LS_Auto}", - "TabWidth {unsigned}", - "UseTab {UseTabStyle: UT_Never, UT_ForIndentation, UT_Always}" - }; - - for (const QString& line : lines) { - const int firstSpace = line.indexOf(' '); - const QString keyword = line.left(firstSpace); - const QString options = line.right(line.size() - firstSpace).trimmed(); - const QString text = "<p><span class=\"option\">" + keyword - + "</span> <span class=\"param\">" + options - + "</span></p><p>" + Tr::tr("No description available.") + "</p>"; - stream.writeStartElement(Constants::DOCUMENTATION_XMLENTRY); - stream.writeTextElement(Constants::DOCUMENTATION_XMLKEY, keyword); - stream.writeTextElement(Constants::DOCUMENTATION_XMLDOC, text); - stream.writeEndElement(); - } - - stream.writeEndElement(); - stream.writeEndDocument(); -} - -QStringList ClangFormatSettings::completerWords() -{ - return { - "LLVM", - "Google", - "Chromium", - "Mozilla", - "WebKit", - "BS_Attach", - "BS_Linux", - "BS_Stroustrup", - "BS_Allman", - "NI_None", - "NI_Inner", - "NI_All", - "LS_Cpp03", - "LS_Cpp11", - "LS_Auto", - "UT_Never", - "UT_ForIndentation", - "UT_Always" - }; -} - -QString ClangFormatSettings::styleFileName(const QString &key) const -{ - return m_styleDir.absolutePath() + '/' + key + '/' + m_ending; -} - -void ClangFormatSettings::readStyles() -{ - const QStringList dirs = m_styleDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); - for (const QString &dir : dirs) { - QFile file(m_styleDir.absoluteFilePath(dir + '/' + m_ending)); - if (file.open(QIODevice::ReadOnly)) - m_styles.insert(dir, QString::fromLocal8Bit(file.readAll())); - } -} - -class ClangFormatOptionsPageWidget : public Core::IOptionsPageWidget -{ -public: - explicit ClangFormatOptionsPageWidget(ClangFormatSettings *settings) - { - ClangFormatSettings &s = *settings; - QGroupBox *options = nullptr; - - auto predefinedStyleButton = new QRadioButton; - s.usePredefinedStyle.adoptButton(predefinedStyleButton); - - auto customizedStyleButton = new QRadioButton(Tr::tr("Use customized style:")); - - auto styleButtonGroup = new QButtonGroup; - styleButtonGroup->addButton(predefinedStyleButton); - styleButtonGroup->addButton(customizedStyleButton); - - auto configurations = new ConfigurationPanel(this); - configurations->setSettings(&s); - configurations->setCurrentConfiguration(s.customStyle()); - - using namespace Layouting; - - auto fallbackBlob = Row { noMargin, Tr::tr("Fallback style:"), s.fallbackStyle }.emerge(); - - auto predefinedBlob = Column { noMargin, s.predefinedStyle, fallbackBlob }.emerge(); - - Column { - Group { - title(Tr::tr("Configuration")), - Form { - s.command, br, - s.supportedMimeTypes - } - }, - Group { - title(Tr::tr("Options")), - bindTo(&options), - Form { - s.usePredefinedStyle, predefinedBlob, br, - customizedStyleButton, configurations, - }, - }, - st - }.attachTo(this); - - if (s.usePredefinedStyle.value()) - predefinedStyleButton->click(); - else - customizedStyleButton->click(); - - const auto updateEnabled = [&s, styleButtonGroup, predefinedBlob, fallbackBlob, - configurations, predefinedStyleButton] { - const bool predefSelected = styleButtonGroup->checkedButton() == predefinedStyleButton; - predefinedBlob->setEnabled(predefSelected); - fallbackBlob->setEnabled(predefSelected && s.predefinedStyle.volatileValue() == 5); // File - configurations->setEnabled(!predefSelected); - }; - updateEnabled(); - connect(styleButtonGroup, &QButtonGroup::buttonClicked, this, updateEnabled); - connect(&s.predefinedStyle, &SelectionAspect::volatileValueChanged, this, updateEnabled); - - setOnApply([settings, configurations] { - settings->customStyle.setValue(configurations->currentConfiguration()); - settings->save(); - }); - - s.read(); - - connect(s.command.pathChooser(), &PathChooser::validChanged, options, &QWidget::setEnabled); - options->setEnabled(s.command.pathChooser()->isValid()); - } -}; - -ClangFormatOptionsPage::ClangFormatOptionsPage(ClangFormatSettings *settings) -{ - setId("ClangFormat"); - setDisplayName(Tr::tr("Clang Format")); - setCategory(Constants::OPTION_CATEGORY); - setWidgetCreator([settings] { return new ClangFormatOptionsPageWidget(settings); }); -} - -} // Beautifier::Internal diff --git a/src/plugins/beautifier/clangformat/clangformatsettings.h b/src/plugins/beautifier/clangformat/clangformatsettings.h deleted file mode 100644 index 64f2b4b9bbd..00000000000 --- a/src/plugins/beautifier/clangformat/clangformatsettings.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2016 Lorenz Haas -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "../abstractsettings.h" - -namespace Beautifier::Internal { - -class ClangFormatSettings : public AbstractSettings -{ -public: - explicit ClangFormatSettings(); - - void createDocumentationFile() const override; - - QStringList completerWords() override; - - Utils::BoolAspect usePredefinedStyle{this}; - Utils::SelectionAspect predefinedStyle{this}; - Utils::SelectionAspect fallbackStyle{this}; - Utils::StringAspect customStyle{this}; - - QString styleFileName(const QString &key) const override; - -private: - void readStyles() override; -}; - -class ClangFormatOptionsPage final : public Core::IOptionsPage -{ -public: - explicit ClangFormatOptionsPage(ClangFormatSettings *settings); -}; - -} // Beautifier::Internal From 2c512625c5a002bb1a76d83ebc9d32e7f7142e7b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 12:13:07 +0200 Subject: [PATCH 0215/1777] FakeVim: Delay settings creation until actual use Task-number: QTCREATORBUG-29167 Change-Id: I3a6f1330922f3840cb7e99d8adb60a728d36eb4b Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/fakevim/fakevimactions.cpp | 41 ++++++++++++++++---------- src/plugins/fakevim/fakevimactions.h | 10 +++---- src/plugins/fakevim/fakevimplugin.cpp | 21 +++++-------- 3 files changed, 38 insertions(+), 34 deletions(-) diff --git a/src/plugins/fakevim/fakevimactions.cpp b/src/plugins/fakevim/fakevimactions.cpp index a6dc84b9b27..c80d17c9722 100644 --- a/src/plugins/fakevim/fakevimactions.cpp +++ b/src/plugins/fakevim/fakevimactions.cpp @@ -45,29 +45,15 @@ void setAutoApply(bool ) {} #endif -static FakeVimSettings *s_settings; - FakeVimSettings &settings() { - return *s_settings; + static FakeVimSettings theSettings; + return theSettings; } FakeVimSettings::FakeVimSettings() { - s_settings = this; - -#ifndef FAKEVIM_STANDALONE - const char SETTINGS_CATEGORY[] = "D.FakeVim"; - const char SETTINGS_ID[] = "A.FakeVim.General"; - - setId(SETTINGS_ID); - setDisplayName(Tr::tr("General")); - setCategory(SETTINGS_CATEGORY); - setDisplayCategory(Tr::tr("FakeVim")); - setCategoryIconPath(":/fakevim/images/settingscategory_fakevim.png"); - setup(&useFakeVim, false, "UseFakeVim", {}, Tr::tr("Use FakeVim")); -#endif // Specific FakeVim settings setup(&readVimRc, false, "ReadVimRc", {}, Tr::tr("Read .vimrc from location:")); @@ -303,4 +289,27 @@ void FakeVimSettings::setup(FvBaseAspect *aspect, m_nameToAspect[shortName] = aspect; } +#ifndef FAKEVIM_STANDALONE + +class FakeVimSettingsPage final : public Core::IOptionsPage +{ +public: + FakeVimSettingsPage() + { + const char SETTINGS_CATEGORY[] = "D.FakeVim"; + const char SETTINGS_ID[] = "A.FakeVim.General"; + + setId(SETTINGS_ID); + setDisplayName(Tr::tr("General")); + setCategory(SETTINGS_CATEGORY); + setDisplayCategory(Tr::tr("FakeVim")); + setCategoryIconPath(":/fakevim/images/settingscategory_fakevim.png"); + setSettingsProvider([] { return &settings(); }); + } +}; + +const FakeVimSettingsPage settingsPage; + +#endif + } // FakeVim::Internal diff --git a/src/plugins/fakevim/fakevimactions.h b/src/plugins/fakevim/fakevimactions.h index 94ba02a7f3a..1d72080d9b2 100644 --- a/src/plugins/fakevim/fakevimactions.h +++ b/src/plugins/fakevim/fakevimactions.h @@ -28,10 +28,10 @@ public: FvBaseAspect() = default; virtual ~FvBaseAspect() = default; - virtual void setVariantValue(const QVariant &value) = 0; - virtual void setDefaultVariantValue(const QVariant &value) = 0; - virtual QVariant variantValue() const = 0; - virtual QVariant defaultVariantValue() const = 0; + virtual void setVariantValue(const QVariant &) {} + virtual void setDefaultVariantValue(const QVariant &) {} + virtual QVariant variantValue() const { return {}; } + virtual QVariant defaultVariantValue() const { return {}; } void setSettingsKey(const QString &group, const QString &key); QString settingsKey() const; @@ -84,7 +84,7 @@ public: #else -using FvAspectContainer = Core::PagedSettings; +using FvAspectContainer = Utils::AspectContainer; using FvBaseAspect = Utils::BaseAspect; using FvBoolAspect = Utils::BoolAspect; using FvIntegerAspect = Utils::IntegerAspect; diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index fac40d951a6..1a988821979 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -683,6 +683,8 @@ public: } }; +const FakeVimExCommandsPage exCommandPage; + /////////////////////////////////////////////////////////////////////// // // FakeVimUserCommandsPage @@ -752,11 +754,10 @@ public: class FakeVimUserCommandsPageWidget : public IOptionsPageWidget { public: - FakeVimUserCommandsPageWidget(FakeVimUserCommandsModel *model) - : m_model(model) + FakeVimUserCommandsPageWidget() { auto widget = new QTreeView; - widget->setModel(m_model); + widget->setModel(&m_model); widget->resizeColumnToContents(0); auto delegate = new FakeVimUserCommandsDelegate(widget); @@ -771,7 +772,7 @@ private: void apply() final { // now save the mappings if necessary - const UserCommandMap ¤t = m_model->commandMap(); + const UserCommandMap ¤t = m_model.commandMap(); UserCommandMap &userMap = dd->m_userCommandMap; if (current != userMap) { @@ -800,7 +801,7 @@ private: } } - FakeVimUserCommandsModel *m_model; + FakeVimUserCommandsModel m_model; }; class FakeVimUserCommandsPage : public IOptionsPage @@ -811,13 +812,11 @@ public: setId(SETTINGS_USER_CMDS_ID); setDisplayName(Tr::tr("User Command Mapping")); setCategory(SETTINGS_CATEGORY); - setWidgetCreator([this] { return new FakeVimUserCommandsPageWidget(&m_model); }); + setWidgetCreator([this] { return new FakeVimUserCommandsPageWidget; }); } - -private: - FakeVimUserCommandsModel m_model; }; +const FakeVimUserCommandsPage userCommandsPage; /////////////////////////////////////////////////////////////////////// // @@ -978,10 +977,6 @@ IAssistProcessor *FakeVimCompletionAssistProvider::createProcessor(const AssistI class FakeVimPluginRunData { public: - FakeVimSettings settings; - FakeVimExCommandsPage exCommandsPage; - FakeVimUserCommandsPage userCommandsPage; - FakeVimCompletionAssistProvider wordProvider; }; From dcca810fdcc1028863760aa77bd18fd9bd1c9649 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 10 Jul 2023 12:39:24 +0200 Subject: [PATCH 0216/1777] VcsBase: More FilePath use Change-Id: I070c356306e19375cd871b7b4525f5d2de33b2a0 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/vcsbase/vcsbasesubmiteditor.cpp | 12 +++++------- src/plugins/vcsbase/vcsbasesubmiteditor.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index 7d18d1de851..bd0fab0d548 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -193,8 +193,8 @@ void VcsBaseSubmitEditor::setParameters(const VcsBaseSubmitEditorParameters &par } } // Do we have user fields? - if (!settings.nickNameFieldListFile.value().isEmpty()) - createUserFields(settings.nickNameFieldListFile.value()); + if (!settings.nickNameFieldListFile().isEmpty()) + createUserFields(settings.nickNameFieldListFile()); // wrapping. etc slotUpdateEditorSettings(); @@ -241,14 +241,12 @@ static inline QStringList fieldTexts(const QString &fileContents) return rc; } -void VcsBaseSubmitEditor::createUserFields(const QString &fieldConfigFile) +void VcsBaseSubmitEditor::createUserFields(const FilePath &fieldConfigFile) { FileReader reader; - if (!reader.fetch(FilePath::fromString(fieldConfigFile), - QIODevice::Text, - Core::ICore::dialogParent())) { + if (!reader.fetch(fieldConfigFile, QIODevice::Text, Core::ICore::dialogParent())) return; - } + // Parse into fields const QStringList fields = fieldTexts(QString::fromUtf8(reader.data())); if (fields.empty()) diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.h b/src/plugins/vcsbase/vcsbasesubmiteditor.h index 5277b3efcf6..2c3123d7368 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.h +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.h @@ -114,7 +114,7 @@ private: void slotSetFieldNickName(int); void slotUpdateEditorSettings(); - void createUserFields(const QString &fieldConfigFile); + void createUserFields(const Utils::FilePath &fieldConfigFile); bool checkSubmitMessage(QString *errorMessage) const; bool runSubmitMessageCheckScript(const Utils::FilePath &script, QString *errorMessage) const; QString promptForNickName(); From afe8b1999600dc4707dcd7b9dc5e39ca72d22ecb Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 08:19:22 +0200 Subject: [PATCH 0217/1777] Beautifier: Move a few strings closer to their use Change-Id: I11c49976eca820b7083d143dbce6603085f9aa9d Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/beautifier/CMakeLists.txt | 3 --- .../artisticstyle/artisticstyle.cpp | 18 ++++++++--------- .../artisticstyle/artisticstyleconstants.h | 12 ----------- src/plugins/beautifier/beautifier.qbs | 3 --- .../beautifier/clangformat/clangformat.cpp | 4 +--- .../clangformat/clangformatconstants.h | 12 ----------- .../beautifier/uncrustify/uncrustify.cpp | 20 ++++++++----------- .../uncrustify/uncrustifyconstants.h | 12 ----------- 8 files changed, 17 insertions(+), 67 deletions(-) delete mode 100644 src/plugins/beautifier/artisticstyle/artisticstyleconstants.h delete mode 100644 src/plugins/beautifier/clangformat/clangformatconstants.h delete mode 100644 src/plugins/beautifier/uncrustify/uncrustifyconstants.h diff --git a/src/plugins/beautifier/CMakeLists.txt b/src/plugins/beautifier/CMakeLists.txt index 276b1a7a45a..f35e7242f05 100644 --- a/src/plugins/beautifier/CMakeLists.txt +++ b/src/plugins/beautifier/CMakeLists.txt @@ -4,18 +4,15 @@ add_qtc_plugin(Beautifier SOURCES abstractsettings.cpp abstractsettings.h artisticstyle/artisticstyle.cpp artisticstyle/artisticstyle.h - artisticstyle/artisticstyleconstants.h beautifier.qrc beautifierabstracttool.h beautifierconstants.h beautifierplugin.cpp beautifierplugin.h beautifiertr.h clangformat/clangformat.cpp clangformat/clangformat.h - clangformat/clangformatconstants.h configurationdialog.cpp configurationdialog.h configurationeditor.cpp configurationeditor.h configurationpanel.cpp configurationpanel.h generalsettings.cpp generalsettings.h uncrustify/uncrustify.cpp uncrustify/uncrustify.h - uncrustify/uncrustifyconstants.h ) diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp index dfc05296b10..71a63ed6d06 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp @@ -5,7 +5,6 @@ #include "artisticstyle.h" -#include "artisticstyleconstants.h" #include "../abstractsettings.h" #include "../beautifierconstants.h" #include "../beautifierplugin.h" @@ -52,6 +51,8 @@ namespace Beautifier::Internal { // Settings +static QString displayName() { return Tr::tr("Artistic Style"); } + const char SETTINGS_NAME[] = "artisticstyle"; class ArtisticStyleSettings : public AbstractSettings @@ -63,8 +64,7 @@ public: setVersionRegExp(QRegularExpression("([2-9]{1})\\.([0-9]{1,2})(\\.[1-9]{1})?$")); command.setLabelText(Tr::tr("Artistic Style command:")); command.setDefaultValue("astyle"); - command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle( - Tr::tr(Constants::ARTISTICSTYLE_DISPLAY_NAME))); + command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle(displayName())); useOtherFiles.setSettingsKey("useOtherFiles"); useOtherFiles.setLabelText(Tr::tr("Use file *.astylerc defined in project files")); @@ -239,7 +239,7 @@ public: ArtisticStyleOptionsPage() { setId("ArtisticStyle"); - setDisplayName(Tr::tr("Artistic Style")); + setDisplayName(displayName()); setCategory(Constants::OPTION_CATEGORY); setWidgetCreator([] { return new ArtisticStyleOptionsPageWidget; }); } @@ -267,7 +267,7 @@ ArtisticStyle::ArtisticStyle() QString ArtisticStyle::id() const { - return QLatin1String(Constants::ARTISTICSTYLE_DISPLAY_NAME); + return "Artistic Style"; } void ArtisticStyle::updateActions(Core::IEditor *editor) @@ -278,12 +278,10 @@ void ArtisticStyle::updateActions(Core::IEditor *editor) void ArtisticStyle::formatFile() { const QString cfgFileName = configurationFile(); - if (cfgFileName.isEmpty()) { - BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile( - Tr::tr(Constants::ARTISTICSTYLE_DISPLAY_NAME))); - } else { + if (cfgFileName.isEmpty()) + BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile(displayName())); + else formatCurrentFile(command(cfgFileName)); - } } QString ArtisticStyle::configurationFile() const diff --git a/src/plugins/beautifier/artisticstyle/artisticstyleconstants.h b/src/plugins/beautifier/artisticstyle/artisticstyleconstants.h deleted file mode 100644 index 92b95f70baf..00000000000 --- a/src/plugins/beautifier/artisticstyle/artisticstyleconstants.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2016 Lorenz Haas -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <QtGlobal> - -namespace Beautifier::Constants { - -const char ARTISTICSTYLE_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::Beautifier", "Artistic Style"); - -} // Beautifier::Constants diff --git a/src/plugins/beautifier/beautifier.qbs b/src/plugins/beautifier/beautifier.qbs index 4e8fc310928..5b80a7b1fda 100644 --- a/src/plugins/beautifier/beautifier.qbs +++ b/src/plugins/beautifier/beautifier.qbs @@ -35,7 +35,6 @@ QtcPlugin { files: [ "artisticstyle.cpp", "artisticstyle.h", - "artisticstyleconstants.h", ] } @@ -45,7 +44,6 @@ QtcPlugin { files: [ "clangformat.cpp", "clangformat.h", - "clangformatconstants.h", ] } @@ -55,7 +53,6 @@ QtcPlugin { files: [ "uncrustify.cpp", "uncrustify.h", - "uncrustifyconstants.h", ] } } diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index 634c4415760..c656347a00e 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -5,8 +5,6 @@ #include "clangformat.h" -#include "clangformatconstants.h" - #include "../abstractsettings.h" #include "../beautifierconstants.h" #include "../beautifierplugin.h" @@ -367,7 +365,7 @@ ClangFormat::ClangFormat() QString ClangFormat::id() const { - return QLatin1String(Constants::CLANGFORMAT_DISPLAY_NAME); + return "ClangFormat"; } void ClangFormat::updateActions(Core::IEditor *editor) diff --git a/src/plugins/beautifier/clangformat/clangformatconstants.h b/src/plugins/beautifier/clangformat/clangformatconstants.h deleted file mode 100644 index 177253f6c18..00000000000 --- a/src/plugins/beautifier/clangformat/clangformatconstants.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2016 Lorenz Haas -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <QtGlobal> - -namespace Beautifier::Constants { - -const char CLANGFORMAT_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::Beautifier", "ClangFormat"); - -} // Beautifier::Constants diff --git a/src/plugins/beautifier/uncrustify/uncrustify.cpp b/src/plugins/beautifier/uncrustify/uncrustify.cpp index da29e7aeabd..f91fc1423dd 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustify.cpp @@ -5,8 +5,6 @@ #include "uncrustify.h" -#include "uncrustifyconstants.h" - #include "../abstractsettings.h" #include "../beautifierconstants.h" #include "../beautifierplugin.h" @@ -54,6 +52,8 @@ namespace Beautifier::Internal { const char SETTINGS_NAME[] = "uncrustify"; +static QString displayName() { return Tr::tr("Uncrustify"); } + class UncrustifySettings : public AbstractSettings { public: @@ -64,8 +64,7 @@ public: command.setDefaultValue("uncrustify"); command.setLabelText(Tr::tr("Uncrustify command:")); - command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle( - Tr::tr(Constants::UNCRUSTIFY_DISPLAY_NAME))); + command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle(displayName())); useOtherFiles.setSettingsKey("useOtherFiles"); useOtherFiles.setDefaultValue(true); @@ -270,7 +269,7 @@ Uncrustify::Uncrustify() QString Uncrustify::id() const { - return QLatin1String(Constants::UNCRUSTIFY_DISPLAY_NAME); + return "Uncrustify"; } void Uncrustify::updateActions(Core::IEditor *editor) @@ -283,20 +282,17 @@ void Uncrustify::updateActions(Core::IEditor *editor) void Uncrustify::formatFile() { const FilePath cfgFileName = configurationFile(); - if (cfgFileName.isEmpty()) { - BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile( - Tr::tr(Constants::UNCRUSTIFY_DISPLAY_NAME))); - } else { + if (cfgFileName.isEmpty()) + BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile(displayName())); + else formatCurrentFile(command(cfgFileName)); - } } void Uncrustify::formatSelectedText() { const FilePath cfgFileName = configurationFile(); if (cfgFileName.isEmpty()) { - BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile( - Tr::tr(Constants::UNCRUSTIFY_DISPLAY_NAME))); + BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile(displayName())); return; } diff --git a/src/plugins/beautifier/uncrustify/uncrustifyconstants.h b/src/plugins/beautifier/uncrustify/uncrustifyconstants.h deleted file mode 100644 index e8c4331be72..00000000000 --- a/src/plugins/beautifier/uncrustify/uncrustifyconstants.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2016 Lorenz Haas -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <QtGlobal> - -namespace Beautifier::Constants { - -const char UNCRUSTIFY_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::Beautifier", "Uncrustify"); - -} // Beautifier::Constants From b9cf021b8edcae39c936d9bb4552bd01ada772d2 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 15:46:17 +0200 Subject: [PATCH 0218/1777] CMakeProjectManager: Use aspects more directly in build configuration Change-Id: I35b9a31c158cac8eccb44ffb3f4e2d21d8183b8b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../cmakebuildconfiguration.cpp | 157 +++++++----------- .../cmakebuildconfiguration.h | 95 +++++------ .../cmakeprojectmanager/cmakebuildsystem.cpp | 7 +- 3 files changed, 98 insertions(+), 161 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 3941f9254a4..b48e9df71bf 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -174,7 +174,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : m_configTextFilterModel(new CategorySortFilterModel(this)) { QTC_ASSERT(bs, return); - BuildConfiguration *bc = bs->buildConfiguration(); + CMakeBuildConfiguration *bc = bs->cmakeBuildConfiguration(); m_configureDetailsWidget = new DetailsWidget; @@ -189,11 +189,10 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : m_configModel->flush(); // clear out config cache...; }); - auto buildTypeAspect = bc->aspect<BuildTypeAspect>(); - connect(buildTypeAspect, &BaseAspect::changed, this, [this, buildTypeAspect] { + connect(&bc->buildTypeAspect, &BaseAspect::changed, this, [this, bc] { if (!m_buildSystem->isMultiConfig()) { CMakeConfig config; - config << CMakeConfigItem("CMAKE_BUILD_TYPE", buildTypeAspect->value().toUtf8()); + config << CMakeConfigItem("CMAKE_BUILD_TYPE", bc->buildTypeAspect().toUtf8()); m_configModel->setBatchEditConfiguration(config); } @@ -326,15 +325,14 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : } }; - auto configureEnvironmentAspectWidget - = bc->aspect<ConfigureEnvironmentAspect>()->createConfigWidget(); + auto configureEnvironmentAspectWidget = bc->configureEnv.createConfigWidget(); configureEnvironmentAspectWidget->setContentsMargins(0, 0, 0, 0); configureEnvironmentAspectWidget->layout()->setContentsMargins(0, 0, 0, 0); Column { Form { buildDirAspect, br, - bc->aspect<BuildTypeAspect>(), br, + bc->buildTypeAspect, br, qmlDebugAspect }, m_warningMessageLabel, @@ -345,8 +343,8 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : Column { cmakeConfiguration, Row { - bc->aspect<InitialCMakeArgumentsAspect>(), br, - bc->aspect<AdditionalCMakeOptionsAspect>() + bc->initialCMakeArguments, br, + bc->additionalCMakeOptions }, m_reconfigureButton, } @@ -506,14 +504,14 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : updateInitialCMakeArguments(); }); - connect(bc->aspect<InitialCMakeArgumentsAspect>(), + connect(&bc->initialCMakeArguments, &Utils::BaseAspect::labelLinkActivated, this, [this](const QString &) { const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildSystem->kit()); CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options"); }); - connect(bc->aspect<AdditionalCMakeOptionsAspect>(), + connect(&bc->additionalCMakeOptions, &Utils::BaseAspect::labelLinkActivated, this, [this](const QString &) { const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildSystem->kit()); CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options"); @@ -629,14 +627,14 @@ void CMakeBuildSettingsWidget::updateInitialCMakeArguments() } } - auto bc = m_buildSystem->buildConfiguration(); - bc->aspect<InitialCMakeArgumentsAspect>()->setCMakeConfiguration(initialList); + auto bc = m_buildSystem->cmakeBuildConfiguration(); + bc->initialCMakeArguments.setCMakeConfiguration(initialList); // value() will contain only the unknown arguments (the non -D/-U arguments) // As the user would expect to have e.g. "--preset" from "Initial Configuration" // to "Current Configuration" as additional parameters m_buildSystem->setAdditionalCMakeArguments(ProcessArgs::splitArgs( - bc->aspect<InitialCMakeArgumentsAspect>()->value(), HostOsInfo::hostOs())); + bc->initialCMakeArguments(), HostOsInfo::hostOs())); } void CMakeBuildSettingsWidget::kitCMakeConfiguration() @@ -759,12 +757,12 @@ void CMakeBuildSettingsWidget::updateButtonState() const bool isInitial = isInitialConfiguration(); m_resetButton->setEnabled(m_configModel->hasChanges(isInitial) && !isParsing); - BuildConfiguration *bc = m_buildSystem->buildConfiguration(); - bc->aspect<InitialCMakeArgumentsAspect>()->setVisible(isInitialConfiguration()); - bc->aspect<AdditionalCMakeOptionsAspect>()->setVisible(!isInitialConfiguration()); + CMakeBuildConfiguration *bc = m_buildSystem->cmakeBuildConfiguration(); + bc->initialCMakeArguments.setVisible(isInitialConfiguration()); + bc->additionalCMakeOptions.setVisible(!isInitialConfiguration()); - bc->aspect<InitialCMakeArgumentsAspect>()->setEnabled(!isParsing); - bc->aspect<AdditionalCMakeOptionsAspect>()->setEnabled(!isParsing); + bc->initialCMakeArguments.setEnabled(!isParsing); + bc->additionalCMakeOptions.setEnabled(!isParsing); // Update label and text boldness of the reconfigure button QFont reconfigureButtonFont = m_reconfigureButton->font(); @@ -823,7 +821,7 @@ void CMakeBuildSettingsWidget::updateFromKit() const QStringList additionalKitCMake = ProcessArgs::splitArgs( CMakeConfigurationKitAspect::additionalConfiguration(k), HostOsInfo::hostOs()); const QStringList additionalInitialCMake = ProcessArgs::splitArgs( - m_buildSystem->buildConfiguration()->aspect<InitialCMakeArgumentsAspect>()->value(), + m_buildSystem->cmakeBuildConfiguration()->initialCMakeArguments(), HostOsInfo::hostOs()); QStringList mergedArgumentList; @@ -832,8 +830,8 @@ void CMakeBuildSettingsWidget::updateFromKit() additionalKitCMake.begin(), additionalKitCMake.end(), std::back_inserter(mergedArgumentList)); - m_buildSystem->buildConfiguration()->aspect<InitialCMakeArgumentsAspect>()->setValue( - ProcessArgs::joinArgs(mergedArgumentList)); + m_buildSystem->cmakeBuildConfiguration()->initialCMakeArguments + .setValue(ProcessArgs::joinArgs(mergedArgumentList)); } void CMakeBuildSettingsWidget::updateConfigurationStateIndex(int index) @@ -1362,8 +1360,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) { m_buildSystem = new CMakeBuildSystem(this); - const auto buildDirAspect = aspect<BuildDirectoryAspect>(); - buildDirAspect->setValueAcceptor( + buildDir.setValueAcceptor( [](const QString &oldDir, const QString &newDir) -> std::optional<QString> { if (oldDir.isEmpty()) return newDir; @@ -1385,11 +1382,20 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) return newDir; }); - auto initialCMakeArgumentsAspect = addAspect<InitialCMakeArgumentsAspect>(); - initialCMakeArgumentsAspect->setMacroExpanderProvider([this] { return macroExpander(); }); + // Will not be displayed, only persisted + sourceDirectory.setSettingsKey("CMake.Source.Directory"); - auto additionalCMakeArgumentsAspect = addAspect<AdditionalCMakeOptionsAspect>(); - additionalCMakeArgumentsAspect->setMacroExpanderProvider([this] { return macroExpander(); }); + buildTypeAspect.setSettingsKey(CMAKE_BUILD_TYPE); + buildTypeAspect.setLabelText(Tr::tr("Build type:")); + buildTypeAspect.setDisplayStyle(StringAspect::LineEditDisplay); + buildTypeAspect.setDefaultValue("Unknown"); + + initialCMakeArguments.setMacroExpanderProvider([this] { return macroExpander(); }); + + additionalCMakeOptions.setSettingsKey("CMake.Additional.Options"); + additionalCMakeOptions.setLabelText(Tr::tr("Additional CMake <a href=\"options\">options</a>:")); + additionalCMakeOptions.setDisplayStyle(StringAspect::LineEditDisplay); + additionalCMakeOptions.setMacroExpanderProvider([this] { return macroExpander(); }); macroExpander()->registerVariable(DEVELOPMENT_TEAM_FLAG, Tr::tr("The CMake flag for the development team"), @@ -1433,13 +1439,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) return QLatin1String(); }); - addAspect<SourceDirectoryAspect>(); - addAspect<BuildTypeAspect>(); - - auto qmlDebuggingAspect = addAspect<QtSupport::QmlDebuggingAspect>(); - qmlDebuggingAspect->setBuildConfiguration(this); - - addAspect<ConfigureEnvironmentAspect>(this); + qmlDebugging.setBuildConfiguration(this); setInitialBuildAndCleanSteps(target); @@ -1450,10 +1450,6 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) const QString buildType = extraInfoMap.contains(CMAKE_BUILD_TYPE) ? extraInfoMap.value(CMAKE_BUILD_TYPE).toString() : info.typeName; - const TriState qmlDebugging = extraInfoMap.contains(Constants::QML_DEBUG_SETTING) - ? TriState::fromVariant( - extraInfoMap.value(Constants::QML_DEBUG_SETTING)) - : TriState::Default; CommandLine cmd = defaultInitialCMakeCommand(k, buildType); m_buildSystem->setIsMultiConfig(CMakeGeneratorKitAspect::isMultiConfigGenerator(k)); @@ -1545,15 +1541,17 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) } if (extraInfoMap.contains(Constants::CMAKE_HOME_DIR)) - setSourceDirectory(FilePath::fromVariant(extraInfoMap.value(Constants::CMAKE_HOME_DIR))); + sourceDirectory.setValue(FilePath::fromVariant(extraInfoMap.value(Constants::CMAKE_HOME_DIR))); - aspect<QtSupport::QmlDebuggingAspect>()->setValue(qmlDebugging); + qmlDebugging.setValue(extraInfoMap.contains(Constants::QML_DEBUG_SETTING) + ? TriState::fromVariant(extraInfoMap.value(Constants::QML_DEBUG_SETTING)) + : TriState::Default); if (qt && qt->isQmlDebuggingSupported()) cmd.addArg("-DCMAKE_CXX_FLAGS_INIT:STRING=%{" + QLatin1String(QT_QML_DEBUG_FLAG) + "}"); CMakeProject *cmakeProject = static_cast<CMakeProject *>(target->project()); - aspect<ConfigureEnvironmentAspect>()->setUserEnvironmentChanges( + configureEnv.setUserEnvironmentChanges( getEnvironmentItemsFromCMakeConfigurePreset(cmakeProject, k)); QStringList initialCMakeArguments = cmd.splitArguments(); @@ -1664,12 +1662,12 @@ QStringList CMakeBuildSystem::configurationChangesArguments(bool initialParamete QStringList CMakeBuildSystem::initialCMakeArguments() const { - return buildConfiguration()->aspect<InitialCMakeArgumentsAspect>()->allValues(); + return cmakeBuildConfiguration()->initialCMakeArguments.allValues(); } CMakeConfig CMakeBuildSystem::initialCMakeConfiguration() const { - return buildConfiguration()->aspect<InitialCMakeArgumentsAspect>()->cmakeConfiguration(); + return cmakeBuildConfiguration()->initialCMakeArguments.cmakeConfiguration(); } void CMakeBuildSystem::setConfigurationFromCMake(const CMakeConfig &config) @@ -1706,7 +1704,7 @@ void CMakeBuildSystem::clearError(ForceEnabledChanged fec) void CMakeBuildSystem::setInitialCMakeArguments(const QStringList &args) { QStringList additionalArguments; - buildConfiguration()->aspect<InitialCMakeArgumentsAspect>()->setAllValues(args.join('\n'), additionalArguments); + cmakeBuildConfiguration()->initialCMakeArguments.setAllValues(args.join('\n'), additionalArguments); // Set the unknown additional arguments also for the "Current Configuration" setAdditionalCMakeArguments(additionalArguments); @@ -1714,7 +1712,7 @@ void CMakeBuildSystem::setInitialCMakeArguments(const QStringList &args) QStringList CMakeBuildSystem::additionalCMakeArguments() const { - return ProcessArgs::splitArgs(buildConfiguration()->aspect<AdditionalCMakeOptionsAspect>()->value(), + return ProcessArgs::splitArgs(cmakeBuildConfiguration()->additionalCMakeOptions(), HostOsInfo::hostOs()); } @@ -1727,8 +1725,8 @@ void CMakeBuildSystem::setAdditionalCMakeArguments(const QStringList &args) [](const QString &s) { return !s.isEmpty(); }); - buildConfiguration()->aspect<AdditionalCMakeOptionsAspect>()->setValue( - ProcessArgs::joinArgs(nonEmptyAdditionalArguments)); + cmakeBuildConfiguration()->additionalCMakeOptions + .setValue(ProcessArgs::joinArgs(nonEmptyAdditionalArguments)); } void CMakeBuildSystem::filterConfigArgumentsFromAdditionalCMakeArguments() @@ -1738,12 +1736,12 @@ void CMakeBuildSystem::filterConfigArgumentsFromAdditionalCMakeArguments() // which is already part of the CMake variables and should not be also // in the addtional CMake options const QStringList arguments = ProcessArgs::splitArgs( - buildConfiguration()->aspect<AdditionalCMakeOptionsAspect>()->value(), + cmakeBuildConfiguration()->additionalCMakeOptions(), HostOsInfo::hostOs()); QStringList unknownOptions; const CMakeConfig config = CMakeConfig::fromArguments(arguments, unknownOptions); - buildConfiguration()->aspect<AdditionalCMakeOptionsAspect>()->setValue(ProcessArgs::joinArgs(unknownOptions)); + cmakeBuildConfiguration()->additionalCMakeOptions.setValue(ProcessArgs::joinArgs(unknownOptions)); } void CMakeBuildSystem::setError(const QString &message) @@ -2038,16 +2036,6 @@ BuildSystem *CMakeBuildConfiguration::buildSystem() const return m_buildSystem; } -void CMakeBuildConfiguration::setSourceDirectory(const FilePath &path) -{ - aspect<SourceDirectoryAspect>()->setValue(path); -} - -FilePath CMakeBuildConfiguration::sourceDirectory() const -{ - return aspect<SourceDirectoryAspect>()->filePath(); -} - void CMakeBuildConfiguration::addToEnvironment(Utils::Environment &env) const { const CMakeTool *tool = CMakeKitAspect::cmakeTool(kit()); @@ -2062,7 +2050,7 @@ void CMakeBuildConfiguration::addToEnvironment(Utils::Environment &env) const Environment CMakeBuildConfiguration::configureEnvironment() const { - Environment env = aspect<ConfigureEnvironmentAspect>()->environment(); + Environment env = configureEnv.environment(); addToEnvironment(env); return env; @@ -2082,7 +2070,7 @@ QString CMakeBuildSystem::cmakeBuildType() const if (!isMultiConfig()) setBuildTypeFromConfig(configurationChanges()); - QString cmakeBuildType = buildConfiguration()->aspect<BuildTypeAspect>()->value(); + QString cmakeBuildType = cmakeBuildConfiguration()->buildTypeAspect(); const Utils::FilePath cmakeCacheTxt = buildConfiguration()->buildDirectory().pathAppended("CMakeCache.txt"); const bool hasCMakeCache = cmakeCacheTxt.exists(); @@ -2109,7 +2097,7 @@ QString CMakeBuildSystem::cmakeBuildType() const void CMakeBuildSystem::setCMakeBuildType(const QString &cmakeBuildType, bool quiet) { - auto aspect = buildConfiguration()->aspect<BuildTypeAspect>(); + auto aspect = &cmakeBuildConfiguration()->buildTypeAspect; if (quiet) aspect->setValueQuietly(cmakeBuildType); else @@ -2195,52 +2183,21 @@ void InitialCMakeArgumentsAspect::toMap(QVariantMap &map) const saveToMap(map, allValues().join('\n'), defaultValue(), settingsKey()); } -InitialCMakeArgumentsAspect::InitialCMakeArgumentsAspect() +InitialCMakeArgumentsAspect::InitialCMakeArgumentsAspect(AspectContainer *container) + : StringAspect(container) { setSettingsKey("CMake.Initial.Parameters"); setLabelText(Tr::tr("Additional CMake <a href=\"options\">options</a>:")); setDisplayStyle(LineEditDisplay); } -// ---------------------------------------------------------------------- -// - AdditionalCMakeOptionsAspect: -// ---------------------------------------------------------------------- - -AdditionalCMakeOptionsAspect::AdditionalCMakeOptionsAspect() -{ - setSettingsKey("CMake.Additional.Options"); - setLabelText(Tr::tr("Additional CMake <a href=\"options\">options</a>:")); - setDisplayStyle(LineEditDisplay); -} - -// ----------------------------------------------------------------------------- -// SourceDirectoryAspect: -// ----------------------------------------------------------------------------- -SourceDirectoryAspect::SourceDirectoryAspect() -{ - // Will not be displayed, only persisted - setSettingsKey("CMake.Source.Directory"); -} - -// ----------------------------------------------------------------------------- -// BuildTypeAspect: -// ----------------------------------------------------------------------------- -BuildTypeAspect::BuildTypeAspect() -{ - setSettingsKey(CMAKE_BUILD_TYPE); - setLabelText(Tr::tr("Build type:")); - setDisplayStyle(LineEditDisplay); - setDefaultValue("Unknown"); -} - // ----------------------------------------------------------------------------- // ConfigureEnvironmentAspect: // ----------------------------------------------------------------------------- -class ConfigureEnvironmentAspectWidget final : public ProjectExplorer::EnvironmentAspectWidget +class ConfigureEnvironmentAspectWidget final : public EnvironmentAspectWidget { public: - ConfigureEnvironmentAspectWidget(ConfigureEnvironmentAspect *aspect, - ProjectExplorer::Target *target) + ConfigureEnvironmentAspectWidget(ConfigureEnvironmentAspect *aspect, Target *target) : EnvironmentAspectWidget(aspect) { envWidget()->setOpenTerminalFunc([target](const Environment &env) { @@ -2250,7 +2207,9 @@ public: } }; -ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(BuildConfiguration *bc) +ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(AspectContainer *container, + BuildConfiguration *bc) + : EnvironmentAspect(container) { Target *target = bc->target(); setIsLocal(true); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index ae0913f23d1..182738c639a 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -10,6 +10,8 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/environmentaspect.h> +#include <qtsupport/qtbuildaspects.h> + namespace CMakeProjectManager { class CMakeProject; @@ -19,6 +21,33 @@ class CMakeBuildSystem; class CMakeBuildSettingsWidget; class CMakeProjectImporter; +class InitialCMakeArgumentsAspect final : public Utils::StringAspect +{ +public: + InitialCMakeArgumentsAspect(Utils::AspectContainer *container); + + const CMakeConfig &cmakeConfiguration() const; + const QStringList allValues() const; + void setAllValues(const QString &values, QStringList &additionalArguments); + void setCMakeConfiguration(const CMakeConfig &config); + + void fromMap(const QVariantMap &map) final; + void toMap(QVariantMap &map) const final; + +private: + CMakeConfig m_cmakeConfiguration; +}; + +class ConfigureEnvironmentAspect final: public ProjectExplorer::EnvironmentAspect +{ +public: + ConfigureEnvironmentAspect(Utils::AspectContainer *container, + ProjectExplorer::BuildConfiguration *buildConfig); + + void fromMap(const QVariantMap &map); + void toMap(QVariantMap &map) const; +}; + } // namespace Internal class CMAKE_EXPORT CMakeBuildConfiguration : public ProjectExplorer::BuildConfiguration @@ -39,13 +68,18 @@ public: void buildTarget(const QString &buildTarget); ProjectExplorer::BuildSystem *buildSystem() const final; - void setSourceDirectory(const Utils::FilePath& path); - Utils::FilePath sourceDirectory() const; - void addToEnvironment(Utils::Environment &env) const override; Utils::Environment configureEnvironment() const; + ProjectExplorer::BuildDirectoryAspect buildDir{this}; + Internal::InitialCMakeArgumentsAspect initialCMakeArguments{this}; + Utils::StringAspect additionalCMakeOptions{this}; + Utils::FilePathAspect sourceDirectory{this}; + Utils::StringAspect buildTypeAspect{this}; + QtSupport::QmlDebuggingAspect qmlDebugging{this}; + Internal::ConfigureEnvironmentAspect configureEnv{this, this}; + signals: void signingFlagsChanged(); void configureEnvironmentChanged(); @@ -94,59 +128,4 @@ private: friend class Internal::CMakeProjectImporter; }; -namespace Internal { - -class InitialCMakeArgumentsAspect final : public Utils::StringAspect -{ - Q_OBJECT - - CMakeConfig m_cmakeConfiguration; -public: - InitialCMakeArgumentsAspect(); - - const CMakeConfig &cmakeConfiguration() const; - const QStringList allValues() const; - void setAllValues(const QString &values, QStringList &additionalArguments); - void setCMakeConfiguration(const CMakeConfig &config); - - void fromMap(const QVariantMap &map) final; - void toMap(QVariantMap &map) const final; -}; - -class AdditionalCMakeOptionsAspect final : public Utils::StringAspect -{ - Q_OBJECT - -public: - AdditionalCMakeOptionsAspect(); -}; - -class SourceDirectoryAspect final : public Utils::FilePathAspect -{ - Q_OBJECT - -public: - SourceDirectoryAspect(); -}; - -class BuildTypeAspect final : public Utils::StringAspect -{ - Q_OBJECT - -public: - BuildTypeAspect(); -}; - -class ConfigureEnvironmentAspect final: public ProjectExplorer::EnvironmentAspect -{ - Q_OBJECT - -public: - explicit ConfigureEnvironmentAspect(ProjectExplorer::BuildConfiguration *buildConfig); - - void fromMap(const QVariantMap &map); - void toMap(QVariantMap &map) const; -}; - -} // namespace Internal } // namespace CMakeProjectManager diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index ebe650581b1..7041aaa3ef1 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1743,10 +1743,9 @@ void CMakeBuildSystem::runGenerator(Id id) } for (const CMakeConfigItem &item : std::as_const(configItems)) cmdLine.addArg(item.toArgument(buildConfiguration()->macroExpander())); - if (const auto optionsAspect = buildConfiguration()->aspect<AdditionalCMakeOptionsAspect>(); - optionsAspect && !optionsAspect->value().isEmpty()) { - cmdLine.addArgs(optionsAspect->value(), CommandLine::Raw); - } + + cmdLine.addArgs(cmakeBuildConfiguration()->additionalCMakeOptions(), CommandLine::Raw); + const auto proc = new Process(this); connect(proc, &Process::done, proc, &Process::deleteLater); connect(proc, &Process::readyReadStandardOutput, this, [proc] { From dbdd6a0701da34f1d52c59294d07669b105c969a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 16:27:46 +0200 Subject: [PATCH 0219/1777] CMake: Pass CMakeBuildConfig to the settings widget ... instead of the build system. Less indirections overall. Change-Id: I59b2fd4508b24a72357426439cac7fbd563e05bf Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../builddirparameters.cpp | 2 +- .../cmakebuildconfiguration.cpp | 191 +++++++++--------- .../cmakebuildconfiguration.h | 2 + .../cmakeprojectmanager/cmakebuildsystem.cpp | 6 +- .../cmakeprojectmanager/cmakebuildsystem.h | 7 +- 5 files changed, 99 insertions(+), 109 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/builddirparameters.cpp b/src/plugins/cmakeprojectmanager/builddirparameters.cpp index 8b7680340a0..a4068c06b4d 100644 --- a/src/plugins/cmakeprojectmanager/builddirparameters.cpp +++ b/src/plugins/cmakeprojectmanager/builddirparameters.cpp @@ -31,7 +31,7 @@ BuildDirParameters::BuildDirParameters(CMakeBuildSystem *buildSystem) expander = bc->macroExpander(); - const QStringList expandedArguments = Utils::transform(buildSystem->initialCMakeArguments(), + const QStringList expandedArguments = Utils::transform(bc->initialCMakeArguments.allValues(), [this](const QString &s) { return expander->expand(s); }); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index b48e9df71bf..2444d5a4623 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -101,7 +101,7 @@ namespace Internal { class CMakeBuildSettingsWidget : public NamedWidget { public: - CMakeBuildSettingsWidget(CMakeBuildSystem *bc); + explicit CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc); void setError(const QString &message); void setWarning(const QString &message); @@ -129,7 +129,7 @@ private: void updateConfigureDetailsWidgetsSummary( const QStringList &configurationArguments = QStringList()); - CMakeBuildSystem *m_buildSystem; + CMakeBuildConfiguration *m_buildConfig; QTreeView *m_configView; ConfigModel *m_configModel; CategorySortFilterModel *m_configFilterModel; @@ -166,15 +166,14 @@ static QModelIndex mapToSource(const QAbstractItemView *view, const QModelIndex return result; } -CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : +CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) : NamedWidget(Tr::tr("CMake")), - m_buildSystem(bs), + m_buildConfig(bc), m_configModel(new ConfigModel(this)), m_configFilterModel(new CategorySortFilterModel(this)), m_configTextFilterModel(new CategorySortFilterModel(this)) { - QTC_ASSERT(bs, return); - CMakeBuildConfiguration *bc = bs->cmakeBuildConfiguration(); + QTC_ASSERT(m_buildConfig, return); m_configureDetailsWidget = new DetailsWidget; @@ -189,10 +188,11 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : m_configModel->flush(); // clear out config cache...; }); - connect(&bc->buildTypeAspect, &BaseAspect::changed, this, [this, bc] { - if (!m_buildSystem->isMultiConfig()) { + connect(&m_buildConfig->buildTypeAspect, &BaseAspect::changed, this, [this] { + if (!m_buildConfig->cmakeBuildSystem()->isMultiConfig()) { CMakeConfig config; - config << CMakeConfigItem("CMAKE_BUILD_TYPE", bc->buildTypeAspect().toUtf8()); + config << CMakeConfigItem("CMAKE_BUILD_TYPE", + m_buildConfig->buildTypeAspect().toUtf8()); m_configModel->setBatchEditConfiguration(config); } @@ -360,10 +360,12 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : }.attachTo(this); updateAdvancedCheckBox(); - setError(m_buildSystem->error()); - setWarning(m_buildSystem->warning()); - connect(m_buildSystem, &BuildSystem::parsingStarted, this, [this] { + CMakeBuildSystem *bs = m_buildConfig->cmakeBuildSystem(); + setError(bs->error()); + setWarning(bs->warning()); + + connect(bs, &BuildSystem::parsingStarted, this, [this] { updateButtonState(); m_configView->setEnabled(false); m_showProgressTimer.start(); @@ -371,28 +373,26 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : m_configModel->setMacroExpander(bc->macroExpander()); - if (m_buildSystem->isParsing()) + if (bs->isParsing()) m_showProgressTimer.start(); else { - m_configModel->setConfiguration(m_buildSystem->configurationFromCMake()); + m_configModel->setConfiguration(bs->configurationFromCMake()); m_configModel->setInitialParametersConfiguration( - m_buildSystem->initialCMakeConfiguration()); + m_buildConfig->initialCMakeArguments.cmakeConfiguration()); } - connect(m_buildSystem, &BuildSystem::parsingFinished, this, [this] { - const CMakeConfig config = m_buildSystem->configurationFromCMake(); - auto qmlDebugAspect = m_buildSystem->buildConfiguration() - ->aspect<QtSupport::QmlDebuggingAspect>(); - const TriState qmlDebugSetting = qmlDebugAspect->value(); + connect(bs, &BuildSystem::parsingFinished, this, [this, bs] { + const CMakeConfig config = bs->configurationFromCMake(); + const TriState qmlDebugSetting = m_buildConfig->qmlDebugging.value(); bool qmlDebugConfig = CMakeBuildConfiguration::hasQmlDebugging(config); if ((qmlDebugSetting == TriState::Enabled && !qmlDebugConfig) || (qmlDebugSetting == TriState::Disabled && qmlDebugConfig)) { - qmlDebugAspect->setValue(TriState::Default); + m_buildConfig->qmlDebugging.setValue(TriState::Default); } m_configModel->setConfiguration(config); m_configModel->setInitialParametersConfiguration( - m_buildSystem->initialCMakeConfiguration()); - m_buildSystem->filterConfigArgumentsFromAdditionalCMakeArguments(); + m_buildConfig->initialCMakeArguments.cmakeConfiguration()); + m_buildConfig->filterConfigArgumentsFromAdditionalCMakeArguments(); updateFromKit(); m_configView->setEnabled(true); updateButtonState(); @@ -401,11 +401,11 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : updateConfigurationStateSelection(); }); - connect(m_buildSystem, &CMakeBuildSystem::configurationCleared, this, [this] { + connect(bs, &CMakeBuildSystem::configurationCleared, this, [this] { updateConfigurationStateSelection(); }); - connect(m_buildSystem, &CMakeBuildSystem::errorOccurred, this, [this] { + connect(bs, &CMakeBuildSystem::errorOccurred, this, [this] { m_showProgressTimer.stop(); m_progressIndicator->hide(); updateConfigurationStateSelection(); @@ -416,10 +416,8 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : connect(m_configModel, &QAbstractItemModel::modelReset, this, &CMakeBuildSettingsWidget::updateButtonState); - connect(m_buildSystem->cmakeBuildConfiguration(), - &CMakeBuildConfiguration::signingFlagsChanged, - this, - &CMakeBuildSettingsWidget::updateButtonState); + connect(m_buildConfig, &CMakeBuildConfiguration::signingFlagsChanged, + this, &CMakeBuildSettingsWidget::updateButtonState); connect(m_showAdvancedCheckBox, &QCheckBox::stateChanged, this, &CMakeBuildSettingsWidget::updateAdvancedCheckBox); @@ -436,15 +434,15 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : connect(m_resetButton, &QPushButton::clicked, this, [this] { m_configModel->resetAllChanges(isInitialConfiguration()); }); - connect(m_reconfigureButton, &QPushButton::clicked, this, [this] { - if (!m_buildSystem->isParsing()) { + connect(m_reconfigureButton, &QPushButton::clicked, this, [this, bs] { + if (!bs->isParsing()) { if (isInitialConfiguration()) { reconfigureWithInitialParameters(); } else { - m_buildSystem->runCMakeWithExtraArguments(); + bs->runCMakeWithExtraArguments(); } } else { - m_buildSystem->stopCMakeRun(); + bs->stopCMakeRun(); m_reconfigureButton->setEnabled(false); } }); @@ -481,16 +479,16 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : connect(m_batchEditButton, &QAbstractButton::clicked, this, &CMakeBuildSettingsWidget::batchEditConfiguration); - connect(m_buildSystem, &CMakeBuildSystem::errorOccurred, + connect(bs, &CMakeBuildSystem::errorOccurred, this, &CMakeBuildSettingsWidget::setError); - connect(m_buildSystem, &CMakeBuildSystem::warningOccurred, + connect(bs, &CMakeBuildSystem::warningOccurred, this, &CMakeBuildSettingsWidget::setWarning); - connect(m_buildSystem, &CMakeBuildSystem::configurationChanged, + connect(bs, &CMakeBuildSystem::configurationChanged, m_configModel, &ConfigModel::setBatchEditConfiguration); updateFromKit(); - connect(m_buildSystem->target(), &Target::kitChanged, + connect(m_buildConfig->target(), &Target::kitChanged, this, &CMakeBuildSettingsWidget::updateFromKit); connect(bc, &CMakeBuildConfiguration::enabledChanged, this, [this, bc] { if (bc->isEnabled()) @@ -500,7 +498,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : updateInitialCMakeArguments(); }); - connect(m_buildSystem->target()->project(), &Project::aboutToSaveSettings, this, [this] { + connect(m_buildConfig->target()->project(), &Project::aboutToSaveSettings, this, [this] { updateInitialCMakeArguments(); }); @@ -508,12 +506,12 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : &Utils::BaseAspect::labelLinkActivated, this, [this](const QString &) { - const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildSystem->kit()); + const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildConfig->kit()); CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options"); }); connect(&bc->additionalCMakeOptions, &Utils::BaseAspect::labelLinkActivated, this, [this](const QString &) { - const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildSystem->kit()); + const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildConfig->kit()); CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options"); }); @@ -541,14 +539,14 @@ void CMakeBuildSettingsWidget::batchEditConfiguration() "<type> can have one of the following values: FILEPATH, PATH, BOOL, INTERNAL, or STRING.<br/>" "To unset a variable, use -U<variable>.<br/>")); connect(label, &QLabel::linkActivated, this, [this](const QString &) { - const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildSystem->target()->kit()); + const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildConfig->target()->kit()); CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-variables.7.html"); }); editor->setMinimumSize(800, 200); auto chooser = new Utils::VariableChooser(dialog); chooser->addSupportedWidget(editor); - chooser->addMacroExpanderProvider([this] { return m_buildSystem->buildConfiguration()->macroExpander(); }); + chooser->addMacroExpanderProvider([this] { return m_buildConfig->macroExpander(); }); auto buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); @@ -559,7 +557,7 @@ void CMakeBuildSettingsWidget::batchEditConfiguration() connect(buttons, &QDialogButtonBox::accepted, dialog, &QDialog::accept); connect(buttons, &QDialogButtonBox::rejected, dialog, &QDialog::reject); connect(dialog, &QDialog::accepted, this, [=]{ - const auto expander = m_buildSystem->buildConfiguration()->macroExpander(); + const auto expander = m_buildConfig->macroExpander(); const QStringList lines = editor->toPlainText().split('\n', Qt::SkipEmptyParts); const QStringList expandedLines = Utils::transform(lines, @@ -577,7 +575,7 @@ void CMakeBuildSettingsWidget::batchEditConfiguration() }); editor->setPlainText( - m_buildSystem->configurationChangesArguments(isInitialConfiguration()) + m_buildConfig->cmakeBuildSystem()->configurationChangesArguments(isInitialConfiguration()) .join('\n')); dialog->show(); @@ -598,19 +596,19 @@ void CMakeBuildSettingsWidget::reconfigureWithInitialParameters() if (reply != QMessageBox::Yes) return; - m_buildSystem->clearCMakeCache(); + m_buildConfig->cmakeBuildSystem()->clearCMakeCache(); updateInitialCMakeArguments(); if (ProjectExplorerPlugin::saveModifiedFiles()) - m_buildSystem->runCMake(); + m_buildConfig->cmakeBuildSystem()->runCMake(); } void CMakeBuildSettingsWidget::updateInitialCMakeArguments() { - CMakeConfig initialList = m_buildSystem->initialCMakeConfiguration(); + CMakeConfig initialList = m_buildConfig->initialCMakeArguments.cmakeConfiguration(); - for (const CMakeConfigItem &ci : m_buildSystem->configurationChanges()) { + for (const CMakeConfigItem &ci : m_buildConfig->cmakeBuildSystem()->configurationChanges()) { if (!ci.isInitial) continue; auto it = std::find_if(initialList.begin(), @@ -627,19 +625,18 @@ void CMakeBuildSettingsWidget::updateInitialCMakeArguments() } } - auto bc = m_buildSystem->cmakeBuildConfiguration(); - bc->initialCMakeArguments.setCMakeConfiguration(initialList); + m_buildConfig->initialCMakeArguments.setCMakeConfiguration(initialList); // value() will contain only the unknown arguments (the non -D/-U arguments) // As the user would expect to have e.g. "--preset" from "Initial Configuration" // to "Current Configuration" as additional parameters - m_buildSystem->setAdditionalCMakeArguments(ProcessArgs::splitArgs( - bc->initialCMakeArguments(), HostOsInfo::hostOs())); + m_buildConfig->cmakeBuildSystem()->setAdditionalCMakeArguments(ProcessArgs::splitArgs( + m_buildConfig->initialCMakeArguments(), HostOsInfo::hostOs())); } void CMakeBuildSettingsWidget::kitCMakeConfiguration() { - m_buildSystem->kit()->blockNotification(); + m_buildConfig->kit()->blockNotification(); auto dialog = new QDialog(this); dialog->setWindowTitle(Tr::tr("Kit CMake Configuration")); @@ -647,7 +644,7 @@ void CMakeBuildSettingsWidget::kitCMakeConfiguration() dialog->setModal(true); dialog->setSizeGripEnabled(true); connect(dialog, &QDialog::finished, this, [this] { - m_buildSystem->kit()->unblockNotification(); + m_buildConfig->kit()->unblockNotification(); }); CMakeKitAspect kitAspect; @@ -655,13 +652,13 @@ void CMakeBuildSettingsWidget::kitCMakeConfiguration() CMakeConfigurationKitAspect configurationKitAspect; Layouting::Grid grid; - KitAspectWidget *widget = kitAspect.createConfigWidget(m_buildSystem->kit()); + KitAspectWidget *widget = kitAspect.createConfigWidget(m_buildConfig->kit()); widget->setParent(dialog); widget->addToLayoutWithLabel(grid, dialog); - widget = generatorAspect.createConfigWidget(m_buildSystem->kit()); + widget = generatorAspect.createConfigWidget(m_buildConfig->kit()); widget->setParent(dialog); widget->addToLayoutWithLabel(grid, dialog); - widget = configurationKitAspect.createConfigWidget(m_buildSystem->kit()); + widget = configurationKitAspect.createConfigWidget(m_buildConfig->kit()); widget->setParent(dialog); widget->addToLayoutWithLabel(grid, dialog); grid.attachTo(dialog); @@ -687,13 +684,12 @@ void CMakeBuildSettingsWidget::updateConfigureDetailsWidgetsSummary( ProjectExplorer::ProcessParameters params; CommandLine cmd; - const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildSystem->kit()); + const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildConfig->kit()); cmd.setExecutable(tool ? tool->cmakeExecutable() : "cmake"); - const BuildConfiguration *bc = m_buildSystem->buildConfiguration(); - const FilePath buildDirectory = bc ? bc->buildDirectory() : "."; + const FilePath buildDirectory = m_buildConfig ? m_buildConfig->buildDirectory() : "."; - cmd.addArgs({"-S", m_buildSystem->projectDirectory().path()}); + cmd.addArgs({"-S", m_buildConfig->project()->projectDirectory().path()}); cmd.addArgs({"-B", buildDirectory.path()}); cmd.addArgs(configurationArguments); @@ -704,7 +700,7 @@ void CMakeBuildSettingsWidget::updateConfigureDetailsWidgetsSummary( void CMakeBuildSettingsWidget::setError(const QString &message) { - m_buildSystem->buildConfiguration()->buildDirectoryAspect()->setProblem(message); + m_buildConfig->buildDirectoryAspect()->setProblem(message); } void CMakeBuildSettingsWidget::setWarning(const QString &message) @@ -716,7 +712,7 @@ void CMakeBuildSettingsWidget::setWarning(const QString &message) void CMakeBuildSettingsWidget::updateButtonState() { - const bool isParsing = m_buildSystem->isParsing(); + const bool isParsing = m_buildConfig->cmakeBuildSystem()->isParsing(); // Update extra data in buildconfiguration const QList<ConfigModel::DataItem> changes = m_configModel->configurationForCMake(); @@ -757,12 +753,11 @@ void CMakeBuildSettingsWidget::updateButtonState() const bool isInitial = isInitialConfiguration(); m_resetButton->setEnabled(m_configModel->hasChanges(isInitial) && !isParsing); - CMakeBuildConfiguration *bc = m_buildSystem->cmakeBuildConfiguration(); - bc->initialCMakeArguments.setVisible(isInitialConfiguration()); - bc->additionalCMakeOptions.setVisible(!isInitialConfiguration()); + m_buildConfig->initialCMakeArguments.setVisible(isInitialConfiguration()); + m_buildConfig->additionalCMakeOptions.setVisible(!isInitialConfiguration()); - bc->initialCMakeArguments.setEnabled(!isParsing); - bc->additionalCMakeOptions.setEnabled(!isParsing); + m_buildConfig->initialCMakeArguments.setEnabled(!isParsing); + m_buildConfig->additionalCMakeOptions.setEnabled(!isParsing); // Update label and text boldness of the reconfigure button QFont reconfigureButtonFont = m_reconfigureButton->font(); @@ -781,11 +776,11 @@ void CMakeBuildSettingsWidget::updateButtonState() } m_reconfigureButton->setFont(reconfigureButtonFont); - m_buildSystem->setConfigurationChanges(configChanges); + m_buildConfig->cmakeBuildSystem()->setConfigurationChanges(configChanges); // Update the tooltip with the changes - const QStringList configurationArguments = m_buildSystem->configurationChangesArguments( - isInitialConfiguration()); + const QStringList configurationArguments = + m_buildConfig->cmakeBuildSystem()->configurationChangesArguments(isInitialConfiguration()); m_reconfigureButton->setToolTip(configurationArguments.join('\n')); updateConfigureDetailsWidgetsSummary(configurationArguments); } @@ -805,7 +800,7 @@ void CMakeBuildSettingsWidget::updateAdvancedCheckBox() void CMakeBuildSettingsWidget::updateFromKit() { - const Kit *k = m_buildSystem->kit(); + const Kit *k = m_buildConfig->kit(); CMakeConfig config = CMakeConfigurationKitAspect::configuration(k); config.append(CMakeGeneratorKitAspect::generatorCMakeConfig(k)); @@ -820,9 +815,8 @@ void CMakeBuildSettingsWidget::updateFromKit() // Then the additional parameters const QStringList additionalKitCMake = ProcessArgs::splitArgs( CMakeConfigurationKitAspect::additionalConfiguration(k), HostOsInfo::hostOs()); - const QStringList additionalInitialCMake = ProcessArgs::splitArgs( - m_buildSystem->cmakeBuildConfiguration()->initialCMakeArguments(), - HostOsInfo::hostOs()); + const QStringList additionalInitialCMake = + ProcessArgs::splitArgs(m_buildConfig->initialCMakeArguments(), HostOsInfo::hostOs()); QStringList mergedArgumentList; std::set_union(additionalInitialCMake.begin(), @@ -830,8 +824,7 @@ void CMakeBuildSettingsWidget::updateFromKit() additionalKitCMake.begin(), additionalKitCMake.end(), std::back_inserter(mergedArgumentList)); - m_buildSystem->cmakeBuildConfiguration()->initialCMakeArguments - .setValue(ProcessArgs::joinArgs(mergedArgumentList)); + m_buildConfig->initialCMakeArguments.setValue(ProcessArgs::joinArgs(mergedArgumentList)); } void CMakeBuildSettingsWidget::updateConfigurationStateIndex(int index) @@ -850,13 +843,12 @@ void CMakeBuildSettingsWidget::updateConfigurationStateIndex(int index) CMakeConfig CMakeBuildSettingsWidget::getQmlDebugCxxFlags() { - const auto aspect = m_buildSystem->buildConfiguration()->aspect<QtSupport::QmlDebuggingAspect>(); - const TriState qmlDebuggingState = aspect->value(); + const TriState qmlDebuggingState = m_buildConfig->qmlDebugging.value(); if (qmlDebuggingState == TriState::Default) // don't touch anything return {}; - const bool enable = aspect->value() == TriState::Enabled; + const bool enable = m_buildConfig->qmlDebugging.value() == TriState::Enabled; - const CMakeConfig configList = m_buildSystem->configurationFromCMake(); + const CMakeConfig configList = m_buildConfig->cmakeBuildSystem()->configurationFromCMake(); const QByteArrayList cxxFlagsPrev{"CMAKE_CXX_FLAGS", "CMAKE_CXX_FLAGS_DEBUG", "CMAKE_CXX_FLAGS_RELWITHDEBINFO", @@ -867,7 +859,7 @@ CMakeConfig CMakeBuildSettingsWidget::getQmlDebugCxxFlags() CMakeConfig changedConfig; if (enable) { - const FilePath cmakeCache = m_buildSystem->cmakeBuildConfiguration()->buildDirectory().pathAppended("CMakeCache.txt"); + const FilePath cmakeCache = m_buildConfig->buildDirectory().pathAppended("CMakeCache.txt"); // Only modify the CMAKE_CXX_FLAGS variable if the project was previously configured // otherwise CMAKE_CXX_FLAGS_INIT will take care of setting the qmlDebug define @@ -903,10 +895,10 @@ CMakeConfig CMakeBuildSettingsWidget::getQmlDebugCxxFlags() CMakeConfig CMakeBuildSettingsWidget::getSigningFlagsChanges() { - const CMakeConfig flags = m_buildSystem->cmakeBuildConfiguration()->signingFlags(); + const CMakeConfig flags = m_buildConfig->signingFlags(); if (flags.isEmpty()) return {}; - const CMakeConfig configList = m_buildSystem->configurationFromCMake(); + const CMakeConfig configList = m_buildConfig->cmakeBuildSystem()->configurationFromCMake(); if (configList.isEmpty()) { // we don't have any configuration --> initial configuration takes care of this itself return {}; @@ -950,8 +942,7 @@ void CMakeBuildSettingsWidget::updateSelection() void CMakeBuildSettingsWidget::updateConfigurationStateSelection() { const bool hasReplyFile - = FileApiParser::scanForCMakeReplyFile( - m_buildSystem->buildConfiguration()->buildDirectory()).exists(); + = FileApiParser::scanForCMakeReplyFile(m_buildConfig->buildDirectory()).exists(); const int switchToIndex = hasReplyFile ? 1 : 0; if (m_configurationStates->currentIndex() != switchToIndex) @@ -1029,7 +1020,7 @@ bool CMakeBuildSettingsWidget::eventFilter(QObject *target, QEvent *event) connect(help, &QAction::triggered, this, [=] { const CMakeConfigItem item = ConfigModel::dataItemFromIndex(idx).toCMakeConfigItem(); - const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildSystem->target()->kit()); + const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildConfig->target()->kit()); const QString linkUrl = "%1/variable/" + QString::fromUtf8(item.key) + ".html"; CMakeTool::openCMakeHelpUrl(tool, linkUrl); }); @@ -1082,8 +1073,7 @@ bool CMakeBuildSettingsWidget::eventFilter(QObject *target, QEvent *event) const QStringList variableList = Utils::transform(validIndexes, [this](const QModelIndex &index) { return ConfigModel::dataItemFromIndex(index).toCMakeConfigItem().toArgument( - isInitialConfiguration() ? nullptr - : m_buildSystem->buildConfiguration()->macroExpander()); + isInitialConfiguration() ? nullptr : m_buildConfig->macroExpander()); }); setClipboardAndSelection(variableList.join('\n')); @@ -1660,11 +1650,6 @@ QStringList CMakeBuildSystem::configurationChangesArguments(bool initialParamete return Utils::transform(filteredInitials, &CMakeConfigItem::toArgument); } -QStringList CMakeBuildSystem::initialCMakeArguments() const -{ - return cmakeBuildConfiguration()->initialCMakeArguments.allValues(); -} - CMakeConfig CMakeBuildSystem::initialCMakeConfiguration() const { return cmakeBuildConfiguration()->initialCMakeArguments.cmakeConfiguration(); @@ -1729,19 +1714,18 @@ void CMakeBuildSystem::setAdditionalCMakeArguments(const QStringList &args) .setValue(ProcessArgs::joinArgs(nonEmptyAdditionalArguments)); } -void CMakeBuildSystem::filterConfigArgumentsFromAdditionalCMakeArguments() +void CMakeBuildConfiguration::filterConfigArgumentsFromAdditionalCMakeArguments() { // On iOS the %{Ios:DevelopmentTeam:Flag} evalues to something like // -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM:STRING=MAGICSTRING // which is already part of the CMake variables and should not be also // in the addtional CMake options - const QStringList arguments = ProcessArgs::splitArgs( - cmakeBuildConfiguration()->additionalCMakeOptions(), - HostOsInfo::hostOs()); + const QStringList arguments = ProcessArgs::splitArgs(additionalCMakeOptions(), + HostOsInfo::hostOs()); QStringList unknownOptions; const CMakeConfig config = CMakeConfig::fromArguments(arguments, unknownOptions); - cmakeBuildConfiguration()->additionalCMakeOptions.setValue(ProcessArgs::joinArgs(unknownOptions)); + additionalCMakeOptions.setValue(ProcessArgs::joinArgs(unknownOptions)); } void CMakeBuildSystem::setError(const QString &message) @@ -1781,7 +1765,7 @@ QString CMakeBuildSystem::warning() const NamedWidget *CMakeBuildConfiguration::createConfigWidget() { - return new CMakeBuildSettingsWidget(m_buildSystem); + return new CMakeBuildSettingsWidget(this); } CMakeConfig CMakeBuildConfiguration::signingFlags() const @@ -1789,7 +1773,7 @@ CMakeConfig CMakeBuildConfiguration::signingFlags() const return {}; } -void CMakeBuildConfiguration::setInitialBuildAndCleanSteps(const ProjectExplorer::Target *target) +void CMakeBuildConfiguration::setInitialBuildAndCleanSteps(const Target *target) { const CMakeConfigItem presetItem = CMakeConfigurationKitAspect::cmakePresetConfigItem( target->kit()); @@ -2036,6 +2020,11 @@ BuildSystem *CMakeBuildConfiguration::buildSystem() const return m_buildSystem; } +CMakeBuildSystem *CMakeBuildConfiguration::cmakeBuildSystem() const +{ + return m_buildSystem; +} + void CMakeBuildConfiguration::addToEnvironment(Utils::Environment &env) const { const CMakeTool *tool = CMakeKitAspect::cmakeTool(kit()); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index 182738c639a..e383408ec45 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -71,6 +71,7 @@ public: void addToEnvironment(Utils::Environment &env) const override; Utils::Environment configureEnvironment() const; + Internal::CMakeBuildSystem *cmakeBuildSystem() const; ProjectExplorer::BuildDirectoryAspect buildDir{this}; Internal::InitialCMakeArgumentsAspect initialCMakeArguments{this}; @@ -97,6 +98,7 @@ private: void setInitialBuildAndCleanSteps(const ProjectExplorer::Target *target); void setBuildPresetToBuildSteps(const ProjectExplorer::Target *target); + void filterConfigArgumentsFromAdditionalCMakeArguments(); Internal::CMakeBuildSystem *m_buildSystem = nullptr; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 7041aaa3ef1..f6f56c76d75 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1572,7 +1572,8 @@ void CMakeBuildSystem::updateQmlJSCodeModel(const QStringList &extraHeaderPaths, void CMakeBuildSystem::updateInitialCMakeExpandableVars() { const CMakeConfig &cm = configurationFromCMake(); - const CMakeConfig &initialConfig = initialCMakeConfiguration(); + const CMakeConfig &initialConfig = + cmakeBuildConfiguration()->initialCMakeArguments.cmakeConfiguration(); CMakeConfig config; @@ -1733,7 +1734,8 @@ void CMakeBuildSystem::runGenerator(Id id) QList<CMakeConfigItem> configItems = Utils::filtered(m_configurationChanges.toList(), itemFilter); const QList<CMakeConfigItem> initialConfigItems - = Utils::filtered(initialCMakeConfiguration().toList(), itemFilter); + = Utils::filtered(cmakeBuildConfiguration()->initialCMakeArguments.cmakeConfiguration().toList(), + itemFilter); for (const CMakeConfigItem &item : std::as_const(initialConfigItems)) { if (!Utils::contains(configItems, [&item](const CMakeConfigItem &existingItem) { return existingItem.key == item.key; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h index 4770b4d84bc..12629227762 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h @@ -109,14 +109,9 @@ public: QStringList configurationChangesArguments(bool initialParameters = false) const; - QStringList initialCMakeArguments() const; - CMakeConfig initialCMakeConfiguration() const; - QStringList additionalCMakeArguments() const; void setAdditionalCMakeArguments(const QStringList &args); - void filterConfigArgumentsFromAdditionalCMakeArguments(); - void setConfigurationFromCMake(const CMakeConfig &config); void setConfigurationChanges(const CMakeConfig &config); @@ -132,6 +127,8 @@ signals: void warningOccurred(const QString &message); private: + CMakeConfig initialCMakeConfiguration() const; + QList<QPair<Utils::Id, QString>> generators() const override; void runGenerator(Utils::Id id) override; ProjectExplorer::ExtraCompiler *findExtraCompiler( From 5f9408ee8d0b46f8f9a7380d2c78b1484c05b870 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 16:46:33 +0200 Subject: [PATCH 0220/1777] CMake: Move some functions from build system to build config Less indirection. Change-Id: I3a0a41c360b051cf0a3021d57d437fbde8f0736e Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../builddirparameters.cpp | 2 +- .../cmakebuildconfiguration.cpp | 32 ++++++++----------- .../cmakebuildconfiguration.h | 6 ++++ .../cmakeprojectmanager/cmakebuildsystem.cpp | 2 +- .../cmakeprojectmanager/cmakebuildsystem.h | 6 ---- 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/builddirparameters.cpp b/src/plugins/cmakeprojectmanager/builddirparameters.cpp index a4068c06b4d..fe4c63af3f7 100644 --- a/src/plugins/cmakeprojectmanager/builddirparameters.cpp +++ b/src/plugins/cmakeprojectmanager/builddirparameters.cpp @@ -41,7 +41,7 @@ BuildDirParameters::BuildDirParameters(CMakeBuildSystem *buildSystem) [this](const QString &s) { return expander->expand(s); }); - additionalCMakeArguments = Utils::transform(buildSystem->additionalCMakeArguments(), + additionalCMakeArguments = Utils::transform(bc->additionalCMakeArguments(), [this](const QString &s) { return expander->expand(s); }); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 2444d5a4623..f5961f03aef 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -630,7 +630,7 @@ void CMakeBuildSettingsWidget::updateInitialCMakeArguments() // value() will contain only the unknown arguments (the non -D/-U arguments) // As the user would expect to have e.g. "--preset" from "Initial Configuration" // to "Current Configuration" as additional parameters - m_buildConfig->cmakeBuildSystem()->setAdditionalCMakeArguments(ProcessArgs::splitArgs( + m_buildConfig->setAdditionalCMakeArguments(ProcessArgs::splitArgs( m_buildConfig->initialCMakeArguments(), HostOsInfo::hostOs())); } @@ -1550,8 +1550,8 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) k, configureEnvironment(), info.buildDirectory); - m_buildSystem->setInitialCMakeArguments(initialCMakeArguments); - m_buildSystem->setCMakeBuildType(buildType); + setInitialCMakeArguments(initialCMakeArguments); + setCMakeBuildType(buildType); setBuildPresetToBuildSteps(target); }); @@ -1686,32 +1686,30 @@ void CMakeBuildSystem::clearError(ForceEnabledChanged fec) } } -void CMakeBuildSystem::setInitialCMakeArguments(const QStringList &args) +void CMakeBuildConfiguration::setInitialCMakeArguments(const QStringList &args) { QStringList additionalArguments; - cmakeBuildConfiguration()->initialCMakeArguments.setAllValues(args.join('\n'), additionalArguments); + initialCMakeArguments.setAllValues(args.join('\n'), additionalArguments); // Set the unknown additional arguments also for the "Current Configuration" setAdditionalCMakeArguments(additionalArguments); } -QStringList CMakeBuildSystem::additionalCMakeArguments() const +QStringList CMakeBuildConfiguration::additionalCMakeArguments() const { - return ProcessArgs::splitArgs(cmakeBuildConfiguration()->additionalCMakeOptions(), - HostOsInfo::hostOs()); + return ProcessArgs::splitArgs(additionalCMakeOptions(), HostOsInfo::hostOs()); } -void CMakeBuildSystem::setAdditionalCMakeArguments(const QStringList &args) +void CMakeBuildConfiguration::setAdditionalCMakeArguments(const QStringList &args) { const QStringList expandedAdditionalArguments = Utils::transform(args, [this](const QString &s) { - return buildConfiguration()->macroExpander()->expand(s); + return macroExpander()->expand(s); }); const QStringList nonEmptyAdditionalArguments = Utils::filtered(expandedAdditionalArguments, [](const QString &s) { return !s.isEmpty(); }); - cmakeBuildConfiguration()->additionalCMakeOptions - .setValue(ProcessArgs::joinArgs(nonEmptyAdditionalArguments)); + additionalCMakeOptions.setValue(ProcessArgs::joinArgs(nonEmptyAdditionalArguments)); } void CMakeBuildConfiguration::filterConfigArgumentsFromAdditionalCMakeArguments() @@ -2052,8 +2050,7 @@ QString CMakeBuildSystem::cmakeBuildType() const return item.key == "CMAKE_BUILD_TYPE" && !item.isInitial; }); if (it != config.end()) - const_cast<CMakeBuildSystem*>(this) - ->setCMakeBuildType(QString::fromUtf8(it->value)); + cmakeBuildConfiguration()->setCMakeBuildType(QString::fromUtf8(it->value)); }; if (!isMultiConfig()) @@ -2084,13 +2081,12 @@ QString CMakeBuildSystem::cmakeBuildType() const return cmakeBuildType; } -void CMakeBuildSystem::setCMakeBuildType(const QString &cmakeBuildType, bool quiet) +void CMakeBuildConfiguration::setCMakeBuildType(const QString &cmakeBuildType, bool quiet) { - auto aspect = &cmakeBuildConfiguration()->buildTypeAspect; if (quiet) - aspect->setValueQuietly(cmakeBuildType); + buildTypeAspect.setValueQuietly(cmakeBuildType); else - aspect->setValue(cmakeBuildType); + buildTypeAspect.setValue(cmakeBuildType); } namespace Internal { diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index e383408ec45..cd019042d45 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -73,6 +73,12 @@ public: Utils::Environment configureEnvironment() const; Internal::CMakeBuildSystem *cmakeBuildSystem() const; + QStringList additionalCMakeArguments() const; + void setAdditionalCMakeArguments(const QStringList &args); + + void setInitialCMakeArguments(const QStringList &args); + void setCMakeBuildType(const QString &cmakeBuildType, bool quiet = false); + ProjectExplorer::BuildDirectoryAspect buildDir{this}; Internal::InitialCMakeArgumentsAspect initialCMakeArguments{this}; Utils::StringAspect additionalCMakeOptions{this}; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index f6f56c76d75..69e8c74a10b 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1182,7 +1182,7 @@ void CMakeBuildSystem::wireUpConnections() const CMakeConfig config = CMakeConfig::fromFile(cmakeCacheTxt, &errorMessage); if (!config.isEmpty() && errorMessage.isEmpty()) { QString cmakeBuildTypeName = config.stringValueOf("CMAKE_BUILD_TYPE"); - setCMakeBuildType(cmakeBuildTypeName, true); + cmakeBuildConfiguration()->setCMakeBuildType(cmakeBuildTypeName, true); } } reparse(options); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h index 12629227762..694840af26b 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h @@ -101,7 +101,6 @@ public: CMakeProject *project() const; QString cmakeBuildType() const; - void setCMakeBuildType(const QString &cmakeBuildType, bool quiet = false); ProjectExplorer::BuildConfiguration::BuildType buildType() const; CMakeConfig configurationFromCMake() const; @@ -109,14 +108,9 @@ public: QStringList configurationChangesArguments(bool initialParameters = false) const; - QStringList additionalCMakeArguments() const; - void setAdditionalCMakeArguments(const QStringList &args); - void setConfigurationFromCMake(const CMakeConfig &config); void setConfigurationChanges(const CMakeConfig &config); - void setInitialCMakeArguments(const QStringList &args); - QString error() const; QString warning() const; From 28e95910524b8e1302d1aa9c3a690cbbd476e704 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 10 Jul 2023 12:52:21 +0200 Subject: [PATCH 0221/1777] Perforce: Use more direct check for executable presence The !isEmpty check is actually redundant, but currently cheaper than the diversion through FilePath::fileAccess(). Change-Id: I44e6ec128c78cccf57c7276da70577a87b8c2f96 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/perforce/perforceplugin.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 5e6a7b18478..5101d471591 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -1117,11 +1117,8 @@ bool PerforcePluginPrivate::isVcsFileOrDirectory(const FilePath &filePath) const bool PerforcePluginPrivate::isConfigured() const { - const QString binary = m_settings.p4BinaryPath.value(); - if (binary.isEmpty()) - return false; - QFileInfo fi(binary); - return fi.exists() && fi.isFile() && fi.isExecutable(); + const FilePath binary = m_settings.p4BinaryPath(); + return !binary.isEmpty() && binary.isExecutableFile(); } bool PerforcePluginPrivate::supportsOperation(Operation operation) const From 7596a91f31092bacd542503828b14bbf288b2a7e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 08:34:03 +0200 Subject: [PATCH 0222/1777] Beautifier: Move functions from settings to tools [1/3] This is a preliminarily renaming files to keep diffs small. Change-Id: I5fc25bd2435a48f1ac3e2f22287004a0f2c8dd16 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/beautifier/CMakeLists.txt | 2 +- src/plugins/beautifier/artisticstyle/artisticstyle.cpp | 2 +- src/plugins/beautifier/beautifier.qbs | 4 ++-- .../beautifier/{abstractsettings.cpp => beautifiertool.cpp} | 2 +- .../beautifier/{abstractsettings.h => beautifiertool.h} | 0 src/plugins/beautifier/clangformat/clangformat.cpp | 2 +- src/plugins/beautifier/configurationdialog.cpp | 2 +- src/plugins/beautifier/configurationeditor.cpp | 2 +- src/plugins/beautifier/configurationpanel.cpp | 2 +- src/plugins/beautifier/uncrustify/uncrustify.cpp | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) rename src/plugins/beautifier/{abstractsettings.cpp => beautifiertool.cpp} (99%) rename src/plugins/beautifier/{abstractsettings.h => beautifiertool.h} (100%) diff --git a/src/plugins/beautifier/CMakeLists.txt b/src/plugins/beautifier/CMakeLists.txt index f35e7242f05..fa9d27b23d4 100644 --- a/src/plugins/beautifier/CMakeLists.txt +++ b/src/plugins/beautifier/CMakeLists.txt @@ -2,12 +2,12 @@ add_qtc_plugin(Beautifier DEPENDS Qt::Xml PLUGIN_DEPENDS Core ProjectExplorer TextEditor SOURCES - abstractsettings.cpp abstractsettings.h artisticstyle/artisticstyle.cpp artisticstyle/artisticstyle.h beautifier.qrc beautifierabstracttool.h beautifierconstants.h beautifierplugin.cpp beautifierplugin.h + beautifiertool.cpp beautifiertool.h beautifiertr.h clangformat/clangformat.cpp clangformat/clangformat.h configurationdialog.cpp configurationdialog.h diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp index 71a63ed6d06..8960f42fbc1 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp @@ -5,9 +5,9 @@ #include "artisticstyle.h" -#include "../abstractsettings.h" #include "../beautifierconstants.h" #include "../beautifierplugin.h" +#include "../beautifiertool.h" #include "../beautifiertr.h" #include "../configurationpanel.h" diff --git a/src/plugins/beautifier/beautifier.qbs b/src/plugins/beautifier/beautifier.qbs index 5b80a7b1fda..4165a383876 100644 --- a/src/plugins/beautifier/beautifier.qbs +++ b/src/plugins/beautifier/beautifier.qbs @@ -11,13 +11,13 @@ QtcPlugin { Depends { name: "ProjectExplorer" } files: [ - "abstractsettings.h", - "abstractsettings.cpp", "beautifier.qrc", "beautifierabstracttool.h", "beautifierconstants.h", "beautifierplugin.cpp", "beautifierplugin.h", + "beautifiertool.h", + "beautifiertool.cpp", "beautifiertr.h", "configurationdialog.cpp", "configurationdialog.h", diff --git a/src/plugins/beautifier/abstractsettings.cpp b/src/plugins/beautifier/beautifiertool.cpp similarity index 99% rename from src/plugins/beautifier/abstractsettings.cpp rename to src/plugins/beautifier/beautifiertool.cpp index 3661720ae37..5e5300fd10b 100644 --- a/src/plugins/beautifier/abstractsettings.cpp +++ b/src/plugins/beautifier/beautifiertool.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2016 Lorenz Haas // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "abstractsettings.h" +#include "beautifiertool.h" #include "beautifierconstants.h" #include "beautifierplugin.h" diff --git a/src/plugins/beautifier/abstractsettings.h b/src/plugins/beautifier/beautifiertool.h similarity index 100% rename from src/plugins/beautifier/abstractsettings.h rename to src/plugins/beautifier/beautifiertool.h diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index c656347a00e..d529ae0eb47 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -5,9 +5,9 @@ #include "clangformat.h" -#include "../abstractsettings.h" #include "../beautifierconstants.h" #include "../beautifierplugin.h" +#include "../beautifiertool.h" #include "../beautifiertr.h" #include "../configurationpanel.h" diff --git a/src/plugins/beautifier/configurationdialog.cpp b/src/plugins/beautifier/configurationdialog.cpp index 09e8c595f30..9d3cf5f5cc8 100644 --- a/src/plugins/beautifier/configurationdialog.cpp +++ b/src/plugins/beautifier/configurationdialog.cpp @@ -3,7 +3,7 @@ #include "configurationdialog.h" -#include "abstractsettings.h" +#include "beautifiertool.h" #include "beautifiertr.h" #include "configurationeditor.h" diff --git a/src/plugins/beautifier/configurationeditor.cpp b/src/plugins/beautifier/configurationeditor.cpp index a90e6230a2f..1a365dc4e7c 100644 --- a/src/plugins/beautifier/configurationeditor.cpp +++ b/src/plugins/beautifier/configurationeditor.cpp @@ -3,7 +3,7 @@ #include "configurationeditor.h" -#include "abstractsettings.h" +#include "beautifiertool.h" #include <texteditor/fontsettings.h> #include <texteditor/texteditorsettings.h> diff --git a/src/plugins/beautifier/configurationpanel.cpp b/src/plugins/beautifier/configurationpanel.cpp index fa0fca71393..fca4242e373 100644 --- a/src/plugins/beautifier/configurationpanel.cpp +++ b/src/plugins/beautifier/configurationpanel.cpp @@ -3,7 +3,7 @@ #include "configurationpanel.h" -#include "abstractsettings.h" +#include "beautifiertool.h" #include "beautifiertr.h" #include "configurationdialog.h" diff --git a/src/plugins/beautifier/uncrustify/uncrustify.cpp b/src/plugins/beautifier/uncrustify/uncrustify.cpp index f91fc1423dd..43082d82dff 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustify.cpp @@ -5,9 +5,9 @@ #include "uncrustify.h" -#include "../abstractsettings.h" #include "../beautifierconstants.h" #include "../beautifierplugin.h" +#include "../beautifiertool.h" #include "../beautifiertr.h" #include "../configurationpanel.h" From d672d70732da0efccc6ce0e65973d925c704f8fe Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 08:43:59 +0200 Subject: [PATCH 0223/1777] Beautifier: Move functions from settings to tools [2/3] Change-Id: Ie0773c99d9f2c814da124259c015d7d0fdc1b497 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/beautifier/CMakeLists.txt | 1 - .../beautifier/artisticstyle/artisticstyle.h | 4 +-- src/plugins/beautifier/beautifier.qbs | 1 - .../beautifier/beautifierabstracttool.h | 35 ------------------- src/plugins/beautifier/beautifierplugin.cpp | 8 ++--- src/plugins/beautifier/beautifiertool.h | 28 +++++++++++++-- .../beautifier/clangformat/clangformat.h | 4 +-- .../beautifier/uncrustify/uncrustify.h | 4 +-- 8 files changed, 36 insertions(+), 49 deletions(-) delete mode 100644 src/plugins/beautifier/beautifierabstracttool.h diff --git a/src/plugins/beautifier/CMakeLists.txt b/src/plugins/beautifier/CMakeLists.txt index fa9d27b23d4..e2ea02a75b9 100644 --- a/src/plugins/beautifier/CMakeLists.txt +++ b/src/plugins/beautifier/CMakeLists.txt @@ -4,7 +4,6 @@ add_qtc_plugin(Beautifier SOURCES artisticstyle/artisticstyle.cpp artisticstyle/artisticstyle.h beautifier.qrc - beautifierabstracttool.h beautifierconstants.h beautifierplugin.cpp beautifierplugin.h beautifiertool.cpp beautifiertool.h diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.h b/src/plugins/beautifier/artisticstyle/artisticstyle.h index 2f920924266..db0af2bc1c8 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.h +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.h @@ -3,7 +3,7 @@ #pragma once -#include "../beautifierabstracttool.h" +#include "../beautifiertool.h" QT_BEGIN_NAMESPACE class QAction; @@ -11,7 +11,7 @@ QT_END_NAMESPACE namespace Beautifier::Internal { -class ArtisticStyle : public BeautifierAbstractTool +class ArtisticStyle : public BeautifierTool { public: ArtisticStyle(); diff --git a/src/plugins/beautifier/beautifier.qbs b/src/plugins/beautifier/beautifier.qbs index 4165a383876..1d540b96cca 100644 --- a/src/plugins/beautifier/beautifier.qbs +++ b/src/plugins/beautifier/beautifier.qbs @@ -12,7 +12,6 @@ QtcPlugin { files: [ "beautifier.qrc", - "beautifierabstracttool.h", "beautifierconstants.h", "beautifierplugin.cpp", "beautifierplugin.h", diff --git a/src/plugins/beautifier/beautifierabstracttool.h b/src/plugins/beautifier/beautifierabstracttool.h deleted file mode 100644 index 00454b60de8..00000000000 --- a/src/plugins/beautifier/beautifierabstracttool.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2016 Lorenz Haas -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <texteditor/command.h> - -#include <QObject> - -namespace Core { -class IDocument; -class IEditor; -} - -namespace Beautifier::Internal { - -class BeautifierAbstractTool : public QObject -{ -public: - BeautifierAbstractTool() = default; - - virtual QString id() const = 0; - virtual void updateActions(Core::IEditor *editor) = 0; - - /** - * Returns the tool's command to format an entire file. - * - * @note The received command may be invalid. - */ - virtual TextEditor::Command command() const = 0; - - virtual bool isApplicable(const Core::IDocument *document) const = 0; -}; - -} // Beautifier::Internal diff --git a/src/plugins/beautifier/beautifierplugin.cpp b/src/plugins/beautifier/beautifierplugin.cpp index b849976a05b..fe76fd1de7d 100644 --- a/src/plugins/beautifier/beautifierplugin.cpp +++ b/src/plugins/beautifier/beautifierplugin.cpp @@ -74,7 +74,7 @@ public: ClangFormat clangFormatBeautifier; Uncrustify uncrustifyBeautifier; - BeautifierAbstractTool *m_tools[3] { + BeautifierTool *m_tools[3] { &artisticStyleBeautifier, &uncrustifyBeautifier, &clangFormatBeautifier @@ -105,7 +105,7 @@ ExtensionSystem::IPlugin::ShutdownFlag BeautifierPlugin::aboutToShutdown() BeautifierPluginPrivate::BeautifierPluginPrivate() { - for (BeautifierAbstractTool *tool : m_tools) + for (BeautifierTool *tool : m_tools) generalSettings.autoFormatTools.addOption(tool->id()); updateActions(); @@ -119,7 +119,7 @@ BeautifierPluginPrivate::BeautifierPluginPrivate() void BeautifierPluginPrivate::updateActions(Core::IEditor *editor) { - for (BeautifierAbstractTool *tool : m_tools) + for (BeautifierTool *tool : m_tools) tool->updateActions(editor); } @@ -147,7 +147,7 @@ void BeautifierPluginPrivate::autoFormatOnSave(Core::IDocument *document) // Find tool to use by id and format file! const QString id = generalSettings.autoFormatTools.stringValue(); auto tool = std::find_if(std::begin(m_tools), std::end(m_tools), - [&id](const BeautifierAbstractTool *t){return t->id() == id;}); + [&id](const BeautifierTool *t){return t->id() == id;}); if (tool != std::end(m_tools)) { if (!(*tool)->isApplicable(document)) return; diff --git a/src/plugins/beautifier/beautifiertool.h b/src/plugins/beautifier/beautifiertool.h index 8e9ceea931d..392b460dc70 100644 --- a/src/plugins/beautifier/beautifiertool.h +++ b/src/plugins/beautifier/beautifiertool.h @@ -5,12 +5,15 @@ #include <coreplugin/dialogs/ioptionspage.h> +#include <texteditor/command.h> + #include <utils/aspects.h> #include <utils/filepath.h> #include <QDir> #include <QHash> #include <QMap> +#include <QObject> #include <QSet> #include <QString> #include <QStringList> @@ -22,9 +25,30 @@ class QRegularExpression; class QVersionNumber; QT_END_NAMESPACE -namespace Core { class IDocument; } +namespace Core { +class IDocument; +class IEditor; +} -namespace Beautifier::Internal { +namespace Beautifier::Internal { + +class BeautifierTool : public QObject +{ +public: + BeautifierTool() = default; + + virtual QString id() const = 0; + virtual void updateActions(Core::IEditor *editor) = 0; + + /** + * Returns the tool's command to format an entire file. + * + * @note The received command may be invalid. + */ + virtual TextEditor::Command command() const = 0; + + virtual bool isApplicable(const Core::IDocument *document) const = 0; +}; class VersionUpdater; diff --git a/src/plugins/beautifier/clangformat/clangformat.h b/src/plugins/beautifier/clangformat/clangformat.h index 22b8ce2a093..9b6b00df40b 100644 --- a/src/plugins/beautifier/clangformat/clangformat.h +++ b/src/plugins/beautifier/clangformat/clangformat.h @@ -3,7 +3,7 @@ #pragma once -#include "../beautifierabstracttool.h" +#include "../beautifiertool.h" QT_BEGIN_NAMESPACE class QAction; @@ -11,7 +11,7 @@ QT_END_NAMESPACE namespace Beautifier::Internal { -class ClangFormat : public BeautifierAbstractTool +class ClangFormat : public BeautifierTool { public: ClangFormat(); diff --git a/src/plugins/beautifier/uncrustify/uncrustify.h b/src/plugins/beautifier/uncrustify/uncrustify.h index 09f6c2273d1..71ee4730c14 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.h +++ b/src/plugins/beautifier/uncrustify/uncrustify.h @@ -3,7 +3,7 @@ #pragma once -#include "../beautifierabstracttool.h" +#include "../beautifiertool.h" QT_BEGIN_NAMESPACE class QAction; @@ -11,7 +11,7 @@ QT_END_NAMESPACE namespace Beautifier::Internal { -class Uncrustify : public BeautifierAbstractTool +class Uncrustify : public BeautifierTool { public: Uncrustify(); From 5545c93ad10c8ae28ac4279d86f6764a31126a8a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 09:00:17 +0200 Subject: [PATCH 0224/1777] Beautifier: Move functions from settings to tools [3/3] Change-Id: I579af5bf7db6f8ed50efdadf7037affdda458c74 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../artisticstyle/artisticstyle.cpp | 7 +- src/plugins/beautifier/beautifierplugin.cpp | 49 +----------- src/plugins/beautifier/beautifierplugin.h | 11 --- src/plugins/beautifier/beautifiertool.cpp | 80 +++++++++++++++---- src/plugins/beautifier/beautifiertool.h | 10 ++- .../beautifier/clangformat/clangformat.cpp | 14 ++-- .../beautifier/uncrustify/uncrustify.cpp | 11 ++- 7 files changed, 89 insertions(+), 93 deletions(-) diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp index 8960f42fbc1..89699253a6a 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp @@ -6,7 +6,6 @@ #include "artisticstyle.h" #include "../beautifierconstants.h" -#include "../beautifierplugin.h" #include "../beautifiertool.h" #include "../beautifiertr.h" #include "../configurationpanel.h" @@ -64,7 +63,7 @@ public: setVersionRegExp(QRegularExpression("([2-9]{1})\\.([0-9]{1,2})(\\.[1-9]{1})?$")); command.setLabelText(Tr::tr("Artistic Style command:")); command.setDefaultValue("astyle"); - command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle(displayName())); + command.setPromptDialogTitle(BeautifierTool::msgCommandPromptDialogTitle(displayName())); useOtherFiles.setSettingsKey("useOtherFiles"); useOtherFiles.setLabelText(Tr::tr("Use file *.astylerc defined in project files")); @@ -255,7 +254,7 @@ ArtisticStyle::ArtisticStyle() Core::ActionContainer *menu = Core::ActionManager::createMenu("ArtisticStyle.Menu"); menu->menu()->setTitle(Tr::tr("&Artistic Style")); - m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this); + m_formatFile = new QAction(msgFormatCurrentFile(), this); menu->addAction(Core::ActionManager::registerAction(m_formatFile, "ArtisticStyle.FormatFile")); connect(m_formatFile, &QAction::triggered, this, &ArtisticStyle::formatFile); @@ -279,7 +278,7 @@ void ArtisticStyle::formatFile() { const QString cfgFileName = configurationFile(); if (cfgFileName.isEmpty()) - BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile(displayName())); + showError(msgCannotGetConfigurationFile(displayName())); else formatCurrentFile(command(cfgFileName)); } diff --git a/src/plugins/beautifier/beautifierplugin.cpp b/src/plugins/beautifier/beautifierplugin.cpp index fe76fd1de7d..d1505e74987 100644 --- a/src/plugins/beautifier/beautifierplugin.cpp +++ b/src/plugins/beautifier/beautifierplugin.cpp @@ -19,14 +19,17 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/ieditor.h> #include <coreplugin/messagemanager.h> + #include <projectexplorer/project.h> #include <projectexplorer/projectnodes.h> #include <projectexplorer/projecttree.h> + #include <texteditor/formattexteditor.h> #include <texteditor/textdocument.h> #include <texteditor/textdocumentlayout.h> #include <texteditor/texteditor.h> #include <texteditor/texteditorconstants.h> + #include <utils/algorithm.h> #include <utils/fileutils.h> #include <utils/mimeutils.h> @@ -162,50 +165,4 @@ void BeautifierPluginPrivate::autoFormatOnSave(Core::IDocument *document) } } -void BeautifierPlugin::showError(const QString &error) -{ - Core::MessageManager::writeFlashing(Tr::tr("Error in Beautifier: %1").arg(error.trimmed())); -} - -QString BeautifierPlugin::msgCannotGetConfigurationFile(const QString &command) -{ - return Tr::tr("Cannot get configuration file for %1.").arg(command); -} - -QString BeautifierPlugin::msgFormatCurrentFile() -{ - //: Menu entry - return Tr::tr("Format &Current File"); -} - -QString BeautifierPlugin::msgFormatSelectedText() -{ - //: Menu entry - return Tr::tr("Format &Selected Text"); -} - -QString BeautifierPlugin::msgFormatAtCursor() -{ - //: Menu entry - return Tr::tr("&Format at Cursor"); -} - -QString BeautifierPlugin::msgFormatLines() -{ - //: Menu entry - return Tr::tr("Format &Line(s)"); -} - -QString BeautifierPlugin::msgDisableFormattingSelectedText() -{ - //: Menu entry - return Tr::tr("&Disable Formatting for Selected Text"); -} - -QString BeautifierPlugin::msgCommandPromptDialogTitle(const QString &command) -{ - //: File dialog title for path chooser when choosing binary - return Tr::tr("%1 Command").arg(command); -} - } // Beautifier::Internal diff --git a/src/plugins/beautifier/beautifierplugin.h b/src/plugins/beautifier/beautifierplugin.h index 8b3d89ed210..e64403d9a7c 100644 --- a/src/plugins/beautifier/beautifierplugin.h +++ b/src/plugins/beautifier/beautifierplugin.h @@ -13,17 +13,6 @@ class BeautifierPlugin : public ExtensionSystem::IPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Beautifier.json") -public: - static QString msgCannotGetConfigurationFile(const QString &command); - static QString msgFormatCurrentFile(); - static QString msgFormatSelectedText(); - static QString msgFormatAtCursor(); - static QString msgFormatLines(); - static QString msgDisableFormattingSelectedText(); - static QString msgCommandPromptDialogTitle(const QString &command); - static void showError(const QString &error); - -private: void initialize() override; void extensionsInitialized() override; ShutdownFlag aboutToShutdown() override; diff --git a/src/plugins/beautifier/beautifiertool.cpp b/src/plugins/beautifier/beautifiertool.cpp index 5e5300fd10b..76b6e7dbd09 100644 --- a/src/plugins/beautifier/beautifiertool.cpp +++ b/src/plugins/beautifier/beautifiertool.cpp @@ -4,11 +4,11 @@ #include "beautifiertool.h" #include "beautifierconstants.h" -#include "beautifierplugin.h" #include "beautifiertr.h" #include <coreplugin/icore.h> #include <coreplugin/idocument.h> +#include <coreplugin/messagemanager.h> #include <utils/algorithm.h> #include <utils/fileutils.h> @@ -26,6 +26,52 @@ using namespace Utils; namespace Beautifier::Internal { +void BeautifierTool::showError(const QString &error) +{ + Core::MessageManager::writeFlashing(Tr::tr("Error in Beautifier: %1").arg(error.trimmed())); +} + +QString BeautifierTool::msgCannotGetConfigurationFile(const QString &command) +{ + return Tr::tr("Cannot get configuration file for %1.").arg(command); +} + +QString BeautifierTool::msgFormatCurrentFile() +{ + //: Menu entry + return Tr::tr("Format &Current File"); +} + +QString BeautifierTool::msgFormatSelectedText() +{ + //: Menu entry + return Tr::tr("Format &Selected Text"); +} + +QString BeautifierTool::msgFormatAtCursor() +{ + //: Menu entry + return Tr::tr("&Format at Cursor"); +} + +QString BeautifierTool::msgFormatLines() +{ + //: Menu entry + return Tr::tr("Format &Line(s)"); +} + +QString BeautifierTool::msgDisableFormattingSelectedText() +{ + //: Menu entry + return Tr::tr("&Disable Formatting for Selected Text"); +} + +QString BeautifierTool::msgCommandPromptDialogTitle(const QString &command) +{ + //: File dialog title for path chooser when choosing binary + return Tr::tr("%1 Command").arg(command); +} + class VersionUpdater { public: @@ -90,7 +136,7 @@ AbstractSettings::AbstractSettings(const QString &name, const QString &ending) command.setSettingsKey("command"); command.setExpectedKind(PathChooser::ExistingCommand); command.setCommandVersionArguments({"--version"}); - command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle("Clang Format")); + command.setPromptDialogTitle(BeautifierTool::msgCommandPromptDialogTitle("Clang Format")); command.setValidatePlaceHolder(true); supportedMimeTypes.setDisplayStyle(StringAspect::LineEditDisplay); @@ -253,22 +299,22 @@ void AbstractSettings::save() const QFileInfo fi(styleFileName(iStyles.key())); if (!(m_styleDir.mkpath(fi.absolutePath()))) { - BeautifierPlugin::showError(Tr::tr("Cannot save styles. %1 does not exist.") - .arg(fi.absolutePath())); + BeautifierTool::showError(Tr::tr("Cannot save styles. %1 does not exist.") + .arg(fi.absolutePath())); continue; } FileSaver saver(FilePath::fromUserInput(fi.absoluteFilePath())); if (saver.hasError()) { - BeautifierPlugin::showError(Tr::tr("Cannot open file \"%1\": %2.") - .arg(saver.filePath().toUserOutput()) - .arg(saver.errorString())); + BeautifierTool::showError(Tr::tr("Cannot open file \"%1\": %2.") + .arg(saver.filePath().toUserOutput()) + .arg(saver.errorString())); } else { saver.write(iStyles.value().toLocal8Bit()); if (!saver.finalize()) { - BeautifierPlugin::showError(Tr::tr("Cannot save file \"%1\": %2.") - .arg(saver.filePath().toUserOutput()) - .arg(saver.errorString())); + BeautifierTool::showError(Tr::tr("Cannot save file \"%1\": %2.") + .arg(saver.filePath().toUserOutput()) + .arg(saver.errorString())); } } ++iStyles; @@ -297,7 +343,7 @@ void AbstractSettings::readDocumentation() { const FilePath filename = documentationFilePath; if (filename.isEmpty()) { - BeautifierPlugin::showError(Tr::tr("No documentation file specified.")); + BeautifierTool::showError(Tr::tr("No documentation file specified.")); return; } @@ -306,8 +352,8 @@ void AbstractSettings::readDocumentation() createDocumentationFile(); if (!file.open(QIODevice::ReadOnly)) { - BeautifierPlugin::showError(Tr::tr("Cannot open documentation file \"%1\".") - .arg(filename.toUserOutput())); + BeautifierTool::showError(Tr::tr("Cannot open documentation file \"%1\".") + .arg(filename.toUserOutput())); return; } @@ -315,8 +361,8 @@ void AbstractSettings::readDocumentation() if (!xml.readNextStartElement()) return; if (xml.name() != QLatin1String(Constants::DOCUMENTATION_XMLROOT)) { - BeautifierPlugin::showError(Tr::tr("The file \"%1\" is not a valid documentation file.") - .arg(filename.toUserOutput())); + BeautifierTool::showError(Tr::tr("The file \"%1\" is not a valid documentation file.") + .arg(filename.toUserOutput())); return; } @@ -346,8 +392,8 @@ void AbstractSettings::readDocumentation() } if (xml.hasError()) { - BeautifierPlugin::showError(Tr::tr("Cannot read documentation file \"%1\": %2.") - .arg(filename.toUserOutput()).arg(xml.errorString())); + BeautifierTool::showError(Tr::tr("Cannot read documentation file \"%1\": %2.") + .arg(filename.toUserOutput()).arg(xml.errorString())); } } diff --git a/src/plugins/beautifier/beautifiertool.h b/src/plugins/beautifier/beautifiertool.h index 392b460dc70..0eb4faf6418 100644 --- a/src/plugins/beautifier/beautifiertool.h +++ b/src/plugins/beautifier/beautifiertool.h @@ -15,7 +15,6 @@ #include <QMap> #include <QObject> #include <QSet> -#include <QString> #include <QStringList> #include <memory> @@ -48,6 +47,15 @@ public: virtual TextEditor::Command command() const = 0; virtual bool isApplicable(const Core::IDocument *document) const = 0; + + static QString msgCannotGetConfigurationFile(const QString &command); + static QString msgFormatCurrentFile(); + static QString msgFormatSelectedText(); + static QString msgFormatAtCursor(); + static QString msgFormatLines(); + static QString msgDisableFormattingSelectedText(); + static QString msgCommandPromptDialogTitle(const QString &command); + static void showError(const QString &error); }; class VersionUpdater; diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index d529ae0eb47..345cf870d50 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -6,7 +6,6 @@ #include "clangformat.h" #include "../beautifierconstants.h" -#include "../beautifierplugin.h" #include "../beautifiertool.h" #include "../beautifiertr.h" #include "../configurationpanel.h" @@ -51,11 +50,11 @@ const char SETTINGS_NAME[] = "clangformat"; class ClangFormatSettings : public AbstractSettings { public: - explicit ClangFormatSettings() + ClangFormatSettings() : AbstractSettings(SETTINGS_NAME, ".clang-format") { command.setDefaultValue("clang-format"); - command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle("Clang Format")); + command.setPromptDialogTitle(BeautifierTool::msgCommandPromptDialogTitle("Clang Format")); command.setLabelText(Tr::tr("Clang Format command:")); usePredefinedStyle.setSettingsKey("usePredefinedStyle"); @@ -333,24 +332,23 @@ ClangFormat::ClangFormat() Core::ActionContainer *menu = Core::ActionManager::createMenu("ClangFormat.Menu"); menu->menu()->setTitle(Tr::tr("&ClangFormat")); - m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this); + m_formatFile = new QAction(msgFormatCurrentFile(), this); Core::Command *cmd = Core::ActionManager::registerAction(m_formatFile, "ClangFormat.FormatFile"); menu->addAction(cmd); connect(m_formatFile, &QAction::triggered, this, &ClangFormat::formatFile); - m_formatLines = new QAction(BeautifierPlugin::msgFormatLines(), this); + m_formatLines = new QAction(msgFormatLines(), this); cmd = Core::ActionManager::registerAction(m_formatLines, "ClangFormat.FormatLines"); menu->addAction(cmd); connect(m_formatLines, &QAction::triggered, this, &ClangFormat::formatLines); - m_formatRange = new QAction(BeautifierPlugin::msgFormatAtCursor(), this); + m_formatRange = new QAction(msgFormatAtCursor(), this); cmd = Core::ActionManager::registerAction(m_formatRange, "ClangFormat.FormatAtCursor"); menu->addAction(cmd); connect(m_formatRange, &QAction::triggered, this, &ClangFormat::formatAtCursor); - m_disableFormattingSelectedText - = new QAction(BeautifierPlugin::msgDisableFormattingSelectedText(), this); + m_disableFormattingSelectedText = new QAction(msgDisableFormattingSelectedText(), this); cmd = Core::ActionManager::registerAction( m_disableFormattingSelectedText, "ClangFormat.DisableFormattingSelectedText"); menu->addAction(cmd); diff --git a/src/plugins/beautifier/uncrustify/uncrustify.cpp b/src/plugins/beautifier/uncrustify/uncrustify.cpp index 43082d82dff..553f3875001 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustify.cpp @@ -6,7 +6,6 @@ #include "uncrustify.h" #include "../beautifierconstants.h" -#include "../beautifierplugin.h" #include "../beautifiertool.h" #include "../beautifiertr.h" #include "../configurationpanel.h" @@ -64,7 +63,7 @@ public: command.setDefaultValue("uncrustify"); command.setLabelText(Tr::tr("Uncrustify command:")); - command.setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle(displayName())); + command.setPromptDialogTitle(BeautifierTool::msgCommandPromptDialogTitle(displayName())); useOtherFiles.setSettingsKey("useOtherFiles"); useOtherFiles.setDefaultValue(true); @@ -250,13 +249,13 @@ Uncrustify::Uncrustify() Core::ActionContainer *menu = Core::ActionManager::createMenu("Uncrustify.Menu"); menu->menu()->setTitle(Tr::tr("&Uncrustify")); - m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this); + m_formatFile = new QAction(msgFormatCurrentFile(), this); Core::Command *cmd = Core::ActionManager::registerAction(m_formatFile, "Uncrustify.FormatFile"); menu->addAction(cmd); connect(m_formatFile, &QAction::triggered, this, &Uncrustify::formatFile); - m_formatRange = new QAction(BeautifierPlugin::msgFormatSelectedText(), this); + m_formatRange = new QAction(msgFormatSelectedText(), this); cmd = Core::ActionManager::registerAction(m_formatRange, "Uncrustify.FormatSelectedText"); menu->addAction(cmd); connect(m_formatRange, &QAction::triggered, this, &Uncrustify::formatSelectedText); @@ -283,7 +282,7 @@ void Uncrustify::formatFile() { const FilePath cfgFileName = configurationFile(); if (cfgFileName.isEmpty()) - BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile(displayName())); + showError(msgCannotGetConfigurationFile(displayName())); else formatCurrentFile(command(cfgFileName)); } @@ -292,7 +291,7 @@ void Uncrustify::formatSelectedText() { const FilePath cfgFileName = configurationFile(); if (cfgFileName.isEmpty()) { - BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile(displayName())); + showError(msgCannotGetConfigurationFile(displayName())); return; } From 0c77d981b16332751fc84aa4989d306fda788a48 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 10 Jul 2023 14:16:50 +0200 Subject: [PATCH 0225/1777] Beautifier: Fix usage of static function Do not use derived method from base class by accident. Change-Id: Ic715d4ce92c50e001b4280234dcd6949862f192b Reviewed-by: hjk <hjk@qt.io> --- src/plugins/beautifier/artisticstyle/artisticstyle.cpp | 8 ++++---- src/plugins/beautifier/uncrustify/uncrustify.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp index 89699253a6a..36d6280ea9c 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp @@ -50,7 +50,7 @@ namespace Beautifier::Internal { // Settings -static QString displayName() { return Tr::tr("Artistic Style"); } +static QString asDisplayName() { return Tr::tr("Artistic Style"); } const char SETTINGS_NAME[] = "artisticstyle"; @@ -63,7 +63,7 @@ public: setVersionRegExp(QRegularExpression("([2-9]{1})\\.([0-9]{1,2})(\\.[1-9]{1})?$")); command.setLabelText(Tr::tr("Artistic Style command:")); command.setDefaultValue("astyle"); - command.setPromptDialogTitle(BeautifierTool::msgCommandPromptDialogTitle(displayName())); + command.setPromptDialogTitle(BeautifierTool::msgCommandPromptDialogTitle(asDisplayName())); useOtherFiles.setSettingsKey("useOtherFiles"); useOtherFiles.setLabelText(Tr::tr("Use file *.astylerc defined in project files")); @@ -238,7 +238,7 @@ public: ArtisticStyleOptionsPage() { setId("ArtisticStyle"); - setDisplayName(displayName()); + setDisplayName(asDisplayName()); setCategory(Constants::OPTION_CATEGORY); setWidgetCreator([] { return new ArtisticStyleOptionsPageWidget; }); } @@ -278,7 +278,7 @@ void ArtisticStyle::formatFile() { const QString cfgFileName = configurationFile(); if (cfgFileName.isEmpty()) - showError(msgCannotGetConfigurationFile(displayName())); + showError(BeautifierTool::msgCannotGetConfigurationFile(asDisplayName())); else formatCurrentFile(command(cfgFileName)); } diff --git a/src/plugins/beautifier/uncrustify/uncrustify.cpp b/src/plugins/beautifier/uncrustify/uncrustify.cpp index 553f3875001..eae39aad591 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustify.cpp @@ -51,7 +51,7 @@ namespace Beautifier::Internal { const char SETTINGS_NAME[] = "uncrustify"; -static QString displayName() { return Tr::tr("Uncrustify"); } +static QString uDisplayName() { return Tr::tr("Uncrustify"); } class UncrustifySettings : public AbstractSettings { @@ -63,7 +63,7 @@ public: command.setDefaultValue("uncrustify"); command.setLabelText(Tr::tr("Uncrustify command:")); - command.setPromptDialogTitle(BeautifierTool::msgCommandPromptDialogTitle(displayName())); + command.setPromptDialogTitle(BeautifierTool::msgCommandPromptDialogTitle(uDisplayName())); useOtherFiles.setSettingsKey("useOtherFiles"); useOtherFiles.setDefaultValue(true); @@ -233,7 +233,7 @@ public: UncrustifyOptionsPage() { setId("Uncrustify"); - setDisplayName(Tr::tr("Uncrustify")); + setDisplayName(uDisplayName()); setCategory(Constants::OPTION_CATEGORY); setWidgetCreator([] { return new UncrustifyOptionsPageWidget; }); } @@ -282,7 +282,7 @@ void Uncrustify::formatFile() { const FilePath cfgFileName = configurationFile(); if (cfgFileName.isEmpty()) - showError(msgCannotGetConfigurationFile(displayName())); + showError(msgCannotGetConfigurationFile(uDisplayName())); else formatCurrentFile(command(cfgFileName)); } @@ -291,7 +291,7 @@ void Uncrustify::formatSelectedText() { const FilePath cfgFileName = configurationFile(); if (cfgFileName.isEmpty()) { - showError(msgCannotGetConfigurationFile(displayName())); + showError(msgCannotGetConfigurationFile(uDisplayName())); return; } From 66018f10f318ba2b453b6b418ea3bbc7e3ed3324 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 10 Jul 2023 14:31:02 +0200 Subject: [PATCH 0226/1777] Terminal: Use one aspect more directly Change-Id: I0767b66b6fa015535876e3ed67495e941631117b Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/terminal/terminalpane.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index 1f6c87abbe2..bc9832f59c7 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -142,7 +142,7 @@ void TerminalPane::openTerminal(const OpenTerminalParameters ¶meters) QFileIconProvider iconProvider; const FilePath command = parametersCopy.shellCommand ? parametersCopy.shellCommand->executable() - : settings().shell.filePath(); + : settings().shell(); icon = iconProvider.icon(command.toFileInfo()); } } From e8617dc0c0e89db024bf5d8773a19fc8ed951f96 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 10 Jul 2023 14:30:17 +0200 Subject: [PATCH 0227/1777] Utils: Move a few FilePath-only functions from String to FilePathAspect Change-Id: I682e158186a1ea7e374c9f0480e292018af07200 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 8 ++++---- src/libs/utils/aspects.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index ab245890e84..58b653cd134 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -854,7 +854,7 @@ FilePath StringAspect::filePath() const return FilePath::fromUserInput(value()); } -PathChooser *StringAspect::pathChooser() const +PathChooser *FilePathAspect::pathChooser() const { return d->m_pathChooserDisplay.data(); } @@ -988,21 +988,21 @@ void StringAspect::setHistoryCompleter(const QString &historyCompleterKey) \sa Utils::PathChooser::setExpectedKind() */ -void StringAspect::setExpectedKind(const PathChooser::Kind expectedKind) +void FilePathAspect::setExpectedKind(const PathChooser::Kind expectedKind) { d->m_expectedKind = expectedKind; if (d->m_pathChooserDisplay) d->m_pathChooserDisplay->setExpectedKind(expectedKind); } -void StringAspect::setEnvironment(const Environment &env) +void FilePathAspect::setEnvironment(const Environment &env) { d->m_environment = env; if (d->m_pathChooserDisplay) d->m_pathChooserDisplay->setEnvironment(env); } -void StringAspect::setBaseFileName(const FilePath &baseFileName) +void FilePathAspect::setBaseFileName(const FilePath &baseFileName) { d->m_baseFileName = baseFileName; if (d->m_pathChooserDisplay) diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index fc3500dd747..468ccd565af 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -465,9 +465,6 @@ public: void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter); void setPlaceHolderText(const QString &placeHolderText); void setHistoryCompleter(const QString &historyCompleterKey); - void setExpectedKind(const PathChooser::Kind expectedKind); - void setEnvironment(const Environment &env); - void setBaseFileName(const FilePath &baseFileName); void setUndoRedoEnabled(bool readOnly); void setAcceptRichText(bool acceptRichText); void setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider); @@ -500,8 +497,6 @@ public: FilePath filePath() const; - PathChooser *pathChooser() const; // Avoid to use. - signals: void checkedChanged(); void validChanged(bool validState); @@ -528,6 +523,11 @@ public: void setAllowPathFromDevice(bool allowPathFromDevice); void setValidatePlaceHolder(bool validatePlaceHolder); void setOpenTerminalHandler(const std::function<void()> &openTerminal); + void setExpectedKind(const PathChooser::Kind expectedKind); + void setEnvironment(const Environment &env); + void setBaseFileName(const FilePath &baseFileName); + + PathChooser *pathChooser() const; // Avoid to use. }; class QTCREATOR_UTILS_EXPORT IntegerAspect : public TypedAspect<qint64> From e85e6c4701bd6b3860f036bc35862ab0b0007d31 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 7 Jul 2023 10:56:23 +0200 Subject: [PATCH 0228/1777] Vcpkg: Use vcpkg logo icon for search vcpkg package dialog Task-number: QTCREATORBUG-29333 Change-Id: I0dca734bdb7a328d97744c21d87de23d273a96b7 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/vcpkg/images/vcpkgicon.png | Bin 0 -> 204 bytes src/plugins/vcpkg/images/vcpkgicon@2x.png | Bin 0 -> 401 bytes src/plugins/vcpkg/vcpkg.qrc | 2 ++ src/plugins/vcpkg/vcpkgmanifesteditor.cpp | 5 ++-- src/tools/icons/qtcreatoricons.svg | 31 ++++++++++++++++++++++ 5 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 src/plugins/vcpkg/images/vcpkgicon.png create mode 100644 src/plugins/vcpkg/images/vcpkgicon@2x.png diff --git a/src/plugins/vcpkg/images/vcpkgicon.png b/src/plugins/vcpkg/images/vcpkgicon.png new file mode 100644 index 0000000000000000000000000000000000000000..28231853671d9ca6cd65699ba7e5df2c432165a7 GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4h9AW2CEqh_A)RqO!jnf43U_c{G*>uVguKo z*r&Q@*WUfct@hzkD<hBBLMD4&g_<^o6$h?tc$~icwt<ns`zEe4x5W+r|Nk%j*)Kld zj#<p&{rlaVD&G~aZ0FGlcqaWzP-Vl#>;G*c9{7AdJGnUj&wqRSqW3Z@tji3H4Q~0^ z7pqiAg&dI2T7Oc1g@akk`+r=|zR2h9y0fV+`~RbFGDZvx`PcWdycg#306Ejs)z4*} HQ$iB}9<5Uz literal 0 HcmV?d00001 diff --git a/src/plugins/vcpkg/images/vcpkgicon@2x.png b/src/plugins/vcpkg/images/vcpkgicon@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..df97ed38b4982d990ef481876df5031ca259b3da GIT binary patch literal 401 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4h9AWhA=@@4F(3r2u~Ns5R22vKl~XCE`%Ta z-YdE6(VZr?mAn5X27g!@IE9gIjeMfkjpYX#Sf=b>pdE4IR0Gqq#hN!x^=O^H(6;Kq zQifSJhton>GkGrY-u`yhU!?Km>Ax<4AKGkxzW$%D|Nrm*&3C&6RnBi>zA7%f`Cq)o zm#?)<N%8A9hJ3XC_WyVz?|DJ4S#|Hees9%kXh@gbw{PM12V8b{_?S-p{@ZZ+|0$MF zwYMK|{d>~<qm_f%tm((T*AKX^HT{eh;5s11_3wb_mc}2E`vo^XV}HVa|1U#$fw_pr zf1$(!$_r`^{EL_EXsFuw@WT23?R%!`X02=9(O+BJt^dz^ev8!I*#|Eke6jQG`TzCn z_y7Mdbo?Ki>p_0W2!n2wbGP?y4V$FMYigV0)US6id<9q3g(ry@8N&_4L+9mkR!#c7 zs6}Ue35W4TyG?E0-P>!9PJ8qJt*5!r!--qY-20XMV3S-J0|Ud$5C8U@ifaUgwWq6} J%Q~loCIGGD!yW(t literal 0 HcmV?d00001 diff --git a/src/plugins/vcpkg/vcpkg.qrc b/src/plugins/vcpkg/vcpkg.qrc index af1c2d1f8c6..ed7019bdc84 100644 --- a/src/plugins/vcpkg/vcpkg.qrc +++ b/src/plugins/vcpkg/vcpkg.qrc @@ -4,5 +4,7 @@ <file>wizards/manifest/wizard.json</file> <file>images/cmakeicon.png</file> <file>images/cmakeicon@2x.png</file> + <file>images/vcpkgicon.png</file> + <file>images/vcpkgicon@2x.png</file> </qresource> </RCC> diff --git a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp index 917ef780923..6b5364463d1 100644 --- a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp +++ b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp @@ -92,8 +92,9 @@ class VcpkgManifestEditorWidget : public TextEditor::TextEditorWidget public: VcpkgManifestEditorWidget() { - m_searchPkgAction = toolBar()->addAction(Utils::Icons::ZOOM_TOOLBAR.icon(), - Tr::tr("Add vcpkg package...")); + const QIcon vcpkgIcon = Utils::Icon({{":/vcpkg/images/vcpkgicon.png", + Utils::Theme::IconsBaseColor}}).icon(); + m_searchPkgAction = toolBar()->addAction(vcpkgIcon, Tr::tr("Add vcpkg package...")); connect(m_searchPkgAction, &QAction::triggered, this, [this] { const Search::VcpkgManifest package = Search::showVcpkgPackageSearchDialog(); if (!package.name.isEmpty()) diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg index a87a018dcd5..17583cb29a2 100644 --- a/src/tools/icons/qtcreatoricons.svg +++ b/src/tools/icons/qtcreatoricons.svg @@ -3664,6 +3664,37 @@ style="display:inline" transform="matrix(0.89482687,0,0,0.89482687,164.39232,51.559627)" /> </g> + <g + id="src/plugins/vcpkg/images/vcpkgicon"> + <use + style="display:inline" + transform="translate(2016,132)" + height="100%" + width="100%" + id="use1952-7-6-1" + xlink:href="#backgroundRect" + y="0" + x="0" /> + <g + id="g6088"> + <path + style="fill:#4d4d4d" + d="m 2003.1348,577.71875 c 1.2848,0.24885 2.6819,-1.48291 2.4355,-3.76367 -0.7916,-0.0764 -1.3258,0.0765 -1.7637,0.36133 -0.6852,0.44589 -1.1449,1.30413 -1.7226,2.23047 0.1588,0.64898 0.5375,1.07247 1.0508,1.17187 z" + id="path2102" + sodipodi:nodetypes="scscs" /> + <path + style="fill:#000000" + d="m 2006.0376,573.24147 c 1.8615,0.51984 1.6429,0.7072 2.8995,1.08292 1.2566,0.37573 2.3556,-0.12796 2.7719,-1.74627 0.3958,-1.53873 -1.3327,-2.57841 -3.4317,-2.56695 -2.0989,0.0114 -4.5685,1.07289 -5.6543,3.36578 -0.3182,0.67202 -0.5017,1.29842 -0.5781,1.85743 0.9246,-1.47431 2.1312,-2.51275 3.9927,-1.99291 z" + id="path5378" + sodipodi:nodetypes="zzssscz" /> + </g> + <use + x="0" + y="0" + xlink:href="#g6088" + id="use6090" + transform="rotate(180,2008,576)" /> + </g> </g> <g inkscape:groupmode="layer" From d9680baf2ab7f90db27c0aec7399da654e22e3e2 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 7 Jul 2023 18:44:00 +0200 Subject: [PATCH 0229/1777] Vcpkg: Implement adding of dependencies to vcpkg.json Instead of just inserting the package name at the cursor position, Qt Creator now attempts to append the package name in the dependencies array. With auto tests. The "interesting" effect of this is that the order of values inside a Json object may change. Qt seems to enforce an alphabetical order on the key names. Also the indentation becomes 4 after the modification. Task-number: QTCREATORBUG-29333 Change-Id: I803ca6a19ee32aeba95640726ac8d8e477750bc0 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/vcpkg/vcpkg_test.cpp | 64 +++++++++++++++++++++++ src/plugins/vcpkg/vcpkg_test.h | 2 + src/plugins/vcpkg/vcpkgmanifesteditor.cpp | 20 ++++++- src/plugins/vcpkg/vcpkgmanifesteditor.h | 2 + 4 files changed, 86 insertions(+), 2 deletions(-) diff --git a/src/plugins/vcpkg/vcpkg_test.cpp b/src/plugins/vcpkg/vcpkg_test.cpp index c48e6ec3881..71e3d50a848 100644 --- a/src/plugins/vcpkg/vcpkg_test.cpp +++ b/src/plugins/vcpkg/vcpkg_test.cpp @@ -3,6 +3,7 @@ #include "vcpkg_test.h" +#include "vcpkgmanifesteditor.h" #include "vcpkgsearch.h" #include <QTest> @@ -114,4 +115,67 @@ void VcpkgSearchTest::testVcpkgJsonParser() QCOMPARE(ok, success); } +void VcpkgSearchTest::testAddDependency_data() +{ + QTest::addColumn<QString>("originalVcpkgManifestJsonData"); + QTest::addColumn<QString>("addedPackage"); + QTest::addColumn<QString>("modifiedVcpkgManifestJsonData"); + + QTest::newRow("Existing dependencies") + << +R"({ + "name": "foo", + "dependencies": [ + "fmt", + { + "name": "vcpkg-cmake", + "host": true + } + ] +} +)" + << "7zip" + << +R"({ + "dependencies": [ + "fmt", + { + "host": true, + "name": "vcpkg-cmake" + }, + "7zip" + ], + "name": "foo" +} +)"; + + QTest::newRow("Without dependencies") + << +R"({ + "name": "foo" +} +)" + << "7zip" + << +R"({ + "dependencies": [ + "7zip" + ], + "name": "foo" +} +)"; +} + +void VcpkgSearchTest::testAddDependency() +{ + QFETCH(QString, originalVcpkgManifestJsonData); + QFETCH(QString, addedPackage); + QFETCH(QString, modifiedVcpkgManifestJsonData); + + const QByteArray result = addDependencyToManifest(originalVcpkgManifestJsonData.toUtf8(), + addedPackage); + + QCOMPARE(QString::fromUtf8(result), modifiedVcpkgManifestJsonData); +} + } // namespace Vcpkg::Internal diff --git a/src/plugins/vcpkg/vcpkg_test.h b/src/plugins/vcpkg/vcpkg_test.h index 8175e28d594..2bc386e7aa1 100644 --- a/src/plugins/vcpkg/vcpkg_test.h +++ b/src/plugins/vcpkg/vcpkg_test.h @@ -19,6 +19,8 @@ public: private slots: void testVcpkgJsonParser_data(); void testVcpkgJsonParser(); + void testAddDependency_data(); + void testAddDependency(); }; } // namespace Vcpkg::Internal diff --git a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp index 6b5364463d1..0335f39af71 100644 --- a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp +++ b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp @@ -20,6 +20,9 @@ #include <texteditor/texteditorsettings.h> #include <QDialogButtonBox> +#include <QJsonArray> +#include <QJsonDocument> +#include <QJsonObject> #include <QPlainTextEdit> #include <QToolBar> @@ -97,8 +100,11 @@ public: m_searchPkgAction = toolBar()->addAction(vcpkgIcon, Tr::tr("Add vcpkg package...")); connect(m_searchPkgAction, &QAction::triggered, this, [this] { const Search::VcpkgManifest package = Search::showVcpkgPackageSearchDialog(); - if (!package.name.isEmpty()) - textCursor().insertText(package.name); + if (!package.name.isEmpty()) { + const QByteArray modifiedDocument = + addDependencyToManifest(textDocument()->contents(), package.name); + textDocument()->setContents(modifiedDocument); + } }); const QIcon cmakeIcon = Utils::Icon({{":/vcpkg/images/cmakeicon.png", @@ -153,4 +159,14 @@ VcpkgManifestEditorFactory::VcpkgManifestEditorFactory() setUseGenericHighlighter(true); } +QByteArray addDependencyToManifest(const QByteArray &manifest, const QString &package) +{ + constexpr char dependenciesKey[] = "dependencies"; + QJsonObject jsonObject = QJsonDocument::fromJson(manifest).object(); + QJsonArray dependencies = jsonObject.value(dependenciesKey).toArray(); + dependencies.append(package); + jsonObject.insert(dependenciesKey, dependencies); + return QJsonDocument(jsonObject).toJson(); +} + } // namespace Vcpkg::Internal diff --git a/src/plugins/vcpkg/vcpkgmanifesteditor.h b/src/plugins/vcpkg/vcpkgmanifesteditor.h index c7762d69df9..3d88ba79655 100644 --- a/src/plugins/vcpkg/vcpkgmanifesteditor.h +++ b/src/plugins/vcpkg/vcpkgmanifesteditor.h @@ -13,4 +13,6 @@ public: VcpkgManifestEditorFactory(); }; +QByteArray addDependencyToManifest(const QByteArray &manifest, const QString &package); + } // namespace Vcpkg::Internal From 6ad4761604ed05acb04e8fbd9a90503876bf9699 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 7 Jul 2023 15:07:03 +0200 Subject: [PATCH 0230/1777] Vcpkg: Prevent user from re-inserting a preexisting dependency If the selected package already exists as dependency in the project, the dialog shows an info label and prevents re-adding of the package bz disabling the OK button. Task-number: QTCREATORBUG-29333 Change-Id: Icd368bb2b0bde72ebe5efaea6a81e3cf96830ce3 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/vcpkg/vcpkgmanifesteditor.cpp | 13 +++++--- src/plugins/vcpkg/vcpkgsearch.cpp | 40 ++++++++++++++++++----- src/plugins/vcpkg/vcpkgsearch.h | 3 +- 3 files changed, 42 insertions(+), 14 deletions(-) diff --git a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp index 0335f39af71..e2d3ab66554 100644 --- a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp +++ b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp @@ -99,7 +99,8 @@ public: Utils::Theme::IconsBaseColor}}).icon(); m_searchPkgAction = toolBar()->addAction(vcpkgIcon, Tr::tr("Add vcpkg package...")); connect(m_searchPkgAction, &QAction::triggered, this, [this] { - const Search::VcpkgManifest package = Search::showVcpkgPackageSearchDialog(); + const Search::VcpkgManifest package = + Search::showVcpkgPackageSearchDialog(documentToManifest()); if (!package.name.isEmpty()) { const QByteArray modifiedDocument = addDependencyToManifest(textDocument()->contents(), package.name); @@ -111,10 +112,7 @@ public: Utils::Theme::IconsBaseColor}}).icon(); m_cmakeCodeAction = toolBar()->addAction(cmakeIcon, Tr::tr("CMake code...")); connect(m_cmakeCodeAction, &QAction::triggered, this, [this] { - bool ok = false; - const Search::VcpkgManifest manifest = - Search::parseVcpkgManifest(textDocument()->contents(), &ok); - CMakeCodeDialog dlg(manifest.dependencies); + CMakeCodeDialog dlg(documentToManifest().dependencies); dlg.exec(); }); @@ -138,6 +136,11 @@ public: } private: + Search::VcpkgManifest documentToManifest() const + { + return Search::parseVcpkgManifest(textDocument()->contents()); + } + QAction *m_searchPkgAction; QAction *m_cmakeCodeAction; }; diff --git a/src/plugins/vcpkg/vcpkgsearch.cpp b/src/plugins/vcpkg/vcpkgsearch.cpp index 175e889a888..ddf42bd8a61 100644 --- a/src/plugins/vcpkg/vcpkgsearch.cpp +++ b/src/plugins/vcpkg/vcpkgsearch.cpp @@ -10,6 +10,7 @@ #include <utils/algorithm.h> #include <utils/fancylineedit.h> #include <utils/fileutils.h> +#include <utils/infolabel.h> #include <utils/itemviews.h> #include <utils/layoutbuilder.h> @@ -28,17 +29,20 @@ namespace Vcpkg::Internal::Search { class VcpkgPackageSearchDialog : public QDialog { public: - explicit VcpkgPackageSearchDialog(QWidget *parent); + explicit VcpkgPackageSearchDialog(const VcpkgManifest &preexistingPackages, QWidget *parent); VcpkgManifest selectedPackage() const; private: void listPackages(const QString &filter); void showPackageDetails(const QString &packageName); + void updateStatus(); VcpkgManifests m_allPackages; VcpkgManifest m_selectedPackage; + const VcpkgManifest m_projectManifest; + FancyLineEdit *m_packagesFilter; ListWidget *m_packagesList; QLineEdit *m_vcpkgName; @@ -46,11 +50,14 @@ private: QLabel *m_vcpkgLicense; QTextBrowser *m_vcpkgDescription; QLabel *m_vcpkgHomepage; + InfoLabel *m_infoLabel; QDialogButtonBox *m_buttonBox; }; -VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(QWidget *parent) +VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(const VcpkgManifest &preexistingPackages, + QWidget *parent) : QDialog(parent) + , m_projectManifest(preexistingPackages) { resize(920, 400); setWindowTitle(Tr::tr("Add vcpkg package")); @@ -75,7 +82,11 @@ VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(QWidget *parent) m_vcpkgHomepage->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred); m_vcpkgHomepage->setTextInteractionFlags(Qt::TextBrowserInteraction); - m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Close); + m_infoLabel = new InfoLabel(Tr::tr("This package is already a project dependency."), + InfoLabel::Information); + m_infoLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); + + m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); using namespace Layouting; Column { @@ -96,12 +107,13 @@ VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(QWidget *parent) }, } }, - m_buttonBox, + Row { m_infoLabel, m_buttonBox }, }.attachTo(this); m_allPackages = vcpkgManifests(settings().vcpkgRoot()); listPackages({}); + updateStatus(); connect(m_packagesFilter, &FancyLineEdit::filterChanged, this, &VcpkgPackageSearchDialog::listPackages); @@ -151,7 +163,16 @@ void VcpkgPackageSearchDialog::showPackageDetails(const QString &packageName) .arg(manifest.homepage.toDisplayString())); m_selectedPackage = manifest; - m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!manifest.name.isEmpty()); + updateStatus(); +} + +void VcpkgPackageSearchDialog::updateStatus() +{ + const QString package = selectedPackage().name; + const bool isProjectDependency = m_projectManifest.dependencies.contains(package); + m_infoLabel->setVisible(isProjectDependency); + m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!(package.isEmpty() + || isProjectDependency)); } VcpkgManifest parseVcpkgManifest(const QByteArray &vcpkgManifestJsonData, bool *ok) @@ -219,10 +240,13 @@ VcpkgManifests vcpkgManifests(const FilePath &vcpkgRoot) return result; } -VcpkgManifest showVcpkgPackageSearchDialog(QWidget *parent) +VcpkgManifest showVcpkgPackageSearchDialog(const VcpkgManifest &projectManifest, QWidget *parent) { - VcpkgPackageSearchDialog dlg(parent ? parent : Core::ICore::dialogParent()); - return (dlg.exec() == QDialog::Accepted) ? dlg.selectedPackage() : VcpkgManifest(); + QWidget *dlgParent = parent ? parent : Core::ICore::dialogParent(); + VcpkgPackageSearchDialog dlg(projectManifest, dlgParent); + const VcpkgManifest result = (dlg.exec() == QDialog::Accepted) ? dlg.selectedPackage() + : VcpkgManifest(); + return result; } } // namespace Vcpkg::Internal::Search diff --git a/src/plugins/vcpkg/vcpkgsearch.h b/src/plugins/vcpkg/vcpkgsearch.h index 2f9242257e6..912dff00b6a 100644 --- a/src/plugins/vcpkg/vcpkgsearch.h +++ b/src/plugins/vcpkg/vcpkgsearch.h @@ -25,6 +25,7 @@ using VcpkgManifests = QList<VcpkgManifest>; VcpkgManifest parseVcpkgManifest(const QByteArray &vcpkgManifestJsonData, bool *ok = nullptr); VcpkgManifests vcpkgManifests(const Utils::FilePath &vcpkgRoot); -VcpkgManifest showVcpkgPackageSearchDialog(QWidget *parent = nullptr); +VcpkgManifest showVcpkgPackageSearchDialog(const VcpkgManifest &projectManifest, + QWidget *parent = nullptr); } // namespace Vcpkg::Internal::Search From 9e84b09e991b30d6515eea40b60110a2b80f0a1c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 10 Jul 2023 13:14:07 +0200 Subject: [PATCH 0231/1777] Valgrind: Some more direct FilePath use Change-Id: I99db6996482cd5a14dcc4d68c55b22c64feef9fa Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/valgrind/callgrindtool.cpp | 10 +++++----- src/plugins/valgrind/valgrindengine.cpp | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index d2dfc469e03..691d5051e58 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -361,7 +361,7 @@ CallgrindToolPrivate::CallgrindToolPrivate() action->setIcon(kCachegrindIcon.icon()); action->setToolTip(Tr::tr("Open results in KCachegrind.")); connect(action, &QAction::triggered, this, [this, settings] { - Process::startDetached({FilePath::fromString(settings->kcachegrindExecutable.value()), { m_lastFileName }}); + Process::startDetached({settings->kcachegrindExecutable(), { m_lastFileName }}); }); // dump action @@ -908,10 +908,10 @@ void CallgrindToolPrivate::takeParserData(ParseData *data) doClear(true); setParseData(data); - const QString kcachegrindExecutable = - ValgrindGlobalSettings::instance()->kcachegrindExecutable.value(); - const bool kcachegrindExists = !Utils::Environment::systemEnvironment().searchInPath( - kcachegrindExecutable).isEmpty(); + const FilePath kcachegrindExecutable = + ValgrindGlobalSettings::instance()->kcachegrindExecutable(); + const FilePath found = kcachegrindExecutable.searchInPath(); + const bool kcachegrindExists = found.isExecutableFile(); m_startKCachegrind->setEnabled(kcachegrindExists && !m_lastFileName.isEmpty()); createTextMarks(); } diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index 61ef89c3041..ee1484108c8 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -144,11 +144,13 @@ void ValgrindToolRunner::runnerFinished() void ValgrindToolRunner::receiveProcessError(const QString &message, QProcess::ProcessError error) { if (error == QProcess::FailedToStart) { - const QString valgrind = m_settings.valgrindExecutable.value(); - if (!valgrind.isEmpty()) - appendMessage(Tr::tr("Error: \"%1\" could not be started: %2").arg(valgrind, message), ErrorMessageFormat); - else + const FilePath valgrind = m_settings.valgrindExecutable(); + if (!valgrind.isEmpty()) { + appendMessage(Tr::tr("Error: \"%1\" could not be started: %2") + .arg(valgrind.toUserOutput(), message), ErrorMessageFormat); + } else { appendMessage(Tr::tr("Error: no Valgrind executable set."), ErrorMessageFormat); + } } else if (m_isStopping && error == QProcess::Crashed) { // process gets killed on stop appendMessage(Tr::tr("Process terminated."), ErrorMessageFormat); } else { From 27d783fd1e361f64ad36fe533812301130685a45 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 10 Jul 2023 09:28:29 +0200 Subject: [PATCH 0232/1777] Nim: Use aspects more directly in NimRunConfiguration Change-Id: I4120f86d36ece183c95325ccea33cb66778753db Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../nim/project/nimrunconfiguration.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/plugins/nim/project/nimrunconfiguration.cpp b/src/plugins/nim/project/nimrunconfiguration.cpp index fa60694be24..30ed5d64d3b 100644 --- a/src/plugins/nim/project/nimrunconfiguration.cpp +++ b/src/plugins/nim/project/nimrunconfiguration.cpp @@ -26,19 +26,13 @@ public: NimRunConfiguration(Target *target, Utils::Id id) : RunConfiguration(target, id) { - auto envAspect = addAspect<EnvironmentAspect>(); - envAspect->setSupportForBuildEnvironment(target); + environment.setSupportForBuildEnvironment(target); - auto exeAspect = addAspect<ExecutableAspect>(); - exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); + executable.setDeviceSelector(target, ExecutableAspect::RunDevice); - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); + arguments.setMacroExpander(macroExpander()); - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); - - addAspect<TerminalAspect>(); + workingDir.setMacroExpander(macroExpander()); setDisplayName(Tr::tr("Current Build Target")); setDefaultDisplayName(Tr::tr("Current Build Target")); @@ -47,15 +41,21 @@ public: auto buildConfiguration = qobject_cast<NimBuildConfiguration *>(target->activeBuildConfiguration()); QTC_ASSERT(buildConfiguration, return); const QFileInfo outFileInfo = buildConfiguration->outFilePath().toFileInfo(); - aspect<ExecutableAspect>()->setExecutable(FilePath::fromString(outFileInfo.absoluteFilePath())); + executable.setExecutable(FilePath::fromString(outFileInfo.absoluteFilePath())); const QString workingDirectory = outFileInfo.absoluteDir().absolutePath(); - aspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(FilePath::fromString(workingDirectory)); + workingDir.setDefaultWorkingDirectory(FilePath::fromString(workingDirectory)); }); // Connect target signals connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); update(); } + + EnvironmentAspect environment{this}; + ExecutableAspect executable{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; + TerminalAspect terminal{this}; }; // NimRunConfigurationFactory From f1a6135c1e465adba616e33d5827a8ee94f54310 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 10 Jul 2023 13:05:36 +0200 Subject: [PATCH 0233/1777] Conan: More direct aspect use in ConanInstallStep Also fix use of a the potentially remote conanfile by using only the .path() when passing to the (remote) install step. Change-Id: If588dc8e2777a9c6515845886d9f3a9ab881c97f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/conan/conaninstallstep.cpp | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/plugins/conan/conaninstallstep.cpp b/src/plugins/conan/conaninstallstep.cpp index 7d03398205d..839261304d0 100644 --- a/src/plugins/conan/conaninstallstep.cpp +++ b/src/plugins/conan/conaninstallstep.cpp @@ -62,6 +62,10 @@ public: private: bool init() final; void setupOutputFormatter(OutputFormatter *formatter) final; + + FilePathAspect conanFile{this}; + StringAspect additionalArguments{this}; + BoolAspect buildMissing{this}; }; ConanInstallStep::ConanInstallStep(BuildStepList *bsl, Id id) @@ -70,36 +74,32 @@ ConanInstallStep::ConanInstallStep(BuildStepList *bsl, Id id) setUseEnglishOutput(); setDisplayName(Tr::tr("Conan install")); - auto conanFile = addAspect<FilePathAspect>(); - conanFile->setSettingsKey("ConanPackageManager.InstallStep.ConanFile"); - conanFile->setValue(conanFilePath(project(), - project()->projectDirectory() / "conanfile.txt")); - conanFile->setLabelText(Tr::tr("Conan file:")); - conanFile->setToolTip(Tr::tr("Enter location of conanfile.txt or conanfile.py.")); - conanFile->setExpectedKind(PathChooser::File); + conanFile.setSettingsKey("ConanPackageManager.InstallStep.ConanFile"); + conanFile.setValue(conanFilePath(project(), project()->projectDirectory() / "conanfile.txt")); + conanFile.setLabelText(Tr::tr("Conan file:")); + conanFile.setToolTip(Tr::tr("Enter location of conanfile.txt or conanfile.py.")); + conanFile.setExpectedKind(PathChooser::File); - auto additionalArguments = addAspect<StringAspect>(); - additionalArguments->setSettingsKey("ConanPackageManager.InstallStep.AdditionalArguments"); - additionalArguments->setLabelText(Tr::tr("Additional arguments:")); - additionalArguments->setDisplayStyle(StringAspect::LineEditDisplay); + additionalArguments.setSettingsKey("ConanPackageManager.InstallStep.AdditionalArguments"); + additionalArguments.setLabelText(Tr::tr("Additional arguments:")); + additionalArguments.setDisplayStyle(StringAspect::LineEditDisplay); - auto buildMissing = addAspect<BoolAspect>(); - buildMissing->setSettingsKey("ConanPackageManager.InstallStep.BuildMissing"); - buildMissing->setLabel("Build missing:", BoolAspect::LabelPlacement::InExtraLabel); - buildMissing->setDefaultValue(true); - buildMissing->setValue(true); + buildMissing.setSettingsKey("ConanPackageManager.InstallStep.BuildMissing"); + buildMissing.setLabel("Build missing:", BoolAspect::LabelPlacement::InExtraLabel); + buildMissing.setDefaultValue(true); + buildMissing.setValue(true); - setCommandLineProvider([=] { + setCommandLineProvider([this] { BuildConfiguration::BuildType bt = buildConfiguration()->buildType(); const QString buildType = bt == BuildConfiguration::Release ? QString("Release") : QString("Debug"); CommandLine cmd(settings().conanFilePath()); cmd.addArgs({"install", "-s", "build_type=" + buildType}); - if (buildMissing->value()) + if (buildMissing()) cmd.addArg("--build=missing"); - cmd.addArg(conanFile->value()); - cmd.addArgs(additionalArguments->value(), CommandLine::Raw); + cmd.addArg(conanFile().path()); + cmd.addArgs(additionalArguments(), CommandLine::Raw); return cmd; }); From a8a68b024a120802345f154a340a64ac3abd59eb Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 17:33:56 +0200 Subject: [PATCH 0234/1777] ProjectExplorer: Use less indirection for BuildConfiguration aspects Change-Id: I6c219bc35edccd723f39e71d52b246060c1c424e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../cmakebuildconfiguration.h | 2 +- src/plugins/projectexplorer/buildaspects.cpp | 5 +- src/plugins/projectexplorer/buildaspects.h | 3 +- .../projectexplorer/buildconfiguration.cpp | 50 +++++++++---------- 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index cd019042d45..cee3ae64baa 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -79,7 +79,7 @@ public: void setInitialCMakeArguments(const QStringList &args); void setCMakeBuildType(const QString &cmakeBuildType, bool quiet = false); - ProjectExplorer::BuildDirectoryAspect buildDir{this}; + ProjectExplorer::BuildDirectoryAspect buildDir{this, this}; Internal::InitialCMakeArgumentsAspect initialCMakeArguments{this}; Utils::StringAspect additionalCMakeOptions{this}; Utils::FilePathAspect sourceDirectory{this}; diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index 2ffcbc7ac8a..3577aa9ec04 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -36,8 +36,9 @@ public: QPointer<InfoLabel> problemLabel; }; -BuildDirectoryAspect::BuildDirectoryAspect(const BuildConfiguration *bc) - : d(new Private(bc->target())) +BuildDirectoryAspect::BuildDirectoryAspect(AspectContainer *container, const BuildConfiguration *bc) + : FilePathAspect(container), + d(new Private(bc->target())) { setSettingsKey("ProjectExplorer.BuildConfiguration.BuildDirectory"); setLabelText(Tr::tr("Build directory:")); diff --git a/src/plugins/projectexplorer/buildaspects.h b/src/plugins/projectexplorer/buildaspects.h index bcc8987cd0c..10043b4ec62 100644 --- a/src/plugins/projectexplorer/buildaspects.h +++ b/src/plugins/projectexplorer/buildaspects.h @@ -14,8 +14,9 @@ class BuildConfiguration; class PROJECTEXPLORER_EXPORT BuildDirectoryAspect : public Utils::FilePathAspect { Q_OBJECT + public: - explicit BuildDirectoryAspect(const BuildConfiguration *bc); + explicit BuildDirectoryAspect(Utils::AspectContainer *container, const BuildConfiguration *bc); ~BuildDirectoryAspect() override; void allowInSourceBuilds(const Utils::FilePath &sourceDir); diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 18a22a421af..e05f863ea18 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -128,15 +128,17 @@ class BuildConfigurationPrivate public: BuildConfigurationPrivate(BuildConfiguration *bc) : m_buildSteps(bc, Constants::BUILDSTEPS_BUILD), - m_cleanSteps(bc, Constants::BUILDSTEPS_CLEAN) + m_cleanSteps(bc, Constants::BUILDSTEPS_CLEAN), + m_buildDirectoryAspect(bc, bc), + m_tooltipAspect(bc) {} bool m_clearSystemEnvironment = false; EnvironmentItems m_userEnvironmentChanges; BuildStepList m_buildSteps; BuildStepList m_cleanSteps; - BuildDirectoryAspect *m_buildDirectoryAspect = nullptr; - StringAspect *m_tooltipAspect = nullptr; + BuildDirectoryAspect m_buildDirectoryAspect; + StringAspect m_tooltipAspect; FilePath m_lastEmittedBuildDirectory; mutable Environment m_cachedEnvironment; QString m_configWidgetDisplayName; @@ -190,24 +192,22 @@ BuildConfiguration::BuildConfiguration(Target *target, Utils::Id id) connect(ProjectTree::instance(), &ProjectTree::currentProjectChanged, this, &BuildConfiguration::updateCacheAndEmitEnvironmentChanged); - d->m_buildDirectoryAspect = addAspect<BuildDirectoryAspect>(this); - d->m_buildDirectoryAspect->setBaseFileName(target->project()->projectDirectory()); - d->m_buildDirectoryAspect->setEnvironment(environment()); - d->m_buildDirectoryAspect->setMacroExpanderProvider([this] { return macroExpander(); }); - connect(d->m_buildDirectoryAspect, &StringAspect::changed, + d->m_buildDirectoryAspect.setBaseFileName(target->project()->projectDirectory()); + d->m_buildDirectoryAspect.setEnvironment(environment()); + d->m_buildDirectoryAspect.setMacroExpanderProvider([this] { return macroExpander(); }); + connect(&d->m_buildDirectoryAspect, &StringAspect::changed, this, &BuildConfiguration::emitBuildDirectoryChanged); connect(this, &BuildConfiguration::environmentChanged, this, [this] { - d->m_buildDirectoryAspect->setEnvironment(environment()); + d->m_buildDirectoryAspect.setEnvironment(environment()); emit this->target()->buildEnvironmentChanged(this); }); - d->m_tooltipAspect = addAspect<StringAspect>(); - d->m_tooltipAspect->setLabelText(Tr::tr("Tooltip in target selector:")); - d->m_tooltipAspect->setToolTip(Tr::tr("Appears as a tooltip when hovering the build configuration")); - d->m_tooltipAspect->setDisplayStyle(StringAspect::LineEditDisplay); - d->m_tooltipAspect->setSettingsKey("ProjectExplorer.BuildConfiguration.Tooltip"); - connect(d->m_tooltipAspect, &StringAspect::changed, this, [this] { - setToolTip(d->m_tooltipAspect->value()); + d->m_tooltipAspect.setLabelText(Tr::tr("Tooltip in target selector:")); + d->m_tooltipAspect.setToolTip(Tr::tr("Appears as a tooltip when hovering the build configuration")); + d->m_tooltipAspect.setDisplayStyle(StringAspect::LineEditDisplay); + d->m_tooltipAspect.setSettingsKey("ProjectExplorer.BuildConfiguration.Tooltip"); + connect(&d->m_tooltipAspect, &StringAspect::changed, this, [this] { + setToolTip(d->m_tooltipAspect()); }); connect(target, &Target::parsingStarted, this, &BuildConfiguration::enabledChanged); @@ -228,7 +228,7 @@ BuildConfiguration::~BuildConfiguration() FilePath BuildConfiguration::buildDirectory() const { FilePath path = FilePath::fromUserInput( - environment().expandVariables(d->m_buildDirectoryAspect->value().trimmed())); + environment().expandVariables(d->m_buildDirectoryAspect.value().trimmed())); // FIXME: If the macro expander is expected to be able to do some // structual changes, the fromUserInput() above might already have // mis-parsed. Should this here be encapsulated in the FilePathAspect? @@ -242,17 +242,17 @@ FilePath BuildConfiguration::buildDirectory() const FilePath BuildConfiguration::rawBuildDirectory() const { - return d->m_buildDirectoryAspect->filePath(); + return d->m_buildDirectoryAspect(); } void BuildConfiguration::setBuildDirectory(const FilePath &dir) { - if (dir == d->m_buildDirectoryAspect->filePath()) + if (dir == d->m_buildDirectoryAspect()) return; - d->m_buildDirectoryAspect->setValue(dir); + d->m_buildDirectoryAspect.setValue(dir); const FilePath fixedDir = BuildDirectoryAspect::fixupDir(buildDirectory()); if (!fixedDir.isEmpty()) - d->m_buildDirectoryAspect->setValue(fixedDir); + d->m_buildDirectoryAspect.setValue(fixedDir); emitBuildDirectoryChanged(); } @@ -425,7 +425,7 @@ bool BuildConfiguration::fromMap(const QVariantMap &map) d->m_customParsers = transform(map.value(CUSTOM_PARSERS_KEY).toList(), &Utils::Id::fromSetting); const bool res = ProjectConfiguration::fromMap(map); - setToolTip(d->m_tooltipAspect->value()); + setToolTip(d->m_tooltipAspect()); return res; } @@ -449,7 +449,7 @@ void BuildConfiguration::emitBuildDirectoryChanged() ProjectExplorer::BuildDirectoryAspect *BuildConfiguration::buildDirectoryAspect() const { - return d->m_buildDirectoryAspect; + return &d->m_buildDirectoryAspect; } void BuildConfiguration::setConfigWidgetDisplayName(const QString &display) @@ -459,7 +459,7 @@ void BuildConfiguration::setConfigWidgetDisplayName(const QString &display) void BuildConfiguration::setBuildDirectoryHistoryCompleter(const QString &history) { - d->m_buildDirectoryAspect->setHistoryCompleter(history); + d->m_buildDirectoryAspect.setHistoryCompleter(history); } void BuildConfiguration::setConfigWidgetHasFrame(bool configWidgetHasFrame) @@ -469,7 +469,7 @@ void BuildConfiguration::setConfigWidgetHasFrame(bool configWidgetHasFrame) void BuildConfiguration::setBuildDirectorySettingsKey(const QString &key) { - d->m_buildDirectoryAspect->setSettingsKey(key); + d->m_buildDirectoryAspect.setSettingsKey(key); } Environment BuildConfiguration::baseEnvironment() const From ebda2068dde79e424d3a84573b71b9b4e4336d57 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 10 Jul 2023 18:10:57 +0200 Subject: [PATCH 0235/1777] Revert "Utils: Move a few FilePath-only functions from String to FilePathAspect" This reverts commit e8617dc0c0e89db024bf5d8773a19fc8ed951f96. Downstream AppManager still uses a combined String/FilePath aspect version. Change-Id: I9de08785120622d76daaa7c4be20fb5abb933095 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 8 ++++---- src/libs/utils/aspects.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 58b653cd134..ab245890e84 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -854,7 +854,7 @@ FilePath StringAspect::filePath() const return FilePath::fromUserInput(value()); } -PathChooser *FilePathAspect::pathChooser() const +PathChooser *StringAspect::pathChooser() const { return d->m_pathChooserDisplay.data(); } @@ -988,21 +988,21 @@ void StringAspect::setHistoryCompleter(const QString &historyCompleterKey) \sa Utils::PathChooser::setExpectedKind() */ -void FilePathAspect::setExpectedKind(const PathChooser::Kind expectedKind) +void StringAspect::setExpectedKind(const PathChooser::Kind expectedKind) { d->m_expectedKind = expectedKind; if (d->m_pathChooserDisplay) d->m_pathChooserDisplay->setExpectedKind(expectedKind); } -void FilePathAspect::setEnvironment(const Environment &env) +void StringAspect::setEnvironment(const Environment &env) { d->m_environment = env; if (d->m_pathChooserDisplay) d->m_pathChooserDisplay->setEnvironment(env); } -void FilePathAspect::setBaseFileName(const FilePath &baseFileName) +void StringAspect::setBaseFileName(const FilePath &baseFileName) { d->m_baseFileName = baseFileName; if (d->m_pathChooserDisplay) diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 468ccd565af..fc3500dd747 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -465,6 +465,9 @@ public: void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter); void setPlaceHolderText(const QString &placeHolderText); void setHistoryCompleter(const QString &historyCompleterKey); + void setExpectedKind(const PathChooser::Kind expectedKind); + void setEnvironment(const Environment &env); + void setBaseFileName(const FilePath &baseFileName); void setUndoRedoEnabled(bool readOnly); void setAcceptRichText(bool acceptRichText); void setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider); @@ -497,6 +500,8 @@ public: FilePath filePath() const; + PathChooser *pathChooser() const; // Avoid to use. + signals: void checkedChanged(); void validChanged(bool validState); @@ -523,11 +528,6 @@ public: void setAllowPathFromDevice(bool allowPathFromDevice); void setValidatePlaceHolder(bool validatePlaceHolder); void setOpenTerminalHandler(const std::function<void()> &openTerminal); - void setExpectedKind(const PathChooser::Kind expectedKind); - void setEnvironment(const Environment &env); - void setBaseFileName(const FilePath &baseFileName); - - PathChooser *pathChooser() const; // Avoid to use. }; class QTCREATOR_UTILS_EXPORT IntegerAspect : public TypedAspect<qint64> From 96506f1f6acb0fef48273052180e669b41f60c58 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 10 Jul 2023 12:31:25 +0200 Subject: [PATCH 0236/1777] Utils: Further split StringAspect and FilePathAspect ... by introducing "proper" FilePathAspect::value() (and therefore hiding the inherited StringAspect::value(() and a temporary stringValue() for the transition period for the remaining users of the QString value. Change-Id: I40cf4238a09a9009cda0decba1acac82bd730233 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 15 +++++++++++++++ src/libs/utils/aspects.h | 4 +++- src/plugins/fossil/fossilclient.cpp | 2 +- src/plugins/fossil/wizard/fossiljsextension.cpp | 4 ++-- src/plugins/git/gitsettings.cpp | 2 +- src/plugins/nim/nimplugin.cpp | 4 ++-- src/plugins/projectexplorer/buildaspects.cpp | 2 +- .../projectexplorer/buildconfiguration.cpp | 2 +- src/plugins/vcsbase/vcsbaseclientsettings.cpp | 2 +- 9 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index ab245890e84..bc3f4beb233 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1327,6 +1327,21 @@ FilePathAspect::FilePathAspect(AspectContainer *container) setDisplayStyle(PathChooserDisplay); } +FilePath FilePathAspect::operator()() const +{ + return filePath(); +} + +FilePath FilePathAspect::value() const +{ + return filePath(); +} + +QString FilePathAspect::stringValue() const +{ + return StringAspect::value(); +} + /*! Sets the value of this file path aspect to \a value. diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index fc3500dd747..f6faac16b4c 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -518,7 +518,9 @@ class QTCREATOR_UTILS_EXPORT FilePathAspect : public StringAspect public: FilePathAspect(AspectContainer *container = nullptr); - FilePath operator()() const { return filePath(); } + FilePath operator()() const; + FilePath value() const; + QString stringValue() const; void setValue(const FilePath &filePath); void setDefaultValue(const FilePath &filePath); diff --git a/src/plugins/fossil/fossilclient.cpp b/src/plugins/fossil/fossilclient.cpp index f7bb29f2aea..db75fbf9d1e 100644 --- a/src/plugins/fossil/fossilclient.cpp +++ b/src/plugins/fossil/fossilclient.cpp @@ -766,7 +766,7 @@ unsigned int FossilClient::binaryVersion() const static unsigned int cachedBinaryVersion = 0; static QString cachedBinaryPath; - const QString currentBinaryPath = settings().binaryPath.value(); + const QString currentBinaryPath = settings().binaryPath.stringValue(); if (currentBinaryPath.isEmpty()) return 0; diff --git a/src/plugins/fossil/wizard/fossiljsextension.cpp b/src/plugins/fossil/wizard/fossiljsextension.cpp index 4c013b503a8..e37e13c644f 100644 --- a/src/plugins/fossil/wizard/fossiljsextension.cpp +++ b/src/plugins/fossil/wizard/fossiljsextension.cpp @@ -58,7 +58,7 @@ QString FossilJsExtension::defaultSslIdentityFile() const if (!isConfigured()) return QString(); - return settings().sslIdentityFile.value(); + return settings().sslIdentityFile.stringValue(); } QString FossilJsExtension::defaultLocalRepoPath() const @@ -66,7 +66,7 @@ QString FossilJsExtension::defaultLocalRepoPath() const if (!isConfigured()) return QString(); - return settings().defaultRepoPath.value(); + return settings().defaultRepoPath.stringValue(); } bool FossilJsExtension::defaultDisableAutosync() const diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index 6c4bd4a480e..6317ff1837e 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -170,7 +170,7 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const *ok = false; if (errorMessage) *errorMessage = Tr::tr("The binary \"%1\" could not be located in the path \"%2\"") - .arg(binaryPath.value(), path().toUserOutput()); + .arg(binaryPath().toUserOutput(), path().toUserOutput()); } return resolvedBinPath; } diff --git a/src/plugins/nim/nimplugin.cpp b/src/plugins/nim/nimplugin.cpp index cdad3981ca9..53900a35c4a 100644 --- a/src/plugins/nim/nimplugin.cpp +++ b/src/plugins/nim/nimplugin.cpp @@ -41,10 +41,10 @@ class NimPluginPrivate public: NimPluginPrivate() { - Suggest::NimSuggestCache::instance().setExecutablePath(settings.nimSuggestPath.value()); + Suggest::NimSuggestCache::instance().setExecutablePath(settings.nimSuggestPath.stringValue()); QObject::connect(&settings.nimSuggestPath, &StringAspect::changed, &Suggest::NimSuggestCache::instance(), [this] { - Suggest::NimSuggestCache::instance().setExecutablePath(settings.nimSuggestPath.value()); + Suggest::NimSuggestCache::instance().setExecutablePath(settings.nimSuggestPath.stringValue()); }); } diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index 3577aa9ec04..7eb724b6323 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -61,7 +61,7 @@ BuildDirectoryAspect::BuildDirectoryAspect(AspectContainer *container, const Bui }); setOpenTerminalHandler([this, bc] { - Core::FileUtils::openTerminal(FilePath::fromString(value()), bc->environment()); + Core::FileUtils::openTerminal(value(), bc->environment()); }); } diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index e05f863ea18..9a013d303cc 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -228,7 +228,7 @@ BuildConfiguration::~BuildConfiguration() FilePath BuildConfiguration::buildDirectory() const { FilePath path = FilePath::fromUserInput( - environment().expandVariables(d->m_buildDirectoryAspect.value().trimmed())); + environment().expandVariables(d->m_buildDirectoryAspect.stringValue().trimmed())); // FIXME: If the macro expander is expected to be able to do some // structual changes, the fromUserInput() above might already have // mis-parsed. Should this here be encapsulated in the FilePathAspect? diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.cpp b/src/plugins/vcsbase/vcsbaseclientsettings.cpp index 170437864a0..16d110ec25e 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.cpp +++ b/src/plugins/vcsbase/vcsbaseclientsettings.cpp @@ -38,7 +38,7 @@ VcsBaseSettings::~VcsBaseSettings() = default; FilePaths VcsBaseSettings::searchPathList() const { - return Utils::transform(path.value().split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts), + return Utils::transform(path.stringValue().split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts), &FilePath::fromUserInput); } From d003cca74e2a08e4c709b36dc4a5bf10f5727a94 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 11 Jul 2023 09:04:02 +0200 Subject: [PATCH 0237/1777] McuSupport: Compile fix Amends 96506f1f6a Change-Id: Icfdb889fa76f99c735e0b65782c54d1c2dda974f Reviewed-by: hjk <hjk@qt.io> --- src/plugins/mcusupport/mcubuildstep.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/mcusupport/mcubuildstep.cpp b/src/plugins/mcusupport/mcubuildstep.cpp index dc3812d0423..aae0c394950 100644 --- a/src/plugins/mcusupport/mcubuildstep.cpp +++ b/src/plugins/mcusupport/mcubuildstep.cpp @@ -109,7 +109,7 @@ DeployMcuProcessStep::DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, U outDir->setPlaceHolderText(m_tmpDir.path()); setCommandLineProvider([this, cmd, args, outDir]() -> Utils::CommandLine { - auto directory = outDir->value(); + auto directory = outDir->stringValue(); if (directory.isEmpty()) directory = m_tmpDir.path(); From 62795df12a08e268963743a74df7ab9224af9769 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 18:28:29 +0200 Subject: [PATCH 0238/1777] Python: Use aspects more directly in PythonRunConfiguration Change-Id: Id85348473236bc01ddcc65ec5302c0537c98c526 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/python/pythonrunconfiguration.cpp | 157 +++++++++--------- src/plugins/python/pythonrunconfiguration.h | 2 +- 2 files changed, 80 insertions(+), 79 deletions(-) diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 43a182900e5..13b7f42b928 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -122,7 +122,7 @@ private: class PythonInterpreterAspectPrivate : public QObject { public: - PythonInterpreterAspectPrivate(PythonInterpreterAspect *parent, PythonRunConfiguration *rc) + PythonInterpreterAspectPrivate(PythonInterpreterAspect *parent, RunConfiguration *rc) : q(parent), rc(rc) { connect(q, &InterpreterAspect::changed, @@ -135,6 +135,9 @@ public: checkForPySide(python); } ); + + connect(rc->target(), &Target::buildSystemUpdated, + this, &PythonInterpreterAspectPrivate::updateExtraCompilers); } ~PythonInterpreterAspectPrivate() { qDeleteAll(m_extraCompilers); } @@ -150,46 +153,28 @@ public: FilePath m_pySideUicPath; PythonInterpreterAspect *q; - PythonRunConfiguration *rc; + RunConfiguration *rc; QList<PySideUicExtraCompiler *> m_extraCompilers; QFutureWatcher<PipPackageInfo> m_watcher; QMetaObject::Connection m_watcherConnection; }; -PythonInterpreterAspect::PythonInterpreterAspect(PythonRunConfiguration *rc) - : d(new PythonInterpreterAspectPrivate(this, rc)) -{} - -PythonInterpreterAspect::~PythonInterpreterAspect() +PythonInterpreterAspect::PythonInterpreterAspect(AspectContainer *container, RunConfiguration *rc) + : InterpreterAspect(container), d(new PythonInterpreterAspectPrivate(this, rc)) { - delete d; -} + setSettingsKey("PythonEditor.RunConfiguation.Interpreter"); + setSettingsDialogId(Constants::C_PYTHONOPTIONS_PAGE_ID); -class PythonRunConfiguration : public ProjectExplorer::RunConfiguration -{ -public: - PythonRunConfiguration(ProjectExplorer::Target *target, Utils::Id id); -}; - -PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) - : RunConfiguration(target, id) -{ - auto interpreterAspect = addAspect<PythonInterpreterAspect>(this); - interpreterAspect->setSettingsKey("PythonEditor.RunConfiguation.Interpreter"); - interpreterAspect->setSettingsDialogId(Constants::C_PYTHONOPTIONS_PAGE_ID); - - connect(PythonSettings::instance(), &PythonSettings::interpretersChanged, - interpreterAspect, &InterpreterAspect::updateInterpreters); + updateInterpreters(PythonSettings::interpreters()); const QList<Interpreter> interpreters = PythonSettings::detectPythonVenvs( - project()->projectDirectory()); - interpreterAspect->updateInterpreters(PythonSettings::interpreters()); + rc->project()->projectDirectory()); Interpreter defaultInterpreter = interpreters.isEmpty() ? PythonSettings::defaultInterpreter() : interpreters.first(); if (!defaultInterpreter.command.isExecutableFile()) defaultInterpreter = PythonSettings::interpreters().value(0); if (defaultInterpreter.command.isExecutableFile()) { - const IDeviceConstPtr device = DeviceKitAspect::device(target->kit()); + const IDeviceConstPtr device = DeviceKitAspect::device(rc->kit()); if (device && !device->handlesFile(defaultInterpreter.command)) { defaultInterpreter = Utils::findOr(PythonSettings::interpreters(), defaultInterpreter, @@ -198,56 +183,15 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id) }); } } - interpreterAspect->setDefaultInterpreter(defaultInterpreter); + setDefaultInterpreter(defaultInterpreter); - auto bufferedAspect = addAspect<BoolAspect>(); - bufferedAspect->setSettingsKey("PythonEditor.RunConfiguation.Buffered"); - bufferedAspect->setLabel(Tr::tr("Buffered output"), BoolAspect::LabelPlacement::AtCheckBox); - bufferedAspect->setToolTip(Tr::tr("Enabling improves output performance, " - "but results in delayed output.")); + connect(PythonSettings::instance(), &PythonSettings::interpretersChanged, + this, &InterpreterAspect::updateInterpreters); +} - auto scriptAspect = addAspect<MainScriptAspect>(); - scriptAspect->setSettingsKey("PythonEditor.RunConfiguation.Script"); - scriptAspect->setLabelText(Tr::tr("Script:")); - scriptAspect->setDisplayStyle(StringAspect::LabelDisplay); - - auto envAspect = addAspect<EnvironmentAspect>(); - envAspect->setSupportForBuildEnvironment(target); - - auto argumentsAspect = addAspect<ArgumentsAspect>(); - argumentsAspect->setMacroExpander(macroExpander()); - - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); - - addAspect<TerminalAspect>(); - - if (HostOsInfo::isAnyUnixHost()) { - auto x11Forwarding = addAspect<X11ForwardingAspect>(); - x11Forwarding->setMacroExpander(macroExpander()); - } - - setCommandLineGetter([bufferedAspect, interpreterAspect, argumentsAspect, scriptAspect] { - CommandLine cmd{interpreterAspect->currentInterpreter().command}; - if (!bufferedAspect->value()) - cmd.addArg("-u"); - cmd.addArg(scriptAspect->filePath().fileName()); - cmd.addArgs(argumentsAspect->arguments(), CommandLine::Raw); - return cmd; - }); - - setUpdater([this, scriptAspect] { - const BuildTargetInfo bti = buildTargetInfo(); - const QString script = bti.targetFilePath.toUserOutput(); - setDefaultDisplayName(Tr::tr("Run %1").arg(script)); - scriptAspect->setValue(script); - aspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(bti.targetFilePath.parentDir()); - }); - - connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); - connect(target, &Target::buildSystemUpdated, this, [this, interpreterAspect] { - interpreterAspect->d->updateExtraCompilers(); - }); +PythonInterpreterAspect::~PythonInterpreterAspect() +{ + delete d; } void PythonInterpreterAspectPrivate::checkForPySide(const FilePath &python) @@ -351,9 +295,9 @@ void PythonInterpreterAspectPrivate::updateExtraCompilers() m_extraCompilers.clear(); if (m_pySideUicPath.isExecutableFile()) { - auto uiMatcher = [](const ProjectExplorer::Node *node) { - if (const ProjectExplorer::FileNode *fileNode = node->asFileNode()) - return fileNode->fileType() == ProjectExplorer::FileType::Form; + auto uiMatcher = [](const Node *node) { + if (const FileNode *fileNode = node->asFileNode()) + return fileNode->fileType() == FileType::Form; return false; }; const FilePaths uiFiles = rc->project()->files(uiMatcher); @@ -383,6 +327,63 @@ void PythonInterpreterAspectPrivate::updateExtraCompilers() qDeleteAll(oldCompilers); } +// RunConfiguration + +class PythonRunConfiguration : public RunConfiguration +{ +public: + PythonRunConfiguration(Target *target, Id id) + : RunConfiguration(target, id) + { + buffered.setSettingsKey("PythonEditor.RunConfiguation.Buffered"); + buffered.setLabelText(Tr::tr("Buffered output")); + buffered.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); + buffered.setToolTip(Tr::tr("Enabling improves output performance, " + "but results in delayed output.")); + + mainScript.setSettingsKey("PythonEditor.RunConfiguation.Script"); + mainScript.setLabelText(Tr::tr("Script:")); + mainScript.setDisplayStyle(StringAspect::LabelDisplay); + + environment.setSupportForBuildEnvironment(target); + + arguments.setMacroExpander(macroExpander()); + + workingDir.setMacroExpander(macroExpander()); + + x11Forwarding.setMacroExpander(macroExpander()); + x11Forwarding.setVisible(HostOsInfo::isAnyUnixHost()); + + setCommandLineGetter([this] { + CommandLine cmd{interpreter.currentInterpreter().command}; + if (!buffered()) + cmd.addArg("-u"); + cmd.addArg(mainScript.filePath().fileName()); + cmd.addArgs(arguments(), CommandLine::Raw); + return cmd; + }); + + setUpdater([this] { + const BuildTargetInfo bti = buildTargetInfo(); + const QString script = bti.targetFilePath.toUserOutput(); + setDefaultDisplayName(Tr::tr("Run %1").arg(script)); + mainScript.setValue(script); + workingDir.setDefaultWorkingDirectory(bti.targetFilePath.parentDir()); + }); + + connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); + } + + PythonInterpreterAspect interpreter{this, this}; + BoolAspect buffered{this}; + MainScriptAspect mainScript{this}; + EnvironmentAspect environment{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; + TerminalAspect terminal{this}; + X11ForwardingAspect x11Forwarding{this}; +}; + // Factories PythonRunConfigurationFactory::PythonRunConfigurationFactory() diff --git a/src/plugins/python/pythonrunconfiguration.h b/src/plugins/python/pythonrunconfiguration.h index 54c912f6879..4c4517abf75 100644 --- a/src/plugins/python/pythonrunconfiguration.h +++ b/src/plugins/python/pythonrunconfiguration.h @@ -17,7 +17,7 @@ class PythonInterpreterAspect final : public ProjectExplorer::InterpreterAspect Q_OBJECT public: - explicit PythonInterpreterAspect(PythonRunConfiguration *rc); + PythonInterpreterAspect(Utils::AspectContainer *container, ProjectExplorer::RunConfiguration *rc); ~PythonInterpreterAspect() final; QList<PySideUicExtraCompiler *> extraCompilers() const; From dddf16226a96abaae39752b802dcad2d40d3a380 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 10 Jul 2023 13:29:27 +0200 Subject: [PATCH 0239/1777] McuSupport: Use aspects more directly in McuBuildStep Change-Id: I2c4c033a23fa9e8de9f8439fbddbc0127a18c150 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/mcusupport/mcubuildstep.cpp | 42 +++++++++++++------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/plugins/mcusupport/mcubuildstep.cpp b/src/plugins/mcusupport/mcubuildstep.cpp index aae0c394950..8cc003607bd 100644 --- a/src/plugins/mcusupport/mcubuildstep.cpp +++ b/src/plugins/mcusupport/mcubuildstep.cpp @@ -30,6 +30,8 @@ #include <QTemporaryDir> #include <QVersionNumber> +using namespace Utils; + namespace McuSupport::Internal { class DeployMcuProcessStep : public ProjectExplorer::AbstractProcessStep @@ -43,6 +45,10 @@ public: private: QString findKitInformation(ProjectExplorer::Kit *kit, const QString &key); QTemporaryDir m_tmpDir; + + FilePathAspect cmd{this}; + StringAspect args{this}; + FilePathAspect outDir{this}; }; const Utils::Id DeployMcuProcessStep::id = "QmlProject.Mcu.DeployStep"; @@ -74,14 +80,12 @@ DeployMcuProcessStep::DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, U QString root = findKitInformation(kit, Internal::Legacy::Constants::QUL_CMAKE_VAR); auto rootPath = Utils::FilePath::fromString(root); - auto cmd = addAspect<Utils::FilePathAspect>(); - cmd->setSettingsKey("QmlProject.Mcu.ProcessStep.Command"); - cmd->setExpectedKind(Utils::PathChooser::Command); - cmd->setLabelText(QmlProjectManager::Tr::tr("Command:")); - cmd->setValue(rootPath.pathAppended("/bin/qmlprojectexporter")); + cmd.setSettingsKey("QmlProject.Mcu.ProcessStep.Command"); + cmd.setExpectedKind(PathChooser::Command); + cmd.setLabelText(QmlProjectManager::Tr::tr("Command:")); + cmd.setValue(rootPath.pathAppended("/bin/qmlprojectexporter")); const char *importPathConstant = QtSupport::Constants::KIT_QML_IMPORT_PATH; - Utils::FilePath projectDir = buildSystem()->projectDirectory(); Utils::FilePath qulIncludeDir = Utils::FilePath::fromVariant(kit->value(importPathConstant)); QStringList includeDirs { Utils::ProcessArgs::quoteArg(qulIncludeDir.toString()), @@ -96,25 +100,23 @@ DeployMcuProcessStep::DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, U "--include-dirs", includeDirs.join(","), }; - auto args = addAspect<Utils::StringAspect>(); - args->setSettingsKey("QmlProject.Mcu.ProcessStep.Arguments"); - args->setDisplayStyle(Utils::StringAspect::LineEditDisplay); - args->setLabelText(QmlProjectManager::Tr::tr("Arguments:")); - args->setValue(Utils::ProcessArgs::joinArgs(arguments)); + args.setSettingsKey("QmlProject.Mcu.ProcessStep.Arguments"); + args.setDisplayStyle(Utils::StringAspect::LineEditDisplay); + args.setLabelText(QmlProjectManager::Tr::tr("Arguments:")); + args.setValue(Utils::ProcessArgs::joinArgs(arguments)); - auto outDir = addAspect<Utils::FilePathAspect>(); - outDir->setSettingsKey("QmlProject.Mcu.ProcessStep.BuildDirectory"); - outDir->setExpectedKind(Utils::PathChooser::Directory); - outDir->setLabelText(QmlProjectManager::Tr::tr("Build directory:")); - outDir->setPlaceHolderText(m_tmpDir.path()); + outDir.setSettingsKey("QmlProject.Mcu.ProcessStep.BuildDirectory"); + outDir.setExpectedKind(Utils::PathChooser::Directory); + outDir.setLabelText(QmlProjectManager::Tr::tr("Build directory:")); + outDir.setPlaceHolderText(m_tmpDir.path()); - setCommandLineProvider([this, cmd, args, outDir]() -> Utils::CommandLine { - auto directory = outDir->stringValue(); + setCommandLineProvider([this] { + QString directory = outDir().path(); if (directory.isEmpty()) directory = m_tmpDir.path(); - Utils::CommandLine cmdLine(cmd->filePath()); - cmdLine.addArgs(args->value(), Utils::CommandLine::Raw); + CommandLine cmdLine(cmd()); + cmdLine.addArgs(args(), Utils::CommandLine::Raw); cmdLine.addArg("--outdir"); cmdLine.addArg(directory); return cmdLine; From 181b5ee28bd3427bfe78537329ac7e2f61a43104 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 10 Jul 2023 09:09:02 +0200 Subject: [PATCH 0240/1777] AbstractRemoteLinuxDeployStep: Enclose prechecks in recipe This is a preparation step toward making the recipe more general. Add a runRecipe() method (private for now) which describes the whole step's execution. Later, when virtual BuildStep::runRecipe() is added, we just make this newly added method virtual. Make deployRecipe() pure virtual. Change-Id: Ic9c4e3eea7d4a3eb95fd419575f4f747224d0499 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../abstractremotelinuxdeploystep.cpp | 33 ++++++++++--------- .../abstractremotelinuxdeploystep.h | 3 +- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index 64bf07538c5..06cc78c655c 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -117,20 +117,7 @@ void AbstractRemoteLinuxDeployStep::doRun() QTC_ASSERT(!d->m_taskTree, return); - const auto canDeploy = isDeploymentPossible(); - if (!canDeploy) { - addErrorMessage(canDeploy.error()); - handleFinished(); - return; - } - - if (!isDeploymentNecessary()) { - addProgressMessage(Tr::tr("No deployment action necessary. Skipping.")); - handleFinished(); - return; - } - - d->m_taskTree.reset(new TaskTree(deployRecipe())); + d->m_taskTree.reset(new TaskTree(runRecipe())); const auto endHandler = [this] { d->m_taskTree.release()->deleteLater(); handleFinished(); @@ -198,9 +185,23 @@ bool AbstractRemoteLinuxDeployStep::isDeploymentNecessary() const return true; } -Group AbstractRemoteLinuxDeployStep::deployRecipe() +Group AbstractRemoteLinuxDeployStep::runRecipe() { - return {}; + const auto onSetup = [this] { + const auto canDeploy = isDeploymentPossible(); + if (!canDeploy) { + addErrorMessage(canDeploy.error()); + handleFinished(); + return SetupResult::StopWithError; + } + if (!isDeploymentNecessary()) { + addProgressMessage(Tr::tr("No deployment action necessary. Skipping.")); + handleFinished(); + return SetupResult::StopWithDone; + } + return SetupResult::Continue; + }; + return Group { onGroupSetup(onSetup), deployRecipe() }; } } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h index f83a3215a79..19eedcd79f7 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h @@ -53,7 +53,8 @@ protected: private: virtual bool isDeploymentNecessary() const; - virtual Tasking::Group deployRecipe(); + virtual Tasking::Group deployRecipe() = 0; + Tasking::Group runRecipe(); Internal::AbstractRemoteLinuxDeployStepPrivate *d; }; From 02ffee322bfd30a145281c74d74cabaf563dac92 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 10 Jul 2023 09:25:59 +0200 Subject: [PATCH 0241/1777] AbstractRemoteLinuxDeployStep: Make recipe return GroupItem There is no need for extra nested Group item in deployRecipe() overloads, as sometimes it's just one task, like in case of QdbStopApplicationStep or CustomCommandDeployStep. Change-Id: I89cdb703c24198f3cbdfb17d0317e40f1929c376 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/boot2qt/qdbmakedefaultappstep.cpp | 4 ++-- src/plugins/boot2qt/qdbstopapplicationstep.cpp | 6 +++--- src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp | 4 ++-- src/plugins/remotelinux/abstractremotelinuxdeploystep.h | 6 +++--- src/plugins/remotelinux/customcommanddeploystep.cpp | 6 +++--- src/plugins/remotelinux/genericdirectuploadstep.cpp | 4 ++-- src/plugins/remotelinux/killappstep.cpp | 6 +++--- src/plugins/remotelinux/rsyncdeploystep.cpp | 4 ++-- src/plugins/remotelinux/tarpackagedeploystep.cpp | 4 ++-- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/plugins/boot2qt/qdbmakedefaultappstep.cpp b/src/plugins/boot2qt/qdbmakedefaultappstep.cpp index b02beff5307..fbff89bd398 100644 --- a/src/plugins/boot2qt/qdbmakedefaultappstep.cpp +++ b/src/plugins/boot2qt/qdbmakedefaultappstep.cpp @@ -36,7 +36,7 @@ public: } private: - Group deployRecipe() final + GroupItem deployRecipe() final { const auto setupHandler = [this](Process &process) { QString remoteExe; @@ -64,7 +64,7 @@ private: const auto errorHandler = [this](const Process &process) { addErrorMessage(Tr::tr("Remote process failed: %1").arg(process.errorString())); }; - return Group { ProcessTask(setupHandler, doneHandler, errorHandler) }; + return ProcessTask(setupHandler, doneHandler, errorHandler); } SelectionAspect selection{this}; diff --git a/src/plugins/boot2qt/qdbstopapplicationstep.cpp b/src/plugins/boot2qt/qdbstopapplicationstep.cpp index 1949aac9580..ea69b6ac1d5 100644 --- a/src/plugins/boot2qt/qdbstopapplicationstep.cpp +++ b/src/plugins/boot2qt/qdbstopapplicationstep.cpp @@ -34,10 +34,10 @@ public: setInternalInitializer([this] { return isDeploymentPossible(); }); } - Group deployRecipe() final; + GroupItem deployRecipe() final; }; -Group QdbStopApplicationStep::deployRecipe() +GroupItem QdbStopApplicationStep::deployRecipe() { const auto setupHandler = [this](Process &process) { const auto device = DeviceKitAspect::device(target()->kit()); @@ -71,7 +71,7 @@ Group QdbStopApplicationStep::deployRecipe() addErrorMessage(failureMessage); } }; - return Group { ProcessTask(setupHandler, doneHandler, errorHandler) }; + return ProcessTask(setupHandler, doneHandler, errorHandler); } // QdbStopApplicationStepFactory diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index 06cc78c655c..8eac07557f7 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -117,7 +117,7 @@ void AbstractRemoteLinuxDeployStep::doRun() QTC_ASSERT(!d->m_taskTree, return); - d->m_taskTree.reset(new TaskTree(runRecipe())); + d->m_taskTree.reset(new TaskTree({runRecipe()})); const auto endHandler = [this] { d->m_taskTree.release()->deleteLater(); handleFinished(); @@ -185,7 +185,7 @@ bool AbstractRemoteLinuxDeployStep::isDeploymentNecessary() const return true; } -Group AbstractRemoteLinuxDeployStep::runRecipe() +GroupItem AbstractRemoteLinuxDeployStep::runRecipe() { const auto onSetup = [this] { const auto canDeploy = isDeploymentPossible(); diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h index 19eedcd79f7..d9674686272 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h @@ -11,7 +11,7 @@ #include <QObject> namespace ProjectExplorer { class DeployableFile; } -namespace Tasking { class Group; } +namespace Tasking { class GroupItem; } namespace RemoteLinux { @@ -53,8 +53,8 @@ protected: private: virtual bool isDeploymentNecessary() const; - virtual Tasking::Group deployRecipe() = 0; - Tasking::Group runRecipe(); + virtual Tasking::GroupItem deployRecipe() = 0; + Tasking::GroupItem runRecipe(); Internal::AbstractRemoteLinuxDeployStepPrivate *d; }; diff --git a/src/plugins/remotelinux/customcommanddeploystep.cpp b/src/plugins/remotelinux/customcommanddeploystep.cpp index 995be652668..2b5753243fb 100644 --- a/src/plugins/remotelinux/customcommanddeploystep.cpp +++ b/src/plugins/remotelinux/customcommanddeploystep.cpp @@ -38,7 +38,7 @@ public: expected_str<void> isDeploymentPossible() const final; private: - Group deployRecipe() final; + GroupItem deployRecipe() final; StringAspect commandLine{this}; }; @@ -51,7 +51,7 @@ expected_str<void> CustomCommandDeployStep::isDeploymentPossible() const return AbstractRemoteLinuxDeployStep::isDeploymentPossible(); } -Group CustomCommandDeployStep::deployRecipe() +GroupItem CustomCommandDeployStep::deployRecipe() { const auto setupHandler = [this](Process &process) { addProgressMessage(Tr::tr("Starting remote command \"%1\"...").arg(commandLine())); @@ -77,7 +77,7 @@ Group CustomCommandDeployStep::deployRecipe() .arg(process.exitCode())); } }; - return Group { ProcessTask(setupHandler, doneHandler, errorHandler) }; + return ProcessTask(setupHandler, doneHandler, errorHandler); } diff --git a/src/plugins/remotelinux/genericdirectuploadstep.cpp b/src/plugins/remotelinux/genericdirectuploadstep.cpp index a85d16f7e1f..8c506772070 100644 --- a/src/plugins/remotelinux/genericdirectuploadstep.cpp +++ b/src/plugins/remotelinux/genericdirectuploadstep.cpp @@ -55,7 +55,7 @@ public: } bool isDeploymentNecessary() const final; - Group deployRecipe() final; + GroupItem deployRecipe() final; QDateTime timestampFromStat(const DeployableFile &file, Process *statProc); @@ -255,7 +255,7 @@ GroupItem GenericDirectUploadStep::chmodTree(const TreeStorage<UploadStorage> &s return TaskTreeTask(setupChmodHandler); } -Group GenericDirectUploadStep::deployRecipe() +GroupItem GenericDirectUploadStep::deployRecipe() { const auto preFilesToStat = [this](UploadStorage *storage) { QList<DeployableFile> filesToStat; diff --git a/src/plugins/remotelinux/killappstep.cpp b/src/plugins/remotelinux/killappstep.cpp index e59088bb9c7..c94f5a41e40 100644 --- a/src/plugins/remotelinux/killappstep.cpp +++ b/src/plugins/remotelinux/killappstep.cpp @@ -38,12 +38,12 @@ public: private: bool isDeploymentNecessary() const final { return !m_remoteExecutable.isEmpty(); } - Group deployRecipe() final; + GroupItem deployRecipe() final; FilePath m_remoteExecutable; }; -Group KillAppStep::deployRecipe() +GroupItem KillAppStep::deployRecipe() { const auto setupHandler = [this](DeviceProcessKiller &killer) { killer.setProcessPath(m_remoteExecutable); @@ -57,7 +57,7 @@ Group KillAppStep::deployRecipe() addProgressMessage(Tr::tr("Failed to kill remote application. " "Assuming it was not running.")); }; - return Group { DeviceProcessKillerTask(setupHandler, doneHandler, errorHandler) }; + return DeviceProcessKillerTask(setupHandler, doneHandler, errorHandler); } KillAppStepFactory::KillAppStepFactory() diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index 8f8da906107..683e5335d7d 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -64,7 +64,7 @@ public: private: bool isDeploymentNecessary() const final; - Group deployRecipe() final; + GroupItem deployRecipe() final; GroupItem mkdirTask(); GroupItem transferTask(); @@ -193,7 +193,7 @@ GroupItem RsyncDeployStep::transferTask() return FileTransferTask(setupHandler, {}, errorHandler); } -Group RsyncDeployStep::deployRecipe() +GroupItem RsyncDeployStep::deployRecipe() { return Group { mkdirTask(), transferTask() }; } diff --git a/src/plugins/remotelinux/tarpackagedeploystep.cpp b/src/plugins/remotelinux/tarpackagedeploystep.cpp index eb2fd4b588a..570ecdb958d 100644 --- a/src/plugins/remotelinux/tarpackagedeploystep.cpp +++ b/src/plugins/remotelinux/tarpackagedeploystep.cpp @@ -54,7 +54,7 @@ public: private: QString remoteFilePath() const; bool isDeploymentNecessary() const final; - Group deployRecipe() final; + GroupItem deployRecipe() final; GroupItem uploadTask(); GroupItem installTask(); @@ -115,7 +115,7 @@ GroupItem TarPackageDeployStep::installTask() return ProcessTask(setupHandler, doneHandler, errorHandler); } -Group TarPackageDeployStep::deployRecipe() +GroupItem TarPackageDeployStep::deployRecipe() { return Group { uploadTask(), installTask() }; } From 6a8fe161cb4cb055ea6b8a5c37596419bc79704a Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 10 Jul 2023 10:02:37 +0200 Subject: [PATCH 0242/1777] BuildStepList: Pass ProjectConfiguration into c'tor Instead of relying on parent-child qobject hierarchy. Add explicit BuildStepList::projectConfiguration() getter. Add explicit Target arg into ProjectConfiguration c'tor and avoid qobject_cast. Change-Id: I0b3105f7f8aea950e9679857887baffe9b321a33 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/buildconfiguration.cpp | 13 ++++++------- src/plugins/projectexplorer/buildstep.cpp | 7 +++---- src/plugins/projectexplorer/buildsteplist.cpp | 14 ++++++++------ src/plugins/projectexplorer/buildsteplist.h | 8 +++++--- .../projectexplorer/deployconfiguration.cpp | 5 ++--- .../projectexplorer/projectconfiguration.cpp | 12 +++--------- src/plugins/projectexplorer/projectconfiguration.h | 2 +- src/plugins/projectexplorer/runconfiguration.cpp | 3 +-- 8 files changed, 29 insertions(+), 35 deletions(-) diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 9a013d303cc..6fa9b198753 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -127,10 +127,10 @@ class BuildConfigurationPrivate { public: BuildConfigurationPrivate(BuildConfiguration *bc) - : m_buildSteps(bc, Constants::BUILDSTEPS_BUILD), - m_cleanSteps(bc, Constants::BUILDSTEPS_CLEAN), - m_buildDirectoryAspect(bc, bc), - m_tooltipAspect(bc) + : m_buildSteps(bc, Constants::BUILDSTEPS_BUILD) + , m_cleanSteps(bc, Constants::BUILDSTEPS_CLEAN) + , m_buildDirectoryAspect(bc, bc) + , m_tooltipAspect(bc) {} bool m_clearSystemEnvironment = false; @@ -157,10 +157,9 @@ public: } // Internal BuildConfiguration::BuildConfiguration(Target *target, Utils::Id id) - : ProjectConfiguration(target, id), d(new Internal::BuildConfigurationPrivate(this)) + : ProjectConfiguration(target, target, id) + , d(new Internal::BuildConfigurationPrivate(this)) { - QTC_CHECK(target && target == this->target()); - MacroExpander *expander = macroExpander(); expander->setDisplayName(Tr::tr("Build Settings")); expander->setAccumulating(true); diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 5e6f3bcd781..86ca6da8fd7 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -111,10 +111,9 @@ namespace ProjectExplorer { static QList<BuildStepFactory *> g_buildStepFactories; -BuildStep::BuildStep(BuildStepList *bsl, Id id) : - ProjectConfiguration(bsl, id) +BuildStep::BuildStep(BuildStepList *bsl, Id id) + : ProjectConfiguration(bsl, bsl->target(), id) { - QTC_CHECK(bsl->target() && bsl->target() == this->target()); connect(this, &ProjectConfiguration::displayNameChanged, this, &BuildStep::updateSummary); // m_displayName = step->displayName(); @@ -346,7 +345,7 @@ bool BuildStepFactory::canHandle(BuildStepList *bsl) const if (!m_supportedStepLists.isEmpty() && !m_supportedStepLists.contains(bsl->id())) return false; - auto config = qobject_cast<ProjectConfiguration *>(bsl->parent()); + ProjectConfiguration *config = bsl->projectConfiguration(); if (!m_supportedDeviceTypes.isEmpty()) { Target *target = bsl->target(); diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index 8d6159541ef..4c520b977d6 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -19,13 +19,10 @@ namespace ProjectExplorer { const char STEPS_COUNT_KEY[] = "ProjectExplorer.BuildStepList.StepsCount"; const char STEPS_PREFIX[] = "ProjectExplorer.BuildStepList.Step."; -BuildStepList::BuildStepList(QObject *parent, Utils::Id id) - : QObject(parent), m_id(id) +BuildStepList::BuildStepList(ProjectConfiguration *config, Utils::Id id) + : QObject(config), m_projectConfiguration(config), m_id(id) { - QTC_ASSERT(parent, return); - QTC_ASSERT(parent->parent(), return); - m_target = qobject_cast<Target *>(parent->parent()); - QTC_ASSERT(m_target, return); + QTC_CHECK(config); } BuildStepList::~BuildStepList() @@ -39,6 +36,11 @@ void BuildStepList::clear() m_steps.clear(); } +Target *BuildStepList::target() const +{ + return m_projectConfiguration->target(); +} + QVariantMap BuildStepList::toMap() const { QVariantMap map; diff --git a/src/plugins/projectexplorer/buildsteplist.h b/src/plugins/projectexplorer/buildsteplist.h index 909c3be3e8c..a5c32cf1a4a 100644 --- a/src/plugins/projectexplorer/buildsteplist.h +++ b/src/plugins/projectexplorer/buildsteplist.h @@ -13,6 +13,7 @@ namespace ProjectExplorer { class BuildStep; +class ProjectConfiguration; class Target; class PROJECTEXPLORER_EXPORT BuildStepList : public QObject @@ -20,7 +21,7 @@ class PROJECTEXPLORER_EXPORT BuildStepList : public QObject Q_OBJECT public: - explicit BuildStepList(QObject *parent, Utils::Id id); + explicit BuildStepList(ProjectConfiguration *config, Utils::Id id); ~BuildStepList() override; void clear(); @@ -56,7 +57,8 @@ public: void moveStepUp(int position); BuildStep *at(int position) const; - Target *target() { return m_target; } + ProjectConfiguration *projectConfiguration() const { return m_projectConfiguration; } + Target *target() const; QVariantMap toMap() const; bool fromMap(const QVariantMap &map); @@ -71,7 +73,7 @@ signals: void stepMoved(int from, int to); private: - Target *m_target; + ProjectConfiguration *m_projectConfiguration; Utils::Id m_id; QList<BuildStep *> m_steps; }; diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp index d6a105682d3..bb500c3294d 100644 --- a/src/plugins/projectexplorer/deployconfiguration.cpp +++ b/src/plugins/projectexplorer/deployconfiguration.cpp @@ -26,10 +26,9 @@ const char USES_DEPLOYMENT_DATA[] = "ProjectExplorer.DeployConfiguration.CustomD const char DEPLOYMENT_DATA[] = "ProjectExplorer.DeployConfiguration.CustomData"; DeployConfiguration::DeployConfiguration(Target *target, Id id) - : ProjectConfiguration(target, id), - m_stepList(this, Constants::BUILDSTEPS_DEPLOY) + : ProjectConfiguration(target, target, id) + , m_stepList(this, Constants::BUILDSTEPS_DEPLOY) { - QTC_CHECK(target && target == this->target()); //: Default DeployConfiguration display name setDefaultDisplayName(Tr::tr("Deploy locally")); } diff --git a/src/plugins/projectexplorer/projectconfiguration.cpp b/src/plugins/projectexplorer/projectconfiguration.cpp index 4aad7c4a392..e0a4f4b66f9 100644 --- a/src/plugins/projectexplorer/projectconfiguration.cpp +++ b/src/plugins/projectexplorer/projectconfiguration.cpp @@ -3,7 +3,6 @@ #include "projectconfiguration.h" -#include "kitinformation.h" #include "target.h" #include <utils/algorithm.h> @@ -17,20 +16,15 @@ const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ProjectConfiguration.DisplayNam // ProjectConfiguration -ProjectConfiguration::ProjectConfiguration(QObject *parent, Utils::Id id) +ProjectConfiguration::ProjectConfiguration(QObject *parent, Target *target, Utils::Id id) : AspectContainer(parent) + , m_target(target) , m_id(id) { QTC_CHECK(parent); + QTC_CHECK(target); QTC_CHECK(id.isValid()); setObjectName(id.toString()); - - for (QObject *obj = this; obj; obj = obj->parent()) { - m_target = qobject_cast<Target *>(obj); - if (m_target) - break; - } - QTC_CHECK(m_target); } ProjectConfiguration::~ProjectConfiguration() = default; diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h index 713c187c83f..b945631ceee 100644 --- a/src/plugins/projectexplorer/projectconfiguration.h +++ b/src/plugins/projectexplorer/projectconfiguration.h @@ -26,7 +26,7 @@ class PROJECTEXPLORER_EXPORT ProjectConfiguration : public Utils::AspectContaine Q_OBJECT protected: - explicit ProjectConfiguration(QObject *parent, Utils::Id id); + explicit ProjectConfiguration(QObject *parent, Target *target, Utils::Id id); public: ~ProjectConfiguration() override; diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index ab6e4fc32fd..763d3bb1ecb 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -160,9 +160,8 @@ void GlobalOrProjectAspect::resetProjectToGlobalSettings() static std::vector<RunConfiguration::AspectFactory> theAspectFactories; RunConfiguration::RunConfiguration(Target *target, Utils::Id id) - : ProjectConfiguration(target, id) + : ProjectConfiguration(target, target, id) { - QTC_CHECK(target && target == this->target()); forceDisplayNameSerialization(); connect(target, &Target::parsingFinished, this, &RunConfiguration::update); From 06a57f8c42247462dcd8264f69ec98703e512bf0 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 10 Jul 2023 12:19:29 +0200 Subject: [PATCH 0243/1777] BuildStep: Store the BuildStepList field Don't rely on qobject hierarchy casts. Change-Id: I7152252c882805fea0bc82e8f1205a964bfdfd93 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/buildstep.cpp | 15 ++++++++------- src/plugins/projectexplorer/buildstep.h | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 86ca6da8fd7..d9017ce4a06 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -113,6 +113,7 @@ static QList<BuildStepFactory *> g_buildStepFactories; BuildStep::BuildStep(BuildStepList *bsl, Id id) : ProjectConfiguration(bsl, bsl->target(), id) + , m_stepList(bsl) { connect(this, &ProjectConfiguration::displayNameChanged, this, &BuildStep::updateSummary); @@ -190,7 +191,7 @@ QVariantMap BuildStep::toMap() const BuildConfiguration *BuildStep::buildConfiguration() const { - auto config = qobject_cast<BuildConfiguration *>(parent()->parent()); + auto config = qobject_cast<BuildConfiguration *>(projectConfiguration()); if (config) return config; @@ -200,7 +201,7 @@ BuildConfiguration *BuildStep::buildConfiguration() const DeployConfiguration *BuildStep::deployConfiguration() const { - auto config = qobject_cast<DeployConfiguration *>(parent()->parent()); + auto config = qobject_cast<DeployConfiguration *>(projectConfiguration()); if (config) return config; // See comment in buildConfiguration() @@ -211,7 +212,7 @@ DeployConfiguration *BuildStep::deployConfiguration() const ProjectConfiguration *BuildStep::projectConfiguration() const { - return static_cast<ProjectConfiguration *>(parent()->parent()); + return stepList()->projectConfiguration(); } BuildSystem *BuildStep::buildSystem() const @@ -223,7 +224,7 @@ BuildSystem *BuildStep::buildSystem() const Environment BuildStep::buildEnvironment() const { - if (const auto bc = qobject_cast<BuildConfiguration *>(parent()->parent())) + if (const auto bc = qobject_cast<BuildConfiguration *>(projectConfiguration())) return bc->environment(); if (const auto bc = target()->activeBuildConfiguration()) return bc->environment(); @@ -260,8 +261,8 @@ QString BuildStep::fallbackWorkingDirectory() const void BuildStep::setupOutputFormatter(OutputFormatter *formatter) { - if (qobject_cast<BuildConfiguration *>(parent()->parent())) { - for (const Id id : buildConfiguration()->customParsers()) { + if (auto bc = qobject_cast<BuildConfiguration *>(projectConfiguration())) { + for (const Id id : bc->customParsers()) { if (Internal::CustomParser * const parser = Internal::CustomParser::createFromId(id)) formatter->addLineParser(parser); } @@ -317,7 +318,7 @@ void BuildStep::setEnabled(bool b) BuildStepList *BuildStep::stepList() const { - return qobject_cast<BuildStepList *>(parent()); + return m_stepList; } bool BuildStep::enabled() const diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 46be75f5633..8520f851def 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -131,6 +131,7 @@ private: virtual void doRun() = 0; virtual void doCancel(); + BuildStepList * const m_stepList; std::atomic_bool m_cancelFlag; bool m_enabled = true; bool m_immutable = false; From ed86673e84067bbec83ddeea343a31a8c2f29559 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 10 Jul 2023 17:22:49 +0200 Subject: [PATCH 0244/1777] AbstractProcessStep: Hide some methods in protected section Change-Id: Ibc306288c35c4826123b6146e568d55d533e07a9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/abstractprocessstep.h | 11 +++++------ src/plugins/qmakeprojectmanager/qmakemakestep.cpp | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index fc1ed131357..0ac03036d8f 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -25,11 +25,14 @@ class PROJECTEXPLORER_EXPORT AbstractProcessStep : public BuildStep public: ProcessParameters *processParameters(); - bool setupProcessParameters(ProcessParameters *params) const; +protected: + AbstractProcessStep(BuildStepList *bsl, Utils::Id id); + ~AbstractProcessStep() override; + + bool setupProcessParameters(ProcessParameters *params) const; bool ignoreReturnValue() const; void setIgnoreReturnValue(bool b); - void setCommandLineProvider(const std::function<Utils::CommandLine()> &provider); void setWorkingDirectoryProvider(const std::function<Utils::FilePath()> &provider); void setEnvironmentModifier(const std::function<void(Utils::Environment &)> &modifier); @@ -37,10 +40,6 @@ public: void emitFaultyConfigurationMessage(); -protected: - AbstractProcessStep(BuildStepList *bsl, Utils::Id id); - ~AbstractProcessStep() override; - bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; void doRun() override; diff --git a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp index e72d3467582..47e6470f602 100644 --- a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp @@ -209,9 +209,9 @@ void QmakeMakeStep::doRun() } if (!m_makeFileToCheck.exists()) { - if (!ignoreReturnValue()) - emit addOutput(Tr::tr("Cannot find Makefile. Check your build settings."), BuildStep::OutputFormat::NormalMessage); const bool success = ignoreReturnValue(); + if (!success) + emit addOutput(Tr::tr("Cannot find Makefile. Check your build settings."), BuildStep::OutputFormat::NormalMessage); emit finished(success); return; } From 0c40bd3e99e9959b255355c0eea33a77e25cd9a1 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 11 Jul 2023 09:32:37 +0200 Subject: [PATCH 0245/1777] McuSupport: Denoise McuBuildStep Change-Id: I519984d7bbdb84b1436184dc0bbd04be0967c3e5 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/mcusupport/mcubuildstep.cpp | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/plugins/mcusupport/mcubuildstep.cpp b/src/plugins/mcusupport/mcubuildstep.cpp index 8cc003607bd..83e68c43ef3 100644 --- a/src/plugins/mcusupport/mcubuildstep.cpp +++ b/src/plugins/mcusupport/mcubuildstep.cpp @@ -37,10 +37,10 @@ namespace McuSupport::Internal { class DeployMcuProcessStep : public ProjectExplorer::AbstractProcessStep { public: - static const Utils::Id id; + static const Id id; static void showError(const QString &text); - DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, Utils::Id id); + DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, Id id); private: QString findKitInformation(ProjectExplorer::Kit *kit, const QString &key); @@ -51,7 +51,7 @@ private: FilePathAspect outDir{this}; }; -const Utils::Id DeployMcuProcessStep::id = "QmlProject.Mcu.DeployStep"; +const Id DeployMcuProcessStep::id = "QmlProject.Mcu.DeployStep"; void DeployMcuProcessStep::showError(const QString &text) { @@ -59,7 +59,7 @@ void DeployMcuProcessStep::showError(const QString &text) ProjectExplorer::TaskHub::addTask(task); } -DeployMcuProcessStep::DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, Utils::Id id) +DeployMcuProcessStep::DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, Id id) : AbstractProcessStep(bc, id) , m_tmpDir() { @@ -77,8 +77,8 @@ DeployMcuProcessStep::DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, U if (!kit) return; - QString root = findKitInformation(kit, Internal::Legacy::Constants::QUL_CMAKE_VAR); - auto rootPath = Utils::FilePath::fromString(root); + const QString root = findKitInformation(kit, Internal::Legacy::Constants::QUL_CMAKE_VAR); + const FilePath rootPath = FilePath::fromString(root); cmd.setSettingsKey("QmlProject.Mcu.ProcessStep.Command"); cmd.setExpectedKind(PathChooser::Command); @@ -86,27 +86,27 @@ DeployMcuProcessStep::DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, U cmd.setValue(rootPath.pathAppended("/bin/qmlprojectexporter")); const char *importPathConstant = QtSupport::Constants::KIT_QML_IMPORT_PATH; - Utils::FilePath qulIncludeDir = Utils::FilePath::fromVariant(kit->value(importPathConstant)); + const FilePath qulIncludeDir = FilePath::fromVariant(kit->value(importPathConstant)); QStringList includeDirs { - Utils::ProcessArgs::quoteArg(qulIncludeDir.toString()), - Utils::ProcessArgs::quoteArg(qulIncludeDir.pathAppended("Timeline").toString()) + ProcessArgs::quoteArg(qulIncludeDir.toString()), + ProcessArgs::quoteArg(qulIncludeDir.pathAppended("Timeline").toString()) }; const char *toolChainConstant = Internal::Constants::KIT_MCUTARGET_TOOLCHAIN_KEY; QStringList arguments = { - Utils::ProcessArgs::quoteArg(buildSystem()->projectFilePath().toString()), + ProcessArgs::quoteArg(buildSystem()->projectFilePath().toString()), "--platform", findKitInformation(kit, "QUL_PLATFORM"), "--toolchain", kit->value(toolChainConstant).toString(), "--include-dirs", includeDirs.join(","), }; args.setSettingsKey("QmlProject.Mcu.ProcessStep.Arguments"); - args.setDisplayStyle(Utils::StringAspect::LineEditDisplay); + args.setDisplayStyle(StringAspect::LineEditDisplay); args.setLabelText(QmlProjectManager::Tr::tr("Arguments:")); - args.setValue(Utils::ProcessArgs::joinArgs(arguments)); + args.setValue(ProcessArgs::joinArgs(arguments)); outDir.setSettingsKey("QmlProject.Mcu.ProcessStep.BuildDirectory"); - outDir.setExpectedKind(Utils::PathChooser::Directory); + outDir.setExpectedKind(PathChooser::Directory); outDir.setLabelText(QmlProjectManager::Tr::tr("Build directory:")); outDir.setPlaceHolderText(m_tmpDir.path()); @@ -116,7 +116,7 @@ DeployMcuProcessStep::DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, U directory = m_tmpDir.path(); CommandLine cmdLine(cmd()); - cmdLine.addArgs(args(), Utils::CommandLine::Raw); + cmdLine.addArgs(args(), CommandLine::Raw); cmdLine.addArg("--outdir"); cmdLine.addArg(directory); return cmdLine; From d171e6da69133856f125d007b10f0dd5908103a6 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 11 Jul 2023 05:53:34 +0200 Subject: [PATCH 0246/1777] AbstractRemoteLinuxDeployStep: Make some overrides final Move some methods into protected section. Do some cleanup. Change-Id: Ica6f6fd181334c450666049c10d9ecc1ea16ea5c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../remotelinux/abstractremotelinuxdeploystep.cpp | 5 +---- .../remotelinux/abstractremotelinuxdeploystep.h | 14 +++++--------- src/plugins/remotelinux/rsyncdeploystep.cpp | 3 +-- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index 8eac07557f7..c97f9bc25e3 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -9,15 +9,12 @@ #include <projectexplorer/deployablefile.h> #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/kitinformation.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/target.h> #include <solutions/tasking/tasktree.h> #include <utils/qtcassert.h> #include <QDateTime> -#include <QPointer> using namespace ProjectExplorer; using namespace Tasking; @@ -55,7 +52,7 @@ IDevice::ConstPtr AbstractRemoteLinuxDeployStep::deviceConfiguration() const } void AbstractRemoteLinuxDeployStep::saveDeploymentTimeStamp(const DeployableFile &deployableFile, - const QDateTime &remoteTimestamp) + const QDateTime &remoteTimestamp) { d->deployTimes.saveDeploymentTimeStamp(deployableFile, kit(), remoteTimestamp); } diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h index d9674686272..299a3ca736a 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h @@ -8,8 +8,6 @@ #include <projectexplorer/buildstep.h> #include <projectexplorer/devicesupport/idevicefwd.h> -#include <QObject> - namespace ProjectExplorer { class DeployableFile; } namespace Tasking { class GroupItem; } @@ -23,19 +21,17 @@ public: explicit AbstractRemoteLinuxDeployStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); ~AbstractRemoteLinuxDeployStep() override; +protected: ProjectExplorer::IDeviceConstPtr deviceConfiguration() const; - virtual Utils::expected_str<void> isDeploymentPossible() const; - void handleStdOutData(const QString &data); void handleStdErrData(const QString &data); -protected: - bool fromMap(const QVariantMap &map) override; - QVariantMap toMap() const override; - bool init() override; + bool fromMap(const QVariantMap &map) final; + QVariantMap toMap() const final; + bool init() final; void doRun() final; - void doCancel() override; + void doCancel() final; void setInternalInitializer(const std::function<Utils::expected_str<void>()> &init); diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index 683e5335d7d..ae496279094 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -176,8 +176,7 @@ GroupItem RsyncDeployStep::transferTask() transfer.setRsyncFlags(flags()); transfer.setFilesToTransfer(m_files); - connect(&transfer, &FileTransfer::progress, - this, &AbstractRemoteLinuxDeployStep::handleStdOutData); + connect(&transfer, &FileTransfer::progress, this, &RsyncDeployStep::handleStdOutData); }; const auto errorHandler = [this](const FileTransfer &transfer) { const ProcessResultData result = transfer.resultData(); From dbfc2a3242f0b124faf105244095eb7812d43856 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 1 Jun 2023 17:19:33 +0200 Subject: [PATCH 0247/1777] Core: Use LayoutBuilder for FancyTabWidget Change-Id: I01905732563807715eec21879e5a1c8c6fc2b5fe Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/coreplugin/fancytabwidget.cpp | 69 +++++++++-------------- 1 file changed, 28 insertions(+), 41 deletions(-) diff --git a/src/plugins/coreplugin/fancytabwidget.cpp b/src/plugins/coreplugin/fancytabwidget.cpp index 5d3bf71764f..85935b27987 100644 --- a/src/plugins/coreplugin/fancytabwidget.cpp +++ b/src/plugins/coreplugin/fancytabwidget.cpp @@ -7,13 +7,13 @@ #include "fancyactionbar.h" #include <utils/hostosinfo.h> +#include <utils/layoutbuilder.h> #include <utils/qtcassert.h> #include <utils/styledbar.h> #include <utils/stylehelper.h> #include <utils/theme/theme.h> #include <QDebug> -#include <QHBoxLayout> #include <QMouseEvent> #include <QPainter> #include <QPixmapCache> @@ -457,57 +457,44 @@ FancyTabWidget::FancyTabWidget(QWidget *parent) m_tabBar = new FancyTabBar(this); m_tabBar->setObjectName("ModeSelector"); // used for UI introduction - m_selectionWidget = new QWidget(this); - auto selectionLayout = new QVBoxLayout; - selectionLayout->setSpacing(0); - selectionLayout->setContentsMargins(0, 0, 0, 0); - auto bar = new StyledBar; - auto layout = new QHBoxLayout(bar); - layout->setContentsMargins(0, 0, 0, 0); - layout->setSpacing(0); - auto fancyButton = new FancyColorButton(this); + auto fancyButton = new FancyColorButton; connect(fancyButton, &FancyColorButton::clicked, this, &FancyTabWidget::topAreaClicked); - layout->addWidget(fancyButton); - selectionLayout->addWidget(bar); - - selectionLayout->addWidget(m_tabBar); - selectionLayout->addStretch(1); - m_selectionWidget->setLayout(selectionLayout); - m_selectionWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); - - m_cornerWidgetContainer = new QWidget(this); - m_cornerWidgetContainer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); - m_cornerWidgetContainer->setAutoFillBackground(false); - - auto cornerWidgetLayout = new QVBoxLayout; - cornerWidgetLayout->setSpacing(0); - cornerWidgetLayout->setContentsMargins(0, 0, 0, 0); - cornerWidgetLayout->addStretch(); - m_cornerWidgetContainer->setLayout(cornerWidgetLayout); - - selectionLayout->addWidget(m_cornerWidgetContainer, 0); m_modesStack = new QStackedLayout; m_statusBar = new QStatusBar; m_statusBar->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed); - auto vlayout = new QVBoxLayout; - vlayout->setContentsMargins(0, 0, 0, 0); - vlayout->setSpacing(0); - vlayout->addLayout(m_modesStack); - vlayout->addWidget(m_statusBar); + QVBoxLayout *vlayout; + + using namespace Layouting; + Row { fancyButton, noMargin() }.attachTo(bar); + Row { + Widget { + bindTo(&m_selectionWidget), + Column { + bar, + m_tabBar, + st, + Widget { + bindTo(&m_cornerWidgetContainer), + Column { st, spacing(0), noMargin() }, + }, + spacing(0), noMargin(), + }, + }, + Column { bindTo(&vlayout), m_modesStack, m_statusBar, spacing(0) }, + spacing(1), noMargin(), + }.attachTo(this); + + m_selectionWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + + m_cornerWidgetContainer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); + m_cornerWidgetContainer->setAutoFillBackground(false); m_infoBarDisplay.setTarget(vlayout, 1); m_infoBarDisplay.setEdge(Qt::BottomEdge); - auto mainLayout = new QHBoxLayout; - mainLayout->setContentsMargins(0, 0, 0, 0); - mainLayout->setSpacing(1); - mainLayout->addWidget(m_selectionWidget); - mainLayout->addLayout(vlayout); - setLayout(mainLayout); - connect(m_tabBar, &FancyTabBar::currentAboutToChange, this, &FancyTabWidget::currentAboutToShow); connect(m_tabBar, &FancyTabBar::currentChanged, this, &FancyTabWidget::showWidget); connect(m_tabBar, &FancyTabBar::menuTriggered, this, &FancyTabWidget::menuTriggered); From 634695238072e4da50b7e3b898d9328fc0f6a208 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 11 Jul 2023 09:01:38 +0200 Subject: [PATCH 0248/1777] Beautifier: Make sure version update process finishes Change-Id: Ifd6fcee56d03f2853c7b196e8dade650f4e60e55 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/beautifier/beautifiertool.cpp | 15 +++++++++------ src/plugins/beautifier/beautifiertool.h | 13 ++++--------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/plugins/beautifier/beautifiertool.cpp b/src/plugins/beautifier/beautifiertool.cpp index 76b6e7dbd09..3fe53070d04 100644 --- a/src/plugins/beautifier/beautifiertool.cpp +++ b/src/plugins/beautifier/beautifiertool.cpp @@ -129,7 +129,6 @@ AbstractSettings::AbstractSettings(const QString &name, const QString &ending) , m_styleDir(Core::ICore::userResourcePath(Beautifier::Constants::SETTINGS_DIRNAME) .pathAppended(name) .toString()) - , m_versionUpdater(new VersionUpdater) { setSettingsGroups(Utils::Constants::BEAUTIFIER_SETTINGS_GROUP, name); @@ -159,9 +158,7 @@ AbstractSettings::AbstractSettings(const QString &name, const QString &ending) return types.join("; "); }); - connect(&command, &BaseAspect::changed, this, [this] { - m_versionUpdater->update(command()); - }); + connect(&command, &BaseAspect::changed, this, [this] { m_version = {}; version(); }); } AbstractSettings::~AbstractSettings() = default; @@ -232,12 +229,18 @@ QString AbstractSettings::styleFileName(const QString &key) const QVersionNumber AbstractSettings::version() const { - return m_versionUpdater->version(); + if (m_version.isNull()) { + VersionUpdater updater; + updater.setVersionRegExp(m_versionRegExp); + updater.update(command()); + m_version = updater.version(); + } + return m_version; } void AbstractSettings::setVersionRegExp(const QRegularExpression &versionRegExp) { - m_versionUpdater->setVersionRegExp(versionRegExp); + m_versionRegExp = versionRegExp; } bool AbstractSettings::isApplicable(const Core::IDocument *document) const diff --git a/src/plugins/beautifier/beautifiertool.h b/src/plugins/beautifier/beautifiertool.h index 0eb4faf6418..0c6bdfd37b5 100644 --- a/src/plugins/beautifier/beautifiertool.h +++ b/src/plugins/beautifier/beautifiertool.h @@ -8,22 +8,18 @@ #include <texteditor/command.h> #include <utils/aspects.h> -#include <utils/filepath.h> #include <QDir> #include <QHash> #include <QMap> #include <QObject> +#include <QRegularExpression> #include <QSet> #include <QStringList> +#include <QVersionNumber> #include <memory> -QT_BEGIN_NAMESPACE -class QRegularExpression; -class QVersionNumber; -QT_END_NAMESPACE - namespace Core { class IDocument; class IEditor; @@ -58,8 +54,6 @@ public: static void showError(const QString &error); }; -class VersionUpdater; - class AbstractSettings : public Utils::AspectContainer { public: @@ -104,12 +98,13 @@ protected: virtual void readStyles(); private: - std::unique_ptr<VersionUpdater> m_versionUpdater; QStringList m_stylesToRemove; QSet<QString> m_changedStyles; QHash<QString, int> m_options; QStringList m_docu; QStringList m_supportedMimeTypes; + mutable QVersionNumber m_version; + QRegularExpression m_versionRegExp; }; } // Beautifier::Internal From e1ca7cf53f47034063d0571d648bf9b97e39149b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 10 Jul 2023 17:27:47 +0200 Subject: [PATCH 0249/1777] Utils: Let registered aspects know about their containers Will help to set up macroexpanders with less boiler plate. Change-Id: I521af3dc9d49524cf855e82eecc0132d1bcc40db Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/aspects.cpp | 10 +++++++++- src/libs/utils/aspects.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index bc3f4beb233..32c7a2ec6c6 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -52,6 +52,8 @@ namespace Internal { class BaseAspectPrivate { public: + explicit BaseAspectPrivate(AspectContainer *container) : m_container(container) {} + Id m_id; std::function<QVariant(const QVariant &)> m_toSettings; std::function<QVariant(const QVariant &)> m_fromSettings; @@ -64,6 +66,7 @@ public: QIcon m_icon; QPointer<QLabel> m_label; // Owned by configuration widget QPointer<QAction> m_action; // Owned by us. + AspectContainer *m_container = nullptr; // Not owned by us. bool m_visible = true; bool m_enabled = true; @@ -106,7 +109,7 @@ public: If \a container is non-null, the aspect is made known to the container. */ BaseAspect::BaseAspect(AspectContainer *container) - : d(new Internal::BaseAspectPrivate) + : d(new Internal::BaseAspectPrivate(container)) { if (container) container->registerAspect(this); @@ -438,6 +441,11 @@ QAction *BaseAspect::action() return d->m_action; } +AspectContainer *BaseAspect::container() const +{ + return d->m_container; +} + /*! Adds the visual representation of this aspect to the layout with the specified \a parent using a layout builder. diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index f6faac16b4c..c23375e1132 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -94,6 +94,8 @@ public: virtual QAction *action(); + AspectContainer *container() const; + virtual void fromMap(const QVariantMap &map); virtual void toMap(QVariantMap &map) const; virtual void toActiveMap(QVariantMap &map) const { toMap(map); } From ed93cff3ba0f7f8c0e985009b3f66cda538a7244 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 18:45:39 +0200 Subject: [PATCH 0250/1777] ProjectExplorer: Allow to specific target device for EnvironmentAspects Similar to what is done for ExecutableAspect. The device related part is here not used yet, as only run related setups are affected. This might change with an attempt to unify EnvironmentAspect and RemoteLinuxEnvironmentAspect. Change-Id: I6a620ad1d3443f0e8201c2572689edda1f84593c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/boot2qt/qdbrunconfiguration.cpp | 3 ++- .../projectexplorer/environmentaspect.cpp | 6 ++++++ .../projectexplorer/environmentaspect.h | 7 +++++++ src/plugins/qnx/qnxrunconfiguration.cpp | 3 ++- .../remotelinuxcustomrunconfiguration.cpp | 3 ++- .../remotelinuxenvironmentaspect.cpp | 20 +++++++++---------- .../remotelinuxenvironmentaspect.h | 2 +- .../remotelinuxrunconfiguration.cpp | 3 ++- 8 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/plugins/boot2qt/qdbrunconfiguration.cpp b/src/plugins/boot2qt/qdbrunconfiguration.cpp index efc4886b3bf..cba9aef178c 100644 --- a/src/plugins/boot2qt/qdbrunconfiguration.cpp +++ b/src/plugins/boot2qt/qdbrunconfiguration.cpp @@ -80,7 +80,8 @@ QdbRunConfiguration::QdbRunConfiguration(Target *target, Id id) symbolsAspect->setLabelText(Tr::tr("Executable on host:")); symbolsAspect->setDisplayStyle(SymbolFileAspect::LabelDisplay); - auto envAspect = addAspect<RemoteLinux::RemoteLinuxEnvironmentAspect>(target); + auto envAspect = addAspect<RemoteLinux::RemoteLinuxEnvironmentAspect>(); + envAspect->setDeviceSelector(target, EnvironmentAspect::RunDevice); auto argsAspect = addAspect<ArgumentsAspect>(); argsAspect->setMacroExpander(macroExpander()); diff --git a/src/plugins/projectexplorer/environmentaspect.cpp b/src/plugins/projectexplorer/environmentaspect.cpp index e55e95156da..cae48b2f329 100644 --- a/src/plugins/projectexplorer/environmentaspect.cpp +++ b/src/plugins/projectexplorer/environmentaspect.cpp @@ -30,6 +30,12 @@ EnvironmentAspect::EnvironmentAspect(AspectContainer *container) addDataExtractor(this, &EnvironmentAspect::environment, &Data::environment); } +void EnvironmentAspect::setDeviceSelector(Target *target, DeviceSelector selector) +{ + m_target = target; + m_selector = selector; +} + int EnvironmentAspect::baseEnvironmentBase() const { return m_base; diff --git a/src/plugins/projectexplorer/environmentaspect.h b/src/plugins/projectexplorer/environmentaspect.h index 1de5641f6b0..ee1bb7e1831 100644 --- a/src/plugins/projectexplorer/environmentaspect.h +++ b/src/plugins/projectexplorer/environmentaspect.h @@ -22,6 +22,9 @@ class PROJECTEXPLORER_EXPORT EnvironmentAspect : public Utils::BaseAspect public: EnvironmentAspect(Utils::AspectContainer *container = nullptr); + enum DeviceSelector { HostDevice, BuildDevice, RunDevice }; + void setDeviceSelector(Target *target, DeviceSelector selector); + // The environment including the user's modifications. Utils::Environment environment() const; @@ -50,6 +53,8 @@ public: bool isLocal() const { return m_isLocal; } + Target *target() const { return m_target; } + bool isPrintOnRunAllowed() const { return m_allowPrintOnRun; } bool isPrintOnRunEnabled() const { return m_printOnRun; } void setPrintOnRun(bool enabled) { m_printOnRun = enabled; } @@ -93,6 +98,8 @@ private: bool m_isLocal = false; bool m_allowPrintOnRun = true; bool m_printOnRun = false; + Target *m_target = nullptr; + DeviceSelector m_selector = RunDevice; }; } // namespace ProjectExplorer diff --git a/src/plugins/qnx/qnxrunconfiguration.cpp b/src/plugins/qnx/qnxrunconfiguration.cpp index 96245e95017..a6624c56f4b 100644 --- a/src/plugins/qnx/qnxrunconfiguration.cpp +++ b/src/plugins/qnx/qnxrunconfiguration.cpp @@ -40,7 +40,8 @@ public: symbolsAspect->setLabelText(Tr::tr("Executable on host:")); symbolsAspect->setDisplayStyle(SymbolFileAspect::LabelDisplay); - auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(target); + auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(); + envAspect->setDeviceSelector(target, EnvironmentAspect::RunDevice); auto argsAspect = addAspect<ArgumentsAspect>(); argsAspect->setMacroExpander(macroExpander()); diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp index cbafc2423b5..631bc638b57 100644 --- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp @@ -32,7 +32,8 @@ private: RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(target); + auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(); + envAspect->setDeviceSelector(target, EnvironmentAspect::RunDevice); auto exeAspect = addAspect<ExecutableAspect>(); exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp index 07880089de2..e658f295521 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp @@ -32,24 +32,26 @@ const int ENVIRONMENTASPECT_VERSION = 1; // Version was introduced in 4.3 with t class RemoteLinuxEnvironmentAspectWidget : public EnvironmentAspectWidget { public: - RemoteLinuxEnvironmentAspectWidget(RemoteLinuxEnvironmentAspect *aspect, Target *target) + RemoteLinuxEnvironmentAspectWidget(RemoteLinuxEnvironmentAspect *aspect) : EnvironmentAspectWidget(aspect) { auto fetchButton = new QPushButton(Tr::tr("Fetch Device Environment")); addWidget(fetchButton); - connect(target, &Target::kitChanged, aspect, [aspect] { aspect->setRemoteEnvironment({}); }); + connect(aspect->target(), &Target::kitChanged, aspect, [aspect] { + aspect->setRemoteEnvironment({}); + }); - connect(fetchButton, &QPushButton::clicked, this, [aspect, target] { - if (IDevice::ConstPtr device = DeviceKitAspect::device(target->kit())) { + connect(fetchButton, &QPushButton::clicked, this, [aspect] { + if (IDevice::ConstPtr device = DeviceKitAspect::device(aspect->target()->kit())) { DeviceFileAccess *access = device->fileAccess(); QTC_ASSERT(access, return); aspect->setRemoteEnvironment(access->deviceEnvironment()); } }); - envWidget()->setOpenTerminalFunc([target](const Environment &env) { - IDevice::ConstPtr device = DeviceKitAspect::device(target->kit()); + envWidget()->setOpenTerminalFunc([aspect](const Environment &env) { + IDevice::ConstPtr device = DeviceKitAspect::device(aspect->target()->kit()); if (!device) { QMessageBox::critical(Core::ICore::dialogParent(), Tr::tr("Cannot Open Terminal"), @@ -70,14 +72,12 @@ static bool displayAlreadySet(const Utils::EnvironmentItems &changes) }); } -RemoteLinuxEnvironmentAspect::RemoteLinuxEnvironmentAspect(Target *target) +RemoteLinuxEnvironmentAspect::RemoteLinuxEnvironmentAspect() { addSupportedBaseEnvironment(Tr::tr("Clean Environment"), {}); addPreferredBaseEnvironment(Tr::tr("System Environment"), [this] { return m_remoteEnvironment; }); - setConfigWidgetCreator([this, target] { - return new RemoteLinuxEnvironmentAspectWidget(this, target); - }); + setConfigWidgetCreator([this] { return new RemoteLinuxEnvironmentAspectWidget(this); }); } void RemoteLinuxEnvironmentAspect::setRemoteEnvironment(const Utils::Environment &env) diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h index 552faabe416..e85c51ac70f 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h @@ -14,7 +14,7 @@ class REMOTELINUX_EXPORT RemoteLinuxEnvironmentAspect : public ProjectExplorer:: Q_OBJECT public: - RemoteLinuxEnvironmentAspect(ProjectExplorer::Target *target); + RemoteLinuxEnvironmentAspect(); void setRemoteEnvironment(const Utils::Environment &env); diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 4234afaf745..8a9cf316662 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -33,7 +33,8 @@ public: RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(target); + auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(); + envAspect->setDeviceSelector(target, EnvironmentAspect::RunDevice); auto exeAspect = addAspect<ExecutableAspect>(); exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); From 80196abd6f926b7777b682364ae0d93f49753822 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 10 Jul 2023 11:03:06 +0200 Subject: [PATCH 0251/1777] CMake: Remove Windows 8 WINVER / _WIN32_WINNT defines This was required for older MinGW toolchains. Change-Id: I89e048adf01fa2b04c52715f71bf266cbd65c44e Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- cmake/QtCreatorAPIInternal.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index 0e990b58fbd..99e87540624 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -30,9 +30,7 @@ if (WIN32) list(APPEND DEFAULT_DEFINES UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS) if (NOT BUILD_WITH_PCH) - # Windows 8 0x0602 list(APPEND DEFAULT_DEFINES - WINVER=0x0602 _WIN32_WINNT=0x0602 WIN32_LEAN_AND_MEAN) endif() endif() From c914e5f9c27f2c01d3516869b5cc729e7aa53b95 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 10 Jul 2023 14:31:59 +0200 Subject: [PATCH 0252/1777] Wininterrupt: Add explicit stdlib.h include statement strtoul is found in stdlib.h and with the llvm-mingw toolchain it fails to compile due to the stdlib.h header not being indirectly included. Change-Id: I85fc5e5828c859572ff1ce2c050556bc087de277 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/tools/wininterrupt/wininterrupt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/wininterrupt/wininterrupt.c b/src/tools/wininterrupt/wininterrupt.c index 8053d6db3cc..47559a30fa7 100644 --- a/src/tools/wininterrupt/wininterrupt.c +++ b/src/tools/wininterrupt/wininterrupt.c @@ -11,6 +11,7 @@ #include <windows.h> #include <stdio.h> +#include <stdlib.h> /* To debug break a 64bit application under Windows, you must call * DebugBreakProcess() from an 64bit apllication. Therefore: From abf2234e4fcd99a8955c2ebfeee8c98460d942ff Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 11 Jul 2023 13:23:00 +0200 Subject: [PATCH 0253/1777] Utils: Add ToolBar to layoutbuilder Change-Id: I26ce85f73e625508d816c0e361a6afc65adf65ff Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/layoutbuilder.cpp | 25 +++++++++++++++++++++++-- src/libs/utils/layoutbuilder.h | 6 ++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/layoutbuilder.cpp b/src/libs/utils/layoutbuilder.cpp index fa2c6e369eb..a45469882e8 100644 --- a/src/libs/utils/layoutbuilder.cpp +++ b/src/libs/utils/layoutbuilder.cpp @@ -3,20 +3,21 @@ #include "layoutbuilder.h" +#include <QApplication> #include <QDebug> #include <QFormLayout> #include <QGridLayout> #include <QGroupBox> #include <QLabel> #include <QPushButton> -#include <QStackedLayout> #include <QSpacerItem> #include <QSpinBox> #include <QSplitter> +#include <QStackedLayout> #include <QStyle> #include <QTabWidget> #include <QTextEdit> -#include <QApplication> +#include <QToolBar> namespace Layouting { @@ -774,6 +775,26 @@ Splitter::Splitter(std::initializer_list<LayoutItem> items) }; } +ToolBar::ToolBar(std::initializer_list<LayoutItem> items) +{ + subItems = items; + onAdd = [](LayoutBuilder &builder) { + auto toolbar = new QToolBar; + toolbar->setOrientation(Qt::Horizontal); + builder.stack.append(toolbar); + }; + onExit = [](LayoutBuilder &builder) { + const Slice slice = builder.stack.last(); + QToolBar *toolBar = qobject_cast<QToolBar *>(slice.widget); + for (const ResultItem &ri : slice.pendingItems) { + if (ri.widget) + toolBar->addWidget(ri.widget); + } + builder.stack.pop_back(); + builder.stack.last().pendingItems.append(ResultItem(toolBar)); + }; +} + TabWidget::TabWidget(std::initializer_list<LayoutItem> items) { this->subItems = items; diff --git a/src/libs/utils/layoutbuilder.h b/src/libs/utils/layoutbuilder.h index 72fefc1b781..e94fbb56c04 100644 --- a/src/libs/utils/layoutbuilder.h +++ b/src/libs/utils/layoutbuilder.h @@ -171,6 +171,12 @@ public: Splitter(std::initializer_list<LayoutItem> items); }; +class QTCREATOR_UTILS_EXPORT ToolBar : public LayoutItem +{ +public: + ToolBar(std::initializer_list<LayoutItem> items); +}; + class QTCREATOR_UTILS_EXPORT TabWidget : public LayoutItem { public: From cf7b2fb822b1f992dbc29bb743313bb73e488ec7 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 19:06:03 +0200 Subject: [PATCH 0254/1777] RemoteLinux: Add auto-registration ability to RemoteLinuxEnvironmentAspect Change-Id: Ifec10445427c2f8125c29cdb4db44d45a99e6453 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp | 3 ++- src/plugins/remotelinux/remotelinuxenvironmentaspect.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp index e658f295521..d2c19e29613 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp @@ -72,7 +72,8 @@ static bool displayAlreadySet(const Utils::EnvironmentItems &changes) }); } -RemoteLinuxEnvironmentAspect::RemoteLinuxEnvironmentAspect() +RemoteLinuxEnvironmentAspect::RemoteLinuxEnvironmentAspect(AspectContainer *container) + : EnvironmentAspect(container) { addSupportedBaseEnvironment(Tr::tr("Clean Environment"), {}); addPreferredBaseEnvironment(Tr::tr("System Environment"), [this] { return m_remoteEnvironment; }); diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h index e85c51ac70f..9041f68c5c6 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h @@ -14,7 +14,7 @@ class REMOTELINUX_EXPORT RemoteLinuxEnvironmentAspect : public ProjectExplorer:: Q_OBJECT public: - RemoteLinuxEnvironmentAspect(); + explicit RemoteLinuxEnvironmentAspect(Utils::AspectContainer *container = nullptr); void setRemoteEnvironment(const Utils::Environment &env); From 200ae0b40b4842fb8280b0bc117afbae6d2feb18 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 19:12:42 +0200 Subject: [PATCH 0255/1777] Qnx: Use Aspects more directly in QnxRunConfiguration Change-Id: I450144e91842792cc5841b2fb61e8fc39b0daa1e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/qnx/qnxrunconfiguration.cpp | 54 ++++++++++++------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/plugins/qnx/qnxrunconfiguration.cpp b/src/plugins/qnx/qnxrunconfiguration.cpp index a6624c56f4b..86a65d98bcb 100644 --- a/src/plugins/qnx/qnxrunconfiguration.cpp +++ b/src/plugins/qnx/qnxrunconfiguration.cpp @@ -28,46 +28,38 @@ public: QnxRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto exeAspect = addAspect<ExecutableAspect>(); - exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); - exeAspect->setLabelText(Tr::tr("Executable on device:")); - exeAspect->setPlaceHolderText(Tr::tr("Remote path not set")); - exeAspect->makeOverridable("RemoteLinux.RunConfig.AlternateRemoteExecutable", + executable.setDeviceSelector(target, ExecutableAspect::RunDevice); + executable.setLabelText(Tr::tr("Executable on device:")); + executable.setPlaceHolderText(Tr::tr("Remote path not set")); + executable.makeOverridable("RemoteLinux.RunConfig.AlternateRemoteExecutable", "RemoteLinux.RunConfig.UseAlternateRemoteExecutable"); - exeAspect->setHistoryCompleter("RemoteLinux.AlternateExecutable.History"); + executable.setHistoryCompleter("RemoteLinux.AlternateExecutable.History"); - auto symbolsAspect = addAspect<SymbolFileAspect>(); - symbolsAspect->setLabelText(Tr::tr("Executable on host:")); - symbolsAspect->setDisplayStyle(SymbolFileAspect::LabelDisplay); + symbolFile.setLabelText(Tr::tr("Executable on host:")); + symbolFile.setDisplayStyle(SymbolFileAspect::LabelDisplay); - auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(); - envAspect->setDeviceSelector(target, EnvironmentAspect::RunDevice); + environment.setDeviceSelector(target, EnvironmentAspect::RunDevice); - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); + arguments.setMacroExpander(macroExpander()); - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); - workingDirAspect->setEnvironment(envAspect); + workingDir.setMacroExpander(macroExpander()); + workingDir.setEnvironment(&environment); - addAspect<TerminalAspect>(); + qtLibraries.setSettingsKey("Qt4ProjectManager.QnxRunConfiguration.QtLibPath"); + qtLibraries.setLabelText(Tr::tr("Path to Qt libraries on device")); + qtLibraries.setDisplayStyle(StringAspect::LineEditDisplay); - auto libAspect = addAspect<StringAspect>(); - libAspect->setSettingsKey("Qt4ProjectManager.QnxRunConfiguration.QtLibPath"); - libAspect->setLabelText(Tr::tr("Path to Qt libraries on device")); - libAspect->setDisplayStyle(StringAspect::LineEditDisplay); - - setUpdater([this, target, exeAspect, symbolsAspect] { + setUpdater([this, target] { const BuildTargetInfo bti = buildTargetInfo(); const FilePath localExecutable = bti.targetFilePath; const DeployableFile depFile = target->deploymentData() .deployableForLocalFile(localExecutable); - exeAspect->setExecutable(FilePath::fromString(depFile.remoteFilePath())); - symbolsAspect->setValue(localExecutable); + executable.setExecutable(FilePath::fromString(depFile.remoteFilePath())); + symbolFile.setValue(localExecutable); }); - setRunnableModifier([libAspect](Runnable &r) { - QString libPath = libAspect->value(); + setRunnableModifier([this](Runnable &r) { + QString libPath = qtLibraries(); if (!libPath.isEmpty()) { r.environment.appendOrSet("LD_LIBRARY_PATH", libPath + "/lib:$LD_LIBRARY_PATH"); r.environment.appendOrSet("QML_IMPORT_PATH", libPath + "/imports:$QML_IMPORT_PATH"); @@ -79,6 +71,14 @@ public: connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); } + + ExecutableAspect executable{this}; + SymbolFileAspect symbolFile{this}; + RemoteLinuxEnvironmentAspect environment{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; + TerminalAspect terminal{this}; + StringAspect qtLibraries{this}; }; // QnxRunConfigurationFactory From 918978ce89c4ae3edf0e00309d251db59bd76150 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 11 Jul 2023 16:16:26 +0200 Subject: [PATCH 0256/1777] Android: Remove unused androiderrormessage.h/.cpp These have been added 10 Years ago with the plan to use them soon after, but that did not happen. Amends: db78293e7f13d53053f323487f96fa3c9ee477ad Change-Id: Ic916eafba56cbb5e4d1dadfb63222fa2870fbd2c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> --- src/plugins/android/CMakeLists.txt | 1 - src/plugins/android/android.qbs | 2 - src/plugins/android/androiderrormessage.cpp | 49 --------------------- src/plugins/android/androiderrormessage.h | 31 ------------- 4 files changed, 83 deletions(-) delete mode 100644 src/plugins/android/androiderrormessage.cpp delete mode 100644 src/plugins/android/androiderrormessage.h diff --git a/src/plugins/android/CMakeLists.txt b/src/plugins/android/CMakeLists.txt index 9246c94e829..f49e57ba58c 100644 --- a/src/plugins/android/CMakeLists.txt +++ b/src/plugins/android/CMakeLists.txt @@ -14,7 +14,6 @@ add_qtc_plugin(Android androiddeployqtstep.cpp androiddeployqtstep.h androiddevice.cpp androiddevice.h androiddeviceinfo.cpp androiddeviceinfo.h - androiderrormessage.cpp androiderrormessage.h androidextralibrarylistmodel.cpp androidextralibrarylistmodel.h androidglobal.h androidmanager.cpp androidmanager.h diff --git a/src/plugins/android/android.qbs b/src/plugins/android/android.qbs index b187ed428fc..2baca19e0f2 100644 --- a/src/plugins/android/android.qbs +++ b/src/plugins/android/android.qbs @@ -36,8 +36,6 @@ Project { "androiddevice.h", "androiddeviceinfo.cpp", "androiddeviceinfo.h", - "androiderrormessage.h", - "androiderrormessage.cpp", "androidextralibrarylistmodel.cpp", "androidextralibrarylistmodel.h", "androidglobal.h", diff --git a/src/plugins/android/androiderrormessage.cpp b/src/plugins/android/androiderrormessage.cpp deleted file mode 100644 index c67abf727f0..00000000000 --- a/src/plugins/android/androiderrormessage.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "androiderrormessage.h" -#include "androidtr.h" - -#include <QObject> - -namespace Android { -namespace Internal { - -QString AndroidErrorMessage::getMessage(ErrorCode errorCode, const QVariantList ¶meters) -{ - Q_UNUSED(parameters) - switch (errorCode) { - case SDKInstallationError: - return Tr::tr("Android: SDK installation error 0x%1").arg(errorCode, 0, 16); - - case NDKInstallationError: - return Tr::tr("Android: NDK installation error 0x%1").arg(errorCode, 0, 16); - - case JavaInstallationError: - return Tr::tr("Android: Java installation error 0x%1").arg(errorCode, 0, 16); - - case AntInstallationError: - return Tr::tr("Android: ant installation error 0x%1").arg(errorCode, 0, 16); - - case AdbInstallationError: - return Tr::tr("Android: adb installation error 0x%1").arg(errorCode, 0, 16); - - case DeviceConnectionError: - return Tr::tr("Android: Device connection error 0x%1").arg(errorCode, 0, 16); - - case DevicePermissionError: - return Tr::tr("Android: Device permission error 0x%1").arg(errorCode, 0, 16); - - case DeviceAuthorizationError: - return Tr::tr("Android: Device authorization error 0x%1").arg(errorCode, 0, 16); - - case DeviceAPILevelError: - return Tr::tr("Android: Device API level not supported: error 0x%1").arg(errorCode, 0, 16); - - default: - return Tr::tr("Android: Unknown error 0x%1").arg(errorCode, 0, 16); - } -} - -} // namespace Internal -} // namespace Android diff --git a/src/plugins/android/androiderrormessage.h b/src/plugins/android/androiderrormessage.h deleted file mode 100644 index c7bb7bc0daa..00000000000 --- a/src/plugins/android/androiderrormessage.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <QVariantList> -#include <QCoreApplication> - -namespace Android { -namespace Internal { - -class AndroidErrorMessage -{ -public: - enum ErrorCode { - UnknownError = 0x3000, - SDKInstallationError, - NDKInstallationError, - JavaInstallationError, - AntInstallationError, - AdbInstallationError, - DeviceConnectionError, - DevicePermissionError, - DeviceAuthorizationError, - DeviceAPILevelError - }; - static QString getMessage(ErrorCode errorCode, const QVariantList ¶meters = QVariantList()); -}; - -} // namespace Internal -} // namespace Android From cd1b6a669bf73fb69987f403c0f942465bf03407 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 11 Jul 2023 12:08:22 +0200 Subject: [PATCH 0257/1777] Tasks: Create a container class for category data Reduce the number of arguments that need to be passed around. Change-Id: I9fbfdcdf7b20f8f26e35f435bf8d65ba483e4114 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../clangcodemodel/clangcodemodelplugin.cpp | 2 +- src/plugins/clangtools/clangtoolsplugin.cpp | 2 +- src/plugins/debugger/debuggerplugin.cpp | 6 ++--- src/plugins/nim/nimplugin.cpp | 2 +- src/plugins/projectexplorer/buildmanager.cpp | 24 +++++++++---------- .../projectexplorer/projectexplorer.cpp | 6 ++--- src/plugins/projectexplorer/taskhub.cpp | 11 ++++----- src/plugins/projectexplorer/taskhub.h | 15 ++++++++---- src/plugins/projectexplorer/taskmodel.cpp | 10 ++++---- src/plugins/projectexplorer/taskmodel.h | 4 +++- src/plugins/projectexplorer/taskwindow.cpp | 8 +++---- src/plugins/projectexplorer/taskwindow.h | 3 ++- src/plugins/python/pythonplugin.cpp | 2 +- .../assetexporterplugin.cpp | 4 ++-- src/plugins/qmljseditor/qmljseditorplugin.cpp | 4 ++-- 15 files changed, 56 insertions(+), 47 deletions(-) diff --git a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp index 9b5ec425231..d9830ec8aa3 100644 --- a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp +++ b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp @@ -77,7 +77,7 @@ ClangCodeModelPlugin::~ClangCodeModelPlugin() void ClangCodeModelPlugin::initialize() { - TaskHub::addCategory(Constants::TASK_CATEGORY_DIAGNOSTICS, Tr::tr("Clang Code Model")); + TaskHub::addCategory({Constants::TASK_CATEGORY_DIAGNOSTICS, Tr::tr("Clang Code Model")}); CppEditor::CppModelManager::instance()->activateClangCodeModel( std::make_unique<ClangModelManagerSupport>()); createCompilationDBAction(); diff --git a/src/plugins/clangtools/clangtoolsplugin.cpp b/src/plugins/clangtools/clangtoolsplugin.cpp index 35086be7aaf..57b11d61b51 100644 --- a/src/plugins/clangtools/clangtoolsplugin.cpp +++ b/src/plugins/clangtools/clangtoolsplugin.cpp @@ -89,7 +89,7 @@ ClangToolsPlugin::~ClangToolsPlugin() void ClangToolsPlugin::initialize() { - TaskHub::addCategory(taskCategory(), Tr::tr("Clang Tools")); + TaskHub::addCategory({taskCategory(), Tr::tr("Clang Tools")}); // Import tidy/clazy diagnostic configs from CppEditor now // instead of at opening time of the settings page diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 2390096a3fb..b76eb6c932a 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -723,7 +723,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) // Task integration. //: Category under which Analyzer tasks are listed in Issues view - TaskHub::addCategory(ANALYZERTASK_ID, Tr::tr("Debugger")); + TaskHub::addCategory({ANALYZERTASK_ID, Tr::tr("Debugger")}); const Context debuggerNotRunning(C_DEBUGGER_NOTRUNNING); ICore::addAdditionalContext(debuggerNotRunning); @@ -765,8 +765,8 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) act->setEnabled(false); Command *cmd = ActionManager::registerAction(act, Constants::OPEN_MEMORY_EDITOR); - TaskHub::addCategory(TASK_CATEGORY_DEBUGGER_DEBUGINFO, Tr::tr("Debug Information")); - TaskHub::addCategory(TASK_CATEGORY_DEBUGGER_RUNTIME, Tr::tr("Debugger Runtime")); + TaskHub::addCategory({TASK_CATEGORY_DEBUGGER_DEBUGINFO, Tr::tr("Debug Information")}); + TaskHub::addCategory({TASK_CATEGORY_DEBUGGER_RUNTIME, Tr::tr("Debugger Runtime")}); m_debuggerSettings.readSettings(); diff --git a/src/plugins/nim/nimplugin.cpp b/src/plugins/nim/nimplugin.cpp index 53900a35c4a..47138b906a1 100644 --- a/src/plugins/nim/nimplugin.cpp +++ b/src/plugins/nim/nimplugin.cpp @@ -97,7 +97,7 @@ void NimPlugin::extensionsInitialized() FileIconProvider::registerIconOverlayForMimeType(icon, Constants::C_NIM_SCRIPT_MIMETYPE); FileIconProvider::registerIconOverlayForMimeType(icon, Constants::C_NIMBLE_MIMETYPE); } - TaskHub::addCategory(Constants::C_NIMPARSE_ID, "Nim"); + TaskHub::addCategory({Constants::C_NIMPARSE_ID, "Nim"}); } } // namespace Nim diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 5d4e7f5837a..5a9575743fa 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -291,18 +291,18 @@ BuildManager *BuildManager::instance() void BuildManager::extensionsInitialized() { - TaskHub::addCategory(Constants::TASK_CATEGORY_COMPILE, - Tr::tr("Compile", "Category for compiler issues listed under 'Issues'"), - true, 100); - TaskHub::addCategory(Constants::TASK_CATEGORY_BUILDSYSTEM, - Tr::tr("Build System", "Category for build system issues listed under 'Issues'"), - true, 100); - TaskHub::addCategory(Constants::TASK_CATEGORY_DEPLOYMENT, - Tr::tr("Deployment", "Category for deployment issues listed under 'Issues'"), - true, 100); - TaskHub::addCategory(Constants::TASK_CATEGORY_AUTOTEST, - Tr::tr("Autotests", "Category for autotest issues listed under 'Issues'"), - true, 100); + TaskHub::addCategory({Constants::TASK_CATEGORY_COMPILE, + Tr::tr("Compile", "Category for compiler issues listed under 'Issues'"), + true, 100}); + TaskHub::addCategory({Constants::TASK_CATEGORY_BUILDSYSTEM, + Tr::tr("Build System", "Category for build system issues listed under 'Issues'"), + true, 100}); + TaskHub::addCategory({Constants::TASK_CATEGORY_DEPLOYMENT, + Tr::tr("Deployment", "Category for deployment issues listed under 'Issues'"), + true, 100}); + TaskHub::addCategory({Constants::TASK_CATEGORY_AUTOTEST, + Tr::tr("Autotests", "Category for autotest issues listed under 'Issues'"), + true, 100}); } void BuildManager::buildProjectWithoutDependencies(Project *project) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index a143f91b704..bb473b900ea 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2074,9 +2074,9 @@ void ProjectExplorerPlugin::extensionsInitialized() dd->m_projectFilterString = filterStrings.join(filterSeparator); BuildManager::extensionsInitialized(); - TaskHub::addCategory(Constants::TASK_CATEGORY_SANITIZER, - Tr::tr("Sanitizer", "Category for sanitizer issues listed under 'Issues'")); - TaskHub::addCategory(Constants::TASK_CATEGORY_TASKLIST_ID, Tr::tr("My Tasks")); + TaskHub::addCategory({Constants::TASK_CATEGORY_SANITIZER, + Tr::tr("Sanitizer", "Category for sanitizer issues listed under 'Issues'")}); + TaskHub::addCategory({Constants::TASK_CATEGORY_TASKLIST_ID, Tr::tr("My Tasks")}); SshSettings::loadSettings(ICore::settings()); const auto searchPathRetriever = [] { diff --git a/src/plugins/projectexplorer/taskhub.cpp b/src/plugins/projectexplorer/taskhub.cpp index 58e797de803..e7ec30d4779 100644 --- a/src/plugins/projectexplorer/taskhub.cpp +++ b/src/plugins/projectexplorer/taskhub.cpp @@ -107,13 +107,12 @@ TaskHub::~TaskHub() m_instance = nullptr; } -void TaskHub::addCategory(Utils::Id categoryId, const QString &displayName, bool visible, - int priority) +void TaskHub::addCategory(const TaskCategory &category) { - QTC_CHECK(!displayName.isEmpty()); - QTC_ASSERT(!m_registeredCategories.contains(categoryId), return); - m_registeredCategories.push_back(categoryId); - emit m_instance->categoryAdded(categoryId, displayName, visible, priority); + QTC_CHECK(!category.displayName.isEmpty()); + QTC_ASSERT(!m_registeredCategories.contains(category.id), return); + m_registeredCategories.push_back(category.id); + emit m_instance->categoryAdded(category); } TaskHub *TaskHub::instance() diff --git a/src/plugins/projectexplorer/taskhub.h b/src/plugins/projectexplorer/taskhub.h index 60cb09b4bad..1822129bc26 100644 --- a/src/plugins/projectexplorer/taskhub.h +++ b/src/plugins/projectexplorer/taskhub.h @@ -12,6 +12,15 @@ namespace ProjectExplorer { class ProjectExplorerPlugin; +class PROJECTEXPLORER_EXPORT TaskCategory +{ +public: + Utils::Id id; + QString displayName; + bool visible = true; + int priority = 0; +}; + class PROJECTEXPLORER_EXPORT TaskHub : public QObject { Q_OBJECT @@ -28,8 +37,7 @@ public slots: static void removeTask(const ProjectExplorer::Task &task); public: - static void addCategory(Utils::Id categoryId, const QString &displayName, bool visible = true, - int priority = 0); + static void addCategory(const TaskCategory &category); static void updateTaskFileName(const Task &task, const QString &fileName); static void updateTaskLineNumber(const Task &task, int line); static void taskMarkClicked(const Task &task); @@ -39,8 +47,7 @@ public: static void requestPopup(); signals: - void categoryAdded(Utils::Id categoryId, const QString &displayName, bool visible, - int priority); + void categoryAdded(const TaskCategory &category); void taskAdded(const ProjectExplorer::Task &task); void taskRemoved(const ProjectExplorer::Task &task); void tasksCleared(Utils::Id categoryId); diff --git a/src/plugins/projectexplorer/taskmodel.cpp b/src/plugins/projectexplorer/taskmodel.cpp index 11591e707d7..83620030543 100644 --- a/src/plugins/projectexplorer/taskmodel.cpp +++ b/src/plugins/projectexplorer/taskmodel.cpp @@ -60,13 +60,13 @@ bool TaskModel::hasFile(const QModelIndex &index) const return !m_tasks.at(row).file.isEmpty(); } -void TaskModel::addCategory(Utils::Id categoryId, const QString &categoryName, int priority) +void TaskModel::addCategory(const TaskCategory &category) { - QTC_ASSERT(categoryId.isValid(), return); + QTC_ASSERT(category.id.isValid(), return); CategoryData data; - data.displayName = categoryName; - data.priority = priority; - m_categories.insert(categoryId, data); + data.displayName = category.displayName; + data.priority = category.priority; + m_categories.insert(category.id, data); } Tasks TaskModel::tasks(Utils::Id categoryId) const diff --git a/src/plugins/projectexplorer/taskmodel.h b/src/plugins/projectexplorer/taskmodel.h index 5fa37c02d1a..d1996ac1751 100644 --- a/src/plugins/projectexplorer/taskmodel.h +++ b/src/plugins/projectexplorer/taskmodel.h @@ -11,6 +11,8 @@ #include "task.h" namespace ProjectExplorer { +class TaskCategory; + namespace Internal { class TaskModel : public QAbstractItemModel @@ -31,7 +33,7 @@ public: QList<Utils::Id> categoryIds() const; QString categoryDisplayName(Utils::Id categoryId) const; - void addCategory(Utils::Id categoryId, const QString &categoryName, int priority); + void addCategory(const TaskCategory &category); Tasks tasks(Utils::Id categoryId = Utils::Id()) const; void addTask(const Task &t); diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 703a277f159..fc866a6588f 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -365,12 +365,12 @@ void TaskWindow::visibilityChanged(bool visible) delayedInitialization(); } -void TaskWindow::addCategory(Id categoryId, const QString &displayName, bool visible, int priority) +void TaskWindow::addCategory(const TaskCategory &category) { - d->m_model->addCategory(categoryId, displayName, priority); - if (!visible) { + d->m_model->addCategory(category); + if (!category.visible) { QList<Id> filters = d->m_filter->filteredCategories(); - filters += categoryId; + filters += category.id; d->m_filter->setFilteredCategories(filters); } } diff --git a/src/plugins/projectexplorer/taskwindow.h b/src/plugins/projectexplorer/taskwindow.h index c2e7a78a242..3f0c6586677 100644 --- a/src/plugins/projectexplorer/taskwindow.h +++ b/src/plugins/projectexplorer/taskwindow.h @@ -14,6 +14,7 @@ class QPoint; QT_END_NAMESPACE namespace ProjectExplorer { +class TaskCategory; class TaskHub; class Task; @@ -60,7 +61,7 @@ signals: private: void updateFilter() override; - void addCategory(Utils::Id categoryId, const QString &displayName, bool visible, int priority); + void addCategory(const TaskCategory &category); void addTask(const ProjectExplorer::Task &task); void removeTask(const ProjectExplorer::Task &task); void updatedTaskFileName(const Task &task, const QString &fileName); diff --git a/src/plugins/python/pythonplugin.cpp b/src/plugins/python/pythonplugin.cpp index 3cbbe817f9d..55377c57222 100644 --- a/src/plugins/python/pythonplugin.cpp +++ b/src/plugins/python/pythonplugin.cpp @@ -70,7 +70,7 @@ void PythonPlugin::extensionsInitialized() ::Constants::FILEOVERLAY_PY); FileIconProvider::registerIconOverlayForSuffix(imageFile, "py"); - TaskHub::addCategory(PythonErrorTaskCategory, "Python", true); + TaskHub::addCategory({PythonErrorTaskCategory, "Python", true}); } } // Python::Internal diff --git a/src/plugins/qmldesigner/assetexporterplugin/assetexporterplugin.cpp b/src/plugins/qmldesigner/assetexporterplugin/assetexporterplugin.cpp index 3ab1d1a6869..6e66a9bba17 100644 --- a/src/plugins/qmldesigner/assetexporterplugin/assetexporterplugin.cpp +++ b/src/plugins/qmldesigner/assetexporterplugin/assetexporterplugin.cpp @@ -38,8 +38,8 @@ namespace QmlDesigner { AssetExporterPlugin::AssetExporterPlugin() { - ProjectExplorer::TaskHub::addCategory( Constants::TASK_CATEGORY_ASSET_EXPORT, - tr("Asset Export"), false); + ProjectExplorer::TaskHub::addCategory({Constants::TASK_CATEGORY_ASSET_EXPORT, + tr("Asset Export"), false}); auto *designerPlugin = QmlDesigner::QmlDesignerPlugin::instance(); auto &viewManager = designerPlugin->viewManager(); diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp index d695989825d..d0393e2df2a 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.cpp +++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp @@ -205,8 +205,8 @@ void QmlJSEditorPlugin::extensionsInitialized() FileIconProvider::registerIconOverlayForMimeType(ProjectExplorer::Constants::FILEOVERLAY_UI, "application/x-qt.ui+qml"); - TaskHub::addCategory(Constants::TASK_CATEGORY_QML, Tr::tr("QML")); - TaskHub::addCategory(Constants::TASK_CATEGORY_QML_ANALYSIS, Tr::tr("QML Analysis"), false); + TaskHub::addCategory({Constants::TASK_CATEGORY_QML, Tr::tr("QML")}); + TaskHub::addCategory({Constants::TASK_CATEGORY_QML_ANALYSIS, Tr::tr("QML Analysis"), false}); QmllsSettingsManager::instance()->setupAutoupdate(); } From 5b79efd0d61edc2e19ff624a6ea668b05f47f1d8 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 11 Jul 2023 13:43:18 +0200 Subject: [PATCH 0258/1777] Tasks: Save TaskCategory objects in the model So data can be accessed more directly, instead of going through individual methods categoryIds and categoryDisplayName. Change-Id: Idb36050762e507480ba69de6a32b5f6f9bec8b75 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/taskmodel.cpp | 19 ++++++------------- src/plugins/projectexplorer/taskmodel.h | 7 +++---- src/plugins/projectexplorer/taskwindow.cpp | 22 +++++++--------------- 3 files changed, 16 insertions(+), 32 deletions(-) diff --git a/src/plugins/projectexplorer/taskmodel.cpp b/src/plugins/projectexplorer/taskmodel.cpp index 83620030543..06962dd13fa 100644 --- a/src/plugins/projectexplorer/taskmodel.cpp +++ b/src/plugins/projectexplorer/taskmodel.cpp @@ -64,8 +64,7 @@ void TaskModel::addCategory(const TaskCategory &category) { QTC_ASSERT(category.id.isValid(), return); CategoryData data; - data.displayName = category.displayName; - data.priority = category.priority; + data.category = category; m_categories.insert(category.id, data); } @@ -88,8 +87,8 @@ bool TaskModel::compareTasks(const Task &task1, const Task &task2) return task1.taskId < task2.taskId; // Higher-priority task should appear higher up in the view and thus compare less-than. - const int prio1 = m_categories.value(task1.category).priority; - const int prio2 = m_categories.value(task2.category).priority; + const int prio1 = m_categories.value(task1.category).category.priority; + const int prio2 = m_categories.value(task2.category).category.priority; if (prio1 < prio2) return false; if (prio1 > prio2) @@ -296,16 +295,10 @@ Tasks TaskModel::tasks(const QModelIndexList &indexes) const [](const Task &t) { return !t.isNull(); }); } -QList<Utils::Id> TaskModel::categoryIds() const +QList<TaskCategory> TaskModel::categories() const { - QList<Utils::Id> categories = m_categories.keys(); - categories.removeAll(Utils::Id()); // remove global category we added for bookkeeping - return categories; -} - -QString TaskModel::categoryDisplayName(Utils::Id categoryId) const -{ - return m_categories.value(categoryId).displayName; + const QList<TaskCategory> cat = Utils::transform<QList>(m_categories, &CategoryData::category); + return Utils::filtered(cat, [](const TaskCategory &c) { return c.id.isValid(); }); } int TaskModel::sizeOfFile(const QFont &font) diff --git a/src/plugins/projectexplorer/taskmodel.h b/src/plugins/projectexplorer/taskmodel.h index d1996ac1751..30ef961eae6 100644 --- a/src/plugins/projectexplorer/taskmodel.h +++ b/src/plugins/projectexplorer/taskmodel.h @@ -9,6 +9,7 @@ #include <QRegularExpression> #include "task.h" +#include "taskhub.h" namespace ProjectExplorer { class TaskCategory; @@ -31,8 +32,7 @@ public: Task task(const QModelIndex &index) const; Tasks tasks(const QModelIndexList &indexes) const; - QList<Utils::Id> categoryIds() const; - QString categoryDisplayName(Utils::Id categoryId) const; + QList<TaskCategory> categories() const; void addCategory(const TaskCategory &category); Tasks tasks(Utils::Id categoryId = Utils::Id()) const; @@ -86,8 +86,7 @@ private: errors = 0; } - QString displayName; - int priority = 0; + TaskCategory category; int count = 0; int warnings = 0; int errors = 0; diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index fc866a6588f..7e41ef26cff 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -465,27 +465,19 @@ void TaskWindow::setShowWarnings(bool show) void TaskWindow::updateCategoriesMenu() { - using NameToIdsConstIt = QMap<QString, Id>::ConstIterator; - d->m_categoriesMenu->clear(); const QList<Id> filteredCategories = d->m_filter->filteredCategories(); + const QList<TaskCategory> categories = Utils::sorted(d->m_model->categories(), + &TaskCategory::displayName); - QMap<QString, Id> nameToIds; - const QList<Id> ids = d->m_model->categoryIds(); - for (const Id categoryId : ids) - nameToIds.insert(d->m_model->categoryDisplayName(categoryId), categoryId); - - const NameToIdsConstIt cend = nameToIds.constEnd(); - for (NameToIdsConstIt it = nameToIds.constBegin(); it != cend; ++it) { - const QString &displayName = it.key(); - const Id categoryId = it.value(); + for (const TaskCategory &c : categories) { auto action = new QAction(d->m_categoriesMenu); action->setCheckable(true); - action->setText(displayName); - action->setChecked(!filteredCategories.contains(categoryId)); - connect(action, &QAction::triggered, this, [this, action, categoryId] { - setCategoryVisibility(categoryId, action->isChecked()); + action->setText(c.displayName); + action->setChecked(!filteredCategories.contains(c.id)); + connect(action, &QAction::triggered, this, [this, action, id = c.id] { + setCategoryVisibility(id, action->isChecked()); }); d->m_categoriesMenu->addAction(action); } From 9144706000fff0ff688942dd8c3d14d4236b3280 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 11 Jul 2023 13:54:30 +0200 Subject: [PATCH 0259/1777] Make showing tool tips for menu items more widely available Change-Id: Ic9fcb61917c955a2b114c3a355dbdf5c291d75f3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/execmenu.cpp | 12 ++++++++++++ src/libs/utils/execmenu.h | 1 + src/plugins/coreplugin/locator/locatorwidget.cpp | 9 ++++----- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/libs/utils/execmenu.cpp b/src/libs/utils/execmenu.cpp index d607a8de69a..13d79152953 100644 --- a/src/libs/utils/execmenu.cpp +++ b/src/libs/utils/execmenu.cpp @@ -3,6 +3,8 @@ #include "execmenu.h" +#include "tooltip/tooltip.h" + #include <QMenu> #include <QPoint> #include <QRect> @@ -41,4 +43,14 @@ QAction *execMenuAtWidget(QMenu *menu, QWidget *widget) return menu->exec(p); } +/*! + Adds tool tips to the menu that show the actions tool tip when hovering over an entry. + */ +void addToolTipsToMenu(QMenu *menu) +{ + QObject::connect(menu, &QMenu::hovered, menu, [menu](QAction *action) { + ToolTip::show(menu->mapToGlobal(menu->actionGeometry(action).topRight()), action->toolTip()); + }); +} + } // namespace Utils diff --git a/src/libs/utils/execmenu.h b/src/libs/utils/execmenu.h index 90fac94c0e8..9ad63d88ead 100644 --- a/src/libs/utils/execmenu.h +++ b/src/libs/utils/execmenu.h @@ -14,5 +14,6 @@ QT_END_NAMESPACE namespace Utils { QTCREATOR_UTILS_EXPORT QAction *execMenuAtWidget(QMenu *menu, QWidget *widget); +QTCREATOR_UTILS_EXPORT void addToolTipsToMenu(QMenu *menu); } // namespace Utils diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index 8af3f4b753d..67a2eba5bb2 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -13,6 +13,7 @@ #include "../modemanager.h" #include <utils/algorithm.h> +#include <utils/execmenu.h> #include <utils/fancylineedit.h> #include <utils/fsengine/fileiconprovider.h> #include <utils/highlightingitemdelegate.h> @@ -22,7 +23,6 @@ #include <utils/qtcassert.h> #include <utils/tooltip/tooltip.h> #include <utils/utilsicons.h> - #include <QAction> #include <QApplication> #include <QColor> @@ -584,13 +584,12 @@ LocatorWidget::LocatorWidget(Locator *locator) m_centeredPopupAction->setCheckable(true); m_centeredPopupAction->setChecked(Locator::useCenteredPopupForShortcut()); + connect(m_filterMenu, &QMenu::aboutToShow, this, [this] { m_centeredPopupAction->setChecked(Locator::useCenteredPopupForShortcut()); }); - connect(m_filterMenu, &QMenu::hovered, this, [this](QAction *action) { - ToolTip::show(m_filterMenu->mapToGlobal(m_filterMenu->actionGeometry(action).topRight()), - action->toolTip()); - }); + Utils::addToolTipsToMenu(m_filterMenu); + connect(m_centeredPopupAction, &QAction::toggled, locator, [locator](bool toggled) { if (toggled != Locator::useCenteredPopupForShortcut()) { Locator::setUseCenteredPopupForShortcut(toggled); From f3654b8fd243f399bf35a8c3186d4f057a0d99c5 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Mon, 5 Jun 2023 23:14:51 +0200 Subject: [PATCH 0260/1777] Autotest: Use LayoutBuilder in ProjectTestSettingsWidget Change-Id: If9f67564323835334e123178806467a999ab73a1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../autotest/projectsettingswidget.cpp | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/src/plugins/autotest/projectsettingswidget.cpp b/src/plugins/autotest/projectsettingswidget.cpp index da988928dc4..53870990b5d 100644 --- a/src/plugins/autotest/projectsettingswidget.cpp +++ b/src/plugins/autotest/projectsettingswidget.cpp @@ -10,11 +10,10 @@ #include "testtreemodel.h" #include <utils/algorithm.h> +#include <utils/layoutbuilder.h> #include <utils/qtcassert.h> -#include <QBoxLayout> #include <QComboBox> -#include <QLabel> #include <QTreeWidget> namespace Autotest { @@ -25,46 +24,45 @@ enum ItemDataRole { BaseTypeRole }; -static QSpacerItem *createSpacer(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical) -{ - return new QSpacerItem(20, 10, horizontal, vertical); -} - ProjectTestSettingsWidget::ProjectTestSettingsWidget(ProjectExplorer::Project *project, QWidget *parent) : ProjectExplorer::ProjectSettingsWidget(parent) , m_projectSettings(AutotestPlugin::projectSettings(project)) { setGlobalSettingsId(Constants::AUTOTEST_SETTINGS_ID); - auto verticalLayout = new QVBoxLayout(this); - verticalLayout->setContentsMargins(0, 0, 0, 0); - auto generalWidget = new QWidget; - auto groupBoxLayout = new QVBoxLayout; - groupBoxLayout->setContentsMargins(0, 0, 0, 0); + QWidget *generalWidget; m_activeFrameworks = new QTreeWidget; m_activeFrameworks->setHeaderHidden(true); m_activeFrameworks->setRootIsDecorated(false); - groupBoxLayout->addWidget(new QLabel(Tr::tr("Active frameworks:"))); - groupBoxLayout->addWidget(m_activeFrameworks); - auto horizontalLayout = new QHBoxLayout; - horizontalLayout->addWidget(new QLabel(Tr::tr("Automatically run tests after build"))); m_runAfterBuild = new QComboBox; m_runAfterBuild->addItem(Tr::tr("None")); m_runAfterBuild->addItem(Tr::tr("All")); m_runAfterBuild->addItem(Tr::tr("Selected")); m_runAfterBuild->setCurrentIndex(int(m_projectSettings->runAfterBuild())); - horizontalLayout->addWidget(m_runAfterBuild); - horizontalLayout->addItem(createSpacer(QSizePolicy::Expanding, QSizePolicy::Minimum)); - groupBoxLayout->addLayout(horizontalLayout); - generalWidget->setLayout(groupBoxLayout); - horizontalLayout = new QHBoxLayout; - verticalLayout->addItem(createSpacer(QSizePolicy::Minimum, QSizePolicy::Fixed)); - horizontalLayout->addWidget(generalWidget); - horizontalLayout->addItem(createSpacer(QSizePolicy::Expanding, QSizePolicy::Minimum)); - verticalLayout->addLayout(horizontalLayout); - verticalLayout->addItem(createSpacer(QSizePolicy::Minimum, QSizePolicy::Expanding)); + using namespace Layouting; + Column { + Widget { + bindTo(&generalWidget), + Column { + Row { + Group { + title(Tr::tr("Active frameworks:")), + Column { m_activeFrameworks }, + }, + st, + }, + Row { + Tr::tr("Automatically run tests after build"), + m_runAfterBuild, + st, + }, + noMargin(), + }, + }, + noMargin(), + }.attachTo(this); generalWidget->setDisabled(m_projectSettings->useGlobalSettings()); From 345c946255280946ed09a68b6dffbbce429be31d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 29 Jun 2023 18:05:07 +0200 Subject: [PATCH 0261/1777] ProjectExplorer: Use direct aspect registration in ProcessStep Task-number: QTCREATORBUG-29168 Change-Id: If83acc092689a935cf81c8133d6a07d802a07177 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/projectexplorer/processstep.cpp | 107 ++++++++++---------- src/plugins/projectexplorer/processstep.h | 6 +- 2 files changed, 53 insertions(+), 60 deletions(-) diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index a34ff10b611..e2aa69dff9b 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -11,13 +11,11 @@ #include "projectexplorertr.h" #include <utils/aspects.h> -#include <utils/fileutils.h> #include <utils/outputformatter.h> using namespace Utils; -namespace ProjectExplorer { -namespace Internal { +namespace ProjectExplorer::Internal { const char PROCESS_COMMAND_KEY[] = "ProjectExplorer.ProcessStep.Command"; const char PROCESS_WORKINGDIRECTORY_KEY[] = "ProjectExplorer.ProcessStep.WorkingDirectory"; @@ -26,60 +24,58 @@ const char PROCESS_ARGUMENTS_KEY[] = "ProjectExplorer.ProcessStep.Arguments"; class ProcessStep final : public AbstractProcessStep { public: - ProcessStep(BuildStepList *bsl, Id id); + ProcessStep(BuildStepList *bsl, Id id) + : AbstractProcessStep(bsl, id) + { + command.setSettingsKey(PROCESS_COMMAND_KEY); + command.setLabelText(Tr::tr("Command:")); + command.setExpectedKind(PathChooser::Command); + command.setHistoryCompleter("PE.ProcessStepCommand.History"); - void setupOutputFormatter(OutputFormatter *formatter) final; + arguments.setSettingsKey(PROCESS_ARGUMENTS_KEY); + arguments.setDisplayStyle(StringAspect::LineEditDisplay); + arguments.setLabelText(Tr::tr("Arguments:")); + + workingDirectory.setSettingsKey(PROCESS_WORKINGDIRECTORY_KEY); + workingDirectory.setValue(Constants::DEFAULT_WORKING_DIR); + workingDirectory.setLabelText(Tr::tr("Working directory:")); + workingDirectory.setExpectedKind(PathChooser::Directory); + + setWorkingDirectoryProvider([this] { + const FilePath workingDir = workingDirectory(); + if (workingDir.isEmpty()) + return FilePath::fromString(fallbackWorkingDirectory()); + return workingDir; + }); + + setCommandLineProvider([this] { + return CommandLine{command(), arguments(), CommandLine::Raw}; + }); + + setSummaryUpdater([this] { + QString display = displayName(); + if (display.isEmpty()) + display = Tr::tr("Custom Process Step"); + ProcessParameters param; + setupProcessParameters(¶m); + return param.summary(display); + }); + + addMacroExpander(); + } + +private: + void setupOutputFormatter(OutputFormatter *formatter) final + { + formatter->addLineParsers(kit()->createOutputParsers()); + AbstractProcessStep::setupOutputFormatter(formatter); + } + + FilePathAspect command{this}; + StringAspect arguments{this}; + FilePathAspect workingDirectory{this}; }; -ProcessStep::ProcessStep(BuildStepList *bsl, Id id) - : AbstractProcessStep(bsl, id) -{ - auto command = addAspect<FilePathAspect>(); - command->setSettingsKey(PROCESS_COMMAND_KEY); - command->setLabelText(Tr::tr("Command:")); - command->setExpectedKind(PathChooser::Command); - command->setHistoryCompleter("PE.ProcessStepCommand.History"); - - auto arguments = addAspect<StringAspect>(); - arguments->setSettingsKey(PROCESS_ARGUMENTS_KEY); - arguments->setDisplayStyle(StringAspect::LineEditDisplay); - arguments->setLabelText(Tr::tr("Arguments:")); - - auto workingDirectory = addAspect<FilePathAspect>(); - workingDirectory->setSettingsKey(PROCESS_WORKINGDIRECTORY_KEY); - workingDirectory->setValue(Constants::DEFAULT_WORKING_DIR); - workingDirectory->setLabelText(Tr::tr("Working directory:")); - workingDirectory->setExpectedKind(PathChooser::Directory); - - setWorkingDirectoryProvider([this, workingDirectory] { - const FilePath workingDir = workingDirectory->filePath(); - if (workingDir.isEmpty()) - return FilePath::fromString(fallbackWorkingDirectory()); - return workingDir; - }); - - setCommandLineProvider([command, arguments] { - return CommandLine{command->filePath(), arguments->value(), CommandLine::Raw}; - }); - - setSummaryUpdater([this] { - QString display = displayName(); - if (display.isEmpty()) - display = Tr::tr("Custom Process Step"); - ProcessParameters param; - setupProcessParameters(¶m); - return param.summary(display); - }); - - addMacroExpander(); -} - -void ProcessStep::setupOutputFormatter(OutputFormatter *formatter) -{ - formatter->addLineParsers(kit()->createOutputParsers()); - AbstractProcessStep::setupOutputFormatter(formatter); -} - // ProcessStepFactory ProcessStepFactory::ProcessStepFactory() @@ -89,5 +85,4 @@ ProcessStepFactory::ProcessStepFactory() setDisplayName(Tr::tr("Custom Process Step")); } -} // Internal -} // ProjectExplorer +} // ProjectExplorer::Internal diff --git a/src/plugins/projectexplorer/processstep.h b/src/plugins/projectexplorer/processstep.h index 40384383057..04e9b7183ce 100644 --- a/src/plugins/projectexplorer/processstep.h +++ b/src/plugins/projectexplorer/processstep.h @@ -5,8 +5,7 @@ #include "buildstep.h" -namespace ProjectExplorer { -namespace Internal { +namespace ProjectExplorer::Internal { class ProcessStepFactory final : public BuildStepFactory { @@ -14,5 +13,4 @@ public: ProcessStepFactory(); }; -} // namespace Internal -} // namespace ProjectExplorer +} // ProjectExplorer::Internal From 14e18fc92fca6074cab15f382b51d996eaa8df6a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 11 Jul 2023 12:40:08 +0200 Subject: [PATCH 0262/1777] AutoTest: Merge settings and tools hierarchies [1/2] Currently living in the settings files to keep changes small, will be renamed in a second step. This allows the settings aspects to be used in their short form and overall removes some indirections. Change-Id: I099369b62239aed8192613a04bca958a660c36c7 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/autotest/CMakeLists.txt | 5 - src/plugins/autotest/autotestplugin.cpp | 22 ++--- src/plugins/autotest/autotestunittests.cpp | 4 +- .../autotest/boost/boosttestconfiguration.cpp | 22 ++--- .../autotest/boost/boosttestframework.cpp | 40 -------- .../autotest/boost/boosttestframework.h | 28 ------ .../autotest/boost/boosttestsettings.cpp | 64 +++++++++++-- .../autotest/boost/boosttestsettings.h | 14 ++- .../autotest/catch/catchconfiguration.cpp | 36 ++++---- src/plugins/autotest/catch/catchframework.cpp | 39 -------- src/plugins/autotest/catch/catchframework.h | 30 ------ .../autotest/catch/catchtestparser.cpp | 2 +- .../autotest/catch/catchtestsettings.cpp | 58 +++++++++++- .../autotest/catch/catchtestsettings.h | 16 +++- src/plugins/autotest/ctest/ctestsettings.cpp | 64 ++++++++++++- src/plugins/autotest/ctest/ctestsettings.h | 19 +++- src/plugins/autotest/ctest/ctesttool.cpp | 43 --------- src/plugins/autotest/ctest/ctesttool.h | 31 ------- src/plugins/autotest/ctest/ctesttreeitem.cpp | 2 +- .../autotest/gtest/gtestconfiguration.cpp | 18 ++-- src/plugins/autotest/gtest/gtestframework.cpp | 75 --------------- src/plugins/autotest/gtest/gtestframework.h | 33 ------- src/plugins/autotest/gtest/gtestsettings.cpp | 92 +++++++++++++++++-- src/plugins/autotest/gtest/gtestsettings.h | 22 ++++- src/plugins/autotest/gtest/gtesttreeitem.cpp | 14 +-- src/plugins/autotest/itestframework.cpp | 10 +- src/plugins/autotest/itestframework.h | 7 +- .../autotest/qtest/qttestconfiguration.cpp | 22 ++--- .../autotest/qtest/qttestframework.cpp | 48 ---------- src/plugins/autotest/qtest/qttestframework.h | 29 ------ src/plugins/autotest/qtest/qttestsettings.cpp | 68 +++++++++++++- src/plugins/autotest/qtest/qttestsettings.h | 16 +++- .../autotest/quick/quicktestconfiguration.cpp | 18 ++-- .../autotest/quick/quicktestframework.cpp | 17 ++-- .../autotest/quick/quicktestframework.h | 9 +- .../autotest/quick/quicktestparser.cpp | 4 +- src/plugins/autotest/testframeworkmanager.cpp | 15 +-- 37 files changed, 489 insertions(+), 567 deletions(-) delete mode 100644 src/plugins/autotest/boost/boosttestframework.cpp delete mode 100644 src/plugins/autotest/boost/boosttestframework.h delete mode 100644 src/plugins/autotest/catch/catchframework.cpp delete mode 100644 src/plugins/autotest/catch/catchframework.h delete mode 100644 src/plugins/autotest/ctest/ctesttool.cpp delete mode 100644 src/plugins/autotest/ctest/ctesttool.h delete mode 100644 src/plugins/autotest/gtest/gtestframework.cpp delete mode 100644 src/plugins/autotest/gtest/gtestframework.h delete mode 100644 src/plugins/autotest/qtest/qttestframework.cpp delete mode 100644 src/plugins/autotest/qtest/qttestframework.h diff --git a/src/plugins/autotest/CMakeLists.txt b/src/plugins/autotest/CMakeLists.txt index bbad11ff0dd..8ded823a8cf 100644 --- a/src/plugins/autotest/CMakeLists.txt +++ b/src/plugins/autotest/CMakeLists.txt @@ -13,7 +13,6 @@ add_qtc_plugin(AutoTest boost/boostcodeparser.cpp boost/boostcodeparser.h boost/boosttestconfiguration.cpp boost/boosttestconfiguration.h boost/boosttestconstants.h - boost/boosttestframework.cpp boost/boosttestframework.h boost/boosttestoutputreader.cpp boost/boosttestoutputreader.h boost/boosttestparser.cpp boost/boosttestparser.h boost/boosttestresult.cpp boost/boosttestresult.h @@ -21,19 +20,16 @@ add_qtc_plugin(AutoTest boost/boosttesttreeitem.cpp boost/boosttesttreeitem.h catch/catchcodeparser.cpp catch/catchcodeparser.h catch/catchconfiguration.cpp catch/catchconfiguration.h - catch/catchframework.h catch/catchframework.cpp catch/catchoutputreader.h catch/catchoutputreader.cpp catch/catchresult.h catch/catchresult.cpp catch/catchtestparser.h catch/catchtestparser.cpp catch/catchtreeitem.h catch/catchtreeitem.cpp catch/catchtestsettings.cpp catch/catchtestsettings.h ctest/ctestconfiguration.cpp ctest/ctestconfiguration.h ctest/ctestoutputreader.cpp ctest/ctestoutputreader.h ctest/ctestsettings.cpp ctest/ctestsettings.h - ctest/ctesttool.cpp ctest/ctesttool.h ctest/ctesttreeitem.cpp ctest/ctesttreeitem.h gtest/gtest_utils.cpp gtest/gtest_utils.h gtest/gtestconfiguration.cpp gtest/gtestconfiguration.h gtest/gtestconstants.h - gtest/gtestframework.cpp gtest/gtestframework.h gtest/gtestoutputreader.cpp gtest/gtestoutputreader.h gtest/gtestparser.cpp gtest/gtestparser.h gtest/gtestresult.cpp gtest/gtestresult.h @@ -47,7 +43,6 @@ add_qtc_plugin(AutoTest qtest/qttest_utils.cpp qtest/qttest_utils.h qtest/qttestconfiguration.cpp qtest/qttestconfiguration.h qtest/qttestconstants.h - qtest/qttestframework.cpp qtest/qttestframework.h qtest/qttestoutputreader.cpp qtest/qttestoutputreader.h qtest/qttestparser.cpp qtest/qttestparser.h qtest/qttestresult.cpp qtest/qttestresult.h diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index cb318c96b6a..1211b7f5e48 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -18,11 +18,11 @@ #include "testtreeitem.h" #include "testtreemodel.h" -#include "boost/boosttestframework.h" -#include "catch/catchframework.h" -#include "ctest/ctesttool.h" -#include "gtest/gtestframework.h" -#include "qtest/qttestframework.h" +#include "boost/boosttestsettings.h" +#include "catch/catchtestsettings.h" +#include "ctest/ctestsettings.h" +#include "gtest/gtestsettings.h" +#include "qtest/qttestsettings.h" #include "quick/quicktestframework.h" #include <coreplugin/actionmanager/actioncontainer.h> @@ -128,13 +128,13 @@ AutotestPluginPrivate::AutotestPluginPrivate() { dd = this; // Needed as the code below access it via the static plugin interface initializeMenuEntries(); - m_frameworkManager.registerTestFramework(new QtTestFramework); - m_frameworkManager.registerTestFramework(new QuickTestFramework); - m_frameworkManager.registerTestFramework(new GTestFramework); - m_frameworkManager.registerTestFramework(new BoostTestFramework); - m_frameworkManager.registerTestFramework(new CatchFramework); + m_frameworkManager.registerTestFramework(&theQtTestFramework()); + m_frameworkManager.registerTestFramework(&theQuickTestFramework()); + m_frameworkManager.registerTestFramework(&theGTestFramework()); + m_frameworkManager.registerTestFramework(&theBoostTestFramework()); + m_frameworkManager.registerTestFramework(&theCatchFramework()); - m_frameworkManager.registerTestTool(new CTestTool); + m_frameworkManager.registerTestTool(&theCTestTool()); m_frameworkManager.synchronizeSettings(); m_resultsPane = TestResultsPane::instance(); diff --git a/src/plugins/autotest/autotestunittests.cpp b/src/plugins/autotest/autotestunittests.cpp index 50d0b496c21..9834a6ea681 100644 --- a/src/plugins/autotest/autotestunittests.cpp +++ b/src/plugins/autotest/autotestunittests.cpp @@ -78,8 +78,8 @@ void AutoTestUnitTests::initTestCase() // Enable quick check for derived tests static const Id id = Id("AutoTest.Framework.QtTest"); - static_cast<Autotest::Internal::QtTestSettings *>( - TestFrameworkManager::frameworkForId(id)->testSettings()) + static_cast<Autotest::Internal::QtTestFramework *>( + TestFrameworkManager::frameworkForId(id)) ->quickCheckForDerivedTests.setValue(true); } diff --git a/src/plugins/autotest/boost/boosttestconfiguration.cpp b/src/plugins/autotest/boost/boosttestconfiguration.cpp index 088506199c8..58cbfb5f313 100644 --- a/src/plugins/autotest/boost/boosttestconfiguration.cpp +++ b/src/plugins/autotest/boost/boosttestconfiguration.cpp @@ -18,10 +18,10 @@ namespace Internal { TestOutputReader *BoostTestConfiguration::createOutputReader(Process *app) const { - auto settings = static_cast<BoostTestSettings *>(framework()->testSettings()); + BoostTestFramework &settings = *static_cast<BoostTestFramework *>(framework()); return new BoostTestOutputReader(app, buildDirectory(), projectFile(), - LogLevel(settings->logLevel.value()), - ReportLevel(settings->reportLevel.value())); + LogLevel(settings.logLevel()), + ReportLevel(settings.reportLevel())); } enum class InterferingType { Options, EnvironmentVariables }; @@ -86,19 +86,19 @@ static QStringList filterInterfering(const QStringList &provided, QStringList *o QStringList BoostTestConfiguration::argumentsForTestRunner(QStringList *omitted) const { - auto boostSettings = static_cast<BoostTestSettings *>(framework()->testSettings()); + BoostTestFramework &boostSettings = *static_cast<BoostTestFramework *>(framework()); QStringList arguments; - arguments << "-l" << BoostTestSettings::logLevelToOption(LogLevel(boostSettings->logLevel())); - arguments << "-r" << BoostTestSettings::reportLevelToOption(ReportLevel(boostSettings->reportLevel())); + arguments << "-l" << BoostTestFramework::logLevelToOption(LogLevel(boostSettings.logLevel())); + arguments << "-r" << BoostTestFramework::reportLevelToOption(ReportLevel(boostSettings.reportLevel())); - if (boostSettings->randomize()) - arguments << QString("--random=").append(QString::number(boostSettings->seed())); + if (boostSettings.randomize()) + arguments << QString("--random=").append(QString::number(boostSettings.seed())); - if (boostSettings->systemErrors()) + if (boostSettings.systemErrors()) arguments << "-s"; - if (boostSettings->fpExceptions()) + if (boostSettings.fpExceptions()) arguments << "--detect_fp_exceptions"; - if (!boostSettings->memLeaks()) + if (!boostSettings.memLeaks()) arguments << "--detect_memory_leaks=0"; // TODO improve the test case gathering and arguments building to avoid too long command lines diff --git a/src/plugins/autotest/boost/boosttestframework.cpp b/src/plugins/autotest/boost/boosttestframework.cpp deleted file mode 100644 index b431bbed76b..00000000000 --- a/src/plugins/autotest/boost/boosttestframework.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2019 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "boosttestframework.h" - -#include "boosttestconstants.h" -#include "boosttesttreeitem.h" -#include "boosttestparser.h" -#include "../autotesttr.h" - -namespace Autotest { -namespace Internal { - -ITestParser *BoostTestFramework::createTestParser() -{ - return new BoostTestParser(this); -} - -ITestTreeItem *BoostTestFramework::createRootNode() -{ - return new BoostTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); -} - -const char *BoostTestFramework::name() const -{ - return BoostTest::Constants::FRAMEWORK_NAME; -} - -QString BoostTestFramework::displayName() const -{ - return Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); -} - -unsigned BoostTestFramework::priority() const -{ - return BoostTest::Constants::FRAMEWORK_PRIORITY; -} - -} // namespace Internal -} // namespace Autotest diff --git a/src/plugins/autotest/boost/boosttestframework.h b/src/plugins/autotest/boost/boosttestframework.h deleted file mode 100644 index da015fbd6f3..00000000000 --- a/src/plugins/autotest/boost/boosttestframework.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2019 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "../itestframework.h" - -#include "boosttestsettings.h" - -namespace Autotest::Internal { - -class BoostTestFramework : public ITestFramework -{ -public: - BoostTestFramework() : ITestFramework(true) {} - -private: - const char *name() const override; - QString displayName() const override; - unsigned priority() const override; - ITestSettings *testSettings() override { return &m_settings; } - ITestParser *createTestParser() override; - ITestTreeItem *createRootNode() override; - - BoostTestSettings m_settings{settingsId()}; -}; - -} // Autotest::Internal diff --git a/src/plugins/autotest/boost/boosttestsettings.cpp b/src/plugins/autotest/boost/boosttestsettings.cpp index 4ff10a90ce8..54c8fa5e498 100644 --- a/src/plugins/autotest/boost/boosttestsettings.cpp +++ b/src/plugins/autotest/boost/boosttestsettings.cpp @@ -4,10 +4,13 @@ #include "boosttestsettings.h" #include "boosttestconstants.h" - +#include "boosttesttreeitem.h" +#include "boosttestparser.h" #include "../autotestconstants.h" #include "../autotesttr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/layoutbuilder.h> using namespace Layouting; @@ -15,11 +18,15 @@ using namespace Utils; namespace Autotest::Internal { -BoostTestSettings::BoostTestSettings(Id settingsId) +BoostTestFramework &theBoostTestFramework() +{ + static BoostTestFramework framework; + return framework; +} + +BoostTestFramework::BoostTestFramework() + : ITestFramework(true) { - setId(settingsId); - setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); - setDisplayName(Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setSettingsGroups("Autotest", "BoostTest"); setLayouter([this] { @@ -88,7 +95,7 @@ BoostTestSettings::BoostTestSettings(Id settingsId) memLeaks.setToolTip(Tr::tr("Enable memory leak detection.")); } -QString BoostTestSettings::logLevelToOption(const LogLevel logLevel) +QString BoostTestFramework::logLevelToOption(const LogLevel logLevel) { switch (logLevel) { case LogLevel::All: return QString("all"); @@ -106,7 +113,7 @@ QString BoostTestSettings::logLevelToOption(const LogLevel logLevel) return {}; } -QString BoostTestSettings::reportLevelToOption(const ReportLevel reportLevel) +QString BoostTestFramework::reportLevelToOption(const ReportLevel reportLevel) { switch (reportLevel) { case ReportLevel::Confirm: return QString("confirm"); @@ -117,4 +124,47 @@ QString BoostTestSettings::reportLevelToOption(const ReportLevel reportLevel) return {}; } +ITestParser *BoostTestFramework::createTestParser() +{ + return new BoostTestParser(this); +} + +ITestTreeItem *BoostTestFramework::createRootNode() +{ + return new BoostTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); +} + +const char *BoostTestFramework::name() const +{ + return BoostTest::Constants::FRAMEWORK_NAME; +} + +QString BoostTestFramework::displayName() const +{ + return Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); +} + +unsigned BoostTestFramework::priority() const +{ + return BoostTest::Constants::FRAMEWORK_PRIORITY; +} + +// BoostSettingsPage + +class BoostSettingsPage final : public Core::IOptionsPage +{ +public: + BoostSettingsPage() + { + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.%2") + .arg(BoostTest::Constants::FRAMEWORK_PRIORITY) + .arg(BoostTest::Constants::FRAMEWORK_NAME))); + setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); + setDisplayName(Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); + setSettingsProvider([] { return &theBoostTestFramework() ; }); + } +}; + +const BoostSettingsPage settingsPage; + } // Autotest::Internal diff --git a/src/plugins/autotest/boost/boosttestsettings.h b/src/plugins/autotest/boost/boosttestsettings.h index e95f98218c2..39e999cb3d4 100644 --- a/src/plugins/autotest/boost/boosttestsettings.h +++ b/src/plugins/autotest/boost/boosttestsettings.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include "../itestframework.h" namespace Autotest::Internal { @@ -30,10 +30,16 @@ enum class ReportLevel No }; -class BoostTestSettings : public Core::PagedSettings +class BoostTestFramework : public ITestFramework { public: - explicit BoostTestSettings(Utils::Id settingsId); + BoostTestFramework(); + + const char *name() const override; + QString displayName() const override; + unsigned priority() const override; + ITestParser *createTestParser() override; + ITestTreeItem *createRootNode() override; static QString logLevelToOption(const LogLevel logLevel); static QString reportLevelToOption(const ReportLevel reportLevel); @@ -47,6 +53,8 @@ public: Utils::BoolAspect memLeaks{this}; }; +BoostTestFramework &theBoostTestFramework(); + } // Autotest::Internal Q_DECLARE_METATYPE(Autotest::Internal::LogLevel) diff --git a/src/plugins/autotest/catch/catchconfiguration.cpp b/src/plugins/autotest/catch/catchconfiguration.cpp index 0cb9aef7c5c..0d073892cb2 100644 --- a/src/plugins/autotest/catch/catchconfiguration.cpp +++ b/src/plugins/autotest/catch/catchconfiguration.cpp @@ -84,32 +84,30 @@ QStringList CatchConfiguration::argumentsForTestRunner(QStringList *omitted) con ' ', Qt::SkipEmptyParts), omitted); } - auto settings = static_cast<CatchTestSettings *>(framework()->testSettings()); - if (!settings) - return arguments; + CatchFramework &settings = *static_cast<CatchFramework *>(framework()); - if (settings->abortAfterChecked.value()) - arguments << "-x" << QString::number(settings->abortAfter.value()); - if (settings->samplesChecked.value()) - arguments << "--benchmark-samples" << QString::number(settings->benchmarkSamples.value()); - if (settings->resamplesChecked.value()) - arguments << "--benchmark-resamples" << QString::number(settings->benchmarkResamples.value()); - if (settings->warmupChecked.value()) - arguments << "--benchmark-warmup-time" << QString::number(settings->benchmarkWarmupTime.value()); - if (settings->confidenceIntervalChecked.value()) - arguments << "--benchmark-confidence-interval" << QString::number(settings->confidenceInterval.value()); - if (settings->noAnalysis.value()) + if (settings.abortAfterChecked()) + arguments << "-x" << QString::number(settings.abortAfter()); + if (settings.samplesChecked()) + arguments << "--benchmark-samples" << QString::number(settings.benchmarkSamples()); + if (settings.resamplesChecked()) + arguments << "--benchmark-resamples" << QString::number(settings.benchmarkResamples()); + if (settings.warmupChecked()) + arguments << "--benchmark-warmup-time" << QString::number(settings.benchmarkWarmupTime()); + if (settings.confidenceIntervalChecked()) + arguments << "--benchmark-confidence-interval" << QString::number(settings.confidenceInterval()); + if (settings.noAnalysis()) arguments << "--benchmark-no-analysis"; - if (settings->showSuccess.value()) + if (settings.showSuccess()) arguments << "-s"; - if (settings->noThrow.value()) + if (settings.noThrow()) arguments << "-e"; - if (settings->visibleWhitespace.value()) + if (settings.visibleWhitespace()) arguments << "-i"; - if (settings->warnOnEmpty.value()) + if (settings.warnOnEmpty()) arguments << "-w" << "NoAssertions"; - if (isDebugRunMode() && settings->breakOnFailure.value()) + if (isDebugRunMode() && settings.breakOnFailure()) arguments << "-b"; return arguments; } diff --git a/src/plugins/autotest/catch/catchframework.cpp b/src/plugins/autotest/catch/catchframework.cpp deleted file mode 100644 index d2afeddaad2..00000000000 --- a/src/plugins/autotest/catch/catchframework.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019 Jochen Seemann -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "catchframework.h" - -#include "catchtestparser.h" -#include "catchtreeitem.h" -#include "../autotesttr.h" - -namespace Autotest { -namespace Internal { - -const char *CatchFramework::name() const -{ - return "Catch"; -} - -QString CatchFramework::displayName() const -{ - return Tr::tr("Catch Test"); -} - -unsigned CatchFramework::priority() const -{ - return 12; -} - -ITestParser *CatchFramework::createTestParser() -{ - return new CatchTestParser(this); -} - -ITestTreeItem *CatchFramework::createRootNode() -{ - return new CatchTreeItem(this, displayName(), {}, ITestTreeItem::Root); -} - -} // namespace Internal -} // namespace Autotest diff --git a/src/plugins/autotest/catch/catchframework.h b/src/plugins/autotest/catch/catchframework.h deleted file mode 100644 index 6bd20b44f6a..00000000000 --- a/src/plugins/autotest/catch/catchframework.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2019 Jochen Seemann -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "../itestframework.h" - -#include "catchtestsettings.h" - -namespace Autotest::Internal { - -class CatchFramework : public ITestFramework -{ -public: - CatchFramework() : ITestFramework(true) {} - - const char *name() const override; - QString displayName() const override; - unsigned priority() const override; - -protected: - ITestParser *createTestParser() override; - ITestTreeItem *createRootNode() override; - -private: - ITestSettings * testSettings() override { return &m_settings; } - CatchTestSettings m_settings{settingsId()}; -}; - -} // Autotest::Internal diff --git a/src/plugins/autotest/catch/catchtestparser.cpp b/src/plugins/autotest/catch/catchtestparser.cpp index a37f8b4ca73..172304eb953 100644 --- a/src/plugins/autotest/catch/catchtestparser.cpp +++ b/src/plugins/autotest/catch/catchtestparser.cpp @@ -4,7 +4,7 @@ #include "catchtestparser.h" #include "catchcodeparser.h" -#include "catchframework.h" +#include "catchtestsettings.h" #include "catchtreeitem.h" #include <cppeditor/cppmodelmanager.h> diff --git a/src/plugins/autotest/catch/catchtestsettings.cpp b/src/plugins/autotest/catch/catchtestsettings.cpp index 5ee4a6acf97..bdca7ae3b33 100644 --- a/src/plugins/autotest/catch/catchtestsettings.cpp +++ b/src/plugins/autotest/catch/catchtestsettings.cpp @@ -3,9 +3,14 @@ #include "catchtestsettings.h" +#include "catchtestparser.h" +#include "catchtreeitem.h" + #include "../autotestconstants.h" #include "../autotesttr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/layoutbuilder.h> using namespace Layouting; @@ -13,11 +18,15 @@ using namespace Utils; namespace Autotest::Internal { -CatchTestSettings::CatchTestSettings(Id settingsId) +CatchFramework &theCatchFramework() +{ + static CatchFramework framework; + return framework; +} + +CatchFramework::CatchFramework() + : ITestFramework(true) { - setId(settingsId); - setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); - setDisplayName(Tr::tr("Catch Test")); setSettingsGroups("Autotest", "Catch2"); setLayouter([this] { @@ -107,4 +116,45 @@ CatchTestSettings::CatchTestSettings(Id settingsId) warnOnEmpty.setToolTip(Tr::tr("Warns if a test section does not check any assertion.")); } +const char *CatchFramework::name() const +{ + return "Catch"; +} + +QString CatchFramework::displayName() const +{ + return Tr::tr("Catch Test"); +} + +unsigned CatchFramework::priority() const +{ + return 12; +} + +ITestParser *CatchFramework::createTestParser() +{ + return new CatchTestParser(this); +} + +ITestTreeItem *CatchFramework::createRootNode() +{ + return new CatchTreeItem(this, displayName(), {}, ITestTreeItem::Root); +} + +// CatchTestSettingsPage + +class CatchTestSettingsPage final : public Core::IOptionsPage +{ +public: + CatchTestSettingsPage() + { + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix("12.Catch")); + setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); + setDisplayName(Tr::tr("Catch Test")); + setSettingsProvider([] { return &theCatchFramework(); }); + } +}; + +const CatchTestSettingsPage settingsPage; + } // Autotest::Internal diff --git a/src/plugins/autotest/catch/catchtestsettings.h b/src/plugins/autotest/catch/catchtestsettings.h index 71c1caf5839..225a99c849f 100644 --- a/src/plugins/autotest/catch/catchtestsettings.h +++ b/src/plugins/autotest/catch/catchtestsettings.h @@ -3,14 +3,14 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include "../itestframework.h" namespace Autotest::Internal { -class CatchTestSettings : public Core::PagedSettings +class CatchFramework : public ITestFramework { public: - explicit CatchTestSettings(Utils::Id settingsId); + CatchFramework(); Utils::IntegerAspect abortAfter{this}; Utils::IntegerAspect benchmarkSamples{this}; @@ -28,6 +28,16 @@ public: Utils::BoolAspect noThrow{this}; Utils::BoolAspect visibleWhitespace{this}; Utils::BoolAspect warnOnEmpty{this}; + + const char *name() const override; + QString displayName() const override; + unsigned priority() const override; + +protected: + ITestParser *createTestParser() override; + ITestTreeItem *createRootNode() override; }; +CatchFramework &theCatchFramework(); + } // Autotest::Internal diff --git a/src/plugins/autotest/ctest/ctestsettings.cpp b/src/plugins/autotest/ctest/ctestsettings.cpp index 70016f79209..aedf929eb84 100644 --- a/src/plugins/autotest/ctest/ctestsettings.cpp +++ b/src/plugins/autotest/ctest/ctestsettings.cpp @@ -3,9 +3,16 @@ #include "ctestsettings.h" +#include "ctesttreeitem.h" #include "../autotestconstants.h" #include "../autotesttr.h" +#include <coreplugin/dialogs/ioptionspage.h> + +#include <cmakeprojectmanager/cmakeprojectconstants.h> + +#include <projectexplorer/buildsystem.h> + #include <utils/layoutbuilder.h> using namespace Layouting; @@ -13,12 +20,16 @@ using namespace Utils; namespace Autotest::Internal { -CTestSettings::CTestSettings(Id settingsId) +CTestTool &theCTestTool() +{ + static CTestTool tool; + return tool; +} + +CTestTool::CTestTool() + : Autotest::ITestTool(false) { setSettingsGroups("Autotest", "CTest"); - setId(settingsId); - setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); - setDisplayName(Tr::tr("CTest")); setLayouter([this] { return Row { Form { @@ -97,7 +108,7 @@ CTestSettings::CTestSettings(Id settingsId) threshold.setEnabler(&testLoad); } -QStringList CTestSettings::activeSettingsAsOptions() const +QStringList CTestTool::activeSettingsAsOptions() const { QStringList options; if (outputOnFail.value()) @@ -133,4 +144,47 @@ QStringList CTestSettings::activeSettingsAsOptions() const return options; } +Id CTestTool::buildSystemId() const +{ + return Id(CMakeProjectManager::Constants::CMAKE_PROJECT_ID); +} + +ITestTreeItem *CTestTool::createItemFromTestCaseInfo(const ProjectExplorer::TestCaseInfo &tci) +{ + CTestTreeItem *item = new CTestTreeItem(this, tci.name, tci.path, TestTreeItem::TestCase); + item->setLine(tci.line); + return item; +} + +const char *CTestTool::name() const +{ + return "CTest"; +} + +QString CTestTool::displayName() const +{ + return Tr::tr("CTest"); +} + +ITestTreeItem *CTestTool::createRootNode() +{ + return new CTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); +} + +// CTestToolSettingsPage + +class CTestToolSettingsPage final : public Core::IOptionsPage +{ +public: + CTestToolSettingsPage() + { + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("255.CTest"))); + setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); + setDisplayName(Tr::tr("CTest")); + setSettingsProvider([] { return &theCTestTool(); }); + } +}; + +const CTestToolSettingsPage settingsPage; + } // Autotest::Internal diff --git a/src/plugins/autotest/ctest/ctestsettings.h b/src/plugins/autotest/ctest/ctestsettings.h index 77de6b0aac8..1549a7db6e1 100644 --- a/src/plugins/autotest/ctest/ctestsettings.h +++ b/src/plugins/autotest/ctest/ctestsettings.h @@ -3,14 +3,23 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include "../itestframework.h" -namespace Autotest::Internal { +namespace Autotest::Internal { -class CTestSettings : public Core::PagedSettings +class CTestTool final : public Autotest::ITestTool { public: - explicit CTestSettings(Utils::Id settingsId); + CTestTool(); + + Utils::Id buildSystemId() const final; + + ITestTreeItem *createItemFromTestCaseInfo(const ProjectExplorer::TestCaseInfo &tci) final; + + const char *name() const final; + QString displayName() const final; + ITestTreeItem *createRootNode() final; + QStringList activeSettingsAsOptions() const; @@ -28,5 +37,7 @@ public: Utils::IntegerAspect threshold{this}; }; +CTestTool &theCTestTool(); + } // Autotest::Internal diff --git a/src/plugins/autotest/ctest/ctesttool.cpp b/src/plugins/autotest/ctest/ctesttool.cpp deleted file mode 100644 index fd2fe675282..00000000000 --- a/src/plugins/autotest/ctest/ctesttool.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "ctesttool.h" -#include "ctesttreeitem.h" -#include "../autotesttr.h" - -#include <cmakeprojectmanager/cmakeprojectconstants.h> - -#include <projectexplorer/buildsystem.h> - -namespace Autotest { -namespace Internal { - -Utils::Id CTestTool::buildSystemId() const -{ - return Utils::Id(CMakeProjectManager::Constants::CMAKE_PROJECT_ID); -} - -ITestTreeItem *CTestTool::createItemFromTestCaseInfo(const ProjectExplorer::TestCaseInfo &tci) -{ - CTestTreeItem *item = new CTestTreeItem(this, tci.name, tci.path, TestTreeItem::TestCase); - item->setLine(tci.line); - return item; -} - -const char *CTestTool::name() const -{ - return "CTest"; -} - -QString CTestTool::displayName() const -{ - return Tr::tr("CTest"); -} - -ITestTreeItem *CTestTool::createRootNode() -{ - return new CTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); -} - -} // namespace Internal -} // namespace Autotest diff --git a/src/plugins/autotest/ctest/ctesttool.h b/src/plugins/autotest/ctest/ctesttool.h deleted file mode 100644 index e7a7f74218a..00000000000 --- a/src/plugins/autotest/ctest/ctesttool.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "../itestframework.h" -#include "ctestsettings.h" - -namespace Autotest::Internal { - -class CTestTool final : public Autotest::ITestTool -{ -public: - CTestTool() : Autotest::ITestTool(false) {} - - Utils::Id buildSystemId() const final; - - ITestTreeItem *createItemFromTestCaseInfo(const ProjectExplorer::TestCaseInfo &tci) final; - -protected: - const char *name() const final; - QString displayName() const final; - ITestTreeItem *createRootNode() final; - -private: - ITestSettings *testSettings() override { return &m_settings; } - - CTestSettings m_settings{settingsId()}; -}; - -} // Autotest::Internal diff --git a/src/plugins/autotest/ctest/ctesttreeitem.cpp b/src/plugins/autotest/ctest/ctesttreeitem.cpp index d95838a5a79..8156d414eec 100644 --- a/src/plugins/autotest/ctest/ctesttreeitem.cpp +++ b/src/plugins/autotest/ctest/ctesttreeitem.cpp @@ -89,7 +89,7 @@ QList<ITestConfiguration *> CTestTreeItem::testConfigurationsFor(const QStringLi const ProjectExplorer::BuildSystem *buildSystem = target->buildSystem(); QStringList options{"--timeout", QString::number(testSettings().timeout() / 1000)}; - auto ctestSettings = static_cast<CTestSettings *>(testBase()->testSettings()); + auto ctestSettings = static_cast<CTestTool *>(testBase()); options << ctestSettings->activeSettingsAsOptions(); CommandLine command = buildSystem->commandLineForTests(selected, options); if (command.executable().isEmpty()) diff --git a/src/plugins/autotest/gtest/gtestconfiguration.cpp b/src/plugins/autotest/gtest/gtestconfiguration.cpp index c2a6b4c0d08..3ce012c7b86 100644 --- a/src/plugins/autotest/gtest/gtestconfiguration.cpp +++ b/src/plugins/autotest/gtest/gtestconfiguration.cpp @@ -67,21 +67,19 @@ QStringList GTestConfiguration::argumentsForTestRunner(QStringList *omitted) con arguments << "--gtest_filter=\"" + testSets.join(':') + '"'; } - auto gSettings = static_cast<GTestSettings *>(framework()->testSettings()); - if (!gSettings) - return arguments; + GTestFramework &gSettings = *static_cast<GTestFramework *>(framework()); - if (gSettings->runDisabled.value()) + if (gSettings.runDisabled()) arguments << "--gtest_also_run_disabled_tests"; - if (gSettings->repeat.value()) - arguments << QString("--gtest_repeat=%1").arg(gSettings->iterations.value()); - if (gSettings->shuffle.value()) - arguments << "--gtest_shuffle" << QString("--gtest_random_seed=%1").arg(gSettings->seed.value()); - if (gSettings->throwOnFailure.value()) + if (gSettings.repeat()) + arguments << QString("--gtest_repeat=%1").arg(gSettings.iterations()); + if (gSettings.shuffle()) + arguments << "--gtest_shuffle" << QString("--gtest_random_seed=%1").arg(gSettings.seed()); + if (gSettings.throwOnFailure()) arguments << "--gtest_throw_on_failure"; if (isDebugRunMode()) { - if (gSettings->breakOnFailure.value()) + if (gSettings.breakOnFailure()) arguments << "--gtest_break_on_failure"; arguments << "--gtest_catch_exceptions=0"; } diff --git a/src/plugins/autotest/gtest/gtestframework.cpp b/src/plugins/autotest/gtest/gtestframework.cpp deleted file mode 100644 index af0a6eaa46c..00000000000 --- a/src/plugins/autotest/gtest/gtestframework.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "gtestframework.h" - -#include "../autotesttr.h" -#include "gtesttreeitem.h" -#include "gtestparser.h" - -#include <QRegularExpression> - -namespace Autotest { -namespace Internal { - -static GTestSettings *g_settings; - -GTestFramework::GTestFramework() - : ITestFramework(true) -{ - g_settings = &m_settings; -} - -ITestParser *GTestFramework::createTestParser() -{ - return new GTestParser(this); -} - -ITestTreeItem *GTestFramework::createRootNode() -{ - return new GTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); -} - -const char *GTestFramework::name() const -{ - return GTest::Constants::FRAMEWORK_NAME; -} - -QString GTestFramework:: displayName() const -{ - return Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); -} - -unsigned GTestFramework::priority() const -{ - return GTest::Constants::FRAMEWORK_PRIORITY; -} - -QString GTestFramework::currentGTestFilter() -{ - return g_settings->gtestFilter.value(); -} - -QString GTestFramework::groupingToolTip() const -{ - return Tr::tr("Enable or disable grouping of test cases by folder or " - "GTest filter.\nSee also Google Test settings."); -} - -GTest::Constants::GroupMode GTestFramework::groupMode() -{ - return GTest::Constants::GroupMode(g_settings->groupMode.itemValue().toInt()); -} - -QStringList GTestFramework::testNameForSymbolName(const QString &symbolName) const -{ - static const QRegularExpression r("^(.+::)?((DISABLED_)?.+?)_((DISABLED_)?.+)_Test::TestBody$"); - const QRegularExpressionMatch match = r.match(symbolName); - if (!match.hasMatch()) - return {}; - - return { match.captured(2), match.captured(4) }; -} - -} // namespace Internal -} // namespace Autotest diff --git a/src/plugins/autotest/gtest/gtestframework.h b/src/plugins/autotest/gtest/gtestframework.h deleted file mode 100644 index 03c8a4fc0d9..00000000000 --- a/src/plugins/autotest/gtest/gtestframework.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "../itestframework.h" -#include "gtestconstants.h" -#include "gtestsettings.h" - -namespace Autotest::Internal { - -class GTestFramework : public ITestFramework -{ -public: - GTestFramework(); - - static GTest::Constants::GroupMode groupMode(); - static QString currentGTestFilter(); - - QStringList testNameForSymbolName(const QString &symbolName) const override; -private: - const char *name() const override; - QString displayName() const override; - unsigned priority() const override; - QString groupingToolTip() const override; - ITestSettings *testSettings() override { return &m_settings; } - ITestParser *createTestParser() override; - ITestTreeItem *createRootNode() override; - - GTestSettings m_settings{settingsId()}; -}; - -} // Autotest::Internal diff --git a/src/plugins/autotest/gtest/gtestsettings.cpp b/src/plugins/autotest/gtest/gtestsettings.cpp index a97515b8d23..1d79a5b40df 100644 --- a/src/plugins/autotest/gtest/gtestsettings.cpp +++ b/src/plugins/autotest/gtest/gtestsettings.cpp @@ -4,11 +4,17 @@ #include "gtestsettings.h" #include "gtest_utils.h" +#include "gtesttreeitem.h" +#include "gtestparser.h" #include "gtestconstants.h" #include "../autotestconstants.h" #include "../autotesttr.h" #include "../testtreemodel.h" +#include <QRegularExpression> + +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/layoutbuilder.h> using namespace Layouting; @@ -16,12 +22,16 @@ using namespace Utils; namespace Autotest::Internal { -GTestSettings::GTestSettings(Id settingsId) +GTestFramework &theGTestFramework() +{ + static GTestFramework framework; + return framework; +} + +GTestFramework::GTestFramework() + : ITestFramework(true) { setSettingsGroups("Autotest", "GTest"); - setId(settingsId); - setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); - setDisplayName(Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setLayouter([this] { return Row { Form { @@ -112,15 +122,83 @@ GTestSettings::GTestSettings(Id settingsId) return edit && GTestUtils::isValidGTestFilter(edit->text()); }); - QObject::connect(&groupMode, &SelectionAspect::volatileValueChanged, >estFilter, [this] { + connect(&groupMode, &SelectionAspect::volatileValueChanged, >estFilter, [this] { gtestFilter.setEnabled(groupMode.itemValueForIndex(groupMode.volatileValue()) == GTest::Constants::GTestFilter); }); - - QObject::connect(this, &AspectContainer::applied, this, [] { + connect(this, &AspectContainer::applied, this, [] { Id id = Id(Constants::FRAMEWORK_PREFIX).withSuffix(GTest::Constants::FRAMEWORK_NAME); TestTreeModel::instance()->rebuild({id}); }); } +ITestParser *GTestFramework::createTestParser() +{ + return new GTestParser(this); +} + +ITestTreeItem *GTestFramework::createRootNode() +{ + return new GTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); +} + +const char *GTestFramework::name() const +{ + return GTest::Constants::FRAMEWORK_NAME; +} + +QString GTestFramework::displayName() const +{ + return Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); +} + +unsigned GTestFramework::priority() const +{ + return GTest::Constants::FRAMEWORK_PRIORITY; +} + +QString GTestFramework::currentGTestFilter() +{ + return theGTestFramework().gtestFilter(); +} + +QString GTestFramework::groupingToolTip() const +{ + return Tr::tr("Enable or disable grouping of test cases by folder or " + "GTest filter.\nSee also Google Test settings."); +} + +GTest::Constants::GroupMode GTestFramework::staticGroupMode() +{ + return GTest::Constants::GroupMode(theGTestFramework().groupMode.itemValue().toInt()); +} + +QStringList GTestFramework::testNameForSymbolName(const QString &symbolName) const +{ + static const QRegularExpression r("^(.+::)?((DISABLED_)?.+?)_((DISABLED_)?.+)_Test::TestBody$"); + const QRegularExpressionMatch match = r.match(symbolName); + if (!match.hasMatch()) + return {}; + + return { match.captured(2), match.captured(4) }; +} + +// GTestSettingPage + +class GTestSettingsPage final : public Core::IOptionsPage +{ +public: + GTestSettingsPage() + { + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.%2") + .arg(GTest::Constants::FRAMEWORK_PRIORITY) + .arg(GTest::Constants::FRAMEWORK_NAME))); + setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); + setDisplayName(Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); + setSettingsProvider([] { return &theGTestFramework(); }); + } +}; + +const GTestSettingsPage settingsPage; + } // Autotest::Internal diff --git a/src/plugins/autotest/gtest/gtestsettings.h b/src/plugins/autotest/gtest/gtestsettings.h index ea0ab565e6c..720a3d9a5b5 100644 --- a/src/plugins/autotest/gtest/gtestsettings.h +++ b/src/plugins/autotest/gtest/gtestsettings.h @@ -3,14 +3,16 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include "../itestframework.h" + +#include "gtestconstants.h" namespace Autotest::Internal { -class GTestSettings : public Core::PagedSettings +class GTestFramework : public ITestFramework { public: - explicit GTestSettings(Utils::Id settingsId); + GTestFramework(); Utils::IntegerAspect iterations{this}; Utils::IntegerAspect seed{this}; @@ -21,6 +23,20 @@ public: Utils::BoolAspect breakOnFailure{this}; Utils::SelectionAspect groupMode{this}; Utils::StringAspect gtestFilter{this}; + + static GTest::Constants::GroupMode staticGroupMode(); + static QString currentGTestFilter(); + + QStringList testNameForSymbolName(const QString &symbolName) const override; + + const char *name() const override; + QString displayName() const override; + unsigned priority() const override; + QString groupingToolTip() const override; + ITestParser *createTestParser() override; + ITestTreeItem *createRootNode() override; }; +GTestFramework &theGTestFramework(); + } // Autotest::Internal diff --git a/src/plugins/autotest/gtest/gtesttreeitem.cpp b/src/plugins/autotest/gtest/gtesttreeitem.cpp index f91b68f0e38..ddeb8b8c4bf 100644 --- a/src/plugins/autotest/gtest/gtesttreeitem.cpp +++ b/src/plugins/autotest/gtest/gtesttreeitem.cpp @@ -5,7 +5,7 @@ #include "gtestconfiguration.h" #include "gtestconstants.h" -#include "gtestframework.h" +#include "gtestsettings.h" #include "gtestparser.h" #include "../autotesttr.h" @@ -113,7 +113,7 @@ QVariant GTestTreeItem::data(int column, int role) const } case Qt::DecorationRole: if (type() == GroupNode - && GTestFramework::groupMode() == GTest::Constants::GTestFilter) { + && GTestFramework::staticGroupMode() == GTest::Constants::GTestFilter) { static const QIcon filterIcon = Icon({{":/utils/images/filtericon.png", Theme::PanelTextColorMid}}).icon(); return filterIcon; @@ -121,7 +121,7 @@ QVariant GTestTreeItem::data(int column, int role) const break; case Qt::ToolTipRole: if (type() == GroupNode - && GTestFramework::groupMode() == GTest::Constants::GTestFilter) { + && GTestFramework::staticGroupMode() == GTest::Constants::GTestFilter) { const auto tpl = QString("<p>%1</p><p>%2</p>").arg(filePath().toString()); return tpl.arg(Tr::tr("Change GTest filter in use inside the settings.")); } @@ -361,7 +361,7 @@ TestTreeItem *GTestTreeItem::find(const TestParseResult *result) switch (type()) { case Root: if (result->framework->grouping()) { - if (GTestFramework::groupMode() == GTest::Constants::Directory) { + if (GTestFramework::staticGroupMode() == GTest::Constants::Directory) { const FilePath base = parseResult->fileName.absolutePath(); for (int row = 0; row < childCount(); ++row) { GTestTreeItem *group = static_cast<GTestTreeItem *>(childAt(row)); @@ -445,7 +445,7 @@ bool GTestTreeItem::modify(const TestParseResult *result) TestTreeItem *GTestTreeItem::createParentGroupNode() const { - if (GTestFramework::groupMode() == GTest::Constants::Directory) { + if (GTestFramework::staticGroupMode() == GTest::Constants::Directory) { const FilePath &absPath = filePath().absolutePath(); return new GTestTreeItem(framework(), absPath.baseName(), absPath, TestTreeItem::GroupNode); } else { // GTestFilter @@ -531,7 +531,7 @@ bool GTestTreeItem::isGroupNodeFor(const TestTreeItem *other) const if (type() != TestTreeItem::GroupNode) return false; - if (GTestFramework::groupMode() == GTest::Constants::Directory) { + if (GTestFramework::staticGroupMode() == GTest::Constants::Directory) { return other->filePath().absolutePath() == filePath(); } else { // GTestFilter QString fullName; @@ -566,7 +566,7 @@ TestTreeItem *GTestTreeItem::applyFilters() if (type() != TestSuite) return nullptr; - if (GTestFramework::groupMode() != GTest::Constants::GTestFilter) + if (GTestFramework::staticGroupMode() != GTest::Constants::GTestFilter) return nullptr; const QString gtestFilter = GTestFramework::currentGTestFilter(); diff --git a/src/plugins/autotest/itestframework.cpp b/src/plugins/autotest/itestframework.cpp index 0f1919b2af8..f8ccd8e85d3 100644 --- a/src/plugins/autotest/itestframework.cpp +++ b/src/plugins/autotest/itestframework.cpp @@ -17,12 +17,6 @@ ITestBase::ITestBase(bool activeByDefault, const ITestBase::TestBaseType type) , m_type(type) {} -Id ITestBase::settingsId() const -{ - return Id(Constants::SETTINGSPAGE_PREFIX) - .withSuffix(QString("%1.%2").arg(priority()).arg(QLatin1String(name()))); -} - Id ITestBase::id() const { return Id(Constants::FRAMEWORK_PREFIX).withSuffix(name()); @@ -41,7 +35,9 @@ void ITestBase::resetRootNode() ITestFramework::ITestFramework(bool activeByDefault) : ITestBase(activeByDefault, ITestBase::Framework) -{} +{ + setAutoApply(false); +} ITestFramework::~ITestFramework() { diff --git a/src/plugins/autotest/itestframework.h b/src/plugins/autotest/itestframework.h index d7a4d7927da..5621d9d8377 100644 --- a/src/plugins/autotest/itestframework.h +++ b/src/plugins/autotest/itestframework.h @@ -3,6 +3,7 @@ #pragma once +#include <utils/aspects.h> #include <utils/id.h> namespace ProjectExplorer { struct TestCaseInfo; } @@ -12,12 +13,11 @@ namespace Autotest { class ITestFramework; class ITestParser; -using ITestSettings = Utils::AspectContainer; class ITestTool; class ITestTreeItem; class TestTreeItem; -class ITestBase +class ITestBase : public Utils::AspectContainer { public: enum TestBaseType @@ -35,9 +35,6 @@ public: virtual unsigned priority() const = 0; // should this be modifyable? TestBaseType type() const { return m_type; } - virtual ITestSettings *testSettings() { return nullptr; } - - Utils::Id settingsId() const; Utils::Id id() const; bool active() const { return m_active; } diff --git a/src/plugins/autotest/qtest/qttestconfiguration.cpp b/src/plugins/autotest/qtest/qttestconfiguration.cpp index 9648e69d547..02972c33fac 100644 --- a/src/plugins/autotest/qtest/qttestconfiguration.cpp +++ b/src/plugins/autotest/qtest/qttestconfiguration.cpp @@ -29,8 +29,8 @@ static QStringList quoteIfNeeded(const QStringList &testCases, bool debugMode) TestOutputReader *QtTestConfiguration::createOutputReader(Process *app) const { - auto qtSettings = static_cast<QtTestSettings *>(framework()->testSettings()); - const QtTestOutputReader::OutputMode mode = qtSettings && qtSettings->useXMLOutput.value() + QtTestFramework &qtSettings = *static_cast<QtTestFramework *>(framework()); + const QtTestOutputReader::OutputMode mode = qtSettings.useXMLOutput() ? QtTestOutputReader::XML : QtTestOutputReader::PlainText; return new QtTestOutputReader(app, buildDirectory(), projectFile(), mode, TestType::QtTest); @@ -44,29 +44,27 @@ QStringList QtTestConfiguration::argumentsForTestRunner(QStringList *omitted) co runnable().command.arguments().split(' ', Qt::SkipEmptyParts), omitted, false)); } - auto qtSettings = static_cast<QtTestSettings *>(framework()->testSettings()); - if (!qtSettings) - return arguments; - if (qtSettings->useXMLOutput.value()) + QtTestFramework &qtSettings = *static_cast<QtTestFramework *>(framework()); + if (qtSettings.useXMLOutput()) arguments << "-xml"; if (!testCases().isEmpty()) arguments << quoteIfNeeded(testCases(), isDebugRunMode()); - const QString &metricsOption = QtTestSettings::metricsTypeToOption(MetricsType(qtSettings->metrics.value())); + const QString metricsOption = QtTestFramework::metricsTypeToOption(MetricsType(qtSettings.metrics())); if (!metricsOption.isEmpty()) arguments << metricsOption; - if (qtSettings->verboseBench.value()) + if (qtSettings.verboseBench()) arguments << "-vb"; - if (qtSettings->logSignalsSlots.value()) + if (qtSettings.logSignalsSlots()) arguments << "-vs"; - if (isDebugRunMode() && qtSettings->noCrashHandler.value()) + if (isDebugRunMode() && qtSettings.noCrashHandler()) arguments << "-nocrashhandler"; - if (qtSettings->limitWarnings.value() && qtSettings->maxWarnings.value() != 2000) - arguments << "-maxwarnings" << QString::number(qtSettings->maxWarnings.value()); + if (qtSettings.limitWarnings() && qtSettings.maxWarnings() != 2000) + arguments << "-maxwarnings" << QString::number(qtSettings.maxWarnings()); return arguments; } diff --git a/src/plugins/autotest/qtest/qttestframework.cpp b/src/plugins/autotest/qtest/qttestframework.cpp deleted file mode 100644 index d13470c8569..00000000000 --- a/src/plugins/autotest/qtest/qttestframework.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "qttestframework.h" - -#include "qttestconstants.h" -#include "qttestparser.h" -#include "qttesttreeitem.h" -#include "../autotesttr.h" - -namespace Autotest { -namespace Internal { - -ITestParser *QtTestFramework::createTestParser() -{ - return new QtTestParser(this); -} - -ITestTreeItem *QtTestFramework::createRootNode() -{ - return new QtTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); -} - -const char *QtTestFramework::name() const -{ - return QtTest::Constants::FRAMEWORK_NAME; -} - -QString QtTestFramework::displayName() const -{ - return Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); -} - -unsigned QtTestFramework::priority() const -{ - return QtTest::Constants::FRAMEWORK_PRIORITY; -} - -QStringList QtTestFramework::testNameForSymbolName(const QString &symbolName) const -{ - int index = symbolName.lastIndexOf("::"); - if (index == -1) - return {}; - return { symbolName.left(index), symbolName.mid(index + 2) }; -} - -} // namespace Internal -} // namespace Autotest diff --git a/src/plugins/autotest/qtest/qttestframework.h b/src/plugins/autotest/qtest/qttestframework.h deleted file mode 100644 index c90bd3c9d8c..00000000000 --- a/src/plugins/autotest/qtest/qttestframework.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "../itestframework.h" - -#include "qttestsettings.h" - -namespace Autotest::Internal { - -class QtTestFramework : public ITestFramework -{ -public: - QtTestFramework() : ITestFramework(true) {} - - QStringList testNameForSymbolName(const QString &symbolName) const override; -private: - const char *name() const override; - QString displayName() const override; - unsigned priority() const override; - ITestParser *createTestParser() override; - ITestTreeItem *createRootNode() override; - ITestSettings *testSettings() override { return &m_settings; } - - QtTestSettings m_settings{settingsId()}; -}; - -} // Autotest::Internal diff --git a/src/plugins/autotest/qtest/qttestsettings.cpp b/src/plugins/autotest/qtest/qttestsettings.cpp index a8953a04492..78239e7f76e 100644 --- a/src/plugins/autotest/qtest/qttestsettings.cpp +++ b/src/plugins/autotest/qtest/qttestsettings.cpp @@ -6,6 +6,10 @@ #include "../autotestconstants.h" #include "../autotesttr.h" #include "qttestconstants.h" +#include "qttestparser.h" +#include "qttesttreeitem.h" + +#include <coreplugin/dialogs/ioptionspage.h> #include <utils/hostosinfo.h> #include <utils/layoutbuilder.h> @@ -15,12 +19,15 @@ using namespace Utils; namespace Autotest::Internal { -QtTestSettings::QtTestSettings(Id settingsId) +QtTestFramework &theQtTestFramework() +{ + static QtTestFramework framework; + return framework; +} + +QtTestFramework::QtTestFramework() : ITestFramework(true) { setSettingsGroups("Autotest", "QtTest"); - setId(settingsId); - setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); - setDisplayName(Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setLayouter([this] { return Row { Form { @@ -91,7 +98,7 @@ QtTestSettings::QtTestSettings(Id settingsId) "feature significantly increases scan time.")); } -QString QtTestSettings::metricsTypeToOption(const MetricsType type) +QString QtTestFramework::metricsTypeToOption(const MetricsType type) { switch (type) { case MetricsType::Walltime: @@ -108,4 +115,55 @@ QString QtTestSettings::metricsTypeToOption(const MetricsType type) return {}; } +ITestParser *QtTestFramework::createTestParser() +{ + return new QtTestParser(this); +} + +ITestTreeItem *QtTestFramework::createRootNode() +{ + return new QtTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); +} + +const char *QtTestFramework::name() const +{ + return QtTest::Constants::FRAMEWORK_NAME; +} + +QString QtTestFramework::displayName() const +{ + return Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); +} + +unsigned QtTestFramework::priority() const +{ + return QtTest::Constants::FRAMEWORK_PRIORITY; +} + +QStringList QtTestFramework::testNameForSymbolName(const QString &symbolName) const +{ + int index = symbolName.lastIndexOf("::"); + if (index == -1) + return {}; + return { symbolName.left(index), symbolName.mid(index + 2) }; +} + +// QtTestSettingsPage + +class QtTestSettingPage final : public Core::IOptionsPage +{ +public: + QtTestSettingPage() + { + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.%2") + .arg(QtTest::Constants::FRAMEWORK_PRIORITY) + .arg(QtTest::Constants::FRAMEWORK_NAME))); + setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); + setDisplayName(Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); + setSettingsProvider([] { return &theQtTestFramework(); }); + } +}; + +const QtTestSettingPage settingsPage; + } // Autotest::Internal diff --git a/src/plugins/autotest/qtest/qttestsettings.h b/src/plugins/autotest/qtest/qttestsettings.h index 31394ee6027..f2dc1a4776a 100644 --- a/src/plugins/autotest/qtest/qttestsettings.h +++ b/src/plugins/autotest/qtest/qttestsettings.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include "../itestframework.h" namespace Autotest::Internal { @@ -16,10 +16,10 @@ enum MetricsType Perf }; -class QtTestSettings : public Core::PagedSettings +class QtTestFramework : public ITestFramework { public: - explicit QtTestSettings(Utils::Id settingsId); + QtTestFramework(); static QString metricsTypeToOption(const MetricsType type); @@ -31,6 +31,16 @@ public: Utils::BoolAspect limitWarnings{this}; Utils::IntegerAspect maxWarnings{this}; Utils::BoolAspect quickCheckForDerivedTests{this}; + + QStringList testNameForSymbolName(const QString &symbolName) const override; + + const char *name() const override; + QString displayName() const override; + unsigned priority() const override; + ITestParser *createTestParser() override; + ITestTreeItem *createRootNode() override; }; +QtTestFramework &theQtTestFramework(); + } // Autotest::Internal diff --git a/src/plugins/autotest/quick/quicktestconfiguration.cpp b/src/plugins/autotest/quick/quicktestconfiguration.cpp index f757dfb0255..b23a2d7a17d 100644 --- a/src/plugins/autotest/quick/quicktestconfiguration.cpp +++ b/src/plugins/autotest/quick/quicktestconfiguration.cpp @@ -22,8 +22,8 @@ QuickTestConfiguration::QuickTestConfiguration(ITestFramework *framework) TestOutputReader *QuickTestConfiguration::createOutputReader(Process *app) const { - auto qtSettings = static_cast<QtTestSettings *>(framework()->testSettings()); - const QtTestOutputReader::OutputMode mode = qtSettings && qtSettings->useXMLOutput.value() + QtTestFramework &qtSettings = *static_cast<QtTestFramework *>(framework()); + const QtTestOutputReader::OutputMode mode = qtSettings.useXMLOutput() ? QtTestOutputReader::XML : QtTestOutputReader::PlainText; return new QtTestOutputReader(app, buildDirectory(), projectFile(), mode, TestType::QuickTest); @@ -38,25 +38,23 @@ QStringList QuickTestConfiguration::argumentsForTestRunner(QStringList *omitted) omitted, true)); } - auto qtSettings = static_cast<QtTestSettings *>(framework()->testSettings()); - if (!qtSettings) - return arguments; - if (qtSettings->useXMLOutput.value()) + QtTestFramework &qtSettings = *static_cast<QtTestFramework *>(framework()); + if (qtSettings.useXMLOutput()) arguments << "-xml"; if (!testCases().isEmpty()) arguments << testCases(); - const QString &metricsOption = QtTestSettings::metricsTypeToOption(MetricsType(qtSettings->metrics.value())); + const QString &metricsOption = QtTestFramework::metricsTypeToOption(MetricsType(qtSettings.metrics())); if (!metricsOption.isEmpty()) arguments << metricsOption; if (isDebugRunMode()) { - if (qtSettings->noCrashHandler.value()) + if (qtSettings.noCrashHandler()) arguments << "-nocrashhandler"; } - if (qtSettings->limitWarnings.value() && qtSettings->maxWarnings.value() != 2000) - arguments << "-maxwarnings" << QString::number(qtSettings->maxWarnings.value()); + if (qtSettings.limitWarnings() && qtSettings.maxWarnings() != 2000) + arguments << "-maxwarnings" << QString::number(qtSettings.maxWarnings()); return arguments; } diff --git a/src/plugins/autotest/quick/quicktestframework.cpp b/src/plugins/autotest/quick/quicktestframework.cpp index a8289ad48e5..e1e70bb03ae 100644 --- a/src/plugins/autotest/quick/quicktestframework.cpp +++ b/src/plugins/autotest/quick/quicktestframework.cpp @@ -5,14 +5,17 @@ #include "quicktestparser.h" #include "quicktesttreeitem.h" -#include "../autotestconstants.h" #include "../autotesttr.h" -#include "../testframeworkmanager.h" -#include "../qtest/qttestconstants.h" namespace Autotest { namespace Internal { +QuickTestFramework &theQuickTestFramework() +{ + static QuickTestFramework framework; + return framework; +} + ITestParser *QuickTestFramework::createTestParser() { return new QuickTestParser(this); @@ -38,13 +41,5 @@ unsigned QuickTestFramework::priority() const return 5; } -ITestSettings *QuickTestFramework::testSettings() -{ - static const Utils::Id id - = Utils::Id(Constants::FRAMEWORK_PREFIX).withSuffix(QtTest::Constants::FRAMEWORK_NAME); - ITestFramework *qtTestFramework = TestFrameworkManager::frameworkForId(id); - return qtTestFramework->testSettings(); -} - } // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/quick/quicktestframework.h b/src/plugins/autotest/quick/quicktestframework.h index 99c7eb0552a..fe3622b0e66 100644 --- a/src/plugins/autotest/quick/quicktestframework.h +++ b/src/plugins/autotest/quick/quicktestframework.h @@ -5,6 +5,8 @@ #include "../itestframework.h" +#include "../qtest/qttestsettings.h" + namespace Autotest { namespace QuickTest { namespace Constants { @@ -16,19 +18,20 @@ const char FRAMEWORK_NAME[] = "QtQuickTest"; namespace Internal { -class QuickTestFramework : public ITestFramework +class QuickTestFramework : public QtTestFramework { public: - QuickTestFramework() : ITestFramework(true) {} + QuickTestFramework() {} const char *name() const override; QString displayName() const override; unsigned priority() const override; - ITestSettings *testSettings() override; protected: ITestParser *createTestParser() override; ITestTreeItem *createRootNode() override; }; +QuickTestFramework &theQuickTestFramework(); + } // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/quick/quicktestparser.cpp b/src/plugins/autotest/quick/quicktestparser.cpp index 4fa8d4fb81d..64b98e1aa28 100644 --- a/src/plugins/autotest/quick/quicktestparser.cpp +++ b/src/plugins/autotest/quick/quicktestparser.cpp @@ -356,8 +356,8 @@ void QuickTestParser::init(const QSet<FilePath> &filesToParse, bool fullParse) m_mainCppFiles.clear(); } - auto qtSettings = static_cast<QtTestSettings *>(framework()->testSettings()); - m_checkForDerivedTests = qtSettings->quickCheckForDerivedTests.value(); + QtTestFramework &qtSettings = *static_cast<QtTestFramework *>(framework()); + m_checkForDerivedTests = qtSettings.quickCheckForDerivedTests(); CppParser::init(filesToParse, fullParse); } diff --git a/src/plugins/autotest/testframeworkmanager.cpp b/src/plugins/autotest/testframeworkmanager.cpp index 26f455cf9b5..b9b61b79d11 100644 --- a/src/plugins/autotest/testframeworkmanager.cpp +++ b/src/plugins/autotest/testframeworkmanager.cpp @@ -22,8 +22,6 @@ TestFrameworkManager::TestFrameworkManager() TestFrameworkManager::~TestFrameworkManager() { - qDeleteAll(m_registeredFrameworks); - qDeleteAll(m_registeredTestTools); s_instance = nullptr; } @@ -96,14 +94,11 @@ ITestTool *TestFrameworkManager::testToolForBuildSystemId(Id buildSystemId) void TestFrameworkManager::synchronizeSettings() { Internal::testSettings().fromSettings(); - for (ITestFramework *framework : std::as_const(m_registeredFrameworks)) { - if (ITestSettings *fSettings = framework->testSettings()) - fSettings->readSettings(); - } - for (ITestTool *testTool : std::as_const(m_registeredTestTools)) { - if (ITestSettings *tSettings = testTool->testSettings()) - tSettings->readSettings(); - } + for (ITestFramework *framework : std::as_const(m_registeredFrameworks)) + framework->readSettings(); + + for (ITestTool *testTool : std::as_const(m_registeredTestTools)) + testTool->readSettings(); } } // namespace Autotest From 1d59a37acb14ff3c87c8870010acc859e30f3461 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 6 Jul 2023 15:36:53 +0200 Subject: [PATCH 0263/1777] ClangCodeModel: Fix outdated message ... after applying a clangd warning suppression. Change-Id: I6b6605edd80080dcfd070b4a2f4219463674421b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/clangcodemodel/clangtextmark.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/clangcodemodel/clangtextmark.cpp b/src/plugins/clangcodemodel/clangtextmark.cpp index 166a55e4f31..e62dfad66ec 100644 --- a/src/plugins/clangcodemodel/clangtextmark.cpp +++ b/src/plugins/clangcodemodel/clangtextmark.cpp @@ -105,7 +105,8 @@ void disableDiagnosticInCurrentProjectConfig(const ClangDiagnostic &diagnostic) projectSettings.setDiagnosticConfigId(config.id()); // Notify the user about changed project specific settings - const QString text = Tr::tr("Changes applied in Projects Mode > Clang Code Model"); + const QString text = Tr::tr("Changes applied to diagnostic configuration \"%1\"") + .arg(config.displayName()); FadingIndicator::showText(Core::ICore::mainWindow(), text, FadingIndicator::SmallText); From 90ba1405456568fcc060fa68ac41ff5490258192 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 11 Jul 2023 14:19:33 +0200 Subject: [PATCH 0264/1777] CplusPlus: Use plainer callbacks to interact to the CppEditor Lets us remove a few explicit CppModelManager::instance() call in user code later. Change-Id: Id8d846d06a0715b3d609cc5d52cc031e1d025fb1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/cplusplus/cppmodelmanagerbase.cpp | 59 +++++++++++-------- src/libs/cplusplus/cppmodelmanagerbase.h | 35 +++++------ src/libs/qmljs/qmljsmodelmanagerinterface.cpp | 7 +-- src/plugins/cppeditor/cppmodelmanager.cpp | 17 +++++- src/plugins/cppeditor/cppmodelmanager.h | 6 +- 5 files changed, 70 insertions(+), 54 deletions(-) diff --git a/src/libs/cplusplus/cppmodelmanagerbase.cpp b/src/libs/cplusplus/cppmodelmanagerbase.cpp index c869fd61a0f..cff9ef99e2c 100644 --- a/src/libs/cplusplus/cppmodelmanagerbase.cpp +++ b/src/libs/cplusplus/cppmodelmanagerbase.cpp @@ -3,48 +3,57 @@ #include "cppmodelmanagerbase.h" -namespace CPlusPlus { +#include <utils/qtcassert.h> -static CppModelManagerBase *g_instance = nullptr; +namespace CPlusPlus::CppModelManagerBase { -CppModelManagerBase::CppModelManagerBase(QObject *parent) - : QObject(parent) +static bool (*setExtraDiagnosticsCallback) + (const QString &, const QString &, const QList<Document::DiagnosticMessage> &) = nullptr; + +static CPlusPlus::Snapshot (*snapshotCallback)() = nullptr; + + +bool trySetExtraDiagnostics(const QString &fileName, const QString &kind, + const QList<Document::DiagnosticMessage> &diagnostics) { - Q_ASSERT(!g_instance); - g_instance = this; + if (!setExtraDiagnosticsCallback) + return false; + return setExtraDiagnosticsCallback(fileName, kind, diagnostics); } -CppModelManagerBase::~CppModelManagerBase() +bool setExtraDiagnostics(const QString &fileName, const QString &kind, + const QList<Document::DiagnosticMessage> &diagnostics) { - Q_ASSERT(g_instance == this); - g_instance = nullptr; + QTC_ASSERT(setExtraDiagnosticsCallback, return false); + return setExtraDiagnosticsCallback(fileName, kind, diagnostics); } -CppModelManagerBase *CppModelManagerBase::instance() +Snapshot snapshot() { - return g_instance; + QTC_ASSERT(snapshotCallback, return {}); + return snapshotCallback(); } -bool CppModelManagerBase::trySetExtraDiagnostics(const QString &fileName, const QString &kind, - const QList<CPlusPlus::Document::DiagnosticMessage> &diagnostics) +bool hasSnapshots() { - if (CppModelManagerBase *mm = instance()) - return mm->setExtraDiagnostics(fileName, kind, diagnostics); - return false; + return snapshotCallback; } -bool CppModelManagerBase::setExtraDiagnostics(const QString &fileName, const QString &kind, - const QList<CPlusPlus::Document::DiagnosticMessage> &diagnostics) +// Installation + +void registerSetExtraDiagnosticsCallback( + bool (*callback)(const QString &, const QString &, const QList<Document::DiagnosticMessage> &)) { - Q_UNUSED(fileName) - Q_UNUSED(kind) - Q_UNUSED(diagnostics) - return false; + QTC_ASSERT(callback, return); + QTC_CHECK(!setExtraDiagnosticsCallback); // bark when used twice + setExtraDiagnosticsCallback = callback; } -CPlusPlus::Snapshot CppModelManagerBase::snapshot() const +void registerSnapshotCallback(Snapshot (*callback)()) { - return CPlusPlus::Snapshot(); + QTC_ASSERT(callback, return); + QTC_CHECK(!snapshotCallback); // bark when used twice + snapshotCallback = callback; } -} // namespace CPlusPlus +} // CPlusPlus::CppModelManagerBase diff --git a/src/libs/cplusplus/cppmodelmanagerbase.h b/src/libs/cplusplus/cppmodelmanagerbase.h index d003fcf1dec..1a9e4c7db33 100644 --- a/src/libs/cplusplus/cppmodelmanagerbase.h +++ b/src/libs/cplusplus/cppmodelmanagerbase.h @@ -5,29 +5,24 @@ #include <cplusplus/CppDocument.h> -#include <QObject> -#include <QList> +namespace CPlusPlus::CppModelManagerBase { -QT_BEGIN_NAMESPACE -class QString; -QT_END_NAMESPACE +CPLUSPLUS_EXPORT bool trySetExtraDiagnostics + (const QString &, const QString &, const QList<Document::DiagnosticMessage> &); -namespace CPlusPlus { +CPLUSPLUS_EXPORT bool setSetExtraDiagnostics + (const QString &, const QString &, const QList<Document::DiagnosticMessage> &); -class CPLUSPLUS_EXPORT CppModelManagerBase : public QObject -{ - Q_OBJECT -public: - CppModelManagerBase(QObject *parent = nullptr); - ~CppModelManagerBase(); +CPLUSPLUS_EXPORT bool hasSnapshots(); - static CppModelManagerBase *instance(); - static bool trySetExtraDiagnostics(const QString &fileName, const QString &kind, - const QList<Document::DiagnosticMessage> &diagnostics); +CPLUSPLUS_EXPORT CPlusPlus::Snapshot snapshot(); - virtual bool setExtraDiagnostics(const QString &fileName, const QString &kind, - const QList<Document::DiagnosticMessage> &diagnostics); - virtual CPlusPlus::Snapshot snapshot() const; -}; -} // namespace CPlusPlus +// These callback are provided by the CppEditor plugin. + +CPLUSPLUS_EXPORT void registerSnapshotCallback(CPlusPlus::Snapshot (*)(void)); + +CPLUSPLUS_EXPORT void registerSetExtraDiagnosticsCallback( + bool(*)(const QString &, const QString &, const QList<Document::DiagnosticMessage> &)); + +} // CPlusPlus::CppModelManagerBase diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index 93b8ca35e71..26238807e0e 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -1366,13 +1366,12 @@ void ModelManagerInterface::startCppQmlTypeUpdate() return; } - CPlusPlus::CppModelManagerBase *cppModelManager = - CPlusPlus::CppModelManagerBase::instance(); - if (!cppModelManager) + if (!CPlusPlus::CppModelManagerBase::hasSnapshots()) return; m_cppQmlTypesUpdater = Utils::asyncRun(&ModelManagerInterface::updateCppQmlTypes, this, - cppModelManager->snapshot(), m_queuedCppDocuments); + CPlusPlus::CppModelManagerBase::snapshot(), + m_queuedCppDocuments); m_queuedCppDocuments.clear(); } diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index 4ea3e99edf4..7fb8115873e 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -912,12 +912,25 @@ void CppModelManager::initCppTools() }); } +static bool setExtraDiagnosticsCallback(const QString &fileName, const QString &kind, + const QList<Document::DiagnosticMessage> &diagnostics) +{ + return m_instance->setExtraDiagnostics(fileName, kind, diagnostics); +} + +static Snapshot snapshotCallback() +{ + return m_instance->snapshot(); +} + CppModelManager::CppModelManager() - : CppModelManagerBase(nullptr) - , d(new CppModelManagerPrivate) + : d(new CppModelManagerPrivate) { m_instance = this; + CppModelManagerBase::registerSetExtraDiagnosticsCallback(&setExtraDiagnosticsCallback); + CppModelManagerBase::registerSnapshotCallback(&snapshotCallback); + // Used for weak dependency in VcsBaseSubmitEditor setObjectName("CppModelManager"); ExtensionSystem::PluginManager::addObject(this); diff --git a/src/plugins/cppeditor/cppmodelmanager.h b/src/plugins/cppeditor/cppmodelmanager.h index 3ab9ee26898..7dd49c6ebd1 100644 --- a/src/plugins/cppeditor/cppmodelmanager.h +++ b/src/plugins/cppeditor/cppmodelmanager.h @@ -66,7 +66,7 @@ enum class SignalSlotType { None }; -class CPPEDITOR_EXPORT CppModelManager final : public CPlusPlus::CppModelManagerBase +class CPPEDITOR_EXPORT CppModelManager final : public QObject { Q_OBJECT @@ -97,7 +97,7 @@ public: bool setExtraDiagnostics(const QString &fileName, const QString &kind, - const QList<Document::DiagnosticMessage> &diagnostics) override; + const QList<Document::DiagnosticMessage> &diagnostics); const QList<Document::DiagnosticMessage> diagnosticMessages(); @@ -119,7 +119,7 @@ public: /// all loaded projects. ProjectPart::ConstPtr fallbackProjectPart(); - CPlusPlus::Snapshot snapshot() const override; + CPlusPlus::Snapshot snapshot() const; Document::Ptr document(const Utils::FilePath &filePath) const; bool replaceDocument(Document::Ptr newDoc); From 8f82e76ba1c4c3c05aa9e14c2c7937809ec775d2 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 6 Jul 2023 12:02:54 +0200 Subject: [PATCH 0265/1777] ProjectExplorer: Centrally disable X11 forwarding aspect on windows That's only the default value, but basically what all user code occurrences do. Change-Id: I2997744cf069455294ac35871109edc4328a1996 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/projectexplorer/runconfigurationaspects.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 5c0242d4a64..7c31f92bf86 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -918,6 +918,7 @@ X11ForwardingAspect::X11ForwardingAspect(AspectContainer *container) makeCheckable(CheckBoxPlacement::Right, Tr::tr("Forward to local display"), "RunConfiguration.UseX11Forwarding"); setValue(defaultDisplay()); + setVisible(HostOsInfo::isAnyUnixHost()); addDataExtractor(this, &X11ForwardingAspect::display, &Data::display); } From 0b83f110f4ca1a620e8faf2db423886aab255602 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 12 Jul 2023 09:47:29 +0200 Subject: [PATCH 0266/1777] CppEditor: Make a few CppModelManager functions static ... to simplify code using it. Change-Id: Ib2bfbb5a17a1d48088a9cf4973d4c3f006cd34e4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/autotest/autotestplugin.cpp | 2 +- .../autotest/boost/boosttestparser.cpp | 3 +- .../autotest/boost/boosttesttreeitem.cpp | 14 +- .../autotest/catch/catchtestparser.cpp | 4 +- src/plugins/autotest/catch/catchtreeitem.cpp | 22 +- src/plugins/autotest/gtest/gtestparser.cpp | 4 +- src/plugins/autotest/gtest/gtesttreeitem.cpp | 8 +- src/plugins/autotest/itestparser.cpp | 10 +- src/plugins/autotest/qtest/qttestparser.cpp | 12 +- src/plugins/autotest/qtest/qttestparser.h | 5 +- src/plugins/autotest/qtest/qttesttreeitem.cpp | 14 +- .../autotest/quick/quicktestparser.cpp | 11 +- .../autotest/quick/quicktesttreeitem.cpp | 4 +- src/plugins/autotest/testcodeparser.cpp | 2 +- .../baremetal/debugservers/uvsc/uvproject.cpp | 2 +- .../clangcodemodel/clangcodemodelplugin.cpp | 8 +- src/plugins/clangcodemodel/clangdclient.cpp | 7 +- .../clangcodemodel/clangdcompletion.cpp | 2 +- .../clangmodelmanagersupport.cpp | 29 +-- src/plugins/clangtools/clangtool.cpp | 8 +- .../clangtools/documentclangtoolrunner.cpp | 2 +- src/plugins/classview/classviewparser.cpp | 6 +- src/plugins/cppcheck/cppchecktool.cpp | 2 +- src/plugins/cppcheck/cppchecktrigger.cpp | 2 +- .../cppeditor/abstracteditorsupport.cpp | 12 +- src/plugins/cppeditor/abstracteditorsupport.h | 5 +- .../cppeditor/baseeditordocumentparser.cpp | 9 +- .../cppeditor/baseeditordocumentprocessor.cpp | 4 +- src/plugins/cppeditor/builtincursorinfo.cpp | 4 +- .../cppeditor/builtineditordocumentparser.cpp | 11 +- .../builtineditordocumentprocessor.cpp | 7 +- .../cppbuiltinmodelmanagersupport.cpp | 26 +-- .../cppeditor/cppcodemodelinspectordialog.cpp | 14 +- .../cppeditor/cppcodemodelinspectordumper.cpp | 2 +- src/plugins/cppeditor/cppcompletionassist.cpp | 4 +- src/plugins/cppeditor/cppeditordocument.cpp | 19 +- src/plugins/cppeditor/cppeditoroutline.cpp | 2 +- src/plugins/cppeditor/cppeditorplugin.cpp | 12 +- src/plugins/cppeditor/cppeditorwidget.cpp | 45 ++-- src/plugins/cppeditor/cppelementevaluator.cpp | 8 +- src/plugins/cppeditor/cppfindreferences.cpp | 18 +- .../cppeditor/cppfollowsymbolundercursor.cpp | 2 +- src/plugins/cppeditor/cppincludehierarchy.cpp | 2 +- src/plugins/cppeditor/cppincludesfilter.cpp | 2 +- src/plugins/cppeditor/cppindexingsupport.cpp | 20 +- src/plugins/cppeditor/cpplocatorfilter.cpp | 4 +- src/plugins/cppeditor/cppmodelmanager.cpp | 167 +++++++------- src/plugins/cppeditor/cppmodelmanager.h | 209 +++++++++--------- .../cppeditor/cppmodelmanager_test.cpp | 160 ++++++-------- src/plugins/cppeditor/cppprojectupdater.cpp | 3 +- src/plugins/cppeditor/cppquickfix_test.cpp | 6 +- .../cppeditor/cppquickfixassistant.cpp | 2 +- src/plugins/cppeditor/cppquickfixes.cpp | 7 +- .../cppeditor/cpprefactoringchanges.cpp | 5 +- src/plugins/cppeditor/cpprefactoringchanges.h | 1 - .../cppeditor/cppsemanticinfoupdater.cpp | 2 +- .../cppeditor/cppsourceprocessor_test.cpp | 10 +- src/plugins/cppeditor/cpptoolsjsextension.cpp | 4 +- src/plugins/cppeditor/cpptoolstestcase.cpp | 35 ++- src/plugins/cppeditor/cpptoolstestcase.h | 2 - .../cppeditor/cppuseselections_test.cpp | 2 +- .../cppeditor/fileandtokenactions_test.cpp | 8 +- .../followsymbol_switchmethoddecldef_test.cpp | 2 +- .../cppeditor/generatedcodemodelsupport.cpp | 15 +- .../cppeditor/generatedcodemodelsupport.h | 3 +- src/plugins/cppeditor/includeutils.cpp | 5 +- .../cppeditor/modelmanagertesthelper.cpp | 2 +- src/plugins/cppeditor/symbolfinder.cpp | 2 +- src/plugins/cppeditor/symbolsfindfilter.cpp | 7 +- src/plugins/cppeditor/symbolsfindfilter.h | 5 +- .../debugger/analyzer/analyzerutils.cpp | 2 +- src/plugins/debugger/cdb/cdbengine.cpp | 4 +- .../debuggerrunconfigurationaspect.cpp | 2 +- src/plugins/debugger/sourceutils.cpp | 6 +- src/plugins/designer/codemodelhelpers.cpp | 2 +- src/plugins/designer/qtcreatorintegration.cpp | 16 +- .../modeleditor/classviewcontroller.cpp | 3 +- .../modeleditor/componentviewcontroller.cpp | 3 +- src/plugins/modeleditor/elementtasks.cpp | 4 +- src/plugins/modeleditor/pxnodeutilities.cpp | 3 +- 80 files changed, 505 insertions(+), 619 deletions(-) diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index 1211b7f5e48..6e12778ded2 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -392,7 +392,7 @@ void AutotestPluginPrivate::onRunUnderCursorTriggered(TestRunMode mode) const int line = currentEditor->currentLine(); const FilePath filePath = currentEditor->textDocument()->filePath(); - const CPlusPlus::Snapshot snapshot = CppEditor::CppModelManager::instance()->snapshot(); + const CPlusPlus::Snapshot snapshot = CppEditor::CppModelManager::snapshot(); const CPlusPlus::Document::Ptr doc = snapshot.document(filePath); if (doc.isNull()) // not part of C++ snapshot return; diff --git a/src/plugins/autotest/boost/boosttestparser.cpp b/src/plugins/autotest/boost/boosttestparser.cpp index 8c701942ada..47b190ecffe 100644 --- a/src/plugins/autotest/boost/boosttestparser.cpp +++ b/src/plugins/autotest/boost/boosttestparser.cpp @@ -104,9 +104,8 @@ bool BoostTestParser::processDocument(QPromise<TestParseResultPtr> &promise, if (doc.isNull() || !includesBoostTest(doc, m_cppSnapshot) || !hasBoostTestMacros(doc)) return false; - const CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance(); const QList<CppEditor::ProjectPart::ConstPtr> projectParts - = modelManager->projectPart(fileName); + = CppEditor::CppModelManager::projectPart(fileName); if (projectParts.isEmpty()) // happens if shutting down while parsing return false; const CppEditor::ProjectPart::ConstPtr projectPart = projectParts.first(); diff --git a/src/plugins/autotest/boost/boosttesttreeitem.cpp b/src/plugins/autotest/boost/boosttesttreeitem.cpp index 957ff73021a..d1fcdcdedd9 100644 --- a/src/plugins/autotest/boost/boosttesttreeitem.cpp +++ b/src/plugins/autotest/boost/boosttesttreeitem.cpp @@ -178,10 +178,9 @@ QList<ITestConfiguration *> BoostTestTreeItem::getAllTestConfigurations() const ++funcChildren; }); if (funcChildren) { - const auto cppMM = CppEditor::CppModelManager::instance(); - QTC_ASSERT(cppMM, return); testsPerProjectfile[item->proFile()].testCases += funcChildren; - testsPerProjectfile[item->proFile()].internalTargets.unite(cppMM->internalTargets(item->filePath())); + testsPerProjectfile[item->proFile()].internalTargets.unite( + CppEditor::CppModelManager::internalTargets(item->filePath())); } }); @@ -219,8 +218,6 @@ QList<ITestConfiguration *> BoostTestTreeItem::getTestConfigurations( if (!item->enabled()) // ignore child tests known to be disabled when using run selected return; if (predicate(item)) { - const auto cppMM = CppEditor::CppModelManager::instance(); - QTC_ASSERT(cppMM, return); QString tcName = item->name(); if (item->state().testFlag(BoostTestTreeItem::Templated)) tcName.append("<*"); @@ -229,7 +226,8 @@ QList<ITestConfiguration *> BoostTestTreeItem::getTestConfigurations( tcName = handleSpecialFunctionNames(tcName); testCasesForProjectFile[item->proFile()].testCases.append( item->prependWithParentsSuitePaths(tcName)); - testCasesForProjectFile[item->proFile()].internalTargets.unite(cppMM->internalTargets(item->filePath())); + testCasesForProjectFile[item->proFile()].internalTargets.unite( + CppEditor::CppModelManager::internalTargets(item->filePath())); } }); @@ -265,8 +263,6 @@ ITestConfiguration *BoostTestTreeItem::testConfiguration() const { ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject(); QTC_ASSERT(project, return nullptr); - const auto cppMM = CppEditor::CppModelManager::instance(); - QTC_ASSERT(cppMM, return nullptr); const Type itemType = type(); if (itemType == TestSuite || itemType == TestCase) { @@ -300,7 +296,7 @@ ITestConfiguration *BoostTestTreeItem::testConfiguration() const config->setProjectFile(proFile()); config->setProject(project); config->setTestCases(testCases); - config->setInternalTargets(cppMM->internalTargets(filePath())); + config->setInternalTargets(CppEditor::CppModelManager::internalTargets(filePath())); return config; } return nullptr; diff --git a/src/plugins/autotest/catch/catchtestparser.cpp b/src/plugins/autotest/catch/catchtestparser.cpp index 172304eb953..fac35df11d3 100644 --- a/src/plugins/autotest/catch/catchtestparser.cpp +++ b/src/plugins/autotest/catch/catchtestparser.cpp @@ -99,7 +99,6 @@ bool CatchTestParser::processDocument(QPromise<TestParseResultPtr> &promise, if (doc.isNull() || !includesCatchHeader(doc, m_cppSnapshot)) return false; - const CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance(); const QString &filePath = doc->filePath().toString(); const QByteArray &fileContent = getFileContent(fileName); @@ -115,7 +114,8 @@ bool CatchTestParser::processDocument(QPromise<TestParseResultPtr> &promise, } - const QList<CppEditor::ProjectPart::ConstPtr> projectParts = modelManager->projectPart(fileName); + const QList<CppEditor::ProjectPart::ConstPtr> projectParts + = CppEditor::CppModelManager::projectPart(fileName); if (projectParts.isEmpty()) // happens if shutting down while parsing return false; FilePath proFile; diff --git a/src/plugins/autotest/catch/catchtreeitem.cpp b/src/plugins/autotest/catch/catchtreeitem.cpp index 034c7ab1d04..9f1d7c8e17c 100644 --- a/src/plugins/autotest/catch/catchtreeitem.cpp +++ b/src/plugins/autotest/catch/catchtreeitem.cpp @@ -145,8 +145,6 @@ ITestConfiguration *CatchTreeItem::testConfiguration() const { ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject(); QTC_ASSERT(project, return nullptr); - const auto cppMM = CppEditor::CppModelManager::instance(); - QTC_ASSERT(cppMM, return nullptr); if (type() != TestCase) return nullptr; @@ -157,7 +155,7 @@ ITestConfiguration *CatchTreeItem::testConfiguration() const config->setProjectFile(proFile()); config->setProject(project); config->setTestCases(QStringList(testCasesString())); - config->setInternalTargets(cppMM->internalTargets(filePath())); + config->setInternalTargets(CppEditor::CppModelManager::internalTargets(filePath())); return config; } @@ -180,8 +178,6 @@ static void collectTestInfo(const TestTreeItem *item, bool ignoreCheckState) { QTC_ASSERT(item, return); - const auto cppMM = CppEditor::CppModelManager::instance(); - QTC_ASSERT(cppMM, return); const int childCount = item->childCount(); if (item->type() == TestTreeItem::GroupNode) { item->forFirstLevelChildItems([&testCasesForProfile, ignoreCheckState](TestTreeItem *it) { @@ -198,15 +194,16 @@ static void collectTestInfo(const TestTreeItem *item, CatchTreeItem *current = static_cast<CatchTreeItem *>(it); testCasesForProfile[projectFile].names.append(current->testCasesString()); }); - testCasesForProfile[projectFile].internalTargets.unite(cppMM->internalTargets(item->filePath())); + testCasesForProfile[projectFile].internalTargets.unite( + CppEditor::CppModelManager::internalTargets(item->filePath())); } else if (item->checked() == Qt::PartiallyChecked) { - item->forFirstLevelChildItems([&testCasesForProfile, cppMM](TestTreeItem *child) { + item->forFirstLevelChildItems([&testCasesForProfile](TestTreeItem *child) { QTC_ASSERT(child->type() == TestTreeItem::TestCase, return); if (child->checked() == Qt::Checked) { CatchTreeItem *current = static_cast<CatchTreeItem *>(child); testCasesForProfile[child->proFile()].names.append(current->testCasesString()); testCasesForProfile[child->proFile()].internalTargets.unite( - cppMM->internalTargets(child->filePath())); + CppEditor::CppModelManager::internalTargets(child->filePath())); } }); @@ -222,13 +219,11 @@ static void collectFailedTestInfo(const CatchTreeItem *item, item->forAllChildItems([&testCasesForProfile](TestTreeItem *it) { QTC_ASSERT(it, return); QTC_ASSERT(it->parentItem(), return); - const auto cppMM = CppEditor::CppModelManager::instance(); - QTC_ASSERT(cppMM, return); if (it->type() == TestTreeItem::TestCase && it->data(0, FailedRole).toBool()) { CatchTreeItem *current = static_cast<CatchTreeItem *>(it); testCasesForProfile[it->proFile()].names.append(current->testCasesString()); testCasesForProfile[it->proFile()].internalTargets.unite( - cppMM->internalTargets(it->filePath())); + CppEditor::CppModelManager::internalTargets(it->filePath())); } }); } @@ -270,8 +265,6 @@ QList<ITestConfiguration *> CatchTreeItem::getFailedTestConfigurations() const QList<ITestConfiguration *> CatchTreeItem::getTestConfigurationsForFile(const FilePath &fileName) const { QList<ITestConfiguration *> result; - const auto cppMM = CppEditor::CppModelManager::instance(); - QTC_ASSERT(cppMM, return result); ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject(); if (!project || type() != Root) @@ -296,7 +289,8 @@ QList<ITestConfiguration *> CatchTreeItem::getTestConfigurationsForFile(const Fi testConfig->setTestCases(testCases); testConfig->setProjectFile(item->proFile()); testConfig->setProject(ProjectExplorer::ProjectManager::startupProject()); - testConfig->setInternalTargets(cppMM->internalTargets(item->filePath())); + testConfig->setInternalTargets( + CppEditor::CppModelManager::internalTargets(item->filePath())); result << testConfig; } diff --git a/src/plugins/autotest/gtest/gtestparser.cpp b/src/plugins/autotest/gtest/gtestparser.cpp index bb2285bd43a..8fc292a9224 100644 --- a/src/plugins/autotest/gtest/gtestparser.cpp +++ b/src/plugins/autotest/gtest/gtestparser.cpp @@ -86,7 +86,6 @@ bool GTestParser::processDocument(QPromise<TestParseResultPtr> &promise, } const FilePath filePath = doc->filePath(); - const CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance(); CPlusPlus::Document::Ptr document = m_cppSnapshot.preprocessedDocument(fileContent, fileName); document->check(); CPlusPlus::AST *ast = document->translationUnit()->ast(); @@ -95,7 +94,8 @@ bool GTestParser::processDocument(QPromise<TestParseResultPtr> &promise, const QMap<GTestCaseSpec, GTestCodeLocationList> result = visitor.gtestFunctions(); FilePath proFile; - const QList<CppEditor::ProjectPart::ConstPtr> &ppList = modelManager->projectPart(filePath); + const QList<CppEditor::ProjectPart::ConstPtr> &ppList = + CppEditor::CppModelManager::projectPart(filePath); if (!ppList.isEmpty()) proFile = FilePath::fromString(ppList.first()->projectFile); else diff --git a/src/plugins/autotest/gtest/gtesttreeitem.cpp b/src/plugins/autotest/gtest/gtesttreeitem.cpp index ddeb8b8c4bf..fdcf150f9c0 100644 --- a/src/plugins/autotest/gtest/gtesttreeitem.cpp +++ b/src/plugins/autotest/gtest/gtesttreeitem.cpp @@ -504,14 +504,14 @@ QString GTestTreeItem::nameSuffix() const QSet<QString> internalTargets(const TestTreeItem &item) { QSet<QString> result; - const auto cppMM = CppEditor::CppModelManager::instance(); - const auto projectInfo = cppMM->projectInfo(ProjectExplorer::ProjectManager::startupProject()); + const auto projectInfo = CppEditor::CppModelManager::projectInfo( + ProjectExplorer::ProjectManager::startupProject()); if (!projectInfo) return {}; const FilePath filePath = item.filePath(); const QVector<CppEditor::ProjectPart::ConstPtr> projectParts = projectInfo->projectParts(); if (projectParts.isEmpty()) - return cppMM->dependingInternalTargets(item.filePath()); + return CppEditor::CppModelManager::dependingInternalTargets(item.filePath()); for (const CppEditor::ProjectPart::ConstPtr &projectPart : projectParts) { if (FilePath::fromString(projectPart->projectFile) == item.proFile() && Utils::anyOf(projectPart->files, [&filePath](const CppEditor::ProjectFile &pf) { @@ -519,7 +519,7 @@ QSet<QString> internalTargets(const TestTreeItem &item) })) { result.insert(projectPart->buildSystemTarget); if (projectPart->buildTargetType != ProjectExplorer::BuildTargetType::Executable) - result.unite(cppMM->dependingInternalTargets(filePath)); + result.unite(CppEditor::CppModelManager::dependingInternalTargets(filePath)); } } return result; diff --git a/src/plugins/autotest/itestparser.cpp b/src/plugins/autotest/itestparser.cpp index 79fde2a0bb1..99b760f78bd 100644 --- a/src/plugins/autotest/itestparser.cpp +++ b/src/plugins/autotest/itestparser.cpp @@ -28,14 +28,14 @@ void CppParser::init(const QSet<FilePath> &filesToParse, bool fullParse) { Q_UNUSED(filesToParse) Q_UNUSED(fullParse) - m_cppSnapshot = CppEditor::CppModelManager::instance()->snapshot(); - m_workingCopy = CppEditor::CppModelManager::instance()->workingCopy(); + m_cppSnapshot = CppEditor::CppModelManager::snapshot(); + m_workingCopy = CppEditor::CppModelManager::workingCopy(); } bool CppParser::selectedForBuilding(const FilePath &fileName) { QList<CppEditor::ProjectPart::ConstPtr> projParts = - CppEditor::CppModelManager::instance()->projectPart(fileName); + CppEditor::CppModelManager::projectPart(fileName); return !projParts.isEmpty() && projParts.at(0)->selectedForBuilding; } @@ -62,8 +62,8 @@ bool precompiledHeaderContains(const CPlusPlus::Snapshot &snapshot, const QString &cacheString, const std::function<bool(const FilePath &)> &checker) { - const CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance(); - const QList<CppEditor::ProjectPart::ConstPtr> projectParts = modelManager->projectPart(filePath); + const QList<CppEditor::ProjectPart::ConstPtr> projectParts + = CppEditor::CppModelManager::projectPart(filePath); if (projectParts.isEmpty()) return false; const QStringList precompiledHeaders = projectParts.first()->precompiledHeaders; diff --git a/src/plugins/autotest/qtest/qttestparser.cpp b/src/plugins/autotest/qtest/qttestparser.cpp index 57c85b08a9e..824f4860a45 100644 --- a/src/plugins/autotest/qtest/qttestparser.cpp +++ b/src/plugins/autotest/qtest/qttestparser.cpp @@ -74,7 +74,7 @@ static bool includesQtTest(const CPlusPlus::Document::Ptr &doc, const CPlusPlus: static bool qtTestLibDefined(const FilePath &fileName) { const QList<CppEditor::ProjectPart::ConstPtr> parts = - CppEditor::CppModelManager::instance()->projectPart(fileName); + CppEditor::CppModelManager::projectPart(fileName); if (parts.size() > 0) { return Utils::anyOf(parts.at(0)->projectMacros, [](const ProjectExplorer::Macro ¯o) { return macro.key == "QT_TESTLIB_LIB"; @@ -83,11 +83,10 @@ static bool qtTestLibDefined(const FilePath &fileName) return false; } -TestCases QtTestParser::testCases(const CppEditor::CppModelManager *modelManager, - const FilePath &filePath) const +TestCases QtTestParser::testCases(const FilePath &filePath) const { const QByteArray &fileContent = getFileContent(filePath); - CPlusPlus::Document::Ptr document = modelManager->document(filePath); + CPlusPlus::Document::Ptr document = CppEditor::CppModelManager::document(filePath); if (document.isNull()) return {}; @@ -305,8 +304,7 @@ bool QtTestParser::processDocument(QPromise<TestParseResultPtr> &promise, return false; } - const CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance(); - TestCases testCaseList(testCases(modelManager, fileName)); + TestCases testCaseList(testCases(fileName)); bool reported = false; // we might be in a reparse without the original entry point with the QTest::qExec() if (testCaseList.isEmpty() && !oldTestCases.empty()) @@ -319,7 +317,7 @@ bool QtTestParser::processDocument(QPromise<TestParseResultPtr> &promise, continue; QList<CppEditor::ProjectPart::ConstPtr> projectParts - = modelManager->projectPart(fileName); + = CppEditor::CppModelManager::projectPart(fileName); if (projectParts.isEmpty()) // happens if shutting down while parsing return false; diff --git a/src/plugins/autotest/qtest/qttestparser.h b/src/plugins/autotest/qtest/qttestparser.h index abd8b2b0aaa..ece2bc639c5 100644 --- a/src/plugins/autotest/qtest/qttestparser.h +++ b/src/plugins/autotest/qtest/qttestparser.h @@ -10,8 +10,6 @@ #include <optional> -namespace CppEditor { class CppModelManager; } - namespace Autotest { namespace Internal { @@ -40,8 +38,7 @@ public: const Utils::FilePath &fileName) override; private: - TestCases testCases(const CppEditor::CppModelManager *modelManager, - const Utils::FilePath &fileName) const; + TestCases testCases(const Utils::FilePath &fileName) const; QHash<QString, QtTestCodeLocationList> checkForDataTags(const Utils::FilePath &fileName) const; struct TestCaseData { Utils::FilePath fileName; diff --git a/src/plugins/autotest/qtest/qttesttreeitem.cpp b/src/plugins/autotest/qtest/qttesttreeitem.cpp index 81f95c17752..b44c79eed37 100644 --- a/src/plugins/autotest/qtest/qttesttreeitem.cpp +++ b/src/plugins/autotest/qtest/qttesttreeitem.cpp @@ -120,8 +120,6 @@ ITestConfiguration *QtTestTreeItem::testConfiguration() const { ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject(); QTC_ASSERT(project, return nullptr); - const auto cppMM = CppEditor::CppModelManager::instance(); - QTC_ASSERT(cppMM, return nullptr); QtTestConfiguration *config = nullptr; switch (type()) { @@ -155,15 +153,13 @@ ITestConfiguration *QtTestTreeItem::testConfiguration() const return nullptr; } if (config) - config->setInternalTargets(cppMM->internalTargets(filePath())); + config->setInternalTargets(CppEditor::CppModelManager::internalTargets(filePath())); return config; } static void fillTestConfigurationsFromCheckState(const TestTreeItem *item, QList<ITestConfiguration *> &testConfigurations) { - const auto cppMM = CppEditor::CppModelManager::instance(); - QTC_ASSERT(cppMM, return); QTC_ASSERT(item, return); if (item->type() == TestTreeItem::GroupNode) { for (int row = 0, count = item->childCount(); row < count; ++row) @@ -198,15 +194,14 @@ static void fillTestConfigurationsFromCheckState(const TestTreeItem *item, testConfig->setTestCases(testCases); testConfig->setProjectFile(item->proFile()); testConfig->setProject(ProjectExplorer::ProjectManager::startupProject()); - testConfig->setInternalTargets(cppMM->internalTargets(item->filePath())); + testConfig->setInternalTargets( + CppEditor::CppModelManager::internalTargets(item->filePath())); testConfigurations << testConfig; } } static void collectFailedTestInfo(TestTreeItem *item, QList<ITestConfiguration *> &testConfigs) { - const auto cppMM = CppEditor::CppModelManager::instance(); - QTC_ASSERT(cppMM, return); QTC_ASSERT(item, return); if (item->type() == TestTreeItem::GroupNode) { for (int row = 0, count = item->childCount(); row < count; ++row) @@ -232,7 +227,8 @@ static void collectFailedTestInfo(TestTreeItem *item, QList<ITestConfiguration * testConfig->setTestCases(testCases); testConfig->setProjectFile(item->proFile()); testConfig->setProject(ProjectExplorer::ProjectManager::startupProject()); - testConfig->setInternalTargets(cppMM->internalTargets(item->filePath())); + testConfig->setInternalTargets( + CppEditor::CppModelManager::internalTargets(item->filePath())); testConfigs << testConfig; } diff --git a/src/plugins/autotest/quick/quicktestparser.cpp b/src/plugins/autotest/quick/quicktestparser.cpp index 64b98e1aa28..6482f1613f3 100644 --- a/src/plugins/autotest/quick/quicktestparser.cpp +++ b/src/plugins/autotest/quick/quicktestparser.cpp @@ -82,9 +82,10 @@ static bool includesQtQuickTest(const CPlusPlus::Document::Ptr &doc, return false; } -static QString quickTestSrcDir(const CppEditor::CppModelManager *cppMM, const FilePath &fileName) +static QString quickTestSrcDir(const FilePath &fileName) { - const QList<CppEditor::ProjectPart::ConstPtr> parts = cppMM->projectPart(fileName); + const QList<CppEditor::ProjectPart::ConstPtr> parts = + CppEditor::CppModelManager::projectPart(fileName); if (parts.size() > 0) { const ProjectExplorer::Macros ¯os = parts.at(0)->projectMacros; auto found = std::find_if(macros.cbegin(), macros.cend(), @@ -252,17 +253,17 @@ bool QuickTestParser::handleQtQuickTest(QPromise<TestParseResultPtr> &promise, CPlusPlus::Document::Ptr document, ITestFramework *framework) { - const CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance(); if (quickTestName(document).isEmpty()) return false; - QList<CppEditor::ProjectPart::ConstPtr> ppList = modelManager->projectPart(document->filePath()); + QList<CppEditor::ProjectPart::ConstPtr> ppList = + CppEditor::CppModelManager::projectPart(document->filePath()); if (ppList.isEmpty()) // happens if shutting down while parsing return false; const FilePath cppFileName = document->filePath(); const FilePath proFile = FilePath::fromString(ppList.at(0)->projectFile); m_mainCppFiles.insert(cppFileName, proFile); - const FilePath srcDir = FilePath::fromString(quickTestSrcDir(modelManager, cppFileName)); + const FilePath srcDir = FilePath::fromString(quickTestSrcDir(cppFileName)); if (srcDir.isEmpty()) return false; diff --git a/src/plugins/autotest/quick/quicktesttreeitem.cpp b/src/plugins/autotest/quick/quicktesttreeitem.cpp index 88f43e15419..5252f8ea27b 100644 --- a/src/plugins/autotest/quick/quicktesttreeitem.cpp +++ b/src/plugins/autotest/quick/quicktesttreeitem.cpp @@ -370,8 +370,8 @@ bool QuickTestTreeItem::isGroupable() const QSet<QString> internalTargets(const FilePath &proFile) { QSet<QString> result; - const auto cppMM = CppEditor::CppModelManager::instance(); - const auto projectInfo = cppMM->projectInfo(ProjectExplorer::ProjectManager::startupProject()); + const auto projectInfo = + CppEditor::CppModelManager::projectInfo(ProjectExplorer::ProjectManager::startupProject()); if (!projectInfo) return {}; for (const CppEditor::ProjectPart::ConstPtr &projectPart : projectInfo->projectParts()) { diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index 2648d63cd03..5dfecdadf15 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -337,7 +337,7 @@ void TestCodeParser::scanForTests(const QSet<FilePath> &filePaths, qCDebug(LOG) << QDateTime::currentDateTime().toString("hh:mm:ss.zzz") << "StartParsing"; m_parsingTimer.restart(); QSet<QString> extensions; - const auto cppSnapshot = CppEditor::CppModelManager::instance()->snapshot(); + const auto cppSnapshot = CppEditor::CppModelManager::snapshot(); for (ITestParser *parser : codeParsers) { parser->init(files, isFullParse); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvproject.cpp b/src/plugins/baremetal/debugservers/uvsc/uvproject.cpp index faa32fea086..6b3bd5b42ed 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvproject.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvproject.cpp @@ -65,7 +65,7 @@ static void extractAllFiles(const DebuggerRunTool *runTool, QStringList &include FilePaths &headers, FilePaths &sources, FilePaths &assemblers) { const auto project = runTool->runControl()->project(); - const CppEditor::ProjectInfo::ConstPtr info = CppModelManager::instance()->projectInfo(project); + const CppEditor::ProjectInfo::ConstPtr info = CppModelManager::projectInfo(project); if (!info) return; const QVector<ProjectPart::ConstPtr> parts = info->projectParts(); diff --git a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp index d9830ec8aa3..f178dc2824e 100644 --- a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp +++ b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp @@ -53,7 +53,7 @@ void ClangCodeModelPlugin::generateCompilationDB() if (!target) return; - const auto projectInfo = CppModelManager::instance()->projectInfo(target->project()); + const auto projectInfo = CppModelManager::projectInfo(target->project()); if (!projectInfo) return; FilePath baseDir = projectInfo->buildRoot(); @@ -78,7 +78,7 @@ ClangCodeModelPlugin::~ClangCodeModelPlugin() void ClangCodeModelPlugin::initialize() { TaskHub::addCategory({Constants::TASK_CATEGORY_DIAGNOSTICS, Tr::tr("Clang Code Model")}); - CppEditor::CppModelManager::instance()->activateClangCodeModel( + CppEditor::CppModelManager::activateClangCodeModel( std::make_unique<ClangModelManagerSupport>()); createCompilationDBAction(); @@ -135,8 +135,8 @@ void ClangCodeModelPlugin::createCompilationDBAction() "No active project."); return; } - const CppEditor::ProjectInfo::ConstPtr projectInfo = CppEditor::CppModelManager::instance() - ->projectInfo(project); + const CppEditor::ProjectInfo::ConstPtr projectInfo = + CppEditor::CppModelManager::projectInfo(project); if (!projectInfo || projectInfo->projectParts().isEmpty()) { MessageManager::writeDisrupting("Cannot generate compilation database: " "Project has no C/C++ project parts."); diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 11d0f47f894..f4ff68f52ee 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -407,7 +407,7 @@ ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir, c const Utils::FilePath includeDir = CppEditor::ClangdSettings(d->settings).clangdIncludePath(); CppEditor::CompilerOptionsBuilder optionsBuilder = clangOptionsBuilder( - *CppEditor::CppModelManager::instance()->fallbackProjectPart(), + *CppEditor::CppModelManager::fallbackProjectPart(), warningsConfigForProject(nullptr), includeDir, {}); const CppEditor::UsePrecompiledHeaders usePch = CppEditor::getPchUsage(); const QJsonArray projectPartOptions = fullProjectPartOptions( @@ -755,7 +755,7 @@ bool ClangdClient::fileBelongsToProject(const Utils::FilePath &filePath) const RefactoringChangesData *ClangdClient::createRefactoringChangesBackend() const { return new CppEditor::CppRefactoringChangesData( - CppEditor::CppModelManager::instance()->snapshot()); + CppEditor::CppModelManager::snapshot()); } QVersionNumber ClangdClient::versionNumber() const @@ -875,8 +875,7 @@ void ClangdClient::updateParserConfig(const Utils::FilePath &filePath, // TODO: Should we write the editor defines into the json file? It seems strange // that they should affect the index only while the file is open in the editor. const auto projectPart = !config.preferredProjectPartId.isEmpty() - ? CppEditor::CppModelManager::instance()->projectPartForId( - config.preferredProjectPartId) + ? CppEditor::CppModelManager::projectPartForId(config.preferredProjectPartId) : projectPartForFile(filePath); if (!projectPart) return; diff --git a/src/plugins/clangcodemodel/clangdcompletion.cpp b/src/plugins/clangcodemodel/clangdcompletion.cpp index 50a78c657d2..08179005bc7 100644 --- a/src/plugins/clangcodemodel/clangdcompletion.cpp +++ b/src/plugins/clangcodemodel/clangdcompletion.cpp @@ -609,7 +609,7 @@ QList<AssistProposalItemInterface *> ClangdCompletionAssistProcessor::generateCo if (!doc || pos < 0 || !Utils::anyOf(items, criterion)) return itemGenerator(items); const QString content = doc->toPlainText(); - const bool requiresSignal = CppModelManager::instance()->getSignalSlotType( + const bool requiresSignal = CppModelManager::getSignalSlotType( filePath(), content.toUtf8(), pos) == SignalSlotType::NewStyleSignal; if (requiresSignal) diff --git a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp index 98e855b4195..e9f37abb4e5 100644 --- a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp +++ b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp @@ -62,11 +62,6 @@ using namespace Utils; namespace ClangCodeModel::Internal { -static CppModelManager *cppModelManager() -{ - return CppModelManager::instance(); -} - static Project *fallbackProject() { if (Project * const p = ProjectTree::currentProject()) @@ -202,10 +197,10 @@ ClangModelManagerSupport::ClangModelManagerSupport() watchForInternalChanges(); setupClangdConfigFile(); checkSystemForClangdSuitability(); - cppModelManager()->setCurrentDocumentFilter(std::make_unique<ClangdCurrentDocumentFilter>()); - cppModelManager()->setLocatorFilter(std::make_unique<ClangdAllSymbolsFilter>()); - cppModelManager()->setClassesFilter(std::make_unique<ClangdClassesFilter>()); - cppModelManager()->setFunctionsFilter(std::make_unique<ClangdFunctionsFilter>()); + CppModelManager::setCurrentDocumentFilter(std::make_unique<ClangdCurrentDocumentFilter>()); + CppModelManager::setLocatorFilter(std::make_unique<ClangdAllSymbolsFilter>()); + CppModelManager::setClassesFilter(std::make_unique<ClangdClassesFilter>()); + CppModelManager::setFunctionsFilter(std::make_unique<ClangdFunctionsFilter>()); // Setup matchers LocatorMatcher::addMatcherCreator(MatcherType::AllSymbols, [] { return LanguageClient::languageClientMatchers( @@ -226,7 +221,7 @@ ClangModelManagerSupport::ClangModelManagerSupport() connect(editorManager, &EditorManager::currentEditorChanged, this, &ClangModelManagerSupport::onCurrentEditorChanged); - CppModelManager *modelManager = cppModelManager(); + CppModelManager *modelManager = CppModelManager::instance(); connect(modelManager, &CppModelManager::abstractEditorSupportContentsUpdated, this, &ClangModelManagerSupport::onAbstractEditorSupportContentsUpdated); connect(modelManager, &CppModelManager::abstractEditorSupportRemoved, @@ -382,7 +377,7 @@ void ClangModelManagerSupport::checkUnused(const Link &link, SearchResult *searc } } - CppModelManager::instance()->modelManagerSupport( + CppModelManager::modelManagerSupport( CppModelManager::Backend::Builtin)->checkUnused(link, search, callback); } @@ -409,7 +404,7 @@ void ClangModelManagerSupport::onCurrentEditorChanged(IEditor *editor) { // Update task hub issues for current CppEditorDocument TaskHub::clearTasks(Constants::TASK_CATEGORY_DIAGNOSTICS); - if (!editor || !editor->document() || !cppModelManager()->isCppEditor(editor)) + if (!editor || !editor->document() || !CppModelManager::isCppEditor(editor)) return; const FilePath filePath = editor->document()->filePath(); @@ -460,12 +455,12 @@ static bool isProjectDataUpToDate(Project *project, ProjectInfoList projectInfo, return false; ProjectInfoList newProjectInfo; if (project) { - if (const ProjectInfo::ConstPtr pi = CppModelManager::instance()->projectInfo(project)) + if (const ProjectInfo::ConstPtr pi = CppModelManager::projectInfo(project)) newProjectInfo.append(pi); else return false; } else { - newProjectInfo = CppModelManager::instance()->projectInfos(); + newProjectInfo = CppModelManager::projectInfos(); } if (newProjectInfo.size() != projectInfo.size()) return false; @@ -486,8 +481,8 @@ void ClangModelManagerSupport::updateLanguageClient(Project *project) ProjectInfoList projectInfo; if (sessionModeEnabled()) { project = nullptr; - projectInfo = CppModelManager::instance()->projectInfos(); - } else if (const ProjectInfo::ConstPtr pi = CppModelManager::instance()->projectInfo(project)) { + projectInfo = CppModelManager::projectInfos(); + } else if (const ProjectInfo::ConstPtr pi = CppModelManager::projectInfo(project)) { projectInfo.append(pi); } else { return; @@ -771,7 +766,7 @@ void ClangModelManagerSupport::onEditorOpened(IEditor *editor) QTC_ASSERT(document, return); auto textDocument = qobject_cast<TextEditor::TextDocument *>(document); - if (textDocument && cppModelManager()->isCppEditor(editor)) { + if (textDocument && CppModelManager::isCppEditor(editor)) { connectToWidgetsMarkContextMenuRequested(editor->widget()); Project * project = ProjectManager::projectForFile(document->filePath()); diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index b9e9e7115ed..c89bdc15418 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -695,7 +695,7 @@ Tasking::Group ClangTool::runRecipe(const RunSettings &runSettings, } const ProjectInfo::ConstPtr projectInfoBeforeBuild - = CppModelManager::instance()->projectInfo(target->project()); + = CppModelManager::projectInfo(target->project()); const auto onTreeSetup = [this, storage, runSettings, diagnosticConfig, fileInfos, tempDir, environment, projectInfoBeforeBuild](TaskTree &taskTree) { @@ -710,7 +710,7 @@ Tasking::Group ClangTool::runRecipe(const RunSettings &runSettings, ProjectExplorerPlugin::saveModifiedFiles(); Project *project = m_runControl->project(); - const ProjectInfo::ConstPtr projectInfo = CppModelManager::instance()->projectInfo(project); + const ProjectInfo::ConstPtr projectInfo = CppModelManager::projectInfo(project); if (!projectInfo) { m_infoBarWidget->setError(InfoBarWidget::Error, failedMessage, [this] { showOutputPane(); }); @@ -892,7 +892,7 @@ FileInfos ClangTool::collectFileInfos(Project *project, FileSelection fileSelect return {}; } - const auto projectInfo = CppModelManager::instance()->projectInfo(project); + const auto projectInfo = CppModelManager::projectInfo(project); QTC_ASSERT(projectInfo, return FileInfos()); const FileInfos allFileInfos = sortedFileInfos(projectInfo->projectParts()); @@ -1024,7 +1024,7 @@ static bool canAnalyzeProject(Project *project) const bool projectSupportsLanguage = project->projectLanguages().contains(c) || project->projectLanguages().contains(cxx); return projectSupportsLanguage - && CppModelManager::instance()->projectInfo(project) + && CppModelManager::projectInfo(project) && ToolChainKitAspect::cxxToolChain(target->kit()); } return false; diff --git a/src/plugins/clangtools/documentclangtoolrunner.cpp b/src/plugins/clangtools/documentclangtoolrunner.cpp index 28ea234f9ad..5906cbc4e32 100644 --- a/src/plugins/clangtools/documentclangtoolrunner.cpp +++ b/src/plugins/clangtools/documentclangtoolrunner.cpp @@ -109,7 +109,7 @@ static VirtualFileSystemOverlay &vfso() static FileInfo getFileInfo(const FilePath &file, Project *project) { - const ProjectInfo::ConstPtr projectInfo = CppModelManager::instance()->projectInfo(project); + const ProjectInfo::ConstPtr projectInfo = CppModelManager::projectInfo(project); if (!projectInfo) return {}; diff --git a/src/plugins/classview/classviewparser.cpp b/src/plugins/classview/classviewparser.cpp index b766c0c4425..2906504eb7c 100644 --- a/src/plugins/classview/classviewparser.cpp +++ b/src/plugins/classview/classviewparser.cpp @@ -250,7 +250,7 @@ ParserTreeItem::ConstPtr Parser::getCachedOrParseDocumentTree(const CPlusPlus::D void Parser::updateDocuments(const QSet<FilePath> &documentPaths) { - updateDocumentsFromSnapshot(documentPaths, CppEditor::CppModelManager::instance()->snapshot()); + updateDocumentsFromSnapshot(documentPaths, CppEditor::CppModelManager::snapshot()); } void Parser::updateDocumentsFromSnapshot(const QSet<FilePath> &documentPaths, @@ -293,7 +293,7 @@ void Parser::resetData(const QHash<FilePath, QPair<QString, FilePaths>> &project d->m_projectCache.clear(); d->m_documentCache.clear(); - const CPlusPlus::Snapshot &snapshot = CppEditor::CppModelManager::instance()->snapshot(); + const CPlusPlus::Snapshot &snapshot = CppEditor::CppModelManager::snapshot(); for (auto it = projects.cbegin(); it != projects.cend(); ++it) { const auto projectData = it.value(); QSet<FilePath> commonFiles; @@ -313,7 +313,7 @@ void Parser::resetData(const QHash<FilePath, QPair<QString, FilePaths>> &project void Parser::addProject(const FilePath &projectPath, const QString &projectName, const FilePaths &filesInProject) { - const CPlusPlus::Snapshot &snapshot = CppEditor::CppModelManager::instance()->snapshot(); + const CPlusPlus::Snapshot &snapshot = CppEditor::CppModelManager::snapshot(); QSet<FilePath> commonFiles; for (const auto &fileInProject : filesInProject) { CPlusPlus::Document::Ptr doc = snapshot.document(fileInProject); diff --git a/src/plugins/cppcheck/cppchecktool.cpp b/src/plugins/cppcheck/cppchecktool.cpp index cd824b3db47..79e5a3e5b6e 100644 --- a/src/plugins/cppcheck/cppchecktool.cpp +++ b/src/plugins/cppcheck/cppchecktool.cpp @@ -180,7 +180,7 @@ void CppcheckTool::check(const Utils::FilePaths &files) return; const CppEditor::ProjectInfo::ConstPtr info - = CppEditor::CppModelManager::instance()->projectInfo(m_project); + = CppEditor::CppModelManager::projectInfo(m_project); if (!info) return; const QVector<CppEditor::ProjectPart::ConstPtr> parts = info->projectParts(); diff --git a/src/plugins/cppcheck/cppchecktrigger.cpp b/src/plugins/cppcheck/cppchecktrigger.cpp index 8be098df558..c7317a958d0 100644 --- a/src/plugins/cppcheck/cppchecktrigger.cpp +++ b/src/plugins/cppcheck/cppchecktrigger.cpp @@ -56,7 +56,7 @@ void CppcheckTrigger::checkEditors(const QList<IEditor *> &editors) using CppModelManager = CppEditor::CppModelManager; const CppEditor::ProjectInfo::ConstPtr info - = CppModelManager::instance()->projectInfo(m_currentProject); + = CppModelManager::projectInfo(m_currentProject); if (!info) return; diff --git a/src/plugins/cppeditor/abstracteditorsupport.cpp b/src/plugins/cppeditor/abstracteditorsupport.cpp index a275ed6b571..ff43c5895aa 100644 --- a/src/plugins/cppeditor/abstracteditorsupport.cpp +++ b/src/plugins/cppeditor/abstracteditorsupport.cpp @@ -16,26 +16,26 @@ using namespace Utils; namespace CppEditor { -AbstractEditorSupport::AbstractEditorSupport(CppModelManager *modelmanager, QObject *parent) : - QObject(parent), m_modelmanager(modelmanager), m_revision(1) +AbstractEditorSupport::AbstractEditorSupport(QObject *parent) : + QObject(parent), m_revision(1) { - modelmanager->addExtraEditorSupport(this); + CppModelManager::addExtraEditorSupport(this); } AbstractEditorSupport::~AbstractEditorSupport() { - m_modelmanager->removeExtraEditorSupport(this); + CppModelManager::removeExtraEditorSupport(this); } void AbstractEditorSupport::updateDocument() { ++m_revision; - m_modelmanager->updateSourceFiles({filePath()}); + CppModelManager::updateSourceFiles({filePath()}); } void AbstractEditorSupport::notifyAboutUpdatedContents() const { - m_modelmanager->emitAbstractEditorSupportContentsUpdated( + CppModelManager::emitAbstractEditorSupportContentsUpdated( filePath().toString(), sourceFilePath().toString(), contents()); } diff --git a/src/plugins/cppeditor/abstracteditorsupport.h b/src/plugins/cppeditor/abstracteditorsupport.h index 277001e0433..0f8a8d179b0 100644 --- a/src/plugins/cppeditor/abstracteditorsupport.h +++ b/src/plugins/cppeditor/abstracteditorsupport.h @@ -13,14 +13,12 @@ namespace ProjectExplorer { class Project; } namespace CppEditor { -class CppModelManager; - class CPPEDITOR_EXPORT AbstractEditorSupport : public QObject { Q_OBJECT public: - explicit AbstractEditorSupport(CppModelManager *modelmanager, QObject *parent = nullptr); + explicit AbstractEditorSupport(QObject *parent = nullptr); ~AbstractEditorSupport() override; /// \returns the contents, encoded as UTF-8 @@ -38,7 +36,6 @@ public: static bool usePragmaOnce(ProjectExplorer::Project *project); private: - CppModelManager *m_modelmanager; unsigned m_revision; }; diff --git a/src/plugins/cppeditor/baseeditordocumentparser.cpp b/src/plugins/cppeditor/baseeditordocumentparser.cpp index cbfa6f96859..109a478871f 100644 --- a/src/plugins/cppeditor/baseeditordocumentparser.cpp +++ b/src/plugins/cppeditor/baseeditordocumentparser.cpp @@ -92,8 +92,7 @@ ProjectPartInfo BaseEditorDocumentParser::projectPartInfo() const BaseEditorDocumentParser::Ptr BaseEditorDocumentParser::get(const FilePath &filePath) { - CppModelManager *cmmi = CppModelManager::instance(); - if (CppEditorDocumentHandle *cppEditorDocument = cmmi->cppEditorDocument(filePath)) { + if (CppEditorDocumentHandle *cppEditorDocument = CppModelManager::cppEditorDocument(filePath)) { if (BaseEditorDocumentProcessor *processor = cppEditorDocument->processor()) return processor->parser(); } @@ -109,14 +108,14 @@ ProjectPartInfo BaseEditorDocumentParser::determineProjectPart(const QString &fi { Internal::ProjectPartChooser chooser; chooser.setFallbackProjectPart([](){ - return CppModelManager::instance()->fallbackProjectPart(); + return CppModelManager::fallbackProjectPart(); }); chooser.setProjectPartsForFile([](const QString &filePath) { - return CppModelManager::instance()->projectPart(filePath); + return CppModelManager::projectPart(filePath); }); chooser.setProjectPartsFromDependenciesForFile([&](const QString &filePath) { const auto fileName = Utils::FilePath::fromString(filePath); - return CppModelManager::instance()->projectPartFromDependencies(fileName); + return CppModelManager::projectPartFromDependencies(fileName); }); const ProjectPartInfo chooserResult diff --git a/src/plugins/cppeditor/baseeditordocumentprocessor.cpp b/src/plugins/cppeditor/baseeditordocumentprocessor.cpp index c6c51675eb9..f48c5a710be 100644 --- a/src/plugins/cppeditor/baseeditordocumentprocessor.cpp +++ b/src/plugins/cppeditor/baseeditordocumentprocessor.cpp @@ -39,7 +39,7 @@ void BaseEditorDocumentProcessor::run(bool projectsUpdated) ? Utils::Language::C : Utils::Language::Cxx; - runImpl({CppModelManager::instance()->workingCopy(), + runImpl({CppModelManager::workingCopy(), ProjectExplorer::ProjectManager::startupProject(), languagePreference, projectsUpdated}); @@ -72,7 +72,7 @@ void BaseEditorDocumentProcessor::runParser(QPromise<void> &promise, } parser->update(promise, updateParams); - CppModelManager::instance()->finishedRefreshingSourceFiles({parser->filePath().toString()}); + CppModelManager::finishedRefreshingSourceFiles({parser->filePath().toString()}); promise.setProgressValue(1); } diff --git a/src/plugins/cppeditor/builtincursorinfo.cpp b/src/plugins/cppeditor/builtincursorinfo.cpp index 4545ebe748d..15e1e0f4921 100644 --- a/src/plugins/cppeditor/builtincursorinfo.cpp +++ b/src/plugins/cppeditor/builtincursorinfo.cpp @@ -218,8 +218,8 @@ private: if (Symbol *s = Internal::CanonicalSymbol::canonicalSymbol( m_scope, m_expression, typeOfExpression)) { - const QList<int> tokenIndices = CppModelManager::instance() - ->references(s, typeOfExpression.context()); + const QList<int> tokenIndices = + CppModelManager::references(s, typeOfExpression.context()); result = toRanges(tokenIndices, m_document->translationUnit()); } diff --git a/src/plugins/cppeditor/builtineditordocumentparser.cpp b/src/plugins/cppeditor/builtineditordocumentparser.cpp index f6d7d6faf22..7c8444098e0 100644 --- a/src/plugins/cppeditor/builtineditordocumentparser.cpp +++ b/src/plugins/cppeditor/builtineditordocumentparser.cpp @@ -59,8 +59,7 @@ void BuiltinEditorDocumentParser::updateImpl(const QPromise<void> &promise, bool invalidateSnapshot = false, invalidateConfig = false; - CppModelManager *modelManager = CppModelManager::instance(); - QByteArray configFile = modelManager->codeModelConfiguration(); + QByteArray configFile = CppModelManager::codeModelConfiguration(); ProjectExplorer::HeaderPaths headerPaths; FilePaths includedFiles; FilePaths precompiledHeaders; @@ -131,7 +130,7 @@ void BuiltinEditorDocumentParser::updateImpl(const QPromise<void> &promise, else invalidateSnapshot = true; - Snapshot globalSnapshot = modelManager->snapshot(); + Snapshot globalSnapshot = CppModelManager::snapshot(); if (invalidateSnapshot) { state.snapshot = Snapshot(); @@ -172,19 +171,19 @@ void BuiltinEditorDocumentParser::updateImpl(const QPromise<void> &promise, Internal::CppSourceProcessor sourceProcessor(state.snapshot, [&](const Document::Ptr &doc) { const bool isInEditor = doc->filePath() == filePath(); - Document::Ptr otherDoc = modelManager->document(doc->filePath()); + Document::Ptr otherDoc = CppModelManager::document(doc->filePath()); unsigned newRev = otherDoc.isNull() ? 1U : otherDoc->revision() + 1; if (isInEditor) newRev = qMax(rev + 1, newRev); doc->setRevision(newRev); - modelManager->emitDocumentUpdated(doc); + CppModelManager::emitDocumentUpdated(doc); if (releaseSourceAndAST_) doc->releaseSourceAndAST(); }); sourceProcessor.setFileSizeLimitInMb(m_fileSizeLimitInMb); sourceProcessor.setCancelChecker([&promise] { return promise.isCanceled(); }); - Snapshot globalSnapshot = modelManager->snapshot(); + Snapshot globalSnapshot = CppModelManager::snapshot(); globalSnapshot.remove(filePath()); sourceProcessor.setGlobalSnapshot(globalSnapshot); sourceProcessor.setWorkingCopy(workingCopy); diff --git a/src/plugins/cppeditor/builtineditordocumentprocessor.cpp b/src/plugins/cppeditor/builtineditordocumentprocessor.cpp index f4df1fcd0cd..cb94e84a67b 100644 --- a/src/plugins/cppeditor/builtineditordocumentprocessor.cpp +++ b/src/plugins/cppeditor/builtineditordocumentprocessor.cpp @@ -183,7 +183,7 @@ BuiltinEditorDocumentProcessor::~BuiltinEditorDocumentProcessor() void BuiltinEditorDocumentProcessor::runImpl( const BaseEditorDocumentParser::UpdateParams &updateParams) { - m_parserFuture = Utils::asyncRun(CppModelManager::instance()->sharedThreadPool(), + m_parserFuture = Utils::asyncRun(CppModelManager::sharedThreadPool(), runParser, parser(), updateParams); } @@ -277,8 +277,7 @@ void BuiltinEditorDocumentProcessor::onParserFinished(CPlusPlus::Document::Ptr d continue; if (cppEditorDoc->filePath() == document->filePath()) continue; - CPlusPlus::Document::Ptr cppDoc = CppModelManager::instance()->document( - cppEditorDoc->filePath()); + CPlusPlus::Document::Ptr cppDoc = CppModelManager::document(cppEditorDoc->filePath()); if (!cppDoc) continue; if (!cppDoc->includedFiles().contains(document->filePath())) @@ -325,7 +324,7 @@ SemanticInfo::Source BuiltinEditorDocumentProcessor::createSemanticInfoSource(bo { QByteArray source; int revision = 0; - if (const auto entry = CppModelManager::instance()->workingCopy().get(filePath())) { + if (const auto entry = CppModelManager::workingCopy().get(filePath())) { source = entry->first; revision = entry->second; } diff --git a/src/plugins/cppeditor/cppbuiltinmodelmanagersupport.cpp b/src/plugins/cppeditor/cppbuiltinmodelmanagersupport.cpp index 4cc69fe4392..01a208f7032 100644 --- a/src/plugins/cppeditor/cppbuiltinmodelmanagersupport.cpp +++ b/src/plugins/cppeditor/cppbuiltinmodelmanagersupport.cpp @@ -105,7 +105,7 @@ void BuiltinModelManagerSupport::followSymbol(const CursorInEditor &data, { SymbolFinder finder; m_followSymbol->findLink(data, processLinkCallback, - resolveTarget, CppModelManager::instance()->snapshot(), + resolveTarget, CppModelManager::snapshot(), data.editorWidget()->semanticInfo().doc, &finder, inNextSplit); } @@ -125,7 +125,7 @@ void BuiltinModelManagerSupport::switchDeclDef(const CursorInEditor &data, { SymbolFinder finder; m_followSymbol->switchDeclDef(data, processLinkCallback, - CppModelManager::instance()->snapshot(), data.editorWidget()->semanticInfo().doc, + CppModelManager::snapshot(), data.editorWidget()->semanticInfo().doc, &finder); } @@ -144,47 +144,39 @@ void BuiltinModelManagerSupport::globalRename(const CursorInEditor &data, const QString &replacement, const std::function<void()> &callback) { - CppModelManager *modelManager = CppModelManager::instance(); - if (!modelManager) - return; - CppEditorWidget *editorWidget = data.editorWidget(); QTC_ASSERT(editorWidget, return;); SemanticInfo info = editorWidget->semanticInfo(); - info.snapshot = modelManager->snapshot(); + info.snapshot = CppModelManager::snapshot(); info.snapshot.insert(info.doc); const QTextCursor &cursor = data.cursor(); if (const CPlusPlus::Macro *macro = findCanonicalMacro(cursor, info.doc)) { - modelManager->renameMacroUsages(*macro, replacement); + CppModelManager::renameMacroUsages(*macro, replacement); } else { Internal::CanonicalSymbol cs(info.doc, info.snapshot); CPlusPlus::Symbol *canonicalSymbol = cs(cursor); if (canonicalSymbol) - modelManager->renameUsages(canonicalSymbol, cs.context(), replacement, callback); + CppModelManager::renameUsages(canonicalSymbol, cs.context(), replacement, callback); } } void BuiltinModelManagerSupport::findUsages(const CursorInEditor &data) const { - CppModelManager *modelManager = CppModelManager::instance(); - if (!modelManager) - return; - CppEditorWidget *editorWidget = data.editorWidget(); QTC_ASSERT(editorWidget, return;); SemanticInfo info = editorWidget->semanticInfo(); - info.snapshot = modelManager->snapshot(); + info.snapshot = CppModelManager::snapshot(); info.snapshot.insert(info.doc); const QTextCursor &cursor = data.cursor(); if (const CPlusPlus::Macro *macro = findCanonicalMacro(cursor, info.doc)) { - modelManager->findMacroUsages(*macro); + CppModelManager::findMacroUsages(*macro); } else { Internal::CanonicalSymbol cs(info.doc, info.snapshot); CPlusPlus::Symbol *canonicalSymbol = cs(cursor); if (canonicalSymbol) - modelManager->findUsages(canonicalSymbol, cs.context()); + CppModelManager::findUsages(canonicalSymbol, cs.context()); } } @@ -199,7 +191,7 @@ void BuiltinModelManagerSupport::switchHeaderSource(const FilePath &filePath, void BuiltinModelManagerSupport::checkUnused(const Utils::Link &link, SearchResult *search, const Utils::LinkHandler &callback) { - CPlusPlus::Snapshot snapshot = CppModelManager::instance()->snapshot(); + CPlusPlus::Snapshot snapshot = CppModelManager::snapshot(); QFile file(link.targetFilePath.toString()); if (!file.open(QIODevice::ReadOnly)) return callback(link); diff --git a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp index 48ee4c80f1e..0b4c5d9af38 100644 --- a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp +++ b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp @@ -1642,8 +1642,6 @@ void CppCodeModelInspectorDialog::onWorkingCopyDocumentSelected(const QModelInde void CppCodeModelInspectorDialog::refresh() { - CppModelManager *cmmi = CppModelManager::instance(); - const int oldSnapshotIndex = m_snapshotSelector->currentIndex(); const bool selectEditorRelevant = m_selectEditorRelevantEntriesAfterRefreshCheckBox->isChecked(); @@ -1652,7 +1650,7 @@ void CppCodeModelInspectorDialog::refresh() m_snapshotInfos->clear(); m_snapshotSelector->clear(); - const Snapshot globalSnapshot = cmmi->snapshot(); + const Snapshot globalSnapshot = CppModelManager::snapshot(); CppCodeModelInspector::Dumper dumper(globalSnapshot); m_snapshotModel->setGlobalSnapshot(globalSnapshot); @@ -1666,7 +1664,7 @@ void CppCodeModelInspectorDialog::refresh() CppEditorDocumentHandle *cppEditorDocument = nullptr; if (editor) { const FilePath editorFilePath = editor->document()->filePath(); - cppEditorDocument = cmmi->cppEditorDocument(editorFilePath); + cppEditorDocument = CppModelManager::cppEditorDocument(editorFilePath); if (auto documentProcessor = CppModelManager::cppEditorDocumentProcessor(editorFilePath)) { const Snapshot editorSnapshot = documentProcessor->snapshot(); m_snapshotInfos->append(SnapshotInfo(editorSnapshot, SnapshotInfo::EditorSnapshot)); @@ -1721,7 +1719,7 @@ void CppCodeModelInspectorDialog::refresh() ? cppEditorDocument->processor()->parser()->projectPartInfo().projectPart : ProjectPart::ConstPtr(); - const QList<ProjectInfo::ConstPtr> projectInfos = cmmi->projectInfos(); + const QList<ProjectInfo::ConstPtr> projectInfos = CppModelManager::projectInfos(); dumper.dumpProjectInfos(projectInfos); m_projectPartsModel->configure(projectInfos, editorsProjectPart); m_projectPartsView->resizeColumns(ProjectPartsModel::ColumnCount); @@ -1737,7 +1735,7 @@ void CppCodeModelInspectorDialog::refresh() } // Working Copy - const WorkingCopy workingCopy = cmmi->workingCopy(); + const WorkingCopy workingCopy = CppModelManager::workingCopy(); dumper.dumpWorkingCopy(workingCopy); m_workingCopyModel->configure(workingCopy); m_workingCopyView->resizeColumns(WorkingCopyModel::ColumnCount); @@ -1752,8 +1750,8 @@ void CppCodeModelInspectorDialog::refresh() } // Merged entities - dumper.dumpMergedEntities(cmmi->headerPaths(), - ProjectExplorer::Macro::toByteArray(cmmi->definedMacros())); + dumper.dumpMergedEntities(CppModelManager::headerPaths(), + ProjectExplorer::Macro::toByteArray(CppModelManager::definedMacros())); } enum DocumentTabs { diff --git a/src/plugins/cppeditor/cppcodemodelinspectordumper.cpp b/src/plugins/cppeditor/cppcodemodelinspectordumper.cpp index e2c879b1835..28d96779d66 100644 --- a/src/plugins/cppeditor/cppcodemodelinspectordumper.cpp +++ b/src/plugins/cppeditor/cppcodemodelinspectordumper.cpp @@ -395,7 +395,7 @@ QString Utils::toString(const ProjectExplorer::Abi &abi) QString Utils::partsForFile(const ::Utils::FilePath &filePath) { const QList<ProjectPart::ConstPtr> parts - = CppModelManager::instance()->projectPart(filePath); + = CppModelManager::projectPart(filePath); QString result; for (const ProjectPart::ConstPtr &part : parts) result += part->displayName + QLatin1Char(','); diff --git a/src/plugins/cppeditor/cppcompletionassist.cpp b/src/plugins/cppeditor/cppcompletionassist.cpp index 19ad8b5120c..82d15774330 100644 --- a/src/plugins/cppeditor/cppcompletionassist.cpp +++ b/src/plugins/cppeditor/cppcompletionassist.cpp @@ -417,7 +417,7 @@ std::unique_ptr<AssistInterface> InternalCompletionAssistProvider::createAssistI BuiltinEditorDocumentParser::get(filePath), languageFeatures, reason, - CppModelManager::instance()->workingCopy()); + CppModelManager::workingCopy()); } // ----------------- @@ -2076,7 +2076,7 @@ void CppCompletionAssistInterface::getCppSpecifics() const m_gotCppSpecifics = true; if (m_parser) { - m_parser->update({CppModelManager::instance()->workingCopy(), + m_parser->update({CppModelManager::workingCopy(), nullptr, Utils::Language::Cxx, false}); diff --git a/src/plugins/cppeditor/cppeditordocument.cpp b/src/plugins/cppeditor/cppeditordocument.cpp index 9e7856b74b2..e03dc2b40fe 100644 --- a/src/plugins/cppeditor/cppeditordocument.cpp +++ b/src/plugins/cppeditor/cppeditordocument.cpp @@ -41,11 +41,6 @@ using namespace Utils; namespace CppEditor { namespace Internal { -static CppEditor::CppModelManager *mm() -{ - return CppEditor::CppModelManager::instance(); -} - enum { processDocumentIntervalInMs = 150 }; class CppEditorDocumentHandleImpl : public CppEditorDocumentHandle @@ -55,12 +50,12 @@ public: : m_cppEditorDocument(cppEditorDocument) , m_registrationFilePath(cppEditorDocument->filePath().toString()) { - mm()->registerCppEditorDocument(this); + CppModelManager::registerCppEditorDocument(this); } ~CppEditorDocumentHandleImpl() override { - mm()->unregisterCppEditorDocument(m_registrationFilePath); + CppModelManager::unregisterCppEditorDocument(m_registrationFilePath); } FilePath filePath() const override { return m_cppEditorDocument->filePath(); } @@ -101,7 +96,7 @@ CppEditorDocument::CppEditorDocument() connect(this, &IDocument::filePathChanged, this, &CppEditorDocument::onFilePathChanged); - connect(mm(), &CppModelManager::diagnosticsChanged, + connect(CppModelManager::instance(), &CppModelManager::diagnosticsChanged, this, &CppEditorDocument::onDiagnosticsChanged); connect(&m_parseContextModel, &ParseContextModel::preferredParseContextChanged, @@ -187,7 +182,7 @@ void CppEditorDocument::onMimeTypeChanged() const QString &mt = mimeType(); m_isObjCEnabled = (mt == QLatin1String(Constants::OBJECTIVE_C_SOURCE_MIMETYPE) || mt == QLatin1String(Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE)); - m_completionAssistProvider = mm()->completionAssistProvider(); + m_completionAssistProvider = CppModelManager::completionAssistProvider(); initializeTimer(); } @@ -380,7 +375,7 @@ void CppEditorDocument::updateOutline() { CPlusPlus::Document::Ptr document; if (!usesClangd()) - document = CppModelManager::instance()->snapshot().document(filePath()); + document = CppModelManager::snapshot().document(filePath()); m_overviewModel.update(document); } @@ -392,7 +387,7 @@ QFuture<CursorInfo> CppEditorDocument::cursorInfo(const CursorInfoParams ¶ms BaseEditorDocumentProcessor *CppEditorDocument::processor() { if (!m_processor) { - m_processor.reset(mm()->createEditorDocumentProcessor(this)); + m_processor.reset(CppModelManager::createEditorDocumentProcessor(this)); connect(m_processor.data(), &BaseEditorDocumentProcessor::projectPartInfoUpdated, [this](const ProjectPartInfo &info) { @@ -493,7 +488,7 @@ void CppEditorDocument::onDiagnosticsChanged(const QString &fileName, const QStr const Utils::Id category = Utils::Id::fromString(kind); - for (const auto &diagnostic : mm()->diagnosticMessages()) { + for (const auto &diagnostic : CppModelManager::diagnosticMessages()) { if (diagnostic.filePath() == filePath()) { auto it = std::find_if(std::begin(removedMarks), std::end(removedMarks), diff --git a/src/plugins/cppeditor/cppeditoroutline.cpp b/src/plugins/cppeditor/cppeditoroutline.cpp index a34d2543612..4c39851274b 100644 --- a/src/plugins/cppeditor/cppeditoroutline.cpp +++ b/src/plugins/cppeditor/cppeditoroutline.cpp @@ -125,7 +125,7 @@ QWidget *CppEditorOutline::widget() const QSharedPointer<CPlusPlus::Document> getDocument(const Utils::FilePath &filePath) { - const CPlusPlus::Snapshot snapshot = CppModelManager::instance()->snapshot(); + const CPlusPlus::Snapshot snapshot = CppModelManager::snapshot(); return snapshot.document(filePath); } diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 223ec0e09f7..40f1917a5a9 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -231,7 +231,7 @@ void CppEditorPlugin::initialize() d = new CppEditorPluginPrivate; d->initialize(); - CppModelManager::instance()->registerJsExtension(); + CppModelManager::registerJsExtension(); ExtensionSystem::PluginManager::addObject(&d->m_cppProjectUpdaterFactory); // Menus @@ -446,9 +446,8 @@ void CppEditorPlugin::initialize() cppToolsMenu->addSeparator(Core::Constants::G_DEFAULT_THREE); d->m_reparseExternallyChangedFiles = new QAction(Tr::tr("Reparse Externally Changed Files"), this); cmd = ActionManager::registerAction(d->m_reparseExternallyChangedFiles, Constants::UPDATE_CODEMODEL); - CppModelManager *cppModelManager = CppModelManager::instance(); connect(d->m_reparseExternallyChangedFiles, &QAction::triggered, - cppModelManager, &CppModelManager::updateModifiedSourceFiles); + CppModelManager::instance(), &CppModelManager::updateModifiedSourceFiles); cppToolsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE); ActionContainer *toolsDebug = ActionManager::actionContainer(Core::Constants::M_TOOLS_DEBUG); @@ -515,7 +514,7 @@ void CppEditorPlugin::extensionsInitialized() }); ProjectPanelFactory::registerFactory(fileNamesPanelFactory); - if (CppModelManager::instance()->isClangCodeModelActive()) { + if (CppModelManager::isClangCodeModelActive()) { d->m_clangdSettingsPage = new ClangdSettingsPage; const auto clangdPanelFactory = new ProjectPanelFactory; clangdPanelFactory->setPriority(100); @@ -528,7 +527,7 @@ void CppEditorPlugin::extensionsInitialized() // Add the hover handler factories here instead of in initialize() // so that the Clang Code Model has a chance to hook in. - d->m_cppEditorFactory.addHoverHandler(CppModelManager::instance()->createHoverHandler()); + d->m_cppEditorFactory.addHoverHandler(CppModelManager::createHoverHandler()); d->m_cppEditorFactory.addHoverHandler(new ColorPreviewHoverHandler); d->m_cppEditorFactory.addHoverHandler(new ResourcePreviewHoverHandler); @@ -876,8 +875,7 @@ FilePath correspondingHeaderOrSource(const FilePath &filePath, bool *wasHeader, // Find files in other projects } else { - CppModelManager *modelManager = CppModelManager::instance(); - const QList<ProjectInfo::ConstPtr> projectInfos = modelManager->projectInfos(); + const QList<ProjectInfo::ConstPtr> projectInfos = CppModelManager::projectInfos(); for (const ProjectInfo::ConstPtr &projectInfo : projectInfos) { const Project *project = projectForProjectInfo(*projectInfo); if (project == currentProject) diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index e8bf8750110..4ebcf3941ef 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -383,8 +383,6 @@ public: bool shouldOfferOutline() const { return !CppModelManager::usesClangd(m_cppEditorDocument); } public: - QPointer<CppModelManager> m_modelManager; - CppEditorDocument *m_cppEditorDocument; CppEditorOutline *m_cppEditorOutline = nullptr; @@ -405,8 +403,7 @@ public: }; CppEditorWidgetPrivate::CppEditorWidgetPrivate(CppEditorWidget *q) - : m_modelManager(CppModelManager::instance()) - , m_cppEditorDocument(qobject_cast<CppEditorDocument *>(q->textDocument())) + : m_cppEditorDocument(qobject_cast<CppEditorDocument *>(q->textDocument())) , m_declDefLinkFinder(new FunctionDeclDefLinkFinder(q)) , m_localRenaming(q) , m_useSelectionsUpdater(q) @@ -611,7 +608,7 @@ void CppEditorWidget::findUsages(QTextCursor cursor) // 'this' in cursorInEditor is never used (and must never be used) asynchronously. const CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this, textDocument()}; QPointer<CppEditorWidget> cppEditorWidget = this; - d->m_modelManager->findUsages(cursorInEditor); + CppModelManager::findUsages(cursorInEditor); } void CppEditorWidget::renameUsages(const QString &replacement, QTextCursor cursor) @@ -626,7 +623,7 @@ void CppEditorWidget::renameUsages(const QString &replacement, QTextCursor curso showRenameWarningIfFileIsGenerated(link.targetFilePath); CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this, textDocument()}; QPointer<CppEditorWidget> cppEditorWidget = this; - d->m_modelManager->globalRename(cursorInEditor, replacement); + CppModelManager::globalRename(cursorInEditor, replacement); }; CppModelManager::followSymbol( CursorInEditor{cursor, textDocument()->filePath(), this, textDocument()}, @@ -640,7 +637,7 @@ void CppEditorWidget::renameUsages(const Utils::FilePath &filePath, const QStrin cursor = textCursor(); CursorInEditor cursorInEditor{cursor, filePath, this, textDocument()}; QPointer<CppEditorWidget> cppEditorWidget = this; - d->m_modelManager->globalRename(cursorInEditor, replacement, callback); + CppModelManager::globalRename(cursorInEditor, replacement, callback); } bool CppEditorWidget::selectBlockUp() @@ -695,15 +692,14 @@ bool CppEditorWidget::isWidgetHighlighted(QWidget *widget) namespace { -QList<ProjectPart::ConstPtr> fetchProjectParts(CppModelManager *modelManager, - const Utils::FilePath &filePath) +QList<ProjectPart::ConstPtr> fetchProjectParts(const Utils::FilePath &filePath) { - QList<ProjectPart::ConstPtr> projectParts = modelManager->projectPart(filePath); + QList<ProjectPart::ConstPtr> projectParts = CppModelManager::projectPart(filePath); if (projectParts.isEmpty()) - projectParts = modelManager->projectPartFromDependencies(filePath); + projectParts = CppModelManager::projectPartFromDependencies(filePath); if (projectParts.isEmpty()) - projectParts.append(modelManager->fallbackProjectPart()); + projectParts.append(CppModelManager::fallbackProjectPart()); return projectParts; } @@ -728,10 +724,10 @@ const ProjectPart *findProjectPartForCurrentProject( const ProjectPart *CppEditorWidget::projectPart() const { - if (!d->m_modelManager) + if (!CppModelManager::instance()) return nullptr; - auto projectParts = fetchProjectParts(d->m_modelManager, textDocument()->filePath()); + auto projectParts = fetchProjectParts(textDocument()->filePath()); return findProjectPartForCurrentProject(projectParts, ProjectExplorer::ProjectTree::currentProject()); @@ -868,11 +864,11 @@ void CppEditorWidget::renameSymbolUnderCursor() }; viewport()->setCursor(Qt::BusyCursor); - d->m_modelManager->startLocalRenaming(CursorInEditor{textCursor(), - textDocument()->filePath(), - this, textDocument()}, - projPart, - std::move(renameSymbols)); + CppModelManager::startLocalRenaming(CursorInEditor{textCursor(), + textDocument()->filePath(), + this, textDocument()}, + projPart, + std::move(renameSymbols)); } void CppEditorWidget::updatePreprocessorButtonTooltip() @@ -887,7 +883,7 @@ void CppEditorWidget::updatePreprocessorButtonTooltip() void CppEditorWidget::switchDeclarationDefinition(bool inNextSplit) { - if (!d->m_modelManager) + if (!CppModelManager::instance()) return; const CursorInEditor cursor(textCursor(), textDocument()->filePath(), this, textDocument()); @@ -901,7 +897,7 @@ void CppEditorWidget::switchDeclarationDefinition(bool inNextSplit) void CppEditorWidget::followSymbolToType(bool inNextSplit) { - if (!d->m_modelManager) + if (!CppModelManager::instance()) return; const CursorInEditor cursor(textCursor(), textDocument()->filePath(), this, textDocument()); @@ -968,7 +964,7 @@ void CppEditorWidget::findLinkAt(const QTextCursor &cursor, bool resolveTarget, bool inNextSplit) { - if (!d->m_modelManager) + if (!CppModelManager::instance()) return processLinkCallback(Utils::Link()); if (followUrl(cursor, processLinkCallback)) @@ -1269,8 +1265,7 @@ std::unique_ptr<AssistInterface> CppEditorWidget::createAssistInterface(AssistKi return cap->createAssistInterface(textDocument()->filePath(), this, getFeatures(), reason); if (isOldStyleSignalOrSlot()) { - return CppModelManager::instance() - ->completionAssistProvider() + return CppModelManager::completionAssistProvider() ->createAssistInterface(textDocument()->filePath(), this, getFeatures(), reason); } } @@ -1331,7 +1326,7 @@ void CppEditorWidget::updateFunctionDeclDefLinkNow() if (!isSemanticInfoValidExceptLocalUses()) return; - Snapshot snapshot = d->m_modelManager->snapshot(); + Snapshot snapshot = CppModelManager::snapshot(); snapshot.insert(semanticDoc); d->m_declDefLinkFinder->startFindLinkAt(textCursor(), semanticDoc, snapshot); diff --git a/src/plugins/cppeditor/cppelementevaluator.cpp b/src/plugins/cppeditor/cppelementevaluator.cpp index 27b481cd0c7..2d5d1c4af48 100644 --- a/src/plugins/cppeditor/cppelementevaluator.cpp +++ b/src/plugins/cppeditor/cppelementevaluator.cpp @@ -475,7 +475,7 @@ static QFuture<QSharedPointer<CppElement>> exec(SourceFunction &&sourceFunction, ExecFunction &&execFunction, bool followTypedef = true) { - const Snapshot &snapshot = CppModelManager::instance()->snapshot(); + const Snapshot &snapshot = CppModelManager::snapshot(); Document::Ptr doc; QString expression; @@ -497,7 +497,7 @@ static QFuture<QSharedPointer<CppElement>> asyncExec( const CPlusPlus::LookupContext &lookupContext) { return Utils::asyncRun(&createTypeHierarchy, snapshot, lookupItem, lookupContext, - *CppModelManager::instance()->symbolFinder()); + *CppModelManager::symbolFinder()); } class FromExpressionFunctor @@ -589,7 +589,7 @@ QFuture<QSharedPointer<CppElement>> FromGuiFunctor::syncExec( QFutureInterface<QSharedPointer<CppElement>> futureInterface; futureInterface.reportStarted(); m_element = handleLookupItemMatch(snapshot, lookupItem, lookupContext, - *CppModelManager::instance()->symbolFinder()); + *CppModelManager::symbolFinder()); futureInterface.reportResult(m_element); futureInterface.reportFinished(); return futureInterface.future(); @@ -694,7 +694,7 @@ const QString &CppElementEvaluator::diagnosis() const Utils::Link CppElementEvaluator::linkFromExpression(const QString &expression, const FilePath &filePath) { - const Snapshot &snapshot = CppModelManager::instance()->snapshot(); + const Snapshot &snapshot = CppModelManager::snapshot(); Document::Ptr doc = snapshot.document(filePath); if (doc.isNull()) return Utils::Link(); diff --git a/src/plugins/cppeditor/cppfindreferences.cpp b/src/plugins/cppeditor/cppfindreferences.cpp index 460ad7d0b2d..78777021a7b 100644 --- a/src/plugins/cppeditor/cppfindreferences.cpp +++ b/src/plugins/cppeditor/cppfindreferences.cpp @@ -437,9 +437,9 @@ void CppFindReferences::findAll_helper(SearchResult *search, CPlusPlus::Symbol * if (search->isInteractive()) SearchResultWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus); - const WorkingCopy workingCopy = m_modelManager->workingCopy(); + const WorkingCopy workingCopy = CppModelManager::workingCopy(); QFuture<CPlusPlus::Usage> result; - result = Utils::asyncRun(m_modelManager->sharedThreadPool(), find_helper, + result = Utils::asyncRun(CppModelManager::sharedThreadPool(), find_helper, workingCopy, context, symbol, categorize); createWatcher(result, search); @@ -484,7 +484,7 @@ void CppFindReferences::searchAgain(SearchResult *search) { CppFindReferencesParameters parameters = search->userData().value<CppFindReferencesParameters>(); parameters.filesToRename.clear(); - CPlusPlus::Snapshot snapshot = CppModelManager::instance()->snapshot(); + CPlusPlus::Snapshot snapshot = CppModelManager::snapshot(); search->restart(); CPlusPlus::LookupContext context; CPlusPlus::Symbol *symbol = findSymbol(parameters, snapshot, &context); @@ -544,7 +544,7 @@ CPlusPlus::Symbol *CppFindReferences::findSymbol(const CppFindReferencesParamete CPlusPlus::Document::Ptr newSymbolDocument = snapshot.document(parameters.symbolFilePath); // document is not parsed and has no bindings yet, do it - QByteArray source = getSource(newSymbolDocument->filePath(), m_modelManager->workingCopy()); + QByteArray source = getSource(newSymbolDocument->filePath(), CppModelManager::workingCopy()); CPlusPlus::Document::Ptr doc = snapshot.preprocessedDocument(source, newSymbolDocument->filePath()); doc->check(); @@ -747,8 +747,8 @@ void CppFindReferences::findMacroUses(const CPlusPlus::Macro ¯o, const QStri Core::EditorManager::openEditorAtSearchResult(item); }); - const CPlusPlus::Snapshot snapshot = m_modelManager->snapshot(); - const WorkingCopy workingCopy = m_modelManager->workingCopy(); + const CPlusPlus::Snapshot snapshot = CppModelManager::snapshot(); + const WorkingCopy workingCopy = CppModelManager::workingCopy(); // add the macro definition itself { @@ -768,7 +768,7 @@ void CppFindReferences::findMacroUses(const CPlusPlus::Macro ¯o, const QStri } QFuture<CPlusPlus::Usage> result; - result = Utils::asyncRun(m_modelManager->sharedThreadPool(), findMacroUses_helper, + result = Utils::asyncRun(CppModelManager::sharedThreadPool(), findMacroUses_helper, workingCopy, snapshot, macro); createWatcher(result, search); @@ -829,8 +829,8 @@ void CppFindReferences::checkUnused(Core::SearchResult *search, const Link &link }); connect(search, &SearchResult::canceled, watcher, [watcher] { watcher->cancel(); }); connect(search, &SearchResult::destroyed, watcher, [watcher] { watcher->cancel(); }); - watcher->setFuture(Utils::asyncRun(m_modelManager->sharedThreadPool(), find_helper, - m_modelManager->workingCopy(), context, symbol, true)); + watcher->setFuture(Utils::asyncRun(CppModelManager::sharedThreadPool(), find_helper, + CppModelManager::workingCopy(), context, symbol, true)); } void CppFindReferences::createWatcher(const QFuture<CPlusPlus::Usage> &future, SearchResult *search) diff --git a/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp b/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp index c36a83a3f6b..862866e01c5 100644 --- a/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp +++ b/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp @@ -209,7 +209,7 @@ Link findMacroLink(const QByteArray &name, const Document::Ptr &doc) { if (!name.isEmpty()) { if (doc) { - const Snapshot snapshot = CppModelManager::instance()->snapshot(); + const Snapshot snapshot = CppModelManager::snapshot(); QSet<QString> processed; return findMacroLink_helper(name, doc, snapshot, &processed); } diff --git a/src/plugins/cppeditor/cppincludehierarchy.cpp b/src/plugins/cppeditor/cppincludehierarchy.cpp index caad2e0937b..6b543f6163a 100644 --- a/src/plugins/cppeditor/cppincludehierarchy.cpp +++ b/src/plugins/cppeditor/cppincludehierarchy.cpp @@ -54,7 +54,7 @@ enum { static Snapshot globalSnapshot() { - return CppModelManager::instance()->snapshot(); + return CppModelManager::snapshot(); } struct FileAndLine diff --git a/src/plugins/cppeditor/cppincludesfilter.cpp b/src/plugins/cppeditor/cppincludesfilter.cpp index 9711b6f52de..e1df13f7a2d 100644 --- a/src/plugins/cppeditor/cppincludesfilter.cpp +++ b/src/plugins/cppeditor/cppincludesfilter.cpp @@ -90,7 +90,7 @@ CppIncludesFilter::CppIncludesFilter() if (entry) inputFilePaths.insert(entry->filePath()); } - const CPlusPlus::Snapshot snapshot = CppModelManager::instance()->snapshot(); + const CPlusPlus::Snapshot snapshot = CppModelManager::snapshot(); return [snapshot, inputFilePaths](const QFuture<void> &future) { // This body runs in non-main thread return generateFilePaths(future, snapshot, inputFilePaths); diff --git a/src/plugins/cppeditor/cppindexingsupport.cpp b/src/plugins/cppeditor/cppindexingsupport.cpp index 6aafb6043d7..8cb0677edd9 100644 --- a/src/plugins/cppeditor/cppindexingsupport.cpp +++ b/src/plugins/cppeditor/cppindexingsupport.cpp @@ -31,7 +31,7 @@ static Q_LOGGING_CATEGORY(indexerLog, "qtc.cppeditor.indexer", QtWarningMsg) SymbolSearcher::SymbolSearcher(const SymbolSearcher::Parameters ¶meters, const QSet<QString> &fileNames) - : m_snapshot(CppModelManager::instance()->snapshot()) + : m_snapshot(CppModelManager::snapshot()) , m_parameters(parameters) , m_fileNames(fileNames) {} @@ -138,8 +138,7 @@ void indexFindErrors(QPromise<void> &promise, const ParseParams params) // Parse the file as precisely as possible BuiltinEditorDocumentParser parser(FilePath::fromString(file)); parser.setReleaseSourceAndAST(false); - parser.update({CppModelManager::instance()->workingCopy(), nullptr, - Language::Cxx, false}); + parser.update({CppModelManager::workingCopy(), nullptr, Language::Cxx, false}); CPlusPlus::Document::Ptr document = parser.document(); QTC_ASSERT(document, return); @@ -181,8 +180,7 @@ void index(QPromise<void> &promise, const ParseParams params) const FilePath &conf = CppModelManager::configurationFileName(); bool processingHeaders = false; - CppModelManager *cmm = CppModelManager::instance(); - const ProjectExplorer::HeaderPaths fallbackHeaderPaths = cmm->headerPaths(); + const ProjectExplorer::HeaderPaths fallbackHeaderPaths = CppModelManager::headerPaths(); const CPlusPlus::LanguageFeatures defaultFeatures = CPlusPlus::LanguageFeatures::defaultFeatures(); @@ -192,7 +190,7 @@ void index(QPromise<void> &promise, const ParseParams params) break; const QString fileName = files.at(i); - const QList<ProjectPart::ConstPtr> parts = cmm->projectPart(fileName); + const QList<ProjectPart::ConstPtr> parts = CppModelManager::projectPart(fileName); const CPlusPlus::LanguageFeatures languageFeatures = parts.isEmpty() ? defaultFeatures : parts.first()->languageFeatures; @@ -236,7 +234,7 @@ void parse(QPromise<void> &promise, const ParseParams params) index(promise, params); promise.setProgressValue(files.size()); - CppModelManager::instance()->finishedRefreshingSourceFiles(files); + CppModelManager::finishedRefreshingSourceFiles(files); } } // anonymous namespace @@ -306,15 +304,13 @@ bool CppIndexingSupport::isFindErrorsIndexingActive() QFuture<void> CppIndexingSupport::refreshSourceFiles(const QSet<QString> &sourceFiles, CppModelManager::ProgressNotificationMode mode) { - CppModelManager *mgr = CppModelManager::instance(); - ParseParams params; params.indexerFileSizeLimitInMb = indexerFileSizeLimitInMb(); - params.headerPaths = mgr->headerPaths(); - params.workingCopy = mgr->workingCopy(); + params.headerPaths = CppModelManager::headerPaths(); + params.workingCopy = CppModelManager::workingCopy(); params.sourceFiles = sourceFiles; - QFuture<void> result = Utils::asyncRun(mgr->sharedThreadPool(), parse, params); + QFuture<void> result = Utils::asyncRun(CppModelManager::sharedThreadPool(), parse, params); m_synchronizer.addFuture(result); if (mode == CppModelManager::ForcedProgressNotification || sourceFiles.count() > 1) { diff --git a/src/plugins/cppeditor/cpplocatorfilter.cpp b/src/plugins/cppeditor/cpplocatorfilter.cpp index cd1add7786e..383db4b94d3 100644 --- a/src/plugins/cppeditor/cpplocatorfilter.cpp +++ b/src/plugins/cppeditor/cpplocatorfilter.cpp @@ -41,7 +41,7 @@ void matchesFor(QPromise<void> &promise, const LocatorStorage &storage, const bool hasColonColon = input.contains("::"); const QRegularExpression shortRegexp = hasColonColon ? ILocatorFilter::createRegExp(input.mid(input.lastIndexOf("::") + 2)) : regexp; - CppLocatorData *locatorData = CppModelManager::instance()->locatorData(); + CppLocatorData *locatorData = CppModelManager::locatorData(); locatorData->filterAllFiles([&](const IndexItem::Ptr &info) { if (promise.isCanceled()) return IndexItem::Break; @@ -174,7 +174,7 @@ QList<IndexItem::Ptr> itemsOfCurrentDocument(const FilePath ¤tFileName) return {}; QList<IndexItem::Ptr> results; - const Snapshot snapshot = CppModelManager::instance()->snapshot(); + const Snapshot snapshot = CppModelManager::snapshot(); if (const Document::Ptr thisDocument = snapshot.document(currentFileName)) { SearchSymbols search; search.setSymbolsToSearchFor(SymbolSearcher::Declarations | diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index 7fb8115873e..3980f99ac89 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -215,6 +215,8 @@ public: QList<Document::DiagnosticMessage> m_diagnosticMessages; }; +static CppModelManagerPrivate *d; + } // namespace Internal using namespace Internal; @@ -296,14 +298,13 @@ QSet<FilePath> CppModelManager::timeStampModifiedFiles(const QList<Document::Ptr */ CppSourceProcessor *CppModelManager::createSourceProcessor() { - CppModelManager *that = instance(); - return new CppSourceProcessor(that->snapshot(), [that](const Document::Ptr &doc) { - const Document::Ptr previousDocument = that->document(doc->filePath()); + return new CppSourceProcessor(snapshot(), [](const Document::Ptr &doc) { + const Document::Ptr previousDocument = document(doc->filePath()); const unsigned newRevision = previousDocument.isNull() ? 1U : previousDocument->revision() + 1; doc->setRevision(newRevision); - that->emitDocumentUpdated(doc); + emitDocumentUpdated(doc); doc->releaseSourceAndAST(); }); } @@ -314,7 +315,7 @@ const FilePath &CppModelManager::editorConfigurationFileName() return config; } -ModelManagerSupport *CppModelManager::modelManagerSupport(Backend backend) const +ModelManagerSupport *CppModelManager::modelManagerSupport(Backend backend) { return backend == Backend::Builtin ? &d->m_builtinModelManagerSupport : d->m_activeModelManagerSupport; @@ -325,27 +326,26 @@ void CppModelManager::startLocalRenaming(const CursorInEditor &data, RenameCallback &&renameSymbolsCallback, Backend backend) { - instance()->modelManagerSupport(backend) + modelManagerSupport(backend) ->startLocalRenaming(data, projectPart, std::move(renameSymbolsCallback)); } void CppModelManager::globalRename(const CursorInEditor &data, const QString &replacement, const std::function<void()> &callback, Backend backend) { - instance()->modelManagerSupport(backend)->globalRename(data, replacement, callback); + modelManagerSupport(backend)->globalRename(data, replacement, callback); } void CppModelManager::findUsages(const CursorInEditor &data, Backend backend) { - instance()->modelManagerSupport(backend)->findUsages(data); + modelManagerSupport(backend)->findUsages(data); } void CppModelManager::switchHeaderSource(bool inNextSplit, Backend backend) { const IDocument *currentDocument = EditorManager::currentDocument(); QTC_ASSERT(currentDocument, return); - instance()->modelManagerSupport(backend)->switchHeaderSource(currentDocument->filePath(), - inNextSplit); + modelManagerSupport(backend)->switchHeaderSource(currentDocument->filePath(), inNextSplit); } void CppModelManager::showPreprocessedFile(bool inNextSplit) @@ -383,7 +383,7 @@ void CppModelManager::showPreprocessedFile(bool inNextSplit) TemporaryDirectory::masterTemporaryDirectory()->filePath(outFileName)); const auto useBuiltinPreprocessor = [filePath, outFilePath, inNextSplit, contents = doc->contents()] { - const Document::Ptr preprocessedDoc = instance()->snapshot() + const Document::Ptr preprocessedDoc = snapshot() .preprocessedDocument(contents, filePath); QByteArray content = R"(/* Created using Qt Creator's built-in preprocessor. */ /* See Tools -> Debug Qt Creator -> Inspect C++ Code Model for the parameters used. @@ -430,7 +430,7 @@ void CppModelManager::showPreprocessedFile(bool inNextSplit) } const ProjectPart::ConstPtr projectPart = Utils::findOrDefault( - instance()->projectPart(filePath), [](const ProjectPart::ConstPtr &pp) { + CppModelManager::projectPart(filePath), [](const ProjectPart::ConstPtr &pp) { return pp->belongsToProject(ProjectTree::currentProject()); }); if (!projectPart) { @@ -513,7 +513,7 @@ static void checkNextFunctionForUnused( remainingLinks = remainingLinksList; activeLinks = activeLinksList; search->setUserData(data); - CppModelManager::instance()->modelManagerSupport(CppModelManager::Backend::Best) + CppModelManager::modelManagerSupport(CppModelManager::Backend::Best) ->checkUnused(link, search, [search, link, findRefsFuture, actionsSwitcher](const Link &) { if (!search || findRefsFuture->isCanceled()) return; @@ -620,7 +620,7 @@ void CppModelManager::checkForUnusedSymbol(SearchResult *search, const CPlusPlus::LookupContext &context, const LinkHandler &callback) { - instance()->d->m_findReferences->checkUnused(search, link, symbol, context, callback); + d->m_findReferences->checkUnused(search, link, symbol, context, callback); } int argumentPositionOf(const AST *last, const CallAST *callAst) @@ -642,7 +642,7 @@ int argumentPositionOf(const AST *last, const CallAST *callAst) SignalSlotType CppModelManager::getSignalSlotType(const FilePath &filePath, const QByteArray &content, - int position) const + int position) { if (content.isEmpty()) return SignalSlotType::None; @@ -653,7 +653,7 @@ SignalSlotType CppModelManager::getSignalSlotType(const FilePath &filePath, if (position > 2 && content.mid(position - 2, 2) == "::") fixedContent.insert(position, 'x'); - const Snapshot snapshot = this->snapshot(); + const Snapshot snapshot = CppModelManager::snapshot(); const Document::Ptr document = snapshot.preprocessedDocument(fixedContent, filePath); document->check(); QTextDocument textDocument(QString::fromUtf8(fixedContent)); @@ -763,7 +763,7 @@ SignalSlotType CppModelManager::getSignalSlotType(const FilePath &filePath, FollowSymbolUnderCursor &CppModelManager::builtinFollowSymbol() { - return instance()->d->m_builtinModelManagerSupport.followSymbolInterface(); + return d->m_builtinModelManagerSupport.followSymbolInterface(); } template<class FilterClass> @@ -804,32 +804,32 @@ void CppModelManager::setCurrentDocumentFilter(std::unique_ptr<ILocatorFilter> & setFilter(d->m_currentDocumentFilter, std::move(filter)); } -ILocatorFilter *CppModelManager::locatorFilter() const +ILocatorFilter *CppModelManager::locatorFilter() { return d->m_locatorFilter.get(); } -ILocatorFilter *CppModelManager::classesFilter() const +ILocatorFilter *CppModelManager::classesFilter() { return d->m_classesFilter.get(); } -ILocatorFilter *CppModelManager::includesFilter() const +ILocatorFilter *CppModelManager::includesFilter() { return d->m_includesFilter.get(); } -ILocatorFilter *CppModelManager::functionsFilter() const +ILocatorFilter *CppModelManager::functionsFilter() { return d->m_functionsFilter.get(); } -IFindFilter *CppModelManager::symbolsFindFilter() const +IFindFilter *CppModelManager::symbolsFindFilter() { return d->m_symbolsFindFilter.get(); } -ILocatorFilter *CppModelManager::currentDocumentFilter() const +ILocatorFilter *CppModelManager::currentDocumentFilter() { return d->m_currentDocumentFilter.get(); } @@ -841,7 +841,7 @@ const FilePath &CppModelManager::configurationFileName() void CppModelManager::updateModifiedSourceFiles() { - const Snapshot snapshot = this->snapshot(); + const Snapshot snapshot = CppModelManager::snapshot(); QList<Document::Ptr> documentsToCheck; for (const Document::Ptr &document : snapshot) documentsToCheck << document; @@ -869,7 +869,7 @@ CppModelManager *CppModelManager::instance() void CppModelManager::registerJsExtension() { - JsExpander::registerGlobalObject("Cpp", [this] { + JsExpander::registerGlobalObject("Cpp", [] { return new CppToolsJsExtension(&d->m_locatorData); }); } @@ -878,16 +878,16 @@ void CppModelManager::initCppTools() { // Objects connect(VcsManager::instance(), &VcsManager::repositoryChanged, - this, &CppModelManager::updateModifiedSourceFiles); + m_instance, &CppModelManager::updateModifiedSourceFiles); connect(DocumentManager::instance(), &DocumentManager::filesChangedInternally, - this, [this](const FilePaths &filePaths) { + m_instance, [](const FilePaths &filePaths) { updateSourceFiles(toSet(filePaths)); }); - connect(this, &CppModelManager::documentUpdated, + connect(m_instance, &CppModelManager::documentUpdated, &d->m_locatorData, &CppLocatorData::onDocumentUpdated); - connect(this, &CppModelManager::aboutToRemoveFiles, + connect(m_instance, &CppModelManager::aboutToRemoveFiles, &d->m_locatorData, &CppLocatorData::onAboutToRemoveFiles); // Set up builtin filters @@ -895,7 +895,7 @@ void CppModelManager::initCppTools() setClassesFilter(std::make_unique<CppClassesFilter>()); setIncludesFilter(std::make_unique<CppIncludesFilter>()); setFunctionsFilter(std::make_unique<CppFunctionsFilter>()); - setSymbolsFindFilter(std::make_unique<SymbolsFindFilter>(this)); + setSymbolsFindFilter(std::make_unique<SymbolsFindFilter>()); setCurrentDocumentFilter(std::make_unique<CppCurrentDocumentFilter>()); // Setup matchers LocatorMatcher::addMatcherCreator(MatcherType::AllSymbols, [] { @@ -912,24 +912,13 @@ void CppModelManager::initCppTools() }); } -static bool setExtraDiagnosticsCallback(const QString &fileName, const QString &kind, - const QList<Document::DiagnosticMessage> &diagnostics) -{ - return m_instance->setExtraDiagnostics(fileName, kind, diagnostics); -} - -static Snapshot snapshotCallback() -{ - return m_instance->snapshot(); -} - CppModelManager::CppModelManager() - : d(new CppModelManagerPrivate) { + d = new CppModelManagerPrivate; m_instance = this; - CppModelManagerBase::registerSetExtraDiagnosticsCallback(&setExtraDiagnosticsCallback); - CppModelManagerBase::registerSnapshotCallback(&snapshotCallback); + CppModelManagerBase::registerSetExtraDiagnosticsCallback(&CppModelManager::setExtraDiagnostics); + CppModelManagerBase::registerSnapshotCallback(&CppModelManager::snapshot); // Used for weak dependency in VcsBaseSubmitEditor setObjectName("CppModelManager"); @@ -1002,13 +991,13 @@ CppModelManager::~CppModelManager() delete d; } -Snapshot CppModelManager::snapshot() const +Snapshot CppModelManager::snapshot() { QMutexLocker locker(&d->m_snapshotMutex); return d->m_snapshot; } -Document::Ptr CppModelManager::document(const FilePath &filePath) const +Document::Ptr CppModelManager::document(const FilePath &filePath) { QMutexLocker locker(&d->m_snapshotMutex); return d->m_snapshot.document(filePath); @@ -1042,7 +1031,7 @@ void CppModelManager::ensureUpdated() d->m_dirty = false; } -FilePaths CppModelManager::internalProjectFiles() const +FilePaths CppModelManager::internalProjectFiles() { FilePaths files; for (const ProjectData &projectData : std::as_const(d->m_projectData)) { @@ -1055,7 +1044,7 @@ FilePaths CppModelManager::internalProjectFiles() const return files; } -HeaderPaths CppModelManager::internalHeaderPaths() const +HeaderPaths CppModelManager::internalHeaderPaths() { HeaderPaths headerPaths; for (const ProjectData &projectData: std::as_const(d->m_projectData)) { @@ -1079,7 +1068,7 @@ static void addUnique(const Macros &newMacros, Macros ¯os, } } -Macros CppModelManager::internalDefinedMacros() const +Macros CppModelManager::internalDefinedMacros() { Macros macros; QSet<ProjectExplorer::Macro> alreadyIn; @@ -1107,7 +1096,7 @@ void CppModelManager::dumpModelManagerConfiguration(const QString &logFileId) ProjectExplorer::Macro::toByteArray(definedMacros())); } -QSet<AbstractEditorSupport *> CppModelManager::abstractEditorSupports() const +QSet<AbstractEditorSupport *> CppModelManager::abstractEditorSupports() { return d->m_extraEditorSupports; } @@ -1122,7 +1111,7 @@ void CppModelManager::removeExtraEditorSupport(AbstractEditorSupport *editorSupp d->m_extraEditorSupports.remove(editorSupport); } -CppEditorDocumentHandle *CppModelManager::cppEditorDocument(const FilePath &filePath) const +CppEditorDocumentHandle *CppModelManager::cppEditorDocument(const FilePath &filePath) { if (filePath.isEmpty()) return nullptr; @@ -1133,7 +1122,7 @@ CppEditorDocumentHandle *CppModelManager::cppEditorDocument(const FilePath &file BaseEditorDocumentProcessor *CppModelManager::cppEditorDocumentProcessor(const FilePath &filePath) { - const auto document = instance()->cppEditorDocument(filePath); + const auto document = cppEditorDocument(filePath); return document ? document->processor() : nullptr; } @@ -1237,17 +1226,17 @@ WorkingCopy CppModelManager::buildWorkingCopyList() return workingCopy; } -WorkingCopy CppModelManager::workingCopy() const +WorkingCopy CppModelManager::workingCopy() { - return const_cast<CppModelManager *>(this)->buildWorkingCopyList(); + return buildWorkingCopyList(); } -QByteArray CppModelManager::codeModelConfiguration() const +QByteArray CppModelManager::codeModelConfiguration() { return QByteArray::fromRawData(pp_configuration, qstrlen(pp_configuration)); } -CppLocatorData *CppModelManager::locatorData() const +CppLocatorData *CppModelManager::locatorData() { return &d->m_locatorData; } @@ -1308,14 +1297,14 @@ QFuture<void> CppModelManager::updateSourceFiles(const QSet<FilePath> &sourceFil return d->m_internalIndexingSupport->refreshSourceFiles(filteredFiles, mode); } -ProjectInfoList CppModelManager::projectInfos() const +ProjectInfoList CppModelManager::projectInfos() { QReadLocker locker(&d->m_projectLock); return Utils::transform<QList<ProjectInfo::ConstPtr>>(d->m_projectData, [](const ProjectData &d) { return d.projectInfo; }); } -ProjectInfo::ConstPtr CppModelManager::projectInfo(Project *project) const +ProjectInfo::ConstPtr CppModelManager::projectInfo(Project *project) { QReadLocker locker(&d->m_projectLock); return d->m_projectData.value(project).projectInfo; @@ -1335,7 +1324,7 @@ void CppModelManager::removeProjectInfoFilesAndIncludesFromSnapshot(const Projec } } -const QList<CppEditorDocumentHandle *> CppModelManager::cppEditorDocuments() const +const QList<CppEditorDocumentHandle *> CppModelManager::cppEditorDocuments() { QMutexLocker locker(&d->m_cppEditorDocumentsMutex); return d->m_cppEditorDocuments.values(); @@ -1453,7 +1442,7 @@ void CppModelManagerPrivate::setupWatcher(const QFuture<void> &future, Project * projectData->indexer->setFuture(future); } -void CppModelManager::updateCppEditorDocuments(bool projectsUpdated) const +void CppModelManager::updateCppEditorDocuments(bool projectsUpdated) { // Refresh visible documents QSet<IDocument *> visibleCppEditorDocuments; @@ -1534,7 +1523,7 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo::ConstPtr &ne const QSet<FilePath> removedFiles = comparer.removedFiles(); if (!removedFiles.isEmpty()) { filesRemoved = true; - emit aboutToRemoveFiles(transform<QStringList>(removedFiles, &FilePath::toString)); + emit m_instance->aboutToRemoveFiles(transform<QStringList>(removedFiles, &FilePath::toString)); removeFilesFromSnapshot(removedFiles); } } @@ -1570,10 +1559,10 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo::ConstPtr &ne // Announce removed project parts if (!removedProjectParts.isEmpty()) - emit projectPartsRemoved(removedProjectParts); + emit m_instance->projectPartsRemoved(removedProjectParts); // Announce added project parts - emit projectPartsUpdated(project); + emit m_instance->projectPartsUpdated(project); // Ideally, we would update all the editor documents that depend on the 'filesToReindex'. // However, on e.g. a session restore first the editor documents are created and then the @@ -1588,25 +1577,25 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo::ConstPtr &ne // It's safe to do this here, as only the UI thread writes to the map and no other thread // uses the indexer value. - d->setupWatcher(indexingFuture, project, projectData, this); + d->setupWatcher(indexingFuture, project, projectData, m_instance); return indexingFuture; } -ProjectPart::ConstPtr CppModelManager::projectPartForId(const QString &projectPartId) const +ProjectPart::ConstPtr CppModelManager::projectPartForId(const QString &projectPartId) { QReadLocker locker(&d->m_projectLock); return d->m_projectPartIdToProjectProjectPart.value(projectPartId); } -QList<ProjectPart::ConstPtr> CppModelManager::projectPart(const FilePath &fileName) const +QList<ProjectPart::ConstPtr> CppModelManager::projectPart(const FilePath &fileName) { QReadLocker locker(&d->m_projectLock); return d->m_fileToProjectParts.value(fileName.canonicalPath()); } QList<ProjectPart::ConstPtr> CppModelManager::projectPartFromDependencies( - const FilePath &fileName) const + const FilePath &fileName) { QSet<ProjectPart::ConstPtr> parts; const FilePaths deps = snapshot().filesDependingOn(fileName); @@ -1631,10 +1620,10 @@ bool CppModelManager::isCppEditor(IEditor *editor) bool CppModelManager::usesClangd(const TextEditor::TextDocument *document) { - return instance()->d->m_activeModelManagerSupport->usesClangd(document); + return d->m_activeModelManagerSupport->usesClangd(document); } -bool CppModelManager::isClangCodeModelActive() const +bool CppModelManager::isClangCodeModelActive() { return d->m_activeModelManagerSupport != &d->m_builtinModelManagerSupport; } @@ -1642,19 +1631,19 @@ bool CppModelManager::isClangCodeModelActive() const void CppModelManager::emitDocumentUpdated(Document::Ptr doc) { if (replaceDocument(doc)) - emit documentUpdated(doc); + emit m_instance->documentUpdated(doc); } void CppModelManager::emitAbstractEditorSupportContentsUpdated(const QString &filePath, const QString &sourcePath, const QByteArray &contents) { - emit abstractEditorSupportContentsUpdated(filePath, sourcePath, contents); + emit m_instance->abstractEditorSupportContentsUpdated(filePath, sourcePath, contents); } void CppModelManager::emitAbstractEditorSupportRemoved(const QString &filePath) { - emit abstractEditorSupportRemoved(filePath); + emit m_instance->abstractEditorSupportRemoved(filePath); } void CppModelManager::onProjectAdded(Project *) @@ -1694,7 +1683,7 @@ void CppModelManager::onAboutToRemoveProject(Project *project) } if (!idsOfRemovedProjectParts.isEmpty()) - emit projectPartsRemoved(idsOfRemovedProjectParts); + emit m_instance->projectPartsRemoved(idsOfRemovedProjectParts); delayedGC(); } @@ -1713,7 +1702,7 @@ void CppModelManager::onActiveProjectChanged(Project *project) updateCppEditorDocuments(); } -void CppModelManager::onSourceFilesRefreshed() const +void CppModelManager::onSourceFilesRefreshed() { if (CppIndexingSupport::isFindErrorsIndexingActive()) { QTimer::singleShot(1, QCoreApplication::instance(), &QCoreApplication::quit); @@ -1745,10 +1734,10 @@ void CppModelManager::onAboutToLoadSession() GC(); } -QSet<QString> CppModelManager::dependingInternalTargets(const FilePath &file) const +QSet<QString> CppModelManager::dependingInternalTargets(const FilePath &file) { QSet<QString> result; - const Snapshot snapshot = this->snapshot(); + const Snapshot snapshot = CppModelManager::snapshot(); QTC_ASSERT(snapshot.contains(file), return result); bool wasHeader; const FilePath correspondingFile @@ -1762,8 +1751,10 @@ QSet<QString> CppModelManager::dependingInternalTargets(const FilePath &file) co return result; } -QSet<QString> CppModelManager::internalTargets(const FilePath &filePath) const +QSet<QString> CppModelManager::internalTargets(const FilePath &filePath) { + QTC_ASSERT(m_instance, return {}); + const QList<ProjectPart::ConstPtr> projectParts = projectPart(filePath); // if we have no project parts it's most likely a header with declarations only and CMake based if (projectParts.isEmpty()) @@ -1931,7 +1922,7 @@ void CppModelManager::setupFallbackProjectPart() QMutexLocker locker(&d->m_fallbackProjectPartMutex); d->m_fallbackProjectPart = part; } - emit fallbackProjectPartUpdated(); + emit m_instance->fallbackProjectPartUpdated(); } void CppModelManager::GC() @@ -1981,14 +1972,14 @@ void CppModelManager::GC() } // Announce removing files and replace the snapshot - emit aboutToRemoveFiles(notReachableFiles); + emit m_instance->aboutToRemoveFiles(notReachableFiles); replaceSnapshot(newSnapshot); - emit gcFinished(); + emit m_instance->gcFinished(); } void CppModelManager::finishedRefreshingSourceFiles(const QSet<QString> &files) { - emit sourceFilesRefreshed(files); + emit m_instance->sourceFilesRefreshed(files); } void CppModelManager::activateClangCodeModel( @@ -1998,12 +1989,12 @@ void CppModelManager::activateClangCodeModel( d->m_activeModelManagerSupport = d->m_extendedModelManagerSupport.get(); } -CppCompletionAssistProvider *CppModelManager::completionAssistProvider() const +CppCompletionAssistProvider *CppModelManager::completionAssistProvider() { return d->m_builtinModelManagerSupport.completionAssistProvider(); } -TextEditor::BaseHoverHandler *CppModelManager::createHoverHandler() const +TextEditor::BaseHoverHandler *CppModelManager::createHoverHandler() { return d->m_builtinModelManagerSupport.createHoverHandler(); } @@ -2012,7 +2003,7 @@ void CppModelManager::followSymbol(const CursorInEditor &data, const LinkHandler &processLinkCallback, bool resolveTarget, bool inNextSplit, Backend backend) { - instance()->modelManagerSupport(backend)->followSymbol(data, processLinkCallback, + modelManagerSupport(backend)->followSymbol(data, processLinkCallback, resolveTarget, inNextSplit); } @@ -2020,7 +2011,7 @@ void CppModelManager::followSymbolToType(const CursorInEditor &data, const LinkHandler &processLinkCallback, bool inNextSplit, Backend backend) { - instance()->modelManagerSupport(backend)->followSymbolToType(data, processLinkCallback, + modelManagerSupport(backend)->followSymbolToType(data, processLinkCallback, inNextSplit); } @@ -2028,11 +2019,11 @@ void CppModelManager::switchDeclDef(const CursorInEditor &data, const LinkHandler &processLinkCallback, Backend backend) { - instance()->modelManagerSupport(backend)->switchDeclDef(data, processLinkCallback); + modelManagerSupport(backend)->switchDeclDef(data, processLinkCallback); } BaseEditorDocumentProcessor *CppModelManager::createEditorDocumentProcessor( - TextEditor::TextDocument *baseTextDocument) const + TextEditor::TextDocument *baseTextDocument) { return d->m_activeModelManagerSupport->createEditorDocumentProcessor(baseTextDocument); } @@ -2093,7 +2084,7 @@ bool CppModelManager::setExtraDiagnostics(const QString &fileName, const QList<Document::DiagnosticMessage> &diagnostics) { d->m_diagnosticMessages = diagnostics; - emit diagnosticsChanged(fileName, kind); + emit m_instance->diagnosticsChanged(fileName, kind); return true; } diff --git a/src/plugins/cppeditor/cppmodelmanager.h b/src/plugins/cppeditor/cppmodelmanager.h index 7dd49c6ebd1..6f6dc7298e3 100644 --- a/src/plugins/cppeditor/cppmodelmanager.h +++ b/src/plugins/cppeditor/cppmodelmanager.h @@ -80,95 +80,95 @@ public: static CppModelManager *instance(); - void registerJsExtension(); + static void registerJsExtension(); - // Documented in source file. - enum ProgressNotificationMode { + // Documented in source file. + enum ProgressNotificationMode { ForcedProgressNotification, ReservedProgressNotification }; - QFuture<void> updateSourceFiles(const QSet<Utils::FilePath> &sourceFiles, - ProgressNotificationMode mode = ReservedProgressNotification); - void updateCppEditorDocuments(bool projectsUpdated = false) const; - WorkingCopy workingCopy() const; - QByteArray codeModelConfiguration() const; - CppLocatorData *locatorData() const; + static QFuture<void> updateSourceFiles(const QSet<Utils::FilePath> &sourceFiles, + ProgressNotificationMode mode = ReservedProgressNotification); + static void updateCppEditorDocuments(bool projectsUpdated = false); + static WorkingCopy workingCopy(); + static QByteArray codeModelConfiguration(); + static CppLocatorData *locatorData(); - bool setExtraDiagnostics(const QString &fileName, - const QString &kind, - const QList<Document::DiagnosticMessage> &diagnostics); + static bool setExtraDiagnostics(const QString &fileName, + const QString &kind, + const QList<Document::DiagnosticMessage> &diagnostics); - const QList<Document::DiagnosticMessage> diagnosticMessages(); + static const QList<Document::DiagnosticMessage> diagnosticMessages(); - ProjectInfoList projectInfos() const; - ProjectInfo::ConstPtr projectInfo(ProjectExplorer::Project *project) const; - QFuture<void> updateProjectInfo(const ProjectInfo::ConstPtr &newProjectInfo, - const QSet<Utils::FilePath> &additionalFiles = {}); + static ProjectInfoList projectInfos(); + static ProjectInfo::ConstPtr projectInfo(ProjectExplorer::Project *project); + static QFuture<void> updateProjectInfo(const ProjectInfo::ConstPtr &newProjectInfo, + const QSet<Utils::FilePath> &additionalFiles = {}); /// \return The project part with the given project file - ProjectPart::ConstPtr projectPartForId(const QString &projectPartId) const; + static ProjectPart::ConstPtr projectPartForId(const QString &projectPartId); /// \return All project parts that mention the given file name as one of the sources/headers. - QList<ProjectPart::ConstPtr> projectPart(const Utils::FilePath &fileName) const; - QList<ProjectPart::ConstPtr> projectPart(const QString &fileName) const + static QList<ProjectPart::ConstPtr> projectPart(const Utils::FilePath &fileName); + static QList<ProjectPart::ConstPtr> projectPart(const QString &fileName) { return projectPart(Utils::FilePath::fromString(fileName)); } /// This is a fall-back function: find all files that includes the file directly or indirectly, /// and return its \c ProjectPart list for use with this file. - QList<ProjectPart::ConstPtr> projectPartFromDependencies(const Utils::FilePath &fileName) const; + static QList<ProjectPart::ConstPtr> projectPartFromDependencies(const Utils::FilePath &fileName); /// \return A synthetic \c ProjectPart which consists of all defines/includes/frameworks from /// all loaded projects. - ProjectPart::ConstPtr fallbackProjectPart(); + static ProjectPart::ConstPtr fallbackProjectPart(); - CPlusPlus::Snapshot snapshot() const; - Document::Ptr document(const Utils::FilePath &filePath) const; - bool replaceDocument(Document::Ptr newDoc); + static CPlusPlus::Snapshot snapshot(); + static Document::Ptr document(const Utils::FilePath &filePath); + static bool replaceDocument(Document::Ptr newDoc); - void emitDocumentUpdated(Document::Ptr doc); - void emitAbstractEditorSupportContentsUpdated(const QString &filePath, + static void emitDocumentUpdated(Document::Ptr doc); + static void emitAbstractEditorSupportContentsUpdated(const QString &filePath, const QString &sourcePath, const QByteArray &contents); - void emitAbstractEditorSupportRemoved(const QString &filePath); + static void emitAbstractEditorSupportRemoved(const QString &filePath); static bool isCppEditor(Core::IEditor *editor); static bool usesClangd(const TextEditor::TextDocument *document); - bool isClangCodeModelActive() const; + static bool isClangCodeModelActive(); - QSet<AbstractEditorSupport*> abstractEditorSupports() const; - void addExtraEditorSupport(AbstractEditorSupport *editorSupport); - void removeExtraEditorSupport(AbstractEditorSupport *editorSupport); + static QSet<AbstractEditorSupport*> abstractEditorSupports(); + static void addExtraEditorSupport(AbstractEditorSupport *editorSupport); + static void removeExtraEditorSupport(AbstractEditorSupport *editorSupport); - const QList<CppEditorDocumentHandle *> cppEditorDocuments() const; - CppEditorDocumentHandle *cppEditorDocument(const Utils::FilePath &filePath) const; + static const QList<CppEditorDocumentHandle *> cppEditorDocuments(); + static CppEditorDocumentHandle *cppEditorDocument(const Utils::FilePath &filePath); static BaseEditorDocumentProcessor *cppEditorDocumentProcessor(const Utils::FilePath &filePath); - void registerCppEditorDocument(CppEditorDocumentHandle *cppEditorDocument); - void unregisterCppEditorDocument(const QString &filePath); + static void registerCppEditorDocument(CppEditorDocumentHandle *cppEditorDocument); + static void unregisterCppEditorDocument(const QString &filePath); - QList<int> references(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context); + static QList<int> references(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context); - SignalSlotType getSignalSlotType(const Utils::FilePath &filePath, - const QByteArray &content, - int position) const; + static SignalSlotType getSignalSlotType(const Utils::FilePath &filePath, + const QByteArray &content, + int position); - void renameUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context, - const QString &replacement = QString(), - const std::function<void()> &callback = {}); - void renameUsages(const CPlusPlus::Document::Ptr &doc, - const QTextCursor &cursor, - const CPlusPlus::Snapshot &snapshot, - const QString &replacement, - const std::function<void()> &callback); - void findUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context); + static void renameUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context, + const QString &replacement = QString(), + const std::function<void()> &callback = {}); + static void renameUsages(const CPlusPlus::Document::Ptr &doc, + const QTextCursor &cursor, + const CPlusPlus::Snapshot &snapshot, + const QString &replacement, + const std::function<void()> &callback); + static void findUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context); - void findMacroUsages(const CPlusPlus::Macro ¯o); - void renameMacroUsages(const CPlusPlus::Macro ¯o, const QString &replacement); + static void findMacroUsages(const CPlusPlus::Macro ¯o); + static void renameMacroUsages(const CPlusPlus::Macro ¯o, const QString &replacement); - void finishedRefreshingSourceFiles(const QSet<QString> &files); + static void finishedRefreshingSourceFiles(const QSet<QString> &files); - void activateClangCodeModel(std::unique_ptr<ModelManagerSupport> &&modelManagerSupport); - CppCompletionAssistProvider *completionAssistProvider() const; - BaseEditorDocumentProcessor *createEditorDocumentProcessor( - TextEditor::TextDocument *baseTextDocument) const; - TextEditor::BaseHoverHandler *createHoverHandler() const; + static void activateClangCodeModel(std::unique_ptr<ModelManagerSupport> &&modelManagerSupport); + static CppCompletionAssistProvider *completionAssistProvider(); + static BaseEditorDocumentProcessor *createEditorDocumentProcessor( + TextEditor::TextDocument *baseTextDocument); + static TextEditor::BaseHoverHandler *createHoverHandler(); static FollowSymbolUnderCursor &builtinFollowSymbol(); enum class Backend { Builtin, Best }; @@ -196,22 +196,22 @@ public: const CPlusPlus::LookupContext &context, const Utils::LinkHandler &callback); - CppIndexingSupport *indexingSupport(); + static CppIndexingSupport *indexingSupport(); - Utils::FilePaths projectFiles(); + static Utils::FilePaths projectFiles(); - ProjectExplorer::HeaderPaths headerPaths(); + static ProjectExplorer::HeaderPaths headerPaths(); // Use this *only* for auto tests - void setHeaderPaths(const ProjectExplorer::HeaderPaths &headerPaths); + static void setHeaderPaths(const ProjectExplorer::HeaderPaths &headerPaths); - ProjectExplorer::Macros definedMacros(); + static ProjectExplorer::Macros definedMacros(); - void enableGarbageCollector(bool enable); + static void enableGarbageCollector(bool enable); - SymbolFinder *symbolFinder(); + static SymbolFinder *symbolFinder(); - QThreadPool *sharedThreadPool(); + static QThreadPool *sharedThreadPool(); static QSet<Utils::FilePath> timeStampModifiedFiles(const QList<Document::Ptr> &documentsToCheck); @@ -219,34 +219,34 @@ public: static const Utils::FilePath &configurationFileName(); static const Utils::FilePath &editorConfigurationFileName(); - void setLocatorFilter(std::unique_ptr<Core::ILocatorFilter> &&filter); - void setClassesFilter(std::unique_ptr<Core::ILocatorFilter> &&filter); - void setIncludesFilter(std::unique_ptr<Core::ILocatorFilter> &&filter); - void setFunctionsFilter(std::unique_ptr<Core::ILocatorFilter> &&filter); - void setSymbolsFindFilter(std::unique_ptr<Core::IFindFilter> &&filter); - void setCurrentDocumentFilter(std::unique_ptr<Core::ILocatorFilter> &&filter); + static void setLocatorFilter(std::unique_ptr<Core::ILocatorFilter> &&filter); + static void setClassesFilter(std::unique_ptr<Core::ILocatorFilter> &&filter); + static void setIncludesFilter(std::unique_ptr<Core::ILocatorFilter> &&filter); + static void setFunctionsFilter(std::unique_ptr<Core::ILocatorFilter> &&filter); + static void setSymbolsFindFilter(std::unique_ptr<Core::IFindFilter> &&filter); + static void setCurrentDocumentFilter(std::unique_ptr<Core::ILocatorFilter> &&filter); - Core::ILocatorFilter *locatorFilter() const; - Core::ILocatorFilter *classesFilter() const; - Core::ILocatorFilter *includesFilter() const; - Core::ILocatorFilter *functionsFilter() const; - Core::IFindFilter *symbolsFindFilter() const; - Core::ILocatorFilter *currentDocumentFilter() const; + static Core::ILocatorFilter *locatorFilter(); + static Core::ILocatorFilter *classesFilter(); + static Core::ILocatorFilter *includesFilter(); + static Core::ILocatorFilter *functionsFilter(); + static Core::IFindFilter *symbolsFindFilter(); + static Core::ILocatorFilter *currentDocumentFilter(); /* * try to find build system target that depends on the given file - if the file is no header * try to find the corresponding header and use this instead to find the respective target */ - QSet<QString> dependingInternalTargets(const Utils::FilePath &file) const; + static QSet<QString> dependingInternalTargets(const Utils::FilePath &file); - QSet<QString> internalTargets(const Utils::FilePath &filePath) const; + static QSet<QString> internalTargets(const Utils::FilePath &filePath); - void renameIncludes(const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath); + static void renameIncludes(const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath); // for VcsBaseSubmitEditor Q_INVOKABLE QSet<QString> symbolsInFiles(const QSet<Utils::FilePath> &files) const; - ModelManagerSupport *modelManagerSupport(Backend backend) const; + static ModelManagerSupport *modelManagerSupport(Backend backend); signals: /// Project data might be locked while this is emitted. @@ -271,40 +271,37 @@ signals: void diagnosticsChanged(const QString &fileName, const QString &kind); public slots: - void updateModifiedSourceFiles(); - void GC(); + static void updateModifiedSourceFiles(); + static void GC(); private: // This should be executed in the GUI thread. friend class Tests::ModelManagerTestHelper; - void onAboutToLoadSession(); - void onProjectAdded(ProjectExplorer::Project *project); - void onAboutToRemoveProject(ProjectExplorer::Project *project); - void onActiveProjectChanged(ProjectExplorer::Project *project); - void onSourceFilesRefreshed() const; - void onCurrentEditorChanged(Core::IEditor *editor); - void onCoreAboutToClose(); - void setupFallbackProjectPart(); + static void onAboutToLoadSession(); + static void onProjectAdded(ProjectExplorer::Project *project); + static void onAboutToRemoveProject(ProjectExplorer::Project *project); + static void onActiveProjectChanged(ProjectExplorer::Project *project); + static void onSourceFilesRefreshed(); + static void onCurrentEditorChanged(Core::IEditor *editor); + static void onCoreAboutToClose(); + static void setupFallbackProjectPart(); - void delayedGC(); - void recalculateProjectPartMappings(); + static void delayedGC(); + static void recalculateProjectPartMappings(); - void replaceSnapshot(const CPlusPlus::Snapshot &newSnapshot); - void removeFilesFromSnapshot(const QSet<Utils::FilePath> &removedFiles); - void removeProjectInfoFilesAndIncludesFromSnapshot(const ProjectInfo &projectInfo); + static void replaceSnapshot(const CPlusPlus::Snapshot &newSnapshot); + static void removeFilesFromSnapshot(const QSet<Utils::FilePath> &removedFiles); + static void removeProjectInfoFilesAndIncludesFromSnapshot(const ProjectInfo &projectInfo); - WorkingCopy buildWorkingCopyList(); + static WorkingCopy buildWorkingCopyList(); - void ensureUpdated(); - Utils::FilePaths internalProjectFiles() const; - ProjectExplorer::HeaderPaths internalHeaderPaths() const; - ProjectExplorer::Macros internalDefinedMacros() const; + static void ensureUpdated(); + static Utils::FilePaths internalProjectFiles(); + static ProjectExplorer::HeaderPaths internalHeaderPaths(); + static ProjectExplorer::Macros internalDefinedMacros(); - void dumpModelManagerConfiguration(const QString &logFileId); - void initCppTools(); - -private: - Internal::CppModelManagerPrivate *d; + static void dumpModelManagerConfiguration(const QString &logFileId); + static void initCppTools(); }; } // CppEditor diff --git a/src/plugins/cppeditor/cppmodelmanager_test.cpp b/src/plugins/cppeditor/cppmodelmanager_test.cpp index cb292293e44..c2a9189fd63 100644 --- a/src/plugins/cppeditor/cppmodelmanager_test.cpp +++ b/src/plugins/cppeditor/cppmodelmanager_test.cpp @@ -164,7 +164,7 @@ private: static ProjectPart::ConstPtr projectPartOfEditorDocument(const FilePath &filePath) { - auto *editorDocument = CppModelManager::instance()->cppEditorDocument(filePath); + auto *editorDocument = CppModelManager::cppEditorDocument(filePath); QTC_ASSERT(editorDocument, return ProjectPart::ConstPtr()); return editorDocument->processor()->parser()->projectPartInfo().projectPart; } @@ -173,7 +173,6 @@ static ProjectPart::ConstPtr projectPartOfEditorDocument(const FilePath &filePat void ModelManagerTest::testPathsAreClean() { ModelManagerTestHelper helper; - CppModelManager *mm = CppModelManager::instance(); const MyTestDataDir testDataDir(_("testdata")); @@ -188,9 +187,9 @@ void ModelManagerTest::testPathsAreClean() const auto pi = ProjectInfo::create(ProjectUpdateInfo(project, KitInfo(nullptr), {}, {}), {part}); - mm->updateProjectInfo(pi); + CppModelManager::updateProjectInfo(pi); - ProjectExplorer::HeaderPaths headerPaths = mm->headerPaths(); + ProjectExplorer::HeaderPaths headerPaths = CppModelManager::headerPaths(); QCOMPARE(headerPaths.size(), 2); QVERIFY(headerPaths.contains(HeaderPath::makeUser(testDataDir.includeDir()))); QVERIFY(headerPaths.contains(HeaderPath::makeFramework(testDataDir.frameworksDir()))); @@ -203,7 +202,6 @@ void ModelManagerTest::testFrameworkHeaders() QSKIP("Can't resolve framework soft links on Windows."); ModelManagerTestHelper helper; - CppModelManager *mm = CppModelManager::instance(); const MyTestDataDir testDataDir(_("testdata")); @@ -221,11 +219,11 @@ void ModelManagerTest::testFrameworkHeaders() const auto pi = ProjectInfo::create(ProjectUpdateInfo(project, KitInfo(nullptr), {}, {}), {part}); - mm->updateProjectInfo(pi).waitForFinished(); + CppModelManager::updateProjectInfo(pi).waitForFinished(); QCoreApplication::processEvents(); - QVERIFY(mm->snapshot().contains(source)); - Document::Ptr doc = mm->document(source); + QVERIFY(CppModelManager::snapshot().contains(source)); + Document::Ptr doc = CppModelManager::document(source); QVERIFY(!doc.isNull()); CPlusPlus::Namespace *ns = doc->globalNamespace(); QVERIFY(ns); @@ -247,7 +245,6 @@ void ModelManagerTest::testFrameworkHeaders() void ModelManagerTest::testRefreshAlsoIncludesOfProjectFiles() { ModelManagerTestHelper helper; - CppModelManager *mm = CppModelManager::instance(); const MyTestDataDir testDataDir(_("testdata")); @@ -268,7 +265,7 @@ void ModelManagerTest::testRefreshAlsoIncludesOfProjectFiles() QSet<FilePath> refreshedFiles = helper.updateProjectInfo(pi); QCOMPARE(refreshedFiles.size(), 1); QVERIFY(refreshedFiles.contains(testCpp)); - CPlusPlus::Snapshot snapshot = mm->snapshot(); + CPlusPlus::Snapshot snapshot = CppModelManager::snapshot(); QVERIFY(snapshot.contains(testHeader)); QVERIFY(snapshot.contains(testCpp)); @@ -287,7 +284,7 @@ void ModelManagerTest::testRefreshAlsoIncludesOfProjectFiles() QCOMPARE(refreshedFiles.size(), 1); QVERIFY(refreshedFiles.contains(testCpp)); - snapshot = mm->snapshot(); + snapshot = CppModelManager::snapshot(); QVERIFY(snapshot.contains(testHeader)); QVERIFY(snapshot.contains(testCpp)); @@ -304,7 +301,6 @@ void ModelManagerTest::testRefreshAlsoIncludesOfProjectFiles() void ModelManagerTest::testRefreshSeveralTimes() { ModelManagerTestHelper helper; - CppModelManager *mm = CppModelManager::instance(); const MyTestDataDir testDataDir(_("testdata_refresh")); @@ -323,7 +319,7 @@ void ModelManagerTest::testRefreshSeveralTimes() }; const auto part = ProjectPart::create(project->projectFilePath(), rpp, {}, files); auto pi = ProjectInfo::create(ProjectUpdateInfo(project, KitInfo(nullptr), {}, {}), {part}); - mm->updateProjectInfo(pi); + CppModelManager::updateProjectInfo(pi); CPlusPlus::Snapshot snapshot; QSet<FilePath> refreshedFiles; @@ -344,7 +340,7 @@ void ModelManagerTest::testRefreshSeveralTimes() QVERIFY(refreshedFiles.contains(testHeader2)); QVERIFY(refreshedFiles.contains(testCpp)); - snapshot = mm->snapshot(); + snapshot = CppModelManager::snapshot(); QVERIFY(snapshot.contains(testHeader1)); QVERIFY(snapshot.contains(testHeader2)); QVERIFY(snapshot.contains(testCpp)); @@ -366,7 +362,6 @@ void ModelManagerTest::testRefreshSeveralTimes() void ModelManagerTest::testRefreshTestForChanges() { ModelManagerTestHelper helper; - CppModelManager *mm = CppModelManager::instance(); const MyTestDataDir testDataDir(_("testdata_refresh")); const FilePath testCpp = testDataDir.filePath("source.cpp"); @@ -381,7 +376,7 @@ void ModelManagerTest::testRefreshTestForChanges() // Reindexing triggers a reparsing thread helper.resetRefreshedSourceFiles(); - QFuture<void> firstFuture = mm->updateProjectInfo(pi); + QFuture<void> firstFuture = CppModelManager::updateProjectInfo(pi); QVERIFY(firstFuture.isStarted() || firstFuture.isRunning()); firstFuture.waitForFinished(); const QSet<FilePath> refreshedFiles = helper.waitForRefreshedSourceFiles(); @@ -389,7 +384,7 @@ void ModelManagerTest::testRefreshTestForChanges() QVERIFY(refreshedFiles.contains(testCpp)); // No reindexing since nothing has changed - QFuture<void> subsequentFuture = mm->updateProjectInfo(pi); + QFuture<void> subsequentFuture = CppModelManager::updateProjectInfo(pi); QVERIFY(subsequentFuture.isCanceled() && subsequentFuture.isFinished()); } @@ -398,7 +393,6 @@ void ModelManagerTest::testRefreshTestForChanges() void ModelManagerTest::testRefreshAddedAndPurgeRemoved() { ModelManagerTestHelper helper; - CppModelManager *mm = CppModelManager::instance(); const MyTestDataDir testDataDir(_("testdata_refresh")); @@ -424,7 +418,7 @@ void ModelManagerTest::testRefreshAddedAndPurgeRemoved() QVERIFY(refreshedFiles.contains(testHeader1)); QVERIFY(refreshedFiles.contains(testCpp)); - snapshot = mm->snapshot(); + snapshot = CppModelManager::snapshot(); QVERIFY(snapshot.contains(testHeader1)); QVERIFY(snapshot.contains(testCpp)); @@ -440,7 +434,7 @@ void ModelManagerTest::testRefreshAddedAndPurgeRemoved() QCOMPARE(refreshedFiles.size(), 1); QVERIFY(refreshedFiles.contains(testHeader2)); - snapshot = mm->snapshot(); + snapshot = CppModelManager::snapshot(); QVERIFY(snapshot.contains(testHeader2)); QVERIFY(snapshot.contains(testCpp)); // The removed project file is not anymore in the snapshot @@ -461,7 +455,6 @@ void ModelManagerTest::testRefreshTimeStampModifiedIfSourcefilesChange() const FilePaths finalProjectFilePaths = toAbsolutePaths(finalProjectFiles, temporaryDir); ModelManagerTestHelper helper; - CppModelManager *mm = CppModelManager::instance(); const auto project = helper.createProject(_("test_modelmanager_refresh_timeStampModified"), FilePath::fromString("blubb.pro")); @@ -480,7 +473,7 @@ void ModelManagerTest::testRefreshTimeStampModifiedIfSourcefilesChange() refreshedFiles = helper.updateProjectInfo(pi); QCOMPARE(refreshedFiles.size(), initialProjectFilePaths.size()); - snapshot = mm->snapshot(); + snapshot = CppModelManager::snapshot(); for (const FilePath &file : initialProjectFilePaths) { QVERIFY(refreshedFiles.contains(file)); QVERIFY(snapshot.contains(file)); @@ -509,7 +502,7 @@ void ModelManagerTest::testRefreshTimeStampModifiedIfSourcefilesChange() refreshedFiles = helper.updateProjectInfo(pi); QCOMPARE(refreshedFiles.size(), finalProjectFilePaths.size()); - snapshot = mm->snapshot(); + snapshot = CppModelManager::snapshot(); for (const FilePath &file : finalProjectFilePaths) { QVERIFY(refreshedFiles.contains(file)); QVERIFY(snapshot.contains(file)); @@ -550,7 +543,6 @@ void ModelManagerTest::testSnapshotAfterTwoProjects() ModelManagerTestHelper helper; ProjectCreator project1(&helper); ProjectCreator project2(&helper); - CppModelManager *mm = CppModelManager::instance(); // Project 1 project1.create(_("test_modelmanager_snapshot_after_two_projects.1"), @@ -559,10 +551,10 @@ void ModelManagerTest::testSnapshotAfterTwoProjects() refreshedFiles = helper.updateProjectInfo(project1.projectInfo); QCOMPARE(refreshedFiles, Utils::toSet(project1.projectFiles)); - const int snapshotSizeAfterProject1 = mm->snapshot().size(); + const int snapshotSizeAfterProject1 = CppModelManager::snapshot().size(); for (const FilePath &file : std::as_const(project1.projectFiles)) - QVERIFY(mm->snapshot().contains(file)); + QVERIFY(CppModelManager::snapshot().contains(file)); // Project 2 project2.create(_("test_modelmanager_snapshot_after_two_projects.2"), @@ -572,14 +564,14 @@ void ModelManagerTest::testSnapshotAfterTwoProjects() refreshedFiles = helper.updateProjectInfo(project2.projectInfo); QCOMPARE(refreshedFiles, Utils::toSet(project2.projectFiles)); - const int snapshotSizeAfterProject2 = mm->snapshot().size(); + const int snapshotSizeAfterProject2 = CppModelManager::snapshot().size(); QVERIFY(snapshotSizeAfterProject2 > snapshotSizeAfterProject1); QVERIFY(snapshotSizeAfterProject2 >= snapshotSizeAfterProject1 + project2.projectFiles.size()); for (const FilePath &file : std::as_const(project1.projectFiles)) - QVERIFY(mm->snapshot().contains(file)); + QVERIFY(CppModelManager::snapshot().contains(file)); for (const FilePath &file : std::as_const(project2.projectFiles)) - QVERIFY(mm->snapshot().contains(file)); + QVERIFY(CppModelManager::snapshot().contains(file)); } /// Check: (1) For a project with a *.ui file an AbstractEditorSupport object @@ -601,10 +593,9 @@ void ModelManagerTest::testExtraeditorsupportUiFiles() // Check working copy. // An AbstractEditorSupport object should have been added for the ui_* file. - CppModelManager *mm = CppModelManager::instance(); - WorkingCopy workingCopy = mm->workingCopy(); + WorkingCopy workingCopy = CppModelManager::workingCopy(); - QCOMPARE(workingCopy.size(), 2); // mm->configurationFileName() and "ui_*.h" + QCOMPARE(workingCopy.size(), 2); // CppModelManager::configurationFileName() and "ui_*.h" QStringList fileNamesInWorkinCopy; const WorkingCopy::Table &elements = workingCopy.elements(); @@ -613,16 +604,16 @@ void ModelManagerTest::testExtraeditorsupportUiFiles() fileNamesInWorkinCopy.sort(); const QString expectedUiHeaderFileName = _("ui_mainwindow.h"); - QCOMPARE(fileNamesInWorkinCopy.at(0), mm->configurationFileName().toString()); + QCOMPARE(fileNamesInWorkinCopy.at(0), CppModelManager::configurationFileName().toString()); QCOMPARE(fileNamesInWorkinCopy.at(1), expectedUiHeaderFileName); // Check CppSourceProcessor / includes. // The CppSourceProcessor is expected to find the ui_* file in the working copy. const FilePath fileIncludingTheUiFile = temporaryDir.absolutePath("mainwindow.cpp"); - while (!mm->snapshot().document(fileIncludingTheUiFile)) + while (!CppModelManager::snapshot().document(fileIncludingTheUiFile)) QCoreApplication::processEvents(); - const CPlusPlus::Snapshot snapshot = mm->snapshot(); + const CPlusPlus::Snapshot snapshot = CppModelManager::snapshot(); const Document::Ptr document = snapshot.document(fileIncludingTheUiFile); QVERIFY(document); const FilePaths includedFiles = document->includedFiles(); @@ -640,7 +631,6 @@ void ModelManagerTest::testGcIfLastCppeditorClosed() MyTestDataDir testDataDirectory(_("testdata_guiproject1")); const FilePath file = testDataDirectory.filePath("main.cpp"); - CppModelManager *mm = CppModelManager::instance(); helper.resetRefreshedSourceFiles(); // Open a file in the editor @@ -648,8 +638,8 @@ void ModelManagerTest::testGcIfLastCppeditorClosed() Core::IEditor *editor = Core::EditorManager::openEditor(file); QVERIFY(editor); QCOMPARE(Core::DocumentModel::openedDocuments().size(), 1); - QVERIFY(mm->isCppEditor(editor)); - QVERIFY(mm->workingCopy().get(file)); + QVERIFY(CppModelManager::isCppEditor(editor)); + QVERIFY(CppModelManager::workingCopy().get(file)); // Wait until the file is refreshed helper.waitForRefreshedSourceFiles(); @@ -659,8 +649,8 @@ void ModelManagerTest::testGcIfLastCppeditorClosed() helper.waitForFinishedGc(); // Check: File is removed from the snapshpt - QVERIFY(!mm->workingCopy().get(file)); - QVERIFY(!mm->snapshot().contains(file)); + QVERIFY(!CppModelManager::workingCopy().get(file)); + QVERIFY(!CppModelManager::snapshot().contains(file)); } /// Check: Files that are open in the editor are not garbage collected. @@ -671,7 +661,6 @@ void ModelManagerTest::testDontGcOpenedFiles() MyTestDataDir testDataDirectory(_("testdata_guiproject1")); const FilePath file = testDataDirectory.filePath("main.cpp"); - CppModelManager *mm = CppModelManager::instance(); helper.resetRefreshedSourceFiles(); // Open a file in the editor @@ -679,24 +668,24 @@ void ModelManagerTest::testDontGcOpenedFiles() Core::IEditor *editor = Core::EditorManager::openEditor(file); QVERIFY(editor); QCOMPARE(Core::DocumentModel::openedDocuments().size(), 1); - QVERIFY(mm->isCppEditor(editor)); + QVERIFY(CppModelManager::isCppEditor(editor)); // Wait until the file is refreshed and check whether it is in the working copy helper.waitForRefreshedSourceFiles(); - QVERIFY(mm->workingCopy().get(file)); + QVERIFY(CppModelManager::workingCopy().get(file)); // Run the garbage collector - mm->GC(); + CppModelManager::GC(); // Check: File is still there - QVERIFY(mm->workingCopy().get(file)); - QVERIFY(mm->snapshot().contains(file)); + QVERIFY(CppModelManager::workingCopy().get(file)); + QVERIFY(CppModelManager::snapshot().contains(file)); // Close editor Core::EditorManager::closeDocuments({editor->document()}); helper.waitForFinishedGc(); - QVERIFY(mm->snapshot().isEmpty()); + QVERIFY(CppModelManager::snapshot().isEmpty()); } namespace { @@ -735,8 +724,6 @@ void ModelManagerTest::testDefinesPerProject() const FilePath main2File = testDataDirectory.filePath("main2.cpp"); const FilePath header = testDataDirectory.filePath("header.h"); - CppModelManager *mm = CppModelManager::instance(); - const auto project = helper.createProject(_("test_modelmanager_defines_per_project"), Utils::FilePath::fromString("blubb.pro")); @@ -758,7 +745,7 @@ void ModelManagerTest::testDefinesPerProject() const auto pi = ProjectInfo::create({project, KitInfo(nullptr), {}, {}}, {part1, part2}); helper.updateProjectInfo(pi); - QCOMPARE(mm->snapshot().size(), 4); + QCOMPARE(CppModelManager::snapshot().size(), 4); // Open a file in the editor QCOMPARE(Core::DocumentModel::openedDocuments().size(), 0); @@ -778,9 +765,9 @@ void ModelManagerTest::testDefinesPerProject() EditorCloser closer(editor); QVERIFY(editor); QCOMPARE(Core::DocumentModel::openedDocuments().size(), 1); - QVERIFY(mm->isCppEditor(editor)); + QVERIFY(CppModelManager::isCppEditor(editor)); - Document::Ptr doc = mm->document(i.filePath); + Document::Ptr doc = CppModelManager::document(i.filePath); QCOMPARE(nameOfFirstDeclaration(doc), firstDeclarationName); } } @@ -796,8 +783,6 @@ void ModelManagerTest::testPrecompiledHeaders() const FilePath pch1File = testDataDirectory.filePath("pch1.h"); const FilePath pch2File = testDataDirectory.filePath("pch2.h"); - CppModelManager *mm = CppModelManager::instance(); - const auto project = helper.createProject(_("test_modelmanager_defines_per_project_pch"), Utils::FilePath::fromString("blubb.pro")); @@ -820,7 +805,7 @@ void ModelManagerTest::testPrecompiledHeaders() const auto pi = ProjectInfo::create({project, KitInfo(nullptr), {}, {}}, {part1, part2}); helper.updateProjectInfo(pi); - QCOMPARE(mm->snapshot().size(), 4); + QCOMPARE(CppModelManager::snapshot().size(), 4); // Open a file in the editor QCOMPARE(Core::DocumentModel::openedDocuments().size(), 0); @@ -842,18 +827,17 @@ void ModelManagerTest::testPrecompiledHeaders() EditorCloser closer(editor); QVERIFY(editor); QCOMPARE(Core::DocumentModel::openedDocuments().size(), 1); - QVERIFY(mm->isCppEditor(editor)); + QVERIFY(CppModelManager::isCppEditor(editor)); auto parser = BuiltinEditorDocumentParser::get(filePath); QVERIFY(parser); BaseEditorDocumentParser::Configuration config = parser->configuration(); config.usePrecompiledHeaders = true; parser->setConfiguration(config); - parser->update({CppModelManager::instance()->workingCopy(), nullptr, - Utils::Language::Cxx, false}); + parser->update({CppModelManager::workingCopy(), nullptr,Utils::Language::Cxx, false}); // Check if defines from pch are considered - Document::Ptr document = mm->document(filePath); + Document::Ptr document = CppModelManager::document(filePath); QCOMPARE(nameOfFirstDeclaration(document), firstDeclarationName); // Check if declarations from pch are considered @@ -876,8 +860,6 @@ void ModelManagerTest::testDefinesPerEditor() const FilePath main2File = testDataDirectory.filePath("main2.cpp"); const FilePath header = testDataDirectory.filePath("header.h"); - CppModelManager *mm = CppModelManager::instance(); - const auto project = helper.createProject(_("test_modelmanager_defines_per_editor"), Utils::FilePath::fromString("blubb.pro")); @@ -896,7 +878,7 @@ void ModelManagerTest::testDefinesPerEditor() const auto pi = ProjectInfo::create({project, KitInfo(nullptr), {}, {}}, {part1, part2}); helper.updateProjectInfo(pi); - QCOMPARE(mm->snapshot().size(), 4); + QCOMPARE(CppModelManager::snapshot().size(), 4); // Open a file in the editor QCOMPARE(Core::DocumentModel::openedDocuments().size(), 0); @@ -916,17 +898,16 @@ void ModelManagerTest::testDefinesPerEditor() EditorCloser closer(editor); QVERIFY(editor); QCOMPARE(Core::DocumentModel::openedDocuments().size(), 1); - QVERIFY(mm->isCppEditor(editor)); + QVERIFY(CppModelManager::isCppEditor(editor)); const FilePath filePath = editor->document()->filePath(); const auto parser = BaseEditorDocumentParser::get(filePath); BaseEditorDocumentParser::Configuration config = parser->configuration(); config.editorDefines = editorDefines.toUtf8(); parser->setConfiguration(config); - parser->update({CppModelManager::instance()->workingCopy(), nullptr, - Utils::Language::Cxx, false}); + parser->update({CppModelManager::workingCopy(), nullptr, Utils::Language::Cxx, false}); - Document::Ptr doc = mm->document(main1File); + Document::Ptr doc = CppModelManager::document(main1File); QCOMPARE(nameOfFirstDeclaration(doc), firstDeclarationName); } } @@ -986,7 +967,7 @@ void ModelManagerTest::testUpdateEditorsAfterProjectUpdate() void ModelManagerTest::testRenameIncludes() { struct ModelManagerGCHelper { - ~ModelManagerGCHelper() { CppModelManager::instance()->GC(); } + ~ModelManagerGCHelper() { CppModelManager::GC(); } } GCHelper; Q_UNUSED(GCHelper) // do not warn about being unused @@ -997,7 +978,6 @@ void ModelManagerTest::testRenameIncludes() const QStringList fileNames = {"foo.h", "foo.cpp", "main.cpp"}; const FilePath oldHeader = FilePath::fromString(workingDir.filePath("foo.h")); const FilePath newHeader = FilePath::fromString(workingDir.filePath("bar.h")); - CppModelManager *modelManager = CppModelManager::instance(); const MyTestDataDir testDir(_("testdata_project1")); // Copy test files to a temporary directory @@ -1012,9 +992,9 @@ void ModelManagerTest::testRenameIncludes() } // Update the c++ model manager and check for the old includes - modelManager->updateSourceFiles(sourceFiles).waitForFinished(); + CppModelManager::updateSourceFiles(sourceFiles).waitForFinished(); QCoreApplication::processEvents(); - CPlusPlus::Snapshot snapshot = modelManager->snapshot(); + CPlusPlus::Snapshot snapshot = CppModelManager::snapshot(); for (const FilePath &sourceFile : std::as_const(sourceFiles)) { QCOMPARE(snapshot.allIncludesForDocument(sourceFile), QSet<FilePath>{oldHeader}); } @@ -1025,9 +1005,9 @@ void ModelManagerTest::testRenameIncludes() Core::HandleIncludeGuards::Yes)); // Update the c++ model manager again and check for the new includes - modelManager->updateSourceFiles(sourceFiles).waitForFinished(); + CppModelManager::updateSourceFiles(sourceFiles).waitForFinished(); QCoreApplication::processEvents(); - snapshot = modelManager->snapshot(); + snapshot = CppModelManager::snapshot(); for (const FilePath &sourceFile : std::as_const(sourceFiles)) { QCOMPARE(snapshot.allIncludesForDocument(sourceFile), QSet<FilePath>{newHeader}); } @@ -1036,7 +1016,7 @@ void ModelManagerTest::testRenameIncludes() void ModelManagerTest::testRenameIncludesInEditor() { struct ModelManagerGCHelper { - ~ModelManagerGCHelper() { CppModelManager::instance()->GC(); } + ~ModelManagerGCHelper() { CppModelManager::GC(); } } GCHelper; Q_UNUSED(GCHelper) // do not warn about being unused @@ -1054,7 +1034,6 @@ void ModelManagerTest::testRenameIncludesInEditor() const QString headerWithMalformedGuard(workingDir.filePath(_("baz3.h"))); const QString renamedHeaderWithMalformedGuard(workingDir.filePath(_("foobar5000.h"))); const FilePath mainFile = FilePath::fromString(workingDir.filePath("main.cpp")); - CppModelManager *modelManager = CppModelManager::instance(); const MyTestDataDir testDir(_("testdata_project1")); ModelManagerTestHelper helper; @@ -1072,9 +1051,9 @@ void ModelManagerTest::testRenameIncludesInEditor() } // Update the c++ model manager and check for the old includes - modelManager->updateSourceFiles(sourceFiles).waitForFinished(); + CppModelManager::updateSourceFiles(sourceFiles).waitForFinished(); QCoreApplication::processEvents(); - CPlusPlus::Snapshot snapshot = modelManager->snapshot(); + CPlusPlus::Snapshot snapshot = CppModelManager::snapshot(); for (const FilePath &sourceFile : std::as_const(sourceFiles)) { QCOMPARE(snapshot.allIncludesForDocument(sourceFile), QSet<FilePath>{headerWithPragmaOnce}); @@ -1087,8 +1066,8 @@ void ModelManagerTest::testRenameIncludesInEditor() EditorCloser editorCloser(editor); const QScopeGuard cleanup([] { Core::DocumentManager::saveAllModifiedDocumentsSilently(); }); QCOMPARE(Core::DocumentModel::openedDocuments().size(), 1); - QVERIFY(modelManager->isCppEditor(editor)); - QVERIFY(modelManager->workingCopy().get(mainFile)); + QVERIFY(CppModelManager::isCppEditor(editor)); + QVERIFY(CppModelManager::workingCopy().get(mainFile)); // Test the renaming of a header file where a pragma once guard is present QVERIFY(Core::FileUtils::renameFile(headerWithPragmaOnce, @@ -1150,9 +1129,9 @@ void ModelManagerTest::testRenameIncludesInEditor() // Update the c++ model manager again and check for the new includes TestCase::waitForProcessedEditorDocument(mainFile); - modelManager->updateSourceFiles(sourceFiles).waitForFinished(); + CppModelManager::updateSourceFiles(sourceFiles).waitForFinished(); QCoreApplication::processEvents(); - snapshot = modelManager->snapshot(); + snapshot = CppModelManager::snapshot(); for (const FilePath &sourceFile : std::as_const(sourceFiles)) { QCOMPARE(snapshot.allIncludesForDocument(sourceFile), QSet<FilePath>{renamedHeaderWithPragmaOnce}); @@ -1170,35 +1149,34 @@ void ModelManagerTest::testDocumentsAndRevisions() const QSet<FilePath> filesToIndex = {filePath1,filePath2}; QVERIFY(TestCase::parseFiles(filesToIndex)); - CppModelManager *modelManager = CppModelManager::instance(); - VERIFY_DOCUMENT_REVISION(modelManager->document(filePath1), 1U); - VERIFY_DOCUMENT_REVISION(modelManager->document(filePath2), 1U); + VERIFY_DOCUMENT_REVISION(CppModelManager::document(filePath1), 1U); + VERIFY_DOCUMENT_REVISION(CppModelManager::document(filePath2), 1U); // Open editor for file 1 TextEditor::BaseTextEditor *editor1; QVERIFY(helper.openCppEditor(filePath1, &editor1)); helper.closeEditorAtEndOfTestCase(editor1); QVERIFY(TestCase::waitForProcessedEditorDocument(filePath1)); - VERIFY_DOCUMENT_REVISION(modelManager->document(filePath1), 2U); - VERIFY_DOCUMENT_REVISION(modelManager->document(filePath2), 1U); + VERIFY_DOCUMENT_REVISION(CppModelManager::document(filePath1), 2U); + VERIFY_DOCUMENT_REVISION(CppModelManager::document(filePath2), 1U); // Index again QVERIFY(TestCase::parseFiles(filesToIndex)); - VERIFY_DOCUMENT_REVISION(modelManager->document(filePath1), 3U); - VERIFY_DOCUMENT_REVISION(modelManager->document(filePath2), 2U); + VERIFY_DOCUMENT_REVISION(CppModelManager::document(filePath1), 3U); + VERIFY_DOCUMENT_REVISION(CppModelManager::document(filePath2), 2U); // Open editor for file 2 TextEditor::BaseTextEditor *editor2; QVERIFY(helper.openCppEditor(filePath2, &editor2)); helper.closeEditorAtEndOfTestCase(editor2); QVERIFY(TestCase::waitForProcessedEditorDocument(filePath2)); - VERIFY_DOCUMENT_REVISION(modelManager->document(filePath1), 3U); - VERIFY_DOCUMENT_REVISION(modelManager->document(filePath2), 3U); + VERIFY_DOCUMENT_REVISION(CppModelManager::document(filePath1), 3U); + VERIFY_DOCUMENT_REVISION(CppModelManager::document(filePath2), 3U); // Index again QVERIFY(TestCase::parseFiles(filesToIndex)); - VERIFY_DOCUMENT_REVISION(modelManager->document(filePath1), 4U); - VERIFY_DOCUMENT_REVISION(modelManager->document(filePath2), 4U); + VERIFY_DOCUMENT_REVISION(CppModelManager::document(filePath1), 4U); + VERIFY_DOCUMENT_REVISION(CppModelManager::document(filePath2), 4U); } } // CppEditor::Internal diff --git a/src/plugins/cppeditor/cppprojectupdater.cpp b/src/plugins/cppeditor/cppprojectupdater.cpp index e4b57c90c5a..4df4b5de4ae 100644 --- a/src/plugins/cppeditor/cppprojectupdater.cpp +++ b/src/plugins/cppeditor/cppprojectupdater.cpp @@ -81,8 +81,7 @@ void CppProjectUpdater::update(const ProjectUpdateInfo &projectUpdateInfo, } } GeneratedCodeModelSupport::update(extraCompilers); - auto updateFuture = CppModelManager::instance()->updateProjectInfo(storage->projectInfo, - compilerFiles); + auto updateFuture = CppModelManager::updateProjectInfo(storage->projectInfo, compilerFiles); m_futureSynchronizer.addFuture(updateFuture); m_taskTree.release()->deleteLater(); }; diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 048ec9915e2..09bc7d05d45 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -95,8 +95,8 @@ BaseQuickFixTestCase::BaseQuickFixTestCase(const QList<TestDocumentPtr> &testDoc // Set appropriate include paths if (!headerPaths.isEmpty()) { m_restoreHeaderPaths = true; - m_headerPathsToRestore = m_modelManager->headerPaths(); - m_modelManager->setHeaderPaths(headerPaths); + m_headerPathsToRestore = CppModelManager::headerPaths(); + CppModelManager::setHeaderPaths(headerPaths); } // Update Code Model @@ -154,7 +154,7 @@ BaseQuickFixTestCase::~BaseQuickFixTestCase() // Restore include paths if (m_restoreHeaderPaths) - m_modelManager->setHeaderPaths(m_headerPathsToRestore); + CppModelManager::setHeaderPaths(m_headerPathsToRestore); // Remove created files from file system for (const TestDocumentPtr &testDocument : std::as_const(m_testDocuments)) diff --git a/src/plugins/cppeditor/cppquickfixassistant.cpp b/src/plugins/cppeditor/cppquickfixassistant.cpp index 19514387d71..9202e639a28 100644 --- a/src/plugins/cppeditor/cppquickfixassistant.cpp +++ b/src/plugins/cppeditor/cppquickfixassistant.cpp @@ -51,7 +51,7 @@ CppQuickFixInterface::CppQuickFixInterface(CppEditorWidget *editor, AssistReason : AssistInterface(editor->textCursor(), editor->textDocument()->filePath(), reason) , m_editor(editor) , m_semanticInfo(editor->semanticInfo()) - , m_snapshot(CppModelManager::instance()->snapshot()) + , m_snapshot(CppModelManager::snapshot()) , m_currentFile(CppRefactoringChanges::file(editor, m_semanticInfo.doc)) , m_context(m_semanticInfo.doc, m_snapshot) { diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 93596f5ec43..9786083f6f8 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -1899,10 +1899,9 @@ ProjectExplorer::HeaderPaths relevantHeaderPaths(const QString &filePath) { ProjectExplorer::HeaderPaths headerPaths; - CppModelManager *modelManager = CppModelManager::instance(); - const QList<ProjectPart::ConstPtr> projectParts = modelManager->projectPart(filePath); + const QList<ProjectPart::ConstPtr> projectParts = CppModelManager::projectPart(filePath); if (projectParts.isEmpty()) { // Not part of any project, better use all include paths than none - headerPaths += modelManager->headerPaths(); + headerPaths += CppModelManager::headerPaths(); } else { for (const ProjectPart::ConstPtr &part : projectParts) headerPaths += part->headerPaths; @@ -1997,7 +1996,7 @@ QList<IndexItem::Ptr> matchName(const Name *name, QString *className) QString simpleName; QList<IndexItem::Ptr> matches; - CppLocatorData *locatorData = CppModelManager::instance()->locatorData(); + CppLocatorData *locatorData = CppModelManager::locatorData(); const Overview oo; if (const QualifiedNameId *qualifiedName = name->asQualifiedNameId()) { const Name *name = qualifiedName->name(); diff --git a/src/plugins/cppeditor/cpprefactoringchanges.cpp b/src/plugins/cppeditor/cpprefactoringchanges.cpp index dcbb53f3b11..98eaaa8febb 100644 --- a/src/plugins/cppeditor/cpprefactoringchanges.cpp +++ b/src/plugins/cppeditor/cpprefactoringchanges.cpp @@ -217,8 +217,7 @@ void CppRefactoringFile::fileChanged() CppRefactoringChangesData::CppRefactoringChangesData(const Snapshot &snapshot) : m_snapshot(snapshot) - , m_modelManager(CppModelManager::instance()) - , m_workingCopy(m_modelManager->workingCopy()) + , m_workingCopy(CppModelManager::workingCopy()) {} void CppRefactoringChangesData::indentSelection(const QTextCursor &selection, @@ -249,7 +248,7 @@ void CppRefactoringChangesData::reindentSelection(const QTextCursor &selection, void CppRefactoringChangesData::fileChanged(const FilePath &filePath) { - m_modelManager->updateSourceFiles({filePath}); + CppModelManager::updateSourceFiles({filePath}); } } // CppEditor diff --git a/src/plugins/cppeditor/cpprefactoringchanges.h b/src/plugins/cppeditor/cpprefactoringchanges.h index 4a79da2f73e..5dca8a9ca51 100644 --- a/src/plugins/cppeditor/cpprefactoringchanges.h +++ b/src/plugins/cppeditor/cpprefactoringchanges.h @@ -76,7 +76,6 @@ public: void fileChanged(const Utils::FilePath &filePath) override; CPlusPlus::Snapshot m_snapshot; - CppModelManager *m_modelManager; WorkingCopy m_workingCopy; }; diff --git a/src/plugins/cppeditor/cppsemanticinfoupdater.cpp b/src/plugins/cppeditor/cppsemanticinfoupdater.cpp index 4fc9dd7c66b..4edc7dac13a 100644 --- a/src/plugins/cppeditor/cppsemanticinfoupdater.cpp +++ b/src/plugins/cppeditor/cppsemanticinfoupdater.cpp @@ -178,7 +178,7 @@ void SemanticInfoUpdater::updateDetached(const SemanticInfo::Source &source) return; } - d->m_future = Utils::asyncRun(CppModelManager::instance()->sharedThreadPool(), + d->m_future = Utils::asyncRun(CppModelManager::sharedThreadPool(), &SemanticInfoUpdaterPrivate::update_helper, d.data(), source); } diff --git a/src/plugins/cppeditor/cppsourceprocessor_test.cpp b/src/plugins/cppeditor/cppsourceprocessor_test.cpp index b6ec4a4095e..23c5e111f63 100644 --- a/src/plugins/cppeditor/cppsourceprocessor_test.cpp +++ b/src/plugins/cppeditor/cppsourceprocessor_test.cpp @@ -34,7 +34,6 @@ class SourcePreprocessor { public: SourcePreprocessor() - : m_cmm(CppModelManager::instance()) { cleanUp(); } @@ -47,7 +46,7 @@ public: TestIncludePaths::directoryOfTestFile())}); sourceProcessor->run(filePath); - Document::Ptr document = m_cmm->document(filePath); + Document::Ptr document = CppModelManager::document(filePath); return document; } @@ -59,12 +58,9 @@ public: private: void cleanUp() { - m_cmm->GC(); - QVERIFY(m_cmm->snapshot().isEmpty()); + CppModelManager::GC(); + QVERIFY(CppModelManager::snapshot().isEmpty()); } - -private: - CppModelManager *m_cmm; }; /// Check: Resolved and unresolved includes are properly tracked. diff --git a/src/plugins/cppeditor/cpptoolsjsextension.cpp b/src/plugins/cppeditor/cpptoolsjsextension.cpp index 0818af0acb4..6e3c1f1a7dc 100644 --- a/src/plugins/cppeditor/cpptoolsjsextension.cpp +++ b/src/plugins/cppeditor/cpptoolsjsextension.cpp @@ -151,8 +151,8 @@ bool CppToolsJsExtension::hasQObjectParent(const QString &klassName) const const IndexItem::Ptr item = candidates.first(); // Find class in AST. - const CPlusPlus::Snapshot snapshot = CppModelManager::instance()->snapshot(); - const WorkingCopy workingCopy = CppModelManager::instance()->workingCopy(); + const CPlusPlus::Snapshot snapshot = CppModelManager::snapshot(); + const WorkingCopy workingCopy = CppModelManager::workingCopy(); std::optional<QByteArray> source = workingCopy.source(item->filePath()); if (!source) { const Utils::expected_str<QByteArray> contents = item->filePath().fileContents(); diff --git a/src/plugins/cppeditor/cpptoolstestcase.cpp b/src/plugins/cppeditor/cpptoolstestcase.cpp index 810f66db49c..63949229abe 100644 --- a/src/plugins/cppeditor/cpptoolstestcase.cpp +++ b/src/plugins/cppeditor/cpptoolstestcase.cpp @@ -149,15 +149,15 @@ VerifyCleanCppModelManager::~VerifyCleanCppModelManager() { bool VerifyCleanCppModelManager::isClean(bool testOnlyForCleanedProjects) { - CppModelManager *mm = CppModelManager::instance(); - RETURN_FALSE_IF_NOT(mm->projectInfos().isEmpty()); - RETURN_FALSE_IF_NOT(mm->headerPaths().isEmpty()); - RETURN_FALSE_IF_NOT(mm->definedMacros().isEmpty()); - RETURN_FALSE_IF_NOT(mm->projectFiles().isEmpty()); + RETURN_FALSE_IF_NOT(CppModelManager::projectInfos().isEmpty()); + RETURN_FALSE_IF_NOT(CppModelManager::headerPaths().isEmpty()); + RETURN_FALSE_IF_NOT(CppModelManager::definedMacros().isEmpty()); + RETURN_FALSE_IF_NOT(CppModelManager::projectFiles().isEmpty()); if (!testOnlyForCleanedProjects) { - RETURN_FALSE_IF_NOT(mm->snapshot().isEmpty()); - RETURN_FALSE_IF_NOT(mm->workingCopy().size() == 1); - RETURN_FALSE_IF_NOT(mm->workingCopy().get(mm->configurationFileName())); + RETURN_FALSE_IF_NOT(CppModelManager::snapshot().isEmpty()); + RETURN_FALSE_IF_NOT(CppModelManager::workingCopy().size() == 1); + RETURN_FALSE_IF_NOT(CppModelManager::workingCopy() + .get(CppModelManager::configurationFileName())); } return true; } @@ -170,9 +170,9 @@ namespace CppEditor::Tests { static bool closeEditorsWithoutGarbageCollectorInvocation(const QList<Core::IEditor *> &editors) { - CppModelManager::instance()->enableGarbageCollector(false); + CppModelManager::enableGarbageCollector(false); const bool closeEditorsSucceeded = Core::EditorManager::closeEditors(editors, false); - CppModelManager::instance()->enableGarbageCollector(true); + CppModelManager::enableGarbageCollector(true); return closeEditorsSucceeded; } @@ -188,8 +188,7 @@ static bool snapshotContains(const CPlusPlus::Snapshot &snapshot, const QSet<Fil } TestCase::TestCase(bool runGarbageCollector) - : m_modelManager(CppModelManager::instance()) - , m_succeededSoFar(false) + : m_succeededSoFar(false) , m_runGarbageCollector(runGarbageCollector) { if (m_runGarbageCollector) @@ -239,12 +238,12 @@ bool TestCase::openCppEditor(const FilePath &filePath, TextEditor::BaseTextEdito CPlusPlus::Snapshot TestCase::globalSnapshot() { - return CppModelManager::instance()->snapshot(); + return CppModelManager::snapshot(); } bool TestCase::garbageCollectGlobalSnapshot() { - CppModelManager::instance()->GC(); + CppModelManager::GC(); return globalSnapshot().isEmpty(); } @@ -269,7 +268,7 @@ static bool waitForProcessedEditorDocument_internal(CppEditorDocumentHandle *edi bool TestCase::waitForProcessedEditorDocument(const FilePath &filePath, int timeOutInMs) { - auto *editorDocument = CppModelManager::instance()->cppEditorDocument(filePath); + auto *editorDocument = CppModelManager::cppEditorDocument(filePath); return waitForProcessedEditorDocument_internal(editorDocument, timeOutInMs); } @@ -282,7 +281,7 @@ CPlusPlus::Document::Ptr TestCase::waitForRehighlightedSemanticDocument(CppEdito bool TestCase::parseFiles(const QSet<FilePath> &filePaths) { - CppModelManager::instance()->updateSourceFiles(filePaths).waitForFinished(); + CppModelManager::updateSourceFiles(filePaths).waitForFinished(); QCoreApplication::processEvents(); const CPlusPlus::Snapshot snapshot = globalSnapshot(); if (snapshot.isEmpty()) { @@ -349,7 +348,7 @@ bool TestCase::waitUntilProjectIsFullyOpened(Project *project, int timeOutInMs) [project]() { return ProjectManager::startupBuildSystem() && !ProjectManager::startupBuildSystem()->isParsing() - && CppModelManager::instance()->projectInfo(project); + && CppModelManager::projectInfo(project); }, timeOutInMs); } @@ -405,7 +404,7 @@ ProjectInfo::ConstPtr ProjectOpenerAndCloser::open(const FilePath &projectFile, if (TestCase::waitUntilProjectIsFullyOpened(project)) { m_openProjects.append(project); - return CppModelManager::instance()->projectInfo(project); + return CppModelManager::projectInfo(project); } return {}; diff --git a/src/plugins/cppeditor/cpptoolstestcase.h b/src/plugins/cppeditor/cpptoolstestcase.h index 84cf0f088a8..13548630e65 100644 --- a/src/plugins/cppeditor/cpptoolstestcase.h +++ b/src/plugins/cppeditor/cpptoolstestcase.h @@ -32,7 +32,6 @@ class IAssistProposal; namespace CppEditor { class CppEditorWidget; -class CppModelManager; namespace Internal::Tests { @@ -152,7 +151,6 @@ public: static bool writeFile(const Utils::FilePath &filePath, const QByteArray &contents); protected: - CppModelManager *m_modelManager; bool m_succeededSoFar; private: diff --git a/src/plugins/cppeditor/cppuseselections_test.cpp b/src/plugins/cppeditor/cppuseselections_test.cpp index c9c56752844..2e5a0f2a0d8 100644 --- a/src/plugins/cppeditor/cppuseselections_test.cpp +++ b/src/plugins/cppeditor/cppuseselections_test.cpp @@ -81,7 +81,7 @@ UseSelectionsTestCase::UseSelectionsTestCase(CppTestDocument &testFile, bool hasTimedOut; const SelectionList selections = waitForUseSelections(&hasTimedOut); - const bool clangCodeModel = CppModelManager::instance()->isClangCodeModelActive(); + const bool clangCodeModel = CppModelManager::isClangCodeModelActive(); if (clangCodeModel) { QEXPECT_FAIL("local use as macro argument - argument eaten", "fails with CCM, find out why", Abort); diff --git a/src/plugins/cppeditor/fileandtokenactions_test.cpp b/src/plugins/cppeditor/fileandtokenactions_test.cpp index 2ad6b6b4ef2..75dd0719a5c 100644 --- a/src/plugins/cppeditor/fileandtokenactions_test.cpp +++ b/src/plugins/cppeditor/fileandtokenactions_test.cpp @@ -110,7 +110,7 @@ static bool waitUntilAProjectIsLoaded(int timeOutInMs = 30000) timer.start(); while (timer.elapsed() < timeOutInMs) { - if (!CppModelManager::instance()->projectInfos().isEmpty()) + if (!CppModelManager::projectInfos().isEmpty()) return true; QCoreApplication::processEvents(); @@ -132,7 +132,7 @@ TestActionsTestCase::TestActionsTestCase(const Actions &tokenActions, const Acti // Collect files to process FilePaths filesToOpen; QList<QPointer<ProjectExplorer::Project> > projects; - const QList<ProjectInfo::ConstPtr> projectInfos = m_modelManager->projectInfos(); + const QList<ProjectInfo::ConstPtr> projectInfos = CppModelManager::projectInfos(); for (const ProjectInfo::ConstPtr &info : projectInfos) { qDebug() << "Project" << info->projectFilePath().toUserOutput() << "- files to process:" @@ -162,8 +162,8 @@ TestActionsTestCase::TestActionsTestCase(const Actions &tokenActions, const Acti QVERIFY(openCppEditor(filePath, &editor, &editorWidget)); QCOMPARE(DocumentModel::openedDocuments().size(), 1); - QVERIFY(m_modelManager->isCppEditor(editor)); - QVERIFY(m_modelManager->workingCopy().get(filePath)); + QVERIFY(CppModelManager::isCppEditor(editor)); + QVERIFY(CppModelManager::workingCopy().get(filePath)); // Rehighlight waitForRehighlightedSemanticDocument(editorWidget); diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp index 31d69f7363d..0432985eafb 100644 --- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp +++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp @@ -331,7 +331,7 @@ F2TestCase::F2TestCase(CppEditorAction action, switch (action) { case FollowSymbolUnderCursorAction: { CppEditorWidget *widget = initialTestFile->m_editorWidget; - if (CppModelManager::instance()->isClangCodeModelActive()) { + if (CppModelManager::isClangCodeModelActive()) { if (curTestName == "testFollowSymbolQTCREATORBUG7903") QSKIP((curTestName + " is not supported by Clang FollowSymbol").toLatin1()); widget->enableTestMode(); diff --git a/src/plugins/cppeditor/generatedcodemodelsupport.cpp b/src/plugins/cppeditor/generatedcodemodelsupport.cpp index 22a9b2735eb..63c9de66b91 100644 --- a/src/plugins/cppeditor/generatedcodemodelsupport.cpp +++ b/src/plugins/cppeditor/generatedcodemodelsupport.cpp @@ -49,10 +49,10 @@ private: QSet<QObject *> m_cache; }; -GeneratedCodeModelSupport::GeneratedCodeModelSupport(CppModelManager *modelmanager, - ExtraCompiler *generator, +GeneratedCodeModelSupport::GeneratedCodeModelSupport(ExtraCompiler *generator, const FilePath &generatedFile) : - AbstractEditorSupport(modelmanager, generator), m_generatedFilePath(generatedFile), + AbstractEditorSupport(generator), + m_generatedFilePath(generatedFile), m_generator(generator) { QLoggingCategory log("qtc.cppeditor.generatedcodemodelsupport", QtWarningMsg); @@ -66,8 +66,7 @@ GeneratedCodeModelSupport::GeneratedCodeModelSupport(CppModelManager *modelmanag GeneratedCodeModelSupport::~GeneratedCodeModelSupport() { - CppModelManager::instance()->emitAbstractEditorSupportRemoved( - m_generatedFilePath.toString()); + CppModelManager::emitAbstractEditorSupportRemoved(m_generatedFilePath.toString()); QLoggingCategory log("qtc.cppeditor.generatedcodemodelsupport", QtWarningMsg); qCDebug(log) << "dtor ~generatedcodemodelsupport for" << m_generatedFilePath; } @@ -99,15 +98,13 @@ void GeneratedCodeModelSupport::update(const QList<ExtraCompiler *> &generators) { static QObjectCache extraCompilerCache; - CppModelManager * const mm = CppModelManager::instance(); - for (ExtraCompiler *generator : generators) { if (extraCompilerCache.contains(generator)) continue; extraCompilerCache.insert(generator); - generator->forEachTarget([mm, generator](const FilePath &generatedFile) { - new GeneratedCodeModelSupport(mm, generator, generatedFile); + generator->forEachTarget([generator](const FilePath &generatedFile) { + new GeneratedCodeModelSupport(generator, generatedFile); }); } } diff --git a/src/plugins/cppeditor/generatedcodemodelsupport.h b/src/plugins/cppeditor/generatedcodemodelsupport.h index d37177d9910..618a837e8b2 100644 --- a/src/plugins/cppeditor/generatedcodemodelsupport.h +++ b/src/plugins/cppeditor/generatedcodemodelsupport.h @@ -15,8 +15,7 @@ class CPPEDITOR_EXPORT GeneratedCodeModelSupport : public AbstractEditorSupport Q_OBJECT public: - GeneratedCodeModelSupport(CppModelManager *modelmanager, - ProjectExplorer::ExtraCompiler *generator, + GeneratedCodeModelSupport(ProjectExplorer::ExtraCompiler *generator, const Utils::FilePath &generatedFile); ~GeneratedCodeModelSupport() override; diff --git a/src/plugins/cppeditor/includeutils.cpp b/src/plugins/cppeditor/includeutils.cpp index 1404f5bace3..c7daa4e9d8f 100644 --- a/src/plugins/cppeditor/includeutils.cpp +++ b/src/plugins/cppeditor/includeutils.cpp @@ -511,14 +511,13 @@ namespace Internal { static QList<Include> includesForSource(const FilePath &filePath) { - CppModelManager *cmm = CppModelManager::instance(); - cmm->GC(); + CppModelManager::GC(); QScopedPointer<CppSourceProcessor> sourceProcessor(CppModelManager::createSourceProcessor()); sourceProcessor->setHeaderPaths({ProjectExplorer::HeaderPath::makeUser( TestIncludePaths::globalIncludePath())}); sourceProcessor->run(filePath); - Document::Ptr document = cmm->document(filePath); + Document::Ptr document = CppModelManager::document(filePath); return document->resolvedIncludes(); } diff --git a/src/plugins/cppeditor/modelmanagertesthelper.cpp b/src/plugins/cppeditor/modelmanagertesthelper.cpp index a133ac7fef2..bfc3998e8ee 100644 --- a/src/plugins/cppeditor/modelmanagertesthelper.cpp +++ b/src/plugins/cppeditor/modelmanagertesthelper.cpp @@ -81,7 +81,7 @@ QSet<FilePath> ModelManagerTestHelper::updateProjectInfo( const ProjectInfo::ConstPtr &projectInfo) { resetRefreshedSourceFiles(); - CppModelManager::instance()->updateProjectInfo(projectInfo).waitForFinished(); + CppModelManager::updateProjectInfo(projectInfo).waitForFinished(); QCoreApplication::processEvents(); return waitForRefreshedSourceFiles(); } diff --git a/src/plugins/cppeditor/symbolfinder.cpp b/src/plugins/cppeditor/symbolfinder.cpp index 5da95a13621..dfc36a0e8aa 100644 --- a/src/plugins/cppeditor/symbolfinder.cpp +++ b/src/plugins/cppeditor/symbolfinder.cpp @@ -476,7 +476,7 @@ void SymbolFinder::checkCacheConsistency(const FilePath &referenceFile, const Sn const QString projectPartIdForFile(const FilePath &filePath) { - const QList<ProjectPart::ConstPtr> parts = CppModelManager::instance()->projectPart(filePath); + const QList<ProjectPart::ConstPtr> parts = CppModelManager::projectPart(filePath); if (!parts.isEmpty()) return parts.first()->id(); return QString(); diff --git a/src/plugins/cppeditor/symbolsfindfilter.cpp b/src/plugins/cppeditor/symbolsfindfilter.cpp index eb6a4c81dab..bf1158c414f 100644 --- a/src/plugins/cppeditor/symbolsfindfilter.cpp +++ b/src/plugins/cppeditor/symbolsfindfilter.cpp @@ -35,9 +35,8 @@ const char SETTINGS_GROUP[] = "CppSymbols"; const char SETTINGS_SYMBOLTYPES[] = "SymbolsToSearchFor"; const char SETTINGS_SEARCHSCOPE[] = "SearchScope"; -SymbolsFindFilter::SymbolsFindFilter(CppModelManager *manager) - : m_manager(manager), - m_enabled(true), +SymbolsFindFilter::SymbolsFindFilter() + : m_enabled(true), m_symbolsToSearch(SearchSymbols::AllTypes), m_scope(SymbolSearcher::SearchProjectsOnly) { @@ -121,7 +120,7 @@ void SymbolsFindFilter::startSearch(SearchResult *search) SymbolSearcher *symbolSearcher = new SymbolSearcher(parameters, projectFileNames); connect(watcher, &QFutureWatcherBase::finished, symbolSearcher, &QObject::deleteLater); - watcher->setFuture(Utils::asyncRun(m_manager->sharedThreadPool(), + watcher->setFuture(Utils::asyncRun(CppModelManager::sharedThreadPool(), &SymbolSearcher::runSearch, symbolSearcher)); FutureProgress *progress = ProgressManager::addTask(watcher->future(), Tr::tr("Searching for Symbol"), Core::Constants::TASK_SEARCH); diff --git a/src/plugins/cppeditor/symbolsfindfilter.h b/src/plugins/cppeditor/symbolsfindfilter.h index db7d4d323ab..a308bd93074 100644 --- a/src/plugins/cppeditor/symbolsfindfilter.h +++ b/src/plugins/cppeditor/symbolsfindfilter.h @@ -18,8 +18,6 @@ namespace Core { class SearchResult; } namespace Utils { class SearchResultItem; } namespace CppEditor { -class CppModelManager; - namespace Internal { class SymbolsFindFilter : public Core::IFindFilter @@ -30,7 +28,7 @@ public: using SearchScope = SymbolSearcher::SearchScope; public: - explicit SymbolsFindFilter(CppModelManager *manager); + SymbolsFindFilter(); QString id() const override; QString displayName() const override; @@ -65,7 +63,6 @@ private: QString toolTip(Utils::FindFlags findFlags) const; void startSearch(Core::SearchResult *search); - CppModelManager *m_manager; bool m_enabled; QMap<QFutureWatcher<Utils::SearchResultItem> *, QPointer<Core::SearchResult> > m_watchers; QPointer<Core::SearchResult> m_currentSearch; diff --git a/src/plugins/debugger/analyzer/analyzerutils.cpp b/src/plugins/debugger/analyzer/analyzerutils.cpp index dc87b2ad614..a2ea231755b 100644 --- a/src/plugins/debugger/analyzer/analyzerutils.cpp +++ b/src/plugins/debugger/analyzer/analyzerutils.cpp @@ -44,7 +44,7 @@ CPlusPlus::Symbol *AnalyzerUtils::findSymbolUnderCursor() const int pos = tc.position(); widget->convertPosition(pos, &line, &column); - const CPlusPlus::Snapshot &snapshot = CppEditor::CppModelManager::instance()->snapshot(); + const CPlusPlus::Snapshot &snapshot = CppEditor::CppModelManager::snapshot(); CPlusPlus::Document::Ptr doc = snapshot.document(widget->textDocument()->filePath()); QTC_ASSERT(doc, return nullptr); diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index b049d76f973..ccda790fe69 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -189,7 +189,7 @@ CdbEngine::CdbEngine() : this, &CdbEngine::updateLocals); if (s->useCodeModel.value()) - m_codeModelSnapshot = CppEditor::CppModelManager::instance()->snapshot(); + m_codeModelSnapshot = CppEditor::CppModelManager::snapshot(); } void CdbEngine::init() @@ -2500,7 +2500,7 @@ void CdbEngine::insertBreakpoint(const Breakpoint &bp) BreakpointParameters response = parameters; const QString responseId = breakPointCdbId(bp); QScopedPointer<BreakpointCorrectionContext> lineCorrection( - new BreakpointCorrectionContext(m_codeModelSnapshot, CppEditor::CppModelManager::instance()->workingCopy())); + new BreakpointCorrectionContext(m_codeModelSnapshot, CppEditor::CppModelManager::workingCopy())); if (!m_autoBreakPointCorrection && parameters.type == BreakpointByFileAndLine && debuggerSettings()->cdbBreakPointCorrection.value()) { diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp index 8811934aee4..cc1c0b855c1 100644 --- a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp +++ b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp @@ -154,7 +154,7 @@ bool DebuggerRunConfigurationAspect::useCppDebugger() const static bool projectHasQmlDefines(ProjectExplorer::Project *project) { - auto projectInfo = CppEditor::CppModelManager::instance()->projectInfo(project); + auto projectInfo = CppEditor::CppModelManager::projectInfo(project); if (!projectInfo) // we may have e.g. a Python project return false; return Utils::anyOf(projectInfo->projectParts(), diff --git a/src/plugins/debugger/sourceutils.cpp b/src/plugins/debugger/sourceutils.cpp index 82f1929bb89..26bb70b43fd 100644 --- a/src/plugins/debugger/sourceutils.cpp +++ b/src/plugins/debugger/sourceutils.cpp @@ -223,7 +223,7 @@ QStringList getUninitializedVariables(const Snapshot &snapshot, QString cppFunctionAt(const FilePath &filePath, int line, int column) { - const Snapshot snapshot = CppModelManager::instance()->snapshot(); + const Snapshot snapshot = CppModelManager::snapshot(); if (const Document::Ptr document = snapshot.document(filePath)) return document->functionAt(line, column); @@ -240,7 +240,7 @@ QString cppExpressionAt(TextEditorWidget *editorWidget, int pos, function->clear(); const FilePath filePath = editorWidget->textDocument()->filePath(); - const Snapshot snapshot = CppModelManager::instance()->snapshot(); + const Snapshot snapshot = CppModelManager::snapshot(); const Document::Ptr document = snapshot.document(filePath); QTextCursor tc = editorWidget->textCursor(); QString expr; @@ -376,7 +376,7 @@ static void setValueAnnotationsHelper(BaseTextEditor *textEditor, TextEditorWidget *widget = textEditor->editorWidget(); TextDocument *textDocument = widget->textDocument(); const FilePath filePath = loc.fileName(); - const Snapshot snapshot = CppModelManager::instance()->snapshot(); + const Snapshot snapshot = CppModelManager::snapshot(); const Document::Ptr cppDocument = snapshot.document(filePath); if (!cppDocument) // For non-C++ documents. return; diff --git a/src/plugins/designer/codemodelhelpers.cpp b/src/plugins/designer/codemodelhelpers.cpp index 8428fd98171..f58c3f65fb7 100644 --- a/src/plugins/designer/codemodelhelpers.cpp +++ b/src/plugins/designer/codemodelhelpers.cpp @@ -105,7 +105,7 @@ bool navigateToSlot(const QString &uiFileName, *errorMessage = Tr::tr("The generated header of the form \"%1\" could not be found.\nRebuilding the project might help.").arg(uiFileName); return false; } - const CPlusPlus::Snapshot snapshot = CppEditor::CppModelManager::instance()->snapshot(); + const CPlusPlus::Snapshot snapshot = CppEditor::CppModelManager::snapshot(); const DocumentPtr generatedHeaderDoc = snapshot.document(generatedHeaderFile); if (!generatedHeaderDoc) { *errorMessage = Tr::tr("The generated header \"%1\" could not be found in the code model.\nRebuilding the project might help.").arg(generatedHeaderFile.toUserOutput()); diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index 58bb62258a3..fb4c1afd5d6 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -499,7 +499,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName, const QString uicedName = "ui_" + fi.completeBaseName() + ".h"; // Retrieve code model snapshot restricted to project of ui file or the working copy. - Snapshot docTable = CppEditor::CppModelManager::instance()->snapshot(); + Snapshot docTable = CppEditor::CppModelManager::snapshot(); Snapshot newDocTable; const Project *uiProject = ProjectManager::projectForFile(currentUiFile); if (uiProject) { @@ -511,7 +511,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName, } else { const FilePath configFileName = CppEditor::CppModelManager::configurationFileName(); const CppEditor::WorkingCopy::Table elements = - CppEditor::CppModelManager::instance()->workingCopy().elements(); + CppEditor::CppModelManager::workingCopy().elements(); for (auto it = elements.cbegin(), end = elements.cend(); it != end; ++it) { const Utils::FilePath &fileName = it.key(); if (fileName != configFileName) @@ -578,7 +578,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName, FilePath declFilePath; if (!fun) { // add function declaration to cl - CppEditor::WorkingCopy workingCopy = CppEditor::CppModelManager::instance()->workingCopy(); + CppEditor::WorkingCopy workingCopy = CppEditor::CppModelManager::workingCopy(); declFilePath = declDoc->filePath(); getParsedDocument(declFilePath, workingCopy, docTable); addDeclaration(docTable, declFilePath, cl, functionNameWithParameterNames); @@ -587,8 +587,8 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName, QList<Utils::FilePath> filePaths; for (auto it = docTable.begin(); it != docTable.end(); ++it) filePaths << it.key(); - workingCopy = CppEditor::CppModelManager::instance()->workingCopy(); - docTable = CppEditor::CppModelManager::instance()->snapshot(); + workingCopy = CppEditor::CppModelManager::workingCopy(); + docTable = CppEditor::CppModelManager::snapshot(); newDocTable = {}; for (const auto &file : std::as_const(filePaths)) { const Document::Ptr doc = docTable.document(file); @@ -742,7 +742,7 @@ void QtCreatorIntegration::handleSymbolRenameStage2( if (usesClangd) editorWidget->textDocument()->setFilePath(uiHeader); editorWidget->textDocument()->setPlainText(QString::fromUtf8(virtualContent)); - Snapshot snapshot = CppEditor::CppModelManager::instance()->snapshot(); + Snapshot snapshot = CppEditor::CppModelManager::snapshot(); snapshot.remove(uiHeader); snapshot.remove(editor->textDocument()->filePath()); const Document::Ptr cppDoc = snapshot.preprocessedDocument(virtualContent, uiHeader); @@ -783,8 +783,8 @@ void QtCreatorIntegration::handleSymbolRenameStage2( qCDebug(log) << "renaming with built-in code model"; snapshot.insert(cppDoc); snapshot.updateDependencyTable(); - CppEditor::CppModelManager::instance()->renameUsages(cppDoc, cursor, snapshot, - newName, callback); + CppEditor::CppModelManager::renameUsages(cppDoc, cursor, snapshot, + newName, callback); } return; } diff --git a/src/plugins/modeleditor/classviewcontroller.cpp b/src/plugins/modeleditor/classviewcontroller.cpp index 68f5a66ae2a..16dcdb92d45 100644 --- a/src/plugins/modeleditor/classviewcontroller.cpp +++ b/src/plugins/modeleditor/classviewcontroller.cpp @@ -21,8 +21,7 @@ QSet<QString> ClassViewController::findClassDeclarations(const FilePath &filePat { QSet<QString> classNames; - CppEditor::CppModelManager *cppModelManager = CppEditor::CppModelManager::instance(); - CPlusPlus::Snapshot snapshot = cppModelManager->snapshot(); + CPlusPlus::Snapshot snapshot = CppEditor::CppModelManager::snapshot(); // scan original file CPlusPlus::Document::Ptr document = snapshot.document(filePath); diff --git a/src/plugins/modeleditor/componentviewcontroller.cpp b/src/plugins/modeleditor/componentviewcontroller.cpp index 4071c5b0159..684d104fd9f 100644 --- a/src/plugins/modeleditor/componentviewcontroller.cpp +++ b/src/plugins/modeleditor/componentviewcontroller.cpp @@ -146,8 +146,7 @@ void UpdateIncludeDependenciesVisitor::updateFilePaths() void UpdateIncludeDependenciesVisitor::visitMComponent(qmt::MComponent *component) { - CppEditor::CppModelManager *cppModelManager = CppEditor::CppModelManager::instance(); - CPlusPlus::Snapshot snapshot = cppModelManager->snapshot(); + CPlusPlus::Snapshot snapshot = CppEditor::CppModelManager::snapshot(); const QStringList filePaths = findFilePathOfComponent(component); for (const QString &filePath : filePaths) { diff --git a/src/plugins/modeleditor/elementtasks.cpp b/src/plugins/modeleditor/elementtasks.cpp index 6413686f61d..3cc271214fe 100644 --- a/src/plugins/modeleditor/elementtasks.cpp +++ b/src/plugins/modeleditor/elementtasks.cpp @@ -87,7 +87,7 @@ bool ElementTasks::hasClassDefinition(const qmt::MElement *element) const if (auto klass = dynamic_cast<const qmt::MClass *>(element)) { const QString qualifiedClassName = klass->umlNamespace().isEmpty() ? klass->name() : klass->umlNamespace() + "::" + klass->name(); - auto *locatorData = CppModelManager::instance()->locatorData(); + auto *locatorData = CppModelManager::locatorData(); if (!locatorData) return false; const QList<IndexItem::Ptr> matches = locatorData->findSymbols(IndexItem::Class, @@ -118,7 +118,7 @@ void ElementTasks::openClassDefinition(const qmt::MElement *element) const QString qualifiedClassName = klass->umlNamespace().isEmpty() ? klass->name() : klass->umlNamespace() + "::" + klass->name(); - auto *locatorData = CppModelManager::instance()->locatorData(); + auto *locatorData = CppModelManager::locatorData(); if (!locatorData) return; const QList<IndexItem::Ptr> matches = locatorData->findSymbols(IndexItem::Class, diff --git a/src/plugins/modeleditor/pxnodeutilities.cpp b/src/plugins/modeleditor/pxnodeutilities.cpp index f9e8e3b034c..c9e58d5052e 100644 --- a/src/plugins/modeleditor/pxnodeutilities.cpp +++ b/src/plugins/modeleditor/pxnodeutilities.cpp @@ -216,8 +216,7 @@ qmt::MObject *PxNodeUtilities::findSameObject(const QStringList &relativeElement bool PxNodeUtilities::isProxyHeader(const QString &file) const { - CppEditor::CppModelManager *cppModelManager = CppEditor::CppModelManager::instance(); - CPlusPlus::Snapshot snapshot = cppModelManager->snapshot(); + CPlusPlus::Snapshot snapshot = CppEditor::CppModelManager::snapshot(); CPlusPlus::Document::Ptr document = snapshot.document(Utils::FilePath::fromString(file)); if (document) { From 323f29a3bdcb741047ed66241bd50ef147a9405d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 12 Jul 2023 12:51:06 +0200 Subject: [PATCH 0267/1777] AutoTest: Merge settings and tools hierarchies [2/2] Renaming files to match class names. Change-Id: I3d75a79a5ad8e9d1c132530cbcc6973efc6dbadf Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/autotest/CMakeLists.txt | 10 +++++----- src/plugins/autotest/autotestplugin.cpp | 10 +++++----- src/plugins/autotest/autotestunittests.cpp | 6 +++--- src/plugins/autotest/boost/boosttestconfiguration.cpp | 3 +-- .../{boosttestsettings.cpp => boosttestframework.cpp} | 2 +- .../{boosttestsettings.h => boosttestframework.h} | 0 src/plugins/autotest/boost/boosttestoutputreader.cpp | 2 +- src/plugins/autotest/catch/catchconfiguration.cpp | 3 +-- .../{catchtestsettings.cpp => catchtestframework.cpp} | 2 +- .../{catchtestsettings.h => catchtestframework.h} | 0 src/plugins/autotest/catch/catchtestparser.cpp | 3 ++- .../ctest/{ctestsettings.cpp => ctesttool.cpp} | 2 +- .../autotest/ctest/{ctestsettings.h => ctesttool.h} | 0 src/plugins/autotest/ctest/ctesttreeitem.cpp | 3 +-- src/plugins/autotest/gtest/gtestconfiguration.cpp | 3 +-- .../gtest/{gtestsettings.cpp => gtestframework.cpp} | 2 +- .../gtest/{gtestsettings.h => gtestframework.h} | 0 src/plugins/autotest/gtest/gtesttreeitem.cpp | 2 +- src/plugins/autotest/qtest/qttestconfiguration.cpp | 3 +-- .../qtest/{qttestsettings.cpp => qttestframework.cpp} | 2 +- .../qtest/{qttestsettings.h => qttestframework.h} | 0 src/plugins/autotest/quick/quicktestconfiguration.cpp | 3 +-- src/plugins/autotest/quick/quicktestframework.h | 2 +- src/plugins/autotest/quick/quicktestparser.cpp | 2 +- 24 files changed, 30 insertions(+), 35 deletions(-) rename src/plugins/autotest/boost/{boosttestsettings.cpp => boosttestframework.cpp} (99%) rename src/plugins/autotest/boost/{boosttestsettings.h => boosttestframework.h} (100%) rename src/plugins/autotest/catch/{catchtestsettings.cpp => catchtestframework.cpp} (99%) rename src/plugins/autotest/catch/{catchtestsettings.h => catchtestframework.h} (100%) rename src/plugins/autotest/ctest/{ctestsettings.cpp => ctesttool.cpp} (99%) rename src/plugins/autotest/ctest/{ctestsettings.h => ctesttool.h} (100%) rename src/plugins/autotest/gtest/{gtestsettings.cpp => gtestframework.cpp} (99%) rename src/plugins/autotest/gtest/{gtestsettings.h => gtestframework.h} (100%) rename src/plugins/autotest/qtest/{qttestsettings.cpp => qttestframework.cpp} (99%) rename src/plugins/autotest/qtest/{qttestsettings.h => qttestframework.h} (100%) diff --git a/src/plugins/autotest/CMakeLists.txt b/src/plugins/autotest/CMakeLists.txt index 8ded823a8cf..c7121131361 100644 --- a/src/plugins/autotest/CMakeLists.txt +++ b/src/plugins/autotest/CMakeLists.txt @@ -13,27 +13,27 @@ add_qtc_plugin(AutoTest boost/boostcodeparser.cpp boost/boostcodeparser.h boost/boosttestconfiguration.cpp boost/boosttestconfiguration.h boost/boosttestconstants.h + boost/boosttestframework.cpp boost/boosttestframework.h boost/boosttestoutputreader.cpp boost/boosttestoutputreader.h boost/boosttestparser.cpp boost/boosttestparser.h boost/boosttestresult.cpp boost/boosttestresult.h - boost/boosttestsettings.cpp boost/boosttestsettings.h boost/boosttesttreeitem.cpp boost/boosttesttreeitem.h catch/catchcodeparser.cpp catch/catchcodeparser.h catch/catchconfiguration.cpp catch/catchconfiguration.h catch/catchoutputreader.cpp catch/catchresult.h catch/catchresult.cpp catch/catchtestparser.h + catch/catchtestframework.cpp catch/catchtestframework.h catch/catchtestparser.cpp catch/catchtreeitem.h catch/catchtreeitem.cpp - catch/catchtestsettings.cpp catch/catchtestsettings.h ctest/ctestconfiguration.cpp ctest/ctestconfiguration.h ctest/ctestoutputreader.cpp ctest/ctestoutputreader.h - ctest/ctestsettings.cpp ctest/ctestsettings.h + ctest/ctesttool.cpp ctest/ctesttool.h ctest/ctesttreeitem.cpp ctest/ctesttreeitem.h gtest/gtest_utils.cpp gtest/gtest_utils.h gtest/gtestconfiguration.cpp gtest/gtestconfiguration.h gtest/gtestconstants.h + gtest/gtestframework.cpp gtest/gtestframework.h gtest/gtestoutputreader.cpp gtest/gtestoutputreader.h gtest/gtestparser.cpp gtest/gtestparser.h gtest/gtestresult.cpp gtest/gtestresult.h - gtest/gtestsettings.cpp gtest/gtestsettings.h gtest/gtesttreeitem.cpp gtest/gtesttreeitem.h gtest/gtestvisitors.cpp gtest/gtestvisitors.h itemdatacache.h @@ -43,10 +43,10 @@ add_qtc_plugin(AutoTest qtest/qttest_utils.cpp qtest/qttest_utils.h qtest/qttestconfiguration.cpp qtest/qttestconfiguration.h qtest/qttestconstants.h + qtest/qttestframework.cpp qtest/qttestframework.h qtest/qttestoutputreader.cpp qtest/qttestoutputreader.h qtest/qttestparser.cpp qtest/qttestparser.h qtest/qttestresult.cpp qtest/qttestresult.h - qtest/qttestsettings.cpp qtest/qttestsettings.h qtest/qttesttreeitem.cpp qtest/qttesttreeitem.h qtest/qttestvisitors.cpp qtest/qttestvisitors.h quick/quicktest_utils.cpp quick/quicktest_utils.h diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index 6e12778ded2..5df8c3ff0a1 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -18,11 +18,11 @@ #include "testtreeitem.h" #include "testtreemodel.h" -#include "boost/boosttestsettings.h" -#include "catch/catchtestsettings.h" -#include "ctest/ctestsettings.h" -#include "gtest/gtestsettings.h" -#include "qtest/qttestsettings.h" +#include "boost/boosttestframework.h" +#include "catch/catchtestframework.h" +#include "ctest/ctesttool.h" +#include "gtest/gtestframework.h" +#include "qtest/qttestframework.h" #include "quick/quicktestframework.h" #include <coreplugin/actionmanager/actioncontainer.h> diff --git a/src/plugins/autotest/autotestunittests.cpp b/src/plugins/autotest/autotestunittests.cpp index 9834a6ea681..94be4be5d3b 100644 --- a/src/plugins/autotest/autotestunittests.cpp +++ b/src/plugins/autotest/autotestunittests.cpp @@ -7,7 +7,7 @@ #include "testframeworkmanager.h" #include "testtreemodel.h" -#include "qtest/qttestsettings.h" +#include "qtest/qttestframework.h" #include <cppeditor/cppmodelmanager.h> #include <cppeditor/cpptoolstestcase.h> @@ -20,6 +20,8 @@ #include <projectexplorer/projectexplorer.h> #include <projectexplorer/toolchain.h> +#include <qtsupport/qtkitinformation.h> + #include <utils/environment.h> #include <QFileInfo> @@ -27,8 +29,6 @@ #include <QSignalSpy> #include <QTest> -#include <qtsupport/qtkitinformation.h> - using namespace Core; using namespace ExtensionSystem; using namespace ProjectExplorer; diff --git a/src/plugins/autotest/boost/boosttestconfiguration.cpp b/src/plugins/autotest/boost/boosttestconfiguration.cpp index 58cbfb5f313..6222c974653 100644 --- a/src/plugins/autotest/boost/boosttestconfiguration.cpp +++ b/src/plugins/autotest/boost/boosttestconfiguration.cpp @@ -3,10 +3,9 @@ #include "boosttestconfiguration.h" +#include "boosttestframework.h" #include "boosttestoutputreader.h" -#include "boosttestsettings.h" -#include "../itestframework.h" #include "../testsettings.h" #include <utils/algorithm.h> diff --git a/src/plugins/autotest/boost/boosttestsettings.cpp b/src/plugins/autotest/boost/boosttestframework.cpp similarity index 99% rename from src/plugins/autotest/boost/boosttestsettings.cpp rename to src/plugins/autotest/boost/boosttestframework.cpp index 54c8fa5e498..216fa20f3a7 100644 --- a/src/plugins/autotest/boost/boosttestsettings.cpp +++ b/src/plugins/autotest/boost/boosttestframework.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "boosttestsettings.h" +#include "boosttestframework.h" #include "boosttestconstants.h" #include "boosttesttreeitem.h" diff --git a/src/plugins/autotest/boost/boosttestsettings.h b/src/plugins/autotest/boost/boosttestframework.h similarity index 100% rename from src/plugins/autotest/boost/boosttestsettings.h rename to src/plugins/autotest/boost/boosttestframework.h diff --git a/src/plugins/autotest/boost/boosttestoutputreader.cpp b/src/plugins/autotest/boost/boosttestoutputreader.cpp index b903f6c10b1..1dab105e243 100644 --- a/src/plugins/autotest/boost/boosttestoutputreader.cpp +++ b/src/plugins/autotest/boost/boosttestoutputreader.cpp @@ -3,7 +3,7 @@ #include "boosttestoutputreader.h" -#include "boosttestsettings.h" +#include "boosttestframework.h" #include "boosttestresult.h" #include "../autotesttr.h" diff --git a/src/plugins/autotest/catch/catchconfiguration.cpp b/src/plugins/autotest/catch/catchconfiguration.cpp index 0d073892cb2..37cb378e071 100644 --- a/src/plugins/autotest/catch/catchconfiguration.cpp +++ b/src/plugins/autotest/catch/catchconfiguration.cpp @@ -3,10 +3,9 @@ #include "catchconfiguration.h" +#include "catchtestframework.h" #include "catchoutputreader.h" -#include "catchtestsettings.h" -#include "../itestframework.h" #include "../testsettings.h" using namespace Utils; diff --git a/src/plugins/autotest/catch/catchtestsettings.cpp b/src/plugins/autotest/catch/catchtestframework.cpp similarity index 99% rename from src/plugins/autotest/catch/catchtestsettings.cpp rename to src/plugins/autotest/catch/catchtestframework.cpp index bdca7ae3b33..d93fe060d39 100644 --- a/src/plugins/autotest/catch/catchtestsettings.cpp +++ b/src/plugins/autotest/catch/catchtestframework.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "catchtestsettings.h" +#include "catchtestframework.h" #include "catchtestparser.h" #include "catchtreeitem.h" diff --git a/src/plugins/autotest/catch/catchtestsettings.h b/src/plugins/autotest/catch/catchtestframework.h similarity index 100% rename from src/plugins/autotest/catch/catchtestsettings.h rename to src/plugins/autotest/catch/catchtestframework.h diff --git a/src/plugins/autotest/catch/catchtestparser.cpp b/src/plugins/autotest/catch/catchtestparser.cpp index fac35df11d3..96f536a9055 100644 --- a/src/plugins/autotest/catch/catchtestparser.cpp +++ b/src/plugins/autotest/catch/catchtestparser.cpp @@ -4,11 +4,12 @@ #include "catchtestparser.h" #include "catchcodeparser.h" -#include "catchtestsettings.h" +#include "catchtestframework.h" #include "catchtreeitem.h" #include <cppeditor/cppmodelmanager.h> #include <cppeditor/projectpart.h> + #include <utils/qtcassert.h> #include <QPromise> diff --git a/src/plugins/autotest/ctest/ctestsettings.cpp b/src/plugins/autotest/ctest/ctesttool.cpp similarity index 99% rename from src/plugins/autotest/ctest/ctestsettings.cpp rename to src/plugins/autotest/ctest/ctesttool.cpp index aedf929eb84..766e9cc1ffd 100644 --- a/src/plugins/autotest/ctest/ctestsettings.cpp +++ b/src/plugins/autotest/ctest/ctesttool.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "ctestsettings.h" +#include "ctesttool.h" #include "ctesttreeitem.h" #include "../autotestconstants.h" diff --git a/src/plugins/autotest/ctest/ctestsettings.h b/src/plugins/autotest/ctest/ctesttool.h similarity index 100% rename from src/plugins/autotest/ctest/ctestsettings.h rename to src/plugins/autotest/ctest/ctesttool.h diff --git a/src/plugins/autotest/ctest/ctesttreeitem.cpp b/src/plugins/autotest/ctest/ctesttreeitem.cpp index 8156d414eec..c3b88ca5f08 100644 --- a/src/plugins/autotest/ctest/ctesttreeitem.cpp +++ b/src/plugins/autotest/ctest/ctesttreeitem.cpp @@ -4,10 +4,9 @@ #include "ctesttreeitem.h" #include "ctestconfiguration.h" -#include "ctestsettings.h" +#include "ctesttool.h" #include "../autotestplugin.h" -#include "../itestframework.h" #include "../testsettings.h" #include <projectexplorer/buildconfiguration.h> diff --git a/src/plugins/autotest/gtest/gtestconfiguration.cpp b/src/plugins/autotest/gtest/gtestconfiguration.cpp index 3ce012c7b86..0b7160d2a55 100644 --- a/src/plugins/autotest/gtest/gtestconfiguration.cpp +++ b/src/plugins/autotest/gtest/gtestconfiguration.cpp @@ -3,10 +3,9 @@ #include "gtestconfiguration.h" +#include "gtestframework.h" #include "gtestoutputreader.h" -#include "gtestsettings.h" -#include "../itestframework.h" #include "../testsettings.h" #include <utils/algorithm.h> diff --git a/src/plugins/autotest/gtest/gtestsettings.cpp b/src/plugins/autotest/gtest/gtestframework.cpp similarity index 99% rename from src/plugins/autotest/gtest/gtestsettings.cpp rename to src/plugins/autotest/gtest/gtestframework.cpp index 1d79a5b40df..79844fa5df1 100644 --- a/src/plugins/autotest/gtest/gtestsettings.cpp +++ b/src/plugins/autotest/gtest/gtestframework.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "gtestsettings.h" +#include "gtestframework.h" #include "gtest_utils.h" #include "gtesttreeitem.h" diff --git a/src/plugins/autotest/gtest/gtestsettings.h b/src/plugins/autotest/gtest/gtestframework.h similarity index 100% rename from src/plugins/autotest/gtest/gtestsettings.h rename to src/plugins/autotest/gtest/gtestframework.h diff --git a/src/plugins/autotest/gtest/gtesttreeitem.cpp b/src/plugins/autotest/gtest/gtesttreeitem.cpp index fdcf150f9c0..8ece0e618ab 100644 --- a/src/plugins/autotest/gtest/gtesttreeitem.cpp +++ b/src/plugins/autotest/gtest/gtesttreeitem.cpp @@ -5,7 +5,7 @@ #include "gtestconfiguration.h" #include "gtestconstants.h" -#include "gtestsettings.h" +#include "gtestframework.h" #include "gtestparser.h" #include "../autotesttr.h" diff --git a/src/plugins/autotest/qtest/qttestconfiguration.cpp b/src/plugins/autotest/qtest/qttestconfiguration.cpp index 02972c33fac..8b433eebfdf 100644 --- a/src/plugins/autotest/qtest/qttestconfiguration.cpp +++ b/src/plugins/autotest/qtest/qttestconfiguration.cpp @@ -3,11 +3,10 @@ #include "qttestconfiguration.h" +#include "qttestframework.h" #include "qttestoutputreader.h" -#include "qttestsettings.h" #include "qttest_utils.h" -#include "../itestframework.h" #include "../testsettings.h" #include <utils/algorithm.h> diff --git a/src/plugins/autotest/qtest/qttestsettings.cpp b/src/plugins/autotest/qtest/qttestframework.cpp similarity index 99% rename from src/plugins/autotest/qtest/qttestsettings.cpp rename to src/plugins/autotest/qtest/qttestframework.cpp index 78239e7f76e..474be75d68c 100644 --- a/src/plugins/autotest/qtest/qttestsettings.cpp +++ b/src/plugins/autotest/qtest/qttestframework.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "qttestsettings.h" +#include "qttestframework.h" #include "../autotestconstants.h" #include "../autotesttr.h" diff --git a/src/plugins/autotest/qtest/qttestsettings.h b/src/plugins/autotest/qtest/qttestframework.h similarity index 100% rename from src/plugins/autotest/qtest/qttestsettings.h rename to src/plugins/autotest/qtest/qttestframework.h diff --git a/src/plugins/autotest/quick/quicktestconfiguration.cpp b/src/plugins/autotest/quick/quicktestconfiguration.cpp index b23a2d7a17d..1f686ea6e7b 100644 --- a/src/plugins/autotest/quick/quicktestconfiguration.cpp +++ b/src/plugins/autotest/quick/quicktestconfiguration.cpp @@ -3,9 +3,8 @@ #include "quicktestconfiguration.h" -#include "../itestframework.h" #include "../qtest/qttestoutputreader.h" -#include "../qtest/qttestsettings.h" +#include "../qtest/qttestframework.h" #include "../qtest/qttest_utils.h" #include "../testsettings.h" diff --git a/src/plugins/autotest/quick/quicktestframework.h b/src/plugins/autotest/quick/quicktestframework.h index fe3622b0e66..9bc18e3dd6f 100644 --- a/src/plugins/autotest/quick/quicktestframework.h +++ b/src/plugins/autotest/quick/quicktestframework.h @@ -5,7 +5,7 @@ #include "../itestframework.h" -#include "../qtest/qttestsettings.h" +#include "../qtest/qttestframework.h" namespace Autotest { namespace QuickTest { diff --git a/src/plugins/autotest/quick/quicktestparser.cpp b/src/plugins/autotest/quick/quicktestparser.cpp index 6482f1613f3..5cfdab93fb8 100644 --- a/src/plugins/autotest/quick/quicktestparser.cpp +++ b/src/plugins/autotest/quick/quicktestparser.cpp @@ -8,7 +8,7 @@ #include "quicktest_utils.h" #include "../testcodeparser.h" #include "../testtreemodel.h" -#include "../qtest/qttestsettings.h" +#include "../qtest/qttestframework.h" #include <cppeditor/cppmodelmanager.h> #include <cppeditor/projectpart.h> From 8ba6f11e9ca21c7c3d2e7ad876a6934f9af3d51f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 19:27:39 +0200 Subject: [PATCH 0268/1777] Boot2Qt: Use aspects more directly in QdbRunConfiguration Change-Id: I8a199f449824ff973f5278f39172307be0e11438 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/boot2qt/qdbrunconfiguration.cpp | 161 +++++++++----------- 1 file changed, 71 insertions(+), 90 deletions(-) diff --git a/src/plugins/boot2qt/qdbrunconfiguration.cpp b/src/plugins/boot2qt/qdbrunconfiguration.cpp index cba9aef178c..ebb58402393 100644 --- a/src/plugins/boot2qt/qdbrunconfiguration.cpp +++ b/src/plugins/boot2qt/qdbrunconfiguration.cpp @@ -25,105 +25,86 @@ using namespace Utils; namespace Qdb::Internal { -// FullCommandLineAspect - -class FullCommandLineAspect : public StringAspect -{ -public: - explicit FullCommandLineAspect(RunConfiguration *rc) - { - setLabelText(Tr::tr("Full command line:")); - - auto exeAspect = rc->aspect<ExecutableAspect>(); - auto argumentsAspect = rc->aspect<ArgumentsAspect>(); - - auto updateCommandLine = [this, exeAspect, argumentsAspect] { - CommandLine plain{exeAspect->executable(), argumentsAspect->arguments(), CommandLine::Raw}; - CommandLine cmd; - cmd.setExecutable(plain.executable().withNewPath(Constants::AppcontrollerFilepath)); - cmd.addCommandLineAsArgs(plain); - setValue(cmd.toUserOutput()); - }; - - connect(argumentsAspect, &ArgumentsAspect::changed, this, updateCommandLine); - connect(exeAspect, &ExecutableAspect::changed, this, updateCommandLine); - updateCommandLine(); - } -}; - - // QdbRunConfiguration class QdbRunConfiguration : public RunConfiguration { public: - QdbRunConfiguration(Target *target, Utils::Id id); + QdbRunConfiguration(Target *target, Id id) + : RunConfiguration(target, id) + { + setDefaultDisplayName(Tr::tr("Run on Boot2Qt Device")); + + executable.setDeviceSelector(target, ExecutableAspect::RunDevice); + executable.setSettingsKey("QdbRunConfig.RemoteExecutable"); + executable.setLabelText(Tr::tr("Executable on device:")); + executable.setPlaceHolderText(Tr::tr("Remote path not set")); + executable.makeOverridable("QdbRunConfig.AlternateRemoteExecutable", + "QdbRunCofig.UseAlternateRemoteExecutable"); + + symbolFile.setSettingsKey("QdbRunConfig.LocalExecutable"); + symbolFile.setLabelText(Tr::tr("Executable on host:")); + symbolFile.setDisplayStyle(SymbolFileAspect::LabelDisplay); + + environment.setDeviceSelector(target, EnvironmentAspect::RunDevice); + + arguments.setMacroExpander(macroExpander()); + + workingDir.setMacroExpander(macroExpander()); + workingDir.setEnvironment(&environment); + + fullCommand.setLabelText(Tr::tr("Full command line:")); + + setUpdater([this, target] { + const BuildTargetInfo bti = buildTargetInfo(); + const FilePath localExecutable = bti.targetFilePath; + const DeployableFile depFile = target->deploymentData().deployableForLocalFile(localExecutable); + IDevice::ConstPtr dev = DeviceKitAspect::device(target->kit()); + QTC_ASSERT(dev, return); + executable.setExecutable(dev->filePath(depFile.remoteFilePath())); + symbolFile.setValue(localExecutable); + }); + + connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); + connect(target, &Target::deploymentDataChanged, this, &RunConfiguration::update); + connect(target, &Target::kitChanged, this, &RunConfiguration::update); + + auto updateFullCommand = [this] { + CommandLine plain{executable(), arguments(), CommandLine::Raw}; + CommandLine cmd; + cmd.setExecutable(plain.executable().withNewPath(Constants::AppcontrollerFilepath)); + cmd.addCommandLineAsArgs(plain); + fullCommand.setValue(cmd.toUserOutput()); + }; + + connect(&arguments, &BaseAspect::changed, this, updateFullCommand); + connect(&executable, &BaseAspect::changed, this, updateFullCommand); + updateFullCommand(); + } private: - Tasks checkForIssues() const override; - QString defaultDisplayName() const; -}; - -QdbRunConfiguration::QdbRunConfiguration(Target *target, Id id) - : RunConfiguration(target, id) -{ - auto exeAspect = addAspect<ExecutableAspect>(); - exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); - exeAspect->setSettingsKey("QdbRunConfig.RemoteExecutable"); - exeAspect->setLabelText(Tr::tr("Executable on device:")); - exeAspect->setPlaceHolderText(Tr::tr("Remote path not set")); - exeAspect->makeOverridable("QdbRunConfig.AlternateRemoteExecutable", - "QdbRunCofig.UseAlternateRemoteExecutable"); - - auto symbolsAspect = addAspect<SymbolFileAspect>(); - symbolsAspect->setSettingsKey("QdbRunConfig.LocalExecutable"); - symbolsAspect->setLabelText(Tr::tr("Executable on host:")); - symbolsAspect->setDisplayStyle(SymbolFileAspect::LabelDisplay); - - auto envAspect = addAspect<RemoteLinux::RemoteLinuxEnvironmentAspect>(); - envAspect->setDeviceSelector(target, EnvironmentAspect::RunDevice); - - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); - - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); - - workingDirAspect->setEnvironment(envAspect); - - addAspect<FullCommandLineAspect>(this); - - setUpdater([this, target, exeAspect, symbolsAspect] { - const BuildTargetInfo bti = buildTargetInfo(); - const FilePath localExecutable = bti.targetFilePath; - const DeployableFile depFile = target->deploymentData().deployableForLocalFile(localExecutable); - IDevice::ConstPtr dev = DeviceKitAspect::device(target->kit()); - QTC_ASSERT(dev, return); - exeAspect->setExecutable(dev->filePath(depFile.remoteFilePath())); - symbolsAspect->setValue(localExecutable); - }); - - connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); - connect(target, &Target::deploymentDataChanged, this, &RunConfiguration::update); - connect(target, &Target::kitChanged, this, &RunConfiguration::update); - - setDefaultDisplayName(Tr::tr("Run on Boot2Qt Device")); -} - -Tasks QdbRunConfiguration::checkForIssues() const -{ - Tasks tasks; - if (aspect<ExecutableAspect>()->executable().toString().isEmpty()) { - tasks << BuildSystemTask(Task::Warning, Tr::tr("The remote executable must be set " - "in order to run on a Boot2Qt device.")); + Tasks checkForIssues() const override + { + Tasks tasks; + if (executable().isEmpty()) { + tasks << BuildSystemTask(Task::Warning, Tr::tr("The remote executable must be set " + "in order to run on a Boot2Qt device.")); + } + return tasks; } - return tasks; -} -QString QdbRunConfiguration::defaultDisplayName() const -{ - return RunConfigurationFactory::decoratedTargetName(buildKey(), target()); -} + QString defaultDisplayName() const + { + return RunConfigurationFactory::decoratedTargetName(buildKey(), target()); + } + + ExecutableAspect executable{this}; + SymbolFileAspect symbolFile{this}; + RemoteLinux::RemoteLinuxEnvironmentAspect environment{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; + StringAspect fullCommand{this}; +}; // QdbRunConfigurationFactory From ae01e13d322ec0bcd4f734efcbfd87405d8e6b2d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 11 Jul 2023 19:35:16 +0200 Subject: [PATCH 0269/1777] AbstractProcessStep: Move process done handler from QMakeStep The done handler is going to be used for other processes, too. Change-Id: I3c60ec75656aa45bd57ec3ca8336cf310c78bd3e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- .../projectexplorer/abstractprocessstep.cpp | 43 +++++++++++++------ .../projectexplorer/abstractprocessstep.h | 2 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 33 ++------------ 3 files changed, 36 insertions(+), 42 deletions(-) diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 806d9159f95..96e6f2291d9 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -185,7 +185,14 @@ void AbstractProcessStep::doRun() d->m_process.reset(new Process); setupProcess(d->m_process.get()); - connect(d->m_process.get(), &Process::done, this, &AbstractProcessStep::handleProcessDone); + connect(d->m_process.get(), &Process::done, this, [this] { + if (d->m_process->error() == QProcess::FailedToStart) { + processStartupFailed(); + d->m_process.release()->deleteLater(); + return; + } + d->cleanUp(d->m_process->exitCode(), d->m_process->exitStatus()); + }); d->m_process->start(); } @@ -241,6 +248,29 @@ void AbstractProcessStep::setupProcess(Process *process) }); } +void AbstractProcessStep::handleProcessDone(const Process &process) +{ + const QString command = displayedParameters()->effectiveCommand().toUserOutput(); + if (process.result() == ProcessResult::FinishedWithSuccess) { + emit addOutput(Tr::tr("The process \"%1\" exited normally.").arg(command), + OutputFormat::NormalMessage); + } else if (process.result() == ProcessResult::FinishedWithError) { + emit addOutput(Tr::tr("The process \"%1\" exited with code %2.") + .arg(command, QString::number(process.exitCode())), + OutputFormat::ErrorMessage); + } else if (process.result() == ProcessResult::StartFailed) { + emit addOutput(Tr::tr("Could not start process \"%1\" %2.") + .arg(command, displayedParameters()->prettyArguments()), + OutputFormat::ErrorMessage); + const QString errorString = process.errorString(); + if (!errorString.isEmpty()) + emit addOutput(errorString, OutputFormat::ErrorMessage); + } else { + emit addOutput(Tr::tr("The process \"%1\" crashed.").arg(command), + OutputFormat::ErrorMessage); + } +} + void AbstractProcessStep::runTaskTree(const Group &recipe) { setupStreams(); @@ -375,15 +405,4 @@ void AbstractProcessStep::finish(ProcessResult result) emit finished(isSuccess(result)); } -void AbstractProcessStep::handleProcessDone() -{ - QTC_ASSERT(d->m_process.get(), return); - if (d->m_process->error() == QProcess::FailedToStart) { - processStartupFailed(); - d->m_process.release()->deleteLater(); - return; - } - d->cleanUp(d->m_process->exitCode(), d->m_process->exitStatus()); -} - } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index 0ac03036d8f..ec0d6a7e803 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -52,13 +52,13 @@ protected: bool checkWorkingDirectory(); void setupProcess(Utils::Process *process); + void handleProcessDone(const Utils::Process &process); void runTaskTree(const Tasking::Group &recipe); ProcessParameters *displayedParameters() const; private: void setupStreams(); void processStartupFailed(); - void handleProcessDone(); class Private; Private *d; diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index d0c07e02f73..292a6439dff 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -281,8 +281,6 @@ void QMakeStep::doRun() if (!checkWorkingDirectory()) return; - m_needToRunQMake = false; - using namespace Tasking; const auto setupQMake = [this](Process &process) { @@ -301,39 +299,16 @@ void QMakeStep::doRun() setupProcess(&process); }; - const auto onProcessDone = [this](const Process &) { - const QString command = displayedParameters()->effectiveCommand().toUserOutput(); - emit addOutput(Tr::tr("The process \"%1\" exited normally.").arg(command), - OutputFormat::NormalMessage); - }; - - const auto onProcessError = [this](const Process &process) { - const QString command = displayedParameters()->effectiveCommand().toUserOutput(); - if (process.result() == ProcessResult::FinishedWithError) { - emit addOutput(Tr::tr("The process \"%1\" exited with code %2.") - .arg(command, QString::number(process.exitCode())), - OutputFormat::ErrorMessage); - } else if (process.result() == ProcessResult::StartFailed) { - emit addOutput(Tr::tr("Could not start process \"%1\" %2.") - .arg(command, displayedParameters()->prettyArguments()), - OutputFormat::ErrorMessage); - const QString errorString = process.errorString(); - if (!errorString.isEmpty()) - emit addOutput(errorString, OutputFormat::ErrorMessage); - } else { - emit addOutput(Tr::tr("The process \"%1\" crashed.").arg(command), - OutputFormat::ErrorMessage); - } - m_needToRunQMake = true; - }; + const auto onProcessDone = [this](const Process &process) { handleProcessDone(process); }; const auto onDone = [this] { emit buildConfiguration()->buildDirectoryInitialized(); + m_needToRunQMake = false; }; - QList<GroupItem> processList = {ProcessTask(setupQMake, onProcessDone, onProcessError)}; + QList<GroupItem> processList = {ProcessTask(setupQMake, onProcessDone, onProcessDone)}; if (m_runMakeQmake) - processList << ProcessTask(setupMakeQMake, onProcessDone, onProcessError); + processList << ProcessTask(setupMakeQMake, onProcessDone, onProcessDone); processList << onGroupDone(onDone); runTaskTree(Group(processList)); From 38c3abb774f11fc28114ce6a7396af1246599e2d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 9 Jun 2023 15:16:33 +0200 Subject: [PATCH 0270/1777] Meson: Move MachineFileManager near build system Closely related Change-Id: Id561dccd909bb4dc53e1a55d6ee77d008e5c4078 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../mesonprojectmanager/CMakeLists.txt | 2 - src/plugins/mesonprojectmanager/kithelper.h | 74 --------- .../machinefilemanager.cpp | 114 ------------- .../mesonprojectmanager/machinefilemanager.h | 26 --- .../mesonprojectmanager/mesonbuildsystem.cpp | 151 +++++++++++++++++- .../mesonprojectmanager/mesonbuildsystem.h | 22 ++- .../mesonprojectmanager.qbs | 2 - .../mesonprojectplugin.cpp | 2 +- 8 files changed, 162 insertions(+), 231 deletions(-) delete mode 100644 src/plugins/mesonprojectmanager/machinefilemanager.cpp delete mode 100644 src/plugins/mesonprojectmanager/machinefilemanager.h diff --git a/src/plugins/mesonprojectmanager/CMakeLists.txt b/src/plugins/mesonprojectmanager/CMakeLists.txt index a9e46077418..d56f77c20e4 100644 --- a/src/plugins/mesonprojectmanager/CMakeLists.txt +++ b/src/plugins/mesonprojectmanager/CMakeLists.txt @@ -14,8 +14,6 @@ add_qtc_plugin(MesonProjectManager infoparser.h kitdata.h kithelper.h - machinefilemanager.cpp - machinefilemanager.h mesonactionsmanager.cpp mesonactionsmanager.h mesonbuildconfiguration.cpp diff --git a/src/plugins/mesonprojectmanager/kithelper.h b/src/plugins/mesonprojectmanager/kithelper.h index 965dad6563e..00db098251a 100644 --- a/src/plugins/mesonprojectmanager/kithelper.h +++ b/src/plugins/mesonprojectmanager/kithelper.h @@ -12,77 +12,3 @@ #include <utils/macroexpander.h> #include <utils/qtcassert.h> -namespace MesonProjectManager { -namespace Internal { - -namespace KitHelper { -namespace details { - -inline QString expand(const ProjectExplorer::Kit *kit, const QString ¯o) -{ - return kit->macroExpander()->expand(macro); -} - -} // namespace details - -inline QString cCompilerPath(const ProjectExplorer::Kit *kit) -{ - QTC_ASSERT(kit, return {}); - return details::expand(kit, "%{Compiler:Executable:C}"); -} - -inline QString cxxCompilerPath(const ProjectExplorer::Kit *kit) -{ - QTC_ASSERT(kit, return {}); - return details::expand(kit, "%{Compiler:Executable:Cxx}"); -} - -inline QString qmakePath(const ProjectExplorer::Kit *kit) -{ - return details::expand(kit, "%{Qt:qmakeExecutable}"); -} - -inline QString cmakePath(const ProjectExplorer::Kit *kit) -{ - return details::expand(kit, "%{CMake:Executable:FilePath}"); -} - -inline QString qtVersion(const ProjectExplorer::Kit *kit) -{ - QTC_ASSERT(kit, return {}); - return details::expand(kit, "%{Qt:Version}"); -} - -inline KitData kitData(const ProjectExplorer::Kit *kit) -{ - QTC_ASSERT(kit, return {}); - KitData data; - data.cCompilerPath = cCompilerPath(kit); - data.cxxCompilerPath = cxxCompilerPath(kit); - data.cmakePath = cmakePath(kit); - data.qmakePath = qmakePath(kit); - data.qtVersionStr = qtVersion(kit); - data.qtVersion = Utils::QtMajorVersion::None; - auto version = Version::fromString(data.qtVersionStr); - if (version.isValid) { - switch (version.major) { - case 4: - data.qtVersion = Utils::QtMajorVersion::Qt4; - break; - case 5: - data.qtVersion = Utils::QtMajorVersion::Qt5; - break; - case 6: - data.qtVersion = Utils::QtMajorVersion::Qt6; - break; - default: - data.qtVersion = Utils::QtMajorVersion::Unknown; - } - } - return data; -} - -} // namespace KitHelper - -} // namespace Internal -} // namespace MesonProjectManager diff --git a/src/plugins/mesonprojectmanager/machinefilemanager.cpp b/src/plugins/mesonprojectmanager/machinefilemanager.cpp deleted file mode 100644 index c340d7170e2..00000000000 --- a/src/plugins/mesonprojectmanager/machinefilemanager.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (C) 2020 Alexis Jeandet. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "machinefilemanager.h" - -#include "kitdata.h" -#include "kithelper.h" - -#include <coreplugin/icore.h> - -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/kitmanager.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/toolchain.h> - -#include <utils/macroexpander.h> -#include <utils/qtcassert.h> - -#include <optional> - -using namespace ProjectExplorer; -using namespace Utils; - -namespace MesonProjectManager::Internal { - -const char MACHINE_FILE_PREFIX[] = "Meson-MachineFile-"; -const char MACHINE_FILE_EXT[] = ".ini"; - -static FilePath machineFilesDir() -{ - return Core::ICore::userResourcePath("Meson-machine-files"); -} - -MachineFileManager::MachineFileManager() -{ - connect(KitManager::instance(), &KitManager::kitAdded, - this, &MachineFileManager::addMachineFile); - connect(KitManager::instance(), &KitManager::kitUpdated, - this, &MachineFileManager::updateMachineFile); - connect(KitManager::instance(), &KitManager::kitRemoved, - this, &MachineFileManager::removeMachineFile); - connect(KitManager::instance(), &KitManager::kitsLoaded, - this, &MachineFileManager::cleanupMachineFiles); -} - -FilePath MachineFileManager::machineFile(const Kit *kit) -{ - QTC_ASSERT(kit, return {}); - auto baseName - = QString("%1%2%3").arg(MACHINE_FILE_PREFIX).arg(kit->id().toString()).arg(MACHINE_FILE_EXT); - baseName = baseName.remove('{').remove('}'); - return machineFilesDir().pathAppended(baseName); -} - -void MachineFileManager::addMachineFile(const Kit *kit) -{ - FilePath filePath = machineFile(kit); - QTC_ASSERT(!filePath.isEmpty(), return ); - auto kitData = KitHelper::kitData(kit); - - auto entry = [](const QString &key, const QString &value) { - return QString("%1 = '%2'\n").arg(key).arg(value).toUtf8(); - }; - - QByteArray ba = "[binaries]\n"; - ba += entry("c", kitData.cCompilerPath); - ba += entry("cpp", kitData.cxxCompilerPath); - ba += entry("qmake", kitData.qmakePath); - if (kitData.qtVersion == QtMajorVersion::Qt4) - ba += entry("qmake-qt4", kitData.qmakePath); - else if (kitData.qtVersion == QtMajorVersion::Qt5) - ba += entry("qmake-qt5", kitData.qmakePath); - else if (kitData.qtVersion == QtMajorVersion::Qt6) - ba += entry("qmake-qt6", kitData.qmakePath); - ba += entry("cmake", kitData.cmakePath); - - filePath.writeFileContents(ba); -} - -void MachineFileManager::removeMachineFile(const Kit *kit) -{ - FilePath filePath = machineFile(kit); - if (filePath.exists()) - filePath.removeFile(); -} - -void MachineFileManager::updateMachineFile(const Kit *kit) -{ - addMachineFile(kit); -} - -void MachineFileManager::cleanupMachineFiles() -{ - FilePath dir = machineFilesDir(); - dir.ensureWritableDir(); - - const FileFilter filter = {{QString("%1*%2").arg(MACHINE_FILE_PREFIX).arg(MACHINE_FILE_EXT)}}; - const FilePaths machineFiles = dir.dirEntries(filter); - - FilePaths expected; - for (Kit const *kit : KitManager::kits()) { - const FilePath fname = machineFile(kit); - expected.push_back(fname); - if (!machineFiles.contains(fname)) - addMachineFile(kit); - } - - for (const FilePath &file : machineFiles) { - if (!expected.contains(file)) - file.removeFile(); - } -} - -} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/machinefilemanager.h b/src/plugins/mesonprojectmanager/machinefilemanager.h deleted file mode 100644 index 5a3a9a9bd71..00000000000 --- a/src/plugins/mesonprojectmanager/machinefilemanager.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2020 Alexis Jeandet. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <utils/filepath.h> - -namespace ProjectExplorer { class Kit; } - -namespace MesonProjectManager::Internal { - -class MachineFileManager final : public QObject -{ -public: - MachineFileManager(); - - static Utils::FilePath machineFile(const ProjectExplorer::Kit *kit); - -private: - void addMachineFile(const ProjectExplorer::Kit *kit); - void removeMachineFile(const ProjectExplorer::Kit *kit); - void updateMachineFile(const ProjectExplorer::Kit *kit); - void cleanupMachineFiles(); -}; - -} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp index d140a468e34..5f1a3b96c25 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp @@ -4,7 +4,8 @@ #include "mesonbuildsystem.h" #include "kithelper.h" -#include "machinefilemanager.h" +#include "kitdata.h" +#include "kithelper.h" #include "mesonbuildconfiguration.h" #include "mesonprojectmanagertr.h" #include "mesontoolkitaspect.h" @@ -16,6 +17,18 @@ #include <qtsupport/qtcppkitinfo.h> #include <qtsupport/qtkitinformation.h> +#include <coreplugin/icore.h> + +#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitmanager.h> +#include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/toolchain.h> + +#include <utils/macroexpander.h> +#include <utils/qtcassert.h> + +#include <optional> + #include <QDir> #include <QLoggingCategory> @@ -37,13 +50,136 @@ }; using namespace ProjectExplorer; +using namespace Utils; + +namespace MesonProjectManager::Internal { -namespace MesonProjectManager { -namespace Internal { static Q_LOGGING_CATEGORY(mesonBuildSystemLog, "qtc.meson.buildsystem", QtWarningMsg); +const char MACHINE_FILE_PREFIX[] = "Meson-MachineFile-"; +const char MACHINE_FILE_EXT[] = ".ini"; + +static KitData createKitData(const Kit *kit) +{ + QTC_ASSERT(kit, return {}); + + MacroExpander *expander = kit->macroExpander(); + + KitData data; + data.cCompilerPath = expander->expand(QString("%{Compiler:Executable:C}")); + data.cxxCompilerPath = expander->expand(QString("%{Compiler:Executable:Cxx}")); + data.cmakePath = expander->expand(QString("%{CMake:Executable:FilePath}")); + data.qmakePath = expander->expand(QString("%{Qt:qmakeExecutable}")); + data.qtVersionStr = expander->expand(QString("%{Qt:Version}")); + data.qtVersion = Utils::QtMajorVersion::None; + auto version = Version::fromString(data.qtVersionStr); + if (version.isValid) { + switch (version.major) { + case 4: + data.qtVersion = Utils::QtMajorVersion::Qt4; + break; + case 5: + data.qtVersion = Utils::QtMajorVersion::Qt5; + break; + case 6: + data.qtVersion = Utils::QtMajorVersion::Qt6; + break; + default: + data.qtVersion = Utils::QtMajorVersion::Unknown; + } + } + return data; +} + +static FilePath machineFilesDir() +{ + return Core::ICore::userResourcePath("Meson-machine-files"); +} + +FilePath MachineFileManager::machineFile(const Kit *kit) +{ + QTC_ASSERT(kit, return {}); + auto baseName + = QString("%1%2%3").arg(MACHINE_FILE_PREFIX).arg(kit->id().toString()).arg(MACHINE_FILE_EXT); + baseName = baseName.remove('{').remove('}'); + return machineFilesDir().pathAppended(baseName); +} + +MachineFileManager::MachineFileManager() +{ + connect(KitManager::instance(), &KitManager::kitAdded, + this, &MachineFileManager::addMachineFile); + connect(KitManager::instance(), &KitManager::kitUpdated, + this, &MachineFileManager::updateMachineFile); + connect(KitManager::instance(), &KitManager::kitRemoved, + this, &MachineFileManager::removeMachineFile); + connect(KitManager::instance(), &KitManager::kitsLoaded, + this, &MachineFileManager::cleanupMachineFiles); +} + +void MachineFileManager::addMachineFile(const Kit *kit) +{ + FilePath filePath = machineFile(kit); + QTC_ASSERT(!filePath.isEmpty(), return ); + auto kitData = createKitData(kit); + + auto entry = [](const QString &key, const QString &value) { + return QString("%1 = '%2'\n").arg(key).arg(value).toUtf8(); + }; + + QByteArray ba = "[binaries]\n"; + ba += entry("c", kitData.cCompilerPath); + ba += entry("cpp", kitData.cxxCompilerPath); + ba += entry("qmake", kitData.qmakePath); + if (kitData.qtVersion == QtMajorVersion::Qt4) + ba += entry("qmake-qt4", kitData.qmakePath); + else if (kitData.qtVersion == QtMajorVersion::Qt5) + ba += entry("qmake-qt5", kitData.qmakePath); + else if (kitData.qtVersion == QtMajorVersion::Qt6) + ba += entry("qmake-qt6", kitData.qmakePath); + ba += entry("cmake", kitData.cmakePath); + + filePath.writeFileContents(ba); +} + +void MachineFileManager::removeMachineFile(const Kit *kit) +{ + FilePath filePath = machineFile(kit); + if (filePath.exists()) + filePath.removeFile(); +} + +void MachineFileManager::updateMachineFile(const Kit *kit) +{ + addMachineFile(kit); +} + +void MachineFileManager::cleanupMachineFiles() +{ + FilePath dir = machineFilesDir(); + dir.ensureWritableDir(); + + const FileFilter filter = {{QString("%1*%2").arg(MACHINE_FILE_PREFIX).arg(MACHINE_FILE_EXT)}}; + const FilePaths machineFiles = dir.dirEntries(filter); + + FilePaths expected; + for (Kit const *kit : KitManager::kits()) { + const FilePath fname = machineFile(kit); + expected.push_back(fname); + if (!machineFiles.contains(fname)) + addMachineFile(kit); + } + + for (const FilePath &file : machineFiles) { + if (!expected.contains(file)) + file.removeFile(); + } +} + +// MesonBuildSystem + MesonBuildSystem::MesonBuildSystem(MesonBuildConfiguration *bc) - : ProjectExplorer::BuildSystem{bc} + : BuildSystem{bc} , m_parser{MesonToolKitAspect::mesonToolId(bc->kit()), bc->environment(), project()} { init(); @@ -92,7 +228,7 @@ void MesonBuildSystem::parsingCompleted(bool success) emit buildConfiguration()->enabledChanged(); // HACK. Should not be needed. } -ProjectExplorer::Kit *MesonBuildSystem::MesonBuildSystem::kit() +Kit *MesonBuildSystem::MesonBuildSystem::kit() { return buildConfiguration()->kit(); } @@ -209,9 +345,8 @@ bool MesonBuildSystem::parseProject() void MesonBuildSystem::updateKit(ProjectExplorer::Kit *kit) { QTC_ASSERT(kit, return ); - m_kitData = KitHelper::kitData(kit); + m_kitData = createKitData(kit); m_parser.setQtVersion(m_kitData.qtVersion); } -} // namespace Internal -} // namespace MesonProjectManager +} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/mesonbuildsystem.h b/src/plugins/mesonprojectmanager/mesonbuildsystem.h index 72e2cc9a961..9851c4af447 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildsystem.h +++ b/src/plugins/mesonprojectmanager/mesonbuildsystem.h @@ -13,13 +13,28 @@ #include <utils/filesystemwatcher.h> -namespace MesonProjectManager { -namespace Internal { +namespace MesonProjectManager::Internal { class MesonBuildConfiguration; + +class MachineFileManager final : public QObject +{ +public: + MachineFileManager(); + + static Utils::FilePath machineFile(const ProjectExplorer::Kit *kit); + +private: + void addMachineFile(const ProjectExplorer::Kit *kit); + void removeMachineFile(const ProjectExplorer::Kit *kit); + void updateMachineFile(const ProjectExplorer::Kit *kit); + void cleanupMachineFiles(); +}; + class MesonBuildSystem final : public ProjectExplorer::BuildSystem { Q_OBJECT + public: MesonBuildSystem(MesonBuildConfiguration *bc); ~MesonBuildSystem() final; @@ -56,5 +71,4 @@ private: KitData m_kitData; }; -} // namespace Internal -} // namespace MesonProjectManager +} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs index 1c0ae3f9d4d..552029cf639 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs +++ b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs @@ -28,8 +28,6 @@ Project { "toolwrapper.h", "kitdata.h", "kithelper.h", - "machinefilemanager.cpp", - "machinefilemanager.h", "mesonactionsmanager.cpp", "mesonactionsmanager.h", "buildoptions.h", diff --git a/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp b/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp index 87beb589bbd..56d945f04b7 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp +++ b/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp @@ -3,9 +3,9 @@ #include "mesonprojectplugin.h" -#include "machinefilemanager.h" #include "mesonactionsmanager.h" #include "mesonbuildconfiguration.h" +#include "mesonbuildsystem.h" #include "mesonproject.h" #include "mesonrunconfiguration.h" #include "mesontoolkitaspect.h" From f31007f40a0ec03002f1205023b094021da1c4b8 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 13 Jun 2023 10:49:20 +0200 Subject: [PATCH 0271/1777] Meson: Remove unnecessary MesonBuildSystem::kits Base is good enough. Change-Id: I3f9f1007336b8ae9a03c8e75da64a8eb5b73a8af Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/mesonprojectmanager/mesonbuildsystem.cpp | 5 ----- src/plugins/mesonprojectmanager/mesonbuildsystem.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp index 5f1a3b96c25..16b18293e3e 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp @@ -228,11 +228,6 @@ void MesonBuildSystem::parsingCompleted(bool success) emit buildConfiguration()->enabledChanged(); // HACK. Should not be needed. } -Kit *MesonBuildSystem::MesonBuildSystem::kit() -{ - return buildConfiguration()->kit(); -} - QStringList MesonBuildSystem::configArgs(bool isSetup) { const QString ¶ms = mesonBuildConfiguration()->parameters(); diff --git a/src/plugins/mesonprojectmanager/mesonbuildsystem.h b/src/plugins/mesonprojectmanager/mesonbuildsystem.h index 9851c4af447..5381df9a0d8 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildsystem.h +++ b/src/plugins/mesonprojectmanager/mesonbuildsystem.h @@ -61,8 +61,8 @@ private: void updateKit(ProjectExplorer::Kit *kit); bool needsSetup(); void parsingCompleted(bool success); - ProjectExplorer::Kit *kit(); QStringList configArgs(bool isSetup); + ProjectExplorer::BuildSystem::ParseGuard m_parseGuard; MesonProjectParser m_parser; CppEditor::CppProjectUpdater m_cppCodeModelUpdater; From f16f09c390f5acb57ac038b76ace43a8bb58795c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 12 Jul 2023 17:31:24 +0200 Subject: [PATCH 0272/1777] ProjectExplorer: Use aspects more directly in customexe runconfig Change-Id: I0c68c3a3b5fcaa0b25f12b9feed5023400e0bd00 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../customexecutablerunconfiguration.cpp | 39 +++++++------------ .../customexecutablerunconfiguration.h | 9 ++++- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index 37b112ac8fe..ca8979b4e35 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -23,38 +23,27 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *targe CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto envAspect = addAspect<EnvironmentAspect>(); - envAspect->setSupportForBuildEnvironment(target); + environment.setSupportForBuildEnvironment(target); - auto exeAspect = addAspect<ExecutableAspect>(); - exeAspect->setDeviceSelector(target, ExecutableAspect::HostDevice); - exeAspect->setSettingsKey("ProjectExplorer.CustomExecutableRunConfiguration.Executable"); - exeAspect->setReadOnly(false); - exeAspect->setHistoryCompleter("Qt.CustomExecutable.History"); - exeAspect->setExpectedKind(PathChooser::ExistingCommand); - exeAspect->setEnvironment(envAspect->environment()); + executable.setDeviceSelector(target, ExecutableAspect::HostDevice); + executable.setSettingsKey("ProjectExplorer.CustomExecutableRunConfiguration.Executable"); + executable.setReadOnly(false); + executable.setHistoryCompleter("Qt.CustomExecutable.History"); + executable.setExpectedKind(PathChooser::ExistingCommand); + executable.setEnvironment(environment.environment()); - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); + arguments.setMacroExpander(macroExpander()); - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); - workingDirAspect->setEnvironment(envAspect); + workingDir.setMacroExpander(macroExpander()); + workingDir.setEnvironment(&environment); - addAspect<TerminalAspect>(); - - connect(envAspect, &EnvironmentAspect::environmentChanged, this, [exeAspect, envAspect] { - exeAspect->setEnvironment(envAspect->environment()); + connect(&environment, &EnvironmentAspect::environmentChanged, this, [this] { + executable.setEnvironment(environment.environment()); }); setDefaultDisplayName(defaultDisplayName()); } -FilePath CustomExecutableRunConfiguration::executable() const -{ - return aspect<ExecutableAspect>()->executable(); -} - bool CustomExecutableRunConfiguration::isEnabled() const { return true; @@ -64,8 +53,8 @@ Runnable CustomExecutableRunConfiguration::runnable() const { Runnable r; r.command = commandLine(); - r.environment = aspect<EnvironmentAspect>()->environment(); - r.workingDirectory = aspect<WorkingDirectoryAspect>()->workingDirectory(); + r.environment = environment.environment(); + r.workingDirectory = workingDir(); if (!r.command.isEmpty()) { const FilePath expanded = macroExpander()->expand(r.command.executable()); diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.h b/src/plugins/projectexplorer/customexecutablerunconfiguration.h index 101516bb2de..5eaced5c493 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.h +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.h @@ -3,6 +3,8 @@ #pragma once +#include "environmentaspect.h" +#include "runconfigurationaspects.h" #include "runcontrol.h" namespace ProjectExplorer { @@ -23,7 +25,12 @@ private: Tasks checkForIssues() const override; void configurationDialogFinished(); - Utils::FilePath executable() const; + + EnvironmentAspect environment{this}; + ExecutableAspect executable{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; + TerminalAspect terminal{this}; }; class CustomExecutableRunConfigurationFactory : public FixedRunConfigurationFactory From 77c7e26779a1ce9a6a47143a9c9e2225231af087 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 11 Jul 2023 14:14:40 +0200 Subject: [PATCH 0273/1777] Tasks: Show tool tips with information about the categories When hovering an entry in the filter menu in the Issues view. Also remove some categories that shouldn't be there. Change-Id: Ifb367d69b9396c2fdc45b83ec5ffd88ac2f0eda7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../clangcodemodel/clangcodemodelplugin.cpp | 7 ++--- src/plugins/clangtools/clangtoolsplugin.cpp | 4 ++- .../debugger/debuggerinternalconstants.h | 1 - src/plugins/debugger/debuggerplugin.cpp | 9 ++++--- src/plugins/debugger/debuggerruncontrol.cpp | 1 - src/plugins/nim/nimconstants.h | 3 --- src/plugins/nim/nimplugin.cpp | 1 - src/plugins/nim/project/nimblebuildsystem.cpp | 5 ++-- src/plugins/projectexplorer/buildmanager.cpp | 26 +++++++++++++------ .../projectexplorer/projectexplorer.cpp | 7 +++-- src/plugins/projectexplorer/taskhub.h | 1 + src/plugins/projectexplorer/taskwindow.cpp | 3 +++ src/plugins/python/pythonplugin.cpp | 6 ++++- .../assetexporterplugin.cpp | 4 ++- src/plugins/qmljseditor/qmljseditorplugin.cpp | 9 +++++-- 15 files changed, 57 insertions(+), 30 deletions(-) diff --git a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp index f178dc2824e..62dae070400 100644 --- a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp +++ b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp @@ -77,9 +77,10 @@ ClangCodeModelPlugin::~ClangCodeModelPlugin() void ClangCodeModelPlugin::initialize() { - TaskHub::addCategory({Constants::TASK_CATEGORY_DIAGNOSTICS, Tr::tr("Clang Code Model")}); - CppEditor::CppModelManager::activateClangCodeModel( - std::make_unique<ClangModelManagerSupport>()); + TaskHub::addCategory({Constants::TASK_CATEGORY_DIAGNOSTICS, + Tr::tr("Clang Code Model"), + Tr::tr("C++ code issues that Clangd found in the current document.")}); + CppEditor::CppModelManager::activateClangCodeModel(std::make_unique<ClangModelManagerSupport>()); createCompilationDBAction(); #ifdef WITH_TESTS diff --git a/src/plugins/clangtools/clangtoolsplugin.cpp b/src/plugins/clangtools/clangtoolsplugin.cpp index 57b11d61b51..8a5815f116b 100644 --- a/src/plugins/clangtools/clangtoolsplugin.cpp +++ b/src/plugins/clangtools/clangtoolsplugin.cpp @@ -89,7 +89,9 @@ ClangToolsPlugin::~ClangToolsPlugin() void ClangToolsPlugin::initialize() { - TaskHub::addCategory({taskCategory(), Tr::tr("Clang Tools")}); + TaskHub::addCategory({taskCategory(), + Tr::tr("Clang Tools"), + Tr::tr("Issues that Clang-Tidy and Clazy found when analyzing code.")}); // Import tidy/clazy diagnostic configs from CppEditor now // instead of at opening time of the settings page diff --git a/src/plugins/debugger/debuggerinternalconstants.h b/src/plugins/debugger/debuggerinternalconstants.h index 5c4205b5a8f..bb3e5181ee2 100644 --- a/src/plugins/debugger/debuggerinternalconstants.h +++ b/src/plugins/debugger/debuggerinternalconstants.h @@ -42,7 +42,6 @@ const char C_DEBUGGER_NOTRUNNING[] = "Debugger.NotRunning"; const char PRESET_PERSPECTIVE_ID[] = "Debugger.Perspective.Preset"; -const char TASK_CATEGORY_DEBUGGER_DEBUGINFO[] = "Debuginfo"; const char TASK_CATEGORY_DEBUGGER_RUNTIME[] = "DebugRuntime"; const char TEXT_MARK_CATEGORY_BREAKPOINT[] = "Debugger.Mark.Breakpoint"; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index b76eb6c932a..9e1217307f9 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -723,7 +723,9 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) // Task integration. //: Category under which Analyzer tasks are listed in Issues view - TaskHub::addCategory({ANALYZERTASK_ID, Tr::tr("Debugger")}); + TaskHub::addCategory({ANALYZERTASK_ID, + Tr::tr("Valgrind"), + Tr::tr("Issues that the Valgrind tools found when analyzing the code.")}); const Context debuggerNotRunning(C_DEBUGGER_NOTRUNNING); ICore::addAdditionalContext(debuggerNotRunning); @@ -765,8 +767,9 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) act->setEnabled(false); Command *cmd = ActionManager::registerAction(act, Constants::OPEN_MEMORY_EDITOR); - TaskHub::addCategory({TASK_CATEGORY_DEBUGGER_DEBUGINFO, Tr::tr("Debug Information")}); - TaskHub::addCategory({TASK_CATEGORY_DEBUGGER_RUNTIME, Tr::tr("Debugger Runtime")}); + TaskHub::addCategory({TASK_CATEGORY_DEBUGGER_RUNTIME, + Tr::tr("Debugger Runtime"), + Tr::tr("Issues with starting the debugger.")}); m_debuggerSettings.readSettings(); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index fa2aa3da693..95eb60c83c1 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -427,7 +427,6 @@ void DebuggerRunTool::addSearchDirectory(const Utils::FilePath &dir) void DebuggerRunTool::start() { - TaskHub::clearTasks(Constants::TASK_CATEGORY_DEBUGGER_DEBUGINFO); TaskHub::clearTasks(Constants::TASK_CATEGORY_DEBUGGER_RUNTIME); if (d->portsGatherer) { diff --git a/src/plugins/nim/nimconstants.h b/src/plugins/nim/nimconstants.h index 5c66be9f295..868fb0b96ee 100644 --- a/src/plugins/nim/nimconstants.h +++ b/src/plugins/nim/nimconstants.h @@ -42,9 +42,6 @@ const QString C_NIMCOMPILERBUILDSTEP_TARGETNIMFILE = QStringLiteral("Nim.NimComp // NimCompilerCleanStep const char C_NIMCOMPILERCLEANSTEP_ID[] = "Nim.NimCompilerCleanStep"; -// Nim task category (Issues pane) -const char C_NIMPARSE_ID[] = "Nim.NimParse"; - const char C_NIMLANGUAGE_ID[] = "Nim"; const char C_NIMCODESTYLESETTINGSPAGE_ID[] = "Nim.NimCodeStyleSettings"; const char C_NIMCODESTYLESETTINGSPAGE_CATEGORY[] = "Z.Nim"; diff --git a/src/plugins/nim/nimplugin.cpp b/src/plugins/nim/nimplugin.cpp index 47138b906a1..2ffcadfbf27 100644 --- a/src/plugins/nim/nimplugin.cpp +++ b/src/plugins/nim/nimplugin.cpp @@ -97,7 +97,6 @@ void NimPlugin::extensionsInitialized() FileIconProvider::registerIconOverlayForMimeType(icon, Constants::C_NIM_SCRIPT_MIMETYPE); FileIconProvider::registerIconOverlayForMimeType(icon, Constants::C_NIMBLE_MIMETYPE); } - TaskHub::addCategory({Constants::C_NIMPARSE_ID, "Nim"}); } } // namespace Nim diff --git a/src/plugins/nim/project/nimblebuildsystem.cpp b/src/plugins/nim/project/nimblebuildsystem.cpp index 3a8ccb08d62..baed02b5254 100644 --- a/src/plugins/nim/project/nimblebuildsystem.cpp +++ b/src/plugins/nim/project/nimblebuildsystem.cpp @@ -39,7 +39,7 @@ static std::vector<NimbleTask> parseTasks(const FilePath &nimblePath, const File std::vector<NimbleTask> result; if (process.exitCode() != 0) { - TaskHub::addTask(Task(Task::Error, process.cleanedStdOut(), {}, -1, Constants::C_NIMPARSE_ID)); + TaskHub::addTask(ProjectExplorer::BuildSystemTask(Task::Error, process.cleanedStdOut())); return result; } @@ -67,7 +67,7 @@ static NimbleMetadata parseMetadata(const FilePath &nimblePath, const FilePath & NimbleMetadata result = {}; if (process.exitCode() != 0) { - TaskHub::addTask(Task(Task::Error, process.cleanedStdOut(), {}, -1, Constants::C_NIMPARSE_ID)); + TaskHub::addTask(ProjectExplorer::BuildSystemTask(Task::Error, process.cleanedStdOut())); return result; } const QList<QByteArray> &lines = linesFromProcessOutput(&process); @@ -141,7 +141,6 @@ void NimbleBuildSystem::triggerParsing() void NimbleBuildSystem::updateProject() { - TaskHub::clearTasks(Constants::C_NIMPARSE_ID); const FilePath projectDir = projectDirectory(); const FilePath nimble = Nim::nimblePathFromKit(kit()); diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 5a9575743fa..76336d3aa13 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -293,16 +293,26 @@ void BuildManager::extensionsInitialized() { TaskHub::addCategory({Constants::TASK_CATEGORY_COMPILE, Tr::tr("Compile", "Category for compiler issues listed under 'Issues'"), - true, 100}); - TaskHub::addCategory({Constants::TASK_CATEGORY_BUILDSYSTEM, - Tr::tr("Build System", "Category for build system issues listed under 'Issues'"), - true, 100}); - TaskHub::addCategory({Constants::TASK_CATEGORY_DEPLOYMENT, - Tr::tr("Deployment", "Category for deployment issues listed under 'Issues'"), - true, 100}); + Tr::tr("Issues parsed from the compile output."), + true, + 100}); + TaskHub::addCategory( + {Constants::TASK_CATEGORY_BUILDSYSTEM, + Tr::tr("Build System", "Category for build system issues listed under 'Issues'"), + Tr::tr("Issues from the build system, such as CMake or qmake."), + true, + 100}); + TaskHub::addCategory( + {Constants::TASK_CATEGORY_DEPLOYMENT, + Tr::tr("Deployment", "Category for deployment issues listed under 'Issues'"), + Tr::tr("Issues found when deploying applications to devices."), + true, + 100}); TaskHub::addCategory({Constants::TASK_CATEGORY_AUTOTEST, Tr::tr("Autotests", "Category for autotest issues listed under 'Issues'"), - true, 100}); + Tr::tr("Issues found when running tests."), + true, + 100}); } void BuildManager::buildProjectWithoutDependencies(Project *project) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index bb473b900ea..9b9ae3886ab 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2075,8 +2075,11 @@ void ProjectExplorerPlugin::extensionsInitialized() BuildManager::extensionsInitialized(); TaskHub::addCategory({Constants::TASK_CATEGORY_SANITIZER, - Tr::tr("Sanitizer", "Category for sanitizer issues listed under 'Issues'")}); - TaskHub::addCategory({Constants::TASK_CATEGORY_TASKLIST_ID, Tr::tr("My Tasks")}); + Tr::tr("Sanitizer", "Category for sanitizer issues listed under 'Issues'"), + Tr::tr("Memory handling issues that the address sanitizer found.")}); + TaskHub::addCategory({Constants::TASK_CATEGORY_TASKLIST_ID, + Tr::tr("My Tasks"), + Tr::tr("Issues from a task list file (.tasks).")}); SshSettings::loadSettings(ICore::settings()); const auto searchPathRetriever = [] { diff --git a/src/plugins/projectexplorer/taskhub.h b/src/plugins/projectexplorer/taskhub.h index 1822129bc26..0afc8d51f47 100644 --- a/src/plugins/projectexplorer/taskhub.h +++ b/src/plugins/projectexplorer/taskhub.h @@ -17,6 +17,7 @@ class PROJECTEXPLORER_EXPORT TaskCategory public: Utils::Id id; QString displayName; + QString description; bool visible = true; int priority = 0; }; diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 7e41ef26cff..ec174887b2e 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -21,6 +21,7 @@ #include <coreplugin/session.h> #include <utils/algorithm.h> +#include <utils/execmenu.h> #include <utils/fileinprojectfinder.h> #include <utils/hostosinfo.h> #include <utils/itemviews.h> @@ -221,6 +222,7 @@ TaskWindow::TaskWindow() : d(std::make_unique<TaskWindowPrivate>()) d->m_categoriesMenu = new QMenu(d->m_categoriesButton); connect(d->m_categoriesMenu, &QMenu::aboutToShow, this, &TaskWindow::updateCategoriesMenu); + Utils::addToolTipsToMenu(d->m_categoriesMenu); d->m_categoriesButton->setMenu(d->m_categoriesMenu); @@ -475,6 +477,7 @@ void TaskWindow::updateCategoriesMenu() auto action = new QAction(d->m_categoriesMenu); action->setCheckable(true); action->setText(c.displayName); + action->setToolTip(c.description); action->setChecked(!filteredCategories.contains(c.id)); connect(action, &QAction::triggered, this, [this, action, id = c.id] { setCategoryVisibility(id, action->isChecked()); diff --git a/src/plugins/python/pythonplugin.cpp b/src/plugins/python/pythonplugin.cpp index 55377c57222..bc95ddd2aa8 100644 --- a/src/plugins/python/pythonplugin.cpp +++ b/src/plugins/python/pythonplugin.cpp @@ -8,6 +8,7 @@ #include "pythonproject.h" #include "pythonrunconfiguration.h" #include "pythonsettings.h" +#include "pythontr.h" #include "pythonwizardpage.h" #include <projectexplorer/buildtargetinfo.h> @@ -70,7 +71,10 @@ void PythonPlugin::extensionsInitialized() ::Constants::FILEOVERLAY_PY); FileIconProvider::registerIconOverlayForSuffix(imageFile, "py"); - TaskHub::addCategory({PythonErrorTaskCategory, "Python", true}); + TaskHub::addCategory({PythonErrorTaskCategory, + "Python", + Tr::tr("Issues parsed from Python runtime output."), + true}); } } // Python::Internal diff --git a/src/plugins/qmldesigner/assetexporterplugin/assetexporterplugin.cpp b/src/plugins/qmldesigner/assetexporterplugin/assetexporterplugin.cpp index 6e66a9bba17..ea0899d07c6 100644 --- a/src/plugins/qmldesigner/assetexporterplugin/assetexporterplugin.cpp +++ b/src/plugins/qmldesigner/assetexporterplugin/assetexporterplugin.cpp @@ -39,7 +39,9 @@ namespace QmlDesigner { AssetExporterPlugin::AssetExporterPlugin() { ProjectExplorer::TaskHub::addCategory({Constants::TASK_CATEGORY_ASSET_EXPORT, - tr("Asset Export"), false}); + tr("Asset Export"), + tr("Issues with exporting assets."), + false}); auto *designerPlugin = QmlDesigner::QmlDesignerPlugin::instance(); auto &viewManager = designerPlugin->viewManager(); diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp index d0393e2df2a..b0736b29d15 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.cpp +++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp @@ -205,8 +205,13 @@ void QmlJSEditorPlugin::extensionsInitialized() FileIconProvider::registerIconOverlayForMimeType(ProjectExplorer::Constants::FILEOVERLAY_UI, "application/x-qt.ui+qml"); - TaskHub::addCategory({Constants::TASK_CATEGORY_QML, Tr::tr("QML")}); - TaskHub::addCategory({Constants::TASK_CATEGORY_QML_ANALYSIS, Tr::tr("QML Analysis"), false}); + TaskHub::addCategory({Constants::TASK_CATEGORY_QML, + Tr::tr("QML"), + Tr::tr("Issues that the QML code parser found.")}); + TaskHub::addCategory({Constants::TASK_CATEGORY_QML_ANALYSIS, + Tr::tr("QML Analysis"), + Tr::tr("Issues that the QML static analyzer found."), + false}); QmllsSettingsManager::instance()->setupAutoupdate(); } From a7ad779525bb8113f2664abfb7a173564c272f58 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 08:08:08 +0200 Subject: [PATCH 0274/1777] RemoteLinux: Use aspects more directly in MakeInstallStep Change-Id: I0586f24154a42033e4c6c1a1ac6274e348447e2a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/remotelinux/makeinstallstep.cpp | 113 +++++++------------- 1 file changed, 41 insertions(+), 72 deletions(-) diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index b11b9b82f63..44da4e9d832 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -32,12 +32,6 @@ using namespace Utils; namespace RemoteLinux { -const char MakeAspectId[] = "RemoteLinux.MakeInstall.Make"; -const char InstallRootAspectId[] = "RemoteLinux.MakeInstall.InstallRoot"; -const char CleanInstallRootAspectId[] = "RemoteLinux.MakeInstall.CleanInstallRoot"; -const char FullCommandLineAspectId[] = "RemoteLinux.MakeInstall.FullCommandLine"; -const char CustomCommandLineAspectId[] = "RemoteLinux.MakeInstall.CustomCommandLine"; - class MakeInstallStep : public MakeStep { public: @@ -50,15 +44,16 @@ private: void finish(ProcessResult result) override; bool isJobCountSupported() const override { return false; } - FilePath installRoot() const; - bool cleanInstallRoot() const; - void updateCommandFromAspect(); void updateArgsFromAspect(); void updateFullCommandLine(); void updateFromCustomCommandLineAspect(); - StringAspect *customCommandLineAspect() const; + ExecutableAspect m_makeBinary{this}; + FilePathAspect m_installRoot{this}; + BoolAspect m_cleanInstallRoot{this}; + StringAspect m_fullCommand{this}; + StringAspect m_customCommand{this}; DeploymentData m_deploymentData; bool m_noInstallTarget = false; @@ -67,7 +62,7 @@ private: MakeInstallStep::MakeInstallStep(BuildStepList *parent, Id id) : MakeStep(parent, id) { - m_makeCommandAspect.setVisible(false); + m_makeBinary.setVisible(false); m_buildTargetsAspect.setVisible(false); m_userArgumentsAspect.setVisible(false); m_overrideMakeflagsAspect.setVisible(false); @@ -87,59 +82,49 @@ MakeInstallStep::MakeInstallStep(BuildStepList *parent, Id id) : MakeStep(parent rootPath = FilePath::fromString(tmpDir.path()); } - const auto makeAspect = addAspect<ExecutableAspect>(); - makeAspect->setDeviceSelector(parent->target(), ExecutableAspect::BuildDevice); - makeAspect->setId(MakeAspectId); - makeAspect->setSettingsKey(MakeAspectId); - makeAspect->setReadOnly(false); - makeAspect->setLabelText(Tr::tr("Command:")); - connect(makeAspect, &ExecutableAspect::changed, + m_makeBinary.setDeviceSelector(parent->target(), ExecutableAspect::BuildDevice); + m_makeBinary.setSettingsKey("RemoteLinux.MakeInstall.Make"); + m_makeBinary.setReadOnly(false); + m_makeBinary.setLabelText(Tr::tr("Command:")); + connect(&m_makeBinary, &BaseAspect::changed, this, &MakeInstallStep::updateCommandFromAspect); - const auto installRootAspect = addAspect<FilePathAspect>(); - installRootAspect->setId(InstallRootAspectId); - installRootAspect->setSettingsKey(InstallRootAspectId); - installRootAspect->setExpectedKind(PathChooser::Directory); - installRootAspect->setLabelText(Tr::tr("Install root:")); - installRootAspect->setValue(rootPath); - connect(installRootAspect, &StringAspect::changed, + m_installRoot.setSettingsKey("RemoteLinux.MakeInstall.InstallRoot"); + m_installRoot.setExpectedKind(PathChooser::Directory); + m_installRoot.setLabelText(Tr::tr("Install root:")); + m_installRoot.setValue(rootPath); + connect(&m_installRoot, &BaseAspect::changed, this, &MakeInstallStep::updateArgsFromAspect); - const auto cleanInstallRootAspect = addAspect<BoolAspect>(); - cleanInstallRootAspect->setId(CleanInstallRootAspectId); - cleanInstallRootAspect->setSettingsKey(CleanInstallRootAspectId); - cleanInstallRootAspect->setLabel(Tr::tr("Clean install root first:"), - BoolAspect::LabelPlacement::InExtraLabel); - cleanInstallRootAspect->setValue(true); + m_cleanInstallRoot.setSettingsKey("RemoteLinux.MakeInstall.CleanInstallRoot"); + m_cleanInstallRoot.setLabelText(Tr::tr("Clean install root first:")); + m_cleanInstallRoot.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); + m_cleanInstallRoot.setDefaultValue(true); - const auto commandLineAspect = addAspect<StringAspect>(); - commandLineAspect->setId(FullCommandLineAspectId); - commandLineAspect->setDisplayStyle(StringAspect::LabelDisplay); - commandLineAspect->setLabelText(Tr::tr("Full command line:")); + m_fullCommand.setDisplayStyle(StringAspect::LabelDisplay); + m_fullCommand.setLabelText(Tr::tr("Full command line:")); - const auto customCommandLineAspect = addAspect<StringAspect>(); - customCommandLineAspect->setId(CustomCommandLineAspectId); - customCommandLineAspect->setSettingsKey(CustomCommandLineAspectId); - customCommandLineAspect->setDisplayStyle(StringAspect::LineEditDisplay); - customCommandLineAspect->setLabelText(Tr::tr("Custom command line:")); - customCommandLineAspect->makeCheckable(StringAspect::CheckBoxPlacement::Top, - Tr::tr("Use custom command line instead:"), - "RemoteLinux.MakeInstall.EnableCustomCommandLine"); + m_customCommand.setSettingsKey("RemoteLinux.MakeInstall.CustomCommandLine"); + m_customCommand.setDisplayStyle(StringAspect::LineEditDisplay); + m_customCommand.setLabelText(Tr::tr("Custom command line:")); + m_customCommand.makeCheckable(StringAspect::CheckBoxPlacement::Top, + Tr::tr("Use custom command line instead:"), + "RemoteLinux.MakeInstall.EnableCustomCommandLine"); const auto updateCommand = [this] { updateCommandFromAspect(); updateArgsFromAspect(); updateFromCustomCommandLineAspect(); }; - connect(customCommandLineAspect, &StringAspect::checkedChanged, this, updateCommand); - connect(customCommandLineAspect, &StringAspect::changed, + connect(&m_customCommand, &StringAspect::checkedChanged, this, updateCommand); + connect(&m_customCommand, &StringAspect::changed, this, &MakeInstallStep::updateFromCustomCommandLineAspect); connect(target(), &Target::buildSystemUpdated, this, updateCommand); const MakeInstallCommand cmd = buildSystem()->makeInstallCommand(rootPath); QTC_ASSERT(!cmd.command.isEmpty(), return); - makeAspect->setExecutable(cmd.command.executable()); + m_makeBinary.setExecutable(cmd.command.executable()); connect(this, &BuildStep::addOutput, this, [this](const QString &string, OutputFormat format) { // When using Makefiles: "No rule to make target 'install'" @@ -160,12 +145,12 @@ bool MakeInstallStep::init() if (!MakeStep::init()) return false; - const FilePath rootDir = makeCommand().withNewPath(installRoot().path()); // FIXME: Needed? + const FilePath rootDir = makeCommand().withNewPath(m_installRoot().path()); // FIXME: Needed? if (rootDir.isEmpty()) { emit addTask(BuildSystemTask(Task::Error, Tr::tr("You must provide an install root."))); return false; } - if (cleanInstallRoot() && !rootDir.removeRecursively()) { + if (m_cleanInstallRoot() && !rootDir.removeRecursively()) { emit addTask(BuildSystemTask(Task::Error, Tr::tr("The install root \"%1\" could not be cleaned.") .arg(rootDir.displayName()))); @@ -206,7 +191,7 @@ bool MakeInstallStep::init() void MakeInstallStep::finish(ProcessResult result) { if (isSuccess(result)) { - const FilePath rootDir = makeCommand().withNewPath(installRoot().path()); // FIXME: Needed? + const FilePath rootDir = makeCommand().withNewPath(m_installRoot().path()); // FIXME: Needed? m_deploymentData = DeploymentData(); m_deploymentData.setLocalInstallRoot(rootDir); @@ -235,29 +220,19 @@ void MakeInstallStep::finish(ProcessResult result) MakeStep::finish(result); } -FilePath MakeInstallStep::installRoot() const -{ - return static_cast<StringAspect *>(aspect(InstallRootAspectId))->filePath(); -} - -bool MakeInstallStep::cleanInstallRoot() const -{ - return static_cast<BoolAspect *>(aspect(CleanInstallRootAspectId))->value(); -} - void MakeInstallStep::updateCommandFromAspect() { - if (customCommandLineAspect()->isChecked()) + if (m_customCommand.isChecked()) return; - setMakeCommand(aspect<ExecutableAspect>()->executable()); + setMakeCommand(m_makeBinary()); updateFullCommandLine(); } void MakeInstallStep::updateArgsFromAspect() { - if (customCommandLineAspect()->isChecked()) + if (m_customCommand.isChecked()) return; - const CommandLine cmd = buildSystem()->makeInstallCommand(installRoot()).command; + const CommandLine cmd = buildSystem()->makeInstallCommand(m_installRoot()).command; setUserArguments(cmd.arguments()); updateFullCommandLine(); } @@ -265,24 +240,18 @@ void MakeInstallStep::updateArgsFromAspect() void MakeInstallStep::updateFullCommandLine() { CommandLine cmd{makeExecutable(), userArguments(), CommandLine::Raw}; - static_cast<StringAspect *>(aspect(FullCommandLineAspectId))->setValue(cmd.toUserOutput()); + m_fullCommand.setValue(cmd.toUserOutput()); } void MakeInstallStep::updateFromCustomCommandLineAspect() { - const StringAspect * const aspect = customCommandLineAspect(); - if (!aspect->isChecked()) + if (m_customCommand.isChecked()) return; - const QStringList tokens = ProcessArgs::splitArgs(aspect->value(), HostOsInfo::hostOs()); + const QStringList tokens = ProcessArgs::splitArgs(m_customCommand(), HostOsInfo::hostOs()); setMakeCommand(tokens.isEmpty() ? FilePath() : FilePath::fromString(tokens.first())); setUserArguments(ProcessArgs::joinArgs(tokens.mid(1))); } -StringAspect *MakeInstallStep::customCommandLineAspect() const -{ - return static_cast<StringAspect *>(aspect(CustomCommandLineAspectId)); -} - bool MakeInstallStep::fromMap(const QVariantMap &map) { if (!MakeStep::fromMap(map)) From d69302ad61c5ef16ad3bdc439bc41858b7b1c607 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 12 Jul 2023 17:10:29 +0200 Subject: [PATCH 0275/1777] Nim: Use aspect more directly in NimCompilerCleanStep Change-Id: I8433dfa96c65ea3e1f7e9b0daef2e64e6cc65684 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../nim/project/nimcompilercleanstep.cpp | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/plugins/nim/project/nimcompilercleanstep.cpp b/src/plugins/nim/project/nimcompilercleanstep.cpp index 798ba4f8a0c..4e2c51446a8 100644 --- a/src/plugins/nim/project/nimcompilercleanstep.cpp +++ b/src/plugins/nim/project/nimcompilercleanstep.cpp @@ -23,7 +23,17 @@ namespace Nim { class NimCompilerCleanStep final : public BuildStep { public: - NimCompilerCleanStep(BuildStepList *parentList, Id id); + NimCompilerCleanStep(BuildStepList *parentList, Id id) + : BuildStep(parentList, id) + { + workingDir.setLabelText(Tr::tr("Working directory:")); + workingDir.setDisplayStyle(StringAspect::LineEditDisplay); + + setSummaryUpdater([this] { + workingDir.setValue(buildDirectory()); + return displayName(); + }); + } private: bool init() final; @@ -34,21 +44,9 @@ private: bool removeOutFilePath(); FilePath m_buildDir; + FilePathAspect workingDir{this}; }; -NimCompilerCleanStep::NimCompilerCleanStep(BuildStepList *parentList, Id id) - : BuildStep(parentList, id) -{ - auto workingDirectory = addAspect<FilePathAspect>(); - workingDirectory->setLabelText(Tr::tr("Working directory:")); - workingDirectory->setDisplayStyle(StringAspect::LineEditDisplay); - - setSummaryUpdater([this, workingDirectory] { - workingDirectory->setValue(buildDirectory()); - return displayName(); - }); -} - bool NimCompilerCleanStep::init() { FilePath buildDir = buildDirectory(); From 69008e390c12434762cf1f06f4456ec6b0f35de6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 12 Jul 2023 17:14:56 +0200 Subject: [PATCH 0276/1777] CMakeProjectManager: Use aspect more directly in CMakeInstallStep Change-Id: Ibdd1fea42b93282b387693ea3d8cb155deeaed8a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../cmakeprojectmanager/cmakeinstallstep.cpp | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp b/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp index 07d3c6fd478..d62a2edbb7c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp @@ -16,6 +16,7 @@ #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> + #include <utils/layoutbuilder.h> using namespace Core; @@ -24,14 +25,20 @@ using namespace Utils; namespace CMakeProjectManager::Internal { -const char CMAKE_ARGUMENTS_KEY[] = "CMakeProjectManager.InstallStep.CMakeArguments"; - // CMakeInstallStep class CMakeInstallStep : public CMakeAbstractProcessStep { public: - CMakeInstallStep(ProjectExplorer::BuildStepList *bsl, Id id); + CMakeInstallStep(BuildStepList *bsl, Id id) + : CMakeAbstractProcessStep(bsl, id) + { + cmakeArguments.setSettingsKey("CMakeProjectManager.InstallStep.CMakeArguments"); + cmakeArguments.setLabelText(Tr::tr("CMake arguments:")); + cmakeArguments.setDisplayStyle(StringAspect::LineEditDisplay); + + setCommandLineProvider([this] { return cmakeCommand(); }); + } private: CommandLine cmakeCommand() const; @@ -41,20 +48,9 @@ private: void setupOutputFormatter(OutputFormatter *formatter) override; QWidget *createConfigWidget() override; - StringAspect *m_cmakeArguments = nullptr; + StringAspect cmakeArguments{this}; }; -CMakeInstallStep::CMakeInstallStep(BuildStepList *bsl, Id id) - : CMakeAbstractProcessStep(bsl, id) -{ - m_cmakeArguments = addAspect<StringAspect>(); - m_cmakeArguments->setSettingsKey(CMAKE_ARGUMENTS_KEY); - m_cmakeArguments->setLabelText(Tr::tr("CMake arguments:")); - m_cmakeArguments->setDisplayStyle(StringAspect::LineEditDisplay); - - setCommandLineProvider([this] { return cmakeCommand(); }); -} - void CMakeInstallStep::setupOutputFormatter(OutputFormatter *formatter) { CMakeParser *cmakeParser = new CMakeParser; @@ -82,8 +78,7 @@ CommandLine CMakeInstallStep::cmakeCommand() const cmd.addArg(bs->cmakeBuildType()); } - if (!m_cmakeArguments->value().isEmpty()) - cmd.addArgs(m_cmakeArguments->value(), CommandLine::Raw); + cmd.addArgs(cmakeArguments(), CommandLine::Raw); return cmd; } @@ -107,11 +102,11 @@ QWidget *CMakeInstallStep::createConfigWidget() setDisplayName(Tr::tr("Install", "ConfigWidget display name.")); using namespace Layouting; - auto widget = Form { m_cmakeArguments, noMargin }.emerge(); + auto widget = Form { cmakeArguments, noMargin }.emerge(); updateDetails(); - connect(m_cmakeArguments, &StringAspect::changed, this, updateDetails); + connect(&cmakeArguments, &StringAspect::changed, this, updateDetails); connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged, From dff33fa84bb37e5261bcef32ec3efefb54530feb Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 11 Jul 2023 20:16:35 +0200 Subject: [PATCH 0277/1777] AbstractProcessStep: Simplify process done handling Change-Id: If520052b364789cb830b41a83e9ff3b86082a1e3 Reviewed-by: hjk <hjk@qt.io> --- .../projectexplorer/abstractprocessstep.cpp | 78 ++++--------------- .../projectexplorer/abstractprocessstep.h | 2 - 2 files changed, 17 insertions(+), 63 deletions(-) diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 96e6f2291d9..9e7a2179371 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -74,8 +74,6 @@ class AbstractProcessStep::Private public: Private(AbstractProcessStep *q) : q(q) {} - void cleanUp(int exitCode, QProcess::ExitStatus status); - AbstractProcessStep *q; std::unique_ptr<Process> m_process; std::unique_ptr<TaskTree> m_taskTree; @@ -177,7 +175,10 @@ void AbstractProcessStep::doRun() return; if (!d->m_param.effectiveCommand().isExecutableFile()) { - processStartupFailed(); + emit addOutput(Tr::tr("The program \"%1\" does not exist or is not executable.") + .arg(d->m_displayedParams->effectiveCommand().toUserOutput()), + OutputFormat::ErrorMessage); + finish(ProcessResult::StartFailed); return; } @@ -186,12 +187,11 @@ void AbstractProcessStep::doRun() d->m_process.reset(new Process); setupProcess(d->m_process.get()); connect(d->m_process.get(), &Process::done, this, [this] { - if (d->m_process->error() == QProcess::FailedToStart) { - processStartupFailed(); - d->m_process.release()->deleteLater(); - return; - } - d->cleanUp(d->m_process->exitCode(), d->m_process->exitStatus()); + handleProcessDone(*d->m_process); + const ProcessResult result = d->outputFormatter->hasFatalErrors() + ? ProcessResult::FinishedWithError : d->m_process->result(); + d->m_process.release()->deleteLater(); + finish(result); }); d->m_process->start(); } @@ -241,7 +241,7 @@ void AbstractProcessStep::setupProcess(Process *process) OutputFormat::Stderr, DontAppendNewline); }); connect(process, &Process::started, this, [this] { - ProcessParameters *params = displayedParameters(); + ProcessParameters *params = d->m_displayedParams; emit addOutput(Tr::tr("Starting: \"%1\" %2") .arg(params->effectiveCommand().toUserOutput(), params->prettyArguments()), OutputFormat::NormalMessage); @@ -250,7 +250,7 @@ void AbstractProcessStep::setupProcess(Process *process) void AbstractProcessStep::handleProcessDone(const Process &process) { - const QString command = displayedParameters()->effectiveCommand().toUserOutput(); + const QString command = d->m_displayedParams->effectiveCommand().toUserOutput(); if (process.result() == ProcessResult::FinishedWithSuccess) { emit addOutput(Tr::tr("The process \"%1\" exited normally.").arg(command), OutputFormat::NormalMessage); @@ -260,7 +260,7 @@ void AbstractProcessStep::handleProcessDone(const Process &process) OutputFormat::ErrorMessage); } else if (process.result() == ProcessResult::StartFailed) { emit addOutput(Tr::tr("Could not start process \"%1\" %2.") - .arg(command, displayedParameters()->prettyArguments()), + .arg(command, d->m_displayedParams->prettyArguments()), OutputFormat::ErrorMessage); const QString errorString = process.errorString(); if (!errorString.isEmpty()) @@ -297,12 +297,15 @@ void AbstractProcessStep::setLowPriority() void AbstractProcessStep::doCancel() { + const QString message = Tr::tr("The build step was ended forcefully."); if (d->m_process) { - d->cleanUp(-1, QProcess::CrashExit); + emit addOutput(message, OutputFormat::ErrorMessage); + d->m_process.reset(); + finish(ProcessResult::TerminatedAbnormally); } if (d->m_taskTree) { d->m_taskTree.reset(); - emit addOutput(Tr::tr("The build step was ended forcefully."), OutputFormat::ErrorMessage); + emit addOutput(message, OutputFormat::ErrorMessage); emit finished(false); } } @@ -342,58 +345,11 @@ bool AbstractProcessStep::setupProcessParameters(ProcessParameters *params) cons return true; } -ProcessParameters *AbstractProcessStep::displayedParameters() const -{ - return d->m_displayedParams; -} - void AbstractProcessStep::setDisplayedParameters(ProcessParameters *params) { d->m_displayedParams = params; } -void AbstractProcessStep::Private::cleanUp(int exitCode, QProcess::ExitStatus status) -{ - const QString command = q->displayedParameters()->effectiveCommand().toUserOutput(); - if (status == QProcess::NormalExit && exitCode == 0) { - emit q->addOutput(Tr::tr("The process \"%1\" exited normally.").arg(command), - OutputFormat::NormalMessage); - } else if (status == QProcess::NormalExit) { - emit q->addOutput(Tr::tr("The process \"%1\" exited with code %2.") - .arg(command, QString::number(exitCode)), - OutputFormat::ErrorMessage); - } else { - emit q->addOutput(Tr::tr("The process \"%1\" crashed.").arg(command), - OutputFormat::ErrorMessage); - } - - if (m_process) - m_process.release()->deleteLater(); - const ProcessResult result = (status == QProcess::NormalExit && exitCode == 0 - && !outputFormatter->hasFatalErrors()) - ? ProcessResult::FinishedWithSuccess : ProcessResult::FinishedWithError; - q->finish(result); -} - -/*! - Called if the process could not be started. - - By default, adds a message to the output window. -*/ - -void AbstractProcessStep::processStartupFailed() -{ - ProcessParameters *params = displayedParameters(); - emit addOutput(Tr::tr("Could not start process \"%1\" %2.") - .arg(params->effectiveCommand().toUserOutput(), params->prettyArguments()), - OutputFormat::ErrorMessage); - - const QString err = d->m_process ? d->m_process->errorString() : QString(); - if (!err.isEmpty()) - emit addOutput(err, OutputFormat::ErrorMessage); - finish(ProcessResult::StartFailed); -} - bool AbstractProcessStep::isSuccess(ProcessResult result) const { return result == ProcessResult::FinishedWithSuccess diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index ec0d6a7e803..02923ad2b15 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -54,11 +54,9 @@ protected: void setupProcess(Utils::Process *process); void handleProcessDone(const Utils::Process &process); void runTaskTree(const Tasking::Group &recipe); - ProcessParameters *displayedParameters() const; private: void setupStreams(); - void processStartupFailed(); class Private; Private *d; From 66ecfb15d11ba15a07523b080ce3b4efd6b70324 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 12 Jul 2023 17:21:51 +0200 Subject: [PATCH 0278/1777] Ios: Use aspects more directly in build configurations Change-Id: I1fa9583fccd5bb6a93fcfea9e3977f626b790afb Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/ios/iosbuildconfiguration.cpp | 77 +++++++++++++++-------- src/plugins/ios/iosbuildconfiguration.h | 31 +-------- 2 files changed, 52 insertions(+), 56 deletions(-) diff --git a/src/plugins/ios/iosbuildconfiguration.cpp b/src/plugins/ios/iosbuildconfiguration.cpp index 84b58f53022..d9b1af12f0e 100644 --- a/src/plugins/ios/iosbuildconfiguration.cpp +++ b/src/plugins/ios/iosbuildconfiguration.cpp @@ -367,25 +367,36 @@ void IosSigningSettingsWidget::updateWarningText() m_warningLabel->setText(warningText); } +// IosQmakeBuildConfiguration -// IosBuildConfiguration +class IosQmakeBuildConfiguration : public QmakeProjectManager::QmakeBuildConfiguration +{ +public: + IosQmakeBuildConfiguration(Target *target, Id id); -IosQmakeBuildConfiguration::IosQmakeBuildConfiguration(Target *target, Utils::Id id) +private: + QList<NamedWidget *> createSubConfigWidgets() override; + bool fromMap(const QVariantMap &map) override; + + void updateQmakeCommand(); + + StringAspect m_signingIdentifier{this}; + BoolAspect m_autoManagedSigning{this}; +}; + +IosQmakeBuildConfiguration::IosQmakeBuildConfiguration(Target *target, Id id) : QmakeBuildConfiguration(target, id) { - m_signingIdentifier = addAspect<StringAspect>(); - m_signingIdentifier->setSettingsKey(signingIdentifierKey); + m_signingIdentifier.setSettingsKey(signingIdentifierKey); - m_autoManagedSigning = addAspect<BoolAspect>(); - m_autoManagedSigning->setDefaultValue(true); - m_autoManagedSigning->setValue(true); - m_autoManagedSigning->setSettingsKey(autoManagedSigningKey); + m_autoManagedSigning.setDefaultValue(true); + m_autoManagedSigning.setSettingsKey(autoManagedSigningKey); - connect(m_signingIdentifier, + connect(&m_signingIdentifier, &BaseAspect::changed, this, &IosQmakeBuildConfiguration::updateQmakeCommand); - connect(m_autoManagedSigning, + connect(&m_autoManagedSigning, &BaseAspect::changed, this, &IosQmakeBuildConfiguration::updateQmakeCommand); @@ -397,8 +408,8 @@ QList<NamedWidget *> IosQmakeBuildConfiguration::createSubConfigWidgets() // Ownership of this widget is with BuildSettingsWidget auto buildSettingsWidget = new IosSigningSettingsWidget(this, - m_autoManagedSigning, - m_signingIdentifier); + &m_autoManagedSigning, + &m_signingIdentifier); subConfigWidgets.prepend(buildSettingsWidget); return subConfigWidgets; } @@ -440,13 +451,13 @@ void IosQmakeBuildConfiguration::updateQmakeCommand() }); // Set force ovveride qmake switch - const QString signingIdentifier = m_signingIdentifier->value(); + const QString signingIdentifier = m_signingIdentifier(); if (signingIdentifier.isEmpty() ) extraArgs << forceOverrideArg; Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(kit()); if (devType == Constants::IOS_DEVICE_TYPE && !signingIdentifier.isEmpty()) { - if (m_autoManagedSigning->value()) { + if (m_autoManagedSigning()) { extraArgs << qmakeIosTeamSettings + signingIdentifier; } else { const QString teamId = teamIdForProvisioningProfile(signingIdentifier); @@ -469,22 +480,36 @@ IosQmakeBuildConfigurationFactory::IosQmakeBuildConfigurationFactory() addSupportedTargetDeviceType(Constants::IOS_SIMULATOR_TYPE); } +// IosCMakeBuildConfiguration + +class IosCMakeBuildConfiguration : public CMakeProjectManager::CMakeBuildConfiguration +{ +public: + IosCMakeBuildConfiguration(Target *target, Id id); + +private: + QList<NamedWidget *> createSubConfigWidgets() override; + bool fromMap(const QVariantMap &map) override; + + CMakeProjectManager::CMakeConfig signingFlags() const final; + + StringAspect m_signingIdentifier{this}; + BoolAspect m_autoManagedSigning{this}; +}; + IosCMakeBuildConfiguration::IosCMakeBuildConfiguration(Target *target, Id id) : CMakeBuildConfiguration(target, id) { - m_signingIdentifier = addAspect<StringAspect>(); - m_signingIdentifier->setSettingsKey(signingIdentifierKey); + m_signingIdentifier.setSettingsKey(signingIdentifierKey); - m_autoManagedSigning = addAspect<BoolAspect>(); - m_autoManagedSigning->setDefaultValue(true); - m_autoManagedSigning->setValue(true); - m_autoManagedSigning->setSettingsKey(autoManagedSigningKey); + m_autoManagedSigning.setDefaultValue(true); + m_autoManagedSigning.setSettingsKey(autoManagedSigningKey); - connect(m_signingIdentifier, + connect(&m_signingIdentifier, &BaseAspect::changed, this, &IosCMakeBuildConfiguration::signingFlagsChanged); - connect(m_autoManagedSigning, + connect(&m_autoManagedSigning, &BaseAspect::changed, this, &IosCMakeBuildConfiguration::signingFlagsChanged); @@ -496,8 +521,8 @@ QList<NamedWidget *> IosCMakeBuildConfiguration::createSubConfigWidgets() // Ownership of this widget is with BuildSettingsWidget auto buildSettingsWidget = new IosSigningSettingsWidget(this, - m_autoManagedSigning, - m_signingIdentifier); + &m_autoManagedSigning, + &m_signingIdentifier); subConfigWidgets.prepend(buildSettingsWidget); return subConfigWidgets; } @@ -513,8 +538,8 @@ CMakeConfig IosCMakeBuildConfiguration::signingFlags() const { if (DeviceTypeKitAspect::deviceTypeId(kit()) != Constants::IOS_DEVICE_TYPE) return {}; - const QString signingIdentifier = m_signingIdentifier->value(); - if (m_autoManagedSigning->value()) { + const QString signingIdentifier = m_signingIdentifier(); + if (m_autoManagedSigning()) { const DevelopmentTeams teams = IosConfigurations::developmentTeams(); const QString teamId = signingIdentifier.isEmpty() && !teams.isEmpty() ? teams.first()->identifier() diff --git a/src/plugins/ios/iosbuildconfiguration.h b/src/plugins/ios/iosbuildconfiguration.h index 5549dfef87a..31ed50bdff9 100644 --- a/src/plugins/ios/iosbuildconfiguration.h +++ b/src/plugins/ios/iosbuildconfiguration.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + #pragma once #include <qmakeprojectmanager/qmakebuildconfiguration.h> @@ -7,42 +8,12 @@ namespace Ios::Internal { -class IosQmakeBuildConfiguration : public QmakeProjectManager::QmakeBuildConfiguration -{ -public: - IosQmakeBuildConfiguration(ProjectExplorer::Target *target, Utils::Id id); - -private: - QList<ProjectExplorer::NamedWidget *> createSubConfigWidgets() override; - bool fromMap(const QVariantMap &map) override; - - void updateQmakeCommand(); - - Utils::StringAspect *m_signingIdentifier = nullptr; - Utils::BoolAspect *m_autoManagedSigning = nullptr; -}; - class IosQmakeBuildConfigurationFactory : public QmakeProjectManager::QmakeBuildConfigurationFactory { public: IosQmakeBuildConfigurationFactory(); }; -class IosCMakeBuildConfiguration : public CMakeProjectManager::CMakeBuildConfiguration -{ -public: - IosCMakeBuildConfiguration(ProjectExplorer::Target *target, Utils::Id id); - -private: - QList<ProjectExplorer::NamedWidget *> createSubConfigWidgets() override; - bool fromMap(const QVariantMap &map) override; - - CMakeProjectManager::CMakeConfig signingFlags() const final; - - Utils::StringAspect *m_signingIdentifier = nullptr; - Utils::BoolAspect *m_autoManagedSigning = nullptr; -}; - class IosCMakeBuildConfigurationFactory : public CMakeProjectManager::CMakeBuildConfigurationFactory { public: From b37b94f0e56b93f5d07789e8922dc90b371669c8 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 11 Jul 2023 20:39:42 +0200 Subject: [PATCH 0279/1777] AbstractProcessStep: De-virtualize finish() method Provide a setDoneHook() setter instead. The hook is introduced temporarily, as when all the subclasses are transformed to use the task tree, the done hook is going to be a part of the subclass' recipe. Task-number: QTCREATORBUG-29168 Change-Id: Idbc0f8b8a32c8df2fa5ecb73ed1cbaedad99620d Reviewed-by: hjk <hjk@qt.io> --- src/plugins/android/androidbuildapkstep.cpp | 12 ++-- src/plugins/android/androidbuildapkstep.h | 1 - .../cmakeprojectmanager/cmakebuildstep.cpp | 13 ++-- .../cmakeprojectmanager/cmakebuildstep.h | 1 - .../cmakeprojectmanager/cmakeinstallstep.cpp | 9 +-- .../projectexplorer/abstractprocessstep.cpp | 18 +++--- .../projectexplorer/abstractprocessstep.h | 5 +- .../qmakeprojectmanager/qmakemakestep.cpp | 21 +++---- src/plugins/remotelinux/makeinstallstep.cpp | 62 +++++++++---------- 9 files changed, 62 insertions(+), 80 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index b27730b45b0..27b86144504 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -484,6 +484,11 @@ AndroidBuildApkStep::AndroidBuildApkStep(BuildStepList *parent, Utils::Id id) if (format == OutputFormat::Stderr) stdError(string); }); + + setDoneHook([this](bool success) { + if (m_openPackageLocationForRun && success) + QTimer::singleShot(0, this, &AndroidBuildApkStep::showInGraphicalShell); + }); } bool AndroidBuildApkStep::init() @@ -632,13 +637,6 @@ QWidget *AndroidBuildApkStep::createConfigWidget() return new AndroidBuildApkWidget(this); } -void AndroidBuildApkStep::finish(ProcessResult result) -{ - if (m_openPackageLocationForRun && isSuccess(result)) - QTimer::singleShot(0, this, &AndroidBuildApkStep::showInGraphicalShell); - AbstractProcessStep::finish(result); -} - bool AndroidBuildApkStep::verifyKeystorePassword() { if (!m_keystorePath.exists()) { diff --git a/src/plugins/android/androidbuildapkstep.h b/src/plugins/android/androidbuildapkstep.h index 89ddd208a54..e2c5c376470 100644 --- a/src/plugins/android/androidbuildapkstep.h +++ b/src/plugins/android/androidbuildapkstep.h @@ -63,7 +63,6 @@ private: bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; QWidget *createConfigWidget() override; - void finish(Utils::ProcessResult result) override; bool verifyKeystorePassword(); bool verifyCertificatePassword(); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 67ceb0002a4..be65426d5c3 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -253,6 +253,11 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Id id) : connect(target(), &Target::activeRunConfigurationChanged, this, &CMakeBuildStep::updateBuildTargetsModel); + + setDoneHook([this](bool) { + updateDeploymentData(); + emit progress(100, {}); + }); } QVariantMap CMakeBuildStep::toMap() const @@ -795,14 +800,6 @@ void CMakeBuildStep::updateDeploymentData() buildSystem()->setDeploymentData(deploymentData); } -void CMakeBuildStep::finish(ProcessResult result) -{ - updateDeploymentData(); - - emit progress(100, {}); - AbstractProcessStep::finish(result); -} - // CMakeBuildStepFactory CMakeBuildStepFactory::CMakeBuildStepFactory() diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h index 85ee46d953b..e0f6f15d19c 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h @@ -77,7 +77,6 @@ signals: private: Utils::CommandLine cmakeCommand() const; - void finish(Utils::ProcessResult result) override; bool fromMap(const QVariantMap &map) override; bool init() override; diff --git a/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp b/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp index d62a2edbb7c..63ed8a8bfda 100644 --- a/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp @@ -38,13 +38,12 @@ public: cmakeArguments.setDisplayStyle(StringAspect::LineEditDisplay); setCommandLineProvider([this] { return cmakeCommand(); }); + setDoneHook([this](bool) { emit progress(100, {}); }); } private: CommandLine cmakeCommand() const; - void finish(ProcessResult result) override; - void setupOutputFormatter(OutputFormatter *formatter) override; QWidget *createConfigWidget() override; @@ -83,12 +82,6 @@ CommandLine CMakeInstallStep::cmakeCommand() const return cmd; } -void CMakeInstallStep::finish(ProcessResult result) -{ - emit progress(100, {}); - AbstractProcessStep::finish(result); -} - QWidget *CMakeInstallStep::createConfigWidget() { auto updateDetails = [this] { diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 9e7a2179371..06952b85129 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -82,6 +82,7 @@ public: std::function<CommandLine()> m_commandLineProvider; std::function<FilePath()> m_workingDirectoryProvider; std::function<void(Environment &)> m_environmentModifier; + std::function<void(bool)> m_doneHook; // TODO: Remove me when all subclasses moved to Tasking bool m_ignoreReturnValue = false; bool m_lowPriority = false; std::unique_ptr<QTextDecoder> stdoutStream; @@ -131,6 +132,11 @@ void AbstractProcessStep::setUseEnglishOutput() d->m_environmentModifier = [](Environment &env) { env.setupEnglishOutput(); }; } +void AbstractProcessStep::setDoneHook(const std::function<void(bool)> &doneHook) +{ + d->m_doneHook = doneHook; +} + void AbstractProcessStep::setCommandLineProvider(const std::function<CommandLine()> &provider) { d->m_commandLineProvider = provider; @@ -350,15 +356,13 @@ void AbstractProcessStep::setDisplayedParameters(ProcessParameters *params) d->m_displayedParams = params; } -bool AbstractProcessStep::isSuccess(ProcessResult result) const -{ - return result == ProcessResult::FinishedWithSuccess - || (result == ProcessResult::FinishedWithError && d->m_ignoreReturnValue); -} - void AbstractProcessStep::finish(ProcessResult result) { - emit finished(isSuccess(result)); + const bool success = result == ProcessResult::FinishedWithSuccess + || (result == ProcessResult::FinishedWithError && d->m_ignoreReturnValue); + if (d->m_doneHook) + d->m_doneHook(success); + emit finished(success); } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index 02923ad2b15..e6b11981ee6 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -33,6 +33,7 @@ protected: bool setupProcessParameters(ProcessParameters *params) const; bool ignoreReturnValue() const; void setIgnoreReturnValue(bool b); + void setDoneHook(const std::function<void(bool)> &doneHook); void setCommandLineProvider(const std::function<Utils::CommandLine()> &provider); void setWorkingDirectoryProvider(const std::function<Utils::FilePath()> &provider); void setEnvironmentModifier(const std::function<void(Utils::Environment &)> &modifier); @@ -46,9 +47,6 @@ protected: void doCancel() override; void setLowPriority(); void setDisplayedParameters(ProcessParameters *params); - bool isSuccess(Utils::ProcessResult result) const; - - virtual void finish(Utils::ProcessResult result); bool checkWorkingDirectory(); void setupProcess(Utils::Process *process); @@ -57,6 +55,7 @@ protected: private: void setupStreams(); + void finish(Utils::ProcessResult result); class Private; Private *d; diff --git a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp index 47e6470f602..dccbe73a53c 100644 --- a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp @@ -40,7 +40,6 @@ public: QmakeMakeStep(BuildStepList *bsl, Id id); private: - void finish(ProcessResult result) override; bool init() override; void setupOutputFormatter(OutputFormatter *formatter) override; void doRun() override; @@ -60,6 +59,15 @@ QmakeMakeStep::QmakeMakeStep(BuildStepList *bsl, Id id) setUserArguments("clean"); } supportDisablingForSubdirs(); + + setDoneHook([this](bool success) { + if (!success && !isCanceled() && m_unalignedBuildDir + && settings().warnAgainstUnalignedBuildDir()) { + const QString msg = Tr::tr("The build directory is not at the same level as the source " + "directory, which could be the reason for the build failure."); + emit addTask(BuildSystemTask(Task::Warning, msg)); + } + }); } bool QmakeMakeStep::init() @@ -219,17 +227,6 @@ void QmakeMakeStep::doRun() AbstractProcessStep::doRun(); } -void QmakeMakeStep::finish(ProcessResult result) -{ - if (!isSuccess(result) && !isCanceled() && m_unalignedBuildDir - && settings().warnAgainstUnalignedBuildDir()) { - const QString msg = Tr::tr("The build directory is not at the same level as the source " - "directory, which could be the reason for the build failure."); - emit addTask(BuildSystemTask(Task::Warning, msg)); - } - MakeStep::finish(result); -} - QStringList QmakeMakeStep::displayArguments() const { const auto bc = static_cast<QmakeBuildConfiguration *>(buildConfiguration()); diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 44da4e9d832..2e85a3be162 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -41,7 +41,6 @@ private: bool fromMap(const QVariantMap &map) override; QWidget *createConfigWidget() override; bool init() override; - void finish(ProcessResult result) override; bool isJobCountSupported() const override { return false; } void updateCommandFromAspect(); @@ -132,6 +131,35 @@ MakeInstallStep::MakeInstallStep(BuildStepList *parent, Id id) : MakeStep(parent if (format == OutputFormat::Stderr && string.contains("target 'install'")) m_noInstallTarget = true; }); + + setDoneHook([this](bool success) { + if (success) { + const FilePath rootDir = makeCommand().withNewPath(m_installRoot().path()); // FIXME: Needed? + + m_deploymentData = DeploymentData(); + m_deploymentData.setLocalInstallRoot(rootDir); + + const int startPos = rootDir.path().length(); + + const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(), + [](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); }); + + auto handleFile = [this, &appFileNames, startPos](const FilePath &filePath) { + const DeployableFile::Type type = appFileNames.contains(filePath.fileName()) + ? DeployableFile::TypeExecutable : DeployableFile::TypeNormal; + const QString targetDir = filePath.parentDir().path().mid(startPos); + m_deploymentData.addFile(filePath, targetDir, type); + return IterationPolicy::Continue; + }; + rootDir.iterateDirectory( + handleFile, {{}, QDir::Files | QDir::Hidden, QDirIterator::Subdirectories}); + + buildSystem()->setDeploymentData(m_deploymentData); + } else if (m_noInstallTarget && m_isCmakeProject) { + emit addTask(DeploymentTask(Task::Warning, Tr::tr("You need to add an install statement " + "to your CMakeLists.txt file for deployment to work."))); + } + }); } QWidget *MakeInstallStep::createConfigWidget() @@ -188,38 +216,6 @@ bool MakeInstallStep::init() return true; } -void MakeInstallStep::finish(ProcessResult result) -{ - if (isSuccess(result)) { - const FilePath rootDir = makeCommand().withNewPath(m_installRoot().path()); // FIXME: Needed? - - m_deploymentData = DeploymentData(); - m_deploymentData.setLocalInstallRoot(rootDir); - - const int startPos = rootDir.path().length(); - - const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(), - [](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); }); - - auto handleFile = [this, &appFileNames, startPos](const FilePath &filePath) { - const DeployableFile::Type type = appFileNames.contains(filePath.fileName()) - ? DeployableFile::TypeExecutable - : DeployableFile::TypeNormal; - const QString targetDir = filePath.parentDir().path().mid(startPos); - m_deploymentData.addFile(filePath, targetDir, type); - return IterationPolicy::Continue; - }; - rootDir.iterateDirectory(handleFile, - {{}, QDir::Files | QDir::Hidden, QDirIterator::Subdirectories}); - - buildSystem()->setDeploymentData(m_deploymentData); - } else if (m_noInstallTarget && m_isCmakeProject) { - emit addTask(DeploymentTask(Task::Warning, Tr::tr("You need to add an install statement " - "to your CMakeLists.txt file for deployment to work."))); - } - MakeStep::finish(result); -} - void MakeInstallStep::updateCommandFromAspect() { if (m_customCommand.isChecked()) From f489a3e4d51210c143130cb5141ebeca60f22917 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 13 Jun 2023 12:44:56 +0200 Subject: [PATCH 0280/1777] Meson: Inline mesonbuildsettingswidget file pair into buildconfiguration Less code, leaner header. Change-Id: Ibc018a60434f5dfeb67a7a77192c30e4cefeea96 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../mesonprojectmanager/CMakeLists.txt | 2 - .../mesonbuildconfiguration.cpp | 275 ++++++++++++++++-- .../mesonbuildconfiguration.h | 69 +---- .../mesonbuildsettingswidget.cpp | 167 ----------- .../mesonbuildsettingswidget.h | 34 --- .../mesonprojectmanager.qbs | 2 - 6 files changed, 246 insertions(+), 303 deletions(-) delete mode 100644 src/plugins/mesonprojectmanager/mesonbuildsettingswidget.cpp delete mode 100644 src/plugins/mesonprojectmanager/mesonbuildsettingswidget.h diff --git a/src/plugins/mesonprojectmanager/CMakeLists.txt b/src/plugins/mesonprojectmanager/CMakeLists.txt index d56f77c20e4..2f0d61ad59a 100644 --- a/src/plugins/mesonprojectmanager/CMakeLists.txt +++ b/src/plugins/mesonprojectmanager/CMakeLists.txt @@ -18,8 +18,6 @@ add_qtc_plugin(MesonProjectManager mesonactionsmanager.h mesonbuildconfiguration.cpp mesonbuildconfiguration.h - mesonbuildsettingswidget.cpp - mesonbuildsettingswidget.h mesonbuildsystem.cpp mesonbuildsystem.h mesoninfo.h diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp index 514c529212a..b71d28b1072 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp @@ -3,34 +3,73 @@ #include "mesonbuildconfiguration.h" -#include "mesonbuildsettingswidget.h" +#include "buildoptionsmodel.h" #include "mesonbuildsystem.h" #include "mesonpluginconstants.h" -#include "mesonpluginconstants.h" +#include "mesonprojectmanagertr.h" #include "mesonwrapper.h" #include "ninjabuildstep.h" +#include <coreplugin/find/itemviewfind.h> + +#include <projectexplorer/buildaspects.h> #include <projectexplorer/buildinfo.h> #include <projectexplorer/buildmanager.h> #include <projectexplorer/buildstep.h> #include <projectexplorer/buildsteplist.h> #include <projectexplorer/kit.h> +#include <projectexplorer/namedwidget.h> #include <projectexplorer/project.h> +#include <projectexplorer/projectconfiguration.h> #include <projectexplorer/projectexplorer.h> -#include <utils/fileutils.h> +#include <utils/categorysortfiltermodel.h> +#include <utils/detailswidget.h> +#include <utils/headerviewstretcher.h> +#include <utils/itemviews.h> +#include <utils/layoutbuilder.h> #include <utils/process.h> +#include <utils/progressindicator.h> +#include <utils/utilsicons.h> -#include <QDir> +#include <QLayout> +#include <QPushButton> using namespace ProjectExplorer; using namespace Utils; -namespace MesonProjectManager { -namespace Internal { +namespace MesonProjectManager::Internal { -MesonBuildConfiguration::MesonBuildConfiguration(ProjectExplorer::Target *target, Utils::Id id) - : ProjectExplorer::BuildConfiguration{target, id} +const QHash<QString, MesonBuildType> buildTypesByName = { + {"plain", MesonBuildType::plain}, + {"debug", MesonBuildType::debug}, + {"debugoptimized", MesonBuildType::debugoptimized}, + {"release", MesonBuildType::release}, + {"minsize", MesonBuildType::minsize}, + {"custom", MesonBuildType::custom} + }; + +static MesonBuildType mesonBuildType(const QString &typeName) +{ + return buildTypesByName.value(typeName, MesonBuildType::custom); +} + +static FilePath shadowBuildDirectory(const FilePath &projectFilePath, + const Kit *k, + const QString &bcName, + BuildConfiguration::BuildType buildType) +{ + if (projectFilePath.isEmpty()) + return {}; + + const QString projectName = projectFilePath.parentDir().fileName(); + return MesonBuildConfiguration::buildDirectoryFromTemplate( + Project::projectDirectory(projectFilePath), projectFilePath, + projectName, k, bcName, buildType, "meson"); +} + +MesonBuildConfiguration::MesonBuildConfiguration(ProjectExplorer::Target *target, Id id) + : BuildConfiguration(target, id) { appendInitialBuildStep(Constants::MESON_BUILD_STEP_ID); appendInitialCleanStep(Constants::MESON_BUILD_STEP_ID); @@ -52,19 +91,6 @@ MesonBuildConfiguration::~MesonBuildConfiguration() delete m_buildSystem; } -FilePath MesonBuildConfiguration::shadowBuildDirectory(const FilePath &projectFilePath, - const Kit *k, - const QString &bcName, - BuildConfiguration::BuildType buildType) -{ - if (projectFilePath.isEmpty()) - return {}; - - const QString projectName = projectFilePath.parentDir().fileName(); - return buildDirectoryFromTemplate(Project::projectDirectory(projectFilePath), projectFilePath, - projectName, k, bcName, buildType, "meson"); -} - ProjectExplorer::BuildSystem *MesonBuildConfiguration::buildSystem() const { return m_buildSystem; @@ -89,6 +115,11 @@ void MesonBuildConfiguration::build(const QString &target) mesonBuildStep->setBuildTarget(originalBuildTarget); } +static QString mesonBuildTypeName(MesonBuildType type) +{ + return buildTypesByName.key(type, "custom"); +} + QStringList MesonBuildConfiguration::mesonConfigArgs() { return Utils::ProcessArgs::splitArgs(m_parameters, HostOsInfo::hostOs()) @@ -124,14 +155,196 @@ bool MesonBuildConfiguration::fromMap(const QVariantMap &map) return res; } -ProjectExplorer::NamedWidget *MesonBuildConfiguration::createConfigWidget() +class MesonBuildSettingsWidget : public NamedWidget +{ +public: + explicit MesonBuildSettingsWidget(MesonBuildConfiguration *buildCfg) + : NamedWidget(Tr::tr("Meson")), m_progressIndicator(ProgressIndicatorSize::Large) + { + auto configureButton = new QPushButton(Tr::tr("Apply Configuration Changes")); + configureButton->setEnabled(false); + configureButton->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); + + auto wipeButton = new QPushButton(Tr::tr("Wipe Project")); + wipeButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); + wipeButton->setIcon(Utils::Icons::WARNING.icon()); + wipeButton->setToolTip(Tr::tr("Wipes build directory and reconfigures using previous command " + "line options.\nUseful if build directory is corrupted or when " + "rebuilding with a newer version of Meson.")); + + auto container = new DetailsWidget; + + auto details = new QWidget; + + container->setState(DetailsWidget::NoSummary); + container->setWidget(details); + + auto parametersLineEdit = new QLineEdit; + + auto optionsFilterLineEdit = new FancyLineEdit; + + auto optionsTreeView = new TreeView; + optionsTreeView->setMinimumHeight(300); + optionsTreeView->setFrameShape(QFrame::NoFrame); + optionsTreeView->setSelectionBehavior(QAbstractItemView::SelectItems); + optionsTreeView->setUniformRowHeights(true); + optionsTreeView->setSortingEnabled(true); + + using namespace Layouting; + Column { + noMargin, + Form { + Tr::tr("Parameters:"), parametersLineEdit, br, + buildCfg->buildDirectoryAspect(), br + }, + optionsFilterLineEdit, + optionsTreeView, + }.attachTo(details); + + Column { + noMargin, + container, + Row { configureButton, wipeButton, noMargin } + }.attachTo(this); + + parametersLineEdit->setText(buildCfg->parameters()); + optionsFilterLineEdit->setFiltering(true); + + optionsTreeView->sortByColumn(0, Qt::AscendingOrder); + + QFrame *findWrapper + = Core::ItemViewFind::createSearchableWrapper(optionsTreeView, + Core::ItemViewFind::LightColored); + findWrapper->setFrameStyle(QFrame::StyledPanel); + m_progressIndicator.attachToWidget(findWrapper); + m_progressIndicator.raise(); + m_progressIndicator.hide(); + details->layout()->addWidget(findWrapper); + + m_showProgressTimer.setSingleShot(true); + m_showProgressTimer.setInterval(50); // don't show progress for < 50ms tasks + connect(&m_showProgressTimer, &QTimer::timeout, [this]() { m_progressIndicator.show(); }); + connect(&m_optionsModel, &BuidOptionsModel::configurationChanged, this, [configureButton] { + configureButton->setEnabled(true); + }); + m_optionsFilter.setSourceModel(&m_optionsModel); + m_optionsFilter.setSortRole(Qt::DisplayRole); + m_optionsFilter.setFilterKeyColumn(-1); + + optionsTreeView->setModel(&m_optionsFilter); + optionsTreeView->setItemDelegate(new BuildOptionDelegate{optionsTreeView}); + + MesonBuildSystem *bs = static_cast<MesonBuildSystem *>(buildCfg->buildSystem()); + connect(buildCfg->target(), &ProjectExplorer::Target::parsingFinished, + this, [this, bs, optionsTreeView](bool success) { + if (success) { + m_optionsModel.setConfiguration(bs->buildOptions()); + } else { + m_optionsModel.clear(); + } + optionsTreeView->expandAll(); + optionsTreeView->resizeColumnToContents(0); + optionsTreeView->setEnabled(true); + m_showProgressTimer.stop(); + m_progressIndicator.hide(); + }); + + connect(bs, &MesonBuildSystem::parsingStarted, this, [this, optionsTreeView] { + if (!m_showProgressTimer.isActive()) { + optionsTreeView->setEnabled(false); + m_showProgressTimer.start(); + } + }); + + connect(&m_optionsModel, &BuidOptionsModel::dataChanged, this, [bs, this] { + bs->setMesonConfigArgs(this->m_optionsModel.changesAsMesonArgs()); + }); + + connect(&m_optionsFilter, &QAbstractItemModel::modelReset, this, [optionsTreeView] { + optionsTreeView->expandAll(); + optionsTreeView->resizeColumnToContents(0); + }); + + connect(optionsFilterLineEdit, &QLineEdit::textChanged, &m_optionsFilter, [this](const QString &txt) { + m_optionsFilter.setFilterRegularExpression( + QRegularExpression(QRegularExpression::escape(txt), + QRegularExpression::CaseInsensitiveOption)); + }); + + connect(optionsTreeView, + &Utils::TreeView::activated, + optionsTreeView, + [tree = optionsTreeView](const QModelIndex &idx) { tree->edit(idx); }); + + connect(configureButton, &QPushButton::clicked, [this, bs, configureButton, optionsTreeView] { + optionsTreeView->setEnabled(false); + configureButton->setEnabled(false); + m_showProgressTimer.start(); + bs->configure(); + }); + connect(wipeButton, &QPushButton::clicked, [this, bs, configureButton, optionsTreeView] { + optionsTreeView->setEnabled(false); + configureButton->setEnabled(false); + m_showProgressTimer.start(); + bs->wipe(); + }); + connect(parametersLineEdit, &QLineEdit::editingFinished, this, [ buildCfg, parametersLineEdit] { + buildCfg->setParameters(parametersLineEdit->text()); + }); + bs->triggerParsing(); + } + +private: + BuidOptionsModel m_optionsModel; + CategorySortFilterModel m_optionsFilter; + ProgressIndicator m_progressIndicator; + QTimer m_showProgressTimer; +}; + +NamedWidget *MesonBuildConfiguration::createConfigWidget() { return new MesonBuildSettingsWidget{this}; } -ProjectExplorer::BuildInfo createBuildInfo(MesonBuildType type) +static BuildConfiguration::BuildType buildType(MesonBuildType type) { - ProjectExplorer::BuildInfo bInfo; + switch (type) { + case MesonBuildType::plain: + return BuildConfiguration::Unknown; + case MesonBuildType::debug: + return BuildConfiguration::Debug; + case MesonBuildType::debugoptimized: + return BuildConfiguration::Profile; + case MesonBuildType::release: + return BuildConfiguration::Release; + case MesonBuildType::minsize: + return BuildConfiguration::Release; + default: + return BuildConfiguration::Unknown; + } +} + +static QString mesonBuildTypeDisplayName(MesonBuildType type) +{ + switch (type) { + case MesonBuildType::plain: + return {"Plain"}; + case MesonBuildType::debug: + return {"Debug"}; + case MesonBuildType::debugoptimized: + return {"Debug With Optimizations"}; + case MesonBuildType::release: + return {"Release"}; + case MesonBuildType::minsize: + return {"Minimum Size"}; + default: + return {"Custom"}; + } +} + +BuildInfo createBuildInfo(MesonBuildType type) +{ + BuildInfo bInfo; bInfo.typeName = mesonBuildTypeName(type); bInfo.displayName = mesonBuildTypeDisplayName(type); bInfo.buildType = buildType(type); @@ -148,7 +361,7 @@ MesonBuildConfigurationFactory::MesonBuildConfigurationFactory() QList<ProjectExplorer::BuildInfo> result; Utils::FilePath path = forSetup - ? ProjectExplorer::Project::projectDirectory(projectPath) + ? Project::projectDirectory(projectPath) : projectPath; for (const auto &bType : {MesonBuildType::debug, MesonBuildType::release, @@ -156,16 +369,14 @@ MesonBuildConfigurationFactory::MesonBuildConfigurationFactory() MesonBuildType::minsize}) { auto bInfo = createBuildInfo(bType); if (forSetup) - bInfo.buildDirectory - = MesonBuildConfiguration::shadowBuildDirectory(projectPath, - k, - bInfo.typeName, - bInfo.buildType); + bInfo.buildDirectory = shadowBuildDirectory(projectPath, + k, + bInfo.typeName, + bInfo.buildType); result << bInfo; } return result; }); } -} // namespace Internal -} // namespace MesonProjectManager +} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h index a4059091892..d262c837810 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h +++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h @@ -1,71 +1,15 @@ // Copyright (C) 2020 Alexis Jeandet. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + #pragma once #include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/target.h> -namespace MesonProjectManager { -namespace Internal { +namespace MesonProjectManager::Internal { enum class MesonBuildType { plain, debug, debugoptimized, release, minsize, custom }; -const QHash<QString, MesonBuildType> buildTypesByName = {{"plain", MesonBuildType::plain}, - {"debug", MesonBuildType::debug}, - {"debugoptimized", - MesonBuildType::debugoptimized}, - {"release", MesonBuildType::release}, - {"minsize", MesonBuildType::minsize}, - {"custom", MesonBuildType::custom}}; - -inline QString mesonBuildTypeName(MesonBuildType type) -{ - return buildTypesByName.key(type, "custom"); -} - -inline QString mesonBuildTypeDisplayName(MesonBuildType type) -{ - switch (type) { - case MesonBuildType::plain: - return {"Plain"}; - case MesonBuildType::debug: - return {"Debug"}; - case MesonBuildType::debugoptimized: - return {"Debug With Optimizations"}; - case MesonBuildType::release: - return {"Release"}; - case MesonBuildType::minsize: - return {"Minimum Size"}; - default: - return {"Custom"}; - } -} - -inline MesonBuildType mesonBuildType(const QString &typeName) -{ - return buildTypesByName.value(typeName, MesonBuildType::custom); -} - -inline ProjectExplorer::BuildConfiguration::BuildType buildType(MesonBuildType type) -{ - switch (type) { - case MesonBuildType::plain: - return ProjectExplorer::BuildConfiguration::Unknown; - case MesonBuildType::debug: - return ProjectExplorer::BuildConfiguration::Debug; - case MesonBuildType::debugoptimized: - return ProjectExplorer::BuildConfiguration::Profile; - case MesonBuildType::release: - return ProjectExplorer::BuildConfiguration::Release; - case MesonBuildType::minsize: - return ProjectExplorer::BuildConfiguration::Release; - default: - return ProjectExplorer::BuildConfiguration::Unknown; - } -} - class MesonBuildSystem; -class MesonTools; class MesonBuildConfiguration final : public ProjectExplorer::BuildConfiguration { @@ -74,12 +18,6 @@ public: MesonBuildConfiguration(ProjectExplorer::Target *target, Utils::Id id); ~MesonBuildConfiguration() final; - static Utils::FilePath shadowBuildDirectory( - const Utils::FilePath &projectFilePath, - const ProjectExplorer::Kit *k, - const QString &bcName, - ProjectExplorer::BuildConfiguration::BuildType buildType); - ProjectExplorer::BuildSystem *buildSystem() const final; void build(const QString &target); @@ -106,5 +44,4 @@ public: MesonBuildConfigurationFactory(); }; -} // namespace Internal -} // namespace MesonProjectManager +} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/mesonbuildsettingswidget.cpp b/src/plugins/mesonprojectmanager/mesonbuildsettingswidget.cpp deleted file mode 100644 index 26389d38883..00000000000 --- a/src/plugins/mesonprojectmanager/mesonbuildsettingswidget.cpp +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (C) 2020 Alexis Jeandet. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "mesonbuildsettingswidget.h" - -#include "mesonbuildconfiguration.h" -#include "mesonbuildsystem.h" -#include "mesonprojectmanagertr.h" - -#include <coreplugin/find/itemviewfind.h> - -#include <projectexplorer/buildaspects.h> -#include <projectexplorer/projectconfiguration.h> - -#include <utils/detailswidget.h> -#include <utils/headerviewstretcher.h> -#include <utils/itemviews.h> -#include <utils/layoutbuilder.h> -#include <utils/utilsicons.h> - -#include <QLayout> -#include <QPushButton> - -using namespace Utils; - -namespace MesonProjectManager::Internal { - -MesonBuildSettingsWidget::MesonBuildSettingsWidget(MesonBuildConfiguration *buildCfg) - : ProjectExplorer::NamedWidget(Tr::tr("Meson")) - , m_progressIndicator(ProgressIndicatorSize::Large) -{ - auto configureButton = new QPushButton(Tr::tr("Apply Configuration Changes")); - configureButton->setEnabled(false); - configureButton->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); - - auto wipeButton = new QPushButton(Tr::tr("Wipe Project")); - wipeButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); - wipeButton->setIcon(Utils::Icons::WARNING.icon()); - wipeButton->setToolTip(Tr::tr("Wipes build directory and reconfigures using previous command " - "line options.\nUseful if build directory is corrupted or when " - "rebuilding with a newer version of Meson.")); - - auto container = new DetailsWidget; - - auto details = new QWidget; - - container->setState(DetailsWidget::NoSummary); - container->setWidget(details); - - auto parametersLineEdit = new QLineEdit; - - auto optionsFilterLineEdit = new FancyLineEdit; - - auto optionsTreeView = new TreeView; - optionsTreeView->setMinimumHeight(300); - optionsTreeView->setFrameShape(QFrame::NoFrame); - optionsTreeView->setSelectionBehavior(QAbstractItemView::SelectItems); - optionsTreeView->setUniformRowHeights(true); - optionsTreeView->setSortingEnabled(true); - - using namespace Layouting; - Column { - noMargin, - Form { - Tr::tr("Parameters:"), parametersLineEdit, br, - buildCfg->buildDirectoryAspect(), br - }, - optionsFilterLineEdit, - optionsTreeView, - }.attachTo(details); - - Column { - noMargin, - container, - Row { configureButton, wipeButton, noMargin } - }.attachTo(this); - - parametersLineEdit->setText(buildCfg->parameters()); - optionsFilterLineEdit->setFiltering(true); - - optionsTreeView->sortByColumn(0, Qt::AscendingOrder); - - QFrame *findWrapper - = Core::ItemViewFind::createSearchableWrapper(optionsTreeView, - Core::ItemViewFind::LightColored); - findWrapper->setFrameStyle(QFrame::StyledPanel); - m_progressIndicator.attachToWidget(findWrapper); - m_progressIndicator.raise(); - m_progressIndicator.hide(); - details->layout()->addWidget(findWrapper); - - m_showProgressTimer.setSingleShot(true); - m_showProgressTimer.setInterval(50); // don't show progress for < 50ms tasks - connect(&m_showProgressTimer, &QTimer::timeout, [this]() { m_progressIndicator.show(); }); - connect(&m_optionsModel, &BuidOptionsModel::configurationChanged, this, [configureButton] { - configureButton->setEnabled(true); - }); - m_optionsFilter.setSourceModel(&m_optionsModel); - m_optionsFilter.setSortRole(Qt::DisplayRole); - m_optionsFilter.setFilterKeyColumn(-1); - - optionsTreeView->setModel(&m_optionsFilter); - optionsTreeView->setItemDelegate(new BuildOptionDelegate{optionsTreeView}); - - MesonBuildSystem *bs = static_cast<MesonBuildSystem *>(buildCfg->buildSystem()); - connect(buildCfg->target(), &ProjectExplorer::Target::parsingFinished, - this, [this, bs, optionsTreeView](bool success) { - if (success) { - m_optionsModel.setConfiguration(bs->buildOptions()); - } else { - m_optionsModel.clear(); - } - optionsTreeView->expandAll(); - optionsTreeView->resizeColumnToContents(0); - optionsTreeView->setEnabled(true); - m_showProgressTimer.stop(); - m_progressIndicator.hide(); - }); - - connect(bs, &MesonBuildSystem::parsingStarted, this, [this, optionsTreeView] { - if (!m_showProgressTimer.isActive()) { - optionsTreeView->setEnabled(false); - m_showProgressTimer.start(); - } - }); - - connect(&m_optionsModel, &BuidOptionsModel::dataChanged, this, [bs, this] { - bs->setMesonConfigArgs(this->m_optionsModel.changesAsMesonArgs()); - }); - - connect(&m_optionsFilter, &QAbstractItemModel::modelReset, this, [optionsTreeView] { - optionsTreeView->expandAll(); - optionsTreeView->resizeColumnToContents(0); - }); - - connect(optionsFilterLineEdit, &QLineEdit::textChanged, &m_optionsFilter, [this](const QString &txt) { - m_optionsFilter.setFilterRegularExpression( - QRegularExpression(QRegularExpression::escape(txt), - QRegularExpression::CaseInsensitiveOption)); - }); - - connect(optionsTreeView, - &Utils::TreeView::activated, - optionsTreeView, - [tree = optionsTreeView](const QModelIndex &idx) { tree->edit(idx); }); - - connect(configureButton, &QPushButton::clicked, [this, bs, configureButton, optionsTreeView] { - optionsTreeView->setEnabled(false); - configureButton->setEnabled(false); - m_showProgressTimer.start(); - bs->configure(); - }); - connect(wipeButton, &QPushButton::clicked, [this, bs, configureButton, optionsTreeView] { - optionsTreeView->setEnabled(false); - configureButton->setEnabled(false); - m_showProgressTimer.start(); - bs->wipe(); - }); - connect(parametersLineEdit, &QLineEdit::editingFinished, this, [ buildCfg, parametersLineEdit] { - buildCfg->setParameters(parametersLineEdit->text()); - }); - bs->triggerParsing(); -} - -MesonBuildSettingsWidget::~MesonBuildSettingsWidget() = default; - -} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/mesonbuildsettingswidget.h b/src/plugins/mesonprojectmanager/mesonbuildsettingswidget.h deleted file mode 100644 index 8c3f89d9518..00000000000 --- a/src/plugins/mesonprojectmanager/mesonbuildsettingswidget.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2020 Alexis Jeandet. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "buildoptionsmodel.h" - -#include <projectexplorer/namedwidget.h> - -#include <utils/categorysortfiltermodel.h> -#include <utils/progressindicator.h> - -#include <QTimer> - -namespace MesonProjectManager::Internal { - -class MesonBuildConfiguration; - -class MesonBuildSettingsWidget : public ProjectExplorer::NamedWidget -{ - Q_OBJECT - -public: - explicit MesonBuildSettingsWidget(MesonBuildConfiguration *buildCfg); - ~MesonBuildSettingsWidget(); - -private: - BuidOptionsModel m_optionsModel; - Utils::CategorySortFilterModel m_optionsFilter; - Utils::ProgressIndicator m_progressIndicator; - QTimer m_showProgressTimer; -}; - -} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs index 552029cf639..db81d16f1a7 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs +++ b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs @@ -42,8 +42,6 @@ Project { "mesonpluginconstants.h", "mesonprojectplugin.cpp", "mesonprojectplugin.h", - "mesonbuildsettingswidget.cpp", - "mesonbuildsettingswidget.h", "arrayoptionlineedit.cpp", "arrayoptionlineedit.h", "buildoptionsmodel.cpp", From 3093142a705da40d0cc92a83c1341b160e9a4445 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 11 Jul 2023 21:20:24 +0200 Subject: [PATCH 0281/1777] AbstractProcessStep: Pass reference to the setupProcess() Conform to the handleProcessDone() and the task tree interface. Task-number: QTCREATORBUG-29168 Change-Id: I25394a877a86434ea5ac26cd85fe50640e55db11 Reviewed-by: hjk <hjk@qt.io> --- .../projectexplorer/abstractprocessstep.cpp | 26 +++++++++---------- .../projectexplorer/abstractprocessstep.h | 2 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 4 +-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 06952b85129..7377128ccb6 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -191,7 +191,7 @@ void AbstractProcessStep::doRun() setupStreams(); d->m_process.reset(new Process); - setupProcess(d->m_process.get()); + setupProcess(*d->m_process.get()); connect(d->m_process.get(), &Process::done, this, [this] { handleProcessDone(*d->m_process); const ProcessResult result = d->outputFormatter->hasFatalErrors() @@ -223,30 +223,30 @@ void AbstractProcessStep::setupStreams() d->stderrStream = std::make_unique<QTextDecoder>(QTextCodec::codecForLocale()); } -void AbstractProcessStep::setupProcess(Process *process) +void AbstractProcessStep::setupProcess(Process &process) { - process->setUseCtrlCStub(HostOsInfo::isWindowsHost()); - process->setWorkingDirectory(d->m_param.effectiveWorkingDirectory()); + process.setUseCtrlCStub(HostOsInfo::isWindowsHost()); + process.setWorkingDirectory(d->m_param.effectiveWorkingDirectory()); // Enforce PWD in the environment because some build tools use that. // PWD can be different from getcwd in case of symbolic links (getcwd resolves symlinks). // For example Clang uses PWD for paths in debug info, see QTCREATORBUG-23788 Environment envWithPwd = d->m_param.environment(); - envWithPwd.set("PWD", process->workingDirectory().path()); - process->setEnvironment(envWithPwd); - process->setCommand({d->m_param.effectiveCommand(), d->m_param.effectiveArguments(), + envWithPwd.set("PWD", process.workingDirectory().path()); + process.setEnvironment(envWithPwd); + process.setCommand({d->m_param.effectiveCommand(), d->m_param.effectiveArguments(), CommandLine::Raw}); if (d->m_lowPriority && ProjectExplorerPlugin::projectExplorerSettings().lowBuildPriority) - process->setLowPriority(); + process.setLowPriority(); - connect(process, &Process::readyReadStandardOutput, this, [this, process] { - emit addOutput(d->stdoutStream->toUnicode(process->readAllRawStandardOutput()), + connect(&process, &Process::readyReadStandardOutput, this, [this, &process] { + emit addOutput(d->stdoutStream->toUnicode(process.readAllRawStandardOutput()), OutputFormat::Stdout, DontAppendNewline); }); - connect(process, &Process::readyReadStandardError, this, [this, process] { - emit addOutput(d->stderrStream->toUnicode(process->readAllRawStandardError()), + connect(&process, &Process::readyReadStandardError, this, [this, &process] { + emit addOutput(d->stderrStream->toUnicode(process.readAllRawStandardError()), OutputFormat::Stderr, DontAppendNewline); }); - connect(process, &Process::started, this, [this] { + connect(&process, &Process::started, this, [this] { ProcessParameters *params = d->m_displayedParams; emit addOutput(Tr::tr("Starting: \"%1\" %2") .arg(params->effectiveCommand().toUserOutput(), params->prettyArguments()), diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index e6b11981ee6..38c507e7ead 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -49,7 +49,7 @@ protected: void setDisplayedParameters(ProcessParameters *params); bool checkWorkingDirectory(); - void setupProcess(Utils::Process *process); + void setupProcess(Utils::Process &process); void handleProcessDone(const Utils::Process &process); void runTaskTree(const Tasking::Group &recipe); diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 292a6439dff..6df042d8d39 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -287,7 +287,7 @@ void QMakeStep::doRun() m_outputFormatter->setLineParsers({new QMakeParser}); ProcessParameters *pp = processParameters(); pp->setCommandLine(m_qmakeCommand); - setupProcess(&process); + setupProcess(process); }; const auto setupMakeQMake = [this](Process &process) { @@ -296,7 +296,7 @@ void QMakeStep::doRun() m_outputFormatter->setLineParsers({parser}); ProcessParameters *pp = processParameters(); pp->setCommandLine(m_makeCommand); - setupProcess(&process); + setupProcess(process); }; const auto onProcessDone = [this](const Process &process) { handleProcessDone(process); }; From fdc834c0d1a3476e491d6e2050d9927fb1f5ddc9 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Wed, 12 Jul 2023 13:03:20 +0200 Subject: [PATCH 0282/1777] CPlusPlus: Remove TranslationUnit::getTokenStartPosition() It was exactly the same as getTokenPosition(). Change-Id: I292522faa18933ec400b556c384786eb9efdfb3a Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/3rdparty/cplusplus/TranslationUnit.cpp | 12 +++--------- src/libs/3rdparty/cplusplus/TranslationUnit.h | 14 +++----------- src/libs/qmljs/qmljsfindexportedcpptypes.cpp | 14 +++++++------- src/plugins/autotest/gtest/gtestvisitors.cpp | 2 +- src/plugins/autotest/qtest/qttestvisitors.cpp | 2 +- .../cppeditor/cppfollowsymbolundercursor.cpp | 2 +- src/plugins/cppeditor/cppquickfixes.cpp | 2 +- src/plugins/cppeditor/cpprefactoringchanges.cpp | 2 +- src/plugins/cppeditor/cppselectionchanger.cpp | 4 ++-- src/plugins/cppeditor/insertionpointlocator.cpp | 12 ++++++------ .../cplusplus-update-frontend.cpp | 4 ++-- 11 files changed, 28 insertions(+), 42 deletions(-) diff --git a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp index 62f4c570c79..d5c7a5fc9b8 100644 --- a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp +++ b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp @@ -379,12 +379,6 @@ int TranslationUnit::findColumnNumber(int utf16CharOffset, int lineNumber) const return utf16CharOffset - _lineOffsets[lineNumber]; } -void TranslationUnit::getTokenPosition(int index, - int *line, - int *column, - const StringLiteral **fileName) const -{ return getPosition(tokenAt(index).utf16charsBegin(), line, column, fileName); } - int TranslationUnit::getTokenPositionInDocument(int index, const QTextDocument *doc) const { int line, column; @@ -399,9 +393,9 @@ int TranslationUnit::getTokenEndPositionInDocument(int index, const QTextDocumen return Utils::Text::positionInText(doc, line, column); } -void TranslationUnit::getTokenStartPosition(int index, int *line, - int *column, - const StringLiteral **fileName) const +void TranslationUnit::getTokenPosition(int index, int *line, + int *column, + const StringLiteral **fileName) const { return getPosition(tokenAt(index).utf16charsBegin(), line, column, fileName); } void TranslationUnit::getTokenEndPosition(int index, int *line, diff --git a/src/libs/3rdparty/cplusplus/TranslationUnit.h b/src/libs/3rdparty/cplusplus/TranslationUnit.h index 9694177a752..9ae01755fb5 100644 --- a/src/libs/3rdparty/cplusplus/TranslationUnit.h +++ b/src/libs/3rdparty/cplusplus/TranslationUnit.h @@ -110,24 +110,16 @@ public: void resetAST(); void release(); - void getTokenStartPosition(int index, int *line, - int *column = nullptr, - const StringLiteral **fileName = nullptr) const; - + void getTokenPosition(int index, int *line, + int *column = nullptr, + const StringLiteral **fileName = nullptr) const; void getTokenEndPosition(int index, int *line, int *column = nullptr, const StringLiteral **fileName = nullptr) const; - void getPosition(int utf16charOffset, int *line, int *column = nullptr, const StringLiteral **fileName = nullptr) const; - - void getTokenPosition(int index, - int *line, - int *column = nullptr, - const StringLiteral **fileName = nullptr) const; - int getTokenPositionInDocument(int index, const QTextDocument *doc) const; int getTokenEndPositionInDocument(int index, const QTextDocument *doc) const; diff --git a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp index 7716e77ed5a..e3c5cb6fc76 100644 --- a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp +++ b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp @@ -247,7 +247,7 @@ protected: nameLit = translationUnit()->stringLiteral(nameAst->literal_token); if (!nameLit) { int line, column; - translationUnit()->getTokenStartPosition(nameExp->firstToken(), &line, &column); + translationUnit()->getTokenPosition(nameExp->firstToken(), &line, &column); _messages += Document::DiagnosticMessage( Document::DiagnosticMessage::Warning, _doc->filePath(), @@ -308,7 +308,7 @@ protected: if (packageName.isEmpty()) { packageName = QmlJS::CppQmlTypes::defaultPackage; int line, column; - translationUnit()->getTokenStartPosition(ast->firstToken(), &line, &column); + translationUnit()->getTokenPosition(ast->firstToken(), &line, &column); _messages += Document::DiagnosticMessage( Document::DiagnosticMessage::Warning, _doc->filePath(), @@ -346,7 +346,7 @@ protected: // we want to do lookup later, so also store the surrounding scope int line, column; - translationUnit()->getTokenStartPosition(ast->firstToken(), &line, &column); + translationUnit()->getTokenPosition(ast->firstToken(), &line, &column); exportedType.scope = _doc->scopeAt(line, column); if (typeId){ @@ -490,7 +490,7 @@ protected: nameLit = translationUnit()->stringLiteral(nameAst->literal_token); if (!nameLit) { int line, column; - translationUnit()->getTokenStartPosition(ast->expression_list->value->firstToken(), &line, &column); + translationUnit()->getTokenPosition(ast->expression_list->value->firstToken(), &line, &column); _messages += Document::DiagnosticMessage( Document::DiagnosticMessage::Warning, _doc->filePath(), @@ -504,9 +504,9 @@ protected: contextProperty.name = QString::fromUtf8(nameLit->chars(), nameLit->size()); contextProperty.expression = stringOf(skipQVariant(ast->expression_list->next->value, translationUnit())); // we want to do lookup later, so also store the line and column of the target scope - translationUnit()->getTokenStartPosition(ast->firstToken(), - &contextProperty.line, - &contextProperty.column); + translationUnit()->getTokenPosition(ast->firstToken(), + &contextProperty.line, + &contextProperty.column); _contextProperties += contextProperty; diff --git a/src/plugins/autotest/gtest/gtestvisitors.cpp b/src/plugins/autotest/gtest/gtestvisitors.cpp index ea7f89863b3..9e9315a518d 100644 --- a/src/plugins/autotest/gtest/gtestvisitors.cpp +++ b/src/plugins/autotest/gtest/gtestvisitors.cpp @@ -91,7 +91,7 @@ bool GTestVisitor::visit(CPlusPlus::FunctionDefinitionAST *ast) int line = 0; int column = 0; unsigned token = id->firstToken(); - m_document->translationUnit()->getTokenStartPosition(token, &line, &column); + m_document->translationUnit()->getTokenPosition(token, &line, &column); GTestCodeLocationAndType locationAndType; locationAndType.m_name = testCaseName; diff --git a/src/plugins/autotest/qtest/qttestvisitors.cpp b/src/plugins/autotest/qtest/qttestvisitors.cpp index 318691db94f..51f62febb00 100644 --- a/src/plugins/autotest/qtest/qttestvisitors.cpp +++ b/src/plugins/autotest/qtest/qttestvisitors.cpp @@ -218,7 +218,7 @@ bool TestDataFunctionVisitor::visit(CallAST *ast) return true; int line = 0; int column = 0; - m_currentDoc->translationUnit()->getTokenStartPosition( + m_currentDoc->translationUnit()->getTokenPosition( firstToken, &line, &column); QtTestCodeLocationAndType locationAndType; locationAndType.m_name = name; diff --git a/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp b/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp index 862866e01c5..f61f0276410 100644 --- a/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp +++ b/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp @@ -342,7 +342,7 @@ Link attemptDeclDef(const QTextCursor &cursor, Snapshot snapshot, result = target->toLink(); int startLine, startColumn, endLine, endColumn; - document->translationUnit()->getTokenStartPosition(name->firstToken(), &startLine, + document->translationUnit()->getTokenPosition(name->firstToken(), &startLine, &startColumn); document->translationUnit()->getTokenEndPosition(name->lastToken() - 1, &endLine, &endColumn); diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 9786083f6f8..176a03fb4b5 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -1941,7 +1941,7 @@ LookupResult lookUpDefinition(const CppQuickFixInterface &interface, const NameA // Find the enclosing scope int line, column; const Document::Ptr doc = interface.semanticInfo().doc; - doc->translationUnit()->getTokenStartPosition(nameAst->firstToken(), &line, &column); + doc->translationUnit()->getTokenPosition(nameAst->firstToken(), &line, &column); Scope *scope = doc->scopeAt(line, column); if (!scope) return LookupResult::NotDeclared; diff --git a/src/plugins/cppeditor/cpprefactoringchanges.cpp b/src/plugins/cppeditor/cpprefactoringchanges.cpp index 98eaaa8febb..9ed1fc284cf 100644 --- a/src/plugins/cppeditor/cpprefactoringchanges.cpp +++ b/src/plugins/cppeditor/cpprefactoringchanges.cpp @@ -112,7 +112,7 @@ void CppRefactoringFile::setCppDocument(Document::Ptr document) Scope *CppRefactoringFile::scopeAt(unsigned index) const { int line, column; - cppDocument()->translationUnit()->getTokenStartPosition(index, &line, &column); + cppDocument()->translationUnit()->getTokenPosition(index, &line, &column); return cppDocument()->scopeAt(line, column); } diff --git a/src/plugins/cppeditor/cppselectionchanger.cpp b/src/plugins/cppeditor/cppselectionchanger.cpp index cd199856925..7b9f6767451 100644 --- a/src/plugins/cppeditor/cppselectionchanger.cpp +++ b/src/plugins/cppeditor/cppselectionchanger.cpp @@ -114,7 +114,7 @@ int CppSelectionChanger::getTokenStartCursorPosition( const QTextCursor &cursor) const { int startLine, startColumn; - m_unit->getTokenStartPosition(tokenIndex, &startLine, &startColumn); + m_unit->getTokenPosition(tokenIndex, &startLine, &startColumn); const QTextDocument *document = cursor.document(); const int startPosition = document->findBlockByNumber(startLine - 1).position() @@ -144,7 +144,7 @@ void CppSelectionChanger::printTokenDebugInfo( { int line, column; const Token token = m_unit->tokenAt(tokenIndex); - m_unit->getTokenStartPosition(tokenIndex, &line, &column); + m_unit->getTokenPosition(tokenIndex, &line, &column); const int startPos = getTokenStartCursorPosition(tokenIndex, cursor); const int endPos = getTokenEndCursorPosition(tokenIndex, cursor); diff --git a/src/plugins/cppeditor/insertionpointlocator.cpp b/src/plugins/cppeditor/insertionpointlocator.cpp index ece52aa559a..3eb1d4aebe3 100644 --- a/src/plugins/cppeditor/insertionpointlocator.cpp +++ b/src/plugins/cppeditor/insertionpointlocator.cpp @@ -292,7 +292,7 @@ InsertionLocation InsertionPointLocator::methodDeclarationInClass(const Translat int line = 0, column = 0; if (pos == InsertionPointLocator::AccessSpecEnd) - tu->getTokenStartPosition(beforeToken, &line, &column); + tu->getTokenPosition(beforeToken, &line, &column); else tu->getTokenEndPosition(beforeToken, &line, &column); @@ -436,7 +436,7 @@ public: } if (lastToken == _bestToken.get()) // No matching namespace found - translationUnit()->getTokenStartPosition(lastToken, line, column); + translationUnit()->getTokenPosition(lastToken, line, column); else // Insert at end of matching namespace translationUnit()->getTokenEndPosition(_bestToken.get(), line, column); } @@ -497,7 +497,7 @@ protected: if (_result) return false; int line, column; - translationUnit()->getTokenStartPosition(ast->firstToken(), &line, &column); + translationUnit()->getTokenPosition(ast->firstToken(), &line, &column); if (line > _line || (line == _line && column > _column)) return false; translationUnit()->getTokenEndPosition(ast->lastToken() - 1, &line, &column); @@ -608,12 +608,12 @@ static InsertionLocation nextToSurroundingDefinitions(Symbol *declaration, if (!functionDefinition) return noResult; - targetFile->cppDocument()->translationUnit()->getTokenStartPosition(functionDefinition->firstToken(), &line, &column); + targetFile->cppDocument()->translationUnit()->getTokenPosition(functionDefinition->firstToken(), &line, &column); const QList<AST *> path = ASTPath(targetFile->cppDocument())(line, column); for (auto it = path.rbegin(); it != path.rend(); ++it) { if (const auto templateDecl = (*it)->asTemplateDeclaration()) { if (templateDecl->declaration == functionDefinition) { - targetFile->cppDocument()->translationUnit()->getTokenStartPosition( + targetFile->cppDocument()->translationUnit()->getTokenPosition( templateDecl->firstToken(), &line, &column); } break; @@ -779,7 +779,7 @@ InsertionLocation insertLocationForMethodDefinition(Symbol *symbol, int lastLine; if (hasIncludeGuard) { const TranslationUnit * const tu = file->cppDocument()->translationUnit(); - tu->getTokenStartPosition(tu->ast()->lastToken(), &lastLine); + tu->getTokenPosition(tu->ast()->lastToken(), &lastLine); } int i = 0; for ( ; i < list.count(); ++i) { diff --git a/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp b/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp index 9661081091b..71b4221872a 100644 --- a/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp +++ b/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp @@ -126,7 +126,7 @@ static ASTNodes astNodes; static QTextCursor createCursor(TranslationUnit *unit, AST *ast, QTextDocument *document) { int startLine, startColumn, endLine, endColumn; - unit->getTokenStartPosition(ast->firstToken(), &startLine, &startColumn); + unit->getTokenPosition(ast->firstToken(), &startLine, &startColumn); unit->getTokenEndPosition(ast->lastToken() - 1, &endLine, &endColumn); QTextCursor tc(document); @@ -1058,7 +1058,7 @@ void generateAST_cpp(const Snapshot &snapshot, const QDir &cplusplusDir) QTextCursor cursor(&cpp_document); int line = 0, column = 0; - AST_cpp_document->translationUnit()->getTokenStartPosition(funDef->firstToken(), &line, &column); + AST_cpp_document->translationUnit()->getTokenPosition(funDef->firstToken(), &line, &column); const int start = cpp_document.findBlockByNumber(line - 1).position() + column - 1; cursor.setPosition(start); int doxyStart = start; From ec92d47103733e66bd852e5322f948d45a525384 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 13 Jun 2023 10:56:40 +0200 Subject: [PATCH 0283/1777] Meson: Inline MesonBuildSystem::init() into ctor Change-Id: I94c33f824dcbdf97562ecf1353fb83dcf726f040 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../mesonprojectmanager/mesonbuildsystem.cpp | 114 ++++++++---------- .../mesonprojectmanager/mesonbuildsystem.h | 3 - .../mesonprojectmanager/mesonprojectnodes.cpp | 2 +- 3 files changed, 52 insertions(+), 67 deletions(-) diff --git a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp index 16b18293e3e..f7a6ea59b8b 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp @@ -3,7 +3,6 @@ #include "mesonbuildsystem.h" -#include "kithelper.h" #include "kitdata.h" #include "kithelper.h" #include "mesonbuildconfiguration.h" @@ -11,25 +10,23 @@ #include "mesontoolkitaspect.h" #include "settings.h" -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/taskhub.h> - -#include <qtsupport/qtcppkitinfo.h> -#include <qtsupport/qtkitinformation.h> - #include <coreplugin/icore.h> +#include <projectexplorer/buildconfiguration.h> #include <projectexplorer/kitinformation.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/taskhub.h> #include <projectexplorer/toolchain.h> +#include <qtsupport/qtcppkitinfo.h> +#include <qtsupport/qtkitinformation.h> + #include <utils/macroexpander.h> #include <utils/qtcassert.h> #include <optional> -#include <QDir> #include <QLoggingCategory> #define LEAVE_IF_BUSY() \ @@ -179,10 +176,45 @@ void MachineFileManager::cleanupMachineFiles() // MesonBuildSystem MesonBuildSystem::MesonBuildSystem(MesonBuildConfiguration *bc) - : BuildSystem{bc} - , m_parser{MesonToolKitAspect::mesonToolId(bc->kit()), bc->environment(), project()} + : BuildSystem(bc) + , m_parser(MesonToolKitAspect::mesonToolId(bc->kit()), bc->environment(), project()) { - init(); + qCDebug(mesonBuildSystemLog) << "Init"; + connect(bc->target(), &ProjectExplorer::Target::kitChanged, this, [this] { + updateKit(kit()); + }); + connect(bc, &MesonBuildConfiguration::buildDirectoryChanged, this, [this] { + updateKit(kit()); + this->triggerParsing(); + }); + connect(bc, &MesonBuildConfiguration::parametersChanged, this, [this] { + updateKit(kit()); + wipe(); + }); + connect(bc, &MesonBuildConfiguration::environmentChanged, this, [this] { + m_parser.setEnvironment(buildConfiguration()->environment()); + }); + + connect(project(), &ProjectExplorer::Project::projectFileIsDirty, this, [this] { + if (buildConfiguration()->isActive()) + parseProject(); + }); + connect(&m_parser, &MesonProjectParser::parsingCompleted, this, &MesonBuildSystem::parsingCompleted); + + connect(&m_IntroWatcher, &Utils::FileSystemWatcher::fileChanged, this, [this] { + if (buildConfiguration()->isActive()) + parseProject(); + }); + + updateKit(kit()); + // as specified here https://mesonbuild.com/IDE-integration.html#ide-integration + // meson-info.json is the last written file, which ensure that all others introspection + // files are ready when a modification is detected on this one. + m_IntroWatcher.addFile(buildConfiguration() + ->buildDirectory() + .pathAppended(Constants::MESON_INFO_DIR) + .pathAppended(Constants::MESON_INFO), + Utils::FileSystemWatcher::WatchModifiedDate); } MesonBuildSystem::~MesonBuildSystem() @@ -230,14 +262,15 @@ void MesonBuildSystem::parsingCompleted(bool success) QStringList MesonBuildSystem::configArgs(bool isSetup) { - const QString ¶ms = mesonBuildConfiguration()->parameters(); + MesonBuildConfiguration *bc = static_cast<MesonBuildConfiguration *>(buildConfiguration()); + + const QString ¶ms = bc->parameters(); if (!isSetup || params.contains("--cross-file") || params.contains("--native-file")) - return m_pendingConfigArgs + mesonBuildConfiguration()->mesonConfigArgs(); - else { - return QStringList{ - QString("--native-file=%1").arg(MachineFileManager::machineFile(kit()).toString())} - + m_pendingConfigArgs + mesonBuildConfiguration()->mesonConfigArgs(); - } + return m_pendingConfigArgs + bc->mesonConfigArgs(); + + return QStringList{ + QString("--native-file=%1").arg(MachineFileManager::machineFile(kit()).toString())} + + m_pendingConfigArgs + bc->mesonConfigArgs(); } bool MesonBuildSystem::configure() @@ -278,51 +311,6 @@ bool MesonBuildSystem::wipe() return false; } -MesonBuildConfiguration *MesonBuildSystem::mesonBuildConfiguration() -{ - return static_cast<MesonBuildConfiguration *>(buildConfiguration()); -} - -void MesonBuildSystem::init() -{ - qCDebug(mesonBuildSystemLog) << "Init"; - connect(buildConfiguration()->target(), &ProjectExplorer::Target::kitChanged, this, [this] { - updateKit(kit()); - }); - connect(mesonBuildConfiguration(), &MesonBuildConfiguration::buildDirectoryChanged, this, [this]() { - updateKit(kit()); - this->triggerParsing(); - }); - connect(mesonBuildConfiguration(), &MesonBuildConfiguration::parametersChanged, this, [this]() { - updateKit(kit()); - wipe(); - }); - connect(mesonBuildConfiguration(), &MesonBuildConfiguration::environmentChanged, this, [this]() { - m_parser.setEnvironment(buildConfiguration()->environment()); - }); - - connect(project(), &ProjectExplorer::Project::projectFileIsDirty, this, [this]() { - if (buildConfiguration()->isActive()) - parseProject(); - }); - connect(&m_parser, &MesonProjectParser::parsingCompleted, this, &MesonBuildSystem::parsingCompleted); - - connect(&m_IntroWatcher, &Utils::FileSystemWatcher::fileChanged, this, [this]() { - if (buildConfiguration()->isActive()) - parseProject(); - }); - - updateKit(kit()); - // as specified here https://mesonbuild.com/IDE-integration.html#ide-integration - // meson-info.json is the last written file, which ensure that all others introspection - // files are ready when a modification is detected on this one. - m_IntroWatcher.addFile(buildConfiguration() - ->buildDirectory() - .pathAppended(Constants::MESON_INFO_DIR) - .pathAppended(Constants::MESON_INFO), - Utils::FileSystemWatcher::WatchModifiedDate); -} - bool MesonBuildSystem::parseProject() { QTC_ASSERT(buildConfiguration(), return false); diff --git a/src/plugins/mesonprojectmanager/mesonbuildsystem.h b/src/plugins/mesonprojectmanager/mesonbuildsystem.h index 5381df9a0d8..b07d5aba4ce 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildsystem.h +++ b/src/plugins/mesonprojectmanager/mesonbuildsystem.h @@ -49,14 +49,11 @@ public: bool setup(); bool wipe(); - MesonBuildConfiguration *mesonBuildConfiguration(); - const QStringList &targetList() const { return m_parser.targetsNames(); } void setMesonConfigArgs(const QStringList &args) { m_pendingConfigArgs = args; } private: - void init(); bool parseProject(); void updateKit(ProjectExplorer::Kit *kit); bool needsSetup(); diff --git a/src/plugins/mesonprojectmanager/mesonprojectnodes.cpp b/src/plugins/mesonprojectmanager/mesonprojectnodes.cpp index d034e381be0..4e842d30376 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectnodes.cpp +++ b/src/plugins/mesonprojectmanager/mesonprojectnodes.cpp @@ -46,7 +46,7 @@ void MesonTargetNode::build() Project *p = getProject(); ProjectExplorer::Target *t = p ? p->activeTarget() : nullptr; if (t) - static_cast<MesonBuildSystem *>(t->buildSystem())->mesonBuildConfiguration()->build(m_name); + static_cast<MesonBuildConfiguration *>(t->buildSystem()->buildConfiguration())->build(m_name); } QString MesonTargetNode::tooltip() const From 5385f84d55734caa6792cfa6e5316f812559b505 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 11 Jul 2023 22:19:23 +0200 Subject: [PATCH 0284/1777] AbstractProcessStep: Make checkWorkingDirectory a part of setupProcess Task-number: QTCREATORBUG-29168 Change-Id: I5cfedc83a3817c64c67c9797c831084c26f1cab9 Reviewed-by: hjk <hjk@qt.io> --- .../projectexplorer/abstractprocessstep.cpp | 36 ++++++++----------- .../projectexplorer/abstractprocessstep.h | 3 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 7 ++-- 3 files changed, 18 insertions(+), 28 deletions(-) diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 7377128ccb6..71400786de6 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -177,9 +177,6 @@ void AbstractProcessStep::setupOutputFormatter(OutputFormatter *formatter) void AbstractProcessStep::doRun() { - if (!checkWorkingDirectory()) - return; - if (!d->m_param.effectiveCommand().isExecutableFile()) { emit addOutput(Tr::tr("The program \"%1\" does not exist or is not executable.") .arg(d->m_displayedParams->effectiveCommand().toUserOutput()), @@ -191,7 +188,11 @@ void AbstractProcessStep::doRun() setupStreams(); d->m_process.reset(new Process); - setupProcess(*d->m_process.get()); + if (!setupProcess(*d->m_process.get())) { + d->m_process.reset(); + finish(ProcessResult::StartFailed); + return; + } connect(d->m_process.get(), &Process::done, this, [this] { handleProcessDone(*d->m_process); const ProcessResult result = d->outputFormatter->hasFatalErrors() @@ -202,20 +203,6 @@ void AbstractProcessStep::doRun() d->m_process->start(); } -bool AbstractProcessStep::checkWorkingDirectory() -{ - const FilePath wd = d->m_param.effectiveWorkingDirectory(); - if (!wd.exists()) { - if (!wd.createDir()) { - emit addOutput(Tr::tr("Could not create directory \"%1\"").arg(wd.toUserOutput()), - OutputFormat::ErrorMessage); - finish(ProcessResult::StartFailed); - return false; - } - } - return true; -} - void AbstractProcessStep::setupStreams() { d->stdoutStream = std::make_unique<QTextDecoder>(buildEnvironment().hasKey("VSLANG") @@ -223,15 +210,21 @@ void AbstractProcessStep::setupStreams() d->stderrStream = std::make_unique<QTextDecoder>(QTextCodec::codecForLocale()); } -void AbstractProcessStep::setupProcess(Process &process) +bool AbstractProcessStep::setupProcess(Process &process) { + const FilePath workingDir = d->m_param.effectiveWorkingDirectory(); + if (!workingDir.exists() && !workingDir.createDir()) { + emit addOutput(Tr::tr("Could not create directory \"%1\"").arg(workingDir.toUserOutput()), + OutputFormat::ErrorMessage); + return false; + } process.setUseCtrlCStub(HostOsInfo::isWindowsHost()); - process.setWorkingDirectory(d->m_param.effectiveWorkingDirectory()); + process.setWorkingDirectory(workingDir); // Enforce PWD in the environment because some build tools use that. // PWD can be different from getcwd in case of symbolic links (getcwd resolves symlinks). // For example Clang uses PWD for paths in debug info, see QTCREATORBUG-23788 Environment envWithPwd = d->m_param.environment(); - envWithPwd.set("PWD", process.workingDirectory().path()); + envWithPwd.set("PWD", workingDir.path()); process.setEnvironment(envWithPwd); process.setCommand({d->m_param.effectiveCommand(), d->m_param.effectiveArguments(), CommandLine::Raw}); @@ -252,6 +245,7 @@ void AbstractProcessStep::setupProcess(Process &process) .arg(params->effectiveCommand().toUserOutput(), params->prettyArguments()), OutputFormat::NormalMessage); }); + return true; } void AbstractProcessStep::handleProcessDone(const Process &process) diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index 38c507e7ead..6c4a9c50715 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -48,8 +48,7 @@ protected: void setLowPriority(); void setDisplayedParameters(ProcessParameters *params); - bool checkWorkingDirectory(); - void setupProcess(Utils::Process &process); + bool setupProcess(Utils::Process &process); void handleProcessDone(const Utils::Process &process); void runTaskTree(const Tasking::Group &recipe); diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 6df042d8d39..72340cbf3fa 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -278,16 +278,13 @@ void QMakeStep::doRun() return; } - if (!checkWorkingDirectory()) - return; - using namespace Tasking; const auto setupQMake = [this](Process &process) { m_outputFormatter->setLineParsers({new QMakeParser}); ProcessParameters *pp = processParameters(); pp->setCommandLine(m_qmakeCommand); - setupProcess(process); + return setupProcess(process) ? SetupResult::Continue : SetupResult::StopWithError; }; const auto setupMakeQMake = [this](Process &process) { @@ -296,7 +293,7 @@ void QMakeStep::doRun() m_outputFormatter->setLineParsers({parser}); ProcessParameters *pp = processParameters(); pp->setCommandLine(m_makeCommand); - setupProcess(process); + return setupProcess(process) ? SetupResult::Continue : SetupResult::StopWithError; }; const auto onProcessDone = [this](const Process &process) { handleProcessDone(process); }; From d42e1756ef7d7701bd25285a78ae1b540cfc24b5 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 11 Jul 2023 22:25:53 +0200 Subject: [PATCH 0285/1777] AbstractProcessStep: Make isExecutableFile check a part of setupProcess Task-number: QTCREATORBUG-29168 Change-Id: I47cc43f1465528354802fdc033fc6369e413b526 Reviewed-by: hjk <hjk@qt.io> --- .../projectexplorer/abstractprocessstep.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 71400786de6..a89a7eb5137 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -177,14 +177,6 @@ void AbstractProcessStep::setupOutputFormatter(OutputFormatter *formatter) void AbstractProcessStep::doRun() { - if (!d->m_param.effectiveCommand().isExecutableFile()) { - emit addOutput(Tr::tr("The program \"%1\" does not exist or is not executable.") - .arg(d->m_displayedParams->effectiveCommand().toUserOutput()), - OutputFormat::ErrorMessage); - finish(ProcessResult::StartFailed); - return; - } - setupStreams(); d->m_process.reset(new Process); @@ -218,6 +210,13 @@ bool AbstractProcessStep::setupProcess(Process &process) OutputFormat::ErrorMessage); return false; } + if (!d->m_param.effectiveCommand().isExecutableFile()) { + emit addOutput(Tr::tr("The program \"%1\" does not exist or is not executable.") + .arg(d->m_displayedParams->effectiveCommand().toUserOutput()), + OutputFormat::ErrorMessage); + return false; + } + process.setUseCtrlCStub(HostOsInfo::isWindowsHost()); process.setWorkingDirectory(workingDir); // Enforce PWD in the environment because some build tools use that. From 799dd9d10173f0a852a6caa20c26d512aee700ae Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 09:23:55 +0200 Subject: [PATCH 0286/1777] AbstractProcessStep: Introduce defaultProcessTask() Task-number: QTCREATORBUG-29168 Change-Id: Ic10a2edefd1a2ce1ffffd0eb051a720d9462e099 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/abstractprocessstep.cpp | 9 +++++++++ src/plugins/projectexplorer/abstractprocessstep.h | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index a89a7eb5137..56260a4854e 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -202,6 +202,15 @@ void AbstractProcessStep::setupStreams() d->stderrStream = std::make_unique<QTextDecoder>(QTextCodec::codecForLocale()); } +GroupItem AbstractProcessStep::defaultProcessTask() +{ + const auto onSetup = [this](Process &process) { + return setupProcess(process) ? SetupResult::Continue : SetupResult::StopWithError; + }; + const auto onEnd = [this](const Process &process) { handleProcessDone(process); }; + return ProcessTask(onSetup, onEnd, onEnd); +} + bool AbstractProcessStep::setupProcess(Process &process) { const FilePath workingDir = d->m_param.effectiveWorkingDirectory(); diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index 6c4a9c50715..9c2618819c3 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -9,11 +9,14 @@ namespace Utils { class CommandLine; -enum class ProcessResult; class Process; +enum class ProcessResult; } -namespace Tasking { class Group; } +namespace Tasking { +class Group; +class GroupItem; +} namespace ProjectExplorer { class ProcessParameters; @@ -48,6 +51,7 @@ protected: void setLowPriority(); void setDisplayedParameters(ProcessParameters *params); + Tasking::GroupItem defaultProcessTask(); bool setupProcess(Utils::Process &process); void handleProcessDone(const Utils::Process &process); void runTaskTree(const Tasking::Group &recipe); From d2d4f888fbf02f293994acac912f28d0f38d9de4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 11 Jul 2023 09:58:24 +0200 Subject: [PATCH 0287/1777] Beautifier: Some filepathification Change-Id: I8ed0ce1c5e08c19c806d3219610badf94202b03b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../artisticstyle/artisticstyle.cpp | 36 ++++++------- .../beautifier/artisticstyle/artisticstyle.h | 2 +- src/plugins/beautifier/beautifiertool.cpp | 53 ++++++++++--------- src/plugins/beautifier/beautifiertool.h | 5 +- .../beautifier/clangformat/clangformat.cpp | 21 ++++---- .../beautifier/uncrustify/uncrustify.cpp | 2 +- 6 files changed, 58 insertions(+), 61 deletions(-) diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp index 36d6280ea9c..68d546508d6 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp @@ -36,7 +36,6 @@ #include <QApplication> #include <QDateTime> #include <QFile> -#include <QFileInfo> #include <QGroupBox> #include <QMenu> #include <QRegularExpression> @@ -276,14 +275,14 @@ void ArtisticStyle::updateActions(Core::IEditor *editor) void ArtisticStyle::formatFile() { - const QString cfgFileName = configurationFile(); + const FilePath cfgFileName = configurationFile(); if (cfgFileName.isEmpty()) showError(BeautifierTool::msgCannotGetConfigurationFile(asDisplayName())); else - formatCurrentFile(command(cfgFileName)); + formatCurrentFile(command(cfgFileName.toFSPathString())); } -QString ArtisticStyle::configurationFile() const +FilePath ArtisticStyle::configurationFile() const { if (settings().useCustomStyle()) return settings().styleFileName(settings().customStyle()); @@ -291,39 +290,38 @@ QString ArtisticStyle::configurationFile() const if (settings().useOtherFiles()) { if (const ProjectExplorer::Project *project = ProjectExplorer::ProjectTree::currentProject()) { - const Utils::FilePaths astyleRcfiles = project->files( + const FilePaths astyleRcfiles = project->files( [](const ProjectExplorer::Node *n) { return n->filePath().endsWith(".astylerc"); }); - for (const Utils::FilePath &file : astyleRcfiles) { - const QFileInfo fi = file.toFileInfo(); - if (fi.isReadable()) - return file.toString(); + for (const FilePath &file : astyleRcfiles) { + if (file.isReadableFile()) + return file; } } } if (settings().useSpecificConfigFile()) { - const Utils::FilePath file = settings().specificConfigFile(); + const FilePath file = settings().specificConfigFile(); if (file.exists()) - return file.toUserOutput(); + return file; } if (settings().useHomeFile()) { - const QDir homeDirectory = QDir::home(); - QString file = homeDirectory.filePath(".astylerc"); - if (QFile::exists(file)) + const FilePath homeDirectory = FileUtils::homePath(); + FilePath file = homeDirectory / ".astylerc"; + if (file.exists()) return file; - file = homeDirectory.filePath("astylerc"); - if (QFile::exists(file)) + file = homeDirectory / "astylerc"; + if (file.exists()) return file; } - return QString(); + return {}; } Command ArtisticStyle::command() const { - const QString cfgFile = configurationFile(); - return cfgFile.isEmpty() ? Command() : command(cfgFile); + const FilePath cfgFile = configurationFile(); + return cfgFile.isEmpty() ? Command() : command(cfgFile.toFSPathString()); } bool ArtisticStyle::isApplicable(const Core::IDocument *document) const diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.h b/src/plugins/beautifier/artisticstyle/artisticstyle.h index db0af2bc1c8..45b94fbd463 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.h +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.h @@ -23,7 +23,7 @@ public: private: void formatFile(); - QString configurationFile() const; + Utils::FilePath configurationFile() const; TextEditor::Command command(const QString &cfgFile) const; QAction *m_formatFile = nullptr; diff --git a/src/plugins/beautifier/beautifiertool.cpp b/src/plugins/beautifier/beautifiertool.cpp index 3fe53070d04..85c70fee264 100644 --- a/src/plugins/beautifier/beautifiertool.cpp +++ b/src/plugins/beautifier/beautifiertool.cpp @@ -17,7 +17,6 @@ #include <utils/process.h> #include <QFile> -#include <QFileInfo> #include <QRegularExpression> #include <QVersionNumber> #include <QXmlStreamReader> @@ -127,8 +126,7 @@ private: AbstractSettings::AbstractSettings(const QString &name, const QString &ending) : m_ending(ending) , m_styleDir(Core::ICore::userResourcePath(Beautifier::Constants::SETTINGS_DIRNAME) - .pathAppended(name) - .toString()) + .pathAppended(name)) { setSettingsGroups(Utils::Constants::BEAUTIFIER_SETTINGS_GROUP, name); @@ -187,15 +185,15 @@ bool AbstractSettings::styleExists(const QString &key) const bool AbstractSettings::styleIsReadOnly(const QString &key) { - const QFileInfo fi(m_styleDir.absoluteFilePath(key + m_ending)); - if (!fi.exists()) { + const FilePath filePath = m_styleDir.pathAppended(key + m_ending); + if (!filePath.exists()) { // newly added style which was not saved yet., thus it is not read only. //TODO In a later version when we have predefined styles in Core::ICore::resourcePath() // we need to check if it is a read only global config file... return false; } - return !fi.isWritable(); + return !filePath.isWritableFile(); } void AbstractSettings::setStyle(const QString &key, const QString &value) @@ -222,9 +220,9 @@ void AbstractSettings::replaceStyle(const QString &oldKey, const QString &newKey m_changedStyles.insert(newKey); } -QString AbstractSettings::styleFileName(const QString &key) const +FilePath AbstractSettings::styleFileName(const QString &key) const { - return m_styleDir.absoluteFilePath(key + m_ending); + return m_styleDir.pathAppended(key + m_ending); } QVersionNumber AbstractSettings::version() const @@ -285,10 +283,14 @@ void AbstractSettings::save() // remove old files and possible subfolder for (const QString &key : std::as_const(m_stylesToRemove)) { - const QFileInfo fi(styleFileName(key)); - QFile::remove(fi.absoluteFilePath()); - if (fi.absoluteDir() != m_styleDir) - m_styleDir.rmdir(fi.absolutePath()); + FilePath filePath = styleFileName(key); + filePath.removeFile(); + QTC_ASSERT(m_styleDir.isAbsolutePath(), break); + QTC_ASSERT(!m_styleDir.needsDevice(), break); + if (filePath.parentDir() != m_styleDir) { + // FIXME: Missing in FilePath + QDir(m_styleDir.toString()).rmdir(filePath.parentDir().toString()); + } } m_stylesToRemove.clear(); @@ -300,23 +302,23 @@ void AbstractSettings::save() continue; } - const QFileInfo fi(styleFileName(iStyles.key())); - if (!(m_styleDir.mkpath(fi.absolutePath()))) { + const FilePath filePath = styleFileName(iStyles.key()); + if (!filePath.parentDir().ensureWritableDir()) { BeautifierTool::showError(Tr::tr("Cannot save styles. %1 does not exist.") - .arg(fi.absolutePath())); + .arg(filePath.toUserOutput())); continue; } - FileSaver saver(FilePath::fromUserInput(fi.absoluteFilePath())); + FileSaver saver(filePath); if (saver.hasError()) { BeautifierTool::showError(Tr::tr("Cannot open file \"%1\": %2.") - .arg(saver.filePath().toUserOutput()) + .arg(filePath.toUserOutput()) .arg(saver.errorString())); } else { saver.write(iStyles.value().toLocal8Bit()); if (!saver.finalize()) { BeautifierTool::showError(Tr::tr("Cannot save file \"%1\": %2.") - .arg(saver.filePath().toUserOutput()) + .arg(filePath.toUserOutput()) .arg(saver.errorString())); } } @@ -405,18 +407,17 @@ void AbstractSettings::readStyles() if (!m_styleDir.exists()) return; - const QStringList files - = m_styleDir.entryList({'*' + m_ending}, - QDir::Files | QDir::Readable | QDir::NoDotAndDotDot); - for (const QString &filename : files) { + const FileFilter filter = {{'*' + m_ending}, QDir::Files | QDir::Readable | QDir::NoDotAndDotDot}; + const FilePaths files = m_styleDir.dirEntries(filter); + for (const FilePath &filePath : files) { // do not allow empty file names - if (filename == m_ending) + if (filePath.fileName() == m_ending) continue; - QFile file(m_styleDir.absoluteFilePath(filename)); - if (file.open(QIODevice::ReadOnly)) { + if (auto contents = filePath.fileContents()) { + const QString filename = filePath.fileName(); m_styles.insert(filename.left(filename.length() - m_ending.length()), - QString::fromLocal8Bit(file.readAll())); + QString::fromLocal8Bit(*contents)); } } } diff --git a/src/plugins/beautifier/beautifiertool.h b/src/plugins/beautifier/beautifiertool.h index 0c6bdfd37b5..5b2c130a7d0 100644 --- a/src/plugins/beautifier/beautifiertool.h +++ b/src/plugins/beautifier/beautifiertool.h @@ -9,7 +9,6 @@ #include <utils/aspects.h> -#include <QDir> #include <QHash> #include <QMap> #include <QObject> @@ -73,7 +72,7 @@ public: void setStyle(const QString &key, const QString &value); void removeStyle(const QString &key); void replaceStyle(const QString &oldKey, const QString &newKey, const QString &value); - virtual QString styleFileName(const QString &key) const; + virtual Utils::FilePath styleFileName(const QString &key) const; Utils::FilePathAspect command{this}; Utils::StringAspect supportedMimeTypes{this}; @@ -92,7 +91,7 @@ protected: QMap<QString, QString> m_styles; QString m_ending; - QDir m_styleDir; + Utils::FilePath m_styleDir; void readDocumentation(); virtual void readStyles(); diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index 345cf870d50..8277af19fb7 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -103,7 +103,7 @@ public: SelectionAspect fallbackStyle{this}; StringAspect customStyle{this}; - QString styleFileName(const QString &key) const override; + Utils::FilePath styleFileName(const QString &key) const override; private: void readStyles() override; @@ -215,18 +215,17 @@ QStringList ClangFormatSettings::completerWords() }; } -QString ClangFormatSettings::styleFileName(const QString &key) const +FilePath ClangFormatSettings::styleFileName(const QString &key) const { - return m_styleDir.absolutePath() + '/' + key + '/' + m_ending; + return m_styleDir / key / m_ending; } void ClangFormatSettings::readStyles() { - const QStringList dirs = m_styleDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); - for (const QString &dir : dirs) { - QFile file(m_styleDir.absoluteFilePath(dir + '/' + m_ending)); - if (file.open(QIODevice::ReadOnly)) - m_styles.insert(dir, QString::fromLocal8Bit(file.readAll())); + const FilePaths dirs = m_styleDir.dirEntries(QDir::AllDirs | QDir::NoDotAndDotDot); + for (const FilePath &dir : dirs) { + if (auto contents = dir.pathAppended(m_ending).fileContents()) + m_styles.insert(dir.fileName(), QString::fromLocal8Bit(*contents)); } } @@ -495,9 +494,9 @@ Command ClangFormat::command() const command.addOption("-assume-filename=%file"); } else { command.addOption("-style=file"); - const QString path = - QFileInfo(settings().styleFileName(settings().customStyle())).absolutePath(); - command.addOption("-assume-filename=" + path + QDir::separator() + "%filename"); + const FilePath path = settings().styleFileName(settings().customStyle()) + .absolutePath().pathAppended("%filename"); + command.addOption("-assume-filename=" + path.nativePath()); } return command; diff --git a/src/plugins/beautifier/uncrustify/uncrustify.cpp b/src/plugins/beautifier/uncrustify/uncrustify.cpp index eae39aad591..819906266f8 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustify.cpp @@ -320,7 +320,7 @@ void Uncrustify::formatSelectedText() FilePath Uncrustify::configurationFile() const { if (settings().useCustomStyle()) - return FilePath::fromUserInput(settings().styleFileName(settings().customStyle())); + return settings().styleFileName(settings().customStyle()); if (settings().useOtherFiles()) { using namespace ProjectExplorer; From bbbbb6d257a535285f7d602b06074fe4ee935aa7 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 13 Jul 2023 09:45:20 +0200 Subject: [PATCH 0288/1777] Axivion: Remove superfluous colons Change-Id: I2193403ee757f7d9b1f1381644c890a18dc85e13 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/axivion/axivionoutputpane.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/axivion/axivionoutputpane.cpp b/src/plugins/axivion/axivionoutputpane.cpp index f36df8d0f17..c2443223cdd 100644 --- a/src/plugins/axivion/axivionoutputpane.cpp +++ b/src/plugins/axivion/axivionoutputpane.cpp @@ -88,7 +88,7 @@ void DashboardWidget::updateUi() const ResultVersion &last = info.versions.last(); m_loc->setText(QString::number(last.linesOfCode)); const QDateTime timeStamp = QDateTime::fromString(last.timeStamp, Qt::ISODate); - m_timestamp->setText(timeStamp.isValid() ? timeStamp.toString("yyyy-MM-dd HH::mm::ss") + m_timestamp->setText(timeStamp.isValid() ? timeStamp.toString("yyyy-MM-dd HH:mm:ss") : Tr::tr("unknown")); const QList<IssueKind> &issueKinds = info.issueKinds; From f021f1503b4f79255308bd2ae516c70e3835bafe Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 13 Jul 2023 09:50:23 +0200 Subject: [PATCH 0289/1777] AutoTest: Remove unused member Change-Id: I1a3a157893a8311db48f6e41c8848720845d07ab Reviewed-by: hjk <hjk@qt.io> --- src/plugins/autotest/quick/quicktestparser.cpp | 2 +- src/plugins/autotest/quick/quicktestvisitors.cpp | 4 +--- src/plugins/autotest/quick/quicktestvisitors.h | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/plugins/autotest/quick/quicktestparser.cpp b/src/plugins/autotest/quick/quicktestparser.cpp index 5cfdab93fb8..9dc92ea2eb2 100644 --- a/src/plugins/autotest/quick/quicktestparser.cpp +++ b/src/plugins/autotest/quick/quicktestparser.cpp @@ -128,7 +128,7 @@ QString QuickTestParser::quickTestName(const CPlusPlus::Document::Ptr &doc) cons return {}; document->check(); CPlusPlus::AST *ast = document->translationUnit()->ast(); - QuickTestAstVisitor astVisitor(document, m_cppSnapshot); + QuickTestAstVisitor astVisitor(document); astVisitor.accept(ast); if (!astVisitor.testBaseName().isEmpty()) return astVisitor.testBaseName(); diff --git a/src/plugins/autotest/quick/quicktestvisitors.cpp b/src/plugins/autotest/quick/quicktestvisitors.cpp index 158f37db839..9403aa1351e 100644 --- a/src/plugins/autotest/quick/quicktestvisitors.cpp +++ b/src/plugins/autotest/quick/quicktestvisitors.cpp @@ -166,11 +166,9 @@ void TestQmlVisitor::throwRecursionDepthError() /************************************** QuickTestAstVisitor *************************************/ -QuickTestAstVisitor::QuickTestAstVisitor(CPlusPlus::Document::Ptr doc, - const CPlusPlus::Snapshot &snapshot) +QuickTestAstVisitor::QuickTestAstVisitor(CPlusPlus::Document::Ptr doc) : ASTVisitor(doc->translationUnit()) , m_currentDoc(doc) - , m_snapshot(snapshot) { } diff --git a/src/plugins/autotest/quick/quicktestvisitors.h b/src/plugins/autotest/quick/quicktestvisitors.h index 58dae69e921..11104cc329a 100644 --- a/src/plugins/autotest/quick/quicktestvisitors.h +++ b/src/plugins/autotest/quick/quicktestvisitors.h @@ -56,7 +56,7 @@ private: class QuickTestAstVisitor : public CPlusPlus::ASTVisitor { public: - QuickTestAstVisitor(CPlusPlus::Document::Ptr doc, const CPlusPlus::Snapshot &snapshot); + QuickTestAstVisitor(CPlusPlus::Document::Ptr doc); bool visit(CPlusPlus::CallAST *ast) override; @@ -64,7 +64,6 @@ public: private: QString m_testBaseName; CPlusPlus::Document::Ptr m_currentDoc; - const CPlusPlus::Snapshot &m_snapshot; }; } // namespace Internal From af998dae2c6924d976afdca8113a4ca7e74f9d06 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 13 Jul 2023 10:05:21 +0200 Subject: [PATCH 0290/1777] AutoTest: Clean up project file Change-Id: I85f3836915e7603cd93956ff81dbce69267e3163 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/autotest/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/autotest/CMakeLists.txt b/src/plugins/autotest/CMakeLists.txt index c7121131361..fd5e51ca004 100644 --- a/src/plugins/autotest/CMakeLists.txt +++ b/src/plugins/autotest/CMakeLists.txt @@ -20,9 +20,11 @@ add_qtc_plugin(AutoTest boost/boosttesttreeitem.cpp boost/boosttesttreeitem.h catch/catchcodeparser.cpp catch/catchcodeparser.h catch/catchconfiguration.cpp catch/catchconfiguration.h - catch/catchoutputreader.cpp catch/catchresult.h catch/catchresult.cpp catch/catchtestparser.h + catch/catchoutputreader.cpp catch/catchoutputreader.h + catch/catchresult.h catch/catchresult.cpp catch/catchtestframework.cpp catch/catchtestframework.h - catch/catchtestparser.cpp catch/catchtreeitem.h catch/catchtreeitem.cpp + catch/catchtestparser.cpp catch/catchtestparser.h + catch/catchtreeitem.h catch/catchtreeitem.cpp ctest/ctestconfiguration.cpp ctest/ctestconfiguration.h ctest/ctestoutputreader.cpp ctest/ctestoutputreader.h ctest/ctesttool.cpp ctest/ctesttool.h From fa815edae3651563acb03acd9f76a8613c92ea98 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 13 Jul 2023 10:06:14 +0200 Subject: [PATCH 0291/1777] AutoTest: Use new approach for settings Avoids a couple of unneeded casts. Change-Id: Ib3361d4ad2c69e4f0e4a44c5e9b3f385cefb6084 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/autotest/autotestunittests.cpp | 5 +---- src/plugins/autotest/boost/boosttestconfiguration.cpp | 4 ++-- src/plugins/autotest/catch/catchconfiguration.cpp | 2 +- src/plugins/autotest/ctest/ctesttreeitem.cpp | 3 +-- src/plugins/autotest/gtest/gtestconfiguration.cpp | 2 +- src/plugins/autotest/qtest/qttestconfiguration.cpp | 5 ++--- src/plugins/autotest/quick/quicktestconfiguration.cpp | 5 ++--- src/plugins/autotest/quick/quicktestparser.cpp | 3 +-- 8 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/plugins/autotest/autotestunittests.cpp b/src/plugins/autotest/autotestunittests.cpp index 94be4be5d3b..7ed1a097d48 100644 --- a/src/plugins/autotest/autotestunittests.cpp +++ b/src/plugins/autotest/autotestunittests.cpp @@ -77,10 +77,7 @@ void AutoTestUnitTests::initTestCase() } // Enable quick check for derived tests - static const Id id = Id("AutoTest.Framework.QtTest"); - static_cast<Autotest::Internal::QtTestFramework *>( - TestFrameworkManager::frameworkForId(id)) - ->quickCheckForDerivedTests.setValue(true); + theQtTestFramework().quickCheckForDerivedTests.setValue(true); } void AutoTestUnitTests::cleanupTestCase() diff --git a/src/plugins/autotest/boost/boosttestconfiguration.cpp b/src/plugins/autotest/boost/boosttestconfiguration.cpp index 6222c974653..15cc0d8bbfe 100644 --- a/src/plugins/autotest/boost/boosttestconfiguration.cpp +++ b/src/plugins/autotest/boost/boosttestconfiguration.cpp @@ -17,7 +17,7 @@ namespace Internal { TestOutputReader *BoostTestConfiguration::createOutputReader(Process *app) const { - BoostTestFramework &settings = *static_cast<BoostTestFramework *>(framework()); + BoostTestFramework &settings = theBoostTestFramework(); return new BoostTestOutputReader(app, buildDirectory(), projectFile(), LogLevel(settings.logLevel()), ReportLevel(settings.reportLevel())); @@ -85,7 +85,7 @@ static QStringList filterInterfering(const QStringList &provided, QStringList *o QStringList BoostTestConfiguration::argumentsForTestRunner(QStringList *omitted) const { - BoostTestFramework &boostSettings = *static_cast<BoostTestFramework *>(framework()); + BoostTestFramework &boostSettings = theBoostTestFramework(); QStringList arguments; arguments << "-l" << BoostTestFramework::logLevelToOption(LogLevel(boostSettings.logLevel())); arguments << "-r" << BoostTestFramework::reportLevelToOption(ReportLevel(boostSettings.reportLevel())); diff --git a/src/plugins/autotest/catch/catchconfiguration.cpp b/src/plugins/autotest/catch/catchconfiguration.cpp index 37cb378e071..e1773064f77 100644 --- a/src/plugins/autotest/catch/catchconfiguration.cpp +++ b/src/plugins/autotest/catch/catchconfiguration.cpp @@ -83,7 +83,7 @@ QStringList CatchConfiguration::argumentsForTestRunner(QStringList *omitted) con ' ', Qt::SkipEmptyParts), omitted); } - CatchFramework &settings = *static_cast<CatchFramework *>(framework()); + CatchFramework &settings = theCatchFramework(); if (settings.abortAfterChecked()) arguments << "-x" << QString::number(settings.abortAfter()); diff --git a/src/plugins/autotest/ctest/ctesttreeitem.cpp b/src/plugins/autotest/ctest/ctesttreeitem.cpp index c3b88ca5f08..89c06411522 100644 --- a/src/plugins/autotest/ctest/ctesttreeitem.cpp +++ b/src/plugins/autotest/ctest/ctesttreeitem.cpp @@ -88,8 +88,7 @@ QList<ITestConfiguration *> CTestTreeItem::testConfigurationsFor(const QStringLi const ProjectExplorer::BuildSystem *buildSystem = target->buildSystem(); QStringList options{"--timeout", QString::number(testSettings().timeout() / 1000)}; - auto ctestSettings = static_cast<CTestTool *>(testBase()); - options << ctestSettings->activeSettingsAsOptions(); + options << theCTestTool().activeSettingsAsOptions(); CommandLine command = buildSystem->commandLineForTests(selected, options); if (command.executable().isEmpty()) return {}; diff --git a/src/plugins/autotest/gtest/gtestconfiguration.cpp b/src/plugins/autotest/gtest/gtestconfiguration.cpp index 0b7160d2a55..248bba0d058 100644 --- a/src/plugins/autotest/gtest/gtestconfiguration.cpp +++ b/src/plugins/autotest/gtest/gtestconfiguration.cpp @@ -66,7 +66,7 @@ QStringList GTestConfiguration::argumentsForTestRunner(QStringList *omitted) con arguments << "--gtest_filter=\"" + testSets.join(':') + '"'; } - GTestFramework &gSettings = *static_cast<GTestFramework *>(framework()); + GTestFramework &gSettings = theGTestFramework(); if (gSettings.runDisabled()) arguments << "--gtest_also_run_disabled_tests"; diff --git a/src/plugins/autotest/qtest/qttestconfiguration.cpp b/src/plugins/autotest/qtest/qttestconfiguration.cpp index 8b433eebfdf..f69a76fe6ac 100644 --- a/src/plugins/autotest/qtest/qttestconfiguration.cpp +++ b/src/plugins/autotest/qtest/qttestconfiguration.cpp @@ -28,8 +28,7 @@ static QStringList quoteIfNeeded(const QStringList &testCases, bool debugMode) TestOutputReader *QtTestConfiguration::createOutputReader(Process *app) const { - QtTestFramework &qtSettings = *static_cast<QtTestFramework *>(framework()); - const QtTestOutputReader::OutputMode mode = qtSettings.useXMLOutput() + const QtTestOutputReader::OutputMode mode = theQtTestFramework().useXMLOutput() ? QtTestOutputReader::XML : QtTestOutputReader::PlainText; return new QtTestOutputReader(app, buildDirectory(), projectFile(), mode, TestType::QtTest); @@ -43,7 +42,7 @@ QStringList QtTestConfiguration::argumentsForTestRunner(QStringList *omitted) co runnable().command.arguments().split(' ', Qt::SkipEmptyParts), omitted, false)); } - QtTestFramework &qtSettings = *static_cast<QtTestFramework *>(framework()); + QtTestFramework &qtSettings = theQtTestFramework(); if (qtSettings.useXMLOutput()) arguments << "-xml"; if (!testCases().isEmpty()) diff --git a/src/plugins/autotest/quick/quicktestconfiguration.cpp b/src/plugins/autotest/quick/quicktestconfiguration.cpp index 1f686ea6e7b..ebf2c2406ea 100644 --- a/src/plugins/autotest/quick/quicktestconfiguration.cpp +++ b/src/plugins/autotest/quick/quicktestconfiguration.cpp @@ -21,8 +21,7 @@ QuickTestConfiguration::QuickTestConfiguration(ITestFramework *framework) TestOutputReader *QuickTestConfiguration::createOutputReader(Process *app) const { - QtTestFramework &qtSettings = *static_cast<QtTestFramework *>(framework()); - const QtTestOutputReader::OutputMode mode = qtSettings.useXMLOutput() + const QtTestOutputReader::OutputMode mode = theQtTestFramework().useXMLOutput() ? QtTestOutputReader::XML : QtTestOutputReader::PlainText; return new QtTestOutputReader(app, buildDirectory(), projectFile(), mode, TestType::QuickTest); @@ -37,7 +36,7 @@ QStringList QuickTestConfiguration::argumentsForTestRunner(QStringList *omitted) omitted, true)); } - QtTestFramework &qtSettings = *static_cast<QtTestFramework *>(framework()); + QtTestFramework &qtSettings = theQtTestFramework(); if (qtSettings.useXMLOutput()) arguments << "-xml"; if (!testCases().isEmpty()) diff --git a/src/plugins/autotest/quick/quicktestparser.cpp b/src/plugins/autotest/quick/quicktestparser.cpp index 9dc92ea2eb2..eaba2299588 100644 --- a/src/plugins/autotest/quick/quicktestparser.cpp +++ b/src/plugins/autotest/quick/quicktestparser.cpp @@ -357,8 +357,7 @@ void QuickTestParser::init(const QSet<FilePath> &filesToParse, bool fullParse) m_mainCppFiles.clear(); } - QtTestFramework &qtSettings = *static_cast<QtTestFramework *>(framework()); - m_checkForDerivedTests = qtSettings.quickCheckForDerivedTests(); + m_checkForDerivedTests = theQtTestFramework().quickCheckForDerivedTests(); CppParser::init(filesToParse, fullParse); } From 1bee37848eb9e64bc85138b823ac77d890b83be9 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 14:20:01 +0200 Subject: [PATCH 0292/1777] AutogenStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I5b0cb5832d91f4147b273475304a1bba1dd08700 Reviewed-by: hjk <hjk@qt.io> --- .../autotoolsprojectmanager/autogenstep.cpp | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/plugins/autotoolsprojectmanager/autogenstep.cpp b/src/plugins/autotoolsprojectmanager/autogenstep.cpp index 090389716de..a6121de9276 100644 --- a/src/plugins/autotoolsprojectmanager/autogenstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autogenstep.cpp @@ -14,6 +14,7 @@ #include <projectexplorer/target.h> #include <utils/aspects.h> +#include <utils/process.h> #include <QDateTime> @@ -71,27 +72,31 @@ AutogenStep::AutogenStep(BuildStepList *bsl, Id id) : AbstractProcessStep(bsl, i void AutogenStep::doRun() { - // Check whether we need to run autogen.sh - const FilePath projectDir = project()->projectDirectory(); - const FilePath configure = projectDir / "configure"; - const FilePath configureAc = projectDir / "configure.ac"; - const FilePath makefileAm = projectDir / "Makefile.am"; + using namespace Tasking; - if (!configure.exists() - || configure.lastModified() < configureAc.lastModified() - || configure.lastModified() < makefileAm.lastModified()) { - m_runAutogen = true; - } + const auto onSetup = [this] { + // Check whether we need to run autogen.sh + const FilePath projectDir = project()->projectDirectory(); + const FilePath configure = projectDir / "configure"; + const FilePath configureAc = projectDir / "configure.ac"; + const FilePath makefileAm = projectDir / "Makefile.am"; - if (!m_runAutogen) { - emit addOutput(Tr::tr("Configuration unchanged, skipping autogen step."), - OutputFormat::NormalMessage); - emit finished(true); - return; - } + if (!configure.exists() + || configure.lastModified() < configureAc.lastModified() + || configure.lastModified() < makefileAm.lastModified()) { + m_runAutogen = true; + } - m_runAutogen = false; - AbstractProcessStep::doRun(); + if (!m_runAutogen) { + emit addOutput(Tr::tr("Configuration unchanged, skipping autogen step."), + OutputFormat::NormalMessage); + return SetupResult::StopWithDone; + } + return SetupResult::Continue; + }; + const auto onDone = [this] { m_runAutogen = false; }; + + runTaskTree({onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask()}); } // AutogenStepFactory From 52eeed5d0a891dfab33f843c28dc0eed8a3f6253 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 14:25:08 +0200 Subject: [PATCH 0293/1777] AutoreconfStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I3f12b856ca877a73c5351cbc9f074e2394673913 Reviewed-by: hjk <hjk@qt.io> --- .../autoreconfstep.cpp | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp index a32191be83b..3d545a6e754 100644 --- a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp @@ -13,6 +13,7 @@ #include <projectexplorer/projectexplorerconstants.h> #include <utils/aspects.h> +#include <utils/process.h> using namespace ProjectExplorer; using namespace Utils; @@ -61,20 +62,24 @@ public: void doRun() override { - // Check whether we need to run autoreconf - const FilePath configure = project()->projectDirectory() / "configure"; - if (!configure.exists()) - m_runAutoreconf = true; + using namespace Tasking; - if (!m_runAutoreconf) { - emit addOutput(Tr::tr("Configuration unchanged, skipping autoreconf step."), - OutputFormat::NormalMessage); - emit finished(true); - return; - } + const auto onSetup = [this] { + // Check whether we need to run autoreconf + const FilePath configure = project()->projectDirectory() / "configure"; + if (!configure.exists()) + m_runAutoreconf = true; - m_runAutoreconf = false; - AbstractProcessStep::doRun(); + if (!m_runAutoreconf) { + emit addOutput(Tr::tr("Configuration unchanged, skipping autoreconf step."), + OutputFormat::NormalMessage); + return SetupResult::StopWithDone; + } + return SetupResult::Continue; + }; + const auto onDone = [this] { m_runAutoreconf = false; }; + + runTaskTree({onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask()}); } private: From 60ef6e167e085222ed8181d18c26e07b324c465a Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 14:51:25 +0200 Subject: [PATCH 0294/1777] ConfigureStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I54281a6aaead85ca76f804956114e7c6dafeb28c Reviewed-by: hjk <hjk@qt.io> --- .../autotoolsprojectmanager/configurestep.cpp | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/plugins/autotoolsprojectmanager/configurestep.cpp b/src/plugins/autotoolsprojectmanager/configurestep.cpp index 2eaf905f5a6..58515990182 100644 --- a/src/plugins/autotoolsprojectmanager/configurestep.cpp +++ b/src/plugins/autotoolsprojectmanager/configurestep.cpp @@ -13,6 +13,7 @@ #include <projectexplorer/target.h> #include <utils/aspects.h> +#include <utils/process.h> #include <QDateTime> @@ -75,27 +76,31 @@ private: void ConfigureStep::doRun() { - // Check whether we need to run configure - const FilePath configure = project()->projectDirectory() / "configure"; - const FilePath configStatus = buildDirectory() / "config.status"; + using namespace Tasking; - if (!configStatus.exists() || configStatus.lastModified() < configure.lastModified()) - m_runConfigure = true; + const auto onSetup = [this] { + // Check whether we need to run configure + const FilePath configure = project()->projectDirectory() / "configure"; + const FilePath configStatus = buildDirectory() / "config.status"; - if (!m_runConfigure) { - emit addOutput(Tr::tr("Configuration unchanged, skipping configure step."), OutputFormat::NormalMessage); - emit finished(true); - return; - } + if (!configStatus.exists() || configStatus.lastModified() < configure.lastModified()) + m_runConfigure = true; - ProcessParameters *param = processParameters(); - if (!param->effectiveCommand().exists()) { - param->setCommandLine(getCommandLine(param->command().arguments())); - setSummaryText(param->summaryInWorkdir(displayName())); - } + if (!m_runConfigure) { + emit addOutput(Tr::tr("Configuration unchanged, skipping configure step."), OutputFormat::NormalMessage); + return SetupResult::StopWithDone; + } - m_runConfigure = false; - AbstractProcessStep::doRun(); + ProcessParameters *param = processParameters(); + if (!param->effectiveCommand().exists()) { + param->setCommandLine(getCommandLine(param->command().arguments())); + setSummaryText(param->summaryInWorkdir(displayName())); + } + return SetupResult::Continue; + }; + const auto onDone = [this] { m_runConfigure = false; }; + + runTaskTree({onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask()}); } // ConfigureStepFactory From 2cc3c3b681677051b2d86f79941f01ff5ff1fe18 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 08:54:53 +0200 Subject: [PATCH 0295/1777] CMakeBuildStep: Employ task tree for running Remove emitting 100% progress on finish, as that's done automatically by the task tree. Task-number: QTCREATORBUG-29168 Change-Id: I468fd2c12ffda4c051a46e586fc18214598269f9 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../cmakeprojectmanager/cmakebuildstep.cpp | 85 +++++++++++-------- .../cmakeprojectmanager/cmakebuildstep.h | 5 -- 2 files changed, 48 insertions(+), 42 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index be65426d5c3..7c4539a5dc4 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -57,7 +57,24 @@ const char CLEAR_SYSTEM_ENVIRONMENT_KEY[] = "CMakeProjectManager.MakeStep.ClearS const char USER_ENVIRONMENT_CHANGES_KEY[] = "CMakeProjectManager.MakeStep.UserEnvironmentChanges"; const char BUILD_PRESET_KEY[] = "CMakeProjectManager.MakeStep.BuildPreset"; -// CmakeProgressParser +class ProjectParserTaskAdapter : public Tasking::TaskAdapter<QPointer<Target>> +{ +public: + void start() final { + Target *target = *task(); + if (!target) { + emit done(false); + return; + } + connect(target, &Target::parsingFinished, this, &TaskInterface::done); + } +}; + +} // namespace CMakeProjectManager::Internal + +TASKING_DECLARE_TASK(ProjectParserTask, CMakeProjectManager::Internal::ProjectParserTaskAdapter); + +namespace CMakeProjectManager::Internal { class CmakeProgressParser : public Utils::OutputLineParser { @@ -253,11 +270,6 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Id id) : connect(target(), &Target::activeRunConfigurationChanged, this, &CMakeBuildStep::updateBuildTargetsModel); - - setDoneHook([this](bool) { - updateDeploymentData(); - emit progress(100, {}); - }); } QVariantMap CMakeBuildStep::toMap() const @@ -337,40 +349,39 @@ void CMakeBuildStep::setupOutputFormatter(Utils::OutputFormatter *formatter) void CMakeBuildStep::doRun() { - // Make sure CMake state was written to disk before trying to build: - auto bs = static_cast<CMakeBuildSystem *>(buildSystem()); - QString message; - if (bs->persistCMakeState()) { - message = Tr::tr("Persisting CMake state..."); - } else if (bs->isWaitingForParse()) { - message = Tr::tr("Running CMake in preparation to build..."); - } else { - runImpl(); - return; - } - emit addOutput(message, OutputFormat::NormalMessage); - m_runTrigger = connect(target(), &Target::parsingFinished, - this, [this](bool success) { handleProjectWasParsed(success); }); -} + using namespace Tasking; -void CMakeBuildStep::runImpl() -{ - // Do the actual build: - CMakeAbstractProcessStep::doRun(); -} - -void CMakeBuildStep::handleProjectWasParsed(bool success) -{ - disconnect(m_runTrigger); - if (isCanceled()) { - emit finished(false); - } else if (success) { - runImpl(); - } else { + const auto onParserSetup = [this](QPointer<Target> &parseTarget) { + // Make sure CMake state was written to disk before trying to build: + auto bs = qobject_cast<CMakeBuildSystem *>(buildSystem()); + QTC_ASSERT(bs, return SetupResult::StopWithError); + QString message; + if (bs->persistCMakeState()) + message = Tr::tr("Persisting CMake state..."); + else if (bs->isWaitingForParse()) + message = Tr::tr("Running CMake in preparation to build..."); + else + return SetupResult::StopWithDone; + emit addOutput(message, OutputFormat::NormalMessage); + parseTarget = target(); + return SetupResult::Continue; + }; + const auto onParserError = [this](const QPointer<Target> &) { emit addOutput(Tr::tr("Project did not parse successfully, cannot build."), OutputFormat::ErrorMessage); - emit finished(false); - } + }; + const auto onEnd = [this] { + updateDeploymentData(); + }; + const Group root { + ignoreReturnValue() ? finishAllAndDone : stopOnError, + ProjectParserTask(onParserSetup, {}, onParserError), + defaultProcessTask(), + onGroupDone(onEnd), + onGroupError(onEnd) + }; + + runTaskTree(root); } QString CMakeBuildStep::defaultBuildTarget() const diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h index e0f6f15d19c..12d9a847129 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h @@ -91,16 +91,11 @@ private: QString defaultBuildTarget() const; bool isCleanStep() const; - void runImpl(); - void handleProjectWasParsed(bool success); - void handleBuildTargetsChanges(bool success); void recreateBuildTargetsModel(); void updateBuildTargetsModel(); void updateDeploymentData(); - QMetaObject::Connection m_runTrigger; - friend class CMakeBuildStepConfigWidget; QStringList m_buildTargets; // Convention: Empty string member signifies "Current executable" Utils::StringAspect *m_cmakeArguments = nullptr; From 4cf878aecf02b9d40a6a317ccb2d3e645d68217b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 07:34:37 +0200 Subject: [PATCH 0296/1777] Python: Base MainScriptAspect on FilePathAspect Instead of StringAspect. Change-Id: Idc5cbe4a28ece5b053eee9f260be9a5f22912f81 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/projectexplorer/runconfigurationaspects.cpp | 2 +- src/plugins/projectexplorer/runconfigurationaspects.h | 2 +- src/plugins/python/pythonrunconfiguration.cpp | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 7c31f92bf86..1e7bc6f05b0 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -949,7 +949,7 @@ SymbolFileAspect::SymbolFileAspect(AspectContainer *container) {} MainScriptAspect::MainScriptAspect(AspectContainer *container) - : StringAspect(container) + : FilePathAspect(container) {} } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index 7b2e453ad88..7865aef3775 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -254,7 +254,7 @@ private: Utils::Id m_settingsDialogId; }; -class PROJECTEXPLORER_EXPORT MainScriptAspect : public Utils::StringAspect +class PROJECTEXPLORER_EXPORT MainScriptAspect : public Utils::FilePathAspect { Q_OBJECT diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 13b7f42b928..110b92a19e1 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -343,7 +343,7 @@ public: mainScript.setSettingsKey("PythonEditor.RunConfiguation.Script"); mainScript.setLabelText(Tr::tr("Script:")); - mainScript.setDisplayStyle(StringAspect::LabelDisplay); + mainScript.setReadOnly(true); environment.setSupportForBuildEnvironment(target); @@ -358,16 +358,15 @@ public: CommandLine cmd{interpreter.currentInterpreter().command}; if (!buffered()) cmd.addArg("-u"); - cmd.addArg(mainScript.filePath().fileName()); + cmd.addArg(mainScript().fileName()); cmd.addArgs(arguments(), CommandLine::Raw); return cmd; }); setUpdater([this] { const BuildTargetInfo bti = buildTargetInfo(); - const QString script = bti.targetFilePath.toUserOutput(); - setDefaultDisplayName(Tr::tr("Run %1").arg(script)); - mainScript.setValue(script); + setDefaultDisplayName(Tr::tr("Run %1").arg(bti.targetFilePath.toUserOutput())); + mainScript.setValue(bti.targetFilePath); workingDir.setDefaultWorkingDirectory(bti.targetFilePath.parentDir()); }); From e796eb40357f0d5257f3fb6c560fbb6d8b946e45 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 10:26:03 +0200 Subject: [PATCH 0297/1777] QMakeStep: Enclose all setup inside the recipe Task-number: QTCREATORBUG-29168 Change-Id: Ia8176625e33b1a4ba4a90234358c74e76d7fc00a Reviewed-by: hjk <hjk@qt.io> --- src/plugins/qmakeprojectmanager/qmakestep.cpp | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 72340cbf3fa..94b93354347 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -181,7 +181,7 @@ bool QMakeStep::init() const QtVersion *qtVersion = QtKitAspect::qtVersion(kit()); if (!qtVersion) { - emit addOutput(Tr::tr("No Qt version configured."), BuildStep::OutputFormat::ErrorMessage); + emit addOutput(Tr::tr("No Qt version configured."), OutputFormat::ErrorMessage); return false; } @@ -217,7 +217,7 @@ bool QMakeStep::init() if (make.isEmpty()) { emit addOutput(Tr::tr("Could not determine which \"make\" command to run. " "Check the \"make\" step in the build configuration."), - BuildStep::OutputFormat::ErrorMessage); + OutputFormat::ErrorMessage); return false; } m_makeCommand = CommandLine{make, makeArguments(makeFile.path()), CommandLine::Raw}; @@ -267,19 +267,18 @@ void QMakeStep::setupOutputFormatter(OutputFormatter *formatter) void QMakeStep::doRun() { - if (m_scriptTemplate) { - emit finished(true); - return; - } - - if (!m_needToRunQMake) { - emit addOutput(Tr::tr("Configuration unchanged, skipping qmake step."), BuildStep::OutputFormat::NormalMessage); - emit finished(true); - return; - } - using namespace Tasking; + const auto onSetup = [this] { + if (m_scriptTemplate) + return SetupResult::StopWithDone; + if (m_needToRunQMake) + return SetupResult::Continue; + emit addOutput(Tr::tr("Configuration unchanged, skipping qmake step."), + OutputFormat::NormalMessage); + return SetupResult::StopWithDone; + }; + const auto setupQMake = [this](Process &process) { m_outputFormatter->setLineParsers({new QMakeParser}); ProcessParameters *pp = processParameters(); @@ -303,10 +302,11 @@ void QMakeStep::doRun() m_needToRunQMake = false; }; - QList<GroupItem> processList = {ProcessTask(setupQMake, onProcessDone, onProcessDone)}; + QList<GroupItem> processList = {onGroupSetup(onSetup), + onGroupDone(onDone), + ProcessTask(setupQMake, onProcessDone, onProcessDone)}; if (m_runMakeQmake) processList << ProcessTask(setupMakeQMake, onProcessDone, onProcessDone); - processList << onGroupDone(onDone); runTaskTree(Group(processList)); } From 7f9d1fb993929ffade441a3f9073f7cbc585d3b9 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 15:33:19 +0200 Subject: [PATCH 0298/1777] QmakeMakeStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I4366c520f58946e372c772c643ac40cdc212ec22 Reviewed-by: hjk <hjk@qt.io> --- .../qmakeprojectmanager/qmakemakestep.cpp | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp index dccbe73a53c..9d949a09923 100644 --- a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp @@ -59,15 +59,6 @@ QmakeMakeStep::QmakeMakeStep(BuildStepList *bsl, Id id) setUserArguments("clean"); } supportDisablingForSubdirs(); - - setDoneHook([this](bool success) { - if (!success && !isCanceled() && m_unalignedBuildDir - && settings().warnAgainstUnalignedBuildDir()) { - const QString msg = Tr::tr("The build directory is not at the same level as the source " - "directory, which could be the reason for the build failure."); - emit addTask(BuildSystemTask(Task::Warning, msg)); - } - }); } bool QmakeMakeStep::init() @@ -211,20 +202,31 @@ void QmakeMakeStep::setupOutputFormatter(OutputFormatter *formatter) void QmakeMakeStep::doRun() { - if (m_scriptTarget || m_ignoredNonTopLevelBuild) { - emit finished(true); - return; - } + using namespace Tasking; - if (!m_makeFileToCheck.exists()) { - const bool success = ignoreReturnValue(); - if (!success) - emit addOutput(Tr::tr("Cannot find Makefile. Check your build settings."), BuildStep::OutputFormat::NormalMessage); - emit finished(success); - return; - } + const auto onSetup = [this] { + if (m_scriptTarget || m_ignoredNonTopLevelBuild) + return SetupResult::StopWithDone; - AbstractProcessStep::doRun(); + if (!m_makeFileToCheck.exists()) { + const bool success = ignoreReturnValue(); + if (!success) { + emit addOutput(Tr::tr("Cannot find Makefile. Check your build settings."), + OutputFormat::NormalMessage); + } + return success ? SetupResult::StopWithDone : SetupResult::StopWithError; + } + return SetupResult::Continue; + }; + const auto onError = [this] { + if (m_unalignedBuildDir && settings().warnAgainstUnalignedBuildDir()) { + const QString msg = Tr::tr("The build directory is not at the same level as the source " + "directory, which could be the reason for the build failure."); + emit addTask(BuildSystemTask(Task::Warning, msg)); + } + }; + + runTaskTree({onGroupSetup(onSetup), onGroupError(onError), defaultProcessTask()}); } QStringList QmakeMakeStep::displayArguments() const From 54a6145ae94458bd180acacdce0256f36f69ef4e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 12:17:26 +0200 Subject: [PATCH 0299/1777] Android: Use aspects more directly in AndroidRunConfiguration Change-Id: I0eed35acd6c65dccd99ace12dc98bf0e3ab1a2f0 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../android/androidrunconfiguration.cpp | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/plugins/android/androidrunconfiguration.cpp b/src/plugins/android/androidrunconfiguration.cpp index e481f1eda44..28d9862a70c 100644 --- a/src/plugins/android/androidrunconfiguration.cpp +++ b/src/plugins/android/androidrunconfiguration.cpp @@ -28,8 +28,9 @@ namespace Android { class BaseStringListAspect final : public Utils::StringAspect { public: - explicit BaseStringListAspect() = default; - ~BaseStringListAspect() final = default; + explicit BaseStringListAspect(AspectContainer *container) + : StringAspect(container) + {} void fromMap(const QVariantMap &map) final { @@ -50,39 +51,34 @@ public: AndroidRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto envAspect = addAspect<EnvironmentAspect>(); - envAspect->addSupportedBaseEnvironment(Tr::tr("Clean Environment"), {}); + environment.addSupportedBaseEnvironment(Tr::tr("Clean Environment"), {}); - auto extraAppArgsAspect = addAspect<ArgumentsAspect>(); - extraAppArgsAspect->setMacroExpander(macroExpander()); + extraAppArgs.setMacroExpander(macroExpander()); - connect(extraAppArgsAspect, &BaseAspect::changed, this, [target, extraAppArgsAspect] { + connect(&extraAppArgs, &BaseAspect::changed, this, [this, target] { if (target->buildConfigurations().first()->buildType() == BuildConfiguration::BuildType::Release) { const QString buildKey = target->activeBuildKey(); target->buildSystem()->setExtraData(buildKey, Android::Constants::AndroidApplicationArgs, - extraAppArgsAspect->arguments()); + extraAppArgs()); } }); - auto amStartArgsAspect = addAspect<StringAspect>(); - amStartArgsAspect->setId(Constants::ANDROID_AM_START_ARGS); - amStartArgsAspect->setSettingsKey("Android.AmStartArgsKey"); - amStartArgsAspect->setLabelText(Tr::tr("Activity manager start arguments:")); - amStartArgsAspect->setDisplayStyle(StringAspect::LineEditDisplay); - amStartArgsAspect->setHistoryCompleter("Android.AmStartArgs.History"); + amStartArgs.setId(Constants::ANDROID_AM_START_ARGS); + amStartArgs.setSettingsKey("Android.AmStartArgsKey"); + amStartArgs.setLabelText(Tr::tr("Activity manager start arguments:")); + amStartArgs.setDisplayStyle(StringAspect::LineEditDisplay); + amStartArgs.setHistoryCompleter("Android.AmStartArgs.History"); - auto preStartShellCmdAspect = addAspect<BaseStringListAspect>(); - preStartShellCmdAspect->setDisplayStyle(StringAspect::TextEditDisplay); - preStartShellCmdAspect->setId(Constants::ANDROID_PRESTARTSHELLCMDLIST); - preStartShellCmdAspect->setSettingsKey("Android.PreStartShellCmdListKey"); - preStartShellCmdAspect->setLabelText(Tr::tr("Pre-launch on-device shell commands:")); + preStartShellCmd.setDisplayStyle(StringAspect::TextEditDisplay); + preStartShellCmd.setId(Constants::ANDROID_PRESTARTSHELLCMDLIST); + preStartShellCmd.setSettingsKey("Android.PreStartShellCmdListKey"); + preStartShellCmd.setLabelText(Tr::tr("Pre-launch on-device shell commands:")); - auto postStartShellCmdAspect = addAspect<BaseStringListAspect>(); - postStartShellCmdAspect->setDisplayStyle(StringAspect::TextEditDisplay); - postStartShellCmdAspect->setId(Constants::ANDROID_POSTFINISHSHELLCMDLIST); - postStartShellCmdAspect->setSettingsKey("Android.PostStartShellCmdListKey"); - postStartShellCmdAspect->setLabelText(Tr::tr("Post-quit on-device shell commands:")); + postStartShellCmd.setDisplayStyle(StringAspect::TextEditDisplay); + postStartShellCmd.setId(Constants::ANDROID_POSTFINISHSHELLCMDLIST); + postStartShellCmd.setSettingsKey("Android.PostStartShellCmdListKey"); + postStartShellCmd.setLabelText(Tr::tr("Post-quit on-device shell commands:")); setUpdater([this] { const BuildTargetInfo bti = buildTargetInfo(); @@ -92,6 +88,12 @@ public: connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); } + + EnvironmentAspect environment{this}; + ArgumentsAspect extraAppArgs{this}; + StringAspect amStartArgs{this}; + BaseStringListAspect preStartShellCmd{this}; + BaseStringListAspect postStartShellCmd{this}; }; AndroidRunConfigurationFactory::AndroidRunConfigurationFactory() From 4c02bc497c6b1981f3853669c60fbbd078c89dc3 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 12 Jul 2023 13:35:15 +0200 Subject: [PATCH 0300/1777] Core: Add some sanity check that settings containers don't auto-apply We use manual 'Apply' in the dialog. Also, mark a few pages as non-autoapply that were recently changed away from PagedSettings again which did that autmatically. Change-Id: Id78cac2770658b18c420813802a0e77443329f39 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/autotest/ctest/ctesttool.cpp | 1 + src/plugins/beautifier/beautifiertool.cpp | 1 + src/plugins/coreplugin/dialogs/ioptionspage.cpp | 7 +++++++ src/plugins/fakevim/fakevimactions.cpp | 2 ++ src/plugins/terminal/terminalsettings.cpp | 1 + src/plugins/vcpkg/vcpkgsettings.cpp | 1 + 6 files changed, 13 insertions(+) diff --git a/src/plugins/autotest/ctest/ctesttool.cpp b/src/plugins/autotest/ctest/ctesttool.cpp index 766e9cc1ffd..8933cc093ec 100644 --- a/src/plugins/autotest/ctest/ctesttool.cpp +++ b/src/plugins/autotest/ctest/ctesttool.cpp @@ -30,6 +30,7 @@ CTestTool::CTestTool() : Autotest::ITestTool(false) { setSettingsGroups("Autotest", "CTest"); + setAutoApply(false); setLayouter([this] { return Row { Form { diff --git a/src/plugins/beautifier/beautifiertool.cpp b/src/plugins/beautifier/beautifiertool.cpp index 85c70fee264..a8be6a48377 100644 --- a/src/plugins/beautifier/beautifiertool.cpp +++ b/src/plugins/beautifier/beautifiertool.cpp @@ -129,6 +129,7 @@ AbstractSettings::AbstractSettings(const QString &name, const QString &ending) .pathAppended(name)) { setSettingsGroups(Utils::Constants::BEAUTIFIER_SETTINGS_GROUP, name); + setAutoApply(false); command.setSettingsKey("command"); command.setExpectedKind(PathChooser::ExistingCommand); diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.cpp b/src/plugins/coreplugin/dialogs/ioptionspage.cpp index 31bf0069b9e..a4762169000 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.cpp +++ b/src/plugins/coreplugin/dialogs/ioptionspage.cpp @@ -164,6 +164,13 @@ void IOptionsPage::apply() if (m_settingsProvider) { AspectContainer *container = m_settingsProvider(); + QTC_ASSERT(container, return); + // Sanity check: Aspects in option pages should not autoapply. + if (!container->aspects().isEmpty()) { + BaseAspect *aspect = container->aspects().first(); + QTC_ASSERT(aspect, return); + QTC_ASSERT(!aspect->isAutoApply(), container->setAutoApply(false)); + } if (container->isDirty()) { container->apply(); container->writeSettings(); diff --git a/src/plugins/fakevim/fakevimactions.cpp b/src/plugins/fakevim/fakevimactions.cpp index c80d17c9722..77707500947 100644 --- a/src/plugins/fakevim/fakevimactions.cpp +++ b/src/plugins/fakevim/fakevimactions.cpp @@ -53,6 +53,8 @@ FakeVimSettings &settings() FakeVimSettings::FakeVimSettings() { + setAutoApply(false); + setup(&useFakeVim, false, "UseFakeVim", {}, Tr::tr("Use FakeVim")); // Specific FakeVim settings diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index 47811b230a7..f78173aa955 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -362,6 +362,7 @@ TerminalSettings &settings() TerminalSettings::TerminalSettings() { setSettingsGroup("Terminal"); + setAutoApply(false); enableTerminal.setSettingsKey("EnableTerminal"); enableTerminal.setLabelText(Tr::tr("Use internal terminal")); diff --git a/src/plugins/vcpkg/vcpkgsettings.cpp b/src/plugins/vcpkg/vcpkgsettings.cpp index 8f026c5654a..338c77df8df 100644 --- a/src/plugins/vcpkg/vcpkgsettings.cpp +++ b/src/plugins/vcpkg/vcpkgsettings.cpp @@ -31,6 +31,7 @@ VcpkgSettings &settings() VcpkgSettings::VcpkgSettings() { setSettingsGroup("Vcpkg"); + setAutoApply(false); vcpkgRoot.setSettingsKey("VcpkgRoot"); vcpkgRoot.setExpectedKind(PathChooser::ExistingDirectory); From ecd524f12bfc06ee5048c8cc3ca08bad2808ab1f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 12:30:59 +0200 Subject: [PATCH 0301/1777] RemoteLinux: Use aspects directly in TarPackageCreationStep Change-Id: If9cdc95184cbf6ec72b326b41fafdd0240c5b060 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../remotelinux/tarpackagecreationstep.cpp | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/plugins/remotelinux/tarpackagecreationstep.cpp b/src/plugins/remotelinux/tarpackagecreationstep.cpp index 7c577812da1..fb169b51fc5 100644 --- a/src/plugins/remotelinux/tarpackagecreationstep.cpp +++ b/src/plugins/remotelinux/tarpackagecreationstep.cpp @@ -29,9 +29,6 @@ using namespace Utils; namespace RemoteLinux::Internal { -const char IgnoreMissingFilesKey[] = "RemoteLinux.TarPackageCreationStep.IgnoreMissingFiles"; -const char IncrementalDeploymentKey[] = "RemoteLinux.TarPackageCreationStep.IncrementalDeployment"; - const int TarBlockSize = 512; struct TarFileHeader { @@ -83,8 +80,8 @@ private: FilePath m_tarFilePath; bool m_deploymentDataModified = false; DeploymentTimeInfo m_deployTimes; - BoolAspect *m_incrementalDeploymentAspect = nullptr; - BoolAspect *m_ignoreMissingFilesAspect = nullptr; + BoolAspect m_incrementalDeployment{this}; + BoolAspect m_ignoreMissingFiles{this}; bool m_packagingNeeded = false; QList<DeployableFile> m_files; @@ -99,15 +96,14 @@ TarPackageCreationStep::TarPackageCreationStep(BuildStepList *bsl, Id id) }); m_deploymentDataModified = true; - m_ignoreMissingFilesAspect = addAspect<BoolAspect>(); - m_ignoreMissingFilesAspect->setLabel(Tr::tr("Ignore missing files"), - BoolAspect::LabelPlacement::AtCheckBox); - m_ignoreMissingFilesAspect->setSettingsKey(IgnoreMissingFilesKey); + m_incrementalDeployment.setSettingsKey( + "RemoteLinux.TarPackageCreationStep.IncrementalDeployment"); + m_incrementalDeployment.setLabelText(Tr::tr("Package modified files only")); + m_incrementalDeployment.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); - m_incrementalDeploymentAspect = addAspect<BoolAspect>(); - m_incrementalDeploymentAspect->setLabel(Tr::tr("Package modified files only"), - BoolAspect::LabelPlacement::AtCheckBox); - m_incrementalDeploymentAspect->setSettingsKey(IncrementalDeploymentKey); + m_ignoreMissingFiles.setSettingsKey("RemoteLinux.TarPackageCreationStep.IgnoreMissingFiles"); + m_ignoreMissingFiles.setLabelText(Tr::tr("Ignore missing files")); + m_ignoreMissingFiles.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); setSummaryUpdater([this] { FilePath path = packageFilePath(); @@ -137,7 +133,7 @@ void TarPackageCreationStep::doRun() { const QList<DeployableFile> &files = target()->deploymentData().allFiles(); - if (m_incrementalDeploymentAspect->value()) { + if (m_incrementalDeployment()) { m_files.clear(); for (const DeployableFile &file : files) addNeededDeploymentFiles(file, kit()); @@ -167,7 +163,7 @@ void TarPackageCreationStep::doRun() this, &TarPackageCreationStep::deployFinished); }); auto future = Utils::asyncRun(&TarPackageCreationStep::doPackage, this, - m_tarFilePath, m_ignoreMissingFilesAspect->value()); + m_tarFilePath, m_ignoreMissingFiles()); watcher->setFuture(future); m_synchronizer.addFuture(future); } From f507eec20758c28c4dde84879b98b0ba0d3fc691 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 11:08:51 +0200 Subject: [PATCH 0302/1777] AndroidBuildApkStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I40fb62ae33e436ba79cad852bf4661f72fb45bda Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/android/androidbuildapkstep.cpp | 89 +++++++++++---------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 27b86144504..5556db1c940 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -484,11 +484,6 @@ AndroidBuildApkStep::AndroidBuildApkStep(BuildStepList *parent, Utils::Id id) if (format == OutputFormat::Stderr) stdError(string); }); - - setDoneHook([this](bool success) { - if (m_openPackageLocationForRun && success) - QTimer::singleShot(0, this, &AndroidBuildApkStep::showInGraphicalShell); - }); } bool AndroidBuildApkStep::init() @@ -703,31 +698,18 @@ static bool copyFileIfNewer(const FilePath &sourceFilePath, void AndroidBuildApkStep::doRun() { - if (m_skipBuilding) { - reportWarningOrError(Tr::tr("Android deploy settings file not found, not building an APK."), - Task::Error); - emit finished(true); - return; - } - - if (AndroidManager::skipInstallationAndPackageSteps(target())) { - reportWarningOrError(Tr::tr("Product type is not an application, not building an APK."), - Task::Warning); - emit finished(true); - return; - } - - auto setup = [this] { - const auto androidAbis = AndroidManager::applicationAbis(target()); - const QString buildKey = target()->activeBuildKey(); + using namespace Tasking; + const auto setupHelper = [this] { QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit()); if (!version) { reportWarningOrError(Tr::tr("The Qt version for kit %1 is invalid.") - .arg(kit()->displayName()), Task::Error); + .arg(kit()->displayName()), Task::Error); return false; } + const auto androidAbis = AndroidManager::applicationAbis(target()); + const QString buildKey = target()->activeBuildKey(); const FilePath buildDir = buildDirectory(); const FilePath androidBuildDir = AndroidManager::androidBuildDirectory(target()); for (const auto &abi : androidAbis) { @@ -751,24 +733,23 @@ void AndroidBuildApkStep::doRun() if (!from.copyFile(to)) { reportWarningOrError(Tr::tr("Cannot copy the target's lib file %1 to the " - "Android build folder %2.") - .arg(fileName, androidLibsDir.toUserOutput()), + "Android build folder %2.") + .arg(fileName, androidLibsDir.toUserOutput()), Task::Error); return false; } } } - } - bool inputExists = m_inputFile.exists(); + const bool inputExists = m_inputFile.exists(); if (inputExists && !AndroidManager::isQtCreatorGenerated(m_inputFile)) return true; // use the generated file if it was not generated by qtcreator BuildSystem *bs = buildSystem(); const FilePaths targets = Utils::transform( - bs->extraData(buildKey, Android::Constants::AndroidTargets).toStringList(), - &FilePath::fromUserInput); + bs->extraData(buildKey, Android::Constants::AndroidTargets).toStringList(), + &FilePath::fromUserInput); if (targets.isEmpty()) return inputExists; // qmake does this job for us @@ -781,9 +762,9 @@ void AndroidBuildApkStep::doRun() for (const FilePath &target : targets) { if (!copyFileIfNewer(target, androidLibsDir.pathAppended(target.fileName()))) { reportWarningOrError( - Tr::tr("Cannot copy file \"%1\" to Android build libs folder \"%2\".") - .arg(target.toUserOutput()).arg(androidLibsDir.toUserOutput()), - Task::Error); + Tr::tr("Cannot copy file \"%1\" to Android build libs folder \"%2\".") + .arg(target.toUserOutput()).arg(androidLibsDir.toUserOutput()), + Task::Error); return false; } } @@ -819,41 +800,61 @@ void AndroidBuildApkStep::doRun() } deploySettings["application-binary"] = applicationBinary; - QString extraLibs = bs->extraData(buildKey, Android::Constants::AndroidExtraLibs).toString(); + const QString extraLibs = bs->extraData(buildKey, Android::Constants::AndroidExtraLibs).toString(); if (!extraLibs.isEmpty()) deploySettings["android-extra-libs"] = extraLibs; - QString androidSrcs = bs->extraData(buildKey, Android::Constants::AndroidPackageSourceDir).toString(); + const QString androidSrcs = bs->extraData(buildKey, Android::Constants::AndroidPackageSourceDir).toString(); if (!androidSrcs.isEmpty()) deploySettings["android-package-source-directory"] = androidSrcs; - QString qmlImportPath = bs->extraData(buildKey, "QML_IMPORT_PATH").toString(); + const QString qmlImportPath = bs->extraData(buildKey, "QML_IMPORT_PATH").toString(); if (!qmlImportPath.isEmpty()) deploySettings["qml-import-paths"] = qmlImportPath; QString qmlRootPath = bs->extraData(buildKey, "QML_ROOT_PATH").toString(); if (qmlRootPath.isEmpty()) qmlRootPath = target()->project()->rootProjectDirectory().toString(); - deploySettings["qml-root-path"] = qmlRootPath; + deploySettings["qml-root-path"] = qmlRootPath; QFile f{m_inputFile.toString()}; if (!f.open(QIODevice::WriteOnly)) { reportWarningOrError(Tr::tr("Cannot open androiddeployqt input file \"%1\" for writing.") - .arg(m_inputFile.toUserOutput()), Task::Error); + .arg(m_inputFile.toUserOutput()), Task::Error); return false; } f.write(QJsonDocument{deploySettings}.toJson()); return true; }; - if (!setup()) { - reportWarningOrError(Tr::tr("Cannot set up \"%1\", not building an APK.").arg(displayName()), - Task::Error); - emit finished(false); - return; - } + const auto onSetup = [this, setupHelper] { + if (m_skipBuilding) { + reportWarningOrError(Tr::tr("Android deploy settings file not found, " + "not building an APK."), Task::Error); + return SetupResult::StopWithDone; + } + if (AndroidManager::skipInstallationAndPackageSteps(target())) { + reportWarningOrError(Tr::tr("Product type is not an application, not building an APK."), + Task::Warning); + return SetupResult::StopWithDone; + } + if (setupHelper()) + return SetupResult::Continue; + reportWarningOrError(Tr::tr("Cannot set up \"%1\", not building an APK.") + .arg(displayName()), Task::Error); + return SetupResult::StopWithError; + }; + const auto onDone = [this] { + if (m_openPackageLocationForRun) + QTimer::singleShot(0, this, &AndroidBuildApkStep::showInGraphicalShell); + }; - AbstractProcessStep::doRun(); + const Group root { + onGroupSetup(onSetup), + onGroupDone(onDone), + defaultProcessTask() + }; + runTaskTree(root); } void AndroidBuildApkStep::reportWarningOrError(const QString &message, Task::TaskType type) From bc2c2bbae943e0ecba18675c78522fa3f7b0e6a7 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 14:09:02 +0200 Subject: [PATCH 0303/1777] AndroidPackageInstallationStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I18d1188a18559bb8030a2c966ea3764833ad96f8 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../androidpackageinstallationstep.cpp | 83 ++++++++++--------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp index e29bac3476b..bd3ddfb7f0b 100644 --- a/src/plugins/android/androidpackageinstallationstep.cpp +++ b/src/plugins/android/androidpackageinstallationstep.cpp @@ -122,53 +122,56 @@ void AndroidPackageInstallationStep::setupOutputFormatter(OutputFormatter *forma void AndroidPackageInstallationStep::doRun() { - if (AndroidManager::skipInstallationAndPackageSteps(target())) { - reportWarningOrError(Tr::tr("Product type is not an application, not running the " - "Make install step."), - Task::Warning); - emit finished(true); - return; - } + using namespace Tasking; - QString error; - for (const QString &dir : std::as_const(m_androidDirsToClean)) { - FilePath androidDir = FilePath::fromString(dir); - if (!dir.isEmpty() && androidDir.exists()) { - emit addOutput(Tr::tr("Removing directory %1").arg(dir), OutputFormat::NormalMessage); - if (!androidDir.removeRecursively(&error)) { - reportWarningOrError(Tr::tr("Failed to clean \"%1\" from the previous build, with " - "error:\n%2").arg(androidDir.toUserOutput()).arg(error), - Task::TaskType::Error); - emit finished(false); - return; + const auto onSetup = [this] { + if (AndroidManager::skipInstallationAndPackageSteps(target())) { + reportWarningOrError(Tr::tr("Product type is not an application, not running the " + "Make install step."), Task::Warning); + return SetupResult::StopWithDone; + } + + for (const QString &dir : std::as_const(m_androidDirsToClean)) { + const FilePath androidDir = FilePath::fromString(dir); + if (!dir.isEmpty() && androidDir.exists()) { + emit addOutput(Tr::tr("Removing directory %1").arg(dir), OutputFormat::NormalMessage); + QString error; + if (!androidDir.removeRecursively(&error)) { + reportWarningOrError(Tr::tr("Failed to clean \"%1\" from the previous build, " + "with error:\n%2").arg(androidDir.toUserOutput()).arg(error), + Task::TaskType::Error); + return SetupResult::StopWithError; + } } } - } - AbstractProcessStep::doRun(); - // NOTE: This is a workaround for QTCREATORBUG-24155 - // Needed for Qt 5.15.0 and Qt 5.14.x versions - if (buildType() == BuildConfiguration::BuildType::Debug) { - QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit()); - if (version && version->qtVersion() >= QVersionNumber(5, 14) - && version->qtVersion() <= QVersionNumber(5, 15, 0)) { - const QString assetsDebugDir = nativeAndroidBuildPath().append( - "/assets/--Added-by-androiddeployqt--/"); - QDir dir; - if (!dir.exists(assetsDebugDir)) - dir.mkpath(assetsDebugDir); + // NOTE: This is a workaround for QTCREATORBUG-24155 + // Needed for Qt 5.15.0 and Qt 5.14.x versions + if (buildType() == BuildConfiguration::BuildType::Debug) { + QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit()); + if (version && version->qtVersion() >= QVersionNumber(5, 14) + && version->qtVersion() <= QVersionNumber(5, 15, 0)) { + const QString assetsDebugDir = nativeAndroidBuildPath().append( + "/assets/--Added-by-androiddeployqt--/"); + QDir dir; + if (!dir.exists(assetsDebugDir)) + dir.mkpath(assetsDebugDir); - QFile file(assetsDebugDir + "debugger.command"); - if (file.open(QIODevice::WriteOnly)) { - qCDebug(packageInstallationStepLog, "Successful added %s to the package.", - qPrintable(file.fileName())); - } else { - qCDebug(packageInstallationStepLog, - "Cannot add %s to the package. The QML debugger might not work properly.", - qPrintable(file.fileName())); + QFile file(assetsDebugDir + "debugger.command"); + if (file.open(QIODevice::WriteOnly)) { + qCDebug(packageInstallationStepLog, "Successful added %s to the package.", + qPrintable(file.fileName())); + } else { + qCDebug(packageInstallationStepLog, + "Cannot add %s to the package. The QML debugger might not work properly.", + qPrintable(file.fileName())); + } } } - } + return SetupResult::Continue; + }; + + runTaskTree({onGroupSetup(onSetup), defaultProcessTask()}); } void AndroidPackageInstallationStep::reportWarningOrError(const QString &message, From 7c8948bef4774d64bd79d3b5ba7b04444d0bd7e3 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 17:59:56 +0200 Subject: [PATCH 0304/1777] WebAssembly: Self-register aspects in runconfiguration No real benefit in this particular case, but the general pattern now. Change-Id: Ia06d3221a2ccd4b7ab429f6e045c11fffffe99ad Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../webassemblyrunconfiguration.cpp | 27 ++++++++++--------- .../webassemblyrunconfigurationaspects.cpp | 8 ++++-- .../webassemblyrunconfigurationaspects.h | 6 +++-- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/plugins/webassembly/webassemblyrunconfiguration.cpp b/src/plugins/webassembly/webassemblyrunconfiguration.cpp index 32f1bf581bb..7459853f508 100644 --- a/src/plugins/webassembly/webassemblyrunconfiguration.cpp +++ b/src/plugins/webassembly/webassemblyrunconfiguration.cpp @@ -69,25 +69,28 @@ class EmrunRunConfiguration : public ProjectExplorer::RunConfiguration { public: EmrunRunConfiguration(Target *target, Utils::Id id) - : RunConfiguration(target, id) + : RunConfiguration(target, id) { - auto webBrowserAspect = addAspect<WebBrowserSelectionAspect>(target); + webBrowser.setTarget(target); - auto effectiveEmrunCall = addAspect<StringAspect>(); - effectiveEmrunCall->setLabelText(Tr::tr("Effective emrun call:")); - effectiveEmrunCall->setDisplayStyle(StringAspect::TextEditDisplay); - effectiveEmrunCall->setReadOnly(true); + effectiveEmrunCall.setLabelText(Tr::tr("Effective emrun call:")); + effectiveEmrunCall.setDisplayStyle(StringAspect::TextEditDisplay); + effectiveEmrunCall.setReadOnly(true); - setUpdater([this, target, effectiveEmrunCall, webBrowserAspect] { - effectiveEmrunCall->setValue(emrunCommand(target, - buildKey(), - webBrowserAspect->currentBrowser(), - "<port>").toUserOutput()); + setUpdater([this, target] { + effectiveEmrunCall.setValue(emrunCommand(target, + buildKey(), + webBrowser.currentBrowser(), + "<port>").toUserOutput()); }); - connect(webBrowserAspect, &BaseAspect::changed, this, &RunConfiguration::update); + connect(&webBrowser, &BaseAspect::changed, this, &RunConfiguration::update); connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); } + +private: + WebBrowserSelectionAspect webBrowser{this}; + StringAspect effectiveEmrunCall{this}; }; class EmrunRunWorker : public SimpleTargetRunner diff --git a/src/plugins/webassembly/webassemblyrunconfigurationaspects.cpp b/src/plugins/webassembly/webassemblyrunconfigurationaspects.cpp index 05b7e89e821..74ee0ded60f 100644 --- a/src/plugins/webassembly/webassemblyrunconfigurationaspects.cpp +++ b/src/plugins/webassembly/webassemblyrunconfigurationaspects.cpp @@ -41,9 +41,13 @@ static WebBrowserEntries emrunBrowsers(ProjectExplorer::Target *target) return result; } -WebBrowserSelectionAspect::WebBrowserSelectionAspect(ProjectExplorer::Target *target) - : m_availableBrowsers(emrunBrowsers(target)) +WebBrowserSelectionAspect::WebBrowserSelectionAspect(AspectContainer *container) + : BaseAspect(container) +{} + +void WebBrowserSelectionAspect::setTarget(ProjectExplorer::Target *target) { + m_availableBrowsers = emrunBrowsers(target); if (!m_availableBrowsers.isEmpty()) { const int defaultIndex = qBound(0, m_availableBrowsers.count() - 1, 1); m_currentBrowser = m_availableBrowsers.at(defaultIndex).first; diff --git a/src/plugins/webassembly/webassemblyrunconfigurationaspects.h b/src/plugins/webassembly/webassemblyrunconfigurationaspects.h index 8a3cc24bdb2..db584d33a19 100644 --- a/src/plugins/webassembly/webassemblyrunconfigurationaspects.h +++ b/src/plugins/webassembly/webassemblyrunconfigurationaspects.h @@ -18,7 +18,9 @@ class WebBrowserSelectionAspect : public Utils::BaseAspect Q_OBJECT public: - WebBrowserSelectionAspect(ProjectExplorer::Target *target); + WebBrowserSelectionAspect(Utils::AspectContainer *container); + + void setTarget(ProjectExplorer::Target *target); void addToLayout(Layouting::LayoutItem &parent) override; @@ -37,7 +39,7 @@ public: private: QComboBox *m_webBrowserComboBox = nullptr; QString m_currentBrowser; - const WebBrowserEntries m_availableBrowsers; + WebBrowserEntries m_availableBrowsers; }; } // namespace Internal From c2b5a75d769f26bb2267216e7a65042eee0cd3ee Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 12:09:31 +0200 Subject: [PATCH 0305/1777] QmlProjectManager: Prepare special aspects for auto-registration Change-Id: I9b5e019dfeaf394107a190e78e8880b4f16b9ee9 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../qmlprojectmanager/qmlmainfileaspect.cpp | 9 ++++-- .../qmlprojectmanager/qmlmainfileaspect.h | 3 +- .../qmlmultilanguageaspect.cpp | 28 +++++++++++-------- .../qmlmultilanguageaspect.h | 4 ++- .../qmlprojectrunconfiguration.cpp | 6 ++-- 5 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/plugins/qmlprojectmanager/qmlmainfileaspect.cpp b/src/plugins/qmlprojectmanager/qmlmainfileaspect.cpp index 349c23a6cf4..ea3edc3542c 100644 --- a/src/plugins/qmlprojectmanager/qmlmainfileaspect.cpp +++ b/src/plugins/qmlprojectmanager/qmlmainfileaspect.cpp @@ -37,8 +37,8 @@ static bool caseInsensitiveLessThan(const FilePath &s1, const FilePath &s2) return s1.toString().toCaseFolded() < s2.toString().toCaseFolded(); } -QmlMainFileAspect::QmlMainFileAspect(Target *target) - : m_target(target) +QmlMainFileAspect::QmlMainFileAspect(AspectContainer *container) + : BaseAspect(container) , m_scriptFile(M_CURRENT_FILE) { addDataExtractor(this, &QmlMainFileAspect::mainScript, &Data::mainScript); @@ -158,6 +158,11 @@ void QmlMainFileAspect::setMainScript(int index) } } +void QmlMainFileAspect::setTarget(ProjectExplorer::Target *target) +{ + m_target = target; +} + void QmlMainFileAspect::setScriptSource(MainScriptSource source, const QString &settingsPath) { if (source == FileInEditor) { diff --git a/src/plugins/qmlprojectmanager/qmlmainfileaspect.h b/src/plugins/qmlprojectmanager/qmlmainfileaspect.h index 3c75e4744a2..bdf9f1d6a38 100644 --- a/src/plugins/qmlprojectmanager/qmlmainfileaspect.h +++ b/src/plugins/qmlprojectmanager/qmlmainfileaspect.h @@ -27,7 +27,7 @@ class QMLPROJECTMANAGER_EXPORT QmlMainFileAspect : public Utils::BaseAspect Q_OBJECT public: - explicit QmlMainFileAspect(ProjectExplorer::Target *target); + explicit QmlMainFileAspect(Utils::AspectContainer *container = nullptr); ~QmlMainFileAspect() override; enum MainScriptSource { @@ -50,6 +50,7 @@ public: MainScriptSource mainScriptSource() const; void setMainScript(int index); + void setTarget(ProjectExplorer::Target *target); void setScriptSource(MainScriptSource source, const QString &settingsPath = QString()); Utils::FilePath mainScript() const; diff --git a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp index db0001ac70f..39c8213e849 100644 --- a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp +++ b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp @@ -14,6 +14,11 @@ #include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> +using namespace ProjectExplorer; +using namespace Utils; + +namespace QmlProjectManager { + static bool isMultilanguagePresent() { const QVector<ExtensionSystem::PluginSpec *> &specs = ExtensionSystem::PluginManager::plugins(); @@ -24,7 +29,7 @@ static bool isMultilanguagePresent() != specs.cend(); } -static Utils::FilePath getMultilanguageDatabaseFilePath(ProjectExplorer::Target *target) +static FilePath getMultilanguageDatabaseFilePath(ProjectExplorer::Target *target) { if (target) { auto filePath = target->project()->projectDirectory().pathAppended("translations.db"); @@ -48,11 +53,8 @@ static QObject *getPreviewPlugin() return nullptr; } - -namespace QmlProjectManager { - -QmlMultiLanguageAspect::QmlMultiLanguageAspect(ProjectExplorer::Target *target) - : m_target(target) +QmlMultiLanguageAspect::QmlMultiLanguageAspect(AspectContainer *container) + : BoolAspect(container) { setVisible(isMultilanguagePresent()); setSettingsKey(Constants::USE_MULTILANGUAGE_KEY); @@ -66,8 +68,7 @@ QmlMultiLanguageAspect::QmlMultiLanguageAspect(ProjectExplorer::Target *target) addDataExtractor(this, &QmlMultiLanguageAspect::origin, &Data::origin); connect(this, &BoolAspect::changed, this, [this] { - for (ProjectExplorer::RunControl *runControl : - ProjectExplorer::ProjectExplorerPlugin::allRunControls()) { + for (RunControl *runControl : ProjectExplorerPlugin::allRunControls()) { if (runControl->aspect<QmlMultiLanguageAspect>()->origin == this) runControl->initiateStop(); } @@ -78,6 +79,11 @@ QmlMultiLanguageAspect::~QmlMultiLanguageAspect() { } +void QmlMultiLanguageAspect::setTarget(Target *target) +{ + m_target = target; +} + void QmlMultiLanguageAspect::setCurrentLocale(const QString &locale) { if (m_currentLocale == locale) @@ -114,19 +120,19 @@ void QmlMultiLanguageAspect::fromMap(const QVariantMap &map) QmlMultiLanguageAspect *QmlMultiLanguageAspect::current() { - if (auto project = ProjectExplorer::ProjectManager::startupProject()) + if (auto project = ProjectManager::startupProject()) return current(project); return {}; } -QmlMultiLanguageAspect *QmlMultiLanguageAspect::current(ProjectExplorer::Project *project) +QmlMultiLanguageAspect *QmlMultiLanguageAspect::current(Project *project) { if (auto target = project->activeTarget()) return current(target); return {}; } -QmlMultiLanguageAspect *QmlMultiLanguageAspect::current(ProjectExplorer::Target *target) +QmlMultiLanguageAspect *QmlMultiLanguageAspect::current(Target *target) { if (!target) return {}; diff --git a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.h b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.h index b3c047e75b1..b7188ce13f0 100644 --- a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.h +++ b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.h @@ -15,9 +15,11 @@ class QMLPROJECTMANAGER_EXPORT QmlMultiLanguageAspect : public Utils::BoolAspect { Q_OBJECT public: - explicit QmlMultiLanguageAspect(ProjectExplorer::Target *target); + explicit QmlMultiLanguageAspect(Utils::AspectContainer *container = nullptr); ~QmlMultiLanguageAspect() override; + void setTarget(ProjectExplorer::Target *target); + QString currentLocale() const; void setCurrentLocale(const QString &locale); Utils::FilePath databaseFilePath() const; diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 4b64440c5fc..7cf8306a1ee 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -120,14 +120,16 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) return cmd; }); - m_qmlMainFileAspect = addAspect<QmlMainFileAspect>(target); + m_qmlMainFileAspect = addAspect<QmlMainFileAspect>(); + m_qmlMainFileAspect->setTarget(target); connect(m_qmlMainFileAspect, &QmlMainFileAspect::changed, this, &RunConfiguration::update); createQtVersionAspect(); connect(target, &Target::kitChanged, this, &RunConfiguration::update); - m_multiLanguageAspect = addAspect<QmlMultiLanguageAspect>(target); + m_multiLanguageAspect = addAspect<QmlMultiLanguageAspect>(); + m_multiLanguageAspect->setTarget(target); auto buildSystem = qobject_cast<const QmlBuildSystem *>(activeBuildSystem()); if (buildSystem) m_multiLanguageAspect->setValue(buildSystem->multilanguageSupport()); From c56301f4ff25c6dcb9a80a01132f7c7f36cd4b32 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 14:08:10 +0200 Subject: [PATCH 0306/1777] AutoTest: De-virtualize some properties Mostly a matter of taste. Change-Id: If4f329d7f73361ee312387d0aa48d26fc1d98ff0 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../autotest/boost/boosttestframework.cpp | 20 ++++------------ .../autotest/boost/boosttestframework.h | 3 --- .../autotest/catch/catchtestframework.cpp | 20 ++++------------ .../autotest/catch/catchtestframework.h | 4 ---- src/plugins/autotest/ctest/ctesttool.cpp | 14 +++-------- src/plugins/autotest/ctest/ctesttool.h | 3 --- src/plugins/autotest/gtest/gtestframework.cpp | 20 ++++------------ src/plugins/autotest/gtest/gtestframework.h | 3 --- src/plugins/autotest/itestframework.cpp | 17 +++++++------ src/plugins/autotest/itestframework.h | 24 +++++++++++-------- .../autotest/qtest/qttestframework.cpp | 21 ++++------------ src/plugins/autotest/qtest/qttestframework.h | 3 --- .../autotest/quick/quicktestframework.cpp | 22 ++++++----------- .../autotest/quick/quicktestframework.h | 5 +--- 14 files changed, 50 insertions(+), 129 deletions(-) diff --git a/src/plugins/autotest/boost/boosttestframework.cpp b/src/plugins/autotest/boost/boosttestframework.cpp index 216fa20f3a7..546f124220d 100644 --- a/src/plugins/autotest/boost/boosttestframework.cpp +++ b/src/plugins/autotest/boost/boosttestframework.cpp @@ -25,9 +25,12 @@ BoostTestFramework &theBoostTestFramework() } BoostTestFramework::BoostTestFramework() - : ITestFramework(true) { + setActive(true); setSettingsGroups("Autotest", "BoostTest"); + setName(BoostTest::Constants::FRAMEWORK_NAME); + setDisplayName(Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); + setPriority(BoostTest::Constants::FRAMEWORK_PRIORITY); setLayouter([this] { return Row { Form { @@ -134,21 +137,6 @@ ITestTreeItem *BoostTestFramework::createRootNode() return new BoostTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); } -const char *BoostTestFramework::name() const -{ - return BoostTest::Constants::FRAMEWORK_NAME; -} - -QString BoostTestFramework::displayName() const -{ - return Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); -} - -unsigned BoostTestFramework::priority() const -{ - return BoostTest::Constants::FRAMEWORK_PRIORITY; -} - // BoostSettingsPage class BoostSettingsPage final : public Core::IOptionsPage diff --git a/src/plugins/autotest/boost/boosttestframework.h b/src/plugins/autotest/boost/boosttestframework.h index 39e999cb3d4..582ba5e6924 100644 --- a/src/plugins/autotest/boost/boosttestframework.h +++ b/src/plugins/autotest/boost/boosttestframework.h @@ -35,9 +35,6 @@ class BoostTestFramework : public ITestFramework public: BoostTestFramework(); - const char *name() const override; - QString displayName() const override; - unsigned priority() const override; ITestParser *createTestParser() override; ITestTreeItem *createRootNode() override; diff --git a/src/plugins/autotest/catch/catchtestframework.cpp b/src/plugins/autotest/catch/catchtestframework.cpp index d93fe060d39..b29a6aa7be6 100644 --- a/src/plugins/autotest/catch/catchtestframework.cpp +++ b/src/plugins/autotest/catch/catchtestframework.cpp @@ -25,9 +25,12 @@ CatchFramework &theCatchFramework() } CatchFramework::CatchFramework() - : ITestFramework(true) { + setActive(true); setSettingsGroups("Autotest", "Catch2"); + setPriority(12); + setName("Catch"); + setDisplayName(Tr::tr("Catch Test")); setLayouter([this] { return Row { Form { @@ -116,21 +119,6 @@ CatchFramework::CatchFramework() warnOnEmpty.setToolTip(Tr::tr("Warns if a test section does not check any assertion.")); } -const char *CatchFramework::name() const -{ - return "Catch"; -} - -QString CatchFramework::displayName() const -{ - return Tr::tr("Catch Test"); -} - -unsigned CatchFramework::priority() const -{ - return 12; -} - ITestParser *CatchFramework::createTestParser() { return new CatchTestParser(this); diff --git a/src/plugins/autotest/catch/catchtestframework.h b/src/plugins/autotest/catch/catchtestframework.h index 225a99c849f..5b5b3f27bda 100644 --- a/src/plugins/autotest/catch/catchtestframework.h +++ b/src/plugins/autotest/catch/catchtestframework.h @@ -29,10 +29,6 @@ public: Utils::BoolAspect visibleWhitespace{this}; Utils::BoolAspect warnOnEmpty{this}; - const char *name() const override; - QString displayName() const override; - unsigned priority() const override; - protected: ITestParser *createTestParser() override; ITestTreeItem *createRootNode() override; diff --git a/src/plugins/autotest/ctest/ctesttool.cpp b/src/plugins/autotest/ctest/ctesttool.cpp index 8933cc093ec..592b408faed 100644 --- a/src/plugins/autotest/ctest/ctesttool.cpp +++ b/src/plugins/autotest/ctest/ctesttool.cpp @@ -27,10 +27,12 @@ CTestTool &theCTestTool() } CTestTool::CTestTool() - : Autotest::ITestTool(false) { + setActive(false); setSettingsGroups("Autotest", "CTest"); setAutoApply(false); + setName("CTest"); + setDisplayName(Tr::tr("CTest")); setLayouter([this] { return Row { Form { @@ -157,16 +159,6 @@ ITestTreeItem *CTestTool::createItemFromTestCaseInfo(const ProjectExplorer::Test return item; } -const char *CTestTool::name() const -{ - return "CTest"; -} - -QString CTestTool::displayName() const -{ - return Tr::tr("CTest"); -} - ITestTreeItem *CTestTool::createRootNode() { return new CTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); diff --git a/src/plugins/autotest/ctest/ctesttool.h b/src/plugins/autotest/ctest/ctesttool.h index 1549a7db6e1..3d65712c0fc 100644 --- a/src/plugins/autotest/ctest/ctesttool.h +++ b/src/plugins/autotest/ctest/ctesttool.h @@ -16,11 +16,8 @@ public: ITestTreeItem *createItemFromTestCaseInfo(const ProjectExplorer::TestCaseInfo &tci) final; - const char *name() const final; - QString displayName() const final; ITestTreeItem *createRootNode() final; - QStringList activeSettingsAsOptions() const; Utils::IntegerAspect repetitionCount{this}; diff --git a/src/plugins/autotest/gtest/gtestframework.cpp b/src/plugins/autotest/gtest/gtestframework.cpp index 79844fa5df1..c046ad774c9 100644 --- a/src/plugins/autotest/gtest/gtestframework.cpp +++ b/src/plugins/autotest/gtest/gtestframework.cpp @@ -29,9 +29,12 @@ GTestFramework &theGTestFramework() } GTestFramework::GTestFramework() - : ITestFramework(true) { + setActive(true); setSettingsGroups("Autotest", "GTest"); + setName(GTest::Constants::FRAMEWORK_NAME); + setDisplayName(Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); + setPriority(GTest::Constants::FRAMEWORK_PRIORITY); setLayouter([this] { return Row { Form { @@ -142,21 +145,6 @@ ITestTreeItem *GTestFramework::createRootNode() return new GTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); } -const char *GTestFramework::name() const -{ - return GTest::Constants::FRAMEWORK_NAME; -} - -QString GTestFramework::displayName() const -{ - return Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); -} - -unsigned GTestFramework::priority() const -{ - return GTest::Constants::FRAMEWORK_PRIORITY; -} - QString GTestFramework::currentGTestFilter() { return theGTestFramework().gtestFilter(); diff --git a/src/plugins/autotest/gtest/gtestframework.h b/src/plugins/autotest/gtest/gtestframework.h index 720a3d9a5b5..ff9e2766b58 100644 --- a/src/plugins/autotest/gtest/gtestframework.h +++ b/src/plugins/autotest/gtest/gtestframework.h @@ -29,9 +29,6 @@ public: QStringList testNameForSymbolName(const QString &symbolName) const override; - const char *name() const override; - QString displayName() const override; - unsigned priority() const override; QString groupingToolTip() const override; ITestParser *createTestParser() override; ITestTreeItem *createRootNode() override; diff --git a/src/plugins/autotest/itestframework.cpp b/src/plugins/autotest/itestframework.cpp index f8ccd8e85d3..513fa96411d 100644 --- a/src/plugins/autotest/itestframework.cpp +++ b/src/plugins/autotest/itestframework.cpp @@ -12,9 +12,7 @@ using namespace Utils; namespace Autotest { -ITestBase::ITestBase(bool activeByDefault, const ITestBase::TestBaseType type) - : m_active(activeByDefault) - , m_type(type) +ITestBase::ITestBase() {} Id ITestBase::id() const @@ -32,10 +30,9 @@ void ITestBase::resetRootNode() m_rootNode = nullptr; } - -ITestFramework::ITestFramework(bool activeByDefault) - : ITestBase(activeByDefault, ITestBase::Framework) +ITestFramework::ITestFramework() { + setType(ITestBase::Framework); setAutoApply(false); } @@ -64,9 +61,11 @@ QStringList ITestFramework::testNameForSymbolName(const QString &) const return {}; } -ITestTool::ITestTool(bool activeByDefault) - : ITestBase(activeByDefault, ITestBase::Tool) -{} +ITestTool::ITestTool() +{ + setType(ITestBase::Tool); + setPriority(255); +} ITestTreeItem *ITestTool::rootNode() { diff --git a/src/plugins/autotest/itestframework.h b/src/plugins/autotest/itestframework.h index 5621d9d8377..8eff4e30458 100644 --- a/src/plugins/autotest/itestframework.h +++ b/src/plugins/autotest/itestframework.h @@ -27,15 +27,14 @@ public: Tool = 0x2 }; - explicit ITestBase(bool activeByDefault, const TestBaseType type); + ITestBase(); virtual ~ITestBase() = default; - virtual const char *name() const = 0; - virtual QString displayName() const = 0; - virtual unsigned priority() const = 0; // should this be modifyable? + const char *name() const { return m_name; } + QString displayName() const { return m_displayName; } TestBaseType type() const { return m_type; } - Utils::Id id() const; + int priority() const { return m_priority; } bool active() const { return m_active; } void setActive(bool active) { m_active = active; } @@ -46,12 +45,20 @@ public: virtual ITestTool *asTestTool() { return nullptr; } protected: + void setPriority(int priority) { m_priority = priority; } + void setDisplayName(const QString &displayName) { m_displayName = displayName; } + void setType(const TestBaseType type) { m_type = type; } + void setName(const char *name) { m_name = name; } + virtual ITestTreeItem *createRootNode() = 0; private: ITestTreeItem *m_rootNode = nullptr; bool m_active = false; TestBaseType m_type = None; + int m_priority = 0; + QString m_displayName; + const char *m_name = nullptr; friend class ITestFramework; friend class ITestTool; @@ -60,7 +67,7 @@ private: class ITestFramework : public ITestBase { public: - explicit ITestFramework(bool activeByDefault); + ITestFramework(); ~ITestFramework() override; TestTreeItem *rootNode(); @@ -88,7 +95,7 @@ using TestFrameworks = QList<ITestFramework *>; class ITestTool : public ITestBase { public: - explicit ITestTool(bool activeByDefault); + ITestTool(); ITestTreeItem *rootNode(); @@ -97,9 +104,6 @@ public: virtual ITestTreeItem *createItemFromTestCaseInfo(const ProjectExplorer::TestCaseInfo &tci) = 0; ITestTool *asTestTool() final { return this; } - -private: - unsigned priority() const final { return 255; } }; using TestTools = QList<ITestTool *>; diff --git a/src/plugins/autotest/qtest/qttestframework.cpp b/src/plugins/autotest/qtest/qttestframework.cpp index 474be75d68c..bdbbc2b07d8 100644 --- a/src/plugins/autotest/qtest/qttestframework.cpp +++ b/src/plugins/autotest/qtest/qttestframework.cpp @@ -25,8 +25,12 @@ QtTestFramework &theQtTestFramework() return framework; } -QtTestFramework::QtTestFramework() : ITestFramework(true) +QtTestFramework::QtTestFramework() { + setActive(true); + setName(QtTest::Constants::FRAMEWORK_NAME); + setDisplayName(Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); + setPriority(QtTest::Constants::FRAMEWORK_PRIORITY); setSettingsGroups("Autotest", "QtTest"); setLayouter([this] { @@ -125,21 +129,6 @@ ITestTreeItem *QtTestFramework::createRootNode() return new QtTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); } -const char *QtTestFramework::name() const -{ - return QtTest::Constants::FRAMEWORK_NAME; -} - -QString QtTestFramework::displayName() const -{ - return Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); -} - -unsigned QtTestFramework::priority() const -{ - return QtTest::Constants::FRAMEWORK_PRIORITY; -} - QStringList QtTestFramework::testNameForSymbolName(const QString &symbolName) const { int index = symbolName.lastIndexOf("::"); diff --git a/src/plugins/autotest/qtest/qttestframework.h b/src/plugins/autotest/qtest/qttestframework.h index f2dc1a4776a..47bf454484e 100644 --- a/src/plugins/autotest/qtest/qttestframework.h +++ b/src/plugins/autotest/qtest/qttestframework.h @@ -34,9 +34,6 @@ public: QStringList testNameForSymbolName(const QString &symbolName) const override; - const char *name() const override; - QString displayName() const override; - unsigned priority() const override; ITestParser *createTestParser() override; ITestTreeItem *createRootNode() override; }; diff --git a/src/plugins/autotest/quick/quicktestframework.cpp b/src/plugins/autotest/quick/quicktestframework.cpp index e1e70bb03ae..8e91638e553 100644 --- a/src/plugins/autotest/quick/quicktestframework.cpp +++ b/src/plugins/autotest/quick/quicktestframework.cpp @@ -16,6 +16,13 @@ QuickTestFramework &theQuickTestFramework() return framework; } +QuickTestFramework::QuickTestFramework() +{ + setName(QuickTest::Constants::FRAMEWORK_NAME); + setDisplayName(Tr::tr("Quick Test")); + setPriority(5); +} + ITestParser *QuickTestFramework::createTestParser() { return new QuickTestParser(this); @@ -26,20 +33,5 @@ ITestTreeItem *QuickTestFramework::createRootNode() return new QuickTestTreeItem(this, displayName(), {}, ITestTreeItem::Root); } -const char *QuickTestFramework::name() const -{ - return QuickTest::Constants::FRAMEWORK_NAME; -} - -QString QuickTestFramework::displayName() const -{ - return Tr::tr("Quick Test"); -} - -unsigned QuickTestFramework::priority() const -{ - return 5; -} - } // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/quick/quicktestframework.h b/src/plugins/autotest/quick/quicktestframework.h index 9bc18e3dd6f..a5de159671b 100644 --- a/src/plugins/autotest/quick/quicktestframework.h +++ b/src/plugins/autotest/quick/quicktestframework.h @@ -21,10 +21,7 @@ namespace Internal { class QuickTestFramework : public QtTestFramework { public: - QuickTestFramework() {} - const char *name() const override; - QString displayName() const override; - unsigned priority() const override; + QuickTestFramework(); protected: ITestParser *createTestParser() override; From 7d3cd76878b1f4160e493d53cc41c595efdb8ef0 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 15:21:54 +0200 Subject: [PATCH 0307/1777] MakeInstallStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I1e4e971f980935425b5bb9dd0355a5ae09f3843e Reviewed-by: hjk <hjk@qt.io> --- src/plugins/remotelinux/makeinstallstep.cpp | 67 ++++++++++++--------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 2e85a3be162..1e44933f270 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -41,6 +41,7 @@ private: bool fromMap(const QVariantMap &map) override; QWidget *createConfigWidget() override; bool init() override; + void doRun() override; bool isJobCountSupported() const override { return false; } void updateCommandFromAspect(); @@ -131,35 +132,6 @@ MakeInstallStep::MakeInstallStep(BuildStepList *parent, Id id) : MakeStep(parent if (format == OutputFormat::Stderr && string.contains("target 'install'")) m_noInstallTarget = true; }); - - setDoneHook([this](bool success) { - if (success) { - const FilePath rootDir = makeCommand().withNewPath(m_installRoot().path()); // FIXME: Needed? - - m_deploymentData = DeploymentData(); - m_deploymentData.setLocalInstallRoot(rootDir); - - const int startPos = rootDir.path().length(); - - const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(), - [](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); }); - - auto handleFile = [this, &appFileNames, startPos](const FilePath &filePath) { - const DeployableFile::Type type = appFileNames.contains(filePath.fileName()) - ? DeployableFile::TypeExecutable : DeployableFile::TypeNormal; - const QString targetDir = filePath.parentDir().path().mid(startPos); - m_deploymentData.addFile(filePath, targetDir, type); - return IterationPolicy::Continue; - }; - rootDir.iterateDirectory( - handleFile, {{}, QDir::Files | QDir::Hidden, QDirIterator::Subdirectories}); - - buildSystem()->setDeploymentData(m_deploymentData); - } else if (m_noInstallTarget && m_isCmakeProject) { - emit addTask(DeploymentTask(Task::Warning, Tr::tr("You need to add an install statement " - "to your CMakeLists.txt file for deployment to work."))); - } - }); } QWidget *MakeInstallStep::createConfigWidget() @@ -216,6 +188,43 @@ bool MakeInstallStep::init() return true; } +void MakeInstallStep::doRun() +{ + using namespace Tasking; + + const auto onDone = [this] { + const FilePath rootDir = makeCommand().withNewPath(m_installRoot().path()); // FIXME: Needed? + + m_deploymentData = DeploymentData(); + m_deploymentData.setLocalInstallRoot(rootDir); + + const int startPos = rootDir.path().length(); + + const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(), + [](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); }); + + auto handleFile = [this, &appFileNames, startPos](const FilePath &filePath) { + const DeployableFile::Type type = appFileNames.contains(filePath.fileName()) + ? DeployableFile::TypeExecutable : DeployableFile::TypeNormal; + const QString targetDir = filePath.parentDir().path().mid(startPos); + m_deploymentData.addFile(filePath, targetDir, type); + return IterationPolicy::Continue; + }; + rootDir.iterateDirectory( + handleFile, {{}, QDir::Files | QDir::Hidden, QDirIterator::Subdirectories}); + + buildSystem()->setDeploymentData(m_deploymentData); + }; + const auto onError = [this] { + if (m_noInstallTarget && m_isCmakeProject) { + emit addTask(DeploymentTask(Task::Warning, Tr::tr("You need to add an install " + "statement to your CMakeLists.txt file for deployment to work."))); + } + }; + + runTaskTree({onGroupDone(onDone), onGroupError(onError), defaultProcessTask()}); +} + void MakeInstallStep::updateCommandFromAspect() { if (m_customCommand.isChecked()) From 4024542df4e659edea66447ce9b3b1f228bdd41c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 13 Jul 2023 13:33:51 +0200 Subject: [PATCH 0308/1777] DeviceCheckBuildStepFactory: Unexport the factory It's not used outside of the ProjectExplorer plugin. Change-Id: I7d58f25a239b8368d74db2781afb0f826be910e1 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../projectexplorer/devicesupport/devicecheckbuildstep.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h index 6b7a8edb11b..d93227e264a 100644 --- a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h +++ b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h @@ -4,11 +4,10 @@ #pragma once #include "../buildstep.h" -#include "../projectexplorer_export.h" namespace ProjectExplorer { -class PROJECTEXPLORER_EXPORT DeviceCheckBuildStepFactory : public BuildStepFactory +class DeviceCheckBuildStepFactory : public BuildStepFactory { public: DeviceCheckBuildStepFactory(); From 4d2b4d0ab16809790d50618c09b2a5ddc6f57af4 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 15:51:04 +0200 Subject: [PATCH 0309/1777] PySideBuildStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: Ia665e8eb79f41e5cbb0bdd1394d7dbf9b85fea14 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/python/pysidebuildconfiguration.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/python/pysidebuildconfiguration.cpp b/src/plugins/python/pysidebuildconfiguration.cpp index 51c97bd40bd..3993363fcd6 100644 --- a/src/plugins/python/pysidebuildconfiguration.cpp +++ b/src/plugins/python/pysidebuildconfiguration.cpp @@ -15,6 +15,7 @@ #include <projectexplorer/target.h> #include <utils/commandline.h> +#include <utils/process.h> using namespace ProjectExplorer; using namespace Utils; @@ -60,10 +61,15 @@ void PySideBuildStep::updatePySideProjectPath(const FilePath &pySideProjectPath) void PySideBuildStep::doRun() { - if (processParameters()->effectiveCommand().isExecutableFile()) - AbstractProcessStep::doRun(); - else - emit finished(true); + using namespace Tasking; + + const auto onSetup = [this] { + if (!processParameters()->effectiveCommand().isExecutableFile()) + return SetupResult::StopWithDone; + return SetupResult::Continue; + }; + + runTaskTree({onGroupSetup(onSetup), defaultProcessTask()}); } From 0b2565a3e76e7798cb5df6327114d6a09dafddd5 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 15:59:24 +0200 Subject: [PATCH 0310/1777] AbstractProcessStep: Get rid of done hook Not needed anymore. Remove emitting 100% progress on finish of CMakeInstallStep, as that's done automatically by the task tree. Task-number: QTCREATORBUG-29168 Change-Id: If93d989eeb0a551f00754c5d6ef7f180fdbabdd5 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp | 1 - src/plugins/projectexplorer/abstractprocessstep.cpp | 8 -------- src/plugins/projectexplorer/abstractprocessstep.h | 1 - 3 files changed, 10 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp b/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp index 63ed8a8bfda..d849a80a363 100644 --- a/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp @@ -38,7 +38,6 @@ public: cmakeArguments.setDisplayStyle(StringAspect::LineEditDisplay); setCommandLineProvider([this] { return cmakeCommand(); }); - setDoneHook([this](bool) { emit progress(100, {}); }); } private: diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 56260a4854e..00c345bd5da 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -82,7 +82,6 @@ public: std::function<CommandLine()> m_commandLineProvider; std::function<FilePath()> m_workingDirectoryProvider; std::function<void(Environment &)> m_environmentModifier; - std::function<void(bool)> m_doneHook; // TODO: Remove me when all subclasses moved to Tasking bool m_ignoreReturnValue = false; bool m_lowPriority = false; std::unique_ptr<QTextDecoder> stdoutStream; @@ -132,11 +131,6 @@ void AbstractProcessStep::setUseEnglishOutput() d->m_environmentModifier = [](Environment &env) { env.setupEnglishOutput(); }; } -void AbstractProcessStep::setDoneHook(const std::function<void(bool)> &doneHook) -{ - d->m_doneHook = doneHook; -} - void AbstractProcessStep::setCommandLineProvider(const std::function<CommandLine()> &provider) { d->m_commandLineProvider = provider; @@ -362,8 +356,6 @@ void AbstractProcessStep::finish(ProcessResult result) { const bool success = result == ProcessResult::FinishedWithSuccess || (result == ProcessResult::FinishedWithError && d->m_ignoreReturnValue); - if (d->m_doneHook) - d->m_doneHook(success); emit finished(success); } diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index 9c2618819c3..899440ce27d 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -36,7 +36,6 @@ protected: bool setupProcessParameters(ProcessParameters *params) const; bool ignoreReturnValue() const; void setIgnoreReturnValue(bool b); - void setDoneHook(const std::function<void(bool)> &doneHook); void setCommandLineProvider(const std::function<Utils::CommandLine()> &provider); void setWorkingDirectoryProvider(const std::function<Utils::FilePath()> &provider); void setEnvironmentModifier(const std::function<void(Utils::Environment &)> &modifier); From 47ac604aea470a2b3e4c30c640c2ed367668d2ad Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 16:30:33 +0200 Subject: [PATCH 0311/1777] AbstractProcessStep: Use task tree for all subclasses Introduce AbstractProcessStep::runRecipe() virtual method with the default implementation. Task-number: QTCREATORBUG-29168 Change-Id: Iac75f4c38f8ee91ad8ac9324bb27881a3722911f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/android/androidbuildapkstep.cpp | 4 +- src/plugins/android/androidbuildapkstep.h | 2 +- .../androidpackageinstallationstep.cpp | 6 +- .../autotoolsprojectmanager/autogenstep.cpp | 6 +- .../autoreconfstep.cpp | 6 +- .../autotoolsprojectmanager/configurestep.cpp | 6 +- .../cmakeprojectmanager/cmakebuildstep.cpp | 5 +- .../cmakeprojectmanager/cmakebuildstep.h | 2 +- .../projectexplorer/abstractprocessstep.cpp | 81 +++++-------------- .../projectexplorer/abstractprocessstep.h | 16 +--- .../python/pysidebuildconfiguration.cpp | 5 +- src/plugins/python/pysidebuildconfiguration.h | 2 +- .../qmakeprojectmanager/qmakemakestep.cpp | 11 ++- src/plugins/qmakeprojectmanager/qmakestep.cpp | 4 +- src/plugins/qmakeprojectmanager/qmakestep.h | 2 +- src/plugins/remotelinux/makeinstallstep.cpp | 6 +- 16 files changed, 61 insertions(+), 103 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 5556db1c940..9b6e8d4dddf 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -696,7 +696,7 @@ static bool copyFileIfNewer(const FilePath &sourceFilePath, return true; } -void AndroidBuildApkStep::doRun() +Tasking::GroupItem AndroidBuildApkStep::runRecipe() { using namespace Tasking; @@ -854,7 +854,7 @@ void AndroidBuildApkStep::doRun() onGroupDone(onDone), defaultProcessTask() }; - runTaskTree(root); + return root; } void AndroidBuildApkStep::reportWarningOrError(const QString &message, Task::TaskType type) diff --git a/src/plugins/android/androidbuildapkstep.h b/src/plugins/android/androidbuildapkstep.h index e2c5c376470..fd68a4ae2cd 100644 --- a/src/plugins/android/androidbuildapkstep.h +++ b/src/plugins/android/androidbuildapkstep.h @@ -66,7 +66,7 @@ private: bool verifyKeystorePassword(); bool verifyCertificatePassword(); - void doRun() override; + Tasking::GroupItem runRecipe() final; void stdError(const QString &output); void reportWarningOrError(const QString &message, ProjectExplorer::Task::TaskType type); diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp index bd3ddfb7f0b..eaa8dc84162 100644 --- a/src/plugins/android/androidpackageinstallationstep.cpp +++ b/src/plugins/android/androidpackageinstallationstep.cpp @@ -46,7 +46,7 @@ public: private: bool init() final; void setupOutputFormatter(OutputFormatter *formatter) final; - void doRun() final; + Tasking::GroupItem runRecipe() final; void reportWarningOrError(const QString &message, ProjectExplorer::Task::TaskType type); @@ -120,7 +120,7 @@ void AndroidPackageInstallationStep::setupOutputFormatter(OutputFormatter *forma AbstractProcessStep::setupOutputFormatter(formatter); } -void AndroidPackageInstallationStep::doRun() +Tasking::GroupItem AndroidPackageInstallationStep::runRecipe() { using namespace Tasking; @@ -171,7 +171,7 @@ void AndroidPackageInstallationStep::doRun() return SetupResult::Continue; }; - runTaskTree({onGroupSetup(onSetup), defaultProcessTask()}); + return Group { onGroupSetup(onSetup), defaultProcessTask() }; } void AndroidPackageInstallationStep::reportWarningOrError(const QString &message, diff --git a/src/plugins/autotoolsprojectmanager/autogenstep.cpp b/src/plugins/autotoolsprojectmanager/autogenstep.cpp index a6121de9276..ec54184478b 100644 --- a/src/plugins/autotoolsprojectmanager/autogenstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autogenstep.cpp @@ -40,7 +40,7 @@ public: AutogenStep(BuildStepList *bsl, Id id); private: - void doRun() final; + Tasking::GroupItem runRecipe() final; bool m_runAutogen = false; StringAspect m_arguments{this}; @@ -70,7 +70,7 @@ AutogenStep::AutogenStep(BuildStepList *bsl, Id id) : AbstractProcessStep(bsl, i }); } -void AutogenStep::doRun() +Tasking::GroupItem AutogenStep::runRecipe() { using namespace Tasking; @@ -96,7 +96,7 @@ void AutogenStep::doRun() }; const auto onDone = [this] { m_runAutogen = false; }; - runTaskTree({onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask()}); + return Group { onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask() }; } // AutogenStepFactory diff --git a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp index 3d545a6e754..2afc690387e 100644 --- a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp @@ -60,7 +60,8 @@ public: }); } - void doRun() override +private: + Tasking::GroupItem runRecipe() final { using namespace Tasking; @@ -79,10 +80,9 @@ public: }; const auto onDone = [this] { m_runAutoreconf = false; }; - runTaskTree({onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask()}); + return Group { onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask() }; } -private: bool m_runAutoreconf = false; StringAspect arguments{this}; }; diff --git a/src/plugins/autotoolsprojectmanager/configurestep.cpp b/src/plugins/autotoolsprojectmanager/configurestep.cpp index 58515990182..14c7a3eefa6 100644 --- a/src/plugins/autotoolsprojectmanager/configurestep.cpp +++ b/src/plugins/autotoolsprojectmanager/configurestep.cpp @@ -63,7 +63,7 @@ public: } private: - void doRun() final; + Tasking::GroupItem runRecipe() final; CommandLine getCommandLine(const QString &arguments) { @@ -74,7 +74,7 @@ private: StringAspect arguments{this}; }; -void ConfigureStep::doRun() +Tasking::GroupItem ConfigureStep::runRecipe() { using namespace Tasking; @@ -100,7 +100,7 @@ void ConfigureStep::doRun() }; const auto onDone = [this] { m_runConfigure = false; }; - runTaskTree({onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask()}); + return Group { onGroupSetup(onSetup), onGroupDone(onDone), defaultProcessTask() }; } // ConfigureStepFactory diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 7c4539a5dc4..3ce1198852d 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -347,7 +347,7 @@ void CMakeBuildStep::setupOutputFormatter(Utils::OutputFormatter *formatter) CMakeAbstractProcessStep::setupOutputFormatter(formatter); } -void CMakeBuildStep::doRun() +Tasking::GroupItem CMakeBuildStep::runRecipe() { using namespace Tasking; @@ -380,8 +380,7 @@ void CMakeBuildStep::doRun() onGroupDone(onEnd), onGroupError(onEnd) }; - - runTaskTree(root); + return root; } QString CMakeBuildStep::defaultBuildTarget() const diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h index 12d9a847129..89b0cbd3b5a 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h @@ -81,7 +81,7 @@ private: bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; - void doRun() override; + Tasking::GroupItem runRecipe() final; QWidget *createConfigWidget() override; Utils::FilePath cmakeExecutable() const; diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 00c345bd5da..acbb57badef 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -3,14 +3,11 @@ #include "abstractprocessstep.h" -#include "buildconfiguration.h" -#include "buildstep.h" #include "processparameters.h" #include "projectexplorer.h" #include "projectexplorersettings.h" #include "projectexplorertr.h" -#include <utils/fileutils.h> #include <utils/outputformatter.h> #include <utils/process.h> #include <utils/qtcassert.h> @@ -75,7 +72,6 @@ public: Private(AbstractProcessStep *q) : q(q) {} AbstractProcessStep *q; - std::unique_ptr<Process> m_process; std::unique_ptr<TaskTree> m_taskTree; ProcessParameters m_param; ProcessParameters *m_displayedParams = &m_param; @@ -84,8 +80,8 @@ public: std::function<void(Environment &)> m_environmentModifier; bool m_ignoreReturnValue = false; bool m_lowPriority = false; - std::unique_ptr<QTextDecoder> stdoutStream; - std::unique_ptr<QTextDecoder> stderrStream; + std::unique_ptr<QTextDecoder> stdOutDecoder; + std::unique_ptr<QTextDecoder> stdErrDecoder; OutputFormatter *outputFormatter = nullptr; }; @@ -148,12 +144,15 @@ void AbstractProcessStep::setWorkingDirectoryProvider(const std::function<FilePa bool AbstractProcessStep::init() { - if (d->m_process || d->m_taskTree) + if (d->m_taskTree) return false; if (!setupProcessParameters(processParameters())) return false; + d->stdOutDecoder = std::make_unique<QTextDecoder>(buildEnvironment().hasKey("VSLANG") + ? QTextCodec::codecForName("UTF-8") : QTextCodec::codecForLocale()); + d->stdErrDecoder = std::make_unique<QTextDecoder>(QTextCodec::codecForLocale()); return true; } @@ -171,29 +170,19 @@ void AbstractProcessStep::setupOutputFormatter(OutputFormatter *formatter) void AbstractProcessStep::doRun() { - setupStreams(); - - d->m_process.reset(new Process); - if (!setupProcess(*d->m_process.get())) { - d->m_process.reset(); - finish(ProcessResult::StartFailed); - return; - } - connect(d->m_process.get(), &Process::done, this, [this] { - handleProcessDone(*d->m_process); - const ProcessResult result = d->outputFormatter->hasFatalErrors() - ? ProcessResult::FinishedWithError : d->m_process->result(); - d->m_process.release()->deleteLater(); - finish(result); + d->m_taskTree.reset(new TaskTree({runRecipe()})); + connect(d->m_taskTree.get(), &TaskTree::progressValueChanged, this, [this](int value) { + emit progress(qRound(double(value) * 100 / std::max(d->m_taskTree->progressMaximum(), 1)), {}); }); - d->m_process->start(); -} - -void AbstractProcessStep::setupStreams() -{ - d->stdoutStream = std::make_unique<QTextDecoder>(buildEnvironment().hasKey("VSLANG") - ? QTextCodec::codecForName("UTF-8") : QTextCodec::codecForLocale()); - d->stderrStream = std::make_unique<QTextDecoder>(QTextCodec::codecForLocale()); + connect(d->m_taskTree.get(), &TaskTree::done, this, [this] { + emit finished(true); + d->m_taskTree.release()->deleteLater(); + }); + connect(d->m_taskTree.get(), &TaskTree::errorOccurred, this, [this] { + emit finished(false); + d->m_taskTree.release()->deleteLater(); + }); + d->m_taskTree->start(); } GroupItem AbstractProcessStep::defaultProcessTask() @@ -234,11 +223,11 @@ bool AbstractProcessStep::setupProcess(Process &process) process.setLowPriority(); connect(&process, &Process::readyReadStandardOutput, this, [this, &process] { - emit addOutput(d->stdoutStream->toUnicode(process.readAllRawStandardOutput()), + emit addOutput(d->stdOutDecoder->toUnicode(process.readAllRawStandardOutput()), OutputFormat::Stdout, DontAppendNewline); }); connect(&process, &Process::readyReadStandardError, this, [this, &process] { - emit addOutput(d->stderrStream->toUnicode(process.readAllRawStandardError()), + emit addOutput(d->stdErrDecoder->toUnicode(process.readAllRawStandardError()), OutputFormat::Stderr, DontAppendNewline); }); connect(&process, &Process::started, this, [this] { @@ -273,25 +262,6 @@ void AbstractProcessStep::handleProcessDone(const Process &process) } } -void AbstractProcessStep::runTaskTree(const Group &recipe) -{ - setupStreams(); - - d->m_taskTree.reset(new TaskTree(recipe)); - connect(d->m_taskTree.get(), &TaskTree::progressValueChanged, this, [this](int value) { - emit progress(qRound(double(value) * 100 / std::max(d->m_taskTree->progressMaximum(), 1)), {}); - }); - connect(d->m_taskTree.get(), &TaskTree::done, this, [this] { - emit finished(true); - d->m_taskTree.release()->deleteLater(); - }); - connect(d->m_taskTree.get(), &TaskTree::errorOccurred, this, [this] { - emit finished(false); - d->m_taskTree.release()->deleteLater(); - }); - d->m_taskTree->start(); -} - void AbstractProcessStep::setLowPriority() { d->m_lowPriority = true; @@ -300,11 +270,6 @@ void AbstractProcessStep::setLowPriority() void AbstractProcessStep::doCancel() { const QString message = Tr::tr("The build step was ended forcefully."); - if (d->m_process) { - emit addOutput(message, OutputFormat::ErrorMessage); - d->m_process.reset(); - finish(ProcessResult::TerminatedAbnormally); - } if (d->m_taskTree) { d->m_taskTree.reset(); emit addOutput(message, OutputFormat::ErrorMessage); @@ -352,11 +317,9 @@ void AbstractProcessStep::setDisplayedParameters(ProcessParameters *params) d->m_displayedParams = params; } -void AbstractProcessStep::finish(ProcessResult result) +GroupItem AbstractProcessStep::runRecipe() { - const bool success = result == ProcessResult::FinishedWithSuccess - || (result == ProcessResult::FinishedWithError && d->m_ignoreReturnValue); - emit finished(success); + return Group { ignoreReturnValue() ? finishAllAndDone : stopOnError, defaultProcessTask() }; } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index 899440ce27d..7b5209a0234 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -5,18 +5,12 @@ #include "buildstep.h" -#include <QProcess> - namespace Utils { class CommandLine; class Process; -enum class ProcessResult; } -namespace Tasking { -class Group; -class GroupItem; -} +namespace Tasking { class GroupItem; } namespace ProjectExplorer { class ProcessParameters; @@ -45,19 +39,17 @@ protected: bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; - void doRun() override; - void doCancel() override; + void doRun() final; + void doCancel() final; void setLowPriority(); void setDisplayedParameters(ProcessParameters *params); Tasking::GroupItem defaultProcessTask(); bool setupProcess(Utils::Process &process); void handleProcessDone(const Utils::Process &process); - void runTaskTree(const Tasking::Group &recipe); private: - void setupStreams(); - void finish(Utils::ProcessResult result); + virtual Tasking::GroupItem runRecipe(); class Private; Private *d; diff --git a/src/plugins/python/pysidebuildconfiguration.cpp b/src/plugins/python/pysidebuildconfiguration.cpp index 3993363fcd6..8525e248c4f 100644 --- a/src/plugins/python/pysidebuildconfiguration.cpp +++ b/src/plugins/python/pysidebuildconfiguration.cpp @@ -59,7 +59,7 @@ void PySideBuildStep::updatePySideProjectPath(const FilePath &pySideProjectPath) m_pysideProject.setValue(pySideProjectPath); } -void PySideBuildStep::doRun() +Tasking::GroupItem PySideBuildStep::runRecipe() { using namespace Tasking; @@ -69,10 +69,9 @@ void PySideBuildStep::doRun() return SetupResult::Continue; }; - runTaskTree({onGroupSetup(onSetup), defaultProcessTask()}); + return Group { onGroupSetup(onSetup), defaultProcessTask() }; } - // PySideBuildConfiguration class PySideBuildConfiguration : public BuildConfiguration diff --git a/src/plugins/python/pysidebuildconfiguration.h b/src/plugins/python/pysidebuildconfiguration.h index e686b9c2220..58ae930ea87 100644 --- a/src/plugins/python/pysidebuildconfiguration.h +++ b/src/plugins/python/pysidebuildconfiguration.h @@ -17,7 +17,7 @@ public: void updatePySideProjectPath(const Utils::FilePath &pySideProjectPath); private: - void doRun() override; + Tasking::GroupItem runRecipe() final; Utils::FilePathAspect m_pysideProject{this}; }; diff --git a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp index 9d949a09923..b79f79b7a6c 100644 --- a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp @@ -42,7 +42,7 @@ public: private: bool init() override; void setupOutputFormatter(OutputFormatter *formatter) override; - void doRun() override; + Tasking::GroupItem runRecipe() final; QStringList displayArguments() const override; bool m_scriptTarget = false; @@ -200,7 +200,7 @@ void QmakeMakeStep::setupOutputFormatter(OutputFormatter *formatter) AbstractProcessStep::setupOutputFormatter(formatter); } -void QmakeMakeStep::doRun() +Tasking::GroupItem QmakeMakeStep::runRecipe() { using namespace Tasking; @@ -226,7 +226,12 @@ void QmakeMakeStep::doRun() } }; - runTaskTree({onGroupSetup(onSetup), onGroupError(onError), defaultProcessTask()}); + return Group { + ignoreReturnValue() ? finishAllAndDone : stopOnError, + onGroupSetup(onSetup), + onGroupError(onError), + defaultProcessTask() + }; } QStringList QmakeMakeStep::displayArguments() const diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 94b93354347..7117aa8ffcb 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -265,7 +265,7 @@ void QMakeStep::setupOutputFormatter(OutputFormatter *formatter) AbstractProcessStep::setupOutputFormatter(formatter); } -void QMakeStep::doRun() +Tasking::GroupItem QMakeStep::runRecipe() { using namespace Tasking; @@ -308,7 +308,7 @@ void QMakeStep::doRun() if (m_runMakeQmake) processList << ProcessTask(setupMakeQMake, onProcessDone, onProcessDone); - runTaskTree(Group(processList)); + return Group(processList); } void QMakeStep::setForced(bool b) diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index d977eedd904..366bbacf60b 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -101,7 +101,6 @@ public: QmakeBuildSystem *qmakeBuildSystem() const; bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; - void doRun() override; QWidget *createConfigWidget() override; void setForced(bool b); @@ -138,6 +137,7 @@ protected: bool fromMap(const QVariantMap &map) override; private: + Tasking::GroupItem runRecipe() final; // slots for handling buildconfiguration/step signals void qtVersionChanged(); void qmakeBuildConfigChanged(); diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 1e44933f270..2749a292a61 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -41,7 +41,7 @@ private: bool fromMap(const QVariantMap &map) override; QWidget *createConfigWidget() override; bool init() override; - void doRun() override; + Tasking::GroupItem runRecipe() final; bool isJobCountSupported() const override { return false; } void updateCommandFromAspect(); @@ -188,7 +188,7 @@ bool MakeInstallStep::init() return true; } -void MakeInstallStep::doRun() +Tasking::GroupItem MakeInstallStep::runRecipe() { using namespace Tasking; @@ -222,7 +222,7 @@ void MakeInstallStep::doRun() } }; - runTaskTree({onGroupDone(onDone), onGroupError(onError), defaultProcessTask()}); + return Group { onGroupDone(onDone), onGroupError(onError), defaultProcessTask() }; } void MakeInstallStep::updateCommandFromAspect() From c92f4bcbdf8d98b99a536c14197bfba0a895e24c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 7 Jul 2023 09:26:22 +0200 Subject: [PATCH 0312/1777] Beautifier: Let tools self-register centrally Change-Id: Id9140747e7c7f7c7ef3a0a957570863de7a628d1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/beautifier/beautifierplugin.cpp | 15 +++++---------- src/plugins/beautifier/beautifiertool.cpp | 16 ++++++++++++++++ src/plugins/beautifier/beautifiertool.h | 4 +++- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/plugins/beautifier/beautifierplugin.cpp b/src/plugins/beautifier/beautifierplugin.cpp index d1505e74987..ade354b62c1 100644 --- a/src/plugins/beautifier/beautifierplugin.cpp +++ b/src/plugins/beautifier/beautifierplugin.cpp @@ -76,12 +76,6 @@ public: ArtisticStyle artisticStyleBeautifier; ClangFormat clangFormatBeautifier; Uncrustify uncrustifyBeautifier; - - BeautifierTool *m_tools[3] { - &artisticStyleBeautifier, - &uncrustifyBeautifier, - &clangFormatBeautifier - }; }; static BeautifierPluginPrivate *dd = nullptr; @@ -108,7 +102,7 @@ ExtensionSystem::IPlugin::ShutdownFlag BeautifierPlugin::aboutToShutdown() BeautifierPluginPrivate::BeautifierPluginPrivate() { - for (BeautifierTool *tool : m_tools) + for (BeautifierTool *tool : BeautifierTool::allTools()) generalSettings.autoFormatTools.addOption(tool->id()); updateActions(); @@ -122,7 +116,7 @@ BeautifierPluginPrivate::BeautifierPluginPrivate() void BeautifierPluginPrivate::updateActions(Core::IEditor *editor) { - for (BeautifierTool *tool : m_tools) + for (BeautifierTool *tool : BeautifierTool::allTools()) tool->updateActions(editor); } @@ -149,9 +143,10 @@ void BeautifierPluginPrivate::autoFormatOnSave(Core::IDocument *document) // Find tool to use by id and format file! const QString id = generalSettings.autoFormatTools.stringValue(); - auto tool = std::find_if(std::begin(m_tools), std::end(m_tools), + const QList<BeautifierTool *> &tools = BeautifierTool::allTools(); + auto tool = std::find_if(std::begin(tools), std::end(tools), [&id](const BeautifierTool *t){return t->id() == id;}); - if (tool != std::end(m_tools)) { + if (tool != std::end(tools)) { if (!(*tool)->isApplicable(document)) return; const TextEditor::Command command = (*tool)->command(); diff --git a/src/plugins/beautifier/beautifiertool.cpp b/src/plugins/beautifier/beautifiertool.cpp index a8be6a48377..6f5c4731c60 100644 --- a/src/plugins/beautifier/beautifiertool.cpp +++ b/src/plugins/beautifier/beautifiertool.cpp @@ -25,6 +25,22 @@ using namespace Utils; namespace Beautifier::Internal { +static QList<BeautifierTool *> &theTools() +{ + static QList<BeautifierTool *> tools; + return tools; +} + +BeautifierTool::BeautifierTool() +{ + theTools().append(this); +} + +const QList<BeautifierTool *> &BeautifierTool::allTools() +{ + return theTools(); +} + void BeautifierTool::showError(const QString &error) { Core::MessageManager::writeFlashing(Tr::tr("Error in Beautifier: %1").arg(error.trimmed())); diff --git a/src/plugins/beautifier/beautifiertool.h b/src/plugins/beautifier/beautifiertool.h index 5b2c130a7d0..f8c99aef55b 100644 --- a/src/plugins/beautifier/beautifiertool.h +++ b/src/plugins/beautifier/beautifiertool.h @@ -29,7 +29,9 @@ namespace Beautifier::Internal { class BeautifierTool : public QObject { public: - BeautifierTool() = default; + BeautifierTool(); + + static const QList<BeautifierTool *> &allTools(); virtual QString id() const = 0; virtual void updateActions(Core::IEditor *editor) = 0; From 188795fecf54b436aeb4317b777c25fb9bdf8c15 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 18:10:21 +0200 Subject: [PATCH 0313/1777] AbstractRemoteLinuxDeployStep: Refactor tree error handling Make it behave like AbstractProcessStep. Move success / failure logging into the recipe. Make starting the task tree look the same in both classes. That's a preparation step before moving running task tree into the base BuildStep class. Task-number: QTCREATORBUG-29168 Change-Id: I2bf3e2476d3942a01efc3b06778410dea40eef5e Reviewed-by: hjk <hjk@qt.io> --- .../projectexplorer/abstractprocessstep.cpp | 18 ++++--- .../abstractremotelinuxdeploystep.cpp | 53 +++++++++---------- 2 files changed, 34 insertions(+), 37 deletions(-) diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index acbb57badef..13e5d00d33a 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -170,17 +170,19 @@ void AbstractProcessStep::setupOutputFormatter(OutputFormatter *formatter) void AbstractProcessStep::doRun() { + QTC_ASSERT(!d->m_taskTree, return); + d->m_taskTree.reset(new TaskTree({runRecipe()})); connect(d->m_taskTree.get(), &TaskTree::progressValueChanged, this, [this](int value) { emit progress(qRound(double(value) * 100 / std::max(d->m_taskTree->progressMaximum(), 1)), {}); }); connect(d->m_taskTree.get(), &TaskTree::done, this, [this] { - emit finished(true); d->m_taskTree.release()->deleteLater(); + emit finished(true); }); connect(d->m_taskTree.get(), &TaskTree::errorOccurred, this, [this] { - emit finished(false); d->m_taskTree.release()->deleteLater(); + emit finished(false); }); d->m_taskTree->start(); } @@ -269,12 +271,12 @@ void AbstractProcessStep::setLowPriority() void AbstractProcessStep::doCancel() { - const QString message = Tr::tr("The build step was ended forcefully."); - if (d->m_taskTree) { - d->m_taskTree.reset(); - emit addOutput(message, OutputFormat::ErrorMessage); - emit finished(false); - } + if (!d->m_taskTree) + return; + + d->m_taskTree.reset(); + emit addOutput(Tr::tr("The build step was ended forcefully."), OutputFormat::ErrorMessage); + emit finished(false); } ProcessParameters *AbstractProcessStep::processParameters() diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index c97f9bc25e3..894f91f49c3 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -26,7 +26,6 @@ namespace Internal { class AbstractRemoteLinuxDeployStepPrivate { public: - bool hasError; std::function<expected_str<void>()> internalInit; DeploymentTimeInfo deployTimes; @@ -110,33 +109,31 @@ bool AbstractRemoteLinuxDeployStep::init() void AbstractRemoteLinuxDeployStep::doRun() { - d->hasError = false; - QTC_ASSERT(!d->m_taskTree, return); d->m_taskTree.reset(new TaskTree({runRecipe()})); - const auto endHandler = [this] { + const auto onDone = [this] { d->m_taskTree.release()->deleteLater(); - handleFinished(); + emit finished(true); }; - connect(d->m_taskTree.get(), &TaskTree::done, this, endHandler); - connect(d->m_taskTree.get(), &TaskTree::errorOccurred, this, endHandler); + const auto onError = [this] { + d->m_taskTree.release()->deleteLater(); + emit finished(false); + }; + connect(d->m_taskTree.get(), &TaskTree::done, this, onDone); + connect(d->m_taskTree.get(), &TaskTree::errorOccurred, this, onError); d->m_taskTree->start(); } void AbstractRemoteLinuxDeployStep::doCancel() { - if (d->hasError) - return; - - emit addOutput(Tr::tr("User requests deployment to stop; cleaning up."), - OutputFormat::NormalMessage); - d->hasError = true; - if (!d->m_taskTree) return; + d->m_taskTree.reset(); - handleFinished(); + emit addOutput(Tr::tr("User requests deployment to stop; cleaning up."), + OutputFormat::NormalMessage); + emit finished(false); } void AbstractRemoteLinuxDeployStep::addProgressMessage(const QString &message) @@ -148,7 +145,6 @@ void AbstractRemoteLinuxDeployStep::addErrorMessage(const QString &message) { emit addOutput(message, OutputFormat::ErrorMessage); emit addTask(DeploymentTask(Task::Error, message), 1); // TODO correct? - d->hasError = true; } void AbstractRemoteLinuxDeployStep::addWarningMessage(const QString &message) @@ -157,16 +153,6 @@ void AbstractRemoteLinuxDeployStep::addWarningMessage(const QString &message) emit addTask(DeploymentTask(Task::Warning, message), 1); // TODO correct? } -void AbstractRemoteLinuxDeployStep::handleFinished() -{ - if (d->hasError) - emit addOutput(Tr::tr("Deploy step failed."), OutputFormat::ErrorMessage); - else - emit addOutput(Tr::tr("Deploy step finished."), OutputFormat::NormalMessage); - - emit finished(!d->hasError); -} - void AbstractRemoteLinuxDeployStep::handleStdOutData(const QString &data) { emit addOutput(data, OutputFormat::Stdout, DontAppendNewline); @@ -188,17 +174,26 @@ GroupItem AbstractRemoteLinuxDeployStep::runRecipe() const auto canDeploy = isDeploymentPossible(); if (!canDeploy) { addErrorMessage(canDeploy.error()); - handleFinished(); return SetupResult::StopWithError; } if (!isDeploymentNecessary()) { addProgressMessage(Tr::tr("No deployment action necessary. Skipping.")); - handleFinished(); return SetupResult::StopWithDone; } return SetupResult::Continue; }; - return Group { onGroupSetup(onSetup), deployRecipe() }; + const auto onDone = [this] { + emit addOutput(Tr::tr("Deploy step finished."), OutputFormat::NormalMessage); + }; + const auto onError = [this] { + emit addOutput(Tr::tr("Deploy step failed."), OutputFormat::ErrorMessage); + }; + return Group { + onGroupSetup(onSetup), + deployRecipe(), + onGroupDone(onDone), + onGroupError(onError) + }; } } // namespace RemoteLinux From 337e27eb5364bea8fad6e7e3e12a0503c1dc1f4b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 08:30:32 +0200 Subject: [PATCH 0314/1777] Utils: Clean up {namevalue,environment}dialog.h Change-Id: I84b959e4b78a39dfa421bc0f9cedcf33bc358984 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/libs/utils/environmentdialog.h | 8 +++----- src/libs/utils/namevaluesdialog.cpp | 16 +++++++++++++++- src/libs/utils/namevaluesdialog.h | 23 ++--------------------- 3 files changed, 20 insertions(+), 27 deletions(-) diff --git a/src/libs/utils/environmentdialog.h b/src/libs/utils/environmentdialog.h index 5c60f3d2a09..335ba7ffe58 100644 --- a/src/libs/utils/environmentdialog.h +++ b/src/libs/utils/environmentdialog.h @@ -7,18 +7,16 @@ #include "environmentfwd.h" #include "namevaluesdialog.h" -#include <thread> namespace Utils { class QTCREATOR_UTILS_EXPORT EnvironmentDialog : public NameValuesDialog { - Q_OBJECT public: static std::optional<EnvironmentItems> getEnvironmentItems(QWidget *parent = nullptr, - const EnvironmentItems &initial = {}, - const QString &placeholderText = {}, - Polisher polish = {}); + const EnvironmentItems &initial = {}, + const QString &placeholderText = {}, + Polisher polish = {}); }; } // namespace Utils diff --git a/src/libs/utils/namevaluesdialog.cpp b/src/libs/utils/namevaluesdialog.cpp index dfd64370770..51403f534eb 100644 --- a/src/libs/utils/namevaluesdialog.cpp +++ b/src/libs/utils/namevaluesdialog.cpp @@ -15,7 +15,6 @@ #include <QVBoxLayout> namespace Utils { - namespace Internal { static EnvironmentItems cleanUp(const EnvironmentItems &items) @@ -35,6 +34,20 @@ static EnvironmentItems cleanUp(const EnvironmentItems &items) return uniqueItems; } +class NameValueItemsWidget : public QWidget +{ +public: + explicit NameValueItemsWidget(QWidget *parent = nullptr); + + void setEnvironmentItems(const EnvironmentItems &items); + EnvironmentItems environmentItems() const; + + void setPlaceholderText(const QString &text); + +private: + QPlainTextEdit *m_editor; +}; + NameValueItemsWidget::NameValueItemsWidget(QWidget *parent) : QWidget(parent) { @@ -63,6 +76,7 @@ void NameValueItemsWidget::setPlaceholderText(const QString &text) { m_editor->setPlaceholderText(text); } + } // namespace Internal NameValuesDialog::NameValuesDialog(const QString &windowTitle, const QString &helpText, QWidget *parent) diff --git a/src/libs/utils/namevaluesdialog.h b/src/libs/utils/namevaluesdialog.h index ad1795d503e..deb54b70538 100644 --- a/src/libs/utils/namevaluesdialog.h +++ b/src/libs/utils/namevaluesdialog.h @@ -13,32 +13,14 @@ #include <memory> #include <optional> -QT_BEGIN_NAMESPACE -class QPlainTextEdit; -QT_END_NAMESPACE - namespace Utils { -namespace Internal { -class NameValueItemsWidget : public QWidget -{ - Q_OBJECT -public: - explicit NameValueItemsWidget(QWidget *parent = nullptr); - - void setEnvironmentItems(const EnvironmentItems &items); - EnvironmentItems environmentItems() const; - - void setPlaceholderText(const QString &text); - -private: - QPlainTextEdit *m_editor; -}; -} // namespace Internal +namespace Internal { class NameValueItemsWidget; } class QTCREATOR_UTILS_EXPORT NameValuesDialog : public QDialog { Q_OBJECT + public: void setNameValueItems(const NameValueItems &items); NameValueItems nameValueItems() const; @@ -52,7 +34,6 @@ public: Polisher polish = {}, const QString &windowTitle = {}, const QString &helpText = {}); - protected: explicit NameValuesDialog(const QString &windowTitle, const QString &helpText, From f7afa521067880c642c08ba0ead97ab351d9f507 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 16:21:49 +0200 Subject: [PATCH 0315/1777] CMake: Use aspects more directly in CMakeBuildStep Change-Id: Id12381556439ef6b3e56307a169830bb18da9003 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../cmakeprojectmanager/cmakebuildstep.cpp | 108 ++++++++---------- .../cmakeprojectmanager/cmakebuildstep.h | 12 +- 2 files changed, 53 insertions(+), 67 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 3ce1198852d..4252ee3914b 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -208,37 +208,34 @@ static bool supportsStageForInstallation(const Kit *kit) CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Id id) : CMakeAbstractProcessStep(bsl, id) { - m_cmakeArguments = addAspect<StringAspect>(); - m_cmakeArguments->setSettingsKey(CMAKE_ARGUMENTS_KEY); - m_cmakeArguments->setLabelText(Tr::tr("CMake arguments:")); - m_cmakeArguments->setDisplayStyle(StringAspect::LineEditDisplay); + cmakeArguments.setSettingsKey(CMAKE_ARGUMENTS_KEY); + cmakeArguments.setLabelText(Tr::tr("CMake arguments:")); + cmakeArguments.setDisplayStyle(StringAspect::LineEditDisplay); - m_toolArguments = addAspect<StringAspect>(); - m_toolArguments->setSettingsKey(TOOL_ARGUMENTS_KEY); - m_toolArguments->setLabelText(Tr::tr("Tool arguments:")); - m_toolArguments->setDisplayStyle(StringAspect::LineEditDisplay); + toolArguments.setSettingsKey(TOOL_ARGUMENTS_KEY); + toolArguments.setLabelText(Tr::tr("Tool arguments:")); + toolArguments.setDisplayStyle(StringAspect::LineEditDisplay); - m_useStaging = addAspect<BoolAspect>(); - m_useStaging->setSettingsKey(USE_STAGING_KEY); - m_useStaging->setLabel(Tr::tr("Stage for installation"), BoolAspect::LabelPlacement::AtCheckBox); - m_useStaging->setDefaultValue(supportsStageForInstallation(kit())); + useStaging.setSettingsKey(USE_STAGING_KEY); + useStaging.setLabel(Tr::tr("Stage for installation"), BoolAspect::LabelPlacement::AtCheckBox); + useStaging.setDefaultValue(supportsStageForInstallation(kit())); - m_stagingDir = addAspect<FilePathAspect>(); - m_stagingDir->setSettingsKey(STAGING_DIR_KEY); - m_stagingDir->setLabelText(Tr::tr("Staging directory:")); - m_stagingDir->setDefaultValue(FilePath::fromUserInput(initialStagingDir(kit()))); + stagingDir.setSettingsKey(STAGING_DIR_KEY); + stagingDir.setLabelText(Tr::tr("Staging directory:")); + stagingDir.setDefaultValue(FilePath::fromUserInput(initialStagingDir(kit()))); Kit *kit = buildConfiguration()->kit(); if (CMakeBuildConfiguration::isIos(kit)) { - m_useiOSAutomaticProvisioningUpdates = addAspect<BoolAspect>(); - m_useiOSAutomaticProvisioningUpdates->setDefaultValue(true); - m_useiOSAutomaticProvisioningUpdates->setSettingsKey( - IOS_AUTOMATIC_PROVISIONG_UPDATES_ARGUMENTS_KEY); - m_useiOSAutomaticProvisioningUpdates->setLabel( - Tr::tr("Enable automatic provisioning updates:")); - m_useiOSAutomaticProvisioningUpdates->setToolTip( - Tr::tr("Tells xcodebuild to create and download a provisioning profile " - "if a valid one does not exist.")); + useiOSAutomaticProvisioningUpdates.setDefaultValue(true); + useiOSAutomaticProvisioningUpdates.setSettingsKey( + IOS_AUTOMATIC_PROVISIONG_UPDATES_ARGUMENTS_KEY); + useiOSAutomaticProvisioningUpdates.setLabel( + Tr::tr("Enable automatic provisioning updates:")); + useiOSAutomaticProvisioningUpdates.setToolTip( + Tr::tr("Tells xcodebuild to create and download a provisioning profile " + "if a valid one does not exist.")); + } else { + useiOSAutomaticProvisioningUpdates.setVisible(false); } m_buildTargetModel.setHeader({Tr::tr("Target")}); @@ -259,8 +256,8 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Id id) : env.set("NINJA_STATUS", ninjaProgressString + "%o/sec] "); env.modify(m_userEnvironmentChanges); - if (m_useStaging) - env.set("DESTDIR", currentStagingDir()); + if (useStaging()) + env.set("DESTDIR", stagingDir().path()); }); connect(target(), &Target::parsingFinished, this, [this](bool success) { @@ -450,7 +447,7 @@ CommandLine CMakeBuildStep::cmakeCommand() const } return s; })); - if (m_useStaging->value()) + if (useStaging()) cmd.addArg("install"); auto bs = qobject_cast<CMakeBuildSystem *>(buildSystem()); @@ -462,17 +459,16 @@ CommandLine CMakeBuildStep::cmakeCommand() const cmd.addArg(bs->cmakeBuildType()); } - if (!m_cmakeArguments->value().isEmpty()) - cmd.addArgs(m_cmakeArguments->value(), CommandLine::Raw); + cmd.addArgs(cmakeArguments(), CommandLine::Raw); bool toolArgumentsSpecified = false; - if (!m_toolArguments->value().isEmpty()) { + if (!toolArguments().isEmpty()) { cmd.addArg("--"); - cmd.addArgs(m_toolArguments->value(), CommandLine::Raw); + cmd.addArgs(toolArguments(), CommandLine::Raw); toolArgumentsSpecified = true; } - if (m_useiOSAutomaticProvisioningUpdates && m_useiOSAutomaticProvisioningUpdates->value()) { + if (useiOSAutomaticProvisioningUpdates()) { // Only add the double dash if it wasn't added before. if (!toolArgumentsSpecified) cmd.addArg("--"); @@ -525,12 +521,12 @@ QWidget *CMakeBuildStep::createConfigWidget() QString summaryText = param.summary(displayName()); - m_stagingDir->setEnabled(m_useStaging->value()); - if (m_useStaging->value()) { + stagingDir.setEnabled(useStaging()); + if (useStaging()) { //: Stage (for installation) at <staging_dir> for <installation_dir> summaryText.append( "; " - + Tr::tr("Stage at %2 for %3").arg(currentStagingDir(), currentInstallPrefix())); + + Tr::tr("Stage at %2 for %3").arg(stagingDir().path(), currentInstallPrefix())); } if (!m_buildPreset.isEmpty()) { @@ -591,13 +587,11 @@ QWidget *CMakeBuildStep::createConfigWidget() }; Layouting::Form builder; - builder.addRow({m_cmakeArguments}); - builder.addRow({m_toolArguments}); - builder.addRow({m_useStaging}); - builder.addRow({m_stagingDir}); - - if (m_useiOSAutomaticProvisioningUpdates) - builder.addRow({m_useiOSAutomaticProvisioningUpdates}); + builder.addRow({cmakeArguments}); + builder.addRow({toolArguments}); + builder.addRow({useStaging}); + builder.addRow({stagingDir}); + builder.addRow({useiOSAutomaticProvisioningUpdates}); builder.addRow({new QLabel(Tr::tr("Targets:")), frame}); @@ -609,13 +603,11 @@ QWidget *CMakeBuildStep::createConfigWidget() updateDetails(); - connect(m_cmakeArguments, &StringAspect::changed, this, updateDetails); - connect(m_toolArguments, &StringAspect::changed, this, updateDetails); - connect(m_useStaging, &BoolAspect::changed, this, updateDetails); - connect(m_stagingDir, &StringAspect::changed, this, updateDetails); - - if (m_useiOSAutomaticProvisioningUpdates) - connect(m_useiOSAutomaticProvisioningUpdates, &BoolAspect::changed, this, updateDetails); + connect(&cmakeArguments, &BaseAspect::changed, this, updateDetails); + connect(&toolArguments, &BaseAspect::changed, this, updateDetails); + connect(&useStaging, &BaseAspect::changed, this, updateDetails); + connect(&stagingDir, &BaseAspect::changed, this, updateDetails); + connect(&useiOSAutomaticProvisioningUpdates, &BaseAspect::changed, this, updateDetails); connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged, this, updateDetails); @@ -685,12 +677,12 @@ void CMakeBuildStep::setConfiguration(const QString &configuration) void CMakeBuildStep::setToolArguments(const QStringList &nativeToolArguments) { - m_toolArguments->setValue(nativeToolArguments.join(" ")); + toolArguments.setValue(nativeToolArguments.join(" ")); } -void CMakeBuildStep::setCMakeArguments(const QStringList &cmakeArguments) +void CMakeBuildStep::setCMakeArguments(const QStringList &cmakeArgs) { - m_cmakeArguments->setValue(cmakeArguments.join(" ")); + cmakeArguments.setValue(cmakeArgs.join(" ")); } Environment CMakeBuildStep::environment() const @@ -763,11 +755,6 @@ QString CMakeBuildStep::currentInstallPrefix() const return QString::fromUtf8(config.valueOf("CMAKE_INSTALL_PREFIX")); } -QString CMakeBuildStep::currentStagingDir() const -{ - return m_stagingDir->filePath().path(); -} - FilePath CMakeBuildStep::cmakeExecutable() const { CMakeTool *tool = CMakeKitAspect::cmakeTool(kit()); @@ -776,12 +763,11 @@ FilePath CMakeBuildStep::cmakeExecutable() const void CMakeBuildStep::updateDeploymentData() { - if (!m_useStaging->value()) + if (!useStaging()) return; QString install = currentInstallPrefix(); - QString stagingDir = currentStagingDir(); - FilePath rootDir = cmakeExecutable().withNewPath(stagingDir); + FilePath rootDir = cmakeExecutable().withNewPath(stagingDir().path()); Q_UNUSED(install); DeploymentData deploymentData; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h index 89b0cbd3b5a..af239275d38 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h @@ -70,6 +70,12 @@ public: void setConfiguration(const QString &configuration); + Utils::StringAspect cmakeArguments{this}; + Utils::StringAspect toolArguments{this}; + Utils::BoolAspect useiOSAutomaticProvisioningUpdates{this}; + Utils::BoolAspect useStaging{this}; + Utils::FilePathAspect stagingDir{this}; + signals: void buildTargetsChanged(); void environmentChanged(); @@ -86,7 +92,6 @@ private: Utils::FilePath cmakeExecutable() const; QString currentInstallPrefix() const; - QString currentStagingDir() const; QString defaultBuildTarget() const; bool isCleanStep() const; @@ -98,11 +103,6 @@ private: friend class CMakeBuildStepConfigWidget; QStringList m_buildTargets; // Convention: Empty string member signifies "Current executable" - Utils::StringAspect *m_cmakeArguments = nullptr; - Utils::StringAspect *m_toolArguments = nullptr; - Utils::BoolAspect *m_useiOSAutomaticProvisioningUpdates = nullptr; - Utils::BoolAspect *m_useStaging = nullptr; - Utils::FilePathAspect *m_stagingDir = nullptr; QString m_allTarget = "all"; QString m_installTarget = "install"; From d7a232331a581c5e87fe8c5fa98a0cfc78d5bce8 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 23:15:26 +0200 Subject: [PATCH 0316/1777] BuildStep: Make it possible to run with task tree Move the doRun() implementation from AbstractProcessStep and from AbstractRemoteLinuxDeployStep into BuildStep. Do the same with doCancel(). Task-number: QTCREATORBUG-29168 Change-Id: I767f73dc7408d7c5a9fe9821da92e664cf1ed8f3 Reviewed-by: hjk <hjk@qt.io> --- .../projectexplorer/abstractprocessstep.cpp | 37 +------------- .../projectexplorer/abstractprocessstep.h | 6 +-- src/plugins/projectexplorer/buildstep.cpp | 48 ++++++++++++++++++- src/plugins/projectexplorer/buildstep.h | 14 ++++-- .../abstractremotelinuxdeploystep.cpp | 36 ++------------ .../abstractremotelinuxdeploystep.h | 7 +-- 6 files changed, 65 insertions(+), 83 deletions(-) diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 13e5d00d33a..550ecff2812 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -72,7 +72,6 @@ public: Private(AbstractProcessStep *q) : q(q) {} AbstractProcessStep *q; - std::unique_ptr<TaskTree> m_taskTree; ProcessParameters m_param; ProcessParameters *m_displayedParams = &m_param; std::function<CommandLine()> m_commandLineProvider; @@ -144,7 +143,7 @@ void AbstractProcessStep::setWorkingDirectoryProvider(const std::function<FilePa bool AbstractProcessStep::init() { - if (d->m_taskTree) + if (!BuildStep::init()) return false; if (!setupProcessParameters(processParameters())) @@ -163,30 +162,6 @@ void AbstractProcessStep::setupOutputFormatter(OutputFormatter *formatter) BuildStep::setupOutputFormatter(formatter); } -/*! - Reimplemented from BuildStep::init(). You need to call this from - YourBuildStep::run(). -*/ - -void AbstractProcessStep::doRun() -{ - QTC_ASSERT(!d->m_taskTree, return); - - d->m_taskTree.reset(new TaskTree({runRecipe()})); - connect(d->m_taskTree.get(), &TaskTree::progressValueChanged, this, [this](int value) { - emit progress(qRound(double(value) * 100 / std::max(d->m_taskTree->progressMaximum(), 1)), {}); - }); - connect(d->m_taskTree.get(), &TaskTree::done, this, [this] { - d->m_taskTree.release()->deleteLater(); - emit finished(true); - }); - connect(d->m_taskTree.get(), &TaskTree::errorOccurred, this, [this] { - d->m_taskTree.release()->deleteLater(); - emit finished(false); - }); - d->m_taskTree->start(); -} - GroupItem AbstractProcessStep::defaultProcessTask() { const auto onSetup = [this](Process &process) { @@ -269,16 +244,6 @@ void AbstractProcessStep::setLowPriority() d->m_lowPriority = true; } -void AbstractProcessStep::doCancel() -{ - if (!d->m_taskTree) - return; - - d->m_taskTree.reset(); - emit addOutput(Tr::tr("The build step was ended forcefully."), OutputFormat::ErrorMessage); - emit finished(false); -} - ProcessParameters *AbstractProcessStep::processParameters() { return &d->m_param; diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index 7b5209a0234..ef52e648c00 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -10,8 +10,6 @@ class CommandLine; class Process; } -namespace Tasking { class GroupItem; } - namespace ProjectExplorer { class ProcessParameters; @@ -39,8 +37,6 @@ protected: bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; - void doRun() final; - void doCancel() final; void setLowPriority(); void setDisplayedParameters(ProcessParameters *params); @@ -49,7 +45,7 @@ protected: void handleProcessDone(const Utils::Process &process); private: - virtual Tasking::GroupItem runRecipe(); + Tasking::GroupItem runRecipe() override; class Private; Private *d; diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index d9017ce4a06..20747bf0cb2 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -10,9 +10,12 @@ #include "kitinformation.h" #include "project.h" #include "projectexplorerconstants.h" +#include "projectexplorertr.h" #include "sanitizerparser.h" #include "target.h" +#include <solutions/tasking/tasktree.h> + #include <utils/algorithm.h> #include <utils/fileinprojectfinder.h> #include <utils/layoutbuilder.h> @@ -103,6 +106,7 @@ immutable steps are run. The default implementation returns \c false. */ +using namespace Tasking; using namespace Utils; static const char buildStepEnabledKey[] = "ProjectExplorer.BuildStep.Enabled"; @@ -114,6 +118,7 @@ static QList<BuildStepFactory *> g_buildStepFactories; BuildStep::BuildStep(BuildStepList *bsl, Id id) : ProjectConfiguration(bsl, bsl->target(), id) , m_stepList(bsl) + , m_cancelMessage(Tr::tr("The build step was ended forcefully.")) { connect(this, &ProjectConfiguration::displayNameChanged, this, &BuildStep::updateSummary); @@ -126,6 +131,11 @@ BuildStep::~BuildStep() emit finished(false); } +bool BuildStep::init() +{ + return !m_taskTree; +} + void BuildStep::run() { m_cancelFlag = false; @@ -297,10 +307,44 @@ bool BuildStep::isCanceled() const return m_cancelFlag; } +void BuildStep::setCancelMessage(const QString &message) +{ + m_cancelMessage = message; +} + +Tasking::GroupItem BuildStep::runRecipe() +{ + return Group {}; +} + +void BuildStep::doRun() +{ + QTC_ASSERT(!m_taskTree, return); + + m_taskTree.reset(new TaskTree({runRecipe()})); + connect(m_taskTree.get(), &TaskTree::progressValueChanged, this, [this](int value) { + emit progress(qRound(double(value) * 100 / std::max(m_taskTree->progressMaximum(), 1)), {}); + }); + connect(m_taskTree.get(), &TaskTree::done, this, [this] { + emit finished(true); + m_taskTree.release()->deleteLater(); + }); + connect(m_taskTree.get(), &TaskTree::errorOccurred, this, [this] { + emit finished(false); + m_taskTree.release()->deleteLater(); + }); + m_taskTree->start(); +} + void BuildStep::doCancel() { - QTC_ASSERT(false, qWarning() << "Build step" << displayName() - << "neeeds to implement the doCancel() function"); + if (!m_taskTree) + return; + + m_taskTree.reset(); + if (!m_cancelMessage.isEmpty()) + emit addOutput(m_cancelMessage, OutputFormat::ErrorMessage); + emit finished(false); } void BuildStep::addMacroExpander() diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 8520f851def..ef483f60796 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -24,6 +24,11 @@ class MacroExpander; class OutputFormatter; } // Utils +namespace Tasking { +class GroupItem; +class TaskTree; +} + namespace ProjectExplorer { class BuildConfiguration; @@ -44,7 +49,7 @@ protected: public: ~BuildStep() override; - virtual bool init() = 0; + virtual bool init(); void run(); void cancel(); @@ -122,13 +127,14 @@ signals: protected: virtual QWidget *createConfigWidget(); - bool isCanceled() const; + void setCancelMessage(const QString &message); private: using ProjectConfiguration::parent; - virtual void doRun() = 0; + virtual Tasking::GroupItem runRecipe(); // TODO: Make pure virtual when all subclasses implement it. + virtual void doRun(); virtual void doCancel(); BuildStepList * const m_stepList; @@ -139,8 +145,10 @@ private: bool m_addMacroExpander = false; std::optional<bool> m_wasExpanded; std::function<QString()> m_summaryUpdater; + std::unique_ptr<Tasking::TaskTree> m_taskTree; QString m_summaryText; + QString m_cancelMessage; }; class PROJECTEXPLORER_EXPORT BuildStepFactory diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index 894f91f49c3..16745f77f08 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -29,7 +29,6 @@ public: std::function<expected_str<void>()> internalInit; DeploymentTimeInfo deployTimes; - std::unique_ptr<TaskTree> m_taskTree; }; } // Internal @@ -38,7 +37,9 @@ using namespace Internal; AbstractRemoteLinuxDeployStep::AbstractRemoteLinuxDeployStep(BuildStepList *bsl, Id id) : BuildStep(bsl, id), d(new AbstractRemoteLinuxDeployStepPrivate) -{} +{ + setCancelMessage(Tr::tr("User requests deployment to stop; cleaning up.")); +} AbstractRemoteLinuxDeployStep::~AbstractRemoteLinuxDeployStep() { @@ -99,6 +100,8 @@ QVariantMap AbstractRemoteLinuxDeployStep::toMap() const bool AbstractRemoteLinuxDeployStep::init() { QTC_ASSERT(d->internalInit, return false); + if (!BuildStep::init()) + return false; const auto canDeploy = d->internalInit(); if (!canDeploy) { emit addOutput(Tr::tr("Cannot deploy: %1").arg(canDeploy.error()), @@ -107,35 +110,6 @@ bool AbstractRemoteLinuxDeployStep::init() return bool(canDeploy); } -void AbstractRemoteLinuxDeployStep::doRun() -{ - QTC_ASSERT(!d->m_taskTree, return); - - d->m_taskTree.reset(new TaskTree({runRecipe()})); - const auto onDone = [this] { - d->m_taskTree.release()->deleteLater(); - emit finished(true); - }; - const auto onError = [this] { - d->m_taskTree.release()->deleteLater(); - emit finished(false); - }; - connect(d->m_taskTree.get(), &TaskTree::done, this, onDone); - connect(d->m_taskTree.get(), &TaskTree::errorOccurred, this, onError); - d->m_taskTree->start(); -} - -void AbstractRemoteLinuxDeployStep::doCancel() -{ - if (!d->m_taskTree) - return; - - d->m_taskTree.reset(); - emit addOutput(Tr::tr("User requests deployment to stop; cleaning up."), - OutputFormat::NormalMessage); - emit finished(false); -} - void AbstractRemoteLinuxDeployStep::addProgressMessage(const QString &message) { emit addOutput(message, OutputFormat::NormalMessage); diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h index 299a3ca736a..0bfc44edfab 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h @@ -9,7 +9,6 @@ #include <projectexplorer/devicesupport/idevicefwd.h> namespace ProjectExplorer { class DeployableFile; } -namespace Tasking { class GroupItem; } namespace RemoteLinux { @@ -30,8 +29,6 @@ protected: bool fromMap(const QVariantMap &map) final; QVariantMap toMap() const final; bool init() final; - void doRun() final; - void doCancel() final; void setInternalInitializer(const std::function<Utils::expected_str<void>()> &init); @@ -45,12 +42,10 @@ protected: void addErrorMessage(const QString &message); void addWarningMessage(const QString &message); - void handleFinished(); - private: virtual bool isDeploymentNecessary() const; virtual Tasking::GroupItem deployRecipe() = 0; - Tasking::GroupItem runRecipe(); + Tasking::GroupItem runRecipe() final; Internal::AbstractRemoteLinuxDeployStepPrivate *d; }; From 870a1dca4dda30e678bb24806de8aa0b08994d31 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 13 Jul 2023 00:04:11 +0200 Subject: [PATCH 0317/1777] CopyStepBase: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: Ie97c20da77ca8b1d93bf4725fa5bd4a7710be55b Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/copystep.cpp | 37 ++++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/plugins/projectexplorer/copystep.cpp b/src/plugins/projectexplorer/copystep.cpp index 6d5aef64db0..0d5c012016d 100644 --- a/src/plugins/projectexplorer/copystep.cpp +++ b/src/plugins/projectexplorer/copystep.cpp @@ -7,7 +7,9 @@ #include "projectexplorertr.h" #include <utils/aspects.h> +#include <utils/filestreamer.h> +using namespace Tasking; using namespace Utils; namespace ProjectExplorer::Internal { @@ -33,31 +35,34 @@ public: protected: bool init() final { + if (!BuildStep::init()) + return false; m_source = m_sourceAspect(); m_target = m_targetAspect(); return m_source.exists(); } - void doRun() final - { - // FIXME: asyncCopy does not handle directories yet. - QTC_ASSERT(m_source.isFile(), emit finished(false)); - m_source.asyncCopy(m_target, this, [this](const expected_str<void> &cont) { - if (!cont) { - addOutput(cont.error(), OutputFormat::ErrorMessage); - addOutput(Tr::tr("Copying failed."), OutputFormat::ErrorMessage); - emit finished(false); - } else { - addOutput(Tr::tr("Copying finished."), OutputFormat::NormalMessage); - emit finished(true); - } - }); - } - FilePathAspect m_sourceAspect{this}; FilePathAspect m_targetAspect{this}; private: + GroupItem runRecipe() final + { + const auto onSetup = [this](FileStreamer &streamer) { + QTC_ASSERT(m_source.isFile(), return SetupResult::StopWithError); + streamer.setSource(m_source); + streamer.setDestination(m_target); + return SetupResult::Continue; + }; + const auto onDone = [this](const FileStreamer &) { + addOutput(Tr::tr("Copying finished."), OutputFormat::NormalMessage); + }; + const auto onError = [this](const FileStreamer &) { + addOutput(Tr::tr("Copying failed."), OutputFormat::ErrorMessage); + }; + return FileStreamerTask(onSetup, onDone, onError); + } + FilePath m_source; FilePath m_target; }; From b1f1624b6ec5bdfaa3d27b2ec2f5f03888e78569 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 13 Jul 2023 00:11:04 +0200 Subject: [PATCH 0318/1777] DeviceCheckBuildStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I3506663263d8ebdc922bd6ac1b11357f4a6dba8f Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../devicesupport/devicecheckbuildstep.cpp | 60 ++++++++++--------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp index 84e3b274084..00b9527b417 100644 --- a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp @@ -8,9 +8,10 @@ #include "../projectexplorertr.h" #include "devicemanager.h" -#include "idevice.h" #include "idevicefactory.h" +#include <solutions/tasking/tasktree.h> + #include <QMessageBox> namespace ProjectExplorer { @@ -26,40 +27,43 @@ public: bool init() override { + if (!BuildStep::init()) + return false; + IDevice::ConstPtr device = DeviceKitAspect::device(kit()); - if (!device) { - Utils::Id deviceTypeId = DeviceTypeKitAspect::deviceTypeId(kit()); - IDeviceFactory *factory = IDeviceFactory::find(deviceTypeId); - if (!factory || !factory->canCreate()) { - emit addOutput(Tr::tr("No device configured."), BuildStep::OutputFormat::ErrorMessage); - return false; - } + if (device) + return true; - QMessageBox msgBox(QMessageBox::Question, Tr::tr("Set Up Device"), - Tr::tr("There is no device set up for this kit. Do you want to add a device?"), - QMessageBox::Yes|QMessageBox::No); - msgBox.setDefaultButton(QMessageBox::Yes); - if (msgBox.exec() == QMessageBox::No) { - emit addOutput(Tr::tr("No device configured."), BuildStep::OutputFormat::ErrorMessage); - return false; - } - - IDevice::Ptr newDevice = factory->create(); - if (newDevice.isNull()) { - emit addOutput(Tr::tr("No device configured."), BuildStep::OutputFormat::ErrorMessage); - return false; - } - - DeviceManager *dm = DeviceManager::instance(); - dm->addDevice(newDevice); - - DeviceKitAspect::setDevice(kit(), newDevice); + Utils::Id deviceTypeId = DeviceTypeKitAspect::deviceTypeId(kit()); + IDeviceFactory *factory = IDeviceFactory::find(deviceTypeId); + if (!factory || !factory->canCreate()) { + emit addOutput(Tr::tr("No device configured."), OutputFormat::ErrorMessage); + return false; } + QMessageBox msgBox(QMessageBox::Question, Tr::tr("Set Up Device"), + Tr::tr("There is no device set up for this kit. Do you want to add a device?"), + QMessageBox::Yes | QMessageBox::No); + msgBox.setDefaultButton(QMessageBox::Yes); + if (msgBox.exec() == QMessageBox::No) { + emit addOutput(Tr::tr("No device configured."), OutputFormat::ErrorMessage); + return false; + } + + IDevice::Ptr newDevice = factory->create(); + if (newDevice.isNull()) { + emit addOutput(Tr::tr("No device configured."), OutputFormat::ErrorMessage); + return false; + } + + DeviceManager *dm = DeviceManager::instance(); + dm->addDevice(newDevice); + DeviceKitAspect::setDevice(kit(), newDevice); return true; } - void doRun() override { emit finished(true); } +private: + Tasking::GroupItem runRecipe() final { return Tasking::Group{}; } }; // Factory From 7fb8cd01dd124578df4e8daf26e4ea8949dd87d0 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 13 Jul 2023 00:23:15 +0200 Subject: [PATCH 0319/1777] NimCompilerCleanStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I9f7b0d6c00fcfdc62baa5e17dc337ccc75d2e4bd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- .../nim/project/nimcompilercleanstep.cpp | 57 ++++++++++--------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/plugins/nim/project/nimcompilercleanstep.cpp b/src/plugins/nim/project/nimcompilercleanstep.cpp index 4e2c51446a8..fe3e4dfa4b2 100644 --- a/src/plugins/nim/project/nimcompilercleanstep.cpp +++ b/src/plugins/nim/project/nimcompilercleanstep.cpp @@ -9,6 +9,8 @@ #include <projectexplorer/projectexplorerconstants.h> +#include <solutions/tasking/tasktree.h> + #include <utils/aspects.h> #include <utils/qtcassert.h> @@ -16,6 +18,7 @@ #include <QDateTime> using namespace ProjectExplorer; +using namespace Tasking; using namespace Utils; namespace Nim { @@ -37,8 +40,7 @@ public: private: bool init() final; - void doRun() final; - void doCancel() final {} // Can be left empty. The run() function hardly does anything. + GroupItem runRecipe() final; bool removeCacheDirectory(); bool removeOutFilePath(); @@ -49,35 +51,36 @@ private: bool NimCompilerCleanStep::init() { - FilePath buildDir = buildDirectory(); - bool result = buildDir.exists(); - if (result) + if (!BuildStep::init()) + return false; + const FilePath buildDir = buildDirectory(); + const bool exists = buildDir.exists(); + if (exists) m_buildDir = buildDir; - return result; + return exists; } -void NimCompilerCleanStep::doRun() +GroupItem NimCompilerCleanStep::runRecipe() { - if (!m_buildDir.exists()) { - emit addOutput(Tr::tr("Build directory \"%1\" does not exist.").arg(m_buildDir.toUserOutput()), OutputFormat::ErrorMessage); - emit finished(false); - return; - } - - if (!removeCacheDirectory()) { - emit addOutput(Tr::tr("Failed to delete the cache directory."), OutputFormat::ErrorMessage); - emit finished(false); - return; - } - - if (!removeOutFilePath()) { - emit addOutput(Tr::tr("Failed to delete the out file."), OutputFormat::ErrorMessage); - emit finished(false); - return; - } - - emit addOutput(Tr::tr("Clean step completed successfully."), OutputFormat::NormalMessage); - emit finished(true); + const auto onSetup = [this] { + if (!m_buildDir.exists()) { + emit addOutput(Tr::tr("Build directory \"%1\" does not exist.") + .arg(m_buildDir.toUserOutput()), OutputFormat::ErrorMessage); + return false; + } + if (!removeCacheDirectory()) { + emit addOutput(Tr::tr("Failed to delete the cache directory."), + OutputFormat::ErrorMessage); + return false; + } + if (!removeOutFilePath()) { + emit addOutput(Tr::tr("Failed to delete the out file."), OutputFormat::ErrorMessage); + return false; + } + emit addOutput(Tr::tr("Clean step completed successfully."), OutputFormat::NormalMessage); + return true; + }; + return Sync(onSetup); } bool NimCompilerCleanStep::removeCacheDirectory() From 64d16786afb255f660d12c1f9ec487779a45863c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 12 Jul 2023 23:43:21 +0200 Subject: [PATCH 0320/1777] AndroidDeployQtStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: Icb38b0036025cc4fe7ab7a6c8086f51922630730 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/android/androiddeployqtstep.cpp | 42 +++++++++------------ 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index db877b4e972..6b44a850ef9 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -89,13 +89,12 @@ private: void runCommand(const CommandLine &command); bool init() override; - void doRun() override; - void doCancel() override; + Tasking::GroupItem runRecipe() final; void gatherFilesToPull(); DeployErrorCode runDeploy(); void slotAskForUninstall(DeployErrorCode errorCode); - void runImpl(QPromise<bool> &promise); + void runImpl(QPromise<void> &promise); QWidget *createConfigWidget() override; @@ -132,8 +131,6 @@ private: FilePath m_workingDirectory; Environment m_environment; AndroidDeviceInfo m_deviceInfo; - - // The synchronizer has cancelOnWait set to true by default. FutureSynchronizer m_synchronizer; }; @@ -162,6 +159,9 @@ AndroidDeployQtStep::AndroidDeployQtStep(BuildStepList *parent, Id id) bool AndroidDeployQtStep::init() { + if (!BuildStep::init()) + return false; + QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit()); if (!version) { reportWarningOrError(Tr::tr("The Qt version for kit %1 is invalid.").arg(kit()->displayName()), @@ -477,16 +477,16 @@ void AndroidDeployQtStep::slotAskForUninstall(DeployErrorCode errorCode) m_askForUninstall = button == QMessageBox::Yes; } -void AndroidDeployQtStep::runImpl(QPromise<bool> &promise) +// TODO: This implementation is not thread safe. +void AndroidDeployQtStep::runImpl(QPromise<void> &promise) { if (!m_avdName.isEmpty()) { - const QString serialNumber = AndroidAvdManager().waitForAvd(m_avdName, - QFuture<void>(promise.future())); + const QString serialNumber = AndroidAvdManager().waitForAvd(m_avdName, promise.future()); qCDebug(deployStepLog) << "Deploying to AVD:" << m_avdName << serialNumber; if (serialNumber.isEmpty()) { reportWarningOrError(Tr::tr("The deployment AVD \"%1\" cannot be started.") .arg(m_avdName), Task::Error); - promise.addResult(false); + promise.future().cancel(); return; } m_serialNumber = serialNumber; @@ -529,7 +529,8 @@ void AndroidDeployQtStep::runImpl(QPromise<bool> &promise) reportWarningOrError(error, Task::Error); } } - promise.addResult(returnValue == NoError); + if (returnValue != NoError) + promise.future().cancel(); } void AndroidDeployQtStep::gatherFilesToPull() @@ -561,22 +562,13 @@ void AndroidDeployQtStep::gatherFilesToPull() << "to:" << itr.value(); } -void AndroidDeployQtStep::doRun() +Tasking::GroupItem AndroidDeployQtStep::runRecipe() { - auto * const watcher = new QFutureWatcher<bool>(this); - connect(watcher, &QFutureWatcher<bool>::finished, this, [this, watcher] { - const bool success = !watcher->isCanceled() && watcher->result(); - emit finished(success); - watcher->deleteLater(); - }); - auto future = Utils::asyncRun(&AndroidDeployQtStep::runImpl, this); - watcher->setFuture(future); - m_synchronizer.addFuture(future); -} - -void AndroidDeployQtStep::doCancel() -{ - m_synchronizer.cancelAllFutures(); + const auto onSetup = [this](Async<void> &async) { + async.setConcurrentCallData(&AndroidDeployQtStep::runImpl, this); + async.setFutureSynchronizer(&m_synchronizer); + }; + return Tasking::AsyncTask<void>(onSetup); } void AndroidDeployQtStep::runCommand(const CommandLine &command) From 108c64fc7acf30fa09e1d5af0e998dbb54efdd07 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 18:27:51 +0200 Subject: [PATCH 0321/1777] WebAssembly: Move special aspect closer to its only use WebBrowserSelectionAspect is not too far off from a normal SelectionAspect, and may be one later. Change-Id: I4d9d3a77244fe3f30f29746e67f5420ae9c6c3f0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/webassembly/CMakeLists.txt | 1 - src/plugins/webassembly/webassembly.qbs | 2 - src/plugins/webassembly/webassembly_test.cpp | 4 +- .../webassemblyrunconfiguration.cpp | 115 +++++++++++++++++- .../webassembly/webassemblyrunconfiguration.h | 6 + .../webassemblyrunconfigurationaspects.cpp | 108 ---------------- .../webassemblyrunconfigurationaspects.h | 46 ------- 7 files changed, 119 insertions(+), 163 deletions(-) delete mode 100644 src/plugins/webassembly/webassemblyrunconfigurationaspects.cpp delete mode 100644 src/plugins/webassembly/webassemblyrunconfigurationaspects.h diff --git a/src/plugins/webassembly/CMakeLists.txt b/src/plugins/webassembly/CMakeLists.txt index 6609357f015..d9e46bcc4d4 100644 --- a/src/plugins/webassembly/CMakeLists.txt +++ b/src/plugins/webassembly/CMakeLists.txt @@ -10,7 +10,6 @@ add_qtc_plugin(WebAssembly webassemblyplugin.cpp webassemblyplugin.h webassemblyqtversion.cpp webassemblyqtversion.h webassemblyrunconfiguration.cpp webassemblyrunconfiguration.h - webassemblyrunconfigurationaspects.cpp webassemblyrunconfigurationaspects.h webassemblysettings.cpp webassemblysettings.h webassemblytoolchain.cpp webassemblytoolchain.h webassemblytr.h diff --git a/src/plugins/webassembly/webassembly.qbs b/src/plugins/webassembly/webassembly.qbs index 12b639238cb..75a019ed422 100644 --- a/src/plugins/webassembly/webassembly.qbs +++ b/src/plugins/webassembly/webassembly.qbs @@ -25,8 +25,6 @@ QtcPlugin { "webassemblyqtversion.h", "webassemblyrunconfiguration.cpp", "webassemblyrunconfiguration.h", - "webassemblyrunconfigurationaspects.cpp", - "webassemblyrunconfigurationaspects.h", "webassemblysettings.cpp", "webassemblysettings.h", "webassemblytoolchain.cpp", diff --git a/src/plugins/webassembly/webassembly_test.cpp b/src/plugins/webassembly/webassembly_test.cpp index 6292cd9942a..bc763822c06 100644 --- a/src/plugins/webassembly/webassembly_test.cpp +++ b/src/plugins/webassembly/webassembly_test.cpp @@ -4,7 +4,7 @@ #include "webassembly_test.h" #include "webassemblyemsdk.h" -#include "webassemblyrunconfigurationaspects.h" +#include "webassemblyrunconfiguration.h" #include <utils/environment.h> @@ -77,7 +77,7 @@ void WebAssemblyTest::testEmrunBrowserListParsing() QFETCH(QByteArray, emrunOutput); QFETCH(WebBrowserEntries, expectedBrowsers); - QCOMPARE(WebBrowserSelectionAspect::parseEmrunOutput(emrunOutput), expectedBrowsers); + QCOMPARE(parseEmrunOutput(emrunOutput), expectedBrowsers); } void WebAssemblyTest::testEmrunBrowserListParsing_data() diff --git a/src/plugins/webassembly/webassemblyrunconfiguration.cpp b/src/plugins/webassembly/webassemblyrunconfiguration.cpp index 7459853f508..a1bb735c3c3 100644 --- a/src/plugins/webassembly/webassemblyrunconfiguration.cpp +++ b/src/plugins/webassembly/webassemblyrunconfiguration.cpp @@ -1,9 +1,9 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "webassemblyconstants.h" #include "webassemblyrunconfiguration.h" -#include "webassemblyrunconfigurationaspects.h" + +#include "webassemblyconstants.h" #include "webassemblytr.h" #include <projectexplorer/buildconfiguration.h> @@ -12,14 +12,37 @@ #include <projectexplorer/devicesupport/deviceusedportsgatherer.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> +#include <utils/layoutbuilder.h> +#include <utils/process.h> +#include <utils/qtcassert.h> + +#include <QComboBox> +#include <QTextStream> + using namespace ProjectExplorer; using namespace Utils; namespace WebAssembly::Internal { +WebBrowserEntries parseEmrunOutput(const QByteArray &output) +{ + WebBrowserEntries result; + QTextStream ts(output); + QString line; + static const QRegularExpression regExp(R"( - (.*):\s*(.*))"); // ' - firefox: Mozilla Firefox' + // ^__1__^ ^______2______^ + while (ts.readLineInto(&line)) { + const QRegularExpressionMatch match = regExp.match(line); + if (match.hasMatch()) + result.push_back({match.captured(1), match.captured(2)}); + } + return result; +} + static FilePath pythonInterpreter(const Environment &env) { const QString emsdkPythonEnvVarKey("EMSDK_PYTHON"); @@ -63,12 +86,94 @@ static CommandLine emrunCommand(const Target *target, return {}; } +static const char BROWSER_KEY[] = "WASM.WebBrowserSelectionAspect.Browser"; + +static WebBrowserEntries emrunBrowsers(Target *target) +{ + WebBrowserEntries result; + result.append(qMakePair(QString(), Tr::tr("Default Browser"))); + if (auto bc = target->activeBuildConfiguration()) { + const Environment environment = bc->environment(); + const FilePath emrunPath = environment.searchInPath("emrun"); + + Process browserLister; + browserLister.setEnvironment(environment); + browserLister.setCommand({emrunPath, {"--list_browsers"}}); + browserLister.start(); + + if (browserLister.waitForFinished()) + result.append(parseEmrunOutput(browserLister.readAllRawStandardOutput())); + } + return result; +} + +class WebBrowserSelectionAspect : public BaseAspect +{ + Q_OBJECT + +public: + WebBrowserSelectionAspect(AspectContainer *container) + : BaseAspect(container) + {} + + void setTarget(Target *target) + { + m_availableBrowsers = emrunBrowsers(target); + if (!m_availableBrowsers.isEmpty()) { + const int defaultIndex = qBound(0, m_availableBrowsers.count() - 1, 1); + m_currentBrowser = m_availableBrowsers.at(defaultIndex).first; + } + setDisplayName(Tr::tr("Web Browser")); + setId("WebBrowserAspect"); + setSettingsKey("RunConfiguration.WebBrowser"); + + addDataExtractor(this, &WebBrowserSelectionAspect::currentBrowser, &Data::currentBrowser); + } + + void addToLayout(Layouting::LayoutItem &parent) override + { + QTC_CHECK(!m_webBrowserComboBox); + m_webBrowserComboBox = new QComboBox; + for (const WebBrowserEntry &be : m_availableBrowsers) + m_webBrowserComboBox->addItem(be.second, be.first); + m_webBrowserComboBox->setCurrentIndex(m_webBrowserComboBox->findData(m_currentBrowser)); + connect(m_webBrowserComboBox, &QComboBox::currentIndexChanged, this, [this] { + m_currentBrowser = m_webBrowserComboBox->currentData().toString(); + emit changed(); + }); + parent.addItems({Tr::tr("Web browser:"), m_webBrowserComboBox}); + } + + void fromMap(const QVariantMap &map) override + { + if (!m_availableBrowsers.isEmpty()) + m_currentBrowser = map.value(BROWSER_KEY, m_availableBrowsers.first().first).toString(); + } + + void toMap(QVariantMap &map) const override + { + map.insert(BROWSER_KEY, m_currentBrowser); + } + + QString currentBrowser() const { return m_currentBrowser; } + + struct Data : BaseAspect::Data + { + QString currentBrowser; + }; + +private: + QComboBox *m_webBrowserComboBox = nullptr; + QString m_currentBrowser; + WebBrowserEntries m_availableBrowsers; +}; + // Runs a webassembly application via emscripten's "emrun" tool // https://emscripten.org/docs/compiling/Running-html-files-with-emrun.html -class EmrunRunConfiguration : public ProjectExplorer::RunConfiguration +class EmrunRunConfiguration : public RunConfiguration { public: - EmrunRunConfiguration(Target *target, Utils::Id id) + EmrunRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { webBrowser.setTarget(target); @@ -130,3 +235,5 @@ EmrunRunWorkerFactory::EmrunRunWorkerFactory() } } // Webassembly::Internal + +#include "webassemblyrunconfiguration.moc" diff --git a/src/plugins/webassembly/webassemblyrunconfiguration.h b/src/plugins/webassembly/webassemblyrunconfiguration.h index b6ade22e847..9490cc77c86 100644 --- a/src/plugins/webassembly/webassemblyrunconfiguration.h +++ b/src/plugins/webassembly/webassemblyrunconfiguration.h @@ -8,6 +8,12 @@ namespace WebAssembly::Internal { +using WebBrowserEntry = QPair<QString, QString>; // first: id, second: display name +using WebBrowserEntries = QList<WebBrowserEntry>; + +WebBrowserEntries parseEmrunOutput(const QByteArray &output); + + class EmrunRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory { public: diff --git a/src/plugins/webassembly/webassemblyrunconfigurationaspects.cpp b/src/plugins/webassembly/webassemblyrunconfigurationaspects.cpp deleted file mode 100644 index 74ee0ded60f..00000000000 --- a/src/plugins/webassembly/webassemblyrunconfigurationaspects.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (C) 2019 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "webassemblyrunconfigurationaspects.h" -#include "webassemblytr.h" - -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/target.h> - -#include <utils/layoutbuilder.h> -#include <utils/process.h> -#include <utils/qtcassert.h> - -#include <QComboBox> -#include <QTextStream> - -using namespace Utils; - -namespace WebAssembly { -namespace Internal { - -static const char BROWSER_KEY[] = "WASM.WebBrowserSelectionAspect.Browser"; - -static WebBrowserEntries emrunBrowsers(ProjectExplorer::Target *target) -{ - WebBrowserEntries result; - result.append(qMakePair(QString(), Tr::tr("Default Browser"))); - if (auto bc = target->activeBuildConfiguration()) { - const Utils::Environment environment = bc->environment(); - const Utils::FilePath emrunPath = environment.searchInPath("emrun"); - - Process browserLister; - browserLister.setEnvironment(environment); - browserLister.setCommand({emrunPath, {"--list_browsers"}}); - browserLister.start(); - - if (browserLister.waitForFinished()) - result.append(WebBrowserSelectionAspect::parseEmrunOutput( - browserLister.readAllRawStandardOutput())); - } - return result; -} - -WebBrowserSelectionAspect::WebBrowserSelectionAspect(AspectContainer *container) - : BaseAspect(container) -{} - -void WebBrowserSelectionAspect::setTarget(ProjectExplorer::Target *target) -{ - m_availableBrowsers = emrunBrowsers(target); - if (!m_availableBrowsers.isEmpty()) { - const int defaultIndex = qBound(0, m_availableBrowsers.count() - 1, 1); - m_currentBrowser = m_availableBrowsers.at(defaultIndex).first; - } - setDisplayName(Tr::tr("Web Browser")); - setId("WebBrowserAspect"); - setSettingsKey("RunConfiguration.WebBrowser"); - - addDataExtractor(this, &WebBrowserSelectionAspect::currentBrowser, &Data::currentBrowser); -} - -void WebBrowserSelectionAspect::addToLayout(Layouting::LayoutItem &parent) -{ - QTC_CHECK(!m_webBrowserComboBox); - m_webBrowserComboBox = new QComboBox; - for (const WebBrowserEntry &be : m_availableBrowsers) - m_webBrowserComboBox->addItem(be.second, be.first); - m_webBrowserComboBox->setCurrentIndex(m_webBrowserComboBox->findData(m_currentBrowser)); - connect(m_webBrowserComboBox, &QComboBox::currentIndexChanged, this, [this] { - m_currentBrowser = m_webBrowserComboBox->currentData().toString(); - emit changed(); - }); - parent.addItems({Tr::tr("Web browser:"), m_webBrowserComboBox}); -} - -void WebBrowserSelectionAspect::fromMap(const QVariantMap &map) -{ - if (!m_availableBrowsers.isEmpty()) - m_currentBrowser = map.value(BROWSER_KEY, m_availableBrowsers.first().first).toString(); -} - -void WebBrowserSelectionAspect::toMap(QVariantMap &map) const -{ - map.insert(BROWSER_KEY, m_currentBrowser); -} - -QString WebBrowserSelectionAspect::currentBrowser() const -{ - return m_currentBrowser; -} - -WebBrowserEntries WebBrowserSelectionAspect::parseEmrunOutput(const QByteArray &output) -{ - WebBrowserEntries result; - QTextStream ts(output); - QString line; - static const QRegularExpression regExp(R"( - (.*):\s*(.*))"); // ' - firefox: Mozilla Firefox' - // ^__1__^ ^______2______^ - while (ts.readLineInto(&line)) { - const QRegularExpressionMatch match = regExp.match(line); - if (match.hasMatch()) - result.push_back({match.captured(1), match.captured(2)}); - } - return result; -} - -} // namespace Internal -} // namespace Webassembly diff --git a/src/plugins/webassembly/webassemblyrunconfigurationaspects.h b/src/plugins/webassembly/webassemblyrunconfigurationaspects.h deleted file mode 100644 index db584d33a19..00000000000 --- a/src/plugins/webassembly/webassemblyrunconfigurationaspects.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (C) 2019 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <projectexplorer/runconfigurationaspects.h> - -QT_FORWARD_DECLARE_CLASS(QComboBox) - -namespace WebAssembly { -namespace Internal { - -using WebBrowserEntry = QPair<QString, QString>; // first: id, second: display name -using WebBrowserEntries = QList<WebBrowserEntry>; - -class WebBrowserSelectionAspect : public Utils::BaseAspect -{ - Q_OBJECT - -public: - WebBrowserSelectionAspect(Utils::AspectContainer *container); - - void setTarget(ProjectExplorer::Target *target); - - void addToLayout(Layouting::LayoutItem &parent) override; - - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; - - QString currentBrowser() const; - - static WebBrowserEntries parseEmrunOutput(const QByteArray &output); - - struct Data : BaseAspect::Data - { - QString currentBrowser; - }; - -private: - QComboBox *m_webBrowserComboBox = nullptr; - QString m_currentBrowser; - WebBrowserEntries m_availableBrowsers; -}; - -} // namespace Internal -} // namespace Webassembly From 7a4fa635cf0203d975ada9cdd198a01cd277c521 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 19:03:26 +0200 Subject: [PATCH 0322/1777] Qmake: Use aspects more directly in QmakeStep Change-Id: I3b9d081d9c7cb918d2a475a9dc7554c67d2e1c13 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../qmakebuildconfiguration.cpp | 4 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 53 +++++++------------ src/plugins/qmakeprojectmanager/qmakestep.h | 21 +++----- 3 files changed, 30 insertions(+), 48 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index f4a56b6b170..fff0a1fd5d3 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -104,7 +104,7 @@ QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Id id) appendInitialCleanStep(Constants::MAKESTEP_BS_ID); setInitializer([this, target](const BuildInfo &info) { - auto qmakeStep = buildSteps()->firstOfType<QMakeStep>(); + QMakeStep *qmakeStep = buildSteps()->firstOfType<QMakeStep>(); QTC_ASSERT(qmakeStep, return); const QmakeExtraBuildInfo qmakeExtra = info.extraInfo.value<QmakeExtraBuildInfo>(); @@ -118,7 +118,7 @@ QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Id id) QString additionalArguments = qmakeExtra.additionalArguments; if (!additionalArguments.isEmpty()) - qmakeStep->setUserArguments(additionalArguments); + qmakeStep->userArguments.setArguments(additionalArguments); aspect<SeparateDebugInfoAspect>()->setValue(qmakeExtra.config.separateDebugInfo); aspect<QmlDebuggingAspect>()->setValue(qmakeExtra.config.linkQmlDebuggingQQ2); diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 7117aa8ffcb..68b47a92494 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -63,23 +63,20 @@ QMakeStep::QMakeStep(BuildStepList *bsl, Id id) { setLowPriority(); - m_buildType = addAspect<SelectionAspect>(); - m_buildType->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - m_buildType->setDisplayName(Tr::tr("qmake build configuration:")); - m_buildType->addOption(Tr::tr("Debug")); - m_buildType->addOption(Tr::tr("Release")); + buildType.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + buildType.setDisplayName(Tr::tr("qmake build configuration:")); + buildType.addOption(Tr::tr("Debug")); + buildType.addOption(Tr::tr("Release")); - m_userArgs = addAspect<ArgumentsAspect>(); - m_userArgs->setMacroExpander(macroExpander()); - m_userArgs->setSettingsKey(QMAKE_ARGUMENTS_KEY); - m_userArgs->setLabelText(Tr::tr("Additional arguments:")); + userArguments.setMacroExpander(macroExpander()); + userArguments.setSettingsKey(QMAKE_ARGUMENTS_KEY); + userArguments.setLabelText(Tr::tr("Additional arguments:")); - m_effectiveCall = addAspect<StringAspect>(); - m_effectiveCall->setDisplayStyle(StringAspect::TextEditDisplay); - m_effectiveCall->setLabelText(Tr::tr("Effective qmake call:")); - m_effectiveCall->setReadOnly(true); - m_effectiveCall->setUndoRedoEnabled(false); - m_effectiveCall->setEnabled(true); + effectiveCall.setDisplayStyle(StringAspect::TextEditDisplay); + effectiveCall.setLabelText(Tr::tr("Effective qmake call:")); + effectiveCall.setReadOnly(true); + effectiveCall.setUndoRedoEnabled(false); + effectiveCall.setEnabled(true); auto updateSummary = [this] { QtVersion *qtVersion = QtKitAspect::qtVersion(target()->kit()); @@ -316,11 +313,6 @@ void QMakeStep::setForced(bool b) m_forced = b; } -void QMakeStep::setUserArguments(const QString &arguments) -{ - m_userArgs->setArguments(arguments); -} - QStringList QMakeStep::extraArguments() const { return m_extraArgs; @@ -397,11 +389,6 @@ QStringList QMakeStep::parserArguments() return result; } -QString QMakeStep::userArguments() const -{ - return m_userArgs->arguments(); -} - QString QMakeStep::mkspec() const { QString additionalArguments = userArguments(); @@ -439,9 +426,9 @@ QWidget *QMakeStep::createConfigWidget() abisListWidget = new QListWidget; Layouting::Form builder; - builder.addRow({m_buildType}); - builder.addRow({m_userArgs}); - builder.addRow({m_effectiveCall}); + builder.addRow({buildType}); + builder.addRow({userArguments}); + builder.addRow({effectiveCall}); builder.addRow({abisLabel, abisListWidget}); builder.addItem(Layouting::noMargin); auto widget = builder.emerge(); @@ -452,7 +439,7 @@ QWidget *QMakeStep::createConfigWidget() updateAbiWidgets(); updateEffectiveQMakeCall(); - connect(m_userArgs, &BaseAspect::changed, widget, [this] { + connect(&userArguments, &BaseAspect::changed, widget, [this] { updateAbiWidgets(); updateEffectiveQMakeCall(); @@ -460,7 +447,7 @@ QWidget *QMakeStep::createConfigWidget() qmakeBuildSystem()->scheduleUpdateAllNowOrLater(); }); - connect(m_buildType, &BaseAspect::changed, + connect(&buildType, &BaseAspect::changed, widget, [this] { buildConfigurationSelected(); }); connect(qmakeBuildConfiguration(), &QmakeBuildConfiguration::qmlDebuggingChanged, @@ -510,7 +497,7 @@ void QMakeStep::qmakeBuildConfigChanged() const bool debug = bc->qmakeBuildConfiguration() & QtVersion::DebugBuild; { const GuardLocker locker(m_ignoreChanges); - m_buildType->setValue(debug ? 0 : 1); + buildType.setValue(debug ? 0 : 1); } updateAbiWidgets(); updateEffectiveQMakeCall(); @@ -599,7 +586,7 @@ void QMakeStep::buildConfigurationSelected() return; QmakeBuildConfiguration *bc = qmakeBuildConfiguration(); QtVersion::QmakeBuildConfigs buildConfiguration = bc->qmakeBuildConfiguration(); - if (m_buildType->value() == 0) { // debug + if (buildType() == 0) { // debug buildConfiguration = buildConfiguration | QtVersion::DebugBuild; } else { buildConfiguration = buildConfiguration & ~QtVersion::DebugBuild; @@ -683,7 +670,7 @@ void QMakeStep::updateAbiWidgets() void QMakeStep::updateEffectiveQMakeCall() { - m_effectiveCall->setValue(effectiveQMakeCall()); + effectiveCall.setValue(effectiveQMakeCall()); } void QMakeStep::handleAbiWidgetChange() diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index 366bbacf60b..b2cf126bcbd 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -6,6 +6,7 @@ #include "qmakeprojectmanager_global.h" #include <projectexplorer/abstractprocessstep.h> +#include <projectexplorer/runconfigurationaspects.h> #include <utils/aspects.h> #include <utils/commandline.h> @@ -16,17 +17,11 @@ #include <QDebug> QT_BEGIN_NAMESPACE -class QComboBox; class QLabel; -class QLineEdit; -class QPlainTextEdit; class QListWidget; QT_END_NAMESPACE -namespace ProjectExplorer { -class Abi; -class ArgumentsAspect; -} // namespace ProjectExplorer +namespace ProjectExplorer { class Abi; } namespace QtSupport { class QtVersion; } @@ -115,9 +110,7 @@ public: QMakeStepConfig deducedArguments() const; // arguments passed to the pro file parser QStringList parserArguments(); - // arguments set by the user - QString userArguments() const; - void setUserArguments(const QString &arguments); + // Extra arguments for qmake and pro file parser. Not user editable via UI. QStringList extraArguments() const; void setExtraArguments(const QStringList &args); @@ -133,6 +126,10 @@ public: QVariantMap toMap() const override; + Utils::SelectionAspect buildType{this}; + ProjectExplorer::ArgumentsAspect userArguments{this}; + Utils::StringAspect effectiveCall{this}; + protected: bool fromMap(const QVariantMap &map) override; @@ -159,7 +156,7 @@ private: Utils::CommandLine m_qmakeCommand; Utils::CommandLine m_makeCommand; - ProjectExplorer::ArgumentsAspect *m_userArgs = nullptr; + // Extra arguments for qmake and pro file parser QStringList m_extraArgs; // Extra arguments for pro file parser only @@ -177,8 +174,6 @@ private: Utils::Guard m_ignoreChanges; QLabel *abisLabel = nullptr; - Utils::SelectionAspect *m_buildType = nullptr; - Utils::StringAspect *m_effectiveCall = nullptr; QListWidget *abisListWidget = nullptr; }; From 9567f82b75d783f124be10976af82cf282914a79 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 18:50:58 +0200 Subject: [PATCH 0323/1777] WebAssembly: Use the most recent settings access pattern Includes delaying construction until its first actual use. Change-Id: Ide0f7a12250c2597f45993d6ef0fb604c974a763 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/webassembly/webassemblyplugin.cpp | 1 - .../webassembly/webassemblysettings.cpp | 36 +++++++++++-------- src/plugins/webassembly/webassemblysettings.h | 18 +++++----- .../webassembly/webassemblytoolchain.cpp | 4 +-- 4 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/plugins/webassembly/webassemblyplugin.cpp b/src/plugins/webassembly/webassemblyplugin.cpp index 28227884da7..87b4283e291 100644 --- a/src/plugins/webassembly/webassemblyplugin.cpp +++ b/src/plugins/webassembly/webassemblyplugin.cpp @@ -39,7 +39,6 @@ public: WebAssemblyQtVersionFactory qtVersionFactory; EmrunRunConfigurationFactory emrunRunConfigurationFactory; EmrunRunWorkerFactory emrunRunWorkerFactory; - WebAssemblySettings settings; }; static WebAssemblyPluginPrivate *dd = nullptr; diff --git a/src/plugins/webassembly/webassemblysettings.cpp b/src/plugins/webassembly/webassemblysettings.cpp index b49c1628654..7c385e3851f 100644 --- a/src/plugins/webassembly/webassemblysettings.cpp +++ b/src/plugins/webassembly/webassemblysettings.cpp @@ -10,6 +10,7 @@ #include "webassemblytr.h" #include <coreplugin/icore.h> +#include <coreplugin/dialogs/ioptionspage.h> #include <utils/aspects.h> #include <utils/environment.h> @@ -24,13 +25,11 @@ using namespace Utils; -namespace WebAssembly { -namespace Internal { +namespace WebAssembly::Internal { -static WebAssemblySettings *theSettings = nullptr; - -WebAssemblySettings *WebAssemblySettings::instance() +WebAssemblySettings &settings() { + static WebAssemblySettings theSettings; return theSettings; } @@ -52,15 +51,9 @@ static QString environmentDisplay(const FilePath &sdkRoot) WebAssemblySettings::WebAssemblySettings() { - theSettings = this; - setSettingsGroup("WebAssembly"); + setAutoApply(false); - setId(Id(Constants::SETTINGS_ID)); - setDisplayName(Tr::tr("WebAssembly")); - setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY); - - registerAspect(&emSdk); emSdk.setSettingsKey("EmSdk"); emSdk.setExpectedKind(Utils::PathChooser::ExistingDirectory); emSdk.setDefaultValue(FileUtils::homePath()); @@ -164,5 +157,20 @@ void WebAssemblySettings::updateStatus() m_qtVersionDisplay->setVisible(WebAssemblyQtVersion::isUnsupportedQtVersionInstalled()); } -} // Internal -} // WebAssembly +// WebAssemblySettingsPage + +class WebAssemblySettingsPage final : public Core::IOptionsPage +{ +public: + WebAssemblySettingsPage() + { + setId(Id(Constants::SETTINGS_ID)); + setDisplayName(Tr::tr("WebAssembly")); + setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY); + setSettingsProvider([] { return &settings(); }); + } +}; + +const WebAssemblySettingsPage settingsPage; + +} // WebAssembly::Internal diff --git a/src/plugins/webassembly/webassemblysettings.h b/src/plugins/webassembly/webassemblysettings.h index c9e207c409c..e607e57d8f6 100644 --- a/src/plugins/webassembly/webassemblysettings.h +++ b/src/plugins/webassembly/webassemblysettings.h @@ -3,23 +3,22 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> QT_BEGIN_NAMESPACE class QTextBrowser; QT_END_NAMESPACE -namespace WebAssembly { -namespace Internal { +namespace Utils { class InfoLabel; } -class WebAssemblySettings final : public Core::PagedSettings +namespace WebAssembly::Internal { + +class WebAssemblySettings final : public Utils::AspectContainer { public: WebAssemblySettings(); - static WebAssemblySettings *instance(); - - Utils::FilePathAspect emSdk; + Utils::FilePathAspect emSdk{this}; private: QWidget *m_emSdkEnvGroupBox = nullptr; @@ -30,5 +29,6 @@ private: void updateStatus(); }; -} // namespace Internal -} // namespace WebAssmbly +WebAssemblySettings &settings(); + +} // WebAssmbly::Internal diff --git a/src/plugins/webassembly/webassemblytoolchain.cpp b/src/plugins/webassembly/webassemblytoolchain.cpp index c554ee65cd5..ef9d449bdf7 100644 --- a/src/plugins/webassembly/webassemblytoolchain.cpp +++ b/src/plugins/webassembly/webassemblytoolchain.cpp @@ -51,7 +51,7 @@ static void addRegisteredMinGWToEnvironment(Environment &env) void WebAssemblyToolChain::addToEnvironment(Environment &env) const { - const FilePath emSdk = WebAssemblySettings::instance()->emSdk(); + const FilePath emSdk = settings().emSdk(); WebAssemblyEmSdk::addToEnvironment(emSdk, env); if (env.osType() == OsTypeWindows) addRegisteredMinGWToEnvironment(env); @@ -95,7 +95,7 @@ const QVersionNumber &WebAssemblyToolChain::minimumSupportedEmSdkVersion() static Toolchains doAutoDetect(const ToolchainDetector &detector) { - const FilePath sdk = WebAssemblySettings::instance()->emSdk(); + const FilePath sdk = settings().emSdk(); if (!WebAssemblyEmSdk::isValid(sdk)) return {}; From 48ebffc5394b8cbd221b9cacb6ecfd5c3a14ffee Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 08:22:15 +0200 Subject: [PATCH 0324/1777] Remove a few unnecessary Q_OBJECT Change-Id: I4c84f264045797c70ec3022e3705f63341a1e7d9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/libs/modelinglib/qmt/config/configcontroller.h | 4 ++-- src/libs/modelinglib/qmt/config/textscanner.h | 5 ++--- src/libs/modelinglib/qmt/controller/namecontroller.h | 2 -- src/libs/modelinglib/qmt/controller/undocontroller.h | 5 ++--- src/libs/modelinglib/qmt/diagram_scene/latchcontroller.h | 6 ++---- src/libs/modelinglib/qmt/model_ui/sortedtreemodel.h | 4 +--- src/libs/modelinglib/qmt/model_ui/treemodelmanager.h | 5 ++--- src/libs/modelinglib/qmt/model_widgets_ui/propertiesview.h | 6 ++---- .../modelinglib/qmt/model_widgets_ui/propertiesviewmview.h | 5 +---- src/libs/modelinglib/qmt/stereotype/stereotypecontroller.h | 4 +--- src/libs/modelinglib/qmt/style/stylecontroller.h | 4 +--- src/plugins/qtsupport/exampleslistmodel.h | 1 - 12 files changed, 16 insertions(+), 35 deletions(-) diff --git a/src/libs/modelinglib/qmt/config/configcontroller.h b/src/libs/modelinglib/qmt/config/configcontroller.h index 73efef16f4a..28e6d65afcd 100644 --- a/src/libs/modelinglib/qmt/config/configcontroller.h +++ b/src/libs/modelinglib/qmt/config/configcontroller.h @@ -3,9 +3,10 @@ #pragma once -#include <QObject> #include "qmt/infrastructure/qmt_global.h" +#include <QObject> + namespace qmt { class CustomRelation; @@ -15,7 +16,6 @@ class Toolbar; class QMT_EXPORT ConfigController : public QObject { - Q_OBJECT class ConfigControllerPrivate; public: diff --git a/src/libs/modelinglib/qmt/config/textscanner.h b/src/libs/modelinglib/qmt/config/textscanner.h index 341b2559039..d0bec89c93a 100644 --- a/src/libs/modelinglib/qmt/config/textscanner.h +++ b/src/libs/modelinglib/qmt/config/textscanner.h @@ -3,12 +3,12 @@ #pragma once -#include <QObject> - #include "sourcepos.h" #include "qmt/infrastructure/exceptions.h" +#include <QObject> + namespace qmt { class ITextSource; @@ -29,7 +29,6 @@ private: class QMT_EXPORT TextScanner : public QObject { - Q_OBJECT class TextScannerPrivate; public: diff --git a/src/libs/modelinglib/qmt/controller/namecontroller.h b/src/libs/modelinglib/qmt/controller/namecontroller.h index b9289fb9cd9..03e3be30bb8 100644 --- a/src/libs/modelinglib/qmt/controller/namecontroller.h +++ b/src/libs/modelinglib/qmt/controller/namecontroller.h @@ -13,8 +13,6 @@ namespace qmt { class QMT_EXPORT NameController : public QObject { - Q_OBJECT - private: explicit NameController(QObject *parent = nullptr); ~NameController() override; diff --git a/src/libs/modelinglib/qmt/controller/undocontroller.h b/src/libs/modelinglib/qmt/controller/undocontroller.h index aaf62c786bd..1bef6ed2081 100644 --- a/src/libs/modelinglib/qmt/controller/undocontroller.h +++ b/src/libs/modelinglib/qmt/controller/undocontroller.h @@ -3,9 +3,10 @@ #pragma once -#include <QObject> #include "qmt/infrastructure/qmt_global.h" +#include <QObject> + QT_BEGIN_NAMESPACE class QUndoStack; QT_END_NAMESPACE @@ -16,8 +17,6 @@ class UndoCommand; class QMT_EXPORT UndoController : public QObject { - Q_OBJECT - public: explicit UndoController(QObject *parent = nullptr); ~UndoController() override; diff --git a/src/libs/modelinglib/qmt/diagram_scene/latchcontroller.h b/src/libs/modelinglib/qmt/diagram_scene/latchcontroller.h index b56a303d881..bc726c50eab 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/latchcontroller.h +++ b/src/libs/modelinglib/qmt/diagram_scene/latchcontroller.h @@ -3,11 +3,12 @@ #pragma once -#include <QObject> #include "qmt/infrastructure/qmt_global.h" #include "capabilities/latchable.h" +#include <QObject> + QT_BEGIN_NAMESPACE class QGraphicsScene; class QGraphicsSceneMouseEvent; @@ -22,8 +23,6 @@ class AlignLineItem; class QMT_EXPORT LatchController : public QObject { - Q_OBJECT - public: explicit LatchController(QObject *parent = nullptr); ~LatchController() override; @@ -44,7 +43,6 @@ private: void hideLatches(); void applyLatches(); -private: DiagramSceneModel *m_diagramSceneModel = nullptr; AlignLineItem *m_horizontalAlignLine = nullptr; AlignLineItem *m_verticalAlignLine = nullptr; diff --git a/src/libs/modelinglib/qmt/model_ui/sortedtreemodel.h b/src/libs/modelinglib/qmt/model_ui/sortedtreemodel.h index 02f02779e5b..0c01cf7de79 100644 --- a/src/libs/modelinglib/qmt/model_ui/sortedtreemodel.h +++ b/src/libs/modelinglib/qmt/model_ui/sortedtreemodel.h @@ -3,9 +3,9 @@ #pragma once -#include <QSortFilterProxyModel> #include "qmt/infrastructure/qmt_global.h" +#include <QSortFilterProxyModel> #include <QTimer> namespace qmt { @@ -14,8 +14,6 @@ class TreeModel; class QMT_EXPORT SortedTreeModel : public QSortFilterProxyModel { - Q_OBJECT - public: explicit SortedTreeModel(QObject *parent = nullptr); ~SortedTreeModel() override; diff --git a/src/libs/modelinglib/qmt/model_ui/treemodelmanager.h b/src/libs/modelinglib/qmt/model_ui/treemodelmanager.h index 0dee6d31f9b..9e0793aba87 100644 --- a/src/libs/modelinglib/qmt/model_ui/treemodelmanager.h +++ b/src/libs/modelinglib/qmt/model_ui/treemodelmanager.h @@ -3,9 +3,10 @@ #pragma once -#include <QObject> #include "qmt/infrastructure/qmt_global.h" +#include <QObject> + namespace qmt { class TreeModel; @@ -16,8 +17,6 @@ class MSelection; class QMT_EXPORT TreeModelManager : public QObject { - Q_OBJECT - public: explicit TreeModelManager(QObject *parent = nullptr); ~TreeModelManager() override; diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesview.h b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesview.h index ba115c03eda..b1255421d02 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesview.h +++ b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesview.h @@ -3,11 +3,11 @@ #pragma once -#include <QObject> - #include "qmt/infrastructure/qmt_global.h" +#include <QObject> #include <QScopedPointer> + #include <functional> QT_BEGIN_NAMESPACE @@ -28,8 +28,6 @@ class StyleController; class QMT_EXPORT PropertiesView : public QObject { - Q_OBJECT - public: class MView; diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.h b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.h index 7b94f445b7c..4762803a209 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.h +++ b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.h @@ -3,8 +3,6 @@ #pragma once -#include <QObject> - #include "propertiesview.h" #include "qmt/model/mconstvisitor.h" @@ -14,6 +12,7 @@ #include "qmt/style/styleengine.h" #include <QList> +#include <QObject> QT_BEGIN_NAMESPACE class QWidget; @@ -36,8 +35,6 @@ class PaletteBox; class QMT_EXPORT PropertiesView::MView : public QObject, public MConstVisitor, public DConstVisitor { - Q_OBJECT - public: explicit MView(PropertiesView *propertiesView); ~MView() override; diff --git a/src/libs/modelinglib/qmt/stereotype/stereotypecontroller.h b/src/libs/modelinglib/qmt/stereotype/stereotypecontroller.h index 949f1027a5c..676f9a275a5 100644 --- a/src/libs/modelinglib/qmt/stereotype/stereotypecontroller.h +++ b/src/libs/modelinglib/qmt/stereotype/stereotypecontroller.h @@ -3,11 +3,10 @@ #pragma once -#include <QObject> - #include "stereotypeicon.h" #include <QMarginsF> +#include <QObject> namespace qmt { @@ -17,7 +16,6 @@ class Style; class QMT_EXPORT StereotypeController : public QObject { - Q_OBJECT class StereotypeControllerPrivate; public: diff --git a/src/libs/modelinglib/qmt/style/stylecontroller.h b/src/libs/modelinglib/qmt/style/stylecontroller.h index 6eeeb61ac7f..2627bb2caa2 100644 --- a/src/libs/modelinglib/qmt/style/stylecontroller.h +++ b/src/libs/modelinglib/qmt/style/stylecontroller.h @@ -3,11 +3,10 @@ #pragma once -#include <QObject> - #include "styleengine.h" #include "qmt/diagram/dobject.h" +#include <QObject> #include <QScopedPointer> namespace qmt { @@ -21,7 +20,6 @@ class DBoundary; class QMT_EXPORT StyleController : public QObject { - Q_OBJECT class Parameters; public: diff --git a/src/plugins/qtsupport/exampleslistmodel.h b/src/plugins/qtsupport/exampleslistmodel.h index f0465655b79..00b87068a84 100644 --- a/src/plugins/qtsupport/exampleslistmodel.h +++ b/src/plugins/qtsupport/exampleslistmodel.h @@ -85,7 +85,6 @@ private: class ExamplesViewController : public QObject { - Q_OBJECT public: explicit ExamplesViewController(ExampleSetModel *exampleSetModel, Core::SectionedGridView *view, From 6f4aa3ad2775977569e3ed77b99e4d0e0b1f7609 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 09:54:46 +0200 Subject: [PATCH 0325/1777] Conan: Delay settings initialization to first use In practice this could mean "never" in case the step is not used. Change-Id: I714f2adbe051b6b795d915d56a48900625d258b0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/conan/conanplugin.cpp | 2 -- src/plugins/conan/conansettings.cpp | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/plugins/conan/conanplugin.cpp b/src/plugins/conan/conanplugin.cpp index 13655b93b63..71c3b0c90e2 100644 --- a/src/plugins/conan/conanplugin.cpp +++ b/src/plugins/conan/conanplugin.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "conaninstallstep.h" -#include "conansettings.h" #include <extensionsystem/iplugin.h> @@ -16,7 +15,6 @@ class ConanPlugin final : public ExtensionSystem::IPlugin public: ConanPlugin() { - addManaged<ConanSettings>(); addManaged<ConanInstallStepFactory>(); } }; diff --git a/src/plugins/conan/conansettings.cpp b/src/plugins/conan/conansettings.cpp index db88a242be2..d3e5d9d09b0 100644 --- a/src/plugins/conan/conansettings.cpp +++ b/src/plugins/conan/conansettings.cpp @@ -9,14 +9,14 @@ using namespace Utils; namespace Conan::Internal { -static ConanSettings *theSettings; - -ConanSettings &settings() { return *theSettings; } +ConanSettings &settings() +{ + static ConanSettings theSettings; + return theSettings; +} ConanSettings::ConanSettings() { - theSettings = this; - setSettingsGroup("ConanSettings"); setAutoApply(false); From 9b2075e7eaa2d2c7c2f1742df62078745995e641 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 14 Jul 2023 09:58:59 +0200 Subject: [PATCH 0326/1777] Debugger: Remove gdboptionspage.cpp This file has been merged into the settings times ago. Change-Id: I0e7fe315790e7193790d3ff6bfe11e0a0fb02570 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/gdb/gdboptionspage.cpp | 99 --------------------- 1 file changed, 99 deletions(-) delete mode 100644 src/plugins/debugger/gdb/gdboptionspage.cpp diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp deleted file mode 100644 index 37008cabcd1..00000000000 --- a/src/plugins/debugger/gdb/gdboptionspage.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include <debugger/debuggeractions.h> -#include <debugger/debuggerconstants.h> -#include <debugger/debuggercore.h> -#include <debugger/debuggerinternalconstants.h> -#include <debugger/debuggertr.h> - -#include <coreplugin/dialogs/ioptionspage.h> - -#include <utils/layoutbuilder.h> - -using namespace Core; -using namespace Utils; - -namespace Debugger::Internal { - -///////////////////////////////////////////////////////////////////////// -// -// GdbOptionsPage - harmless options -// -///////////////////////////////////////////////////////////////////////// - -class GdbOptionsPage : public Core::IOptionsPage -{ -public: - GdbOptionsPage() - { - setId("M.Gdb"); - setDisplayName(Tr::tr("GDB")); - setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY); - setSettings(&debuggerSettings()->page2); - - setLayouter([] { - using namespace Layouting; - DebuggerSettings &s = *debuggerSettings(); - - auto labelDangerous = new QLabel("<html><head/><body><i>" + - Tr::tr("The options below give access to advanced<br>" - "or experimental functions of GDB.<p>" - "Enabling them may negatively impact<br>" - "your debugging experience.") + "</i></body></html>"); - - Group general { - title(Tr::tr("General")), - Column { - Row { s.gdbWatchdogTimeout, st }, - s.skipKnownFrames, - s.useMessageBoxForSignals, - s.adjustBreakpointLocations, - s.useDynamicType, - s.loadGdbInit, - s.loadGdbDumpers, - s.intelFlavor, - s.usePseudoTracepoints, - s.useIndexCache, - st - } - }; - - Group extended { - title(Tr::tr("Extended")), - Column { - labelDangerous, - s.targetAsync, - s.autoEnrichParameters, - s.breakOnWarning, - s.breakOnFatal, - s.breakOnAbort, - s.enableReverseDebugging, - s.multiInferior, - st - } - }; - - Group startup { - title(Tr::tr("Additional Startup Commands")), - Column { s.gdbStartupCommands } - }; - - Group attach { - title(Tr::tr("Additional Attach Commands")), - Column { s.gdbPostAttachCommands }, - }; - - return Grid { general, extended, br, startup, attach }; - }); - } -}; - -// Registration - -void addGdbOptionPages(QList<IOptionsPage *> *opts) -{ - opts->push_back(new GdbOptionsPage); -} - -} // Debugger::Internal From a5e773aeee40812cd4e8db88eda2521806ba40a4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 15:23:29 +0200 Subject: [PATCH 0327/1777] Debugger: Adapt to latest settings access style Change-Id: I14f737612b4fe6a37e650190b587ef0b04e559ea Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/debugger/breakhandler.cpp | 18 ++--- src/plugins/debugger/cdb/cdbengine.cpp | 58 ++++++------- src/plugins/debugger/cdb/cdboptionspage.cpp | 20 ++--- src/plugins/debugger/commonoptionspage.cpp | 4 +- src/plugins/debugger/debuggeractions.cpp | 20 ++--- src/plugins/debugger/debuggeractions.h | 2 +- src/plugins/debugger/debuggerengine.cpp | 36 ++++----- src/plugins/debugger/debuggerplugin.cpp | 31 ++++--- src/plugins/debugger/debuggerruncontrol.cpp | 6 +- .../debugger/debuggertooltipmanager.cpp | 2 +- src/plugins/debugger/disassembleragent.cpp | 7 +- src/plugins/debugger/gdb/gdbengine.cpp | 81 +++++++++---------- src/plugins/debugger/lldb/lldbengine.cpp | 31 ++++--- src/plugins/debugger/logwindow.cpp | 10 +-- src/plugins/debugger/moduleshandler.cpp | 2 +- src/plugins/debugger/pdb/pdbengine.cpp | 2 +- .../debugger/peripheralregisterhandler.cpp | 2 +- src/plugins/debugger/qml/qmlengine.cpp | 9 +-- .../debugger/qml/qmlinspectoragent.cpp | 19 +++-- src/plugins/debugger/registerhandler.cpp | 2 +- src/plugins/debugger/sourcefileshandler.cpp | 2 +- src/plugins/debugger/stackhandler.cpp | 24 +++--- src/plugins/debugger/threadshandler.cpp | 2 +- src/plugins/debugger/watchhandler.cpp | 21 +++-- src/plugins/debugger/watchwindow.cpp | 5 +- 25 files changed, 202 insertions(+), 214 deletions(-) diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 963aced456c..1c414367add 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -1101,10 +1101,10 @@ QVariant BreakpointItem::data(int column, int role) const break; } - if (role == Qt::ToolTipRole && debuggerSettings()->useToolTipsInBreakpointsView.value()) + if (role == Qt::ToolTipRole && settings().useToolTipsInBreakpointsView()) return toolTip(); - return QVariant(); + return {}; } void BreakpointItem::addToCommand(DebuggerCommand *cmd, BreakpointPathUsage defaultPathUsage) const @@ -1689,8 +1689,8 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev) menu->addSeparator(); - menu->addAction(debuggerSettings()->useToolTipsInBreakpointsView.action()); - menu->addAction(debuggerSettings()->settingsDialog.action()); + menu->addAction(settings().useToolTipsInBreakpointsView.action()); + menu->addAction(settings().settingsDialog.action()); connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater); menu->popup(ev.globalPos()); @@ -2219,10 +2219,10 @@ QVariant GlobalBreakpointItem::data(int column, int role) const break; } - if (role == Qt::ToolTipRole && debuggerSettings()->useToolTipsInBreakpointsView.value()) + if (role == Qt::ToolTipRole && settings().useToolTipsInBreakpointsView()) return toolTip(); - return QVariant(); + return {}; } QIcon GlobalBreakpointItem::icon() const @@ -2495,7 +2495,7 @@ void BreakpointManager::setOrRemoveBreakpoint(const ContextData &location, const BreakpointParameters data; if (location.type == LocationByFile) { data.type = BreakpointByFileAndLine; - if (debuggerSettings()->breakpointsFullPathByDefault.value()) + if (settings().breakpointsFullPathByDefault()) data.pathUsage = BreakpointUseFullPath; data.tracepoint = !tracePointMessage.isEmpty(); data.message = tracePointMessage; @@ -2686,8 +2686,8 @@ bool BreakpointManager::contextMenuEvent(const ItemViewEvent &ev) menu->addSeparator(); - menu->addAction(debuggerSettings()->useToolTipsInBreakpointsView.action()); - menu->addAction(debuggerSettings()->settingsDialog.action()); + menu->addAction(settings().useToolTipsInBreakpointsView.action()); + menu->addAction(settings().settingsDialog.action()); connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater); menu->popup(ev.globalPos()); diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index ccda790fe69..d89ea99fa4a 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -178,17 +178,17 @@ CdbEngine::CdbEngine() : wh->addTypeFormats("QImage", imageFormats); wh->addTypeFormats("QImage *", imageFormats); - DebuggerSettings *s = debuggerSettings(); - connect(s->createFullBacktrace.action(), &QAction::triggered, + DebuggerSettings &s = settings(); + connect(s.createFullBacktrace.action(), &QAction::triggered, this, &CdbEngine::createFullBacktrace); connect(&m_process, &Process::started, this, &CdbEngine::processStarted); connect(&m_process, &Process::done, this, &CdbEngine::processDone); m_process.setStdOutLineCallback([this](const QString &line) { parseOutputLine(line); }); m_process.setStdErrLineCallback([this](const QString &line) { parseOutputLine(line); }); - connect(&s->useDebuggingHelpers, &BaseAspect::changed, + connect(&s.useDebuggingHelpers, &BaseAspect::changed, this, &CdbEngine::updateLocals); - if (s->useCodeModel.value()) + if (s.useCodeModel()) m_codeModelSnapshot = CppEditor::CppModelManager::snapshot(); } @@ -225,7 +225,7 @@ void CdbEngine::init() } const SourcePathMap &sourcePathMap - = mergePlatformQtPath(runParameters(), debuggerSettings()->sourcePathMap.value()); + = mergePlatformQtPath(runParameters(), settings().sourcePathMap()); if (!sourcePathMap.isEmpty()) { for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd(); it != cend; ++it) { m_sourcePathMappings.push_back({QDir::toNativeSeparators(it.key()), @@ -364,8 +364,8 @@ void CdbEngine::setupEngine() if (sp.useTerminal) // Separate console debugger.addArg("-2"); - const DebuggerSettings &s = *debuggerSettings(); - if (s.ignoreFirstChanceAccessViolation.value()) + const DebuggerSettings &s = settings(); + if (s.ignoreFirstChanceAccessViolation()) debugger.addArg("-x"); const QStringList &sourcePaths = s.cdbSourcePaths.value(); @@ -472,8 +472,8 @@ void CdbEngine::handleInitialSessionIdle() // Take ownership of the breakpoint. Requests insertion. TODO: Cpp only? BreakpointManager::claimBreakpointsForEngine(this); - const DebuggerSettings &s = *debuggerSettings(); - QStringList symbolPaths = s.cdbSymbolPaths.value(); + const DebuggerSettings &s = settings(); + QStringList symbolPaths = s.cdbSymbolPaths(); QString symbolPath = rp.inferior.environment.expandedValueForKey("_NT_ALT_SYMBOL_PATH"); if (!symbolPath.isEmpty()) symbolPaths += symbolPath; @@ -493,7 +493,7 @@ void CdbEngine::handleInitialSessionIdle() + " secondChance=" + (s.secondChanceExceptionTaskEntry() ? "1" : "0") , NoFlags}); - if (s.cdbUsePythonDumper.value()) + if (s.cdbUsePythonDumper()) runCommand({"print(sys.version)", ScriptCommand, CB(setupScripting)}); runCommand({"pid", ExtensionCommand, [this](const DebuggerResponse &response) { @@ -551,13 +551,13 @@ void CdbEngine::runEngine() if (debug) qDebug("runEngine"); - const QStringList breakEvents = debuggerSettings()->cdbBreakEvents.value(); + const QStringList breakEvents = settings().cdbBreakEvents(); for (const QString &breakEvent : breakEvents) runCommand({"sxe " + breakEvent, NoFlags}); // Break functions: each function must be fully qualified, // else the debugger will slow down considerably. const auto cb = [this](const DebuggerResponse &r) { handleBreakInsert(r, Breakpoint()); }; - if (debuggerSettings()->cdbBreakOnCrtDbgReport.value()) { + if (settings().cdbBreakOnCrtDbgReport()) { Abi::OSFlavor flavor = runParameters().toolChainAbi.osFlavor(); // CrtDebugReport cannot be safely resolved for vc 19 if ((flavor > Abi::WindowsMsvc2005Flavor && flavor <= Abi::WindowsMsvc2013Flavor) || @@ -570,11 +570,11 @@ void CdbEngine::runEngine() runCommand({breakAtFunctionCommand(Constants::CRT_DEBUG_REPORT, debugModule), BuiltinCommand, cb}); } } -// if (debuggerSettings()->breakOnWarning.value())) { +// if (settings().breakOnWarning())) { // runCommand({"bm /( QtCored4!qWarning", BuiltinCommand}); // 'bm': All overloads. // runCommand({"bm /( Qt5Cored!QMessageLogger::warning", BuiltinCommand}); // } -// if (debuggerSettion()->breakOnFatal.value()) { +// if (settings().breakOnFatal()) { // runCommand({"bm /( QtCored4!qFatal", BuiltinCommand}); // 'bm': All overloads. // runCommand({"bm /( Qt5Cored!QMessageLogger::fatal", BuiltinCommand}); // } @@ -1058,7 +1058,7 @@ void CdbEngine::activateFrame(int index) void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters) { - const DebuggerSettings &s = *debuggerSettings(); + const DebuggerSettings &s = settings(); if (m_pythonVersion > 0x030000) { watchHandler()->notifyUpdateStarted(updateParameters); @@ -1068,21 +1068,21 @@ void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters) const bool alwaysVerbose = qtcEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE"); cmd.arg("passexceptions", alwaysVerbose); - cmd.arg("fancy", s.useDebuggingHelpers.value()); - cmd.arg("autoderef", s.autoDerefPointers.value()); - cmd.arg("dyntype", s.useDynamicType.value()); + cmd.arg("fancy", s.useDebuggingHelpers()); + cmd.arg("autoderef", s.autoDerefPointers()); + cmd.arg("dyntype", s.useDynamicType()); cmd.arg("partialvar", updateParameters.partialVariable); - cmd.arg("qobjectnames", s.showQObjectNames.value()); - cmd.arg("timestamps", s.logTimeStamps.value()); + cmd.arg("qobjectnames", s.showQObjectNames()); + cmd.arg("timestamps", s.logTimeStamps()); StackFrame frame = stackHandler()->currentFrame(); cmd.arg("context", frame.context); cmd.arg("nativemixed", isNativeMixedActive()); - cmd.arg("stringcutoff", s.maximalStringLength.value()); - cmd.arg("displaystringlimit", s.displayStringLimit.value()); + cmd.arg("stringcutoff", s.maximalStringLength()); + cmd.arg("displaystringlimit", s.displayStringLimit()); - if (s.useCodeModel.value()) { + if (s.useCodeModel()) { QStringList variables = getUninitializedVariables(m_codeModelSnapshot, frame.function, frame.file, frame.line); cmd.arg("uninitialized", variables); @@ -1141,9 +1141,9 @@ void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters) } } str << blankSeparator << "-v"; - if (s.useDebuggingHelpers.value()) + if (s.useDebuggingHelpers()) str << blankSeparator << "-c"; - if (s.sortStructMembers.value()) + if (s.sortStructMembers()) str << blankSeparator << "-a"; const QString typeFormats = watchHandler()->typeFormatRequests(); if (!typeFormats.isEmpty()) @@ -1153,7 +1153,7 @@ void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters) str << blankSeparator << "-I " << individualFormats; // Uninitialized variables if desired. Quote as safeguard against shadowed // variables in case of errors in uninitializedVariables(). - if (s.useCodeModel.value()) { + if (s.useCodeModel()) { const QStringList variables = getUninitializedVariables(m_codeModelSnapshot, frame.function, frame.file, frame.line); if (!variables.isEmpty()) { @@ -2503,7 +2503,7 @@ void CdbEngine::insertBreakpoint(const Breakpoint &bp) new BreakpointCorrectionContext(m_codeModelSnapshot, CppEditor::CppModelManager::workingCopy())); if (!m_autoBreakPointCorrection && parameters.type == BreakpointByFileAndLine - && debuggerSettings()->cdbBreakPointCorrection.value()) { + && settings().cdbBreakPointCorrection()) { response.textPosition.line = int(lineCorrection->fixLineNumber(parameters.fileName, unsigned(parameters.textPosition.line))); @@ -2825,13 +2825,13 @@ void CdbEngine::setupScripting(const DebuggerResponse &response) runCommand({"theDumper = Dumper()", ScriptCommand}); } - const FilePath path = debuggerSettings()->extraDumperFile(); + const FilePath path = settings().extraDumperFile(); if (!path.isEmpty() && path.isReadableFile()) { DebuggerCommand cmd("theDumper.addDumperModule", ScriptCommand); cmd.arg("path", path.path()); runCommand(cmd); } - const QString commands = debuggerSettings()->extraDumperCommands.value(); + const QString commands = settings().extraDumperCommands(); if (!commands.isEmpty()) { for (const auto &command : commands.split('\n', Qt::SkipEmptyParts)) runCommand({command, ScriptCommand}); diff --git a/src/plugins/debugger/cdb/cdboptionspage.cpp b/src/plugins/debugger/cdb/cdboptionspage.cpp index f47e275fd15..3aad91cd7ef 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.cpp +++ b/src/plugins/debugger/cdb/cdboptionspage.cpp @@ -159,7 +159,7 @@ private: void apply() final; void finish() final; - Utils::AspectContainer &m_group = debuggerSettings()->page5; + Utils::AspectContainer &m_group = settings().page5; CdbBreakEventWidget *m_breakEventWidget; }; @@ -167,9 +167,9 @@ CdbOptionsPageWidget::CdbOptionsPageWidget() : m_breakEventWidget(new CdbBreakEventWidget) { using namespace Layouting; - DebuggerSettings &s = *debuggerSettings(); + DebuggerSettings &s = settings(); - m_breakEventWidget->setBreakEvents(debuggerSettings()->cdbBreakEvents.value()); + m_breakEventWidget->setBreakEvents(settings().cdbBreakEvents.value()); Column { Row { @@ -215,12 +215,12 @@ void CdbOptionsPageWidget::apply() { m_group.apply(); m_group.writeSettings(); - debuggerSettings()->cdbBreakEvents.setValue(m_breakEventWidget->breakEvents()); + settings().cdbBreakEvents.setValue(m_breakEventWidget->breakEvents()); } void CdbOptionsPageWidget::finish() { - m_breakEventWidget->setBreakEvents(debuggerSettings()->cdbBreakEvents.value()); + m_breakEventWidget->setBreakEvents(settings().cdbBreakEvents.value()); m_group.finish(); } @@ -243,7 +243,7 @@ public: void apply() final; void finish() final; - AspectContainer &m_group = debuggerSettings()->page6; + AspectContainer &m_group = settings().page6; private: PathListEditor *m_symbolPaths = nullptr; @@ -266,15 +266,15 @@ CdbPathsPageWidget::CdbPathsPageWidget() void CdbPathsPageWidget::apply() { - debuggerSettings()->cdbSymbolPaths.setValue(m_symbolPaths->pathList()); - debuggerSettings()->cdbSourcePaths.setValue(m_sourcePaths->pathList()); + settings().cdbSymbolPaths.setValue(m_symbolPaths->pathList()); + settings().cdbSourcePaths.setValue(m_sourcePaths->pathList()); m_group.writeSettings(); } void CdbPathsPageWidget::finish() { - m_symbolPaths->setPathList(debuggerSettings()->cdbSymbolPaths.value()); - m_sourcePaths->setPathList(debuggerSettings()->cdbSourcePaths.value()); + m_symbolPaths->setPathList(settings().cdbSymbolPaths()); + m_sourcePaths->setPathList(settings().cdbSourcePaths()); } CdbPathsPage::CdbPathsPage() diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 7dd6950f0f9..8d0dda445f5 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -26,7 +26,7 @@ class CommonOptionsPageWidget : public Core::IOptionsPageWidget public: explicit CommonOptionsPageWidget() { - DebuggerSettings &s = *debuggerSettings(); + DebuggerSettings &s = settings(); setOnApply([&s] { const bool originalPostMortem = s.registerForPostMortem->value(); @@ -113,7 +113,7 @@ class LocalsAndExpressionsOptionsPageWidget : public IOptionsPageWidget public: LocalsAndExpressionsOptionsPageWidget() { - DebuggerSettings &s = *debuggerSettings(); + DebuggerSettings &s = settings(); setOnApply([&s] { s.page4.apply(); s.page4.writeSettings(); }); setOnFinish([&s] { s.page4.finish(); }); diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 63c2268734d..bf1b8f76f30 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -33,18 +33,14 @@ const char cdbSettingsGroupC[] = "CDB2"; // ////////////////////////////////////////////////////////////////////////// -static DebuggerSettings *theDebuggerSettings_ = nullptr; - -DebuggerSettings *debuggerSettings() +DebuggerSettings &settings() { - QTC_CHECK(theDebuggerSettings_); - return theDebuggerSettings_; + static DebuggerSettings settings; + return settings; } DebuggerSettings::DebuggerSettings() { - theDebuggerSettings_ = this; - const QString debugModeGroup(debugModeSettingsGroupC); const QString cdbSettingsGroup(cdbSettingsGroupC); @@ -482,8 +478,8 @@ void DebuggerSettings::writeSettings() const QString DebuggerSettings::dump() { - QStringList settings; - debuggerSettings()->all.forEachAspect([&settings](BaseAspect *aspect) { + QStringList msg; + settings().all.forEachAspect([&msg](BaseAspect *aspect) { QString key = aspect->settingsKey(); if (!key.isEmpty()) { const int pos = key.indexOf('/'); @@ -494,11 +490,11 @@ QString DebuggerSettings::dump() QString setting = key + ": " + current + " (default: " + default_ + ')'; if (current != default_) setting += " ***"; - settings << setting; + msg << setting; } }); - settings.sort(); - return "Debugger settings:\n" + settings.join('\n'); + msg.sort(); + return "Debugger settings:\n" + msg.join('\n'); } } // Debugger::Internal diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index e59b6356f1c..bfa76454777 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -148,7 +148,7 @@ private: DebuggerSettings &operator=(const DebuggerSettings &) = delete; }; -DebuggerSettings *debuggerSettings(); +DebuggerSettings &settings(); } // Debugger::Internal diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 0c80b0cf9f0..729f8082c06 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -265,7 +265,7 @@ public: m_logWindow = new LogWindow(m_engine); // Needed before start() m_logWindow->setObjectName("Debugger.Dock.Output"); - connect(&debuggerSettings()->enableReverseDebugging, &BaseAspect::changed, this, [this] { + connect(&settings().enableReverseDebugging, &BaseAspect::changed, this, [this] { updateState(); if (m_companionEngine) m_companionEngine->d->updateState(); @@ -406,7 +406,7 @@ public: m_watchHandler.cleanup(); m_engine->showMessage(Tr::tr("Debugger finished."), StatusBar); m_engine->setState(DebuggerFinished); // Also destroys views. - if (debuggerSettings()->switchModeOnExit.value()) + if (settings().switchModeOnExit()) EngineManager::deactivateDebugMode(); } @@ -805,10 +805,10 @@ void DebuggerEnginePrivate::setupViews() m_perspective->addToolBarWidget(m_threadsHandler.threadSwitcher()); connect(TextEditorSettings::instance(), &TextEditorSettings::fontSettingsChanged, - this, [this](const FontSettings &settings) { - if (!debuggerSettings()->fontSizeFollowsEditor.value()) + this, [this](const FontSettings &fs) { + if (!Internal::settings().fontSizeFollowsEditor()) return; - const qreal size = settings.fontZoom() * settings.fontSize() / 100.; + const qreal size = fs.fontZoom() * fs.fontSize() / 100.; QFont font = m_breakWindow->font(); font.setPointSizeF(size); m_breakWindow->setFont(font); @@ -1085,7 +1085,7 @@ void DebuggerEngine::gotoLocation(const Location &loc) &newEditor); QTC_ASSERT(editor, return); // Unreadable file? - editor->gotoLine(line, 0, !debuggerSettings()->stationaryEditorWhileStepping.value()); + editor->gotoLine(line, 0, !settings().stationaryEditorWhileStepping()); if (newEditor) editor->document()->setProperty(Constants::OPENED_BY_DEBUGGER, true); @@ -1348,7 +1348,7 @@ void DebuggerEngine::notifyInferiorSpontaneousStop() d->m_perspective->select(); showMessage(Tr::tr("Stopped."), StatusBar); setState(InferiorStopOk); - if (debuggerSettings()->raiseOnInterrupt.value()) + if (settings().raiseOnInterrupt()) ICore::raiseWindow(DebuggerMainWindow::instance()); } @@ -1408,8 +1408,8 @@ void DebuggerEnginePrivate::setInitialActionStates() m_jumpToLineAction.setVisible(false); m_stepOverAction.setEnabled(true); - debuggerSettings()->autoDerefPointers.setEnabled(true); - debuggerSettings()->expandStack.setEnabled(false); + settings().autoDerefPointers.setEnabled(true); + settings().expandStack.setEnabled(false); if (m_threadLabel) m_threadLabel->setEnabled(false); @@ -1549,9 +1549,9 @@ void DebuggerEnginePrivate::updateState() const bool actionsEnabled = m_engine->debuggerActionsEnabled(); const bool canDeref = actionsEnabled && m_engine->hasCapability(AutoDerefPointersCapability); - debuggerSettings()->autoDerefPointers.setEnabled(canDeref); - debuggerSettings()->autoDerefPointers.setEnabled(true); - debuggerSettings()->expandStack.setEnabled(actionsEnabled); + settings().autoDerefPointers.setEnabled(canDeref); + settings().autoDerefPointers.setEnabled(true); + settings().expandStack.setEnabled(actionsEnabled); const bool notbusy = state == InferiorStopOk || state == DebuggerNotReady @@ -1563,7 +1563,7 @@ void DebuggerEnginePrivate::updateState() void DebuggerEnginePrivate::updateReverseActions() { const bool stopped = m_state == InferiorStopOk; - const bool reverseEnabled = debuggerSettings()->enableReverseDebugging.value(); + const bool reverseEnabled = settings().enableReverseDebugging(); const bool canReverse = reverseEnabled && m_engine->hasCapability(ReverseSteppingCapability); const bool doesRecord = m_recordForReverseOperationAction.isChecked(); @@ -1581,8 +1581,8 @@ void DebuggerEnginePrivate::updateReverseActions() void DebuggerEnginePrivate::cleanupViews() { - const bool closeSource = debuggerSettings()->closeSourceBuffersOnExit.value(); - const bool closeMemory = debuggerSettings()->closeMemoryBuffersOnExit.value(); + const bool closeSource = settings().closeSourceBuffersOnExit(); + const bool closeMemory = settings().closeMemoryBuffersOnExit(); QList<IDocument *> toClose; const QList<IDocument *> documents = DocumentModel::openedDocuments(); @@ -1869,7 +1869,7 @@ QString DebuggerEngine::expand(const QString &string) const QString DebuggerEngine::nativeStartupCommands() const { - QStringList lines = debuggerSettings()->gdbStartupCommands.value().split('\n'); + QStringList lines = settings().gdbStartupCommands().split('\n'); lines += runParameters().additionalStartupCommands.split('\n'); lines = Utils::filtered(lines, [](const QString line) { @@ -2717,7 +2717,7 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp) { static const QString warnOnInappropriateDebuggerKey = "DebuggerWarnOnInappropriateDebugger"; - const bool warnOnRelease = debuggerSettings()->warnOnReleaseBuilds.value() + const bool warnOnRelease = settings().warnOnReleaseBuilds() && rp.toolChainAbi.osFlavor() != Abi::AndroidLinuxFlavor; bool warnOnInappropriateDebugger = false; QString detailedWarning; @@ -2818,7 +2818,7 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp) bool hasEmbeddedInfo = elfData.indexOf(".debug_info") >= 0; bool hasLink = elfData.indexOf(".gnu_debuglink") >= 0; if (hasEmbeddedInfo) { - const SourcePathMap sourcePathMap = debuggerSettings()->sourcePathMap.value(); + const SourcePathMap sourcePathMap = settings().sourcePathMap(); QList<QPair<QRegularExpression, QString>> globalRegExpSourceMap; globalRegExpSourceMap.reserve(sourcePathMap.size()); for (auto it = sourcePathMap.begin(), end = sourcePathMap.end(); it != end; ++it) { diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 9e1217307f9..152f928fb1e 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -585,7 +585,7 @@ public: void writeSettings() { - m_debuggerSettings.writeSettings(); + settings().writeSettings(); // writeWindowSettings(); } @@ -684,7 +684,6 @@ public: QTimer m_shutdownTimer; Console m_console; // ensure Debugger Console is created before settings are taken into account - DebuggerSettings m_debuggerSettings; QStringList m_arguments; DebuggerItemManager m_debuggerItemManager; @@ -771,7 +770,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) Tr::tr("Debugger Runtime"), Tr::tr("Issues with starting the debugger.")}); - m_debuggerSettings.readSettings(); + settings().readSettings(); const auto addLabel = [](QWidget *widget, const QString &text) { auto vbox = qobject_cast<QVBoxLayout *>(widget->layout()); @@ -784,10 +783,10 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) const auto addFontSizeAdaptation = [this](QWidget *widget) { QObject::connect(TextEditorSettings::instance(), &TextEditorSettings::fontSettingsChanged, - this, [widget](const FontSettings &settings) { - if (!debuggerSettings()->fontSizeFollowsEditor.value()) + this, [widget](const FontSettings &fs) { + if (!settings().fontSizeFollowsEditor()) return; - qreal size = settings.fontZoom() * settings.fontSize() / 100.; + qreal size = fs.fontZoom() * fs.fontSize() / 100.; QFont font = widget->font(); font.setPointSizeF(size); widget->setFont(font); @@ -1173,7 +1172,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) // Application interaction // Use a queued connection so the dialog isn't triggered in the same event. - connect(debuggerSettings()->settingsDialog.action(), &QAction::triggered, this, + connect(settings().settingsDialog.action(), &QAction::triggered, this, [] { ICore::showOptionsDialog(DEBUGGER_COMMON_SETTINGS_ID); }, Qt::QueuedConnection); m_perspective.useSubPerspectiveSwitcher(EngineManager::engineChooser()); @@ -1475,10 +1474,10 @@ void DebuggerPluginPrivate::updatePresetState() // FIXME: Decentralize the actions below const bool actionsEnabled = currentEngine->debuggerActionsEnabled(); const bool canDeref = actionsEnabled && currentEngine->hasCapability(AutoDerefPointersCapability); - DebuggerSettings *s = debuggerSettings(); - s->autoDerefPointers.setEnabled(canDeref); - s->autoDerefPointers.setEnabled(true); - s->expandStack.setEnabled(actionsEnabled); + DebuggerSettings &s = settings(); + s.autoDerefPointers.setEnabled(canDeref); + s.autoDerefPointers.setEnabled(true); + s.expandStack.setEnabled(actionsEnabled); m_startAndDebugApplicationAction.setEnabled(true); m_attachToQmlPortAction.setEnabled(true); @@ -1973,8 +1972,8 @@ void DebuggerPluginPrivate::setInitialState() m_enableOrDisableBreakpointAction.setEnabled(false); //m_snapshotAction.setEnabled(false); - debuggerSettings()->autoDerefPointers.setEnabled(true); - debuggerSettings()->expandStack.setEnabled(false); + settings().autoDerefPointers.setEnabled(true); + settings().expandStack.setEnabled(false); } void DebuggerPluginPrivate::updateDebugWithoutDeployMenu() @@ -2069,11 +2068,11 @@ void DebuggerPluginPrivate::extensionsInitialized() QWidget *DebuggerPluginPrivate::addSearch(BaseTreeView *treeView) { - BoolAspect &act = debuggerSettings()->useAlternatingRowColors; - treeView->setAlternatingRowColors(act.value()); + BoolAspect &act = settings().useAlternatingRowColors; + treeView->setAlternatingRowColors(act()); treeView->setProperty(PerspectiveState::savesHeaderKey(), true); connect(&act, &BaseAspect::changed, treeView, [treeView] { - treeView->setAlternatingRowColors(debuggerSettings()->useAlternatingRowColors.value()); + treeView->setAlternatingRowColors(settings().useAlternatingRowColors()); }); return ItemViewFind::createSearchableWrapper(treeView); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 95eb60c83c1..85ad01d76df 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -293,7 +293,7 @@ void DebuggerRunTool::setUseTerminal(bool on) bool useCdbConsole = m_runParameters.cppEngineType == CdbEngineType && (m_runParameters.startMode == StartInternal || m_runParameters.startMode == StartExternal) - && debuggerSettings()->useCdbConsole.value(); + && settings().useCdbConsole(); if (on && !d->terminalRunner && !useCdbConsole) { d->terminalRunner = @@ -759,7 +759,7 @@ bool DebuggerRunTool::fixupParameters() } } - if (!debuggerSettings()->autoEnrichParameters.value()) { + if (settings().autoEnrichParameters()) { const FilePath sysroot = rp.sysRoot; if (rp.debugInfoLocation.isEmpty()) rp.debugInfoLocation = sysroot / "/usr/lib/debug"; @@ -816,7 +816,7 @@ bool DebuggerRunTool::fixupParameters() if (rp.isNativeMixedDebugging()) rp.inferior.environment.set("QV4_FORCE_INTERPRETER", "1"); - if (debuggerSettings()->forceLoggingToConsole.value()) + if (settings().forceLoggingToConsole()) rp.inferior.environment.set("QT_LOGGING_TO_CONSOLE", "1"); return true; diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index 90b5f4edb15..d51dcd9bcba 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -1151,7 +1151,7 @@ void DebuggerToolTipManagerPrivate::slotTooltipOverrideRequested QTC_ASSERT(handled, return); QTC_ASSERT(editorWidget, return); - if (!debuggerSettings()->useToolTipsInMainEditor.value()) + if (!settings().useToolTipsInMainEditor()) return; const TextDocument *document = editorWidget->textDocument(); diff --git a/src/plugins/debugger/disassembleragent.cpp b/src/plugins/debugger/disassembleragent.cpp index d4e3caa6f1b..b393fe44da2 100644 --- a/src/plugins/debugger/disassembleragent.cpp +++ b/src/plugins/debugger/disassembleragent.cpp @@ -29,6 +29,7 @@ using namespace Core; using namespace TextEditor; +using namespace Utils; namespace Debugger::Internal { @@ -43,9 +44,7 @@ class DisassemblerBreakpointMarker : public TextMark { public: DisassemblerBreakpointMarker(const Breakpoint &bp, int lineNumber) - : TextMark(Utils::FilePath(), - lineNumber, - {Tr::tr("Breakpoint"), Constants::TEXT_MARK_CATEGORY_BREAKPOINT}) + : TextMark({}, lineNumber, {Tr::tr("Breakpoint"), Constants::TEXT_MARK_CATEGORY_BREAKPOINT}) , m_bp(bp) { setIcon(bp->icon()); @@ -161,7 +160,7 @@ int DisassemblerAgentPrivate::lineForAddress(quint64 address) const DisassemblerAgent::DisassemblerAgent(DebuggerEngine *engine) : d(new DisassemblerAgentPrivate(engine)) { - connect(&debuggerSettings()->intelFlavor, &Utils::BaseAspect::changed, + connect(&settings().intelFlavor, &Utils::BaseAspect::changed, this, &DisassemblerAgent::reload); } diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 910372f1937..6e4f6384366 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -136,7 +136,7 @@ GdbEngine::GdbEngine() connect(&m_commandTimer, &QTimer::timeout, this, &GdbEngine::commandTimeout); - DebuggerSettings &s = *debuggerSettings(); + DebuggerSettings &s = settings(); connect(&s.autoDerefPointers, &BaseAspect::changed, this, &GdbEngine::reloadLocals); connect(s.createFullBacktrace.action(), &QAction::triggered, @@ -417,7 +417,7 @@ void GdbEngine::handleResponse(const QString &buff) } } - if (debuggerSettings()->logTimeStamps.value()) + if (settings().logTimeStamps()) showMessage(QString("Output handled")); } @@ -801,7 +801,7 @@ void GdbEngine::runCommand(const DebuggerCommand &command) int GdbEngine::commandTimeoutTime() const { - const int time = debuggerSettings()->gdbWatchdogTimeout(); + const int time = settings().gdbWatchdogTimeout(); return 1000 * qMax(20, time); } @@ -942,7 +942,7 @@ void GdbEngine::handleResultRecord(DebuggerResponse *response) DebuggerCommand cmd = m_commandForToken.take(token); const int flags = m_flagsForToken.take(token); - if (debuggerSettings()->logTimeStamps.value()) { + if (settings().logTimeStamps()) { showMessage(QString("Response time: %1: %2 s") .arg(cmd.function) .arg(QTime::fromMSecsSinceStartOfDay(cmd.postTime).msecsTo(QTime::currentTime()) / 1000.), @@ -1016,7 +1016,7 @@ void GdbEngine::updateAll() { //PENDING_DEBUG("UPDATING ALL\n"); QTC_CHECK(state() == InferiorUnrunnable || state() == InferiorStopOk); - DebuggerCommand cmd(stackCommand(debuggerSettings()->maximalStackDepth())); + DebuggerCommand cmd(stackCommand(settings().maximalStackDepth())); cmd.callback = [this](const DebuggerResponse &r) { handleStackListFrames(r, false); }; runCommand(cmd); stackHandler()->setCurrentIndex(0); @@ -1124,7 +1124,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data) // Jump over well-known frames. //static int stepCounter = 0; - if (debuggerSettings()->skipKnownFrames.value()) { + if (settings().skipKnownFrames()) { if (reason == "end-stepping-range" || reason == "function-finished") { //showMessage(frame.toString()); QString funcName = frame["function"].data(); @@ -1310,7 +1310,7 @@ void GdbEngine::handleStop1(const GdbMi &data) if (!m_systemDumpersLoaded) { m_systemDumpersLoaded = true; - if (m_gdbVersion >= 70400 && debuggerSettings()->loadGdbDumpers.value()) + if (m_gdbVersion >= 70400 && settings().loadGdbDumpers()) runCommand({"importPlainDumpers on"}); else runCommand({"importPlainDumpers off"}); @@ -1427,7 +1427,7 @@ void GdbEngine::handleStop2(const GdbMi &data) m_expectTerminalTrap = false; } else { showMessage("HANDLING SIGNAL " + name); - if (debuggerSettings()->useMessageBoxForSignals.value() && !isStopperThread) + if (settings().useMessageBoxForSignals() && !isStopperThread) if (!showStoppedBySignalMessageBox(meaning, name)) { showMessage("SIGNAL RECEIVED WHILE SHOWING SIGNAL MESSAGE"); return; @@ -1586,7 +1586,7 @@ FilePath GdbEngine::cleanupFullName(const QString &fileName) return {}; } - if (!debuggerSettings()->autoEnrichParameters.value()) + if (!settings().autoEnrichParameters()) return cleanFilePath; if (cleanFilePath.isReadableFile()) @@ -2042,7 +2042,7 @@ void GdbEngine::setTokenBarrier() QTC_ASSERT(good, return); PENDING_DEBUG("\n--- token barrier ---\n"); showMessage("--- token barrier ---", LogMiscInput); - if (debuggerSettings()->logTimeStamps.value()) + if (settings().logTimeStamps()) showMessage(LogWindow::logTimeStamp(), LogMiscInput); m_oldestAcceptableToken = currentToken(); m_stackNeeded = false; @@ -2164,7 +2164,7 @@ void GdbEngine::handleCatchInsert(const DebuggerResponse &response, const Breakp void GdbEngine::handleBkpt(const GdbMi &bkpt, const Breakpoint &bp) { QTC_ASSERT(bp, return); - const bool usePseudoTracepoints = debuggerSettings()->usePseudoTracepoints.value(); + const bool usePseudoTracepoints = settings().usePseudoTracepoints(); const QString nr = bkpt["number"].data(); if (nr.contains('.')) { // A sub-breakpoint. @@ -2579,7 +2579,7 @@ void GdbEngine::insertBreakpoint(const Breakpoint &bp) int spec = requested.threadSpec; if (requested.isTracepoint()) { - if (debuggerSettings()->usePseudoTracepoints.value()) { + if (settings().usePseudoTracepoints()) { cmd.function = "createTracepoint"; if (requested.oneShot) @@ -2615,7 +2615,7 @@ void GdbEngine::insertBreakpoint(const Breakpoint &bp) // for dumping of expressions const bool alwaysVerbose = qtcEnvironmentVariableIsSet( "QTC_DEBUGGER_PYTHON_VERBOSE"); - const DebuggerSettings &s = *debuggerSettings(); + const DebuggerSettings &s = settings(); cmd.arg("passexceptions", alwaysVerbose); cmd.arg("fancy", s.useDebuggingHelpers()); cmd.arg("autoderef", s.autoDerefPointers()); @@ -3116,7 +3116,7 @@ DebuggerCommand GdbEngine::stackCommand(int depth) void GdbEngine::reloadStack() { PENDING_DEBUG("RELOAD STACK"); - DebuggerCommand cmd = stackCommand(debuggerSettings()->maximalStackDepth.value()); + DebuggerCommand cmd = stackCommand(settings().maximalStackDepth()); cmd.callback = [this](const DebuggerResponse &r) { handleStackListFrames(r, false); }; cmd.flags = Discardable; runCommand(cmd); @@ -3180,8 +3180,8 @@ void GdbEngine::handleThreadInfo(const DebuggerResponse &response) ThreadsHandler *handler = threadsHandler(); handler->setThreads(response.data); updateState(); // Adjust Threads combobox. - if (debuggerSettings()->showThreadNames.value()) { - runCommand({QString("threadnames %1").arg(debuggerSettings()->maximalStackDepth.value()), + if (settings().showThreadNames()) { + runCommand({QString("threadnames %1").arg(settings().maximalStackDepth()), Discardable, CB(handleThreadNames)}); } reloadStack(); // Will trigger register reload. @@ -3649,7 +3649,7 @@ public: void GdbEngine::fetchDisassembler(DisassemblerAgent *agent) { - if (debuggerSettings()->intelFlavor.value()) + if (settings().intelFlavor()) runCommand({"set disassembly-flavor intel"}); else runCommand({"set disassembly-flavor att"}); @@ -3838,7 +3838,7 @@ void GdbEngine::setupEngine() } gdbCommand.addArgs({"-i", "mi"}); - if (!debuggerSettings()->loadGdbInit.value()) + if (!settings().loadGdbInit()) gdbCommand.addArg("-n"); // This is filled in DebuggerKitAspect::runnable @@ -3884,7 +3884,7 @@ void GdbEngine::handleGdbStarted() runCommand({"set breakpoint pending on"}); runCommand({"set print elements 10000"}); - if (debuggerSettings()->useIndexCache.value()) + if (settings().useIndexCache()) runCommand({"set index-cache on"}); // Produces a few messages during symtab loading @@ -3929,8 +3929,7 @@ void GdbEngine::handleGdbStarted() // Apply source path mappings from global options. //showMessage(_("Assuming Qt is installed at %1").arg(qtInstallPath)); - const SourcePathMap sourcePathMap = - mergePlatformQtPath(rp, debuggerSettings()->sourcePathMap.value()); + const SourcePathMap sourcePathMap = mergePlatformQtPath(rp, settings().sourcePathMap()); const SourcePathMap completeSourcePathMap = mergeStartParametersSourcePathMap(rp, sourcePathMap); for (auto it = completeSourcePathMap.constBegin(), cend = completeSourcePathMap.constEnd(); @@ -3958,7 +3957,7 @@ void GdbEngine::handleGdbStarted() //if (!ba.isEmpty()) // runCommand("set solib-search-path " + ba); - if (debuggerSettings()->multiInferior.value() || runParameters().multiProcess) { + if (settings().multiInferior() || runParameters().multiProcess) { //runCommand("set follow-exec-mode new"); runCommand({"set detach-on-fork off"}); } @@ -4028,14 +4027,14 @@ void GdbEngine::handleGdbStarted() runCommand({"python from gdbbridge import *"}); } - const FilePath path = debuggerSettings()->extraDumperFile(); + const FilePath path = settings().extraDumperFile(); if (!path.isEmpty() && path.isReadableFile()) { DebuggerCommand cmd("addDumperModule"); cmd.arg("path", path.path()); runCommand(cmd); } - const QString commands = expand(debuggerSettings()->extraDumperCommands.value()); + const QString commands = expand(settings().extraDumperCommands()); if (!commands.isEmpty()) runCommand({commands}); @@ -4252,7 +4251,7 @@ bool GdbEngine::usesExecInterrupt() const bool GdbEngine::usesTargetAsync() const { - return runParameters().useTargetAsync || debuggerSettings()->targetAsync.value(); + return runParameters().useTargetAsync || settings().targetAsync(); } void GdbEngine::scheduleTestResponse(int testCase, const QString &response) @@ -4371,10 +4370,10 @@ void GdbEngine::claimInitialBreakpoints() showMessage(Tr::tr("Setting breakpoints...")); BreakpointManager::claimBreakpointsForEngine(this); - const DebuggerSettings &s = *debuggerSettings(); - const bool onAbort = s.breakOnAbort.value(); - const bool onWarning = s.breakOnWarning.value(); - const bool onFatal = s.breakOnFatal.value(); + const DebuggerSettings &s = settings(); + const bool onAbort = s.breakOnAbort(); + const bool onWarning = s.breakOnWarning(); + const bool onFatal = s.breakOnFatal(); if (onAbort || onWarning || onFatal) { DebuggerCommand cmd("createSpecialBreakpoints"); cmd.arg("breakonabort", onAbort); @@ -4612,7 +4611,7 @@ void GdbEngine::handleLocalAttach(const DebuggerResponse &response) { showMessage("INFERIOR ATTACHED"); - QString commands = expand(debuggerSettings()->gdbPostAttachCommands.value()); + QString commands = expand(settings().gdbPostAttachCommands()); if (!commands.isEmpty()) runCommand({commands, NativeCommand}); @@ -4792,7 +4791,7 @@ void GdbEngine::handleExecRun(const DebuggerResponse &response) if (response.resultClass == ResultRunning) { if (isLocalRunEngine()) { - QString commands = expand(debuggerSettings()->gdbPostAttachCommands.value()); + QString commands = expand(settings().gdbPostAttachCommands()); if (!commands.isEmpty()) runCommand({commands, NativeCommand}); } @@ -4846,7 +4845,7 @@ void GdbEngine::handleTargetRemote(const DebuggerResponse &response) // gdb server will stop the remote application itself. showMessage("INFERIOR STARTED"); showMessage(msgAttachedToStoppedInferior(), StatusBar); - QString commands = expand(debuggerSettings()->gdbPostAttachCommands.value()); + QString commands = expand(settings().gdbPostAttachCommands()); if (!commands.isEmpty()) runCommand({commands, NativeCommand}); handleInferiorPrepared(); @@ -4862,7 +4861,7 @@ void GdbEngine::handleTargetExtendedRemote(const DebuggerResponse &response) if (response.resultClass == ResultDone) { showMessage("ATTACHED TO GDB SERVER STARTED"); showMessage(msgAttachedToStoppedInferior(), StatusBar); - QString commands = expand(debuggerSettings()->gdbPostAttachCommands.value()); + QString commands = expand(settings().gdbPostAttachCommands()); if (!commands.isEmpty()) runCommand({commands, NativeCommand}); if (runParameters().attachPID.isValid()) { // attach to pid if valid @@ -5112,20 +5111,20 @@ void GdbEngine::doUpdateLocals(const UpdateParameters ¶ms) watchHandler()->appendWatchersAndTooltipRequests(&cmd); const bool alwaysVerbose = qtcEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE"); - const DebuggerSettings &s = *debuggerSettings(); + const DebuggerSettings &s = settings(); cmd.arg("passexceptions", alwaysVerbose); - cmd.arg("fancy", s.useDebuggingHelpers.value()); - cmd.arg("autoderef", s.autoDerefPointers.value()); - cmd.arg("dyntype", s.useDynamicType.value()); - cmd.arg("qobjectnames", s.showQObjectNames.value()); - cmd.arg("timestamps", s.logTimeStamps.value()); + cmd.arg("fancy", s.useDebuggingHelpers()); + cmd.arg("autoderef", s.autoDerefPointers()); + cmd.arg("dyntype", s.useDynamicType()); + cmd.arg("qobjectnames", s.showQObjectNames()); + cmd.arg("timestamps", s.logTimeStamps()); StackFrame frame = stackHandler()->currentFrame(); cmd.arg("context", frame.context); cmd.arg("nativemixed", isNativeMixedActive()); - cmd.arg("stringcutoff", s.maximalStringLength.value()); - cmd.arg("displaystringlimit", s.displayStringLimit.value()); + cmd.arg("stringcutoff", s.maximalStringLength()); + cmd.arg("displaystringlimit", s.displayStringLimit()); cmd.arg("resultvarname", m_resultVarName); cmd.arg("partialvar", params.partialVariable); diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index d46b86fa871..73025062503 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -69,7 +69,7 @@ LldbEngine::LldbEngine() setObjectName("LldbEngine"); setDebuggerName("LLDB"); - DebuggerSettings &ds = *debuggerSettings(); + DebuggerSettings &ds = settings(); connect(&ds.autoDerefPointers, &BaseAspect::changed, this, &LldbEngine::updateLocals); connect(ds.createFullBacktrace.action(), &QAction::triggered, this, &LldbEngine::fetchFullBacktrace); @@ -228,14 +228,14 @@ void LldbEngine::handleLldbStarted() if (!commands.isEmpty()) executeCommand(commands); - const FilePath path = debuggerSettings()->extraDumperFile(); + const FilePath path = settings().extraDumperFile(); if (!path.isEmpty() && path.isReadableFile()) { DebuggerCommand cmd("addDumperModule"); cmd.arg("path", path.path()); runCommand(cmd); } - commands = debuggerSettings()->extraDumperCommands.value(); + commands = settings().extraDumperCommands(); if (!commands.isEmpty()) { DebuggerCommand cmd("executeDebuggerCommand"); cmd.arg("command", commands); @@ -248,8 +248,7 @@ void LldbEngine::handleLldbStarted() }; runCommand(cmd1); - const SourcePathMap sourcePathMap = - mergePlatformQtPath(rp, debuggerSettings()->sourcePathMap.value()); + const SourcePathMap sourcePathMap = mergePlatformQtPath(rp, settings().sourcePathMap()); for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd(); it != cend; ++it) { @@ -468,7 +467,7 @@ void LldbEngine::selectThread(const Thread &thread) DebuggerCommand cmd("selectThread"); cmd.arg("id", thread->id()); cmd.callback = [this](const DebuggerResponse &) { - fetchStack(debuggerSettings()->maximalStackDepth()); + fetchStack(settings().maximalStackDepth()); }; runCommand(cmd); } @@ -700,7 +699,7 @@ void LldbEngine::updateAll() DebuggerCommand cmd("fetchThreads"); cmd.callback = [this](const DebuggerResponse &response) { threadsHandler()->setThreads(response.data); - fetchStack(debuggerSettings()->maximalStackDepth()); + fetchStack(settings().maximalStackDepth()); reloadRegisters(); }; runCommand(cmd); @@ -733,21 +732,21 @@ void LldbEngine::doUpdateLocals(const UpdateParameters ¶ms) watchHandler()->appendWatchersAndTooltipRequests(&cmd); const bool alwaysVerbose = qtcEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE"); - const DebuggerSettings &s = *debuggerSettings(); + const DebuggerSettings &s = settings(); cmd.arg("passexceptions", alwaysVerbose); - cmd.arg("fancy", s.useDebuggingHelpers.value()); - cmd.arg("autoderef", s.autoDerefPointers.value()); - cmd.arg("dyntype", s.useDynamicType.value()); + cmd.arg("fancy", s.useDebuggingHelpers()); + cmd.arg("autoderef", s.autoDerefPointers()); + cmd.arg("dyntype", s.useDynamicType()); cmd.arg("partialvar", params.partialVariable); - cmd.arg("qobjectnames", s.showQObjectNames.value()); - cmd.arg("timestamps", s.logTimeStamps.value()); + cmd.arg("qobjectnames", s.showQObjectNames()); + cmd.arg("timestamps", s.logTimeStamps()); StackFrame frame = stackHandler()->currentFrame(); cmd.arg("context", frame.context); cmd.arg("nativemixed", isNativeMixedActive()); - cmd.arg("stringcutoff", s.maximalStringLength.value()); - cmd.arg("displaystringlimit", s.displayStringLimit.value()); + cmd.arg("stringcutoff", s.maximalStringLength()); + cmd.arg("displaystringlimit", s.displayStringLimit()); //cmd.arg("resultvarname", m_resultVarName); cmd.arg("partialvar", params.partialVariable); @@ -997,7 +996,7 @@ void LldbEngine::fetchDisassembler(DisassemblerAgent *agent) DebuggerCommand cmd("fetchDisassembler"); cmd.arg("address", loc.address()); cmd.arg("function", loc.functionName()); - cmd.arg("flavor", debuggerSettings()->intelFlavor.value() ? "intel" : "att"); + cmd.arg("flavor", settings().intelFlavor() ? "intel" : "att"); cmd.callback = [this, id](const DebuggerResponse &response) { DisassemblerLines result; QPointer<DisassemblerAgent> agent = m_disassemblerAgents.key(id); diff --git a/src/plugins/debugger/logwindow.cpp b/src/plugins/debugger/logwindow.cpp index 3ff32f9df52..ba3452f66d9 100644 --- a/src/plugins/debugger/logwindow.cpp +++ b/src/plugins/debugger/logwindow.cpp @@ -193,10 +193,10 @@ public: QMenu *menu = createStandardContextMenu(); menu->addAction(m_clearContentsAction); menu->addAction(m_saveContentsAction); // X11 clipboard is unreliable for long texts - menu->addAction(debuggerSettings()->logTimeStamps.action()); + menu->addAction(settings().logTimeStamps.action()); menu->addAction(Core::ActionManager::command(Constants::RELOAD_DEBUGGING_HELPERS)->action()); menu->addSeparator(); - menu->addAction(debuggerSettings()->settingsDialog.action()); + menu->addAction(settings().settingsDialog.action()); menu->exec(ev->globalPos()); delete menu; } @@ -494,7 +494,7 @@ void LogWindow::showOutput(int channel, const QString &output) QString out; out.reserve(output.size() + 1000); - if (output.at(0) != '~' && debuggerSettings()->logTimeStamps.value()) { + if (output.at(0) != '~' && settings().logTimeStamps()) { out.append(charForChannel(LogTime)); out.append(logTimeStamp()); out.append(nchar); @@ -562,7 +562,7 @@ void LogWindow::showInput(int channel, const QString &input) m_inputText->setTextCursor(cursor); return; } - if (debuggerSettings()->logTimeStamps.value()) + if (settings().logTimeStamps()) m_inputText->append(logTimeStamp()); m_inputText->append(input); QTextCursor cursor = m_inputText->textCursor(); @@ -695,7 +695,7 @@ void GlobalLogWindow::doOutput(const QString &output) void GlobalLogWindow::doInput(const QString &input) { - if (debuggerSettings()->logTimeStamps.value()) + if (settings().logTimeStamps()) m_leftPane->append(LogWindow::logTimeStamp()); m_leftPane->append(input); QTextCursor cursor = m_leftPane->textCursor(); diff --git a/src/plugins/debugger/moduleshandler.cpp b/src/plugins/debugger/moduleshandler.cpp index 4f063b57288..5d0d6d6a8b7 100644 --- a/src/plugins/debugger/moduleshandler.cpp +++ b/src/plugins/debugger/moduleshandler.cpp @@ -205,7 +205,7 @@ bool ModulesModel::contextMenuEvent(const ItemViewEvent &ev) canShowSymbols && moduleNameValid, [this, modulePath] { engine->requestModuleSections(modulePath); }); - menu->addAction(debuggerSettings()->settingsDialog.action()); + menu->addAction(settings().settingsDialog.action()); connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater); menu->popup(ev.globalPos()); diff --git a/src/plugins/debugger/pdb/pdbengine.cpp b/src/plugins/debugger/pdb/pdbengine.cpp index 8b548b9d3d0..9c7c9bcac35 100644 --- a/src/plugins/debugger/pdb/pdbengine.cpp +++ b/src/plugins/debugger/pdb/pdbengine.cpp @@ -543,7 +543,7 @@ void PdbEngine::updateLocals() const bool alwaysVerbose = qtcEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE"); cmd.arg("passexceptions", alwaysVerbose); - cmd.arg("fancy", debuggerSettings()->useDebuggingHelpers.value()); + cmd.arg("fancy", settings().useDebuggingHelpers()); //cmd.arg("resultvarname", m_resultVarName); //m_lastDebuggableCommand = cmd; diff --git a/src/plugins/debugger/peripheralregisterhandler.cpp b/src/plugins/debugger/peripheralregisterhandler.cpp index e2ae4a9b7a7..f94e11e6235 100644 --- a/src/plugins/debugger/peripheralregisterhandler.cpp +++ b/src/plugins/debugger/peripheralregisterhandler.cpp @@ -771,7 +771,7 @@ bool PeripheralRegisterHandler::contextMenuEvent(const ItemViewEvent &ev) menu->addMenu(fmtMenu); } - menu->addAction(debuggerSettings()->settingsDialog.action()); + menu->addAction(settings().settingsDialog.action()); connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater); menu->popup(ev.globalPos()); return true; diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index f1724f29798..d418d9cb4dc 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -845,10 +845,9 @@ bool compareConsoleItems(const ConsoleItem *a, const ConsoleItem *b) return a->text() < b->text(); } -static ConsoleItem *constructLogItemTree(const QVariant &result, - const QString &key = QString()) +static ConsoleItem *constructLogItemTree(const QVariant &result, const QString &key = {}) { - bool sorted = debuggerSettings()->sortStructMembers.value(); + const bool sorted = settings().sortStructMembers(); if (!result.isValid()) return nullptr; @@ -2234,7 +2233,7 @@ void QmlEnginePrivate::constructChildLogItems(ConsoleItem *item, const QmlV8Obje for (const QVariant &property : objectData.properties) *(it++) = constructLogItemTree(extractData(property), seenHandles); - if (debuggerSettings()->sortStructMembers.value()) + if (settings().sortStructMembers()) std::sort(children.begin(), children.end(), compareConsoleItems); for (ConsoleItem *child : std::as_const(children)) @@ -2346,7 +2345,7 @@ void QmlEnginePrivate::insertSubItems(WatchItem *parent, const QVariantList &pro parent->appendChild(item.release()); } - if (debuggerSettings()->sortStructMembers.value()) { + if (settings().sortStructMembers()) { parent->sortChildren([](const WatchItem *item1, const WatchItem *item2) { return item1->name < item2->name; }); diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp index 712b66e5b35..c2e118b73cb 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.cpp +++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp @@ -46,12 +46,12 @@ QmlInspectorAgent::QmlInspectorAgent(QmlEngine *engine, QmlDebugConnection *conn : m_qmlEngine(engine) , m_inspectorToolsContext("Debugger.QmlInspector") , m_selectAction(new QAction(this)) - , m_showAppOnTopAction(debuggerSettings()->showAppOnTop.action()) + , m_showAppOnTopAction(settings().showAppOnTop.action()) { m_debugIdToIname.insert(WatchItem::InvalidId, "inspect"); - connect(&debuggerSettings()->showQmlObjectTree, &Utils::BaseAspect::changed, + connect(&settings().showQmlObjectTree, &Utils::BaseAspect::changed, this, &QmlInspectorAgent::updateState); - connect(&debuggerSettings()->sortStructMembers, &Utils::BaseAspect::changed, + connect(&settings().sortStructMembers, &Utils::BaseAspect::changed, this, &QmlInspectorAgent::updateState); m_delayQueryTimer.setSingleShot(true); m_delayQueryTimer.setInterval(100); @@ -171,7 +171,7 @@ void QmlInspectorAgent::addObjectWatch(int objectDebugId) if (objectDebugId == WatchItem::InvalidId) return; - if (!isConnected() || !debuggerSettings()->showQmlObjectTree.value()) + if (!isConnected() || !settings().showQmlObjectTree()) return; // already set @@ -190,8 +190,7 @@ void QmlInspectorAgent::updateState() m_qmlEngine->logServiceStateChange(m_engineClient->name(), m_engineClient->serviceVersion(), m_engineClient->state()); - if (m_engineClient->state() == QmlDebugClient::Enabled - && debuggerSettings()->showQmlObjectTree.value()) + if (m_engineClient->state() == QmlDebugClient::Enabled && settings().showQmlObjectTree()) reloadEngines(); else clearObjectTree(); @@ -280,7 +279,7 @@ void QmlInspectorAgent::newObject(int engineId, int /*objectId*/, int /*parentId static void sortChildrenIfNecessary(WatchItem *propertiesWatch) { - if (debuggerSettings()->sortStructMembers.value()) { + if (settings().sortStructMembers()) { propertiesWatch->sortChildren([](const WatchItem *item1, const WatchItem *item2) { return item1->name < item2->name; }); @@ -354,7 +353,7 @@ void QmlInspectorAgent::queryEngineContext() { qCDebug(qmlInspectorLog) << __FUNCTION__ << "pending queries:" << m_rootContextQueryIds; - if (!isConnected() || !debuggerSettings()->showQmlObjectTree.value()) + if (!isConnected() || !settings().showQmlObjectTree()) return; log(LogSend, "LIST_OBJECTS"); @@ -369,7 +368,7 @@ void QmlInspectorAgent::fetchObject(int debugId) { qCDebug(qmlInspectorLog) << __FUNCTION__ << '(' << debugId << ')'; - if (!isConnected() || !debuggerSettings()->showQmlObjectTree.value()) + if (!isConnected() || !settings().showQmlObjectTree()) return; log(LogSend, "FETCH_OBJECT " + QString::number(debugId)); @@ -383,7 +382,7 @@ void QmlInspectorAgent::updateObjectTree(const ContextReference &context, int en { qCDebug(qmlInspectorLog) << __FUNCTION__ << '(' << context << ')'; - if (!isConnected() || !debuggerSettings()->showQmlObjectTree.value()) + if (!isConnected() || !settings().showQmlObjectTree()) return; for (const ObjectReference &obj : context.objects()) diff --git a/src/plugins/debugger/registerhandler.cpp b/src/plugins/debugger/registerhandler.cpp index 09a04e815a2..64f82052bf6 100644 --- a/src/plugins/debugger/registerhandler.cpp +++ b/src/plugins/debugger/registerhandler.cpp @@ -811,7 +811,7 @@ bool RegisterHandler::contextMenuEvent(const ItemViewEvent &ev) addFormatAction(Tr::tr("Octal"), OctalFormat); addFormatAction(Tr::tr("Binary"), BinaryFormat); - menu->addAction(debuggerSettings()->settingsDialog.action()); + menu->addAction(settings().settingsDialog.action()); connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater); menu->popup(ev.globalPos()); return true; diff --git a/src/plugins/debugger/sourcefileshandler.cpp b/src/plugins/debugger/sourcefileshandler.cpp index bec03054173..23ec2477023 100644 --- a/src/plugins/debugger/sourcefileshandler.cpp +++ b/src/plugins/debugger/sourcefileshandler.cpp @@ -114,7 +114,7 @@ bool SourceFilesHandler::setData(const QModelIndex &idx, const QVariant &data, i addAction(Tr::tr("Open File \"%1\"").arg(name), true, [this, name] { m_engine->gotoLocation(FilePath::fromString(name)); }); - menu->addAction(debuggerSettings()->settingsDialog.action()); + menu->addAction(settings().settingsDialog.action()); menu->popup(ev.globalPos()); return true; } diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index 1fc6f04582f..d8ca3cad06b 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -47,9 +47,9 @@ StackHandler::StackHandler(DebuggerEngine *engine) setObjectName("StackModel"); setHeader({Tr::tr("Level"), Tr::tr("Function"), Tr::tr("File"), Tr::tr("Line"), Tr::tr("Address") }); - connect(debuggerSettings()->expandStack.action(), &QAction::triggered, + connect(settings().expandStack.action(), &QAction::triggered, this, &StackHandler::reloadFullStack); - connect(debuggerSettings()->maximalStackDepth.action(), &QAction::triggered, + connect(settings().maximalStackDepth.action(), &QAction::triggered, this, &StackHandler::reloadFullStack); // For now there's always only "the" current thread. @@ -66,7 +66,7 @@ QVariant SpecialStackItem::data(int column, int role) const return Tr::tr("<More>"); if (role == Qt::DecorationRole && column == StackLevelColumn) return Icons::EMPTY.icon(); - return QVariant(); + return {}; } QVariant StackFrameItem::data(int column, int role) const @@ -86,16 +86,16 @@ QVariant StackFrameItem::data(int column, int role) const return QString("0x%1").arg(frame.address, 0, 16); return QString(); } - return QVariant(); + return {}; } if (role == Qt::DecorationRole && column == StackLevelColumn) return handler->iconForRow(row); - if (role == Qt::ToolTipRole && debuggerSettings()->useToolTipsInStackView.value()) + if (role == Qt::ToolTipRole && settings().useToolTipsInStackView()) return frame.toToolTip(); - return QVariant(); + return {}; } Qt::ItemFlags StackFrameItem::flags(int column) const @@ -234,8 +234,8 @@ void StackHandler::setFramesAndCurrentIndex(const GdbMi &frames, bool isFull) targetFrame = i; } - bool canExpand = !isFull && (n >= debuggerSettings()->maximalStackDepth()); - debuggerSettings()->expandStack.setEnabled(canExpand); + bool canExpand = !isFull && n >= settings().maximalStackDepth(); + settings().expandStack.setEnabled(canExpand); setFrames(stackFrames, canExpand); // We can't jump to any file if we don't have any frames. @@ -424,7 +424,7 @@ bool StackHandler::contextMenuEvent(const ItemViewEvent &ev) frame = frameAt(row); const quint64 address = frame.address; - menu->addAction(debuggerSettings()->expandStack.action()); + menu->addAction(settings().expandStack.action()); addAction(this, menu, Tr::tr("Copy Contents to Clipboard"), true, [ev] { setClipboardAndSelection(selectedText(ev.view(), true)); @@ -437,7 +437,7 @@ bool StackHandler::contextMenuEvent(const ItemViewEvent &ev) addAction(this, menu, Tr::tr("Save as Task File..."), true, [this] { saveTaskFile(); }); if (m_engine->hasCapability(CreateFullBacktraceCapability)) - menu->addAction(debuggerSettings()->createFullBacktrace.action()); + menu->addAction(settings().createFullBacktrace.action()); if (m_engine->hasCapability(AdditionalQmlStackCapability)) addAction(this, menu, Tr::tr("Load QML Stack"), true, [this] { m_engine->loadAdditionalQmlStack(); }); @@ -485,8 +485,8 @@ bool StackHandler::contextMenuEvent(const ItemViewEvent &ev) } menu->addSeparator(); - menu->addAction(debuggerSettings()->useToolTipsInStackView.action()); - menu->addAction(debuggerSettings()->settingsDialog.action()); + menu->addAction(settings().useToolTipsInStackView.action()); + menu->addAction(settings().settingsDialog.action()); connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater); menu->popup(ev.globalPos()); return true; diff --git a/src/plugins/debugger/threadshandler.cpp b/src/plugins/debugger/threadshandler.cpp index 063c12a85cf..f7adcf3288a 100644 --- a/src/plugins/debugger/threadshandler.cpp +++ b/src/plugins/debugger/threadshandler.cpp @@ -227,7 +227,7 @@ bool ThreadsHandler::setData(const QModelIndex &idx, const QVariant &data, int r if (ev.as<QContextMenuEvent>()) { auto menu = new QMenu; - menu->addAction(debuggerSettings()->settingsDialog.action()); + menu->addAction(settings().settingsDialog.action()); menu->popup(ev.globalPos()); return true; } diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index f0ece852f4e..aebf092e8d9 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -525,7 +525,7 @@ WatchModel::WatchModel(WatchHandler *handler, DebuggerEngine *engine) m_engine->updateLocalsWindow(showReturn); }); - DebuggerSettings &s = *debuggerSettings(); + DebuggerSettings &s = settings(); connect(&s.sortStructMembers, &BaseAspect::changed, m_engine, &DebuggerEngine::updateLocals); connect(&s.showStdNamespace, &BaseAspect::changed, @@ -581,9 +581,9 @@ static QString niceTypeHelper(const QString &typeIn) QString WatchModel::removeNamespaces(QString str) const { - if (!debuggerSettings()->showStdNamespace.value()) + if (!settings().showStdNamespace()) str.remove("std::"); - if (!debuggerSettings()->showQtNamespace.value()) { + if (!settings().showQtNamespace()) { const QString qtNamespace = m_engine->qtNamespace(); if (!qtNamespace.isEmpty()) str.remove(qtNamespace); @@ -1113,8 +1113,7 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const } case Qt::ToolTipRole: - return debuggerSettings()->useToolTipsInLocalsView.value() - ? item->toToolTip() : QVariant(); + return settings().useToolTipsInLocalsView() ? item->toToolTip() : QVariant(); case Qt::ForegroundRole: return valueColor(item, column); @@ -1134,7 +1133,7 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const default: break; } - return QVariant(); + return {}; } bool WatchModel::setData(const QModelIndex &idx, const QVariant &value, int role) @@ -1349,7 +1348,7 @@ void WatchModel::expand(WatchItem *item, bool requestEngineUpdate) if (item->isLoadMore()) { item = item->parent(); m_maxArrayCount[item->iname] - = m_maxArrayCount.value(item->iname, debuggerSettings()->defaultArraySize.value()) * 10; + = m_maxArrayCount.value(item->iname, settings().defaultArraySize()) * 10; if (requestEngineUpdate) m_engine->updateItem(item->iname); } else { @@ -1823,7 +1822,7 @@ bool WatchModel::contextMenuEvent(const ItemViewEvent &ev) menu->addSeparator(); - DebuggerSettings &s = *debuggerSettings(); + DebuggerSettings &s = settings(); menu->addAction(s.useDebuggingHelpers.action()); menu->addAction(s.useToolTipsInLocalsView.action()); menu->addAction(s.autoDerefPointers.action()); @@ -2190,7 +2189,7 @@ void WatchHandler::insertItems(const GdbMi &data) { QSet<WatchItem *> itemsToSort; - const bool sortStructMembers = debuggerSettings()->sortStructMembers.value(); + const bool sortStructMembers = settings().sortStructMembers(); for (const GdbMi &child : data) { auto item = new WatchItem; item->parse(child, sortStructMembers); @@ -2332,7 +2331,7 @@ void WatchHandler::notifyUpdateFinished() }); QMap<QString, QString> values; - if (debuggerSettings()->useAnnotationsInMainEditor.value()) { + if (settings().useAnnotationsInMainEditor()) { m_model->forAllItems([&values](WatchItem *item) { const QString expr = item->sourceExpression(); if (!expr.isEmpty()) @@ -2848,7 +2847,7 @@ QSet<QString> WatchHandler::expandedINames() const int WatchHandler::maxArrayCount(const QString &iname) const { - return m_model->m_maxArrayCount.value(iname, debuggerSettings()->defaultArraySize()); + return m_model->m_maxArrayCount.value(iname, settings().defaultArraySize()); } void WatchHandler::recordTypeInfo(const GdbMi &typeInfo) diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index b7256464dfb..4e95b04b6f5 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -32,7 +32,7 @@ WatchTreeView::WatchTreeView(WatchType type) connect(this, &QTreeView::expanded, this, &WatchTreeView::expandNode); connect(this, &QTreeView::collapsed, this, &WatchTreeView::collapseNode); - connect(&debuggerSettings()->logTimeStamps, &Utils::BaseAspect::changed, + connect(&settings().logTimeStamps, &Utils::BaseAspect::changed, this, &WatchTreeView::updateTimeColumn); } @@ -84,8 +84,7 @@ void WatchTreeView::setModel(QAbstractItemModel *model) void WatchTreeView::updateTimeColumn() { if (header()) - header()->setSectionHidden(WatchModelBase::TimeColumn, - !debuggerSettings()->logTimeStamps.value()); + header()->setSectionHidden(WatchModelBase::TimeColumn, !settings().logTimeStamps()); } void WatchTreeView::handleItemIsExpanded(const QModelIndex &idx) From cd6e990de8a794735c9ca000b2cd0fd3668fbe08 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Tue, 4 Jul 2023 16:32:37 +0200 Subject: [PATCH 0328/1777] DAP: Add CMake debug to the debug panel This commit introduces the capability to initiate CMake Debug sessions directly from the debug panel in the QtCretor. Change-Id: I00245e0e14aded378e881c4049cdc41dd1fbd00e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 11 ++- .../cmakeprojectmanager/cmakebuildsystem.h | 2 + .../cmakeprojectmanager/cmakeprocess.cpp | 16 +--- .../cmakeprojectmanager/cmakeprocess.h | 1 + .../cmakeprojectmanager/fileapireader.cpp | 15 +++- .../cmakeprojectmanager/fileapireader.h | 6 +- src/plugins/debugger/dap/dapengine.cpp | 74 +++++++++++++------ src/plugins/debugger/dap/dapengine.h | 3 +- src/plugins/debugger/debuggerengine.cpp | 13 ++-- .../debugger/debuggerinternalconstants.h | 1 + src/plugins/debugger/debuggermainwindow.cpp | 5 ++ src/plugins/debugger/debuggermainwindow.h | 1 + src/plugins/debugger/debuggerplugin.cpp | 30 ++++++++ src/plugins/debugger/debuggerruncontrol.cpp | 1 + src/plugins/projectexplorer/buildsystem.h | 2 + .../projectexplorer/projectexplorer.cpp | 7 +- .../projectexplorerconstants.h | 1 + 17 files changed, 140 insertions(+), 49 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 69e8c74a10b..4579ccdc941 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -115,6 +115,7 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc) &CMakeBuildSystem::handleParsingSucceeded); connect(&m_reader, &FileApiReader::errorOccurred, this, &CMakeBuildSystem::handleParsingFailed); connect(&m_reader, &FileApiReader::dirty, this, &CMakeBuildSystem::becameDirty); + connect(&m_reader, &FileApiReader::debuggingStarted, this, &BuildSystem::debuggingStarted); wireUpConnections(); @@ -193,7 +194,15 @@ void CMakeBuildSystem::triggerParsing() qCDebug(cmakeBuildSystemLog) << "Asking reader to parse"; m_reader.parse(reparseParameters & REPARSE_FORCE_CMAKE_RUN, reparseParameters & REPARSE_FORCE_INITIAL_CONFIGURATION, - reparseParameters & REPARSE_FORCE_EXTRA_CONFIGURATION); + reparseParameters & REPARSE_FORCE_EXTRA_CONFIGURATION, + reparseParameters & REPARSE_DEBUG); +} + +void CMakeBuildSystem::requestDebugging() +{ + qCDebug(cmakeBuildSystemLog) << "Requesting parse due to \"Rescan Project\" command"; + reparse(REPARSE_FORCE_CMAKE_RUN | REPARSE_FORCE_EXTRA_CONFIGURATION | REPARSE_URGENT + | REPARSE_DEBUG); } bool CMakeBuildSystem::supportsAction(Node *context, ProjectAction action, const Node *node) const diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h index 694840af26b..068fbc986e1 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h @@ -40,6 +40,7 @@ public: ~CMakeBuildSystem() final; void triggerParsing() final; + void requestDebugging() final; bool supportsAction(ProjectExplorer::Node *context, ProjectExplorer::ProjectAction action, @@ -143,6 +144,7 @@ private: = (1 << 1), // Force initial configuration arguments to cmake REPARSE_FORCE_EXTRA_CONFIGURATION = (1 << 2), // Force extra configuration arguments to cmake REPARSE_URGENT = (1 << 3), // Do not delay the parser run by 1s + REPARSE_DEBUG = (1 << 4), // Start with debugging }; void reparse(int reparseParameters); QString reparseParametersString(int reparseFlags); diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index b9eb017b94b..05dba3e8376 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -122,8 +122,9 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & m_process->setWorkingDirectory(buildDirectory); m_process->setEnvironment(parameters.environment); - m_process->setStdOutLineCallback([](const QString &s) { + m_process->setStdOutLineCallback([this](const QString &s) { BuildSystem::appendBuildSystemOutput(stripTrailingNewline(s)); + emit stdOutReady(s); }); m_process->setStdErrLineCallback([this](const QString &s) { @@ -139,19 +140,6 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & commandLine.addArgs({"-S", sourceDirectory.path(), "-B", buildDirectory.path()}); commandLine.addArgs(arguments); - if (qEnvironmentVariableIsSet("QTC_USE_CMAKE_DEBUGGER")) { - FilePath file = FilePath::fromString("/tmp/cmake-dap.sock"); - file.removeFile(); - commandLine.addArgs({"--debugger", "--debugger-pipe=/tmp/cmake-dap.sock"}); - connect(m_process.get(), &Process::started, this, [this, cmakeExecutable] { - QMetaObject::invokeMethod(debuggerPlugin(), - "attachToProcess", - Qt::QueuedConnection, - Q_ARG(qint64, m_process->processId()), - Q_ARG(const Utils::FilePath &, cmakeExecutable)); - }); - } - TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); BuildSystem::startNewBuildSystemOutput(::CMakeProjectManager::Tr::tr("Running %1 in %2.") diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.h b/src/plugins/cmakeprojectmanager/cmakeprocess.h index bb365d337cc..a49033c929b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.h +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.h @@ -33,6 +33,7 @@ public: signals: void finished(int exitCode); + void stdOutReady(const QString &s); private: void handleProcessDone(const Utils::ProcessResultData &resultData); diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp index f680cdc0a38..66995ba5d32 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.cpp +++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp @@ -82,19 +82,26 @@ void FileApiReader::resetData() void FileApiReader::parse(bool forceCMakeRun, bool forceInitialConfiguration, - bool forceExtraConfiguration) + bool forceExtraConfiguration, + bool debugging) { qCDebug(cmakeFileApiMode) << "Parse called with arguments: ForceCMakeRun:" << forceCMakeRun << " - forceConfiguration:" << forceInitialConfiguration << " - forceExtraConfiguration:" << forceExtraConfiguration; startState(); - const QStringList args = (forceInitialConfiguration ? m_parameters.initialCMakeArguments + QStringList args = (forceInitialConfiguration ? m_parameters.initialCMakeArguments : QStringList()) + (forceExtraConfiguration ? (m_parameters.configurationChangesArguments + m_parameters.additionalCMakeArguments) : QStringList()); + if (debugging) { + FilePath file = FilePath::fromString("/tmp/cmake-dap.sock"); + file.removeFile(); + args << "--debugger" << "--debugger-pipe=/tmp/cmake-dap.sock"; + } + qCDebug(cmakeFileApiMode) << "Parameters request these CMake arguments:" << args; const FilePath replyFile = FileApiParser::scanForCMakeReplyFile(m_parameters.buildDirectory); @@ -339,6 +346,10 @@ void FileApiReader::startCMakeState(const QStringList &configurationArguments) m_cmakeProcess = std::make_unique<CMakeProcess>(); connect(m_cmakeProcess.get(), &CMakeProcess::finished, this, &FileApiReader::cmakeFinishedState); + connect(m_cmakeProcess.get(), &CMakeProcess::stdOutReady, this, [this](const QString &data) { + if (data.endsWith("Waiting for debugger client to connect...\n")) + emit debuggingStarted(); + }); qCDebug(cmakeFileApiMode) << ">>>>>> Running cmake with arguments:" << configurationArguments; // Reset watcher: diff --git a/src/plugins/cmakeprojectmanager/fileapireader.h b/src/plugins/cmakeprojectmanager/fileapireader.h index 115d22ea71a..b013770982d 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.h +++ b/src/plugins/cmakeprojectmanager/fileapireader.h @@ -38,7 +38,10 @@ public: void setParameters(const BuildDirParameters &p); void resetData(); - void parse(bool forceCMakeRun, bool forceInitialConfiguration, bool forceExtraConfiguration); + void parse(bool forceCMakeRun, + bool forceInitialConfiguration, + bool forceExtraConfiguration, + bool debugging); void stop(); void stopCMakeRun(); @@ -64,6 +67,7 @@ signals: void dataAvailable(bool restoredFromBackup) const; void dirty() const; void errorOccurred(const QString &message) const; + void debuggingStarted() const; private: void startState(); diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 3cddfa9dc81..16a314db000 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -7,8 +7,11 @@ #include <debugger/debuggeractions.h> #include <debugger/debuggercore.h> #include <debugger/debuggerdialogs.h> +#include <debugger/debuggerinternalconstants.h> +#include <debugger/debuggermainwindow.h> #include <debugger/debuggerplugin.h> #include <debugger/debuggerprotocol.h> +#include <debugger/debuggerruncontrol.h> #include <debugger/debuggertooltipmanager.h> #include <debugger/debuggertr.h> #include <debugger/moduleshandler.h> @@ -20,6 +23,8 @@ #include <debugger/watchhandler.h> #include <debugger/watchutils.h> +#include <extensionsystem/pluginmanager.h> + #include <utils/algorithm.h> #include <utils/environment.h> #include <utils/process.h> @@ -31,6 +36,10 @@ #include <coreplugin/idocument.h> #include <coreplugin/messagebox.h> +#include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/buildsystem.h> +#include <projectexplorer/projecttree.h> + #include <QDateTime> #include <QDebug> #include <QDir> @@ -45,7 +54,7 @@ using namespace Core; using namespace Utils; -static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengin", QtWarningMsg) +static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg) namespace Debugger::Internal { @@ -221,21 +230,47 @@ void DapEngine::setupEngine() { QTC_ASSERT(state() == EngineSetupRequested, qCDebug(dapEngineLog) << state()); - if (qEnvironmentVariableIsSet("QTC_USE_CMAKE_DEBUGGER")) { + const auto connectDataGeneratorSignals = [this] { + if (!m_dataGenerator) + return; + + connect(m_dataGenerator.get(), &IDataProvider::started, this, &DapEngine::handleDapStarted); + connect(m_dataGenerator.get(), &IDataProvider::done, this, &DapEngine::handleDapDone); + connect(m_dataGenerator.get(), + &IDataProvider::readyReadStandardOutput, + this, + &DapEngine::readDapStandardOutput); + connect(m_dataGenerator.get(), + &IDataProvider::readyReadStandardError, + this, + &DapEngine::readDapStandardError); + }; + + Perspective *currentPerspective = DebuggerMainWindow::instance()->currentPerspective(); + if (currentPerspective->parentPerspectiveId() == Constants::CMAKE_PERSPECTIVE_ID) { + qCDebug(dapEngineLog) << "build system name" << ProjectExplorer::ProjectTree::currentBuildSystem()->name(); + + m_nextBreakpointId = 0; m_dataGenerator = std::make_unique<LocalSocketDataProvider>("/tmp/cmake-dap.sock"); + connectDataGeneratorSignals(); + + connect(ProjectExplorer::ProjectTree::currentBuildSystem(), + &ProjectExplorer::BuildSystem::debuggingStarted, + this, + [this] { + m_dataGenerator->start(); + }); + + ProjectExplorer::ProjectTree::currentBuildSystem()->requestDebugging(); } else { const DebuggerRunParameters &rp = runParameters(); const CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}}; + m_dataGenerator = std::make_unique<ProcessDataProvider>(rp, cmd); + connectDataGeneratorSignals(); + m_dataGenerator->start(); + } - - connect(m_dataGenerator.get(), &IDataProvider::started, this, &DapEngine::handleDapStarted); - connect(m_dataGenerator.get(), &IDataProvider::done, this, &DapEngine::handleDapDone); - connect(m_dataGenerator.get(), &IDataProvider::readyReadStandardOutput, this, &DapEngine::readDapStandardOutput); - connect(m_dataGenerator.get(), &IDataProvider::readyReadStandardError, this, &DapEngine::readDapStandardError); - - m_dataGenerator->start(); - notifyEngineSetupOk(); } @@ -325,13 +360,13 @@ void DapEngine::dapStackTrace() }); } -void DapEngine::dapScopes() +void DapEngine::dapScopes(int frameId) { postDirectCommand({ {"command", "scopes"}, {"type", "request"}, {"arguments", QJsonObject{ - {"frameId", 0} + {"frameId", frameId} }} }); } @@ -791,7 +826,7 @@ void DapEngine::handleOutput(const QJsonDocument &data) gotoLocation(Location(file, line)); refreshStack(stackFrames); - dapScopes(); + dapScopes(stackFrame.value("id").toInt()); return; } @@ -802,8 +837,8 @@ void DapEngine::handleOutput(const QJsonDocument &data) const QString name = scope.toObject().value("name").toString(); const int variablesReference = scope.toObject().value("variablesReference").toInt(); qCDebug(dapEngineLog) << "scoped success" << name << variablesReference; - if (name == "Locals") - dapVariables(variablesReference); +// if (name == "Locals") +// dapVariables(variablesReference); } } } @@ -851,15 +886,6 @@ void DapEngine::handleOutput(const QJsonDocument &data) const QJsonObject body = ob.value("body").toObject(); if (event == "exited") { - postDirectCommand({ - {"command", "disconnect"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"restart", false}, - {"terminateDebuggee", true} - }} - }); - notifyInferiorExited(); showMessage("exited", LogDebug); return; diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 7402385943d..16181b96669 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -4,6 +4,7 @@ #pragma once #include <debugger/debuggerengine.h> + #include <utils/process.h> #include <QVariant> @@ -108,7 +109,7 @@ private: void handleDapConfigurationDone(); void dapStackTrace(); - void dapScopes(); + void dapScopes(int frameId); void threads(); void dapVariables(int variablesReference); diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 729f8082c06..e7f8b47848d 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -541,13 +541,15 @@ void DebuggerEnginePrivate::setupViews() QTC_CHECK(!m_perspective); + Perspective *currentPerspective = DebuggerMainWindow::instance()->currentPerspective(); + const QString perspectiveId = "Debugger.Perspective." + m_runId + '.' + m_debuggerName; const QString settingsId = "Debugger.Perspective." + m_debuggerName; + const QString parentPerspectiveId = currentPerspective ? currentPerspective->id() + : Constants::PRESET_PERSPECTIVE_ID; - m_perspective = new Perspective(perspectiveId, - m_engine->displayName(), - Debugger::Constants::PRESET_PERSPECTIVE_ID, - settingsId); + m_perspective + = new Perspective(perspectiveId, m_engine->displayName(), parentPerspectiveId, settingsId); m_progress.setProgressRange(0, 1000); FutureProgress *fp = ProgressManager::addTask(m_progress.future(), @@ -724,7 +726,8 @@ void DebuggerEnginePrivate::setupViews() m_breakWindow->setObjectName("Debugger.Dock.Break." + engineId); m_breakWindow->setWindowTitle(Tr::tr("&Breakpoints")); - m_perspective->useSubPerspectiveSwitcher(EngineManager::engineChooser()); + if (!currentPerspective || currentPerspective->id() == Constants::PRESET_PERSPECTIVE_ID) + m_perspective->useSubPerspectiveSwitcher(EngineManager::engineChooser()); m_perspective->addToolBarAction(&m_continueAction); m_perspective->addToolBarAction(&m_interruptAction); diff --git a/src/plugins/debugger/debuggerinternalconstants.h b/src/plugins/debugger/debuggerinternalconstants.h index bb3e5181ee2..024e2cd3e2a 100644 --- a/src/plugins/debugger/debuggerinternalconstants.h +++ b/src/plugins/debugger/debuggerinternalconstants.h @@ -41,6 +41,7 @@ const char C_QMLDEBUGGER[] = "Qml/JavaScript Debugger"; const char C_DEBUGGER_NOTRUNNING[] = "Debugger.NotRunning"; const char PRESET_PERSPECTIVE_ID[] = "Debugger.Perspective.Preset"; +const char CMAKE_PERSPECTIVE_ID[] = "Debugger.Perspective.Cmake"; const char TASK_CATEGORY_DEBUGGER_RUNTIME[] = "DebugRuntime"; diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index 2a5ec866edb..fbe3c8079ab 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -785,6 +785,11 @@ QString Perspective::id() const return d->m_id; } +QString Perspective::parentPerspectiveId() const +{ + return d->m_parentPerspectiveId; +} + QString Perspective::name() const { return d->m_name; diff --git a/src/plugins/debugger/debuggermainwindow.h b/src/plugins/debugger/debuggermainwindow.h index 051704d4d9d..fbe959f19fd 100644 --- a/src/plugins/debugger/debuggermainwindow.h +++ b/src/plugins/debugger/debuggermainwindow.h @@ -76,6 +76,7 @@ public: void setShouldPersistChecker(const ShouldPersistChecker &checker); QString id() const; // Currently used by GammaRay plugin. + QString parentPerspectiveId() const; QString name() const; QWidget *centralWidget() const; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 152f928fb1e..b2d9e46595b 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -56,6 +56,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildmanager.h> +#include <projectexplorer/buildsystem.h> #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/devicesupport/deviceprocessesdialog.h> #include <projectexplorer/devicesupport/sshparameters.h> @@ -660,6 +661,7 @@ public: ProxyAction m_hiddenStopAction; QAction m_undisturbableAction; OptionalAction m_startAction; + OptionalAction m_startCmakeAction; QAction m_debugWithoutDeployAction{Tr::tr("Start Debugging Without Deployment")}; QAction m_startAndDebugApplicationAction{Tr::tr("Start and Debug External Application...")}; QAction m_attachToRunningApplication{Tr::tr("Attach to Running Application...")}; @@ -692,6 +694,7 @@ public: IContext m_debugModeContext; Perspective m_perspective{Constants::PRESET_PERSPECTIVE_ID, Tr::tr("Debugger")}; + std::unique_ptr<Perspective> m_perspectiveCmake; DebuggerKitAspect debuggerKitAspect; CommonOptionsPage commonOptionsPage; @@ -838,6 +841,11 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE, false); }); + connect(&m_startCmakeAction, &QAction::triggered, this, [] { +// ProjectTree::currentBuildSystem()->requestDebugging(); + ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE, true); + }); + connect(&m_debugWithoutDeployAction, &QAction::triggered, this, [] { ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE, true); }); @@ -1182,6 +1190,28 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) m_perspective.addWindow(breakpointManagerWindow, Perspective::SplitHorizontal, engineManagerWindow); m_perspective.addWindow(globalLogWindow, Perspective::AddToTab, nullptr, false, Qt::TopDockWidgetArea); + if (qEnvironmentVariableIsSet("QTC_USE_CMAKE_DEBUGGER")) { + m_perspectiveCmake = std::make_unique<Perspective>(Constants::CMAKE_PERSPECTIVE_ID, + Tr::tr("CMake")); + m_startCmakeAction.setText(Tr::tr("Start CMake Debugging")); + m_startCmakeAction.setEnabled(true); + m_startCmakeAction.setIcon(startIcon(true)); + m_startCmakeAction.setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + m_startCmakeAction.setVisible(true); + + m_perspectiveCmake->addToolBarAction(&m_startCmakeAction); + + m_perspectiveCmake->addWindow(engineManagerWindow, Perspective::SplitVertical, nullptr); + m_perspectiveCmake->addWindow(breakpointManagerWindow, + Perspective::SplitHorizontal, + engineManagerWindow); + m_perspectiveCmake->addWindow(globalLogWindow, + Perspective::AddToTab, + nullptr, + false, + Qt::TopDockWidgetArea); + } + setInitialState(); connect(ProjectManager::instance(), &ProjectManager::startupProjectChanged, diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 85ad01d76df..67cefc7b27d 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -1136,6 +1136,7 @@ DebuggerRunWorkerFactory::DebuggerRunWorkerFactory() { setProduct<DebuggerRunTool>(); addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE); + addSupportedRunMode(ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE); addSupportedDeviceType(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE); addSupportedDeviceType("DockerDeviceType"); } diff --git a/src/plugins/projectexplorer/buildsystem.h b/src/plugins/projectexplorer/buildsystem.h index 1cd1e41a060..55de9b30ac8 100644 --- a/src/plugins/projectexplorer/buildsystem.h +++ b/src/plugins/projectexplorer/buildsystem.h @@ -66,6 +66,7 @@ public: Utils::Environment activeParseEnvironment() const; + virtual void requestDebugging() {} virtual bool addFiles(Node *context, const Utils::FilePaths &filePaths, Utils::FilePaths *notAdded = nullptr); @@ -153,6 +154,7 @@ signals: void parsingFinished(bool success); void deploymentDataChanged(); void testInformationUpdated(); + void debuggingStarted(); protected: // Helper methods to manage parsing state and signalling diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 9b9ae3886ab..bcfc8197ebd 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2932,10 +2932,15 @@ void ProjectExplorerPlugin::runRunConfiguration(RunConfiguration *rc, dd->m_delayedRunConfiguration = rc; dd->m_shouldHaveRunConfiguration = true; }; - const BuildForRunConfigStatus buildStatus = forceSkipDeploy + + BuildForRunConfigStatus buildStatus = forceSkipDeploy ? BuildManager::isBuilding(rc->project()) ? BuildForRunConfigStatus::Building : BuildForRunConfigStatus::NotBuilding : BuildManager::potentiallyBuildForRunConfig(rc); + + if (dd->m_runMode != Constants::CMAKE_DEBUG_RUN_MODE) + buildStatus = BuildForRunConfigStatus::NotBuilding; + switch (buildStatus) { case BuildForRunConfigStatus::BuildFailed: return; diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index 50bacef3a41..27bd5936cc2 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -178,6 +178,7 @@ const char GENERATOR_ID_PREFIX[] = "PE.Wizard.Generator."; const char NO_RUN_MODE[]="RunConfiguration.NoRunMode"; const char NORMAL_RUN_MODE[]="RunConfiguration.NormalRunMode"; const char DEBUG_RUN_MODE[]="RunConfiguration.DebugRunMode"; +const char CMAKE_DEBUG_RUN_MODE[]="RunConfiguration.CmakeDebugRunMode"; const char QML_PROFILER_RUN_MODE[]="RunConfiguration.QmlProfilerRunMode"; const char QML_PROFILER_RUNNER[]="RunConfiguration.QmlProfilerRunner"; const char QML_PREVIEW_RUN_MODE[]="RunConfiguration.QmlPreviewRunMode"; From eeea437743b38f7f8ea21813c7d2d6ba1e1788e2 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 13 Jul 2023 13:43:59 +0200 Subject: [PATCH 0329/1777] DAP: Add displaying nested variables Change-Id: I588dde7c0ef402fe8d6c9d43dc9f0183bfa2d733 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/dapengine.cpp | 39 ++++++++++++++++++++------ src/plugins/debugger/dap/dapengine.h | 6 ++++ 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 16a314db000..65b5a731101 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -151,6 +151,8 @@ DapEngine::DapEngine() { setObjectName("DapEngine"); setDebuggerName("DAP"); + m_rootWatchItem = new WatchItem(); + m_currentWatchItem = m_rootWatchItem; } void DapEngine::executeDebuggerCommand(const QString &/*command*/) @@ -837,17 +839,20 @@ void DapEngine::handleOutput(const QJsonDocument &data) const QString name = scope.toObject().value("name").toString(); const int variablesReference = scope.toObject().value("variablesReference").toInt(); qCDebug(dapEngineLog) << "scoped success" << name << variablesReference; -// if (name == "Locals") -// dapVariables(variablesReference); + if (name == "Locals") { // Fix for several scopes + m_rootWatchItem = new WatchItem(); + m_currentWatchItem = m_rootWatchItem; + watchHandler()->removeAllData(); + watchHandler()->notifyUpdateStarted(); + dapVariables(variablesReference); + } } } } if (command == "variables") { - if (ob.value("success").toBool()) { - auto variables = ob.value("body").toObject().value("variables").toArray(); - refreshLocals(variables); - } + auto variables = ob.value("body").toObject().value("variables").toArray(); + refreshLocals(variables); } if (command == "stepIn" || command == "stepOut" || command == "next") { @@ -985,7 +990,6 @@ void DapEngine::handleOutput(const QJsonDocument &data) void DapEngine::refreshLocals(const QJsonArray &variables) { - watchHandler()->notifyUpdateStarted(); for (auto variable : variables) { WatchItem *item = new WatchItem; const QString name = variable.toObject().value("name").toString(); @@ -995,10 +999,27 @@ void DapEngine::refreshLocals(const QJsonArray &variables) item->value = variable.toObject().value("value").toString(); item->address = variable.toObject().value("address").toInt(); item->type = variable.toObject().value("type").toString(); + qCDebug(dapEngineLog) << "variable" << name << item->hexAddress(); - watchHandler()->insertItem(item); + m_currentWatchItem->appendChild(item); + + const int variablesReference = variable.toObject().value("variablesReference").toInt(); + if (variablesReference > 0) + m_variablesReferenceQueue.push({variablesReference, item}); } - watchHandler()->notifyUpdateFinished(); + + if (m_variablesReferenceQueue.empty()) { + for (auto item = m_rootWatchItem->begin(); item != m_rootWatchItem->end(); ++item) + watchHandler()->insertItem(*item); + watchHandler()->notifyUpdateFinished(); + return; + } + + const auto front = m_variablesReferenceQueue.front(); + m_variablesReferenceQueue.pop(); + + dapVariables(front.first); + m_currentWatchItem = front.second; } void DapEngine::refreshStack(const QJsonArray &stackFrames) diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 16181b96669..5a0c34492f9 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -9,6 +9,8 @@ #include <QVariant> +#include <queue> + namespace Debugger::Internal { class DebuggerCommand; @@ -126,6 +128,10 @@ private: int m_nextBreakpointId = 1; int m_currentThreadId = -1; + + std::queue<std::pair<int, WatchItem *>> m_variablesReferenceQueue; + WatchItem *m_currentWatchItem = nullptr; + WatchItem *m_rootWatchItem = nullptr; }; } // Debugger::Internal From 763b694801c148140ceddeebca5912a3774eeb96 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 15:25:40 +0200 Subject: [PATCH 0330/1777] AutoTest: Use more concise aspect access Change-Id: Iad5b82f697d4c32ff444b230dbb682833dbc5f82 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/autotest/ctest/ctesttool.cpp | 22 +++++++++++----------- src/plugins/autotest/testsettings.cpp | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/plugins/autotest/ctest/ctesttool.cpp b/src/plugins/autotest/ctest/ctesttool.cpp index 592b408faed..c8274498d67 100644 --- a/src/plugins/autotest/ctest/ctesttool.cpp +++ b/src/plugins/autotest/ctest/ctesttool.cpp @@ -114,16 +114,16 @@ CTestTool::CTestTool() QStringList CTestTool::activeSettingsAsOptions() const { QStringList options; - if (outputOnFail.value()) + if (outputOnFail()) options << "--output-on-failure"; - switch (outputMode.value()) { + switch (outputMode()) { case 1: options << "-V"; break; case 2: options << "-VV"; break; default: break; } - if (repeat.value()) { + if (repeat()) { QString repeatOption; - switch (repetitionMode.value()) { + switch (repetitionMode()) { case 0: repeatOption = "until-fail"; break; case 1: repeatOption = "until-pass"; break; case 2: repeatOption = "after-timeout"; break; @@ -131,18 +131,18 @@ QStringList CTestTool::activeSettingsAsOptions() const } if (!repeatOption.isEmpty()) { repeatOption.append(':'); - repeatOption.append(QString::number(repetitionCount.value())); + repeatOption.append(QString::number(repetitionCount())); options << "--repeat" << repeatOption; } } - if (scheduleRandom.value()) + if (scheduleRandom()) options << "--schedule-random"; - if (stopOnFailure.value()) + if (stopOnFailure()) options << "--stop-on-failure"; - if (parallel.value()) { - options << "-j" << QString::number(jobs.value()); - if (testLoad.value()) - options << "--test-load" << QString::number(threshold.value()); + if (parallel()) { + options << "-j" << QString::number(jobs()); + if (testLoad()) + options << "--test-load" << QString::number(threshold()); } return options; } diff --git a/src/plugins/autotest/testsettings.cpp b/src/plugins/autotest/testsettings.cpp index e6e101343d5..2e7926617d8 100644 --- a/src/plugins/autotest/testsettings.cpp +++ b/src/plugins/autotest/testsettings.cpp @@ -155,7 +155,7 @@ void TestSettings::fromSettings() RunAfterBuildMode TestSettings::runAfterBuildMode() const { - return static_cast<RunAfterBuildMode>(runAfterBuild.value()); + return static_cast<RunAfterBuildMode>(runAfterBuild()); } } // namespace Autotest::Internal From 46b0cdf90ed7f989df6df100f449445257536279 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 15:43:12 +0200 Subject: [PATCH 0331/1777] Qbs: Use aspects more directly in QbsBuildConfiguration Change-Id: Ie6de858023895cc3f70a9f1d14308e3d0d3480a4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/aspects.h | 1 + src/plugins/projectexplorer/buildaspects.cpp | 5 +- src/plugins/projectexplorer/buildaspects.h | 2 +- .../qbsbuildconfiguration.cpp | 48 +++++-------------- .../qbsprojectmanager/qbsbuildconfiguration.h | 9 ++-- 5 files changed, 21 insertions(+), 44 deletions(-) diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index c23375e1132..17faa1225ea 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -621,6 +621,7 @@ public: const QString &offString = {}, const QString &defaultString = {}); + TriState operator()() const { return value(); } TriState value() const; void setValue(TriState setting); diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index 7eb724b6323..f0f3d819440 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -163,11 +163,12 @@ void BuildDirectoryAspect::updateProblemLabel() d->problemLabel->setVisible(!d->problem.isEmpty()); } -SeparateDebugInfoAspect::SeparateDebugInfoAspect() +SeparateDebugInfoAspect::SeparateDebugInfoAspect(AspectContainer *container) + : TriStateAspect(container) { setDisplayName(Tr::tr("Separate debug info:")); setSettingsKey("SeparateDebugInfo"); - setValue(ProjectExplorerPlugin::buildPropertiesSettings().separateDebugInfo.value()); + setValue(ProjectExplorerPlugin::buildPropertiesSettings().separateDebugInfo()); } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/buildaspects.h b/src/plugins/projectexplorer/buildaspects.h index 10043b4ec62..5471ce893ae 100644 --- a/src/plugins/projectexplorer/buildaspects.h +++ b/src/plugins/projectexplorer/buildaspects.h @@ -41,7 +41,7 @@ class PROJECTEXPLORER_EXPORT SeparateDebugInfoAspect : public Utils::TriStateAsp { Q_OBJECT public: - SeparateDebugInfoAspect(); + SeparateDebugInfoAspect(Utils::AspectContainer *container = nullptr); }; } // namespace ProjectExplorer diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index 52dd6fb9933..2e7d725ef51 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -98,7 +98,7 @@ QbsBuildConfiguration::QbsBuildConfiguration(Target *target, Utils::Id id) + '_' + kit->fileSystemFriendlyName().left(8) + '_' + hash.toHex().left(16); - m_configurationName->setValue(uniqueConfigName); + configurationName.setValue(uniqueConfigName); auto bs = buildSteps()->firstOfType<QbsBuildStep>(); QTC_ASSERT(bs, return); @@ -107,25 +107,21 @@ QbsBuildConfiguration::QbsBuildConfiguration(Target *target, Utils::Id id) emit qbsConfigurationChanged(); }); - m_configurationName = addAspect<StringAspect>(); - m_configurationName->setLabelText(QbsProjectManager::Tr::tr("Configuration name:")); - m_configurationName->setSettingsKey("Qbs.configName"); - m_configurationName->setDisplayStyle(StringAspect::LineEditDisplay); - connect(m_configurationName, &StringAspect::changed, + configurationName.setSettingsKey("Qbs.configName"); + configurationName.setLabelText(QbsProjectManager::Tr::tr("Configuration name:")); + configurationName.setDisplayStyle(StringAspect::LineEditDisplay); + connect(&configurationName, &StringAspect::changed, this, &BuildConfiguration::buildDirectoryChanged); - const auto separateDebugInfoAspect = addAspect<SeparateDebugInfoAspect>(); - connect(separateDebugInfoAspect, &SeparateDebugInfoAspect::changed, + connect(&separateDebugInfoSetting, &BaseAspect::changed, this, &QbsBuildConfiguration::qbsConfigurationChanged); - const auto qmlDebuggingAspect = addAspect<QtSupport::QmlDebuggingAspect>(); - qmlDebuggingAspect->setBuildConfiguration(this); - connect(qmlDebuggingAspect, &QtSupport::QmlDebuggingAspect::changed, + qmlDebuggingSetting.setBuildConfiguration(this); + connect(&qmlDebuggingSetting, &BaseAspect::changed, this, &QbsBuildConfiguration::qbsConfigurationChanged); - const auto qtQuickCompilerAspect = addAspect<QtSupport::QtQuickCompilerAspect>(); - qtQuickCompilerAspect->setBuildConfiguration(this); - connect(qtQuickCompilerAspect, &QtSupport::QtQuickCompilerAspect::changed, + qtQuickCompilerSetting.setBuildConfiguration(this); + connect(&qtQuickCompilerSetting, &BaseAspect::changed, this, &QbsBuildConfiguration::qbsConfigurationChanged); connect(this, &BuildConfiguration::environmentChanged, @@ -171,11 +167,11 @@ bool QbsBuildConfiguration::fromMap(const QVariantMap &map) if (!BuildConfiguration::fromMap(map)) return false; - if (m_configurationName->value().isEmpty()) { // pre-4.4 backwards compatibility + if (configurationName().isEmpty()) { // pre-4.4 backwards compatibility const QString profileName = QbsProfileManager::profileNameForKit(target()->kit()); const QString buildVariant = qbsConfiguration() .value(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY)).toString(); - m_configurationName->setValue(profileName + '-' + buildVariant); + configurationName.setValue(profileName + '-' + buildVariant); } return true; @@ -251,11 +247,6 @@ QStringList QbsBuildConfiguration::products() const return m_products; } -QString QbsBuildConfiguration::configurationName() const -{ - return m_configurationName->value(); -} - QString QbsBuildConfiguration::equivalentCommandLine(const QbsBuildStepData &stepData) const { CommandLine commandLine; @@ -302,21 +293,6 @@ QString QbsBuildConfiguration::equivalentCommandLine(const QbsBuildStepData &ste return commandLine.arguments(); } -TriState QbsBuildConfiguration::qmlDebuggingSetting() const -{ - return aspect<QtSupport::QmlDebuggingAspect>()->value(); -} - -TriState QbsBuildConfiguration::qtQuickCompilerSetting() const -{ - return aspect<QtSupport::QtQuickCompilerAspect>()->value(); -} - -TriState QbsBuildConfiguration::separateDebugInfoSetting() const -{ - return aspect<SeparateDebugInfoAspect>()->value(); -} - // --------------------------------------------------------------------------- // QbsBuildConfigurationFactory: // --------------------------------------------------------------------------- diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h index 89ee9624371..8fdeb2ba550 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h @@ -60,12 +60,12 @@ public: void setProducts(const QStringList &products); QStringList products() const; - QString configurationName() const; QString equivalentCommandLine(const QbsBuildStepData &stepData) const; - Utils::TriState qmlDebuggingSetting() const; - Utils::TriState qtQuickCompilerSetting() const; - Utils::TriState separateDebugInfoSetting() const; + Utils::StringAspect configurationName{this}; + ProjectExplorer::SeparateDebugInfoAspect separateDebugInfoSetting{this}; + QtSupport::QmlDebuggingAspect qmlDebuggingSetting{this}; + QtSupport::QtQuickCompilerAspect qtQuickCompilerSetting{this}; signals: void qbsConfigurationChanged(); @@ -78,7 +78,6 @@ private: QStringList m_changedFiles; QStringList m_activeFileTags; QStringList m_products; - Utils::StringAspect *m_configurationName = nullptr; QbsBuildSystem *m_buildSystem = nullptr; }; From 87dcd7ce34d6ef6b11e910501a566765ad10b84b Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 13 Jul 2023 01:09:48 +0200 Subject: [PATCH 0332/1777] TarPackageCreationStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: Ic37e7047e063ff9e024e2d53a81f6bd310d545c1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../remotelinux/tarpackagecreationstep.cpp | 90 +++++++++---------- 1 file changed, 42 insertions(+), 48 deletions(-) diff --git a/src/plugins/remotelinux/tarpackagecreationstep.cpp b/src/plugins/remotelinux/tarpackagecreationstep.cpp index fb169b51fc5..4654d3f7302 100644 --- a/src/plugins/remotelinux/tarpackagecreationstep.cpp +++ b/src/plugins/remotelinux/tarpackagecreationstep.cpp @@ -25,6 +25,7 @@ #include <cstring> using namespace ProjectExplorer; +using namespace Tasking; using namespace Utils; namespace RemoteLinux::Internal { @@ -60,8 +61,7 @@ public: private: bool init() final; - void doRun() final; - void doCancel() final; + GroupItem runRecipe() final; bool fromMap(const QVariantMap &map) final; QVariantMap toMap() const final; QVariant data(Id id) const final; @@ -71,9 +71,9 @@ private: bool isPackagingNeeded() const; void deployFinished(bool success); void addNeededDeploymentFiles(const DeployableFile &deployable, const Kit *kit); - void doPackage(QPromise<bool> &promise, const Utils::FilePath &tarFilePath, + void doPackage(QPromise<void> &promise, const Utils::FilePath &tarFilePath, bool ignoreMissingFiles); - bool appendFile(QPromise<bool> &promise, QFile &tarFile, const QFileInfo &fileInfo, + bool appendFile(QPromise<void> &promise, QFile &tarFile, const QFileInfo &fileInfo, const QString &remoteFilePath, const Utils::FilePath &tarFilePath, bool ignoreMissingFiles); @@ -129,48 +129,41 @@ bool TarPackageCreationStep::init() return true; } -void TarPackageCreationStep::doRun() +GroupItem TarPackageCreationStep::runRecipe() { - const QList<DeployableFile> &files = target()->deploymentData().allFiles(); - - if (m_incrementalDeployment()) { - m_files.clear(); - for (const DeployableFile &file : files) - addNeededDeploymentFiles(file, kit()); - } else { - m_files = files; - } - - emit addOutput(Tr::tr("Creating tarball..."), OutputFormat::NormalMessage); - if (!m_packagingNeeded) { - emit addOutput(Tr::tr("Tarball up to date, skipping packaging."), OutputFormat::NormalMessage); - emit finished(true); - return; - } - - auto * const watcher = new QFutureWatcher<bool>(this); - connect(watcher, &QFutureWatcher<bool>::finished, this, [this, watcher] { - const bool success = !watcher->isCanceled() && watcher->result(); - if (success) { - m_deploymentDataModified = false; - emit addOutput(Tr::tr("Packaging finished successfully."), OutputFormat::NormalMessage); + const auto onSetup = [this](Async<void> &async) { + const QList<DeployableFile> &files = target()->deploymentData().allFiles(); + if (m_incrementalDeployment()) { + m_files.clear(); + for (const DeployableFile &file : files) + addNeededDeploymentFiles(file, kit()); } else { - emit addOutput(Tr::tr("Packaging failed."), OutputFormat::ErrorMessage); + m_files = files; } - emit finished(success); - watcher->deleteLater(); + + emit addOutput(Tr::tr("Creating tarball..."), OutputFormat::NormalMessage); + if (!m_packagingNeeded) { + emit addOutput(Tr::tr("Tarball up to date, skipping packaging."), + OutputFormat::NormalMessage); + return SetupResult::StopWithDone; + } + + async.setConcurrentCallData(&TarPackageCreationStep::doPackage, this, + m_tarFilePath, m_ignoreMissingFiles()); + async.setFutureSynchronizer(&m_synchronizer); + return SetupResult::Continue; + }; + const auto onDone = [this](const Async<void> &) { + m_deploymentDataModified = false; + emit addOutput(Tr::tr("Packaging finished successfully."), OutputFormat::NormalMessage); + // TODO: Should it be the next task in sequence? connect(BuildManager::instance(), &BuildManager::buildQueueFinished, this, &TarPackageCreationStep::deployFinished); - }); - auto future = Utils::asyncRun(&TarPackageCreationStep::doPackage, this, - m_tarFilePath, m_ignoreMissingFiles()); - watcher->setFuture(future); - m_synchronizer.addFuture(future); -} - -void TarPackageCreationStep::doCancel() -{ - m_synchronizer.cancelAllFutures(); + }; + const auto onError = [this](const Async<void> &) { + emit addOutput(Tr::tr("Packaging failed."), OutputFormat::ErrorMessage); + }; + return AsyncTask<void>(onSetup, onDone, onError); } bool TarPackageCreationStep::fromMap(const QVariantMap &map) @@ -266,7 +259,9 @@ void TarPackageCreationStep::addNeededDeploymentFiles( } } -void TarPackageCreationStep::doPackage(QPromise<bool> &promise, const FilePath &tarFilePath, +// TODO: Fix error / message reporting. Currently, the messages may still be posted +// (and delivered) after the async task was already canceled. +void TarPackageCreationStep::doPackage(QPromise<void> &promise, const FilePath &tarFilePath, bool ignoreMissingFiles) { // TODO: Optimization: Only package changed files @@ -275,7 +270,7 @@ void TarPackageCreationStep::doPackage(QPromise<bool> &promise, const FilePath & if (!tarFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { raiseError(Tr::tr("Error: tar file %1 cannot be opened (%2).") .arg(tarFilePath.toUserOutput(), tarFile.errorString())); - promise.addResult(false); + promise.future().cancel(); return; } @@ -289,19 +284,18 @@ void TarPackageCreationStep::doPackage(QPromise<bool> &promise, const FilePath & if (!appendFile(promise, tarFile, fileInfo, d.remoteDirectory() + QLatin1Char('/') + fileInfo.fileName(), tarFilePath, ignoreMissingFiles)) { - promise.addResult(false); + promise.future().cancel(); return; } } - const QByteArray eofIndicator(2*sizeof(TarFileHeader), 0); + const QByteArray eofIndicator(2 * sizeof(TarFileHeader), 0); if (tarFile.write(eofIndicator) != eofIndicator.length()) { raiseError(Tr::tr("Error writing tar file \"%1\": %2.") .arg(QDir::toNativeSeparators(tarFile.fileName()), tarFile.errorString())); - promise.addResult(false); + promise.future().cancel(); return; } - promise.addResult(true); } static bool setFilePath(TarFileHeader &header, const QByteArray &filePath) @@ -383,7 +377,7 @@ static bool writeHeader(QFile &tarFile, const QFileInfo &fileInfo, const QString return true; } -bool TarPackageCreationStep::appendFile(QPromise<bool> &promise, +bool TarPackageCreationStep::appendFile(QPromise<void> &promise, QFile &tarFile, const QFileInfo &fileInfo, const QString &remoteFilePath, From ed35f78197bfae9d330c497659dfc94d21aef18d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 12:23:25 +0200 Subject: [PATCH 0333/1777] ProjectExplorer: Allow X11Forwarding also to Windows hosts Probably a rare setup, but nothing fundamentally wrong with it. Change-Id: I3f2719aff2bbfef29c166c0ab784f89ab7442ec3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/runconfigurationaspects.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 1e7bc6f05b0..3b5d8649b46 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -918,7 +918,6 @@ X11ForwardingAspect::X11ForwardingAspect(AspectContainer *container) makeCheckable(CheckBoxPlacement::Right, Tr::tr("Forward to local display"), "RunConfiguration.UseX11Forwarding"); setValue(defaultDisplay()); - setVisible(HostOsInfo::isAnyUnixHost()); addDataExtractor(this, &X11ForwardingAspect::display, &Data::display); } From c43a2ee1c4ce30e2a00a388928aad3d2fdb2c53e Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 13 Jul 2023 16:23:53 +0200 Subject: [PATCH 0334/1777] Use categories for Tutorials page Instead of adding the category into the title with "Help: ..." etc, use the actual categorized view that we already use for examples and marketplace. Set the corresponding meta data in the manifest file and read it also for tutorials. Change-Id: Id9081518c1c0afee8d080af3ca8a5dca5cdde775 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/qtsupport/exampleslistmodel.cpp | 20 +- src/plugins/qtsupport/examplesparser.cpp | 33 +-- src/plugins/qtsupport/examplesparser.h | 5 +- src/plugins/qtsupport/qtcreator_tutorials.xml | 245 ++++++++++++++---- tests/auto/examples/tst_examples.cpp | 25 +- 5 files changed, 251 insertions(+), 77 deletions(-) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 5beb9c80a35..b1914350d3e 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -325,6 +325,21 @@ static bool isValidExampleOrDemo(ExampleItem *item) return ok || debugExamples(); } +// ordered list of "known" categories +// TODO this should be defined in the manifest +Q_GLOBAL_STATIC_WITH_ARGS(QStringList, + defaultOrder, + {QStringList() << "Application Examples" + << "Desktop" + << "Mobile" + << "Embedded" + << "Graphics" + << "Input/Output" + << "Connectivity" + << "Networking" + << "Positioning & Location" + << "Internationalization"}); + void ExamplesViewController::updateExamples() { QString examplesInstallPath; @@ -366,9 +381,10 @@ void ExamplesViewController::updateExamples() } } - const bool sortIntoCategories = qtVersion >= *minQtVersionForCategories; + const bool sortIntoCategories = !m_isExamples || qtVersion >= *minQtVersionForCategories; + const QStringList order = m_isExamples ? *defaultOrder : QStringList(); const QList<std::pair<Section, QList<ExampleItem *>>> sections - = getCategories(items, sortIntoCategories); + = getCategories(items, sortIntoCategories, order, m_isExamples); for (int i = 0; i < sections.size(); ++i) { m_view->addSection(sections.at(i).first, static_container_cast<ListItem *>(sections.at(i).second)); diff --git a/src/plugins/qtsupport/examplesparser.cpp b/src/plugins/qtsupport/examplesparser.cpp index d115dcf3fe0..f961846e1d7 100644 --- a/src/plugins/qtsupport/examplesparser.cpp +++ b/src/plugins/qtsupport/examplesparser.cpp @@ -215,7 +215,8 @@ static QList<ExampleItem *> parseTutorials(QXmlStreamReader *reader, const FileP QXmlStreamAttributes attributes = reader->attributes(); item->name = attributes.value(QLatin1String("name")).toString(); const QString projectPath = attributes.value(QLatin1String("projectPath")).toString(); - item->projectPath = projectsOffset / projectPath; + item->projectPath = projectPath.isEmpty() ? FilePath() + : projectsOffset / projectPath; item->hasSourceCode = !projectPath.isEmpty(); item->imageUrl = Utils::StyleHelper::dpiSpecificImageFile( attributes.value(QLatin1String("imageUrl")).toString()); @@ -239,6 +240,8 @@ static QList<ExampleItem *> parseTutorials(QXmlStreamReader *reader, const FileP } else if (reader->name() == QLatin1String("tags")) { item->tags = reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement) .split(QLatin1Char(',')); + } else if (reader->name() == QLatin1String("meta")) { + item->metaData = parseMeta(reader); } break; case QXmlStreamReader::EndElement: @@ -301,21 +304,6 @@ expected_str<QList<ExampleItem *>> parseExamples(const QByteArray &manifestData, return items; } -// ordered list of "known" categories -// TODO this should be defined in the manifest -Q_GLOBAL_STATIC_WITH_ARGS(QList<QString>, - defaultOrder, - {QStringList() << "Application Examples" - << "Desktop" - << "Mobile" - << "Embedded" - << "Graphics" - << "Input/Output" - << "Connectivity" - << "Networking" - << "Positioning & Location" - << "Internationalization"}); - static bool sortByHighlightedAndName(ExampleItem *first, ExampleItem *second) { if (first->isHighlighted && !second->isHighlighted) @@ -326,7 +314,9 @@ static bool sortByHighlightedAndName(ExampleItem *first, ExampleItem *second) } QList<std::pair<Core::Section, QList<ExampleItem *>>> getCategories(const QList<ExampleItem *> &items, - bool sortIntoCategories) + bool sortIntoCategories, + const QStringList &defaultOrder, + bool restrictRows) { static const QString otherDisplayName = Tr::tr("Other", "Category for all other examples"); const bool useCategories = sortIntoCategories @@ -365,14 +355,17 @@ QList<std::pair<Core::Section, QList<ExampleItem *>>> getCategories(const QList< } else { // All original items have been copied into a category or other, delete. qDeleteAll(items); - static const int defaultOrderSize = defaultOrder->size(); + static const int defaultOrderSize = defaultOrder.size(); int index = 0; const auto end = categoryMap.constKeyValueEnd(); for (auto it = categoryMap.constKeyValueBegin(); it != end; ++it) { // order "known" categories as wanted, others come afterwards - const int defaultIndex = defaultOrder->indexOf(it->first); + const int defaultIndex = defaultOrder.indexOf(it->first); const int priority = defaultIndex >= 0 ? defaultIndex : (index + defaultOrderSize); - categories.append({{it->first, priority, /*maxRows=*/index == 0 ? 2 : 1}, it->second}); + const std::optional<int> maxRows = restrictRows + ? std::make_optional<int>(index == 0 ? 2 : 1) + : std::nullopt; + categories.append({{it->first, priority, maxRows}, it->second}); ++index; } if (!other.isEmpty()) diff --git a/src/plugins/qtsupport/examplesparser.h b/src/plugins/qtsupport/examplesparser.h index 54efaf58875..d57e7a536ad 100644 --- a/src/plugins/qtsupport/examplesparser.h +++ b/src/plugins/qtsupport/examplesparser.h @@ -45,7 +45,10 @@ QTSUPPORT_TEST_EXPORT Utils::expected_str<QList<ExampleItem *>> parseExamples( bool examples); QTSUPPORT_TEST_EXPORT QList<std::pair<Core::Section, QList<ExampleItem *>>> getCategories( - const QList<ExampleItem *> &items, bool sortIntoCategories); + const QList<ExampleItem *> &items, + bool sortIntoCategories, + const QStringList &defaultOrder, + bool restrictRows); } // namespace QtSupport::Internal diff --git a/src/plugins/qtsupport/qtcreator_tutorials.xml b/src/plugins/qtsupport/qtcreator_tutorials.xml index 5f56f7501b7..f374f1b6301 100644 --- a/src/plugins/qtsupport/qtcreator_tutorials.xml +++ b/src/plugins/qtsupport/qtcreator_tutorials.xml @@ -1,196 +1,337 @@ <?xml version="1.0" encoding="utf-8"?> <instructionals module="Qt"> <tutorials> - <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/creator-build-example-application.html" projectPath="" name="Help: Building and Running an Example"> + <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/creator-build-example-application.html" projectPath="" name="Building and Running an Example"> <description><![CDATA[Testing that your installation is successful by opening an existing example application project.]]></description> <tags>qt creator,build,compile,help</tags> + <meta> + <entry name="category">Help</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/creator-writing-program.html" projectPath="" name="Help: Creating a Qt Widget-Based Application"> + <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/creator-writing-program.html" projectPath="" name="Creating a Qt Widget-Based Application"> <description><![CDATA[Using Qt Creator to create a small Qt application, Text Finder.]]></description> <tags>qt creator,qt designer,widgets,c++,text,help</tags> + <meta> + <entry name="category">Help</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtdoc/qtwidgets/qtwidgets-tutorials-notepad-example.html" projectPath="" name="Help: Getting Started Programming with Qt Widgets"> + <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtdoc/qtwidgets/qtwidgets-tutorials-notepad-example.html" projectPath="" name="Getting Started Programming with Qt Widgets"> <description><![CDATA[Developing Qt applications using C++ and the Qt Widgets module.]]></description> <tags>qt,qt creator,qt designer,widgets,c++,help</tags> + <meta> + <entry name="category">Help</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/qtcreator-transitions-example.html" projectPath="" name="Help: Creating a Qt Quick Application"> + <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/qtcreator-transitions-example.html" projectPath="" name="Creating a Qt Quick Application"> <description><![CDATA[Using basic QML types and learning about basic concepts of Qt Quick.]]></description> <tags>qt creator,qt quick,qml,states,transitions,help</tags> + <meta> + <entry name="category">Help</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/qtcreator-accelbubble-example.html" projectPath="" name="Help: Creating a Mobile Qt Application"> + <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/qtcreator-accelbubble-example.html" projectPath="" name="Creating a Mobile Qt Application"> <description><![CDATA[Developing Qt Quick applications for Android and iOS devices.]]></description> <tags>qt creator,qml,android,ios,controls,help</tags> + <meta> + <entry name="category">Help</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtdoc/qtdoc/qtdoc-tutorials-alarms-example.html" projectPath="" name="Help: Getting Started Programming with Qt Quick"> + <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtdoc/qtdoc/qtdoc-tutorials-alarms-example.html" projectPath="" name="Getting Started Programming with Qt Quick"> <description><![CDATA[Developing Qt Quick applications using Qt Quick and Qt Quick Controls.]]></description> <tags>qt quick,controls,tumbler,help</tags> + <meta> + <entry name="category">Help</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubehOx3dod5-1A.webp" difficulty="" projectPath="" name="Learning: Qt Creator - UI Tour and the Welcome screen" isVideo="true" videoUrl="https://www.youtube.com/watch?v=hOx3dod5-1A" videoLength="3:21"> + <tutorial imageUrl=":qtsupport/images/icons/youtubehOx3dod5-1A.webp" difficulty="" projectPath="" name="Qt Creator - UI Tour and the Welcome screen" isVideo="true" videoUrl="https://www.youtube.com/watch?v=hOx3dod5-1A" videoLength="3:21"> <description><![CDATA[The parts of the Qt Creator UI and the Welcome mode.]]></description> <tags>qt creator,learning,ui,welcome,2023</tags> + <meta> + <entry name="category">Learning</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeFTSvDmcAgPI.webp" difficulty="" projectPath="" name="Learning: Qt Creator - Create a new project" isVideo="true" videoUrl="https://www.youtube.com/watch?v=FTSvDmcAgPI" videoLength="3:21"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeFTSvDmcAgPI.webp" difficulty="" projectPath="" name="Qt Creator - Create a new project" isVideo="true" videoUrl="https://www.youtube.com/watch?v=FTSvDmcAgPI" videoLength="3:21"> <description><![CDATA[Creating a Qt Widgets application project.]]></description> <tags>qt creator,learning,projects,qt widgets,2023</tags> + <meta> + <entry name="category">Learning</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeLnVjI0I7cKs.webp" difficulty="" projectPath="" name="Learning: Qt Creator - Design and Edit Modes" isVideo="true" videoUrl="https://www.youtube.com/watch?v=LnVjI0I7cKs" videoLength="4:34"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeLnVjI0I7cKs.webp" difficulty="" projectPath="" name="Qt Creator - Design and Edit Modes" isVideo="true" videoUrl="https://www.youtube.com/watch?v=LnVjI0I7cKs" videoLength="4:34"> <description><![CDATA[Developing a Qt Widgets application.]]></description> <tags>qt creator,learning,qt designer,coding,2023</tags> + <meta> + <entry name="category">Learning</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeEhJ1eV_6RH8.webp" difficulty="" projectPath="" name="Learning: Qt Creator - Debugging" isVideo="true" videoUrl="https://www.youtube.com/watch?v=EhJ1eV_6RH8" videoLength="3:22"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeEhJ1eV_6RH8.webp" difficulty="" projectPath="" name="Qt Creator - Debugging" isVideo="true" videoUrl="https://www.youtube.com/watch?v=EhJ1eV_6RH8" videoLength="3:22"> <description><![CDATA[Debugging a Qt Widgets application.]]></description> <tags>qt creator,learning,debugging,2023</tags> + <meta> + <entry name="category">Learning</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtube1tSpq5OLkYI.webp" difficulty="" projectPath="" name="Online: How to set up and deploy an application using Qt for Device Creation" isVideo="true" videoUrl="https://youtu.be/1tSpq5OLkYI" videoLength="5:48"> + <tutorial imageUrl=":qtsupport/images/icons/youtube1tSpq5OLkYI.webp" difficulty="" projectPath="" name="How to set up and deploy an application using Qt for Device Creation" isVideo="true" videoUrl="https://youtu.be/1tSpq5OLkYI" videoLength="5:48"> <description><![CDATA[Using Qt Creator to deploy applications to an embedded device.]]></description> <tags>qt creator,embedded,device creation,video,2021</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtube9xqhq9nDiOg.webp" difficulty="" projectPath="" name="Online: Qt SCXML and State Machine Tooling in Qt Creator" isVideo="true" videoUrl="https://youtu.be/9xqhq9nDiOg" videoLength="4:53"> + <tutorial imageUrl=":qtsupport/images/icons/youtube9xqhq9nDiOg.webp" difficulty="" projectPath="" name="Qt SCXML and State Machine Tooling in Qt Creator" isVideo="true" videoUrl="https://youtu.be/9xqhq9nDiOg" videoLength="4:53"> <description><![CDATA[Creating state machines.]]></description> <tags>qt creator,SCXML,video</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtube9BcAYDlpuT8.webp" difficulty="" projectPath="" name="Online: Using C++ Models in QML - To-do List" isVideo="true" videoUrl="https://www.youtube.com/watch?v=9BcAYDlpuT8" videoLength="49:48"> + <tutorial imageUrl=":qtsupport/images/icons/youtube9BcAYDlpuT8.webp" difficulty="" projectPath="" name="Using C++ Models in QML - To-do List" isVideo="true" videoUrl="https://www.youtube.com/watch?v=9BcAYDlpuT8" videoLength="49:48"> <description><![CDATA[Creating and using a C++ model in QML.]]></description> <tags>qt creator,qt quick,c++,video</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubezAqSiIGdj8M.webp" difficulty="" projectPath="" name="Online: Qt Creator - Meet Qt Creator" isVideo="true" videoUrl="https://youtu.be/zAqSiIGdj8M" videoLength="2:06"> + <tutorial imageUrl=":qtsupport/images/icons/youtubezAqSiIGdj8M.webp" difficulty="" projectPath="" name="Qt Creator - Meet Qt Creator" isVideo="true" videoUrl="https://youtu.be/zAqSiIGdj8M" videoLength="2:06"> <description><![CDATA[Overview of Qt Creator.]]></description> <tags>qt creator,video</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeR6zWLfHIYJw.webp" difficulty="" projectPath="" name="Online: Qt Creator - Examples" isVideo="true" videoUrl="https://www.youtube.com/watch?v=R6zWLfHIYJw" videoLength="9:29"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeR6zWLfHIYJw.webp" difficulty="" projectPath="" name="Qt Creator - Examples" isVideo="true" videoUrl="https://www.youtube.com/watch?v=R6zWLfHIYJw" videoLength="9:29"> <description><![CDATA[Using Qt Creator tutorials and examples to develop Qt applications.]]></description> <tags>qt creator,video,2018</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeuuhmSZxK1mk.webp" difficulty="" projectPath="" name="Online: Qt Creator - Introduction to Qt Quick Controls" isVideo="true" videoUrl="https://www.youtube.com/watch?v=uuhmSZxK1mk" videoLength="7:09"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeuuhmSZxK1mk.webp" difficulty="" projectPath="" name="Qt Creator - Introduction to Qt Quick Controls" isVideo="true" videoUrl="https://www.youtube.com/watch?v=uuhmSZxK1mk" videoLength="7:09"> <description><![CDATA[Using Qt Quick Controls to develop Qt Quick applications.]]></description> <tags>qt creator,qt quick,controls,video,2018</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeY-MM-9FigTc.webp" difficulty="" projectPath="" name="Online: Debugging inside Qt Creator" isVideo="true" videoUrl="https://youtu.be/Y-MM-9FigTc" videoLength="21:54"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeY-MM-9FigTc.webp" difficulty="" projectPath="" name="Debugging inside Qt Creator" isVideo="true" videoUrl="https://youtu.be/Y-MM-9FigTc" videoLength="21:54"> <description><![CDATA[Debugging applications in Qt Creator.]]></description> - <tags>qt creator,debugging,2021</tags> + <tags>qt creator,debugging,video,2021</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubexNIz78IPBu0.webp" difficulty="" projectPath="" name="Online: How to do translations with Qt Linguist" isVideo="true" videoUrl="https://youtu.be/xNIz78IPBu0" videoLength="9:14"> + <tutorial imageUrl=":qtsupport/images/icons/youtubexNIz78IPBu0.webp" difficulty="" projectPath="" name="How to do translations with Qt Linguist" isVideo="true" videoUrl="https://youtu.be/xNIz78IPBu0" videoLength="9:14"> <description><![CDATA[Preparing applications for translation, translating them with Qt Linguist, and using the translations in apps.]]></description> - <tags>qt creator,qt linguist,translation,2021</tags> + <tags>qt creator,qt linguist,translation,video,2021</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtube-xhiVA0P4yk.webp" difficulty="" projectPath="" name="Online: Qt Windows Online Installer walkthrough" isVideo="true" videoUrl="https://youtu.be/-xhiVA0P4yk" videoLength="6:17"> + <tutorial imageUrl=":qtsupport/images/icons/youtube-xhiVA0P4yk.webp" difficulty="" projectPath="" name="Qt Windows Online Installer walkthrough" isVideo="true" videoUrl="https://youtu.be/-xhiVA0P4yk" videoLength="6:17"> <description><![CDATA[Downloading and installing Qt with the options that you want.]]></description> <tags>qt,installation,online installer,modules,video,2021</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeYJfFwDBOvqk.webp" difficulty="" projectPath="" name="Online: How to install and set up Qt for Device Creation on Linux" isVideo="true" videoUrl="https://youtu.be/YJfFwDBOvqk" videoLength="6:52"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeYJfFwDBOvqk.webp" difficulty="" projectPath="" name="How to install and set up Qt for Device Creation on Linux" isVideo="true" videoUrl="https://youtu.be/YJfFwDBOvqk" videoLength="6:52"> <description><![CDATA[Downloading and installing Qt Device Creation with the options that you want.]]></description> - <tags>embedded,installation,device creation,2021</tags> + <tags>embedded,installation,device creation,video,2021</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubejbx3Oq1Q4gY.webp" difficulty="" projectPath="" name="Online: Creating a simple widget app" isVideo="true" videoUrl="https://youtu.be/jbx3Oq1Q4gY" videoLength="6:08"> + <tutorial imageUrl=":qtsupport/images/icons/youtubejbx3Oq1Q4gY.webp" difficulty="" projectPath="" name="Creating a simple widget app" isVideo="true" videoUrl="https://youtu.be/jbx3Oq1Q4gY" videoLength="6:08"> <description><![CDATA[Creating a simple widget-based application and running it on your development machine using Qt Creator 5.0.]]></description> - <tags>qt creator,widgets,2021</tags> + <tags>qt creator,widgets,video,2021</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtube2RvhhEAZQxM.webp" difficulty="" projectPath="" name="Online: Qt Widgets or Qt Quick" isVideo="true" videoUrl="https://youtu.be/2RvhhEAZQxM" videoLength="5:00"> + <tutorial imageUrl=":qtsupport/images/icons/youtube2RvhhEAZQxM.webp" difficulty="" projectPath="" name="Qt Widgets or Qt Quick" isVideo="true" videoUrl="https://youtu.be/2RvhhEAZQxM" videoLength="5:00"> <description><![CDATA[Learning the differences between Qt Widgets and Qt Quick and making the right choice for your application needs.]]></description> <tags>qt quick,widgets,ui,video,2021</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeDRFz0Tll4G8.webp" difficulty="" projectPath="" name="Online: How to install and set up Qt for MCUs" isVideo="true" videoUrl="https://youtu.be/DRFz0Tll4G8" videoLength="8:29"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeDRFz0Tll4G8.webp" difficulty="" projectPath="" name="How to install and set up Qt for MCUs" isVideo="true" videoUrl="https://youtu.be/DRFz0Tll4G8" videoLength="8:29"> <description><![CDATA[Downloading and installing Qt for MCUs with the options that you want.]]></description> <tags>qt,mcus,video,STM32H750B-DISCOVERY,2021</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeBkgjJfxYN20.webp" difficulty="" projectPath="" name="Online: How to build your first 'Qt for MCUs' application" isVideo="true" videoUrl="https://youtu.be/BkgjJfxYN20" videoLength="21:54"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeBkgjJfxYN20.webp" difficulty="" projectPath="" name="How to build your first 'Qt for MCUs' application" isVideo="true" videoUrl="https://youtu.be/BkgjJfxYN20" videoLength="21:54"> <description><![CDATA[Building your first application for the NXP IMXRT1050 device.]]></description> <tags>qtformcus,mcus,qt,video,NXP IMXRT1050-EVKB,2020</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubemn-JmXIMCqk.webp" difficulty="" projectPath="" name="Online: How to create a simple application with Qt for MCUs" isVideo="true" videoUrl="https://youtu.be/mn-JmXIMCqk" videoLength="5:16"> + <tutorial imageUrl=":qtsupport/images/icons/youtubemn-JmXIMCqk.webp" difficulty="" projectPath="" name="How to create a simple application with Qt for MCUs" isVideo="true" videoUrl="https://youtu.be/mn-JmXIMCqk" videoLength="5:16"> <description><![CDATA[Creating a simple Qt for MCUs application and running it on your development machine using Qt Creator 5.0.]]></description> <tags>qtformcus,mcus,qt,video,2021</tags> + <meta> + <entry name="category">Online</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeKo3DuCgFamo.webp" difficulty="" projectPath="" name="Talk: Custom Qt Creator Wizards" isVideo="true" videoUrl="https://www.youtube.com/watch?v=Ko3DuCgFamo" videoLength="27:21"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeKo3DuCgFamo.webp" difficulty="" projectPath="" name="Custom Qt Creator Wizards" isVideo="true" videoUrl="https://www.youtube.com/watch?v=Ko3DuCgFamo" videoLength="27:21"> <description><![CDATA[Adding custom file and project creation wizards to Qt Creator.]]></description> <tags>qt creator,wizard,talk,2015</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeDP0lMoLVneY.webp" difficulty="" projectPath="" name="Talk: Extending Qt Creator" isVideo="true" videoUrl="http://www.youtube.com/watch?v=DP0lMoLVneY" videoLength="59:49"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeDP0lMoLVneY.webp" difficulty="" projectPath="" name="Extending Qt Creator" isVideo="true" videoUrl="http://www.youtube.com/watch?v=DP0lMoLVneY" videoLength="59:49"> <description><![CDATA[Customizing Qt Creator to fit your own or your customers' purposes.]]></description> <tags>qt creator,configuration,talk,2013</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubePzV2MYRAUYQ.webp" difficulty="" projectPath="" name="Talk: How to create a plugin for Qt Creator" isVideo="true" videoUrl="https://youtu.be/PzV2MYRAUYQ" videoLength="55:37"> + <tutorial imageUrl=":qtsupport/images/icons/youtubePzV2MYRAUYQ.webp" difficulty="" projectPath="" name="How to create a plugin for Qt Creator" isVideo="true" videoUrl="https://youtu.be/PzV2MYRAUYQ" videoLength="55:37"> <description><![CDATA[Adding plugins to Qt Creator.]]></description> <tags>qt creator,plugins,talk,2019</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeTiJiF0MOOFc.webp" difficulty="" projectPath="" name="Talk: Qt Creator - Using the QML Profiler" isVideo="true" videoUrl="https://www.youtube.com/watch?v=TiJiF0MOOFc" videoLength="55:12"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeTiJiF0MOOFc.webp" difficulty="" projectPath="" name="Qt Creator - Using the QML Profiler" isVideo="true" videoUrl="https://www.youtube.com/watch?v=TiJiF0MOOFc" videoLength="55:12"> <description><![CDATA[Monitoring the performance of a Qt Quick application.]]></description> - <tags>qt quick,qt creator,qml profiler,talk,2014</tags> + <tags>qt quick,qt creator,qml profiler,talk,2014</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeG0AbgVHGdXI.webp" difficulty="" projectPath="" name="Talk: The CPU Usage Analyzer for Device Creation" isVideo="true" videoUrl="https://www.youtube.com/watch?v=G0AbgVHGdXI" videoLength="22:30"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeG0AbgVHGdXI.webp" difficulty="" projectPath="" name="The CPU Usage Analyzer for Device Creation" isVideo="true" videoUrl="https://www.youtube.com/watch?v=G0AbgVHGdXI" videoLength="22:30"> <description><![CDATA[Using the Linux perf tool to generate data for code analysis.]]></description> <tags>qt creator,cpu usage analyzer,perf,embedded,device creation,talk,2015</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeX0kEkB0ewyw.webp" difficulty="" projectPath="" name="Talk: Qt SCXML - State Machines Made Easier" isVideo="true" videoUrl="https://youtu.be/X0kEkB0ewyw" videoLength="42:22"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeX0kEkB0ewyw.webp" difficulty="" projectPath="" name="Qt SCXML - State Machines Made Easier" isVideo="true" videoUrl="https://youtu.be/X0kEkB0ewyw" videoLength="42:22"> <description><![CDATA[Using the Qt SCXML module and Qt Creator SCXML editor.]]></description> <tags>qt creator,scxml,talk,2016</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubev4glCQt2jE0.webp" difficulty="" projectPath="" name="Talk: Effective Multi-Platform Development with Qt Creator, QBS, and QEMU" isVideo="true" videoUrl="https://www.youtube.com/watch?v=v4glCQt2jE0" videoLength="19:08"> + <tutorial imageUrl=":qtsupport/images/icons/youtubev4glCQt2jE0.webp" difficulty="" projectPath="" name="Effective Multi-Platform Development with Qt Creator, QBS, and QEMU" isVideo="true" videoUrl="https://www.youtube.com/watch?v=v4glCQt2jE0" videoLength="19:08"> <description><![CDATA[Using Qt Creator, Qbs, and QEMU for application development.]]></description> <tags>qt creator,qbs,qemu,talk,2015</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeT_13aX5NTPk.webp" difficulty="" projectPath="" name="Talk: Qt for iOS - A to Z" isVideo="true" videoUrl="https://youtu.be/T_13aX5NTPk" videoLength="1:00:13"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeT_13aX5NTPk.webp" difficulty="" projectPath="" name="Qt for iOS - A to Z" isVideo="true" videoUrl="https://youtu.be/T_13aX5NTPk" videoLength="1:00:13"> <description><![CDATA[Developing Qt applications for iOS.]]></description> <tags>qt creator,ios,talk,2016</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubehrKz63Q_Rf0.webp" difficulty="" projectPath="" name="Talk: Qt Creator for Bare Metal Development" isVideo="true" videoUrl="http://www.youtube.com/watch?v=hrKz63Q_Rf0" videoLength="9:35"> + <tutorial imageUrl=":qtsupport/images/icons/youtubehrKz63Q_Rf0.webp" difficulty="" projectPath="" name="Qt Creator for Bare Metal Development" isVideo="true" videoUrl="http://www.youtube.com/watch?v=hrKz63Q_Rf0" videoLength="9:35"> <description><![CDATA[Developing Qt Applications for Bare Metal devices.]]></description> <tags>qt creator,baremetal,talk,2013</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeWIRRoPxIerc.webp" difficulty="" projectPath="" name="Talk: The Curse of Choice - An Overview of GUI Technologies in Qt" isVideo="true" videoUrl="https://youtu.be/WIRRoPxIerc" videoLength="40:45"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeWIRRoPxIerc.webp" difficulty="" projectPath="" name="The Curse of Choice - An Overview of GUI Technologies in Qt" isVideo="true" videoUrl="https://youtu.be/WIRRoPxIerc" videoLength="40:45"> <description><![CDATA[Overview of UI technologies that can be used with Qt.]]></description> <tags>qt quick,ui,widgets,talk,2016</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubesRihJdZFuCg.webp" difficulty="" projectPath="" name="Talk: Code Once Deploy Everywhere: How Qt is ideal for cross-platform development" isVideo="true" videoUrl="https://youtu.be/sRihJdZFuCg" videoLength="42:37"> + <tutorial imageUrl=":qtsupport/images/icons/youtubesRihJdZFuCg.webp" difficulty="" projectPath="" name="Code Once Deploy Everywhere: How Qt is ideal for cross-platform development" isVideo="true" videoUrl="https://youtu.be/sRihJdZFuCg" videoLength="42:37"> <description><![CDATA[Using Qt Creator for cross-platform development.]]></description> <tags>qt creator,talk,2019</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeW3WC-VpKdGQ.webp" difficulty="" projectPath="" name="Talk: WEBASM with Qt - Qt for WebAssembly" isVideo="true" videoUrl="https://youtu.be/W3WC-VpKdGQ" videoLength="27:50"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeW3WC-VpKdGQ.webp" difficulty="" projectPath="" name="WEBASM with Qt - Qt for WebAssembly" isVideo="true" videoUrl="https://youtu.be/W3WC-VpKdGQ" videoLength="27:50"> <description><![CDATA[Running Qt applications on the Web using Qt for WebAssembly.]]></description> <tags>qt creator,webassembly,emscripten,talk,2019</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeqclquZ99ZVQ.webp" difficulty="" projectPath="" name="Talk: How to Develop with Qt for Multiple Screen Resolutions and Platforms and Best Practices for an Efficient App Lifecycle with Qt" isVideo="true" videoUrl="https://youtu.be/qclquZ99ZVQ" videoLength="27:44"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeqclquZ99ZVQ.webp" difficulty="" projectPath="" name="How to Develop with Qt for Multiple Screen Resolutions and Platforms and Best Practices for an Efficient App Lifecycle with Qt" isVideo="true" videoUrl="https://youtu.be/qclquZ99ZVQ" videoLength="27:44"> <description><![CDATA[Best practices for an efficient app lifecycle.]]></description> <tags>qt,qt quick,screen resolution,ui,talk,2016</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeB0X5FOev9Lw.webp" difficulty="" projectPath="" name="Talk: Qt Designer tutorial: Integrate custom widgets" isVideo="true" videoUrl="https://youtu.be/B0X5FOev9Lw" videoLength="27:07"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeB0X5FOev9Lw.webp" difficulty="" projectPath="" name="Qt Designer tutorial: Integrate custom widgets" isVideo="true" videoUrl="https://youtu.be/B0X5FOev9Lw" videoLength="27:07"> <description><![CDATA[Integrating custom widgets into Qt Designer.]]></description> <tags>qt designer,widgets,ui,talk,2019</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtube3o2Wo4YzlII.webp" difficulty="" projectPath="" name="Talk: Android & iOS - Put Your App on a Diet" isVideo="true" videoUrl="https://www.youtube.com/watch?v=3o2Wo4YzlII" videoLength="23:41"> + <tutorial imageUrl=":qtsupport/images/icons/youtube3o2Wo4YzlII.webp" difficulty="" projectPath="" name="Android & iOS - Put Your App on a Diet" isVideo="true" videoUrl="https://www.youtube.com/watch?v=3o2Wo4YzlII" videoLength="23:41"> <description><![CDATA[Making Android and iOS apps smaller.]]></description> <tags>android,ios,talk,2017</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubev_ynSET9FHU.webp" difficulty="" projectPath="" name="Talk: LTTng for full stack tracing" isVideo="true" videoUrl="https://youtu.be/v_ynSET9FHU" videoLength="25:46"> + <tutorial imageUrl=":qtsupport/images/icons/youtubev_ynSET9FHU.webp" difficulty="" projectPath="" name="LTTng for full stack tracing" isVideo="true" videoUrl="https://youtu.be/v_ynSET9FHU" videoLength="25:46"> <description><![CDATA[Using tracing and profiling to optimize the startup time of apps.]]></description> <tags>qt creator,qml profiler,ctf viewer,lttng,talk,2019</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeau3brB7lNms.webp" difficulty="" projectPath="" name="Talk: No Limits - How to Make a More Complicated Mobile Business App" isVideo="true" videoUrl="https://www.youtube.com/watch?v=au3brB7lNms" videoLength="23:33"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeau3brB7lNms.webp" difficulty="" projectPath="" name="No Limits - How to Make a More Complicated Mobile Business App" isVideo="true" videoUrl="https://www.youtube.com/watch?v=au3brB7lNms" videoLength="23:33"> <description><![CDATA[Creating mobile business apps using Qt Quick Controls 2.]]></description> <tags>android,ios,qt quick,controls,talk,2017</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubeECA8_oLT0ZE.webp" difficulty="" projectPath="" name="Talk: Qt & Yocto, an ECU development workflow" isVideo="true" videoUrl="https://youtu.be/ECA8_oLT0ZE" videoLength="29:08"> + <tutorial imageUrl=":qtsupport/images/icons/youtubeECA8_oLT0ZE.webp" difficulty="" projectPath="" name="Qt & Yocto, an ECU development workflow" isVideo="true" videoUrl="https://youtu.be/ECA8_oLT0ZE" videoLength="29:08"> <description><![CDATA[Using Qt Creator kits and Yocto when developing for embedded devices.]]></description> <tags>qt creator,kits,yocto,embedded,talk,2019</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtube1w0ak9RNNWY.webp" difficulty="" projectPath="" name="Talk: Qt Creator in Space" isVideo="true" videoUrl="https://youtu.be/1w0ak9RNNWY" videoLength="28:05"> + <tutorial imageUrl=":qtsupport/images/icons/youtube1w0ak9RNNWY.webp" difficulty="" projectPath="" name="Qt Creator in Space" isVideo="true" videoUrl="https://youtu.be/1w0ak9RNNWY" videoLength="28:05"> <description><![CDATA[Creating and maintaining a portfolio of Qt Creator plugins.]]></description> <tags>qt creator,plugins,video,2021</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubenmvurCcsWos.webp" difficulty="" projectPath="" name="Talk: All You Need to Get Your App Done with Qt for Android" isVideo="true" videoUrl="https://youtu.be/nmvurCcsWos" videoLength="24:11"> + <tutorial imageUrl=":qtsupport/images/icons/youtubenmvurCcsWos.webp" difficulty="" projectPath="" name="All You Need to Get Your App Done with Qt for Android" isVideo="true" videoUrl="https://youtu.be/nmvurCcsWos" videoLength="24:11"> <description><![CDATA[Developing an Android app using Qt for Android.]]></description> <tags>android,talk,2021</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubetnZo9umrPtg.webp" difficulty="" projectPath="" name="Talk: Styling a Qt Quick Controls Desktop Application" isVideo="true" videoUrl="https://youtu.be/tnZo9umrPtg" videoLength="29:40"> + <tutorial imageUrl=":qtsupport/images/icons/youtubetnZo9umrPtg.webp" difficulty="" projectPath="" name="Styling a Qt Quick Controls Desktop Application" isVideo="true" videoUrl="https://youtu.be/tnZo9umrPtg" videoLength="29:40"> <description><![CDATA[Styling Qt Quick Controls using the styling API.]]></description> <tags>qt quick,controls,styling,ui,talk,2021</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> - <tutorial imageUrl=":qtsupport/images/icons/youtubepN0pRBUqrrc.webp" difficulty="" projectPath="" name="Talk: The New Property Bindings: Making C++ more QMLish" isVideo="true" videoUrl="https://youtu.be/pN0pRBUqrrc" videoLength="29:54"> + <tutorial imageUrl=":qtsupport/images/icons/youtubepN0pRBUqrrc.webp" difficulty="" projectPath="" name="The New Property Bindings: Making C++ more QMLish" isVideo="true" videoUrl="https://youtu.be/pN0pRBUqrrc" videoLength="29:54"> <description><![CDATA[Using the Qt 6 property system in pure C++ and mixed C++/QML applications.]]></description> <tags>qt,c++,qml,talk,2021</tags> + <meta> + <entry name="category">Talk</entry> + </meta> </tutorial> </tutorials> </instructionals> diff --git a/tests/auto/examples/tst_examples.cpp b/tests/auto/examples/tst_examples.cpp index d6639663adf..e01336d65a8 100644 --- a/tests/auto/examples/tst_examples.cpp +++ b/tests/auto/examples/tst_examples.cpp @@ -140,6 +140,27 @@ void tst_Examples::parsing_data() << FilePath("examples") << QString() << FilePaths() << FilePath() << FilePaths() << Example << /*hasSourceCode=*/false << false << /*isHighlighted=*/true << "" << "" << QStringList() << MetaData() << QStringList{"Featured"}; + + QTest::addRow("tutorial with category") + << QByteArray(R"raw( + <tutorials> + <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/dummytutorial.html" projectPath="" name="A tutorial"> + <description><![CDATA[A dummy tutorial.]]></description> + <tags>qt creator,build,compile,help</tags> + <meta> + <entry name="category">Help</entry> + </meta> + </tutorial> + </tutorials> +)raw") << /*isExamples=*/false + << "A tutorial" + << "A dummy tutorial." + << ":qtsupport/images/icons/tutorialicon.png" + << QStringList{"qt creator", "build", "compile", "help"} << FilePath() + << "qthelp://org.qt-project.qtcreator/doc/dummytutorial.html" << FilePaths() << FilePath() + << FilePaths() << Tutorial << /*hasSourceCode=*/false << /*isVideo=*/false + << /*isHighlighted=*/false << QString() << QString() << QStringList() + << MetaData({{"category", {"Help"}}}) << QStringList("Help"); } void tst_Examples::parsing() @@ -175,8 +196,8 @@ void tst_Examples::parsing() QCOMPARE(item.platforms, expected.platforms); QCOMPARE(item.metaData, expected.metaData); - const QList<std::pair<Section, QList<ExampleItem *>>> resultCategories = getCategories(*result, - true); + const QList<std::pair<Section, QList<ExampleItem *>>> resultCategories + = getCategories(*result, true, {}, true); QCOMPARE(resultCategories.size(), categories.size()); for (int i = 0; i < resultCategories.size(); ++i) { QCOMPARE(resultCategories.at(i).first.name, categories.at(i)); From 4a0a6f07e7e72f74a452526becfb9c7c867f3be0 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Fri, 14 Jul 2023 11:07:56 +0200 Subject: [PATCH 0335/1777] DAP: Fix start CMake debug mode Change-Id: I2951142736b0e6ccf2b08a7bd78b08b1e96bca6f Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/debuggerengine.h | 1 - src/plugins/debugger/debuggerplugin.cpp | 1 - src/plugins/debugger/debuggerruncontrol.cpp | 12 +++--------- src/plugins/debugger/debuggerruncontrol.h | 1 - 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 6e48f8c02b6..cc6baf32d28 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -150,7 +150,6 @@ public: bool multiProcess = false; // Whether to set detach-on-fork off. bool useTerminal = false; bool runAsRoot = false; - bool cmakeDapDebugging = false; ProjectExplorer::Runnable debugger; Utils::FilePath overrideStartScript; // Used in attach to core and remote debugging diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index b2d9e46595b..6a6f60f08d5 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1724,7 +1724,6 @@ RunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit, debugger->setStartMode(AttachToLocalProcess); debugger->setCloseMode(DetachAtClose); debugger->setContinueAfterAttach(contAfterAttach); - debugger->setCmakeDapDebugging(processInfo.executable.endsWith(QLatin1String("cmake"))); debugger->startRunControl(); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 67cefc7b27d..3d97bb89d1e 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -310,11 +310,6 @@ void DebuggerRunTool::setRunAsRoot(bool on) m_runParameters.runAsRoot = on; } -void DebuggerRunTool::setCmakeDapDebugging(bool on) -{ - m_runParameters.cmakeDapDebugging = on; -} - void DebuggerRunTool::setCommandsAfterConnect(const QString &commands) { m_runParameters.commandsAfterConnect = commands; @@ -491,11 +486,10 @@ void DebuggerRunTool::start() runControl()->setDisplayName(m_runParameters.displayName); - if (!m_engine && m_runParameters.cmakeDapDebugging) - m_engine = createDapEngine(); - if (!m_engine) { - if (m_runParameters.isCppDebugging()) { + if (runControl()->runMode() == ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE) + m_engine = createDapEngine(); + else if (m_runParameters.isCppDebugging()) { switch (m_runParameters.cppEngineType) { case GdbEngineType: m_engine = createGdbEngine(); diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index 44870382732..2bd18508c6a 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -84,7 +84,6 @@ public: void setBreakOnMain(bool on); void setUseTerminal(bool on); void setRunAsRoot(bool on); - void setCmakeDapDebugging(bool on); void setCommandsAfterConnect(const QString &commands); void setCommandsForReset(const QString &commands); From 93d96c9d7533db1d75429c577229423cad7497bf Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 11:04:55 +0200 Subject: [PATCH 0336/1777] Vcs: Code cosmetics Drop some Utils:: and rely on some aspects' operator()() Change-Id: I40d2c2973c1c9eff443bb74b8da44e0824d8d5c6 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/fossil/fossilclient.cpp | 4 +-- .../fossil/wizard/fossiljsextension.cpp | 4 +-- src/plugins/git/branchview.cpp | 2 +- src/plugins/git/gitclient.cpp | 4 +-- src/plugins/git/giteditor.cpp | 2 +- src/plugins/git/gitplugin.cpp | 8 +++--- src/plugins/gitlab/gitlaboptionspage.cpp | 28 +++++++++---------- src/plugins/perforce/perforceplugin.cpp | 4 +-- src/plugins/perforce/perforcesettings.cpp | 16 +++++------ 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/plugins/fossil/fossilclient.cpp b/src/plugins/fossil/fossilclient.cpp index db75fbf9d1e..bb04dd43d5c 100644 --- a/src/plugins/fossil/fossilclient.cpp +++ b/src/plugins/fossil/fossilclient.cpp @@ -433,7 +433,7 @@ RepositorySettings FossilClient::synchronousSettingsQuery(const FilePath &workin RepositorySettings repoSettings; repoSettings.user = synchronousUserDefaultQuery(workingDirectory); if (repoSettings.user.isEmpty()) - repoSettings.user = settings().userName.value(); + repoSettings.user = settings().userName(); for (const QString &line : output.split('\n', Qt::SkipEmptyParts)) { // parse settings line: @@ -587,7 +587,7 @@ bool FossilClient::synchronousCreateRepository(const FilePath &workingDirectory, const QString repoName = workingDirectory.fileName().simplified(); const FilePath repoPath = settings().defaultRepoPath(); - const QString adminUser = settings().userName.value(); + const QString adminUser = settings().userName(); if (repoName.isEmpty() || repoPath.isEmpty()) return false; diff --git a/src/plugins/fossil/wizard/fossiljsextension.cpp b/src/plugins/fossil/wizard/fossiljsextension.cpp index e37e13c644f..35d7a6fd36c 100644 --- a/src/plugins/fossil/wizard/fossiljsextension.cpp +++ b/src/plugins/fossil/wizard/fossiljsextension.cpp @@ -50,7 +50,7 @@ QString FossilJsExtension::defaultAdminUser() const if (!isConfigured()) return QString(); - return settings().userName.value(); + return settings().userName(); } QString FossilJsExtension::defaultSslIdentityFile() const @@ -74,7 +74,7 @@ bool FossilJsExtension::defaultDisableAutosync() const if (!isConfigured()) return false; - return settings().disableAutosync.value(); + return settings().disableAutosync(); } } // namespace Internal diff --git a/src/plugins/git/branchview.cpp b/src/plugins/git/branchview.cpp index 857d3996a61..5720497ecae 100644 --- a/src/plugins/git/branchview.cpp +++ b/src/plugins/git/branchview.cpp @@ -115,7 +115,7 @@ BranchView::BranchView() connect(m_includeOldEntriesAction, &QAction::toggled, this, &BranchView::setIncludeOldEntries); m_includeTagsAction->setCheckable(true); - m_includeTagsAction->setChecked(settings().showTags.value()); + m_includeTagsAction->setChecked(settings().showTags()); connect(m_includeTagsAction, &QAction::toggled, this, &BranchView::setIncludeTags); diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 764feb0d08b..bd0b037cdaf 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -2110,7 +2110,7 @@ Environment GitClient::processEnvironment() const Environment environment = VcsBaseClientImpl::processEnvironment(); const FilePath gitPath = settings().path(); environment.prependOrSetPath(gitPath); - if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment.value()) { + if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment()) { QString homePath; if (qtcEnvironmentVariableIsEmpty("HOMESHARE")) { homePath = QDir::toNativeSeparators(QDir::homePath()); @@ -2448,7 +2448,7 @@ void GitClient::tryLaunchingGitK(const Environment &env, binary = wish; } } - const QString gitkOpts = settings().gitkOptions.value(); + const QString gitkOpts = settings().gitkOptions(); if (!gitkOpts.isEmpty()) arguments.append(ProcessArgs::splitArgs(gitkOpts, HostOsInfo::hostOs())); if (!fileName.isEmpty()) diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index c7078dc2ba1..106cd585686 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -132,7 +132,7 @@ static QString sanitizeBlameOutput(const QString &b) if (b.isEmpty()) return b; - const bool omitDate = settings().omitAnnotationDate.value(); + const bool omitDate = settings().omitAnnotationDate(); const QChar space(' '); const int parenPos = b.indexOf(')'); if (parenPos == -1) diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 9ada18c1194..c7d2f1f0661 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -1437,7 +1437,7 @@ void GitPluginPrivate::setupInstantBlame() return; } - if (!settings().instantBlame.value()) { + if (!settings().instantBlame()) { m_lastVisitedEditorLine = -1; stopInstantBlame(); return; @@ -1456,7 +1456,7 @@ void GitPluginPrivate::setupInstantBlame() m_blameCursorPosConn = connect(widget, &QPlainTextEdit::cursorPositionChanged, this, [this] { - if (!settings().instantBlame.value()) { + if (!settings().instantBlame()) { disconnect(m_blameCursorPosConn); return; } @@ -1515,7 +1515,7 @@ CommitInfo parseBlameOutput(const QStringList &blame, const Utils::FilePath &fil void GitPluginPrivate::instantBlameOnce() { - if (!settings().instantBlame.value()) { + if (!settings().instantBlame()) { const TextEditorWidget *widget = TextEditorWidget::currentTextEditorWidget(); if (!widget) return; @@ -1725,7 +1725,7 @@ void GitPluginPrivate::pull() const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); FilePath topLevel = state.topLevel(); - bool rebase = settings().pullRebase.value(); + bool rebase = settings().pullRebase(); if (!rebase) { QString currentBranch = m_gitClient.synchronousCurrentLocalBranch(topLevel); diff --git a/src/plugins/gitlab/gitlaboptionspage.cpp b/src/plugins/gitlab/gitlaboptionspage.cpp index 48ec0fda00d..bb471c5a414 100644 --- a/src/plugins/gitlab/gitlaboptionspage.cpp +++ b/src/plugins/gitlab/gitlaboptionspage.cpp @@ -69,19 +69,19 @@ GitLabServerWidget::GitLabServerWidget(Mode m, QWidget *parent) , m_mode(m) { m_host.setLabelText(Tr::tr("Host:")); - m_host.setDisplayStyle(m == Display ? Utils::StringAspect::LabelDisplay - : Utils::StringAspect::LineEditDisplay); - m_host.setValidationFunction([](Utils::FancyLineEdit *l, QString *) { + m_host.setDisplayStyle(m == Display ? StringAspect::LabelDisplay + : StringAspect::LineEditDisplay); + m_host.setValidationFunction([](FancyLineEdit *l, QString *) { return hostValid(l->text()); }); m_description.setLabelText(Tr::tr("Description:")); - m_description.setDisplayStyle(m == Display ? Utils::StringAspect::LabelDisplay - : Utils::StringAspect::LineEditDisplay); + m_description.setDisplayStyle(m == Display ? StringAspect::LabelDisplay + : StringAspect::LineEditDisplay); m_token.setLabelText(Tr::tr("Access token:")); - m_token.setDisplayStyle(m == Display ? Utils::StringAspect::LabelDisplay - : Utils::StringAspect::LineEditDisplay); + m_token.setDisplayStyle(m == Display ? StringAspect::LabelDisplay + : StringAspect::LineEditDisplay); m_token.setVisible(m == Edit); m_port.setLabelText(Tr::tr("Port:")); @@ -89,7 +89,7 @@ GitLabServerWidget::GitLabServerWidget(Mode m, QWidget *parent) m_port.setValue(GitLabServer::defaultPort); m_port.setEnabled(m == Edit); m_secure.setLabelText(Tr::tr("HTTPS:")); - m_secure.setLabelPlacement(Utils::BoolAspect::LabelPlacement::InExtraLabel); + m_secure.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); m_secure.setDefaultValue(true); m_secure.setEnabled(m == Edit); @@ -110,12 +110,12 @@ GitLabServerWidget::GitLabServerWidget(Mode m, QWidget *parent) GitLabServer GitLabServerWidget::gitLabServer() const { GitLabServer result; - result.id = m_mode == Edit ? Utils::Id::fromName(QUuid::createUuid().toByteArray()) : m_id; - result.host = m_host.value(); - result.description = m_description.value(); - result.token = m_token.value(); - result.port = m_port.value(); - result.secure = m_secure.value(); + result.id = m_mode == Edit ? Id::fromName(QUuid::createUuid().toByteArray()) : m_id; + result.host = m_host(); + result.description = m_description(); + result.token = m_token(); + result.port = m_port(); + result.secure = m_secure(); return result; } diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 5101d471591..2a9905a4c22 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -1152,7 +1152,7 @@ bool PerforcePluginPrivate::vcsOpen(const FilePath &filePath) IVersionControl::SettingsFlags PerforcePluginPrivate::settingsFlags() const { SettingsFlags rc; - if (m_settings.autoOpen.value()) + if (m_settings.autoOpen()) rc |= AutoOpen; return rc; } @@ -1689,7 +1689,7 @@ void PerforcePluginPrivate::slotTopLevelFailed(const QString &errorMessage) void PerforcePluginPrivate::getTopLevel(const FilePath &workingDirectory, bool isSync) { // Run a new checker - if (m_settings.p4BinaryPath.value().isEmpty()) + if (m_settings.p4BinaryPath().isEmpty()) return; auto checker = new PerforceChecker(dd); connect(checker, &PerforceChecker::failed, dd, &PerforcePluginPrivate::slotTopLevelFailed); diff --git a/src/plugins/perforce/perforcesettings.cpp b/src/plugins/perforce/perforcesettings.cpp index 915c4777ddd..eba981115f5 100644 --- a/src/plugins/perforce/perforcesettings.cpp +++ b/src/plugins/perforce/perforcesettings.cpp @@ -149,13 +149,13 @@ PerforceSettings::~PerforceSettings() QStringList PerforceSettings::commonP4Arguments() const { QStringList lst; - if (customEnv.value()) { - if (!p4Client.value().isEmpty()) - lst << "-c" << p4Client.value(); - if (!p4Port.value().isEmpty()) - lst << "-p" << p4Port.value(); - if (!p4User.value().isEmpty()) - lst << "-u" << p4User.value(); + if (customEnv()) { + if (!p4Client().isEmpty()) + lst << "-c" << p4Client(); + if (!p4Port().isEmpty()) + lst << "-p" << p4Port(); + if (!p4User().isEmpty()) + lst << "-u" << p4User(); } return lst; } @@ -179,7 +179,7 @@ QStringList PerforceSettings::commonP4Arguments_volatile() const bool PerforceSettings::isValid() const { - return !m_topLevel.isEmpty() && !p4BinaryPath.value().isEmpty(); + return !m_topLevel.isEmpty() && !p4BinaryPath().isEmpty(); } bool PerforceSettings::defaultEnv() const From 5bcf289fcef525eb0f43d046a5a476f07b2f87d4 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 14 Jul 2023 11:54:49 +0200 Subject: [PATCH 0337/1777] CMakeProcess: Remove unused function Amends cd6e990de8a794735c9ca000b2cd0fd3668fbe08 Change-Id: I407a26bb75bbd059b9bf7a0b546024700b738769 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> --- src/plugins/cmakeprojectmanager/cmakeprocess.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index 05dba3e8376..8ec21f28a80 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -46,11 +46,6 @@ CMakeProcess::~CMakeProcess() static const int failedToStartExitCode = 0xFF; // See ProcessPrivate::handleDone() impl -static QObject *debuggerPlugin() -{ - return ExtensionSystem::PluginManager::getObjectByName("DebuggerPlugin"); -} - void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList &arguments) { QTC_ASSERT(!m_process, return); From d9768caf766a23137021833adc0f7505fc6d14c3 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 11:49:37 +0200 Subject: [PATCH 0338/1777] PerFProfiler: Use aspects more directly Change-Id: I6d15d32d9cd02acd9a95bb96cbde72beff506931 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/perfprofiler/perfconfigeventsmodel.cpp | 4 ++-- src/plugins/perfprofiler/perfsettings.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/perfprofiler/perfconfigeventsmodel.cpp b/src/plugins/perfprofiler/perfconfigeventsmodel.cpp index a235a6122db..ac7924cfe0e 100644 --- a/src/plugins/perfprofiler/perfconfigeventsmodel.cpp +++ b/src/plugins/perfprofiler/perfconfigeventsmodel.cpp @@ -22,7 +22,7 @@ PerfConfigEventsModel::PerfConfigEventsModel(PerfSettings *settings, QObject *pa int PerfConfigEventsModel::rowCount(const QModelIndex &parent) const { - return parent.isValid() ? 0 : m_settings->events.value().length(); + return parent.isValid() ? 0 : m_settings->events().length(); } int PerfConfigEventsModel::columnCount(const QModelIndex &parent) const @@ -40,7 +40,7 @@ QVariant PerfConfigEventsModel::data(const QModelIndex &index, int role) const return QVariant(); // ignore } - QString event = m_settings->events.value().value(index.row()); + QString event = m_settings->events().value(index.row()); const EventDescription description = parseEvent(event); switch (index.column()) { case ColumnEventType: { diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp index 8851b19d777..6322f77fa12 100644 --- a/src/plugins/perfprofiler/perfsettings.cpp +++ b/src/plugins/perfprofiler/perfsettings.cpp @@ -99,10 +99,10 @@ void PerfSettings::addPerfRecordArguments(CommandLine *cmd) const { QString callgraphArg = callgraphMode.itemValue().toString(); if (callgraphArg == Constants::PerfCallgraphDwarf) - callgraphArg += "," + QString::number(stackSize.value()); + callgraphArg += "," + QString::number(stackSize()); QString events; - for (const QString &event : this->events.value()) { + for (const QString &event : this->events()) { if (!event.isEmpty()) { if (!events.isEmpty()) events.append(','); @@ -113,7 +113,7 @@ void PerfSettings::addPerfRecordArguments(CommandLine *cmd) const cmd->addArgs({"-e", events, "--call-graph", callgraphArg, sampleMode.itemValue().toString(), - QString::number(period.value())}); + QString::number(period())}); cmd->addArgs(extraArguments(), CommandLine::Raw); } From 42144afe6640bad6afac5ab496d0db74a0fd87b8 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 14 Jul 2023 09:17:54 +0200 Subject: [PATCH 0339/1777] Doc: Remove list of filters from Issues docs and promote tooltips Task-number: QTCREATORBUG-29392 Change-Id: Ief101bf9a1a6a412a4649881e372eb1479d71259 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- doc/qtcreator/images/qtcreator-issues.webp | Bin 2082 -> 6842 bytes .../creator-reference-output-views.qdoc | 64 +----------------- 2 files changed, 3 insertions(+), 61 deletions(-) diff --git a/doc/qtcreator/images/qtcreator-issues.webp b/doc/qtcreator/images/qtcreator-issues.webp index 503e23a51136744572c0dc91436e2d1bb5abfd98..d55a32c5ffd2425b9090a77bb094a164e4b005ac 100644 GIT binary patch literal 6842 zcmWIYbaUGz#lR5m>J$(bVBxb&ih)6Yu~Q_&*RDs~a%D3AZ!F$>UtdYBVWaQ&0N!Vl zT&GRazs$t7!{zwINZFUOe=lN)nkb!qyNTcUvx5bj<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{<QepG;F{s<8r+Q<ybYX*= z|C`$`G7Ba;7tcSUE&3*~rYmlR#$jjKlug^+oGmvvDm#0J*D1GEX=p?)aP>|+oyL$F z!nq^ulKQp0BNt3`ydU!1b(fs<it~Z2)J0W?Z|qqYPvt*Qw-oY{kn(+WP{`h>w&d2z z?nN51?U#gwMK^G-QeV-|_S#&7T~6j^LdmkLVZ5zjPRka?Fy3*Op7e^-Zm-m=-BO`1 z)P26xay@PpnrFf6<+$;K?;BaEhX<#x4H0F!ZStr>@c_5twTw*_vZ6CqoN3OAIL$WS z^o6Hp81t(HpBE3TY-%q_a5H)Fs~%J5=8+57mazC%L$Xv>LNo6&#aiLVY?<QkkA7pC z{C@J8>e|au+kV8Xz4$@VxzeF?BG(%BwrPAUo_nVCE#NaMzw+|pZ5~|<?k1}@Cl$rd z%FOC-_dD$DVCJ1WmGQjE6&>!o;ttM1wt`KaJ5=tq`Rr%@q_J;WT*re~W=!G1-?Yy1 eXT<2c^?od#vhDwkf62f5-`eA4-0^5)VgLX>%G%xl diff --git a/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc b/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc index 60387532f7e..28f9cb933d6 100644 --- a/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc +++ b/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc @@ -22,72 +22,14 @@ and presents the issues in an organized way. To further filter the output by type, select \inlineimage icons/filtericon.png - (\uicontrol {Filter Tree}) and then select a filter: + (\uicontrol {Filter Tree}) and then select a filter. See the tooltips for + more information about each filter. - \list - - \if defined(qtdesignstudio) - \li \uicontrol {Asset Export} - Errors and warnings encountered - while exporting assets. - - \li \uicontrol {Asset Importer Error} - Errors and warnings encountered - while importing assets from a design tool. - \else - \li \uicontrol Autotests - Errors and warnings encountered while running - tests. - \endif - - \li \uicontrol {Build System} - Errors and warnings encountered when - opening and managing projects. - - \if defined(qtcreator) - \li \uicontrol {Clang Code Model} - - \l {Parsing C++ Files with the Clang Code Model} - {Errors and warnings from the current editor}. - \li \uicontrol {Clang Tools} - Errors and warnings from - \l {Using Clang Tools}{Clang-Tidy and Clazy} - \endif - - \li \uicontrol Compile - Selected output from the compiler. Open - \uicontrol {Compile Output} for more detailed information. - - \li \uicontrol{Debug Information} - Lists debug information packages that might - be missing. - - \if defined(qtcreator) - \li \uicontrol Debugger - Errors encountered while running the - \l{Analyzing Code}{Valgrind code analysis tools}. - \endif - - \li \uicontrol{Debugger Runtime} - Errors encountered when starting \QC. For - example, information about missing DLLs. - - \li \uicontrol Deployment - Errors encountered between building an application - successfully and starting it on a \l{glossary-device}{device}. - - \if defined(qtcreator) - \li \uicontrol {My Tasks} - Entries from a task list file (.tasks) generated - by \l{Showing Task List Files in Issues} - {code scanning and analysis tools}. - - \li \uicontrol Python - Runtime errors and exceptions of Python scripts. - \endif - - \li \uicontrol QML and \uicontrol {QML Analysis} - - \l{JavaScript and QML Error Codes} - {QML and JavaScript syntax errors}. - - \if defined(qtcreator) - \li \uicontrol Sanitizer - Tasks created when you run an application if - you used an \e {address sanitizer} to detect memory handling issues. - \endif - \endlist + \image qtcreator-issues.webp {Issues} To find output in the view, enter search criteria in the \uicontrol Filter field. - \image qtcreator-issues.webp {Issues} - Select one or several lines to apply context-menu actions to their contents. You can remove the selected lines or copy their contents to the clipboard. For single lines, you can search the Internet for a solution using the From 7d9b124ea2a7fba5a747cb3b182e09a3bd7f6249 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 12:25:47 +0200 Subject: [PATCH 0340/1777] AutoTest: Use aspect as member in TestRunConfiguration Change-Id: If39015ec0b10a7b77e558bb04e83d06d1367173a Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/autotest/testrunconfiguration.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/autotest/testrunconfiguration.h b/src/plugins/autotest/testrunconfiguration.h index 1e89949ce13..5468ea36056 100644 --- a/src/plugins/autotest/testrunconfiguration.h +++ b/src/plugins/autotest/testrunconfiguration.h @@ -23,7 +23,8 @@ class TestRunConfiguration : public ProjectExplorer::RunConfiguration { public: TestRunConfiguration(ProjectExplorer::Target *parent, TestConfiguration *config) - : ProjectExplorer::RunConfiguration(parent, "AutoTest.TestRunConfig") + : ProjectExplorer::RunConfiguration(parent, "AutoTest.TestRunConfig"), + debuggerAspect(parent) { setDefaultDisplayName(QCoreApplication::translate("QtC::Autotest", "AutoTest Debug")); @@ -31,8 +32,8 @@ public: if (auto debuggable = dynamic_cast<DebuggableTestConfiguration *>(config)) enableQuick = debuggable->mixedDebugging(); - auto debugAspect = addAspect<Debugger::DebuggerRunConfigurationAspect>(parent); - debugAspect->setUseQmlDebugger(enableQuick); + registerAspect(&debuggerAspect); + debuggerAspect.setUseQmlDebugger(enableQuick); ProjectExplorer::ProjectExplorerPlugin::updateRunActions(); m_testConfig = config; } @@ -50,6 +51,7 @@ public: private: TestConfiguration *m_testConfig = nullptr; + Debugger::DebuggerRunConfigurationAspect debuggerAspect; }; } // namespace Internal From 381ff44f6678085917357898ec58cb3fe0d39e58 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 7 Jul 2023 12:05:25 +0200 Subject: [PATCH 0341/1777] Debugger: Fix post mortem action on Windows Change-Id: I411853098f3bb7c410b4446bb6f2ed61fb11b217 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/commonoptionspage.cpp | 5 ----- src/plugins/debugger/debuggeractions.cpp | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 8d0dda445f5..0369ed14893 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -29,11 +29,6 @@ public: DebuggerSettings &s = settings(); setOnApply([&s] { - const bool originalPostMortem = s.registerForPostMortem->value(); - const bool currentPostMortem = s.registerForPostMortem->volatileValue(); - // explicitly trigger setValue() to override the setValueSilently() and trigger the registration - if (originalPostMortem != currentPostMortem) - s.registerForPostMortem->setValue(currentPostMortem); s.page1.apply(); s.page1.writeSettings(); }); diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index bf1b8f76f30..e4026bca81d 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -405,6 +405,8 @@ DebuggerSettings::DebuggerSettings() page1.registerAspect(&forceLoggingToConsole); page1.registerAspect(&sourcePathMap); + if (HostOsInfo::isWindowsHost()) + page1.registerAspect(registerForPostMortem); // Page 4 page4.registerAspect(&useDebuggingHelpers); @@ -429,8 +431,6 @@ DebuggerSettings::DebuggerSettings() page5.registerAspect(&firstChanceExceptionTaskEntry); page5.registerAspect(&secondChanceExceptionTaskEntry); page5.registerAspect(&ignoreFirstChanceAccessViolation); - if (HostOsInfo::isWindowsHost()) - page5.registerAspect(registerForPostMortem); // Page 6 page6.registerAspect(&cdbSymbolPaths); From f65cffdfa21354ac31f3cf3bb13daac8a493160f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 11:55:00 +0200 Subject: [PATCH 0342/1777] Qbs: Use aspects in QbsInstallStep more directly Change-Id: I5fca944d8c2c93e0f7249cc9c0532f66e5b9b33c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../qbsprojectmanager/qbsinstallstep.cpp | 48 +++++++------------ .../qbsprojectmanager/qbsinstallstep.h | 6 +-- 2 files changed, 21 insertions(+), 33 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp index 87fe3ae0f9c..5f6dbf2a710 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp @@ -10,7 +10,6 @@ #include "qbsprojectmanagertr.h" #include "qbssession.h" -#include <coreplugin/icore.h> #include <projectexplorer/buildsteplist.h> #include <projectexplorer/deployconfiguration.h> #include <projectexplorer/kit.h> @@ -30,36 +29,25 @@ using namespace Utils; namespace QbsProjectManager { namespace Internal { -// -------------------------------------------------------------------- -// Constants: -// -------------------------------------------------------------------- - -const char QBS_REMOVE_FIRST[] = "Qbs.RemoveFirst"; -const char QBS_DRY_RUN[] = "Qbs.DryRun"; -const char QBS_KEEP_GOING[] = "Qbs.DryKeepGoing"; - // -------------------------------------------------------------------- // QbsInstallStep: // -------------------------------------------------------------------- -QbsInstallStep::QbsInstallStep(BuildStepList *bsl, Utils::Id id) +QbsInstallStep::QbsInstallStep(BuildStepList *bsl, Id id) : BuildStep(bsl, id) { setDisplayName(Tr::tr("Qbs Install")); setSummaryText(Tr::tr("<b>Qbs:</b> %1").arg("install")); const auto labelPlacement = BoolAspect::LabelPlacement::AtCheckBox; - m_dryRun = addAspect<BoolAspect>(); - m_dryRun->setSettingsKey(QBS_DRY_RUN); - m_dryRun->setLabel(Tr::tr("Dry run"), labelPlacement); + dryRun.setSettingsKey("Qbs.DryRun"); + dryRun.setLabel(Tr::tr("Dry run"), labelPlacement); - m_keepGoing = addAspect<BoolAspect>(); - m_keepGoing->setSettingsKey(QBS_KEEP_GOING); - m_keepGoing->setLabel(Tr::tr("Keep going"), labelPlacement); + keepGoing.setSettingsKey("Qbs.DryKeepGoing"); + keepGoing.setLabel(Tr::tr("Keep going"), labelPlacement); - m_cleanInstallRoot = addAspect<BoolAspect>(); - m_cleanInstallRoot->setSettingsKey(QBS_REMOVE_FIRST); - m_cleanInstallRoot->setLabel(Tr::tr("Remove first"), labelPlacement); + cleanInstallRoot.setSettingsKey("Qbs.RemoveFirst"); + cleanInstallRoot.setLabel(Tr::tr("Remove first"), labelPlacement); } QbsInstallStep::~QbsInstallStep() @@ -82,9 +70,9 @@ void QbsInstallStep::doRun() QJsonObject request; request.insert("type", "install-project"); request.insert("install-root", installRoot().path()); - request.insert("clean-install-root", m_cleanInstallRoot->value()); - request.insert("keep-going", m_keepGoing->value()); - request.insert("dry-run", m_dryRun->value()); + request.insert("clean-install-root", cleanInstallRoot()); + request.insert("keep-going", keepGoing()); + request.insert("dry-run", dryRun()); m_session->sendRequest(request); m_maxProgress = 0; @@ -137,7 +125,7 @@ void QbsInstallStep::handleProgress(int value) } void QbsInstallStep::createTaskAndOutput(Task::TaskType type, const QString &message, - const Utils::FilePath &file, int line) + const FilePath &file, int line) { emit addOutput(message, OutputFormat::Stdout); emit addTask(CompileTask(type, message, file, line), 1); @@ -147,10 +135,10 @@ QbsBuildStepData QbsInstallStep::stepData() const { QbsBuildStepData data; data.command = "install"; - data.dryRun = m_dryRun->value(); - data.keepGoing = m_keepGoing->value(); + data.dryRun = dryRun(); + data.keepGoing = keepGoing(); data.noBuild = true; - data.cleanInstallRoot = m_cleanInstallRoot->value(); + data.cleanInstallRoot = cleanInstallRoot(); data.isInstallStep = true; auto bs = static_cast<QbsBuildConfiguration *>(target()->activeBuildConfiguration())->qbsStep(); if (bs) @@ -175,7 +163,7 @@ QWidget *QbsInstallStep::createConfigWidget() using namespace Layouting; Form { Tr::tr("Install root:"), installRootValueLabel, br, - Tr::tr("Flags:"), m_dryRun, m_keepGoing, m_cleanInstallRoot, br, + Tr::tr("Flags:"), dryRun, keepGoing, cleanInstallRoot, br, commandLineKeyLabel, commandLineTextEdit }.attachTo(widget); @@ -187,9 +175,9 @@ QWidget *QbsInstallStep::createConfigWidget() connect(target(), &Target::parsingFinished, this, updateState); connect(this, &ProjectConfiguration::displayNameChanged, this, updateState); - connect(m_dryRun, &BoolAspect::changed, this, updateState); - connect(m_keepGoing, &BoolAspect::changed, this, updateState); - connect(m_cleanInstallRoot, &BoolAspect::changed, this, updateState); + connect(&dryRun, &BaseAspect::changed, this, updateState); + connect(&keepGoing, &BaseAspect::changed, this, updateState); + connect(&cleanInstallRoot, &BaseAspect::changed, this, updateState); const QbsBuildConfiguration * const bc = buildConfig(); connect(bc, &QbsBuildConfiguration::qbsConfigurationChanged, this, updateState); diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.h b/src/plugins/qbsprojectmanager/qbsinstallstep.h index e0063da8189..98d9853e8fa 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.h +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.h @@ -42,9 +42,9 @@ private: void createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message, const Utils::FilePath &file, int line); - Utils::BoolAspect *m_cleanInstallRoot = nullptr; - Utils::BoolAspect *m_dryRun = nullptr; - Utils::BoolAspect *m_keepGoing = nullptr; + Utils::BoolAspect cleanInstallRoot{this}; + Utils::BoolAspect dryRun{this}; + Utils::BoolAspect keepGoing{this}; QbsSession *m_session = nullptr; QString m_description; From a01d7e9a7806a87d00ccc21aecc9873f25420099 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 11:35:51 +0200 Subject: [PATCH 0343/1777] Qbs: More direct aspect use in QbsCleanStep Change-Id: Ib917375ab0027b6b6ff75d1ebcbbff25fe63e6ee Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../qbsprojectmanager/qbscleanstep.cpp | 27 +++++++++---------- src/plugins/qbsprojectmanager/qbscleanstep.h | 5 ++-- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.cpp b/src/plugins/qbsprojectmanager/qbscleanstep.cpp index b68b1400308..a0e6916403a 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.cpp +++ b/src/plugins/qbsprojectmanager/qbscleanstep.cpp @@ -34,26 +34,23 @@ QbsCleanStep::QbsCleanStep(BuildStepList *bsl, Utils::Id id) { setDisplayName(Tr::tr("Qbs Clean")); - m_dryRunAspect = addAspect<BoolAspect>(); - m_dryRunAspect->setSettingsKey("Qbs.DryRun"); - m_dryRunAspect->setLabel(Tr::tr("Dry run:"), BoolAspect::LabelPlacement::InExtraLabel); + dryRun.setSettingsKey("Qbs.DryRun"); + dryRun.setLabel(Tr::tr("Dry run:"), BoolAspect::LabelPlacement::InExtraLabel); - m_keepGoingAspect = addAspect<BoolAspect>(); - m_keepGoingAspect->setSettingsKey("Qbs.DryKeepGoing"); - m_keepGoingAspect->setLabel(Tr::tr("Keep going:"), BoolAspect::LabelPlacement::InExtraLabel); + keepGoing.setSettingsKey("Qbs.DryKeepGoing"); + keepGoing.setLabel(Tr::tr("Keep going:"), BoolAspect::LabelPlacement::InExtraLabel); - auto effectiveCommandAspect = addAspect<StringAspect>(); - effectiveCommandAspect->setDisplayStyle(StringAspect::TextEditDisplay); - effectiveCommandAspect->setLabelText(Tr::tr("Equivalent command line:")); + effectiveCommand.setDisplayStyle(StringAspect::TextEditDisplay); + effectiveCommand.setLabelText(Tr::tr("Equivalent command line:")); - setSummaryUpdater([this, effectiveCommandAspect] { + setSummaryUpdater([this] { QbsBuildStepData data; data.command = "clean"; - data.dryRun = m_dryRunAspect->value(); - data.keepGoing = m_keepGoingAspect->value(); + data.dryRun = dryRun(); + data.keepGoing = keepGoing(); QString command = static_cast<QbsBuildConfiguration *>(buildConfiguration()) ->equivalentCommandLine(data); - effectiveCommandAspect->setValue(command); + effectiveCommand.setValue(command); return Tr::tr("<b>Qbs:</b> %1").arg("clean"); }); } @@ -98,8 +95,8 @@ void QbsCleanStep::doRun() request.insert("type", "clean-project"); if (!m_products.isEmpty()) request.insert("products", QJsonArray::fromStringList(m_products)); - request.insert("dry-run", m_dryRunAspect->value()); - request.insert("keep-going", m_keepGoingAspect->value()); + request.insert("dry-run", dryRun()); + request.insert("keep-going", keepGoing()); m_session->sendRequest(request); m_maxProgress = 0; connect(m_session, &QbsSession::projectCleaned, this, &QbsCleanStep::cleaningDone); diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.h b/src/plugins/qbsprojectmanager/qbscleanstep.h index 921678c65a7..f7f1d58d018 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.h +++ b/src/plugins/qbsprojectmanager/qbscleanstep.h @@ -40,8 +40,9 @@ private: void createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message, const QString &file, int line); - Utils::BoolAspect *m_dryRunAspect = nullptr; - Utils::BoolAspect *m_keepGoingAspect = nullptr; + Utils::BoolAspect dryRun{this}; + Utils::BoolAspect keepGoing{this}; + Utils::StringAspect effectiveCommand{this}; QStringList m_products; QbsSession *m_session = nullptr; From 6fb3e7f1aeb0e594b2159f2ea2c0ceac041e5f61 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 14:09:58 +0200 Subject: [PATCH 0344/1777] CPaster: Prepare delaying settings creation Change-Id: Ie4ae3ced23f65b87d9da0841736c6d652398e286 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/cpaster/cpasterplugin.cpp | 33 +++++++++---------- src/plugins/cpaster/fileshareprotocol.cpp | 14 ++++---- src/plugins/cpaster/fileshareprotocol.h | 4 --- .../cpaster/fileshareprotocolsettingspage.cpp | 28 ++++++++++++++-- .../cpaster/fileshareprotocolsettingspage.h | 6 +++- src/plugins/cpaster/settings.cpp | 29 +++++++++++++--- src/plugins/cpaster/settings.h | 6 ++-- 7 files changed, 81 insertions(+), 39 deletions(-) diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index 2a33dcfccb9..4d829589e15 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -60,7 +60,6 @@ public: void fetchUrl(); - Settings m_settings; QAction *m_postEditorAction = nullptr; QAction *m_fetchAction = nullptr; QAction *m_fetchUrlAction = nullptr; @@ -124,15 +123,15 @@ CodePasterPluginPrivate::CodePasterPluginPrivate() // Connect protocols if (!m_protocols.isEmpty()) { for (Protocol *proto : m_protocols) { - m_settings.protocols.addOption(proto->name()); + settings().protocols.addOption(proto->name()); connect(proto, &Protocol::pasteDone, this, &CodePasterPluginPrivate::finishPost); connect(proto, &Protocol::fetchDone, this, &CodePasterPluginPrivate::finishFetch); } - m_settings.protocols.setDefaultValue(m_protocols.at(0)->name()); + settings().protocols.setDefaultValue(m_protocols.at(0)->name()); } // Create the settings Page - m_settings.readSettings(); + settings().readSettings(); connect(&m_urlOpen, &Protocol::fetchDone, this, &CodePasterPluginPrivate::finishFetch); @@ -238,20 +237,20 @@ void CodePasterPluginPrivate::post(QString data, const QString &mimeType) { fixSpecialCharacters(data); - const QString username = m_settings.username.value(); + const QString username = settings().username(); PasteView view(m_protocols, mimeType, ICore::dialogParent()); - view.setProtocol(m_settings.protocols.stringValue()); + view.setProtocol(settings().protocols.stringValue()); const FileDataList diffChunks = splitDiffToFiles(data); const int dialogResult = diffChunks.isEmpty() ? - view.show(username, {}, {}, m_settings.expiryDays(), data) : - view.show(username, {}, {}, m_settings.expiryDays(), diffChunks); + view.show(username, {}, {}, settings().expiryDays(), data) : + view.show(username, {}, {}, settings().expiryDays(), diffChunks); // Save new protocol in case user changed it. - if (dialogResult == QDialog::Accepted && m_settings.protocols.value() != view.protocol()) { - m_settings.protocols.setValue(view.protocol()); - m_settings.writeSettings(); + if (dialogResult == QDialog::Accepted && settings().protocols() != view.protocol()) { + settings().protocols.setValue(view.protocol()); + settings().writeSettings(); } } @@ -275,14 +274,14 @@ void CodePasterPluginPrivate::pasteSnippet() void CodePasterPluginPrivate::fetch() { PasteSelectDialog dialog(m_protocols, ICore::dialogParent()); - dialog.setProtocol(m_settings.protocols.stringValue()); + dialog.setProtocol(settings().protocols.stringValue()); if (dialog.exec() != QDialog::Accepted) return; // Save new protocol in case user changed it. - if (m_settings.protocols.value() != dialog.protocol()) { - m_settings.protocols.setValue(dialog.protocol()); - m_settings.writeSettings(); + if (settings().protocols() != dialog.protocol()) { + settings().protocols.setValue(dialog.protocol()); + settings().writeSettings(); } const QString pasteID = dialog.pasteId(); @@ -295,10 +294,10 @@ void CodePasterPluginPrivate::fetch() void CodePasterPluginPrivate::finishPost(const QString &link) { - if (m_settings.copyToClipboard.value()) + if (settings().copyToClipboard()) Utils::setClipboardAndSelection(link); - if (m_settings.displayOutput.value()) + if (settings().displayOutput()) MessageManager::writeDisrupting(link); else MessageManager::writeFlashing(link); diff --git a/src/plugins/cpaster/fileshareprotocol.cpp b/src/plugins/cpaster/fileshareprotocol.cpp index e67eac346a9..853805d0c99 100644 --- a/src/plugins/cpaster/fileshareprotocol.cpp +++ b/src/plugins/cpaster/fileshareprotocol.cpp @@ -34,7 +34,7 @@ FileShareProtocol::~FileShareProtocol() = default; QString FileShareProtocol::name() const { - return m_settings.displayName(); + return fileShareSettingsPage().displayName(); } unsigned FileShareProtocol::capabilities() const @@ -49,7 +49,7 @@ bool FileShareProtocol::hasSettings() const const Core::IOptionsPage *FileShareProtocol::settingsPage() const { - return &m_settings; + return &fileShareSettingsPage(); } static bool parse(const QString &fileName, @@ -100,7 +100,7 @@ static bool parse(const QString &fileName, bool FileShareProtocol::checkConfiguration(QString *errorMessage) { - if (m_settings.path().isEmpty()) { + if (fileShareSettings().path().isEmpty()) { if (errorMessage) *errorMessage = Tr::tr("Please configure a path."); return false; @@ -113,7 +113,7 @@ void FileShareProtocol::fetch(const QString &id) // Absolute or relative path name. QFileInfo fi(id); if (fi.isRelative()) - fi = m_settings.path().pathAppended(id).toFileInfo(); + fi = fileShareSettings().path().pathAppended(id).toFileInfo(); QString errorMessage; QString text; if (parse(fi.absoluteFilePath(), &errorMessage, nullptr, nullptr, &text)) @@ -125,7 +125,7 @@ void FileShareProtocol::fetch(const QString &id) void FileShareProtocol::list() { // Read out directory, display by date (latest first) - QDir dir(m_settings.path().toFSPathString(), tempGlobPatternC, + QDir dir(fileShareSettings().path().toFSPathString(), tempGlobPatternC, QDir::Time, QDir::Files|QDir::NoDotAndDotDot|QDir::Readable); QStringList entries; QString user; @@ -133,7 +133,7 @@ void FileShareProtocol::list() QString errorMessage; const QChar blank = QLatin1Char(' '); const QFileInfoList entryInfoList = dir.entryInfoList(); - const int count = qMin(int(m_settings.displayCount()), entryInfoList.size()); + const int count = qMin(int(fileShareSettings().displayCount()), entryInfoList.size()); for (int i = 0; i < count; i++) { const QFileInfo& entryFi = entryInfoList.at(i); if (parse(entryFi.absoluteFilePath(), &errorMessage, &user, &description)) { @@ -160,7 +160,7 @@ void FileShareProtocol::paste( ) { // Write out temp XML file - Utils::TempFileSaver saver(m_settings.path().pathAppended(tempPatternC).toFSPathString()); + Utils::TempFileSaver saver(fileShareSettings().path().pathAppended(tempPatternC).toFSPathString()); saver.setAutoRemove(false); if (!saver.hasError()) { // Flat text sections embedded into pasterElement diff --git a/src/plugins/cpaster/fileshareprotocol.h b/src/plugins/cpaster/fileshareprotocol.h index db03bb11bf6..71d98d078f8 100644 --- a/src/plugins/cpaster/fileshareprotocol.h +++ b/src/plugins/cpaster/fileshareprotocol.h @@ -4,7 +4,6 @@ #pragma once #include "protocol.h" -#include "fileshareprotocolsettingspage.h" namespace CodePaster { @@ -30,9 +29,6 @@ public: const QString &username = QString(), const QString &comment = QString(), const QString &description = QString()) override; - -private: - FileShareProtocolSettings m_settings; }; } // CodePaster diff --git a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp index 6d26f630791..a5da0a6aa82 100644 --- a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp +++ b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp @@ -13,11 +13,15 @@ using namespace Utils; namespace CodePaster { +FileShareProtocolSettings &fileShareSettings() +{ + static FileShareProtocolSettings theSettings; + return theSettings; +} + FileShareProtocolSettings::FileShareProtocolSettings() { - setId("X.CodePaster.FileSharePaster"); - setDisplayName(Tr::tr("Fileshare")); - setCategory(Constants::CPASTER_SETTINGS_CATEGORY); + setAutoApply(false); setSettingsGroup("FileSharePasterSettings"); path.setSettingsKey("Path"); @@ -51,4 +55,22 @@ FileShareProtocolSettings::FileShareProtocolSettings() readSettings(); } +class FileShareProtocolSettingsPage final : public Core::IOptionsPage +{ +public: + FileShareProtocolSettingsPage() + { + setId("X.CodePaster.FileSharePaster"); + setDisplayName(Tr::tr("Fileshare")); + setCategory(Constants::CPASTER_SETTINGS_CATEGORY); + setSettingsProvider([] { return &fileShareSettings(); }); + } +}; + +Core::IOptionsPage &fileShareSettingsPage() +{ + static FileShareProtocolSettingsPage theSettings; + return theSettings; +} + } // namespace CodePaster diff --git a/src/plugins/cpaster/fileshareprotocolsettingspage.h b/src/plugins/cpaster/fileshareprotocolsettingspage.h index 8775fe16096..564aa7f8251 100644 --- a/src/plugins/cpaster/fileshareprotocolsettingspage.h +++ b/src/plugins/cpaster/fileshareprotocolsettingspage.h @@ -7,7 +7,7 @@ namespace CodePaster { -class FileShareProtocolSettings : public Core::PagedSettings +class FileShareProtocolSettings final : public Utils::AspectContainer { public: FileShareProtocolSettings(); @@ -16,4 +16,8 @@ public: Utils::IntegerAspect displayCount{this}; }; +FileShareProtocolSettings &fileShareSettings(); + +Core::IOptionsPage &fileShareSettingsPage(); + } // CodePaster diff --git a/src/plugins/cpaster/settings.cpp b/src/plugins/cpaster/settings.cpp index 1c3d9e5e4db..597b3080f9b 100644 --- a/src/plugins/cpaster/settings.cpp +++ b/src/plugins/cpaster/settings.cpp @@ -6,21 +6,24 @@ #include "cpasterconstants.h" #include "cpastertr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/layoutbuilder.h> using namespace Utils; namespace CodePaster { +Settings &settings() +{ + static Settings theSettings; + return theSettings; +} + Settings::Settings() { setSettingsGroup("CodePaster"); setAutoApply(false); - setId("A.CodePaster.General"); - setDisplayName(Tr::tr("General")); - setCategory(Constants::CPASTER_SETTINGS_CATEGORY); - setDisplayCategory(Tr::tr("Code Pasting")); - setCategoryIconPath(":/cpaster/images/settingscategory_cpaster.png"); username.setDisplayStyle(StringAspect::LineEditDisplay); username.setSettingsKey("UserName"); @@ -64,4 +67,20 @@ Settings::Settings() }); } +class CPasterSettingsPage final : public Core::IOptionsPage +{ +public: + CPasterSettingsPage() + { + setId("A.CodePaster.General"); + setDisplayName(Tr::tr("General")); + setCategory(Constants::CPASTER_SETTINGS_CATEGORY); + setDisplayCategory(Tr::tr("Code Pasting")); + setCategoryIconPath(":/cpaster/images/settingscategory_cpaster.png"); + setSettingsProvider([] { return &settings(); }); + } +}; + +const CPasterSettingsPage settingsPage; + } // CodePaster diff --git a/src/plugins/cpaster/settings.h b/src/plugins/cpaster/settings.h index 1e7d03be761..f17df36caef 100644 --- a/src/plugins/cpaster/settings.h +++ b/src/plugins/cpaster/settings.h @@ -3,11 +3,11 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> namespace CodePaster { -class Settings : public Core::PagedSettings +class Settings final : public Utils::AspectContainer { public: Settings(); @@ -19,4 +19,6 @@ public: Utils::BoolAspect displayOutput{this}; }; +Settings &settings(); + } // CodePaster From 0fdee5e000c4430c5e09eac8eb2eadf79f647179 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 16:06:25 +0200 Subject: [PATCH 0345/1777] Qbs: Use aspects more directly in QbsBuildStep Change-Id: I592dd23210bda3519f0e4bffe677f18a6b80c1ad Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../qbsprojectmanager/qbsbuildstep.cpp | 179 ++++++++---------- src/plugins/qbsprojectmanager/qbsbuildstep.h | 47 +++-- 2 files changed, 106 insertions(+), 120 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index afb94652416..7a8cf613866 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -56,27 +56,8 @@ using namespace Utils; namespace QbsProjectManager { namespace Internal { -class ArchitecturesAspect : public Utils::MultiSelectionAspect -{ - Q_OBJECT -public: - ArchitecturesAspect(); - - void setKit(const ProjectExplorer::Kit *kit) { m_kit = kit; } - void addToLayout(Layouting::LayoutItem &parent) override; - QStringList selectedArchitectures() const; - void setSelectedArchitectures(const QStringList& architectures); - bool isManagedByTarget() const { return m_isManagedByTarget; } - -private: - void setVisibleDynamic(bool visible); - - const ProjectExplorer::Kit *m_kit = nullptr; - QMap<QString, QString> m_abisToArchMap; - bool m_isManagedByTarget = false; -}; - -ArchitecturesAspect::ArchitecturesAspect() +ArchitecturesAspect::ArchitecturesAspect(AspectContainer *container) + : MultiSelectionAspect(container) { m_abisToArchMap = { {ProjectExplorer::Constants::ANDROID_ABI_ARMEABI_V7A, "armv7a"}, @@ -205,71 +186,62 @@ QbsBuildStep::QbsBuildStep(BuildStepList *bsl, Utils::Id id) : connect(this, &QbsBuildStep::qbsConfigurationChanged, qbsBuildConfig, &QbsBuildConfiguration::qbsConfigurationChanged); - m_buildVariant = addAspect<SelectionAspect>(); - m_buildVariant->setDisplayName(QbsProjectManager::Tr::tr("Build variant:")); - m_buildVariant->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - m_buildVariant->addOption({ProjectExplorer::Tr::tr("Debug"), {}, Constants::QBS_VARIANT_DEBUG}); - m_buildVariant->addOption({ProjectExplorer::Tr::tr("Release"), {}, - Constants::QBS_VARIANT_RELEASE}); - m_buildVariant->addOption({ProjectExplorer::Tr::tr("Profile"), {}, - Constants::QBS_VARIANT_PROFILING}); + buildVariantHolder.setDisplayName(QbsProjectManager::Tr::tr("Build variant:")); + buildVariantHolder.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + buildVariantHolder.addOption({ProjectExplorer::Tr::tr("Debug"), {}, Constants::QBS_VARIANT_DEBUG}); + buildVariantHolder.addOption({ProjectExplorer::Tr::tr("Release"), {}, + Constants::QBS_VARIANT_RELEASE}); + buildVariantHolder.addOption({ProjectExplorer::Tr::tr("Profile"), {}, + Constants::QBS_VARIANT_PROFILING}); - m_selectedAbis = addAspect<ArchitecturesAspect>(); - m_selectedAbis->setLabelText(QbsProjectManager::Tr::tr("ABIs:")); - m_selectedAbis->setDisplayStyle(MultiSelectionAspect::DisplayStyle::ListView); - m_selectedAbis->setKit(target()->kit()); + selectedAbis.setLabelText(QbsProjectManager::Tr::tr("ABIs:")); + selectedAbis.setDisplayStyle(MultiSelectionAspect::DisplayStyle::ListView); + selectedAbis.setKit(target()->kit()); - m_keepGoing = addAspect<BoolAspect>(); - m_keepGoing->setSettingsKey(QBS_KEEP_GOING); - m_keepGoing->setToolTip( - QbsProjectManager::Tr::tr("Keep going when errors occur (if at all possible).")); - m_keepGoing->setLabel(QbsProjectManager::Tr::tr("Keep going"), + keepGoing.setSettingsKey(QBS_KEEP_GOING); + keepGoing.setToolTip( + QbsProjectManager::Tr::tr("Keep going when errors occur (if at all possible).")); + keepGoing.setLabel(QbsProjectManager::Tr::tr("Keep going"), + BoolAspect::LabelPlacement::AtCheckBox); + + maxJobCount.setSettingsKey(QBS_MAXJOBCOUNT); + maxJobCount.setLabel(QbsProjectManager::Tr::tr("Parallel jobs:")); + maxJobCount.setToolTip(QbsProjectManager::Tr::tr("Number of concurrent build jobs.")); + maxJobCount.setValue(QThread::idealThreadCount()); + + showCommandLines.setSettingsKey(QBS_SHOWCOMMANDLINES); + showCommandLines.setLabel(QbsProjectManager::Tr::tr("Show command lines"), + BoolAspect::LabelPlacement::AtCheckBox); + + install.setSettingsKey(QBS_INSTALL); + install.setValue(true); + install.setLabel(QbsProjectManager::Tr::tr("Install"), BoolAspect::LabelPlacement::AtCheckBox); + + cleanInstallRoot.setSettingsKey(QBS_CLEAN_INSTALL_ROOT); + cleanInstallRoot.setLabel(QbsProjectManager::Tr::tr("Clean install root"), + BoolAspect::LabelPlacement::AtCheckBox); + + forceProbes.setSettingsKey("Qbs.forceProbesKey"); + forceProbes.setLabel(QbsProjectManager::Tr::tr("Force probes"), BoolAspect::LabelPlacement::AtCheckBox); - m_maxJobCount = addAspect<IntegerAspect>(); - m_maxJobCount->setSettingsKey(QBS_MAXJOBCOUNT); - m_maxJobCount->setLabel(QbsProjectManager::Tr::tr("Parallel jobs:")); - m_maxJobCount->setToolTip(QbsProjectManager::Tr::tr("Number of concurrent build jobs.")); - m_maxJobCount->setValue(QThread::idealThreadCount()); + commandLine.setDisplayStyle(StringAspect::TextEditDisplay); + commandLine.setLabelText(QbsProjectManager::Tr::tr("Equivalent command line:")); + commandLine.setUndoRedoEnabled(false); + commandLine.setReadOnly(true); - m_showCommandLines = addAspect<BoolAspect>(); - m_showCommandLines->setSettingsKey(QBS_SHOWCOMMANDLINES); - m_showCommandLines->setLabel(QbsProjectManager::Tr::tr("Show command lines"), - BoolAspect::LabelPlacement::AtCheckBox); + connect(&maxJobCount, &BaseAspect::changed, this, &QbsBuildStep::updateState); + connect(&keepGoing, &BaseAspect::changed, this, &QbsBuildStep::updateState); + connect(&showCommandLines, &BaseAspect::changed, this, &QbsBuildStep::updateState); + connect(&install, &BaseAspect::changed, this, &QbsBuildStep::updateState); + connect(&cleanInstallRoot, &BaseAspect::changed, this, &QbsBuildStep::updateState); + connect(&forceProbes, &BaseAspect::changed, this, &QbsBuildStep::updateState); - m_install = addAspect<BoolAspect>(); - m_install->setSettingsKey(QBS_INSTALL); - m_install->setValue(true); - m_install->setLabel(QbsProjectManager::Tr::tr("Install"), BoolAspect::LabelPlacement::AtCheckBox); - - m_cleanInstallDir = addAspect<BoolAspect>(); - m_cleanInstallDir->setSettingsKey(QBS_CLEAN_INSTALL_ROOT); - m_cleanInstallDir->setLabel(QbsProjectManager::Tr::tr("Clean install root"), - BoolAspect::LabelPlacement::AtCheckBox); - - m_forceProbes = addAspect<BoolAspect>(); - m_forceProbes->setSettingsKey("Qbs.forceProbesKey"); - m_forceProbes->setLabel(QbsProjectManager::Tr::tr("Force probes"), - BoolAspect::LabelPlacement::AtCheckBox); - - m_commandLine = addAspect<StringAspect>(); - m_commandLine->setDisplayStyle(StringAspect::TextEditDisplay); - m_commandLine->setLabelText(QbsProjectManager::Tr::tr("Equivalent command line:")); - m_commandLine->setUndoRedoEnabled(false); - m_commandLine->setReadOnly(true); - - connect(m_maxJobCount, &BaseAspect::changed, this, &QbsBuildStep::updateState); - connect(m_keepGoing, &BaseAspect::changed, this, &QbsBuildStep::updateState); - connect(m_showCommandLines, &BaseAspect::changed, this, &QbsBuildStep::updateState); - connect(m_install, &BaseAspect::changed, this, &QbsBuildStep::updateState); - connect(m_cleanInstallDir, &BaseAspect::changed, this, &QbsBuildStep::updateState); - connect(m_forceProbes, &BaseAspect::changed, this, &QbsBuildStep::updateState); - - connect(m_buildVariant, &SelectionAspect::changed, this, [this] { - setBuildVariant(m_buildVariant->itemValue().toString()); + connect(&buildVariantHolder, &BaseAspect::changed, this, [this] { + setBuildVariant(buildVariantHolder.itemValue().toString()); }); - connect(m_selectedAbis, &SelectionAspect::changed, [this] { - setConfiguredArchitectures(m_selectedAbis->selectedArchitectures()); }); + connect(&selectedAbis, &BaseAspect::changed, [this] { + setConfiguredArchitectures(selectedAbis.selectedArchitectures()); }); } QbsBuildStep::~QbsBuildStep() @@ -327,7 +299,7 @@ QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) co { QVariantMap config = m_qbsConfiguration; const auto qbsBuildConfig = static_cast<QbsBuildConfiguration *>(buildConfiguration()); - config.insert(Constants::QBS_FORCE_PROBES_KEY, m_forceProbes->value()); + config.insert(Constants::QBS_FORCE_PROBES_KEY, forceProbes()); const auto store = [&config](TriState ts, const QString &key) { if (ts == TriState::Enabled) @@ -370,8 +342,7 @@ void QbsBuildStep::setQbsConfiguration(const QVariantMap &config) if (tmp == m_qbsConfiguration) return; m_qbsConfiguration = tmp; - if (m_buildVariant) - m_buildVariant->setValue(m_buildVariant->indexForItemValue(buildVariant)); + buildVariantHolder.setValue(buildVariantHolder.indexForItemValue(buildVariant)); if (ProjectExplorer::BuildConfiguration *bc = buildConfiguration()) emit bc->buildTypeChanged(); emit qbsConfigurationChanged(); @@ -396,8 +367,8 @@ Utils::FilePath QbsBuildStep::installRoot(VariableHandling variableHandling) con int QbsBuildStep::maxJobs() const { - if (m_maxJobCount->value() > 0) - return m_maxJobCount->value(); + if (maxJobCount() > 0) + return maxJobCount(); return QThread::idealThreadCount(); } @@ -609,12 +580,12 @@ QbsBuildStepData QbsBuildStep::stepData() const QbsBuildStepData data; data.command = "build"; data.dryRun = false; - data.keepGoing = m_keepGoing->value(); - data.forceProbeExecution = m_forceProbes->value(); - data.showCommandLines = m_showCommandLines->value(); - data.noInstall = !m_install->value(); + data.keepGoing = keepGoing(); + data.forceProbeExecution = forceProbes(); + data.showCommandLines = showCommandLines(); + data.noInstall = !install(); data.noBuild = false; - data.cleanInstallRoot = m_cleanInstallDir->value(); + data.cleanInstallRoot = cleanInstallRoot(); data.jobCount = maxJobs(); data.installRoot = installRoot(); return data; @@ -660,23 +631,23 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) using namespace Layouting; Form { - m_qbsStep->m_buildVariant, br, - m_qbsStep->m_selectedAbis, br, - m_qbsStep->m_maxJobCount, br, + step->buildVariantHolder, br, + step->selectedAbis, br, + step->maxJobCount, br, QbsProjectManager::Tr::tr("Properties:"), propertyEdit, br, QbsProjectManager::Tr::tr("Flags:"), - m_qbsStep->m_keepGoing, - m_qbsStep->m_showCommandLines, - m_qbsStep->m_forceProbes, br, + step->keepGoing, + step->showCommandLines, + step->forceProbes, br, QbsProjectManager::Tr::tr("Installation flags:"), - m_qbsStep->m_install, - m_qbsStep->m_cleanInstallDir, + step->install, + step->cleanInstallRoot, defaultInstallDirCheckBox, br, QbsProjectManager::Tr::tr("Installation directory:"), installDirChooser, br, - m_qbsStep->m_commandLine, br, + step->commandLine, br, noMargin, }.attachTo(this); @@ -706,7 +677,7 @@ void QbsBuildStepConfigWidget::updateState() updatePropertyEdit(m_qbsStep->qbsConfiguration(QbsBuildStep::PreserveVariables)); installDirChooser->setFilePath(m_qbsStep->installRoot(QbsBuildStep::PreserveVariables)); defaultInstallDirCheckBox->setChecked(!m_qbsStep->hasCustomInstallRoot()); - m_qbsStep->m_selectedAbis->setSelectedArchitectures(m_qbsStep->configuredArchitectures()); + m_qbsStep->selectedAbis.setSelectedArchitectures(m_qbsStep->configuredArchitectures()); } const auto qbsBuildConfig = static_cast<QbsBuildConfiguration *>(m_qbsStep->buildConfiguration()); @@ -717,7 +688,7 @@ void QbsBuildStepConfigWidget::updateState() command += ' ' + m_propertyCache.at(i).name + ':' + m_propertyCache.at(i).effectiveValue; } - if (m_qbsStep->m_selectedAbis->isManagedByTarget()) { + if (m_qbsStep->selectedAbis.isManagedByTarget()) { QStringList selectedArchitectures = m_qbsStep->configuredArchitectures(); if (!selectedArchitectures.isEmpty()) { command += ' ' + QLatin1String(Constants::QBS_ARCHITECTURES) + ':' + @@ -742,7 +713,7 @@ void QbsBuildStepConfigWidget::updateState() addToCommand(qbsBuildConfig->qtQuickCompilerSetting(), Constants::QBS_CONFIG_QUICK_COMPILER_KEY); - m_qbsStep->m_commandLine->setValue(command); + m_qbsStep->commandLine.setValue(command); } @@ -759,7 +730,7 @@ void QbsBuildStepConfigWidget::updatePropertyEdit(const QVariantMap &data) editable.remove(Constants::QBS_CONFIG_QUICK_COMPILER_KEY); editable.remove(Constants::QBS_FORCE_PROBES_KEY); editable.remove(Constants::QBS_INSTALL_ROOT_KEY); - if (m_qbsStep->m_selectedAbis->isManagedByTarget()) + if (m_qbsStep->selectedAbis.isManagedByTarget()) editable.remove(Constants::QBS_ARCHITECTURES); QStringList propertyList; @@ -806,7 +777,7 @@ void QbsBuildStepConfigWidget::applyCachedProperties() Constants::QBS_CONFIG_QUICK_COMPILER_KEY, Constants::QBS_CONFIG_SEPARATE_DEBUG_INFO_KEY, Constants::QBS_INSTALL_ROOT_KEY}); - if (m_qbsStep->m_selectedAbis->isManagedByTarget()) + if (m_qbsStep->selectedAbis.isManagedByTarget()) additionalSpecialKeys << Constants::QBS_ARCHITECTURES; for (const QString &key : std::as_const(additionalSpecialKeys)) { const auto it = tmp.constFind(key); @@ -849,7 +820,7 @@ bool QbsBuildStepConfigWidget::validateProperties(Utils::FancyLineEdit *edit, QS Constants::QBS_CONFIG_QUICK_DEBUG_KEY, Constants::QBS_CONFIG_QUICK_COMPILER_KEY, Constants::QBS_INSTALL_ROOT_KEY, Constants::QBS_CONFIG_SEPARATE_DEBUG_INFO_KEY, }; - if (m_qbsStep->m_selectedAbis->isManagedByTarget()) + if (m_qbsStep->selectedAbis.isManagedByTarget()) specialProperties << Constants::QBS_ARCHITECTURES; if (specialProperties.contains(propertyName)) { if (errorMessage) { diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index e15ceb79e83..7938f5137f6 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -15,9 +15,29 @@ class ErrorInfo; class QbsProject; class QbsSession; -class ArchitecturesAspect; class QbsBuildStepConfigWidget; +class ArchitecturesAspect : public Utils::MultiSelectionAspect +{ + Q_OBJECT + +public: + ArchitecturesAspect(Utils::AspectContainer *container = nullptr); + + void setKit(const ProjectExplorer::Kit *kit) { m_kit = kit; } + void addToLayout(Layouting::LayoutItem &parent) override; + QStringList selectedArchitectures() const; + void setSelectedArchitectures(const QStringList& architectures); + bool isManagedByTarget() const { return m_isManagedByTarget; } + +private: + void setVisibleDynamic(bool visible); + + const ProjectExplorer::Kit *m_kit = nullptr; + QMap<QString, QString> m_abisToArchMap; + bool m_isManagedByTarget = false; +}; + class QbsBuildStep final : public ProjectExplorer::BuildStep { Q_OBJECT @@ -35,16 +55,20 @@ public: QVariantMap qbsConfiguration(VariableHandling variableHandling) const; void setQbsConfiguration(const QVariantMap &config); - bool keepGoing() const { return m_keepGoing->value(); } - bool showCommandLines() const { return m_showCommandLines->value(); } - bool install() const { return m_install->value(); } - bool cleanInstallRoot() const { return m_cleanInstallDir->value(); } bool hasCustomInstallRoot() const; Utils::FilePath installRoot(VariableHandling variableHandling = ExpandVariables) const; - int maxJobs() const; QString buildVariant() const; + int maxJobs() const; - bool forceProbes() const { return m_forceProbes->value(); } + Utils::SelectionAspect buildVariantHolder{this}; + ArchitecturesAspect selectedAbis{this}; + Utils::IntegerAspect maxJobCount{this}; + Utils::BoolAspect keepGoing{this}; + Utils::BoolAspect showCommandLines{this}; + Utils::BoolAspect install{this}; + Utils::BoolAspect cleanInstallRoot{this}; + Utils::BoolAspect forceProbes{this}; + Utils::StringAspect commandLine{this}; QbsBuildSystem *qbsBuildSystem() const; QbsBuildStepData stepData() const; @@ -92,15 +116,6 @@ private: QStringList configuredArchitectures() const; QVariantMap m_qbsConfiguration; - Utils::SelectionAspect *m_buildVariant = nullptr; - ArchitecturesAspect *m_selectedAbis = nullptr; - Utils::IntegerAspect *m_maxJobCount = nullptr; - Utils::BoolAspect *m_keepGoing = nullptr; - Utils::BoolAspect *m_showCommandLines = nullptr; - Utils::BoolAspect *m_install = nullptr; - Utils::BoolAspect *m_cleanInstallDir = nullptr; - Utils::BoolAspect *m_forceProbes = nullptr; - Utils::StringAspect *m_commandLine = nullptr; // Temporary data: QStringList m_changedFiles; From 7a279669ef98c4ec52c36d7ff1f8d4d2e31f0d0d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 11:28:59 +0200 Subject: [PATCH 0346/1777] RemoteLinux: Use aspects more directly in RunConfiguration This also unconditionally adds the X11ForwardingAspect. Change-Id: I691d3b8fd8dc2c632938f256e34e3130c8524e5d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../remotelinuxrunconfiguration.cpp | 62 +++++++++---------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 8a9cf316662..ff608a6b27f 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -28,47 +28,45 @@ class RemoteLinuxRunConfiguration final : public RunConfiguration { public: RemoteLinuxRunConfiguration(Target *target, Id id); + + RemoteLinuxEnvironmentAspect environment{this}; + ExecutableAspect executable{this}; + SymbolFileAspect symbolFile{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; + TerminalAspect terminal{this}; + X11ForwardingAspect x11Forwarding{this}; + UseLibraryPathsAspect useLibraryPath{this}; }; RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(); - envAspect->setDeviceSelector(target, EnvironmentAspect::RunDevice); + environment.setDeviceSelector(target, EnvironmentAspect::RunDevice); - auto exeAspect = addAspect<ExecutableAspect>(); - exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); - exeAspect->setLabelText(Tr::tr("Executable on device:")); - exeAspect->setPlaceHolderText(Tr::tr("Remote path not set")); - exeAspect->makeOverridable("RemoteLinux.RunConfig.AlternateRemoteExecutable", + executable.setDeviceSelector(target, ExecutableAspect::RunDevice); + executable.setLabelText(Tr::tr("Executable on device:")); + executable.setPlaceHolderText(Tr::tr("Remote path not set")); + executable.makeOverridable("RemoteLinux.RunConfig.AlternateRemoteExecutable", "RemoteLinux.RunConfig.UseAlternateRemoteExecutable"); - exeAspect->setHistoryCompleter("RemoteLinux.AlternateExecutable.History"); + executable.setHistoryCompleter("RemoteLinux.AlternateExecutable.History"); - auto symbolsAspect = addAspect<SymbolFileAspect>(); - symbolsAspect->setLabelText(Tr::tr("Executable on host:")); - symbolsAspect->setDisplayStyle(SymbolFileAspect::LabelDisplay); + symbolFile.setLabelText(Tr::tr("Executable on host:")); + symbolFile.setDisplayStyle(SymbolFileAspect::LabelDisplay); - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); + arguments.setMacroExpander(macroExpander()); - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); - workingDirAspect->setEnvironment(envAspect); + workingDir.setMacroExpander(macroExpander()); + workingDir.setEnvironment(&environment); - if (HostOsInfo::isAnyUnixHost()) - addAspect<TerminalAspect>(); + terminal.setVisible(HostOsInfo::isAnyUnixHost()); - if (HostOsInfo::isAnyUnixHost()) { - auto x11Forwarding = addAspect<X11ForwardingAspect>(); - x11Forwarding->setMacroExpander(macroExpander()); - } + x11Forwarding.setMacroExpander(macroExpander()); - auto libAspect = addAspect<UseLibraryPathsAspect>(); - libAspect->setValue(false); - connect(libAspect, &UseLibraryPathsAspect::changed, - envAspect, &EnvironmentAspect::environmentChanged); + connect(&useLibraryPath, &BaseAspect::changed, + &environment, &EnvironmentAspect::environmentChanged); - setUpdater([this, target, exeAspect, symbolsAspect, libAspect] { + setUpdater([this, target] { const IDeviceConstPtr buildDevice = BuildDeviceKitAspect::device(target->kit()); const IDeviceConstPtr runDevice = DeviceKitAspect::device(target->kit()); QTC_ASSERT(buildDevice, return); @@ -78,15 +76,15 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Id id) const DeploymentData deploymentData = target->deploymentData(); const DeployableFile depFile = deploymentData.deployableForLocalFile(localExecutable); - exeAspect->setExecutable(runDevice->filePath(depFile.remoteFilePath())); - symbolsAspect->setValue(localExecutable); - libAspect->setEnabled(buildDevice == runDevice); + executable.setExecutable(runDevice->filePath(depFile.remoteFilePath())); + symbolFile.setValue(localExecutable); + useLibraryPath.setEnabled(buildDevice == runDevice); }); - envAspect->addModifier([this, libAspect](Environment &env) { + environment.addModifier([this](Environment &env) { BuildTargetInfo bti = buildTargetInfo(); if (bti.runEnvModifier) - bti.runEnvModifier(env, libAspect->value()); + bti.runEnvModifier(env, useLibraryPath()); }); connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); From c8e74916856fcc3d2f92fa9c2d4a9a956934b943 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 06:58:35 +0200 Subject: [PATCH 0347/1777] RemoteLinux: Use aspects more directly in RemoteLinuxCustomRunRC This now also unconditionally enables the X11ForwardingAspect. Change-Id: I5c4c69fcc2902bd6b842adba1ec93978b846f651 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../remotelinuxcustomrunconfiguration.cpp | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp index 631bc638b57..478fc1b1b40 100644 --- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp @@ -27,56 +27,56 @@ public: private: Tasks checkForIssues() const override; + + RemoteLinuxEnvironmentAspect environment{this}; + ExecutableAspect executable{this}; + SymbolFileAspect symbolFile{this}; + ArgumentsAspect arguments{this}; + WorkingDirectoryAspect workingDir{this}; + TerminalAspect terminal{this}; + X11ForwardingAspect x11Forwarding{this}; }; RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto envAspect = addAspect<RemoteLinuxEnvironmentAspect>(); - envAspect->setDeviceSelector(target, EnvironmentAspect::RunDevice); + environment.setDeviceSelector(target, EnvironmentAspect::RunDevice); - auto exeAspect = addAspect<ExecutableAspect>(); - exeAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); - exeAspect->setSettingsKey("RemoteLinux.CustomRunConfig.RemoteExecutable"); - exeAspect->setLabelText(Tr::tr("Remote executable:")); - exeAspect->setReadOnly(false); - exeAspect->setHistoryCompleter("RemoteLinux.CustomExecutable.History"); - exeAspect->setExpectedKind(PathChooser::Any); + executable.setDeviceSelector(target, ExecutableAspect::RunDevice); + executable.setSettingsKey("RemoteLinux.CustomRunConfig.RemoteExecutable"); + executable.setLabelText(Tr::tr("Remote executable:")); + executable.setReadOnly(false); + executable.setHistoryCompleter("RemoteLinux.CustomExecutable.History"); + executable.setExpectedKind(PathChooser::Any); - auto symbolsAspect = addAspect<FilePathAspect>(); - symbolsAspect->setSettingsKey("RemoteLinux.CustomRunConfig.LocalExecutable"); - symbolsAspect->setLabelText(Tr::tr("Local executable:")); + symbolFile.setSettingsKey("RemoteLinux.CustomRunConfig.LocalExecutable"); + symbolFile.setLabelText(Tr::tr("Local executable:")); - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); + arguments.setMacroExpander(macroExpander()); - auto workingDirAspect = addAspect<WorkingDirectoryAspect>(); - workingDirAspect->setMacroExpander(macroExpander()); - workingDirAspect->setEnvironment(envAspect); + workingDir.setMacroExpander(macroExpander()); + workingDir.setEnvironment(&environment); - if (HostOsInfo::isAnyUnixHost()) - addAspect<TerminalAspect>(); + terminal.setVisible(HostOsInfo::isAnyUnixHost()); - if (HostOsInfo::isAnyUnixHost()) { - auto x11Forwarding = addAspect<X11ForwardingAspect>(); - x11Forwarding->setMacroExpander(macroExpander()); - } + x11Forwarding.setMacroExpander(macroExpander()); setDefaultDisplayName(runConfigDefaultDisplayName()); } QString RemoteLinuxCustomRunConfiguration::runConfigDefaultDisplayName() { - QString remoteExecutable = aspect<ExecutableAspect>()->executable().toString(); + FilePath remoteExecutable = executable(); QString display = remoteExecutable.isEmpty() - ? Tr::tr("Custom Executable") : Tr::tr("Run \"%1\"").arg(remoteExecutable); - return RunConfigurationFactory::decoratedTargetName(display, target()); + ? Tr::tr("Custom Executable") + : Tr::tr("Run \"%1\"").arg(remoteExecutable.toUserOutput()); + return RunConfigurationFactory::decoratedTargetName(display, target()); } Tasks RemoteLinuxCustomRunConfiguration::checkForIssues() const { Tasks tasks; - if (aspect<ExecutableAspect>()->executable().isEmpty()) { + if (executable().isEmpty()) { tasks << createConfigurationIssue(Tr::tr("The remote executable must be set in order to run " "a custom remote run configuration.")); } From 7878b0bf9ad180cdd52bc9c7cdf2461621b76107 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 11:47:40 +0200 Subject: [PATCH 0348/1777] McuSupport: Use aspect more directly in RunConfiguration Change-Id: I75bd439a1747cf8c3dcb40327a7b614fc7438590 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../mcusupport/mcusupportrunconfiguration.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/mcusupport/mcusupportrunconfiguration.cpp b/src/plugins/mcusupport/mcusupportrunconfiguration.cpp index 8b80f09fccc..d428074dc8b 100644 --- a/src/plugins/mcusupport/mcusupportrunconfiguration.cpp +++ b/src/plugins/mcusupport/mcusupportrunconfiguration.cpp @@ -42,22 +42,23 @@ static QStringList flashAndRunArgs(const RunConfiguration *rc, const Target *tar class FlashAndRunConfiguration final : public RunConfiguration { public: - FlashAndRunConfiguration(Target *target, Utils::Id id) + FlashAndRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - auto flashAndRunParameters = addAspect<StringAspect>(); - flashAndRunParameters->setLabelText(Tr::tr("Flash and run CMake parameters:")); - flashAndRunParameters->setDisplayStyle(StringAspect::TextEditDisplay); - flashAndRunParameters->setSettingsKey("FlashAndRunConfiguration.Parameters"); + flashAndRunParameters.setLabelText(Tr::tr("Flash and run CMake parameters:")); + flashAndRunParameters.setDisplayStyle(StringAspect::TextEditDisplay); + flashAndRunParameters.setSettingsKey("FlashAndRunConfiguration.Parameters"); - setUpdater([target, flashAndRunParameters, this] { - flashAndRunParameters->setValue(flashAndRunArgs(this, target).join(' ')); + setUpdater([target, this] { + flashAndRunParameters.setValue(flashAndRunArgs(this, target).join(' ')); }); update(); connect(target->project(), &Project::displayNameChanged, this, &RunConfiguration::update); } + + StringAspect flashAndRunParameters{this}; }; class FlashAndRunWorker : public SimpleTargetRunner From abd770520a943e915e0e4d66d7637f8f2b84a271 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 11:37:28 +0200 Subject: [PATCH 0349/1777] Qbs: Avoid a FilePath/String round trip ... when creating tasks in the clean step Change-Id: I563d126416d266eff0b95baa4deb3133cb3e3dc9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/qbsprojectmanager/qbscleanstep.cpp | 7 ++++--- src/plugins/qbsprojectmanager/qbscleanstep.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.cpp b/src/plugins/qbsprojectmanager/qbscleanstep.cpp index a0e6916403a..9d6799a5fb1 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.cpp +++ b/src/plugins/qbsprojectmanager/qbscleanstep.cpp @@ -119,7 +119,7 @@ void QbsCleanStep::cleaningDone(const ErrorInfo &error) m_session = nullptr; for (const ErrorInfoItem &item : error.items) - createTaskAndOutput(Task::Error, item.description, item.filePath.toString(), item.line); + createTaskAndOutput(Task::Error, item.description, item.filePath, item.line); emit finished(!error.hasError()); } @@ -135,10 +135,11 @@ void QbsCleanStep::handleProgress(int value) emit progress(value * 100 / m_maxProgress, m_description); } -void QbsCleanStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message, const QString &file, int line) +void QbsCleanStep::createTaskAndOutput(Task::TaskType type, const QString &message, + const FilePath &file, int line) { emit addOutput(message, OutputFormat::Stdout); - emit addTask(CompileTask(type, message, Utils::FilePath::fromString(file), line), 1); + emit addTask(CompileTask(type, message, file, line), 1); } // -------------------------------------------------------------------- diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.h b/src/plugins/qbsprojectmanager/qbscleanstep.h index f7f1d58d018..b3552993366 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.h +++ b/src/plugins/qbsprojectmanager/qbscleanstep.h @@ -38,7 +38,7 @@ private: void handleProgress(int value); void createTaskAndOutput(ProjectExplorer::Task::TaskType type, - const QString &message, const QString &file, int line); + const QString &message, const Utils::FilePath &file, int line); Utils::BoolAspect dryRun{this}; Utils::BoolAspect keepGoing{this}; From baf5377b60ba388caffecbdc60642e855cb1c47e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 15:30:19 +0200 Subject: [PATCH 0350/1777] Docker: Simplify settings access Change-Id: I0ecbba9d29b041b06dac26159be702a38db42185 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/docker/dockerapi.cpp | 5 +-- src/plugins/docker/dockerapi.h | 3 +- src/plugins/docker/dockerdevice.cpp | 54 ++++++++++----------------- src/plugins/docker/dockerdevice.h | 8 ++-- src/plugins/docker/dockerplugin.cpp | 9 ++--- src/plugins/docker/dockersettings.cpp | 26 +++++++++++-- src/plugins/docker/dockersettings.h | 6 ++- 7 files changed, 57 insertions(+), 54 deletions(-) diff --git a/src/plugins/docker/dockerapi.cpp b/src/plugins/docker/dockerapi.cpp index baa9ed6be9f..fe89d590591 100644 --- a/src/plugins/docker/dockerapi.cpp +++ b/src/plugins/docker/dockerapi.cpp @@ -22,8 +22,7 @@ namespace Docker::Internal { DockerApi *s_instance{nullptr}; -DockerApi::DockerApi(DockerSettings *settings) - : m_settings(settings) +DockerApi::DockerApi() { s_instance = this; } @@ -103,7 +102,7 @@ std::optional<bool> DockerApi::isDockerDaemonAvailable(bool async) FilePath DockerApi::dockerClient() { - return m_settings->dockerBinaryPath(); + return settings().dockerBinaryPath(); } } // Docker::Internal diff --git a/src/plugins/docker/dockerapi.h b/src/plugins/docker/dockerapi.h index f422e542eb7..4866e84c66a 100644 --- a/src/plugins/docker/dockerapi.h +++ b/src/plugins/docker/dockerapi.h @@ -20,7 +20,7 @@ class DockerApi : public QObject Q_OBJECT public: - DockerApi(DockerSettings *settings); + DockerApi(); static DockerApi *instance(); @@ -40,7 +40,6 @@ private: std::optional<bool> m_dockerDaemonAvailable; QMutex m_daemonCheckGuard; - DockerSettings *m_settings; }; } // Docker::Internal diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 6059d77e309..c25f9458dae 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -90,16 +90,15 @@ namespace Docker::Internal { class ContainerShell : public Utils::DeviceShell { public: - ContainerShell(DockerSettings *settings, const QString &containerId, const FilePath &devicePath) - : m_settings(settings) - , m_containerId(containerId) + ContainerShell(const QString &containerId, const FilePath &devicePath) + : m_containerId(containerId) , m_devicePath(devicePath) {} private: void setupShellProcess(Process *shellProcess) final { - shellProcess->setCommand({m_settings->dockerBinaryPath(), + shellProcess->setCommand({settings().dockerBinaryPath(), {"container", "start", "-i", "-a", m_containerId}}); } @@ -111,7 +110,6 @@ private: } private: - DockerSettings *m_settings; QString m_containerId; FilePath m_devicePath; }; @@ -133,10 +131,9 @@ public: class DockerDevicePrivate : public QObject { public: - DockerDevicePrivate(DockerDevice *parent, DockerSettings *settings, DockerDeviceData data) + DockerDevicePrivate(DockerDevice *parent, DockerDeviceData data) : q(parent) , m_data(std::move(data)) - , m_settings(settings) {} ~DockerDevicePrivate() { stopCurrentContainer(); } @@ -152,7 +149,6 @@ public: QString containerId() { return m_container; } DockerDeviceData data() { return m_data; } void setData(const DockerDeviceData &data); - DockerSettings *settings() { return m_settings; } QString repoAndTag() const { return m_data.repoAndTag(); } QString repoAndTagEncoded() const { return m_data.repoAndTagEncoded(); } @@ -190,7 +186,6 @@ public: DockerDevice *const q; DockerDeviceData m_data; - DockerSettings *m_settings; struct TemporaryMountInfo { @@ -414,8 +409,8 @@ QString DockerDeviceFileAccess::mapToDevicePath(const QString &hostPath) const return newPath; } -DockerDevice::DockerDevice(DockerSettings *settings, const DockerDeviceData &data) - : d(new DockerDevicePrivate(this, settings, data)) +DockerDevice::DockerDevice(const DockerDeviceData &data) + : d(new DockerDevicePrivate(this, data)) { setFileAccess(&d->m_fileAccess); setDisplayType(Tr::tr("Docker")); @@ -492,13 +487,10 @@ CommandLine DockerDevicePrivate::withDockerExecCmd(const CommandLine &cmd, bool withPty, bool withMarker) { - if (!m_settings) - return {}; - if (!updateContainerAccess()) return {}; - CommandLine dockerCmd{m_settings->dockerBinaryPath(), {"exec"}}; + CommandLine dockerCmd{settings().dockerBinaryPath(), {"exec"}}; if (interactive) dockerCmd.addArg("-i"); @@ -538,8 +530,6 @@ CommandLine DockerDevicePrivate::withDockerExecCmd(const CommandLine &cmd, void DockerDevicePrivate::stopCurrentContainer() { - if (!m_settings) - return; if (m_container.isEmpty()) return; if (!DockerApi::isDockerDaemonAvailable(false).value_or(false)) @@ -555,7 +545,7 @@ void DockerDevicePrivate::stopCurrentContainer() } Process proc; - proc.setCommand({m_settings->dockerBinaryPath(), {"container", "stop", m_container}}); + proc.setCommand({settings().dockerBinaryPath(), {"container", "stop", m_container}}); m_container.clear(); @@ -660,7 +650,7 @@ bool DockerDevicePrivate::isImageAvailable() const { Process proc; proc.setCommand( - {m_settings->dockerBinaryPath(), + {settings().dockerBinaryPath(), {"image", "list", m_data.repoAndTag(), "--format", "{{.Repository}}:{{.Tag}}"}}); proc.runBlocking(); if (proc.result() != ProcessResult::FinishedWithSuccess) @@ -674,15 +664,12 @@ bool DockerDevicePrivate::isImageAvailable() const bool DockerDevicePrivate::createContainer() { - if (!m_settings) - return false; - if (!isImageAvailable()) return false; const QString display = HostOsInfo::isLinuxHost() ? QString(":0") : QString("host.docker.internal:0"); - CommandLine dockerCreate{m_settings->dockerBinaryPath(), + CommandLine dockerCreate{settings().dockerBinaryPath(), {"create", "-i", "--rm", @@ -734,7 +721,7 @@ bool DockerDevicePrivate::startContainer() if (!createContainer()) return false; - m_shell = std::make_unique<ContainerShell>(m_settings, m_container, q->rootPath()); + m_shell = std::make_unique<ContainerShell>(m_container, q->rootPath()); connect(m_shell.get(), &DeviceShell::done, this, [this](const ProcessResultData &resultData) { if (m_shell) @@ -979,9 +966,8 @@ public: class DockerDeviceSetupWizard final : public QDialog { public: - DockerDeviceSetupWizard(DockerSettings *settings) + DockerDeviceSetupWizard() : QDialog(ICore::dialogParent()) - , m_settings(settings) { setWindowTitle(Tr::tr("Docker Image Selection")); resize(800, 600); @@ -1050,7 +1036,7 @@ public: connect(m_buttons, &QDialogButtonBox::rejected, this, &QDialog::reject); m_buttons->button(QDialogButtonBox::Ok)->setEnabled(false); - CommandLine cmd{m_settings->dockerBinaryPath(), + CommandLine cmd{settings().dockerBinaryPath(), {"images", "--format", "{{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.Size}}"}}; m_log->append(Tr::tr("Running \"%1\"\n").arg(cmd.toUserOutput())); @@ -1106,7 +1092,7 @@ public: m_proxyModel->mapToSource(selectedRows.front())); QTC_ASSERT(item, return {}); - auto device = DockerDevice::create(m_settings, *item); + auto device = DockerDevice::create(*item); return device; } @@ -1117,7 +1103,6 @@ public: SortFilterModel *m_proxyModel = nullptr; QTextBrowser *m_log = nullptr; QDialogButtonBox *m_buttons; - DockerSettings *m_settings; Process *m_process = nullptr; QString m_selectedId; @@ -1125,19 +1110,19 @@ public: // Factory -DockerDeviceFactory::DockerDeviceFactory(DockerSettings *settings) +DockerDeviceFactory::DockerDeviceFactory() : IDeviceFactory(Constants::DOCKER_DEVICE_TYPE) { setDisplayName(Tr::tr("Docker Device")); setIcon(QIcon()); - setCreator([settings] { - DockerDeviceSetupWizard wizard(settings); + setCreator([] { + DockerDeviceSetupWizard wizard; if (wizard.exec() != QDialog::Accepted) return IDevice::Ptr(); return wizard.device(); }); - setConstructionFunction([settings, this] { - auto device = DockerDevice::create(settings, {}); + setConstructionFunction([this] { + auto device = DockerDevice::create({}); QMutexLocker lk(&m_deviceListMutex); m_existingDevices.push_back(device); return device; @@ -1193,7 +1178,6 @@ Environment DockerDevicePrivate::environment() void DockerDevicePrivate::shutdown() { m_isShutdown = true; - m_settings = nullptr; stopCurrentContainer(); } diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 596b047d0b8..6e40b585372 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -58,14 +58,14 @@ public: using Ptr = QSharedPointer<DockerDevice>; using ConstPtr = QSharedPointer<const DockerDevice>; - explicit DockerDevice(DockerSettings *settings, const DockerDeviceData &data); + explicit DockerDevice(const DockerDeviceData &data); ~DockerDevice(); void shutdown(); - static Ptr create(DockerSettings *settings, const DockerDeviceData &data) + static Ptr create(const DockerDeviceData &data) { - return Ptr(new DockerDevice(settings, data)); + return Ptr(new DockerDevice(data)); } ProjectExplorer::IDeviceWidget *createWidget() override; @@ -114,7 +114,7 @@ private: class DockerDeviceFactory final : public ProjectExplorer::IDeviceFactory { public: - DockerDeviceFactory(DockerSettings *settings); + DockerDeviceFactory(); void shutdownExistingDevices(); diff --git a/src/plugins/docker/dockerplugin.cpp b/src/plugins/docker/dockerplugin.cpp index 7e47abd7b1f..a3714f13148 100644 --- a/src/plugins/docker/dockerplugin.cpp +++ b/src/plugins/docker/dockerplugin.cpp @@ -6,7 +6,6 @@ #include "dockerapi.h" #include "dockerconstants.h" #include "dockerdevice.h" -#include "dockersettings.h" #include <projectexplorer/projectexplorerconstants.h> @@ -22,13 +21,13 @@ namespace Docker::Internal { class DockerPluginPrivate { public: - ~DockerPluginPrivate() { + ~DockerPluginPrivate() + { m_deviceFactory.shutdownExistingDevices(); } - DockerSettings m_settings; - DockerDeviceFactory m_deviceFactory{&m_settings}; - DockerApi m_dockerApi{&m_settings}; + DockerDeviceFactory m_deviceFactory; + DockerApi m_dockerApi; }; DockerPlugin::DockerPlugin() diff --git a/src/plugins/docker/dockersettings.cpp b/src/plugins/docker/dockersettings.cpp index 1057a066644..79ebb64841e 100644 --- a/src/plugins/docker/dockersettings.cpp +++ b/src/plugins/docker/dockersettings.cpp @@ -6,6 +6,8 @@ #include "dockerconstants.h" #include "dockertr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <projectexplorer/projectexplorerconstants.h> #include <utils/hostosinfo.h> @@ -15,12 +17,16 @@ using namespace Utils; namespace Docker::Internal { +DockerSettings &settings() +{ + static DockerSettings theSettings; + return theSettings; +} + DockerSettings::DockerSettings() { + setAutoApply(false); setSettingsGroup(Constants::DOCKER); - setId(Docker::Constants::DOCKER_SETTINGS_ID); - setDisplayName(Tr::tr("Docker")); - setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY); setLayouter([this] { using namespace Layouting; @@ -52,4 +58,18 @@ DockerSettings::DockerSettings() readSettings(); } +class DockerSettingsPage final : public Core::IOptionsPage +{ +public: + DockerSettingsPage() + { + setId(Docker::Constants::DOCKER_SETTINGS_ID); + setDisplayName(Tr::tr("Docker")); + setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY); + setSettingsProvider([] { return &settings(); }); + } +}; + +const DockerSettingsPage settingsPage; + } // Docker::Internal diff --git a/src/plugins/docker/dockersettings.h b/src/plugins/docker/dockersettings.h index 076acf6fa8c..77481a8eaee 100644 --- a/src/plugins/docker/dockersettings.h +++ b/src/plugins/docker/dockersettings.h @@ -3,11 +3,11 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> namespace Docker::Internal { -class DockerSettings final : public Core::PagedSettings +class DockerSettings final : public Utils::AspectContainer { public: DockerSettings(); @@ -15,4 +15,6 @@ public: Utils::FilePathAspect dockerBinaryPath{this}; }; +DockerSettings &settings(); + } // Docker::Internal From bd24f18dd5f7b54f402379f0f6cfaa231ef2462e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 15:38:02 +0200 Subject: [PATCH 0351/1777] Docker: Simplify plugin definition Change-Id: If37a8df1292f01f1048549adb135a65fda66a09f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/docker/CMakeLists.txt | 2 +- src/plugins/docker/docker.qbs | 1 - src/plugins/docker/dockerplugin.cpp | 49 +++++++++++++++-------------- src/plugins/docker/dockerplugin.h | 26 --------------- 4 files changed, 26 insertions(+), 52 deletions(-) delete mode 100644 src/plugins/docker/dockerplugin.h diff --git a/src/plugins/docker/CMakeLists.txt b/src/plugins/docker/CMakeLists.txt index b2773c25056..827c78732dc 100644 --- a/src/plugins/docker/CMakeLists.txt +++ b/src/plugins/docker/CMakeLists.txt @@ -8,7 +8,7 @@ add_qtc_plugin(Docker dockerconstants.h dockerdevice.cpp dockerdevice.h dockerdevicewidget.cpp dockerdevicewidget.h - dockerplugin.cpp dockerplugin.h + dockerplugin.cpp dockersettings.cpp dockersettings.h kitdetector.cpp kitdetector.h ) diff --git a/src/plugins/docker/docker.qbs b/src/plugins/docker/docker.qbs index d2e0dd416fd..a2cb29ae9e9 100644 --- a/src/plugins/docker/docker.qbs +++ b/src/plugins/docker/docker.qbs @@ -20,7 +20,6 @@ QtcPlugin { "dockerdevicewidget.cpp", "dockerdevicewidget.h", "dockerplugin.cpp", - "dockerplugin.h", "dockersettings.cpp", "dockersettings.h", "kitdetector.cpp", diff --git a/src/plugins/docker/dockerplugin.cpp b/src/plugins/docker/dockerplugin.cpp index a3714f13148..eb4ce5a7468 100644 --- a/src/plugins/docker/dockerplugin.cpp +++ b/src/plugins/docker/dockerplugin.cpp @@ -1,16 +1,15 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "dockerplugin.h" - #include "dockerapi.h" #include "dockerconstants.h" #include "dockerdevice.h" +#include <extensionsystem/iplugin.h> + #include <projectexplorer/projectexplorerconstants.h> #include <utils/fsengine/fsengine.h> -#include <utils/qtcassert.h> using namespace Core; using namespace ProjectExplorer; @@ -18,32 +17,34 @@ using namespace Utils; namespace Docker::Internal { -class DockerPluginPrivate +class DockerPlugin final : public ExtensionSystem::IPlugin { + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Docker.json") + public: - ~DockerPluginPrivate() + DockerPlugin() { - m_deviceFactory.shutdownExistingDevices(); + FSEngine::registerDeviceScheme(Constants::DOCKER_DEVICE_SCHEME); } - DockerDeviceFactory m_deviceFactory; - DockerApi m_dockerApi; +private: + ~DockerPlugin() final + { + FSEngine::unregisterDeviceScheme(Constants::DOCKER_DEVICE_SCHEME); + m_deviceFactory->shutdownExistingDevices(); + } + + void initialize() final + { + m_deviceFactory = std::make_unique<DockerDeviceFactory>(); + m_dockerApi = std::make_unique<DockerApi>(); + } + + std::unique_ptr<DockerDeviceFactory> m_deviceFactory; + std::unique_ptr<DockerApi> m_dockerApi; }; -DockerPlugin::DockerPlugin() -{ - FSEngine::registerDeviceScheme(Constants::DOCKER_DEVICE_SCHEME); -} +} // Docker::Internal -DockerPlugin::~DockerPlugin() -{ - FSEngine::unregisterDeviceScheme(Constants::DOCKER_DEVICE_SCHEME); - delete d; -} - -void DockerPlugin::initialize() -{ - d = new DockerPluginPrivate; -} - -} // Docker::Interanl +#include "dockerplugin.moc" diff --git a/src/plugins/docker/dockerplugin.h b/src/plugins/docker/dockerplugin.h deleted file mode 100644 index 267244709d8..00000000000 --- a/src/plugins/docker/dockerplugin.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <extensionsystem/iplugin.h> - -namespace Docker::Internal { - -class DockerPlugin final : public ExtensionSystem::IPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Docker.json") - -public: - DockerPlugin(); - -private: - ~DockerPlugin() final; - - void initialize() final; - - class DockerPluginPrivate *d = nullptr; -}; - -} // Docker::Internal From 17267bb15c2baa9bc9d60843a7c0ce037bce7cee Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 16:29:11 +0200 Subject: [PATCH 0352/1777] Copilot: Move closer to latest settings setup and usage pattern Change-Id: I86983f55cd53a540e2fe1a5b307ebf67f7ea7a98 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/copilot/CMakeLists.txt | 1 - src/plugins/copilot/copilot.qbs | 2 - src/plugins/copilot/copilotclient.cpp | 4 +- src/plugins/copilot/copilotoptionspage.cpp | 117 --------------------- src/plugins/copilot/copilotoptionspage.h | 18 ---- src/plugins/copilot/copilotplugin.cpp | 38 +++---- src/plugins/copilot/copilotplugin.h | 1 - src/plugins/copilot/copilotsettings.cpp | 116 +++++++++++++++++++- src/plugins/copilot/copilotsettings.h | 8 +- 9 files changed, 130 insertions(+), 175 deletions(-) delete mode 100644 src/plugins/copilot/copilotoptionspage.cpp delete mode 100644 src/plugins/copilot/copilotoptionspage.h diff --git a/src/plugins/copilot/CMakeLists.txt b/src/plugins/copilot/CMakeLists.txt index 01129674fce..f50890d0fd2 100644 --- a/src/plugins/copilot/CMakeLists.txt +++ b/src/plugins/copilot/CMakeLists.txt @@ -6,7 +6,6 @@ add_qtc_plugin(Copilot copilotclient.cpp copilotclient.h copilotconstants.h copilothoverhandler.cpp copilothoverhandler.h - copilotoptionspage.cpp copilotoptionspage.h copilotplugin.cpp copilotplugin.h copilotprojectpanel.cpp copilotprojectpanel.h copilotsettings.cpp copilotsettings.h diff --git a/src/plugins/copilot/copilot.qbs b/src/plugins/copilot/copilot.qbs index 714c45543d4..6d2b2100472 100644 --- a/src/plugins/copilot/copilot.qbs +++ b/src/plugins/copilot/copilot.qbs @@ -18,8 +18,6 @@ QtcPlugin { "copilotconstants.h", "copilothoverhandler.cpp", "copilothoverhandler.h", - "copilotoptionspage.cpp", - "copilotoptionspage.h", "copilotplugin.cpp", "copilotplugin.h", "copilotprojectpanel.cpp", diff --git a/src/plugins/copilot/copilotclient.cpp b/src/plugins/copilot/copilotclient.cpp index 061d5d4a459..3f624ca071c 100644 --- a/src/plugins/copilot/copilotclient.cpp +++ b/src/plugins/copilot/copilotclient.cpp @@ -92,7 +92,7 @@ void CopilotClient::openDocument(TextDocument *document) this, [this, document](int position, int charsRemoved, int charsAdded) { Q_UNUSED(charsRemoved) - if (!CopilotSettings::instance().autoComplete()) + if (!settings().autoComplete()) return; auto project = ProjectManager::projectForFile(document->filePath()); @@ -263,7 +263,7 @@ bool CopilotClient::canOpenProject(Project *project) bool CopilotClient::isEnabled(Project *project) { if (!project) - return CopilotSettings::instance().enableCopilot(); + return settings().enableCopilot(); CopilotProjectSettings settings(project); return settings.isEnabled(); diff --git a/src/plugins/copilot/copilotoptionspage.cpp b/src/plugins/copilot/copilotoptionspage.cpp deleted file mode 100644 index 07e21bf91e3..00000000000 --- a/src/plugins/copilot/copilotoptionspage.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 - -#include "copilotoptionspage.h" - -#include "authwidget.h" -#include "copilotconstants.h" -#include "copilotsettings.h" -#include "copilottr.h" - -#include <utils/layoutbuilder.h> -#include <utils/pathchooser.h> - -#include <QToolTip> - -using namespace Utils; -using namespace LanguageClient; - -namespace Copilot { - -class CopilotOptionsPageWidget : public Core::IOptionsPageWidget -{ -public: - CopilotOptionsPageWidget() - { - using namespace Layouting; - - auto warningLabel = new QLabel; - warningLabel->setWordWrap(true); - warningLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse - | Qt::LinksAccessibleByKeyboard - | Qt::TextSelectableByMouse); - warningLabel->setText(Tr::tr( - "Enabling %1 is subject to your agreement and abidance with your applicable " - "%1 terms. It is your responsibility to know and accept the requirements and " - "parameters of using tools like %1. This may include, but is not limited to, " - "ensuring you have the rights to allow %1 access to your code, as well as " - "understanding any implications of your use of %1 and suggestions produced " - "(like copyright, accuracy, etc.)." ).arg("Copilot")); - - auto authWidget = new AuthWidget(); - - auto helpLabel = new QLabel(); - helpLabel->setTextFormat(Qt::MarkdownText); - helpLabel->setWordWrap(true); - helpLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse - | Qt::LinksAccessibleByKeyboard - | Qt::TextSelectableByMouse); - helpLabel->setOpenExternalLinks(true); - connect(helpLabel, &QLabel::linkHovered, [](const QString &link) { - QToolTip::showText(QCursor::pos(), link); - }); - - // clang-format off - helpLabel->setText(Tr::tr( - "The Copilot plugin requires node.js and the Copilot neovim plugin. " - "If you install the neovim plugin as described in %1, " - "the plugin will find the agent.js file automatically.\n\n" - "Otherwise you need to specify the path to the %2 " - "file from the Copilot neovim plugin.", - "Markdown text for the copilot instruction label") - .arg("[README.md](https://github.com/github/copilot.vim)") - .arg("[agent.js](https://github.com/github/copilot.vim/tree/release/copilot/dist)")); - - Column { - QString("<b>" + Tr::tr("Note:") + "</b>"), br, - warningLabel, br, - CopilotSettings::instance().enableCopilot, br, - authWidget, br, - CopilotSettings::instance().nodeJsPath, br, - CopilotSettings::instance().distPath, br, - CopilotSettings::instance().autoComplete, br, - helpLabel, br, - st - }.attachTo(this); - // clang-format on - - auto updateAuthWidget = [authWidget]() { - authWidget->updateClient( - FilePath::fromUserInput(CopilotSettings::instance().nodeJsPath.volatileValue()), - FilePath::fromUserInput(CopilotSettings::instance().distPath.volatileValue())); - }; - - connect(CopilotSettings::instance().nodeJsPath.pathChooser(), - &PathChooser::textChanged, - authWidget, - updateAuthWidget); - connect(CopilotSettings::instance().distPath.pathChooser(), - &PathChooser::textChanged, - authWidget, - updateAuthWidget); - updateAuthWidget(); - - setOnApply([] { - CopilotSettings::instance().apply(); - CopilotSettings::instance().writeSettings(); - }); - } -}; - -CopilotOptionsPage::CopilotOptionsPage() -{ - setId(Constants::COPILOT_GENERAL_OPTIONS_ID); - setDisplayName("Copilot"); - setCategory(Constants::COPILOT_GENERAL_OPTIONS_CATEGORY); - setDisplayCategory(Constants::COPILOT_GENERAL_OPTIONS_DISPLAY_CATEGORY); - setCategoryIconPath(":/copilot/images/settingscategory_copilot.png"); - setWidgetCreator([] { return new CopilotOptionsPageWidget; }); -} - -CopilotOptionsPage &CopilotOptionsPage::instance() -{ - static CopilotOptionsPage settingsPage; - return settingsPage; -} - -} // namespace Copilot diff --git a/src/plugins/copilot/copilotoptionspage.h b/src/plugins/copilot/copilotoptionspage.h deleted file mode 100644 index 103e975b634..00000000000 --- a/src/plugins/copilot/copilotoptionspage.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <coreplugin/dialogs/ioptionspage.h> - -namespace Copilot { - -class CopilotOptionsPage : public Core::IOptionsPage -{ -public: - CopilotOptionsPage(); - - static CopilotOptionsPage &instance(); -}; - -} // Copilot diff --git a/src/plugins/copilot/copilotplugin.cpp b/src/plugins/copilot/copilotplugin.cpp index 4ecb1fdf40a..cfc5ab8c83c 100644 --- a/src/plugins/copilot/copilotplugin.cpp +++ b/src/plugins/copilot/copilotplugin.cpp @@ -6,7 +6,6 @@ #include "copilotclient.h" #include "copilotconstants.h" #include "copiloticons.h" -#include "copilotoptionspage.h" #include "copilotprojectpanel.h" #include "copilotsettings.h" #include "copilotsuggestion.h" @@ -34,6 +33,7 @@ namespace Copilot { namespace Internal { enum Direction { Previous, Next }; + void cycleSuggestion(TextEditor::TextEditorWidget *editor, Direction direction) { QTextBlock block = editor->textCursor().block(); @@ -57,14 +57,9 @@ void cycleSuggestion(TextEditor::TextEditorWidget *editor, Direction direction) void CopilotPlugin::initialize() { - CopilotSettings::instance().readSettings(); - restartClient(); - connect(&CopilotSettings::instance(), - &CopilotSettings::applied, - this, - &CopilotPlugin::restartClient); + connect(&settings(), &AspectContainer::applied, this, &CopilotPlugin::restartClient); QAction *requestAction = new QAction(this); requestAction->setText(Tr::tr("Request Copilot Suggestion")); @@ -108,8 +103,8 @@ void CopilotPlugin::initialize() disableAction->setText(Tr::tr("Disable Copilot")); disableAction->setToolTip(Tr::tr("Disable Copilot.")); connect(disableAction, &QAction::triggered, this, [] { - CopilotSettings::instance().enableCopilot.setValue(true); - CopilotSettings::instance().apply(); + settings().enableCopilot.setValue(true); + settings().apply(); }); ActionManager::registerAction(disableAction, Constants::COPILOT_DISABLE); @@ -117,32 +112,31 @@ void CopilotPlugin::initialize() enableAction->setText(Tr::tr("Enable Copilot")); enableAction->setToolTip(Tr::tr("Enable Copilot.")); connect(enableAction, &QAction::triggered, this, [] { - CopilotSettings::instance().enableCopilot.setValue(false); - CopilotSettings::instance().apply(); + settings().enableCopilot.setValue(false); + settings().apply(); }); ActionManager::registerAction(enableAction, Constants::COPILOT_ENABLE); QAction *toggleAction = new QAction(this); toggleAction->setText(Tr::tr("Toggle Copilot")); toggleAction->setCheckable(true); - toggleAction->setChecked(CopilotSettings::instance().enableCopilot.value()); + toggleAction->setChecked(settings().enableCopilot()); toggleAction->setIcon(COPILOT_ICON.icon()); connect(toggleAction, &QAction::toggled, this, [](bool checked) { - CopilotSettings::instance().enableCopilot.setValue(checked); - CopilotSettings::instance().apply(); + settings().enableCopilot.setValue(checked); + settings().apply(); }); ActionManager::registerAction(toggleAction, Constants::COPILOT_TOGGLE); auto updateActions = [toggleAction, requestAction] { - const bool enabled = CopilotSettings::instance().enableCopilot.value(); + const bool enabled = settings().enableCopilot(); toggleAction->setToolTip(enabled ? Tr::tr("Disable Copilot.") : Tr::tr("Enable Copilot.")); toggleAction->setChecked(enabled); requestAction->setEnabled(enabled); }; - connect(&CopilotSettings::instance().enableCopilot, &BaseAspect::changed, - this, updateActions); + connect(&settings().enableCopilot, &BaseAspect::changed, this, updateActions); updateActions(); @@ -157,19 +151,13 @@ void CopilotPlugin::initialize() ProjectPanelFactory::registerFactory(panelFactory); } -void CopilotPlugin::extensionsInitialized() -{ - (void)CopilotOptionsPage::instance(); -} - void CopilotPlugin::restartClient() { LanguageClient::LanguageClientManager::shutdownClient(m_client); - if (!CopilotSettings::instance().nodeJsPath().isExecutableFile()) + if (!settings().nodeJsPath().isExecutableFile()) return; - m_client = new CopilotClient(CopilotSettings::instance().nodeJsPath(), - CopilotSettings::instance().distPath()); + m_client = new CopilotClient(settings().nodeJsPath(), settings().distPath()); } ExtensionSystem::IPlugin::ShutdownFlag CopilotPlugin::aboutToShutdown() diff --git a/src/plugins/copilot/copilotplugin.h b/src/plugins/copilot/copilotplugin.h index 8c1a176a732..3533a17e831 100644 --- a/src/plugins/copilot/copilotplugin.h +++ b/src/plugins/copilot/copilotplugin.h @@ -19,7 +19,6 @@ class CopilotPlugin : public ExtensionSystem::IPlugin public: void initialize() override; - void extensionsInitialized() override; void restartClient(); ShutdownFlag aboutToShutdown() override; diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index 11e31623da1..089e30448aa 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -2,13 +2,21 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "copilotsettings.h" + +#include "authwidget.h" #include "copilotconstants.h" #include "copilottr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <projectexplorer/project.h> #include <utils/algorithm.h> #include <utils/environment.h> +#include <utils/layoutbuilder.h> +#include <utils/pathchooser.h> + +#include <QToolTip> using namespace Utils; @@ -23,7 +31,7 @@ static void initEnableAspect(BoolAspect &enableCopilot) enableCopilot.setDefaultValue(false); } -CopilotSettings &CopilotSettings::instance() +CopilotSettings &settings() { static CopilotSettings settings; return settings; @@ -79,6 +87,8 @@ CopilotSettings::CopilotSettings() "position after changes to the document.")); initEnableAspect(enableCopilot); + + readSettings(); } CopilotProjectSettings::CopilotProjectSettings(ProjectExplorer::Project *project, QObject *parent) @@ -106,7 +116,7 @@ void CopilotProjectSettings::setUseGlobalSettings(bool useGlobal) bool CopilotProjectSettings::isEnabled() const { if (useGlobalSettings()) - return CopilotSettings::instance().enableCopilot(); + return settings().enableCopilot(); return enableCopilot(); } @@ -117,7 +127,105 @@ void CopilotProjectSettings::save(ProjectExplorer::Project *project) project->setNamedSettings(Constants::COPILOT_PROJECT_SETTINGS_ID, map); // This triggers a restart of the Copilot language server. - CopilotSettings::instance().apply(); + settings().apply(); } -} // namespace Copilot +// CopilotOptionsPageWidget + +class CopilotOptionsPageWidget : public Core::IOptionsPageWidget +{ +public: + CopilotOptionsPageWidget() + { + using namespace Layouting; + + auto warningLabel = new QLabel; + warningLabel->setWordWrap(true); + warningLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse + | Qt::LinksAccessibleByKeyboard + | Qt::TextSelectableByMouse); + warningLabel->setText(Tr::tr( + "Enabling %1 is subject to your agreement and abidance with your applicable " + "%1 terms. It is your responsibility to know and accept the requirements and " + "parameters of using tools like %1. This may include, but is not limited to, " + "ensuring you have the rights to allow %1 access to your code, as well as " + "understanding any implications of your use of %1 and suggestions produced " + "(like copyright, accuracy, etc.)." ).arg("Copilot")); + + auto authWidget = new AuthWidget(); + + auto helpLabel = new QLabel(); + helpLabel->setTextFormat(Qt::MarkdownText); + helpLabel->setWordWrap(true); + helpLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse + | Qt::LinksAccessibleByKeyboard + | Qt::TextSelectableByMouse); + helpLabel->setOpenExternalLinks(true); + connect(helpLabel, &QLabel::linkHovered, [](const QString &link) { + QToolTip::showText(QCursor::pos(), link); + }); + + // clang-format off + helpLabel->setText(Tr::tr( + "The Copilot plugin requires node.js and the Copilot neovim plugin. " + "If you install the neovim plugin as described in %1, " + "the plugin will find the agent.js file automatically.\n\n" + "Otherwise you need to specify the path to the %2 " + "file from the Copilot neovim plugin.", + "Markdown text for the copilot instruction label") + .arg("[README.md](https://github.com/github/copilot.vim)") + .arg("[agent.js](https://github.com/github/copilot.vim/tree/release/copilot/dist)")); + + Column { + QString("<b>" + Tr::tr("Note:") + "</b>"), br, + warningLabel, br, + settings().enableCopilot, br, + authWidget, br, + settings().nodeJsPath, br, + settings().distPath, br, + settings().autoComplete, br, + helpLabel, br, + st + }.attachTo(this); + // clang-format on + + auto updateAuthWidget = [authWidget]() { + authWidget->updateClient( + FilePath::fromUserInput(settings().nodeJsPath.volatileValue()), + FilePath::fromUserInput(settings().distPath.volatileValue())); + }; + + connect(settings().nodeJsPath.pathChooser(), + &PathChooser::textChanged, + authWidget, + updateAuthWidget); + connect(settings().distPath.pathChooser(), + &PathChooser::textChanged, + authWidget, + updateAuthWidget); + updateAuthWidget(); + + setOnApply([] { + settings().apply(); + settings().writeSettings(); + }); + } +}; + +class CopilotSettingsPage : public Core::IOptionsPage +{ +public: + CopilotSettingsPage() + { + setId(Constants::COPILOT_GENERAL_OPTIONS_ID); + setDisplayName("Copilot"); + setCategory(Constants::COPILOT_GENERAL_OPTIONS_CATEGORY); + setDisplayCategory(Constants::COPILOT_GENERAL_OPTIONS_DISPLAY_CATEGORY); + setCategoryIconPath(":/copilot/images/settingscategory_copilot.png"); + setWidgetCreator([] { return new CopilotOptionsPageWidget; }); + } +}; + +const CopilotSettingsPage settingsPage; + +} // Copilot diff --git a/src/plugins/copilot/copilotsettings.h b/src/plugins/copilot/copilotsettings.h index cec44c43fed..2f66f48ffba 100644 --- a/src/plugins/copilot/copilotsettings.h +++ b/src/plugins/copilot/copilotsettings.h @@ -5,9 +5,7 @@ #include <utils/aspects.h> -namespace ProjectExplorer { -class Project; -} +namespace ProjectExplorer { class Project; } namespace Copilot { @@ -16,14 +14,14 @@ class CopilotSettings : public Utils::AspectContainer public: CopilotSettings(); - static CopilotSettings &instance(); - Utils::FilePathAspect nodeJsPath{this}; Utils::FilePathAspect distPath{this}; Utils::BoolAspect autoComplete{this}; Utils::BoolAspect enableCopilot{this}; }; +CopilotSettings &settings(); + class CopilotProjectSettings : public Utils::AspectContainer { public: From 3bfd60b708c12611e87a9a612d70e704c5d728e1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 16:36:07 +0200 Subject: [PATCH 0353/1777] Copilot: Move AuthWidget update to the class itself Change-Id: Iab23566c6d74760eab732fdbad2d9eac645faaff Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/copilot/authwidget.cpp | 16 ++++++++++++++-- src/plugins/copilot/copilotsettings.cpp | 16 ---------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/plugins/copilot/authwidget.cpp b/src/plugins/copilot/authwidget.cpp index 559dee30cf9..f4d9c0e0561 100644 --- a/src/plugins/copilot/authwidget.cpp +++ b/src/plugins/copilot/authwidget.cpp @@ -4,6 +4,7 @@ #include "authwidget.h" #include "copilotclient.h" +#include "copilotsettings.h" #include "copilottr.h" #include <utils/layoutbuilder.h> @@ -16,6 +17,7 @@ using namespace LanguageClient; using namespace Copilot::Internal; +using namespace Utils; namespace Copilot { @@ -26,7 +28,7 @@ AuthWidget::AuthWidget(QWidget *parent) m_button = new QPushButton(Tr::tr("Sign In")); m_button->setEnabled(false); - m_progressIndicator = new Utils::ProgressIndicator(Utils::ProgressIndicatorSize::Small); + m_progressIndicator = new ProgressIndicator(ProgressIndicatorSize::Small); m_progressIndicator->setVisible(false); m_statusLabel = new QLabel(); m_statusLabel->setVisible(false); @@ -48,6 +50,16 @@ AuthWidget::AuthWidget(QWidget *parent) else if (m_status == Status::SignedOut) signIn(); }); + + auto update = [this] { + updateClient(FilePath::fromUserInput(settings().nodeJsPath.volatileValue()), + FilePath::fromUserInput(settings().distPath.volatileValue())); + }; + + connect(settings().nodeJsPath.pathChooser(), &PathChooser::textChanged, this, update); + connect(settings().distPath.pathChooser(), &PathChooser::textChanged, this, update); + + update(); } AuthWidget::~AuthWidget() @@ -89,7 +101,7 @@ void AuthWidget::checkStatus() }); } -void AuthWidget::updateClient(const Utils::FilePath &nodeJs, const Utils::FilePath &agent) +void AuthWidget::updateClient(const FilePath &nodeJs, const FilePath &agent) { LanguageClientManager::shutdownClient(m_client); m_client = nullptr; diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index 089e30448aa..22c38f30e26 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -189,22 +189,6 @@ public: }.attachTo(this); // clang-format on - auto updateAuthWidget = [authWidget]() { - authWidget->updateClient( - FilePath::fromUserInput(settings().nodeJsPath.volatileValue()), - FilePath::fromUserInput(settings().distPath.volatileValue())); - }; - - connect(settings().nodeJsPath.pathChooser(), - &PathChooser::textChanged, - authWidget, - updateAuthWidget); - connect(settings().distPath.pathChooser(), - &PathChooser::textChanged, - authWidget, - updateAuthWidget); - updateAuthWidget(); - setOnApply([] { settings().apply(); settings().writeSettings(); From 6d5b0782380caa72f75d8d7352828b23e95ca303 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 12:13:00 +0200 Subject: [PATCH 0354/1777] QmlProjectManager: Use aspects more directly Change-Id: Ibfa91c541666ed81dbe5238075cafebd628f5889 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../qmlprojectrunconfiguration.cpp | 116 ++++++++---------- 1 file changed, 54 insertions(+), 62 deletions(-) diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 7cf8306a1ee..b5385bb4124 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -59,27 +59,29 @@ private: FilePath mainScript() const; FilePath qmlRuntimeFilePath() const; - void createQtVersionAspect(); + void setupQtVersionAspect(); + + FilePathAspect qmlViewer{this}; + ArgumentsAspect arguments{this}; + QmlMainFileAspect qmlMainFile{this}; + SelectionAspect qtversion{this}; + QmlMultiLanguageAspect multiLanguage{this}; + EnvironmentAspect environment{this}; + X11ForwardingAspect x11Forwarding{this}; - FilePathAspect *m_qmlViewerAspect = nullptr; - QmlMainFileAspect *m_qmlMainFileAspect = nullptr; - QmlMultiLanguageAspect *m_multiLanguageAspect = nullptr; - SelectionAspect *m_qtversionAspect = nullptr; mutable bool usePuppetAsQmlRuntime = false; }; QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) : RunConfiguration(target, id) { - m_qmlViewerAspect = addAspect<FilePathAspect>(); - m_qmlViewerAspect->setLabelText(Tr::tr("Override device QML viewer:")); - m_qmlViewerAspect->setPlaceHolderText(qmlRuntimeFilePath().toUserOutput()); - m_qmlViewerAspect->setHistoryCompleter("QmlProjectManager.viewer.history"); - m_qmlViewerAspect->setSettingsKey(Constants::QML_VIEWER_KEY); + qmlViewer.setSettingsKey(Constants::QML_VIEWER_KEY); + qmlViewer.setLabelText(Tr::tr("Override device QML viewer:")); + qmlViewer.setPlaceHolderText(qmlRuntimeFilePath().toUserOutput()); + qmlViewer.setHistoryCompleter("QmlProjectManager.viewer.history"); - auto argumentAspect = addAspect<ArgumentsAspect>(); - argumentAspect->setMacroExpander(macroExpander()); - argumentAspect->setSettingsKey(Constants::QML_VIEWER_ARGUMENTS_KEY); + arguments.setSettingsKey(Constants::QML_VIEWER_ARGUMENTS_KEY); + arguments.setMacroExpander(macroExpander()); setCommandLineGetter([this, target] { const FilePath qmlRuntime = qmlRuntimeFilePath(); @@ -88,7 +90,7 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) cmd.addArg("--qml-runtime"); // arguments in .user file - cmd.addArgs(aspect<ArgumentsAspect>()->arguments(), CommandLine::Raw); + cmd.addArgs(arguments(), CommandLine::Raw); // arguments from .qmlproject file const QmlBuildSystem *bs = qobject_cast<QmlBuildSystem *>(target->buildSystem()); @@ -120,35 +122,31 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) return cmd; }); - m_qmlMainFileAspect = addAspect<QmlMainFileAspect>(); - m_qmlMainFileAspect->setTarget(target); - connect(m_qmlMainFileAspect, &QmlMainFileAspect::changed, this, &RunConfiguration::update); + qmlMainFile.setTarget(target); + connect(&qmlMainFile, &BaseAspect::changed, this, &RunConfiguration::update); - createQtVersionAspect(); + if (QmlProject::isQtDesignStudio()) + setupQtVersionAspect(); + else + qtversion.setVisible(false); connect(target, &Target::kitChanged, this, &RunConfiguration::update); - m_multiLanguageAspect = addAspect<QmlMultiLanguageAspect>(); - m_multiLanguageAspect->setTarget(target); + multiLanguage.setTarget(target); auto buildSystem = qobject_cast<const QmlBuildSystem *>(activeBuildSystem()); if (buildSystem) - m_multiLanguageAspect->setValue(buildSystem->multilanguageSupport()); + multiLanguage.setValue(buildSystem->multilanguageSupport()); - auto envAspect = addAspect<EnvironmentAspect>(); - connect(m_multiLanguageAspect, - &QmlMultiLanguageAspect::changed, - envAspect, - &EnvironmentAspect::environmentChanged); + connect(&multiLanguage, &BaseAspect::changed, + &environment, &EnvironmentAspect::environmentChanged); auto envModifier = [this](Environment env) { if (auto bs = qobject_cast<const QmlBuildSystem *>(activeBuildSystem())) env.modify(bs->environment()); - if (m_multiLanguageAspect && m_multiLanguageAspect->value() - && !m_multiLanguageAspect->databaseFilePath().isEmpty()) { - env.set("QT_MULTILANGUAGE_DATABASE", - m_multiLanguageAspect->databaseFilePath().toString()); - env.set("QT_MULTILANGUAGE_LANGUAGE", m_multiLanguageAspect->currentLocale()); + if (multiLanguage() && !multiLanguage.databaseFilePath().isEmpty()) { + env.set("QT_MULTILANGUAGE_DATABASE", multiLanguage.databaseFilePath().path()); + env.set("QT_MULTILANGUAGE_LANGUAGE", multiLanguage.currentLocale()); } else { env.unset("QT_MULTILANGUAGE_DATABASE"); env.unset("QT_MULTILANGUAGE_LANGUAGE"); @@ -158,20 +156,17 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) const Id deviceTypeId = DeviceTypeKitAspect::deviceTypeId(target->kit()); if (deviceTypeId == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { - envAspect->addPreferredBaseEnvironment(Tr::tr("System Environment"), [envModifier] { + environment.addPreferredBaseEnvironment(Tr::tr("System Environment"), [envModifier] { return envModifier(Environment::systemEnvironment()); }); } - envAspect->addSupportedBaseEnvironment(Tr::tr("Clean Environment"), [envModifier] { + environment.addSupportedBaseEnvironment(Tr::tr("Clean Environment"), [envModifier] { Environment environment; return envModifier(environment); }); - if (HostOsInfo::isAnyUnixHost()) { - auto x11Forwarding = addAspect<X11ForwardingAspect>(); - x11Forwarding->setMacroExpander(macroExpander()); - } + x11Forwarding.setMacroExpander(macroExpander()); setRunnableModifier([this](Runnable &r) { const QmlBuildSystem *bs = static_cast<QmlBuildSystem *>(activeBuildSystem()); @@ -202,9 +197,8 @@ FilePath QmlProjectRunConfiguration::qmlRuntimeFilePath() const { usePuppetAsQmlRuntime = false; // Give precedence to the manual override in the run configuration. - const FilePath qmlViewer = m_qmlViewerAspect->filePath(); - if (!qmlViewer.isEmpty()) - return qmlViewer; + if (!qmlViewer().isEmpty()) + return qmlViewer(); Kit *kit = target()->kit(); @@ -241,15 +235,11 @@ FilePath QmlProjectRunConfiguration::qmlRuntimeFilePath() const return dev ? dev->filePath("qml").searchInPath() : "qml"; } -void QmlProjectRunConfiguration::createQtVersionAspect() +void QmlProjectRunConfiguration::setupQtVersionAspect() { - if (!QmlProject::isQtDesignStudio()) - return; - - m_qtversionAspect = addAspect<SelectionAspect>(); - m_qtversionAspect->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - m_qtversionAspect->setLabelText(Tr::tr("Qt Version:")); - m_qtversionAspect->setSettingsKey("QmlProjectManager.kit"); + qtversion.setSettingsKey("QmlProjectManager.kit"); + qtversion.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + qtversion.setLabelText(Tr::tr("Qt Version:")); Kit *kit = target()->kit(); QtVersion *version = QtKitAspect::qtVersion(kit); @@ -259,23 +249,23 @@ void QmlProjectRunConfiguration::createQtVersionAspect() const bool isQt6Project = buildSystem && buildSystem->qt6Project(); if (isQt6Project) { - m_qtversionAspect->addOption(Tr::tr("Qt 6")); - m_qtversionAspect->setReadOnly(true); + qtversion.addOption(Tr::tr("Qt 6")); + qtversion.setReadOnly(true); } else { /* Only if this is not a Qt 6 project changing kits makes sense */ - m_qtversionAspect->addOption(Tr::tr("Qt 5")); - m_qtversionAspect->addOption(Tr::tr("Qt 6")); + qtversion.addOption(Tr::tr("Qt 5")); + qtversion.addOption(Tr::tr("Qt 6")); const int valueForVersion = version->qtVersion().majorVersion() == 6 ? 1 : 0; - m_qtversionAspect->setValue(valueForVersion); + qtversion.setValue(valueForVersion); - connect(m_qtversionAspect, &SelectionAspect::changed, this, [&]() { + connect(&qtversion, &BaseAspect::changed, this, [this] { QTC_ASSERT(target(), return ); auto project = target()->project(); QTC_ASSERT(project, return ); - int oldValue = !m_qtversionAspect->value(); - const int preferedQtVersion = m_qtversionAspect->value() > 0 ? 6 : 5; + int oldValue = !qtversion(); + const int preferedQtVersion = qtversion() > 0 ? 6 : 5; Kit *currentKit = target()->kit(); const QList<Kit *> kits = Utils::filtered(KitManager::kits(), [&](const Kit *k) { @@ -296,9 +286,10 @@ void QmlProjectRunConfiguration::createQtVersionAspect() project->setActiveTarget(newTarget, SetActive::Cascade); /* Reset the aspect. We changed the target and this aspect should not change. */ - m_qtversionAspect->blockSignals(true); - m_qtversionAspect->setValue(oldValue); - m_qtversionAspect->blockSignals(false); + // FIXME: That should use setValueSilently() + qtversion.blockSignals(true); + qtversion.setValue(oldValue); + qtversion.blockSignals(false); } }); } @@ -307,13 +298,14 @@ void QmlProjectRunConfiguration::createQtVersionAspect() bool QmlProjectRunConfiguration::isEnabled() const { - return m_qmlMainFileAspect->isQmlFilePresent() && !commandLine().executable().isEmpty() - && activeBuildSystem()->hasParsingData(); + return const_cast<QmlProjectRunConfiguration *>(this)->qmlMainFile.isQmlFilePresent() + && !commandLine().executable().isEmpty() + && activeBuildSystem()->hasParsingData(); } FilePath QmlProjectRunConfiguration::mainScript() const { - return m_qmlMainFileAspect->mainScript(); + return qmlMainFile.mainScript(); } // QmlProjectRunConfigurationFactory From 66bdb5548ebd160619cf47c4e2c5837c72978cc9 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Date: Thu, 13 Jul 2023 09:31:35 +0900 Subject: [PATCH 0355/1777] SessionDialog: Add ellipsis to buttons that open another dialog Change-Id: I3eaa44f350653b38acbed99b7afbff3e6c02de3f Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- share/qtcreator/translations/qtcreator_cs.ts | 16 ++++++++-------- share/qtcreator/translations/qtcreator_da.ts | 16 ++++++++-------- share/qtcreator/translations/qtcreator_de.ts | 16 ++++++++-------- share/qtcreator/translations/qtcreator_fr.ts | 16 ++++++++-------- share/qtcreator/translations/qtcreator_hr.ts | 16 ++++++++-------- share/qtcreator/translations/qtcreator_ja.ts | 16 ++++++++-------- share/qtcreator/translations/qtcreator_pl.ts | 16 ++++++++-------- share/qtcreator/translations/qtcreator_ru.ts | 16 ++++++++-------- share/qtcreator/translations/qtcreator_sl.ts | 16 ++++++++-------- share/qtcreator/translations/qtcreator_uk.ts | 16 ++++++++-------- share/qtcreator/translations/qtcreator_zh_CN.ts | 12 ++++++------ share/qtcreator/translations/qtcreator_zh_TW.ts | 14 +++++++------- src/plugins/coreplugin/sessiondialog.cpp | 8 ++++---- 13 files changed, 97 insertions(+), 97 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_cs.ts b/share/qtcreator/translations/qtcreator_cs.ts index d0e98799683..025ee46159d 100644 --- a/share/qtcreator/translations/qtcreator_cs.ts +++ b/share/qtcreator/translations/qtcreator_cs.ts @@ -9724,20 +9724,20 @@ se projektu '%2' nepodařilo přidat.</translation> <translation type="obsolete">Přepnout na sezení</translation> </message> <message> - <source>&New</source> - <translation>&Nový</translation> + <source>&New...</source> + <translation>&Nový...</translation> </message> <message> - <source>&Rename</source> - <translation>&Přejmenovat</translation> + <source>&Rename...</source> + <translation>&Přejmenovat...</translation> </message> <message> - <source>C&lone</source> - <translation>Zdvo&jit</translation> + <source>C&lone...</source> + <translation>Zdvo&jit...</translation> </message> <message> - <source>&Delete</source> - <translation>&Smazat</translation> + <source>&Delete...</source> + <translation>&Smazat...</translation> </message> <message> <source>&Open</source> diff --git a/share/qtcreator/translations/qtcreator_da.ts b/share/qtcreator/translations/qtcreator_da.ts index a52185b07d4..5b3b918cb9c 100644 --- a/share/qtcreator/translations/qtcreator_da.ts +++ b/share/qtcreator/translations/qtcreator_da.ts @@ -22699,20 +22699,20 @@ til projektet "%2".</translation> <translation>Sessionshåndtering</translation> </message> <message> - <source>&New</source> - <translation>&Ny</translation> + <source>&New...</source> + <translation>&Ny...</translation> </message> <message> - <source>&Rename</source> - <translation>&Omdøb</translation> + <source>&Rename...</source> + <translation>&Omdøb...</translation> </message> <message> - <source>C&lone</source> - <translation>&Klon</translation> + <source>C&lone...</source> + <translation>&Klon...</translation> </message> <message> - <source>&Delete</source> - <translation>&Slet</translation> + <source>&Delete...</source> + <translation>&Slet...</translation> </message> <message> <source>&Open</source> diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 244f28ef9ca..f5e94a6a30a 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -36784,20 +36784,20 @@ Title of a the cloned RunConfiguration window, text of the window</extracomment> <translation>Sitzungsverwaltung</translation> </message> <message> - <source>&New</source> - <translation>&Neu</translation> + <source>&New...</source> + <translation>&Neu...</translation> </message> <message> - <source>&Rename</source> - <translation>&Umbenennen</translation> + <source>&Rename...</source> + <translation>&Umbenennen...</translation> </message> <message> - <source>C&lone</source> - <translation>&Duplizieren</translation> + <source>C&lone...</source> + <translation>&Duplizieren...</translation> </message> <message> - <source>&Delete</source> - <translation>&Löschen</translation> + <source>&Delete...</source> + <translation>&Löschen...</translation> </message> <message> <source>Restore last session on startup</source> diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index c2573bd2729..c9f9a6ff189 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -34945,20 +34945,20 @@ Title of a the cloned RunConfiguration window, text of the window</extracomment> <translation>Gestionnaire de session</translation> </message> <message> - <source>&New</source> - <translation>&Nouveau</translation> + <source>&New...</source> + <translation>&Nouveau...</translation> </message> <message> - <source>&Rename</source> - <translation>&Renommer</translation> + <source>&Rename...</source> + <translation>&Renommer...</translation> </message> <message> - <source>C&lone</source> - <translation>C&lone</translation> + <source>C&lone...</source> + <translation>C&lone...</translation> </message> <message> - <source>&Delete</source> - <translation>&Supprimer</translation> + <source>&Delete...</source> + <translation>&Supprimer...</translation> </message> <message> <source>&Open</source> diff --git a/share/qtcreator/translations/qtcreator_hr.ts b/share/qtcreator/translations/qtcreator_hr.ts index bdc95b998f8..1c4db2eb695 100644 --- a/share/qtcreator/translations/qtcreator_hr.ts +++ b/share/qtcreator/translations/qtcreator_hr.ts @@ -5564,20 +5564,20 @@ Greška: %5</translation> <translation>Upravljač za sesije</translation> </message> <message> - <source>&New</source> - <translation>&Novi</translation> + <source>&New...</source> + <translation>&Novi...</translation> </message> <message> - <source>&Rename</source> - <translation>&Preimenuj</translation> + <source>&Rename...</source> + <translation>&Preimenuj...</translation> </message> <message> - <source>C&lone</source> - <translation>K&loniraj</translation> + <source>C&lone...</source> + <translation>K&loniraj...</translation> </message> <message> - <source>&Delete</source> - <translation>&Ukloni</translation> + <source>&Delete...</source> + <translation>&Ukloni...</translation> </message> <message> <source>&Open</source> diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts index 7bba62d3666..42800af9390 100644 --- a/share/qtcreator/translations/qtcreator_ja.ts +++ b/share/qtcreator/translations/qtcreator_ja.ts @@ -4383,20 +4383,20 @@ Add, modify, and remove document filters, which determine the documentation set <translation>セッションマネージャ</translation> </message> <message> - <source>&New</source> - <translation>新規作成(&N)</translation> + <source>&New...</source> + <translation>新規作成(&N)...</translation> </message> <message> - <source>&Rename</source> - <translation>名前を変更(&R)</translation> + <source>&Rename...</source> + <translation>名前を変更(&R)...</translation> </message> <message> - <source>C&lone</source> - <translation>複製(&L)</translation> + <source>C&lone...</source> + <translation>複製(&L)...</translation> </message> <message> - <source>&Delete</source> - <translation>削除(&D)</translation> + <source>&Delete...</source> + <translation>削除(&D)...</translation> </message> <message> <source>Restore last session on startup</source> diff --git a/share/qtcreator/translations/qtcreator_pl.ts b/share/qtcreator/translations/qtcreator_pl.ts index fc280a71457..27826c1aa99 100644 --- a/share/qtcreator/translations/qtcreator_pl.ts +++ b/share/qtcreator/translations/qtcreator_pl.ts @@ -883,20 +883,20 @@ <translation>Zarządzanie sesjami</translation> </message> <message> - <source>&New</source> - <translation>&Nowa sesja</translation> + <source>&New...</source> + <translation>&Nowa sesja...</translation> </message> <message> - <source>&Rename</source> - <translation>Z&mień nazwę</translation> + <source>&Rename...</source> + <translation>Z&mień nazwę...</translation> </message> <message> - <source>C&lone</source> - <translation>S&klonuj</translation> + <source>C&lone...</source> + <translation>S&klonuj...</translation> </message> <message> - <source>&Delete</source> - <translation>&Usuń</translation> + <source>&Delete...</source> + <translation>&Usuń...</translation> </message> <message> <source>&Open</source> diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index 0c4dd669944..6e06d08ee18 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -29135,20 +29135,20 @@ to project "%2".</source> <translation>Управление сессиями</translation> </message> <message> - <source>&New</source> - <translation>&Новая</translation> + <source>&New...</source> + <translation>&Новая...</translation> </message> <message> - <source>&Rename</source> - <translation>&Переименовать</translation> + <source>&Rename...</source> + <translation>&Переименовать...</translation> </message> <message> - <source>C&lone</source> - <translation>&Копировать</translation> + <source>C&lone...</source> + <translation>&Копировать...</translation> </message> <message> - <source>&Delete</source> - <translation>&Удалить</translation> + <source>&Delete...</source> + <translation>&Удалить...</translation> </message> <message> <source>What is a Session?</source> diff --git a/share/qtcreator/translations/qtcreator_sl.ts b/share/qtcreator/translations/qtcreator_sl.ts index 8292124dfe6..b9ce29e5633 100644 --- a/share/qtcreator/translations/qtcreator_sl.ts +++ b/share/qtcreator/translations/qtcreator_sl.ts @@ -6752,20 +6752,20 @@ enojen »Vstopi« za oddajo signala pa vas bo privedel neposredno do ustrezne pr <translation>Upravljalnik sej</translation> </message> <message> - <source>&New</source> - <translation>&Nova</translation> + <source>&New...</source> + <translation>&Nova...</translation> </message> <message> - <source>&Rename</source> - <translation>Pre&imenuj</translation> + <source>&Rename...</source> + <translation>Pre&imenuj...</translation> </message> <message> - <source>C&lone</source> - <translation>&Podvoji</translation> + <source>C&lone...</source> + <translation>&Podvoji...</translation> </message> <message> - <source>&Delete</source> - <translation>&Izbriši</translation> + <source>&Delete...</source> + <translation>&Izbriši...</translation> </message> <message> <source>&Open</source> diff --git a/share/qtcreator/translations/qtcreator_uk.ts b/share/qtcreator/translations/qtcreator_uk.ts index 47c7b8a0931..87518bce072 100644 --- a/share/qtcreator/translations/qtcreator_uk.ts +++ b/share/qtcreator/translations/qtcreator_uk.ts @@ -13203,20 +13203,20 @@ to project "%2".</source> <translation>Менеджер сесій</translation> </message> <message> - <source>&New</source> - <translation>&Нова</translation> + <source>&New...</source> + <translation>&Нова...</translation> </message> <message> - <source>&Rename</source> - <translation>Перей&менувати</translation> + <source>&Rename...</source> + <translation>Перей&менувати...</translation> </message> <message> - <source>C&lone</source> - <translation>&Клонувати</translation> + <source>C&lone...</source> + <translation>&Клонувати...</translation> </message> <message> - <source>&Delete</source> - <translation>Ви&далити</translation> + <source>&Delete...</source> + <translation>Ви&далити...</translation> </message> <message> <source>&Open</source> diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 5d038593cc8..5d358e80ac5 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -28204,16 +28204,16 @@ to project "%2".</source> <translation>会话管理器</translation> </message> <message> - <source>&New</source> - <translation>新建(&N)</translation> + <source>&New...</source> + <translation>新建(&N)...</translation> </message> <message> - <source>C&lone</source> - <translation>克隆(&L)</translation> + <source>C&lone...</source> + <translation>克隆(&L)...</translation> </message> <message> - <source>&Delete</source> - <translation>删除(&D)</translation> + <source>&Delete...</source> + <translation>删除(&D)...</translation> </message> <message> <source>&Open</source> diff --git a/share/qtcreator/translations/qtcreator_zh_TW.ts b/share/qtcreator/translations/qtcreator_zh_TW.ts index f5c68598b06..587948f7c94 100644 --- a/share/qtcreator/translations/qtcreator_zh_TW.ts +++ b/share/qtcreator/translations/qtcreator_zh_TW.ts @@ -6472,19 +6472,19 @@ Add, modify, and remove document filters, which determine the documentation set <translation>工作階段管理器</translation> </message> <message> - <source>&New</source> - <translation>新增(&N)</translation> + <source>&New...</source> + <translation>新增(&N)...</translation> </message> <message> - <source>&Rename</source> - <translation>重新命名(&R)</translation> + <source>&Rename...</source> + <translation>重新命名(&R)...</translation> </message> <message> - <source>C&lone</source> - <translation>複製(&L)</translation> + <source>C&lone...</source> + <translation>複製(&L)...</translation> </message> <message> - <source>&Delete</source> + <source>&Delete...</source> <translation>刪除(&D)</translation> </message> <message> diff --git a/src/plugins/coreplugin/sessiondialog.cpp b/src/plugins/coreplugin/sessiondialog.cpp index dd81f43fd09..f0789cf45ba 100644 --- a/src/plugins/coreplugin/sessiondialog.cpp +++ b/src/plugins/coreplugin/sessiondialog.cpp @@ -136,14 +136,14 @@ SessionDialog::SessionDialog(QWidget *parent) : QDialog(parent) sessionView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); sessionView->setActivationMode(Utils::DoubleClickActivation); - auto createNewButton = new QPushButton(PE::Tr::tr("&New")); + auto createNewButton = new QPushButton(PE::Tr::tr("&New...")); createNewButton->setObjectName("btCreateNew"); m_openButton = new QPushButton(PE::Tr::tr("&Open")); m_openButton->setObjectName("btOpen"); - m_renameButton = new QPushButton(PE::Tr::tr("&Rename")); - m_cloneButton = new QPushButton(PE::Tr::tr("C&lone")); - m_deleteButton = new QPushButton(PE::Tr::tr("&Delete")); + m_renameButton = new QPushButton(PE::Tr::tr("&Rename...")); + m_cloneButton = new QPushButton(PE::Tr::tr("C&lone...")); + m_deleteButton = new QPushButton(PE::Tr::tr("&Delete...")); m_autoLoadCheckBox = new QCheckBox(PE::Tr::tr("Restore last session on startup")); From 9f72b0519f8e328c8c4c73e8583c68343a2188f6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 09:21:10 +0200 Subject: [PATCH 0356/1777] Unittest: Work around warning for unused parameter Amends 7fada70e8f. Change-Id: Ic47526a497c67dab48903b6500a37bab742034fd Reviewed-by: Marco Bubke <marco.bubke@qt.io> --- tests/unit/tests/printers/gtest-creator-printing.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/tests/printers/gtest-creator-printing.cpp b/tests/unit/tests/printers/gtest-creator-printing.cpp index 9a5c000c390..5a2adf5dd07 100644 --- a/tests/unit/tests/printers/gtest-creator-printing.cpp +++ b/tests/unit/tests/printers/gtest-creator-printing.cpp @@ -220,6 +220,7 @@ std::ostream &operator<<(std::ostream &out, const ValueView &value) } namespace { +#if 0 Utils::SmallStringView operationText(int operation) { switch (operation) { @@ -236,7 +237,6 @@ Utils::SmallStringView operationText(int operation) std::ostream &operator<<(std::ostream &out, sqlite3_changeset_iter *iter) { -#if 0 out << "("; const char *tableName = nullptr; @@ -279,9 +279,9 @@ std::ostream &operator<<(std::ostream &out, sqlite3_changeset_iter *iter) } out << "})"; -#endif return out; } +#endif const char *toText(Operation operation) { @@ -316,6 +316,7 @@ const char *toText(LockingMode lockingMode) std::ostream &operator<<(std::ostream &out, const SessionChangeSet &changeset) { + Q_UNUSED(changeset) #if 0 sqlite3_changeset_iter *iter = nullptr; sqlite3changeset_start(&iter, changeset.size(), const_cast<void *>(changeset.data())); From 5d5a36ef18671183b85c2edcce996c7a67ab4bfe Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 12:00:43 +0200 Subject: [PATCH 0357/1777] ProjectExplorer: Fix cmake dap start logic Change-Id: I06148c3d7aec6cfde072c477c8ff81025d4d24f9 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/projectexplorer/projectexplorer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index bcfc8197ebd..773a44a647c 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2938,7 +2938,7 @@ void ProjectExplorerPlugin::runRunConfiguration(RunConfiguration *rc, ? BuildForRunConfigStatus::Building : BuildForRunConfigStatus::NotBuilding : BuildManager::potentiallyBuildForRunConfig(rc); - if (dd->m_runMode != Constants::CMAKE_DEBUG_RUN_MODE) + if (dd->m_runMode == Constants::CMAKE_DEBUG_RUN_MODE) buildStatus = BuildForRunConfigStatus::NotBuilding; switch (buildStatus) { From af5a8fe80c05caa7f2c965f032e53fe3c0599772 Mon Sep 17 00:00:00 2001 From: Andre Hartmann <aha_1980@gmx.de> Date: Mon, 17 Jul 2023 07:26:37 +0200 Subject: [PATCH 0358/1777] Git: Restart instant blame on document save When the current line is modified, refresh the blame after saving. Before, the cursor had to be moved to another line to restart the blame. Change-Id: I61012f1c8583545b9bc34a71ff63ade2f9cc5b13 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/git/gitplugin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index c7d2f1f0661..223cecf0b69 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -437,6 +437,7 @@ public: QTimer *m_cursorPositionChangedTimer = nullptr; std::unique_ptr<BlameMark> m_blameMark; QMetaObject::Connection m_blameCursorPosConn; + QMetaObject::Connection m_documentChangedConn; GitGrep gitGrep{&m_gitClient}; @@ -1462,6 +1463,11 @@ void GitPluginPrivate::setupInstantBlame() } m_cursorPositionChangedTimer->start(500); }); + IDocument *document = editor->document(); + m_documentChangedConn = connect(document, &IDocument::changed, this, [this, document] { + if (!document->isModified()) + forceInstantBlame(); + }); forceInstantBlame(); }; @@ -1590,6 +1596,7 @@ void GitPluginPrivate::stopInstantBlame() m_blameMark.reset(); m_cursorPositionChangedTimer->stop(); disconnect(m_blameCursorPosConn); + disconnect(m_documentChangedConn); } bool GitPluginPrivate::refreshWorkingDirectory(const FilePath &workingDirectory) From a9663d65adb97e611e684c6159c434bc21cbfbff Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 13 Jul 2023 11:19:23 +0200 Subject: [PATCH 0359/1777] IosDeviceToolHandlerPrivate: Replace QProcess with Process The Process takes care of the proper destruction automatically. This is a preparation step before creating a task tree adapter for IosToolHandler. Change-Id: I6a8ae12b46a83be3a7074d0a268a598c260a66b5 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/ios/iosdeploystep.cpp | 4 +- src/plugins/ios/iostoolhandler.cpp | 157 ++++++++++------------------- 2 files changed, 54 insertions(+), 107 deletions(-) diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index 2995f290ffe..12a0b7a6c1c 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -261,8 +261,8 @@ void IosDeployStep::checkProvisioningProfile() } m_expectFail = true; - QString provisioningProfile = provisionPlist.value(QLatin1String("Name")).toString(); - QString provisioningUid = provisionPlist.value(QLatin1String("UUID")).toString(); + const QString provisioningProfile = provisionPlist.value(QLatin1String("Name")).toString(); + const QString provisioningUid = provisionPlist.value(QLatin1String("UUID")).toString(); CompileTask task(Task::Warning, Tr::tr("The provisioning profile \"%1\" (%2) used to sign the application " "does not cover the device %3 (%4). Deployment to it will fail.") diff --git a/src/plugins/ios/iostoolhandler.cpp b/src/plugins/ios/iostoolhandler.cpp index 18cc42d44e2..34dd74de2ec 100644 --- a/src/plugins/ios/iostoolhandler.cpp +++ b/src/plugins/ios/iostoolhandler.cpp @@ -13,26 +13,14 @@ #include <debugger/debuggerconstants.h> #include <utils/async.h> -#include <utils/filepath.h> #include <utils/futuresynchronizer.h> #include <utils/process.h> #include <utils/qtcassert.h> #include <utils/temporarydirectory.h> #include <QDir> -#include <QFutureWatcher> -#include <QJsonArray> -#include <QJsonDocument> -#include <QJsonObject> -#include <QList> #include <QLoggingCategory> -#include <QPointer> -#include <QProcess> -#include <QProcessEnvironment> -#include <QScopedArrayPointer> -#include <QSocketNotifier> #include <QTemporaryFile> -#include <QTimer> #include <QXmlStreamReader> #include <signal.h> @@ -216,7 +204,6 @@ class IosDeviceToolHandlerPrivate final : public IosToolHandlerPrivate }; public: explicit IosDeviceToolHandlerPrivate(const IosDeviceType &devType, IosToolHandler *q); - ~IosDeviceToolHandlerPrivate() override; // IosToolHandlerPrivate overrides public: @@ -231,14 +218,20 @@ public: void stop(int errorCode) override; private: - void subprocessError(QProcess::ProcessError error); - void subprocessFinished(int exitCode, QProcess::ExitStatus exitStatus); void subprocessHasData(); void processXml(); - void killProcess(); - QTimer killTimer; - std::shared_ptr<QProcess> process; + struct Deleter { + void operator()(Process *process) const + { + if (process->state() != QProcess::NotRunning) { + process->write("k\n\r"); + process->closeWriteChannel(); + } + delete process; + }; + }; + std::unique_ptr<Process, Deleter> process; State state = NonStarted; Op op = OpNone; QXmlStreamReader outputParser; @@ -305,7 +298,7 @@ private: private: qint64 m_pid = -1; LogTailFiles outputLogger; - Utils::FutureSynchronizer futureSynchronizer; + FutureSynchronizer futureSynchronizer; }; IosToolHandlerPrivate::IosToolHandlerPrivate(const IosDeviceType &devType, @@ -369,25 +362,6 @@ void IosToolHandlerPrivate::toolExited(int code) emit q->toolExited(q, code); } -void IosDeviceToolHandlerPrivate::subprocessError(QProcess::ProcessError error) -{ - if (state != Stopped) - errorMsg(Tr::tr("iOS tool error %1").arg(error)); - stop(-1); - if (error == QProcess::FailedToStart) { - qCDebug(toolHandlerLog) << "IosToolHandler::finished(" << this << ")"; - emit q->finished(q); - } -} - -void IosDeviceToolHandlerPrivate::subprocessFinished(int exitCode, QProcess::ExitStatus exitStatus) -{ - stop((exitStatus == QProcess::NormalExit) ? exitCode : -1 ); - qCDebug(toolHandlerLog) << "IosToolHandler::finished(" << this << ")"; - killTimer.stop(); - emit q->finished(q); -} - void IosDeviceToolHandlerPrivate::processXml() { while (!outputParser.atEnd()) { @@ -475,10 +449,10 @@ void IosDeviceToolHandlerPrivate::processXml() } else if (elName == QLatin1String("server_ports")) { stack.append(ParserState(ParserState::ServerPorts)); QXmlStreamAttributes attributes = outputParser.attributes(); - Utils::Port gdbServerPort( - attributes.value(QLatin1String("gdb_server")).toString().toInt()); - Utils::Port qmlServerPort( - attributes.value(QLatin1String("qml_server")).toString().toInt()); + Port gdbServerPort( + attributes.value(QLatin1String("gdb_server")).toString().toInt()); + Port qmlServerPort( + attributes.value(QLatin1String("qml_server")).toString().toInt()); gotServerPorts(m_bundlePath, m_deviceId, gdbServerPort, qmlServerPort); } else { qCWarning(toolHandlerLog) << "unexpected element " << elName; @@ -570,12 +544,6 @@ void IosDeviceToolHandlerPrivate::processXml() } } -void IosDeviceToolHandlerPrivate::killProcess() -{ - if (isRunning()) - process->kill(); -} - void IosDeviceToolHandlerPrivate::subprocessHasData() { qCDebug(toolHandlerLog) << "subprocessHasData, state:" << state; @@ -588,17 +556,12 @@ void IosDeviceToolHandlerPrivate::subprocessHasData() case StartedInferior: // read some data { - char buf[200]; while (isRunning()) { - qint64 rRead = process->read(buf, sizeof(buf)); - if (rRead == -1) { - stop(-1); + const QByteArray buffer = process->readAllRawStandardOutput(); + if (buffer.isEmpty()) return; - } - if (rRead == 0) - return; - qCDebug(toolHandlerLog) << "subprocessHasData read " << QByteArray(buf, rRead); - outputParser.addData(QByteArray(buf, rRead)); + qCDebug(toolHandlerLog) << "subprocessHasData read " << buffer; + outputParser.addData(buffer); processXml(); } break; @@ -617,27 +580,18 @@ void IosDeviceToolHandlerPrivate::subprocessHasData() IosDeviceToolHandlerPrivate::IosDeviceToolHandlerPrivate(const IosDeviceType &devType, IosToolHandler *q) : IosToolHandlerPrivate(devType, q) + , process(new Process, Deleter()) { - killTimer.setSingleShot(true); - - auto deleter = [](QProcess *p) { - if (p->state() != QProcess::NotRunning) { - p->kill(); - if (!p->waitForFinished(2000)) - p->terminate(); - } - delete p; - }; - process = std::shared_ptr<QProcess>(new QProcess, deleter); - // Prepare & set process Environment. - QProcessEnvironment env(QProcessEnvironment::systemEnvironment()); - const QStringList keys = env.keys(); - for (const QString &k : keys) - if (k.startsWith(QLatin1String("DYLD_"))) - env.remove(k); + const Environment systemEnv = Environment::systemEnvironment(); + Environment env(systemEnv); + systemEnv.forEachEntry([&env](const QString &key, const QString &, bool enabled) { + if (enabled && key.startsWith(QLatin1String("DYLD_"))) + env.unset(key); + }); + QStringList frameworkPaths; - const Utils::FilePath libPath = IosConfigurations::developerPath().pathAppended("Platforms/iPhoneSimulator.platform/Developer/Library"); + const FilePath libPath = IosConfigurations::developerPath().pathAppended("Platforms/iPhoneSimulator.platform/Developer/Library"); for (const auto framework : {"PrivateFrameworks", "OtherFrameworks", "SharedFrameworks"}) { const QString frameworkPath = libPath.pathAppended(QLatin1String(framework)).toFileInfo().canonicalFilePath(); @@ -645,34 +599,27 @@ IosDeviceToolHandlerPrivate::IosDeviceToolHandlerPrivate(const IosDeviceType &de frameworkPaths << frameworkPath; } frameworkPaths << "/System/Library/Frameworks" << "/System/Library/PrivateFrameworks"; - env.insert(QLatin1String("DYLD_FALLBACK_FRAMEWORK_PATH"), frameworkPaths.join(QLatin1Char(':'))); + env.set(QLatin1String("DYLD_FALLBACK_FRAMEWORK_PATH"), frameworkPaths.join(QLatin1Char(':'))); qCDebug(toolHandlerLog) << "IosToolHandler runEnv:" << env.toStringList(); - process->setProcessEnvironment(env); + process->setEnvironment(env); + process->setProcessMode(ProcessMode::Writer); + process->setReaperTimeout(1500); - QObject::connect(process.get(), &QProcess::readyReadStandardOutput, - std::bind(&IosDeviceToolHandlerPrivate::subprocessHasData,this)); - - QObject::connect(process.get(), &QProcess::finished, - std::bind(&IosDeviceToolHandlerPrivate::subprocessFinished,this, _1,_2)); - - QObject::connect(process.get(), &QProcess::errorOccurred, - std::bind(&IosDeviceToolHandlerPrivate::subprocessError, this, _1)); - - QObject::connect(&killTimer, &QTimer::timeout, std::bind(&IosDeviceToolHandlerPrivate::killProcess, this)); -} - -IosDeviceToolHandlerPrivate::~IosDeviceToolHandlerPrivate() -{ - if (isRunning()) { - // Disconnect the signals to avoid notifications while destructing. - // QTCREATORBUG-18147 - process->disconnect(); - // Quit ios-tool gracefully before kill is executed. - process->write("k\n\r"); - process->closeWriteChannel(); - // Give some time to ios-tool to finish. - process->waitForFinished(2000); - } + QObject::connect(process.get(), &Process::readyReadStandardOutput, + q, [this] { subprocessHasData(); }); + QObject::connect(process.get(), &Process::done, q, [this] { + if (process->result() == ProcessResult::FinishedWithSuccess) { + stop((process->exitStatus() == QProcess::NormalExit) ? process->exitCode() : -1); + qCDebug(toolHandlerLog) << "IosToolHandler::finished(" << this << ")"; + } else { + if (state != Stopped) + errorMsg(Tr::tr("iOS tool error %1").arg(process->error())); + stop(-1); + if (process->result() == ProcessResult::StartFailed) + qCDebug(toolHandlerLog) << "IosToolHandler::finished(" << this << ")"; + } + emit IosToolHandlerPrivate::q->finished(IosToolHandlerPrivate::q); + }); } void IosDeviceToolHandlerPrivate::requestTransferApp(const FilePath &bundlePath, @@ -680,7 +627,7 @@ void IosDeviceToolHandlerPrivate::requestTransferApp(const FilePath &bundlePath, { m_bundlePath = bundlePath; m_deviceId = deviceId; - QString tmpDeltaPath = Utils::TemporaryDirectory::masterDirectoryFilePath().pathAppended("ios").toString(); + QString tmpDeltaPath = TemporaryDirectory::masterDirectoryFilePath().pathAppended("ios").toString(); QStringList args; args << QLatin1String("--id") << deviceId << QLatin1String("--bundle") << bundlePath.path() << QLatin1String("--timeout") << QString::number(timeout) @@ -736,11 +683,11 @@ void IosDeviceToolHandlerPrivate::start(const QString &exe, const QStringList &a QTC_CHECK(state == NonStarted); state = Starting; qCDebug(toolHandlerLog) << "running " << exe << args; - process->start(exe, args); + process->setCommand({FilePath::fromString(exe), args}); + process->start(); state = StartedInferior; } - void IosDeviceToolHandlerPrivate::stop(int errorCode) { qCDebug(toolHandlerLog) << "IosToolHandlerPrivate::stop"; @@ -775,7 +722,7 @@ void IosDeviceToolHandlerPrivate::stop(int errorCode) if (isRunning()) { process->write("k\n\r"); process->closeWriteChannel(); - killTimer.start(1500); + process->stop(); } } From b5808cdd56792bdca0d65b9b405ffbb24c7a6b1f Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Sat, 15 Jul 2023 12:58:31 +0200 Subject: [PATCH 0360/1777] Solutions: Enable theming and dpr for spinner images Change-Id: I2105b9c1032940d26f3f3bf2083f88e1133e8757 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../solutions/spinner/icons/spinner_large.png | Bin 1346 -> 850 bytes .../spinner/icons/spinner_large@2x.png | Bin 0 -> 1698 bytes .../spinner/icons/spinner_medium.png | Bin 765 -> 447 bytes .../spinner/icons/spinner_medium@2x.png | Bin 0 -> 875 bytes .../solutions/spinner/icons/spinner_small.png | Bin 315 -> 210 bytes .../spinner/icons/spinner_small@2x.png | Bin 0 -> 302 bytes src/libs/solutions/spinner/spinner.cpp | 21 ++++++++++++++++-- src/libs/solutions/spinner/spinner.qrc | 3 +++ src/tools/icons/qtcreatoricons.svg | 21 ++++++++++++++++++ 9 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 src/libs/solutions/spinner/icons/spinner_large@2x.png create mode 100644 src/libs/solutions/spinner/icons/spinner_medium@2x.png create mode 100644 src/libs/solutions/spinner/icons/spinner_small@2x.png diff --git a/src/libs/solutions/spinner/icons/spinner_large.png b/src/libs/solutions/spinner/icons/spinner_large.png index c24ff1b77cf26d49561c2719f5160070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<#!4Z1Xz5P}<CCxl{FT4MAg7a}5jc?u7v*v7M zuJV-L-~9CH)qTmLR}Z+w?i1a*Pi22)WVyIp;?KPy$qTr@N|fc_j9B!2<DbNRfqu5H zKh0|Y5bt*?a?7^dHTQE=k2UF>o-At;&bz_%T2vj|mrnt<KPQ~HcyICTrILHor#aN` zocM2rWx^RjW;UlQauUq78|&oW_FKBiT$(eR;RJ`ug2{^7yuW7ebz_kGoMiLspAy44 zZnp-5Q`Q;J9QS8svp)zlKYEQnTTe#t7UP`5+iF?A`0_G7kpBMo7Tcd^4E*Q0k6XP+ zXDMd5u6=%%&i#T*3^w|)52s#rY-AH)x|y?Jvs5laNnR|o!0!ud($2iv|DVBGfRX1^ Sg>nt3B=B_gb6Mw<&;$U2+?2oo diff --git a/src/libs/solutions/spinner/icons/spinner_large@2x.png b/src/libs/solutions/spinner/icons/spinner_large@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..910a11bc75636b951c4ab4d771f593df37b685e7 GIT binary patch literal 1698 zcmeAS@N?(olHy`uVBq!ia0y~yU}ykg4h9AWhG(I6;tULInVv3=Ar-gY&i)-N9V&AC zv-(HtvOj{WznU(7^uzlAdstxmEx{@BPJbP(o7rA$IeIFg-QBy<?f{ds{ANXN#ZMbj zK0S&Q*2rg4ahNyZtkfji4d%b^?aq`@e}3HI+wYTmpU*3Pw>Q1iq_0w&i(9{9quj#7 zm+XTlY%#t!hcQHC$(y8e3|yBPS}mD15_I@K>}R{NBPQm~hJ}0zM#f2n?jIPg-PiZJ z#h#tTaOkkhCAUKn4Ex2FzNt24FjGqP(`hKb%-|aKlwsc%JI5r(J!cuF$Y`-HSi{pG z$$j7egGi}1Yedo)PHV9Pe<Il)%#BTDFf?AAf9r5`o0~+FRVstA0fX_3!UOzy6=h+Z z2ljEs7_>=q?oQy)65?W*caT9RvHj8FAO(Yy>=Ep>+O6}s-54J%?ucQ?5@D!`Qdyj( zkTIG20pnjy-%SrMz2-SETly2jB6V+r6~0#c_?$mXwqa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H43Q?_~~z~l>a6)R%E5ss=IGop56{Gcr@qH;a3}0%1zvF_cf^h z^~#mm9W~9GZppKoxVx8%m3(<$wCF|OUB!)|U#e|>&zyg9&!&&}ou5XFTkb!4Yof{O z6H6Y%M7=dt`qXP9dEx3rqwNL^=eFJz-d1CKP}sC7HnYJlkzr2v>H9Y(pRe{z_IzDl z!o~a`=I*>@^X$bc<liNKv1Xg_nSavU+(Nze>=Hj$3m4Y?mttx7*|Sz%^3)f`(CgnD zugF}n6<Q@Xuer{C>dv2bx%r1O6Bhjadwt!vb=+s)CGs<@DeRMv$X&g=D9Xa)l4M|v zsDGo~Zg24`Km1h0w&<Sbw@T!E)6JZ+y0^WB(ZPzPl3~-86I&R6edk}wu<6n%S6&8& zTl0>vPnepv&GLf0j|X$g!nyio{0wH9nG9A7DxDvzyok=QWZ1%OH~%u5LP7h*_gp8L zFYH=*m4*4if~Slbcdq?r`cmEhgel|J4Vm}M41S$z91AkDw@ZJSf8i6O-|XAsg^Wsf zd;ZPMRb{xf_4|KTW&=NM#tUy)+hrq~?h2+dMD2Z4IEl3~yHJo}ZCnu}|BG&I)(bC8 z=kMlWsE-q5zVO0T{TRFNmLi7SxUXFI{HH29nld~T-10AUJ5TdsTmCgpmaZ}leLHk- ztpD9Po5kT9|LV^Smh1|tYrp6)-2jtIwm(07aSo%*eIEJy{~z7hpKh>4Vzp9qDX8-C MboFyt=akR{0K@M9ZU6uP literal 0 HcmV?d00001 diff --git a/src/libs/solutions/spinner/icons/spinner_medium.png b/src/libs/solutions/spinner/icons/spinner_medium.png index d64cc514e1b6f5a8a7b4f0672301c9ea4751c247..6cb735f18ac8e275a5dc174d0c55b5c5ab3f7759 100644 GIT binary patch delta 432 zcmey%x}SN1WIY1|14Edgss;lCW1FXoV~EA+*2(_fOo1XtpDX{=Ra@kmt*F)%<920H zXm^IVkII#0Q7#Weazna0UMy=&&J?(k5H!&#O<A+Ivwl{|y-daPg~u+QdsX=Jp!N4V z)vOjzKkwvXsu!8boUy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cnZ5%aS7= zss=9F{&3Ex<QoTHFB0&5epUFi)V=kGqAPUgFLx2i6BAmoCtmS{x!9sART-hH`AR3x zb~KeliA)N-b2TO;YU-oHJ-U15ANKzdR$_Xjv;OAX>^}90yRLixlL)mm(6X90an28} z^bZB|8rLq`bMJ6#&35kf54t+8SqXlNyqlI1R&y>tIrW^qe$>{PT@G8#pBFAVxO=W- z>ts(Ssp%|Fet%W!s*l<c%71C+%PaNWt)4&TrseqGT&=Wlmci7|*)BKKt54`;1bJ&c zoRP6Gt#F$|=D$fFYUVcm3Uo?vzo+h6_WiJP%;}FmlA2Um%(`24uAg0@x<jeXW8UTG z!T0(Pa23v}+pwiA$?y9f{a@}^LpZhPh|A{v4Vm(w&Er(q{xmj|xWvH6AM}4Y&7YkA T;kiEp0|SGntDnm{r-UW|BENeP diff --git a/src/libs/solutions/spinner/icons/spinner_medium@2x.png b/src/libs/solutions/spinner/icons/spinner_medium@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..3cd93d63e246eed92600a1d9a49de40f91afab49 GIT binary patch literal 875 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4h9AWhJGeJCI$v(BTpB{kch)~r$_q>JBl3t z=~36+_0ci;%fabWCrAkS`1puCUd*ZAw$+VSMe690Wu_Th<1Q%VWKP^>lEK}?>zX;S z$S@|yIs4_bb8FJmqsz8iZ{F;b#PNKi@&EYr=P}D&H*QT%_+}l&C!cUTIGMR%+bPB? zZ0C0}<v93p=_^Ga5T1UzG;KEPiZ)fxs12-7{FxuhaT~Dz+K^MvuFr5`)<WigEQ}u} z7kBP{>+oU`^P~m+O7p~%7z%nXGrV3f-RwtU0W*WsRW1j^3+l2gmo9NC{8-bV^P*W* zec}!FhTz#}87x^E-uF4}tPta{J=-Ai;`k~ahEL)>`}Z;*_-JXI5MBCkQ{nVI4c{3K zA37So`<KuwhC``2Of`(PGSc6k912>;s8Pz*RG_<Vz2C}pGKNgoLd5f4T5nUkvS7_M z#`Ua8w%XON%^3^!tziye`Bs0`xyVat+FIrdFI1f}Uh7{gUo(%T$^F0c)z*bY$`SQF zLOZ9;m?iEt&#dW%%qsV+{j0x*-J8(%`JkKFqpkifay}>3%-4O(xL+7+ow3t8`CC|K z*lOebk8iyccJ-D~S)ax6-D-DTXwWR1O>W#vZUwL_ZmB+1VtJ~i!)A(OkB5%Ug>{Rj z^UW}=wXvNdzT2@rv6D}MHFZ<Md~S<6*NRiSnzoqiYub5Ig}qD1!L<9|){P(D3NY-_ zN!uQ~=|&)f45N9}W7A#569SICY=6YTZE)OwS-f4K$X)4@+RoYMmhx|Ry~_4IJRsna z-NgHxr+#Z?a`$({@I3h*8nQhu>(jqA*KCw3t0K=|KK;w@g71^PoxfE5D{C)yJwDd7 z{CCG4+dC_sA5D*2Uw*7GyE}9F_xyL9#~kEutX1dVzcZ}L@t;L*2it|}&0TyOwte5R zaj&-L$Gj^BNsqrT_`gDeG3CIF1YQZQz8TBbS6=vSc9!9{;PRD*KNtmq&oKN}Je@P& z(LNxLZGvI`J<bIWm=BmQm0X}>C2QjD_@6D3G3AQy2gcK@xTlL~A9%PSwwk-jb0OoL z-rt&E87i#~oNQif#PG|rm9ODv!|x|E+5Q&KWG(pc;*jKi^R*ioUTxNIw~SkHM!~G% k|A!@C4>6Z6`_J%$d#YJ`q;<eUZ%{7sboFyt=akR{0R5YbKmY&$ literal 0 HcmV?d00001 diff --git a/src/libs/solutions/spinner/icons/spinner_small.png b/src/libs/solutions/spinner/icons/spinner_small.png index 254e9c82fc0424e0e69db4e08558edd2dccf5708..cd6e92a7370d86cca3b2f24361c8686a172d6c51 100644 GIT binary patch delta 193 zcmdnZbcu0-WIY1|1B2C!1$!A77-o99IEF}sr}i82H5>4_S_Zwlv~+sHi7RW_9c>v; zU9)_3%Omw6-<m)Ph0^XPzaBSCc%}HOZsPy#+SiPhb#z(wOD|x3P`h?96W4mz0~!8i zi~%1S4V0Gj9rO6V<ZAO|+wW&SD*orP_*$X7R#SY6TGbW%hFR@ahdHXsrTdoMG=2Nz zublSY*{OB$Z>savC6d1Kt^TaOxvA)mSmY7@$ecT~pF}4f1i9AJ)z4*}Q$iB}_*GX1 delta 299 zcmcb_xSMH$WIY=L1B3kM|A`C?j7**`jv*GkOE1}aH9HC%`#Aq+fFrM?wysU%BC%_e z%;ssd3IuHUBsI@LKwoj*K`#Lple!j_q>t~kAHP=9l#z%?`~LsTn==Nt^CtUmjk3^B z%<WS!Q4W_AyLedgR`G+sPqu0Vq}@Nn8D;z+^vdM_9D5e^SLf6}-V)^5a=)NGaNQ9x zy@JlU0{M?Q+C6iYZPh9e`N^#Rz~=J~bJsn=yjP0W|I0po<IIuG@hj3F=#_nJaBTR# zq0zl&sza&p?ug^u^F-_4X}En~C-K;Ejf&o-!lwBJt^EpiL1*e3M34HJEIuG{c*<9) z`7`BQCK{?;@R%-qXURMsW0iu?l%Q`51@(@fe13Di=s&jYw+;M0$Zdbfz`(%Z>FVdQ I&MBb@072e|`Tzg` diff --git a/src/libs/solutions/spinner/icons/spinner_small@2x.png b/src/libs/solutions/spinner/icons/spinner_small@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..36821a92e19f7d4e286da4a890d5f9a1962f01f7 GIT binary patch literal 302 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4h9AWhA=@@4F(2=ubwWBAr`0iPPXN1HsEQs z40=Cl)8^1Q3(7fz+gB}T;Os2maEb7~)v4#fF=f&O3;Td+VP8{z)^eWP%(+9j-SUpt z2jvB7*$sPnF1Q@O!yYlMTq;AUMTC*z^ra9XCIv+&4V|0?bHAD-{}NuR@I;m?A!z?> zwZ;er@9XEUw6NsJ)@ZN@@+-~lxDb7R#m~OUTHjdC-S(Td(eB7^p_1FL4lbFT`c?AK zJO{3i{0Bsizg1IQygl#xOp}Ax^Nz2uIw*1fSbtdX!pB}_+f8-W>K~}Ovq1Ymyu?a% zQ}c%HMd!P%@)^oASpy5j3$D%k%>LBw!5@ovJa<lgKOnv8X;DSvE2~?efbewnb6Mw< G&;$UjC4CD3 literal 0 HcmV?d00001 diff --git a/src/libs/solutions/spinner/spinner.cpp b/src/libs/solutions/spinner/spinner.cpp index 2dc241db7e1..114fea537da 100644 --- a/src/libs/solutions/spinner/spinner.cpp +++ b/src/libs/solutions/spinner/spinner.cpp @@ -3,7 +3,9 @@ #include "spinner.h" +#include <QApplication> #include <QEvent> +#include <QIcon> #include <QPainter> #include <QTimer> #include <QWidget> @@ -81,7 +83,7 @@ private: int m_rotationStep = 45; int m_rotation = 0; QTimer m_timer; - QPixmap m_pixmap; + mutable QPixmap m_pixmap; UpdateCallback m_callback; }; @@ -98,6 +100,18 @@ static QString imageFileNameForSpinnerSize(SpinnerSize size) return {}; } +static QPixmap themedPixmapForSpinnerSize(SpinnerSize size, qreal dpr) +{ + QImage mask(qt_findAtNxFile(imageFileNameForSpinnerSize(size), dpr)); + mask.invertPixels(); + QImage themedImage(mask.size(), QImage::Format_ARGB32); + themedImage.fill(qApp->palette().text().color()); + themedImage.setAlphaChannel(mask); + QPixmap themedPixmap = QPixmap::fromImage(themedImage); + themedPixmap.setDevicePixelRatio(mask.devicePixelRatio()); + return themedPixmap; +} + SpinnerPainter::SpinnerPainter(SpinnerSize size) { m_timer.setSingleShot(false); @@ -114,11 +128,14 @@ void SpinnerPainter::setSize(SpinnerSize size) m_size = size; m_rotationStep = size == SpinnerSize::Small ? 45 : 30; m_timer.setInterval(size == SpinnerSize::Small ? 100 : 80); - m_pixmap = QPixmap(imageFileNameForSpinnerSize(size)); + m_pixmap = themedPixmapForSpinnerSize(size, qApp->devicePixelRatio()); } void SpinnerPainter::paint(QPainter &painter, const QRect &rect) const { + const qreal dpr = painter.device()->devicePixelRatioF(); + if (!qFuzzyCompare(m_pixmap.devicePixelRatio(), dpr)) + m_pixmap = themedPixmapForSpinnerSize(m_size, dpr); painter.save(); painter.setRenderHint(QPainter::SmoothPixmapTransform); QPoint translate(rect.x() + rect.width() / 2, rect.y() + rect.height() / 2); diff --git a/src/libs/solutions/spinner/spinner.qrc b/src/libs/solutions/spinner/spinner.qrc index 5ad85953e8d..0b8a980272e 100644 --- a/src/libs/solutions/spinner/spinner.qrc +++ b/src/libs/solutions/spinner/spinner.qrc @@ -1,7 +1,10 @@ <RCC> <qresource prefix="/" > <file>icons/spinner_large.png</file> + <file>icons/spinner_large@2x.png</file> <file>icons/spinner_medium.png</file> + <file>icons/spinner_medium@2x.png</file> <file>icons/spinner_small.png</file> + <file>icons/spinner_small@2x.png</file> </qresource> </RCC> diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg index 17583cb29a2..155b5ee2729 100644 --- a/src/tools/icons/qtcreatoricons.svg +++ b/src/tools/icons/qtcreatoricons.svg @@ -1200,6 +1200,27 @@ y="0" x="0" /> </g> + <use + x="0" + y="0" + xlink:href="#src/libs/utils/images/progressindicator_big" + id="src/libs/solutions/spinner/icons/spinner_large" + transform="translate(97,-29)" + style="display:inline" /> + <use + x="0" + y="0" + xlink:href="#src/libs/utils/images/progressindicator_medium" + id="src/libs/solutions/spinner/icons/spinner_medium" + transform="translate(98,-61)" + style="display:inline" /> + <use + x="0" + y="0" + xlink:href="#src/libs/utils/images/progressindicator_small" + id="src/libs/solutions/spinner/icons/spinner_small" + transform="translate(243,-177)" + style="display:inline" /> <g id="src/plugins/coreplugin/find/images/wrapindicator"> <rect From 301e18f12be3867db44e1706fa6ee8da418d7d2f Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 13 Jul 2023 13:30:34 +0200 Subject: [PATCH 0361/1777] LogTailFiles: Replace QProcess with Process Change-Id: Ia154daf16a801d8d09ac1a1a5e00c669ad9f36ad Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/ios/iostoolhandler.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/plugins/ios/iostoolhandler.cpp b/src/plugins/ios/iostoolhandler.cpp index 34dd74de2ec..3d6fe1cfde1 100644 --- a/src/plugins/ios/iostoolhandler.cpp +++ b/src/plugins/ios/iostoolhandler.cpp @@ -65,27 +65,20 @@ public: watcher.setFuture(promise.future()); // Process to print the console output while app is running. - auto logProcess = [&](QProcess *tailProcess, std::shared_ptr<QTemporaryFile> file) { - QObject::connect(tailProcess, &QProcess::readyReadStandardOutput, &loop, [&, tailProcess] { + auto logProcess = [&](Process *tailProcess, std::shared_ptr<QTemporaryFile> file) { + QObject::connect(tailProcess, &Process::readyReadStandardOutput, &loop, [&, tailProcess] { if (!promise.isCanceled()) - emit logMessage(QString::fromLocal8Bit(tailProcess->readAll())); + emit logMessage(QString::fromLocal8Bit(tailProcess->readAllRawStandardOutput())); }); - tailProcess->start(QStringLiteral("tail"), {"-f", file->fileName()}); + tailProcess->setCommand({FilePath::fromString("tail"), {"-f", file->fileName()}}); + tailProcess->start(); }; - auto processDeleter = [](QProcess *process) { - if (process->state() != QProcess::NotRunning) { - process->terminate(); - process->waitForFinished(); - } - delete process; - }; - - std::unique_ptr<QProcess, void(*)(QProcess *)> tailStdout(new QProcess, processDeleter); + std::unique_ptr<Process> tailStdout(new Process); if (stdoutFile) logProcess(tailStdout.get(), stdoutFile); - std::unique_ptr<QProcess, void(*)(QProcess *)> tailStderr(new QProcess, processDeleter); + std::unique_ptr<Process> tailStderr(new Process); if (stderrFile) logProcess(tailStderr.get(), stderrFile); From 134eee611a761b0ee0152ba419c08703998c1d92 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 15 Jul 2023 09:44:27 +0200 Subject: [PATCH 0362/1777] AndroidDeployQtStep: Use promise for checking canceled state Change-Id: I4fec6004b0b17be182088dab4deb49aa2d7c8a0b Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/android/androiddeployqtstep.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index 6b44a850ef9..c75b14bf362 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -91,7 +91,7 @@ private: bool init() override; Tasking::GroupItem runRecipe() final; void gatherFilesToPull(); - DeployErrorCode runDeploy(); + DeployErrorCode runDeploy(QPromise<void> &promise); void slotAskForUninstall(DeployErrorCode errorCode); void runImpl(QPromise<void> &promise); @@ -341,7 +341,7 @@ bool AndroidDeployQtStep::init() return true; } -AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::runDeploy() +AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::runDeploy(QPromise<void> &promise) { CommandLine cmd(m_command); if (m_useAndroiddeployqt && m_apkPath.isEmpty()) { @@ -404,7 +404,7 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::runDeploy() if (process.state() == QProcess::NotRunning) break; - if (isCanceled()) { + if (promise.isCanceled()) { process.kill(); process.waitForFinished(); } @@ -494,12 +494,12 @@ void AndroidDeployQtStep::runImpl(QPromise<void> &promise) AndroidManager::setDeviceSerialNumber(target(), serialNumber); } - DeployErrorCode returnValue = runDeploy(); + DeployErrorCode returnValue = runDeploy(promise); if (returnValue > DeployErrorCode::NoError && returnValue < DeployErrorCode::Failure) { emit askForUninstall(returnValue); if (m_askForUninstall) { m_uninstallPreviousPackageRun = true; - returnValue = runDeploy(); + returnValue = runDeploy(promise); } } From 433f8a32417143fd10afe1d011721ecb1974fbc0 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 15:53:52 +0200 Subject: [PATCH 0363/1777] CMake: Remove an accidentally introduces second build dir aspect Not quite harmless, as it was destroying persistent data written by the normal one. Amends b9cf021b8edc. Change-Id: Ie2775881535c4d19174177f443a4606acc1576de Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index f5961f03aef..2ed08688cf5 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1350,7 +1350,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) { m_buildSystem = new CMakeBuildSystem(this); - buildDir.setValueAcceptor( + buildDirectoryAspect()->setValueAcceptor( [](const QString &oldDir, const QString &newDir) -> std::optional<QString> { if (oldDir.isEmpty()) return newDir; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index cee3ae64baa..a04de47196e 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -79,7 +79,6 @@ public: void setInitialCMakeArguments(const QStringList &args); void setCMakeBuildType(const QString &cmakeBuildType, bool quiet = false); - ProjectExplorer::BuildDirectoryAspect buildDir{this, this}; Internal::InitialCMakeArgumentsAspect initialCMakeArguments{this}; Utils::StringAspect additionalCMakeOptions{this}; Utils::FilePathAspect sourceDirectory{this}; From 4ab1d75ee6aa60b4c4122aa88c521653004640f1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 12 Jul 2023 15:41:06 +0200 Subject: [PATCH 0364/1777] Utils: Introduce a staging area for gui values Accessing gui elements is very aspect-specific, whereas the rules when and how values are synchronized are rather general. Splitting the two concepts and having a permanent 'buffer' area that is synchronized with the gui elements if and only if they have been created helps to keep the boilerplate needed per-aspect at a minimum. This value could also serve as "model" in case we wanted to allow multiple "views" in different places of the gui onto that aspect. Change-Id: I34832512b99c53cb0e4df437ee9b4c5d17a2ad8f Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/aspects.cpp | 306 +++++++++--------- src/libs/utils/aspects.h | 92 +++--- src/plugins/debugger/debuggeractions.h | 4 +- .../debuggersourcepathmappingwidget.cpp | 8 +- src/plugins/valgrind/valgrindsettings.cpp | 10 +- src/plugins/valgrind/valgrindsettings.h | 4 +- 6 files changed, 211 insertions(+), 213 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 3225274788e..5a1e214c24f 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -472,7 +472,8 @@ void createItem(Layouting::LayoutItem *item, const BaseAspect *aspect) */ void BaseAspect::apply() { - if (silentApply()) { + if (isDirty()) { + silentApply(); if (hasAction()) emit action()->triggered(variantValue().toBool()); emit changed(); @@ -485,10 +486,11 @@ void BaseAspect::apply() \returns whether the value changed. Does not emit signals. */ -bool BaseAspect::silentApply() +void BaseAspect::silentApply() { - guiToInternal(); - return internalToExternal(); + guiToBuffer(); + bufferToInternal(); + internalToExternal(); } /*! Discard user changes in the widget and restore widget contents from @@ -498,8 +500,8 @@ bool BaseAspect::silentApply() */ void BaseAspect::cancel() { - externalToInternal(); - internalToGui(); + internalToBuffer(); + bufferToGui(); } void BaseAspect::finish() @@ -873,7 +875,7 @@ PathChooser *StringAspect::pathChooser() const void StringAspect::setShowToolTipOnLabel(bool show) { d->m_showToolTipOnLabel = show; - internalToGui(); + bufferToGui(); } /*! @@ -1125,25 +1127,17 @@ void StringAspect::addToLayout(LayoutItem &parent) d->updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data()); addLabeledItem(parent, d->m_pathChooserDisplay); useMacroExpander(d->m_pathChooserDisplay->lineEdit()); - if (isAutoApply()) { - if (d->m_autoApplyOnEditingFinished) { - const auto setPathChooserValue = [this] { - if (d->m_blockAutoApply) - return; - d->m_blockAutoApply = true; - setValue(d->m_pathChooserDisplay->filePath().toString()); - d->m_blockAutoApply = false; - }; - connect(d->m_pathChooserDisplay, &PathChooser::editingFinished, this, setPathChooserValue); - connect(d->m_pathChooserDisplay, &PathChooser::browsingFinished, this, setPathChooserValue); - } else { - connect(d->m_pathChooserDisplay, &PathChooser::textChanged, - this, [this](const QString &path) { - setValue(path); - }); - } - } connect(d->m_pathChooserDisplay, &PathChooser::validChanged, this, &StringAspect::validChanged); + bufferToGui(); + if (isAutoApply() && d->m_autoApplyOnEditingFinished) { + connect(d->m_pathChooserDisplay, &PathChooser::editingFinished, + this, &StringAspect::handleGuiChanged); + connect(d->m_pathChooserDisplay, &PathChooser::browsingFinished, + this, &StringAspect::handleGuiChanged); + } else { + connect(d->m_pathChooserDisplay, &PathChooser::textChanged, + this, &StringAspect::handleGuiChanged); + } break; case LineEditDisplay: d->m_lineEditDisplay = createSubWidget<FancyLineEdit>(); @@ -1159,25 +1153,6 @@ void StringAspect::addToLayout(LayoutItem &parent) d->updateWidgetFromCheckStatus(this, d->m_lineEditDisplay.data()); addLabeledItem(parent, d->m_lineEditDisplay); useMacroExpander(d->m_lineEditDisplay); - if (isAutoApply()) { - if (d->m_autoApplyOnEditingFinished) { - connect(d->m_lineEditDisplay, &FancyLineEdit::editingFinished, this, [this] { - if (d->m_blockAutoApply) - return; - d->m_blockAutoApply = true; - setValue(d->m_lineEditDisplay->text()); - d->m_blockAutoApply = false; - }); - } else { - connect(d->m_lineEditDisplay, - &FancyLineEdit::textEdited, - this, - &StringAspect::setValue); - connect(d->m_lineEditDisplay, &FancyLineEdit::editingFinished, this, [this] { - setValue(d->m_lineEditDisplay->text()); - }); - } - } if (d->m_useResetButton) { auto resetButton = createSubWidget<QPushButton>(Tr::tr("Reset")); resetButton->setEnabled(d->m_lineEditDisplay->text() != defaultValue()); @@ -1190,6 +1165,14 @@ void StringAspect::addToLayout(LayoutItem &parent) parent.addItem(resetButton); } connect(d->m_lineEditDisplay, &FancyLineEdit::validChanged, this, &StringAspect::validChanged); + bufferToGui(); + if (isAutoApply() && d->m_autoApplyOnEditingFinished) { + connect(d->m_lineEditDisplay, &FancyLineEdit::editingFinished, + this, &StringAspect::handleGuiChanged); + } else { + connect(d->m_lineEditDisplay, &QLineEdit::textEdited, + this, &StringAspect::handleGuiChanged); + } break; case TextEditDisplay: d->m_textEditDisplay = createSubWidget<QTextEdit>(); @@ -1202,11 +1185,9 @@ void StringAspect::addToLayout(LayoutItem &parent) d->updateWidgetFromCheckStatus(this, d->m_textEditDisplay.data()); addLabeledItem(parent, d->m_textEditDisplay); useMacroExpander(d->m_textEditDisplay); - if (isAutoApply()) { - connect(d->m_textEditDisplay, &QTextEdit::textChanged, this, [this] { - setValue(d->m_textEditDisplay->document()->toPlainText()); - }); - } + bufferToGui(); + connect(d->m_textEditDisplay, &QTextEdit::textChanged, + this, &StringAspect::handleGuiChanged); break; case LabelDisplay: d->m_labelDisplay = createSubWidget<ElidingLabel>(); @@ -1218,63 +1199,67 @@ void StringAspect::addToLayout(LayoutItem &parent) break; } - validateInput(); - if (d->m_checker && d->m_checkBoxPlacement == CheckBoxPlacement::Right) d->m_checker->addToLayout(parent); } -void StringAspect::guiToInternal() +void StringAspect::guiToBuffer() { - QString val; switch (d->m_displayStyle) { case PathChooserDisplay: if (d->m_pathChooserDisplay) - val = d->m_pathChooserDisplay->lineEdit()->text(); + m_buffer = d->m_pathChooserDisplay->lineEdit()->text(); break; case LineEditDisplay: if (d->m_lineEditDisplay) - val = d->m_lineEditDisplay->text(); + m_buffer = d->m_lineEditDisplay->text(); break; case TextEditDisplay: if (d->m_textEditDisplay) - val = d->m_textEditDisplay->document()->toPlainText(); + m_buffer = d->m_textEditDisplay->document()->toPlainText(); case LabelDisplay: break; } - - if (d->m_valueAcceptor) { - const std::optional<QString> tmp = d->m_valueAcceptor(m_internal, val); - if (tmp) - m_internal = *tmp; - } else { - m_internal = val; - } } -void StringAspect::internalToGui() +void StringAspect::bufferToInternal() +{ + if (d->m_valueAcceptor) { + if (const std::optional<QString> tmp = d->m_valueAcceptor(m_internal, m_buffer)) + m_internal = *tmp; + return; + } + + m_internal = m_buffer; +} + +void StringAspect::internalToBuffer() +{ + m_buffer = d->m_displayFilter ? d->m_displayFilter(m_internal) : m_internal; +} + +void StringAspect::bufferToGui() { - const QString displayed = d->m_displayFilter ? d->m_displayFilter(m_internal) : m_internal; if (d->m_pathChooserDisplay) { - d->m_pathChooserDisplay->lineEdit()->setText(displayed); + d->m_pathChooserDisplay->lineEdit()->setText(m_buffer); d->updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data()); } if (d->m_lineEditDisplay) { - d->m_lineEditDisplay->setTextKeepingActiveCursor(displayed); + d->m_lineEditDisplay->setTextKeepingActiveCursor(m_buffer); d->updateWidgetFromCheckStatus(this, d->m_lineEditDisplay.data()); } if (d->m_textEditDisplay) { const QString old = d->m_textEditDisplay->document()->toPlainText(); - if (displayed != old) - d->m_textEditDisplay->setText(displayed); + if (m_buffer != old) + d->m_textEditDisplay->setText(m_buffer); d->updateWidgetFromCheckStatus(this, d->m_textEditDisplay.data()); } if (d->m_labelDisplay) { - d->m_labelDisplay->setText(displayed); - d->m_labelDisplay->setToolTip(d->m_showToolTipOnLabel ? displayed : toolTip()); + d->m_labelDisplay->setText(m_buffer); + d->m_labelDisplay->setToolTip(d->m_showToolTipOnLabel ? m_buffer : toolTip()); } validateInput(); @@ -1299,17 +1284,20 @@ void StringAspect::makeCheckable(CheckBoxPlacement checkBoxPlacement, d->m_checker->setSettingsKey(checkerKey); connect(d->m_checker.get(), &BoolAspect::changed, this, [this] { - internalToGui(); + internalToBuffer(); + bufferToGui(); emit changed(); checkedChanged(); }); connect(d->m_checker.get(), &BoolAspect::volatileValueChanged, this, [this] { - internalToGui(); + internalToBuffer(); + bufferToGui(); checkedChanged(); }); - internalToGui(); + internalToBuffer(); + bufferToGui(); } @@ -1392,25 +1380,22 @@ void ColorAspect::addToLayout(Layouting::LayoutItem &parent) QTC_CHECK(!d->m_colorButton); d->m_colorButton = createSubWidget<QtColorButton>(); parent.addItem(d->m_colorButton.data()); - d->m_colorButton->setColor(value()); - if (isAutoApply()) { - connect(d->m_colorButton.data(), - &QtColorButton::colorChanged, - this, - [this](const QColor &color) { setValue(color); }); - } + + bufferToGui(); + connect(d->m_colorButton.data(), &QtColorButton::colorChanged, + this, &ColorAspect::handleGuiChanged); } -void ColorAspect::internalToGui() +void ColorAspect::guiToBuffer() { if (d->m_colorButton) - m_internal = d->m_colorButton->color(); + m_buffer = d->m_colorButton->color(); } -void ColorAspect::guiToInternal() +void ColorAspect::bufferToGui() { if (d->m_colorButton) - d->m_colorButton->setColor(m_internal); + d->m_colorButton->setColor(m_buffer); } /*! @@ -1445,6 +1430,8 @@ BoolAspect::~BoolAspect() = default; */ void BoolAspect::addToLayout(Layouting::LayoutItem &parent) { + QTC_ASSERT(m_buffer == m_internal, m_buffer = m_internal); + if (!d->m_buttonIsAdopted) { QTC_CHECK(!d->m_button); d->m_button = createSubWidget<QCheckBox>(); @@ -1463,13 +1450,10 @@ void BoolAspect::addToLayout(Layouting::LayoutItem &parent) addLabeledItem(parent, d->m_button); break; } - d->m_button->setChecked(value()); - if (isAutoApply()) { - connect(d->m_button.data(), &QAbstractButton::clicked, - this, [this](bool val) { setValue(val); }); - } + + bufferToGui(); connect(d->m_button.data(), &QAbstractButton::clicked, - this, &BoolAspect::volatileValueChanged); + this, &BoolAspect::handleGuiChanged); } void BoolAspect::adoptButton(QAbstractButton *button) @@ -1499,35 +1483,28 @@ QAction *BoolAspect::action() return TypedAspect::action(); auto act = TypedAspect::action(); // Creates it. act->setCheckable(true); - act->setChecked(value()); + act->setChecked(m_internal); act->setToolTip(toolTip()); connect(act, &QAction::triggered, this, [this](bool newValue) { - // The check would be nice to have in simple conditions, but if we - // have an action that's used both on a settings page and as action - // in a menu like "Use FakeVim", isAutoApply() is false, and yet this - // here can trigger. - //QTC_CHECK(isAutoApply()); - m_external = newValue; - externalToInternal(); - internalToGui(); + setValue(newValue); }); return act; } -void BoolAspect::guiToInternal() +void BoolAspect::guiToBuffer() { if (d->m_button) - m_internal = d->m_button->isChecked(); + m_buffer = d->m_button->isChecked(); else if (d->m_groupBox) - m_internal = d->m_groupBox->isChecked(); + m_buffer = d->m_groupBox->isChecked(); } -void BoolAspect::internalToGui() +void BoolAspect::bufferToGui() { if (d->m_button) - d->m_button->setChecked(m_internal); + d->m_button->setChecked(m_buffer); else if (d->m_groupBox) - d->m_groupBox->setChecked(m_internal); + d->m_groupBox->setChecked(m_buffer); } void BoolAspect::setLabel(const QString &labelText, LabelPlacement labelPlacement) @@ -1587,6 +1564,7 @@ void SelectionAspect::addToLayout(Layouting::LayoutItem &parent) QTC_CHECK(d->m_buttonGroup == nullptr); QTC_CHECK(!d->m_comboBox); QTC_ASSERT(d->m_buttons.isEmpty(), d->m_buttons.clear()); + QTC_ASSERT(m_buffer == m_internal, m_buffer = m_internal); switch (d->m_displayStyle) { case DisplayStyle::RadioButtons: @@ -1601,50 +1579,45 @@ void SelectionAspect::addToLayout(Layouting::LayoutItem &parent) parent.addItem(button); d->m_buttons.append(button); d->m_buttonGroup->addButton(button, i); - if (isAutoApply()) { - connect(button, &QAbstractButton::clicked, this, [this, i] { - setValue(i); - }); - } } + bufferToGui(); + connect(d->m_buttonGroup, &QButtonGroup::idClicked, + this, &SelectionAspect::handleGuiChanged); break; case DisplayStyle::ComboBox: setLabelText(displayName()); d->m_comboBox = createSubWidget<QComboBox>(); for (int i = 0, n = d->m_options.size(); i < n; ++i) d->m_comboBox->addItem(d->m_options.at(i).displayName); - if (isAutoApply()) { - connect(d->m_comboBox.data(), &QComboBox::activated, - this, &SelectionAspect::setValue); - } - connect(d->m_comboBox.data(), &QComboBox::currentIndexChanged, - this, &SelectionAspect::volatileValueChanged); d->m_comboBox->setCurrentIndex(value()); addLabeledItem(parent, d->m_comboBox); + bufferToGui(); + connect(d->m_comboBox.data(), &QComboBox::activated, + this, &SelectionAspect::handleGuiChanged); break; } } -void SelectionAspect::guiToInternal() +void SelectionAspect::guiToBuffer() { switch (d->m_displayStyle) { case DisplayStyle::RadioButtons: if (d->m_buttonGroup) - m_internal = d->m_buttonGroup->checkedId(); + m_buffer = d->m_buttonGroup->checkedId(); break; case DisplayStyle::ComboBox: if (d->m_comboBox) - m_internal = d->m_comboBox->currentIndex(); + m_buffer = d->m_comboBox->currentIndex(); break; } } -void SelectionAspect::internalToGui() +void SelectionAspect::bufferToGui() { switch (d->m_displayStyle) { case DisplayStyle::RadioButtons: { if (d->m_buttonGroup) { - QAbstractButton *button = d->m_buttonGroup->button(m_internal); + QAbstractButton *button = d->m_buttonGroup->button(m_buffer); QTC_ASSERT(button, return); button->setChecked(true); } @@ -1652,7 +1625,7 @@ void SelectionAspect::internalToGui() } case DisplayStyle::ComboBox: if (d->m_comboBox) - d->m_comboBox->setCurrentIndex(m_internal); + d->m_comboBox->setCurrentIndex(m_buffer); break; } } @@ -1775,17 +1748,13 @@ void MultiSelectionAspect::addToLayout(LayoutItem &builder) switch (d->m_displayStyle) { case DisplayStyle::ListView: d->m_listView = createSubWidget<QListWidget>(); - for (const QString &val : std::as_const(d->m_allValues)) { - auto item = new QListWidgetItem(val, d->m_listView); - item->setFlags(item->flags() | Qt::ItemIsUserCheckable); - item->setCheckState(value().contains(item->text()) ? Qt::Checked : Qt::Unchecked); - } - connect(d->m_listView, &QListWidget::itemChanged, this, - [this](QListWidgetItem *item) { - if (d->setValueSelectedHelper(item->text(), item->checkState() & Qt::Checked)) - emit changed(); - }); + for (const QString &val : std::as_const(d->m_allValues)) + (void) new QListWidgetItem(val, d->m_listView); addLabeledItem(builder, d->m_listView); + + bufferToGui(); + connect(d->m_listView, &QListWidget::itemChanged, + this, &MultiSelectionAspect::handleGuiChanged); } } @@ -1820,27 +1789,28 @@ void MultiSelectionAspect::setDisplayStyle(MultiSelectionAspect::DisplayStyle st d->m_displayStyle = style; } -void MultiSelectionAspect::internalToGui() +void MultiSelectionAspect::bufferToGui() { if (d->m_listView) { const int n = d->m_listView->count(); QTC_CHECK(n == d->m_allValues.size()); for (int i = 0; i != n; ++i) { auto item = d->m_listView->item(i); - item->setCheckState(m_internal.contains(item->text()) ? Qt::Checked : Qt::Unchecked); + item->setCheckState(m_buffer.contains(item->text()) ? Qt::Checked : Qt::Unchecked); } } } -void MultiSelectionAspect::guiToInternal() +void MultiSelectionAspect::guiToBuffer() { if (d->m_listView) { - m_internal.clear(); - for (const QString &val : std::as_const(d->m_allValues)) { - auto item = new QListWidgetItem(val, d->m_listView); - item->setFlags(item->flags() | Qt::ItemIsUserCheckable); + m_buffer.clear(); + const int n = d->m_listView->count(); + QTC_CHECK(n == d->m_allValues.size()); + for (int i = 0; i != n; ++i) { + auto item = d->m_listView->item(i); if (item->checkState() == Qt::Checked) - m_internal.append(item->text()); + m_buffer.append(item->text()); } } } @@ -1897,16 +1867,16 @@ void IntegerAspect::addToLayout(Layouting::LayoutItem &parent) } } -void IntegerAspect::guiToInternal() +void IntegerAspect::guiToBuffer() { if (d->m_spinBox) - m_internal = d->m_spinBox->value() * d->m_displayScaleFactor; + m_buffer = d->m_spinBox->value() * d->m_displayScaleFactor; } -void IntegerAspect::internalToGui() +void IntegerAspect::bufferToGui() { if (d->m_spinBox) - d->m_spinBox->setValue(m_internal / d->m_displayScaleFactor); + d->m_spinBox->setValue(m_buffer / d->m_displayScaleFactor); } void IntegerAspect::setRange(qint64 min, qint64 max) @@ -1990,7 +1960,7 @@ void DoubleAspect::addToLayout(LayoutItem &builder) d->m_spinBox->setSpecialValueText(d->m_specialValueText); if (d->m_maximumValue && d->m_maximumValue) d->m_spinBox->setRange(d->m_minimumValue.value(), d->m_maximumValue.value()); - internalToGui(); // Must happen after setRange()! + bufferToGui(); // Must happen after setRange()! addLabeledItem(builder, d->m_spinBox); if (isAutoApply()) { @@ -1999,16 +1969,16 @@ void DoubleAspect::addToLayout(LayoutItem &builder) } } -void DoubleAspect::guiToInternal() +void DoubleAspect::guiToBuffer() { if (d->m_spinBox) - m_internal = d->m_spinBox->value(); + m_buffer = d->m_spinBox->value(); } -void DoubleAspect::internalToGui() +void DoubleAspect::bufferToGui() { if (d->m_spinBox) - d->m_spinBox->setValue(m_internal); + d->m_spinBox->setValue(m_buffer); } void DoubleAspect::setRange(double min, double max) @@ -2477,7 +2447,7 @@ BaseAspect::Data::Ptr BaseAspect::extractData() const No-op otherwise. */ -void BaseAspect::internalToGui() +void BaseAspect::bufferToGui() {} /* @@ -2486,19 +2456,27 @@ void BaseAspect::internalToGui() No-op otherwise. */ -void BaseAspect::guiToInternal() +void BaseAspect::guiToBuffer() {} /* - Mirrors internal volatile value to the externally visible value. + Mirrors buffered volatile value to the internal value. This function is used for \c apply(). - - \returns whether the value changes. */ -bool BaseAspect::internalToExternal() -{ - return false; -} + +void BaseAspect::bufferToInternal() +{} + + +void BaseAspect::internalToBuffer() +{} + +/* + Applies common postprocessing like macro expansion. +*/ + +void BaseAspect::internalToExternal() +{} /* Mirrors externally visible value to internal volatile value. @@ -2506,6 +2484,14 @@ bool BaseAspect::internalToExternal() void BaseAspect::externalToInternal() {} +void BaseAspect::handleGuiChanged() +{ + guiToBuffer(); + emit volatileValueChanged(); + if (isAutoApply()) + apply(); +} + void BaseAspect::addDataExtractorHelper(const DataExtractor &extractor) const { d->m_dataExtractors.append(extractor); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 17faa1225ea..cb596949de5 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -112,7 +112,7 @@ public: QVariant fromSettingsValue(const QVariant &val) const; virtual void apply(); - virtual bool silentApply(); + virtual void silentApply(); virtual void cancel(); virtual void finish(); virtual bool isDirty(); @@ -170,11 +170,15 @@ signals: void labelLinkActivated(const QString &link); protected: - virtual void internalToGui(); - virtual void guiToInternal(); - virtual bool internalToExternal(); + virtual void internalToBuffer(); + virtual void bufferToInternal(); + virtual void bufferToGui(); + virtual void guiToBuffer(); + virtual void internalToExternal(); virtual void externalToInternal(); + virtual void handleGuiChanged(); + QLabel *label() const; void setupLabel(); void addLabeledItem(Layouting::LayoutItem &parent, QWidget *widget); @@ -243,46 +247,50 @@ public: void setValue(const ValueType &value) { - m_external = value; - const bool emitSignal = m_external != m_internal; - externalToInternal(); - internalToGui(); - if (emitSignal) - emit changed(); + m_internal = value; + internalToBuffer(); + bufferToGui(); + internalToExternal(); } void setValueQuietly(const ValueType &value) - { - m_external = value; - externalToInternal(); - internalToGui(); - } - - void setVolatileValue(const ValueType &value) { m_internal = value; - internalToGui(); + internalToBuffer(); + bufferToGui(); + internalToExternal(); } ValueType volatileValue() const { - const_cast<TypedAspect *>(this)->guiToInternal(); - return m_internal; + return m_buffer; + } + + void setVolatileValue(const ValueType &value) + { + m_buffer = value; + bufferToGui(); } protected: bool isDirty() override { - guiToInternal(); - return m_internal != m_external; + return m_internal != m_buffer; } - bool internalToExternal() override + void internalToBuffer() override + { + m_buffer = m_internal; + } + + void bufferToInternal() override + { + m_internal = m_buffer; + } + + void internalToExternal() override { - if (m_external == m_internal) - return false; m_external = m_internal; - return true; } void externalToInternal() override @@ -318,6 +326,7 @@ protected: ValueType m_default{}; ValueType m_external{}; ValueType m_internal{}; + ValueType m_buffer{}; }; class QTCREATOR_UTILS_EXPORT BoolAspect : public TypedAspect<bool> @@ -344,8 +353,8 @@ public: void adoptButton(QAbstractButton *button); private: - void internalToGui() override; - void guiToInternal() override; + void bufferToGui() override; + void guiToBuffer() override; std::unique_ptr<Internal::BoolAspectPrivate> d; }; @@ -361,8 +370,8 @@ public: void addToLayout(Layouting::LayoutItem &parent) override; private: - void internalToGui() override; - void guiToInternal() override; + void bufferToGui() override; + void guiToBuffer() override; std::unique_ptr<Internal::ColorAspectPrivate> d; }; @@ -409,8 +418,8 @@ public: QVariant itemValueForIndex(int index) const; protected: - void internalToGui() override; - void guiToInternal() override; + void bufferToGui() override; + void guiToBuffer() override; private: std::unique_ptr<Internal::SelectionAspectPrivate> d; @@ -433,8 +442,8 @@ public: void setAllValues(const QStringList &val); protected: - void internalToGui() override; - void guiToInternal() override; + void bufferToGui() override; + void guiToBuffer() override; private: std::unique_ptr<Internal::MultiSelectionAspectPrivate> d; @@ -509,8 +518,11 @@ signals: void validChanged(bool validState); protected: - void internalToGui() override; - void guiToInternal() override; + void bufferToGui() override; + void guiToBuffer() override; + + void internalToBuffer() override; + void bufferToInternal() override; std::unique_ptr<Internal::StringAspectPrivate> d; }; @@ -556,8 +568,8 @@ public: struct Data : BaseAspect::Data { qint64 value = 0; }; protected: - void internalToGui() override; - void guiToInternal() override; + void bufferToGui() override; + void guiToBuffer() override; private: std::unique_ptr<Internal::IntegerAspectPrivate> d; @@ -580,8 +592,8 @@ public: void setSingleStep(double step); protected: - void internalToGui() override; - void guiToInternal() override; + void bufferToGui() override; + void guiToBuffer() override; private: std::unique_ptr<Internal::DoubleAspectPrivate> d; diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index bfa76454777..c4f8c235532 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -36,8 +36,8 @@ public: void writeSettings() const override; private: - void guiToInternal() override; - void internalToGui() override; + void guiToBuffer() override; + void bufferToGui() override; SourcePathMapAspectPrivate *d = nullptr; }; diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 023918fe7f8..a8959ff4455 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -470,16 +470,16 @@ void SourcePathMapAspect::addToLayout(Layouting::LayoutItem &parent) parent.addItem(d->m_widget.data()); } -void SourcePathMapAspect::guiToInternal() +void SourcePathMapAspect::guiToBuffer() { if (d->m_widget) - m_internal = d->m_widget->sourcePathMap(); + m_buffer = d->m_widget->sourcePathMap(); } -void SourcePathMapAspect::internalToGui() +void SourcePathMapAspect::bufferToGui() { if (d->m_widget) - d->m_widget->setSourcePathMap(m_internal); + d->m_widget->setSourcePathMap(m_buffer); } const char sourcePathMappingArrayNameC[] = "SourcePathMappings"; diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 6140760b283..8331c5331c8 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -159,17 +159,17 @@ void SuppressionAspect::toMap(QVariantMap &map) const BaseAspect::toMap(map); } -void SuppressionAspect::guiToInternal() +void SuppressionAspect::guiToBuffer() { - m_internal.clear(); + m_buffer.clear(); for (int i = 0; i < d->m_model.rowCount(); ++i) - m_internal.append(FilePath::fromUserInput(d->m_model.item(i)->text())); + m_buffer.append(FilePath::fromUserInput(d->m_model.item(i)->text())); } -void SuppressionAspect::internalToGui() +void SuppressionAspect::bufferToGui() { d->m_model.clear(); - for (const FilePath &file : m_internal) + for (const FilePath &file : m_buffer) d->m_model.appendRow(new QStandardItem(file.toUserOutput())); } diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index 92ac467a015..aac01dac46d 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -28,8 +28,8 @@ public: void addSuppressionFile(const Utils::FilePath &suppressionFile); private: - void internalToGui() override; - void guiToInternal() override; + void bufferToGui() override; + void guiToBuffer() override; friend class ValgrindBaseSettings; SuppressionAspectPrivate *d = nullptr; From 109727d6de08a3d86e5e620f72540fc2e82eb924 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 14 Jul 2023 11:37:50 +0200 Subject: [PATCH 0365/1777] IosDeployStep: Introduce IosTransferTask It's going to be used in IosDeployStep. Change-Id: I01158207c0243421a38870718cdf125499eece34 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/ios/iosdeploystep.cpp | 77 +++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index 12a0b7a6c1c..764cb907f23 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -18,16 +18,91 @@ #include <projectexplorer/kitinformation.h> #include <projectexplorer/devicesupport/devicemanager.h> +#include <solutions/tasking/tasktree.h> + #include <utils/temporaryfile.h> #include <QFile> #include <QSettings> using namespace ProjectExplorer; +using namespace Tasking; using namespace Utils; namespace Ios::Internal { +class IosTransfer : public QObject +{ + Q_OBJECT + +public: + void setDeviceType(const IosDeviceType &deviceType) { m_deviceType = deviceType; } + void setBundlePath(const FilePath &bundlePath) { m_bundlePath = bundlePath; } + void setExpectSuccess(bool success) { m_expectSuccess = success; } + void start() + { + QTC_ASSERT(m_deviceType, emit done(false); return); + QTC_ASSERT(!m_toolHandler, return); + + m_toolHandler.reset(new IosToolHandler(*m_deviceType)); + connect(m_toolHandler.get(), &IosToolHandler::isTransferringApp, this, + [this](IosToolHandler *, const FilePath &, const QString &, + int progress, int maxProgress, const QString &info) { + emit progressValueChanged(progress * 100 / maxProgress, info); + }); + connect(m_toolHandler.get(), &IosToolHandler::errorMsg, this, + [this](IosToolHandler *, const QString &message) { + if (message.contains(QLatin1String("AMDeviceInstallApplication returned -402653103"))) + TaskHub::addTask(DeploymentTask(Task::Warning, Tr::tr("The Info.plist might be incorrect."))); + emit errorMessage(message); + }); + connect(m_toolHandler.get(), &IosToolHandler::didTransferApp, this, + [this](IosToolHandler *, const FilePath &, const QString &, + IosToolHandler::OpStatus status) { + disconnect(m_toolHandler.get(), nullptr, this, nullptr); + m_toolHandler.release()->deleteLater(); + if (status != IosToolHandler::Success && m_expectSuccess) { + TaskHub::addTask(DeploymentTask(Task::Error, Tr::tr("Deployment failed. " + "The settings in the Devices window of Xcode might be incorrect."))); + } + emit done(status == IosToolHandler::Success); + }); + connect(m_toolHandler.get(), &IosToolHandler::finished, this, [this] { + disconnect(m_toolHandler.get(), nullptr, this, nullptr); + m_toolHandler.release()->deleteLater(); + TaskHub::addTask(DeploymentTask(Task::Error, Tr::tr("Deployment failed."))); + emit done(false); + }); + m_toolHandler->requestTransferApp(m_bundlePath, m_deviceType->identifier); + } + +signals: + void done(bool success); + void progressValueChanged(int progress, const QString &info); // progress in % + void errorMessage(const QString &message); + +private: + std::optional<IosDeviceType> m_deviceType; + FilePath m_bundlePath; + bool m_expectSuccess = true; + std::unique_ptr<IosToolHandler> m_toolHandler; +}; + +class IosTransferTaskAdapter : public TaskAdapter<IosTransfer> +{ +public: + IosTransferTaskAdapter() { connect(task(), &IosTransfer::done, this, &TaskInterface::done); } + +private: + void start() final { task()->start(); } +}; + +} // Ios::Internal + +TASKING_DECLARE_TASK(IosTransferTask, Ios::Internal::IosTransferTaskAdapter); + +namespace Ios::Internal { + class IosDeployStep final : public BuildStep { public: @@ -293,3 +368,5 @@ IosDeployStepFactory::IosDeployStepFactory() } } // Ios::Internal + +#include "iosdeploystep.moc" From 63bc9a2e42959f78432226fce7234b3664e8b909 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 14 Jul 2023 12:57:23 +0200 Subject: [PATCH 0366/1777] IosDeployStep: Add return value to checkProvisioningProfile() Change-Id: If5829daae851a4af06bcff7dcd60ecd6004b5bdb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/ios/iosdeploystep.cpp | 43 ++++++++++++++++--------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index 764cb907f23..b77345c5b52 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -137,7 +137,7 @@ private: IosSimulator::ConstPtr iossimulator() const; QString deviceId() const; - void checkProvisioningProfile(); + bool checkProvisioningProfile(); TransferStatus m_transferStatus = NoTransfer; IosToolHandler *m_toolHandler = nullptr; @@ -207,7 +207,7 @@ void IosDeployStep::doRun() this, &IosDeployStep::handleFinished); connect(m_toolHandler, &IosToolHandler::errorMsg, this, &IosDeployStep::handleErrorMsg); - checkProvisioningProfile(); + m_expectFail = !checkProvisioningProfile(); m_toolHandler->requestTransferApp(m_bundlePath, m_deviceType.identifier); } @@ -297,53 +297,54 @@ QString IosDeployStep::deviceId() const return iosdevice()->uniqueDeviceID(); } -void IosDeployStep::checkProvisioningProfile() +bool IosDeployStep::checkProvisioningProfile() { IosDevice::ConstPtr device = iosdevice(); if (device.isNull()) - return; + return true; const FilePath provisioningFilePath = m_bundlePath.pathAppended("embedded.mobileprovision"); - // the file is a signed plist stored in DER format // we simply search for start and end of the plist instead of decoding the DER payload if (!provisioningFilePath.exists()) - return; + return true; + QFile provisionFile(provisioningFilePath.toString()); if (!provisionFile.open(QIODevice::ReadOnly)) - return; - QByteArray provisionData = provisionFile.readAll(); - int start = provisionData.indexOf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); + return true; + + const QByteArray provisionData = provisionFile.readAll(); + const int start = provisionData.indexOf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); int end = provisionData.indexOf("</plist>"); if (start == -1 || end == -1) - return; - end += 8; + return true; + end += 8; TemporaryFile f("iosdeploy"); if (!f.open()) - return; + return true; + f.write(provisionData.mid(start, end - start)); f.flush(); - QSettings provisionPlist(f.fileName(), QSettings::NativeFormat); - + const QSettings provisionPlist(f.fileName(), QSettings::NativeFormat); if (!provisionPlist.contains(QLatin1String("ProvisionedDevices"))) - return; + return true; + const QStringList deviceIds = provisionPlist.value("ProvisionedDevices").toStringList(); const QString targetId = device->uniqueDeviceID(); for (const QString &deviceId : deviceIds) { if (deviceId == targetId) - return; + return true; } - m_expectFail = true; const QString provisioningProfile = provisionPlist.value(QLatin1String("Name")).toString(); const QString provisioningUid = provisionPlist.value(QLatin1String("UUID")).toString(); - CompileTask task(Task::Warning, + const CompileTask task(Task::Warning, Tr::tr("The provisioning profile \"%1\" (%2) used to sign the application " - "does not cover the device %3 (%4). Deployment to it will fail.") - .arg(provisioningProfile, provisioningUid, device->displayName(), - targetId)); + "does not cover the device %3 (%4). Deployment to it will fail.") + .arg(provisioningProfile, provisioningUid, device->displayName(), targetId)); emit addTask(task); + return false; } IosDevice::ConstPtr IosDeployStep::iosdevice() const From 9692ccf3527731e06b269965fb034bdd2acae445 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 14 Jul 2023 12:32:06 +0200 Subject: [PATCH 0367/1777] IosDeployStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I212aa8cc66d97b84adce9d8acdf8e958989bdc6b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/ios/iosdeploystep.cpp | 131 +++++------------------------- 1 file changed, 21 insertions(+), 110 deletions(-) diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index b77345c5b52..b218af2284d 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -106,45 +106,26 @@ namespace Ios::Internal { class IosDeployStep final : public BuildStep { public: - enum TransferStatus { - NoTransfer, - TransferInProgress, - TransferOk, - TransferFailed - }; - IosDeployStep(BuildStepList *bc, Utils::Id id); private: void cleanup(); - void doRun() final; - void doCancel() final; + Tasking::GroupItem runRecipe() final; - void handleIsTransferringApp(IosToolHandler *handler, const FilePath &bundlePath, - const QString &deviceId, int progress, int maxProgress, - const QString &info); - void handleDidTransferApp(IosToolHandler *handler, const FilePath &bundlePath, - const QString &deviceId, IosToolHandler::OpStatus status); - void handleFinished(IosToolHandler *handler); - void handleErrorMsg(IosToolHandler *handler, const QString &msg); void updateDisplayNames(); bool init() final; QWidget *createConfigWidget() final; - IDevice::ConstPtr device() const; IosDevice::ConstPtr iosdevice() const; IosSimulator::ConstPtr iossimulator() const; QString deviceId() const; bool checkProvisioningProfile(); - TransferStatus m_transferStatus = NoTransfer; - IosToolHandler *m_toolHandler = nullptr; IDevice::ConstPtr m_device; FilePath m_bundlePath; IosDeviceType m_deviceType; - bool m_expectFail = false; }; IosDeployStep::IosDeployStep(BuildStepList *parent, Utils::Id id) @@ -167,7 +148,8 @@ void IosDeployStep::updateDisplayNames() bool IosDeployStep::init() { - QTC_ASSERT(m_transferStatus == NoTransfer, return false); + if (!BuildStep::init()) + return false; m_device = DeviceKitAspect::device(kit()); auto runConfig = qobject_cast<const IosRunConfiguration *>( this->target()->activeRunConfiguration()); @@ -186,96 +168,25 @@ bool IosDeployStep::init() return true; } -void IosDeployStep::doRun() +GroupItem IosDeployStep::runRecipe() { - QTC_CHECK(m_transferStatus == NoTransfer); - if (m_device.isNull()) { - TaskHub::addTask( - DeploymentTask(Task::Error, Tr::tr("Deployment failed. No iOS device found."))); - emit finished(!iossimulator().isNull()); - cleanup(); - return; - } - m_toolHandler = new IosToolHandler(m_deviceType, this); - m_transferStatus = TransferInProgress; - emit progress(0, Tr::tr("Transferring application")); - connect(m_toolHandler, &IosToolHandler::isTransferringApp, - this, &IosDeployStep::handleIsTransferringApp); - connect(m_toolHandler, &IosToolHandler::didTransferApp, - this, &IosDeployStep::handleDidTransferApp); - connect(m_toolHandler, &IosToolHandler::finished, - this, &IosDeployStep::handleFinished); - connect(m_toolHandler, &IosToolHandler::errorMsg, - this, &IosDeployStep::handleErrorMsg); - m_expectFail = !checkProvisioningProfile(); - m_toolHandler->requestTransferApp(m_bundlePath, m_deviceType.identifier); -} - -void IosDeployStep::doCancel() -{ - if (m_toolHandler) - m_toolHandler->stop(); -} - -void IosDeployStep::cleanup() -{ - QTC_CHECK(m_transferStatus != TransferInProgress); - m_transferStatus = NoTransfer; - m_device.clear(); - m_toolHandler = nullptr; - m_expectFail = false; -} - -void IosDeployStep::handleIsTransferringApp(IosToolHandler *handler, const FilePath &bundlePath, - const QString &deviceId, int progress, int maxProgress, - const QString &info) -{ - Q_UNUSED(handler); Q_UNUSED(bundlePath); Q_UNUSED(deviceId) - QTC_CHECK(m_transferStatus == TransferInProgress); - emit this->progress(progress * 100 / maxProgress, info); -} - -void IosDeployStep::handleDidTransferApp(IosToolHandler *handler, const FilePath &bundlePath, - const QString &deviceId, IosToolHandler::OpStatus status) -{ - Q_UNUSED(handler); Q_UNUSED(bundlePath); Q_UNUSED(deviceId) - QTC_CHECK(m_transferStatus == TransferInProgress); - if (status == IosToolHandler::Success) { - m_transferStatus = TransferOk; - } else { - m_transferStatus = TransferFailed; - if (!m_expectFail) - TaskHub::addTask(DeploymentTask(Task::Error, - Tr::tr("Deployment failed. The settings in the Devices window of Xcode might be incorrect."))); - } - emit finished(status == IosToolHandler::Success); -} - -void IosDeployStep::handleFinished(IosToolHandler *handler) -{ - switch (m_transferStatus) { - case TransferInProgress: - m_transferStatus = TransferFailed; - TaskHub::addTask(DeploymentTask(Task::Error, Tr::tr("Deployment failed."))); - emit finished(false); - break; - case NoTransfer: - case TransferOk: - case TransferFailed: - break; - } - cleanup(); - handler->deleteLater(); - // move it when result is reported? (would need care to avoid problems with concurrent runs) -} - -void IosDeployStep::handleErrorMsg(IosToolHandler *handler, const QString &msg) -{ - Q_UNUSED(handler) - if (msg.contains(QLatin1String("AMDeviceInstallApplication returned -402653103"))) - TaskHub::addTask(DeploymentTask(Task::Warning, Tr::tr("The Info.plist might be incorrect."))); - - emit addOutput(msg, OutputFormat::ErrorMessage); + const auto onSetup = [this](IosTransfer &transfer) { + if (m_device.isNull()) { + TaskHub::addTask( + DeploymentTask(Task::Error, Tr::tr("Deployment failed. No iOS device found."))); + return SetupResult::StopWithError; + } + transfer.setDeviceType(m_deviceType); + transfer.setBundlePath(m_bundlePath); + transfer.setExpectSuccess(checkProvisioningProfile()); + emit progress(0, Tr::tr("Transferring application")); + connect(&transfer, &IosTransfer::progressValueChanged, this, &IosDeployStep::progress); + connect(&transfer, &IosTransfer::errorMessage, this, [this](const QString &message) { + emit addOutput(message, OutputFormat::ErrorMessage); + }); + return SetupResult::Continue; + }; + return IosTransferTask(onSetup); } QWidget *IosDeployStep::createConfigWidget() From 9be4aeb55a7158c1c0d4a43366a818f08b4fbb70 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Date: Sun, 9 Jul 2023 15:21:04 +0900 Subject: [PATCH 0368/1777] Help: Store and restore size of TopicChooser The default size seems too small to use Change-Id: Ia8284e1e8b97ee7c76dc4d1ce807fec017ff10dd Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../coreplugin/dialogs/settingsdialog.cpp | 8 +++----- src/shared/help/topicchooser.cpp | 17 ++++++++++++++++- src/shared/help/topicchooser.h | 1 + 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index d4ff3250c4d..6970116ea3f 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -765,16 +765,14 @@ bool SettingsDialog::execDialog() m_running = true; m_finished = false; static const QLatin1String kPreferenceDialogSize("Core/PreferenceDialogSize"); - if (ICore::settings()->contains(kPreferenceDialogSize)) - resize(ICore::settings()->value(kPreferenceDialogSize).toSize()); - else - resize(kInitialWidth, kInitialHeight); + const QSize initialSize(kInitialWidth, kInitialHeight); + resize(ICore::settings()->value(kPreferenceDialogSize, initialSize).toSize()); exec(); m_running = false; m_instance = nullptr; ICore::settings()->setValueWithDefault(kPreferenceDialogSize, size(), - QSize(kInitialWidth, kInitialHeight)); + initialSize); // make sure that the current "single" instance is deleted // we can't delete right away, since we still access the m_applied member deleteLater(); diff --git a/src/shared/help/topicchooser.cpp b/src/shared/help/topicchooser.cpp index 93a4bf47be9..43d24cd1364 100644 --- a/src/shared/help/topicchooser.cpp +++ b/src/shared/help/topicchooser.cpp @@ -9,6 +9,8 @@ #include <utils/layoutbuilder.h> #include <utils/utilstr.h> +#include <coreplugin/icore.h> + #include <QMap> #include <QUrl> @@ -18,12 +20,18 @@ #include <QStandardItemModel> #include <QSortFilterProxyModel> +const int kInitialWidth = 400; +const int kInitialHeight = 220; +const char kPreferenceDialogSize[] = "Core/TopicChooserSize"; + TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, const QMultiMap<QString, QUrl> &links) : QDialog(parent) , m_filterModel(new QSortFilterProxyModel(this)) { - resize(400, 220); + const QSize initialSize(kInitialWidth, kInitialHeight); + resize(Core::ICore::settings()->value(kPreferenceDialogSize, initialSize).toSize()); + setWindowTitle(::Help::Tr::tr("Choose Topic")); QStandardItemModel *model = new QStandardItemModel(this); @@ -70,6 +78,13 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, this, &TopicChooser::setFilter); } +TopicChooser::~TopicChooser() +{ + Core::ICore::settings()->setValueWithDefault(kPreferenceDialogSize, + size(), + QSize(kInitialWidth, kInitialHeight)); +} + QUrl TopicChooser::link() const { if (m_activedIndex.isValid()) diff --git a/src/shared/help/topicchooser.h b/src/shared/help/topicchooser.h index 53954cad09f..feca98c85fd 100644 --- a/src/shared/help/topicchooser.h +++ b/src/shared/help/topicchooser.h @@ -24,6 +24,7 @@ class TopicChooser : public QDialog public: TopicChooser(QWidget *parent, const QString &keyword, const QMultiMap<QString, QUrl> &links); + ~TopicChooser() override; QUrl link() const; From e8fd863fcc0f83fd19d96cae713d825d157e1962 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 12:10:20 +0200 Subject: [PATCH 0369/1777] Nim: Convert tool settings to latest style Change-Id: I206b7d10531a9a3053a68eae522896971c9f1423 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/nim/settings/nimsettings.cpp | 32 ++++++++++++++++++++---- src/plugins/nim/settings/nimsettings.h | 6 +++-- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/plugins/nim/settings/nimsettings.cpp b/src/plugins/nim/settings/nimsettings.cpp index fac77109fde..1c404ac8503 100644 --- a/src/plugins/nim/settings/nimsettings.cpp +++ b/src/plugins/nim/settings/nimsettings.cpp @@ -7,6 +7,7 @@ #include "../nimtr.h" #include "nimcodestylepreferencesfactory.h" +#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icore.h> #include <texteditor/codestylepool.h> @@ -24,14 +25,16 @@ namespace Nim { static SimpleCodeStylePreferences *m_globalCodeStyle = nullptr; +NimSettings &settings() +{ + static NimSettings theSettings; + return theSettings; +} + NimSettings::NimSettings() { setSettingsGroups("Nim", "NimSuggest"); - setId(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_ID); - setDisplayName(Tr::tr("Tools")); - setCategory(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_CATEGORY); - setDisplayCategory(Tr::tr("Nim")); - setCategoryIconPath(":/nim/images/settingscategory_nim.png"); + setAutoApply(false); setLayouter([this] { using namespace Layouting; @@ -105,7 +108,26 @@ NimSettings::~NimSettings() SimpleCodeStylePreferences *NimSettings::globalCodeStyle() { + QTC_ASSERT(m_globalCodeStyle, settings()); // Ensure creation return m_globalCodeStyle; } +// NimSettingsPage + +class NimSettingsPage final : public Core::IOptionsPage +{ +public: + NimSettingsPage() + { + setId(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_ID); + setDisplayName(Tr::tr("Tools")); + setCategory(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_CATEGORY); + setDisplayCategory(Tr::tr("Nim")); + setCategoryIconPath(":/nim/images/settingscategory_nim.png"); + setSettingsProvider([] { return &settings(); }); + } +}; + +const NimSettingsPage settingsPage; + } // namespace Nim diff --git a/src/plugins/nim/settings/nimsettings.h b/src/plugins/nim/settings/nimsettings.h index a7c6628b65b..5f0e23b8976 100644 --- a/src/plugins/nim/settings/nimsettings.h +++ b/src/plugins/nim/settings/nimsettings.h @@ -3,13 +3,13 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> namespace TextEditor { class SimpleCodeStylePreferences; } namespace Nim { -class NimSettings : public Core::PagedSettings +class NimSettings final : public Utils::AspectContainer { public: NimSettings(); @@ -20,5 +20,7 @@ public: static TextEditor::SimpleCodeStylePreferences *globalCodeStyle(); }; +NimSettings &settings(); + } // Nim From ef04ff218961fb9c1922f90f38a11cc8c544881a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 15:45:51 +0200 Subject: [PATCH 0370/1777] ProjectExplorer: BuildDirAspect's base fromMap/toMap This was still going to StringAspect, even with the new FilePathAspect base. Operationally it was not different as the FilePathAspect does not do anything else than what the StringAspect was doing. Change-Id: I3dac247acf48d653f77abb228a1765f01da7823b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/buildaspects.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index f0f3d819440..683d712b2a1 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -90,7 +90,7 @@ void BuildDirectoryAspect::setProblem(const QString &description) void BuildDirectoryAspect::toMap(QVariantMap &map) const { - StringAspect::toMap(map); + FilePathAspect::toMap(map); if (!d->sourceDir.isEmpty()) { const FilePath shadowDir = isChecked() ? filePath() : d->savedShadowBuildDir; saveToMap(map, shadowDir.toSettings(), QString(), settingsKey() + ".shadowDir"); @@ -99,7 +99,7 @@ void BuildDirectoryAspect::toMap(QVariantMap &map) const void BuildDirectoryAspect::fromMap(const QVariantMap &map) { - StringAspect::fromMap(map); + FilePathAspect::fromMap(map); if (!d->sourceDir.isEmpty()) { d->savedShadowBuildDir = FilePath::fromSettings(map.value(settingsKey() + ".shadowDir")); if (d->savedShadowBuildDir.isEmpty()) @@ -110,7 +110,7 @@ void BuildDirectoryAspect::fromMap(const QVariantMap &map) void BuildDirectoryAspect::addToLayout(Layouting::LayoutItem &parent) { - StringAspect::addToLayout(parent); + FilePathAspect::addToLayout(parent); d->problemLabel = new InfoLabel({}, InfoLabel::Warning); d->problemLabel->setElideMode(Qt::ElideNone); parent.addItems({Layouting::br, Layouting::empty, d->problemLabel.data()}); From d127336753331afd0b91dd75c39f8930bfff8290 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 18 Jul 2023 09:51:50 +0200 Subject: [PATCH 0371/1777] Fix that aspects read&wrote install settings Do not give them the QSettings object that has SystemScope. Also rename the "globalSettings" term to "installSettings" locally and in PluginManager, and the one for aspects to just "setSettings" (like e.g. for TerminalCommand). Change-Id: Iad051f6e507373042014db73b83d0b16944b7374 Reviewed-by: hjk <hjk@qt.io> --- src/app/main.cpp | 6 +++--- src/libs/extensionsystem/pluginmanager.cpp | 2 +- src/libs/extensionsystem/pluginmanager.h | 2 +- src/libs/utils/aspects.cpp | 2 +- src/libs/utils/aspects.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 540b5125613..f92930d0aa4 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -619,7 +619,7 @@ int main(int argc, char **argv) // Re-setup install settings for real setupInstallSettings(options.installSettingsPath); Utils::QtcSettings *settings = createUserSettings(); - Utils::QtcSettings *globalSettings + Utils::QtcSettings *installSettings = new Utils::QtcSettings(QSettings::IniFormat, QSettings::SystemScope, QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR), @@ -652,10 +652,10 @@ int main(int argc, char **argv) PluginManager pluginManager; PluginManager::setPluginIID(QLatin1String("org.qt-project.Qt.QtCreatorPlugin")); - PluginManager::setGlobalSettings(globalSettings); + PluginManager::setInstallSettings(installSettings); PluginManager::setSettings(settings); - Utils::BaseAspect::setGlobalSettings(globalSettings); + Utils::BaseAspect::setSettings(settings); using namespace Core; Utils::AppInfo info; diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 2da7065314d..c0395115441 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -488,7 +488,7 @@ void PluginManager::setSettings(QtcSettings *settings) default disabled plugins. Needs to be set before the plugin search path is set with setPluginPaths(). */ -void PluginManager::setGlobalSettings(QtcSettings *settings) +void PluginManager::setInstallSettings(QtcSettings *settings) { d->setGlobalSettings(settings); } diff --git a/src/libs/extensionsystem/pluginmanager.h b/src/libs/extensionsystem/pluginmanager.h index ecd0ee70b73..84e3bbc55be 100644 --- a/src/libs/extensionsystem/pluginmanager.h +++ b/src/libs/extensionsystem/pluginmanager.h @@ -83,7 +83,7 @@ public: // Settings static void setSettings(Utils::QtcSettings *settings); static Utils::QtcSettings *settings(); - static void setGlobalSettings(Utils::QtcSettings *settings); + static void setInstallSettings(Utils::QtcSettings *settings); static Utils::QtcSettings *globalSettings(); static void writeSettings(); diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 5a1e214c24f..e4035ca86b5 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -37,7 +37,7 @@ namespace Utils { static QSettings *theSettings = nullptr; -void BaseAspect::setGlobalSettings(QSettings *settings) +void BaseAspect::setSettings(QSettings *settings) { theSettings = settings; } diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index cb596949de5..7c911a0ea58 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -161,7 +161,7 @@ public: Data::Ptr extractData() const; - static void setGlobalSettings(QSettings *settings); + static void setSettings(QSettings *settings); static QSettings *settings(); signals: From bce9b9ffaacc6b355bd4278356a8cd03a3816627 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 13:04:50 +0200 Subject: [PATCH 0372/1777] Nim: Move code style related code to nimcodestylesettingspage.cpp Not necessarily the final setup, but a step closer. The selected style doesn't seem to stick anymore, but that's already the case in 11.x. Change-Id: I6c094c1222147c31456cf843397ffaaae9252a30 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../nim/settings/nimcodestylesettingspage.cpp | 99 ++++++++++++++++++- .../nim/settings/nimcodestylesettingspage.h | 1 + src/plugins/nim/settings/nimsettings.cpp | 68 ------------- src/plugins/nim/settings/nimsettings.h | 5 - 4 files changed, 96 insertions(+), 77 deletions(-) diff --git a/src/plugins/nim/settings/nimcodestylesettingspage.cpp b/src/plugins/nim/settings/nimcodestylesettingspage.cpp index 56919a6c156..32e9525014c 100644 --- a/src/plugins/nim/settings/nimcodestylesettingspage.cpp +++ b/src/plugins/nim/settings/nimcodestylesettingspage.cpp @@ -3,14 +3,19 @@ #include "nimcodestylesettingspage.h" +#include "nimcodestylepreferencesfactory.h" +#include "nimsettings.h" #include "../nimconstants.h" #include "../nimtr.h" -#include "nimsettings.h" -#include <texteditor/simplecodestylepreferences.h> +#include <coreplugin/icore.h> + #include <texteditor/codestyleeditor.h> -#include <texteditor/texteditorsettings.h> +#include <texteditor/codestylepool.h> +#include <texteditor/icodestylepreferencesfactory.h> +#include <texteditor/simplecodestylepreferences.h> #include <texteditor/tabsettings.h> +#include <texteditor/texteditorsettings.h> #include <QVBoxLayout> @@ -18,12 +23,78 @@ using namespace TextEditor; namespace Nim { +static SimpleCodeStylePreferences *m_globalCodeStyle = nullptr; +static CodeStylePool *pool = nullptr; + +SimpleCodeStylePreferences *globalCodeStyle() +{ + QTC_CHECK(m_globalCodeStyle); + return m_globalCodeStyle; +} + +static void createGlobalCodeStyle() +{ + auto factory = new NimCodeStylePreferencesFactory(); + TextEditorSettings::registerCodeStyleFactory(factory); + + // code style pool + pool = new CodeStylePool(factory); + TextEditorSettings::registerCodeStylePool(Nim::Constants::C_NIMLANGUAGE_ID, pool); + + m_globalCodeStyle = new SimpleCodeStylePreferences(); + m_globalCodeStyle->setDelegatingPool(pool); + m_globalCodeStyle->setDisplayName(Tr::tr("Global", "Settings")); + m_globalCodeStyle->setId(Nim::Constants::C_NIMGLOBALCODESTYLE_ID); + pool->addCodeStyle(m_globalCodeStyle); + TextEditorSettings::registerCodeStyle(Nim::Constants::C_NIMLANGUAGE_ID, m_globalCodeStyle); + + auto nimCodeStyle = new SimpleCodeStylePreferences(); + nimCodeStyle->setId("nim"); + nimCodeStyle->setDisplayName(Tr::tr("Nim")); + nimCodeStyle->setReadOnly(true); + + TabSettings nimTabSettings; + nimTabSettings.m_tabPolicy = TabSettings::SpacesOnlyTabPolicy; + nimTabSettings.m_tabSize = 2; + nimTabSettings.m_indentSize = 2; + nimTabSettings.m_continuationAlignBehavior = TabSettings::ContinuationAlignWithIndent; + nimCodeStyle->setTabSettings(nimTabSettings); + + pool->addCodeStyle(nimCodeStyle); + + m_globalCodeStyle->setCurrentDelegate(nimCodeStyle); + + pool->loadCustomCodeStyles(); + + // load global settings (after built-in settings are added to the pool) + QSettings *s = Core::ICore::settings(); + m_globalCodeStyle->fromSettings(QLatin1String(Nim::Constants::C_NIMLANGUAGE_ID), s); + + TextEditorSettings::registerMimeTypeForLanguageId(Nim::Constants::C_NIM_MIMETYPE, + Nim::Constants::C_NIMLANGUAGE_ID); + TextEditorSettings::registerMimeTypeForLanguageId(Nim::Constants::C_NIM_SCRIPT_MIMETYPE, + Nim::Constants::C_NIMLANGUAGE_ID); +} + +static void destroyGlobalCodeStyle() +{ + TextEditorSettings::unregisterCodeStyle(Nim::Constants::C_NIMLANGUAGE_ID); + TextEditorSettings::unregisterCodeStylePool(Nim::Constants::C_NIMLANGUAGE_ID); + TextEditorSettings::unregisterCodeStyleFactory(Nim::Constants::C_NIMLANGUAGE_ID); + + delete m_globalCodeStyle; + m_globalCodeStyle = nullptr; + + delete pool; + pool = nullptr; +} + class NimCodeStyleSettingsWidget : public Core::IOptionsPageWidget { public: NimCodeStyleSettingsWidget() { - auto originalTabPreferences = NimSettings::globalCodeStyle(); + auto originalTabPreferences = globalCodeStyle(); m_nimCodeStylePreferences = new SimpleCodeStylePreferences(this); m_nimCodeStylePreferences->setDelegatingPool(originalTabPreferences->delegatingPool()); m_nimCodeStylePreferences->setTabSettings(originalTabPreferences->tabSettings()); @@ -36,12 +107,25 @@ public: auto layout = new QVBoxLayout(this); layout->addWidget(editor); + + QTC_ASSERT(m_globalCodeStyle, return); + QSettings *s = Core::ICore::settings(); + m_globalCodeStyle->toSettings(QLatin1String(Nim::Constants::C_NIMLANGUAGE_ID), s); + } + + void apply() final + { + QTC_ASSERT(m_globalCodeStyle, return); + QSettings *s = Core::ICore::settings(); + m_globalCodeStyle->toSettings(QLatin1String(Nim::Constants::C_NIMLANGUAGE_ID), s); } private: TextEditor::SimpleCodeStylePreferences *m_nimCodeStylePreferences; }; +// NimCodeStyleSettingsPage + NimCodeStyleSettingsPage::NimCodeStyleSettingsPage() { setId(Nim::Constants::C_NIMCODESTYLESETTINGSPAGE_ID); @@ -50,6 +134,13 @@ NimCodeStyleSettingsPage::NimCodeStyleSettingsPage() setDisplayCategory(Tr::tr("Nim")); setCategoryIconPath(":/nim/images/settingscategory_nim.png"); setWidgetCreator([] { return new NimCodeStyleSettingsWidget; }); + + createGlobalCodeStyle(); +} + +NimCodeStyleSettingsPage::~NimCodeStyleSettingsPage() +{ + destroyGlobalCodeStyle(); } } // Nim diff --git a/src/plugins/nim/settings/nimcodestylesettingspage.h b/src/plugins/nim/settings/nimcodestylesettingspage.h index 173b1eeb7db..f0acc402e98 100644 --- a/src/plugins/nim/settings/nimcodestylesettingspage.h +++ b/src/plugins/nim/settings/nimcodestylesettingspage.h @@ -11,6 +11,7 @@ class NimCodeStyleSettingsPage final : public Core::IOptionsPage { public: NimCodeStyleSettingsPage(); + ~NimCodeStyleSettingsPage(); }; } // Nim diff --git a/src/plugins/nim/settings/nimsettings.cpp b/src/plugins/nim/settings/nimsettings.cpp index 1c404ac8503..9df9acd73bf 100644 --- a/src/plugins/nim/settings/nimsettings.cpp +++ b/src/plugins/nim/settings/nimsettings.cpp @@ -5,26 +5,16 @@ #include "../nimconstants.h" #include "../nimtr.h" -#include "nimcodestylepreferencesfactory.h" #include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icore.h> -#include <texteditor/codestylepool.h> -#include <texteditor/icodestylepreferencesfactory.h> -#include <texteditor/simplecodestylepreferences.h> -#include <texteditor/tabsettings.h> -#include <texteditor/texteditorsettings.h> - #include <utils/layoutbuilder.h> -using namespace TextEditor; using namespace Utils; namespace Nim { -static SimpleCodeStylePreferences *m_globalCodeStyle = nullptr; - NimSettings &settings() { static NimSettings theSettings; @@ -47,48 +37,6 @@ NimSettings::NimSettings() }; }); - // code style factory - auto factory = new NimCodeStylePreferencesFactory(); - TextEditorSettings::registerCodeStyleFactory(factory); - - // code style pool - auto pool = new CodeStylePool(factory, this); - TextEditorSettings::registerCodeStylePool(Nim::Constants::C_NIMLANGUAGE_ID, pool); - - m_globalCodeStyle = new SimpleCodeStylePreferences(); - m_globalCodeStyle->setDelegatingPool(pool); - m_globalCodeStyle->setDisplayName(Tr::tr("Global", "Settings")); - m_globalCodeStyle->setId(Nim::Constants::C_NIMGLOBALCODESTYLE_ID); - pool->addCodeStyle(m_globalCodeStyle); - TextEditorSettings::registerCodeStyle(Nim::Constants::C_NIMLANGUAGE_ID, m_globalCodeStyle); - - auto nimCodeStyle = new SimpleCodeStylePreferences(); - nimCodeStyle->setId("nim"); - nimCodeStyle->setDisplayName(Tr::tr("Nim")); - nimCodeStyle->setReadOnly(true); - - TabSettings nimTabSettings; - nimTabSettings.m_tabPolicy = TabSettings::SpacesOnlyTabPolicy; - nimTabSettings.m_tabSize = 2; - nimTabSettings.m_indentSize = 2; - nimTabSettings.m_continuationAlignBehavior = TabSettings::ContinuationAlignWithIndent; - nimCodeStyle->setTabSettings(nimTabSettings); - - pool->addCodeStyle(nimCodeStyle); - - m_globalCodeStyle->setCurrentDelegate(nimCodeStyle); - - pool->loadCustomCodeStyles(); - - // load global settings (after built-in settings are added to the pool) - QSettings *s = Core::ICore::settings(); - m_globalCodeStyle->fromSettings(QLatin1String(Nim::Constants::C_NIMLANGUAGE_ID), s); - - TextEditorSettings::registerMimeTypeForLanguageId(Nim::Constants::C_NIM_MIMETYPE, - Nim::Constants::C_NIMLANGUAGE_ID); - TextEditorSettings::registerMimeTypeForLanguageId(Nim::Constants::C_NIM_SCRIPT_MIMETYPE, - Nim::Constants::C_NIMLANGUAGE_ID); - nimSuggestPath.setSettingsKey("Command"); nimSuggestPath.setExpectedKind(PathChooser::ExistingCommand); nimSuggestPath.setLabelText(Tr::tr("Path:")); @@ -96,22 +44,6 @@ NimSettings::NimSettings() readSettings(); } -NimSettings::~NimSettings() -{ - TextEditorSettings::unregisterCodeStyle(Nim::Constants::C_NIMLANGUAGE_ID); - TextEditorSettings::unregisterCodeStylePool(Nim::Constants::C_NIMLANGUAGE_ID); - TextEditorSettings::unregisterCodeStyleFactory(Nim::Constants::C_NIMLANGUAGE_ID); - - delete m_globalCodeStyle; - m_globalCodeStyle = nullptr; -} - -SimpleCodeStylePreferences *NimSettings::globalCodeStyle() -{ - QTC_ASSERT(m_globalCodeStyle, settings()); // Ensure creation - return m_globalCodeStyle; -} - // NimSettingsPage class NimSettingsPage final : public Core::IOptionsPage diff --git a/src/plugins/nim/settings/nimsettings.h b/src/plugins/nim/settings/nimsettings.h index 5f0e23b8976..4a105bf628c 100644 --- a/src/plugins/nim/settings/nimsettings.h +++ b/src/plugins/nim/settings/nimsettings.h @@ -5,19 +5,14 @@ #include <utils/aspects.h> -namespace TextEditor { class SimpleCodeStylePreferences; } - namespace Nim { class NimSettings final : public Utils::AspectContainer { public: NimSettings(); - ~NimSettings(); Utils::FilePathAspect nimSuggestPath{this}; - - static TextEditor::SimpleCodeStylePreferences *globalCodeStyle(); }; NimSettings &settings(); From 8e7ac2e59db0f1cfcd1f28dac9f0ddd8ef7384f6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 08:44:12 +0200 Subject: [PATCH 0373/1777] CppCheck: Use new settings pattern Change-Id: Ia2de8e684690ab7bfbdcf7ba417df1f2174433de Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/cppcheck/cppcheckoptions.cpp | 33 +++++++++++++---- src/plugins/cppcheck/cppcheckoptions.h | 11 ++++-- src/plugins/cppcheck/cppcheckplugin.cpp | 10 +++--- src/plugins/cppcheck/cppchecktool.cpp | 45 ++++++++++++------------ src/plugins/cppcheck/cppchecktool.h | 6 ++-- 5 files changed, 64 insertions(+), 41 deletions(-) diff --git a/src/plugins/cppcheck/cppcheckoptions.cpp b/src/plugins/cppcheck/cppcheckoptions.cpp index 214d4b3c229..cf3cdc5c761 100644 --- a/src/plugins/cppcheck/cppcheckoptions.cpp +++ b/src/plugins/cppcheck/cppcheckoptions.cpp @@ -16,6 +16,7 @@ #include <utils/qtcassert.h> #include <utils/variablechooser.h> +#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icore.h> #include <debugger/analyzer/analyzericons.h> @@ -25,14 +26,16 @@ using namespace Utils; namespace Cppcheck::Internal { -CppcheckOptions::CppcheckOptions() +CppcheckSettings &settings() +{ + static CppcheckSettings theSettings; + return theSettings; +} + +CppcheckSettings::CppcheckSettings() { - setId(Constants::OPTIONS_PAGE_ID); - setDisplayName(Tr::tr("Cppcheck")); - setCategory("T.Analyzer"); - setDisplayCategory(::Debugger::Tr::tr("Analyzer")); - setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); setSettingsGroup("Cppcheck"); + setAutoApply(false); binary.setSettingsKey("binary"); binary.setExpectedKind(PathChooser::ExistingCommand); @@ -108,7 +111,7 @@ CppcheckOptions::CppcheckOptions() readSettings(); } -std::function<Layouting::LayoutItem()> CppcheckOptions::layouter() +std::function<Layouting::LayoutItem()> CppcheckSettings::layouter() { return [this] { using namespace Layouting; @@ -136,4 +139,20 @@ std::function<Layouting::LayoutItem()> CppcheckOptions::layouter() }; } +class CppCheckSettingsPage final : public Core::IOptionsPage +{ +public: + CppCheckSettingsPage() + { + setId(Constants::OPTIONS_PAGE_ID); + setDisplayName(Tr::tr("Cppcheck")); + setCategory("T.Analyzer"); + setDisplayCategory(::Debugger::Tr::tr("Analyzer")); + setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); + setSettingsProvider([] { return &settings(); }); + } +}; + +const CppCheckSettingsPage settingsPage; + } // Cppcheck::Internal diff --git a/src/plugins/cppcheck/cppcheckoptions.h b/src/plugins/cppcheck/cppcheckoptions.h index eb3e1c7ddbf..8842b2b65f2 100644 --- a/src/plugins/cppcheck/cppcheckoptions.h +++ b/src/plugins/cppcheck/cppcheckoptions.h @@ -3,14 +3,16 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> + +#include <functional> namespace Cppcheck::Internal { -class CppcheckOptions final : public Core::PagedSettings +class CppcheckSettings final : public Utils::AspectContainer { public: - CppcheckOptions(); + CppcheckSettings(); std::function<Layouting::LayoutItem()> layouter(); @@ -32,4 +34,7 @@ public: Utils::BoolAspect guessArguments{this}; }; +CppcheckSettings &settings(); + + } // Cppcheck::Internal diff --git a/src/plugins/cppcheck/cppcheckplugin.cpp b/src/plugins/cppcheck/cppcheckplugin.cpp index b025762c8c6..33f6e3b7863 100644 --- a/src/plugins/cppcheck/cppcheckplugin.cpp +++ b/src/plugins/cppcheck/cppcheckplugin.cpp @@ -5,6 +5,7 @@ #include "cppcheckconstants.h" #include "cppcheckdiagnosticview.h" +#include "cppcheckoptions.h" #include "cppchecktextmarkmanager.h" #include "cppchecktool.h" #include "cppchecktr.h" @@ -39,11 +40,10 @@ public: explicit CppcheckPluginPrivate(); CppcheckTextMarkManager marks; - CppcheckOptions options; - CppcheckTool tool{options, marks, Constants::CHECK_PROGRESS_ID}; + CppcheckTool tool{marks, Constants::CHECK_PROGRESS_ID}; CppcheckTrigger trigger{marks, tool}; DiagnosticsModel manualRunModel; - CppcheckTool manualRunTool{options, manualRunModel, Constants::MANUAL_CHECK_PROGRESS_ID}; + CppcheckTool manualRunTool{manualRunModel, Constants::MANUAL_CHECK_PROGRESS_ID}; Utils::Perspective perspective{Constants::PERSPECTIVE_ID, ::Cppcheck::Tr::tr("Cppcheck")}; QAction *manualRunAction; @@ -55,7 +55,7 @@ public: CppcheckPluginPrivate::CppcheckPluginPrivate() { tool.updateOptions(); - connect(&options, &AspectContainer::changed, [this] { + connect(&settings(), &AspectContainer::changed, [this] { tool.updateOptions(); trigger.recheck(); }); @@ -112,7 +112,7 @@ void CppcheckPluginPrivate::startManualRun() manualRunTool.updateOptions(); - auto optionsWidget = options.layouter()().emerge(); + auto optionsWidget = settings().layouter()().emerge(); ManualRunDialog dialog(optionsWidget, project); if (dialog.exec() == ManualRunDialog::Rejected) diff --git a/src/plugins/cppcheck/cppchecktool.cpp b/src/plugins/cppcheck/cppchecktool.cpp index 79e5a3e5b6e..bed43a98107 100644 --- a/src/plugins/cppcheck/cppchecktool.cpp +++ b/src/plugins/cppcheck/cppchecktool.cpp @@ -26,8 +26,7 @@ using namespace Utils; namespace Cppcheck::Internal { -CppcheckTool::CppcheckTool(CppcheckOptions &options, CppcheckDiagnosticManager &manager, const Id &progressId) : - m_options(options), +CppcheckTool::CppcheckTool(CppcheckDiagnosticManager &manager, const Id &progressId) : m_manager(manager), m_progressRegexp("^.* checked (\\d+)% done$"), m_messageRegexp("^(.+),(\\d+),(\\w+),(\\w+),(.*)$"), @@ -43,7 +42,7 @@ CppcheckTool::~CppcheckTool() = default; void CppcheckTool::updateOptions() { m_filters.clear(); - for (const QString &pattern : m_options.ignoredPatterns().split(',')) { + for (const QString &pattern : settings().ignoredPatterns().split(',')) { const QString trimmedPattern = pattern.trimmed(); if (trimmedPattern.isEmpty()) continue; @@ -69,45 +68,47 @@ void CppcheckTool::updateArguments() m_cachedAdditionalArguments.clear(); + CppcheckSettings &s = settings(); + QStringList arguments; - if (!m_options.customArguments().isEmpty()) { + if (!s.customArguments().isEmpty()) { Utils::MacroExpander *expander = Utils::globalMacroExpander(); - const QString expanded = expander->expand(m_options.customArguments()); + const QString expanded = expander->expand(s.customArguments()); arguments.push_back(expanded); } - if (m_options.warning()) + if (s.warning()) arguments.push_back("--enable=warning"); - if (m_options.style()) + if (s.style()) arguments.push_back("--enable=style"); - if (m_options.performance()) + if (s.performance()) arguments.push_back("--enable=performance"); - if (m_options.portability()) + if (s.portability()) arguments.push_back("--enable=portability"); - if (m_options.information()) + if (s.information()) arguments.push_back("--enable=information"); - if (m_options.unusedFunction()) + if (s.unusedFunction()) arguments.push_back("--enable=unusedFunction"); - if (m_options.missingInclude()) + if (s.missingInclude()) arguments.push_back("--enable=missingInclude"); - if (m_options.inconclusive()) + if (s.inconclusive()) arguments.push_back("--inconclusive"); - if (m_options.forceDefines()) + if (s.forceDefines()) arguments.push_back("--force"); - if (!m_options.unusedFunction() && !m_options.customArguments().contains("-j ")) + if (!s.unusedFunction() && !s.customArguments().contains("-j ")) arguments.push_back("-j " + QString::number(QThread::idealThreadCount())); arguments.push_back("--template=\"{file},{line},{severity},{id},{message}\""); - m_runner->reconfigure(m_options.binary(), arguments.join(' ')); + m_runner->reconfigure(s.binary(), arguments.join(' ')); } QStringList CppcheckTool::additionalArguments(const CppEditor::ProjectPart &part) const { QStringList result; - if (m_options.addIncludePaths()) { + if (settings().addIncludePaths()) { for (const ProjectExplorer::HeaderPath &path : part.headerPaths) { const QString projectDir = m_project->projectDirectory().toString(); if (path.type == ProjectExplorer::HeaderPathType::User @@ -116,7 +117,7 @@ QStringList CppcheckTool::additionalArguments(const CppEditor::ProjectPart &part } } - if (!m_options.guessArguments()) + if (!settings().guessArguments()) return result; using Version = Utils::LanguageVersion; @@ -221,7 +222,7 @@ void CppcheckTool::stop(const Utils::FilePaths &files) void CppcheckTool::startParsing() { - if (m_options.showOutput()) { + if (settings().showOutput()) { const QString message = Tr::tr("Cppcheck started: \"%1\".").arg(m_runner->currentCommand()); Core::MessageManager::writeSilently(message); } @@ -240,7 +241,7 @@ void CppcheckTool::parseOutputLine(const QString &line) if (line.isEmpty()) return; - if (m_options.showOutput()) + if (settings().showOutput()) Core::MessageManager::writeSilently(line); enum Matches { Percentage = 1 }; @@ -271,7 +272,7 @@ void CppcheckTool::parseErrorLine(const QString &line) if (line.isEmpty()) return; - if (m_options.showOutput()) + if (settings().showOutput()) Core::MessageManager::writeSilently(line); enum Matches { File = 1, Line, Severity, Id, Message }; @@ -296,7 +297,7 @@ void CppcheckTool::parseErrorLine(const QString &line) void CppcheckTool::finishParsing() { - if (m_options.showOutput()) + if (settings().showOutput()) Core::MessageManager::writeSilently(Tr::tr("Cppcheck finished.")); QTC_ASSERT(m_progress, return); diff --git a/src/plugins/cppcheck/cppchecktool.h b/src/plugins/cppcheck/cppchecktool.h index 4dc6699e336..d14485fd5e8 100644 --- a/src/plugins/cppcheck/cppchecktool.h +++ b/src/plugins/cppcheck/cppchecktool.h @@ -3,7 +3,7 @@ #pragma once -#include <cppcheck/cppcheckoptions.h> +#include <utils/id.h> #include <QFutureInterface> #include <QPointer> @@ -24,14 +24,13 @@ namespace Cppcheck::Internal { class CppcheckRunner; class CppcheckDiagnosticManager; -class CppcheckOptions; class CppcheckTool final : public QObject { Q_OBJECT public: - CppcheckTool(CppcheckOptions &options, CppcheckDiagnosticManager &manager, const Utils::Id &progressId); + CppcheckTool(CppcheckDiagnosticManager &manager, const Utils::Id &progressId); ~CppcheckTool() override; void updateOptions(); @@ -49,7 +48,6 @@ private: void addToQueue(const Utils::FilePaths &files, const CppEditor::ProjectPart &part); QStringList additionalArguments(const CppEditor::ProjectPart &part) const; - CppcheckOptions &m_options; CppcheckDiagnosticManager &m_manager; QPointer<ProjectExplorer::Project> m_project; std::unique_ptr<CppcheckRunner> m_runner; From ee3658904aba7a107a01150a7d6e2c2849060cbe Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sun, 4 Jun 2023 22:20:26 +0200 Subject: [PATCH 0374/1777] FileExtractor: Replace the usage of Archive with Unarchiver Keep a pointer to the unarchiver inside the FileExtractor in order to not to leak it on FileExtractor destruction. Change-Id: I517bfb5997612db36e7ca8e61709b022caf5dc09 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> --- .../qmldesigner/utils/fileextractor.cpp | 20 +++++++++++-------- src/plugins/qmldesigner/utils/fileextractor.h | 3 +++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/plugins/qmldesigner/utils/fileextractor.cpp b/src/plugins/qmldesigner/utils/fileextractor.cpp index cb9f35fdd74..bbea7edc2cb 100644 --- a/src/plugins/qmldesigner/utils/fileextractor.cpp +++ b/src/plugins/qmldesigner/utils/fileextractor.cpp @@ -217,8 +217,12 @@ void FileExtractor::extract() targetDir.mkdir(m_targetFolder); } - Archive *archive = new Archive(m_sourceFile, m_targetPath); - QTC_ASSERT(archive->isValid(), delete archive; return); + const auto sourceAndCommand = Unarchiver::sourceAndCommand(m_sourceFile); + QTC_ASSERT(sourceAndCommand, return); + + m_unarchiver.reset(new Unarchiver); + m_unarchiver->setSourceAndCommand(*sourceAndCommand); + m_unarchiver->setDestDir(m_targetPath); m_timer.start(); m_bytesBefore = QStorageInfo(m_targetPath.toFileInfo().dir()).bytesAvailable(); @@ -226,14 +230,14 @@ void FileExtractor::extract() if (m_compressedSize <= 0) qWarning() << "Compressed size for file '" << m_sourceFile << "' is zero or invalid: " << m_compressedSize; - QObject::connect(archive, &Archive::outputReceived, this, [this](const QString &output) { + connect(m_unarchiver.get(), &Unarchiver::outputReceived, this, [this](const QString &output) { m_detailedText += output; emit detailedTextChanged(); }); - QObject::connect(archive, &Archive::finished, this, [this, archive](bool ret) { - archive->deleteLater(); - m_finished = ret; + QObject::connect(m_unarchiver.get(), &Unarchiver::done, this, [this](bool success) { + m_unarchiver.release()->deleteLater(); + m_finished = success; m_timer.stop(); m_progress = 100; @@ -241,9 +245,9 @@ void FileExtractor::extract() emit targetFolderExistsChanged(); emit finishedChanged(); - QTC_CHECK(ret); + QTC_CHECK(success); }); - archive->unarchive(); + m_unarchiver->start(); } } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/utils/fileextractor.h b/src/plugins/qmldesigner/utils/fileextractor.h index 5dbf12e903a..c02237fab4f 100644 --- a/src/plugins/qmldesigner/utils/fileextractor.h +++ b/src/plugins/qmldesigner/utils/fileextractor.h @@ -8,6 +8,8 @@ #include <utils/filepath.h> +namespace Utils { class Unarchiver; } + namespace QmlDesigner { class FileExtractor : public QObject @@ -87,6 +89,7 @@ private: qint64 m_bytesBefore = 0; qint64 m_compressedSize = 0; + std::unique_ptr<Utils::Unarchiver> m_unarchiver; }; } // QmlDesigner From b779223bb3b7354ec9f76244a53a0fd621c5994d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 11:35:51 +0200 Subject: [PATCH 0375/1777] Nim: Remove Q_OBJECT from NimCompletionAssistProcessor Not really used. Change-Id: Ide97d5d60fcf3b4e6efa93a089028d8293b02dde Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/nim/editor/nimcompletionassistprovider.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/plugins/nim/editor/nimcompletionassistprovider.cpp b/src/plugins/nim/editor/nimcompletionassistprovider.cpp index f732c45d173..fc0ddc26712 100644 --- a/src/plugins/nim/editor/nimcompletionassistprovider.cpp +++ b/src/plugins/nim/editor/nimcompletionassistprovider.cpp @@ -40,8 +40,6 @@ bool isActivationChar(QChar c) class NimCompletionAssistProcessor : public QObject, public TextEditor::IAssistProcessor { - Q_OBJECT - public: TextEditor::IAssistProposal *perform() final { @@ -249,5 +247,3 @@ bool NimCompletionAssistProvider::isActivationCharSequence(const QString &sequen } } - -#include "nimcompletionassistprovider.moc" From 814fabfe4b808ed68505abb25d78c12bff2c7bb1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 09:06:36 +0200 Subject: [PATCH 0376/1777] CppCheck: Rename options to settings That's the by far more common name nowadays. Change-Id: Iae987221f9fa2e955fdee21496f895d25d44be4e Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/cppcheck/CMakeLists.txt | 2 +- src/plugins/cppcheck/cppcheck.qbs | 4 ++-- src/plugins/cppcheck/cppcheckmanualrundialog.cpp | 2 +- src/plugins/cppcheck/cppcheckplugin.cpp | 2 +- .../cppcheck/{cppcheckoptions.cpp => cppchecksettings.cpp} | 2 +- .../cppcheck/{cppcheckoptions.h => cppchecksettings.h} | 0 src/plugins/cppcheck/cppchecktool.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) rename src/plugins/cppcheck/{cppcheckoptions.cpp => cppchecksettings.cpp} (99%) rename src/plugins/cppcheck/{cppcheckoptions.h => cppchecksettings.h} (100%) diff --git a/src/plugins/cppcheck/CMakeLists.txt b/src/plugins/cppcheck/CMakeLists.txt index 6cd06dc9c67..fb1aea634cc 100644 --- a/src/plugins/cppcheck/CMakeLists.txt +++ b/src/plugins/cppcheck/CMakeLists.txt @@ -8,9 +8,9 @@ add_qtc_plugin(Cppcheck cppcheckdiagnosticsmodel.cpp cppcheckdiagnosticsmodel.h cppcheckdiagnosticview.cpp cppcheckdiagnosticview.h cppcheckmanualrundialog.cpp cppcheckmanualrundialog.h - cppcheckoptions.cpp cppcheckoptions.h cppcheckplugin.cpp cppcheckplugin.h cppcheckrunner.cpp cppcheckrunner.h + cppchecksettings.cpp cppchecksettings.h cppchecktextmark.cpp cppchecktextmark.h cppchecktextmarkmanager.cpp cppchecktextmarkmanager.h cppchecktool.cpp cppchecktool.h diff --git a/src/plugins/cppcheck/cppcheck.qbs b/src/plugins/cppcheck/cppcheck.qbs index e7b5f185baa..f1a8026fedb 100644 --- a/src/plugins/cppcheck/cppcheck.qbs +++ b/src/plugins/cppcheck/cppcheck.qbs @@ -23,12 +23,12 @@ QtcPlugin { "cppcheckdiagnosticview.h", "cppcheckmanualrundialog.cpp", "cppcheckmanualrundialog.h", - "cppcheckoptions.cpp", - "cppcheckoptions.h", "cppcheckplugin.cpp", "cppcheckplugin.h", "cppcheckrunner.cpp", "cppcheckrunner.h", + "cppchecksettings.cpp", + "cppchecksettings.h", "cppchecktextmark.cpp", "cppchecktextmark.h", "cppchecktextmarkmanager.cpp", diff --git a/src/plugins/cppcheck/cppcheckmanualrundialog.cpp b/src/plugins/cppcheck/cppcheckmanualrundialog.cpp index 060f888cc25..d38a424b6b1 100644 --- a/src/plugins/cppcheck/cppcheckmanualrundialog.cpp +++ b/src/plugins/cppcheck/cppcheckmanualrundialog.cpp @@ -3,7 +3,7 @@ #include "cppcheckmanualrundialog.h" -#include "cppcheckoptions.h" +#include "cppchecksettings.h" #include "cppchecktr.h" #include <projectexplorer/selectablefilesmodel.h> diff --git a/src/plugins/cppcheck/cppcheckplugin.cpp b/src/plugins/cppcheck/cppcheckplugin.cpp index 33f6e3b7863..f8096350293 100644 --- a/src/plugins/cppcheck/cppcheckplugin.cpp +++ b/src/plugins/cppcheck/cppcheckplugin.cpp @@ -5,7 +5,7 @@ #include "cppcheckconstants.h" #include "cppcheckdiagnosticview.h" -#include "cppcheckoptions.h" +#include "cppchecksettings.h" #include "cppchecktextmarkmanager.h" #include "cppchecktool.h" #include "cppchecktr.h" diff --git a/src/plugins/cppcheck/cppcheckoptions.cpp b/src/plugins/cppcheck/cppchecksettings.cpp similarity index 99% rename from src/plugins/cppcheck/cppcheckoptions.cpp rename to src/plugins/cppcheck/cppchecksettings.cpp index cf3cdc5c761..926a8f9813b 100644 --- a/src/plugins/cppcheck/cppcheckoptions.cpp +++ b/src/plugins/cppcheck/cppchecksettings.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2018 Sergey Morozov // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "cppcheckoptions.h" +#include "cppchecksettings.h" #include "cppcheckconstants.h" #include "cppchecktool.h" diff --git a/src/plugins/cppcheck/cppcheckoptions.h b/src/plugins/cppcheck/cppchecksettings.h similarity index 100% rename from src/plugins/cppcheck/cppcheckoptions.h rename to src/plugins/cppcheck/cppchecksettings.h diff --git a/src/plugins/cppcheck/cppchecktool.cpp b/src/plugins/cppcheck/cppchecktool.cpp index bed43a98107..5bfcf941a3f 100644 --- a/src/plugins/cppcheck/cppchecktool.cpp +++ b/src/plugins/cppcheck/cppchecktool.cpp @@ -4,8 +4,8 @@ #include "cppchecktool.h" #include "cppcheckdiagnostic.h" -#include "cppcheckoptions.h" #include "cppcheckrunner.h" +#include "cppchecksettings.h" #include "cppchecktextmarkmanager.h" #include "cppchecktr.h" From 9338f7a4d774d76e9fe2266b8739bc4759d09d5f Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 17 Jul 2023 14:28:30 +0200 Subject: [PATCH 0377/1777] Utils: Fix visibility handling for aspects Otherwise we may fail to hide widgets of aspects that are explicitly set invisible while construction. Change-Id: I2679c8fa22e79e4eb32ca5ae4266010d8cf9387d Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index e4035ca86b5..f4226eeac57 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -209,7 +209,7 @@ void BaseAspect::setVisible(bool visible) // This may happen during layout building. Explicit setting visibility here // may create a show a toplevel widget for a moment until it is parented // to some non-shown widget. - if (w->parentWidget()) + if (!visible || w->parentWidget()) w->setVisible(visible); } } From 1042323e8ca2c827277dba090baacf45c6d3368a Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 18 Jul 2023 13:39:39 +0200 Subject: [PATCH 0378/1777] RunControl: Check autoDelete state on finish Amends a5ecc6207bdc657cc323119114d25e21372d42cd Change-Id: I0a762fb41e00416f295f9d71cc23091799359f07 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/runcontrol.cpp | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index f046764617c..f0d4a7fe3b0 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -309,6 +309,7 @@ public: bool supportsReRunning() const; bool isUsingTaskTree() const { return bool(m_runRecipe); } void startTaskTree(); + void checkAutoDeleteAndEmitStopped(); RunControl *q; Id runMode; @@ -445,7 +446,7 @@ void RunControl::initiateStop() { if (d->isUsingTaskTree()) { d->m_taskTree.reset(); - emit stopped(); + d->checkAutoDeleteAndEmitStopped(); } else { d->initiateStop(); } @@ -1052,13 +1053,24 @@ void RunControlPrivate::startTaskTree() connect(m_taskTree.get(), &TaskTree::started, q, &RunControl::started); const auto finalize = [this] { m_taskTree.release()->deleteLater(); - emit q->stopped(); + checkAutoDeleteAndEmitStopped(); }; connect(m_taskTree.get(), &TaskTree::done, this, finalize); connect(m_taskTree.get(), &TaskTree::errorOccurred, this, finalize); m_taskTree->start(); } +void RunControlPrivate::checkAutoDeleteAndEmitStopped() +{ + if (autoDelete) { + debugMessage("All finished. Deleting myself"); + q->deleteLater(); + } else { + q->setApplicationProcessHandle(Utils::ProcessHandle()); + } + emit q->stopped(); +} + bool RunControl::isRunning() const { if (d->isUsingTaskTree()) @@ -1160,13 +1172,7 @@ void RunControlPrivate::setState(RunControlState newState) emit q->started(); break; case RunControlState::Stopped: - if (autoDelete) { - debugMessage("All finished. Deleting myself"); - q->deleteLater(); - } else { - q->setApplicationProcessHandle(Utils::ProcessHandle()); - } - emit q->stopped(); + checkAutoDeleteAndEmitStopped(); break; default: break; From 89a64a19e8006c66fd6c596b09770a1061d335fb Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 12:14:21 +0200 Subject: [PATCH 0379/1777] VcsBase: Contruct CommonSettings on first access Change-Id: Ifa425e2f1952017769accd855e33d1fa53b7b6c9 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/vcsbase/commonvcssettings.cpp | 34 +++++++++++++++-------- src/plugins/vcsbase/commonvcssettings.h | 5 ++-- src/plugins/vcsbase/vcsplugin.cpp | 5 ++-- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/plugins/vcsbase/commonvcssettings.cpp b/src/plugins/vcsbase/commonvcssettings.cpp index faa119697b1..d4e4beb149c 100644 --- a/src/plugins/vcsbase/commonvcssettings.cpp +++ b/src/plugins/vcsbase/commonvcssettings.cpp @@ -6,6 +6,7 @@ #include "vcsbaseconstants.h" #include "vcsbasetr.h" +#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/vcsmanager.h> #include <utils/environment.h> @@ -28,24 +29,16 @@ static QString sshPasswordPromptDefault() return QLatin1String("ssh-askpass"); } -static CommonVcsSettings *s_instance; - CommonVcsSettings &commonSettings() { - return *s_instance; + static CommonVcsSettings settings; + return settings; } CommonVcsSettings::CommonVcsSettings() { - s_instance = this; - + setAutoApply(false); setSettingsGroup("VCS"); - setId(Constants::VCS_COMMON_SETTINGS_ID); - setDisplayName(Tr::tr("General")); - setCategory(Constants::VCS_SETTINGS_CATEGORY); - // The following act as blueprint for other pages in the same category: - setDisplayCategory(Tr::tr("Version Control")); - setCategoryIconPath(":/vcsbase/images/settingscategory_vcs.png"); nickNameMailMap.setSettingsKey("NickNameMailMap"); nickNameMailMap.setExpectedKind(PathChooser::File); @@ -118,4 +111,23 @@ CommonVcsSettings::CommonVcsSettings() readSettings(); } +// CommonVcsSettingsPage + +class CommonVcsSettingsPage final : public Core::IOptionsPage +{ +public: + CommonVcsSettingsPage() + { + setId(Constants::VCS_COMMON_SETTINGS_ID); + setDisplayName(Tr::tr("General")); + setCategory(Constants::VCS_SETTINGS_CATEGORY); + // The following act as blueprint for other pages in the same category: + setDisplayCategory(Tr::tr("Version Control")); + setCategoryIconPath(":/vcsbase/images/settingscategory_vcs.png"); + setSettingsProvider([] { return &commonSettings(); }); + } +}; + +const CommonVcsSettingsPage settingsPage; + } // VcsBase::Internal diff --git a/src/plugins/vcsbase/commonvcssettings.h b/src/plugins/vcsbase/commonvcssettings.h index 0f591b27111..ced68d31b97 100644 --- a/src/plugins/vcsbase/commonvcssettings.h +++ b/src/plugins/vcsbase/commonvcssettings.h @@ -3,12 +3,11 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> -#include <coreplugin/iversioncontrol.h> +#include <utils/aspects.h> namespace VcsBase::Internal { -class CommonVcsSettings : public Core::PagedSettings +class CommonVcsSettings final : public Utils::AspectContainer { public: CommonVcsSettings(); diff --git a/src/plugins/vcsbase/vcsplugin.cpp b/src/plugins/vcsbase/vcsplugin.cpp index c61c8e0bec0..c622fbf45ef 100644 --- a/src/plugins/vcsbase/vcsplugin.cpp +++ b/src/plugins/vcsbase/vcsplugin.cpp @@ -40,7 +40,7 @@ public: explicit VcsPluginPrivate(VcsPlugin *plugin) : q(plugin) { - QObject::connect(&m_settings, &AspectContainer::changed, + QObject::connect(&commonSettings(), &AspectContainer::changed, [this] { slotSettingsChanged(); }); slotSettingsChanged(); } @@ -57,7 +57,7 @@ public: void populateNickNameModel() { QString errorMessage; - if (!NickNameDialog::populateModelFromMailCapFile(m_settings.nickNameMailMap(), + if (!NickNameDialog::populateModelFromMailCapFile(commonSettings().nickNameMailMap(), m_nickNameModel, &errorMessage)) { qWarning("%s", qPrintable(errorMessage)); @@ -71,7 +71,6 @@ public: } VcsPlugin *q; - CommonVcsSettings m_settings; QStandardItemModel *m_nickNameModel = nullptr; }; From 9a69c78ca5d5aab675188d04182e8352e0f8c968 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 12:57:17 +0200 Subject: [PATCH 0380/1777] Vcs: Convert settings pages to latest style Last change in that area for this year. Change-Id: Ibae9f1869cb20faf85c0c1669b84751ad022b8fd Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/bazaar/bazaarplugin.cpp | 1 - src/plugins/bazaar/bazaarsettings.cpp | 28 +++++++++++++----- src/plugins/cvs/cvsplugin.cpp | 1 - src/plugins/cvs/cvssettings.cpp | 28 +++++++++++++----- src/plugins/fossil/fossilplugin.cpp | 1 - src/plugins/fossil/fossilsettings.cpp | 28 +++++++++++++----- src/plugins/fossil/fossilsettings.h | 2 +- src/plugins/git/gitplugin.cpp | 1 - src/plugins/git/gitsettings.cpp | 29 ++++++++++++++----- src/plugins/git/gitsettings.h | 2 +- src/plugins/mercurial/mercurialplugin.cpp | 1 - src/plugins/mercurial/mercurialsettings.cpp | 29 ++++++++++++++----- src/plugins/mercurial/mercurialsettings.h | 2 +- src/plugins/subversion/subversionplugin.cpp | 1 - src/plugins/subversion/subversionsettings.cpp | 28 +++++++++++++----- src/plugins/subversion/subversionsettings.h | 2 +- src/plugins/vcsbase/vcsbaseclientsettings.h | 4 +-- 17 files changed, 128 insertions(+), 60 deletions(-) diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index 542c2ef7066..8a9268748dd 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -215,7 +215,6 @@ public: void createRepositoryActions(const Core::Context &context); // Variables - BazaarSettings m_setting; BazaarClient m_client; VcsSubmitEditorFactory m_submitEditorFactory { diff --git a/src/plugins/bazaar/bazaarsettings.cpp b/src/plugins/bazaar/bazaarsettings.cpp index dc6ef77dd48..090d5209fa3 100644 --- a/src/plugins/bazaar/bazaarsettings.cpp +++ b/src/plugins/bazaar/bazaarsettings.cpp @@ -6,6 +6,7 @@ #include "bazaartr.h" #include "constants.h" +#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icore.h> #include <utils/layoutbuilder.h> @@ -16,21 +17,16 @@ using namespace Utils; namespace Bazaar::Internal { -static BazaarSettings *theSettings; - BazaarSettings &settings() { - return *theSettings; + static BazaarSettings theSettings; + return theSettings; } BazaarSettings::BazaarSettings() { - theSettings = this; - + setAutoApply(false); setSettingsGroup(Constants::BAZAAR); - setId(VcsBase::Constants::VCS_ID_BAZAAR); - setDisplayName(Tr::tr("Bazaar")); - setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); binaryPath.setExpectedKind(PathChooser::ExistingCommand); binaryPath.setDefaultValue(Constants::BAZAARDEFAULT); @@ -92,4 +88,20 @@ BazaarSettings::BazaarSettings() }); } +// BazaarSettingsPage + +class BazaarSettingsPage final : public Core::IOptionsPage +{ +public: + BazaarSettingsPage() + { + setId(VcsBase::Constants::VCS_ID_BAZAAR); + setDisplayName(Tr::tr("Bazaar")); + setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); + setSettingsProvider([] { return &settings(); }); + } +}; + +const BazaarSettingsPage settingsPage; + } // Bazaar::Internal diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index d9980328fc9..47d1256528c 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -288,7 +288,6 @@ private: bool commit(const QString &messageFile, const QStringList &subVersionFileList); void cleanCommitMessageFile(); - CvsSettings m_setting; CvsClient *m_client = nullptr; QString m_commitMessageFileName; diff --git a/src/plugins/cvs/cvssettings.cpp b/src/plugins/cvs/cvssettings.cpp index 9e1523486fa..775a393df3e 100644 --- a/src/plugins/cvs/cvssettings.cpp +++ b/src/plugins/cvs/cvssettings.cpp @@ -5,6 +5,7 @@ #include "cvstr.h" +#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icore.h> #include <utils/hostosinfo.h> @@ -17,22 +18,17 @@ using namespace Utils; namespace Cvs::Internal { -static CvsSettings *theSettings; - CvsSettings &settings() { - return *theSettings; + static CvsSettings theSettings; + return theSettings; } CvsSettings::CvsSettings() { - theSettings = this; + setAutoApply(false); setSettingsGroup("CVS"); - setId(VcsBase::Constants::VCS_ID_CVS); - setDisplayName(Tr::tr("CVS")); - setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); - binaryPath.setDefaultValue("cvs" QTC_HOST_EXE_SUFFIX); binaryPath.setExpectedKind(PathChooser::ExistingCommand); binaryPath.setHistoryCompleter(QLatin1String("Cvs.Command.History")); @@ -97,4 +93,20 @@ QStringList CvsSettings::addOptions(const QStringList &args) const return rc; } +// CvsSettingsPage + +class CvsSettingsPage final : Core::IOptionsPage +{ +public: + CvsSettingsPage() + { + setId(VcsBase::Constants::VCS_ID_CVS); + setDisplayName(Tr::tr("CVS")); + setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); + setSettingsProvider([] { return &settings(); }); + } +}; + +const CvsSettingsPage settingsPage; + } // Cvs::Internal diff --git a/src/plugins/fossil/fossilplugin.cpp b/src/plugins/fossil/fossilplugin.cpp index 1f6f7d93064..6706e8e851d 100644 --- a/src/plugins/fossil/fossilplugin.cpp +++ b/src/plugins/fossil/fossilplugin.cpp @@ -187,7 +187,6 @@ public: bool pullOrPush(SyncMode mode); // Variables - FossilSettings m_settings; FossilClient m_client; VcsSubmitEditorFactory submitEditorFactory { diff --git a/src/plugins/fossil/fossilsettings.cpp b/src/plugins/fossil/fossilsettings.cpp index 0662445b131..1a2960a0e5c 100644 --- a/src/plugins/fossil/fossilsettings.cpp +++ b/src/plugins/fossil/fossilsettings.cpp @@ -6,6 +6,7 @@ #include "constants.h" #include "fossiltr.h" +#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icore.h> #include <utils/layoutbuilder.h> @@ -17,21 +18,16 @@ using namespace Utils; namespace Fossil::Internal { -static FossilSettings *theSettings; - FossilSettings &settings() { - return *theSettings; + static FossilSettings theSettings; + return theSettings; } FossilSettings::FossilSettings() { - theSettings = this; - + setAutoApply(false); setSettingsGroup(Constants::FOSSIL); - setId(Constants::VCS_ID_FOSSIL); - setDisplayName(Tr::tr("Fossil")); - setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); binaryPath.setExpectedKind(PathChooser::ExistingCommand); binaryPath.setDefaultValue(Constants::FOSSILDEFAULT); @@ -121,4 +117,20 @@ FossilSettings::FossilSettings() }); } +// FossilSettingsPage + +class FossilSettingsPage final : public Core::IOptionsPage +{ +public: + FossilSettingsPage() + { + setId(Constants::VCS_ID_FOSSIL); + setDisplayName(Tr::tr("Fossil")); + setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); + setSettingsProvider([] { return &settings(); }); + } +}; + +const FossilSettingsPage settingsPage; + } // Fossil::Internal diff --git a/src/plugins/fossil/fossilsettings.h b/src/plugins/fossil/fossilsettings.h index 8e56b1985cc..f1b9b3f52b8 100644 --- a/src/plugins/fossil/fossilsettings.h +++ b/src/plugins/fossil/fossilsettings.h @@ -7,7 +7,7 @@ namespace Fossil::Internal { -class FossilSettings : public VcsBase::VcsBaseSettings +class FossilSettings final : public VcsBase::VcsBaseSettings { public: FossilSettings(); diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 223cecf0b69..6fa194adfbe 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -399,7 +399,6 @@ public: void onApplySettings(); - GitSettings setting; CommandLocator *m_commandLocator = nullptr; QAction *m_menuAction = nullptr; diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index 6317ff1837e..f10dd3d9638 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -5,6 +5,8 @@ #include "gittr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/environment.h> #include <utils/layoutbuilder.h> @@ -17,20 +19,15 @@ using namespace VcsBase; namespace Git::Internal { -static GitSettings *theSettings; - GitSettings &settings() { - return *theSettings; + static GitSettings theSettings; + return theSettings; } GitSettings::GitSettings() { - theSettings = this; - - setId(VcsBase::Constants::VCS_ID_GIT); - setDisplayName(Tr::tr("Git")); - setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); + setAutoApply(false); setSettingsGroup("Git"); path.setDisplayStyle(StringAspect::LineEditDisplay); @@ -175,4 +172,20 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const return resolvedBinPath; } +// GitSettingsPage + +class GitSettingsPage final : public Core::IOptionsPage +{ +public: + GitSettingsPage() + { + setId(VcsBase::Constants::VCS_ID_GIT); + setDisplayName(Tr::tr("Git")); + setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); + setSettingsProvider([] { return &settings(); }); + } +}; + +const GitSettingsPage settingsPage; + } // Git::Internal diff --git a/src/plugins/git/gitsettings.h b/src/plugins/git/gitsettings.h index df6cf56e4e8..a48b5ccb2a9 100644 --- a/src/plugins/git/gitsettings.h +++ b/src/plugins/git/gitsettings.h @@ -15,7 +15,7 @@ enum CommitType }; // Todo: Add user name and password? -class GitSettings : public VcsBase::VcsBaseSettings +class GitSettings final : public VcsBase::VcsBaseSettings { public: GitSettings(); diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index cc294cad57a..75fbc5eb75f 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -169,7 +169,6 @@ private: void createRepositoryActions(const Core::Context &context); // Variables - MercurialSettings m_settings; MercurialClient m_client; Core::CommandLocator *m_commandLocator = nullptr; diff --git a/src/plugins/mercurial/mercurialsettings.cpp b/src/plugins/mercurial/mercurialsettings.cpp index 0b493e277bf..048d7345813 100644 --- a/src/plugins/mercurial/mercurialsettings.cpp +++ b/src/plugins/mercurial/mercurialsettings.cpp @@ -6,6 +6,8 @@ #include "constants.h" #include "mercurialtr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/layoutbuilder.h> #include <vcsbase/vcsbaseconstants.h> @@ -14,20 +16,15 @@ using namespace Utils; namespace Mercurial::Internal { -static MercurialSettings *theSettings; - MercurialSettings &settings() { - return *theSettings; + static MercurialSettings theSettings; + return theSettings; } MercurialSettings::MercurialSettings() { - theSettings = this; - - setId(VcsBase::Constants::VCS_ID_MERCURIAL); - setDisplayName(Tr::tr("Mercurial")); - setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); + setAutoApply(false); setSettingsGroup("Mercurial"); binaryPath.setExpectedKind(PathChooser::ExistingCommand); @@ -75,4 +72,20 @@ MercurialSettings::MercurialSettings() }); } +// MercurialSettingsPage + +class MercurialSettingsPage final : public Core::IOptionsPage +{ +public: + MercurialSettingsPage() + { + setId(VcsBase::Constants::VCS_ID_MERCURIAL); + setDisplayName(Tr::tr("Mercurial")); + setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); + setSettingsProvider([] { return &settings(); }); + } +}; + +const MercurialSettingsPage settingsPage; + } // Mercurial::Internal diff --git a/src/plugins/mercurial/mercurialsettings.h b/src/plugins/mercurial/mercurialsettings.h index 2102d7037d6..6dc245307bf 100644 --- a/src/plugins/mercurial/mercurialsettings.h +++ b/src/plugins/mercurial/mercurialsettings.h @@ -7,7 +7,7 @@ namespace Mercurial::Internal { -class MercurialSettings : public VcsBase::VcsBaseSettings +class MercurialSettings final : public VcsBase::VcsBaseSettings { public: MercurialSettings(); diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index e584d981818..6e84643a405 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -261,7 +261,6 @@ private: const QStringList m_svnDirectories; - SubversionSettings m_settings; SubversionClient *m_client = nullptr; QString m_commitMessageFileName; FilePath m_commitRepository; diff --git a/src/plugins/subversion/subversionsettings.cpp b/src/plugins/subversion/subversionsettings.cpp index 9b9225ccae7..c22f847f89e 100644 --- a/src/plugins/subversion/subversionsettings.cpp +++ b/src/plugins/subversion/subversionsettings.cpp @@ -5,6 +5,8 @@ #include "subversiontr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/hostosinfo.h> #include <utils/layoutbuilder.h> #include <utils/pathchooser.h> @@ -16,20 +18,15 @@ using namespace VcsBase; namespace Subversion::Internal { -static SubversionSettings *theSettings; - SubversionSettings &settings() { - return *theSettings; + static SubversionSettings theSettings; + return theSettings; } SubversionSettings::SubversionSettings() { - theSettings = this; - - setId(VcsBase::Constants::VCS_ID_SUBVERSION); - setDisplayName(Tr::tr("Subversion")); - setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); + setAutoApply(false); setSettingsGroup("Subversion"); binaryPath.setExpectedKind(PathChooser::ExistingCommand); @@ -104,4 +101,19 @@ bool SubversionSettings::hasAuthentication() const return useAuthentication() && !userName().isEmpty(); } +// SubversionSettingsPage + +class SubversionSettingsPage final : public Core::IOptionsPage +{ +public: + SubversionSettingsPage() + { + setId(VcsBase::Constants::VCS_ID_SUBVERSION); + setDisplayName(Tr::tr("Subversion")); + setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); + } +}; + +const SubversionSettingsPage settingsPage; + } // Subversion::Internal diff --git a/src/plugins/subversion/subversionsettings.h b/src/plugins/subversion/subversionsettings.h index c5bcb8e9cf5..0c615bb0f91 100644 --- a/src/plugins/subversion/subversionsettings.h +++ b/src/plugins/subversion/subversionsettings.h @@ -7,7 +7,7 @@ namespace Subversion::Internal { -class SubversionSettings : public VcsBase::VcsBaseSettings +class SubversionSettings final : public VcsBase::VcsBaseSettings { public: SubversionSettings(); diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.h b/src/plugins/vcsbase/vcsbaseclientsettings.h index 77aa9770b0f..abf79d35988 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.h +++ b/src/plugins/vcsbase/vcsbaseclientsettings.h @@ -5,11 +5,11 @@ #include "vcsbase_global.h" -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> namespace VcsBase { -class VCSBASE_EXPORT VcsBaseSettings : public Core::PagedSettings +class VCSBASE_EXPORT VcsBaseSettings : public Utils::AspectContainer { public: VcsBaseSettings(); From a0a461668c1cb024629f6a6fe0e8431df1509621 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 13:52:01 +0200 Subject: [PATCH 0381/1777] Vcs: Distribute readSettings() calls to individual settings Isn't a benefit here, but what the other settings do, so it's easier to ponder more centralized solutions later. Change-Id: I3837e5bedc8771dd56b8bacda8c23e40281b4fe3 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/bazaar/bazaarsettings.cpp | 2 ++ src/plugins/cvs/cvssettings.cpp | 2 ++ src/plugins/fossil/fossilsettings.cpp | 2 ++ src/plugins/git/gitsettings.cpp | 2 ++ src/plugins/mercurial/mercurialsettings.cpp | 2 ++ src/plugins/subversion/subversionsettings.cpp | 2 ++ src/plugins/vcsbase/vcsbaseclient.cpp | 1 - 7 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/bazaar/bazaarsettings.cpp b/src/plugins/bazaar/bazaarsettings.cpp index 090d5209fa3..6683036d5ee 100644 --- a/src/plugins/bazaar/bazaarsettings.cpp +++ b/src/plugins/bazaar/bazaarsettings.cpp @@ -86,6 +86,8 @@ BazaarSettings::BazaarSettings() st }; }); + + readSettings(); } // BazaarSettingsPage diff --git a/src/plugins/cvs/cvssettings.cpp b/src/plugins/cvs/cvssettings.cpp index 775a393df3e..a03e8a74089 100644 --- a/src/plugins/cvs/cvssettings.cpp +++ b/src/plugins/cvs/cvssettings.cpp @@ -78,6 +78,8 @@ CvsSettings::CvsSettings() st }; }); + + readSettings(); } QStringList CvsSettings::addOptions(const QStringList &args) const diff --git a/src/plugins/fossil/fossilsettings.cpp b/src/plugins/fossil/fossilsettings.cpp index 1a2960a0e5c..2443e61c8f0 100644 --- a/src/plugins/fossil/fossilsettings.cpp +++ b/src/plugins/fossil/fossilsettings.cpp @@ -115,6 +115,8 @@ FossilSettings::FossilSettings() st }; }); + + readSettings(); } // FossilSettingsPage diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index f10dd3d9638..b0cedb300c7 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -145,6 +145,8 @@ GitSettings::GitSettings() }); connect(&binaryPath, &BaseAspect::changed, this, [this] { tryResolve = true; }); connect(&path, &BaseAspect::changed, this, [this] { tryResolve = true; }); + + readSettings(); } FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const diff --git a/src/plugins/mercurial/mercurialsettings.cpp b/src/plugins/mercurial/mercurialsettings.cpp index 048d7345813..05c96672f90 100644 --- a/src/plugins/mercurial/mercurialsettings.cpp +++ b/src/plugins/mercurial/mercurialsettings.cpp @@ -70,6 +70,8 @@ MercurialSettings::MercurialSettings() st }; }); + + readSettings(); } // MercurialSettingsPage diff --git a/src/plugins/subversion/subversionsettings.cpp b/src/plugins/subversion/subversionsettings.cpp index c22f847f89e..6fb5a83ff57 100644 --- a/src/plugins/subversion/subversionsettings.cpp +++ b/src/plugins/subversion/subversionsettings.cpp @@ -94,6 +94,8 @@ SubversionSettings::SubversionSettings() st }; }); + + readSettings(); } bool SubversionSettings::hasAuthentication() const diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index de3565dd531..b58524209d0 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -57,7 +57,6 @@ namespace VcsBase { VcsBaseClientImpl::VcsBaseClientImpl(VcsBaseSettings *baseSettings) : m_baseSettings(baseSettings) { - m_baseSettings->readSettings(); connect(ICore::instance(), &ICore::saveSettingsRequested, this, &VcsBaseClientImpl::saveSettings); } From ab70a044615ebbee75496a2a30b16b5822b68349 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 18 Jul 2023 15:43:23 +0200 Subject: [PATCH 0382/1777] VcsBase: Fix missing include Change-Id: I99cf36c0d1b4b91d828c241c6cad56bdc94e56f7 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/vcsbase/commonvcssettings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/vcsbase/commonvcssettings.cpp b/src/plugins/vcsbase/commonvcssettings.cpp index d4e4beb149c..f631c20d953 100644 --- a/src/plugins/vcsbase/commonvcssettings.cpp +++ b/src/plugins/vcsbase/commonvcssettings.cpp @@ -7,6 +7,7 @@ #include "vcsbasetr.h" #include <coreplugin/dialogs/ioptionspage.h> +#include <coreplugin/iversioncontrol.h> #include <coreplugin/vcsmanager.h> #include <utils/environment.h> From 171675099cc60ad2e7bf2d2b8b5a6e34cd629b2f Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 18 Jul 2023 19:07:49 +0200 Subject: [PATCH 0383/1777] DiffEditor: Replace QVector with QList Change-Id: I79246cc79a2cdcd6150b060386b34ce2f9923456 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/diffeditor/diffeditor.h | 2 +- src/plugins/diffeditor/selectabletexteditorwidget.cpp | 6 +++--- src/plugins/diffeditor/selectabletexteditorwidget.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/diffeditor/diffeditor.h b/src/plugins/diffeditor/diffeditor.h index 24f89d55030..0bf3d52c6d1 100644 --- a/src/plugins/diffeditor/diffeditor.h +++ b/src/plugins/diffeditor/diffeditor.h @@ -74,7 +74,7 @@ private: UnifiedView *m_unifiedView = nullptr; SideBySideView *m_sideBySideView = nullptr; QStackedWidget *m_stackedWidget = nullptr; - QVector<IDiffView *> m_views; + QList<IDiffView *> m_views; QToolBar *m_toolBar = nullptr; QComboBox *m_entriesComboBox = nullptr; QSpinBox *m_contextSpinBox = nullptr; diff --git a/src/plugins/diffeditor/selectabletexteditorwidget.cpp b/src/plugins/diffeditor/selectabletexteditorwidget.cpp index e0c95f6abd3..bcb3ee0381d 100644 --- a/src/plugins/diffeditor/selectabletexteditorwidget.cpp +++ b/src/plugins/diffeditor/selectabletexteditorwidget.cpp @@ -114,13 +114,13 @@ void SelectableTextEditorWidget::setFoldingIndent(const QTextBlock &block, int i void SelectableTextEditorWidget::paintBlock(QPainter *painter, const QTextBlock &block, const QPointF &offset, - const QVector<QTextLayout::FormatRange> &selections, + const QList<QTextLayout::FormatRange> &selections, const QRect &clipRect) const { const int blockNumber = block.blockNumber(); - QList<DiffSelection> diffs = m_diffSelections.value(blockNumber); + const QList<DiffSelection> diffs = m_diffSelections.value(blockNumber); - QVector<QTextLayout::FormatRange> newSelections; + QList<QTextLayout::FormatRange> newSelections; for (const DiffSelection &diffSelection : diffs) { if (diffSelection.format) { QTextLayout::FormatRange formatRange; diff --git a/src/plugins/diffeditor/selectabletexteditorwidget.h b/src/plugins/diffeditor/selectabletexteditorwidget.h index 4b0d465204f..4e82f83b304 100644 --- a/src/plugins/diffeditor/selectabletexteditorwidget.h +++ b/src/plugins/diffeditor/selectabletexteditorwidget.h @@ -39,7 +39,7 @@ private: void paintBlock(QPainter *painter, const QTextBlock &block, const QPointF &offset, - const QVector<QTextLayout::FormatRange> &selections, + const QList<QTextLayout::FormatRange> &selections, const QRect &clipRect) const override; DiffSelections m_diffSelections; From 481d301c5c589c83a862db8f58c5443fb8e360fa Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 18 Jul 2023 19:13:35 +0200 Subject: [PATCH 0384/1777] GitPlugin: Replace QVector with QList Change-Id: I20218a5fcd9b4af6e6633de55d41d4ba771bcd75 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/git/gitplugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 6fa194adfbe..7d669c398ce 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -416,9 +416,9 @@ public: QAction *m_fixupCommitAction = nullptr; QAction *m_interactiveRebaseAction = nullptr; - QVector<ParameterAction *> m_fileActions; - QVector<ParameterAction *> m_projectActions; - QVector<QAction *> m_repositoryActions; + QList<ParameterAction *> m_fileActions; + QList<ParameterAction *> m_projectActions; + QList<QAction *> m_repositoryActions; ParameterAction *m_applyCurrentFilePatchAction = nullptr; Gerrit::Internal::GerritPlugin m_gerritPlugin; From 3e2e0d9393af2494a833d476a76c240adbb37329 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 11:43:54 +0200 Subject: [PATCH 0385/1777] Meson: Delay settings creation Change-Id: Ib4de981670c9f70e5ddd4c6e0b31bfd4b6a61851 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../mesonprojectplugin.cpp | 2 -- src/plugins/mesonprojectmanager/settings.cpp | 36 ++++++++++++------- src/plugins/mesonprojectmanager/settings.h | 8 ++--- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp b/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp index 56d945f04b7..1b71ff5e3f2 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp +++ b/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp @@ -11,7 +11,6 @@ #include "mesontoolkitaspect.h" #include "ninjabuildstep.h" #include "ninjatoolkitaspect.h" -#include "settings.h" #include "toolssettingsaccessor.h" #include "toolssettingspage.h" @@ -45,7 +44,6 @@ public: ~MesonProjectPluginPrivate() {} private: - Settings m_settings; ToolsSettingsPage m_toolslSettingsPage; ToolsSettingsAccessor m_toolsSettings; MesonToolKitAspect m_mesonKitAspect; diff --git a/src/plugins/mesonprojectmanager/settings.cpp b/src/plugins/mesonprojectmanager/settings.cpp index e1fe290bc5c..b233ae3c48b 100644 --- a/src/plugins/mesonprojectmanager/settings.cpp +++ b/src/plugins/mesonprojectmanager/settings.cpp @@ -6,29 +6,23 @@ #include "mesonpluginconstants.h" #include "mesonprojectmanagertr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/layoutbuilder.h> namespace MesonProjectManager::Internal { -static Settings *s_instance; - -Settings &settings() +MesonSettings &settings() { - return *s_instance; + static MesonSettings theSettings; + return theSettings; } -Settings::Settings() +MesonSettings::MesonSettings() { - s_instance = this; - + setAutoApply(false); setSettingsGroup("MesonProjectManager"); - setId("A.MesonProjectManager.SettingsPage.General"); - setDisplayName(Tr::tr("General")); - setDisplayCategory("Meson"); - setCategory(Constants::SettingsPage::CATEGORY); - setCategoryIconPath(Constants::Icons::MESON_BW); - autorunMeson.setSettingsKey("meson.autorun"); autorunMeson.setLabelText(Tr::tr("Autorun Meson")); autorunMeson.setToolTip(Tr::tr("Automatically run Meson when needed.")); @@ -49,4 +43,20 @@ Settings::Settings() readSettings(); } +class MesonSettingsPage final : public Core::IOptionsPage +{ +public: + MesonSettingsPage() + { + setId("A.MesonProjectManager.SettingsPage.General"); + setDisplayName(Tr::tr("General")); + setDisplayCategory("Meson"); + setCategory(Constants::SettingsPage::CATEGORY); + setCategoryIconPath(Constants::Icons::MESON_BW); + setSettingsProvider([] { return &settings(); }); + } +}; + +const MesonSettingsPage settingsPage; + } // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/settings.h b/src/plugins/mesonprojectmanager/settings.h index 34c2e9e97d9..8ddc5f53ece 100644 --- a/src/plugins/mesonprojectmanager/settings.h +++ b/src/plugins/mesonprojectmanager/settings.h @@ -3,21 +3,19 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> - #include <utils/aspects.h> namespace MesonProjectManager::Internal { -class Settings : public Core::PagedSettings +class MesonSettings final : public Utils::AspectContainer { public: - Settings(); + MesonSettings(); Utils::BoolAspect autorunMeson{this}; Utils::BoolAspect verboseNinja{this}; }; -Settings &settings(); +MesonSettings &settings(); } // MesonProjectManager::Internal From bedab22e63e813719b8cdf3d0b4fd4bf323f7d42 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 14:33:48 +0200 Subject: [PATCH 0386/1777] Replace a few aspect.value() calls with operatpor() Change-Id: Icaada671fe8dbe59d4f596da49476b3ec2137c25 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/beautifier/generalsettings.cpp | 2 +- .../cmakebuildconfiguration.cpp | 6 ++--- src/plugins/cvs/cvsplugin.cpp | 2 +- src/plugins/cvs/cvssettings.cpp | 2 +- src/plugins/debugger/cdb/cdbengine.cpp | 6 ++--- src/plugins/debugger/cdb/cdboptionspage.cpp | 4 ++-- .../perfprofiler/perfconfigeventsmodel.cpp | 6 ++--- src/plugins/projectexplorer/makestep.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilertool.cpp | 6 ++--- src/plugins/squish/squishfilehandler.cpp | 2 +- src/plugins/squish/squishsettings.cpp | 4 ++-- src/plugins/terminal/terminalwidget.cpp | 22 +++++++++---------- src/plugins/valgrind/callgrindtool.cpp | 8 +++---- src/plugins/valgrind/valgrindengine.cpp | 2 +- 14 files changed, 36 insertions(+), 38 deletions(-) diff --git a/src/plugins/beautifier/generalsettings.cpp b/src/plugins/beautifier/generalsettings.cpp index b0da1fc2d4c..b54e2cc93cd 100644 --- a/src/plugins/beautifier/generalsettings.cpp +++ b/src/plugins/beautifier/generalsettings.cpp @@ -61,7 +61,7 @@ GeneralSettings::GeneralSettings() QList<MimeType> GeneralSettings::allowedMimeTypes() const { - const QStringList stringTypes = autoFormatMime.value().split(';'); + const QStringList stringTypes = autoFormatMime().split(';'); QList<MimeType> types; for (QString t : stringTypes) { diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 2ed08688cf5..e98ed2a8cd5 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -383,7 +383,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) connect(bs, &BuildSystem::parsingFinished, this, [this, bs] { const CMakeConfig config = bs->configurationFromCMake(); - const TriState qmlDebugSetting = m_buildConfig->qmlDebugging.value(); + const TriState qmlDebugSetting = m_buildConfig->qmlDebugging(); bool qmlDebugConfig = CMakeBuildConfiguration::hasQmlDebugging(config); if ((qmlDebugSetting == TriState::Enabled && !qmlDebugConfig) || (qmlDebugSetting == TriState::Disabled && qmlDebugConfig)) { @@ -843,10 +843,10 @@ void CMakeBuildSettingsWidget::updateConfigurationStateIndex(int index) CMakeConfig CMakeBuildSettingsWidget::getQmlDebugCxxFlags() { - const TriState qmlDebuggingState = m_buildConfig->qmlDebugging.value(); + const TriState qmlDebuggingState = m_buildConfig->qmlDebugging(); if (qmlDebuggingState == TriState::Default) // don't touch anything return {}; - const bool enable = m_buildConfig->qmlDebugging.value() == TriState::Enabled; + const bool enable = m_buildConfig->qmlDebugging() == TriState::Enabled; const CMakeConfig configList = m_buildConfig->cmakeBuildSystem()->configurationFromCMake(); const QByteArrayList cxxFlagsPrev{"CMAKE_CXX_FLAGS", diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index 47d1256528c..aae9acd1e86 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -148,7 +148,7 @@ public: QStringList arguments() const override { - return settings().diffOptions.value().split(' ', Qt::SkipEmptyParts) + return settings().diffOptions().split(' ', Qt::SkipEmptyParts) + VcsBaseEditorConfig::arguments(); } }; diff --git a/src/plugins/cvs/cvssettings.cpp b/src/plugins/cvs/cvssettings.cpp index a03e8a74089..c6f9350b256 100644 --- a/src/plugins/cvs/cvssettings.cpp +++ b/src/plugins/cvs/cvssettings.cpp @@ -84,7 +84,7 @@ CvsSettings::CvsSettings() QStringList CvsSettings::addOptions(const QStringList &args) const { - const QString cvsRoot = this->cvsRoot.value(); + const QString cvsRoot = this->cvsRoot(); if (cvsRoot.isEmpty()) return args; diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index d89ea99fa4a..54aa3f6ca17 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -368,13 +368,13 @@ void CdbEngine::setupEngine() if (s.ignoreFirstChanceAccessViolation()) debugger.addArg("-x"); - const QStringList &sourcePaths = s.cdbSourcePaths.value(); + const QStringList &sourcePaths = s.cdbSourcePaths(); if (!sourcePaths.isEmpty()) debugger.addArgs({"-srcpath", sourcePaths.join(';')}); - debugger.addArgs({"-y", QChar('"') + s.cdbSymbolPaths.value().join(';') + '"'}); + debugger.addArgs({"-y", QChar('"') + s.cdbSymbolPaths().join(';') + '"'}); - debugger.addArgs(expand(s.cdbAdditionalArguments.value()), CommandLine::Raw); + debugger.addArgs(expand(s.cdbAdditionalArguments()), CommandLine::Raw); switch (sp.startMode) { case StartInternal: diff --git a/src/plugins/debugger/cdb/cdboptionspage.cpp b/src/plugins/debugger/cdb/cdboptionspage.cpp index 3aad91cd7ef..ef3586e61b6 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.cpp +++ b/src/plugins/debugger/cdb/cdboptionspage.cpp @@ -169,7 +169,7 @@ CdbOptionsPageWidget::CdbOptionsPageWidget() using namespace Layouting; DebuggerSettings &s = settings(); - m_breakEventWidget->setBreakEvents(settings().cdbBreakEvents.value()); + m_breakEventWidget->setBreakEvents(settings().cdbBreakEvents()); Column { Row { @@ -220,7 +220,7 @@ void CdbOptionsPageWidget::apply() void CdbOptionsPageWidget::finish() { - m_breakEventWidget->setBreakEvents(settings().cdbBreakEvents.value()); + m_breakEventWidget->setBreakEvents(settings().cdbBreakEvents()); m_group.finish(); } diff --git a/src/plugins/perfprofiler/perfconfigeventsmodel.cpp b/src/plugins/perfprofiler/perfconfigeventsmodel.cpp index ac7924cfe0e..296feb88790 100644 --- a/src/plugins/perfprofiler/perfconfigeventsmodel.cpp +++ b/src/plugins/perfprofiler/perfconfigeventsmodel.cpp @@ -124,7 +124,7 @@ bool PerfConfigEventsModel::setData(const QModelIndex &dataIndex, const QVariant const int row = dataIndex.row(); const int column = dataIndex.column(); - QStringList events = m_settings->events.value(); + QStringList events = m_settings->events(); EventDescription description = parseEvent(events[row]); switch (column) { case ColumnEventType: @@ -183,7 +183,7 @@ bool PerfConfigEventsModel::insertRows(int row, int count, const QModelIndex &pa if (parent.isValid()) return false; - QStringList events = m_settings->events.value(); + QStringList events = m_settings->events(); for (int i = 0; i < count; ++i) events.insert(row, "dummy"); beginInsertRows(parent, row, row + count - 1); @@ -197,7 +197,7 @@ bool PerfConfigEventsModel::removeRows(int row, int count, const QModelIndex &pa if (parent.isValid()) return false; - QStringList events = m_settings->events.value(); + QStringList events = m_settings->events(); for (int i = 0; i < count; ++i) events.removeAt(row); beginRemoveRows(parent, row, row + count - 1); diff --git a/src/plugins/projectexplorer/makestep.cpp b/src/plugins/projectexplorer/makestep.cpp index cd8ef6120ec..6ec22628457 100644 --- a/src/plugins/projectexplorer/makestep.cpp +++ b/src/plugins/projectexplorer/makestep.cpp @@ -303,7 +303,7 @@ CommandLine MakeStep::effectiveMakeCommand(MakeCommandType type) const cmd.addArgs(displayArguments()); cmd.addArgs(userArguments(), CommandLine::Raw); cmd.addArgs(jobArguments()); - cmd.addArgs(m_buildTargetsAspect.value()); + cmd.addArgs(m_buildTargetsAspect()); return cmd; } diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 59a740e3b5d..f5ade253be3 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -291,9 +291,9 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker) auto runControl = runWorker->runControl(); if (auto aspect = runControl->aspect<QmlProfilerRunConfigurationAspect>()) { if (auto settings = static_cast<const QmlProfilerSettings *>(aspect->currentSettings)) { - d->m_profilerConnections->setFlushInterval(settings->flushEnabled.value() ? - settings->flushInterval.value() : 0); - d->m_profilerModelManager->setAggregateTraces(settings->aggregateTraces.value()); + d->m_profilerConnections->setFlushInterval(settings->flushEnabled() ? + settings->flushInterval() : 0); + d->m_profilerModelManager->setAggregateTraces(settings->aggregateTraces()); } } diff --git a/src/plugins/squish/squishfilehandler.cpp b/src/plugins/squish/squishfilehandler.cpp index 8a726cb9baa..ed2ad231378 100644 --- a/src/plugins/squish/squishfilehandler.cpp +++ b/src/plugins/squish/squishfilehandler.cpp @@ -436,7 +436,7 @@ void SquishFileHandler::recordTestCase(const QString &suiteName, const QString & return; conf.setAut(dialog.aut.currentText()); - conf.setArguments(dialog.arguments.value()); + conf.setArguments(dialog.arguments()); } SquishTools::instance()->recordTestCase(suitePath, testCaseName, conf); diff --git a/src/plugins/squish/squishsettings.cpp b/src/plugins/squish/squishsettings.cpp index 597b292a901..af442bc7869 100644 --- a/src/plugins/squish/squishsettings.cpp +++ b/src/plugins/squish/squishsettings.cpp @@ -523,8 +523,8 @@ void SquishServerSettingsWidget::addAttachableAut(TreeItem *categoryItem, Squish if (dialog.exec() != QDialog::Accepted) return; - const QString executableStr = dialog.executable.value(); - const QString hostStr = dialog.host.value(); + const QString executableStr = dialog.executable(); + const QString hostStr = dialog.host(); if (executableStr.isEmpty() || hostStr.isEmpty()) return; diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 4e88071a94f..fdb5547a4f6 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -143,9 +143,7 @@ void TerminalWidget::setupPty() m_process = std::make_unique<Process>(); CommandLine shellCommand = m_openParameters.shellCommand.value_or( - CommandLine{settings().shell(), - settings().shellArguments.value(), - CommandLine::Raw}); + CommandLine{settings().shell(), settings().shellArguments(), CommandLine::Raw}); Environment env = m_openParameters.environment.value_or(Environment{}) .appliedToEnvironment(shellCommand.executable().deviceEnvironment()); @@ -230,8 +228,8 @@ void TerminalWidget::setupFont() { QFont f; f.setFixedPitch(true); - f.setFamily(settings().font.value()); - f.setPointSize(settings().fontSize.value()); + f.setFamily(settings().font()); + f.setPointSize(settings().fontSize()); setFont(f); } @@ -241,12 +239,12 @@ void TerminalWidget::setupColors() // Check if the colors have changed. std::array<QColor, 20> newColors; for (int i = 0; i < 16; ++i) { - newColors[i] = settings().colors[i].value(); + newColors[i] = settings().colors[i](); } - newColors[ColorIndex::Background] = settings().backgroundColor.value(); - newColors[ColorIndex::Foreground] = settings().foregroundColor.value(); - newColors[ColorIndex::Selection] = settings().selectionColor.value(); - newColors[ColorIndex::FindMatch] = settings().findMatchColor.value(); + newColors[ColorIndex::Background] = settings().backgroundColor(); + newColors[ColorIndex::Foreground] = settings().foregroundColor(); + newColors[ColorIndex::Selection] = settings().selectionColor(); + newColors[ColorIndex::FindMatch] = settings().findMatchColor(); if (m_currentColors == newColors) return; @@ -401,7 +399,7 @@ void TerminalWidget::setupSurface() verticalScrollBar()->setValue(verticalScrollBar()->maximum()); }); connect(m_surface.get(), &Internal::TerminalSurface::bell, this, [] { - if (settings().audibleBell.value()) + if (settings().audibleBell()) QApplication::beep(); }); connect(m_surface.get(), @@ -438,7 +436,7 @@ void TerminalWidget::setupSurface() void TerminalWidget::configBlinkTimer() { bool shouldRun = m_cursor.visible && m_cursor.blink && hasFocus() - && settings().allowBlinkingCursor.value(); + && settings().allowBlinkingCursor(); if (shouldRun != m_cursorBlinkTimer.isActive()) { if (shouldRun) m_cursorBlinkTimer.start(); diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 691d5051e58..f89aa58b8c9 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -477,7 +477,7 @@ CallgrindToolPrivate::CallgrindToolPrivate() connect(m_searchFilter, &QLineEdit::textChanged, &m_updateTimer, QOverload<>::of(&QTimer::start)); - setCostFormat(CostDelegate::CostFormat(settings->costFormat.value())); + setCostFormat(CostDelegate::CostFormat(settings->costFormat())); m_perspective.addToolBarAction(settings->detectCycles.action()); m_perspective.addToolBarAction(settings->shortenTemplates.action()); @@ -747,9 +747,9 @@ void CallgrindToolPrivate::setupRunner(CallgrindToolRunner *toolRunner) // apply project settings ValgrindProjectSettings settings; settings.fromMap(runControl->settingsData(ANALYZER_VALGRIND_SETTINGS)); - m_visualization->setMinimumInclusiveCostRatio(settings.visualizationMinimumInclusiveCostRatio.value() / 100.0); - m_proxyModel.setMinimumInclusiveCostRatio(settings.minimumInclusiveCostRatio.value() / 100.0); - m_dataModel.setVerboseToolTipsEnabled(settings.enableEventToolTips.value()); + m_visualization->setMinimumInclusiveCostRatio(settings.visualizationMinimumInclusiveCostRatio() / 100.0); + m_proxyModel.setMinimumInclusiveCostRatio(settings.minimumInclusiveCostRatio() / 100.0); + m_dataModel.setVerboseToolTipsEnabled(settings.enableEventToolTips()); m_toolBusy = true; updateRunActions(); diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index ee1484108c8..aab377fc741 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -103,7 +103,7 @@ QStringList ValgrindToolRunner::genericToolArguments() const { QString smcCheckValue; - switch (m_settings.selfModifyingCodeDetection.value()) { + switch (m_settings.selfModifyingCodeDetection()) { case ValgrindBaseSettings::DetectSmcNo: smcCheckValue = "none"; break; From c7cf450bd86322c04b28dab1c802badbc2ab1ed8 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 14:05:42 +0200 Subject: [PATCH 0387/1777] VcsBase: Remove almost unused access to VcssBaseClientImpl::settings() Change-Id: I090714e9724dcc00b37651bb1310d7848066e03e Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/subversion/subversionclient.cpp | 6 ++---- src/plugins/vcsbase/vcsbaseclient.cpp | 5 ----- src/plugins/vcsbase/vcsbaseclient.h | 2 -- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/plugins/subversion/subversionclient.cpp b/src/plugins/subversion/subversionclient.cpp index 4ab11b6c913..0e47c584542 100644 --- a/src/plugins/subversion/subversionclient.cpp +++ b/src/plugins/subversion/subversionclient.cpp @@ -234,13 +234,12 @@ void SubversionDiffEditorController::setChangeNumber(int changeNumber) SubversionDiffEditorController *SubversionClient::findOrCreateDiffEditor(const QString &documentId, const FilePath &source, const QString &title, const FilePath &workingDirectory) { - SubversionSettings &settings = Internal::settings(); IDocument *document = DiffEditorController::findOrCreateDocument(documentId, title); auto controller = qobject_cast<SubversionDiffEditorController *>( DiffEditorController::controller(document)); if (!controller) { controller = new SubversionDiffEditorController(document); - controller->setVcsBinary(settings.binaryPath()); + controller->setVcsBinary(settings().binaryPath()); controller->setProcessEnvironment(processEnvironment()); controller->setWorkingDirectory(workingDirectory); } @@ -271,8 +270,7 @@ void SubversionClient::log(const FilePath &workingDir, bool enableAnnotationContextMenu, const std::function<void(Utils::CommandLine &)> &addAuthOptions) { - auto &settings = static_cast<SubversionSettings &>(this->settings()); - const int logCount = settings.logCount(); + const int logCount = settings().logCount(); QStringList svnExtraOptions = extraOptions; if (logCount > 0) svnExtraOptions << QLatin1String("-l") << QString::number(logCount); diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index b58524209d0..700f32284e5 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -61,11 +61,6 @@ VcsBaseClientImpl::VcsBaseClientImpl(VcsBaseSettings *baseSettings) this, &VcsBaseClientImpl::saveSettings); } -VcsBaseSettings &VcsBaseClientImpl::settings() const -{ - return *m_baseSettings; -} - FilePath VcsBaseClientImpl::vcsBinary() const { return m_baseSettings->binaryPath(); diff --git a/src/plugins/vcsbase/vcsbaseclient.h b/src/plugins/vcsbase/vcsbaseclient.h index 035e2f00424..1c22fbf968e 100644 --- a/src/plugins/vcsbase/vcsbaseclient.h +++ b/src/plugins/vcsbase/vcsbaseclient.h @@ -44,8 +44,6 @@ public: explicit VcsBaseClientImpl(VcsBaseSettings *baseSettings); ~VcsBaseClientImpl() override = default; - VcsBaseSettings &settings() const; - virtual Utils::FilePath vcsBinary() const; int vcsTimeoutS() const; From 2a31f17354e2cc1dea085b9cb995036a4bfe6a71 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 08:48:01 +0200 Subject: [PATCH 0388/1777] Utils: Use handleGuiChanged more consistently in aspect implementations Change-Id: I53eb3416b27dca45bd30860f1fb0ec674c98240e Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/aspects.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index f4226eeac57..ae8ee76da96 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1860,11 +1860,8 @@ void IntegerAspect::addToLayout(Layouting::LayoutItem &parent) int(d->m_maximumValue.value() / d->m_displayScaleFactor)); d->m_spinBox->setValue(int(value() / d->m_displayScaleFactor)); // Must happen after setRange() addLabeledItem(parent, d->m_spinBox); - - if (isAutoApply()) { - connect(d->m_spinBox.data(), &QSpinBox::valueChanged, - this, [this] { setValue(d->m_spinBox->value() * d->m_displayScaleFactor); }); - } + connect(d->m_spinBox.data(), &QSpinBox::valueChanged, + this, &IntegerAspect::handleGuiChanged); } void IntegerAspect::guiToBuffer() @@ -1962,11 +1959,8 @@ void DoubleAspect::addToLayout(LayoutItem &builder) d->m_spinBox->setRange(d->m_minimumValue.value(), d->m_maximumValue.value()); bufferToGui(); // Must happen after setRange()! addLabeledItem(builder, d->m_spinBox); - - if (isAutoApply()) { - connect(d->m_spinBox.data(), &QDoubleSpinBox::valueChanged, - this, [this] { setValue(d->m_spinBox->value()); }); - } + connect(d->m_spinBox.data(), &QDoubleSpinBox::valueChanged, + this, &DoubleAspect::handleGuiChanged); } void DoubleAspect::guiToBuffer() From e157ac82a1cfea8396816e9293c101fbfd2d38de Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 17:20:59 +0200 Subject: [PATCH 0389/1777] Debugger: Paddle back on multiple inheritance for settings This is fairly close to the new "standard" pattern for an individual page but still allows flat access using the same 'settings().' stanza. Change-Id: I1edbbd64a857a3d3936fb2c21fdc7e3c8ae7a44c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/debugger/debuggeractions.cpp | 26 +++++++++++++++++--- src/plugins/debugger/debuggeractions.h | 28 +++++++++++++++++++--- src/plugins/debugger/disassembleragent.cpp | 2 -- src/plugins/debugger/gdb/gdbsettings.cpp | 28 +++++++++++++++++++--- src/plugins/debugger/gdb/gdbsettings.h | 6 +++-- src/plugins/debugger/lldb/lldbengine.cpp | 1 - 6 files changed, 77 insertions(+), 14 deletions(-) diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index e4026bca81d..aaf9971a623 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -7,6 +7,7 @@ #include "debuggericons.h" #include "debuggerinternalconstants.h" #include "debuggertr.h" +#include "gdb/gdbsettings.h" #ifdef Q_OS_WIN #include "registerpostmortemaction.h" @@ -39,7 +40,28 @@ DebuggerSettings &settings() return settings; } -DebuggerSettings::DebuggerSettings() +DebuggerSettings::DebuggerSettings() : + gdbWatchdogTimeout{gdbSettings().gdbWatchdogTimeout}, + skipKnownFrames{gdbSettings().skipKnownFrames}, + useMessageBoxForSignals{gdbSettings().useMessageBoxForSignals}, + adjustBreakpointLocations{gdbSettings().adjustBreakpointLocations}, + useDynamicType{gdbSettings().useDynamicType}, + loadGdbInit{gdbSettings().loadGdbInit}, + loadGdbDumpers{gdbSettings().loadGdbDumpers}, + intelFlavor{gdbSettings().intelFlavor}, + usePseudoTracepoints{gdbSettings().usePseudoTracepoints}, + useIndexCache{gdbSettings().useIndexCache}, + gdbStartupCommands{gdbSettings().gdbStartupCommands}, + gdbPostAttachCommands{gdbSettings().gdbPostAttachCommands}, + targetAsync{gdbSettings().targetAsync}, + autoEnrichParameters{gdbSettings().autoEnrichParameters}, + breakOnThrow{gdbSettings().breakOnThrow}, + breakOnCatch{gdbSettings().breakOnCatch}, + breakOnWarning{gdbSettings().breakOnWarning}, + breakOnFatal{gdbSettings().breakOnFatal}, + breakOnAbort{gdbSettings().breakOnAbort}, + enableReverseDebugging{gdbSettings().enableReverseDebugging}, + multiInferior{gdbSettings().multiInferior} { const QString debugModeGroup(debugModeSettingsGroupC); const QString cdbSettingsGroup(cdbSettingsGroupC); @@ -467,13 +489,11 @@ DebuggerSettings::~DebuggerSettings() void DebuggerSettings::readSettings() { all.readSettings(); - GdbSettings::readSettings(); } void DebuggerSettings::writeSettings() const { all.writeSettings(); - GdbSettings::writeSettings(); } QString DebuggerSettings::dump() diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index c4f8c235532..063967dc90f 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -3,12 +3,11 @@ #pragma once -#include "gdb/gdbsettings.h" +#include <utils/aspects.h> #include <QCoreApplication> #include <QHash> #include <QMap> -#include <QVector> namespace Debugger::Internal { @@ -48,7 +47,7 @@ class GeneralSettings ~GeneralSettings(); }; -class DebuggerSettings : public GdbSettings +class DebuggerSettings { public: explicit DebuggerSettings(); @@ -56,6 +55,29 @@ public: static QString dump(); + Utils::IntegerAspect &gdbWatchdogTimeout; + Utils::BoolAspect &skipKnownFrames; + Utils::BoolAspect &useMessageBoxForSignals; + Utils::BoolAspect &adjustBreakpointLocations; + Utils::BoolAspect &useDynamicType; + Utils::BoolAspect &loadGdbInit; + Utils::BoolAspect &loadGdbDumpers; + Utils::BoolAspect &intelFlavor; + Utils::BoolAspect &usePseudoTracepoints; + Utils::BoolAspect &useIndexCache; + Utils::StringAspect &gdbStartupCommands; + Utils::StringAspect &gdbPostAttachCommands; + + Utils::BoolAspect &targetAsync; + Utils::BoolAspect &autoEnrichParameters; + Utils::BoolAspect &breakOnThrow; + Utils::BoolAspect &breakOnCatch; + Utils::BoolAspect &breakOnWarning; + Utils::BoolAspect &breakOnFatal; + Utils::BoolAspect &breakOnAbort; + Utils::BoolAspect &enableReverseDebugging; + Utils::BoolAspect &multiInferior; + // Page 1: General Utils::BoolAspect useAlternatingRowColors; Utils::BoolAspect useAnnotationsInMainEditor; diff --git a/src/plugins/debugger/disassembleragent.cpp b/src/plugins/debugger/disassembleragent.cpp index b393fe44da2..afe08e2d1fe 100644 --- a/src/plugins/debugger/disassembleragent.cpp +++ b/src/plugins/debugger/disassembleragent.cpp @@ -20,12 +20,10 @@ #include <texteditor/textdocument.h> #include <texteditor/texteditor.h> -#include <utils/aspects.h> #include <utils/mimeutils.h> #include <utils/qtcassert.h> #include <QTextBlock> -#include <QDir> using namespace Core; using namespace TextEditor; diff --git a/src/plugins/debugger/gdb/gdbsettings.cpp b/src/plugins/debugger/gdb/gdbsettings.cpp index 2adeeb7931a..31c8e3f6912 100644 --- a/src/plugins/debugger/gdb/gdbsettings.cpp +++ b/src/plugins/debugger/gdb/gdbsettings.cpp @@ -3,6 +3,8 @@ #include "gdbsettings.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <debugger/commonoptionspage.h> #include <debugger/debuggeractions.h> #include <debugger/debuggerconstants.h> @@ -18,11 +20,15 @@ using namespace Utils; namespace Debugger::Internal { +GdbSettings &gdbSettings() +{ + static GdbSettings settings; + return settings; +} + GdbSettings::GdbSettings() { - setId("M.Gdb"); - setDisplayName(Tr::tr("GDB")); - setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY); + setAutoApply(false); setSettingsGroup("DebugMode"); useMessageBoxForSignals.setSettingsKey("UseMessageBoxForSignals"); @@ -250,4 +256,20 @@ GdbSettings::GdbSettings() readSettings(); } +// GdbSettingsPage + +class GdbSettingsPage final : public Core::IOptionsPage +{ +public: + GdbSettingsPage() + { + setId("M.Gdb"); + setDisplayName(Tr::tr("GDB")); + setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY); + setSettingsProvider([] { return &gdbSettings(); }); + } +}; + +const GdbSettingsPage settingsPage; + } // Debugger::Internal diff --git a/src/plugins/debugger/gdb/gdbsettings.h b/src/plugins/debugger/gdb/gdbsettings.h index d04e89eb966..73c2646e1ca 100644 --- a/src/plugins/debugger/gdb/gdbsettings.h +++ b/src/plugins/debugger/gdb/gdbsettings.h @@ -3,11 +3,11 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> namespace Debugger::Internal { -class GdbSettings : public Core::PagedSettings +class GdbSettings : public Utils::AspectContainer { public: GdbSettings(); @@ -36,4 +36,6 @@ public: Utils::BoolAspect multiInferior{this}; }; +GdbSettings &gdbSettings(); + } // Debugger::Internal diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 73025062503..2d90f1e76c9 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -36,7 +36,6 @@ #include <QApplication> #include <QDateTime> #include <QDebug> -#include <QDir> #include <QFileInfo> #include <QTimer> #include <QToolTip> From d7461a380b19316b3ad6c79dd8c0011e266664d3 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 11:59:51 +0200 Subject: [PATCH 0390/1777] Squish: Use new settings scheme Change-Id: I262342c2797a03a774c89f7b7caae3f9d8c79a6c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/squish/objectsmapdocument.cpp | 5 +-- src/plugins/squish/squishnavigationwidget.cpp | 6 +-- src/plugins/squish/squishplugin.cpp | 18 +++----- src/plugins/squish/squishplugin.h | 6 --- src/plugins/squish/squishsettings.cpp | 44 +++++++++++++------ src/plugins/squish/squishsettings.h | 6 ++- src/plugins/squish/squishtesttreeview.cpp | 7 +-- src/plugins/squish/squishtools.cpp | 17 +++---- src/plugins/squish/squishwizardpages.cpp | 4 +- src/plugins/squish/suiteconf.cpp | 3 +- 10 files changed, 53 insertions(+), 63 deletions(-) diff --git a/src/plugins/squish/objectsmapdocument.cpp b/src/plugins/squish/objectsmapdocument.cpp index 96bf8797208..767f4cb058d 100644 --- a/src/plugins/squish/objectsmapdocument.cpp +++ b/src/plugins/squish/objectsmapdocument.cpp @@ -5,7 +5,6 @@ #include "objectsmaptreeitem.h" #include "squishconstants.h" -#include "squishplugin.h" #include "squishsettings.h" #include "squishtr.h" @@ -197,7 +196,7 @@ Core::IDocument::OpenResult ObjectsMapDocument::openImpl(QString *error, text = reader.data(); } else { - const Utils::FilePath base = SquishPlugin::squishSettings()->squishPath(); + const Utils::FilePath base = settings().squishPath(); if (base.isEmpty()) { if (error) error->append(Tr::tr("Incomplete Squish settings. " @@ -235,7 +234,7 @@ bool ObjectsMapDocument::writeFile(const Utils::FilePath &fileName) const } // otherwise we need the objectmaptool to write the scripted object map again - const Utils::FilePath base = SquishPlugin::squishSettings()->squishPath(); + const Utils::FilePath base = settings().squishPath(); if (base.isEmpty()) return false; const Utils::FilePath exe = base.pathAppended("lib/exec/objectmaptool").withExecutableSuffix(); diff --git a/src/plugins/squish/squishnavigationwidget.cpp b/src/plugins/squish/squishnavigationwidget.cpp index cc9ec76b317..c8545a0ce9a 100644 --- a/src/plugins/squish/squishnavigationwidget.cpp +++ b/src/plugins/squish/squishnavigationwidget.cpp @@ -6,7 +6,6 @@ #include "squishconstants.h" #include "squishfilehandler.h" #include "squishmessages.h" -#include "squishplugin.h" #include "squishsettings.h" #include "squishtesttreemodel.h" #include "squishtesttreeview.h" @@ -311,10 +310,7 @@ void SquishNavigationWidget::onRecordTestCase(const QString &suiteName, const QS void SquishNavigationWidget::onNewTestCaseTriggered(const QModelIndex &index) { - auto settings = SquishPlugin::squishSettings(); - QTC_ASSERT(settings, return); - - if (!settings->squishPath().pathAppended("scriptmodules").exists()) { + if (!settings().squishPath().pathAppended("scriptmodules").exists()) { SquishMessages::criticalMessage(Tr::tr("Set up a valid Squish path to be able to create " "a new test case.\n(Edit > Preferences > Squish)")); return; diff --git a/src/plugins/squish/squishplugin.cpp b/src/plugins/squish/squishplugin.cpp index e2feea622aa..cb2da8c9e51 100644 --- a/src/plugins/squish/squishplugin.cpp +++ b/src/plugins/squish/squishplugin.cpp @@ -27,9 +27,9 @@ #include <utils/qtcassert.h> #include <QMenu> -#include <QtPlugin> using namespace Core; +using namespace Utils; namespace Squish { namespace Internal { @@ -43,7 +43,6 @@ public: void initializeMenuEntries(); bool initializeGlobalScripts(); - SquishSettings m_squishSettings; SquishTestTreeModel m_treeModel; SquishNavigationWidgetFactory m_navigationWidgetFactory; ObjectsMapEditorFactory m_objectsMapEditorFactory; @@ -79,12 +78,6 @@ SquishPlugin::~SquishPlugin() dd = nullptr; } -SquishSettings *SquishPlugin::squishSettings() -{ - QTC_ASSERT(dd, return nullptr); - return &dd->m_squishSettings; -} - void SquishPluginPrivate::initializeMenuEntries() { ActionContainer *menu = ActionManager::createMenu("Squish.Menu"); @@ -95,8 +88,7 @@ void SquishPluginPrivate::initializeMenuEntries() Command *command = ActionManager::registerAction(action, "Squish.ServerSettings"); menu->addAction(command); connect(action, &QAction::triggered, this, [] { - const SquishSettings *settings = SquishPlugin::squishSettings(); - if (!settings->squishPath().exists()) { + if (!settings().squishPath().exists()) { SquishMessages::criticalMessage(Tr::tr("Invalid Squish settings. Configure Squish " "installation path inside " "Preferences... > Squish > General to use " @@ -117,8 +109,8 @@ bool SquishPluginPrivate::initializeGlobalScripts() QTC_ASSERT(dd->m_squishTools, return false); SquishFileHandler::instance()->setSharedFolders({}); - const Utils::FilePath squishserver = dd->m_squishSettings.squishPath().pathAppended( - Utils::HostOsInfo::withExecutableSuffix("bin/squishserver")); + const FilePath squishserver = settings().squishPath().pathAppended( + HostOsInfo::withExecutableSuffix("bin/squishserver")); if (!squishserver.isExecutableFile()) return false; @@ -142,7 +134,7 @@ void SquishPlugin::initialize() bool SquishPlugin::delayedInitialize() { - connect(&dd->m_squishSettings.squishPath, &Utils::BaseAspect::changed, + connect(&settings().squishPath, &BaseAspect::changed, dd, &SquishPluginPrivate::initializeGlobalScripts); return dd->initializeGlobalScripts(); diff --git a/src/plugins/squish/squishplugin.h b/src/plugins/squish/squishplugin.h index 86b5eca3932..c27a24bcd57 100644 --- a/src/plugins/squish/squishplugin.h +++ b/src/plugins/squish/squishplugin.h @@ -3,15 +3,11 @@ #pragma once -#include "squishplugin_global.h" - #include <extensionsystem/iplugin.h> namespace Squish { namespace Internal { -class SquishSettings; - class SquishPlugin : public ExtensionSystem::IPlugin { Q_OBJECT @@ -20,8 +16,6 @@ public: SquishPlugin() = default; ~SquishPlugin() override; - static SquishSettings *squishSettings(); - void initialize() override; bool delayedInitialize() override; ShutdownFlag aboutToShutdown() override; diff --git a/src/plugins/squish/squishsettings.cpp b/src/plugins/squish/squishsettings.cpp index af442bc7869..674c4217b06 100644 --- a/src/plugins/squish/squishsettings.cpp +++ b/src/plugins/squish/squishsettings.cpp @@ -8,6 +8,7 @@ #include "squishtools.h" #include "squishtr.h" +#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icore.h> #include <utils/basetreeview.h> @@ -28,17 +29,16 @@ using namespace Utils; -namespace Squish { -namespace Internal { +namespace Squish::Internal { + +SquishSettings &settings() +{ + static SquishSettings theSettings; + return theSettings; +} SquishSettings::SquishSettings() { - setId("A.Squish.General"); - setDisplayName(Tr::tr("General")); - setCategory(Constants::SQUISH_SETTINGS_CATEGORY); - setDisplayCategory("Squish"); - setCategoryIcon(Icon({{":/squish/images/settingscategory_squish.png", - Theme::PanelTextColorDark}}, Icon::Tint)); setSettingsGroup("Squish"); setAutoApply(false); @@ -113,9 +113,9 @@ SquishSettings::SquishSettings() readSettings(); } -Utils::FilePath SquishSettings::scriptsPath(Language language) const +FilePath SquishSettings::scriptsPath(Language language) const { - Utils::FilePath scripts = squishPath().pathAppended("scriptmodules"); + FilePath scripts = squishPath().pathAppended("scriptmodules"); switch (language) { case Language::Python: scripts = scripts.pathAppended("python"); break; case Language::Perl: scripts = scripts.pathAppended("perl"); break; @@ -124,9 +124,28 @@ Utils::FilePath SquishSettings::scriptsPath(Language language) const case Language::Tcl: scripts = scripts.pathAppended("tcl"); break; } - return scripts.isReadableDir() ? scripts : Utils::FilePath(); + return scripts.isReadableDir() ? scripts : FilePath(); } +class SquishSettingsPage final : public Core::IOptionsPage +{ +public: + SquishSettingsPage() + { + setId("A.Squish.General"); + setDisplayName(Tr::tr("General")); + setCategory(Constants::SQUISH_SETTINGS_CATEGORY); + setDisplayCategory("Squish"); + setCategoryIcon(Icon({{":/squish/images/settingscategory_squish.png", + Theme::PanelTextColorDark}}, Icon::Tint)); + setSettingsProvider([] { return &settings(); }); + } +}; + +const SquishSettingsPage settingsPage; + +// SquishServerSettings + SquishServerSettings::SquishServerSettings() { autTimeout.setLabel(Tr::tr("Maximum startup time:")); @@ -681,5 +700,4 @@ void SquishServerSettingsDialog::configWriteFailed(QProcess::ProcessError error) SquishMessages::criticalMessage(detail); } -} // namespace Internal -} // namespace Squish +} // Squish::Internal diff --git a/src/plugins/squish/squishsettings.h b/src/plugins/squish/squishsettings.h index 0e25a4215e3..7f8fd680ea9 100644 --- a/src/plugins/squish/squishsettings.h +++ b/src/plugins/squish/squishsettings.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> #include <QDialog> #include <QProcess> @@ -29,7 +29,7 @@ public: Utils::BoolAspect animatedCursor{this}; }; -class SquishSettings : public Core::PagedSettings +class SquishSettings : public Utils::AspectContainer { public: SquishSettings(); @@ -45,6 +45,8 @@ public: Utils::BoolAspect minimizeIDE{this}; }; +SquishSettings &settings(); + class SquishServerSettingsDialog : public QDialog { public: diff --git a/src/plugins/squish/squishtesttreeview.cpp b/src/plugins/squish/squishtesttreeview.cpp index 2a1b85a0887..cf9af9a9157 100644 --- a/src/plugins/squish/squishtesttreeview.cpp +++ b/src/plugins/squish/squishtesttreeview.cpp @@ -5,7 +5,6 @@ #include "squishconstants.h" #include "squishfilehandler.h" -#include "squishplugin.h" #include "squishsettings.h" #include "squishtesttreemodel.h" #include "suiteconf.h" @@ -163,10 +162,6 @@ void SquishTestTreeItemDelegate::setEditorData(QWidget *editor, const QModelInde static bool copyScriptTemplates(const SuiteConf &suiteConf, const Utils::FilePath &destination) { - const SquishSettings *s = SquishPlugin::squishSettings(); - QTC_ASSERT(s, return false); - // copy template files - Utils::expected_str<void> result = destination.ensureWritableDir(); QTC_ASSERT_EXPECTED(result, return false); @@ -174,7 +169,7 @@ static bool copyScriptTemplates(const SuiteConf &suiteConf, const Utils::FilePat const QString extension = suiteConf.scriptExtension(); const QString testStr = scripted ? QString("script_som_template") : QString("script_template"); - const Utils::FilePath scripts = s->scriptsPath(suiteConf.language()); + const Utils::FilePath scripts = settings().scriptsPath(suiteConf.language()); const Utils::FilePath test = scripts.pathAppended(testStr + extension); const Utils::FilePath testFile = destination.pathAppended("test" + extension); QTC_ASSERT(!testFile.exists(), return false); diff --git a/src/plugins/squish/squishtools.cpp b/src/plugins/squish/squishtools.cpp index 21450953068..9ee9a18cbec 100644 --- a/src/plugins/squish/squishtools.cpp +++ b/src/plugins/squish/squishtools.cpp @@ -6,7 +6,6 @@ #include "scripthelper.h" #include "squishmessages.h" #include "squishoutputpane.h" -#include "squishplugin.h" #include "squishsettings.h" #include "squishtr.h" #include "squishxmloutputhandler.h" @@ -167,9 +166,7 @@ struct SquishToolsSettings // populate members using current settings void setup() { - const SquishSettings *squishSettings = SquishPlugin::squishSettings(); - QTC_ASSERT(squishSettings, return); - squishPath = squishSettings->squishPath(); + squishPath = settings().squishPath(); if (!squishPath.isEmpty()) { const FilePath squishBin(squishPath.pathAppended("bin")); @@ -181,12 +178,12 @@ struct SquishToolsSettings HostOsInfo::withExecutableSuffix("processcomm")).absoluteFilePath(); } - isLocalServer = squishSettings->local(); - serverHost = squishSettings->serverHost(); - serverPort = squishSettings->serverPort(); - verboseLog = squishSettings->verbose(); - licenseKeyPath = squishSettings->licensePath(); - minimizeIDE = squishSettings->minimizeIDE(); + isLocalServer = settings().local(); + serverHost = settings().serverHost(); + serverPort = settings().serverPort(); + verboseLog = settings().verbose(); + licenseKeyPath = settings().licensePath(); + minimizeIDE = settings().minimizeIDE(); } }; diff --git a/src/plugins/squish/squishwizardpages.cpp b/src/plugins/squish/squishwizardpages.cpp index 33567b11199..f812f0d4684 100644 --- a/src/plugins/squish/squishwizardpages.cpp +++ b/src/plugins/squish/squishwizardpages.cpp @@ -4,7 +4,6 @@ #include "squishwizardpages.h" #include "squishfilehandler.h" -#include "squishplugin.h" #include "squishsettings.h" #include "squishtools.h" #include "squishtr.h" @@ -111,8 +110,7 @@ bool SquishToolkitsPage::handleReject() void SquishToolkitsPage::delayedInitialize() { - const auto s = SquishPlugin::squishSettings(); - const Utils::FilePath server = s->squishPath().pathAppended( + const Utils::FilePath server = settings().squishPath().pathAppended( Utils::HostOsInfo::withExecutableSuffix("bin/squishserver")); if (server.isExecutableFile()) fetchServerSettings(); diff --git a/src/plugins/squish/suiteconf.cpp b/src/plugins/squish/suiteconf.cpp index b47034e67cc..03a93b6a172 100644 --- a/src/plugins/squish/suiteconf.cpp +++ b/src/plugins/squish/suiteconf.cpp @@ -3,7 +3,6 @@ #include "suiteconf.h" -#include "squishplugin.h" #include "squishsettings.h" #include <coreplugin/documentmanager.h> @@ -314,7 +313,7 @@ bool SuiteConf::ensureObjectMapExists() const return objectMap.parentDir().ensureWritableDir() && objectMap.ensureExistingFile(); } - const Utils::FilePath scripts = SquishPlugin::squishSettings()->scriptsPath(language()); + const Utils::FilePath scripts = settings().scriptsPath(language()); QTC_ASSERT(scripts.exists(), return false); const QString extension = scriptExtension(); From 2b7e8599c8ae363edde5c0f91efafd22e02f8c06 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 09:11:27 +0200 Subject: [PATCH 0391/1777] CppCheck: Move widget creation for manual run closer to its use Change-Id: I08d50f5e4534b8a58d374ae37bfd03dbd234a483 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/cppcheck/cppcheckmanualrundialog.cpp | 6 ++++-- src/plugins/cppcheck/cppcheckmanualrundialog.h | 2 +- src/plugins/cppcheck/cppcheckplugin.cpp | 4 +--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/cppcheck/cppcheckmanualrundialog.cpp b/src/plugins/cppcheck/cppcheckmanualrundialog.cpp index d38a424b6b1..35a057ccffd 100644 --- a/src/plugins/cppcheck/cppcheckmanualrundialog.cpp +++ b/src/plugins/cppcheck/cppcheckmanualrundialog.cpp @@ -10,6 +10,7 @@ #include <cppeditor/projectinfo.h> +#include <utils/layoutbuilder.h> #include <utils/qtcassert.h> #include <QBoxLayout> @@ -18,8 +19,7 @@ namespace Cppcheck::Internal { -ManualRunDialog::ManualRunDialog(QWidget *optionsWidget, - const ProjectExplorer::Project *project) +ManualRunDialog::ManualRunDialog(const ProjectExplorer::Project *project) : m_model(new ProjectExplorer::SelectableFilesFromDirModel(this)) { QTC_ASSERT(project, return ); @@ -52,6 +52,8 @@ ManualRunDialog::ManualRunDialog(QWidget *optionsWidget, analyzeButton->setEnabled(m_model->hasCheckedFiles()); }); + auto optionsWidget = settings().layouter()().emerge(); + auto layout = new QVBoxLayout(this); layout->addWidget(optionsWidget); layout->addWidget(view); diff --git a/src/plugins/cppcheck/cppcheckmanualrundialog.h b/src/plugins/cppcheck/cppcheckmanualrundialog.h index 460a85e75c4..76206578e34 100644 --- a/src/plugins/cppcheck/cppcheckmanualrundialog.h +++ b/src/plugins/cppcheck/cppcheckmanualrundialog.h @@ -20,7 +20,7 @@ namespace Cppcheck::Internal { class ManualRunDialog : public QDialog { public: - ManualRunDialog(QWidget *optionsWidget, const ProjectExplorer::Project *project); + explicit ManualRunDialog(const ProjectExplorer::Project *project); Utils::FilePaths filePaths() const; QSize sizeHint() const override; diff --git a/src/plugins/cppcheck/cppcheckplugin.cpp b/src/plugins/cppcheck/cppcheckplugin.cpp index f8096350293..261eb50b0a5 100644 --- a/src/plugins/cppcheck/cppcheckplugin.cpp +++ b/src/plugins/cppcheck/cppcheckplugin.cpp @@ -112,9 +112,7 @@ void CppcheckPluginPrivate::startManualRun() manualRunTool.updateOptions(); - auto optionsWidget = settings().layouter()().emerge(); - - ManualRunDialog dialog(optionsWidget, project); + ManualRunDialog dialog(project); if (dialog.exec() == ManualRunDialog::Rejected) return; From 74ff10001aba27f3d7b142eedec99927c535965e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 19 Jul 2023 09:05:35 +0200 Subject: [PATCH 0392/1777] Squish: Set only category icon path in settings page ... instead of icon directly. Change-Id: Ie16cb23323bd2ef90b5169ecc0bd8f4fb6d406f0 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/squish/squishsettings.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/squish/squishsettings.cpp b/src/plugins/squish/squishsettings.cpp index 674c4217b06..8d4cfe5ded0 100644 --- a/src/plugins/squish/squishsettings.cpp +++ b/src/plugins/squish/squishsettings.cpp @@ -13,7 +13,6 @@ #include <utils/basetreeview.h> #include <utils/fileutils.h> -#include <utils/icon.h> #include <utils/layoutbuilder.h> #include <utils/progressindicator.h> #include <utils/qtcassert.h> @@ -136,8 +135,7 @@ public: setDisplayName(Tr::tr("General")); setCategory(Constants::SQUISH_SETTINGS_CATEGORY); setDisplayCategory("Squish"); - setCategoryIcon(Icon({{":/squish/images/settingscategory_squish.png", - Theme::PanelTextColorDark}}, Icon::Tint)); + setCategoryIconPath(":/squish/images/settingscategory_squish.png"); setSettingsProvider([] { return &settings(); }); } }; From f10d0bad0180669b76c6c4ad0cfebf4b470a3f62 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 13:54:37 +0200 Subject: [PATCH 0393/1777] TextEditor: Push back explicit use of core settings It's meant to be handled via aspects in the long term. Change-Id: I2a2792f7bb5e75ede18e2328bb31729c212e30e6 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../cppeditor/cppcodestylesettingspage.cpp | 21 +++++++------- src/plugins/cppeditor/cpptoolssettings.cpp | 3 +- .../nim/settings/nimcodestylesettingspage.cpp | 10 ++----- .../qmljstools/qmljscodestylesettingspage.cpp | 8 ++---- src/plugins/qmljstools/qmljstoolssettings.cpp | 3 +- src/plugins/texteditor/behaviorsettings.cpp | 11 ++++---- src/plugins/texteditor/behaviorsettings.h | 8 ++---- .../texteditor/behaviorsettingspage.cpp | 28 ++++++++----------- .../texteditor/extraencodingsettings.cpp | 17 +++++------ .../texteditor/extraencodingsettings.h | 8 ++---- .../texteditor/icodestylepreferences.cpp | 13 +++++---- .../texteditor/icodestylepreferences.h | 5 ++-- src/plugins/texteditor/storagesettings.cpp | 11 ++++---- src/plugins/texteditor/storagesettings.h | 8 ++---- src/plugins/texteditor/typingsettings.cpp | 11 +++++--- src/plugins/texteditor/typingsettings.h | 5 ++-- 16 files changed, 74 insertions(+), 96 deletions(-) diff --git a/src/plugins/cppeditor/cppcodestylesettingspage.cpp b/src/plugins/cppeditor/cppcodestylesettingspage.cpp index 88be950193b..2f49c7eeb4d 100644 --- a/src/plugins/cppeditor/cppcodestylesettingspage.cpp +++ b/src/plugins/cppeditor/cppcodestylesettingspage.cpp @@ -11,8 +11,13 @@ #include "cpppointerdeclarationformatter.h" #include "cpptoolssettings.h" -#include <coreplugin/icore.h> #include <cppeditor/cppeditorconstants.h> + +#include <cplusplus/Overview.h> +#include <cplusplus/pp.h> + +#include <extensionsystem/pluginmanager.h> + #include <texteditor/codestyleeditor.h> #include <texteditor/displaysettings.h> #include <texteditor/fontsettings.h> @@ -23,14 +28,10 @@ #include <texteditor/tabsettingswidget.h> #include <texteditor/textdocument.h> #include <texteditor/texteditorsettings.h> + #include <utils/layoutbuilder.h> #include <utils/qtcassert.h> -#include <cplusplus/Overview.h> -#include <cplusplus/pp.h> - -#include <extensionsystem/pluginmanager.h> - #include <QCheckBox> #include <QTabWidget> #include <QTextBlock> @@ -588,20 +589,18 @@ public: void apply() final { - QSettings *s = Core::ICore::settings(); - CppCodeStylePreferences *originalCppCodeStylePreferences = CppToolsSettings::instance()->cppCodeStyle(); if (originalCppCodeStylePreferences->codeStyleSettings() != m_pageCppCodeStylePreferences->codeStyleSettings()) { originalCppCodeStylePreferences->setCodeStyleSettings(m_pageCppCodeStylePreferences->codeStyleSettings()); - originalCppCodeStylePreferences->toSettings(QLatin1String(CppEditor::Constants::CPP_SETTINGS_ID), s); + originalCppCodeStylePreferences->toSettings(QLatin1String(CppEditor::Constants::CPP_SETTINGS_ID)); } if (originalCppCodeStylePreferences->tabSettings() != m_pageCppCodeStylePreferences->tabSettings()) { originalCppCodeStylePreferences->setTabSettings(m_pageCppCodeStylePreferences->tabSettings()); - originalCppCodeStylePreferences->toSettings(QLatin1String(CppEditor::Constants::CPP_SETTINGS_ID), s); + originalCppCodeStylePreferences->toSettings(QLatin1String(CppEditor::Constants::CPP_SETTINGS_ID)); } if (originalCppCodeStylePreferences->currentDelegate() != m_pageCppCodeStylePreferences->currentDelegate()) { originalCppCodeStylePreferences->setCurrentDelegate(m_pageCppCodeStylePreferences->currentDelegate()); - originalCppCodeStylePreferences->toSettings(QLatin1String(CppEditor::Constants::CPP_SETTINGS_ID), s); + originalCppCodeStylePreferences->toSettings(QLatin1String(CppEditor::Constants::CPP_SETTINGS_ID)); } m_codeStyleEditor->apply(); diff --git a/src/plugins/cppeditor/cpptoolssettings.cpp b/src/plugins/cppeditor/cpptoolssettings.cpp index 0b5536fdd72..5dd22b6aae8 100644 --- a/src/plugins/cppeditor/cpptoolssettings.cpp +++ b/src/plugins/cppeditor/cpptoolssettings.cpp @@ -130,9 +130,8 @@ CppToolsSettings::CppToolsSettings() pool->loadCustomCodeStyles(); - QSettings *s = ICore::settings(); // load global settings (after built-in settings are added to the pool) - d->m_globalCodeStyle->fromSettings(QLatin1String(Constants::CPP_SETTINGS_ID), s); + d->m_globalCodeStyle->fromSettings(QLatin1String(Constants::CPP_SETTINGS_ID)); // mimetypes to be handled TextEditorSettings::registerMimeTypeForLanguageId(Constants::C_SOURCE_MIMETYPE, Constants::CPP_SETTINGS_ID); diff --git a/src/plugins/nim/settings/nimcodestylesettingspage.cpp b/src/plugins/nim/settings/nimcodestylesettingspage.cpp index 32e9525014c..c2b0d6d194b 100644 --- a/src/plugins/nim/settings/nimcodestylesettingspage.cpp +++ b/src/plugins/nim/settings/nimcodestylesettingspage.cpp @@ -67,8 +67,7 @@ static void createGlobalCodeStyle() pool->loadCustomCodeStyles(); // load global settings (after built-in settings are added to the pool) - QSettings *s = Core::ICore::settings(); - m_globalCodeStyle->fromSettings(QLatin1String(Nim::Constants::C_NIMLANGUAGE_ID), s); + m_globalCodeStyle->fromSettings(QLatin1String(Nim::Constants::C_NIMLANGUAGE_ID)); TextEditorSettings::registerMimeTypeForLanguageId(Nim::Constants::C_NIM_MIMETYPE, Nim::Constants::C_NIMLANGUAGE_ID); @@ -107,17 +106,12 @@ public: auto layout = new QVBoxLayout(this); layout->addWidget(editor); - - QTC_ASSERT(m_globalCodeStyle, return); - QSettings *s = Core::ICore::settings(); - m_globalCodeStyle->toSettings(QLatin1String(Nim::Constants::C_NIMLANGUAGE_ID), s); } void apply() final { QTC_ASSERT(m_globalCodeStyle, return); - QSettings *s = Core::ICore::settings(); - m_globalCodeStyle->toSettings(QLatin1String(Nim::Constants::C_NIMLANGUAGE_ID), s); + m_globalCodeStyle->toSettings(QLatin1String(Nim::Constants::C_NIMLANGUAGE_ID)); } private: diff --git a/src/plugins/qmljstools/qmljscodestylesettingspage.cpp b/src/plugins/qmljstools/qmljscodestylesettingspage.cpp index fc97aa53c82..a48ce825ea4 100644 --- a/src/plugins/qmljstools/qmljscodestylesettingspage.cpp +++ b/src/plugins/qmljstools/qmljscodestylesettingspage.cpp @@ -144,20 +144,18 @@ public: void apply() final { - QSettings *s = Core::ICore::settings(); - QmlJSCodeStylePreferences *originalPreferences = QmlJSToolsSettings::globalCodeStyle(); if (originalPreferences->codeStyleSettings() != m_preferences.codeStyleSettings()) { originalPreferences->setCodeStyleSettings(m_preferences.codeStyleSettings()); - originalPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID), s); + originalPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID)); } if (originalPreferences->tabSettings() != m_preferences.tabSettings()) { originalPreferences->setTabSettings(m_preferences.tabSettings()); - originalPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID), s); + originalPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID)); } if (originalPreferences->currentDelegate() != m_preferences.currentDelegate()) { originalPreferences->setCurrentDelegate(m_preferences.currentDelegate()); - originalPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID), s); + originalPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID)); } } diff --git a/src/plugins/qmljstools/qmljstoolssettings.cpp b/src/plugins/qmljstools/qmljstoolssettings.cpp index caeb6dfa26f..5a7e0ac309e 100644 --- a/src/plugins/qmljstools/qmljstoolssettings.cpp +++ b/src/plugins/qmljstools/qmljstoolssettings.cpp @@ -68,8 +68,7 @@ QmlJSToolsSettings::QmlJSToolsSettings() pool->loadCustomCodeStyles(); // load global settings (after built-in settings are added to the pool) - QSettings *s = Core::ICore::settings(); - m_globalCodeStyle->fromSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID), s); + m_globalCodeStyle->fromSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID)); // mimetypes to be handled TextEditorSettings::registerMimeTypeForLanguageId(Constants::QML_MIMETYPE, Constants::QML_JS_SETTINGS_ID); diff --git a/src/plugins/texteditor/behaviorsettings.cpp b/src/plugins/texteditor/behaviorsettings.cpp index d04b4824fe6..635ddea0a23 100644 --- a/src/plugins/texteditor/behaviorsettings.cpp +++ b/src/plugins/texteditor/behaviorsettings.cpp @@ -3,9 +3,10 @@ #include "behaviorsettings.h" +#include <coreplugin/icore.h> + #include <utils/settingsutils.h> -#include <QSettings> #include <QString> static const char mouseHidingKey[] = "MouseHiding"; @@ -30,15 +31,15 @@ BehaviorSettings::BehaviorSettings() : { } -void BehaviorSettings::toSettings(const QString &category, QSettings *s) const +void BehaviorSettings::toSettings(const QString &category) const { - Utils::toSettings(QLatin1String(groupPostfix), category, s, this); + Utils::toSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); } -void BehaviorSettings::fromSettings(const QString &category, QSettings *s) +void BehaviorSettings::fromSettings(const QString &category) { *this = BehaviorSettings(); - Utils::fromSettings(QLatin1String(groupPostfix), category, s, this); + Utils::fromSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); } QVariantMap BehaviorSettings::toMap() const diff --git a/src/plugins/texteditor/behaviorsettings.h b/src/plugins/texteditor/behaviorsettings.h index 678ec7b37f7..ec4746c6115 100644 --- a/src/plugins/texteditor/behaviorsettings.h +++ b/src/plugins/texteditor/behaviorsettings.h @@ -7,10 +7,6 @@ #include <QVariantMap> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - namespace TextEditor { /** @@ -22,8 +18,8 @@ class TEXTEDITOR_EXPORT BehaviorSettings public: BehaviorSettings(); - void toSettings(const QString &category, QSettings *s) const; - void fromSettings(const QString &category, QSettings *s); + void toSettings(const QString &category) const; + void fromSettings(const QString &category); QVariantMap toMap() const; void fromMap(const QVariantMap &map); diff --git a/src/plugins/texteditor/behaviorsettingspage.cpp b/src/plugins/texteditor/behaviorsettingspage.cpp index 73675e2cdb9..2fcbdab4ccb 100644 --- a/src/plugins/texteditor/behaviorsettingspage.cpp +++ b/src/plugins/texteditor/behaviorsettingspage.cpp @@ -31,7 +31,6 @@ #include <QCoreApplication> #include <QGridLayout> #include <QPointer> -#include <QSettings> #include <QSpacerItem> namespace TextEditor { @@ -64,12 +63,11 @@ BehaviorSettingsPagePrivate::BehaviorSettingsPagePrivate() m_defaultCodeStylePool = new CodeStylePool(nullptr, this); // Any language m_defaultCodeStylePool->addCodeStyle(m_codeStyle); - QSettings * const s = Core::ICore::settings(); - m_codeStyle->fromSettings(m_settingsPrefix, s); - m_typingSettings.fromSettings(m_settingsPrefix, s); - m_storageSettings.fromSettings(m_settingsPrefix, s); - m_behaviorSettings.fromSettings(m_settingsPrefix, s); - m_extraEncodingSettings.fromSettings(m_settingsPrefix, s); + m_codeStyle->fromSettings(m_settingsPrefix); + m_typingSettings.fromSettings(m_settingsPrefix); + m_storageSettings.fromSettings(m_settingsPrefix); + m_behaviorSettings.fromSettings(m_settingsPrefix); + m_extraEncodingSettings.fromSettings(m_settingsPrefix); } class BehaviorSettingsWidgetImpl : public Core::IOptionsPageWidget @@ -153,47 +151,45 @@ void BehaviorSettingsWidgetImpl::apply() d->m_behaviorWidget->assignedBehaviorSettings(&newBehaviorSettings); d->m_behaviorWidget->assignedExtraEncodingSettings(&newExtraEncodingSettings); - QSettings *s = Core::ICore::settings(); - QTC_ASSERT(s, return); - if (d->m_codeStyle->tabSettings() != d->m_pageCodeStyle->tabSettings()) { d->m_codeStyle->setTabSettings(d->m_pageCodeStyle->tabSettings()); - d->m_codeStyle->toSettings(d->m_settingsPrefix, s); + d->m_codeStyle->toSettings(d->m_settingsPrefix); } if (d->m_codeStyle->currentDelegate() != d->m_pageCodeStyle->currentDelegate()) { d->m_codeStyle->setCurrentDelegate(d->m_pageCodeStyle->currentDelegate()); - d->m_codeStyle->toSettings(d->m_settingsPrefix, s); + d->m_codeStyle->toSettings(d->m_settingsPrefix); } if (newTypingSettings != d->m_typingSettings) { d->m_typingSettings = newTypingSettings; - d->m_typingSettings.toSettings(d->m_settingsPrefix, s); + d->m_typingSettings.toSettings(d->m_settingsPrefix); emit TextEditorSettings::instance()->typingSettingsChanged(newTypingSettings); } if (newStorageSettings != d->m_storageSettings) { d->m_storageSettings = newStorageSettings; - d->m_storageSettings.toSettings(d->m_settingsPrefix, s); + d->m_storageSettings.toSettings(d->m_settingsPrefix); emit TextEditorSettings::instance()->storageSettingsChanged(newStorageSettings); } if (newBehaviorSettings != d->m_behaviorSettings) { d->m_behaviorSettings = newBehaviorSettings; - d->m_behaviorSettings.toSettings(d->m_settingsPrefix, s); + d->m_behaviorSettings.toSettings(d->m_settingsPrefix); emit TextEditorSettings::instance()->behaviorSettingsChanged(newBehaviorSettings); } if (newExtraEncodingSettings != d->m_extraEncodingSettings) { d->m_extraEncodingSettings = newExtraEncodingSettings; - d->m_extraEncodingSettings.toSettings(d->m_settingsPrefix, s); + d->m_extraEncodingSettings.toSettings(d->m_settingsPrefix); emit TextEditorSettings::instance()->extraEncodingSettingsChanged(newExtraEncodingSettings); } + QSettings *s = Core::ICore::settings(); s->setValue(QLatin1String(Core::Constants::SETTINGS_DEFAULTTEXTENCODING), d->m_behaviorWidget->assignedCodecName()); s->setValue(QLatin1String(Core::Constants::SETTINGS_DEFAULT_LINE_TERMINATOR), diff --git a/src/plugins/texteditor/extraencodingsettings.cpp b/src/plugins/texteditor/extraencodingsettings.cpp index 349d37a39ef..638f749d7e0 100644 --- a/src/plugins/texteditor/extraencodingsettings.cpp +++ b/src/plugins/texteditor/extraencodingsettings.cpp @@ -6,35 +6,34 @@ #include "behaviorsettingswidget.h" #include "texteditortr.h" -#include <utils/settingsutils.h> +#include <coreplugin/icore.h> -#include <QLatin1String> -#include <QSettings> +#include <utils/settingsutils.h> // Keep this for compatibility reasons. static const char kGroupPostfix[] = "EditorManager"; static const char kUtf8BomBehaviorKey[] = "Utf8BomBehavior"; -using namespace TextEditor; +namespace TextEditor { ExtraEncodingSettings::ExtraEncodingSettings() : m_utf8BomSetting(OnlyKeep) {} ExtraEncodingSettings::~ExtraEncodingSettings() = default; -void ExtraEncodingSettings::toSettings(const QString &category, QSettings *s) const +void ExtraEncodingSettings::toSettings(const QString &category) const { Q_UNUSED(category) - Utils::toSettings(QLatin1String(kGroupPostfix), QString(), s, this); + Utils::toSettings(QLatin1String(kGroupPostfix), QString(), Core::ICore::settings(), this); } -void ExtraEncodingSettings::fromSettings(const QString &category, QSettings *s) +void ExtraEncodingSettings::fromSettings(const QString &category) { Q_UNUSED(category) *this = ExtraEncodingSettings(); - Utils::fromSettings(QLatin1String(kGroupPostfix), QString(), s, this); + Utils::fromSettings(QLatin1String(kGroupPostfix), QString(), Core::ICore::settings(), this); } QVariantMap ExtraEncodingSettings::toMap() const @@ -58,3 +57,5 @@ QStringList ExtraEncodingSettings::lineTerminationModeNames() { return {Tr::tr("Unix (LF)"), Tr::tr("Windows (CRLF)")}; } + +} // TextEditor diff --git a/src/plugins/texteditor/extraencodingsettings.h b/src/plugins/texteditor/extraencodingsettings.h index 15fd357a9ff..8f905e7a942 100644 --- a/src/plugins/texteditor/extraencodingsettings.h +++ b/src/plugins/texteditor/extraencodingsettings.h @@ -7,10 +7,6 @@ #include <QVariantMap> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - namespace TextEditor { class TEXTEDITOR_EXPORT ExtraEncodingSettings @@ -19,8 +15,8 @@ public: ExtraEncodingSettings(); ~ExtraEncodingSettings(); - void toSettings(const QString &category, QSettings *s) const; - void fromSettings(const QString &category, QSettings *s); + void toSettings(const QString &category) const; + void fromSettings(const QString &category); QVariantMap toMap() const; void fromMap(const QVariantMap &map); diff --git a/src/plugins/texteditor/icodestylepreferences.cpp b/src/plugins/texteditor/icodestylepreferences.cpp index 29a524ebf68..1d92095d5a3 100644 --- a/src/plugins/texteditor/icodestylepreferences.cpp +++ b/src/plugins/texteditor/icodestylepreferences.cpp @@ -4,9 +4,10 @@ #include "icodestylepreferences.h" #include "codestylepool.h" #include "tabsettings.h" -#include <utils/settingsutils.h> -#include <QSettings> +#include <coreplugin/icore.h> + +#include <utils/settingsutils.h> using namespace TextEditor; @@ -211,14 +212,14 @@ void ICodeStylePreferences::setSettingsSuffix(const QString &suffix) d->m_settingsSuffix = suffix; } -void ICodeStylePreferences::toSettings(const QString &category, QSettings *s) const +void ICodeStylePreferences::toSettings(const QString &category) const { - Utils::toSettings(d->m_settingsSuffix, category, s, this); + Utils::toSettings(d->m_settingsSuffix, category, Core::ICore::settings(), this); } -void ICodeStylePreferences::fromSettings(const QString &category, QSettings *s) +void ICodeStylePreferences::fromSettings(const QString &category) { - Utils::fromSettings(d->m_settingsSuffix, category, s, this); + Utils::fromSettings(d->m_settingsSuffix, category, Core::ICore::settings(), this); } QVariantMap ICodeStylePreferences::toMap() const diff --git a/src/plugins/texteditor/icodestylepreferences.h b/src/plugins/texteditor/icodestylepreferences.h index 7fd616d5604..329e7eb4e5d 100644 --- a/src/plugins/texteditor/icodestylepreferences.h +++ b/src/plugins/texteditor/icodestylepreferences.h @@ -9,7 +9,6 @@ QT_BEGIN_NAMESPACE class QVariant; -class QSettings; QT_END_NAMESPACE namespace TextEditor { @@ -64,8 +63,8 @@ public: void setCurrentDelegate(const QByteArray &id); void setSettingsSuffix(const QString &suffix); - void toSettings(const QString &category, QSettings *s) const; - void fromSettings(const QString &category, QSettings *s); + void toSettings(const QString &category) const; + void fromSettings(const QString &category); // make below 2 protected? virtual QVariantMap toMap() const; diff --git a/src/plugins/texteditor/storagesettings.cpp b/src/plugins/texteditor/storagesettings.cpp index 1e26119189c..adaf0be1030 100644 --- a/src/plugins/texteditor/storagesettings.cpp +++ b/src/plugins/texteditor/storagesettings.cpp @@ -3,11 +3,12 @@ #include "storagesettings.h" +#include <coreplugin/icore.h> + #include <utils/hostosinfo.h> #include <utils/settingsutils.h> #include <QRegularExpression> -#include <QSettings> #include <QString> namespace TextEditor { @@ -31,15 +32,15 @@ StorageSettings::StorageSettings() { } -void StorageSettings::toSettings(const QString &category, QSettings *s) const +void StorageSettings::toSettings(const QString &category) const { - Utils::toSettings(QLatin1String(groupPostfix), category, s, this); + Utils::toSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); } -void StorageSettings::fromSettings(const QString &category, QSettings *s) +void StorageSettings::fromSettings(const QString &category) { *this = StorageSettings(); - Utils::fromSettings(QLatin1String(groupPostfix), category, s, this); + Utils::fromSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); } QVariantMap StorageSettings::toMap() const diff --git a/src/plugins/texteditor/storagesettings.h b/src/plugins/texteditor/storagesettings.h index 53040f5c7d8..522c1039172 100644 --- a/src/plugins/texteditor/storagesettings.h +++ b/src/plugins/texteditor/storagesettings.h @@ -7,10 +7,6 @@ #include <QVariantMap> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - namespace TextEditor { class TEXTEDITOR_EXPORT StorageSettings @@ -18,8 +14,8 @@ class TEXTEDITOR_EXPORT StorageSettings public: StorageSettings(); - void toSettings(const QString &category, QSettings *s) const; - void fromSettings(const QString &category, QSettings *s); + void toSettings(const QString &category) const; + void fromSettings(const QString &category); QVariantMap toMap() const; void fromMap(const QVariantMap &map); diff --git a/src/plugins/texteditor/typingsettings.cpp b/src/plugins/texteditor/typingsettings.cpp index e5db1a7129f..83bbb800222 100644 --- a/src/plugins/texteditor/typingsettings.cpp +++ b/src/plugins/texteditor/typingsettings.cpp @@ -3,7 +3,10 @@ #include "typingsettings.h" +#include <coreplugin/icore.h> + #include <utils/settingsutils.h> + #include <QTextCursor> #include <QTextDocument> @@ -24,15 +27,15 @@ TypingSettings::TypingSettings(): { } -void TypingSettings::toSettings(const QString &category, QSettings *s) const +void TypingSettings::toSettings(const QString &category) const { - Utils::toSettings(QLatin1String(groupPostfix), category, s, this); + Utils::toSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); } -void TypingSettings::fromSettings(const QString &category, QSettings *s) +void TypingSettings::fromSettings(const QString &category) { *this = TypingSettings(); // Assign defaults - Utils::fromSettings(QLatin1String(groupPostfix), category, s, this); + Utils::fromSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); } QVariantMap TypingSettings::toMap() const diff --git a/src/plugins/texteditor/typingsettings.h b/src/plugins/texteditor/typingsettings.h index 5af7ff3a413..03d3989b814 100644 --- a/src/plugins/texteditor/typingsettings.h +++ b/src/plugins/texteditor/typingsettings.h @@ -8,7 +8,6 @@ #include <QVariantMap> QT_BEGIN_NAMESPACE -class QSettings; class QTextDocument; class QTextCursor; QT_END_NAMESPACE @@ -36,8 +35,8 @@ public: bool tabShouldIndent(const QTextDocument *document, const QTextCursor &cursor, int *suggestedPosition) const; - void toSettings(const QString &category, QSettings *s) const; - void fromSettings(const QString &category, QSettings *s); + void toSettings(const QString &category) const; + void fromSettings(const QString &category); QVariantMap toMap() const; void fromMap(const QVariantMap &map); From cd8bb1d92303b47cf23c2a2c0f3b6624dade6001 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 5 Jun 2023 18:54:37 +0200 Subject: [PATCH 0394/1777] ExampleCheckout: Replace the usage of Archive with Unarchiver Change-Id: I76550b618bcc631fc9575343eb4b8552cb21a018 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/studiowelcome/examplecheckout.cpp | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/plugins/studiowelcome/examplecheckout.cpp b/src/plugins/studiowelcome/examplecheckout.cpp index b919bf29394..c22156a91c7 100644 --- a/src/plugins/studiowelcome/examplecheckout.cpp +++ b/src/plugins/studiowelcome/examplecheckout.cpp @@ -66,11 +66,11 @@ QString DataModelDownloader::targetPath() const return QmlDesigner::Paths::examplesPathSetting(); } -static Utils::FilePath tempFilePath() +static FilePath tempFilePath() { QStandardPaths::StandardLocation location = QStandardPaths::CacheLocation; - return Utils::FilePath::fromString(QStandardPaths::writableLocation(location)) + return FilePath::fromString(QStandardPaths::writableLocation(location)) .pathAppended("QtDesignStudio"); } @@ -118,17 +118,18 @@ DataModelDownloader::DataModelDownloader(QObject * /* parent */) m_started = false; if (m_fileDownloader.finished()) { - const Utils::FilePath archiveFile = Utils::FilePath::fromString( - m_fileDownloader.outputFile()); - QTC_ASSERT(Utils::Archive::supportsFile(archiveFile), return ); - auto archive = new Utils::Archive(archiveFile, tempFilePath()); - QTC_ASSERT(archive->isValid(), delete archive; return ); - QObject::connect(archive, &Utils::Archive::finished, this, [this, archive](bool ret) { - QTC_CHECK(ret); - archive->deleteLater(); + const FilePath archiveFile = FilePath::fromString(m_fileDownloader.outputFile()); + const auto sourceAndCommand = Unarchiver::sourceAndCommand(archiveFile); + QTC_ASSERT(sourceAndCommand, return); + auto unarchiver = new Unarchiver; + unarchiver->setSourceAndCommand(*sourceAndCommand); + unarchiver->setDestDir(tempFilePath()); + QObject::connect(unarchiver, &Unarchiver::done, this, [this, unarchiver](bool success) { + QTC_CHECK(success); + unarchiver->deleteLater(); emit finished(); }); - archive->unarchive(); + unarchiver->start(); } }); } @@ -180,9 +181,9 @@ bool DataModelDownloader::available() const return m_available; } -Utils::FilePath DataModelDownloader::targetFolder() const +FilePath DataModelDownloader::targetFolder() const { - return Utils::FilePath::fromUserInput(tempFilePath().toString() + "/" + "dataImports"); + return FilePath::fromUserInput(tempFilePath().toString() + "/" + "dataImports"); } void DataModelDownloader::setForceDownload(bool b) From 694c29d67be8c982b6675da8c3766369ef89edc4 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 7 Jun 2023 10:24:52 +0200 Subject: [PATCH 0395/1777] Utils: Get rid of Archive Use Unarchiver instead. Change-Id: I7544b36ca11578d7ae7eb8571e6fe823cf74dee1 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/archive.cpp | 81 -------------------------------------- src/libs/utils/archive.h | 22 ----------- 2 files changed, 103 deletions(-) diff --git a/src/libs/utils/archive.cpp b/src/libs/utils/archive.cpp index b86a7ab0b89..5086ce5358b 100644 --- a/src/libs/utils/archive.cpp +++ b/src/libs/utils/archive.cpp @@ -98,87 +98,6 @@ static std::optional<Tool> resolveTool(const Tool &tool) return executable.isEmpty() ? std::nullopt : std::make_optional(resolvedTool); } -static std::optional<Tool> unzipTool(const FilePath &src, const FilePath &dest) -{ - const QVector<Tool> tools = toolsForFilePath(src); - for (const Tool &tool : tools) { - const std::optional<Tool> resolvedTool = resolveTool(tool); - if (resolvedTool) { - Tool result = *resolvedTool; - const QString srcStr = src.path(); - const QString destStr = dest.path(); - const QString args = result.command.arguments().replace("%{src}", srcStr).replace("%{dest}", destStr); - result.command.setArguments(args); - return result; - } - } - return {}; -} - -bool Archive::supportsFile(const FilePath &filePath, QString *reason) -{ - const QVector<Tool> tools = toolsForFilePath(filePath); - if (tools.isEmpty()) { - if (reason) - *reason = Tr::tr("File format not supported."); - return false; - } - if (!anyOf(tools, [tools](const Tool &t) { return resolveTool(t); })) { - if (reason) { - const QStringList execs = transform<QStringList>(tools, [](const Tool &tool) { - return tool.command.executable().toUserOutput(); - }); - *reason = Tr::tr("Could not find any unarchiving executable in PATH (%1).") - .arg(execs.join(", ")); - } - return false; - } - return true; -} - -Archive::Archive(const FilePath &src, const FilePath &dest) -{ - const std::optional<Tool> tool = unzipTool(src, dest); - if (!tool) - return; - m_commandLine = tool->command; - m_workingDirectory = dest.absoluteFilePath(); -} - -Archive::~Archive() = default; - -bool Archive::isValid() const -{ - return !m_commandLine.isEmpty(); -} - -void Archive::unarchive() -{ - QTC_ASSERT(isValid(), return); - QTC_ASSERT(!m_process, return); - - m_workingDirectory.ensureWritableDir(); - - m_process.reset(new Process); - m_process->setProcessChannelMode(QProcess::MergedChannels); - QObject::connect(m_process.get(), &Process::readyReadStandardOutput, this, [this] { - emit outputReceived(m_process->readAllStandardOutput()); - }); - QObject::connect(m_process.get(), &Process::done, this, [this] { - const bool successfulFinish = m_process->result() == ProcessResult::FinishedWithSuccess; - if (!successfulFinish) - emit outputReceived(Tr::tr("Command failed.")); - emit finished(successfulFinish); - }); - - emit outputReceived(Tr::tr("Running %1\nin \"%2\".\n\n", "Running <cmd> in <workingdirectory>") - .arg(m_commandLine.toUserOutput(), m_workingDirectory.toUserOutput())); - - m_process->setCommand(m_commandLine); - m_process->setWorkingDirectory(m_workingDirectory); - m_process->start(); -} - expected_str<Unarchiver::SourceAndCommand> Unarchiver::sourceAndCommand(const FilePath &sourceFile) { const QVector<Tool> tools = toolsForFilePath(sourceFile); diff --git a/src/libs/utils/archive.h b/src/libs/utils/archive.h index b40d26c7a4b..0890bafa743 100644 --- a/src/libs/utils/archive.h +++ b/src/libs/utils/archive.h @@ -14,28 +14,6 @@ namespace Utils { -class QTCREATOR_UTILS_EXPORT Archive : public QObject -{ - Q_OBJECT -public: - Archive(const FilePath &src, const FilePath &dest); - ~Archive(); - - bool isValid() const; - void unarchive(); - - static bool supportsFile(const FilePath &filePath, QString *reason = nullptr); - -signals: - void outputReceived(const QString &output); - void finished(bool success); - -private: - CommandLine m_commandLine; - FilePath m_workingDirectory; - std::unique_ptr<Process> m_process; -}; - class QTCREATOR_UTILS_EXPORT Unarchiver : public QObject { Q_OBJECT From 6bb8bbabd2f99ae2fdae8c5b1c0b5fe4a13e35aa Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 7 Jun 2023 10:28:57 +0200 Subject: [PATCH 0396/1777] Utils: Rename archive.{cpp, h} -> unarchiver.{cpp, h} Change-Id: I0c3fdb68a15a6ad7419405d2bef86d4e75537df5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/libs/utils/CMakeLists.txt | 2 +- src/libs/utils/{archive.cpp => unarchiver.cpp} | 2 +- src/libs/utils/{archive.h => unarchiver.h} | 0 src/libs/utils/utils.qbs | 4 ++-- src/plugins/android/androidsdkdownloader.cpp | 2 +- src/plugins/coreplugin/plugininstallwizard.cpp | 2 +- src/plugins/qmldesigner/utils/fileextractor.cpp | 2 +- src/plugins/studiowelcome/examplecheckout.cpp | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename src/libs/utils/{archive.cpp => unarchiver.cpp} (99%) rename src/libs/utils/{archive.h => unarchiver.h} (100%) diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 1e9affd09fd..357ca1f85b9 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -10,7 +10,6 @@ add_qtc_library(Utils ansiescapecodehandler.cpp ansiescapecodehandler.h appinfo.cpp appinfo.h appmainwindow.cpp appmainwindow.h - archive.cpp archive.h aspects.cpp aspects.h async.cpp async.h basetreeview.cpp basetreeview.h @@ -186,6 +185,7 @@ add_qtc_library(Utils transientscroll.cpp transientscroll.h treemodel.cpp treemodel.h treeviewcombobox.cpp treeviewcombobox.h + unarchiver.cpp unarchiver.h uncommentselection.cpp uncommentselection.h uniqueobjectptr.h unixutils.cpp unixutils.h diff --git a/src/libs/utils/archive.cpp b/src/libs/utils/unarchiver.cpp similarity index 99% rename from src/libs/utils/archive.cpp rename to src/libs/utils/unarchiver.cpp index 5086ce5358b..b7a43017178 100644 --- a/src/libs/utils/archive.cpp +++ b/src/libs/utils/unarchiver.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "archive.h" +#include "unarchiver.h" #include "algorithm.h" #include "mimeutils.h" diff --git a/src/libs/utils/archive.h b/src/libs/utils/unarchiver.h similarity index 100% rename from src/libs/utils/archive.h rename to src/libs/utils/unarchiver.h diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index f9e22e82bfd..da82da0608c 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -47,8 +47,6 @@ Project { "appinfo.h", "appmainwindow.cpp", "appmainwindow.h", - "archive.cpp", - "archive.h", "aspects.cpp", "aspects.h", "async.cpp", @@ -333,6 +331,8 @@ Project { "treeviewcombobox.h", "headerviewstretcher.cpp", "headerviewstretcher.h", + "unarchiver.cpp", + "unarchiver.h", "uncommentselection.cpp", "uncommentselection.h", "uniqueobjectptr.h", diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp index 8f2821160da..4e465514622 100644 --- a/src/plugins/android/androidsdkdownloader.cpp +++ b/src/plugins/android/androidsdkdownloader.cpp @@ -7,9 +7,9 @@ #include <solutions/tasking/networkquery.h> -#include <utils/archive.h> #include <utils/filepath.h> #include <utils/networkaccessmanager.h> +#include <utils/unarchiver.h> #include <coreplugin/icore.h> diff --git a/src/plugins/coreplugin/plugininstallwizard.cpp b/src/plugins/coreplugin/plugininstallwizard.cpp index 9aa067a45ca..d58e02e7518 100644 --- a/src/plugins/coreplugin/plugininstallwizard.cpp +++ b/src/plugins/coreplugin/plugininstallwizard.cpp @@ -10,7 +10,6 @@ #include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginspec.h> -#include <utils/archive.h> #include <utils/async.h> #include <utils/fileutils.h> #include <utils/hostosinfo.h> @@ -20,6 +19,7 @@ #include <utils/process.h> #include <utils/qtcassert.h> #include <utils/temporarydirectory.h> +#include <utils/unarchiver.h> #include <utils/wizard.h> #include <utils/wizardpage.h> diff --git a/src/plugins/qmldesigner/utils/fileextractor.cpp b/src/plugins/qmldesigner/utils/fileextractor.cpp index bbea7edc2cb..11827fca021 100644 --- a/src/plugins/qmldesigner/utils/fileextractor.cpp +++ b/src/plugins/qmldesigner/utils/fileextractor.cpp @@ -8,9 +8,9 @@ #include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginspec.h> -#include <utils/archive.h> #include <utils/fileutils.h> #include <utils/qtcassert.h> +#include <utils/unarchiver.h> using namespace Utils; diff --git a/src/plugins/studiowelcome/examplecheckout.cpp b/src/plugins/studiowelcome/examplecheckout.cpp index c22156a91c7..52ad72ce8a8 100644 --- a/src/plugins/studiowelcome/examplecheckout.cpp +++ b/src/plugins/studiowelcome/examplecheckout.cpp @@ -11,10 +11,10 @@ #include <studiosettingspage.h> #include <qmldesignerbase/qmldesignerbaseplugin.h> -#include <utils/archive.h> #include <utils/algorithm.h> #include <utils/networkaccessmanager.h> #include <utils/qtcassert.h> +#include <utils/unarchiver.h> #include <private/qqmldata_p.h> From 9f3e0db3e4b5e21f30b7d7e2f4da33e1658147ad Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 13 Jul 2023 17:50:21 +0200 Subject: [PATCH 0397/1777] Unarchiver: Replace QVector with QList Change-Id: Ib8a954f1b29ee475b645191424eb0e391dbb6baf Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/unarchiver.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/utils/unarchiver.cpp b/src/libs/utils/unarchiver.cpp index b7a43017178..9435bc77a51 100644 --- a/src/libs/utils/unarchiver.cpp +++ b/src/libs/utils/unarchiver.cpp @@ -37,9 +37,9 @@ static FilePaths additionalInstallDirs(const QString ®istryKey, const QString #endif } -static const QVector<Tool> &sTools() +static const QList<Tool> &sTools() { - static QVector<Tool> tools; + static QList<Tool> tools; if (tools.isEmpty()) { if (HostOsInfo::isWindowsHost()) { tools << Tool{{"powershell", "-command Expand-Archive -Force '%{src}' '%{dest}'", CommandLine::Raw}, @@ -76,7 +76,7 @@ static const QVector<Tool> &sTools() return tools; } -static QVector<Tool> toolsForMimeType(const MimeType &mimeType) +static QList<Tool> toolsForMimeType(const MimeType &mimeType) { return Utils::filtered(sTools(), [mimeType](const Tool &tool) { return Utils::anyOf(tool.supportedMimeTypes, @@ -84,7 +84,7 @@ static QVector<Tool> toolsForMimeType(const MimeType &mimeType) }); } -static QVector<Tool> toolsForFilePath(const FilePath &fp) +static QList<Tool> toolsForFilePath(const FilePath &fp) { return toolsForMimeType(mimeTypeForFile(fp)); } @@ -100,7 +100,7 @@ static std::optional<Tool> resolveTool(const Tool &tool) expected_str<Unarchiver::SourceAndCommand> Unarchiver::sourceAndCommand(const FilePath &sourceFile) { - const QVector<Tool> tools = toolsForFilePath(sourceFile); + const QList<Tool> tools = toolsForFilePath(sourceFile); if (tools.isEmpty()) return make_unexpected(Tr::tr("File format not supported.")); From 944a1e8a11b21403be22e220c12ad48806117dac Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 09:23:10 +0200 Subject: [PATCH 0398/1777] Android: Remove a few unnecessay Q_OBJECT Change-Id: Ic57a7cfc58d741547cb793b24ff1358d900eaf5d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/android/androidmanifesteditorwidget.h | 1 - src/plugins/android/androidsdkmanagerwidget.h | 2 -- src/plugins/android/androidsdkmodel.h | 2 -- src/plugins/android/androidsignaloperation.h | 1 - src/plugins/android/avddialog.h | 3 ++- 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugins/android/androidmanifesteditorwidget.h b/src/plugins/android/androidmanifesteditorwidget.h index 1cce7157e44..23b8cdce05d 100644 --- a/src/plugins/android/androidmanifesteditorwidget.h +++ b/src/plugins/android/androidmanifesteditorwidget.h @@ -37,7 +37,6 @@ class SplashScreenContainerWidget; class PermissionsModel: public QAbstractListModel { - Q_OBJECT public: PermissionsModel(QObject *parent = nullptr); void setPermissions(const QStringList &permissions); diff --git a/src/plugins/android/androidsdkmanagerwidget.h b/src/plugins/android/androidsdkmanagerwidget.h index 9346bfcd944..718d5390d69 100644 --- a/src/plugins/android/androidsdkmanagerwidget.h +++ b/src/plugins/android/androidsdkmanagerwidget.h @@ -43,8 +43,6 @@ class AndroidSdkModel; class OptionsDialog : public QDialog { - Q_OBJECT - public: OptionsDialog(AndroidSdkManager *sdkManager, const QStringList &args, QWidget *parent = nullptr); diff --git a/src/plugins/android/androidsdkmodel.h b/src/plugins/android/androidsdkmodel.h index 49bdef0ded1..36dbe27b312 100644 --- a/src/plugins/android/androidsdkmodel.h +++ b/src/plugins/android/androidsdkmodel.h @@ -15,7 +15,6 @@ class AndroidSdkManager; class AndroidSdkModel : public QAbstractItemModel { - Q_OBJECT public: enum PackageColumn { packageNameColumn = 0, @@ -53,7 +52,6 @@ private: void clearContainers(); void refreshData(); -private: const AndroidConfig &m_config; AndroidSdkManager *m_sdkManager; QList<const SdkPlatform *> m_sdkPlatforms; diff --git a/src/plugins/android/androidsignaloperation.h b/src/plugins/android/androidsignaloperation.h index 1c3bb48454c..2a6e3ddb6cf 100644 --- a/src/plugins/android/androidsignaloperation.h +++ b/src/plugins/android/androidsignaloperation.h @@ -13,7 +13,6 @@ namespace Internal { class AndroidSignalOperation : public ProjectExplorer::DeviceProcessSignalOperation { - Q_OBJECT public: ~AndroidSignalOperation() override; void killProcess(qint64 pid) override; diff --git a/src/plugins/android/avddialog.h b/src/plugins/android/avddialog.h index b7888b1db9d..4cd03870443 100644 --- a/src/plugins/android/avddialog.h +++ b/src/plugins/android/avddialog.h @@ -24,10 +24,11 @@ class AndroidConfig; class SdkPlatform; namespace Internal { + class AndroidSdkManager; + class AvdDialog : public QDialog { - Q_OBJECT public: explicit AvdDialog(const AndroidConfig &config, QWidget *parent = nullptr); int exec() override; From 7dfdb6d36c44b070470605d2b9d1b52c2af648c0 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 10:02:34 +0200 Subject: [PATCH 0399/1777] Android: Hide some manifesteditorwidget code in the .cpp Change-Id: I4478cb2d85535c8d92aeef5e1e664e001d168ec5 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../android/androidmanifesteditorwidget.cpp | 27 ++++++++++++++ .../android/androidmanifesteditorwidget.h | 37 ++----------------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index 9c6a616abe3..434af007891 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -41,6 +41,7 @@ #include <QFileDialog> #include <QFileInfo> #include <QFormLayout> +#include <QGroupBox> #include <QHBoxLayout> #include <QImage> #include <QLabel> @@ -84,6 +85,32 @@ static Target *androidTarget(const FilePath &fileName) return nullptr; } +class PermissionsModel: public QAbstractListModel +{ +public: + PermissionsModel(QObject *parent = nullptr); + void setPermissions(const QStringList &permissions); + const QStringList &permissions(); + QModelIndex addPermission(const QString &permission); + void removePermission(int index); + QVariant data(const QModelIndex &index, int role) const override; + +protected: + int rowCount(const QModelIndex &parent) const override; + +private: + QStringList m_permissions; +}; + +class AndroidManifestTextEditorWidget : public TextEditor::TextEditorWidget +{ +public: + explicit AndroidManifestTextEditorWidget(AndroidManifestEditorWidget *parent); + +private: + Core::IContext *m_context; +}; + AndroidManifestEditorWidget::AndroidManifestEditorWidget() { m_textEditorWidget = new AndroidManifestTextEditorWidget(this); diff --git a/src/plugins/android/androidmanifesteditorwidget.h b/src/plugins/android/androidmanifesteditorwidget.h index 23b8cdce05d..cfb59f38401 100644 --- a/src/plugins/android/androidmanifesteditorwidget.h +++ b/src/plugins/android/androidmanifesteditorwidget.h @@ -5,23 +5,19 @@ #include <texteditor/texteditor.h> -#include <QAbstractListModel> -#include <QGroupBox> -#include <QTabWidget> #include <QStackedWidget> #include <QTimer> QT_BEGIN_NAMESPACE class QCheckBox; class QDomDocument; -class QDomElement; class QComboBox; +class QGroupBox; class QPushButton; class QLabel; class QLineEdit; class QListView; -class QSpinBox; -class QToolButton; +class QTabWidget; class QXmlStreamReader; class QXmlStreamWriter; QT_END_NAMESPACE @@ -32,38 +28,13 @@ namespace Android::Internal { class AndroidManifestEditor; class AndroidManifestEditorIconContainerWidget; -class AndroidManifestEditorWidget; +class PermissionsModel; class SplashScreenContainerWidget; -class PermissionsModel: public QAbstractListModel -{ -public: - PermissionsModel(QObject *parent = nullptr); - void setPermissions(const QStringList &permissions); - const QStringList &permissions(); - QModelIndex addPermission(const QString &permission); - void removePermission(int index); - QVariant data(const QModelIndex &index, int role) const override; - -protected: - int rowCount(const QModelIndex &parent) const override; - -private: - QStringList m_permissions; -}; - -class AndroidManifestTextEditorWidget : public TextEditor::TextEditorWidget -{ -public: - explicit AndroidManifestTextEditorWidget(AndroidManifestEditorWidget *parent); - -private: - Core::IContext *m_context; -}; - class AndroidManifestEditorWidget : public QStackedWidget { Q_OBJECT + public: enum EditorPage { General = 0, From b14b7b1a5fb9dfba90d9aeb4d6f56a758a58ebe1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 19 Jul 2023 09:06:17 +0200 Subject: [PATCH 0400/1777] Replace a few more Aspect::value() calls with operator() uses Change-Id: I9343e74bfb51af41df02a411976b82b9260be2fb Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/python/pythonwizardpage.cpp | 6 +++--- src/plugins/subversion/subversionplugin.cpp | 2 +- src/plugins/terminal/terminalpane.cpp | 2 +- src/plugins/terminal/terminalwidget.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/python/pythonwizardpage.cpp b/src/plugins/python/pythonwizardpage.cpp index bfd7359fafb..78776202e87 100644 --- a/src/plugins/python/pythonwizardpage.cpp +++ b/src/plugins/python/pythonwizardpage.cpp @@ -140,7 +140,7 @@ void PythonWizardPage::initializePage() bool PythonWizardPage::validatePage() { - if (m_createVenv.value() && !m_venvPath.pathChooser()->isValid()) + if (m_createVenv() && !m_venvPath.pathChooser()->isValid()) return false; auto wiz = qobject_cast<JsonWizard *>(wizard()); const QMap<QString, QVariant> data = m_pySideVersion.itemValue().toMap(); @@ -156,7 +156,7 @@ void PythonWizardPage::setupProject(const JsonWizard::GeneratorFiles &files) Interpreter interpreter = m_interpreter.currentInterpreter(); Project *project = ProjectManager::openProject(Utils::mimeTypeForFile(f.file.filePath()), f.file.filePath().absoluteFilePath()); - if (m_createVenv.value()) { + if (m_createVenv()) { auto openProjectWithInterpreter = [f](const std::optional<Interpreter> &interpreter) { if (!interpreter) return; @@ -202,7 +202,7 @@ void PythonWizardPage::updateInterpreters() void PythonWizardPage::updateStateLabel() { QTC_ASSERT(m_stateLabel, return); - if (m_createVenv.value()) { + if (m_createVenv()) { if (PathChooser *pathChooser = m_venvPath.pathChooser()) { if (!pathChooser->isValid()) { m_stateLabel->show(); diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 6e84643a405..7ddcb0ddf6c 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -864,7 +864,7 @@ void SubversionPluginPrivate::vcsAnnotateHelper(const FilePath &workingDir, cons CommandLine args{settings().binaryPath(), {"annotate"}}; args << SubversionClient::AddAuthOptions(); - if (settings().spaceIgnorantAnnotation.value()) + if (settings().spaceIgnorantAnnotation()) args << "-x" << "-uw"; if (!revision.isEmpty()) args << "-r" << revision; diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index bc9832f59c7..853e1f66a05 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -78,7 +78,7 @@ TerminalPane::TerminalPane(QObject *parent) static const QString shiftEsc = QKeySequence( QKeyCombination(Qt::ShiftModifier, Qt::Key_Escape)) .toString(QKeySequence::NativeText); - if (settings().sendEscapeToTerminal.value()) { + if (settings().sendEscapeToTerminal()) { m_escSettingButton->setText(escKey); m_escSettingButton->setToolTip(Tr::tr("Sends Esc to terminal instead of Qt Creator.")); } else { diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index fdb5547a4f6..63826ea6d99 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -1004,7 +1004,7 @@ void TerminalWidget::paintCursor(QPainter &p) const cursor.shape = Internal::Cursor::Shape::Underline; const bool blinkState = !cursor.blink || m_cursorBlinkState - || !settings().allowBlinkingCursor.value(); + || !settings().allowBlinkingCursor(); if (cursor.visible && blinkState) { const int cursorCellWidth = m_surface->cellWidthAt(cursor.position.x(), cursor.position.y()); @@ -1160,7 +1160,7 @@ void TerminalWidget::keyPressEvent(QKeyEvent *event) } if (event->key() == Qt::Key_Escape) { - bool sendToTerminal = settings().sendEscapeToTerminal.value(); + bool sendToTerminal = settings().sendEscapeToTerminal(); bool send = false; if (sendToTerminal && event->modifiers() == Qt::NoModifier) send = true; From ddff28150df11d50e491e1deb19f2962366e7514 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 12:53:50 +0200 Subject: [PATCH 0401/1777] ClangTools: Convert two persisting values to aspects Change-Id: Ida296c35f08951eaef698f53bceb705728f55aa9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/clangtools/clangtoolssettings.cpp | 32 +++++++++++-------- src/plugins/clangtools/clangtoolssettings.h | 13 ++++---- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/plugins/clangtools/clangtoolssettings.cpp b/src/plugins/clangtools/clangtoolssettings.cpp index 286b076f95c..ba819231890 100644 --- a/src/plugins/clangtools/clangtoolssettings.cpp +++ b/src/plugins/clangtools/clangtoolssettings.cpp @@ -23,8 +23,6 @@ using namespace Utils; namespace ClangTools { namespace Internal { -const char clangTidyExecutableKey[] = "ClangTidyExecutable"; -const char clazyStandaloneExecutableKey[] = "ClazyStandaloneExecutable"; const char parallelJobsKey[] = "ParallelJobs"; const char preferConfigFileKey[] = "PreferConfigFile"; @@ -89,17 +87,23 @@ bool RunSettings::hasConfigFileForSourceFile(const Utils::FilePath &sourceFile) return false; } -ClangToolsSettings::ClangToolsSettings() -{ - readSettings(); -} - ClangToolsSettings *ClangToolsSettings::instance() { static ClangToolsSettings instance; return &instance; } +ClangToolsSettings::ClangToolsSettings() +{ + setSettingsGroup(Constants::SETTINGS_ID); + + clangTidyExecutable.setSettingsKey("ClangTidyExecutable"); + + clazyStandaloneExecutable.setSettingsKey("ClazyStandaloneExecutable"); + + readSettings(); +} + static QVariantMap convertToMapFromVersionBefore410(QSettings *s) { const char oldParallelJobsKey[] = "simultaneousProcesses"; @@ -141,10 +145,10 @@ void ClangToolsSettings::readSettings() if (!importedConfigs.isEmpty()) write = true; + AspectContainer::readSettings(); + QSettings *s = Core::ICore::settings(); s->beginGroup(Constants::SETTINGS_ID); - m_clangTidyExecutable = FilePath::fromSettings(s->value(clangTidyExecutableKey)); - m_clazyStandaloneExecutable = FilePath::fromSettings(s->value(clazyStandaloneExecutableKey)); m_diagnosticConfigs.append(diagnosticConfigsFromSettings(s)); QVariantMap map; @@ -174,11 +178,11 @@ void ClangToolsSettings::readSettings() void ClangToolsSettings::writeSettings() { + AspectContainer::writeSettings(); + QSettings *s = Core::ICore::settings(); s->beginGroup(Constants::SETTINGS_ID); - s->setValue(clangTidyExecutableKey, m_clangTidyExecutable.toSettings()); - s->setValue(clazyStandaloneExecutableKey, m_clazyStandaloneExecutable.toSettings()); diagnosticConfigsToSettings(s, m_diagnosticConfigs); QVariantMap map; @@ -193,16 +197,16 @@ void ClangToolsSettings::writeSettings() FilePath ClangToolsSettings::executable(ClangToolType tool) const { - return tool == ClangToolType::Tidy ? m_clangTidyExecutable : m_clazyStandaloneExecutable; + return tool == ClangToolType::Tidy ? clangTidyExecutable() : clazyStandaloneExecutable(); } void ClangToolsSettings::setExecutable(ClangToolType tool, const FilePath &path) { if (tool == ClangToolType::Tidy) { - m_clangTidyExecutable = path; + clangTidyExecutable.setValue(path); m_clangTidyVersion = {}; } else { - m_clazyStandaloneExecutable = path; + clazyStandaloneExecutable.setValue(path); m_clazyVersion = {}; } } diff --git a/src/plugins/clangtools/clangtoolssettings.h b/src/plugins/clangtools/clangtoolssettings.h index 45a2cb032e4..ddc4b9157e4 100644 --- a/src/plugins/clangtools/clangtoolssettings.h +++ b/src/plugins/clangtools/clangtoolssettings.h @@ -5,6 +5,7 @@ #include <cppeditor/clangdiagnosticconfig.h> +#include <utils/aspects.h> #include <utils/filepath.h> #include <utils/id.h> @@ -55,14 +56,19 @@ private: bool m_analyzeOpenFiles = true; }; -class ClangToolsSettings : public QObject +class ClangToolsSettings : public Utils::AspectContainer { Q_OBJECT + ClangToolsSettings(); public: static ClangToolsSettings *instance(); void writeSettings(); + // Executables + Utils::FilePathAspect clangTidyExecutable{this}; + Utils::FilePathAspect clazyStandaloneExecutable{this}; + Utils::FilePath executable(CppEditor::ClangToolType tool) const; void setExecutable(CppEditor::ClangToolType tool, const Utils::FilePath &path); @@ -80,13 +86,8 @@ signals: void changed(); private: - ClangToolsSettings(); void readSettings(); - // Executables - Utils::FilePath m_clangTidyExecutable; - Utils::FilePath m_clazyStandaloneExecutable; - // Diagnostic Configs CppEditor::ClangDiagnosticConfigs m_diagnosticConfigs; From 52ba040e604b339a3d971f962a9ddc956e4408dc Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 11:34:47 +0200 Subject: [PATCH 0402/1777] Utils: Emit TypedAspect::volatileValueChanged when it changes Change-Id: I9a2cf591955332453e6ff9d99c5e18249510599a Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 7c911a0ea58..a44911202dc 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -268,8 +268,11 @@ public: void setVolatileValue(const ValueType &value) { + if (m_buffer == value) + return; m_buffer = value; bufferToGui(); + emit volatileValueChanged(); } protected: From 6cc471f38dd8723136c4c8002195408f0095f6f2 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 20 Jul 2023 11:33:30 +0200 Subject: [PATCH 0403/1777] Utils: Replace QVector with QList Make usages of QList consistent. In some cases the declaration contained QVector arg, while the definition had QList arg. Remove some unneeded includes of QList. Change-Id: I7c15b39f261cefdeec6aaaf506ff4cc981432855 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 2 +- src/libs/utils/commandline.h | 1 - src/libs/utils/differ.cpp | 1 - src/libs/utils/elfreader.h | 6 +++--- src/libs/utils/environment.cpp | 4 ++-- src/libs/utils/environment.h | 2 +- src/libs/utils/environmentfwd.h | 4 ++-- src/libs/utils/fuzzymatcher.h | 6 +++--- src/libs/utils/highlightingitemdelegate.cpp | 12 ++++++------ src/libs/utils/highlightingitemdelegate.h | 2 +- src/libs/utils/icon.cpp | 4 ++-- src/libs/utils/icon.h | 6 +++--- src/libs/utils/json.h | 5 ++--- src/libs/utils/layoutbuilder.h | 2 +- src/libs/utils/macroexpander.cpp | 4 ++-- src/libs/utils/macroexpander.h | 3 +-- src/libs/utils/namevaluedictionary.h | 2 +- src/libs/utils/namevalueitem.h | 1 - src/libs/utils/port.h | 2 +- src/libs/utils/terminalcommand.cpp | 6 +++--- src/libs/utils/terminalcommand.h | 4 ++-- src/libs/utils/theme/theme_p.h | 6 +++--- src/libs/utils/treemodel.cpp | 2 +- src/libs/utils/treemodel.h | 4 ++-- 24 files changed, 43 insertions(+), 48 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index ae8ee76da96..860b6990d8c 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -637,7 +637,7 @@ public: SelectionAspect::DisplayStyle m_displayStyle = SelectionAspect::DisplayStyle::RadioButtons; - QVector<SelectionAspect::Option> m_options; + QList<SelectionAspect::Option> m_options; // These are all owned by the configuration widget. QList<QPointer<QRadioButton>> m_buttons; diff --git a/src/libs/utils/commandline.h b/src/libs/utils/commandline.h index d7fc0a066be..52ff8c5496f 100644 --- a/src/libs/utils/commandline.h +++ b/src/libs/utils/commandline.h @@ -8,7 +8,6 @@ #include "filepath.h" #include "hostosinfo.h" -#include <QList> #include <QPair> #include <QStringList> diff --git a/src/libs/utils/differ.cpp b/src/libs/utils/differ.cpp index f929efbeeb0..2d27de3f80b 100644 --- a/src/libs/utils/differ.cpp +++ b/src/libs/utils/differ.cpp @@ -13,7 +13,6 @@ publication by Neil Fraser: http://neil.fraser.name/writing/diff/ #include "utilstr.h" -#include <QList> #include <QMap> #include <QPair> #include <QRegularExpression> diff --git a/src/libs/utils/elfreader.h b/src/libs/utils/elfreader.h index d1506c81f00..a254b8e221e 100644 --- a/src/libs/utils/elfreader.h +++ b/src/libs/utils/elfreader.h @@ -10,8 +10,8 @@ #include <QByteArray> #include <QCoreApplication> #include <QFile> +#include <QList> #include <QSharedPointer> -#include <QVector> namespace Utils { @@ -130,8 +130,8 @@ public: QByteArray debugLink; QByteArray buildId; DebugSymbolsType symbolsType = UnknownSymbols; - QVector<ElfSectionHeader> sectionHeaders; - QVector<ElfProgramHeader> programHeaders; + QList<ElfSectionHeader> sectionHeaders; + QList<ElfProgramHeader> programHeaders; }; class QTCREATOR_UTILS_EXPORT ElfReader diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index b9af2dea928..2fe99fb97f5 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -24,7 +24,7 @@ namespace Utils { static QReadWriteLock s_envMutex; Q_GLOBAL_STATIC_WITH_ARGS(Environment, staticSystemEnvironment, (QProcessEnvironment::systemEnvironment().toStringList())) -Q_GLOBAL_STATIC(QVector<EnvironmentProvider>, environmentProviders) +Q_GLOBAL_STATIC(QList<EnvironmentProvider>, environmentProviders) Environment::Environment() : m_dict(HostOsInfo::hostOs()) @@ -352,7 +352,7 @@ void EnvironmentProvider::addProvider(EnvironmentProvider &&provider) environmentProviders->append(std::move(provider)); } -const QVector<EnvironmentProvider> EnvironmentProvider::providers() +const QList<EnvironmentProvider> EnvironmentProvider::providers() { return *environmentProviders; } diff --git a/src/libs/utils/environment.h b/src/libs/utils/environment.h index 63fe697bd6e..479778e4ce7 100644 --- a/src/libs/utils/environment.h +++ b/src/libs/utils/environment.h @@ -134,7 +134,7 @@ public: std::function<Environment()> environment; static void addProvider(EnvironmentProvider &&provider); - static const QVector<EnvironmentProvider> providers(); + static const QList<EnvironmentProvider> providers(); static std::optional<EnvironmentProvider> provider(const QByteArray &id); }; diff --git a/src/libs/utils/environmentfwd.h b/src/libs/utils/environmentfwd.h index 2975cbb64a7..51089eeee19 100644 --- a/src/libs/utils/environmentfwd.h +++ b/src/libs/utils/environmentfwd.h @@ -3,7 +3,7 @@ #pragma once -#include <QVector> +#include <QList> QT_BEGIN_NAMESPACE class QTreeView; @@ -12,7 +12,7 @@ QT_END_NAMESPACE namespace Utils { class NameValueDictionary; class NameValueItem; -using NameValueItems = QVector<NameValueItem>; +using NameValueItems = QList<NameValueItem>; class Environment; using EnvironmentItem = NameValueItem; diff --git a/src/libs/utils/fuzzymatcher.h b/src/libs/utils/fuzzymatcher.h index dc665ec8648..88c5269870d 100644 --- a/src/libs/utils/fuzzymatcher.h +++ b/src/libs/utils/fuzzymatcher.h @@ -7,7 +7,7 @@ #include "utils_global.h" -#include <QVector> +#include <QList> QT_BEGIN_NAMESPACE class QRegularExpression; @@ -26,8 +26,8 @@ public: class HighlightingPositions { public: - QVector<int> starts; - QVector<int> lengths; + QList<int> starts; + QList<int> lengths; }; static QRegularExpression createRegExp( diff --git a/src/libs/utils/highlightingitemdelegate.cpp b/src/libs/utils/highlightingitemdelegate.cpp index 22d55e23bf0..7fe0507311a 100644 --- a/src/libs/utils/highlightingitemdelegate.cpp +++ b/src/libs/utils/highlightingitemdelegate.cpp @@ -134,12 +134,12 @@ void HighlightingItemDelegate::drawText(QPainter *painter, if (index.model()->hasChildren(index)) text += " (" + QString::number(index.model()->rowCount(index)) + ')'; - QVector<int> searchTermStarts = - index.model()->data(index, int(HighlightingItemRole::StartColumn)).value<QVector<int>>(); - QVector<int> searchTermLengths = - index.model()->data(index, int(HighlightingItemRole::Length)).value<QVector<int>>(); + QList<int> searchTermStarts + = index.model()->data(index, int(HighlightingItemRole::StartColumn)).value<QList<int>>(); + QList<int> searchTermLengths + = index.model()->data(index, int(HighlightingItemRole::Length)).value<QList<int>>(); - QVector<QTextLayout::FormatRange> formats; + QList<QTextLayout::FormatRange> formats; const QString extraText = index.model()->data(index, int(HighlightingItemRole::DisplayExtra)).toString(); @@ -230,7 +230,7 @@ QSizeF doTextLayout(QTextLayout *textLayout, int lineWidth) void HighlightingItemDelegate::drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QString &text, - const QVector<QTextLayout::FormatRange> &format) const + const QList<QTextLayout::FormatRange> &format) const { QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled; diff --git a/src/libs/utils/highlightingitemdelegate.h b/src/libs/utils/highlightingitemdelegate.h index cbda7042c26..ed47f18cca2 100644 --- a/src/libs/utils/highlightingitemdelegate.h +++ b/src/libs/utils/highlightingitemdelegate.h @@ -36,7 +36,7 @@ private: const QRect &rect, const QModelIndex &index) const; using QItemDelegate::drawDisplay; void drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, - const QString &text, const QVector<QTextLayout::FormatRange> &format) const; + const QString &text, const QList<QTextLayout::FormatRange> &format) const; QString m_tabString; }; diff --git a/src/libs/utils/icon.cpp b/src/libs/utils/icon.cpp index 4ce143b56c7..d2e4737d479 100644 --- a/src/libs/utils/icon.cpp +++ b/src/libs/utils/icon.cpp @@ -36,7 +36,7 @@ static QPixmap maskToColorAndAlpha(const QPixmap &mask, const QColor &color) using MaskAndColor = QPair<QPixmap, QColor>; using MasksAndColors = QList<MaskAndColor>; -static MasksAndColors masksAndColors(const QVector<IconMaskAndColor> &icon, int dpr) +static MasksAndColors masksAndColors(const QList<IconMaskAndColor> &icon, int dpr) { MasksAndColors result; for (const IconMaskAndColor &i: icon) { @@ -134,7 +134,7 @@ static QPixmap masksToIcon(const MasksAndColors &masks, const QPixmap &combinedM Icon::Icon() = default; -Icon::Icon(QVector<IconMaskAndColor> args, Icon::IconStyleOptions style) +Icon::Icon(QList<IconMaskAndColor> args, Icon::IconStyleOptions style) : m_iconSourceList(std::move(args)) , m_style(style) { diff --git a/src/libs/utils/icon.h b/src/libs/utils/icon.h index c2c5e7a3de5..ea1384ffd3c 100644 --- a/src/libs/utils/icon.h +++ b/src/libs/utils/icon.h @@ -9,8 +9,8 @@ #include "theme/theme.h" #include <QIcon> +#include <QList> #include <QPair> -#include <QVector> QT_BEGIN_NAMESPACE class QColor; @@ -40,7 +40,7 @@ public: Q_DECLARE_FLAGS(IconStyleOptions, IconStyleOption) Icon(); - Icon(QVector<IconMaskAndColor> args, IconStyleOptions style = ToolBarStyle); + Icon(QList<IconMaskAndColor> args, IconStyleOptions style = ToolBarStyle); Icon(const FilePath &imageFileName); QIcon icon() const; @@ -62,7 +62,7 @@ public: static QIcon combinedIcon(const QList<Icon> &icons); private: - QVector<IconMaskAndColor> m_iconSourceList; + QList<IconMaskAndColor> m_iconSourceList; IconStyleOptions m_style = None; mutable int m_lastDevicePixelRatio = -1; mutable QIcon m_lastIcon; diff --git a/src/libs/utils/json.h b/src/libs/utils/json.h index 96a06772083..4872760ed30 100644 --- a/src/libs/utils/json.h +++ b/src/libs/utils/json.h @@ -8,7 +8,6 @@ #include <QDateTime> #include <QHash> #include <QStringList> -#include <QVector> QT_BEGIN_NAMESPACE class QVariant; @@ -37,7 +36,7 @@ public: } private: - QVector<char *> _objs; + QList<char *> _objs; }; /*! @@ -359,7 +358,7 @@ private: int m_index; }; - QVector<Context> m_schemas; + QList<Context> m_schemas; const JsonSchemaManager *m_manager; }; diff --git a/src/libs/utils/layoutbuilder.h b/src/libs/utils/layoutbuilder.h index e94fbb56c04..63eeee34d50 100644 --- a/src/libs/utils/layoutbuilder.h +++ b/src/libs/utils/layoutbuilder.h @@ -3,10 +3,10 @@ #pragma once +#include <QFormLayout> #include <QList> #include <QString> #include <QtGlobal> -#include <QFormLayout> #include <optional> diff --git a/src/libs/utils/macroexpander.cpp b/src/libs/utils/macroexpander.cpp index 3ab7d92e9a6..f6d3dad3623 100644 --- a/src/libs/utils/macroexpander.cpp +++ b/src/libs/utils/macroexpander.cpp @@ -88,10 +88,10 @@ public: QHash<QByteArray, MacroExpander::StringFunction> m_map; QHash<QByteArray, MacroExpander::PrefixFunction> m_prefixMap; - QVector<MacroExpander::ResolverFunction> m_extraResolvers; + QList<MacroExpander::ResolverFunction> m_extraResolvers; QMap<QByteArray, QString> m_descriptions; QString m_displayName; - QVector<MacroExpanderProvider> m_subProviders; + QList<MacroExpanderProvider> m_subProviders; bool m_accumulating = false; bool m_aborted = false; diff --git a/src/libs/utils/macroexpander.h b/src/libs/utils/macroexpander.h index 12172a5e17e..adde4db1d3f 100644 --- a/src/libs/utils/macroexpander.h +++ b/src/libs/utils/macroexpander.h @@ -7,7 +7,6 @@ #include <QCoreApplication> #include <QList> -#include <QVector> #include <functional> @@ -18,7 +17,7 @@ namespace Internal { class MacroExpanderPrivate; } class FilePath; class MacroExpander; using MacroExpanderProvider = std::function<MacroExpander *()>; -using MacroExpanderProviders = QVector<MacroExpanderProvider>; +using MacroExpanderProviders = QList<MacroExpanderProvider>; class QTCREATOR_UTILS_EXPORT MacroExpander { diff --git a/src/libs/utils/namevaluedictionary.h b/src/libs/utils/namevaluedictionary.h index 4c8b5466816..722558f8912 100644 --- a/src/libs/utils/namevaluedictionary.h +++ b/src/libs/utils/namevaluedictionary.h @@ -30,7 +30,7 @@ inline bool operator<(const DictKey &k1, const DictKey &k2) inline bool operator>(const DictKey &k1, const DictKey &k2) { return k2 < k1; } using NameValuePair = std::pair<QString, QString>; -using NameValuePairs = QVector<NameValuePair>; +using NameValuePairs = QList<NameValuePair>; using NameValueMap = QMap<DictKey, QPair<QString, bool>>; class QTCREATOR_UTILS_EXPORT NameValueDictionary diff --git a/src/libs/utils/namevalueitem.h b/src/libs/utils/namevalueitem.h index b1f2bc22f84..62ba9d25baf 100644 --- a/src/libs/utils/namevalueitem.h +++ b/src/libs/utils/namevalueitem.h @@ -10,7 +10,6 @@ #include <QStringList> #include <QVariantList> -#include <QVector> namespace Utils { diff --git a/src/libs/utils/port.h b/src/libs/utils/port.h index c4b46631de2..2bf561f0b94 100644 --- a/src/libs/utils/port.h +++ b/src/libs/utils/port.h @@ -5,8 +5,8 @@ #include "utils_global.h" -#include <QMetaType> #include <QList> +#include <QMetaType> #include <QString> namespace Utils { diff --git a/src/libs/utils/terminalcommand.cpp b/src/libs/utils/terminalcommand.cpp index bb1492515f3..afb0c3fe546 100644 --- a/src/libs/utils/terminalcommand.cpp +++ b/src/libs/utils/terminalcommand.cpp @@ -45,7 +45,7 @@ void TerminalCommand::setSettings(QSettings *settings) s_settings = settings; } -Q_GLOBAL_STATIC_WITH_ARGS(const QVector<TerminalCommand>, knownTerminals, ( +Q_GLOBAL_STATIC_WITH_ARGS(const QList<TerminalCommand>, knownTerminals, ( { {"x-terminal-emulator", "", "-e"}, {"xdg-terminal", "", "", true}, @@ -82,9 +82,9 @@ TerminalCommand TerminalCommand::defaultTerminalEmulator() return defaultTerm; } -QVector<TerminalCommand> TerminalCommand::availableTerminalEmulators() +QList<TerminalCommand> TerminalCommand::availableTerminalEmulators() { - QVector<TerminalCommand> result; + QList<TerminalCommand> result; if (HostOsInfo::isAnyUnixHost()) { const Environment env = Environment::systemEnvironment(); diff --git a/src/libs/utils/terminalcommand.h b/src/libs/utils/terminalcommand.h index edb9ffcadde..92a136d9655 100644 --- a/src/libs/utils/terminalcommand.h +++ b/src/libs/utils/terminalcommand.h @@ -7,8 +7,8 @@ #include "filepath.h" +#include <QList> #include <QMetaType> -#include <QVector> QT_BEGIN_NAMESPACE class QSettings; @@ -35,7 +35,7 @@ public: static void setSettings(QSettings *settings); static TerminalCommand defaultTerminalEmulator(); - static QVector<TerminalCommand> availableTerminalEmulators(); + static QList<TerminalCommand> availableTerminalEmulators(); static TerminalCommand terminalEmulator(); static void setTerminalEmulator(const TerminalCommand &term); }; diff --git a/src/libs/utils/theme/theme_p.h b/src/libs/utils/theme/theme_p.h index 6aa5fb06a6c..14483f6d58c 100644 --- a/src/libs/utils/theme/theme_p.h +++ b/src/libs/utils/theme/theme_p.h @@ -23,9 +23,9 @@ public: QStringList preferredStyles; QString defaultTextEditorColorScheme; QString enforceAccentColorOnMacOS; - QVector<QPair<QColor, QString> > colors; - QVector<QString> imageFiles; - QVector<bool> flags; + QList<QPair<QColor, QString> > colors; + QList<QString> imageFiles; + QList<bool> flags; QMap<QString, QColor> palette; }; diff --git a/src/libs/utils/treemodel.cpp b/src/libs/utils/treemodel.cpp index e5e5aa59b99..2691525441a 100644 --- a/src/libs/utils/treemodel.cpp +++ b/src/libs/utils/treemodel.cpp @@ -717,7 +717,7 @@ void TreeItem::sortChildren(const std::function<bool(const TreeItem *, const Tre { if (m_model) { if (const int n = childCount()) { - QVector<TreeItem *> tmp = m_children; + QList<TreeItem *> tmp = m_children; std::sort(tmp.begin(), tmp.end(), cmp); if (tmp == m_children) { // Nothing changed. diff --git a/src/libs/utils/treemodel.h b/src/libs/utils/treemodel.h index 2cff2f72414..46832ff9d94 100644 --- a/src/libs/utils/treemodel.h +++ b/src/libs/utils/treemodel.h @@ -49,7 +49,7 @@ public: TreeItem *lastChild() const; int level() const; - using const_iterator = QVector<TreeItem *>::const_iterator; + using const_iterator = QList<TreeItem *>::const_iterator; using value_type = TreeItem *; int childCount() const { return m_children.size(); } int indexInParent() const; @@ -81,7 +81,7 @@ private: TreeItem *m_parent = nullptr; // Not owned. BaseTreeModel *m_model = nullptr; // Not owned. - QVector<TreeItem *> m_children; // Owned. + QList<TreeItem *> m_children; // Owned. friend class BaseTreeModel; }; From e8de9d44c93405fc603fbc09e2e8776d37261590 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 13 Jul 2023 19:17:55 +0200 Subject: [PATCH 0404/1777] Qmake: Use aspects more directly in QmakeBuildConfiguration Change-Id: Ida1f62939242944e25986b71183164cd15c8de94 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../qmakebuildconfiguration.cpp | 72 ++++++------------- .../qmakebuildconfiguration.h | 14 ++-- .../qmakeprojectmanager/qmakeproject.cpp | 2 +- 3 files changed, 31 insertions(+), 57 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index fff0a1fd5d3..3fca1a4a3e7 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -53,18 +53,6 @@ using namespace QmakeProjectManager::Internal; namespace QmakeProjectManager { -class RunSystemAspect : public TriStateAspect -{ - Q_OBJECT -public: - RunSystemAspect() - : TriStateAspect(nullptr, Tr::tr("Run"), Tr::tr("Ignore"), Tr::tr("Use global setting")) - { - setSettingsKey("RunSystemFunction"); - setDisplayName(Tr::tr("qmake system() behavior when parsing:")); - } -}; - QmakeExtraBuildInfo::QmakeExtraBuildInfo() { const BuildPropertiesSettings &settings = ProjectExplorerPlugin::buildPropertiesSettings(); @@ -120,9 +108,9 @@ QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Id id) if (!additionalArguments.isEmpty()) qmakeStep->userArguments.setArguments(additionalArguments); - aspect<SeparateDebugInfoAspect>()->setValue(qmakeExtra.config.separateDebugInfo); - aspect<QmlDebuggingAspect>()->setValue(qmakeExtra.config.linkQmlDebuggingQQ2); - aspect<QtQuickCompilerAspect>()->setValue(qmakeExtra.config.useQtQuickCompiler); + separateDebugInfo.setValue(qmakeExtra.config.separateDebugInfo); + qmlDebugging.setValue(qmakeExtra.config.linkQmlDebuggingQQ2); + useQtQuickCompiler.setValue(qmakeExtra.config.useQtQuickCompiler); setQMakeBuildConfiguration(config); @@ -166,30 +154,33 @@ QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Id id) connect(target, &Target::parsingFinished, this, &QmakeBuildConfiguration::updateProblemLabel); connect(target, &Target::kitChanged, this, &QmakeBuildConfiguration::updateProblemLabel); - const auto separateDebugInfoAspect = addAspect<SeparateDebugInfoAspect>(); - connect(separateDebugInfoAspect, &SeparateDebugInfoAspect::changed, this, [this] { + connect(&separateDebugInfo, &BaseAspect::changed, this, [this] { emit separateDebugInfoChanged(); emit qmakeBuildConfigurationChanged(); qmakeBuildSystem()->scheduleUpdateAllNowOrLater(); }); - const auto qmlDebuggingAspect = addAspect<QmlDebuggingAspect>(); - qmlDebuggingAspect->setBuildConfiguration(this); - connect(qmlDebuggingAspect, &QmlDebuggingAspect::changed, this, [this] { + qmlDebugging.setBuildConfiguration(this); + connect(&qmlDebugging, &BaseAspect::changed, this, [this] { emit qmlDebuggingChanged(); emit qmakeBuildConfigurationChanged(); qmakeBuildSystem()->scheduleUpdateAllNowOrLater(); }); - const auto qtQuickCompilerAspect = addAspect<QtQuickCompilerAspect>(); - qtQuickCompilerAspect->setBuildConfiguration(this); - connect(qtQuickCompilerAspect, &QtQuickCompilerAspect::changed, this, [this] { + useQtQuickCompiler.setBuildConfiguration(this); + connect(&useQtQuickCompiler, &QtQuickCompilerAspect::changed, this, [this] { emit useQtQuickCompilerChanged(); emit qmakeBuildConfigurationChanged(); qmakeBuildSystem()->scheduleUpdateAllNowOrLater(); }); - addAspect<RunSystemAspect>(); + runSystemFunctions.setSettingsKey("RunSystemFunction"); + runSystemFunctions.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + runSystemFunctions.setDisplayName(Tr::tr("qmake system() behavior when parsing:")); + runSystemFunctions.addOption(Tr::tr("Run")); + runSystemFunctions.addOption(Tr::tr("Ignore")); + runSystemFunctions.addOption(Tr::tr("Use global setting")); + runSystemFunctions.setDefaultValue(2); } QmakeBuildConfiguration::~QmakeBuildConfiguration() @@ -390,44 +381,27 @@ bool QmakeBuildConfiguration::isBuildDirAtSafeLocation() const return isBuildDirAtSafeLocation(project()->projectDirectory(), buildDirectory()); } -TriState QmakeBuildConfiguration::separateDebugInfo() const -{ - return aspect<SeparateDebugInfoAspect>()->value(); -} - void QmakeBuildConfiguration::forceSeparateDebugInfo(bool sepDebugInfo) { - aspect<SeparateDebugInfoAspect>()->setValue(sepDebugInfo - ? TriState::Enabled - : TriState::Disabled); -} - -TriState QmakeBuildConfiguration::qmlDebugging() const -{ - return aspect<QmlDebuggingAspect>()->value(); + separateDebugInfo.setValue(sepDebugInfo ? TriState::Enabled : TriState::Disabled); } void QmakeBuildConfiguration::forceQmlDebugging(bool enable) { - aspect<QmlDebuggingAspect>()->setValue(enable ? TriState::Enabled : TriState::Disabled); -} - -TriState QmakeBuildConfiguration::useQtQuickCompiler() const -{ - return aspect<QtQuickCompilerAspect>()->value(); + qmlDebugging.setValue(enable ? TriState::Enabled : TriState::Disabled); } void QmakeBuildConfiguration::forceQtQuickCompiler(bool enable) { - aspect<QtQuickCompilerAspect>()->setValue(enable ? TriState::Enabled : TriState::Disabled); + useQtQuickCompiler.setValue(enable ? TriState::Enabled : TriState::Disabled); } -bool QmakeBuildConfiguration::runSystemFunction() const +bool QmakeBuildConfiguration::runQmakeSystemFunctions() const { - const TriState runSystem = aspect<RunSystemAspect>()->value(); - if (runSystem == TriState::Enabled) + const int sel = runSystemFunctions(); + if (sel == 0) return true; - if (runSystem == TriState::Disabled) + if (sel == 1) return false; return settings().runSystemFunction(); } @@ -857,5 +831,3 @@ void QmakeBuildConfiguration::restrictNextBuild(const RunConfiguration *rc) } } // namespace QmakeProjectManager - -#include <qmakebuildconfiguration.moc> diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h index 3b842cfd7cc..f5a38c99fce 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h @@ -5,8 +5,10 @@ #include "qmakeprojectmanager_global.h" +#include <projectexplorer/buildaspects.h> #include <projectexplorer/buildconfiguration.h> #include <qtsupport/baseqtversion.h> +#include <qtsupport/qtbuildaspects.h> #include <utils/aspects.h> @@ -76,16 +78,16 @@ public: const Utils::FilePath &buildDir); bool isBuildDirAtSafeLocation() const; - Utils::TriState separateDebugInfo() const; void forceSeparateDebugInfo(bool sepDebugInfo); - - Utils::TriState qmlDebugging() const; void forceQmlDebugging(bool enable); - - Utils::TriState useQtQuickCompiler() const; void forceQtQuickCompiler(bool enable); - bool runSystemFunction() const; + ProjectExplorer::SeparateDebugInfoAspect separateDebugInfo{this}; + QtSupport::QmlDebuggingAspect qmlDebugging{this}; + QtSupport::QtQuickCompilerAspect useQtQuickCompiler{this}; + Utils::SelectionAspect runSystemFunctions{this}; + + bool runQmakeSystemFunctions() const; signals: /// emitted for setQMakeBuildConfig, not emitted for Qt version changes, even diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index d7aefb50b8b..332b9e29bdd 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -872,7 +872,7 @@ QtSupport::ProFileReader *QmakeBuildSystem::createProFileReader(const QmakeProFi }); m_qmakeGlobals->setCommandLineArguments(rootProFileName, qmakeArgs); - m_qmakeGlobals->runSystemFunction = bc->runSystemFunction(); + m_qmakeGlobals->runSystemFunction = bc->runQmakeSystemFunctions(); QtSupport::ProFileCacheManager::instance()->incRefCount(); From 635e8c161490150cdb92420d7ddedc9f3db54561 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 09:09:11 +0200 Subject: [PATCH 0405/1777] Utils: Introduce a FilePathAspect::expandedValue() Currently and long-term synonym for operator(), to be used in cases where (*this)() or such looks ugly. Change-Id: I3f70ecd3298a1df394a0e3cc593917b4c7d36d82 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/libs/utils/aspects.cpp | 9 +++++++-- src/libs/utils/aspects.h | 1 + src/plugins/projectexplorer/buildaspects.cpp | 10 +++++----- .../projectexplorer/runconfigurationaspects.cpp | 4 ++-- src/plugins/qnx/qnxdebugsupport.cpp | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 860b6990d8c..55a9ee77fa7 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1325,12 +1325,17 @@ FilePathAspect::FilePathAspect(AspectContainer *container) FilePath FilePathAspect::operator()() const { - return filePath(); + return FilePath::fromUserInput(StringAspect::value()); } FilePath FilePathAspect::value() const { - return filePath(); + return FilePath::fromUserInput(StringAspect::value()); +} + +FilePath FilePathAspect::expandedValue() const +{ + return FilePath::fromUserInput(StringAspect::value()); } QString FilePathAspect::stringValue() const diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index a44911202dc..ea12b9b7b82 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -537,6 +537,7 @@ public: FilePath operator()() const; FilePath value() const; + FilePath expandedValue() const; QString stringValue() const; void setValue(const FilePath &filePath); void setDefaultValue(const FilePath &filePath); diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index 683d712b2a1..74650f49c14 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -74,12 +74,12 @@ void BuildDirectoryAspect::allowInSourceBuilds(const FilePath &sourceDir) { d->sourceDir = sourceDir; makeCheckable(CheckBoxPlacement::Top, Tr::tr("Shadow build:"), QString()); - setChecked(d->sourceDir != filePath()); + setChecked(d->sourceDir != expandedValue()); } bool BuildDirectoryAspect::isShadowBuild() const { - return !d->sourceDir.isEmpty() && d->sourceDir != filePath(); + return !d->sourceDir.isEmpty() && d->sourceDir != expandedValue(); } void BuildDirectoryAspect::setProblem(const QString &description) @@ -92,7 +92,7 @@ void BuildDirectoryAspect::toMap(QVariantMap &map) const { FilePathAspect::toMap(map); if (!d->sourceDir.isEmpty()) { - const FilePath shadowDir = isChecked() ? filePath() : d->savedShadowBuildDir; + const FilePath shadowDir = isChecked() ? expandedValue() : d->savedShadowBuildDir; saveToMap(map, shadowDir.toSettings(), QString(), settingsKey() + ".shadowDir"); } } @@ -104,7 +104,7 @@ void BuildDirectoryAspect::fromMap(const QVariantMap &map) d->savedShadowBuildDir = FilePath::fromSettings(map.value(settingsKey() + ".shadowDir")); if (d->savedShadowBuildDir.isEmpty()) setValue(d->sourceDir); - setChecked(d->sourceDir != filePath()); + setChecked(d->sourceDir != expandedValue()); // FIXME: Check. } } @@ -121,7 +121,7 @@ void BuildDirectoryAspect::addToLayout(Layouting::LayoutItem &parent) setValue(d->savedShadowBuildDir.isEmpty() ? d->sourceDir : d->savedShadowBuildDir); } else { - d->savedShadowBuildDir = filePath(); + d->savedShadowBuildDir = expandedValue(); // FIXME: Check. setValue(d->sourceDir); } }); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 3b5d8649b46..4950cef0962 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -632,8 +632,8 @@ void ExecutableAspect::makeOverridable(const QString &overridingKey, const QStri FilePath ExecutableAspect::executable() const { FilePath exe = m_alternativeExecutable && m_alternativeExecutable->isChecked() - ? m_alternativeExecutable->filePath() - : m_executable.filePath(); + ? (*m_alternativeExecutable)() + : m_executable(); if (const IDevice::ConstPtr dev = executionDevice(m_target, m_selector)) exe = dev->rootPath().withNewMappedPath(exe); diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index 919e9ef1fcc..5ad45f057aa 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -230,7 +230,7 @@ void showAttachToProcessDialog() FilePath localExecutable = dlg.localExecutable(); if (localExecutable.isEmpty()) { if (auto aspect = runConfig->aspect<SymbolFileAspect>()) - localExecutable = aspect->filePath(); + localExecutable = aspect->expandedValue(); } auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE); From e8669653f11f91923826af0edcbcde99d12dc904 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 20 Jul 2023 12:38:52 +0200 Subject: [PATCH 0406/1777] Icon: Pass const reference to QList in c'tor Change-Id: I8e009cdd29d08fc0dbcac3c812885779c928337c Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/icon.cpp | 6 +++--- src/libs/utils/icon.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/icon.cpp b/src/libs/utils/icon.cpp index d2e4737d479..9c7625e32b2 100644 --- a/src/libs/utils/icon.cpp +++ b/src/libs/utils/icon.cpp @@ -134,15 +134,15 @@ static QPixmap masksToIcon(const MasksAndColors &masks, const QPixmap &combinedM Icon::Icon() = default; -Icon::Icon(QList<IconMaskAndColor> args, Icon::IconStyleOptions style) - : m_iconSourceList(std::move(args)) +Icon::Icon(const QList<IconMaskAndColor> &args, Icon::IconStyleOptions style) + : m_iconSourceList(args) , m_style(style) { } Icon::Icon(const FilePath &imageFileName) + : m_iconSourceList({{imageFileName, Theme::Color(-1)}}) { - m_iconSourceList.append({imageFileName, Theme::Color(-1)}); } QIcon Icon::icon() const diff --git a/src/libs/utils/icon.h b/src/libs/utils/icon.h index ea1384ffd3c..b1482410a3d 100644 --- a/src/libs/utils/icon.h +++ b/src/libs/utils/icon.h @@ -40,7 +40,7 @@ public: Q_DECLARE_FLAGS(IconStyleOptions, IconStyleOption) Icon(); - Icon(QList<IconMaskAndColor> args, IconStyleOptions style = ToolBarStyle); + Icon(const QList<IconMaskAndColor> &args, IconStyleOptions style = ToolBarStyle); Icon(const FilePath &imageFileName); QIcon icon() const; From 31312dc23e1888093a7dd2e383d8fc03d047d3e9 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 20 Jul 2023 13:15:49 +0200 Subject: [PATCH 0407/1777] Examples: Re-add categories for sorting that got accidentally lost while merging 11.0 because the code moved Change-Id: I786d89f0909ccf5f3159a734b1d10d78e96904c5 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/qtsupport/exampleslistmodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index b1914350d3e..a35015d6aa8 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -333,11 +333,15 @@ Q_GLOBAL_STATIC_WITH_ARGS(QStringList, << "Desktop" << "Mobile" << "Embedded" + << "Graphics & Multimedia" << "Graphics" + << "Data Visualization & 3D" + << "Data Processing & I/O" << "Input/Output" << "Connectivity" << "Networking" << "Positioning & Location" + << "Web Technologies" << "Internationalization"}); void ExamplesViewController::updateExamples() From 9b0d90ec3389c7317b0d4968b944d37844c0d9fe Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 14:25:13 +0200 Subject: [PATCH 0408/1777] Help: Clean up constants definitions Some unused, some style. Change-Id: I3308e2c7a6a4ce861d32889682f4a57b45d4f894 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/help/helpconstants.h | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/plugins/help/helpconstants.h b/src/plugins/help/helpconstants.h index f47d325313f..5acb6281056 100644 --- a/src/plugins/help/helpconstants.h +++ b/src/plugins/help/helpconstants.h @@ -6,13 +6,10 @@ #include <QtGlobal> #include <QLatin1String> -namespace Help { -namespace Constants { +namespace Help::Constants { -static const QLatin1String ListSeparator("|"); -static const QLatin1String AboutBlank("about:blank"); -static const QLatin1String WeAddedFilterKey("UnfilteredFilterInserted"); -static const QLatin1String PreviousFilterNameKey("UnfilteredFilterName"); +const QLatin1String ListSeparator("|"); +const QLatin1String AboutBlank("about:blank"); const int P_MODE_HELP = 70; const char ID_MODE_HELP [] = "Help"; @@ -34,14 +31,13 @@ const char HELP_SEARCH[] = "Help.Search"; const char HELP_BOOKMARKS[] = "Help.Bookmarks"; const char HELP_OPENPAGES[] = "Help.OpenPages"; -static const char SB_INDEX[] = QT_TRANSLATE_NOOP("QtC::Help", "Index"); -static const char SB_CONTENTS[] = QT_TRANSLATE_NOOP("QtC::Help", "Contents"); -static const char SB_BOOKMARKS[] = QT_TRANSLATE_NOOP("QtC::Help", "Bookmarks"); -static const char SB_OPENPAGES[] = QT_TRANSLATE_NOOP("QtC::Help", "Open Pages"); -static const char SB_SEARCH[] = QT_TRANSLATE_NOOP("QtC::Help", "Search"); +const char SB_INDEX[] = QT_TRANSLATE_NOOP("QtC::Help", "Index"); +const char SB_CONTENTS[] = QT_TRANSLATE_NOOP("QtC::Help", "Contents"); +const char SB_BOOKMARKS[] = QT_TRANSLATE_NOOP("QtC::Help", "Bookmarks"); +const char SB_OPENPAGES[] = QT_TRANSLATE_NOOP("QtC::Help", "Open Pages"); +const char SB_SEARCH[] = QT_TRANSLATE_NOOP("QtC::Help", "Search"); -static const char TR_OPEN_LINK_AS_NEW_PAGE[] = QT_TRANSLATE_NOOP("QtC::Help", "Open Link as New Page"); -static const char TR_OPEN_LINK_IN_WINDOW[] = QT_TRANSLATE_NOOP("QtC::Help", "Open Link in Window"); +const char TR_OPEN_LINK_AS_NEW_PAGE[] = QT_TRANSLATE_NOOP("QtC::Help", "Open Link as New Page"); +const char TR_OPEN_LINK_IN_WINDOW[] = QT_TRANSLATE_NOOP("QtC::Help", "Open Link in Window"); -} // Constants -} // Help +} // Help::Constants From 934eb86d77b39f3d6b0a185353b3e7666833d9a5 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 19 Jul 2023 11:29:51 +0200 Subject: [PATCH 0409/1777] EditLocation: Use QByteArray directly The `state` in the edit location is used to save the editor state, which is a QByteArray, so there is no use in saving it in a variant instead of a QByteArray directly. Change-Id: I987a7d1bbb66b2cb1c1f4c7cfe0451742ea5bca2 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- .../coreplugin/editormanager/editormanager.cpp | 2 +- src/plugins/coreplugin/editormanager/editorview.cpp | 12 ++++++------ src/plugins/coreplugin/editormanager/editorview.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 09c7f4aa79a..2e321341b01 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -3487,7 +3487,7 @@ void EditorManager::setLastEditLocation(const IEditor* editor) location.document = document; location.filePath = document->filePath(); location.id = document->id(); - location.state = QVariant(state); + location.state = state; d->m_globalLastEditLocation = location; } diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index defe03271de..3ac8405ea26 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -241,7 +241,7 @@ void EditorView::updateEditorHistory(IEditor *editor, QList<EditLocation> &histo location.document = document; location.filePath = document->filePath(); location.id = document->id(); - location.state = QVariant(state); + location.state = state; for (int i = 0; i < history.size(); ++i) { const EditLocation &item = history.at(i); @@ -472,7 +472,7 @@ void EditorView::addCurrentPositionToNavigationHistory(const QByteArray &saveSta location.document = document; location.filePath = document->filePath(); location.id = document->id(); - location.state = QVariant(state); + location.state = state; m_currentNavigationHistoryPosition = qMin(m_currentNavigationHistoryPosition, m_navigationHistory.size()); // paranoia m_navigationHistory.insert(m_currentNavigationHistoryPosition, location); ++m_currentNavigationHistoryPosition; @@ -527,7 +527,7 @@ void EditorView::updateCurrentPositionInNavigationHistory() location->document = document; location->filePath = document->filePath(); location->id = document->id(); - location->state = QVariant(editor->saveState()); + location->state = editor->saveState(); } static bool fileNameWasRemoved(const FilePath &filePath) @@ -558,7 +558,7 @@ void EditorView::goBackInNavigationHistory() continue; } } - editor->restoreState(location.state.toByteArray()); + editor->restoreState(location.state); break; } updateNavigatorActions(); @@ -589,7 +589,7 @@ void EditorView::goForwardInNavigationHistory() continue; } } - editor->restoreState(location.state.toByteArray()); + editor->restoreState(location.state); break; } if (m_currentNavigationHistoryPosition >= m_navigationHistory.size()) @@ -615,7 +615,7 @@ void EditorView::goToEditLocation(const EditLocation &location) } if (editor) { - editor->restoreState(location.state.toByteArray()); + editor->restoreState(location.state); } } diff --git a/src/plugins/coreplugin/editormanager/editorview.h b/src/plugins/coreplugin/editormanager/editorview.h index 03424a93f2d..20cf782bc14 100644 --- a/src/plugins/coreplugin/editormanager/editorview.h +++ b/src/plugins/coreplugin/editormanager/editorview.h @@ -43,7 +43,7 @@ struct EditLocation { QPointer<IDocument> document; Utils::FilePath filePath; Utils::Id id; - QVariant state; + QByteArray state; }; class SplitterOrView; From 2f11a1d32bb69f86b9baef21f09f4d5f7c788416 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 14:47:49 +0200 Subject: [PATCH 0410/1777] Utils: Avoid some FilePath::toString() uses Change-Id: I7d6ee7739e14a25787ca661e10cc24fa6c536780 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/libs/utils/dropsupport.cpp | 2 +- src/libs/utils/terminalinterface.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/utils/dropsupport.cpp b/src/libs/utils/dropsupport.cpp index 9bb86f5caf1..5fa9289a2ab 100644 --- a/src/libs/utils/dropsupport.cpp +++ b/src/libs/utils/dropsupport.cpp @@ -181,7 +181,7 @@ void DropMimeData::addFile(const FilePath &filePath, int line, int column) { // standard mime data QList<QUrl> currentUrls = urls(); - currentUrls.append(QUrl::fromLocalFile(filePath.toString())); + currentUrls.append(filePath.toUrl()); setUrls(currentUrls); // special mime data m_files.append(DropSupport::FileSpec(filePath, line, column)); diff --git a/src/libs/utils/terminalinterface.cpp b/src/libs/utils/terminalinterface.cpp index 204cd79d7a1..9fb226ece54 100644 --- a/src/libs/utils/terminalinterface.cpp +++ b/src/libs/utils/terminalinterface.cpp @@ -45,12 +45,12 @@ static QString msgUnexpectedOutput(const QByteArray &what) static QString msgCannotChangeToWorkDir(const FilePath &dir, const QString &why) { - return Tr::tr("Cannot change to working directory \"%1\": %2").arg(dir.toString(), why); + return Tr::tr("Cannot change to working directory \"%1\": %2").arg(dir.toUserOutput(), why); } -static QString msgCannotExecute(const QString &p, const QString &why) +static QString msgCannotExecute(const FilePath &p, const QString &why) { - return Tr::tr("Cannot execute \"%1\": %2").arg(p, why); + return Tr::tr("Cannot execute \"%1\": %2").arg(p.toUserOutput(), why); } static QString msgPromptToClose() @@ -169,7 +169,7 @@ void TerminalInterface::onStubReadyRead() errnoToString(out.mid(10).toInt()))); } else if (out.startsWith("err:exec ")) { emitError(QProcess::FailedToStart, - msgCannotExecute(m_setup.m_commandLine.executable().toString(), + msgCannotExecute(m_setup.m_commandLine.executable(), errnoToString(out.mid(9).toInt()))); } else if (out.startsWith("spid ")) { d->envListFile.reset(); From 11e1c7b1a425e29271783ae8f6a0e6a090752585 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 10:49:35 +0200 Subject: [PATCH 0411/1777] Debugger: Move CommonOptionsPage to new settings scheme Change-Id: I851931d3b0536659dc2e53a67b9879caad2f3166 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/debugger/commonoptionspage.cpp | 156 +++++++++++++++-- src/plugins/debugger/commonoptionspage.h | 61 ++++++- src/plugins/debugger/debuggeractions.cpp | 164 +++--------------- src/plugins/debugger/debuggeractions.h | 89 +++------- src/plugins/debugger/debuggerengine.cpp | 2 +- src/plugins/debugger/debuggerplugin.cpp | 2 - .../debuggersourcepathmappingwidget.cpp | 2 +- src/plugins/debugger/gdb/gdbsettings.cpp | 12 +- 8 files changed, 252 insertions(+), 236 deletions(-) diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 0369ed14893..d21aab57c91 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -7,19 +7,133 @@ #include "debuggerinternalconstants.h" #include "debuggertr.h" +#ifdef Q_OS_WIN +#include "registerpostmortemaction.h" +#endif + #include <utils/layoutbuilder.h> +#include <QGuiApplication> + using namespace Core; using namespace Debugger::Constants; using namespace Utils; namespace Debugger::Internal { -/////////////////////////////////////////////////////////////////////// -// -// CommonOptionsPage -// -/////////////////////////////////////////////////////////////////////// +// CommonSettings + +CommonSettings &commonSettings() +{ + static CommonSettings settings; + return settings; +} + +CommonSettings::CommonSettings() +{ + const QString debugModeGroup("DebugMode"); + + useAlternatingRowColors.setSettingsKey(debugModeGroup, "UseAlternatingRowColours"); + useAlternatingRowColors.setLabelText(Tr::tr("Use alternating row colors in debug views")); + + stationaryEditorWhileStepping.setSettingsKey(debugModeGroup, "StationaryEditorWhileStepping"); + stationaryEditorWhileStepping.setLabelText(Tr::tr("Keep editor stationary when stepping")); + stationaryEditorWhileStepping.setToolTip( + Tr::tr("Scrolls the editor only when it is necessary to keep the current line in view, " + "instead of keeping the next statement centered at all times.")); + + forceLoggingToConsole.setSettingsKey(debugModeGroup, "ForceLoggingToConsole"); + forceLoggingToConsole.setLabelText(Tr::tr("Force logging to console")); + forceLoggingToConsole.setToolTip( + Tr::tr("Sets QT_LOGGING_TO_CONSOLE=1 in the environment of the debugged program, " + "preventing storing debug output in system logs.")); + + fontSizeFollowsEditor.setSettingsKey(debugModeGroup, "FontSizeFollowsEditor"); + fontSizeFollowsEditor.setToolTip(Tr::tr("Changes the font size in the debugger views when " + "the font size in the main editor changes.")); + fontSizeFollowsEditor.setLabelText(Tr::tr("Debugger font size follows main editor")); + +#ifdef Q_OS_WIN + registerForPostMortem = new RegisterPostMortemAction; + registerForPostMortem->setSettingsKey(debugModeGroup, "RegisterForPostMortem"); + registerForPostMortem->setToolTip(Tr::tr("Registers %1 for debugging crashed applications.") + .arg(QGuiApplication::applicationDisplayName())); + registerForPostMortem->setLabelText( + Tr::tr("Use %1 for post-mortem debugging").arg(QGuiApplication::applicationDisplayName())); + registerAspect(registerForPostMortem); +#else + // Some dummy. + registerForPostMortem = new BoolAspect; + registerForPostMortem->setVisible(false); +#endif + + maximalStackDepth.setSettingsKey(debugModeGroup, "MaximalStackDepth"); + maximalStackDepth.setDefaultValue(20); + maximalStackDepth.setSpecialValueText(Tr::tr("<unlimited>")); + maximalStackDepth.setRange(0, 1000); + maximalStackDepth.setSingleStep(5); + maximalStackDepth.setLabelText(Tr::tr("Maximum stack depth:")); + + showQmlObjectTree.setSettingsKey(debugModeGroup, "ShowQmlObjectTree"); + showQmlObjectTree.setDefaultValue(true); + showQmlObjectTree.setToolTip(Tr::tr("Shows QML object tree in Locals and Expressions " + "when connected and not stepping.")); + showQmlObjectTree.setLabelText(Tr::tr("Show QML object tree")); + + const QString t = Tr::tr("Stopping and stepping in the debugger " + "will automatically open views associated with the current location.") + '\n'; + + closeSourceBuffersOnExit.setSettingsKey(debugModeGroup, "CloseBuffersOnExit"); + closeSourceBuffersOnExit.setLabelText(Tr::tr("Close temporary source views on debugger exit")); + closeSourceBuffersOnExit.setToolTip(t + Tr::tr("Closes automatically opened source views when the debugger exits.")); + + closeMemoryBuffersOnExit.setSettingsKey(debugModeGroup, "CloseMemoryBuffersOnExit"); + closeMemoryBuffersOnExit.setDefaultValue(true); + closeMemoryBuffersOnExit.setLabelText(Tr::tr("Close temporary memory views on debugger exit")); + closeMemoryBuffersOnExit.setToolTip(t + Tr::tr("Closes automatically opened memory views when the debugger exits.")); + + switchModeOnExit.setSettingsKey(debugModeGroup, "SwitchModeOnExit"); + switchModeOnExit.setLabelText(Tr::tr("Switch to previous mode on debugger exit")); + + breakpointsFullPathByDefault.setSettingsKey(debugModeGroup, "BreakpointsFullPath"); + breakpointsFullPathByDefault.setToolTip(Tr::tr("Enables a full file path in breakpoints by default also for GDB.")); + breakpointsFullPathByDefault.setLabelText(Tr::tr("Set breakpoints using a full absolute path")); + + raiseOnInterrupt.setSettingsKey(debugModeGroup, "RaiseOnInterrupt"); + raiseOnInterrupt.setDefaultValue(true); + raiseOnInterrupt.setLabelText(Tr::tr("Bring %1 to foreground when application interrupts") + .arg(QGuiApplication::applicationDisplayName())); + + useAnnotationsInMainEditor.setSettingsKey(debugModeGroup, "UseAnnotations"); + useAnnotationsInMainEditor.setLabelText(Tr::tr("Use annotations in main editor when debugging")); + useAnnotationsInMainEditor.setToolTip( + "<p>" + + Tr::tr("Shows simple variable values " + "as annotations in the main editor during debugging.")); + useAnnotationsInMainEditor.setDefaultValue(true); + + warnOnReleaseBuilds.setSettingsKey(debugModeGroup, "WarnOnReleaseBuilds"); + warnOnReleaseBuilds.setDefaultValue(true); + warnOnReleaseBuilds.setLabelText(Tr::tr("Warn when debugging \"Release\" builds")); + warnOnReleaseBuilds.setToolTip(Tr::tr("Shows a warning when starting the debugger " + "on a binary with insufficient debug information.")); + + useToolTipsInMainEditor.setSettingsKey(debugModeGroup, "UseToolTips"); + useToolTipsInMainEditor.setLabelText(Tr::tr("Use tooltips in main editor when debugging")); + useToolTipsInMainEditor.setToolTip( + "<p>" + + Tr::tr("Enables tooltips for variable " + "values during debugging. Since this can slow down debugging and " + "does not provide reliable information as it does not use scope " + "information, it is switched off by default.")); + useToolTipsInMainEditor.setDefaultValue(true); +} + +CommonSettings::~CommonSettings() +{ + delete registerForPostMortem; +} + class CommonOptionsPageWidget : public Core::IOptionsPageWidget { @@ -67,23 +181,12 @@ public: } }; -CommonOptionsPage::CommonOptionsPage() -{ - setId(DEBUGGER_COMMON_SETTINGS_ID); - setDisplayName(Tr::tr("General")); - setCategory(DEBUGGER_SETTINGS_CATEGORY); - setDisplayCategory(Tr::tr("Debugger")); - setCategoryIconPath(":/debugger/images/settingscategory_debugger.png"); - setWidgetCreator([] { return new CommonOptionsPageWidget; }); -} - -QString CommonOptionsPage::msgSetBreakpointAtFunction(const char *function) +QString msgSetBreakpointAtFunction(const char *function) { return Tr::tr("Stop when %1() is called").arg(QLatin1String(function)); } -QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *function, - const QString &hint) +QString msgSetBreakpointAtFunctionToolTip(const char *function, const QString &hint) { QString result = "<html><head/><body>"; result += Tr::tr("Always adds a breakpoint on the <i>%1()</i> function.") @@ -96,6 +199,23 @@ QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *functio return result; } +// CommonSettingPage + +class CommonSettingsPage final : public Core::IOptionsPage +{ +public: + CommonSettingsPage() + { + setId(DEBUGGER_COMMON_SETTINGS_ID); + setDisplayName(Tr::tr("General")); + setCategory(DEBUGGER_SETTINGS_CATEGORY); + setDisplayCategory(Tr::tr("Debugger")); + setCategoryIconPath(":/debugger/images/settingscategory_debugger.png"); + setWidgetCreator([] { return new CommonOptionsPageWidget; }); + } +}; + +const CommonSettingsPage commonSettingsPage; /////////////////////////////////////////////////////////////////////// // diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h index 33349605115..f5806b39d69 100644 --- a/src/plugins/debugger/commonoptionspage.h +++ b/src/plugins/debugger/commonoptionspage.h @@ -7,16 +7,65 @@ namespace Debugger::Internal { -class CommonOptionsPage final : public Core::IOptionsPage +class SourcePathMapAspectPrivate; + +// Entries starting with '(' are considered regular expressions in the ElfReader. +// This is useful when there are multiple build machines with different +// path, and the user would like to match anything up to some known +// directory to his local project. +// Syntax: (/home/.*)/KnownSubdir -> /home/my/project +using SourcePathMap = QMap<QString, QString>; + +class SourcePathMapAspect : public Utils::TypedAspect<SourcePathMap> { public: - CommonOptionsPage(); + SourcePathMapAspect(); + ~SourcePathMapAspect() override; - static QString msgSetBreakpointAtFunction(const char *function); - static QString msgSetBreakpointAtFunctionToolTip(const char *function, - const QString &hint = {}); + void fromMap(const QVariantMap &map) override; + void toMap(QVariantMap &map) const override; + + void addToLayout(Layouting::LayoutItem &parent) override; + + void readSettings() override; + void writeSettings() const override; + +private: + void guiToBuffer() override; + void bufferToGui() override; + + SourcePathMapAspectPrivate *d = nullptr; }; +class CommonSettings final : public Utils::AspectContainer +{ +public: + CommonSettings(); + ~CommonSettings(); + + Utils::BoolAspect useAlternatingRowColors; + Utils::BoolAspect useAnnotationsInMainEditor; + Utils::BoolAspect useToolTipsInMainEditor; + Utils::BoolAspect closeSourceBuffersOnExit; + Utils::BoolAspect closeMemoryBuffersOnExit; + Utils::BoolAspect raiseOnInterrupt; + Utils::BoolAspect breakpointsFullPathByDefault; + Utils::BoolAspect warnOnReleaseBuilds; + Utils::IntegerAspect maximalStackDepth; + + Utils::BoolAspect fontSizeFollowsEditor; + Utils::BoolAspect switchModeOnExit; + Utils::BoolAspect showQmlObjectTree; + Utils::BoolAspect stationaryEditorWhileStepping; + Utils::BoolAspect forceLoggingToConsole; + + SourcePathMapAspect sourcePathMap; + + Utils::BoolAspect *registerForPostMortem = nullptr; +}; + +CommonSettings &commonSettings(); + class LocalsAndExpressionsOptionsPage final : public Core::IOptionsPage { public: @@ -24,3 +73,5 @@ public: }; } // Debugger::Internal + +Q_DECLARE_METATYPE(Debugger::Internal::SourcePathMap) diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index aaf9971a623..e1b4c57fb4d 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -9,10 +9,6 @@ #include "debuggertr.h" #include "gdb/gdbsettings.h" -#ifdef Q_OS_WIN -#include "registerpostmortemaction.h" -#endif - #include <coreplugin/coreconstants.h> #include <utils/hostosinfo.h> @@ -25,14 +21,7 @@ using namespace Utils; namespace Debugger::Internal { -const char debugModeSettingsGroupC[] = "DebugMode"; -const char cdbSettingsGroupC[] = "CDB2"; - -////////////////////////////////////////////////////////////////////////// -// // DebuggerSettings -// -////////////////////////////////////////////////////////////////////////// DebuggerSettings &settings() { @@ -41,6 +30,25 @@ DebuggerSettings &settings() } DebuggerSettings::DebuggerSettings() : + useAlternatingRowColors{commonSettings().useAlternatingRowColors}, + useAnnotationsInMainEditor{commonSettings().useAnnotationsInMainEditor}, + useToolTipsInMainEditor{commonSettings().useToolTipsInMainEditor}, + closeSourceBuffersOnExit{commonSettings().closeSourceBuffersOnExit}, + closeMemoryBuffersOnExit{commonSettings().closeMemoryBuffersOnExit}, + raiseOnInterrupt{commonSettings().raiseOnInterrupt}, + breakpointsFullPathByDefault{commonSettings().breakpointsFullPathByDefault}, + warnOnReleaseBuilds{commonSettings().warnOnReleaseBuilds}, + maximalStackDepth{commonSettings().maximalStackDepth}, + + fontSizeFollowsEditor{commonSettings().fontSizeFollowsEditor}, + switchModeOnExit{commonSettings().switchModeOnExit}, + showQmlObjectTree{commonSettings().showQmlObjectTree}, + stationaryEditorWhileStepping{commonSettings().stationaryEditorWhileStepping}, + forceLoggingToConsole{commonSettings().forceLoggingToConsole}, + + sourcePathMap{commonSettings().sourcePathMap}, + registerForPostMortem{*commonSettings().registerForPostMortem}, + gdbWatchdogTimeout{gdbSettings().gdbWatchdogTimeout}, skipKnownFrames{gdbSettings().skipKnownFrames}, useMessageBoxForSignals{gdbSettings().useMessageBoxForSignals}, @@ -63,8 +71,8 @@ DebuggerSettings::DebuggerSettings() : enableReverseDebugging{gdbSettings().enableReverseDebugging}, multiInferior{gdbSettings().multiInferior} { - const QString debugModeGroup(debugModeSettingsGroupC); - const QString cdbSettingsGroup(cdbSettingsGroupC); + const QString debugModeGroup("DebugMode"); + const QString cdbSettingsGroup("CDB2"); settingsDialog.setLabelText(Tr::tr("Configure Debugger...")); @@ -101,29 +109,6 @@ DebuggerSettings::DebuggerSettings() : alwaysAdjustColumnWidths.setSettingsKey(debugModeGroup, "AlwaysAdjustColumnWidths"); alwaysAdjustColumnWidths.setDefaultValue(true); - // Needed by QML Inspector - //useAlternatingRowColors.setLabelText(Tr::tr("Use Alternating Row Colors")); - useAlternatingRowColors.setSettingsKey(debugModeGroup, "UseAlternatingRowColours"); - useAlternatingRowColors.setLabelText(Tr::tr("Use alternating row colors in debug views")); - - stationaryEditorWhileStepping.setSettingsKey(debugModeGroup, "StationaryEditorWhileStepping"); - stationaryEditorWhileStepping.setLabelText(Tr::tr("Keep editor stationary when stepping")); - stationaryEditorWhileStepping.setToolTip(Tr::tr("Scrolls the editor only when it is necessary " - "to keep the current line in view, " - "instead of keeping the next statement centered at " - "all times.")); - - forceLoggingToConsole.setSettingsKey(debugModeGroup, "ForceLoggingToConsole"); - forceLoggingToConsole.setLabelText(Tr::tr("Force logging to console")); - forceLoggingToConsole.setToolTip(Tr::tr("Sets QT_LOGGING_TO_CONSOLE=1 in the environment " - "of the debugged program, preventing storing debug output " - "in system logs.")); - - fontSizeFollowsEditor.setSettingsKey(debugModeGroup, "FontSizeFollowsEditor"); - fontSizeFollowsEditor.setToolTip(Tr::tr("Changes the font size in the debugger views when " - "the font size in the main editor changes.")); - fontSizeFollowsEditor.setLabelText(Tr::tr("Debugger font size follows main editor")); - logTimeStamps.setLabelText(Tr::tr("Log Time Stamps")); logTimeStamps.setSettingsKey(debugModeGroup, "LogTimeStamps"); @@ -150,11 +135,9 @@ DebuggerSettings::DebuggerSettings() : cdbBreakEvents.setSettingsKey(cdbSettingsGroup, "BreakEvent"); cdbBreakOnCrtDbgReport.setSettingsKey(cdbSettingsGroup, "BreakOnCrtDbgReport"); - cdbBreakOnCrtDbgReport.setLabelText( - CommonOptionsPage::msgSetBreakpointAtFunction(Constants::CRT_DEBUG_REPORT)); - cdbBreakOnCrtDbgReport.setToolTip( - CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(Constants::CRT_DEBUG_REPORT, - Tr::tr("Catches runtime error messages caused by assert(), for example."))); + cdbBreakOnCrtDbgReport.setLabelText(msgSetBreakpointAtFunction(Constants::CRT_DEBUG_REPORT)); + cdbBreakOnCrtDbgReport.setToolTip(msgSetBreakpointAtFunctionToolTip(Constants::CRT_DEBUG_REPORT, + Tr::tr("Catches runtime error messages caused by assert(), for example."))); useCdbConsole.setSettingsKey(cdbSettingsGroup, "CDB_Console"); useCdbConsole.setToolTip("<html><head/><body><p>" + Tr::tr( @@ -261,57 +244,9 @@ DebuggerSettings::DebuggerSettings() : // Label text is intentional empty in the GUI. extraDumperFile.setToolTip(Tr::tr("Path to a Python file containing additional data dumpers.")); - const QString t = Tr::tr("Stopping and stepping in the debugger " - "will automatically open views associated with the current location.") + '\n'; - - closeSourceBuffersOnExit.setSettingsKey(debugModeGroup, "CloseBuffersOnExit"); - closeSourceBuffersOnExit.setLabelText(Tr::tr("Close temporary source views on debugger exit")); - closeSourceBuffersOnExit.setToolTip(t + Tr::tr("Closes automatically opened source views when the debugger exits.")); - - closeMemoryBuffersOnExit.setSettingsKey(debugModeGroup, "CloseMemoryBuffersOnExit"); - closeMemoryBuffersOnExit.setDefaultValue(true); - closeMemoryBuffersOnExit.setLabelText(Tr::tr("Close temporary memory views on debugger exit")); - closeMemoryBuffersOnExit.setToolTip(t + Tr::tr("Closes automatically opened memory views when the debugger exits.")); - - switchModeOnExit.setSettingsKey(debugModeGroup, "SwitchModeOnExit"); - switchModeOnExit.setLabelText(Tr::tr("Switch to previous mode on debugger exit")); - - breakpointsFullPathByDefault.setSettingsKey(debugModeGroup, "BreakpointsFullPath"); - breakpointsFullPathByDefault.setToolTip(Tr::tr("Enables a full file path in breakpoints by default also for GDB.")); - breakpointsFullPathByDefault.setLabelText(Tr::tr("Set breakpoints using a full absolute path")); - - raiseOnInterrupt.setSettingsKey(debugModeGroup, "RaiseOnInterrupt"); - raiseOnInterrupt.setDefaultValue(true); - raiseOnInterrupt.setLabelText(Tr::tr("Bring %1 to foreground when application interrupts") - .arg(QGuiApplication::applicationDisplayName())); - autoQuit.setSettingsKey(debugModeGroup, "AutoQuit"); autoQuit.setLabelText(Tr::tr("Automatically Quit Debugger")); - useAnnotationsInMainEditor.setSettingsKey(debugModeGroup, "UseAnnotations"); - useAnnotationsInMainEditor.setLabelText(Tr::tr("Use annotations in main editor when debugging")); - useAnnotationsInMainEditor.setToolTip( - "<p>" - + Tr::tr("Shows simple variable values " - "as annotations in the main editor during debugging.")); - useAnnotationsInMainEditor.setDefaultValue(true); - - warnOnReleaseBuilds.setSettingsKey(debugModeGroup, "WarnOnReleaseBuilds"); - warnOnReleaseBuilds.setDefaultValue(true); - warnOnReleaseBuilds.setLabelText(Tr::tr("Warn when debugging \"Release\" builds")); - warnOnReleaseBuilds.setToolTip(Tr::tr("Shows a warning when starting the debugger " - "on a binary with insufficient debug information.")); - - useToolTipsInMainEditor.setSettingsKey(debugModeGroup, "UseToolTips"); - useToolTipsInMainEditor.setLabelText(Tr::tr("Use tooltips in main editor when debugging")); - useToolTipsInMainEditor.setToolTip( - "<p>" - + Tr::tr("Enables tooltips for variable " - "values during debugging. Since this can slow down debugging and " - "does not provide reliable information as it does not use scope " - "information, it is switched off by default.")); - useToolTipsInMainEditor.setDefaultValue(true); - useToolTipsInLocalsView.setSettingsKey(debugModeGroup, "UseToolTipsInLocalsView"); useToolTipsInLocalsView.setLabelText(Tr::tr("Use Tooltips in Locals View when Debugging")); useToolTipsInLocalsView.setToolTip("<p>" @@ -331,19 +266,6 @@ DebuggerSettings::DebuggerSettings() : "view during debugging.")); useToolTipsInStackView.setDefaultValue(true); -#ifdef Q_OS_WIN - registerForPostMortem = new RegisterPostMortemAction; - registerForPostMortem->setSettingsKey(debugModeGroup, "RegisterForPostMortem"); - registerForPostMortem->setToolTip(Tr::tr("Registers %1 for debugging crashed applications.") - .arg(QGuiApplication::applicationDisplayName())); - registerForPostMortem->setLabelText( - Tr::tr("Use %1 for post-mortem debugging").arg(QGuiApplication::applicationDisplayName())); -#else - // Some dummy. - registerForPostMortem = new BoolAspect; - registerForPostMortem->setVisible(false); -#endif - allPluginBreakpoints.setSettingsKey(debugModeGroup, "AllPluginBreakpoints"); allPluginBreakpoints.setDefaultValue(true); @@ -354,13 +276,6 @@ DebuggerSettings::DebuggerSettings() : selectedPluginBreakpointsPattern.setSettingsKey(debugModeGroup, "SelectedPluginBreakpointsPattern"); selectedPluginBreakpointsPattern.setDefaultValue(QString(".*")); - maximalStackDepth.setSettingsKey(debugModeGroup, "MaximalStackDepth"); - maximalStackDepth.setDefaultValue(20); - maximalStackDepth.setSpecialValueText(Tr::tr("<unlimited>")); - maximalStackDepth.setRange(0, 1000); - maximalStackDepth.setSingleStep(5); - maximalStackDepth.setLabelText(Tr::tr("Maximum stack depth:")); - displayStringLimit.setSettingsKey(debugModeGroup, "DisplayStringLimit"); displayStringLimit.setDefaultValue(300); displayStringLimit.setSpecialValueText(Tr::tr("<unlimited>")); @@ -400,35 +315,9 @@ DebuggerSettings::DebuggerSettings() : // // QML Tools // - showQmlObjectTree.setSettingsKey(debugModeGroup, "ShowQmlObjectTree"); - showQmlObjectTree.setDefaultValue(true); - showQmlObjectTree.setToolTip(Tr::tr("Shows QML object tree in Locals and Expressions " - "when connected and not stepping.")); - showQmlObjectTree.setLabelText(Tr::tr("Show QML object tree")); - const QString qmlInspectorGroup = "QML.Inspector"; showAppOnTop.setSettingsKey(qmlInspectorGroup, "QmlInspector.ShowAppOnTop"); - // Page 1 - page1.registerAspect(&useAlternatingRowColors); - page1.registerAspect(&useAnnotationsInMainEditor); - page1.registerAspect(&useToolTipsInMainEditor); - page1.registerAspect(&closeSourceBuffersOnExit); - page1.registerAspect(&closeMemoryBuffersOnExit); - page1.registerAspect(&raiseOnInterrupt); - page1.registerAspect(&breakpointsFullPathByDefault); - page1.registerAspect(&warnOnReleaseBuilds); - page1.registerAspect(&maximalStackDepth); - - page1.registerAspect(&fontSizeFollowsEditor); - page1.registerAspect(&switchModeOnExit); - page1.registerAspect(&showQmlObjectTree); - page1.registerAspect(&stationaryEditorWhileStepping); - page1.registerAspect(&forceLoggingToConsole); - - page1.registerAspect(&sourcePathMap); - if (HostOsInfo::isWindowsHost()) - page1.registerAspect(registerForPostMortem); // Page 4 page4.registerAspect(&useDebuggingHelpers); @@ -481,11 +370,6 @@ DebuggerSettings::DebuggerSettings() : }); } -DebuggerSettings::~DebuggerSettings() -{ - delete registerForPostMortem; -} - void DebuggerSettings::readSettings() { all.readSettings(); diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index 063967dc90f..9ea285388ae 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -5,56 +5,39 @@ #include <utils/aspects.h> -#include <QCoreApplication> -#include <QHash> #include <QMap> namespace Debugger::Internal { -class SourcePathMapAspectPrivate; - -// Entries starting with '(' are considered regular expressions in the ElfReader. -// This is useful when there are multiple build machines with different -// path, and the user would like to match anything up to some known -// directory to his local project. -// Syntax: (/home/.*)/KnownSubdir -> /home/my/project -using SourcePathMap = QMap<QString, QString>; - -class SourcePathMapAspect : public Utils::TypedAspect<SourcePathMap> -{ -public: - SourcePathMapAspect(); - ~SourcePathMapAspect() override; - - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; - - void addToLayout(Layouting::LayoutItem &parent) override; - - void readSettings() override; - void writeSettings() const override; - -private: - void guiToBuffer() override; - void bufferToGui() override; - - SourcePathMapAspectPrivate *d = nullptr; -}; - -class GeneralSettings -{ - GeneralSettings(); - ~GeneralSettings(); -}; - class DebuggerSettings { public: - explicit DebuggerSettings(); - ~DebuggerSettings(); + DebuggerSettings(); static QString dump(); + // Page 1: General + Utils::BoolAspect &useAlternatingRowColors; + Utils::BoolAspect &useAnnotationsInMainEditor; + Utils::BoolAspect &useToolTipsInMainEditor; + Utils::BoolAspect &closeSourceBuffersOnExit; + Utils::BoolAspect &closeMemoryBuffersOnExit; + Utils::BoolAspect &raiseOnInterrupt; + Utils::BoolAspect &breakpointsFullPathByDefault; + Utils::BoolAspect &warnOnReleaseBuilds; + Utils::IntegerAspect &maximalStackDepth; + + Utils::BoolAspect &fontSizeFollowsEditor; + Utils::BoolAspect &switchModeOnExit; + Utils::BoolAspect &showQmlObjectTree; + Utils::BoolAspect &stationaryEditorWhileStepping; + Utils::BoolAspect &forceLoggingToConsole; + + Utils::TypedAspect<QMap<QString, QString>> &sourcePathMap; + + Utils::BoolAspect ®isterForPostMortem; + + // Page 2: Gdb Utils::IntegerAspect &gdbWatchdogTimeout; Utils::BoolAspect &skipKnownFrames; Utils::BoolAspect &useMessageBoxForSignals; @@ -78,25 +61,6 @@ public: Utils::BoolAspect &enableReverseDebugging; Utils::BoolAspect &multiInferior; - // Page 1: General - Utils::BoolAspect useAlternatingRowColors; - Utils::BoolAspect useAnnotationsInMainEditor; - Utils::BoolAspect useToolTipsInMainEditor; - Utils::BoolAspect closeSourceBuffersOnExit; - Utils::BoolAspect closeMemoryBuffersOnExit; - Utils::BoolAspect raiseOnInterrupt; - Utils::BoolAspect breakpointsFullPathByDefault; - Utils::BoolAspect warnOnReleaseBuilds; - Utils::IntegerAspect maximalStackDepth; - - Utils::BoolAspect fontSizeFollowsEditor; - Utils::BoolAspect switchModeOnExit; - Utils::BoolAspect showQmlObjectTree; - Utils::BoolAspect stationaryEditorWhileStepping; - Utils::BoolAspect forceLoggingToConsole; - - SourcePathMapAspect sourcePathMap; - // Page 4: Locals and expressions Utils::BoolAspect useDebuggingHelpers; Utils::BoolAspect useCodeModel; @@ -119,8 +83,6 @@ public: Utils::BoolAspect secondChanceExceptionTaskEntry; Utils::BoolAspect ignoreFirstChanceAccessViolation; - Utils::BoolAspect *registerForPostMortem = nullptr; - // Page 6: CDB Paths Utils::StringListAspect cdbSymbolPaths; Utils::StringListAspect cdbSourcePaths; @@ -172,6 +134,7 @@ private: DebuggerSettings &settings(); -} // Debugger::Internal +QString msgSetBreakpointAtFunction(const char *function); +QString msgSetBreakpointAtFunctionToolTip(const char *function, const QString &hint = {}); -Q_DECLARE_METATYPE(Debugger::Internal::SourcePathMap) +} // Debugger::Internal diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index e7f8b47848d..48d4a938cea 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -2821,7 +2821,7 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp) bool hasEmbeddedInfo = elfData.indexOf(".debug_info") >= 0; bool hasLink = elfData.indexOf(".gnu_debuglink") >= 0; if (hasEmbeddedInfo) { - const SourcePathMap sourcePathMap = settings().sourcePathMap(); + const QMap<QString, QString> sourcePathMap = settings().sourcePathMap(); QList<QPair<QRegularExpression, QString>> globalRegExpSourceMap; globalRegExpSourceMap.reserve(sourcePathMap.size()); for (auto it = sourcePathMap.begin(), end = sourcePathMap.end(); it != end; ++it) { diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 6a6f60f08d5..63ab6b95d41 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -25,7 +25,6 @@ #include "sourceutils.h" #include "shared/hostutils.h" #include "console/console.h" - #include "commonoptionspage.h" #include "analyzer/analyzerconstants.h" @@ -697,7 +696,6 @@ public: std::unique_ptr<Perspective> m_perspectiveCmake; DebuggerKitAspect debuggerKitAspect; - CommonOptionsPage commonOptionsPage; DebuggerRunWorkerFactory debuggerWorkerFactory; diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index a8959ff4455..6ec92416ed8 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -3,7 +3,7 @@ #include "debuggersourcepathmappingwidget.h" -#include "debuggeractions.h" +#include "commonoptionspage.h" #include "debuggerengine.h" #include "debuggertr.h" diff --git a/src/plugins/debugger/gdb/gdbsettings.cpp b/src/plugins/debugger/gdb/gdbsettings.cpp index 31c8e3f6912..eef19df9719 100644 --- a/src/plugins/debugger/gdb/gdbsettings.cpp +++ b/src/plugins/debugger/gdb/gdbsettings.cpp @@ -69,18 +69,18 @@ GdbSettings::GdbSettings() breakOnWarning.setLabelText(Tr::tr("Break on \"qWarning\"")); breakOnWarning.setSettingsKey("BreakOnWarning"); // FIXME: Move to common settings page. - breakOnWarning.setLabelText(CommonOptionsPage::msgSetBreakpointAtFunction("qWarning")); - breakOnWarning.setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qWarning")); + breakOnWarning.setLabelText(msgSetBreakpointAtFunction("qWarning")); + breakOnWarning.setToolTip(msgSetBreakpointAtFunctionToolTip("qWarning")); breakOnFatal.setLabelText(Tr::tr("Break on \"qFatal\"")); breakOnFatal.setSettingsKey("BreakOnFatal"); - breakOnFatal.setLabelText(CommonOptionsPage::msgSetBreakpointAtFunction("qFatal")); - breakOnFatal.setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qFatal")); + breakOnFatal.setLabelText(msgSetBreakpointAtFunction("qFatal")); + breakOnFatal.setToolTip(msgSetBreakpointAtFunctionToolTip("qFatal")); breakOnAbort.setLabelText(Tr::tr("Break on \"abort\"")); breakOnAbort.setSettingsKey("BreakOnAbort"); - breakOnAbort.setLabelText(CommonOptionsPage::msgSetBreakpointAtFunction("abort")); - breakOnAbort.setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("abort")); + breakOnAbort.setLabelText(msgSetBreakpointAtFunction("abort")); + breakOnAbort.setToolTip(msgSetBreakpointAtFunctionToolTip("abort")); loadGdbInit.setSettingsKey("LoadGdbInit"); loadGdbInit.setDefaultValue(true); From 7cc607875667debf14d2fcd46a0c051bdb1027bb Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 14:25:13 +0200 Subject: [PATCH 0412/1777] Utils: Let aspect transition functions indicate there was a change Helps to make it easier to reason about the necessity of emitting *changed signals. Change-Id: Ieab29b25f5cc2799e193417b9cab02c99501c60a Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 82 +++++++++++++------ src/libs/utils/aspects.h | 57 ++++++++----- src/plugins/debugger/commonoptionspage.h | 2 +- .../debuggersourcepathmappingwidget.cpp | 4 +- src/plugins/valgrind/valgrindsettings.cpp | 6 +- src/plugins/valgrind/valgrindsettings.h | 2 +- 6 files changed, 103 insertions(+), 50 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 55a9ee77fa7..381c396b6d0 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1203,8 +1203,9 @@ void StringAspect::addToLayout(LayoutItem &parent) d->m_checker->addToLayout(parent); } -void StringAspect::guiToBuffer() +bool StringAspect::guiToBuffer() { + const QString old = m_buffer; switch (d->m_displayStyle) { case PathChooserDisplay: if (d->m_pathChooserDisplay) @@ -1220,22 +1221,26 @@ void StringAspect::guiToBuffer() case LabelDisplay: break; } + return m_buffer != old; } -void StringAspect::bufferToInternal() +bool StringAspect::bufferToInternal() { + const QString old = m_internal; if (d->m_valueAcceptor) { if (const std::optional<QString> tmp = d->m_valueAcceptor(m_internal, m_buffer)) m_internal = *tmp; - return; + } else { + m_internal = m_buffer; } - - m_internal = m_buffer; + return m_internal != old; } -void StringAspect::internalToBuffer() +bool StringAspect::internalToBuffer() { + const QString old = m_buffer; m_buffer = d->m_displayFilter ? d->m_displayFilter(m_internal) : m_internal; + return m_buffer != old; } void StringAspect::bufferToGui() @@ -1391,10 +1396,12 @@ void ColorAspect::addToLayout(Layouting::LayoutItem &parent) this, &ColorAspect::handleGuiChanged); } -void ColorAspect::guiToBuffer() +bool ColorAspect::guiToBuffer() { + const QColor old = m_buffer; if (d->m_colorButton) m_buffer = d->m_colorButton->color(); + return m_buffer != old; } void ColorAspect::bufferToGui() @@ -1496,12 +1503,14 @@ QAction *BoolAspect::action() return act; } -void BoolAspect::guiToBuffer() +bool BoolAspect::guiToBuffer() { + const bool old = m_buffer; if (d->m_button) m_buffer = d->m_button->isChecked(); else if (d->m_groupBox) m_buffer = d->m_groupBox->isChecked(); + return m_buffer != old; } void BoolAspect::bufferToGui() @@ -1603,8 +1612,9 @@ void SelectionAspect::addToLayout(Layouting::LayoutItem &parent) } } -void SelectionAspect::guiToBuffer() +bool SelectionAspect::guiToBuffer() { + const int old = m_buffer; switch (d->m_displayStyle) { case DisplayStyle::RadioButtons: if (d->m_buttonGroup) @@ -1615,6 +1625,7 @@ void SelectionAspect::guiToBuffer() m_buffer = d->m_comboBox->currentIndex(); break; } + return m_buffer != old; } void SelectionAspect::bufferToGui() @@ -1806,8 +1817,9 @@ void MultiSelectionAspect::bufferToGui() } } -void MultiSelectionAspect::guiToBuffer() +bool MultiSelectionAspect::guiToBuffer() { + const QStringList old = m_buffer; if (d->m_listView) { m_buffer.clear(); const int n = d->m_listView->count(); @@ -1818,6 +1830,7 @@ void MultiSelectionAspect::guiToBuffer() m_buffer.append(item->text()); } } + return m_buffer != old; } @@ -1869,10 +1882,12 @@ void IntegerAspect::addToLayout(Layouting::LayoutItem &parent) this, &IntegerAspect::handleGuiChanged); } -void IntegerAspect::guiToBuffer() +bool IntegerAspect::guiToBuffer() { + const qint64 old = m_buffer; if (d->m_spinBox) m_buffer = d->m_spinBox->value() * d->m_displayScaleFactor; + return m_buffer != old; } void IntegerAspect::bufferToGui() @@ -1968,10 +1983,12 @@ void DoubleAspect::addToLayout(LayoutItem &builder) this, &DoubleAspect::handleGuiChanged); } -void DoubleAspect::guiToBuffer() +bool DoubleAspect::guiToBuffer() { + const double old = m_buffer; if (d->m_spinBox) m_buffer = d->m_spinBox->value(); + return m_buffer != old; } void DoubleAspect::bufferToGui() @@ -2447,46 +2464,61 @@ BaseAspect::Data::Ptr BaseAspect::extractData() const No-op otherwise. */ void BaseAspect::bufferToGui() -{} +{ +} /* Mirrors the data stored in GUI element if they are already created to the internal volatile value. No-op otherwise. + + \return true when the buffered volatile value changed. */ -void BaseAspect::guiToBuffer() -{} +bool BaseAspect::guiToBuffer() +{ + return false; +} /* Mirrors buffered volatile value to the internal value. This function is used for \c apply(). + + \return true when the internal value changed. */ -void BaseAspect::bufferToInternal() -{} +bool BaseAspect::bufferToInternal() +{ + return false; +} -void BaseAspect::internalToBuffer() -{} +bool BaseAspect::internalToBuffer() +{ + return false; +} /* Applies common postprocessing like macro expansion. */ -void BaseAspect::internalToExternal() -{} +bool BaseAspect::internalToExternal() +{ + return false; +} /* Mirrors externally visible value to internal volatile value. */ -void BaseAspect::externalToInternal() -{} +bool BaseAspect::externalToInternal() +{ + return false; +} void BaseAspect::handleGuiChanged() { - guiToBuffer(); - emit volatileValueChanged(); + if (guiToBuffer()) + volatileValueChanged(); if (isAutoApply()) apply(); } diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index ea12b9b7b82..7a85f2af649 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -165,17 +165,18 @@ public: static QSettings *settings(); signals: - void changed(); + void changed(); // "internal" void volatileValueChanged(); + void externalValueChanged(); void labelLinkActivated(const QString &link); protected: - virtual void internalToBuffer(); - virtual void bufferToInternal(); + virtual bool internalToBuffer(); + virtual bool bufferToInternal(); virtual void bufferToGui(); - virtual void guiToBuffer(); - virtual void internalToExternal(); - virtual void externalToInternal(); + virtual bool guiToBuffer(); + virtual bool internalToExternal(); + virtual bool externalToInternal(); virtual void handleGuiChanged(); @@ -247,10 +248,14 @@ public: void setValue(const ValueType &value) { + const bool changes = m_internal != value; m_internal = value; - internalToBuffer(); + if (internalToBuffer()) + emit volatileValueChanged(); bufferToGui(); internalToExternal(); + if (changes) + emit changed(); } void setValueQuietly(const ValueType &value) @@ -281,24 +286,36 @@ protected: return m_internal != m_buffer; } - void internalToBuffer() override + bool internalToBuffer() override { + if (m_buffer == m_internal) + return false; m_buffer = m_internal; + return true; } - void bufferToInternal() override + bool bufferToInternal() override { + if (m_buffer == m_internal) + return false; m_internal = m_buffer; + return true; } - void internalToExternal() override + bool internalToExternal() override { + if (m_external == m_internal) + return false; m_external = m_internal; + return true; } - void externalToInternal() override + bool externalToInternal() override { + if (m_external == m_internal) + return false; m_internal = m_external; + return true; } QVariant variantValue() const override @@ -357,7 +374,7 @@ public: private: void bufferToGui() override; - void guiToBuffer() override; + bool guiToBuffer() override; std::unique_ptr<Internal::BoolAspectPrivate> d; }; @@ -374,7 +391,7 @@ public: private: void bufferToGui() override; - void guiToBuffer() override; + bool guiToBuffer() override; std::unique_ptr<Internal::ColorAspectPrivate> d; }; @@ -422,7 +439,7 @@ public: protected: void bufferToGui() override; - void guiToBuffer() override; + bool guiToBuffer() override; private: std::unique_ptr<Internal::SelectionAspectPrivate> d; @@ -446,7 +463,7 @@ public: protected: void bufferToGui() override; - void guiToBuffer() override; + bool guiToBuffer() override; private: std::unique_ptr<Internal::MultiSelectionAspectPrivate> d; @@ -522,10 +539,10 @@ signals: protected: void bufferToGui() override; - void guiToBuffer() override; + bool guiToBuffer() override; - void internalToBuffer() override; - void bufferToInternal() override; + bool internalToBuffer() override; + bool bufferToInternal() override; std::unique_ptr<Internal::StringAspectPrivate> d; }; @@ -573,7 +590,7 @@ public: protected: void bufferToGui() override; - void guiToBuffer() override; + bool guiToBuffer() override; private: std::unique_ptr<Internal::IntegerAspectPrivate> d; @@ -597,7 +614,7 @@ public: protected: void bufferToGui() override; - void guiToBuffer() override; + bool guiToBuffer() override; private: std::unique_ptr<Internal::DoubleAspectPrivate> d; diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h index f5806b39d69..f5624191bfb 100644 --- a/src/plugins/debugger/commonoptionspage.h +++ b/src/plugins/debugger/commonoptionspage.h @@ -31,7 +31,7 @@ public: void writeSettings() const override; private: - void guiToBuffer() override; + bool guiToBuffer() override; void bufferToGui() override; SourcePathMapAspectPrivate *d = nullptr; diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 6ec92416ed8..8e4d2bef147 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -470,10 +470,12 @@ void SourcePathMapAspect::addToLayout(Layouting::LayoutItem &parent) parent.addItem(d->m_widget.data()); } -void SourcePathMapAspect::guiToBuffer() +bool SourcePathMapAspect::guiToBuffer() { + const SourcePathMap old = m_buffer; if (d->m_widget) m_buffer = d->m_widget->sourcePathMap(); + return m_buffer != old; } void SourcePathMapAspect::bufferToGui() diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 8331c5331c8..198312f2f5c 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -151,7 +151,7 @@ void SuppressionAspect::addToLayout(Layouting::LayoutItem &parent) void SuppressionAspect::fromMap(const QVariantMap &map) { - BaseAspect::fromMap(map); + BaseAspect::fromMap(map); // FIXME Looks wrong, as it skips the intermediate level } void SuppressionAspect::toMap(QVariantMap &map) const @@ -159,11 +159,13 @@ void SuppressionAspect::toMap(QVariantMap &map) const BaseAspect::toMap(map); } -void SuppressionAspect::guiToBuffer() +bool SuppressionAspect::guiToBuffer() { + const FilePaths old = m_buffer; m_buffer.clear(); for (int i = 0; i < d->m_model.rowCount(); ++i) m_buffer.append(FilePath::fromUserInput(d->m_model.item(i)->text())); + return m_buffer != old; } void SuppressionAspect::bufferToGui() diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index aac01dac46d..5f68e93f2c2 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -29,7 +29,7 @@ public: private: void bufferToGui() override; - void guiToBuffer() override; + bool guiToBuffer() override; friend class ValgrindBaseSettings; SuppressionAspectPrivate *d = nullptr; From 048cd9d1438578ce3bd4e6cdd5df261a0c869160 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 16:06:53 +0200 Subject: [PATCH 0413/1777] BareMetal: Hide IarToolChain definitions Not needed publicly. Change-Id: Id8250f32c64dbb53434082ae1d885b47f8a8d666 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/baremetal/iarewtoolchain.cpp | 68 +++++++++++++++++++-- src/plugins/baremetal/iarewtoolchain.h | 78 ------------------------ 2 files changed, 62 insertions(+), 84 deletions(-) diff --git a/src/plugins/baremetal/iarewtoolchain.cpp b/src/plugins/baremetal/iarewtoolchain.cpp index c6653fefbb4..5e3f81f85b5 100644 --- a/src/plugins/baremetal/iarewtoolchain.cpp +++ b/src/plugins/baremetal/iarewtoolchain.cpp @@ -10,6 +10,7 @@ #include <projectexplorer/abiwidget.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectmacro.h> +#include <projectexplorer/toolchainconfigwidget.h> #include <projectexplorer/toolchainmanager.h> #include <utils/algorithm.h> @@ -262,15 +263,70 @@ static QString buildDisplayName(Abi::Architecture arch, Utils::Id language, return Tr::tr("IAREW %1 (%2, %3)").arg(version, langName, archName); } +// IarToolChainConfigWidget + +class IarToolChain; + +class IarToolChainConfigWidget final : public ToolChainConfigWidget +{ +public: + explicit IarToolChainConfigWidget(IarToolChain *tc); + +private: + void applyImpl() final; + void discardImpl() final { setFromToolchain(); } + bool isDirtyImpl() const final; + void makeReadOnlyImpl() final; + + void setFromToolchain(); + void handleCompilerCommandChange(); + void handlePlatformCodeGenFlagsChange(); + + PathChooser *m_compilerCommand = nullptr; + AbiWidget *m_abiWidget = nullptr; + QLineEdit *m_platformCodeGenFlagsLineEdit = nullptr; + Macros m_macros; +}; + // IarToolChain -IarToolChain::IarToolChain() : - ToolChain(Constants::IAREW_TOOLCHAIN_TYPEID) +class IarToolChain final : public ToolChain { - setTypeDisplayName(Tr::tr("IAREW")); - setTargetAbiKey("TargetAbi"); - setCompilerCommandKey("CompilerPath"); -} +public: + IarToolChain() : ToolChain(Constants::IAREW_TOOLCHAIN_TYPEID) + { + setTypeDisplayName(Tr::tr("IAREW")); + setTargetAbiKey("TargetAbi"); + setCompilerCommandKey("CompilerPath"); + } + + MacroInspectionRunner createMacroInspectionRunner() const final; + + LanguageExtensions languageExtensions(const QStringList &cxxflags) const final; + WarningFlags warningFlags(const QStringList &cxxflags) const final; + + BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Environment &) const final; + void addToEnvironment(Environment &env) const final; + QList<OutputLineParser *> createOutputParsers() const final; + + QVariantMap toMap() const final; + bool fromMap(const QVariantMap &data) final; + + std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() final; + + bool operator==(const ToolChain &other) const final; + + void setExtraCodeModelFlags(const QStringList &flags); + QStringList extraCodeModelFlags() const final; + + FilePath makeCommand(const Environment &env) const final; + +private: + QStringList m_extraCodeModelFlags; + + friend class IarToolChainFactory; + friend class IarToolChainConfigWidget; +}; ToolChain::MacroInspectionRunner IarToolChain::createMacroInspectionRunner() const { diff --git a/src/plugins/baremetal/iarewtoolchain.h b/src/plugins/baremetal/iarewtoolchain.h index d342c934e49..1b67e9e051f 100644 --- a/src/plugins/baremetal/iarewtoolchain.h +++ b/src/plugins/baremetal/iarewtoolchain.h @@ -3,63 +3,10 @@ #pragma once -#include <projectexplorer/abi.h> #include <projectexplorer/toolchain.h> -#include <projectexplorer/toolchainconfigwidget.h> - -QT_BEGIN_NAMESPACE -class QLineEdit; -class QPlainTextEdit; -class QPushButton; -class QTextEdit; -QT_END_NAMESPACE - -namespace Utils { -class FilePath; -class PathChooser; -} - -namespace ProjectExplorer { class AbiWidget; } namespace BareMetal::Internal { -// IarToolChain - -class IarToolChain final : public ProjectExplorer::ToolChain -{ -public: - MacroInspectionRunner createMacroInspectionRunner() const final; - - Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const final; - Utils::WarningFlags warningFlags(const QStringList &cxxflags) const final; - - BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Utils::Environment &) const final; - void addToEnvironment(Utils::Environment &env) const final; - QList<Utils::OutputLineParser *> createOutputParsers() const final; - - QVariantMap toMap() const final; - bool fromMap(const QVariantMap &data) final; - - std::unique_ptr<ProjectExplorer::ToolChainConfigWidget> createConfigurationWidget() final; - - bool operator ==(const ToolChain &other) const final; - - void setExtraCodeModelFlags(const QStringList &flags); - QStringList extraCodeModelFlags() const final; - - Utils::FilePath makeCommand(const Utils::Environment &env) const final; - -private: - IarToolChain(); - - QStringList m_extraCodeModelFlags; - - friend class IarToolChainFactory; - friend class IarToolChainConfigWidget; -}; - -// IarToolChainFactory - class IarToolChainFactory final : public ProjectExplorer::ToolChainFactory { public: @@ -77,29 +24,4 @@ private: const Candidate &candidate, Utils::Id languageId) const; }; -// IarToolChainConfigWidget - -class IarToolChainConfigWidget final : public ProjectExplorer::ToolChainConfigWidget -{ - Q_OBJECT - -public: - explicit IarToolChainConfigWidget(IarToolChain *tc); - -private: - void applyImpl() final; - void discardImpl() final { setFromToolchain(); } - bool isDirtyImpl() const final; - void makeReadOnlyImpl() final; - - void setFromToolchain(); - void handleCompilerCommandChange(); - void handlePlatformCodeGenFlagsChange(); - - Utils::PathChooser *m_compilerCommand = nullptr; - ProjectExplorer::AbiWidget *m_abiWidget = nullptr; - QLineEdit *m_platformCodeGenFlagsLineEdit = nullptr; - ProjectExplorer::Macros m_macros; -}; - } // BareMetal::Internal From e3dd3521d4cbaa6821f5c70397d8ebd55cf1e27a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 16:11:30 +0200 Subject: [PATCH 0414/1777] BareMetal: Hide KeilToolChain definitions Not needed publicly. Change-Id: I40272a26a450a10ada8e5d579dd6a2b5bd3c259a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/baremetal/keiltoolchain.cpp | 70 +++++++++++++++++++++-- src/plugins/baremetal/keiltoolchain.h | 74 ------------------------- 2 files changed, 64 insertions(+), 80 deletions(-) diff --git a/src/plugins/baremetal/keiltoolchain.cpp b/src/plugins/baremetal/keiltoolchain.cpp index 3bb2423ab23..af681f89307 100644 --- a/src/plugins/baremetal/keiltoolchain.cpp +++ b/src/plugins/baremetal/keiltoolchain.cpp @@ -10,6 +10,7 @@ #include <projectexplorer/abiwidget.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectmacro.h> +#include <projectexplorer/toolchainconfigwidget.h> #include <projectexplorer/toolchainmanager.h> #include <utils/algorithm.h> @@ -402,13 +403,70 @@ static void addDefaultCpuArgs(const FilePath &compiler, QStringList &extraArgs) // KeilToolchain -KeilToolChain::KeilToolChain() : - ToolChain(Constants::KEIL_TOOLCHAIN_TYPEID) +class KeilToolChain; + +class KeilToolChainConfigWidget final : public ToolChainConfigWidget { - setTypeDisplayName(Tr::tr("KEIL")); - setTargetAbiKey("TargetAbi"); - setCompilerCommandKey("CompilerPath"); -} +public: + explicit KeilToolChainConfigWidget(KeilToolChain *tc); + +private: + void applyImpl() final; + void discardImpl() final { setFromToolChain(); } + bool isDirtyImpl() const final; + void makeReadOnlyImpl() final; + + void setFromToolChain(); + void handleCompilerCommandChange(); + void handlePlatformCodeGenFlagsChange(); + + PathChooser *m_compilerCommand = nullptr; + AbiWidget *m_abiWidget = nullptr; + QLineEdit *m_platformCodeGenFlagsLineEdit = nullptr; + Macros m_macros; +}; + +// KeilToolChain + +class KeilToolChain final : public ToolChain +{ +public: + KeilToolChain() : + ToolChain(Constants::KEIL_TOOLCHAIN_TYPEID) + { + setTypeDisplayName(Tr::tr("KEIL")); + setTargetAbiKey("TargetAbi"); + setCompilerCommandKey("CompilerPath"); + } + + MacroInspectionRunner createMacroInspectionRunner() const final; + + LanguageExtensions languageExtensions(const QStringList &cxxflags) const final; + WarningFlags warningFlags(const QStringList &cxxflags) const final; + + BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Environment &) const final; + void addToEnvironment(Environment &env) const final; + QList<OutputLineParser *> createOutputParsers() const final; + + QVariantMap toMap() const final; + bool fromMap(const QVariantMap &data) final; + + std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() final; + + bool operator==(const ToolChain &other) const final; + + void setExtraCodeModelFlags(const QStringList &flags); + QStringList extraCodeModelFlags() const final; + + FilePath makeCommand(const Environment &env) const final; + +private: + QStringList m_extraCodeModelFlags; + + friend class KeilToolChainFactory; + friend class KeilToolChainConfigWidget; +}; + ToolChain::MacroInspectionRunner KeilToolChain::createMacroInspectionRunner() const { diff --git a/src/plugins/baremetal/keiltoolchain.h b/src/plugins/baremetal/keiltoolchain.h index 77803b6cea1..6f897369095 100644 --- a/src/plugins/baremetal/keiltoolchain.h +++ b/src/plugins/baremetal/keiltoolchain.h @@ -3,61 +3,10 @@ #pragma once -#include <projectexplorer/abi.h> #include <projectexplorer/toolchain.h> -#include <projectexplorer/toolchainconfigwidget.h> - -QT_BEGIN_NAMESPACE -class QLineEdit; -class QPlainTextEdit; -class QPushButton; -class QTextEdit; -QT_END_NAMESPACE - -namespace Utils { class PathChooser; } - -namespace ProjectExplorer { class AbiWidget; } namespace BareMetal::Internal { -// KeilToolChain - -class KeilToolChain final : public ProjectExplorer::ToolChain -{ -public: - MacroInspectionRunner createMacroInspectionRunner() const final; - - Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const final; - Utils::WarningFlags warningFlags(const QStringList &cxxflags) const final; - - BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner( - const Utils::Environment &) const final; - void addToEnvironment(Utils::Environment &env) const final; - QList<Utils::OutputLineParser *> createOutputParsers() const final; - - QVariantMap toMap() const final; - bool fromMap(const QVariantMap &data) final; - - std::unique_ptr<ProjectExplorer::ToolChainConfigWidget> createConfigurationWidget() final; - - bool operator ==(const ToolChain &other) const final; - - void setExtraCodeModelFlags(const QStringList &flags); - QStringList extraCodeModelFlags() const final; - - Utils::FilePath makeCommand(const Utils::Environment &env) const final; - -private: - KeilToolChain(); - - QStringList m_extraCodeModelFlags; - - friend class KeilToolChainFactory; - friend class KeilToolChainConfigWidget; -}; - -// KeilToolchainFactory - class KeilToolChainFactory final : public ProjectExplorer::ToolChainFactory { public: @@ -73,27 +22,4 @@ private: const Candidate &candidate, Utils::Id language) const; }; -// KeilToolchainConfigWidget - -class KeilToolChainConfigWidget final : public ProjectExplorer::ToolChainConfigWidget -{ -public: - explicit KeilToolChainConfigWidget(KeilToolChain *tc); - -private: - void applyImpl() final; - void discardImpl() final { setFromToolChain(); } - bool isDirtyImpl() const final; - void makeReadOnlyImpl() final; - - void setFromToolChain(); - void handleCompilerCommandChange(); - void handlePlatformCodeGenFlagsChange(); - - Utils::PathChooser *m_compilerCommand = nullptr; - ProjectExplorer::AbiWidget *m_abiWidget = nullptr; - QLineEdit *m_platformCodeGenFlagsLineEdit = nullptr; - ProjectExplorer::Macros m_macros; -}; - } // BareMetal::Internal From 2b9882f5634c1e67c96a7911850cdaf8405b59f3 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 16:16:34 +0200 Subject: [PATCH 0415/1777] BareMetal: Hide SdccToolChain definitions Not needed publicly. Change-Id: Iee1243c48d0b3308316bb6e7b4f4a34b0551f4ed Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/baremetal/sdcctoolchain.cpp | 65 +++++++++++++++++++++---- src/plugins/baremetal/sdcctoolchain.h | 63 ------------------------ 2 files changed, 55 insertions(+), 73 deletions(-) diff --git a/src/plugins/baremetal/sdcctoolchain.cpp b/src/plugins/baremetal/sdcctoolchain.cpp index a35a468d202..f559aac3a65 100644 --- a/src/plugins/baremetal/sdcctoolchain.cpp +++ b/src/plugins/baremetal/sdcctoolchain.cpp @@ -10,6 +10,7 @@ #include <projectexplorer/abiwidget.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectmacro.h> +#include <projectexplorer/toolchainconfigwidget.h> #include <projectexplorer/toolchainmanager.h> #include <utils/algorithm.h> @@ -168,29 +169,73 @@ static Abi guessAbi(const Macros ¯os) guessFormat(arch), guessWordWidth(macros)}; } -static QString buildDisplayName(Abi::Architecture arch, Utils::Id language, - const QString &version) +static QString buildDisplayName(Abi::Architecture arch, Id language, const QString &version) { const QString archName = Abi::toString(arch); const QString langName = ToolChainManager::displayNameOfLanguageId(language); return Tr::tr("SDCC %1 (%2, %3)").arg(version, langName, archName); } -static Utils::FilePath compilerPathFromEnvironment(const QString &compilerName) +static FilePath compilerPathFromEnvironment(const QString &compilerName) { const Environment systemEnvironment = Environment::systemEnvironment(); return systemEnvironment.searchInPath(compilerName); } +// SdccToolChainConfigWidget + +class SdccToolChain; + +class SdccToolChainConfigWidget final : public ToolChainConfigWidget +{ +public: + explicit SdccToolChainConfigWidget(SdccToolChain *tc); + +private: + void applyImpl() final; + void discardImpl() final { setFromToolchain(); } + bool isDirtyImpl() const final; + void makeReadOnlyImpl() final; + + void setFromToolchain(); + void handleCompilerCommandChange(); + + PathChooser *m_compilerCommand = nullptr; + AbiWidget *m_abiWidget = nullptr; + Macros m_macros; +}; + // SdccToolChain -SdccToolChain::SdccToolChain() : - ToolChain(Constants::SDCC_TOOLCHAIN_TYPEID) +class SdccToolChain final : public ToolChain { - setTypeDisplayName(Tr::tr("SDCC")); - setTargetAbiKey("TargetAbi"); - setCompilerCommandKey("CompilerPath"); -} +public: + SdccToolChain() : ToolChain(Constants::SDCC_TOOLCHAIN_TYPEID) + { + setTypeDisplayName(Tr::tr("SDCC")); + setTargetAbiKey("TargetAbi"); + setCompilerCommandKey("CompilerPath"); + } + + MacroInspectionRunner createMacroInspectionRunner() const final; + + LanguageExtensions languageExtensions(const QStringList &cxxflags) const final; + WarningFlags warningFlags(const QStringList &cxxflags) const final; + + BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Environment &) const final; + void addToEnvironment(Environment &env) const final; + QList<OutputLineParser *> createOutputParsers() const final; + + std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() final; + + bool operator==(const ToolChain &other) const final; + + FilePath makeCommand(const Environment &env) const final; + +private: + friend class SdccToolChainFactory; + friend class SdccToolChainConfigWidget; +}; ToolChain::MacroInspectionRunner SdccToolChain::createMacroInspectionRunner() const { @@ -215,7 +260,7 @@ ToolChain::MacroInspectionRunner SdccToolChain::createMacroInspectionRunner() co }; } -Utils::LanguageExtensions SdccToolChain::languageExtensions(const QStringList &) const +LanguageExtensions SdccToolChain::languageExtensions(const QStringList &) const { return LanguageExtension::None; } diff --git a/src/plugins/baremetal/sdcctoolchain.h b/src/plugins/baremetal/sdcctoolchain.h index 274ae41fb2b..972eee000d5 100644 --- a/src/plugins/baremetal/sdcctoolchain.h +++ b/src/plugins/baremetal/sdcctoolchain.h @@ -3,52 +3,10 @@ #pragma once -#include <projectexplorer/abi.h> #include <projectexplorer/toolchain.h> -#include <projectexplorer/toolchainconfigwidget.h> - -QT_BEGIN_NAMESPACE -class QPlainTextEdit; -class QPushButton; -class QTextEdit; -QT_END_NAMESPACE - -namespace Utils { class PathChooser; } - -namespace ProjectExplorer { class AbiWidget; } namespace BareMetal::Internal { -// SdccToolChain - -class SdccToolChain final : public ProjectExplorer::ToolChain -{ -public: - MacroInspectionRunner createMacroInspectionRunner() const final; - - Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const final; - Utils::WarningFlags warningFlags(const QStringList &cxxflags) const final; - - BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner( - const Utils::Environment &) const final; - void addToEnvironment(Utils::Environment &env) const final; - QList<Utils::OutputLineParser *> createOutputParsers() const final; - - std::unique_ptr<ProjectExplorer::ToolChainConfigWidget> createConfigurationWidget() final; - - bool operator ==(const ToolChain &other) const final; - - Utils::FilePath makeCommand(const Utils::Environment &env) const final; - -private: - SdccToolChain(); - - friend class SdccToolChainFactory; - friend class SdccToolChainConfigWidget; -}; - -// SdccToolChainFactory - class SdccToolChainFactory final : public ProjectExplorer::ToolChainFactory { public: @@ -64,25 +22,4 @@ private: const Candidate &candidate, Utils::Id language) const; }; -// SdccToolChainConfigWidget - -class SdccToolChainConfigWidget final : public ProjectExplorer::ToolChainConfigWidget -{ -public: - explicit SdccToolChainConfigWidget(SdccToolChain *tc); - -private: - void applyImpl() final; - void discardImpl() final { setFromToolchain(); } - bool isDirtyImpl() const final; - void makeReadOnlyImpl() final; - - void setFromToolchain(); - void handleCompilerCommandChange(); - - Utils::PathChooser *m_compilerCommand = nullptr; - ProjectExplorer::AbiWidget *m_abiWidget = nullptr; - ProjectExplorer::Macros m_macros; -}; - } // BareMetal::Internal From d5f754d4568d915e6e52a481491d02aedff02998 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 16:21:24 +0200 Subject: [PATCH 0416/1777] BareMetal: Inline some simple toolchain function Change-Id: I01112a82c1de101e16dfa262413dbac17400d375 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/baremetal/keiltoolchain.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/plugins/baremetal/keiltoolchain.cpp b/src/plugins/baremetal/keiltoolchain.cpp index af681f89307..3da4c04248a 100644 --- a/src/plugins/baremetal/keiltoolchain.cpp +++ b/src/plugins/baremetal/keiltoolchain.cpp @@ -446,7 +446,8 @@ public: BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Environment &) const final; void addToEnvironment(Environment &env) const final; - QList<OutputLineParser *> createOutputParsers() const final; + + QList<OutputLineParser *> createOutputParsers() const final { return {new KeilParser}; } QVariantMap toMap() const final; bool fromMap(const QVariantMap &data) final; @@ -458,7 +459,7 @@ public: void setExtraCodeModelFlags(const QStringList &flags); QStringList extraCodeModelFlags() const final; - FilePath makeCommand(const Environment &env) const final; + FilePath makeCommand(const Environment &) const final { return {}; } private: QStringList m_extraCodeModelFlags; @@ -525,10 +526,6 @@ void KeilToolChain::addToEnvironment(Environment &env) const env.prependOrSetPath(compilerCommand().parentDir()); } -QList<OutputLineParser *> KeilToolChain::createOutputParsers() const -{ - return {new KeilParser}; -} QVariantMap KeilToolChain::toMap() const { @@ -574,12 +571,6 @@ QStringList KeilToolChain::extraCodeModelFlags() const return m_extraCodeModelFlags; } -FilePath KeilToolChain::makeCommand(const Environment &env) const -{ - Q_UNUSED(env) - return {}; -} - // KeilToolchainFactory KeilToolChainFactory::KeilToolChainFactory() From cd81336f404f76bfea565c29c26c53a96f727ce8 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sun, 16 Jul 2023 09:46:44 +0200 Subject: [PATCH 0417/1777] BuildManager: Avoid code repetition in 2 "if" branches Change-Id: If3ecb5457c2f7b661bed1c8daf80bf289204da15 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/buildmanager.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 76336d3aa13..40620f7a711 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -652,13 +652,13 @@ void BuildManager::addToOutputWindow(const QString &string, BuildStep::OutputFor void BuildManager::nextBuildQueue() { d->m_outputWindow->flush(); + disconnectOutput(d->m_currentBuildStep); + decrementActiveBuildSteps(d->m_currentBuildStep); + if (d->m_canceling) { d->m_canceling = false; QTimer::singleShot(0, m_instance, &BuildManager::emitCancelMessage); - disconnectOutput(d->m_currentBuildStep); - decrementActiveBuildSteps(d->m_currentBuildStep); - //TODO NBS fix in qtconcurrent d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, Tr::tr("Build/Deployment canceled")); @@ -666,11 +666,9 @@ void BuildManager::nextBuildQueue() return; } - disconnectOutput(d->m_currentBuildStep); if (!d->m_skipDisabled) ++d->m_progress; d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, msgProgress(d->m_progress, d->m_maxProgress)); - decrementActiveBuildSteps(d->m_currentBuildStep); const bool success = d->m_skipDisabled || d->m_lastStepSucceeded; if (success) { From 580d605fd3e0a6a6755bdfdcba3bfdea24e319f4 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sun, 16 Jul 2023 11:10:13 +0200 Subject: [PATCH 0418/1777] BuildManager: Add ParserAwaiterTask helper Change-Id: I5c22b8a17d6495c3411e979e3e79cf9415236442 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/buildmanager.cpp | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 40620f7a711..e1bc165d27c 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -30,6 +30,8 @@ #include <extensionsystem/pluginmanager.h> +#include <solutions/tasking/tasktree.h> + #include <utils/algorithm.h> #include <utils/outputformatter.h> #include <utils/stringutils.h> @@ -46,11 +48,42 @@ #include <QTimer> using namespace Core; +using namespace Tasking; using namespace Utils; namespace ProjectExplorer { using namespace Internal; +class ParserAwaiterTaskAdapter : public TaskAdapter<QSet<BuildSystem *>> +{ +private: + void start() final { checkParsing(); } + void checkParsing() { + const QSet<BuildSystem *> buildSystems = *task(); + for (BuildSystem *buildSystem : buildSystems) { + if (!buildSystem || !buildSystem->isParsing()) + continue; + connect(buildSystem, &BuildSystem::parsingFinished, + this, [this, buildSystem](bool success) { + disconnect(buildSystem, &BuildSystem::parsingFinished, this, nullptr); + if (!success) { + emit done(false); + return; + } + checkParsing(); + }); + return; + } + emit done(true); + } +}; + +} // ProjectExplorer + +TASKING_DECLARE_TASK(ParserAwaiterTask, ProjectExplorer::ParserAwaiterTaskAdapter); + +namespace ProjectExplorer { + static QString msgProgress(int progress, int total) { return Tr::tr("Finished %1 of %n steps", nullptr, total).arg(progress); From c1309f94178a40709204a722e5c40c83620bf757 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 16:41:45 +0200 Subject: [PATCH 0419/1777] ProjectExplorer: Change ToolChain::toMap() signature ... to something similar to AspectContainer::toMap() as preparation for later aspectification. Change-Id: Ic60060ad1a7eb1aba58ded01221b016c684db073 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/baremetal/iarewtoolchain.cpp | 7 +++---- src/plugins/baremetal/keiltoolchain.cpp | 7 +++---- src/plugins/projectexplorer/customtoolchain.cpp | 6 ++---- src/plugins/projectexplorer/customtoolchain.h | 2 +- src/plugins/projectexplorer/gcctoolchain.cpp | 10 ++++------ src/plugins/projectexplorer/gcctoolchain.h | 4 ++-- src/plugins/projectexplorer/msvctoolchain.cpp | 12 +++++------- src/plugins/projectexplorer/msvctoolchain.h | 4 ++-- src/plugins/projectexplorer/toolchain.cpp | 8 ++++---- src/plugins/projectexplorer/toolchain.h | 2 +- .../projectexplorer/toolchainsettingsaccessor.cpp | 10 ++++------ src/plugins/qnx/qnxtoolchain.cpp | 5 ++--- src/plugins/qnx/qnxtoolchain.h | 2 +- 13 files changed, 34 insertions(+), 45 deletions(-) diff --git a/src/plugins/baremetal/iarewtoolchain.cpp b/src/plugins/baremetal/iarewtoolchain.cpp index 5e3f81f85b5..dda9e47e00c 100644 --- a/src/plugins/baremetal/iarewtoolchain.cpp +++ b/src/plugins/baremetal/iarewtoolchain.cpp @@ -309,7 +309,7 @@ public: void addToEnvironment(Environment &env) const final; QList<OutputLineParser *> createOutputParsers() const final; - QVariantMap toMap() const final; + void toMap(QVariantMap &data) const final; bool fromMap(const QVariantMap &data) final; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() final; @@ -404,11 +404,10 @@ QList<Utils::OutputLineParser *> IarToolChain::createOutputParsers() const return {new IarParser()}; } -QVariantMap IarToolChain::toMap() const +void IarToolChain::toMap(QVariantMap &data) const { - QVariantMap data = ToolChain::toMap(); + ToolChain::toMap(data); data.insert(compilerPlatformCodeGenFlagsKeyC, m_extraCodeModelFlags); - return data; } bool IarToolChain::fromMap(const QVariantMap &data) diff --git a/src/plugins/baremetal/keiltoolchain.cpp b/src/plugins/baremetal/keiltoolchain.cpp index 3da4c04248a..9257a8d781c 100644 --- a/src/plugins/baremetal/keiltoolchain.cpp +++ b/src/plugins/baremetal/keiltoolchain.cpp @@ -449,7 +449,7 @@ public: QList<OutputLineParser *> createOutputParsers() const final { return {new KeilParser}; } - QVariantMap toMap() const final; + void toMap(QVariantMap &data) const final; bool fromMap(const QVariantMap &data) final; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() final; @@ -527,11 +527,10 @@ void KeilToolChain::addToEnvironment(Environment &env) const } -QVariantMap KeilToolChain::toMap() const +void KeilToolChain::toMap(QVariantMap &data) const { - QVariantMap data = ToolChain::toMap(); + ToolChain::toMap(data); data.insert(compilerPlatformCodeGenFlagsKeyC, m_extraCodeModelFlags); - return data; } bool KeilToolChain::fromMap(const QVariantMap &data) diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp index 9c7ab0a4088..c15ade15c08 100644 --- a/src/plugins/projectexplorer/customtoolchain.cpp +++ b/src/plugins/projectexplorer/customtoolchain.cpp @@ -217,9 +217,9 @@ QString CustomToolChain::mkspecs() const return m_mkspecs.join(','); } -QVariantMap CustomToolChain::toMap() const +void CustomToolChain::toMap(QVariantMap &data) const { - QVariantMap data = ToolChain::toMap(); + ToolChain::toMap(data); data.insert(QLatin1String(makeCommandKeyC), m_makeCommand.toString()); QStringList macros = Utils::transform<QList>(m_predefinedMacros, [](const Macro &m) { return QString::fromUtf8(m.toByteArray()); }); data.insert(QLatin1String(predefinedMacrosKeyC), macros); @@ -227,8 +227,6 @@ QVariantMap CustomToolChain::toMap() const data.insert(QLatin1String(cxx11FlagsKeyC), m_cxx11Flags); data.insert(QLatin1String(mkspecsKeyC), mkspecs()); data.insert(QLatin1String(outputParserKeyC), m_outputParserId.toSetting()); - - return data; } bool CustomToolChain::fromMap(const QVariantMap &data) diff --git a/src/plugins/projectexplorer/customtoolchain.h b/src/plugins/projectexplorer/customtoolchain.h index 3da4dfd9160..b01850a43cd 100644 --- a/src/plugins/projectexplorer/customtoolchain.h +++ b/src/plugins/projectexplorer/customtoolchain.h @@ -56,7 +56,7 @@ public: QStringList headerPathsList() const; void setHeaderPaths(const QStringList &list); - QVariantMap toMap() const override; + void toMap(QVariantMap &data) const override; bool fromMap(const QVariantMap &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index f69ab0afc8f..c6f74d565b3 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -795,14 +795,13 @@ QStringList GccToolChain::platformLinkerFlags() const return m_platformLinkerFlags; } -QVariantMap GccToolChain::toMap() const +void GccToolChain::toMap(QVariantMap &data) const { - QVariantMap data = ToolChain::toMap(); + ToolChain::toMap(data); data.insert(compilerPlatformCodeGenFlagsKeyC, m_platformCodeGenFlags); data.insert(compilerPlatformLinkerFlagsKeyC, m_platformLinkerFlags); data.insert(originalTargetTripleKeyC, m_originalTargetTriple); data.insert(supportedAbisKeyC, Utils::transform<QStringList>(m_supportedAbis, &Abi::toString)); - return data; } bool GccToolChain::fromMap(const QVariantMap &data) @@ -1713,12 +1712,11 @@ std::unique_ptr<ToolChainConfigWidget> ClangToolChain::createConfigurationWidget return std::make_unique<ClangToolChainConfigWidget>(this); } -QVariantMap ClangToolChain::toMap() const +void ClangToolChain::toMap(QVariantMap &data) const { - QVariantMap data = GccToolChain::toMap(); + GccToolChain::toMap(data); data.insert(parentToolChainIdKeyC, m_parentToolChainId); data.insert(priorityKeyC, m_priority); - return data; } bool ClangToolChain::fromMap(const QVariantMap &data) diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 1e6353d0a75..96ab49df3d2 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -66,7 +66,7 @@ public: QStringList suggestedMkspecList() const override; QList<Utils::OutputLineParser *> createOutputParsers() const override; - QVariantMap toMap() const override; + void toMap(QVariantMap &data) const override; bool fromMap(const QVariantMap &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; @@ -206,7 +206,7 @@ public: std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; - QVariantMap toMap() const override; + void toMap(QVariantMap &data) const override; bool fromMap(const QVariantMap &data) override; void setPriority(int priority) { m_priority = priority; } diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index d4d518de44d..095978bb91d 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -978,16 +978,15 @@ Abis MsvcToolChain::supportedAbis() const return abis; } -QVariantMap MsvcToolChain::toMap() const +void MsvcToolChain::toMap(QVariantMap &data) const { - QVariantMap data = ToolChain::toMap(); + ToolChain::toMap(data); data.insert(QLatin1String(varsBatKeyC), m_vcvarsBat); if (!m_varsBatArg.isEmpty()) data.insert(QLatin1String(varsBatArgKeyC), m_varsBatArg); Utils::EnvironmentItem::sort(&m_environmentModifications); data.insert(QLatin1String(environModsKeyC), Utils::EnvironmentItem::toVariantList(m_environmentModifications)); - return data; } bool MsvcToolChain::fromMap(const QVariantMap &data) @@ -1728,11 +1727,10 @@ static inline QString llvmDirKey() return QStringLiteral("ProjectExplorer.ClangClToolChain.LlvmDir"); } -QVariantMap ClangClToolChain::toMap() const +void ClangClToolChain::toMap(QVariantMap &data) const { - QVariantMap result = MsvcToolChain::toMap(); - result.insert(llvmDirKey(), m_clangPath.toString()); - return result; + MsvcToolChain::toMap(data); + data.insert(llvmDirKey(), m_clangPath.toString()); } bool ClangClToolChain::fromMap(const QVariantMap &data) diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index 68f8b9dcf19..77cd18a647a 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -46,7 +46,7 @@ public: QStringList suggestedMkspecList() const override; Abis supportedAbis() const override; - QVariantMap toMap() const override; + void toMap(QVariantMap &data) const override; bool fromMap(const QVariantMap &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; @@ -146,7 +146,7 @@ public: void addToEnvironment(Utils::Environment &env) const override; Utils::FilePath compilerCommand() const override; // FIXME: Remove QList<Utils::OutputLineParser *> createOutputParsers() const override; - QVariantMap toMap() const override; + void toMap(QVariantMap &data) const override; bool fromMap(const QVariantMap &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner( diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index f1a8f80c22d..4373114a028 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -226,7 +226,9 @@ ToolChain *ToolChain::clone() const if (f->supportedToolChainType() == d->m_typeId) { ToolChain *tc = f->create(); QTC_ASSERT(tc, return nullptr); - tc->fromMap(toMap()); + QVariantMap data; + toMap(data); + tc->fromMap(data); // New ID for the clone. It's different. tc->d->m_id = QUuid::createUuid().toByteArray(); return tc; @@ -242,9 +244,8 @@ ToolChain *ToolChain::clone() const Make sure to call this function when deriving. */ -QVariantMap ToolChain::toMap() const +void ToolChain::toMap(QVariantMap &result) const { - QVariantMap result; QString idToSave = d->m_typeId.toString() + QLatin1Char(':') + QString::fromUtf8(id()); result.insert(QLatin1String(ID_KEY), idToSave); result.insert(QLatin1String(DISPLAY_NAME_KEY), displayName()); @@ -265,7 +266,6 @@ QVariantMap ToolChain::toMap() const result.insert(d->m_targetAbiKey, d->m_targetAbi.toString()); if (!d->m_compilerCommandKey.isEmpty()) result.insert(d->m_compilerCommandKey, d->m_compilerCommand.toSettings()); - return result; } void ToolChain::toolChainUpdated() diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 35cad5333ee..f1a0894ef31 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -145,7 +145,7 @@ public: // Used by the toolchainmanager to save user-generated tool chains. // Make sure to call this function when deriving! - virtual QVariantMap toMap() const; + virtual void toMap(QVariantMap &map) const; virtual Tasks validateKit(const Kit *k) const; virtual bool isJobCountSupported() const { return true; } diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index 9354f6e62db..a001f509496 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -220,7 +220,8 @@ void ToolChainSettingsAccessor::saveToolChains(const Toolchains &toolchains, QWi for (const ToolChain *tc : toolchains) { if (!tc || (!tc->isValid() && tc->isAutoDetected())) continue; - const QVariantMap tmp = tc->toMap(); + QVariantMap tmp; + tc->toMap(tmp); if (tmp.isEmpty()) continue; data.insert(QString::fromLatin1(TOOLCHAIN_DATA_KEY) + QString::number(count), tmp); @@ -326,11 +327,10 @@ public: return true; } - QVariantMap toMap() const final + void toMap(QVariantMap &data) const final { - QVariantMap data = ToolChain::toMap(); + ToolChain::toMap(data); data[TestTokenKey] = token; - return data; } QByteArray token; @@ -339,8 +339,6 @@ private: bool m_valid = false; static QList<TTC *> m_toolChains; - -public: }; QList<TTC *> TTC::m_toolChains; diff --git a/src/plugins/qnx/qnxtoolchain.cpp b/src/plugins/qnx/qnxtoolchain.cpp index 8176b3d17c9..0d8f9a01095 100644 --- a/src/plugins/qnx/qnxtoolchain.cpp +++ b/src/plugins/qnx/qnxtoolchain.cpp @@ -131,12 +131,11 @@ QStringList QnxToolChain::suggestedMkspecList() const }; } -QVariantMap QnxToolChain::toMap() const +void QnxToolChain::toMap(QVariantMap &data) const { - QVariantMap data = GccToolChain::toMap(); + GccToolChain::toMap(data); data.insert(QLatin1String(CompilerSdpPath), m_sdpPath.toSettings()); data.insert(QLatin1String(CpuDirKey), m_cpuDir); - return data; } bool QnxToolChain::fromMap(const QVariantMap &data) diff --git a/src/plugins/qnx/qnxtoolchain.h b/src/plugins/qnx/qnxtoolchain.h index e2edb76f8ee..c38249d8546 100644 --- a/src/plugins/qnx/qnxtoolchain.h +++ b/src/plugins/qnx/qnxtoolchain.h @@ -21,7 +21,7 @@ public: void addToEnvironment(Utils::Environment &env) const override; QStringList suggestedMkspecList() const override; - QVariantMap toMap() const override; + void toMap(QVariantMap &data) const override; bool fromMap(const QVariantMap &data) override; Utils::FilePath sdpPath() const; From a38c8a88b22a98e11d16c29ebe1d3e0b36d5bf80 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 15 Jul 2023 18:26:46 +0200 Subject: [PATCH 0420/1777] BuildManager: Simplify buildQueueAppend() Pass QList<BuildItem> instead of two separate lists with build steps and their names. Use "continue" when disabled or when init succeeded. Move the "if (!init)" early return directly into the previous loop. Append directly the passed items into the m_buildQueue. Change-Id: Ie1bfc4e0695bf24d5bf25570523fed9b6b8c31e3 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/buildmanager.cpp | 90 ++++++++------------ src/plugins/projectexplorer/buildmanager.h | 12 +-- 2 files changed, 42 insertions(+), 60 deletions(-) diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index e1bc165d27c..7634d69bea5 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -246,7 +246,9 @@ static int queue(const QList<Project *> &projects, const QList<Id> &stepIds, return stepLists.count(); } -struct BuildItem { +class BuildItem +{ +public: BuildStep *buildStep = nullptr; bool enabled = true; QString name; @@ -800,7 +802,7 @@ void BuildManager::nextStep() } } -bool BuildManager::buildQueueAppend(const QList<BuildStep *> &steps, QStringList names, const QStringList &preambleMessage) +bool BuildManager::buildQueueAppend(const QList<BuildItem> &items, const QStringList &preambleMessage) { if (!d->m_running) { d->m_outputWindow->clearContents(); @@ -810,49 +812,37 @@ bool BuildManager::buildQueueAppend(const QList<BuildStep *> &steps, QStringList TaskHub::clearTasks(Constants::TASK_CATEGORY_DEPLOYMENT); TaskHub::clearTasks(Constants::TASK_CATEGORY_AUTOTEST); } - for (const QString &str : preambleMessage) addToOutputWindow(str, BuildStep::OutputFormat::NormalMessage, BuildStep::DontAppendNewline); } - int count = steps.size(); - bool init = true; - int i = 0; - for (; i < count; ++i) { - BuildStep *bs = steps.at(i); - connect(bs, &BuildStep::addTask, m_instance, &BuildManager::addToTaskWindow); - connect(bs, &BuildStep::addOutput, m_instance, &BuildManager::addToOutputWindow); - if (bs->enabled()) { - init = bs->init(); - if (!init) - break; - } - } - if (!init) { - BuildStep *bs = steps.at(i); - - // cleaning up - // print something for the user - const QString projectName = bs->project()->displayName(); - const QString targetName = bs->target()->displayName(); - addToOutputWindow(Tr::tr("Error while building/deploying project %1 (kit: %2)").arg(projectName, targetName), BuildStep::OutputFormat::Stderr); - addToOutputWindow(Tr::tr("When executing step \"%1\"").arg(bs->displayName()), BuildStep::OutputFormat::Stderr); - - // disconnect the buildsteps again - for (int j = 0; j <= i; ++j) - disconnectOutput(steps.at(j)); + QList<BuildStep *> connectedSteps; + int enabledCount = 0; + for (const BuildItem &item : items) { + connect(item.buildStep, &BuildStep::addTask, m_instance, &BuildManager::addToTaskWindow); + connect(item.buildStep, &BuildStep::addOutput, m_instance, &BuildManager::addToOutputWindow); + connectedSteps.append(item.buildStep); + if (!item.enabled) + continue; + ++enabledCount; + if (item.buildStep->init()) + continue; + // init() failed, print something for the user... + const QString projectName = item.buildStep->project()->displayName(); + const QString targetName = item.buildStep->target()->displayName(); + addToOutputWindow(Tr::tr("Error while building/deploying project %1 (kit: %2)") + .arg(projectName, targetName), BuildStep::OutputFormat::Stderr); + addToOutputWindow(Tr::tr("When executing step \"%1\"") + .arg(item.buildStep->displayName()), BuildStep::OutputFormat::Stderr); + for (BuildStep *buildStep : std::as_const(connectedSteps)) + disconnectOutput(buildStep); return false; } - // Everthing init() well - for (i = 0; i < count; ++i) { - BuildStep *buildStep = steps.at(i); - const bool enabled = buildStep->enabled(); - d->m_buildQueue.append({buildStep, enabled, names.at(i)}); - if (enabled) - ++d->m_maxProgress; - incrementActiveBuildSteps(buildStep); - } + d->m_buildQueue << items; + d->m_maxProgress += enabledCount; + for (const BuildItem &item : items) + incrementActiveBuildSteps(item.buildStep); return true; } @@ -861,25 +851,18 @@ bool BuildManager::buildList(BuildStepList *bsl) return buildLists({bsl}); } -bool BuildManager::buildLists(const QList<BuildStepList *> bsls, const QStringList &preambelMessage) +bool BuildManager::buildLists(const QList<BuildStepList *> &bsls, const QStringList &preambleMessage) { - QList<BuildStep *> steps; - QStringList stepListNames; + QList<BuildItem> buildItems; for (BuildStepList *list : bsls) { - steps.append(list->steps()); - stepListNames.append(displayNameForStepId(list->id())); + const QString name = displayNameForStepId(list->id()); + const QList<BuildStep *> steps = list->steps(); + for (BuildStep *step : steps) + buildItems.append({step, step->enabled(), name}); d->m_isDeploying = d->m_isDeploying || list->id() == Constants::BUILDSTEPS_DEPLOY; } - QStringList names; - names.reserve(steps.size()); - for (int i = 0; i < bsls.size(); ++i) { - for (int j = 0; j < bsls.at(i)->count(); ++j) - names.append(stepListNames.at(i)); - } - - bool success = buildQueueAppend(steps, names, preambelMessage); - if (!success) { + if (!buildQueueAppend(buildItems, preambleMessage)) { d->m_outputWindow->popup(IOutputPane::NoModeSwitch); d->m_isDeploying = false; return false; @@ -893,8 +876,7 @@ bool BuildManager::buildLists(const QList<BuildStepList *> bsls, const QStringLi void BuildManager::appendStep(BuildStep *step, const QString &name) { - bool success = buildQueueAppend({step}, {name}); - if (!success) { + if (!buildQueueAppend({{step, step->enabled(), name}})) { d->m_outputWindow->popup(IOutputPane::NoModeSwitch); return; } diff --git a/src/plugins/projectexplorer/buildmanager.h b/src/plugins/projectexplorer/buildmanager.h index d9478db4093..659ce079bcb 100644 --- a/src/plugins/projectexplorer/buildmanager.h +++ b/src/plugins/projectexplorer/buildmanager.h @@ -11,6 +11,7 @@ namespace ProjectExplorer { +class BuildItem; class Project; class RunConfiguration; class Task; @@ -33,9 +34,7 @@ public: static void cleanProjectWithoutDependencies(Project *project); static void rebuildProjectWithoutDependencies(Project *project); static void buildProjectWithDependencies( - Project *project, - ConfigSelection configSelection = ConfigSelection::Active - ); + Project *project, ConfigSelection configSelection = ConfigSelection::Active); static void cleanProjectWithDependencies(Project *project, ConfigSelection configSelection); static void rebuildProjectWithDependencies(Project *project, ConfigSelection configSelection); static void buildProjects(const QList<Project *> &projects, ConfigSelection configSelection); @@ -50,8 +49,8 @@ public: static bool isDeploying(); static bool tasksAvailable(); - static bool buildLists(const QList<BuildStepList *> bsls, - const QStringList &preambelMessage = QStringList()); + static bool buildLists(const QList<BuildStepList *> &bsls, + const QStringList &preambelMessage = {}); static bool buildList(BuildStepList *bsl); static bool isBuilding(const Project *p); @@ -93,7 +92,8 @@ private: static void startBuildQueue(); static void nextStep(); static void clearBuildQueue(); - static bool buildQueueAppend(const QList<BuildStep *> &steps, QStringList names, const QStringList &preambleMessage = QStringList()); + static bool buildQueueAppend(const QList<BuildItem> &items, + const QStringList &preambleMessage = {}); static void incrementActiveBuildSteps(BuildStep *bs); static void decrementActiveBuildSteps(BuildStep *bs); static void disconnectOutput(BuildStep *bs); From 32850e7fcca2b4ab945e83103d61c8e75ed52816 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 17:15:13 +0200 Subject: [PATCH 0421/1777] ProjectEplorer: Base ToolChain on AspectContainer Similar approach as done with ProjectConfiguration Change-Id: Ia5e1d464b7c5c64d7a12ee12c7673ff453f24390 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/projectexplorer/toolchain.cpp | 4 ++++ src/plugins/projectexplorer/toolchain.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 4373114a028..aed69cea3c2 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -246,6 +246,8 @@ ToolChain *ToolChain::clone() const void ToolChain::toMap(QVariantMap &result) const { + AspectContainer::toMap(result); + QString idToSave = d->m_typeId.toString() + QLatin1Char(':') + QString::fromUtf8(id()); result.insert(QLatin1String(ID_KEY), idToSave); result.insert(QLatin1String(DISPLAY_NAME_KEY), displayName()); @@ -353,6 +355,8 @@ void ToolChain::setTypeDisplayName(const QString &typeName) bool ToolChain::fromMap(const QVariantMap &data) { + AspectContainer::fromMap(data); + d->m_displayName = data.value(QLatin1String(DISPLAY_NAME_KEY)).toString(); // make sure we have new style ids: diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index f1a0894ef31..66c9edd6614 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -12,6 +12,7 @@ #include "task.h" #include "toolchaincache.h" +#include <utils/aspects.h> #include <utils/cpplanguage_details.h> #include <utils/environment.h> #include <utils/fileutils.h> @@ -60,7 +61,7 @@ public: // ToolChain (documentation inside) // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT ToolChain +class PROJECTEXPLORER_EXPORT ToolChain : public Utils::AspectContainer { public: enum Detection { From 012f926f7c28e34eadfe93f1365d63f0a11b4c80 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 15 Jul 2023 19:30:46 +0200 Subject: [PATCH 0422/1777] BuildManager: Move some repeating code into buildQueueAppend() Make it clear that calling init() on newly added build steps are always followed synchronously by starting a build queue. Change-Id: I9918b2e595cdb1d0639490e3edf77e67fb8ae52e Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/projectexplorer/buildmanager.cpp | 25 +++++++------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 7634d69bea5..d33e2fa3e4b 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -836,6 +836,7 @@ bool BuildManager::buildQueueAppend(const QList<BuildItem> &items, const QString .arg(item.buildStep->displayName()), BuildStep::OutputFormat::Stderr); for (BuildStep *buildStep : std::as_const(connectedSteps)) disconnectOutput(buildStep); + d->m_outputWindow->popup(IOutputPane::NoModeSwitch); return false; } @@ -843,6 +844,9 @@ bool BuildManager::buildQueueAppend(const QList<BuildItem> &items, const QString d->m_maxProgress += enabledCount; for (const BuildItem &item : items) incrementActiveBuildSteps(item.buildStep); + if (CompileOutputSettings::instance().popUp()) + d->m_outputWindow->popup(IOutputPane::NoModeSwitch); + startBuildQueue(); return true; } @@ -862,27 +866,16 @@ bool BuildManager::buildLists(const QList<BuildStepList *> &bsls, const QStringL d->m_isDeploying = d->m_isDeploying || list->id() == Constants::BUILDSTEPS_DEPLOY; } - if (!buildQueueAppend(buildItems, preambleMessage)) { - d->m_outputWindow->popup(IOutputPane::NoModeSwitch); - d->m_isDeploying = false; - return false; - } + if (buildQueueAppend(buildItems, preambleMessage)) + return true; - if (CompileOutputSettings::instance().popUp()) - d->m_outputWindow->popup(IOutputPane::NoModeSwitch); - startBuildQueue(); - return true; + d->m_isDeploying = false; + return false; } void BuildManager::appendStep(BuildStep *step, const QString &name) { - if (!buildQueueAppend({{step, step->enabled(), name}})) { - d->m_outputWindow->popup(IOutputPane::NoModeSwitch); - return; - } - if (CompileOutputSettings::instance().popUp()) - d->m_outputWindow->popup(IOutputPane::NoModeSwitch); - startBuildQueue(); + buildQueueAppend({{step, step->enabled(), name}}); } template <class T> From 81f8a3fd7d13bdfa6610b259df44aa0ef993a8f4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 09:09:47 +0200 Subject: [PATCH 0423/1777] QmlProfiler: Move to new settings setup also for project settings Change-Id: I204f052ddbc2956ff3bca8e6faaf2f758e4fee17 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../projectexplorer/runconfiguration.cpp | 2 + src/plugins/qmlprofiler/qmlprofilerplugin.cpp | 8 -- src/plugins/qmlprofiler/qmlprofilerplugin.h | 5 -- .../qmlprofilerrunconfigurationaspect.cpp | 6 +- .../qmlprofiler/qmlprofilersettings.cpp | 81 ++++++++----------- src/plugins/qmlprofiler/qmlprofilersettings.h | 18 ++--- src/plugins/qmlprofiler/qmlprofilertool.cpp | 12 +-- 7 files changed, 51 insertions(+), 81 deletions(-) diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 763d3bb1ecb..afe8dccb701 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -86,11 +86,13 @@ GlobalOrProjectAspect::~GlobalOrProjectAspect() void GlobalOrProjectAspect::setProjectSettings(ISettingsAspect *settings) { m_projectSettings = settings; + m_projectSettings->setAutoApply(true); } void GlobalOrProjectAspect::setGlobalSettings(ISettingsAspect *settings) { m_globalSettings = settings; + m_projectSettings->setAutoApply(false); } void GlobalOrProjectAspect::setUsingGlobalSettings(bool value) diff --git a/src/plugins/qmlprofiler/qmlprofilerplugin.cpp b/src/plugins/qmlprofiler/qmlprofilerplugin.cpp index d562131e00f..b605b249ca7 100644 --- a/src/plugins/qmlprofiler/qmlprofilerplugin.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerplugin.cpp @@ -53,13 +53,10 @@ using namespace ProjectExplorer; namespace QmlProfiler::Internal { -Q_GLOBAL_STATIC(QmlProfilerSettings, qmlProfilerGlobalSettings) - class QmlProfilerPluginPrivate { public: QmlProfilerTool m_profilerTool; - QmlProfilerOptionsPage m_profilerOptionsPage; QmlProfilerActions m_actions; // The full local profiler. @@ -119,9 +116,4 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerPlugin::aboutToShutdown() return SynchronousShutdown; } -QmlProfilerSettings *QmlProfilerPlugin::globalSettings() -{ - return qmlProfilerGlobalSettings(); -} - } // QmlProfiler::Internal diff --git a/src/plugins/qmlprofiler/qmlprofilerplugin.h b/src/plugins/qmlprofiler/qmlprofilerplugin.h index e189268e705..d04f016a877 100644 --- a/src/plugins/qmlprofiler/qmlprofilerplugin.h +++ b/src/plugins/qmlprofiler/qmlprofilerplugin.h @@ -7,16 +7,11 @@ namespace QmlProfiler::Internal { -class QmlProfilerSettings; - class QmlProfilerPlugin : public ExtensionSystem::IPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlProfiler.json") -public: - static QmlProfilerSettings *globalSettings(); - private: bool initialize(const QStringList &arguments, QString *errorString) final; void extensionsInitialized() final; diff --git a/src/plugins/qmlprofiler/qmlprofilerrunconfigurationaspect.cpp b/src/plugins/qmlprofiler/qmlprofilerrunconfigurationaspect.cpp index ac3056d3da3..e513e3fe6fd 100644 --- a/src/plugins/qmlprofiler/qmlprofilerrunconfigurationaspect.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerrunconfigurationaspect.cpp @@ -1,9 +1,9 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "qmlprofilerconstants.h" -#include "qmlprofilerplugin.h" #include "qmlprofilerrunconfigurationaspect.h" + +#include "qmlprofilerconstants.h" #include "qmlprofilersettings.h" #include "qmlprofilertr.h" @@ -14,7 +14,7 @@ namespace QmlProfiler::Internal { QmlProfilerRunConfigurationAspect::QmlProfilerRunConfigurationAspect(ProjectExplorer::Target *) { setProjectSettings(new QmlProfilerSettings); - setGlobalSettings(QmlProfilerPlugin::globalSettings()); + setGlobalSettings(&Internal::globalSettings()); setId(Constants::SETTINGS); setDisplayName(Tr::tr("QML Profiler Settings")); setUsingGlobalSettings(true); diff --git a/src/plugins/qmlprofiler/qmlprofilersettings.cpp b/src/plugins/qmlprofiler/qmlprofilersettings.cpp index 17ae29c28b9..a5c1352fcaf 100644 --- a/src/plugins/qmlprofiler/qmlprofilersettings.cpp +++ b/src/plugins/qmlprofiler/qmlprofilersettings.cpp @@ -1,50 +1,33 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "qmlprofilerconstants.h" -#include "qmlprofilerplugin.h" #include "qmlprofilersettings.h" + +#include "qmlprofilerconstants.h" #include "qmlprofilertr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <debugger/analyzer/analyzericons.h> #include <debugger/debuggertr.h> #include <utils/layoutbuilder.h> -#include <QSettings> - using namespace Utils; namespace QmlProfiler::Internal { -class QmlProfilerOptionsPageWidget : public Core::IOptionsPageWidget +QmlProfilerSettings &globalSettings() { -public: - explicit QmlProfilerOptionsPageWidget(QmlProfilerSettings *settings) - { - QmlProfilerSettings &s = *settings; - - using namespace Layouting; - Form { - s.flushEnabled, br, - s.flushInterval, br, - s.aggregateTraces, br, - }.attachTo(this); - } - - void apply() final - { - QmlProfilerPlugin::globalSettings()->writeGlobalSettings(); - } -}; + static QmlProfilerSettings theSettings; + return theSettings; +} QmlProfilerSettings::QmlProfilerSettings() { - setConfigWidgetCreator([this] { return new QmlProfilerOptionsPageWidget(this); }); - + setAutoApply(false); setSettingsGroup(Constants::ANALYZER); - registerAspect(&flushEnabled); flushEnabled.setSettingsKey("Analyzer.QmlProfiler.FlushEnabled"); flushEnabled.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); flushEnabled.setLabelText(Tr::tr("Flush data while profiling:")); @@ -53,17 +36,14 @@ QmlProfilerSettings::QmlProfilerSettings() "data and the memory usage in the application. It distorts the profile as the flushing\n" "itself takes time.")); - registerAspect(&flushInterval); flushInterval.setSettingsKey("Analyzer.QmlProfiler.FlushInterval"); flushInterval.setRange(1, 10000000); flushInterval.setDefaultValue(1000); flushInterval.setLabelText(Tr::tr("Flush interval (ms):")); flushInterval.setEnabler(&flushEnabled); - registerAspect(&lastTraceFile); lastTraceFile.setSettingsKey("Analyzer.QmlProfiler.LastTraceFile"); - registerAspect(&aggregateTraces); aggregateTraces.setSettingsKey("Analyzer.QmlProfiler.AggregateTraces"); aggregateTraces.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); aggregateTraces.setLabelText(Tr::tr("Process data only when process ends:")); @@ -73,27 +53,36 @@ QmlProfilerSettings::QmlProfilerSettings() "for example if multiple QML engines start and stop sequentially during a single run of\n" "the program.")); - // Read stored values + setLayouter([this] { + using namespace Layouting; + return Form { + flushEnabled, br, + flushInterval, br, + aggregateTraces, br, + }; + }); + + setConfigWidgetCreator([this] { return layouter()().emerge(); }); + readSettings(); } -void QmlProfilerSettings::writeGlobalSettings() const -{ - writeSettings(); -} +// QmlProfilerSettingsPage -// QmlProfilerOptionsPage - -QmlProfilerOptionsPage::QmlProfilerOptionsPage() +class QmlProfilerSettingsPage final : public Core::IOptionsPage { - setId(Constants::SETTINGS); - setDisplayName(Tr::tr("QML Profiler")); - setCategory("T.Analyzer"); - setDisplayCategory(::Debugger::Tr::tr("Analyzer")); - setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); - setWidgetCreator([] { - return new QmlProfilerOptionsPageWidget(QmlProfilerPlugin::globalSettings()); - }); -} +public: + QmlProfilerSettingsPage() + { + setId(Constants::SETTINGS); + setDisplayName(Tr::tr("QML Profiler")); + setCategory("T.Analyzer"); + setDisplayCategory(::Debugger::Tr::tr("Analyzer")); + setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); + setSettingsProvider([] { return &globalSettings(); }); + } +}; + +const QmlProfilerSettingsPage settingsPage; } // QmlProfiler::Internal diff --git a/src/plugins/qmlprofiler/qmlprofilersettings.h b/src/plugins/qmlprofiler/qmlprofilersettings.h index b53622cabc5..2b0329e4f5e 100644 --- a/src/plugins/qmlprofiler/qmlprofilersettings.h +++ b/src/plugins/qmlprofiler/qmlprofilersettings.h @@ -3,8 +3,6 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> - #include <projectexplorer/runconfiguration.h> namespace QmlProfiler::Internal { @@ -14,18 +12,12 @@ class QmlProfilerSettings : public ProjectExplorer::ISettingsAspect public: QmlProfilerSettings(); - void writeGlobalSettings() const; - - Utils::BoolAspect flushEnabled; - Utils::IntegerAspect flushInterval; - Utils::FilePathAspect lastTraceFile; - Utils::BoolAspect aggregateTraces; + Utils::BoolAspect flushEnabled{this}; + Utils::IntegerAspect flushInterval{this}; + Utils::FilePathAspect lastTraceFile{this}; + Utils::BoolAspect aggregateTraces{this}; }; -class QmlProfilerOptionsPage final : public Core::IOptionsPage -{ -public: - QmlProfilerOptionsPage(); -}; +QmlProfilerSettings &globalSettings(); } // QmlProfiler::Internal diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index f5ade253be3..c8e38d100f6 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -566,10 +566,10 @@ void QmlProfilerTool::showErrorDialog(const QString &error) static void saveLastTraceFile(const FilePath &filePath) { - QmlProfilerSettings *settings = QmlProfilerPlugin::globalSettings(); - if (filePath != settings->lastTraceFile()) { - settings->lastTraceFile.setValue(filePath); - settings->writeGlobalSettings(); + QmlProfilerSettings &s = globalSettings(); + if (filePath != s.lastTraceFile()) { + s.lastTraceFile.setValue(filePath); + s.writeSettings(); } } @@ -579,7 +579,7 @@ void QmlProfilerTool::showSaveDialog() QLatin1String zFile(QztFileExtension); FilePath filePath = FileUtils::getSaveFilePath( nullptr, Tr::tr("Save QML Trace"), - QmlProfilerPlugin::globalSettings()->lastTraceFile(), + globalSettings().lastTraceFile(), Tr::tr("QML traces (*%1 *%2)").arg(zFile).arg(tFile)); if (!filePath.isEmpty()) { if (!filePath.endsWith(zFile) && !filePath.endsWith(tFile)) @@ -603,7 +603,7 @@ void QmlProfilerTool::showLoadDialog() QLatin1String zFile(QztFileExtension); FilePath filePath = FileUtils::getOpenFilePath( nullptr, Tr::tr("Load QML Trace"), - QmlProfilerPlugin::globalSettings()->lastTraceFile(), + globalSettings().lastTraceFile(), Tr::tr("QML traces (*%1 *%2)").arg(zFile).arg(tFile)); if (!filePath.isEmpty()) { From 396c6c92f2c30ca4173334b3443cb2bb7a6350e1 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 20 Jul 2023 23:24:49 +0200 Subject: [PATCH 0424/1777] RemoteLinux: Make generic wizard similar to QnxDeviceWizard Change-Id: Ia8feb1b5d18d7a1cebd14f37775a6097b1dc380c Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- .../genericlinuxdeviceconfigurationwizard.cpp | 23 +++++++++---------- .../genericlinuxdeviceconfigurationwizard.h | 2 +- src/plugins/remotelinux/linuxdevice.cpp | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp index 7bd047a590e..48e61ca4670 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp @@ -8,6 +8,8 @@ #include "remotelinux_constants.h" #include "remotelinuxtr.h" +#include <coreplugin/icore.h> + #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/devicesupport/sshparameters.h> @@ -17,33 +19,30 @@ using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { -enum PageId { SetupPageId, KeyDeploymentPageId, FinalPageId }; class GenericLinuxDeviceConfigurationWizardPrivate { public: - GenericLinuxDeviceConfigurationWizardPrivate(QWidget *parent) - : setupPage(parent), keyDeploymentPage(parent), finalPage(parent) - { - } - GenericLinuxDeviceConfigurationWizardSetupPage setupPage; GenericLinuxDeviceConfigurationWizardKeyDeploymentPage keyDeploymentPage; GenericLinuxDeviceConfigurationWizardFinalPage finalPage; LinuxDevice::Ptr device; }; + } // namespace Internal -GenericLinuxDeviceConfigurationWizard::GenericLinuxDeviceConfigurationWizard(QWidget *parent) - : Utils::Wizard(parent), - d(new Internal::GenericLinuxDeviceConfigurationWizardPrivate(this)) +GenericLinuxDeviceConfigurationWizard::GenericLinuxDeviceConfigurationWizard() + : Utils::Wizard(Core::ICore::dialogParent()) + , d(new Internal::GenericLinuxDeviceConfigurationWizardPrivate) { setWindowTitle(Tr::tr("New Remote Linux Device Configuration Setup")); - setPage(Internal::SetupPageId, &d->setupPage); - setPage(Internal::KeyDeploymentPageId, &d->keyDeploymentPage); - setPage(Internal::FinalPageId, &d->finalPage); + addPage(&d->setupPage); + addPage(&d->keyDeploymentPage); + addPage(&d->finalPage); d->finalPage.setCommitPage(true); + d->device = LinuxDevice::create(); + d->setupPage.setDevice(d->device); d->keyDeploymentPage.setDevice(d->device); } diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h index df25a3b5861..87b27bf402e 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h @@ -16,7 +16,7 @@ class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizard : public Utils::W Q_OBJECT public: - GenericLinuxDeviceConfigurationWizard(QWidget *parent = nullptr); + GenericLinuxDeviceConfigurationWizard(); ~GenericLinuxDeviceConfigurationWizard() override; ProjectExplorer::IDevicePtr device(); diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 5883af8a4ae..d78a91c99a2 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -1485,7 +1485,7 @@ LinuxDeviceFactory::LinuxDeviceFactory() setConstructionFunction(&LinuxDevice::create); setQuickCreationAllowed(true); setCreator([] { - GenericLinuxDeviceConfigurationWizard wizard(Core::ICore::dialogParent()); + GenericLinuxDeviceConfigurationWizard wizard; if (wizard.exec() != QDialog::Accepted) return IDevice::Ptr(); return wizard.device(); From da856ea9f1b8759148d0ee7c7c965104421263d3 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 17:56:59 +0200 Subject: [PATCH 0425/1777] BareMetal: Use aspect for KeilToolChain::m_extraCodeModelFlags Change-Id: I847bc9260b645d75eb695e1d0791326e8a2b734e Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/baremetal/keiltoolchain.cpp | 46 ++++++------------------- 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/src/plugins/baremetal/keiltoolchain.cpp b/src/plugins/baremetal/keiltoolchain.cpp index 9257a8d781c..552bc3c35f3 100644 --- a/src/plugins/baremetal/keiltoolchain.cpp +++ b/src/plugins/baremetal/keiltoolchain.cpp @@ -38,8 +38,6 @@ namespace BareMetal::Internal { // Helpers: -static const char compilerPlatformCodeGenFlagsKeyC[] = "PlatformCodeGenFlags"; - static bool compilerExists(const FilePath &compilerPath) { const QFileInfo fi = compilerPath.toFileInfo(); @@ -437,6 +435,10 @@ public: setTypeDisplayName(Tr::tr("KEIL")); setTargetAbiKey("TargetAbi"); setCompilerCommandKey("CompilerPath"); + + m_extraCodeModelFlags.setSettingsKey("PlatformCodeGenFlags"); + connect(&m_extraCodeModelFlags, &BaseAspect::changed, + this, &KeilToolChain::toolChainUpdated); } MacroInspectionRunner createMacroInspectionRunner() const final; @@ -449,26 +451,21 @@ public: QList<OutputLineParser *> createOutputParsers() const final { return {new KeilParser}; } - void toMap(QVariantMap &data) const final; - bool fromMap(const QVariantMap &data) final; - std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() final; bool operator==(const ToolChain &other) const final; - void setExtraCodeModelFlags(const QStringList &flags); QStringList extraCodeModelFlags() const final; FilePath makeCommand(const Environment &) const final { return {}; } private: - QStringList m_extraCodeModelFlags; + StringListAspect m_extraCodeModelFlags{this}; friend class KeilToolChainFactory; friend class KeilToolChainConfigWidget; }; - ToolChain::MacroInspectionRunner KeilToolChain::createMacroInspectionRunner() const { Environment env = Environment::systemEnvironment(); @@ -478,7 +475,7 @@ ToolChain::MacroInspectionRunner KeilToolChain::createMacroInspectionRunner() co const Id lang = language(); MacrosCache macroCache = predefinedMacrosCache(); - const QStringList extraArgs = m_extraCodeModelFlags; + const QStringList extraArgs = m_extraCodeModelFlags(); return [env, compiler, extraArgs, macroCache, lang](const QStringList &flags) { Q_UNUSED(flags) @@ -526,21 +523,6 @@ void KeilToolChain::addToEnvironment(Environment &env) const env.prependOrSetPath(compilerCommand().parentDir()); } - -void KeilToolChain::toMap(QVariantMap &data) const -{ - ToolChain::toMap(data); - data.insert(compilerPlatformCodeGenFlagsKeyC, m_extraCodeModelFlags); -} - -bool KeilToolChain::fromMap(const QVariantMap &data) -{ - if (!ToolChain::fromMap(data)) - return false; - m_extraCodeModelFlags = data.value(compilerPlatformCodeGenFlagsKeyC).toStringList(); - return true; -} - std::unique_ptr<ToolChainConfigWidget> KeilToolChain::createConfigurationWidget() { return std::make_unique<KeilToolChainConfigWidget>(this); @@ -554,20 +536,12 @@ bool KeilToolChain::operator ==(const ToolChain &other) const const auto customTc = static_cast<const KeilToolChain *>(&other); return compilerCommand() == customTc->compilerCommand() && targetAbi() == customTc->targetAbi() - && m_extraCodeModelFlags == customTc->m_extraCodeModelFlags; -} - -void KeilToolChain::setExtraCodeModelFlags(const QStringList &flags) -{ - if (flags == m_extraCodeModelFlags) - return; - m_extraCodeModelFlags = flags; - toolChainUpdated(); + && m_extraCodeModelFlags() == customTc->m_extraCodeModelFlags(); } QStringList KeilToolChain::extraCodeModelFlags() const { - return m_extraCodeModelFlags; + return m_extraCodeModelFlags(); } // KeilToolchainFactory @@ -730,7 +704,7 @@ Toolchains KeilToolChainFactory::autoDetectToolchain(const Candidate &candidate, tc->setDetection(ToolChain::AutoDetection); tc->setLanguage(language); tc->setCompilerCommand(candidate.compilerPath); - tc->setExtraCodeModelFlags(extraArgs); + tc->m_extraCodeModelFlags.setValue(extraArgs); tc->setTargetAbi(abi); tc->setDisplayName(buildDisplayName(abi.architecture(), language, candidate.compilerVersion)); @@ -775,7 +749,7 @@ void KeilToolChainConfigWidget::applyImpl() const auto tc = static_cast<KeilToolChain *>(toolChain()); const QString displayName = tc->displayName(); tc->setCompilerCommand(m_compilerCommand->filePath()); - tc->setExtraCodeModelFlags(splitString(m_platformCodeGenFlagsLineEdit->text())); + tc->m_extraCodeModelFlags.setValue(splitString(m_platformCodeGenFlagsLineEdit->text())); tc->setTargetAbi(m_abiWidget->currentAbi()); tc->setDisplayName(displayName); From 6b8a70b37e287160fbb935de1920c45cd6485da2 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 17:49:32 +0200 Subject: [PATCH 0426/1777] BareMetal: Use aspect for IarToolChain::m_extraCodeModelFlags Change-Id: I6438c93bb2a5200cf628900184a7db59d1fa1689 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/baremetal/iarewtoolchain.cpp | 55 ++++++------------------ 1 file changed, 12 insertions(+), 43 deletions(-) diff --git a/src/plugins/baremetal/iarewtoolchain.cpp b/src/plugins/baremetal/iarewtoolchain.cpp index dda9e47e00c..9a2d13c95ea 100644 --- a/src/plugins/baremetal/iarewtoolchain.cpp +++ b/src/plugins/baremetal/iarewtoolchain.cpp @@ -36,8 +36,6 @@ namespace BareMetal::Internal { // Helpers: -static const char compilerPlatformCodeGenFlagsKeyC[] = "PlatformCodeGenFlags"; - static bool compilerExists(const FilePath &compilerPath) { const QFileInfo fi = compilerPath.toFileInfo(); @@ -298,6 +296,10 @@ public: setTypeDisplayName(Tr::tr("IAREW")); setTargetAbiKey("TargetAbi"); setCompilerCommandKey("CompilerPath"); + + m_extraCodeModelFlags.setSettingsKey("PlatformCodeGenFlags"); + connect(&m_extraCodeModelFlags, &BaseAspect::changed, + this, &IarToolChain::toolChainUpdated); } MacroInspectionRunner createMacroInspectionRunner() const final; @@ -309,20 +311,16 @@ public: void addToEnvironment(Environment &env) const final; QList<OutputLineParser *> createOutputParsers() const final; - void toMap(QVariantMap &data) const final; - bool fromMap(const QVariantMap &data) final; - std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() final; bool operator==(const ToolChain &other) const final; - void setExtraCodeModelFlags(const QStringList &flags); - QStringList extraCodeModelFlags() const final; + QStringList extraCodeModelFlags() const final { return m_extraCodeModelFlags(); } - FilePath makeCommand(const Environment &env) const final; + FilePath makeCommand(const Environment &) const final { return {}; } private: - QStringList m_extraCodeModelFlags; + StringListAspect m_extraCodeModelFlags{this}; friend class IarToolChainFactory; friend class IarToolChainConfigWidget; @@ -335,7 +333,7 @@ ToolChain::MacroInspectionRunner IarToolChain::createMacroInspectionRunner() con const FilePath compiler = compilerCommand(); const Id languageId = language(); - const QStringList extraArgs = m_extraCodeModelFlags; + const QStringList extraArgs = m_extraCodeModelFlags(); MacrosCache macrosCache = predefinedMacrosCache(); return [env, compiler, extraArgs, macrosCache, languageId] @@ -404,20 +402,6 @@ QList<Utils::OutputLineParser *> IarToolChain::createOutputParsers() const return {new IarParser()}; } -void IarToolChain::toMap(QVariantMap &data) const -{ - ToolChain::toMap(data); - data.insert(compilerPlatformCodeGenFlagsKeyC, m_extraCodeModelFlags); -} - -bool IarToolChain::fromMap(const QVariantMap &data) -{ - if (!ToolChain::fromMap(data)) - return false; - m_extraCodeModelFlags = data.value(compilerPlatformCodeGenFlagsKeyC).toStringList(); - return true; -} - std::unique_ptr<ToolChainConfigWidget> IarToolChain::createConfigurationWidget() { return std::make_unique<IarToolChainConfigWidget>(this); @@ -430,27 +414,10 @@ bool IarToolChain::operator==(const ToolChain &other) const const auto customTc = static_cast<const IarToolChain *>(&other); return compilerCommand() == customTc->compilerCommand() - && m_extraCodeModelFlags == customTc->m_extraCodeModelFlags; + && m_extraCodeModelFlags() == customTc->m_extraCodeModelFlags(); } -void IarToolChain::setExtraCodeModelFlags(const QStringList &flags) -{ - if (flags == m_extraCodeModelFlags) - return; - m_extraCodeModelFlags = flags; - toolChainUpdated(); -} -QStringList IarToolChain::extraCodeModelFlags() const -{ - return m_extraCodeModelFlags; -} - -FilePath IarToolChain::makeCommand(const Environment &env) const -{ - Q_UNUSED(env) - return {}; -} // IarToolChainFactory @@ -629,7 +596,9 @@ void IarToolChainConfigWidget::applyImpl() const auto tc = static_cast<IarToolChain *>(toolChain()); const QString displayName = tc->displayName(); tc->setCompilerCommand(m_compilerCommand->filePath()); - tc->setExtraCodeModelFlags(splitString(m_platformCodeGenFlagsLineEdit->text())); + + tc->m_extraCodeModelFlags.setValue(splitString(m_platformCodeGenFlagsLineEdit->text())); + tc->setTargetAbi(m_abiWidget->currentAbi()); tc->setDisplayName(displayName); From 0137c7f8b66a8f98d8e111bfff030ebfa2c44b07 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 18:09:18 +0200 Subject: [PATCH 0427/1777] BareMetal: Simplify a few tests for executable compiler Change-Id: I9d85623b09a949be88075b031fa973c218e93e80 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/baremetal/iarewtoolchain.cpp | 14 +++----------- src/plugins/baremetal/keiltoolchain.cpp | 12 ++---------- src/plugins/baremetal/sdcctoolchain.cpp | 14 +++----------- 3 files changed, 8 insertions(+), 32 deletions(-) diff --git a/src/plugins/baremetal/iarewtoolchain.cpp b/src/plugins/baremetal/iarewtoolchain.cpp index 9a2d13c95ea..0804aa61363 100644 --- a/src/plugins/baremetal/iarewtoolchain.cpp +++ b/src/plugins/baremetal/iarewtoolchain.cpp @@ -34,14 +34,6 @@ using namespace Utils; namespace BareMetal::Internal { -// Helpers: - -static bool compilerExists(const FilePath &compilerPath) -{ - const QFileInfo fi = compilerPath.toFileInfo(); - return fi.exists() && fi.isExecutable() && fi.isFile(); -} - static QString cppLanguageOption(const FilePath &compiler) { const QString baseName = compiler.baseName(); @@ -485,7 +477,7 @@ Toolchains IarToolChainFactory::autoDetect(const ToolchainDetector &detector) co // Build full compiler path. compilerPath += entry.subExePath; const FilePath fn = FilePath::fromUserInput(compilerPath); - if (compilerExists(fn)) { + if (fn.isExecutableFile()) { // Note: threeLevelKey is a guessed toolchain version. candidates.push_back({fn, threeLevelKey}); } @@ -634,14 +626,14 @@ void IarToolChainConfigWidget::setFromToolchain() m_compilerCommand->setFilePath(tc->compilerCommand()); m_platformCodeGenFlagsLineEdit->setText(ProcessArgs::joinArgs(tc->extraCodeModelFlags())); m_abiWidget->setAbis({}, tc->targetAbi()); - const bool haveCompiler = compilerExists(m_compilerCommand->filePath()); + const bool haveCompiler = m_compilerCommand->filePath().isExecutableFile(); m_abiWidget->setEnabled(haveCompiler && !tc->isAutoDetected()); } void IarToolChainConfigWidget::handleCompilerCommandChange() { const FilePath compilerPath = m_compilerCommand->filePath(); - const bool haveCompiler = compilerExists(compilerPath); + const bool haveCompiler = compilerPath.isExecutableFile(); if (haveCompiler) { const auto env = Environment::systemEnvironment(); const QStringList extraArgs = splitString(m_platformCodeGenFlagsLineEdit->text()); diff --git a/src/plugins/baremetal/keiltoolchain.cpp b/src/plugins/baremetal/keiltoolchain.cpp index 552bc3c35f3..d39dc9f03b0 100644 --- a/src/plugins/baremetal/keiltoolchain.cpp +++ b/src/plugins/baremetal/keiltoolchain.cpp @@ -36,14 +36,6 @@ using namespace Utils; namespace BareMetal::Internal { -// Helpers: - -static bool compilerExists(const FilePath &compilerPath) -{ - const QFileInfo fi = compilerPath.toFileInfo(); - return fi.exists() && fi.isExecutable() && fi.isFile(); -} - static Abi::Architecture guessArchitecture(const FilePath &compilerPath) { const QFileInfo fi = compilerPath.toFileInfo(); @@ -785,14 +777,14 @@ void KeilToolChainConfigWidget::setFromToolChain() m_compilerCommand->setFilePath(tc->compilerCommand()); m_platformCodeGenFlagsLineEdit->setText(ProcessArgs::joinArgs(tc->extraCodeModelFlags())); m_abiWidget->setAbis({}, tc->targetAbi()); - const bool haveCompiler = compilerExists(m_compilerCommand->filePath()); + const bool haveCompiler = m_compilerCommand->filePath().isExecutableFile(); m_abiWidget->setEnabled(haveCompiler && !tc->isAutoDetected()); } void KeilToolChainConfigWidget::handleCompilerCommandChange() { const FilePath compilerPath = m_compilerCommand->filePath(); - const bool haveCompiler = compilerExists(compilerPath); + const bool haveCompiler = compilerPath.isExecutableFile(); if (haveCompiler) { const auto env = Environment::systemEnvironment(); const QStringList prevExtraArgs = splitString(m_platformCodeGenFlagsLineEdit->text()); diff --git a/src/plugins/baremetal/sdcctoolchain.cpp b/src/plugins/baremetal/sdcctoolchain.cpp index f559aac3a65..48a2257ec6b 100644 --- a/src/plugins/baremetal/sdcctoolchain.cpp +++ b/src/plugins/baremetal/sdcctoolchain.cpp @@ -35,14 +35,6 @@ using namespace Utils; namespace BareMetal::Internal { -// Helpers: - -static bool compilerExists(const FilePath &compilerPath) -{ - const QFileInfo fi = compilerPath.toFileInfo(); - return fi.exists() && fi.isExecutable() && fi.isFile(); -} - static QString compilerTargetFlag(const Abi &abi) { switch (abi.architecture()) { @@ -346,7 +338,7 @@ Toolchains SdccToolChainFactory::autoDetect(const ToolchainDetector &detector) c compilerPath += "/bin/sdcc.exe"; const FilePath fn = FilePath::fromString( QFileInfo(compilerPath).absoluteFilePath()); - if (!compilerExists(fn)) + if (!fn.isExecutableFile()) return Candidate{}; // Build compiler version. const QString version = QString("%1.%2.%3").arg( @@ -511,14 +503,14 @@ void SdccToolChainConfigWidget::setFromToolchain() const auto tc = static_cast<SdccToolChain *>(toolChain()); m_compilerCommand->setFilePath(tc->compilerCommand()); m_abiWidget->setAbis({}, tc->targetAbi()); - const bool haveCompiler = compilerExists(m_compilerCommand->filePath()); + const bool haveCompiler = m_compilerCommand->filePath().isExecutableFile(); m_abiWidget->setEnabled(haveCompiler && !tc->isAutoDetected()); } void SdccToolChainConfigWidget::handleCompilerCommandChange() { const FilePath compilerPath = m_compilerCommand->filePath(); - const bool haveCompiler = compilerExists(compilerPath); + const bool haveCompiler = compilerPath.isExecutableFile(); if (haveCompiler) { const auto env = Environment::systemEnvironment(); m_macros = dumpPredefinedMacros(compilerPath, env, {}); From df0a3e2a85ba800b9651d09526bf2f757716c9e4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 18:14:03 +0200 Subject: [PATCH 0428/1777] BareMetal: More inlining of simple functions Change-Id: I88413413a4db9a599ed673a818fb8947224605ae Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/baremetal/iarewtoolchain.cpp | 7 +------ src/plugins/baremetal/sdcctoolchain.cpp | 15 ++------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/plugins/baremetal/iarewtoolchain.cpp b/src/plugins/baremetal/iarewtoolchain.cpp index 0804aa61363..262516b4b35 100644 --- a/src/plugins/baremetal/iarewtoolchain.cpp +++ b/src/plugins/baremetal/iarewtoolchain.cpp @@ -301,7 +301,7 @@ public: BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Environment &) const final; void addToEnvironment(Environment &env) const final; - QList<OutputLineParser *> createOutputParsers() const final; + QList<OutputLineParser *> createOutputParsers() const final { return {new IarParser()}; } std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() final; @@ -389,11 +389,6 @@ void IarToolChain::addToEnvironment(Environment &env) const env.prependOrSetPath(compilerCommand().parentDir()); } -QList<Utils::OutputLineParser *> IarToolChain::createOutputParsers() const -{ - return {new IarParser()}; -} - std::unique_ptr<ToolChainConfigWidget> IarToolChain::createConfigurationWidget() { return std::make_unique<IarToolChainConfigWidget>(this); diff --git a/src/plugins/baremetal/sdcctoolchain.cpp b/src/plugins/baremetal/sdcctoolchain.cpp index 48a2257ec6b..e57dd9fafe2 100644 --- a/src/plugins/baremetal/sdcctoolchain.cpp +++ b/src/plugins/baremetal/sdcctoolchain.cpp @@ -216,13 +216,13 @@ public: BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Environment &) const final; void addToEnvironment(Environment &env) const final; - QList<OutputLineParser *> createOutputParsers() const final; + QList<OutputLineParser *> createOutputParsers() const final { return {new SdccParser}; } std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() final; bool operator==(const ToolChain &other) const final; - FilePath makeCommand(const Environment &env) const final; + FilePath makeCommand(const Environment &) const final { return {}; } private: friend class SdccToolChainFactory; @@ -283,11 +283,6 @@ void SdccToolChain::addToEnvironment(Environment &env) const env.prependOrSetPath(compilerCommand().parentDir()); } -QList<Utils::OutputLineParser *> SdccToolChain::createOutputParsers() const -{ - return {new SdccParser}; -} - std::unique_ptr<ToolChainConfigWidget> SdccToolChain::createConfigurationWidget() { return std::make_unique<SdccToolChainConfigWidget>(this); @@ -303,12 +298,6 @@ bool SdccToolChain::operator==(const ToolChain &other) const && targetAbi() == customTc->targetAbi(); } -FilePath SdccToolChain::makeCommand(const Environment &env) const -{ - Q_UNUSED(env) - return {}; -} - // SdccToolChainFactory SdccToolChainFactory::SdccToolChainFactory() From 5a3dc4248505bdabaf493e688de69f736ac65313 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 18:22:29 +0200 Subject: [PATCH 0429/1777] Qnx: Use new AspectContainer base in QnxToolChain Change-Id: I185c69c41e6350993f6e953200224e78575bdb93 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/qnx/qnxsettingspage.cpp | 4 +- src/plugins/qnx/qnxtoolchain.cpp | 78 ++++++++--------------------- src/plugins/qnx/qnxtoolchain.h | 17 +------ 3 files changed, 24 insertions(+), 75 deletions(-) diff --git a/src/plugins/qnx/qnxsettingspage.cpp b/src/plugins/qnx/qnxsettingspage.cpp index 98a740947bb..5d685420dc3 100644 --- a/src/plugins/qnx/qnxsettingspage.cpp +++ b/src/plugins/qnx/qnxsettingspage.cpp @@ -238,8 +238,8 @@ Toolchains QnxConfiguration::createToolChains(const QnxTarget &target) toolChain->setDisplayName(Tr::tr("QCC for %1 (%2)") .arg(m_configName) .arg(target.shortDescription())); - toolChain->setSdpPath(m_envFile.parentDir()); - toolChain->setCpuDir(target.cpuDir()); + toolChain->sdpPath.setValue(m_envFile.parentDir()); + toolChain->cpuDir.setValue(target.cpuDir()); toolChain->resetToolChain(m_qccCompiler); ToolChainManager::registerToolChain(toolChain); diff --git a/src/plugins/qnx/qnxtoolchain.cpp b/src/plugins/qnx/qnxtoolchain.cpp index 0d8f9a01095..130945c976c 100644 --- a/src/plugins/qnx/qnxtoolchain.cpp +++ b/src/plugins/qnx/qnxtoolchain.cpp @@ -10,6 +10,8 @@ #include <projectexplorer/abiwidget.h> #include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/toolchainconfigwidget.h> + #include <utils/algorithm.h> #include <utils/pathchooser.h> @@ -20,9 +22,6 @@ using namespace Utils; namespace Qnx::Internal { -const char CompilerSdpPath[] = "Qnx.QnxToolChain.NDKPath"; -const char CpuDirKey[] = "Qnx.QnxToolChain.CpuDir"; - // QnxToolChainConfigWidget class QnxToolChainConfigWidget : public ToolChainConfigWidget @@ -38,10 +37,9 @@ private: void handleSdpPathChange(); - Utils::PathChooser *m_compilerCommand; - Utils::PathChooser *m_sdpPath; + PathChooser *m_compilerCommand; + PathChooser *m_sdpPath; ProjectExplorer::AbiWidget *m_abiWidget; - }; static Abis detectTargetAbis(const FilePath &sdpPath) @@ -104,6 +102,18 @@ QnxToolChain::QnxToolChain() { setOptionsReinterpreter(&reinterpretOptions); setTypeDisplayName(Tr::tr("QCC")); + + sdpPath.setSettingsKey("Qnx.QnxToolChain.NDKPath"); + connect(&sdpPath, &BaseAspect::changed, this, &QnxToolChain::toolChainUpdated); + + cpuDir.setSettingsKey("Qnx.QnxToolChain.CpuDir"); + connect(&cpuDir, &BaseAspect::changed, this, &QnxToolChain::toolChainUpdated); + + connect(this, &AspectContainer::fromMapFinished, this, [this] { + // Make the ABIs QNX specific (if they aren't already). + setSupportedAbis(QnxUtils::convertAbis(supportedAbis())); + setTargetAbi(QnxUtils::convertAbi(targetAbi())); + }); } std::unique_ptr<ToolChainConfigWidget> QnxToolChain::createConfigurationWidget() @@ -116,7 +126,7 @@ void QnxToolChain::addToEnvironment(Environment &env) const if (env.expandedValueForKey("QNX_HOST").isEmpty() || env.expandedValueForKey("QNX_TARGET").isEmpty() || env.expandedValueForKey("QNX_CONFIGURATION_EXCLUSIVE").isEmpty()) - setQnxEnvironment(env, QnxUtils::qnxEnvironment(m_sdpPath)); + setQnxEnvironment(env, QnxUtils::qnxEnvironment(sdpPath())); GccToolChain::addToEnvironment(env); } @@ -131,54 +141,6 @@ QStringList QnxToolChain::suggestedMkspecList() const }; } -void QnxToolChain::toMap(QVariantMap &data) const -{ - GccToolChain::toMap(data); - data.insert(QLatin1String(CompilerSdpPath), m_sdpPath.toSettings()); - data.insert(QLatin1String(CpuDirKey), m_cpuDir); -} - -bool QnxToolChain::fromMap(const QVariantMap &data) -{ - if (!GccToolChain::fromMap(data)) - return false; - - m_sdpPath = FilePath::fromSettings(data.value(CompilerSdpPath)); - m_cpuDir = data.value(QLatin1String(CpuDirKey)).toString(); - - // Make the ABIs QNX specific (if they aren't already). - setSupportedAbis(QnxUtils::convertAbis(supportedAbis())); - setTargetAbi(QnxUtils::convertAbi(targetAbi())); - - return true; -} - -FilePath QnxToolChain::sdpPath() const -{ - return m_sdpPath; -} - -void QnxToolChain::setSdpPath(const FilePath &sdpPath) -{ - if (m_sdpPath == sdpPath) - return; - m_sdpPath = sdpPath; - toolChainUpdated(); -} - -QString QnxToolChain::cpuDir() const -{ - return m_cpuDir; -} - -void QnxToolChain::setCpuDir(const QString &cpuDir) -{ - if (m_cpuDir == cpuDir) - return; - m_cpuDir = cpuDir; - toolChainUpdated(); -} - GccToolChain::DetectedAbisResult QnxToolChain::detectSupportedAbis() const { // "unknown-qnx-gnu"is needed to get the "--target=xxx" parameter sent code model, @@ -187,7 +149,7 @@ GccToolChain::DetectedAbisResult QnxToolChain::detectSupportedAbis() const // // Without it on Windows Clang defaults to a MSVC mode, which breaks with // the QNX code, which is mostly GNU based. - return GccToolChain::DetectedAbisResult{detectTargetAbis(m_sdpPath), "unknown-qnx-gnu"}; + return GccToolChain::DetectedAbisResult{detectTargetAbis(sdpPath()), "unknown-qnx-gnu"}; } bool QnxToolChain::operator ==(const ToolChain &other) const @@ -197,7 +159,7 @@ bool QnxToolChain::operator ==(const ToolChain &other) const auto qnxTc = static_cast<const QnxToolChain *>(&other); - return m_sdpPath == qnxTc->m_sdpPath && m_cpuDir == qnxTc->m_cpuDir; + return sdpPath() == qnxTc->sdpPath() && cpuDir() == qnxTc->cpuDir(); } // -------------------------------------------------------------------------- @@ -268,7 +230,7 @@ void QnxToolChainConfigWidget::applyImpl() Q_ASSERT(tc); QString displayName = tc->displayName(); tc->setDisplayName(displayName); // reset display name - tc->setSdpPath(m_sdpPath->filePath()); + tc->sdpPath.setValue(m_sdpPath->filePath()); tc->setTargetAbi(m_abiWidget->currentAbi()); tc->resetToolChain(m_compilerCommand->filePath()); } diff --git a/src/plugins/qnx/qnxtoolchain.h b/src/plugins/qnx/qnxtoolchain.h index c38249d8546..7cbdc8f4983 100644 --- a/src/plugins/qnx/qnxtoolchain.h +++ b/src/plugins/qnx/qnxtoolchain.h @@ -4,10 +4,6 @@ #pragma once #include <projectexplorer/gcctoolchain.h> -#include <projectexplorer/toolchainconfigwidget.h> - -namespace ProjectExplorer { class AbiWidget; } -namespace Utils { class PathChooser; } namespace Qnx::Internal { @@ -21,22 +17,13 @@ public: void addToEnvironment(Utils::Environment &env) const override; QStringList suggestedMkspecList() const override; - void toMap(QVariantMap &data) const override; - bool fromMap(const QVariantMap &data) override; - - Utils::FilePath sdpPath() const; - void setSdpPath(const Utils::FilePath &sdpPath); - QString cpuDir() const; - void setCpuDir(const QString &cpuDir); + Utils::FilePathAspect sdpPath{this}; + Utils::StringAspect cpuDir{this}; bool operator ==(const ToolChain &) const override; protected: DetectedAbisResult detectSupportedAbis() const override; - -private: - Utils::FilePath m_sdpPath; - QString m_cpuDir; }; // -------------------------------------------------------------------------- From 661f89be41b64d500bfe8b0a23398798733dd40d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 21 Jul 2023 00:21:07 +0200 Subject: [PATCH 0430/1777] RemoteLinux: Make generic wizard reusable Reuse it in QnxPlugin. Change-Id: Ie60e2829dffa90a4097ef2a0cf1ab19220c2631f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> --- .../devicesupport/idevicefactory.cpp | 2 +- src/plugins/qnx/qnxdevice.cpp | 42 +++------------ .../genericlinuxdeviceconfigurationwizard.cpp | 53 +++++-------------- .../genericlinuxdeviceconfigurationwizard.h | 10 +--- ...riclinuxdeviceconfigurationwizardpages.cpp | 10 ++-- ...nericlinuxdeviceconfigurationwizardpages.h | 4 +- src/plugins/remotelinux/linuxdevice.cpp | 12 ++--- 7 files changed, 36 insertions(+), 97 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/idevicefactory.cpp b/src/plugins/projectexplorer/devicesupport/idevicefactory.cpp index b5178445702..2ff351a8c29 100644 --- a/src/plugins/projectexplorer/devicesupport/idevicefactory.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevicefactory.cpp @@ -112,7 +112,7 @@ void IDeviceFactory::setCombinedIcon(const FilePath &small, const FilePath &larg Icon({{large, Theme::IconsBaseColor}})}); } -void IDeviceFactory::setCreator(const std::function<IDevice::Ptr ()> &creator) +void IDeviceFactory::setCreator(const std::function<IDevice::Ptr()> &creator) { QTC_ASSERT(creator, return); m_creator = creator; diff --git a/src/plugins/qnx/qnxdevice.cpp b/src/plugins/qnx/qnxdevice.cpp index 306b87e861d..ccb19c2031d 100644 --- a/src/plugins/qnx/qnxdevice.cpp +++ b/src/plugins/qnx/qnxdevice.cpp @@ -12,7 +12,7 @@ #include <projectexplorer/devicesupport/sshparameters.h> -#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h> +#include <remotelinux/genericlinuxdeviceconfigurationwizard.h> #include <remotelinux/remotelinuxsignaloperation.h> #include <remotelinux/linuxdevice.h> @@ -86,36 +86,6 @@ public: DeviceTester *createDeviceTester() const final { return new QnxDeviceTester; } }; -class QnxDeviceWizard : public Wizard -{ -public: - QnxDeviceWizard() : Wizard(Core::ICore::dialogParent()) - { - setWindowTitle(Tr::tr("New QNX Device Configuration Setup")); - - addPage(&m_setupPage); - addPage(&m_keyDeploymentPage); - addPage(&m_finalPage); - m_finalPage.setCommitPage(true); - - m_device.reset(new QnxDevice); - - m_setupPage.setDevice(m_device); - m_keyDeploymentPage.setDevice(m_device); - } - - IDevice::Ptr device() const { return m_device; } - -private: - GenericLinuxDeviceConfigurationWizardSetupPage m_setupPage; - GenericLinuxDeviceConfigurationWizardKeyDeploymentPage m_keyDeploymentPage; - GenericLinuxDeviceConfigurationWizardFinalPage m_finalPage; - - LinuxDevice::Ptr m_device; -}; - -// Factory - QnxDeviceFactory::QnxDeviceFactory() : IDeviceFactory(Constants::QNX_QNX_OS_TYPE) { setDisplayName(Tr::tr("QNX Device")); @@ -123,11 +93,13 @@ QnxDeviceFactory::QnxDeviceFactory() : IDeviceFactory(Constants::QNX_QNX_OS_TYPE ":/qnx/images/qnxdevice.png"); setQuickCreationAllowed(true); setConstructionFunction([] { return IDevice::Ptr(new QnxDevice); }); - setCreator([] { - QnxDeviceWizard wizard; + setCreator([]() -> IDevice::Ptr { + const IDevice::Ptr device = IDevice::Ptr(new QnxDevice); + GenericLinuxDeviceConfigurationWizard wizard( + Tr::tr("New QNX Device Configuration Setup"), device); if (wizard.exec() != QDialog::Accepted) - return IDevice::Ptr(); - return wizard.device(); + return {}; + return device; }); } diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp index 48e61ca4670..b1270a276a0 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp @@ -4,57 +4,28 @@ #include "genericlinuxdeviceconfigurationwizard.h" #include "genericlinuxdeviceconfigurationwizardpages.h" -#include "linuxdevice.h" -#include "remotelinux_constants.h" -#include "remotelinuxtr.h" #include <coreplugin/icore.h> -#include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/devicesupport/sshparameters.h> - -#include <utils/fileutils.h> - -using namespace ProjectExplorer; - namespace RemoteLinux { -namespace Internal { -class GenericLinuxDeviceConfigurationWizardPrivate -{ -public: - GenericLinuxDeviceConfigurationWizardSetupPage setupPage; - GenericLinuxDeviceConfigurationWizardKeyDeploymentPage keyDeploymentPage; - GenericLinuxDeviceConfigurationWizardFinalPage finalPage; - LinuxDevice::Ptr device; -}; - -} // namespace Internal - -GenericLinuxDeviceConfigurationWizard::GenericLinuxDeviceConfigurationWizard() +GenericLinuxDeviceConfigurationWizard::GenericLinuxDeviceConfigurationWizard( + const QString &title, const ProjectExplorer::IDevicePtr &device) : Utils::Wizard(Core::ICore::dialogParent()) - , d(new Internal::GenericLinuxDeviceConfigurationWizardPrivate) { - setWindowTitle(Tr::tr("New Remote Linux Device Configuration Setup")); - addPage(&d->setupPage); - addPage(&d->keyDeploymentPage); - addPage(&d->finalPage); - d->finalPage.setCommitPage(true); + setWindowTitle(title); - d->device = LinuxDevice::create(); + auto setupPage = new GenericLinuxDeviceConfigurationWizardSetupPage; + auto keyDeploymentPage = new GenericLinuxDeviceConfigurationWizardKeyDeploymentPage; + auto finalPage = new GenericLinuxDeviceConfigurationWizardFinalPage; - d->setupPage.setDevice(d->device); - d->keyDeploymentPage.setDevice(d->device); -} + addPage(setupPage); + addPage(keyDeploymentPage); + addPage(finalPage); -GenericLinuxDeviceConfigurationWizard::~GenericLinuxDeviceConfigurationWizard() -{ - delete d; -} - -IDevice::Ptr GenericLinuxDeviceConfigurationWizard::device() -{ - return d->device; + finalPage->setCommitPage(true); + setupPage->setDevice(device); + keyDeploymentPage->setDevice(device); } } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h index 87b27bf402e..2d1892e4c36 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h @@ -9,20 +9,14 @@ #include <utils/wizard.h> namespace RemoteLinux { -namespace Internal { class GenericLinuxDeviceConfigurationWizardPrivate; } class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizard : public Utils::Wizard { Q_OBJECT public: - GenericLinuxDeviceConfigurationWizard(); - ~GenericLinuxDeviceConfigurationWizard() override; - - ProjectExplorer::IDevicePtr device(); - -private: - Internal::GenericLinuxDeviceConfigurationWizardPrivate * const d; + GenericLinuxDeviceConfigurationWizard(const QString &title, + const ProjectExplorer::IDevicePtr &device); }; } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp index 0a34683bdeb..03f945098ac 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp @@ -35,7 +35,7 @@ public: QSpinBox *sshPortSpinBox; FancyLineEdit *userNameLineEdit; - LinuxDevice::Ptr device; + IDevicePtr device; }; class GenericLinuxDeviceConfigurationWizardFinalPagePrivate @@ -116,7 +116,8 @@ QString GenericLinuxDeviceConfigurationWizardSetupPage::configurationName() cons return d->nameLineEdit->text().trimmed(); } -void GenericLinuxDeviceConfigurationWizardSetupPage::setDevice(const LinuxDevice::Ptr &device) +void GenericLinuxDeviceConfigurationWizardSetupPage::setDevice( + const ProjectExplorer::IDevicePtr &device) { d->device = device; } @@ -158,7 +159,7 @@ struct GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::Private PathChooser keyFileChooser; QLabel iconLabel; - LinuxDevice::Ptr device; + IDevicePtr device; }; GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::GenericLinuxDeviceConfigurationWizardKeyDeploymentPage(QWidget *parent) @@ -214,7 +215,8 @@ GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::~GenericLinuxDeviceConfi delete d; } -void GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::setDevice(const LinuxDevice::Ptr &device) +void GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::setDevice( + const ProjectExplorer::IDevicePtr &device) { d->device = device; } diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h index 2e2d5298913..4e3f15965fd 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h @@ -24,7 +24,7 @@ public: explicit GenericLinuxDeviceConfigurationWizardSetupPage(QWidget *parent = nullptr); ~GenericLinuxDeviceConfigurationWizardSetupPage() override; - void setDevice(const LinuxDevice::Ptr &device); + void setDevice(const ProjectExplorer::IDevicePtr &device); private: void initializePage() override; @@ -44,7 +44,7 @@ public: explicit GenericLinuxDeviceConfigurationWizardKeyDeploymentPage(QWidget *parent = nullptr); ~GenericLinuxDeviceConfigurationWizardKeyDeploymentPage() override; - void setDevice(const LinuxDevice::Ptr &device); + void setDevice(const ProjectExplorer::IDevicePtr &device); private: void initializePage() override; diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index d78a91c99a2..782ed03d2fd 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -1475,8 +1475,6 @@ void LinuxDevice::checkOsType() namespace Internal { -// Factory - LinuxDeviceFactory::LinuxDeviceFactory() : IDeviceFactory(Constants::GenericLinuxOsType) { @@ -1484,11 +1482,13 @@ LinuxDeviceFactory::LinuxDeviceFactory() setIcon(QIcon()); setConstructionFunction(&LinuxDevice::create); setQuickCreationAllowed(true); - setCreator([] { - GenericLinuxDeviceConfigurationWizard wizard; + setCreator([]() -> IDevice::Ptr { + const IDevice::Ptr device = LinuxDevice::create(); + GenericLinuxDeviceConfigurationWizard wizard( + Tr::tr("New Remote Linux Device Configuration Setup"), device); if (wizard.exec() != QDialog::Accepted) - return IDevice::Ptr(); - return wizard.device(); + return {}; + return device; }); } From 760b8d7139ea0da4ad4b1f8ff55050f2afb2e67a Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 21 Jul 2023 06:56:30 +0200 Subject: [PATCH 0431/1777] Tests: Fix qbs build Change-Id: I12757ef3bccfad3fc6da4f2d22a24e3c4d92a71f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: hjk <hjk@qt.io> --- tests/auto/toolchaincache/toolchaincache.qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/toolchaincache/toolchaincache.qbs b/tests/auto/toolchaincache/toolchaincache.qbs index 7f1a2adbf19..7384b21a88c 100644 --- a/tests/auto/toolchaincache/toolchaincache.qbs +++ b/tests/auto/toolchaincache/toolchaincache.qbs @@ -3,7 +3,7 @@ import qbs QtcAutotest { name: "ToolChainCache autotest" Depends { name: "ProjectExplorer" } - Depends { name: "Qt.gui" } // For QIcon in Task + Depends { name: "Qt"; submodules: ["gui", "widgets"] } // For QIcon in Task, QLabel in ElidingLabel Group { name: "Test sources" files: "tst_toolchaincache.cpp" From 4267d6ad8130d3e3ade2d2998c08d1a1f3b185d9 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 21 Jul 2023 01:02:08 +0200 Subject: [PATCH 0432/1777] RemoteLinux: Inline wizard pages Change-Id: I058c001e34653f7dfa96cd8886daea84be7dc6a1 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/remotelinux/CMakeLists.txt | 1 - .../genericlinuxdeviceconfigurationwizard.cpp | 209 +++++++++++++- ...riclinuxdeviceconfigurationwizardpages.cpp | 265 ------------------ ...nericlinuxdeviceconfigurationwizardpages.h | 78 ------ src/plugins/remotelinux/remotelinux.qbs | 2 - 5 files changed, 204 insertions(+), 351 deletions(-) delete mode 100644 src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp delete mode 100644 src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h diff --git a/src/plugins/remotelinux/CMakeLists.txt b/src/plugins/remotelinux/CMakeLists.txt index f81f75350ac..c49f49793be 100644 --- a/src/plugins/remotelinux/CMakeLists.txt +++ b/src/plugins/remotelinux/CMakeLists.txt @@ -8,7 +8,6 @@ add_qtc_plugin(RemoteLinux genericdirectuploadstep.cpp genericdirectuploadstep.h genericlinuxdeviceconfigurationwidget.cpp genericlinuxdeviceconfigurationwidget.h genericlinuxdeviceconfigurationwizard.cpp genericlinuxdeviceconfigurationwizard.h - genericlinuxdeviceconfigurationwizardpages.cpp genericlinuxdeviceconfigurationwizardpages.h killappstep.cpp killappstep.h linuxdevice.cpp linuxdevice.h linuxdevicetester.cpp linuxdevicetester.h diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp index b1270a276a0..314a0f518bf 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp @@ -3,21 +3,220 @@ #include "genericlinuxdeviceconfigurationwizard.h" -#include "genericlinuxdeviceconfigurationwizardpages.h" +#include "publickeydeploymentdialog.h" +#include "remotelinuxtr.h" +#include "sshkeycreationdialog.h" #include <coreplugin/icore.h> +#include <projectexplorer/devicesupport/idevice.h> +#include <projectexplorer/devicesupport/sshparameters.h> + +#include <utils/fancylineedit.h> +#include <utils/fileutils.h> +#include <utils/layoutbuilder.h> +#include <utils/pathchooser.h> +#include <utils/utilsicons.h> + +#include <QLabel> +#include <QPushButton> +#include <QSpinBox> + +using namespace ProjectExplorer; +using namespace Utils; + namespace RemoteLinux { +class SetupPage : public QWizardPage +{ +public: + explicit SetupPage(QWidget *parent = nullptr) + : QWizardPage(parent) + { + setTitle(Tr::tr("Connection")); + setWindowTitle(Tr::tr("WizardPage")); + + m_nameLineEdit = new FancyLineEdit(this); + m_nameLineEdit->setHistoryCompleter("DeviceName"); + + m_hostNameLineEdit = new FancyLineEdit(this); + m_hostNameLineEdit->setHistoryCompleter("HostName"); + + m_sshPortSpinBox = new QSpinBox(this); + + m_userNameLineEdit = new FancyLineEdit(this); + m_userNameLineEdit->setHistoryCompleter("UserName"); + + using namespace Layouting; + Form { + Tr::tr("The name to identify this configuration:"), m_nameLineEdit, br, + Tr::tr("The device's host name or IP address:"), m_hostNameLineEdit, st, br, + Tr::tr("The device's SSH port number:"), m_sshPortSpinBox, st, br, + Tr::tr("The username to log into the device:"), m_userNameLineEdit, st, br + }.attachTo(this); + + setSubTitle(QLatin1String(" ")); // For Qt bug (background color) + connect(m_nameLineEdit, &QLineEdit::textChanged, this, &QWizardPage::completeChanged); + connect(m_hostNameLineEdit, &QLineEdit::textChanged, this, &QWizardPage::completeChanged); + connect(m_sshPortSpinBox, &QSpinBox::valueChanged, this, &QWizardPage::completeChanged); + connect(m_userNameLineEdit, &QLineEdit::textChanged, this, &QWizardPage::completeChanged); + } + + void setDevice(const ProjectExplorer::IDevicePtr &device) { m_device = device; } + +private: + void initializePage() final { + m_nameLineEdit->setText(m_device->displayName()); + m_hostNameLineEdit->setText(m_device->sshParameters().host()); + m_sshPortSpinBox->setValue(22); + m_sshPortSpinBox->setRange(1, 65535); + m_userNameLineEdit->setText(m_device->sshParameters().userName()); + } + bool isComplete() const final { + return !configurationName().isEmpty() + && !m_hostNameLineEdit->text().trimmed().isEmpty() + && !m_userNameLineEdit->text().trimmed().isEmpty(); + + } + bool validatePage() final { + m_device->setDisplayName(configurationName()); + SshParameters sshParams = m_device->sshParameters(); + sshParams.setHost(m_hostNameLineEdit->text().trimmed()); + sshParams.setUserName(m_userNameLineEdit->text().trimmed()); + sshParams.setPort(m_sshPortSpinBox->value()); + m_device->setSshParameters(sshParams); + return true; + } + + QString configurationName() const { return m_nameLineEdit->text().trimmed(); } + + FancyLineEdit *m_nameLineEdit; + FancyLineEdit *m_hostNameLineEdit; + QSpinBox *m_sshPortSpinBox; + FancyLineEdit *m_userNameLineEdit; + IDevicePtr m_device; +}; + +class KeyDeploymentPage : public QWizardPage +{ +public: + explicit KeyDeploymentPage(QWidget *parent = nullptr) + : QWizardPage(parent) + { + setTitle(Tr::tr("Key Deployment")); + setSubTitle(" "); + const QString info = Tr::tr("We recommend that you log into your device using public key " + "authentication.\n" + "If your device is already set up for this, you do not have to do " + "anything here.\n" + "Otherwise, please deploy the public key for the private key " + "with which to connect in the future.\n" + "If you do not have a private key yet, you can also " + "create one here."); + m_keyFileChooser.setExpectedKind(PathChooser::File); + m_keyFileChooser.setHistoryCompleter("Ssh.KeyFile.History"); + m_keyFileChooser.setPromptDialogTitle(Tr::tr("Choose a Private Key File")); + auto const deployButton = new QPushButton(Tr::tr("Deploy Public Key"), this); + connect(deployButton, &QPushButton::clicked, this, [this] { + PublicKeyDeploymentDialog dlg(m_device, + m_keyFileChooser.filePath().stringAppended(".pub"), this); + m_iconLabel.setPixmap((dlg.exec() == QDialog::Accepted ? Icons::OK : Icons::BROKEN).pixmap()); + }); + auto const createButton = new QPushButton(Tr::tr("Create New Key Pair"), this); + connect(createButton, &QPushButton::clicked, this, [this] { + SshKeyCreationDialog dlg(this); + if (dlg.exec() == QDialog::Accepted) + m_keyFileChooser.setFilePath(dlg.privateKeyFilePath()); + }); + auto const mainLayout = new QVBoxLayout(this); + auto const keyLayout = new QHBoxLayout; + auto const deployLayout = new QHBoxLayout; + mainLayout->addWidget(new QLabel(info)); + keyLayout->addWidget(new QLabel(Tr::tr("Private key file:"))); + keyLayout->addWidget(&m_keyFileChooser); + keyLayout->addWidget(createButton); + keyLayout->addStretch(); + mainLayout->addLayout(keyLayout); + deployLayout->addWidget(deployButton); + deployLayout->addWidget(&m_iconLabel); + deployLayout->addStretch(); + mainLayout->addLayout(deployLayout); + connect(&m_keyFileChooser, &PathChooser::textChanged, this, [this, deployButton] { + deployButton->setEnabled(m_keyFileChooser.filePath().exists()); + m_iconLabel.clear(); + emit completeChanged(); + }); + for (const FilePath &defaultKey : defaultKeys()) { + if (defaultKey.exists()) { + m_keyFileChooser.setFilePath(defaultKey); + break; + } + } + } + + void setDevice(const ProjectExplorer::IDevicePtr &device) { m_device = device; } + +private: + void initializePage() final { + if (!m_device->sshParameters().privateKeyFile.isEmpty()) + m_keyFileChooser.setFilePath(m_keyFileChooser.filePath()); + m_iconLabel.clear(); + } + bool isComplete() const final { + return m_keyFileChooser.filePath().toString().isEmpty() + || m_keyFileChooser.filePath().exists(); + } + bool validatePage() final { + if (!defaultKeys().contains(m_keyFileChooser.filePath())) { + SshParameters sshParams = m_device->sshParameters(); + sshParams.authenticationType = SshParameters::AuthenticationTypeSpecificKey; + sshParams.privateKeyFile = m_keyFileChooser.filePath(); + m_device->setSshParameters(sshParams); + } + return true; + } + + FilePaths defaultKeys() const { + const FilePath baseDir = FileUtils::homePath() / ".ssh"; + return {baseDir / "id_rsa", baseDir / "id_ecdsa", baseDir / "id_ed25519"}; + } + + PathChooser m_keyFileChooser; + QLabel m_iconLabel; + IDevicePtr m_device; +}; + +class FinalPage final : public QWizardPage +{ +public: + FinalPage(QWidget *parent = nullptr) + : QWizardPage(parent) + { + setTitle(Tr::tr("Summary")); + setSubTitle(QLatin1String(" ")); // For Qt bug (background color) + m_infoLabel.setWordWrap(true); + auto const layout = new QVBoxLayout(this); + layout->addWidget(&m_infoLabel); + } + +private: + void initializePage() final { + m_infoLabel.setText(Tr::tr("The new device configuration will now be created.\n" + "In addition, device connectivity will be tested.")); + } + + QLabel m_infoLabel; +}; + GenericLinuxDeviceConfigurationWizard::GenericLinuxDeviceConfigurationWizard( const QString &title, const ProjectExplorer::IDevicePtr &device) - : Utils::Wizard(Core::ICore::dialogParent()) + : Wizard(Core::ICore::dialogParent()) { setWindowTitle(title); - auto setupPage = new GenericLinuxDeviceConfigurationWizardSetupPage; - auto keyDeploymentPage = new GenericLinuxDeviceConfigurationWizardKeyDeploymentPage; - auto finalPage = new GenericLinuxDeviceConfigurationWizardFinalPage; + auto setupPage = new SetupPage; + auto keyDeploymentPage = new KeyDeploymentPage; + auto finalPage = new FinalPage; addPage(setupPage); addPage(keyDeploymentPage); diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp deleted file mode 100644 index 03f945098ac..00000000000 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "genericlinuxdeviceconfigurationwizardpages.h" - -#include "publickeydeploymentdialog.h" -#include "remotelinuxtr.h" -#include "sshkeycreationdialog.h" - -#include <projectexplorer/devicesupport/sshparameters.h> - -#include <utils/filepath.h> -#include <utils/fileutils.h> -#include <utils/fancylineedit.h> -#include <utils/layoutbuilder.h> -#include <utils/pathchooser.h> -#include <utils/utilsicons.h> - -#include <QHBoxLayout> -#include <QLabel> -#include <QPushButton> -#include <QSpinBox> - -using namespace ProjectExplorer; -using namespace Utils; - -namespace RemoteLinux { -namespace Internal { - -class GenericLinuxDeviceConfigurationWizardSetupPagePrivate -{ -public: - FancyLineEdit *nameLineEdit; - FancyLineEdit *hostNameLineEdit; - QSpinBox *sshPortSpinBox; - FancyLineEdit *userNameLineEdit; - - IDevicePtr device; -}; - -class GenericLinuxDeviceConfigurationWizardFinalPagePrivate -{ -public: - QLabel infoLabel; -}; - -} // namespace Internal - -GenericLinuxDeviceConfigurationWizardSetupPage::GenericLinuxDeviceConfigurationWizardSetupPage( - QWidget *parent) : - QWizardPage(parent), d(new Internal::GenericLinuxDeviceConfigurationWizardSetupPagePrivate) -{ - setTitle(Tr::tr("Connection")); - setWindowTitle(Tr::tr("WizardPage")); - - d->nameLineEdit = new FancyLineEdit(this); - d->nameLineEdit->setHistoryCompleter("DeviceName"); - - d->hostNameLineEdit = new FancyLineEdit(this); - d->hostNameLineEdit->setHistoryCompleter("HostName"); - - d->sshPortSpinBox = new QSpinBox(this); - - d->userNameLineEdit = new FancyLineEdit(this); - d->userNameLineEdit->setHistoryCompleter("UserName"); - - using namespace Layouting; - Form { - Tr::tr("The name to identify this configuration:"), d->nameLineEdit, br, - Tr::tr("The device's host name or IP address:"), d->hostNameLineEdit, st, br, - Tr::tr("The device's SSH port number:"), d->sshPortSpinBox, st, br, - Tr::tr("The username to log into the device:"), d->userNameLineEdit, st, br - }.attachTo(this); - - setSubTitle(QLatin1String(" ")); // For Qt bug (background color) - connect(d->nameLineEdit, &QLineEdit::textChanged, this, &QWizardPage::completeChanged); - connect(d->hostNameLineEdit, &QLineEdit::textChanged, this, &QWizardPage::completeChanged); - connect(d->sshPortSpinBox, &QSpinBox::valueChanged, this, &QWizardPage::completeChanged); - connect(d->userNameLineEdit, &QLineEdit::textChanged, this, &QWizardPage::completeChanged); -} - -GenericLinuxDeviceConfigurationWizardSetupPage::~GenericLinuxDeviceConfigurationWizardSetupPage() -{ - delete d; -} - -void GenericLinuxDeviceConfigurationWizardSetupPage::initializePage() -{ - d->nameLineEdit->setText(d->device->displayName()); - d->hostNameLineEdit->setText(d->device->sshParameters().host()); - d->sshPortSpinBox->setValue(22); - d->sshPortSpinBox->setRange(1, 65535); - d->userNameLineEdit->setText(d->device->sshParameters().userName()); -} - -bool GenericLinuxDeviceConfigurationWizardSetupPage::isComplete() const -{ - return !configurationName().isEmpty() - && !d->hostNameLineEdit->text().trimmed().isEmpty() - && !d->userNameLineEdit->text().trimmed().isEmpty(); -} - -bool GenericLinuxDeviceConfigurationWizardSetupPage::validatePage() -{ - d->device->setDisplayName(configurationName()); - SshParameters sshParams = d->device->sshParameters(); - sshParams.setHost(d->hostNameLineEdit->text().trimmed()); - sshParams.setUserName(d->userNameLineEdit->text().trimmed()); - sshParams.setPort(d->sshPortSpinBox->value()); - d->device->setSshParameters(sshParams); - return true; -} - -QString GenericLinuxDeviceConfigurationWizardSetupPage::configurationName() const -{ - return d->nameLineEdit->text().trimmed(); -} - -void GenericLinuxDeviceConfigurationWizardSetupPage::setDevice( - const ProjectExplorer::IDevicePtr &device) -{ - d->device = device; -} - -GenericLinuxDeviceConfigurationWizardFinalPage::GenericLinuxDeviceConfigurationWizardFinalPage( - QWidget *parent) - : QWizardPage(parent), d(new Internal::GenericLinuxDeviceConfigurationWizardFinalPagePrivate) -{ - setTitle(Tr::tr("Summary")); - setSubTitle(QLatin1String(" ")); // For Qt bug (background color) - d->infoLabel.setWordWrap(true); - auto const layout = new QVBoxLayout(this); - layout->addWidget(&d->infoLabel); -} - -GenericLinuxDeviceConfigurationWizardFinalPage::~GenericLinuxDeviceConfigurationWizardFinalPage() -{ - delete d; -} - -void GenericLinuxDeviceConfigurationWizardFinalPage::initializePage() -{ - d->infoLabel.setText(infoText()); -} - -QString GenericLinuxDeviceConfigurationWizardFinalPage::infoText() const -{ - return Tr::tr("The new device configuration will now be created.\n" - "In addition, device connectivity will be tested."); -} - -struct GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::Private -{ - FilePaths defaultKeys() const - { - const FilePath baseDir = FileUtils::homePath() / ".ssh"; - return {baseDir / "id_rsa", baseDir / "id_ecdsa", baseDir / "id_ed25519"}; - } - - PathChooser keyFileChooser; - QLabel iconLabel; - IDevicePtr device; -}; - -GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::GenericLinuxDeviceConfigurationWizardKeyDeploymentPage(QWidget *parent) - : QWizardPage(parent), d(new Private) -{ - setTitle(Tr::tr("Key Deployment")); - setSubTitle(" "); - const QString info = Tr::tr("We recommend that you log into your device using public key " - "authentication.\n" - "If your device is already set up for this, you do not have to do " - "anything here.\n" - "Otherwise, please deploy the public key for the private key " - "with which to connect in the future.\n" - "If you do not have a private key yet, you can also " - "create one here."); - d->keyFileChooser.setExpectedKind(PathChooser::File); - d->keyFileChooser.setHistoryCompleter("Ssh.KeyFile.History"); - d->keyFileChooser.setPromptDialogTitle(Tr::tr("Choose a Private Key File")); - auto const deployButton = new QPushButton(Tr::tr("Deploy Public Key"), this); - connect(deployButton, &QPushButton::clicked, - this, &GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::deployKey); - auto const createButton = new QPushButton(Tr::tr("Create New Key Pair"), this); - connect(createButton, &QPushButton::clicked, - this, &GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::createKey); - auto const mainLayout = new QVBoxLayout(this); - auto const keyLayout = new QHBoxLayout; - auto const deployLayout = new QHBoxLayout; - mainLayout->addWidget(new QLabel(info)); - keyLayout->addWidget(new QLabel(Tr::tr("Private key file:"))); - keyLayout->addWidget(&d->keyFileChooser); - keyLayout->addWidget(createButton); - keyLayout->addStretch(); - mainLayout->addLayout(keyLayout); - deployLayout->addWidget(deployButton); - deployLayout->addWidget(&d->iconLabel); - deployLayout->addStretch(); - mainLayout->addLayout(deployLayout); - connect(&d->keyFileChooser, &PathChooser::textChanged, this, [this, deployButton] { - deployButton->setEnabled(d->keyFileChooser.filePath().exists()); - d->iconLabel.clear(); - emit completeChanged(); - }); - for (const FilePath &defaultKey : d->defaultKeys()) { - if (defaultKey.exists()) { - d->keyFileChooser.setFilePath(defaultKey); - break; - } - } -} - -GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::~GenericLinuxDeviceConfigurationWizardKeyDeploymentPage() -{ - delete d; -} - -void GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::setDevice( - const ProjectExplorer::IDevicePtr &device) -{ - d->device = device; -} - -void GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::initializePage() -{ - if (!d->device->sshParameters().privateKeyFile.isEmpty()) - d->keyFileChooser.setFilePath(privateKeyFilePath()); - d->iconLabel.clear(); -} - -bool GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::isComplete() const -{ - return d->keyFileChooser.filePath().toString().isEmpty() || d->keyFileChooser.filePath().exists(); -} - -bool GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::validatePage() -{ - if (!d->defaultKeys().contains(d->keyFileChooser.filePath())) { - SshParameters sshParams = d->device->sshParameters(); - sshParams.authenticationType = SshParameters::AuthenticationTypeSpecificKey; - sshParams.privateKeyFile = d->keyFileChooser.filePath(); - d->device->setSshParameters(sshParams); - } - return true; -} - -FilePath GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::privateKeyFilePath() const -{ - return d->keyFileChooser.filePath(); -} - -void GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::createKey() -{ - SshKeyCreationDialog dlg(this); - if (dlg.exec() == QDialog::Accepted) - d->keyFileChooser.setFilePath(dlg.privateKeyFilePath()); -} - -void GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::deployKey() -{ - PublicKeyDeploymentDialog dlg(d->device, privateKeyFilePath().stringAppended(".pub"), this); - d->iconLabel.setPixmap((dlg.exec() == QDialog::Accepted ? Icons::OK : Icons::BROKEN).pixmap()); -} - -} // namespace RemoteLinux diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h deleted file mode 100644 index 4e3f15965fd..00000000000 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "remotelinux_export.h" - -#include "linuxdevice.h" - -#include <QWizardPage> - -namespace RemoteLinux { -class LinuxDevice; -namespace Internal { -class GenericLinuxDeviceConfigurationWizardSetupPagePrivate; -class GenericLinuxDeviceConfigurationWizardFinalPagePrivate; -} // namespace Internal - -class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizardSetupPage : public QWizardPage -{ - Q_OBJECT - -public: - explicit GenericLinuxDeviceConfigurationWizardSetupPage(QWidget *parent = nullptr); - ~GenericLinuxDeviceConfigurationWizardSetupPage() override; - - void setDevice(const ProjectExplorer::IDevicePtr &device); - -private: - void initializePage() override; - bool isComplete() const override; - bool validatePage() override; - - QString configurationName() const; - - Internal::GenericLinuxDeviceConfigurationWizardSetupPagePrivate * const d; -}; - -class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizardKeyDeploymentPage : public QWizardPage -{ - Q_OBJECT - -public: - explicit GenericLinuxDeviceConfigurationWizardKeyDeploymentPage(QWidget *parent = nullptr); - ~GenericLinuxDeviceConfigurationWizardKeyDeploymentPage() override; - - void setDevice(const ProjectExplorer::IDevicePtr &device); - -private: - void initializePage() override; - bool isComplete() const override; - bool validatePage() override; - - Utils::FilePath privateKeyFilePath() const; - void createKey(); - void deployKey(); - - struct Private; - Private * const d; -}; - -class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizardFinalPage final : public QWizardPage -{ - Q_OBJECT -public: - GenericLinuxDeviceConfigurationWizardFinalPage(QWidget *parent = nullptr); - ~GenericLinuxDeviceConfigurationWizardFinalPage() override; - -protected: - virtual QString infoText() const; - -private: - void initializePage() override; - - Internal::GenericLinuxDeviceConfigurationWizardFinalPagePrivate * const d; -}; - -} // namespace RemoteLinux diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs index 03a6afad10f..d363603cd99 100644 --- a/src/plugins/remotelinux/remotelinux.qbs +++ b/src/plugins/remotelinux/remotelinux.qbs @@ -25,8 +25,6 @@ Project { "genericlinuxdeviceconfigurationwidget.h", "genericlinuxdeviceconfigurationwizard.cpp", "genericlinuxdeviceconfigurationwizard.h", - "genericlinuxdeviceconfigurationwizardpages.cpp", - "genericlinuxdeviceconfigurationwizardpages.h", "killappstep.cpp", "killappstep.h", "linuxdevice.cpp", From 6847c7c5aeb2c3e97371aaa27e17b03875e496a6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 09:32:18 +0200 Subject: [PATCH 0433/1777] Utils: Consolidate some duplicated code in aspect implementations Change-Id: Iad6b81d13705ce6ad752f2855fb47ea038ffe581 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 78 +++++++++++++------------------------- src/libs/utils/aspects.h | 30 +++++++-------- 2 files changed, 41 insertions(+), 67 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 381c396b6d0..50b6f5e299f 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1205,42 +1205,28 @@ void StringAspect::addToLayout(LayoutItem &parent) bool StringAspect::guiToBuffer() { - const QString old = m_buffer; - switch (d->m_displayStyle) { - case PathChooserDisplay: - if (d->m_pathChooserDisplay) - m_buffer = d->m_pathChooserDisplay->lineEdit()->text(); - break; - case LineEditDisplay: - if (d->m_lineEditDisplay) - m_buffer = d->m_lineEditDisplay->text(); - break; - case TextEditDisplay: - if (d->m_textEditDisplay) - m_buffer = d->m_textEditDisplay->document()->toPlainText(); - case LabelDisplay: - break; - } - return m_buffer != old; + if (d->m_pathChooserDisplay) + return updateStorage(m_buffer, d->m_pathChooserDisplay->lineEdit()->text()); + if (d->m_lineEditDisplay) + return updateStorage(m_buffer, d->m_lineEditDisplay->text()); + if (d->m_textEditDisplay) + return updateStorage(m_buffer, d->m_textEditDisplay->document()->toPlainText()); + return false; } bool StringAspect::bufferToInternal() { - const QString old = m_internal; if (d->m_valueAcceptor) { if (const std::optional<QString> tmp = d->m_valueAcceptor(m_internal, m_buffer)) - m_internal = *tmp; - } else { - m_internal = m_buffer; + return updateStorage(m_internal, *tmp); } - return m_internal != old; + return updateStorage(m_internal, m_buffer); } bool StringAspect::internalToBuffer() { - const QString old = m_buffer; - m_buffer = d->m_displayFilter ? d->m_displayFilter(m_internal) : m_internal; - return m_buffer != old; + const QString val = d->m_displayFilter ? d->m_displayFilter(m_internal) : m_internal; + return updateStorage(m_buffer, val); } void StringAspect::bufferToGui() @@ -1398,10 +1384,9 @@ void ColorAspect::addToLayout(Layouting::LayoutItem &parent) bool ColorAspect::guiToBuffer() { - const QColor old = m_buffer; if (d->m_colorButton) - m_buffer = d->m_colorButton->color(); - return m_buffer != old; + return updateStorage(m_buffer, d->m_colorButton->color()); + return false; } void ColorAspect::bufferToGui() @@ -1630,19 +1615,12 @@ bool SelectionAspect::guiToBuffer() void SelectionAspect::bufferToGui() { - switch (d->m_displayStyle) { - case DisplayStyle::RadioButtons: { - if (d->m_buttonGroup) { - QAbstractButton *button = d->m_buttonGroup->button(m_buffer); - QTC_ASSERT(button, return); - button->setChecked(true); - } - break; - } - case DisplayStyle::ComboBox: - if (d->m_comboBox) - d->m_comboBox->setCurrentIndex(m_buffer); - break; + if (d->m_buttonGroup) { + QAbstractButton *button = d->m_buttonGroup->button(m_buffer); + QTC_ASSERT(button, return); + button->setChecked(true); + } else if (d->m_comboBox) { + d->m_comboBox->setCurrentIndex(m_buffer); } } @@ -1819,18 +1797,18 @@ void MultiSelectionAspect::bufferToGui() bool MultiSelectionAspect::guiToBuffer() { - const QStringList old = m_buffer; if (d->m_listView) { - m_buffer.clear(); + QStringList val; const int n = d->m_listView->count(); QTC_CHECK(n == d->m_allValues.size()); for (int i = 0; i != n; ++i) { auto item = d->m_listView->item(i); if (item->checkState() == Qt::Checked) - m_buffer.append(item->text()); + val.append(item->text()); } + return updateStorage(m_buffer, val); } - return m_buffer != old; + return false; } @@ -1884,10 +1862,9 @@ void IntegerAspect::addToLayout(Layouting::LayoutItem &parent) bool IntegerAspect::guiToBuffer() { - const qint64 old = m_buffer; if (d->m_spinBox) - m_buffer = d->m_spinBox->value() * d->m_displayScaleFactor; - return m_buffer != old; + return updateStorage(m_buffer, d->m_spinBox->value() * d->m_displayScaleFactor); + return false; } void IntegerAspect::bufferToGui() @@ -1985,10 +1962,9 @@ void DoubleAspect::addToLayout(LayoutItem &builder) bool DoubleAspect::guiToBuffer() { - const double old = m_buffer; if (d->m_spinBox) - m_buffer = d->m_spinBox->value(); - return m_buffer != old; + return updateStorage(m_buffer, d->m_spinBox->value()); + return false; } void DoubleAspect::bufferToGui() diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 7a85f2af649..a98f6ae79d0 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -214,6 +214,16 @@ protected: static void saveToMap(QVariantMap &data, const QVariant &value, const QVariant &defaultValue, const QString &key); +protected: + template <class Value> + bool updateStorage(Value &target, const Value &val) + { + if (target == val) + return false; + target = val; + return true; + } + private: std::unique_ptr<Internal::BaseAspectPrivate> d; }; @@ -288,34 +298,22 @@ protected: bool internalToBuffer() override { - if (m_buffer == m_internal) - return false; - m_buffer = m_internal; - return true; + return updateStorage(m_buffer, m_internal); } bool bufferToInternal() override { - if (m_buffer == m_internal) - return false; - m_internal = m_buffer; - return true; + return updateStorage(m_internal, m_buffer); } bool internalToExternal() override { - if (m_external == m_internal) - return false; - m_external = m_internal; - return true; + return updateStorage(m_external, m_internal); } bool externalToInternal() override { - if (m_external == m_internal) - return false; - m_internal = m_external; - return true; + return updateStorage(m_internal, m_external); } QVariant variantValue() const override From 8a2aac2045c4068962679e96a2be7b00d8b7c2d8 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 11:28:39 +0200 Subject: [PATCH 0434/1777] Nim: FilePathify NimSuggest Change-Id: I9beeaa9f5441e040c039e8ceeeecf9c4b2053d22 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/nim/nimplugin.cpp | 4 ++-- src/plugins/nim/suggest/nimsuggest.cpp | 16 ++++++------- src/plugins/nim/suggest/nimsuggest.h | 25 +++++++++++---------- src/plugins/nim/suggest/nimsuggestcache.cpp | 17 +++++++------- src/plugins/nim/suggest/nimsuggestcache.h | 12 +++++----- src/plugins/nim/suggest/server.cpp | 25 +++++---------------- src/plugins/nim/suggest/server.h | 18 +++++---------- 7 files changed, 48 insertions(+), 69 deletions(-) diff --git a/src/plugins/nim/nimplugin.cpp b/src/plugins/nim/nimplugin.cpp index 2ffcadfbf27..502e0889dbb 100644 --- a/src/plugins/nim/nimplugin.cpp +++ b/src/plugins/nim/nimplugin.cpp @@ -41,10 +41,10 @@ class NimPluginPrivate public: NimPluginPrivate() { - Suggest::NimSuggestCache::instance().setExecutablePath(settings.nimSuggestPath.stringValue()); + Suggest::NimSuggestCache::instance().setExecutablePath(settings.nimSuggestPath()); QObject::connect(&settings.nimSuggestPath, &StringAspect::changed, &Suggest::NimSuggestCache::instance(), [this] { - Suggest::NimSuggestCache::instance().setExecutablePath(settings.nimSuggestPath.stringValue()); + Suggest::NimSuggestCache::instance().setExecutablePath(settings.nimSuggestPath()); }); } diff --git a/src/plugins/nim/suggest/nimsuggest.cpp b/src/plugins/nim/suggest/nimsuggest.cpp index 1e59233a2d0..260598713ca 100644 --- a/src/plugins/nim/suggest/nimsuggest.cpp +++ b/src/plugins/nim/suggest/nimsuggest.cpp @@ -3,8 +3,9 @@ #include "nimsuggest.h" -namespace Nim { -namespace Suggest { +using namespace Utils; + +namespace Nim::Suggest { NimSuggest::NimSuggest(QObject *parent) : QObject(parent) @@ -16,12 +17,12 @@ NimSuggest::NimSuggest(QObject *parent) connect(&m_client, &NimSuggestClient::connected, this, &NimSuggest::onClientConnected); } -QString NimSuggest::projectFile() const +FilePath NimSuggest::projectFile() const { return m_projectFile; } -void NimSuggest::setProjectFile(const QString &file) +void NimSuggest::setProjectFile(const Utils::FilePath &file) { if (m_projectFile == file) return; @@ -32,12 +33,12 @@ void NimSuggest::setProjectFile(const QString &file) restart(); } -QString NimSuggest::executablePath() const +FilePath NimSuggest::executablePath() const { return m_executablePath; } -void NimSuggest::setExecutablePath(const QString &path) +void NimSuggest::setExecutablePath(const FilePath &path) { if (m_executablePath == path) return; @@ -145,5 +146,4 @@ void NimSuggest::onClientDisconnected() connectClient(); } -} // namespace Suggest -} // namespace Nim +} // Nim::Suggest diff --git a/src/plugins/nim/suggest/nimsuggest.h b/src/plugins/nim/suggest/nimsuggest.h index 403b70abf69..14ea812336d 100644 --- a/src/plugins/nim/suggest/nimsuggest.h +++ b/src/plugins/nim/suggest/nimsuggest.h @@ -6,8 +6,10 @@ #include "client.h" #include "server.h" -namespace Nim { -namespace Suggest { +#include <utils/filepath.h> + + +namespace Nim::Suggest { class NimSuggest : public QObject { @@ -16,11 +18,11 @@ class NimSuggest : public QObject public: NimSuggest(QObject *parent = nullptr); - QString projectFile() const; - void setProjectFile(const QString &file); + Utils::FilePath projectFile() const; + void setProjectFile(const Utils::FilePath &file); - QString executablePath() const; - void setExecutablePath(const QString &path); + Utils::FilePath executablePath() const; + void setExecutablePath(const Utils::FilePath &path); bool isReady() const; @@ -32,8 +34,8 @@ public: signals: void readyChanged(bool ready); - void projectFileChanged(const QString &projectFile); - void executablePathChanged(const QString &executablePath); + void projectFileChanged(const Utils::FilePath &projectFile); + void executablePathChanged(const Utils::FilePath &executablePath); private: void restart(); @@ -61,11 +63,10 @@ private: bool m_ready = false; bool m_clientReady = false; bool m_serverReady = false; - QString m_projectFile; - QString m_executablePath; + Utils::FilePath m_projectFile; + Utils::FilePath m_executablePath; NimSuggestServer m_server; NimSuggestClient m_client; }; -} // namespace Suggest -} // namespace Nim +} // Nim::Suggest diff --git a/src/plugins/nim/suggest/nimsuggestcache.cpp b/src/plugins/nim/suggest/nimsuggestcache.cpp index 127c55904b3..9fe869cdd55 100644 --- a/src/plugins/nim/suggest/nimsuggestcache.cpp +++ b/src/plugins/nim/suggest/nimsuggestcache.cpp @@ -5,12 +5,14 @@ #include "nimconstants.h" #include "nimsuggest.h" +#include "settings/nimsettings.h" #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/ieditor.h> -namespace Nim { -namespace Suggest { +using namespace Utils; + +namespace Nim::Suggest { NimSuggestCache &NimSuggestCache::instance() { @@ -20,12 +22,12 @@ NimSuggestCache &NimSuggestCache::instance() NimSuggestCache::~NimSuggestCache() = default; -NimSuggest *NimSuggestCache::get(const Utils::FilePath &filename) +NimSuggest *NimSuggestCache::get(const FilePath &filename) { auto it = m_nimSuggestInstances.find(filename); if (it == m_nimSuggestInstances.end()) { auto instance = std::make_unique<Suggest::NimSuggest>(this); - instance->setProjectFile(filename.toString()); + instance->setProjectFile(filename); instance->setExecutablePath(m_executablePath); it = m_nimSuggestInstances.emplace(filename, std::move(instance)).first; } @@ -41,12 +43,12 @@ NimSuggestCache::NimSuggestCache() this, &NimSuggestCache::onEditorClosed); } -QString NimSuggestCache::executablePath() const +FilePath NimSuggestCache::executablePath() const { return m_executablePath; } -void NimSuggestCache::setExecutablePath(const QString &path) +void NimSuggestCache::setExecutablePath(const FilePath &path) { if (m_executablePath == path) return; @@ -72,5 +74,4 @@ void Nim::Suggest::NimSuggestCache::onEditorClosed(Core::IEditor *editor) m_nimSuggestInstances.erase(it); } -} -} +} // Nim::Suggest diff --git a/src/plugins/nim/suggest/nimsuggestcache.h b/src/plugins/nim/suggest/nimsuggestcache.h index df06c5b33fd..757118ba47b 100644 --- a/src/plugins/nim/suggest/nimsuggestcache.h +++ b/src/plugins/nim/suggest/nimsuggestcache.h @@ -11,8 +11,7 @@ namespace Core { class IEditor; } -namespace Nim { -namespace Suggest { +namespace Nim::Suggest { class NimSuggest; @@ -25,8 +24,8 @@ public: NimSuggest *get(const Utils::FilePath &filename); - QString executablePath() const; - void setExecutablePath(const QString &path); + Utils::FilePath executablePath() const; + void setExecutablePath(const Utils::FilePath &path); private: NimSuggestCache(); @@ -37,8 +36,7 @@ private: std::unordered_map<Utils::FilePath, std::unique_ptr<Suggest::NimSuggest>> m_nimSuggestInstances; - QString m_executablePath; + Utils::FilePath m_executablePath; }; -} // namespace Suggest -} // namespace Nim +} // Nim::Suggest diff --git a/src/plugins/nim/suggest/server.cpp b/src/plugins/nim/suggest/server.cpp index 7573505f727..d3f8d086ceb 100644 --- a/src/plugins/nim/suggest/server.cpp +++ b/src/plugins/nim/suggest/server.cpp @@ -5,8 +5,7 @@ using namespace Utils; -namespace Nim { -namespace Suggest { +namespace Nim::Suggest { NimSuggestServer::NimSuggestServer(QObject *parent) : QObject(parent) { @@ -15,20 +14,14 @@ NimSuggestServer::NimSuggestServer(QObject *parent) : QObject(parent) &NimSuggestServer::onStandardOutputAvailable); } -QString NimSuggestServer::executablePath() const +bool NimSuggestServer::start(const FilePath &executablePath, const FilePath &projectFilePath) { - return m_executablePath; -} - -bool NimSuggestServer::start(const QString &executablePath, - const QString &projectFilePath) -{ - if (!QFile::exists(executablePath)) { + if (!executablePath.exists()) { qWarning() << "NimSuggest executable path" << executablePath << "does not exist"; return false; } - if (!QFile::exists(projectFilePath)) { + if (!projectFilePath.exists()) { qWarning() << "Project file" << projectFilePath << "doesn't exist"; return false; } @@ -36,7 +29,7 @@ bool NimSuggestServer::start(const QString &executablePath, stop(); m_executablePath = executablePath; m_projectFilePath = projectFilePath; - m_process.setCommand({FilePath::fromString(executablePath), {"--epc", m_projectFilePath}}); + m_process.setCommand({executablePath, {"--epc", m_projectFilePath.path()}}); m_process.start(); return true; } @@ -52,11 +45,6 @@ quint16 NimSuggestServer::port() const return m_port; } -QString NimSuggestServer::projectFilePath() const -{ - return m_projectFilePath; -} - void NimSuggestServer::onStandardOutputAvailable() { if (!m_portAvailable) { @@ -81,5 +69,4 @@ void NimSuggestServer::clearState() m_port = 0; } -} // namespace Suggest -} // namespace Nim +} // namespace Nim::Suggest diff --git a/src/plugins/nim/suggest/server.h b/src/plugins/nim/suggest/server.h index 9eb2bac141d..73e28096e29 100644 --- a/src/plugins/nim/suggest/server.h +++ b/src/plugins/nim/suggest/server.h @@ -3,14 +3,9 @@ #pragma once -#include <QDebug> -#include <QFile> -#include <QObject> - #include <utils/process.h> -namespace Nim { -namespace Suggest { +namespace Nim::Suggest { class NimSuggestServer : public QObject { @@ -19,12 +14,10 @@ class NimSuggestServer : public QObject public: NimSuggestServer(QObject *parent = nullptr); - bool start(const QString &executablePath, const QString &projectFilePath); + bool start(const Utils::FilePath &executablePath, const Utils::FilePath &projectFilePath); void stop(); quint16 port() const; - QString executablePath() const; - QString projectFilePath() const; signals: void started(); @@ -38,9 +31,8 @@ private: bool m_portAvailable = false; Utils::Process m_process; quint16 m_port = 0; - QString m_projectFilePath; - QString m_executablePath; + Utils::FilePath m_projectFilePath; + Utils::FilePath m_executablePath; }; -} // namespace Suggest -} // namespace Nim +} // Nim::Suggest From afe1fb36764c2f5a284a846af59457697df2c105 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 10:13:48 +0200 Subject: [PATCH 0435/1777] Nim: Actually use the static instance Amends e8fd863fcc, the global settings() function there was unused so far, this here starts using it. Change-Id: I0311baf7e4f86d138fdfafa146bf594b61b237f6 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/nim/nimplugin.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/nim/nimplugin.cpp b/src/plugins/nim/nimplugin.cpp index 502e0889dbb..337499083de 100644 --- a/src/plugins/nim/nimplugin.cpp +++ b/src/plugins/nim/nimplugin.cpp @@ -41,14 +41,13 @@ class NimPluginPrivate public: NimPluginPrivate() { - Suggest::NimSuggestCache::instance().setExecutablePath(settings.nimSuggestPath()); - QObject::connect(&settings.nimSuggestPath, &StringAspect::changed, + Suggest::NimSuggestCache::instance().setExecutablePath(settings().nimSuggestPath()); + QObject::connect(&settings().nimSuggestPath, &StringAspect::changed, &Suggest::NimSuggestCache::instance(), [this] { - Suggest::NimSuggestCache::instance().setExecutablePath(settings.nimSuggestPath()); + Suggest::NimSuggestCache::instance().setExecutablePath(settings().nimSuggestPath()); }); } - NimSettings settings; NimEditorFactory editorFactory; NimBuildConfigurationFactory buildConfigFactory; NimbleBuildConfigurationFactory nimbleBuildConfigFactory; From ce998a16610975c344ffd87705e0585de46d7d78 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 08:58:24 +0200 Subject: [PATCH 0436/1777] Utils: Move pathChooser accessor from String to FilePathAspect Change-Id: Ida3cf1ea8249461bd48327b0c77de1e66a2541e6 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/aspects.cpp | 2 +- src/libs/utils/aspects.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 50b6f5e299f..058b2a7bdc3 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -864,7 +864,7 @@ FilePath StringAspect::filePath() const return FilePath::fromUserInput(value()); } -PathChooser *StringAspect::pathChooser() const +PathChooser *FilePathAspect::pathChooser() const { return d->m_pathChooserDisplay.data(); } diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index a98f6ae79d0..e8cafb79b30 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -529,8 +529,6 @@ public: FilePath filePath() const; - PathChooser *pathChooser() const; // Avoid to use. - signals: void checkedChanged(); void validChanged(bool validState); @@ -563,6 +561,8 @@ public: void setAllowPathFromDevice(bool allowPathFromDevice); void setValidatePlaceHolder(bool validatePlaceHolder); void setOpenTerminalHandler(const std::function<void()> &openTerminal); + + PathChooser *pathChooser() const; // Avoid to use. }; class QTCREATOR_UTILS_EXPORT IntegerAspect : public TypedAspect<qint64> From eb5e258d964394c2d17d2db0f2bac43faf0929a2 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 10:23:29 +0200 Subject: [PATCH 0437/1777] Beautifier: Delay-construct main settings Even though it doesn't help yet as it's immediately accessed. Change-Id: I7e3a40a05517130a9f747c82a3d4928378143947 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/beautifier/beautifierplugin.cpp | 20 ++++---------- src/plugins/beautifier/generalsettings.cpp | 29 +++++++++++++++++---- src/plugins/beautifier/generalsettings.h | 7 ++--- 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/src/plugins/beautifier/beautifierplugin.cpp b/src/plugins/beautifier/beautifierplugin.cpp index ade354b62c1..d4389b00c54 100644 --- a/src/plugins/beautifier/beautifierplugin.cpp +++ b/src/plugins/beautifier/beautifierplugin.cpp @@ -26,22 +26,14 @@ #include <texteditor/formattexteditor.h> #include <texteditor/textdocument.h> -#include <texteditor/textdocumentlayout.h> #include <texteditor/texteditor.h> #include <texteditor/texteditorconstants.h> #include <utils/algorithm.h> #include <utils/fileutils.h> #include <utils/mimeutils.h> -#include <utils/process.h> -#include <utils/qtcassert.h> -#include <utils/temporarydirectory.h> -#include <utils/textutils.h> #include <QMenu> -#include <QPlainTextEdit> -#include <QScrollBar> -#include <QTextBlock> using namespace TextEditor; @@ -71,8 +63,6 @@ public: void autoFormatOnSave(Core::IDocument *document); - GeneralSettings generalSettings; - ArtisticStyle artisticStyleBeautifier; ClangFormat clangFormatBeautifier; Uncrustify uncrustifyBeautifier; @@ -103,7 +93,7 @@ ExtensionSystem::IPlugin::ShutdownFlag BeautifierPlugin::aboutToShutdown() BeautifierPluginPrivate::BeautifierPluginPrivate() { for (BeautifierTool *tool : BeautifierTool::allTools()) - generalSettings.autoFormatTools.addOption(tool->id()); + generalSettings().autoFormatTools.addOption(tool->id()); updateActions(); @@ -122,14 +112,14 @@ void BeautifierPluginPrivate::updateActions(Core::IEditor *editor) void BeautifierPluginPrivate::autoFormatOnSave(Core::IDocument *document) { - if (!generalSettings.autoFormatOnSave.value()) + if (!generalSettings().autoFormatOnSave()) return; - if (!isAutoFormatApplicable(document, generalSettings.allowedMimeTypes())) + if (!isAutoFormatApplicable(document, generalSettings().allowedMimeTypes())) return; // Check if file is contained in the current project (if wished) - if (generalSettings.autoFormatOnlyCurrentProject.value()) { + if (generalSettings().autoFormatOnlyCurrentProject()) { const ProjectExplorer::Project *pro = ProjectExplorer::ProjectTree::currentProject(); if (!pro || pro->files([document](const ProjectExplorer::Node *n) { @@ -142,7 +132,7 @@ void BeautifierPluginPrivate::autoFormatOnSave(Core::IDocument *document) } // Find tool to use by id and format file! - const QString id = generalSettings.autoFormatTools.stringValue(); + const QString id = generalSettings().autoFormatTools.stringValue(); const QList<BeautifierTool *> &tools = BeautifierTool::allTools(); auto tool = std::find_if(std::begin(tools), std::end(tools), [&id](const BeautifierTool *t){return t->id() == id;}); diff --git a/src/plugins/beautifier/generalsettings.cpp b/src/plugins/beautifier/generalsettings.cpp index b54e2cc93cd..7b8d37416ac 100644 --- a/src/plugins/beautifier/generalsettings.cpp +++ b/src/plugins/beautifier/generalsettings.cpp @@ -6,6 +6,8 @@ #include "beautifierconstants.h" #include "beautifiertr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/algorithm.h> #include <utils/genericconstants.h> #include <utils/layoutbuilder.h> @@ -14,13 +16,14 @@ using namespace Utils; namespace Beautifier::Internal { +GeneralSettings &generalSettings() +{ + static GeneralSettings theSettings; + return theSettings; +} + GeneralSettings::GeneralSettings() { - setId(Constants::OPTION_GENERAL_ID); - setDisplayName(Tr::tr("General")); - setCategory(Constants::OPTION_CATEGORY); - setDisplayCategory(Tr::tr("Beautifier")); - setCategoryIconPath(":/beautifier/images/settingscategory_beautifier.png"); setSettingsGroups("Beautifier", "General"); autoFormatOnSave.setSettingsKey(Utils::Constants::BEAUTIFIER_AUTO_FORMAT_ON_SAVE); @@ -73,4 +76,20 @@ QList<MimeType> GeneralSettings::allowedMimeTypes() const return types; } +class GeneralSettingsPage final : public Core::IOptionsPage +{ +public: + GeneralSettingsPage() + { + setId(Constants::OPTION_GENERAL_ID); + setDisplayName(Tr::tr("General")); + setCategory(Constants::OPTION_CATEGORY); + setDisplayCategory(Tr::tr("Beautifier")); + setCategoryIconPath(":/beautifier/images/settingscategory_beautifier.png"); + setSettingsProvider([] { return &generalSettings(); }); + } +}; + +const GeneralSettingsPage settingsPage; + } // Beautifier::Internal diff --git a/src/plugins/beautifier/generalsettings.h b/src/plugins/beautifier/generalsettings.h index 0be68b98e35..23c55e1765d 100644 --- a/src/plugins/beautifier/generalsettings.h +++ b/src/plugins/beautifier/generalsettings.h @@ -3,13 +3,12 @@ #pragma once +#include <utils/aspects.h> #include <utils/mimeutils.h> -#include <coreplugin/dialogs/ioptionspage.h> - namespace Beautifier::Internal { -class GeneralSettings : public Core::PagedSettings +class GeneralSettings final : public Utils::AspectContainer { public: GeneralSettings(); @@ -22,4 +21,6 @@ public: Utils::StringAspect autoFormatMime{this}; }; +GeneralSettings &generalSettings(); + } // Beautifier::Internal From e607005096a6c01bb4d7763efdb76ceb50f5ee7f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 10:52:11 +0200 Subject: [PATCH 0438/1777] ScxmlEditor: Simplify plugin setup Change-Id: Ib28cca1c24780a710f6eae29d168203cbf235ef2 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/scxmleditor/CMakeLists.txt | 2 +- src/plugins/scxmleditor/scxmleditor.qbs | 2 +- src/plugins/scxmleditor/scxmleditorplugin.cpp | 46 +++++++++---------- src/plugins/scxmleditor/scxmleditorplugin.h | 26 ----------- 4 files changed, 24 insertions(+), 52 deletions(-) delete mode 100644 src/plugins/scxmleditor/scxmleditorplugin.h diff --git a/src/plugins/scxmleditor/CMakeLists.txt b/src/plugins/scxmleditor/CMakeLists.txt index 358c407233c..396a03820e3 100644 --- a/src/plugins/scxmleditor/CMakeLists.txt +++ b/src/plugins/scxmleditor/CMakeLists.txt @@ -89,7 +89,7 @@ add_qtc_plugin(ScxmlEditor scxmleditordata.cpp scxmleditordata.h scxmleditordocument.cpp scxmleditordocument.h scxmleditorfactory.cpp scxmleditorfactory.h - scxmleditorplugin.cpp scxmleditorplugin.h + scxmleditorplugin.cpp scxmleditorstack.cpp scxmleditorstack.h scxmltexteditor.cpp scxmltexteditor.h ) diff --git a/src/plugins/scxmleditor/scxmleditor.qbs b/src/plugins/scxmleditor/scxmleditor.qbs index d8457e6e1a3..3f8bbad3d03 100644 --- a/src/plugins/scxmleditor/scxmleditor.qbs +++ b/src/plugins/scxmleditor/scxmleditor.qbs @@ -24,7 +24,7 @@ QtcPlugin { "scxmleditordata.cpp", "scxmleditordata.h", "scxmleditordocument.cpp", "scxmleditordocument.h", "scxmleditorfactory.cpp", "scxmleditorfactory.h", - "scxmleditorplugin.cpp", "scxmleditorplugin.h", + "scxmleditorplugin.cpp", "scxmleditorstack.cpp", "scxmleditorstack.h", "scxmltexteditor.cpp", "scxmltexteditor.h", ] diff --git a/src/plugins/scxmleditor/scxmleditorplugin.cpp b/src/plugins/scxmleditor/scxmleditorplugin.cpp index f2a0de589e2..fdf554b7e40 100644 --- a/src/plugins/scxmleditor/scxmleditorplugin.cpp +++ b/src/plugins/scxmleditor/scxmleditorplugin.cpp @@ -1,37 +1,35 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "scxmleditorplugin.h" - #include "scxmleditorfactory.h" +#include <extensionsystem/iplugin.h> + #include <coreplugin/designmode.h> -using namespace Core; +#include <memory> -namespace ScxmlEditor { -namespace Internal { +namespace ScxmlEditor::Internal { -class ScxmlEditorPluginPrivate +class ScxmlEditorPlugin : public ExtensionSystem::IPlugin { -public: - ScxmlEditorFactory editorFactory; + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ScxmlEditor.json") + +private: + void initialize() final + { + editorFactory = std::make_unique<ScxmlEditorFactory>(); + } + + void extensionsInitialized() final + { + DesignMode::setDesignModeIsRequired(); + } + + std::unique_ptr<ScxmlEditorFactory> editorFactory; }; -ScxmlEditorPlugin::~ScxmlEditorPlugin() -{ - delete d; -} +} // ScxmlEditor::Internal -void ScxmlEditorPlugin::initialize() -{ - d = new ScxmlEditorPluginPrivate; -} - -void ScxmlEditorPlugin::extensionsInitialized() -{ - DesignMode::setDesignModeIsRequired(); -} - -} // Internal -} // ScxmlEditor +#include "scxmleditorplugin.moc" diff --git a/src/plugins/scxmleditor/scxmleditorplugin.h b/src/plugins/scxmleditor/scxmleditorplugin.h deleted file mode 100644 index 485ba92def0..00000000000 --- a/src/plugins/scxmleditor/scxmleditorplugin.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include <extensionsystem/iplugin.h> - -namespace ScxmlEditor { -namespace Internal { - -class ScxmlEditorPlugin : public ExtensionSystem::IPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ScxmlEditor.json") - -public: - ScxmlEditorPlugin() = default; - ~ScxmlEditorPlugin(); - -private: - void initialize() final; - void extensionsInitialized() final; - - class ScxmlEditorPluginPrivate *d = nullptr; -}; - -} // namespace Internal -} // namespace ScxmlEditor From 465d20fb1554af71f7c7971f3c4f67ef6b3b8324 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 12:18:39 +0200 Subject: [PATCH 0439/1777] ScxmlEditor: Compile fix Change-Id: Iaf4bcc481f1637f3307aa302dbba33dbed822cbc Reviewed-by: hjk <hjk@qt.io> --- src/plugins/scxmleditor/scxmleditorplugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/scxmleditor/scxmleditorplugin.cpp b/src/plugins/scxmleditor/scxmleditorplugin.cpp index fdf554b7e40..47d76a8c089 100644 --- a/src/plugins/scxmleditor/scxmleditorplugin.cpp +++ b/src/plugins/scxmleditor/scxmleditorplugin.cpp @@ -24,7 +24,7 @@ private: void extensionsInitialized() final { - DesignMode::setDesignModeIsRequired(); + Core::DesignMode::setDesignModeIsRequired(); } std::unique_ptr<ScxmlEditorFactory> editorFactory; From 5f38ac700c60ea2702599ee36ddbb729073f0d13 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 10:20:34 +0200 Subject: [PATCH 0440/1777] Nim: Move unusual plugin private ctor content to its only user Also, drop an unused Q_OBEJCT Change-Id: I0c9188fd09268ca6b6daa94124219a6f9a2fefa8 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/nim/nimplugin.cpp | 11 ----------- src/plugins/nim/suggest/nimsuggestcache.cpp | 12 ++++++++---- src/plugins/nim/suggest/nimsuggestcache.h | 6 ++---- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/plugins/nim/nimplugin.cpp b/src/plugins/nim/nimplugin.cpp index 337499083de..03fe7177f22 100644 --- a/src/plugins/nim/nimplugin.cpp +++ b/src/plugins/nim/nimplugin.cpp @@ -19,8 +19,6 @@ #include "project/nimbletaskstep.h" #include "settings/nimcodestylepreferencesfactory.h" #include "settings/nimcodestylesettingspage.h" -#include "settings/nimsettings.h" -#include "suggest/nimsuggestcache.h" #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runcontrol.h> @@ -39,15 +37,6 @@ namespace Nim { class NimPluginPrivate { public: - NimPluginPrivate() - { - Suggest::NimSuggestCache::instance().setExecutablePath(settings().nimSuggestPath()); - QObject::connect(&settings().nimSuggestPath, &StringAspect::changed, - &Suggest::NimSuggestCache::instance(), [this] { - Suggest::NimSuggestCache::instance().setExecutablePath(settings().nimSuggestPath()); - }); - } - NimEditorFactory editorFactory; NimBuildConfigurationFactory buildConfigFactory; NimbleBuildConfigurationFactory nimbleBuildConfigFactory; diff --git a/src/plugins/nim/suggest/nimsuggestcache.cpp b/src/plugins/nim/suggest/nimsuggestcache.cpp index 9fe869cdd55..e59f63a5525 100644 --- a/src/plugins/nim/suggest/nimsuggestcache.cpp +++ b/src/plugins/nim/suggest/nimsuggestcache.cpp @@ -36,6 +36,11 @@ NimSuggest *NimSuggestCache::get(const FilePath &filename) NimSuggestCache::NimSuggestCache() { + setExecutablePath(settings().nimSuggestPath()); + QObject::connect(&settings().nimSuggestPath, &StringAspect::changed, [this] { + setExecutablePath(settings().nimSuggestPath()); + }); + Core::EditorManager *editorManager = Core::EditorManager::instance(); connect(editorManager, &Core::EditorManager::editorOpened, this, &NimSuggestCache::onEditorOpened); @@ -60,14 +65,13 @@ void NimSuggestCache::setExecutablePath(const FilePath &path) } } -void Nim::Suggest::NimSuggestCache::onEditorOpened(Core::IEditor *editor) +void NimSuggestCache::onEditorOpened(Core::IEditor *editor) { - if (editor->document()->mimeType() == Constants::C_NIM_MIMETYPE) { + if (editor->document()->mimeType() == Constants::C_NIM_MIMETYPE) get(editor->document()->filePath()); - } } -void Nim::Suggest::NimSuggestCache::onEditorClosed(Core::IEditor *editor) +void NimSuggestCache::onEditorClosed(Core::IEditor *editor) { auto it = m_nimSuggestInstances.find(editor->document()->filePath()); if (it != m_nimSuggestInstances.end()) diff --git a/src/plugins/nim/suggest/nimsuggestcache.h b/src/plugins/nim/suggest/nimsuggestcache.h index 757118ba47b..51f65d9119b 100644 --- a/src/plugins/nim/suggest/nimsuggestcache.h +++ b/src/plugins/nim/suggest/nimsuggestcache.h @@ -3,7 +3,7 @@ #pragma once -#include <utils/fileutils.h> +#include <utils/filepath.h> #include <QObject> @@ -15,10 +15,8 @@ namespace Nim::Suggest { class NimSuggest; -class NimSuggestCache : public QObject +class NimSuggestCache final : public QObject { - Q_OBJECT - public: static NimSuggestCache &instance(); From 032ba45fae3310f417d8bc520c3c6864866d271a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 10:36:06 +0200 Subject: [PATCH 0441/1777] Nim: Hide most of NimSuggestCache interface Change-Id: I8fc114d253e7ca3a0cc3bed4542402acebfd9e86 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../editor/nimcompletionassistprovider.cpp | 4 +- .../nim/editor/nimtexteditorwidget.cpp | 2 +- src/plugins/nim/suggest/nimsuggestcache.cpp | 117 ++++++++++-------- src/plugins/nim/suggest/nimsuggestcache.h | 30 +---- 4 files changed, 67 insertions(+), 86 deletions(-) diff --git a/src/plugins/nim/editor/nimcompletionassistprovider.cpp b/src/plugins/nim/editor/nimcompletionassistprovider.cpp index fc0ddc26712..e290c8fb84d 100644 --- a/src/plugins/nim/editor/nimcompletionassistprovider.cpp +++ b/src/plugins/nim/editor/nimcompletionassistprovider.cpp @@ -130,7 +130,7 @@ private: static Suggest::NimSuggest *nimSuggestInstance(const AssistInterface *interface) { - return Nim::Suggest::NimSuggestCache::instance().get(interface->filePath()); + return Suggest::getFromCache(interface->filePath()); } static std::shared_ptr<Suggest::NimSuggestClientRequest> sendRequest(const AssistInterface *interface, @@ -154,7 +154,7 @@ private: return result; } - static AssistProposalItemInterface *createProposal(const Nim::Suggest::Line &line) + static AssistProposalItemInterface *createProposal(const Suggest::Line &line) { auto item = new AssistProposalItem(); item->setIcon(Utils::CodeModelIcon::iconForType(symbolIcon(line.symbol_kind))); diff --git a/src/plugins/nim/editor/nimtexteditorwidget.cpp b/src/plugins/nim/editor/nimtexteditorwidget.cpp index b297607dced..f7ca080dace 100644 --- a/src/plugins/nim/editor/nimtexteditorwidget.cpp +++ b/src/plugins/nim/editor/nimtexteditorwidget.cpp @@ -39,7 +39,7 @@ void NimTextEditorWidget::findLinkAt(const QTextCursor &c, const Utils::LinkHand { const Utils::FilePath &path = textDocument()->filePath(); - NimSuggest *suggest = NimSuggestCache::instance().get(path); + NimSuggest *suggest = Nim::Suggest::getFromCache(path); if (!suggest) return processLinkCallback(Utils::Link()); diff --git a/src/plugins/nim/suggest/nimsuggestcache.cpp b/src/plugins/nim/suggest/nimsuggestcache.cpp index e59f63a5525..92bca20d5e9 100644 --- a/src/plugins/nim/suggest/nimsuggestcache.cpp +++ b/src/plugins/nim/suggest/nimsuggestcache.cpp @@ -10,72 +10,79 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/ieditor.h> +#include <unordered_map> + using namespace Utils; namespace Nim::Suggest { -NimSuggestCache &NimSuggestCache::instance() +class NimSuggestCache final : public QObject { - static NimSuggestCache instance; - return instance; -} - -NimSuggestCache::~NimSuggestCache() = default; - -NimSuggest *NimSuggestCache::get(const FilePath &filename) -{ - auto it = m_nimSuggestInstances.find(filename); - if (it == m_nimSuggestInstances.end()) { - auto instance = std::make_unique<Suggest::NimSuggest>(this); - instance->setProjectFile(filename); - instance->setExecutablePath(m_executablePath); - it = m_nimSuggestInstances.emplace(filename, std::move(instance)).first; - } - return it->second.get(); -} - -NimSuggestCache::NimSuggestCache() -{ - setExecutablePath(settings().nimSuggestPath()); - QObject::connect(&settings().nimSuggestPath, &StringAspect::changed, [this] { +public: + NimSuggestCache() + { setExecutablePath(settings().nimSuggestPath()); - }); + QObject::connect(&settings().nimSuggestPath, &StringAspect::changed, [this] { + setExecutablePath(settings().nimSuggestPath()); + }); - Core::EditorManager *editorManager = Core::EditorManager::instance(); - connect(editorManager, &Core::EditorManager::editorOpened, - this, &NimSuggestCache::onEditorOpened); - connect(editorManager, &Core::EditorManager::editorAboutToClose, - this, &NimSuggestCache::onEditorClosed); -} - -FilePath NimSuggestCache::executablePath() const -{ - return m_executablePath; -} - -void NimSuggestCache::setExecutablePath(const FilePath &path) -{ - if (m_executablePath == path) - return; - - m_executablePath = path; - - for (const auto &pair : m_nimSuggestInstances) { - pair.second->setExecutablePath(path); + Core::EditorManager *editorManager = Core::EditorManager::instance(); + connect(editorManager, &Core::EditorManager::editorOpened, + this, &NimSuggestCache::onEditorOpened); + connect(editorManager, &Core::EditorManager::editorAboutToClose, + this, &NimSuggestCache::onEditorClosed); } + + void setExecutablePath(const FilePath &path) + { + if (m_executablePath == path) + return; + + m_executablePath = path; + + for (const auto &pair : m_nimSuggestInstances) + pair.second->setExecutablePath(path); + } + + void onEditorOpened(Core::IEditor *editor) + { + if (editor->document()->mimeType() == Constants::C_NIM_MIMETYPE) + getFromCache(editor->document()->filePath()); + } + + void onEditorClosed(Core::IEditor *editor) + { + auto it = m_nimSuggestInstances.find(editor->document()->filePath()); + if (it != m_nimSuggestInstances.end()) + m_nimSuggestInstances.erase(it); + } + + NimSuggest *get(const FilePath &filePath) + { + auto it = m_nimSuggestInstances.find(filePath); + if (it == m_nimSuggestInstances.end()) { + auto instance = std::make_unique<NimSuggest>(this); + instance->setProjectFile(filePath); + instance->setExecutablePath(m_executablePath); + it = m_nimSuggestInstances.emplace(filePath, std::move(instance)).first; + } + return it->second.get(); + } + + std::unordered_map<FilePath, std::unique_ptr<Suggest::NimSuggest>> m_nimSuggestInstances; + + FilePath m_executablePath; +}; + +static NimSuggestCache &cache() +{ + static NimSuggestCache theCache; + return theCache; } -void NimSuggestCache::onEditorOpened(Core::IEditor *editor) +NimSuggest *getFromCache(const FilePath &filePath) { - if (editor->document()->mimeType() == Constants::C_NIM_MIMETYPE) - get(editor->document()->filePath()); -} - -void NimSuggestCache::onEditorClosed(Core::IEditor *editor) -{ - auto it = m_nimSuggestInstances.find(editor->document()->filePath()); - if (it != m_nimSuggestInstances.end()) - m_nimSuggestInstances.erase(it); + return cache().get(filePath); } } // Nim::Suggest diff --git a/src/plugins/nim/suggest/nimsuggestcache.h b/src/plugins/nim/suggest/nimsuggestcache.h index 51f65d9119b..764828cf0a7 100644 --- a/src/plugins/nim/suggest/nimsuggestcache.h +++ b/src/plugins/nim/suggest/nimsuggestcache.h @@ -3,38 +3,12 @@ #pragma once -#include <utils/filepath.h> - -#include <QObject> - -#include <unordered_map> - -namespace Core { class IEditor; } +namespace Utils { class FilePath; } namespace Nim::Suggest { class NimSuggest; -class NimSuggestCache final : public QObject -{ -public: - static NimSuggestCache &instance(); - - NimSuggest *get(const Utils::FilePath &filename); - - Utils::FilePath executablePath() const; - void setExecutablePath(const Utils::FilePath &path); - -private: - NimSuggestCache(); - ~NimSuggestCache(); - - void onEditorOpened(Core::IEditor *editor); - void onEditorClosed(Core::IEditor *editor); - - std::unordered_map<Utils::FilePath, std::unique_ptr<Suggest::NimSuggest>> m_nimSuggestInstances; - - Utils::FilePath m_executablePath; -}; +NimSuggest *getFromCache(const Utils::FilePath &filePath); } // Nim::Suggest From ece7ae6bb584ec3478a5dff4f814d6a206cc1747 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 14:02:24 +0200 Subject: [PATCH 0442/1777] Debugger: Avoid now unusual external trigger of readSettings() Change-Id: I5a3c9f07e7b07184916b5ca3b95a8966c62193eb Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/debugger/commonoptionspage.cpp | 2 ++ src/plugins/debugger/debuggeractions.cpp | 3 --- src/plugins/debugger/debuggeractions.h | 1 - src/plugins/debugger/debuggerplugin.cpp | 2 -- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index d21aab57c91..a5e3246f0e7 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -127,6 +127,8 @@ CommonSettings::CommonSettings() "does not provide reliable information as it does not use scope " "information, it is switched off by default.")); useToolTipsInMainEditor.setDefaultValue(true); + + readSettings(); } CommonSettings::~CommonSettings() diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index e1b4c57fb4d..ecfcf0e5b5a 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -368,10 +368,7 @@ DebuggerSettings::DebuggerSettings() : if (auto boolAspect = dynamic_cast<BoolAspect *>(aspect)) boolAspect->setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); }); -} -void DebuggerSettings::readSettings() -{ all.readSettings(); } diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index 9ea285388ae..8fa62d172db 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -124,7 +124,6 @@ public: Utils::AspectContainer page5; // CDB Utils::AspectContainer page6; // CDB Paths - void readSettings(); void writeSettings() const; private: diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 63ab6b95d41..3add78b59ff 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -771,8 +771,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) Tr::tr("Debugger Runtime"), Tr::tr("Issues with starting the debugger.")}); - settings().readSettings(); - const auto addLabel = [](QWidget *widget, const QString &text) { auto vbox = qobject_cast<QVBoxLayout *>(widget->layout()); QTC_ASSERT(vbox, return); From fa9601990ba770677a2ea769ecd64fa5c8b4e35b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 12:37:43 +0200 Subject: [PATCH 0443/1777] Debugger: Register common aspects Change-Id: Iaa43758bdf0e5060830213ae744a2d0baedf6c15 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/debugger/commonoptionspage.h | 32 +++++++++---------- .../debuggersourcepathmappingwidget.cpp | 4 +-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h index f5624191bfb..d60658710a4 100644 --- a/src/plugins/debugger/commonoptionspage.h +++ b/src/plugins/debugger/commonoptionspage.h @@ -19,7 +19,7 @@ using SourcePathMap = QMap<QString, QString>; class SourcePathMapAspect : public Utils::TypedAspect<SourcePathMap> { public: - SourcePathMapAspect(); + explicit SourcePathMapAspect(Utils::AspectContainer *container); ~SourcePathMapAspect() override; void fromMap(const QVariantMap &map) override; @@ -43,23 +43,23 @@ public: CommonSettings(); ~CommonSettings(); - Utils::BoolAspect useAlternatingRowColors; - Utils::BoolAspect useAnnotationsInMainEditor; - Utils::BoolAspect useToolTipsInMainEditor; - Utils::BoolAspect closeSourceBuffersOnExit; - Utils::BoolAspect closeMemoryBuffersOnExit; - Utils::BoolAspect raiseOnInterrupt; - Utils::BoolAspect breakpointsFullPathByDefault; - Utils::BoolAspect warnOnReleaseBuilds; - Utils::IntegerAspect maximalStackDepth; + Utils::BoolAspect useAlternatingRowColors{this}; + Utils::BoolAspect useAnnotationsInMainEditor{this}; + Utils::BoolAspect useToolTipsInMainEditor{this}; + Utils::BoolAspect closeSourceBuffersOnExit{this}; + Utils::BoolAspect closeMemoryBuffersOnExit{this}; + Utils::BoolAspect raiseOnInterrupt{this}; + Utils::BoolAspect breakpointsFullPathByDefault{this}; + Utils::BoolAspect warnOnReleaseBuilds{this}; + Utils::IntegerAspect maximalStackDepth{this}; - Utils::BoolAspect fontSizeFollowsEditor; - Utils::BoolAspect switchModeOnExit; - Utils::BoolAspect showQmlObjectTree; - Utils::BoolAspect stationaryEditorWhileStepping; - Utils::BoolAspect forceLoggingToConsole; + Utils::BoolAspect fontSizeFollowsEditor{this}; + Utils::BoolAspect switchModeOnExit{this}; + Utils::BoolAspect showQmlObjectTree{this}; + Utils::BoolAspect stationaryEditorWhileStepping{this}; + Utils::BoolAspect forceLoggingToConsole{this}; - SourcePathMapAspect sourcePathMap; + SourcePathMapAspect sourcePathMap{this}; Utils::BoolAspect *registerForPostMortem = nullptr; }; diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 8e4d2bef147..244264bf793 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -442,8 +442,8 @@ public: }; -SourcePathMapAspect::SourcePathMapAspect() - : d(new SourcePathMapAspectPrivate) +SourcePathMapAspect::SourcePathMapAspect(AspectContainer *container) + : TypedAspect(container), d(new SourcePathMapAspectPrivate) { } From 273939afce0f7786284418473d182ddb9dde9b5c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 16:38:40 +0200 Subject: [PATCH 0444/1777] ProjectExplorer: Access default build properties more directly Change-Id: I2c80e68028971e8b6fd10ef8fba6cf23834e02de Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/projectexplorer/buildaspects.cpp | 3 +- .../projectexplorer/buildconfiguration.cpp | 3 +- .../buildpropertiessettings.cpp | 52 +++++++++++++------ .../projectexplorer/buildpropertiessettings.h | 9 ++-- .../projectexplorer/projectexplorer.cpp | 30 +---------- src/plugins/projectexplorer/projectexplorer.h | 7 --- .../qmakebuildconfiguration.cpp | 19 ++++--- src/plugins/qtsupport/qtbuildaspects.cpp | 4 +- src/plugins/qtsupport/qtsupportplugin.cpp | 5 +- 9 files changed, 58 insertions(+), 74 deletions(-) diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index 74650f49c14..fd7d3f7ae96 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -8,7 +8,6 @@ #include "devicesupport/idevice.h" #include "kitinformation.h" #include "projectexplorerconstants.h" -#include "projectexplorer.h" #include "projectexplorertr.h" #include "target.h" @@ -168,7 +167,7 @@ SeparateDebugInfoAspect::SeparateDebugInfoAspect(AspectContainer *container) { setDisplayName(Tr::tr("Separate debug info:")); setSettingsKey("SeparateDebugInfo"); - setValue(ProjectExplorerPlugin::buildPropertiesSettings().separateDebugInfo()); + setValue(buildPropertiesSettings().separateDebugInfo()); } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 6fa9b198753..920985c66c9 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -5,6 +5,7 @@ #include "buildaspects.h" #include "buildinfo.h" +#include "buildpropertiessettings.h" #include "buildsteplist.h" #include "buildstepspage.h" #include "buildsystem.h" @@ -621,7 +622,7 @@ FilePath BuildConfiguration::buildDirectoryFromTemplate(const FilePath &projectD [buildType] { return buildTypeName(buildType); }); exp.registerSubProvider([kit] { return kit->macroExpander(); }); - FilePath buildDir = FilePath::fromUserInput(ProjectExplorerPlugin::buildDirectoryTemplate()); + FilePath buildDir = FilePath::fromUserInput(buildPropertiesSettings().buildDirectoryTemplate()); qCDebug(bcLog) << "build dir template:" << buildDir.toUserOutput(); buildDir = exp.expand(buildDir); qCDebug(bcLog) << "expanded build:" << buildDir.toUserOutput(); diff --git a/src/plugins/projectexplorer/buildpropertiessettings.cpp b/src/plugins/projectexplorer/buildpropertiessettings.cpp index aed8c5a8ba2..09c373befb2 100644 --- a/src/plugins/projectexplorer/buildpropertiessettings.cpp +++ b/src/plugins/projectexplorer/buildpropertiessettings.cpp @@ -6,15 +6,24 @@ #include "projectexplorerconstants.h" #include "projectexplorertr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/layoutbuilder.h> using namespace Utils; namespace ProjectExplorer { -// Default directory: -const char DEFAULT_BUILD_DIRECTORY_TEMPLATE[] - = "../%{JS: Util.asciify(\"build-%{Project:Name}-%{Kit:FileSystemName}-%{BuildConfig:Name}\")}"; +static QString defaultBuildDirectoryTemplate() +{ + return "../%{JS: Util.asciify(\"build-%{Project:Name}-%{Kit:FileSystemName}-%{BuildConfig:Name}\")}"; +} + +BuildPropertiesSettings &buildPropertiesSettings() +{ + static BuildPropertiesSettings theSettings; + return theSettings; +} BuildPropertiesSettings::BuildTriStateAspect::BuildTriStateAspect(AspectContainer *container) : TriStateAspect(container, Tr::tr("Enable"), Tr::tr("Disable"), Tr::tr("Use Project Default")) @@ -24,11 +33,6 @@ BuildPropertiesSettings::BuildPropertiesSettings() { setAutoApply(false); - setId("AB.ProjectExplorer.BuildPropertiesSettingsPage"); - setDisplayName(Tr::tr("Default Build Properties")); - setCategory(ProjectExplorer::Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); - setSettings(this); - setLayouter([this] { using namespace Layouting; @@ -45,7 +49,7 @@ BuildPropertiesSettings::BuildPropertiesSettings() buildDirectoryTemplate.setDisplayStyle(StringAspect::LineEditDisplay); buildDirectoryTemplate.setSettingsKey("Directories/BuildDirectory.TemplateV2"); - buildDirectoryTemplate.setDefaultValue(DEFAULT_BUILD_DIRECTORY_TEMPLATE); + buildDirectoryTemplate.setDefaultValue(defaultBuildDirectoryTemplate()); buildDirectoryTemplate.setLabelText(Tr::tr("Default build directory:")); buildDirectoryTemplate.setUseGlobalMacroExpander(); buildDirectoryTemplate.setUseResetButton(); @@ -55,21 +59,35 @@ BuildPropertiesSettings::BuildPropertiesSettings() qmlDebugging.setSettingsKey("ProjectExplorer/Settings/QmlDebugging"); qmlDebugging.setLabelText(Tr::tr("QML debugging:")); + qmlDebugging.setVisible(false); qtQuickCompiler.setSettingsKey("ProjectExplorer/Settings/QtQuickCompiler"); qtQuickCompiler.setLabelText(Tr::tr("Use qmlcachegen:")); + qtQuickCompiler.setVisible(false); - QObject::connect(&showQtSettings, &BaseAspect::changed, &qmlDebugging, [this] { - qmlDebugging.setVisible(showQtSettings()); - }); - QObject::connect(&showQtSettings, &BaseAspect::changed, &qtQuickCompiler, [this] { - qtQuickCompiler.setVisible(showQtSettings()); - }); + readSettings(); } -QString BuildPropertiesSettings::defaultBuildDirectoryTemplate() +void BuildPropertiesSettings::showQtSettings() { - return QString(DEFAULT_BUILD_DIRECTORY_TEMPLATE); + buildPropertiesSettings().qmlDebugging.setVisible(true); + buildPropertiesSettings().qtQuickCompiler.setVisible(true); } +// BuildPropertiesSettingsPage + +class BuildPropertiesSettingsPage final : public Core::IOptionsPage +{ +public: + BuildPropertiesSettingsPage() + { + setId("AB.ProjectExplorer.BuildPropertiesSettingsPage"); + setDisplayName(Tr::tr("Default Build Properties")); + setCategory(ProjectExplorer::Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); + setSettingsProvider([] { return &buildPropertiesSettings(); }); + } +}; + +const BuildPropertiesSettingsPage settingsPage; + } // ProjectExplorer diff --git a/src/plugins/projectexplorer/buildpropertiessettings.h b/src/plugins/projectexplorer/buildpropertiessettings.h index 3b1b2b7c698..75061f3e28c 100644 --- a/src/plugins/projectexplorer/buildpropertiessettings.h +++ b/src/plugins/projectexplorer/buildpropertiessettings.h @@ -5,11 +5,11 @@ #include "projectexplorer_export.h" -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> namespace ProjectExplorer { -class PROJECTEXPLORER_EXPORT BuildPropertiesSettings : public Core::PagedSettings +class PROJECTEXPLORER_EXPORT BuildPropertiesSettings : public Utils::AspectContainer { public: BuildPropertiesSettings(); @@ -24,9 +24,10 @@ public: BuildTriStateAspect separateDebugInfo{this}; BuildTriStateAspect qmlDebugging{this}; BuildTriStateAspect qtQuickCompiler{this}; - Utils::BoolAspect showQtSettings; - QString defaultBuildDirectoryTemplate(); + static void showQtSettings(); // Called by the Qt support plugin }; +PROJECTEXPLORER_EXPORT BuildPropertiesSettings &buildPropertiesSettings(); + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 773a44a647c..111aec12aa5 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -588,7 +588,6 @@ public: QString m_projectFilterString; MiniProjectTargetSelector * m_targetSelector; ProjectExplorerSettings m_projectExplorerSettings; - BuildPropertiesSettings m_buildPropertiesSettings; QList<CustomParserSettings> m_customParsers; bool m_shouldHaveRunConfiguration = false; Id m_runMode = Constants::NO_RUN_MODE; @@ -1681,8 +1680,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er = s->value(Constants::LOW_BUILD_PRIORITY_SETTINGS_KEY, defaultSettings.lowBuildPriority) .toBool(); - dd->m_buildPropertiesSettings.readSettings(); - const int customParserCount = s->value(Constants::CUSTOM_PARSER_COUNT_KEY).toInt(); for (int i = 0; i < customParserCount; ++i) { CustomParserSettings settings; @@ -2258,7 +2255,7 @@ void ProjectExplorerPluginPrivate::savePersistentSettings() int(dd->m_projectExplorerSettings.stopBeforeBuild), int(defaultSettings.stopBeforeBuild)); - dd->m_buildPropertiesSettings.writeSettings(); + buildPropertiesSettings().writeSettings(); // FIXME: Should not be needed. s->setValueWithDefault(Constants::CUSTOM_PARSER_COUNT_KEY, int(dd->m_customParsers.count()), 0); for (int i = 0; i < dd->m_customParsers.count(); ++i) { @@ -3927,16 +3924,6 @@ const AppOutputSettings &ProjectExplorerPlugin::appOutputSettings() return dd->m_outputPane.settings(); } -BuildPropertiesSettings &ProjectExplorerPlugin::buildPropertiesSettings() -{ - return dd->m_buildPropertiesSettings; -} - -void ProjectExplorerPlugin::showQtSettings() -{ - dd->m_buildPropertiesSettings.showQtSettings.setValue(true); -} - void ProjectExplorerPlugin::setCustomParsers(const QList<CustomParserSettings> &settings) { if (dd->m_customParsers != settings) { @@ -4000,21 +3987,6 @@ void ProjectExplorerPlugin::openOpenProjectDialog() ICore::openFiles(files, ICore::SwitchMode); } -/*! - Returns the current build directory template. - - \sa setBuildDirectoryTemplate -*/ -QString ProjectExplorerPlugin::buildDirectoryTemplate() -{ - return dd->m_buildPropertiesSettings.buildDirectoryTemplate.value(); -} - -QString ProjectExplorerPlugin::defaultBuildDirectoryTemplate() -{ - return dd->m_buildPropertiesSettings.defaultBuildDirectoryTemplate(); -} - void ProjectExplorerPlugin::updateActions() { dd->updateActions(); diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index c472094a987..8ba0b646f08 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -28,7 +28,6 @@ class ProcessHandle; } // Utils namespace ProjectExplorer { -class BuildPropertiesSettings; class CustomParserSettings; class FolderNode; class Node; @@ -119,9 +118,6 @@ public: static void setAppOutputSettings(const Internal::AppOutputSettings &settings); static const Internal::AppOutputSettings &appOutputSettings(); - static BuildPropertiesSettings &buildPropertiesSettings(); - static void showQtSettings(); - static void setCustomParsers(const QList<CustomParserSettings> &settings); static void addCustomParser(const CustomParserSettings &settings); static void removeCustomParser(Utils::Id id); @@ -159,9 +155,6 @@ public: static void openNewProjectDialog(); static void openOpenProjectDialog(); - static QString buildDirectoryTemplate(); - static QString defaultBuildDirectoryTemplate(); - static void updateActions(); static void activateProjectPanel(Utils::Id panelId); diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 3fca1a4a3e7..eaff42d8f36 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -26,7 +26,6 @@ #include <projectexplorer/buildsteplist.h> #include <projectexplorer/kit.h> #include <projectexplorer/makestep.h> -#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorertr.h> #include <projectexplorer/runconfiguration.h> @@ -55,10 +54,10 @@ namespace QmakeProjectManager { QmakeExtraBuildInfo::QmakeExtraBuildInfo() { - const BuildPropertiesSettings &settings = ProjectExplorerPlugin::buildPropertiesSettings(); - config.separateDebugInfo = settings.separateDebugInfo.value(); - config.linkQmlDebuggingQQ2 = settings.qmlDebugging.value(); - config.useQtQuickCompiler = settings.qtQuickCompiler.value(); + const BuildPropertiesSettings &settings = buildPropertiesSettings(); + config.separateDebugInfo = settings.separateDebugInfo(); + config.linkQmlDebuggingQQ2 = settings.qmlDebugging(); + config.useQtQuickCompiler = settings.qtQuickCompiler(); } // -------------------------------------------------------------------- @@ -655,7 +654,7 @@ QString QmakeBuildConfiguration::extractSpecFromArguments(QString *args, static BuildInfo createBuildInfo(const Kit *k, const FilePath &projectPath, BuildConfiguration::BuildType type) { - const BuildPropertiesSettings &settings = ProjectExplorerPlugin::buildPropertiesSettings(); + const BuildPropertiesSettings &settings = buildPropertiesSettings(); QtVersion *version = QtKitAspect::qtVersion(k); QmakeExtraBuildInfo extraInfo; BuildInfo info; @@ -666,7 +665,7 @@ static BuildInfo createBuildInfo(const Kit *k, const FilePath &projectPath, info.displayName = ::ProjectExplorer::Tr::tr("Release"); //: Non-ASCII characters in directory suffix may cause build issues. suffix = Tr::tr("Release", "Shadow build directory suffix"); - if (settings.qtQuickCompiler.value() == TriState::Default) { + if (settings.qtQuickCompiler() == TriState::Default) { if (version && version->isQtQuickCompilerSupported()) extraInfo.config.useQtQuickCompiler = TriState::Enabled; } @@ -681,15 +680,15 @@ static BuildInfo createBuildInfo(const Kit *k, const FilePath &projectPath, info.displayName = ::ProjectExplorer::Tr::tr("Profile"); //: Non-ASCII characters in directory suffix may cause build issues. suffix = Tr::tr("Profile", "Shadow build directory suffix"); - if (settings.separateDebugInfo.value() == TriState::Default) + if (settings.separateDebugInfo() == TriState::Default) extraInfo.config.separateDebugInfo = TriState::Enabled; - if (settings.qtQuickCompiler.value() == TriState::Default) { + if (settings.qtQuickCompiler() == TriState::Default) { if (version && version->isQtQuickCompilerSupported()) extraInfo.config.useQtQuickCompiler = TriState::Enabled; } } - if (settings.qmlDebugging.value() == TriState::Default) { + if (settings.qmlDebugging() == TriState::Default) { if (version && version->isQmlDebuggingSupported()) extraInfo.config.linkQmlDebuggingQQ2 = TriState::Enabled; } diff --git a/src/plugins/qtsupport/qtbuildaspects.cpp b/src/plugins/qtsupport/qtbuildaspects.cpp index 55f47d8ac50..e941dcb1872 100644 --- a/src/plugins/qtsupport/qtbuildaspects.cpp +++ b/src/plugins/qtsupport/qtbuildaspects.cpp @@ -27,7 +27,7 @@ QmlDebuggingAspect::QmlDebuggingAspect(AspectContainer *container) { setSettingsKey("EnableQmlDebugging"); setDisplayName(Tr::tr("QML debugging and profiling:")); - setValue(ProjectExplorerPlugin::buildPropertiesSettings().qmlDebugging.value()); + setValue(buildPropertiesSettings().qmlDebugging()); } void QmlDebuggingAspect::addToLayout(Layouting::LayoutItem &parent) @@ -69,7 +69,7 @@ QtQuickCompilerAspect::QtQuickCompilerAspect(AspectContainer *container) { setSettingsKey("QtQuickCompiler"); setDisplayName(Tr::tr("Qt Quick Compiler:")); - setValue(ProjectExplorerPlugin::buildPropertiesSettings().qtQuickCompiler.value()); + setValue(buildPropertiesSettings().qtQuickCompiler()); } void QtQuickCompilerAspect::setBuildConfiguration(const BuildConfiguration *buildConfig) diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index 497390045b5..ed0cb998ff7 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -22,8 +22,8 @@ #include <coreplugin/jsexpander.h> #include <projectexplorer/jsonwizard/jsonwizardfactory.h> +#include <projectexplorer/buildpropertiessettings.h> #include <projectexplorer/project.h> -#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/projecttree.h> #include <projectexplorer/target.h> @@ -132,7 +132,8 @@ void QtSupportPlugin::initialize() JsExpander::registerGlobalObject<CodeGenerator>("QtSupport"); ProjectExplorer::JsonWizardFactory::registerPageFactory(new TranslationWizardPageFactory); - ProjectExplorerPlugin::showQtSettings(); + + BuildPropertiesSettings::showQtSettings(); d = new QtSupportPluginPrivate; From d08a6070b97317ffaf8c44ffc0e5007b4d2ffec2 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 21 Jul 2023 14:24:47 +0200 Subject: [PATCH 0445/1777] ADS: Fix compile Change-Id: I97335e884d99f97efd70980064ae143b964c0ccf Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> --- src/libs/advanceddockingsystem/linux/floatingwidgettitlebar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/advanceddockingsystem/linux/floatingwidgettitlebar.cpp b/src/libs/advanceddockingsystem/linux/floatingwidgettitlebar.cpp index 699a0086fb9..1e02e47ebdc 100644 --- a/src/libs/advanceddockingsystem/linux/floatingwidgettitlebar.cpp +++ b/src/libs/advanceddockingsystem/linux/floatingwidgettitlebar.cpp @@ -174,7 +174,7 @@ void FloatingWidgetTitleBar::mouseMoveEvent(QMouseEvent *event) // Move floating window if (DraggingFloatingWidget == d->m_dragState) { if (d->m_floatingWidget->isMaximized()) - d->m_floatingWidget->showNormal(true); + d->m_floatingWidget->showNormal(); d->m_floatingWidget->moveFloating(); Super::mouseMoveEvent(event); From 0a37ff4149080204778a1e0906b6eef2464d2dd2 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 14:23:44 +0200 Subject: [PATCH 0446/1777] Utils: Move some more FilePath-only functions to FilePathAspect Change-Id: Id814e69339d510e88efbf95108c7573bcc53a87b Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 6 +++--- src/libs/utils/aspects.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 058b2a7bdc3..8e4da2794b0 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -998,21 +998,21 @@ void StringAspect::setHistoryCompleter(const QString &historyCompleterKey) \sa Utils::PathChooser::setExpectedKind() */ -void StringAspect::setExpectedKind(const PathChooser::Kind expectedKind) +void FilePathAspect::setExpectedKind(const PathChooser::Kind expectedKind) { d->m_expectedKind = expectedKind; if (d->m_pathChooserDisplay) d->m_pathChooserDisplay->setExpectedKind(expectedKind); } -void StringAspect::setEnvironment(const Environment &env) +void FilePathAspect::setEnvironment(const Environment &env) { d->m_environment = env; if (d->m_pathChooserDisplay) d->m_pathChooserDisplay->setEnvironment(env); } -void StringAspect::setBaseFileName(const FilePath &baseFileName) +void FilePathAspect::setBaseFileName(const FilePath &baseFileName) { d->m_baseFileName = baseFileName; if (d->m_pathChooserDisplay) diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index e8cafb79b30..e9e81936738 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -494,9 +494,6 @@ public: void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter); void setPlaceHolderText(const QString &placeHolderText); void setHistoryCompleter(const QString &historyCompleterKey); - void setExpectedKind(const PathChooser::Kind expectedKind); - void setEnvironment(const Environment &env); - void setBaseFileName(const FilePath &baseFileName); void setUndoRedoEnabled(bool readOnly); void setAcceptRichText(bool acceptRichText); void setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider); @@ -561,6 +558,9 @@ public: void setAllowPathFromDevice(bool allowPathFromDevice); void setValidatePlaceHolder(bool validatePlaceHolder); void setOpenTerminalHandler(const std::function<void()> &openTerminal); + void setExpectedKind(const PathChooser::Kind expectedKind); + void setEnvironment(const Environment &env); + void setBaseFileName(const FilePath &baseFileName); PathChooser *pathChooser() const; // Avoid to use. }; From 0f9156166777cd48949ef64f5e4b6ae3db188824 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 09:14:47 +0200 Subject: [PATCH 0447/1777] Utils: Make FilePathAspect::value() return a QString This is meant to be the "internal", raw, unexpanded value that does not necessarily match a scheme://host/path pattern before expansion. Change-Id: I627afbe1e9682d85c5bb04542c7354760ba9a13f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 7 +------ src/libs/utils/aspects.h | 3 +-- src/plugins/fossil/fossilclient.cpp | 4 ++-- src/plugins/fossil/wizard/fossiljsextension.cpp | 4 ++-- src/plugins/projectexplorer/buildaspects.cpp | 2 +- src/plugins/projectexplorer/buildconfiguration.cpp | 2 +- src/plugins/vcsbase/vcsbaseclientsettings.cpp | 3 ++- src/plugins/vcsbase/vcsbasesubmiteditor.cpp | 4 ++-- 8 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 8e4da2794b0..3b2891f80a9 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1319,17 +1319,12 @@ FilePath FilePathAspect::operator()() const return FilePath::fromUserInput(StringAspect::value()); } -FilePath FilePathAspect::value() const -{ - return FilePath::fromUserInput(StringAspect::value()); -} - FilePath FilePathAspect::expandedValue() const { return FilePath::fromUserInput(StringAspect::value()); } -QString FilePathAspect::stringValue() const +QString FilePathAspect::value() const { return StringAspect::value(); } diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index e9e81936738..9fd54a24dac 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -546,9 +546,8 @@ public: FilePathAspect(AspectContainer *container = nullptr); FilePath operator()() const; - FilePath value() const; FilePath expandedValue() const; - QString stringValue() const; + QString value() const; void setValue(const FilePath &filePath); void setDefaultValue(const FilePath &filePath); diff --git a/src/plugins/fossil/fossilclient.cpp b/src/plugins/fossil/fossilclient.cpp index bb04dd43d5c..db23a6fcac9 100644 --- a/src/plugins/fossil/fossilclient.cpp +++ b/src/plugins/fossil/fossilclient.cpp @@ -764,9 +764,9 @@ bool FossilClient::managesFile(const FilePath &workingDirectory, const QString & unsigned int FossilClient::binaryVersion() const { static unsigned int cachedBinaryVersion = 0; - static QString cachedBinaryPath; + static FilePath cachedBinaryPath; - const QString currentBinaryPath = settings().binaryPath.stringValue(); + const FilePath currentBinaryPath = settings().binaryPath(); if (currentBinaryPath.isEmpty()) return 0; diff --git a/src/plugins/fossil/wizard/fossiljsextension.cpp b/src/plugins/fossil/wizard/fossiljsextension.cpp index 35d7a6fd36c..9ca6b6e0bf0 100644 --- a/src/plugins/fossil/wizard/fossiljsextension.cpp +++ b/src/plugins/fossil/wizard/fossiljsextension.cpp @@ -58,7 +58,7 @@ QString FossilJsExtension::defaultSslIdentityFile() const if (!isConfigured()) return QString(); - return settings().sslIdentityFile.stringValue(); + return settings().sslIdentityFile().toFSPathString(); } QString FossilJsExtension::defaultLocalRepoPath() const @@ -66,7 +66,7 @@ QString FossilJsExtension::defaultLocalRepoPath() const if (!isConfigured()) return QString(); - return settings().defaultRepoPath.stringValue(); + return settings().defaultRepoPath().toFSPathString(); } bool FossilJsExtension::defaultDisableAutosync() const diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index fd7d3f7ae96..fe6f95b86ce 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -60,7 +60,7 @@ BuildDirectoryAspect::BuildDirectoryAspect(AspectContainer *container, const Bui }); setOpenTerminalHandler([this, bc] { - Core::FileUtils::openTerminal(value(), bc->environment()); + Core::FileUtils::openTerminal(expandedValue(), bc->environment()); }); } diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 920985c66c9..bce374884f4 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -228,7 +228,7 @@ BuildConfiguration::~BuildConfiguration() FilePath BuildConfiguration::buildDirectory() const { FilePath path = FilePath::fromUserInput( - environment().expandVariables(d->m_buildDirectoryAspect.stringValue().trimmed())); + environment().expandVariables(d->m_buildDirectoryAspect.value().trimmed())); // FIXME: If the macro expander is expected to be able to do some // structual changes, the fromUserInput() above might already have // mis-parsed. Should this here be encapsulated in the FilePathAspect? diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.cpp b/src/plugins/vcsbase/vcsbaseclientsettings.cpp index 16d110ec25e..e9e6d86136f 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.cpp +++ b/src/plugins/vcsbase/vcsbaseclientsettings.cpp @@ -38,7 +38,8 @@ VcsBaseSettings::~VcsBaseSettings() = default; FilePaths VcsBaseSettings::searchPathList() const { - return Utils::transform(path.stringValue().split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts), + // FIXME: Filepathify + return Utils::transform(path.value().split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts), &FilePath::fromUserInput); } diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index bd0fab0d548..12d91b7b7a5 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -174,7 +174,7 @@ void VcsBaseSubmitEditor::setParameters(const VcsBaseSubmitEditorParameters &par const CommonVcsSettings &settings = commonSettings(); // Add additional context menu settings if (!settings.submitMessageCheckScript().isEmpty() - || !settings.nickNameMailMap.value().isEmpty()) { + || !settings.nickNameMailMap().isEmpty()) { auto sep = new QAction(this); sep->setSeparator(true); d->m_widget->addDescriptionEditContextMenuAction(sep); @@ -186,7 +186,7 @@ void VcsBaseSubmitEditor::setParameters(const VcsBaseSubmitEditorParameters &par d->m_widget->addDescriptionEditContextMenuAction(checkAction); } // Insert nick - if (!settings.nickNameMailMap.value().isEmpty()) { + if (!settings.nickNameMailMap().isEmpty()) { auto insertAction = new QAction(Tr::tr("Insert Name..."), this); connect(insertAction, &QAction::triggered, this, &VcsBaseSubmitEditor::slotInsertNickName); d->m_widget->addDescriptionEditContextMenuAction(insertAction); From be0e0490af446c4d56b32678de182d924f9a8d3a Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 21 Jul 2023 14:41:13 +0200 Subject: [PATCH 0448/1777] DebuggerRunTool: Remove unused methods Change-Id: I9f55e79bc202eedbf594100155fc18fedaf7b814 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/debuggerruncontrol.cpp | 10 ---------- src/plugins/debugger/debuggerruncontrol.h | 3 --- 2 files changed, 13 deletions(-) diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 3d97bb89d1e..0a04eb61bcc 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -305,11 +305,6 @@ void DebuggerRunTool::setUseTerminal(bool on) } } -void DebuggerRunTool::setRunAsRoot(bool on) -{ - m_runParameters.runAsRoot = on; -} - void DebuggerRunTool::setCommandsAfterConnect(const QString &commands) { m_runParameters.commandsAfterConnect = commands; @@ -694,11 +689,6 @@ bool DebuggerRunTool::isQmlDebugging() const return m_runParameters.isQmlDebugging; } -int DebuggerRunTool::portsUsedByDebugger() const -{ - return isCppDebugging() + isQmlDebugging(); -} - void DebuggerRunTool::setUsePortsGatherer(bool useCpp, bool useQml) { QTC_ASSERT(!d->portsGatherer, reportFailure(); return); diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index 2bd18508c6a..69856f4cc01 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -39,7 +39,6 @@ public: bool isCppDebugging() const; bool isQmlDebugging() const; - int portsUsedByDebugger() const; void setUsePortsGatherer(bool useCpp, bool useQml); DebugServerPortsGatherer *portsGatherer() const; @@ -83,12 +82,10 @@ public: void setUseCtrlCStub(bool on); void setBreakOnMain(bool on); void setUseTerminal(bool on); - void setRunAsRoot(bool on); void setCommandsAfterConnect(const QString &commands); void setCommandsForReset(const QString &commands); - void setServerStartScript(const Utils::FilePath &serverStartScript); void setDebugInfoLocation(const Utils::FilePath &debugInfoLocation); void setQmlServer(const QUrl &qmlServer); From 062cea960199ea320a88e76844c276f64152f23b Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 21 Jul 2023 15:27:01 +0200 Subject: [PATCH 0449/1777] DebuggerRunTool: Hide some methods in protected / private section Change-Id: I9ab5fb1b8661191080e270307a3be8723d7b6f7c Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/debuggerruncontrol.h | 49 ++++++++++++----------- src/plugins/qnx/qnxdebugsupport.cpp | 3 +- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index 69856f4cc01..c4fbb3110e8 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -32,19 +32,10 @@ public: void startRunControl(); - void showMessage(const QString &msg, int channel = LogDebug, int timeout = -1); - void start() override; void stop() override; - bool isCppDebugging() const; - bool isQmlDebugging() const; - - void setUsePortsGatherer(bool useCpp, bool useQml); - DebugServerPortsGatherer *portsGatherer() const; - void setSolibSearchPath(const Utils::FilePaths &list); - void addSolibSearchDir(const QString &str); static void setBreakOnMainNextTime(); @@ -53,12 +44,9 @@ public: void setInferiorEnvironment(const Utils::Environment &env); // Used by GammaRay plugin void setRunControlName(const QString &name); void setStartMessage(const QString &msg); - void addQmlServerInferiorCommandLineArgumentIfNeeded(); - void modifyDebuggerEnvironment(const Utils::EnvironmentItems &item); void setCrashParameter(const QString &event); void addExpectedSignal(const QString &signal); - void addSearchDirectory(const Utils::FilePath &dir); void setStartMode(DebuggerStartMode startMode); void setCloseMode(DebuggerCloseMode closeMode); @@ -68,18 +56,13 @@ public: void setSysRoot(const Utils::FilePath &sysRoot); void setSymbolFile(const Utils::FilePath &symbolFile); - void setLldbPlatform(const QString &platform); void setRemoteChannel(const QString &channel); void setRemoteChannel(const QString &host, int port); - void setRemoteChannel(const QUrl &url); QString remoteChannel() const; void setUseExtendedRemote(bool on); void setUseContinueInsteadOfRun(bool on); - void setUseTargetAsync(bool on); void setContinueAfterAttach(bool on); - void setSkipExecutableValidation(bool on); - void setUseCtrlCStub(bool on); void setBreakOnMain(bool on); void setUseTerminal(bool on); @@ -93,20 +76,40 @@ public: void setCoreFilePath(const Utils::FilePath &core, bool isSnapshot = false); - void setIosPlatform(const QString &platform); - void setDeviceSymbolsRoot(const QString &deviceSymbolsRoot); - void setTestCase(int testCase); void setOverrideStartScript(const Utils::FilePath &script); - void setAbi(const ProjectExplorer::Abi &abi); - Internal::TerminalRunner *terminalRunner() const; - DebuggerEngineType cppEngineType() const; Internal::DebuggerRunParameters &runParameters() { return m_runParameters; } +protected: + bool isCppDebugging() const; + bool isQmlDebugging() const; + + void setUsePortsGatherer(bool useCpp, bool useQml); + DebugServerPortsGatherer *portsGatherer() const; + + void addSolibSearchDir(const QString &str); + void addQmlServerInferiorCommandLineArgumentIfNeeded(); + void modifyDebuggerEnvironment(const Utils::EnvironmentItems &item); + void addSearchDirectory(const Utils::FilePath &dir); + + void setLldbPlatform(const QString &platform); + void setRemoteChannel(const QUrl &url); + void setUseTargetAsync(bool on); + void setSkipExecutableValidation(bool on); + void setUseCtrlCStub(bool on); + + void setIosPlatform(const QString &platform); + void setDeviceSymbolsRoot(const QString &deviceSymbolsRoot); + void setAbi(const ProjectExplorer::Abi &abi); + + DebuggerEngineType cppEngineType() const; + private: + void showMessage(const QString &msg, int channel = LogDebug, int timeout = -1); + bool fixupParameters(); void handleEngineStarted(Internal::DebuggerEngine *engine); void handleEngineFinished(Internal::DebuggerEngine *engine); diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index 5ad45f057aa..0d869d78673 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -195,8 +195,8 @@ public: : DebuggerRunTool(runControl) { setId("QnxAttachDebugSupport"); - setUsePortsGatherer(isCppDebugging(), isQmlDebugging()); + setUseCtrlCStub(true); if (isCppDebugging()) { auto pdebugRunner = new PDebugRunner(runControl, portsGatherer()); @@ -239,7 +239,6 @@ void showAttachToProcessDialog() debugger->setStartMode(AttachToRemoteServer); debugger->setCloseMode(DetachAtClose); debugger->setSymbolFile(localExecutable); - debugger->setUseCtrlCStub(true); debugger->setAttachPid(pid); // setRunControlName(Tr::tr("Remote: \"%1\" - Process %2").arg(remoteChannel).arg(m_process.pid)); debugger->setRunControlName(Tr::tr("Remote QNX process %1").arg(pid)); From 1a88508654a1db58ade0bd5bc56ffd896406dea7 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 17 Jul 2023 17:04:05 +0200 Subject: [PATCH 0450/1777] ProjectExplorer: Use latest settings style for compile output window Change-Id: I6b4c8bf3ed7b9589a4b7e7ee77cd0fc5011954c3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/projectexplorer/buildmanager.cpp | 2 +- .../projectexplorer/compileoutputwindow.cpp | 54 +++++++++++-------- .../projectexplorer/compileoutputwindow.h | 7 ++- 3 files changed, 36 insertions(+), 27 deletions(-) diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index d33e2fa3e4b..710f03fed13 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -844,7 +844,7 @@ bool BuildManager::buildQueueAppend(const QList<BuildItem> &items, const QString d->m_maxProgress += enabledCount; for (const BuildItem &item : items) incrementActiveBuildSteps(item.buildStep); - if (CompileOutputSettings::instance().popUp()) + if (compileOutputSettings().popUp()) d->m_outputWindow->popup(IOutputPane::NoModeSwitch); startBuildQueue(); return true; diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index bafc31fc14a..f14f80a0587 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -11,9 +11,12 @@ #include "showoutputtaskhandler.h" #include <coreplugin/outputwindow.h> +#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icore.h> #include <coreplugin/coreconstants.h> + #include <extensionsystem/pluginmanager.h> + #include <texteditor/texteditorsettings.h> #include <texteditor/fontsettings.h> #include <texteditor/behaviorsettings.h> @@ -37,11 +40,7 @@ #include <QToolButton> #include <QVBoxLayout> -namespace ProjectExplorer { - -class Task; - -namespace Internal { +namespace ProjectExplorer::Internal { const char SETTINGS_KEY[] = "ProjectExplorer/CompileOutput/Zoom"; const char C_COMPILE_OUTPUT[] = "ProjectExplorer.CompileOutput"; @@ -102,14 +101,15 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) : setupContext(C_COMPILE_OUTPUT, m_outputWindow); updateFromSettings(); - m_outputWindow->setWordWrapEnabled(m_settings.wrapOutput()); - m_outputWindow->setMaxCharCount(m_settings.maxCharCount()); + CompileOutputSettings &s = compileOutputSettings(); + m_outputWindow->setWordWrapEnabled(s.wrapOutput()); + m_outputWindow->setMaxCharCount(s.maxCharCount()); - connect(&m_settings.wrapOutput, &Utils::BaseAspect::changed, m_outputWindow, [this] { - m_outputWindow->setWordWrapEnabled(m_settings.wrapOutput()); + connect(&s.wrapOutput, &Utils::BaseAspect::changed, m_outputWindow, [this] { + m_outputWindow->setWordWrapEnabled(compileOutputSettings().wrapOutput()); }); - connect(&m_settings.maxCharCount, &Utils::BaseAspect::changed, m_outputWindow, [this] { - m_outputWindow->setMaxCharCount(m_settings.maxCharCount()); + connect(&s.maxCharCount, &Utils::BaseAspect::changed, m_outputWindow, [this] { + m_outputWindow->setMaxCharCount(compileOutputSettings().maxCharCount()); }); } @@ -231,20 +231,15 @@ void CompileOutputWindow::updateFilter() // CompileOutputSettings -static CompileOutputSettings *s_compileOutputSettings; - -CompileOutputSettings &CompileOutputSettings::instance() +CompileOutputSettings &compileOutputSettings() { - return *s_compileOutputSettings; + static CompileOutputSettings theSettings; + return theSettings; } CompileOutputSettings::CompileOutputSettings() { - s_compileOutputSettings = this; - - setId(OPTIONS_PAGE_ID); - setDisplayName(Tr::tr("Compile Output")); - setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); + setAutoApply(false); wrapOutput.setSettingsKey("ProjectExplorer/Settings/WrapBuildOutput"); wrapOutput.setDefaultValue(true); @@ -274,5 +269,20 @@ CompileOutputSettings::CompileOutputSettings() readSettings(); } -} // Internal -} // ProjectExplorer +// CompileOutputSettingsPage + +class CompileOutputSettingsPage final : public Core::IOptionsPage +{ +public: + CompileOutputSettingsPage() + { + setId(OPTIONS_PAGE_ID); + setDisplayName(Tr::tr("Compile Output")); + setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); + setSettingsProvider([] { return &compileOutputSettings(); }); + } +}; + +const CompileOutputSettingsPage settingsPage; + +} // ProjectExplorer::Internal diff --git a/src/plugins/projectexplorer/compileoutputwindow.h b/src/plugins/projectexplorer/compileoutputwindow.h index 89c7b749f2e..be3e237efa5 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.h +++ b/src/plugins/projectexplorer/compileoutputwindow.h @@ -26,18 +26,18 @@ namespace Internal { class ShowOutputTaskHandler; class CompileOutputTextEdit; -class CompileOutputSettings final : public Core::PagedSettings +class CompileOutputSettings final : public Utils::AspectContainer { public: CompileOutputSettings(); - static CompileOutputSettings &instance(); - Utils::BoolAspect popUp{this}; Utils::BoolAspect wrapOutput{this}; Utils::IntegerAspect maxCharCount{this}; }; +CompileOutputSettings &compileOutputSettings(); + class CompileOutputWindow final : public Core::IOutputPane { Q_OBJECT @@ -80,7 +80,6 @@ private: ShowOutputTaskHandler *m_handler; QToolButton *m_cancelBuildButton; QToolButton * const m_settingsButton; - CompileOutputSettings m_settings; }; } // namespace Internal From 53d06feecdc0d2cba67101be9a3672df48c6ac60 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 17:44:01 +0200 Subject: [PATCH 0451/1777] ProjectExplorer: Change ProjectConfiguration::toMap signature To match better with the rest, especially the base AspectContainer. Change-Id: Ide0966cab3219800aa6b7b9e6012731a3fbe7a6f Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/android/androidbuildapkstep.cpp | 5 ++--- src/plugins/android/androidbuildapkstep.h | 2 +- .../cmakebuildconfiguration.cpp | 5 ++--- .../cmakebuildconfiguration.h | 2 +- .../cmakeprojectmanager/cmakebuildstep.cpp | 6 ++---- .../cmakeprojectmanager/cmakebuildstep.h | 2 +- src/plugins/ios/iosbuildstep.cpp | 8 +++---- src/plugins/ios/iosdsymbuildstep.cpp | 7 +++---- .../mesonbuildconfiguration.cpp | 9 ++++---- .../mesonbuildconfiguration.h | 2 +- .../mesonprojectmanager/ninjabuildstep.cpp | 7 +++---- .../mesonprojectmanager/ninjabuildstep.h | 3 ++- .../nim/project/nimblebuildconfiguration.cpp | 5 ++--- .../nim/project/nimblebuildconfiguration.h | 3 +-- .../nim/project/nimcompilerbuildstep.cpp | 11 +++++----- .../nim/project/nimcompilerbuildstep.h | 2 +- .../projectexplorer/buildconfiguration.cpp | 12 +++++------ .../projectexplorer/buildconfiguration.h | 2 +- src/plugins/projectexplorer/buildstep.cpp | 5 ++--- src/plugins/projectexplorer/buildstep.h | 2 +- src/plugins/projectexplorer/buildsteplist.cpp | 7 +++++-- .../projectexplorer/deployconfiguration.cpp | 9 ++++---- .../projectexplorer/deployconfiguration.h | 2 +- .../projectexplorer/projectconfiguration.cpp | 4 +--- .../projectexplorer/projectconfiguration.h | 2 +- .../projectexplorer/runconfiguration.cpp | 21 ++++++++++--------- .../projectexplorer/runconfiguration.h | 4 ++-- src/plugins/projectexplorer/target.cpp | 21 +++++++++++++------ .../qbsprojectmanager/qbsbuildstep.cpp | 5 ++--- src/plugins/qbsprojectmanager/qbsbuildstep.h | 2 +- .../qmakebuildconfiguration.cpp | 5 ++--- .../qmakebuildconfiguration.h | 2 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 5 ++--- src/plugins/qmakeprojectmanager/qmakestep.h | 2 +- .../abstractremotelinuxdeploystep.cpp | 5 ++--- .../abstractremotelinuxdeploystep.h | 2 +- .../remotelinux/tarpackagecreationstep.cpp | 7 +++---- 37 files changed, 100 insertions(+), 105 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 9b6e8d4dddf..b4934ee183f 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -894,14 +894,13 @@ bool AndroidBuildApkStep::fromMap(const QVariantMap &map) return ProjectExplorer::BuildStep::fromMap(map); } -QVariantMap AndroidBuildApkStep::toMap() const +void AndroidBuildApkStep::toMap(QVariantMap &map) const { - QVariantMap map = ProjectExplorer::AbstractProcessStep::toMap(); + ProjectExplorer::AbstractProcessStep::toMap(map); map.insert(KeystoreLocationKey, m_keystorePath.toSettings()); map.insert(BuildTargetSdkKey, m_buildTargetSdk); map.insert(BuildToolsVersionKey, m_buildToolsVersion.toString()); map.insert(VerboseOutputKey, m_verbose); - return map; } Utils::FilePath AndroidBuildApkStep::keystorePath() const diff --git a/src/plugins/android/androidbuildapkstep.h b/src/plugins/android/androidbuildapkstep.h index fd68a4ae2cd..e0a2a951338 100644 --- a/src/plugins/android/androidbuildapkstep.h +++ b/src/plugins/android/androidbuildapkstep.h @@ -24,7 +24,7 @@ public: AndroidBuildApkStep(ProjectExplorer::BuildStepList *bc, Utils::Id id); bool fromMap(const QVariantMap &map) override; - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; // signing Utils::FilePath keystorePath() const; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index e98ed2a8cd5..4d87dc0a28c 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1562,10 +1562,9 @@ CMakeBuildConfiguration::~CMakeBuildConfiguration() delete m_buildSystem; } -QVariantMap CMakeBuildConfiguration::toMap() const +void CMakeBuildConfiguration::toMap(QVariantMap &map) const { - QVariantMap map(BuildConfiguration::toMap()); - return map; + BuildConfiguration::toMap(map); } bool CMakeBuildConfiguration::fromMap(const QVariantMap &map) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index a04de47196e..126d796dc5a 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -94,7 +94,7 @@ protected: bool fromMap(const QVariantMap &map) override; private: - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; BuildType buildType() const override; ProjectExplorer::NamedWidget *createConfigWidget() override; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 6fc6ecc3e32..455340197bf 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -272,15 +272,13 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Id id) : this, &CMakeBuildStep::updateBuildTargetsModel); } -QVariantMap CMakeBuildStep::toMap() const +void CMakeBuildStep::toMap(QVariantMap &map) const { - QVariantMap map(CMakeAbstractProcessStep::toMap()); + CMakeAbstractProcessStep::toMap(map); map.insert(BUILD_TARGETS_KEY, m_buildTargets); map.insert(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY), m_clearSystemEnvironment); map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), EnvironmentItem::toStringList(m_userEnvironmentChanges)); map.insert(QLatin1String(BUILD_PRESET_KEY), m_buildPreset); - - return map; } bool CMakeBuildStep::fromMap(const QVariantMap &map) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h index af239275d38..009f9f7e602 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h @@ -44,7 +44,7 @@ public: bool buildsBuildTarget(const QString &target) const; void setBuildsBuildTarget(const QString &target, bool on); - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; QString cleanTarget() const; QString allTarget() const ; diff --git a/src/plugins/ios/iosbuildstep.cpp b/src/plugins/ios/iosbuildstep.cpp index 7831d84e239..af50a79ffde 100644 --- a/src/plugins/ios/iosbuildstep.cpp +++ b/src/plugins/ios/iosbuildstep.cpp @@ -57,7 +57,7 @@ private: bool init() final; void setupOutputFormatter(Utils::OutputFormatter *formatter) final; bool fromMap(const QVariantMap &map) final; - QVariantMap toMap() const final; + void toMap(QVariantMap &map) const final; QStringList m_baseBuildArguments; QStringList m_extraArguments; @@ -166,17 +166,15 @@ void IosBuildStep::setupOutputFormatter(OutputFormatter *formatter) AbstractProcessStep::setupOutputFormatter(formatter); } -QVariantMap IosBuildStep::toMap() const +void IosBuildStep::toMap(QVariantMap &map) const { - QVariantMap map(AbstractProcessStep::toMap()); + AbstractProcessStep::toMap(map); map.insert(BUILD_ARGUMENTS_KEY, m_baseBuildArguments); map.insert(BUILD_USE_DEFAULT_ARGS_KEY, m_useDefaultArguments); // Not used anymore since 4.14. But make sure older versions of Creator can read this. map.insert(CLEAN_KEY, stepList()->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN); - - return map; } bool IosBuildStep::fromMap(const QVariantMap &map) diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index 2d0e2b841f0..2c840cb6b73 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -59,7 +59,7 @@ public: private: void setupOutputFormatter(OutputFormatter *formatter) override; - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; bool fromMap(const QVariantMap &map) override; QStringList defaultCleanCmdList() const; @@ -83,9 +83,9 @@ IosDsymBuildStep::IosDsymBuildStep(BuildStepList *parent, Id id) : setIgnoreReturnValue(m_clean); } -QVariantMap IosDsymBuildStep::toMap() const +void IosDsymBuildStep::toMap(QVariantMap &map) const { - QVariantMap map(AbstractProcessStep::toMap()); + AbstractProcessStep::toMap(map); map.insert(id().withSuffix(ARGUMENTS_PARTIAL_KEY).toString(), arguments()); @@ -93,7 +93,6 @@ QVariantMap IosDsymBuildStep::toMap() const isDefault()); map.insert(id().withSuffix(CLEAN_PARTIAL_KEY).toString(), m_clean); map.insert(id().withSuffix(COMMAND_PARTIAL_KEY).toString(), command().toSettings()); - return map; } bool IosDsymBuildStep::fromMap(const QVariantMap &map) diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp index b71d28b1072..e4c19e09572 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp @@ -137,12 +137,11 @@ void MesonBuildConfiguration::setParameters(const QString ¶ms) emit parametersChanged(); } -QVariantMap MesonBuildConfiguration::toMap() const +void MesonBuildConfiguration::toMap(QVariantMap &map) const { - auto data = ProjectExplorer::BuildConfiguration::toMap(); - data[Constants::BuildConfiguration::BUILD_TYPE_KEY] = mesonBuildTypeName(m_buildType); - data[Constants::BuildConfiguration::PARAMETERS_KEY] = m_parameters; - return data; + ProjectExplorer::BuildConfiguration::toMap(map); + map[Constants::BuildConfiguration::BUILD_TYPE_KEY] = mesonBuildTypeName(m_buildType); + map[Constants::BuildConfiguration::PARAMETERS_KEY] = m_parameters; } bool MesonBuildConfiguration::fromMap(const QVariantMap &map) diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h index d262c837810..c9433dd5b69 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h +++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h @@ -30,7 +30,7 @@ signals: void parametersChanged(); private: - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; bool fromMap(const QVariantMap &map) override; MesonBuildType m_buildType; ProjectExplorer::NamedWidget *createConfigWidget() final; diff --git a/src/plugins/mesonprojectmanager/ninjabuildstep.cpp b/src/plugins/mesonprojectmanager/ninjabuildstep.cpp index 0cb71186bdd..310d6b12da5 100644 --- a/src/plugins/mesonprojectmanager/ninjabuildstep.cpp +++ b/src/plugins/mesonprojectmanager/ninjabuildstep.cpp @@ -189,7 +189,7 @@ MesonBuildStepFactory::MesonBuildStepFactory() setDisplayName(Tr::tr("Meson Build")); } -void MesonProjectManager::Internal::NinjaBuildStep::setBuildTarget(const QString &targetName) +void NinjaBuildStep::setBuildTarget(const QString &targetName) { m_targetName = targetName; } @@ -199,12 +199,11 @@ void NinjaBuildStep::setCommandArgs(const QString &args) m_commandArgs = args.trimmed(); } -QVariantMap NinjaBuildStep::toMap() const +void NinjaBuildStep::toMap(QVariantMap &map) const { - QVariantMap map(AbstractProcessStep::toMap()); + AbstractProcessStep::toMap(map); map.insert(TARGETS_KEY, m_targetName); map.insert(TOOL_ARGUMENTS_KEY, m_commandArgs); - return map; } bool NinjaBuildStep::fromMap(const QVariantMap &map) diff --git a/src/plugins/mesonprojectmanager/ninjabuildstep.h b/src/plugins/mesonprojectmanager/ninjabuildstep.h index 1feecadb5f1..8038d36bb60 100644 --- a/src/plugins/mesonprojectmanager/ninjabuildstep.h +++ b/src/plugins/mesonprojectmanager/ninjabuildstep.h @@ -25,7 +25,8 @@ public: const QString &targetName() const { return m_targetName; } Q_SIGNAL void targetListChanged(); Q_SIGNAL void commandChanged(); - QVariantMap toMap() const override; + + void toMap(QVariantMap &map) const override; bool fromMap(const QVariantMap &map) override; private: diff --git a/src/plugins/nim/project/nimblebuildconfiguration.cpp b/src/plugins/nim/project/nimblebuildconfiguration.cpp index b0fc7cefb88..0f13a643aa7 100644 --- a/src/plugins/nim/project/nimblebuildconfiguration.cpp +++ b/src/plugins/nim/project/nimblebuildconfiguration.cpp @@ -43,11 +43,10 @@ bool NimbleBuildConfiguration::fromMap(const QVariantMap &map) return BuildConfiguration::fromMap(map); } -QVariantMap NimbleBuildConfiguration::toMap() const +void NimbleBuildConfiguration::toMap(QVariantMap &map) const { - auto map = BuildConfiguration::toMap(); + BuildConfiguration::toMap(map); map[Constants::C_NIMBLEBUILDCONFIGURATION_BUILDTYPE] = buildType(); - return map; } void NimbleBuildConfiguration::setBuildType(BuildConfiguration::BuildType buildType) diff --git a/src/plugins/nim/project/nimblebuildconfiguration.h b/src/plugins/nim/project/nimblebuildconfiguration.h index fa572bdc78d..1a575ac6f06 100644 --- a/src/plugins/nim/project/nimblebuildconfiguration.h +++ b/src/plugins/nim/project/nimblebuildconfiguration.h @@ -19,8 +19,7 @@ class NimbleBuildConfiguration : public ProjectExplorer::BuildConfiguration BuildType buildType() const override; bool fromMap(const QVariantMap &map) override; - - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; private: void setBuildType(BuildType buildType); diff --git a/src/plugins/nim/project/nimcompilerbuildstep.cpp b/src/plugins/nim/project/nimcompilerbuildstep.cpp index 76802a85df8..49b7760c951 100644 --- a/src/plugins/nim/project/nimcompilerbuildstep.cpp +++ b/src/plugins/nim/project/nimcompilerbuildstep.cpp @@ -130,13 +130,12 @@ bool NimCompilerBuildStep::fromMap(const QVariantMap &map) return true; } -QVariantMap NimCompilerBuildStep::toMap() const +void NimCompilerBuildStep::toMap(QVariantMap &map) const { - QVariantMap result = AbstractProcessStep::toMap(); - result[Constants::C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS] = m_userCompilerOptions.join('|'); - result[Constants::C_NIMCOMPILERBUILDSTEP_DEFAULTBUILDOPTIONS] = m_defaultOptions; - result[Constants::C_NIMCOMPILERBUILDSTEP_TARGETNIMFILE] = m_targetNimFile.toString(); - return result; + AbstractProcessStep::toMap(map); + map[Constants::C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS] = m_userCompilerOptions.join('|'); + map[Constants::C_NIMCOMPILERBUILDSTEP_DEFAULTBUILDOPTIONS] = m_defaultOptions; + map[Constants::C_NIMCOMPILERBUILDSTEP_TARGETNIMFILE] = m_targetNimFile.toString(); } void NimCompilerBuildStep::setBuildType(BuildConfiguration::BuildType buildType) diff --git a/src/plugins/nim/project/nimcompilerbuildstep.h b/src/plugins/nim/project/nimcompilerbuildstep.h index 90fa7bdb718..41985166b3e 100644 --- a/src/plugins/nim/project/nimcompilerbuildstep.h +++ b/src/plugins/nim/project/nimcompilerbuildstep.h @@ -27,7 +27,7 @@ private: QWidget *createConfigWidget() override; bool fromMap(const QVariantMap &map) override; - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; void updateTargetNimFile(); Utils::CommandLine commandLine(); diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index bce374884f4..b7500d46be5 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -372,9 +372,9 @@ void BuildConfiguration::appendInitialCleanStep(Utils::Id id) d->m_initialCleanSteps.append(id); } -QVariantMap BuildConfiguration::toMap() const +void BuildConfiguration::toMap(QVariantMap &map) const { - QVariantMap map = ProjectConfiguration::toMap(); + ProjectConfiguration::toMap(map); map.insert(QLatin1String(Constants::CLEAR_SYSTEM_ENVIRONMENT_KEY), d->m_clearSystemEnvironment); map.insert(QLatin1String(Constants::USER_ENVIRONMENT_CHANGES_KEY), @@ -386,8 +386,6 @@ QVariantMap BuildConfiguration::toMap() const map.insert(PARSE_STD_OUT_KEY, d->m_parseStdOut); map.insert(CUSTOM_PARSERS_KEY, transform(d->m_customParsers,&Utils::Id::toSetting)); - - return map; } bool BuildConfiguration::fromMap(const QVariantMap &map) @@ -795,9 +793,11 @@ BuildConfiguration *BuildConfigurationFactory::restore(Target *parent, const QVa } BuildConfiguration *BuildConfigurationFactory::clone(Target *parent, - const BuildConfiguration *source) + const BuildConfiguration *source) { - return restore(parent, source->toMap()); + QVariantMap map; + source->toMap(map); + return restore(parent, map); } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index 7d2a779bbda..64bcd2c8b38 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -69,7 +69,7 @@ public: void appendInitialCleanStep(Utils::Id id); bool fromMap(const QVariantMap &map) override; - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; bool isEnabled() const; QString disabledReason() const; diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 20747bf0cb2..8bea8c1f15f 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -192,11 +192,10 @@ bool BuildStep::fromMap(const QVariantMap &map) return ProjectConfiguration::fromMap(map); } -QVariantMap BuildStep::toMap() const +void BuildStep::toMap(QVariantMap &map) const { - QVariantMap map = ProjectConfiguration::toMap(); + ProjectConfiguration::toMap(map); map.insert(buildStepEnabledKey, m_enabled); - return map; } BuildConfiguration *BuildStep::buildConfiguration() const diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index ef483f60796..3a9d68bd4a0 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -54,7 +54,7 @@ public: void cancel(); bool fromMap(const QVariantMap &map) override; - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; bool enabled() const; void setEnabled(bool b); diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index 4c520b977d6..f42c224f8b0 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -57,8 +57,11 @@ QVariantMap BuildStepList::toMap() const // Save build steps map.insert(QString::fromLatin1(STEPS_COUNT_KEY), m_steps.count()); - for (int i = 0; i < m_steps.count(); ++i) - map.insert(QString::fromLatin1(STEPS_PREFIX) + QString::number(i), m_steps.at(i)->toMap()); + for (int i = 0; i < m_steps.count(); ++i) { + QVariantMap data; + m_steps.at(i)->toMap(data); + map.insert(QString::fromLatin1(STEPS_PREFIX) + QString::number(i), data); + } return map; } diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp index bb500c3294d..1fe0aa5166a 100644 --- a/src/plugins/projectexplorer/deployconfiguration.cpp +++ b/src/plugins/projectexplorer/deployconfiguration.cpp @@ -50,9 +50,9 @@ QWidget *DeployConfiguration::createConfigWidget() return m_configWidgetCreator(this); } -QVariantMap DeployConfiguration::toMap() const +void DeployConfiguration::toMap(QVariantMap &map) const { - QVariantMap map(ProjectConfiguration::toMap()); + ProjectConfiguration::toMap(map); map.insert(QLatin1String(BUILD_STEP_LIST_COUNT), 1); map.insert(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1Char('0'), m_stepList.toMap()); map.insert(USES_DEPLOYMENT_DATA, usesCustomDeploymentData()); @@ -62,7 +62,6 @@ QVariantMap DeployConfiguration::toMap() const deployData.insert(f.localFilePath().toString(), f.remoteDirectory()); } map.insert(DEPLOYMENT_DATA, deployData); - return map; } bool DeployConfiguration::fromMap(const QVariantMap &map) @@ -185,7 +184,9 @@ DeployConfiguration *DeployConfigurationFactory::create(Target *parent) DeployConfiguration *DeployConfigurationFactory::clone(Target *parent, const DeployConfiguration *source) { - return restore(parent, source->toMap()); + QVariantMap map; + source->toMap(map); + return restore(parent, map); } DeployConfiguration *DeployConfigurationFactory::restore(Target *parent, const QVariantMap &map) diff --git a/src/plugins/projectexplorer/deployconfiguration.h b/src/plugins/projectexplorer/deployconfiguration.h index e5a0f6d164a..e6b9c4c3cca 100644 --- a/src/plugins/projectexplorer/deployconfiguration.h +++ b/src/plugins/projectexplorer/deployconfiguration.h @@ -32,7 +32,7 @@ public: QWidget *createConfigWidget(); bool fromMap(const QVariantMap &map) override; - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; bool isActive() const; diff --git a/src/plugins/projectexplorer/projectconfiguration.cpp b/src/plugins/projectexplorer/projectconfiguration.cpp index e0a4f4b66f9..96176786b0f 100644 --- a/src/plugins/projectexplorer/projectconfiguration.cpp +++ b/src/plugins/projectexplorer/projectconfiguration.cpp @@ -74,14 +74,12 @@ QString ProjectConfiguration::toolTip() const return m_toolTip; } -QVariantMap ProjectConfiguration::toMap() const +void ProjectConfiguration::toMap(QVariantMap &map) const { QTC_CHECK(m_id.isValid()); - QVariantMap map; map.insert(QLatin1String(CONFIGURATION_ID_KEY), m_id.toSetting()); m_displayName.toMap(map, DISPLAY_NAME_KEY); AspectContainer::toMap(map); - return map; } Target *ProjectConfiguration::target() const diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h index b945631ceee..7a96ebbd05c 100644 --- a/src/plugins/projectexplorer/projectconfiguration.h +++ b/src/plugins/projectexplorer/projectconfiguration.h @@ -47,7 +47,7 @@ public: virtual bool fromMap(const QVariantMap &map); // Note: Make sure subclasses call the superclasses' toMap() function! - virtual QVariantMap toMap() const; + virtual void toMap(QVariantMap &map) const; Target *target() const; Project *project() const; diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index afe8dccb701..66e6d7272c9 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -246,7 +246,8 @@ bool RunConfiguration::isCustomized() const { if (m_customized) return true; - QVariantMap state = toMapSimple(); + QVariantMap state; + toMapSimple(state); // TODO: Why do we save this at all? It's a computed value. state.remove("RunConfiguration.WorkingDirectory.default"); @@ -265,7 +266,8 @@ bool RunConfiguration::hasCreator() const void RunConfiguration::setPristineState() { if (!m_customized) { - m_pristineState = toMapSimple(); + m_pristineState.clear(); + toMapSimple(m_pristineState); m_pristineState.remove("RunConfiguration.WorkingDirectory.default"); } } @@ -306,16 +308,15 @@ Task RunConfiguration::createConfigurationIssue(const QString &description) cons return BuildSystemTask(Task::Error, description); } -QVariantMap RunConfiguration::toMap() const +void RunConfiguration::toMap(QVariantMap &map) const { - QVariantMap map = toMapSimple(); + toMapSimple(map); map.insert(CUSTOMIZED_KEY, isCustomized()); - return map; } -QVariantMap RunConfiguration::toMapSimple() const +void RunConfiguration::toMapSimple(QVariantMap &map) const { - QVariantMap map = ProjectConfiguration::toMap(); + ProjectConfiguration::toMap(map); map.insert(BUILD_KEY, m_buildKey); // FIXME: Remove this id mangling, e.g. by using a separate entry for the build key. @@ -323,8 +324,6 @@ QVariantMap RunConfiguration::toMapSimple() const const Utils::Id mangled = id().withSuffix(m_buildKey); map.insert(settingsIdKey(), mangled.toSetting()); } - - return map; } void RunConfiguration::setCommandLineGetter(const CommandLineGetter &cmdGetter) @@ -649,7 +648,9 @@ RunConfiguration *RunConfigurationFactory::restore(Target *parent, const QVarian RunConfiguration *RunConfigurationFactory::clone(Target *parent, RunConfiguration *source) { - return restore(parent, source->toMap()); + QVariantMap map; + source->toMap(map); + return restore(parent, map); } const QList<RunConfigurationCreationInfo> RunConfigurationFactory::creatorsForTarget(Target *parent) diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 9d9a55120bb..5f1820c0912 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -172,8 +172,8 @@ protected: private: // Any additional data should be handled by aspects. bool fromMap(const QVariantMap &map) final; - QVariantMap toMap() const final; - QVariantMap toMapSimple() const; + void toMap(QVariantMap &map) const final; + void toMapSimple(QVariantMap &map) const; static void addAspectFactory(const AspectFactory &aspectFactory); diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index d2f6b3535e4..ae6d6d78ce2 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -602,20 +602,29 @@ QVariantMap Target::toMap() const const QList<BuildConfiguration *> bcs = buildConfigurations(); map.insert(QLatin1String(ACTIVE_BC_KEY), bcs.indexOf(d->m_activeBuildConfiguration)); map.insert(QLatin1String(BC_COUNT_KEY), bcs.size()); - for (int i = 0; i < bcs.size(); ++i) - map.insert(QString::fromLatin1(BC_KEY_PREFIX) + QString::number(i), bcs.at(i)->toMap()); + for (int i = 0; i < bcs.size(); ++i) { + QVariantMap data; + bcs.at(i)->toMap(data); + map.insert(QString::fromLatin1(BC_KEY_PREFIX) + QString::number(i), data); + } const QList<DeployConfiguration *> dcs = deployConfigurations(); map.insert(QLatin1String(ACTIVE_DC_KEY), dcs.indexOf(d->m_activeDeployConfiguration)); map.insert(QLatin1String(DC_COUNT_KEY), dcs.size()); - for (int i = 0; i < dcs.size(); ++i) - map.insert(QString::fromLatin1(DC_KEY_PREFIX) + QString::number(i), dcs.at(i)->toMap()); + for (int i = 0; i < dcs.size(); ++i) { + QVariantMap data; + dcs.at(i)->toMap(data); + map.insert(QString::fromLatin1(DC_KEY_PREFIX) + QString::number(i), data); + } const QList<RunConfiguration *> rcs = runConfigurations(); map.insert(QLatin1String(ACTIVE_RC_KEY), rcs.indexOf(d->m_activeRunConfiguration)); map.insert(QLatin1String(RC_COUNT_KEY), rcs.size()); - for (int i = 0; i < rcs.size(); ++i) - map.insert(QString::fromLatin1(RC_KEY_PREFIX) + QString::number(i), rcs.at(i)->toMap()); + for (int i = 0; i < rcs.size(); ++i) { + QVariantMap data; + rcs.at(i)->toMap(data); + map.insert(QString::fromLatin1(RC_KEY_PREFIX) + QString::number(i), data); + } if (!d->m_pluginSettings.isEmpty()) map.insert(QLatin1String(PLUGIN_SETTINGS_KEY), d->m_pluginSettings); diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 7a8cf613866..50ecdf5d7ea 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -381,11 +381,10 @@ bool QbsBuildStep::fromMap(const QVariantMap &map) return true; } -QVariantMap QbsBuildStep::toMap() const +void QbsBuildStep::toMap(QVariantMap &map) const { - QVariantMap map = ProjectExplorer::BuildStep::toMap(); + ProjectExplorer::BuildStep::toMap(map); map.insert(QBS_CONFIG, m_qbsConfiguration); - return map; } void QbsBuildStep::buildingDone(const ErrorInfo &error) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index 7938f5137f6..c1dfd1b2edf 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -86,7 +86,7 @@ private: void doCancel() override; QWidget *createConfigWidget() override; bool fromMap(const QVariantMap &map) override; - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; void buildingDone(const ErrorInfo &error); void reparsingDone(bool success); diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index eaff42d8f36..7e0d8918fe7 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -187,11 +187,10 @@ QmakeBuildConfiguration::~QmakeBuildConfiguration() delete m_buildSystem; } -QVariantMap QmakeBuildConfiguration::toMap() const +void QmakeBuildConfiguration::toMap(QVariantMap &map) const { - QVariantMap map(BuildConfiguration::toMap()); + BuildConfiguration::toMap(map); map.insert(QLatin1String(BUILD_CONFIGURATION_KEY), int(m_qmakeBuildConfiguration)); - return map; } bool QmakeBuildConfiguration::fromMap(const QVariantMap &map) diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h index f5a38c99fce..25f0c0db378 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h @@ -67,7 +67,7 @@ public: QString *arguments, const Utils::FilePath &directory, const QtSupport::QtVersion *version, QStringList *outArgs = nullptr); - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; BuildType buildType() const override; diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 68b47a92494..3487c04438e 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -403,12 +403,11 @@ QString QMakeStep::mkspec() const return QmakeKitAspect::effectiveMkspec(target()->kit()); } -QVariantMap QMakeStep::toMap() const +void QMakeStep::toMap(QVariantMap &map) const { - QVariantMap map(AbstractProcessStep::toMap()); + AbstractProcessStep::toMap(map); map.insert(QMAKE_FORCED_KEY, m_forced); map.insert(QMAKE_SELECTED_ABIS_KEY, m_selectedAbis); - return map; } bool QMakeStep::fromMap(const QVariantMap &map) diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index b2cf126bcbd..b497000a3e6 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -124,7 +124,7 @@ public: QString makeArguments(const QString &makefile) const; QString effectiveQMakeCall() const; - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; Utils::SelectionAspect buildType{this}; ProjectExplorer::ArgumentsAspect userArguments{this}; diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index 16745f77f08..8280c969f20 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -90,11 +90,10 @@ bool AbstractRemoteLinuxDeployStep::fromMap(const QVariantMap &map) return true; } -QVariantMap AbstractRemoteLinuxDeployStep::toMap() const +void AbstractRemoteLinuxDeployStep::toMap(QVariantMap &map) const { - QVariantMap map = BuildStep::toMap(); + BuildStep::toMap(map); map.insert(d->deployTimes.exportDeployTimes()); - return map; } bool AbstractRemoteLinuxDeployStep::init() diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h index 0bfc44edfab..0fe42a26d9f 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h @@ -27,7 +27,7 @@ protected: void handleStdErrData(const QString &data); bool fromMap(const QVariantMap &map) final; - QVariantMap toMap() const final; + void toMap(QVariantMap &map) const final; bool init() final; void setInternalInitializer(const std::function<Utils::expected_str<void>()> &init); diff --git a/src/plugins/remotelinux/tarpackagecreationstep.cpp b/src/plugins/remotelinux/tarpackagecreationstep.cpp index 4654d3f7302..da9f43e29c6 100644 --- a/src/plugins/remotelinux/tarpackagecreationstep.cpp +++ b/src/plugins/remotelinux/tarpackagecreationstep.cpp @@ -63,7 +63,7 @@ private: bool init() final; GroupItem runRecipe() final; bool fromMap(const QVariantMap &map) final; - QVariantMap toMap() const final; + void toMap(QVariantMap &map) const final; QVariant data(Id id) const final; void raiseError(const QString &errorMessage); @@ -174,11 +174,10 @@ bool TarPackageCreationStep::fromMap(const QVariantMap &map) return true; } -QVariantMap TarPackageCreationStep::toMap() const +void TarPackageCreationStep::toMap(QVariantMap &map) const { - QVariantMap map = BuildStep::toMap(); + BuildStep::toMap(map); map.insert(m_deployTimes.exportDeployTimes()); - return map; } QVariant TarPackageCreationStep::data(Id id) const From de4c1adbfa87ec2e0fd96b1cc78c2918d57d73ee Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 15 Jul 2023 10:50:15 +0200 Subject: [PATCH 0452/1777] QbsBuildStep: Some cleanup Change-Id: Ic3e7fe9a2aaabebd44acd1a61941318a0698d3e1 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 50ecdf5d7ea..0a222059d26 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -139,7 +139,7 @@ private: QbsBuildStep *qbsStep() const; - bool validateProperties(Utils::FancyLineEdit *edit, QString *errorMessage); + bool validateProperties(FancyLineEdit *edit, QString *errorMessage); class Property { @@ -173,7 +173,7 @@ private: // QbsBuildStep: // -------------------------------------------------------------------- -QbsBuildStep::QbsBuildStep(BuildStepList *bsl, Utils::Id id) : +QbsBuildStep::QbsBuildStep(BuildStepList *bsl, Id id) : BuildStep(bsl, id) { setDisplayName(QbsProjectManager::Tr::tr("Qbs Build")); @@ -343,7 +343,7 @@ void QbsBuildStep::setQbsConfiguration(const QVariantMap &config) return; m_qbsConfiguration = tmp; buildVariantHolder.setValue(buildVariantHolder.indexForItemValue(buildVariant)); - if (ProjectExplorer::BuildConfiguration *bc = buildConfiguration()) + if (BuildConfiguration *bc = buildConfiguration()) emit bc->buildTypeChanged(); emit qbsConfigurationChanged(); } @@ -353,12 +353,12 @@ bool QbsBuildStep::hasCustomInstallRoot() const return m_qbsConfiguration.contains(Constants::QBS_INSTALL_ROOT_KEY); } -Utils::FilePath QbsBuildStep::installRoot(VariableHandling variableHandling) const +FilePath QbsBuildStep::installRoot(VariableHandling variableHandling) const { const QString root = qbsConfiguration(variableHandling).value(Constants::QBS_INSTALL_ROOT_KEY).toString(); if (!root.isNull()) - return Utils::FilePath::fromUserInput(root); + return FilePath::fromUserInput(root); QString defaultInstallDir = QbsSettings::defaultInstallDirTemplate(); if (variableHandling == VariableHandling::ExpandVariables) defaultInstallDir = macroExpander()->expand(defaultInstallDir); @@ -374,7 +374,7 @@ int QbsBuildStep::maxJobs() const bool QbsBuildStep::fromMap(const QVariantMap &map) { - if (!ProjectExplorer::BuildStep::fromMap(map)) + if (!BuildStep::fromMap(map)) return false; setQbsConfiguration(map.value(QBS_CONFIG).toMap()); @@ -488,7 +488,7 @@ void QbsBuildStep::setBuildVariant(const QString &variant) return; m_qbsConfiguration.insert(Constants::QBS_CONFIG_VARIANT_KEY, variant); emit qbsConfigurationChanged(); - if (ProjectExplorer::BuildConfiguration *bc = buildConfiguration()) + if (BuildConfiguration *bc = buildConfiguration()) emit bc->buildTypeChanged(); } @@ -664,7 +664,7 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) connect(defaultInstallDirCheckBox, &QCheckBox::toggled, this, &QbsBuildStepConfigWidget::changeUseDefaultInstallDir); - connect(installDirChooser, &Utils::PathChooser::rawPathChanged, this, + connect(installDirChooser, &PathChooser::rawPathChanged, this, &QbsBuildStepConfigWidget::changeInstallDir); updateState(); @@ -798,7 +798,7 @@ QbsBuildStep *QbsBuildStepConfigWidget::qbsStep() const return m_qbsStep; } -bool QbsBuildStepConfigWidget::validateProperties(Utils::FancyLineEdit *edit, QString *errorMessage) +bool QbsBuildStepConfigWidget::validateProperties(FancyLineEdit *edit, QString *errorMessage) { ProcessArgs::SplitError err; const QStringList argList = ProcessArgs::splitArgs(edit->text(), HostOsInfo::hostOs(), false, &err); From 93de403391b59acf90fbe7319a059382dfe458a6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira <thiago.macieira@intel.com> Date: Fri, 21 Jul 2023 09:35:51 -0700 Subject: [PATCH 0453/1777] Fix build: contextless QObject::connect are not permitted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Qt6UiPlugin cmake file defines QT_NO_CONTEXTLESS_CONNECT as part of its interface (I don't know why and don't care why), so remove the contextless connections by adding context. formeditor.cpp:363:21: error: no matching function for call to ‘Designer::Internal::FormEditorData::connect(Core::EditorManager*, void (Core::EditorManager::*)(QList<Core::IEditor*>), Designer::Internal::FormEditorData::fullInit()::<lambda(QList<Core::IEditor*>)>)’ formeditor.cpp:490:21: error: no matching function for call to ‘Designer::Internal::FormEditorData::connect(QAction*&, void (QAction::*)(bool), Designer::Internal::FormEditorData::setupActions()::<lambda()>)’ Change-Id: Ib84fc618ac204205bf7afffd1773ef41ee3e7fdd Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/designer/formeditor.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/designer/formeditor.cpp b/src/plugins/designer/formeditor.cpp index ab2dd3ddd1e..86f5f13c8df 100644 --- a/src/plugins/designer/formeditor.cpp +++ b/src/plugins/designer/formeditor.cpp @@ -230,7 +230,7 @@ FormEditorData::FormEditorData() : m_settingsPages.append(settingsPage); } - QObject::connect(EditorManager::instance(), &EditorManager::currentEditorChanged, [this](IEditor *editor) { + QObject::connect(EditorManager::instance(), &EditorManager::currentEditorChanged, this, [this](IEditor *editor) { if (Designer::Constants::Internal::debug) qDebug() << Q_FUNC_INFO << editor << " of " << m_fwm->formWindowCount(); @@ -360,7 +360,7 @@ void FormEditorData::fullInit() delete initTime; } - QObject::connect(EditorManager::instance(), &EditorManager::editorsClosed, + QObject::connect(EditorManager::instance(), &EditorManager::editorsClosed, this, [this] (const QList<IEditor *> editors) { for (IEditor *editor : editors) m_editorWidget->removeFormWindowEditor(editor); @@ -487,7 +487,7 @@ void FormEditorData::setupActions() m_actionPrint = new QAction(this); bindShortcut(ActionManager::registerAction(m_actionPrint, Core::Constants::PRINT, m_contexts), m_actionPrint); - QObject::connect(m_actionPrint, &QAction::triggered, [this]() { print(); }); + QObject::connect(m_actionPrint, &QAction::triggered, this, [this] { print(); }); //'delete' action. Do not set a shortcut as Designer handles // the 'Delete' key by event filter. Setting a shortcut triggers @@ -500,7 +500,7 @@ void FormEditorData::setupActions() m_actionGroupEditMode = new QActionGroup(this); m_actionGroupEditMode->setExclusive(true); - QObject::connect(m_actionGroupEditMode, &QActionGroup::triggered, + QObject::connect(m_actionGroupEditMode, &QActionGroup::triggered, this, [this](QAction *a) { activateEditMode(a->data().toInt()); }); medit->addSeparator(m_contexts, Core::Constants::G_EDIT_OTHER); @@ -605,7 +605,7 @@ void FormEditorData::setupActions() m_actionAboutPlugins->setEnabled(false); // FWM - QObject::connect(m_fwm, &QDesignerFormWindowManagerInterface::activeFormWindowChanged, + QObject::connect(m_fwm, &QDesignerFormWindowManagerInterface::activeFormWindowChanged, this, [this] (QDesignerFormWindowInterface *afw) { m_fwm->closeAllPreviews(); setPreviewMenuEnabled(afw != nullptr); @@ -739,7 +739,7 @@ IEditor *FormEditorData::createEditor() QDesignerFormWindowInterface *form = m_fwm->createFormWindow(nullptr); QTC_ASSERT(form, return nullptr); form->setPalette(Theme::initialPalette()); - QObject::connect(form, &QDesignerFormWindowInterface::toolChanged, [this] (int i) { toolChanged(i); }); + QObject::connect(form, &QDesignerFormWindowInterface::toolChanged, this, [this](int i) { toolChanged(i); }); auto widgetHost = new SharedTools::WidgetHost( /* parent */ nullptr, form); FormWindowEditor *formWindowEditor = m_xmlEditorFactory->create(form); From a263d3de89f54382a1ef9f30d678e7c15a052f85 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 24 Jul 2023 07:28:01 +0200 Subject: [PATCH 0454/1777] Tests: Fix cmake build Change-Id: I1e42c0361aa92b54e52ba2c29f26f3f3f600e898 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- tests/unit/tests/matchers/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/tests/matchers/CMakeLists.txt b/tests/unit/tests/matchers/CMakeLists.txt index bea752e670c..32e5ea0b178 100644 --- a/tests/unit/tests/matchers/CMakeLists.txt +++ b/tests/unit/tests/matchers/CMakeLists.txt @@ -2,6 +2,7 @@ add_qtc_library(TestMatchers OBJECT EXCLUDE_FROM_INSTALL PROPERTIES SKIP_AUTOGEN ON PUBLIC_INCLUDES ${CMAKE_CURRENT_LIST_DIR} + CONDITION QmlDesigner DEPENDS Googletest Utils QmlDesigner SOURCES From 1c4f9733659521ae7bdf24ef6e48a956ef2ab373 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 18:23:50 +0200 Subject: [PATCH 0455/1777] ProjectExplorer: Replace the fromMap error return value ... by some out-of-band mechanism, keeping previous functionality. The driving reason is to get the same fromMap signature as in the AspectContainer base, however, the whole mechanism seems rather useless: There are only a few places that actually ever could report errors, in those places "moving on" looks ok, too, and these few places are not conceptually different than a lot others. Removal of this (new) mechanism is left for later. Change-Id: Ibe7a0456bc3b84a84e942231f14446e783372d76 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/android/androidbuildapkstep.cpp | 4 ++-- src/plugins/android/androidbuildapkstep.h | 2 +- .../cmakebuildconfiguration.cpp | 10 -------- .../cmakebuildconfiguration.h | 4 ---- .../cmakeprojectmanager/cmakebuildstep.cpp | 4 ++-- .../cmakeprojectmanager/cmakebuildstep.h | 2 +- src/plugins/ios/iosbuildconfiguration.cpp | 19 ++++----------- src/plugins/ios/iosbuildstep.cpp | 6 ++--- src/plugins/ios/iosdsymbuildstep.cpp | 6 ++--- .../mesonbuildconfiguration.cpp | 5 ++-- .../mesonbuildconfiguration.h | 3 ++- .../mesonprojectmanager/ninjabuildstep.cpp | 2 +- .../mesonprojectmanager/ninjabuildstep.h | 2 +- .../nim/project/nimblebuildconfiguration.cpp | 4 ++-- .../nim/project/nimblebuildconfiguration.h | 2 +- .../nim/project/nimcompilerbuildstep.cpp | 3 +-- .../nim/project/nimcompilerbuildstep.h | 2 +- .../projectexplorer/buildconfiguration.cpp | 8 +++---- .../projectexplorer/buildconfiguration.h | 2 +- src/plugins/projectexplorer/buildstep.cpp | 7 +++--- src/plugins/projectexplorer/buildstep.h | 2 +- .../projectexplorer/deployconfiguration.cpp | 23 +++++++++++-------- .../projectexplorer/deployconfiguration.h | 2 +- .../projectexplorer/projectconfiguration.cpp | 5 ++-- .../projectexplorer/projectconfiguration.h | 7 ++++-- .../projectexplorer/runconfiguration.cpp | 12 +++++----- .../projectexplorer/runconfiguration.h | 2 +- .../qbsbuildconfiguration.cpp | 9 ++++---- .../qbsprojectmanager/qbsbuildconfiguration.h | 2 +- .../qbsprojectmanager/qbsbuildstep.cpp | 9 ++++---- src/plugins/qbsprojectmanager/qbsbuildstep.h | 2 +- .../qmakebuildconfiguration.cpp | 8 +++---- .../qmakebuildconfiguration.h | 2 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 4 ++-- src/plugins/qmakeprojectmanager/qmakestep.h | 2 +- .../abstractremotelinuxdeploystep.cpp | 8 +++---- .../abstractremotelinuxdeploystep.h | 2 +- src/plugins/remotelinux/makeinstallstep.cpp | 10 ++++---- .../remotelinux/tarpackagecreationstep.cpp | 10 ++++---- 39 files changed, 100 insertions(+), 118 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index b4934ee183f..7fc98f6c450 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -880,7 +880,7 @@ void AndroidBuildApkStep::updateBuildToolsVersionInJsonFile() } } -bool AndroidBuildApkStep::fromMap(const QVariantMap &map) +void AndroidBuildApkStep::fromMap(const QVariantMap &map) { m_keystorePath = FilePath::fromSettings(map.value(KeystoreLocationKey)); m_signPackage = false; // don't restore this @@ -891,7 +891,7 @@ bool AndroidBuildApkStep::fromMap(const QVariantMap &map) sdkManager()->latestAndroidSdkPlatform()); } m_verbose = map.value(VerboseOutputKey).toBool(); - return ProjectExplorer::BuildStep::fromMap(map); + ProjectExplorer::BuildStep::fromMap(map); } void AndroidBuildApkStep::toMap(QVariantMap &map) const diff --git a/src/plugins/android/androidbuildapkstep.h b/src/plugins/android/androidbuildapkstep.h index e0a2a951338..2e41b0ddbb8 100644 --- a/src/plugins/android/androidbuildapkstep.h +++ b/src/plugins/android/androidbuildapkstep.h @@ -23,7 +23,7 @@ class AndroidBuildApkStep : public ProjectExplorer::AbstractProcessStep public: AndroidBuildApkStep(ProjectExplorer::BuildStepList *bc, Utils::Id id); - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; // signing diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 4d87dc0a28c..0c8bd830cff 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1562,16 +1562,6 @@ CMakeBuildConfiguration::~CMakeBuildConfiguration() delete m_buildSystem; } -void CMakeBuildConfiguration::toMap(QVariantMap &map) const -{ - BuildConfiguration::toMap(map); -} - -bool CMakeBuildConfiguration::fromMap(const QVariantMap &map) -{ - return BuildConfiguration::fromMap(map); -} - FilePath CMakeBuildConfiguration::shadowBuildDirectory(const FilePath &projectFilePath, const Kit *k, const QString &bcName, diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index 126d796dc5a..4fe1fb6c6bc 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -90,11 +90,7 @@ signals: void signingFlagsChanged(); void configureEnvironmentChanged(); -protected: - bool fromMap(const QVariantMap &map) override; - private: - void toMap(QVariantMap &map) const override; BuildType buildType() const override; ProjectExplorer::NamedWidget *createConfigWidget() override; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 455340197bf..c9fd39d71d1 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -281,7 +281,7 @@ void CMakeBuildStep::toMap(QVariantMap &map) const map.insert(QLatin1String(BUILD_PRESET_KEY), m_buildPreset); } -bool CMakeBuildStep::fromMap(const QVariantMap &map) +void CMakeBuildStep::fromMap(const QVariantMap &map) { setBuildTargets(map.value(BUILD_TARGETS_KEY).toStringList()); @@ -294,7 +294,7 @@ bool CMakeBuildStep::fromMap(const QVariantMap &map) m_buildPreset = map.value(QLatin1String(BUILD_PRESET_KEY)).toString(); - return BuildStep::fromMap(map); + BuildStep::fromMap(map); } bool CMakeBuildStep::init() diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h index 009f9f7e602..f808b342de1 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h @@ -83,7 +83,7 @@ signals: private: Utils::CommandLine cmakeCommand() const; - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; diff --git a/src/plugins/ios/iosbuildconfiguration.cpp b/src/plugins/ios/iosbuildconfiguration.cpp index d9b1af12f0e..93838793d93 100644 --- a/src/plugins/ios/iosbuildconfiguration.cpp +++ b/src/plugins/ios/iosbuildconfiguration.cpp @@ -376,7 +376,7 @@ public: private: QList<NamedWidget *> createSubConfigWidgets() override; - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; void updateQmakeCommand(); @@ -414,12 +414,11 @@ QList<NamedWidget *> IosQmakeBuildConfiguration::createSubConfigWidgets() return subConfigWidgets; } -bool IosQmakeBuildConfiguration::fromMap(const QVariantMap &map) +void IosQmakeBuildConfiguration::fromMap(const QVariantMap &map) { - if (!QmakeBuildConfiguration::fromMap(map)) - return false; - updateQmakeCommand(); - return true; + QmakeBuildConfiguration::fromMap(map); + if (!hasError()) + updateQmakeCommand(); } static QString teamIdForProvisioningProfile(const QString &id) @@ -489,7 +488,6 @@ public: private: QList<NamedWidget *> createSubConfigWidgets() override; - bool fromMap(const QVariantMap &map) override; CMakeProjectManager::CMakeConfig signingFlags() const final; @@ -527,13 +525,6 @@ QList<NamedWidget *> IosCMakeBuildConfiguration::createSubConfigWidgets() return subConfigWidgets; } -bool IosCMakeBuildConfiguration::fromMap(const QVariantMap &map) -{ - if (!CMakeBuildConfiguration::fromMap(map)) - return false; - return true; -} - CMakeConfig IosCMakeBuildConfiguration::signingFlags() const { if (DeviceTypeKitAspect::deviceTypeId(kit()) != Constants::IOS_DEVICE_TYPE) diff --git a/src/plugins/ios/iosbuildstep.cpp b/src/plugins/ios/iosbuildstep.cpp index af50a79ffde..bbc8d878101 100644 --- a/src/plugins/ios/iosbuildstep.cpp +++ b/src/plugins/ios/iosbuildstep.cpp @@ -56,7 +56,7 @@ private: bool init() final; void setupOutputFormatter(Utils::OutputFormatter *formatter) final; - bool fromMap(const QVariantMap &map) final; + void fromMap(const QVariantMap &map) final; void toMap(QVariantMap &map) const final; QStringList m_baseBuildArguments; @@ -177,13 +177,13 @@ void IosBuildStep::toMap(QVariantMap &map) const map.insert(CLEAN_KEY, stepList()->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN); } -bool IosBuildStep::fromMap(const QVariantMap &map) +void IosBuildStep::fromMap(const QVariantMap &map) { QVariant bArgs = map.value(BUILD_ARGUMENTS_KEY); m_baseBuildArguments = bArgs.toStringList(); m_useDefaultArguments = map.value(BUILD_USE_DEFAULT_ARGS_KEY).toBool(); - return BuildStep::fromMap(map); + BuildStep::fromMap(map); } QStringList IosBuildStep::allArguments() const diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index 2c840cb6b73..2808cca8a2d 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -60,7 +60,7 @@ public: private: void setupOutputFormatter(OutputFormatter *formatter) override; void toMap(QVariantMap &map) const override; - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; QStringList defaultCleanCmdList() const; QStringList defaultCmdList() const; @@ -95,7 +95,7 @@ void IosDsymBuildStep::toMap(QVariantMap &map) const map.insert(id().withSuffix(COMMAND_PARTIAL_KEY).toString(), command().toSettings()); } -bool IosDsymBuildStep::fromMap(const QVariantMap &map) +void IosDsymBuildStep::fromMap(const QVariantMap &map) { QVariant bArgs = map.value(id().withSuffix(ARGUMENTS_PARTIAL_KEY).toString()); m_arguments = bArgs.toStringList(); @@ -108,7 +108,7 @@ bool IosDsymBuildStep::fromMap(const QVariantMap &map) m_arguments = defaultArguments(); } - return BuildStep::fromMap(map); + BuildStep::fromMap(map); } QStringList IosDsymBuildStep::defaultArguments() const diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp index e4c19e09572..a8722fc24fc 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp @@ -144,14 +144,13 @@ void MesonBuildConfiguration::toMap(QVariantMap &map) const map[Constants::BuildConfiguration::PARAMETERS_KEY] = m_parameters; } -bool MesonBuildConfiguration::fromMap(const QVariantMap &map) +void MesonBuildConfiguration::fromMap(const QVariantMap &map) { - auto res = ProjectExplorer::BuildConfiguration::fromMap(map); + ProjectExplorer::BuildConfiguration::fromMap(map); m_buildSystem = new MesonBuildSystem{this}; m_buildType = mesonBuildType( map.value(Constants::BuildConfiguration::BUILD_TYPE_KEY).toString()); m_parameters = map.value(Constants::BuildConfiguration::PARAMETERS_KEY).toString(); - return res; } class MesonBuildSettingsWidget : public NamedWidget diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h index c9433dd5b69..5721ee5938e 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h +++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h @@ -31,7 +31,8 @@ signals: private: void toMap(QVariantMap &map) const override; - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; + MesonBuildType m_buildType; ProjectExplorer::NamedWidget *createConfigWidget() final; MesonBuildSystem *m_buildSystem = nullptr; diff --git a/src/plugins/mesonprojectmanager/ninjabuildstep.cpp b/src/plugins/mesonprojectmanager/ninjabuildstep.cpp index 310d6b12da5..02065c12a98 100644 --- a/src/plugins/mesonprojectmanager/ninjabuildstep.cpp +++ b/src/plugins/mesonprojectmanager/ninjabuildstep.cpp @@ -206,7 +206,7 @@ void NinjaBuildStep::toMap(QVariantMap &map) const map.insert(TOOL_ARGUMENTS_KEY, m_commandArgs); } -bool NinjaBuildStep::fromMap(const QVariantMap &map) +void NinjaBuildStep::fromMap(const QVariantMap &map) { m_targetName = map.value(TARGETS_KEY).toString(); m_commandArgs = map.value(TOOL_ARGUMENTS_KEY).toString(); diff --git a/src/plugins/mesonprojectmanager/ninjabuildstep.h b/src/plugins/mesonprojectmanager/ninjabuildstep.h index 8038d36bb60..750ab6d9e0a 100644 --- a/src/plugins/mesonprojectmanager/ninjabuildstep.h +++ b/src/plugins/mesonprojectmanager/ninjabuildstep.h @@ -27,7 +27,7 @@ public: Q_SIGNAL void commandChanged(); void toMap(QVariantMap &map) const override; - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; private: void update(bool parsingSuccessful); diff --git a/src/plugins/nim/project/nimblebuildconfiguration.cpp b/src/plugins/nim/project/nimblebuildconfiguration.cpp index 0f13a643aa7..3a198474983 100644 --- a/src/plugins/nim/project/nimblebuildconfiguration.cpp +++ b/src/plugins/nim/project/nimblebuildconfiguration.cpp @@ -37,10 +37,10 @@ BuildConfiguration::BuildType NimbleBuildConfiguration::buildType() const return m_buildType; } -bool NimbleBuildConfiguration::fromMap(const QVariantMap &map) +void NimbleBuildConfiguration::fromMap(const QVariantMap &map) { m_buildType = static_cast<BuildType>(map[Constants::C_NIMBLEBUILDCONFIGURATION_BUILDTYPE].toInt()); - return BuildConfiguration::fromMap(map); + BuildConfiguration::fromMap(map); } void NimbleBuildConfiguration::toMap(QVariantMap &map) const diff --git a/src/plugins/nim/project/nimblebuildconfiguration.h b/src/plugins/nim/project/nimblebuildconfiguration.h index 1a575ac6f06..236ea3a15cc 100644 --- a/src/plugins/nim/project/nimblebuildconfiguration.h +++ b/src/plugins/nim/project/nimblebuildconfiguration.h @@ -18,7 +18,7 @@ class NimbleBuildConfiguration : public ProjectExplorer::BuildConfiguration BuildType buildType() const override; - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; private: diff --git a/src/plugins/nim/project/nimcompilerbuildstep.cpp b/src/plugins/nim/project/nimcompilerbuildstep.cpp index 49b7760c951..9e941e6893c 100644 --- a/src/plugins/nim/project/nimcompilerbuildstep.cpp +++ b/src/plugins/nim/project/nimcompilerbuildstep.cpp @@ -121,13 +121,12 @@ QWidget *NimCompilerBuildStep::createConfigWidget() return widget; } -bool NimCompilerBuildStep::fromMap(const QVariantMap &map) +void NimCompilerBuildStep::fromMap(const QVariantMap &map) { AbstractProcessStep::fromMap(map); m_userCompilerOptions = map[Constants::C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS].toString().split('|'); m_defaultOptions = static_cast<DefaultBuildOptions>(map[Constants::C_NIMCOMPILERBUILDSTEP_DEFAULTBUILDOPTIONS].toInt()); m_targetNimFile = FilePath::fromString(map[Constants::C_NIMCOMPILERBUILDSTEP_TARGETNIMFILE].toString()); - return true; } void NimCompilerBuildStep::toMap(QVariantMap &map) const diff --git a/src/plugins/nim/project/nimcompilerbuildstep.h b/src/plugins/nim/project/nimcompilerbuildstep.h index 41985166b3e..fdd902af53d 100644 --- a/src/plugins/nim/project/nimcompilerbuildstep.h +++ b/src/plugins/nim/project/nimcompilerbuildstep.h @@ -26,7 +26,7 @@ private: void setupOutputFormatter(Utils::OutputFormatter *formatter) override; QWidget *createConfigWidget() override; - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; void updateTargetNimFile(); diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index b7500d46be5..ce3fa75a233 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -388,7 +388,7 @@ void BuildConfiguration::toMap(QVariantMap &map) const map.insert(CUSTOM_PARSERS_KEY, transform(d->m_customParsers,&Utils::Id::toSetting)); } -bool BuildConfiguration::fromMap(const QVariantMap &map) +void BuildConfiguration::fromMap(const QVariantMap &map) { d->m_clearSystemEnvironment = map.value(QLatin1String(Constants::CLEAR_SYSTEM_ENVIRONMENT_KEY)) .toBool(); @@ -422,9 +422,8 @@ bool BuildConfiguration::fromMap(const QVariantMap &map) d->m_parseStdOut = map.value(PARSE_STD_OUT_KEY).toBool(); d->m_customParsers = transform(map.value(CUSTOM_PARSERS_KEY).toList(), &Utils::Id::fromSetting); - const bool res = ProjectConfiguration::fromMap(map); + ProjectConfiguration::fromMap(map); setToolTip(d->m_tooltipAspect()); - return res; } void BuildConfiguration::updateCacheAndEmitEnvironmentChanged() @@ -783,7 +782,8 @@ BuildConfiguration *BuildConfigurationFactory::restore(Target *parent, const QVa continue; BuildConfiguration *bc = factory->m_creator(parent); QTC_ASSERT(bc, return nullptr); - if (!bc->fromMap(map)) { + bc->fromMap(map); + if (bc->hasError()) { delete bc; bc = nullptr; } diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index 64bcd2c8b38..85ee42247bb 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -68,7 +68,7 @@ public: void appendInitialBuildStep(Utils::Id id); void appendInitialCleanStep(Utils::Id id); - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; bool isEnabled() const; diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 8bea8c1f15f..cdf843d0ba5 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -186,10 +186,10 @@ QWidget *BuildStep::createConfigWidget() return widget; } -bool BuildStep::fromMap(const QVariantMap &map) +void BuildStep::fromMap(const QVariantMap &map) { m_enabled = map.value(buildStepEnabledKey, true).toBool(); - return ProjectConfiguration::fromMap(map); + ProjectConfiguration::fromMap(map); } void BuildStep::toMap(QVariantMap &map) const @@ -512,7 +512,8 @@ BuildStep *BuildStepFactory::restore(BuildStepList *parent, const QVariantMap &m BuildStep *bs = create(parent); if (!bs) return nullptr; - if (!bs->fromMap(map)) { + bs->fromMap(map); + if (bs->hasError()) { QTC_CHECK(false); delete bs; return nullptr; diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 3a9d68bd4a0..5f960a1fb16 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -53,7 +53,7 @@ public: void run(); void cancel(); - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; bool enabled() const; diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp index 1fe0aa5166a..85986a5f694 100644 --- a/src/plugins/projectexplorer/deployconfiguration.cpp +++ b/src/plugins/projectexplorer/deployconfiguration.cpp @@ -64,32 +64,36 @@ void DeployConfiguration::toMap(QVariantMap &map) const map.insert(DEPLOYMENT_DATA, deployData); } -bool DeployConfiguration::fromMap(const QVariantMap &map) +void DeployConfiguration::fromMap(const QVariantMap &map) { - if (!ProjectConfiguration::fromMap(map)) - return false; + ProjectConfiguration::fromMap(map); + if (hasError()) + return; int maxI = map.value(QLatin1String(BUILD_STEP_LIST_COUNT), 0).toInt(); - if (maxI != 1) - return false; + if (maxI != 1) { + reportError(); + return; + } QVariantMap data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1Char('0')).toMap(); if (!data.isEmpty()) { m_stepList.clear(); if (!m_stepList.fromMap(data)) { qWarning() << "Failed to restore deploy step list"; m_stepList.clear(); - return false; + reportError(); + return; } } else { qWarning() << "No data for deploy step list found!"; - return false; + reportError(); + return; } m_usesCustomDeploymentData = map.value(USES_DEPLOYMENT_DATA, false).toBool(); const QVariantMap deployData = map.value(DEPLOYMENT_DATA).toMap(); for (auto it = deployData.begin(); it != deployData.end(); ++it) m_customDeploymentData.addFile(FilePath::fromString(it.key()), it.value().toString()); - return true; } bool DeployConfiguration::isActive() const @@ -202,7 +206,8 @@ DeployConfiguration *DeployConfigurationFactory::restore(Target *parent, const Q return nullptr; DeployConfiguration *dc = factory->createDeployConfiguration(parent); QTC_ASSERT(dc, return nullptr); - if (!dc->fromMap(map)) { + dc->fromMap(map); + if (dc->hasError()) { delete dc; dc = nullptr; } else if (factory->postRestore()) { diff --git a/src/plugins/projectexplorer/deployconfiguration.h b/src/plugins/projectexplorer/deployconfiguration.h index e6b9c4c3cca..9e0b40865c4 100644 --- a/src/plugins/projectexplorer/deployconfiguration.h +++ b/src/plugins/projectexplorer/deployconfiguration.h @@ -31,7 +31,7 @@ public: QWidget *createConfigWidget(); - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; bool isActive() const; diff --git a/src/plugins/projectexplorer/projectconfiguration.cpp b/src/plugins/projectexplorer/projectconfiguration.cpp index 96176786b0f..082d978913a 100644 --- a/src/plugins/projectexplorer/projectconfiguration.cpp +++ b/src/plugins/projectexplorer/projectconfiguration.cpp @@ -87,16 +87,15 @@ Target *ProjectConfiguration::target() const return m_target; } -bool ProjectConfiguration::fromMap(const QVariantMap &map) +void ProjectConfiguration::fromMap(const QVariantMap &map) { Utils::Id id = Utils::Id::fromSetting(map.value(QLatin1String(CONFIGURATION_ID_KEY))); // Note: This is only "startsWith", not ==, as RunConfigurations currently still // mangle in their build keys. - QTC_ASSERT(id.toString().startsWith(m_id.toString()), return false); + QTC_ASSERT(id.toString().startsWith(m_id.toString()), reportError(); return); m_displayName.fromMap(map, DISPLAY_NAME_KEY); AspectContainer::fromMap(map); - return true; } Id ProjectExplorer::idFromMap(const QVariantMap &map) diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h index 7a96ebbd05c..7a2f5155c46 100644 --- a/src/plugins/projectexplorer/projectconfiguration.h +++ b/src/plugins/projectexplorer/projectconfiguration.h @@ -43,9 +43,11 @@ public: void setToolTip(const QString &text); QString toolTip() const; - // Note: Make sure subclasses call the superclasses' fromMap() function! - virtual bool fromMap(const QVariantMap &map); + void reportError() { m_hasError = true; } + bool hasError() const { return m_hasError; } + // Note: Make sure subclasses call the superclasses' fromMap() function! + virtual void fromMap(const QVariantMap &map); // Note: Make sure subclasses call the superclasses' toMap() function! virtual void toMap(QVariantMap &map) const; @@ -64,6 +66,7 @@ private: const Utils::Id m_id; Utils::DisplayName m_displayName; QString m_toolTip; + bool m_hasError = false; }; // helper function: diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 66e6d7272c9..716bff52a3e 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -375,10 +375,11 @@ ProjectNode *RunConfiguration::productNode() const }); } -bool RunConfiguration::fromMap(const QVariantMap &map) +void RunConfiguration::fromMap(const QVariantMap &map) { - if (!ProjectConfiguration::fromMap(map)) - return false; + ProjectConfiguration::fromMap(map); + if (hasError()) + return; m_customized = m_customized || map.value(CUSTOMIZED_KEY, false).toBool(); m_buildKey = map.value(BUILD_KEY).toString(); @@ -393,8 +394,6 @@ bool RunConfiguration::fromMap(const QVariantMap &map) if (magicIndex != -1) m_buildKey = m_buildKey.mid(magicIndex + magicSeparator.length()); } - - return true; } /*! @@ -633,7 +632,8 @@ RunConfiguration *RunConfigurationFactory::restore(Target *parent, const QVarian const Utils::Id id = idFromMap(map); if (id.name().startsWith(factory->m_runConfigurationId.name())) { RunConfiguration *rc = factory->create(parent); - if (rc->fromMap(map)) { + rc->fromMap(map); + if (!rc->hasError()) { rc->update(); rc->setPristineState(); return rc; diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 5f1820c0912..bae6a01cfc4 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -171,7 +171,7 @@ protected: private: // Any additional data should be handled by aspects. - bool fromMap(const QVariantMap &map) final; + void fromMap(const QVariantMap &map) final; void toMap(QVariantMap &map) const final; void toMapSimple(QVariantMap &map) const; diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index 2e7d725ef51..243ac8cbf23 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -162,10 +162,11 @@ void QbsBuildConfiguration::triggerReparseIfActive() m_buildSystem->delayParsing(); } -bool QbsBuildConfiguration::fromMap(const QVariantMap &map) +void QbsBuildConfiguration::fromMap(const QVariantMap &map) { - if (!BuildConfiguration::fromMap(map)) - return false; + BuildConfiguration::fromMap(map); + if (hasError()) + return; if (configurationName().isEmpty()) { // pre-4.4 backwards compatibility const QString profileName = QbsProfileManager::profileNameForKit(target()->kit()); @@ -173,8 +174,6 @@ bool QbsBuildConfiguration::fromMap(const QVariantMap &map) .value(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY)).toString(); configurationName.setValue(profileName + '-' + buildVariant); } - - return true; } void QbsBuildConfiguration::restrictNextBuild(const RunConfiguration *rc) diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h index 8fdeb2ba550..5984a555b9e 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h @@ -71,7 +71,7 @@ signals: void qbsConfigurationChanged(); private: - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; void restrictNextBuild(const ProjectExplorer::RunConfiguration *rc) override; void triggerReparseIfActive(); diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 0a222059d26..3dd11f505d7 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -372,13 +372,12 @@ int QbsBuildStep::maxJobs() const return QThread::idealThreadCount(); } -bool QbsBuildStep::fromMap(const QVariantMap &map) +void QbsBuildStep::fromMap(const QVariantMap &map) { - if (!BuildStep::fromMap(map)) - return false; - + BuildStep::fromMap(map); + if (hasError()) + return; setQbsConfiguration(map.value(QBS_CONFIG).toMap()); - return true; } void QbsBuildStep::toMap(QVariantMap &map) const diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index c1dfd1b2edf..f2f3c336d5d 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -85,7 +85,7 @@ private: void doRun() override; void doCancel() override; QWidget *createConfigWidget() override; - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; void buildingDone(const ErrorInfo &error); diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 7e0d8918fe7..ee71c7eb2db 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -193,15 +193,15 @@ void QmakeBuildConfiguration::toMap(QVariantMap &map) const map.insert(QLatin1String(BUILD_CONFIGURATION_KEY), int(m_qmakeBuildConfiguration)); } -bool QmakeBuildConfiguration::fromMap(const QVariantMap &map) +void QmakeBuildConfiguration::fromMap(const QVariantMap &map) { - if (!BuildConfiguration::fromMap(map)) - return false; + BuildConfiguration::fromMap(map); + if (hasError()) + return; m_qmakeBuildConfiguration = QtVersion::QmakeBuildConfigs(map.value(QLatin1String(BUILD_CONFIGURATION_KEY)).toInt()); m_lastKitState = LastKitState(kit()); - return true; } void QmakeBuildConfiguration::kitChanged() diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h index 25f0c0db378..a1813e6cd7f 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h @@ -99,7 +99,7 @@ signals: void useQtQuickCompilerChanged(); protected: - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; bool regenerateBuildFiles(ProjectExplorer::Node *node = nullptr) override; private: diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 3487c04438e..cae48809b7a 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -410,11 +410,11 @@ void QMakeStep::toMap(QVariantMap &map) const map.insert(QMAKE_SELECTED_ABIS_KEY, m_selectedAbis); } -bool QMakeStep::fromMap(const QVariantMap &map) +void QMakeStep::fromMap(const QVariantMap &map) { m_forced = map.value(QMAKE_FORCED_KEY, false).toBool(); m_selectedAbis = map.value(QMAKE_SELECTED_ABIS_KEY).toStringList(); - return BuildStep::fromMap(map); + BuildStep::fromMap(map); } QWidget *QMakeStep::createConfigWidget() diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index b497000a3e6..334cfb8157d 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -131,7 +131,7 @@ public: Utils::StringAspect effectiveCall{this}; protected: - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; private: Tasking::GroupItem runRecipe() final; diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index 8280c969f20..b9ebcf71246 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -82,12 +82,12 @@ void AbstractRemoteLinuxDeployStep::setInternalInitializer( d->internalInit = init; } -bool AbstractRemoteLinuxDeployStep::fromMap(const QVariantMap &map) +void AbstractRemoteLinuxDeployStep::fromMap(const QVariantMap &map) { - if (!BuildStep::fromMap(map)) - return false; + BuildStep::fromMap(map); + if (hasError()) + return; d->deployTimes.importDeployTimes(map); - return true; } void AbstractRemoteLinuxDeployStep::toMap(QVariantMap &map) const diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h index 0fe42a26d9f..78cfd532041 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h @@ -26,7 +26,7 @@ protected: void handleStdOutData(const QString &data); void handleStdErrData(const QString &data); - bool fromMap(const QVariantMap &map) final; + void fromMap(const QVariantMap &map) final; void toMap(QVariantMap &map) const final; bool init() final; diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 2749a292a61..f52394231fc 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -38,7 +38,7 @@ public: MakeInstallStep(BuildStepList *parent, Id id); private: - bool fromMap(const QVariantMap &map) override; + void fromMap(const QVariantMap &map) override; QWidget *createConfigWidget() override; bool init() override; Tasking::GroupItem runRecipe() final; @@ -257,14 +257,14 @@ void MakeInstallStep::updateFromCustomCommandLineAspect() setUserArguments(ProcessArgs::joinArgs(tokens.mid(1))); } -bool MakeInstallStep::fromMap(const QVariantMap &map) +void MakeInstallStep::fromMap(const QVariantMap &map) { - if (!MakeStep::fromMap(map)) - return false; + MakeStep::fromMap(map); + if (hasError()) + return; updateCommandFromAspect(); updateArgsFromAspect(); updateFromCustomCommandLineAspect(); - return true; } // Factory diff --git a/src/plugins/remotelinux/tarpackagecreationstep.cpp b/src/plugins/remotelinux/tarpackagecreationstep.cpp index da9f43e29c6..4a3720d8c85 100644 --- a/src/plugins/remotelinux/tarpackagecreationstep.cpp +++ b/src/plugins/remotelinux/tarpackagecreationstep.cpp @@ -62,7 +62,7 @@ public: private: bool init() final; GroupItem runRecipe() final; - bool fromMap(const QVariantMap &map) final; + void fromMap(const QVariantMap &map) final; void toMap(QVariantMap &map) const final; QVariant data(Id id) const final; @@ -166,12 +166,12 @@ GroupItem TarPackageCreationStep::runRecipe() return AsyncTask<void>(onSetup, onDone, onError); } -bool TarPackageCreationStep::fromMap(const QVariantMap &map) +void TarPackageCreationStep::fromMap(const QVariantMap &map) { - if (!BuildStep::fromMap(map)) - return false; + BuildStep::fromMap(map); + if (hasError()) + return; m_deployTimes.importDeployTimes(map); - return true; } void TarPackageCreationStep::toMap(QVariantMap &map) const From 5d67ad37cf2bb39644f803fe7d97f2bf8e77cd4d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 14:14:18 +0200 Subject: [PATCH 0456/1777] Debugger: Simplify code path leading to .writeSettings() Change-Id: Iaea1159305507e10adf2b448a774e2b528eaef80 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/debugger/debuggeractions.cpp | 8 ++++---- src/plugins/debugger/debuggeractions.h | 2 -- src/plugins/debugger/debuggerplugin.cpp | 10 ---------- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index ecfcf0e5b5a..074197eec1a 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -10,6 +10,7 @@ #include "gdb/gdbsettings.h" #include <coreplugin/coreconstants.h> +#include <coreplugin/icore.h> #include <utils/hostosinfo.h> #include <utils/qtcassert.h> @@ -370,11 +371,10 @@ DebuggerSettings::DebuggerSettings() : }); all.readSettings(); -} -void DebuggerSettings::writeSettings() const -{ - all.writeSettings(); + QObject::connect(Core::ICore::instance(), &Core::ICore::saveSettingsRequested, + &all, &AspectContainer::writeSettings); + } QString DebuggerSettings::dump() diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index 8fa62d172db..f455aba7a74 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -124,8 +124,6 @@ public: Utils::AspectContainer page5; // CDB Utils::AspectContainer page6; // CDB Paths - void writeSettings() const; - private: DebuggerSettings(const DebuggerSettings &) = delete; DebuggerSettings &operator=(const DebuggerSettings &) = delete; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 3add78b59ff..18d68ac2bb9 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -583,12 +583,6 @@ public: RunControl *attachToRunningProcess(Kit *kit, const ProcessInfo &process, bool contAfterAttach); - void writeSettings() - { - settings().writeSettings(); -// writeWindowSettings(); - } - void breakpointSetMarginActionTriggered(bool isMessageOnly, const ContextData &data) { QString message; @@ -1160,10 +1154,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) // Connections // - // Core - connect(ICore::instance(), &ICore::saveSettingsRequested, - this, &DebuggerPluginPrivate::writeSettings); - // ProjectExplorer connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated, this, &DebuggerPluginPrivate::updatePresetState); From 45aa708e894185dc27ed29a0ad31f64e1f333510 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 12:05:36 +0200 Subject: [PATCH 0457/1777] Haskell: Delay settings creation Change-Id: I45666aa8aab1caa776d2f9f23455dc6a92384018 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/haskell/haskellplugin.cpp | 2 -- src/plugins/haskell/haskellsettings.cpp | 33 +++++++++++++++++-------- src/plugins/haskell/haskellsettings.h | 4 +-- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/plugins/haskell/haskellplugin.cpp b/src/plugins/haskell/haskellplugin.cpp index 1afa8cd175f..9c082c67a9e 100644 --- a/src/plugins/haskell/haskellplugin.cpp +++ b/src/plugins/haskell/haskellplugin.cpp @@ -9,7 +9,6 @@ #include "haskellmanager.h" #include "haskellproject.h" #include "haskellrunconfiguration.h" -#include "haskellsettings.h" #include "haskelltr.h" #include "stackbuildstep.h" @@ -31,7 +30,6 @@ namespace Internal { class HaskellPluginPrivate { public: - HaskellSettings settings; HaskellEditorFactory editorFactory; HaskellBuildConfigurationFactory buildConfigFactory; StackBuildStepFactory stackBuildStepFactory; diff --git a/src/plugins/haskell/haskellsettings.cpp b/src/plugins/haskell/haskellsettings.cpp index 2b58a30af0a..ce13a5fddda 100644 --- a/src/plugins/haskell/haskellsettings.cpp +++ b/src/plugins/haskell/haskellsettings.cpp @@ -6,6 +6,8 @@ #include "haskellconstants.h" #include "haskelltr.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/hostosinfo.h> #include <utils/layoutbuilder.h> @@ -13,22 +15,15 @@ using namespace Utils; namespace Haskell::Internal { -static HaskellSettings *theSettings; - HaskellSettings &settings() { - return *theSettings; + static HaskellSettings theSettings; + return theSettings; } HaskellSettings::HaskellSettings() { - theSettings = this; - - setId(Constants::OPTIONS_GENERAL); - setDisplayName(Tr::tr("General")); - setCategory("J.Z.Haskell"); - setDisplayCategory(Tr::tr("Haskell")); - setCategoryIconPath(":/haskell/images/settingscategory_haskell.png"); + setAutoApply(false); stackPath.setSettingsKey("Haskell/StackExecutable"); stackPath.setExpectedKind(PathChooser::ExistingCommand); @@ -55,4 +50,22 @@ HaskellSettings::HaskellSettings() readSettings(); } +// HaskellSettingsPage + +class HaskellSettingsPage final : public Core::IOptionsPage +{ +public: + HaskellSettingsPage() + { + setId(Constants::OPTIONS_GENERAL); + setDisplayName(Tr::tr("General")); + setCategory("J.Z.Haskell"); + setDisplayCategory(Tr::tr("Haskell")); + setCategoryIconPath(":/haskell/images/settingscategory_haskell.png"); + setSettingsProvider([] { return &settings(); }); + } +}; + +const HaskellSettingsPage settingsPage; + } // Haskell::Internal diff --git a/src/plugins/haskell/haskellsettings.h b/src/plugins/haskell/haskellsettings.h index 1331e5aa89a..dbe7c6b40b9 100644 --- a/src/plugins/haskell/haskellsettings.h +++ b/src/plugins/haskell/haskellsettings.h @@ -3,11 +3,11 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> namespace Haskell::Internal { -class HaskellSettings : public Core::PagedSettings +class HaskellSettings final : public Utils::AspectContainer { public: HaskellSettings(); From 678e8d3137b6a06b72621712a7b3650afff8c95e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 20 Jul 2023 09:36:41 +0200 Subject: [PATCH 0458/1777] PerfProfiler: Convert to current settings scheme Change-Id: I33e667a1cd9515f17af1bf9b2af6171b083c79de Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/perfprofiler/CMakeLists.txt | 3 +- src/plugins/perfprofiler/perfoptionspage.cpp | 26 ------------- src/plugins/perfprofiler/perfoptionspage.h | 21 ----------- src/plugins/perfprofiler/perfprofiler.qbs | 2 - .../perfprofiler/perfprofilerplugin.cpp | 10 +---- src/plugins/perfprofiler/perfprofilerplugin.h | 4 -- src/plugins/perfprofiler/perfprofilertool.cpp | 2 +- .../perfrunconfigurationaspect.cpp | 2 +- src/plugins/perfprofiler/perfsettings.cpp | 37 ++++++++++++++++++- src/plugins/perfprofiler/perfsettings.h | 4 +- 10 files changed, 42 insertions(+), 69 deletions(-) delete mode 100644 src/plugins/perfprofiler/perfoptionspage.cpp delete mode 100644 src/plugins/perfprofiler/perfoptionspage.h diff --git a/src/plugins/perfprofiler/CMakeLists.txt b/src/plugins/perfprofiler/CMakeLists.txt index b7ae8e6c9cf..7140042f565 100644 --- a/src/plugins/perfprofiler/CMakeLists.txt +++ b/src/plugins/perfprofiler/CMakeLists.txt @@ -15,7 +15,6 @@ set(PERFPROFILER_CPP_SOURCES perfevent.h perfeventtype.h perfloaddialog.cpp perfloaddialog.h - perfoptionspage.cpp perfoptionspage.h perfprofiler.qrc perfprofilerconstants.h perfprofilerflamegraphmodel.cpp perfprofilerflamegraphmodel.h @@ -29,7 +28,7 @@ set(PERFPROFILER_CPP_SOURCES perfprofilertracemanager.cpp perfprofilertracemanager.h perfprofilertraceview.cpp perfprofilertraceview.h perfprofiler_global.h - perfprofilertr.h + perfprofilertr.h perfresourcecounter.cpp perfresourcecounter.h perfrunconfigurationaspect.cpp perfrunconfigurationaspect.h perfsettings.cpp perfsettings.h diff --git a/src/plugins/perfprofiler/perfoptionspage.cpp b/src/plugins/perfprofiler/perfoptionspage.cpp deleted file mode 100644 index e295a5be489..00000000000 --- a/src/plugins/perfprofiler/perfoptionspage.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "perfconfigwidget.h" -#include "perfoptionspage.h" -#include "perfprofilerconstants.h" -#include "perfprofilertr.h" - -#include <debugger/analyzer/analyzericons.h> -#include <debugger/debuggertr.h> - -namespace PerfProfiler { -namespace Internal { - -PerfOptionsPage::PerfOptionsPage(PerfSettings *settings) -{ - setId(Constants::PerfSettingsId); - setDisplayName(Tr::tr("CPU Usage")); - setCategory("T.Analyzer"); - setDisplayCategory(::Debugger::Tr::tr("Analyzer")); - setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); - setWidgetCreator([settings] { return new PerfConfigWidget(settings); }); -} - -} // namespace Internal -} // namespace PerfProfiler diff --git a/src/plugins/perfprofiler/perfoptionspage.h b/src/plugins/perfprofiler/perfoptionspage.h deleted file mode 100644 index ae87f031ed0..00000000000 --- a/src/plugins/perfprofiler/perfoptionspage.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <coreplugin/dialogs/ioptionspage.h> - -namespace PerfProfiler { - -class PerfSettings; - -namespace Internal { - -class PerfOptionsPage final : public Core::IOptionsPage -{ -public: - explicit PerfOptionsPage(PerfSettings *settings); -}; - -} // namespace Internal -} // namespace PerfProfiler diff --git a/src/plugins/perfprofiler/perfprofiler.qbs b/src/plugins/perfprofiler/perfprofiler.qbs index 68d8452ffc1..4604a2e2099 100644 --- a/src/plugins/perfprofiler/perfprofiler.qbs +++ b/src/plugins/perfprofiler/perfprofiler.qbs @@ -26,8 +26,6 @@ QtcPlugin { "perfeventtype.h", "perfloaddialog.cpp", "perfloaddialog.h", - "perfoptionspage.cpp", - "perfoptionspage.h", "perfprofiler_global.h", "perfprofilertr.h", "perfprofilerconstants.h", "perfprofilerplugin.cpp", diff --git a/src/plugins/perfprofiler/perfprofilerplugin.cpp b/src/plugins/perfprofiler/perfprofilerplugin.cpp index 1293d84f436..f7ac90eaa9a 100644 --- a/src/plugins/perfprofiler/perfprofilerplugin.cpp +++ b/src/plugins/perfprofiler/perfprofilerplugin.cpp @@ -1,8 +1,8 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "perfoptionspage.h" #include "perfprofilerplugin.h" + #include "perfprofilerruncontrol.h" #include "perfprofilertool.h" #include "perfrunconfigurationaspect.h" @@ -17,8 +17,6 @@ using namespace ProjectExplorer; namespace PerfProfiler::Internal { -Q_GLOBAL_STATIC(PerfSettings, perfGlobalSettings) - class PerfProfilerPluginPrivate { public: @@ -28,7 +26,6 @@ public: } PerfProfilerRunWorkerFactory profilerWorkerFactory; - PerfOptionsPage optionsPage{perfGlobalSettings()}; PerfProfilerTool profilerTool; }; @@ -47,9 +44,4 @@ void PerfProfilerPlugin::initialize() #endif // WITH_TESTS } -PerfSettings *PerfProfilerPlugin::globalSettings() -{ - return perfGlobalSettings(); -} - } // PerfProfiler::Internal diff --git a/src/plugins/perfprofiler/perfprofilerplugin.h b/src/plugins/perfprofiler/perfprofilerplugin.h index afb6ea0936d..8421884f0fe 100644 --- a/src/plugins/perfprofiler/perfprofilerplugin.h +++ b/src/plugins/perfprofiler/perfprofilerplugin.h @@ -3,8 +3,6 @@ #pragma once -#include "perfsettings.h" - #include <extensionsystem/iplugin.h> namespace PerfProfiler::Internal { @@ -19,8 +17,6 @@ public: void initialize() final; - static PerfSettings *globalSettings(); - class PerfProfilerPluginPrivate *d = nullptr; }; diff --git a/src/plugins/perfprofiler/perfprofilertool.cpp b/src/plugins/perfprofiler/perfprofilertool.cpp index d4a06a249e3..6e530e77689 100644 --- a/src/plugins/perfprofiler/perfprofilertool.cpp +++ b/src/plugins/perfprofiler/perfprofilertool.cpp @@ -237,7 +237,7 @@ void PerfProfilerTool::createViews() } PerfConfigWidget *widget = new PerfConfigWidget( - settings ? settings : PerfProfilerPlugin::globalSettings(), + settings ? settings : &globalSettings(), Core::ICore::dialogParent()); widget->setTracePointsButtonVisible(true); widget->setTarget(target); diff --git a/src/plugins/perfprofiler/perfrunconfigurationaspect.cpp b/src/plugins/perfprofiler/perfrunconfigurationaspect.cpp index 2196d8be2a0..d801af2104c 100644 --- a/src/plugins/perfprofiler/perfrunconfigurationaspect.cpp +++ b/src/plugins/perfprofiler/perfrunconfigurationaspect.cpp @@ -14,7 +14,7 @@ namespace PerfProfiler { PerfRunConfigurationAspect::PerfRunConfigurationAspect(ProjectExplorer::Target *target) { setProjectSettings(new PerfSettings(target)); - setGlobalSettings(Internal::PerfProfilerPlugin::globalSettings()); + setGlobalSettings(&PerfProfiler::globalSettings()); setId(Constants::PerfSettingsId); setDisplayName(Tr::tr("Performance Analyzer Settings")); setUsingGlobalSettings(true); diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp index 6322f77fa12..e737031a3fe 100644 --- a/src/plugins/perfprofiler/perfsettings.cpp +++ b/src/plugins/perfprofiler/perfsettings.cpp @@ -6,16 +6,25 @@ #include "perfprofilertr.h" #include "perfsettings.h" +#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icore.h> -#include <QSettings> +#include <debugger/analyzer/analyzericons.h> +#include <debugger/debuggertr.h> +#include <utils/layoutbuilder.h> #include <utils/process.h> using namespace Utils; namespace PerfProfiler { +PerfSettings &globalSettings() +{ + static PerfSettings theSettings(nullptr); + return theSettings; +} + PerfSettings::PerfSettings(ProjectExplorer::Target *target) { setConfigWidgetCreator([this, target] { @@ -62,6 +71,14 @@ PerfSettings::PerfSettings(ProjectExplorer::Target *target) stackSize.setEnabled(callgraphMode.volatileValue() == 0); }); + setLayouter([this] { + using namespace Layouting; + return Column { + createConfigWidget() + }; + }); + + readSettings(); readGlobalSettings(); } @@ -125,4 +142,22 @@ void PerfSettings::resetToDefault() fromMap(map); } +// PerfSettingsPage + +class PerfSettingsPage final : public Core::IOptionsPage +{ +public: + PerfSettingsPage() + { + setId(Constants::PerfSettingsId); + setDisplayName(Tr::tr("CPU Usage")); + setCategory("T.Analyzer"); + setDisplayCategory(::Debugger::Tr::tr("Analyzer")); + setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); + setSettingsProvider([] { return &globalSettings(); }); + } +}; + +const PerfSettingsPage settingsPage; + } // namespace PerfProfiler diff --git a/src/plugins/perfprofiler/perfsettings.h b/src/plugins/perfprofiler/perfsettings.h index 7c10706098b..8b38f1015ea 100644 --- a/src/plugins/perfprofiler/perfsettings.h +++ b/src/plugins/perfprofiler/perfsettings.h @@ -7,8 +7,6 @@ #include <projectexplorer/runconfiguration.h> -#include <QObject> - namespace PerfProfiler { class PERFPROFILER_EXPORT PerfSettings final : public ProjectExplorer::ISettingsAspect @@ -34,4 +32,6 @@ public: Utils::StringAspect extraArguments{this}; }; +PerfSettings &globalSettings(); + } // namespace PerfProfiler From c5588965945174196a6d25305b795e806d994aa7 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 19:15:02 +0200 Subject: [PATCH 0459/1777] ProjectExplorer: Replace the fromMap error return value for toolchains ... by some out-of-band mechanism, keeping previous functionality. The driving reason is to get the same fromMap signature as in the AspectContainer base. Change-Id: Ife7fbf4d0e0f78d88729021eb5220ec4a8ddb2ec Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/android/androidtoolchain.cpp | 10 +++--- src/plugins/android/androidtoolchain.h | 2 +- src/plugins/nim/project/nimtoolchain.cpp | 8 ++--- src/plugins/nim/project/nimtoolchain.h | 2 +- .../projectexplorer/customtoolchain.cpp | 9 +++-- src/plugins/projectexplorer/customtoolchain.h | 2 +- src/plugins/projectexplorer/gcctoolchain.cpp | 17 +++++----- src/plugins/projectexplorer/gcctoolchain.h | 4 +-- src/plugins/projectexplorer/msvctoolchain.cpp | 33 ++++++++++--------- src/plugins/projectexplorer/msvctoolchain.h | 4 +-- src/plugins/projectexplorer/toolchain.cpp | 18 +++++++--- src/plugins/projectexplorer/toolchain.h | 5 ++- .../toolchainsettingsaccessor.cpp | 3 +- 13 files changed, 66 insertions(+), 51 deletions(-) diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index 7af3bb417b6..50a850aa192 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -101,11 +101,13 @@ void AndroidToolChain::addToEnvironment(Environment &env) const env.set(QLatin1String("ANDROID_SDK_ROOT"), config.sdkLocation().toUserOutput()); } -bool AndroidToolChain::fromMap(const QVariantMap &data) +void AndroidToolChain::fromMap(const QVariantMap &data) { - if (!ClangToolChain::fromMap(data)) - return false; - return isValid(); + ClangToolChain::fromMap(data); + if (hasError()) + return; + if (!isValid()) + reportError(); } QStringList AndroidToolChain::suggestedMkspecList() const diff --git a/src/plugins/android/androidtoolchain.h b/src/plugins/android/androidtoolchain.h index af4572c3cbd..707125391cb 100644 --- a/src/plugins/android/androidtoolchain.h +++ b/src/plugins/android/androidtoolchain.h @@ -22,7 +22,7 @@ public: QStringList suggestedMkspecList() const override; Utils::FilePath makeCommand(const Utils::Environment &environment) const override; - bool fromMap(const QVariantMap &data) override; + void fromMap(const QVariantMap &data) override; void setNdkLocation(const Utils::FilePath &ndkLocation); Utils::FilePath ndkLocation() const; diff --git a/src/plugins/nim/project/nimtoolchain.cpp b/src/plugins/nim/project/nimtoolchain.cpp index 21b441fa6ce..e04efeae8e3 100644 --- a/src/plugins/nim/project/nimtoolchain.cpp +++ b/src/plugins/nim/project/nimtoolchain.cpp @@ -85,12 +85,12 @@ QString NimToolChain::compilerVersion() const std::get<2>(m_version)); } -bool NimToolChain::fromMap(const QVariantMap &data) +void NimToolChain::fromMap(const QVariantMap &data) { - if (!ToolChain::fromMap(data)) - return false; + ToolChain::fromMap(data); + if (hasError()) + return; parseVersion(compilerCommand(), m_version); - return true; } bool NimToolChain::parseVersion(const FilePath &path, std::tuple<int, int, int> &result) diff --git a/src/plugins/nim/project/nimtoolchain.h b/src/plugins/nim/project/nimtoolchain.h index a2f816a7f97..087f44cd2eb 100644 --- a/src/plugins/nim/project/nimtoolchain.h +++ b/src/plugins/nim/project/nimtoolchain.h @@ -26,7 +26,7 @@ public: QList<Utils::OutputLineParser *> createOutputParsers() const final; std::unique_ptr<ProjectExplorer::ToolChainConfigWidget> createConfigurationWidget() final; - bool fromMap(const QVariantMap &data) final; + void fromMap(const QVariantMap &data) final; static bool parseVersion(const Utils::FilePath &path, std::tuple<int, int, int> &version); diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp index c15ade15c08..9ad4551c57d 100644 --- a/src/plugins/projectexplorer/customtoolchain.cpp +++ b/src/plugins/projectexplorer/customtoolchain.cpp @@ -229,10 +229,11 @@ void CustomToolChain::toMap(QVariantMap &data) const data.insert(QLatin1String(outputParserKeyC), m_outputParserId.toSetting()); } -bool CustomToolChain::fromMap(const QVariantMap &data) +void CustomToolChain::fromMap(const QVariantMap &data) { - if (!ToolChain::fromMap(data)) - return false; + ToolChain::fromMap(data); + if (hasError()) + return; m_makeCommand = FilePath::fromString(data.value(QLatin1String(makeCommandKeyC)).toString()); const QStringList macros = data.value(QLatin1String(predefinedMacrosKeyC)).toStringList(); @@ -241,8 +242,6 @@ bool CustomToolChain::fromMap(const QVariantMap &data) m_cxx11Flags = data.value(QLatin1String(cxx11FlagsKeyC)).toStringList(); setMkspecs(data.value(QLatin1String(mkspecsKeyC)).toString()); setOutputParserId(Utils::Id::fromSetting(data.value(QLatin1String(outputParserKeyC)))); - - return true; } bool CustomToolChain::operator ==(const ToolChain &other) const diff --git a/src/plugins/projectexplorer/customtoolchain.h b/src/plugins/projectexplorer/customtoolchain.h index b01850a43cd..13a16139293 100644 --- a/src/plugins/projectexplorer/customtoolchain.h +++ b/src/plugins/projectexplorer/customtoolchain.h @@ -57,7 +57,7 @@ public: void setHeaderPaths(const QStringList &list); void toMap(QVariantMap &data) const override; - bool fromMap(const QVariantMap &data) override; + void fromMap(const QVariantMap &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index c6f74d565b3..fa5d41a623f 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -804,10 +804,11 @@ void GccToolChain::toMap(QVariantMap &data) const data.insert(supportedAbisKeyC, Utils::transform<QStringList>(m_supportedAbis, &Abi::toString)); } -bool GccToolChain::fromMap(const QVariantMap &data) +void GccToolChain::fromMap(const QVariantMap &data) { - if (!ToolChain::fromMap(data)) - return false; + ToolChain::fromMap(data); + if (hasError()) + return; m_platformCodeGenFlags = data.value(compilerPlatformCodeGenFlagsKeyC).toStringList(); m_platformLinkerFlags = data.value(compilerPlatformLinkerFlagsKeyC).toStringList(); @@ -820,8 +821,6 @@ bool GccToolChain::fromMap(const QVariantMap &data) const QString targetAbiString = data.value(targetAbiKeyC).toString(); if (targetAbiString.isEmpty()) resetToolChain(compilerCommand()); - - return true; } bool GccToolChain::operator ==(const ToolChain &other) const @@ -1719,15 +1718,15 @@ void ClangToolChain::toMap(QVariantMap &data) const data.insert(priorityKeyC, m_priority); } -bool ClangToolChain::fromMap(const QVariantMap &data) +void ClangToolChain::fromMap(const QVariantMap &data) { - if (!GccToolChain::fromMap(data)) - return false; + GccToolChain::fromMap(data); + if (hasError()) + return; m_parentToolChainId = data.value(parentToolChainIdKeyC).toByteArray(); m_priority = data.value(priorityKeyC, PriorityNormal).toInt(); syncAutodetectedWithParentToolchains(); - return true; } LanguageExtensions ClangToolChain::defaultLanguageExtensions() const diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 96ab49df3d2..389213d12f2 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -67,7 +67,7 @@ public: QList<Utils::OutputLineParser *> createOutputParsers() const override; void toMap(QVariantMap &data) const override; - bool fromMap(const QVariantMap &data) override; + void fromMap(const QVariantMap &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; @@ -207,7 +207,7 @@ public: std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; void toMap(QVariantMap &data) const override; - bool fromMap(const QVariantMap &data) override; + void fromMap(const QVariantMap &data) override; void setPriority(int priority) { m_priority = priority; } int priority() const override { return m_priority; } diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 095978bb91d..19aa8923d57 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -989,11 +989,12 @@ void MsvcToolChain::toMap(QVariantMap &data) const Utils::EnvironmentItem::toVariantList(m_environmentModifications)); } -bool MsvcToolChain::fromMap(const QVariantMap &data) +void MsvcToolChain::fromMap(const QVariantMap &data) { - if (!ToolChain::fromMap(data)) { + ToolChain::fromMap(data); + if (hasError()) { g_availableMsvcToolchains.removeOne(this); - return false; + return; } m_vcvarsBat = QDir::fromNativeSeparators(data.value(QLatin1String(varsBatKeyC)).toString()); m_varsBatArg = data.value(QLatin1String(varsBatArgKeyC)).toString(); @@ -1005,11 +1006,10 @@ bool MsvcToolChain::fromMap(const QVariantMap &data) initEnvModWatcher(Utils::asyncRun(envModThreadPool(), &MsvcToolChain::environmentModifications, m_vcvarsBat, m_varsBatArg)); - const bool valid = !m_vcvarsBat.isEmpty() && targetAbi().isValid(); - if (!valid) + if (m_vcvarsBat.isEmpty() || !targetAbi().isValid()) { + reportError(); g_availableMsvcToolchains.removeOne(this); - - return valid; + } } std::unique_ptr<ToolChainConfigWidget> MsvcToolChain::createConfigurationWidget() @@ -1733,16 +1733,19 @@ void ClangClToolChain::toMap(QVariantMap &data) const data.insert(llvmDirKey(), m_clangPath.toString()); } -bool ClangClToolChain::fromMap(const QVariantMap &data) +void ClangClToolChain::fromMap(const QVariantMap &data) { - if (!MsvcToolChain::fromMap(data)) - return false; - const QString clangPath = data.value(llvmDirKey()).toString(); - if (clangPath.isEmpty()) - return false; - m_clangPath = FilePath::fromString(clangPath); + MsvcToolChain::fromMap(data); + if (hasError()) + return; - return true; + const QString clangPath = data.value(llvmDirKey()).toString(); + if (clangPath.isEmpty()) { + reportError(); + return; + } + + m_clangPath = FilePath::fromString(clangPath); } std::unique_ptr<ToolChainConfigWidget> ClangClToolChain::createConfigurationWidget() diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index 77cd18a647a..9f0b867466a 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -47,7 +47,7 @@ public: Abis supportedAbis() const override; void toMap(QVariantMap &data) const override; - bool fromMap(const QVariantMap &data) override; + void fromMap(const QVariantMap &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; bool hostPrefersToolchain() const override; @@ -147,7 +147,7 @@ public: Utils::FilePath compilerCommand() const override; // FIXME: Remove QList<Utils::OutputLineParser *> createOutputParsers() const override; void toMap(QVariantMap &data) const override; - bool fromMap(const QVariantMap &data) override; + void fromMap(const QVariantMap &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner( const Utils::Environment &env) const override; diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index aed69cea3c2..a41c749d002 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -74,6 +74,7 @@ public: ToolChain::MacrosCache m_predefinedMacrosCache; ToolChain::HeaderPathsCache m_headerPathsCache; std::optional<bool> m_isValid; + bool m_hasError = false; }; @@ -353,7 +354,7 @@ void ToolChain::setTypeDisplayName(const QString &typeName) Make sure to call this function when deriving. */ -bool ToolChain::fromMap(const QVariantMap &data) +void ToolChain::fromMap(const QVariantMap &data) { AspectContainer::fromMap(data); @@ -362,7 +363,7 @@ bool ToolChain::fromMap(const QVariantMap &data) // make sure we have new style ids: const QString id = data.value(QLatin1String(ID_KEY)).toString(); int pos = id.indexOf(QLatin1Char(':')); - QTC_ASSERT(pos > 0, return false); + QTC_ASSERT(pos > 0, reportError(); return); d->m_typeId = Id::fromString(id.left(pos)); d->m_id = id.mid(pos + 1).toUtf8(); @@ -393,8 +394,16 @@ bool ToolChain::fromMap(const QVariantMap &data) d->m_compilerCommand = FilePath::fromSettings(data.value(d->m_compilerCommandKey)); d->m_isValid.reset(); +} - return true; +void ToolChain::reportError() +{ + d->m_hasError = true; +} + +bool ToolChain::hasError() const +{ + return d->m_hasError; } const ToolChain::HeaderPathsCache &ToolChain::headerPathsCache() const @@ -597,7 +606,8 @@ ToolChain *ToolChainFactory::restore(const QVariantMap &data) ToolChain *tc = m_toolchainConstructor(); QTC_ASSERT(tc, return nullptr); - if (tc->fromMap(data)) + tc->fromMap(data); + if (!tc->hasError()) return tc; delete tc; diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 66c9edd6614..337c10727b0 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -182,7 +182,10 @@ protected: void toolChainUpdated(); // Make sure to call this function when deriving! - virtual bool fromMap(const QVariantMap &data); + virtual void fromMap(const QVariantMap &data); + + void reportError(); + bool hasError() const; enum class PossiblyConcatenatedFlag { No, Yes }; static Utils::FilePaths includedFiles(const QString &option, diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index a001f509496..7c005f62956 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -320,11 +320,10 @@ public: return static_cast<const TTC *>(&other)->token == token; } - bool fromMap(const QVariantMap &data) final + void fromMap(const QVariantMap &data) final { ToolChain::fromMap(data); token = data.value(TestTokenKey).toByteArray(); - return true; } void toMap(QVariantMap &data) const final From 5af88f570211f3e8b992371308b6d29acfaf6352 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 12:31:52 +0200 Subject: [PATCH 0460/1777] Ios: Use aspects more directly in IosRunConfiguration Change-Id: Ic6fd16287e28a16c231b0b30211f112aceb11795 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/ios/iosrunconfiguration.cpp | 23 +++++++++-------------- src/plugins/ios/iosrunconfiguration.h | 8 ++++++-- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index dda93209270..2012dfcc8f2 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -56,25 +56,20 @@ static IosDeviceType toIosDeviceType(const SimulatorInfo &device) } IosRunConfiguration::IosRunConfiguration(Target *target, Id id) - : RunConfiguration(target, id) + : RunConfiguration(target, id), iosDeviceType(this, this) { - auto executableAspect = addAspect<ExecutableAspect>(); - executableAspect->setDeviceSelector(target, ExecutableAspect::RunDevice); + executable.setDeviceSelector(target, ExecutableAspect::RunDevice); - auto argsAspect = addAspect<ArgumentsAspect>(); - argsAspect->setMacroExpander(macroExpander()); + arguments.setMacroExpander(macroExpander()); - m_deviceTypeAspect = addAspect<IosDeviceTypeAspect>(this); - - setUpdater([this, target, executableAspect] { + setUpdater([this, target] { IDevice::ConstPtr dev = DeviceKitAspect::device(target->kit()); const QString devName = dev.isNull() ? IosDevice::name() : dev->displayName(); setDefaultDisplayName(Tr::tr("Run on %1").arg(devName)); setDisplayName(Tr::tr("Run %1 on %2").arg(applicationName()).arg(devName)); - executableAspect->setExecutable(localExecutable()); - - m_deviceTypeAspect->updateDeviceType(); + executable.setExecutable(localExecutable()); + iosDeviceType.updateDeviceType(); }); } @@ -279,7 +274,7 @@ QString IosRunConfiguration::disabledReason() const IosDeviceType IosRunConfiguration::deviceType() const { - return m_deviceTypeAspect->deviceType(); + return iosDeviceType.deviceType(); } IosDeviceType IosDeviceTypeAspect::deviceType() const @@ -311,8 +306,8 @@ void IosDeviceTypeAspect::setDeviceType(const IosDeviceType &deviceType) m_deviceType = deviceType; } -IosDeviceTypeAspect::IosDeviceTypeAspect(IosRunConfiguration *runConfiguration) - : m_runConfiguration(runConfiguration) +IosDeviceTypeAspect::IosDeviceTypeAspect(AspectContainer *container, IosRunConfiguration *rc) + : BaseAspect(container), m_runConfiguration(rc) { addDataExtractor(this, &IosDeviceTypeAspect::deviceType, &Data::deviceType); addDataExtractor(this, &IosDeviceTypeAspect::bundleDirectory, &Data::bundleDirectory); diff --git a/src/plugins/ios/iosrunconfiguration.h b/src/plugins/ios/iosrunconfiguration.h index 1ebe79efa56..813a0c5524f 100644 --- a/src/plugins/ios/iosrunconfiguration.h +++ b/src/plugins/ios/iosrunconfiguration.h @@ -8,6 +8,7 @@ #include "iossimulator.h" #include <projectexplorer/runconfiguration.h> +#include <projectexplorer/runconfigurationaspects.h> #include <utils/fileutils.h> @@ -23,7 +24,8 @@ class IosDeviceTypeAspect : public Utils::BaseAspect Q_OBJECT public: - explicit IosDeviceTypeAspect(IosRunConfiguration *runConfiguration); + explicit IosDeviceTypeAspect(Utils::AspectContainer *container, + IosRunConfiguration *runConfiguration); void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; @@ -74,7 +76,9 @@ public: private: bool isEnabled() const final; - IosDeviceTypeAspect *m_deviceTypeAspect = nullptr; + ProjectExplorer::ExecutableAspect executable{this}; + ProjectExplorer::ArgumentsAspect arguments{this}; + IosDeviceTypeAspect iosDeviceType; }; class IosRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory From 08bbe885b49d6782178f0bc7b19c1bb162633666 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 21 Jul 2023 09:21:20 +0200 Subject: [PATCH 0461/1777] Examples: Support manifest-defined category order Reads a separate sorted list of categories from the manifest files. The first of these lists that is found in the manifest files is used. For example the Qt documentation defines the list in the manifest file for qtdoc. Change-Id: I57c2779862a5ebfc27707b53d43d4ed9e7e8c5f9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/qtsupport/exampleslistmodel.cpp | 10 ++-- src/plugins/qtsupport/examplesparser.cpp | 47 ++++++++++++++----- src/plugins/qtsupport/examplesparser.h | 11 ++++- src/plugins/qtsupport/qtcreator_tutorials.xml | 6 +++ tests/auto/examples/tst_examples.cpp | 47 ++++++++++++++----- 5 files changed, 92 insertions(+), 29 deletions(-) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index a35015d6aa8..6835ec60009 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -355,13 +355,14 @@ void ExamplesViewController::updateExamples() &qtVersion); m_view->clear(); + QStringList categoryOrder; QList<ExampleItem *> items; for (const QString &exampleSource : sources) { const auto manifest = FilePath::fromUserInput(exampleSource); qCDebug(log) << QString::fromLatin1("Reading file \"%1\"...") .arg(manifest.absoluteFilePath().toUserOutput()); - const expected_str<QList<ExampleItem *>> result + const expected_str<ParsedExamples> result = parseExamples(manifest, FilePath::fromUserInput(examplesInstallPath), FilePath::fromUserInput(demosInstallPath), @@ -371,7 +372,9 @@ void ExamplesViewController::updateExamples() << result.error(); continue; } - items += filtered(*result, isValidExampleOrDemo); + items += filtered(result->items, isValidExampleOrDemo); + if (categoryOrder.isEmpty()) + categoryOrder = result->categoryOrder; } if (m_isExamples) { @@ -386,7 +389,8 @@ void ExamplesViewController::updateExamples() } const bool sortIntoCategories = !m_isExamples || qtVersion >= *minQtVersionForCategories; - const QStringList order = m_isExamples ? *defaultOrder : QStringList(); + const QStringList order = categoryOrder.isEmpty() && m_isExamples ? *defaultOrder + : categoryOrder; const QList<std::pair<Section, QList<ExampleItem *>>> sections = getCategories(items, sortIntoCategories, order, m_isExamples); for (int i = 0; i < sections.size(); ++i) { diff --git a/src/plugins/qtsupport/examplesparser.cpp b/src/plugins/qtsupport/examplesparser.cpp index f961846e1d7..eb082f08f8e 100644 --- a/src/plugins/qtsupport/examplesparser.cpp +++ b/src/plugins/qtsupport/examplesparser.cpp @@ -75,6 +75,26 @@ static QHash<QString, QStringList> parseMeta(QXmlStreamReader *reader) return result; } +static QStringList parseCategories(QXmlStreamReader *reader) +{ + QStringList categoryOrder; + while (!reader->atEnd()) { + switch (reader->readNext()) { + case QXmlStreamReader::StartElement: + if (reader->name() == QLatin1String("category")) + categoryOrder.append(reader->readElementText()); + break; + case QXmlStreamReader::EndElement: + if (reader->name() == QLatin1String("categories")) + return categoryOrder; + break; + default: + break; + } + } + return categoryOrder; +} + static QList<ExampleItem *> parseExamples(QXmlStreamReader *reader, const FilePath &projectsOffset, const FilePath &examplesInstallPath) @@ -257,10 +277,10 @@ static QList<ExampleItem *> parseTutorials(QXmlStreamReader *reader, const FileP return result; } -expected_str<QList<ExampleItem *>> parseExamples(const FilePath &manifest, - const FilePath &examplesInstallPath, - const FilePath &demosInstallPath, - const bool examples) +expected_str<ParsedExamples> parseExamples(const FilePath &manifest, + const FilePath &examplesInstallPath, + const FilePath &demosInstallPath, + const bool examples) { const expected_str<QByteArray> contents = manifest.fileContents(); if (!contents) @@ -269,19 +289,22 @@ expected_str<QList<ExampleItem *>> parseExamples(const FilePath &manifest, return parseExamples(*contents, manifest, examplesInstallPath, demosInstallPath, examples); } -expected_str<QList<ExampleItem *>> parseExamples(const QByteArray &manifestData, - const Utils::FilePath &manifestPath, - const FilePath &examplesInstallPath, - const FilePath &demosInstallPath, - const bool examples) +expected_str<ParsedExamples> parseExamples(const QByteArray &manifestData, + const Utils::FilePath &manifestPath, + const FilePath &examplesInstallPath, + const FilePath &demosInstallPath, + const bool examples) { const FilePath path = manifestPath.parentDir(); + QStringList categoryOrder; QList<ExampleItem *> items; QXmlStreamReader reader(manifestData); while (!reader.atEnd()) { switch (reader.readNext()) { case QXmlStreamReader::StartElement: - if (examples && reader.name() == QLatin1String("examples")) + if (categoryOrder.isEmpty() && reader.name() == QLatin1String("categories")) + categoryOrder = parseCategories(&reader); + else if (examples && reader.name() == QLatin1String("examples")) items += parseExamples(&reader, path, examplesInstallPath); else if (examples && reader.name() == QLatin1String("demos")) items += parseDemos(&reader, path, demosInstallPath); @@ -301,7 +324,7 @@ expected_str<QList<ExampleItem *>> parseExamples(const QByteArray &manifestData, .arg(reader.columnNumber()) .arg(reader.errorString())); } - return items; + return {{items, categoryOrder}}; } static bool sortByHighlightedAndName(ExampleItem *first, ExampleItem *second) @@ -355,7 +378,7 @@ QList<std::pair<Core::Section, QList<ExampleItem *>>> getCategories(const QList< } else { // All original items have been copied into a category or other, delete. qDeleteAll(items); - static const int defaultOrderSize = defaultOrder.size(); + const int defaultOrderSize = defaultOrder.size(); int index = 0; const auto end = categoryMap.constKeyValueEnd(); for (auto it = categoryMap.constKeyValueBegin(); it != end; ++it) { diff --git a/src/plugins/qtsupport/examplesparser.h b/src/plugins/qtsupport/examplesparser.h index d57e7a536ad..aee539ad62b 100644 --- a/src/plugins/qtsupport/examplesparser.h +++ b/src/plugins/qtsupport/examplesparser.h @@ -31,13 +31,20 @@ public: QHash<QString, QStringList> metaData; }; -QTSUPPORT_TEST_EXPORT Utils::expected_str<QList<ExampleItem *>> parseExamples( +class QTSUPPORT_TEST_EXPORT ParsedExamples +{ +public: + QList<ExampleItem *> items; + QStringList categoryOrder; +}; + +QTSUPPORT_TEST_EXPORT Utils::expected_str<ParsedExamples> parseExamples( const Utils::FilePath &manifest, const Utils::FilePath &examplesInstallPath, const Utils::FilePath &demosInstallPath, bool examples); -QTSUPPORT_TEST_EXPORT Utils::expected_str<QList<ExampleItem *>> parseExamples( +QTSUPPORT_TEST_EXPORT Utils::expected_str<ParsedExamples> parseExamples( const QByteArray &manifestData, const Utils::FilePath &manifestPath, const Utils::FilePath &examplesInstallPath, diff --git a/src/plugins/qtsupport/qtcreator_tutorials.xml b/src/plugins/qtsupport/qtcreator_tutorials.xml index f374f1b6301..af657454432 100644 --- a/src/plugins/qtsupport/qtcreator_tutorials.xml +++ b/src/plugins/qtsupport/qtcreator_tutorials.xml @@ -1,5 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <instructionals module="Qt"> + <categories> + <category>Help</category> + <category>Learning</category> + <category>Online</category> + <category>Talk</category> + </categories> <tutorials> <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/creator-build-example-application.html" projectPath="" name="Building and Running an Example"> <description><![CDATA[Testing that your installation is successful by opening an existing example application project.]]></description> diff --git a/tests/auto/examples/tst_examples.cpp b/tests/auto/examples/tst_examples.cpp index e01336d65a8..5d30c8710b5 100644 --- a/tests/auto/examples/tst_examples.cpp +++ b/tests/auto/examples/tst_examples.cpp @@ -90,9 +90,11 @@ void tst_Examples::parsing_data() QTest::addColumn<QStringList>("platforms"); QTest::addColumn<MetaData>("metaData"); QTest::addColumn<QStringList>("categories"); + QTest::addColumn<QStringList>("categoryOrder"); QTest::addRow("example") << QByteArray(R"raw( + <instructionals module="Qt"> <examples> <example docUrl="qthelp://org.qt-project.qtwidgets.660/qtwidgets/qtwidgets-widgets-analogclock-example.html" imageUrl="qthelp://org.qt-project.qtwidgets.660/qtwidgets/images/analogclock-example.png" @@ -110,6 +112,13 @@ void tst_Examples::parsing_data() </meta> </example> </examples> + <categories> + <category>Application Examples</category> + <category>Desktop</category> + <category>Mobile</category> + <category>Embedded</category> + </categories> + </instructionals> )raw") << /*isExamples=*/true << "Analog Clock" << "The Analog Clock example shows how to draw the contents of a custom widget." @@ -126,23 +135,33 @@ void tst_Examples::parsing_data() << FilePaths() << Example << true << false << false << "" << "" << QStringList() << MetaData({{"category", {"Graphics", "Graphics", "Foobar"}}, {"tags", {"widgets"}}}) - << QStringList{"Foobar", "Graphics"}; + << QStringList{"Foobar", "Graphics"} + << QStringList{"Application Examples", "Desktop", "Mobile", "Embedded"}; QTest::addRow("no category, highlighted") << QByteArray(R"raw( + <instructionals module="Qt"> <examples> <example name="No Category, highlighted" isHighlighted="true"> </example> </examples> + </instructionals> )raw") << /*isExamples=*/true << "No Category, highlighted" << QString() << QString() << QStringList() << FilePath("examples") << QString() << FilePaths() << FilePath() << FilePaths() << Example << /*hasSourceCode=*/false << false << /*isHighlighted=*/true << "" - << "" << QStringList() << MetaData() << QStringList{"Featured"}; + << "" << QStringList() << MetaData() << QStringList{"Featured"} << QStringList(); QTest::addRow("tutorial with category") << QByteArray(R"raw( + <instructionals module="Qt"> + <categories> + <category>Help</category> + <category>Learning</category> + <category>Online</category> + <category>Talk</category> + </categories> <tutorials> <tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/dummytutorial.html" projectPath="" name="A tutorial"> <description><![CDATA[A dummy tutorial.]]></description> @@ -152,6 +171,7 @@ void tst_Examples::parsing_data() </meta> </tutorial> </tutorials> + </instructionals> )raw") << /*isExamples=*/false << "A tutorial" << "A dummy tutorial." @@ -160,7 +180,8 @@ void tst_Examples::parsing_data() << "qthelp://org.qt-project.qtcreator/doc/dummytutorial.html" << FilePaths() << FilePath() << FilePaths() << Tutorial << /*hasSourceCode=*/false << /*isVideo=*/false << /*isHighlighted=*/false << QString() << QString() << QStringList() - << MetaData({{"category", {"Help"}}}) << QStringList("Help"); + << MetaData({{"category", {"Help"}}}) << QStringList("Help") + << QStringList{"Help", "Learning", "Online", "Talk"}; } void tst_Examples::parsing() @@ -168,16 +189,18 @@ void tst_Examples::parsing() QFETCH(QByteArray, data); QFETCH(bool, isExamples); QFETCH(QStringList, categories); + QFETCH(QStringList, categoryOrder); const ExampleItem expected = fetchItem(); - const expected_str<QList<ExampleItem *>> result - = parseExamples(data, - FilePath("manifest/examples-manifest.xml"), - FilePath("examples"), - FilePath("demos"), - isExamples); + const expected_str<ParsedExamples> result = parseExamples(data, + FilePath( + "manifest/examples-manifest.xml"), + FilePath("examples"), + FilePath("demos"), + isExamples); QVERIFY(result); - QCOMPARE(result->size(), 1); - const ExampleItem item = *result->at(0); + QCOMPARE(result->categoryOrder, categoryOrder); + QCOMPARE(result->items.size(), 1); + const ExampleItem item = *result->items.at(0); QCOMPARE(item.name, expected.name); QCOMPARE(item.description, expected.description); QCOMPARE(item.imageUrl, expected.imageUrl); @@ -197,7 +220,7 @@ void tst_Examples::parsing() QCOMPARE(item.metaData, expected.metaData); const QList<std::pair<Section, QList<ExampleItem *>>> resultCategories - = getCategories(*result, true, {}, true); + = getCategories(result->items, true, {}, true); QCOMPARE(resultCategories.size(), categories.size()); for (int i = 0; i < resultCategories.size(); ++i) { QCOMPARE(resultCategories.at(i).first.name, categories.at(i)); From 773a28acea32953f5e8cb14e3ac496c93d7fab98 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 19 Jul 2023 09:59:00 +0200 Subject: [PATCH 0462/1777] Valgrind: Move global settings handling closer to current pattern Change-Id: I41f35485ef51b977ee75fec53dbf0c8d75a27461 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../projectexplorer/runconfiguration.h | 1 - src/plugins/valgrind/callgrindtool.cpp | 20 ++++------ src/plugins/valgrind/memchecktool.cpp | 10 ++--- src/plugins/valgrind/valgrindconfigwidget.cpp | 37 +++++++++++-------- src/plugins/valgrind/valgrindconfigwidget.h | 8 +--- src/plugins/valgrind/valgrindplugin.cpp | 5 +-- src/plugins/valgrind/valgrindsettings.cpp | 23 +++++------- src/plugins/valgrind/valgrindsettings.h | 4 +- 8 files changed, 47 insertions(+), 61 deletions(-) diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index bae6a01cfc4..c4bba4760c8 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -77,7 +77,6 @@ public: void resetProjectToGlobalSettings(); ISettingsAspect *projectSettings() const { return m_projectSettings; } - ISettingsAspect *globalSettings() const { return m_globalSettings; } ISettingsAspect *currentSettings() const; struct Data : Utils::BaseAspect::Data diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index f89aa58b8c9..85ad9a76f08 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -342,8 +342,6 @@ CallgrindToolPrivate::CallgrindToolPrivate() updateCostFormat(); - ValgrindGlobalSettings *settings = ValgrindGlobalSettings::instance(); - // // Control Widget // @@ -360,8 +358,8 @@ CallgrindToolPrivate::CallgrindToolPrivate() Theme::IconsBaseColor}}); action->setIcon(kCachegrindIcon.icon()); action->setToolTip(Tr::tr("Open results in KCachegrind.")); - connect(action, &QAction::triggered, this, [this, settings] { - Process::startDetached({settings->kcachegrindExecutable(), { m_lastFileName }}); + connect(action, &QAction::triggered, this, [this] { + Process::startDetached({globalSettings().kcachegrindExecutable(), { m_lastFileName }}); }); // dump action @@ -468,7 +466,7 @@ CallgrindToolPrivate::CallgrindToolPrivate() } // Filtering - action = m_filterProjectCosts = settings->filterExternalIssues.action(); + action = m_filterProjectCosts = globalSettings().filterExternalIssues.action(); connect(action, &QAction::toggled, this, &CallgrindToolPrivate::handleFilterProjectCosts); // Filter @@ -477,10 +475,10 @@ CallgrindToolPrivate::CallgrindToolPrivate() connect(m_searchFilter, &QLineEdit::textChanged, &m_updateTimer, QOverload<>::of(&QTimer::start)); - setCostFormat(CostDelegate::CostFormat(settings->costFormat())); + setCostFormat(CostDelegate::CostFormat(globalSettings().costFormat())); - m_perspective.addToolBarAction(settings->detectCycles.action()); - m_perspective.addToolBarAction(settings->shortenTemplates.action()); + m_perspective.addToolBarAction(globalSettings().detectCycles.action()); + m_perspective.addToolBarAction(globalSettings().shortenTemplates.action()); m_perspective.addToolBarAction(m_filterProjectCosts); m_perspective.addToolBarWidget(m_searchFilter); @@ -625,8 +623,7 @@ void CallgrindToolPrivate::updateCostFormat() m_calleesView->setCostFormat(format); m_callersView->setCostFormat(format); } - if (ValgrindGlobalSettings *settings = ValgrindGlobalSettings::instance()) - settings->costFormat.setValue(format); + globalSettings().costFormat.setValue(format); } void CallgrindToolPrivate::handleFilterProjectCosts() @@ -908,8 +905,7 @@ void CallgrindToolPrivate::takeParserData(ParseData *data) doClear(true); setParseData(data); - const FilePath kcachegrindExecutable = - ValgrindGlobalSettings::instance()->kcachegrindExecutable(); + const FilePath kcachegrindExecutable = globalSettings().kcachegrindExecutable(); const FilePath found = kcachegrindExecutable.searchInPath(); const bool kcachegrindExists = found.isExecutableFile(); m_startKCachegrind->setEnabled(kcachegrindExists && !m_lastFileName.isEmpty()); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index e179e8c4f55..f08b3a7f3ce 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -519,7 +519,7 @@ private: MemcheckToolPrivate::MemcheckToolPrivate() { - m_settings = ValgrindGlobalSettings::instance(); + m_settings = &globalSettings(); setObjectName("MemcheckTool"); @@ -904,7 +904,7 @@ void MemcheckToolPrivate::updateRunActions() void MemcheckToolPrivate::settingsDestroyed(QObject *settings) { QTC_ASSERT(m_settings == settings, return); - m_settings = ValgrindGlobalSettings::instance(); + m_settings = &globalSettings(); } void MemcheckToolPrivate::updateFromSettings() @@ -943,7 +943,7 @@ void MemcheckToolPrivate::maybeActiveRunConfigurationChanged() settings = rc->currentSettings<ValgrindBaseSettings>(ANALYZER_VALGRIND_SETTINGS); if (!settings) // fallback to global settings - settings = ValgrindGlobalSettings::instance(); + settings = &globalSettings(); if (m_settings == settings) return; @@ -1045,8 +1045,8 @@ void MemcheckToolPrivate::loadXmlLogFile(const QString &filePath) clearErrorView(); m_loadExternalLogFile->setDisabled(true); - if (!m_settings || m_settings != ValgrindGlobalSettings::instance()) { - m_settings = ValgrindGlobalSettings::instance(); + if (!m_settings || m_settings != &globalSettings()) { + m_settings = &globalSettings(); m_errorView->settingsChanged(m_settings); updateFromSettings(); } diff --git a/src/plugins/valgrind/valgrindconfigwidget.cpp b/src/plugins/valgrind/valgrindconfigwidget.cpp index 2200eb5b254..cbd2339ecfc 100644 --- a/src/plugins/valgrind/valgrindconfigwidget.cpp +++ b/src/plugins/valgrind/valgrindconfigwidget.cpp @@ -16,8 +16,7 @@ using namespace Utils; -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { class ValgrindConfigWidget : public Core::IOptionsPageWidget { @@ -26,13 +25,13 @@ public: void apply() final { - ValgrindGlobalSettings::instance()->apply(); - ValgrindGlobalSettings::instance()->writeSettings(); + globalSettings().apply(); + globalSettings().writeSettings(); } void finish() final { - ValgrindGlobalSettings::instance()->finish(); + globalSettings().finish(); } }; @@ -87,20 +86,26 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings) // ValgrindOptionsPage -ValgrindOptionsPage::ValgrindOptionsPage() +class ValgrindOptionsPage final : public Core::IOptionsPage { - setId(ANALYZER_VALGRIND_SETTINGS); - setDisplayName(Tr::tr("Valgrind")); - setCategory("T.Analyzer"); - setDisplayCategory(::Debugger::Tr::tr("Analyzer")); - setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); - setWidgetCreator([] { return new ValgrindConfigWidget(ValgrindGlobalSettings::instance()); }); -} +public: + ValgrindOptionsPage() + { + setId(ANALYZER_VALGRIND_SETTINGS); + setDisplayName(Tr::tr("Valgrind")); + setCategory("T.Analyzer"); + setDisplayCategory(::Debugger::Tr::tr("Analyzer")); + setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); + setWidgetCreator([] { return new ValgrindConfigWidget(&globalSettings()); }); + } +}; -QWidget *ValgrindOptionsPage::createSettingsWidget(ValgrindBaseSettings *settings) +const ValgrindOptionsPage settingsPage; + + +QWidget *createSettingsWidget(ValgrindBaseSettings *settings) { return new ValgrindConfigWidget(settings); } -} // namespace Internal -} // namespace Valgrind +} // Valgrind::Internal diff --git a/src/plugins/valgrind/valgrindconfigwidget.h b/src/plugins/valgrind/valgrindconfigwidget.h index b6353cc2ef7..fe77030e914 100644 --- a/src/plugins/valgrind/valgrindconfigwidget.h +++ b/src/plugins/valgrind/valgrindconfigwidget.h @@ -7,12 +7,6 @@ namespace Valgrind::Internal { -class ValgrindOptionsPage final : public Core::IOptionsPage -{ -public: - ValgrindOptionsPage(); - - static QWidget *createSettingsWidget(class ValgrindBaseSettings *settings); -}; +QWidget *createSettingsWidget(class ValgrindBaseSettings *settings); } // Valgrind::Internal diff --git a/src/plugins/valgrind/valgrindplugin.cpp b/src/plugins/valgrind/valgrindplugin.cpp index fad8db5c980..3b3a8156163 100644 --- a/src/plugins/valgrind/valgrindplugin.cpp +++ b/src/plugins/valgrind/valgrindplugin.cpp @@ -7,7 +7,6 @@ #include "valgrindsettings.h" #include "valgrindtr.h" -#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icontext.h> #include <coreplugin/icore.h> @@ -34,7 +33,7 @@ public: ValgrindRunConfigurationAspect(Target *) { setProjectSettings(new ValgrindProjectSettings); - setGlobalSettings(ValgrindGlobalSettings::instance()); + setGlobalSettings(&globalSettings()); setId(ANALYZER_VALGRIND_SETTINGS); setDisplayName(Tr::tr("Valgrind Settings")); setUsingGlobalSettings(true); @@ -46,10 +45,8 @@ public: class ValgrindPluginPrivate { public: - ValgrindGlobalSettings valgrindGlobalSettings; // Needs to come before the tools. MemcheckTool memcheckTool; CallgrindTool callgrindTool; - ValgrindOptionsPage valgrindOptionsPage; }; class ValgrindPlugin final : public ExtensionSystem::IPlugin diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 198312f2f5c..c4e49e8d4ae 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -59,18 +59,16 @@ void SuppressionAspect::addSuppressionFile(const FilePath &suppression) void SuppressionAspectPrivate::slotAddSuppression() { - ValgrindGlobalSettings *conf = ValgrindGlobalSettings::instance(); - QTC_ASSERT(conf, return); const FilePaths files = FileUtils::getOpenFilePaths(nullptr, Tr::tr("Valgrind Suppression Files"), - conf->lastSuppressionDirectory(), + globalSettings().lastSuppressionDirectory(), Tr::tr("Valgrind Suppression File (*.supp);;All Files (*)")); //dialog.setHistory(conf->lastSuppressionDialogHistory()); if (!files.isEmpty()) { for (const FilePath &file : files) m_model.appendRow(new QStandardItem(file.toString())); - conf->lastSuppressionDirectory.setValue(files.at(0).absolutePath()); + globalSettings().lastSuppressionDirectory.setValue(files.at(0).absolutePath()); //conf->setLastSuppressionDialogHistory(dialog.history()); if (!isGlobal) q->apply(); @@ -327,13 +325,15 @@ ValgrindBaseSettings::ValgrindBaseSettings(bool global) // ////////////////////////////////////////////////////////////////// -static ValgrindGlobalSettings *theGlobalSettings = nullptr; +ValgrindGlobalSettings &globalSettings() +{ + static ValgrindGlobalSettings theSettings; + return theSettings; +} ValgrindGlobalSettings::ValgrindGlobalSettings() : ValgrindBaseSettings(true) { - theGlobalSettings = this; - const QString base = "Analyzer.Valgrind"; lastSuppressionDirectory.setSettingsKey(base + "LastSuppressionDirectory"); @@ -355,17 +355,12 @@ ValgrindGlobalSettings::ValgrindGlobalSettings() shortenTemplates.setLabelText("<>"); // FIXME: Create a real icon shortenTemplates.setToolTip(Tr::tr("Remove template parameter lists when displaying function names.")); - setConfigWidgetCreator([this] { return ValgrindOptionsPage::createSettingsWidget(this); }); + setConfigWidgetCreator([this] { return createSettingsWidget(this); }); readSettings(); setAutoApply(false); } -ValgrindGlobalSettings *ValgrindGlobalSettings::instance() -{ - return theGlobalSettings; -} - // // Memcheck // @@ -417,7 +412,7 @@ void ValgrindGlobalSettings::writeSettings() const ValgrindProjectSettings::ValgrindProjectSettings() : ValgrindBaseSettings(false) { - setConfigWidgetCreator([this] { return ValgrindOptionsPage::createSettingsWidget(this); }); + setConfigWidgetCreator([this] { return createSettingsWidget(this); }); connect(this, &AspectContainer::fromMapFinished, [this] { // FIXME: Update project page e.g. on "Restore Global", aspects diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index 5f68e93f2c2..eb4ef4e867b 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -111,8 +111,6 @@ class ValgrindGlobalSettings : public ValgrindBaseSettings public: ValgrindGlobalSettings(); - static ValgrindGlobalSettings *instance(); - /** * Global memcheck settings */ @@ -132,6 +130,8 @@ public: Utils::BoolAspect shortenTemplates{this}; }; +ValgrindGlobalSettings &globalSettings(); + /** * Per-project valgrind settings. From b6eedab12315d5eff13fa1d3a6d1dbd55c8ec709 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 24 Jul 2023 13:50:41 +0200 Subject: [PATCH 0463/1777] QtSupport: Omit default parameter Less noise. Change-Id: I5ea7f258b10a35374afb161b63729a5a4fa4ab2b Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/qtsupport/examplesparser.cpp | 41 ++++++++---------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/src/plugins/qtsupport/examplesparser.cpp b/src/plugins/qtsupport/examplesparser.cpp index eb082f08f8e..293c19ecb8f 100644 --- a/src/plugins/qtsupport/examplesparser.cpp +++ b/src/plugins/qtsupport/examplesparser.cpp @@ -58,8 +58,7 @@ static QHash<QString, QStringList> parseMeta(QXmlStreamReader *reader) reader->raiseError("Tag \"entry\" requires \"name\" attribute"); break; } - const QString value = reader->readElementText( - QXmlStreamReader::ErrorOnUnexpectedElement); + const QString value = reader->readElementText(); if (!value.isEmpty()) result[key].append(value); } @@ -125,28 +124,22 @@ static QList<ExampleItem *> parseExamples(QXmlStreamReader *reader, const QString mainFileAttribute = reader->attributes().value(QLatin1String("mainFile")).toString(); const FilePath filePath - = relativeOrInstallPath(FilePath::fromUserInput(reader->readElementText( - QXmlStreamReader::ErrorOnUnexpectedElement)), + = relativeOrInstallPath(FilePath::fromUserInput(reader->readElementText()), projectsOffset, examplesInstallPath); item->filesToOpen.append(filePath); if (mainFileAttribute.compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) item->mainFile = filePath; } else if (reader->name() == QLatin1String("description")) { - item->description = fixStringForTags( - reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement)); + item->description = fixStringForTags(reader->readElementText()); } else if (reader->name() == QLatin1String("dependency")) { - item->dependencies.append( - projectsOffset - / reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement)); + item->dependencies.append(projectsOffset / reader->readElementText()); } else if (reader->name() == QLatin1String("tags")) { item->tags = trimStringList( - reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement) - .split(QLatin1Char(','), Qt::SkipEmptyParts)); + reader->readElementText().split(QLatin1Char(','), Qt::SkipEmptyParts)); } else if (reader->name() == QLatin1String("platforms")) { item->platforms = trimStringList( - reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement) - .split(QLatin1Char(','), Qt::SkipEmptyParts)); + reader->readElementText().split(QLatin1Char(','), Qt::SkipEmptyParts)); } else if (reader->name() == QLatin1String("meta")) { item->metaData = parseMeta(reader); } @@ -192,20 +185,18 @@ static QList<ExampleItem *> parseDemos(QXmlStreamReader *reader, == QLatin1String("true"); } else if (reader->name() == QLatin1String("fileToOpen")) { item->filesToOpen.append( - relativeOrInstallPath(FilePath::fromUserInput(reader->readElementText( - QXmlStreamReader::ErrorOnUnexpectedElement)), + relativeOrInstallPath(FilePath::fromUserInput(reader->readElementText()), projectsOffset, demosInstallPath)); } else if (reader->name() == QLatin1String("description")) { item->description = fixStringForTags( - reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement)); + reader->readElementText()); } else if (reader->name() == QLatin1String("dependency")) { item->dependencies.append( projectsOffset - / reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement)); + / reader->readElementText()); } else if (reader->name() == QLatin1String("tags")) { - item->tags = reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement) - .split(QLatin1Char(',')); + item->tags = reader->readElementText().split(QLatin1Char(',')); } break; case QXmlStreamReader::EndElement: @@ -249,17 +240,13 @@ static QList<ExampleItem *> parseTutorials(QXmlStreamReader *reader, const FileP } else if (reader->name() == QLatin1String("fileToOpen")) { item->filesToOpen.append( projectsOffset - / reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement)); + / reader->readElementText()); } else if (reader->name() == QLatin1String("description")) { - item->description = fixStringForTags( - reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement)); + item->description = fixStringForTags(reader->readElementText()); } else if (reader->name() == QLatin1String("dependency")) { - item->dependencies.append( - projectsOffset - / reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement)); + item->dependencies.append(projectsOffset / reader->readElementText()); } else if (reader->name() == QLatin1String("tags")) { - item->tags = reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement) - .split(QLatin1Char(',')); + item->tags = reader->readElementText().split(QLatin1Char(',')); } else if (reader->name() == QLatin1String("meta")) { item->metaData = parseMeta(reader); } From 4997a23f15f5bb2cdb8deb979aeedf1f8c771929 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 14 Jul 2023 20:50:05 +0200 Subject: [PATCH 0464/1777] QbsProjectManager: Introduce QbsRequest It's going to be used in task tree for QbsBuildStep, QbsCleanStep and QbsInstallStep. Change-Id: I347562b72a628b66d648f943c2fbf67df69c0bc5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/qbsprojectmanager/CMakeLists.txt | 1 + .../qbsprojectmanager/qbsprojectmanager.qbs | 2 + src/plugins/qbsprojectmanager/qbsrequest.cpp | 88 +++++++++++++++++++ src/plugins/qbsprojectmanager/qbsrequest.h | 52 +++++++++++ 4 files changed, 143 insertions(+) create mode 100644 src/plugins/qbsprojectmanager/qbsrequest.cpp create mode 100644 src/plugins/qbsprojectmanager/qbsrequest.h diff --git a/src/plugins/qbsprojectmanager/CMakeLists.txt b/src/plugins/qbsprojectmanager/CMakeLists.txt index 885edbf0bf7..3408e3f3ad0 100644 --- a/src/plugins/qbsprojectmanager/CMakeLists.txt +++ b/src/plugins/qbsprojectmanager/CMakeLists.txt @@ -25,6 +25,7 @@ add_qtc_plugin(QbsProjectManager qbsprojectmanagerconstants.h qbsprojectmanagerplugin.cpp qbsprojectmanagerplugin.h qbsprojectparser.cpp qbsprojectparser.h + qbsrequest.cpp qbsrequest.h qbssession.cpp qbssession.h qbssettings.cpp qbssettings.h ) diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs index 727507dda13..b5d671e8df9 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs +++ b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs @@ -54,6 +54,8 @@ QtcPlugin { "qbsprojectmanagerplugin.h", "qbsprojectparser.cpp", "qbsprojectparser.h", + "qbsrequest.cpp", + "qbsrequest.h", "qbssession.cpp", "qbssession.h", "qbssettings.cpp", diff --git a/src/plugins/qbsprojectmanager/qbsrequest.cpp b/src/plugins/qbsprojectmanager/qbsrequest.cpp new file mode 100644 index 00000000000..78624cfcead --- /dev/null +++ b/src/plugins/qbsprojectmanager/qbsrequest.cpp @@ -0,0 +1,88 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "qbsrequest.h" + +#include "qbsprojectmanagertr.h" +#include "qbssession.h" + +#include <projectexplorer/task.h> + +#include <utils/commandline.h> +#include <utils/qtcassert.h> + +using namespace ProjectExplorer; +using namespace Tasking; +using namespace Utils; + +namespace QbsProjectManager::Internal { + +QbsRequest::~QbsRequest() +{ + if (m_isRunning) + m_session->cancelCurrentJob(); +} + +void QbsRequest::setSession(QbsSession *session) +{ + QTC_ASSERT(!m_isRunning, return); + m_session = session; +} + +void QbsRequest::start() +{ + QTC_ASSERT(!m_isRunning, return); + QTC_ASSERT(m_session, emit done(false); return); + QTC_ASSERT(m_requestData, emit done(false); return); + + const auto handleDone = [this](const ErrorInfo &error) { + m_isRunning = false; + m_session->disconnect(this); + for (const ErrorInfoItem &item : error.items) { + emit outputAdded(item.description, BuildStep::OutputFormat::Stdout); + emit taskAdded(CompileTask(Task::Error, item.description, item.filePath, item.line)); + } + emit done(error.items.isEmpty()); + }; + connect(m_session, &QbsSession::projectBuilt, this, handleDone); + connect(m_session, &QbsSession::projectCleaned, this, handleDone); + connect(m_session, &QbsSession::projectInstalled, this, handleDone); + connect(m_session, &QbsSession::errorOccurred, this, [handleDone](QbsSession::Error error) { + handleDone(ErrorInfo(QbsSession::errorString(error))); + }); + connect(m_session, &QbsSession::taskStarted, this, [this](const QString &desciption, int max) { + m_description = desciption; + m_maxProgress = max; + }); + connect(m_session, &QbsSession::maxProgressChanged, this, [this](int max) { + m_maxProgress = max; + }); + connect(m_session, &QbsSession::taskProgress, this, [this](int progress) { + if (m_maxProgress > 0) + emit progressChanged(progress * 100 / m_maxProgress, m_description); + }); + connect(m_session, &QbsSession::commandDescription, this, [this](const QString &message) { + emit outputAdded(message, BuildStep::OutputFormat::Stdout); + }); + connect(m_session, &QbsSession::processResult, this, [this](const FilePath &executable, + const QStringList &arguments, + const FilePath &workingDir, + const QStringList &stdOut, + const QStringList &stdErr, + bool success) { + Q_UNUSED(workingDir); + const bool hasOutput = !stdOut.isEmpty() || !stdErr.isEmpty(); + if (success && !hasOutput) + return; + emit outputAdded(executable.toUserOutput() + ' ' + ProcessArgs::joinArgs(arguments), + BuildStep::OutputFormat::Stdout); + for (const QString &line : stdErr) + emit outputAdded(line, BuildStep::OutputFormat::Stderr); + for (const QString &line : stdOut) + emit outputAdded(line, BuildStep::OutputFormat::Stdout); + }); + m_isRunning = true; + m_session->sendRequest(*m_requestData); +} + +} // namespace QbsProjectManager::Internal diff --git a/src/plugins/qbsprojectmanager/qbsrequest.h b/src/plugins/qbsprojectmanager/qbsrequest.h new file mode 100644 index 00000000000..12b00a83fb6 --- /dev/null +++ b/src/plugins/qbsprojectmanager/qbsrequest.h @@ -0,0 +1,52 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <projectexplorer/buildstep.h> + +#include <solutions/tasking/tasktree.h> + +#include <QJsonObject> + +namespace QbsProjectManager::Internal { + +class QbsSession; + +class QbsRequest final : public QObject +{ + Q_OBJECT + +public: + ~QbsRequest() override; + + void setSession(QbsSession *session); + void setRequestData(const QJsonObject &requestData) { m_requestData = requestData; } + void start(); + +signals: + void done(bool success); + void progressChanged(int progress, const QString &info); // progress in % + void outputAdded(const QString &output, ProjectExplorer::BuildStep::OutputFormat format); + void taskAdded(const ProjectExplorer::Task &task); + +private: + QbsSession *m_session = nullptr; + std::optional<QJsonObject> m_requestData; + bool m_isRunning = false; + QString m_description; + int m_maxProgress = 100; +}; + +class QbsRequestTaskAdapter : public Tasking::TaskAdapter<QbsRequest> +{ +public: + QbsRequestTaskAdapter() { connect(task(), &QbsRequest::done, this, &TaskInterface::done); } + +private: + void start() final { task()->start(); } +}; + +} // namespace QbsProjectManager::Internal + +TASKING_DECLARE_TASK(QbsRequestTask, QbsProjectManager::Internal::QbsRequestTaskAdapter); From aab5b73a31b83e15e9ba1cec306c0b142c7a070a Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 14 Jul 2023 21:55:52 +0200 Subject: [PATCH 0465/1777] QbsCleanStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I68e097747f8383d319d5c14eeb5bb9f1a94353a5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../qbsbuildconfiguration.cpp | 6 - .../qbsprojectmanager/qbscleanstep.cpp | 118 ++++++------------ src/plugins/qbsprojectmanager/qbscleanstep.h | 33 +---- 3 files changed, 38 insertions(+), 119 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index 243ac8cbf23..476bd5b071f 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -4,8 +4,6 @@ #include "qbsbuildconfiguration.h" #include "qbsbuildstep.h" -#include "qbscleanstep.h" -#include "qbsinstallstep.h" #include "qbsproject.h" #include "qbsprojectmanagerconstants.h" #include "qbsprojectmanagertr.h" @@ -144,10 +142,6 @@ QbsBuildConfiguration::~QbsBuildConfiguration() if (const auto qbs = qobject_cast<QbsBuildStep *>(bs)) qbs->dropSession(); } - for (BuildStep * const cs : cleanSteps()->steps()) { - if (const auto qcs = qobject_cast<QbsCleanStep *>(cs)) - qcs->dropSession(); - } delete m_buildSystem; } diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.cpp b/src/plugins/qbsprojectmanager/qbscleanstep.cpp index 9d6799a5fb1..475d38e9478 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.cpp +++ b/src/plugins/qbsprojectmanager/qbscleanstep.cpp @@ -4,32 +4,27 @@ #include "qbscleanstep.h" #include "qbsbuildconfiguration.h" -#include "qbsproject.h" #include "qbsprojectmanagerconstants.h" #include "qbsprojectmanagertr.h" +#include "qbsrequest.h" #include "qbssession.h" -#include <projectexplorer/buildsteplist.h> -#include <projectexplorer/kit.h> #include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/buildmanager.h> -#include <projectexplorer/target.h> -#include <utils/qtcassert.h> #include <QJsonArray> #include <QJsonObject> using namespace ProjectExplorer; +using namespace Tasking; using namespace Utils; -namespace QbsProjectManager { -namespace Internal { +namespace QbsProjectManager::Internal { // -------------------------------------------------------------------- // QbsCleanStep: // -------------------------------------------------------------------- -QbsCleanStep::QbsCleanStep(BuildStepList *bsl, Utils::Id id) +QbsCleanStep::QbsCleanStep(BuildStepList *bsl, Id id) : BuildStep(bsl, id) { setDisplayName(Tr::tr("Qbs Clean")); @@ -55,25 +50,11 @@ QbsCleanStep::QbsCleanStep(BuildStepList *bsl, Utils::Id id) }); } -QbsCleanStep::~QbsCleanStep() -{ - doCancel(); - if (m_session) - m_session->disconnect(this); -} - -void QbsCleanStep::dropSession() -{ - if (m_session) { - doCancel(); - m_session->disconnect(this); - m_session = nullptr; - } -} - bool QbsCleanStep::init() { - if (buildSystem()->isParsing() || m_session) + if (!BuildStep::init()) + return false; + if (buildSystem()->isParsing()) return false; const auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration()); if (!bc) @@ -82,64 +63,36 @@ bool QbsCleanStep::init() return true; } -void QbsCleanStep::doRun() +GroupItem QbsCleanStep::runRecipe() { - m_session = static_cast<QbsBuildSystem*>(buildSystem())->session(); - if (!m_session) { - emit addOutput(Tr::tr("No qbs session exists for this target."), OutputFormat::ErrorMessage); - emit finished(false); - return; - } + const auto onSetup = [this](QbsRequest &request) { + QbsSession *session = static_cast<QbsBuildSystem*>(buildSystem())->session(); + if (!session) { + emit addOutput(Tr::tr("No qbs session exists for this target."), + OutputFormat::ErrorMessage); + return SetupResult::StopWithError; + } + QJsonObject requestData; + requestData.insert("type", "clean-project"); + if (!m_products.isEmpty()) + requestData.insert("products", QJsonArray::fromStringList(m_products)); + requestData.insert("dry-run", dryRun()); + requestData.insert("keep-going", keepGoing()); - QJsonObject request; - request.insert("type", "clean-project"); - if (!m_products.isEmpty()) - request.insert("products", QJsonArray::fromStringList(m_products)); - request.insert("dry-run", dryRun()); - request.insert("keep-going", keepGoing()); - m_session->sendRequest(request); - m_maxProgress = 0; - connect(m_session, &QbsSession::projectCleaned, this, &QbsCleanStep::cleaningDone); - connect(m_session, &QbsSession::taskStarted, this, &QbsCleanStep::handleTaskStarted); - connect(m_session, &QbsSession::taskProgress, this, &QbsCleanStep::handleProgress); - connect(m_session, &QbsSession::errorOccurred, this, [this] { - cleaningDone(ErrorInfo(Tr::tr("Cleaning canceled: Qbs session failed."))); - }); -} + request.setSession(session); + request.setRequestData(requestData); + connect(&request, &QbsRequest::progressChanged, this, &BuildStep::progress); + connect(&request, &QbsRequest::outputAdded, this, + [this](const QString &output, OutputFormat format) { + emit addOutput(output, format); + }); + connect(&request, &QbsRequest::taskAdded, this, [this](const Task &task) { + emit addTask(task, 1); + }); + return SetupResult::Continue; + }; -void QbsCleanStep::doCancel() -{ - if (m_session) - m_session->cancelCurrentJob(); -} - -void QbsCleanStep::cleaningDone(const ErrorInfo &error) -{ - m_session->disconnect(this); - m_session = nullptr; - - for (const ErrorInfoItem &item : error.items) - createTaskAndOutput(Task::Error, item.description, item.filePath, item.line); - emit finished(!error.hasError()); -} - -void QbsCleanStep::handleTaskStarted(const QString &desciption, int max) -{ - Q_UNUSED(desciption) - m_maxProgress = max; -} - -void QbsCleanStep::handleProgress(int value) -{ - if (m_maxProgress > 0) - emit progress(value * 100 / m_maxProgress, m_description); -} - -void QbsCleanStep::createTaskAndOutput(Task::TaskType type, const QString &message, - const FilePath &file, int line) -{ - emit addOutput(message, OutputFormat::Stdout); - emit addTask(CompileTask(type, message, file, line), 1); + return QbsRequestTask(onSetup); } // -------------------------------------------------------------------- @@ -154,5 +107,4 @@ QbsCleanStepFactory::QbsCleanStepFactory() setDisplayName(Tr::tr("Qbs Clean")); } -} // namespace Internal -} // namespace QbsProjectManager +} // namespace QbsProjectManager::Internal diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.h b/src/plugins/qbsprojectmanager/qbscleanstep.h index b3552993366..132287afd7c 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.h +++ b/src/plugins/qbsprojectmanager/qbscleanstep.h @@ -3,18 +3,9 @@ #pragma once -#include "qbsbuildconfiguration.h" - #include <projectexplorer/buildstep.h> -#include <projectexplorer/task.h> -#include <utils/aspects.h> - -namespace QbsProjectManager { -namespace Internal { - -class ErrorInfo; -class QbsSession; +namespace QbsProjectManager::Internal { class QbsCleanStep final : public ProjectExplorer::BuildStep { @@ -22,33 +13,16 @@ class QbsCleanStep final : public ProjectExplorer::BuildStep public: QbsCleanStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); - ~QbsCleanStep() override; - - QbsBuildStepData stepData() const; - - void dropSession(); private: bool init() override; - void doRun() override; - void doCancel() override; - - void cleaningDone(const ErrorInfo &error); - void handleTaskStarted(const QString &desciption, int max); - void handleProgress(int value); - - void createTaskAndOutput(ProjectExplorer::Task::TaskType type, - const QString &message, const Utils::FilePath &file, int line); + Tasking::GroupItem runRecipe() final; Utils::BoolAspect dryRun{this}; Utils::BoolAspect keepGoing{this}; Utils::StringAspect effectiveCommand{this}; QStringList m_products; - QbsSession *m_session = nullptr; - QString m_description; - int m_maxProgress; - bool m_showCompilerOutput = true; }; class QbsCleanStepFactory : public ProjectExplorer::BuildStepFactory @@ -57,5 +31,4 @@ public: QbsCleanStepFactory(); }; -} // namespace Internal -} // namespace QbsProjectManager +} // namespace QbsProjectManager::Internal From 4d0564a1474231118d5d2cc6f634b015d0647039 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 14 Jul 2023 22:18:57 +0200 Subject: [PATCH 0466/1777] QbsInstallStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I0fa0face3bcc567b8e29db2b23b2a48364252fed Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../qbsprojectmanager/qbsinstallstep.cpp | 103 ++++++------------ .../qbsprojectmanager/qbsinstallstep.h | 30 +---- .../qbsprojectmanagerplugin.cpp | 1 + 3 files changed, 40 insertions(+), 94 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp index 5f6dbf2a710..329610fb784 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp @@ -3,16 +3,12 @@ #include "qbsinstallstep.h" -#include "qbsbuildconfiguration.h" #include "qbsbuildstep.h" -#include "qbsproject.h" #include "qbsprojectmanagerconstants.h" #include "qbsprojectmanagertr.h" +#include "qbsrequest.h" #include "qbssession.h" -#include <projectexplorer/buildsteplist.h> -#include <projectexplorer/deployconfiguration.h> -#include <projectexplorer/kit.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> @@ -24,10 +20,10 @@ #include <QPlainTextEdit> using namespace ProjectExplorer; +using namespace Tasking; using namespace Utils; -namespace QbsProjectManager { -namespace Internal { +namespace QbsProjectManager::Internal { // -------------------------------------------------------------------- // QbsInstallStep: @@ -50,44 +46,44 @@ QbsInstallStep::QbsInstallStep(BuildStepList *bsl, Id id) cleanInstallRoot.setLabel(Tr::tr("Remove first"), labelPlacement); } -QbsInstallStep::~QbsInstallStep() -{ - doCancel(); - if (m_session) - m_session->disconnect(this); -} - bool QbsInstallStep::init() { - QTC_ASSERT(!target()->buildSystem()->isParsing() && !m_session, return false); + if (!BuildStep::init()) + return false; + QTC_ASSERT(!target()->buildSystem()->isParsing(), return false); return true; } -void QbsInstallStep::doRun() +GroupItem QbsInstallStep::runRecipe() { - m_session = static_cast<QbsBuildSystem *>(target()->buildSystem())->session(); + const auto onSetup = [this](QbsRequest &request) { + QbsSession *session = static_cast<QbsBuildSystem*>(buildSystem())->session(); + if (!session) { + emit addOutput(Tr::tr("No qbs session exists for this target."), + OutputFormat::ErrorMessage); + return SetupResult::StopWithError; + } + QJsonObject requestData; + requestData.insert("type", "install-project"); + requestData.insert("install-root", installRoot().path()); + requestData.insert("clean-install-root", cleanInstallRoot()); + requestData.insert("keep-going", keepGoing()); + requestData.insert("dry-run", dryRun()); - QJsonObject request; - request.insert("type", "install-project"); - request.insert("install-root", installRoot().path()); - request.insert("clean-install-root", cleanInstallRoot()); - request.insert("keep-going", keepGoing()); - request.insert("dry-run", dryRun()); - m_session->sendRequest(request); + request.setSession(session); + request.setRequestData(requestData); + connect(&request, &QbsRequest::progressChanged, this, &BuildStep::progress); + connect(&request, &QbsRequest::outputAdded, this, + [this](const QString &output, OutputFormat format) { + emit addOutput(output, format); + }); + connect(&request, &QbsRequest::taskAdded, this, [this](const Task &task) { + emit addTask(task, 1); + }); + return SetupResult::Continue; + }; - m_maxProgress = 0; - connect(m_session, &QbsSession::projectInstalled, this, &QbsInstallStep::installDone); - connect(m_session, &QbsSession::taskStarted, this, &QbsInstallStep::handleTaskStarted); - connect(m_session, &QbsSession::taskProgress, this, &QbsInstallStep::handleProgress); - connect(m_session, &QbsSession::errorOccurred, this, [this] { - installDone(ErrorInfo(Tr::tr("Installing canceled: Qbs session failed."))); - }); -} - -void QbsInstallStep::doCancel() -{ - if (m_session) - m_session->cancelCurrentJob(); + return QbsRequestTask(onSetup); } FilePath QbsInstallStep::installRoot() const @@ -101,36 +97,6 @@ const QbsBuildConfiguration *QbsInstallStep::buildConfig() const return static_cast<QbsBuildConfiguration *>(target()->activeBuildConfiguration()); } -void QbsInstallStep::installDone(const ErrorInfo &error) -{ - m_session->disconnect(this); - m_session = nullptr; - - for (const ErrorInfoItem &item : error.items) - createTaskAndOutput(Task::Error, item.description, item.filePath, item.line); - - emit finished(!error.hasError()); -} - -void QbsInstallStep::handleTaskStarted(const QString &desciption, int max) -{ - m_description = desciption; - m_maxProgress = max; -} - -void QbsInstallStep::handleProgress(int value) -{ - if (m_maxProgress > 0) - emit progress(value * 100 / m_maxProgress, m_description); -} - -void QbsInstallStep::createTaskAndOutput(Task::TaskType type, const QString &message, - const FilePath &file, int line) -{ - emit addOutput(message, OutputFormat::Stdout); - emit addTask(CompileTask(type, message, file, line), 1); -} - QbsBuildStepData QbsInstallStep::stepData() const { QbsBuildStepData data; @@ -202,5 +168,4 @@ QbsInstallStepFactory::QbsInstallStepFactory() setDisplayName(Tr::tr("Qbs Install")); } -} // namespace Internal -} // namespace QbsProjectManager +} // namespace QbsProjectManager::Internal diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.h b/src/plugins/qbsprojectmanager/qbsinstallstep.h index 98d9853e8fa..37f7a60db6d 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.h +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.h @@ -3,19 +3,12 @@ #pragma once -#include "qbsbuildconfiguration.h" -#include "qbssession.h" - #include <projectexplorer/buildstep.h> -#include <projectexplorer/task.h> -#include <utils/aspects.h> +namespace QbsProjectManager::Internal { -namespace QbsProjectManager { -namespace Internal { - -class ErrorInfo; -class QbsSession; +class QbsBuildConfiguration; +class QbsBuildStepData; class QbsInstallStep final : public ProjectExplorer::BuildStep { @@ -23,33 +16,21 @@ class QbsInstallStep final : public ProjectExplorer::BuildStep public: QbsInstallStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); - ~QbsInstallStep() override; Utils::FilePath installRoot() const; QbsBuildStepData stepData() const; private: bool init() override; - void doRun() override; - void doCancel() override; + Tasking::GroupItem runRecipe() final; QWidget *createConfigWidget() override; const QbsBuildConfiguration *buildConfig() const; - void installDone(const ErrorInfo &error); - void handleTaskStarted(const QString &desciption, int max); - void handleProgress(int value); - - void createTaskAndOutput(ProjectExplorer::Task::TaskType type, - const QString &message, const Utils::FilePath &file, int line); Utils::BoolAspect cleanInstallRoot{this}; Utils::BoolAspect dryRun{this}; Utils::BoolAspect keepGoing{this}; - QbsSession *m_session = nullptr; - QString m_description; - int m_maxProgress; - friend class QbsInstallStepConfigWidget; }; @@ -59,5 +40,4 @@ public: QbsInstallStepFactory(); }; -} // namespace Internal -} // namespace QbsProjectManager +} // namespace QbsProjectManager::Internal diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp index 3245b609bef..9b6dfd05461 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp @@ -14,6 +14,7 @@ #include "qbsproject.h" #include "qbsprojectmanagerconstants.h" #include "qbsprojectmanagertr.h" +#include "qbssession.h" #include "qbssettings.h" #include <coreplugin/actionmanager/actioncontainer.h> From d2bb1151f5a3876ad352a4c9fdd9e9d90edcad02 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 19 Jul 2023 10:47:51 +0200 Subject: [PATCH 0467/1777] Valgrind: Merge configwidget population to settings aspect container Change-Id: I021ef0ea9b3ab48c805a8af282a4062ddd701dea Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/valgrind/CMakeLists.txt | 1 - src/plugins/valgrind/valgrind.qbs | 1 - src/plugins/valgrind/valgrindconfigwidget.cpp | 111 ------------------ src/plugins/valgrind/valgrindconfigwidget.h | 12 -- src/plugins/valgrind/valgrindplugin.cpp | 1 - src/plugins/valgrind/valgrindsettings.cpp | 84 ++++++++++++- src/plugins/valgrind/valgrindsettings.h | 1 - 7 files changed, 82 insertions(+), 129 deletions(-) delete mode 100644 src/plugins/valgrind/valgrindconfigwidget.cpp delete mode 100644 src/plugins/valgrind/valgrindconfigwidget.h diff --git a/src/plugins/valgrind/CMakeLists.txt b/src/plugins/valgrind/CMakeLists.txt index 3e1f149730f..e931c16ece2 100644 --- a/src/plugins/valgrind/CMakeLists.txt +++ b/src/plugins/valgrind/CMakeLists.txt @@ -26,7 +26,6 @@ add_qtc_plugin(Valgrind memchecktool.cpp memchecktool.h suppressiondialog.cpp suppressiondialog.h valgrind.qrc - valgrindconfigwidget.cpp valgrindconfigwidget.h valgrindengine.cpp valgrindengine.h valgrindplugin.cpp valgrindrunner.cpp valgrindrunner.h diff --git a/src/plugins/valgrind/valgrind.qbs b/src/plugins/valgrind/valgrind.qbs index 973b1d7b85a..590ecb4e73c 100644 --- a/src/plugins/valgrind/valgrind.qbs +++ b/src/plugins/valgrind/valgrind.qbs @@ -30,7 +30,6 @@ QtcPlugin { "memchecktool.cpp", "memchecktool.h", "suppressiondialog.cpp", "suppressiondialog.h", "valgrind.qrc", - "valgrindconfigwidget.cpp", "valgrindconfigwidget.h", "valgrindengine.cpp", "valgrindengine.h", "valgrindplugin.cpp", "valgrindrunner.cpp", "valgrindrunner.h", diff --git a/src/plugins/valgrind/valgrindconfigwidget.cpp b/src/plugins/valgrind/valgrindconfigwidget.cpp deleted file mode 100644 index cbd2339ecfc..00000000000 --- a/src/plugins/valgrind/valgrindconfigwidget.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "valgrindconfigwidget.h" -#include "valgrindsettings.h" -#include "valgrindtr.h" - -#include <debugger/analyzer/analyzericons.h> -#include <debugger/debuggertr.h> - -#include <coreplugin/icore.h> - -#include <utils/algorithm.h> -#include <utils/layoutbuilder.h> -#include <utils/qtcassert.h> - -using namespace Utils; - -namespace Valgrind::Internal { - -class ValgrindConfigWidget : public Core::IOptionsPageWidget -{ -public: - explicit ValgrindConfigWidget(ValgrindBaseSettings *settings); - - void apply() final - { - globalSettings().apply(); - globalSettings().writeSettings(); - } - - void finish() final - { - globalSettings().finish(); - } -}; - -ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings) -{ - using namespace Layouting; - ValgrindBaseSettings &s = *settings; - // clang-format off - Grid generic { - s.valgrindExecutable, br, - s.valgrindArguments, br, - s.selfModifyingCodeDetection, br - }; - - Grid memcheck { - s.memcheckArguments, br, - s.trackOrigins, br, - s.showReachable, br, - s.leakCheckOnFinish, br, - s.numCallers, br, - s.filterExternalIssues, br, - s.suppressions - }; - - Grid callgrind { - s.callgrindArguments, br, - s.kcachegrindExecutable, br, - s.minimumInclusiveCostRatio, br, - s.visualizationMinimumInclusiveCostRatio, br, - s.enableEventToolTips, br, - Span { - 2, - Group { - Column { - s.enableCacheSim, - s.enableBranchSim, - s.collectSystime, - s.collectBusEvents, - } - } - } - }; - - Column { - Group { title(Tr::tr("Valgrind Generic Settings")), generic }, - Group { title(Tr::tr("Memcheck Memory Analysis Options")), memcheck }, - Group { title(Tr::tr("Callgrind Profiling Options")), callgrind }, - st, - }.attachTo(this); - // clang-format on -} - -// ValgrindOptionsPage - -class ValgrindOptionsPage final : public Core::IOptionsPage -{ -public: - ValgrindOptionsPage() - { - setId(ANALYZER_VALGRIND_SETTINGS); - setDisplayName(Tr::tr("Valgrind")); - setCategory("T.Analyzer"); - setDisplayCategory(::Debugger::Tr::tr("Analyzer")); - setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); - setWidgetCreator([] { return new ValgrindConfigWidget(&globalSettings()); }); - } -}; - -const ValgrindOptionsPage settingsPage; - - -QWidget *createSettingsWidget(ValgrindBaseSettings *settings) -{ - return new ValgrindConfigWidget(settings); -} - -} // Valgrind::Internal diff --git a/src/plugins/valgrind/valgrindconfigwidget.h b/src/plugins/valgrind/valgrindconfigwidget.h deleted file mode 100644 index fe77030e914..00000000000 --- a/src/plugins/valgrind/valgrindconfigwidget.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <coreplugin/dialogs/ioptionspage.h> - -namespace Valgrind::Internal { - -QWidget *createSettingsWidget(class ValgrindBaseSettings *settings); - -} // Valgrind::Internal diff --git a/src/plugins/valgrind/valgrindplugin.cpp b/src/plugins/valgrind/valgrindplugin.cpp index 3b3a8156163..7005efd98ff 100644 --- a/src/plugins/valgrind/valgrindplugin.cpp +++ b/src/plugins/valgrind/valgrindplugin.cpp @@ -3,7 +3,6 @@ #include "callgrindtool.h" #include "memchecktool.h" -#include "valgrindconfigwidget.h" #include "valgrindsettings.h" #include "valgrindtr.h" diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index c4e49e8d4ae..1446ab2712a 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -4,11 +4,14 @@ #include "valgrindsettings.h" #include "callgrindcostdelegate.h" -#include "valgrindconfigwidget.h" #include "valgrindtr.h" #include <coreplugin/icore.h> +#include <coreplugin/dialogs/ioptionspage.h> +#include <debugger/analyzer/analyzericons.h> +#include <debugger/debuggertr.h> + #include <utils/algorithm.h> #include <utils/layoutbuilder.h> #include <utils/qtcassert.h> @@ -173,6 +176,14 @@ void SuppressionAspect::bufferToGui() d->m_model.appendRow(new QStandardItem(file.toUserOutput())); } +// ValgrindConfigWidget + + +QWidget *createSettingsWidget(ValgrindBaseSettings *settings) +{ + return settings->layouter()().emerge(); +} + ////////////////////////////////////////////////////////////////// // // ValgrindBaseSettings @@ -316,6 +327,54 @@ ValgrindBaseSettings::ValgrindBaseSettings(bool global) for (int i = 0; i < Valgrind::XmlProtocol::MemcheckErrorKindCount; ++i) defaultErrorKinds << i; visibleErrorKinds.setDefaultValue(defaultErrorKinds); + + setLayouter([this] { + using namespace Layouting; + + // clang-format off + Grid generic { + valgrindExecutable, br, + valgrindArguments, br, + selfModifyingCodeDetection, br + }; + + Grid memcheck { + memcheckArguments, br, + trackOrigins, br, + showReachable, br, + leakCheckOnFinish, br, + numCallers, br, + filterExternalIssues, br, + suppressions + }; + + Grid callgrind { + callgrindArguments, br, + kcachegrindExecutable, br, + minimumInclusiveCostRatio, br, + visualizationMinimumInclusiveCostRatio, br, + enableEventToolTips, br, + Span { + 2, + Group { + Column { + enableCacheSim, + enableBranchSim, + collectSystime, + collectBusEvents, + } + } + } + }; + + return Column { + Group { title(Tr::tr("Valgrind Generic Settings")), generic }, + Group { title(Tr::tr("Memcheck Memory Analysis Options")), memcheck }, + Group { title(Tr::tr("Callgrind Profiling Options")), callgrind }, + st, + }; + // clang-format on + }); } @@ -356,8 +415,8 @@ ValgrindGlobalSettings::ValgrindGlobalSettings() shortenTemplates.setToolTip(Tr::tr("Remove template parameter lists when displaying function names.")); setConfigWidgetCreator([this] { return createSettingsWidget(this); }); - readSettings(); + readSettings(); setAutoApply(false); } @@ -424,4 +483,25 @@ ValgrindProjectSettings::ValgrindProjectSettings() }); } +// +// ValgrindOptionsPage +// + +class ValgrindOptionsPage final : public Core::IOptionsPage +{ +public: + ValgrindOptionsPage() + { + setId(ANALYZER_VALGRIND_SETTINGS); + setDisplayName(Tr::tr("Valgrind")); + setCategory("T.Analyzer"); + setDisplayCategory(::Debugger::Tr::tr("Analyzer")); + setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); + setSettingsProvider([] { return &globalSettings(); }); + } +}; + +const ValgrindOptionsPage settingsPage; + + } // Valgrind::Internal diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index eb4ef4e867b..9687a545ecf 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -100,7 +100,6 @@ public: QVariantMap defaultSettings() const; }; - /** * Global valgrind settings */ From 370bd18dc695e3deae6346119115ba6fb891c71a Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 24 Jul 2023 14:54:18 +0200 Subject: [PATCH 0468/1777] Debugger: Fix persisting of common options I have some notion where this should lead to, but we are not there yet. Change-Id: I402618a64dfef43c8e2089bface44ec5c822eb0b Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/debuggeractions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 074197eec1a..218ebda31e0 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -319,7 +319,7 @@ DebuggerSettings::DebuggerSettings() : const QString qmlInspectorGroup = "QML.Inspector"; showAppOnTop.setSettingsKey(qmlInspectorGroup, "QmlInspector.ShowAppOnTop"); - + page1.registerAspects(commonSettings()); // Page 4 page4.registerAspect(&useDebuggingHelpers); page4.registerAspect(&useCodeModel); From d22df34e6c6e55c6a368e87ac445d1f248f0c5de Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 15:47:13 +0200 Subject: [PATCH 0469/1777] Utils: Factor out code related to optional checkboxes for strings We will need it twice when the FilePathAspect is fully separate. Change-Id: Ief69af0e1167d5ca5c770c3cbd16fdafa16114f7 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 191 +++++++++++------- src/libs/utils/aspects.h | 17 +- .../runconfigurationaspects.cpp | 2 +- src/plugins/remotelinux/makeinstallstep.cpp | 2 +- 4 files changed, 124 insertions(+), 88 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 3b2891f80a9..91cc020cdeb 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -661,16 +661,102 @@ public: QPointer<QListWidget> m_listView; }; +class CheckableAspectImplementation +{ +public: + void fromMap(const QVariantMap &map) + { + if (m_checked) + m_checked->fromMap(map); + } + + void toMap(QVariantMap &map) + { + if (m_checked) + m_checked->toMap(map); + } + + template<class Widget> + void updateWidgetFromCheckStatus(BaseAspect *aspect, Widget *w) + { + const bool enabled = !m_checked || m_checked->value(); + if (m_uncheckedSemantics == UncheckedSemantics::Disabled) + w->setEnabled(enabled && aspect->isEnabled()); + else + w->setReadOnly(!enabled || aspect->isReadOnly()); + } + + void setUncheckedSemantics(UncheckedSemantics semantics) + { + m_uncheckedSemantics = semantics; + } + + bool isChecked() const + { + QTC_ASSERT(m_checked, return false); + return m_checked->value(); + } + + void setChecked(bool checked) + { + QTC_ASSERT(m_checked, return); + m_checked->setValue(checked); + } + + void makeCheckable(CheckBoxPlacement checkBoxPlacement, const QString &checkerLabel, + const QString &checkerKey, BaseAspect *aspect) + { + QTC_ASSERT(!m_checked, return); + m_checkBoxPlacement = checkBoxPlacement; + m_checked.reset(new BoolAspect); + m_checked->setLabel(checkerLabel, checkBoxPlacement == CheckBoxPlacement::Top + ? BoolAspect::LabelPlacement::InExtraLabel + : BoolAspect::LabelPlacement::AtCheckBox); + m_checked->setSettingsKey(checkerKey); + + QObject::connect(m_checked.get(), &BoolAspect::changed, aspect, [aspect] { + // FIXME: Check. + aspect->internalToBuffer(); + aspect->bufferToGui(); + emit aspect->changed(); + aspect->checkedChanged(); + }); + + QObject::connect(m_checked.get(), &BoolAspect::volatileValueChanged, aspect, [aspect] { + // FIXME: Check. + aspect->internalToBuffer(); + aspect->bufferToGui(); + aspect->checkedChanged(); + }); + + aspect->internalToBuffer(); + aspect->bufferToGui(); + } + + void addToLayoutFirst(LayoutItem &parent) + { + if (m_checked && m_checkBoxPlacement == CheckBoxPlacement::Top) { + m_checked->addToLayout(parent); + parent.addItem(br); + } + } + + void addToLayoutLast(LayoutItem &parent) + { + if (m_checked && m_checkBoxPlacement == CheckBoxPlacement::Right) + m_checked->addToLayout(parent); + } + + CheckBoxPlacement m_checkBoxPlacement = CheckBoxPlacement::Right; + UncheckedSemantics m_uncheckedSemantics = UncheckedSemantics::Disabled; + std::unique_ptr<BoolAspect> m_checked; +}; + class StringAspectPrivate { public: StringAspect::DisplayStyle m_displayStyle = StringAspect::LabelDisplay; - StringAspect::CheckBoxPlacement m_checkBoxPlacement - = StringAspect::CheckBoxPlacement::Right; - StringAspect::UncheckedSemantics m_uncheckedSemantics - = StringAspect::UncheckedSemantics::Disabled; std::function<QString(const QString &)> m_displayFilter; - std::unique_ptr<BoolAspect> m_checker; Qt::TextElideMode m_elideMode = Qt::ElideNone; QString m_placeHolderText; @@ -690,6 +776,8 @@ public: std::optional<FancyLineEdit::ValidationFunction> m_validator; std::function<void()> m_openTerminal; + CheckableAspectImplementation m_checkerImpl; + bool m_undoRedoEnabled = true; bool m_acceptRichText = false; bool m_showToolTipOnLabel = false; @@ -701,15 +789,6 @@ public: bool m_blockAutoApply = false; bool m_allowPathFromDevice = true; bool m_validatePlaceHolder = false; - - template<class Widget> void updateWidgetFromCheckStatus(StringAspect *aspect, Widget *w) - { - const bool enabled = !m_checker || m_checker->value(); - if (m_uncheckedSemantics == StringAspect::UncheckedSemantics::Disabled) - w->setEnabled(enabled && aspect->isEnabled()); - else - w->setReadOnly(!enabled || aspect->isReadOnly()); - } }; class IntegerAspectPrivate @@ -838,8 +917,7 @@ void StringAspect::fromMap(const QVariantMap &map) { if (!settingsKey().isEmpty()) setValueQuietly(map.value(settingsKey(), defaultValue()).toString()); - if (d->m_checker) - d->m_checker->fromMap(map); + d->m_checkerImpl.fromMap(map); } /*! @@ -848,8 +926,7 @@ void StringAspect::fromMap(const QVariantMap &map) void StringAspect::toMap(QVariantMap &map) const { saveToMap(map, value(), defaultValue(), settingsKey()); - if (d->m_checker) - d->m_checker->toMap(map); + d->m_checkerImpl.toMap(map); } /*! @@ -887,27 +964,6 @@ void StringAspect::setDisplayFilter(const std::function<QString(const QString &) d->m_displayFilter = displayFilter; } -/*! - Returns the check box value. - - \sa makeCheckable(), setChecked() -*/ -bool StringAspect::isChecked() const -{ - return !d->m_checker || d->m_checker->value(); -} - -/*! - Sets the check box of this aspect to \a checked. - - \sa makeCheckable(), isChecked() -*/ -void StringAspect::setChecked(bool checked) -{ - QTC_ASSERT(d->m_checker, return); - d->m_checker->setValue(checked); -} - /*! Selects the main display characteristics of the aspect according to \a displayStyle. @@ -1077,17 +1133,9 @@ void StringAspect::validateInput() d->m_lineEditDisplay->validate(); } -void StringAspect::setUncheckedSemantics(StringAspect::UncheckedSemantics semantics) -{ - d->m_uncheckedSemantics = semantics; -} - void StringAspect::addToLayout(LayoutItem &parent) { - if (d->m_checker && d->m_checkBoxPlacement == CheckBoxPlacement::Top) { - d->m_checker->addToLayout(parent); - parent.addItem(br); - } + d->m_checkerImpl.addToLayoutFirst(parent); const auto useMacroExpander = [this](QWidget *w) { if (!d->m_expanderProvider) @@ -1124,7 +1172,7 @@ void StringAspect::addToLayout(LayoutItem &parent) // do not override default value with placeholder, but use placeholder if default is empty if (d->m_pathChooserDisplay->lineEdit()->placeholderText().isEmpty()) d->m_pathChooserDisplay->lineEdit()->setPlaceholderText(d->m_placeHolderText); - d->updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data()); + d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data()); addLabeledItem(parent, d->m_pathChooserDisplay); useMacroExpander(d->m_pathChooserDisplay->lineEdit()); connect(d->m_pathChooserDisplay, &PathChooser::validChanged, this, &StringAspect::validChanged); @@ -1150,7 +1198,7 @@ void StringAspect::addToLayout(LayoutItem &parent) d->m_lineEditDisplay->setTextKeepingActiveCursor(displayedString); d->m_lineEditDisplay->setReadOnly(isReadOnly()); d->m_lineEditDisplay->setValidatePlaceHolder(d->m_validatePlaceHolder); - d->updateWidgetFromCheckStatus(this, d->m_lineEditDisplay.data()); + d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_lineEditDisplay.data()); addLabeledItem(parent, d->m_lineEditDisplay); useMacroExpander(d->m_lineEditDisplay); if (d->m_useResetButton) { @@ -1182,7 +1230,7 @@ void StringAspect::addToLayout(LayoutItem &parent) d->m_textEditDisplay->setTextInteractionFlags(Qt::TextEditorInteraction); d->m_textEditDisplay->setText(displayedString); d->m_textEditDisplay->setReadOnly(isReadOnly()); - d->updateWidgetFromCheckStatus(this, d->m_textEditDisplay.data()); + d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_textEditDisplay.data()); addLabeledItem(parent, d->m_textEditDisplay); useMacroExpander(d->m_textEditDisplay); bufferToGui(); @@ -1199,8 +1247,7 @@ void StringAspect::addToLayout(LayoutItem &parent) break; } - if (d->m_checker && d->m_checkBoxPlacement == CheckBoxPlacement::Right) - d->m_checker->addToLayout(parent); + d->m_checkerImpl.addToLayoutLast(parent); } bool StringAspect::guiToBuffer() @@ -1233,19 +1280,19 @@ void StringAspect::bufferToGui() { if (d->m_pathChooserDisplay) { d->m_pathChooserDisplay->lineEdit()->setText(m_buffer); - d->updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data()); + d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data()); } if (d->m_lineEditDisplay) { d->m_lineEditDisplay->setTextKeepingActiveCursor(m_buffer); - d->updateWidgetFromCheckStatus(this, d->m_lineEditDisplay.data()); + d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_lineEditDisplay.data()); } if (d->m_textEditDisplay) { const QString old = d->m_textEditDisplay->document()->toPlainText(); if (m_buffer != old) d->m_textEditDisplay->setText(m_buffer); - d->updateWidgetFromCheckStatus(this, d->m_textEditDisplay.data()); + d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_textEditDisplay.data()); } if (d->m_labelDisplay) { @@ -1264,31 +1311,19 @@ void StringAspect::bufferToGui() \a checkerKey. */ void StringAspect::makeCheckable(CheckBoxPlacement checkBoxPlacement, - const QString &checkerLabel, const QString &checkerKey) + const QString &checkerLabel, const QString &checkerKey) { - QTC_ASSERT(!d->m_checker, return); - d->m_checkBoxPlacement = checkBoxPlacement; - d->m_checker.reset(new BoolAspect); - d->m_checker->setLabel(checkerLabel, checkBoxPlacement == CheckBoxPlacement::Top - ? BoolAspect::LabelPlacement::InExtraLabel - : BoolAspect::LabelPlacement::AtCheckBox); - d->m_checker->setSettingsKey(checkerKey); + d->m_checkerImpl.makeCheckable(checkBoxPlacement, checkerLabel, checkerKey, this); +} - connect(d->m_checker.get(), &BoolAspect::changed, this, [this] { - internalToBuffer(); - bufferToGui(); - emit changed(); - checkedChanged(); - }); +bool StringAspect::isChecked() const +{ + return d->m_checkerImpl.isChecked(); +} - connect(d->m_checker.get(), &BoolAspect::volatileValueChanged, this, [this] { - internalToBuffer(); - bufferToGui(); - checkedChanged(); - }); - - internalToBuffer(); - bufferToGui(); +void StringAspect::setChecked(bool checked) +{ + return d->m_checkerImpl.setChecked(checked); } diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 9fd54a24dac..3dfd6d7aac9 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -38,6 +38,7 @@ class SelectionAspectPrivate; class StringAspectPrivate; class StringListAspectPrivate; class TextDisplayPrivate; +class CheckableAspectImplementation; } // Internal class QTCREATOR_UTILS_EXPORT BaseAspect : public QObject @@ -169,6 +170,7 @@ signals: void volatileValueChanged(); void externalValueChanged(); void labelLinkActivated(const QString &link); + void checkedChanged(); protected: virtual bool internalToBuffer(); @@ -226,6 +228,7 @@ protected: private: std::unique_ptr<Internal::BaseAspectPrivate> d; + friend class Internal::CheckableAspectImplementation; }; QTCREATOR_UTILS_EXPORT void createItem(Layouting::LayoutItem *item, const BaseAspect &aspect); @@ -467,6 +470,9 @@ private: std::unique_ptr<Internal::MultiSelectionAspectPrivate> d; }; +enum class UncheckedSemantics { Disabled, ReadOnly }; +enum class CheckBoxPlacement { Top, Right }; + class QTCREATOR_UTILS_EXPORT StringAspect : public TypedAspect<QString> { Q_OBJECT @@ -503,15 +509,11 @@ public: void setAutoApplyOnEditingFinished(bool applyOnEditingFinished); void setElideMode(Qt::TextElideMode elideMode); - void validateInput(); - - enum class UncheckedSemantics { Disabled, ReadOnly }; - enum class CheckBoxPlacement { Top, Right }; - void setUncheckedSemantics(UncheckedSemantics semantics); + void makeCheckable(CheckBoxPlacement checkBoxPlacement, const QString &optionalLabel, const QString &optionalBaseKey); bool isChecked() const; void setChecked(bool checked); - void makeCheckable(CheckBoxPlacement checkBoxPlacement, const QString &optionalLabel, - const QString &optionalBaseKey); + + void validateInput(); enum DisplayStyle { LabelDisplay, @@ -527,7 +529,6 @@ public: FilePath filePath() const; signals: - void checkedChanged(); void validChanged(bool validState); protected: diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 4950cef0962..db56fa434ef 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -616,7 +616,7 @@ void ExecutableAspect::makeOverridable(const QString &overridingKey, const QStri m_alternativeExecutable->setDisplayStyle(StringAspect::LineEditDisplay); m_alternativeExecutable->setLabelText(Tr::tr("Alternate executable on device:")); m_alternativeExecutable->setSettingsKey(overridingKey); - m_alternativeExecutable->makeCheckable(StringAspect::CheckBoxPlacement::Right, + m_alternativeExecutable->makeCheckable(CheckBoxPlacement::Right, Tr::tr("Use this command instead"), useOverridableKey); connect(m_alternativeExecutable, &StringAspect::changed, this, &ExecutableAspect::changed); diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index f52394231fc..9aa548c8e76 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -107,7 +107,7 @@ MakeInstallStep::MakeInstallStep(BuildStepList *parent, Id id) : MakeStep(parent m_customCommand.setSettingsKey("RemoteLinux.MakeInstall.CustomCommandLine"); m_customCommand.setDisplayStyle(StringAspect::LineEditDisplay); m_customCommand.setLabelText(Tr::tr("Custom command line:")); - m_customCommand.makeCheckable(StringAspect::CheckBoxPlacement::Top, + m_customCommand.makeCheckable(CheckBoxPlacement::Top, Tr::tr("Use custom command line instead:"), "RemoteLinux.MakeInstall.EnableCustomCommandLine"); const auto updateCommand = [this] { From c007be8a9ab764f2386b450c31f3fdec946f6db7 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 24 Jul 2023 17:33:16 +0200 Subject: [PATCH 0470/1777] Valgrind: Save a few cycles in updateFromSettings() Makes it easier to debug, too. Change-Id: Id55591195bc645cfff002d04e4fdae6e4b3a4b85 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/valgrind/memchecktool.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index f08b3a7f3ce..9c6e935c77f 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -909,14 +909,17 @@ void MemcheckToolPrivate::settingsDestroyed(QObject *settings) void MemcheckToolPrivate::updateFromSettings() { + const QList<int> stored = m_settings->visibleErrorKinds(); for (QAction *action : std::as_const(m_errorFilterActions)) { bool contained = true; const QList<QVariant> actions = action->data().toList(); for (const QVariant &v : actions) { bool ok; int kind = v.toInt(&ok); - if (ok && !m_settings->visibleErrorKinds().contains(kind)) + if (ok && !stored.contains(kind)) { contained = false; + break; + } } action->setChecked(contained); } From 355e8d133c323343666fb6b55f590e1e2520ef34 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 24 Jul 2023 14:22:37 +0200 Subject: [PATCH 0471/1777] Fix some warnings about unused things Change-Id: I42bb514dfe1d6745b1469b508a4cfa576e17c31b Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 1 - src/plugins/fakevim/fakevimplugin.cpp | 2 +- src/plugins/git/gitgrep.cpp | 1 - src/plugins/git/gitgrep.h | 1 - src/plugins/texteditor/syntaxhighlighter.cpp | 1 - 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 0c8bd830cff..4348ac2e56d 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -83,7 +83,6 @@ namespace CMakeProjectManager { static Q_LOGGING_CATEGORY(cmakeBuildConfigurationLog, "qtc.cmake.bc", QtWarningMsg); -const char CONFIGURATION_KEY[] = "CMake.Configuration"; const char DEVELOPMENT_TEAM_FLAG[] = "Ios:DevelopmentTeam:Flag"; const char PROVISIONING_PROFILE_FLAG[] = "Ios:ProvisioningProfile:Flag"; const char CMAKE_OSX_ARCHITECTURES_FLAG[] = "CMAKE_OSX_ARCHITECTURES:DefaultFlag"; diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 1a988821979..afebf316c9c 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -812,7 +812,7 @@ public: setId(SETTINGS_USER_CMDS_ID); setDisplayName(Tr::tr("User Command Mapping")); setCategory(SETTINGS_CATEGORY); - setWidgetCreator([this] { return new FakeVimUserCommandsPageWidget; }); + setWidgetCreator([] { return new FakeVimUserCommandsPageWidget; }); } }; diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index 4e581b965ff..b2e6e36a19d 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -190,7 +190,6 @@ static bool isGitDirectory(const FilePath &path) } GitGrep::GitGrep(GitClient *client) - : m_client(client) { m_widget = new QWidget; auto layout = new QHBoxLayout(m_widget); diff --git a/src/plugins/git/gitgrep.h b/src/plugins/git/gitgrep.h index 6563f5bcaad..c17151a480c 100644 --- a/src/plugins/git/gitgrep.h +++ b/src/plugins/git/gitgrep.h @@ -32,7 +32,6 @@ public: private: GitGrepParameters gitParameters() const; - GitClient *m_client; QWidget *m_widget; Utils::FancyLineEdit *m_treeLineEdit; QCheckBox *m_recurseSubmodules = nullptr; diff --git a/src/plugins/texteditor/syntaxhighlighter.cpp b/src/plugins/texteditor/syntaxhighlighter.cpp index d8b39a5c2c2..24a96522b38 100644 --- a/src/plugins/texteditor/syntaxhighlighter.cpp +++ b/src/plugins/texteditor/syntaxhighlighter.cpp @@ -512,7 +512,6 @@ void SyntaxHighlighter::formatSpaces(const QString &text, int start, int count) void SyntaxHighlighter::setFormatWithSpaces(const QString &text, int start, int count, const QTextCharFormat &format) { - Q_D(const SyntaxHighlighter); const QTextCharFormat visualSpaceFormat = whitespacified(format); const int end = std::min(start + count, int(text.length())); From d31416a5f5005f51973a0f5f0d36ba66d012deaa Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 24 Jul 2023 18:10:10 +0200 Subject: [PATCH 0472/1777] Utils: Introduce a way to immediate force aspect value saving Will be used for e.g. valgrinds error categories. These are handled by actions in a menu outside the settings page mechanism. Change-Id: I2dea9b9f13dbc92fa3e9938f85aa083d01d0d99b Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 55 ++++++++++++++++++++++++++++---------- src/libs/utils/aspects.h | 16 +++++++++++ 2 files changed, 57 insertions(+), 14 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 91cc020cdeb..ff7806bd84f 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -412,6 +412,22 @@ void BaseAspect::setSettingsKey(const QString &group, const QString &key) d->m_settingsKey = group + "/" + key; } +/*! + Immediately writes the value of this aspect into its specified + settings, taking a potential container's settings group specification + into account. + + \note This is expensive, so it should only be used with good reason. +*/ +void BaseAspect::writeToSettingsImmediatly() const +{ + QStringList groups; + if (d->m_container) + groups = d->m_container->settingsGroups(); + const SettingsGroupNester nester(groups); + writeSettings(); +} + /*! Returns the string that should be used when this action appears in menus or other places that are typically used with Book style capitalization. @@ -2344,28 +2360,16 @@ void AspectContainer::toMap(QVariantMap &map) const void AspectContainer::readSettings() { - QTC_ASSERT(theSettings, return); - for (const QString &group : d->m_settingsGroup) - theSettings->beginGroup(group); - + const SettingsGroupNester nester(d->m_settingsGroup); for (BaseAspect *aspect : std::as_const(d->m_items)) aspect->readSettings(); - - for (int i = 0; i != d->m_settingsGroup.size(); ++i) - theSettings->endGroup(); } void AspectContainer::writeSettings() const { - QTC_ASSERT(theSettings, return); - for (const QString &group : d->m_settingsGroup) - theSettings->beginGroup(group); - + const SettingsGroupNester nester(d->m_settingsGroup); for (BaseAspect *aspect : std::as_const(d->m_items)) aspect->writeSettings(); - - for (int i = 0; i != d->m_settingsGroup.size(); ++i) - theSettings->endGroup(); } void AspectContainer::setSettingsGroup(const QString &groupKey) @@ -2378,6 +2382,11 @@ void AspectContainer::setSettingsGroups(const QString &groupKey, const QString & d->m_settingsGroup = QStringList{groupKey, subGroupKey}; } +QStringList AspectContainer::settingsGroups() const +{ + return d->m_settingsGroup; +} + void AspectContainer::apply() { const bool willChange = isDirty(); @@ -2579,4 +2588,22 @@ void BaseAspect::Data::Ptr::operator=(const Ptr &other) m_data = other.m_data->clone(); } +// SettingsGroupNester + +SettingsGroupNester::SettingsGroupNester(const QStringList &groups) + : m_groupCount(groups.size()) +{ + QTC_ASSERT(theSettings, return); + for (const QString &group : groups) + theSettings->beginGroup(group); +} + +SettingsGroupNester::~SettingsGroupNester() +{ + QTC_ASSERT(theSettings, return); + for (int i = 0; i != m_groupCount; ++i) + theSettings->endGroup(); +} + + } // namespace Utils diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 3dfd6d7aac9..e2093a2206b 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -165,6 +165,9 @@ public: static void setSettings(QSettings *settings); static QSettings *settings(); + // This is expensive. Do not use without good reason + void writeToSettingsImmediatly() const; + signals: void changed(); // "internal" void volatileValueChanged(); @@ -728,6 +731,18 @@ private: QList<BaseAspect::Data::Ptr> m_data; // Owned. }; +class QTCREATOR_UTILS_EXPORT SettingsGroupNester +{ + Q_DISABLE_COPY_MOVE(SettingsGroupNester) + +public: + explicit SettingsGroupNester(const QStringList &groups); + ~SettingsGroupNester(); + +private: + const int m_groupCount; +}; + class QTCREATOR_UTILS_EXPORT AspectContainer : public QObject { Q_OBJECT @@ -758,6 +773,7 @@ public: void setSettingsGroup(const QString &groupKey); void setSettingsGroups(const QString &groupKey, const QString &subGroupKey); + QStringList settingsGroups() const; void apply(); void cancel(); From 846ff37aacefa08715b2237ba58d7648b305c5b1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 24 Jul 2023 17:00:32 +0200 Subject: [PATCH 0473/1777] Valgrind: Fix valgrind settings persistence Change-Id: Idcd551e10d36cbadb8785bd7922777a45a871518 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/valgrind/memchecktool.cpp | 3 ++ src/plugins/valgrind/valgrindsettings.cpp | 39 +---------------------- src/plugins/valgrind/valgrindsettings.h | 5 --- 3 files changed, 4 insertions(+), 43 deletions(-) diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 9c6e935c77f..39a091b58f1 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -927,9 +927,11 @@ void MemcheckToolPrivate::updateFromSettings() m_filterProjectAction->setChecked(!m_settings->filterExternalIssues()); m_errorView->settingsChanged(m_settings); + m_errorProxyModel.setAcceptedKinds(m_settings->visibleErrorKinds()); connect(&m_settings->visibleErrorKinds, &BaseAspect::changed, &m_errorProxyModel, [this] { m_errorProxyModel.setAcceptedKinds(m_settings->visibleErrorKinds()); }); + m_errorProxyModel.setFilterExternalIssues(m_settings->filterExternalIssues()); connect(&m_settings->filterExternalIssues, &BaseAspect::changed, &m_errorProxyModel, [this] { m_errorProxyModel.setFilterExternalIssues(m_settings->filterExternalIssues()); }); @@ -1109,6 +1111,7 @@ void MemcheckToolPrivate::updateErrorFilter() } } m_settings->visibleErrorKinds.setValue(errorKinds); + m_settings->visibleErrorKinds.writeToSettingsImmediatly(); } int MemcheckToolPrivate::updateUiAfterFinishedHelper() diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 1446ab2712a..82160908b72 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -416,6 +416,7 @@ ValgrindGlobalSettings::ValgrindGlobalSettings() setConfigWidgetCreator([this] { return createSettingsWidget(this); }); + setSettingsGroup("Analyzer"); readSettings(); setAutoApply(false); } @@ -424,44 +425,6 @@ ValgrindGlobalSettings::ValgrindGlobalSettings() // Memcheck // -QVariantMap ValgrindBaseSettings::defaultSettings() const -{ - QVariantMap defaults; - forEachAspect([&defaults](BaseAspect *aspect) { - defaults.insert(aspect->settingsKey(), aspect->defaultVariantValue()); - }); - return defaults; -} - -static const char groupC[] = "Analyzer"; - -void ValgrindGlobalSettings::readSettings() -{ - // Read stored values - QSettings *settings = Core::ICore::settings(); - settings->beginGroup(groupC); - QVariantMap map; - const QStringList childKey = settings->childKeys(); - for (const QString &key : childKey) - map.insert(key, settings->value(key)); - settings->endGroup(); - - fromMap(map); -} - -void ValgrindGlobalSettings::writeSettings() const -{ - const QVariantMap defaults = defaultSettings(); - - Utils::QtcSettings *settings = Core::ICore::settings(); - settings->beginGroup(groupC); - QVariantMap map; - toMap(map); - for (QVariantMap::ConstIterator it = map.constBegin(); it != map.constEnd(); ++it) - settings->setValueWithDefault(it.key(), it.value(), defaults.value(it.key())); - settings->endGroup(); -} - ////////////////////////////////////////////////////////////////// // // ValgrindProjectSettings diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index 9687a545ecf..68e6d21969d 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -96,8 +96,6 @@ public: Utils::BoolAspect enableEventToolTips{this}; Utils::DoubleAspect minimumInclusiveCostRatio{this}; Utils::DoubleAspect visualizationMinimumInclusiveCostRatio{this}; - - QVariantMap defaultSettings() const; }; /** @@ -114,9 +112,6 @@ public: * Global memcheck settings */ - void writeSettings() const; - void readSettings(); - Utils::FilePathAspect lastSuppressionDirectory{this}; Utils::StringAspect lastSuppressionHistory{this}; From b53d1186eaba5693c222ba9ea231c8add595def6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 25 Jul 2023 10:44:44 +0200 Subject: [PATCH 0474/1777] Valgrind: Remove one copied member when direct access is ok Change-Id: I2813d062781571b50ae89e6f0482a4e72419ccde Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/valgrind/suppressiondialog.cpp | 3 +-- src/plugins/valgrind/suppressiondialog.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/valgrind/suppressiondialog.cpp b/src/plugins/valgrind/suppressiondialog.cpp index 6273580e82d..33be943ddd4 100644 --- a/src/plugins/valgrind/suppressiondialog.cpp +++ b/src/plugins/valgrind/suppressiondialog.cpp @@ -93,7 +93,6 @@ static bool equalSuppression(const Error &error, const Error &suppressed) SuppressionDialog::SuppressionDialog(MemcheckErrorView *view, const QList<Error> &errors) : m_view(view), - m_settings(view->settings()), m_cleanupIfCanceled(false), m_errors(errors), m_fileChooser(new PathChooser(this)), @@ -191,7 +190,7 @@ void SuppressionDialog::accept() } } - m_settings->suppressions.addSuppressionFile(path); + m_view->settings()->suppressions.addSuppressionFile(path); const QModelIndexList indices = Utils::sorted(m_view->selectionModel()->selectedRows(), [](const QModelIndex &l, const QModelIndex &r) { diff --git a/src/plugins/valgrind/suppressiondialog.h b/src/plugins/valgrind/suppressiondialog.h index b4aac0d644d..c042089ac6d 100644 --- a/src/plugins/valgrind/suppressiondialog.h +++ b/src/plugins/valgrind/suppressiondialog.h @@ -18,7 +18,6 @@ namespace Valgrind { namespace Internal { class MemcheckErrorView; -class ValgrindBaseSettings; class SuppressionDialog : public QDialog { @@ -33,7 +32,6 @@ private: void reject() override; MemcheckErrorView *m_view; - ValgrindBaseSettings *m_settings; bool m_cleanupIfCanceled; QList<XmlProtocol::Error> m_errors; From 82f39892f97405ee0cd51b4a5ebe28aca599b252 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 25 Jul 2023 10:52:07 +0200 Subject: [PATCH 0475/1777] Valgrind: Inline suppressiondialog.{h,cpp} into its only user Change-Id: Ica1e67ce67c15c2481b0d892090f6a59fb6d2145 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/valgrind/CMakeLists.txt | 1 - src/plugins/valgrind/memcheckerrorview.cpp | 237 +++++++++++++++++++- src/plugins/valgrind/suppressiondialog.cpp | 245 --------------------- src/plugins/valgrind/suppressiondialog.h | 44 ---- src/plugins/valgrind/valgrind.qbs | 1 - 5 files changed, 233 insertions(+), 295 deletions(-) delete mode 100644 src/plugins/valgrind/suppressiondialog.cpp delete mode 100644 src/plugins/valgrind/suppressiondialog.h diff --git a/src/plugins/valgrind/CMakeLists.txt b/src/plugins/valgrind/CMakeLists.txt index e931c16ece2..f3f1fce9bcb 100644 --- a/src/plugins/valgrind/CMakeLists.txt +++ b/src/plugins/valgrind/CMakeLists.txt @@ -24,7 +24,6 @@ add_qtc_plugin(Valgrind callgrindvisualisation.cpp callgrindvisualisation.h memcheckerrorview.cpp memcheckerrorview.h memchecktool.cpp memchecktool.h - suppressiondialog.cpp suppressiondialog.h valgrind.qrc valgrindengine.cpp valgrindengine.h valgrindplugin.cpp diff --git a/src/plugins/valgrind/memcheckerrorview.cpp b/src/plugins/valgrind/memcheckerrorview.cpp index 48e9afd8018..8977a950074 100644 --- a/src/plugins/valgrind/memcheckerrorview.cpp +++ b/src/plugins/valgrind/memcheckerrorview.cpp @@ -3,24 +3,33 @@ #include "memcheckerrorview.h" -#include "suppressiondialog.h" #include "valgrindsettings.h" #include "valgrindtr.h" #include "xmlprotocol/error.h" #include "xmlprotocol/errorlistmodel.h" +#include "xmlprotocol/frame.h" +#include "xmlprotocol/stack.h" #include "xmlprotocol/suppression.h" -#include <coreplugin/editormanager/editormanager.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectmanager.h> +#include <projectexplorer/projectnodes.h> -#include <utils/qtcassert.h> +#include <utils/algorithm.h> #include <utils/icon.h> +#include <utils/pathchooser.h> +#include <utils/qtcassert.h> #include <utils/theme/theme.h> #include <QAction> +#include <QDialog> +#include <QDialogButtonBox> +#include <QFormLayout> +#include <QLabel> +#include <QPlainTextEdit> +#include <QPushButton> using namespace Utils; using namespace Valgrind::XmlProtocol; @@ -28,6 +37,25 @@ using namespace Valgrind::XmlProtocol; namespace Valgrind { namespace Internal { +class SuppressionDialog : public QDialog +{ +public: + SuppressionDialog(MemcheckErrorView *view, const QList<XmlProtocol::Error> &errors); + +private: + void validate(); + void accept() override; + void reject() override; + + MemcheckErrorView *m_view; + bool m_cleanupIfCanceled; + QList<XmlProtocol::Error> m_errors; + + Utils::PathChooser *m_fileChooser; + QPlainTextEdit *m_suppressionEdit; + QDialogButtonBox *m_buttonBox; +}; + MemcheckErrorView::MemcheckErrorView(QWidget *parent) : Debugger::DetailedErrorView(parent) { @@ -66,7 +94,23 @@ void MemcheckErrorView::settingsChanged(ValgrindBaseSettings *settings) void MemcheckErrorView::suppressError() { - SuppressionDialog::maybeShow(this); + QModelIndexList indices = selectionModel()->selectedRows(); + // Can happen when using arrow keys to navigate and shortcut to trigger suppression: + if (indices.isEmpty() && selectionModel()->currentIndex().isValid()) + indices.append(selectionModel()->currentIndex()); + + QList<XmlProtocol::Error> errors; + for (const QModelIndex &index : std::as_const(indices)) { + Error error = model()->data(index, ErrorListModel::ErrorRole).value<Error>(); + if (!error.suppression().isNull()) + errors.append(error); + } + + if (errors.isEmpty()) + return; + + SuppressionDialog dialog(this, errors); + dialog.exec(); } QList<QAction *> MemcheckErrorView::customActions() const @@ -88,5 +132,190 @@ QList<QAction *> MemcheckErrorView::customActions() const return actions; } +static QString suppressionText(const Error &error) +{ + Suppression sup(error.suppression()); + + // workaround: https://bugs.kde.org/show_bug.cgi?id=255822 + if (sup.frames().size() >= 24) + sup.setFrames(sup.frames().mid(0, 23)); + QTC_CHECK(sup.frames().size() < 24); + + // try to set some useful name automatically, instead of "insert_name_here" + // we take the last stack frame and append the suppression kind, e.g.: + // QDebug::operator<<(bool) [Memcheck:Cond] + if (!error.stacks().isEmpty() && !error.stacks().constFirst().frames().isEmpty()) { + const Frame frame = error.stacks().constFirst().frames().constFirst(); + + QString newName; + if (!frame.functionName().isEmpty()) + newName = frame.functionName(); + else if (!frame.object().isEmpty()) + newName = frame.object(); + + if (!newName.isEmpty()) + sup.setName(newName + '[' + sup.kind() + ']'); + } + + return sup.toString(); +} + +/// @p error input error, which might get hidden when it has the same stack +/// @p suppressed the error that got suppressed already +static bool equalSuppression(const Error &error, const Error &suppressed) +{ + if (error.kind() != suppressed.kind() || error.suppression().isNull()) + return false; + + const SuppressionFrames errorFrames = error.suppression().frames(); + const SuppressionFrames suppressedFrames = suppressed.suppression().frames(); + + // limit to 23 frames, see: https://bugs.kde.org/show_bug.cgi?id=255822 + if (qMin(23, suppressedFrames.size()) > errorFrames.size()) + return false; + + int frames = 23; + if (errorFrames.size() < frames) + frames = errorFrames.size(); + + if (suppressedFrames.size() < frames) + frames = suppressedFrames.size(); + + for (int i = 0; i < frames; ++i) + if (errorFrames.at(i) != suppressedFrames.at(i)) + return false; + + return true; +} + +SuppressionDialog::SuppressionDialog(MemcheckErrorView *view, const QList<Error> &errors) + : m_view(view), + m_cleanupIfCanceled(false), + m_errors(errors), + m_fileChooser(new PathChooser(this)), + m_suppressionEdit(new QPlainTextEdit(this)) +{ + setWindowTitle(Tr::tr("Save Suppression")); + + auto fileLabel = new QLabel(Tr::tr("Suppression File:"), this); + + auto suppressionsLabel = new QLabel(Tr::tr("Suppression:"), this); + suppressionsLabel->setBuddy(m_suppressionEdit); + + QFont font; + font.setFamily("Monospace"); + m_suppressionEdit->setFont(font); + + m_buttonBox = new QDialogButtonBox(this); + m_buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Save); + + auto formLayout = new QFormLayout(this); + formLayout->addRow(fileLabel, m_fileChooser); + formLayout->addRow(suppressionsLabel); + formLayout->addRow(m_suppressionEdit); + formLayout->addRow(m_buttonBox); + + const FilePath defaultSuppFile = view->defaultSuppressionFile(); + if (!defaultSuppFile.exists() && defaultSuppFile.ensureExistingFile()) + m_cleanupIfCanceled = true; + + m_fileChooser->setExpectedKind(PathChooser::File); + m_fileChooser->setHistoryCompleter("Valgrind.Suppression.History"); + m_fileChooser->setPath(defaultSuppFile.fileName()); + m_fileChooser->setPromptDialogFilter("*.supp"); + m_fileChooser->setPromptDialogTitle(Tr::tr("Select Suppression File")); + + QString suppressions; + for (const Error &error : std::as_const(m_errors)) + suppressions += suppressionText(error); + + m_suppressionEdit->setPlainText(suppressions); + + connect(m_fileChooser, &PathChooser::validChanged, + this, &SuppressionDialog::validate); + connect(m_suppressionEdit->document(), &QTextDocument::contentsChanged, + this, &SuppressionDialog::validate); + connect(m_buttonBox, &QDialogButtonBox::accepted, + this, &SuppressionDialog::accept); + connect(m_buttonBox, &QDialogButtonBox::rejected, + this, &SuppressionDialog::reject); +} + +void SuppressionDialog::accept() +{ + const FilePath path = m_fileChooser->filePath(); + QTC_ASSERT(!path.isEmpty(), return); + QTC_ASSERT(!m_suppressionEdit->toPlainText().trimmed().isEmpty(), return); + + FileSaver saver(path, QIODevice::Append); + if (!saver.hasError()) { + QTextStream stream(saver.file()); + stream << m_suppressionEdit->toPlainText(); + saver.setResult(&stream); + } + if (!saver.finalize(this)) + return; + + // Add file to project if there is a project containing this file on the file system. + if (!ProjectExplorer::ProjectManager::projectForFile(path)) { + for (ProjectExplorer::Project *p : ProjectExplorer::ProjectManager::projects()) { + if (path.startsWith(p->projectDirectory().toString())) { + p->rootProjectNode()->addFiles({path}); + break; + } + } + } + + m_view->settings()->suppressions.addSuppressionFile(path); + + const QModelIndexList indices = Utils::sorted(m_view->selectionModel()->selectedRows(), + [](const QModelIndex &l, const QModelIndex &r) { + return l.row() > r.row(); + }); + QAbstractItemModel *model = m_view->model(); + for (const QModelIndex &index : indices) { + bool removed = model->removeRow(index.row()); + QTC_ASSERT(removed, qt_noop()); + Q_UNUSED(removed) + } + + // One suppression might hide multiple rows, care for that. + for (int row = 0; row < model->rowCount(); ++row ) { + const Error rowError = model->data( + model->index(row, 0), ErrorListModel::ErrorRole).value<Error>(); + + for (const Error &error : std::as_const(m_errors)) { + if (equalSuppression(rowError, error)) { + bool removed = model->removeRow(row); + QTC_CHECK(removed); + // Gets incremented in the for loop again. + --row; + break; + } + } + } + + // Select a new item. + m_view->setCurrentIndex(indices.first()); + + QDialog::accept(); +} + +void SuppressionDialog::reject() +{ + if (m_cleanupIfCanceled) + m_view->defaultSuppressionFile().removeFile(); + + QDialog::reject(); +} + +void SuppressionDialog::validate() +{ + bool valid = m_fileChooser->isValid() + && !m_suppressionEdit->toPlainText().trimmed().isEmpty(); + + m_buttonBox->button(QDialogButtonBox::Save)->setEnabled(valid); +} + } // namespace Internal } // namespace Valgrind diff --git a/src/plugins/valgrind/suppressiondialog.cpp b/src/plugins/valgrind/suppressiondialog.cpp deleted file mode 100644 index 33be943ddd4..00000000000 --- a/src/plugins/valgrind/suppressiondialog.cpp +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "suppressiondialog.h" - -#include "memcheckerrorview.h" -#include "valgrindsettings.h" -#include "valgrindtr.h" - -#include "xmlprotocol/suppression.h" -#include "xmlprotocol/errorlistmodel.h" -#include "xmlprotocol/stack.h" -#include "xmlprotocol/frame.h" - -#include <projectexplorer/project.h> -#include <projectexplorer/projectexplorer.h> -#include <projectexplorer/projectmanager.h> -#include <projectexplorer/projectnodes.h> - -#include <utils/algorithm.h> -#include <utils/pathchooser.h> -#include <utils/fileutils.h> -#include <utils/qtcassert.h> - -#include <QDialogButtonBox> -#include <QFile> -#include <QFormLayout> -#include <QLabel> -#include <QPlainTextEdit> -#include <QPushButton> - -using namespace Utils; -using namespace Valgrind::XmlProtocol; - -namespace Valgrind { -namespace Internal { - -static QString suppressionText(const Error &error) -{ - Suppression sup(error.suppression()); - - // workaround: https://bugs.kde.org/show_bug.cgi?id=255822 - if (sup.frames().size() >= 24) - sup.setFrames(sup.frames().mid(0, 23)); - QTC_CHECK(sup.frames().size() < 24); - - // try to set some useful name automatically, instead of "insert_name_here" - // we take the last stack frame and append the suppression kind, e.g.: - // QDebug::operator<<(bool) [Memcheck:Cond] - if (!error.stacks().isEmpty() && !error.stacks().constFirst().frames().isEmpty()) { - const Frame frame = error.stacks().constFirst().frames().constFirst(); - - QString newName; - if (!frame.functionName().isEmpty()) - newName = frame.functionName(); - else if (!frame.object().isEmpty()) - newName = frame.object(); - - if (!newName.isEmpty()) - sup.setName(newName + '[' + sup.kind() + ']'); - } - - return sup.toString(); -} - -/// @p error input error, which might get hidden when it has the same stack -/// @p suppressed the error that got suppressed already -static bool equalSuppression(const Error &error, const Error &suppressed) -{ - if (error.kind() != suppressed.kind() || error.suppression().isNull()) - return false; - - const SuppressionFrames errorFrames = error.suppression().frames(); - const SuppressionFrames suppressedFrames = suppressed.suppression().frames(); - - // limit to 23 frames, see: https://bugs.kde.org/show_bug.cgi?id=255822 - if (qMin(23, suppressedFrames.size()) > errorFrames.size()) - return false; - - int frames = 23; - if (errorFrames.size() < frames) - frames = errorFrames.size(); - - if (suppressedFrames.size() < frames) - frames = suppressedFrames.size(); - - for (int i = 0; i < frames; ++i) - if (errorFrames.at(i) != suppressedFrames.at(i)) - return false; - - return true; -} - -SuppressionDialog::SuppressionDialog(MemcheckErrorView *view, const QList<Error> &errors) - : m_view(view), - m_cleanupIfCanceled(false), - m_errors(errors), - m_fileChooser(new PathChooser(this)), - m_suppressionEdit(new QPlainTextEdit(this)) -{ - setWindowTitle(Tr::tr("Save Suppression")); - - auto fileLabel = new QLabel(Tr::tr("Suppression File:"), this); - - auto suppressionsLabel = new QLabel(Tr::tr("Suppression:"), this); - suppressionsLabel->setBuddy(m_suppressionEdit); - - QFont font; - font.setFamily("Monospace"); - m_suppressionEdit->setFont(font); - - m_buttonBox = new QDialogButtonBox(this); - m_buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Save); - - auto formLayout = new QFormLayout(this); - formLayout->addRow(fileLabel, m_fileChooser); - formLayout->addRow(suppressionsLabel); - formLayout->addRow(m_suppressionEdit); - formLayout->addRow(m_buttonBox); - - const FilePath defaultSuppFile = view->defaultSuppressionFile(); - if (!defaultSuppFile.exists() && defaultSuppFile.ensureExistingFile()) - m_cleanupIfCanceled = true; - - m_fileChooser->setExpectedKind(PathChooser::File); - m_fileChooser->setHistoryCompleter("Valgrind.Suppression.History"); - m_fileChooser->setPath(defaultSuppFile.fileName()); - m_fileChooser->setPromptDialogFilter("*.supp"); - m_fileChooser->setPromptDialogTitle(Tr::tr("Select Suppression File")); - - QString suppressions; - for (const Error &error : std::as_const(m_errors)) - suppressions += suppressionText(error); - - m_suppressionEdit->setPlainText(suppressions); - - connect(m_fileChooser, &PathChooser::validChanged, - this, &SuppressionDialog::validate); - connect(m_suppressionEdit->document(), &QTextDocument::contentsChanged, - this, &SuppressionDialog::validate); - connect(m_buttonBox, &QDialogButtonBox::accepted, - this, &SuppressionDialog::accept); - connect(m_buttonBox, &QDialogButtonBox::rejected, - this, &SuppressionDialog::reject); -} - -void SuppressionDialog::maybeShow(MemcheckErrorView *view) -{ - QModelIndexList indices = view->selectionModel()->selectedRows(); - // Can happen when using arrow keys to navigate and shortcut to trigger suppression: - if (indices.isEmpty() && view->selectionModel()->currentIndex().isValid()) - indices.append(view->selectionModel()->currentIndex()); - - QList<XmlProtocol::Error> errors; - for (const QModelIndex &index : std::as_const(indices)) { - Error error = view->model()->data(index, ErrorListModel::ErrorRole).value<Error>(); - if (!error.suppression().isNull()) - errors.append(error); - } - - if (errors.isEmpty()) - return; - - SuppressionDialog dialog(view, errors); - dialog.exec(); -} - -void SuppressionDialog::accept() -{ - const FilePath path = m_fileChooser->filePath(); - QTC_ASSERT(!path.isEmpty(), return); - QTC_ASSERT(!m_suppressionEdit->toPlainText().trimmed().isEmpty(), return); - - FileSaver saver(path, QIODevice::Append); - if (!saver.hasError()) { - QTextStream stream(saver.file()); - stream << m_suppressionEdit->toPlainText(); - saver.setResult(&stream); - } - if (!saver.finalize(this)) - return; - - // Add file to project if there is a project containing this file on the file system. - if (!ProjectExplorer::ProjectManager::projectForFile(path)) { - for (ProjectExplorer::Project *p : ProjectExplorer::ProjectManager::projects()) { - if (path.startsWith(p->projectDirectory().toString())) { - p->rootProjectNode()->addFiles({path}); - break; - } - } - } - - m_view->settings()->suppressions.addSuppressionFile(path); - - const QModelIndexList indices = Utils::sorted(m_view->selectionModel()->selectedRows(), - [](const QModelIndex &l, const QModelIndex &r) { - return l.row() > r.row(); - }); - QAbstractItemModel *model = m_view->model(); - for (const QModelIndex &index : indices) { - bool removed = model->removeRow(index.row()); - QTC_ASSERT(removed, qt_noop()); - Q_UNUSED(removed) - } - - // One suppression might hide multiple rows, care for that. - for (int row = 0; row < model->rowCount(); ++row ) { - const Error rowError = model->data( - model->index(row, 0), ErrorListModel::ErrorRole).value<Error>(); - - for (const Error &error : std::as_const(m_errors)) { - if (equalSuppression(rowError, error)) { - bool removed = model->removeRow(row); - QTC_CHECK(removed); - // Gets incremented in the for loop again. - --row; - break; - } - } - } - - // Select a new item. - m_view->setCurrentIndex(indices.first()); - - QDialog::accept(); -} - -void SuppressionDialog::reject() -{ - if (m_cleanupIfCanceled) - m_view->defaultSuppressionFile().removeFile(); - - QDialog::reject(); -} - -void SuppressionDialog::validate() -{ - bool valid = m_fileChooser->isValid() - && !m_suppressionEdit->toPlainText().trimmed().isEmpty(); - - m_buttonBox->button(QDialogButtonBox::Save)->setEnabled(valid); -} - -} // namespace Internal -} // namespace Valgrind diff --git a/src/plugins/valgrind/suppressiondialog.h b/src/plugins/valgrind/suppressiondialog.h deleted file mode 100644 index c042089ac6d..00000000000 --- a/src/plugins/valgrind/suppressiondialog.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "xmlprotocol/error.h" - -#include <utils/pathchooser.h> - -#include <QDialog> - -QT_BEGIN_NAMESPACE -class QPlainTextEdit; -class QDialogButtonBox; -QT_END_NAMESPACE - -namespace Valgrind { -namespace Internal { - -class MemcheckErrorView; - -class SuppressionDialog : public QDialog -{ -public: - SuppressionDialog(MemcheckErrorView *view, - const QList<XmlProtocol::Error> &errors); - static void maybeShow(MemcheckErrorView *view); - -private: - void validate(); - void accept() override; - void reject() override; - - MemcheckErrorView *m_view; - bool m_cleanupIfCanceled; - QList<XmlProtocol::Error> m_errors; - - Utils::PathChooser *m_fileChooser; - QPlainTextEdit *m_suppressionEdit; - QDialogButtonBox *m_buttonBox; -}; - -} // namespace Internal -} // namespace Valgrind diff --git a/src/plugins/valgrind/valgrind.qbs b/src/plugins/valgrind/valgrind.qbs index 590ecb4e73c..d5ca08f7806 100644 --- a/src/plugins/valgrind/valgrind.qbs +++ b/src/plugins/valgrind/valgrind.qbs @@ -28,7 +28,6 @@ QtcPlugin { "callgrindvisualisation.cpp", "callgrindvisualisation.h", "memcheckerrorview.cpp", "memcheckerrorview.h", "memchecktool.cpp", "memchecktool.h", - "suppressiondialog.cpp", "suppressiondialog.h", "valgrind.qrc", "valgrindengine.cpp", "valgrindengine.h", "valgrindplugin.cpp", From d8deb81e3f07a5961e503330e02b004096977d6a Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 21 Jul 2023 01:22:39 +0200 Subject: [PATCH 0476/1777] GenericLinuxDeviceConfigurationWizard: Rename into SshDeviceWizard Change-Id: I67baad931c524376de6ae67a361db6866a910317 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/qnx/qnxdevice.cpp | 3 +-- .../remotelinux/genericlinuxdeviceconfigurationwizard.cpp | 3 +-- .../remotelinux/genericlinuxdeviceconfigurationwizard.h | 7 ++----- src/plugins/remotelinux/linuxdevice.cpp | 3 +-- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/plugins/qnx/qnxdevice.cpp b/src/plugins/qnx/qnxdevice.cpp index ccb19c2031d..733772a10c6 100644 --- a/src/plugins/qnx/qnxdevice.cpp +++ b/src/plugins/qnx/qnxdevice.cpp @@ -95,8 +95,7 @@ QnxDeviceFactory::QnxDeviceFactory() : IDeviceFactory(Constants::QNX_QNX_OS_TYPE setConstructionFunction([] { return IDevice::Ptr(new QnxDevice); }); setCreator([]() -> IDevice::Ptr { const IDevice::Ptr device = IDevice::Ptr(new QnxDevice); - GenericLinuxDeviceConfigurationWizard wizard( - Tr::tr("New QNX Device Configuration Setup"), device); + SshDeviceWizard wizard(Tr::tr("New QNX Device Configuration Setup"), device); if (wizard.exec() != QDialog::Accepted) return {}; return device; diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp index 314a0f518bf..da0aa3b8cd8 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp @@ -208,8 +208,7 @@ private: QLabel m_infoLabel; }; -GenericLinuxDeviceConfigurationWizard::GenericLinuxDeviceConfigurationWizard( - const QString &title, const ProjectExplorer::IDevicePtr &device) +SshDeviceWizard::SshDeviceWizard(const QString &title, const ProjectExplorer::IDevicePtr &device) : Wizard(Core::ICore::dialogParent()) { setWindowTitle(title); diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h index 2d1892e4c36..3bd2af1ab22 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h @@ -10,13 +10,10 @@ namespace RemoteLinux { -class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizard : public Utils::Wizard +class REMOTELINUX_EXPORT SshDeviceWizard : public Utils::Wizard { - Q_OBJECT - public: - GenericLinuxDeviceConfigurationWizard(const QString &title, - const ProjectExplorer::IDevicePtr &device); + SshDeviceWizard(const QString &title, const ProjectExplorer::IDevicePtr &device); }; } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 782ed03d2fd..a80e4380b06 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -1484,8 +1484,7 @@ LinuxDeviceFactory::LinuxDeviceFactory() setQuickCreationAllowed(true); setCreator([]() -> IDevice::Ptr { const IDevice::Ptr device = LinuxDevice::create(); - GenericLinuxDeviceConfigurationWizard wizard( - Tr::tr("New Remote Linux Device Configuration Setup"), device); + SshDeviceWizard wizard(Tr::tr("New Remote Linux Device Configuration Setup"), device); if (wizard.exec() != QDialog::Accepted) return {}; return device; From 3f79a077e8e10de9393210e5b6532e12ce3c7017 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 25 Jul 2023 11:38:22 +0200 Subject: [PATCH 0477/1777] Core: Proliferate FilePath use a bit Change-Id: I06c9a9875b0698e3ccab13a2f1136cdbcac621b3 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/editormanager/editormanager.cpp | 4 ++-- src/plugins/coreplugin/editormanager/editormanager.h | 2 +- src/plugins/projectexplorer/projectmanager.cpp | 5 ++--- src/plugins/projectexplorer/projectmanager.h | 2 +- src/plugins/qmlprofiler/qmlprofilertool.cpp | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 2e321341b01..946355a0abc 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1442,7 +1442,7 @@ IEditor *EditorManagerPrivate::createEditor(IEditorFactory *factory, const FileP connect(document, &IDocument::changed, d, [document] { d->handleDocumentStateChange(document); }); - emit m_instance->editorCreated(editor, filePath.toString()); + emit m_instance->editorCreated(editor, filePath); } return editor; @@ -1531,7 +1531,7 @@ IEditor *EditorManagerPrivate::duplicateEditor(IEditor *editor) return nullptr; IEditor *duplicate = editor->duplicate(); - emit m_instance->editorCreated(duplicate, duplicate->document()->filePath().toString()); + emit m_instance->editorCreated(duplicate, duplicate->document()->filePath()); addEditor(duplicate); return duplicate; } diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index ea0fd5df8cd..5e211c88e2f 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -154,7 +154,7 @@ signals: void currentEditorChanged(Core::IEditor *editor); void currentDocumentStateChanged(); void documentStateChanged(Core::IDocument *document); - void editorCreated(Core::IEditor *editor, const QString &fileName); + void editorCreated(Core::IEditor *editor, const Utils::FilePath &filePath); void editorOpened(Core::IEditor *editor); void documentOpened(Core::IDocument *document); void editorAboutToClose(Core::IEditor *editor); diff --git a/src/plugins/projectexplorer/projectmanager.cpp b/src/plugins/projectexplorer/projectmanager.cpp index e3c8e65c59b..e1e8175b2fa 100644 --- a/src/plugins/projectexplorer/projectmanager.cpp +++ b/src/plugins/projectexplorer/projectmanager.cpp @@ -520,12 +520,11 @@ Project *ProjectManager::projectWithProjectFilePath(const FilePath &filePath) [&filePath](const Project *p) { return p->projectFilePath() == filePath; }); } -void ProjectManager::configureEditor(IEditor *editor, const QString &fileName) +void ProjectManager::configureEditor(IEditor *editor, const FilePath &filePath) { if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor*>(editor)) { - Project *project = projectForFile(Utils::FilePath::fromString(fileName)); // Global settings are the default. - if (project) + if (Project *project = projectForFile(filePath)) project->editorConfiguration()->configureEditor(textEditor); } } diff --git a/src/plugins/projectexplorer/projectmanager.h b/src/plugins/projectexplorer/projectmanager.h index f49cc96e54c..27913a00cd0 100644 --- a/src/plugins/projectexplorer/projectmanager.h +++ b/src/plugins/projectexplorer/projectmanager.h @@ -97,7 +97,7 @@ signals: void projectFinishedParsing(ProjectExplorer::Project *project); private: - static void configureEditor(Core::IEditor *editor, const QString &fileName); + static void configureEditor(Core::IEditor *editor, const Utils::FilePath &filePath); static void configureEditors(Project *project); static void registerProjectCreator(const QString &mimeType, diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index c8e38d100f6..1f27fb30124 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -228,9 +228,9 @@ QmlProfilerTool::QmlProfilerTool() QmlProfilerTextMarkModel *model = d->m_profilerModelManager->textMarkModel(); if (EditorManager *editorManager = EditorManager::instance()) { connect(editorManager, &EditorManager::editorCreated, - model, [this, model](Core::IEditor *editor, const QString &fileName) { + model, [this, model](Core::IEditor *editor, const FilePath &filePath) { Q_UNUSED(editor) - model->createMarks(d->m_viewContainer, fileName); + model->createMarks(d->m_viewContainer, filePath.toString()); }); } From d8ffbfb3ff47d4da850223a08c26f33b5be6b440 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 21 Jul 2023 01:31:04 +0200 Subject: [PATCH 0478/1777] RemoteLinux: Rename into sshdevicewizard{cpp, h} Change-Id: I0a385887791be962f5ad4435b2b1b01913ae32c7 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/qnx/qnxdevice.cpp | 4 ++-- src/plugins/remotelinux/CMakeLists.txt | 2 +- src/plugins/remotelinux/linuxdevice.cpp | 2 +- src/plugins/remotelinux/remotelinux.qbs | 4 ++-- ...linuxdeviceconfigurationwizard.cpp => sshdevicewizard.cpp} | 2 +- ...ericlinuxdeviceconfigurationwizard.h => sshdevicewizard.h} | 0 6 files changed, 7 insertions(+), 7 deletions(-) rename src/plugins/remotelinux/{genericlinuxdeviceconfigurationwizard.cpp => sshdevicewizard.cpp} (99%) rename src/plugins/remotelinux/{genericlinuxdeviceconfigurationwizard.h => sshdevicewizard.h} (100%) diff --git a/src/plugins/qnx/qnxdevice.cpp b/src/plugins/qnx/qnxdevice.cpp index 733772a10c6..e355183c89d 100644 --- a/src/plugins/qnx/qnxdevice.cpp +++ b/src/plugins/qnx/qnxdevice.cpp @@ -12,9 +12,9 @@ #include <projectexplorer/devicesupport/sshparameters.h> -#include <remotelinux/genericlinuxdeviceconfigurationwizard.h> -#include <remotelinux/remotelinuxsignaloperation.h> #include <remotelinux/linuxdevice.h> +#include <remotelinux/remotelinuxsignaloperation.h> +#include <remotelinux/sshdevicewizard.h> #include <utils/port.h> #include <utils/portlist.h> diff --git a/src/plugins/remotelinux/CMakeLists.txt b/src/plugins/remotelinux/CMakeLists.txt index c49f49793be..3b2133b85a5 100644 --- a/src/plugins/remotelinux/CMakeLists.txt +++ b/src/plugins/remotelinux/CMakeLists.txt @@ -7,7 +7,6 @@ add_qtc_plugin(RemoteLinux deploymenttimeinfo.cpp deploymenttimeinfo.h genericdirectuploadstep.cpp genericdirectuploadstep.h genericlinuxdeviceconfigurationwidget.cpp genericlinuxdeviceconfigurationwidget.h - genericlinuxdeviceconfigurationwizard.cpp genericlinuxdeviceconfigurationwizard.h killappstep.cpp killappstep.h linuxdevice.cpp linuxdevice.h linuxdevicetester.cpp linuxdevicetester.h @@ -26,6 +25,7 @@ add_qtc_plugin(RemoteLinux remotelinuxsignaloperation.cpp remotelinuxsignaloperation.h remotelinuxtr.h rsyncdeploystep.cpp rsyncdeploystep.h + sshdevicewizard.cpp sshdevicewizard.h sshkeycreationdialog.cpp sshkeycreationdialog.h tarpackagecreationstep.cpp tarpackagecreationstep.h tarpackagedeploystep.cpp tarpackagedeploystep.h diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index a80e4380b06..0db57bd3133 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -4,13 +4,13 @@ #include "linuxdevice.h" #include "genericlinuxdeviceconfigurationwidget.h" -#include "genericlinuxdeviceconfigurationwizard.h" #include "linuxdevicetester.h" #include "linuxprocessinterface.h" #include "publickeydeploymentdialog.h" #include "remotelinux_constants.h" #include "remotelinuxsignaloperation.h" #include "remotelinuxtr.h" +#include "sshdevicewizard.h" #include <coreplugin/icore.h> #include <coreplugin/messagemanager.h> diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs index d363603cd99..3bf972697b2 100644 --- a/src/plugins/remotelinux/remotelinux.qbs +++ b/src/plugins/remotelinux/remotelinux.qbs @@ -23,8 +23,6 @@ Project { "genericdirectuploadstep.h", "genericlinuxdeviceconfigurationwidget.cpp", "genericlinuxdeviceconfigurationwidget.h", - "genericlinuxdeviceconfigurationwizard.cpp", - "genericlinuxdeviceconfigurationwizard.h", "killappstep.cpp", "killappstep.h", "linuxdevice.cpp", @@ -56,6 +54,8 @@ Project { "remotelinuxtr.h", "rsyncdeploystep.cpp", "rsyncdeploystep.h", + "sshdevicewizard.cpp", + "sshdevicewizard.h", "sshkeycreationdialog.cpp", "sshkeycreationdialog.h", "tarpackagecreationstep.cpp", diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp b/src/plugins/remotelinux/sshdevicewizard.cpp similarity index 99% rename from src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp rename to src/plugins/remotelinux/sshdevicewizard.cpp index da0aa3b8cd8..f23db7b4035 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp +++ b/src/plugins/remotelinux/sshdevicewizard.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "genericlinuxdeviceconfigurationwizard.h" +#include "sshdevicewizard.h" #include "publickeydeploymentdialog.h" #include "remotelinuxtr.h" diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h b/src/plugins/remotelinux/sshdevicewizard.h similarity index 100% rename from src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h rename to src/plugins/remotelinux/sshdevicewizard.h From ef005dd56ed3fe68498a91c96f724ff4c8168fe5 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 21 Jul 2023 09:21:20 +0200 Subject: [PATCH 0479/1777] RemoteLinux: Unexport some classes And move them into Internal namespace. Change-Id: Ic3cc92b8250413f46f597f99fe0f1e4c8ef68950 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/remotelinux/linuxdevice.cpp | 2 +- src/plugins/remotelinux/makeinstallstep.cpp | 4 ++-- src/plugins/remotelinux/makeinstallstep.h | 9 +++------ .../remotelinux/publickeydeploymentdialog.cpp | 8 ++------ .../remotelinux/publickeydeploymentdialog.h | 15 +++++++-------- src/plugins/remotelinux/rsyncdeploystep.cpp | 4 ++-- src/plugins/remotelinux/rsyncdeploystep.h | 9 +++------ src/plugins/remotelinux/sshdevicewizard.cpp | 4 ++-- 8 files changed, 22 insertions(+), 33 deletions(-) diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 0db57bd3133..ce233f2e46b 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -952,7 +952,7 @@ LinuxDevice::LinuxDevice() setSshParameters(sshParams); addDeviceAction({Tr::tr("Deploy Public Key..."), [](const IDevice::Ptr &device, QWidget *parent) { - if (auto d = PublicKeyDeploymentDialog::createDialog(device, parent)) { + if (auto d = Internal::PublicKeyDeploymentDialog::createDialog(device, parent)) { d->exec(); delete d; } diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 9aa548c8e76..022dc9fd7cf 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -30,7 +30,7 @@ using namespace ProjectExplorer; using namespace Utils; -namespace RemoteLinux { +namespace RemoteLinux::Internal { class MakeInstallStep : public MakeStep { @@ -275,4 +275,4 @@ MakeInstallStepFactory::MakeInstallStepFactory() setDisplayName(Tr::tr("Install into temporary host directory")); } -} // RemoteLinux +} // RemoteLinux::Internal diff --git a/src/plugins/remotelinux/makeinstallstep.h b/src/plugins/remotelinux/makeinstallstep.h index 564a262abcd..d2ffed1356a 100644 --- a/src/plugins/remotelinux/makeinstallstep.h +++ b/src/plugins/remotelinux/makeinstallstep.h @@ -3,17 +3,14 @@ #pragma once -#include "remotelinux_export.h" - #include <projectexplorer/buildstep.h> -namespace RemoteLinux { +namespace RemoteLinux::Internal { -class REMOTELINUX_EXPORT MakeInstallStepFactory - : public ProjectExplorer::BuildStepFactory +class MakeInstallStepFactory : public ProjectExplorer::BuildStepFactory { public: MakeInstallStepFactory(); }; -} // namespace RemoteLinux +} // namespace RemoteLinux::Internal diff --git a/src/plugins/remotelinux/publickeydeploymentdialog.cpp b/src/plugins/remotelinux/publickeydeploymentdialog.cpp index c7b4a548103..f06f28790d9 100644 --- a/src/plugins/remotelinux/publickeydeploymentdialog.cpp +++ b/src/plugins/remotelinux/publickeydeploymentdialog.cpp @@ -17,8 +17,7 @@ using namespace ProjectExplorer; using namespace Utils; -namespace RemoteLinux { -namespace Internal { +namespace RemoteLinux::Internal { class PublicKeyDeploymentDialogPrivate { @@ -26,9 +25,6 @@ public: Process m_process; bool m_done; }; -} // namespace Internal; - -using namespace Internal; PublicKeyDeploymentDialog *PublicKeyDeploymentDialog::createDialog( const IDevice::ConstPtr &deviceConfig, QWidget *parent) @@ -128,4 +124,4 @@ void PublicKeyDeploymentDialog::handleDeploymentDone(bool succeeded, const QStri d->m_done = true; } -} // namespace RemoteLinux +} // namespace RemoteLinux::Internal diff --git a/src/plugins/remotelinux/publickeydeploymentdialog.h b/src/plugins/remotelinux/publickeydeploymentdialog.h index 285e4a1fa82..8177e58935e 100644 --- a/src/plugins/remotelinux/publickeydeploymentdialog.h +++ b/src/plugins/remotelinux/publickeydeploymentdialog.h @@ -3,24 +3,23 @@ #pragma once -#include "remotelinux_export.h" - #include <projectexplorer/devicesupport/idevicefwd.h> #include <QProgressDialog> namespace Utils { class FilePath; } -namespace RemoteLinux { -namespace Internal { class PublicKeyDeploymentDialogPrivate; } +namespace RemoteLinux::Internal { -class REMOTELINUX_EXPORT PublicKeyDeploymentDialog : public QProgressDialog +class PublicKeyDeploymentDialogPrivate; + +class PublicKeyDeploymentDialog : public QProgressDialog { Q_OBJECT public: // Asks for public key and returns null if the file dialog is canceled. - static PublicKeyDeploymentDialog *createDialog(const ProjectExplorer::IDeviceConstPtr &deviceConfig, - QWidget *parent = nullptr); + static PublicKeyDeploymentDialog *createDialog( + const ProjectExplorer::IDeviceConstPtr &deviceConfig, QWidget *parent = nullptr); PublicKeyDeploymentDialog(const ProjectExplorer::IDeviceConstPtr &deviceConfig, const Utils::FilePath &publicKeyFileName, QWidget *parent = nullptr); @@ -33,4 +32,4 @@ private: Internal::PublicKeyDeploymentDialogPrivate * const d; }; -} // namespace RemoteLinux +} // namespace RemoteLinux::Internal diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index ae496279094..203fed34643 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -26,7 +26,7 @@ using namespace ProjectExplorer; using namespace Tasking; using namespace Utils; -namespace RemoteLinux { +namespace RemoteLinux::Internal { // RsyncDeployStep @@ -205,4 +205,4 @@ RsyncDeployStepFactory::RsyncDeployStepFactory() setDisplayName(Tr::tr("Deploy files via rsync")); } -} // RemoteLinux +} // RemoteLinux::Internal diff --git a/src/plugins/remotelinux/rsyncdeploystep.h b/src/plugins/remotelinux/rsyncdeploystep.h index 7450d84fcb6..20a16e9597a 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.h +++ b/src/plugins/remotelinux/rsyncdeploystep.h @@ -3,17 +3,14 @@ #pragma once -#include "remotelinux_export.h" - #include <projectexplorer/buildstep.h> -namespace RemoteLinux { +namespace RemoteLinux::Internal { -class REMOTELINUX_EXPORT RsyncDeployStepFactory - : public ProjectExplorer::BuildStepFactory +class RsyncDeployStepFactory : public ProjectExplorer::BuildStepFactory { public: RsyncDeployStepFactory(); }; -} // namespace RemoteLinux +} // namespace RemoteLinux::Internal diff --git a/src/plugins/remotelinux/sshdevicewizard.cpp b/src/plugins/remotelinux/sshdevicewizard.cpp index f23db7b4035..7a2f48b359d 100644 --- a/src/plugins/remotelinux/sshdevicewizard.cpp +++ b/src/plugins/remotelinux/sshdevicewizard.cpp @@ -118,8 +118,8 @@ public: m_keyFileChooser.setPromptDialogTitle(Tr::tr("Choose a Private Key File")); auto const deployButton = new QPushButton(Tr::tr("Deploy Public Key"), this); connect(deployButton, &QPushButton::clicked, this, [this] { - PublicKeyDeploymentDialog dlg(m_device, - m_keyFileChooser.filePath().stringAppended(".pub"), this); + Internal::PublicKeyDeploymentDialog dlg( + m_device, m_keyFileChooser.filePath().stringAppended(".pub"), this); m_iconLabel.setPixmap((dlg.exec() == QDialog::Accepted ? Icons::OK : Icons::BROKEN).pixmap()); }); auto const createButton = new QPushButton(Tr::tr("Create New Key Pair"), this); From 70b59e74005d4871720fbacbcdc266eaca9931d6 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 25 Jul 2023 11:36:16 +0200 Subject: [PATCH 0480/1777] SshDeviceWizard: Simplify the implementation Change-Id: Iaa8c06e5bdea210c47c7672e9399729df3139020 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/remotelinux/sshdevicewizard.cpp | 68 +++++++-------------- 1 file changed, 22 insertions(+), 46 deletions(-) diff --git a/src/plugins/remotelinux/sshdevicewizard.cpp b/src/plugins/remotelinux/sshdevicewizard.cpp index 7a2f48b359d..9606ecf434a 100644 --- a/src/plugins/remotelinux/sshdevicewizard.cpp +++ b/src/plugins/remotelinux/sshdevicewizard.cpp @@ -30,8 +30,8 @@ namespace RemoteLinux { class SetupPage : public QWizardPage { public: - explicit SetupPage(QWidget *parent = nullptr) - : QWizardPage(parent) + explicit SetupPage(const ProjectExplorer::IDevicePtr &device) + : m_device(device) { setTitle(Tr::tr("Connection")); setWindowTitle(Tr::tr("WizardPage")); @@ -62,8 +62,6 @@ public: connect(m_userNameLineEdit, &QLineEdit::textChanged, this, &QWizardPage::completeChanged); } - void setDevice(const ProjectExplorer::IDevicePtr &device) { m_device = device; } - private: void initializePage() final { m_nameLineEdit->setText(m_device->displayName()); @@ -73,13 +71,12 @@ private: m_userNameLineEdit->setText(m_device->sshParameters().userName()); } bool isComplete() const final { - return !configurationName().isEmpty() + return !m_nameLineEdit->text().trimmed().isEmpty() && !m_hostNameLineEdit->text().trimmed().isEmpty() && !m_userNameLineEdit->text().trimmed().isEmpty(); - } bool validatePage() final { - m_device->setDisplayName(configurationName()); + m_device->setDisplayName(m_nameLineEdit->text().trimmed()); SshParameters sshParams = m_device->sshParameters(); sshParams.setHost(m_hostNameLineEdit->text().trimmed()); sshParams.setUserName(m_userNameLineEdit->text().trimmed()); @@ -88,8 +85,6 @@ private: return true; } - QString configurationName() const { return m_nameLineEdit->text().trimmed(); } - FancyLineEdit *m_nameLineEdit; FancyLineEdit *m_hostNameLineEdit; QSpinBox *m_sshPortSpinBox; @@ -100,19 +95,17 @@ private: class KeyDeploymentPage : public QWizardPage { public: - explicit KeyDeploymentPage(QWidget *parent = nullptr) - : QWizardPage(parent) + explicit KeyDeploymentPage(const ProjectExplorer::IDevicePtr &device) + : m_device(device) { setTitle(Tr::tr("Key Deployment")); setSubTitle(" "); - const QString info = Tr::tr("We recommend that you log into your device using public key " - "authentication.\n" - "If your device is already set up for this, you do not have to do " - "anything here.\n" - "Otherwise, please deploy the public key for the private key " - "with which to connect in the future.\n" - "If you do not have a private key yet, you can also " - "create one here."); + const QString info = Tr::tr( + "We recommend that you log into your device using public key authentication.\n" + "If your device is already set up for this, you do not have to do anything here.\n" + "Otherwise, please deploy the public key for the private key " + "with which to connect in the future.\n" + "If you do not have a private key yet, you can also create one here."); m_keyFileChooser.setExpectedKind(PathChooser::File); m_keyFileChooser.setHistoryCompleter("Ssh.KeyFile.History"); m_keyFileChooser.setPromptDialogTitle(Tr::tr("Choose a Private Key File")); @@ -154,8 +147,6 @@ public: } } - void setDevice(const ProjectExplorer::IDevicePtr &device) { m_device = device; } - private: void initializePage() final { if (!m_device->sshParameters().privateKeyFile.isEmpty()) @@ -175,7 +166,6 @@ private: } return true; } - FilePaths defaultKeys() const { const FilePath baseDir = FileUtils::homePath() / ".ssh"; return {baseDir / "id_rsa", baseDir / "id_ecdsa", baseDir / "id_ed25519"}; @@ -189,23 +179,17 @@ private: class FinalPage final : public QWizardPage { public: - FinalPage(QWidget *parent = nullptr) - : QWizardPage(parent) + FinalPage() { setTitle(Tr::tr("Summary")); setSubTitle(QLatin1String(" ")); // For Qt bug (background color) - m_infoLabel.setWordWrap(true); - auto const layout = new QVBoxLayout(this); - layout->addWidget(&m_infoLabel); + auto infoLabel = new QLabel(Tr::tr("The new device configuration will now be created.\n" + "In addition, device connectivity will be tested.")); + infoLabel->setWordWrap(true); + auto layout = new QVBoxLayout(this); + layout->addWidget(infoLabel); + setCommitPage(true); } - -private: - void initializePage() final { - m_infoLabel.setText(Tr::tr("The new device configuration will now be created.\n" - "In addition, device connectivity will be tested.")); - } - - QLabel m_infoLabel; }; SshDeviceWizard::SshDeviceWizard(const QString &title, const ProjectExplorer::IDevicePtr &device) @@ -213,17 +197,9 @@ SshDeviceWizard::SshDeviceWizard(const QString &title, const ProjectExplorer::ID { setWindowTitle(title); - auto setupPage = new SetupPage; - auto keyDeploymentPage = new KeyDeploymentPage; - auto finalPage = new FinalPage; - - addPage(setupPage); - addPage(keyDeploymentPage); - addPage(finalPage); - - finalPage->setCommitPage(true); - setupPage->setDevice(device); - keyDeploymentPage->setDevice(device); + addPage(new SetupPage(device)); + addPage(new KeyDeploymentPage(device)); + addPage(new FinalPage); } } // namespace RemoteLinux From 2260c12f6cca3dd3f38c6c00468c28cd07d8476b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 25 Jul 2023 12:40:08 +0200 Subject: [PATCH 0481/1777] ADS: Replace some uses of FilePath::toString Change-Id: Id6482e6e15d4c28f05a30b7eb05401cda4bce854 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/advanceddockingsystem/dockmanager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp index 20b9a71a730..482fd98a7bc 100644 --- a/src/libs/advanceddockingsystem/dockmanager.cpp +++ b/src/libs/advanceddockingsystem/dockmanager.cpp @@ -1548,7 +1548,7 @@ void DockManager::syncWorkspacePresets() // Try do create the 'workspaces' directory if it doesn't exist already if (!userDirectory().ensureWritableDir()) { - qWarning() << QString("Could not make directory '%1')").arg(userDirectory().toString()); + qWarning() << QString("Could not make directory '%1')").arg(userDirectory().toUserOutput()); return; } @@ -1573,8 +1573,8 @@ void DockManager::syncWorkspacePresets() userDirectory().pathAppended(filePath.fileName())); if (!copyResult) qWarning() << QString("Could not copy '%1' to '%2' due to %3") - .arg(filePath.toString(), - userDirectory().toString(), + .arg(filePath.toUserOutput(), + userDirectory().toUserOutput(), copyResult.error()); } } From 9a53869d5199dd0eb7bb0b9a7c776e2014a4483a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 16:39:05 +0200 Subject: [PATCH 0482/1777] ProjectExplorer: Dissolve ISettingsAspect Covered by AspectContainer nowadays. Change-Id: Id7eadaf089059031e6bd4c4b3e742e4ed0a1dc96 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../analyzer/analyzerrunconfigwidget.cpp | 2 +- src/plugins/perfprofiler/perfsettings.cpp | 16 ++----- src/plugins/perfprofiler/perfsettings.h | 2 +- .../projectexplorer/runconfiguration.cpp | 25 ++-------- .../projectexplorer/runconfiguration.h | 46 ++++--------------- .../qmlprofiler/qmlprofilersettings.cpp | 2 - src/plugins/qmlprofiler/qmlprofilersettings.h | 4 +- src/plugins/valgrind/valgrindsettings.cpp | 12 ----- src/plugins/valgrind/valgrindsettings.h | 2 +- 9 files changed, 21 insertions(+), 90 deletions(-) diff --git a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp index c74ea44a06b..61f81f46ce3 100644 --- a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp +++ b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp @@ -27,7 +27,7 @@ AnalyzerRunConfigWidget::AnalyzerRunConfigWidget(ProjectExplorer::GlobalOrProjec auto restoreButton = new QPushButton(Tr::tr("Restore Global")); auto innerPane = new QWidget; - auto configWidget = aspect->projectSettings()->createConfigWidget(); + auto configWidget = aspect->projectSettings()->layouter()().emerge(); auto details = new DetailsWidget; details->setWidget(innerPane); diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp index e737031a3fe..7d71de3504c 100644 --- a/src/plugins/perfprofiler/perfsettings.cpp +++ b/src/plugins/perfprofiler/perfsettings.cpp @@ -27,13 +27,6 @@ PerfSettings &globalSettings() PerfSettings::PerfSettings(ProjectExplorer::Target *target) { - setConfigWidgetCreator([this, target] { - auto widget = new Internal::PerfConfigWidget(this); - widget->setTracePointsButtonVisible(target != nullptr); - widget->setTarget(target); - return widget; - }); - period.setSettingsKey("Analyzer.Perf.Frequency"); period.setRange(250, 2147483647); period.setDefaultValue(250); @@ -71,11 +64,12 @@ PerfSettings::PerfSettings(ProjectExplorer::Target *target) stackSize.setEnabled(callgraphMode.volatileValue() == 0); }); - setLayouter([this] { + setLayouter([this, target] { using namespace Layouting; - return Column { - createConfigWidget() - }; + auto widget = new Internal::PerfConfigWidget(this); + widget->setTracePointsButtonVisible(target != nullptr); + widget->setTarget(target); + return Column { widget }; }); readSettings(); diff --git a/src/plugins/perfprofiler/perfsettings.h b/src/plugins/perfprofiler/perfsettings.h index 8b38f1015ea..bef4d996071 100644 --- a/src/plugins/perfprofiler/perfsettings.h +++ b/src/plugins/perfprofiler/perfsettings.h @@ -9,7 +9,7 @@ namespace PerfProfiler { -class PERFPROFILER_EXPORT PerfSettings final : public ProjectExplorer::ISettingsAspect +class PERFPROFILER_EXPORT PerfSettings final : public Utils::AspectContainer { Q_OBJECT diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 716bff52a3e..5fe190a5139 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -47,25 +47,6 @@ namespace ProjectExplorer { const char BUILD_KEY[] = "ProjectExplorer.RunConfiguration.BuildKey"; const char CUSTOMIZED_KEY[] = "ProjectExplorer.RunConfiguration.Customized"; -/////////////////////////////////////////////////////////////////////// -// -// ISettingsAspect -// -/////////////////////////////////////////////////////////////////////// - -ISettingsAspect::ISettingsAspect() = default; - -QWidget *ISettingsAspect::createConfigWidget() const -{ - QTC_ASSERT(m_configWidgetCreator, return nullptr); - return m_configWidgetCreator(); -} - -void ISettingsAspect::setConfigWidgetCreator(const ConfigWidgetCreator &configWidgetCreator) -{ - m_configWidgetCreator = configWidgetCreator; -} - /////////////////////////////////////////////////////////////////////// // @@ -83,13 +64,13 @@ GlobalOrProjectAspect::~GlobalOrProjectAspect() delete m_projectSettings; } -void GlobalOrProjectAspect::setProjectSettings(ISettingsAspect *settings) +void GlobalOrProjectAspect::setProjectSettings(AspectContainer *settings) { m_projectSettings = settings; m_projectSettings->setAutoApply(true); } -void GlobalOrProjectAspect::setGlobalSettings(ISettingsAspect *settings) +void GlobalOrProjectAspect::setGlobalSettings(AspectContainer *settings) { m_globalSettings = settings; m_projectSettings->setAutoApply(false); @@ -100,7 +81,7 @@ void GlobalOrProjectAspect::setUsingGlobalSettings(bool value) m_useGlobalSettings = value; } -ISettingsAspect *GlobalOrProjectAspect::currentSettings() const +AspectContainer *GlobalOrProjectAspect::currentSettings() const { return m_useGlobalSettings ? m_globalSettings : m_projectSettings; } diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index c4bba4760c8..ba4fb4d4c95 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -11,8 +11,6 @@ #include <utils/environment.h> #include <utils/macroexpander.h> -#include <QWidget> - #include <functional> #include <memory> @@ -29,32 +27,6 @@ class RunConfiguration; class RunConfigurationCreationInfo; class Target; -/** - * An interface for a hunk of global or per-project - * configuration data. - * - */ - -class PROJECTEXPLORER_EXPORT ISettingsAspect : public Utils::AspectContainer -{ - Q_OBJECT - -public: - ISettingsAspect(); - - /// Create a configuration widget for this settings aspect. - QWidget *createConfigWidget() const; - -protected: - using ConfigWidgetCreator = std::function<QWidget *()>; - void setConfigWidgetCreator(const ConfigWidgetCreator &configWidgetCreator); - - friend class GlobalOrProjectAspect; - - ConfigWidgetCreator m_configWidgetCreator; -}; - - /** * An interface to facilitate switching between hunks of * global and per-project configuration data. @@ -69,19 +41,19 @@ public: GlobalOrProjectAspect(); ~GlobalOrProjectAspect() override; - void setProjectSettings(ISettingsAspect *settings); - void setGlobalSettings(ISettingsAspect *settings); + void setProjectSettings(Utils::AspectContainer *settings); + void setGlobalSettings(Utils::AspectContainer *settings); bool isUsingGlobalSettings() const { return m_useGlobalSettings; } void setUsingGlobalSettings(bool value); void resetProjectToGlobalSettings(); - ISettingsAspect *projectSettings() const { return m_projectSettings; } - ISettingsAspect *currentSettings() const; + Utils::AspectContainer *projectSettings() const { return m_projectSettings; } + Utils::AspectContainer *currentSettings() const; struct Data : Utils::BaseAspect::Data { - ISettingsAspect *currentSettings = nullptr; + Utils::AspectContainer *currentSettings = nullptr; }; protected: @@ -92,8 +64,8 @@ protected: private: bool m_useGlobalSettings = false; - ISettingsAspect *m_projectSettings = nullptr; // Owned if present. - ISettingsAspect *m_globalSettings = nullptr; // Not owned. + Utils::AspectContainer *m_projectSettings = nullptr; // Owned if present. + Utils::AspectContainer *m_globalSettings = nullptr; // Not owned. }; // Documentation inside. @@ -133,7 +105,7 @@ public: ProjectExplorer::ProjectNode *productNode() const; - template <class T = ISettingsAspect> T *currentSettings(Utils::Id id) const + template <class T = Utils::AspectContainer> T *currentSettings(Utils::Id id) const { if (auto a = qobject_cast<GlobalOrProjectAspect *>(aspect(id))) return qobject_cast<T *>(a->currentSettings()); @@ -264,5 +236,3 @@ private: }; } // namespace ProjectExplorer - -Q_DECLARE_METATYPE(ProjectExplorer::ISettingsAspect *); diff --git a/src/plugins/qmlprofiler/qmlprofilersettings.cpp b/src/plugins/qmlprofiler/qmlprofilersettings.cpp index a5c1352fcaf..9bbac157414 100644 --- a/src/plugins/qmlprofiler/qmlprofilersettings.cpp +++ b/src/plugins/qmlprofiler/qmlprofilersettings.cpp @@ -62,8 +62,6 @@ QmlProfilerSettings::QmlProfilerSettings() }; }); - setConfigWidgetCreator([this] { return layouter()().emerge(); }); - readSettings(); } diff --git a/src/plugins/qmlprofiler/qmlprofilersettings.h b/src/plugins/qmlprofiler/qmlprofilersettings.h index 2b0329e4f5e..0336aee31a7 100644 --- a/src/plugins/qmlprofiler/qmlprofilersettings.h +++ b/src/plugins/qmlprofiler/qmlprofilersettings.h @@ -3,11 +3,11 @@ #pragma once -#include <projectexplorer/runconfiguration.h> +#include <utils/aspects.h> namespace QmlProfiler::Internal { -class QmlProfilerSettings : public ProjectExplorer::ISettingsAspect +class QmlProfilerSettings : public Utils::AspectContainer { public: QmlProfilerSettings(); diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 82160908b72..702e0561eb0 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -176,14 +176,6 @@ void SuppressionAspect::bufferToGui() d->m_model.appendRow(new QStandardItem(file.toUserOutput())); } -// ValgrindConfigWidget - - -QWidget *createSettingsWidget(ValgrindBaseSettings *settings) -{ - return settings->layouter()().emerge(); -} - ////////////////////////////////////////////////////////////////// // // ValgrindBaseSettings @@ -414,8 +406,6 @@ ValgrindGlobalSettings::ValgrindGlobalSettings() shortenTemplates.setLabelText("<>"); // FIXME: Create a real icon shortenTemplates.setToolTip(Tr::tr("Remove template parameter lists when displaying function names.")); - setConfigWidgetCreator([this] { return createSettingsWidget(this); }); - setSettingsGroup("Analyzer"); readSettings(); setAutoApply(false); @@ -434,8 +424,6 @@ ValgrindGlobalSettings::ValgrindGlobalSettings() ValgrindProjectSettings::ValgrindProjectSettings() : ValgrindBaseSettings(false) { - setConfigWidgetCreator([this] { return createSettingsWidget(this); }); - connect(this, &AspectContainer::fromMapFinished, [this] { // FIXME: Update project page e.g. on "Restore Global", aspects // there are 'autoapply', and Aspect::cancel() is normally part of diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index 68e6d21969d..ca85a2d92f9 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -38,7 +38,7 @@ private: /** * Valgrind settings shared for global and per-project. */ -class ValgrindBaseSettings : public ProjectExplorer::ISettingsAspect +class ValgrindBaseSettings : public Utils::AspectContainer { Q_OBJECT From 18a9436330b4f3f615c378e3c18aa324f29cacf7 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 25 Jul 2023 13:08:24 +0200 Subject: [PATCH 0483/1777] Valgrind Parser: Hide Tool enum in cpp Replace some explicit iterators with auto. Change-Id: I30aad955e02cbffbfd4ffe100d381e32202fea05 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/xmlprotocol/parser.cpp | 37 ++++++++++++--------- src/plugins/valgrind/xmlprotocol/parser.h | 7 ---- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/plugins/valgrind/xmlprotocol/parser.cpp b/src/plugins/valgrind/xmlprotocol/parser.cpp index 342277b7f1d..749e9f2327b 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.cpp +++ b/src/plugins/valgrind/xmlprotocol/parser.cpp @@ -59,6 +59,13 @@ namespace { namespace Valgrind { namespace XmlProtocol { +enum class Tool { + Unknown, + Memcheck, + Ptrcheck, + Helgrind +}; + class Parser::Private { public: @@ -91,12 +98,12 @@ private: bool notAtEnd() const; QString blockingReadElementText(); - Tool tool; + Tool tool = Tool::Unknown; QXmlStreamReader reader; QHash<QString, MemcheckErrorKind> errorKindsByName_memcheck; QHash<QString, HelgrindErrorKind> errorKindsByName_helgrind; QHash<QString, PtrcheckErrorKind> errorKindsByName_ptrcheck; - QHash<QString, Parser::Tool> toolsByName; + QHash<QString, Tool> toolsByName; private: Parser *const q; @@ -109,11 +116,10 @@ private: Parser::Private::Private(Parser *qq) : q(qq) { - tool = Parser::Unknown; - toolsByName.insert("memcheck", Parser::Memcheck); - toolsByName.insert("ptrcheck", Parser::Ptrcheck); - toolsByName.insert("exp-ptrcheck", Parser::Ptrcheck); - toolsByName.insert("helgrind", Parser::Helgrind); + toolsByName.insert("memcheck", Tool::Memcheck); + toolsByName.insert("ptrcheck", Tool::Ptrcheck); + toolsByName.insert("exp-ptrcheck", Tool::Ptrcheck); + toolsByName.insert("helgrind", Tool::Helgrind); ADD_ENUM(memcheck, ClientCheck) ADD_ENUM(memcheck, InvalidFree) @@ -257,8 +263,7 @@ void Parser::Private::checkProtocolVersion(const QString &versionStr) void Parser::Private::checkTool(const QString &reportedStr) { - const QHash<QString,Parser::Tool>::ConstIterator reported = toolsByName.constFind(reportedStr); - + const auto reported = toolsByName.constFind(reportedStr); if (reported == toolsByName.constEnd()) throw ParserException(Tr::tr("Valgrind tool \"%1\" not supported").arg(reportedStr)); @@ -315,7 +320,7 @@ XauxWhat Parser::Private::parseXauxWhat() MemcheckErrorKind Parser::Private::parseMemcheckErrorKind(const QString &kind) { - const QHash<QString,MemcheckErrorKind>::ConstIterator it = errorKindsByName_memcheck.constFind(kind); + const auto it = errorKindsByName_memcheck.constFind(kind); if (it != errorKindsByName_memcheck.constEnd()) return *it; else @@ -324,7 +329,7 @@ MemcheckErrorKind Parser::Private::parseMemcheckErrorKind(const QString &kind) HelgrindErrorKind Parser::Private::parseHelgrindErrorKind(const QString &kind) { - const QHash<QString,HelgrindErrorKind>::ConstIterator it = errorKindsByName_helgrind.constFind(kind); + const auto it = errorKindsByName_helgrind.constFind(kind); if (it != errorKindsByName_helgrind.constEnd()) return *it; else @@ -333,7 +338,7 @@ HelgrindErrorKind Parser::Private::parseHelgrindErrorKind(const QString &kind) PtrcheckErrorKind Parser::Private::parsePtrcheckErrorKind(const QString &kind) { - const QHash<QString,PtrcheckErrorKind>::ConstIterator it = errorKindsByName_ptrcheck.constFind(kind); + const auto it = errorKindsByName_ptrcheck.constFind(kind); if (it != errorKindsByName_ptrcheck.constEnd()) return *it; else @@ -343,13 +348,13 @@ PtrcheckErrorKind Parser::Private::parsePtrcheckErrorKind(const QString &kind) int Parser::Private::parseErrorKind(const QString &kind) { switch (tool) { - case Memcheck: + case Tool::Memcheck: return parseMemcheckErrorKind(kind); - case Ptrcheck: + case Tool::Ptrcheck: return parsePtrcheckErrorKind(kind); - case Helgrind: + case Tool::Helgrind: return parseHelgrindErrorKind(kind); - case Unknown: + case Tool::Unknown: default: break; } diff --git a/src/plugins/valgrind/xmlprotocol/parser.h b/src/plugins/valgrind/xmlprotocol/parser.h index 5be623a3513..069696cba64 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.h +++ b/src/plugins/valgrind/xmlprotocol/parser.h @@ -24,13 +24,6 @@ class Parser : public QObject Q_OBJECT public: - enum Tool { - Unknown, - Memcheck, - Ptrcheck, - Helgrind - }; - explicit Parser(QObject *parent = nullptr); ~Parser() override; From b11a6900e601e605475e94f46e2f5d85ba22a2df Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 24 Jul 2023 14:48:57 +0200 Subject: [PATCH 0484/1777] Build: Remove feature from the olden times We don't set this to anything else anymore, so remove the option to set it. Change-Id: I9e2aced8909d557e3a4f0b8ca8fff70ac6ec2e1d Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- cmake/QtCreatorAPI.cmake | 8 +------- src/plugins/updateinfo/CMakeLists.txt | 1 - src/plugins/updateinfo/UpdateInfo.json.in | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index effbb454047..54384fcdfe3 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -320,7 +320,7 @@ endfunction(add_qtc_library) function(add_qtc_plugin target_name) cmake_parse_arguments(_arg "SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION;EXPORT;SKIP_PCH" - "VERSION;COMPAT_VERSION;PLUGIN_JSON_IN;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT;PLUGIN_CLASS" + "VERSION;COMPAT_VERSION;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT;PLUGIN_CLASS" "CONDITION;DEPENDS;PUBLIC_DEPENDS;DEFINES;PUBLIC_DEFINES;INCLUDES;PUBLIC_INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PLUGIN_DEPENDS;PLUGIN_RECOMMENDS;PLUGIN_TEST_DEPENDS;PROPERTIES" ${ARGN} ) @@ -431,12 +431,6 @@ function(add_qtc_plugin target_name) string(REPLACE "$$QTCREATOR_COPYRIGHT_YEAR" "\${IDE_COPYRIGHT_YEAR}" plugin_json_in ${plugin_json_in}) string(REPLACE "$$QTC_PLUGIN_REVISION" "\${QTC_PLUGIN_REVISION}" plugin_json_in ${plugin_json_in}) string(REPLACE "$$dependencyList" "\${IDE_PLUGIN_DEPENDENCY_STRING}" plugin_json_in ${plugin_json_in}) - if(_arg_PLUGIN_JSON_IN) - #e.g. UPDATEINFO_EXPERIMENTAL_STR=true - string(REGEX REPLACE "=.*$" "" json_key ${_arg_PLUGIN_JSON_IN}) - string(REGEX REPLACE "^.*=" "" json_value ${_arg_PLUGIN_JSON_IN}) - string(REPLACE "$$${json_key}" "${json_value}" plugin_json_in ${plugin_json_in}) - endif() string(CONFIGURE "${plugin_json_in}" plugin_json) file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.json" diff --git a/src/plugins/updateinfo/CMakeLists.txt b/src/plugins/updateinfo/CMakeLists.txt index 2507f99964b..5049f351f0f 100644 --- a/src/plugins/updateinfo/CMakeLists.txt +++ b/src/plugins/updateinfo/CMakeLists.txt @@ -1,7 +1,6 @@ add_qtc_plugin(UpdateInfo DEPENDS Qt::Xml PLUGIN_DEPENDS Core - PLUGIN_JSON_IN UPDATEINFO_EXPERIMENTAL_STR=true SOURCES settingspage.cpp settingspage.h diff --git a/src/plugins/updateinfo/UpdateInfo.json.in b/src/plugins/updateinfo/UpdateInfo.json.in index 5331281feaf..f2f060d44a7 100644 --- a/src/plugins/updateinfo/UpdateInfo.json.in +++ b/src/plugins/updateinfo/UpdateInfo.json.in @@ -2,7 +2,7 @@ \"Name\" : \"UpdateInfo\", \"Version\" : \"$$QTCREATOR_VERSION\", \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : $$UPDATEINFO_EXPERIMENTAL_STR, + \"DisabledByDefault\" : true, \"Vendor\" : \"The Qt Company Ltd\", \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", \"License\" : [ \"Commercial Usage\", From a419670ff5384ed16f4ae00b3da497792931a771 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 24 Jul 2023 16:14:26 +0200 Subject: [PATCH 0485/1777] Build: Change plugin json.in files to CMake style They were still using variables in qmake style. Directly use CMake variables in the json.in files and remove the no longer needed escaping of quotes. Adds a fatal message if it detects the old style in a .json.in file for easier porting. Change-Id: I8de88d8db2da55781f0e9d72eda03f943723188e Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- cmake/QtCreatorAPI.cmake | 21 +- .../examples/exampleplugin/Example.json.in | 18 +- doc/qtcreatordev/src/first-plugin.qdoc | 2 +- qbs/modules/pluginjson/pluginjson.qbs | 12 +- .../wizards/qtcreatorplugin/MyPlugin.json.in | 18 +- src/plugins/android/Android.json.in | 50 ++-- src/plugins/autotest/AutoTest.json.in | 30 +-- .../AutotoolsProjectManager.json.in | 34 +-- src/plugins/axivion/Axivion.json.in | 36 +-- src/plugins/baremetal/BareMetal.json.in | 32 +-- src/plugins/bazaar/Bazaar.json.in | 32 +-- src/plugins/beautifier/Beautifier.json.in | 34 +-- src/plugins/bineditor/BinEditor.json.in | 32 +-- src/plugins/bookmarks/Bookmarks.json.in | 32 +-- src/plugins/boot2qt/Boot2Qt.json.in | 34 +-- .../clangcodemodel/ClangCodeModel.json.in | 32 +-- src/plugins/clangformat/ClangFormat.json.in | 32 +-- src/plugins/clangtools/ClangTools.json.in | 32 +-- src/plugins/classview/ClassView.json.in | 32 +-- src/plugins/clearcase/ClearCase.json.in | 52 ++--- .../CMakeProjectManager.json.in | 60 ++--- src/plugins/coco/Coco.json.in | 32 +-- .../CompilationDatabaseProjectManager.json.in | 52 ++--- src/plugins/conan/Conan.json.in | 32 +-- src/plugins/copilot/Copilot.json.in | 32 +-- src/plugins/coreplugin/Core.json.in | 60 ++--- src/plugins/cpaster/CodePaster.json.in | 30 +-- src/plugins/cppcheck/Cppcheck.json.in | 34 +-- src/plugins/cppeditor/CppEditor.json.in | 220 +++++++++--------- .../ctfvisualizer/CtfVisualizer.json.in | 32 +-- src/plugins/cvs/CVS.json.in | 48 ++-- src/plugins/debugger/Debugger.json.in | 88 +++---- src/plugins/designer/Designer.json.in | 32 +-- src/plugins/diffeditor/DiffEditor.json.in | 30 +-- src/plugins/docker/Docker.json.in | 32 +-- src/plugins/emacskeys/EmacsKeys.json.in | 56 ++--- src/plugins/fakevim/FakeVim.json.in | 30 +-- src/plugins/fossil/Fossil.json.in | 34 +-- .../GenericProjectManager.json.in | 100 ++++---- src/plugins/git/Git.json.in | 70 +++--- src/plugins/gitlab/GitLab.json.in | 32 +-- src/plugins/glsleditor/GLSLEditor.json.in | 104 ++++----- src/plugins/haskell/Haskell.json.in | 38 +-- src/plugins/helloworld/HelloWorld.json.in | 32 +-- src/plugins/help/Help.json.in | 32 +-- src/plugins/imageviewer/ImageViewer.json.in | 46 ++-- src/plugins/incredibuild/IncrediBuild.json.in | 34 +-- src/plugins/insight/Insight.json.in | 36 +-- src/plugins/ios/Ios.json.in | 34 +-- .../languageclient/LanguageClient.json.in | 32 +-- src/plugins/macros/Macros.json.in | 30 +-- src/plugins/marketplace/Marketplace.json.in | 30 +-- src/plugins/mcusupport/McuSupport.json.in | 34 +-- src/plugins/mercurial/Mercurial.json.in | 32 +-- .../MesonProjectManager.json.in | 36 +-- src/plugins/modeleditor/ModelEditor.json.in | 50 ++-- src/plugins/nim/Nim.json.in | 82 +++---- src/plugins/perforce/Perforce.json.in | 56 ++--- src/plugins/perfprofiler/PerfProfiler.json.in | 32 +-- .../projectexplorer/ProjectExplorer.json.in | 64 ++--- src/plugins/python/Python.json.in | 80 +++---- .../QbsProjectManager.json.in | 32 +-- .../QmakeProjectManager.json.in | 100 ++++---- src/plugins/qmldesigner/QmlDesigner.json.in | 42 ++-- .../qmldesignerbase/QmlDesignerBase.json.in | 32 +-- src/plugins/qmljseditor/QmlJSEditor.json.in | 32 +-- src/plugins/qmljstools/QmlJSTools.json.in | 134 +++++------ src/plugins/qmlpreview/QmlPreview.json.in | 32 +-- src/plugins/qmlprofiler/QmlProfiler.json.in | 32 +-- .../QmlProjectManager.json.in | 50 ++-- src/plugins/qnx/Qnx.json.in | 32 +-- src/plugins/qtsupport/QtSupport.json.in | 58 ++--- src/plugins/remotelinux/RemoteLinux.json.in | 32 +-- .../resourceeditor/ResourceEditor.json.in | 50 ++-- src/plugins/saferenderer/SafeRenderer.json.in | 34 +-- src/plugins/scxmleditor/ScxmlEditor.json.in | 50 ++-- .../serialterminal/SerialTerminal.json.in | 34 +-- .../silversearcher/SilverSearcher.json.in | 32 +-- src/plugins/squish/Squish.json.in | 50 ++-- .../studiowelcome/StudioWelcome.json.in | 32 +-- src/plugins/subversion/Subversion.json.in | 48 ++-- src/plugins/terminal/Terminal.json.in | 30 +-- src/plugins/texteditor/TextEditor.json.in | 32 +-- src/plugins/todo/Todo.json.in | 32 +-- src/plugins/updateinfo/UpdateInfo.json.in | 32 +-- src/plugins/valgrind/Valgrind.json.in | 32 +-- src/plugins/vcpkg/Vcpkg.json.in | 50 ++-- src/plugins/vcsbase/VcsBase.json.in | 32 +-- src/plugins/webassembly/WebAssembly.json.in | 36 +-- src/plugins/welcome/Welcome.json.in | 38 +-- 90 files changed, 1947 insertions(+), 1952 deletions(-) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 54384fcdfe3..34549c6ca30 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -418,23 +418,20 @@ function(add_qtc_plugin target_name) ) string(APPEND _arg_DEPENDENCY_STRING "\n ]") - set(IDE_PLUGIN_DEPENDENCY_STRING ${_arg_DEPENDENCY_STRING}) + set(IDE_PLUGIN_DEPENDENCIES ${_arg_DEPENDENCY_STRING}) ### Configure plugin.json file: if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.json.in") list(APPEND _arg_SOURCES ${name}.json.in) file(READ "${name}.json.in" plugin_json_in) - string(REPLACE "\\\"" "\"" plugin_json_in ${plugin_json_in}) - string(REPLACE "\\'" "'" plugin_json_in ${plugin_json_in}) - string(REPLACE "$$QTCREATOR_VERSION" "\${IDE_VERSION}" plugin_json_in ${plugin_json_in}) - string(REPLACE "$$QTCREATOR_COMPAT_VERSION" "\${IDE_VERSION_COMPAT}" plugin_json_in ${plugin_json_in}) - string(REPLACE "$$QTCREATOR_COPYRIGHT_YEAR" "\${IDE_COPYRIGHT_YEAR}" plugin_json_in ${plugin_json_in}) - string(REPLACE "$$QTC_PLUGIN_REVISION" "\${QTC_PLUGIN_REVISION}" plugin_json_in ${plugin_json_in}) - string(REPLACE "$$dependencyList" "\${IDE_PLUGIN_DEPENDENCY_STRING}" plugin_json_in ${plugin_json_in}) - string(CONFIGURE "${plugin_json_in}" plugin_json) - file(GENERATE - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.json" - CONTENT "${plugin_json}") + if(plugin_json_in MATCHES "\\$\\$dependencyList") + message(FATAL_ERROR "Found $$dependencyList in ${name}.json.in. " + "This is no longer supported. " + "Use \${IDE_PLUGIN_DEPENDENCIES}, \${IDE_VERSION} " + "and other CMake variables directly. " + "Also remove escaping of quotes.") + endif() + configure_file(${name}.json.in "${CMAKE_CURRENT_BINARY_DIR}/${name}.json") endif() if (QTC_STATIC_BUILD) diff --git a/doc/qtcreatordev/examples/exampleplugin/Example.json.in b/doc/qtcreatordev/examples/exampleplugin/Example.json.in index 3a52e318c55..c5faf0a2559 100644 --- a/doc/qtcreatordev/examples/exampleplugin/Example.json.in +++ b/doc/qtcreatordev/examples/exampleplugin/Example.json.in @@ -1,17 +1,17 @@ { //! [1] - \"Name\" : \"Example\", - \"Version\" : \"0.0.1\", - \"CompatVersion\" : \"0.0.1\", + "Name" : "Example", + "Version" : "0.0.1", + "CompatVersion" : "0.0.1", //! [1] //! [2] - \"Vendor\" : \"MyCompany\", - \"Copyright\" : \"(C) MyCompany\", - \"License\" : \"Put short license information here\", - \"Description\" : \"Put a short description of your plugin here\", - \"Url\" : \"https://www.mycompany.com\", + "Vendor" : "MyCompany", + "Copyright" : "(C) MyCompany", + "License" : "Put short license information here", + "Description" : "Put a short description of your plugin here", + "Url" : "https://www.mycompany.com", //! [2] //! [3] - $$dependencyList + ${IDE_PLUGIN_DEPENDENCIES} //! [3] } diff --git a/doc/qtcreatordev/src/first-plugin.qdoc b/doc/qtcreatordev/src/first-plugin.qdoc index 96b993066c7..0e45e17759f 100644 --- a/doc/qtcreatordev/src/first-plugin.qdoc +++ b/doc/qtcreatordev/src/first-plugin.qdoc @@ -254,7 +254,7 @@ \snippet exampleplugin/Example.json.in 3 - The \c {$$dependencyList} variable is automatically replaced by the + The \c {IDE_PLUGIN_DEPENDENCIES} variable is automatically replaced by the dependency information in \c {QTC_PLUGIN_DEPENDS} and \c {QTC_PLUGIN_RECOMMENDS} from your plugin's \c {.pro} file. diff --git a/qbs/modules/pluginjson/pluginjson.qbs b/qbs/modules/pluginjson/pluginjson.qbs index e210731f0bf..f52158c9652 100644 --- a/qbs/modules/pluginjson/pluginjson.qbs +++ b/qbs/modules/pluginjson/pluginjson.qbs @@ -72,17 +72,15 @@ Module { var vars = pluginJsonReplacements || {}; var inf = new TextFile(input.filePath); var all = inf.readAll(); - // replace quoted quotes - all = all.replace(/\\\"/g, '"'); // replace config vars var qtcVersion = product.moduleProperty("qtc", "qtcreator_version"); - vars['QTCREATOR_VERSION'] = qtcVersion; - vars['QTCREATOR_COMPAT_VERSION'] + vars['IDE_VERSION'] = qtcVersion; + vars['IDE_VERSION_COMPAT'] = product.moduleProperty("qtc", "qtcreator_compat_version"); vars['IDE_VERSION_MAJOR'] = product.moduleProperty("qtc", "ide_version_major"); vars['IDE_VERSION_MINOR'] = product.moduleProperty("qtc", "ide_version_minor"); vars['IDE_VERSION_RELEASE'] = product.moduleProperty("qtc", "ide_version_release"); - vars['QTCREATOR_COPYRIGHT_YEAR'] + vars['IDE_COPYRIGHT_YEAR'] = product.moduleProperty("qtc", "qtcreator_copyright_year") if (!vars['QTC_PLUGIN_REVISION']) vars['QTC_PLUGIN_REVISION'] = product.vcs ? (product.vcs.repoState || "") : ""; @@ -97,9 +95,9 @@ Module { deplist.push(" { \"Name\" : \"" + plugin_test_depends[i] + "\", \"Version\" : \"" + qtcVersion + "\", \"Type\" : \"test\" }"); } deplist = deplist.join(",\n") - vars['dependencyList'] = "\"Dependencies\" : [\n" + deplist + "\n ]"; + vars['IDE_PLUGIN_DEPENDENCIES'] = "\"Dependencies\" : [\n" + deplist + "\n ]"; for (i in vars) { - all = all.replace(new RegExp('\\\$\\\$' + i + '(?!\w)', 'g'), vars[i]); + all = all.replace(new RegExp('\\\$\\{' + i + '(?!\w)\\}', 'g'), vars[i]); } var file = new TextFile(output.filePath, TextFile.WriteOnly); file.truncate(); diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/MyPlugin.json.in b/share/qtcreator/templates/wizards/qtcreatorplugin/MyPlugin.json.in index 24e580808bf..2e62c447394 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/MyPlugin.json.in +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/MyPlugin.json.in @@ -1,11 +1,11 @@ { - \\"Name\\" : \\"%{PluginName}\\", - \\"Version\\" : \\"0.0.1\\", - \\"CompatVersion\\" : \\"0.0.1\\", - \\"Vendor\\" : \\"%{VendorName}\\", - \\"Copyright\\" : \\"%{Copyright}\\", - \\"License\\" : \\"%{License}\\", - \\"Description\\" : \\"%{Description}\\", - \\"Url\\" : \\"%{Url}\\", - $$dependencyList + \"Name\" : \"%{PluginName}\", + \"Version\" : \"0.0.1\", + \"CompatVersion\" : \"0.0.1\", + \"Vendor\" : \"%{VendorName}\", + \"Copyright\" : \"%{Copyright}\", + \"License\" : \"%{License}\", + \"Description\" : \"%{Description}\", + \"Url\" : \"%{Url}\", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/android/Android.json.in b/src/plugins/android/Android.json.in index 52aff652e8b..7a020c5061f 100644 --- a/src/plugins/android/Android.json.in +++ b/src/plugins/android/Android.json.in @@ -1,30 +1,30 @@ { - \"Name\" : \"Android\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"KDE Necessitas\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Android", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "KDE Necessitas", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Device Support\", - \"Description\" : \"Support for deployment to and execution on Android Devices.\", - \"Url\" : \"http://necessitas.kde.org\", - $$dependencyList, + "Category" : "Device Support", + "Description" : "Support for deployment to and execution on Android Devices.", + "Url" : "http://necessitas.kde.org", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'application/vnd.google.android.android_manifest\'>\", - \" <comment>Android manifest file</comment>\", - \" <sub-class-of type=\'application/xml\'/>\", - \" <glob pattern=\'AndroidManifest.xml\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='application/vnd.google.android.android_manifest'>", + " <comment>Android manifest file</comment>", + " <sub-class-of type='application/xml'/>", + " <glob pattern='AndroidManifest.xml'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/autotest/AutoTest.json.in b/src/plugins/autotest/AutoTest.json.in index 9dc49b1caa7..230a9ee0f69 100644 --- a/src/plugins/autotest/AutoTest.json.in +++ b/src/plugins/autotest/AutoTest.json.in @@ -1,18 +1,18 @@ { -\"Name\" : \"AutoTest\", -\"Version\" : \"$$QTCREATOR_VERSION\", -\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", -\"Vendor\" : \"The Qt Company Ltd\", -\"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", -\"License\" : [ \"Commercial Usage\", -\"\", -\"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", -\"\", -\"GNU General Public License Usage\", -\"\", -\"Alternatively, this file may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this file. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" +"Name" : "AutoTest", +"Version" : "${IDE_VERSION}", +"CompatVersion" : "${IDE_VERSION_COMPAT}", +"Vendor" : "The Qt Company Ltd", +"Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", +"License" : [ "Commercial Usage", +"", +"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", +"", +"GNU General Public License Usage", +"", +"Alternatively, this file may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this file. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], -\"Description\" : \"Auto Test plugin.\", -\"Url\" : \"http://www.qt.io\", -$$dependencyList +"Description" : "Auto Test plugin.", +"Url" : "http://www.qt.io", +${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.json.in b/src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.json.in index 5e3a7d5850b..399a70dd3a6 100644 --- a/src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.json.in +++ b/src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.json.in @@ -1,20 +1,20 @@ { - \"Name\" : \"AutotoolsProjectManager\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, - \"Vendor\" : \"Openismus GmbH\", - \"Copyright\" : \"(C) 2016 Openismus GmbH, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "AutotoolsProjectManager", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Vendor" : "Openismus GmbH", + "Copyright" : "(C) 2016 Openismus GmbH, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Build Systems\", - \"Description\" : \"Autotools project integration.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Build Systems", + "Description" : "Autotools project integration.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/axivion/Axivion.json.in b/src/plugins/axivion/Axivion.json.in index fac0520565f..50958b9e9da 100644 --- a/src/plugins/axivion/Axivion.json.in +++ b/src/plugins/axivion/Axivion.json.in @@ -1,21 +1,21 @@ { - \"Name\" : \"Axivion\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Revision\" : \"$$QTC_PLUGIN_REVISION\", - \"Experimental\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Axivion", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Revision" : "${QTC_PLUGIN_REVISION}", + "Experimental" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Code Analyzer\", - \"Description\" : \"Integration of the axivion dashboard.\", - \"Url\" : \"https://www.qt.io\", - $$dependencyList + "Category" : "Code Analyzer", + "Description" : "Integration of the axivion dashboard.", + "Url" : "https://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/baremetal/BareMetal.json.in b/src/plugins/baremetal/BareMetal.json.in index c27befaddc3..13bd9ba4ac9 100644 --- a/src/plugins/baremetal/BareMetal.json.in +++ b/src/plugins/baremetal/BareMetal.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"BareMetal\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Experimental\" : true, - \"Vendor\" : \"Tim Sander\", - \"Copyright\" : \"(C) 2016 Tim Sander, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "BareMetal", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Experimental" : true, + "Vendor" : "Tim Sander", + "Copyright" : "(C) 2016 Tim Sander, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Device Support\", - \"Description\" : \"This plugin adds a target for bare metal development.\", - $$dependencyList + "Category" : "Device Support", + "Description" : "This plugin adds a target for bare metal development.", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/bazaar/Bazaar.json.in b/src/plugins/bazaar/Bazaar.json.in index 74c336b0752..82bb55661f6 100644 --- a/src/plugins/bazaar/Bazaar.json.in +++ b/src/plugins/bazaar/Bazaar.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"Bazaar\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"Hugues Delorme\", - \"Copyright\" : \"(C) 2016 Hugues Delorme, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Bazaar", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "Hugues Delorme", + "Copyright" : "(C) 2016 Hugues Delorme, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Version Control\", - \"Description\" : \"Bazaar integration.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Version Control", + "Description" : "Bazaar integration.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/beautifier/Beautifier.json.in b/src/plugins/beautifier/Beautifier.json.in index db8cc8b001d..79de488b617 100644 --- a/src/plugins/beautifier/Beautifier.json.in +++ b/src/plugins/beautifier/Beautifier.json.in @@ -1,20 +1,20 @@ { - \"Name\" : \"Beautifier\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Experimental\" : true, - \"Vendor\" : \"Lorenz Haas\", - \"Copyright\" : \"(C) 2017 Lorenz Haas, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Beautifier", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Experimental" : true, + "Vendor" : "Lorenz Haas", + "Copyright" : "(C) 2017 Lorenz Haas, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"C++\", - \"Description\" : \"Format source files with the help of beautifiers like AStyle, uncrustify or clang-format.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "C++", + "Description" : "Format source files with the help of beautifiers like AStyle, uncrustify or clang-format.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/bineditor/BinEditor.json.in b/src/plugins/bineditor/BinEditor.json.in index 4aa1225f8bb..5d05094b0f8 100644 --- a/src/plugins/bineditor/BinEditor.json.in +++ b/src/plugins/bineditor/BinEditor.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"BinEditor\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "BinEditor", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Qt Creator\", - \"Description\" : \"Binary editor component.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Qt Creator", + "Description" : "Binary editor component.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/bookmarks/Bookmarks.json.in b/src/plugins/bookmarks/Bookmarks.json.in index 32ccf2418b5..46a307f517a 100644 --- a/src/plugins/bookmarks/Bookmarks.json.in +++ b/src/plugins/bookmarks/Bookmarks.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"Bookmarks\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Bookmarks", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Core\", - \"Description\" : \"Bookmarks in text editors.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Core", + "Description" : "Bookmarks in text editors.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/boot2qt/Boot2Qt.json.in b/src/plugins/boot2qt/Boot2Qt.json.in index 13b22578e2b..6ab0b2a7d60 100644 --- a/src/plugins/boot2qt/Boot2Qt.json.in +++ b/src/plugins/boot2qt/Boot2Qt.json.in @@ -1,21 +1,21 @@ { - \"Name\" : \"Boot2Qt\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Boot2Qt", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Device Support\", - \"Description\" : \"Support for the Boot2Qt Device access using the Qt Debug Bridge.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Device Support", + "Description" : "Support for the Boot2Qt Device access using the Qt Debug Bridge.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/clangcodemodel/ClangCodeModel.json.in b/src/plugins/clangcodemodel/ClangCodeModel.json.in index ca57ed80c81..4702372b83b 100644 --- a/src/plugins/clangcodemodel/ClangCodeModel.json.in +++ b/src/plugins/clangcodemodel/ClangCodeModel.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"ClangCodeModel\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "ClangCodeModel", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"C++\", - \"Description\" : \"Clang Code Model plugin.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "C++", + "Description" : "Clang Code Model plugin.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/clangformat/ClangFormat.json.in b/src/plugins/clangformat/ClangFormat.json.in index cf952b481ce..c444af0fcd6 100644 --- a/src/plugins/clangformat/ClangFormat.json.in +++ b/src/plugins/clangformat/ClangFormat.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"ClangFormat\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "ClangFormat", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"C++\", - \"Description\" : \"clang-format indentation plugin.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "C++", + "Description" : "clang-format indentation plugin.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/clangtools/ClangTools.json.in b/src/plugins/clangtools/ClangTools.json.in index 7eea61d1bce..d6d1280c404 100644 --- a/src/plugins/clangtools/ClangTools.json.in +++ b/src/plugins/clangtools/ClangTools.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"ClangTools\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid commercial Qt licenses may use this file in accordance with the commercial license agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company. For licensing terms and conditions see https://www.qt.io/terms-conditions. For further information use the contact form at https://www.qt.io/contact-us.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this file may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this file. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "ClangTools", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid commercial Qt licenses may use this file in accordance with the commercial license agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company. For licensing terms and conditions see https://www.qt.io/terms-conditions. For further information use the contact form at https://www.qt.io/contact-us.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this file may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this file. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Code Analyzer\", - \"Description\" : \"ClangTools Plugin.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Code Analyzer", + "Description" : "ClangTools Plugin.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/classview/ClassView.json.in b/src/plugins/classview/ClassView.json.in index 81cca038c3c..753824248b9 100644 --- a/src/plugins/classview/ClassView.json.in +++ b/src/plugins/classview/ClassView.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"ClassView\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) 2016 Denis Mingulov, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "ClassView", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) 2016 Denis Mingulov, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"C++\", - \"Description\" : \"Class View component.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "C++", + "Description" : "Class View component.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/clearcase/ClearCase.json.in b/src/plugins/clearcase/ClearCase.json.in index e4ddc162b08..8bcfbb66bc0 100644 --- a/src/plugins/clearcase/ClearCase.json.in +++ b/src/plugins/clearcase/ClearCase.json.in @@ -1,31 +1,31 @@ { - \"Name\" : \"ClearCase\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, - \"Platform\" : \"^(Linux|Windows)\", - \"Vendor\" : \"AudioCodes\", - \"Copyright\" : \"(C) 2016 AudioCodes Ltd., (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "ClearCase", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Platform" : "^(Linux|Windows)", + "Vendor" : "AudioCodes", + "Copyright" : "(C) 2016 AudioCodes Ltd., (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Version Control\", - \"Description\" : \"ClearCase integration.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Version Control", + "Description" : "ClearCase integration.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'application/vnd.audc.text.clearcase.submit\'>\", - \" <comment>ClearCase submit template</comment>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='application/vnd.audc.text.clearcase.submit'>", + " <comment>ClearCase submit template</comment>", + " <sub-class-of type='text/plain'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/cmakeprojectmanager/CMakeProjectManager.json.in b/src/plugins/cmakeprojectmanager/CMakeProjectManager.json.in index 4b11e3d7c2a..fc239c6a572 100644 --- a/src/plugins/cmakeprojectmanager/CMakeProjectManager.json.in +++ b/src/plugins/cmakeprojectmanager/CMakeProjectManager.json.in @@ -1,35 +1,35 @@ { - \"Name\" : \"CMakeProjectManager\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "CMakeProjectManager", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Build Systems\", - \"Description\" : \"CMake support.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Build Systems", + "Description" : "CMake support.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/x-cmake\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>CMake Project file</comment>\", - \" <glob pattern=\'*.cmake\'/>\", - \" </mime-type>\", - \" <mime-type type=\'text/x-cmake-project\'>\", - \" <sub-class-of type=\'text/x-cmake\'/>\", - \" <comment>CMake Project file</comment>\", - \" <glob pattern=\'CMakeLists.txt\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/x-cmake'>", + " <sub-class-of type='text/plain'/>", + " <comment>CMake Project file</comment>", + " <glob pattern='*.cmake'/>", + " </mime-type>", + " <mime-type type='text/x-cmake-project'>", + " <sub-class-of type='text/x-cmake'/>", + " <comment>CMake Project file</comment>", + " <glob pattern='CMakeLists.txt'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/coco/Coco.json.in b/src/plugins/coco/Coco.json.in index d4a16e34a65..01beb8c4984 100644 --- a/src/plugins/coco/Coco.json.in +++ b/src/plugins/coco/Coco.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"Coco\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Experimental\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Coco", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Experimental" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Squish Coco support. Squish Coco is a code coverage tool for Tcl, QML, C# and C/C++.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "Squish Coco support. Squish Coco is a code coverage tool for Tcl, QML, C# and C/C++.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/compilationdatabaseprojectmanager/CompilationDatabaseProjectManager.json.in b/src/plugins/compilationdatabaseprojectmanager/CompilationDatabaseProjectManager.json.in index 00da891d743..4842c3d73cc 100644 --- a/src/plugins/compilationdatabaseprojectmanager/CompilationDatabaseProjectManager.json.in +++ b/src/plugins/compilationdatabaseprojectmanager/CompilationDatabaseProjectManager.json.in @@ -1,30 +1,30 @@ { - \"Name\" : \"CompilationDatabaseProjectManager\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Experimental\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "CompilationDatabaseProjectManager", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Experimental" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Build Systems\", - \"Description\" : \"Compilation Database project support.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/x-compilation-database-project\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Compilation Database file</comment>\", - \" <glob pattern=\'compile_commands.json\' weight=\'100\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Category" : "Build Systems", + "Description" : "Compilation Database project support.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/x-compilation-database-project'>", + " <sub-class-of type='text/plain'/>", + " <comment>Compilation Database file</comment>", + " <glob pattern='compile_commands.json' weight='100'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/conan/Conan.json.in b/src/plugins/conan/Conan.json.in index 4ee078c1c90..b81813c0a6f 100644 --- a/src/plugins/conan/Conan.json.in +++ b/src/plugins/conan/Conan.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"Conan\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"Jochen Seemann\", - \"Copyright\" : \"(C) 2018 Jochen Seemann, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Conan", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "Jochen Seemann", + "Copyright" : "(C) 2018 Jochen Seemann, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Experimental\" : true, - \"Description\" : \"Conan integration.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Experimental" : true, + "Description" : "Conan integration.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/copilot/Copilot.json.in b/src/plugins/copilot/Copilot.json.in index ae5853c212d..81f326770d4 100644 --- a/src/plugins/copilot/Copilot.json.in +++ b/src/plugins/copilot/Copilot.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"Copilot\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Copilot", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Copilot support\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "Copilot support", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/coreplugin/Core.json.in b/src/plugins/coreplugin/Core.json.in index 606085c91d8..8f121d61a3f 100644 --- a/src/plugins/coreplugin/Core.json.in +++ b/src/plugins/coreplugin/Core.json.in @@ -1,44 +1,44 @@ { - \"Name\" : \"Core\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Required\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Core", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Required" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Core\", - \"Description\" : \"The core plugin for the Qt IDE.\", - \"Url\" : \"http://www.qt.io\", - \"Arguments\" : [ + "Category" : "Core", + "Description" : "The core plugin for the Qt IDE.", + "Url" : "http://www.qt.io", + "Arguments" : [ { - \"Name\" : \"-color\", - \"Parameter\" : \"color\", - \"Description\" : \"Override selected UI color\" + "Name" : "-color", + "Parameter" : "color", + "Description" : "Override selected UI color" }, { - \"Name\" : \"-theme\", - \"Parameter\" : \"default|dark\", - \"Description\" : \"Choose a built-in theme or pass a .creatortheme file\" + "Name" : "-theme", + "Parameter" : "default|dark", + "Description" : "Choose a built-in theme or pass a .creatortheme file" }, { - \"Name\" : \"-presentationMode\", - \"Description\" : \"Enable presentation mode with pop-ups for key combos\" + "Name" : "-presentationMode", + "Description" : "Enable presentation mode with pop-ups for key combos" }, { - \"Name\" : \"-lastsession\", - \"Description\" : \"Restore the last session\" + "Name" : "-lastsession", + "Description" : "Restore the last session" }, { - \"Name\" : \"<session>\", - \"Description\" : \"Restore a saved session\" + "Name" : "<session>", + "Description" : "Restore a saved session" } ], - $$dependencyList + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/cpaster/CodePaster.json.in b/src/plugins/cpaster/CodePaster.json.in index 1e569634c4d..af6025becbb 100644 --- a/src/plugins/cpaster/CodePaster.json.in +++ b/src/plugins/cpaster/CodePaster.json.in @@ -1,18 +1,18 @@ { - \"Name\" : \"CodePaster\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "CodePaster", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Codepaster plugin for pushing/fetching diff from server.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "Codepaster plugin for pushing/fetching diff from server.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/cppcheck/Cppcheck.json.in b/src/plugins/cppcheck/Cppcheck.json.in index ef2b1f48ca9..f2206e0fcae 100644 --- a/src/plugins/cppcheck/Cppcheck.json.in +++ b/src/plugins/cppcheck/Cppcheck.json.in @@ -1,20 +1,20 @@ { - \"Name\" : \"Cppcheck\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Experimental\" : true, - \"Vendor\" : \"Sergey Morozov\", - \"Copyright\" : \"(C) 2018 Sergey Morozov, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid commercial Qt licenses may use this file in accordance with the commercial license agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company. For licensing terms and conditions see https://www.qt.io/terms-conditions. For further information use the contact form at https://www.qt.io/contact-us.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this file may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this file. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Cppcheck", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Experimental" : true, + "Vendor" : "Sergey Morozov", + "Copyright" : "(C) 2018 Sergey Morozov, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid commercial Qt licenses may use this file in accordance with the commercial license agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company. For licensing terms and conditions see https://www.qt.io/terms-conditions. For further information use the contact form at https://www.qt.io/contact-us.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this file may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this file. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Code Analyzer\", - \"Description\" : \"Cppcheck static analyzer tool integration. See http://cppcheck.sourceforge.net.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Code Analyzer", + "Description" : "Cppcheck static analyzer tool integration. See http://cppcheck.sourceforge.net.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/cppeditor/CppEditor.json.in b/src/plugins/cppeditor/CppEditor.json.in index b3c0149291b..0e9d50eb4b3 100644 --- a/src/plugins/cppeditor/CppEditor.json.in +++ b/src/plugins/cppeditor/CppEditor.json.in @@ -1,125 +1,125 @@ { - \"Name\" : \"CppEditor\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "CppEditor", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"C++\", - \"Description\" : \"C/C++ editor component.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "C++", + "Description" : "C/C++ editor component.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\' encoding=\'UTF-8\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/x-csrc\'>\", - \" <comment>C source code</comment>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <alias type=\'text/x-c\'/>\", - \" <glob pattern=\'*.c\' case-sensitive=\'true\' weight=\'70\'/>\", - \" </mime-type>\", + "Mimetypes" : [ + "<?xml version='1.0' encoding='UTF-8'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/x-csrc'>", + " <comment>C source code</comment>", + " <sub-class-of type='text/plain'/>", + " <alias type='text/x-c'/>", + " <glob pattern='*.c' case-sensitive='true' weight='70'/>", + " </mime-type>", - \" <mime-type type=\'text/vnd.nvidia.cuda.csrc\'>\", - \" <sub-class-of type=\'text/x-csrc\'/>\", - \" <comment>NVIDIA CUDA C source code</comment>\", - \" <glob pattern=\'*.cu\'/>\", - \" </mime-type>\", + " <mime-type type='text/vnd.nvidia.cuda.csrc'>", + " <sub-class-of type='text/x-csrc'/>", + " <comment>NVIDIA CUDA C source code</comment>", + " <glob pattern='*.cu'/>", + " </mime-type>", - \" <mime-type type=\'text/x-chdr\'>\", - \" <comment>C header</comment>\", - \" <sub-class-of type=\'text/x-csrc\'/>\", - \" <!-- reduce weight from freedesktop to avoid conflict with text/x-c++hdr -->\", - \" <glob pattern=\'*.h\' weight=\'30\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-chdr'>", + " <comment>C header</comment>", + " <sub-class-of type='text/x-csrc'/>", + " <!-- reduce weight from freedesktop to avoid conflict with text/x-c++hdr -->", + " <glob pattern='*.h' weight='30'/>", + " </mime-type>", - \" <!-- Those are used to find matching headers by the CppEditor plugin,\", - \" so, they should match -->\", - \" <mime-type type=\'text/x-c++hdr\'>\", - \" <sub-class-of type=\'text/x-chdr\'/>\", - \" <comment>C++ header</comment>\", - \" <glob pattern=\'*.hh\' weight=\'70\'/>\", - \" <glob pattern=\'*.hxx\' weight=\'70\'/>\", - \" <glob pattern=\'*.h++\' weight=\'70\'/>\", - \" <glob pattern=\'*.hpp\' weight=\'70\'/>\", - \" <glob pattern=\'*.hp\' weight=\'70\'/>\", - \" <!-- Additions to freedesktop: -->\", - \" <glob pattern=\'*.h\' weight=\'70\'/>\", - \" <glob pattern=\'*.H\' weight=\'70\'/>\", - \" <glob pattern=\'*.inl\' weight=\'70\'/>\", - \" <glob pattern=\'*.tcc\' weight=\'70\'/>\", - \" <glob pattern=\'*.tpp\' weight=\'70\'/>\", - \" <glob pattern=\'*.t++\' weight=\'70\'/>\", - \" <glob pattern=\'*.txx\' weight=\'70\'/>\", - \" <!-- Find include guards of header files without extension, for\", - \" example, STL ones like <string>. Those can have a big initial\", - \" comment exceeding 1000 chars, though. -->\", - \" <magic priority=\'40\'>\", - \" <match value=\'#ifndef \' type=\'string\' offset=\'0:2000\'/>\", - \" <match value=\'#if \' type=\'string\' offset=\'0:2000\'/>\", - \" <match value=\'#include \' type=\'string\' offset=\'0:2000\'/>\", - \" </magic>\", - \" </mime-type>\", + " <!-- Those are used to find matching headers by the CppEditor plugin,", + " so, they should match -->", + " <mime-type type='text/x-c++hdr'>", + " <sub-class-of type='text/x-chdr'/>", + " <comment>C++ header</comment>", + " <glob pattern='*.hh' weight='70'/>", + " <glob pattern='*.hxx' weight='70'/>", + " <glob pattern='*.h++' weight='70'/>", + " <glob pattern='*.hpp' weight='70'/>", + " <glob pattern='*.hp' weight='70'/>", + " <!-- Additions to freedesktop: -->", + " <glob pattern='*.h' weight='70'/>", + " <glob pattern='*.H' weight='70'/>", + " <glob pattern='*.inl' weight='70'/>", + " <glob pattern='*.tcc' weight='70'/>", + " <glob pattern='*.tpp' weight='70'/>", + " <glob pattern='*.t++' weight='70'/>", + " <glob pattern='*.txx' weight='70'/>", + " <!-- Find include guards of header files without extension, for", + " example, STL ones like <string>. Those can have a big initial", + " comment exceeding 1000 chars, though. -->", + " <magic priority='40'>", + " <match value='#ifndef ' type='string' offset='0:2000'/>", + " <match value='#if ' type='string' offset='0:2000'/>", + " <match value='#include ' type='string' offset='0:2000'/>", + " </magic>", + " </mime-type>", - \" <mime-type type=\'text/x-c++src\'>\", - \" <comment>C++ source code</comment>\", - \" <sub-class-of type=\'text/x-csrc\'/>\", - \" <glob pattern=\'*.cpp\' weight=\'70\'/>\", - \" <glob pattern=\'*.cxx\' weight=\'70\'/>\", - \" <glob pattern=\'*.cc\' weight=\'70\'/>\", - \" <glob pattern=\'*.C\' case-sensitive=\'true\' weight=\'70\'/>\", - \" <glob pattern=\'*.c++\' weight=\'70\'/>\", - \" <!-- Additions to freedesktop: -->\", - \" <glob pattern=\'*.cp\' weight=\'70\'/>\", - \" <magic priority=\'30\'>\", - \" <match value=\'-*- C++ -*-\' type=\'string\' offset=\'0:30\'/>\", - \" </magic>\", - \" </mime-type>\", + " <mime-type type='text/x-c++src'>", + " <comment>C++ source code</comment>", + " <sub-class-of type='text/x-csrc'/>", + " <glob pattern='*.cpp' weight='70'/>", + " <glob pattern='*.cxx' weight='70'/>", + " <glob pattern='*.cc' weight='70'/>", + " <glob pattern='*.C' case-sensitive='true' weight='70'/>", + " <glob pattern='*.c++' weight='70'/>", + " <!-- Additions to freedesktop: -->", + " <glob pattern='*.cp' weight='70'/>", + " <magic priority='30'>", + " <match value='-*- C++ -*-' type='string' offset='0:30'/>", + " </magic>", + " </mime-type>", - \" <mime-type type=\'text/x-qdoc\'>\", - \" <comment>Qt documentation file</comment>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <glob pattern=\'*.qdoc\' weight=\'70\'/>\", - \" <glob pattern=\'*.qdocinc\' weight=\'70\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-qdoc'>", + " <comment>Qt documentation file</comment>", + " <sub-class-of type='text/plain'/>", + " <glob pattern='*.qdoc' weight='70'/>", + " <glob pattern='*.qdocinc' weight='70'/>", + " </mime-type>", - \" <mime-type type=\'text/x-moc\'>\", - \" <comment>Qt MOC file</comment>\", - \" <!-- Fix to freedesktop: moc is C++ source -->\", - \" <sub-class-of type=\'text/x-c++src\'/>\", - \" <glob pattern=\'*.moc\' weight=\'70\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-moc'>", + " <comment>Qt MOC file</comment>", + " <!-- Fix to freedesktop: moc is C++ source -->", + " <sub-class-of type='text/x-c++src'/>", + " <glob pattern='*.moc' weight='70'/>", + " </mime-type>", - \" <mime-type type=\'text/x-objc++src\'>\", - \" <comment>Objective-C++ source code</comment>\", - \" <sub-class-of type=\'text/x-c++src\'/>\", - \" <sub-class-of type=\'text/x-objcsrc\'/>\", - \" <glob pattern=\'*.mm\' weight=\'70\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-objc++src'>", + " <comment>Objective-C++ source code</comment>", + " <sub-class-of type='text/x-c++src'/>", + " <sub-class-of type='text/x-objcsrc'/>", + " <glob pattern='*.mm' weight='70'/>", + " </mime-type>", - \" <mime-type type=\'text/x-objcsrc\'>\", - \" <comment>Objective-C source code</comment>\", - \" <sub-class-of type=\'text/x-csrc\'/>\", - \" <glob pattern=\'*.m\' weight=\'70\'/>\", - \" <magic priority=\'30\'>\", - \" <match value=\'#import\' type=\'string\' offset=\'0\'/>\", - \" </magic>\", - \" </mime-type>\", + " <mime-type type='text/x-objcsrc'>", + " <comment>Objective-C source code</comment>", + " <sub-class-of type='text/x-csrc'/>", + " <glob pattern='*.m' weight='70'/>", + " <magic priority='30'>", + " <match value='#import' type='string' offset='0'/>", + " </magic>", + " </mime-type>", - \" <mime-type type=\'text/x-dsrc\'>\", - \" <comment>D source code</comment>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <glob pattern=\'*.d\'/>\", - \" <glob pattern=\'*.di\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-dsrc'>", + " <comment>D source code</comment>", + " <sub-class-of type='text/plain'/>", + " <glob pattern='*.d'/>", + " <glob pattern='*.di'/>", + " </mime-type>", - \"</mime-info>\" + "</mime-info>" ] } diff --git a/src/plugins/ctfvisualizer/CtfVisualizer.json.in b/src/plugins/ctfvisualizer/CtfVisualizer.json.in index e581d227334..1b4b91a6d5a 100644 --- a/src/plugins/ctfvisualizer/CtfVisualizer.json.in +++ b/src/plugins/ctfvisualizer/CtfVisualizer.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"CtfVisualizer\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"KDAB Group, www.kdab.com\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "CtfVisualizer", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "KDAB Group, www.kdab.com", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Code Analyzer\", - \"Description\" : \"Chrome Trace Format Visualizer Plugin.\", - \"Url\" : \"https://www.kdab.com\", - $$dependencyList + "Category" : "Code Analyzer", + "Description" : "Chrome Trace Format Visualizer Plugin.", + "Url" : "https://www.kdab.com", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/cvs/CVS.json.in b/src/plugins/cvs/CVS.json.in index 5aa6b1eb784..6691722b0ae 100644 --- a/src/plugins/cvs/CVS.json.in +++ b/src/plugins/cvs/CVS.json.in @@ -1,29 +1,29 @@ { - \"Name\" : \"CVS\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "CVS", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Version Control\", - \"Description\" : \"CVS integration.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Version Control", + "Description" : "CVS integration.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/vnd.qtcreator.cvs.submit\'>\", - \" <comment>CVS submit template</comment>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/vnd.qtcreator.cvs.submit'>", + " <comment>CVS submit template</comment>", + " <sub-class-of type='text/plain'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/debugger/Debugger.json.in b/src/plugins/debugger/Debugger.json.in index 96b9502ebe0..06df0489d6c 100644 --- a/src/plugins/debugger/Debugger.json.in +++ b/src/plugins/debugger/Debugger.json.in @@ -1,60 +1,60 @@ { - \"Name\" : \"Debugger\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Debugger", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Qt Creator\", - \"Description\" : \"Debugger integration.\", - \"Url\" : \"http://www.qt.io\", - \"Arguments\" : [ + "Category" : "Qt Creator", + "Description" : "Debugger integration.", + "Url" : "http://www.qt.io", + "Arguments" : [ { - \"Name\" : \"-debug\", - \"Parameter\" : \"pid\", - \"Description\" : \"Attach to local process\" + "Name" : "-debug", + "Parameter" : "pid", + "Description" : "Attach to local process" }, { - \"Name\" : \"-debug <executable>[,kit=<kit>][,terminal={0,1}][,sysroot=<sysroot>]\", - \"Description\" : \"Start and debug executable\" + "Name" : "-debug <executable>[,kit=<kit>][,terminal={0,1}][,sysroot=<sysroot>]", + "Description" : "Start and debug executable" }, { - \"Name\" : \"-debug [executable,]core=<corefile>[,kit=<kit>][,sysroot=<sysroot>]\", - \"Description\" : \"Attach to core file\" + "Name" : "-debug [executable,]core=<corefile>[,kit=<kit>][,sysroot=<sysroot>]", + "Description" : "Attach to core file" }, { - \"Name\" : \"-debug <executable>,server=<server:port>[,kit=<kit>][,sysroot=<sysroot>]\", - \"Description\" : \"Attach to remote debug server\" + "Name" : "-debug <executable>,server=<server:port>[,kit=<kit>][,sysroot=<sysroot>]", + "Description" : "Attach to remote debug server" }, { - \"Name\" : \"-wincrashevent\", - \"Parameter\" : \"eventhandle:pid\", - \"Description\" : \"Event handle used for attaching to crashed processes\" + "Name" : "-wincrashevent", + "Parameter" : "eventhandle:pid", + "Description" : "Event handle used for attaching to crashed processes" } ], - $$dependencyList, + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/x-asm\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Assembler</comment>\", - \" <glob pattern=\'*.asm\'/>\", - \" </mime-type>\", - \" <!-- Catch-all for assemblers -->\", - \" <mime-type type=\'text/x-qtcreator-generic-asm\'>\", - \" <sub-class-of type=\'text/x-asm\'/>\", - \" <comment>Qt Creator Generic Assembler</comment>\", - \" <glob pattern=\'*.asm\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/x-asm'>", + " <sub-class-of type='text/plain'/>", + " <comment>Assembler</comment>", + " <glob pattern='*.asm'/>", + " </mime-type>", + " <!-- Catch-all for assemblers -->", + " <mime-type type='text/x-qtcreator-generic-asm'>", + " <sub-class-of type='text/x-asm'/>", + " <comment>Qt Creator Generic Assembler</comment>", + " <glob pattern='*.asm'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/designer/Designer.json.in b/src/plugins/designer/Designer.json.in index 91f90b06520..b11764606e4 100644 --- a/src/plugins/designer/Designer.json.in +++ b/src/plugins/designer/Designer.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"Designer\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Designer", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Qt Creator\", - \"Description\" : \"Qt Designer integration.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Qt Creator", + "Description" : "Qt Designer integration.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/diffeditor/DiffEditor.json.in b/src/plugins/diffeditor/DiffEditor.json.in index 0dbbfbd6106..8fc93667da0 100644 --- a/src/plugins/diffeditor/DiffEditor.json.in +++ b/src/plugins/diffeditor/DiffEditor.json.in @@ -1,18 +1,18 @@ { - \"Name\" : \"DiffEditor\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "DiffEditor", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Diff editor component.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "Diff editor component.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/docker/Docker.json.in b/src/plugins/docker/Docker.json.in index c2854973d48..6fc896f8032 100644 --- a/src/plugins/docker/Docker.json.in +++ b/src/plugins/docker/Docker.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"Docker\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Docker", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Experimental\" : true, - \"Description\" : \"Basic support for Docker\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Experimental" : true, + "Description" : "Basic support for Docker", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/emacskeys/EmacsKeys.json.in b/src/plugins/emacskeys/EmacsKeys.json.in index 9935c0cd72a..c0e5bdde59a 100644 --- a/src/plugins/emacskeys/EmacsKeys.json.in +++ b/src/plugins/emacskeys/EmacsKeys.json.in @@ -1,32 +1,32 @@ { - \"Name\" : \"EmacsKeys\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Experimental\" : true, - \"Vendor\" : \"nsf\", - \"Copyright\" : \"(C) 2016 nsf <no.smile.face@gmail.com>, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "EmacsKeys", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Experimental" : true, + "Vendor" : "nsf", + "Copyright" : "(C) 2016 nsf <no.smile.face@gmail.com>, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Provides additional actions that typical Emacs users would expect.\", - \"LongDescription\" : [ - \"The main idea behind this plugin is to provide additional actions a typical emacs user would expect. It doesn\'t claim to provide full emacs emulation. The following actions are available:\", - \" - Movement [C-f, C-b, C-n, C-p, M-f, M-b, C-a, C-e, M-<, M->]\", - \" - Mark-based selection [C-SPC, C-x C-x]\", - \" - Cut/copy/yank (doesn\'t provide kill ring feature) [M-w, C-w, C-y]\", - \" - Kill actions, which interact properly with clipboard [C-k, M-d, C-d]\", - \" - Scrolling (half of the screen, keeps cursor visible) [C-v, M-v]\", - \" - Insert new line and indent [C-j]\", - \"\", - \"IMPORTANT: Actions are not bound to any key combinations by default. You can find them under \'EmacsKeys\' section in keyboard shortcuts settings.\", - \"\", - \"Also it\'s worth mentioning that EmacsKeys plugin forces disabling of menu mnemonics by calling Qt\'s qt_set_sequence_auto_mnemonic function with false argument. Many of the english menu mnemonics get into the way of typical emacs keys, this includes: Alt+F (File), Alt+B (Build), Alt+W (Window). It\'s a temporary solution, it remains until there is a better one.\" + "Description" : "Provides additional actions that typical Emacs users would expect.", + "LongDescription" : [ + "The main idea behind this plugin is to provide additional actions a typical emacs user would expect. It doesn't claim to provide full emacs emulation. The following actions are available:", + " - Movement [C-f, C-b, C-n, C-p, M-f, M-b, C-a, C-e, M-<, M->]", + " - Mark-based selection [C-SPC, C-x C-x]", + " - Cut/copy/yank (doesn't provide kill ring feature) [M-w, C-w, C-y]", + " - Kill actions, which interact properly with clipboard [C-k, M-d, C-d]", + " - Scrolling (half of the screen, keeps cursor visible) [C-v, M-v]", + " - Insert new line and indent [C-j]", + "", + "IMPORTANT: Actions are not bound to any key combinations by default. You can find them under 'EmacsKeys' section in keyboard shortcuts settings.", + "", + "Also it's worth mentioning that EmacsKeys plugin forces disabling of menu mnemonics by calling Qt's qt_set_sequence_auto_mnemonic function with false argument. Many of the english menu mnemonics get into the way of typical emacs keys, this includes: Alt+F (File), Alt+B (Build), Alt+W (Window). It's a temporary solution, it remains until there is a better one." ], - \"Url\" : \"http://nosmileface.ru\", - $$dependencyList + "Url" : "http://nosmileface.ru", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/fakevim/FakeVim.json.in b/src/plugins/fakevim/FakeVim.json.in index b9b72636495..915b50331b3 100644 --- a/src/plugins/fakevim/FakeVim.json.in +++ b/src/plugins/fakevim/FakeVim.json.in @@ -1,18 +1,18 @@ { - \"Name\" : \"FakeVim\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "FakeVim", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"VI-style keyboard navigation.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "VI-style keyboard navigation.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/fossil/Fossil.json.in b/src/plugins/fossil/Fossil.json.in index eb4719af8f9..61204143ba6 100644 --- a/src/plugins/fossil/Fossil.json.in +++ b/src/plugins/fossil/Fossil.json.in @@ -1,20 +1,20 @@ { - \"Name\" : \"Fossil\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, - \"Vendor\" : \"Artur Shepilko\", - \"Copyright\" : \"(C) 2018 Artur Shepilko\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Fossil", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Vendor" : "Artur Shepilko", + "Copyright" : "(C) 2018 Artur Shepilko", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Version Control\", - \"Description\" : \"Fossil SCM integration.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Version Control", + "Description" : "Fossil SCM integration.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/genericprojectmanager/GenericProjectManager.json.in b/src/plugins/genericprojectmanager/GenericProjectManager.json.in index c52201914a8..ec4eae552e8 100644 --- a/src/plugins/genericprojectmanager/GenericProjectManager.json.in +++ b/src/plugins/genericprojectmanager/GenericProjectManager.json.in @@ -1,62 +1,62 @@ { - \"Name\" : \"GenericProjectManager\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "GenericProjectManager", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Build Systems\", - \"Description\" : \"Generic support.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Build Systems", + "Description" : "Generic support.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", + "Mimetypes" : [ + "<?xml version='1.0'?>", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/x-generic-project\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Generic Qt Creator Project file</comment>\", - \" <glob pattern=\'*.creator\'/>\", - \" </mime-type>\", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/x-generic-project'>", + " <sub-class-of type='text/plain'/>", + " <comment>Generic Qt Creator Project file</comment>", + " <glob pattern='*.creator'/>", + " </mime-type>", - \" <mime-type type=\'application/vnd.qtcreator.generic.files\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Generic Project Files</comment>\", - \" <glob pattern=\'*.files\'/>\", - \" </mime-type>\", + " <mime-type type='application/vnd.qtcreator.generic.files'>", + " <sub-class-of type='text/plain'/>", + " <comment>Generic Project Files</comment>", + " <glob pattern='*.files'/>", + " </mime-type>", - \" <mime-type type=\'application/vnd.qtcreator.generic.includes\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Generic Project Include Paths</comment>\", - \" <glob pattern=\'*.includes\'/>\", - \" </mime-type>\", + " <mime-type type='application/vnd.qtcreator.generic.includes'>", + " <sub-class-of type='text/plain'/>", + " <comment>Generic Project Include Paths</comment>", + " <glob pattern='*.includes'/>", + " </mime-type>", - \" <mime-type type=\'application/vnd.qtcreator.generic.config\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Generic Project Configuration File</comment>\", - \" <glob pattern=\'*.config\'/>\", - \" </mime-type>\", + " <mime-type type='application/vnd.qtcreator.generic.config'>", + " <sub-class-of type='text/plain'/>", + " <comment>Generic Project Configuration File</comment>", + " <glob pattern='*.config'/>", + " </mime-type>", - \" <mime-type type=\'application/vnd.qtcreator.generic.cxxflags\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Generic Project CXXFLAGS File</comment>\", - \" <glob pattern=\'*.cxxflags\'/>\", - \" </mime-type>\", + " <mime-type type='application/vnd.qtcreator.generic.cxxflags'>", + " <sub-class-of type='text/plain'/>", + " <comment>Generic Project CXXFLAGS File</comment>", + " <glob pattern='*.cxxflags'/>", + " </mime-type>", - \" <mime-type type=\'application/vnd.qtcreator.generic.cflags\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Generic Project CFLAGS File</comment>\", - \" <glob pattern=\'*.cflags\'/>\", - \" </mime-type>\", + " <mime-type type='application/vnd.qtcreator.generic.cflags'>", + " <sub-class-of type='text/plain'/>", + " <comment>Generic Project CFLAGS File</comment>", + " <glob pattern='*.cflags'/>", + " </mime-type>", - \"</mime-info>\" + "</mime-info>" ] } diff --git a/src/plugins/git/Git.json.in b/src/plugins/git/Git.json.in index 244ed2f8435..db0663a8765 100644 --- a/src/plugins/git/Git.json.in +++ b/src/plugins/git/Git.json.in @@ -1,43 +1,43 @@ { - \"Name\" : \"Git\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Git", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Version Control\", - \"Description\" : \"Git integration.\", - \"Url\" : \"http://www.qt.io\", - \"Arguments\" : [ + "Category" : "Version Control", + "Description" : "Git integration.", + "Url" : "http://www.qt.io", + "Arguments" : [ { - \"Name\" : \"-git-show\", - \"Parameter\" : \"git commit hash\", - \"Description\" : \"Show given commit hash\" + "Name" : "-git-show", + "Parameter" : "git commit hash", + "Description" : "Show given commit hash" } ], - $$dependencyList, + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/vnd.qtcreator.git.commit\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Git Commit File</comment>\", - \" <glob pattern=\'COMMIT_MSG\'/>\", - \" <glob pattern=\'COMMIT_EDITMSG\'/>\", - \" </mime-type>\", - \" <mime-type type=\'text/vnd.qtcreator.git.rebase\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Git Commit File</comment>\", - \" <glob pattern=\'git-rebase-todo\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/vnd.qtcreator.git.commit'>", + " <sub-class-of type='text/plain'/>", + " <comment>Git Commit File</comment>", + " <glob pattern='COMMIT_MSG'/>", + " <glob pattern='COMMIT_EDITMSG'/>", + " </mime-type>", + " <mime-type type='text/vnd.qtcreator.git.rebase'>", + " <sub-class-of type='text/plain'/>", + " <comment>Git Commit File</comment>", + " <glob pattern='git-rebase-todo'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/gitlab/GitLab.json.in b/src/plugins/gitlab/GitLab.json.in index cd65b9ee3ee..ad55a21d7c5 100644 --- a/src/plugins/gitlab/GitLab.json.in +++ b/src/plugins/gitlab/GitLab.json.in @@ -1,19 +1,19 @@ { -\"Name\" : \"GitLab\", -\"Version\" : \"$$QTCREATOR_VERSION\", -\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", -\"Experimental\" : true, -\"Vendor\" : \"The Qt Company Ltd\", -\"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", -\"License\" : [ \"Commercial Usage\", -\"\", -\"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", -\"\", -\"GNU General Public License Usage\", -\"\", -\"Alternatively, this file may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this file. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" +"Name" : "GitLab", +"Version" : "${IDE_VERSION}", +"CompatVersion" : "${IDE_VERSION_COMPAT}", +"Experimental" : true, +"Vendor" : "The Qt Company Ltd", +"Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", +"License" : [ "Commercial Usage", +"", +"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", +"", +"GNU General Public License Usage", +"", +"Alternatively, this file may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this file. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], -\"Description\" : \"GitLab plugin.\", -\"Url\" : \"http://www.qt.io\", -$$dependencyList +"Description" : "GitLab plugin.", +"Url" : "http://www.qt.io", +${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/glsleditor/GLSLEditor.json.in b/src/plugins/glsleditor/GLSLEditor.json.in index aa67b7bfc9e..54ef8d548bb 100644 --- a/src/plugins/glsleditor/GLSLEditor.json.in +++ b/src/plugins/glsleditor/GLSLEditor.json.in @@ -1,64 +1,64 @@ { - \"Name\" : \"GLSLEditor\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "GLSLEditor", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Other Languages\", - \"Description\" : \"Editor for GLSL.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Other Languages", + "Description" : "Editor for GLSL.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", - \" <mime-type type=\'application/x-glsl\'>\", - \" <alias type=\'text/x-glsl\'/>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>GLSL Shader file</comment>\", - \" <glob pattern=\'*.glsl\'/>\", - \" <glob pattern=\'*.shader\'/>\", - \" </mime-type>\", + " <mime-type type='application/x-glsl'>", + " <alias type='text/x-glsl'/>", + " <sub-class-of type='text/plain'/>", + " <comment>GLSL Shader file</comment>", + " <glob pattern='*.glsl'/>", + " <glob pattern='*.shader'/>", + " </mime-type>", - \" <mime-type type=\'text/x-glsl-frag\'>\", - \" <sub-class-of type=\'text/x-glsl\'/>\", - \" <comment>GLSL Fragment Shader file</comment>\", - \" <glob pattern=\'*.frag\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-glsl-frag'>", + " <sub-class-of type='text/x-glsl'/>", + " <comment>GLSL Fragment Shader file</comment>", + " <glob pattern='*.frag'/>", + " </mime-type>", - \" <mime-type type=\'text/x-glsl-es-frag\'>\", - \" <sub-class-of type=\'text/x-glsl\'/>\", - \" <comment>GLSL/ES Fragment Shader file</comment>\", - \" <glob pattern=\'*.fsh\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-glsl-es-frag'>", + " <sub-class-of type='text/x-glsl'/>", + " <comment>GLSL/ES Fragment Shader file</comment>", + " <glob pattern='*.fsh'/>", + " </mime-type>", - \" <mime-type type=\'text/x-glsl-vert\'>\", - \" <sub-class-of type=\'text/x-glsl\'/>\", - \" <comment>GLSL Vertex Shader file</comment>\", - \" <glob pattern=\'*.vert\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-glsl-vert'>", + " <sub-class-of type='text/x-glsl'/>", + " <comment>GLSL Vertex Shader file</comment>", + " <glob pattern='*.vert'/>", + " </mime-type>", - \" <mime-type type=\'text/x-glsl-es-vert\'>\", - \" <sub-class-of type=\'text/x-glsl\'/>\", - \" <comment>GLSL/ES Vertex Shader file</comment>\", - \" <glob pattern=\'*.vsh\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-glsl-es-vert'>", + " <sub-class-of type='text/x-glsl'/>", + " <comment>GLSL/ES Vertex Shader file</comment>", + " <glob pattern='*.vsh'/>", + " </mime-type>", - \" <mime-type type=\'text/x-glsl-es-geometry\'>\", - \" <sub-class-of type=\'text/x-glsl\'/>\", - \" <comment>GLSL/ES Geometry Shader file</comment>\", - \" <glob pattern=\'*.gsh\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-glsl-es-geometry'>", + " <sub-class-of type='text/x-glsl'/>", + " <comment>GLSL/ES Geometry Shader file</comment>", + " <glob pattern='*.gsh'/>", + " </mime-type>", - \"</mime-info>\" + "</mime-info>" ] } diff --git a/src/plugins/haskell/Haskell.json.in b/src/plugins/haskell/Haskell.json.in index f9062c88b27..9cdb34694a5 100644 --- a/src/plugins/haskell/Haskell.json.in +++ b/src/plugins/haskell/Haskell.json.in @@ -1,23 +1,23 @@ { - \"Name\" : \"Haskell\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, - \"Vendor\" : \"Eike Ziller\", - \"Copyright\" : \"(C) Eike Ziller\", - \"License\" : \"MIT\", - \"Description\" : \"Haskell support\", - \"Url\" : \"https://haskell.org\", - $$dependencyList, + "Name" : "Haskell", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Vendor" : "Eike Ziller", + "Copyright" : "(C) Eike Ziller", + "License" : "MIT", + "Description" : "Haskell support", + "Url" : "https://haskell.org", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/x-haskell-project\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Haskell Cabal project file</comment>\", - \" <glob pattern=\'*.cabal\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/x-haskell-project'>", + " <sub-class-of type='text/plain'/>", + " <comment>Haskell Cabal project file</comment>", + " <glob pattern='*.cabal'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/helloworld/HelloWorld.json.in b/src/plugins/helloworld/HelloWorld.json.in index d471fd0ba98..bf6fa1587be 100644 --- a/src/plugins/helloworld/HelloWorld.json.in +++ b/src/plugins/helloworld/HelloWorld.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"HelloWorld\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "HelloWorld", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Hello World sample plugin.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "Hello World sample plugin.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/help/Help.json.in b/src/plugins/help/Help.json.in index 98f79b0b3f0..e6ecc9eeb37 100644 --- a/src/plugins/help/Help.json.in +++ b/src/plugins/help/Help.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"Help\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Help", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Core\", - \"Description\" : \"Help system.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Core", + "Description" : "Help system.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/imageviewer/ImageViewer.json.in b/src/plugins/imageviewer/ImageViewer.json.in index 239ed0b0fdf..90ffbcc0c62 100644 --- a/src/plugins/imageviewer/ImageViewer.json.in +++ b/src/plugins/imageviewer/ImageViewer.json.in @@ -1,30 +1,30 @@ { - \"Name\" : \"ImageViewer\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "ImageViewer", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Image Viewer component.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Description" : "Image Viewer component.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", - \" <mime-type type=\'image/webp\'>\", - \" <comment>WebP Image file</comment>\", - \" <glob pattern=\'*.webp\'/>\", - \" </mime-type>\", + " <mime-type type='image/webp'>", + " <comment>WebP Image file</comment>", + " <glob pattern='*.webp'/>", + " </mime-type>", - \"</mime-info>\" + "</mime-info>" ] } diff --git a/src/plugins/incredibuild/IncrediBuild.json.in b/src/plugins/incredibuild/IncrediBuild.json.in index ff8d1718728..d7fb5f242b6 100644 --- a/src/plugins/incredibuild/IncrediBuild.json.in +++ b/src/plugins/incredibuild/IncrediBuild.json.in @@ -1,20 +1,20 @@ { - \"Name\" : \"IncrediBuild\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Platform\" : \"^(Linux|Windows)\", - \"Vendor\" : \"IncrediBuild\", - \"Copyright\" : \"(C) IncrediBuild\", - \"Category\" : \"Build Systems\", - \"Url\" : \"http://www.IncrediBuild.com\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "IncrediBuild", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Platform" : "^(Linux|Windows)", + "Vendor" : "IncrediBuild", + "Copyright" : "(C) IncrediBuild", + "Category" : "Build Systems", + "Url" : "http://www.IncrediBuild.com", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Support for Incredibuild.\", - $$dependencyList + "Description" : "Support for Incredibuild.", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/insight/Insight.json.in b/src/plugins/insight/Insight.json.in index 0ac25523677..096cc0569f5 100644 --- a/src/plugins/insight/Insight.json.in +++ b/src/plugins/insight/Insight.json.in @@ -1,21 +1,21 @@ { - \"Name\" : \"Insight\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Revision\" : \"$$QTC_PLUGIN_REVISION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Insight", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Revision" : "${QTC_PLUGIN_REVISION}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Qt Quick\", - \"Description\" : \"Qt Insight Support for Design Studio.\", - \"DisabledByDefault\" : true, - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Qt Quick", + "Description" : "Qt Insight Support for Design Studio.", + "DisabledByDefault" : true, + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/ios/Ios.json.in b/src/plugins/ios/Ios.json.in index 102f18caa89..2b2e4bae777 100644 --- a/src/plugins/ios/Ios.json.in +++ b/src/plugins/ios/Ios.json.in @@ -1,20 +1,20 @@ { - \"Name\" : \"Ios\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Platform\" : \"OS X.*\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Ios", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Platform" : "OS X.*", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Device Support\", - \"Description\" : \"Support for deployment to and execution on iOS Devices.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Device Support", + "Description" : "Support for deployment to and execution on iOS Devices.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/languageclient/LanguageClient.json.in b/src/plugins/languageclient/LanguageClient.json.in index 8eea5c88cc6..b72f23b154d 100644 --- a/src/plugins/languageclient/LanguageClient.json.in +++ b/src/plugins/languageclient/LanguageClient.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"LanguageClient\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "LanguageClient", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Other Languages\", - \"Description\" : \"Language Server Protocol client component. See https://microsoft.github.io/language-server-protocol/overview for an overview on Language Servers.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Other Languages", + "Description" : "Language Server Protocol client component. See https://microsoft.github.io/language-server-protocol/overview for an overview on Language Servers.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/macros/Macros.json.in b/src/plugins/macros/Macros.json.in index cac1bdf1871..1c5d949c1c2 100644 --- a/src/plugins/macros/Macros.json.in +++ b/src/plugins/macros/Macros.json.in @@ -1,18 +1,18 @@ { - \"Name\" : \"Macros\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Macros", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Macros in text editors.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "Macros in text editors.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/marketplace/Marketplace.json.in b/src/plugins/marketplace/Marketplace.json.in index fd7e6b592cb..1122b40a67a 100644 --- a/src/plugins/marketplace/Marketplace.json.in +++ b/src/plugins/marketplace/Marketplace.json.in @@ -1,18 +1,18 @@ { -\"Name\" : \"Marketplace\", -\"Version\" : \"$$QTCREATOR_VERSION\", -\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", -\"Vendor\" : \"The Qt Company Ltd\", -\"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", -\"License\" : [ \"Commercial Usage\", -\"\", -\"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", -\"\", -\"GNU General Public License Usage\", -\"\", -\"Alternatively, this file may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this file. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" +"Name" : "Marketplace", +"Version" : "${IDE_VERSION}", +"CompatVersion" : "${IDE_VERSION_COMPAT}", +"Vendor" : "The Qt Company Ltd", +"Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", +"License" : [ "Commercial Usage", +"", +"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", +"", +"GNU General Public License Usage", +"", +"Alternatively, this file may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this file. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], -\"Description\" : \"Qt Marketplace plugin.\", -\"Url\" : \"http://www.qt.io\", -$$dependencyList +"Description" : "Qt Marketplace plugin.", +"Url" : "http://www.qt.io", +${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/mcusupport/McuSupport.json.in b/src/plugins/mcusupport/McuSupport.json.in index 2616ea29dcd..94586c932e8 100644 --- a/src/plugins/mcusupport/McuSupport.json.in +++ b/src/plugins/mcusupport/McuSupport.json.in @@ -1,20 +1,20 @@ { - \"Name\" : \"McuSupport\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "McuSupport", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Device Support\", - \"Description\" : \"Helper for MCU related projects.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Device Support", + "Description" : "Helper for MCU related projects.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/mercurial/Mercurial.json.in b/src/plugins/mercurial/Mercurial.json.in index 80a349365d7..5c897570e5f 100644 --- a/src/plugins/mercurial/Mercurial.json.in +++ b/src/plugins/mercurial/Mercurial.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"Mercurial\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"Brian McGillion\", - \"Copyright\" : \"(C) 2016 Brian McGillion, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Mercurial", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "Brian McGillion", + "Copyright" : "(C) 2016 Brian McGillion, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Version Control\", - \"Description\" : \"Mercurial integration.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Version Control", + "Description" : "Mercurial integration.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/mesonprojectmanager/MesonProjectManager.json.in b/src/plugins/mesonprojectmanager/MesonProjectManager.json.in index 27a0bfda7d0..169ac45e628 100644 --- a/src/plugins/mesonprojectmanager/MesonProjectManager.json.in +++ b/src/plugins/mesonprojectmanager/MesonProjectManager.json.in @@ -1,21 +1,21 @@ { - \"Name\" : \"MesonProjectManager\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"Laboratory of Plasma Physics\", - \"Experimental\" : true, - \"DisabledByDefault\" : true, - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR Laboratory of Plasma Physics\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "MesonProjectManager", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "Laboratory of Plasma Physics", + "Experimental" : true, + "DisabledByDefault" : true, + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} Laboratory of Plasma Physics", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Build Systems\", - \"Description\" : \"Meson support.\", - \"Url\" : \"http://www.mesonbuild.com\", - $$dependencyList + "Category" : "Build Systems", + "Description" : "Meson support.", + "Url" : "http://www.mesonbuild.com", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/modeleditor/ModelEditor.json.in b/src/plugins/modeleditor/ModelEditor.json.in index ea4aa9d92f6..6237bce22f1 100644 --- a/src/plugins/modeleditor/ModelEditor.json.in +++ b/src/plugins/modeleditor/ModelEditor.json.in @@ -1,30 +1,30 @@ { - \"Name\" : \"ModelEditor\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"Jochen Becher\", - \"Copyright\" : \"(C) 2017 Jochen Becher, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "ModelEditor", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "Jochen Becher", + "Copyright" : "(C) 2017 Jochen Becher, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Modeling\", - \"Description\" : \"Graphical modeling with structured diagrams.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Modeling", + "Description" : "Graphical modeling with structured diagrams.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\' encoding=\'UTF-8\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/vnd.qtcreator.model\'>\", - \" <sub-class-of type=\'text/xml\'/>\", - \" <comment>Qt Creator Model File</comment>\", - \" <glob pattern=\'*.qmodel\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0' encoding='UTF-8'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/vnd.qtcreator.model'>", + " <sub-class-of type='text/xml'/>", + " <comment>Qt Creator Model File</comment>", + " <glob pattern='*.qmodel'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/nim/Nim.json.in b/src/plugins/nim/Nim.json.in index ae37bfb085d..622e460a0b8 100644 --- a/src/plugins/nim/Nim.json.in +++ b/src/plugins/nim/Nim.json.in @@ -1,50 +1,50 @@ { - \"Name\" : \"Nim\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"Filippo Cucchetto\", - \"Copyright\" : \"(C) 2017 Filippo Cucchetto, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Nim", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "Filippo Cucchetto", + "Copyright" : "(C) 2017 Filippo Cucchetto, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Other Languages\", - \"Description\" : \"Plugin for supporting the Nim programming language.\", - \"Url\" : \"http://www.qt.io\", - \"Experimental\" : true, - $$dependencyList, + "Category" : "Other Languages", + "Description" : "Plugin for supporting the Nim programming language.", + "Url" : "http://www.qt.io", + "Experimental" : true, + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", - \" <mime-type type=\'text/x-nim-project\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Nim project file</comment>\", - \" <glob pattern=\'*.nimproject\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-nim-project'>", + " <sub-class-of type='text/plain'/>", + " <comment>Nim project file</comment>", + " <glob pattern='*.nimproject'/>", + " </mime-type>", - \" <mime-type type=\'text/x-nim\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Nim source file</comment>\", - \" <glob pattern=\'*.nim\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-nim'>", + " <sub-class-of type='text/plain'/>", + " <comment>Nim source file</comment>", + " <glob pattern='*.nim'/>", + " </mime-type>", - \" <mime-type type=\'text/x-nimble\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Nimble project file</comment>\", - \" <glob pattern=\'*.nimble\'/>\", - \" </mime-type>\", + " <mime-type type='text/x-nimble'>", + " <sub-class-of type='text/plain'/>", + " <comment>Nimble project file</comment>", + " <glob pattern='*.nimble'/>", + " </mime-type>", - \" <mime-type type=\'text/x-nim-script\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Nim script file</comment>\", - \" <glob pattern=\'*.nims\'/>\", - \" </mime-type>\", - \"</mime-info>\" + " <mime-type type='text/x-nim-script'>", + " <sub-class-of type='text/plain'/>", + " <comment>Nim script file</comment>", + " <glob pattern='*.nims'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/perforce/Perforce.json.in b/src/plugins/perforce/Perforce.json.in index fc8e4b3679c..8a8e1e5099a 100644 --- a/src/plugins/perforce/Perforce.json.in +++ b/src/plugins/perforce/Perforce.json.in @@ -1,33 +1,33 @@ { - \"Name\" : \"Perforce\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Perforce", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Version Control\", - \"Description\" : \"Perforce integration.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Version Control", + "Description" : "Perforce integration.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/vnd.qtcreator.p4.submit\'>\", - \" <comment>Perforce submit template</comment>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <magic priority=\'50\'>\", - \" <match value=\'# A Perforce Change Specification.\' type=\'string\' offset=\'0\'/>\", - \" </magic>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/vnd.qtcreator.p4.submit'>", + " <comment>Perforce submit template</comment>", + " <sub-class-of type='text/plain'/>", + " <magic priority='50'>", + " <match value='# A Perforce Change Specification.' type='string' offset='0'/>", + " </magic>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/perfprofiler/PerfProfiler.json.in b/src/plugins/perfprofiler/PerfProfiler.json.in index 7af2536d01e..c3a439b1a56 100644 --- a/src/plugins/perfprofiler/PerfProfiler.json.in +++ b/src/plugins/perfprofiler/PerfProfiler.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"PerfProfiler\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "PerfProfiler", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Code Analyzer\", - \"Description\" : \"Perf Profiler Plugin.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Code Analyzer", + "Description" : "Perf Profiler Plugin.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/projectexplorer/ProjectExplorer.json.in b/src/plugins/projectexplorer/ProjectExplorer.json.in index c9b54ad441c..b5f30d4242c 100644 --- a/src/plugins/projectexplorer/ProjectExplorer.json.in +++ b/src/plugins/projectexplorer/ProjectExplorer.json.in @@ -1,42 +1,42 @@ { - \"Name\" : \"ProjectExplorer\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "ProjectExplorer", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Core\", - \"Description\" : \"ProjectExplorer framework that can be extended with different kind of project types.\", - \"Url\" : \"http://www.qt.io\", - \"Arguments\" : [ + "Category" : "Core", + "Description" : "ProjectExplorer framework that can be extended with different kind of project types.", + "Url" : "http://www.qt.io", + "Arguments" : [ { - \"Name\" : \"-customwizard-verbose\", - \"Description\" : \"Verbose loading of custom wizards\" + "Name" : "-customwizard-verbose", + "Description" : "Verbose loading of custom wizards" }, { - \"Name\" : \"-ensure-kit-for-binary\", - \"Parameter\" : \"file path\", - \"Description\" : \"Create kit with architecture matching a given application or library\" + "Name" : "-ensure-kit-for-binary", + "Parameter" : "file path", + "Description" : "Create kit with architecture matching a given application or library" } ], - $$dependencyList, + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\' encoding=\'UTF-8\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/x-tasklist\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Qt Creator task list file</comment>\", - \" <glob pattern=\'*.tasks\'/>\", - \" <glob pattern=\'*.tasks.txt\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0' encoding='UTF-8'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/x-tasklist'>", + " <sub-class-of type='text/plain'/>", + " <comment>Qt Creator task list file</comment>", + " <glob pattern='*.tasks'/>", + " <glob pattern='*.tasks.txt'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/python/Python.json.in b/src/plugins/python/Python.json.in index 98fd52ec8d5..5dfb4c6d49e 100644 --- a/src/plugins/python/Python.json.in +++ b/src/plugins/python/Python.json.in @@ -1,45 +1,45 @@ { - \"Name\" : \"Python\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Python", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Other Languages\", - \"Description\" : \"Plugin for supporting the Python language.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Other Languages", + "Description" : "Plugin for supporting the Python language.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/x-python-gui\'>\", - \" <sub-class-of type=\'text/x-python\'/>\", - \" <comment>Python source file without console</comment>\", - \" <glob pattern=\'*.pyw\'/>\", - \" </mime-type>\", - \" <mime-type type=\'text/x-python-interface\'>\", - \" <sub-class-of type=\'text/x-python\'/>\", - \" <comment>Python module interface file</comment>\", - \" <glob pattern=\'*.pyi\'/>\", - \" </mime-type>\", - \" <mime-type type=\'text/x-pyqt-project\'>\", - \" <sub-class-of type=\'text/x-python\'/>\", - \" <comment>Qt Creator Python project file</comment>\", - \" <glob pattern=\'*.pyqtc\'/>\", - \" </mime-type>\", - \" <mime-type type=\'text/x-python-project\'>\", - \" <sub-class-of type=\'application/json\'/>\", - \" <comment>Qt Creator Python project file</comment>\", - \" <glob pattern=\'*.pyproject\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/x-python-gui'>", + " <sub-class-of type='text/x-python'/>", + " <comment>Python source file without console</comment>", + " <glob pattern='*.pyw'/>", + " </mime-type>", + " <mime-type type='text/x-python-interface'>", + " <sub-class-of type='text/x-python'/>", + " <comment>Python module interface file</comment>", + " <glob pattern='*.pyi'/>", + " </mime-type>", + " <mime-type type='text/x-pyqt-project'>", + " <sub-class-of type='text/x-python'/>", + " <comment>Qt Creator Python project file</comment>", + " <glob pattern='*.pyqtc'/>", + " </mime-type>", + " <mime-type type='text/x-python-project'>", + " <sub-class-of type='application/json'/>", + " <comment>Qt Creator Python project file</comment>", + " <glob pattern='*.pyproject'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/qbsprojectmanager/QbsProjectManager.json.in b/src/plugins/qbsprojectmanager/QbsProjectManager.json.in index 6f74bda34f9..263722d28da 100644 --- a/src/plugins/qbsprojectmanager/QbsProjectManager.json.in +++ b/src/plugins/qbsprojectmanager/QbsProjectManager.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"QbsProjectManager\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "QbsProjectManager", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Build Systems\", - \"Description\" : \"QBS support.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Build Systems", + "Description" : "QBS support.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/qmakeprojectmanager/QmakeProjectManager.json.in b/src/plugins/qmakeprojectmanager/QmakeProjectManager.json.in index db4ebc7edc3..a080d69dece 100644 --- a/src/plugins/qmakeprojectmanager/QmakeProjectManager.json.in +++ b/src/plugins/qmakeprojectmanager/QmakeProjectManager.json.in @@ -1,55 +1,55 @@ { - \"Name\" : \"QmakeProjectManager\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "QmakeProjectManager", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Build Systems\", - \"Description\" : \"Provides project type for Qt/QMake .pro files and tools.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Build Systems", + "Description" : "Provides project type for Qt/QMake .pro files and tools.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'application/vnd.qt.qmakeprofile\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Qt Project file</comment>\", - \" <glob pattern=\'*.pro\'/>\", - \" </mime-type>\", - \" <mime-type type=\'application/vnd.qt.qmakeproincludefile\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Qt Project include file</comment>\", - \" <glob pattern=\'*.pri\'/>\", - \" </mime-type>\", - \" <mime-type type=\'application/vnd.qt.qmakeprofeaturefile\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Qt Project feature file</comment>\", - \" <glob pattern=\'*.prf\'/>\", - \" </mime-type>\", - \" <mime-type type=\'application/vnd.qt.qmakeproconfigurationfile\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Qt Project configuration file</comment>\", - \" <glob pattern=\'.qmake.conf\'/>\", - \" </mime-type>\", - \" <mime-type type=\'application/vnd.qt.qmakeprocachefile\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Qt Project cache file</comment>\", - \" <glob pattern=\'.qmake.cache\'/>\", - \" </mime-type>\", - \" <mime-type type=\'application/vnd.qt.qmakeprostashfile\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Qt Project stash file</comment>\", - \" <glob pattern=\'.qmake.stash\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='application/vnd.qt.qmakeprofile'>", + " <sub-class-of type='text/plain'/>", + " <comment>Qt Project file</comment>", + " <glob pattern='*.pro'/>", + " </mime-type>", + " <mime-type type='application/vnd.qt.qmakeproincludefile'>", + " <sub-class-of type='text/plain'/>", + " <comment>Qt Project include file</comment>", + " <glob pattern='*.pri'/>", + " </mime-type>", + " <mime-type type='application/vnd.qt.qmakeprofeaturefile'>", + " <sub-class-of type='text/plain'/>", + " <comment>Qt Project feature file</comment>", + " <glob pattern='*.prf'/>", + " </mime-type>", + " <mime-type type='application/vnd.qt.qmakeproconfigurationfile'>", + " <sub-class-of type='text/plain'/>", + " <comment>Qt Project configuration file</comment>", + " <glob pattern='.qmake.conf'/>", + " </mime-type>", + " <mime-type type='application/vnd.qt.qmakeprocachefile'>", + " <sub-class-of type='text/plain'/>", + " <comment>Qt Project cache file</comment>", + " <glob pattern='.qmake.cache'/>", + " </mime-type>", + " <mime-type type='application/vnd.qt.qmakeprostashfile'>", + " <sub-class-of type='text/plain'/>", + " <comment>Qt Project stash file</comment>", + " <glob pattern='.qmake.stash'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/qmldesigner/QmlDesigner.json.in b/src/plugins/qmldesigner/QmlDesigner.json.in index 9770f14a2c4..3dea4ee8885 100644 --- a/src/plugins/qmldesigner/QmlDesigner.json.in +++ b/src/plugins/qmldesigner/QmlDesigner.json.in @@ -1,27 +1,27 @@ { - \"Name\" : \"QmlDesigner\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "QmlDesigner", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Qt Quick\", - \"Description\" : \"Visual Designer for QML files.\", - \"DisabledByDefault\" : true, - \"Url\" : \"http://www.qt.io\", - \"Arguments\" : [ + "Category" : "Qt Quick", + "Description" : "Visual Designer for QML files.", + "DisabledByDefault" : true, + "Url" : "http://www.qt.io", + "Arguments" : [ { - \"Name\" : \"-capture-puppet-stream\", - \"Parameter\" : \"capture file\", - \"Description\" : \"Captures the Qml Puppet stream\" + "Name" : "-capture-puppet-stream", + "Parameter" : "capture file", + "Description" : "Captures the Qml Puppet stream" } ], - $$dependencyList + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/qmldesignerbase/QmlDesignerBase.json.in b/src/plugins/qmldesignerbase/QmlDesignerBase.json.in index 38fb427ae1b..27c62aeef64 100644 --- a/src/plugins/qmldesignerbase/QmlDesignerBase.json.in +++ b/src/plugins/qmldesignerbase/QmlDesignerBase.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"QmlDesignerBase\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "QmlDesignerBase", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Qt Quick\", - \"Description\" : \"Provides support code for the qml designer and co..\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Qt Quick", + "Description" : "Provides support code for the qml designer and co..", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/qmljseditor/QmlJSEditor.json.in b/src/plugins/qmljseditor/QmlJSEditor.json.in index 774031be3f3..c05d4efa808 100644 --- a/src/plugins/qmljseditor/QmlJSEditor.json.in +++ b/src/plugins/qmljseditor/QmlJSEditor.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"QmlJSEditor\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "QmlJSEditor", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Qt Quick\", - \"Description\" : \"Editor for QML and JavaScript.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Qt Quick", + "Description" : "Editor for QML and JavaScript.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/qmljstools/QmlJSTools.json.in b/src/plugins/qmljstools/QmlJSTools.json.in index ecc5f1e856a..0edfb8a7bf4 100644 --- a/src/plugins/qmljstools/QmlJSTools.json.in +++ b/src/plugins/qmljstools/QmlJSTools.json.in @@ -1,73 +1,73 @@ { - \"Name\" : \"QmlJSTools\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "QmlJSTools", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Qt Quick\", - \"Description\" : \"Tools for analyzing Qml/JS code.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Qt Quick", + "Description" : "Tools for analyzing Qml/JS code.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/x-qml\'>\", - \" <alias type=\'application/x-qml\'/>\", - \" <!-- sub class is missing in the freedesktop.org definition -->\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>QML file</comment>\", - \" <glob pattern=\'*.qml\' weight=\'70\'/>\", - \" </mime-type>\", - \" <mime-type type=\'application/x-qt.qbs+qml\'>\", - \" <alias type=\'text/x-qt.qbs+qml\'/>\", - \" <sub-class-of type=\'text/x-qml\'/>\", - \" <comment>Qt Build Suite file</comment>\", - \" <glob pattern=\'*.qbs\' weight=\'70\'/>\", - \" </mime-type>\", - \" <mime-type type=\'application/x-qt.ui+qml\'>\", - \" <alias type=\'text/x-qt.ui+qml\'/>\", - \" <sub-class-of type=\'text/x-qml\'/>\", - \" <comment>QtQuick Designer ui file</comment>\", - \" <glob pattern=\'*.ui.qml\' weight=\'70\'/>\", - \" </mime-type>\", - \" <mime-type type=\'application/x-qmlproject\'>\", - \" <alias type=\'text/x-qmlproject\'/>\", - \" <sub-class-of type=\'text/x-qml\'/>\", - \" <comment>Qt Creator Qt UI project file</comment>\", - \" <glob pattern=\'*.qmlproject\' weight=\'70\'/>\", - \" </mime-type>\", - \" <mime-type type=\'application/x-qt.meta-info+qml\'>\", - \" <alias type=\'text/x-qt.meta-info+qml\'/>\", - \" <sub-class-of type=\'text/x-qml\'/>\", - \" <comment>QML file</comment>\", - \" <glob pattern=\'*.qmltypes\' weight=\'70\'/>\", - \" </mime-type>\", - \" <mime-type type=\'application/json\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>JSON file</comment>\", - \" <glob pattern=\'*.json\' weight=\'70\'/>\", - \" </mime-type>\", - \" <mime-type type=\'application/x-javascript-module\'>\", - \" <sub-class-of type=\'application/javascript\'/>\", - \" <comment>Javascript module</comment>\", - \" <glob pattern=\'*.mjs\' weight=\'70\'/>\", - \" </mime-type>\", - \" <mime-type type=\'text/x-qtscript\'>\", - \" <alias type=\'application/x-qtscript\'/>\", - \" <sub-class-of type=\'application/javascript\'/>\", - \" <comment>Qt Script file</comment>\", - \" <glob pattern=\'*.qs\' weight=\'70\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/x-qml'>", + " <alias type='application/x-qml'/>", + " <!-- sub class is missing in the freedesktop.org definition -->", + " <sub-class-of type='text/plain'/>", + " <comment>QML file</comment>", + " <glob pattern='*.qml' weight='70'/>", + " </mime-type>", + " <mime-type type='application/x-qt.qbs+qml'>", + " <alias type='text/x-qt.qbs+qml'/>", + " <sub-class-of type='text/x-qml'/>", + " <comment>Qt Build Suite file</comment>", + " <glob pattern='*.qbs' weight='70'/>", + " </mime-type>", + " <mime-type type='application/x-qt.ui+qml'>", + " <alias type='text/x-qt.ui+qml'/>", + " <sub-class-of type='text/x-qml'/>", + " <comment>QtQuick Designer ui file</comment>", + " <glob pattern='*.ui.qml' weight='70'/>", + " </mime-type>", + " <mime-type type='application/x-qmlproject'>", + " <alias type='text/x-qmlproject'/>", + " <sub-class-of type='text/x-qml'/>", + " <comment>Qt Creator Qt UI project file</comment>", + " <glob pattern='*.qmlproject' weight='70'/>", + " </mime-type>", + " <mime-type type='application/x-qt.meta-info+qml'>", + " <alias type='text/x-qt.meta-info+qml'/>", + " <sub-class-of type='text/x-qml'/>", + " <comment>QML file</comment>", + " <glob pattern='*.qmltypes' weight='70'/>", + " </mime-type>", + " <mime-type type='application/json'>", + " <sub-class-of type='text/plain'/>", + " <comment>JSON file</comment>", + " <glob pattern='*.json' weight='70'/>", + " </mime-type>", + " <mime-type type='application/x-javascript-module'>", + " <sub-class-of type='application/javascript'/>", + " <comment>Javascript module</comment>", + " <glob pattern='*.mjs' weight='70'/>", + " </mime-type>", + " <mime-type type='text/x-qtscript'>", + " <alias type='application/x-qtscript'/>", + " <sub-class-of type='application/javascript'/>", + " <comment>Qt Script file</comment>", + " <glob pattern='*.qs' weight='70'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/qmlpreview/QmlPreview.json.in b/src/plugins/qmlpreview/QmlPreview.json.in index 8a9ce6f6ec9..d053c4040ba 100644 --- a/src/plugins/qmlpreview/QmlPreview.json.in +++ b/src/plugins/qmlpreview/QmlPreview.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"QmlPreview\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "QmlPreview", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Qt Quick\", - \"Description\" : \"Qml Preview Plugin.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Qt Quick", + "Description" : "Qml Preview Plugin.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/qmlprofiler/QmlProfiler.json.in b/src/plugins/qmlprofiler/QmlProfiler.json.in index 31089e8cc36..45fdb6e8fff 100644 --- a/src/plugins/qmlprofiler/QmlProfiler.json.in +++ b/src/plugins/qmlprofiler/QmlProfiler.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"QmlProfiler\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "QmlProfiler", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Qt Quick\", - \"Description\" : \"Qml Profiler Plugin.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Qt Quick", + "Description" : "Qml Profiler Plugin.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/qmlprojectmanager/QmlProjectManager.json.in b/src/plugins/qmlprojectmanager/QmlProjectManager.json.in index 11e400284a7..5df33015f48 100644 --- a/src/plugins/qmlprojectmanager/QmlProjectManager.json.in +++ b/src/plugins/qmlprojectmanager/QmlProjectManager.json.in @@ -1,31 +1,31 @@ { - \"Name\" : \"QmlProjectManager\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "QmlProjectManager", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Qt Quick\", - \"Description\" : \"Qt Quick support\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Qt Quick", + "Description" : "Qt Quick support", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", + "Mimetypes" : [ + "<?xml version='1.0'?>", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'application/x-qmlproject\'>\", - \" <sub-class-of type=\'text/x-qml\'/>\", - \" <comment>QML Project file</comment>\", - \" <glob pattern=\'*.qmlproject\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='application/x-qmlproject'>", + " <sub-class-of type='text/x-qml'/>", + " <comment>QML Project file</comment>", + " <glob pattern='*.qmlproject'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/qnx/Qnx.json.in b/src/plugins/qnx/Qnx.json.in index 005f669c41c..0340d3b7dc1 100644 --- a/src/plugins/qnx/Qnx.json.in +++ b/src/plugins/qnx/Qnx.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"Qnx\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"BlackBerry\", - \"Copyright\" : \"(C) 2017 BlackBerry, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Qnx", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "BlackBerry", + "Copyright" : "(C) 2017 BlackBerry, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Device Support\", - \"Description\" : \"Adds support for QNX to Qt Creator.\", - \"Url\" : \"http://www.blackberry.com\", - $$dependencyList + "Category" : "Device Support", + "Description" : "Adds support for QNX to Qt Creator.", + "Url" : "http://www.blackberry.com", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/qtsupport/QtSupport.json.in b/src/plugins/qtsupport/QtSupport.json.in index fcfa515688d..0a39a762ce1 100644 --- a/src/plugins/qtsupport/QtSupport.json.in +++ b/src/plugins/qtsupport/QtSupport.json.in @@ -1,34 +1,34 @@ { - \"Name\" : \"QtSupport\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "QtSupport", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Build Systems\", - \"Description\" : \"Provides support code for build systems.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Build Systems", + "Description" : "Provides support code for build systems.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'application/x-linguist-translation\'>\", - \" <comment>Linguist compiled translations</comment>\", - \" <glob pattern=\'*.qm\'/>\", - \" </mime-type>\", - \" <mime-type type=\'application/scxml+xml\'>\", - \" <comment>SCXML State Chart</comment>\", - \" <sub-class-of type=\'application/xml\'/>\", - \" <glob pattern=\'*.scxml\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='application/x-linguist-translation'>", + " <comment>Linguist compiled translations</comment>", + " <glob pattern='*.qm'/>", + " </mime-type>", + " <mime-type type='application/scxml+xml'>", + " <comment>SCXML State Chart</comment>", + " <sub-class-of type='application/xml'/>", + " <glob pattern='*.scxml'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/remotelinux/RemoteLinux.json.in b/src/plugins/remotelinux/RemoteLinux.json.in index a5cfc60645b..2345b5acab3 100644 --- a/src/plugins/remotelinux/RemoteLinux.json.in +++ b/src/plugins/remotelinux/RemoteLinux.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"RemoteLinux\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "RemoteLinux", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Device Support\", - \"Description\" : \"Support for deployment to and execution on a remote Linux host.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Device Support", + "Description" : "Support for deployment to and execution on a remote Linux host.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/resourceeditor/ResourceEditor.json.in b/src/plugins/resourceeditor/ResourceEditor.json.in index 3eb667334d1..be3ace268a7 100644 --- a/src/plugins/resourceeditor/ResourceEditor.json.in +++ b/src/plugins/resourceeditor/ResourceEditor.json.in @@ -1,30 +1,30 @@ { - \"Name\" : \"ResourceEditor\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "ResourceEditor", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Qt Creator\", - \"Description\" : \"Editor for qrc files.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Qt Creator", + "Description" : "Editor for qrc files.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'application/vnd.qt.xml.resource\'>\", - \" <sub-class-of type=\'text/xml\'/>\", - \" <comment>Qt Resource file</comment>\", - \" <glob pattern=\'*.qrc\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='application/vnd.qt.xml.resource'>", + " <sub-class-of type='text/xml'/>", + " <comment>Qt Resource file</comment>", + " <glob pattern='*.qrc'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/saferenderer/SafeRenderer.json.in b/src/plugins/saferenderer/SafeRenderer.json.in index c8a6e3ee795..ae60bb3f020 100644 --- a/src/plugins/saferenderer/SafeRenderer.json.in +++ b/src/plugins/saferenderer/SafeRenderer.json.in @@ -1,20 +1,20 @@ { - \"Name\" : \"SafeRenderer\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "SafeRenderer", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Device Support\", - \"Description\" : \"Helper plugin for Qt Safe Renderer projects.\", - \"Url\" : \"https://www.qt.io\", - $$dependencyList + "Category" : "Device Support", + "Description" : "Helper plugin for Qt Safe Renderer projects.", + "Url" : "https://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/scxmleditor/ScxmlEditor.json.in b/src/plugins/scxmleditor/ScxmlEditor.json.in index 34c9d4ea2b3..3b4351f78b1 100644 --- a/src/plugins/scxmleditor/ScxmlEditor.json.in +++ b/src/plugins/scxmleditor/ScxmlEditor.json.in @@ -1,30 +1,30 @@ { - \"Name\" : \"ScxmlEditor\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "ScxmlEditor", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Modeling\", - \"Description\" : \"Visual Editor for SCXML (State Chart XML) files.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Modeling", + "Description" : "Visual Editor for SCXML (State Chart XML) files.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'application/scxml+xml\'>\", - \" <sub-class-of type=\'text/xml\'/>\", - \" <comment>SCXML file</comment>\", - \" <glob pattern=\'*.scxml\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='application/scxml+xml'>", + " <sub-class-of type='text/xml'/>", + " <comment>SCXML file</comment>", + " <glob pattern='*.scxml'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/serialterminal/SerialTerminal.json.in b/src/plugins/serialterminal/SerialTerminal.json.in index efff034b32a..78ac127ab4d 100644 --- a/src/plugins/serialterminal/SerialTerminal.json.in +++ b/src/plugins/serialterminal/SerialTerminal.json.in @@ -1,20 +1,20 @@ { - \"Name\" : \"SerialTerminal\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"Benjamin Balga\", - \"Experimental\" : true, - \"DisabledByDefault\" : true, - \"Copyright\" : \"(C) 2018 Benjamin Balga\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "SerialTerminal", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "Benjamin Balga", + "Experimental" : true, + "DisabledByDefault" : true, + "Copyright" : "(C) 2018 Benjamin Balga", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Serial Port Terminal\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "Serial Port Terminal", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/silversearcher/SilverSearcher.json.in b/src/plugins/silversearcher/SilverSearcher.json.in index a60ade39c20..bfaf5536359 100644 --- a/src/plugins/silversearcher/SilverSearcher.json.in +++ b/src/plugins/silversearcher/SilverSearcher.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"SilverSearcher\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Experimental\" : true, - \"Vendor\" : \"Przemyslaw Gorszkowski\", - \"Copyright\" : \"(C) 2017 Przemyslaw Gorszkowski, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "SilverSearcher", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Experimental" : true, + "Vendor" : "Przemyslaw Gorszkowski", + "Copyright" : "(C) 2017 Przemyslaw Gorszkowski, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Adds possibility to use SilverSearcher tool as an alternative mechanism of 'find in files'\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "Adds possibility to use SilverSearcher tool as an alternative mechanism of 'find in files'", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/squish/Squish.json.in b/src/plugins/squish/Squish.json.in index 9f32eb46d8c..64e4397aeb3 100644 --- a/src/plugins/squish/Squish.json.in +++ b/src/plugins/squish/Squish.json.in @@ -1,30 +1,30 @@ { -\"Name\" : \"Squish\", -\"Version\" : \"$$QTCREATOR_VERSION\", -\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", -\"Experimental\" : true, -\"Vendor\" : \"The Qt Company Ltd\", -\"Copyright\" : \"(C) 2022 The Qt Company Ltd\", -\"License\" : [ \"Commercial Usage\", -\"\", -\"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", -\"\", -\"GNU General Public License Usage\", -\"\", -\"Alternatively, this file may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this file. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" +"Name" : "Squish", +"Version" : "${IDE_VERSION}", +"CompatVersion" : "${IDE_VERSION_COMPAT}", +"Experimental" : true, +"Vendor" : "The Qt Company Ltd", +"Copyright" : "(C) 2022 The Qt Company Ltd", +"License" : [ "Commercial Usage", +"", +"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", +"", +"GNU General Public License Usage", +"", +"Alternatively, this file may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this file. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], -\"Description\" : \"Squish plugin. Provides integration of Squish.\", -\"Url\" : \"http://www.qt.io\", -$$dependencyList, +"Description" : "Squish plugin. Provides integration of Squish.", +"Url" : "http://www.qt.io", +${IDE_PLUGIN_DEPENDENCIES}, -\"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/squish-objectsmap\'>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" <comment>Squish objects.map File</comment>\", - \" <glob pattern=\'objects.map\'/>\", - \" </mime-type>\", - \"</mime-info>\" +"Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/squish-objectsmap'>", + " <sub-class-of type='text/plain'/>", + " <comment>Squish objects.map File</comment>", + " <glob pattern='objects.map'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/studiowelcome/StudioWelcome.json.in b/src/plugins/studiowelcome/StudioWelcome.json.in index 94e7e2e2bea..9ee3c251721 100644 --- a/src/plugins/studiowelcome/StudioWelcome.json.in +++ b/src/plugins/studiowelcome/StudioWelcome.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"StudioWelcome\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "StudioWelcome", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Qt Design Studio Welcome Page.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "Qt Design Studio Welcome Page.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/subversion/Subversion.json.in b/src/plugins/subversion/Subversion.json.in index 86ef4349b6d..604ba2648a9 100644 --- a/src/plugins/subversion/Subversion.json.in +++ b/src/plugins/subversion/Subversion.json.in @@ -1,29 +1,29 @@ { - \"Name\" : \"Subversion\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Subversion", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Version Control\", - \"Description\" : \"Subversion integration.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Category" : "Version Control", + "Description" : "Subversion integration.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'text/vnd.qtcreator.svn.submit\'>\", - \" <comment>Subversion submit template</comment>\", - \" <sub-class-of type=\'text/plain\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='text/vnd.qtcreator.svn.submit'>", + " <comment>Subversion submit template</comment>", + " <sub-class-of type='text/plain'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/terminal/Terminal.json.in b/src/plugins/terminal/Terminal.json.in index 5640012c081..8c631dd6519 100644 --- a/src/plugins/terminal/Terminal.json.in +++ b/src/plugins/terminal/Terminal.json.in @@ -1,18 +1,18 @@ { - \"Name\" : \"Terminal\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Terminal", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Terminal window.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "Terminal window.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/texteditor/TextEditor.json.in b/src/plugins/texteditor/TextEditor.json.in index a2aefaf146f..5fbf3e3067b 100644 --- a/src/plugins/texteditor/TextEditor.json.in +++ b/src/plugins/texteditor/TextEditor.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"TextEditor\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "TextEditor", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Core\", - \"Description\" : \"Text editor framework and the implementation of the basic text editor.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Core", + "Description" : "Text editor framework and the implementation of the basic text editor.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/todo/Todo.json.in b/src/plugins/todo/Todo.json.in index 5bc157f3722..2b6227492e8 100644 --- a/src/plugins/todo/Todo.json.in +++ b/src/plugins/todo/Todo.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"Todo\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Experimental\" : true, - \"Vendor\" : \"Dmitry Savchenko\", - \"Copyright\" : \"(C) 2016 Dmitry Savchenko, Vasiliy Sorokin, (C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Todo", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Experimental" : true, + "Vendor" : "Dmitry Savchenko", + "Copyright" : "(C) 2016 Dmitry Savchenko, Vasiliy Sorokin, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Adds pane that lists all TODO, FIXME, etc. entries in comments.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "Adds pane that lists all TODO, FIXME, etc. entries in comments.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/updateinfo/UpdateInfo.json.in b/src/plugins/updateinfo/UpdateInfo.json.in index f2f060d44a7..b7f15e449ba 100644 --- a/src/plugins/updateinfo/UpdateInfo.json.in +++ b/src/plugins/updateinfo/UpdateInfo.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"UpdateInfo\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"DisabledByDefault\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "UpdateInfo", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Description\" : \"Displays Update-Infos for Qt Installer Framework-based Updaters.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Description" : "Displays Update-Infos for Qt Installer Framework-based Updaters.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/valgrind/Valgrind.json.in b/src/plugins/valgrind/Valgrind.json.in index 23b822f2422..1f270b12184 100644 --- a/src/plugins/valgrind/Valgrind.json.in +++ b/src/plugins/valgrind/Valgrind.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"Valgrind\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Valgrind", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Code Analyzer\", - \"Description\" : \"Valgrind Plugin.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Code Analyzer", + "Description" : "Valgrind Plugin.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/vcpkg/Vcpkg.json.in b/src/plugins/vcpkg/Vcpkg.json.in index 7357c9e845b..f3ab4f0a5d7 100644 --- a/src/plugins/vcpkg/Vcpkg.json.in +++ b/src/plugins/vcpkg/Vcpkg.json.in @@ -1,30 +1,30 @@ { - \"Name\" : \"Vcpkg\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Vcpkg", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Experimental\" : true, - \"Description\" : \"vcpkg integration.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList, + "Experimental" : true, + "Description" : "vcpkg integration.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES}, - \"Mimetypes\" : [ - \"<?xml version=\'1.0\' encoding=\'UTF-8\'?>\", - \"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\", - \" <mime-type type=\'application/vcpkg.manifest+json\'>\", - \" <sub-class-of type=\'application/json\'/>\", - \" <comment>Vcpkg Manifest File</comment>\", - \" <glob pattern=\'vcpkg.json\' weight=\'71\'/>\", - \" </mime-type>\", - \"</mime-info>\" + "Mimetypes" : [ + "<?xml version='1.0' encoding='UTF-8'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='application/vcpkg.manifest+json'>", + " <sub-class-of type='application/json'/>", + " <comment>Vcpkg Manifest File</comment>", + " <glob pattern='vcpkg.json' weight='71'/>", + " </mime-type>", + "</mime-info>" ] } diff --git a/src/plugins/vcsbase/VcsBase.json.in b/src/plugins/vcsbase/VcsBase.json.in index 3167b8d0c20..87e343ff45f 100644 --- a/src/plugins/vcsbase/VcsBase.json.in +++ b/src/plugins/vcsbase/VcsBase.json.in @@ -1,19 +1,19 @@ { - \"Name\" : \"VcsBase\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "VcsBase", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Version Control\", - \"Description\" : \"Version Control System Base Plugin.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Version Control", + "Description" : "Version Control System Base Plugin.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/webassembly/WebAssembly.json.in b/src/plugins/webassembly/WebAssembly.json.in index 6245d74456e..f860568cee9 100644 --- a/src/plugins/webassembly/WebAssembly.json.in +++ b/src/plugins/webassembly/WebAssembly.json.in @@ -1,21 +1,21 @@ { - \"Name\" : \"WebAssembly\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Experimental\" : true, - \"DisabledByDefault\" : true, - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "WebAssembly", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Experimental" : true, + "DisabledByDefault" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Device Support\", - \"Description\" : \"Helper for WebAssembly projects.\", - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Category" : "Device Support", + "Description" : "Helper for WebAssembly projects.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/welcome/Welcome.json.in b/src/plugins/welcome/Welcome.json.in index 8cdf438151d..40f7e1ee3ff 100644 --- a/src/plugins/welcome/Welcome.json.in +++ b/src/plugins/welcome/Welcome.json.in @@ -1,25 +1,25 @@ { - \"Name\" : \"Welcome\", - \"Version\" : \"$$QTCREATOR_VERSION\", - \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", - \"Vendor\" : \"The Qt Company Ltd\", - \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", - \"License\" : [ \"Commercial Usage\", - \"\", - \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", - \"\", - \"GNU General Public License Usage\", - \"\", - \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + "Name" : "Welcome", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - \"Category\" : \"Core\", - \"Description\" : \"Secondary Welcome Screen Plugin.\", - \"Arguments\" : [ + "Category" : "Core", + "Description" : "Secondary Welcome Screen Plugin.", + "Arguments" : [ { - \"Name\" : \"-notour\", - \"Description\" : \"Do not ask for taking a UI tour on startup\" + "Name" : "-notour", + "Description" : "Do not ask for taking a UI tour on startup" } ], - \"Url\" : \"http://www.qt.io\", - $$dependencyList + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} } From cecf9c9136d3fdec135840a66e7fc256b63f8121 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 25 Jul 2023 13:07:40 +0200 Subject: [PATCH 0486/1777] Valgrind: Collapse project and global settings classes Change-Id: I41b157bb07a451851641c7a5785334bd28036f45 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/valgrind/callgrindtool.cpp | 2 +- src/plugins/valgrind/memcheckerrorview.cpp | 2 +- src/plugins/valgrind/memcheckerrorview.h | 8 +- src/plugins/valgrind/memchecktool.cpp | 14 +-- src/plugins/valgrind/valgrindengine.cpp | 8 +- src/plugins/valgrind/valgrindengine.h | 2 +- src/plugins/valgrind/valgrindplugin.cpp | 2 +- src/plugins/valgrind/valgrindsettings.cpp | 107 +++++++++------------ src/plugins/valgrind/valgrindsettings.h | 69 +++---------- 9 files changed, 78 insertions(+), 136 deletions(-) diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 85ad9a76f08..6062b95ea40 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -742,7 +742,7 @@ void CallgrindToolPrivate::setupRunner(CallgrindToolRunner *toolRunner) QTC_ASSERT(m_visualization, return); // apply project settings - ValgrindProjectSettings settings; + ValgrindSettings settings{false}; settings.fromMap(runControl->settingsData(ANALYZER_VALGRIND_SETTINGS)); m_visualization->setMinimumInclusiveCostRatio(settings.visualizationMinimumInclusiveCostRatio() / 100.0); m_proxyModel.setMinimumInclusiveCostRatio(settings.minimumInclusiveCostRatio() / 100.0); diff --git a/src/plugins/valgrind/memcheckerrorview.cpp b/src/plugins/valgrind/memcheckerrorview.cpp index 8977a950074..ef6ab2856e1 100644 --- a/src/plugins/valgrind/memcheckerrorview.cpp +++ b/src/plugins/valgrind/memcheckerrorview.cpp @@ -86,7 +86,7 @@ FilePath MemcheckErrorView::defaultSuppressionFile() const // slot, can (for now) be invoked either when the settings were modified *or* when the active // settings object has changed. -void MemcheckErrorView::settingsChanged(ValgrindBaseSettings *settings) +void MemcheckErrorView::settingsChanged(ValgrindSettings *settings) { QTC_ASSERT(settings, return); m_settings = settings; diff --git a/src/plugins/valgrind/memcheckerrorview.h b/src/plugins/valgrind/memcheckerrorview.h index 8de9400d851..dbf7650e11f 100644 --- a/src/plugins/valgrind/memcheckerrorview.h +++ b/src/plugins/valgrind/memcheckerrorview.h @@ -12,7 +12,7 @@ namespace Valgrind { namespace Internal { -class ValgrindBaseSettings; +class ValgrindSettings; class MemcheckErrorView : public Debugger::DetailedErrorView { @@ -22,8 +22,8 @@ public: void setDefaultSuppressionFile(const Utils::FilePath &suppFile); Utils::FilePath defaultSuppressionFile() const; - ValgrindBaseSettings *settings() const { return m_settings; } - void settingsChanged(ValgrindBaseSettings *settings); + ValgrindSettings *settings() const { return m_settings; } + void settingsChanged(ValgrindSettings *settings); private: void suppressError(); @@ -31,7 +31,7 @@ private: QAction *m_suppressAction; Utils::FilePath m_defaultSuppFile; - ValgrindBaseSettings *m_settings = nullptr; + ValgrindSettings *m_settings = nullptr; }; } // namespace Internal diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 39a091b58f1..70bc01f7e7c 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -193,13 +193,13 @@ void MemcheckToolRunner::addToolArguments(CommandLine &cmd) const QString leakCheckValue; switch (m_settings.leakCheckOnFinish()) { - case ValgrindBaseSettings::LeakCheckOnFinishNo: + case ValgrindSettings::LeakCheckOnFinishNo: leakCheckValue = "no"; break; - case ValgrindBaseSettings::LeakCheckOnFinishYes: + case ValgrindSettings::LeakCheckOnFinishYes: leakCheckValue = "full"; break; - case ValgrindBaseSettings::LeakCheckOnFinishSummaryOnly: + case ValgrindSettings::LeakCheckOnFinishSummaryOnly: default: leakCheckValue = "summary"; break; @@ -420,7 +420,7 @@ private: void heobAction(); private: - ValgrindBaseSettings *m_settings; + ValgrindSettings *m_settings; QMenu *m_filterMenu = nullptr; Valgrind::XmlProtocol::ErrorListModel m_errorModel; @@ -941,11 +941,11 @@ void MemcheckToolPrivate::maybeActiveRunConfigurationChanged() { updateRunActions(); - ValgrindBaseSettings *settings = nullptr; + ValgrindSettings *settings = nullptr; if (Project *project = ProjectManager::startupProject()) if (Target *target = project->activeTarget()) if (RunConfiguration *rc = target->activeRunConfiguration()) - settings = rc->currentSettings<ValgrindBaseSettings>(ANALYZER_VALGRIND_SETTINGS); + settings = rc->currentSettings<ValgrindSettings>(ANALYZER_VALGRIND_SETTINGS); if (!settings) // fallback to global settings settings = &globalSettings(); @@ -962,7 +962,7 @@ void MemcheckToolPrivate::maybeActiveRunConfigurationChanged() // now make the new settings current, update and connect input widgets m_settings = settings; QTC_ASSERT(m_settings, return); - connect(m_settings, &ValgrindBaseSettings::destroyed, + connect(m_settings, &ValgrindSettings::destroyed, this, &MemcheckToolPrivate::settingsDestroyed); updateFromSettings(); diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index aab377fc741..fdbf6eb87db 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -104,16 +104,16 @@ QStringList ValgrindToolRunner::genericToolArguments() const QString smcCheckValue; switch (m_settings.selfModifyingCodeDetection()) { - case ValgrindBaseSettings::DetectSmcNo: + case ValgrindSettings::DetectSmcNo: smcCheckValue = "none"; break; - case ValgrindBaseSettings::DetectSmcEverywhere: + case ValgrindSettings::DetectSmcEverywhere: smcCheckValue = "all"; break; - case ValgrindBaseSettings::DetectSmcEverywhereButFile: + case ValgrindSettings::DetectSmcEverywhereButFile: smcCheckValue = "all-non-file"; break; - case ValgrindBaseSettings::DetectSmcStackOnly: + case ValgrindSettings::DetectSmcStackOnly: default: smcCheckValue = "stack"; break; diff --git a/src/plugins/valgrind/valgrindengine.h b/src/plugins/valgrind/valgrindengine.h index d491c7a8476..d8c5a0ae690 100644 --- a/src/plugins/valgrind/valgrindengine.h +++ b/src/plugins/valgrind/valgrindengine.h @@ -24,7 +24,7 @@ protected: virtual QString progressTitle() const = 0; virtual void addToolArguments(Utils::CommandLine &cmd) const = 0; - ValgrindProjectSettings m_settings; + ValgrindSettings m_settings{false}; QFutureInterface<void> m_progress; ValgrindRunner m_runner; diff --git a/src/plugins/valgrind/valgrindplugin.cpp b/src/plugins/valgrind/valgrindplugin.cpp index 7005efd98ff..6840c3c0a1f 100644 --- a/src/plugins/valgrind/valgrindplugin.cpp +++ b/src/plugins/valgrind/valgrindplugin.cpp @@ -31,7 +31,7 @@ class ValgrindRunConfigurationAspect : public GlobalOrProjectAspect public: ValgrindRunConfigurationAspect(Target *) { - setProjectSettings(new ValgrindProjectSettings); + setProjectSettings(new ValgrindSettings(false)); setGlobalSettings(&globalSettings()); setId(ANALYZER_VALGRIND_SETTINGS); setDisplayName(Tr::tr("Valgrind Settings")); diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 702e0561eb0..b7353d0516d 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -182,9 +182,12 @@ void SuppressionAspect::bufferToGui() // ////////////////////////////////////////////////////////////////// -ValgrindBaseSettings::ValgrindBaseSettings(bool global) +ValgrindSettings::ValgrindSettings(bool global) : suppressions(this, global) { + setSettingsGroup("Analyzer"); + setAutoApply(false); + // Note that this is used twice, once for project settings in the .user files // and once for global settings in QtCreator.ini. This uses intentionally // the same key to facilitate copying using fromMap/toMap. @@ -250,6 +253,12 @@ ValgrindBaseSettings::ValgrindBaseSettings(bool global) numCallers.setDefaultValue(25); numCallers.setLabelText(Tr::tr("Backtrace frame count:")); + lastSuppressionDirectory.setSettingsKey(base + "LastSuppressionDirectory"); + lastSuppressionDirectory.setVisible(global); + + lastSuppressionHistory.setSettingsKey(base + "LastSuppressionHistory"); + lastSuppressionHistory.setVisible(global); + // Callgrind kcachegrindExecutable.setSettingsKey(base + "KCachegrindExecutable"); @@ -320,6 +329,24 @@ ValgrindBaseSettings::ValgrindBaseSettings(bool global) defaultErrorKinds << i; visibleErrorKinds.setDefaultValue(defaultErrorKinds); + detectCycles.setSettingsKey(base + "Callgrind.CycleDetection"); + detectCycles.setDefaultValue(true); + detectCycles.setLabelText("O"); // FIXME: Create a real icon + detectCycles.setToolTip(Tr::tr("Enable cycle detection to properly handle recursive " + "or circular function calls.")); + detectCycles.setVisible(global); + + costFormat.setSettingsKey(base + "Callgrind.CostFormat"); + costFormat.setDefaultValue(CostDelegate::FormatRelative); + costFormat.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + costFormat.setVisible(global); + + shortenTemplates.setSettingsKey(base + "Callgrind.ShortenTemplates"); + shortenTemplates.setDefaultValue(true); + shortenTemplates.setLabelText("<>"); // FIXME: Create a real icon + shortenTemplates.setToolTip(Tr::tr("Remove template parameter lists when displaying function names.")); + shortenTemplates.setVisible(global); + setLayouter([this] { using namespace Layouting; @@ -367,73 +394,28 @@ ValgrindBaseSettings::ValgrindBaseSettings(bool global) }; // clang-format on }); + + if (global) { + readSettings(); + } else { + // FIXME: Is this needed? + connect(this, &AspectContainer::fromMapFinished, [this] { + // FIXME: Update project page e.g. on "Restore Global", aspects + // there are 'autoapply', and Aspect::cancel() is normally part of + // the 'manual apply' machinery. + setAutoApply(false); + cancel(); + setAutoApply(true); + }); + } } - -////////////////////////////////////////////////////////////////// -// -// ValgrindGlobalSettings -// -////////////////////////////////////////////////////////////////// - -ValgrindGlobalSettings &globalSettings() +ValgrindSettings &globalSettings() { - static ValgrindGlobalSettings theSettings; + static ValgrindSettings theSettings{true}; return theSettings; } -ValgrindGlobalSettings::ValgrindGlobalSettings() - : ValgrindBaseSettings(true) -{ - const QString base = "Analyzer.Valgrind"; - - lastSuppressionDirectory.setSettingsKey(base + "LastSuppressionDirectory"); - - lastSuppressionHistory.setSettingsKey(base + "LastSuppressionHistory"); - - detectCycles.setSettingsKey(base + "Callgrind.CycleDetection"); - detectCycles.setDefaultValue(true); - detectCycles.setLabelText("O"); // FIXME: Create a real icon - detectCycles.setToolTip(Tr::tr("Enable cycle detection to properly handle recursive " - "or circular function calls.")); - - costFormat.setSettingsKey(base + "Callgrind.CostFormat"); - costFormat.setDefaultValue(CostDelegate::FormatRelative); - costFormat.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - - shortenTemplates.setSettingsKey(base + "Callgrind.ShortenTemplates"); - shortenTemplates.setDefaultValue(true); - shortenTemplates.setLabelText("<>"); // FIXME: Create a real icon - shortenTemplates.setToolTip(Tr::tr("Remove template parameter lists when displaying function names.")); - - setSettingsGroup("Analyzer"); - readSettings(); - setAutoApply(false); -} - -// -// Memcheck -// - -////////////////////////////////////////////////////////////////// -// -// ValgrindProjectSettings -// -////////////////////////////////////////////////////////////////// - -ValgrindProjectSettings::ValgrindProjectSettings() - : ValgrindBaseSettings(false) -{ - connect(this, &AspectContainer::fromMapFinished, [this] { - // FIXME: Update project page e.g. on "Restore Global", aspects - // there are 'autoapply', and Aspect::cancel() is normally part of - // the 'manual apply' machinery. - setAutoApply(false); - cancel(); - setAutoApply(true); - }); -} - // // ValgrindOptionsPage // @@ -454,5 +436,4 @@ public: const ValgrindOptionsPage settingsPage; - } // Valgrind::Internal diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index ca85a2d92f9..b9de99db05b 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -31,19 +31,20 @@ private: void bufferToGui() override; bool guiToBuffer() override; - friend class ValgrindBaseSettings; + friend class ValgrindSettings; SuppressionAspectPrivate *d = nullptr; }; /** * Valgrind settings shared for global and per-project. */ -class ValgrindBaseSettings : public Utils::AspectContainer +class ValgrindSettings : public Utils::AspectContainer { Q_OBJECT public: - explicit ValgrindBaseSettings(bool global); + // These exists once globally, and once per project + explicit ValgrindSettings(bool global); enum SelfModifyingCodeDetection { DetectSmcNo, @@ -58,20 +59,14 @@ public: LeakCheckOnFinishYes }; -/** - * Base valgrind settings - */ -public: + // Generic valgrind settings Utils::FilePathAspect valgrindExecutable{this}; Utils::StringAspect valgrindArguments{this}; Utils::SelectionAspect selfModifyingCodeDetection{this}; SuppressionAspect suppressions; -/** - * Base memcheck settings - */ -public: + // Memcheck Utils::StringAspect memcheckArguments{this}; Utils::IntegerAspect numCallers{this}; Utils::SelectionAspect leakCheckOnFinish{this}; @@ -80,12 +75,12 @@ public: Utils::BoolAspect filterExternalIssues{this}; Utils::IntegersAspect visibleErrorKinds{this}; + Utils::FilePathAspect lastSuppressionDirectory{this}; // Global only + Utils::StringAspect lastSuppressionHistory{this}; // Global only + void setVisibleErrorKinds(const QList<int> &); -/** - * Base callgrind settings - */ -public: + // Callgrind Utils::StringAspect callgrindArguments{this}; Utils::FilePathAspect kcachegrindExecutable{this}; @@ -96,46 +91,12 @@ public: Utils::BoolAspect enableEventToolTips{this}; Utils::DoubleAspect minimumInclusiveCostRatio{this}; Utils::DoubleAspect visualizationMinimumInclusiveCostRatio{this}; + + Utils::SelectionAspect costFormat{this}; // Global only + Utils::BoolAspect detectCycles{this}; // Global only + Utils::BoolAspect shortenTemplates{this}; // Global only }; -/** - * Global valgrind settings - */ -class ValgrindGlobalSettings : public ValgrindBaseSettings -{ - Q_OBJECT - -public: - ValgrindGlobalSettings(); - - /** - * Global memcheck settings - */ - - Utils::FilePathAspect lastSuppressionDirectory{this}; - Utils::StringAspect lastSuppressionHistory{this}; - - - /** - * Global callgrind settings - */ - Utils::SelectionAspect costFormat{this}; - Utils::BoolAspect detectCycles{this}; - Utils::BoolAspect shortenTemplates{this}; -}; - -ValgrindGlobalSettings &globalSettings(); - - -/** - * Per-project valgrind settings. - */ -class ValgrindProjectSettings : public ValgrindBaseSettings -{ - Q_OBJECT - -public: - ValgrindProjectSettings(); -}; +ValgrindSettings &globalSettings(); } // Valgrind::Internal From 8423d2b5e534d280140220f3cfb420c372c76e70 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 25 Jul 2023 12:54:45 +0200 Subject: [PATCH 0487/1777] CppEditor: Proliferate use of FilePath a bit Change-Id: I7e314d73a427bf40c10f3ca6c4c5804e31482f88 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/cplusplus/cppmodelmanagerbase.cpp | 17 ++++++++++------- src/libs/cplusplus/cppmodelmanagerbase.h | 8 +++++--- src/libs/qmljs/qmljsfindexportedcpptypes.cpp | 3 +-- src/plugins/cppeditor/cppeditordocument.cpp | 4 ++-- src/plugins/cppeditor/cppeditordocument.h | 2 +- src/plugins/cppeditor/cppmodelmanager.cpp | 4 ++-- src/plugins/cppeditor/cppmodelmanager.h | 4 ++-- 7 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/libs/cplusplus/cppmodelmanagerbase.cpp b/src/libs/cplusplus/cppmodelmanagerbase.cpp index cff9ef99e2c..410244ab96f 100644 --- a/src/libs/cplusplus/cppmodelmanagerbase.cpp +++ b/src/libs/cplusplus/cppmodelmanagerbase.cpp @@ -3,29 +3,32 @@ #include "cppmodelmanagerbase.h" +#include <utils/filepath.h> #include <utils/qtcassert.h> +using namespace Utils; + namespace CPlusPlus::CppModelManagerBase { static bool (*setExtraDiagnosticsCallback) - (const QString &, const QString &, const QList<Document::DiagnosticMessage> &) = nullptr; + (const FilePath &, const QString &, const QList<Document::DiagnosticMessage> &) = nullptr; static CPlusPlus::Snapshot (*snapshotCallback)() = nullptr; -bool trySetExtraDiagnostics(const QString &fileName, const QString &kind, +bool trySetExtraDiagnostics(const FilePath &filePath, const QString &kind, const QList<Document::DiagnosticMessage> &diagnostics) { if (!setExtraDiagnosticsCallback) return false; - return setExtraDiagnosticsCallback(fileName, kind, diagnostics); + return setExtraDiagnosticsCallback(filePath, kind, diagnostics); } -bool setExtraDiagnostics(const QString &fileName, const QString &kind, - const QList<Document::DiagnosticMessage> &diagnostics) +bool setExtraDiagnostics(const FilePath &filePath, const QString &kind, + const QList<Document::DiagnosticMessage> &diagnostics) { QTC_ASSERT(setExtraDiagnosticsCallback, return false); - return setExtraDiagnosticsCallback(fileName, kind, diagnostics); + return setExtraDiagnosticsCallback(filePath, kind, diagnostics); } Snapshot snapshot() @@ -42,7 +45,7 @@ bool hasSnapshots() // Installation void registerSetExtraDiagnosticsCallback( - bool (*callback)(const QString &, const QString &, const QList<Document::DiagnosticMessage> &)) + bool (*callback)(const FilePath &, const QString &, const QList<Document::DiagnosticMessage> &)) { QTC_ASSERT(callback, return); QTC_CHECK(!setExtraDiagnosticsCallback); // bark when used twice diff --git a/src/libs/cplusplus/cppmodelmanagerbase.h b/src/libs/cplusplus/cppmodelmanagerbase.h index 1a9e4c7db33..0a8e18e733f 100644 --- a/src/libs/cplusplus/cppmodelmanagerbase.h +++ b/src/libs/cplusplus/cppmodelmanagerbase.h @@ -5,13 +5,15 @@ #include <cplusplus/CppDocument.h> +namespace Utils { class FilePath; } + namespace CPlusPlus::CppModelManagerBase { CPLUSPLUS_EXPORT bool trySetExtraDiagnostics - (const QString &, const QString &, const QList<Document::DiagnosticMessage> &); + (const Utils::FilePath &filePath, const QString &, const QList<Document::DiagnosticMessage> &); CPLUSPLUS_EXPORT bool setSetExtraDiagnostics - (const QString &, const QString &, const QList<Document::DiagnosticMessage> &); + (const Utils::FilePath &, const QString &, const QList<Document::DiagnosticMessage> &); CPLUSPLUS_EXPORT bool hasSnapshots(); @@ -23,6 +25,6 @@ CPLUSPLUS_EXPORT CPlusPlus::Snapshot snapshot(); CPLUSPLUS_EXPORT void registerSnapshotCallback(CPlusPlus::Snapshot (*)(void)); CPLUSPLUS_EXPORT void registerSetExtraDiagnosticsCallback( - bool(*)(const QString &, const QString &, const QList<Document::DiagnosticMessage> &)); + bool(*)(const Utils::FilePath &, const QString &, const QList<Document::DiagnosticMessage> &)); } // CPlusPlus::CppModelManagerBase diff --git a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp index e3c5cb6fc76..6b2c10b21a8 100644 --- a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp +++ b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp @@ -842,8 +842,7 @@ QStringList FindExportedCppTypes::operator()(const CPlusPlus::Document::Ptr &doc FindExportsVisitor finder(document); finder(); static const QString kindKey = QLatin1String("QmlJSTools.ExportedQmlTypesDiagnostic"); - CppModelManagerBase::trySetExtraDiagnostics(document->filePath().toString(), kindKey, - finder.messages()); + CppModelManagerBase::trySetExtraDiagnostics(document->filePath(), kindKey, finder.messages()); // if nothing was found, done const QList<ContextProperty> contextPropertyDescriptions = finder.contextProperties(); diff --git a/src/plugins/cppeditor/cppeditordocument.cpp b/src/plugins/cppeditor/cppeditordocument.cpp index e03dc2b40fe..da9eaed9b87 100644 --- a/src/plugins/cppeditor/cppeditordocument.cpp +++ b/src/plugins/cppeditor/cppeditordocument.cpp @@ -479,9 +479,9 @@ bool CppEditorDocument::usesClangd() const return CppModelManager::usesClangd(this); } -void CppEditorDocument::onDiagnosticsChanged(const QString &fileName, const QString &kind) +void CppEditorDocument::onDiagnosticsChanged(const FilePath &fileName, const QString &kind) { - if (FilePath::fromString(fileName) != filePath()) + if (fileName != filePath()) return; TextMarks removedMarks = marks(); diff --git a/src/plugins/cppeditor/cppeditordocument.h b/src/plugins/cppeditor/cppeditordocument.h index 734c64b665f..7a0a8f43cc5 100644 --- a/src/plugins/cppeditor/cppeditordocument.h +++ b/src/plugins/cppeditor/cppeditordocument.h @@ -76,7 +76,7 @@ private: void onAboutToReload(); void onReloadFinished(); - void onDiagnosticsChanged(const QString &fileName, const QString &kind); + void onDiagnosticsChanged(const Utils::FilePath &fileName, const QString &kind); void reparseWithPreferredParseContext(const QString &id); diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index 3980f99ac89..c95567eb3b6 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -2079,12 +2079,12 @@ QThreadPool *CppModelManager::sharedThreadPool() return &d->m_threadPool; } -bool CppModelManager::setExtraDiagnostics(const QString &fileName, +bool CppModelManager::setExtraDiagnostics(const FilePath &filePath, const QString &kind, const QList<Document::DiagnosticMessage> &diagnostics) { d->m_diagnosticMessages = diagnostics; - emit m_instance->diagnosticsChanged(fileName, kind); + emit m_instance->diagnosticsChanged(filePath, kind); return true; } diff --git a/src/plugins/cppeditor/cppmodelmanager.h b/src/plugins/cppeditor/cppmodelmanager.h index 6f6dc7298e3..2e78042eb79 100644 --- a/src/plugins/cppeditor/cppmodelmanager.h +++ b/src/plugins/cppeditor/cppmodelmanager.h @@ -95,7 +95,7 @@ public: static QByteArray codeModelConfiguration(); static CppLocatorData *locatorData(); - static bool setExtraDiagnostics(const QString &fileName, + static bool setExtraDiagnostics(const Utils::FilePath &filePath, const QString &kind, const QList<Document::DiagnosticMessage> &diagnostics); @@ -268,7 +268,7 @@ signals: void abstractEditorSupportRemoved(const QString &filePath); void fallbackProjectPartUpdated(); - void diagnosticsChanged(const QString &fileName, const QString &kind); + void diagnosticsChanged(const Utils::FilePath &filePath, const QString &kind); public slots: static void updateModifiedSourceFiles(); From e87a131c37952c6c869e0e21f25e88bd515c6531 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 15 Jul 2023 08:28:14 +0200 Subject: [PATCH 0488/1777] QbsBuildStep: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: I508b7951f53f25f7cfd3e7f7e80086281cc7168e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../qbsbuildconfiguration.cpp | 4 - .../qbsprojectmanager/qbsbuildstep.cpp | 277 +++++++----------- src/plugins/qbsprojectmanager/qbsbuildstep.h | 54 +--- .../qbsprojectmanager/qbsinstallstep.cpp | 2 + 4 files changed, 107 insertions(+), 230 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index 476bd5b071f..ad7ce2e1719 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -138,10 +138,6 @@ QbsBuildConfiguration::QbsBuildConfiguration(Target *target, Utils::Id id) QbsBuildConfiguration::~QbsBuildConfiguration() { - for (BuildStep * const bs : buildSteps()->steps()) { - if (const auto qbs = qobject_cast<QbsBuildStep *>(bs)) - qbs->dropSession(); - } delete m_buildSystem; } diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 3dd11f505d7..3cae842280a 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -7,35 +7,29 @@ #include "qbsproject.h" #include "qbsprojectmanagerconstants.h" #include "qbsprojectmanagertr.h" +#include "qbsrequest.h" #include "qbssession.h" #include "qbssettings.h" -#include <coreplugin/icore.h> - #include <projectexplorer/buildsteplist.h> -#include <projectexplorer/kit.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorertr.h> #include <projectexplorer/target.h> #include <qtsupport/qtkitinformation.h> -#include <qtsupport/qtversionmanager.h> #include <utils/algorithm.h> -#include <utils/aspects.h> #include <utils/guard.h> #include <utils/layoutbuilder.h> #include <utils/macroexpander.h> #include <utils/outputformatter.h> #include <utils/pathchooser.h> -#include <utils/process.h> #include <utils/qtcassert.h> #include <utils/variablechooser.h> #include <QCheckBox> #include <QJsonArray> #include <QJsonObject> -#include <QLabel> #include <QThread> // -------------------------------------------------------------------- @@ -51,10 +45,43 @@ const char QBS_CLEAN_INSTALL_ROOT[] = "Qbs.CleanInstallRoot"; using namespace ProjectExplorer; using namespace QtSupport; +using namespace Tasking; using namespace Utils; -namespace QbsProjectManager { -namespace Internal { +namespace QbsProjectManager::Internal { + +class QbsParserTaskAdapter : public TaskAdapter<QPointer<QbsBuildSystem>> +{ +public: + ~QbsParserTaskAdapter() + { + QbsBuildSystem *buildSystem = *task(); + if (buildSystem && m_isRunning) + buildSystem->cancelParsing(); + } + void start() final + { + QbsBuildSystem *buildSystem = *task(); + if (!buildSystem) { + emit done(false); + return; + } + m_isRunning = true; + connect(buildSystem->target(), &Target::parsingFinished, this, [this](bool success) { + m_isRunning = false; + emit done(success); + }); + buildSystem->parseCurrentBuildConfiguration(); + } +private: + bool m_isRunning = false; +}; + +} // namespace QbsProjectManager::Internal + +TASKING_DECLARE_TASK(QbsParserTask, QbsProjectManager::Internal::QbsParserTaskAdapter); + +namespace QbsProjectManager::Internal { ArchitecturesAspect::ArchitecturesAspect(AspectContainer *container) : MultiSelectionAspect(container) @@ -244,16 +271,9 @@ QbsBuildStep::QbsBuildStep(BuildStepList *bsl, Id id) : setConfiguredArchitectures(selectedAbis.selectedArchitectures()); }); } -QbsBuildStep::~QbsBuildStep() -{ - doCancel(); - if (m_session) - m_session->disconnect(this); -} - bool QbsBuildStep::init() { - if (m_session) + if (!BuildStep::init()) return false; auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration()); @@ -274,27 +294,11 @@ void QbsBuildStep::setupOutputFormatter(OutputFormatter *formatter) BuildStep::setupOutputFormatter(formatter); } -void QbsBuildStep::doRun() -{ - // We need a pre-build parsing step in order not to lose project file changes done - // right before building (but before the delay has elapsed). - m_parsingAfterBuild = false; - parseProject(); -} - QWidget *QbsBuildStep::createConfigWidget() { return new QbsBuildStepConfigWidget(this); } -void QbsBuildStep::doCancel() -{ - if (m_parsingProject) - qbsBuildSystem()->cancelParsing(); - else if (m_session) - m_session->cancelCurrentJob(); -} - QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) const { QVariantMap config = m_qbsConfiguration; @@ -386,91 +390,6 @@ void QbsBuildStep::toMap(QVariantMap &map) const map.insert(QBS_CONFIG, m_qbsConfiguration); } -void QbsBuildStep::buildingDone(const ErrorInfo &error) -{ - m_session->disconnect(this); - m_session = nullptr; - m_lastWasSuccess = !error.hasError(); - for (const ErrorInfoItem &item : std::as_const(error.items)) { - createTaskAndOutput( - ProjectExplorer::Task::Error, - item.description, - item.filePath.toString(), - item.line); - } - - // Building can uncover additional target artifacts. - qbsBuildSystem()->updateAfterBuild(); - - // The reparsing, if it is necessary, has to be done before finished() is emitted, as - // otherwise a potential additional build step could conflict with the parsing step. - if (qbsBuildSystem()->parsingScheduled()) { - m_parsingAfterBuild = true; - parseProject(); - } else { - finish(); - } -} - -void QbsBuildStep::reparsingDone(bool success) -{ - disconnect(target(), &Target::parsingFinished, this, &QbsBuildStep::reparsingDone); - m_parsingProject = false; - if (m_parsingAfterBuild) { - finish(); - } else if (!success) { - m_lastWasSuccess = false; - finish(); - } else { - build(); - } -} - -void QbsBuildStep::handleTaskStarted(const QString &desciption, int max) -{ - m_currentTask = desciption; - m_maxProgress = max; -} - -void QbsBuildStep::handleProgress(int value) -{ - if (m_maxProgress > 0) - emit progress(value * 100 / m_maxProgress, m_currentTask); -} - -void QbsBuildStep::handleCommandDescription(const QString &message) -{ - emit addOutput(message, OutputFormat::Stdout); -} - -void QbsBuildStep::handleProcessResult( - const FilePath &executable, - const QStringList &arguments, - const FilePath &workingDir, - const QStringList &stdOut, - const QStringList &stdErr, - bool success) -{ - Q_UNUSED(workingDir); - const bool hasOutput = !stdOut.isEmpty() || !stdErr.isEmpty(); - if (success && !hasOutput) - return; - - emit addOutput(executable.toUserOutput() + ' ' + ProcessArgs::joinArgs(arguments), - OutputFormat::Stdout); - for (const QString &line : stdErr) - emit addOutput(line, OutputFormat::Stderr); - for (const QString &line : stdOut) - emit addOutput(line, OutputFormat::Stdout); -} - -void QbsBuildStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message, - const QString &file, int line) -{ - emit addOutput(message, OutputFormat::Stdout); - emit addTask(CompileTask(type, message, FilePath::fromString(file), line), 1); -} - QString QbsBuildStep::buildVariant() const { return qbsConfiguration(PreserveVariables).value(Constants::QBS_CONFIG_VARIANT_KEY).toString(); @@ -496,59 +415,70 @@ QString QbsBuildStep::profile() const return qbsConfiguration(PreserveVariables).value(Constants::QBS_CONFIG_PROFILE_KEY).toString(); } -void QbsBuildStep::parseProject() +GroupItem QbsBuildStep::runRecipe() { - m_parsingProject = true; - connect(target(), &Target::parsingFinished, this, &QbsBuildStep::reparsingDone); - qbsBuildSystem()->parseCurrentBuildConfiguration(); -} + const auto onPreParserSetup = [this](QPointer<QbsBuildSystem> &buildSystem) { + buildSystem = qbsBuildSystem(); + }; + const auto onBuildSetup = [this](QbsRequest &request) { + QbsSession *session = static_cast<QbsBuildSystem*>(buildSystem())->session(); + if (!session) { + emit addOutput(Tr::tr("No qbs session exists for this target."), + OutputFormat::ErrorMessage); + return SetupResult::StopWithError; + } + QJsonObject requestData; + requestData.insert("type", "build-project"); + requestData.insert("max-job-count", maxJobs()); + requestData.insert("keep-going", keepGoing()); + requestData.insert("command-echo-mode", showCommandLines() ? "command-line" : "summary"); + requestData.insert("install", install()); + QbsSession::insertRequestedModuleProperties(requestData); + requestData.insert("clean-install-root", cleanInstallRoot()); + if (!m_products.isEmpty()) + requestData.insert("products", QJsonArray::fromStringList(m_products)); + if (!m_changedFiles.isEmpty()) { + const auto changedFilesArray = QJsonArray::fromStringList(m_changedFiles); + requestData.insert("changed-files", changedFilesArray); + requestData.insert("files-to-consider", changedFilesArray); + } + if (!m_activeFileTags.isEmpty()) + requestData.insert("active-file-tags", QJsonArray::fromStringList(m_activeFileTags)); + requestData.insert("data-mode", "only-if-changed"); -void QbsBuildStep::build() -{ - m_session = qbsBuildSystem()->session(); - if (!m_session) { - emit addOutput(QbsProjectManager::Tr::tr("No qbs session exists for this target."), - OutputFormat::ErrorMessage); - emit finished(false); - return; - } + request.setSession(session); + request.setRequestData(requestData); + connect(&request, &QbsRequest::progressChanged, this, &BuildStep::progress); + connect(&request, &QbsRequest::outputAdded, this, + [this](const QString &output, OutputFormat format) { + emit addOutput(output, format); + }); + connect(&request, &QbsRequest::taskAdded, this, [this](const Task &task) { + emit addTask(task, 1); + }); + return SetupResult::Continue; + }; + const auto onPostParserSetup = [this](QPointer<QbsBuildSystem> &buildSystem) { + buildSystem = qbsBuildSystem(); + return buildSystem->parsingScheduled() ? SetupResult::Continue : SetupResult::StopWithDone; + }; - QJsonObject request; - request.insert("type", "build-project"); - request.insert("max-job-count", maxJobs()); - request.insert("keep-going", keepGoing()); - request.insert("command-echo-mode", showCommandLines() ? "command-line" : "summary"); - request.insert("install", install()); - QbsSession::insertRequestedModuleProperties(request); - request.insert("clean-install-root", cleanInstallRoot()); - if (!m_products.isEmpty()) - request.insert("products", QJsonArray::fromStringList(m_products)); - if (!m_changedFiles.isEmpty()) { - const auto changedFilesArray = QJsonArray::fromStringList(m_changedFiles); - request.insert("changed-files", changedFilesArray); - request.insert("files-to-consider", changedFilesArray); - } - if (!m_activeFileTags.isEmpty()) - request.insert("active-file-tags", QJsonArray::fromStringList(m_activeFileTags)); - request.insert("data-mode", "only-if-changed"); + const Group root { + // We need a pre-build parsing step in order not to lose project file changes done + // right before building (but before the delay has elapsed). + QbsParserTask(onPreParserSetup), + Group { + continueOnError, + QbsRequestTask(onBuildSetup), + // Building can uncover additional target artifacts. + Sync([this] { qbsBuildSystem()->updateAfterBuild(); }), + // The reparsing, if it is necessary, has to be done before done() is emitted, as + // otherwise a potential additional build step could conflict with the parsing step. + QbsParserTask(onPostParserSetup) + } + }; - m_session->sendRequest(request); - m_maxProgress = 0; - connect(m_session, &QbsSession::projectBuilt, this, &QbsBuildStep::buildingDone); - connect(m_session, &QbsSession::taskStarted, this, &QbsBuildStep::handleTaskStarted); - connect(m_session, &QbsSession::taskProgress, this, &QbsBuildStep::handleProgress); - connect(m_session, &QbsSession::commandDescription, - this, &QbsBuildStep::handleCommandDescription); - connect(m_session, &QbsSession::processResult, this, &QbsBuildStep::handleProcessResult); - connect(m_session, &QbsSession::errorOccurred, this, [this] { - buildingDone(ErrorInfo(QbsProjectManager::Tr::tr("Build canceled: Qbs session failed."))); - }); -} - -void QbsBuildStep::finish() -{ - m_session = nullptr; - emit finished(m_lastWasSuccess); + return root; } void QbsBuildStep::updateState() @@ -589,16 +519,6 @@ QbsBuildStepData QbsBuildStep::stepData() const return data; } -void QbsBuildStep::dropSession() -{ - if (m_session) { - doCancel(); - m_session->disconnect(this); - m_session = nullptr; - } -} - - // -------------------------------------------------------------------- // QbsBuildStepConfigWidget: // -------------------------------------------------------------------- @@ -857,7 +777,6 @@ QbsBuildStepFactory::QbsBuildStepFactory() setSupportedProjectType(Constants::PROJECT_ID); } -} // namespace Internal -} // namespace QbsProjectManager +} // namespace QbsProjectManager::Internal #include "qbsbuildstep.moc" diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index f2f3c336d5d..a3d2c7a1b7e 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -3,19 +3,13 @@ #pragma once -#include "qbsbuildconfiguration.h" - #include <projectexplorer/buildstep.h> -#include <projectexplorer/task.h> -namespace QbsProjectManager { -namespace Internal { - -class ErrorInfo; -class QbsProject; -class QbsSession; +namespace QbsProjectManager::Internal { class QbsBuildStepConfigWidget; +class QbsBuildStepData; +class QbsBuildSystem; class ArchitecturesAspect : public Utils::MultiSelectionAspect { @@ -50,7 +44,6 @@ public: }; QbsBuildStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); - ~QbsBuildStep() override; QVariantMap qbsConfiguration(VariableHandling variableHandling) const; void setQbsConfiguration(const QVariantMap &config); @@ -70,11 +63,6 @@ public: Utils::BoolAspect forceProbes{this}; Utils::StringAspect commandLine{this}; - QbsBuildSystem *qbsBuildSystem() const; - QbsBuildStepData stepData() const; - - void dropSession(); - signals: void qbsConfigurationChanged(); void qbsBuildOptionsChanged(); @@ -82,36 +70,17 @@ signals: private: bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; - void doRun() override; - void doCancel() override; + Tasking::GroupItem runRecipe() final; QWidget *createConfigWidget() override; void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; - void buildingDone(const ErrorInfo &error); - void reparsingDone(bool success); - void handleTaskStarted(const QString &desciption, int max); - void handleProgress(int value); - void handleCommandDescription(const QString &message); - void handleProcessResult( - const Utils::FilePath &executable, - const QStringList &arguments, - const Utils::FilePath &workingDir, - const QStringList &stdOut, - const QStringList &stdErr, - bool success); - - void createTaskAndOutput(ProjectExplorer::Task::TaskType type, - const QString &message, const QString &file, int line); - + QbsBuildSystem *qbsBuildSystem() const; + QbsBuildStepData stepData() const; void setBuildVariant(const QString &variant); void setConfiguredArchitectures(const QStringList &architectures); QString profile() const; - void parseProject(); - void build(); - void finish(); - void updateState(); QStringList configuredArchitectures() const; @@ -122,14 +91,6 @@ private: QStringList m_activeFileTags; QStringList m_products; - QbsSession *m_session = nullptr; - - QString m_currentTask; - int m_maxProgress; - bool m_lastWasSuccess; - bool m_parsingProject = false; - bool m_parsingAfterBuild = false; - friend class QbsBuildStepConfigWidget; }; @@ -139,5 +100,4 @@ public: QbsBuildStepFactory(); }; -} // namespace Internal -} // namespace QbsProjectManager +} // namespace QbsProjectManager::Internal diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp index 329610fb784..0797f4cbca0 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp @@ -3,7 +3,9 @@ #include "qbsinstallstep.h" +#include "qbsbuildconfiguration.h" #include "qbsbuildstep.h" +#include "qbsproject.h" #include "qbsprojectmanagerconstants.h" #include "qbsprojectmanagertr.h" #include "qbsrequest.h" From 545dbc5743a48f1c7e2b099a564e105c080a174d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 25 Jul 2023 16:29:36 +0200 Subject: [PATCH 0489/1777] Valgrind: Use QMetaEnum for parsing enum values Change-Id: I43685e3fde662a57b6966d5f5f29d4138158b4d8 Reviewed-by: hjk <hjk@qt.io> --- .../valgrind/valgrindmemcheckparsertest.cpp | 2 +- src/plugins/valgrind/valgrindsettings.cpp | 6 +- src/plugins/valgrind/xmlprotocol/error.h | 14 ++-- src/plugins/valgrind/xmlprotocol/parser.cpp | 82 +++---------------- 4 files changed, 26 insertions(+), 78 deletions(-) diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp index 1d3a8a0e323..256557c178c 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -28,7 +28,7 @@ QT_BEGIN_NAMESPACE namespace QTest { template<> -inline bool qCompare(int const &t1, MemcheckErrorKind const &t2, +inline bool qCompare(int const &t1, MemcheckError const &t2, char const *actual, char const *expected, char const *file, int line) { return qCompare(t1, int(t2), actual, expected, file, line); diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index b7353d0516d..d398fa3a58f 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -22,6 +22,7 @@ #include <QDebug> #include <QListView> +#include <QMetaEnum> #include <QPushButton> #include <QSettings> #include <QStandardItemModel> @@ -325,8 +326,9 @@ ValgrindSettings::ValgrindSettings(bool global) visibleErrorKinds.setSettingsKey(base + "VisibleErrorKinds"); QList<int> defaultErrorKinds; - for (int i = 0; i < Valgrind::XmlProtocol::MemcheckErrorKindCount; ++i) - defaultErrorKinds << i; + const QMetaEnum memcheckErrorEnum = QMetaEnum::fromType<XmlProtocol::MemcheckError>(); + for (int i = 0; i < memcheckErrorEnum.keyCount(); ++i) + defaultErrorKinds << memcheckErrorEnum.value(i); visibleErrorKinds.setDefaultValue(defaultErrorKinds); detectCycles.setSettingsKey(base + "Callgrind.CycleDetection"); diff --git a/src/plugins/valgrind/xmlprotocol/error.h b/src/plugins/valgrind/xmlprotocol/error.h index c0948e62b5a..758091c8d91 100644 --- a/src/plugins/valgrind/xmlprotocol/error.h +++ b/src/plugins/valgrind/xmlprotocol/error.h @@ -14,13 +14,15 @@ QT_END_NAMESPACE namespace Valgrind { namespace XmlProtocol { +Q_NAMESPACE + class Stack; class Suppression; /** * Error kinds, specific to memcheck */ -enum MemcheckErrorKind +enum MemcheckError { InvalidFree, MismatchedFree, @@ -36,19 +38,20 @@ enum MemcheckErrorKind Leak_DefinitelyLost, Leak_PossiblyLost, Leak_StillReachable, - Leak_IndirectlyLost, - MemcheckErrorKindCount + Leak_IndirectlyLost }; +Q_ENUM_NS(MemcheckError); -enum PtrcheckErrorKind +enum PtrcheckError { SorG, Heap, Arith, SysParam }; +Q_ENUM_NS(PtrcheckError); -enum HelgrindErrorKind +enum HelgrindError { Race, UnlockUnlocked, @@ -58,6 +61,7 @@ enum HelgrindErrorKind LockOrder, Misc }; +Q_ENUM_NS(HelgrindError); class Error { diff --git a/src/plugins/valgrind/xmlprotocol/parser.cpp b/src/plugins/valgrind/xmlprotocol/parser.cpp index 749e9f2327b..f498fcf4fa5 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.cpp +++ b/src/plugins/valgrind/xmlprotocol/parser.cpp @@ -15,7 +15,7 @@ #include <QAbstractSocket> #include <QHash> #include <QIODevice> -#include <QPair> +#include <QMetaEnum> #include <QXmlStreamReader> namespace { @@ -88,9 +88,6 @@ private: void checkTool(const QString &tool); XWhat parseXWhat(); XauxWhat parseXauxWhat(); - MemcheckErrorKind parseMemcheckErrorKind(const QString &kind); - HelgrindErrorKind parseHelgrindErrorKind(const QString &kind); - PtrcheckErrorKind parsePtrcheckErrorKind(const QString &kind); int parseErrorKind(const QString &kind); void reportInternalError(const QString &errorString); @@ -100,19 +97,12 @@ private: Tool tool = Tool::Unknown; QXmlStreamReader reader; - QHash<QString, MemcheckErrorKind> errorKindsByName_memcheck; - QHash<QString, HelgrindErrorKind> errorKindsByName_helgrind; - QHash<QString, PtrcheckErrorKind> errorKindsByName_ptrcheck; QHash<QString, Tool> toolsByName; private: Parser *const q; }; -#undef ADD_ENUM -#define ADD_ENUM(tool,enumV) { errorKindsByName_##tool.insert(#enumV, enumV); } - - Parser::Private::Private(Parser *qq) : q(qq) { @@ -120,38 +110,8 @@ Parser::Private::Private(Parser *qq) toolsByName.insert("ptrcheck", Tool::Ptrcheck); toolsByName.insert("exp-ptrcheck", Tool::Ptrcheck); toolsByName.insert("helgrind", Tool::Helgrind); - - ADD_ENUM(memcheck, ClientCheck) - ADD_ENUM(memcheck, InvalidFree) - ADD_ENUM(memcheck, InvalidJump) - ADD_ENUM(memcheck, InvalidRead) - ADD_ENUM(memcheck, InvalidWrite) - ADD_ENUM(memcheck, Leak_DefinitelyLost) - ADD_ENUM(memcheck, Leak_PossiblyLost) - ADD_ENUM(memcheck, Leak_StillReachable) - ADD_ENUM(memcheck, Leak_IndirectlyLost) - ADD_ENUM(memcheck, MismatchedFree) - ADD_ENUM(memcheck, Overlap) - ADD_ENUM(memcheck, SyscallParam) - ADD_ENUM(memcheck, UninitCondition) - ADD_ENUM(memcheck, UninitValue) - - ADD_ENUM(helgrind, Race) - ADD_ENUM(helgrind, UnlockUnlocked) - ADD_ENUM(helgrind, UnlockForeign) - ADD_ENUM(helgrind, UnlockBogus) - ADD_ENUM(helgrind, PthAPIerror) - ADD_ENUM(helgrind, LockOrder) - ADD_ENUM(helgrind, Misc) - - ADD_ENUM(ptrcheck, SorG) - ADD_ENUM(ptrcheck, Heap) - ADD_ENUM(ptrcheck, Arith) - ADD_ENUM(ptrcheck, SysParam) } -#undef ADD_ENUM - static quint64 parseHex(const QString &str, const QString &context) { bool ok; @@ -316,44 +276,26 @@ XauxWhat Parser::Private::parseXauxWhat() return what; } - - -MemcheckErrorKind Parser::Private::parseMemcheckErrorKind(const QString &kind) +template <typename Enum> +int parseErrorEnum(const QString &kind) { - const auto it = errorKindsByName_memcheck.constFind(kind); - if (it != errorKindsByName_memcheck.constEnd()) - return *it; - else - throw ParserException(Tr::tr("Unknown memcheck error kind \"%1\"").arg(kind)); -} - -HelgrindErrorKind Parser::Private::parseHelgrindErrorKind(const QString &kind) -{ - const auto it = errorKindsByName_helgrind.constFind(kind); - if (it != errorKindsByName_helgrind.constEnd()) - return *it; - else - throw ParserException(Tr::tr("Unknown helgrind error kind \"%1\"").arg(kind)); -} - -PtrcheckErrorKind Parser::Private::parsePtrcheckErrorKind(const QString &kind) -{ - const auto it = errorKindsByName_ptrcheck.constFind(kind); - if (it != errorKindsByName_ptrcheck.constEnd()) - return *it; - else - throw ParserException(Tr::tr("Unknown ptrcheck error kind \"%1\"").arg(kind)); + const QMetaEnum metaEnum = QMetaEnum::fromType<Enum>(); + const int value = metaEnum.keyToValue(kind.toUtf8()); + if (value >= 0) + return value; + throw ParserException(Tr::tr("Unknown %1 kind \"%2\"") + .arg(QString::fromUtf8(metaEnum.enumName()), kind)); } int Parser::Private::parseErrorKind(const QString &kind) { switch (tool) { case Tool::Memcheck: - return parseMemcheckErrorKind(kind); + return parseErrorEnum<MemcheckError>(kind); case Tool::Ptrcheck: - return parsePtrcheckErrorKind(kind); + return parseErrorEnum<PtrcheckError>(kind); case Tool::Helgrind: - return parseHelgrindErrorKind(kind); + return parseErrorEnum<HelgrindError>(kind); case Tool::Unknown: default: break; From 76ac2c044eacd36a552bae35c12d527790794792 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 15 Jul 2023 09:42:31 +0200 Subject: [PATCH 0490/1777] BuildStep: Make runRecipe() pure virtual Task-number: QTCREATORBUG-29168 Change-Id: I8a73325b095b86e5cc625348f615705ed3da3dd5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/buildstep.cpp | 59 +++++++++-------------- src/plugins/projectexplorer/buildstep.h | 4 +- 2 files changed, 23 insertions(+), 40 deletions(-) diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index cdf843d0ba5..82deb528479 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -139,13 +139,33 @@ bool BuildStep::init() void BuildStep::run() { m_cancelFlag = false; - doRun(); + QTC_ASSERT(!m_taskTree, return); + + m_taskTree.reset(new TaskTree({runRecipe()})); + connect(m_taskTree.get(), &TaskTree::progressValueChanged, this, [this](int value) { + emit progress(qRound(double(value) * 100 / std::max(m_taskTree->progressMaximum(), 1)), {}); + }); + connect(m_taskTree.get(), &TaskTree::done, this, [this] { + emit finished(true); + m_taskTree.release()->deleteLater(); + }); + connect(m_taskTree.get(), &TaskTree::errorOccurred, this, [this] { + emit finished(false); + m_taskTree.release()->deleteLater(); + }); + m_taskTree->start(); } void BuildStep::cancel() { m_cancelFlag = true; - doCancel(); + if (!m_taskTree) + return; + + m_taskTree.reset(); + if (!m_cancelMessage.isEmpty()) + emit addOutput(m_cancelMessage, OutputFormat::ErrorMessage); + emit finished(false); } QWidget *BuildStep::doCreateConfigWidget() @@ -311,41 +331,6 @@ void BuildStep::setCancelMessage(const QString &message) m_cancelMessage = message; } -Tasking::GroupItem BuildStep::runRecipe() -{ - return Group {}; -} - -void BuildStep::doRun() -{ - QTC_ASSERT(!m_taskTree, return); - - m_taskTree.reset(new TaskTree({runRecipe()})); - connect(m_taskTree.get(), &TaskTree::progressValueChanged, this, [this](int value) { - emit progress(qRound(double(value) * 100 / std::max(m_taskTree->progressMaximum(), 1)), {}); - }); - connect(m_taskTree.get(), &TaskTree::done, this, [this] { - emit finished(true); - m_taskTree.release()->deleteLater(); - }); - connect(m_taskTree.get(), &TaskTree::errorOccurred, this, [this] { - emit finished(false); - m_taskTree.release()->deleteLater(); - }); - m_taskTree->start(); -} - -void BuildStep::doCancel() -{ - if (!m_taskTree) - return; - - m_taskTree.reset(); - if (!m_cancelMessage.isEmpty()) - emit addOutput(m_cancelMessage, OutputFormat::ErrorMessage); - emit finished(false); -} - void BuildStep::addMacroExpander() { m_addMacroExpander = true; diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 5f960a1fb16..510895e10c9 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -133,9 +133,7 @@ protected: private: using ProjectConfiguration::parent; - virtual Tasking::GroupItem runRecipe(); // TODO: Make pure virtual when all subclasses implement it. - virtual void doRun(); - virtual void doCancel(); + virtual Tasking::GroupItem runRecipe() = 0; BuildStepList * const m_stepList; std::atomic_bool m_cancelFlag; From 93305b49b82ce0091995780eb982af5cec5640b7 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 15 Jul 2023 09:49:36 +0200 Subject: [PATCH 0491/1777] BuildStep: Get rid of isCanceled() Change-Id: Ife5ce447c40fec3698abff9c866169e3b41613f0 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/projectexplorer/buildstep.cpp | 7 ------- src/plugins/projectexplorer/buildstep.h | 2 -- 2 files changed, 9 deletions(-) diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 82deb528479..2086b7a2eba 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -138,7 +138,6 @@ bool BuildStep::init() void BuildStep::run() { - m_cancelFlag = false; QTC_ASSERT(!m_taskTree, return); m_taskTree.reset(new TaskTree({runRecipe()})); @@ -158,7 +157,6 @@ void BuildStep::run() void BuildStep::cancel() { - m_cancelFlag = true; if (!m_taskTree) return; @@ -321,11 +319,6 @@ QVariant BuildStep::data(Id id) const return {}; } -bool BuildStep::isCanceled() const -{ - return m_cancelFlag; -} - void BuildStep::setCancelMessage(const QString &message) { m_cancelMessage = message; diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 510895e10c9..04a6c616e88 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -127,7 +127,6 @@ signals: protected: virtual QWidget *createConfigWidget(); - bool isCanceled() const; void setCancelMessage(const QString &message); private: @@ -136,7 +135,6 @@ private: virtual Tasking::GroupItem runRecipe() = 0; BuildStepList * const m_stepList; - std::atomic_bool m_cancelFlag; bool m_enabled = true; bool m_immutable = false; bool m_widgetExpandedByDefault = true; From d30bb927041adfeb59b1c76d2472c7e712dd11a6 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 25 Jul 2023 17:09:48 +0200 Subject: [PATCH 0492/1777] GitPlugin: Use PluginManager's futureSynchronizer It's being deleted on plugin unload, so it should be a proper substitute. Change-Id: I27383db72dfa0d5b0df2886b24c96266602ccbac Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/git/gitclient.cpp | 5 ----- src/plugins/git/gitclient.h | 4 ---- src/plugins/git/gitsubmiteditor.cpp | 3 ++- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index bd0b037cdaf..f544ad30b9b 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -3099,11 +3099,6 @@ void GitClient::handleMergeConflicts(const FilePath &workingDir, const QString & } } -void GitClient::addFuture(const QFuture<void> &future) -{ - m_synchronizer.addFuture(future); -} - // Subversion: git svn void GitClient::synchronousSubversionFetch(const FilePath &workingDirectory) const { diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 3604eb9f3cf..f0875bed8ff 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -12,7 +12,6 @@ #include <vcsbase/vcsbaseclient.h> #include <utils/fileutils.h> -#include <utils/futuresynchronizer.h> #include <utils/process.h> #include <QObject> @@ -331,7 +330,6 @@ public: bool isValidRevision(const QString &revision) const; void handleMergeConflicts(const Utils::FilePath &workingDir, const QString &commit, const QStringList &files, const QString &abortCommand); - void addFuture(const QFuture<void> &future); static QString msgNoChangedFiles(); static QString msgNoCommits(bool includeRemote); @@ -406,8 +404,6 @@ private: QString m_diffCommit; Utils::FilePaths m_updatedSubmodules; bool m_disableEditor = false; - // The synchronizer has cancelOnWait set to true by default. - Utils::FutureSynchronizer m_synchronizer; // for commit updates }; class GitRemote : public Core::IVersionControl::RepoUrl diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp index 9ff83c8c124..88bc91616f7 100644 --- a/src/plugins/git/gitsubmiteditor.cpp +++ b/src/plugins/git/gitsubmiteditor.cpp @@ -11,6 +11,7 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/iversioncontrol.h> #include <coreplugin/progressmanager/progressmanager.h> +#include <extensionsystem/pluginmanager.h> #include <utils/async.h> #include <utils/qtcassert.h> #include <vcsbase/submitfilemodel.h> @@ -209,7 +210,7 @@ void GitSubmitEditor::updateFileModel() Core::ProgressManager::addTask(m_fetchWatcher.future(), Tr::tr("Refreshing Commit Data"), TASK_UPDATE_COMMIT); - GitClient::instance()->addFuture(QFuture<void>(m_fetchWatcher.future())); + ExtensionSystem::PluginManager::futureSynchronizer()->addFuture(m_fetchWatcher.future()); } void GitSubmitEditor::forceUpdateFileModel() From c828ba2f309f8c8db94eb4c440f5748d36fe91a1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 25 Jul 2023 17:56:27 +0200 Subject: [PATCH 0493/1777] Beautifier: Rename some entities called 'command' A confusing amount of TextCommand or Utils::Command objects or -returning functions were called 'command'. Rename a few to make future reasoning simpler. Change-Id: I872b2e841cb40a4533e5ebcd37cb05489158cec7 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../artisticstyle/artisticstyle.cpp | 28 +++++++------- .../beautifier/artisticstyle/artisticstyle.h | 4 +- src/plugins/beautifier/beautifierplugin.cpp | 2 +- src/plugins/beautifier/beautifiertool.h | 2 +- .../beautifier/clangformat/clangformat.cpp | 38 +++++++++---------- .../beautifier/clangformat/clangformat.h | 4 +- .../beautifier/uncrustify/uncrustify.cpp | 36 +++++++++--------- .../beautifier/uncrustify/uncrustify.h | 4 +- 8 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp index 68d546508d6..20a9f41e221 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp @@ -279,7 +279,7 @@ void ArtisticStyle::formatFile() if (cfgFileName.isEmpty()) showError(BeautifierTool::msgCannotGetConfigurationFile(asDisplayName())); else - formatCurrentFile(command(cfgFileName.toFSPathString())); + formatCurrentFile(textCommand(cfgFileName.toFSPathString())); } FilePath ArtisticStyle::configurationFile() const @@ -318,10 +318,10 @@ FilePath ArtisticStyle::configurationFile() const return {}; } -Command ArtisticStyle::command() const +Command ArtisticStyle::textCommand() const { const FilePath cfgFile = configurationFile(); - return cfgFile.isEmpty() ? Command() : command(cfgFile.toFSPathString()); + return cfgFile.isEmpty() ? Command() : textCommand(cfgFile.toFSPathString()); } bool ArtisticStyle::isApplicable(const Core::IDocument *document) const @@ -329,25 +329,25 @@ bool ArtisticStyle::isApplicable(const Core::IDocument *document) const return settings().isApplicable(document); } -Command ArtisticStyle::command(const QString &cfgFile) const +Command ArtisticStyle::textCommand(const QString &cfgFile) const { - Command command; - command.setExecutable(settings().command()); - command.addOption("-q"); - command.addOption("--options=" + cfgFile); + Command cmd; + cmd.setExecutable(settings().command()); + cmd.addOption("-q"); + cmd.addOption("--options=" + cfgFile); const QVersionNumber version = settings().version(); if (version > QVersionNumber(2, 3)) { - command.setProcessing(Command::PipeProcessing); + cmd.setProcessing(Command::PipeProcessing); if (version == QVersionNumber(2, 4)) - command.setPipeAddsNewline(true); - command.setReturnsCRLF(Utils::HostOsInfo::isWindowsHost()); - command.addOption("-z2"); + cmd.setPipeAddsNewline(true); + cmd.setReturnsCRLF(Utils::HostOsInfo::isWindowsHost()); + cmd.addOption("-z2"); } else { - command.addOption("%file"); + cmd.addOption("%file"); } - return command; + return cmd; } } // Beautifier::Internal diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.h b/src/plugins/beautifier/artisticstyle/artisticstyle.h index 45b94fbd463..2a20b7f1f2f 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.h +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.h @@ -18,13 +18,13 @@ public: QString id() const override; void updateActions(Core::IEditor *editor) override; - TextEditor::Command command() const override; + TextEditor::Command textCommand() const override; bool isApplicable(const Core::IDocument *document) const override; private: void formatFile(); Utils::FilePath configurationFile() const; - TextEditor::Command command(const QString &cfgFile) const; + TextEditor::Command textCommand(const QString &cfgFile) const; QAction *m_formatFile = nullptr; }; diff --git a/src/plugins/beautifier/beautifierplugin.cpp b/src/plugins/beautifier/beautifierplugin.cpp index d4389b00c54..e7a4b7593fc 100644 --- a/src/plugins/beautifier/beautifierplugin.cpp +++ b/src/plugins/beautifier/beautifierplugin.cpp @@ -139,7 +139,7 @@ void BeautifierPluginPrivate::autoFormatOnSave(Core::IDocument *document) if (tool != std::end(tools)) { if (!(*tool)->isApplicable(document)) return; - const TextEditor::Command command = (*tool)->command(); + const TextEditor::Command command = (*tool)->textCommand(); if (!command.isValid()) return; const QList<Core::IEditor *> editors = Core::DocumentModel::editorsForDocument(document); diff --git a/src/plugins/beautifier/beautifiertool.h b/src/plugins/beautifier/beautifiertool.h index f8c99aef55b..b41197b49e5 100644 --- a/src/plugins/beautifier/beautifiertool.h +++ b/src/plugins/beautifier/beautifiertool.h @@ -41,7 +41,7 @@ public: * * @note The received command may be invalid. */ - virtual TextEditor::Command command() const = 0; + virtual TextEditor::Command textCommand() const = 0; virtual bool isApplicable(const Core::IDocument *document) const = 0; diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index 8277af19fb7..9ed2d4f4a40 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -374,7 +374,7 @@ void ClangFormat::updateActions(Core::IEditor *editor) void ClangFormat::formatFile() { - formatCurrentFile(command()); + formatCurrentFile(textCommand()); } void ClangFormat::formatAtPosition(const int pos, const int length) @@ -385,7 +385,7 @@ void ClangFormat::formatAtPosition(const int pos, const int length) const QTextCodec *codec = widget->textDocument()->codec(); if (!codec) { - formatCurrentFile(command(pos, length)); + formatCurrentFile(textCommand(pos, length)); return; } @@ -393,7 +393,7 @@ void ClangFormat::formatAtPosition(const int pos, const int length) const QStringView buffer(text); const int encodedOffset = codec->fromUnicode(buffer.left(pos)).size(); const int encodedLength = codec->fromUnicode(buffer.mid(pos, length)).size(); - formatCurrentFile(command(encodedOffset, encodedLength)); + formatCurrentFile(textCommand(encodedOffset, encodedLength)); } void ClangFormat::formatAtCursor() @@ -436,7 +436,7 @@ void ClangFormat::formatLines() lineEnd = end.blockNumber() + 1; } - auto cmd = command(); + auto cmd = textCommand(); cmd.addOption(QString("-lines=%1:%2").arg(QString::number(lineStart)).arg(QString::number(lineEnd))); formatCurrentFile(cmd); } @@ -476,30 +476,30 @@ void ClangFormat::disableFormattingSelectedText() formatAtPosition(selectionStartBlock.position(), reformatTextLength); } -Command ClangFormat::command() const +Command ClangFormat::textCommand() const { - Command command; - command.setExecutable(settings().command()); - command.setProcessing(Command::PipeProcessing); + Command cmd; + cmd.setExecutable(settings().command()); + cmd.setProcessing(Command::PipeProcessing); if (settings().usePredefinedStyle()) { const QString predefinedStyle = settings().predefinedStyle.stringValue(); - command.addOption("-style=" + predefinedStyle); + cmd.addOption("-style=" + predefinedStyle); if (predefinedStyle == "File") { const QString fallbackStyle = settings().fallbackStyle.stringValue(); if (fallbackStyle != "Default") - command.addOption("-fallback-style=" + fallbackStyle); + cmd.addOption("-fallback-style=" + fallbackStyle); } - command.addOption("-assume-filename=%file"); + cmd.addOption("-assume-filename=%file"); } else { - command.addOption("-style=file"); + cmd.addOption("-style=file"); const FilePath path = settings().styleFileName(settings().customStyle()) .absolutePath().pathAppended("%filename"); - command.addOption("-assume-filename=" + path.nativePath()); + cmd.addOption("-assume-filename=" + path.nativePath()); } - return command; + return cmd; } bool ClangFormat::isApplicable(const Core::IDocument *document) const @@ -507,12 +507,12 @@ bool ClangFormat::isApplicable(const Core::IDocument *document) const return settings().isApplicable(document); } -Command ClangFormat::command(int offset, int length) const +Command ClangFormat::textCommand(int offset, int length) const { - Command c = command(); - c.addOption("-offset=" + QString::number(offset)); - c.addOption("-length=" + QString::number(length)); - return c; + Command cmd = textCommand(); + cmd.addOption("-offset=" + QString::number(offset)); + cmd.addOption("-length=" + QString::number(length)); + return cmd; } } // Beautifier::Internal diff --git a/src/plugins/beautifier/clangformat/clangformat.h b/src/plugins/beautifier/clangformat/clangformat.h index 9b6b00df40b..82f6ac160b9 100644 --- a/src/plugins/beautifier/clangformat/clangformat.h +++ b/src/plugins/beautifier/clangformat/clangformat.h @@ -18,7 +18,7 @@ public: QString id() const override; void updateActions(Core::IEditor *editor) override; - TextEditor::Command command() const override; + TextEditor::Command textCommand() const override; bool isApplicable(const Core::IDocument *document) const override; private: @@ -27,7 +27,7 @@ private: void formatAtCursor(); void formatLines(); void disableFormattingSelectedText(); - TextEditor::Command command(int offset, int length) const; + TextEditor::Command textCommand(int offset, int length) const; QAction *m_formatFile = nullptr; QAction *m_formatLines = nullptr; diff --git a/src/plugins/beautifier/uncrustify/uncrustify.cpp b/src/plugins/beautifier/uncrustify/uncrustify.cpp index 819906266f8..fb69eac520c 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustify.cpp @@ -284,7 +284,7 @@ void Uncrustify::formatFile() if (cfgFileName.isEmpty()) showError(msgCannotGetConfigurationFile(uDisplayName())); else - formatCurrentFile(command(cfgFileName)); + formatCurrentFile(textCommand(cfgFileName)); } void Uncrustify::formatSelectedText() @@ -311,7 +311,7 @@ void Uncrustify::formatSelectedText() if (tc.positionInBlock() > 0) tc.movePosition(QTextCursor::EndOfLine); const int endPos = tc.position(); - formatCurrentFile(command(cfgFileName, true), startPos, endPos); + formatCurrentFile(textCommand(cfgFileName, true), startPos, endPos); } else if (settings().formatEntireFileFallback()) { formatFile(); } @@ -349,10 +349,10 @@ FilePath Uncrustify::configurationFile() const return {}; } -Command Uncrustify::command() const +Command Uncrustify::textCommand() const { const FilePath cfgFile = configurationFile(); - return cfgFile.isEmpty() ? Command() : command(cfgFile, false); + return cfgFile.isEmpty() ? Command() : textCommand(cfgFile, false); } bool Uncrustify::isApplicable(const Core::IDocument *document) const @@ -360,25 +360,25 @@ bool Uncrustify::isApplicable(const Core::IDocument *document) const return settings().isApplicable(document); } -Command Uncrustify::command(const FilePath &cfgFile, bool fragment) const +Command Uncrustify::textCommand(const FilePath &cfgFile, bool fragment) const { - Command command; - command.setExecutable(settings().command()); - command.setProcessing(Command::PipeProcessing); + Command cmd; + cmd.setExecutable(settings().command()); + cmd.setProcessing(Command::PipeProcessing); if (settings().version() >= QVersionNumber(0, 62)) { - command.addOption("--assume"); - command.addOption("%file"); + cmd.addOption("--assume"); + cmd.addOption("%file"); } else { - command.addOption("-l"); - command.addOption("cpp"); + cmd.addOption("-l"); + cmd.addOption("cpp"); } - command.addOption("-L"); - command.addOption("1-2"); + cmd.addOption("-L"); + cmd.addOption("1-2"); if (fragment) - command.addOption("--frag"); - command.addOption("-c"); - command.addOption(cfgFile.path()); - return command; + cmd.addOption("--frag"); + cmd.addOption("-c"); + cmd.addOption(cfgFile.path()); + return cmd; } } // Beautifier::Internal diff --git a/src/plugins/beautifier/uncrustify/uncrustify.h b/src/plugins/beautifier/uncrustify/uncrustify.h index 71ee4730c14..090b06e0423 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.h +++ b/src/plugins/beautifier/uncrustify/uncrustify.h @@ -18,14 +18,14 @@ public: QString id() const override; void updateActions(Core::IEditor *editor) override; - TextEditor::Command command() const override; + TextEditor::Command textCommand() const override; bool isApplicable(const Core::IDocument *document) const override; private: void formatFile(); void formatSelectedText(); Utils::FilePath configurationFile() const; - TextEditor::Command command(const Utils::FilePath &cfgFile, bool fragment = false) const; + TextEditor::Command textCommand(const Utils::FilePath &cfgFile, bool fragment = false) const; QAction *m_formatFile = nullptr; QAction *m_formatRange = nullptr; From 84250d3daf231924b1c1687e24bac853f55e7a4f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 25 Jul 2023 13:23:37 +0200 Subject: [PATCH 0494/1777] Valgrind: Rename ValgrindOptionsPage into ValgrindSettingsPage That's the usual naming nowadays. Change-Id: I10c20e857f20ee4e1d36107e1cc1bf77449e7b17 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/valgrind/valgrindsettings.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index d398fa3a58f..3f81f05b20d 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -418,14 +418,12 @@ ValgrindSettings &globalSettings() return theSettings; } -// -// ValgrindOptionsPage -// +// ValgrindSettingsPage -class ValgrindOptionsPage final : public Core::IOptionsPage +class ValgrindSettingsPage final : public Core::IOptionsPage { public: - ValgrindOptionsPage() + ValgrindSettingsPage() { setId(ANALYZER_VALGRIND_SETTINGS); setDisplayName(Tr::tr("Valgrind")); @@ -436,6 +434,6 @@ public: } }; -const ValgrindOptionsPage settingsPage; +const ValgrindSettingsPage settingsPage; } // Valgrind::Internal From 4ffbf6ec635f5392861cabea5f62898efca4665d Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 25 Jul 2023 15:29:37 +0200 Subject: [PATCH 0495/1777] PerfProfiler: Disable auto apply on settings Change-Id: I67dc03f15e66e55e18b0bba41dc6365e8e6889ff Reviewed-by: hjk <hjk@qt.io> --- src/plugins/perfprofiler/perfsettings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp index 7d71de3504c..4cb1286885e 100644 --- a/src/plugins/perfprofiler/perfsettings.cpp +++ b/src/plugins/perfprofiler/perfsettings.cpp @@ -27,6 +27,7 @@ PerfSettings &globalSettings() PerfSettings::PerfSettings(ProjectExplorer::Target *target) { + setAutoApply(false); period.setSettingsKey("Analyzer.Perf.Frequency"); period.setRange(250, 2147483647); period.setDefaultValue(250); From c7d0c735877f5332eab5c3f881abc161599e38d0 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 24 Jul 2023 14:21:49 +0200 Subject: [PATCH 0496/1777] Build: Rename deployqt.py to deploy.py It hasn't been about just deploying Qt for a very long time. Change-Id: I72fb070db505909500d2e68f2bafb198c3342c2b Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- cmake/Utils.cmake | 4 ++-- scripts/{deployqt.py => deploy.py} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename scripts/{deployqt.py => deploy.py} (100%) diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake index d684b972648..b08aaee4a84 100644 --- a/cmake/Utils.cmake +++ b/cmake/Utils.cmake @@ -32,7 +32,7 @@ function(setup_dependencies_component) set(_ide_app_target \"\${_default_app_target}\") if (NOT EXISTS \"\${_ide_app_target}\") # The component CPack generators (WIX, NSIS64, IFW) install every component with their own CMAKE_INSTALL_PREFIX - # directory and since deployqt.py needs the path to IDE_APP_TARGET the line below is needeed + # directory and since deploy.py needs the path to IDE_APP_TARGET the line below is needeed string(REPLACE \"Dependencies\" \"${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}\" _ide_app_target \"\${_ide_app_target}\") endif() if (NOT EXISTS \"\${_ide_app_target}\") @@ -41,7 +41,7 @@ function(setup_dependencies_component) endif() execute_process(COMMAND \"${Python3_EXECUTABLE}\" - \"${CMAKE_CURRENT_LIST_DIR}/scripts/deployqt.py\" + \"${CMAKE_CURRENT_LIST_DIR}/scripts/deploy.py\" ${_llvm_arg} ${_elfutils_arg} \"\${_ide_app_target}\" diff --git a/scripts/deployqt.py b/scripts/deploy.py similarity index 100% rename from scripts/deployqt.py rename to scripts/deploy.py From e3567ddc714ad40f6e9e958b39ffc96e60e9f6ee Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 25 Jul 2023 14:53:18 +0200 Subject: [PATCH 0497/1777] Build: Remove outdated argument handling No longer used Change-Id: Ife7edad49c66ee2a59d67ea4eca72767f8d73a7a Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- scripts/deploy.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/scripts/deploy.py b/scripts/deploy.py index 79aea111bdd..70a8399c8cc 100755 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -19,14 +19,10 @@ encoding = locale.getdefaultlocale()[1] def get_args(): parser = argparse.ArgumentParser(description='Deploy Qt Creator dependencies for packaging') - parser.add_argument('-i', '--ignore-errors', help='For backward compatibility', - action='store_true', default=False) parser.add_argument('--elfutils-path', help='Path to elfutils installation for use by perfprofiler (Windows, Linux)') - # TODO remove defaulting to LLVM_INSTALL_DIR when we no longer build qmake based packages parser.add_argument('--llvm-path', - help='Path to LLVM installation', - default=os.environ.get('LLVM_INSTALL_DIR')) + help='Path to LLVM installation') parser.add_argument('qtcreator_binary', help='Path to Qt Creator binary (or the app bundle on macOS)') parser.add_argument('qmake_binary', help='Path to qmake binary') @@ -53,9 +49,6 @@ def get_args(): return args -def usage(): - print("Usage: %s <existing_qtcreator_binary> [qmake_path]" % os.path.basename(sys.argv[0])) - def which(program): def is_exe(fpath): return os.path.exists(fpath) and os.access(fpath, os.X_OK) From 56f38e4171b89fa56af03b0f8a3e5fd1db8ecd7b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 09:21:24 +0200 Subject: [PATCH 0498/1777] Use path chooser for selection local debug symbol files Change-Id: I7aa3f58389ea3608cc09b1e2cf2d167c463e6c6c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/boot2qt/qdbrunconfiguration.cpp | 1 - src/plugins/qnx/qnxrunconfiguration.cpp | 1 - src/plugins/remotelinux/remotelinuxrunconfiguration.cpp | 1 - 3 files changed, 3 deletions(-) diff --git a/src/plugins/boot2qt/qdbrunconfiguration.cpp b/src/plugins/boot2qt/qdbrunconfiguration.cpp index ebb58402393..976483faf9b 100644 --- a/src/plugins/boot2qt/qdbrunconfiguration.cpp +++ b/src/plugins/boot2qt/qdbrunconfiguration.cpp @@ -44,7 +44,6 @@ public: symbolFile.setSettingsKey("QdbRunConfig.LocalExecutable"); symbolFile.setLabelText(Tr::tr("Executable on host:")); - symbolFile.setDisplayStyle(SymbolFileAspect::LabelDisplay); environment.setDeviceSelector(target, EnvironmentAspect::RunDevice); diff --git a/src/plugins/qnx/qnxrunconfiguration.cpp b/src/plugins/qnx/qnxrunconfiguration.cpp index 86a65d98bcb..12ae568bddd 100644 --- a/src/plugins/qnx/qnxrunconfiguration.cpp +++ b/src/plugins/qnx/qnxrunconfiguration.cpp @@ -36,7 +36,6 @@ public: executable.setHistoryCompleter("RemoteLinux.AlternateExecutable.History"); symbolFile.setLabelText(Tr::tr("Executable on host:")); - symbolFile.setDisplayStyle(SymbolFileAspect::LabelDisplay); environment.setDeviceSelector(target, EnvironmentAspect::RunDevice); diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index ff608a6b27f..0165b0268f8 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -52,7 +52,6 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Id id) executable.setHistoryCompleter("RemoteLinux.AlternateExecutable.History"); symbolFile.setLabelText(Tr::tr("Executable on host:")); - symbolFile.setDisplayStyle(SymbolFileAspect::LabelDisplay); arguments.setMacroExpander(macroExpander()); From 59ce7c14f75e27297d604afbcec1820da3ce3997 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 07:17:59 +0200 Subject: [PATCH 0499/1777] Debugger: Use CommonSettings::setLayouter ... instead of a IOptionsPage-derived class. Change-Id: Ica45b1752fc4e6f83e9dfae25c5e9dcd1fd9c9ba Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/debugger/commonoptionspage.cpp | 82 +++++++++------------- src/plugins/debugger/debuggeractions.cpp | 2 - src/plugins/debugger/debuggeractions.h | 1 - 3 files changed, 34 insertions(+), 51 deletions(-) diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index a5e3246f0e7..053031e2974 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -31,6 +31,7 @@ CommonSettings &commonSettings() CommonSettings::CommonSettings() { + setAutoApply(false); const QString debugModeGroup("DebugMode"); useAlternatingRowColors.setSettingsKey(debugModeGroup, "UseAlternatingRowColours"); @@ -128,6 +129,38 @@ CommonSettings::CommonSettings() "information, it is switched off by default.")); useToolTipsInMainEditor.setDefaultValue(true); + setLayouter([this] { + using namespace Layouting; + + Column col1 { + useAlternatingRowColors, + useAnnotationsInMainEditor, + useToolTipsInMainEditor, + closeSourceBuffersOnExit, + closeMemoryBuffersOnExit, + raiseOnInterrupt, + breakpointsFullPathByDefault, + warnOnReleaseBuilds, + Row { maximalStackDepth, st } + }; + + Column col2 { + fontSizeFollowsEditor, + switchModeOnExit, + showQmlObjectTree, + stationaryEditorWhileStepping, + forceLoggingToConsole, + registerForPostMortem, + st + }; + + return Column { + Group { title("Behavior"), Row { col1, col2, st } }, + sourcePathMap, + st + }; + }); + readSettings(); } @@ -136,53 +169,6 @@ CommonSettings::~CommonSettings() delete registerForPostMortem; } - -class CommonOptionsPageWidget : public Core::IOptionsPageWidget -{ -public: - explicit CommonOptionsPageWidget() - { - DebuggerSettings &s = settings(); - - setOnApply([&s] { - s.page1.apply(); - s.page1.writeSettings(); - }); - - setOnFinish([&s] { s.page1.finish(); }); - - using namespace Layouting; - - Column col1 { - s.useAlternatingRowColors, - s.useAnnotationsInMainEditor, - s.useToolTipsInMainEditor, - s.closeSourceBuffersOnExit, - s.closeMemoryBuffersOnExit, - s.raiseOnInterrupt, - s.breakpointsFullPathByDefault, - s.warnOnReleaseBuilds, - Row { s.maximalStackDepth, st } - }; - - Column col2 { - s.fontSizeFollowsEditor, - s.switchModeOnExit, - s.showQmlObjectTree, - s.stationaryEditorWhileStepping, - s.forceLoggingToConsole, - s.registerForPostMortem, - st - }; - - Column { - Group { title("Behavior"), Row { col1, col2, st } }, - s.sourcePathMap, - st - }.attachTo(this); - } -}; - QString msgSetBreakpointAtFunction(const char *function) { return Tr::tr("Stop when %1() is called").arg(QLatin1String(function)); @@ -213,7 +199,7 @@ public: setCategory(DEBUGGER_SETTINGS_CATEGORY); setDisplayCategory(Tr::tr("Debugger")); setCategoryIconPath(":/debugger/images/settingscategory_debugger.png"); - setWidgetCreator([] { return new CommonOptionsPageWidget; }); + setSettingsProvider([] { return &commonSettings(); }); } }; diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 218ebda31e0..17c9ca32587 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -319,7 +319,6 @@ DebuggerSettings::DebuggerSettings() : const QString qmlInspectorGroup = "QML.Inspector"; showAppOnTop.setSettingsKey(qmlInspectorGroup, "QmlInspector.ShowAppOnTop"); - page1.registerAspects(commonSettings()); // Page 4 page4.registerAspect(&useDebuggingHelpers); page4.registerAspect(&useCodeModel); @@ -358,7 +357,6 @@ DebuggerSettings::DebuggerSettings() : all.registerAspect(&sortStructMembers); // Collect all - all.registerAspects(page1); all.registerAspects(page4); all.registerAspects(page5); all.registerAspects(page6); diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index f455aba7a74..689580dca9a 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -119,7 +119,6 @@ public: Utils::BoolAspect showAppOnTop; Utils::AspectContainer all; // All - Utils::AspectContainer page1; // General Utils::AspectContainer page4; // Locals & Expressions Utils::AspectContainer page5; // CDB Utils::AspectContainer page6; // CDB Paths From bcb083bd99604614315f33e732b812d6c6cc1fec Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 11:55:08 +0200 Subject: [PATCH 0500/1777] Python: Use a connect that will remain valid ... after a StringAspect/FileAspect split, instead of relying on the current inheritance. Change-Id: I7dd91f402636d35a15e9d1618b73c0981777b06e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/python/pythonwizardpage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/python/pythonwizardpage.cpp b/src/plugins/python/pythonwizardpage.cpp index 78776202e87..8b631e2c414 100644 --- a/src/plugins/python/pythonwizardpage.cpp +++ b/src/plugins/python/pythonwizardpage.cpp @@ -109,7 +109,7 @@ PythonWizardPage::PythonWizardPage(const QList<QPair<QString, QVariant>> &pySide m_stateLabel->setWordWrap(true); m_stateLabel->setFilled(true); m_stateLabel->setType(InfoLabel::Error); - connect(&m_venvPath, &StringAspect::validChanged, this, &PythonWizardPage::updateStateLabel); + connect(&m_venvPath, &FilePathAspect::validChanged, this, &PythonWizardPage::updateStateLabel); connect(&m_createVenv, &BaseAspect::changed, this, &PythonWizardPage::updateStateLabel); Form { From 0e284ba50cb69d3340a7b0d32d6e0ff9cd2dc38c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 11:57:25 +0200 Subject: [PATCH 0501/1777] Nim: Use FilePathChooser for working directory Change-Id: I08cd734dec1e810a113edfa646036242736fe9e1 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/nim/project/nimcompilercleanstep.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/nim/project/nimcompilercleanstep.cpp b/src/plugins/nim/project/nimcompilercleanstep.cpp index fe3e4dfa4b2..e8b523e7a5a 100644 --- a/src/plugins/nim/project/nimcompilercleanstep.cpp +++ b/src/plugins/nim/project/nimcompilercleanstep.cpp @@ -30,7 +30,6 @@ public: : BuildStep(parentList, id) { workingDir.setLabelText(Tr::tr("Working directory:")); - workingDir.setDisplayStyle(StringAspect::LineEditDisplay); setSummaryUpdater([this] { workingDir.setValue(buildDirectory()); From 8ea41af94f09f0a16c5419c6aa648df32bbac106 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 11:58:21 +0200 Subject: [PATCH 0502/1777] ProjectExplorer: Use FilePathChooser for alternative executable ... also for the manual fallback (ExecutableAspect::makeOverridable) Change-Id: If660c9e26005ce88b3712472d44cf46c95379acb Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/projectexplorer/runconfigurationaspects.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index db56fa434ef..980dec8bf87 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -613,7 +613,6 @@ void ExecutableAspect::makeOverridable(const QString &overridingKey, const QStri { QTC_ASSERT(!m_alternativeExecutable, return); m_alternativeExecutable = new FilePathAspect; - m_alternativeExecutable->setDisplayStyle(StringAspect::LineEditDisplay); m_alternativeExecutable->setLabelText(Tr::tr("Alternate executable on device:")); m_alternativeExecutable->setSettingsKey(overridingKey); m_alternativeExecutable->makeCheckable(CheckBoxPlacement::Right, From 8d5897b8eb7a753b38734fc6c1bde2cef873b768 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 25 Jul 2023 12:24:52 +0200 Subject: [PATCH 0503/1777] Designer: Add command line arguments for plugin paths Add a command line argument for overriding the default plugin path (useful if you have installed custom designer plugins in a different, compatible Qt version), and one for adding plugin paths (for example to separate builds of custom designer plugins that haven't been installed anywhere). This feature is only enabled when building with Qt >= 6.7, which added the option to change the plugin paths for designer. Change-Id: I990b26056477e3e41c6afe82479383d8bc7c45d0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/designer/CMakeLists.txt | 19 +++++++++++++ src/plugins/designer/Designer.json.in | 1 + src/plugins/designer/formeditor.cpp | 34 +++++++++++++++++++++-- src/plugins/designer/formeditor.h | 3 ++ src/plugins/designer/formeditorplugin.cpp | 25 ++++++++++++++++- src/plugins/designer/formeditorplugin.h | 2 +- 6 files changed, 80 insertions(+), 4 deletions(-) diff --git a/src/plugins/designer/CMakeLists.txt b/src/plugins/designer/CMakeLists.txt index 18b1cf97692..eea16798a5d 100644 --- a/src/plugins/designer/CMakeLists.txt +++ b/src/plugins/designer/CMakeLists.txt @@ -1,3 +1,22 @@ +# used in the .json.in +if(Qt6_VERSION VERSION_GREATER_EQUAL 6.7.0) + set(DESIGNER_PLUGIN_ARGUMENTS + "\"Arguments\" : [ + { + \"Name\" : \"-designer-qt-pluginpath\", + \"Parameter\" : \"path\", + \"Description\" : \"Override the default search path for Qt Designer plugins\" + }, + { + \"Name\" : \"-designer-pluginpath\", + \"Parameter\" : \"path\", + \"Description\" : \"Add a custom search path for Qt Designer plugins\" + } + ],") +else() + set(DESIGNER_PLUGIN_ARGUMENTS) +endif() + add_qtc_plugin(Designer PLUGIN_CLASS FormEditorPlugin CONDITION TARGET Qt::DesignerComponentsPrivate AND TARGET Qt::Designer diff --git a/src/plugins/designer/Designer.json.in b/src/plugins/designer/Designer.json.in index b11764606e4..2d03527c30a 100644 --- a/src/plugins/designer/Designer.json.in +++ b/src/plugins/designer/Designer.json.in @@ -15,5 +15,6 @@ "Category" : "Qt Creator", "Description" : "Qt Designer integration.", "Url" : "http://www.qt.io", + ${DESIGNER_PLUGIN_ARGUMENTS} ${IDE_PLUGIN_DEPENDENCIES} } diff --git a/src/plugins/designer/formeditor.cpp b/src/plugins/designer/formeditor.cpp index 86f5f13c8df..4d8acb41f5b 100644 --- a/src/plugins/designer/formeditor.cpp +++ b/src/plugins/designer/formeditor.cpp @@ -78,6 +78,9 @@ static inline QIcon designerIcon(const QString &iconName) return icon; } +Q_GLOBAL_STATIC(QString, sQtPluginPath); +Q_GLOBAL_STATIC(QStringList, sAdditionalPluginPaths); + using namespace Core; using namespace Designer::Constants; using namespace Utils; @@ -203,9 +206,24 @@ public: static FormEditorData *d = nullptr; -FormEditorData::FormEditorData() : - m_formeditor(QDesignerComponents::createFormEditor(nullptr)) +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +static QStringList designerPluginPaths() { + const QStringList qtPluginPath = sQtPluginPath->isEmpty() + ? QDesignerComponents::defaultPluginPaths() + : QStringList(*sQtPluginPath); + return qtPluginPath + *sAdditionalPluginPaths; +} +#endif + +FormEditorData::FormEditorData() +{ +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + m_formeditor = QDesignerComponents::createFormEditorWithPluginPaths(designerPluginPaths(), + nullptr); +#else + m_formeditor = QDesignerComponents::createFormEditor(nullptr); +#endif if (Designer::Constants::Internal::debug) qDebug() << Q_FUNC_INFO; QTC_ASSERT(!d, return); @@ -871,5 +889,17 @@ void FormEditorData::print() printer->setPageOrientation(oldOrientation); } +void setQtPluginPath(const QString &qtPluginPath) +{ + QTC_CHECK(!d); + *sQtPluginPath = qtPluginPath; +} + +void addPluginPath(const QString &pluginPath) +{ + QTC_CHECK(!d); + sAdditionalPluginPaths->append(pluginPath); +} + } // namespace Internal } // namespace Designer diff --git a/src/plugins/designer/formeditor.h b/src/plugins/designer/formeditor.h index 0d069e2322c..875c8e50904 100644 --- a/src/plugins/designer/formeditor.h +++ b/src/plugins/designer/formeditor.h @@ -60,5 +60,8 @@ SharedTools::WidgetHost *activeWidgetHost(); FormWindowEditor *activeEditor(); QList<Core::IOptionsPage *> optionsPages(); +void setQtPluginPath(const QString &qtPluginPath); +void addPluginPath(const QString &pluginPath); + } // namespace Internal } // namespace Designer diff --git a/src/plugins/designer/formeditorplugin.cpp b/src/plugins/designer/formeditorplugin.cpp index fd9a78187c5..37d0f7ce5df 100644 --- a/src/plugins/designer/formeditorplugin.cpp +++ b/src/plugins/designer/formeditorplugin.cpp @@ -60,7 +60,25 @@ FormEditorPlugin::~FormEditorPlugin() delete d; } -void FormEditorPlugin::initialize() +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +static void parseArguments(const QStringList &arguments) +{ + const auto doWithNext = [arguments](auto it, const std::function<void(QString)> &fun) { + ++it; + if (it != arguments.cend()) + fun(*it); + }; + for (auto it = arguments.cbegin(); it != arguments.cend(); ++it) { + if (*it == "-designer-qt-pluginpath") + doWithNext(it, [](const QString &path) { setQtPluginPath(path); }); + else if (*it == "-designer-pluginpath") + doWithNext(it, [](const QString &path) { addPluginPath(path); }); + } +} +#endif + +bool FormEditorPlugin::initialize([[maybe_unused]] const QStringList &arguments, + [[maybe_unused]] QString *errorString) { d = new FormEditorPluginPrivate; @@ -91,6 +109,11 @@ void FormEditorPlugin::initialize() if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath)) QCoreApplication::installTranslator(qtr); } + +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + parseArguments(arguments); +#endif + return true; } void FormEditorPlugin::extensionsInitialized() diff --git a/src/plugins/designer/formeditorplugin.h b/src/plugins/designer/formeditorplugin.h index e24c76ec538..754aeecaee4 100644 --- a/src/plugins/designer/formeditorplugin.h +++ b/src/plugins/designer/formeditorplugin.h @@ -24,7 +24,7 @@ private slots: #endif private: - void initialize() override; + bool initialize(const QStringList &arguments, QString *errorString) override; void extensionsInitialized() override; void switchSourceForm(); From 778a1d75ba9cf89ec009484ff8d8da28b59b54f1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 25 Jul 2023 16:09:50 +0200 Subject: [PATCH 0504/1777] Git: Initialize GitClient on first access This does not change the current timing of construction a lot as the GerritPlugin may need it immediately in some cases, in any case the gitGrep instance will need it. There's nothing big going on at destruction time, so the prolonged lifetime until really close to the end does not hurt. The reason here is that this way we will avoid cases like in change 5e5b90a9a1664c. Change-Id: I326d83c1a3d21114322ac6cce8d9e9b782faacdc Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/git/branchmodel.cpp | 56 +++-- src/plugins/git/branchmodel.h | 3 +- src/plugins/git/branchview.cpp | 50 +++-- src/plugins/git/changeselectiondialog.cpp | 9 +- src/plugins/git/gerrit/branchcombobox.cpp | 4 +- src/plugins/git/gerrit/gerritmodel.cpp | 2 +- src/plugins/git/gerrit/gerritplugin.cpp | 20 +- src/plugins/git/gerrit/gerritpushdialog.cpp | 14 +- .../git/gerrit/gerritremotechooser.cpp | 2 +- src/plugins/git/gerrit/gerritserver.cpp | 15 +- src/plugins/git/gitclient.cpp | 74 +++---- src/plugins/git/gitclient.h | 4 +- src/plugins/git/giteditor.cpp | 12 +- src/plugins/git/gitgrep.cpp | 10 +- src/plugins/git/gitgrep.h | 3 +- src/plugins/git/gitplugin.cpp | 193 +++++++++--------- src/plugins/git/gitplugin.h | 3 - src/plugins/git/gitsubmiteditor.cpp | 8 +- src/plugins/git/logchangedialog.cpp | 4 +- src/plugins/git/mergetool.cpp | 4 +- src/plugins/git/remotedialog.cpp | 4 +- src/plugins/git/remotemodel.cpp | 10 +- src/plugins/git/stashdialog.cpp | 18 +- src/plugins/gitlab/gitlabprojectsettings.cpp | 13 +- 24 files changed, 255 insertions(+), 280 deletions(-) diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp index 3bf65cf5b38..0702c4a0aac 100644 --- a/src/plugins/git/branchmodel.cpp +++ b/src/plugins/git/branchmodel.cpp @@ -201,9 +201,8 @@ public: class BranchModel::Private { public: - explicit Private(BranchModel *q, GitClient *client) : + explicit Private(BranchModel *q) : q(q), - client(client), rootNode(new BranchNode) { } @@ -222,7 +221,6 @@ public: void updateAllUpstreamStatus(BranchNode *node); BranchModel *q; - GitClient *client; FilePath workingDirectory; BranchNode *rootNode; BranchNode *currentBranch = nullptr; @@ -249,12 +247,10 @@ public: // BranchModel: // -------------------------------------------------------------------------- -BranchModel::BranchModel(GitClient *client, QObject *parent) : +BranchModel::BranchModel(QObject *parent) : QAbstractItemModel(parent), - d(new Private(this, client)) + d(new Private(this)) { - QTC_CHECK(d->client); - // Abuse the sha field for ref prefix d->rootNode->append(new BranchNode(Tr::tr("Local Branches"), "refs/heads")); d->rootNode->append(new BranchNode(Tr::tr("Remote Branches"), "refs/remotes")); @@ -415,7 +411,7 @@ void BranchModel::refresh(const FilePath &workingDirectory, ShowError showError) } const ProcessTask topRevisionProc = - d->client->topRevision(workingDirectory, + gitClient().topRevision(workingDirectory, [=](const QString &ref, const QDateTime &dateTime) { d->currentSha = ref; d->currentDateTime = dateTime; @@ -430,7 +426,7 @@ void BranchModel::refresh(const FilePath &workingDirectory, ShowError showError) "refs/remotes/**"}; if (settings().showTags()) args << "refs/tags/**"; - d->client->setupCommand(process, workingDirectory, args); + gitClient().setupCommand(process, workingDirectory, args); }; const auto forEachRefDone = [=](const Process &process) { @@ -481,7 +477,7 @@ void BranchModel::refresh(const FilePath &workingDirectory, ShowError showError) void BranchModel::setCurrentBranch() { - const QString currentBranch = d->client->synchronousCurrentLocalBranch(d->workingDirectory); + const QString currentBranch = gitClient().synchronousCurrentLocalBranch(d->workingDirectory); if (currentBranch.isEmpty()) return; @@ -499,8 +495,8 @@ void BranchModel::renameBranch(const QString &oldName, const QString &newName) { QString errorMessage; QString output; - if (!d->client->synchronousBranchCmd(d->workingDirectory, {"-m", oldName, newName}, - &output, &errorMessage)) + if (!gitClient().synchronousBranchCmd(d->workingDirectory, {"-m", oldName, newName}, + &output, &errorMessage)) VcsOutputWindow::appendError(errorMessage); else refresh(d->workingDirectory); @@ -510,10 +506,10 @@ void BranchModel::renameTag(const QString &oldName, const QString &newName) { QString errorMessage; QString output; - if (!d->client->synchronousTagCmd(d->workingDirectory, {newName, oldName}, - &output, &errorMessage) - || !d->client->synchronousTagCmd(d->workingDirectory, {"-d", oldName}, - &output, &errorMessage)) { + if (!gitClient().synchronousTagCmd(d->workingDirectory, {newName, oldName}, + &output, &errorMessage) + || !gitClient().synchronousTagCmd(d->workingDirectory, {"-d", oldName}, + &output, &errorMessage)) { VcsOutputWindow::appendError(errorMessage); } else { refresh(d->workingDirectory); @@ -610,7 +606,7 @@ void BranchModel::removeBranch(const QModelIndex &idx) QString errorMessage; QString output; - if (!d->client->synchronousBranchCmd(d->workingDirectory, {"-D", branch}, &output, &errorMessage)) { + if (!gitClient().synchronousBranchCmd(d->workingDirectory, {"-D", branch}, &output, &errorMessage)) { VcsOutputWindow::appendError(errorMessage); return; } @@ -626,7 +622,7 @@ void BranchModel::removeTag(const QModelIndex &idx) QString errorMessage; QString output; - if (!d->client->synchronousTagCmd(d->workingDirectory, {"-d", tag}, &output, &errorMessage)) { + if (!gitClient().synchronousTagCmd(d->workingDirectory, {"-d", tag}, &output, &errorMessage)) { VcsOutputWindow::appendError(errorMessage); return; } @@ -642,8 +638,8 @@ void BranchModel::checkoutBranch(const QModelIndex &idx, const QObject *context, // No StashGuard since this function for now is only used with clean working dir. // If it is ever used from another place, please add StashGuard here - d->client->checkout(d->workingDirectory, branch, GitClient::StashMode::NoStash, - context, handler); + gitClient().checkout(d->workingDirectory, branch, GitClient::StashMode::NoStash, + context, handler); } bool BranchModel::branchIsMerged(const QModelIndex &idx) @@ -655,8 +651,8 @@ bool BranchModel::branchIsMerged(const QModelIndex &idx) QString errorMessage; QString output; - if (!d->client->synchronousBranchCmd(d->workingDirectory, {"-a", "--contains", sha(idx)}, - &output, &errorMessage)) { + if (!gitClient().synchronousBranchCmd(d->workingDirectory, {"-a", "--contains", sha(idx)}, + &output, &errorMessage)) { VcsOutputWindow::appendError(errorMessage); } @@ -700,15 +696,15 @@ QModelIndex BranchModel::addBranch(const QString &name, bool track, const QModel branchDateTime = dateTime(startPoint); } else { const QStringList arguments({"-n1", "--format=%H %ct"}); - if (d->client->synchronousLog(d->workingDirectory, arguments, &output, &errorMessage, - RunFlags::SuppressCommandLogging)) { + if (gitClient().synchronousLog(d->workingDirectory, arguments, &output, &errorMessage, + RunFlags::SuppressCommandLogging)) { const QStringList values = output.split(' '); startSha = values[0]; branchDateTime = QDateTime::fromSecsSinceEpoch(values[1].toLongLong()); } } - if (!d->client->synchronousBranchCmd(d->workingDirectory, args, &output, &errorMessage)) { + if (!gitClient().synchronousBranchCmd(d->workingDirectory, args, &output, &errorMessage)) { VcsOutputWindow::appendError(errorMessage); return QModelIndex(); } @@ -748,7 +744,7 @@ void BranchModel::setRemoteTracking(const QModelIndex &trackingIndex) const QString currentName = fullName(current); const QString shortTracking = fullName(trackingIndex); const QString tracking = fullName(trackingIndex, true); - d->client->synchronousSetTrackingBranch(d->workingDirectory, currentName, tracking); + gitClient().synchronousSetTrackingBranch(d->workingDirectory, currentName, tracking); d->currentBranch->tracking = shortTracking; updateUpstreamStatus(d->currentBranch); emit dataChanged(current, current); @@ -920,8 +916,8 @@ void BranchModel::updateUpstreamStatus(BranchNode *node) return; Process *process = new Process(node); - process->setEnvironment(d->client->processEnvironment()); - process->setCommand({d->client->vcsBinary(), {"rev-list", "--no-color", "--left-right", + process->setEnvironment(gitClient().processEnvironment()); + process->setCommand({gitClient().vcsBinary(), {"rev-list", "--no-color", "--left-right", "--count", node->fullRef() + "..." + node->tracking}}); process->setWorkingDirectory(d->workingDirectory); connect(process, &Process::done, this, [this, process, node] { @@ -958,8 +954,8 @@ QString BranchModel::toolTip(const QString &sha) const // Show the sha description excluding diff as toolTip QString output; QString errorMessage; - if (!d->client->synchronousLog(d->workingDirectory, {"-n1", sha}, &output, &errorMessage, - RunFlags::SuppressCommandLogging)) { + if (!gitClient().synchronousLog(d->workingDirectory, {"-n1", sha}, &output, &errorMessage, + RunFlags::SuppressCommandLogging)) { return errorMessage; } return output; diff --git a/src/plugins/git/branchmodel.h b/src/plugins/git/branchmodel.h index de126e9a5eb..e1f0cabee8d 100644 --- a/src/plugins/git/branchmodel.h +++ b/src/plugins/git/branchmodel.h @@ -16,12 +16,11 @@ class CommandResult; namespace Git::Internal { class BranchNode; -class GitClient; class BranchModel : public QAbstractItemModel { public: - explicit BranchModel(GitClient *client, QObject *parent = nullptr); + explicit BranchModel(QObject *parent = nullptr); ~BranchModel() override; // QAbstractItemModel diff --git a/src/plugins/git/branchview.cpp b/src/plugins/git/branchview.cpp index 5720497ecae..ad045660cf7 100644 --- a/src/plugins/git/branchview.cpp +++ b/src/plugins/git/branchview.cpp @@ -78,7 +78,7 @@ BranchView::BranchView() , m_refreshAction(new QAction(this)) , m_repositoryLabel(new ElidingLabel(this)) , m_branchView(new NavigationTreeView(this)) - , m_model(new BranchModel(GitClient::instance(), this)) + , m_model(new BranchModel(this)) , m_filterModel(new BranchFilterModel(this)) { m_addAction->setIcon(Utils::Icons::PLUS_TOOLBAR.icon()); @@ -237,12 +237,12 @@ void BranchView::slotCustomContextMenu(const QPoint &point) const std::optional<QString> remote = m_model->remoteName(index); if (remote.has_value()) { contextMenu.addAction(Tr::tr("&Fetch"), this, [this, &remote] { - GitClient::instance()->fetch(m_repository, *remote); + gitClient().fetch(m_repository, *remote); }); contextMenu.addSeparator(); if (!remote->isEmpty()) { contextMenu.addAction(Tr::tr("Remove &Stale Branches"), this, [this, &remote] { - GitClient::instance()->removeStaleRemoteBranches(m_repository, *remote); + gitClient().removeStaleRemoteBranches(m_repository, *remote); }); contextMenu.addSeparator(); } @@ -261,7 +261,7 @@ void BranchView::slotCustomContextMenu(const QPoint &point) contextMenu.addAction(Tr::tr("&Diff"), this, [this] { const QString fullName = m_model->fullName(selectedIndex(), true); if (!fullName.isEmpty()) - GitClient::instance()->diffBranch(m_repository, fullName); + gitClient().diffBranch(m_repository, fullName); }); contextMenu.addAction(Tr::tr("&Log"), this, [this] { log(selectedIndex()); }); contextMenu.addAction(Tr::tr("Reflo&g"), this, [this] { reflog(selectedIndex()); }); @@ -394,13 +394,12 @@ bool BranchView::checkout() ' ' + nextBranch + "-AutoStash "; BranchCheckoutDialog branchCheckoutDialog(this, currentBranch, nextBranch); - GitClient *client = GitClient::instance(); - if (client->gitStatus(m_repository, StatusMode(NoUntracked | NoSubmodules)) != GitClient::StatusChanged) + if (gitClient().gitStatus(m_repository, StatusMode(NoUntracked | NoSubmodules)) != GitClient::StatusChanged) branchCheckoutDialog.foundNoLocalChanges(); QList<Stash> stashes; - client->synchronousStashList(m_repository, &stashes); + gitClient().synchronousStashList(m_repository, &stashes); for (const Stash &stash : std::as_const(stashes)) { if (stash.message.startsWith(popMessageStart)) { branchCheckoutDialog.foundStashForNextBranch(); @@ -415,13 +414,13 @@ bool BranchView::checkout() } else if (branchCheckoutDialog.exec() == QDialog::Accepted) { if (branchCheckoutDialog.makeStashOfCurrentBranch()) { - if (client->synchronousStash(m_repository, currentBranch + "-AutoStash").isEmpty()) + if (gitClient().synchronousStash(m_repository, currentBranch + "-AutoStash").isEmpty()) return false; } else if (branchCheckoutDialog.moveLocalChangesToNextBranch()) { - if (!client->beginStashScope(m_repository, "Checkout", NoPrompt)) + if (!gitClient().beginStashScope(m_repository, "Checkout", NoPrompt)) return false; } else if (branchCheckoutDialog.discardLocalChanges()) { - if (!client->synchronousReset(m_repository)) + if (!gitClient().synchronousReset(m_repository)) return false; } @@ -429,18 +428,18 @@ bool BranchView::checkout() const bool popStash = branchCheckoutDialog.popStashOfNextBranch(); const auto commandHandler = [=](const CommandResult &) { if (moveChanges) { - client->endStashScope(m_repository); + gitClient().endStashScope(m_repository); } else if (popStash) { QList<Stash> stashes; QString stashName; - client->synchronousStashList(m_repository, &stashes); + gitClient().synchronousStashList(m_repository, &stashes); for (const Stash &stash : std::as_const(stashes)) { if (stash.message.startsWith(popMessageStart)) { stashName = stash.name; break; } } - client->synchronousStashRestore(m_repository, stashName, true); + gitClient().synchronousStashRestore(m_repository, stashName, true); } }; m_model->checkoutBranch(selected, this, commandHandler); @@ -526,7 +525,7 @@ bool BranchView::reset(const QByteArray &resetType) if (QMessageBox::question(this, Tr::tr("Git Reset"), Tr::tr("Reset branch \"%1\" to \"%2\"?") .arg(currentName, branchName), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { - GitClient::instance()->reset(m_repository, QLatin1String("--" + resetType), branchName); + gitClient().reset(m_repository, QLatin1String("--" + resetType), branchName); return true; } return false; @@ -547,15 +546,14 @@ TaskTree *BranchView::onFastForwardMerge(const std::function<void()> &callback) const TreeStorage<FastForwardStorage> storage; - GitClient *client = GitClient::instance(); const auto setupMergeBase = [=](Process &process) { - client->setupCommand(process, m_repository, {"merge-base", "HEAD", branch}); + gitClient().setupCommand(process, m_repository, {"merge-base", "HEAD", branch}); }; const auto onMergeBaseDone = [storage](const Process &process) { storage->mergeBase = process.cleanedStdOut().trimmed(); }; - const ProcessTask topRevisionProc = client->topRevision( + const ProcessTask topRevisionProc = gitClient().topRevision( m_repository, [storage](const QString &revision, const QDateTime &) { storage->topRevision = revision; @@ -584,9 +582,8 @@ bool BranchView::merge(bool allowFastForward) QTC_CHECK(selected != m_model->currentBranch()); const QString branch = m_model->fullName(selected, true); - GitClient *client = GitClient::instance(); - if (client->beginStashScope(m_repository, "merge", AllowUnstashed)) - return client->synchronousMerge(m_repository, branch, allowFastForward); + if (gitClient().beginStashScope(m_repository, "merge", AllowUnstashed)) + return gitClient().synchronousMerge(m_repository, branch, allowFastForward); return false; } @@ -599,9 +596,8 @@ void BranchView::rebase() QTC_CHECK(selected != m_model->currentBranch()); const QString baseBranch = m_model->fullName(selected, true); - GitClient *client = GitClient::instance(); - if (client->beginStashScope(m_repository, "rebase")) - client->rebase(m_repository, baseBranch); + if (gitClient().beginStashScope(m_repository, "rebase")) + gitClient().rebase(m_repository, baseBranch); } bool BranchView::cherryPick() @@ -612,7 +608,7 @@ bool BranchView::cherryPick() QTC_CHECK(selected != m_model->currentBranch()); const QString branch = m_model->fullName(selected, true); - return GitClient::instance()->synchronousCherryPick(m_repository, branch); + return gitClient().synchronousCherryPick(m_repository, branch); } void BranchView::log(const QModelIndex &idx) @@ -621,7 +617,7 @@ void BranchView::log(const QModelIndex &idx) if (branchName.isEmpty()) return; SetInContext block(m_blockRefresh); - GitClient::instance()->log(m_repository, QString(), false, {branchName}); + gitClient().log(m_repository, QString(), false, {branchName}); } void BranchView::reflog(const QModelIndex &idx) @@ -630,7 +626,7 @@ void BranchView::reflog(const QModelIndex &idx) if (branchName.isEmpty()) return; SetInContext block(m_blockRefresh); - GitClient::instance()->reflog(m_repository, branchName); + gitClient().reflog(m_repository, branchName); } void BranchView::push() @@ -646,7 +642,7 @@ void BranchView::push() const QString remoteBranch = fullTargetName.mid(pos + 1); const QStringList pushArgs = {remoteName, localBranch + ':' + remoteBranch}; - GitClient::instance()->push(m_repository, pushArgs); + gitClient().push(m_repository, pushArgs); } BranchViewFactory::BranchViewFactory() diff --git a/src/plugins/git/changeselectiondialog.cpp b/src/plugins/git/changeselectiondialog.cpp index 8e4a6bdc997..cf991e6e938 100644 --- a/src/plugins/git/changeselectiondialog.cpp +++ b/src/plugins/git/changeselectiondialog.cpp @@ -33,8 +33,8 @@ ChangeSelectionDialog::ChangeSelectionDialog(const FilePath &workingDirectory, I QWidget *parent) : QDialog(parent) { - m_gitExecutable = GitClient::instance()->vcsBinary(); - m_gitEnvironment = GitClient::instance()->processEnvironment(); + m_gitExecutable = gitClient().vcsBinary(); + m_gitEnvironment = gitClient().processEnvironment(); resize(550, 350); setWindowTitle(Tr::tr("Select a Git Commit")); @@ -208,10 +208,9 @@ void ChangeSelectionDialog::recalculateCompletion() if (workingDir.isEmpty()) return; - GitClient *client = GitClient::instance(); Process *process = new Process(this); - process->setEnvironment(client->processEnvironment()); - process->setCommand({client->vcsBinary(), {"for-each-ref", "--format=%(refname:short)"}}); + process->setEnvironment(gitClient().processEnvironment()); + process->setCommand({gitClient().vcsBinary(), {"for-each-ref", "--format=%(refname:short)"}}); process->setWorkingDirectory(workingDir); process->setUseCtrlCStub(true); connect(process, &Process::done, this, [this, process] { diff --git a/src/plugins/git/gerrit/branchcombobox.cpp b/src/plugins/git/gerrit/branchcombobox.cpp index 6337b529de2..01a861ec427 100644 --- a/src/plugins/git/gerrit/branchcombobox.cpp +++ b/src/plugins/git/gerrit/branchcombobox.cpp @@ -14,7 +14,7 @@ BranchComboBox::BranchComboBox(QWidget *parent) : QComboBox(parent) void BranchComboBox::init(const FilePath &repository) { m_repository = repository; - QString currentBranch = GitClient::instance()->synchronousCurrentLocalBranch(repository); + QString currentBranch = gitClient().synchronousCurrentLocalBranch(repository); if (currentBranch.isEmpty()) { m_detached = true; currentBranch = "HEAD"; @@ -22,7 +22,7 @@ void BranchComboBox::init(const FilePath &repository) } QString output; const QString branchPrefix("refs/heads/"); - if (!GitClient::instance()->synchronousForEachRefCmd( + if (!gitClient().synchronousForEachRefCmd( m_repository, {"--format=%(refname)", branchPrefix}, &output)) { return; } diff --git a/src/plugins/git/gerrit/gerritmodel.cpp b/src/plugins/git/gerrit/gerritmodel.cpp index 6457117b322..8fdbf427f7b 100644 --- a/src/plugins/git/gerrit/gerritmodel.cpp +++ b/src/plugins/git/gerrit/gerritmodel.cpp @@ -268,7 +268,7 @@ QueryContext::QueryContext(const QString &query, m_output.append(m_process.readAllRawStandardOutput()); }); connect(&m_process, &Process::done, this, &QueryContext::processDone); - m_process.setEnvironment(Git::Internal::GitClient::instance()->processEnvironment()); + m_process.setEnvironment(Git::Internal::gitClient().processEnvironment()); m_timer.setInterval(timeOutMS); m_timer.setSingleShot(true); diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp index 87ce5bfdaca..f39cc538609 100644 --- a/src/plugins/git/gerrit/gerritplugin.cpp +++ b/src/plugins/git/gerrit/gerritplugin.cpp @@ -101,7 +101,7 @@ FetchContext::FetchContext(const QSharedPointer<GerritChange> &change, VcsBase::VcsOutputWindow::append(QString::fromLocal8Bit(m_process.readAllRawStandardOutput())); }); m_process.setWorkingDirectory(repository); - m_process.setEnvironment(GitClient::instance()->processEnvironment()); + m_process.setEnvironment(gitClient().processEnvironment()); } void FetchContext::start() @@ -136,7 +136,7 @@ void FetchContext::show() { const QString title = QString::number(m_change->number) + '/' + QString::number(m_change->currentPatchSet.patchSetNumber); - GitClient::instance()->show(m_repository, "FETCH_HEAD", title); + gitClient().show(m_repository, "FETCH_HEAD", title); } void FetchContext::cherryPick() @@ -144,12 +144,12 @@ void FetchContext::cherryPick() // Point user to errors. VcsBase::VcsOutputWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus); - GitClient::instance()->synchronousCherryPick(m_repository, "FETCH_HEAD"); + gitClient().synchronousCherryPick(m_repository, "FETCH_HEAD"); } void FetchContext::checkout() { - GitClient::instance()->checkout(m_repository, "FETCH_HEAD"); + gitClient().checkout(m_repository, "FETCH_HEAD"); } GerritPlugin::GerritPlugin() @@ -219,7 +219,7 @@ void GerritPlugin::push(const FilePath &topLevel) dialog.storeTopic(); m_reviewers = dialog.reviewers(); - GitClient::instance()->push(topLevel, {dialog.selectedRemoteName(), dialog.pushTarget()}); + gitClient().push(topLevel, {dialog.selectedRemoteName(), dialog.pushTarget()}); } static FilePath currentRepository() @@ -267,19 +267,19 @@ void GerritPlugin::push() Utils::FilePath GerritPlugin::gitBinDirectory() { - return GitClient::instance()->gitBinDirectory(); + return gitClient().gitBinDirectory(); } // Find the branch of a repository. QString GerritPlugin::branch(const FilePath &repository) { - return GitClient::instance()->synchronousCurrentLocalBranch(repository); + return gitClient().synchronousCurrentLocalBranch(repository); } void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode) { // Locate git. - const Utils::FilePath git = GitClient::instance()->vcsBinary(); + const Utils::FilePath git = gitClient().vcsBinary(); if (git.isEmpty()) { VcsBase::VcsOutputWindow::appendError(Git::Tr::tr("Git is not available.")); return; @@ -292,7 +292,7 @@ void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode) if (!repository.isEmpty()) { // Check if remote from a working dir is the same as remote from patch - QMap<QString, QString> remotesList = GitClient::instance()->synchronousRemotesList(repository); + QMap<QString, QString> remotesList = gitClient().synchronousRemotesList(repository); if (!remotesList.isEmpty()) { const QStringList remotes = remotesList.values(); for (QString remote : remotes) { @@ -305,7 +305,7 @@ void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode) } if (!verifiedRepository) { - const SubmoduleDataMap submodules = GitClient::instance()->submoduleList(repository); + const SubmoduleDataMap submodules = gitClient().submoduleList(repository); for (const SubmoduleData &submoduleData : submodules) { QString remote = submoduleData.url; if (remote.endsWith(".git")) diff --git a/src/plugins/git/gerrit/gerritpushdialog.cpp b/src/plugins/git/gerrit/gerritpushdialog.cpp index 87961c5945a..a97bdeeabf8 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.cpp +++ b/src/plugins/git/gerrit/gerritpushdialog.cpp @@ -54,7 +54,7 @@ QString GerritPushDialog::determineRemoteBranch(const QString &localBranch) QString output; QString error; - if (!GitClient::instance()->synchronousBranchCmd( + if (!gitClient().synchronousBranchCmd( m_workingDir, {"-r", "--contains", earliestCommit + '^'}, &output, &error)) { return QString(); } @@ -63,7 +63,7 @@ QString GerritPushDialog::determineRemoteBranch(const QString &localBranch) QString remoteTrackingBranch; if (localBranch != "HEAD") - remoteTrackingBranch = GitClient::instance()->synchronousTrackingBranch(m_workingDir, localBranch); + remoteTrackingBranch = gitClient().synchronousTrackingBranch(m_workingDir, localBranch); QString remoteBranch; for (const QString &reference : refs) { @@ -87,7 +87,7 @@ void GerritPushDialog::initRemoteBranches() const QString head = "/HEAD"; const QString remotesPrefix("refs/remotes/"); - if (!GitClient::instance()->synchronousForEachRefCmd( + if (!gitClient().synchronousForEachRefCmd( m_workingDir, {"--format=%(refname)\t%(committerdate:raw)", remotesPrefix}, &output)) { return; } @@ -198,7 +198,7 @@ QString GerritPushDialog::calculateChangeRange(const QString &branch) const QString remote = selectedRemoteName() + '/' + selectedRemoteBranchName(); QString number; QString error; - GitClient::instance()->synchronousRevListCmd( + gitClient().synchronousRevListCmd( m_workingDir, { remote + ".." + branch, "--count" }, &number, &error); number.chop(1); return number; @@ -322,7 +322,7 @@ QString GerritPushDialog::pushTarget() const void GerritPushDialog::storeTopic() { const QString branch = m_localBranchComboBox->currentText(); - GitClient::instance()->setConfigValue( + gitClient().setConfigValue( m_workingDir, QString("branch.%1.topic").arg(branch), selectedTopic()); } @@ -335,7 +335,7 @@ void GerritPushDialog::setRemoteBranches(bool includeOld) const QString remoteName = selectedRemoteName(); if (!m_remoteBranches.contains(remoteName)) { const QStringList remoteBranches = - GitClient::instance()->synchronousRepositoryBranches(remoteName, m_workingDir); + gitClient().synchronousRepositoryBranches(remoteName, m_workingDir); for (const QString &branch : remoteBranches) m_remoteBranches.insertMulti(remoteName, {branch, {}}); if (remoteBranches.isEmpty()) { @@ -373,7 +373,7 @@ void GerritPushDialog::updateCommits(int index) { const QString branch = m_localBranchComboBox->itemText(index); m_hasLocalCommits = m_commitView->init(m_workingDir, branch, LogChangeWidget::Silent); - const QString topic = GitClient::instance()->readConfigValue( + const QString topic = gitClient().readConfigValue( m_workingDir, QString("branch.%1.topic").arg(branch)); if (!topic.isEmpty()) m_topicLineEdit->setText(topic); diff --git a/src/plugins/git/gerrit/gerritremotechooser.cpp b/src/plugins/git/gerrit/gerritremotechooser.cpp index 2804d75333d..d3363051857 100644 --- a/src/plugins/git/gerrit/gerritremotechooser.cpp +++ b/src/plugins/git/gerrit/gerritremotechooser.cpp @@ -85,7 +85,7 @@ bool GerritRemoteChooser::updateRemotes(bool forceReload) m_remotes.clear(); QString errorMessage; // Mute errors. We'll just fallback to the defaults const QMap<QString, QString> remotesList = - Git::Internal::GitClient::instance()->synchronousRemotesList(m_repository, &errorMessage); + Git::Internal::gitClient().synchronousRemotesList(m_repository, &errorMessage); for (auto mapIt = remotesList.cbegin(), end = remotesList.cend(); mapIt != end; ++mapIt) { GerritServer server; if (!server.fillFromRemote(mapIt.value(), *m_parameters, forceReload)) diff --git a/src/plugins/git/gerrit/gerritserver.cpp b/src/plugins/git/gerrit/gerritserver.cpp index a02174b2053..a91c963d6a4 100644 --- a/src/plugins/git/gerrit/gerritserver.cpp +++ b/src/plugins/git/gerrit/gerritserver.cpp @@ -1,9 +1,10 @@ // Copyright (C) 2017 Orgad Shaneh <orgads@gmail.com>. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#include "gerritserver.h" + #include "authenticationdialog.h" #include "gerritparameters.h" -#include "gerritserver.h" #include "../gitclient.h" #include "../gittr.h" @@ -222,9 +223,8 @@ QStringList GerritServer::curlArguments() const int GerritServer::testConnection() { - static GitClient *const client = GitClient::instance(); const QStringList arguments = curlArguments() << (url(RestUrl) + accountUrlC); - const CommandResult result = client->vcsSynchronousExec({}, {curlBinary, arguments}); + const CommandResult result = gitClient().vcsSynchronousExec({}, {curlBinary, arguments}); if (result.result() == ProcessResult::FinishedWithSuccess) { QString output = result.cleanedStdOut(); // Gerrit returns an empty response for /p/qt-creator/a/accounts/self @@ -310,7 +310,6 @@ bool GerritServer::resolveRoot() bool GerritServer::resolveVersion(const GerritParameters &p, bool forceReload) { - static GitClient *const client = GitClient::instance(); QSettings *settings = Core::ICore::settings(); const QString fullVersionKey = "Gerrit/" + host + '/' + versionKey; version = settings->value(fullVersionKey).toString(); @@ -321,8 +320,8 @@ bool GerritServer::resolveVersion(const GerritParameters &p, bool forceReload) if (port) arguments << p.portFlag << QString::number(port); arguments << hostArgument() << "gerrit" << "version"; - const CommandResult result = client->vcsSynchronousExec({}, {p.ssh, arguments}, - RunFlags::NoOutput); + const CommandResult result = gitClient().vcsSynchronousExec({}, {p.ssh, arguments}, + RunFlags::NoOutput); QString stdOut = result.cleanedStdOut().trimmed(); stdOut.remove("gerrit version "); version = stdOut; @@ -330,8 +329,8 @@ bool GerritServer::resolveVersion(const GerritParameters &p, bool forceReload) return false; } else { const QStringList arguments = curlArguments() << (url(RestUrl) + versionUrlC); - const CommandResult result = client->vcsSynchronousExec({}, {curlBinary, arguments}, - RunFlags::NoOutput); + const CommandResult result = gitClient().vcsSynchronousExec({}, {curlBinary, arguments}, + RunFlags::NoOutput); // REST endpoint for version is only available from 2.8 and up. Do not consider invalid // if it fails. if (result.result() == ProcessResult::FinishedWithSuccess) { diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index f544ad30b9b..53d738cbe82 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -82,8 +82,6 @@ using namespace VcsBase; namespace Git::Internal { -static GitClient *m_instance = nullptr; - static QString branchesDisplay(const QString &prefix, QStringList *branches, bool *first) { const int limit = 12; @@ -128,7 +126,7 @@ static void stage(DiffEditorController *diffController, const QString &patch, bo if (revert) args << "--reverse"; QString errorMessage; - if (GitClient::instance()->synchronousApplyPatch(baseDir, patchFile.fileName(), + if (gitClient().synchronousApplyPatch(baseDir, patchFile.fileName(), &errorMessage, args)) { if (errorMessage.isEmpty()) { if (revert) @@ -219,7 +217,7 @@ private: auto fixRightCommit = [this](const QString &commit) { if (!commit.isEmpty()) return commit; - if (m_instance->checkCommandInProgress(workingDirectory()) == GitClient::NoCommand) + if (gitClient().checkCommandInProgress(workingDirectory()) == GitClient::NoCommand) return QString(); return QString(HEAD); }; @@ -399,7 +397,7 @@ ShowController::ShowController(IDocument *document, const QString &id) }; const auto setupDescription = [this, id](Process &process) { - process.setCodec(m_instance->encoding(GitClient::EncodingCommit, workingDirectory())); + process.setCodec(gitClient().encoding(GitClient::EncodingCommit, workingDirectory())); setupCommand(process, {"show", "-s", noColorOption, showFormatC, id}); VcsOutputWindow::appendCommand(process.workingDirectory(), process.commandLine()); setDescription(Tr::tr("Waiting for data...")); @@ -499,7 +497,7 @@ ShowController::ShowController(IDocument *document, const QString &id) QStringList parents; QString errorMessage; // TODO: it's trivial now to call below asynchonously, too - m_instance->synchronousParentRevisions(workingDirectory(), data->m_commit, + gitClient().synchronousParentRevisions(workingDirectory(), data->m_commit, &parents, &errorMessage); data->m_follows = {busyMessage}; data->m_follows.resize(parents.size()); @@ -638,7 +636,7 @@ public: static bool gitHasRgbColors() { - const unsigned gitVersion = GitClient::instance()->gitVersion().result(); + const unsigned gitVersion = gitClient().gitVersion().result(); return gitVersion >= 0x020300U; } @@ -754,10 +752,10 @@ static void handleConflictResponse(const VcsBase::CommandResult &result, commit = errMatch.captured(1); if (commit.isEmpty() && files.isEmpty()) { - if (m_instance->checkCommandInProgress(workingDirectory) == GitClient::NoCommand) - m_instance->endStashScope(workingDirectory); + if (gitClient().checkCommandInProgress(workingDirectory) == GitClient::NoCommand) + gitClient().endStashScope(workingDirectory); } else { - m_instance->handleMergeConflicts(workingDirectory, commit, files, abortCommand); + gitClient().handleMergeConflicts(workingDirectory, commit, files, abortCommand); } } @@ -812,19 +810,21 @@ static inline void msgCannotRun(const QStringList &args, const FilePath &working // ---------------- GitClient +GitClient &gitClient() +{ + static GitClient client; + return client; +} + GitClient::GitClient() : VcsBase::VcsBaseClientImpl(&Internal::settings()) { - m_instance = this; m_gitQtcEditor = QString::fromLatin1("\"%1\" -client -block -pid %2") .arg(QCoreApplication::applicationFilePath()) .arg(QCoreApplication::applicationPid()); } -GitClient *GitClient::instance() -{ - return m_instance; -} +GitClient::~GitClient() = default; GitSettings &GitClient::settings() { @@ -3497,7 +3497,7 @@ bool GitClient::StashInfo::init(const FilePath &workingDirectory, const QString m_pushAction = pushAction; QString errorMessage; QString statusOutput; - switch (m_instance->gitStatus(m_workingDir, StatusMode(NoUntracked | NoSubmodules), + switch (gitClient().gitStatus(m_workingDir, StatusMode(NoUntracked | NoSubmodules), &statusOutput, &errorMessage)) { case GitClient::StatusChanged: if (m_flags & NoPrompt) @@ -3550,14 +3550,14 @@ void GitClient::StashInfo::stashPrompt(const QString &command, const QString &st msgBox.exec(); if (msgBox.clickedButton() == discardButton) { - m_stashResult = m_instance->synchronousReset(m_workingDir, QStringList(), errorMessage) ? + m_stashResult = gitClient().synchronousReset(m_workingDir, QStringList(), errorMessage) ? StashUnchanged : StashFailed; } else if (msgBox.clickedButton() == ignoreButton) { // At your own risk, so. m_stashResult = NotStashed; } else if (msgBox.clickedButton() == cancelButton) { m_stashResult = StashCanceled; } else if (msgBox.clickedButton() == stashButton) { - const bool result = m_instance->executeSynchronousStash( + const bool result = gitClient().executeSynchronousStash( m_workingDir, creatorStashMessage(command), false, errorMessage); m_stashResult = result ? StashUnchanged : StashFailed; } else if (msgBox.clickedButton() == stashAndPopButton) { @@ -3568,7 +3568,7 @@ void GitClient::StashInfo::stashPrompt(const QString &command, const QString &st void GitClient::StashInfo::executeStash(const QString &command, QString *errorMessage) { m_message = creatorStashMessage(command); - if (!m_instance->executeSynchronousStash(m_workingDir, m_message, false, errorMessage)) + if (!gitClient().executeSynchronousStash(m_workingDir, m_message, false, errorMessage)) m_stashResult = StashFailed; else m_stashResult = Stashed; @@ -3591,12 +3591,12 @@ void GitClient::StashInfo::end() { if (m_stashResult == Stashed) { QString stashName; - if (m_instance->stashNameFromMessage(m_workingDir, m_message, &stashName)) - m_instance->stashPop(m_workingDir, stashName); + if (gitClient().stashNameFromMessage(m_workingDir, m_message, &stashName)) + gitClient().stashPop(m_workingDir, stashName); } if (m_pushAction == NormalPush) - m_instance->push(m_workingDir); + gitClient().push(m_workingDir); else if (m_pushAction == PushToGerrit) GitPlugin::gerritPush(m_workingDir); @@ -3621,7 +3621,7 @@ QString GitClient::suggestedLocalBranchName( initialName = target.mid(target.lastIndexOf('/') + 1); } else { QString subject; - instance()->synchronousLog(workingDirectory, {"-n", "1", "--format=%s", target}, + gitClient().synchronousLog(workingDirectory, {"-n", "1", "--format=%s", target}, &subject, nullptr, RunFlags::NoOutput); initialName = subject.trimmed(); } @@ -3641,14 +3641,14 @@ void GitClient::addChangeActions(QMenu *menu, const FilePath &source, const QStr const FilePath &workingDir = fileWorkingDirectory(source); const bool isRange = change.contains(".."); menu->addAction(Tr::tr("Cherr&y-Pick %1").arg(change), [workingDir, change] { - m_instance->synchronousCherryPick(workingDir, change); + gitClient().synchronousCherryPick(workingDir, change); }); menu->addAction(Tr::tr("Re&vert %1").arg(change), [workingDir, change] { - m_instance->synchronousRevert(workingDir, change); + gitClient().synchronousRevert(workingDir, change); }); if (!isRange) { menu->addAction(Tr::tr("C&heckout %1").arg(change), [workingDir, change] { - m_instance->checkout(workingDir, change); + gitClient().checkout(workingDir, change); }); connect(menu->addAction(Tr::tr("&Interactive Rebase from %1...").arg(change)), &QAction::triggered, [workingDir, change] { @@ -3656,7 +3656,7 @@ void GitClient::addChangeActions(QMenu *menu, const FilePath &source, const QStr }); } QAction *logAction = menu->addAction(Tr::tr("&Log for %1").arg(change), [workingDir, change] { - m_instance->log(workingDir, QString(), false, {change}); + gitClient().log(workingDir, QString(), false, {change}); }); if (isRange) { menu->setDefaultAction(logAction); @@ -3665,13 +3665,13 @@ void GitClient::addChangeActions(QMenu *menu, const FilePath &source, const QStr if (!filePath.isDir()) { menu->addAction(Tr::tr("Sh&ow file \"%1\" on revision %2").arg(filePath.fileName(), change), [workingDir, change, source] { - m_instance->openShowEditor(workingDir, change, source); + gitClient().openShowEditor(workingDir, change, source); }); } menu->addAction(Tr::tr("Add &Tag for %1...").arg(change), [workingDir, change] { QString output; QString errorMessage; - m_instance->synchronousTagCmd(workingDir, QStringList(), &output, &errorMessage); + gitClient().synchronousTagCmd(workingDir, QStringList(), &output, &errorMessage); const QStringList tags = output.split('\n'); BranchAddDialog dialog(tags, BranchAddDialog::Type::AddTag, Core::ICore::dialogParent()); @@ -3679,7 +3679,7 @@ void GitClient::addChangeActions(QMenu *menu, const FilePath &source, const QStr if (dialog.exec() == QDialog::Rejected) return; - m_instance->synchronousTagCmd(workingDir, {dialog.branchName(), change}, + gitClient().synchronousTagCmd(workingDir, {dialog.branchName(), change}, &output, &errorMessage); VcsOutputWindow::append(output); if (!errorMessage.isEmpty()) @@ -3687,7 +3687,7 @@ void GitClient::addChangeActions(QMenu *menu, const FilePath &source, const QStr }); auto resetChange = [workingDir, change](const QByteArray &resetType) { - m_instance->reset(workingDir, QLatin1String("--" + resetType), change); + gitClient().reset(workingDir, QLatin1String("--" + resetType), change); }; auto resetMenu = new QMenu(Tr::tr("&Reset to Change %1").arg(change), menu); resetMenu->addAction(Tr::tr("&Hard"), std::bind(resetChange, "hard")); @@ -3698,18 +3698,18 @@ void GitClient::addChangeActions(QMenu *menu, const FilePath &source, const QStr menu->addAction((isRange ? Tr::tr("Di&ff %1") : Tr::tr("Di&ff Against %1")).arg(change), [workingDir, change] { - m_instance->diffRepository(workingDir, change, {}); + gitClient().diffRepository(workingDir, change, {}); }); if (!isRange) { - if (!m_instance->m_diffCommit.isEmpty()) { - menu->addAction(Tr::tr("Diff &Against Saved %1").arg(m_instance->m_diffCommit), + if (!gitClient().m_diffCommit.isEmpty()) { + menu->addAction(Tr::tr("Diff &Against Saved %1").arg(gitClient().m_diffCommit), [workingDir, change] { - m_instance->diffRepository(workingDir, m_instance->m_diffCommit, change); - m_instance->m_diffCommit.clear(); + gitClient().diffRepository(workingDir, gitClient().m_diffCommit, change); + gitClient().m_diffCommit.clear(); }); } menu->addAction(Tr::tr("&Save for Diff"), [change] { - m_instance->m_diffCommit = change; + gitClient().m_diffCommit = change; }); } } diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index f0875bed8ff..85e00f0a48a 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -120,7 +120,7 @@ public: }; GitClient(); - static GitClient *instance(); + ~GitClient(); Utils::FilePath vcsBinary() const override; QFuture<unsigned> gitVersion() const; @@ -406,6 +406,8 @@ private: bool m_disableEditor = false; }; +GITSHARED_EXPORT GitClient &gitClient(); + class GitRemote : public Core::IVersionControl::RepoUrl { public: diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index 106cd585686..76df05d53b1 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -224,7 +224,7 @@ void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, PatchAction patchAc if (patchAction == PatchAction::Revert) args << "--reverse"; QString errorMessage; - if (GitClient::instance()->synchronousApplyPatch(baseDir, patchFile.fileName(), &errorMessage, args)) { + if (gitClient().synchronousApplyPatch(baseDir, patchFile.fileName(), &errorMessage, args)) { if (errorMessage.isEmpty()) VcsOutputWindow::append(Tr::tr("Chunk successfully staged")); else @@ -244,7 +244,7 @@ void GitEditorWidget::init() const bool isRebaseEditor = editorId == Git::Constants::GIT_REBASE_EDITOR_ID; if (!isCommitEditor && !isRebaseEditor) return; - const QChar commentChar = GitClient::instance()->commentChar(source()); + const QChar commentChar = gitClient().commentChar(source()); if (isCommitEditor) textDocument()->setSyntaxHighlighter(new GitSubmitHighlighter(commentChar)); else if (isRebaseEditor) @@ -274,14 +274,14 @@ void GitEditorWidget::aboutToOpen(const FilePath &filePath, const FilePath &real || editorId == Git::Constants::GIT_REBASE_EDITOR_ID) { const FilePath gitPath = filePath.absolutePath(); setSource(gitPath); - textDocument()->setCodec(GitClient::instance()->encoding(GitClient::EncodingCommit, gitPath)); + textDocument()->setCodec(gitClient().encoding(GitClient::EncodingCommit, gitPath)); } } QString GitEditorWidget::decorateVersion(const QString &revision) const { // Format verbose, SHA1 being first token - return GitClient::instance()->synchronousShortDescription(sourceWorkingDirectory(), revision); + return gitClient().synchronousShortDescription(sourceWorkingDirectory(), revision); } QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision) const @@ -289,7 +289,7 @@ QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision) QStringList revisions; QString errorMessage; // Get the SHA1's of the file. - if (!GitClient::instance()->synchronousParentRevisions( + if (!gitClient().synchronousParentRevisions( sourceWorkingDirectory(), revision, &revisions, &errorMessage)) { VcsOutputWindow::appendSilently(errorMessage); return QStringList(); @@ -299,7 +299,7 @@ QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision) bool GitEditorWidget::isValidRevision(const QString &revision) const { - return GitClient::instance()->isValidRevision(revision); + return gitClient().isValidRevision(revision); } void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change) diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index b2e6e36a19d..c82226fa83b 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -135,8 +135,8 @@ static void runGitGrep(QPromise<SearchResultItems> &promise, const FileFindParam const GitGrepParameters &gitParameters) { const auto setupProcess = [¶meters, gitParameters](Process &process) { - const FilePath vcsBinary = GitClient::instance()->vcsBinary(); - const Environment environment = GitClient::instance()->processEnvironment(); + const FilePath vcsBinary = gitClient().vcsBinary(); + const Environment environment = gitClient().processEnvironment(); QStringList arguments = { "-c", "color.grep.match=bold red", @@ -189,7 +189,7 @@ static bool isGitDirectory(const FilePath &path) return gitVc == VcsManager::findVersionControlForDirectory(path); } -GitGrep::GitGrep(GitClient *client) +GitGrep::GitGrep() { m_widget = new QWidget; auto layout = new QHBoxLayout(m_widget); @@ -202,7 +202,7 @@ GitGrep::GitGrep(GitClient *client) m_treeLineEdit->setValidator(new QRegularExpressionValidator(refExpression, this)); layout->addWidget(m_treeLineEdit); // asynchronously check git version, add "recurse submodules" option if available - Utils::onResultReady(client->gitVersion(), this, + Utils::onResultReady(gitClient().gitVersion(), this, [this, pLayout = QPointer<QHBoxLayout>(layout)](unsigned version) { if (version >= 0x021300 && pLayout) { m_recurseSubmodules = new QCheckBox(Tr::tr("Recurse submodules")); @@ -271,7 +271,7 @@ EditorOpener GitGrep::editorOpener() const if (params.ref.isEmpty() || itemPath.isEmpty()) return nullptr; const FilePath path = FilePath::fromUserInput(itemPath.first()); - IEditor *editor = GitClient::instance()->openShowEditor( + IEditor *editor = gitClient().openShowEditor( parameters.searchDir, params.ref, path, GitClient::ShowEditor::OnlyIfDifferent); if (editor) editor->gotoLine(item.mainRange().begin.line, item.mainRange().begin.column); diff --git a/src/plugins/git/gitgrep.h b/src/plugins/git/gitgrep.h index c17151a480c..2f74cfa3322 100644 --- a/src/plugins/git/gitgrep.h +++ b/src/plugins/git/gitgrep.h @@ -13,13 +13,12 @@ namespace Utils { class FancyLineEdit; } namespace Git::Internal { -class GitClient; class GitGrepParameters; class GitGrep : public TextEditor::SearchEngine { public: - explicit GitGrep(GitClient *client); + GitGrep(); ~GitGrep() override; QString title() const override; diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 7d669c398ce..85e01f3e9aa 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -216,7 +216,7 @@ public: showAction->setIcon(Utils::Icons::ZOOM.icon()); showAction->setToolTip(TextEditor::Tr::tr("Show Commit %1").arg(info.sha1.left(8))); QObject::connect(showAction, &QAction::triggered, [info] { - GitClient::instance()->show(info.filePath, info.sha1); + gitClient().show(info.filePath, info.sha1); }); return QList<QAction *>{copyToClipboardAction, showAction}; }); @@ -267,7 +267,7 @@ public: bool vcsCreateRepository(const FilePath &directory) final; void vcsAnnotate(const FilePath &filePath, int line) final; - void vcsDescribe(const FilePath &source, const QString &id) final { m_gitClient.show(source, id); }; + void vcsDescribe(const FilePath &source, const QString &id) final { gitClient().show(source, id); } QString vcsTopic(const FilePath &directory) final; VcsCommand *createInitialCheckoutCommand(const QString &url, @@ -290,9 +290,9 @@ public: bool handleLink(const FilePath &workingDirectory, const QString &reference) final { if (reference.contains("..")) - GitClient::instance()->log(workingDirectory, {}, false, {reference}); + gitClient().log(workingDirectory, {}, false, {reference}); else - GitClient::instance()->show(workingDirectory, reference); + gitClient().show(workingDirectory, reference); return true; } @@ -422,7 +422,6 @@ public: ParameterAction *m_applyCurrentFilePatchAction = nullptr; Gerrit::Internal::GerritPlugin m_gerritPlugin; - GitClient m_gitClient; QPointer<StashDialog> m_stashDialog; BranchViewFactory m_branchViewFactory; QPointer<RemoteDialog> m_remoteDialog; @@ -438,7 +437,7 @@ public: QMetaObject::Connection m_blameCursorPosConn; QMetaObject::Connection m_documentChangedConn; - GitGrep gitGrep{&m_gitClient}; + GitGrep gitGrep; VcsEditorFactory svnLogEditorFactory { &svnLogEditorParameters, @@ -488,25 +487,20 @@ static GitPluginPrivate *dd = nullptr; class GitTopicCache : public IVersionControl::TopicCache { public: - GitTopicCache(GitClient *client) : - m_client(client) - { } + GitTopicCache() {} protected: FilePath trackFile(const FilePath &repository) override { - const FilePath gitDir = m_client->findGitDirForRepository(repository); + const FilePath gitDir = gitClient().findGitDirForRepository(repository); return gitDir.isEmpty() ? FilePath() : gitDir / "HEAD"; } QString refreshTopic(const FilePath &repository) override { emit dd->repositoryChanged(repository); - return m_client->synchronousTopic(repository); + return gitClient().synchronousTopic(repository); } - -private: - GitClient *m_client; }; GitPluginPrivate::~GitPluginPrivate() @@ -547,11 +541,6 @@ bool GitPluginPrivate::isCommitEditorOpen() const return !m_commitMessageFileName.isEmpty(); } -GitClient *GitPlugin::client() -{ - return &dd->m_gitClient; -} - IVersionControl *GitPlugin::versionControl() { return dd; @@ -670,7 +659,7 @@ QAction *GitPluginPrivate::createRepositoryAction(ActionContainer *ac, const QSt { auto cb = [this, func] { QTC_ASSERT(currentState().hasTopLevel(), return); - (m_gitClient.*func)(currentState().topLevel()); + (gitClient().*func)(currentState().topLevel()); }; // Set the member func as data and connect to GitClient method return createRepositoryAction(ac, text, id, context, addToLocator, cb, keys); @@ -701,12 +690,12 @@ GitPluginPrivate::GitPluginPrivate() { dd = this; - setTopicCache(new GitTopicCache(&m_gitClient)); + setTopicCache(new GitTopicCache); m_fileActions.reserve(10); m_projectActions.reserve(10); m_repositoryActions.reserve(50); - m_codec = GitClient::instance()->defaultCommitEncoding(); + m_codec = gitClient().defaultCommitEncoding(); Context context(Constants::GIT_CONTEXT); @@ -861,28 +850,28 @@ GitPluginPrivate::GitPluginPrivate() }; m_abortMergeAction = createAction(Tr::tr("Abort Merge", "Avoid translating \"Merge\""), "Git.MergeAbort", - std::bind(&GitClient::synchronousMerge, &m_gitClient, _1, QString("--abort"), true)); + std::bind(&GitClient::synchronousMerge, &gitClient(), _1, QString("--abort"), true)); m_abortRebaseAction = createAction(Tr::tr("Abort Rebase", "Avoid translating \"Rebase\""), "Git.RebaseAbort", - std::bind(&GitClient::rebase, &m_gitClient, _1, QString("--abort"))); + std::bind(&GitClient::rebase, &gitClient(), _1, QString("--abort"))); m_continueRebaseAction = createAction(Tr::tr("Continue Rebase"), "Git.RebaseContinue", - std::bind(&GitClient::rebase, &m_gitClient, _1, QString("--continue"))); + std::bind(&GitClient::rebase, &gitClient(), _1, QString("--continue"))); m_skipRebaseAction = createAction(Tr::tr("Skip Rebase"), "Git.RebaseSkip", - std::bind(&GitClient::rebase, &m_gitClient, _1, QString("--skip"))); + std::bind(&GitClient::rebase, &gitClient(), _1, QString("--skip"))); m_abortCherryPickAction = createAction(Tr::tr("Abort Cherry Pick", "Avoid translating \"Cherry Pick\""), "Git.CherryPickAbort", - std::bind(&GitClient::synchronousCherryPick, &m_gitClient, _1, QString("--abort"))); + std::bind(&GitClient::synchronousCherryPick, &gitClient(), _1, QString("--abort"))); m_continueCherryPickAction = createAction(Tr::tr("Continue Cherry Pick"), "Git.CherryPickContinue", - std::bind(&GitClient::cherryPick, &m_gitClient, _1, QString("--continue"))); + std::bind(&GitClient::cherryPick, &gitClient(), _1, QString("--continue"))); m_abortRevertAction = createAction(Tr::tr("Abort Revert", "Avoid translating \"Revert\""), "Git.RevertAbort", - std::bind(&GitClient::synchronousRevert, &m_gitClient, _1, QString("--abort"))); + std::bind(&GitClient::synchronousRevert, &gitClient(), _1, QString("--abort"))); m_continueRevertAction = createAction(Tr::tr("Continue Revert"), "Git.RevertContinue", - std::bind(&GitClient::revert, &m_gitClient, _1, QString("--continue"))); + std::bind(&GitClient::revert, &gitClient(), _1, QString("--continue"))); // -------------- localRepositoryMenu->addSeparator(context); @@ -1076,7 +1065,7 @@ void GitPluginPrivate::diffCurrentFile() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); - m_gitClient.diffFile(state.currentFileTopLevel(), state.relativeCurrentFile()); + gitClient().diffFile(state.currentFileTopLevel(), state.relativeCurrentFile()); } void GitPluginPrivate::diffCurrentProject() @@ -1085,16 +1074,16 @@ void GitPluginPrivate::diffCurrentProject() QTC_ASSERT(state.hasProject(), return); const QString relativeProject = state.relativeCurrentProject(); if (relativeProject.isEmpty()) - m_gitClient.diffRepository(state.currentProjectTopLevel()); + gitClient().diffRepository(state.currentProjectTopLevel()); else - m_gitClient.diffProject(state.currentProjectTopLevel(), relativeProject); + gitClient().diffProject(state.currentProjectTopLevel(), relativeProject); } void GitPluginPrivate::logFile() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); - m_gitClient.log(state.currentFileTopLevel(), state.relativeCurrentFile(), true); + gitClient().log(state.currentFileTopLevel(), state.relativeCurrentFile(), true); } void GitPluginPrivate::blameFile() @@ -1132,7 +1121,7 @@ void GitPluginPrivate::blameFile() const FilePath fileName = state.currentFile().canonicalPath(); FilePath topLevel; VcsManager::findVersionControlForDirectory(fileName.parentDir(), &topLevel); - m_gitClient.annotate(topLevel, fileName.relativeChildPath(topLevel).toString(), + gitClient().annotate(topLevel, fileName.relativeChildPath(topLevel).toString(), lineNumber, {}, extraOptions, firstLine); } @@ -1140,21 +1129,21 @@ void GitPluginPrivate::logProject() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return); - m_gitClient.log(state.currentProjectTopLevel(), state.relativeCurrentProject()); + gitClient().log(state.currentProjectTopLevel(), state.relativeCurrentProject()); } void GitPluginPrivate::logRepository() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - m_gitClient.log(state.topLevel()); + gitClient().log(state.topLevel()); } void GitPluginPrivate::reflogRepository() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - m_gitClient.reflog(state.topLevel()); + gitClient().reflog(state.topLevel()); } void GitPluginPrivate::undoFileChanges(bool revertStaging) @@ -1166,7 +1155,7 @@ void GitPluginPrivate::undoFileChanges(bool revertStaging) const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); FileChangeBlocker fcb(state.currentFile()); - m_gitClient.revertFiles({state.currentFile().toString()}, revertStaging); + gitClient().revertFiles({state.currentFile().toString()}, revertStaging); } class ResetItemDelegate : public LogItemDelegate @@ -1208,7 +1197,7 @@ void GitPluginPrivate::resetRepository() ResetItemDelegate delegate(dialog.widget()); dialog.setWindowTitle(Tr::tr("Undo Changes to %1").arg(topLevel.toUserOutput())); if (dialog.runDialog(topLevel, {}, LogChangeWidget::IncludeRemotes)) - m_gitClient.reset(topLevel, dialog.resetFlag(), dialog.commit()); + gitClient().reset(topLevel, dialog.resetFlag(), dialog.commit()); } void GitPluginPrivate::recoverDeletedFiles() @@ -1217,7 +1206,7 @@ void GitPluginPrivate::recoverDeletedFiles() return; const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - m_gitClient.recoverDeletedFiles(state.topLevel()); + gitClient().recoverDeletedFiles(state.topLevel()); } void GitPluginPrivate::startRebase() @@ -1233,7 +1222,7 @@ void GitPluginPrivate::startRebaseFromCommit(const FilePath &workingDirectory, Q { if (!DocumentManager::saveAllModifiedDocuments()) return; - if (workingDirectory.isEmpty() || !m_gitClient.canRebase(workingDirectory)) + if (workingDirectory.isEmpty() || !gitClient().canRebase(workingDirectory)) return; if (commit.isEmpty()) { @@ -1245,8 +1234,8 @@ void GitPluginPrivate::startRebaseFromCommit(const FilePath &workingDirectory, Q commit = dialog.commit(); } - if (m_gitClient.beginStashScope(workingDirectory, "Rebase-i")) - m_gitClient.interactiveRebase(workingDirectory, commit, false); + if (gitClient().beginStashScope(workingDirectory, "Rebase-i")) + gitClient().interactiveRebase(workingDirectory, commit, false); } void GitPluginPrivate::startChangeRelatedAction(const Id &id) @@ -1271,15 +1260,15 @@ void GitPluginPrivate::startChangeRelatedAction(const Id &id) const int colon = change.indexOf(':'); if (colon > 0) { const FilePath path = workingDirectory.resolvePath(change.mid(colon + 1)); - m_gitClient.openShowEditor(workingDirectory, change.left(colon), path); + gitClient().openShowEditor(workingDirectory, change.left(colon), path); } else { - m_gitClient.show(workingDirectory, change); + gitClient().show(workingDirectory, change); } return; } if (dialog.command() == Archive) { - m_gitClient.archive(workingDirectory, change); + gitClient().archive(workingDirectory, change); return; } @@ -1288,13 +1277,13 @@ void GitPluginPrivate::startChangeRelatedAction(const Id &id) switch (dialog.command()) { case CherryPick: - m_gitClient.synchronousCherryPick(workingDirectory, change); + gitClient().synchronousCherryPick(workingDirectory, change); break; case Revert: - m_gitClient.synchronousRevert(workingDirectory, change); + gitClient().synchronousRevert(workingDirectory, change); break; case Checkout: - m_gitClient.checkout(workingDirectory, change); + gitClient().checkout(workingDirectory, change); break; default: return; @@ -1305,21 +1294,21 @@ void GitPluginPrivate::stageFile() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); - m_gitClient.addFile(state.currentFileTopLevel(), state.relativeCurrentFile()); + gitClient().addFile(state.currentFileTopLevel(), state.relativeCurrentFile()); } void GitPluginPrivate::unstageFile() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); - m_gitClient.synchronousReset(state.currentFileTopLevel(), {state.relativeCurrentFile()}); + gitClient().synchronousReset(state.currentFileTopLevel(), {state.relativeCurrentFile()}); } void GitPluginPrivate::gitkForCurrentFile() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); - m_gitClient.launchGitK(state.currentFileTopLevel(), state.relativeCurrentFile()); + gitClient().launchGitK(state.currentFileTopLevel(), state.relativeCurrentFile()); } void GitPluginPrivate::gitkForCurrentFolder() @@ -1330,7 +1319,7 @@ void GitPluginPrivate::gitkForCurrentFolder() /* * entire lower part of the code can be easily replaced with one line: * - * m_gitClient.launchGitK(dir.currentFileDirectory(), "."); + * gitClient().launchGitK(dir.currentFileDirectory(), "."); * * However, there is a bug in gitk in version 1.7.9.5, and if you run above * command, there will be no documents listed in lower right section. @@ -1343,12 +1332,12 @@ void GitPluginPrivate::gitkForCurrentFolder() */ QDir dir(state.currentFileDirectory().toString()); if (QFileInfo(dir,".git").exists() || dir.cd(".git")) { - m_gitClient.launchGitK(state.currentFileDirectory()); + gitClient().launchGitK(state.currentFileDirectory()); } else { QString folderName = dir.absolutePath(); dir.cdUp(); folderName = folderName.remove(0, dir.absolutePath().length() + 1); - m_gitClient.launchGitK(FilePath::fromString(dir.absolutePath()), folderName); + gitClient().launchGitK(FilePath::fromString(dir.absolutePath()), folderName); } } @@ -1356,14 +1345,14 @@ void GitPluginPrivate::gitGui() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - m_gitClient.launchGitGui(state.topLevel()); + gitClient().launchGitGui(state.topLevel()); } void GitPluginPrivate::gitBash() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - m_gitClient.launchGitBash(state.topLevel()); + gitClient().launchGitBash(state.topLevel()); } void GitPluginPrivate::startCommit(CommitType commitType) @@ -1383,7 +1372,7 @@ void GitPluginPrivate::startCommit(CommitType commitType) QString errorMessage, commitTemplate; CommitData data(commitType); - if (!m_gitClient.getCommitData(state.topLevel(), &commitTemplate, data, &errorMessage)) { + if (!gitClient().getCommitData(state.topLevel(), &commitTemplate, data, &errorMessage)) { VcsOutputWindow::appendError(errorMessage); return; } @@ -1410,7 +1399,7 @@ void GitPluginPrivate::updateVersionWarning() QPointer<IDocument> curDocument = EditorManager::currentDocument(); if (!curDocument) return; - Utils::onResultReady(m_gitClient.gitVersion(), this, [curDocument](unsigned version) { + Utils::onResultReady(gitClient().gitVersion(), this, [curDocument](unsigned version) { if (!curDocument || !version || version >= minimumRequiredVersion) return; InfoBar *infoBar = curDocument->infoBar(); @@ -1585,7 +1574,7 @@ void GitPluginPrivate::instantBlame() const CommitInfo info = parseBlameOutput(output.split('\n'), filePath, m_author); m_blameMark.reset(new BlameMark(filePath, line, info)); }; - GitClient::instance()->vcsExecWithHandler(workingDirectory, + gitClient().vcsExecWithHandler(workingDirectory, {"blame", "-p", "-L", lineString, "--", filePath.toString()}, this, commandHandler, RunFlags::NoOutput, m_codec); } @@ -1615,7 +1604,7 @@ bool GitPluginPrivate::refreshWorkingDirectory(const FilePath &workingDirectory) const QString codecName = result.cleanedStdOut().trimmed(); codec = QTextCodec::codecForName(codecName.toUtf8()); } else { - codec = GitClient::instance()->defaultCommitEncoding(); + codec = gitClient().defaultCommitEncoding(); } if (m_codec != codec) { @@ -1623,13 +1612,13 @@ bool GitPluginPrivate::refreshWorkingDirectory(const FilePath &workingDirectory) forceInstantBlame(); } }; - GitClient::instance()->readConfigAsync(workingDirectory, {"config", "i18n.commitEncoding"}, + gitClient().readConfigAsync(workingDirectory, {"config", "i18n.commitEncoding"}, commitCodecHandler); const auto authorHandler = [this, workingDirectory](const CommandResult &result) { if (result.result() == ProcessResult::FinishedWithSuccess) { const QString authorInfo = result.cleanedStdOut().trimmed(); - const Author author = GitClient::instance()->parseAuthor(authorInfo); + const Author author = gitClient().parseAuthor(authorInfo); if (m_author != author) { m_author = author; @@ -1637,7 +1626,7 @@ bool GitPluginPrivate::refreshWorkingDirectory(const FilePath &workingDirectory) } } }; - GitClient::instance()->readConfigAsync(workingDirectory, {"var", "GIT_AUTHOR_IDENT"}, + gitClient().readConfigAsync(workingDirectory, {"var", "GIT_AUTHOR_IDENT"}, authorHandler); return true; @@ -1693,7 +1682,7 @@ bool GitPluginPrivate::activateCommit() if (!DocumentManager::saveDocument(editorDocument)) return false; - if (!m_gitClient.addAndCommit(m_submitRepository, editor->panelData(), commitType, + if (!gitClient().addAndCommit(m_submitRepository, editor->panelData(), commitType, amendSHA1, m_commitMessageFileName, model)) { editor->updateFileModel(); return false; @@ -1701,15 +1690,15 @@ bool GitPluginPrivate::activateCommit() } cleanCommitMessageFile(); if (commitType == FixupCommit) { - if (!m_gitClient.beginStashScope(m_submitRepository, "Rebase-fixup", + if (!gitClient().beginStashScope(m_submitRepository, "Rebase-fixup", NoPrompt, editor->panelData().pushAction)) { return false; } - m_gitClient.interactiveRebase(m_submitRepository, amendSHA1, true); + gitClient().interactiveRebase(m_submitRepository, amendSHA1, true); } else { - m_gitClient.continueCommandIfNeeded(m_submitRepository); + gitClient().continueCommandIfNeeded(m_submitRepository); if (editor->panelData().pushAction == NormalPush) { - m_gitClient.push(m_submitRepository); + gitClient().push(m_submitRepository); } else if (editor->panelData().pushAction == PushToGerrit) { connect(editor, &QObject::destroyed, this, &GitPluginPrivate::delayedPushToGerrit, Qt::QueuedConnection); @@ -1721,7 +1710,7 @@ bool GitPluginPrivate::activateCommit() void GitPluginPrivate::fetch() { - m_gitClient.fetch(currentState().topLevel(), {}); + gitClient().fetch(currentState().topLevel(), {}); } void GitPluginPrivate::pull() @@ -1734,31 +1723,31 @@ void GitPluginPrivate::pull() bool rebase = settings().pullRebase(); if (!rebase) { - QString currentBranch = m_gitClient.synchronousCurrentLocalBranch(topLevel); + QString currentBranch = gitClient().synchronousCurrentLocalBranch(topLevel); if (!currentBranch.isEmpty()) { currentBranch.prepend("branch."); currentBranch.append(".rebase"); - rebase = (m_gitClient.readConfigValue(topLevel, currentBranch) == "true"); + rebase = (gitClient().readConfigValue(topLevel, currentBranch) == "true"); } } - if (!m_gitClient.beginStashScope(topLevel, "Pull", rebase ? Default : AllowUnstashed)) + if (!gitClient().beginStashScope(topLevel, "Pull", rebase ? Default : AllowUnstashed)) return; - m_gitClient.pull(topLevel, rebase); + gitClient().pull(topLevel, rebase); } void GitPluginPrivate::push() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - m_gitClient.push(state.topLevel()); + gitClient().push(state.topLevel()); } void GitPluginPrivate::startMergeTool() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - m_gitClient.merge(state.topLevel()); + gitClient().merge(state.topLevel()); } void GitPluginPrivate::cleanProject() @@ -1782,7 +1771,7 @@ void GitPluginPrivate::cleanRepository(const FilePath &directory) QStringList files; QStringList ignoredFiles; QApplication::setOverrideCursor(Qt::WaitCursor); - const bool gotFiles = m_gitClient.synchronousCleanList(directory, {}, &files, &ignoredFiles, + const bool gotFiles = gitClient().synchronousCleanList(directory, {}, &files, &ignoredFiles, &errorMessage); QApplication::restoreOverrideCursor(); @@ -1806,7 +1795,7 @@ void GitPluginPrivate::updateSubmodules() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - m_gitClient.updateSubmodulesIfNeeded(state.topLevel(), false); + gitClient().updateSubmodulesIfNeeded(state.topLevel(), false); } // If the file is modified in an editor, make sure it is saved. @@ -1836,20 +1825,20 @@ void GitPluginPrivate::promptApplyPatch() void GitPluginPrivate::applyPatch(const FilePath &workingDirectory, QString file) { // Ensure user has been notified about pending changes - if (!m_gitClient.beginStashScope(workingDirectory, "Apply-Patch", AllowUnstashed)) + if (!gitClient().beginStashScope(workingDirectory, "Apply-Patch", AllowUnstashed)) return; // Prompt for file if (file.isEmpty()) { const QString filter = Tr::tr("Patches (*.patch *.diff)"); file = QFileDialog::getOpenFileName(ICore::dialogParent(), Tr::tr("Choose Patch"), {}, filter); if (file.isEmpty()) { - m_gitClient.endStashScope(workingDirectory); + gitClient().endStashScope(workingDirectory); return; } } // Run! QString errorMessage; - if (m_gitClient.synchronousApplyPatch(workingDirectory, file, &errorMessage)) { + if (gitClient().synchronousApplyPatch(workingDirectory, file, &errorMessage)) { if (errorMessage.isEmpty()) VcsOutputWindow::appendMessage(Tr::tr("Patch %1 successfully applied to %2") .arg(file, workingDirectory.toUserOutput())); @@ -1858,7 +1847,7 @@ void GitPluginPrivate::applyPatch(const FilePath &workingDirectory, QString file } else { VcsOutputWindow::appendError(errorMessage); } - m_gitClient.endStashScope(workingDirectory); + gitClient().endStashScope(workingDirectory); } void GitPluginPrivate::stash(bool unstagedOnly) @@ -1870,7 +1859,7 @@ void GitPluginPrivate::stash(bool unstagedOnly) QTC_ASSERT(state.hasTopLevel(), return); const FilePath topLevel = state.topLevel(); - m_gitClient.executeSynchronousStash(topLevel, {}, unstagedOnly); + gitClient().executeSynchronousStash(topLevel, {}, unstagedOnly); if (m_stashDialog) m_stashDialog->refresh(topLevel, true); } @@ -1885,7 +1874,7 @@ void GitPluginPrivate::stashSnapshot() // Prompt for description, restore immediately and keep on working. const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - const QString id = m_gitClient.synchronousStash(state.topLevel(), {}, + const QString id = gitClient().synchronousStash(state.topLevel(), {}, GitClient::StashImmediateRestore | GitClient::StashPromptDescription); if (!id.isEmpty() && m_stashDialog) m_stashDialog->refresh(state.topLevel(), true); @@ -1896,7 +1885,7 @@ void GitPluginPrivate::stashPop() if (!DocumentManager::saveAllModifiedDocuments()) return; const FilePath repository = currentState().topLevel(); - m_gitClient.stashPop(repository); + gitClient().stashPop(repository); if (m_stashDialog) m_stashDialog->refresh(repository, true); } @@ -1970,7 +1959,7 @@ void GitPluginPrivate::updateActions(VcsBasePluginPrivate::ActionState as) repositoryAction->setEnabled(repositoryEnabled); m_submoduleUpdateAction->setVisible(repositoryEnabled - && !m_gitClient.submoduleList(state.topLevel()).isEmpty()); + && !gitClient().submoduleList(state.topLevel()).isEmpty()); updateContinueAndAbortCommands(); updateRepositoryBrowserAction(); @@ -1982,7 +1971,7 @@ void GitPluginPrivate::updateContinueAndAbortCommands() { if (currentState().hasTopLevel()) { GitClient::CommandInProgress gitCommandInProgress = - m_gitClient.checkCommandInProgress(currentState().topLevel()); + gitClient().checkCommandInProgress(currentState().topLevel()); m_mergeToolAction->setVisible(gitCommandInProgress != GitClient::NoCommand); m_abortMergeAction->setVisible(gitCommandInProgress == GitClient::Merge); @@ -2035,7 +2024,7 @@ QObject *GitPlugin::remoteCommand(const QStringList &options, const QString &wor return nullptr; if (options.first() == "-git-show") - dd->m_gitClient.show(FilePath::fromUserInput(workingDirectory), options.at(1)); + gitClient().show(FilePath::fromUserInput(workingDirectory), options.at(1)); return nullptr; } @@ -2070,7 +2059,7 @@ bool GitPluginPrivate::isVcsFileOrDirectory(const FilePath &filePath) const bool GitPluginPrivate::isConfigured() const { - return !m_gitClient.vcsBinary().isEmpty(); + return !gitClient().vcsBinary().isEmpty(); } bool GitPluginPrivate::supportsOperation(Operation operation) const @@ -2098,30 +2087,30 @@ bool GitPluginPrivate::vcsOpen(const FilePath & /*filePath*/) bool GitPluginPrivate::vcsAdd(const FilePath &filePath) { - return m_gitClient.synchronousAdd(filePath.parentDir(), {filePath.fileName()}, {"--intent-to-add"}); + return gitClient().synchronousAdd(filePath.parentDir(), {filePath.fileName()}, {"--intent-to-add"}); } bool GitPluginPrivate::vcsDelete(const FilePath &filePath) { - return m_gitClient.synchronousDelete(filePath.absolutePath(), true, {filePath.fileName()}); + return gitClient().synchronousDelete(filePath.absolutePath(), true, {filePath.fileName()}); } bool GitPluginPrivate::vcsMove(const FilePath &from, const FilePath &to) { const QFileInfo fromInfo = from.toFileInfo(); const QFileInfo toInfo = to.toFileInfo(); - return m_gitClient.synchronousMove(from.absolutePath(), fromInfo.absoluteFilePath(), toInfo.absoluteFilePath()); + return gitClient().synchronousMove(from.absolutePath(), fromInfo.absoluteFilePath(), toInfo.absoluteFilePath()); } bool GitPluginPrivate::vcsCreateRepository(const FilePath &directory) { - return m_gitClient.synchronousInit(directory); + return gitClient().synchronousInit(directory); } QString GitPluginPrivate::vcsTopic(const FilePath &directory) { QString topic = IVersionControl::vcsTopic(directory); - const QString commandInProgress = m_gitClient.commandInProgressDescription(directory); + const QString commandInProgress = gitClient().commandInProgressDescription(directory); if (!commandInProgress.isEmpty()) topic += " (" + commandInProgress + ')'; return topic; @@ -2135,9 +2124,9 @@ VcsCommand *GitPluginPrivate::createInitialCheckoutCommand(const QString &url, QStringList args = {"clone", "--progress"}; args << extraArgs << url << localName; - auto command = VcsBaseClient::createVcsCommand(baseDirectory, m_gitClient.processEnvironment()); + auto command = VcsBaseClient::createVcsCommand(baseDirectory, gitClient().processEnvironment()); command->addFlags(RunFlags::SuppressStdErr); - command->addJob({m_gitClient.vcsBinary(), args}, -1); + command->addJob({gitClient().vcsBinary(), args}, -1); return command; } @@ -2149,7 +2138,7 @@ GitPluginPrivate::RepoUrl GitPluginPrivate::getRepoUrl(const QString &location) FilePaths GitPluginPrivate::additionalToolsPath() const { FilePaths res = settings().searchPathList(); - const FilePath binaryPath = m_gitClient.gitBinDirectory(); + const FilePath binaryPath = gitClient().gitBinDirectory(); if (!binaryPath.isEmpty() && !res.contains(binaryPath)) res << binaryPath; return res; @@ -2157,7 +2146,7 @@ FilePaths GitPluginPrivate::additionalToolsPath() const bool GitPluginPrivate::managesDirectory(const FilePath &directory, FilePath *topLevel) const { - const FilePath topLevelFound = m_gitClient.findRepositoryForDirectory(directory); + const FilePath topLevelFound = gitClient().findRepositoryForDirectory(directory); if (topLevel) *topLevel = topLevelFound; return !topLevelFound.isEmpty(); @@ -2165,17 +2154,17 @@ bool GitPluginPrivate::managesDirectory(const FilePath &directory, FilePath *top bool GitPluginPrivate::managesFile(const FilePath &workingDirectory, const QString &fileName) const { - return m_gitClient.managesFile(workingDirectory, fileName); + return gitClient().managesFile(workingDirectory, fileName); } FilePaths GitPluginPrivate::unmanagedFiles(const FilePaths &filePaths) const { - return m_gitClient.unmanagedFiles(filePaths); + return gitClient().unmanagedFiles(filePaths); } void GitPluginPrivate::vcsAnnotate(const FilePath &filePath, int line) { - m_gitClient.annotate(filePath.absolutePath(), filePath.fileName(), line); + gitClient().annotate(filePath.absolutePath(), filePath.fileName(), line); } void GitPlugin::emitFilesChanged(const QStringList &l) diff --git a/src/plugins/git/gitplugin.h b/src/plugins/git/gitplugin.h index 59d9a87fdec..00005d855e5 100644 --- a/src/plugins/git/gitplugin.h +++ b/src/plugins/git/gitplugin.h @@ -17,8 +17,6 @@ namespace VcsBase { class VcsBasePluginState; } namespace Git::Internal { -class GitClient; - class GITSHARED_EXPORT GitPlugin final : public ExtensionSystem::IPlugin { Q_OBJECT @@ -33,7 +31,6 @@ public: QObject *remoteCommand(const QStringList &options, const QString &workingDirectory, const QStringList &args) final; - static GitClient *client(); static Core::IVersionControl *versionControl(); static const VcsBase::VcsBasePluginState ¤tState(); diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp index 88bc91616f7..ba663635750 100644 --- a/src/plugins/git/gitsubmiteditor.cpp +++ b/src/plugins/git/gitsubmiteditor.cpp @@ -69,7 +69,7 @@ CommitDataFetchResult CommitDataFetchResult::fetch(CommitType commitType, const CommitDataFetchResult result; result.commitData.commitType = commitType; QString commitTemplate; - result.success = GitClient::instance()->getCommitData( + result.success = gitClient().getCommitData( workingDirectory, &commitTemplate, result.commitData, &result.errorMessage); return result; } @@ -181,15 +181,15 @@ void GitSubmitEditor::slotDiffSelected(const QList<int> &rows) } } if (!unstagedFiles.empty() || !stagedFiles.empty()) - GitClient::instance()->diffFiles(m_workingDirectory, unstagedFiles, stagedFiles); + gitClient().diffFiles(m_workingDirectory, unstagedFiles, stagedFiles); if (!unmergedFiles.empty()) - GitClient::instance()->merge(m_workingDirectory, unmergedFiles); + gitClient().merge(m_workingDirectory, unmergedFiles); } void GitSubmitEditor::showCommit(const QString &commit) { if (!m_workingDirectory.isEmpty()) - GitClient::instance()->show(m_workingDirectory, commit); + gitClient().show(m_workingDirectory, commit); } void GitSubmitEditor::updateFileModel() diff --git a/src/plugins/git/logchangedialog.cpp b/src/plugins/git/logchangedialog.cpp index 75660c11897..35f90abdadc 100644 --- a/src/plugins/git/logchangedialog.cpp +++ b/src/plugins/git/logchangedialog.cpp @@ -47,7 +47,7 @@ public: const auto it = m_descriptions.constFind(revision); if (it != m_descriptions.constEnd()) return *it; - const QString desc = QString::fromUtf8(GitClient::instance()->synchronousShow( + const QString desc = QString::fromUtf8(gitClient().synchronousShow( m_workingDirectory, revision, RunFlags::NoOutput)); m_descriptions[revision] = desc; return desc; @@ -170,7 +170,7 @@ bool LogChangeWidget::populateLog(const FilePath &repository, const QString &com } arguments << "--"; QString output; - if (!GitClient::instance()->synchronousLog( + if (!gitClient().synchronousLog( repository, arguments, &output, nullptr, RunFlags::NoOutput)) { return false; } diff --git a/src/plugins/git/mergetool.cpp b/src/plugins/git/mergetool.cpp index 6fbc9d5ea83..62a24bd93a6 100644 --- a/src/plugins/git/mergetool.cpp +++ b/src/plugins/git/mergetool.cpp @@ -37,7 +37,7 @@ void MergeTool::start(const FilePath &workingDirectory, const QStringList &files { QStringList arguments; arguments << "mergetool" << "-y" << files; - const CommandLine cmd = {GitClient::instance()->vcsBinary(), arguments}; + const CommandLine cmd = {gitClient().vcsBinary(), arguments}; VcsOutputWindow::appendCommand(workingDirectory, cmd); m_process.setCommand(cmd); m_process.setWorkingDirectory(workingDirectory); @@ -224,7 +224,7 @@ void MergeTool::done() VcsOutputWindow::appendError(m_process.exitMessage()); const FilePath workingDirectory = m_process.workingDirectory(); - GitClient::instance()->continueCommandIfNeeded(workingDirectory, success); + gitClient().continueCommandIfNeeded(workingDirectory, success); GitPlugin::emitRepositoryChanged(workingDirectory); deleteLater(); } diff --git a/src/plugins/git/remotedialog.cpp b/src/plugins/git/remotedialog.cpp index 25d0f76af25..7c1f55a62ad 100644 --- a/src/plugins/git/remotedialog.cpp +++ b/src/plugins/git/remotedialog.cpp @@ -248,7 +248,7 @@ void RemoteDialog::pushToRemote() const int row = indexList.at(0).row(); const QString remoteName = m_remoteModel->remoteName(row); - GitClient::instance()->push(m_remoteModel->workingDirectory(), {remoteName}); + gitClient().push(m_remoteModel->workingDirectory(), {remoteName}); } void RemoteDialog::fetchFromRemote() @@ -259,7 +259,7 @@ void RemoteDialog::fetchFromRemote() int row = indexList.at(0).row(); const QString remoteName = m_remoteModel->remoteName(row); - GitClient::instance()->fetch(m_remoteModel->workingDirectory(), remoteName); + gitClient().fetch(m_remoteModel->workingDirectory(), remoteName); } void RemoteDialog::updateButtonState() diff --git a/src/plugins/git/remotemodel.cpp b/src/plugins/git/remotemodel.cpp index 908f0cff134..e5ba743ee8e 100644 --- a/src/plugins/git/remotemodel.cpp +++ b/src/plugins/git/remotemodel.cpp @@ -34,7 +34,7 @@ bool RemoteModel::removeRemote(int row) { QString output; QString error; - bool success = GitClient::instance()->synchronousRemoteCmd( + bool success = gitClient().synchronousRemoteCmd( m_workingDirectory, {"rm", remoteName(row)}, &output, &error); if (success) success = refresh(m_workingDirectory, &error); @@ -48,7 +48,7 @@ bool RemoteModel::addRemote(const QString &name, const QString &url) if (name.isEmpty() || url.isEmpty()) return false; - bool success = GitClient::instance()->synchronousRemoteCmd( + bool success = gitClient().synchronousRemoteCmd( m_workingDirectory, {"add", name, url}, &output, &error); if (success) success = refresh(m_workingDirectory, &error); @@ -59,7 +59,7 @@ bool RemoteModel::renameRemote(const QString &oldName, const QString &newName) { QString output; QString error; - bool success = GitClient::instance()->synchronousRemoteCmd( + bool success = gitClient().synchronousRemoteCmd( m_workingDirectory, {"rename", oldName, newName}, &output, &error); if (success) success = refresh(m_workingDirectory, &error); @@ -70,7 +70,7 @@ bool RemoteModel::updateUrl(const QString &name, const QString &newUrl) { QString output; QString error; - bool success = GitClient::instance()->synchronousRemoteCmd( + bool success = gitClient().synchronousRemoteCmd( m_workingDirectory, {"set-url", name, newUrl}, &output, &error); if (success) success = refresh(m_workingDirectory, &error); @@ -165,7 +165,7 @@ bool RemoteModel::refresh(const FilePath &workingDirectory, QString *errorMessag // get list of remotes. QMap<QString,QString> remotesList - = GitClient::instance()->synchronousRemotesList(workingDirectory, errorMessage); + = gitClient().synchronousRemotesList(workingDirectory, errorMessage); beginResetModel(); m_remotes.clear(); diff --git a/src/plugins/git/stashdialog.cpp b/src/plugins/git/stashdialog.cpp index 195d6622d9a..3dc92249d93 100644 --- a/src/plugins/git/stashdialog.cpp +++ b/src/plugins/git/stashdialog.cpp @@ -171,7 +171,7 @@ void StashDialog::refresh(const FilePath &repository, bool force) m_model->setStashes(QList<Stash>()); } else { QList<Stash> stashes; - GitClient::instance()->synchronousStashList(m_repository, &stashes); + gitClient().synchronousStashList(m_repository, &stashes); m_model->setStashes(stashes); if (!stashes.isEmpty()) { for (int c = 0; c < ColumnCount; c++) @@ -187,7 +187,7 @@ void StashDialog::deleteAll() if (!ask(title, Tr::tr("Do you want to delete all stashes?"))) return; QString errorMessage; - if (GitClient::instance()->synchronousStashRemove(m_repository, QString(), &errorMessage)) + if (gitClient().synchronousStashRemove(m_repository, QString(), &errorMessage)) refresh(m_repository, true); else warning(title, errorMessage); @@ -204,7 +204,7 @@ void StashDialog::deleteSelection() QStringList errors; // Delete in reverse order as stashes rotate for (int r = rows.size() - 1; r >= 0; r--) - if (!GitClient::instance()->synchronousStashRemove(m_repository, m_model->at(rows.at(r)).name, &errorMessage)) + if (!gitClient().synchronousStashRemove(m_repository, m_model->at(rows.at(r)).name, &errorMessage)) errors.push_back(errorMessage); refresh(m_repository, true); if (!errors.isEmpty()) @@ -215,7 +215,7 @@ void StashDialog::showCurrent() { const int index = currentRow(); QTC_ASSERT(index >= 0, return); - GitClient::instance()->show(m_repository, QString(m_model->at(index).name)); + gitClient().show(m_repository, QString(m_model->at(index).name)); } // Suggest Branch name to restore 'stash@{0}' -> 'stash0-date' @@ -276,7 +276,7 @@ bool StashDialog::promptForRestore(QString *stash, { const QString stashIn = *stash; bool modifiedPromptShown = false; - switch (GitClient::instance()->gitStatus( + switch (gitClient().gitStatus( m_repository, StatusMode(NoUntracked | NoSubmodules), nullptr, errorMessage)) { case GitClient::StatusFailed: return false; @@ -285,7 +285,7 @@ bool StashDialog::promptForRestore(QString *stash, case ModifiedRepositoryCancel: return false; case ModifiedRepositoryStash: - if (GitClient::instance()->synchronousStash( + if (gitClient().synchronousStash( m_repository, QString(), GitClient::StashPromptDescription).isEmpty()) { return false; } @@ -293,7 +293,7 @@ bool StashDialog::promptForRestore(QString *stash, QTC_ASSERT(!stash->isEmpty(), return false); break; case ModifiedRepositoryDiscard: - if (!GitClient::instance()->synchronousReset(m_repository)) + if (!gitClient().synchronousReset(m_repository)) return false; break; } @@ -330,7 +330,7 @@ void StashDialog::restoreCurrent() // Make sure repository is not modified, restore. The command will // output to window on success. if (promptForRestore(&name, nullptr, &errorMessage) - && GitClient::instance()->synchronousStashRestore(m_repository, name)) { + && gitClient().synchronousStashRestore(m_repository, name)) { refresh(m_repository, true); // Might have stashed away local changes. } else if (!errorMessage.isEmpty()) { warning(msgRestoreFailedTitle(name), errorMessage); @@ -345,7 +345,7 @@ void StashDialog::restoreCurrentInBranch() QString branch; QString name = m_model->at(index).name; if (promptForRestore(&name, &branch, &errorMessage) - && GitClient::instance()->synchronousStashRestore(m_repository, name, false, branch)) { + && gitClient().synchronousStashRestore(m_repository, name, false, branch)) { refresh(m_repository, true); // git deletes the stash, unfortunately. } else if (!errorMessage.isEmpty()) { warning(msgRestoreFailedTitle(name), errorMessage); diff --git a/src/plugins/gitlab/gitlabprojectsettings.cpp b/src/plugins/gitlab/gitlabprojectsettings.cpp index 240f5292e4f..b5bb12942b4 100644 --- a/src/plugins/gitlab/gitlabprojectsettings.cpp +++ b/src/plugins/gitlab/gitlabprojectsettings.cpp @@ -246,13 +246,13 @@ void GitLabProjectSettingsWidget::updateUi() } const Utils::FilePath projectDirectory = m_projectSettings->project()->projectDirectory(); - const auto *gitClient = Git::Internal::GitClient::instance(); - const Utils::FilePath repository = gitClient - ? gitClient->findRepositoryForDirectory(projectDirectory) : Utils::FilePath(); + const Utils::FilePath repository = + Git::Internal::gitClient().findRepositoryForDirectory(projectDirectory); m_hostCB->clear(); if (!repository.isEmpty()) { - const QMap<QString, QString> remotes = gitClient->synchronousRemotesList(repository); + const QMap<QString, QString> remotes = + Git::Internal::gitClient().synchronousRemotesList(repository); for (auto it = remotes.begin(), end = remotes.end(); it != end; ++it) { const QString display = it.key() + " (" + it.value() + ')'; m_hostCB->addItem(display, QVariant::fromValue(it.value())); @@ -291,9 +291,8 @@ void GitLabProjectSettingsWidget::updateEnabledStates() m_checkConnection->setEnabled(isGitRepository && hasGitLabServers); if (!isGitRepository) { const Utils::FilePath projectDirectory = m_projectSettings->project()->projectDirectory(); - const auto *gitClient = Git::Internal::GitClient::instance(); - const Utils::FilePath repository = gitClient - ? gitClient->findRepositoryForDirectory(projectDirectory) : Utils::FilePath(); + const Utils::FilePath repository = + Git::Internal::gitClient().findRepositoryForDirectory(projectDirectory); if (repository.isEmpty()) m_infoLabel->setText(Tr::tr("Not a git repository.")); else From a478b9682e36fea5825f76d3239f94ce52681c1a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 12:15:28 +0200 Subject: [PATCH 0505/1777] Utils: Introduce a helper function to prepend or set paths This is meant for cases where we get a raw ':'/';' separated list of directories. Change-Id: I9ef8888f71700d553213949a867f62dec763054c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/environment.cpp | 5 +++++ src/libs/utils/environment.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index 2fe99fb97f5..4af5399a7af 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -149,6 +149,11 @@ void Environment::prependOrSetPath(const FilePath &value) prependOrSet("PATH", value.nativePath(), OsSpecificAspects::pathListSeparator(osType())); } +void Environment::prependOrSetPath(const QString &directories) +{ + prependOrSet("PATH", directories, OsSpecificAspects::pathListSeparator(osType())); +} + void Environment::appendOrSet(const QString &key, const QString &value, const QString &sep) { addItem(Item{std::in_place_index_t<AppendOrSet>(), key, value, sep}); diff --git a/src/libs/utils/environment.h b/src/libs/utils/environment.h index 479778e4ce7..06ac5d20a5c 100644 --- a/src/libs/utils/environment.h +++ b/src/libs/utils/environment.h @@ -48,6 +48,7 @@ public: void appendOrSetPath(const FilePath &value); void prependOrSetPath(const FilePath &value); + void prependOrSetPath(const QString &directories); // Could be several ':'/';' separated entries. void prependOrSetLibrarySearchPath(const FilePath &value); void prependOrSetLibrarySearchPaths(const FilePaths &values); From 86e11befca98ad972bdb51a3d9c48e8afab3fc5b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 25 Jul 2023 13:55:32 +0200 Subject: [PATCH 0506/1777] Perf: Move config widget setup closer to settingspage Change-Id: Idda753dc07103dc0f6d0c3ff9759d0ff083ac2d9 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/perfprofiler/CMakeLists.txt | 1 - src/plugins/perfprofiler/perfconfigwidget.cpp | 369 ------------------ src/plugins/perfprofiler/perfconfigwidget.h | 50 --- src/plugins/perfprofiler/perfprofiler.qbs | 2 - src/plugins/perfprofiler/perfprofilertool.cpp | 8 +- src/plugins/perfprofiler/perfsettings.cpp | 364 ++++++++++++++++- src/plugins/perfprofiler/perfsettings.h | 2 + 7 files changed, 363 insertions(+), 433 deletions(-) delete mode 100644 src/plugins/perfprofiler/perfconfigwidget.cpp delete mode 100644 src/plugins/perfprofiler/perfconfigwidget.h diff --git a/src/plugins/perfprofiler/CMakeLists.txt b/src/plugins/perfprofiler/CMakeLists.txt index 7140042f565..360ee8a7ee9 100644 --- a/src/plugins/perfprofiler/CMakeLists.txt +++ b/src/plugins/perfprofiler/CMakeLists.txt @@ -10,7 +10,6 @@ endif() set(PERFPROFILER_CPP_SOURCES perfconfigeventsmodel.cpp perfconfigeventsmodel.h - perfconfigwidget.cpp perfconfigwidget.h perfdatareader.cpp perfdatareader.h perfevent.h perfeventtype.h diff --git a/src/plugins/perfprofiler/perfconfigwidget.cpp b/src/plugins/perfprofiler/perfconfigwidget.cpp deleted file mode 100644 index e5e3fd37256..00000000000 --- a/src/plugins/perfprofiler/perfconfigwidget.cpp +++ /dev/null @@ -1,369 +0,0 @@ -// Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "perfconfigeventsmodel.h" -#include "perfconfigwidget.h" -#include "perfprofilertr.h" - -#include <coreplugin/messagebox.h> - -#include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kit.h> -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/target.h> - -#include <utils/aspects.h> -#include <utils/layoutbuilder.h> -#include <utils/process.h> -#include <utils/qtcassert.h> - -#include <QComboBox> -#include <QHeaderView> -#include <QMessageBox> -#include <QMetaEnum> -#include <QPushButton> -#include <QStyledItemDelegate> -#include <QTableView> - -using namespace Utils; - -namespace PerfProfiler { -namespace Internal { - -class SettingsDelegate : public QStyledItemDelegate -{ - Q_OBJECT -public: - SettingsDelegate(QObject *parent = nullptr) : QStyledItemDelegate(parent) {} - - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const override; - - void setEditorData(QWidget *editor, const QModelIndex &index) const override; - void setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const override; - - void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, - const QModelIndex &index) const override; -}; - -PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, QWidget *parent) - : m_settings(settings) -{ - setParent(parent); - - eventsView = new QTableView(this); - eventsView->setMinimumSize(QSize(0, 300)); - eventsView->setEditTriggers(QAbstractItemView::AllEditTriggers); - eventsView->setSelectionMode(QAbstractItemView::SingleSelection); - eventsView->setSelectionBehavior(QAbstractItemView::SelectRows); - eventsView->setModel(new PerfConfigEventsModel(m_settings, this)); - eventsView->setItemDelegate(new SettingsDelegate(this)); - eventsView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); - - useTracePointsButton = new QPushButton(this); - useTracePointsButton->setText(Tr::tr("Use Trace Points")); - useTracePointsButton->setVisible(false); - connect(useTracePointsButton, &QPushButton::pressed, - this, &PerfConfigWidget::readTracePoints); - - addEventButton = new QPushButton(this); - addEventButton->setText(Tr::tr("Add Event")); - connect(addEventButton, &QPushButton::pressed, this, [this]() { - auto model = eventsView->model(); - model->insertRow(model->rowCount()); - }); - - removeEventButton = new QPushButton(this); - removeEventButton->setText(Tr::tr("Remove Event")); - connect(removeEventButton, &QPushButton::pressed, this, [this]() { - QModelIndex index = eventsView->currentIndex(); - if (index.isValid()) - eventsView->model()->removeRow(index.row()); - }); - - resetButton = new QPushButton(this); - resetButton->setText(Tr::tr("Reset")); - connect(resetButton, &QPushButton::pressed, m_settings, &PerfSettings::resetToDefault); - - using namespace Layouting; - Column { - Row { st, useTracePointsButton, addEventButton, removeEventButton, resetButton }, - - eventsView, - - Grid { - m_settings->callgraphMode, m_settings->stackSize, br, - m_settings->sampleMode, m_settings->period, br, - m_settings->extraArguments, - }, - - st - }.attachTo(this); -} - -PerfConfigWidget::~PerfConfigWidget() = default; - -void PerfConfigWidget::setTarget(ProjectExplorer::Target *target) -{ - ProjectExplorer::IDevice::ConstPtr device; - if (target) { - if (ProjectExplorer::Kit *kit = target->kit()) - device = ProjectExplorer::DeviceKitAspect::device(kit); - } - - if (device.isNull()) { - useTracePointsButton->setEnabled(false); - return; - } - - QTC_ASSERT(device, return); - QTC_CHECK(!m_process || m_process->state() == QProcess::NotRunning); - - m_process.reset(new Process); - m_process->setCommand({device->filePath("perf"), {"probe", "-l"}}); - connect(m_process.get(), &Process::done, - this, &PerfConfigWidget::handleProcessDone); - - useTracePointsButton->setEnabled(true); -} - -void PerfConfigWidget::setTracePointsButtonVisible(bool visible) -{ - useTracePointsButton->setVisible(visible); -} - -void PerfConfigWidget::apply() -{ - m_settings->writeGlobalSettings(); -} - -void PerfConfigWidget::readTracePoints() -{ - QMessageBox messageBox; - messageBox.setWindowTitle(Tr::tr("Use Trace Points")); - messageBox.setIcon(QMessageBox::Question); - messageBox.setText(Tr::tr("Replace events with trace points read from the device?")); - messageBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - if (messageBox.exec() == QMessageBox::Yes) { - m_process->start(); - useTracePointsButton->setEnabled(false); - } -} - -void PerfConfigWidget::handleProcessDone() -{ - if (m_process->error() == QProcess::FailedToStart) { - Core::AsynchronousMessageBox::warning( - Tr::tr("Cannot List Trace Points"), - Tr::tr("\"perf probe -l\" failed to start. Is perf installed?")); - useTracePointsButton->setEnabled(true); - return; - } - const QList<QByteArray> lines = - m_process->readAllRawStandardOutput().append(m_process->readAllRawStandardError()) - .split('\n'); - auto model = eventsView->model(); - const int previousRows = model->rowCount(); - QHash<QByteArray, QByteArray> tracePoints; - for (const QByteArray &line : lines) { - const QByteArray trimmed = line.trimmed(); - const int space = trimmed.indexOf(' '); - if (space < 0) - continue; - - // If the whole "on ..." string is the same, the trace points are redundant - tracePoints[trimmed.mid(space + 1)] = trimmed.left(space); - } - - if (tracePoints.isEmpty()) { - Core::AsynchronousMessageBox::warning( - Tr::tr("No Trace Points Found"), - Tr::tr("Trace points can be defined with \"perf probe -a\".")); - } else { - for (const QByteArray &event : std::as_const(tracePoints)) { - int row = model->rowCount(); - model->insertRow(row); - model->setData(model->index(row, PerfConfigEventsModel::ColumnEventType), - PerfConfigEventsModel::EventTypeCustom); - model->setData(model->index(row, PerfConfigEventsModel::ColumnSubType), - QString::fromUtf8(event)); - } - model->removeRows(0, previousRows); - m_settings->sampleMode.setVolatileValue(1); - m_settings->period.setVolatileValue(1); - } - useTracePointsButton->setEnabled(true); -} - -QWidget *SettingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const -{ - Q_UNUSED(option) - const int row = index.row(); - const int column = index.column(); - const PerfConfigEventsModel *model = qobject_cast<const PerfConfigEventsModel *>(index.model()); - - auto getRowEventType = [&]() { - return qvariant_cast<PerfConfigEventsModel::EventType>( - model->data(model->index(row, PerfConfigEventsModel::ColumnEventType), - Qt::EditRole)); - }; - - switch (column) { - case PerfConfigEventsModel::ColumnEventType: { - QComboBox *editor = new QComboBox(parent); - QMetaEnum meta = QMetaEnum::fromType<PerfConfigEventsModel::EventType>(); - for (int i = 0; i < PerfConfigEventsModel::EventTypeInvalid; ++i) { - editor->addItem(QString::fromLatin1(meta.valueToKey(i)).mid( - static_cast<int>(strlen("EventType"))).toLower(), i); - } - return editor; - } - case PerfConfigEventsModel::ColumnSubType: { - PerfConfigEventsModel::EventType eventType = getRowEventType(); - switch (eventType) { - case PerfConfigEventsModel::EventTypeHardware: { - QComboBox *editor = new QComboBox(parent); - for (int i = PerfConfigEventsModel::SubTypeEventTypeHardware; - i < PerfConfigEventsModel::SubTypeEventTypeSoftware; ++i) { - editor->addItem(PerfConfigEventsModel::subTypeString(PerfConfigEventsModel::EventTypeHardware, - PerfConfigEventsModel::SubType(i)), i); - } - return editor; - } - case PerfConfigEventsModel::EventTypeSoftware: { - QComboBox *editor = new QComboBox(parent); - for (int i = PerfConfigEventsModel::SubTypeEventTypeSoftware; - i < PerfConfigEventsModel::SubTypeEventTypeCache; ++i) { - editor->addItem(PerfConfigEventsModel::subTypeString(PerfConfigEventsModel::EventTypeSoftware, - PerfConfigEventsModel::SubType(i)), i); - } - return editor; - } - case PerfConfigEventsModel::EventTypeCache: { - QComboBox *editor = new QComboBox(parent); - for (int i = PerfConfigEventsModel::SubTypeEventTypeCache; - i < PerfConfigEventsModel::SubTypeInvalid; ++i) { - editor->addItem(PerfConfigEventsModel::subTypeString(PerfConfigEventsModel::EventTypeCache, - PerfConfigEventsModel::SubType(i)), i); - } - return editor; - } - case PerfConfigEventsModel::EventTypeBreakpoint: { - QLineEdit *editor = new QLineEdit(parent); - editor->setText("0x0000000000000000"); - editor->setValidator(new QRegularExpressionValidator( - QRegularExpression("0x[0-9a-f]{16}"), parent)); - return editor; - } - case PerfConfigEventsModel::EventTypeCustom: { - QLineEdit *editor = new QLineEdit(parent); - return editor; - } - case PerfConfigEventsModel::EventTypeRaw: { - QLineEdit *editor = new QLineEdit(parent); - editor->setText("r000"); - editor->setValidator(new QRegularExpressionValidator( - QRegularExpression("r[0-9a-f]{3}"), parent)); - return editor; - } - case PerfConfigEventsModel::EventTypeInvalid: - return nullptr; - } - return nullptr; // Will never be reached, but GCC cannot figure this out. - } - case PerfConfigEventsModel::ColumnOperation: { - QComboBox *editor = new QComboBox(parent); - PerfConfigEventsModel::EventType eventType = getRowEventType(); - if (eventType == PerfConfigEventsModel::EventTypeCache) { - editor->addItem("load", PerfConfigEventsModel::OperationLoad); - editor->addItem("store", PerfConfigEventsModel::OperationStore); - editor->addItem("prefetch", PerfConfigEventsModel::OperationPrefetch); - } else if (eventType == PerfConfigEventsModel::EventTypeBreakpoint) { - editor->addItem("r", PerfConfigEventsModel::OperationLoad); - editor->addItem("rw", PerfConfigEventsModel::OperationLoad - | PerfConfigEventsModel::OperationStore); - editor->addItem("rwx", PerfConfigEventsModel::OperationLoad - | PerfConfigEventsModel::OperationStore - | PerfConfigEventsModel::OperationExecute); - editor->addItem("rx", PerfConfigEventsModel::OperationLoad - | PerfConfigEventsModel::OperationExecute); - editor->addItem("w", PerfConfigEventsModel::OperationStore); - editor->addItem("wx", PerfConfigEventsModel::OperationStore - | PerfConfigEventsModel::OperationExecute); - editor->addItem("x", PerfConfigEventsModel::OperationExecute); - } else { - editor->setEnabled(false); - } - return editor; - } - case PerfConfigEventsModel::ColumnResult: { - QComboBox *editor = new QComboBox(parent); - PerfConfigEventsModel::EventType eventType = getRowEventType(); - if (eventType != PerfConfigEventsModel::EventTypeCache) { - editor->setEnabled(false); - } else { - editor->addItem("refs", PerfConfigEventsModel::ResultRefs); - editor->addItem("misses", PerfConfigEventsModel::ResultMisses); - } - return editor; - } - default: - return nullptr; - } -} - -void SettingsDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const -{ - if (QComboBox *combo = qobject_cast<QComboBox *>(editor)) { - QVariant data = index.model()->data(index, Qt::EditRole); - for (int i = 0, end = combo->count(); i != end; ++i) { - if (combo->itemData(i) == data) { - combo->setCurrentIndex(i); - return; - } - } - } else if (QLineEdit *lineedit = qobject_cast<QLineEdit *>(editor)) { - lineedit->setText(index.model()->data(index, Qt::DisplayRole).toString()); - } -} - -void SettingsDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const -{ - if (QComboBox *combo = qobject_cast<QComboBox *>(editor)) { - model->setData(index, combo->currentData()); - } else if (QLineEdit *lineedit = qobject_cast<QLineEdit *>(editor)) { - QString text = lineedit->text(); - QVariant type = model->data(model->index(index.row(), - PerfConfigEventsModel::ColumnEventType), - Qt::EditRole); - switch (qvariant_cast<PerfConfigEventsModel::EventType>(type)) { - case PerfConfigEventsModel::EventTypeRaw: - model->setData(index, text.mid(static_cast<int>(strlen("r"))).toULongLong(nullptr, 16)); - break; - case PerfConfigEventsModel::EventTypeBreakpoint: - model->setData(index, - text.mid(static_cast<int>(strlen("0x"))).toULongLong(nullptr, 16)); - break; - case PerfConfigEventsModel::EventTypeCustom: - model->setData(index, text); - break; - default: - break; - } - } -} - -void SettingsDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, - const QModelIndex &index) const -{ - Q_UNUSED(index) - editor->setGeometry(option.rect); -} - -} // namespace Internal -} // namespace PerfProfiler - -#include "perfconfigwidget.moc" diff --git a/src/plugins/perfprofiler/perfconfigwidget.h b/src/plugins/perfprofiler/perfconfigwidget.h deleted file mode 100644 index 5372647064e..00000000000 --- a/src/plugins/perfprofiler/perfconfigwidget.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "perfsettings.h" - -#include <coreplugin/dialogs/ioptionspage.h> - -#include <QProcess> - -QT_BEGIN_NAMESPACE -class QPushButton; -class QTableView; -QT_END_NAMESPACE - -namespace Utils { class Process; } - -namespace PerfProfiler { -namespace Internal { - -class PerfConfigWidget : public Core::IOptionsPageWidget -{ - Q_OBJECT -public: - explicit PerfConfigWidget(PerfSettings *settings, QWidget *parent = nullptr); - ~PerfConfigWidget(); - - void updateUi(); - void setTarget(ProjectExplorer::Target *target); - void setTracePointsButtonVisible(bool visible); - -private: - void apply() final; - - void readTracePoints(); - void handleProcessDone(); - - PerfSettings *m_settings; - std::unique_ptr<Utils::Process> m_process; - - QTableView *eventsView; - QPushButton *useTracePointsButton; - QPushButton *addEventButton; - QPushButton *removeEventButton; - QPushButton *resetButton; -}; - -} // namespace Internal -} // namespace PerfProfiler diff --git a/src/plugins/perfprofiler/perfprofiler.qbs b/src/plugins/perfprofiler/perfprofiler.qbs index 4604a2e2099..93235770250 100644 --- a/src/plugins/perfprofiler/perfprofiler.qbs +++ b/src/plugins/perfprofiler/perfprofiler.qbs @@ -18,8 +18,6 @@ QtcPlugin { files: [ "perfconfigeventsmodel.cpp", "perfconfigeventsmodel.h", - "perfconfigwidget.cpp", - "perfconfigwidget.h", "perfdatareader.cpp", "perfdatareader.h", "perfevent.h", diff --git a/src/plugins/perfprofiler/perfprofilertool.cpp b/src/plugins/perfprofiler/perfprofilertool.cpp index 6e530e77689..4d2ed0b05a5 100644 --- a/src/plugins/perfprofiler/perfprofilertool.cpp +++ b/src/plugins/perfprofiler/perfprofilertool.cpp @@ -3,7 +3,6 @@ #include "perfprofilertool.h" -#include "perfconfigwidget.h" #include "perfloaddialog.h" #include "perfprofilerplugin.h" #include "perfprofilertr.h" @@ -236,11 +235,8 @@ void PerfProfilerTool::createViews() settings = runConfig->currentSettings<PerfSettings>(Constants::PerfSettingsId); } - PerfConfigWidget *widget = new PerfConfigWidget( - settings ? settings : &globalSettings(), - Core::ICore::dialogParent()); - widget->setTracePointsButtonVisible(true); - widget->setTarget(target); + QWidget *widget = settings ? settings->createPerfConfigWidget(target) + : globalSettings().createPerfConfigWidget(target); widget->setWindowFlags(Qt::Dialog); widget->setAttribute(Qt::WA_DeleteOnClose); widget->show(); diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp index 4cb1286885e..0cc95595b6c 100644 --- a/src/plugins/perfprofiler/perfsettings.cpp +++ b/src/plugins/perfprofiler/perfsettings.cpp @@ -1,24 +1,375 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "perfconfigwidget.h" +#include "perfsettings.h" + +#include "perfconfigeventsmodel.h" #include "perfprofilerconstants.h" #include "perfprofilertr.h" -#include "perfsettings.h" #include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icore.h> +#include <coreplugin/messagebox.h> #include <debugger/analyzer/analyzericons.h> #include <debugger/debuggertr.h> +#include <projectexplorer/devicesupport/idevice.h> +#include <projectexplorer/kit.h> +#include <projectexplorer/kitinformation.h> +#include <projectexplorer/target.h> + +#include <utils/aspects.h> #include <utils/layoutbuilder.h> #include <utils/process.h> +#include <utils/qtcassert.h> +#include <QComboBox> +#include <QHeaderView> +#include <QMessageBox> +#include <QMetaEnum> +#include <QPushButton> +#include <QStyledItemDelegate> +#include <QTableView> + +using namespace ProjectExplorer; using namespace Utils; +using namespace PerfProfiler::Internal; + namespace PerfProfiler { +class PerfConfigWidget : public Core::IOptionsPageWidget +{ +public: + PerfConfigWidget(PerfSettings *settings, Target *target); + +private: + void apply() final; + + void readTracePoints(); + void handleProcessDone(); + + PerfSettings *m_settings; + std::unique_ptr<Utils::Process> m_process; + + QTableView *eventsView; + QPushButton *useTracePointsButton; +}; + +class SettingsDelegate : public QStyledItemDelegate +{ +public: + SettingsDelegate(QObject *parent = nullptr) : QStyledItemDelegate(parent) {} + + QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, + const QModelIndex &index) const override; + + void setEditorData(QWidget *editor, const QModelIndex &index) const override; + void setModelData(QWidget *editor, QAbstractItemModel *model, + const QModelIndex &index) const override; + + void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, + const QModelIndex &) const override + { + editor->setGeometry(option.rect); + } +}; + +PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, Target *target) + : m_settings(settings) +{ + eventsView = new QTableView(this); + eventsView->setMinimumSize(QSize(0, 300)); + eventsView->setEditTriggers(QAbstractItemView::AllEditTriggers); + eventsView->setSelectionMode(QAbstractItemView::SingleSelection); + eventsView->setSelectionBehavior(QAbstractItemView::SelectRows); + eventsView->setModel(new PerfConfigEventsModel(m_settings, this)); + eventsView->setItemDelegate(new SettingsDelegate(this)); + eventsView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + + useTracePointsButton = new QPushButton(this); + useTracePointsButton->setText(Tr::tr("Use Trace Points")); + useTracePointsButton->setVisible(target != nullptr); + connect(useTracePointsButton, &QPushButton::pressed, + this, &PerfConfigWidget::readTracePoints); + + auto addEventButton = new QPushButton(Tr::tr("Add Event"), this); + connect(addEventButton, &QPushButton::pressed, this, [this]() { + auto model = eventsView->model(); + model->insertRow(model->rowCount()); + }); + + auto removeEventButton = new QPushButton(Tr::tr("Remove Event"), this); + connect(removeEventButton, &QPushButton::pressed, this, [this] { + QModelIndex index = eventsView->currentIndex(); + if (index.isValid()) + eventsView->model()->removeRow(index.row()); + }); + + auto resetButton = new QPushButton(Tr::tr("Reset"), this); + connect(resetButton, &QPushButton::pressed, m_settings, &PerfSettings::resetToDefault); + + using namespace Layouting; + Column { + Row { st, useTracePointsButton, addEventButton, removeEventButton, resetButton }, + + eventsView, + + Grid { + m_settings->callgraphMode, m_settings->stackSize, br, + m_settings->sampleMode, m_settings->period, br, + m_settings->extraArguments, + }, + + st + }.attachTo(this); + + IDevice::ConstPtr device; + if (target) + device = DeviceKitAspect::device(target->kit()); + + if (device.isNull()) { + useTracePointsButton->setEnabled(false); + return; + } + + QTC_ASSERT(device, return); + QTC_CHECK(!m_process || m_process->state() == QProcess::NotRunning); + + m_process.reset(new Process); + m_process->setCommand({device->filePath("perf"), {"probe", "-l"}}); + connect(m_process.get(), &Process::done, + this, &PerfConfigWidget::handleProcessDone); + + useTracePointsButton->setEnabled(true); +} + +void PerfConfigWidget::apply() +{ + m_settings->writeGlobalSettings(); +} + +void PerfConfigWidget::readTracePoints() +{ + QMessageBox messageBox; + messageBox.setWindowTitle(Tr::tr("Use Trace Points")); + messageBox.setIcon(QMessageBox::Question); + messageBox.setText(Tr::tr("Replace events with trace points read from the device?")); + messageBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); + if (messageBox.exec() == QMessageBox::Yes) { + m_process->start(); + useTracePointsButton->setEnabled(false); + } +} + +void PerfConfigWidget::handleProcessDone() +{ + if (m_process->error() == QProcess::FailedToStart) { + Core::AsynchronousMessageBox::warning( + Tr::tr("Cannot List Trace Points"), + Tr::tr("\"perf probe -l\" failed to start. Is perf installed?")); + useTracePointsButton->setEnabled(true); + return; + } + const QList<QByteArray> lines = + m_process->readAllRawStandardOutput().append(m_process->readAllRawStandardError()) + .split('\n'); + auto model = eventsView->model(); + const int previousRows = model->rowCount(); + QHash<QByteArray, QByteArray> tracePoints; + for (const QByteArray &line : lines) { + const QByteArray trimmed = line.trimmed(); + const int space = trimmed.indexOf(' '); + if (space < 0) + continue; + + // If the whole "on ..." string is the same, the trace points are redundant + tracePoints[trimmed.mid(space + 1)] = trimmed.left(space); + } + + if (tracePoints.isEmpty()) { + Core::AsynchronousMessageBox::warning( + Tr::tr("No Trace Points Found"), + Tr::tr("Trace points can be defined with \"perf probe -a\".")); + } else { + for (const QByteArray &event : std::as_const(tracePoints)) { + int row = model->rowCount(); + model->insertRow(row); + model->setData(model->index(row, PerfConfigEventsModel::ColumnEventType), + PerfConfigEventsModel::EventTypeCustom); + model->setData(model->index(row, PerfConfigEventsModel::ColumnSubType), + QString::fromUtf8(event)); + } + model->removeRows(0, previousRows); + m_settings->sampleMode.setVolatileValue(1); + m_settings->period.setVolatileValue(1); + } + useTracePointsButton->setEnabled(true); +} + +QWidget *SettingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, + const QModelIndex &index) const +{ + Q_UNUSED(option) + const int row = index.row(); + const int column = index.column(); + const PerfConfigEventsModel *model = qobject_cast<const PerfConfigEventsModel *>(index.model()); + + auto getRowEventType = [&]() { + return qvariant_cast<PerfConfigEventsModel::EventType>( + model->data(model->index(row, PerfConfigEventsModel::ColumnEventType), + Qt::EditRole)); + }; + + switch (column) { + case PerfConfigEventsModel::ColumnEventType: { + QComboBox *editor = new QComboBox(parent); + QMetaEnum meta = QMetaEnum::fromType<PerfConfigEventsModel::EventType>(); + for (int i = 0; i < PerfConfigEventsModel::EventTypeInvalid; ++i) { + editor->addItem(QString::fromLatin1(meta.valueToKey(i)).mid( + static_cast<int>(strlen("EventType"))).toLower(), i); + } + return editor; + } + case PerfConfigEventsModel::ColumnSubType: { + PerfConfigEventsModel::EventType eventType = getRowEventType(); + switch (eventType) { + case PerfConfigEventsModel::EventTypeHardware: { + QComboBox *editor = new QComboBox(parent); + for (int i = PerfConfigEventsModel::SubTypeEventTypeHardware; + i < PerfConfigEventsModel::SubTypeEventTypeSoftware; ++i) { + editor->addItem(PerfConfigEventsModel::subTypeString(PerfConfigEventsModel::EventTypeHardware, + PerfConfigEventsModel::SubType(i)), i); + } + return editor; + } + case PerfConfigEventsModel::EventTypeSoftware: { + QComboBox *editor = new QComboBox(parent); + for (int i = PerfConfigEventsModel::SubTypeEventTypeSoftware; + i < PerfConfigEventsModel::SubTypeEventTypeCache; ++i) { + editor->addItem(PerfConfigEventsModel::subTypeString(PerfConfigEventsModel::EventTypeSoftware, + PerfConfigEventsModel::SubType(i)), i); + } + return editor; + } + case PerfConfigEventsModel::EventTypeCache: { + QComboBox *editor = new QComboBox(parent); + for (int i = PerfConfigEventsModel::SubTypeEventTypeCache; + i < PerfConfigEventsModel::SubTypeInvalid; ++i) { + editor->addItem(PerfConfigEventsModel::subTypeString(PerfConfigEventsModel::EventTypeCache, + PerfConfigEventsModel::SubType(i)), i); + } + return editor; + } + case PerfConfigEventsModel::EventTypeBreakpoint: { + QLineEdit *editor = new QLineEdit(parent); + editor->setText("0x0000000000000000"); + editor->setValidator(new QRegularExpressionValidator( + QRegularExpression("0x[0-9a-f]{16}"), parent)); + return editor; + } + case PerfConfigEventsModel::EventTypeCustom: { + QLineEdit *editor = new QLineEdit(parent); + return editor; + } + case PerfConfigEventsModel::EventTypeRaw: { + QLineEdit *editor = new QLineEdit(parent); + editor->setText("r000"); + editor->setValidator(new QRegularExpressionValidator( + QRegularExpression("r[0-9a-f]{3}"), parent)); + return editor; + } + case PerfConfigEventsModel::EventTypeInvalid: + return nullptr; + } + return nullptr; // Will never be reached, but GCC cannot figure this out. + } + case PerfConfigEventsModel::ColumnOperation: { + QComboBox *editor = new QComboBox(parent); + PerfConfigEventsModel::EventType eventType = getRowEventType(); + if (eventType == PerfConfigEventsModel::EventTypeCache) { + editor->addItem("load", PerfConfigEventsModel::OperationLoad); + editor->addItem("store", PerfConfigEventsModel::OperationStore); + editor->addItem("prefetch", PerfConfigEventsModel::OperationPrefetch); + } else if (eventType == PerfConfigEventsModel::EventTypeBreakpoint) { + editor->addItem("r", PerfConfigEventsModel::OperationLoad); + editor->addItem("rw", PerfConfigEventsModel::OperationLoad + | PerfConfigEventsModel::OperationStore); + editor->addItem("rwx", PerfConfigEventsModel::OperationLoad + | PerfConfigEventsModel::OperationStore + | PerfConfigEventsModel::OperationExecute); + editor->addItem("rx", PerfConfigEventsModel::OperationLoad + | PerfConfigEventsModel::OperationExecute); + editor->addItem("w", PerfConfigEventsModel::OperationStore); + editor->addItem("wx", PerfConfigEventsModel::OperationStore + | PerfConfigEventsModel::OperationExecute); + editor->addItem("x", PerfConfigEventsModel::OperationExecute); + } else { + editor->setEnabled(false); + } + return editor; + } + case PerfConfigEventsModel::ColumnResult: { + QComboBox *editor = new QComboBox(parent); + PerfConfigEventsModel::EventType eventType = getRowEventType(); + if (eventType != PerfConfigEventsModel::EventTypeCache) { + editor->setEnabled(false); + } else { + editor->addItem("refs", PerfConfigEventsModel::ResultRefs); + editor->addItem("misses", PerfConfigEventsModel::ResultMisses); + } + return editor; + } + default: + return nullptr; + } +} + +void SettingsDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const +{ + if (QComboBox *combo = qobject_cast<QComboBox *>(editor)) { + QVariant data = index.model()->data(index, Qt::EditRole); + for (int i = 0, end = combo->count(); i != end; ++i) { + if (combo->itemData(i) == data) { + combo->setCurrentIndex(i); + return; + } + } + } else if (QLineEdit *lineedit = qobject_cast<QLineEdit *>(editor)) { + lineedit->setText(index.model()->data(index, Qt::DisplayRole).toString()); + } +} + +void SettingsDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, + const QModelIndex &index) const +{ + if (QComboBox *combo = qobject_cast<QComboBox *>(editor)) { + model->setData(index, combo->currentData()); + } else if (QLineEdit *lineedit = qobject_cast<QLineEdit *>(editor)) { + QString text = lineedit->text(); + QVariant type = model->data(model->index(index.row(), + PerfConfigEventsModel::ColumnEventType), + Qt::EditRole); + switch (qvariant_cast<PerfConfigEventsModel::EventType>(type)) { + case PerfConfigEventsModel::EventTypeRaw: + model->setData(index, text.mid(static_cast<int>(strlen("r"))).toULongLong(nullptr, 16)); + break; + case PerfConfigEventsModel::EventTypeBreakpoint: + model->setData(index, + text.mid(static_cast<int>(strlen("0x"))).toULongLong(nullptr, 16)); + break; + case PerfConfigEventsModel::EventTypeCustom: + model->setData(index, text); + break; + default: + break; + } + } +} + +// PerfSettingsPage + PerfSettings &globalSettings() { static PerfSettings theSettings(nullptr); @@ -67,9 +418,7 @@ PerfSettings::PerfSettings(ProjectExplorer::Target *target) setLayouter([this, target] { using namespace Layouting; - auto widget = new Internal::PerfConfigWidget(this); - widget->setTracePointsButtonVisible(target != nullptr); - widget->setTarget(target); + auto widget = new PerfConfigWidget(this, target); return Column { widget }; }); @@ -137,6 +486,11 @@ void PerfSettings::resetToDefault() fromMap(map); } +QWidget *PerfSettings::createPerfConfigWidget(Target *target) +{ + return new PerfConfigWidget(this, target); +} + // PerfSettingsPage class PerfSettingsPage final : public Core::IOptionsPage diff --git a/src/plugins/perfprofiler/perfsettings.h b/src/plugins/perfprofiler/perfsettings.h index bef4d996071..a53557b9c47 100644 --- a/src/plugins/perfprofiler/perfsettings.h +++ b/src/plugins/perfprofiler/perfsettings.h @@ -24,6 +24,8 @@ public: void resetToDefault(); + QWidget *createPerfConfigWidget(ProjectExplorer::Target *target); + Utils::IntegerAspect period{this}; Utils::IntegerAspect stackSize{this}; Utils::SelectionAspect sampleMode{this}; From a140a930675dd3b7af5fbbc423dc2aa444512881 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 17 Jul 2023 08:07:30 +0200 Subject: [PATCH 0507/1777] BuildManager: Employ task tree for running Task-number: QTCREATORBUG-29168 Change-Id: Ibdc1882f3a019855bc06e7a7e49e2ae6e3bf17f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/buildmanager.cpp | 436 +++++++++---------- src/plugins/projectexplorer/buildmanager.h | 6 +- src/plugins/projectexplorer/buildstep.h | 1 + 3 files changed, 202 insertions(+), 241 deletions(-) diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 710f03fed13..38bc2e3bddc 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -260,31 +260,23 @@ public: Internal::CompileOutputWindow *m_outputWindow = nullptr; Internal::TaskWindow *m_taskWindow = nullptr; - QMetaObject::Connection m_scheduledBuild; + QList<BuildItem> m_pendingQueue; QList<BuildItem> m_buildQueue; int m_progress = 0; int m_maxProgress = 0; bool m_poppedUpTaskWindow = false; - bool m_running = false; bool m_isDeploying = false; - // is set to true while canceling, so that nextBuildStep knows that the BuildStep finished because of canceling - bool m_skipDisabled = false; - bool m_canceling = false; - bool m_lastStepSucceeded = true; - bool m_allStepsSucceeded = true; - BuildStep *m_currentBuildStep = nullptr; - QString m_currentConfiguration; // used to decide if we are building a project to decide when to emit buildStateChanged(Project *) QHash<Project *, int> m_activeBuildSteps; QHash<Target *, int> m_activeBuildStepsPerTarget; QHash<ProjectConfiguration *, int> m_activeBuildStepsPerProjectConfiguration; - Project *m_previousBuildStepProject = nullptr; // Progress reporting to the progress manager QFutureInterface<void> *m_progressFutureInterface = nullptr; QFutureWatcher<void> m_progressWatcher; QPointer<FutureProgress> m_futureProgress; + std::unique_ptr<TaskTree> m_taskTree; QElapsedTimer m_elapsed; }; @@ -475,7 +467,7 @@ void BuildManager::aboutToRemoveProject(Project *p) bool BuildManager::isBuilding() { // we are building even if we are not running yet - return !d->m_buildQueue.isEmpty() || d->m_running; + return !d->m_pendingQueue.isEmpty() || !d->m_buildQueue.isEmpty(); } bool BuildManager::isDeploying() @@ -506,20 +498,51 @@ QString BuildManager::displayNameForStepId(Id stepId) return Tr::tr("Build"); } +void BuildManager::cleanupBuild() +{ + const QList<BuildItem> buildQueue = d->m_buildQueue; + d->m_buildQueue.clear(); + for (const BuildItem &item : buildQueue) { + decrementActiveBuildSteps(item.buildStep); + disconnect(item.buildStep, nullptr, m_instance, nullptr); + } + if (d->m_progressFutureInterface) { + d->m_progressFutureInterface->reportFinished(); + d->m_progressWatcher.setFuture(QFuture<void>()); + delete d->m_progressFutureInterface; + d->m_progressFutureInterface = nullptr; + } + d->m_progress = 0; + d->m_maxProgress = 0; + d->m_futureProgress = nullptr; +} + void BuildManager::cancel() { - if (d->m_scheduledBuild) { - disconnect(d->m_scheduledBuild); - d->m_scheduledBuild = {}; - clearBuildQueue(); + if (!d->m_taskTree) return; + + d->m_taskTree.reset(); + + const QList<BuildItem> pendingQueue = d->m_pendingQueue; + d->m_pendingQueue.clear(); + for (const BuildItem &item : pendingQueue) { + decrementActiveBuildSteps(item.buildStep); + disconnect(item.buildStep, nullptr, m_instance, nullptr); } - if (d->m_running) { - if (d->m_canceling) - return; - d->m_canceling = true; - d->m_currentBuildStep->cancel(); + + d->m_poppedUpTaskWindow = false; + d->m_isDeploying = false; + + if (d->m_progressFutureInterface) { + d->m_progressFutureInterface->setProgressValueAndText(100 * d->m_progress, + Tr::tr("Build/Deployment canceled")); + d->m_progressFutureInterface->reportCanceled(); } + cleanupBuild(); + + addToOutputWindow(Tr::tr("Canceled build/deployment."), BuildStep::OutputFormat::ErrorMessage); + emit m_instance->buildQueueFinished(false); } void BuildManager::updateTaskCount() @@ -541,39 +564,6 @@ void BuildManager::finish() QApplication::alert(ICore::dialogParent(), 3000); } -void BuildManager::emitCancelMessage() -{ - addToOutputWindow(Tr::tr("Canceled build/deployment."), BuildStep::OutputFormat::ErrorMessage); -} - -void BuildManager::clearBuildQueue() -{ - for (const BuildItem &item : std::as_const(d->m_buildQueue)) { - decrementActiveBuildSteps(item.buildStep); - disconnectOutput(item.buildStep); - } - - d->m_buildQueue.clear(); - d->m_running = false; - d->m_poppedUpTaskWindow = false; - d->m_isDeploying = false; - d->m_previousBuildStepProject = nullptr; - d->m_currentBuildStep = nullptr; - - if (d->m_progressFutureInterface) { - d->m_progressFutureInterface->reportCanceled(); - d->m_progressFutureInterface->reportFinished(); - d->m_progressWatcher.setFuture(QFuture<void>()); - delete d->m_progressFutureInterface; - d->m_progressFutureInterface = nullptr; - } - d->m_futureProgress = nullptr; - d->m_maxProgress = 0; - - emit m_instance->buildQueueFinished(false); -} - - void BuildManager::toggleOutputWindow() { d->m_outputWindow->toggle(IOutputPane::ModeSwitch | IOutputPane::WithFocus); @@ -600,58 +590,137 @@ bool BuildManager::tasksAvailable() void BuildManager::startBuildQueue() { - if (d->m_buildQueue.isEmpty()) { - emit m_instance->buildQueueFinished(true); - return; - } + if (compileOutputSettings().popUp()) + d->m_outputWindow->popup(IOutputPane::NoModeSwitch); - // Delay if any of the involved build systems are currently parsing. - const auto buildSystems = transform<QSet<BuildSystem *>>(d->m_buildQueue, - [](const BuildItem &item) { return item.buildStep->buildSystem(); }); - for (const BuildSystem * const bs : buildSystems) { - if (!bs || !bs->isParsing()) + const auto onAwaiterSetup = [](QSet<BuildSystem *> &buildSystems) { + // Delay if any of the involved build systems are currently parsing. + buildSystems = transform<QSet<BuildSystem *>>( + d->m_buildQueue, [](const BuildItem &item) { return item.buildStep->buildSystem(); }); + }; + + const GroupItem abortPolicy + = ProjectExplorerPlugin::projectExplorerSettings().abortBuildAllOnError + ? stopOnError : continueOnError; + + QList<GroupItem> topLevel { abortPolicy, ParserAwaiterTask(onAwaiterSetup) }; + Project *lastProject = nullptr; + Target *lastTarget = nullptr; + QList<GroupItem> targetTasks; + d->m_progress = 0; + d->m_maxProgress = 0; + + for (const BuildItem &item : std::as_const(d->m_buildQueue)) { + BuildStep *buildStep = item.buildStep; + Target *target = buildStep->target(); + if (lastTarget != target) { + if (!targetTasks.isEmpty()) + topLevel.append(Group(targetTasks)); + targetTasks.clear(); + lastTarget = target; + } + + Project *project = buildStep->project(); + if (lastProject != project) { + targetTasks.append(Sync([projectName = buildStep->project()->displayName()] { + addToOutputWindow(Tr::tr("Running steps for project %1...") + .arg(projectName), BuildStep::OutputFormat::NormalMessage); + })); + lastProject = project; + } + + if (!item.enabled) { + targetTasks.append(Sync([name = buildStep->displayName()] { + addToOutputWindow(Tr::tr("Skipping disabled step %1.") + .arg(name), BuildStep::OutputFormat::NormalMessage); + })); continue; - d->m_scheduledBuild = QObject::connect(bs, &BuildSystem::parsingFinished, - BuildManager::instance(), - [](bool parsingSuccess) { - if (!d->m_scheduledBuild) - return; - QObject::disconnect(d->m_scheduledBuild); - d->m_scheduledBuild = {}; - if (parsingSuccess) - startBuildQueue(); - else - clearBuildQueue(); - }, Qt::QueuedConnection); - return; - } + } + ++d->m_maxProgress; - if (!d->m_running) { - d->m_elapsed.start(); - // Progress Reporting - d->m_progressFutureInterface = new QFutureInterface<void>; - d->m_progressWatcher.setFuture(d->m_progressFutureInterface->future()); - ProgressManager::setApplicationLabel(QString()); - d->m_futureProgress = ProgressManager::addTask(d->m_progressFutureInterface->future(), - QString(), "ProjectExplorer.Task.Build", - ProgressManager::KeepOnFinish | ProgressManager::ShowInApplicationIcon); - connect(d->m_futureProgress.data(), &FutureProgress::clicked, - m_instance, &BuildManager::showBuildResults); - d->m_futureProgress.data()->setWidget(new Internal::BuildProgress(d->m_taskWindow)); - d->m_futureProgress.data()->setStatusBarWidget(new Internal::BuildProgress(d->m_taskWindow, - Qt::Horizontal)); - d->m_progress = 0; - d->m_progressFutureInterface->setProgressRange(0, d->m_maxProgress * 100); - - d->m_running = true; - d->m_allStepsSucceeded = true; - d->m_progressFutureInterface->reportStarted(); - nextStep(); - } else { - // Already running - d->m_progressFutureInterface->setProgressRange(0, d->m_maxProgress * 100); - d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, msgProgress(d->m_progress, d->m_maxProgress)); + const auto onRecipeSetup = [buildStep, name = item.name] { + d->m_outputWindow->reset(); + buildStep->setupOutputFormatter(d->m_outputWindow->outputFormatter()); + connect(buildStep, &BuildStep::progress, instance(), &BuildManager::progressChanged); + if (d->m_futureProgress) + d->m_futureProgress.data()->setTitle(name); + }; + const auto onRecipeDone = [buildStep] { + disconnect(buildStep, &BuildStep::progress, instance(), nullptr); + d->m_outputWindow->flush(); + ++d->m_progress; + d->m_progressFutureInterface->setProgressValueAndText( + 100 * d->m_progress, msgProgress(d->m_progress, d->m_maxProgress)); + }; + const auto onRecipeError = [buildStep, target, onRecipeDone] { + onRecipeDone(); + const QString projectName = buildStep->project()->displayName(); + const QString targetName = target->displayName(); + addToOutputWindow(Tr::tr("Error while building/deploying project %1 (kit: %2)") + .arg(projectName, targetName), BuildStep::OutputFormat::Stderr); + const Tasks kitTasks = target->kit()->validate(); + if (!kitTasks.isEmpty()) { + addToOutputWindow(Tr::tr("The kit %1 has configuration issues which might " + "be the root cause for this problem.") + .arg(targetName), BuildStep::OutputFormat::Stderr); + } + addToOutputWindow(Tr::tr("When executing step \"%1\"") + .arg(buildStep->displayName()), BuildStep::OutputFormat::Stderr); + }; + const Group recipeGroup { + onGroupSetup(onRecipeSetup), + buildStep->runRecipe(), + onGroupDone(onRecipeDone), + onGroupError(onRecipeError), + }; + targetTasks.append(recipeGroup); } + if (!targetTasks.isEmpty()) + topLevel.append(Group(targetTasks)); + + d->m_taskTree.reset(new TaskTree(Group{topLevel})); + const auto endHandler = [](bool success) { + d->m_taskTree.release()->deleteLater(); + + if (!success && d->m_progressFutureInterface) + d->m_progressFutureInterface->reportCanceled(); + + cleanupBuild(); + + if (d->m_pendingQueue.isEmpty()) { + d->m_poppedUpTaskWindow = false; + d->m_isDeploying = false; + } + + emit m_instance->buildQueueFinished(success); + + if (!d->m_pendingQueue.isEmpty()) { + d->m_buildQueue = d->m_pendingQueue; + d->m_pendingQueue.clear(); + startBuildQueue(); + } + }; + connect(d->m_taskTree.get(), &TaskTree::done, instance(), [endHandler] { endHandler(true); }); + connect(d->m_taskTree.get(), &TaskTree::errorOccurred, instance(), + [endHandler] { endHandler(false); }); + + // Progress Reporting + d->m_progressFutureInterface = new QFutureInterface<void>; + d->m_progressWatcher.setFuture(d->m_progressFutureInterface->future()); + ProgressManager::setApplicationLabel({}); + d->m_futureProgress = ProgressManager::addTask(d->m_progressFutureInterface->future(), + {}, "ProjectExplorer.Task.Build", + ProgressManager::KeepOnFinish | ProgressManager::ShowInApplicationIcon); + connect(d->m_futureProgress.data(), &FutureProgress::clicked, + m_instance, &BuildManager::showBuildResults); + d->m_futureProgress.data()->setWidget(new BuildProgress(d->m_taskWindow)); + d->m_futureProgress.data()->setStatusBarWidget(new BuildProgress(d->m_taskWindow, + Qt::Horizontal)); + d->m_progressFutureInterface->setProgressRange(0, d->m_maxProgress * 100); + d->m_progressFutureInterface->reportStarted(); + + d->m_elapsed.start(); + d->m_taskTree->start(); } void BuildManager::showBuildResults() @@ -684,127 +753,15 @@ void BuildManager::addToOutputWindow(const QString &string, BuildStep::OutputFor d->m_outputWindow->appendText(stringToWrite, format); } -void BuildManager::nextBuildQueue() -{ - d->m_outputWindow->flush(); - disconnectOutput(d->m_currentBuildStep); - decrementActiveBuildSteps(d->m_currentBuildStep); - - if (d->m_canceling) { - d->m_canceling = false; - QTimer::singleShot(0, m_instance, &BuildManager::emitCancelMessage); - - //TODO NBS fix in qtconcurrent - d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, - Tr::tr("Build/Deployment canceled")); - clearBuildQueue(); - return; - } - - if (!d->m_skipDisabled) - ++d->m_progress; - d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, msgProgress(d->m_progress, d->m_maxProgress)); - - const bool success = d->m_skipDisabled || d->m_lastStepSucceeded; - if (success) { - nextStep(); - } else { - // Build Failure - d->m_allStepsSucceeded = false; - Target *t = d->m_currentBuildStep->target(); - const QString projectName = d->m_currentBuildStep->project()->displayName(); - const QString targetName = t->displayName(); - addToOutputWindow(Tr::tr("Error while building/deploying project %1 (kit: %2)").arg(projectName, targetName), BuildStep::OutputFormat::Stderr); - const Tasks kitTasks = t->kit()->validate(); - if (!kitTasks.isEmpty()) { - addToOutputWindow(Tr::tr("The kit %1 has configuration issues which might be the root cause for this problem.") - .arg(targetName), BuildStep::OutputFormat::Stderr); - } - addToOutputWindow(Tr::tr("When executing step \"%1\"").arg(d->m_currentBuildStep->displayName()), BuildStep::OutputFormat::Stderr); - - bool abort = ProjectExplorerPlugin::projectExplorerSettings().abortBuildAllOnError; - if (!abort) { - while (!d->m_buildQueue.isEmpty() - && d->m_buildQueue.front().buildStep->target() == t) { - BuildStep * const nextStepForFailedTarget = d->m_buildQueue.takeFirst().buildStep; - disconnectOutput(nextStepForFailedTarget); - decrementActiveBuildSteps(nextStepForFailedTarget); - } - if (d->m_buildQueue.isEmpty()) - abort = true; - } - - if (abort) { - // NBS TODO fix in qtconcurrent - d->m_progressFutureInterface->setProgressValueAndText(d->m_progress * 100, - Tr::tr("Error while building/deploying project %1 (kit: %2)") - .arg(projectName, targetName)); - clearBuildQueue(); - } else { - nextStep(); - } - } -} - void BuildManager::progressChanged(int percent, const QString &text) { if (d->m_progressFutureInterface) d->m_progressFutureInterface->setProgressValueAndText(percent + 100 * d->m_progress, text); } -void BuildManager::nextStep() -{ - if (!d->m_buildQueue.empty()) { - const BuildItem item = d->m_buildQueue.takeFirst(); - d->m_currentBuildStep = item.buildStep; - d->m_skipDisabled = !item.enabled; - if (d->m_futureProgress) - d->m_futureProgress.data()->setTitle(item.name); - - if (d->m_currentBuildStep->project() != d->m_previousBuildStepProject) { - const QString projectName = d->m_currentBuildStep->project()->displayName(); - addToOutputWindow(Tr::tr("Running steps for project %1...") - .arg(projectName), BuildStep::OutputFormat::NormalMessage); - d->m_previousBuildStepProject = d->m_currentBuildStep->project(); - } - - if (d->m_skipDisabled) { - addToOutputWindow(Tr::tr("Skipping disabled step %1.") - .arg(d->m_currentBuildStep->displayName()), BuildStep::OutputFormat::NormalMessage); - nextBuildQueue(); - return; - } - - static const auto finishedHandler = [](bool success) { - d->m_outputWindow->flush(); - d->m_lastStepSucceeded = success; - disconnect(d->m_currentBuildStep, nullptr, instance(), nullptr); - BuildManager::nextBuildQueue(); - }; - connect(d->m_currentBuildStep, &BuildStep::finished, instance(), finishedHandler); - connect(d->m_currentBuildStep, &BuildStep::progress, - instance(), &BuildManager::progressChanged); - d->m_outputWindow->reset(); - d->m_currentBuildStep->setupOutputFormatter(d->m_outputWindow->outputFormatter()); - d->m_currentBuildStep->run(); - } else { - d->m_running = false; - d->m_poppedUpTaskWindow = false; - d->m_isDeploying = false; - d->m_previousBuildStepProject = nullptr; - d->m_progressFutureInterface->reportFinished(); - d->m_progressWatcher.setFuture(QFuture<void>()); - d->m_currentBuildStep = nullptr; - delete d->m_progressFutureInterface; - d->m_progressFutureInterface = nullptr; - d->m_maxProgress = 0; - emit m_instance->buildQueueFinished(d->m_allStepsSucceeded); - } -} - bool BuildManager::buildQueueAppend(const QList<BuildItem> &items, const QStringList &preambleMessage) { - if (!d->m_running) { + if (!d->m_taskTree) { d->m_outputWindow->clearContents(); if (ProjectExplorerPlugin::projectExplorerSettings().clearIssuesOnRebuild) { TaskHub::clearTasks(Constants::TASK_CATEGORY_COMPILE); @@ -819,34 +776,46 @@ bool BuildManager::buildQueueAppend(const QList<BuildItem> &items, const QString QList<BuildStep *> connectedSteps; int enabledCount = 0; for (const BuildItem &item : items) { - connect(item.buildStep, &BuildStep::addTask, m_instance, &BuildManager::addToTaskWindow); - connect(item.buildStep, &BuildStep::addOutput, m_instance, &BuildManager::addToOutputWindow); - connectedSteps.append(item.buildStep); + BuildStep *buildStep = item.buildStep; + connect(buildStep, &BuildStep::addTask, m_instance, &BuildManager::addToTaskWindow); + connect(buildStep, &BuildStep::addOutput, m_instance, &BuildManager::addToOutputWindow); + connectedSteps.append(buildStep); if (!item.enabled) continue; ++enabledCount; - if (item.buildStep->init()) + if (!isBuilding(buildStep) && buildStep->init()) continue; + // init() failed, print something for the user... - const QString projectName = item.buildStep->project()->displayName(); - const QString targetName = item.buildStep->target()->displayName(); + const QString projectName = buildStep->project()->displayName(); + const QString targetName = buildStep->target()->displayName(); addToOutputWindow(Tr::tr("Error while building/deploying project %1 (kit: %2)") .arg(projectName, targetName), BuildStep::OutputFormat::Stderr); addToOutputWindow(Tr::tr("When executing step \"%1\"") - .arg(item.buildStep->displayName()), BuildStep::OutputFormat::Stderr); + .arg(buildStep->displayName()), BuildStep::OutputFormat::Stderr); for (BuildStep *buildStep : std::as_const(connectedSteps)) - disconnectOutput(buildStep); + connect(buildStep, nullptr, m_instance, nullptr); d->m_outputWindow->popup(IOutputPane::NoModeSwitch); return false; } - d->m_buildQueue << items; - d->m_maxProgress += enabledCount; + if (d->m_taskTree) + d->m_pendingQueue << items; + else + d->m_buildQueue = items; + + if (d->m_buildQueue.isEmpty() && d->m_pendingQueue.isEmpty()) { + if (compileOutputSettings().popUp()) + d->m_outputWindow->popup(IOutputPane::NoModeSwitch); + emit m_instance->buildQueueFinished(true); + return true; + } + for (const BuildItem &item : items) incrementActiveBuildSteps(item.buildStep); - if (compileOutputSettings().popUp()) - d->m_outputWindow->popup(IOutputPane::NoModeSwitch); - startBuildQueue(); + + if (!d->m_taskTree) + startBuildQueue(); return true; } @@ -857,6 +826,7 @@ bool BuildManager::buildList(BuildStepList *bsl) bool BuildManager::buildLists(const QList<BuildStepList *> &bsls, const QStringList &preambleMessage) { + const bool wasDeploying = d->m_isDeploying; QList<BuildItem> buildItems; for (BuildStepList *list : bsls) { const QString name = displayNameForStepId(list->id()); @@ -869,7 +839,7 @@ bool BuildManager::buildLists(const QList<BuildStepList *> &bsls, const QStringL if (buildQueueAppend(buildItems, preambleMessage)) return true; - d->m_isDeploying = false; + d->m_isDeploying = wasDeploying; return false; } @@ -905,8 +875,8 @@ bool BuildManager::isBuilding(const ProjectConfiguration *p) bool BuildManager::isBuilding(BuildStep *step) { - return (d->m_currentBuildStep == step) || Utils::anyOf( - d->m_buildQueue, [step](const BuildItem &item) { return item.buildStep == step; }); + const auto checker = [step](const BuildItem &item) { return item.buildStep == step; }; + return Utils::anyOf(d->m_buildQueue, checker) || Utils::anyOf(d->m_pendingQueue, checker); } template <class T> bool increment(QHash<T *, int> &hash, T *key) @@ -956,10 +926,4 @@ void BuildManager::decrementActiveBuildSteps(BuildStep *bs) emit m_instance->buildStateChanged(bs->project()); } -void BuildManager::disconnectOutput(BuildStep *bs) -{ - disconnect(bs, &BuildStep::addTask, m_instance, nullptr); - disconnect(bs, &BuildStep::addOutput, m_instance, nullptr); -} - } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/buildmanager.h b/src/plugins/projectexplorer/buildmanager.h index 659ce079bcb..3ad4c84afd2 100644 --- a/src/plugins/projectexplorer/buildmanager.h +++ b/src/plugins/projectexplorer/buildmanager.h @@ -78,25 +78,21 @@ signals: void buildQueueFinished(bool success); private: + static void cleanupBuild(); static void addToTaskWindow(const ProjectExplorer::Task &task, int linkedOutputLines, int skipLines); static void addToOutputWindow(const QString &string, BuildStep::OutputFormat format, BuildStep::OutputNewlineSetting newlineSettings = BuildStep::DoAppendNewline); - static void nextBuildQueue(); static void progressChanged(int percent, const QString &text); - static void emitCancelMessage(); static void showBuildResults(); static void updateTaskCount(); static void finish(); static void startBuildQueue(); - static void nextStep(); - static void clearBuildQueue(); static bool buildQueueAppend(const QList<BuildItem> &items, const QStringList &preambleMessage = {}); static void incrementActiveBuildSteps(BuildStep *bs); static void decrementActiveBuildSteps(BuildStep *bs); - static void disconnectOutput(BuildStep *bs); }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 04a6c616e88..6bc195f431c 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -132,6 +132,7 @@ protected: private: using ProjectConfiguration::parent; + friend class BuildManager; virtual Tasking::GroupItem runRecipe() = 0; BuildStepList * const m_stepList; From 75d9dc2d313acca3ddf72809d2d2bec89b836844 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 13:31:30 +0200 Subject: [PATCH 0508/1777] CppEditor: Apply 'static pattern' to CppToolsSettings Change-Id: I1632787e1a1ebf60427c92b302b25a1a2550853f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../clangformat/clangformatbaseindenter.cpp | 2 +- .../cppeditor/cppcodestylesettings.cpp | 5 ++-- .../cppeditor/cppcodestylesettingspage.cpp | 7 ++--- src/plugins/cppeditor/cppdoxygen_test.cpp | 7 ++--- src/plugins/cppeditor/cppeditoroutline.cpp | 2 +- src/plugins/cppeditor/cppqtstyleindenter.cpp | 2 +- src/plugins/cppeditor/cppquickfix_test.cpp | 10 +++---- src/plugins/cppeditor/cpptoolssettings.cpp | 16 +++++----- src/plugins/cppeditor/cpptoolssettings.h | 29 +++++-------------- src/plugins/glsleditor/glslindenter.cpp | 12 +++----- 10 files changed, 36 insertions(+), 56 deletions(-) diff --git a/src/plugins/clangformat/clangformatbaseindenter.cpp b/src/plugins/clangformat/clangformatbaseindenter.cpp index 8e8d6013253..6903491fb0c 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.cpp +++ b/src/plugins/clangformat/clangformatbaseindenter.cpp @@ -565,7 +565,7 @@ Utils::EditOperations ClangFormatBaseIndenter::format(const TextEditor::RangesIn { bool doFormatting = mode == FormattingMode::Forced || formatCodeInsteadOfIndent(); #ifdef WITH_TESTS - doFormatting = doFormatting || CppEditor::CppToolsSettings::instance()->cppCodeStyle() + doFormatting = doFormatting || CppEditor::CppToolsSettings::cppCodeStyle() ->codeStyleSettings().forceFormatting; #endif if (!doFormatting) diff --git a/src/plugins/cppeditor/cppcodestylesettings.cpp b/src/plugins/cppeditor/cppcodestylesettings.cpp index 0fafad5a071..0607ce52819 100644 --- a/src/plugins/cppeditor/cppcodestylesettings.cpp +++ b/src/plugins/cppeditor/cppcodestylesettings.cpp @@ -161,7 +161,7 @@ CppCodeStyleSettings CppCodeStyleSettings::currentProjectCodeStyle() CppCodeStyleSettings CppCodeStyleSettings::currentGlobalCodeStyle() { - CppCodeStylePreferences *cppCodeStylePreferences = CppToolsSettings::instance()->cppCodeStyle(); + CppCodeStylePreferences *cppCodeStylePreferences = CppToolsSettings::cppCodeStyle(); QTC_ASSERT(cppCodeStylePreferences, return CppCodeStyleSettings()); return cppCodeStylePreferences->currentCodeStyleSettings(); @@ -188,8 +188,7 @@ TextEditor::TabSettings CppCodeStyleSettings::currentProjectTabSettings() TextEditor::TabSettings CppCodeStyleSettings::currentGlobalTabSettings() { - CppCodeStylePreferences *cppCodeStylePreferences - = CppToolsSettings::instance()->cppCodeStyle(); + CppCodeStylePreferences *cppCodeStylePreferences = CppToolsSettings::cppCodeStyle(); QTC_ASSERT(cppCodeStylePreferences, return TextEditor::TabSettings()); return cppCodeStylePreferences->currentTabSettings(); diff --git a/src/plugins/cppeditor/cppcodestylesettingspage.cpp b/src/plugins/cppeditor/cppcodestylesettingspage.cpp index 2f49c7eeb4d..d580f4dd990 100644 --- a/src/plugins/cppeditor/cppcodestylesettingspage.cpp +++ b/src/plugins/cppeditor/cppcodestylesettingspage.cpp @@ -469,7 +469,7 @@ void CppCodeStylePreferencesWidget::updatePreview() { CppCodeStylePreferences *cppCodeStylePreferences = m_preferences ? m_preferences - : CppToolsSettings::instance()->cppCodeStyle(); + : CppToolsSettings::cppCodeStyle(); const CppCodeStyleSettings ccss = cppCodeStylePreferences->currentCodeStyleSettings(); const TabSettings ts = cppCodeStylePreferences->currentTabSettings(); QtStyleCodeFormatter formatter(ts, ccss); @@ -568,8 +568,7 @@ class CppCodeStyleSettingsPageWidget : public Core::IOptionsPageWidget public: CppCodeStyleSettingsPageWidget() { - CppCodeStylePreferences *originalCodeStylePreferences = CppToolsSettings::instance() - ->cppCodeStyle(); + CppCodeStylePreferences *originalCodeStylePreferences = CppToolsSettings::cppCodeStyle(); m_pageCppCodeStylePreferences = new CppCodeStylePreferences(); m_pageCppCodeStylePreferences->setDelegatingPool( originalCodeStylePreferences->delegatingPool()); @@ -589,7 +588,7 @@ public: void apply() final { - CppCodeStylePreferences *originalCppCodeStylePreferences = CppToolsSettings::instance()->cppCodeStyle(); + CppCodeStylePreferences *originalCppCodeStylePreferences = CppToolsSettings::cppCodeStyle(); if (originalCppCodeStylePreferences->codeStyleSettings() != m_pageCppCodeStylePreferences->codeStyleSettings()) { originalCppCodeStylePreferences->setCodeStyleSettings(m_pageCppCodeStylePreferences->codeStyleSettings()); originalCppCodeStylePreferences->toSettings(QLatin1String(CppEditor::Constants::CPP_SETTINGS_ID)); diff --git a/src/plugins/cppeditor/cppdoxygen_test.cpp b/src/plugins/cppeditor/cppdoxygen_test.cpp index 19d1dee42b4..d784c008c91 100644 --- a/src/plugins/cppeditor/cppdoxygen_test.cpp +++ b/src/plugins/cppeditor/cppdoxygen_test.cpp @@ -40,7 +40,7 @@ void DoxygenTest::cleanTestCase() void DoxygenTest::cleanup() { if (oldSettings) - CppToolsSettings::instance()->setCommentsSettings(*oldSettings); + CppToolsSettings::setCommentsSettings(*oldSettings); QVERIFY(Core::EditorManager::closeAllEditors(false)); QVERIFY(TestCase::garbageCollectGlobalSnapshot()); } @@ -434,9 +434,8 @@ void DoxygenTest::runTest(const QByteArray &original, &testDocument.m_editorWidget)); if (settings) { - auto *cts = CppToolsSettings::instance(); - oldSettings.reset(new TextEditor::CommentsSettings(cts->commentsSettings())); - cts->setCommentsSettings(*settings); + oldSettings.reset(new TextEditor::CommentsSettings(CppToolsSettings::commentsSettings())); + CppToolsSettings::setCommentsSettings(*settings); } // We want to test documents that start with a comment. By default, the diff --git a/src/plugins/cppeditor/cppeditoroutline.cpp b/src/plugins/cppeditor/cppeditoroutline.cpp index 4c39851274b..dec97045639 100644 --- a/src/plugins/cppeditor/cppeditoroutline.cpp +++ b/src/plugins/cppeditor/cppeditoroutline.cpp @@ -79,7 +79,7 @@ CppEditorOutline::CppEditorOutline(CppEditorWidget *editorWidget) m_proxyModel->setSourceModel(m_model); // Set up proxy model - if (CppToolsSettings::instance()->sortedEditorDocumentOutline()) + if (CppToolsSettings::sortedEditorDocumentOutline()) m_proxyModel->sort(0, Qt::AscendingOrder); else m_proxyModel->sort(-1, Qt::AscendingOrder); // don't sort yet, but set column for sortedOutline() diff --git a/src/plugins/cppeditor/cppqtstyleindenter.cpp b/src/plugins/cppeditor/cppqtstyleindenter.cpp index cbcaad47a2f..b7bdfb69b55 100644 --- a/src/plugins/cppeditor/cppqtstyleindenter.cpp +++ b/src/plugins/cppeditor/cppqtstyleindenter.cpp @@ -19,7 +19,7 @@ CppQtStyleIndenter::CppQtStyleIndenter(QTextDocument *doc) { // Just for safety. setCodeStylePreferences should be called when the editor the // indenter belongs to gets initialized. - m_cppCodeStylePreferences = CppToolsSettings::instance()->cppCodeStyle(); + m_cppCodeStylePreferences = CppToolsSettings::cppCodeStyle(); } CppQtStyleIndenter::~CppQtStyleIndenter() = default; diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 09bc7d05d45..18da315a764 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -129,7 +129,7 @@ BaseQuickFixTestCase::BaseQuickFixTestCase(const QList<TestDocumentPtr> &testDoc // Enforce the default cpp code style, so we are independent of config file settings. // This is needed by e.g. the GenerateGetterSetter quick fix. - m_cppCodeStylePreferences = CppToolsSettings::instance()->cppCodeStyle(); + m_cppCodeStylePreferences = CppToolsSettings::cppCodeStyle(); QVERIFY(m_cppCodeStylePreferences); m_cppCodeStylePreferencesOriginalDelegateId = m_cppCodeStylePreferences->currentDelegateId(); m_cppCodeStylePreferences->setCurrentDelegate("qt"); @@ -3479,14 +3479,12 @@ void CppCodeStyleSettingsChanger::setSettings(const CppCodeStyleSettings &settin QVariant variant; variant.setValue(settings); - CppCodeStylePreferences *preferences = CppToolsSettings::instance()->cppCodeStyle(); - preferences->currentDelegate()->setValue(variant); + CppToolsSettings::cppCodeStyle()->currentDelegate()->setValue(variant); } CppCodeStyleSettings CppCodeStyleSettingsChanger::currentSettings() { - CppCodeStylePreferences *preferences = CppToolsSettings::instance()->cppCodeStyle(); - return preferences->currentDelegate()->value().value<CppCodeStyleSettings>(); + return CppToolsSettings::cppCodeStyle()->currentDelegate()->value().value<CppCodeStyleSettings>(); } void QuickfixTest::testGenerateGettersSetters_data() @@ -5392,7 +5390,7 @@ SpaceBeforeParens: Always CppTestDocument::create("file.cpp", origSource, expectedSource)}); InsertDefsFromDecls factory; factory.setMode(InsertDefsFromDecls::Mode::Impl); - CppCodeStylePreferences * const prefs = CppToolsSettings::instance()->cppCodeStyle(); + CppCodeStylePreferences * const prefs = CppToolsSettings::cppCodeStyle(); const CppCodeStyleSettings settings = prefs->codeStyleSettings(); CppCodeStyleSettings tempSettings = settings; tempSettings.forceFormatting = true; diff --git a/src/plugins/cppeditor/cpptoolssettings.cpp b/src/plugins/cppeditor/cpptoolssettings.cpp index 5dd22b6aae8..abc0558e069 100644 --- a/src/plugins/cppeditor/cpptoolssettings.cpp +++ b/src/plugins/cppeditor/cpptoolssettings.cpp @@ -29,21 +29,24 @@ using namespace TextEditor; namespace CppEditor { namespace Internal { + class CppToolsSettingsPrivate { public: CommentsSettings m_commentsSettings; CppCodeStylePreferences *m_globalCodeStyle = nullptr; }; -} // namespace Internal -CppToolsSettings *CppToolsSettings::m_instance = nullptr; +} // Internal + +CppToolsSettings *m_instance = nullptr; +Internal::CppToolsSettingsPrivate *d = nullptr; CppToolsSettings::CppToolsSettings() - : d(new Internal::CppToolsSettingsPrivate) { QTC_ASSERT(!m_instance, return); m_instance = this; + d = new Internal::CppToolsSettingsPrivate; qRegisterMetaType<CppCodeStyleSettings>("CppEditor::CppCodeStyleSettings"); @@ -156,12 +159,12 @@ CppToolsSettings *CppToolsSettings::instance() return m_instance; } -CppCodeStylePreferences *CppToolsSettings::cppCodeStyle() const +CppCodeStylePreferences *CppToolsSettings::cppCodeStyle() { return d->m_globalCodeStyle; } -const CommentsSettings &CppToolsSettings::commentsSettings() const +const CommentsSettings &CppToolsSettings::commentsSettings() { return d->m_commentsSettings; } @@ -178,7 +181,7 @@ static QString sortEditorDocumentOutlineKey() + QLatin1String(Constants::CPPEDITOR_SORT_EDITOR_DOCUMENT_OUTLINE); } -bool CppToolsSettings::sortedEditorDocumentOutline() const +bool CppToolsSettings::sortedEditorDocumentOutline() { return ICore::settings() ->value(sortEditorDocumentOutlineKey(), kSortEditorDocumentOutlineDefault) @@ -190,7 +193,6 @@ void CppToolsSettings::setSortedEditorDocumentOutline(bool sorted) ICore::settings()->setValueWithDefault(sortEditorDocumentOutlineKey(), sorted, kSortEditorDocumentOutlineDefault); - emit editorDocumentOutlineSortingChanged(sorted); } } // namespace CppEditor diff --git a/src/plugins/cppeditor/cpptoolssettings.h b/src/plugins/cppeditor/cpptoolssettings.h index 32a48234145..b95b9b2569c 100644 --- a/src/plugins/cppeditor/cpptoolssettings.h +++ b/src/plugins/cppeditor/cpptoolssettings.h @@ -9,40 +9,27 @@ namespace TextEditor { class CommentsSettings; } -namespace CppEditor -{ +namespace CppEditor { + class CppCodeStylePreferences; -namespace Internal { class CppToolsSettingsPrivate; } +// This class is meant to go away. -/** - * This class provides a central place for cpp tools settings. - */ class CPPEDITOR_EXPORT CppToolsSettings : public QObject { - Q_OBJECT - public: CppToolsSettings(); ~CppToolsSettings() override; static CppToolsSettings *instance(); - CppCodeStylePreferences *cppCodeStyle() const; + static CppCodeStylePreferences *cppCodeStyle(); - const TextEditor::CommentsSettings &commentsSettings() const; - void setCommentsSettings(const TextEditor::CommentsSettings &commentsSettings); + static const TextEditor::CommentsSettings &commentsSettings(); + static void setCommentsSettings(const TextEditor::CommentsSettings &commentsSettings); - bool sortedEditorDocumentOutline() const; - void setSortedEditorDocumentOutline(bool sorted); - -signals: - void editorDocumentOutlineSortingChanged(bool isSorted); - -private: - Internal::CppToolsSettingsPrivate *d; - - static CppToolsSettings *m_instance; + static bool sortedEditorDocumentOutline(); + static void setSortedEditorDocumentOutline(bool sorted); }; } // namespace CppEditor diff --git a/src/plugins/glsleditor/glslindenter.cpp b/src/plugins/glsleditor/glslindenter.cpp index c914dbc36c4..7a8dcbbb289 100644 --- a/src/plugins/glsleditor/glslindenter.cpp +++ b/src/plugins/glsleditor/glslindenter.cpp @@ -34,8 +34,7 @@ void GlslIndenter::indentBlock(const QTextBlock &block, { // TODO: do something with it CppEditor::QtStyleCodeFormatter - codeFormatter(tabSettings, - CppEditor::CppToolsSettings::instance()->cppCodeStyle()->codeStyleSettings()); + codeFormatter(tabSettings, CppEditor::CppToolsSettings::cppCodeStyle()->codeStyleSettings()); codeFormatter.updateStateUntil(block); int indent; @@ -66,8 +65,7 @@ void GlslIndenter::indent(const QTextCursor &cursor, // TODO: do something with it CppEditor::QtStyleCodeFormatter codeFormatter(tabSettings, - CppEditor::CppToolsSettings::instance() - ->cppCodeStyle() + CppEditor::CppToolsSettings::cppCodeStyle() ->codeStyleSettings()); codeFormatter.updateStateUntil(block); @@ -92,8 +90,7 @@ int GlslIndenter::indentFor(const QTextBlock &block, int /*cursorPositionInEditor*/) { CppEditor::QtStyleCodeFormatter - codeFormatter(tabSettings, - CppEditor::CppToolsSettings::instance()->cppCodeStyle()->codeStyleSettings()); + codeFormatter(tabSettings, CppEditor::CppToolsSettings::cppCodeStyle()->codeStyleSettings()); codeFormatter.updateStateUntil(block); int indent; @@ -109,8 +106,7 @@ TextEditor::IndentationForBlock GlslIndenter::indentationForBlocks( int /*cursorPositionInEditor*/) { CppEditor::QtStyleCodeFormatter - codeFormatter(tabSettings, - CppEditor::CppToolsSettings::instance()->cppCodeStyle()->codeStyleSettings()); + codeFormatter(tabSettings, CppEditor::CppToolsSettings::cppCodeStyle()->codeStyleSettings()); codeFormatter.updateStateUntil(blocks.last()); From 79e839b29ffefa509ee71f78e4b7b057e3a74429 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 25 Jul 2023 09:16:48 +0200 Subject: [PATCH 0509/1777] Terminal: Add mouse support Change-Id: Ibeb8e13b5f8f75f16ec86f64536235587c844ffc Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/libs/3rdparty/libptyqt/conptyprocess.cpp | 80 ++++++++++++++++++-- src/libs/3rdparty/libptyqt/conptyprocess.h | 77 +------------------ src/libs/3rdparty/libptyqt/iptyprocess.h | 1 - src/libs/3rdparty/libptyqt/ptyqt.cpp | 13 +++- src/libs/3rdparty/libptyqt/ptyqt.h | 2 + src/libs/3rdparty/libptyqt/unixptyprocess.h | 2 +- src/libs/3rdparty/libptyqt/winptyprocess.h | 2 +- src/libs/3rdparty/libvterm/src/state.c | 12 ++- src/plugins/terminal/CMakeLists.txt | 2 +- src/plugins/terminal/terminalpane.cpp | 45 ++++++----- src/plugins/terminal/terminalpane.h | 1 - src/plugins/terminal/terminalsettings.cpp | 15 ++++ src/plugins/terminal/terminalsettings.h | 2 + src/plugins/terminal/terminalsurface.cpp | 33 ++++++++ src/plugins/terminal/terminalsurface.h | 2 + src/plugins/terminal/terminalwidget.cpp | 33 ++++++++ src/plugins/terminal/terminalwidget.h | 1 + 17 files changed, 211 insertions(+), 112 deletions(-) diff --git a/src/libs/3rdparty/libptyqt/conptyprocess.cpp b/src/libs/3rdparty/libptyqt/conptyprocess.cpp index cb18b332066..6464dbeb347 100644 --- a/src/libs/3rdparty/libptyqt/conptyprocess.cpp +++ b/src/libs/3rdparty/libptyqt/conptyprocess.cpp @@ -12,6 +12,76 @@ #define READ_INTERVAL_MSEC 500 +//ConPTY is available only on Windows 10 released after 1903 (19H1) Windows release +class WindowsContext +{ +private: + WindowsContext() {} + +public: + typedef HRESULT (*CreatePseudoConsolePtr)( + COORD size, // ConPty Dimensions + HANDLE hInput, // ConPty Input + HANDLE hOutput, // ConPty Output + DWORD dwFlags, // ConPty Flags + HPCON* phPC); // ConPty Reference + + typedef HRESULT (*ResizePseudoConsolePtr)(HPCON hPC, COORD size); + + typedef VOID (*ClosePseudoConsolePtr)(HPCON hPC); + + static WindowsContext &instance() + { + static WindowsContext ctx; + return ctx; + } + + bool init() + { + //already initialized + if (createPseudoConsole) + return true; + + //try to load symbols from library + //if it fails -> we can't use ConPty API + HANDLE kernel32Handle = LoadLibraryExW(L"kernel32.dll", 0, 0); + + if (kernel32Handle != nullptr) + { + createPseudoConsole = (CreatePseudoConsolePtr)GetProcAddress((HMODULE)kernel32Handle, "CreatePseudoConsole"); + resizePseudoConsole = (ResizePseudoConsolePtr)GetProcAddress((HMODULE)kernel32Handle, "ResizePseudoConsole"); + closePseudoConsole = (ClosePseudoConsolePtr)GetProcAddress((HMODULE)kernel32Handle, "ClosePseudoConsole"); + if (createPseudoConsole == NULL || resizePseudoConsole == NULL || closePseudoConsole == NULL) + { + m_lastError = QString("WindowsContext/ConPty error: %1").arg("Invalid on load API functions"); + return false; + } + } + else + { + m_lastError = QString("WindowsContext/ConPty error: %1").arg("Unable to load kernel32"); + return false; + } + + return true; + } + + QString lastError() + { + return m_lastError; + } + +public: + //vars + CreatePseudoConsolePtr createPseudoConsole{nullptr}; + ResizePseudoConsolePtr resizePseudoConsole{nullptr}; + ClosePseudoConsolePtr closePseudoConsole{nullptr}; + +private: + QString m_lastError; +}; + + HRESULT ConPtyProcess::createPseudoConsoleAndPipes(HPCON* phPC, HANDLE* phPipeIn, HANDLE* phPipeOut, qint16 cols, qint16 rows) { HRESULT hr{ E_UNEXPECTED }; @@ -23,7 +93,7 @@ HRESULT ConPtyProcess::createPseudoConsoleAndPipes(HPCON* phPC, HANDLE* phPipeIn CreatePipe(phPipeIn, &hPipePTYOut, NULL, 0)) { // Create the Pseudo Console of the required size, attached to the PTY-end of the pipes - hr = m_winContext.createPseudoConsole({cols, rows}, hPipePTYIn, hPipePTYOut, 0, phPC); + hr = WindowsContext::instance().createPseudoConsole({cols, rows}, hPipePTYIn, hPipePTYOut, 0, phPC); // Note: We can close the handles to the PTY-end of the pipes here // because the handles are dup'ed into the ConHost and will be released @@ -108,7 +178,7 @@ bool ConPtyProcess::startProcess(const QString &executable, qint16 rows) { if (!isAvailable()) { - m_lastError = m_winContext.lastError(); + m_lastError = WindowsContext::instance().lastError(); return false; } @@ -228,7 +298,7 @@ bool ConPtyProcess::resize(qint16 cols, qint16 rows) return false; } - bool res = SUCCEEDED(m_winContext.resizePseudoConsole(m_ptyHandler, {cols, rows})); + bool res = SUCCEEDED(WindowsContext::instance().resizePseudoConsole(m_ptyHandler, {cols, rows})); if (res) { @@ -248,7 +318,7 @@ bool ConPtyProcess::kill() m_aboutToDestruct = true; // Close ConPTY - this will terminate client process if running - m_winContext.closePseudoConsole(m_ptyHandler); + WindowsContext::instance().closePseudoConsole(m_ptyHandler); // Clean-up the pipes if (INVALID_HANDLE_VALUE != m_hPipeOut) @@ -334,7 +404,7 @@ bool ConPtyProcess::isAvailable() qint32 buildNumber = QSysInfo::kernelVersion().split(".").last().toInt(); if (buildNumber < CONPTY_MINIMAL_WINDOWS_VERSION) return false; - return m_winContext.init(); + return WindowsContext::instance().init(); } void ConPtyProcess::moveToThread(QThread *targetThread) diff --git a/src/libs/3rdparty/libptyqt/conptyprocess.h b/src/libs/3rdparty/libptyqt/conptyprocess.h index d4ffd62b7ee..aaf56fe76f1 100644 --- a/src/libs/3rdparty/libptyqt/conptyprocess.h +++ b/src/libs/3rdparty/libptyqt/conptyprocess.h @@ -25,80 +25,6 @@ typedef VOID* HPCON; class QWinEventNotifier; -template <typename T> -std::vector<T> vectorFromString(const std::basic_string<T> &str) -{ - return std::vector<T>(str.begin(), str.end()); -} - -//ConPTY available only on Windows 10 releazed after 1903 (19H1) Windows release -class WindowsContext -{ -public: - typedef HRESULT (*CreatePseudoConsolePtr)( - COORD size, // ConPty Dimensions - HANDLE hInput, // ConPty Input - HANDLE hOutput, // ConPty Output - DWORD dwFlags, // ConPty Flags - HPCON* phPC); // ConPty Reference - - typedef HRESULT (*ResizePseudoConsolePtr)(HPCON hPC, COORD size); - - typedef VOID (*ClosePseudoConsolePtr)(HPCON hPC); - - WindowsContext() - : createPseudoConsole(nullptr) - , resizePseudoConsole(nullptr) - , closePseudoConsole(nullptr) - { - - } - - bool init() - { - //already initialized - if (createPseudoConsole) - return true; - - //try to load symbols from library - //if it fails -> we can't use ConPty API - HANDLE kernel32Handle = LoadLibraryExW(L"kernel32.dll", 0, 0); - - if (kernel32Handle != nullptr) - { - createPseudoConsole = (CreatePseudoConsolePtr)GetProcAddress((HMODULE)kernel32Handle, "CreatePseudoConsole"); - resizePseudoConsole = (ResizePseudoConsolePtr)GetProcAddress((HMODULE)kernel32Handle, "ResizePseudoConsole"); - closePseudoConsole = (ClosePseudoConsolePtr)GetProcAddress((HMODULE)kernel32Handle, "ClosePseudoConsole"); - if (createPseudoConsole == NULL || resizePseudoConsole == NULL || closePseudoConsole == NULL) - { - m_lastError = QString("WindowsContext/ConPty error: %1").arg("Invalid on load API functions"); - return false; - } - } - else - { - m_lastError = QString("WindowsContext/ConPty error: %1").arg("Unable to load kernel32"); - return false; - } - - return true; - } - - QString lastError() - { - return m_lastError; - } - -public: - //vars - CreatePseudoConsolePtr createPseudoConsole; - ResizePseudoConsolePtr resizePseudoConsole; - ClosePseudoConsolePtr closePseudoConsole; - -private: - QString m_lastError; -}; - class PtyBuffer : public QIODevice { friend class ConPtyProcess; @@ -141,7 +67,7 @@ public: virtual QIODevice *notifier(); virtual QByteArray readAll(); virtual qint64 write(const QByteArray &byteArray); - bool isAvailable(); + static bool isAvailable(); void moveToThread(QThread *targetThread); private: @@ -149,7 +75,6 @@ private: HRESULT initializeStartupInfoAttachedToPseudoConsole(STARTUPINFOEX* pStartupInfo, HPCON hPC); private: - WindowsContext m_winContext; HPCON m_ptyHandler{INVALID_HANDLE_VALUE}; HANDLE m_hPipeIn{INVALID_HANDLE_VALUE}, m_hPipeOut{INVALID_HANDLE_VALUE}; diff --git a/src/libs/3rdparty/libptyqt/iptyprocess.h b/src/libs/3rdparty/libptyqt/iptyprocess.h index 3d974908c86..7c255b9a5e8 100644 --- a/src/libs/3rdparty/libptyqt/iptyprocess.h +++ b/src/libs/3rdparty/libptyqt/iptyprocess.h @@ -32,7 +32,6 @@ public: virtual QIODevice *notifier() = 0; virtual QByteArray readAll() = 0; virtual qint64 write(const QByteArray &byteArray) = 0; - virtual bool isAvailable() = 0; virtual void moveToThread(QThread *targetThread) = 0; qint64 pid() { return m_pid; } QPair<qint16, qint16> size() { return m_size; } diff --git a/src/libs/3rdparty/libptyqt/ptyqt.cpp b/src/libs/3rdparty/libptyqt/ptyqt.cpp index b3e7aa1b164..06fe4498190 100644 --- a/src/libs/3rdparty/libptyqt/ptyqt.cpp +++ b/src/libs/3rdparty/libptyqt/ptyqt.cpp @@ -10,6 +10,15 @@ #include "unixptyprocess.h" #endif +bool PtyQt::isUsingConPTY() +{ +#ifdef Q_OS_WIN + if (ConPtyProcess::isAvailable() && qgetenv("QTC_USE_WINPTY").isEmpty()) + return true; +#endif + + return false; +} IPtyProcess *PtyQt::createPtyProcess(IPtyProcess::PtyType ptyType) { @@ -34,7 +43,7 @@ IPtyProcess *PtyQt::createPtyProcess(IPtyProcess::PtyType ptyType) } #ifdef Q_OS_WIN - if (ConPtyProcess().isAvailable() && qgetenv("QTC_USE_WINPTY").isEmpty()) + if (isUsingConPTY()) return new ConPtyProcess(); else return new WinPtyProcess(); @@ -43,3 +52,5 @@ IPtyProcess *PtyQt::createPtyProcess(IPtyProcess::PtyType ptyType) return new UnixPtyProcess(); #endif } + + diff --git a/src/libs/3rdparty/libptyqt/ptyqt.h b/src/libs/3rdparty/libptyqt/ptyqt.h index 23b80d346bb..85f27b33a9b 100644 --- a/src/libs/3rdparty/libptyqt/ptyqt.h +++ b/src/libs/3rdparty/libptyqt/ptyqt.h @@ -7,6 +7,8 @@ class PtyQt { public: static IPtyProcess *createPtyProcess(IPtyProcess::PtyType ptyType); + + static bool isUsingConPTY(); }; #endif // PTYQT_H diff --git a/src/libs/3rdparty/libptyqt/unixptyprocess.h b/src/libs/3rdparty/libptyqt/unixptyprocess.h index e4df0d2f74d..f7e3a2e5281 100644 --- a/src/libs/3rdparty/libptyqt/unixptyprocess.h +++ b/src/libs/3rdparty/libptyqt/unixptyprocess.h @@ -54,7 +54,7 @@ public: virtual QIODevice *notifier(); virtual QByteArray readAll(); virtual qint64 write(const QByteArray &byteArray); - virtual bool isAvailable(); + static bool isAvailable(); void moveToThread(QThread *targetThread); private: diff --git a/src/libs/3rdparty/libptyqt/winptyprocess.h b/src/libs/3rdparty/libptyqt/winptyprocess.h index 0bfb27c02c4..ee91fbdf8d6 100644 --- a/src/libs/3rdparty/libptyqt/winptyprocess.h +++ b/src/libs/3rdparty/libptyqt/winptyprocess.h @@ -26,7 +26,7 @@ public: QIODevice *notifier(); QByteArray readAll(); qint64 write(const QByteArray &byteArray); - bool isAvailable(); + static bool isAvailable(); void moveToThread(QThread *targetThread); private: diff --git a/src/libs/3rdparty/libvterm/src/state.c b/src/libs/3rdparty/libvterm/src/state.c index 313e746e77c..5362efbcd35 100644 --- a/src/libs/3rdparty/libvterm/src/state.c +++ b/src/libs/3rdparty/libvterm/src/state.c @@ -1311,8 +1311,10 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha break; case LEADER('?', 0x68): // DEC private mode set - if(!CSI_ARG_IS_MISSING(args[0])) - set_dec_mode(state, CSI_ARG(args[0]), 1); + for (int i = 0; i < argcount; i++) { + if (!CSI_ARG_IS_MISSING(args[i])) + set_dec_mode(state, CSI_ARG(args[i]), 1); + } break; case 0x6a: // HPB - ECMA-48 8.3.58 @@ -1333,8 +1335,10 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha break; case LEADER('?', 0x6c): // DEC private mode reset - if(!CSI_ARG_IS_MISSING(args[0])) - set_dec_mode(state, CSI_ARG(args[0]), 0); + for (int i = 0; i < argcount; i++) { + if (!CSI_ARG_IS_MISSING(args[i])) + set_dec_mode(state, CSI_ARG(args[i]), 0); + } break; case 0x6d: // SGR - ECMA-48 8.3.117 diff --git a/src/plugins/terminal/CMakeLists.txt b/src/plugins/terminal/CMakeLists.txt index c7b64cc8ad4..bf405b672ab 100644 --- a/src/plugins/terminal/CMakeLists.txt +++ b/src/plugins/terminal/CMakeLists.txt @@ -1,7 +1,7 @@ add_qtc_plugin(Terminal PLUGIN_DEPENDS Core ProjectExplorer - DEPENDS libvterm + DEPENDS libvterm ptyqt SOURCES celliterator.cpp celliterator.h glyphcache.cpp glyphcache.h diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index 853e1f66a05..3e4327dc235 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -54,9 +54,6 @@ TerminalPane::TerminalPane(QObject *parent) initActions(); - m_lockKeyboardButton = new QToolButton(); - m_lockKeyboardButton->setDefaultAction(&lockKeyboard); - m_newTerminalButton = new QToolButton(); m_newTerminalButton->setDefaultAction(&newTerminal); @@ -94,11 +91,34 @@ TerminalPane::TerminalPane(QObject *parent) connect(m_escSettingButton, &QToolButton::toggled, this, [this, updateEscButton] { settings().sendEscapeToTerminal.setValue(m_escSettingButton->isChecked()); - settings().writeSettings(); updateEscButton(); }); connect(&settings(), &TerminalSettings::applied, this, updateEscButton); + + const auto updateLockButton = [this] { + m_lockKeyboardButton->setChecked(settings().lockKeyboard()); + if (settings().lockKeyboard()) { + m_lockKeyboardButton->setIcon(LOCK_KEYBOARD_ICON.icon()); + m_lockKeyboardButton->setToolTip( + Tr::tr("Qt Creator shortcuts are blocked when focus is inside the terminal.")); + } else { + m_lockKeyboardButton->setIcon(UNLOCK_KEYBOARD_ICON.icon()); + m_lockKeyboardButton->setToolTip(Tr::tr("Qt Creator shortcuts take precedence.")); + } + }; + + m_lockKeyboardButton = new QToolButton(); + m_lockKeyboardButton->setCheckable(true); + + updateLockButton(); + + connect(m_lockKeyboardButton, &QToolButton::toggled, this, [this, updateLockButton] { + settings().lockKeyboard.setValue(m_lockKeyboardButton->isChecked()); + updateLockButton(); + }); + + connect(&settings(), &TerminalSettings::applied, this, updateLockButton); } TerminalPane::~TerminalPane() {} @@ -249,23 +269,6 @@ void TerminalPane::initActions() { createShellMenu(); - lockKeyboard.setCheckable(true); - lockKeyboard.setChecked(settings().lockKeyboard()); - - auto updateLockKeyboard = [this](bool locked) { - settings().lockKeyboard.setValue(locked); - if (locked) { - lockKeyboard.setIcon(LOCK_KEYBOARD_ICON.icon()); - lockKeyboard.setToolTip(Tr::tr("Sends keyboard shortcuts to Terminal.")); - } else { - lockKeyboard.setIcon(UNLOCK_KEYBOARD_ICON.icon()); - lockKeyboard.setToolTip(Tr::tr("Sends keyboard shortcuts to Qt Creator.")); - } - }; - - updateLockKeyboard(settings().lockKeyboard()); - connect(&lockKeyboard, &QAction::toggled, this, updateLockKeyboard); - newTerminal.setText(Tr::tr("New Terminal")); newTerminal.setIcon(NEW_TERMINAL_ICON.icon()); newTerminal.setToolTip(Tr::tr("Create a new Terminal.")); diff --git a/src/plugins/terminal/terminalpane.h b/src/plugins/terminal/terminalpane.h index 8a24e1cf302..bc25ade2b14 100644 --- a/src/plugins/terminal/terminalpane.h +++ b/src/plugins/terminal/terminalpane.h @@ -68,7 +68,6 @@ private: QAction nextTerminal; QAction prevTerminal; QAction closeTerminal; - QAction lockKeyboard; QMenu m_shellMenu; diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index f78173aa955..9240a100b60 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -8,6 +8,8 @@ #include <coreplugin/icore.h> #include <coreplugin/dialogs/ioptionspage.h> +#include <libptyqt/ptyqt.h> + #include <utils/dropsupport.h> #include <utils/environment.h> #include <utils/expected.h> @@ -410,12 +412,23 @@ TerminalSettings::TerminalSettings() "instead of closing the terminal.")); sendEscapeToTerminal.setDefaultValue(false); + lockKeyboard.setSettingsKey("LockKeyboard"); + lockKeyboard.setLabelText(Tr::tr("Block shortcuts in terminal")); + lockKeyboard.setToolTip( + Tr::tr("Keeps Qt Creator short cuts from interfering with the terminal.")); + lockKeyboard.setDefaultValue(true); + audibleBell.setSettingsKey("AudibleBell"); audibleBell.setLabelText(Tr::tr("Audible bell")); audibleBell.setToolTip(Tr::tr("Makes the terminal beep when a bell " "character is received.")); audibleBell.setDefaultValue(true); + enableMouseTracking.setSettingsKey("EnableMouseTracking"); + enableMouseTracking.setLabelText(Tr::tr("Enable mouse tracking")); + enableMouseTracking.setToolTip(Tr::tr("Enables mouse tracking in the terminal.")); + enableMouseTracking.setDefaultValue(true); + setupColor(this, foregroundColor, "Foreground", @@ -528,8 +541,10 @@ TerminalSettings::TerminalSettings() Column { enableTerminal, st, sendEscapeToTerminal, st, + lockKeyboard, st, audibleBell, st, allowBlinkingCursor, st, + enableMouseTracking, st, }, }, Group { diff --git a/src/plugins/terminal/terminalsettings.h b/src/plugins/terminal/terminalsettings.h index e253abf69e8..1400339dd8d 100644 --- a/src/plugins/terminal/terminalsettings.h +++ b/src/plugins/terminal/terminalsettings.h @@ -31,6 +31,8 @@ public: Utils::BoolAspect sendEscapeToTerminal{this}; Utils::BoolAspect audibleBell{this}; Utils::BoolAspect lockKeyboard{this}; + + Utils::BoolAspect enableMouseTracking{this}; }; TerminalSettings &settings(); diff --git a/src/plugins/terminal/terminalsurface.cpp b/src/plugins/terminal/terminalsurface.cpp index 802ff59a124..24e881b35cf 100644 --- a/src/plugins/terminal/terminalsurface.cpp +++ b/src/plugins/terminal/terminalsurface.cpp @@ -494,6 +494,39 @@ ShellIntegration *TerminalSurface::shellIntegration() const return d->m_shellIntegration; } +void TerminalSurface::mouseMove(QPoint pos, Qt::KeyboardModifiers modifiers) +{ + vterm_mouse_move(d->m_vterm.get(), pos.y(), pos.x(), Internal::qtModifierToVTerm(modifiers)); +} + +void TerminalSurface::mouseButton(Qt::MouseButton button, + bool pressed, + Qt::KeyboardModifiers modifiers) +{ + int btnIdx = 0; + switch (button) { + case Qt::LeftButton: + btnIdx = 1; + break; + case Qt::RightButton: + btnIdx = 3; + break; + case Qt::MiddleButton: + btnIdx = 2; + break; + case Qt::ExtraButton1: + btnIdx = 4; + break; + case Qt::ExtraButton2: + btnIdx = 5; + break; + default: + return; + } + + vterm_mouse_button(d->m_vterm.get(), btnIdx, pressed, Internal::qtModifierToVTerm(modifiers)); +} + CellIterator TerminalSurface::begin() const { auto res = CellIterator(this, {0, 0}); diff --git a/src/plugins/terminal/terminalsurface.h b/src/plugins/terminal/terminalsurface.h index f6e463ac8dd..09a86f26e73 100644 --- a/src/plugins/terminal/terminalsurface.h +++ b/src/plugins/terminal/terminalsurface.h @@ -95,6 +95,8 @@ public: ShellIntegration *shellIntegration() const; + void mouseMove(QPoint pos, Qt::KeyboardModifiers modifiers); + void mouseButton(Qt::MouseButton button, bool pressed, Qt::KeyboardModifiers modifiers); signals: void writeToPty(const QByteArray &data); void invalidated(QRect grid); diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 63826ea6d99..72b7e103483 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -1280,6 +1280,14 @@ void TerminalWidget::updateViewportRect(const QRect &rect) void TerminalWidget::wheelEvent(QWheelEvent *event) { verticalScrollBar()->event(event); + + if (!settings().enableMouseTracking()) + return; + + if (event->angleDelta().ry() > 0) + m_surface->mouseButton(Qt::ExtraButton1, true, event->modifiers()); + else if (event->angleDelta().ry() < 0) + m_surface->mouseButton(Qt::ExtraButton2, true, event->modifiers()); } void TerminalWidget::focusInEvent(QFocusEvent *) @@ -1306,8 +1314,18 @@ void TerminalWidget::inputMethodEvent(QInputMethodEvent *event) m_surface->sendKey(event->commitString()); } +QPoint TerminalWidget::toGridPos(QMouseEvent *event) const +{ + return globalToGrid(event->pos().toPointF() + QPointF(0, -topMargin() + 0.5)); +} + void TerminalWidget::mousePressEvent(QMouseEvent *event) { + if (settings().enableMouseTracking()) { + m_surface->mouseMove(toGridPos(event), event->modifiers()); + m_surface->mouseButton(event->button(), true, event->modifiers()); + } + m_scrollDirection = 0; m_activeMouseSelect.start = viewportToGlobal(event->pos()); @@ -1383,8 +1401,12 @@ void TerminalWidget::mousePressEvent(QMouseEvent *event) } } } + void TerminalWidget::mouseMoveEvent(QMouseEvent *event) { + if (settings().enableMouseTracking()) + m_surface->mouseMove(toGridPos(event), event->modifiers()); + if (m_selection && event->buttons() & Qt::LeftButton) { Selection newSelection = *m_selection; int scrollVelocity = 0; @@ -1487,6 +1509,11 @@ bool TerminalWidget::checkLinkAt(const QPoint &pos) void TerminalWidget::mouseReleaseEvent(QMouseEvent *event) { + if (settings().enableMouseTracking()) { + m_surface->mouseMove(toGridPos(event), event->modifiers()); + m_surface->mouseButton(event->button(), false, event->modifiers()); + } + m_scrollTimer.stop(); if (m_selection && event->button() == Qt::LeftButton) { @@ -1528,6 +1555,12 @@ TerminalWidget::TextAndOffsets TerminalWidget::textAt(const QPoint &pos) const void TerminalWidget::mouseDoubleClickEvent(QMouseEvent *event) { + if (settings().enableMouseTracking()) { + m_surface->mouseMove(toGridPos(event), event->modifiers()); + m_surface->mouseButton(event->button(), true, event->modifiers()); + m_surface->mouseButton(event->button(), false, event->modifiers()); + } + const auto hit = textAt(event->pos()); setSelection(Selection{hit.start, hit.end, true}); diff --git a/src/plugins/terminal/terminalwidget.h b/src/plugins/terminal/terminalwidget.h index 66f721df5da..2801ea4fc16 100644 --- a/src/plugins/terminal/terminalwidget.h +++ b/src/plugins/terminal/terminalwidget.h @@ -156,6 +156,7 @@ protected: QPoint globalToGrid(QPointF p) const; QPointF gridToGlobal(QPoint p, bool bottom = false, bool right = false) const; QRect gridToViewport(QRect rect) const; + QPoint toGridPos(QMouseEvent *event) const; void updateViewport(); void updateViewportRect(const QRect &rect); From b880525e68d68c2f932ed89909dcf7164e5576cd Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 12:07:11 +0200 Subject: [PATCH 0510/1777] Vcs: Use a StringAspect again for settings().path() This holds a path list, i.e. possibly several directories, separated by ';' or ':'. PathChooser can't handle that. Long term this could be something more sophisticate, but for now it's more a "string" than one FilePath. Change-Id: I6665c131e698db3afd268d6ab9bcf3d76a7c7289 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/git/gitclient.cpp | 3 +-- src/plugins/git/gitsettings.cpp | 4 ++-- src/plugins/vcsbase/vcsbaseclientsettings.cpp | 2 +- src/plugins/vcsbase/vcsbaseclientsettings.h | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 53d738cbe82..a503557d692 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -2108,8 +2108,7 @@ bool GitClient::synchronousApplyPatch(const FilePath &workingDirectory, Environment GitClient::processEnvironment() const { Environment environment = VcsBaseClientImpl::processEnvironment(); - const FilePath gitPath = settings().path(); - environment.prependOrSetPath(gitPath); + environment.prependOrSetPath(settings().path()); if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment()) { QString homePath; if (qtcEnvironmentVariableIsEmpty("HOMESHARE")) { diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index b0cedb300c7..62ef1f15eb2 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -160,7 +160,7 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const if (tryResolve) { resolvedBinPath = binaryPath(); if (!resolvedBinPath.isAbsolutePath()) - resolvedBinPath = resolvedBinPath.searchInPath({path()}, FilePath::PrependToPath); + resolvedBinPath = resolvedBinPath.searchInPath(searchPathList(), FilePath::PrependToPath); tryResolve = false; } @@ -169,7 +169,7 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const *ok = false; if (errorMessage) *errorMessage = Tr::tr("The binary \"%1\" could not be located in the path \"%2\"") - .arg(binaryPath().toUserOutput(), path().toUserOutput()); + .arg(binaryPath().toUserOutput(), path()); } return resolvedBinPath; } diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.cpp b/src/plugins/vcsbase/vcsbaseclientsettings.cpp index e9e6d86136f..33d9b34a6c1 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.cpp +++ b/src/plugins/vcsbase/vcsbaseclientsettings.cpp @@ -39,7 +39,7 @@ VcsBaseSettings::~VcsBaseSettings() = default; FilePaths VcsBaseSettings::searchPathList() const { // FIXME: Filepathify - return Utils::transform(path.value().split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts), + return Utils::transform(path().split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts), &FilePath::fromUserInput); } diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.h b/src/plugins/vcsbase/vcsbaseclientsettings.h index abf79d35988..e998434910f 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.h +++ b/src/plugins/vcsbase/vcsbaseclientsettings.h @@ -20,7 +20,7 @@ public: Utils::StringAspect userEmail{this}; Utils::IntegerAspect logCount{this}; Utils::IntegerAspect timeout{this}; // Seconds - Utils::FilePathAspect path{this}; + Utils::StringAspect path{this}; Utils::FilePaths searchPathList() const; }; From 44189c45905753a9a296da07c499f4d86744b104 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 18 Jul 2023 22:38:37 +0200 Subject: [PATCH 0511/1777] BuildStep: Drop using ProjectConfiguration::parent The parent function isn't used anymore after the amended change. Originally, it was introduced in 9d206a2bc45af5ae4680fad0ab0db9b6415abcda, when things still relied on QObject hierarchy. Amends 06a57f8c42247462dcd8264f69ec98703e512bf0 Change-Id: I9e3a2bbaf4c4cac308a18cbe5cf5905f2655443f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/buildstep.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 6bc195f431c..c22579f75fe 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -130,8 +130,6 @@ protected: void setCancelMessage(const QString &message); private: - using ProjectConfiguration::parent; - friend class BuildManager; virtual Tasking::GroupItem runRecipe() = 0; From 55b9e3d151d1f1f552fb39a90f09b3e3ef17a4cd Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 26 Jul 2023 17:14:56 +0200 Subject: [PATCH 0512/1777] LibVTerm: Integrate upstream changes Change-Id: I9636eead9f9426f4d7754af8dede19956bc1fb8c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/3rdparty/libvterm/src/screen.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/libs/3rdparty/libvterm/src/screen.c b/src/libs/3rdparty/libvterm/src/screen.c index 9d1028e67ae..6c549094a9a 100644 --- a/src/libs/3rdparty/libvterm/src/screen.c +++ b/src/libs/3rdparty/libvterm/src/screen.c @@ -595,8 +595,15 @@ static void resize_buffer(VTermScreen *screen, int bufidx, int new_rows, int new new_row_start, new_row_end, old_row_start, old_row_end, width); #endif - if(new_row_start < 0) + if(new_row_start < 0) { + if(old_row_start <= old_cursor.row && old_cursor.row < old_row_end) { + new_cursor.row = 0; + new_cursor.col = old_cursor.col; + if(new_cursor.col >= new_cols) + new_cursor.col = new_cols-1; + } break; + } for(new_row = new_row_start, old_row = old_row_start; new_row <= new_row_end; new_row++) { int count = width >= new_cols ? new_cols : width; @@ -660,8 +667,9 @@ static void resize_buffer(VTermScreen *screen, int bufidx, int new_rows, int new if(old_row >= 0 && bufidx == BUFIDX_PRIMARY) { /* Push spare lines to scrollback buffer */ - for(int row = 0; row <= old_row; row++) - sb_pushline_from_row(screen, row); + if(screen->callbacks && screen->callbacks->sb_pushline) + for(int row = 0; row <= old_row; row++) + sb_pushline_from_row(screen, row); if(active) statefields->pos.row -= (old_row + 1); } From 323e94c2fa91aeef7e6030ab0ef4909eedd3e358 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 07:39:55 +0200 Subject: [PATCH 0513/1777] Debugger: Use AspectContainer directly for L&E settings page layout Change-Id: I538362541e67499ee1a93fbd5452bdd76694f87b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/debugger/commonoptionspage.cpp | 165 ++++++++++++++++----- src/plugins/debugger/commonoptionspage.h | 24 ++- src/plugins/debugger/debuggeractions.cpp | 121 ++------------- src/plugins/debugger/debuggeractions.h | 24 +-- src/plugins/debugger/debuggerplugin.cpp | 1 - 5 files changed, 180 insertions(+), 155 deletions(-) diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 053031e2974..9418c704d6f 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -11,6 +11,8 @@ #include "registerpostmortemaction.h" #endif +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/layoutbuilder.h> #include <QGuiApplication> @@ -205,21 +207,110 @@ public: const CommonSettingsPage commonSettingsPage; -/////////////////////////////////////////////////////////////////////// -// -// LocalsAndExpressionsOptionsPage -// -/////////////////////////////////////////////////////////////////////// -class LocalsAndExpressionsOptionsPageWidget : public IOptionsPageWidget +// LocalsAndExpressions + +LocalsAndExpressionsSettings &localsAndExpressionSettings() { -public: - LocalsAndExpressionsOptionsPageWidget() - { - DebuggerSettings &s = settings(); - setOnApply([&s] { s.page4.apply(); s.page4.writeSettings(); }); - setOnFinish([&s] { s.page4.finish(); }); + static LocalsAndExpressionsSettings settings; + return settings; +} +LocalsAndExpressionsSettings::LocalsAndExpressionsSettings() +{ + setAutoApply(false); + + const QString debugModeGroup("DebugMode"); + + useDebuggingHelpers.setSettingsKey(debugModeGroup, "UseDebuggingHelper"); + useDebuggingHelpers.setDefaultValue(true); + useDebuggingHelpers.setLabelText(Tr::tr("Use Debugging Helpers")); + + useCodeModel.setSettingsKey(debugModeGroup, "UseCodeModel"); + useCodeModel.setDefaultValue(true); + useCodeModel.setLabelText(Tr::tr("Use code model")); + useCodeModel.setToolTip( + "<p>" + + Tr::tr("Selecting this causes the C++ Code Model being asked " + "for variable scope information. This might result in slightly faster " + "debugger operation but may fail for optimized code.")); + + showThreadNames.setSettingsKey(debugModeGroup, "ShowThreadNames"); + showThreadNames.setLabelText(Tr::tr("Display thread names")); + showThreadNames.setToolTip("<p>" + Tr::tr("Displays names of QThread based threads.")); + + showStdNamespace.setSettingsKey(debugModeGroup, "ShowStandardNamespace"); + showStdNamespace.setDefaultValue(true); + showStdNamespace.setDisplayName(Tr::tr("Show \"std::\" Namespace in Types")); + showStdNamespace.setLabelText(Tr::tr("Show \"std::\" namespace in types")); + showStdNamespace.setToolTip( + "<p>" + Tr::tr("Shows \"std::\" prefix for types from the standard library.")); + + showQtNamespace.setSettingsKey(debugModeGroup, "ShowQtNamespace"); + showQtNamespace.setDefaultValue(true); + showQtNamespace.setDisplayName(Tr::tr("Show Qt's Namespace in Types")); + showQtNamespace.setLabelText(Tr::tr("Show Qt's namespace in types")); + showQtNamespace.setToolTip("<p>" + + Tr::tr("Shows Qt namespace prefix for Qt types. This is only " + "relevant if Qt was configured with \"-qtnamespace\".")); + + showQObjectNames.setSettingsKey(debugModeGroup, "ShowQObjectNames2"); + showQObjectNames.setDefaultValue(true); + showQObjectNames.setDisplayName(Tr::tr("Show QObject names if available")); + showQObjectNames.setLabelText(Tr::tr("Show QObject names if available")); + showQObjectNames.setToolTip( + "<p>" + + Tr::tr("Displays the objectName property of QObject based items. " + "Note that this can negatively impact debugger performance " + "even if no QObjects are present.")); + + extraDumperCommands.setSettingsKey(debugModeGroup, "GdbCustomDumperCommands"); + extraDumperCommands.setDisplayStyle(StringAspect::TextEditDisplay); + extraDumperCommands.setUseGlobalMacroExpander(); + extraDumperCommands.setToolTip("<html><head/><body><p>" + + Tr::tr("Python commands entered here will be executed after built-in " + "debugging helpers have been loaded and fully initialized. You can " + "load additional debugging helpers or modify existing ones here.") + + "</p></body></html>"); + + extraDumperFile.setSettingsKey(debugModeGroup, "ExtraDumperFile"); + extraDumperFile.setDisplayName(Tr::tr("Extra Debugging Helpers")); + // Label text is intentional empty in the GUI. + extraDumperFile.setToolTip(Tr::tr("Path to a Python file containing additional data dumpers.")); + + displayStringLimit.setSettingsKey(debugModeGroup, "DisplayStringLimit"); + displayStringLimit.setDefaultValue(300); + displayStringLimit.setSpecialValueText(Tr::tr("<unlimited>")); + displayStringLimit.setRange(20, 10000); + displayStringLimit.setSingleStep(10); + displayStringLimit.setLabelText(Tr::tr("Display string length:")); + displayStringLimit.setToolTip( + "<p>" + + Tr::tr("The maximum length of string entries in the " + "Locals and Expressions views. Longer than that are cut off " + "and displayed with an ellipsis attached.")); + + maximalStringLength.setSettingsKey(debugModeGroup, "MaximalStringLength"); + maximalStringLength.setDefaultValue(10000); + maximalStringLength.setSpecialValueText(Tr::tr("<unlimited>")); + maximalStringLength.setRange(20, 10000000); + maximalStringLength.setSingleStep(20); + maximalStringLength.setLabelText(Tr::tr("Maximum string length:")); + maximalStringLength.setToolTip( + "<p>" + + Tr::tr("The maximum length for strings in separated windows. " + "Longer strings are cut off and displayed with an ellipsis attached.")); + + defaultArraySize.setSettingsKey(debugModeGroup, "DefaultArraySize"); + defaultArraySize.setDefaultValue(100); + defaultArraySize.setRange(10, 1000000000); + defaultArraySize.setSingleStep(100); + defaultArraySize.setLabelText(Tr::tr("Default array size:")); + defaultArraySize.setToolTip("<p>" + + Tr::tr("The number of array elements requested when expanding " + "entries in the Locals and Expressions views.")); + + setLayouter([this] { auto label = new QLabel; //(useHelperGroup); label->setTextFormat(Qt::AutoText); label->setWordWrap(true); @@ -232,9 +323,9 @@ public: using namespace Layouting; Column left { label, - s.useCodeModel, - s.showThreadNames, - Group { title(Tr::tr("Extra Debugging Helper")), Column { s.extraDumperFile } } + useCodeModel, + showThreadNames, + Group { title(Tr::tr("Extra Debugging Helper")), Column { extraDumperFile } } }; Group useHelper { @@ -242,38 +333,46 @@ public: left, Group { title(Tr::tr("Debugging Helper Customization")), - Column { s.extraDumperCommands } + Column { extraDumperCommands } } } }; Grid limits { - s.maximalStringLength, br, - s.displayStringLimit, br, - s.defaultArraySize + maximalStringLength, br, + displayStringLimit, br, + defaultArraySize }; - Column { - s.useDebuggingHelpers, + return Column { + useDebuggingHelpers, useHelper, Space(10), - s.showStdNamespace, - s.showQtNamespace, - s.showQObjectNames, + showStdNamespace, + showQtNamespace, + showQObjectNames, Space(10), Row { limits, st }, st - }.attachTo(this); + }; + }); + + readSettings(); +} + +class LocalsAndExpressionsSettingsPage final : public Core::IOptionsPage +{ +public: + LocalsAndExpressionsSettingsPage() + { + setId("Z.Debugger.LocalsAndExpressions"); + //: '&&' will appear as one (one is marking keyboard shortcut) + setDisplayName(Tr::tr("Locals && Expressions")); + setCategory(DEBUGGER_SETTINGS_CATEGORY); + setSettingsProvider([] { return &localsAndExpressionSettings(); }); } }; -LocalsAndExpressionsOptionsPage::LocalsAndExpressionsOptionsPage() -{ - setId("Z.Debugger.LocalsAndExpressions"); - //: '&&' will appear as one (one is marking keyboard shortcut) - setDisplayName(Tr::tr("Locals && Expressions")); - setCategory(DEBUGGER_SETTINGS_CATEGORY); - setWidgetCreator([] { return new LocalsAndExpressionsOptionsPageWidget; }); -} +const LocalsAndExpressionsSettingsPage localsAndExpressionSettingsPage; } // Debugger::Internal diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h index d60658710a4..6b890b53a56 100644 --- a/src/plugins/debugger/commonoptionspage.h +++ b/src/plugins/debugger/commonoptionspage.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> namespace Debugger::Internal { @@ -66,12 +66,30 @@ public: CommonSettings &commonSettings(); -class LocalsAndExpressionsOptionsPage final : public Core::IOptionsPage + +class LocalsAndExpressionsSettings final : public Utils::AspectContainer { public: - LocalsAndExpressionsOptionsPage(); + LocalsAndExpressionsSettings(); + + Utils::BoolAspect useDebuggingHelpers{this}; + Utils::BoolAspect useCodeModel{this}; + Utils::BoolAspect showThreadNames{this}; + Utils::FilePathAspect extraDumperFile{this}; // For loading a file. Recommended. + Utils::StringAspect extraDumperCommands{this}; // To modify an existing setup. + + Utils::BoolAspect showStdNamespace{this}; + Utils::BoolAspect showQtNamespace{this}; + Utils::BoolAspect showQObjectNames{this}; + + Utils::IntegerAspect maximalStringLength{this}; + Utils::IntegerAspect displayStringLimit{this}; + Utils::IntegerAspect defaultArraySize{this}; }; +LocalsAndExpressionsSettings &localsAndExpressionSettings(); + + } // Debugger::Internal Q_DECLARE_METATYPE(Debugger::Internal::SourcePathMap) diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 17c9ca32587..c6f91192396 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -70,7 +70,21 @@ DebuggerSettings::DebuggerSettings() : breakOnFatal{gdbSettings().breakOnFatal}, breakOnAbort{gdbSettings().breakOnAbort}, enableReverseDebugging{gdbSettings().enableReverseDebugging}, - multiInferior{gdbSettings().multiInferior} + multiInferior{gdbSettings().multiInferior}, + + // Page 4 + useDebuggingHelpers{localsAndExpressionSettings().useDebuggingHelpers}, + useCodeModel{localsAndExpressionSettings().useCodeModel}, + showThreadNames{localsAndExpressionSettings().showThreadNames}, + extraDumperFile{localsAndExpressionSettings().extraDumperFile}, // For loading a file. Recommended. + extraDumperCommands{localsAndExpressionSettings().extraDumperCommands}, // To modify an existing setup. + + showStdNamespace{localsAndExpressionSettings().showStdNamespace}, + showQtNamespace{localsAndExpressionSettings().showQtNamespace}, + showQObjectNames{localsAndExpressionSettings().showQObjectNames}, + maximalStringLength{localsAndExpressionSettings().maximalStringLength}, + displayStringLimit{localsAndExpressionSettings().displayStringLimit}, + defaultArraySize{localsAndExpressionSettings().defaultArraySize} { const QString debugModeGroup("DebugMode"); const QString cdbSettingsGroup("CDB2"); @@ -175,76 +189,16 @@ DebuggerSettings::DebuggerSettings() : // // Locals & Watchers - // - showStdNamespace.setSettingsKey(debugModeGroup, "ShowStandardNamespace"); - showStdNamespace.setDefaultValue(true); - showStdNamespace.setDisplayName(Tr::tr("Show \"std::\" Namespace in Types")); - showStdNamespace.setLabelText(Tr::tr("Show \"std::\" namespace in types")); - showStdNamespace.setToolTip( - "<p>" + Tr::tr("Shows \"std::\" prefix for types from the standard library.")); - - showQtNamespace.setSettingsKey(debugModeGroup, "ShowQtNamespace"); - showQtNamespace.setDefaultValue(true); - showQtNamespace.setDisplayName(Tr::tr("Show Qt's Namespace in Types")); - showQtNamespace.setLabelText(Tr::tr("Show Qt's namespace in types")); - showQtNamespace.setToolTip("<p>" - + Tr::tr("Shows Qt namespace prefix for Qt types. This is only " - "relevant if Qt was configured with \"-qtnamespace\".")); - - showQObjectNames.setSettingsKey(debugModeGroup, "ShowQObjectNames2"); - showQObjectNames.setDefaultValue(true); - showQObjectNames.setDisplayName(Tr::tr("Show QObject names if available")); - showQObjectNames.setLabelText(Tr::tr("Show QObject names if available")); - showQObjectNames.setToolTip( - "<p>" - + Tr::tr("Displays the objectName property of QObject based items. " - "Note that this can negatively impact debugger performance " - "even if no QObjects are present.")); - sortStructMembers.setSettingsKey(debugModeGroup, "SortStructMembers"); sortStructMembers.setDisplayName(Tr::tr("Sort Members of Classes and Structs Alphabetically")); sortStructMembers.setLabelText(Tr::tr("Sort members of classes and structs alphabetically")); sortStructMembers.setDefaultValue(true); - // - // DebuggingHelper - // - useDebuggingHelpers.setSettingsKey(debugModeGroup, "UseDebuggingHelper"); - useDebuggingHelpers.setDefaultValue(true); - useDebuggingHelpers.setLabelText(Tr::tr("Use Debugging Helpers")); - - useCodeModel.setSettingsKey(debugModeGroup, "UseCodeModel"); - useCodeModel.setDefaultValue(true); - useCodeModel.setLabelText(Tr::tr("Use code model")); - useCodeModel.setToolTip( - "<p>" - + Tr::tr("Selecting this causes the C++ Code Model being asked " - "for variable scope information. This might result in slightly faster " - "debugger operation but may fail for optimized code.")); - - showThreadNames.setSettingsKey(debugModeGroup, "ShowThreadNames"); - showThreadNames.setLabelText(Tr::tr("Display thread names")); - showThreadNames.setToolTip("<p>" + Tr::tr("Displays names of QThread based threads.")); - // // Breakpoints // synchronizeBreakpoints.setLabelText(Tr::tr("Synchronize Breakpoints")); - extraDumperCommands.setSettingsKey(debugModeGroup, "GdbCustomDumperCommands"); - extraDumperCommands.setDisplayStyle(StringAspect::TextEditDisplay); - extraDumperCommands.setUseGlobalMacroExpander(); - extraDumperCommands.setToolTip("<html><head/><body><p>" - + Tr::tr("Python commands entered here will be executed after built-in " - "debugging helpers have been loaded and fully initialized. You can " - "load additional debugging helpers or modify existing ones here.") - + "</p></body></html>"); - - extraDumperFile.setSettingsKey(debugModeGroup, "ExtraDumperFile"); - extraDumperFile.setDisplayName(Tr::tr("Extra Debugging Helpers")); - // Label text is intentional empty in the GUI. - extraDumperFile.setToolTip(Tr::tr("Path to a Python file containing additional data dumpers.")); - autoQuit.setSettingsKey(debugModeGroup, "AutoQuit"); autoQuit.setLabelText(Tr::tr("Automatically Quit Debugger")); @@ -277,38 +231,6 @@ DebuggerSettings::DebuggerSettings() : selectedPluginBreakpointsPattern.setSettingsKey(debugModeGroup, "SelectedPluginBreakpointsPattern"); selectedPluginBreakpointsPattern.setDefaultValue(QString(".*")); - displayStringLimit.setSettingsKey(debugModeGroup, "DisplayStringLimit"); - displayStringLimit.setDefaultValue(300); - displayStringLimit.setSpecialValueText(Tr::tr("<unlimited>")); - displayStringLimit.setRange(20, 10000); - displayStringLimit.setSingleStep(10); - displayStringLimit.setLabelText(Tr::tr("Display string length:")); - displayStringLimit.setToolTip( - "<p>" - + Tr::tr("The maximum length of string entries in the " - "Locals and Expressions views. Longer than that are cut off " - "and displayed with an ellipsis attached.")); - - maximalStringLength.setSettingsKey(debugModeGroup, "MaximalStringLength"); - maximalStringLength.setDefaultValue(10000); - maximalStringLength.setSpecialValueText(Tr::tr("<unlimited>")); - maximalStringLength.setRange(20, 10000000); - maximalStringLength.setSingleStep(20); - maximalStringLength.setLabelText(Tr::tr("Maximum string length:")); - maximalStringLength.setToolTip( - "<p>" - + Tr::tr("The maximum length for strings in separated windows. " - "Longer strings are cut off and displayed with an ellipsis attached.")); - - defaultArraySize.setSettingsKey(debugModeGroup, "DefaultArraySize"); - defaultArraySize.setDefaultValue(100); - defaultArraySize.setRange(10, 1000000000); - defaultArraySize.setSingleStep(100); - defaultArraySize.setLabelText(Tr::tr("Default array size:")); - defaultArraySize.setToolTip("<p>" - + Tr::tr("The number of array elements requested when expanding " - "entries in the Locals and Expressions views.")); - expandStack.setLabelText(Tr::tr("Reload Full Stack")); createFullBacktrace.setLabelText(Tr::tr("Create Full Backtrace")); @@ -319,18 +241,6 @@ DebuggerSettings::DebuggerSettings() : const QString qmlInspectorGroup = "QML.Inspector"; showAppOnTop.setSettingsKey(qmlInspectorGroup, "QmlInspector.ShowAppOnTop"); - // Page 4 - page4.registerAspect(&useDebuggingHelpers); - page4.registerAspect(&useCodeModel); - page4.registerAspect(&showThreadNames); - page4.registerAspect(&showStdNamespace); - page4.registerAspect(&showQtNamespace); - page4.registerAspect(&extraDumperFile); - page4.registerAspect(&extraDumperCommands); - page4.registerAspect(&showQObjectNames); - page4.registerAspect(&displayStringLimit); - page4.registerAspect(&maximalStringLength); - page4.registerAspect(&defaultArraySize); // Page 5 page5.registerAspect(&cdbAdditionalArguments); @@ -357,7 +267,6 @@ DebuggerSettings::DebuggerSettings() : all.registerAspect(&sortStructMembers); // Collect all - all.registerAspects(page4); all.registerAspects(page5); all.registerAspects(page6); diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index 689580dca9a..f20d60839b0 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -62,15 +62,19 @@ public: Utils::BoolAspect &multiInferior; // Page 4: Locals and expressions - Utils::BoolAspect useDebuggingHelpers; - Utils::BoolAspect useCodeModel; - Utils::BoolAspect showThreadNames; - Utils::FilePathAspect extraDumperFile; // For loading a file. Recommended. - Utils::StringAspect extraDumperCommands; // To modify an existing setup. + Utils::BoolAspect &useDebuggingHelpers; + Utils::BoolAspect &useCodeModel; + Utils::BoolAspect &showThreadNames; + Utils::FilePathAspect &extraDumperFile; // For loading a file. Recommended. + Utils::StringAspect &extraDumperCommands; // To modify an existing setup. - Utils::BoolAspect showStdNamespace; - Utils::BoolAspect showQtNamespace; - Utils::BoolAspect showQObjectNames; + Utils::BoolAspect &showStdNamespace; + Utils::BoolAspect &showQtNamespace; + Utils::BoolAspect &showQObjectNames; + + Utils::IntegerAspect &maximalStringLength; + Utils::IntegerAspect &displayStringLimit; + Utils::IntegerAspect &defaultArraySize; // Page 5: CDB Utils::StringAspect cdbAdditionalArguments; @@ -101,9 +105,6 @@ public: // Watchers & Locals Utils::BoolAspect autoDerefPointers; - Utils::IntegerAspect maximalStringLength; - Utils::IntegerAspect displayStringLimit; - Utils::IntegerAspect defaultArraySize; Utils::BoolAspect sortStructMembers; Utils::BoolAspect useToolTipsInLocalsView; @@ -119,7 +120,6 @@ public: Utils::BoolAspect showAppOnTop; Utils::AspectContainer all; // All - Utils::AspectContainer page4; // Locals & Expressions Utils::AspectContainer page5; // CDB Utils::AspectContainer page6; // CDB Paths diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 18d68ac2bb9..e9acc715755 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1122,7 +1122,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) // QTC_CHECK(false); // }); - m_optionPages.append(new LocalsAndExpressionsOptionsPage); addCdbOptionPages(&m_optionPages); connect(ModeManager::instance(), &ModeManager::currentModeAboutToChange, this, [] { From ddbfdb6f3f04f21305cfef56783cf1b451bcab9a Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 19 Jul 2023 09:47:43 +0200 Subject: [PATCH 0514/1777] ProjectExplorer: Fix 10 seconds hang on shutdown Delete the RunControl directly when it's not running. Do it in two cases: when tab is closed and when tab is reused with a new RunControl instance. In other case, queue the call to initiateStop, so that any possible deleteLater() is called when the nested event loop of the shutdown is already spinning. It looks like the amended changes introduced the hang when compiled against Qt 6.5. When compiled against Qt 6.4 the regression doesn't occur. The regression is caused by 449b45ff34ce4a45e5d6a24967566f69f43ebbb6. Amends c1f6d7044589f7842d19fc7b44574152ce72a20f Amends 6e16512eba2c39baa714fa253843b2171ba24f47 Change-Id: Icb3ba757f32bccb3daae675b2eb516f75b84530a Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/projectexplorer/appoutputpane.cpp | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index c69aeaf828c..2255d96b5e9 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -407,10 +407,9 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) }); if (tab != m_runControlTabs.end()) { // Reuse this tab - if (tab->runControl) { - tab->runControl->setAutoDeleteOnStop(true); - tab->runControl->initiateStop(); - } + if (tab->runControl) + delete tab->runControl; + tab->runControl = rc; tab->window->reset(); rc->setupFormatter(tab->window->outputFormatter()); @@ -645,12 +644,18 @@ void AppOutputPane::closeTab(int tabIndex, CloseTabMode closeTabMode) m_tabWidget->removeTab(tabIndex); delete window; + Utils::erase(m_runControlTabs, [runControl](const RunControlTab &t) { + return t.runControl == runControl; }); if (runControl) { - runControl->setAutoDeleteOnStop(true); - runControl->initiateStop(); + if (runControl->isRunning()) { + QMetaObject::invokeMethod(runControl, [runControl] { + runControl->setAutoDeleteOnStop(true); + runControl->initiateStop(); + }, Qt::QueuedConnection); + } else { + delete runControl; + } } - Utils::erase(m_runControlTabs, [tab](const RunControlTab &t) { - return t.runControl == tab->runControl; }); updateCloseActions(); setFilteringEnabled(m_tabWidget->count() > 0); From 4c5e3aa6bae2ee209f4c42e55ec36375a568409b Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 20 Jul 2023 13:09:30 +0200 Subject: [PATCH 0515/1777] Utils: Fix BoolAspect::action Change-Id: I6c82dfd5ec15eae16091e4ab52b552b636fbcca6 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index ff7806bd84f..c606c3dff67 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1529,7 +1529,9 @@ QAction *BoolAspect::action() act->setChecked(m_internal); act->setToolTip(toolTip()); connect(act, &QAction::triggered, this, [this](bool newValue) { - setValue(newValue); + setVolatileValue(newValue); + if (isAutoApply()) + apply(); }); return act; } From 424898873d5cb58f37f547c40f4f761e0e9a1163 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 25 Jul 2023 14:26:24 +0200 Subject: [PATCH 0516/1777] Core: Move settings category icon creation closer to its first use No real difference in performance, just stuff closer to its use. Change-Id: Ib41209fc90872743a3baa692c9bc32c87e951ad5 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/clangtools/clangtoolsplugin.cpp | 1 + .../coreplugin/dialogs/ioptionspage.cpp | 17 +++++------------ src/plugins/coreplugin/dialogs/ioptionspage.h | 19 ++++++------------- .../coreplugin/dialogs/settingsdialog.cpp | 13 +++++++++---- src/plugins/designer/formeditor.cpp | 2 ++ src/plugins/designer/settingspage.cpp | 3 +-- src/plugins/nim/nimplugin.cpp | 2 ++ 7 files changed, 26 insertions(+), 31 deletions(-) diff --git a/src/plugins/clangtools/clangtoolsplugin.cpp b/src/plugins/clangtools/clangtoolsplugin.cpp index 8a5815f116b..dda49864eff 100644 --- a/src/plugins/clangtools/clangtoolsplugin.cpp +++ b/src/plugins/clangtools/clangtoolsplugin.cpp @@ -17,6 +17,7 @@ #include "clangtoolsunittests.h" #endif +#include <utils/icon.h> #include <utils/mimeutils.h> #include <utils/qtcassert.h> #include <utils/stylehelper.h> diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.cpp b/src/plugins/coreplugin/dialogs/ioptionspage.cpp index a4762169000..ffd27f85725 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.cpp +++ b/src/plugins/coreplugin/dialogs/ioptionspage.cpp @@ -7,14 +7,12 @@ #include "ioptionspage.h" #include <utils/algorithm.h> -#include <utils/aspects.h> #include <utils/layoutbuilder.h> #include <utils/qtcassert.h> #include <utils/stringutils.h> #include <QCheckBox> #include <QGroupBox> -#include <QIcon> #include <QLabel> #include <QPushButton> #include <QRegularExpression> @@ -74,12 +72,12 @@ namespace Core { */ /*! - Returns the category icon of the options page. This icon is displayed in the list on the left - side of the \uicontrol Options dialog. + Returns the path to the category icon of the options page. This icon will be read from this + path and displayed in the list on the left side of the \uicontrol Options dialog. */ -QIcon IOptionsPage::categoryIcon() const +FilePath IOptionsPage::categoryIconPath() const { - return m_categoryIcon.icon(); + return m_categoryIconPath; } /*! @@ -206,7 +204,7 @@ void IOptionsPage::finish() */ void IOptionsPage::setCategoryIconPath(const FilePath &categoryIconPath) { - m_categoryIcon = Icon({{categoryIconPath, Theme::PanelTextColorDark}}, Icon::Tint); + m_categoryIconPath = categoryIconPath; } void IOptionsPage::setSettings(AspectContainer *settings) @@ -316,11 +314,6 @@ const QList<IOptionsPageProvider *> IOptionsPageProvider::allOptionsPagesProvide return g_optionsPagesProviders; } -QIcon IOptionsPageProvider::categoryIcon() const -{ - return m_categoryIcon.icon(); -} - // PagedSettings PagedSettings::PagedSettings() diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index 5b856f18056..c8e78545e68 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -6,20 +6,14 @@ #include <coreplugin/core_global.h> #include <utils/aspects.h> -#include <utils/icon.h> #include <utils/id.h> -#include <QObject> #include <QPointer> #include <QStringList> #include <QWidget> #include <functional> -namespace Layouting { class LayoutItem; } - -namespace Utils { class AspectContainer; } - namespace Core { class CORE_EXPORT IOptionsPageWidget : public QWidget @@ -54,7 +48,7 @@ public: QString displayName() const { return m_displayName; } Utils::Id category() const { return m_category; } QString displayCategory() const { return m_displayCategory; } - QIcon categoryIcon() const; + Utils::FilePath categoryIconPath() const; using WidgetCreator = std::function<IOptionsPageWidget *()>; void setWidgetCreator(const WidgetCreator &widgetCreator); @@ -72,7 +66,6 @@ protected: void setDisplayName(const QString &displayName) { m_displayName = displayName; } void setCategory(Utils::Id category) { m_category = category; } void setDisplayCategory(const QString &displayCategory) { m_displayCategory = displayCategory; } - void setCategoryIcon(const Utils::Icon &categoryIcon) { m_categoryIcon = categoryIcon; } void setCategoryIconPath(const Utils::FilePath &categoryIconPath); void setSettings(Utils::AspectContainer *settings); // FIXME: Remove. void setSettingsProvider(const std::function<Utils::AspectContainer *()> &provider); @@ -82,7 +75,7 @@ private: Utils::Id m_category; QString m_displayName; QString m_displayCategory; - Utils::Icon m_categoryIcon; + Utils::FilePath m_categoryIconPath; WidgetCreator m_widgetCreator; QPointer<QWidget> m_widget; // Used in conjunction with m_widgetCreator @@ -102,7 +95,7 @@ private: class CORE_EXPORT IOptionsPageProvider { - Q_DISABLE_COPY_MOVE(IOptionsPageProvider); + Q_DISABLE_COPY_MOVE(IOptionsPageProvider) public: IOptionsPageProvider(); @@ -112,7 +105,7 @@ public: Utils::Id category() const { return m_category; } QString displayCategory() const { return m_displayCategory; } - QIcon categoryIcon() const; + Utils::FilePath categoryIconPath() const { return m_categoryIconPath; } virtual QList<IOptionsPage *> pages() const = 0; virtual bool matches(const QRegularExpression ®exp) const = 0; @@ -120,11 +113,11 @@ public: protected: void setCategory(Utils::Id category) { m_category = category; } void setDisplayCategory(const QString &displayCategory) { m_displayCategory = displayCategory; } - void setCategoryIcon(const Utils::Icon &categoryIcon) { m_categoryIcon = categoryIcon; } + void setCategoryIconPath(const Utils::FilePath &iconPath) { m_categoryIconPath = iconPath; } Utils::Id m_category; QString m_displayCategory; - Utils::Icon m_categoryIcon; + Utils::FilePath m_categoryIconPath; }; class CORE_EXPORT PagedSettings : public Utils::AspectContainer, public IOptionsPage diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 6970116ea3f..1f0af6f0efc 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -10,6 +10,7 @@ #include <utils/algorithm.h> #include <utils/hostosinfo.h> +#include <utils/icon.h> #include <utils/fancylineedit.h> #include <utils/qtcassert.h> @@ -166,8 +167,10 @@ void CategoryModel::setPages(const QList<IOptionsPage*> &pages, } if (category->displayName.isEmpty()) category->displayName = page->displayCategory(); - if (category->icon.isNull()) - category->icon = page->categoryIcon(); + if (category->icon.isNull()) { + Icon icon({{page->categoryIconPath(), Theme::PanelTextColorDark}}, Icon::Tint); + category->icon = icon.icon(); + } category->pages.append(page); } @@ -183,8 +186,10 @@ void CategoryModel::setPages(const QList<IOptionsPage*> &pages, } if (category->displayName.isEmpty()) category->displayName = provider->displayCategory(); - if (category->icon.isNull()) - category->icon = provider->categoryIcon(); + if (category->icon.isNull()) { + Icon icon({{provider->categoryIconPath(), Theme::PanelTextColorDark}}, Icon::Tint); + category->icon = icon.icon(); + } category->providers.append(provider); } diff --git a/src/plugins/designer/formeditor.cpp b/src/plugins/designer/formeditor.cpp index 4d8acb41f5b..9629f905266 100644 --- a/src/plugins/designer/formeditor.cpp +++ b/src/plugins/designer/formeditor.cpp @@ -25,8 +25,10 @@ #include <coreplugin/minisplitter.h> #include <coreplugin/modemanager.h> #include <coreplugin/outputpane.h> + #include <utils/infobar.h> #include <utils/qtcassert.h> +#include <utils/theme/theme.h> #include <QDesignerFormEditorPluginInterface> #include <QDesignerFormEditorInterface> diff --git a/src/plugins/designer/settingspage.cpp b/src/plugins/designer/settingspage.cpp index e1998ffd5e3..4fdee045a78 100644 --- a/src/plugins/designer/settingspage.cpp +++ b/src/plugins/designer/settingspage.cpp @@ -47,8 +47,7 @@ SettingsPageProvider::SettingsPageProvider() { setCategory(Designer::Constants::SETTINGS_CATEGORY); setDisplayCategory(Tr::tr(Designer::Constants::SETTINGS_TR_CATEGORY)); - setCategoryIcon(Utils::Icon({{":/core/images/settingscategory_design.png", - Utils::Theme::PanelTextColorDark}}, Utils::Icon::Tint)); + setCategoryIconPath(":/core/images/settingscategory_design.png"); } QList<Core::IOptionsPage *> SettingsPageProvider::pages() const diff --git a/src/plugins/nim/nimplugin.cpp b/src/plugins/nim/nimplugin.cpp index 03fe7177f22..09b730c3aba 100644 --- a/src/plugins/nim/nimplugin.cpp +++ b/src/plugins/nim/nimplugin.cpp @@ -28,6 +28,8 @@ #include <texteditor/snippets/snippetprovider.h> #include <utils/fsengine/fileiconprovider.h> +#include <utils/icon.h> +#include <utils/theme/theme.h> using namespace Utils; using namespace ProjectExplorer; From fa2124f037cfe0d4f18ce15a4e7383e140a46d24 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 17:52:12 +0200 Subject: [PATCH 0517/1777] Core: Move GeneralSettings setup structure closer to new normal Change-Id: I3ffbe1b28971912510582a174bf37a0e3f9d4ff4 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/coreplugin/generalsettings.cpp | 99 ++++++++++++---------- src/plugins/coreplugin/generalsettings.h | 19 ++--- src/plugins/coreplugin/mainwindow.cpp | 6 -- src/plugins/coreplugin/mainwindow.h | 1 - 4 files changed, 61 insertions(+), 64 deletions(-) diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index eab29faf7d6..1f7da60d157 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -8,6 +8,7 @@ #include "themechooser.h" #include <coreplugin/dialogs/restartdialog.h> +#include <coreplugin/dialogs/ioptionspage.h> #include <extensionsystem/pluginmanager.h> @@ -35,18 +36,45 @@ using namespace Utils; using namespace Layouting; -namespace Core { -namespace Internal { +namespace Core::Internal { const char settingsKeyDPI[] = "Core/EnableHighDpiScaling"; -const char settingsKeyShortcutsInContextMenu[] = "General/ShowShortcutsInContextMenu"; const char settingsKeyCodecForLocale[] = "General/OverrideCodecForLocale"; const char settingsKeyToolbarStyle[] = "General/ToolbarStyle"; +static bool defaultShowShortcutsInContextMenu() +{ + return QGuiApplication::styleHints()->showShortcutsInContextMenus(); +} + +GeneralSettings &generalSettings() +{ + static GeneralSettings theSettings; + return theSettings; +} + +GeneralSettings::GeneralSettings() +{ + setAutoApply(false); + + showShortcutsInContextMenus.setSettingsKey("General/ShowShortcutsInContextMenu"); + showShortcutsInContextMenus.setDefaultValue(defaultShowShortcutsInContextMenu()); + showShortcutsInContextMenus.setLabelText( + Tr::tr("Show keyboard shortcuts in context menus (default: %1)") + .arg(defaultShowShortcutsInContextMenu() ? Tr::tr("on") : Tr::tr("off"))); + + connect(&showShortcutsInContextMenus, &BaseAspect::changed, this, [this] { + QCoreApplication::setAttribute(Qt::AA_DontShowShortcutsInContextMenus, + !showShortcutsInContextMenus()); + }); + + readSettings(); +} + class GeneralSettingsWidget final : public IOptionsPageWidget { public: - explicit GeneralSettingsWidget(GeneralSettings *q); + GeneralSettingsWidget(); void apply() final; @@ -63,21 +91,17 @@ public: static void setCodecForLocale(const QByteArray&); void fillToolbarSyleBox() const; - GeneralSettings *q; QComboBox *m_languageBox; QComboBox *m_codecBox; - QCheckBox *m_showShortcutsInContextMenus; QtColorButton *m_colorButton; ThemeChooser *m_themeChooser; QPushButton *m_resetWarningsButton; QComboBox *m_toolbarStyleBox; }; -GeneralSettingsWidget::GeneralSettingsWidget(GeneralSettings *q) - : q(q) - , m_languageBox(new QComboBox) +GeneralSettingsWidget::GeneralSettingsWidget() + : m_languageBox(new QComboBox) , m_codecBox(new QComboBox) - , m_showShortcutsInContextMenus(new QCheckBox) , m_colorButton(new QtColorButton) , m_themeChooser(new ThemeChooser) , m_resetWarningsButton(new QPushButton) @@ -123,7 +147,7 @@ GeneralSettingsWidget::GeneralSettingsWidget(GeneralSettings *q) }); } - form.addRow({empty, m_showShortcutsInContextMenus}); + form.addRow({empty, generalSettings().showShortcutsInContextMenus}); form.addRow({Row{m_resetWarningsButton, st}}); form.addRow({Tr::tr("Text codec for tools:"), m_codecBox, st}); Column{Group{title(Tr::tr("User Interface")), form}}.attachTo(this); @@ -135,11 +159,6 @@ GeneralSettingsWidget::GeneralSettingsWidget(GeneralSettings *q) m_colorButton->setColor(StyleHelper::requestedBaseColor()); m_resetWarningsButton->setEnabled(canResetWarnings()); - m_showShortcutsInContextMenus->setText( - Tr::tr("Show keyboard shortcuts in context menus (default: %1)") - .arg(q->m_defaultShowShortcutsInContextMenu ? Tr::tr("on") : Tr::tr("off"))); - m_showShortcutsInContextMenus->setChecked(GeneralSettings::showShortcutsInContextMenu()); - connect(resetColorButton, &QAbstractButton::clicked, this, @@ -191,11 +210,13 @@ void GeneralSettingsWidget::fillLanguageBox() const void GeneralSettingsWidget::apply() { + generalSettings().apply(); + generalSettings().writeSettings(); + int currentIndex = m_languageBox->currentIndex(); setLanguage(m_languageBox->itemData(currentIndex, Qt::UserRole).toString()); currentIndex = m_codecBox->currentIndex(); setCodecForLocale(m_codecBox->itemText(currentIndex).toLocal8Bit()); - q->setShowShortcutsInContextMenu(m_showShortcutsInContextMenus->isChecked()); // Apply the new base color if accepted StyleHelper::setBaseColor(m_colorButton->color()); m_themeChooser->apply(); @@ -210,14 +231,6 @@ void GeneralSettingsWidget::apply() } } -bool GeneralSettings::showShortcutsInContextMenu() -{ - return ICore::settings() - ->value(settingsKeyShortcutsInContextMenu, - QGuiApplication::styleHints()->showShortcutsInContextMenus()) - .toBool(); -} - void GeneralSettingsWidget::resetInterfaceColor() { m_colorButton->setColor(StyleHelper::DEFAULT_BASE_COLOR); @@ -305,31 +318,27 @@ void GeneralSettingsWidget::fillToolbarSyleBox() const m_toolbarStyleBox->setCurrentIndex(curId); } -void GeneralSettings::setShowShortcutsInContextMenu(bool show) -{ - ICore::settings()->setValueWithDefault(settingsKeyShortcutsInContextMenu, - show, - m_defaultShowShortcutsInContextMenu); - QCoreApplication::setAttribute(Qt::AA_DontShowShortcutsInContextMenus, !show); -} - void GeneralSettings::applyToolbarStyleFromSettings() { StyleHelper::setToolbarStyle(toolbarStylefromSettings()); } -GeneralSettings::GeneralSettings() +// GeneralSettingsPage + +class GeneralSettingsPage final : public IOptionsPage { - setId(Constants::SETTINGS_ID_INTERFACE); - setDisplayName(Tr::tr("Interface")); - setCategory(Constants::SETTINGS_CATEGORY_CORE); - setDisplayCategory(Tr::tr("Environment")); - setCategoryIconPath(":/core/images/settingscategory_core.png"); - setWidgetCreator([this] { return new GeneralSettingsWidget(this); }); +public: + GeneralSettingsPage() + { + setId(Constants::SETTINGS_ID_INTERFACE); + setDisplayName(Tr::tr("Interface")); + setCategory(Constants::SETTINGS_CATEGORY_CORE); + setDisplayCategory(Tr::tr("Environment")); + setCategoryIconPath(":/core/images/settingscategory_core.png"); + setWidgetCreator([] { return new GeneralSettingsWidget; }); + } +}; - m_defaultShowShortcutsInContextMenu = QGuiApplication::styleHints() - ->showShortcutsInContextMenus(); -} +const GeneralSettingsPage settingsPage; -} // namespace Internal -} // namespace Core +} // Core::Internal diff --git a/src/plugins/coreplugin/generalsettings.h b/src/plugins/coreplugin/generalsettings.h index 4587443eaca..498e243b2a4 100644 --- a/src/plugins/coreplugin/generalsettings.h +++ b/src/plugins/coreplugin/generalsettings.h @@ -3,25 +3,20 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> -namespace Core { -namespace Internal { +namespace Core::Internal { -class GeneralSettings : public IOptionsPage +class GeneralSettings : public Utils::AspectContainer { public: GeneralSettings(); - static bool showShortcutsInContextMenu(); - void setShowShortcutsInContextMenu(bool show); + Utils::BoolAspect showShortcutsInContextMenus{this}; static void applyToolbarStyleFromSettings(); - -private: - friend class GeneralSettingsWidget; - bool m_defaultShowShortcutsInContextMenu; }; -} // namespace Internal -} // namespace Core +GeneralSettings &generalSettings(); + +} // Core::Internal diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index fb15ebd28e8..805365e061d 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -22,7 +22,6 @@ #include "fileutils.h" #include "find/basetextfind.h" #include "findplaceholder.h" -#include "generalsettings.h" #include "helpmanager.h" #include "icore.h" #include "idocumentfactory.h" @@ -130,7 +129,6 @@ MainWindow::MainWindow() , m_jsExpander(JsExpander::createGlobalJsExpander()) , m_vcsManager(new VcsManager) , m_modeStack(new FancyTabWidget(this)) - , m_generalSettings(new GeneralSettings) , m_systemSettings(new SystemSettings) , m_shortcutSettings(new ShortcutSettings) , m_toolSettings(new ToolSettings) @@ -165,8 +163,6 @@ MainWindow::MainWindow() } QApplication::setStyle(new ManhattanStyle(baseName)); - m_generalSettings->setShowShortcutsInContextMenu( - GeneralSettings::showShortcutsInContextMenu()); setDockNestingEnabled(true); @@ -279,8 +275,6 @@ MainWindow::~MainWindow() m_messageManager = nullptr; delete m_shortcutSettings; m_shortcutSettings = nullptr; - delete m_generalSettings; - m_generalSettings = nullptr; delete m_systemSettings; m_systemSettings = nullptr; delete m_toolSettings; diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index b254cb268f3..8691e771e2e 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -160,7 +160,6 @@ private: std::unordered_map<QWidget *, IContext *> m_contextWidgets; - GeneralSettings *m_generalSettings = nullptr; SystemSettings *m_systemSettings = nullptr; ShortcutSettings *m_shortcutSettings = nullptr; ToolSettings *m_toolSettings = nullptr; From 209f3ba579e3cba07011fbb963bb7da8b8d19a0d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 27 Jul 2023 13:08:20 +0200 Subject: [PATCH 0518/1777] Nim: Merge Toolchain related file pairs Change-Id: Ia8526bc55934e6f2b29aa291a6269050309e3b4f Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/nim/CMakeLists.txt | 1 - src/plugins/nim/nim.qbs | 1 - src/plugins/nim/nimplugin.cpp | 2 +- src/plugins/nim/project/nimtoolchain.cpp | 149 +++++++++++++++++- src/plugins/nim/project/nimtoolchain.h | 9 ++ .../nim/project/nimtoolchainfactory.cpp | 129 --------------- src/plugins/nim/project/nimtoolchainfactory.h | 44 ------ 7 files changed, 151 insertions(+), 184 deletions(-) delete mode 100644 src/plugins/nim/project/nimtoolchainfactory.cpp delete mode 100644 src/plugins/nim/project/nimtoolchainfactory.h diff --git a/src/plugins/nim/CMakeLists.txt b/src/plugins/nim/CMakeLists.txt index 02cf6356f4f..85a3a204ed0 100644 --- a/src/plugins/nim/CMakeLists.txt +++ b/src/plugins/nim/CMakeLists.txt @@ -24,7 +24,6 @@ add_qtc_plugin(Nim project/nimproject.cpp project/nimproject.h project/nimrunconfiguration.cpp project/nimrunconfiguration.h project/nimtoolchain.cpp project/nimtoolchain.h - project/nimtoolchainfactory.cpp project/nimtoolchainfactory.h settings/nimcodestylepreferencesfactory.cpp settings/nimcodestylepreferencesfactory.h settings/nimcodestylepreferenceswidget.cpp settings/nimcodestylepreferenceswidget.h settings/nimcodestylesettingspage.cpp settings/nimcodestylesettingspage.h diff --git a/src/plugins/nim/nim.qbs b/src/plugins/nim/nim.qbs index 34a20473b8f..d1ceb5007c8 100644 --- a/src/plugins/nim/nim.qbs +++ b/src/plugins/nim/nim.qbs @@ -46,7 +46,6 @@ QtcPlugin { "nimproject.h", "nimproject.cpp", "nimrunconfiguration.h", "nimrunconfiguration.cpp", "nimtoolchain.h", "nimtoolchain.cpp", - "nimtoolchainfactory.h", "nimtoolchainfactory.cpp", "nimblebuildstep.h", "nimblebuildstep.cpp", "nimbleproject.h", "nimbleproject.cpp", "nimblerunconfiguration.h", "nimblerunconfiguration.cpp", diff --git a/src/plugins/nim/nimplugin.cpp b/src/plugins/nim/nimplugin.cpp index 09b730c3aba..1b435ae0ebd 100644 --- a/src/plugins/nim/nimplugin.cpp +++ b/src/plugins/nim/nimplugin.cpp @@ -14,7 +14,7 @@ #include "project/nimproject.h" #include "project/nimbleproject.h" #include "project/nimrunconfiguration.h" -#include "project/nimtoolchainfactory.h" +#include "project/nimtoolchain.h" #include "project/nimblebuildstep.h" #include "project/nimbletaskstep.h" #include "settings/nimcodestylepreferencesfactory.h" diff --git a/src/plugins/nim/project/nimtoolchain.cpp b/src/plugins/nim/project/nimtoolchain.cpp index e04efeae8e3..871c4b14c33 100644 --- a/src/plugins/nim/project/nimtoolchain.cpp +++ b/src/plugins/nim/project/nimtoolchain.cpp @@ -4,13 +4,22 @@ #include "nimtoolchain.h" #include "nimconstants.h" -#include "nimtoolchainfactory.h" +#include "nimtoolchain.h" #include "nimtr.h" #include <projectexplorer/abi.h> -#include <utils/environment.h> -#include <utils/process.h> +#include <projectexplorer/devicesupport/devicemanager.h> +#include <projectexplorer/toolchainconfigwidget.h> +#include <utils/algorithm.h> +#include <utils/environment.h> +#include <utils/environment.h> +#include <utils/fileutils.h> +#include <utils/pathchooser.h> +#include <utils/process.h> +#include <utils/qtcassert.h> + +#include <QFormLayout> #include <QRegularExpression> using namespace ProjectExplorer; @@ -70,11 +79,6 @@ QList<Utils::OutputLineParser *> NimToolChain::createOutputParsers() const return {}; } -std::unique_ptr<ProjectExplorer::ToolChainConfigWidget> NimToolChain::createConfigurationWidget() -{ - return std::make_unique<NimToolChainConfigWidget>(this); -} - QString NimToolChain::compilerVersion() const { return compilerCommand().isEmpty() || m_version == std::make_tuple(-1,-1,-1) @@ -114,4 +118,133 @@ bool NimToolChain::parseVersion(const FilePath &path, std::tuple<int, int, int> return true; } +// NimToolChainConfigWidget + +class NimToolChainConfigWidget : public ToolChainConfigWidget +{ +public: + explicit NimToolChainConfigWidget(NimToolChain *tc) + : ToolChainConfigWidget(tc) + , m_compilerCommand(new PathChooser) + , m_compilerVersion(new QLineEdit) + { + // Create ui + const auto gnuVersionArgs = QStringList("--version"); + m_compilerCommand->setExpectedKind(PathChooser::ExistingCommand); + m_compilerCommand->setCommandVersionArguments(gnuVersionArgs); + m_mainLayout->addRow(Tr::tr("&Compiler path:"), m_compilerCommand); + m_compilerVersion->setReadOnly(true); + m_mainLayout->addRow(Tr::tr("&Compiler version:"), m_compilerVersion); + + // Fill + fillUI(); + + // Connect + connect(m_compilerCommand, &PathChooser::validChanged, this, [this] { + const FilePath path = m_compilerCommand->rawFilePath(); + auto tc = static_cast<NimToolChain *>(toolChain()); + QTC_ASSERT(tc, return); + tc->setCompilerCommand(path); + fillUI(); + }); + } + +protected: + void applyImpl() final; + void discardImpl() final; + bool isDirtyImpl() const final; + void makeReadOnlyImpl() final; + +private: + void fillUI(); + + Utils::PathChooser *m_compilerCommand; + QLineEdit *m_compilerVersion; +}; + +void NimToolChainConfigWidget::applyImpl() +{ + auto tc = static_cast<NimToolChain *>(toolChain()); + Q_ASSERT(tc); + if (tc->isAutoDetected()) + return; + tc->setCompilerCommand(m_compilerCommand->filePath()); +} + +void NimToolChainConfigWidget::discardImpl() +{ + fillUI(); +} + +bool NimToolChainConfigWidget::isDirtyImpl() const +{ + auto tc = static_cast<NimToolChain *>(toolChain()); + Q_ASSERT(tc); + return tc->compilerCommand() != m_compilerCommand->filePath(); +} + +void NimToolChainConfigWidget::makeReadOnlyImpl() +{ + m_compilerCommand->setReadOnly(true); +} + +void NimToolChainConfigWidget::fillUI() +{ + auto tc = static_cast<NimToolChain *>(toolChain()); + Q_ASSERT(tc); + m_compilerCommand->setFilePath(tc->compilerCommand()); + m_compilerVersion->setText(tc->compilerVersion()); +} + +std::unique_ptr<ToolChainConfigWidget> NimToolChain::createConfigurationWidget() +{ + return std::make_unique<NimToolChainConfigWidget>(this); +} + +// NimToolChainFactory + +NimToolChainFactory::NimToolChainFactory() +{ + setDisplayName(Tr::tr("Nim")); + setSupportedToolChainType(Constants::C_NIMTOOLCHAIN_TYPEID); + setSupportedLanguages({Constants::C_NIMLANGUAGE_ID}); + setToolchainConstructor([] { return new NimToolChain; }); + setUserCreatable(true); +} + +Toolchains NimToolChainFactory::autoDetect(const ToolchainDetector &detector) const +{ + Toolchains result; + + const FilePath compilerPath = detector.device->searchExecutableInPath("nim"); + if (compilerPath.isEmpty()) + return result; + + result = Utils::filtered(detector.alreadyKnown, [compilerPath](ToolChain *tc) { + return tc->typeId() == Constants::C_NIMTOOLCHAIN_TYPEID + && tc->compilerCommand() == compilerPath; + }); + + if (!result.empty()) + return result; + + auto tc = new NimToolChain; + tc->setDetection(ToolChain::AutoDetection); + tc->setCompilerCommand(compilerPath); + result.append(tc); + return result; +} + +Toolchains NimToolChainFactory::detectForImport(const ToolChainDescription &tcd) const +{ + Toolchains result; + if (tcd.language == Constants::C_NIMLANGUAGE_ID) { + auto tc = new NimToolChain; + tc->setDetection(ToolChain::ManualDetection); // FIXME: sure? + tc->setCompilerCommand(tcd.compilerPath); + result.append(tc); + } + return result; +} + } // Nim diff --git a/src/plugins/nim/project/nimtoolchain.h b/src/plugins/nim/project/nimtoolchain.h index 087f44cd2eb..c86a35a91a2 100644 --- a/src/plugins/nim/project/nimtoolchain.h +++ b/src/plugins/nim/project/nimtoolchain.h @@ -34,4 +34,13 @@ private: std::tuple<int, int, int> m_version; }; +class NimToolChainFactory : public ProjectExplorer::ToolChainFactory +{ +public: + NimToolChainFactory(); + + ProjectExplorer::Toolchains autoDetect(const ProjectExplorer::ToolchainDetector &detector) const final; + ProjectExplorer::Toolchains detectForImport(const ProjectExplorer::ToolChainDescription &tcd) const final; +}; + } // Nim diff --git a/src/plugins/nim/project/nimtoolchainfactory.cpp b/src/plugins/nim/project/nimtoolchainfactory.cpp deleted file mode 100644 index 415e7e76962..00000000000 --- a/src/plugins/nim/project/nimtoolchainfactory.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (C) Filippo Cucchetto <filippocucchetto@gmail.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "nimtoolchainfactory.h" - -#include "nimconstants.h" -#include "nimtoolchain.h" -#include "nimtr.h" - -#include <projectexplorer/devicesupport/devicemanager.h> - -#include <utils/algorithm.h> -#include <utils/environment.h> -#include <utils/fileutils.h> -#include <utils/pathchooser.h> -#include <utils/qtcassert.h> - -#include <QFormLayout> - -using namespace ProjectExplorer; -using namespace Utils; - -namespace Nim { - -NimToolChainFactory::NimToolChainFactory() -{ - setDisplayName(Tr::tr("Nim")); - setSupportedToolChainType(Constants::C_NIMTOOLCHAIN_TYPEID); - setSupportedLanguages({Constants::C_NIMLANGUAGE_ID}); - setToolchainConstructor([] { return new NimToolChain; }); - setUserCreatable(true); -} - -Toolchains NimToolChainFactory::autoDetect(const ToolchainDetector &detector) const -{ - Toolchains result; - - const FilePath compilerPath = detector.device->searchExecutableInPath("nim"); - if (compilerPath.isEmpty()) - return result; - - result = Utils::filtered(detector.alreadyKnown, [compilerPath](ToolChain *tc) { - return tc->typeId() == Constants::C_NIMTOOLCHAIN_TYPEID - && tc->compilerCommand() == compilerPath; - }); - - if (!result.empty()) - return result; - - auto tc = new NimToolChain; - tc->setDetection(ToolChain::AutoDetection); - tc->setCompilerCommand(compilerPath); - result.append(tc); - return result; -} - -Toolchains NimToolChainFactory::detectForImport(const ToolChainDescription &tcd) const -{ - Toolchains result; - if (tcd.language == Constants::C_NIMLANGUAGE_ID) { - auto tc = new NimToolChain; - tc->setDetection(ToolChain::ManualDetection); // FIXME: sure? - tc->setCompilerCommand(tcd.compilerPath); - result.append(tc); - } - return result; -} - -NimToolChainConfigWidget::NimToolChainConfigWidget(NimToolChain *tc) - : ToolChainConfigWidget(tc) - , m_compilerCommand(new PathChooser) - , m_compilerVersion(new QLineEdit) -{ - // Create ui - const auto gnuVersionArgs = QStringList("--version"); - m_compilerCommand->setExpectedKind(PathChooser::ExistingCommand); - m_compilerCommand->setCommandVersionArguments(gnuVersionArgs); - m_mainLayout->addRow(Tr::tr("&Compiler path:"), m_compilerCommand); - m_compilerVersion->setReadOnly(true); - m_mainLayout->addRow(Tr::tr("&Compiler version:"), m_compilerVersion); - - // Fill - fillUI(); - - // Connect - connect(m_compilerCommand, &PathChooser::validChanged, this, [this] { - const FilePath path = m_compilerCommand->rawFilePath(); - auto tc = static_cast<NimToolChain *>(toolChain()); - QTC_ASSERT(tc, return); - tc->setCompilerCommand(path); - fillUI(); - }); -} - -void NimToolChainConfigWidget::applyImpl() -{ - auto tc = static_cast<NimToolChain *>(toolChain()); - Q_ASSERT(tc); - if (tc->isAutoDetected()) - return; - tc->setCompilerCommand(m_compilerCommand->filePath()); -} - -void NimToolChainConfigWidget::discardImpl() -{ - fillUI(); -} - -bool NimToolChainConfigWidget::isDirtyImpl() const -{ - auto tc = static_cast<NimToolChain *>(toolChain()); - Q_ASSERT(tc); - return tc->compilerCommand() != m_compilerCommand->filePath(); -} - -void NimToolChainConfigWidget::makeReadOnlyImpl() -{ - m_compilerCommand->setReadOnly(true); -} - -void NimToolChainConfigWidget::fillUI() -{ - auto tc = static_cast<NimToolChain *>(toolChain()); - Q_ASSERT(tc); - m_compilerCommand->setFilePath(tc->compilerCommand()); - m_compilerVersion->setText(tc->compilerVersion()); -} - -} diff --git a/src/plugins/nim/project/nimtoolchainfactory.h b/src/plugins/nim/project/nimtoolchainfactory.h deleted file mode 100644 index 96fc55b8e56..00000000000 --- a/src/plugins/nim/project/nimtoolchainfactory.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) Filippo Cucchetto <filippocucchetto@gmail.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <projectexplorer/toolchain.h> -#include <projectexplorer/toolchainconfigwidget.h> - -namespace Utils { class PathChooser; } - -namespace Nim { - -class NimToolChain; - -class NimToolChainFactory : public ProjectExplorer::ToolChainFactory -{ -public: - NimToolChainFactory(); - - ProjectExplorer::Toolchains autoDetect(const ProjectExplorer::ToolchainDetector &detector) const final; - ProjectExplorer::Toolchains detectForImport(const ProjectExplorer::ToolChainDescription &tcd) const final; -}; - -class NimToolChainConfigWidget : public ProjectExplorer::ToolChainConfigWidget -{ - Q_OBJECT - -public: - explicit NimToolChainConfigWidget(NimToolChain *tc); - -protected: - void applyImpl() final; - void discardImpl() final; - bool isDirtyImpl() const final; - void makeReadOnlyImpl() final; - -private: - void fillUI(); - - Utils::PathChooser *m_compilerCommand; - QLineEdit *m_compilerVersion; -}; - -} // Nim From 42ed82973cec46f74f9ac57ac9ee79cd50d74c9f Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 17 Jul 2023 13:51:56 +0200 Subject: [PATCH 0519/1777] Terminal: Create Terminal solution Change-Id: If271fd23a84c49bbc25fcc3b9bc0939c7237d095 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/libs/solutions/CMakeLists.txt | 1 + src/libs/solutions/terminal/CMakeLists.txt | 12 + .../solutions}/terminal/celliterator.cpp | 4 +- .../solutions}/terminal/celliterator.h | 8 +- .../solutions}/terminal/glyphcache.cpp | 4 +- .../solutions}/terminal/glyphcache.h | 4 +- .../solutions}/terminal/keys.cpp | 11 +- .../solutions}/terminal/keys.h | 4 +- .../solutions}/terminal/scrollback.cpp | 4 +- .../solutions}/terminal/scrollback.h | 4 +- .../solutions/terminal/surfaceintegration.h | 19 + src/libs/solutions/terminal/terminal_global.h | 14 + .../solutions}/terminal/terminalsurface.cpp | 66 +- .../solutions}/terminal/terminalsurface.h | 17 +- src/libs/solutions/terminal/terminalview.cpp | 1263 ++++++++++++++++ src/libs/solutions/terminal/terminalview.h | 221 +++ src/plugins/terminal/CMakeLists.txt | 7 +- src/plugins/terminal/shellintegration.cpp | 21 +- src/plugins/terminal/shellintegration.h | 9 +- src/plugins/terminal/terminalpane.cpp | 7 +- src/plugins/terminal/terminalsearch.cpp | 25 +- src/plugins/terminal/terminalsearch.h | 34 +- src/plugins/terminal/terminalsettings.cpp | 5 +- src/plugins/terminal/terminalwidget.cpp | 1344 ++--------------- src/plugins/terminal/terminalwidget.h | 178 +-- src/plugins/terminal/tests/mouse | 67 + 26 files changed, 1885 insertions(+), 1468 deletions(-) create mode 100644 src/libs/solutions/terminal/CMakeLists.txt rename src/{plugins => libs/solutions}/terminal/celliterator.cpp (96%) rename src/{plugins => libs/solutions}/terminal/celliterator.h (94%) rename src/{plugins => libs/solutions}/terminal/glyphcache.cpp (94%) rename src/{plugins => libs/solutions}/terminal/glyphcache.h (90%) rename src/{plugins => libs/solutions}/terminal/keys.cpp (92%) rename src/{plugins => libs/solutions}/terminal/keys.h (83%) rename src/{plugins => libs/solutions}/terminal/scrollback.cpp (95%) rename src/{plugins => libs/solutions}/terminal/scrollback.h (95%) create mode 100644 src/libs/solutions/terminal/surfaceintegration.h create mode 100644 src/libs/solutions/terminal/terminal_global.h rename src/{plugins => libs/solutions}/terminal/terminalsurface.cpp (89%) rename src/{plugins => libs/solutions}/terminal/terminalsurface.h (87%) create mode 100644 src/libs/solutions/terminal/terminalview.cpp create mode 100644 src/libs/solutions/terminal/terminalview.h create mode 100755 src/plugins/terminal/tests/mouse diff --git a/src/libs/solutions/CMakeLists.txt b/src/libs/solutions/CMakeLists.txt index 2a47fbee5fb..67630f067c7 100644 --- a/src/libs/solutions/CMakeLists.txt +++ b/src/libs/solutions/CMakeLists.txt @@ -1,2 +1,3 @@ add_subdirectory(spinner) add_subdirectory(tasking) +add_subdirectory(terminal) diff --git a/src/libs/solutions/terminal/CMakeLists.txt b/src/libs/solutions/terminal/CMakeLists.txt new file mode 100644 index 00000000000..58c3e8780d4 --- /dev/null +++ b/src/libs/solutions/terminal/CMakeLists.txt @@ -0,0 +1,12 @@ +add_qtc_library(TerminalLib + DEPENDS Qt::Core Qt::Widgets libvterm + SOURCES + celliterator.cpp celliterator.h + glyphcache.cpp glyphcache.h + keys.cpp keys.h + scrollback.cpp scrollback.h + surfaceintegration.h + terminal_global.h + terminalsurface.cpp terminalsurface.h + terminalview.cpp terminalview.h +) diff --git a/src/plugins/terminal/celliterator.cpp b/src/libs/solutions/terminal/celliterator.cpp similarity index 96% rename from src/plugins/terminal/celliterator.cpp rename to src/libs/solutions/terminal/celliterator.cpp index 91a70f76ea3..b7053438e08 100644 --- a/src/plugins/terminal/celliterator.cpp +++ b/src/libs/solutions/terminal/celliterator.cpp @@ -7,7 +7,7 @@ #include <stdexcept> -namespace Terminal::Internal { +namespace TerminalSolution { CellIterator::CellIterator(const TerminalSurface *surface, QPoint pos) : CellIterator(surface, pos.x() + (pos.y() * surface->liveSize().width())) @@ -91,4 +91,4 @@ CellIterator &CellIterator::operator+=(int n) return *this; } -} // namespace Terminal::Internal +} // namespace TerminalSolution diff --git a/src/plugins/terminal/celliterator.h b/src/libs/solutions/terminal/celliterator.h similarity index 94% rename from src/plugins/terminal/celliterator.h rename to src/libs/solutions/terminal/celliterator.h index c246aaa3114..e1fc6efce74 100644 --- a/src/plugins/terminal/celliterator.h +++ b/src/libs/solutions/terminal/celliterator.h @@ -3,15 +3,17 @@ #pragma once +#include "terminal_global.h" + #include <string> #include <QPoint> -namespace Terminal::Internal { +namespace TerminalSolution { class TerminalSurface; -class CellIterator +class TERMINAL_EXPORT CellIterator { public: using iterator_category = std::bidirectional_iterator_tag; @@ -94,4 +96,4 @@ private: mutable std::u32string::value_type m_char; }; -} // namespace Terminal::Internal +} // namespace TerminalSolution diff --git a/src/plugins/terminal/glyphcache.cpp b/src/libs/solutions/terminal/glyphcache.cpp similarity index 94% rename from src/plugins/terminal/glyphcache.cpp rename to src/libs/solutions/terminal/glyphcache.cpp index 72a0fd7b9d1..d5e4b306e16 100644 --- a/src/plugins/terminal/glyphcache.cpp +++ b/src/libs/solutions/terminal/glyphcache.cpp @@ -5,7 +5,7 @@ #include <QTextLayout> -namespace Terminal::Internal { +namespace TerminalSolution { size_t qHash(const GlyphCacheKey &key, size_t seed = 0) { @@ -45,4 +45,4 @@ const QGlyphRun *GlyphCache::get(const QFont &font, const QString &text) return nullptr; } -} // namespace Terminal::Internal +} // namespace TerminalSolution diff --git a/src/plugins/terminal/glyphcache.h b/src/libs/solutions/terminal/glyphcache.h similarity index 90% rename from src/plugins/terminal/glyphcache.h rename to src/libs/solutions/terminal/glyphcache.h index 60701098f5f..a5ebfc21453 100644 --- a/src/plugins/terminal/glyphcache.h +++ b/src/libs/solutions/terminal/glyphcache.h @@ -8,7 +8,7 @@ #include <QGlyphRun> #include <QString> -namespace Terminal::Internal { +namespace TerminalSolution { struct GlyphCacheKey { @@ -31,4 +31,4 @@ public: const QGlyphRun *get(const QFont &font, const QString &text); }; -} // namespace Terminal::Internal +} // namespace TerminalSolution diff --git a/src/plugins/terminal/keys.cpp b/src/libs/solutions/terminal/keys.cpp similarity index 92% rename from src/plugins/terminal/keys.cpp rename to src/libs/solutions/terminal/keys.cpp index ce14cbe5fbc..adbcda10ea7 100644 --- a/src/plugins/terminal/keys.cpp +++ b/src/libs/solutions/terminal/keys.cpp @@ -1,11 +1,9 @@ // Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 -#include <utils/hostosinfo.h> - #include "keys.h" -namespace Terminal::Internal { +namespace TerminalSolution { VTermModifier qtModifierToVTerm(Qt::KeyboardModifiers mod) { @@ -77,8 +75,9 @@ VTermKey qtKeyToVTerm(Qt::Key key, bool keypad) case Qt::Key_Enter: { VTermKey enterKey = VTERM_KEY_KP_ENTER; - if (Utils::HostOsInfo::isWindowsHost()) - enterKey = VTERM_KEY_ENTER; +#ifdef Q_OS_WIN + enterKey = VTERM_KEY_ENTER; +#endif return keypad ? enterKey : VTERM_KEY_NONE; } @@ -88,4 +87,4 @@ VTermKey qtKeyToVTerm(Qt::Key key, bool keypad) return VTERM_KEY_NONE; } } -} // namespace Terminal::Internal +} // namespace TerminalSolution diff --git a/src/plugins/terminal/keys.h b/src/libs/solutions/terminal/keys.h similarity index 83% rename from src/plugins/terminal/keys.h rename to src/libs/solutions/terminal/keys.h index f3df9330013..2f967010db9 100644 --- a/src/plugins/terminal/keys.h +++ b/src/libs/solutions/terminal/keys.h @@ -7,9 +7,9 @@ #include <QKeyEvent> -namespace Terminal::Internal { +namespace TerminalSolution { VTermKey qtKeyToVTerm(Qt::Key key, bool keypad); VTermModifier qtModifierToVTerm(Qt::KeyboardModifiers mod); -} // namespace Terminal::Internal +} // namespace TerminalSolution diff --git a/src/plugins/terminal/scrollback.cpp b/src/libs/solutions/terminal/scrollback.cpp similarity index 95% rename from src/plugins/terminal/scrollback.cpp rename to src/libs/solutions/terminal/scrollback.cpp index e22d5fa2436..b3fa9af8433 100644 --- a/src/plugins/terminal/scrollback.cpp +++ b/src/libs/solutions/terminal/scrollback.cpp @@ -8,7 +8,7 @@ #include <cstring> #include <future> -namespace Terminal::Internal { +namespace TerminalSolution { Scrollback::Line::Line(int cols, const VTermScreenCell *cells) : m_cols(cols) @@ -58,4 +58,4 @@ void Scrollback::clear() m_deque.clear(); } -} // namespace Terminal::Internal +} // namespace TerminalSolution diff --git a/src/plugins/terminal/scrollback.h b/src/libs/solutions/terminal/scrollback.h similarity index 95% rename from src/plugins/terminal/scrollback.h rename to src/libs/solutions/terminal/scrollback.h index 9ca71eec615..a03f9891e64 100644 --- a/src/plugins/terminal/scrollback.h +++ b/src/libs/solutions/terminal/scrollback.h @@ -13,7 +13,7 @@ #include <QFont> #include <QTextLayout> -namespace Terminal::Internal { +namespace TerminalSolution { class Scrollback { @@ -54,4 +54,4 @@ private: std::deque<Line> m_deque; }; -} // namespace Terminal::Internal +} // namespace TerminalSolution diff --git a/src/libs/solutions/terminal/surfaceintegration.h b/src/libs/solutions/terminal/surfaceintegration.h new file mode 100644 index 00000000000..5959e2b53a7 --- /dev/null +++ b/src/libs/solutions/terminal/surfaceintegration.h @@ -0,0 +1,19 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <QString> + +namespace TerminalSolution { + +class SurfaceIntegration +{ +public: + virtual void onOsc(int cmd, std::string_view str, bool initial, bool final) = 0; + + virtual void onBell() {} + virtual void onTitle(const QString &title) { Q_UNUSED(title); } +}; + +} // namespace TerminalSolution diff --git a/src/libs/solutions/terminal/terminal_global.h b/src/libs/solutions/terminal/terminal_global.h new file mode 100644 index 00000000000..b7fec1c77c5 --- /dev/null +++ b/src/libs/solutions/terminal/terminal_global.h @@ -0,0 +1,14 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <qglobal.h> + +#if defined(TERMINALLIB_LIBRARY) +#define TERMINAL_EXPORT Q_DECL_EXPORT +#elif defined(TERMINALLIB_STATIC_LIBRARY) +#define TERMINAL_EXPORT +#else +#define TERMINAL_EXPORT Q_DECL_IMPORT +#endif diff --git a/src/plugins/terminal/terminalsurface.cpp b/src/libs/solutions/terminal/terminalsurface.cpp similarity index 89% rename from src/plugins/terminal/terminalsurface.cpp rename to src/libs/solutions/terminal/terminalsurface.cpp index 24e881b35cf..aedf8533d29 100644 --- a/src/plugins/terminal/terminalsurface.cpp +++ b/src/libs/solutions/terminal/terminalsurface.cpp @@ -2,17 +2,16 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "terminalsurface.h" +#include "surfaceintegration.h" #include "keys.h" #include "scrollback.h" -#include <utils/qtcassert.h> - #include <vterm.h> #include <QLoggingCategory> -namespace Terminal::Internal { +namespace TerminalSolution { Q_LOGGING_CATEGORY(log, "qtc.terminal.surface", QtWarningMsg); @@ -23,13 +22,10 @@ QColor toQColor(const VTermColor &c) struct TerminalSurfacePrivate { - TerminalSurfacePrivate(TerminalSurface *surface, - const QSize &initialGridSize, - ShellIntegration *shellIntegration) + TerminalSurfacePrivate(TerminalSurface *surface, const QSize &initialGridSize) : m_vterm(vterm_new(initialGridSize.height(), initialGridSize.width()), vterm_free) , m_vtermScreen(vterm_obtain_screen(m_vterm.get())) - , m_scrollback(std::make_unique<Internal::Scrollback>(5000)) - , m_shellIntegration(shellIntegration) + , m_scrollback(std::make_unique<Scrollback>(5000)) , q(surface) {} @@ -74,7 +70,8 @@ struct TerminalSurfacePrivate }; m_vtermScreenCallbacks.bell = [](void *user) { auto p = static_cast<TerminalSurfacePrivate *>(user); - emit p->q->bell(); + if (p->m_surfaceIntegration) + p->m_surfaceIntegration->onBell(); return 1; }; @@ -219,8 +216,12 @@ struct TerminalSurfacePrivate int osc(int cmd, const VTermStringFragment &fragment) { - if (m_shellIntegration) - m_shellIntegration->onOsc(cmd, fragment); + if (m_surfaceIntegration) { + m_surfaceIntegration->onOsc(cmd, + {fragment.str, fragment.len}, + fragment.initial, + fragment.final); + } return 1; } @@ -249,7 +250,8 @@ struct TerminalSurfacePrivate case VTERM_PROP_ICONNAME: break; case VTERM_PROP_TITLE: - emit q->titleChanged(QString::fromUtf8(val->string.str, val->string.len)); + if (m_surfaceIntegration) + m_surfaceIntegration->onTitle(QString::fromUtf8(val->string.str, val->string.len)); break; case VTERM_PROP_ALTSCREEN: m_altscreen = val->boolean; @@ -278,8 +280,11 @@ struct TerminalSurfacePrivate const VTermScreenCell *cellAt(int x, int y) { - QTC_ASSERT(y >= 0 && x >= 0, return nullptr); - QTC_ASSERT(y < q->fullSize().height() && x < liveSize().width(), return nullptr); + if (y < 0 || x < 0 || y >= q->fullSize().height() || x >= liveSize().width()) { + qCWarning(log) << "Invalid Parameter for cellAt:" << x << y << "liveSize:" << liveSize() + << "fullSize:" << q->fullSize(); + return nullptr; + } if (!m_altscreen && y < m_scrollback->size()) { const auto &sbl = m_scrollback->line((m_scrollback->size() - 1) - y); @@ -309,15 +314,15 @@ struct TerminalSurfacePrivate bool m_altscreen{false}; - std::unique_ptr<Internal::Scrollback> m_scrollback; + std::unique_ptr<Scrollback> m_scrollback; - ShellIntegration *m_shellIntegration{nullptr}; + SurfaceIntegration *m_surfaceIntegration{nullptr}; TerminalSurface *q; }; -TerminalSurface::TerminalSurface(QSize initialGridSize, ShellIntegration *shellIntegration) - : d(std::make_unique<TerminalSurfacePrivate>(this, initialGridSize, shellIntegration)) +TerminalSurface::TerminalSurface(QSize initialGridSize) + : d(std::make_unique<TerminalSurfacePrivate>(this, initialGridSize)) { d->init(); } @@ -369,8 +374,10 @@ TerminalCell TerminalSurface::fetchCell(int x, int y) const QTextCharFormat::NoUnderline, false}; - QTC_ASSERT(y >= 0, return emptyCell); - QTC_ASSERT(y < fullSize().height() && x < fullSize().width(), return emptyCell); + if (y < 0 || y >= fullSize().height() || x >= fullSize().width()) { + qCWarning(log) << "Invalid Parameter for fetchCell:" << x << y << "fullSize:" << fullSize(); + return emptyCell; + } const VTermScreenCell *refCell = d->cellAt(x, y); if (!refCell) @@ -450,8 +457,8 @@ void TerminalSurface::sendKey(const QString &text) void TerminalSurface::sendKey(QKeyEvent *event) { bool keypad = event->modifiers() & Qt::KeypadModifier; - VTermModifier mod = Internal::qtModifierToVTerm(event->modifiers()); - VTermKey key = Internal::qtKeyToVTerm(Qt::Key(event->key()), keypad); + VTermModifier mod = qtModifierToVTerm(event->modifiers()); + VTermKey key = qtKeyToVTerm(Qt::Key(event->key()), keypad); if (key != VTERM_KEY_NONE) { if (mod == VTERM_MOD_SHIFT && (key == VTERM_KEY_ESCAPE || key == VTERM_KEY_BACKSPACE)) @@ -489,14 +496,19 @@ Cursor TerminalSurface::cursor() const return cursor; } -ShellIntegration *TerminalSurface::shellIntegration() const +SurfaceIntegration *TerminalSurface::surfaceIntegration() const { - return d->m_shellIntegration; + return d->m_surfaceIntegration; +} + +void TerminalSurface::setSurfaceIntegration(SurfaceIntegration *surfaceIntegration) +{ + d->m_surfaceIntegration = surfaceIntegration; } void TerminalSurface::mouseMove(QPoint pos, Qt::KeyboardModifiers modifiers) { - vterm_mouse_move(d->m_vterm.get(), pos.y(), pos.x(), Internal::qtModifierToVTerm(modifiers)); + vterm_mouse_move(d->m_vterm.get(), pos.y(), pos.x(), qtModifierToVTerm(modifiers)); } void TerminalSurface::mouseButton(Qt::MouseButton button, @@ -524,7 +536,7 @@ void TerminalSurface::mouseButton(Qt::MouseButton button, return; } - vterm_mouse_button(d->m_vterm.get(), btnIdx, pressed, Internal::qtModifierToVTerm(modifiers)); + vterm_mouse_button(d->m_vterm.get(), btnIdx, pressed, qtModifierToVTerm(modifiers)); } CellIterator TerminalSurface::begin() const @@ -568,4 +580,4 @@ std::reverse_iterator<CellIterator> TerminalSurface::rIteratorAt(int pos) const return std::make_reverse_iterator(iteratorAt(pos)); } -} // namespace Terminal::Internal +} // namespace TerminalSolution diff --git a/src/plugins/terminal/terminalsurface.h b/src/libs/solutions/terminal/terminalsurface.h similarity index 87% rename from src/plugins/terminal/terminalsurface.h rename to src/libs/solutions/terminal/terminalsurface.h index 09a86f26e73..be20a4c0aa2 100644 --- a/src/plugins/terminal/terminalsurface.h +++ b/src/libs/solutions/terminal/terminalsurface.h @@ -3,8 +3,9 @@ #pragma once +#include "terminal_global.h" + #include "celliterator.h" -#include "shellintegration.h" #include <QKeyEvent> #include <QSize> @@ -12,9 +13,10 @@ #include <memory> -namespace Terminal::Internal { +namespace TerminalSolution { class Scrollback; +class SurfaceIntegration; struct TerminalSurfacePrivate; @@ -45,12 +47,12 @@ struct Cursor bool blink{false}; }; -class TerminalSurface : public QObject +class TERMINAL_EXPORT TerminalSurface : public QObject { Q_OBJECT; public: - TerminalSurface(QSize initialGridSize, ShellIntegration *shellIntegration); + TerminalSurface(QSize initialGridSize); ~TerminalSurface(); public: @@ -93,7 +95,8 @@ public: Cursor cursor() const; - ShellIntegration *shellIntegration() const; + SurfaceIntegration *surfaceIntegration() const; + void setSurfaceIntegration(SurfaceIntegration *surfaceIntegration); void mouseMove(QPoint pos, Qt::KeyboardModifiers modifiers); void mouseButton(Qt::MouseButton button, bool pressed, Qt::KeyboardModifiers modifiers); @@ -104,11 +107,9 @@ signals: void cursorChanged(Cursor oldCursor, Cursor newCursor); void altscreenChanged(bool altScreen); void unscroll(); - void bell(); - void titleChanged(const QString &title); private: std::unique_ptr<TerminalSurfacePrivate> d; }; -} // namespace Terminal::Internal +} // namespace TerminalSolution diff --git a/src/libs/solutions/terminal/terminalview.cpp b/src/libs/solutions/terminal/terminalview.cpp new file mode 100644 index 00000000000..3924f09d33a --- /dev/null +++ b/src/libs/solutions/terminal/terminalview.cpp @@ -0,0 +1,1263 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 + +#include "terminalview.h" +#include "glyphcache.h" +#include "terminalsurface.h" + +#include <vterm.h> + +#include <QApplication> +#include <QCache> +#include <QClipboard> +#include <QDesktopServices> +#include <QElapsedTimer> +#include <QGlyphRun> +#include <QLoggingCategory> +#include <QMenu> +#include <QMimeData> +#include <QPaintEvent> +#include <QPainter> +#include <QPainterPath> +#include <QPixmapCache> +#include <QRawFont> +#include <QRegularExpression> +#include <QScrollBar> +#include <QTextItem> +#include <QTextLayout> +#include <QToolTip> + +Q_LOGGING_CATEGORY(terminalLog, "qtc.terminal", QtWarningMsg) +Q_LOGGING_CATEGORY(selectionLog, "qtc.terminal.selection", QtWarningMsg) +Q_LOGGING_CATEGORY(paintLog, "qtc.terminal.paint", QtWarningMsg) + +namespace TerminalSolution { + +using namespace std::chrono_literals; + +// Minimum time between two refreshes. (30fps) +static constexpr std::chrono::milliseconds minRefreshInterval = 33ms; + +class TerminalViewPrivate +{ +public: + TerminalViewPrivate() + { + m_cursorBlinkTimer.setInterval(750ms); + m_cursorBlinkTimer.setSingleShot(false); + + m_flushDelayTimer.setSingleShot(true); + m_flushDelayTimer.setInterval(minRefreshInterval); + + m_scrollTimer.setSingleShot(false); + m_scrollTimer.setInterval(500ms); + } + + std::optional<TerminalView::Selection> m_selection; + std::unique_ptr<TerminalSurface> m_surface; + + QSizeF m_cellSize; + + bool m_ignoreScroll{false}; + + QString m_preEditString; + + std::optional<TerminalView::LinkSelection> m_linkSelection; + + struct + { + QPoint start; + QPoint end; + } m_activeMouseSelect; + + QTimer m_flushDelayTimer; + + QTimer m_scrollTimer; + int m_scrollDirection{0}; + + std::array<QColor, 20> m_currentColors; + + std::chrono::system_clock::time_point m_lastFlush{std::chrono::system_clock::now()}; + std::chrono::system_clock::time_point m_lastDoubleClick{std::chrono::system_clock::now()}; + bool m_selectLineMode{false}; + Cursor m_cursor; + QTimer m_cursorBlinkTimer; + bool m_cursorBlinkState{true}; + bool m_allowBlinkingCursor{true}; + bool m_allowMouseTracking{true}; + + SurfaceIntegration *m_surfaceIntegration{nullptr}; +}; + +QString defaultFontFamily() +{ +#ifdef Q_OS_DARWIN + return QLatin1String("Menlo"); +#elif defined(Q_OS_WIN) + return QLatin1String("Consolas"); +#else + return QLatin1String("Monospace"); +#endif +} + +int defaultFontSize() +{ +#ifdef Q_OS_DARWIN + return 12; +#elif defined(Q_OS_WIN) + return 10; +#else + return 9; +#endif +} + +TerminalView::TerminalView(QWidget *parent) + : QAbstractScrollArea(parent) + , d(std::make_unique<TerminalViewPrivate>()) +{ + setupSurface(); + setFont(QFont(defaultFontFamily(), defaultFontSize())); + + connect(&d->m_cursorBlinkTimer, &QTimer::timeout, this, [this]() { + if (hasFocus()) + d->m_cursorBlinkState = !d->m_cursorBlinkState; + else + d->m_cursorBlinkState = true; + updateViewportRect(gridToViewport(QRect{d->m_cursor.position, d->m_cursor.position})); + }); + + setAttribute(Qt::WA_InputMethodEnabled); + setAttribute(Qt::WA_MouseTracking); + setAcceptDrops(true); + + setCursor(Qt::IBeamCursor); + + setViewportMargins(1, 1, 1, 1); + + setFocus(); + setFocusPolicy(Qt::StrongFocus); + + setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + + connect(&d->m_flushDelayTimer, &QTimer::timeout, this, [this]() { flushVTerm(true); }); + + connect(&d->m_scrollTimer, &QTimer::timeout, this, [this] { + if (d->m_scrollDirection < 0) + verticalScrollBar()->triggerAction(QAbstractSlider::SliderSingleStepSub); + else if (d->m_scrollDirection > 0) + verticalScrollBar()->triggerAction(QAbstractSlider::SliderSingleStepAdd); + }); +} + +TerminalView::~TerminalView() = default; + +void TerminalView::setSurfaceIntegration(SurfaceIntegration *surfaceIntegration) +{ + d->m_surfaceIntegration = surfaceIntegration; + if (d->m_surface) + d->m_surface->setSurfaceIntegration(d->m_surfaceIntegration); +} + +TerminalSurface *TerminalView::surface() const +{ + return d->m_surface.get(); +} + +void TerminalView::setupSurface() +{ + d->m_surface = std::make_unique<TerminalSurface>(QSize{80, 60}); + + if (d->m_surfaceIntegration) + d->m_surface->setSurfaceIntegration(d->m_surfaceIntegration); + + connect(d->m_surface.get(), &TerminalSurface::writeToPty, this, &TerminalView::writeToPty); + + connect(d->m_surface.get(), &TerminalSurface::fullSizeChanged, this, [this] { + updateScrollBars(); + }); + connect(d->m_surface.get(), &TerminalSurface::invalidated, this, [this](const QRect &rect) { + setSelection(std::nullopt); + updateViewportRect(gridToViewport(rect)); + verticalScrollBar()->setValue(d->m_surface->fullSize().height()); + }); + connect( + d->m_surface.get(), + &TerminalSurface::cursorChanged, + this, + [this](const Cursor &oldCursor, const Cursor &newCursor) { + int startX = oldCursor.position.x(); + int endX = newCursor.position.x(); + + if (startX > endX) + std::swap(startX, endX); + + int startY = oldCursor.position.y(); + int endY = newCursor.position.y(); + if (startY > endY) + std::swap(startY, endY); + + d->m_cursor = newCursor; + + updateViewportRect(gridToViewport(QRect{QPoint{startX, startY}, QPoint{endX, endY}})); + configBlinkTimer(); + }); + connect(d->m_surface.get(), &TerminalSurface::altscreenChanged, this, [this] { + updateScrollBars(); + if (!setSelection(std::nullopt)) + updateViewport(); + }); + connect(d->m_surface.get(), &TerminalSurface::unscroll, this, [this] { + verticalScrollBar()->setValue(verticalScrollBar()->maximum()); + }); + + surfaceChanged(); + updateScrollBars(); +} + +void TerminalView::setAllowBlinkingCursor(bool allow) +{ + d->m_allowBlinkingCursor = allow; +} +bool TerminalView::allowBlinkingCursor() const +{ + return d->m_allowBlinkingCursor; +} + +void TerminalView::configBlinkTimer() +{ + bool shouldRun = d->m_cursor.visible && d->m_cursor.blink && hasFocus() + && d->m_allowBlinkingCursor; + if (shouldRun != d->m_cursorBlinkTimer.isActive()) { + if (shouldRun) + d->m_cursorBlinkTimer.start(); + else + d->m_cursorBlinkTimer.stop(); + } +} + +QColor TerminalView::toQColor(std::variant<int, QColor> color) const +{ + if (std::holds_alternative<int>(color)) { + int idx = std::get<int>(color); + if (idx >= 0 && idx < 18) + return d->m_currentColors[idx]; + + return d->m_currentColors[(int) WidgetColorIdx::Background]; + } + return std::get<QColor>(color); +} + +void TerminalView::setColors(const std::array<QColor, 20> &newColors) +{ + if (d->m_currentColors == newColors) + return; + + d->m_currentColors = newColors; + + updateViewport(); + update(); +} + +void TerminalView::setFont(const QFont &font) +{ + QAbstractScrollArea::setFont(font); + + QFontMetricsF qfm{font}; + qCInfo(terminalLog) << font.family() << font.pointSize() << qfm.averageCharWidth() + << qfm.maxWidth() << viewport()->size(); + + d->m_cellSize = {qfm.averageCharWidth(), (double) qCeil(qfm.height())}; + + QAbstractScrollArea::setFont(font); + + applySizeChange(); +} + +void TerminalView::copyToClipboard() +{ + if (!d->m_selection.has_value()) + return; + + QString text = textFromSelection(); + + qCDebug(selectionLog) << "Copied to clipboard: " << text; + + setClipboard(text); +} + +void TerminalView::pasteFromClipboard() +{ + QClipboard *clipboard = QApplication::clipboard(); + const QString clipboardText = clipboard->text(QClipboard::Clipboard); + + if (clipboardText.isEmpty()) + return; + + d->m_surface->pasteFromClipboard(clipboardText); +} + +void TerminalView::copyLinkToClipboard() +{ + if (d->m_linkSelection) + setClipboard(d->m_linkSelection->link.text); +} + +std::optional<TerminalView::Selection> TerminalView::selection() const +{ + return d->m_selection; +} + +void TerminalView::clearSelection() +{ + setSelection(std::nullopt); + d->m_surface->sendKey(Qt::Key_Escape); +} + +void TerminalView::zoomIn() +{ + QFont f = font(); + f.setPointSize(f.pointSize() + 1); + setFont(f); +} + +void TerminalView::zoomOut() +{ + QFont f = font(); + f.setPointSize(qMax(f.pointSize() - 1, 1)); + setFont(f); +} + +void TerminalView::moveCursorWordLeft() +{ + writeToPty("\x1b\x62"); +} + +void TerminalView::moveCursorWordRight() +{ + writeToPty("\x1b\x66"); +} + +void TerminalView::clearContents() +{ + d->m_surface->clearAll(); +} + +void TerminalView::writeToTerminal(const QByteArray &data, bool forceFlush) +{ + d->m_surface->dataFromPty(data); + flushVTerm(forceFlush); +} + +void TerminalView::flushVTerm(bool force) +{ + const std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); + const std::chrono::milliseconds timeSinceLastFlush + = std::chrono::duration_cast<std::chrono::milliseconds>(now - d->m_lastFlush); + + const bool shouldFlushImmediately = timeSinceLastFlush > minRefreshInterval; + if (force || shouldFlushImmediately) { + if (d->m_flushDelayTimer.isActive()) + d->m_flushDelayTimer.stop(); + + d->m_lastFlush = now; + d->m_surface->flush(); + return; + } + + if (!d->m_flushDelayTimer.isActive()) { + const std::chrono::milliseconds timeToNextFlush = (minRefreshInterval - timeSinceLastFlush); + d->m_flushDelayTimer.start(timeToNextFlush.count()); + } +} + +QString TerminalView::textFromSelection() const +{ + if (!d->m_selection) + return {}; + + CellIterator it = d->m_surface->iteratorAt(d->m_selection->start); + CellIterator end = d->m_surface->iteratorAt(d->m_selection->end); + + if (it.position() >= end.position()) { + qCWarning(selectionLog) << "Invalid selection: start >= end"; + return {}; + } + + std::u32string s; + bool previousWasZero = false; + for (; it != end; ++it) { + if (it.gridPos().x() == 0 && !s.empty() && previousWasZero) + s += U'\n'; + + if (*it != 0) { + previousWasZero = false; + s += *it; + } else { + previousWasZero = true; + } + } + + return QString::fromUcs4(s.data(), static_cast<int>(s.size())); +} + +bool TerminalView::setSelection(const std::optional<Selection> &selection, bool scroll) +{ + qCDebug(selectionLog) << "setSelection" << selection.has_value(); + if (selection.has_value()) + qCDebug(selectionLog) << "start:" << selection->start << "end:" << selection->end + << "final:" << selection->final; + + if (selectionLog().isDebugEnabled()) + updateViewport(); + + if (selection == d->m_selection) + return false; + + d->m_selection = selection; + selectionChanged(d->m_selection); + + if (d->m_selection && d->m_selection->final && scroll) { + QPoint start = d->m_surface->posToGrid(d->m_selection->start); + QPoint end = d->m_surface->posToGrid(d->m_selection->end); + QRect viewRect = gridToViewport(QRect{start, end}); + if (viewRect.y() >= viewport()->height() || viewRect.y() < 0) { + // Selection is outside of the viewport, scroll to it. + verticalScrollBar()->setValue(start.y()); + } + } + + if (!selectionLog().isDebugEnabled()) + updateViewport(); + + return true; +} + +void TerminalView::restart() +{ + setupSurface(); + applySizeChange(); +} + +QPoint TerminalView::viewportToGlobal(QPoint p) const +{ + int y = p.y() - topMargin(); + const double offset = verticalScrollBar()->value() * d->m_cellSize.height(); + y += offset; + + return {p.x(), y}; +} + +QPoint TerminalView::globalToViewport(QPoint p) const +{ + int y = p.y() + topMargin(); + const double offset = verticalScrollBar()->value() * d->m_cellSize.height(); + y -= offset; + + return {p.x(), y}; +} + +QPoint TerminalView::globalToGrid(QPointF p) const +{ + return QPoint(p.x() / d->m_cellSize.width(), p.y() / d->m_cellSize.height()); +} + +QPointF TerminalView::gridToGlobal(QPoint p, bool bottom, bool right) const +{ + QPointF result = QPointF(p.x() * d->m_cellSize.width(), p.y() * d->m_cellSize.height()); + if (bottom || right) + result += {right ? d->m_cellSize.width() : 0, bottom ? d->m_cellSize.height() : 0}; + return result; +} + +qreal TerminalView::topMargin() const +{ + return viewport()->size().height() + - (d->m_surface->liveSize().height() * d->m_cellSize.height()); +} + +static QPixmap generateWavyPixmap(qreal maxRadius, const QPen &pen) +{ + const qreal radiusBase = qMax(qreal(1), maxRadius); + const qreal pWidth = pen.widthF(); + + const QString key = QLatin1String("WaveUnderline-") % pen.color().name() + % QString::number(int(radiusBase), 16) % QString::number(int(pWidth), 16); + + QPixmap pixmap; + if (QPixmapCache::find(key, &pixmap)) + return pixmap; + + const qreal halfPeriod = qMax(qreal(2), qreal(radiusBase * 1.61803399)); // the golden ratio + const int width = qCeil(100 / (2 * halfPeriod)) * (2 * halfPeriod); + const qreal radius = qFloor(radiusBase * 2) / 2.; + + QPainterPath path; + + qreal xs = 0; + qreal ys = radius; + + while (xs < width) { + xs += halfPeriod; + ys = -ys; + path.quadTo(xs - halfPeriod / 2, ys, xs, 0); + } + + pixmap = QPixmap(width, radius * 2); + pixmap.fill(Qt::transparent); + { + QPen wavePen = pen; + wavePen.setCapStyle(Qt::SquareCap); + + // This is to protect against making the line too fat, as happens on macOS + // due to it having a rather thick width for the regular underline. + const qreal maxPenWidth = .8 * radius; + if (wavePen.widthF() > maxPenWidth) + wavePen.setWidthF(maxPenWidth); + + QPainter imgPainter(&pixmap); + imgPainter.setPen(wavePen); + imgPainter.setRenderHint(QPainter::Antialiasing); + imgPainter.translate(0, radius); + imgPainter.drawPath(path); + } + + QPixmapCache::insert(key, pixmap); + + return pixmap; +} + +// Copied from qpainter.cpp +static void drawTextItemDecoration(QPainter &painter, + const QPointF &pos, + QTextCharFormat::UnderlineStyle underlineStyle, + QTextItem::RenderFlags flags, + qreal width, + const QColor &underlineColor, + const QRawFont &font) +{ + if (underlineStyle == QTextCharFormat::NoUnderline + && !(flags & (QTextItem::StrikeOut | QTextItem::Overline))) + return; + + const QPen oldPen = painter.pen(); + const QBrush oldBrush = painter.brush(); + painter.setBrush(Qt::NoBrush); + QPen pen = oldPen; + pen.setStyle(Qt::SolidLine); + pen.setWidthF(font.lineThickness()); + pen.setCapStyle(Qt::FlatCap); + + QLineF line(qFloor(pos.x()), pos.y(), qFloor(pos.x() + width), pos.y()); + + const qreal underlineOffset = font.underlinePosition(); + + /*if (underlineStyle == QTextCharFormat::SpellCheckUnderline) { + QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme(); + if (theme) + underlineStyle = QTextCharFormat::UnderlineStyle( + theme->themeHint(QPlatformTheme::SpellCheckUnderlineStyle).toInt()); + if (underlineStyle == QTextCharFormat::SpellCheckUnderline) // still not resolved + underlineStyle = QTextCharFormat::WaveUnderline; + }*/ + + if (underlineStyle == QTextCharFormat::WaveUnderline) { + painter.save(); + painter.translate(0, pos.y() + 1); + qreal maxHeight = font.descent() - qreal(1); + + QColor uc = underlineColor; + if (uc.isValid()) + pen.setColor(uc); + + // Adapt wave to underlineOffset or pen width, whatever is larger, to make it work on all platforms + const QPixmap wave = generateWavyPixmap(qMin(qMax(underlineOffset, pen.widthF()), + maxHeight / qreal(2.)), + pen); + const int descent = qFloor(maxHeight); + + painter.setBrushOrigin(painter.brushOrigin().x(), 0); + painter.fillRect(pos.x(), 0, qCeil(width), qMin(wave.height(), descent), wave); + painter.restore(); + } else if (underlineStyle != QTextCharFormat::NoUnderline) { + // Deliberately ceil the offset to avoid the underline coming too close to + // the text above it, but limit it to stay within descent. + qreal adjustedUnderlineOffset = std::ceil(underlineOffset) + 0.5; + if (underlineOffset <= font.descent()) + adjustedUnderlineOffset = qMin(adjustedUnderlineOffset, font.descent() - qreal(0.5)); + const qreal underlinePos = pos.y() + adjustedUnderlineOffset; + QColor uc = underlineColor; + if (uc.isValid()) + pen.setColor(uc); + + pen.setStyle((Qt::PenStyle)(underlineStyle)); + painter.setPen(pen); + QLineF underline(line.x1(), underlinePos, line.x2(), underlinePos); + painter.drawLine(underline); + } + + pen.setStyle(Qt::SolidLine); + pen.setColor(oldPen.color()); + + if (flags & QTextItem::StrikeOut) { + QLineF strikeOutLine = line; + strikeOutLine.translate(0., -font.ascent() / 3.); + QColor uc = underlineColor; + if (uc.isValid()) + pen.setColor(uc); + painter.setPen(pen); + painter.drawLine(strikeOutLine); + } + + if (flags & QTextItem::Overline) { + QLineF overline = line; + overline.translate(0., -font.ascent()); + QColor uc = underlineColor; + if (uc.isValid()) + pen.setColor(uc); + painter.setPen(pen); + painter.drawLine(overline); + } + + painter.setPen(oldPen); + painter.setBrush(oldBrush); +} + +bool TerminalView::paintFindMatches(QPainter &p, + QList<SearchHit>::const_iterator &it, + const QRectF &cellRect, + const QPoint gridPos) const +{ + if (it == searchHits().constEnd()) + return false; + + const int pos = d->m_surface->gridToPos(gridPos); + while (it != searchHits().constEnd()) { + if (pos < it->start) + return false; + + if (pos >= it->end) { + ++it; + continue; + } + break; + } + + if (it == searchHits().constEnd()) + return false; + + p.fillRect(cellRect, d->m_currentColors[(size_t) WidgetColorIdx::FindMatch]); + + return true; +} + +bool TerminalView::paintSelection(QPainter &p, const QRectF &cellRect, const QPoint gridPos) const +{ + bool isInSelection = false; + const int pos = d->m_surface->gridToPos(gridPos); + + if (d->m_selection) + isInSelection = pos >= d->m_selection->start && pos < d->m_selection->end; + + if (isInSelection) + p.fillRect(cellRect, d->m_currentColors[(size_t) WidgetColorIdx::Selection]); + + return isInSelection; +} + +int TerminalView::paintCell(QPainter &p, + const QRectF &cellRect, + QPoint gridPos, + const TerminalCell &cell, + QFont &f, + QList<SearchHit>::const_iterator &searchIt) const +{ + bool paintBackground = !paintSelection(p, cellRect, gridPos) + && !paintFindMatches(p, searchIt, cellRect, gridPos); + + bool isDefaultBg = std::holds_alternative<int>(cell.backgroundColor) + && std::get<int>(cell.backgroundColor) == 17; + + if (paintBackground && !isDefaultBg) + p.fillRect(cellRect, toQColor(cell.backgroundColor)); + + p.setPen(toQColor(cell.foregroundColor)); + + f.setBold(cell.bold); + f.setItalic(cell.italic); + + if (!cell.text.isEmpty()) { + const auto r = GlyphCache::instance().get(f, cell.text); + + if (r) { + const auto brSize = r->boundingRect().size(); + QPointF brOffset; + if (brSize.width() > cellRect.size().width()) + brOffset.setX(-(brSize.width() - cellRect.size().width()) / 2.0); + if (brSize.height() > cellRect.size().height()) + brOffset.setY(-(brSize.height() - cellRect.size().height()) / 2.0); + + QPointF finalPos = cellRect.topLeft() + brOffset; + + p.drawGlyphRun(finalPos, *r); + + bool tempLink = false; + if (d->m_linkSelection) { + int chPos = d->m_surface->gridToPos(gridPos); + tempLink = chPos >= d->m_linkSelection->start && chPos < d->m_linkSelection->end; + } + if (cell.underlineStyle != QTextCharFormat::NoUnderline || cell.strikeOut || tempLink) { + QTextItem::RenderFlags flags; + //flags.setFlag(QTextItem::RenderFlag::Underline, cell.format.fontUnderline()); + flags.setFlag(QTextItem::StrikeOut, cell.strikeOut); + finalPos.setY(finalPos.y() + r->rawFont().ascent()); + drawTextItemDecoration(p, + finalPos, + tempLink ? QTextCharFormat::DashUnderline + : cell.underlineStyle, + flags, + cellRect.size().width(), + {}, + r->rawFont()); + } + } + } + + return cell.width; +} + +void TerminalView::paintCursor(QPainter &p) const +{ + auto cursor = d->m_surface->cursor(); + + if (!d->m_preEditString.isEmpty()) + cursor.shape = Cursor::Shape::Underline; + + const bool blinkState = !cursor.blink || d->m_cursorBlinkState || !d->m_allowBlinkingCursor + || !d->m_cursorBlinkTimer.isActive(); + + if (cursor.visible && blinkState) { + const int cursorCellWidth = d->m_surface->cellWidthAt(cursor.position.x(), + cursor.position.y()); + + QRectF cursorRect = QRectF(gridToGlobal(cursor.position), + gridToGlobal({cursor.position.x() + cursorCellWidth, + cursor.position.y()}, + true)) + .toAlignedRect(); + + cursorRect.adjust(1, 1, -1, -1); + + QPen pen(Qt::white, 0, Qt::SolidLine); + p.setPen(pen); + + if (hasFocus()) { + QPainter::CompositionMode oldMode = p.compositionMode(); + p.setCompositionMode(QPainter::RasterOp_NotDestination); + switch (cursor.shape) { + case Cursor::Shape::Block: + p.fillRect(cursorRect, p.pen().brush()); + break; + case Cursor::Shape::Underline: + p.drawLine(cursorRect.bottomLeft(), cursorRect.bottomRight()); + break; + case Cursor::Shape::LeftBar: + p.drawLine(cursorRect.topLeft(), cursorRect.bottomLeft()); + break; + } + p.setCompositionMode(oldMode); + } else { + p.drawRect(cursorRect); + } + } +} + +void TerminalView::paintPreedit(QPainter &p) const +{ + auto cursor = d->m_surface->cursor(); + if (!d->m_preEditString.isEmpty()) { + QRectF rect = QRectF(gridToGlobal(cursor.position), + gridToGlobal({cursor.position.x(), cursor.position.y()}, true, true)); + + rect.setWidth(viewport()->width() - rect.x()); + + p.setPen(toQColor((int) WidgetColorIdx::Foreground)); + QFont f = font(); + f.setUnderline(true); + p.setFont(f); + p.drawText(rect, Qt::TextDontClip | Qt::TextWrapAnywhere, d->m_preEditString); + } +} + +void TerminalView::paintCells(QPainter &p, QPaintEvent *event) const +{ + QFont f = font(); + + const int scrollOffset = verticalScrollBar()->value(); + + const int maxRow = d->m_surface->fullSize().height(); + const int startRow = qFloor((qreal) event->rect().y() / d->m_cellSize.height()) + scrollOffset; + const int endRow = qMin(maxRow, + qCeil((event->rect().y() + event->rect().height()) + / d->m_cellSize.height()) + + scrollOffset); + + QList<SearchHit>::const_iterator searchIt + = std::lower_bound(searchHits().constBegin(), + searchHits().constEnd(), + startRow, + [this](const SearchHit &hit, int value) { + return d->m_surface->posToGrid(hit.start).y() < value; + }); + + for (int cellY = startRow; cellY < endRow; ++cellY) { + for (int cellX = 0; cellX < d->m_surface->liveSize().width();) { + const auto cell = d->m_surface->fetchCell(cellX, cellY); + + QRectF cellRect(gridToGlobal({cellX, cellY}), + QSizeF{d->m_cellSize.width() * cell.width, d->m_cellSize.height()}); + + int numCells = paintCell(p, cellRect, {cellX, cellY}, cell, f, searchIt); + + cellX += numCells; + } + } +} + +void TerminalView::paintDebugSelection(QPainter &p, const Selection &selection) const +{ + auto s = globalToViewport(gridToGlobal(d->m_surface->posToGrid(selection.start)).toPoint()); + const auto e = globalToViewport( + gridToGlobal(d->m_surface->posToGrid(selection.end), true).toPoint()); + + p.setPen(QPen(Qt::green, 1, Qt::DashLine)); + p.drawLine(s.x(), 0, s.x(), height()); + p.drawLine(0, s.y(), width(), s.y()); + + p.setPen(QPen(Qt::red, 1, Qt::DashLine)); + + p.drawLine(e.x(), 0, e.x(), height()); + p.drawLine(0, e.y(), width(), e.y()); +} + +void TerminalView::paintEvent(QPaintEvent *event) +{ + QElapsedTimer t; + t.start(); + event->accept(); + QPainter p(viewport()); + + p.save(); + + if (paintLog().isDebugEnabled()) + p.fillRect(event->rect(), QColor::fromRgb(rand() % 60, rand() % 60, rand() % 60)); + else + p.fillRect(event->rect(), d->m_currentColors[(size_t) WidgetColorIdx::Background]); + + int scrollOffset = verticalScrollBar()->value(); + int offset = -(scrollOffset * d->m_cellSize.height()); + + qreal margin = topMargin(); + + p.translate(QPointF{0.0, offset + margin}); + + paintCells(p, event); + paintCursor(p); + paintPreedit(p); + + p.restore(); + + p.fillRect(QRectF{{0, 0}, QSizeF{(qreal) width(), topMargin()}}, + d->m_currentColors[(size_t) WidgetColorIdx::Background]); + + if (selectionLog().isDebugEnabled()) { + if (d->m_selection) + paintDebugSelection(p, *d->m_selection); + if (d->m_linkSelection) + paintDebugSelection(p, *d->m_linkSelection); + } + + if (paintLog().isDebugEnabled()) { + QToolTip::showText(this->mapToGlobal(QPoint(width() - 200, 0)), + QString("Paint: %1ms").arg(t.elapsed())); + } +} + +void TerminalView::keyPressEvent(QKeyEvent *event) +{ + // Don't blink during typing + if (d->m_cursorBlinkTimer.isActive()) { + d->m_cursorBlinkTimer.start(); + d->m_cursorBlinkState = true; + } + + if (event->key() == Qt::Key_Control) { + if (!d->m_linkSelection.has_value() && checkLinkAt(mapFromGlobal(QCursor::pos()))) { + setCursor(Qt::PointingHandCursor); + } + } + + event->accept(); + + d->m_surface->sendKey(event); +} + +void TerminalView::keyReleaseEvent(QKeyEvent *event) +{ + if (event->key() == Qt::Key_Control && d->m_linkSelection.has_value()) { + d->m_linkSelection.reset(); + setCursor(Qt::IBeamCursor); + updateViewport(); + } +} + +void TerminalView::applySizeChange() +{ + QSize newLiveSize = { + qFloor((qreal) (viewport()->size().width()) / (qreal) d->m_cellSize.width()), + qFloor((qreal) (viewport()->size().height()) / d->m_cellSize.height()), + }; + + if (newLiveSize.height() <= 0) + newLiveSize.setHeight(1); + + if (newLiveSize.width() <= 0) + newLiveSize.setWidth(1); + + resizePty(newLiveSize); + d->m_surface->resize(newLiveSize); + flushVTerm(true); +} + +void TerminalView::updateScrollBars() +{ + int scrollSize = d->m_surface->fullSize().height() - d->m_surface->liveSize().height(); + verticalScrollBar()->setRange(0, scrollSize); + verticalScrollBar()->setValue(verticalScrollBar()->maximum()); + updateViewport(); +} + +void TerminalView::resizeEvent(QResizeEvent *event) +{ + event->accept(); + + // If increasing in size, we'll trigger libvterm to call sb_popline in + // order to pull lines out of the history. This will cause the scrollback + // to decrease in size which reduces the size of the verticalScrollBar. + // That will trigger a scroll offset increase which we want to ignore. + d->m_ignoreScroll = true; + + applySizeChange(); + + setSelection(std::nullopt); + d->m_ignoreScroll = false; +} + +QRect TerminalView::gridToViewport(QRect rect) const +{ + int offset = verticalScrollBar()->value(); + + int startRow = rect.y() - offset; + int numRows = rect.height(); + int numCols = rect.width(); + + QRectF r{rect.x() * d->m_cellSize.width(), + startRow * d->m_cellSize.height(), + numCols * d->m_cellSize.width(), + numRows * d->m_cellSize.height()}; + + r.translate(0, topMargin()); + + return r.toAlignedRect(); +} + +QPoint TerminalView::toGridPos(QMouseEvent *event) const +{ + return globalToGrid(event->pos().toPointF() + QPointF(0, -topMargin() + 0.5)); +} + +void TerminalView::updateViewport() +{ + viewport()->update(); +} + +void TerminalView::updateViewportRect(const QRect &rect) +{ + viewport()->update(rect); +} + +void TerminalView::focusInEvent(QFocusEvent *) +{ + updateViewport(); + configBlinkTimer(); + selectionChanged(d->m_selection); +} +void TerminalView::focusOutEvent(QFocusEvent *) +{ + updateViewport(); + configBlinkTimer(); +} + +void TerminalView::inputMethodEvent(QInputMethodEvent *event) +{ + d->m_preEditString = event->preeditString(); + + if (event->commitString().isEmpty()) { + updateViewport(); + return; + } + + d->m_surface->sendKey(event->commitString()); +} + +void TerminalView::mousePressEvent(QMouseEvent *event) +{ + if (d->m_allowMouseTracking) { + d->m_surface->mouseMove(toGridPos(event), event->modifiers()); + d->m_surface->mouseButton(event->button(), true, event->modifiers()); + } + + d->m_scrollDirection = 0; + + d->m_activeMouseSelect.start = viewportToGlobal(event->pos()); + + if (event->button() == Qt::LeftButton && event->modifiers() & Qt::ControlModifier) { + if (d->m_linkSelection) { + if (event->modifiers() & Qt::ShiftModifier) { + copyLinkToClipboard(); + return; + } + + linkActivated(d->m_linkSelection->link); + } + return; + } + + if (event->button() == Qt::LeftButton) { + if (std::chrono::system_clock::now() - d->m_lastDoubleClick < 500ms) { + d->m_selectLineMode = true; + const Selection newSelection{d->m_surface->gridToPos( + {0, + d->m_surface->posToGrid(d->m_selection->start).y()}), + d->m_surface->gridToPos( + {d->m_surface->liveSize().width(), + d->m_surface->posToGrid(d->m_selection->end).y()}), + false}; + setSelection(newSelection); + } else { + d->m_selectLineMode = false; + int pos = d->m_surface->gridToPos(globalToGrid(viewportToGlobal(event->pos()))); + setSelection(Selection{pos, pos, false}); + } + event->accept(); + updateViewport(); + } else if (event->button() == Qt::RightButton) { + if (event->modifiers() & Qt::ShiftModifier) { + contextMenuRequested(event->pos()); + } else if (d->m_selection) { + copyToClipboard(); + setSelection(std::nullopt); + } else { + pasteFromClipboard(); + } + } else if (event->button() == Qt::MiddleButton) { + QClipboard *clipboard = QApplication::clipboard(); + if (clipboard->supportsSelection()) { + const QString selectionText = clipboard->text(QClipboard::Selection); + if (!selectionText.isEmpty()) + d->m_surface->pasteFromClipboard(selectionText); + } else { + d->m_surface->pasteFromClipboard(textFromSelection()); + } + } +} +void TerminalView::mouseMoveEvent(QMouseEvent *event) +{ + if (d->m_allowMouseTracking) + d->m_surface->mouseMove(toGridPos(event), event->modifiers()); + + if (d->m_selection && event->buttons() & Qt::LeftButton) { + Selection newSelection = *d->m_selection; + int scrollVelocity = 0; + if (event->pos().y() < 0) { + scrollVelocity = (event->pos().y()); + } else if (event->pos().y() > viewport()->height()) { + scrollVelocity = (event->pos().y() - viewport()->height()); + } + + if ((scrollVelocity != 0) != d->m_scrollTimer.isActive()) { + if (scrollVelocity != 0) + d->m_scrollTimer.start(); + else + d->m_scrollTimer.stop(); + } + + d->m_scrollDirection = scrollVelocity; + + if (d->m_scrollTimer.isActive() && scrollVelocity != 0) { + const std::chrono::milliseconds scrollInterval = 1000ms / qAbs(scrollVelocity); + if (d->m_scrollTimer.intervalAsDuration() != scrollInterval) + d->m_scrollTimer.setInterval(scrollInterval); + } + + QPoint posBoundedToViewport = event->pos(); + posBoundedToViewport.setX(qBound(0, posBoundedToViewport.x(), viewport()->width())); + + int start = d->m_surface->gridToPos(globalToGrid(d->m_activeMouseSelect.start)); + int newEnd = d->m_surface->gridToPos(globalToGrid(viewportToGlobal(posBoundedToViewport))); + + if (start > newEnd) { + std::swap(start, newEnd); + } + if (start < 0) + start = 0; + + if (d->m_selectLineMode) { + newSelection.start = d->m_surface->gridToPos({0, d->m_surface->posToGrid(start).y()}); + newSelection.end = d->m_surface->gridToPos( + {d->m_surface->liveSize().width(), d->m_surface->posToGrid(newEnd).y()}); + } else { + newSelection.start = start; + newSelection.end = newEnd; + } + + setSelection(newSelection); + } else if (event->modifiers() & Qt::ControlModifier) { + checkLinkAt(event->pos()); + } else if (d->m_linkSelection) { + d->m_linkSelection.reset(); + updateViewport(); + } + + if (d->m_linkSelection) { + setCursor(Qt::PointingHandCursor); + } else { + setCursor(Qt::IBeamCursor); + } +} + +void TerminalView::mouseReleaseEvent(QMouseEvent *event) +{ + if (d->m_allowMouseTracking) { + d->m_surface->mouseMove(toGridPos(event), event->modifiers()); + d->m_surface->mouseButton(event->button(), false, event->modifiers()); + } + + d->m_scrollTimer.stop(); + + if (d->m_selection && event->button() == Qt::LeftButton) { + if (d->m_selection->end - d->m_selection->start == 0) + setSelection(std::nullopt); + else + setSelection(Selection{d->m_selection->start, d->m_selection->end, true}); + } +} + +void TerminalView::mouseDoubleClickEvent(QMouseEvent *event) +{ + if (d->m_allowMouseTracking) { + d->m_surface->mouseMove(toGridPos(event), event->modifiers()); + d->m_surface->mouseButton(event->button(), true, event->modifiers()); + d->m_surface->mouseButton(event->button(), false, event->modifiers()); + } + + const auto hit = textAt(event->pos()); + + setSelection(Selection{hit.start, hit.end, true}); + + d->m_lastDoubleClick = std::chrono::system_clock::now(); + + event->accept(); +} + +void TerminalView::wheelEvent(QWheelEvent *event) +{ + verticalScrollBar()->event(event); + + if (!d->m_allowMouseTracking) + return; + + if (event->angleDelta().ry() > 0) + d->m_surface->mouseButton(Qt::ExtraButton1, true, event->modifiers()); + else if (event->angleDelta().ry() < 0) + d->m_surface->mouseButton(Qt::ExtraButton2, true, event->modifiers()); +} + +bool TerminalView::checkLinkAt(const QPoint &pos) +{ + const TextAndOffsets hit = textAt(pos); + + if (hit.text.size() > 0) { + QString t = QString::fromUcs4(hit.text.c_str(), hit.text.size()).trimmed(); + auto newLink = toLink(t); + if (newLink) { + const LinkSelection newSelection = LinkSelection{{hit.start, hit.end}, newLink.value()}; + if (!d->m_linkSelection || *d->m_linkSelection != newSelection) { + d->m_linkSelection = newSelection; + updateViewport(); + } + + return true; + } + } + + if (d->m_linkSelection) { + d->m_linkSelection.reset(); + updateViewport(); + } + return false; +} + +TerminalView::TextAndOffsets TerminalView::textAt(const QPoint &pos) const +{ + auto it = d->m_surface->iteratorAt(globalToGrid(viewportToGlobal(pos))); + auto itRev = d->m_surface->rIteratorAt(globalToGrid(viewportToGlobal(pos))); + + std::u32string whiteSpaces = U" \t\x00a0"; + + const bool inverted = whiteSpaces.find(*it) != std::u32string::npos || *it == 0; + + auto predicate = [inverted, whiteSpaces](const std::u32string::value_type &ch) { + if (inverted) + return ch != 0 && whiteSpaces.find(ch) == std::u32string::npos; + else + return ch == 0 || whiteSpaces.find(ch) != std::u32string::npos; + }; + + auto itRight = std::find_if(it, d->m_surface->end(), predicate); + auto itLeft = std::find_if(itRev, d->m_surface->rend(), predicate); + + std::u32string text; + std::copy(itLeft.base(), it, std::back_inserter(text)); + std::copy(it, itRight, std::back_inserter(text)); + std::transform(text.begin(), text.end(), text.begin(), [](const char32_t &ch) { + return ch == 0 ? U' ' : ch; + }); + + return {(itLeft.base()).position(), itRight.position(), text}; +} + +bool TerminalView::event(QEvent *event) +{ + if (event->type() == QEvent::Paint) { + QPainter p(this); + p.fillRect(QRect(QPoint(0, 0), size()), + d->m_currentColors[(size_t) WidgetColorIdx::Background]); + return true; + } + + // TODO: Is this necessary? + if (event->type() == QEvent::KeyPress) { + auto k = static_cast<QKeyEvent *>(event); + keyPressEvent(k); + return true; + } + if (event->type() == QEvent::KeyRelease) { + auto k = static_cast<QKeyEvent *>(event); + keyReleaseEvent(k); + return true; + } + + return QAbstractScrollArea::event(event); +} + +} // namespace TerminalSolution diff --git a/src/libs/solutions/terminal/terminalview.h b/src/libs/solutions/terminal/terminalview.h new file mode 100644 index 00000000000..7b0a2f7bc70 --- /dev/null +++ b/src/libs/solutions/terminal/terminalview.h @@ -0,0 +1,221 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "terminal_global.h" +#include "terminalsurface.h" + +#include <QAbstractScrollArea> +#include <QAction> +#include <QTextLayout> +#include <QTimer> + +#include <chrono> +#include <memory> +#include <optional> + +namespace TerminalSolution { + +class SurfaceIntegration; +class TerminalViewPrivate; + +struct SearchHit +{ + int start{-1}; + int end{-1}; + + bool operator!=(const SearchHit &other) const + { + return start != other.start || end != other.end; + } + bool operator==(const SearchHit &other) const { return !operator!=(other); } +}; + +QString defaultFontFamily(); +int defaultFontSize(); + +class TERMINAL_EXPORT TerminalView : public QAbstractScrollArea +{ + friend class CellIterator; + Q_OBJECT +public: + enum class WidgetColorIdx { + Foreground = ColorIndex::Foreground, + Background = ColorIndex::Background, + Selection, + FindMatch, + }; + + TerminalView(QWidget *parent = nullptr); + ~TerminalView() override; + + void setAllowBlinkingCursor(bool allow); + bool allowBlinkingCursor() const; + + void setFont(const QFont &font); + + void copyToClipboard(); + void pasteFromClipboard(); + void copyLinkToClipboard(); + + struct Selection + { + int start; + int end; + bool final{false}; + + bool operator!=(const Selection &other) const + { + return start != other.start || end != other.end || final != other.final; + } + + bool operator==(const Selection &other) const { return !operator!=(other); } + }; + + std::optional<Selection> selection() const; + void clearSelection(); + + void zoomIn(); + void zoomOut(); + + void moveCursorWordLeft(); + void moveCursorWordRight(); + + void clearContents(); + + void setSurfaceIntegration(SurfaceIntegration *surfaceIntegration); + void setColors(const std::array<QColor, 20> &colors); + + struct Link + { + QString text; + int targetLine = 0; + int targetColumn = 0; + }; + + struct LinkSelection : public Selection + { + Link link; + + bool operator!=(const LinkSelection &other) const + { + return link.text != other.link.text || link.targetLine != other.link.targetLine + || link.targetColumn != other.link.targetColumn || Selection::operator!=(other); + } + }; + + virtual void writeToPty(const QByteArray &data) { Q_UNUSED(data); } + void writeToTerminal(const QByteArray &data, bool forceFlush); + + void restart(); + + virtual const QList<SearchHit> &searchHits() const + { + static QList<SearchHit> noHits; + return noHits; + } + + virtual void resizePty(QSize newSize) { Q_UNUSED(newSize); } + virtual void setClipboard(const QString &text) { Q_UNUSED(text); } + virtual std::optional<Link> toLink(const QString &text) + { + Q_UNUSED(text); + return std::nullopt; + } + + virtual void selectionChanged(const std::optional<Selection> &newSelection) + { + Q_UNUSED(newSelection); + } + virtual void linkActivated(const Link &link) { Q_UNUSED(link); } + virtual void contextMenuRequested(const QPoint &pos) { Q_UNUSED(pos); } + + virtual void surfaceChanged(){}; + + TerminalSurface *surface() const; + +protected: + void paintEvent(QPaintEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; + void keyReleaseEvent(QKeyEvent *event) override; + void resizeEvent(QResizeEvent *event) override; + void wheelEvent(QWheelEvent *event) override; + void focusInEvent(QFocusEvent *event) override; + void focusOutEvent(QFocusEvent *event) override; + void inputMethodEvent(QInputMethodEvent *event) override; + + void mousePressEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; + + bool event(QEvent *event) override; + +protected: + void setupSurface(); + + int paintCell(QPainter &p, + const QRectF &cellRect, + QPoint gridPos, + const TerminalCell &cell, + QFont &f, + QList<SearchHit>::const_iterator &searchIt) const; + void paintCells(QPainter &painter, QPaintEvent *event) const; + void paintCursor(QPainter &painter) const; + void paintPreedit(QPainter &painter) const; + bool paintFindMatches(QPainter &painter, + QList<SearchHit>::const_iterator &searchIt, + const QRectF &cellRect, + const QPoint gridPos) const; + + bool paintSelection(QPainter &painter, const QRectF &cellRect, const QPoint gridPos) const; + void paintDebugSelection(QPainter &painter, const Selection &selection) const; + + qreal topMargin() const; + + QPoint viewportToGlobal(QPoint p) const; + QPoint globalToViewport(QPoint p) const; + QPoint globalToGrid(QPointF p) const; + QPointF gridToGlobal(QPoint p, bool bottom = false, bool right = false) const; + QRect gridToViewport(QRect rect) const; + QPoint toGridPos(QMouseEvent *event) const; + + void updateViewport(); + void updateViewportRect(const QRect &rect); + + int textLineFromPixel(int y) const; + std::optional<int> textPosFromPoint(const QTextLayout &textLayout, QPoint p) const; + + std::optional<QTextLayout::FormatRange> selectionToFormatRange(Selection selection, + const QTextLayout &layout, + int rowOffset) const; + + bool checkLinkAt(const QPoint &pos); + + struct TextAndOffsets + { + int start; + int end; + std::u32string text; + }; + + TextAndOffsets textAt(const QPoint &pos) const; + + void applySizeChange(); + void updateScrollBars(); + + void flushVTerm(bool force); + + bool setSelection(const std::optional<Selection> &selection, bool scroll = true); + QString textFromSelection() const; + + void configBlinkTimer(); + + QColor toQColor(std::variant<int, QColor> color) const; + +private: + std::unique_ptr<TerminalViewPrivate> d; +}; + +} // namespace TerminalSolution diff --git a/src/plugins/terminal/CMakeLists.txt b/src/plugins/terminal/CMakeLists.txt index bf405b672ab..28037780af2 100644 --- a/src/plugins/terminal/CMakeLists.txt +++ b/src/plugins/terminal/CMakeLists.txt @@ -1,12 +1,8 @@ add_qtc_plugin(Terminal PLUGIN_DEPENDS Core ProjectExplorer - DEPENDS libvterm ptyqt + DEPENDS TerminalLib SOURCES - celliterator.cpp celliterator.h - glyphcache.cpp glyphcache.h - keys.cpp keys.h - scrollback.cpp scrollback.h shellintegration.cpp shellintegration.h shellmodel.cpp shellmodel.h shortcutmap.cpp shortcutmap.h @@ -18,7 +14,6 @@ add_qtc_plugin(Terminal terminalprocessimpl.cpp terminalprocessimpl.h terminalsearch.cpp terminalsearch.h terminalsettings.cpp terminalsettings.h - terminalsurface.cpp terminalsurface.h terminaltr.h terminalwidget.cpp terminalwidget.h ) diff --git a/src/plugins/terminal/shellintegration.cpp b/src/plugins/terminal/shellintegration.cpp index d981dc7269e..44cee54b978 100644 --- a/src/plugins/terminal/shellintegration.cpp +++ b/src/plugins/terminal/shellintegration.cpp @@ -3,10 +3,13 @@ #include "shellintegration.h" +#include "terminalsettings.h" + #include <utils/environment.h> #include <utils/filepath.h> #include <utils/stringutils.h> +#include <QApplication> #include <QLoggingCategory> Q_LOGGING_CATEGORY(integrationLog, "qtc.terminal.shellintegration", QtWarningMsg) @@ -74,9 +77,12 @@ bool ShellIntegration::canIntegrate(const Utils::CommandLine &cmdLine) return false; } -void ShellIntegration::onOsc(int cmd, const VTermStringFragment &fragment) +void ShellIntegration::onOsc(int cmd, std::string_view str, bool initial, bool final) { - QString d = QString::fromLocal8Bit(fragment.str, fragment.len); + Q_UNUSED(initial); + Q_UNUSED(final); + + QString d = QString::fromLocal8Bit(str); const auto [command, data] = Utils::splitAtFirst(d, ';'); if (cmd == 1337) { @@ -103,6 +109,17 @@ void ShellIntegration::onOsc(int cmd, const VTermStringFragment &fragment) } } +void ShellIntegration::onBell() +{ + if (settings().audibleBell.value()) + QApplication::beep(); +} + +void ShellIntegration::onTitle(const QString &title) +{ + emit titleChanged(title); +} + void ShellIntegration::prepareProcess(Utils::Process &process) { Environment env = process.environment().hasChanges() ? process.environment() diff --git a/src/plugins/terminal/shellintegration.h b/src/plugins/terminal/shellintegration.h index a4a813c8a65..aac63e63e84 100644 --- a/src/plugins/terminal/shellintegration.h +++ b/src/plugins/terminal/shellintegration.h @@ -7,25 +7,28 @@ #include <utils/commandline.h> #include <utils/process.h> -#include <vterm.h> +#include <solutions/terminal/surfaceintegration.h> #include <QTemporaryDir> namespace Terminal { -class ShellIntegration : public QObject +class ShellIntegration : public QObject, public TerminalSolution::SurfaceIntegration { Q_OBJECT public: static bool canIntegrate(const Utils::CommandLine &cmdLine); - void onOsc(int cmd, const VTermStringFragment &fragment); + void onOsc(int cmd, std::string_view str, bool initial, bool final) override; + void onBell() override; + void onTitle(const QString &title) override; void prepareProcess(Utils::Process &process); signals: void commandChanged(const Utils::CommandLine &command); void currentDirChanged(const QString &dir); + void titleChanged(const QString &title); private: QTemporaryDir m_tempDir; diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index 3e4327dc235..13a1abac2f5 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -80,7 +80,8 @@ TerminalPane::TerminalPane(QObject *parent) m_escSettingButton->setToolTip(Tr::tr("Sends Esc to terminal instead of Qt Creator.")); } else { m_escSettingButton->setText(shiftEsc); - m_escSettingButton->setToolTip(Tr::tr("Press %1 to send Esc to terminal.").arg(shiftEsc)); + m_escSettingButton->setToolTip( + Tr::tr("Press %1 to send Esc to terminal.").arg(shiftEsc)); } }; @@ -161,8 +162,8 @@ void TerminalPane::openTerminal(const OpenTerminalParameters ¶meters) if (icon.isNull()) { QFileIconProvider iconProvider; const FilePath command = parametersCopy.shellCommand - ? parametersCopy.shellCommand->executable() - : settings().shell(); + ? parametersCopy.shellCommand->executable() + : settings().shell(); icon = iconProvider.icon(command.toFileInfo()); } } diff --git a/src/plugins/terminal/terminalsearch.cpp b/src/plugins/terminal/terminalsearch.cpp index d1aa392e9f4..20fa12908cb 100644 --- a/src/plugins/terminal/terminalsearch.cpp +++ b/src/plugins/terminal/terminalsearch.cpp @@ -17,17 +17,18 @@ using namespace std::chrono_literals; namespace Terminal { -using namespace Terminal::Internal; - constexpr std::chrono::milliseconds debounceInterval = 100ms; -TerminalSearch::TerminalSearch(TerminalSurface *surface) +TerminalSearch::TerminalSearch(TerminalSolution::TerminalSurface *surface) : m_surface(surface) { m_debounceTimer.setInterval(debounceInterval); m_debounceTimer.setSingleShot(true); - connect(surface, &TerminalSurface::invalidated, this, &TerminalSearch::updateHits); + connect(surface, + &TerminalSolution::TerminalSurface::invalidated, + this, + &TerminalSearch::updateHits); connect(&m_debounceTimer, &QTimer::timeout, this, &TerminalSearch::debouncedUpdateHits); } @@ -85,9 +86,9 @@ bool isSpace(char32_t a, char32_t b) return false; } -QList<SearchHit> TerminalSearch::search() +QList<TerminalSolution::SearchHit> TerminalSearch::search() { - QList<SearchHit> hits; + QList<TerminalSolution::SearchHit> hits; std::function<bool(char32_t, char32_t)> compare; @@ -108,12 +109,12 @@ QList<SearchHit> TerminalSearch::search() searchString.insert(searchString.begin(), std::numeric_limits<char32_t>::max()); } - Internal::CellIterator it = m_surface->begin(); + TerminalSolution::CellIterator it = m_surface->begin(); while (it != m_surface->end()) { it = std::search(it, m_surface->end(), searchString.begin(), searchString.end(), compare); if (it != m_surface->end()) { - auto hit = SearchHit{it.position(), + auto hit = TerminalSolution::SearchHit{it.position(), static_cast<int>(it.position() + searchString.size())}; if (m_findFlags.testFlag(FindFlag::FindWholeWords)) { hit.start++; @@ -127,9 +128,9 @@ QList<SearchHit> TerminalSearch::search() return hits; } -QList<SearchHit> TerminalSearch::searchRegex() +QList<TerminalSolution::SearchHit> TerminalSearch::searchRegex() { - QList<SearchHit> hits; + QList<TerminalSolution::SearchHit> hits; QString allText; allText.reserve(1000); @@ -170,7 +171,7 @@ QList<SearchHit> TerminalSearch::searchRegex() } e -= adjust; } - hits << SearchHit{s, e}; + hits << TerminalSolution::SearchHit{s, e}; } return hits; @@ -185,7 +186,7 @@ void TerminalSearch::debouncedUpdateHits() const bool regex = m_findFlags.testFlag(FindFlag::FindRegularExpression); - QList<SearchHit> hits = regex ? searchRegex() : search(); + QList<TerminalSolution::SearchHit> hits = regex ? searchRegex() : search(); if (hits != m_hits) { m_currentHit = -1; diff --git a/src/plugins/terminal/terminalsearch.h b/src/plugins/terminal/terminalsearch.h index a5a66edbcd5..4a176e7c643 100644 --- a/src/plugins/terminal/terminalsearch.h +++ b/src/plugins/terminal/terminalsearch.h @@ -3,7 +3,9 @@ #pragma once -#include "terminalsurface.h" +#include <terminal/terminalsurface.h> + +#include <solutions/terminal/terminalview.h> #include <coreplugin/find/ifindsupport.h> #include <coreplugin/find/textfindconstants.h> @@ -12,19 +14,7 @@ namespace Terminal { -struct SearchHit -{ - int start{-1}; - int end{-1}; - - bool operator!=(const SearchHit &other) const - { - return start != other.start || end != other.end; - } - bool operator==(const SearchHit &other) const { return !operator!=(other); } -}; - -struct SearchHitWithText : SearchHit +struct SearchHitWithText : TerminalSolution::SearchHit { QString text; }; @@ -33,17 +23,17 @@ class TerminalSearch : public Core::IFindSupport { Q_OBJECT public: - TerminalSearch(Internal::TerminalSurface *surface); + TerminalSearch(TerminalSolution::TerminalSurface *surface); void setCurrentSelection(std::optional<SearchHitWithText> selection); void setSearchString(const QString &searchString, Utils::FindFlags findFlags); void nextHit(); void previousHit(); - const QList<SearchHit> &hits() const { return m_hits; } - SearchHit currentHit() const + const QList<TerminalSolution::SearchHit> &hits() const { return m_hits; } + TerminalSolution::SearchHit currentHit() const { - return m_currentHit >= 0 ? m_hits.at(m_currentHit) : SearchHit{}; + return m_currentHit >= 0 ? m_hits.at(m_currentHit) : TerminalSolution::SearchHit{}; } public: @@ -65,17 +55,17 @@ signals: protected: void updateHits(); void debouncedUpdateHits(); - QList<SearchHit> search(); - QList<SearchHit> searchRegex(); + QList<TerminalSolution::SearchHit> search(); + QList<TerminalSolution::SearchHit> searchRegex(); private: std::optional<SearchHitWithText> m_currentSelection; QString m_currentSearchString; Utils::FindFlags m_findFlags; - Internal::TerminalSurface *m_surface; + TerminalSolution::TerminalSurface *m_surface; int m_currentHit{-1}; - QList<SearchHit> m_hits; + QList<TerminalSolution::SearchHit> m_hits; QTimer m_debounceTimer; }; diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index 9240a100b60..b86cce402d8 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -8,8 +8,6 @@ #include <coreplugin/icore.h> #include <coreplugin/dialogs/ioptionspage.h> -#include <libptyqt/ptyqt.h> - #include <utils/dropsupport.h> #include <utils/environment.h> #include <utils/expected.h> @@ -72,7 +70,6 @@ void setupColor(TerminalSettings *settings, color.setSettingsKey(label); color.setDefaultValue(defaultColor); color.setToolTip(Tr::tr("The color used for %1.").arg(label)); - settings->registerAspect(&color); } @@ -479,7 +476,7 @@ TerminalSettings::TerminalSettings() fontComboBox->setCurrentFont(font()); connect(fontComboBox, &QFontComboBox::currentFontChanged, this, [this](const QFont &f) { - font.setValue(f.family()); + font.setVolatileValue(f.family()); }); auto loadThemeButton = new QPushButton(Tr::tr("Load Theme...")); diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 72b7e103483..8916328971f 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -2,10 +2,8 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "terminalwidget.h" -#include "glyphcache.h" #include "terminalconstants.h" #include "terminalsettings.h" -#include "terminalsurface.h" #include "terminaltr.h" #include <aggregation/aggregate.h> @@ -25,8 +23,6 @@ #include <utils/proxyaction.h> #include <utils/stringutils.h> -#include <vterm.h> - #include <QApplication> #include <QCache> #include <QClipboard> @@ -47,90 +43,35 @@ #include <QTextLayout> #include <QToolTip> -Q_LOGGING_CATEGORY(terminalLog, "qtc.terminal", QtWarningMsg) -Q_LOGGING_CATEGORY(selectionLog, "qtc.terminal.selection", QtWarningMsg) -Q_LOGGING_CATEGORY(paintLog, "qtc.terminal.paint", QtWarningMsg) - using namespace Utils; using namespace Utils::Terminal; using namespace Core; namespace Terminal { - -namespace ColorIndex { -enum Indices { - Foreground = Internal::ColorIndex::Foreground, - Background = Internal::ColorIndex::Background, - Selection, - FindMatch, -}; -} - -using namespace std::chrono_literals; - -// Minimum time between two refreshes. (30fps) -static constexpr std::chrono::milliseconds minRefreshInterval = 1s / 30; - TerminalWidget::TerminalWidget(QWidget *parent, const OpenTerminalParameters &openParameters) - : QAbstractScrollArea(parent) + : TerminalSolution::TerminalView(parent) , m_context(Utils::Id("TerminalWidget_").withSuffix(QString::number((uintptr_t) this))) , m_openParameters(openParameters) - , m_lastFlush(std::chrono::system_clock::now()) - , m_lastDoubleClick(std::chrono::system_clock::now()) { auto contextObj = new IContext(this); contextObj->setWidget(this); contextObj->setContext(m_context); ICore::addContextObject(contextObj); - setupSurface(); setupFont(); setupColors(); setupActions(); - m_cursorBlinkTimer.setInterval(750); - m_cursorBlinkTimer.setSingleShot(false); + surfaceChanged(); - connect(&m_cursorBlinkTimer, &QTimer::timeout, this, [this]() { - if (hasFocus()) - m_cursorBlinkState = !m_cursorBlinkState; - else - m_cursorBlinkState = true; - updateViewportRect(gridToViewport(QRect{m_cursor.position, m_cursor.position})); - }); - - setAttribute(Qt::WA_InputMethodEnabled); - setAttribute(Qt::WA_MouseTracking); - setAcceptDrops(true); - - setCursor(Qt::IBeamCursor); - - setViewportMargins(1, 1, 1, 1); - - setFocus(); - setFocusPolicy(Qt::StrongFocus); - - setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - - m_flushDelayTimer.setSingleShot(true); - m_flushDelayTimer.setInterval(minRefreshInterval); - - connect(&m_flushDelayTimer, &QTimer::timeout, this, [this]() { flushVTerm(true); }); - - m_scrollTimer.setSingleShot(false); - m_scrollTimer.setInterval(1s / 2); - connect(&m_scrollTimer, &QTimer::timeout, this, [this] { - if (m_scrollDirection < 0) - verticalScrollBar()->triggerAction(QAbstractSlider::SliderSingleStepSub); - else if (m_scrollDirection > 0) - verticalScrollBar()->triggerAction(QAbstractSlider::SliderSingleStepAdd); - }); + setAllowBlinkingCursor(settings().allowBlinkingCursor()); connect(&settings(), &AspectContainer::applied, this, [this] { // Setup colors first, as setupFont will redraw the screen. setupColors(); setupFont(); configBlinkTimer(); + setAllowBlinkingCursor(settings().allowBlinkingCursor()); }); m_aggregate = new Aggregation::Aggregate(this); @@ -160,9 +101,8 @@ void TerminalWidget::setupPty() m_process->setWorkingDirectory(*m_openParameters.workingDirectory); m_process->setEnvironment(env); - if (m_surface->shellIntegration()) { - m_surface->shellIntegration()->prepareProcess(*m_process.get()); - } + if (m_shellIntegration) + m_shellIntegration->prepareProcess(*m_process.get()); connect(m_process.get(), &Process::readyReadStandardOutput, this, [this]() { onReadyRead(false); @@ -199,12 +139,12 @@ void TerminalWidget::setupPty() if (!errorMessage.isEmpty()) { QByteArray msg = QString("\r\n\033[31m%1").arg(errorMessage).toUtf8(); - m_surface->dataFromPty(msg); + writeToTerminal(msg, true); } else { QString exitMsg = Tr::tr("Process exited with code: %1") .arg(m_process ? m_process->exitCode() : -1); QByteArray msg = QString("\r\n%1").arg(exitMsg).toUtf8(); - m_surface->dataFromPty(msg); + writeToTerminal(msg, true); } } else if (!errorMessage.isEmpty()) { Core::MessageManager::writeFlashing(errorMessage); @@ -241,18 +181,12 @@ void TerminalWidget::setupColors() for (int i = 0; i < 16; ++i) { newColors[i] = settings().colors[i](); } - newColors[ColorIndex::Background] = settings().backgroundColor(); - newColors[ColorIndex::Foreground] = settings().foregroundColor(); - newColors[ColorIndex::Selection] = settings().selectionColor(); - newColors[ColorIndex::FindMatch] = settings().findMatchColor(); + newColors[(size_t) WidgetColorIdx::Background] = settings().backgroundColor.value(); + newColors[(size_t) WidgetColorIdx::Foreground] = settings().foregroundColor.value(); + newColors[(size_t) WidgetColorIdx::Selection] = settings().selectionColor.value(); + newColors[(size_t) WidgetColorIdx::FindMatch] = settings().findMatchColor.value(); - if (m_currentColors == newColors) - return; - - m_currentColors = newColors; - - updateViewport(); - update(); + setColors(newColors); } static bool contextMatcher(QObject *, Qt::ShortcutContext) @@ -336,74 +270,33 @@ void TerminalWidget::writeToPty(const QByteArray &data) m_process->writeRaw(data); } -void TerminalWidget::setupSurface() +void TerminalWidget::resizePty(QSize newSize) +{ + if (m_process && m_process->ptyData()) + m_process->ptyData()->resize(newSize); +} + +void TerminalWidget::surfaceChanged() { m_shellIntegration.reset(new ShellIntegration()); - m_surface = std::make_unique<Internal::TerminalSurface>(QSize{80, 60}, m_shellIntegration.get()); - m_search = TerminalSearchPtr(new TerminalSearch(m_surface.get()), [this](TerminalSearch *p) { + setSurfaceIntegration(m_shellIntegration.get()); + + m_search = TerminalSearchPtr(new TerminalSearch(surface()), [this](TerminalSearch *p) { m_aggregate->remove(p); delete p; }); connect(m_search.get(), &TerminalSearch::hitsChanged, this, &TerminalWidget::updateViewport); connect(m_search.get(), &TerminalSearch::currentHitChanged, this, [this] { - SearchHit hit = m_search->currentHit(); + TerminalSolution::SearchHit hit = m_search->currentHit(); if (hit.start >= 0) { setSelection(Selection{hit.start, hit.end, true}, hit != m_lastSelectedHit); m_lastSelectedHit = hit; } }); - connect(m_surface.get(), - &Internal::TerminalSurface::writeToPty, - this, - &TerminalWidget::writeToPty); - connect(m_surface.get(), &Internal::TerminalSurface::fullSizeChanged, this, [this] { - updateScrollBars(); - }); - connect(m_surface.get(), - &Internal::TerminalSurface::invalidated, - this, - [this](const QRect &rect) { - setSelection(std::nullopt); - updateViewportRect(gridToViewport(rect)); - verticalScrollBar()->setValue(m_surface->fullSize().height()); - }); - connect(m_surface.get(), - &Internal::TerminalSurface::cursorChanged, - this, - [this](const Internal::Cursor &oldCursor, const Internal::Cursor &newCursor) { - int startX = oldCursor.position.x(); - int endX = newCursor.position.x(); - - if (startX > endX) - std::swap(startX, endX); - - int startY = oldCursor.position.y(); - int endY = newCursor.position.y(); - if (startY > endY) - std::swap(startY, endY); - - m_cursor = newCursor; - - updateViewportRect( - gridToViewport(QRect{QPoint{startX, startY}, QPoint{endX, endY}})); - configBlinkTimer(); - }); - connect(m_surface.get(), &Internal::TerminalSurface::altscreenChanged, this, [this] { - updateScrollBars(); - if (!setSelection(std::nullopt)) - updateViewport(); - }); - connect(m_surface.get(), &Internal::TerminalSurface::unscroll, this, [this] { - verticalScrollBar()->setValue(verticalScrollBar()->maximum()); - }); - connect(m_surface.get(), &Internal::TerminalSurface::bell, this, [] { - if (settings().audibleBell()) - QApplication::beep(); - }); - connect(m_surface.get(), - &Internal::TerminalSurface::titleChanged, + connect(m_shellIntegration.get(), + &ShellIntegration::titleChanged, this, [this](const QString &title) { const FilePath titleFile = FilePath::fromUserInput(title); @@ -415,46 +308,20 @@ void TerminalWidget::setupSurface() emit titleChanged(); }); - if (m_shellIntegration) { - connect(m_shellIntegration.get(), - &ShellIntegration::commandChanged, - this, - [this](const CommandLine &command) { - m_currentCommand = command; - emit commandChanged(m_currentCommand); - }); - connect(m_shellIntegration.get(), - &ShellIntegration::currentDirChanged, - this, - [this](const QString ¤tDir) { - m_cwd = FilePath::fromUserInput(currentDir); - emit cwdChanged(m_cwd); - }); - } -} - -void TerminalWidget::configBlinkTimer() -{ - bool shouldRun = m_cursor.visible && m_cursor.blink && hasFocus() - && settings().allowBlinkingCursor(); - if (shouldRun != m_cursorBlinkTimer.isActive()) { - if (shouldRun) - m_cursorBlinkTimer.start(); - else - m_cursorBlinkTimer.stop(); - } -} - -QColor TerminalWidget::toQColor(std::variant<int, QColor> color) const -{ - if (std::holds_alternative<int>(color)) { - int idx = std::get<int>(color); - if (idx >= 0 && idx < 18) - return m_currentColors[idx]; - - return m_currentColors[ColorIndex::Background]; - } - return std::get<QColor>(color); + connect(m_shellIntegration.get(), + &ShellIntegration::commandChanged, + this, + [this](const CommandLine &command) { + m_currentCommand = command; + emit commandChanged(m_currentCommand); + }); + connect(m_shellIntegration.get(), + &ShellIntegration::currentDirChanged, + this, + [this](const QString ¤tDir) { + m_cwd = FilePath::fromUserInput(currentDir); + emit cwdChanged(m_cwd); + }); } QString TerminalWidget::title() const @@ -473,194 +340,49 @@ void TerminalWidget::updateCopyState() if (!hasFocus()) return; - m_copy->setEnabled(m_selection.has_value()); + m_copy->setEnabled(selection().has_value()); } -void TerminalWidget::setFont(const QFont &font) +void TerminalWidget::setClipboard(const QString &text) { - m_font = font; - - QFontMetricsF qfm{m_font}; - const qreal w = [qfm]() -> qreal { - if (HostOsInfo::isMacHost()) - return qfm.maxWidth(); - return qfm.averageCharWidth(); - }(); - - qCInfo(terminalLog) << font.family() << font.pointSize() << w << viewport()->size(); - - m_cellSize = {w, (double) qCeil(qfm.height())}; - - QAbstractScrollArea::setFont(m_font); - - if (m_process) { - applySizeChange(); - } -} - -void TerminalWidget::copyToClipboard() -{ - QTC_ASSERT(m_selection.has_value(), return); - - QString text = textFromSelection(); - - qCDebug(selectionLog) << "Copied to clipboard: " << text; - setClipboardAndSelection(text); } -void TerminalWidget::pasteFromClipboard() +std::optional<TerminalSolution::TerminalView::Link> TerminalWidget::toLink(const QString &text) { - QClipboard *clipboard = QApplication::clipboard(); - const QString clipboardText = clipboard->text(QClipboard::Clipboard); + if (text.size() > 0) { + QString result = chopIfEndsWith(text, ':'); - if (clipboardText.isEmpty()) - return; + if (!result.isEmpty()) { + if (result.startsWith("~/")) + result = QDir::homePath() + result.mid(1); - m_surface->pasteFromClipboard(clipboardText); + Utils::Link link = Utils::Link::fromString(result, true); + + if (!link.targetFilePath.isEmpty() && !link.targetFilePath.isAbsolutePath()) + link.targetFilePath = m_cwd.pathAppended(link.targetFilePath.path()); + + if (link.hasValidTarget() + && (link.targetFilePath.scheme().toString().startsWith("http") + || link.targetFilePath.exists())) { + return Link{link.targetFilePath.toString(), link.targetLine, link.targetColumn}; + } + } + } + + return std::nullopt; } -void TerminalWidget::copyLinkToClipboard() +const QList<TerminalSolution::SearchHit> &TerminalWidget::searchHits() const { - if (m_linkSelection) - setClipboardAndSelection(m_linkSelection->link.targetFilePath.toUserOutput()); -} - -void TerminalWidget::clearSelection() -{ - setSelection(std::nullopt); - m_surface->sendKey(Qt::Key_Escape); -} - -void TerminalWidget::zoomIn() -{ - m_font.setPointSize(m_font.pointSize() + 1); - setFont(m_font); -} - -void TerminalWidget::zoomOut() -{ - m_font.setPointSize(qMax(m_font.pointSize() - 1, 1)); - setFont(m_font); -} - -void TerminalWidget::moveCursorWordLeft() -{ - writeToPty("\x1b\x62"); -} - -void TerminalWidget::moveCursorWordRight() -{ - writeToPty("\x1b\x66"); -} - -void TerminalWidget::clearContents() -{ - m_surface->clearAll(); + return m_search->hits(); } void TerminalWidget::onReadyRead(bool forceFlush) { QByteArray data = m_process->readAllRawStandardOutput(); - m_surface->dataFromPty(data); - - flushVTerm(forceFlush); -} - -void TerminalWidget::flushVTerm(bool force) -{ - const std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); - const std::chrono::milliseconds timeSinceLastFlush - = std::chrono::duration_cast<std::chrono::milliseconds>(now - m_lastFlush); - - const bool shouldFlushImmediately = timeSinceLastFlush > minRefreshInterval; - if (force || shouldFlushImmediately) { - if (m_flushDelayTimer.isActive()) - m_flushDelayTimer.stop(); - - m_lastFlush = now; - m_surface->flush(); - return; - } - - if (!m_flushDelayTimer.isActive()) { - const std::chrono::milliseconds timeToNextFlush = (minRefreshInterval - timeSinceLastFlush); - m_flushDelayTimer.start(timeToNextFlush.count()); - } -} - -QString TerminalWidget::textFromSelection() const -{ - if (!m_selection) - return {}; - - Internal::CellIterator it = m_surface->iteratorAt(m_selection->start); - Internal::CellIterator end = m_surface->iteratorAt(m_selection->end); - - QTC_ASSERT(it.position() < end.position(), return {}); - - std::u32string s; - bool previousWasZero = false; - for (; it != end; ++it) { - if (it.gridPos().x() == 0 && !s.empty() && previousWasZero) - s += U'\n'; - - if (*it != 0) { - previousWasZero = false; - s += *it; - } else { - previousWasZero = true; - } - } - - return QString::fromUcs4(s.data(), static_cast<int>(s.size())); -} - -bool TerminalWidget::setSelection(const std::optional<Selection> &selection, bool scroll) -{ - qCDebug(selectionLog) << "setSelection" << selection.has_value(); - if (selection.has_value()) - qCDebug(selectionLog) << "start:" << selection->start << "end:" << selection->end - << "final:" << selection->final; - - if (selectionLog().isDebugEnabled()) - updateViewport(); - - if (selection == m_selection) - return false; - - m_selection = selection; - - updateCopyState(); - - if (m_selection && m_selection->final) { - qCDebug(selectionLog) << "Copy enabled:" << selection.has_value(); - QString text = textFromSelection(); - - QClipboard *clipboard = QApplication::clipboard(); - if (clipboard->supportsSelection()) { - qCDebug(selectionLog) << "Selection set to clipboard: " << text; - clipboard->setText(text, QClipboard::Selection); - } - - if (scroll) { - QPoint start = m_surface->posToGrid(m_selection->start); - QPoint end = m_surface->posToGrid(m_selection->end); - QRect viewRect = gridToViewport(QRect{start, end}); - if (viewRect.y() >= viewport()->height() || viewRect.y() < 0) { - // Selection is outside of the viewport, scroll to it. - verticalScrollBar()->setValue(start.y()); - } - } - - m_search->setCurrentSelection(SearchHitWithText{{selection->start, selection->end}, text}); - } - - if (!selectionLog().isDebugEnabled()) - updateViewport(); - - return true; + writeToTerminal(data, forceFlush); } void TerminalWidget::setShellName(const QString &shellName) @@ -700,874 +422,65 @@ void TerminalWidget::restart(const OpenTerminalParameters &openParameters) { QTC_ASSERT(!m_process || !m_process->isRunning(), return); m_openParameters = openParameters; - m_process.reset(); - setupSurface(); + TerminalView::restart(); setupPty(); } -QPoint TerminalWidget::viewportToGlobal(QPoint p) const +void TerminalWidget::selectionChanged(const std::optional<Selection> &newSelection) { - int y = p.y() - topMargin(); - const double offset = verticalScrollBar()->value() * m_cellSize.height(); - y += offset; + updateCopyState(); - return {p.x(), y}; -} + if (selection() && selection()->final) { + QString text = textFromSelection(); -QPoint TerminalWidget::globalToViewport(QPoint p) const -{ - int y = p.y() + topMargin(); - const double offset = verticalScrollBar()->value() * m_cellSize.height(); - y -= offset; + QClipboard *clipboard = QApplication::clipboard(); + if (clipboard->supportsSelection()) + clipboard->setText(text, QClipboard::Selection); - return {p.x(), y}; -} - -QPoint TerminalWidget::globalToGrid(QPointF p) const -{ - return QPoint(p.x() / m_cellSize.width(), p.y() / m_cellSize.height()); -} - -QPointF TerminalWidget::gridToGlobal(QPoint p, bool bottom, bool right) const -{ - QPointF result = QPointF(p.x() * m_cellSize.width(), p.y() * m_cellSize.height()); - if (bottom || right) - result += {right ? m_cellSize.width() : 0, bottom ? m_cellSize.height() : 0}; - return result; -} - -qreal TerminalWidget::topMargin() const -{ - return viewport()->size().height() - (m_surface->liveSize().height() * m_cellSize.height()); -} - -static QPixmap generateWavyPixmap(qreal maxRadius, const QPen &pen) -{ - const qreal radiusBase = qMax(qreal(1), maxRadius); - const qreal pWidth = pen.widthF(); - - const QString key = QLatin1String("WaveUnderline-") % pen.color().name() - % QString::number(int(radiusBase), 16) - % QString::number(int(pWidth), 16); - - QPixmap pixmap; - if (QPixmapCache::find(key, &pixmap)) - return pixmap; - - const qreal halfPeriod = qMax(qreal(2), qreal(radiusBase * 1.61803399)); // the golden ratio - const int width = qCeil(100 / (2 * halfPeriod)) * (2 * halfPeriod); - const qreal radius = qFloor(radiusBase * 2) / 2.; - - QPainterPath path; - - qreal xs = 0; - qreal ys = radius; - - while (xs < width) { - xs += halfPeriod; - ys = -ys; - path.quadTo(xs - halfPeriod / 2, ys, xs, 0); + m_search->setCurrentSelection( + SearchHitWithText{{newSelection->start, newSelection->end}, text}); } - - pixmap = QPixmap(width, radius * 2); - pixmap.fill(Qt::transparent); - { - QPen wavePen = pen; - wavePen.setCapStyle(Qt::SquareCap); - - // This is to protect against making the line too fat, as happens on macOS - // due to it having a rather thick width for the regular underline. - const qreal maxPenWidth = .8 * radius; - if (wavePen.widthF() > maxPenWidth) - wavePen.setWidthF(maxPenWidth); - - QPainter imgPainter(&pixmap); - imgPainter.setPen(wavePen); - imgPainter.setRenderHint(QPainter::Antialiasing); - imgPainter.translate(0, radius); - imgPainter.drawPath(path); - } - - QPixmapCache::insert(key, pixmap); - - return pixmap; } -// Copied from qpainter.cpp -static void drawTextItemDecoration(QPainter &painter, - const QPointF &pos, - QTextCharFormat::UnderlineStyle underlineStyle, - QTextItem::RenderFlags flags, - qreal width, - const QColor &underlineColor, - const QRawFont &font) +void TerminalWidget::linkActivated(const Link &link) { - if (underlineStyle == QTextCharFormat::NoUnderline - && !(flags & (QTextItem::StrikeOut | QTextItem::Overline))) + FilePath filePath = FilePath::fromUserInput(link.text); + + if (filePath.scheme().toString().startsWith("http")) { + QDesktopServices::openUrl(filePath.toUrl()); return; - - const QPen oldPen = painter.pen(); - const QBrush oldBrush = painter.brush(); - painter.setBrush(Qt::NoBrush); - QPen pen = oldPen; - pen.setStyle(Qt::SolidLine); - pen.setWidthF(font.lineThickness()); - pen.setCapStyle(Qt::FlatCap); - - QLineF line(qFloor(pos.x()), pos.y(), qFloor(pos.x() + width), pos.y()); - - const qreal underlineOffset = font.underlinePosition(); - - /*if (underlineStyle == QTextCharFormat::SpellCheckUnderline) { - QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme(); - if (theme) - underlineStyle = QTextCharFormat::UnderlineStyle( - theme->themeHint(QPlatformTheme::SpellCheckUnderlineStyle).toInt()); - if (underlineStyle == QTextCharFormat::SpellCheckUnderline) // still not resolved - underlineStyle = QTextCharFormat::WaveUnderline; - }*/ - - if (underlineStyle == QTextCharFormat::WaveUnderline) { - painter.save(); - painter.translate(0, pos.y() + 1); - qreal maxHeight = font.descent() - qreal(1); - - QColor uc = underlineColor; - if (uc.isValid()) - pen.setColor(uc); - - // Adapt wave to underlineOffset or pen width, whatever is larger, to make it work on all platforms - const QPixmap wave = generateWavyPixmap(qMin(qMax(underlineOffset, pen.widthF()), - maxHeight / qreal(2.)), - pen); - const int descent = qFloor(maxHeight); - - painter.setBrushOrigin(painter.brushOrigin().x(), 0); - painter.fillRect(pos.x(), 0, qCeil(width), qMin(wave.height(), descent), wave); - painter.restore(); - } else if (underlineStyle != QTextCharFormat::NoUnderline) { - // Deliberately ceil the offset to avoid the underline coming too close to - // the text above it, but limit it to stay within descent. - qreal adjustedUnderlineOffset = std::ceil(underlineOffset) + 0.5; - if (underlineOffset <= font.descent()) - adjustedUnderlineOffset = qMin(adjustedUnderlineOffset, font.descent() - qreal(0.5)); - const qreal underlinePos = pos.y() + adjustedUnderlineOffset; - QColor uc = underlineColor; - if (uc.isValid()) - pen.setColor(uc); - - pen.setStyle((Qt::PenStyle)(underlineStyle)); - painter.setPen(pen); - QLineF underline(line.x1(), underlinePos, line.x2(), underlinePos); - painter.drawLine(underline); } - pen.setStyle(Qt::SolidLine); - pen.setColor(oldPen.color()); - - if (flags & QTextItem::StrikeOut) { - QLineF strikeOutLine = line; - strikeOutLine.translate(0., -font.ascent() / 3.); - QColor uc = underlineColor; - if (uc.isValid()) - pen.setColor(uc); - painter.setPen(pen); - painter.drawLine(strikeOutLine); - } - - if (flags & QTextItem::Overline) { - QLineF overline = line; - overline.translate(0., -font.ascent()); - QColor uc = underlineColor; - if (uc.isValid()) - pen.setColor(uc); - painter.setPen(pen); - painter.drawLine(overline); - } - - painter.setPen(oldPen); - painter.setBrush(oldBrush); -} - -bool TerminalWidget::paintFindMatches(QPainter &p, - QList<SearchHit>::const_iterator &it, - const QRectF &cellRect, - const QPoint gridPos) const -{ - if (it == m_search->hits().constEnd()) - return false; - - const int pos = m_surface->gridToPos(gridPos); - while (it != m_search->hits().constEnd()) { - if (pos < it->start) - return false; - - if (pos >= it->end) { - ++it; - continue; - } - break; - } - - if (it == m_search->hits().constEnd()) - return false; - - p.fillRect(cellRect, m_currentColors[ColorIndex::FindMatch]); - - return true; -} - -bool TerminalWidget::paintSelection(QPainter &p, const QRectF &cellRect, const QPoint gridPos) const -{ - bool isInSelection = false; - const int pos = m_surface->gridToPos(gridPos); - - if (m_selection) - isInSelection = pos >= m_selection->start && pos < m_selection->end; - - if (isInSelection) - p.fillRect(cellRect, m_currentColors[ColorIndex::Selection]); - - return isInSelection; -} - -int TerminalWidget::paintCell(QPainter &p, - const QRectF &cellRect, - QPoint gridPos, - const Internal::TerminalCell &cell, - QFont &f, - QList<SearchHit>::const_iterator &searchIt) const -{ - bool paintBackground = !paintSelection(p, cellRect, gridPos) - && !paintFindMatches(p, searchIt, cellRect, gridPos); - - bool isDefaultBg = std::holds_alternative<int>(cell.backgroundColor) - && std::get<int>(cell.backgroundColor) == 17; - - if (paintBackground && !isDefaultBg) - p.fillRect(cellRect, toQColor(cell.backgroundColor)); - - p.setPen(toQColor(cell.foregroundColor)); - - f.setBold(cell.bold); - f.setItalic(cell.italic); - - if (!cell.text.isEmpty()) { - const auto r = Internal::GlyphCache::instance().get(f, cell.text); - - if (r) { - const auto brSize = r->boundingRect().size(); - QPointF brOffset; - if (brSize.width() > cellRect.size().width()) - brOffset.setX(-(brSize.width() - cellRect.size().width()) / 2.0); - if (brSize.height() > cellRect.size().height()) - brOffset.setY(-(brSize.height() - cellRect.size().height()) / 2.0); - - QPointF finalPos = cellRect.topLeft() + brOffset; - - p.drawGlyphRun(finalPos, *r); - - bool tempLink = false; - if (m_linkSelection) { - int chPos = m_surface->gridToPos(gridPos); - tempLink = chPos >= m_linkSelection->start && chPos < m_linkSelection->end; - } - if (cell.underlineStyle != QTextCharFormat::NoUnderline || cell.strikeOut || tempLink) { - QTextItem::RenderFlags flags; - //flags.setFlag(QTextItem::RenderFlag::Underline, cell.format.fontUnderline()); - flags.setFlag(QTextItem::StrikeOut, cell.strikeOut); - finalPos.setY(finalPos.y() + r->rawFont().ascent()); - drawTextItemDecoration(p, - finalPos, - tempLink ? QTextCharFormat::DashUnderline - : cell.underlineStyle, - flags, - cellRect.size().width(), - {}, - r->rawFont()); - } - } - } - - return cell.width; -} - -void TerminalWidget::paintCursor(QPainter &p) const -{ - if (!m_process || !m_process->isRunning()) - return; - - auto cursor = m_surface->cursor(); - - if (!m_preEditString.isEmpty()) - cursor.shape = Internal::Cursor::Shape::Underline; - - const bool blinkState = !cursor.blink || m_cursorBlinkState - || !settings().allowBlinkingCursor(); - - if (cursor.visible && blinkState) { - const int cursorCellWidth = m_surface->cellWidthAt(cursor.position.x(), cursor.position.y()); - - QRectF cursorRect = QRectF(gridToGlobal(cursor.position), - gridToGlobal({cursor.position.x() + cursorCellWidth, - cursor.position.y()}, - true)) - .toAlignedRect(); - - cursorRect.adjust(1, 1, -1, -1); - - QPen pen(Qt::white, 0, Qt::SolidLine); - p.setPen(pen); - - if (hasFocus()) { - QPainter::CompositionMode oldMode = p.compositionMode(); - p.setCompositionMode(QPainter::RasterOp_NotDestination); - switch (cursor.shape) { - case Internal::Cursor::Shape::Block: - p.fillRect(cursorRect, p.pen().brush()); - break; - case Internal::Cursor::Shape::Underline: - p.drawLine(cursorRect.bottomLeft(), cursorRect.bottomRight()); - break; - case Internal::Cursor::Shape::LeftBar: - p.drawLine(cursorRect.topLeft(), cursorRect.bottomLeft()); - break; - } - p.setCompositionMode(oldMode); - } else { - p.drawRect(cursorRect); - } - } -} - -void TerminalWidget::paintPreedit(QPainter &p) const -{ - auto cursor = m_surface->cursor(); - if (!m_preEditString.isEmpty()) { - QRectF rect = QRectF(gridToGlobal(cursor.position), - gridToGlobal({cursor.position.x(), cursor.position.y()}, true, true)); - - rect.setWidth(viewport()->width() - rect.x()); - - p.setPen(toQColor(ColorIndex::Foreground)); - QFont f = font(); - f.setUnderline(true); - p.setFont(f); - p.drawText(rect, Qt::TextDontClip | Qt::TextWrapAnywhere, m_preEditString); - } -} - -void TerminalWidget::paintCells(QPainter &p, QPaintEvent *event) const -{ - QFont f = m_font; - - const int scrollOffset = verticalScrollBar()->value(); - - const int maxRow = m_surface->fullSize().height(); - const int startRow = qFloor((qreal) event->rect().y() / m_cellSize.height()) + scrollOffset; - const int endRow = qMin(maxRow, - qCeil((event->rect().y() + event->rect().height()) / m_cellSize.height()) - + scrollOffset); - - QList<SearchHit>::const_iterator searchIt - = std::lower_bound(m_search->hits().constBegin(), - m_search->hits().constEnd(), - startRow, - [this](const SearchHit &hit, int value) { - return m_surface->posToGrid(hit.start).y() < value; - }); - - for (int cellY = startRow; cellY < endRow; ++cellY) { - for (int cellX = 0; cellX < m_surface->liveSize().width();) { - const auto cell = m_surface->fetchCell(cellX, cellY); - - QRectF cellRect(gridToGlobal({cellX, cellY}), - QSizeF{m_cellSize.width() * cell.width, m_cellSize.height()}); - - int numCells = paintCell(p, cellRect, {cellX, cellY}, cell, f, searchIt); - - cellX += numCells; - } - } -} - -void TerminalWidget::paintDebugSelection(QPainter &p, const Selection &selection) const -{ - auto s = globalToViewport(gridToGlobal(m_surface->posToGrid(selection.start)).toPoint()); - const auto e = globalToViewport( - gridToGlobal(m_surface->posToGrid(selection.end), true).toPoint()); - - p.setPen(QPen(Qt::green, 1, Qt::DashLine)); - p.drawLine(s.x(), 0, s.x(), height()); - p.drawLine(0, s.y(), width(), s.y()); - - p.setPen(QPen(Qt::red, 1, Qt::DashLine)); - - p.drawLine(e.x(), 0, e.x(), height()); - p.drawLine(0, e.y(), width(), e.y()); -} - -void TerminalWidget::paintEvent(QPaintEvent *event) -{ - QElapsedTimer t; - t.start(); - event->accept(); - QPainter p(viewport()); - - p.save(); - - if (paintLog().isDebugEnabled()) - p.fillRect(event->rect(), QColor::fromRgb(rand() % 60, rand() % 60, rand() % 60)); + if (filePath.isDir()) + Core::FileUtils::showInFileSystemView(filePath); else - p.fillRect(event->rect(), m_currentColors[ColorIndex::Background]); - - int scrollOffset = verticalScrollBar()->value(); - int offset = -(scrollOffset * m_cellSize.height()); - - qreal margin = topMargin(); - - p.translate(QPointF{0.0, offset + margin}); - - paintCells(p, event); - paintCursor(p); - paintPreedit(p); - - p.restore(); - - p.fillRect(QRectF{{0, 0}, QSizeF{(qreal) width(), topMargin()}}, - m_currentColors[ColorIndex::Background]); - - if (selectionLog().isDebugEnabled()) { - if (m_selection) - paintDebugSelection(p, *m_selection); - if (m_linkSelection) - paintDebugSelection(p, *m_linkSelection); - } - - if (paintLog().isDebugEnabled()) { - QToolTip::showText(this->mapToGlobal(QPoint(width() - 200, 0)), - QString("Paint: %1ms").arg(t.elapsed())); - } + EditorManager::openEditorAt(Utils::Link{filePath, link.targetLine, link.targetColumn}); } -void TerminalWidget::keyPressEvent(QKeyEvent *event) +void TerminalWidget::focusInEvent(QFocusEvent *event) { - // Don't blink during typing - if (m_cursorBlinkTimer.isActive()) { - m_cursorBlinkTimer.start(); - m_cursorBlinkState = true; - } - - if (event->key() == Qt::Key_Escape) { - bool sendToTerminal = settings().sendEscapeToTerminal(); - bool send = false; - if (sendToTerminal && event->modifiers() == Qt::NoModifier) - send = true; - else if (!sendToTerminal && event->modifiers() == Qt::ShiftModifier) - send = true; - - if (send) { - event->setModifiers(Qt::NoModifier); - m_surface->sendKey(event); - return; - } - - if (m_selection) - m_clearSelection->trigger(); - else { - QAction *returnAction = ActionManager::command(Core::Constants::S_RETURNTOEDITOR) - ->actionForContext(Core::Constants::C_GLOBAL); - QTC_ASSERT(returnAction, return); - returnAction->trigger(); - } - return; - } - - if (event->key() == Qt::Key_Control) { - if (!m_linkSelection.has_value() && checkLinkAt(mapFromGlobal(QCursor::pos()))) { - setCursor(Qt::PointingHandCursor); - } - } - - event->accept(); - - m_surface->sendKey(event); -} - -void TerminalWidget::keyReleaseEvent(QKeyEvent *event) -{ - if (event->key() == Qt::Key_Control && m_linkSelection.has_value()) { - m_linkSelection.reset(); - updateCopyState(); - setCursor(Qt::IBeamCursor); - updateViewport(); - } -} - -void TerminalWidget::applySizeChange() -{ - QSize newLiveSize = { - qFloor((qreal) (viewport()->size().width()) / (qreal) m_cellSize.width()), - qFloor((qreal) (viewport()->size().height()) / m_cellSize.height()), - }; - - if (newLiveSize.height() <= 0) - newLiveSize.setHeight(1); - - if (newLiveSize.width() <= 0) - newLiveSize.setWidth(1); - - if (m_process && m_process->ptyData()) - m_process->ptyData()->resize(newLiveSize); - - m_surface->resize(newLiveSize); - flushVTerm(true); -} - -void TerminalWidget::updateScrollBars() -{ - int scrollSize = m_surface->fullSize().height() - m_surface->liveSize().height(); - verticalScrollBar()->setRange(0, scrollSize); - verticalScrollBar()->setValue(verticalScrollBar()->maximum()); - updateViewport(); -} - -void TerminalWidget::resizeEvent(QResizeEvent *event) -{ - event->accept(); - - // If increasing in size, we'll trigger libvterm to call sb_popline in - // order to pull lines out of the history. This will cause the scrollback - // to decrease in size which reduces the size of the verticalScrollBar. - // That will trigger a scroll offset increase which we want to ignore. - m_ignoreScroll = true; - - applySizeChange(); - - setSelection(std::nullopt); - m_ignoreScroll = false; -} - -QRect TerminalWidget::gridToViewport(QRect rect) const -{ - int offset = verticalScrollBar()->value(); - - int startRow = rect.y() - offset; - int numRows = rect.height(); - int numCols = rect.width(); - - QRectF r{rect.x() * m_cellSize.width(), - startRow * m_cellSize.height(), - numCols * m_cellSize.width(), - numRows * m_cellSize.height()}; - - r.translate(0, topMargin()); - - return r.toAlignedRect(); -} - -void TerminalWidget::updateViewport() -{ - viewport()->update(); -} - -void TerminalWidget::updateViewportRect(const QRect &rect) -{ - viewport()->update(rect); -} - -void TerminalWidget::wheelEvent(QWheelEvent *event) -{ - verticalScrollBar()->event(event); - - if (!settings().enableMouseTracking()) - return; - - if (event->angleDelta().ry() > 0) - m_surface->mouseButton(Qt::ExtraButton1, true, event->modifiers()); - else if (event->angleDelta().ry() < 0) - m_surface->mouseButton(Qt::ExtraButton2, true, event->modifiers()); -} - -void TerminalWidget::focusInEvent(QFocusEvent *) -{ - updateViewport(); - configBlinkTimer(); + TerminalView::focusInEvent(event); updateCopyState(); } -void TerminalWidget::focusOutEvent(QFocusEvent *) + +void TerminalWidget::contextMenuRequested(const QPoint &pos) { - updateViewport(); - configBlinkTimer(); -} - -void TerminalWidget::inputMethodEvent(QInputMethodEvent *event) -{ - m_preEditString = event->preeditString(); - - if (event->commitString().isEmpty()) { - updateViewport(); - return; - } - - m_surface->sendKey(event->commitString()); -} - -QPoint TerminalWidget::toGridPos(QMouseEvent *event) const -{ - return globalToGrid(event->pos().toPointF() + QPointF(0, -topMargin() + 0.5)); -} - -void TerminalWidget::mousePressEvent(QMouseEvent *event) -{ - if (settings().enableMouseTracking()) { - m_surface->mouseMove(toGridPos(event), event->modifiers()); - m_surface->mouseButton(event->button(), true, event->modifiers()); - } - - m_scrollDirection = 0; - - m_activeMouseSelect.start = viewportToGlobal(event->pos()); - - if (event->button() == Qt::LeftButton && event->modifiers() & Qt::ControlModifier) { - if (m_linkSelection) { - if (event->modifiers() & Qt::ShiftModifier) { - copyLinkToClipboard(); - return; - } - - if (m_linkSelection->link.targetFilePath.scheme().toString().startsWith("http")) { - QDesktopServices::openUrl(m_linkSelection->link.targetFilePath.toUrl()); - return; - } - - if (m_linkSelection->link.targetFilePath.isDir()) - Core::FileUtils::showInFileSystemView(m_linkSelection->link.targetFilePath); - else - EditorManager::openEditorAt(m_linkSelection->link); - } - return; - } - - if (event->button() == Qt::LeftButton) { - if (std::chrono::system_clock::now() - m_lastDoubleClick < 500ms) { - m_selectLineMode = true; - const Selection newSelection{m_surface->gridToPos( - {0, m_surface->posToGrid(m_selection->start).y()}), - m_surface->gridToPos( - {m_surface->liveSize().width(), - m_surface->posToGrid(m_selection->end).y()}), - false}; - setSelection(newSelection); - } else { - m_selectLineMode = false; - int pos = m_surface->gridToPos(globalToGrid(viewportToGlobal(event->pos()))); - setSelection(Selection{pos, pos, false}); - } - event->accept(); - updateViewport(); - } else if (event->button() == Qt::RightButton) { - if (event->modifiers() & Qt::ShiftModifier) { - QMenu *contextMenu = new QMenu(this); - QAction *configureAction = new QAction(contextMenu); - configureAction->setText(Tr::tr("Configure...")); - connect(configureAction, &QAction::triggered, this, [] { - ICore::showOptionsDialog("Terminal.General"); - }); - - contextMenu->addAction(ActionManager::command(Constants::COPY)->action()); - contextMenu->addAction(ActionManager::command(Constants::PASTE)->action()); - contextMenu->addSeparator(); - contextMenu->addAction(ActionManager::command(Constants::CLEAR_TERMINAL)->action()); - contextMenu->addSeparator(); - contextMenu->addAction(configureAction); - - contextMenu->popup(event->globalPosition().toPoint()); - } else if (m_selection) { - copyToClipboard(); - setSelection(std::nullopt); - } else { - pasteFromClipboard(); - } - } else if (event->button() == Qt::MiddleButton) { - QClipboard *clipboard = QApplication::clipboard(); - if (clipboard->supportsSelection()) { - const QString selectionText = clipboard->text(QClipboard::Selection); - if (!selectionText.isEmpty()) - m_surface->pasteFromClipboard(selectionText); - } else { - m_surface->pasteFromClipboard(textFromSelection()); - } - } -} - -void TerminalWidget::mouseMoveEvent(QMouseEvent *event) -{ - if (settings().enableMouseTracking()) - m_surface->mouseMove(toGridPos(event), event->modifiers()); - - if (m_selection && event->buttons() & Qt::LeftButton) { - Selection newSelection = *m_selection; - int scrollVelocity = 0; - if (event->pos().y() < 0) { - scrollVelocity = (event->pos().y()); - } else if (event->pos().y() > viewport()->height()) { - scrollVelocity = (event->pos().y() - viewport()->height()); - } - - if ((scrollVelocity != 0) != m_scrollTimer.isActive()) { - if (scrollVelocity != 0) - m_scrollTimer.start(); - else - m_scrollTimer.stop(); - } - - m_scrollDirection = scrollVelocity; - - if (m_scrollTimer.isActive() && scrollVelocity != 0) { - const std::chrono::milliseconds scrollInterval = 1000ms / qAbs(scrollVelocity); - if (m_scrollTimer.intervalAsDuration() != scrollInterval) - m_scrollTimer.setInterval(scrollInterval); - } - - QPoint posBoundedToViewport = event->pos(); - posBoundedToViewport.setX(qBound(0, posBoundedToViewport.x(), viewport()->width())); - - int start = m_surface->gridToPos(globalToGrid(m_activeMouseSelect.start)); - int newEnd = m_surface->gridToPos(globalToGrid(viewportToGlobal(posBoundedToViewport))); - - if (start > newEnd) { - std::swap(start, newEnd); - } - if (start < 0) - start = 0; - - if (m_selectLineMode) { - newSelection.start = m_surface->gridToPos({0, m_surface->posToGrid(start).y()}); - newSelection.end = m_surface->gridToPos( - {m_surface->liveSize().width(), m_surface->posToGrid(newEnd).y()}); - } else { - newSelection.start = start; - newSelection.end = newEnd; - } - - setSelection(newSelection); - } else if (event->modifiers() & Qt::ControlModifier) { - checkLinkAt(event->pos()); - } else if (m_linkSelection) { - m_linkSelection.reset(); - updateCopyState(); - updateViewport(); - } - - if (m_linkSelection) { - setCursor(Qt::PointingHandCursor); - } else { - setCursor(Qt::IBeamCursor); - } -} - -bool TerminalWidget::checkLinkAt(const QPoint &pos) -{ - const TextAndOffsets hit = textAt(pos); - - if (hit.text.size() > 0) { - QString t = QString::fromUcs4(hit.text.c_str(), hit.text.size()).trimmed(); - t = chopIfEndsWith(t, ':'); - - if (!t.isEmpty()) { - if (t.startsWith("~/")) - t = QDir::homePath() + t.mid(1); - - Link link = Link::fromString(t, true); - - if (!link.targetFilePath.isEmpty() && !link.targetFilePath.isAbsolutePath()) - link.targetFilePath = m_cwd.pathAppended(link.targetFilePath.path()); - - if (link.hasValidTarget() - && (link.targetFilePath.scheme().toString().startsWith("http") - || link.targetFilePath.exists())) { - const LinkSelection newSelection = LinkSelection{{hit.start, hit.end}, link}; - if (!m_linkSelection || *m_linkSelection != newSelection) { - m_linkSelection = newSelection; - updateViewport(); - updateCopyState(); - } - return true; - } - } - } - - if (m_linkSelection) { - m_linkSelection.reset(); - updateCopyState(); - updateViewport(); - } - return false; -} - -void TerminalWidget::mouseReleaseEvent(QMouseEvent *event) -{ - if (settings().enableMouseTracking()) { - m_surface->mouseMove(toGridPos(event), event->modifiers()); - m_surface->mouseButton(event->button(), false, event->modifiers()); - } - - m_scrollTimer.stop(); - - if (m_selection && event->button() == Qt::LeftButton) { - if (m_selection->end - m_selection->start == 0) - setSelection(std::nullopt); - else - setSelection(Selection{m_selection->start, m_selection->end, true}); - } -} - -TerminalWidget::TextAndOffsets TerminalWidget::textAt(const QPoint &pos) const -{ - auto it = m_surface->iteratorAt(globalToGrid(viewportToGlobal(pos))); - auto itRev = m_surface->rIteratorAt(globalToGrid(viewportToGlobal(pos))); - - std::u32string whiteSpaces = U" \t\x00a0"; - - const bool inverted = whiteSpaces.find(*it) != std::u32string::npos || *it == 0; - - auto predicate = [inverted, whiteSpaces](const std::u32string::value_type &ch) { - if (inverted) - return ch != 0 && whiteSpaces.find(ch) == std::u32string::npos; - else - return ch == 0 || whiteSpaces.find(ch) != std::u32string::npos; - }; - - auto itRight = std::find_if(it, m_surface->end(), predicate); - auto itLeft = std::find_if(itRev, m_surface->rend(), predicate); - - std::u32string text; - std::copy(itLeft.base(), it, std::back_inserter(text)); - std::copy(it, itRight, std::back_inserter(text)); - std::transform(text.begin(), text.end(), text.begin(), [](const char32_t &ch) { - return ch == 0 ? U' ' : ch; + QMenu *contextMenu = new QMenu(this); + QAction *configureAction = new QAction(contextMenu); + configureAction->setText(Tr::tr("Configure...")); + connect(configureAction, &QAction::triggered, this, [] { + ICore::showOptionsDialog("Terminal.General"); }); - return {(itLeft.base()).position(), itRight.position(), text}; -} + contextMenu->addAction(ActionManager::command(Constants::COPY)->action()); + contextMenu->addAction(ActionManager::command(Constants::PASTE)->action()); + contextMenu->addSeparator(); + contextMenu->addAction(ActionManager::command(Constants::CLEAR_TERMINAL)->action()); + contextMenu->addSeparator(); + contextMenu->addAction(configureAction); -void TerminalWidget::mouseDoubleClickEvent(QMouseEvent *event) -{ - if (settings().enableMouseTracking()) { - m_surface->mouseMove(toGridPos(event), event->modifiers()); - m_surface->mouseButton(event->button(), true, event->modifiers()); - m_surface->mouseButton(event->button(), false, event->modifiers()); - } - - const auto hit = textAt(event->pos()); - - setSelection(Selection{hit.start, hit.end, true}); - - m_lastDoubleClick = std::chrono::system_clock::now(); - - event->accept(); + contextMenu->popup(mapToGlobal(pos)); } void TerminalWidget::dragEnterEvent(QDragEnterEvent *event) @@ -1596,38 +509,65 @@ void TerminalWidget::showEvent(QShowEvent *event) if (!m_process) setupPty(); - QAbstractScrollArea::showEvent(event); + TerminalView::showEvent(event); +} + +void TerminalWidget::handleEscKey(QKeyEvent *event) +{ + bool sendToTerminal = settings().sendEscapeToTerminal(); + bool send = false; + if (sendToTerminal && event->modifiers() == Qt::NoModifier) + send = true; + else if (!sendToTerminal && event->modifiers() == Qt::ShiftModifier) + send = true; + + if (send) { + event->setModifiers(Qt::NoModifier); + TerminalView::keyPressEvent(event); + return; + } + + if (selection()) { + clearSelection(); + } else { + QAction *returnAction = ActionManager::command(Core::Constants::S_RETURNTOEDITOR) + ->actionForContext(Core::Constants::C_GLOBAL); + QTC_ASSERT(returnAction, return); + returnAction->trigger(); + } } bool TerminalWidget::event(QEvent *event) { - if (settings().lockKeyboard() && event->type() == QEvent::ShortcutOverride) { - event->accept(); - return true; - } + if (event->type() == QEvent::ShortcutOverride) { + auto keyEvent = static_cast<QKeyEvent *>(event); + if (keyEvent->key() == Qt::Key_Escape && keyEvent->modifiers() == Qt::NoModifier + && settings().sendEscapeToTerminal()) { + event->accept(); + return true; + } - if (event->type() == QEvent::Paint) { - QPainter p(this); - p.fillRect(QRect(QPoint(0, 0), size()), m_currentColors[ColorIndex::Background]); - return true; + if (settings().lockKeyboard()) { + event->accept(); + return true; + } } if (event->type() == QEvent::KeyPress) { auto k = static_cast<QKeyEvent *>(event); + if (k->key() == Qt::Key_Escape) { + handleEscKey(k); + return true; + } + if (settings().lockKeyboard() && m_shortcutMap.tryShortcut(k)) return true; keyPressEvent(k); return true; } - if (event->type() == QEvent::KeyRelease) { - auto k = static_cast<QKeyEvent *>(event); - keyReleaseEvent(k); - return true; - } - - return QAbstractScrollArea::event(event); + return TerminalView::event(event); } void TerminalWidget::initActions() diff --git a/src/plugins/terminal/terminalwidget.h b/src/plugins/terminal/terminalwidget.h index 2801ea4fc16..4b54562cc6c 100644 --- a/src/plugins/terminal/terminalwidget.h +++ b/src/plugins/terminal/terminalwidget.h @@ -3,83 +3,36 @@ #pragma once +#include "shellintegration.h" #include "shortcutmap.h" #include "terminalsearch.h" -#include "terminalsurface.h" + +#include <solutions/terminal/terminalview.h> #include <aggregation/aggregate.h> -#include <coreplugin/icontext.h> #include <coreplugin/actionmanager/command.h> +#include <coreplugin/icontext.h> #include <utils/link.h> #include <utils/process.h> #include <utils/terminalhooks.h> -#include <QAbstractScrollArea> -#include <QAction> -#include <QTextLayout> -#include <QTimer> - -#include <chrono> -#include <memory> - namespace Terminal { using RegisteredAction = std::unique_ptr<QAction, std::function<void(QAction *)>>; -class TerminalWidget : public QAbstractScrollArea +class TerminalWidget : public TerminalSolution::TerminalView { - friend class CellIterator; Q_OBJECT public: TerminalWidget(QWidget *parent = nullptr, const Utils::Terminal::OpenTerminalParameters &openParameters = {}); - void setFont(const QFont &font); - - void copyToClipboard(); - void pasteFromClipboard(); - void copyLinkToClipboard(); - - void clearSelection(); - - void zoomIn(); - void zoomOut(); - - void moveCursorWordLeft(); - void moveCursorWordRight(); - - void clearContents(); - void closeTerminal(); TerminalSearch *search() { return m_search.get(); } - struct Selection - { - int start; - int end; - bool final{false}; - - bool operator!=(const Selection &other) const - { - return start != other.start || end != other.end || final != other.final; - } - - bool operator==(const Selection &other) const { return !operator!=(other); } - }; - - struct LinkSelection : public Selection - { - Utils::Link link; - - bool operator!=(const LinkSelection &other) const - { - return link != other.link || Selection::operator!=(other); - } - }; - void setShellName(const QString &shellName); QString shellName() const; QString title() const; @@ -102,142 +55,52 @@ signals: void titleChanged(); protected: - void paintEvent(QPaintEvent *event) override; - void keyPressEvent(QKeyEvent *event) override; - void keyReleaseEvent(QKeyEvent *event) override; - void resizeEvent(QResizeEvent *event) override; - void wheelEvent(QWheelEvent *event) override; - void focusInEvent(QFocusEvent *event) override; - void focusOutEvent(QFocusEvent *event) override; - void inputMethodEvent(QInputMethodEvent *event) override; - - void mousePressEvent(QMouseEvent *event) override; - void mouseMoveEvent(QMouseEvent *event) override; - void mouseReleaseEvent(QMouseEvent *event) override; - void mouseDoubleClickEvent(QMouseEvent *event) override; - void dragEnterEvent(QDragEnterEvent *event) override; void dropEvent(QDropEvent *event) override; - void showEvent(QShowEvent *event) override; - + void focusInEvent(QFocusEvent *event) override; bool event(QEvent *event) override; -protected: void onReadyRead(bool forceFlush); - void setupSurface(); void setupFont(); void setupPty(); void setupColors(); void setupActions(); - void writeToPty(const QByteArray &data); + void handleEscKey(QKeyEvent *event); - int paintCell(QPainter &p, - const QRectF &cellRect, - QPoint gridPos, - const Internal::TerminalCell &cell, - QFont &f, - QList<SearchHit>::const_iterator &searchIt) const; - void paintCells(QPainter &painter, QPaintEvent *event) const; - void paintCursor(QPainter &painter) const; - void paintPreedit(QPainter &painter) const; - bool paintFindMatches(QPainter &painter, - QList<SearchHit>::const_iterator &searchIt, - const QRectF &cellRect, - const QPoint gridPos) const; - bool paintSelection(QPainter &painter, const QRectF &cellRect, const QPoint gridPos) const; - void paintDebugSelection(QPainter &painter, const Selection &selection) const; + void surfaceChanged() override; - qreal topMargin() const; + void selectionChanged(const std::optional<Selection> &newSelection) override; + void linkActivated(const Link &link) override; + void contextMenuRequested(const QPoint &pos) override; - QPoint viewportToGlobal(QPoint p) const; - QPoint globalToViewport(QPoint p) const; - QPoint globalToGrid(QPointF p) const; - QPointF gridToGlobal(QPoint p, bool bottom = false, bool right = false) const; - QRect gridToViewport(QRect rect) const; - QPoint toGridPos(QMouseEvent *event) const; + void writeToPty(const QByteArray &data) override; + void resizePty(QSize newSize) override; + void setClipboard(const QString &text) override; + std::optional<TerminalView::Link> toLink(const QString &text) override; - void updateViewport(); - void updateViewportRect(const QRect &rect); - - int textLineFromPixel(int y) const; - std::optional<int> textPosFromPoint(const QTextLayout &textLayout, QPoint p) const; - - std::optional<QTextLayout::FormatRange> selectionToFormatRange( - TerminalWidget::Selection selection, const QTextLayout &layout, int rowOffset) const; - - bool checkLinkAt(const QPoint &pos); - - struct TextAndOffsets - { - int start; - int end; - std::u32string text; - }; - - TextAndOffsets textAt(const QPoint &pos) const; - - void applySizeChange(); - void updateScrollBars(); - - void flushVTerm(bool force); - - bool setSelection(const std::optional<Selection> &selection, bool scroll = true); - QString textFromSelection() const; - - void configBlinkTimer(); - - QColor toQColor(std::variant<int, QColor> color) const; - - void updateCopyState(); + const QList<TerminalSolution::SearchHit> &searchHits() const override; RegisteredAction registerAction(Utils::Id commandId, const Core::Context &context); void registerShortcut(Core::Command *command); + void updateCopyState(); + private: Core::Context m_context; std::unique_ptr<Utils::Process> m_process; - std::unique_ptr<Internal::TerminalSurface> m_surface; std::unique_ptr<ShellIntegration> m_shellIntegration; QString m_shellName; - Utils::Id m_identifier; - - QFont m_font; - QSizeF m_cellSize; - - bool m_ignoreScroll{false}; - - QString m_preEditString; QString m_title; - std::optional<Selection> m_selection; - std::optional<LinkSelection> m_linkSelection; + TerminalSolution::SearchHit m_lastSelectedHit{}; - struct - { - QPoint start; - QPoint end; - } m_activeMouseSelect; - - QTimer m_flushDelayTimer; - - QTimer m_scrollTimer; - int m_scrollDirection{0}; - - std::array<QColor, 20> m_currentColors; + Utils::Id m_identifier; Utils::Terminal::OpenTerminalParameters m_openParameters; - std::chrono::system_clock::time_point m_lastFlush; - std::chrono::system_clock::time_point m_lastDoubleClick; - bool m_selectLineMode{false}; - - Internal::Cursor m_cursor; - QTimer m_cursorBlinkTimer; - bool m_cursorBlinkState{true}; - Utils::FilePath m_cwd; Utils::CommandLine m_currentCommand; @@ -245,7 +108,6 @@ private: TerminalSearchPtr m_search; Aggregation::Aggregate *m_aggregate{nullptr}; - SearchHit m_lastSelectedHit{}; RegisteredAction m_copy; RegisteredAction m_paste; diff --git a/src/plugins/terminal/tests/mouse b/src/plugins/terminal/tests/mouse new file mode 100755 index 00000000000..3134454bb38 --- /dev/null +++ b/src/plugins/terminal/tests/mouse @@ -0,0 +1,67 @@ +#!/bin/sh + + +function cleanup { + stty -echo + printf "\e[?1006;1000l" +} + +trap cleanup EXIT + +stty -echo + +# Enable SGR protocol and button press and release events +printf "\e[?1006;1000h" + +while read -n 1 line +do + printf -v ch "%d" \'$line + if [ "27" != "$ch" ]; then + continue + fi + read -n 1 line + if [ "[" != "$line" ]; then + continue + fi + read -n 1 line + if [ "<" != "$line" ]; then + continue + fi + # Read button state + modifier= + while read -n 1 line + do + if [ ";" = "$line" ]; then + # End + break + fi + printf -v modifier "$modifier$line" + done + # Read column + col= + while read -n 1 line + do + if [ ";" = "$line" ]; then + # End + break + fi + printf -v col "$col$line" + done + # Read row + row= + while read -n 1 line + do + if [ "M" = "$line" ] || [ "m" = "$line" ]; then + # End + btn=$line + break + fi + printf -v row "$row$line" + done + if [ "M" = "$btn" ]; then + echo "You pressed at $col x $row (mods: $modifier)" + else + echo "You released at $col x $row (mods: $modifier)" + fi +done < "${1:-/dev/stdin}" + From 77cee300f69bcf22c73a76b79f17dee8d6001a94 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 17 Jul 2023 14:25:34 +0200 Subject: [PATCH 0520/1777] BuildStep: Some cleanup Remove unused BuildStep API. Remove outdated docs. Cleanup includes. Don't repeat custom cancel messages from build/deploy steps, as in case of cancel action the follow-up message: "Canceled build/deployment." always appears anyway. Change-Id: I50b31e0cc688ee66d76a3a1dbe58eb72702112ad Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/android/androiddeployqtstep.cpp | 3 - src/plugins/ios/iosdeploystep.cpp | 2 - .../nim/project/nimcompilercleanstep.cpp | 2 - .../projectexplorer/abstractprocessstep.cpp | 3 - src/plugins/projectexplorer/buildstep.cpp | 85 +------------------ src/plugins/projectexplorer/buildstep.h | 33 ++----- src/plugins/projectexplorer/copystep.cpp | 2 - .../devicesupport/devicecheckbuildstep.cpp | 3 - .../qbsprojectmanager/qbsbuildstep.cpp | 3 - .../qbsprojectmanager/qbscleanstep.cpp | 2 - .../qbsprojectmanager/qbsinstallstep.cpp | 2 - .../abstractremotelinuxdeploystep.cpp | 3 - 12 files changed, 9 insertions(+), 134 deletions(-) diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index c75b14bf362..e91687f6db7 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -159,9 +159,6 @@ AndroidDeployQtStep::AndroidDeployQtStep(BuildStepList *parent, Id id) bool AndroidDeployQtStep::init() { - if (!BuildStep::init()) - return false; - QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit()); if (!version) { reportWarningOrError(Tr::tr("The Qt version for kit %1 is invalid.").arg(kit()->displayName()), diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index b218af2284d..3e86d9ec860 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -148,8 +148,6 @@ void IosDeployStep::updateDisplayNames() bool IosDeployStep::init() { - if (!BuildStep::init()) - return false; m_device = DeviceKitAspect::device(kit()); auto runConfig = qobject_cast<const IosRunConfiguration *>( this->target()->activeRunConfiguration()); diff --git a/src/plugins/nim/project/nimcompilercleanstep.cpp b/src/plugins/nim/project/nimcompilercleanstep.cpp index e8b523e7a5a..edfe1b370cb 100644 --- a/src/plugins/nim/project/nimcompilercleanstep.cpp +++ b/src/plugins/nim/project/nimcompilercleanstep.cpp @@ -50,8 +50,6 @@ private: bool NimCompilerCleanStep::init() { - if (!BuildStep::init()) - return false; const FilePath buildDir = buildDirectory(); const bool exists = buildDir.exists(); if (exists) diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 550ecff2812..c5516d5dc5b 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -143,9 +143,6 @@ void AbstractProcessStep::setWorkingDirectoryProvider(const std::function<FilePa bool AbstractProcessStep::init() { - if (!BuildStep::init()) - return false; - if (!setupProcessParameters(processParameters())) return false; diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 2086b7a2eba..61d26fe9632 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -10,17 +10,12 @@ #include "kitinformation.h" #include "project.h" #include "projectexplorerconstants.h" -#include "projectexplorertr.h" #include "sanitizerparser.h" #include "target.h" -#include <solutions/tasking/tasktree.h> - -#include <utils/algorithm.h> #include <utils/fileinprojectfinder.h> #include <utils/layoutbuilder.h> #include <utils/outputformatter.h> -#include <utils/qtcassert.h> #include <utils/variablechooser.h> /*! @@ -41,9 +36,6 @@ \c init() is called in the GUI thread and can be used to query the project for any information you need. - - \c run() is run via Utils::asyncRun in a separate thread. If you need an - event loop, you need to create it yourself. */ /*! @@ -53,26 +45,6 @@ that you need in the run() function. */ -/*! - \fn void ProjectExplorer::BuildStep::run(QFutureInterface<bool> &fi) - - Reimplement this function. It is called when the target is built. - By default, this function is NOT run in the GUI thread, but runs in its - own thread. If you need an event loop, you need to create one. - This function should block until the task is done - - The absolute minimal implementation is: - \code - fi.reportResult(true); - \endcode - - By returning \c true from runInGuiThread(), this function is called in - the GUI thread. Then the function should not block and instead the - finished() signal should be emitted. - - \sa runInGuiThread() -*/ - /*! \fn BuildStepConfigWidget *ProjectExplorer::BuildStep::createConfigWidget() @@ -93,11 +65,6 @@ It should be in plain text, with the format in the parameter. */ -/*! - \fn void ProjectExplorer::BuildStep::finished() - This signal needs to be emitted if the build step runs in the GUI thread. -*/ - /*! \fn bool ProjectExplorer::BuildStep::isImmutable() @@ -106,7 +73,6 @@ immutable steps are run. The default implementation returns \c false. */ -using namespace Tasking; using namespace Utils; static const char buildStepEnabledKey[] = "ProjectExplorer.BuildStep.Enabled"; @@ -118,52 +84,8 @@ static QList<BuildStepFactory *> g_buildStepFactories; BuildStep::BuildStep(BuildStepList *bsl, Id id) : ProjectConfiguration(bsl, bsl->target(), id) , m_stepList(bsl) - , m_cancelMessage(Tr::tr("The build step was ended forcefully.")) { - connect(this, &ProjectConfiguration::displayNameChanged, - this, &BuildStep::updateSummary); -// m_displayName = step->displayName(); -// m_summaryText = "<b>" + m_displayName + "</b>"; -} - -BuildStep::~BuildStep() -{ - emit finished(false); -} - -bool BuildStep::init() -{ - return !m_taskTree; -} - -void BuildStep::run() -{ - QTC_ASSERT(!m_taskTree, return); - - m_taskTree.reset(new TaskTree({runRecipe()})); - connect(m_taskTree.get(), &TaskTree::progressValueChanged, this, [this](int value) { - emit progress(qRound(double(value) * 100 / std::max(m_taskTree->progressMaximum(), 1)), {}); - }); - connect(m_taskTree.get(), &TaskTree::done, this, [this] { - emit finished(true); - m_taskTree.release()->deleteLater(); - }); - connect(m_taskTree.get(), &TaskTree::errorOccurred, this, [this] { - emit finished(false); - m_taskTree.release()->deleteLater(); - }); - m_taskTree->start(); -} - -void BuildStep::cancel() -{ - if (!m_taskTree) - return; - - m_taskTree.reset(); - if (!m_cancelMessage.isEmpty()) - emit addOutput(m_cancelMessage, OutputFormat::ErrorMessage); - emit finished(false); + connect(this, &ProjectConfiguration::displayNameChanged, this, &BuildStep::updateSummary); } QWidget *BuildStep::doCreateConfigWidget() @@ -319,11 +241,6 @@ QVariant BuildStep::data(Id id) const return {}; } -void BuildStep::setCancelMessage(const QString &message) -{ - m_cancelMessage = message; -} - void BuildStep::addMacroExpander() { m_addMacroExpander = true; diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index c22579f75fe..c5c82978223 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -3,35 +3,25 @@ #pragma once -#include "projectconfiguration.h" +#include "projectexplorer_export.h" #include "buildconfiguration.h" -#include "projectexplorer_export.h" +#include "projectconfiguration.h" #include <utils/qtcassert.h> -#include <QWidget> - -#include <atomic> #include <functional> -#include <memory> #include <optional> namespace Utils { -class Environment; -class FilePath; class MacroExpander; class OutputFormatter; } // Utils -namespace Tasking { -class GroupItem; -class TaskTree; -} +namespace Tasking { class GroupItem; } namespace ProjectExplorer { -class BuildConfiguration; class BuildStepFactory; class BuildStepList; class BuildSystem; @@ -48,10 +38,7 @@ protected: explicit BuildStep(BuildStepList *bsl, Utils::Id id); public: - ~BuildStep() override; - virtual bool init(); - void run(); - void cancel(); + virtual bool init() = 0; void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; @@ -98,7 +85,7 @@ public: void setImmutable(bool immutable) { m_immutable = immutable; } virtual QVariant data(Utils::Id id) const; - void setSummaryUpdater(const std::function<QString ()> &summaryUpdater); + void setSummaryUpdater(const std::function<QString()> &summaryUpdater); void addMacroExpander(); @@ -114,20 +101,18 @@ signals: /// Do note that for linking compile output with tasks, you should first emit the output /// and then emit the task. \p linkedOutput lines will be linked. And the last \p skipLines will /// be skipped. - void addTask(const ProjectExplorer::Task &task, int linkedOutputLines = 0, int skipLines = 0); + void addTask(const Task &task, int linkedOutputLines = 0, int skipLines = 0); /// Adds \p string to the compile output view, formatted in \p format - void addOutput(const QString &string, ProjectExplorer::BuildStep::OutputFormat format, - ProjectExplorer::BuildStep::OutputNewlineSetting newlineSetting = DoAppendNewline); + void addOutput(const QString &string, OutputFormat format, + OutputNewlineSetting newlineSetting = DoAppendNewline); void enabledChanged(); void progress(int percentage, const QString &message); - void finished(bool result); protected: virtual QWidget *createConfigWidget(); - void setCancelMessage(const QString &message); private: friend class BuildManager; @@ -140,10 +125,8 @@ private: bool m_addMacroExpander = false; std::optional<bool> m_wasExpanded; std::function<QString()> m_summaryUpdater; - std::unique_ptr<Tasking::TaskTree> m_taskTree; QString m_summaryText; - QString m_cancelMessage; }; class PROJECTEXPLORER_EXPORT BuildStepFactory diff --git a/src/plugins/projectexplorer/copystep.cpp b/src/plugins/projectexplorer/copystep.cpp index 0d5c012016d..98cd5df3f17 100644 --- a/src/plugins/projectexplorer/copystep.cpp +++ b/src/plugins/projectexplorer/copystep.cpp @@ -35,8 +35,6 @@ public: protected: bool init() final { - if (!BuildStep::init()) - return false; m_source = m_sourceAspect(); m_target = m_targetAspect(); return m_source.exists(); diff --git a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp index 00b9527b417..9ccf0662d07 100644 --- a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp @@ -27,9 +27,6 @@ public: bool init() override { - if (!BuildStep::init()) - return false; - IDevice::ConstPtr device = DeviceKitAspect::device(kit()); if (device) return true; diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 3cae842280a..17e76c85e7b 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -273,9 +273,6 @@ QbsBuildStep::QbsBuildStep(BuildStepList *bsl, Id id) : bool QbsBuildStep::init() { - if (!BuildStep::init()) - return false; - auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration()); if (!bc) diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.cpp b/src/plugins/qbsprojectmanager/qbscleanstep.cpp index 475d38e9478..e3de616166e 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.cpp +++ b/src/plugins/qbsprojectmanager/qbscleanstep.cpp @@ -52,8 +52,6 @@ QbsCleanStep::QbsCleanStep(BuildStepList *bsl, Id id) bool QbsCleanStep::init() { - if (!BuildStep::init()) - return false; if (buildSystem()->isParsing()) return false; const auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration()); diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp index 0797f4cbca0..59baaf6e38e 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp @@ -50,8 +50,6 @@ QbsInstallStep::QbsInstallStep(BuildStepList *bsl, Id id) bool QbsInstallStep::init() { - if (!BuildStep::init()) - return false; QTC_ASSERT(!target()->buildSystem()->isParsing(), return false); return true; } diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index b9ebcf71246..a8f3d31d1e9 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -38,7 +38,6 @@ using namespace Internal; AbstractRemoteLinuxDeployStep::AbstractRemoteLinuxDeployStep(BuildStepList *bsl, Id id) : BuildStep(bsl, id), d(new AbstractRemoteLinuxDeployStepPrivate) { - setCancelMessage(Tr::tr("User requests deployment to stop; cleaning up.")); } AbstractRemoteLinuxDeployStep::~AbstractRemoteLinuxDeployStep() @@ -99,8 +98,6 @@ void AbstractRemoteLinuxDeployStep::toMap(QVariantMap &map) const bool AbstractRemoteLinuxDeployStep::init() { QTC_ASSERT(d->internalInit, return false); - if (!BuildStep::init()) - return false; const auto canDeploy = d->internalInit(); if (!canDeploy) { emit addOutput(Tr::tr("Cannot deploy: %1").arg(canDeploy.error()), From 31cf0dfb74db072c7c39e4d119d1e7e6e3fe5326 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 25 Jul 2023 19:44:40 +0200 Subject: [PATCH 0521/1777] BuildStep: Hide some API in protected / private sections Change-Id: I3345afa871bbb900beb739b2a283145392262658 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/buildstep.cpp | 5 ---- src/plugins/projectexplorer/buildstep.h | 31 ++++++++++------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 61d26fe9632..8844a34604b 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -241,11 +241,6 @@ QVariant BuildStep::data(Id id) const return {}; } -void BuildStep::addMacroExpander() -{ - m_addMacroExpander = true; -} - void BuildStep::setEnabled(bool b) { if (m_enabled == b) diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index c5c82978223..8c37ff3ecde 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -49,17 +49,10 @@ public: BuildStepList *stepList() const; BuildConfiguration *buildConfiguration() const; - DeployConfiguration *deployConfiguration() const; - ProjectConfiguration *projectConfiguration() const; BuildSystem *buildSystem() const; - Utils::Environment buildEnvironment() const; - Utils::FilePath buildDirectory() const; BuildConfiguration::BuildType buildType() const; Utils::MacroExpander *macroExpander() const; - QString fallbackWorkingDirectory() const; - - virtual void setupOutputFormatter(Utils::OutputFormatter *formatter); enum class OutputFormat { Stdout, Stderr, // These are for forwarded output from external tools @@ -75,23 +68,12 @@ public: }; bool widgetExpandedByDefault() const; - void setWidgetExpandedByDefault(bool widgetExpandedByDefault); - bool hasUserExpansionState() const { return m_wasExpanded.has_value(); } bool wasUserExpanded() const { return m_wasExpanded.value_or(false); } void setUserExpanded(bool expanded) { m_wasExpanded = expanded; } - bool isImmutable() const { return m_immutable; } - void setImmutable(bool immutable) { m_immutable = immutable; } - virtual QVariant data(Utils::Id id) const; - void setSummaryUpdater(const std::function<QString()> &summaryUpdater); - - void addMacroExpander(); - QString summaryText() const; - void setSummaryText(const QString &summaryText); - QWidget *doCreateConfigWidget(); signals: @@ -112,11 +94,24 @@ signals: void progress(int percentage, const QString &message); protected: + void setWidgetExpandedByDefault(bool widgetExpandedByDefault); + void setImmutable(bool immutable) { m_immutable = immutable; } + void setSummaryUpdater(const std::function<QString()> &summaryUpdater); + void addMacroExpander() { m_addMacroExpander = true; } + void setSummaryText(const QString &summaryText); + + DeployConfiguration *deployConfiguration() const; + Utils::Environment buildEnvironment() const; + Utils::FilePath buildDirectory() const; + QString fallbackWorkingDirectory() const; + virtual QWidget *createConfigWidget(); + virtual void setupOutputFormatter(Utils::OutputFormatter *formatter); private: friend class BuildManager; virtual Tasking::GroupItem runRecipe() = 0; + ProjectConfiguration *projectConfiguration() const; BuildStepList * const m_stepList; bool m_enabled = true; From c326f049dc845f435520ca873b7f9c5c4ac7a495 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 14:41:41 +0200 Subject: [PATCH 0522/1777] CMake: Prepare postponing formatter settings creation This is still an overall quirky setup. Change-Id: I7c1d22267bb76d434fe2f9b77ed8d0bfef5ac952 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../cmakeprojectmanager/cmakeformatter.cpp | 54 ++++++++++--------- .../cmakeprojectmanager/cmakeformatter.h | 6 --- .../cmakeprojectplugin.cpp | 1 - 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeformatter.cpp b/src/plugins/cmakeprojectmanager/cmakeformatter.cpp index 8a727ba7942..9b6f88bfb46 100644 --- a/src/plugins/cmakeprojectmanager/cmakeformatter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeformatter.cpp @@ -37,19 +37,15 @@ using namespace Utils; namespace CMakeProjectManager::Internal { -class CMakeFormatterPrivate : public PagedSettings +class CMakeFormatterSettings : public AspectContainer { public: - CMakeFormatterPrivate() + CMakeFormatterSettings() { + setAutoApply(false); setSettingsGroups(Constants::CMAKEFORMATTER_SETTINGS_GROUP, Constants::CMAKEFORMATTER_GENERAL_GROUP); - setId(Constants::Settings::FORMATTER_ID); - setDisplayName(Tr::tr("Formatter")); - setDisplayCategory("CMake"); - setCategory(Constants::Settings::CATEGORY); - command.setSettingsKey("autoFormatCommand"); command.setDefaultValue("cmake-format"); command.setExpectedKind(PathChooser::ExistingCommand); @@ -109,7 +105,7 @@ public: connect(EditorManager::instance(), &EditorManager::currentEditorChanged, this, updateActions); connect(EditorManager::instance(), &EditorManager::aboutToSave, - this, &CMakeFormatterPrivate::applyIfNecessary); + this, &CMakeFormatterSettings::applyIfNecessary); readSettings(); } @@ -136,15 +132,15 @@ public: QAction formatFile{Tr::tr("Format &Current File")}; }; -bool CMakeFormatterPrivate::isApplicable(const IDocument *document) const +bool CMakeFormatterSettings::isApplicable(const IDocument *document) const { if (!document) return false; - if (autoFormatMime.value().isEmpty()) + if (autoFormatMime().isEmpty()) return true; - const QStringList allowedMimeTypes = autoFormatMime.value().split(';'); + const QStringList allowedMimeTypes = autoFormatMime().split(';'); const MimeType documentMimeType = Utils::mimeTypeForName(document->mimeType()); return anyOf(allowedMimeTypes, [&documentMimeType](const QString &mime) { @@ -152,9 +148,9 @@ bool CMakeFormatterPrivate::isApplicable(const IDocument *document) const }); } -void CMakeFormatterPrivate::applyIfNecessary(IDocument *document) const +void CMakeFormatterSettings::applyIfNecessary(IDocument *document) const { - if (!autoFormatOnSave.value()) + if (!autoFormatOnSave()) return; if (!document) @@ -164,7 +160,7 @@ void CMakeFormatterPrivate::applyIfNecessary(IDocument *document) const return; // Check if file is contained in the current project (if wished) - if (autoFormatOnlyCurrentProject.value()) { + if (autoFormatOnlyCurrentProject()) { const ProjectExplorer::Project *pro = ProjectExplorer::ProjectTree::currentProject(); if (!pro || pro->files([document](const ProjectExplorer::Node *n) { return ProjectExplorer::Project::SourceFiles(n) @@ -188,20 +184,30 @@ void CMakeFormatterPrivate::applyIfNecessary(IDocument *document) const TextEditor::formatEditor(widget, command); } -// CMakeFormatter - -CMakeFormatter::CMakeFormatter() - : d(new CMakeFormatterPrivate) -{} - -CMakeFormatter::~CMakeFormatter() +CMakeFormatterSettings &formatterSettings() { - delete d; + static CMakeFormatterSettings theSettings; + return theSettings; } -void CMakeFormatter::applyIfNecessary(IDocument *document) const +class CMakeFormatterSettingsPage final : public Core::IOptionsPage { - d->applyIfNecessary(document); +public: + CMakeFormatterSettingsPage() + { + setId(Constants::Settings::FORMATTER_ID); + setDisplayName(Tr::tr("Formatter")); + setDisplayCategory("CMake"); + setCategory(Constants::Settings::CATEGORY); + setSettingsProvider([] { return &formatterSettings(); }); + } +}; + +const CMakeFormatterSettingsPage settingsPage; + +CMakeFormatter::CMakeFormatter() +{ + formatterSettings(); } } // CMakeProjectManager::Internal diff --git a/src/plugins/cmakeprojectmanager/cmakeformatter.h b/src/plugins/cmakeprojectmanager/cmakeformatter.h index 9727c245a50..bb3ea353537 100644 --- a/src/plugins/cmakeprojectmanager/cmakeformatter.h +++ b/src/plugins/cmakeprojectmanager/cmakeformatter.h @@ -12,12 +12,6 @@ class CMakeFormatter { public: CMakeFormatter(); - ~CMakeFormatter(); - - void applyIfNecessary(Core::IDocument *document) const; - -private: - class CMakeFormatterPrivate *d = nullptr; }; } // CMakeProjectManager::Internal diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index fcccab85d94..38352126e81 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -65,7 +65,6 @@ public: CMakeKitAspect cmakeKitAspect; CMakeGeneratorKitAspect cmakeGeneratorKitAspect; CMakeConfigurationKitAspect cmakeConfigurationKitAspect; - CMakeFormatter cmakeFormatter; }; From 1e35f09251d16f3d72bac759e5c25161a6a3828a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 18 Jul 2023 13:54:51 +0200 Subject: [PATCH 0523/1777] Core: Remove PagedSettings again Turned out to create a too strict tie between settings and settings pages, we are more flexible with delaying/avoiding initialization without these. Change-Id: I948af675e29c7da34bfccd490c1c1b999923f279 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/coreplugin/dialogs/ioptionspage.cpp | 8 -------- src/plugins/coreplugin/dialogs/ioptionspage.h | 6 ------ 2 files changed, 14 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.cpp b/src/plugins/coreplugin/dialogs/ioptionspage.cpp index ffd27f85725..dc751eddc98 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.cpp +++ b/src/plugins/coreplugin/dialogs/ioptionspage.cpp @@ -314,12 +314,4 @@ const QList<IOptionsPageProvider *> IOptionsPageProvider::allOptionsPagesProvide return g_optionsPagesProviders; } -// PagedSettings - -PagedSettings::PagedSettings() -{ - setSettings(this); - setAutoApply(false); -} - } // Core diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index c8e78545e68..54617d6e602 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -120,10 +120,4 @@ protected: Utils::FilePath m_categoryIconPath; }; -class CORE_EXPORT PagedSettings : public Utils::AspectContainer, public IOptionsPage -{ -public: - PagedSettings(); -}; - } // namespace Core From 68c3103f7651605fd4cd496039354ac80574efd3 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 27 Jul 2023 14:44:44 +0200 Subject: [PATCH 0524/1777] Android: Use a more direct access to the tools' path Change-Id: I49c574144fd4d6b2edd829538c424465c1fe7f05 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/android/androidavdmanager.cpp | 7 +++---- src/plugins/android/androidconfigurations.cpp | 4 ++-- src/plugins/android/androidconfigurations.h | 3 ++- src/plugins/android/androiddevice.cpp | 2 +- src/plugins/android/androidsdkmanager.cpp | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/plugins/android/androidavdmanager.cpp b/src/plugins/android/androidavdmanager.cpp index e5568ef541f..6a296be2b9a 100644 --- a/src/plugins/android/androidavdmanager.cpp +++ b/src/plugins/android/androidavdmanager.cpp @@ -38,8 +38,7 @@ bool AndroidAvdManager::avdManagerCommand(const AndroidConfig &config, const QSt { CommandLine cmd(config.avdManagerToolPath(), args); Process proc; - Environment env = AndroidConfigurations::toolsEnvironment(config); - proc.setEnvironment(env); + proc.setEnvironment(config.toolsEnvironment()); qCDebug(avdManagerLog).noquote() << "Running AVD Manager command:" << cmd.toUserOutput(); proc.setCommand(cmd); proc.runBlocking(); @@ -87,7 +86,7 @@ static CreateAvdInfo createAvdCommand(const AndroidConfig &config, const CreateA qCDebug(avdManagerLog).noquote() << "Running AVD Manager command:" << avdManager.toUserOutput(); Process proc; proc.setProcessMode(ProcessMode::Writer); - proc.setEnvironment(AndroidConfigurations::toolsEnvironment(config)); + proc.setEnvironment(config.toolsEnvironment()); proc.setCommand(avdManager); proc.start(); if (!proc.waitForStarted()) { @@ -148,7 +147,7 @@ bool AndroidAvdManager::removeAvd(const QString &name) const qCDebug(avdManagerLog).noquote() << "Running command (removeAvd):" << command.toUserOutput(); Process proc; proc.setTimeoutS(5); - proc.setEnvironment(AndroidConfigurations::toolsEnvironment(m_config)); + proc.setEnvironment(m_config.toolsEnvironment()); proc.setCommand(command); proc.runBlocking(); return proc.result() == ProcessResult::FinishedWithSuccess; diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index 82410682c60..633d23c5e3e 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -1424,10 +1424,10 @@ void AndroidConfigurations::updateAutomaticKitList() KitManager::deregisterKit(k); } -Environment AndroidConfigurations::toolsEnvironment(const AndroidConfig &config) +Environment AndroidConfig::toolsEnvironment() const { Environment env = Environment::systemEnvironment(); - FilePath jdkLocation = config.openJDKLocation(); + FilePath jdkLocation = openJDKLocation(); if (!jdkLocation.isEmpty()) { env.set(Constants::JAVA_HOME_ENV_VAR, jdkLocation.toUserOutput()); env.prependOrSetPath(jdkLocation.pathAppended("bin")); diff --git a/src/plugins/android/androidconfigurations.h b/src/plugins/android/androidconfigurations.h index b7d86b80820..f55dbd14559 100644 --- a/src/plugins/android/androidconfigurations.h +++ b/src/plugins/android/androidconfigurations.h @@ -150,6 +150,8 @@ public: static QStringList getAbis(const QString &device); static int getSDKVersion(const QString &device); + Utils::Environment toolsEnvironment() const; + private: static QString getDeviceProperty(const QString &device, const QString &property); @@ -197,7 +199,6 @@ public: static void removeOldToolChains(); static void updateAutomaticKitList(); static bool force32bitEmulator(); - static Utils::Environment toolsEnvironment(const AndroidConfig &config); signals: void aboutToUpdate(); diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index ce2f4c11ee7..6a6ffcd5c1b 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -641,7 +641,7 @@ void AndroidDeviceManager::setupDevicesWatcher() const CommandLine command = CommandLine(m_androidConfig.adbToolPath(), {"track-devices"}); m_adbDeviceWatcherProcess->setCommand(command); m_adbDeviceWatcherProcess->setWorkingDirectory(command.executable().parentDir()); - m_adbDeviceWatcherProcess->setEnvironment(AndroidConfigurations::toolsEnvironment(m_androidConfig)); + m_adbDeviceWatcherProcess->setEnvironment(m_androidConfig.toolsEnvironment()); m_adbDeviceWatcherProcess->start(); // Setup AVD filesystem watcher to listen for changes when an avd is created/deleted, diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp index 1839f7c21c4..45dc1009dc8 100644 --- a/src/plugins/android/androidsdkmanager.cpp +++ b/src/plugins/android/androidsdkmanager.cpp @@ -94,7 +94,7 @@ static bool sdkManagerCommand(const AndroidConfig &config, const QStringList &ar << CommandLine(config.sdkManagerToolPath(), newArgs) .toUserOutput(); Process proc; - proc.setEnvironment(AndroidConfigurations::toolsEnvironment(config)); + proc.setEnvironment(config.toolsEnvironment()); proc.setTimeoutS(timeout); proc.setTimeOutMessageBoxEnabled(true); proc.setCommand({config.sdkManagerToolPath(), newArgs}); @@ -122,7 +122,7 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar .toUserOutput(); int offset = promise.future().progressValue(); Process proc; - proc.setEnvironment(AndroidConfigurations::toolsEnvironment(config)); + proc.setEnvironment(config.toolsEnvironment()); bool assertionFound = false; proc.setTimeoutS(timeout); proc.setStdOutCallback([offset, progressQuota, &proc, &assertionFound, &promise](const QString &out) { @@ -523,7 +523,7 @@ void AndroidSdkManagerPrivate::getPendingLicense(SdkCmdPromise &fi) Process licenseCommand; licenseCommand.setProcessMode(ProcessMode::Writer); - licenseCommand.setEnvironment(AndroidConfigurations::toolsEnvironment(m_config)); + licenseCommand.setEnvironment(m_config.toolsEnvironment()); bool reviewingLicenses = false; licenseCommand.setCommand(CommandLine(m_config.sdkManagerToolPath(), {"--licenses", sdkRootArg(m_config)})); licenseCommand.setUseCtrlCStub(true); From 80b23292b1b5448e237703ecbcc92cfdb84f7a1d Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 20 Jul 2023 08:34:09 +0200 Subject: [PATCH 0525/1777] Core: Add searchable terminal Change-Id: Id058fb1a97c967fc253b08edf3910f019e708b50 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/coreplugin/CMakeLists.txt | 4 +- .../terminal/searchableterminal.cpp} | 66 +++++++++++++++++-- .../terminal/searchableterminal.h} | 35 +++++++--- src/plugins/terminal/CMakeLists.txt | 1 - src/plugins/terminal/terminalwidget.cpp | 32 ++------- src/plugins/terminal/terminalwidget.h | 17 +---- 6 files changed, 96 insertions(+), 59 deletions(-) rename src/plugins/{terminal/terminalsearch.cpp => coreplugin/terminal/searchableterminal.cpp} (79%) rename src/plugins/{terminal/terminalsearch.h => coreplugin/terminal/searchableterminal.h} (69%) diff --git a/src/plugins/coreplugin/CMakeLists.txt b/src/plugins/coreplugin/CMakeLists.txt index a37b2f216ca..10b5475e5fe 100644 --- a/src/plugins/coreplugin/CMakeLists.txt +++ b/src/plugins/coreplugin/CMakeLists.txt @@ -1,5 +1,5 @@ add_qtc_plugin(Core - DEPENDS Qt::PrintSupport Qt::Qml Qt::Sql Qt::Gui Qt::GuiPrivate + DEPENDS Qt::PrintSupport Qt::Qml Qt::Sql Qt::Gui Qt::GuiPrivate TerminalLib PUBLIC_DEPENDS Aggregation ExtensionSystem Utils SOURCES actionmanager/actioncontainer.cpp @@ -285,6 +285,8 @@ add_qtc_plugin(Core statusbarmanager.h systemsettings.cpp systemsettings.h + terminal/searchableterminal.cpp + terminal/searchableterminal.h textdocument.cpp textdocument.h themechooser.cpp diff --git a/src/plugins/terminal/terminalsearch.cpp b/src/plugins/coreplugin/terminal/searchableterminal.cpp similarity index 79% rename from src/plugins/terminal/terminalsearch.cpp rename to src/plugins/coreplugin/terminal/searchableterminal.cpp index 20fa12908cb..5a98d3e57d4 100644 --- a/src/plugins/terminal/terminalsearch.cpp +++ b/src/plugins/coreplugin/terminal/searchableterminal.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "terminalsearch.h" +#include "searchableterminal.h" #include <QElapsedTimer> #include <QLoggingCategory> @@ -15,7 +15,7 @@ using namespace Utils; using namespace std::chrono_literals; -namespace Terminal { +namespace Core { constexpr std::chrono::milliseconds debounceInterval = 100ms; @@ -115,7 +115,8 @@ QList<TerminalSolution::SearchHit> TerminalSearch::search() if (it != m_surface->end()) { auto hit = TerminalSolution::SearchHit{it.position(), - static_cast<int>(it.position() + searchString.size())}; + static_cast<int>(it.position() + + searchString.size())}; if (m_findFlags.testFlag(FindFlag::FindWholeWords)) { hit.start++; hit.end--; @@ -207,8 +208,8 @@ void TerminalSearch::debouncedUpdateHits() FindFlags TerminalSearch::supportedFindFlags() const { - return FindFlag::FindCaseSensitively | FindFlag::FindBackward - | FindFlag::FindRegularExpression | FindFlag::FindWholeWords; + return FindFlag::FindCaseSensitively | FindFlag::FindBackward | FindFlag::FindRegularExpression + | FindFlag::FindWholeWords; } void TerminalSearch::resetIncrementalSearch() @@ -273,4 +274,57 @@ void TerminalSearch::highlightAll(const QString &txt, FindFlags findFlags) setSearchString(txt, findFlags); } -} // namespace Terminal +SearchableTerminal::SearchableTerminal(QWidget *parent) + : TerminalSolution::TerminalView(parent) +{ + m_aggregate = new Aggregation::Aggregate(this); + m_aggregate->add(this); + + surfaceChanged(); +} + +SearchableTerminal::~SearchableTerminal() = default; + +void SearchableTerminal::surfaceChanged() +{ + TerminalView::surfaceChanged(); + + m_search = TerminalSearchPtr(new TerminalSearch(surface()), [this](TerminalSearch *p) { + m_aggregate->remove(p); + delete p; + }); + + m_aggregate->add(m_search.get()); + + connect(m_search.get(), &TerminalSearch::hitsChanged, this, &SearchableTerminal::updateViewport); + connect(m_search.get(), &TerminalSearch::currentHitChanged, this, [this] { + TerminalSolution::SearchHit hit = m_search->currentHit(); + if (hit.start >= 0) { + setSelection(Selection{hit.start, hit.end, true}, hit != m_lastSelectedHit); + m_lastSelectedHit = hit; + } + }); +} + +void SearchableTerminal::selectionChanged(const std::optional<Selection> &newSelection) +{ + TerminalView::selectionChanged(newSelection); + + if (selection() && selection()->final) { + QString text = textFromSelection(); + + if (m_search) { + m_search->setCurrentSelection( + SearchHitWithText{{newSelection->start, newSelection->end}, text}); + } + } +} + +const QList<TerminalSolution::SearchHit> &SearchableTerminal::searchHits() const +{ + if (!m_search) + return TerminalSolution::TerminalView::searchHits(); + return m_search->hits(); +} + +} // namespace Core diff --git a/src/plugins/terminal/terminalsearch.h b/src/plugins/coreplugin/terminal/searchableterminal.h similarity index 69% rename from src/plugins/terminal/terminalsearch.h rename to src/plugins/coreplugin/terminal/searchableterminal.h index 4a176e7c643..d1747fd99b2 100644 --- a/src/plugins/terminal/terminalsearch.h +++ b/src/plugins/coreplugin/terminal/searchableterminal.h @@ -3,23 +3,21 @@ #pragma once -#include <terminal/terminalsurface.h> +#include "../core_global.h" +#include "../find/ifindsupport.h" + +#include <aggregation/aggregate.h> #include <solutions/terminal/terminalview.h> -#include <coreplugin/find/ifindsupport.h> -#include <coreplugin/find/textfindconstants.h> - -#include <QTimer> - -namespace Terminal { +namespace Core { struct SearchHitWithText : TerminalSolution::SearchHit { QString text; }; -class TerminalSearch : public Core::IFindSupport +class TerminalSearch : public IFindSupport { Q_OBJECT public: @@ -69,4 +67,23 @@ private: QTimer m_debounceTimer; }; -} // namespace Terminal +class CORE_EXPORT SearchableTerminal : public TerminalSolution::TerminalView +{ +public: + SearchableTerminal(QWidget *parent = nullptr); + ~SearchableTerminal() override; + +protected: + void surfaceChanged() override; + const QList<TerminalSolution::SearchHit> &searchHits() const override; + void selectionChanged(const std::optional<Selection> &newSelection) override; + +private: + using TerminalSearchPtr = std::unique_ptr<TerminalSearch, std::function<void(TerminalSearch *)>>; + TerminalSearchPtr m_search; + TerminalSolution::SearchHit m_lastSelectedHit{}; + + Aggregation::Aggregate *m_aggregate{nullptr}; +}; + +} // namespace Core diff --git a/src/plugins/terminal/CMakeLists.txt b/src/plugins/terminal/CMakeLists.txt index 28037780af2..fd73e5d6e67 100644 --- a/src/plugins/terminal/CMakeLists.txt +++ b/src/plugins/terminal/CMakeLists.txt @@ -12,7 +12,6 @@ add_qtc_plugin(Terminal terminalpane.cpp terminalpane.h terminalplugin.cpp terminalprocessimpl.cpp terminalprocessimpl.h - terminalsearch.cpp terminalsearch.h terminalsettings.cpp terminalsettings.h terminaltr.h terminalwidget.cpp terminalwidget.h diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 8916328971f..bfb58ba708a 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -49,7 +49,7 @@ using namespace Core; namespace Terminal { TerminalWidget::TerminalWidget(QWidget *parent, const OpenTerminalParameters &openParameters) - : TerminalSolution::TerminalView(parent) + : Core::SearchableTerminal(parent) , m_context(Utils::Id("TerminalWidget_").withSuffix(QString::number((uintptr_t) this))) , m_openParameters(openParameters) { @@ -73,10 +73,6 @@ TerminalWidget::TerminalWidget(QWidget *parent, const OpenTerminalParameters &op configBlinkTimer(); setAllowBlinkingCursor(settings().allowBlinkingCursor()); }); - - m_aggregate = new Aggregation::Aggregate(this); - m_aggregate->add(this); - m_aggregate->add(m_search.get()); } void TerminalWidget::setupPty() @@ -278,23 +274,11 @@ void TerminalWidget::resizePty(QSize newSize) void TerminalWidget::surfaceChanged() { + Core::SearchableTerminal::surfaceChanged(); + m_shellIntegration.reset(new ShellIntegration()); setSurfaceIntegration(m_shellIntegration.get()); - m_search = TerminalSearchPtr(new TerminalSearch(surface()), [this](TerminalSearch *p) { - m_aggregate->remove(p); - delete p; - }); - - connect(m_search.get(), &TerminalSearch::hitsChanged, this, &TerminalWidget::updateViewport); - connect(m_search.get(), &TerminalSearch::currentHitChanged, this, [this] { - TerminalSolution::SearchHit hit = m_search->currentHit(); - if (hit.start >= 0) { - setSelection(Selection{hit.start, hit.end, true}, hit != m_lastSelectedHit); - m_lastSelectedHit = hit; - } - }); - connect(m_shellIntegration.get(), &ShellIntegration::titleChanged, this, @@ -373,11 +357,6 @@ std::optional<TerminalSolution::TerminalView::Link> TerminalWidget::toLink(const return std::nullopt; } -const QList<TerminalSolution::SearchHit> &TerminalWidget::searchHits() const -{ - return m_search->hits(); -} - void TerminalWidget::onReadyRead(bool forceFlush) { QByteArray data = m_process->readAllRawStandardOutput(); @@ -429,6 +408,8 @@ void TerminalWidget::restart(const OpenTerminalParameters &openParameters) void TerminalWidget::selectionChanged(const std::optional<Selection> &newSelection) { + Q_UNUSED(newSelection); + updateCopyState(); if (selection() && selection()->final) { @@ -437,9 +418,6 @@ void TerminalWidget::selectionChanged(const std::optional<Selection> &newSelecti QClipboard *clipboard = QApplication::clipboard(); if (clipboard->supportsSelection()) clipboard->setText(text, QClipboard::Selection); - - m_search->setCurrentSelection( - SearchHitWithText{{newSelection->start, newSelection->end}, text}); } } diff --git a/src/plugins/terminal/terminalwidget.h b/src/plugins/terminal/terminalwidget.h index 4b54562cc6c..c836c832b54 100644 --- a/src/plugins/terminal/terminalwidget.h +++ b/src/plugins/terminal/terminalwidget.h @@ -5,14 +5,12 @@ #include "shellintegration.h" #include "shortcutmap.h" -#include "terminalsearch.h" - -#include <solutions/terminal/terminalview.h> #include <aggregation/aggregate.h> #include <coreplugin/actionmanager/command.h> #include <coreplugin/icontext.h> +#include <coreplugin/terminal/searchableterminal.h> #include <utils/link.h> #include <utils/process.h> @@ -22,7 +20,7 @@ namespace Terminal { using RegisteredAction = std::unique_ptr<QAction, std::function<void(QAction *)>>; -class TerminalWidget : public TerminalSolution::TerminalView +class TerminalWidget : public Core::SearchableTerminal { Q_OBJECT public: @@ -31,8 +29,6 @@ public: void closeTerminal(); - TerminalSearch *search() { return m_search.get(); } - void setShellName(const QString &shellName); QString shellName() const; QString title() const; @@ -80,8 +76,6 @@ protected: void setClipboard(const QString &text) override; std::optional<TerminalView::Link> toLink(const QString &text) override; - const QList<TerminalSolution::SearchHit> &searchHits() const override; - RegisteredAction registerAction(Utils::Id commandId, const Core::Context &context); void registerShortcut(Core::Command *command); @@ -95,8 +89,6 @@ private: QString m_shellName; QString m_title; - TerminalSolution::SearchHit m_lastSelectedHit{}; - Utils::Id m_identifier; Utils::Terminal::OpenTerminalParameters m_openParameters; @@ -104,11 +96,6 @@ private: Utils::FilePath m_cwd; Utils::CommandLine m_currentCommand; - using TerminalSearchPtr = std::unique_ptr<TerminalSearch, std::function<void(TerminalSearch *)>>; - TerminalSearchPtr m_search; - - Aggregation::Aggregate *m_aggregate{nullptr}; - RegisteredAction m_copy; RegisteredAction m_paste; RegisteredAction m_clearSelection; From 07de94237cd0a2e07ea2bcbe8f6c4dcb31ce78cf Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 27 Jul 2023 13:29:21 +0200 Subject: [PATCH 0526/1777] Nim: Simplify error message creation for missing compilers NimToolChains are the only ones with Constants::C_NIMLANGUAGE_ID, no need to double-check with dynamic cast. Change-Id: I1542128903261f8cfd2e20533b0589f9ceb7bc50 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/nim/project/nimproject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp index 4a2bc060260..0e3240600f9 100644 --- a/src/plugins/nim/project/nimproject.cpp +++ b/src/plugins/nim/project/nimproject.cpp @@ -6,13 +6,13 @@ #include "../nimconstants.h" #include "../nimtr.h" #include "nimbuildsystem.h" -#include "nimtoolchain.h" #include <coreplugin/icontext.h> #include <projectexplorer/kitinformation.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectmanager.h> +#include <projectexplorer/toolchain.h> using namespace ProjectExplorer; using namespace Utils; @@ -52,7 +52,7 @@ NimProject::NimProject(const FilePath &filePath) : Project(Constants::C_NIM_MIME Tasks NimProject::projectIssues(const Kit *k) const { Tasks result = Project::projectIssues(k); - auto tc = dynamic_cast<NimToolChain *>(ToolChainKitAspect::toolChain(k, Constants::C_NIMLANGUAGE_ID)); + auto tc = ToolChainKitAspect::toolChain(k, Constants::C_NIMLANGUAGE_ID); if (!tc) { result.append(createProjectTask(Task::TaskType::Error, Tr::tr("No Nim compiler set."))); return result; From 9a78f717e4082a9f928db8afa5ee8ae01c33028f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 27 Jul 2023 13:45:51 +0200 Subject: [PATCH 0527/1777] ProjectExplorer: Change signature to Project::toMap(QVariantMap &) More aspect-friendly. Change-Id: Ia107dbab65f3772b315d735e4c46f9dfe1043d5a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/nim/project/nimbleproject.cpp | 7 +++---- src/plugins/nim/project/nimbleproject.h | 2 +- src/plugins/nim/project/nimproject.cpp | 9 ++++----- src/plugins/projectexplorer/project.cpp | 12 ++++++------ src/plugins/projectexplorer/project.h | 2 +- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/plugins/nim/project/nimbleproject.cpp b/src/plugins/nim/project/nimbleproject.cpp index 5777724afbd..aeb16c8a8df 100644 --- a/src/plugins/nim/project/nimbleproject.cpp +++ b/src/plugins/nim/project/nimbleproject.cpp @@ -26,11 +26,10 @@ NimbleProject::NimbleProject(const Utils::FilePath &fileName) setBuildSystemCreator([] (Target *t) { return new NimbleBuildSystem(t); }); } -QVariantMap NimbleProject::toMap() const +void NimbleProject::toMap(QVariantMap &map) const { - QVariantMap result = Project::toMap(); - result[Constants::C_NIMPROJECT_EXCLUDEDFILES] = m_excludedFiles; - return result; + Project::toMap(map); + map[Constants::C_NIMPROJECT_EXCLUDEDFILES] = m_excludedFiles; } Project::RestoreResult NimbleProject::fromMap(const QVariantMap &map, QString *errorMessage) diff --git a/src/plugins/nim/project/nimbleproject.h b/src/plugins/nim/project/nimbleproject.h index 9abbc90dcc4..4a71514e898 100644 --- a/src/plugins/nim/project/nimbleproject.h +++ b/src/plugins/nim/project/nimbleproject.h @@ -16,7 +16,7 @@ public: NimbleProject(const Utils::FilePath &filename); // Keep for compatibility with Qt Creator 4.10 - QVariantMap toMap() const final; + void toMap(QVariantMap &map) const final; QStringList excludedFiles() const; void setExcludedFiles(const QStringList &excludedFiles); diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp index 0e3240600f9..ed74cf43744 100644 --- a/src/plugins/nim/project/nimproject.cpp +++ b/src/plugins/nim/project/nimproject.cpp @@ -27,7 +27,7 @@ public: Tasks projectIssues(const Kit *k) const final; // Keep for compatibility with Qt Creator 4.10 - QVariantMap toMap() const final; + void toMap(QVariantMap &map) const final; QStringList excludedFiles() const; void setExcludedFiles(const QStringList &excludedFiles); @@ -63,11 +63,10 @@ Tasks NimProject::projectIssues(const Kit *k) const return result; } -QVariantMap NimProject::toMap() const +void NimProject::toMap(QVariantMap &map) const { - QVariantMap result = Project::toMap(); - result[Constants::C_NIMPROJECT_EXCLUDEDFILES] = m_excludedFiles; - return result; + Project::toMap(map); + map[Constants::C_NIMPROJECT_EXCLUDEDFILES] = m_excludedFiles; } Project::RestoreResult NimProject::fromMap(const QVariantMap &map, QString *errorMessage) diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index d917672c6b9..c541d04773c 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -634,8 +634,11 @@ void Project::saveSettings() emit aboutToSaveSettings(); if (!d->m_accessor) d->m_accessor = std::make_unique<Internal::UserFileAccessor>(this); - if (!targets().isEmpty()) - d->m_accessor->saveSettings(toMap(), ICore::dialogParent()); + if (!targets().isEmpty()) { + QVariantMap map; + toMap(map); + d->m_accessor->saveSettings(map, ICore::dialogParent()); + } } Project::RestoreResult Project::restoreSettings(QString *errorMessage) @@ -688,11 +691,10 @@ FilePaths Project::files(const NodeMatcher &filter) const creating new build configurations. */ -QVariantMap Project::toMap() const +void Project::toMap(QVariantMap &map) const { const QList<Target *> ts = targets(); - QVariantMap map; map.insert(QLatin1String(ACTIVE_TARGET_KEY), ts.indexOf(d->m_activeTarget)); map.insert(QLatin1String(TARGET_COUNT_KEY), ts.size()); for (int i = 0; i < ts.size(); ++i) @@ -701,8 +703,6 @@ QVariantMap Project::toMap() const map.insert(QLatin1String(EDITOR_SETTINGS_KEY), d->m_editorConfiguration.toMap()); if (!d->m_pluginSettings.isEmpty()) map.insert(QLatin1String(PLUGIN_SETTINGS_KEY), d->m_pluginSettings); - - return map; } /*! diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 832fc3c9423..93c1611bb1e 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -111,7 +111,7 @@ public: const NodeMatcher &extraMatcher = {}) const; Utils::FilePaths binariesForSourceFile(const Utils::FilePath &sourceFile) const; - virtual QVariantMap toMap() const; + virtual void toMap(QVariantMap &map) const; Core::Context projectContext() const; Core::Context projectLanguages() const; From 4ca7dd87634dd1aa7046e9a64d640c2f7dfb2b9e Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 27 Jul 2023 14:28:04 +0200 Subject: [PATCH 0528/1777] Terminal: Adapt to recent restructuring Amends 42ed82973cec46f74f9ac57ac9ee79cd50d74c9f. Change-Id: I5845d1fe15ee88862742ee81486ba57062ab0158 Reviewed-by: hjk <hjk@qt.io> --- src/libs/solutions/solutions.qbs | 1 + src/libs/solutions/terminal/terminal.qbs | 25 ++++++++++++++++++++++++ src/plugins/terminal/terminal.qbs | 13 +----------- 3 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 src/libs/solutions/terminal/terminal.qbs diff --git a/src/libs/solutions/solutions.qbs b/src/libs/solutions/solutions.qbs index 3978235666e..d166c43f439 100644 --- a/src/libs/solutions/solutions.qbs +++ b/src/libs/solutions/solutions.qbs @@ -4,5 +4,6 @@ Project { references: [ "spinner/spinner.qbs", "tasking/tasking.qbs", + "terminal/terminal.qbs", ].concat(project.additionalLibs) } diff --git a/src/libs/solutions/terminal/terminal.qbs b/src/libs/solutions/terminal/terminal.qbs new file mode 100644 index 00000000000..a8b10b10cbb --- /dev/null +++ b/src/libs/solutions/terminal/terminal.qbs @@ -0,0 +1,25 @@ +import qbs 1.0 + +QtcLibrary { + name: "TerminalLib" + + Depends { name: "vterm" } + Depends { name: "Qt"; submodules: "widgets" } + + files: [ + "celliterator.cpp", + "celliterator.h", + "glyphcache.cpp", + "glyphcache.h", + "keys.cpp", + "keys.h", + "scrollback.cpp", + "scrollback.h", + "surfaceintegration.h", + "terminal_global.h", + "terminalsurface.cpp", + "terminalsurface.h", + "terminalview.cpp", + "terminalview.h", + ] +} diff --git a/src/plugins/terminal/terminal.qbs b/src/plugins/terminal/terminal.qbs index f9b3409bebd..57ce8042b6e 100644 --- a/src/plugins/terminal/terminal.qbs +++ b/src/plugins/terminal/terminal.qbs @@ -5,18 +5,9 @@ QtcPlugin { Depends { name: "Core" } Depends { name: "ProjectExplorer" } - Depends { name: "vterm" } - Depends { name: "ptyqt" } + Depends { name: "TerminalLib" } files: [ - "celliterator.cpp", - "celliterator.h", - "glyphcache.cpp", - "glyphcache.h", - "keys.cpp", - "keys.h", - "scrollback.cpp", - "scrollback.h", "shellmodel.cpp", "shellmodel.h", "shellintegration.cpp", @@ -35,8 +26,6 @@ QtcPlugin { "terminalsearch.h", "terminalsettings.cpp", "terminalsettings.h", - "terminalsurface.cpp", - "terminalsurface.h", "terminaltr.h", "terminalwidget.cpp", "terminalwidget.h", From 429ad78bc7feedafd6be3dfb95d04af837c4d51e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 08:58:26 +0200 Subject: [PATCH 0529/1777] Utils: Finally split FilePathAspect and StringAspect The patch was done by - duplicating StringAspectPrivate to FilePathAspectPrivate - basing FilePathAspect on TypedAspect<QString>, duplicating the needed used parts of StringAspect interface and implementation - dropping m_pathChooserDisplay from StringPathAspectPrivate and all other *displays from FilePathAspect private - remove related things until it compile - remove now unused members in the privates. Change-Id: I6ad710135dc4d3fc2f48bb620b502c20e717aa42 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 468 ++++++++++++++++++++++++------------- src/libs/utils/aspects.h | 61 +++-- 2 files changed, 347 insertions(+), 182 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index c606c3dff67..1f039fa22a9 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -776,34 +776,21 @@ public: Qt::TextElideMode m_elideMode = Qt::ElideNone; QString m_placeHolderText; - QString m_prompDialogFilter; - QString m_prompDialogTitle; - QStringList m_commandVersionArguments; QString m_historyCompleterKey; - PathChooser::Kind m_expectedKind = PathChooser::File; - Environment m_environment; QPointer<ElidingLabel> m_labelDisplay; QPointer<FancyLineEdit> m_lineEditDisplay; - QPointer<PathChooser> m_pathChooserDisplay; QPointer<QTextEdit> m_textEditDisplay; MacroExpanderProvider m_expanderProvider; - FilePath m_baseFileName; StringAspect::ValueAcceptor m_valueAcceptor; std::optional<FancyLineEdit::ValidationFunction> m_validator; - std::function<void()> m_openTerminal; CheckableAspectImplementation m_checkerImpl; bool m_undoRedoEnabled = true; bool m_acceptRichText = false; bool m_showToolTipOnLabel = false; - bool m_fileDialogOnly = false; bool m_useResetButton = false; bool m_autoApplyOnEditingFinished = false; - // Used to block recursive editingFinished signals for example when return is pressed, and - // the validation changes focus by opening a dialog - bool m_blockAutoApply = false; - bool m_allowPathFromDevice = true; bool m_validatePlaceHolder = false; }; @@ -900,9 +887,6 @@ StringAspect::StringAspect(AspectContainer *container) : TypedAspect(container), d(new Internal::StringAspectPrivate) { setSpan(2, 1); // Default: Label + something - - addDataExtractor(this, &StringAspect::value, &Data::value); - addDataExtractor(this, &StringAspect::filePath, &Data::filePath); } /*! @@ -918,14 +902,6 @@ void StringAspect::setValueAcceptor(StringAspect::ValueAcceptor &&acceptor) d->m_valueAcceptor = std::move(acceptor); } -/*! - Returns the value of this StringAspect as an ordinary \c QString. -*/ -QString StringAspect::value() const -{ - return TypedAspect::value(); -} - /*! \reimp */ @@ -945,23 +921,6 @@ void StringAspect::toMap(QVariantMap &map) const d->m_checkerImpl.toMap(map); } -/*! - Returns the value of this string aspect as \c Utils::FilePath. - - \note This simply uses \c FilePath::fromUserInput() for the - conversion. It does not use any check that the value is actually - a valid file path. -*/ -FilePath StringAspect::filePath() const -{ - return FilePath::fromUserInput(value()); -} - -PathChooser *FilePathAspect::pathChooser() const -{ - return d->m_pathChooserDisplay.data(); -} - /*! \internal */ @@ -1005,41 +964,6 @@ void StringAspect::setPlaceHolderText(const QString &placeHolderText) d->m_textEditDisplay->setPlaceholderText(placeHolderText); } -void FilePathAspect::setPromptDialogFilter(const QString &filter) -{ - d->m_prompDialogFilter = filter; - if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->setPromptDialogFilter(filter); -} - -void FilePathAspect::setPromptDialogTitle(const QString &title) -{ - d->m_prompDialogTitle = title; - if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->setPromptDialogTitle(title); -} - -void FilePathAspect::setCommandVersionArguments(const QStringList &arguments) -{ - d->m_commandVersionArguments = arguments; - if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->setCommandVersionArguments(arguments); -} - -void FilePathAspect::setAllowPathFromDevice(bool allowPathFromDevice) -{ - d->m_allowPathFromDevice = allowPathFromDevice; - if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->setAllowPathFromDevice(allowPathFromDevice); -} - -void FilePathAspect::setValidatePlaceHolder(bool validatePlaceHolder) -{ - d->m_validatePlaceHolder = validatePlaceHolder; - if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->lineEdit()->setValidatePlaceHolder(validatePlaceHolder); -} - /*! Sets \a elideMode as label elide mode. */ @@ -1061,34 +985,6 @@ void StringAspect::setHistoryCompleter(const QString &historyCompleterKey) d->m_historyCompleterKey = historyCompleterKey; if (d->m_lineEditDisplay) d->m_lineEditDisplay->setHistoryCompleter(historyCompleterKey); - if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->setHistoryCompleter(historyCompleterKey); -} - -/*! - Sets \a expectedKind as expected kind for path chooser displays. - - \sa Utils::PathChooser::setExpectedKind() -*/ -void FilePathAspect::setExpectedKind(const PathChooser::Kind expectedKind) -{ - d->m_expectedKind = expectedKind; - if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->setExpectedKind(expectedKind); -} - -void FilePathAspect::setEnvironment(const Environment &env) -{ - d->m_environment = env; - if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->setEnvironment(env); -} - -void FilePathAspect::setBaseFileName(const FilePath &baseFileName) -{ - d->m_baseFileName = baseFileName; - if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->setBaseDirectory(baseFileName); } void StringAspect::setUndoRedoEnabled(bool undoRedoEnabled) @@ -1125,15 +1021,6 @@ void StringAspect::setValidationFunction(const FancyLineEdit::ValidationFunction d->m_validator = validator; if (d->m_lineEditDisplay) d->m_lineEditDisplay->setValidationFunction(*d->m_validator); - else if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->setValidationFunction(*d->m_validator); -} - -void FilePathAspect::setOpenTerminalHandler(const std::function<void ()> &openTerminal) -{ - d->m_openTerminal = openTerminal; - if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->setOpenTerminalHandler(openTerminal); } void StringAspect::setAutoApplyOnEditingFinished(bool applyOnEditingFinished) @@ -1143,8 +1030,6 @@ void StringAspect::setAutoApplyOnEditingFinished(bool applyOnEditingFinished) void StringAspect::validateInput() { - if (d->m_pathChooserDisplay) - d->m_pathChooserDisplay->triggerChanged(); if (d->m_lineEditDisplay) d->m_lineEditDisplay->validate(); } @@ -1164,45 +1049,6 @@ void StringAspect::addToLayout(LayoutItem &parent) const QString displayedString = d->m_displayFilter ? d->m_displayFilter(value()) : value(); switch (d->m_displayStyle) { - case PathChooserDisplay: - d->m_pathChooserDisplay = createSubWidget<PathChooser>(); - d->m_pathChooserDisplay->setExpectedKind(d->m_expectedKind); - if (!d->m_historyCompleterKey.isEmpty()) - d->m_pathChooserDisplay->setHistoryCompleter(d->m_historyCompleterKey); - - if (d->m_validator) - d->m_pathChooserDisplay->setValidationFunction(*d->m_validator); - d->m_pathChooserDisplay->setEnvironment(d->m_environment); - d->m_pathChooserDisplay->setBaseDirectory(d->m_baseFileName); - d->m_pathChooserDisplay->setOpenTerminalHandler(d->m_openTerminal); - d->m_pathChooserDisplay->setPromptDialogFilter(d->m_prompDialogFilter); - d->m_pathChooserDisplay->setPromptDialogTitle(d->m_prompDialogTitle); - d->m_pathChooserDisplay->setCommandVersionArguments(d->m_commandVersionArguments); - d->m_pathChooserDisplay->setAllowPathFromDevice(d->m_allowPathFromDevice); - d->m_pathChooserDisplay->setReadOnly(isReadOnly()); - d->m_pathChooserDisplay->lineEdit()->setValidatePlaceHolder(d->m_validatePlaceHolder); - if (defaultValue() == value()) - d->m_pathChooserDisplay->setDefaultValue(defaultValue()); - else - d->m_pathChooserDisplay->setFilePath(FilePath::fromUserInput(displayedString)); - // do not override default value with placeholder, but use placeholder if default is empty - if (d->m_pathChooserDisplay->lineEdit()->placeholderText().isEmpty()) - d->m_pathChooserDisplay->lineEdit()->setPlaceholderText(d->m_placeHolderText); - d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data()); - addLabeledItem(parent, d->m_pathChooserDisplay); - useMacroExpander(d->m_pathChooserDisplay->lineEdit()); - connect(d->m_pathChooserDisplay, &PathChooser::validChanged, this, &StringAspect::validChanged); - bufferToGui(); - if (isAutoApply() && d->m_autoApplyOnEditingFinished) { - connect(d->m_pathChooserDisplay, &PathChooser::editingFinished, - this, &StringAspect::handleGuiChanged); - connect(d->m_pathChooserDisplay, &PathChooser::browsingFinished, - this, &StringAspect::handleGuiChanged); - } else { - connect(d->m_pathChooserDisplay, &PathChooser::textChanged, - this, &StringAspect::handleGuiChanged); - } - break; case LineEditDisplay: d->m_lineEditDisplay = createSubWidget<FancyLineEdit>(); d->m_lineEditDisplay->setPlaceholderText(d->m_placeHolderText); @@ -1268,8 +1114,6 @@ void StringAspect::addToLayout(LayoutItem &parent) bool StringAspect::guiToBuffer() { - if (d->m_pathChooserDisplay) - return updateStorage(m_buffer, d->m_pathChooserDisplay->lineEdit()->text()); if (d->m_lineEditDisplay) return updateStorage(m_buffer, d->m_lineEditDisplay->text()); if (d->m_textEditDisplay) @@ -1294,11 +1138,6 @@ bool StringAspect::internalToBuffer() void StringAspect::bufferToGui() { - if (d->m_pathChooserDisplay) { - d->m_pathChooserDisplay->lineEdit()->setText(m_buffer); - d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data()); - } - if (d->m_lineEditDisplay) { d->m_lineEditDisplay->setTextKeepingActiveCursor(m_buffer); d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_lineEditDisplay.data()); @@ -1358,26 +1197,66 @@ void StringAspect::setChecked(bool checked) \sa Utils::StringAspect */ +class Internal::FilePathAspectPrivate +{ +public: + std::function<QString(const QString &)> m_displayFilter; + + QString m_placeHolderText; + QString m_prompDialogFilter; + QString m_prompDialogTitle; + QStringList m_commandVersionArguments; + QString m_historyCompleterKey; + PathChooser::Kind m_expectedKind = PathChooser::File; + Environment m_environment; + QPointer<PathChooser> m_pathChooserDisplay; + MacroExpanderProvider m_expanderProvider; + FilePath m_baseFileName; + StringAspect::ValueAcceptor m_valueAcceptor; + std::optional<FancyLineEdit::ValidationFunction> m_validator; + std::function<void()> m_openTerminal; + + CheckableAspectImplementation m_checkerImpl; + + bool m_showToolTipOnLabel = false; + bool m_fileDialogOnly = false; + bool m_autoApplyOnEditingFinished = false; + bool m_allowPathFromDevice = true; + bool m_validatePlaceHolder = false; +}; FilePathAspect::FilePathAspect(AspectContainer *container) - : StringAspect(container) + : TypedAspect(container), d(new Internal::FilePathAspectPrivate) { - setDisplayStyle(PathChooserDisplay); + setSpan(2, 1); // Default: Label + something + + addDataExtractor(this, &FilePathAspect::value, &Data::value); + addDataExtractor(this, &FilePathAspect::operator(), &Data::filePath); } +FilePathAspect::~FilePathAspect() = default; + +/*! + Returns the value of this aspect as \c Utils::FilePath. + + \note This simply uses \c FilePath::fromUserInput() for the + conversion. It does not use any check that the value is actually + a valid file path. +*/ + FilePath FilePathAspect::operator()() const { - return FilePath::fromUserInput(StringAspect::value()); + return FilePath::fromUserInput(TypedAspect::value()); } FilePath FilePathAspect::expandedValue() const { - return FilePath::fromUserInput(StringAspect::value()); + return FilePath::fromUserInput(TypedAspect::value()); } QString FilePathAspect::value() const { - return StringAspect::value(); + return TypedAspect::value(); } /*! @@ -1389,12 +1268,265 @@ QString FilePathAspect::value() const void FilePathAspect::setValue(const FilePath &filePath) { - StringAspect::setValue(filePath.toUserOutput()); + TypedAspect::setValue(filePath.toUserOutput()); } void FilePathAspect::setDefaultValue(const FilePath &filePath) { - StringAspect::setDefaultValue(filePath.toUserOutput()); + TypedAspect::setDefaultValue(filePath.toUserOutput()); +} + +/*! + Adds a check box with a \a checkerLabel according to \a checkBoxPlacement + to the line edit. + + The state of the check box is made persistent when using a non-emtpy + \a checkerKey. +*/ +void FilePathAspect::makeCheckable(CheckBoxPlacement checkBoxPlacement, + const QString &checkerLabel, const QString &checkerKey) +{ + d->m_checkerImpl.makeCheckable(checkBoxPlacement, checkerLabel, checkerKey, this); +} + +bool FilePathAspect::isChecked() const +{ + return d->m_checkerImpl.isChecked(); +} + +void FilePathAspect::setChecked(bool checked) +{ + return d->m_checkerImpl.setChecked(checked); +} + +void FilePathAspect::setValueAcceptor(ValueAcceptor &&acceptor) +{ + d->m_valueAcceptor = std::move(acceptor); +} + +bool FilePathAspect::guiToBuffer() +{ + if (d->m_pathChooserDisplay) + return updateStorage(m_buffer, d->m_pathChooserDisplay->lineEdit()->text()); + return false; +} + +bool FilePathAspect::bufferToInternal() +{ + if (d->m_valueAcceptor) { + if (const std::optional<QString> tmp = d->m_valueAcceptor(m_internal, m_buffer)) + return updateStorage(m_internal, *tmp); + } + return updateStorage(m_internal, m_buffer); +} + +bool FilePathAspect::internalToBuffer() +{ + const QString val = d->m_displayFilter ? d->m_displayFilter(m_internal) : m_internal; + return updateStorage(m_buffer, val); +} + +void FilePathAspect::bufferToGui() +{ + if (d->m_pathChooserDisplay) { + d->m_pathChooserDisplay->lineEdit()->setText(m_buffer); + d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data()); + } + + validateInput(); +} + +PathChooser *FilePathAspect::pathChooser() const +{ + return d->m_pathChooserDisplay.data(); +} + +void FilePathAspect::addToLayout(Layouting::LayoutItem &parent) +{ + d->m_checkerImpl.addToLayoutFirst(parent); + + const auto useMacroExpander = [this](QWidget *w) { + if (!d->m_expanderProvider) + return; + const auto chooser = new VariableChooser(w); + chooser->addSupportedWidget(w); + chooser->addMacroExpanderProvider(d->m_expanderProvider); + }; + + const QString displayedString = d->m_displayFilter ? d->m_displayFilter(value()) : value(); + + d->m_pathChooserDisplay = createSubWidget<PathChooser>(); + d->m_pathChooserDisplay->setExpectedKind(d->m_expectedKind); + if (!d->m_historyCompleterKey.isEmpty()) + d->m_pathChooserDisplay->setHistoryCompleter(d->m_historyCompleterKey); + + if (d->m_validator) + d->m_pathChooserDisplay->setValidationFunction(*d->m_validator); + d->m_pathChooserDisplay->setEnvironment(d->m_environment); + d->m_pathChooserDisplay->setBaseDirectory(d->m_baseFileName); + d->m_pathChooserDisplay->setOpenTerminalHandler(d->m_openTerminal); + d->m_pathChooserDisplay->setPromptDialogFilter(d->m_prompDialogFilter); + d->m_pathChooserDisplay->setPromptDialogTitle(d->m_prompDialogTitle); + d->m_pathChooserDisplay->setCommandVersionArguments(d->m_commandVersionArguments); + d->m_pathChooserDisplay->setAllowPathFromDevice(d->m_allowPathFromDevice); + d->m_pathChooserDisplay->setReadOnly(isReadOnly()); + d->m_pathChooserDisplay->lineEdit()->setValidatePlaceHolder(d->m_validatePlaceHolder); + if (defaultValue() == value()) + d->m_pathChooserDisplay->setDefaultValue(defaultValue()); + else + d->m_pathChooserDisplay->setFilePath(FilePath::fromUserInput(displayedString)); + // do not override default value with placeholder, but use placeholder if default is empty + if (d->m_pathChooserDisplay->lineEdit()->placeholderText().isEmpty()) + d->m_pathChooserDisplay->lineEdit()->setPlaceholderText(d->m_placeHolderText); + d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data()); + addLabeledItem(parent, d->m_pathChooserDisplay); + useMacroExpander(d->m_pathChooserDisplay->lineEdit()); + connect(d->m_pathChooserDisplay, &PathChooser::validChanged, this, &FilePathAspect::validChanged); + bufferToGui(); + if (isAutoApply() && d->m_autoApplyOnEditingFinished) { + connect(d->m_pathChooserDisplay, &PathChooser::editingFinished, + this, &FilePathAspect::handleGuiChanged); + connect(d->m_pathChooserDisplay, &PathChooser::browsingFinished, + this, &FilePathAspect::handleGuiChanged); + } else { + connect(d->m_pathChooserDisplay, &PathChooser::textChanged, + this, &FilePathAspect::handleGuiChanged); + } + + d->m_checkerImpl.addToLayoutLast(parent); +} + +/*! + \reimp +*/ +void FilePathAspect::fromMap(const QVariantMap &map) +{ + if (!settingsKey().isEmpty()) + setValueQuietly(map.value(settingsKey(), defaultValue()).toString()); + d->m_checkerImpl.fromMap(map); +} + +/*! + \reimp +*/ +void FilePathAspect::toMap(QVariantMap &map) const +{ + saveToMap(map, value(), defaultValue(), settingsKey()); + d->m_checkerImpl.toMap(map); +} + +void FilePathAspect::setPromptDialogFilter(const QString &filter) +{ + d->m_prompDialogFilter = filter; + if (d->m_pathChooserDisplay) + d->m_pathChooserDisplay->setPromptDialogFilter(filter); +} + +void FilePathAspect::setPromptDialogTitle(const QString &title) +{ + d->m_prompDialogTitle = title; + if (d->m_pathChooserDisplay) + d->m_pathChooserDisplay->setPromptDialogTitle(title); +} + +void FilePathAspect::setCommandVersionArguments(const QStringList &arguments) +{ + d->m_commandVersionArguments = arguments; + if (d->m_pathChooserDisplay) + d->m_pathChooserDisplay->setCommandVersionArguments(arguments); +} + +void FilePathAspect::setAllowPathFromDevice(bool allowPathFromDevice) +{ + d->m_allowPathFromDevice = allowPathFromDevice; + if (d->m_pathChooserDisplay) + d->m_pathChooserDisplay->setAllowPathFromDevice(allowPathFromDevice); +} + +void FilePathAspect::setValidatePlaceHolder(bool validatePlaceHolder) +{ + d->m_validatePlaceHolder = validatePlaceHolder; + if (d->m_pathChooserDisplay) + d->m_pathChooserDisplay->lineEdit()->setValidatePlaceHolder(validatePlaceHolder); +} + +void FilePathAspect::setShowToolTipOnLabel(bool show) +{ + d->m_showToolTipOnLabel = show; + bufferToGui(); +} + +void FilePathAspect::setAutoApplyOnEditingFinished(bool applyOnEditingFinished) +{ + d->m_autoApplyOnEditingFinished = applyOnEditingFinished; +} + +/*! + Sets \a expectedKind as expected kind for path chooser displays. + + \sa Utils::PathChooser::setExpectedKind() +*/ +void FilePathAspect::setExpectedKind(const PathChooser::Kind expectedKind) +{ + d->m_expectedKind = expectedKind; + if (d->m_pathChooserDisplay) + d->m_pathChooserDisplay->setExpectedKind(expectedKind); +} + +void FilePathAspect::setEnvironment(const Environment &env) +{ + d->m_environment = env; + if (d->m_pathChooserDisplay) + d->m_pathChooserDisplay->setEnvironment(env); +} + +void FilePathAspect::setBaseFileName(const FilePath &baseFileName) +{ + d->m_baseFileName = baseFileName; + if (d->m_pathChooserDisplay) + d->m_pathChooserDisplay->setBaseDirectory(baseFileName); +} + +void FilePathAspect::setPlaceHolderText(const QString &placeHolderText) +{ + d->m_placeHolderText = placeHolderText; +} + +void FilePathAspect::setValidationFunction(const FancyLineEdit::ValidationFunction &validator) +{ + d->m_validator = validator; + if (d->m_pathChooserDisplay) + d->m_pathChooserDisplay->setValidationFunction(*d->m_validator); +} + +void FilePathAspect::setDisplayFilter(const std::function<QString (const QString &)> &displayFilter) +{ + d->m_displayFilter = displayFilter; +} + +void FilePathAspect::setHistoryCompleter(const QString &historyCompleterKey) +{ + d->m_historyCompleterKey = historyCompleterKey; + if (d->m_pathChooserDisplay) + d->m_pathChooserDisplay->setHistoryCompleter(historyCompleterKey); +} + +void FilePathAspect::setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider) +{ + d->m_expanderProvider = expanderProvider; +} + +void FilePathAspect::validateInput() +{ + if (d->m_pathChooserDisplay) + d->m_pathChooserDisplay->triggerChanged(); +} + +void FilePathAspect::setOpenTerminalHandler(const std::function<void ()> &openTerminal) +{ + d->m_openTerminal = openTerminal; + if (d->m_pathChooserDisplay) + d->m_pathChooserDisplay->setOpenTerminalHandler(openTerminal); } /*! diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index e2093a2206b..e99aa29a407 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -32,6 +32,7 @@ class BaseAspectPrivate; class BoolAspectPrivate; class ColorAspectPrivate; class DoubleAspectPrivate; +class FilePathAspectPrivate; class IntegerAspectPrivate; class MultiSelectionAspectPrivate; class SelectionAspectPrivate; @@ -484,22 +485,13 @@ public: StringAspect(AspectContainer *container = nullptr); ~StringAspect() override; - struct Data : BaseAspect::Data - { - QString value; - FilePath filePath; - }; - void addToLayout(Layouting::LayoutItem &parent) override; // Hook between UI and StringAspect: using ValueAcceptor = std::function<std::optional<QString>(const QString &, const QString &)>; void setValueAcceptor(ValueAcceptor &&acceptor); - QString value() const; - void setShowToolTipOnLabel(bool show); - void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter); void setPlaceHolderText(const QString &placeHolderText); void setHistoryCompleter(const QString &historyCompleterKey); @@ -521,16 +513,13 @@ public: enum DisplayStyle { LabelDisplay, LineEditDisplay, - TextEditDisplay, - PathChooserDisplay + TextEditDisplay }; void setDisplayStyle(DisplayStyle style); void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; - FilePath filePath() const; - signals: void validChanged(bool validState); @@ -544,10 +533,19 @@ protected: std::unique_ptr<Internal::StringAspectPrivate> d; }; -class QTCREATOR_UTILS_EXPORT FilePathAspect : public StringAspect +class QTCREATOR_UTILS_EXPORT FilePathAspect : public TypedAspect<QString> { + Q_OBJECT + public: FilePathAspect(AspectContainer *container = nullptr); + ~FilePathAspect(); + + struct Data : BaseAspect::Data + { + QString value; + FilePath filePath; + }; FilePath operator()() const; FilePath expandedValue() const; @@ -565,7 +563,42 @@ public: void setEnvironment(const Environment &env); void setBaseFileName(const FilePath &baseFileName); + void setPlaceHolderText(const QString &placeHolderText); + void setValidationFunction(const FancyLineEdit::ValidationFunction &validator); + void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter); + void setHistoryCompleter(const QString &historyCompleterKey); + void setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider); + void setShowToolTipOnLabel(bool show); + void setAutoApplyOnEditingFinished(bool applyOnEditingFinished); + + void validateInput(); + + void makeCheckable(CheckBoxPlacement checkBoxPlacement, const QString &optionalLabel, const QString &optionalBaseKey); + bool isChecked() const; + void setChecked(bool checked); + + // Hook between UI and StringAspect: + using ValueAcceptor = std::function<std::optional<QString>(const QString &, const QString &)>; + void setValueAcceptor(ValueAcceptor &&acceptor); + PathChooser *pathChooser() const; // Avoid to use. + + void addToLayout(Layouting::LayoutItem &parent) override; + + void fromMap(const QVariantMap &map) override; + void toMap(QVariantMap &map) const override; + +signals: + void validChanged(bool validState); + +protected: + void bufferToGui() override; + bool guiToBuffer() override; + + bool internalToBuffer() override; + bool bufferToInternal() override; + + std::unique_ptr<Internal::FilePathAspectPrivate> d; }; class QTCREATOR_UTILS_EXPORT IntegerAspect : public TypedAspect<qint64> From 1c3ce50c3dc13f683f24ca6801421d26d351d912 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 27 Jul 2023 12:31:43 +0200 Subject: [PATCH 0530/1777] QbsProject: Fix enum value name typo Change-Id: I7808c784123bac2ce06579d30ae22253255a0ed5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/qbsprojectmanager/qbsproject.cpp | 2 +- src/plugins/qbsprojectmanager/qbsproject.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 3b59618310c..55a3b64c0da 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -641,7 +641,7 @@ void QbsBuildSystem::parseCurrentBuildConfiguration() void QbsBuildSystem::cancelParsing() { QTC_ASSERT(m_qbsProjectParser, return); - m_cancelStatus = CancelStatusCancelingAltoghether; + m_cancelStatus = CancelStatusCancelingAltogether; m_qbsProjectParser->cancel(); } diff --git a/src/plugins/qbsprojectmanager/qbsproject.h b/src/plugins/qbsprojectmanager/qbsproject.h index 048971db7ca..bfd5d708fcf 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.h +++ b/src/plugins/qbsprojectmanager/qbsproject.h @@ -139,7 +139,7 @@ private: enum CancelStatus { CancelStatusNone, CancelStatusCancelingForReparse, - CancelStatusCancelingAltoghether + CancelStatusCancelingAltogether } m_cancelStatus = CancelStatusNone; CppEditor::CppProjectUpdater *m_cppCodeModelUpdater = nullptr; From eaa9f0f4c18ab313ccaf54cb00e424ed58d7bc7b Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 27 Jul 2023 12:42:36 +0200 Subject: [PATCH 0531/1777] QbsProject: Remove unused method Change-Id: I44494c28a631850f215d7ae45209ef4be3c398d1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/qbsprojectmanager/qbsproject.cpp | 6 ------ src/plugins/qbsprojectmanager/qbsproject.h | 1 - 2 files changed, 7 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 55a3b64c0da..74411ef3a4c 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -56,7 +56,6 @@ #include <QJsonArray> #include <QMessageBox> #include <QSet> -#include <QTimer> #include <QVariantMap> #include <algorithm> @@ -456,11 +455,6 @@ void QbsBuildSystem::updateAfterParse() }); } -void QbsBuildSystem::delayedUpdateAfterParse() -{ - QTimer::singleShot(0, this, &QbsBuildSystem::updateAfterParse); -} - void QbsBuildSystem::updateProjectNodes(const std::function<void ()> &continuation) { m_treeCreationWatcher = new TreeCreationWatcher(this); diff --git a/src/plugins/qbsprojectmanager/qbsproject.h b/src/plugins/qbsprojectmanager/qbsproject.h index bfd5d708fcf..7aa92e1d1be 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.h +++ b/src/plugins/qbsprojectmanager/qbsproject.h @@ -119,7 +119,6 @@ private: void updateBuildTargetData(); bool checkCancelStatus(); void updateAfterParse(); - void delayedUpdateAfterParse(); void updateProjectNodes(const std::function<void()> &continuation); Utils::FilePath installRoot(); From e8ca1877de7f5cc6fec940551b3a13745170bcb0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira <thiago.macieira@intel.com> Date: Thu, 16 Mar 2023 18:37:25 -0700 Subject: [PATCH 0532/1777] Use Qt 6.7's QProcess::UnixProcessFlag::CreateNewSession Allow QProcess to do the setsid() call for us. Unfortunately, the nice()-setting feature wasn't approved, so we need to keep the modifier for that. Change-Id: Icfe44ecf285a480fafe4fffd174d111b806eb3a8 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/libs/utils/launcherinterface.cpp | 4 ++++ src/libs/utils/processutils.cpp | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/launcherinterface.cpp b/src/libs/utils/launcherinterface.cpp index 218286521db..d188e224fc1 100644 --- a/src/libs/utils/launcherinterface.cpp +++ b/src/libs/utils/launcherinterface.cpp @@ -82,9 +82,13 @@ void LauncherInterfacePrivate::doStart() connect(m_process, &QProcess::readyReadStandardError, this, &LauncherInterfacePrivate::handleProcessStderr); #ifdef Q_OS_UNIX +# if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + m_process->setUnixProcessParameters(QProcess::UnixProcessFlag::CreateNewSession); +# else m_process->setChildProcessModifier([] { setpgid(0, 0); }); +# endif #endif m_process->start(launcherFilePath(), QStringList(m_server->fullServerName())); diff --git a/src/libs/utils/processutils.cpp b/src/libs/utils/processutils.cpp index 62ea514b658..c5fc3d1ade7 100644 --- a/src/libs/utils/processutils.cpp +++ b/src/libs/utils/processutils.cpp @@ -107,7 +107,17 @@ ProcessHelper::ProcessHelper(QObject *parent) : QProcess(parent), m_processStartHandler(this) { #if defined(Q_OS_UNIX) - setChildProcessModifier([this] { + bool needSetsid = m_unixTerminalDisabled; +# if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + if (needSetsid) { + setUnixProcessParameters(QProcess::UnixProcessFlag::CreateNewSession); + needSetsid = false; + } +# endif + + if (!m_lowPriority && !needSetsid) + return; + setChildProcessModifier([=, this] { // nice value range is -20 to +19 where -20 is highest, 0 default and +19 is lowest if (m_lowPriority) { errno = 0; @@ -116,7 +126,7 @@ ProcessHelper::ProcessHelper(QObject *parent) } // Disable terminal by becoming a session leader. - if (m_unixTerminalDisabled) + if (needSetsid) setsid(); }); #endif From b51747b92c1075c6b6757ccd600063ec497bfef2 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 12:36:35 +0200 Subject: [PATCH 0533/1777] Utils: Remove AspectContainer::addAspect "factory" Aspects are supposed to self-register in their constructor, or if really necessary, by manually calling AC::registerAspect. Change-Id: I6c6c46162d49d70c3cefebad8fec968a27faeadb Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/libs/utils/aspects.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index e99aa29a407..2e20f75800a 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -790,14 +790,6 @@ public: void registerAspect(BaseAspect *aspect, bool takeOwnership = false); void registerAspects(const AspectContainer &aspects); - template <class Aspect, typename ...Args> - Aspect *addAspect(Args && ...args) - { - auto aspect = new Aspect(args...); - registerAspect(aspect, true); - return aspect; - } - void fromMap(const QVariantMap &map); void toMap(QVariantMap &map) const; From 25596541325bf71c9a338bd4a0e9f866749205bb Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 27 Jul 2023 14:02:28 +0200 Subject: [PATCH 0534/1777] GenericProject: Use the right kit in example creation Change-Id: I1743f3bdcda0658ef5062f1a1784597b95e9bfec Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/genericprojectmanager/genericproject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index ef83f906a95..d0f21bb0942 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -663,7 +663,7 @@ void GenericProject::configureAsExampleProject(ProjectExplorer::Kit *kit) BuildInfo buildInfo; buildInfo.displayName = Tr::tr("Build %1").arg(i + 1); buildInfo.factory = factory; - buildInfo.kitId = kit->id(); + buildInfo.kitId = k->id(); buildInfo.buildDirectory = projectFilePath(); infoList << buildInfo; } From 6ed56f640a67224dcdbd19731660d6896dfda119 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 28 Jul 2023 08:35:29 +0200 Subject: [PATCH 0535/1777] Utils: Make it possible to change internal aspect updates ... without subclassing. This is useful in situations where there are small modifications needed for simple aspects that are themselves exposed as members of an aspect container in a header but we don't want to create a subclass for it. Change-Id: I058643137c38e564072af9a2f45b1576ea058651 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 1 - src/libs/utils/aspects.h | 51 +++++++++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 1f039fa22a9..7461b378f24 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -2739,5 +2739,4 @@ SettingsGroupNester::~SettingsGroupNester() theSettings->endGroup(); } - } // namespace Utils diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 2e20f75800a..0622c6a66f3 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -222,7 +222,7 @@ protected: protected: template <class Value> - bool updateStorage(Value &target, const Value &val) + static bool updateStorage(Value &target, const Value &val) { if (target == val) return false; @@ -354,6 +354,55 @@ protected: ValueType m_buffer{}; }; +template <typename ValueType> +class FlexibleTypedAspect : public TypedAspect<ValueType> +{ +public: + using Base = TypedAspect<ValueType>; + using Updater = std::function<bool(ValueType &, const ValueType &)>; + + using Base::Base; + + void setInternalToBuffer(const Updater &updater) { m_internalToBuffer = updater; } + void setBufferToInternal(const Updater &updater) { m_bufferToInternal = updater; } + void setInternalToExternal(const Updater &updater) { m_internalToExternal = updater; } + void setExternalToInternal(const Updater &updater) { m_externalToInternal = updater; } + +protected: + bool internalToBuffer() override + { + if (m_internalToBuffer) + return m_internalToBuffer(Base::m_buffer, Base::m_internal); + return Base::internalToBuffer(); + } + + bool bufferToInternal() override + { + if (m_bufferToInternal) + return m_bufferToInternal(Base::m_internal, Base::m_buffer); + return Base::bufferToInternal(); + } + + bool internalToExternal() override + { + if (m_internalToExternal) + return m_internalToExternal(Base::m_external, Base::m_internal); + return Base::internalToExternal(); + } + + bool externalToInternal() override + { + if (m_externalToInternal) + return m_externalToInternal(Base::m_internal, Base::m_external); + return Base::externalToInternal(); + } + + Updater m_internalToBuffer; + Updater m_bufferToInternal; + Updater m_internalToExternal; + Updater m_externalToInternal; +}; + class QTCREATOR_UTILS_EXPORT BoolAspect : public TypedAspect<bool> { Q_OBJECT From c60f999a6635f444990393ea8954c295525f6e86 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 28 Jul 2023 06:39:22 +0200 Subject: [PATCH 0536/1777] Fix qbs build Amends 4ca7dd87634dd1aa7046e9a64d640c2f7dfb2b9e and 80b23292b1b5448e237703ecbcc92cfdb84f7a1d. Change-Id: I323a22b1427d51a1c25a41b2ab54eef8bc68a32f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/solutions/terminal/terminal.qbs | 4 ++++ src/plugins/coreplugin/coreplugin.qbs | 10 ++++++++++ src/plugins/terminal/terminal.qbs | 2 -- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/libs/solutions/terminal/terminal.qbs b/src/libs/solutions/terminal/terminal.qbs index a8b10b10cbb..56d317148b1 100644 --- a/src/libs/solutions/terminal/terminal.qbs +++ b/src/libs/solutions/terminal/terminal.qbs @@ -6,6 +6,10 @@ QtcLibrary { Depends { name: "vterm" } Depends { name: "Qt"; submodules: "widgets" } + cpp.defines: base.concat([ + "TERMINALLIB_LIBRARY" + ]) + files: [ "celliterator.cpp", "celliterator.h", diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index 1cd3fcb7b31..63fbe1520b9 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -18,6 +18,7 @@ Project { Depends { name: "Utils" } Depends { name: "Aggregation" } + Depends { name: "TerminalLib" } cpp.dynamicLibraries: { if (qbs.targetOS.contains("windows")) @@ -367,6 +368,15 @@ Project { ] } + Group { + name: "Terminal" + prefix: "terminal/" + files: [ + "searchableterminal.cpp", + "searchableterminal.h", + ] + } + Export { Depends { name: "Aggregation" } Depends { name: "Utils" } diff --git a/src/plugins/terminal/terminal.qbs b/src/plugins/terminal/terminal.qbs index 57ce8042b6e..4cf3bb7a1b7 100644 --- a/src/plugins/terminal/terminal.qbs +++ b/src/plugins/terminal/terminal.qbs @@ -22,8 +22,6 @@ QtcPlugin { "terminalplugin.cpp", "terminalprocessimpl.cpp", "terminalprocessimpl.h", - "terminalsearch.cpp", - "terminalsearch.h", "terminalsettings.cpp", "terminalsettings.h", "terminaltr.h", From 8a6e4bea9ebdcc78d081f48ad1e283bf21996cd4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 27 Jul 2023 16:13:18 +0200 Subject: [PATCH 0537/1777] Autotest: Simplify framework registration functions signature Change-Id: I249b73f0adf5a678145be9d00bee9a733097bfef Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/autotest/testframeworkmanager.cpp | 14 ++++++-------- src/plugins/autotest/testframeworkmanager.h | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/plugins/autotest/testframeworkmanager.cpp b/src/plugins/autotest/testframeworkmanager.cpp index b9b61b79d11..0c9ffeef616 100644 --- a/src/plugins/autotest/testframeworkmanager.cpp +++ b/src/plugins/autotest/testframeworkmanager.cpp @@ -25,22 +25,20 @@ TestFrameworkManager::~TestFrameworkManager() s_instance = nullptr; } -bool TestFrameworkManager::registerTestFramework(ITestFramework *framework) +void TestFrameworkManager::registerTestFramework(ITestFramework *framework) { - QTC_ASSERT(framework, return false); - QTC_ASSERT(!m_registeredFrameworks.contains(framework), return false); + QTC_ASSERT(framework, return); + QTC_ASSERT(!m_registeredFrameworks.contains(framework), return); // TODO check for unique priority before registering m_registeredFrameworks.append(framework); Utils::sort(m_registeredFrameworks, &ITestFramework::priority); - return true; } -bool TestFrameworkManager::registerTestTool(ITestTool *testTool) +void TestFrameworkManager::registerTestTool(ITestTool *testTool) { - QTC_ASSERT(testTool, return false); - QTC_ASSERT(!m_registeredTestTools.contains(testTool), return false); + QTC_ASSERT(testTool, return); + QTC_ASSERT(!m_registeredTestTools.contains(testTool), return); m_registeredTestTools.append(testTool); - return true; } void TestFrameworkManager::activateFrameworksAndToolsFromSettings() diff --git a/src/plugins/autotest/testframeworkmanager.h b/src/plugins/autotest/testframeworkmanager.h index e42001dc2d4..444ea3fc2fe 100644 --- a/src/plugins/autotest/testframeworkmanager.h +++ b/src/plugins/autotest/testframeworkmanager.h @@ -14,8 +14,8 @@ public: TestFrameworkManager(); ~TestFrameworkManager(); - bool registerTestFramework(ITestFramework *framework); - bool registerTestTool(ITestTool *testTool); + void registerTestFramework(ITestFramework *framework); + void registerTestTool(ITestTool *testTool); void synchronizeSettings(); static ITestFramework *frameworkForId(Utils::Id frameworkId); From 3ad3b6a97584fcc62b2aaef925d545a07dc3f270 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 27 Jul 2023 16:40:46 +0200 Subject: [PATCH 0538/1777] AutoTest: Dissolve TestFrameworkManager It's a handful functions around two independent lists. Change-Id: I0a7015deef27a77d4e67488e1f9b6c7a8d71133b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/autotest/autotestplugin.cpp | 15 ++--- src/plugins/autotest/testframeworkmanager.cpp | 65 +++++++++---------- src/plugins/autotest/testframeworkmanager.h | 33 ++++------ 3 files changed, 49 insertions(+), 64 deletions(-) diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index 5df8c3ff0a1..72dbaf08418 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -99,7 +99,6 @@ public: TestCodeParser m_testCodeParser; TestTreeModel m_testTreeModel{&m_testCodeParser}; TestRunner m_testRunner; - TestFrameworkManager m_frameworkManager; #ifdef WITH_TESTS LoadProjectScenario m_loadProjectScenario{&m_testTreeModel}; #endif @@ -128,15 +127,15 @@ AutotestPluginPrivate::AutotestPluginPrivate() { dd = this; // Needed as the code below access it via the static plugin interface initializeMenuEntries(); - m_frameworkManager.registerTestFramework(&theQtTestFramework()); - m_frameworkManager.registerTestFramework(&theQuickTestFramework()); - m_frameworkManager.registerTestFramework(&theGTestFramework()); - m_frameworkManager.registerTestFramework(&theBoostTestFramework()); - m_frameworkManager.registerTestFramework(&theCatchFramework()); + TestFrameworkManager::registerTestFramework(&theQtTestFramework()); + TestFrameworkManager::registerTestFramework(&theQuickTestFramework()); + TestFrameworkManager::registerTestFramework(&theGTestFramework()); + TestFrameworkManager::registerTestFramework(&theBoostTestFramework()); + TestFrameworkManager::registerTestFramework(&theCatchFramework()); - m_frameworkManager.registerTestTool(&theCTestTool()); + TestFrameworkManager::registerTestTool(&theCTestTool()); + TestFrameworkManager::synchronizeSettings(); - m_frameworkManager.synchronizeSettings(); m_resultsPane = TestResultsPane::instance(); auto panelFactory = new ProjectExplorer::ProjectPanelFactory(); diff --git a/src/plugins/autotest/testframeworkmanager.cpp b/src/plugins/autotest/testframeworkmanager.cpp index 0c9ffeef616..d44dc3d1e7c 100644 --- a/src/plugins/autotest/testframeworkmanager.cpp +++ b/src/plugins/autotest/testframeworkmanager.cpp @@ -11,92 +11,89 @@ using namespace Utils; -namespace Autotest { +namespace Autotest::TestFrameworkManager { -static TestFrameworkManager *s_instance = nullptr; - -TestFrameworkManager::TestFrameworkManager() +TestFrameworks &testFrameworks() { - s_instance = this; + static TestFrameworks theFrameworks; + return theFrameworks; } -TestFrameworkManager::~TestFrameworkManager() +TestTools &testTools() { - s_instance = nullptr; + static TestTools theTools; + return theTools; } -void TestFrameworkManager::registerTestFramework(ITestFramework *framework) +void registerTestFramework(ITestFramework *framework) { QTC_ASSERT(framework, return); - QTC_ASSERT(!m_registeredFrameworks.contains(framework), return); + QTC_ASSERT(!testFrameworks().contains(framework), return); // TODO check for unique priority before registering - m_registeredFrameworks.append(framework); - Utils::sort(m_registeredFrameworks, &ITestFramework::priority); + testFrameworks().append(framework); + Utils::sort(testFrameworks(), &ITestFramework::priority); } -void TestFrameworkManager::registerTestTool(ITestTool *testTool) +void registerTestTool(ITestTool *testTool) { QTC_ASSERT(testTool, return); - QTC_ASSERT(!m_registeredTestTools.contains(testTool), return); - m_registeredTestTools.append(testTool); + QTC_ASSERT(!testTools().contains(testTool), return); + testTools().append(testTool); } -void TestFrameworkManager::activateFrameworksAndToolsFromSettings() +void activateFrameworksAndToolsFromSettings() { const Internal::TestSettings &settings = Internal::testSettings(); - for (ITestFramework *framework : std::as_const(s_instance->m_registeredFrameworks)) { + for (ITestFramework *framework : std::as_const(testFrameworks())) { framework->setActive(settings.frameworks.value(framework->id(), false)); framework->setGrouping(settings.frameworksGrouping.value(framework->id(), false)); } - for (ITestTool *testTool : std::as_const(s_instance->m_registeredTestTools)) + for (ITestTool *testTool : std::as_const(testTools())) testTool->setActive(settings.tools.value(testTool->id(), false)); } -const TestFrameworks TestFrameworkManager::registeredFrameworks() +const TestFrameworks registeredFrameworks() { - return s_instance->m_registeredFrameworks; + return testFrameworks(); } -const TestTools TestFrameworkManager::registeredTestTools() +const TestTools registeredTestTools() { - return s_instance->m_registeredTestTools; + return testTools(); } -ITestFramework *TestFrameworkManager::frameworkForId(Id frameworkId) +ITestFramework *frameworkForId(Id frameworkId) { - return Utils::findOrDefault(s_instance->m_registeredFrameworks, - [frameworkId](ITestFramework *framework) { + return Utils::findOrDefault(testFrameworks(), [frameworkId](ITestFramework *framework) { return framework->id() == frameworkId; }); } -ITestTool *TestFrameworkManager::testToolForId(Id testToolId) +ITestTool *testToolForId(Id testToolId) { - return Utils::findOrDefault(s_instance->m_registeredTestTools, - [testToolId](ITestTool *testTool) { + return Utils::findOrDefault(testTools(), [testToolId](ITestTool *testTool) { return testTool->id() == testToolId; }); } -ITestTool *TestFrameworkManager::testToolForBuildSystemId(Id buildSystemId) +ITestTool *testToolForBuildSystemId(Id buildSystemId) { if (!buildSystemId.isValid()) return nullptr; - return Utils::findOrDefault(s_instance->m_registeredTestTools, - [&buildSystemId](ITestTool *testTool) { + return Utils::findOrDefault(testTools(), [&buildSystemId](ITestTool *testTool) { return testTool->buildSystemId() == buildSystemId; }); } -void TestFrameworkManager::synchronizeSettings() +void synchronizeSettings() { Internal::testSettings().fromSettings(); - for (ITestFramework *framework : std::as_const(m_registeredFrameworks)) + for (ITestFramework *framework : std::as_const(testFrameworks())) framework->readSettings(); - for (ITestTool *testTool : std::as_const(m_registeredTestTools)) + for (ITestTool *testTool : std::as_const(testTools())) testTool->readSettings(); } -} // namespace Autotest +} // Autotest::TestframeworkManager diff --git a/src/plugins/autotest/testframeworkmanager.h b/src/plugins/autotest/testframeworkmanager.h index 444ea3fc2fe..9ced25d8fb9 100644 --- a/src/plugins/autotest/testframeworkmanager.h +++ b/src/plugins/autotest/testframeworkmanager.h @@ -5,29 +5,18 @@ #include "itestframework.h" -namespace Autotest { +namespace Autotest::TestFrameworkManager { -class TestFrameworkManager final -{ +void registerTestFramework(ITestFramework *framework); +void registerTestTool(ITestTool *testTool); +void synchronizeSettings(); -public: - TestFrameworkManager(); - ~TestFrameworkManager(); +ITestFramework *frameworkForId(Utils::Id frameworkId); +ITestTool *testToolForId(Utils::Id testToolId); +ITestTool *testToolForBuildSystemId(Utils::Id buildSystemId); +void activateFrameworksAndToolsFromSettings(); +const TestFrameworks registeredFrameworks(); +const TestTools registeredTestTools(); - void registerTestFramework(ITestFramework *framework); - void registerTestTool(ITestTool *testTool); - void synchronizeSettings(); - static ITestFramework *frameworkForId(Utils::Id frameworkId); - static ITestTool *testToolForId(Utils::Id testToolId); - static ITestTool *testToolForBuildSystemId(Utils::Id buildSystemId); - static void activateFrameworksAndToolsFromSettings(); - static const TestFrameworks registeredFrameworks(); - static const TestTools registeredTestTools(); - -private: - TestFrameworks m_registeredFrameworks; - TestTools m_registeredTestTools; -}; - -} // namespace Autotest +} // Autotest::TestFrameworkManager From defc39173871d5fb869292fc13a0809962c7c02d Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 28 Jul 2023 12:29:16 +0200 Subject: [PATCH 0539/1777] PerfProfiler: Fix restoring settings Change-Id: Ia669be096efc077d87b23ec6136ad5138363eb05 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/perfprofiler/perfsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp index 0cc95595b6c..1699d973f2d 100644 --- a/src/plugins/perfprofiler/perfsettings.cpp +++ b/src/plugins/perfprofiler/perfsettings.cpp @@ -422,8 +422,8 @@ PerfSettings::PerfSettings(ProjectExplorer::Target *target) return Column { widget }; }); - readSettings(); readGlobalSettings(); + readSettings(); } PerfSettings::~PerfSettings() From 497bcbbf976eb3b254bd0ed1169df80d141fcfe0 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 16:55:19 +0200 Subject: [PATCH 0540/1777] Perfprofiler: Make PerfConfigWidget a plain widget Change-Id: Ic268db92d16657457cce404056732a3903be8205 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/perfprofiler/perfsettings.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp index 1699d973f2d..534af139615 100644 --- a/src/plugins/perfprofiler/perfsettings.cpp +++ b/src/plugins/perfprofiler/perfsettings.cpp @@ -39,14 +39,12 @@ using namespace PerfProfiler::Internal; namespace PerfProfiler { -class PerfConfigWidget : public Core::IOptionsPageWidget +class PerfConfigWidget : public QWidget { public: PerfConfigWidget(PerfSettings *settings, Target *target); private: - void apply() final; - void readTracePoints(); void handleProcessDone(); @@ -145,11 +143,6 @@ PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, Target *target) useTracePointsButton->setEnabled(true); } -void PerfConfigWidget::apply() -{ - m_settings->writeGlobalSettings(); -} - void PerfConfigWidget::readTracePoints() { QMessageBox messageBox; From e49ac10cb18a21d93fb7a2f387aaff8728634ecd Mon Sep 17 00:00:00 2001 From: Andre Hartmann <aha_1980@gmx.de> Date: Thu, 13 Jul 2023 09:10:09 +0200 Subject: [PATCH 0541/1777] Git: Ignore irrelevant changes in instant blame Optionally ignore whitespace changes or line moves to only show the last real code changes. Feature is disabled by default. Fixes: QTCREATORBUG-29378 Change-Id: Ia2d5ad926f4098554b1ed3365bffadd4e2063e8e Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- src/plugins/git/gitplugin.cpp | 19 +++++++++++++++---- src/plugins/git/gitsettings.cpp | 15 ++++++++++++++- src/plugins/git/gitsettings.h | 2 ++ 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 85e01f3e9aa..0196a8cee8f 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -224,7 +224,7 @@ public: QString toolTipText(const CommitInfo &info) const { - const QString result = QString( + QString result = QString( "<table>" " <tr><td>commit</td><td>%1</td></tr>" " <tr><td>Author:</td><td>%2 <%3></td></tr>" @@ -234,6 +234,12 @@ public: "</table>") .arg(info.sha1, info.author, info.authorMail, info.authorTime.toString("yyyy-MM-dd hh:mm:ss"), info.summary); + + if (settings().instantBlameIgnoreSpaceChanges() + || settings().instantBlameIgnoreLineMoves()) { + result.append(Tr::tr("<p><b>Note:</b> Ignore whitespace changes or line moves" + " is enabled in the instant blame settings.</p>")); + } return result; } }; @@ -1574,9 +1580,14 @@ void GitPluginPrivate::instantBlame() const CommitInfo info = parseBlameOutput(output.split('\n'), filePath, m_author); m_blameMark.reset(new BlameMark(filePath, line, info)); }; - gitClient().vcsExecWithHandler(workingDirectory, - {"blame", "-p", "-L", lineString, "--", filePath.toString()}, - this, commandHandler, RunFlags::NoOutput, m_codec); + QStringList options = {"blame", "-p"}; + if (settings().instantBlameIgnoreSpaceChanges()) + options.append("-w"); + if (settings().instantBlameIgnoreLineMoves()) + options.append("-M"); + options.append({"-L", lineString, "--", filePath.toString()}); + gitClient().vcsExecWithHandler(workingDirectory, options, this, + commandHandler, RunFlags::NoOutput, m_codec); } void GitPluginPrivate::stopInstantBlame() diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index 62ef1f15eb2..79d85566986 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -89,6 +89,18 @@ GitSettings::GitSettings() instantBlame.setLabelText(Tr::tr("Add instant blame annotations to editor")); instantBlame.setToolTip( Tr::tr("Annotate the current line in the editor with Git \"blame\" output.")); + instantBlameIgnoreSpaceChanges.setSettingsKey("GitInstantIgnoreSpaceChanges"); + instantBlameIgnoreSpaceChanges.setDefaultValue(false); + instantBlameIgnoreSpaceChanges.setLabelText( + Tr::tr("Ignore whitespace changes")); + instantBlameIgnoreSpaceChanges.setToolTip( + Tr::tr("Finds the commit that introduced the last real code changes to the line.")); + instantBlameIgnoreLineMoves.setSettingsKey("GitInstantIgnoreLineMoves"); + instantBlameIgnoreLineMoves.setDefaultValue(false); + instantBlameIgnoreLineMoves.setLabelText( + Tr::tr("Ignore line moves")); + instantBlameIgnoreLineMoves.setToolTip( + Tr::tr("Finds the commit that introduced the line before it was moved.")); graphLog.setSettingsKey("GraphLog"); @@ -137,7 +149,8 @@ GitSettings::GitSettings() Group { title(Tr::tr("Instant Blame")), - Row { instantBlame } + instantBlame.groupChecker(), + Row { instantBlameIgnoreSpaceChanges, instantBlameIgnoreLineMoves, st }, }, st diff --git a/src/plugins/git/gitsettings.h b/src/plugins/git/gitsettings.h index a48b5ccb2a9..f5a83c5e8a9 100644 --- a/src/plugins/git/gitsettings.h +++ b/src/plugins/git/gitsettings.h @@ -38,6 +38,8 @@ public: Utils::IntegerAspect lastResetIndex{this}; Utils::BoolAspect refLogShowDate{this}; Utils::BoolAspect instantBlame{this}; + Utils::BoolAspect instantBlameIgnoreSpaceChanges{this}; + Utils::BoolAspect instantBlameIgnoreLineMoves{this}; mutable Utils::FilePath resolvedBinPath; mutable bool tryResolve = true; From 3c0899d736456d52bb6f3172e3de8f4d4bc1e588 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 27 Jul 2023 16:26:15 +0200 Subject: [PATCH 0542/1777] Debugger: use TemporaryDirectory for CMake debugger Hardcoding "/tmp" is not the best idea. Change-Id: I9d5abd48bdf37d842d790db5ae5c4a7b994075e1 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cmakeprojectmanager/fileapireader.cpp | 5 +++-- src/plugins/debugger/dap/dapengine.cpp | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp index 66995ba5d32..8cc8fc572b1 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.cpp +++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp @@ -16,6 +16,7 @@ #include <utils/algorithm.h> #include <utils/async.h> #include <utils/qtcassert.h> +#include <utils/temporarydirectory.h> #include <QLoggingCategory> @@ -97,9 +98,9 @@ void FileApiReader::parse(bool forceCMakeRun, + m_parameters.additionalCMakeArguments) : QStringList()); if (debugging) { - FilePath file = FilePath::fromString("/tmp/cmake-dap.sock"); + FilePath file = FilePath::fromString(TemporaryDirectory::masterDirectoryPath() + "/cmake-dap.sock"); file.removeFile(); - args << "--debugger" << "--debugger-pipe=/tmp/cmake-dap.sock"; + args << "--debugger" << "--debugger-pipe=" + file.path(); } qCDebug(cmakeFileApiMode) << "Parameters request these CMake arguments:" << args; diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 65b5a731101..2720adb04de 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -29,6 +29,7 @@ #include <utils/environment.h> #include <utils/process.h> #include <utils/qtcassert.h> +#include <utils/temporarydirectory.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/ieditor.h> @@ -253,7 +254,8 @@ void DapEngine::setupEngine() qCDebug(dapEngineLog) << "build system name" << ProjectExplorer::ProjectTree::currentBuildSystem()->name(); m_nextBreakpointId = 0; - m_dataGenerator = std::make_unique<LocalSocketDataProvider>("/tmp/cmake-dap.sock"); + m_dataGenerator = std::make_unique<LocalSocketDataProvider>( + TemporaryDirectory::masterDirectoryPath() + "/cmake-dap.sock"); connectDataGeneratorSignals(); connect(ProjectExplorer::ProjectTree::currentBuildSystem(), From 9d9e84296aabaa2ff373790b49e494ca44d7d4ca Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 25 Jul 2023 13:10:22 +0200 Subject: [PATCH 0543/1777] Designer: Add -designer-qt-pluginpath argument also for Qt < 6.7 It doesn't have the public API yet, but hack it by temporarily changing the application's library path, which is used by designer for the default plugin paths. Change-Id: I658e41d1228cb89cb6e72d51f3e70b17de32127c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/designer/CMakeLists.txt | 9 ++++++- src/plugins/designer/formeditor.cpp | 30 ++++++++++++++++++++++- src/plugins/designer/formeditorplugin.cpp | 8 +++--- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/plugins/designer/CMakeLists.txt b/src/plugins/designer/CMakeLists.txt index eea16798a5d..581f7ec2a7e 100644 --- a/src/plugins/designer/CMakeLists.txt +++ b/src/plugins/designer/CMakeLists.txt @@ -14,7 +14,14 @@ if(Qt6_VERSION VERSION_GREATER_EQUAL 6.7.0) } ],") else() - set(DESIGNER_PLUGIN_ARGUMENTS) + set(DESIGNER_PLUGIN_ARGUMENTS + "\"Arguments\" : [ + { + \"Name\" : \"-designer-qt-pluginpath\", + \"Parameter\" : \"path\", + \"Description\" : \"Override the default search path for Qt Designer plugins\" + } + ],") endif() add_qtc_plugin(Designer diff --git a/src/plugins/designer/formeditor.cpp b/src/plugins/designer/formeditor.cpp index 9629f905266..93603e1a28e 100644 --- a/src/plugins/designer/formeditor.cpp +++ b/src/plugins/designer/formeditor.cpp @@ -28,6 +28,7 @@ #include <utils/infobar.h> #include <utils/qtcassert.h> +#include <utils/stringutils.h> #include <utils/theme/theme.h> #include <QDesignerFormEditorPluginInterface> @@ -224,7 +225,18 @@ FormEditorData::FormEditorData() m_formeditor = QDesignerComponents::createFormEditorWithPluginPaths(designerPluginPaths(), nullptr); #else + // Qt < 6.7.0 doesn't have API for changing the plugin path yet. + // Work around it by temporarily changing the application's library paths, + // which are used for Designer's plugin paths. + // This must be done before creating the FormEditor, and with it QDesignerPluginManager. + const QStringList restoreLibraryPaths = sQtPluginPath->isEmpty() + ? QStringList() + : QCoreApplication::libraryPaths(); + if (!sQtPluginPath->isEmpty()) + QCoreApplication::setLibraryPaths(QStringList(*sQtPluginPath)); m_formeditor = QDesignerComponents::createFormEditor(nullptr); + if (!sQtPluginPath->isEmpty()) + QCoreApplication::setLibraryPaths(restoreLibraryPaths); #endif if (Designer::Constants::Internal::debug) qDebug() << Q_FUNC_INFO; @@ -894,7 +906,23 @@ void FormEditorData::print() void setQtPluginPath(const QString &qtPluginPath) { QTC_CHECK(!d); - *sQtPluginPath = qtPluginPath; + *sQtPluginPath = QDir::fromNativeSeparators(qtPluginPath); +#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) + // Cut a "/designer" postfix off, if present. + // For Qt < 6.7.0 we hack the plugin path by temporarily setting the application library paths + // and Designer adds "/designer" to these. + static const QString postfix = "/designer"; + *sQtPluginPath = Utils::trimBack(*sQtPluginPath, '/'); + if (sQtPluginPath->endsWith(postfix)) + sQtPluginPath->chop(postfix.size()); + if (!QFile::exists(*sQtPluginPath + postfix)) { + qWarning() << qPrintable( + QLatin1String( + "Warning: The path \"%1\" passed to -designer-qt-pluginpath does not exist. " + "Note that \"%2\" at the end is enforced.") + .arg(*sQtPluginPath + postfix, postfix)); + } +#endif } void addPluginPath(const QString &pluginPath) diff --git a/src/plugins/designer/formeditorplugin.cpp b/src/plugins/designer/formeditorplugin.cpp index 37d0f7ce5df..e839ce2b3a2 100644 --- a/src/plugins/designer/formeditorplugin.cpp +++ b/src/plugins/designer/formeditorplugin.cpp @@ -60,7 +60,6 @@ FormEditorPlugin::~FormEditorPlugin() delete d; } -#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) static void parseArguments(const QStringList &arguments) { const auto doWithNext = [arguments](auto it, const std::function<void(QString)> &fun) { @@ -71,11 +70,14 @@ static void parseArguments(const QStringList &arguments) for (auto it = arguments.cbegin(); it != arguments.cend(); ++it) { if (*it == "-designer-qt-pluginpath") doWithNext(it, [](const QString &path) { setQtPluginPath(path); }); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + // -designer-pluginpath is only supported when building with Qt >= 6.7.0, which added the + // required API else if (*it == "-designer-pluginpath") doWithNext(it, [](const QString &path) { addPluginPath(path); }); +#endif } } -#endif bool FormEditorPlugin::initialize([[maybe_unused]] const QStringList &arguments, [[maybe_unused]] QString *errorString) @@ -110,9 +112,7 @@ bool FormEditorPlugin::initialize([[maybe_unused]] const QStringList &arguments, QCoreApplication::installTranslator(qtr); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) parseArguments(arguments); -#endif return true; } From 7d08f96da5f59e3b174b71c69d5301fbae1b10b5 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 27 Jul 2023 15:13:31 +0200 Subject: [PATCH 0544/1777] Utils: Remove AspectContainer ctor's parent parameter Instead use setParent in the two cases that use it. The parent gets in the way when attempting to derive AspectContainer from BaseAspect. Change-Id: I6079beb0e00334133da115b714bc5186064c6722 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/libs/utils/aspects.cpp | 10 +++------- src/libs/utils/aspects.h | 2 +- src/plugins/copilot/copilotprojectpanel.cpp | 3 ++- src/plugins/copilot/copilotsettings.cpp | 3 +-- src/plugins/copilot/copilotsettings.h | 2 +- src/plugins/projectexplorer/projectconfiguration.cpp | 4 ++-- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 7461b378f24..aee58f74fdd 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -2399,9 +2399,7 @@ void TextDisplay::setText(const QString &message) Sub-aspects ownership can be declared using \a setOwnsSubAspects. */ -namespace Internal { - -class AspectContainerPrivate +class Internal::AspectContainerPrivate { public: QList<BaseAspect *> m_items; // Both owned and non-owned. @@ -2411,10 +2409,8 @@ public: std::function<Layouting::LayoutItem ()> m_layouter; }; -} // Internal - -AspectContainer::AspectContainer(QObject *parent) - : QObject(parent), d(new Internal::AspectContainerPrivate) +AspectContainer::AspectContainer() + : d(new Internal::AspectContainerPrivate) {} /*! diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 0622c6a66f3..c2acbc5041d 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -830,7 +830,7 @@ class QTCREATOR_UTILS_EXPORT AspectContainer : public QObject Q_OBJECT public: - AspectContainer(QObject *parent = nullptr); + AspectContainer(); ~AspectContainer(); AspectContainer(const AspectContainer &) = delete; diff --git a/src/plugins/copilot/copilotprojectpanel.cpp b/src/plugins/copilot/copilotprojectpanel.cpp index f1eb5d119e8..034e43bc2dc 100644 --- a/src/plugins/copilot/copilotprojectpanel.cpp +++ b/src/plugins/copilot/copilotprojectpanel.cpp @@ -32,7 +32,8 @@ ProjectSettingsWidget *createCopilotProjectPanel(Project *project) using namespace ProjectExplorer; auto widget = new CopilotProjectSettingsWidget; - auto settings = new CopilotProjectSettings(project, widget); + auto settings = new CopilotProjectSettings(project); + settings->setParent(widget); QObject::connect(widget, &ProjectSettingsWidget::useGlobalSettingsChanged, diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index 22c38f30e26..ce67265d56e 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -91,8 +91,7 @@ CopilotSettings::CopilotSettings() readSettings(); } -CopilotProjectSettings::CopilotProjectSettings(ProjectExplorer::Project *project, QObject *parent) - : AspectContainer(parent) +CopilotProjectSettings::CopilotProjectSettings(ProjectExplorer::Project *project) { setAutoApply(true); diff --git a/src/plugins/copilot/copilotsettings.h b/src/plugins/copilot/copilotsettings.h index 2f66f48ffba..11e9ace9c6b 100644 --- a/src/plugins/copilot/copilotsettings.h +++ b/src/plugins/copilot/copilotsettings.h @@ -25,7 +25,7 @@ CopilotSettings &settings(); class CopilotProjectSettings : public Utils::AspectContainer { public: - CopilotProjectSettings(ProjectExplorer::Project *project, QObject *parent = nullptr); + explicit CopilotProjectSettings(ProjectExplorer::Project *project); void save(ProjectExplorer::Project *project); void setUseGlobalSettings(bool useGlobalSettings); diff --git a/src/plugins/projectexplorer/projectconfiguration.cpp b/src/plugins/projectexplorer/projectconfiguration.cpp index 082d978913a..9b88e47bb5e 100644 --- a/src/plugins/projectexplorer/projectconfiguration.cpp +++ b/src/plugins/projectexplorer/projectconfiguration.cpp @@ -17,11 +17,11 @@ const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ProjectConfiguration.DisplayNam // ProjectConfiguration ProjectConfiguration::ProjectConfiguration(QObject *parent, Target *target, Utils::Id id) - : AspectContainer(parent) - , m_target(target) + : m_target(target) , m_id(id) { QTC_CHECK(parent); + setParent(parent); QTC_CHECK(target); QTC_CHECK(id.isValid()); setObjectName(id.toString()); From e1211974a598ba7a1bfda8758f732c0190015cf4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 28 Jul 2023 14:41:29 +0200 Subject: [PATCH 0545/1777] BareMetal: Make toMap signature more aspect friendly Change-Id: I03b91db90e07c7ad6f6b59cd2d63f13b6961e268 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../baremetal/debugserverprovidermanager.cpp | 3 ++- .../baremetal/debugserverproviderssettingspage.cpp | 4 +++- .../debugservers/gdb/eblinkgdbserverprovider.cpp | 6 ++---- .../debugservers/gdb/eblinkgdbserverprovider.h | 2 +- .../debugservers/gdb/gdbserverprovider.cpp | 8 +++----- .../baremetal/debugservers/gdb/gdbserverprovider.h | 2 +- .../debugservers/gdb/jlinkgdbserverprovider.cpp | 5 ++--- .../debugservers/gdb/jlinkgdbserverprovider.h | 2 +- .../debugservers/gdb/openocdgdbserverprovider.cpp | 5 ++--- .../debugservers/gdb/openocdgdbserverprovider.h | 2 +- .../gdb/stlinkutilgdbserverprovider.cpp | 5 ++--- .../debugservers/gdb/stlinkutilgdbserverprovider.h | 2 +- .../debugservers/uvsc/jlinkuvscserverprovider.cpp | 5 ++--- .../debugservers/uvsc/jlinkuvscserverprovider.h | 2 +- .../uvsc/simulatoruvscserverprovider.cpp | 5 ++--- .../uvsc/simulatoruvscserverprovider.h | 2 +- .../debugservers/uvsc/stlinkuvscserverprovider.cpp | 5 ++--- .../debugservers/uvsc/stlinkuvscserverprovider.h | 2 +- .../debugservers/uvsc/uvscserverprovider.cpp | 5 ++--- .../debugservers/uvsc/uvscserverprovider.h | 2 +- src/plugins/baremetal/idebugserverprovider.cpp | 14 ++++++-------- src/plugins/baremetal/idebugserverprovider.h | 2 +- 22 files changed, 40 insertions(+), 50 deletions(-) diff --git a/src/plugins/baremetal/debugserverprovidermanager.cpp b/src/plugins/baremetal/debugserverprovidermanager.cpp index be4ed0ab06f..d56d81b2d9c 100644 --- a/src/plugins/baremetal/debugserverprovidermanager.cpp +++ b/src/plugins/baremetal/debugserverprovidermanager.cpp @@ -126,7 +126,8 @@ void DebugServerProviderManager::saveProviders() int count = 0; for (const IDebugServerProvider *p : std::as_const(m_providers)) { if (p->isValid()) { - const QVariantMap tmp = p->toMap(); + QVariantMap tmp; + p->toMap(tmp); if (tmp.isEmpty()) continue; const QString key = QString::fromLatin1(dataKeyC) + QString::number(count); diff --git a/src/plugins/baremetal/debugserverproviderssettingspage.cpp b/src/plugins/baremetal/debugserverproviderssettingspage.cpp index 9fa9db95418..bcb108f0ee8 100644 --- a/src/plugins/baremetal/debugserverproviderssettingspage.cpp +++ b/src/plugins/baremetal/debugserverproviderssettingspage.cpp @@ -347,7 +347,9 @@ DebugServerProvidersSettingsWidget::DebugServerProvidersSettingsWidget() for (const auto f : DebugServerProviderManager::factories()) { if (id.startsWith(f->id())) { IDebugServerProvider *p = f->create(); - p->fromMap(old->toMap()); + QVariantMap map; + old->toMap(map); + p->fromMap(map); p->setDisplayName(Tr::tr("Clone of %1").arg(old->displayName())); p->resetId(); addProviderToModel(p); diff --git a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp index d307eefb0ec..e955aa3ff21 100644 --- a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp @@ -142,9 +142,9 @@ bool EBlinkGdbServerProvider::isValid() const } } -QVariantMap EBlinkGdbServerProvider::toMap() const +void EBlinkGdbServerProvider::toMap(QVariantMap &data) const { - QVariantMap data = GdbServerProvider::toMap(); + GdbServerProvider::toMap(data); data.insert(executableFileKeyC, m_executableFile.toSettings()); data.insert(verboseLevelKeyC, m_verboseLevel); data.insert(interfaceTypeC, m_interfaceType); @@ -156,8 +156,6 @@ QVariantMap EBlinkGdbServerProvider::toMap() const data.insert(targetDisableStackC, m_targetDisableStack); data.insert(gdbShutDownAfterDisconnectC, m_gdbShutDownAfterDisconnect); data.insert(gdbNotUseCacheC, m_gdbNotUseCache); - - return data; } bool EBlinkGdbServerProvider::fromMap(const QVariantMap &data) diff --git a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.h index 9f74ba52f48..5ee074bbcc7 100644 --- a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.h @@ -21,7 +21,7 @@ class EBlinkGdbServerProvider final : public GdbServerProvider public: enum InterfaceType { SWD, JTAG }; - QVariantMap toMap() const final; + void toMap(QVariantMap &data) const final; bool fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp index 222d22ade98..10f8842ae7f 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp @@ -120,15 +120,14 @@ bool GdbServerProvider::operator==(const IDebugServerProvider &other) const && m_useExtendedRemote == p->m_useExtendedRemote; } -QVariantMap GdbServerProvider::toMap() const +void GdbServerProvider::toMap(QVariantMap &data) const { - QVariantMap data = IDebugServerProvider::toMap(); + IDebugServerProvider::toMap(data); data.insert(startupModeKeyC, m_startupMode); data.insert(peripheralDescriptionFileKeyC, m_peripheralDescriptionFile.toSettings()); data.insert(initCommandsKeyC, m_initCommands); data.insert(resetCommandsKeyC, m_resetCommands); data.insert(useExtendedRemoteKeyC, m_useExtendedRemote); - return data; } bool GdbServerProvider::isValid() const @@ -136,8 +135,7 @@ bool GdbServerProvider::isValid() const return !channelString().isEmpty(); } -bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, - QString &errorMessage) const +bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const { QTC_ASSERT(runTool, return false); const RunControl *runControl = runTool->runControl(); diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h index 1c23d499957..6b3c91f2947 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h @@ -33,7 +33,7 @@ public: bool operator==(const IDebugServerProvider &other) const override; - QVariantMap toMap() const override; + void toMap(QVariantMap &data) const override; virtual Utils::CommandLine command() const; diff --git a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp index c1ee31b7109..f923d79f75a 100644 --- a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp @@ -118,9 +118,9 @@ bool JLinkGdbServerProvider::isValid() const return true; } -QVariantMap JLinkGdbServerProvider::toMap() const +void JLinkGdbServerProvider::toMap(QVariantMap &data) const { - QVariantMap data = GdbServerProvider::toMap(); + GdbServerProvider::toMap(data); data.insert(executableFileKeyC, m_executableFile.toSettings()); data.insert(jlinkDeviceKeyC, m_jlinkDevice); data.insert(jlinkHostInterfaceKeyC, m_jlinkHost); @@ -128,7 +128,6 @@ QVariantMap JLinkGdbServerProvider::toMap() const data.insert(jlinkTargetInterfaceKeyC, m_jlinkTargetIface); data.insert(jlinkTargetInterfaceSpeedKeyC, m_jlinkTargetIfaceSpeed); data.insert(additionalArgumentsKeyC, m_additionalArguments); - return data; } bool JLinkGdbServerProvider::fromMap(const QVariantMap &data) diff --git a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.h index aacb781b045..3e490bfb852 100644 --- a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.h @@ -18,7 +18,7 @@ namespace BareMetal::Internal { class JLinkGdbServerProvider final : public GdbServerProvider { public: - QVariantMap toMap() const final; + void toMap(QVariantMap &data) const final; bool fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; diff --git a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp index ca7f25e56f3..5d746a29b4f 100644 --- a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp @@ -125,14 +125,13 @@ bool OpenOcdGdbServerProvider::isValid() const return true; } -QVariantMap OpenOcdGdbServerProvider::toMap() const +void OpenOcdGdbServerProvider::toMap(QVariantMap &data) const { - QVariantMap data = GdbServerProvider::toMap(); + GdbServerProvider::toMap(data); data.insert(executableFileKeyC, m_executableFile.toSettings()); data.insert(rootScriptsDirKeyC, m_rootScriptsDir.toSettings()); data.insert(configurationFileKeyC, m_configurationFile.toSettings()); data.insert(additionalArgumentsKeyC, m_additionalArguments); - return data; } bool OpenOcdGdbServerProvider::fromMap(const QVariantMap &data) diff --git a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.h index e21972a9ab5..e45aa5aef7b 100644 --- a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.h @@ -18,7 +18,7 @@ namespace BareMetal::Internal { class OpenOcdGdbServerProvider final : public GdbServerProvider { public: - QVariantMap toMap() const final; + void toMap(QVariantMap &data) const final; bool fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; diff --git a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp index 78d0e6fedbe..4941c7732b7 100644 --- a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp @@ -113,16 +113,15 @@ bool StLinkUtilGdbServerProvider::isValid() const return true; } -QVariantMap StLinkUtilGdbServerProvider::toMap() const +void StLinkUtilGdbServerProvider::toMap(QVariantMap &data) const { - QVariantMap data = GdbServerProvider::toMap(); + GdbServerProvider::toMap(data); data.insert(executableFileKeyC, m_executableFile.toSettings()); data.insert(verboseLevelKeyC, m_verboseLevel); data.insert(extendedModeKeyC, m_extendedMode); data.insert(resetBoardKeyC, m_resetBoard); data.insert(transportLayerKeyC, m_transport); data.insert(connectUnderResetKeyC, m_connectUnderReset); - return data; } bool StLinkUtilGdbServerProvider::fromMap(const QVariantMap &data) diff --git a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.h index 66a3930676f..52b2642c19c 100644 --- a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.h @@ -21,7 +21,7 @@ class StLinkUtilGdbServerProvider final : public GdbServerProvider public: enum TransportLayer { ScsiOverUsb = 1, RawUsb = 2, UnspecifiedTransport }; - QVariantMap toMap() const final; + void toMap(QVariantMap &data) const final; bool fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; diff --git a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp index 7bb0bec353c..22d0244cd78 100644 --- a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp @@ -158,11 +158,10 @@ JLinkUvscServerProvider::JLinkUvscServerProvider() setSupportedDrivers({"Segger\\JL2CM3.dll"}); } -QVariantMap JLinkUvscServerProvider::toMap() const +void JLinkUvscServerProvider::toMap(QVariantMap &data) const { - QVariantMap data = UvscServerProvider::toMap(); + UvscServerProvider::toMap(data); data.insert(adapterOptionsKeyC, m_adapterOpts.toMap()); - return data; } bool JLinkUvscServerProvider::fromMap(const QVariantMap &data) diff --git a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.h index bf2c5f295d3..19df028dd7f 100644 --- a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.h @@ -36,7 +36,7 @@ public: class JLinkUvscServerProvider final : public UvscServerProvider { public: - QVariantMap toMap() const final; + void toMap(QVariantMap &data) const final; bool fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; diff --git a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp index d7eba5ebfd1..188df6e9165 100644 --- a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp @@ -63,11 +63,10 @@ SimulatorUvscServerProvider::SimulatorUvscServerProvider() setDriverSelection(defaultSimulatorDriverSelection()); } -QVariantMap SimulatorUvscServerProvider::toMap() const +void SimulatorUvscServerProvider::toMap(QVariantMap &data) const { - QVariantMap data = UvscServerProvider::toMap(); + UvscServerProvider::toMap(data); data.insert(limitSpeedKeyC, m_limitSpeed); - return data; } bool SimulatorUvscServerProvider::fromMap(const QVariantMap &data) diff --git a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h index e08a02d741a..b80da20b1ec 100644 --- a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h @@ -16,7 +16,7 @@ namespace BareMetal::Internal { class SimulatorUvscServerProvider final : public UvscServerProvider { public: - QVariantMap toMap() const final; + void toMap(QVariantMap &data) const final; bool fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; diff --git a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp index 17fcd7f0e77..e2330e68ac2 100644 --- a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp @@ -114,11 +114,10 @@ StLinkUvscServerProvider::StLinkUvscServerProvider() setSupportedDrivers({"STLink\\ST-LINKIII-KEIL_SWO.dll"}); } -QVariantMap StLinkUvscServerProvider::toMap() const +void StLinkUvscServerProvider::toMap(QVariantMap &data) const { - QVariantMap data = UvscServerProvider::toMap(); + UvscServerProvider::toMap(data); data.insert(adapterOptionsKeyC, m_adapterOpts.toMap()); - return data; } bool StLinkUvscServerProvider::fromMap(const QVariantMap &data) diff --git a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.h index 26614c29bfb..ccfa675d47b 100644 --- a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.h @@ -39,7 +39,7 @@ public: class StLinkUvscServerProvider final : public UvscServerProvider { public: - QVariantMap toMap() const final; + void toMap(QVariantMap &data) const final; bool fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index a266ed7bfdc..e2df93596aa 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -147,13 +147,12 @@ FilePath UvscServerProvider::buildOptionsFilePath(DebuggerRunTool *runTool) cons return path; } -QVariantMap UvscServerProvider::toMap() const +void UvscServerProvider::toMap(QVariantMap &data) const { - QVariantMap data = IDebugServerProvider::toMap(); + IDebugServerProvider::toMap(data); data.insert(toolsIniKeyC, m_toolsIniFile.toSettings()); data.insert(deviceSelectionKeyC, m_deviceSelection.toMap()); data.insert(driverSelectionKeyC, m_driverSelection.toMap()); - return data; } bool UvscServerProvider::isValid() const diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h index 4c14ee7b7c1..512a0412668 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h @@ -48,7 +48,7 @@ public: bool operator==(const IDebugServerProvider &other) const override; - QVariantMap toMap() const override; + void toMap(QVariantMap &map) const override; bool aboutToRun(Debugger::DebuggerRunTool *runTool, QString &errorMessage) const final; ProjectExplorer::RunWorker *targetRunner(ProjectExplorer::RunControl *runControl) const final; diff --git a/src/plugins/baremetal/idebugserverprovider.cpp b/src/plugins/baremetal/idebugserverprovider.cpp index 80a733c1115..c3c82dedcf3 100644 --- a/src/plugins/baremetal/idebugserverprovider.cpp +++ b/src/plugins/baremetal/idebugserverprovider.cpp @@ -137,15 +137,13 @@ IDebugServerProviderConfigWidget *IDebugServerProvider::configurationWidget() co return m_configurationWidgetCreator(); } -QVariantMap IDebugServerProvider::toMap() const +void IDebugServerProvider::toMap(QVariantMap &data) const { - return { - {idKeyC, m_id}, - {displayNameKeyC, m_displayName}, - {engineTypeKeyC, m_engineType}, - {hostKeyC, m_channel.host()}, - {portKeyC, m_channel.port()}, - }; + data.insert(idKeyC, m_id); + data.insert(displayNameKeyC, m_displayName); + data.insert(engineTypeKeyC, m_engineType); + data.insert(hostKeyC, m_channel.host()); + data.insert(portKeyC, m_channel.port()); } void IDebugServerProvider::registerDevice(BareMetalDevice *device) diff --git a/src/plugins/baremetal/idebugserverprovider.h b/src/plugins/baremetal/idebugserverprovider.h index a936ad61421..c219b31e822 100644 --- a/src/plugins/baremetal/idebugserverprovider.h +++ b/src/plugins/baremetal/idebugserverprovider.h @@ -65,7 +65,7 @@ public: void setConfigurationWidgetCreator (const std::function<IDebugServerProviderConfigWidget *()> &configurationWidgetCreator); - virtual QVariantMap toMap() const; + virtual void toMap(QVariantMap &data) const; virtual bool fromMap(const QVariantMap &data); virtual bool aboutToRun(Debugger::DebuggerRunTool *runTool, From bc1ef0f158f2004fa4fd66752d7d51c857cc2b46 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 28 Jul 2023 14:58:33 +0200 Subject: [PATCH 0546/1777] BareMetal: Remove error return value from fromMap This was never used. Change-Id: Ic4474fe4a7e634409523407d351529bdde89f4af Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../debugservers/gdb/eblinkgdbserverprovider.cpp | 11 +++-------- .../debugservers/gdb/eblinkgdbserverprovider.h | 2 +- .../baremetal/debugservers/gdb/gdbserverprovider.cpp | 7 ++----- .../baremetal/debugservers/gdb/gdbserverprovider.h | 2 +- .../debugservers/gdb/jlinkgdbserverprovider.cpp | 7 ++----- .../debugservers/gdb/jlinkgdbserverprovider.h | 2 +- .../debugservers/gdb/openocdgdbserverprovider.cpp | 7 ++----- .../debugservers/gdb/openocdgdbserverprovider.h | 2 +- .../debugservers/gdb/stlinkutilgdbserverprovider.cpp | 7 ++----- .../debugservers/gdb/stlinkutilgdbserverprovider.h | 2 +- .../debugservers/uvsc/jlinkuvscserverprovider.cpp | 6 ++---- .../debugservers/uvsc/jlinkuvscserverprovider.h | 2 +- .../debugservers/uvsc/simulatoruvscserverprovider.cpp | 6 ++---- .../debugservers/uvsc/simulatoruvscserverprovider.h | 2 +- .../debugservers/uvsc/stlinkuvscserverprovider.cpp | 6 ++---- .../debugservers/uvsc/stlinkuvscserverprovider.h | 2 +- .../debugservers/uvsc/uvscserverprovider.cpp | 6 ++---- .../baremetal/debugservers/uvsc/uvscserverprovider.h | 2 +- src/plugins/baremetal/idebugserverprovider.cpp | 9 +++------ src/plugins/baremetal/idebugserverprovider.h | 2 +- 20 files changed, 32 insertions(+), 60 deletions(-) diff --git a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp index e955aa3ff21..b8071ce3a86 100644 --- a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp @@ -158,16 +158,13 @@ void EBlinkGdbServerProvider::toMap(QVariantMap &data) const data.insert(gdbNotUseCacheC, m_gdbNotUseCache); } -bool EBlinkGdbServerProvider::fromMap(const QVariantMap &data) +void EBlinkGdbServerProvider::fromMap(const QVariantMap &data) { - if (!GdbServerProvider::fromMap(data)) - return false; - + GdbServerProvider::fromMap(data); m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC)); m_verboseLevel = data.value(verboseLevelKeyC).toInt(); m_interfaceResetOnConnect = data.value(interfaceResetOnConnectC).toBool(); - m_interfaceType = static_cast<InterfaceType>( - data.value(interfaceTypeC).toInt()); + m_interfaceType = static_cast<InterfaceType>(data.value(interfaceTypeC).toInt()); m_deviceScript = FilePath::fromSettings(data.value(deviceScriptC)); m_interfaceResetOnConnect = data.value(interfaceResetOnConnectC).toBool(); m_interfaceSpeed = data.value(interfaceSpeedC).toInt(); @@ -176,8 +173,6 @@ bool EBlinkGdbServerProvider::fromMap(const QVariantMap &data) m_targetDisableStack = data.value(targetDisableStackC).toBool(); m_gdbShutDownAfterDisconnect = data.value(gdbShutDownAfterDisconnectC).toBool(); m_gdbNotUseCache = data.value(gdbNotUseCacheC).toBool(); - - return true; } bool EBlinkGdbServerProvider::operator==(const IDebugServerProvider &other) const diff --git a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.h index 5ee074bbcc7..efc794c8e0b 100644 --- a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.h @@ -22,7 +22,7 @@ public: enum InterfaceType { SWD, JTAG }; void toMap(QVariantMap &data) const final; - bool fromMap(const QVariantMap &data) final; + void fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp index 10f8842ae7f..8bd2b3fdcc2 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp @@ -179,17 +179,14 @@ RunWorker *GdbServerProvider::targetRunner(RunControl *runControl) const return new GdbServerProviderRunner(runControl, command()); } -bool GdbServerProvider::fromMap(const QVariantMap &data) +void GdbServerProvider::fromMap(const QVariantMap &data) { - if (!IDebugServerProvider::fromMap(data)) - return false; - + IDebugServerProvider::fromMap(data); m_startupMode = static_cast<StartupMode>(data.value(startupModeKeyC).toInt()); m_peripheralDescriptionFile = FilePath::fromSettings(data.value(peripheralDescriptionFileKeyC)); m_initCommands = data.value(initCommandsKeyC).toString(); m_resetCommands = data.value(resetCommandsKeyC).toString(); m_useExtendedRemote = data.value(useExtendedRemoteKeyC).toBool(); - return true; } // GdbServerProviderConfigWidget diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h index 6b3c91f2947..d4aba6fd9be 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h @@ -55,7 +55,7 @@ protected: void setResetCommands(const QString &); void setUseExtendedRemote(bool); - bool fromMap(const QVariantMap &data) override; + void fromMap(const QVariantMap &data) override; StartupMode m_startupMode = StartupOnNetwork; Utils::FilePath m_peripheralDescriptionFile; diff --git a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp index f923d79f75a..9b02e9742f5 100644 --- a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp @@ -130,11 +130,9 @@ void JLinkGdbServerProvider::toMap(QVariantMap &data) const data.insert(additionalArgumentsKeyC, m_additionalArguments); } -bool JLinkGdbServerProvider::fromMap(const QVariantMap &data) +void JLinkGdbServerProvider::fromMap(const QVariantMap &data) { - if (!GdbServerProvider::fromMap(data)) - return false; - + GdbServerProvider::fromMap(data); m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC)); m_jlinkDevice = data.value(jlinkDeviceKeyC).toString(); m_additionalArguments = data.value(additionalArgumentsKeyC).toString(); @@ -142,7 +140,6 @@ bool JLinkGdbServerProvider::fromMap(const QVariantMap &data) m_jlinkHostAddr = data.value(jlinkHostInterfaceIPAddressKeyC).toString(); m_jlinkTargetIface = data.value(jlinkTargetInterfaceKeyC).toString(); m_jlinkTargetIfaceSpeed = data.value(jlinkTargetInterfaceSpeedKeyC).toString(); - return true; } bool JLinkGdbServerProvider::operator==(const IDebugServerProvider &other) const diff --git a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.h index 3e490bfb852..75d9140a6ee 100644 --- a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.h @@ -19,7 +19,7 @@ class JLinkGdbServerProvider final : public GdbServerProvider { public: void toMap(QVariantMap &data) const final; - bool fromMap(const QVariantMap &data) final; + void fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; diff --git a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp index 5d746a29b4f..5ff5047c87b 100644 --- a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp @@ -134,16 +134,13 @@ void OpenOcdGdbServerProvider::toMap(QVariantMap &data) const data.insert(additionalArgumentsKeyC, m_additionalArguments); } -bool OpenOcdGdbServerProvider::fromMap(const QVariantMap &data) +void OpenOcdGdbServerProvider::fromMap(const QVariantMap &data) { - if (!GdbServerProvider::fromMap(data)) - return false; - + GdbServerProvider::fromMap(data); m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC)); m_rootScriptsDir = FilePath::fromSettings(data.value(rootScriptsDirKeyC)); m_configurationFile = FilePath::fromSettings(data.value(configurationFileKeyC)); m_additionalArguments = data.value(additionalArgumentsKeyC).toString(); - return true; } bool OpenOcdGdbServerProvider::operator==(const IDebugServerProvider &other) const diff --git a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.h index e45aa5aef7b..49884e4bb14 100644 --- a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.h @@ -19,7 +19,7 @@ class OpenOcdGdbServerProvider final : public GdbServerProvider { public: void toMap(QVariantMap &data) const final; - bool fromMap(const QVariantMap &data) final; + void fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; diff --git a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp index 4941c7732b7..66e1a67f980 100644 --- a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp @@ -124,11 +124,9 @@ void StLinkUtilGdbServerProvider::toMap(QVariantMap &data) const data.insert(connectUnderResetKeyC, m_connectUnderReset); } -bool StLinkUtilGdbServerProvider::fromMap(const QVariantMap &data) +void StLinkUtilGdbServerProvider::fromMap(const QVariantMap &data) { - if (!GdbServerProvider::fromMap(data)) - return false; - + GdbServerProvider::fromMap(data); m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC)); m_verboseLevel = data.value(verboseLevelKeyC).toInt(); m_extendedMode = data.value(extendedModeKeyC).toBool(); @@ -136,7 +134,6 @@ bool StLinkUtilGdbServerProvider::fromMap(const QVariantMap &data) m_transport = static_cast<TransportLayer>( data.value(transportLayerKeyC).toInt()); m_connectUnderReset = data.value(connectUnderResetKeyC).toBool(); - return true; } bool StLinkUtilGdbServerProvider::operator==(const IDebugServerProvider &other) const diff --git a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.h index 52b2642c19c..82f1bfa6b63 100644 --- a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.h @@ -22,7 +22,7 @@ public: enum TransportLayer { ScsiOverUsb = 1, RawUsb = 2, UnspecifiedTransport }; void toMap(QVariantMap &data) const final; - bool fromMap(const QVariantMap &data) final; + void fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; diff --git a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp index 22d0244cd78..78b05754481 100644 --- a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp @@ -164,12 +164,10 @@ void JLinkUvscServerProvider::toMap(QVariantMap &data) const data.insert(adapterOptionsKeyC, m_adapterOpts.toMap()); } -bool JLinkUvscServerProvider::fromMap(const QVariantMap &data) +void JLinkUvscServerProvider::fromMap(const QVariantMap &data) { - if (!UvscServerProvider::fromMap(data)) - return false; + UvscServerProvider::fromMap(data); m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).toMap()); - return true; } bool JLinkUvscServerProvider::operator==(const IDebugServerProvider &other) const diff --git a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.h index 19df028dd7f..5b989679922 100644 --- a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.h @@ -37,7 +37,7 @@ class JLinkUvscServerProvider final : public UvscServerProvider { public: void toMap(QVariantMap &data) const final; - bool fromMap(const QVariantMap &data) final; + void fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; Utils::FilePath optionsFilePath(Debugger::DebuggerRunTool *runTool, diff --git a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp index 188df6e9165..7f3824ccb80 100644 --- a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp @@ -69,12 +69,10 @@ void SimulatorUvscServerProvider::toMap(QVariantMap &data) const data.insert(limitSpeedKeyC, m_limitSpeed); } -bool SimulatorUvscServerProvider::fromMap(const QVariantMap &data) +void SimulatorUvscServerProvider::fromMap(const QVariantMap &data) { - if (!UvscServerProvider::fromMap(data)) - return false; + UvscServerProvider::fromMap(data); m_limitSpeed = data.value(limitSpeedKeyC).toBool(); - return true; } bool SimulatorUvscServerProvider::operator==(const IDebugServerProvider &other) const diff --git a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h index b80da20b1ec..96305b06a21 100644 --- a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h @@ -17,7 +17,7 @@ class SimulatorUvscServerProvider final : public UvscServerProvider { public: void toMap(QVariantMap &data) const final; - bool fromMap(const QVariantMap &data) final; + void fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; bool isSimulator() const final { return true; } diff --git a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp index e2330e68ac2..316adbb0fcd 100644 --- a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp @@ -120,12 +120,10 @@ void StLinkUvscServerProvider::toMap(QVariantMap &data) const data.insert(adapterOptionsKeyC, m_adapterOpts.toMap()); } -bool StLinkUvscServerProvider::fromMap(const QVariantMap &data) +void StLinkUvscServerProvider::fromMap(const QVariantMap &data) { - if (!UvscServerProvider::fromMap(data)) - return false; + UvscServerProvider::fromMap(data); m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).toMap()); - return true; } bool StLinkUvscServerProvider::operator==(const IDebugServerProvider &other) const diff --git a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.h index ccfa675d47b..6e6b2d9a1dd 100644 --- a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.h @@ -40,7 +40,7 @@ class StLinkUvscServerProvider final : public UvscServerProvider { public: void toMap(QVariantMap &data) const final; - bool fromMap(const QVariantMap &data) final; + void fromMap(const QVariantMap &data) final; bool operator==(const IDebugServerProvider &other) const final; Utils::FilePath optionsFilePath(Debugger::DebuggerRunTool *runTool, diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index e2df93596aa..bb894a688d7 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -219,14 +219,12 @@ ProjectExplorer::RunWorker *UvscServerProvider::targetRunner(RunControl *runCont return new UvscServerProviderRunner(runControl, r); } -bool UvscServerProvider::fromMap(const QVariantMap &data) +void UvscServerProvider::fromMap(const QVariantMap &data) { - if (!IDebugServerProvider::fromMap(data)) - return false; + IDebugServerProvider::fromMap(data); m_toolsIniFile = FilePath::fromSettings(data.value(toolsIniKeyC)); m_deviceSelection.fromMap(data.value(deviceSelectionKeyC).toMap()); m_driverSelection.fromMap(data.value(driverSelectionKeyC).toMap()); - return true; } FilePath UvscServerProvider::projectFilePath(DebuggerRunTool *runTool, QString &errorMessage) const diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h index 512a0412668..3363a519392 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h @@ -69,7 +69,7 @@ protected: Utils::FilePath buildProjectFilePath(Debugger::DebuggerRunTool *runTool) const; Utils::FilePath buildOptionsFilePath(Debugger::DebuggerRunTool *runTool) const; - bool fromMap(const QVariantMap &data) override; + void fromMap(const QVariantMap &data) override; // uVision specific stuff. virtual Utils::FilePath projectFilePath(Debugger::DebuggerRunTool *runTool, diff --git a/src/plugins/baremetal/idebugserverprovider.cpp b/src/plugins/baremetal/idebugserverprovider.cpp index c3c82dedcf3..6bf5ea8cb6e 100644 --- a/src/plugins/baremetal/idebugserverprovider.cpp +++ b/src/plugins/baremetal/idebugserverprovider.cpp @@ -166,7 +166,7 @@ void IDebugServerProvider::resetId() m_id = createId(m_id); } -bool IDebugServerProvider::fromMap(const QVariantMap &data) +void IDebugServerProvider::fromMap(const QVariantMap &data) { m_id = data.value(idKeyC).toString(); m_displayName = data.value(displayNameKeyC).toString(); @@ -174,7 +174,6 @@ bool IDebugServerProvider::fromMap(const QVariantMap &data) data.value(engineTypeKeyC, NoEngineType).toInt()); m_channel.setHost(data.value(hostKeyC).toString()); m_channel.setPort(data.value(portKeyC).toInt()); - return true; } void IDebugServerProvider::setConfigurationWidgetCreator(const std::function<IDebugServerProviderConfigWidget *()> &configurationWidgetCreator) @@ -209,10 +208,8 @@ IDebugServerProvider *IDebugServerProviderFactory::create() const IDebugServerProvider *IDebugServerProviderFactory::restore(const QVariantMap &data) const { IDebugServerProvider *p = m_creator(); - if (p->fromMap(data)) - return p; - delete p; - return nullptr; + p->fromMap(data); + return p; } bool IDebugServerProviderFactory::canRestore(const QVariantMap &data) const diff --git a/src/plugins/baremetal/idebugserverprovider.h b/src/plugins/baremetal/idebugserverprovider.h index c219b31e822..c28e8c50d8a 100644 --- a/src/plugins/baremetal/idebugserverprovider.h +++ b/src/plugins/baremetal/idebugserverprovider.h @@ -66,7 +66,7 @@ public: (const std::function<IDebugServerProviderConfigWidget *()> &configurationWidgetCreator); virtual void toMap(QVariantMap &data) const; - virtual bool fromMap(const QVariantMap &data); + virtual void fromMap(const QVariantMap &data); virtual bool aboutToRun(Debugger::DebuggerRunTool *runTool, QString &errorMessage) const = 0; From 7f908d737b0e017e65e917c65b19499f3093fa4c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 26 Jul 2023 18:29:20 +0200 Subject: [PATCH 0547/1777] Core: Move SystemSettings page closer to current setup Also align items a bit and use BaseAspect::setEnabler() where appropriate. Change-Id: I7497e3ce82f3685582a84b1bf383e65892d76f96 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/coreplugin/documentmanager.cpp | 4 +- .../editormanager/editormanager.cpp | 164 +---------- .../editormanager/editormanager_p.h | 36 +-- src/plugins/coreplugin/mainwindow.cpp | 22 +- src/plugins/coreplugin/mainwindow.h | 6 - src/plugins/coreplugin/systemsettings.cpp | 254 ++++++++++-------- src/plugins/coreplugin/systemsettings.h | 34 ++- 7 files changed, 182 insertions(+), 338 deletions(-) diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index b7b7ccfbe06..a529cb6ff98 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -22,6 +22,7 @@ #include <coreplugin/editormanager/ieditor.h> #include <coreplugin/editormanager/ieditorfactory.h> #include <coreplugin/editormanager/iexternaleditor.h> +#include <coreplugin/systemsettings.h> #include <extensionsystem/pluginmanager.h> @@ -1336,7 +1337,8 @@ void DocumentManager::addToRecentFiles(const FilePath &filePath, Id editorId) Utils::erase(d->m_recentFiles, [fileKey](const RecentFile &file) { return fileKey == filePathKey(file.first, DocumentManager::KeepLinks); }); - while (d->m_recentFiles.count() >= EditorManagerPrivate::maxRecentFiles()) + const int maxRecentFiles = systemSettings().maxRecentFiles(); + while (d->m_recentFiles.count() >= maxRecentFiles) d->m_recentFiles.removeLast(); d->m_recentFiles.prepend(RecentFile(filePath, editorId)); } diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 946355a0abc..fdcefe841b7 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -33,6 +33,7 @@ #include "../outputpanemanager.h" #include "../rightpane.h" #include "../settingsdatabase.h" +#include "../systemsettings.h" #include "../vcsmanager.h" #include <extensionsystem/pluginmanager.h> @@ -90,15 +91,6 @@ static const char kCurrentDocumentYPos[] = "CurrentDocument:YPos"; static const char kMakeWritableWarning[] = "Core.EditorManager.MakeWritable"; static const char documentStatesKey[] = "EditorManager/DocumentStates"; -static const char reloadBehaviorKey[] = "EditorManager/ReloadBehavior"; -static const char autoSaveEnabledKey[] = "EditorManager/AutoSaveEnabled"; -static const char autoSaveIntervalKey[] = "EditorManager/AutoSaveInterval"; -static const char autoSaveAfterRefactoringKey[] = "EditorManager/AutoSaveAfterRefactoring"; -static const char autoSuspendEnabledKey[] = "EditorManager/AutoSuspendEnabled"; -static const char autoSuspendMinDocumentCountKey[] = "EditorManager/AutoSuspendMinDocuments"; -static const char warnBeforeOpeningBigTextFilesKey[] = "EditorManager/WarnBeforeOpeningBigTextFiles"; -static const char bigTextFileSizeLimitKey[] = "EditorManager/BigTextFileSizeLimitInMB"; -static const char maxRecentFilesKey[] = "EditorManager/MaxRecentFiles"; static const char fileSystemCaseSensitivityKey[] = "Core/FileSystemCaseSensitivity"; static const char preferredEditorFactoriesKey[] = "EditorManager/PreferredEditorFactories"; @@ -732,7 +724,7 @@ EditorArea *EditorManagerPrivate::mainEditorArea() bool EditorManagerPrivate::skipOpeningBigTextFile(const FilePath &filePath) { - if (!d->m_settings.warnBeforeOpeningBigFilesEnabled) + if (!systemSettings().warnBeforeOpeningBigFiles()) return false; if (!filePath.exists()) @@ -745,7 +737,7 @@ bool EditorManagerPrivate::skipOpeningBigTextFile(const FilePath &filePath) const qint64 fileSize = filePath.fileSize(); const double fileSizeInMB = fileSize / 1000.0 / 1000.0; - if (fileSizeInMB > d->m_settings.bigFileSizeLimitInMB + if (fileSizeInMB > systemSettings().bigFileSizeLimitInMB() && fileSize < EditorManager::maxTextFileSize()) { const QString title = ::Core::Tr::tr("Continue Opening Huge Text File?"); const QString text = ::Core::Tr::tr( @@ -761,7 +753,7 @@ bool EditorManagerPrivate::skipOpeningBigTextFile(const FilePath &filePath) QMessageBox::StandardButton clickedButton = CheckableMessageBox::question(ICore::dialogParent(), title, text, decider); - setWarnBeforeOpeningBigFilesEnabled(askAgain); + systemSettings().warnBeforeOpeningBigFiles.setValue(askAgain); return clickedButton != QMessageBox::Yes; } @@ -1217,51 +1209,14 @@ void EditorManagerPrivate::saveSettings() { ICore::settingsDatabase()->setValue(documentStatesKey, d->m_editorStates); - const Settings def; QtcSettings *qsettings = ICore::settings(); - qsettings->setValueWithDefault(reloadBehaviorKey, - int(d->m_settings.reloadSetting), - int(def.reloadSetting)); - qsettings->setValueWithDefault(autoSaveEnabledKey, - d->m_settings.autoSaveEnabled, - def.autoSaveEnabled); - qsettings->setValueWithDefault(autoSaveIntervalKey, - d->m_settings.autoSaveInterval, - def.autoSaveInterval); - qsettings->setValueWithDefault(autoSaveAfterRefactoringKey, - d->m_settings.autoSaveAfterRefactoring, - def.autoSaveAfterRefactoring); - qsettings->setValueWithDefault(autoSuspendEnabledKey, - d->m_settings.autoSuspendEnabled, - def.autoSuspendEnabled); - qsettings->setValueWithDefault(autoSuspendMinDocumentCountKey, - d->m_settings.autoSuspendMinDocumentCount, - def.autoSuspendMinDocumentCount); - qsettings->setValueWithDefault(warnBeforeOpeningBigTextFilesKey, - d->m_settings.warnBeforeOpeningBigFilesEnabled, - def.warnBeforeOpeningBigFilesEnabled); - qsettings->setValueWithDefault(bigTextFileSizeLimitKey, - d->m_settings.bigFileSizeLimitInMB, - def.bigFileSizeLimitInMB); - qsettings->setValueWithDefault(maxRecentFilesKey, - d->m_settings.maxRecentFiles, - def.maxRecentFiles); qsettings->setValueWithDefault(preferredEditorFactoriesKey, toMap(userPreferredEditorTypes())); } void EditorManagerPrivate::readSettings() { - Settings def; QSettings *qs = ICore::settings(); - d->m_settings.warnBeforeOpeningBigFilesEnabled - = qs->value(warnBeforeOpeningBigTextFilesKey, def.warnBeforeOpeningBigFilesEnabled).toBool(); - d->m_settings.bigFileSizeLimitInMB - = qs->value(bigTextFileSizeLimitKey, def.bigFileSizeLimitInMB).toInt(); - - const int maxRecentFiles = qs->value(maxRecentFilesKey, def.maxRecentFiles).toInt(); - if (maxRecentFiles > 0) - d->m_settings.maxRecentFiles = maxRecentFiles; const Qt::CaseSensitivity defaultSensitivity = OsSpecificAspects::fileNameCaseSensitivity( HostOsInfo::hostOs()); @@ -1281,19 +1236,6 @@ void EditorManagerPrivate::readSettings() .value<QMap<QString, QVariant> >(); } - d->m_settings.reloadSetting = IDocument::ReloadSetting( - qs->value(reloadBehaviorKey, def.reloadSetting).toInt()); - - d->m_settings.autoSaveEnabled = qs->value(autoSaveEnabledKey, def.autoSaveEnabled).toBool(); - d->m_settings.autoSaveInterval = qs->value(autoSaveIntervalKey, def.autoSaveInterval).toInt(); - d->m_settings.autoSaveAfterRefactoring = qs->value(autoSaveAfterRefactoringKey, - def.autoSaveAfterRefactoring).toBool(); - - d->m_settings.autoSuspendEnabled = qs->value(autoSuspendEnabledKey, def.autoSuspendEnabled) - .toBool(); - d->m_settings.autoSuspendMinDocumentCount - = qs->value(autoSuspendMinDocumentCountKey, def.autoSuspendMinDocumentCount).toInt(); - updateAutoSave(); } @@ -1325,88 +1267,6 @@ void EditorManagerPrivate::writeFileSystemSensitivity(Utils::QtcSettings *settin HostOsInfo::hostOs()))); } -void EditorManagerPrivate::setAutoSaveEnabled(bool enabled) -{ - d->m_settings.autoSaveEnabled = enabled; - updateAutoSave(); -} - -bool EditorManagerPrivate::autoSaveEnabled() -{ - return d->m_settings.autoSaveEnabled; -} - -void EditorManagerPrivate::setAutoSaveInterval(int interval) -{ - d->m_settings.autoSaveInterval = interval; - updateAutoSave(); -} - -int EditorManagerPrivate::autoSaveInterval() -{ - return d->m_settings.autoSaveInterval; -} - -void EditorManagerPrivate::setAutoSaveAfterRefactoring(bool enabled) -{ - d->m_settings.autoSaveAfterRefactoring = enabled; -} - -bool EditorManagerPrivate::autoSaveAfterRefactoring() -{ - return d->m_settings.autoSaveAfterRefactoring; -} - -void EditorManagerPrivate::setAutoSuspendEnabled(bool enabled) -{ - d->m_settings.autoSuspendEnabled = enabled; -} - -bool EditorManagerPrivate::autoSuspendEnabled() -{ - return d->m_settings.autoSuspendEnabled; -} - -void EditorManagerPrivate::setAutoSuspendMinDocumentCount(int count) -{ - d->m_settings.autoSuspendMinDocumentCount = count; -} - -int EditorManagerPrivate::autoSuspendMinDocumentCount() -{ - return d->m_settings.autoSuspendMinDocumentCount; -} - -bool EditorManagerPrivate::warnBeforeOpeningBigFilesEnabled() -{ - return d->m_settings.warnBeforeOpeningBigFilesEnabled; -} - -void EditorManagerPrivate::setWarnBeforeOpeningBigFilesEnabled(bool enabled) -{ - d->m_settings.warnBeforeOpeningBigFilesEnabled = enabled; -} - -int EditorManagerPrivate::bigFileSizeLimit() -{ - return d->m_settings.bigFileSizeLimitInMB; -} - -void EditorManagerPrivate::setMaxRecentFiles(int count) -{ - d->m_settings.maxRecentFiles = count; -} - -int EditorManagerPrivate::maxRecentFiles() -{ - return d->m_settings.maxRecentFiles; -} - -void EditorManagerPrivate::setBigFileSizeLimit(int limitInMB) -{ - d->m_settings.bigFileSizeLimitInMB = limitInMB; -} - EditorFactoryList EditorManagerPrivate::findFactories(Id editorId, const FilePath &filePath) { if (debugEditorManager) @@ -2005,8 +1865,8 @@ void EditorManagerPrivate::addDocumentToRecentFiles(IDocument *document) void EditorManagerPrivate::updateAutoSave() { - if (d->m_settings.autoSaveEnabled) - d->m_autoSaveTimer->start(d->m_settings.autoSaveInterval * (60 * 1000)); + if (systemSettings().autoSaveModifiedFiles()) + d->m_autoSaveTimer->start(systemSettings().autoSaveInterval() * (60 * 1000)); else d->m_autoSaveTimer->stop(); } @@ -2595,20 +2455,21 @@ void EditorManagerPrivate::revertToSaved(IDocument *document) void EditorManagerPrivate::autoSuspendDocuments() { - if (!d->m_settings.autoSuspendEnabled) + if (!systemSettings().autoSuspendEnabled()) return; auto visibleDocuments = Utils::transform<QSet>(EditorManager::visibleEditors(), &IEditor::document); int keptEditorCount = 0; QList<IDocument *> documentsToSuspend; + const int minDocumentCount = systemSettings().autoSuspendMinDocumentCount(); for (const EditLocation &editLocation : std::as_const(d->m_globalHistory)) { IDocument *document = editLocation.document; if (!document || !document->isSuspendAllowed() || document->isModified() || document->isTemporary() || document->filePath().isEmpty() || visibleDocuments.contains(document)) continue; - if (keptEditorCount >= d->m_settings.autoSuspendMinDocumentCount) + if (keptEditorCount >= minDocumentCount) documentsToSuspend.append(document); else ++keptEditorCount; @@ -3001,7 +2862,8 @@ void EditorManager::runWithTemporaryEditor(const Utils::FilePath &filePath, */ IDocument::ReloadSetting EditorManager::reloadSetting() { - return d->m_settings.reloadSetting; + // FIXME: Used TypedSelectionAspect once we have that. + return IDocument::ReloadSetting(systemSettings().reloadSetting.value()); } /*! @@ -3011,7 +2873,7 @@ IDocument::ReloadSetting EditorManager::reloadSetting() */ void EditorManager::setReloadSetting(IDocument::ReloadSetting behavior) { - d->m_settings.reloadSetting = behavior; + systemSettings().reloadSetting.setValue(behavior); } /*! @@ -3228,7 +3090,7 @@ bool EditorManager::isAutoSaveFile(const QString &filePath) bool EditorManager::autoSaveAfterRefactoring() { - return EditorManagerPrivate::autoSaveAfterRefactoring(); + return systemSettings().autoSaveAfterRefactoring(); } /*! diff --git a/src/plugins/coreplugin/editormanager/editormanager_p.h b/src/plugins/coreplugin/editormanager/editormanager_p.h index 6ad61d3df47..3cae95ba96e 100644 --- a/src/plugins/coreplugin/editormanager/editormanager_p.h +++ b/src/plugins/coreplugin/editormanager/editormanager_p.h @@ -99,22 +99,6 @@ public: static Qt::CaseSensitivity readFileSystemSensitivity(QSettings *settings); static void writeFileSystemSensitivity(Utils::QtcSettings *settings, Qt::CaseSensitivity sensitivity); - static void setAutoSaveEnabled(bool enabled); - static bool autoSaveEnabled(); - static void setAutoSaveInterval(int interval); - static int autoSaveInterval(); - static void setAutoSaveAfterRefactoring(bool enabled); - static bool autoSaveAfterRefactoring(); - static void setAutoSuspendEnabled(bool enabled); - static bool autoSuspendEnabled(); - static void setAutoSuspendMinDocumentCount(int count); - static int autoSuspendMinDocumentCount(); - static void setWarnBeforeOpeningBigFilesEnabled(bool enabled); - static bool warnBeforeOpeningBigFilesEnabled(); - static void setBigFileSizeLimit(int limitInMB); - static int bigFileSizeLimit(); - static void setMaxRecentFiles(int count); - static int maxRecentFiles(); static EditorWindow *createEditorWindow(); static void splitNewWindow(Internal::EditorView *view); @@ -132,6 +116,8 @@ public: static void setPlaceholderText(const QString &text); static QString placeholderText(); + static void updateAutoSave(); + public slots: static bool saveDocument(Core::IDocument *document); static bool saveDocumentAs(Core::IDocument *document); @@ -191,7 +177,6 @@ private: static EditorArea *findEditorArea(const EditorView *view, int *areaIndex = nullptr); static IEditor *pickUnusedEditor(Internal::EditorView **foundView = nullptr); static void addDocumentToRecentFiles(IDocument *document); - static void updateAutoSave(); static void updateMakeWritableWarning(); static void setupSaveActions(IDocument *document, QAction *saveAction, QAction *saveAsAction, QAction *revertToSavedAction); @@ -263,23 +248,6 @@ private: EditorManager::WindowTitleHandler m_sessionTitleHandler; EditorManager::WindowTitleHandler m_titleVcsTopicHandler; - struct Settings - { - IDocument::ReloadSetting reloadSetting = IDocument::AlwaysAsk; - - bool autoSaveEnabled = true; - int autoSaveInterval = 5; - - bool autoSuspendEnabled = true; - int autoSuspendMinDocumentCount = 10; - - bool autoSaveAfterRefactoring = true; - bool warnBeforeOpeningBigFilesEnabled = true; - int bigFileSizeLimitInMB = 5; - int maxRecentFiles = 8; - }; - - Settings m_settings; QString m_placeholderText; QList<std::function<bool(IEditor *)>> m_closeEditorListeners; }; diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 805365e061d..5b3eaca50c0 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -103,7 +103,6 @@ namespace Internal { static const char settingsGroup[] = "MainWindow"; static const char colorKey[] = "Color"; -static const char askBeforeExitKey[] = "AskBeforeExit"; static const char windowGeometryKey[] = "WindowGeometry"; static const char windowStateKey[] = "WindowState"; static const char modeSelectorLayoutKey[] = "ModeSelectorLayout"; @@ -129,7 +128,6 @@ MainWindow::MainWindow() , m_jsExpander(JsExpander::createGlobalJsExpander()) , m_vcsManager(new VcsManager) , m_modeStack(new FancyTabWidget(this)) - , m_systemSettings(new SystemSettings) , m_shortcutSettings(new ShortcutSettings) , m_toolSettings(new ToolSettings) , m_mimeTypeSettings(new MimeTypeSettings) @@ -232,16 +230,6 @@ void MainWindow::setSidebarVisible(bool visible, Side side) navigationWidget(side)->setShown(visible); } -bool MainWindow::askConfirmationBeforeExit() const -{ - return m_askConfirmationBeforeExit; -} - -void MainWindow::setAskConfirmationBeforeExit(bool ask) -{ - m_askConfirmationBeforeExit = ask; -} - void MainWindow::setOverrideColor(const QColor &color) { m_overrideColor = color; @@ -275,8 +263,6 @@ MainWindow::~MainWindow() m_messageManager = nullptr; delete m_shortcutSettings; m_shortcutSettings = nullptr; - delete m_systemSettings; - m_systemSettings = nullptr; delete m_toolSettings; m_toolSettings = nullptr; delete m_mimeTypeSettings; @@ -376,7 +362,7 @@ void MainWindow::closeEvent(QCloseEvent *event) return; } - if (m_askConfirmationBeforeExit + if (systemSettings().askBeforeExit() && (QMessageBox::question(this, Tr::tr("Exit %1?").arg(QGuiApplication::applicationDisplayName()), Tr::tr("Exit %1?").arg(QGuiApplication::applicationDisplayName()), @@ -1181,8 +1167,6 @@ void MainWindow::readSettings() QColor(StyleHelper::DEFAULT_BASE_COLOR)).value<QColor>()); } - m_askConfirmationBeforeExit = settings->value(askBeforeExitKey, askBeforeExitDefault).toBool(); - { ModeManager::Style modeStyle = ModeManager::Style(settings->value(modeSelectorLayoutKey, int(ModeManager::Style::IconsAndText)).toInt()); @@ -1216,10 +1200,6 @@ void MainWindow::saveSettings() StyleHelper::requestedBaseColor(), QColor(StyleHelper::DEFAULT_BASE_COLOR)); - settings->setValueWithDefault(askBeforeExitKey, - m_askConfirmationBeforeExit, - askBeforeExitDefault); - settings->endGroup(); DocumentManager::saveSettings(); diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index 8691e771e2e..0755fae3e45 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -50,7 +50,6 @@ class MimeTypeSettings; class VersionDialog; class WindowSupport; class SystemEditor; -class SystemSettings; class MainWindow : public Utils::AppMainWindow { @@ -81,9 +80,6 @@ public: void updateAdditionalContexts(const Context &remove, const Context &add, ICore::ContextPriority priority); - bool askConfirmationBeforeExit() const; - void setAskConfirmationBeforeExit(bool ask); - void setOverrideColor(const QColor &color); QStringList additionalAboutInformation() const; @@ -160,7 +156,6 @@ private: std::unordered_map<QWidget *, IContext *> m_contextWidgets; - SystemSettings *m_systemSettings = nullptr; ShortcutSettings *m_shortcutSettings = nullptr; ToolSettings *m_toolSettings = nullptr; MimeTypeSettings *m_mimeTypeSettings = nullptr; @@ -186,7 +181,6 @@ private: QToolButton *m_toggleLeftSideBarButton = nullptr; QToolButton *m_toggleRightSideBarButton = nullptr; - bool m_askConfirmationBeforeExit = false; QColor m_overrideColor; QList<std::function<bool()>> m_preCloseListeners; }; diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index af34c668cf1..18c8908149a 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -8,6 +8,7 @@ #include "coreplugintr.h" #include "editormanager/editormanager_p.h" #include "dialogs/restartdialog.h" +#include "dialogs/ioptionspage.h" #include "fileutils.h" #include "icore.h" #include "iversioncontrol.h" @@ -40,13 +41,9 @@ using namespace Utils; using namespace Layouting; -namespace Core { -namespace Internal { +namespace Core::Internal { #ifdef ENABLE_CRASHPAD -const char crashReportingEnabledKey[] = "CrashReportingEnabled"; -const char showCrashButtonKey[] = "ShowCrashButton"; - // TODO: move to somewhere in Utils static QString formatSize(qint64 size) { @@ -63,55 +60,128 @@ static QString formatSize(qint64 size) } #endif // ENABLE_CRASHPAD +SystemSettings &systemSettings() +{ + static SystemSettings theSettings; + return theSettings; +} + +SystemSettings::SystemSettings() +{ + setAutoApply(false); + + autoSaveModifiedFiles.setSettingsKey("EditorManager/AutoSaveEnabled"); + autoSaveModifiedFiles.setDefaultValue(true); + autoSaveModifiedFiles.setLabelText(Tr::tr("Auto-save modified files")); + autoSaveModifiedFiles.setLabelPlacement( + BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + autoSaveModifiedFiles.setToolTip( + Tr::tr("Automatically creates temporary copies of modified files. " + "If %1 is restarted after a crash or power failure, it asks whether to " + "recover the auto-saved content.") + .arg(QGuiApplication::applicationDisplayName())); + + autoSaveInterval.setSettingsKey("EditorManager/AutoSaveInterval"); + autoSaveInterval.setSuffix(Tr::tr("min")); + autoSaveInterval.setRange(1, 1000000); + autoSaveInterval.setDefaultValue(5); + autoSaveInterval.setEnabler(&autoSaveModifiedFiles); + autoSaveInterval.setLabelText(Tr::tr("Interval:")); + + autoSaveAfterRefactoring.setSettingsKey("EditorManager/AutoSaveAfterRefactoring"); + autoSaveAfterRefactoring.setDefaultValue(true); + autoSaveAfterRefactoring.setLabelPlacement( + BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + autoSaveAfterRefactoring.setLabelText(Tr::tr("Auto-save files after refactoring")); + autoSaveAfterRefactoring.setToolTip( + Tr::tr("Automatically saves all open files affected by a refactoring operation,\n" + "provided they were unmodified before the refactoring.")); + + autoSuspendEnabled.setSettingsKey("EditorManager/AutoSuspendEnabled"); + autoSuspendEnabled.setDefaultValue(true); + autoSuspendEnabled.setLabelText(Tr::tr("Auto-suspend unmodified files")); + autoSuspendEnabled.setLabelPlacement( + BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + autoSuspendEnabled.setToolTip( + Tr::tr("Automatically free resources of old documents that are not visible and not " + "modified. They stay visible in the list of open documents.")); + + autoSuspendMinDocumentCount.setSettingsKey("EditorManager/AutoSuspendMinDocuments"); + autoSuspendMinDocumentCount.setRange(1, 500); + autoSuspendMinDocumentCount.setDefaultValue(30); + autoSuspendMinDocumentCount.setEnabler(&autoSuspendEnabled); + autoSuspendMinDocumentCount.setLabelText(Tr::tr("Files to keep open:")); + autoSuspendMinDocumentCount.setToolTip( + Tr::tr("Minimum number of open documents that should be kept in memory. Increasing this " + "number will lead to greater resource usage when not manually closing documents.")); + + warnBeforeOpeningBigFiles.setSettingsKey("EditorManager/WarnBeforeOpeningBigTextFiles"); + warnBeforeOpeningBigFiles.setDefaultValue(true); + warnBeforeOpeningBigFiles.setLabelPlacement( + BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + warnBeforeOpeningBigFiles.setLabelText(Tr::tr("Warn before opening text files greater than")); + + bigFileSizeLimitInMB.setSettingsKey("EditorManager/BigTextFileSizeLimitInMB"); + bigFileSizeLimitInMB.setSuffix(Tr::tr("MB")); + bigFileSizeLimitInMB.setRange(1, 500); + bigFileSizeLimitInMB.setDefaultValue(5); + bigFileSizeLimitInMB.setEnabler(&warnBeforeOpeningBigFiles); + + maxRecentFiles.setSettingsKey("EditorManager/MaxRecentFiles"); + maxRecentFiles.setRange(1, 99); + maxRecentFiles.setDefaultValue(8); + + reloadSetting.setSettingsKey("EditorManager/ReloadBehavior"); + reloadSetting.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + reloadSetting.addOption(Tr::tr("Always Ask")); + reloadSetting.addOption(Tr::tr("Reload All Unchanged Editors")); + reloadSetting.addOption(Tr::tr("Ignore Modifications")); + reloadSetting.setDefaultValue(IDocument::AlwaysAsk); + reloadSetting.setLabelText(Tr::tr("When files are externally modified:")); + + askBeforeExit.setSettingsKey("AskBeforeExit"); + askBeforeExit.setLabelText(Tr::tr("Ask for confirmation before exiting")); + askBeforeExit.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + +#ifdef ENABLE_CRASHPAD + enableCrashReporting.setSettingsKey("CrashReportingEnabled"); + enableCrashReporting.setLabelText(tr("Enable crash reporting")); + enableCrashReporting.setToolTip( + Tr::tr("Allow crashes to be automatically reported. Collected reports are " + "used for the sole purpose of fixing bugs.")); + + showCrashButton.setSettingsKey("ShowCrashButton"); +#endif + + const auto updateAutoSave = [] { EditorManagerPrivate::updateAutoSave(); }; + connect(&autoSaveModifiedFiles, &BaseAspect::changed, this, updateAutoSave); + connect(&autoSaveInterval, &BaseAspect::changed, this, updateAutoSave); + + readSettings(); +} + class SystemSettingsWidget : public IOptionsPageWidget { public: SystemSettingsWidget() : m_fileSystemCaseSensitivityChooser(new QComboBox) - , m_autoSuspendMinDocumentCount(new QSpinBox) , m_externalFileBrowserEdit(new QLineEdit) - , m_autoSuspendCheckBox(new QCheckBox(Tr::tr("Auto-suspend unmodified files"))) - , m_maxRecentFilesSpinBox(new QSpinBox) - , m_enableCrashReportingCheckBox(new QCheckBox(Tr::tr("Enable crash reporting"))) - , m_warnBeforeOpeningBigFiles( - new QCheckBox(Tr::tr("Warn before opening text files greater than"))) - , m_bigFilesLimitSpinBox(new QSpinBox) , m_terminalComboBox(new QComboBox) , m_terminalOpenArgs(new QLineEdit) , m_terminalExecuteArgs(new QLineEdit) , m_patchChooser(new Utils::PathChooser) , m_environmentChangesLabel(new Utils::ElidingLabel) - , m_askBeforeExitCheckBox(new QCheckBox(Tr::tr("Ask for confirmation before exiting"))) - , m_reloadBehavior(new QComboBox) - , m_autoSaveCheckBox(new QCheckBox(Tr::tr("Auto-save modified files"))) , m_clearCrashReportsButton(new QPushButton(Tr::tr("Clear Local Crash Reports"))) , m_crashReportsSizeText(new QLabel) - , m_autoSaveInterval(new QSpinBox) - , m_autoSaveRefactoringCheckBox(new QCheckBox(Tr::tr("Auto-save files after refactoring"))) { - m_autoSuspendCheckBox->setToolTip( - Tr::tr("Automatically free resources of old documents that are not visible and not " - "modified. They stay visible in the list of open documents.")); - m_autoSuspendMinDocumentCount->setMinimum(1); - m_autoSuspendMinDocumentCount->setMaximum(500); - m_autoSuspendMinDocumentCount->setValue(30); - m_enableCrashReportingCheckBox->setToolTip( - Tr::tr("Allow crashes to be automatically reported. Collected reports are " - "used for the sole purpose of fixing bugs.")); - m_bigFilesLimitSpinBox->setSuffix(Tr::tr("MB")); - m_bigFilesLimitSpinBox->setMinimum(1); - m_bigFilesLimitSpinBox->setMaximum(500); - m_bigFilesLimitSpinBox->setValue(5); + SystemSettings &s = systemSettings(); + m_terminalExecuteArgs->setToolTip( Tr::tr("Command line arguments used for \"Run in terminal\".")); QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(5); m_environmentChangesLabel->setSizePolicy(sizePolicy); - m_reloadBehavior->addItem(Tr::tr("Always Ask")); - m_reloadBehavior->addItem(Tr::tr("Reload All Unchanged Editors")); - m_reloadBehavior->addItem(Tr::tr("Ignore Modifications")); - m_autoSaveInterval->setSuffix(Tr::tr("min")); QSizePolicy termSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed); termSizePolicy.setHorizontalStretch(3); m_terminalComboBox->setSizePolicy(termSizePolicy); @@ -119,15 +189,10 @@ public: m_terminalComboBox->setEditable(true); m_terminalOpenArgs->setToolTip( Tr::tr("Command line arguments used for \"%1\".").arg(FileUtils::msgTerminalHereAction())); - m_autoSaveInterval->setMinimum(1); auto fileSystemCaseSensitivityLabel = new QLabel(Tr::tr("File system case sensitivity:")); fileSystemCaseSensitivityLabel->setToolTip( Tr::tr("Influences how file names are matched to decide if they are the same.")); - auto autoSuspendLabel = new QLabel(Tr::tr("Files to keep open:")); - autoSuspendLabel->setToolTip( - Tr::tr("Minimum number of open documents that should be kept in memory. Increasing this " - "number will lead to greater resource usage when not manually closing documents.")); auto resetFileBrowserButton = new QPushButton(Tr::tr("Reset")); resetFileBrowserButton->setToolTip(Tr::tr("Reset to default.")); auto helpExternalFileBrowserButton = new QToolButton; @@ -164,21 +229,16 @@ public: form.addRow({fileSystemCaseSensitivityLabel, Span(2, Row{m_fileSystemCaseSensitivityChooser, st})}); } - form.addRow( - {Tr::tr("When files are externally modified:"), Span(2, Row{m_reloadBehavior, st})}); - form.addRow( - {m_autoSaveCheckBox, Span(2, Row{Tr::tr("Interval:"), m_autoSaveInterval, st})}); - form.addRow({Span(3, m_autoSaveRefactoringCheckBox)}); - form.addRow({m_autoSuspendCheckBox, - Span(2, Row{autoSuspendLabel, m_autoSuspendMinDocumentCount, st})}); - form.addRow({Span(3, Row{m_warnBeforeOpeningBigFiles, m_bigFilesLimitSpinBox, st})}); - form.addRow({Span(3, - Row{Tr::tr("Maximum number of entries in \"Recent Files\":"), - m_maxRecentFilesSpinBox, - st})}); - form.addRow({m_askBeforeExitCheckBox}); + form.addRow({s.reloadSetting, st}); + form.addRow({s.autoSaveModifiedFiles, Span(2, Row{s.autoSaveInterval, st})}); + form.addRow({Span(3, s.autoSaveAfterRefactoring)}); + form.addRow({s.autoSuspendEnabled, Span(2, Row{s.autoSuspendMinDocumentCount, st})}); + form.addRow({s.warnBeforeOpeningBigFiles, Span(2, Row{s.bigFileSizeLimitInMB, st})}); + form.addRow({Tr::tr("Maximum number of entries in \"Recent Files\":"), + Span(2, Row{s.maxRecentFiles, st})}); + form.addRow({s.askBeforeExit}); #ifdef ENABLE_CRASHPAD - form.addRow({Span(3, Row{m_enableCrashReportingCheckBox, helpCrashReportingButton, st})}); + form.addRow({Span(3, Row{s.enableCrashReporting, helpCrashReportingButton, st})}); form.addRow({Span(3, Row{m_clearCrashReportsButton, m_crashReportsSizeText, st})}); #endif @@ -189,7 +249,6 @@ public: } }.attachTo(this); - m_reloadBehavior->setCurrentIndex(EditorManager::reloadSetting()); if (HostOsInfo::isAnyUnixHost()) { const QVector<TerminalCommand> availableTerminals = TerminalCommand::availableTerminalEmulators(); @@ -211,28 +270,9 @@ public: m_patchChooser->setExpectedKind(PathChooser::ExistingCommand); m_patchChooser->setHistoryCompleter(QLatin1String("General.PatchCommand.History")); m_patchChooser->setFilePath(PatchTool::patchCommand()); - m_autoSaveCheckBox->setChecked(EditorManagerPrivate::autoSaveEnabled()); - m_autoSaveCheckBox->setToolTip(Tr::tr("Automatically creates temporary copies of " - "modified files. If %1 is restarted after " - "a crash or power failure, it asks whether to " - "recover the auto-saved content.") - .arg(QGuiApplication::applicationDisplayName())); - m_autoSaveRefactoringCheckBox->setChecked(EditorManager::autoSaveAfterRefactoring()); - m_autoSaveRefactoringCheckBox->setToolTip( - Tr::tr("Automatically saves all open files " - "affected by a refactoring operation,\nprovided they were unmodified before the " - "refactoring.")); - m_autoSaveInterval->setValue(EditorManagerPrivate::autoSaveInterval()); - m_autoSuspendCheckBox->setChecked(EditorManagerPrivate::autoSuspendEnabled()); - m_autoSuspendMinDocumentCount->setValue(EditorManagerPrivate::autoSuspendMinDocumentCount()); - m_warnBeforeOpeningBigFiles->setChecked( - EditorManagerPrivate::warnBeforeOpeningBigFilesEnabled()); - m_bigFilesLimitSpinBox->setValue(EditorManagerPrivate::bigFileSizeLimit()); - m_maxRecentFilesSpinBox->setMinimum(1); - m_maxRecentFilesSpinBox->setMaximum(99); - m_maxRecentFilesSpinBox->setValue(EditorManagerPrivate::maxRecentFiles()); + #ifdef ENABLE_CRASHPAD - if (ICore::settings()->value(showCrashButtonKey).toBool()) { + if (s.showCrashButton()) { auto crashButton = new QPushButton("CRASH!!!"); crashButton->show(); connect(crashButton, &QPushButton::clicked, [] { @@ -241,12 +281,10 @@ public: }); } - m_enableCrashReportingCheckBox->setChecked( - ICore::settings()->value(crashReportingEnabledKey).toBool()); connect(helpCrashReportingButton, &QAbstractButton::clicked, this, [this] { showHelpDialog(Tr::tr("Crash Reporting"), CorePlugin::msgCrashpadInformation()); }); - connect(m_enableCrashReportingCheckBox, &QCheckBox::stateChanged, this, [this] { + connect(&s.enableCrashReporting, &BaseAspect::changed, this, [this] { const QString restartText = Tr::tr("The change will take effect after restart."); Core::RestartDialog restartDialog(Core::ICore::dialogParent(), restartText); restartDialog.exec(); @@ -263,10 +301,6 @@ public: }); #endif - m_askBeforeExitCheckBox->setChecked( - static_cast<Core::Internal::MainWindow *>(ICore::mainWindow()) - ->askConfirmationBeforeExit()); - if (HostOsInfo::isAnyUnixHost()) { connect(resetTerminalButton, &QAbstractButton::clicked, @@ -342,33 +376,24 @@ private: void showHelpDialog(const QString &title, const QString &helpText); QComboBox *m_fileSystemCaseSensitivityChooser; - QSpinBox *m_autoSuspendMinDocumentCount; QLineEdit *m_externalFileBrowserEdit; - QCheckBox *m_autoSuspendCheckBox; - QSpinBox *m_maxRecentFilesSpinBox; - QCheckBox *m_enableCrashReportingCheckBox; - QCheckBox *m_warnBeforeOpeningBigFiles; - QSpinBox *m_bigFilesLimitSpinBox; QComboBox *m_terminalComboBox; QLineEdit *m_terminalOpenArgs; QLineEdit *m_terminalExecuteArgs; Utils::PathChooser *m_patchChooser; Utils::ElidingLabel *m_environmentChangesLabel; - QCheckBox *m_askBeforeExitCheckBox; - QComboBox *m_reloadBehavior; - QCheckBox *m_autoSaveCheckBox; QPushButton *m_clearCrashReportsButton; QLabel *m_crashReportsSizeText; - QSpinBox *m_autoSaveInterval; - QCheckBox *m_autoSaveRefactoringCheckBox; QPointer<QMessageBox> m_dialog; EnvironmentItems m_environmentChanges; }; void SystemSettingsWidget::apply() { + systemSettings().apply(); + systemSettings().writeSettings(); + QtcSettings *settings = ICore::settings(); - EditorManager::setReloadSetting(IDocument::ReloadSetting(m_reloadBehavior->currentIndex())); if (HostOsInfo::isAnyUnixHost()) { TerminalCommand::setTerminalEmulator({ FilePath::fromUserInput(m_terminalComboBox->lineEdit()->text()), @@ -380,22 +405,6 @@ void SystemSettingsWidget::apply() } } PatchTool::setPatchCommand(m_patchChooser->filePath()); - EditorManagerPrivate::setAutoSaveEnabled(m_autoSaveCheckBox->isChecked()); - EditorManagerPrivate::setAutoSaveInterval(m_autoSaveInterval->value()); - EditorManagerPrivate::setAutoSaveAfterRefactoring(m_autoSaveRefactoringCheckBox->isChecked()); - EditorManagerPrivate::setAutoSuspendEnabled(m_autoSuspendCheckBox->isChecked()); - EditorManagerPrivate::setAutoSuspendMinDocumentCount(m_autoSuspendMinDocumentCount->value()); - EditorManagerPrivate::setWarnBeforeOpeningBigFilesEnabled( - m_warnBeforeOpeningBigFiles->isChecked()); - EditorManagerPrivate::setBigFileSizeLimit(m_bigFilesLimitSpinBox->value()); - EditorManagerPrivate::setMaxRecentFiles(m_maxRecentFilesSpinBox->value()); -#ifdef ENABLE_CRASHPAD - ICore::settings()->setValue(crashReportingEnabledKey, - m_enableCrashReportingCheckBox->isChecked()); -#endif - - static_cast<Core::Internal::MainWindow *>(ICore::mainWindow()) - ->setAskConfirmationBeforeExit(m_askBeforeExitCheckBox->isChecked()); if (HostOsInfo::isMacHost()) { const Qt::CaseSensitivity sensitivity = EditorManagerPrivate::readFileSystemSensitivity( @@ -487,13 +496,20 @@ void SystemSettingsWidget::showHelpForFileBrowser() showHelpDialog(Tr::tr("Variables"), UnixUtils::fileBrowserHelpText()); } -SystemSettings::SystemSettings() -{ - setId(Constants::SETTINGS_ID_SYSTEM); - setDisplayName(Tr::tr("System")); - setCategory(Constants::SETTINGS_CATEGORY_CORE); - setWidgetCreator([] { return new SystemSettingsWidget; }); -} +// SystemSettingsPage -} // namespace Internal -} // namespace Core +class SystemSettingsPage final : public IOptionsPage +{ +public: + SystemSettingsPage() + { + setId(Constants::SETTINGS_ID_SYSTEM); + setDisplayName(Tr::tr("System")); + setCategory(Constants::SETTINGS_CATEGORY_CORE); + setWidgetCreator([] { return new SystemSettingsWidget; }); + } +}; + +const SystemSettingsPage settingsPage; + +} // Core::Internal diff --git a/src/plugins/coreplugin/systemsettings.h b/src/plugins/coreplugin/systemsettings.h index c28c47e990c..18126e29fc9 100644 --- a/src/plugins/coreplugin/systemsettings.h +++ b/src/plugins/coreplugin/systemsettings.h @@ -3,16 +3,38 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/aspects.h> -namespace Core { -namespace Internal { +namespace Core::Internal { -class SystemSettings final : public IOptionsPage +class SystemSettings final : public Utils::AspectContainer { public: SystemSettings(); + + Utils::BoolAspect autoSaveModifiedFiles{this}; + Utils::IntegerAspect autoSaveInterval{this}; + + Utils::BoolAspect autoSaveAfterRefactoring{this}; + + Utils::BoolAspect autoSuspendEnabled{this}; + Utils::IntegerAspect autoSuspendMinDocumentCount{this}; + + Utils::BoolAspect warnBeforeOpeningBigFiles{this}; + Utils::IntegerAspect bigFileSizeLimitInMB{this}; + + Utils::IntegerAspect maxRecentFiles{this}; + + Utils::SelectionAspect reloadSetting{this}; + +#ifdef ENABLE_CRASHPAD + Utils::BoolAspect enableCrashReporting{this}; + Utils::BoolAspect showCrashButton{this}; +#endif + + Utils::BoolAspect askBeforeExit{this}; }; -} // namespace Internal -} // namespace Core +SystemSettings &systemSettings(); + +} // Core::Internal From f0ba7bbbea455e0c27bd5c28f05bbd05d7ca9eca Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Date: Tue, 18 Jul 2023 22:28:37 +0900 Subject: [PATCH 0548/1777] QtQuick Application wizard: Remove unused import Window belongs to QtQuick module in Qt 6 Change-Id: I8ff75320d84927db1fc79ba64538a3396203d36a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../templates/wizards/projects/qtquickapplication/Main.qml.tpl | 1 - 1 file changed, 1 deletion(-) diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/Main.qml.tpl b/share/qtcreator/templates/wizards/projects/qtquickapplication/Main.qml.tpl index e1a6ccc8c31..378557b3df0 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/Main.qml.tpl +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/Main.qml.tpl @@ -1,5 +1,4 @@ import QtQuick -import QtQuick.Window @if %{UseVirtualKeyboard} import QtQuick.VirtualKeyboard @endif From 59a67022710c20fcbaf17af0eb124df7aa66c6a9 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 28 Jul 2023 15:56:08 +0200 Subject: [PATCH 0549/1777] Wizards: Enforce use of #pragma once in the Creator Plugin template This should match Creator style, no matter what the users uses for own projects. Change-Id: I32e052b24ed6d029cd3c7a466bdf8191d1657e4e Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../templates/wizards/qtcreatorplugin/myplugin.h | 9 --------- .../wizards/qtcreatorplugin/myplugin_global.h | 9 --------- .../wizards/qtcreatorplugin/mypluginconstants.h | 15 ++------------- .../templates/wizards/qtcreatorplugin/wizard.json | 5 +---- 4 files changed, 3 insertions(+), 35 deletions(-) diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h index 6644f4685fd..f605c10da97 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h @@ -1,9 +1,4 @@ -@if '%{Cpp:PragmaOnce}' #pragma once -@else -#ifndef %{GUARD} -#define %{GUARD} -@endif #include "%{GlobalHdrFileName}" @@ -29,7 +24,3 @@ private: }; } // namespace %{PluginName}::Internal - -@if ! '%{Cpp:PragmaOnce}' -#endif // %{GUARD} -@endif diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin_global.h b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin_global.h index ad863f17945..a81c8fcee0d 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin_global.h +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin_global.h @@ -1,10 +1,5 @@ %{Cpp:LicenseTemplate}\ -@if '%{Cpp:PragmaOnce}' #pragma once -@else -#ifndef %{GLOBAL_GUARD} -#define %{GLOBAL_GUARD} -@endif #include <qglobal.h> @@ -13,7 +8,3 @@ #else # define %{LibraryExport} Q_DECL_IMPORT #endif -@if ! '%{Cpp:PragmaOnce}' - -#endif // %{GLOBAL_GUARD} -@endif diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/mypluginconstants.h b/share/qtcreator/templates/wizards/qtcreatorplugin/mypluginconstants.h index 699e49b2954..a5822a337e7 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/mypluginconstants.h +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/mypluginconstants.h @@ -1,20 +1,9 @@ %{Cpp:LicenseTemplate}\ -@if '%{Cpp:PragmaOnce}' #pragma once -@else -#ifndef %{CONSTANTS_GUARD} -#define %{CONSTANTS_GUARD} -@endif -namespace %{PluginName} { -namespace Constants { +namespace %{PluginName}::Constants { const char ACTION_ID[] = "%{PluginName}.Action"; const char MENU_ID[] = "%{PluginName}.Menu"; -} // namespace Constants -} // namespace %{PluginName} - -@if ! '%{Cpp:PragmaOnce}' -#endif // %{CONSTANTS_GUARD} -@endif +} // namespace %{PluginName}::Constants diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.json b/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.json index 95549b2cd99..6bbc9ce8038 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.json +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.json @@ -23,10 +23,7 @@ { "key": "GlobalHdrFileName", "value": "%{JS: Util.fileName(value('PluginNameLower') + '_global', Util.preferredSuffix('text/x-c++hdr'))}" }, { "key": "ConstantsHdrFileName", "value": "%{JS: Util.fileName(value('PluginNameLower') + 'constants', Util.preferredSuffix('text/x-c++hdr'))}" }, { "key": "CN", "value": "%{JS: Cpp.className(value('PluginName') + 'Plugin')}" }, - { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('CN'), Util.suffix(value('HdrFileName')))}" }, - { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" }, - { "key": "GLOBAL_GUARD", "value": "%{JS: Cpp.headerGuard(value('GlobalHdrFileName'))}" }, - { "key": "CONSTANTS_GUARD", "value": "%{JS: Cpp.headerGuard(value('ConstantsHdrFileName'))}" } + { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" } ], "pages": From 5a2e6c9a9b498072dad5becc8a8f9057060b68d7 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 27 Jul 2023 15:20:04 +0200 Subject: [PATCH 0550/1777] QbsRequest: Implement request queuing Change-Id: I33b33026aab34c06a2a4dd8c45f9c848c66de74b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/qbsprojectmanager/qbsrequest.cpp | 132 +++++++++++++++++-- src/plugins/qbsprojectmanager/qbsrequest.h | 9 +- 2 files changed, 122 insertions(+), 19 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsrequest.cpp b/src/plugins/qbsprojectmanager/qbsrequest.cpp index 78624cfcead..a2b185f832b 100644 --- a/src/plugins/qbsprojectmanager/qbsrequest.cpp +++ b/src/plugins/qbsprojectmanager/qbsrequest.cpp @@ -3,7 +3,6 @@ #include "qbsrequest.h" -#include "qbsprojectmanagertr.h" #include "qbssession.h" #include <projectexplorer/task.h> @@ -17,26 +16,99 @@ using namespace Utils; namespace QbsProjectManager::Internal { -QbsRequest::~QbsRequest() +class QbsRequestManager : public QObject { - if (m_isRunning) - m_session->cancelCurrentJob(); +public: + void sendRequest(QbsRequestObject *requestObject); + void cancelRequest(QbsRequestObject *requestObject); + +private: + void continueSessionQueue(QbsSession *session); + + QHash<QObject *, QList<QbsRequestObject *>> m_queuedRequests; +}; + +class QbsRequestObject final : public QObject +{ + Q_OBJECT + +public: + void setSession(QbsSession *session) { m_session = session; } + QbsSession *session() const { return m_session; } + void setRequestData(const QJsonObject &requestData) { m_requestData = requestData; } + void start(); + +signals: + void done(bool success); + void progressChanged(int progress, const QString &info); // progress in % + void outputAdded(const QString &output, ProjectExplorer::BuildStep::OutputFormat format); + void taskAdded(const ProjectExplorer::Task &task); + +private: + QbsSession *m_session = nullptr; + QJsonObject m_requestData; + QString m_description; + int m_maxProgress = 100; +}; + +void QbsRequestManager::sendRequest(QbsRequestObject *requestObject) +{ + QbsSession *session = requestObject->session(); + QList<QbsRequestObject *> &queue = m_queuedRequests[session]; + if (queue.isEmpty()) { + connect(session, &QObject::destroyed, this, [this, session] { + qDeleteAll(m_queuedRequests.value(session)); + m_queuedRequests.remove(session); + }); + } + queue.append(requestObject); + if (queue.size() == 1) + continueSessionQueue(session); } -void QbsRequest::setSession(QbsSession *session) +void QbsRequestManager::cancelRequest(QbsRequestObject *requestObject) { - QTC_ASSERT(!m_isRunning, return); - m_session = session; + QbsSession *session = requestObject->session(); + QList<QbsRequestObject *> &queue = m_queuedRequests[session]; + const int index = queue.indexOf(requestObject); + QTC_ASSERT(index >= 0, return); + if (index > 0) { + delete queue.takeAt(index); + return; + } + session->cancelCurrentJob(); } -void QbsRequest::start() +void QbsRequestManager::continueSessionQueue(QbsSession *session) { - QTC_ASSERT(!m_isRunning, return); - QTC_ASSERT(m_session, emit done(false); return); - QTC_ASSERT(m_requestData, emit done(false); return); + const QList<QbsRequestObject *> &queue = m_queuedRequests[session]; + if (queue.isEmpty()) { + m_queuedRequests.remove(session); + disconnect(session, &QObject::destroyed, this, nullptr); + return; + } + QbsRequestObject *requestObject = queue.first(); + connect(requestObject, &QbsRequestObject::done, this, [this, requestObject] { + QbsSession *session = requestObject->session(); + requestObject->deleteLater(); + QList<QbsRequestObject *> &queue = m_queuedRequests[session]; + QTC_ASSERT(!queue.isEmpty(), return); + QTC_CHECK(queue.first() == requestObject); + queue.removeFirst(); + continueSessionQueue(session); + }); + requestObject->start(); +} +static QbsRequestManager &manager() +{ + static QbsRequestManager theManager; + return theManager; +} + +void QbsRequestObject::start() +{ const auto handleDone = [this](const ErrorInfo &error) { - m_isRunning = false; m_session->disconnect(this); for (const ErrorInfoItem &item : error.items) { emit outputAdded(item.description, BuildStep::OutputFormat::Stdout); @@ -81,8 +153,40 @@ void QbsRequest::start() for (const QString &line : stdOut) emit outputAdded(line, BuildStep::OutputFormat::Stdout); }); - m_isRunning = true; - m_session->sendRequest(*m_requestData); + m_session->sendRequest(m_requestData); +} + +QbsRequest::~QbsRequest() +{ + if (!m_requestObject) + return; + disconnect(m_requestObject, nullptr, this, nullptr); + manager().cancelRequest(m_requestObject); +} + +void QbsRequest::start() +{ + QTC_ASSERT(!m_requestObject, return); + QTC_ASSERT(m_session, emit done(false); return); + QTC_ASSERT(m_requestData, emit done(false); return); + + m_requestObject = new QbsRequestObject; + m_requestObject->setSession(m_session); + m_requestObject->setRequestData(*m_requestData); + + connect(m_requestObject, &QbsRequestObject::done, this, [this](bool success) { + m_requestObject->deleteLater(); + m_requestObject = nullptr; + emit done(success); + }); + connect(m_requestObject, &QbsRequestObject::progressChanged, + this, &QbsRequest::progressChanged); + connect(m_requestObject, &QbsRequestObject::outputAdded, this, &QbsRequest::outputAdded); + connect(m_requestObject, &QbsRequestObject::taskAdded, this, &QbsRequest::taskAdded); + + manager().sendRequest(m_requestObject); } } // namespace QbsProjectManager::Internal + +#include "qbsrequest.moc" diff --git a/src/plugins/qbsprojectmanager/qbsrequest.h b/src/plugins/qbsprojectmanager/qbsrequest.h index 12b00a83fb6..3c19bc37904 100644 --- a/src/plugins/qbsprojectmanager/qbsrequest.h +++ b/src/plugins/qbsprojectmanager/qbsrequest.h @@ -12,6 +12,7 @@ namespace QbsProjectManager::Internal { class QbsSession; +class QbsRequestObject; class QbsRequest final : public QObject { @@ -20,7 +21,7 @@ class QbsRequest final : public QObject public: ~QbsRequest() override; - void setSession(QbsSession *session); + void setSession(QbsSession *session) { m_session = session; } void setRequestData(const QJsonObject &requestData) { m_requestData = requestData; } void start(); @@ -31,11 +32,9 @@ signals: void taskAdded(const ProjectExplorer::Task &task); private: - QbsSession *m_session = nullptr; + QbsSession *m_session = nullptr; // TODO: Should we keep a QPointer? std::optional<QJsonObject> m_requestData; - bool m_isRunning = false; - QString m_description; - int m_maxProgress = 100; + QbsRequestObject *m_requestObject = nullptr; }; class QbsRequestTaskAdapter : public Tasking::TaskAdapter<QbsRequest> From 3da1ce27ef71ef1a04291eae7293d331776d7dc2 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 28 Jul 2023 13:53:32 +0200 Subject: [PATCH 0551/1777] QbsRequest: Enrich functionality with parsing Change-Id: I8f189edb0e9fe51488bf98579945182e669fed0b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../qbsprojectmanager/qbsbuildstep.cpp | 50 ++++--------------- src/plugins/qbsprojectmanager/qbsrequest.cpp | 36 ++++++++++--- src/plugins/qbsprojectmanager/qbsrequest.h | 5 +- 3 files changed, 42 insertions(+), 49 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 17e76c85e7b..d83fba74283 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -50,39 +50,6 @@ using namespace Utils; namespace QbsProjectManager::Internal { -class QbsParserTaskAdapter : public TaskAdapter<QPointer<QbsBuildSystem>> -{ -public: - ~QbsParserTaskAdapter() - { - QbsBuildSystem *buildSystem = *task(); - if (buildSystem && m_isRunning) - buildSystem->cancelParsing(); - } - void start() final - { - QbsBuildSystem *buildSystem = *task(); - if (!buildSystem) { - emit done(false); - return; - } - m_isRunning = true; - connect(buildSystem->target(), &Target::parsingFinished, this, [this](bool success) { - m_isRunning = false; - emit done(success); - }); - buildSystem->parseCurrentBuildConfiguration(); - } -private: - bool m_isRunning = false; -}; - -} // namespace QbsProjectManager::Internal - -TASKING_DECLARE_TASK(QbsParserTask, QbsProjectManager::Internal::QbsParserTaskAdapter); - -namespace QbsProjectManager::Internal { - ArchitecturesAspect::ArchitecturesAspect(AspectContainer *container) : MultiSelectionAspect(container) { @@ -414,11 +381,11 @@ QString QbsBuildStep::profile() const GroupItem QbsBuildStep::runRecipe() { - const auto onPreParserSetup = [this](QPointer<QbsBuildSystem> &buildSystem) { - buildSystem = qbsBuildSystem(); + const auto onPreParserSetup = [this](QbsRequest &request) { + request.setParseData(qbsBuildSystem()); }; const auto onBuildSetup = [this](QbsRequest &request) { - QbsSession *session = static_cast<QbsBuildSystem*>(buildSystem())->session(); + QbsSession *session = qbsBuildSystem()->session(); if (!session) { emit addOutput(Tr::tr("No qbs session exists for this target."), OutputFormat::ErrorMessage); @@ -455,15 +422,16 @@ GroupItem QbsBuildStep::runRecipe() }); return SetupResult::Continue; }; - const auto onPostParserSetup = [this](QPointer<QbsBuildSystem> &buildSystem) { - buildSystem = qbsBuildSystem(); - return buildSystem->parsingScheduled() ? SetupResult::Continue : SetupResult::StopWithDone; + const auto onPostParserSetup = [this](QbsRequest &request) { + auto bs = qbsBuildSystem(); + request.setParseData(bs); + return bs->parsingScheduled() ? SetupResult::Continue : SetupResult::StopWithDone; }; const Group root { // We need a pre-build parsing step in order not to lose project file changes done // right before building (but before the delay has elapsed). - QbsParserTask(onPreParserSetup), + QbsRequestTask(onPreParserSetup), Group { continueOnError, QbsRequestTask(onBuildSetup), @@ -471,7 +439,7 @@ GroupItem QbsBuildStep::runRecipe() Sync([this] { qbsBuildSystem()->updateAfterBuild(); }), // The reparsing, if it is necessary, has to be done before done() is emitted, as // otherwise a potential additional build step could conflict with the parsing step. - QbsParserTask(onPostParserSetup) + QbsRequestTask(onPostParserSetup) } }; diff --git a/src/plugins/qbsprojectmanager/qbsrequest.cpp b/src/plugins/qbsprojectmanager/qbsrequest.cpp index a2b185f832b..98e4e42f132 100644 --- a/src/plugins/qbsprojectmanager/qbsrequest.cpp +++ b/src/plugins/qbsprojectmanager/qbsrequest.cpp @@ -3,15 +3,16 @@ #include "qbsrequest.h" +#include "qbsproject.h" #include "qbssession.h" +#include <projectexplorer/target.h> #include <projectexplorer/task.h> #include <utils/commandline.h> #include <utils/qtcassert.h> using namespace ProjectExplorer; -using namespace Tasking; using namespace Utils; namespace QbsProjectManager::Internal { @@ -21,10 +22,8 @@ class QbsRequestManager : public QObject public: void sendRequest(QbsRequestObject *requestObject); void cancelRequest(QbsRequestObject *requestObject); - private: void continueSessionQueue(QbsSession *session); - QHash<QObject *, QList<QbsRequestObject *>> m_queuedRequests; }; @@ -36,7 +35,9 @@ public: void setSession(QbsSession *session) { m_session = session; } QbsSession *session() const { return m_session; } void setRequestData(const QJsonObject &requestData) { m_requestData = requestData; } + void setParseData(const QPointer<QbsBuildSystem> &buildSystem) { m_parseData = buildSystem; } void start(); + void cancel(); signals: void done(bool success); @@ -47,6 +48,7 @@ signals: private: QbsSession *m_session = nullptr; QJsonObject m_requestData; + QPointer<QbsBuildSystem> m_parseData; QString m_description; int m_maxProgress = 100; }; @@ -76,7 +78,7 @@ void QbsRequestManager::cancelRequest(QbsRequestObject *requestObject) delete queue.takeAt(index); return; } - session->cancelCurrentJob(); + requestObject->cancel(); } void QbsRequestManager::continueSessionQueue(QbsSession *session) @@ -108,6 +110,14 @@ static QbsRequestManager &manager() void QbsRequestObject::start() { + if (m_parseData) { + connect(m_parseData->target(), &Target::parsingFinished, this, [this](bool success) { + emit done(success); + }); + m_parseData->parseCurrentBuildConfiguration(); + return; + } + const auto handleDone = [this](const ErrorInfo &error) { m_session->disconnect(this); for (const ErrorInfoItem &item : error.items) { @@ -156,6 +166,14 @@ void QbsRequestObject::start() m_session->sendRequest(m_requestData); } +void QbsRequestObject::cancel() +{ + if (m_parseData) + m_parseData->cancelParsing(); + else + m_session->cancelCurrentJob(); +} + QbsRequest::~QbsRequest() { if (!m_requestObject) @@ -167,12 +185,16 @@ QbsRequest::~QbsRequest() void QbsRequest::start() { QTC_ASSERT(!m_requestObject, return); - QTC_ASSERT(m_session, emit done(false); return); - QTC_ASSERT(m_requestData, emit done(false); return); + QTC_ASSERT(m_parseData || (m_session && m_requestData), emit done(false); return); m_requestObject = new QbsRequestObject; m_requestObject->setSession(m_session); - m_requestObject->setRequestData(*m_requestData); + if (m_requestData) + m_requestObject->setRequestData(*m_requestData); + if (m_parseData) { + m_requestObject->setSession(m_parseData->session()); + m_requestObject->setParseData(m_parseData); + } connect(m_requestObject, &QbsRequestObject::done, this, [this](bool success) { m_requestObject->deleteLater(); diff --git a/src/plugins/qbsprojectmanager/qbsrequest.h b/src/plugins/qbsprojectmanager/qbsrequest.h index 3c19bc37904..94654284af3 100644 --- a/src/plugins/qbsprojectmanager/qbsrequest.h +++ b/src/plugins/qbsprojectmanager/qbsrequest.h @@ -11,8 +11,9 @@ namespace QbsProjectManager::Internal { -class QbsSession; +class QbsBuildSystem; class QbsRequestObject; +class QbsSession; class QbsRequest final : public QObject { @@ -23,6 +24,7 @@ public: void setSession(QbsSession *session) { m_session = session; } void setRequestData(const QJsonObject &requestData) { m_requestData = requestData; } + void setParseData(const QPointer<QbsBuildSystem> &buildSystem) { m_parseData = buildSystem; } void start(); signals: @@ -34,6 +36,7 @@ signals: private: QbsSession *m_session = nullptr; // TODO: Should we keep a QPointer? std::optional<QJsonObject> m_requestData; + QPointer<QbsBuildSystem> m_parseData; QbsRequestObject *m_requestObject = nullptr; }; From e3782735762a56d255926143009d6913316f0d71 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 28 Jul 2023 14:30:21 +0200 Subject: [PATCH 0552/1777] QbsBuildStep: Introduce qbsBuildConfiguration() helper Change-Id: I8053942380bcd18919e49e3a767edbf6ce770d5b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 16 +++++++++------- src/plugins/qbsprojectmanager/qbsbuildstep.h | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index d83fba74283..c58e7fd4f81 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -240,15 +240,13 @@ QbsBuildStep::QbsBuildStep(BuildStepList *bsl, Id id) : bool QbsBuildStep::init() { - auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration()); - + const auto bc = qbsBuildConfiguration(); if (!bc) return false; m_changedFiles = bc->changedFiles(); m_activeFileTags = bc->activeFileTags(); m_products = bc->products(); - return true; } @@ -266,7 +264,7 @@ QWidget *QbsBuildStep::createConfigWidget() QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) const { QVariantMap config = m_qbsConfiguration; - const auto qbsBuildConfig = static_cast<QbsBuildConfiguration *>(buildConfiguration()); + const auto qbsBuildConfig = qbsBuildConfiguration(); config.insert(Constants::QBS_FORCE_PROBES_KEY, forceProbes()); const auto store = [&config](TriState ts, const QString &key) { @@ -359,6 +357,11 @@ QString QbsBuildStep::buildVariant() const return qbsConfiguration(PreserveVariables).value(Constants::QBS_CONFIG_VARIANT_KEY).toString(); } +QbsBuildConfiguration *QbsBuildStep::qbsBuildConfiguration() const +{ + return static_cast<QbsBuildConfiguration *>(buildConfiguration()); +} + QbsBuildSystem *QbsBuildStep::qbsBuildSystem() const { return static_cast<QbsBuildSystem *>(buildSystem()); @@ -493,8 +496,7 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) { connect(step, &ProjectConfiguration::displayNameChanged, this, &QbsBuildStepConfigWidget::updateState); - connect(static_cast<QbsBuildConfiguration *>(step->buildConfiguration()), - &QbsBuildConfiguration::qbsConfigurationChanged, + connect(step->qbsBuildConfiguration(), &QbsBuildConfiguration::qbsConfigurationChanged, this, &QbsBuildStepConfigWidget::updateState); connect(step, &QbsBuildStep::qbsBuildOptionsChanged, this, &QbsBuildStepConfigWidget::updateState); @@ -563,7 +565,7 @@ void QbsBuildStepConfigWidget::updateState() m_qbsStep->selectedAbis.setSelectedArchitectures(m_qbsStep->configuredArchitectures()); } - const auto qbsBuildConfig = static_cast<QbsBuildConfiguration *>(m_qbsStep->buildConfiguration()); + const auto qbsBuildConfig = m_qbsStep->qbsBuildConfiguration(); QString command = qbsBuildConfig->equivalentCommandLine(m_qbsStep->stepData()); diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index a3d2c7a1b7e..49279a1247c 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -7,6 +7,7 @@ namespace QbsProjectManager::Internal { +class QbsBuildConfiguration; class QbsBuildStepConfigWidget; class QbsBuildStepData; class QbsBuildSystem; @@ -45,6 +46,7 @@ public: QbsBuildStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); + QbsBuildConfiguration *qbsBuildConfiguration() const; QVariantMap qbsConfiguration(VariableHandling variableHandling) const; void setQbsConfiguration(const QVariantMap &config); From 387512862d461e521f69c1cfbb06c717daa62778 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 28 Jul 2023 10:46:23 +0200 Subject: [PATCH 0553/1777] Designer: Fix qbs build Amends 8d5897b8eb7a753b38734fc6c1bde2cef873b768. Change-Id: Ia297433fbcff88f352c23bae89625ee42ccd78be Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/designer/designer.qbs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/plugins/designer/designer.qbs b/src/plugins/designer/designer.qbs index 8b97a494a7c..88bfb1df6be 100644 --- a/src/plugins/designer/designer.qbs +++ b/src/plugins/designer/designer.qbs @@ -27,6 +27,20 @@ QtcPlugin { sharedSources.prefix ]) + pluginJsonReplacements: ({"DESIGNER_PLUGIN_ARGUMENTS": + "\"Arguments\" : [\n\ + {\n\ + \"Name\" : \"-designer-qt-pluginpath\",\n\ + \"Parameter\" : \"path\",\n\ + \"Description\" : \"Override the default search path for Qt Designer plugins\"\n\ + },\n\ + {\n\ + \"Name\" : \"-designer-pluginpath\",\n\ + \"Parameter\" : \"path\",\n\ + \"Description\" : \"Add a custom search path for Qt Designer plugins\"\n\ + }\n\ + ],"}) + Group { name: "General" files: [ From 734c493aea38528b3c542c248745c90eb11dda03 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh <orgad.shaneh@audiocodes.com> Date: Sun, 30 Jul 2023 16:56:27 +0300 Subject: [PATCH 0554/1777] ClangTool: Fix MSVC warning warning: C4267: '=': conversion from 'size_t' to 'int', possible loss of data Change-Id: Ic8214887787866c17a0eafc8ecac4640fdbbf231 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/clangtools/clangtool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index c89bdc15418..493bd4e41d1 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -644,7 +644,7 @@ Tasking::Group ClangTool::runRecipe(const RunSettings &runSettings, const ClangDiagnosticConfig &diagnosticConfig, const FileInfos &fileInfos, bool buildBeforeAnalysis) { - m_filesCount = fileInfos.size(); + m_filesCount = int(fileInfos.size()); using namespace Tasking; From 0717a768030dae8565486a3569874599513944d1 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 31 Jul 2023 08:43:10 +0200 Subject: [PATCH 0555/1777] Core: Do not access system settings during creation Do not directly access system settings during its creation. Avoids an endless hang by recursive initialization. Amends 7f908d737b0e017e65e917c65b19499f3093fa4c. Correct initialization is guaranteed by the init() of the EditorManagerPrivate. Change-Id: Ia58cfb5d6b11a2230915a8a0b5042bb26be5e1a2 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/coreplugin/systemsettings.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index 18c8908149a..fa474059f5f 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -152,12 +152,10 @@ SystemSettings::SystemSettings() showCrashButton.setSettingsKey("ShowCrashButton"); #endif - - const auto updateAutoSave = [] { EditorManagerPrivate::updateAutoSave(); }; - connect(&autoSaveModifiedFiles, &BaseAspect::changed, this, updateAutoSave); - connect(&autoSaveInterval, &BaseAspect::changed, this, updateAutoSave); - readSettings(); + connect(&autoSaveModifiedFiles, &BaseAspect::changed, + this, &EditorManagerPrivate::updateAutoSave); + connect(&autoSaveInterval, &BaseAspect::changed, this, &EditorManagerPrivate::updateAutoSave); } class SystemSettingsWidget : public IOptionsPageWidget From 7a2d4ed080dd8ccc33764d9a939d630e874d1336 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 27 Jul 2023 17:21:11 +0200 Subject: [PATCH 0556/1777] ProjectExplorer: Don't use QObject parents for ProjectConfigurations ... for ownership. It was not really used anymore, the target manually deletes build/run/deploy configurations, steplist their steps and steplists themselves are proper members in build/deploy config. Change-Id: I8addd1db0700342629fdab004ab42aa64291e93a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/buildconfiguration.cpp | 2 +- src/plugins/projectexplorer/buildstep.cpp | 2 +- src/plugins/projectexplorer/buildsteplist.cpp | 2 +- src/plugins/projectexplorer/deployconfiguration.cpp | 2 +- src/plugins/projectexplorer/projectconfiguration.cpp | 4 +--- src/plugins/projectexplorer/projectconfiguration.h | 2 +- src/plugins/projectexplorer/runconfiguration.cpp | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index ce3fa75a233..f2f1d02310b 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -158,7 +158,7 @@ public: } // Internal BuildConfiguration::BuildConfiguration(Target *target, Utils::Id id) - : ProjectConfiguration(target, target, id) + : ProjectConfiguration(target, id) , d(new Internal::BuildConfigurationPrivate(this)) { MacroExpander *expander = macroExpander(); diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 8844a34604b..503d82d22e7 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -82,7 +82,7 @@ namespace ProjectExplorer { static QList<BuildStepFactory *> g_buildStepFactories; BuildStep::BuildStep(BuildStepList *bsl, Id id) - : ProjectConfiguration(bsl, bsl->target(), id) + : ProjectConfiguration(bsl->target(), id) , m_stepList(bsl) { connect(this, &ProjectConfiguration::displayNameChanged, this, &BuildStep::updateSummary); diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index f42c224f8b0..c5a361a24e8 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -20,7 +20,7 @@ const char STEPS_COUNT_KEY[] = "ProjectExplorer.BuildStepList.StepsCount"; const char STEPS_PREFIX[] = "ProjectExplorer.BuildStepList.Step."; BuildStepList::BuildStepList(ProjectConfiguration *config, Utils::Id id) - : QObject(config), m_projectConfiguration(config), m_id(id) + : m_projectConfiguration(config), m_id(id) { QTC_CHECK(config); } diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp index 85986a5f694..a99bb447122 100644 --- a/src/plugins/projectexplorer/deployconfiguration.cpp +++ b/src/plugins/projectexplorer/deployconfiguration.cpp @@ -26,7 +26,7 @@ const char USES_DEPLOYMENT_DATA[] = "ProjectExplorer.DeployConfiguration.CustomD const char DEPLOYMENT_DATA[] = "ProjectExplorer.DeployConfiguration.CustomData"; DeployConfiguration::DeployConfiguration(Target *target, Id id) - : ProjectConfiguration(target, target, id) + : ProjectConfiguration(target, id) , m_stepList(this, Constants::BUILDSTEPS_DEPLOY) { //: Default DeployConfiguration display name diff --git a/src/plugins/projectexplorer/projectconfiguration.cpp b/src/plugins/projectexplorer/projectconfiguration.cpp index 9b88e47bb5e..e793ec920c3 100644 --- a/src/plugins/projectexplorer/projectconfiguration.cpp +++ b/src/plugins/projectexplorer/projectconfiguration.cpp @@ -16,12 +16,10 @@ const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ProjectConfiguration.DisplayNam // ProjectConfiguration -ProjectConfiguration::ProjectConfiguration(QObject *parent, Target *target, Utils::Id id) +ProjectConfiguration::ProjectConfiguration(Target *target, Id id) : m_target(target) , m_id(id) { - QTC_CHECK(parent); - setParent(parent); QTC_CHECK(target); QTC_CHECK(id.isValid()); setObjectName(id.toString()); diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h index 7a2f5155c46..a28c1d44152 100644 --- a/src/plugins/projectexplorer/projectconfiguration.h +++ b/src/plugins/projectexplorer/projectconfiguration.h @@ -26,7 +26,7 @@ class PROJECTEXPLORER_EXPORT ProjectConfiguration : public Utils::AspectContaine Q_OBJECT protected: - explicit ProjectConfiguration(QObject *parent, Target *target, Utils::Id id); + explicit ProjectConfiguration(Target *target, Utils::Id id); public: ~ProjectConfiguration() override; diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 5fe190a5139..365fb1673d6 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -143,7 +143,7 @@ void GlobalOrProjectAspect::resetProjectToGlobalSettings() static std::vector<RunConfiguration::AspectFactory> theAspectFactories; RunConfiguration::RunConfiguration(Target *target, Utils::Id id) - : ProjectConfiguration(target, target, id) + : ProjectConfiguration(target, id) { forceDisplayNameSerialization(); connect(target, &Target::parsingFinished, this, &RunConfiguration::update); From 1b84828caf029c6296c769787b2c4c7426ef686a Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 28 Jul 2023 17:36:36 +0200 Subject: [PATCH 0557/1777] QbsProjectManager: Replace some dynamic_casts with qobject_casts Change-Id: I55baf9938199891b444b3817dbd40df99bf4ce6a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/gcctoolchain.h | 2 ++ .../qbsprojectmanager/defaultpropertyprovider.cpp | 2 +- .../qbsprojectmanager/qbsprojectmanagerplugin.cpp | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 389213d12f2..fb59f64354e 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -45,6 +45,8 @@ inline const QStringList gccPredefinedMacrosOptions(Utils::Id languageId) class PROJECTEXPLORER_EXPORT GccToolChain : public ToolChain { + Q_OBJECT + public: GccToolChain(Utils::Id typeId); diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index e2d1ae9ee7b..67779062eea 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -336,7 +336,7 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor } data.insert(QLatin1String(CPP_TOOLCHAINPATH), mainFilePath.absolutePath().toString()); - if (auto gcc = dynamic_cast<ProjectExplorer::GccToolChain *>(mainTc)) { + if (auto gcc = qobject_cast<ProjectExplorer::GccToolChain *>(mainTc)) { QStringList compilerFlags = gcc->platformCodeGenFlags(); filterCompilerLinkerFlags(targetAbi, compilerFlags); data.insert(QLatin1String(CPP_PLATFORMCOMMONCOMPILERFLAGS), compilerFlags); diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp index 9b6dfd05461..75e5bd24b98 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp @@ -357,7 +357,7 @@ void QbsProjectManagerPlugin::buildFileContextMenu() { const Node *node = ProjectTree::currentNode(); QTC_ASSERT(node, return); - auto project = dynamic_cast<QbsProject *>(ProjectTree::currentProject()); + auto project = qobject_cast<QbsProject *>(ProjectTree::currentProject()); QTC_ASSERT(project, return); buildSingleFile(project, node->filePath().toString()); } @@ -392,7 +392,7 @@ void QbsProjectManagerPlugin::runStepsForProductContextMenu(const QList<Utils::I { const Node *node = ProjectTree::currentNode(); QTC_ASSERT(node, return); - auto project = dynamic_cast<QbsProject *>(ProjectTree::currentProject()); + auto project = qobject_cast<QbsProject *>(ProjectTree::currentProject()); QTC_ASSERT(project, return); const auto * const productNode = dynamic_cast<const QbsProductNode *>(node); @@ -455,7 +455,7 @@ void QbsProjectManagerPlugin::runStepsForSubprojectContextMenu(const QList<Utils { const Node *node = ProjectTree::currentNode(); QTC_ASSERT(node, return); - auto project = dynamic_cast<QbsProject *>(ProjectTree::currentProject()); + auto project = qobject_cast<QbsProject *>(ProjectTree::currentProject()); QTC_ASSERT(project, return); const auto subProject = dynamic_cast<const QbsProjectNode *>(node); @@ -533,12 +533,12 @@ void QbsProjectManagerPlugin::runStepsForProducts(QbsProject *project, void QbsProjectManagerPlugin::reparseSelectedProject() { - reparseProject(dynamic_cast<QbsProject *>(ProjectTree::currentProject())); + reparseProject(qobject_cast<QbsProject *>(ProjectTree::currentProject())); } void QbsProjectManagerPlugin::reparseCurrentProject() { - reparseProject(dynamic_cast<QbsProject *>(ProjectManager::startupProject())); + reparseProject(qobject_cast<QbsProject *>(ProjectManager::startupProject())); } void QbsProjectManagerPlugin::reparseProject(QbsProject *project) From 870cdb12f762545f4d4187d7fccafbfbdac3921b Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 31 Jul 2023 07:48:20 +0200 Subject: [PATCH 0558/1777] QbsBuildSystem: Properly queue parse requests Rename parseCurrentBuildConfiguration() into startParsing(). Make startParsing() and cancelParsing() private members, accessible only for QbsRequestObject. Change the behavior of the public scheduleParsing() method. It now queues the parse request. The new call to scheduleParse() cancels any possible running parsing and queues the new request. Change-Id: Ia2459a98e299c04fa715e73ca349e303d5536d82 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../qbsprojectmanager/qbsbuildstep.cpp | 8 ------ src/plugins/qbsprojectmanager/qbsproject.cpp | 26 +++++++++++-------- src/plugins/qbsprojectmanager/qbsproject.h | 12 +++++---- .../qbsprojectmanagerplugin.cpp | 10 +------ src/plugins/qbsprojectmanager/qbsrequest.cpp | 5 +++- 5 files changed, 27 insertions(+), 34 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index c58e7fd4f81..40e30372e02 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -425,11 +425,6 @@ GroupItem QbsBuildStep::runRecipe() }); return SetupResult::Continue; }; - const auto onPostParserSetup = [this](QbsRequest &request) { - auto bs = qbsBuildSystem(); - request.setParseData(bs); - return bs->parsingScheduled() ? SetupResult::Continue : SetupResult::StopWithDone; - }; const Group root { // We need a pre-build parsing step in order not to lose project file changes done @@ -440,9 +435,6 @@ GroupItem QbsBuildStep::runRecipe() QbsRequestTask(onBuildSetup), // Building can uncover additional target artifacts. Sync([this] { qbsBuildSystem()->updateAfterBuild(); }), - // The reparsing, if it is necessary, has to be done before done() is emitted, as - // otherwise a potential additional build step could conflict with the parsing step. - QbsRequestTask(onPostParserSetup) } }; diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 74411ef3a4c..c9cc99a7eff 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -13,6 +13,7 @@ #include "qbsprojectmanagerconstants.h" #include "qbsprojectmanagertr.h" #include "qbsprojectparser.h" +#include "qbsrequest.h" #include "qbssession.h" #include "qbssettings.h" @@ -198,6 +199,7 @@ QbsBuildSystem::QbsBuildSystem(QbsBuildConfiguration *bc) QbsBuildSystem::~QbsBuildSystem() { + m_parseRequest.reset(); delete m_cppCodeModelUpdater; delete m_qbsProjectParser; if (m_qbsUpdateFutureInterface) { @@ -434,7 +436,7 @@ bool QbsBuildSystem::checkCancelStatus() m_qbsProjectParser = nullptr; m_treeCreationWatcher = nullptr; m_guard = {}; - parseCurrentBuildConfiguration(); + startParsing(); return true; } @@ -564,14 +566,7 @@ void QbsBuildSystem::changeActiveTarget(Target *t) void QbsBuildSystem::triggerParsing() { - // Qbs does update the build graph during the build. So we cannot - // start to parse while a build is running or we will lose information. - if (BuildManager::isBuilding(project())) { - scheduleParsing(); - return; - } - - parseCurrentBuildConfiguration(); + scheduleParsing(); } void QbsBuildSystem::delayParsing() @@ -585,9 +580,18 @@ ExtraCompiler *QbsBuildSystem::findExtraCompiler(const ExtraCompilerFilter &filt return Utils::findOrDefault(m_extraCompilers, filter); } -void QbsBuildSystem::parseCurrentBuildConfiguration() +void QbsBuildSystem::scheduleParsing() +{ + m_parseRequest.reset(new QbsRequest); + m_parseRequest->setParseData(this); + connect(m_parseRequest.get(), &QbsRequest::done, this, [this] { + m_parseRequest.release()->deleteLater(); + }); + m_parseRequest->start(); +} + +void QbsBuildSystem::startParsing() { - m_parsingScheduled = false; if (m_cancelStatus == CancelStatusCancelingForReparse) return; diff --git a/src/plugins/qbsprojectmanager/qbsproject.h b/src/plugins/qbsprojectmanager/qbsproject.h index 7aa92e1d1be..d694f7dda41 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.h +++ b/src/plugins/qbsprojectmanager/qbsproject.h @@ -28,6 +28,7 @@ namespace Internal { class ErrorInfo; class QbsBuildConfiguration; class QbsProjectParser; +class QbsRequest; class QbsSession; class QbsProject : public ProjectExplorer::Project @@ -88,10 +89,7 @@ public: static ProjectExplorer::FileType fileTypeFor(const QSet<QString> &tags); QString profile() const; - void parseCurrentBuildConfiguration(); - void scheduleParsing() { m_parsingScheduled = true; } - bool parsingScheduled() const { return m_parsingScheduled; } - void cancelParsing(); + void scheduleParsing(); void updateAfterBuild(); QbsSession *session() const { return m_session; } @@ -103,6 +101,10 @@ public: private: friend class QbsProject; + friend class QbsRequestObject; + + void startParsing(); + void cancelParsing(); ProjectExplorer::ExtraCompiler *findExtraCompiler( const ExtraCompilerFilter &filter) const override; @@ -133,7 +135,7 @@ private: using TreeCreationWatcher = QFutureWatcher<QbsProjectNode *>; TreeCreationWatcher *m_treeCreationWatcher = nullptr; Utils::Environment m_lastParseEnv; - bool m_parsingScheduled = false; + std::unique_ptr<QbsRequest> m_parseRequest; enum CancelStatus { CancelStatusNone, diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp index 75e5bd24b98..acb6dc45e49 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp @@ -550,16 +550,8 @@ void QbsProjectManagerPlugin::reparseProject(QbsProject *project) if (!t) return; - QbsBuildSystem *bs = static_cast<QbsBuildSystem *>(t->buildSystem()); - if (!bs) - return; - - // Qbs does update the build graph during the build. So we cannot - // start to parse while a build is running or we will lose information. - if (BuildManager::isBuilding(project)) + if (auto bs = qobject_cast<QbsBuildSystem *>(t->buildSystem())) bs->scheduleParsing(); - else - bs->parseCurrentBuildConfiguration(); } void QbsProjectManagerPlugin::buildNamedProduct(QbsProject *project, const QString &product) diff --git a/src/plugins/qbsprojectmanager/qbsrequest.cpp b/src/plugins/qbsprojectmanager/qbsrequest.cpp index 98e4e42f132..1355922b448 100644 --- a/src/plugins/qbsprojectmanager/qbsrequest.cpp +++ b/src/plugins/qbsprojectmanager/qbsrequest.cpp @@ -91,6 +91,7 @@ void QbsRequestManager::continueSessionQueue(QbsSession *session) } QbsRequestObject *requestObject = queue.first(); connect(requestObject, &QbsRequestObject::done, this, [this, requestObject] { + disconnect(requestObject, &QbsRequestObject::done, this, nullptr); QbsSession *session = requestObject->session(); requestObject->deleteLater(); QList<QbsRequestObject *> &queue = m_queuedRequests[session]; @@ -112,9 +113,11 @@ void QbsRequestObject::start() { if (m_parseData) { connect(m_parseData->target(), &Target::parsingFinished, this, [this](bool success) { + disconnect(m_parseData->target(), &Target::parsingFinished, this, nullptr); emit done(success); }); - m_parseData->parseCurrentBuildConfiguration(); + QMetaObject::invokeMethod(m_parseData.get(), &QbsBuildSystem::startParsing, + Qt::QueuedConnection); return; } From aa89d7fd03bdd2c10bdd4d99f40cf1fdf28065d5 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 31 Jul 2023 08:47:33 +0200 Subject: [PATCH 0559/1777] QbsBuildSystem: Do some cleanup Get rid of CancelStatus enum and checkCancelStatus() method. Change-Id: If703c78c8c3d82a5e6a5976c7c42c1da238744db Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/buildsystem.cpp | 3 +- src/plugins/qbsprojectmanager/qbsproject.cpp | 43 ++------------------ src/plugins/qbsprojectmanager/qbsproject.h | 7 ---- 3 files changed, 4 insertions(+), 49 deletions(-) diff --git a/src/plugins/projectexplorer/buildsystem.cpp b/src/plugins/projectexplorer/buildsystem.cpp index 9a120a9863f..b0103a52f7c 100644 --- a/src/plugins/projectexplorer/buildsystem.cpp +++ b/src/plugins/projectexplorer/buildsystem.cpp @@ -62,8 +62,7 @@ BuildSystem::BuildSystem(Target *target) // Timer: d->m_delayedParsingTimer.setSingleShot(true); - connect(&d->m_delayedParsingTimer, &QTimer::timeout, this, - [this] { + connect(&d->m_delayedParsingTimer, &QTimer::timeout, this, [this] { if (ProjectManager::hasProject(project())) triggerParsing(); else diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index c9cc99a7eff..b0968da5a8a 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -425,21 +425,6 @@ QString QbsBuildSystem::profile() const return QbsProfileManager::ensureProfileForKit(target()->kit()); } -bool QbsBuildSystem::checkCancelStatus() -{ - const CancelStatus cancelStatus = m_cancelStatus; - m_cancelStatus = CancelStatusNone; - if (cancelStatus != CancelStatusCancelingForReparse) - return false; - qCDebug(qbsPmLog) << "Cancel request while parsing, starting re-parse"; - m_qbsProjectParser->deleteLater(); - m_qbsProjectParser = nullptr; - m_treeCreationWatcher = nullptr; - m_guard = {}; - startParsing(); - return true; -} - void QbsBuildSystem::updateAfterParse() { qCDebug(qbsPmLog) << "Updating data after parse"; @@ -508,9 +493,6 @@ void QbsBuildSystem::handleQbsParsingDone(bool success) qCDebug(qbsPmLog) << "Parsing done, success:" << success; - if (checkCancelStatus()) - return; - generateErrors(m_qbsProjectParser->error()); bool dataChanged = false; @@ -545,9 +527,9 @@ void QbsBuildSystem::handleQbsParsingDone(bool success) if (dataChanged) { updateAfterParse(); return; - } - else if (envChanged) + } else if (envChanged) { updateCppCodeModel(); + } if (success) m_guard.markAsSuccess(); m_guard = {}; @@ -592,25 +574,7 @@ void QbsBuildSystem::scheduleParsing() void QbsBuildSystem::startParsing() { - if (m_cancelStatus == CancelStatusCancelingForReparse) - return; - - // The CancelStatusCancelingAltoghether type can only be set by a build job, during - // which no other parse requests come through to this point (except by the build job itself, - // but of course not while canceling is in progress). - QTC_ASSERT(m_cancelStatus == CancelStatusNone, return); - - // New parse requests override old ones. - // NOTE: We need to wait for the current operation to finish, since otherwise there could - // be a conflict. Consider the case where the old qbs::ProjectSetupJob is writing - // to the build graph file when the cancel request comes in. If we don't wait for - // acknowledgment, it might still be doing that when the new one already reads from the - // same file. - if (m_qbsProjectParser) { - m_cancelStatus = CancelStatusCancelingForReparse; - m_qbsProjectParser->cancel(); - return; - } + QTC_ASSERT(!m_qbsProjectParser, return); QVariantMap config = m_buildConfiguration->qbsConfiguration(); if (!config.contains(Constants::QBS_INSTALL_ROOT_KEY)) { @@ -639,7 +603,6 @@ void QbsBuildSystem::startParsing() void QbsBuildSystem::cancelParsing() { QTC_ASSERT(m_qbsProjectParser, return); - m_cancelStatus = CancelStatusCancelingAltogether; m_qbsProjectParser->cancel(); } diff --git a/src/plugins/qbsprojectmanager/qbsproject.h b/src/plugins/qbsprojectmanager/qbsproject.h index d694f7dda41..e3dcc6f3466 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.h +++ b/src/plugins/qbsprojectmanager/qbsproject.h @@ -119,7 +119,6 @@ private: void updateApplicationTargets(); void updateDeploymentInfo(); void updateBuildTargetData(); - bool checkCancelStatus(); void updateAfterParse(); void updateProjectNodes(const std::function<void()> &continuation); Utils::FilePath installRoot(); @@ -137,12 +136,6 @@ private: Utils::Environment m_lastParseEnv; std::unique_ptr<QbsRequest> m_parseRequest; - enum CancelStatus { - CancelStatusNone, - CancelStatusCancelingForReparse, - CancelStatusCancelingAltogether - } m_cancelStatus = CancelStatusNone; - CppEditor::CppProjectUpdater *m_cppCodeModelUpdater = nullptr; QHash<ProjectExplorer::ExtraCompilerFactory *, QStringList> m_sourcesForGeneratedFiles; From edb9dc409e146d768eb817b9966c8047e6f34e46 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 31 Jul 2023 10:33:29 +0200 Subject: [PATCH 0560/1777] QbsInstallStep: Reuse installRoot() Change-Id: I3f563ea4a452b72c3a4eac478560ce65a0712713 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/qbsprojectmanager/qbsinstallstep.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp index 59baaf6e38e..77780168d49 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp @@ -106,9 +106,7 @@ QbsBuildStepData QbsInstallStep::stepData() const data.noBuild = true; data.cleanInstallRoot = cleanInstallRoot(); data.isInstallStep = true; - auto bs = static_cast<QbsBuildConfiguration *>(target()->activeBuildConfiguration())->qbsStep(); - if (bs) - data.installRoot = bs->installRoot(); + data.installRoot = installRoot(); return data; } From b0435da3960f178902b2cce8894a6e425256a4a3 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 31 Jul 2023 10:42:47 +0200 Subject: [PATCH 0561/1777] QbsInstallStep: Remove stepData() from the public API Inline it instead, as it's used only once. Change-Id: I4b8882334640493fed66504799d7cdfe367be1d9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../qbsprojectmanager/qbsinstallstep.cpp | 23 ++++++++----------- .../qbsprojectmanager/qbsinstallstep.h | 1 - 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp index 77780168d49..33474a254b7 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp @@ -97,19 +97,6 @@ const QbsBuildConfiguration *QbsInstallStep::buildConfig() const return static_cast<QbsBuildConfiguration *>(target()->activeBuildConfiguration()); } -QbsBuildStepData QbsInstallStep::stepData() const -{ - QbsBuildStepData data; - data.command = "install"; - data.dryRun = dryRun(); - data.keepGoing = keepGoing(); - data.noBuild = true; - data.cleanInstallRoot = cleanInstallRoot(); - data.isInstallStep = true; - data.installRoot = installRoot(); - return data; -} - QWidget *QbsInstallStep::createConfigWidget() { auto widget = new QWidget; @@ -133,7 +120,15 @@ QWidget *QbsInstallStep::createConfigWidget() const auto updateState = [this, commandLineTextEdit, installRootValueLabel] { installRootValueLabel->setText(installRoot().toUserOutput()); - commandLineTextEdit->setPlainText(buildConfig()->equivalentCommandLine(stepData())); + QbsBuildStepData data; + data.command = "install"; + data.dryRun = dryRun(); + data.keepGoing = keepGoing(); + data.noBuild = true; + data.cleanInstallRoot = cleanInstallRoot(); + data.isInstallStep = true; + data.installRoot = installRoot(); + commandLineTextEdit->setPlainText(buildConfig()->equivalentCommandLine(data)); }; connect(target(), &Target::parsingFinished, this, updateState); diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.h b/src/plugins/qbsprojectmanager/qbsinstallstep.h index 37f7a60db6d..3a80a560778 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.h +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.h @@ -18,7 +18,6 @@ public: QbsInstallStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); Utils::FilePath installRoot() const; - QbsBuildStepData stepData() const; private: bool init() override; From d56a2a233c428c440f6930382bdc227e288345e3 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 31 Jul 2023 11:06:43 +0200 Subject: [PATCH 0562/1777] QbsBuildStep: Hide some methods in private section Change-Id: I1f8ff6e12308d5dd41f4256efc061d93a157a1a7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/qbsprojectmanager/qbsbuildstep.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index 49279a1247c..613766e8ae6 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -46,14 +46,11 @@ public: QbsBuildStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); - QbsBuildConfiguration *qbsBuildConfiguration() const; QVariantMap qbsConfiguration(VariableHandling variableHandling) const; void setQbsConfiguration(const QVariantMap &config); - bool hasCustomInstallRoot() const; Utils::FilePath installRoot(VariableHandling variableHandling = ExpandVariables) const; QString buildVariant() const; - int maxJobs() const; Utils::SelectionAspect buildVariantHolder{this}; ArchitecturesAspect selectedAbis{this}; @@ -77,11 +74,14 @@ private: void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; + QbsBuildConfiguration *qbsBuildConfiguration() const; QbsBuildSystem *qbsBuildSystem() const; QbsBuildStepData stepData() const; void setBuildVariant(const QString &variant); void setConfiguredArchitectures(const QStringList &architectures); QString profile() const; + bool hasCustomInstallRoot() const; + int maxJobs() const; void updateState(); QStringList configuredArchitectures() const; From 385ff37f883445a42264677d20bb52bbe8b05667 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 31 Jul 2023 09:30:22 +0200 Subject: [PATCH 0563/1777] Terminal: Fix selection A missing call to the base class meant that when starting to search with a selection set, the selected text was not copied into the search field. Change-Id: I1f2f1054a687d8b33b6733cc2a96e85ffa7f7816 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/terminal/terminalwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 0a4607ce67d..4b06c353433 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -410,7 +410,7 @@ void TerminalWidget::restart(const OpenTerminalParameters &openParameters) void TerminalWidget::selectionChanged(const std::optional<Selection> &newSelection) { - Q_UNUSED(newSelection); + SearchableTerminal::selectionChanged(newSelection); updateCopyState(); From a3254587ac98b8d4b7f4dda81a4ad9e19e85597d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 31 Jul 2023 11:10:46 +0200 Subject: [PATCH 0564/1777] QbsBuildStep: Remove qbsBuildOptionsChanged() signal It is never emitted. Change-Id: Ib0650a2139213a117796ebbfaf8e596752b14f6b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 2 -- src/plugins/qbsprojectmanager/qbsbuildstep.h | 1 - src/plugins/qbsprojectmanager/qbsinstallstep.cpp | 7 +------ 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 40e30372e02..a86d129e796 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -490,8 +490,6 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) this, &QbsBuildStepConfigWidget::updateState); connect(step->qbsBuildConfiguration(), &QbsBuildConfiguration::qbsConfigurationChanged, this, &QbsBuildStepConfigWidget::updateState); - connect(step, &QbsBuildStep::qbsBuildOptionsChanged, - this, &QbsBuildStepConfigWidget::updateState); connect(&QbsSettings::instance(), &QbsSettings::settingsChanged, this, &QbsBuildStepConfigWidget::updateState); connect(step->buildConfiguration(), &BuildConfiguration::buildDirectoryChanged, diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index 613766e8ae6..9c35f7020df 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -64,7 +64,6 @@ public: signals: void qbsConfigurationChanged(); - void qbsBuildOptionsChanged(); private: bool init() override; diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp index 33474a254b7..4cd0fed5fc5 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp @@ -132,19 +132,14 @@ QWidget *QbsInstallStep::createConfigWidget() }; connect(target(), &Target::parsingFinished, this, updateState); + connect(buildConfig(), &QbsBuildConfiguration::qbsConfigurationChanged, this, updateState); connect(this, &ProjectConfiguration::displayNameChanged, this, updateState); connect(&dryRun, &BaseAspect::changed, this, updateState); connect(&keepGoing, &BaseAspect::changed, this, updateState); connect(&cleanInstallRoot, &BaseAspect::changed, this, updateState); - const QbsBuildConfiguration * const bc = buildConfig(); - connect(bc, &QbsBuildConfiguration::qbsConfigurationChanged, this, updateState); - if (bc->qbsStep()) - connect(bc->qbsStep(), &QbsBuildStep::qbsBuildOptionsChanged, this, updateState); - updateState(); - return widget; } From 671bfad88e1854ce1ac389440232269a27587d78 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 31 Jul 2023 14:15:08 +0200 Subject: [PATCH 0565/1777] QbsBuildStep: Some cleanup Get rid of unused profile() method. Inline setBuildVariant() and setConfigurationArchitectures(), as they are used just once. Add context object to selectedAbis's connection. Change-Id: I8c41327ee15d870e97ab496670af58ba2b13a913 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../qbsprojectmanager/qbsbuildstep.cpp | 46 +++++++------------ src/plugins/qbsprojectmanager/qbsbuildstep.h | 3 -- 2 files changed, 17 insertions(+), 32 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index a86d129e796..f18b81adbfc 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -232,10 +232,24 @@ QbsBuildStep::QbsBuildStep(BuildStepList *bsl, Id id) : connect(&forceProbes, &BaseAspect::changed, this, &QbsBuildStep::updateState); connect(&buildVariantHolder, &BaseAspect::changed, this, [this] { - setBuildVariant(buildVariantHolder.itemValue().toString()); + const QString variant = buildVariantHolder.itemValue().toString(); + if (m_qbsConfiguration.value(Constants::QBS_CONFIG_VARIANT_KEY).toString() == variant) + return; + m_qbsConfiguration.insert(Constants::QBS_CONFIG_VARIANT_KEY, variant); + emit qbsConfigurationChanged(); + if (BuildConfiguration *bc = buildConfiguration()) + emit bc->buildTypeChanged(); + }); + connect(&selectedAbis, &BaseAspect::changed, this, [this] { + const QStringList architectures = selectedAbis.selectedArchitectures(); + if (configuredArchitectures() == architectures) + return; + if (architectures.isEmpty()) + m_qbsConfiguration.remove(Constants::QBS_ARCHITECTURES); + else + m_qbsConfiguration.insert(Constants::QBS_ARCHITECTURES, architectures.join(',')); + emit qbsConfigurationChanged(); }); - connect(&selectedAbis, &BaseAspect::changed, [this] { - setConfiguredArchitectures(selectedAbis.selectedArchitectures()); }); } bool QbsBuildStep::init() @@ -367,21 +381,6 @@ QbsBuildSystem *QbsBuildStep::qbsBuildSystem() const return static_cast<QbsBuildSystem *>(buildSystem()); } -void QbsBuildStep::setBuildVariant(const QString &variant) -{ - if (m_qbsConfiguration.value(Constants::QBS_CONFIG_VARIANT_KEY).toString() == variant) - return; - m_qbsConfiguration.insert(Constants::QBS_CONFIG_VARIANT_KEY, variant); - emit qbsConfigurationChanged(); - if (BuildConfiguration *bc = buildConfiguration()) - emit bc->buildTypeChanged(); -} - -QString QbsBuildStep::profile() const -{ - return qbsConfiguration(PreserveVariables).value(Constants::QBS_CONFIG_PROFILE_KEY).toString(); -} - GroupItem QbsBuildStep::runRecipe() { const auto onPreParserSetup = [this](QbsRequest &request) { @@ -446,17 +445,6 @@ void QbsBuildStep::updateState() emit qbsConfigurationChanged(); } -void QbsBuildStep::setConfiguredArchitectures(const QStringList &architectures) -{ - if (configuredArchitectures() == architectures) - return; - if (architectures.isEmpty()) - m_qbsConfiguration.remove(Constants::QBS_ARCHITECTURES); - else - m_qbsConfiguration.insert(Constants::QBS_ARCHITECTURES, architectures.join(',')); - emit qbsConfigurationChanged(); -} - QStringList QbsBuildStep::configuredArchitectures() const { return m_qbsConfiguration[Constants::QBS_ARCHITECTURES].toString().split(',', diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index 9c35f7020df..1e5186a326b 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -76,9 +76,6 @@ private: QbsBuildConfiguration *qbsBuildConfiguration() const; QbsBuildSystem *qbsBuildSystem() const; QbsBuildStepData stepData() const; - void setBuildVariant(const QString &variant); - void setConfiguredArchitectures(const QStringList &architectures); - QString profile() const; bool hasCustomInstallRoot() const; int maxJobs() const; From 61f0e31e3036d869fe51b7158cc80b1f11a7e7f0 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 31 Jul 2023 13:37:07 +0200 Subject: [PATCH 0566/1777] Core: Set category icon only if path is set Silences warning "Could not load image: ''". Change-Id: I84bb86d3290040a2a0b7876ae540f7a0766b3b14 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/dialogs/settingsdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 1f0af6f0efc..c1410bf130f 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -167,7 +167,7 @@ void CategoryModel::setPages(const QList<IOptionsPage*> &pages, } if (category->displayName.isEmpty()) category->displayName = page->displayCategory(); - if (category->icon.isNull()) { + if (category->icon.isNull() && !page->categoryIconPath().isEmpty()) { Icon icon({{page->categoryIconPath(), Theme::PanelTextColorDark}}, Icon::Tint); category->icon = icon.icon(); } From 98e24a199f5a286ad50cc4a94df9718ce6992d2a Mon Sep 17 00:00:00 2001 From: Burak Hancerli <burak.hancerli@qt.io> Date: Tue, 1 Aug 2023 14:24:38 +0200 Subject: [PATCH 0567/1777] Copilot: Fix the broken link in the settings page Change-Id: Iabedbbd1cc4c3371bd5351e434918e8368705daf Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/copilot/copilotsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index ce67265d56e..c03ada7dce5 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -173,7 +173,7 @@ public: "file from the Copilot neovim plugin.", "Markdown text for the copilot instruction label") .arg("[README.md](https://github.com/github/copilot.vim)") - .arg("[agent.js](https://github.com/github/copilot.vim/tree/release/copilot/dist)")); + .arg("[agent.js](https://github.com/github/copilot.vim/tree/release/dist)")); Column { QString("<b>" + Tr::tr("Note:") + "</b>"), br, From 404bf9547f9981f90bd86f48fe7e16c63ed57bdb Mon Sep 17 00:00:00 2001 From: Jonas Karlsson <jonas.karlsson@qt.io> Date: Tue, 1 Aug 2023 14:20:47 +0200 Subject: [PATCH 0568/1777] Update QtQuick3D.Physics.Helpers qmldir Task-number: QTBUG-115539 Change-Id: I6d44ebe64dd32d1f2c1575ce4cbc84c01d3588f7 Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../projectstorage/data/qml/QtQuick3D/Physics/Helpers/qmldir | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Physics/Helpers/qmldir b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Physics/Helpers/qmldir index 01802761653..74780bb7d60 100644 --- a/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Physics/Helpers/qmldir +++ b/tests/unit/tests/unittests/projectstorage/data/qml/QtQuick3D/Physics/Helpers/qmldir @@ -3,6 +3,8 @@ linktarget Qt6::qtquick3dphysicshelpersplugin optional plugin qtquick3dphysicshelpersplugin classname QtQuick3DPhysicsHelpersPlugin typeinfo plugins.qmltypes -depends QtQuick3DPhysics auto +depends QtQuick3D.Physics auto +depends QtQuick3D auto +depends QtQuick auto prefer :/qt-project.org/imports/QtQuick3D/Physics/Helpers/ From eb2b4b6cf3e6f202846ac56377765eaa66932148 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 21:19:48 +0200 Subject: [PATCH 0569/1777] Various Plugins: Simplify return QList statements Change-Id: I36633128e061d0544e4752a65804b460371283f7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- .../advanceddockingsystem/dockmanager.cpp | 2 +- src/libs/aggregation/aggregate.h | 4 +-- src/libs/cplusplus/ResolveExpression.cpp | 2 +- src/libs/glsl/glslsymbol.cpp | 2 +- .../qmt/model_controller/modelcontroller.cpp | 2 +- .../qmt/model_widgets_ui/classmembersedit.cpp | 2 +- src/libs/qmljs/jsoncheck.cpp | 2 +- src/libs/qmljs/qmljsdialect.cpp | 2 +- src/libs/utils/differ.cpp | 6 ++--- src/libs/utils/wizard.cpp | 4 +-- src/plugins/autotest/testtreeitem.cpp | 2 +- .../editormanager/documentmodel.cpp | 2 +- src/plugins/coreplugin/sidebar.cpp | 2 +- src/plugins/cppeditor/cppoutline.cpp | 2 +- src/plugins/cppeditor/cppquickfix_test.cpp | 3 +-- src/plugins/cppeditor/cpptoolstestcase.cpp | 2 +- .../followsymbol_switchmethoddecldef_test.cpp | 2 +- .../debugger/analyzer/detailederrorview.cpp | 2 +- src/plugins/projectexplorer/appoutputpane.cpp | 2 +- .../projectexplorer/kitinformation.cpp | 2 +- .../customwidgetwizard/plugingenerator.cpp | 26 +++++++++---------- .../components/formeditor/movetool.cpp | 5 ++-- .../timelineeditor/preseteditor.cpp | 2 +- .../timelineeditor/timelineview.cpp | 2 +- .../designercore/model/nodelistproperty.cpp | 4 +-- src/plugins/squish/squishoutputpane.cpp | 2 +- src/plugins/todo/lineparser.cpp | 2 +- .../instances/objectnodeinstance.cpp | 6 ++--- .../instances/qt5nodeinstanceserver.cpp | 2 +- 29 files changed, 49 insertions(+), 51 deletions(-) diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp index 482fd98a7bc..73b475ee5a4 100644 --- a/src/libs/advanceddockingsystem/dockmanager.cpp +++ b/src/libs/advanceddockingsystem/dockmanager.cpp @@ -737,7 +737,7 @@ QList<int> DockManager::splitterSizes(DockAreaWidget *containedArea) const return splitter->sizes(); } - return QList<int>(); + return {}; } void DockManager::setSplitterSizes(DockAreaWidget *containedArea, const QList<int> &sizes) diff --git a/src/libs/aggregation/aggregate.h b/src/libs/aggregation/aggregate.h index 4934191d444..0e210451e71 100644 --- a/src/libs/aggregation/aggregate.h +++ b/src/libs/aggregation/aggregate.h @@ -83,14 +83,14 @@ template <typename T> T *query(QObject *obj) template <typename T> QList<T *> query_all(Aggregate *obj) { if (!obj) - return QList<T *>(); + return {}; return obj->template components<T>(); } template <typename T> QList<T *> query_all(QObject *obj) { if (!obj) - return QList<T *>(); + return {}; QReadLocker locker(&Aggregate::lock()); Aggregate *parentAggregation = Aggregate::parentAggregate(obj); QList<T *> results; diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp index 1ac35319bd1..a120d5b736f 100644 --- a/src/libs/cplusplus/ResolveExpression.cpp +++ b/src/libs/cplusplus/ResolveExpression.cpp @@ -231,7 +231,7 @@ QList<LookupItem> ResolveExpression::reference(ExpressionAST *ast, Scope *scope) QList<LookupItem> ResolveExpression::resolve(ExpressionAST *ast, Scope *scope, bool ref) { if (! scope) - return QList<LookupItem>(); + return {}; std::swap(_scope, scope); std::swap(_reference, ref); diff --git a/src/libs/glsl/glslsymbol.cpp b/src/libs/glsl/glslsymbol.cpp index 9b2630872c6..fb1324aacf9 100644 --- a/src/libs/glsl/glslsymbol.cpp +++ b/src/libs/glsl/glslsymbol.cpp @@ -52,5 +52,5 @@ Symbol *Scope::lookup(const QString &name) const QList<Symbol *> Scope::members() const { - return QList<Symbol *>(); + return {}; } diff --git a/src/libs/modelinglib/qmt/model_controller/modelcontroller.cpp b/src/libs/modelinglib/qmt/model_controller/modelcontroller.cpp index 3e38aabdf3f..b363decd683 100644 --- a/src/libs/modelinglib/qmt/model_controller/modelcontroller.cpp +++ b/src/libs/modelinglib/qmt/model_controller/modelcontroller.cpp @@ -878,7 +878,7 @@ void ModelController::moveRelation(MObject *newOwner, MRelation *relation) QList<MRelation *> ModelController::findRelationsOfObject(const MObject *object) const { - QMT_ASSERT(object, return QList<MRelation *>()); + QMT_ASSERT(object, return {}); return m_objectRelationsMap.values(object->uid()); } diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/classmembersedit.cpp b/src/libs/modelinglib/qmt/model_widgets_ui/classmembersedit.cpp index d9146c038fe..3f14eb93e5d 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/classmembersedit.cpp +++ b/src/libs/modelinglib/qmt/model_widgets_ui/classmembersedit.cpp @@ -429,7 +429,7 @@ QString ClassMembersEdit::build(const QList<MClassMember> &members) QList<MClassMember> ClassMembersEdit::parse(const QString &text, bool *ok) { - QMT_ASSERT(ok, return QList<MClassMember>()); + QMT_ASSERT(ok, {}); *ok = true; QList<MClassMember> members; diff --git a/src/libs/qmljs/jsoncheck.cpp b/src/libs/qmljs/jsoncheck.cpp index b7ce1443fb9..366c150c95c 100644 --- a/src/libs/qmljs/jsoncheck.cpp +++ b/src/libs/qmljs/jsoncheck.cpp @@ -29,7 +29,7 @@ JsonCheck::~JsonCheck() QList<Message> JsonCheck::operator ()(JsonSchema *schema) { - QTC_ASSERT(schema, return QList<Message>()); + QTC_ASSERT(schema, return {}); m_schema = schema; diff --git a/src/libs/qmljs/qmljsdialect.cpp b/src/libs/qmljs/qmljsdialect.cpp index 58b9771bcd1..387c06a3ab9 100644 --- a/src/libs/qmljs/qmljsdialect.cpp +++ b/src/libs/qmljs/qmljsdialect.cpp @@ -192,7 +192,7 @@ QList<Dialect> Dialect::companionLanguages() const << Dialect::QmlQtQuick2Ui << Dialect::Qml; break; case Dialect::NoLanguage: - return QList<Dialect>(); // return at least itself? + return {}; // return at least itself? } if (*this != Dialect::AnyLanguage) langs << Dialect::AnyLanguage; diff --git a/src/libs/utils/differ.cpp b/src/libs/utils/differ.cpp index 2d27de3f80b..bc7dda6f302 100644 --- a/src/libs/utils/differ.cpp +++ b/src/libs/utils/differ.cpp @@ -578,7 +578,7 @@ static QList<Diff> decodeExpandedWhitespace(const QList<Diff> &input, const int replacementSize = it.value().first; const int reversePosition = diffCount + counter - it.key(); if (reversePosition < replacementSize) - return QList<Diff>(); // replacement exceeds one Diff + return {}; // replacement exceeds one Diff const QString replacement = it.value().second; const int updatedDiffCount = diff.text.size(); diff.text.replace(updatedDiffCount - reversePosition, @@ -977,7 +977,7 @@ Differ::DiffMode Differ::diffMode() const QList<Diff> Differ::preprocess1AndDiff(const QString &text1, const QString &text2) { if (text1.isNull() && text2.isNull()) - return QList<Diff>(); + return {}; if (text1 == text2) { QList<Diff> diffList; @@ -1074,7 +1074,7 @@ QList<Diff> Differ::diffMyers(const QString &text1, const QString &text2) if (m_future && m_future->isCanceled()) { delete [] forwardV; delete [] reverseV; - return QList<Diff>(); + return {}; } // going forward for (int k = qMax(-d, kMinForward + qAbs(d + kMinForward) % 2); diff --git a/src/libs/utils/wizard.cpp b/src/libs/utils/wizard.cpp index ce37d80705e..d80ef32c524 100644 --- a/src/libs/utils/wizard.cpp +++ b/src/libs/utils/wizard.cpp @@ -630,7 +630,7 @@ QList<WizardProgressItem *> WizardProgressPrivate::singlePathBetween(WizardProgr if (!item) item = m_startItem; if (!item) - return QList<WizardProgressItem *>(); + return {}; // Optimization. It is workaround for case A->B, B->C, A->C where "from" is A and "to" is C. // When we had X->A in addition and "from" was X and "to" was C, this would not work @@ -666,7 +666,7 @@ QList<WizardProgressItem *> WizardProgressPrivate::singlePathBetween(WizardProgr while (itItem != itEnd) { path.prepend(itItem.key()); if (itItem.value().count() != 1) - return QList<WizardProgressItem *>(); + return {}; it = itItem.value().constBegin().key(); if (it == item) return path; diff --git a/src/plugins/autotest/testtreeitem.cpp b/src/plugins/autotest/testtreeitem.cpp index 69481b60cad..adfacf7731f 100644 --- a/src/plugins/autotest/testtreeitem.cpp +++ b/src/plugins/autotest/testtreeitem.cpp @@ -331,7 +331,7 @@ ITestConfiguration *TestTreeItem::asConfiguration(TestRunMode mode) const QList<ITestConfiguration *> TestTreeItem::getTestConfigurationsForFile(const FilePath &) const { - return QList<ITestConfiguration *>(); + return {}; } bool TestTreeItem::isGroupNodeFor(const TestTreeItem *other) const diff --git a/src/plugins/coreplugin/editormanager/documentmodel.cpp b/src/plugins/coreplugin/editormanager/documentmodel.cpp index 090c7601e1d..e8183401bf6 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.cpp +++ b/src/plugins/coreplugin/editormanager/documentmodel.cpp @@ -590,7 +590,7 @@ QList<IEditor *> DocumentModel::editorsForFilePath(const Utils::FilePath &filePa IDocument *document = documentForFilePath(filePath); if (document) return editorsForDocument(document); - return QList<IEditor *>(); + return {}; } DocumentModel::Entry *DocumentModel::entryAtRow(int row) diff --git a/src/plugins/coreplugin/sidebar.cpp b/src/plugins/coreplugin/sidebar.cpp index c7a9b922647..e1cf32777b3 100644 --- a/src/plugins/coreplugin/sidebar.cpp +++ b/src/plugins/coreplugin/sidebar.cpp @@ -42,7 +42,7 @@ QString SideBarItem::title() const QList<QToolButton *> SideBarItem::createToolBarWidgets() { - return QList<QToolButton *>(); + return {}; } struct SideBarPrivate { diff --git a/src/plugins/cppeditor/cppoutline.cpp b/src/plugins/cppeditor/cppoutline.cpp index 0d8883f631d..bbb641dc959 100644 --- a/src/plugins/cppeditor/cppoutline.cpp +++ b/src/plugins/cppeditor/cppoutline.cpp @@ -112,7 +112,7 @@ CppOutlineWidget::CppOutlineWidget(CppEditorWidget *editor) : QList<QAction*> CppOutlineWidget::filterMenuActions() const { - return QList<QAction*>(); + return {}; } void CppOutlineWidget::setCursorSynchronization(bool syncWithCursor) diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 18da315a764..3f292769f1e 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -57,8 +57,7 @@ public: QList<TestDocumentPtr> singleDocument(const QByteArray &original, const QByteArray &expected) { - return QList<TestDocumentPtr>() - << CppTestDocument::create("file.cpp", original, expected); + return {CppTestDocument::create("file.cpp", original, expected)}; } BaseQuickFixTestCase::BaseQuickFixTestCase(const QList<TestDocumentPtr> &testDocuments, diff --git a/src/plugins/cppeditor/cpptoolstestcase.cpp b/src/plugins/cppeditor/cpptoolstestcase.cpp index 63949229abe..420e551847d 100644 --- a/src/plugins/cppeditor/cpptoolstestcase.cpp +++ b/src/plugins/cppeditor/cpptoolstestcase.cpp @@ -332,7 +332,7 @@ QList<CPlusPlus::Document::Ptr> TestCase::waitForFilesInGlobalSnapshot(const Fil break; } if (t.elapsed() > timeOutInMs) - return QList<CPlusPlus::Document::Ptr>(); + return {}; QCoreApplication::processEvents(); } } diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp index 0432985eafb..8ee45c8e79f 100644 --- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp +++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp @@ -174,7 +174,7 @@ private: QList<TestDocumentPtr> singleDocument(const QByteArray &source) { - return QList<TestDocumentPtr>() << CppTestDocument::create(source, "file.cpp"); + return {CppTestDocument::create(source, "file.cpp")}; } /** diff --git a/src/plugins/debugger/analyzer/detailederrorview.cpp b/src/plugins/debugger/analyzer/detailederrorview.cpp index 6817ef75f34..06941ac1148 100644 --- a/src/plugins/debugger/analyzer/detailederrorview.cpp +++ b/src/plugins/debugger/analyzer/detailederrorview.cpp @@ -134,7 +134,7 @@ QList<QAction *> DetailedErrorView::commonActions() const QList<QAction *> DetailedErrorView::customActions() const { - return QList<QAction *>(); + return {}; } int DetailedErrorView::currentRow() const diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 2255d96b5e9..849c34e35cd 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -299,7 +299,7 @@ QWidget *AppOutputPane::outputWidget(QWidget *) return m_tabWidget; } -QList<QWidget*> AppOutputPane::toolBarWidgets() const +QList<QWidget *> AppOutputPane::toolBarWidgets() const { return QList<QWidget *>{m_reRunButton, m_stopButton, m_attachButton, m_settingsButton, m_formatterWidget} + IOutputPane::toolBarWidgets(); diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index ea900407bf9..2b881a47168 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -607,7 +607,7 @@ ToolChain *ToolChainKitAspect::cxxToolChain(const Kit *k) QList<ToolChain *> ToolChainKitAspect::toolChains(const Kit *k) { - QTC_ASSERT(k, return QList<ToolChain *>()); + QTC_ASSERT(k, return {}); const QVariantMap value = k->value(ToolChainKitAspect::id()).toMap(); const QList<ToolChain *> tcList diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp b/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp index 565766dff4b..0a36120a64b 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp @@ -55,8 +55,8 @@ static QString qt5PluginMetaData(const QString &interfaceName) + interfaceName + QLatin1String("\")"); } -QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationParameters& p, const PluginOptions &options, - QString *errorMessage) +QList<Core::GeneratedFile> PluginGenerator::generatePlugin( + const GenerationParameters& p, const PluginOptions &options, QString *errorMessage) { const QChar slash = QLatin1Char('/'); const QChar blank = QLatin1Char(' '); @@ -93,7 +93,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara qt5PluginMetaData(QLatin1String("QDesignerCustomWidgetInterface")) : QString()); const QString pluginHeaderContents = processTemplate(p.templatePath + QLatin1String("/tpl_single.h"), sm, errorMessage); if (pluginHeaderContents.isEmpty()) - return QList<Core::GeneratedFile>(); + return {}; Core::GeneratedFile pluginHeader(baseDir / wo.pluginHeaderFile); pluginHeader.setContents(CppEditor::AbstractEditorSupport::licenseTemplate( project, FilePath::fromString(wo.pluginHeaderFile), @@ -121,7 +121,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara const QString pluginSourceContents = processTemplate(p.templatePath + QLatin1String("/tpl_single.cpp"), sm, errorMessage); if (pluginSourceContents.isEmpty()) - return QList<Core::GeneratedFile>(); + return {}; Core::GeneratedFile pluginSource(baseDir / wo.pluginSourceFile); pluginSource.setContents(CppEditor::AbstractEditorSupport::licenseTemplate( project, @@ -157,7 +157,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara if (pc.library != wo.widgetLibrary) { *errorMessage = Tr::tr("Creating multiple widget libraries (%1, %2) in one project (%3) is not supported.") .arg(pc.library, wo.widgetLibrary, wo.widgetProjectFile); - return QList<Core::GeneratedFile>(); + return {}; } } pc.headers += blank + wo.widgetHeaderFile; @@ -169,7 +169,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara sm.insert(QLatin1String("WIDGET_CLASS"), wo.widgetClassName); const QString widgetHeaderContents = processTemplate(p.templatePath + QLatin1String("/tpl_widget.h"), sm, errorMessage); if (widgetHeaderContents.isEmpty()) - return QList<Core::GeneratedFile>(); + return {}; Core::GeneratedFile widgetHeader(baseDir / wo.widgetHeaderFile); widgetHeader.setContents(CppEditor::AbstractEditorSupport::licenseTemplate( project, @@ -182,7 +182,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara sm.insert(QLatin1String("WIDGET_HEADER"), wo.widgetHeaderFile); const QString widgetSourceContents = processTemplate(p.templatePath + QLatin1String("/tpl_widget.cpp"), sm, errorMessage); if (widgetSourceContents.isEmpty()) - return QList<Core::GeneratedFile>(); + return {}; Core::GeneratedFile widgetSource(baseDir / wo.widgetSourceFile); widgetSource.setContents(CppEditor::AbstractEditorSupport::licenseTemplate( project, @@ -206,7 +206,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara sm.insert(QLatin1String("WIDGET_LIBRARY"), pc.library); const QString widgetPriContents = processTemplate(pc.tmpl, sm, errorMessage); if (widgetPriContents.isEmpty()) - return QList<Core::GeneratedFile>(); + return {}; Core::GeneratedFile widgetPri(baseDir / it.key()); widgetPri.setContents(widgetPriContents); rc.push_back(widgetPri); @@ -220,7 +220,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara sm.insert(QLatin1String("COLLECTION_PLUGIN_METADATA"), qt5PluginMetaData(QLatin1String("QDesignerCustomWidgetCollectionInterface"))); const QString collectionHeaderContents = processTemplate(p.templatePath + QLatin1String("/tpl_collection.h"), sm, errorMessage); if (collectionHeaderContents.isEmpty()) - return QList<Core::GeneratedFile>(); + return {}; Core::GeneratedFile collectionHeader(baseDir / options.collectionHeaderFile); collectionHeader.setContents(CppEditor::AbstractEditorSupport::licenseTemplate( project, @@ -238,7 +238,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara sm.insert(QLatin1String("PLUGIN_ADDITIONS"), pluginAdditions); const QString collectionSourceFileContents = processTemplate(p.templatePath + QLatin1String("/tpl_collection.cpp"), sm, errorMessage); if (collectionSourceFileContents.isEmpty()) - return QList<Core::GeneratedFile>(); + return {}; Core::GeneratedFile collectionSource(baseDir / options.collectionSourceFile); collectionSource.setContents(CppEditor::AbstractEditorSupport::licenseTemplate( project, @@ -263,7 +263,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara newIcon, errorMessage); if (iconFile.filePath().isEmpty()) - return QList<Core::GeneratedFile>(); + return {}; rc.push_back(iconFile); icon = qfi.fileName(); } @@ -274,7 +274,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara sm.insert(QLatin1String("ICON_FILES"), iconFiles); const QString resourceFileContents = processTemplate(p.templatePath + QLatin1String("/tpl_resources.qrc"), sm, errorMessage); if (resourceFileContents.isEmpty()) - return QList<Core::GeneratedFile>(); + return {}; Core::GeneratedFile resourceFile(baseDir / options.resourceFile); resourceFile.setContents(resourceFileContents); rc.push_back(resourceFile); @@ -289,7 +289,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara sm.insert(QLatin1String("INCLUSIONS"), QStringList(Utils::toList(widgetProjects)).join(QLatin1Char('\n'))); const QString proFileContents = processTemplate(p.templatePath + QLatin1String("/tpl_plugin.pro"), sm, errorMessage); if (proFileContents.isEmpty()) - return QList<Core::GeneratedFile>(); + return {}; Core::GeneratedFile proFile(baseDir.pathAppended(p.fileName + ".pro")); proFile.setContents(proFileContents); proFile.setAttributes(Core::GeneratedFile::OpenProjectAttribute); diff --git a/src/plugins/qmldesigner/components/formeditor/movetool.cpp b/src/plugins/qmldesigner/components/formeditor/movetool.cpp index 76b8f9a5f64..0d486b0f4f9 100644 --- a/src/plugins/qmldesigner/components/formeditor/movetool.cpp +++ b/src/plugins/qmldesigner/components/formeditor/movetool.cpp @@ -355,10 +355,9 @@ QList<FormEditorItem*> MoveTool::movingItems(const QList<FormEditorItem*> &selec if (ancestorItem != nullptr && ancestorItem->qmlItemNode().isRootNode()) { // view()->changeToSelectionTool(); - return QList<FormEditorItem*>(); + return {}; } - if (ancestorItem != nullptr && ancestorItem->parentItem() != nullptr) { QList<FormEditorItem*> ancestorItemList; ancestorItemList.append(ancestorItem); @@ -367,7 +366,7 @@ QList<FormEditorItem*> MoveTool::movingItems(const QList<FormEditorItem*> &selec if (!haveSameParent(filteredItemList)) { // view()->changeToSelectionTool(); - return QList<FormEditorItem*>(); + return {}; } return filteredItemList; diff --git a/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp b/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp index 0dd61b61eb7..0f12c6ce2de 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp @@ -434,7 +434,7 @@ QList<NamedEasingCurve> PresetList::storedCurves() const QVariant presetSettings = settings.value(Internal::settingsKey); if (!presetSettings.isValid()) - return QList<NamedEasingCurve>(); + return {}; QList<QVariant> presets = presetSettings.toList(); diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp index b68dc98eaf8..9cc45d1f336 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp @@ -482,7 +482,7 @@ QList<QmlTimeline> TimelineView::getTimelines() const QList<ModelNode> TimelineView::getAnimations(const QmlTimeline &timeline) { if (!timeline.isValid()) - return QList<ModelNode>(); + return {}; if (isAttached()) { return Utils::filtered(timeline.modelNode().directSubModelNodes(), diff --git a/src/plugins/qmldesigner/designercore/model/nodelistproperty.cpp b/src/plugins/qmldesigner/designercore/model/nodelistproperty.cpp index 0822786467e..4f8e84e8a44 100644 --- a/src/plugins/qmldesigner/designercore/model/nodelistproperty.cpp +++ b/src/plugins/qmldesigner/designercore/model/nodelistproperty.cpp @@ -68,13 +68,13 @@ QList<ModelNode> NodeListProperty::toModelNodeList() const if (internalNodeListProperty()) return internalNodesToModelNodes(m_internalNodeListProperty->nodeList(), model(), view()); - return QList<ModelNode>(); + return {}; } QList<QmlObjectNode> NodeListProperty::toQmlObjectNodeList() const { if (model()->nodeInstanceView()) - return QList<QmlObjectNode>(); + return {}; QList<QmlObjectNode> qmlObjectNodeList; diff --git a/src/plugins/squish/squishoutputpane.cpp b/src/plugins/squish/squishoutputpane.cpp index 8c8047f47f4..da0c8792c45 100644 --- a/src/plugins/squish/squishoutputpane.cpp +++ b/src/plugins/squish/squishoutputpane.cpp @@ -115,7 +115,7 @@ QWidget *SquishOutputPane::outputWidget(QWidget *parent) QList<QWidget *> SquishOutputPane::toolBarWidgets() const { - return QList<QWidget *>() << m_filterButton << m_expandAll << m_collapseAll; + return {m_filterButton, m_expandAll, m_collapseAll}; } QString SquishOutputPane::displayName() const diff --git a/src/plugins/todo/lineparser.cpp b/src/plugins/todo/lineparser.cpp index 2dace7a4df2..334bccfae08 100644 --- a/src/plugins/todo/lineparser.cpp +++ b/src/plugins/todo/lineparser.cpp @@ -79,7 +79,7 @@ QList<LineParser::KeywordEntry> LineParser::keywordEntriesFromCandidates( { // Ensure something is found if (candidates.isEmpty()) - return QList<KeywordEntry>(); + return {}; // Convert candidates to entries std::vector<KeywordEntry> tmp; diff --git a/src/tools/qml2puppet/qml2puppet/instances/objectnodeinstance.cpp b/src/tools/qml2puppet/qml2puppet/instances/objectnodeinstance.cpp index 373bd6dbefb..74a45b92b6e 100644 --- a/src/tools/qml2puppet/qml2puppet/instances/objectnodeinstance.cpp +++ b/src/tools/qml2puppet/qml2puppet/instances/objectnodeinstance.cpp @@ -708,12 +708,12 @@ QString ObjectNodeInstance::instanceType(const PropertyName &name) const QList<ServerNodeInstance> ObjectNodeInstance::childItems() const { - return QList<ServerNodeInstance>(); + return {}; } QList<QQuickItem *> ObjectNodeInstance::allItemsRecursive() const { - return QList<QQuickItem *>(); + return {}; } QList<ServerNodeInstance> ObjectNodeInstance::stateInstances() const @@ -728,7 +728,7 @@ QList<ServerNodeInstance> ObjectNodeInstance::stateInstances() const return instanceList; } - return QList<ServerNodeInstance>(); + return {}; } void ObjectNodeInstance::setNodeSource(const QString & /*source*/) diff --git a/src/tools/qml2puppet/qml2puppet/instances/qt5nodeinstanceserver.cpp b/src/tools/qml2puppet/qml2puppet/instances/qt5nodeinstanceserver.cpp index e520079a5d1..813e40f4a3a 100644 --- a/src/tools/qml2puppet/qml2puppet/instances/qt5nodeinstanceserver.cpp +++ b/src/tools/qml2puppet/qml2puppet/instances/qt5nodeinstanceserver.cpp @@ -202,7 +202,7 @@ const QList<QQuickItem*> Qt5NodeInstanceServer::allItems() const if (rootNodeInstance().isValid()) return rootNodeInstance().allItemsRecursive(); - return QList<QQuickItem*>(); + return {}; } bool Qt5NodeInstanceServer::rootIsRenderable3DObject() const From 925bb2ca312f3489a8d9ed48c35bb4f80e9815fa Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 21:26:29 +0200 Subject: [PATCH 0570/1777] Various Plugins: Simplify return QStringList statements Change-Id: Id014225851e6b9f8436387c681bea42e5de3b797 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/libs/utils/commandline.cpp | 8 ++++---- src/libs/utils/filesystemmodel.cpp | 2 +- src/libs/utils/pathlisteditor.cpp | 2 +- src/plugins/autotest/boost/boosttestconfiguration.cpp | 2 +- src/plugins/autotoolsprojectmanager/makefileparser.cpp | 6 +++--- src/plugins/beautifier/beautifiertool.cpp | 2 +- src/plugins/clangtools/clangtoolsutils.cpp | 2 +- src/plugins/cppeditor/cppeditorplugin.cpp | 4 ++-- src/plugins/cvs/cvseditor.cpp | 2 +- src/plugins/genericprojectmanager/genericproject.cpp | 2 +- src/plugins/git/branchmodel.cpp | 3 +-- src/plugins/git/giteditor.cpp | 2 +- src/plugins/perforce/perforceeditor.cpp | 2 +- .../components/connectioneditor/bindingmodel.cpp | 6 +++--- .../connectioneditor/dynamicpropertiesmodel.cpp | 4 ++-- .../propertyeditor/propertyeditorcontextobject.cpp | 2 +- .../components/stateseditor/stateseditormodel.cpp | 2 +- .../components/stateseditor/stateseditorview.cpp | 2 +- .../designercore/include/plaintexteditmodifier.h | 2 +- .../qmldesigner/designercore/metainfo/nodemetainfo.cpp | 4 ++-- .../designercore/metainfo/subcomponentmanager.cpp | 2 +- .../designercore/model/basetexteditmodifier.cpp | 2 +- .../designercore/pluginmanager/widgetpluginpath.cpp | 2 +- src/plugins/qmldesigner/documentmanager.cpp | 6 +++--- src/plugins/qtsupport/baseqtversion.cpp | 4 ++-- src/plugins/squish/propertytreeitem.cpp | 2 +- src/plugins/subversion/subversioneditor.cpp | 2 +- src/plugins/vcsbase/vcsbaseclient.cpp | 2 +- src/plugins/vcsbase/vcsbaseeditor.cpp | 2 +- src/plugins/vcsbase/vcsbasesubmiteditor.cpp | 2 +- tests/auto/qml/codemodel/ecmascript7/tst_ecmascript7.cpp | 2 +- 31 files changed, 44 insertions(+), 45 deletions(-) diff --git a/src/libs/utils/commandline.cpp b/src/libs/utils/commandline.cpp index 60b8d72eed2..8e6bc60277e 100644 --- a/src/libs/utils/commandline.cpp +++ b/src/libs/utils/commandline.cpp @@ -182,7 +182,7 @@ static QStringList doSplitArgsWin(const QString &args, ProcessArgs::SplitError * if (inquote) { if (err) *err = ProcessArgs::BadQuoting; - return QStringList(); + return {}; } break; } @@ -265,7 +265,7 @@ static QStringList splitArgsWin(const QString &_args, bool abortOnMeta, err = &perr; QString args = prepareArgsWin(_args, &perr, env, pwd).toWindowsArgs(); if (*err != ProcessArgs::SplitOk) - return QStringList(); + return {}; return doSplitArgsWin(args, err); } else { QString args = _args; @@ -470,12 +470,12 @@ static QStringList splitArgsUnix(const QString &args, bool abortOnMeta, quoteerr: if (err) *err = ProcessArgs::BadQuoting; - return QStringList(); + return {}; metaerr: if (err) *err = ProcessArgs::FoundMeta; - return QStringList(); + return {}; } inline static bool isSpecialCharUnix(ushort c) diff --git a/src/libs/utils/filesystemmodel.cpp b/src/libs/utils/filesystemmodel.cpp index 9a10f3b91fc..a6bce17cabc 100644 --- a/src/libs/utils/filesystemmodel.cpp +++ b/src/libs/utils/filesystemmodel.cpp @@ -2520,7 +2520,7 @@ QStringList FileSystemModelPrivate::unwatchPathsAt(const QModelIndex &index) QTC_CHECK(useFileSystemWatcher()); const FileSystemNode *indexNode = node(index); if (indexNode == nullptr) - return QStringList(); + return {}; const Qt::CaseSensitivity caseSensitivity = indexNode->caseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive; const QString path = indexNode->fileInfo().absoluteFilePath(); diff --git a/src/libs/utils/pathlisteditor.cpp b/src/libs/utils/pathlisteditor.cpp index f2349b275fd..383ca88b030 100644 --- a/src/libs/utils/pathlisteditor.cpp +++ b/src/libs/utils/pathlisteditor.cpp @@ -138,7 +138,7 @@ QStringList PathListEditor::pathList() const { const QString text = d->edit->toPlainText().trimmed(); if (text.isEmpty()) - return QStringList(); + return {}; // trim each line QStringList rc = text.split('\n', Qt::SkipEmptyParts); const QStringList::iterator end = rc.end(); diff --git a/src/plugins/autotest/boost/boosttestconfiguration.cpp b/src/plugins/autotest/boost/boosttestconfiguration.cpp index 15cc0d8bbfe..af3f1e9eb18 100644 --- a/src/plugins/autotest/boost/boosttestconfiguration.cpp +++ b/src/plugins/autotest/boost/boosttestconfiguration.cpp @@ -46,7 +46,7 @@ static QStringList interfering(InterferingType type) return QString("BOOST_TEST_" + item).toUpper(); }); } - return QStringList(); + return {}; } static QStringList filterInterfering(const QStringList &provided, QStringList *omitted) diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.cpp b/src/plugins/autotoolsprojectmanager/makefileparser.cpp index e1cac6b1866..8a2f684f877 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparser.cpp +++ b/src/plugins/autotoolsprojectmanager/makefileparser.cpp @@ -300,7 +300,7 @@ QStringList MakefileParser::directorySources(const QString &directory, { if (isCanceled()) { m_success = false; - return QStringList(); + return {}; } emit status(Tr::tr("Parsing directory %1").arg(directory)); @@ -343,7 +343,7 @@ QStringList MakefileParser::targetValues(bool *hasVariables) const int index = m_line.indexOf(QLatin1Char('=')); if (index < 0) { m_success = false; - return QStringList(); + return {}; } m_line.remove(0, index + 1); // remove the 'target = ' prefix @@ -423,7 +423,7 @@ QStringList MakefileParser::parseTermsAfterAssign(const QString &line) { int assignPos = line.indexOf(QLatin1Char('=')) + 1; if (assignPos <= 0 || assignPos >= line.size()) - return QStringList(); + return {}; const QStringList parts = ProcessArgs::splitArgs(line.mid(assignPos), HostOsInfo::hostOs()); QStringList result; diff --git a/src/plugins/beautifier/beautifiertool.cpp b/src/plugins/beautifier/beautifiertool.cpp index 6f5c4731c60..01f470ad7c5 100644 --- a/src/plugins/beautifier/beautifiertool.cpp +++ b/src/plugins/beautifier/beautifiertool.cpp @@ -180,7 +180,7 @@ AbstractSettings::~AbstractSettings() = default; QStringList AbstractSettings::completerWords() { - return QStringList(); + return {}; } QStringList AbstractSettings::styles() const diff --git a/src/plugins/clangtools/clangtoolsutils.cpp b/src/plugins/clangtools/clangtoolsutils.cpp index de3ac2b9cba..effab6f3252 100644 --- a/src/plugins/clangtools/clangtoolsutils.cpp +++ b/src/plugins/clangtools/clangtoolsutils.cpp @@ -280,7 +280,7 @@ ClangDiagnosticConfig diagnosticConfig(const Utils::Id &diagConfigId) static QStringList extraOptions(const QString &envVar) { if (!qtcEnvironmentVariableIsSet(envVar)) - return QStringList(); + return {}; QString arguments = qtcEnvironmentVariable(envVar); return ProcessArgs::splitArgs(arguments, HostOsInfo::hostOs()); } diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 40f1917a5a9..e47c939d280 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -663,7 +663,7 @@ static QStringList findFilesInProject(const QString &name, const Project *projec qDebug() << Q_FUNC_INFO << name << project; if (!project) - return QStringList(); + return {}; QString pattern = QString(1, QLatin1Char('/')); pattern += name; @@ -702,7 +702,7 @@ static QStringList matchingCandidateSuffixes(ProjectFile::Kind kind) case ProjectFile::OpenCLSource: return mimeTypeForName(Constants::CPP_HEADER_MIMETYPE).suffixes(); default: - return QStringList(); + return {}; } } diff --git a/src/plugins/cvs/cvseditor.cpp b/src/plugins/cvs/cvseditor.cpp index 5a62103fd57..0a9298bd47e 100644 --- a/src/plugins/cvs/cvseditor.cpp +++ b/src/plugins/cvs/cvseditor.cpp @@ -101,7 +101,7 @@ VcsBase::BaseAnnotationHighlighter *CvsEditorWidget::createAnnotationHighlighter QStringList CvsEditorWidget::annotationPreviousVersions(const QString &revision) const { if (isFirstRevision(revision)) - return QStringList(); + return {}; return QStringList(previousRevision(revision)); } diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index d0f21bb0942..6a718e92a44 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -398,7 +398,7 @@ static QStringList readFlags(const QString &filePath) { const QStringList lines = readLines(filePath); if (lines.isEmpty()) - return QStringList(); + return {}; QStringList flags; for (const auto &line : lines) flags.append(ProcessArgs::splitArgs(line, HostOsInfo::hostOs())); diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp index 0702c4a0aac..df38ea9961a 100644 --- a/src/plugins/git/branchmodel.cpp +++ b/src/plugins/git/branchmodel.cpp @@ -543,8 +543,7 @@ QString BranchModel::fullName(const QModelIndex &idx, bool includePrefix) const QStringList BranchModel::localBranchNames() const { if (!d->rootNode || !d->rootNode->count()) - return QStringList(); - + return {}; return d->rootNode->children.at(LocalBranches)->childrenNames() + d->obsoleteLocalBranches; } diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index 76df05d53b1..717704ff028 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -292,7 +292,7 @@ QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision) if (!gitClient().synchronousParentRevisions( sourceWorkingDirectory(), revision, &revisions, &errorMessage)) { VcsOutputWindow::appendSilently(errorMessage); - return QStringList(); + return {}; } return revisions; } diff --git a/src/plugins/perforce/perforceeditor.cpp b/src/plugins/perforce/perforceeditor.cpp index 2483f0dc522..ec418a7cedd 100644 --- a/src/plugins/perforce/perforceeditor.cpp +++ b/src/plugins/perforce/perforceeditor.cpp @@ -70,7 +70,7 @@ QStringList PerforceEditorWidget::annotationPreviousVersions(const QString &v) c bool ok; const int changeList = v.toInt(&ok); if (!ok || changeList < 2) - return QStringList(); + return {}; return QStringList(QString::number(changeList - 1)); } diff --git a/src/plugins/qmldesigner/components/connectioneditor/bindingmodel.cpp b/src/plugins/qmldesigner/components/connectioneditor/bindingmodel.cpp index 2b2025ed83a..a5562059d67 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/bindingmodel.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/bindingmodel.cpp @@ -134,7 +134,7 @@ QStringList BindingModel::possibleTargetProperties(const BindingProperty &bindin if (!modelNode.isValid()) { qWarning() << " BindingModel::possibleTargetPropertiesForRow invalid model node"; - return QStringList(); + return {}; } NodeMetaInfo metaInfo = modelNode.metaInfo(); @@ -151,7 +151,7 @@ QStringList BindingModel::possibleTargetProperties(const BindingProperty &bindin return writableProperties; } - return QStringList(); + return {}; } QStringList BindingModel::possibleSourceProperties(const BindingProperty &bindingProperty) const @@ -191,7 +191,7 @@ QStringList BindingModel::possibleSourceProperties(const BindingProperty &bindin } qWarning() << " BindingModel::possibleSourcePropertiesForRow invalid model node"; - return QStringList(); + return {}; } NodeMetaInfo metaInfo = modelNode.metaInfo(); diff --git a/src/plugins/qmldesigner/components/connectioneditor/dynamicpropertiesmodel.cpp b/src/plugins/qmldesigner/components/connectioneditor/dynamicpropertiesmodel.cpp index eb0976eaed9..bfd5e16be97 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/dynamicpropertiesmodel.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/dynamicpropertiesmodel.cpp @@ -463,7 +463,7 @@ QStringList DynamicPropertiesModel::possibleTargetProperties(const BindingProper if (!modelNode.isValid()) { qWarning() << " BindingModel::possibleTargetPropertiesForRow invalid model node"; - return QStringList(); + return {}; } NodeMetaInfo metaInfo = modelNode.metaInfo(); @@ -519,7 +519,7 @@ QStringList DynamicPropertiesModel::possibleSourceProperties(const BindingProper if (!modelNode.isValid()) { qWarning() << " BindingModel::possibleSourcePropertiesForRow invalid model node"; - return QStringList(); + return {}; } NodeMetaInfo metaInfo = modelNode.metaInfo(); diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp index 8c9b19d62ee..a8d7fb5a6fc 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp @@ -131,7 +131,7 @@ QStringList PropertyEditorContextObject::autoComplete(const QString &text, int p return Utils::filtered(m_model->rewriterView()->autoComplete(text, pos, explicitComplete), [filter](const QString &string) { return !filter || (!string.isEmpty() && string.at(0).isUpper()); }); - return QStringList(); + return {}; } void PropertyEditorContextObject::toogleExportAlias() diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp index 0b53af121b8..8c3e79e9764 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp @@ -218,7 +218,7 @@ QStringList StatesEditorModel::autoComplete(const QString &text, int pos, bool e if (model && model->rewriterView()) return model->rewriterView()->autoComplete(text, pos, explicitComplete); - return QStringList(); + return {}; } QVariant StatesEditorModel::stateModelNode(int internalNodeId) diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp index 03cd658f22a..5df44802e4b 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp @@ -499,7 +499,7 @@ bool StatesEditorView::hasExtend() const QStringList StatesEditorView::extendedStates() const { if (!model()) - return QStringList(); + return {}; QStringList states; diff --git a/src/plugins/qmldesigner/designercore/include/plaintexteditmodifier.h b/src/plugins/qmldesigner/designercore/include/plaintexteditmodifier.h index 4172e8921ee..843af9f8af0 100644 --- a/src/plugins/qmldesigner/designercore/include/plaintexteditmodifier.h +++ b/src/plugins/qmldesigner/designercore/include/plaintexteditmodifier.h @@ -48,7 +48,7 @@ public: { return false; } QStringList autoComplete(QTextDocument * /*textDocument*/, int /*position*/, bool /*explicitComplete*/) override - { return QStringList(); } + { return {}; } bool moveToComponent(int /* nodeOffset */) override { return false; } diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp index 5121e6a663c..004bad1674e 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp @@ -1167,11 +1167,11 @@ Model *NodeMetaInfoPrivate::model() const QStringList NodeMetaInfoPrivate::keysForEnum(const QString &enumName) const { if (!isValid()) - return QStringList(); + return {}; const CppComponentValue *qmlObjectValue = getNearestCppComponentValue(); if (!qmlObjectValue) - return QStringList(); + return {}; return qmlObjectValue->getEnum(enumName).keys(); } diff --git a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp index 0afd0d735c7..b793cf03c32 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp @@ -384,7 +384,7 @@ QStringList SubComponentManager::importPaths() const if (model()) return model()->importPaths(); - return QStringList(); + return {}; } void SubComponentManager::parseQuick3DAssetsDir(const QString &quick3DAssetsPath) diff --git a/src/plugins/qmldesigner/designercore/model/basetexteditmodifier.cpp b/src/plugins/qmldesigner/designercore/model/basetexteditmodifier.cpp index 69c74ec6cf8..2f4a27e09fd 100644 --- a/src/plugins/qmldesigner/designercore/model/basetexteditmodifier.cpp +++ b/src/plugins/qmldesigner/designercore/model/basetexteditmodifier.cpp @@ -132,5 +132,5 @@ QStringList BaseTextEditModifier::autoComplete(QTextDocument *textDocument, int document->filePath(), explicitComplete ? TextEditor::ExplicitlyInvoked : TextEditor::ActivationCharacter, document->semanticInfo()); - return QStringList(); + return {}; } diff --git a/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp b/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp index dc96b1a4001..953e4a6bf12 100644 --- a/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp +++ b/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp @@ -104,7 +104,7 @@ QStringList WidgetPluginPath::libraryFilePaths(const QDir &dir) { const QFileInfoList infoList = dir.entryInfoList(QDir::Files|QDir::Readable|QDir::NoDotAndDotDot); if (infoList.empty()) - return QStringList(); + return {}; // Load symbolic links but make sure all file names are unique as not // to fall for something like 'libplugin.so.1 -> libplugin.so' QStringList result; diff --git a/src/plugins/qmldesigner/documentmanager.cpp b/src/plugins/qmldesigner/documentmanager.cpp index 75ae05de56d..0ce1f5e07fd 100644 --- a/src/plugins/qmldesigner/documentmanager.cpp +++ b/src/plugins/qmldesigner/documentmanager.cpp @@ -361,19 +361,19 @@ QStringList DocumentManager::isoIconsQmakeVariableValue(const QString &proPath) ProjectExplorer::Node *node = ProjectExplorer::ProjectTree::nodeForFile(Utils::FilePath::fromString(proPath)); if (!node) { qCWarning(documentManagerLog) << "No node for .pro:" << proPath; - return QStringList(); + return {}; } ProjectExplorer::Node *parentNode = node->parentFolderNode(); if (!parentNode) { qCWarning(documentManagerLog) << "No parent node for node at" << proPath; - return QStringList(); + return {}; } auto proNode = dynamic_cast<QmakeProjectManager::QmakeProFileNode*>(parentNode); if (!proNode) { qCWarning(documentManagerLog) << "Parent node for node at" << proPath << "could not be converted to a QmakeProFileNode"; - return QStringList(); + return {}; } return proNode->variableValue(QmakeProjectManager::Variable::IsoIcons); diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index a5d42a6394d..f84408941a1 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -2116,7 +2116,7 @@ static QByteArray scanQtBinaryForBuildString(const FilePath &library) static QStringList extractFieldsFromBuildString(const QByteArray &buildString) { if (buildString.isEmpty() || buildString.size() > 4096) - return QStringList(); + return {}; const QRegularExpression buildStringMatcher("^Qt " "([\\d\\.a-zA-Z]*) " // Qt version @@ -2132,7 +2132,7 @@ static QStringList extractFieldsFromBuildString(const QByteArray &buildString) const QRegularExpressionMatch match = buildStringMatcher.match(QString::fromUtf8(buildString)); if (!match.hasMatch()) - return QStringList(); + return {}; QStringList result; result.append(match.captured(1)); // qtVersion diff --git a/src/plugins/squish/propertytreeitem.cpp b/src/plugins/squish/propertytreeitem.cpp index 3e16212a2d9..442d7f5b9a0 100644 --- a/src/plugins/squish/propertytreeitem.cpp +++ b/src/plugins/squish/propertytreeitem.cpp @@ -240,7 +240,7 @@ QStringList PropertiesModel::allPropertyNames() const { TreeItem *root = rootItem(); if (!root) - return QStringList(); + return {}; QStringList result; result.reserve(root->childCount()); diff --git a/src/plugins/subversion/subversioneditor.cpp b/src/plugins/subversion/subversioneditor.cpp index cf27b606a2d..c54371c7867 100644 --- a/src/plugins/subversion/subversioneditor.cpp +++ b/src/plugins/subversion/subversioneditor.cpp @@ -85,6 +85,6 @@ QStringList SubversionEditorWidget::annotationPreviousVersions(const QString &v) bool ok; const int revision = v.toInt(&ok); if (!ok || revision < 2) - return QStringList(); + return {}; return QStringList(QString::number(revision - 1)); } diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index 700f32284e5..93374712dd1 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -115,7 +115,7 @@ QStringList VcsBaseClientImpl::splitLines(const QString &s) if (output.endsWith(newLine)) output.truncate(output.size() - 1); if (output.isEmpty()) - return QStringList(); + return {}; return output.split(newLine); } diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 26c19c7f91e..036ddf12239 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -1454,7 +1454,7 @@ void VcsBaseEditorWidget::slotAnnotateRevision(const QString &change) QStringList VcsBaseEditorWidget::annotationPreviousVersions(const QString &) const { - return QStringList(); + return {}; } void VcsBaseEditorWidget::slotPaste() diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index 12d91b7b7a5..c6d8653ec23 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -385,7 +385,7 @@ SubmitFileModel *VcsBaseSubmitEditor::fileModel() const QStringList VcsBaseSubmitEditor::rowsToFiles(const QList<int> &rows) const { if (rows.empty()) - return QStringList(); + return {}; QStringList rc; const SubmitFileModel *model = fileModel(); diff --git a/tests/auto/qml/codemodel/ecmascript7/tst_ecmascript7.cpp b/tests/auto/qml/codemodel/ecmascript7/tst_ecmascript7.cpp index 003630ab0bf..ac0611aa85c 100644 --- a/tests/auto/qml/codemodel/ecmascript7/tst_ecmascript7.cpp +++ b/tests/auto/qml/codemodel/ecmascript7/tst_ecmascript7.cpp @@ -71,7 +71,7 @@ static QStringList readSkipList(const QDir &dir, const QString &filename) QStringList result; if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) - return QStringList(); + return {}; while (!f.atEnd()) { const QString s = QString::fromUtf8(f.readLine().trimmed()); From e9721641fcab78ca0e75409a11aca70ad239da5d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 09:42:56 +0200 Subject: [PATCH 0571/1777] TaskTree: Add static assert ensuring the right Adapter type Change-Id: I87e995151ec21963c5514dfdb1863cfd2bc457b9 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/libs/solutions/tasking/tasktree.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h index 88f89ef0c51..2cd6e42bdbf 100644 --- a/src/libs/solutions/tasking/tasktree.h +++ b/src/libs/solutions/tasking/tasktree.h @@ -318,6 +318,9 @@ class CustomTask : public GroupItem { public: using Task = typename Adapter::Type; + static_assert(std::is_base_of_v<TaskAdapter<Task>, Adapter>, + "The Adapter type for the CustomTask<Adapter> needs to be derived from " + "TaskAdapter<Task>."); using EndHandler = std::function<void(const Task &)>; static Adapter *createAdapter() { return new Adapter; } CustomTask() : GroupItem({&createAdapter}) {} From 82712e12f857b9c1d69d29e7582533c7cb75af6e Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 2 Aug 2023 08:01:11 +0200 Subject: [PATCH 0572/1777] Various Plugins: Simplify return QStringList statements Amends 925bb2ca312f3489a8d9ed48c35bb4f80e9815fa Change-Id: I57bee33cb7acd0ab1cdcfb6897a4847b912b4c97 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/libs/qmljs/qmljsfindexportedcpptypes.cpp | 2 +- src/libs/utils/dropsupport.cpp | 2 +- src/libs/utils/json.cpp | 2 +- src/libs/utils/mimetypes2/mimedatabase.cpp | 2 +- src/plugins/android/androiddeviceinfo.cpp | 4 ++-- src/plugins/autotest/qtest/qttest_utils.cpp | 6 +++--- src/plugins/coreplugin/dialogs/externaltoolconfig.cpp | 2 +- src/plugins/ios/iosdsymbuildstep.cpp | 8 ++++---- src/plugins/qmakeprojectmanager/qmakenodes.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp | 6 +----- src/plugins/qtsupport/baseqtversion.cpp | 2 +- src/plugins/qtsupport/qscxmlcgenerator.cpp | 5 ++--- src/plugins/squish/objectsmaptreeitem.cpp | 2 +- 14 files changed, 21 insertions(+), 26 deletions(-) diff --git a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp index 6b2c10b21a8..36125539776 100644 --- a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp +++ b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp @@ -827,7 +827,7 @@ FindExportedCppTypes::FindExportedCppTypes(const CPlusPlus::Snapshot &snapshot) QStringList FindExportedCppTypes::operator()(const CPlusPlus::Document::Ptr &document) { - QTC_ASSERT(!document.isNull(), return QStringList()); + QTC_ASSERT(!document.isNull(), return {}); m_contextProperties.clear(); m_exportedTypes.clear(); diff --git a/src/libs/utils/dropsupport.cpp b/src/libs/utils/dropsupport.cpp index 5fa9289a2ab..7416edf9c37 100644 --- a/src/libs/utils/dropsupport.cpp +++ b/src/libs/utils/dropsupport.cpp @@ -63,7 +63,7 @@ DropSupport::DropSupport(QWidget *parentWidget, const DropFilterFunction &filter QStringList DropSupport::mimeTypesForFilePaths() { - return QStringList("text/uri-list"); + return {"text/uri-list"}; } bool DropSupport::isFileDrop(QDropEvent *event) diff --git a/src/libs/utils/json.cpp b/src/libs/utils/json.cpp index 5afd4a685b7..d0f2518af32 100644 --- a/src/libs/utils/json.cpp +++ b/src/libs/utils/json.cpp @@ -252,7 +252,7 @@ QStringList JsonSchema::properties(JsonObjectValue *v) const QStringList JsonSchema::properties() const { - QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Object)), return QStringList()); + QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Object)), return {}); return properties(currentValue()); } diff --git a/src/libs/utils/mimetypes2/mimedatabase.cpp b/src/libs/utils/mimetypes2/mimedatabase.cpp index b703421d96f..cba76f733ae 100644 --- a/src/libs/utils/mimetypes2/mimedatabase.cpp +++ b/src/libs/utils/mimetypes2/mimedatabase.cpp @@ -223,7 +223,7 @@ MimeType MimeDatabasePrivate::mimeTypeForName(const QString &nameOrAlias) QStringList MimeDatabasePrivate::mimeTypeForFileName(const QString &fileName) { if (fileName.endsWith(QLatin1Char('/'))) - return QStringList() << QLatin1String("inode/directory"); + return {"inode/directory"}; const MimeGlobMatchResult result = findByFileName(fileName); QStringList matchingMimeTypes = result.m_matchingMimeTypes; diff --git a/src/plugins/android/androiddeviceinfo.cpp b/src/plugins/android/androiddeviceinfo.cpp index 4d34d7a57c9..3c00547d062 100644 --- a/src/plugins/android/androiddeviceinfo.cpp +++ b/src/plugins/android/androiddeviceinfo.cpp @@ -12,8 +12,8 @@ namespace Android { QStringList AndroidDeviceInfo::adbSelector(const QString &serialNumber) { if (serialNumber.startsWith(QLatin1String("????"))) - return QStringList("-d"); - return QStringList({"-s", serialNumber}); + return {"-d"}; + return {"-s", serialNumber}; } bool AndroidDeviceInfo::operator<(const AndroidDeviceInfo &other) const diff --git a/src/plugins/autotest/qtest/qttest_utils.cpp b/src/plugins/autotest/qtest/qttest_utils.cpp index e40f50448c3..3717a563862 100644 --- a/src/plugins/autotest/qtest/qttest_utils.cpp +++ b/src/plugins/autotest/qtest/qttest_utils.cpp @@ -99,13 +99,13 @@ QStringList filterInterfering(const QStringList &provided, QStringList *omitted, if (knownAllowedOptionsWithParameter.contains(currentOpt)) { allowed.append(currentOpt); ++it; - QTC_ASSERT(it != end, return QStringList()); + QTC_ASSERT(it != end, return {}); allowed.append(*it); } else if (knownInterferingOptionWithParameter.contains(currentOpt)) { if (omitted) { omitted->append(currentOpt); ++it; - QTC_ASSERT(it != end, return QStringList()); + QTC_ASSERT(it != end, return {}); omitted->append(*it); } } else if (knownInterferingSingleOptions.contains(currentOpt)) { @@ -115,7 +115,7 @@ QStringList filterInterfering(const QStringList &provided, QStringList *omitted, if (knownAllowedQuickOptionsWithParameter.contains(currentOpt)) { allowed.append(currentOpt); ++it; - QTC_ASSERT(it != end, return QStringList()); + QTC_ASSERT(it != end, return {}); allowed.append(*it); } else if (knownAllowedSingleQuickOptions.contains(currentOpt)) { allowed.append(currentOpt); diff --git a/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp b/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp index 59237aad79a..6883e930a5c 100644 --- a/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp +++ b/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp @@ -192,7 +192,7 @@ bool ExternalToolModel::dropMimeData(const QMimeData *data, QStringList ExternalToolModel::mimeTypes() const { - return QStringList("application/qtcreator-externaltool-config"); + return {"application/qtcreator-externaltool-config"}; } QModelIndex ExternalToolModel::index(int row, int column, const QModelIndex &parent) const diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index 2808cca8a2d..b7eb1f6abc1 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -129,11 +129,11 @@ FilePath IosDsymBuildStep::defaultCommand() const QStringList IosDsymBuildStep::defaultCleanCmdList() const { auto runConf = qobject_cast<IosRunConfiguration *>(target()->activeRunConfiguration()); - QTC_ASSERT(runConf, return QStringList("echo")); + QTC_ASSERT(runConf, return {"echo"}); QString dsymPath = runConf->bundleDirectory().toUserOutput(); dsymPath.chop(4); dsymPath.append(".dSYM"); - return QStringList({"rm", "-rf", dsymPath}); + return {"rm", "-rf", dsymPath}; } QStringList IosDsymBuildStep::defaultCmdList() const @@ -144,11 +144,11 @@ QStringList IosDsymBuildStep::defaultCmdList() const if (dsymUtilPath.exists()) dsymutilCmd = dsymUtilPath.toUserOutput(); auto runConf = qobject_cast<const IosRunConfiguration *>(target()->activeRunConfiguration()); - QTC_ASSERT(runConf, return QStringList("echo")); + QTC_ASSERT(runConf, return {"echo"}); QString dsymPath = runConf->bundleDirectory().toUserOutput(); dsymPath.chop(4); dsymPath.append(".dSYM"); - return QStringList({dsymutilCmd, "-o", dsymPath, runConf->localExecutable().toUserOutput()}); + return {dsymutilCmd, "-o", dsymPath, runConf->localExecutable().toUserOutput()}; } FilePath IosDsymBuildStep::command() const diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index 144a9cc0c9f..c83808e2d5f 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -167,7 +167,7 @@ bool QmakePriFileNode::removeSubProject(const FilePath &proFilePath) QStringList QmakePriFileNode::subProjectFileNamePatterns() const { - return QStringList("*.pro"); + return {"*.pro"}; } bool QmakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FilePaths *notAdded) diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index cae48809b7a..a4a56b51963 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -381,7 +381,7 @@ QStringList QMakeStep::parserArguments() // NOTE: extra parser args placed before the other args intentionally QStringList result = m_extraParserArgs; QtVersion *qt = QtKitAspect::qtVersion(kit()); - QTC_ASSERT(qt, return QStringList()); + QTC_ASSERT(qt, return {}); for (ProcessArgs::ConstArgIterator ait(allArguments(qt, ArgumentFlag::Expand)); ait.next(); ) { if (ait.isSimple()) result << ait.value(); diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp index 6b8a2020c97..92126d42e34 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp @@ -121,11 +121,7 @@ QStringList QmlProfilerStatisticsModel::details(int typeIndex) const data = data.left(maxColumnWidth - 1) + ellipsisChar; } - return QStringList({ - displayName, - data, - QString::number(durationPercent(typeIndex), 'f', 2) + QLatin1Char('%') - }); + return {displayName, data, QString::number(durationPercent(typeIndex), 'f', 2) + '%'}; } QString QmlProfilerStatisticsModel::summary(const QVector<int> &typeIds) const diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index f84408941a1..15a891dc110 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -2143,7 +2143,7 @@ static QStringList extractFieldsFromBuildString(const QByteArray &buildString) result.append(abiInfo.takeFirst()); // cpu const QString endian = abiInfo.takeFirst(); - QTC_ASSERT(endian.endsWith("_endian"), return QStringList()); + QTC_ASSERT(endian.endsWith("_endian"), return {}); result.append(endian.left(endian.size() - 7)); // without the "_endian" result.append(abiInfo.takeFirst()); // pointer diff --git a/src/plugins/qtsupport/qscxmlcgenerator.cpp b/src/plugins/qtsupport/qscxmlcgenerator.cpp index 7cb67f6171e..b0d41d9ba7a 100644 --- a/src/plugins/qtsupport/qscxmlcgenerator.cpp +++ b/src/plugins/qtsupport/qscxmlcgenerator.cpp @@ -68,10 +68,9 @@ Utils::FilePath QScxmlcGenerator::command() const QStringList QScxmlcGenerator::arguments() const { - QTC_ASSERT(!m_header.isEmpty(), return QStringList()); + QTC_ASSERT(!m_header.isEmpty(), return {}); - return QStringList({QLatin1String("--header"), m_header, QLatin1String("--impl"), m_impl, - tmpFile().fileName()}); + return {"--header", m_header, "--impl", m_impl, tmpFile().fileName()}; } Utils::FilePath QScxmlcGenerator::workingDirectory() const diff --git a/src/plugins/squish/objectsmaptreeitem.cpp b/src/plugins/squish/objectsmaptreeitem.cpp index 1fec8eafc34..1fd39366cde 100644 --- a/src/plugins/squish/objectsmaptreeitem.cpp +++ b/src/plugins/squish/objectsmaptreeitem.cpp @@ -346,7 +346,7 @@ void ObjectsMapModel::removeSymbolicName(const QModelIndex &idx) QStringList ObjectsMapModel::allSymbolicNames() const { TreeItem *root = rootItem(); - QTC_ASSERT(root, return QStringList()); + QTC_ASSERT(root, return {}); QMap<QString, PropertyList> objects; forAllItems([&objects](ObjectsMapTreeItem *item) { From 8dd46d03998e41d86890bcb7daaa20c6425a89b4 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 2 Aug 2023 08:09:26 +0200 Subject: [PATCH 0573/1777] Various Plugins: Simplify return FilePath statements Change-Id: Ia9efb86f722caca1492b577d51442f1f23b804b4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/libs/languageserverprotocol/lsptypes.cpp | 2 +- src/libs/qmljs/qmljsmodelmanagerinterface.cpp | 2 +- src/libs/qmljs/qmljsplugindumper.cpp | 4 ++-- src/libs/utils/fileinprojectfinder.cpp | 2 +- src/libs/utils/filepath.cpp | 4 ++-- src/plugins/android/androidconfigurations.cpp | 10 +++++----- src/plugins/clangformat/clangformatconfigwidget.cpp | 2 +- src/plugins/clangformat/clangformatutils.cpp | 2 +- .../cmakeprojectmanager/cmakebuildconfiguration.cpp | 2 +- .../cmakeprojectmanager/fileapidataextractor.cpp | 4 ++-- src/plugins/git/gitclient.cpp | 6 +++--- src/plugins/mcusupport/mcukitmanager.cpp | 2 +- src/plugins/qmakeprojectmanager/makefileparse.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 2 +- .../qmldesigner/components/eventlist/eventlist.cpp | 2 +- .../components/integration/designdocument.cpp | 5 +---- src/plugins/qmljseditor/qmljseditordocument.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp | 4 ++-- src/plugins/qnx/qnxqtversion.cpp | 2 +- src/plugins/qtsupport/baseqtversion.cpp | 4 ++-- src/plugins/qtsupport/qscxmlcgenerator.cpp | 2 +- src/plugins/qtsupport/qtversionmanager.cpp | 2 +- src/plugins/qtsupport/uicgenerator.cpp | 2 +- src/plugins/squish/objectsmapdocument.cpp | 2 +- 24 files changed, 35 insertions(+), 38 deletions(-) diff --git a/src/libs/languageserverprotocol/lsptypes.cpp b/src/libs/languageserverprotocol/lsptypes.cpp index 7f781f8e6df..d8f02e256fc 100644 --- a/src/libs/languageserverprotocol/lsptypes.cpp +++ b/src/libs/languageserverprotocol/lsptypes.cpp @@ -384,7 +384,7 @@ Utils::FilePath DocumentUri::toFilePath(const PathMapper &mapToHostPath) const QTC_ASSERT(mapToHostPath, return serverPath); return mapToHostPath(serverPath); } - return Utils::FilePath(); + return {}; } DocumentUri DocumentUri::fromProtocol(const QString &uri) diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index 26238807e0e..8cdcb1e886a 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -901,7 +901,7 @@ static bool findNewQmlLibraryInPath(const Utils::FilePath &path, static FilePath modulePath(const ImportInfo &import, const FilePaths &paths) { if (!import.version().isValid()) - return FilePath(); + return {}; const FilePaths modPaths = modulePaths(import.name(), import.version().toString(), paths); return modPaths.value(0); // first is best match diff --git a/src/libs/qmljs/qmljsplugindumper.cpp b/src/libs/qmljs/qmljsplugindumper.cpp index 761df90ddcd..04913de3ddc 100644 --- a/src/libs/qmljs/qmljsplugindumper.cpp +++ b/src/libs/qmljs/qmljsplugindumper.cpp @@ -387,14 +387,14 @@ Utils::FilePath PluginDumper::buildQmltypesPath(const QString &name) const m_modelManager->importPathsNames()); if (paths.isEmpty()) - return Utils::FilePath(); + return {}; for (const Utils::FilePath &path : paths) { auto qmltypes = path.dirEntries(FileFilter(QStringList{"*.qmltypes"}, QDir::Files)); if (!qmltypes.isEmpty()) return qmltypes.first(); } - return Utils::FilePath(); + return {}; } /*! diff --git a/src/libs/utils/fileinprojectfinder.cpp b/src/libs/utils/fileinprojectfinder.cpp index 957f694179b..29e0f6d7c2c 100644 --- a/src/libs/utils/fileinprojectfinder.cpp +++ b/src/libs/utils/fileinprojectfinder.cpp @@ -477,7 +477,7 @@ FilePath chooseFileFromList(const FilePaths &candidates) filesMenu.addAction(candidate.toUserOutput()); if (const QAction * const action = filesMenu.exec(QCursor::pos())) return FilePath::fromUserInput(action->text()); - return FilePath(); + return {}; } } // namespace Utils diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index e7697f1bc8f..e3ae97267dd 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -985,12 +985,12 @@ FilePath FilePath::parentDir() const { const QString basePath = path(); if (basePath.isEmpty()) - return FilePath(); + return {}; const QString path = basePath + QLatin1String("/.."); const QString parent = doCleanPath(path); if (parent == path) - return FilePath(); + return {}; return withNewPath(parent); } diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index 633d23c5e3e..afc0db6ce3f 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -452,7 +452,7 @@ FilePath AndroidConfig::emulatorToolPath() const if (emulatorFile.exists()) return emulatorFile; - return FilePath(); + return {}; } FilePath AndroidConfig::sdkManagerToolPath() const @@ -468,7 +468,7 @@ FilePath AndroidConfig::sdkManagerToolPath() const if (sdkmanagerTmpPath.exists()) return sdkmanagerTmpPath; - return FilePath(); + return {}; } FilePath AndroidConfig::avdManagerToolPath() const @@ -478,7 +478,7 @@ FilePath AndroidConfig::avdManagerToolPath() const if (sdkmanagerPath.exists()) return sdkmanagerPath; - return FilePath(); + return {}; } void AndroidConfig::setTemporarySdkToolsPath(const Utils::FilePath &path) @@ -498,7 +498,7 @@ FilePath AndroidConfig::sdkToolsVersionPath() const if (tmpSdkPath.exists()) return tmpSdkPath; - return FilePath(); + return {}; } FilePath AndroidConfig::toolchainPathFromNdk(const FilePath &ndkLocation, OsType hostOs) @@ -523,7 +523,7 @@ FilePath AndroidConfig::toolchainPathFromNdk(const FilePath &ndkLocation, OsType case OsTypeMac: hostPatterns << QLatin1String("darwin*"); break; - default: /* unknown host */ return FilePath(); + default: /* unknown host */ return {}; } QDirIterator iter(toolchainPath.toString(), hostPatterns, QDir::Dirs); diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index 7c5b8ac3369..9a1f1d4dd52 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -196,7 +196,7 @@ Utils::FilePath ClangFormatConfigWidget::projectPath() if (d->project) return globalPath().pathAppended("clang-format/" + projectUniqueId(d->project)); - return Utils::FilePath(); + return {}; } void ClangFormatConfigWidget::createStyleFileIfNeeded(bool isGlobal) diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 7b9a896fc10..694078b3c3c 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -338,7 +338,7 @@ Utils::FilePath findConfig(const Utils::FilePath &fileName) parentDirectory = parentDirectory.parentDir(); } - return Utils::FilePath(); + return {}; } Utils::FilePath configForFile(const Utils::FilePath &fileName) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 4348ac2e56d..d2653baefeb 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1567,7 +1567,7 @@ FilePath CMakeBuildConfiguration::shadowBuildDirectory(const FilePath &projectFi BuildConfiguration::BuildType buildType) { if (projectFilePath.isEmpty()) - return FilePath(); + return {}; const QString projectName = projectFilePath.parentDir().fileName(); const FilePath projectDir = Project::projectDirectory(projectFilePath); diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index d39a95fccf6..3462980ef7a 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -480,7 +480,7 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input, FilePath directorySourceDir(const Configuration &c, const FilePath &sourceDir, int directoryIndex) { const size_t di = static_cast<size_t>(directoryIndex); - QTC_ASSERT(di < c.directories.size(), return FilePath()); + QTC_ASSERT(di < c.directories.size(), return {}); return sourceDir.resolvePath(c.directories[di].sourcePath); } @@ -488,7 +488,7 @@ FilePath directorySourceDir(const Configuration &c, const FilePath &sourceDir, i FilePath directoryBuildDir(const Configuration &c, const FilePath &buildDir, int directoryIndex) { const size_t di = static_cast<size_t>(directoryIndex); - QTC_ASSERT(di < c.directories.size(), return FilePath()); + QTC_ASSERT(di < c.directories.size(), return {}); return buildDir.resolvePath(c.directories[di].buildPath); } diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index a503557d692..c4c53206d4c 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -2428,7 +2428,7 @@ static FilePath gitBinDir(const GitClient::GitKLaunchTrial trial, const FilePath if (trial == GitClient::SystemPath) return Environment::systemEnvironment().searchInPath("gitk").parentDir(); QTC_CHECK(false); - return FilePath(); + return {}; } void GitClient::tryLaunchingGitK(const Environment &env, @@ -2518,7 +2518,7 @@ FilePath GitClient::gitBinDirectory() const { const QString git = vcsBinary().toString(); if (git.isEmpty()) - return FilePath(); + return {}; // Is 'git\cmd' in the path (folder containing .bats)? QString path = QFileInfo(git).absolutePath(); @@ -2564,7 +2564,7 @@ FilePath GitClient::vcsBinary() const bool ok; Utils::FilePath binary = settings().gitExecutable(&ok); if (!ok) - return Utils::FilePath(); + return {}; return binary; } diff --git a/src/plugins/mcusupport/mcukitmanager.cpp b/src/plugins/mcusupport/mcukitmanager.cpp index 00709b126f5..cadb583188e 100644 --- a/src/plugins/mcusupport/mcukitmanager.cpp +++ b/src/plugins/mcusupport/mcukitmanager.cpp @@ -413,7 +413,7 @@ static FilePath kitDependencyPath(const Kit *kit, const QString &cmakeVariableNa if (configItem.key == keyName) return FilePath::fromUserInput(QString::fromUtf8(configItem.value)); } - return FilePath(); + return {}; } // Kit Information diff --git a/src/plugins/qmakeprojectmanager/makefileparse.cpp b/src/plugins/qmakeprojectmanager/makefileparse.cpp index 990fd0ff417..b5a6d82a1f9 100644 --- a/src/plugins/qmakeprojectmanager/makefileparse.cpp +++ b/src/plugins/qmakeprojectmanager/makefileparse.cpp @@ -225,7 +225,7 @@ static FilePath findQMakeBinaryFromMakefile(const FilePath &makefile) } } } - return FilePath(); + return {}; } MakeFileParse::MakeFileParse(const FilePath &makefile, Mode mode) : m_mode(mode) diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index a4a56b51963..bfcc8a89402 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -341,7 +341,7 @@ FilePath QMakeStep::makeCommand() const { if (auto ms = stepList()->firstOfType<MakeStep>()) return ms->makeExecutable(); - return FilePath(); + return {}; } QString QMakeStep::makeArguments(const QString &makefile) const diff --git a/src/plugins/qmldesigner/components/eventlist/eventlist.cpp b/src/plugins/qmldesigner/components/eventlist/eventlist.cpp index a0d7cc89815..18c16c28e7b 100644 --- a/src/plugins/qmldesigner/components/eventlist/eventlist.cpp +++ b/src/plugins/qmldesigner/components/eventlist/eventlist.cpp @@ -26,7 +26,7 @@ Utils::FilePath projectFilePath() if (auto *proj = ProjectExplorer::ProjectManager::projectForFile(doc->fileName())) return proj->projectDirectory(); } - return Utils::FilePath(); + return {}; } static Utils::FilePath findFile(const Utils::FilePath &path, const QString &fileName) diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp index 7bbbac5b253..ed34abdc79d 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp @@ -334,10 +334,7 @@ void DesignDocument::updateFileName(const Utils::FilePath & /*oldFileName*/, con Utils::FilePath DesignDocument::fileName() const { - if (editor()) - return editor()->document()->filePath(); - - return Utils::FilePath(); + return editor() ? editor()->document()->filePath() : Utils::FilePath(); } ProjectExplorer::Target *DesignDocument::currentTarget() const diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index a5b7687a2ac..3b865570aca 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -741,7 +741,7 @@ static Utils::FilePath qmllsForFile(const Utils::FilePath &file, QmllsSettings settings = settingsManager->lastSettings(); bool enabled = settings.useQmlls; if (!enabled) - return Utils::FilePath(); + return {}; if (settings.useLatestQmlls) return settingsManager->latestQmlls(); QmlJS::ModelManagerInterface::ProjectInfo pInfo = modelManager->projectInfoForPath(file); diff --git a/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp b/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp index e9f0b1a7807..ff386c7a5ba 100644 --- a/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp @@ -98,9 +98,9 @@ Utils::FilePath QmlProfilerDetailsRewriter::getLocalFile(const QString &remoteFi { const Utils::FilePath localFile = m_projectFinder.findFile(remoteFile).constFirst(); if (!localFile.exists() || !localFile.isReadableFile()) - return Utils::FilePath(); + return {}; if (!QmlJS::ModelManagerInterface::guessLanguageOfFile(localFile).isQmlLikeOrJsLanguage()) - return Utils::FilePath(); + return {}; return localFile.canonicalPath(); } diff --git a/src/plugins/qnx/qnxqtversion.cpp b/src/plugins/qnx/qnxqtversion.cpp index a13f96148b0..8de173e9f37 100644 --- a/src/plugins/qnx/qnxqtversion.cpp +++ b/src/plugins/qnx/qnxqtversion.cpp @@ -98,7 +98,7 @@ FilePath QnxQtVersion::qnxTarget() const return FilePath::fromUserInput(item.value); } - return FilePath(); + return {}; } QString QnxQtVersion::cpuDir() const diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 15a891dc110..a0ed8041b33 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -1773,7 +1773,7 @@ FilePath QtVersionPrivate::mkspecDirectoryFromVersionInfo(const QHash<ProKey, Pr { QString dataDir = qmakeProperty(versionInfo, "QT_HOST_DATA", PropertyVariantSrc); if (dataDir.isEmpty()) - return FilePath(); + return {}; return qmakeCommand.withNewPath(dataDir + "/mkspecs").cleanPath(); } @@ -1782,7 +1782,7 @@ FilePath QtVersionPrivate::mkspecFromVersionInfo(const QHash<ProKey, ProString> { FilePath baseMkspecDir = mkspecDirectoryFromVersionInfo(versionInfo, qmakeCommand); if (baseMkspecDir.isEmpty()) - return FilePath(); + return {}; bool qt5 = false; QString theSpec = qmakeProperty(versionInfo, "QMAKE_XSPEC"); diff --git a/src/plugins/qtsupport/qscxmlcgenerator.cpp b/src/plugins/qtsupport/qscxmlcgenerator.cpp index b0d41d9ba7a..f3245bd9432 100644 --- a/src/plugins/qtsupport/qscxmlcgenerator.cpp +++ b/src/plugins/qtsupport/qscxmlcgenerator.cpp @@ -61,7 +61,7 @@ Utils::FilePath QScxmlcGenerator::command() const version = QtSupport::QtKitAspect::qtVersion(KitManager::defaultKit()); if (!version) - return Utils::FilePath(); + return {}; return version->qscxmlcFilePath(); } diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index eedc79e6864..b00291e6049 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -397,7 +397,7 @@ static FilePaths gatherQmakePathsFromQtChooser() { const QString qtchooser = QStandardPaths::findExecutable(QStringLiteral("qtchooser")); if (qtchooser.isEmpty()) - return FilePaths(); + return {}; const QList<QByteArray> versions = runQtChooser(qtchooser, QStringList("-l")); QSet<FilePath> foundQMakes; diff --git a/src/plugins/qtsupport/uicgenerator.cpp b/src/plugins/qtsupport/uicgenerator.cpp index f1ff905b831..4c68d5efa54 100644 --- a/src/plugins/qtsupport/uicgenerator.cpp +++ b/src/plugins/qtsupport/uicgenerator.cpp @@ -39,7 +39,7 @@ Utils::FilePath UicGenerator::command() const version = QtSupport::QtKitAspect::qtVersion(KitManager::defaultKit()); if (!version) - return Utils::FilePath(); + return {}; return version->uicFilePath(); } diff --git a/src/plugins/squish/objectsmapdocument.cpp b/src/plugins/squish/objectsmapdocument.cpp index 767f4cb058d..7f2a050b290 100644 --- a/src/plugins/squish/objectsmapdocument.cpp +++ b/src/plugins/squish/objectsmapdocument.cpp @@ -64,7 +64,7 @@ bool ObjectsMapDocument::saveImpl(QString *errorString, Utils::FilePath ObjectsMapDocument::fallbackSaveAsPath() const { - return Utils::FilePath(); + return {}; } QString ObjectsMapDocument::fallbackSaveAsFileName() const From 5245cad8110423af5121f1262a79ec91b9fbcc1f Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 20:31:02 +0200 Subject: [PATCH 0574/1777] ProjectExplorer: Add context object into connections Change-Id: I50b9e8357881a2626e8026e7910399f0ae0a1d28 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/buildconfiguration.cpp | 2 +- src/plugins/projectexplorer/customparser.cpp | 2 +- .../projectexplorer/customparserssettingspage.cpp | 8 ++++---- src/plugins/projectexplorer/gcctoolchain.cpp | 8 ++++---- src/plugins/projectexplorer/msvctoolchain.cpp | 2 +- src/plugins/projectexplorer/projectexplorer.cpp | 14 ++++++++------ src/plugins/projectexplorer/projectwelcomepage.cpp | 4 ++-- .../projectexplorer/runconfigurationaspects.cpp | 2 +- .../projectexplorer/runsettingspropertiespage.cpp | 2 +- src/plugins/projectexplorer/taskwindow.cpp | 6 +++--- .../projectexplorer/toolchainoptionspage.cpp | 7 ++++--- src/plugins/qbsprojectmanager/qbssettings.cpp | 4 ++-- 12 files changed, 32 insertions(+), 29 deletions(-) diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index f2f1d02310b..4fe82b14cdf 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -115,7 +115,7 @@ public: const auto selectionWidget = new CustomParsersSelectionWidget(this); layout->addWidget(selectionWidget); - connect(selectionWidget, &CustomParsersSelectionWidget::selectionChanged, + connect(selectionWidget, &CustomParsersSelectionWidget::selectionChanged, this, [selectionWidget, bc] { bc->setCustomParsers(selectionWidget->selectedParsers()); }); diff --git a/src/plugins/projectexplorer/customparser.cpp b/src/plugins/projectexplorer/customparser.cpp index 327e6ac8441..c04b240d12d 100644 --- a/src/plugins/projectexplorer/customparser.cpp +++ b/src/plugins/projectexplorer/customparser.cpp @@ -322,7 +322,7 @@ private: CustomParsersSelectionWidget::CustomParsersSelectionWidget(QWidget *parent) : DetailsWidget(parent) { const auto widget = new SelectionWidget(this); - connect(widget, &SelectionWidget::selectionChanged, [this] { + connect(widget, &SelectionWidget::selectionChanged, this, [this] { updateSummary(); emit selectionChanged(); }); diff --git a/src/plugins/projectexplorer/customparserssettingspage.cpp b/src/plugins/projectexplorer/customparserssettingspage.cpp index fd16d41ff6f..b1238f684ac 100644 --- a/src/plugins/projectexplorer/customparserssettingspage.cpp +++ b/src/plugins/projectexplorer/customparserssettingspage.cpp @@ -49,7 +49,7 @@ public: buttonLayout->addWidget(editButton); buttonLayout->addStretch(1); - connect(addButton, &QPushButton::clicked, [this] { + connect(addButton, &QPushButton::clicked, this, [this] { CustomParserConfigDialog dlg(this); dlg.setSettings(CustomParserSettings()); if (dlg.exec() != QDialog::Accepted) @@ -60,13 +60,13 @@ public: m_customParsers << newParser; resetListView(); }); - connect(removeButton, &QPushButton::clicked, [this] { + connect(removeButton, &QPushButton::clicked, this, [this] { const QList<QListWidgetItem *> sel = m_parserListView.selectedItems(); QTC_ASSERT(sel.size() == 1, return); m_customParsers.removeAt(m_parserListView.row(sel.first())); delete sel.first(); }); - connect(editButton, &QPushButton::clicked, [this] { + connect(editButton, &QPushButton::clicked, this, [this] { const QList<QListWidgetItem *> sel = m_parserListView.selectedItems(); QTC_ASSERT(sel.size() == 1, return); CustomParserSettings &s = m_customParsers[m_parserListView.row(sel.first())]; @@ -78,7 +78,7 @@ public: s.warning = dlg.settings().warning; }); - connect(&m_parserListView, &QListWidget::itemChanged, [this](QListWidgetItem *item) { + connect(&m_parserListView, &QListWidget::itemChanged, this, [this](QListWidgetItem *item) { m_customParsers[m_parserListView.row(item)].displayName = item->text(); resetListView(); }); diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index fa5d41a623f..cb05e25a384 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1508,8 +1508,8 @@ void ClangToolChain::syncAutodetectedWithParentToolchains() QObject::disconnect(m_mingwToolchainAddedConnection); if (!ToolChainManager::isLoaded()) { - QObject::connect(ToolChainManager::instance(), &ToolChainManager::toolChainsLoaded, - [id = id()] { + connect(ToolChainManager::instance(), &ToolChainManager::toolChainsLoaded, this, + [id = id()] { if (ToolChain * const tc = ToolChainManager::findToolChain(id)) { if (tc->typeId() == Constants::CLANG_TOOLCHAIN_TYPEID) static_cast<ClangToolChain *>(tc)->syncAutodetectedWithParentToolchains(); @@ -1526,14 +1526,14 @@ void ClangToolChain::syncAutodetectedWithParentToolchains() // Subscribe only autodetected toolchains. ToolChainManager *tcManager = ToolChainManager::instance(); m_mingwToolchainAddedConnection - = QObject::connect(tcManager, &ToolChainManager::toolChainAdded, [this](ToolChain *tc) { + = connect(tcManager, &ToolChainManager::toolChainAdded, this, [this](ToolChain *tc) { if (tc->typeId() == Constants::MINGW_TOOLCHAIN_TYPEID && !mingwToolChainFromId(m_parentToolChainId)) { m_parentToolChainId = tc->id(); } }); m_thisToolchainRemovedConnection - = QObject::connect(tcManager, &ToolChainManager::toolChainRemoved, [this](ToolChain *tc) { + = connect(tcManager, &ToolChainManager::toolChainRemoved, this, [this](ToolChain *tc) { if (tc == this) { QObject::disconnect(m_thisToolchainRemovedConnection); QObject::disconnect(m_mingwToolchainAddedConnection); diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 19aa8923d57..9b90effa3ba 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -780,7 +780,7 @@ void MsvcToolChain::environmentModifications(QPromise<MsvcToolChain::GenerateEnv void MsvcToolChain::initEnvModWatcher(const QFuture<GenerateEnvResult> &future) { - QObject::connect(&m_envModWatcher, &QFutureWatcher<GenerateEnvResult>::resultReadyAt, [&]() { + connect(&m_envModWatcher, &QFutureWatcher<GenerateEnvResult>::resultReadyAt, this, [this] { const GenerateEnvResult &result = m_envModWatcher.result(); if (result.error) { QString errorMessage = *result.error; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 111aec12aa5..d31f2a7a8ab 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1290,7 +1290,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er // FIXME: This menu will never become visible if the user tried to open it once // without a project loaded. - connect(generatorContainer->menu(), &QMenu::aboutToShow, [menu = generatorContainer->menu()] { + connect(generatorContainer->menu(), &QMenu::aboutToShow, + this, [menu = generatorContainer->menu()] { menu->clear(); if (Project * const project = ProjectManager::startupProject()) { for (const auto &generator : project->allGenerators()) { @@ -3124,8 +3125,8 @@ void ProjectExplorerPluginPrivate::updateUnloadProjectMenu() menu->clear(); for (Project *project : ProjectManager::projects()) { QAction *action = menu->addAction(Tr::tr("Close Project \"%1\"").arg(project->displayName())); - connect(action, &QAction::triggered, - [project] { ProjectExplorerPlugin::unloadProject(project); } ); + connect(action, &QAction::triggered, this, + [project] { ProjectExplorerPlugin::unloadProject(project); }); } } @@ -3853,7 +3854,8 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFileName) const HandleIncludeGuards handleGuards = canTryToRenameIncludeGuards(node); if (!folderNode->canRenameFile(oldFilePath, newFilePath)) { - QTimer::singleShot(0, [oldFilePath, newFilePath, projectFileName, handleGuards] { + QTimer::singleShot(0, m_instance, + [oldFilePath, newFilePath, projectFileName, handleGuards] { int res = QMessageBox::question(ICore::dialogParent(), Tr::tr("Project Editing Failed"), Tr::tr("The project file %1 cannot be automatically changed.\n\n" @@ -3877,7 +3879,7 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFileName) .arg(newFilePath.toUserOutput()) .arg(projectFileName); - QTimer::singleShot(0, [renameFileError] { + QTimer::singleShot(0, m_instance, [renameFileError] { QMessageBox::warning(ICore::dialogParent(), Tr::tr("Project Editing Failed"), renameFileError); @@ -3888,7 +3890,7 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFileName) .arg(oldFilePath.toUserOutput()) .arg(newFilePath.toUserOutput()); - QTimer::singleShot(0, [renameFileError] { + QTimer::singleShot(0, m_instance, [renameFileError] { QMessageBox::warning(ICore::dialogParent(), Tr::tr("Cannot Rename File"), renameFileError); }); } diff --git a/src/plugins/projectexplorer/projectwelcomepage.cpp b/src/plugins/projectexplorer/projectwelcomepage.cpp index 5def44f9482..1b2b1b1edc5 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.cpp +++ b/src/plugins/projectexplorer/projectwelcomepage.cpp @@ -523,14 +523,14 @@ public: QAction *action = new QAction(Tr::tr("Remove Project from Recent Projects")); const auto projectModel = qobject_cast<ProjectModel *>(model); contextMenu.addAction(action); - connect(action, &QAction::triggered, [idx, projectModel](){ + connect(action, &QAction::triggered, this, [idx, projectModel] { const QVariant projectFile = idx.data(ProjectModel::FilePathRole); ProjectExplorerPlugin::removeFromRecentProjects(FilePath::fromVariant(projectFile)); projectModel->resetProjects(); }); contextMenu.addSeparator(); action = new QAction(Tr::tr("Clear Recent Project List")); - connect(action, &QAction::triggered, [projectModel]() { + connect(action, &QAction::triggered, this, [projectModel] { ProjectExplorerPlugin::clearRecentProjects(); projectModel->resetProjects(); }); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 980dec8bf87..806e387fdf8 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -855,7 +855,7 @@ void InterpreterAspect::addToLayout(LayoutItem &builder) this, &InterpreterAspect::updateCurrentInterpreter); auto manageButton = new QPushButton(Tr::tr("Manage...")); - connect(manageButton, &QPushButton::clicked, [this] { + connect(manageButton, &QPushButton::clicked, this, [this] { Core::ICore::showOptionsDialog(m_settingsDialogId); }); diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index 1aeecabf956..0b780cee3e7 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -324,7 +324,7 @@ void RunSettingsWidget::aboutToShowDeployMenu() for (DeployConfigurationFactory *factory : DeployConfigurationFactory::find(m_target)) { QAction *action = m_addDeployMenu->addAction(factory->defaultDisplayName()); - connect(action, &QAction::triggered, [factory, this]() { + connect(action, &QAction::triggered, this, [factory, this] { DeployConfiguration *newDc = factory->create(m_target); if (!newDc) return; diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 58603a64f92..c829e4f087a 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -241,17 +241,17 @@ TaskWindow::TaskWindow() : d(std::make_unique<TaskWindowPrivate>()) connect(hub, &TaskHub::showTask, this, &TaskWindow::showTask); connect(hub, &TaskHub::openTask, this, &TaskWindow::openTask); - connect(d->m_filter, &TaskFilterModel::rowsAboutToBeRemoved, + connect(d->m_filter, &TaskFilterModel::rowsAboutToBeRemoved, this, [this](const QModelIndex &, int first, int last) { d->m_visibleIssuesCount -= d->m_filter->issuesCount(first, last); emit setBadgeNumber(d->m_visibleIssuesCount); }); - connect(d->m_filter, &TaskFilterModel::rowsInserted, + connect(d->m_filter, &TaskFilterModel::rowsInserted, this, [this](const QModelIndex &, int first, int last) { d->m_visibleIssuesCount += d->m_filter->issuesCount(first, last); emit setBadgeNumber(d->m_visibleIssuesCount); }); - connect(d->m_filter, &TaskFilterModel::modelReset, [this] { + connect(d->m_filter, &TaskFilterModel::modelReset, this, [this] { d->m_visibleIssuesCount = d->m_filter->issuesCount(0, d->m_filter->rowCount()); emit setBadgeNumber(d->m_visibleIssuesCount); }); diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index a0dc19392ed..8954a93fa1a 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -210,7 +210,7 @@ public: m_addButton->setStyleSheet("text-align:center;"); m_cloneButton = new QPushButton(Tr::tr("Clone"), this); - connect(m_cloneButton, &QAbstractButton::clicked, [this] { cloneToolChain(); }); + connect(m_cloneButton, &QAbstractButton::clicked, this, [this] { cloneToolChain(); }); m_delButton = new QPushButton(Tr::tr("Remove"), this); @@ -280,7 +280,7 @@ public: connect(ToolChainManager::instance(), &ToolChainManager::toolChainsChanged, this, &ToolChainOptionsWidget::toolChainSelectionChanged); - connect(m_delButton, &QAbstractButton::clicked, [this] { + connect(m_delButton, &QAbstractButton::clicked, this, [this] { if (ToolChainTreeItem *item = currentTreeItem()) markForRemoval(item); }); @@ -303,7 +303,8 @@ public: QAction *createAction(const QString &name, ToolChainFactory *factory, Utils::Id language) { auto action = new QAction(name, nullptr); - connect(action, &QAction::triggered, [this, factory, language] { createToolChain(factory, language); }); + connect(action, &QAction::triggered, this, + [this, factory, language] { createToolChain(factory, language); }); return action; } diff --git a/src/plugins/qbsprojectmanager/qbssettings.cpp b/src/plugins/qbsprojectmanager/qbssettings.cpp index d631f23ced8..87d5b5b284b 100644 --- a/src/plugins/qbsprojectmanager/qbssettings.cpp +++ b/src/plugins/qbsprojectmanager/qbssettings.cpp @@ -172,10 +172,10 @@ public: layout->addRow(Tr::tr("Default installation directory:"), &m_defaultInstallDirLineEdit); layout->addRow(Tr::tr("Qbs version:"), &m_versionLabel); - connect(&m_qbsExePathChooser, &PathChooser::textChanged, [this] { + connect(&m_qbsExePathChooser, &PathChooser::textChanged, this, [this] { m_versionLabel.setText(getQbsVersionString()); }); - connect(&m_resetQbsExeButton, &QPushButton::clicked, [this] { + connect(&m_resetQbsExeButton, &QPushButton::clicked, this, [this] { m_qbsExePathChooser.setFilePath(QbsSettings::defaultQbsExecutableFilePath()); }); } From 47fce17aa37f6e0ca003ad07917afbd047179f50 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 20:35:59 +0200 Subject: [PATCH 0575/1777] Tests: Add context object into connections Change-Id: I4bb05e5890b9b415085f17d6358d9066e3112d6d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../timelinezoomcontrol/tst_timelinezoomcontrol.cpp | 7 +++---- tests/manual/widgets/common/themeselector.cpp | 2 +- .../widgets/infolabel/tst_manual_widgets_infolabel.cpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/auto/tracing/timelinezoomcontrol/tst_timelinezoomcontrol.cpp b/tests/auto/tracing/timelinezoomcontrol/tst_timelinezoomcontrol.cpp index 3e1c936c0d5..ea26071401d 100644 --- a/tests/auto/tracing/timelinezoomcontrol/tst_timelinezoomcontrol.cpp +++ b/tests/auto/tracing/timelinezoomcontrol/tst_timelinezoomcontrol.cpp @@ -55,15 +55,14 @@ void tst_TimelineZoomControl::window() QTimer timer; timer.setSingleShot(true); - connect(&timer, &QTimer::timeout, [&] { + connect(&timer, &QTimer::timeout, this, [&zoomControl] { QVERIFY(zoomControl.windowLocked()); zoomControl.setWindowLocked(false); }); int numWindowChanges = 0; - connect(&zoomControl, &TimelineZoomControl::windowChanged, - [&](qint64, qint64) { + connect(&zoomControl, &TimelineZoomControl::windowChanged, this, [&](qint64, qint64) { verifyWindow(zoomControl); QVERIFY(!timer.isActive()); @@ -100,7 +99,7 @@ void tst_TimelineZoomControl::window() zoomControl.setRange(152000, 152005); // move right QMetaObject::Connection connection = connect( - &zoomControl, &TimelineZoomControl::windowMovingChanged, [&](bool moving) { + &zoomControl, &TimelineZoomControl::windowMovingChanged, this, [&](bool moving) { if (moving) return; diff --git a/tests/manual/widgets/common/themeselector.cpp b/tests/manual/widgets/common/themeselector.cpp index 2fbdd2424b8..8d3b3bf2db1 100644 --- a/tests/manual/widgets/common/themeselector.cpp +++ b/tests/manual/widgets/common/themeselector.cpp @@ -45,7 +45,7 @@ ThemeSelector::ThemeSelector(QWidget *parent) setCurrentText(appSettings.value(themeNameKey, "Flat Dark").toString()); setTheme(currentData().toString()); - connect(this, &QComboBox::currentTextChanged, [this]{ + connect(this, &QComboBox::currentTextChanged, this, [this] { setTheme(currentData().toString()); QSettings appSettings; appSettings.setValue(themeNameKey, currentText()); diff --git a/tests/manual/widgets/infolabel/tst_manual_widgets_infolabel.cpp b/tests/manual/widgets/infolabel/tst_manual_widgets_infolabel.cpp index 288c1fb4a97..3943176a93c 100644 --- a/tests/manual/widgets/infolabel/tst_manual_widgets_infolabel.cpp +++ b/tests/manual/widgets/infolabel/tst_manual_widgets_infolabel.cpp @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) auto withLink = new Utils::InfoLabel("With <a href=\"link clicked!\">link</a>", InfoLabel::Error); withLink->setElideMode(Qt::ElideNone); - QObject::connect(withLink, &QLabel::linkActivated, [widget](const QString& link){ + QObject::connect(withLink, &QLabel::linkActivated, &app, [widget](const QString& link) { QMessageBox::information(widget, {}, link); }); mainLayout->addWidget(withLink); From aa016cc5a784098947636b05106ab57ae6e70d38 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 19:59:54 +0200 Subject: [PATCH 0576/1777] Various Plugins: Add context object into connections Change-Id: I360677bebfef16a3233b3b8177cff6da57ec7c31 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/axivion/axivionplugin.cpp | 4 ++-- src/plugins/coreplugin/sessiondialog.cpp | 2 +- src/plugins/coreplugin/sessionview.cpp | 4 ++-- src/plugins/cppcheck/cppcheckplugin.cpp | 2 +- src/plugins/ctfvisualizer/ctfstatisticsview.cpp | 2 +- src/plugins/ctfvisualizer/ctfvisualizertool.cpp | 3 +-- src/plugins/fakevim/fakevimplugin.cpp | 2 +- src/plugins/fossil/fossilclient.cpp | 12 ++++++++---- src/plugins/help/helpwidget.cpp | 7 ++----- src/plugins/marketplace/qtmarketplacewelcomepage.cpp | 2 +- .../mcusupport/dialogs/mcukitcreationdialog.cpp | 6 +++--- .../mesonprojectmanager/mesonbuildconfiguration.cpp | 9 ++++++--- src/plugins/nim/suggest/nimsuggestcache.cpp | 2 +- src/plugins/serialterminal/serialcontrol.cpp | 2 +- src/plugins/serialterminal/serialoutputpane.cpp | 6 ++---- src/plugins/welcome/welcomeplugin.cpp | 4 ++-- src/tools/qtc-askpass/qtc-askpass-main.cpp | 2 +- 17 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index 40b2cb6590f..7703fede02c 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -205,7 +205,7 @@ void AxivionPluginPrivate::onStartupProjectChanged() void AxivionPluginPrivate::fetchProjectInfo(const QString &projectName) { if (m_runningQuery) { // re-schedule - QTimer::singleShot(3000, [this, projectName]{ fetchProjectInfo(projectName); }); + QTimer::singleShot(3000, this, [this, projectName] { fetchProjectInfo(projectName); }); return; } clearAllMarks(); @@ -228,7 +228,7 @@ void AxivionPluginPrivate::fetchProjectInfo(const QString &projectName) void AxivionPluginPrivate::fetchRuleInfo(const QString &id) { if (m_runningQuery) { - QTimer::singleShot(3000, [this, id]{ fetchRuleInfo(id); }); + QTimer::singleShot(3000, this, [this, id] { fetchRuleInfo(id); }); return; } diff --git a/src/plugins/coreplugin/sessiondialog.cpp b/src/plugins/coreplugin/sessiondialog.cpp index f0789cf45ba..5ab1343a963 100644 --- a/src/plugins/coreplugin/sessiondialog.cpp +++ b/src/plugins/coreplugin/sessiondialog.cpp @@ -93,7 +93,7 @@ SessionNameInputDialog::SessionNameInputDialog(QWidget *parent) }.attachTo(this); // clang-format on - connect(m_newSessionLineEdit, &QLineEdit::textChanged, [this](const QString &text) { + connect(m_newSessionLineEdit, &QLineEdit::textChanged, this, [this](const QString &text) { m_okButton->setEnabled(!text.isEmpty()); m_switchToButton->setEnabled(!text.isEmpty()); }); diff --git a/src/plugins/coreplugin/sessionview.cpp b/src/plugins/coreplugin/sessionview.cpp index c3d7ed25b30..4b03c929900 100644 --- a/src/plugins/coreplugin/sessionview.cpp +++ b/src/plugins/coreplugin/sessionview.cpp @@ -54,10 +54,10 @@ SessionView::SessionView(QWidget *parent) selectionModel()->select(firstRow, QItemSelectionModel::QItemSelectionModel:: SelectCurrent); - connect(this, &Utils::TreeView::activated, [this](const QModelIndex &index){ + connect(this, &Utils::TreeView::activated, this, [this](const QModelIndex &index){ emit sessionActivated(m_sessionModel.sessionAt(index.row())); }); - connect(selectionModel(), &QItemSelectionModel::selectionChanged, [this] { + connect(selectionModel(), &QItemSelectionModel::selectionChanged, this, [this] { emit sessionsSelected(selectedSessions()); }); diff --git a/src/plugins/cppcheck/cppcheckplugin.cpp b/src/plugins/cppcheck/cppcheckplugin.cpp index 261eb50b0a5..8f80707a240 100644 --- a/src/plugins/cppcheck/cppcheckplugin.cpp +++ b/src/plugins/cppcheck/cppcheckplugin.cpp @@ -55,7 +55,7 @@ public: CppcheckPluginPrivate::CppcheckPluginPrivate() { tool.updateOptions(); - connect(&settings(), &AspectContainer::changed, [this] { + connect(&settings(), &AspectContainer::changed, this, [this] { tool.updateOptions(); trigger.recheck(); }); diff --git a/src/plugins/ctfvisualizer/ctfstatisticsview.cpp b/src/plugins/ctfvisualizer/ctfstatisticsview.cpp index 3ca6a4738dd..3e8ff8a40b8 100644 --- a/src/plugins/ctfvisualizer/ctfstatisticsview.cpp +++ b/src/plugins/ctfvisualizer/ctfstatisticsview.cpp @@ -31,7 +31,7 @@ CtfStatisticsView::CtfStatisticsView(CtfStatisticsModel *model, QWidget *parent) setUniformRowHeights(true); setSortingEnabled(true); - connect(selectionModel(), &QItemSelectionModel::currentChanged, + connect(selectionModel(), &QItemSelectionModel::currentChanged, this, [this] (const QModelIndex ¤t, const QModelIndex &previous) { Q_UNUSED(previous); diff --git a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp index 05cf55d729f..c5ca64eeb31 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp +++ b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp @@ -97,8 +97,7 @@ void CtfVisualizerTool::createViews() m_statisticsView = new CtfStatisticsView(m_statisticsModel.get()); m_statisticsView->setWindowTitle(Tr::tr("Statistics")); - connect(m_statisticsView, &CtfStatisticsView::eventTypeSelected, [this] (QString title) - { + connect(m_statisticsView, &CtfStatisticsView::eventTypeSelected, this, [this](QString title) { int typeId = m_traceManager->getSelectionId(title.toStdString()); m_traceView->selectByTypeId(typeId); }); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index afebf316c9c..dffae9b45cd 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -502,7 +502,7 @@ FakeVimExCommandsMappings::FakeVimExCommandsMappings() auto infoLabel = new InfoLabel(Tr::tr("Invalid regular expression."), InfoLabel::Error); infoLabel->setVisible(false); - connect(m_commandEdit, &FancyLineEdit::validChanged, [infoLabel](bool valid){ + connect(m_commandEdit, &FancyLineEdit::validChanged, this, [infoLabel](bool valid){ infoLabel->setVisible(!valid); }); commandBoxLayout->addWidget(infoLabel); diff --git a/src/plugins/fossil/fossilclient.cpp b/src/plugins/fossil/fossilclient.cpp index db23a6fcac9..7f4ebd206c5 100644 --- a/src/plugins/fossil/fossilclient.cpp +++ b/src/plugins/fossil/fossilclient.cpp @@ -915,8 +915,10 @@ void FossilClient::log(const FilePath &workingDir, const QStringList &files, if (VcsBaseEditorConfig *editorConfig = createLogEditor(fossilEditor)) { editorConfig->setBaseArguments(extraOptions); // editor has been just created, createVcsEditor() didn't set a configuration widget yet - connect(editorConfig, &VcsBaseEditorConfig::commandExecutionRequested, - [=]() { this->log(workingDir, files, editorConfig->arguments(), enableAnnotationContextMenu, addAuthOptions); } ); + connect(editorConfig, &VcsBaseEditorConfig::commandExecutionRequested, this, [=] { + log(workingDir, files, editorConfig->arguments(), enableAnnotationContextMenu, + addAuthOptions); + }); fossilEditor->setEditorConfig(editorConfig); } } @@ -968,8 +970,10 @@ void FossilClient::logCurrentFile(const FilePath &workingDir, const QStringList if (VcsBaseEditorConfig *editorConfig = createLogCurrentFileEditor(fossilEditor)) { editorConfig->setBaseArguments(extraOptions); // editor has been just created, createVcsEditor() didn't set a configuration widget yet - connect(editorConfig, &VcsBaseEditorConfig::commandExecutionRequested, - [=]() { this->logCurrentFile(workingDir, files, editorConfig->arguments(), enableAnnotationContextMenu, addAuthOptions); } ); + connect(editorConfig, &VcsBaseEditorConfig::commandExecutionRequested, this, [=] { + logCurrentFile(workingDir, files, editorConfig->arguments(), + enableAnnotationContextMenu, addAuthOptions); + }); fossilEditor->setEditorConfig(editorConfig); } } diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp index 67b42232c90..a2d9eca985a 100644 --- a/src/plugins/help/helpwidget.cpp +++ b/src/plugins/help/helpwidget.cpp @@ -323,14 +323,11 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget helpTargetButton->setProperty(Utils::StyleHelper::C_NO_ARROW, true); helpTargetButton->setPopupMode(QToolButton::DelayedPopup); helpTargetButton->setMenu(createHelpTargetMenu(helpTargetButton)); - connect(LocalHelpManager::instance(), - &LocalHelpManager::contextHelpOptionChanged, + connect(LocalHelpManager::instance(), &LocalHelpManager::contextHelpOptionChanged, this, [this, helpTargetAction] { helpTargetAction->setChecked(isTargetOfContextHelp(m_style)); }); - connect(helpTargetAction, - &QAction::triggered, - this, + connect(helpTargetAction, &QAction::triggered, this, [this, helpTargetAction, helpTargetButton](bool checked) { if (checked) { LocalHelpManager::setContextHelpOption(optionForStyle(m_style)); diff --git a/src/plugins/marketplace/qtmarketplacewelcomepage.cpp b/src/plugins/marketplace/qtmarketplacewelcomepage.cpp index 44272858c5e..b894454b18d 100644 --- a/src/plugins/marketplace/qtmarketplacewelcomepage.cpp +++ b/src/plugins/marketplace/qtmarketplacewelcomepage.cpp @@ -74,7 +74,7 @@ public: connect(m_sectionedProducts, &SectionedProducts::toggleProgressIndicator, progressIndicator, &Utils::ProgressIndicator::setVisible); - connect(m_sectionedProducts, &SectionedProducts::errorOccurred, + connect(m_sectionedProducts, &SectionedProducts::errorOccurred, this, [this, progressIndicator, searchBox](int, const QString &message) { progressIndicator->hide(); progressIndicator->deleteLater(); diff --git a/src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp b/src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp index 9702fb77bfb..897fcd0aa14 100644 --- a/src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp +++ b/src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp @@ -89,9 +89,9 @@ McuKitCreationDialog::McuKitCreationDialog(const MessagesList &messages, if (qtMCUPackage->isValidStatus()) m_qtMCUsPathLabel->setText( Tr::tr("Qt for MCUs path %1").arg(qtMCUPackage->path().toUserOutput())); - connect(m_nextButton, &QPushButton::clicked, [=] { updateMessage(1); }); - connect(m_previousButton, &QPushButton::clicked, [=] { updateMessage(-1); }); - connect(fixButton, &QPushButton::clicked, [=] { + connect(m_nextButton, &QPushButton::clicked, this, [this] { updateMessage(1); }); + connect(m_previousButton, &QPushButton::clicked, this, [this] { updateMessage(-1); }); + connect(fixButton, &QPushButton::clicked, this, [this, settingsHandler] { // Open the MCU Options widget on the current platform settingsHandler->setInitialPlatformName(m_messages[m_currentIndex].platform); Core::ICore::showOptionsDialog(Constants::SETTINGS_ID); diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp index a8722fc24fc..579efa7035f 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp @@ -221,7 +221,8 @@ public: m_showProgressTimer.setSingleShot(true); m_showProgressTimer.setInterval(50); // don't show progress for < 50ms tasks - connect(&m_showProgressTimer, &QTimer::timeout, [this]() { m_progressIndicator.show(); }); + connect(&m_showProgressTimer, &QTimer::timeout, + this, [this] { m_progressIndicator.show(); }); connect(&m_optionsModel, &BuidOptionsModel::configurationChanged, this, [configureButton] { configureButton->setEnabled(true); }); @@ -274,13 +275,15 @@ public: optionsTreeView, [tree = optionsTreeView](const QModelIndex &idx) { tree->edit(idx); }); - connect(configureButton, &QPushButton::clicked, [this, bs, configureButton, optionsTreeView] { + connect(configureButton, &QPushButton::clicked, + this, [this, bs, configureButton, optionsTreeView] { optionsTreeView->setEnabled(false); configureButton->setEnabled(false); m_showProgressTimer.start(); bs->configure(); }); - connect(wipeButton, &QPushButton::clicked, [this, bs, configureButton, optionsTreeView] { + connect(wipeButton, &QPushButton::clicked, + this, [this, bs, configureButton, optionsTreeView] { optionsTreeView->setEnabled(false); configureButton->setEnabled(false); m_showProgressTimer.start(); diff --git a/src/plugins/nim/suggest/nimsuggestcache.cpp b/src/plugins/nim/suggest/nimsuggestcache.cpp index 92bca20d5e9..fa4751cb5c1 100644 --- a/src/plugins/nim/suggest/nimsuggestcache.cpp +++ b/src/plugins/nim/suggest/nimsuggestcache.cpp @@ -22,7 +22,7 @@ public: NimSuggestCache() { setExecutablePath(settings().nimSuggestPath()); - QObject::connect(&settings().nimSuggestPath, &StringAspect::changed, [this] { + QObject::connect(&settings().nimSuggestPath, &StringAspect::changed, this, [this] { setExecutablePath(settings().nimSuggestPath()); }); diff --git a/src/plugins/serialterminal/serialcontrol.cpp b/src/plugins/serialterminal/serialcontrol.cpp index 0c034f1cb18..2ec8fe3523f 100644 --- a/src/plugins/serialterminal/serialcontrol.cpp +++ b/src/plugins/serialterminal/serialcontrol.cpp @@ -151,7 +151,7 @@ QString SerialControl::baudRateText() const void SerialControl::pulseDataTerminalReady() { m_serialPort.setDataTerminalReady(!m_initialDtrState); - QTimer::singleShot(Constants::RESET_DELAY, [&]() { + QTimer::singleShot(Constants::RESET_DELAY, this, [this] { m_serialPort.setDataTerminalReady(m_initialDtrState); }); } diff --git a/src/plugins/serialterminal/serialoutputpane.cpp b/src/plugins/serialterminal/serialoutputpane.cpp index 7a92424d7b8..b343ea478ee 100644 --- a/src/plugins/serialterminal/serialoutputpane.cpp +++ b/src/plugins/serialterminal/serialoutputpane.cpp @@ -257,14 +257,12 @@ void SerialOutputPane::createNewOutputWindow(SerialControl *rc) return; // Signals to update buttons - connect(rc, &SerialControl::started, - [this, rc]() { + connect(rc, &SerialControl::started, this, [this, rc] { if (isCurrent(rc)) enableButtons(rc, true); }); - connect(rc, &SerialControl::finished, - [this, rc]() { + connect(rc, &SerialControl::finished, this, [this, rc] { const int tabIndex = indexOf(rc); if (tabIndex != -1) m_serialControlTabs[tabIndex].window->flush(); diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index d4089de465a..8cc8165aa29 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -351,12 +351,12 @@ WelcomeMode::WelcomeMode() m_modeWidget = new ResizeSignallingWidget; m_modeWidget->setPalette(palette); - connect(m_modeWidget, &ResizeSignallingWidget::resized, + connect(m_modeWidget, &ResizeSignallingWidget::resized, this, [this](const QSize &size, const QSize &) { const bool hideSideArea = size.width() <= 750; const bool hideBottomArea = size.width() <= 850; const bool compactVertically = size.height() <= 530; - QTimer::singleShot(0, [this, hideSideArea, hideBottomArea, compactVertically]() { + QTimer::singleShot(0, this, [this, hideSideArea, hideBottomArea, compactVertically] { m_sideArea->setVisible(!hideSideArea); m_bottomArea->setVisible(!(hideBottomArea || compactVertically)); m_topArea->setCompact(compactVertically); diff --git a/src/tools/qtc-askpass/qtc-askpass-main.cpp b/src/tools/qtc-askpass/qtc-askpass-main.cpp index 5a527e18db1..5cd0eaf1adb 100644 --- a/src/tools/qtc-askpass/qtc-askpass-main.cpp +++ b/src/tools/qtc-askpass/qtc-askpass-main.cpp @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QTimer::singleShot(0, [] { + QTimer::singleShot(0, &app, [] { QInputDialog dlg; const QStringList appArgs = qApp->arguments(); QString labelText = QCoreApplication::translate("qtc-askpass", From 0bdf6f2a50a410d523051337d5252ddc2e0be58d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 12:29:35 +0200 Subject: [PATCH 0577/1777] WaitForBarrierTask: Don't derive from BarrierTask The CustomTask<Adapter> isn't really meant to be derived from. Provide a global function instead. Change-Id: I8cfde260e638a34fa675126f3f412faab902e94a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/solutions/tasking/barrier.h | 42 ++++++++++---------- src/libs/utils/filestreamer.cpp | 2 +- tests/auto/solutions/tasking/tst_tasking.cpp | 24 +++++------ 3 files changed, 33 insertions(+), 35 deletions(-) diff --git a/src/libs/solutions/tasking/barrier.h b/src/libs/solutions/tasking/barrier.h index 64a59ec8733..ba8319682e0 100644 --- a/src/libs/solutions/tasking/barrier.h +++ b/src/libs/solutions/tasking/barrier.h @@ -70,28 +70,26 @@ using MultiBarrier = TreeStorage<SharedBarrier<Limit>>; // alias template deduction only available with C++20. using SingleBarrier = MultiBarrier<1>; -class TASKING_EXPORT WaitForBarrierTask : public BarrierTask +template <int Limit> +GroupItem waitForBarrierTask(const MultiBarrier<Limit> &sharedBarrier) { -public: - template <int Limit> - WaitForBarrierTask(const MultiBarrier<Limit> &sharedBarrier) - : BarrierTask([sharedBarrier](Barrier &barrier) { - SharedBarrier<Limit> *activeBarrier = sharedBarrier.activeStorage(); - if (!activeBarrier) { - qWarning("The barrier referenced from WaitForBarrier element " - "is not reachable in the running tree. " - "It is possible that no barrier was added to the tree, " - "or the storage is not reachable from where it is referenced. " - "The WaitForBarrier task finishes with an error. "); - return SetupResult::StopWithError; - } - Barrier *activeSharedBarrier = activeBarrier->barrier(); - const std::optional<bool> result = activeSharedBarrier->result(); - if (result.has_value()) - return result.value() ? SetupResult::StopWithDone : SetupResult::StopWithError; - QObject::connect(activeSharedBarrier, &Barrier::done, &barrier, &Barrier::stopWithResult); - return SetupResult::Continue; - }) {} -}; + return BarrierTask([sharedBarrier](Barrier &barrier) { + SharedBarrier<Limit> *activeBarrier = sharedBarrier.activeStorage(); + if (!activeBarrier) { + qWarning("The barrier referenced from WaitForBarrier element " + "is not reachable in the running tree. " + "It is possible that no barrier was added to the tree, " + "or the storage is not reachable from where it is referenced. " + "The WaitForBarrier task finishes with an error. "); + return SetupResult::StopWithError; + } + Barrier *activeSharedBarrier = activeBarrier->barrier(); + const std::optional<bool> result = activeSharedBarrier->result(); + if (result.has_value()) + return result.value() ? SetupResult::StopWithDone : SetupResult::StopWithError; + QObject::connect(activeSharedBarrier, &Barrier::done, &barrier, &Barrier::stopWithResult); + return SetupResult::Continue; + }); +} } // namespace Tasking diff --git a/src/libs/utils/filestreamer.cpp b/src/libs/utils/filestreamer.cpp index eb9e057c1a1..e8ff353be81 100644 --- a/src/libs/utils/filestreamer.cpp +++ b/src/libs/utils/filestreamer.cpp @@ -355,7 +355,7 @@ static Group interDeviceTransferTask(const FilePath &source, const FilePath &des Storage(storage), FileStreamWriterTask(setupWriter), Group { - WaitForBarrierTask(writerReadyBarrier), + waitForBarrierTask(writerReadyBarrier), FileStreamReaderTask(setupReader, finalizeReader, finalizeReader) } }; diff --git a/tests/auto/solutions/tasking/tst_tasking.cpp b/tests/auto/solutions/tasking/tst_tasking.cpp index 5f25008228b..316b3587038 100644 --- a/tests/auto/solutions/tasking/tst_tasking.cpp +++ b/tests/auto/solutions/tasking/tst_tasking.cpp @@ -1846,7 +1846,7 @@ void tst_Tasking::testTree_data() createBarrierAdvance(storage, barrier, 1), Group { groupSetup(2), - WaitForBarrierTask(barrier), + waitForBarrierTask(barrier), createSuccessTask(2), createSuccessTask(3) } @@ -1871,7 +1871,7 @@ void tst_Tasking::testTree_data() createBarrierAdvance(storage, barrier, 1), Group { groupSetup(2), - WaitForBarrierTask(barrier), + waitForBarrierTask(barrier), createSuccessTask(2), createSuccessTask(3) } @@ -1902,7 +1902,7 @@ void tst_Tasking::testTree_data() parallel, Group { groupSetup(2), - WaitForBarrierTask(barrier), + waitForBarrierTask(barrier), createSuccessTask(2), createSuccessTask(3) }, @@ -1928,12 +1928,12 @@ void tst_Tasking::testTree_data() createBarrierAdvance(storage, barrier, 1), Group { groupSetup(2), - WaitForBarrierTask(barrier), + waitForBarrierTask(barrier), createSuccessTask(4) }, Group { groupSetup(3), - WaitForBarrierTask(barrier), + waitForBarrierTask(barrier), createSuccessTask(5) } }; @@ -1963,8 +1963,8 @@ void tst_Tasking::testTree_data() Group { parallel, groupSetup(1), - WaitForBarrierTask(barrier), - WaitForBarrierTask(barrier2) + waitForBarrierTask(barrier), + waitForBarrierTask(barrier2) }, createSuccessTask(3) }, @@ -2006,7 +2006,7 @@ void tst_Tasking::testTree_data() createBarrierAdvance(storage, barrier, 2), Group { groupSetup(2), - WaitForBarrierTask(barrier), + waitForBarrierTask(barrier), createSuccessTask(2), createSuccessTask(3) } @@ -2034,7 +2034,7 @@ void tst_Tasking::testTree_data() createBarrierAdvance(storage, barrier, 2), Group { groupSetup(2), - WaitForBarrierTask(barrier), + waitForBarrierTask(barrier), createSuccessTask(3), createSuccessTask(4) } @@ -2067,7 +2067,7 @@ void tst_Tasking::testTree_data() parallel, Group { groupSetup(2), - WaitForBarrierTask(barrier), + waitForBarrierTask(barrier), createSuccessTask(3), createSuccessTask(4) }, @@ -2097,12 +2097,12 @@ void tst_Tasking::testTree_data() createBarrierAdvance(storage, barrier, 2), Group { groupSetup(2), - WaitForBarrierTask(barrier), + waitForBarrierTask(barrier), createSuccessTask(3) }, Group { groupSetup(3), - WaitForBarrierTask(barrier), + waitForBarrierTask(barrier), createSuccessTask(4) } }; From 78b035f266179275312aab0f86cb99441f9c6ac9 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 12:39:52 +0200 Subject: [PATCH 0578/1777] TaskTree: Make GroupItem subclasses final They are not meant to be derived from. Change-Id: I946565cffe27b4cb42915ba560c6dffcfda4ab43 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/solutions/tasking/tasktree.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h index 2cd6e42bdbf..339644f7406 100644 --- a/src/libs/solutions/tasking/tasktree.h +++ b/src/libs/solutions/tasking/tasktree.h @@ -267,16 +267,15 @@ TASKING_EXPORT extern const GroupItem stopOnFinished; TASKING_EXPORT extern const GroupItem finishAllAndDone; TASKING_EXPORT extern const GroupItem finishAllAndError; -class TASKING_EXPORT Storage : public GroupItem +class TASKING_EXPORT Storage final : public GroupItem { public: Storage(const TreeStorageBase &storage) : GroupItem(storage) { } }; // Synchronous invocation. Similarly to Group - isn't counted as a task inside taskCount() -class TASKING_EXPORT Sync : public Group +class TASKING_EXPORT Sync final : public Group { - public: template<typename Function> Sync(Function &&function) : Group(init(std::forward<Function>(function))) {} @@ -314,7 +313,7 @@ private: }; template <typename Adapter> -class CustomTask : public GroupItem +class CustomTask final : public GroupItem { public: using Task = typename Adapter::Type; From f85aa6b5311962aea0c61855c44b0baa06f6a51b Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 13:08:59 +0200 Subject: [PATCH 0579/1777] TaskTree: Derive Sync from GroupItem instead of from Group Change-Id: I6fd9ce48d3105f95f566ccb3328875872fd4af2b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/libs/solutions/tasking/tasktree.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h index 339644f7406..eeaa29f5cb2 100644 --- a/src/libs/solutions/tasking/tasktree.h +++ b/src/libs/solutions/tasking/tasktree.h @@ -190,7 +190,7 @@ protected: static GroupItem parallelLimit(int limit) { return GroupItem({{}, limit}); } static GroupItem workflowPolicy(WorkflowPolicy policy) { return GroupItem({{}, {}, policy}); } static GroupItem withTimeout(const GroupItem &item, std::chrono::milliseconds timeout, - const GroupEndHandler &handler = {}); + const GroupEndHandler &handler = {}); private: Type m_type = Type::Group; @@ -274,15 +274,15 @@ public: }; // Synchronous invocation. Similarly to Group - isn't counted as a task inside taskCount() -class TASKING_EXPORT Sync final : public Group +class TASKING_EXPORT Sync final : public GroupItem { public: template<typename Function> - Sync(Function &&function) : Group(init(std::forward<Function>(function))) {} + Sync(Function &&function) { addChildren({init(std::forward<Function>(function))}); } private: template<typename Function> - static QList<GroupItem> init(Function &&function) { + static GroupItem init(Function &&function) { constexpr bool isInvocable = std::is_invocable_v<std::decay_t<Function>>; static_assert(isInvocable, "Sync element: The synchronous function can't take any arguments."); @@ -291,10 +291,10 @@ private: static_assert(isBool || isVoid, "Sync element: The synchronous function has to return void or bool."); if constexpr (isBool) { - return {onGroupSetup([function] { return function() ? SetupResult::StopWithDone - : SetupResult::StopWithError; })}; + return onGroupSetup([function] { return function() ? SetupResult::StopWithDone + : SetupResult::StopWithError; }); } - return {onGroupSetup([function] { function(); return SetupResult::StopWithDone; })}; + return onGroupSetup([function] { function(); return SetupResult::StopWithDone; }); }; }; From 9098bcd7061a3378c10b82cef1aec79d03f0d97f Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 13:14:53 +0200 Subject: [PATCH 0580/1777] TaskTree: Make Group final It's not meant to be derived from. Change-Id: I356b3af743bc672f7a62e9a5d8516beadb85a68d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/solutions/tasking/tasktree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h index eeaa29f5cb2..94db0d7c7ea 100644 --- a/src/libs/solutions/tasking/tasktree.h +++ b/src/libs/solutions/tasking/tasktree.h @@ -200,7 +200,7 @@ private: TaskHandler m_taskHandler; }; -class TASKING_EXPORT Group : public GroupItem +class TASKING_EXPORT Group final : public GroupItem { public: Group(const QList<GroupItem> &children) { addChildren(children); } From 8d8e60436da8103f98147c45a9c6da7cd31fcb80 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 20:52:58 +0200 Subject: [PATCH 0581/1777] ProjectExplorer: Simplify return statements Change-Id: Ifef006cd2dcc567097ce16376eab9ccedb092f04 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/abi.cpp | 6 +++--- .../projectexplorer/addrunconfigdialog.cpp | 2 +- .../projectexplorer/buildconfiguration.cpp | 5 ++--- .../customwizard/customwizardparameters.cpp | 8 ++++---- .../customwizard/customwizardscriptgenerator.cpp | 2 +- .../projectexplorer/dependenciespanel.cpp | 2 +- .../projectexplorer/deploymentdataview.cpp | 2 +- .../devicesupport/desktopdevice.cpp | 2 +- .../devicesupport/devicemanagermodel.cpp | 4 ++-- .../devicesupport/deviceprocessesdialog.cpp | 2 +- .../devicesupport/processlist.cpp | 2 +- .../devicesupport/sshsettings.cpp | 2 +- src/plugins/projectexplorer/extracompiler.cpp | 4 ++-- .../projectexplorer/filterkitaspectsdialog.cpp | 2 +- src/plugins/projectexplorer/gcctoolchain.cpp | 2 +- .../projectexplorer/jsonwizard/jsonwizard.cpp | 10 +++++----- .../jsonwizard/jsonwizardfactory.cpp | 6 +++--- src/plugins/projectexplorer/kitinformation.cpp | 11 +++++------ src/plugins/projectexplorer/kitmanager.cpp | 8 ++++---- src/plugins/projectexplorer/kitoptionspage.cpp | 4 ++-- src/plugins/projectexplorer/msvctoolchain.cpp | 8 ++++---- src/plugins/projectexplorer/project.cpp | 16 ++++++++-------- src/plugins/projectexplorer/projectmacro.cpp | 3 +-- src/plugins/projectexplorer/projectmanager.cpp | 4 ++-- src/plugins/projectexplorer/projectmodels.cpp | 5 ++--- src/plugins/projectexplorer/projectnodes.cpp | 2 +- src/plugins/projectexplorer/projectnodes.h | 2 +- .../projectexplorer/projectwelcomepage.cpp | 4 ++-- src/plugins/projectexplorer/projectwindow.cpp | 7 +++---- .../projectexplorer/projectwizardpage.cpp | 4 ++-- src/plugins/projectexplorer/runcontrol.cpp | 2 +- .../projectexplorer/selectablefilesmodel.cpp | 10 +++++----- src/plugins/projectexplorer/target.cpp | 2 +- .../projectexplorer/targetsettingspanel.cpp | 12 ++++-------- src/plugins/projectexplorer/taskmodel.cpp | 2 +- src/plugins/projectexplorer/toolchain.cpp | 6 +++--- src/plugins/projectexplorer/toolchain.h | 6 +++--- .../projectexplorer/toolchainoptionspage.cpp | 2 +- .../toolchainsettingsaccessor.cpp | 4 ++-- src/plugins/projectexplorer/treescanner.cpp | 4 ++-- 40 files changed, 91 insertions(+), 100 deletions(-) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 88efb966599..165eaf2b58a 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -196,7 +196,7 @@ static Abi macAbiForCpu(quint32 type) { case 0x01000000 + 12: // CPU_TYPE_ARM64 return Abi(Abi::ArmArchitecture, Abi::DarwinOS, Abi::GenericFlavor, Abi::MachOFormat, 64); default: - return Abi(); + return {}; } } @@ -451,7 +451,7 @@ Abi Abi::abiFromTargetTriplet(const QString &triple) { const QString machine = triple.toLower(); if (machine.isEmpty()) - return Abi(); + return {}; const QStringList parts = machine.split(QRegularExpression("[ /-]")); @@ -873,7 +873,7 @@ Abi Abi::fromString(const QString &abiString) if (!abiParts.isEmpty()) { architecture = architectureFromString(abiParts.at(0)); if (abiParts.at(0) != toString(architecture)) - return Abi(); + return {}; } Abi::OS os = UnknownOS; diff --git a/src/plugins/projectexplorer/addrunconfigdialog.cpp b/src/plugins/projectexplorer/addrunconfigdialog.cpp index b0b502f9ede..fa5b0bbb913 100644 --- a/src/plugins/projectexplorer/addrunconfigdialog.cpp +++ b/src/plugins/projectexplorer/addrunconfigdialog.cpp @@ -52,7 +52,7 @@ private: } return displayPath.isEmpty() ? Tr::tr("[none]") : displayPath.toUserOutput(); } - return QVariant(); + return {}; } const RunConfigurationCreationInfo m_creationInfo; diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 4fe82b14cdf..2d8afbd4fdb 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -546,9 +546,8 @@ bool BuildConfiguration::isEnabled() const QString BuildConfiguration::disabledReason() const { - if (!buildSystem()->hasParsingData()) - return (Tr::tr("The project was not parsed successfully.")); - return QString(); + return buildSystem()->hasParsingData() ? QString() + : Tr::tr("The project was not parsed successfully."); } bool BuildConfiguration::regenerateBuildFiles(Node *node) diff --git a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp index c63181bc6e6..516bab9f574 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp @@ -199,13 +199,13 @@ static inline QIcon wizardIcon(const QString &configFileFullPath, if (fi.isFile() && fi.isAbsolute()) return QIcon(fi.absoluteFilePath()); if (!fi.isRelative()) - return QIcon(); + return {}; // Expand by config path const QFileInfo absFi(QFileInfo(configFileFullPath).absolutePath() + QLatin1Char('/') + xmlIconFileName); if (absFi.isFile()) return QIcon(absFi.absoluteFilePath()); - return QIcon(); + return {}; } // Forward a reader over element text @@ -929,13 +929,13 @@ QString CustomWizardContext::processFile(const FieldReplacementMap &fm, QString if (!errorMessage.isEmpty()) { qWarning("Error processing custom widget file: %s\nFile:\n%s", qPrintable(errorMessage), qPrintable(in)); - return QString(); + return {}; } if (!Utils::TemplateEngine::preprocessText(in, &out, &errorMessage)) { qWarning("Error preprocessing custom widget file: %s\nFile:\n%s", qPrintable(errorMessage), qPrintable(in)); - return QString(); + return {}; } return out; } diff --git a/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.cpp b/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.cpp index 7d1174839dd..bfc8f46ae9d 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.cpp @@ -27,7 +27,7 @@ namespace Internal { QStringList fixGeneratorScript(const QString &configFile, QString binary) { if (binary.isEmpty()) - return QStringList(); + return {}; // Expand to full path if it is relative and in the wizard // directory, else assume it can be found in path. QFileInfo binaryInfo(binary); diff --git a/src/plugins/projectexplorer/dependenciespanel.cpp b/src/plugins/projectexplorer/dependenciespanel.cpp index daac52b8d75..5c6990b67d8 100644 --- a/src/plugins/projectexplorer/dependenciespanel.cpp +++ b/src/plugins/projectexplorer/dependenciespanel.cpp @@ -81,7 +81,7 @@ QVariant DependenciesModel::data(const QModelIndex &index, int role) const case Qt::DecorationRole: return Utils::FileIconProvider::icon(p->projectFilePath()); default: - return QVariant(); + return {}; } } diff --git a/src/plugins/projectexplorer/deploymentdataview.cpp b/src/plugins/projectexplorer/deploymentdataview.cpp index 5c13cb3acfb..c513c9cd19b 100644 --- a/src/plugins/projectexplorer/deploymentdataview.cpp +++ b/src/plugins/projectexplorer/deploymentdataview.cpp @@ -45,7 +45,7 @@ public: { if (role == Qt::DisplayRole || role == Qt::EditRole) return column == 0 ? file.localFilePath().toUserOutput() : file.remoteDirectory(); - return QVariant(); + return {}; } bool setData(int column, const QVariant &data, int role) override diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 98805597967..4f9e07ee64d 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -73,7 +73,7 @@ DesktopDevice::~DesktopDevice() = default; IDevice::DeviceInfo DesktopDevice::deviceInformation() const { - return DeviceInfo(); + return {}; } IDeviceWidget *DesktopDevice::createWidget() diff --git a/src/plugins/projectexplorer/devicesupport/devicemanagermodel.cpp b/src/plugins/projectexplorer/devicesupport/devicemanagermodel.cpp index 30e12354202..edb9999d6a0 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanagermodel.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanagermodel.cpp @@ -141,9 +141,9 @@ int DeviceManagerModel::rowCount(const QModelIndex &parent) const QVariant DeviceManagerModel::data(const QModelIndex &index, int role) const { if (!index.isValid() || index.row() >= rowCount()) - return QVariant(); + return {}; if (role != Qt::DisplayRole && role != Qt::UserRole) - return QVariant(); + return {}; const IDevice::ConstPtr dev = device(index.row()); if (role == Qt::UserRole) return dev->id().toSetting(); diff --git a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp index b5d138dfc9b..bd73abf0857 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp @@ -259,7 +259,7 @@ ProcessInfo DeviceProcessesDialogPrivate::selectedProcess() const { const QModelIndexList indexes = procView->selectionModel()->selectedIndexes(); if (indexes.empty() || !processList) - return ProcessInfo(); + return {}; return processList->at(proxyModel.mapToSource(indexes.first()).row()); } diff --git a/src/plugins/projectexplorer/devicesupport/processlist.cpp b/src/plugins/projectexplorer/devicesupport/processlist.cpp index 2d69fb404ec..b707b9b2569 100644 --- a/src/plugins/projectexplorer/devicesupport/processlist.cpp +++ b/src/plugins/projectexplorer/devicesupport/processlist.cpp @@ -118,7 +118,7 @@ QVariant DeviceProcessTreeItem::data(int column, int role) const else return process.commandLine; } - return QVariant(); + return {}; } void ProcessList::setFinished() diff --git a/src/plugins/projectexplorer/devicesupport/sshsettings.cpp b/src/plugins/projectexplorer/devicesupport/sshsettings.cpp index b5f247609e7..d428c4640a3 100644 --- a/src/plugins/projectexplorer/devicesupport/sshsettings.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshsettings.cpp @@ -114,7 +114,7 @@ static FilePath filePathValue(const FilePath &value, const QStringList &candidat if (!filePath.isEmpty()) return filePath; } - return FilePath(); + return {}; } // Keep read locker locked while calling this method diff --git a/src/plugins/projectexplorer/extracompiler.cpp b/src/plugins/projectexplorer/extracompiler.cpp index bbd34a798fa..1d0cb765685 100644 --- a/src/plugins/projectexplorer/extracompiler.cpp +++ b/src/plugins/projectexplorer/extracompiler.cpp @@ -350,12 +350,12 @@ GroupItem ProcessExtraCompiler::taskItemImpl(const ContentProvider &provider) FilePath ProcessExtraCompiler::workingDirectory() const { - return FilePath(); + return {}; } QStringList ProcessExtraCompiler::arguments() const { - return QStringList(); + return {}; } bool ProcessExtraCompiler::prepareToRun(const QByteArray &sourceContents) diff --git a/src/plugins/projectexplorer/filterkitaspectsdialog.cpp b/src/plugins/projectexplorer/filterkitaspectsdialog.cpp index b773f59abc5..389165976b4 100644 --- a/src/plugins/projectexplorer/filterkitaspectsdialog.cpp +++ b/src/plugins/projectexplorer/filterkitaspectsdialog.cpp @@ -48,7 +48,7 @@ private: return displayName(); if (column == 1 && role == Qt::CheckStateRole) return m_enabled ? Qt::Checked : Qt::Unchecked; - return QVariant(); + return {}; } bool setData(int column, const QVariant &data, int role) override diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index cb05e25a384..ccbf9f8db88 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1670,7 +1670,7 @@ QString ClangToolChain::sysRoot() const { const MingwToolChain *parentTC = mingwToolChainFromId(m_parentToolChainId); if (!parentTC) - return QString(); + return {}; const FilePath mingwCompiler = parentTC->compilerCommand(); return mingwCompiler.parentDir().parentDir().toString(); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp index 8204f7aaa25..b7207ce45ef 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp @@ -59,7 +59,7 @@ private: QVariant data(int column, int role) const override { if (column != 0 || role != Qt::DisplayRole) - return QVariant(); + return {}; return m_candidate->file.filePath().toUserOutput(); } @@ -192,7 +192,7 @@ JsonWizard::GeneratorFiles JsonWizard::generateFileList() Tr::tr("The wizard failed to generate files.<br>" "The error message was: \"%1\".").arg(errorMessage)); reject(); - return GeneratorFiles(); + return {}; } QList<GeneratorFile *> projectFiles; @@ -216,7 +216,7 @@ QString JsonWizard::stringValue(const QString &n) const { QVariant v = value(n); if (!v.isValid()) - return QString(); + return {}; if (v.typeId() == QVariant::String) { QString tmp = m_expander.expand(v.toString()); @@ -271,7 +271,7 @@ QVariant JsonWizard::value(const QString &n) const return v; if (hasField(n)) return field(n); // Cannot contain macros! - return QVariant(); + return {}; } bool JsonWizard::boolFromVariant(const QVariant &v, MacroExpander *expander) @@ -287,7 +287,7 @@ QString JsonWizard::stringListToArrayString(const QStringList &list, const Macro { // Todo: Handle ' embedded in the strings better. if (list.isEmpty()) - return QString(); + return {}; QStringList tmp = Utils::transform(list, [expander](const QString &i) { return expander->expand(i).replace(QLatin1Char('\''), QLatin1String("\\'")); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp index fa6f044f072..80a0b8e0dcb 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp @@ -660,7 +660,7 @@ QList<QVariant> JsonWizardFactory::objectOrList(const QVariant &data, QString *e QString JsonWizardFactory::localizedString(const QVariant &value) { if (value.isNull()) - return QString(); + return {}; if (value.typeId() == QVariant::Map) { QVariantMap tmp = value.toMap(); const QString locale = languageSetting().toLower(); @@ -671,7 +671,7 @@ QString JsonWizardFactory::localizedString(const QVariant &value) if (!result.isEmpty()) return result; } - return QString(); + return {}; } return Tr::tr(value.toByteArray()); } @@ -871,7 +871,7 @@ QVariant JsonWizardFactoryJsExtension::value(const QString &name) const return Id::toStringList(m_availableFeatures); if (name == "Plugins") return Id::toStringList(m_pluginFeatures); - return QVariant(); + return {}; } } // namespace Internal diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index 2b881a47168..84c203ddcf6 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -149,7 +149,7 @@ Utils::Id SysRootKitAspect::id() FilePath SysRootKitAspect::sysRoot(const Kit *k) { if (!k) - return FilePath(); + return {}; if (!k->value(SysRootKitAspect::id()).toString().isEmpty()) return FilePath::fromString(k->value(SysRootKitAspect::id()).toString()); @@ -158,8 +158,7 @@ FilePath SysRootKitAspect::sysRoot(const Kit *k) if (!tc->sysRoot().isEmpty()) return FilePath::fromString(tc->sysRoot()); } - - return FilePath(); + return {}; } void SysRootKitAspect::setSysRoot(Kit *k, const FilePath &v) @@ -584,7 +583,7 @@ QByteArray ToolChainKitAspect::toolChainId(const Kit *k, Id language) { QTC_ASSERT(ToolChainManager::isLoaded(), return nullptr); if (!k) - return QByteArray(); + return {}; QVariantMap value = k->value(ToolChainKitAspect::id()).toMap(); return value.value(language.toString(), QByteArray()).toByteArray(); } @@ -977,7 +976,7 @@ QVariant DeviceKitAspect::defaultValue(const Kit *k) const return dev->id().toString(); } // Fail: No device set up. - return QString(); + return {}; } Tasks DeviceKitAspect::validate(const Kit *k) const @@ -1544,7 +1543,7 @@ EnvironmentItems EnvironmentKitAspect::environmentChanges(const Kit *k) { if (k) return EnvironmentItem::fromStringList(k->value(EnvironmentKitAspect::id()).toStringList()); - return EnvironmentItems(); + return {}; } void EnvironmentKitAspect::setEnvironmentChanges(Kit *k, const EnvironmentItems &changes) diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 86a3b533c15..7c1eaa83f05 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -702,19 +702,19 @@ QList<OutputLineParser *> KitAspect::createOutputParsers(const Kit *k) const QString KitAspect::displayNamePostfix(const Kit *k) const { Q_UNUSED(k) - return QString(); + return {}; } QSet<Id> KitAspect::supportedPlatforms(const Kit *k) const { Q_UNUSED(k) - return QSet<Id>(); + return {}; } QSet<Id> KitAspect::availableFeatures(const Kit *k) const { Q_UNUSED(k) - return QSet<Id>(); + return {}; } void KitAspect::addToMacroExpander(Kit *k, MacroExpander *expander) const @@ -816,7 +816,7 @@ QString KitFeatureProvider::displayNameForPlatform(Id id) const QTC_CHECK(!dn.isEmpty()); return dn; } - return QString(); + return {}; } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/kitoptionspage.cpp b/src/plugins/projectexplorer/kitoptionspage.cpp index db578a403e6..24bafc0eeb0 100644 --- a/src/plugins/projectexplorer/kitoptionspage.cpp +++ b/src/plugins/projectexplorer/kitoptionspage.cpp @@ -230,11 +230,11 @@ void KitOptionsPageWidget::updateState() QModelIndex KitOptionsPageWidget::currentIndex() const { if (!m_selectionModel) - return QModelIndex(); + return {}; QModelIndexList idxs = m_selectionModel->selectedRows(); if (idxs.count() != 1) - return QModelIndex(); + return {}; return idxs.at(0); } diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 9b90effa3ba..2e692287ebd 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -116,7 +116,7 @@ static QString platformName(MsvcToolChain::Platform t) { if (const MsvcPlatform *p = platformEntry(t)) return QLatin1String(p->name); - return QString(); + return {}; } static bool hostPrefersPlatform(MsvcToolChain::Platform platform) @@ -2120,7 +2120,7 @@ std::optional<QString> MsvcToolChain::generateEnvironmentSettings(const Utils::E saver.write("@echo " + marker.toLocal8Bit() + "\r\n"); if (!saver.finalize()) { qWarning("%s: %s", Q_FUNC_INFO, qPrintable(saver.errorString())); - return QString(); + return {}; } Utils::Process run; @@ -2161,13 +2161,13 @@ std::optional<QString> MsvcToolChain::generateEnvironmentSettings(const Utils::E const int start = stdOut.indexOf(marker); if (start == -1) { qWarning("Could not find start marker in stdout output."); - return QString(); + return {}; } const int end = stdOut.indexOf(marker, start + 1); if (end == -1) { qWarning("Could not find end marker in stdout output."); - return QString(); + return {}; } const QString output = stdOut.mid(start, end - start); diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index c541d04773c..85a3850447d 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -725,7 +725,7 @@ FilePath Project::projectDirectory() const FilePath Project::projectDirectory(const FilePath &top) { if (top.isEmpty()) - return FilePath(); + return {}; return top.absolutePath(); } @@ -1232,10 +1232,10 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix, //: %1 is something like "Active project" ::PE::Tr::tr("%1: Variables in the active build environment.") .arg(descriptor), - [bcGetter](const QString &var) { + [bcGetter](const QString &var) -> QString { if (BuildConfiguration *const bc = bcGetter()) return bc->environment().expandedValueForKey(var); - return QString(); + return {}; }); expander->registerVariable(fullPrefix + "RunConfig:Name", @@ -1245,7 +1245,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix, [rcGetter]() -> QString { if (const RunConfiguration *const rc = rcGetter()) return rc->displayName(); - return QString(); + return {}; }); expander->registerFileVariables(fullPrefix + "RunConfig:Executable", //: %1 is something like "Active project" @@ -1262,25 +1262,25 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix, ::PE::Tr::tr( "%1: Variables in the environment of the active run configuration.") .arg(descriptor), - [rcGetter](const QString &var) { + [rcGetter](const QString &var) -> QString { if (const RunConfiguration *const rc = rcGetter()) { if (const auto envAspect = rc->aspect<EnvironmentAspect>()) return envAspect->environment().expandedValueForKey(var); } - return QString(); + return {}; }); expander->registerVariable(fullPrefix + "RunConfig:WorkingDir", //: %1 is something like "Active project" ::PE::Tr::tr( "%1: Working directory of the active run configuration.") .arg(descriptor), - [rcGetter] { + [rcGetter]() -> QString { if (const RunConfiguration *const rc = rcGetter()) { if (const auto wdAspect = rc->aspect<WorkingDirectoryAspect>()) return wdAspect->workingDirectory().toString(); } - return QString(); + return {}; }); } diff --git a/src/plugins/projectexplorer/projectmacro.cpp b/src/plugins/projectexplorer/projectmacro.cpp index 471cf65939d..9dfe0e2b168 100644 --- a/src/plugins/projectexplorer/projectmacro.cpp +++ b/src/plugins/projectexplorer/projectmacro.cpp @@ -24,8 +24,7 @@ QByteArray Macro::toByteArray() const case MacroType::Undefine: return QByteArray("#undef ") + key; case MacroType::Invalid: break; } - - return QByteArray(); + return {}; } QByteArray Macro::toByteArray(const Macros ¯os) diff --git a/src/plugins/projectexplorer/projectmanager.cpp b/src/plugins/projectexplorer/projectmanager.cpp index e1e8175b2fa..007efe13332 100644 --- a/src/plugins/projectexplorer/projectmanager.cpp +++ b/src/plugins/projectexplorer/projectmanager.cpp @@ -406,14 +406,14 @@ QString ProjectManagerPrivate::sessionTitle(const FilePath &filePath) } else { return sessionName.isEmpty() ? Tr::tr("Untitled") : sessionName; } - return QString(); + return {}; } QString ProjectManagerPrivate::locationInProject(const FilePath &filePath) { const Project *project = ProjectManager::projectForFile(filePath); if (!project) - return QString(); + return {}; const FilePath parentDir = filePath.parentDir(); if (parentDir == project->projectDirectory()) diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index e8ef6139d7b..698fcc54daf 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -190,7 +190,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const { const Node * const node = nodeForIndex(index); if (!node) - return QVariant(); + return {}; const FolderNode * const folderNode = node->asFolderNode(); const ContainerNode * const containerNode = node->asContainerNode(); @@ -247,8 +247,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const case Project::isParsingRole: return project && bs ? bs->isParsing() && !project->needsConfiguration() : false; } - - return QVariant(); + return {}; } Qt::ItemFlags FlatModel::flags(const QModelIndex &index) const diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index e5c8a9a3c64..11ab5fe0561 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -911,7 +911,7 @@ bool ProjectNode::addSubProject(const FilePath &proFilePath) QStringList ProjectNode::subProjectFileNamePatterns() const { - return QStringList(); + return {}; } bool ProjectNode::removeSubProject(const FilePath &proFilePath) diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index 0e0068ba7b0..25868d0ed75 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -142,7 +142,7 @@ public: virtual ContainerNode *asContainerNode() { return nullptr; } virtual const ContainerNode *asContainerNode() const { return nullptr; } - virtual QString buildKey() const { return QString(); } + virtual QString buildKey() const { return {}; } static bool sortByPath(const Node *a, const Node *b); void setParentFolderNode(FolderNode *parentFolder); diff --git a/src/plugins/projectexplorer/projectwelcomepage.cpp b/src/plugins/projectexplorer/projectwelcomepage.cpp index 1b2b1b1edc5..4fb585dee57 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.cpp +++ b/src/plugins/projectexplorer/projectwelcomepage.cpp @@ -81,10 +81,10 @@ QVariant ProjectModel::data(const QModelIndex &index, int role) const const Id projectBase = PROJECT_BASE_ID; if (Command *cmd = ActionManager::command(projectBase.withSuffix(index.row() + 1))) return cmd->keySequence().toString(QKeySequence::NativeText); - return QVariant(); + return {}; } default: - return QVariant(); + return {}; } } diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index a69ee4c855a..1ad0b256a2a 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -246,8 +246,7 @@ QVariant MiscSettingsPanelItem::data(int column, int role) const if (role == ActiveItemRole) // We are the active one. return QVariant::fromValue<TreeItem *>(const_cast<MiscSettingsPanelItem *>(this)); - - return QVariant(); + return {}; } Qt::ItemFlags MiscSettingsPanelItem::flags(int column) const @@ -300,7 +299,7 @@ public: if (0 <= m_currentPanelIndex && m_currentPanelIndex < childCount()) return childAt(m_currentPanelIndex)->data(column, role); } - return QVariant(); + return {}; } bool setData(int column, const QVariant &data, int role) override @@ -363,7 +362,7 @@ public: if (m_currentChildIndex == 1) return m_miscItem->data(column, role); } - return QVariant(); + return {}; } bool setData(int column, const QVariant &dat, int role) override diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index 75f573430dd..d8a815a7545 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -108,7 +108,7 @@ QVariant AddNewTree::data(int, int role) const case Qt::UserRole: return QVariant::fromValue(static_cast<void*>(node())); default: - return QVariant(); + return {}; } } @@ -201,7 +201,7 @@ QString BestNodeSelector::deployingProjects() const { if (m_deploys) return m_deployText; - return QString(); + return {}; } // -------------------------------------------------------------------- diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index f0d4a7fe3b0..c8418d82798 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1771,7 +1771,7 @@ QString RunWorker::userMessageForProcessError(QProcess::ProcessError error, cons // "The last waitFor...() function timed out. " // "The state of QProcess is unchanged, and you can try calling " // "waitFor...() again." - return QString(); // sic! + return {}; // sic! case QProcess::WriteError: msg = Tr::tr("An error occurred when attempting to write " "to the process. For example, the process may not be running, " diff --git a/src/plugins/projectexplorer/selectablefilesmodel.cpp b/src/plugins/projectexplorer/selectablefilesmodel.cpp index de5b0b79b40..4bdc973e1b1 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.cpp +++ b/src/plugins/projectexplorer/selectablefilesmodel.cpp @@ -184,12 +184,12 @@ QModelIndex SelectableFilesModel::index(int row, int column, const QModelIndex & QModelIndex SelectableFilesModel::parent(const QModelIndex &child) const { if (!child.isValid()) - return QModelIndex(); + return {}; if (!child.internalPointer()) - return QModelIndex(); + return {}; auto parent = static_cast<Tree *>(child.internalPointer())->parent; if (!parent) - return QModelIndex(); + return {}; if (!parent->parent) //then the parent is the root return createIndex(0, 0, parent); // figure out where the parent is @@ -202,7 +202,7 @@ QModelIndex SelectableFilesModel::parent(const QModelIndex &child) const QVariant SelectableFilesModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) - return QVariant(); + return {}; auto t = static_cast<Tree *>(index.internalPointer()); if (role == Qt::DisplayRole) return t->name; @@ -213,7 +213,7 @@ QVariant SelectableFilesModel::data(const QModelIndex &index, int role) const t->icon = Utils::FileIconProvider::icon(t->fullPath); return t->icon; } - return QVariant(); + return {}; } bool SelectableFilesModel::setData(const QModelIndex &index, const QVariant &value, int role) diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index ae6d6d78ce2..6f20ca8eaa3 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -584,7 +584,7 @@ QString Target::overlayIconToolTip() QVariantMap Target::toMap() const { if (!d->m_kit) // Kit was deleted, target is only around to be copied. - return QVariantMap(); + return {}; QVariantMap map; map.insert(displayNameKey(), displayName()); diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index f17354bc5da..313588c8006 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -309,8 +309,7 @@ public: default: break; } - - return QVariant(); + return {}; } bool setData(int column, const QVariant &data, int role) override @@ -554,8 +553,7 @@ public: default: break; } - - return QVariant(); + return {}; } Qt::ItemFlags flags(int column) const override @@ -611,8 +609,7 @@ public: font.setItalic(true); return font; } - - return QVariant(); + return {}; } bool setData(int column, const QVariant &data, int role) override @@ -700,8 +697,7 @@ QVariant TargetGroupItem::data(int column, int role) const d->ensureWidget(); return QVariant::fromValue<QWidget *>(d->m_configurePage.data()); } - - return QVariant(); + return {}; } bool TargetGroupItem::setData(int column, const QVariant &data, int role) diff --git a/src/plugins/projectexplorer/taskmodel.cpp b/src/plugins/projectexplorer/taskmodel.cpp index 06962dd13fa..0dae3344df6 100644 --- a/src/plugins/projectexplorer/taskmodel.cpp +++ b/src/plugins/projectexplorer/taskmodel.cpp @@ -283,7 +283,7 @@ Task TaskModel::task(const QModelIndex &index) const int row = index.row(); if (!index.isValid() || row < 0 || row >= m_tasks.count() || index.internalId() || index.column() > 0) { - return Task(); + return {}; } return m_tasks.at(row); } diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index a41c749d002..2c7a81acc98 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -90,7 +90,7 @@ Id fromLanguageV1(int language) return Id(Constants::CXX_LANGUAGE_ID); case Deprecated::Toolchain::None: default: - return Id(); + return {}; } } @@ -108,7 +108,7 @@ QString languageId(Language l) case Language::Cxx: return QStringLiteral("Cxx"); }; - return QString(); + return {}; } } // namespace Deprecated::ToolChain @@ -517,7 +517,7 @@ Tasks ToolChain::validateKit(const Kit *) const QString ToolChain::sysRoot() const { - return QString(); + return {}; } QString ToolChain::explicitCodeModelTargetTriple() const diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 337c10727b0..d6f2221cb82 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -94,9 +94,9 @@ public: void setTargetAbi(const Abi &abi); virtual ProjectExplorer::Abis supportedAbis() const; - virtual QString originalTargetTriple() const { return QString(); } - virtual QStringList extraCodeModelFlags() const { return QStringList(); } - virtual Utils::FilePath installDir() const { return Utils::FilePath(); } + virtual QString originalTargetTriple() const { return {}; } + virtual QStringList extraCodeModelFlags() const { return {}; } + virtual Utils::FilePath installDir() const { return {}; } virtual bool hostPrefersToolchain() const { return true; } virtual bool isValid() const; diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index 8954a93fa1a..c18a877ec26 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -78,7 +78,7 @@ public: return column == 0 && !toolChain->isValid() ? Utils::Icons::CRITICAL.icon() : QVariant(); } - return QVariant(); + return {}; } ToolChainConfigWidget *widget() diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index 7c005f62956..52af2cc5db3 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -306,10 +306,10 @@ public: static bool hasToolChains() { return !m_toolChains.isEmpty(); } bool isValid() const override { return m_valid; } - MacroInspectionRunner createMacroInspectionRunner() const override { return MacroInspectionRunner(); } + MacroInspectionRunner createMacroInspectionRunner() const override { return {}; } LanguageExtensions languageExtensions(const QStringList &cxxflags) const override { Q_UNUSED(cxxflags) return LanguageExtension::None; } WarningFlags warningFlags(const QStringList &cflags) const override { Q_UNUSED(cflags) return WarningFlags::NoWarnings; } - BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Utils::Environment &) const override { return BuiltInHeaderPathsRunner(); } + BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Utils::Environment &) const override { return {}; } void addToEnvironment(Environment &env) const override { Q_UNUSED(env) } FilePath makeCommand(const Environment &) const override { return "make"; } QList<OutputLineParser *> createOutputParsers() const override { return {}; } diff --git a/src/plugins/projectexplorer/treescanner.cpp b/src/plugins/projectexplorer/treescanner.cpp index 294ef4988e1..1eefc3baf42 100644 --- a/src/plugins/projectexplorer/treescanner.cpp +++ b/src/plugins/projectexplorer/treescanner.cpp @@ -77,7 +77,7 @@ TreeScanner::Result TreeScanner::result() const { if (isFinished()) return m_scanFuture.result(); - return Result(); + return {}; } TreeScanner::Result TreeScanner::release() @@ -88,7 +88,7 @@ TreeScanner::Result TreeScanner::release() return result; } m_scanFuture = Future(); - return Result(); + return {}; } void TreeScanner::reset() From 224e4eeb59e66848476f4e765cbbd482425dbd4c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 2 Aug 2023 11:37:20 +0200 Subject: [PATCH 0582/1777] GitPlugin: Simplify return statements Change-Id: If09c93acade749326b95bb1c6068b2d43a4d8551 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/git/branchmodel.cpp | 34 +++++++++---------- src/plugins/git/branchview.cpp | 2 +- .../git/gerrit/authenticationdialog.cpp | 2 +- src/plugins/git/gerrit/gerritmodel.cpp | 4 +-- src/plugins/git/gerrit/gerritpushdialog.cpp | 2 +- src/plugins/git/gitclient.cpp | 4 +-- src/plugins/git/giteditor.cpp | 12 +++---- src/plugins/git/logchangedialog.cpp | 6 ++-- src/plugins/git/mergetool.cpp | 4 +-- src/plugins/git/remotemodel.cpp | 5 ++- src/plugins/git/stashdialog.cpp | 6 ++-- src/plugins/gitlab/queryrunner.cpp | 2 +- 12 files changed, 40 insertions(+), 43 deletions(-) diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp index df38ea9961a..f01d2903d61 100644 --- a/src/plugins/git/branchmodel.cpp +++ b/src/plugins/git/branchmodel.cpp @@ -264,22 +264,22 @@ BranchModel::~BranchModel() QModelIndex BranchModel::index(int row, int column, const QModelIndex &parentIdx) const { if (column > 1) - return QModelIndex(); + return {}; BranchNode *parentNode = indexToNode(parentIdx); if (row >= parentNode->count()) - return QModelIndex(); + return {}; return nodeToIndex(parentNode->children.at(row), column); } QModelIndex BranchModel::parent(const QModelIndex &index) const { if (!index.isValid()) - return QModelIndex(); + return {}; BranchNode *node = indexToNode(index); if (node->parent == d->rootNode) - return QModelIndex(); + return {}; return nodeToIndex(node->parent, ColumnBranch); } @@ -304,7 +304,7 @@ QVariant BranchModel::data(const QModelIndex &index, int role) const BranchNode *node = indexToNode(index); if (!node) - return QVariant(); + return {}; switch (role) { case Qt::DisplayRole: { @@ -330,7 +330,7 @@ QVariant BranchModel::data(const QModelIndex &index, int role) const return index.column() == 0 ? node->fullRef() : QVariant(); case Qt::ToolTipRole: if (!node->isLeaf()) - return QVariant(); + return {}; if (node->toolTip.isEmpty()) node->toolTip = toolTip(node->sha); return node->toolTip; @@ -346,7 +346,7 @@ QVariant BranchModel::data(const QModelIndex &index, int role) const return font; } default: - return QVariant(); + return {}; } } @@ -524,17 +524,17 @@ FilePath BranchModel::workingDirectory() const QModelIndex BranchModel::currentBranch() const { if (!d->currentBranch) - return QModelIndex(); + return {}; return nodeToIndex(d->currentBranch, ColumnBranch); } QString BranchModel::fullName(const QModelIndex &idx, bool includePrefix) const { if (!idx.isValid()) - return QString(); + return {}; BranchNode *node = indexToNode(idx); if (!node || !node->isLeaf()) - return QString(); + return {}; if (node == d->headNode) return QString("HEAD"); return node->fullRef(includePrefix); @@ -550,7 +550,7 @@ QStringList BranchModel::localBranchNames() const QString BranchModel::sha(const QModelIndex &idx) const { if (!idx.isValid()) - return QString(); + return {}; BranchNode *node = indexToNode(idx); return node->sha; } @@ -558,13 +558,11 @@ QString BranchModel::sha(const QModelIndex &idx) const QDateTime BranchModel::dateTime(const QModelIndex &idx) const { if (!idx.isValid()) - return QDateTime(); + return {}; BranchNode *node = indexToNode(idx); return node->dateTime; } - - bool BranchModel::isHead(const QModelIndex &idx) const { if (!idx.isValid()) @@ -679,7 +677,7 @@ static int positionForName(BranchNode *node, const QString &name) QModelIndex BranchModel::addBranch(const QString &name, bool track, const QModelIndex &startPoint) { if (!d->rootNode || !d->rootNode->count()) - return QModelIndex(); + return {}; const QString trackedBranch = fullName(startPoint); const QString fullTrackedBranch = fullName(startPoint, true); @@ -705,7 +703,7 @@ QModelIndex BranchModel::addBranch(const QString &name, bool track, const QModel if (!gitClient().synchronousBranchCmd(d->workingDirectory, args, &output, &errorMessage)) { VcsOutputWindow::appendError(errorMessage); - return QModelIndex(); + return {}; } BranchNode *local = d->rootNode->children.at(LocalBranches); @@ -761,7 +759,7 @@ std::optional<QString> BranchModel::remoteName(const QModelIndex &idx) const if (!node) return std::nullopt; if (node == remotesNode) - return QString(); + return {}; if (node->parent == remotesNode) return node->name; return std::nullopt; @@ -888,7 +886,7 @@ BranchNode *BranchModel::indexToNode(const QModelIndex &index) const QModelIndex BranchModel::nodeToIndex(BranchNode *node, int column) const { if (node == d->rootNode) - return QModelIndex(); + return {}; return createIndex(node->parent->rowOf(node), column, static_cast<void *>(node)); } diff --git a/src/plugins/git/branchview.cpp b/src/plugins/git/branchview.cpp index ad045660cf7..53804efdd9c 100644 --- a/src/plugins/git/branchview.cpp +++ b/src/plugins/git/branchview.cpp @@ -333,7 +333,7 @@ QModelIndex BranchView::selectedIndex() { QModelIndexList selected = m_branchView->selectionModel()->selectedIndexes(); if (selected.isEmpty()) - return QModelIndex(); + return {}; return m_filterModel->mapToSource(selected.at(0)); } diff --git a/src/plugins/git/gerrit/authenticationdialog.cpp b/src/plugins/git/gerrit/authenticationdialog.cpp index 2fc855411d9..fd1eac05d61 100644 --- a/src/plugins/git/gerrit/authenticationdialog.cpp +++ b/src/plugins/git/gerrit/authenticationdialog.cpp @@ -39,7 +39,7 @@ static QString findEntry(const QString &line, const QString &type) const QRegularExpressionMatch match = entryMatch(line, type); if (match.hasMatch()) return match.captured(1); - return QString(); + return {}; } static bool replaceEntry(QString &line, const QString &type, const QString &value) diff --git a/src/plugins/git/gerrit/gerritmodel.cpp b/src/plugins/git/gerrit/gerritmodel.cpp index 8fdbf427f7b..a4f31f3393d 100644 --- a/src/plugins/git/gerrit/gerritmodel.cpp +++ b/src/plugins/git/gerrit/gerritmodel.cpp @@ -81,7 +81,7 @@ static inline QString defaultUrl(const QSharedPointer<GerritParameters> &p, QString GerritPatchSet::approvalsToHtml() const { if (approvals.isEmpty()) - return QString(); + return {}; QString result; QTextStream str(&result); @@ -411,7 +411,7 @@ QString GerritModel::toHtml(const QModelIndex& index) const static const QString neededByHeader = Git::Tr::tr("Needed by"); if (!index.isValid()) - return QString(); + return {}; const GerritChangePtr c = change(index); const QString serverPrefix = c->url.left(c->url.lastIndexOf('/') + 1); QString result; diff --git a/src/plugins/git/gerrit/gerritpushdialog.cpp b/src/plugins/git/gerrit/gerritpushdialog.cpp index a97bdeeabf8..a7d28060faf 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.cpp +++ b/src/plugins/git/gerrit/gerritpushdialog.cpp @@ -56,7 +56,7 @@ QString GerritPushDialog::determineRemoteBranch(const QString &localBranch) if (!gitClient().synchronousBranchCmd( m_workingDir, {"-r", "--contains", earliestCommit + '^'}, &output, &error)) { - return QString(); + return {}; } const QString head = "/HEAD"; const QStringList refs = output.split('\n'); diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index c4c53206d4c..494bf5c8fc1 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1677,7 +1677,7 @@ QString GitClient::synchronousTopic(const FilePath &workingDirectory) const // Detached HEAD, try a tag or remote branch QStringList references; if (!synchronousHeadRefs(workingDirectory, &references)) - return QString(); + return {}; const QString tagStart("refs/tags/"); const QString remoteStart("refs/remotes/"); @@ -2262,7 +2262,7 @@ QString GitClient::commandInProgressDescription(const FilePath &workingDirectory case Merge: return Tr::tr("MERGING"); } - return QString(); + return {}; } GitClient::CommandInProgress GitClient::checkCommandInProgress(const FilePath &workingDirectory) const diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index 717704ff028..a8613688ea8 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -110,11 +110,11 @@ QString GitEditorWidget::changeUnderCursor(const QTextCursor &c) const // Any number is regarded as change number. cursor.select(QTextCursor::WordUnderCursor); if (!cursor.hasSelection()) - return QString(); + return {}; const QString change = cursor.selectedText(); if (m_changeNumberPattern.match(change).hasMatch()) return change; - return QString(); + return {}; } BaseAnnotationHighlighter *GitEditorWidget::createAnnotationHighlighter(const QSet<QString> &changes) const @@ -317,7 +317,7 @@ QString GitEditorWidget::revisionSubject(const QTextBlock &inBlock) const return block.text().trimmed(); } } - return QString(); + return {}; } bool GitEditorWidget::supportChangeLinks() const @@ -363,21 +363,21 @@ QWidget *GitEditorWidget::addFilterWidget() QString GitEditorWidget::grepValue() const { if (!m_logFilterWidget) - return QString(); + return {}; return m_logFilterWidget->grepLineEdit->text(); } QString GitEditorWidget::pickaxeValue() const { if (!m_logFilterWidget) - return QString(); + return {}; return m_logFilterWidget->pickaxeLineEdit->text(); } QString GitEditorWidget::authorValue() const { if (!m_logFilterWidget) - return QString(); + return {}; return m_logFilterWidget->authorLineEdit->text(); } diff --git a/src/plugins/git/logchangedialog.cpp b/src/plugins/git/logchangedialog.cpp index 35f90abdadc..9462fc8bce9 100644 --- a/src/plugins/git/logchangedialog.cpp +++ b/src/plugins/git/logchangedialog.cpp @@ -95,7 +95,7 @@ QString LogChangeWidget::commit() const { if (const QStandardItem *sha1Item = currentItem(Sha1Column)) return sha1Item->text(); - return QString(); + return {}; } int LogChangeWidget::commitIndex() const @@ -113,7 +113,7 @@ QString LogChangeWidget::earliestCommit() const if (const QStandardItem *item = m_model->item(rows - 1, Sha1Column)) return item->text(); } - return QString(); + return {}; } void LogChangeWidget::setItemDelegate(QAbstractItemDelegate *delegate) @@ -269,7 +269,7 @@ int LogChangeDialog::commitIndex() const QString LogChangeDialog::resetFlag() const { if (!m_resetTypeComboBox) - return QString(); + return {}; return m_resetTypeComboBox->itemData(m_resetTypeComboBox->currentIndex()).toString(); } diff --git a/src/plugins/git/mergetool.cpp b/src/plugins/git/mergetool.cpp index 62a24bd93a6..775eb1ac213 100644 --- a/src/plugins/git/mergetool.cpp +++ b/src/plugins/git/mergetool.cpp @@ -94,7 +94,7 @@ QString MergeTool::mergeTypeName() case DeletedMerge: return Tr::tr("Deleted"); case SymbolicLinkMerge: return Tr::tr("Symbolic link"); } - return QString(); + return {}; } QString MergeTool::stateName(MergeTool::FileState state, const QString &extraInfo) @@ -107,7 +107,7 @@ QString MergeTool::stateName(MergeTool::FileState state, const QString &extraInf case SymbolicLinkState: return Tr::tr("Symbolic link -> %1").arg(extraInfo); default: break; } - return QString(); + return {}; } void MergeTool::chooseAction() diff --git a/src/plugins/git/remotemodel.cpp b/src/plugins/git/remotemodel.cpp index e5ba743ee8e..cbfa77afd93 100644 --- a/src/plugins/git/remotemodel.cpp +++ b/src/plugins/git/remotemodel.cpp @@ -112,14 +112,13 @@ QVariant RemoteModel::data(const QModelIndex &index, int role) const default: break; } - return QVariant(); + return {}; } QVariant RemoteModel::headerData(int section, Qt::Orientation orientation, int role) const { if (role != Qt::DisplayRole || orientation != Qt::Horizontal) - return QVariant(); - + return {}; return (section == 0) ? Tr::tr("Name") : Tr::tr("URL"); } diff --git a/src/plugins/git/stashdialog.cpp b/src/plugins/git/stashdialog.cpp index 3dc92249d93..d2807d1d8ec 100644 --- a/src/plugins/git/stashdialog.cpp +++ b/src/plugins/git/stashdialog.cpp @@ -234,14 +234,14 @@ static inline QString nextStash(const QString &stash) { const int openingBracePos = stash.indexOf('{'); if (openingBracePos == -1) - return QString(); + return {}; const int closingBracePos = stash.indexOf('}', openingBracePos + 2); if (closingBracePos == -1) - return QString(); + return {}; bool ok; const int n = stash.mid(openingBracePos + 1, closingBracePos - openingBracePos - 1).toInt(&ok); if (!ok) - return QString(); + return {}; QString rc = stash.left(openingBracePos + 1); rc += QString::number(n + 1); rc += '}'; diff --git a/src/plugins/gitlab/queryrunner.cpp b/src/plugins/gitlab/queryrunner.cpp index fd56c68c29d..8c48855f0b7 100644 --- a/src/plugins/gitlab/queryrunner.cpp +++ b/src/plugins/gitlab/queryrunner.cpp @@ -51,7 +51,7 @@ QString Query::toString() const QString query = API_PREFIX; switch (m_type) { case Query::NoQuery: - return QString(); + return {}; case Query::Project: QTC_ASSERT(!m_parameter.isEmpty(), return {}); query += QLatin1String(QUERY_PROJECT).arg(QLatin1String( From 88926ed1a8cfebdbefb628e33ad9129088e9c75b Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 2 Aug 2023 11:45:36 +0200 Subject: [PATCH 0583/1777] VcsPlugin: Simplify return statements Change-Id: Icdf580fb1ca6860a82f3594e4676fb450b55d174 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/vcsbase/nicknamedialog.cpp | 2 +- src/plugins/vcsbase/submitfilemodel.cpp | 4 ++-- src/plugins/vcsbase/vcsbaseclient.cpp | 2 +- src/plugins/vcsbase/vcsbaseeditor.cpp | 2 +- src/plugins/vcsbase/vcsbaseplugin.cpp | 4 ++-- src/plugins/vcsbase/vcsbasesubmiteditor.cpp | 2 +- src/plugins/vcsbase/vcsoutputwindow.cpp | 4 ++-- src/plugins/vcsbase/vcsplugin.cpp | 10 ++++------ 8 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/plugins/vcsbase/nicknamedialog.cpp b/src/plugins/vcsbase/nicknamedialog.cpp index 40d77dee545..39791dc7472 100644 --- a/src/plugins/vcsbase/nicknamedialog.cpp +++ b/src/plugins/vcsbase/nicknamedialog.cpp @@ -215,7 +215,7 @@ QString NickNameDialog::nickName() const if (const QStandardItem *item = m_model->itemFromIndex(sourceIndex)) return NickNameEntry::nickNameOf(item); } - return QString(); + return {}; } QStandardItemModel *NickNameDialog::createModel(QObject *parent) diff --git a/src/plugins/vcsbase/submitfilemodel.cpp b/src/plugins/vcsbase/submitfilemodel.cpp index 4ee4b35f3cf..02a9b6e359e 100644 --- a/src/plugins/vcsbase/submitfilemodel.cpp +++ b/src/plugins/vcsbase/submitfilemodel.cpp @@ -121,14 +121,14 @@ QList<QStandardItem *> SubmitFileModel::addFile(const QString &fileName, const Q QString SubmitFileModel::state(int row) const { if (row < 0 || row >= rowCount()) - return QString(); + return {}; return item(row)->text(); } QString SubmitFileModel::file(int row) const { if (row < 0 || row >= rowCount()) - return QString(); + return {}; return item(row, FileColumn)->text(); } diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index 93374712dd1..7460024e225 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -515,7 +515,7 @@ QString VcsBaseClient::vcsCommandString(VcsCommandTag cmd) const case LogCommand: return QLatin1String("log"); case StatusCommand: return QLatin1String("status"); } - return QString(); + return {}; } ExitCodeInterpreter VcsBaseClient::exitCodeInterpreter(VcsCommandTag cmd) const diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 036ddf12239..0df7b928ee7 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -1554,7 +1554,7 @@ bool VcsBaseEditorWidget::isValidRevision(const QString &revision) const QString VcsBaseEditorWidget::revisionSubject(const QTextBlock &inBlock) const { Q_UNUSED(inBlock) - return QString(); + return {}; } bool VcsBaseEditorWidget::hasDiff() const diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index b73f97dd79c..6880e42e5a2 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -220,7 +220,7 @@ QString StateListener::windowTitleVcsTopic(const FilePath &filePath) searchPath = projects.first()->projectDirectory(); } if (searchPath.isEmpty()) - return QString(); + return {}; FilePath topLevelPath; IVersionControl *vc = VcsManager::findVersionControlForDirectory( searchPath, &topLevelPath); @@ -232,7 +232,7 @@ static inline QString displayNameOfEditor(const FilePath &fileName) IDocument *document = DocumentModel::documentForFilePath(fileName); if (document) return document->displayName(); - return QString(); + return {}; } void StateListener::slotStateChanged() diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index c6d8653ec23..3b78546526e 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -487,7 +487,7 @@ QString VcsBaseSubmitEditor::promptForNickName() d->m_nickNameDialog = new NickNameDialog(VcsPlugin::instance()->nickNameModel(), d->m_widget); if (d->m_nickNameDialog->exec() == QDialog::Accepted) return d->m_nickNameDialog->nickName(); - return QString(); + return {}; } void VcsBaseSubmitEditor::slotInsertNickName() diff --git a/src/plugins/vcsbase/vcsoutputwindow.cpp b/src/plugins/vcsbase/vcsoutputwindow.cpp index 816aa79f022..d02ad28abc7 100644 --- a/src/plugins/vcsbase/vcsoutputwindow.cpp +++ b/src/plugins/vcsbase/vcsoutputwindow.cpp @@ -123,13 +123,13 @@ QString OutputWindowPlainTextEdit::identifierUnderCursor(const QPoint &widgetPos const int cursorDocumentPos = cursor.position(); cursor.select(QTextCursor::BlockUnderCursor); if (!cursor.hasSelection()) - return QString(); + return {}; const QString block = cursor.selectedText(); // Determine cursor position within line and find blank-delimited word const int cursorPos = cursorDocumentPos - cursor.block().position(); const int blockSize = block.size(); if (cursorPos < 0 || cursorPos >= blockSize || block.at(cursorPos).isSpace()) - return QString(); + return {}; // Retrieve repository if desired if (repository) if (QTextBlockUserData *data = cursor.block().userData()) diff --git a/src/plugins/vcsbase/vcsplugin.cpp b/src/plugins/vcsbase/vcsplugin.cpp index c622fbf45ef..62619b18d86 100644 --- a/src/plugins/vcsbase/vcsplugin.cpp +++ b/src/plugins/vcsbase/vcsplugin.cpp @@ -107,8 +107,7 @@ void VcsPlugin::initialize() MacroExpander *expander = globalMacroExpander(); expander->registerVariable(Constants::VAR_VCS_NAME, - Tr::tr("Name of the version control system in use by the current project."), - []() -> QString { + Tr::tr("Name of the version control system in use by the current project."), [] { IVersionControl *vc = nullptr; if (Project *project = ProjectTree::currentProject()) vc = VcsManager::findVersionControlForDirectory(project->projectDirectory()); @@ -116,8 +115,8 @@ void VcsPlugin::initialize() }); expander->registerVariable(Constants::VAR_VCS_TOPIC, - Tr::tr("The current version control topic (branch or tag) identification of the current project."), - []() -> QString { + Tr::tr("The current version control topic (branch or tag) identification " + "of the current project."), [] { IVersionControl *vc = nullptr; FilePath topLevel; if (Project *project = ProjectTree::currentProject()) @@ -126,8 +125,7 @@ void VcsPlugin::initialize() }); expander->registerVariable(Constants::VAR_VCS_TOPLEVELPATH, - Tr::tr("The top level path to the repository the current project is in."), - []() -> QString { + Tr::tr("The top level path to the repository the current project is in."), [] { if (Project *project = ProjectTree::currentProject()) return VcsManager::findTopLevelForDirectory(project->projectDirectory()).toString(); return QString(); From d45ece173298ac1f7ab73f3555160e1aef648c4b Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 2 Aug 2023 11:55:45 +0200 Subject: [PATCH 0584/1777] Bazaar, Cvs, Fossil, Mercurial, Perforce, Svn: Simplify returns Change-Id: Ic0d6a7510a26a4a9db180594f140156b036c5090 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/bazaar/annotationhighlighter.cpp | 2 +- src/plugins/bazaar/bazaarcommitwidget.cpp | 2 +- src/plugins/bazaar/bazaareditor.cpp | 2 +- src/plugins/bazaar/pullorpushdialog.cpp | 2 +- src/plugins/cvs/cvseditor.cpp | 2 +- src/plugins/cvs/cvssubmiteditor.cpp | 2 +- src/plugins/fossil/pullorpushdialog.cpp | 2 +- src/plugins/fossil/wizard/fossiljsextension.cpp | 15 +++------------ src/plugins/mercurial/annotationhighlighter.cpp | 2 +- src/plugins/mercurial/mercurialcommitwidget.cpp | 2 +- src/plugins/mercurial/mercurialeditor.cpp | 2 +- src/plugins/perforce/perforceeditor.cpp | 2 +- src/plugins/perforce/perforceplugin.cpp | 10 +++++----- src/plugins/subversion/subversionclient.cpp | 2 +- src/plugins/subversion/subversioneditor.cpp | 4 ++-- src/plugins/subversion/subversionplugin.cpp | 2 +- 16 files changed, 23 insertions(+), 32 deletions(-) diff --git a/src/plugins/bazaar/annotationhighlighter.cpp b/src/plugins/bazaar/annotationhighlighter.cpp index 8f99f9ec06a..7b5e2ba0208 100644 --- a/src/plugins/bazaar/annotationhighlighter.cpp +++ b/src/plugins/bazaar/annotationhighlighter.cpp @@ -19,7 +19,7 @@ QString BazaarAnnotationHighlighter::changeNumber(const QString &block) const const QRegularExpressionMatch match = m_changeset.match(block); if (match.hasMatch()) return match.captured(1); - return QString(); + return {}; } } // Bazaar::Internal diff --git a/src/plugins/bazaar/bazaarcommitwidget.cpp b/src/plugins/bazaar/bazaarcommitwidget.cpp index 379fca66610..465395e0aef 100644 --- a/src/plugins/bazaar/bazaarcommitwidget.cpp +++ b/src/plugins/bazaar/bazaarcommitwidget.cpp @@ -159,7 +159,7 @@ QString BazaarCommitWidget::committer() const const QString author = m_bazaarCommitPanel->authorLineEdit->text(); const QString email = m_bazaarCommitPanel->emailLineEdit->text(); if (author.isEmpty()) - return QString(); + return {}; QString user = author; if (!email.isEmpty()) { diff --git a/src/plugins/bazaar/bazaareditor.cpp b/src/plugins/bazaar/bazaareditor.cpp index 956ed6f28a9..146b2e71932 100644 --- a/src/plugins/bazaar/bazaareditor.cpp +++ b/src/plugins/bazaar/bazaareditor.cpp @@ -56,7 +56,7 @@ QString BazaarEditorWidget::changeUnderCursor(const QTextCursor &cursorIn) const } } } - return QString(); + return {}; } VcsBase::BaseAnnotationHighlighter *BazaarEditorWidget::createAnnotationHighlighter(const QSet<QString> &changes) const diff --git a/src/plugins/bazaar/pullorpushdialog.cpp b/src/plugins/bazaar/pullorpushdialog.cpp index 4c2cd99e7c5..1b607622369 100644 --- a/src/plugins/bazaar/pullorpushdialog.cpp +++ b/src/plugins/bazaar/pullorpushdialog.cpp @@ -112,7 +112,7 @@ PullOrPushDialog::~PullOrPushDialog() = default; QString PullOrPushDialog::branchLocation() const { if (m_defaultButton->isChecked()) - return QString(); + return {}; if (m_localButton->isChecked()) return m_localPathChooser->filePath().toString(); return m_urlLineEdit->text(); diff --git a/src/plugins/cvs/cvseditor.cpp b/src/plugins/cvs/cvseditor.cpp index 0a9298bd47e..d28144e3146 100644 --- a/src/plugins/cvs/cvseditor.cpp +++ b/src/plugins/cvs/cvseditor.cpp @@ -90,7 +90,7 @@ QString CvsEditorWidget::changeUnderCursor(const QTextCursor &c) const } break; } - return QString(); + return {}; } VcsBase::BaseAnnotationHighlighter *CvsEditorWidget::createAnnotationHighlighter(const QSet<QString> &changes) const diff --git a/src/plugins/cvs/cvssubmiteditor.cpp b/src/plugins/cvs/cvssubmiteditor.cpp index d5ecf9fcf4c..983dadaee32 100644 --- a/src/plugins/cvs/cvssubmiteditor.cpp +++ b/src/plugins/cvs/cvssubmiteditor.cpp @@ -29,7 +29,7 @@ QString CvsSubmitEditor::stateName(State st) const case LocallyRemoved: return m_msgRemoved; } - return QString(); + return {}; } void CvsSubmitEditor::setStateList(const StateFilePairs &statusOutput) diff --git a/src/plugins/fossil/pullorpushdialog.cpp b/src/plugins/fossil/pullorpushdialog.cpp index b6473a68b41..8c0df1dd522 100644 --- a/src/plugins/fossil/pullorpushdialog.cpp +++ b/src/plugins/fossil/pullorpushdialog.cpp @@ -82,7 +82,7 @@ PullOrPushDialog::PullOrPushDialog(Mode mode, QWidget *parent) QString PullOrPushDialog::remoteLocation() const { if (m_defaultButton->isChecked()) - return QString(); + return {}; if (m_localButton->isChecked()) return m_localPathChooser->filePath().toString(); return m_urlLineEdit->text(); diff --git a/src/plugins/fossil/wizard/fossiljsextension.cpp b/src/plugins/fossil/wizard/fossiljsextension.cpp index 9ca6b6e0bf0..aaf5d172b67 100644 --- a/src/plugins/fossil/wizard/fossiljsextension.cpp +++ b/src/plugins/fossil/wizard/fossiljsextension.cpp @@ -47,26 +47,17 @@ QString FossilJsExtension::displayName() const QString FossilJsExtension::defaultAdminUser() const { - if (!isConfigured()) - return QString(); - - return settings().userName(); + return isConfigured() ? settings().userName() : QString(); } QString FossilJsExtension::defaultSslIdentityFile() const { - if (!isConfigured()) - return QString(); - - return settings().sslIdentityFile().toFSPathString(); + return isConfigured() ? settings().sslIdentityFile().toFSPathString() : QString(); } QString FossilJsExtension::defaultLocalRepoPath() const { - if (!isConfigured()) - return QString(); - - return settings().defaultRepoPath().toFSPathString(); + return isConfigured() ? settings().defaultRepoPath().toFSPathString() : QString(); } bool FossilJsExtension::defaultDisableAutosync() const diff --git a/src/plugins/mercurial/annotationhighlighter.cpp b/src/plugins/mercurial/annotationhighlighter.cpp index be2259182f0..ec75322a71e 100644 --- a/src/plugins/mercurial/annotationhighlighter.cpp +++ b/src/plugins/mercurial/annotationhighlighter.cpp @@ -18,7 +18,7 @@ QString MercurialAnnotationHighlighter::changeNumber(const QString &block) const const QRegularExpressionMatch match = changeset.match(block); if (match.hasMatch()) return match.captured(1); - return QString(); + return {}; } } // Mercurial::Internal diff --git a/src/plugins/mercurial/mercurialcommitwidget.cpp b/src/plugins/mercurial/mercurialcommitwidget.cpp index c6b35a67d08..d1d1a7b37b9 100644 --- a/src/plugins/mercurial/mercurialcommitwidget.cpp +++ b/src/plugins/mercurial/mercurialcommitwidget.cpp @@ -151,7 +151,7 @@ QString MercurialCommitWidget::committer() const const QString author = mercurialCommitPanel->m_authorLineEdit->text(); const QString email = mercurialCommitPanel->m_emailLineEdit->text(); if (author.isEmpty()) - return QString(); + return {}; QString user = author; if (!email.isEmpty()) { diff --git a/src/plugins/mercurial/mercurialeditor.cpp b/src/plugins/mercurial/mercurialeditor.cpp index 19e1921e02c..b08802b8d66 100644 --- a/src/plugins/mercurial/mercurialeditor.cpp +++ b/src/plugins/mercurial/mercurialeditor.cpp @@ -45,7 +45,7 @@ QString MercurialEditorWidget::changeUnderCursor(const QTextCursor &cursorIn) co if (exactIdentifier40.match(change).hasMatch()) return change; } - return QString(); + return {}; } VcsBase::BaseAnnotationHighlighter *MercurialEditorWidget::createAnnotationHighlighter(const QSet<QString> &changes) const diff --git a/src/plugins/perforce/perforceeditor.cpp b/src/plugins/perforce/perforceeditor.cpp index ec418a7cedd..623ac1ed8fe 100644 --- a/src/plugins/perforce/perforceeditor.cpp +++ b/src/plugins/perforce/perforceeditor.cpp @@ -46,7 +46,7 @@ QString PerforceEditorWidget::changeUnderCursor(const QTextCursor &c) const // Any number is regarded as change number. cursor.select(QTextCursor::WordUnderCursor); if (!cursor.hasSelection()) - return QString(); + return {}; const QString change = cursor.selectedText(); return m_changeNumberPattern.match(change).hasMatch() ? change : QString(); } diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 2a9905a4c22..64ad692c889 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -1589,7 +1589,7 @@ QString PerforcePluginPrivate::clientFilePath(const QString &serverFilePath) const PerforceResponse response = runP4Cmd(m_settings.topLevelSymLinkTarget(), args, ShowBusyCursor|RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow); if (response.error) - return QString(); + return {}; const QRegularExpression r("\\.\\.\\.\\sclientFile\\s(.+?)\n"); const QRegularExpressionMatch match = r.match(response.stdOut); @@ -1604,14 +1604,14 @@ QString PerforcePluginPrivate::pendingChangesData() const PerforceResponse userResponse = runP4Cmd(m_settings.topLevelSymLinkTarget(), args, RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow); if (userResponse.error) - return QString(); + return {}; const QRegularExpression r("User\\sname:\\s(\\S+?)\\s*?\n"); QTC_ASSERT(r.isValid(), return QString()); const QRegularExpressionMatch match = r.match(userResponse.stdOut); const QString user = match.hasMatch() ? match.captured(1).trimmed() : QString(); if (user.isEmpty()) - return QString(); + return {}; args.clear(); args << QLatin1String("changes") << QLatin1String("-s") << QLatin1String("pending") << QLatin1String("-u") << user; const PerforceResponse dataResponse = runP4Cmd(m_settings.topLevelSymLinkTarget(), args, @@ -1644,7 +1644,7 @@ QString PerforcePlugin::fileNameFromPerforceName(const QString& perforceName, const PerforceResponse response = dd->runP4Cmd(dd->m_settings.topLevelSymLinkTarget(), args, flags); if (response.error) { *errorMessage = msgWhereFailed(perforceName, response.message); - return QString(); + return {}; } QString output = response.stdOut; @@ -1656,7 +1656,7 @@ QString PerforcePlugin::fileNameFromPerforceName(const QString& perforceName, if (output.isEmpty()) { //: File is not managed by Perforce *errorMessage = msgWhereFailed(perforceName, Tr::tr("The file is not mapped")); - return QString(); + return {}; } const QString p4fileSpec = output.mid(output.lastIndexOf(QLatin1Char(' ')) + 1); return dd->m_settings.mapToFileSystem(p4fileSpec); diff --git a/src/plugins/subversion/subversionclient.cpp b/src/plugins/subversion/subversionclient.cpp index 0e47c584542..5bb2a3eac2f 100644 --- a/src/plugins/subversion/subversionclient.cpp +++ b/src/plugins/subversion/subversionclient.cpp @@ -89,7 +89,7 @@ Id SubversionClient::vcsEditorKind(VcsCommandTag cmd) const case VcsBaseClient::LogCommand: return Constants::SUBVERSION_LOG_EDITOR_ID; case VcsBaseClient::AnnotateCommand: return Constants::SUBVERSION_BLAME_EDITOR_ID; default: - return Id(); + return {}; } } diff --git a/src/plugins/subversion/subversioneditor.cpp b/src/plugins/subversion/subversioneditor.cpp index c54371c7867..4549c6e14da 100644 --- a/src/plugins/subversion/subversioneditor.cpp +++ b/src/plugins/subversion/subversioneditor.cpp @@ -46,7 +46,7 @@ QString SubversionEditorWidget::changeUnderCursor(const QTextCursor &c) const // Any number is regarded as change number. cursor.select(QTextCursor::LineUnderCursor); if (!cursor.hasSelection()) - return QString(); + return {}; const QString change = cursor.selectedText(); const int pos = c.position() - cursor.selectionStart() + 1; // Annotation output has number, log output has revision numbers, @@ -72,7 +72,7 @@ QString SubversionEditorWidget::changeUnderCursor(const QTextCursor &c) const if (pos > start && pos <= end) return rev; } - return QString(); + return {}; } VcsBase::BaseAnnotationHighlighter *SubversionEditorWidget::createAnnotationHighlighter(const QSet<QString> &changes) const diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 7ddcb0ddf6c..fb6fca48d4f 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -994,7 +994,7 @@ QString SubversionPluginPrivate::monitorFile(const FilePath &repository) const return fi.absoluteFilePath(); } } - return QString(); + return {}; } QString SubversionPluginPrivate::synchronousTopic(const FilePath &repository) const From 9680b8434e7eeb6a7053e352757791a12b59d27f Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 2 Aug 2023 12:47:18 +0200 Subject: [PATCH 0585/1777] Tests: Simplify return statements Change-Id: I9609609f0f880654b73e8930cd05818ddf9b7152 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- .../auto/cplusplus/checksymbols/tst_checksymbols.cpp | 2 +- .../auto/cplusplus/preprocessor/tst_preprocessor.cpp | 11 +++-------- .../extensionsystem/pluginspec/tst_pluginspec.cpp | 4 ++-- .../qml/qmldesigner/coretests/testrewriterview.cpp | 3 +-- tests/auto/utils/multicursor/tst_multicursor.cpp | 2 +- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp b/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp index e73468db799..0e0705c5e56 100644 --- a/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp +++ b/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp @@ -144,7 +144,7 @@ public: if (result.column == column) return result; } - return Use(); + return {}; } CheckSymbols::Future future; diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp index d9fce5e2f23..54ceed08ca0 100644 --- a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp +++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp @@ -21,7 +21,7 @@ QByteArray loadSource(const QString &fileName) QFile inf(QLatin1String(SRCDIR) + QLatin1Char('/') + fileName); if (!inf.open(QIODevice::ReadOnly | QIODevice::Text)) { qDebug("Cannot open \"%s\"", fileName.toUtf8().constData()); - return QByteArray(); + return {}; } QTextStream ins(&inf); @@ -194,11 +194,7 @@ public: else dir = QFileInfo(currentFileName).dir(); const QFileInfo inc(dir, includedFileName); - if (inc.exists()) { - return inc.filePath(); - } else { - return QString(); - } + return inc.exists() ? inc.filePath() : QString(); } QString resolveGlobally(const QString ¤tFileName) const @@ -208,8 +204,7 @@ public: if (f.exists()) return f.filePath(); } - - return QString(); + return {}; } void setIncludePaths(const QStringList &includePaths) diff --git a/tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp b/tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp index abf5bd5c068..762142b95ee 100644 --- a/tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp +++ b/tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp @@ -20,13 +20,13 @@ static QJsonObject metaData(const QString &fileName) QFile f(fileName); if (!f.open(QIODevice::ReadOnly)) { qWarning() << "Could not open" << fileName; - return QJsonObject(); + return {}; } QJsonParseError error; QJsonDocument doc = QJsonDocument::fromJson(f.readAll(), &error); if (error.error != QJsonParseError::NoError) { qWarning() << "Could not parse" << fileName << ":" << error.errorString(); - return QJsonObject(); + return {}; } return doc.object(); } diff --git a/tests/auto/qml/qmldesigner/coretests/testrewriterview.cpp b/tests/auto/qml/qmldesigner/coretests/testrewriterview.cpp index 0f708da693e..4dc37a3b691 100644 --- a/tests/auto/qml/qmldesigner/coretests/testrewriterview.cpp +++ b/tests/auto/qml/qmldesigner/coretests/testrewriterview.cpp @@ -57,8 +57,7 @@ VariantProperty TestModelToTextMerger::findAddedVariantProperty(const VariantPro return property.toVariantProperty(); } } - - return VariantProperty(); + return {}; } TestRewriterView::TestRewriterView(ExternalDependenciesInterface &externalDependencies, diff --git a/tests/auto/utils/multicursor/tst_multicursor.cpp b/tests/auto/utils/multicursor/tst_multicursor.cpp index 4068d47f1fe..f873af143c7 100644 --- a/tests/auto/utils/multicursor/tst_multicursor.cpp +++ b/tests/auto/utils/multicursor/tst_multicursor.cpp @@ -57,7 +57,7 @@ public: QTextCursor toTextCursor(QTextDocument *doc) { if (p.first < 0) - return QTextCursor(); + return {}; QTextCursor c(doc); c.setPosition(p.second); c.setPosition(p.first, QTextCursor::KeepAnchor); From 197d80f99b987e70ce102f47f0e9a1c393601320 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 31 Jul 2023 12:14:14 +0200 Subject: [PATCH 0586/1777] Markdown: Use different background color for code Sets the background color for code blocks and for inline code (actually for any fixed font text). Change-Id: I1365111b38314a8e0a129aca35d754ad3f2f13bb Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/libs/utils/stringutils.cpp | 29 +++++++++++++++++++++++++++-- src/libs/utils/stringutils.h | 3 +++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/stringutils.cpp b/src/libs/utils/stringutils.cpp index a33a08e3d99..f91a8dc4ce9 100644 --- a/src/libs/utils/stringutils.cpp +++ b/src/libs/utils/stringutils.cpp @@ -5,6 +5,7 @@ #include "filepath.h" #include "qtcassert.h" +#include "stylehelper.h" #include "theme/theme.h" #include "utilstr.h" @@ -18,6 +19,7 @@ #include <QJsonArray> #include <QJsonValue> #include <QLocale> +#include <QPalette> #include <QRegularExpression> #include <QSet> #include <QTextDocument> @@ -573,16 +575,28 @@ QTCREATOR_UTILS_EXPORT int endOfNextWord(const QString &string, int position) MarkdownHighlighter::MarkdownHighlighter(QTextDocument *parent) : QSyntaxHighlighter(parent) , h2Brush(Qt::NoBrush) + , m_codeBgBrush(Qt::NoBrush) { parent->setIndentWidth(30); // default value is 40 } +QBrush MarkdownHighlighter::codeBgBrush() +{ + if (m_codeBgBrush.style() == Qt::NoBrush) { + m_codeBgBrush = StyleHelper::mergedColors(QGuiApplication::palette().color(QPalette::Text), + QGuiApplication::palette().color(QPalette::Base), + 10); + } + return m_codeBgBrush; +} + void MarkdownHighlighter::highlightBlock(const QString &text) { if (text.isEmpty()) return; - QTextBlockFormat fmt = currentBlock().blockFormat(); + const QTextBlock block = currentBlock(); + QTextBlockFormat fmt = block.blockFormat(); QTextCursor cur(currentBlock()); if (fmt.hasProperty(QTextFormat::HeadingLevel)) { fmt.setTopMargin(10); @@ -610,7 +624,8 @@ void MarkdownHighlighter::highlightBlock(const QString &text) } cur.setBlockFormat(fmt); } else if (fmt.hasProperty(QTextFormat::BlockCodeLanguage) && fmt.indent() == 0) { - // set identation for code blocks + // set identation and background for code blocks + fmt.setBackground(codeBgBrush()); fmt.setIndent(1); cur.setBlockFormat(fmt); } @@ -624,6 +639,16 @@ void MarkdownHighlighter::highlightBlock(const QString &text) list->setFormat(listFmt); } } + + // background color of code + for (auto it = block.begin(); it != block.end(); ++it) { + const QTextFragment fragment = it.fragment(); + QTextCharFormat fmt = fragment.charFormat(); + if (fmt.fontFixedPitch()) { + fmt.setBackground(codeBgBrush()); + setFormat(fragment.position() - block.position(), fragment.length(), fmt); + } + } } } // namespace Utils diff --git a/src/libs/utils/stringutils.h b/src/libs/utils/stringutils.h index 3bab6110cf3..b27a2efc6f0 100644 --- a/src/libs/utils/stringutils.h +++ b/src/libs/utils/stringutils.h @@ -130,7 +130,10 @@ public: void highlightBlock(const QString &text); private: + QBrush codeBgBrush(); + QBrush h2Brush; + QBrush m_codeBgBrush; }; } // namespace Utils From d060d1b2244e9de75d9e5960df16b9c9e13ce449 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 2 Aug 2023 12:41:28 +0200 Subject: [PATCH 0587/1777] QtSupport: Use QImage::fromData instead of QImageReader QImage offers this convenience shortcut since Qt 6.2. Change-Id: Ia1b286597ed13bcadeb663cf80b3dd3da964c5b7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/qtsupport/exampleslistmodel.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 6835ec60009..3254df00a93 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -9,7 +9,6 @@ #include <QApplication> #include <QDir> #include <QFile> -#include <QImageReader> #include <QPixmapCache> #include <QUrl> @@ -244,13 +243,10 @@ static QPixmap fetchPixmapAndUpdatePixmapCache(const QString &url) return pixmap; if (url.startsWith("qthelp://")) { - QByteArray fetchedData = Core::HelpManager::fileData(url); + const QByteArray fetchedData = Core::HelpManager::fileData(url); if (!fetchedData.isEmpty()) { - QBuffer imgBuffer(&fetchedData); - imgBuffer.open(QIODevice::ReadOnly); - QImageReader reader(&imgBuffer, QFileInfo(url).suffix().toLatin1()); - QImage img = reader.read(); - img.convertTo(QImage::Format_RGB32); + const QImage img = QImage::fromData(fetchedData, QFileInfo(url).suffix().toLatin1()) + .convertToFormat(QImage::Format_RGB32); const int dpr = qApp->devicePixelRatio(); // boundedTo -> don't scale thumbnails up const QSize scaledSize = From 6845434f3d447cd53b81c9aead4e283ea7fc2841 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 2 Aug 2023 20:12:04 +0200 Subject: [PATCH 0588/1777] VcsBaseDiffEditorController: Get rid of inputStorage() method Pass explicitly the storage to the postProcessTask() instead. Change-Id: I75ac10969530dfea1eac266b44481be3b1d8249b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/git/gitclient.cpp | 12 ++++++------ src/plugins/mercurial/mercurialclient.cpp | 4 ++-- src/plugins/subversion/subversionclient.cpp | 4 ++-- .../vcsbase/vcsbasediffeditorcontroller.cpp | 15 +++------------ src/plugins/vcsbase/vcsbasediffeditorcontroller.h | 3 +-- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 494bf5c8fc1..12ca9e3e4db 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -238,7 +238,7 @@ GitDiffEditorController::GitDiffEditorController(IDocument *document, { using namespace Tasking; - const TreeStorage<QString> diffInputStorage = inputStorage(); + const TreeStorage<QString> diffInputStorage; const auto setupDiff = [=](Process &process) { process.setCodec(VcsBaseEditor::getCodec(workingDirectory(), {})); @@ -252,7 +252,7 @@ GitDiffEditorController::GitDiffEditorController(IDocument *document, const Group root { Storage(diffInputStorage), ProcessTask(setupDiff, onDiffDone), - postProcessTask() + postProcessTask(diffInputStorage) }; setReloadRecipe(root); } @@ -304,7 +304,7 @@ FileListDiffController::FileListDiffController(IDocument *document, const QStrin }; const TreeStorage<DiffStorage> storage; - const TreeStorage<QString> diffInputStorage = inputStorage(); + const TreeStorage<QString> diffInputStorage; const auto setupStaged = [this, stagedFiles](Process &process) { if (stagedFiles.isEmpty()) @@ -346,7 +346,7 @@ FileListDiffController::FileListDiffController(IDocument *document, const QStrin ProcessTask(setupUnstaged, onUnstagedDone), onGroupDone(onStagingDone) }, - postProcessTask() + postProcessTask(diffInputStorage) }; setReloadRecipe(root); } @@ -377,7 +377,7 @@ ShowController::ShowController(IDocument *document, const QString &id) }; const TreeStorage<ReloadStorage> storage; - const TreeStorage<QString> diffInputStorage = inputStorage(); + const TreeStorage<QString> diffInputStorage; const auto updateDescription = [this](const ReloadStorage &storage) { QString desc = storage.m_header; @@ -552,7 +552,7 @@ ShowController::ShowController(IDocument *document, const QString &id) }, Group { ProcessTask(setupDiff, onDiffDone), - postProcessTask() + postProcessTask(diffInputStorage) } }; setReloadRecipe(root); diff --git a/src/plugins/mercurial/mercurialclient.cpp b/src/plugins/mercurial/mercurialclient.cpp index 6a0c2574d43..b2136e43afd 100644 --- a/src/plugins/mercurial/mercurialclient.cpp +++ b/src/plugins/mercurial/mercurialclient.cpp @@ -53,7 +53,7 @@ MercurialDiffEditorController::MercurialDiffEditorController(IDocument *document using namespace Tasking; - const TreeStorage<QString> diffInputStorage = inputStorage(); + const TreeStorage<QString> diffInputStorage; const auto setupDiff = [=](Process &process) { setupCommand(process, {addConfigurationArguments(args)}); @@ -66,7 +66,7 @@ MercurialDiffEditorController::MercurialDiffEditorController(IDocument *document const Group root { Storage(diffInputStorage), ProcessTask(setupDiff, onDiffDone), - postProcessTask() + postProcessTask(diffInputStorage) }; setReloadRecipe(root); } diff --git a/src/plugins/subversion/subversionclient.cpp b/src/plugins/subversion/subversionclient.cpp index 5bb2a3eac2f..27f1d7ca43b 100644 --- a/src/plugins/subversion/subversionclient.cpp +++ b/src/plugins/subversion/subversionclient.cpp @@ -163,7 +163,7 @@ SubversionDiffEditorController::SubversionDiffEditorController(IDocument *docume using namespace Tasking; - const TreeStorage<QString> diffInputStorage = inputStorage(); + const TreeStorage<QString> diffInputStorage; const auto setupDescription = [this](Process &process) { if (m_changeNumber == 0) @@ -209,7 +209,7 @@ SubversionDiffEditorController::SubversionDiffEditorController(IDocument *docume }, Group { ProcessTask(setupDiff, onDiffDone), - postProcessTask() + postProcessTask(diffInputStorage) } }; setReloadRecipe(root); diff --git a/src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp b/src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp index b60abaeb5f5..0486566c374 100644 --- a/src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp +++ b/src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp @@ -40,20 +40,11 @@ VcsBaseDiffEditorController::~VcsBaseDiffEditorController() delete d; } -TreeStorage<QString> VcsBaseDiffEditorController::inputStorage() const +GroupItem VcsBaseDiffEditorController::postProcessTask(const TreeStorage<QString> &inputStorage) { - return d->m_inputStorage; -} - -GroupItem VcsBaseDiffEditorController::postProcessTask() -{ - const auto setupDiffProcessor = [this](Async<QList<FileData>> &async) { - const QString *storage = inputStorage().activeStorage(); - QTC_ASSERT(storage, qWarning("Using postProcessTask() requires putting inputStorage() " - "into task tree's root group.")); - const QString inputData = storage ? *storage : QString(); + const auto setupDiffProcessor = [inputStorage](Async<QList<FileData>> &async) { async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer()); - async.setConcurrentCallData(&DiffUtils::readPatchWithPromise, inputData); + async.setConcurrentCallData(&DiffUtils::readPatchWithPromise, *inputStorage); }; const auto onDiffProcessorDone = [this](const Async<QList<FileData>> &async) { setDiffFiles(async.isResultAvailable() ? async.result() : QList<FileData>()); diff --git a/src/plugins/vcsbase/vcsbasediffeditorcontroller.h b/src/plugins/vcsbase/vcsbasediffeditorcontroller.h index e4b88805065..9c9b8fd7513 100644 --- a/src/plugins/vcsbase/vcsbasediffeditorcontroller.h +++ b/src/plugins/vcsbase/vcsbasediffeditorcontroller.h @@ -28,8 +28,7 @@ public: void setVcsBinary(const Utils::FilePath &path); protected: - Tasking::TreeStorage<QString> inputStorage() const; - Tasking::GroupItem postProcessTask(); + Tasking::GroupItem postProcessTask(const Tasking::TreeStorage<QString> &inputStorage); void setupCommand(Utils::Process &process, const QStringList &args) const; From a6df8ebb5325e5d06b6486264ec4a1e9d74a5f35 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 2 Aug 2023 23:04:15 +0200 Subject: [PATCH 0589/1777] VcsBaseDiffEditorController: Get rid of unused field Amends 6845434f3d447cd53b81c9aead4e283ea7fc2841 Change-Id: I73a01ddf8e3068dbe54f886c0194ccbc647967b0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp b/src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp index 0486566c374..f7372fcd074 100644 --- a/src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp +++ b/src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp @@ -9,7 +9,6 @@ #include <utils/environment.h> #include <utils/futuresynchronizer.h> #include <utils/process.h> -#include <utils/qtcassert.h> using namespace DiffEditor; using namespace Tasking; @@ -25,7 +24,6 @@ public: VcsBaseDiffEditorController *q; Environment m_processEnvironment; FilePath m_vcsBinary; - const TreeStorage<QString> m_inputStorage; }; ///////////////////// From 1ceea7a91fde3e977a0a8724602a58678c05c1e7 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 19:49:35 +0200 Subject: [PATCH 0590/1777] CppEditor: Add context object into connections Change-Id: I1a74f62b0a42ea4971b14fb82213f662b5fe4736 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/cppeditor/cppcodemodelsettingspage.cpp | 2 +- src/plugins/cppeditor/cppeditordocument.cpp | 13 ++++++------- src/plugins/cppeditor/cppeditorwidget.cpp | 2 +- src/plugins/cppeditor/cppinsertvirtualmethods.cpp | 2 +- src/plugins/cppeditor/cppquickfixes.cpp | 8 ++++---- .../cppeditor/cppquickfixprojectsettings.cpp | 2 +- src/plugins/cppeditor/cppquickfixsettingswidget.cpp | 8 ++++---- .../followsymbol_switchmethoddecldef_test.cpp | 2 +- 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp index 289cd3dc86c..58db1673348 100644 --- a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp @@ -82,7 +82,7 @@ CppCodeModelSettingsWidget::CppCodeModelSettingsWidget(CppCodeModelSettings *s) m_ignorePatternTextEdit->setToolTip(m_ignoreFilesCheckBox->toolTip()); m_ignorePatternTextEdit->setEnabled(m_ignoreFilesCheckBox->isChecked()); - connect(m_ignoreFilesCheckBox, &QCheckBox::stateChanged, [this] { + connect(m_ignoreFilesCheckBox, &QCheckBox::stateChanged, this, [this] { m_ignorePatternTextEdit->setEnabled(m_ignoreFilesCheckBox->isChecked()); }); diff --git a/src/plugins/cppeditor/cppeditordocument.cpp b/src/plugins/cppeditor/cppeditordocument.cpp index da9eaed9b87..3559fb7da73 100644 --- a/src/plugins/cppeditor/cppeditordocument.cpp +++ b/src/plugins/cppeditor/cppeditordocument.cpp @@ -388,8 +388,7 @@ BaseEditorDocumentProcessor *CppEditorDocument::processor() { if (!m_processor) { m_processor.reset(CppModelManager::createEditorDocumentProcessor(this)); - connect(m_processor.data(), - &BaseEditorDocumentProcessor::projectPartInfoUpdated, + connect(m_processor.data(), &BaseEditorDocumentProcessor::projectPartInfoUpdated, this, [this](const ProjectPartInfo &info) { const bool hasProjectPart = !(info.hints & ProjectPartInfo::IsFallbackMatch); minimizableInfoBars()->setInfoVisible(NO_PROJECT_CONFIGURATION, !hasProjectPart); @@ -398,15 +397,15 @@ BaseEditorDocumentProcessor *CppEditorDocument::processor() const bool isProjectFile = info.hints & ProjectPartInfo::IsFromProjectMatch; showHideInfoBarAboutMultipleParseContexts(isAmbiguous && isProjectFile); }); - connect(m_processor.data(), &BaseEditorDocumentProcessor::codeWarningsUpdated, - [this] (unsigned revision, - const QList<QTextEdit::ExtraSelection> selections, - const TextEditor::RefactorMarkers &refactorMarkers) { + connect(m_processor.data(), &BaseEditorDocumentProcessor::codeWarningsUpdated, this, + [this](unsigned revision, + const QList<QTextEdit::ExtraSelection> selections, + const TextEditor::RefactorMarkers &refactorMarkers) { emit codeWarningsUpdated(revision, selections, refactorMarkers); }); connect(m_processor.data(), &BaseEditorDocumentProcessor::ifdefedOutBlocksUpdated, this, &CppEditorDocument::ifdefedOutBlocksUpdated); - connect(m_processor.data(), &BaseEditorDocumentProcessor::cppDocumentUpdated, + connect(m_processor.data(), &BaseEditorDocumentProcessor::cppDocumentUpdated, this, [this](const CPlusPlus::Document::Ptr document) { // Update syntax highlighter auto *highlighter = qobject_cast<CppHighlighter *>(syntaxHighlighter()); diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index 4ebcf3941ef..f7305ff85f0 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -454,7 +454,7 @@ void CppEditorWidget::finalizeInitialization() connect(document(), &QTextDocument::contentsChange, &d->m_localRenaming, &CppLocalRenaming::onContentsChangeOfEditorWidgetDocument); - connect(&d->m_localRenaming, &CppLocalRenaming::finished, [this] { + connect(&d->m_localRenaming, &CppLocalRenaming::finished, this, [this] { cppEditorDocument()->recalculateSemanticInfoDetached(); }); connect(&d->m_localRenaming, &CppLocalRenaming::processKeyPressNormally, diff --git a/src/plugins/cppeditor/cppinsertvirtualmethods.cpp b/src/plugins/cppeditor/cppinsertvirtualmethods.cpp index eabd00c2f1c..5fba144c0e2 100644 --- a/src/plugins/cppeditor/cppinsertvirtualmethods.cpp +++ b/src/plugins/cppeditor/cppinsertvirtualmethods.cpp @@ -1048,7 +1048,7 @@ void InsertVirtualMethodsDialog::initGui() auto clearUserAddedReplacements = new QAction(this); clearUserAddedReplacements->setIcon(Utils::Icons::CLEAN_TOOLBAR.icon()); clearUserAddedReplacements->setText(Tr::tr("Clear Added \"override\" Equivalents")); - connect(clearUserAddedReplacements, &QAction::triggered, [this] { + connect(clearUserAddedReplacements, &QAction::triggered, this, [this] { m_availableOverrideReplacements = defaultOverrideReplacements(); updateOverrideReplacementsComboBox(); m_clearUserAddedReplacementsButton->setEnabled(false); diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 176a03fb4b5..43c96cf383b 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -8907,9 +8907,8 @@ public: QSizePolicy labelSizePolicy = errorLabel->sizePolicy(); labelSizePolicy.setRetainSizeWhenHidden(true); errorLabel->setSizePolicy(labelSizePolicy); - connect(constructorParamsModel, - &ConstructorParams::validOrder, - [=, button = buttonBox->button(QDialogButtonBox::Ok)](bool valid) { + connect(constructorParamsModel, &ConstructorParams::validOrder, this, + [errorLabel, button = buttonBox->button(QDialogButtonBox::Ok)](bool valid) { button->setEnabled(valid); errorLabel->setVisible(!valid); }); @@ -8917,7 +8916,8 @@ public: // setup select all/none checkbox QCheckBox *const checkBox = new QCheckBox(Tr::tr("Initialize all members")); checkBox->setChecked(true); - connect(checkBox, &QCheckBox::stateChanged, [model = constructorParamsModel](int state) { + connect(checkBox, &QCheckBox::stateChanged, this, + [model = constructorParamsModel](int state) { if (state != Qt::PartiallyChecked) { for (int i = 0; i < model->rowCount(); ++i) model->setData(model->index(i, ConstructorParams::ShouldInitColumn), diff --git a/src/plugins/cppeditor/cppquickfixprojectsettings.cpp b/src/plugins/cppeditor/cppquickfixprojectsettings.cpp index 3dbcf8d2047..d4d0f9b1de6 100644 --- a/src/plugins/cppeditor/cppquickfixprojectsettings.cpp +++ b/src/plugins/cppeditor/cppquickfixprojectsettings.cpp @@ -36,7 +36,7 @@ CppQuickFixProjectsSettings::CppQuickFixProjectsSettings(ProjectExplorer::Projec m_useGlobalSettings = true; } } - connect(project, &ProjectExplorer::Project::aboutToSaveSettings, [this] { + connect(project, &ProjectExplorer::Project::aboutToSaveSettings, this, [this] { auto settings = m_project->namedSettings(QUICK_FIX_SETTINGS_ID).toMap(); settings.insert(USE_GLOBAL_SETTINGS, m_useGlobalSettings); m_project->setNamedSettings(QUICK_FIX_SETTINGS_ID, settings); diff --git a/src/plugins/cppeditor/cppquickfixsettingswidget.cpp b/src/plugins/cppeditor/cppquickfixsettingswidget.cpp index 679d140967f..c589a26b9d2 100644 --- a/src/plugins/cppeditor/cppquickfixsettingswidget.cpp +++ b/src/plugins/cppeditor/cppquickfixsettingswidget.cpp @@ -190,24 +190,24 @@ e.g. name = "m_test_foo_": connect(m_listWidget_customTemplates, &QListWidget::currentItemChanged, this, &CppQuickFixSettingsWidget::currentCustomItemChanged); - connect(pushButton_addValueType, &QPushButton::clicked, [this] { + connect(pushButton_addValueType, &QPushButton::clicked, this, [this] { auto item = new QListWidgetItem("<type>", m_valueTypes); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemNeverHasChildren); m_valueTypes->scrollToItem(item); item->setSelected(true); }); - connect(pushButton_addCustomTemplate, &QPushButton::clicked, [this] { + connect(pushButton_addCustomTemplate, &QPushButton::clicked, this, [this] { auto item = new QListWidgetItem("<type>", m_listWidget_customTemplates); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemNeverHasChildren); m_listWidget_customTemplates->scrollToItem(item); m_listWidget_customTemplates->setCurrentItem(item); m_lineEdit_customTemplateTypes->setText("<type>"); }); - connect(m_pushButton_removeCustomTemplate, &QPushButton::clicked, [this] { + connect(m_pushButton_removeCustomTemplate, &QPushButton::clicked, this, [this] { delete m_listWidget_customTemplates->currentItem(); }); - connect(pushButton_removeValueType, &QPushButton::clicked, [this] { + connect(pushButton_removeValueType, &QPushButton::clicked, this, [this] { delete m_valueTypes->currentItem(); }); diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp index 8ee45c8e79f..feac4e70fa7 100644 --- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp +++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp @@ -381,7 +381,7 @@ F2TestCase::F2TestCase(CppEditorAction action, QObject::connect(&t, &QTimer::timeout, &l, &QEventLoop::quit); const IAssistProposal *immediateProposal = nullptr; const IAssistProposal *finalProposal = nullptr; - QObject::connect(initialTestFile->m_editorWidget, &CppEditorWidget::proposalsReady, + QObject::connect(initialTestFile->m_editorWidget, &CppEditorWidget::proposalsReady, &l, [&](const IAssistProposal *i, const IAssistProposal *f) { immediateProposal = i; finalProposal = f; From a1fbc1a4b7987b700e778c92026dadbd97f819e1 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 1 Aug 2023 20:17:54 +0200 Subject: [PATCH 0591/1777] LanguageClient: Add context object into connections Change-Id: I03bc2c1a9fa36d7c629d63a7fb866b919bb2cc20 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/languageclient/callhierarchy.cpp | 6 ++---- src/plugins/languageclient/languageclientmanager.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugins/languageclient/callhierarchy.cpp b/src/plugins/languageclient/callhierarchy.cpp index a05922cbe5e..029ca64d939 100644 --- a/src/plugins/languageclient/callhierarchy.cpp +++ b/src/plugins/languageclient/callhierarchy.cpp @@ -292,10 +292,8 @@ Core::NavigationView CallHierarchyFactory::createWidget() auto button = new QToolButton; button->setIcon(Icons::RELOAD_TOOLBAR.icon()); button->setToolTip(Tr::tr("Reloads the call hierarchy for the symbol under cursor position.")); - connect(button, &QToolButton::clicked, [h](){ - h->updateHierarchyAtCursorPosition(); - }); - return {h,{button}}; + connect(button, &QToolButton::clicked, this, [h] { h->updateHierarchyAtCursorPosition(); }); + return {h, {button}}; } } // namespace LanguageClient diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index 3129bccf30c..54b3f5205a5 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -590,7 +590,7 @@ void LanguageClientManager::trackClientDeletion(Client *client) { QTC_ASSERT(!m_scheduledForDeletion.contains(client->id()), return); m_scheduledForDeletion.insert(client->id()); - connect(client, &QObject::destroyed, [this, id = client->id()](){ + connect(client, &QObject::destroyed, this, [this, id = client->id()] { m_scheduledForDeletion.remove(id); if (isShutdownFinished()) emit shutdownFinished(); From cb0597aeed3b47dfa843abcf7ac8333156bbd239 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 1 Aug 2023 15:25:34 +0200 Subject: [PATCH 0592/1777] libvterm: Fix DECSTR (soft reset) command See: https://bugs.launchpad.net/libvterm/+bug/2029441 Change-Id: Ia2411819818cb7f0f6dff7dcc2d7d7730cfc6e7f Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/3rdparty/libvterm/src/parser.c | 2 +- src/libs/3rdparty/libvterm/src/state.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/3rdparty/libvterm/src/parser.c b/src/libs/3rdparty/libvterm/src/parser.c index b43a549cefc..b8959fdfe5b 100644 --- a/src/libs/3rdparty/libvterm/src/parser.c +++ b/src/libs/3rdparty/libvterm/src/parser.c @@ -203,7 +203,7 @@ size_t vterm_input_write(VTerm *vt, const char *bytes, size_t len) switch(vt->parser.state) { case CSI_LEADER: /* Extract leader bytes 0x3c to 0x3f */ - if(c >= 0x3c && c <= 0x3f) { + if(c >= 0x3c && c <= 0x3f || c == '!') { if(vt->parser.v.csi.leaderlen < CSI_LEADER_MAX-1) vt->parser.v.csi.leader[vt->parser.v.csi.leaderlen++] = c; break; diff --git a/src/libs/3rdparty/libvterm/src/state.c b/src/libs/3rdparty/libvterm/src/state.c index 5362efbcd35..1aa8ce5aa44 100644 --- a/src/libs/3rdparty/libvterm/src/state.c +++ b/src/libs/3rdparty/libvterm/src/state.c @@ -934,6 +934,7 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha return 0; switch(leader[0]) { + case '!': case '?': case '>': leader_byte = leader[0]; From 979cb4aba406c4f6cac14be5d1360128c00321b9 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 3 Aug 2023 08:10:24 +0200 Subject: [PATCH 0593/1777] libvterm: Fix osc_selection See: https://bugs.launchpad.net/libvterm/+bug/2029444 Change-Id: Ie358ee9554cca7a5c9a5bf477e45f21f1241dd89 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/libs/3rdparty/libvterm/src/state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/3rdparty/libvterm/src/state.c b/src/libs/3rdparty/libvterm/src/state.c index 1aa8ce5aa44..1b0a4a32ee9 100644 --- a/src/libs/3rdparty/libvterm/src/state.c +++ b/src/libs/3rdparty/libvterm/src/state.c @@ -1735,7 +1735,7 @@ static void osc_selection(VTermState *state, VTermStringFragment frag) .str = state->selection.buffer, .len = bufcur, .initial = state->tmp.selection.state == SELECTION_SET_INITIAL, - .final = frag.final, + .final = frag.final && frag.len == 0, }, state->selection.user); state->tmp.selection.state = SELECTION_SET; } From 0a69cdd277a25c0e5ebafe367e2282b3b6f7257b Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 3 Aug 2023 08:44:34 +0200 Subject: [PATCH 0594/1777] libvterm: Fix clear selection see: https://bugs.launchpad.net/libvterm/+bug/2029450 Change-Id: I3a075e58787bdd85a154dc7d0626a398d072f5b8 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/libs/3rdparty/libvterm/src/state.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libs/3rdparty/libvterm/src/state.c b/src/libs/3rdparty/libvterm/src/state.c index 1b0a4a32ee9..45db3fca2ea 100644 --- a/src/libs/3rdparty/libvterm/src/state.c +++ b/src/libs/3rdparty/libvterm/src/state.c @@ -1657,8 +1657,18 @@ static void osc_selection(VTermState *state, VTermStringFragment frag) frag.len--; } - if(!frag.len) + if(!frag.len) { + // Clear selection + if(state->selection.callbacks->set) { + (*state->selection.callbacks->set)(state->tmp.selection.mask, (VTermStringFragment){ + .str = 0, + .len = 0, + .initial = true, + .final = true, + }, state->selection.user); + } return; + } if(state->tmp.selection.state == SELECTION_SELECTED) { if(frag.str[0] == '?') { From 8ac94047257fa611a0826c0c2711f35b1a279d15 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 3 Aug 2023 08:25:10 +0200 Subject: [PATCH 0595/1777] Terminal: Add support for copy (OSC52) Allows terminal apps like vim to set the clipboard, even from inside an ssh/remote shell. Change-Id: I1d068737ef65bb4541c3fc9c43870986865f1b45 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../solutions/terminal/surfaceintegration.h | 3 ++ .../solutions/terminal/terminalsurface.cpp | 38 ++++++++++++++++ src/plugins/terminal/shellintegration.cpp | 5 +++ src/plugins/terminal/shellintegration.h | 2 + src/plugins/terminal/tests/copy | 45 +++++++++++++++++++ 5 files changed, 93 insertions(+) create mode 100755 src/plugins/terminal/tests/copy diff --git a/src/libs/solutions/terminal/surfaceintegration.h b/src/libs/solutions/terminal/surfaceintegration.h index 5959e2b53a7..99b9538de15 100644 --- a/src/libs/solutions/terminal/surfaceintegration.h +++ b/src/libs/solutions/terminal/surfaceintegration.h @@ -14,6 +14,9 @@ public: virtual void onBell() {} virtual void onTitle(const QString &title) { Q_UNUSED(title); } + + virtual void onSetClipboard(const QByteArray &text) { Q_UNUSED(text); } + virtual void onGetClipboard() {} }; } // namespace TerminalSolution diff --git a/src/libs/solutions/terminal/terminalsurface.cpp b/src/libs/solutions/terminal/terminalsurface.cpp index 3f816670c34..8baf743e2f0 100644 --- a/src/libs/solutions/terminal/terminalsurface.cpp +++ b/src/libs/solutions/terminal/terminalsurface.cpp @@ -142,6 +142,41 @@ struct TerminalSurfacePrivate VTermState *vts = vterm_obtain_state(m_vterm.get()); vterm_state_set_unrecognised_fallbacks(vts, &m_vtermStateFallbacks, this); + + memset(&m_vtermSelectionCallbacks, 0, sizeof(m_vtermSelectionCallbacks)); + + m_vtermSelectionCallbacks.query = [](VTermSelectionMask mask, void *user) { + if (!(mask & 0xF)) + return 0; + + auto p = static_cast<TerminalSurfacePrivate *>(user); + if (p->m_surfaceIntegration) + p->m_surfaceIntegration->onGetClipboard(); + + return 0; + }; + + m_vtermSelectionCallbacks.set = + [](VTermSelectionMask mask, VTermStringFragment frag, void *user) { + if (!(mask & 0xF)) + return 0; + + auto p = static_cast<TerminalSurfacePrivate *>(user); + if (frag.initial) + p->m_selectionBuffer.clear(); + + p->m_selectionBuffer.append(frag.str, frag.len); + if (!frag.final) + return 1; + + if (p->m_surfaceIntegration) + p->m_surfaceIntegration->onSetClipboard(p->m_selectionBuffer); + + return 1; + }; + + vterm_state_set_selection_callbacks(vts, &m_vtermSelectionCallbacks, this, nullptr, 256); + vterm_state_set_bold_highbright(vts, true); VTermColor fg; @@ -363,6 +398,8 @@ struct TerminalSurfacePrivate VTermScreenCallbacks m_vtermScreenCallbacks; VTermStateFallbacks m_vtermStateFallbacks; + VTermSelectionCallbacks m_vtermSelectionCallbacks; + Cursor m_cursor; QString m_currentCommand; @@ -375,6 +412,7 @@ struct TerminalSurfacePrivate TerminalSurface *q; QTimer m_delayWriteTimer; QByteArray m_writeBuffer; + QByteArray m_selectionBuffer; TerminalSurface::WriteToPty m_writeToPty; }; diff --git a/src/plugins/terminal/shellintegration.cpp b/src/plugins/terminal/shellintegration.cpp index 44cee54b978..c0cad7f3dd2 100644 --- a/src/plugins/terminal/shellintegration.cpp +++ b/src/plugins/terminal/shellintegration.cpp @@ -179,4 +179,9 @@ void ShellIntegration::prepareProcess(Utils::Process &process) process.setEnvironment(env); } +void ShellIntegration::onSetClipboard(const QByteArray &text) +{ + setClipboardAndSelection(QString::fromLocal8Bit(text)); +} + } // namespace Terminal diff --git a/src/plugins/terminal/shellintegration.h b/src/plugins/terminal/shellintegration.h index aac63e63e84..22cf4e79a34 100644 --- a/src/plugins/terminal/shellintegration.h +++ b/src/plugins/terminal/shellintegration.h @@ -23,6 +23,8 @@ public: void onBell() override; void onTitle(const QString &title) override; + void onSetClipboard(const QByteArray &text) override; + void prepareProcess(Utils::Process &process); signals: diff --git a/src/plugins/terminal/tests/copy b/src/plugins/terminal/tests/copy new file mode 100755 index 00000000000..fdd9e71d187 --- /dev/null +++ b/src/plugins/terminal/tests/copy @@ -0,0 +1,45 @@ +#!/bin/bash + +function set_clipboard() { + b=$(echo -ne "$2" | base64); + printf "\033]52;$1;$b\a\n" +} + +function test_clipboard() { + echo -e "\033[1m ⎆ The Clipboard should now contain '$2'\033[0m" + + set_clipboard "$1" "$2" + + read -p " ⎆ Press enter to continue " -n1 -s + echo + echo +} + +test_clipboard "c" "copypasta!" +test_clipboard "p" "Mask: p" +test_clipboard "q" "Mask: q" +test_clipboard "s" "Mask: s" +test_clipboard "cpqs" "Mask: cpqs" + +echo -e "\033[1m ⎆ The Clipboard should now be empty\033[0m" +printf "\033]52;cpqs;\a\n" + +read -p " ⎆ Press enter to continue " -n1 -s +echo +echo + +echo -e "\033[1m ⎆ The Clipboard should still be empty\033[0m" +set_clipboard "01234567" "Hello World!" + +read -p " ⎆ Press enter to continue " -n1 -s +echo +echo + +test_clipboard "c01234567" "Hello World!" + +echo -e "\033[1m ⎆ The Clipboard should now contain the source of terminalsurface.cpp\033[0m" +printf "\033]52;c;Ly8gQ29weXJpZ2h0IChDKSAyMDIyIFRoZSBRdCBDb21wYW55IEx0ZC4KLy8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IExpY2Vuc2VSZWYtUXQtQ29tbWVyY2lhbCBPUiBHUEwtMy4wKyBPUiBHUEwtMy4wIFdJVEggUXQtR1BMLWV4Y2VwdGlvbi0xLjAKCiNpbmNsdWRlICJ0ZXJtaW5hbHN1cmZhY2UuaCIKI2luY2x1ZGUgInN1cmZhY2VpbnRlZ3JhdGlvbi5oIgoKI2luY2x1ZGUgImtleXMuaCIKI2luY2x1ZGUgInNjcm9sbGJhY2suaCIKCiNpbmNsdWRlIDx2dGVybS5oPgoKI2luY2x1ZGUgPFFMb2dnaW5nQ2F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6ZW9mKG1fdnRlcm1TZWxlY3Rpb25DYWxsYmFja3MpKTsKCiAgICAgICAgbV92dGVybVNlbGVjdGlvbkNhbGxiYWNrcy5xdWVyeSA9IFtdKFZUZXJtU2VsZWN0aW9uTWFzayBtYXNrLCB2b2lkICp1c2VyKSB7CiAgICAgICAgICAgIGlmICghKG1hc2sgJiAweEYpKQogICAgICAgICAgICAgICAgcmV0dXJuIDA7CgogICAgICAgICAgICBhdXRvIHAgPSBzdGF0aWNfY2FzdDxUZXJtaW5hbFN1cmZhY2VQcml2YXRlICo+KHVzZXIpOwogICAgICAgICAgICBpZiAocC0+bV9zdXJmYWNlSW50ZWdyYXRpb24pCiAgICAgICAgICAgICAgICBwLT5tX3N1cmZhY2VJbnRlZ3JhdGlvbi0+b25HZXRDbGlwYm9hcmQoKTsKCiAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgIH07CgogICAgICAgIG1fdnRlcm1TZWxlY3Rpb25DYWxsYmFja3Muc2V0ID0KICAgICAgICAgICAgW10oVlRlcm1TZWxlY3Rpb25NYXNrIG1hc2ssIFZUZXJtU3RyaW5nRnJhZ21lbnQgZnJhZywgdm9pZCAqdXNlcikgewogICAgICAgICAgICAgICAgaWYgKCEobWFzayAmIDB4RikpCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CgogICAgICAgICAgICAgICAgYXV0byBwID0gc3RhdGljX2Nhc3Q8VGVybWluYWxTdXJmYWNlUHJpdmF0ZSAqPih1c2VyKTsKICAgICAgICAgICAgICAgIGlmIChmcmFnLmluaXRpYWwpCiAgICAgICAgICAgICAgICAgICAgcC0+bV9zZWxlY3Rpb25CdWZmZXIuY2xlYXIoKTsKCiAgICAgICAgICAgICAgICBwLT5tX3NlbGVjdGlvbkJ1ZmZlci5hcHBlbmQoZnJhZy5zdHIsIGZyYWcubGVuKTsKICAgICAgICAgICAgICAgIGlmICghZnJhZy5maW5hbCkKICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTsKCiAgICAgICAgIC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WxsKQogICAgewogICAgICAgIFRlcm1pbmFsQ2VsbCByZXN1bHQ7CiAgICAgICAgcmVzdWx0LndpZHRoID0gY2VsbC53aWR0aDsKICAgICAgICByZXN1bHQudGV4dCA9IFFTdHJpbmc6OmZyb21VY3M0KGNlbGwuY2hhcnMpOwoKICAgICAgICBjb25zdCBWVGVybUNvbG9yICpiZyA9ICZjZWxsLmJnOwogICAgICAgIGNvbnN0IFZUZXJtQ29sb3IgKmZnID0gJmNlbGwuZmc7CgogICAgICAgIGlmIChzdGF0aWNfY2FzdDxib29sPihjZWxsLmF0dHJzLnJldmVyc2UpKQogICAgICAgICAgICBzdGQ6OnN3YXAoZmcsIGJnKTsKCiAgICAgICAgcmVzdWx0LmJhY2tncm91bmRDb2xvciA9IHRvVmFyaWFudENvbG9yKCpiZyk7CiAgICAgICAgcmVzdWx0LmZvcmVncm91bmRDb2xvciA9IHRvVmFyaWFudENvbG9yKCpmZyk7CgogICAgICAgIHJlc3VsdC5ib2xkID0gY2VsbC5hdHRycy5ib2xkOwogICAgICAgIHJlc3VsdC5zdHJpa2VPdXQgPSBjZWxsLmF0dHJzLnN0cmlrZTsKCiAgICAgICAgaWYgKGNlbGwuYXR0cnMudW5kZXJsaW5lID4gMCkgewogICAgICAgICAgICByZXN1bHQudW5kZXJsaW5lU3R5bGUgPSBRVGV4dENoYXJGb3JtYXQ6Ok5vVW5kZXJsaW5lOwogICAgICAgICAgICBzd2l0Y2ggKGNlbGwuYXR0cnMudW5kZXJsaW5lKSB7CiAgICAgICAgICAgIGNhc2UgVlRFUk1fVU5ERVJMSU5FX1NJTkdMRToKICAgICAgICAgICAgICAgIHJlc3VsdC51bmRlcmxpbmVTdHlsZSA9IFFUZXh0Q2hhckZvcm1hdDo6U2luZ2xlVW5kZXJsaW5lOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgVlRFUk1fVU5ERVJMSU5FX0RPVUJMRToKICAgICAgICAgICAgICAgIC8vIFRPRE86IERvdWJsZSB1bmRlcmxpbmUKICAgICAgICAgICAgICAgIHJlc3VsdC51bmRlcmxpbmVTdHlsZSA9IFFUZXh0Q2hhckZvcm1hdDo6U2luZ2xlVW5kZXJsaW5lOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgVlRFUk1fVU5ERVJMSU5FX0NVUkxZOgogICAgICAgICAgICAgICAgcmVzdWx0LnVuZGVybGluZVN0eWxlID0gUVRleHRDaGFyRm9ybWF0OjpXYXZlVW5kZXJsaW5lOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgVlRFUk1fVU5ERVJMSU5FX0RBU0hFRDoKICAgICAgICAgICAgICAgIHJlc3VsdC51bmRlcmxpbmVTdHlsZSA9IFFUZXh0Q2hhckZvcm1hdDo6RGFzaFVuZGVybGluZTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlIFZURVJNX1VOREVSTElORV9ET1RURUQ6CiAgICAgICAgICAgICAgICByZXN1bHQudW5kZXJsaW5lU3R5bGUgPSBRVGV4dENoYXJGb3JtYXQ6OkRvdExpbmU7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgcmVzdWx0LnN0cmlrZU91dCA9IGNlbGwuYXR0cnMuc3RyaWtlOwoKICAgICAgICByZXR1cm4gcmVzdWx0OwogICAgfQoKICAgIC8vIENhbGxiYWNrcyBmcm9tIHZ0ZXJtCiAgICB2b2lkIGludmFsaWRhdGUoVlRlcm1SZWN0IHJlY3QpCiAgICB7CiAgICAgICAgaWYgKCFtX2FsdHNjcmVlbikgewogICAgICAgICAgICByZWN0LnN0YXJ0X3JvdyArPSBtX3Njcm9sbGJhY2stPnNpemUoKTsKICAgICAgICAgICAgcmVjdC5lbmRfcm93ICs9IG1fc2Nyb2xsYmFjay0+c2l6ZSgpOwogICAgICAgIH0KCiAgICAgICAgZW1pdCBxLT5pbnZhbGlkYXRl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AgICAge2ZyYWdtZW50LnN0ciwgZnJhZ21lbnQubGVufSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYWdtZW50LmluaXRpYWwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFnbWVudC5maW5hbCk7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gMTsKICAgIH0KCiAgICBpbnQgc2V0VGVybWluYWxQcm9wZXJ0aWVzKFZUZXJtUHJvcCBwcm9wLCBWVGVybVZhbHVlICp2YWwpCiAgICB7CiAgICAgICAgc3dpdGNoIChwcm9wKSB7CiAgICAgICAgY2FzZSBWVEVSTV9QUk9QX0NVUlNPUlZJU0lCTEU6IHsKICAgICAgICAgICAgQ3Vyc29yIG9sZCA9IHEtPmN1cnNvcigpOwogICAgICAgICAgICBtX2N1cnNvci52aXNpYmxlID0gdmFsLT5ib29sZWFuOwogICAgICAgICAgICBxLT5jdXJzb3JDaGFuZ2VkKG9sZCwgcS0+Y3Vyc29yKCkpOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgY2FzZSBWVEVSTV9QUk9QX0NVUlNPUkJMSU5LOiB7CiAgICAgICAgICAgIEN1cnNvciBvbGQgPSBxLT5jdXJzb3IoKTsKICAgICAgICAgICAgbV9jdXJzb3IuYmxpbmsgPSB2YWwtPmJvb2xlYW47CiAgICAgICAgICAgIGVtaXQgcS0+Y3Vyc29yQ2hhbmdlZChvbGQsIHEtPmN1cnNvcigpKTsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgfQogICAgICAgIGNhc2UgVlRFUk1fUFJPUF9DVVJTT1JTSEFQRTogewogICAgICAgICAgICBDdXJzb3Igb2xkID0gcS0+Y3Vyc29yKCk7CiAgICAgICAgICAgIG1fY3Vyc29yLnNoYXBlID0gKEN1cnNvcjo6U2hhcGUpIHZhbC0+bnVtYmVyOwogICAgICAgICAgICBlbWl0IHEtPmN1cnNvckNoYW5nZWQob2xkLCBxLT5jdXJzb3IoKSk7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICBjYXNlIFZURVJNX1BST1BfSUNPTk5BTUU6CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgVlRFUk1fUFJPUF9USVRMRToKICAgICAgICAgICAgaWYgKG1fc3VyZmFjZUludGVncmF0aW9uKQogICAgICAgICAgICAgICAgbV9zdXJmYWNlSW50ZWdyYXRpb24tPm9uVGl0bGUoUVN0cmluZzo6ZnJvbVV0ZjgodmFsLT5zdHJpbmcuc3RyLCB2YWwtPnN0cmluZy5sZW4pKTsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSBWVEVSTV9QUk9QX0FMVFNDUkVFTjoKICAgICAgICAgICAgbV9hbHRzY3JlZW4gPSB2YWwtPmJvb2xlYW47CiAgICAgICAgICAgIGVtaXQgcS0+YWx0c2NyZWVuQ2hhbmdlZChtX2FsdHNjcmVlbik7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgVlRFUk1fUFJPUF9NT1VTRToKICAgICAgICAgICAgcUNEZWJ1Zyhsb2cpIDw8ICJJZ25vcmluZyBWVEVSTV9QUk9QX01PVVNFIiA8PCB2YWwtPm51bWJlcjsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSBWVEVSTV9QUk9QX1JFVkVSU0U6CiAgICAgICAgICAgIHFDRGVidWcobG9nKSA8PCAiSWdub3JpbmcgVlRFUk1fUFJPUF9SRVZFUlNFIiA8PCB2YWwtPmJvb2xlYW47CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgVlRFUk1fTl9QUk9QUzoKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgfQogICAgICAgIHJldHVybiAxOwogICAgfQogICAgaW50IG1vdmVjdXJzb3IoVlRlcm1Qb3MgcG9zLCBWVGVybVBvcyBvbGRwb3MsIGludCB2aXNpYmxlKQogICAgewogICAgICAgIFFfVU5VU0VEKG9s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mcgcyA9IFFTdHJpbmc6OmZyb21VY3M0KGNlbGwtPmNoYXJzLCA2KS5ub3JtYWxpemVkKFFTdHJpbmc6Ok5vcm1hbGl6YXRpb25Gb3JtX0MpOwogICAgY29uc3QgUUxpc3Q8dWludD4gdWNzNCA9IHMudG9VY3M0KCk7CiAgICByZXR1cm4gc3RkOjp1MzJzdHJpbmcodWNzNC5iZWdpbigpLCB1Y3M0LmVuZCgpKS5mcm9udCgpOwp9CgpUZXJtaW5hbENlbGwgVGVybWluYWxTdXJmYWNlOjpmZXRjaENlbGwoaW50IHgsIGludCB5KSBjb25zdAp7CiAgICBzdGF0aWMgVGVybWluYWxDZWxsIGVtcHR5Q2VsbHsxLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7fSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29sb3JJbmRleDo6Rm9yZWdyb3VuZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbG9ySW5kZXg6OkJhY2tncm91bmQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRVGV4dENoYXJGb3JtYXQ6Ok5vVW5kZXJsaW5lLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2V9OwoKICAgIGlmICh5IDwgMCB8fCB5ID49IGZ1bGxTaXplKCkuaGVpZ2h0KCkgfHwgeCA+PSBmdWxsU2l6ZSgpLndpZHRoKCkpIHsKICAgICAgICBxQ1dhcm5pbmcobG9nKSA8PCAiSW52YWxpZCBQYXJhbWV0ZXIgZm9yIGZldGNoQ2VsbDoiIDw8IHggPDwgeSA8PCAiZnVsbFNpemU6IiA8PCBmdWxsU2l6ZSgpOwogICAgICAgIHJldHVybiBlbXB0eUNlbGw7CiAgICB9CgogICAgY29uc3QgVlRlcm1TY3JlZW5DZWxs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cmF0b3IoaXRlcmF0b3JBdChwb3MpKTsKfQoKc3RkOjpyZXZlcnNlX2l0ZXJhdG9yPENlbGxJdGVyYXRvcj4gVGVybWluYWxTdXJmYWNlOjpySXRlcmF0b3JBdChpbnQgcG9zKSBjb25zdAp7CiAgICByZXR1cm4gc3RkOjptYWtlX3JldmVyc2VfaXRlcmF0b3IoaXRlcmF0b3JBdChwb3MpKTsKfQoKfSAvLyBuYW1lc3BhY2UgVGVybWluYWxTb2x1dGlvbgo=\a\n" + +read -p " ⎆ Press enter to continue " -n1 -s +echo +echo From ea14ada43bcd943ea5722c57003ae3cee1a7c1a6 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 3 Aug 2023 08:25:40 +0200 Subject: [PATCH 0596/1777] Terminal: Fix handling big chunks of OSC data ShellIntegration previously ignored the initial and final flags of onOsc. Change-Id: Ifa9594fba654cf543c117835fc182d4642dc70e4 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/terminal/shellintegration.cpp | 11 ++++++++--- src/plugins/terminal/shellintegration.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/terminal/shellintegration.cpp b/src/plugins/terminal/shellintegration.cpp index c0cad7f3dd2..8cd6acd7443 100644 --- a/src/plugins/terminal/shellintegration.cpp +++ b/src/plugins/terminal/shellintegration.cpp @@ -79,10 +79,15 @@ bool ShellIntegration::canIntegrate(const Utils::CommandLine &cmdLine) void ShellIntegration::onOsc(int cmd, std::string_view str, bool initial, bool final) { - Q_UNUSED(initial); - Q_UNUSED(final); + if (initial) + m_oscBuffer.clear(); - QString d = QString::fromLocal8Bit(str); + m_oscBuffer.append(str); + + if (!final) + return; + + QString d = QString::fromLocal8Bit(m_oscBuffer); const auto [command, data] = Utils::splitAtFirst(d, ';'); if (cmd == 1337) { diff --git a/src/plugins/terminal/shellintegration.h b/src/plugins/terminal/shellintegration.h index 22cf4e79a34..4f1215fad94 100644 --- a/src/plugins/terminal/shellintegration.h +++ b/src/plugins/terminal/shellintegration.h @@ -34,6 +34,7 @@ signals: private: QTemporaryDir m_tempDir; + QByteArray m_oscBuffer; }; } // namespace Terminal From 2e7286017926ca680428a4d9892655ef54c3ca13 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 6 Jul 2023 12:23:25 +0200 Subject: [PATCH 0597/1777] Editor: avoid FontSettings copies Change-Id: I1ffd9aa21a38404bdf5e2f402b61ce57a023e83d Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/fossil/fossilcommitwidget.cpp | 2 +- src/plugins/texteditor/highlighter_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/fossil/fossilcommitwidget.cpp b/src/plugins/fossil/fossilcommitwidget.cpp index 72fba5ef86f..c8cec3d9585 100644 --- a/src/plugins/fossil/fossilcommitwidget.cpp +++ b/src/plugins/fossil/fossilcommitwidget.cpp @@ -30,7 +30,7 @@ namespace Internal { // Retrieve the comment char format from the text editor. static QTextCharFormat commentFormat() { - const TextEditor::FontSettings settings = TextEditor::TextEditorSettings::instance()->fontSettings(); + const TextEditor::FontSettings &settings = TextEditor::TextEditorSettings::instance()->fontSettings(); return settings.toTextCharFormat(TextEditor::C_COMMENT); } diff --git a/src/plugins/texteditor/highlighter_test.cpp b/src/plugins/texteditor/highlighter_test.cpp index 89b5196a864..f38e6a4f854 100644 --- a/src/plugins/texteditor/highlighter_test.cpp +++ b/src/plugins/texteditor/highlighter_test.cpp @@ -49,7 +49,7 @@ using FormatRanges = QList<QTextLayout::FormatRange>; QTextCharFormat toFormat(const TextStyle &style) { - const static FontSettings fontSettings = TextEditorSettings::fontSettings(); + const static FontSettings &fontSettings = TextEditorSettings::fontSettings(); auto format = fontSettings.toTextCharFormat(style); if (style == C_FUNCTION) format.setFontWeight(QFont::Bold); // is explicitly set by the ksyntax format definition From f63c4857b868424eb6b46cdbac4e28f59cddf147 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Tue, 1 Aug 2023 16:11:44 +0200 Subject: [PATCH 0598/1777] ClangFormat: Update script for generating clangformatchecks Updated for clang-format-16 Task-number: QTCREATORBUG-29434 Change-Id: Ib7fe12c19a6e3616760c146b623b150fb1df2c22 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- scripts/generateClangFormatChecksLayout.py | 52 +++++++++++----------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/scripts/generateClangFormatChecksLayout.py b/scripts/generateClangFormatChecksLayout.py index 03f8c7830d7..db28ddd6ec7 100755 --- a/scripts/generateClangFormatChecksLayout.py +++ b/scripts/generateClangFormatChecksLayout.py @@ -70,8 +70,6 @@ def full_source_content(source_code, layout_code): #include <QPushButton> #include <QWidget> -using namespace Utils; - using namespace ClangFormat; ClangFormatChecks::ClangFormatChecks(QWidget *parent) @@ -105,8 +103,8 @@ def combobox_source(name, values, offset): def combobox_source_bool(name, offset): return combobox_source(name, ["Default", "true", "false"], offset) -def combobox_layout(name, offset): - layout = " new QLabel(\"" + offset + name + "\"), m_" + name + ", br,\n" +def combobox_layout(name, field_name, offset): + layout = " new QLabel(\"" + offset + field_name + "\"), m_" + name + ", br,\n" return layout # String UI @@ -121,11 +119,10 @@ def string_source(name, offset): source += " m_" + name + "->setObjectName(\"" + name + "\");\n" source += " m_set" + name + " = new QPushButton(\"Set\", this);\n\n" source += " m_set" + name + "->setObjectName(\"set" + name + "\");\n" -# source += "m_" + name + "->setObjectName(\"" + offset + name + "\");\n\n" return source -def string_layout(name, offset): - layout = " new QLabel(\"" + offset + name + "\"), Row {m_" + name + ", m_set" + name + "}, br,\n" +def string_layout(name, field_name, offset): + layout = " new QLabel(\"" + offset + field_name + "\"), Row {m_" + name + ", m_set" + name + "}, br,\n" return layout # Vector UI @@ -144,8 +141,8 @@ def vector_source(name, offset): # source += "m_" + name + "->setObjectName(\"" + offset + name + "\");\n\n" return source -def vector_layout(name, offset): - layout = " new QLabel(\"" + offset + name + "\"), Row {m_" + name + ", m_set" + name + "}, br,\n" +def vector_layout(name, field_name, offset): + layout = " new QLabel(\"" + offset + field_name + "\"), Row {m_" + name + ", m_set" + name + "}, br,\n" return layout # Struct Layout @@ -160,7 +157,7 @@ def in_list(list, type): return element; return -def create_private_variables(variables, enums, structs, offset = ""): +def create_private_variables(variables, enums, structs, offset = "", parent_name = ""): header = "" source = "" layout = "" @@ -169,7 +166,7 @@ def create_private_variables(variables, enums, structs, offset = ""): if offset == "": header += combobox_header("BasedOnStyle") source += combobox_source("BasedOnStyle", ["LLVM", "Google", "Chromium", "Mozilla", "WebKit", "Microsoft", "GNU"], offset) - layout += combobox_layout("BasedOnStyle", offset) + layout += combobox_layout("BasedOnStyle", "BasedOnStyle", offset) for variable in variables: if "doxygen" in variable.keys(): @@ -177,31 +174,32 @@ def create_private_variables(variables, enums, structs, offset = ""): continue; type = variable["type"] - name = variable["name"] + field_name = variable["name"] + variable_name = parent_name + variable["name"] enum = in_list(enums, type) struct = in_list(structs, type) if enum: - header += combobox_header(name) - source += combobox_source(name, [value["name"].split("_")[1] for value in enum["values"]], offset) - layout += combobox_layout(name, offset) + header += combobox_header(variable_name) + source += combobox_source(variable_name, [value["name"].split("_")[1] for value in enum["values"]], offset) + layout += combobox_layout(variable_name, field_name, offset) elif struct: - layout += struct_layout(name, offset) - header_tmp, source_tmp, layout_tmp = create_private_variables(struct["properties"]["public"], enums, structs, " ") + layout += struct_layout(variable_name, offset) + header_tmp, source_tmp, layout_tmp = create_private_variables(struct["properties"]["public"], enums, structs, " ", variable_name) header += header_tmp source += source_tmp layout += layout_tmp elif "std::string" == type or "unsigned" == type or "int" == type: - header += string_header(name) - source += string_source(name, offset) - layout += string_layout(name, offset) - elif "std::vector<std::string >" == type: - header += vector_header(name) - source += vector_source(name, offset) - layout += vector_layout(name, offset) + header += string_header(variable_name) + source += string_source(variable_name, offset) + layout += string_layout(variable_name, field_name, offset) + elif "std::vector<std::string>" == type: + header += vector_header(variable_name) + source += vector_source(variable_name, offset) + layout += vector_layout(variable_name, field_name, offset) elif "bool" == type: - header += combobox_header(name) - source += combobox_source_bool(name, offset) - layout += combobox_layout(name, offset); + header += combobox_header(variable_name) + source += combobox_source_bool(variable_name, offset) + layout += combobox_layout(variable_name, field_name, offset); return header, source, layout From 0d3e66a5b80989af48d6118af0f6d32c98e1d15a Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Wed, 2 Aug 2023 16:00:49 +0200 Subject: [PATCH 0599/1777] ClangFormat: Regenerate clangformatchecks - Regenerated clangformatchecks for clang-format-16 - Updated clangformatconfigwidget for using new clangformatchecks Fixes: QTCREATORBUG-29434 Change-Id: If308942b6fbe4cc2568acda6d421139175ac081a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/clangformat/clangformatchecks.cpp | 663 +++++++++++------- src/plugins/clangformat/clangformatchecks.h | 149 ++-- .../clangformat/clangformatconfigwidget.cpp | 171 ++--- 3 files changed, 565 insertions(+), 418 deletions(-) diff --git a/src/plugins/clangformat/clangformatchecks.cpp b/src/plugins/clangformat/clangformatchecks.cpp index 6027e600d70..4cb200871c9 100644 --- a/src/plugins/clangformat/clangformatchecks.cpp +++ b/src/plugins/clangformat/clangformatchecks.cpp @@ -41,21 +41,85 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_AlignArrayOfStructures->addItems({"Left","Right","None",}); m_AlignArrayOfStructures->setObjectName("AlignArrayOfStructures"); - m_AlignConsecutiveMacros = new QComboBox(this); - m_AlignConsecutiveMacros->addItems({"None","Consecutive","AcrossEmptyLines","AcrossComments","AcrossEmptyLinesAndComments",}); - m_AlignConsecutiveMacros->setObjectName("AlignConsecutiveMacros"); + m_AlignConsecutiveMacrosEnabled = new QComboBox(this); + m_AlignConsecutiveMacrosEnabled->addItems({"Default","true","false",}); + m_AlignConsecutiveMacrosEnabled->setObjectName("AlignConsecutiveMacrosEnabled"); - m_AlignConsecutiveAssignments = new QComboBox(this); - m_AlignConsecutiveAssignments->addItems({"None","Consecutive","AcrossEmptyLines","AcrossComments","AcrossEmptyLinesAndComments",}); - m_AlignConsecutiveAssignments->setObjectName("AlignConsecutiveAssignments"); + m_AlignConsecutiveMacrosAcrossEmptyLines = new QComboBox(this); + m_AlignConsecutiveMacrosAcrossEmptyLines->addItems({"Default","true","false",}); + m_AlignConsecutiveMacrosAcrossEmptyLines->setObjectName("AlignConsecutiveMacrosAcrossEmptyLines"); - m_AlignConsecutiveBitFields = new QComboBox(this); - m_AlignConsecutiveBitFields->addItems({"None","Consecutive","AcrossEmptyLines","AcrossComments","AcrossEmptyLinesAndComments",}); - m_AlignConsecutiveBitFields->setObjectName("AlignConsecutiveBitFields"); + m_AlignConsecutiveMacrosAcrossComments = new QComboBox(this); + m_AlignConsecutiveMacrosAcrossComments->addItems({"Default","true","false",}); + m_AlignConsecutiveMacrosAcrossComments->setObjectName("AlignConsecutiveMacrosAcrossComments"); - m_AlignConsecutiveDeclarations = new QComboBox(this); - m_AlignConsecutiveDeclarations->addItems({"None","Consecutive","AcrossEmptyLines","AcrossComments","AcrossEmptyLinesAndComments",}); - m_AlignConsecutiveDeclarations->setObjectName("AlignConsecutiveDeclarations"); + m_AlignConsecutiveMacrosAlignCompound = new QComboBox(this); + m_AlignConsecutiveMacrosAlignCompound->addItems({"Default","true","false",}); + m_AlignConsecutiveMacrosAlignCompound->setObjectName("AlignConsecutiveMacrosAlignCompound"); + + m_AlignConsecutiveMacrosPadOperators = new QComboBox(this); + m_AlignConsecutiveMacrosPadOperators->addItems({"Default","true","false",}); + m_AlignConsecutiveMacrosPadOperators->setObjectName("AlignConsecutiveMacrosPadOperators"); + + m_AlignConsecutiveAssignmentsEnabled = new QComboBox(this); + m_AlignConsecutiveAssignmentsEnabled->addItems({"Default","true","false",}); + m_AlignConsecutiveAssignmentsEnabled->setObjectName("AlignConsecutiveAssignmentsEnabled"); + + m_AlignConsecutiveAssignmentsAcrossEmptyLines = new QComboBox(this); + m_AlignConsecutiveAssignmentsAcrossEmptyLines->addItems({"Default","true","false",}); + m_AlignConsecutiveAssignmentsAcrossEmptyLines->setObjectName("AlignConsecutiveAssignmentsAcrossEmptyLines"); + + m_AlignConsecutiveAssignmentsAcrossComments = new QComboBox(this); + m_AlignConsecutiveAssignmentsAcrossComments->addItems({"Default","true","false",}); + m_AlignConsecutiveAssignmentsAcrossComments->setObjectName("AlignConsecutiveAssignmentsAcrossComments"); + + m_AlignConsecutiveAssignmentsAlignCompound = new QComboBox(this); + m_AlignConsecutiveAssignmentsAlignCompound->addItems({"Default","true","false",}); + m_AlignConsecutiveAssignmentsAlignCompound->setObjectName("AlignConsecutiveAssignmentsAlignCompound"); + + m_AlignConsecutiveAssignmentsPadOperators = new QComboBox(this); + m_AlignConsecutiveAssignmentsPadOperators->addItems({"Default","true","false",}); + m_AlignConsecutiveAssignmentsPadOperators->setObjectName("AlignConsecutiveAssignmentsPadOperators"); + + m_AlignConsecutiveBitFieldsEnabled = new QComboBox(this); + m_AlignConsecutiveBitFieldsEnabled->addItems({"Default","true","false",}); + m_AlignConsecutiveBitFieldsEnabled->setObjectName("AlignConsecutiveBitFieldsEnabled"); + + m_AlignConsecutiveBitFieldsAcrossEmptyLines = new QComboBox(this); + m_AlignConsecutiveBitFieldsAcrossEmptyLines->addItems({"Default","true","false",}); + m_AlignConsecutiveBitFieldsAcrossEmptyLines->setObjectName("AlignConsecutiveBitFieldsAcrossEmptyLines"); + + m_AlignConsecutiveBitFieldsAcrossComments = new QComboBox(this); + m_AlignConsecutiveBitFieldsAcrossComments->addItems({"Default","true","false",}); + m_AlignConsecutiveBitFieldsAcrossComments->setObjectName("AlignConsecutiveBitFieldsAcrossComments"); + + m_AlignConsecutiveBitFieldsAlignCompound = new QComboBox(this); + m_AlignConsecutiveBitFieldsAlignCompound->addItems({"Default","true","false",}); + m_AlignConsecutiveBitFieldsAlignCompound->setObjectName("AlignConsecutiveBitFieldsAlignCompound"); + + m_AlignConsecutiveBitFieldsPadOperators = new QComboBox(this); + m_AlignConsecutiveBitFieldsPadOperators->addItems({"Default","true","false",}); + m_AlignConsecutiveBitFieldsPadOperators->setObjectName("AlignConsecutiveBitFieldsPadOperators"); + + m_AlignConsecutiveDeclarationsEnabled = new QComboBox(this); + m_AlignConsecutiveDeclarationsEnabled->addItems({"Default","true","false",}); + m_AlignConsecutiveDeclarationsEnabled->setObjectName("AlignConsecutiveDeclarationsEnabled"); + + m_AlignConsecutiveDeclarationsAcrossEmptyLines = new QComboBox(this); + m_AlignConsecutiveDeclarationsAcrossEmptyLines->addItems({"Default","true","false",}); + m_AlignConsecutiveDeclarationsAcrossEmptyLines->setObjectName("AlignConsecutiveDeclarationsAcrossEmptyLines"); + + m_AlignConsecutiveDeclarationsAcrossComments = new QComboBox(this); + m_AlignConsecutiveDeclarationsAcrossComments->addItems({"Default","true","false",}); + m_AlignConsecutiveDeclarationsAcrossComments->setObjectName("AlignConsecutiveDeclarationsAcrossComments"); + + m_AlignConsecutiveDeclarationsAlignCompound = new QComboBox(this); + m_AlignConsecutiveDeclarationsAlignCompound->addItems({"Default","true","false",}); + m_AlignConsecutiveDeclarationsAlignCompound->setObjectName("AlignConsecutiveDeclarationsAlignCompound"); + + m_AlignConsecutiveDeclarationsPadOperators = new QComboBox(this); + m_AlignConsecutiveDeclarationsPadOperators->addItems({"Default","true","false",}); + m_AlignConsecutiveDeclarationsPadOperators->setObjectName("AlignConsecutiveDeclarationsPadOperators"); m_AlignEscapedNewlines = new QComboBox(this); m_AlignEscapedNewlines->addItems({"DontAlign","Left","Right",}); @@ -65,22 +129,19 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_AlignOperands->addItems({"DontAlign","Align","AlignAfterOperator",}); m_AlignOperands->setObjectName("AlignOperands"); - m_AlignTrailingComments = new QComboBox(this); - m_AlignTrailingComments->addItems({"Default","true","false",}); - m_AlignTrailingComments->setObjectName("AlignTrailingComments"); + m_AlignTrailingCommentsKind = new QComboBox(this); + m_AlignTrailingCommentsKind->addItems({"Leave","Always","Never",}); + m_AlignTrailingCommentsKind->setObjectName("AlignTrailingCommentsKind"); + m_AlignTrailingCommentsOverEmptyLines = new QLineEdit(this); + m_AlignTrailingCommentsOverEmptyLines->setObjectName("AlignTrailingCommentsOverEmptyLines"); + m_setAlignTrailingCommentsOverEmptyLines = new QPushButton("Set", this); + + m_setAlignTrailingCommentsOverEmptyLines->setObjectName("setAlignTrailingCommentsOverEmptyLines"); m_AllowAllArgumentsOnNextLine = new QComboBox(this); m_AllowAllArgumentsOnNextLine->addItems({"Default","true","false",}); m_AllowAllArgumentsOnNextLine->setObjectName("AllowAllArgumentsOnNextLine"); - m_AllowAllParametersOfDeclarationOnNextLine = new QComboBox(this); - m_AllowAllParametersOfDeclarationOnNextLine->addItems({"Default","true","false",}); - m_AllowAllParametersOfDeclarationOnNextLine->setObjectName("AllowAllParametersOfDeclarationOnNextLine"); - - m_AllowShortEnumsOnASingleLine = new QComboBox(this); - m_AllowShortEnumsOnASingleLine->addItems({"Default","true","false",}); - m_AllowShortEnumsOnASingleLine->setObjectName("AllowShortEnumsOnASingleLine"); - m_AllowShortBlocksOnASingleLine = new QComboBox(this); m_AllowShortBlocksOnASingleLine->addItems({"Never","Empty","Always",}); m_AllowShortBlocksOnASingleLine->setObjectName("AllowShortBlocksOnASingleLine"); @@ -89,6 +150,10 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_AllowShortCaseLabelsOnASingleLine->addItems({"Default","true","false",}); m_AllowShortCaseLabelsOnASingleLine->setObjectName("AllowShortCaseLabelsOnASingleLine"); + m_AllowShortEnumsOnASingleLine = new QComboBox(this); + m_AllowShortEnumsOnASingleLine->addItems({"Default","true","false",}); + m_AllowShortEnumsOnASingleLine->setObjectName("AllowShortEnumsOnASingleLine"); + m_AllowShortFunctionsOnASingleLine = new QComboBox(this); m_AllowShortFunctionsOnASingleLine->addItems({"None","InlineOnly","Empty","Inline","All",}); m_AllowShortFunctionsOnASingleLine->setObjectName("AllowShortFunctionsOnASingleLine"); @@ -127,14 +192,94 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_BinPackArguments->addItems({"Default","true","false",}); m_BinPackArguments->setObjectName("BinPackArguments"); - m_InsertTrailingCommas = new QComboBox(this); - m_InsertTrailingCommas->addItems({"None","Wrapped",}); - m_InsertTrailingCommas->setObjectName("InsertTrailingCommas"); - m_BinPackParameters = new QComboBox(this); m_BinPackParameters->addItems({"Default","true","false",}); m_BinPackParameters->setObjectName("BinPackParameters"); + m_BitFieldColonSpacing = new QComboBox(this); + m_BitFieldColonSpacing->addItems({"Both","None","Before","After",}); + m_BitFieldColonSpacing->setObjectName("BitFieldColonSpacing"); + + m_BraceWrappingAfterCaseLabel = new QComboBox(this); + m_BraceWrappingAfterCaseLabel->addItems({"Default","true","false",}); + m_BraceWrappingAfterCaseLabel->setObjectName("BraceWrappingAfterCaseLabel"); + + m_BraceWrappingAfterClass = new QComboBox(this); + m_BraceWrappingAfterClass->addItems({"Default","true","false",}); + m_BraceWrappingAfterClass->setObjectName("BraceWrappingAfterClass"); + + m_BraceWrappingAfterControlStatement = new QComboBox(this); + m_BraceWrappingAfterControlStatement->addItems({"Never","MultiLine","Always",}); + m_BraceWrappingAfterControlStatement->setObjectName("BraceWrappingAfterControlStatement"); + + m_BraceWrappingAfterEnum = new QComboBox(this); + m_BraceWrappingAfterEnum->addItems({"Default","true","false",}); + m_BraceWrappingAfterEnum->setObjectName("BraceWrappingAfterEnum"); + + m_BraceWrappingAfterFunction = new QComboBox(this); + m_BraceWrappingAfterFunction->addItems({"Default","true","false",}); + m_BraceWrappingAfterFunction->setObjectName("BraceWrappingAfterFunction"); + + m_BraceWrappingAfterNamespace = new QComboBox(this); + m_BraceWrappingAfterNamespace->addItems({"Default","true","false",}); + m_BraceWrappingAfterNamespace->setObjectName("BraceWrappingAfterNamespace"); + + m_BraceWrappingAfterObjCDeclaration = new QComboBox(this); + m_BraceWrappingAfterObjCDeclaration->addItems({"Default","true","false",}); + m_BraceWrappingAfterObjCDeclaration->setObjectName("BraceWrappingAfterObjCDeclaration"); + + m_BraceWrappingAfterStruct = new QComboBox(this); + m_BraceWrappingAfterStruct->addItems({"Default","true","false",}); + m_BraceWrappingAfterStruct->setObjectName("BraceWrappingAfterStruct"); + + m_BraceWrappingAfterUnion = new QComboBox(this); + m_BraceWrappingAfterUnion->addItems({"Default","true","false",}); + m_BraceWrappingAfterUnion->setObjectName("BraceWrappingAfterUnion"); + + m_BraceWrappingAfterExternBlock = new QComboBox(this); + m_BraceWrappingAfterExternBlock->addItems({"Default","true","false",}); + m_BraceWrappingAfterExternBlock->setObjectName("BraceWrappingAfterExternBlock"); + + m_BraceWrappingBeforeCatch = new QComboBox(this); + m_BraceWrappingBeforeCatch->addItems({"Default","true","false",}); + m_BraceWrappingBeforeCatch->setObjectName("BraceWrappingBeforeCatch"); + + m_BraceWrappingBeforeElse = new QComboBox(this); + m_BraceWrappingBeforeElse->addItems({"Default","true","false",}); + m_BraceWrappingBeforeElse->setObjectName("BraceWrappingBeforeElse"); + + m_BraceWrappingBeforeLambdaBody = new QComboBox(this); + m_BraceWrappingBeforeLambdaBody->addItems({"Default","true","false",}); + m_BraceWrappingBeforeLambdaBody->setObjectName("BraceWrappingBeforeLambdaBody"); + + m_BraceWrappingBeforeWhile = new QComboBox(this); + m_BraceWrappingBeforeWhile->addItems({"Default","true","false",}); + m_BraceWrappingBeforeWhile->setObjectName("BraceWrappingBeforeWhile"); + + m_BraceWrappingIndentBraces = new QComboBox(this); + m_BraceWrappingIndentBraces->addItems({"Default","true","false",}); + m_BraceWrappingIndentBraces->setObjectName("BraceWrappingIndentBraces"); + + m_BraceWrappingSplitEmptyFunction = new QComboBox(this); + m_BraceWrappingSplitEmptyFunction->addItems({"Default","true","false",}); + m_BraceWrappingSplitEmptyFunction->setObjectName("BraceWrappingSplitEmptyFunction"); + + m_BraceWrappingSplitEmptyRecord = new QComboBox(this); + m_BraceWrappingSplitEmptyRecord->addItems({"Default","true","false",}); + m_BraceWrappingSplitEmptyRecord->setObjectName("BraceWrappingSplitEmptyRecord"); + + m_BraceWrappingSplitEmptyNamespace = new QComboBox(this); + m_BraceWrappingSplitEmptyNamespace->addItems({"Default","true","false",}); + m_BraceWrappingSplitEmptyNamespace->setObjectName("BraceWrappingSplitEmptyNamespace"); + + m_BreakAfterAttributes = new QComboBox(this); + m_BreakAfterAttributes->addItems({"Always","Leave","Never",}); + m_BreakAfterAttributes->setObjectName("BreakAfterAttributes"); + + m_BreakArrays = new QComboBox(this); + m_BreakArrays->addItems({"Default","true","false",}); + m_BreakArrays->setObjectName("BreakArrays"); + m_BreakBeforeBinaryOperators = new QComboBox(this); m_BreakBeforeBinaryOperators->addItems({"None","NonAssignment","All",}); m_BreakBeforeBinaryOperators->setObjectName("BreakBeforeBinaryOperators"); @@ -143,82 +288,14 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_BreakBeforeBraces->addItems({"Attach","Linux","Mozilla","Stroustrup","Allman","Whitesmiths","GNU","WebKit","Custom",}); m_BreakBeforeBraces->setObjectName("BreakBeforeBraces"); - m_AfterCaseLabel = new QComboBox(this); - m_AfterCaseLabel->addItems({"Default","true","false",}); - m_AfterCaseLabel->setObjectName("AfterCaseLabel"); - - m_AfterClass = new QComboBox(this); - m_AfterClass->addItems({"Default","true","false",}); - m_AfterClass->setObjectName("AfterClass"); - - m_AfterControlStatement = new QComboBox(this); - m_AfterControlStatement->addItems({"Never","MultiLine","Always",}); - m_AfterControlStatement->setObjectName("AfterControlStatement"); - - m_AfterEnum = new QComboBox(this); - m_AfterEnum->addItems({"Default","true","false",}); - m_AfterEnum->setObjectName("AfterEnum"); - - m_AfterFunction = new QComboBox(this); - m_AfterFunction->addItems({"Default","true","false",}); - m_AfterFunction->setObjectName("AfterFunction"); - - m_AfterNamespace = new QComboBox(this); - m_AfterNamespace->addItems({"Default","true","false",}); - m_AfterNamespace->setObjectName("AfterNamespace"); - - m_AfterObjCDeclaration = new QComboBox(this); - m_AfterObjCDeclaration->addItems({"Default","true","false",}); - m_AfterObjCDeclaration->setObjectName("AfterObjCDeclaration"); - - m_AfterStruct = new QComboBox(this); - m_AfterStruct->addItems({"Default","true","false",}); - m_AfterStruct->setObjectName("AfterStruct"); - - m_AfterUnion = new QComboBox(this); - m_AfterUnion->addItems({"Default","true","false",}); - m_AfterUnion->setObjectName("AfterUnion"); - - m_AfterExternBlock = new QComboBox(this); - m_AfterExternBlock->addItems({"Default","true","false",}); - m_AfterExternBlock->setObjectName("AfterExternBlock"); - - m_BeforeCatch = new QComboBox(this); - m_BeforeCatch->addItems({"Default","true","false",}); - m_BeforeCatch->setObjectName("BeforeCatch"); - - m_BeforeElse = new QComboBox(this); - m_BeforeElse->addItems({"Default","true","false",}); - m_BeforeElse->setObjectName("BeforeElse"); - - m_BeforeLambdaBody = new QComboBox(this); - m_BeforeLambdaBody->addItems({"Default","true","false",}); - m_BeforeLambdaBody->setObjectName("BeforeLambdaBody"); - - m_BeforeWhile = new QComboBox(this); - m_BeforeWhile->addItems({"Default","true","false",}); - m_BeforeWhile->setObjectName("BeforeWhile"); - - m_IndentBraces = new QComboBox(this); - m_IndentBraces->addItems({"Default","true","false",}); - m_IndentBraces->setObjectName("IndentBraces"); - - m_SplitEmptyFunction = new QComboBox(this); - m_SplitEmptyFunction->addItems({"Default","true","false",}); - m_SplitEmptyFunction->setObjectName("SplitEmptyFunction"); - - m_SplitEmptyRecord = new QComboBox(this); - m_SplitEmptyRecord->addItems({"Default","true","false",}); - m_SplitEmptyRecord->setObjectName("SplitEmptyRecord"); - - m_SplitEmptyNamespace = new QComboBox(this); - m_SplitEmptyNamespace->addItems({"Default","true","false",}); - m_SplitEmptyNamespace->setObjectName("SplitEmptyNamespace"); - m_BreakBeforeConceptDeclarations = new QComboBox(this); - m_BreakBeforeConceptDeclarations->addItems({"Default","true","false",}); + m_BreakBeforeConceptDeclarations->addItems({"Never","Allowed","Always",}); m_BreakBeforeConceptDeclarations->setObjectName("BreakBeforeConceptDeclarations"); + m_BreakBeforeInlineASMColon = new QComboBox(this); + m_BreakBeforeInlineASMColon->addItems({"Never","OnlyMultiline","Always",}); + m_BreakBeforeInlineASMColon->setObjectName("BreakBeforeInlineASMColon"); + m_BreakBeforeTernaryOperators = new QComboBox(this); m_BreakBeforeTernaryOperators->addItems({"Default","true","false",}); m_BreakBeforeTernaryOperators->setObjectName("BreakBeforeTernaryOperators"); @@ -245,16 +322,6 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_setCommentPragmas = new QPushButton("Set", this); m_setCommentPragmas->setObjectName("setCommentPragmas"); - m_QualifierAlignment = new QComboBox(this); - m_QualifierAlignment->addItems({"Leave","Left","Right","Custom",}); - m_QualifierAlignment->setObjectName("QualifierAlignment"); - - m_QualifierOrder = new QPlainTextEdit(this); - m_QualifierOrder->setObjectName("QualifierOrder"); - m_QualifierOrder->setFixedHeight(100); - m_setQualifierOrder = new QPushButton("Set", this); - - m_setQualifierOrder->setObjectName("setQualifierOrder"); m_BreakInheritanceList = new QComboBox(this); m_BreakInheritanceList->addItems({"BeforeColon","BeforeComma","AfterColon","AfterComma",}); m_BreakInheritanceList->setObjectName("BreakInheritanceList"); @@ -263,11 +330,6 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_CompactNamespaces->addItems({"Default","true","false",}); m_CompactNamespaces->setObjectName("CompactNamespaces"); - m_ConstructorInitializerIndentWidth = new QLineEdit(this); - m_ConstructorInitializerIndentWidth->setObjectName("ConstructorInitializerIndentWidth"); - m_setConstructorInitializerIndentWidth = new QPushButton("Set", this); - - m_setConstructorInitializerIndentWidth->setObjectName("setConstructorInitializerIndentWidth"); m_ContinuationIndentWidth = new QLineEdit(this); m_ContinuationIndentWidth->setObjectName("ContinuationIndentWidth"); m_setContinuationIndentWidth = new QPushButton("Set", this); @@ -277,14 +339,6 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_Cpp11BracedListStyle->addItems({"Default","true","false",}); m_Cpp11BracedListStyle->setObjectName("Cpp11BracedListStyle"); - m_DeriveLineEnding = new QComboBox(this); - m_DeriveLineEnding->addItems({"Default","true","false",}); - m_DeriveLineEnding->setObjectName("DeriveLineEnding"); - - m_DerivePointerAlignment = new QComboBox(this); - m_DerivePointerAlignment->addItems({"Default","true","false",}); - m_DerivePointerAlignment->setObjectName("DerivePointerAlignment"); - m_DisableFormat = new QComboBox(this); m_DisableFormat->addItems({"Default","true","false",}); m_DisableFormat->setObjectName("DisableFormat"); @@ -301,10 +355,6 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_ExperimentalAutoDetectBinPacking->addItems({"Default","true","false",}); m_ExperimentalAutoDetectBinPacking->setObjectName("ExperimentalAutoDetectBinPacking"); - m_PackConstructorInitializers = new QComboBox(this); - m_PackConstructorInitializers->addItems({"Never","BinPack","CurrentLine","NextLine",}); - m_PackConstructorInitializers->setObjectName("PackConstructorInitializers"); - m_FixNamespaceComments = new QComboBox(this); m_FixNamespaceComments->addItems({"Default","true","false",}); m_FixNamespaceComments->setObjectName("FixNamespaceComments"); @@ -321,57 +371,33 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_setIfMacros = new QPushButton("Set", this); m_setIfMacros->setObjectName("setIfMacros"); - m_TypenameMacros = new QPlainTextEdit(this); - m_TypenameMacros->setObjectName("TypenameMacros"); - m_TypenameMacros->setFixedHeight(100); - m_setTypenameMacros = new QPushButton("Set", this); - - m_setTypenameMacros->setObjectName("setTypenameMacros"); - m_StatementMacros = new QPlainTextEdit(this); - m_StatementMacros->setObjectName("StatementMacros"); - m_StatementMacros->setFixedHeight(100); - m_setStatementMacros = new QPushButton("Set", this); - - m_setStatementMacros->setObjectName("setStatementMacros"); - m_NamespaceMacros = new QPlainTextEdit(this); - m_NamespaceMacros->setObjectName("NamespaceMacros"); - m_NamespaceMacros->setFixedHeight(100); - m_setNamespaceMacros = new QPushButton("Set", this); - - m_setNamespaceMacros->setObjectName("setNamespaceMacros"); - m_WhitespaceSensitiveMacros = new QPlainTextEdit(this); - m_WhitespaceSensitiveMacros->setObjectName("WhitespaceSensitiveMacros"); - m_WhitespaceSensitiveMacros->setFixedHeight(100); - m_setWhitespaceSensitiveMacros = new QPushButton("Set", this); - - m_setWhitespaceSensitiveMacros->setObjectName("setWhitespaceSensitiveMacros"); m_IndentAccessModifiers = new QComboBox(this); m_IndentAccessModifiers->addItems({"Default","true","false",}); m_IndentAccessModifiers->setObjectName("IndentAccessModifiers"); - m_IndentCaseLabels = new QComboBox(this); - m_IndentCaseLabels->addItems({"Default","true","false",}); - m_IndentCaseLabels->setObjectName("IndentCaseLabels"); - m_IndentCaseBlocks = new QComboBox(this); m_IndentCaseBlocks->addItems({"Default","true","false",}); m_IndentCaseBlocks->setObjectName("IndentCaseBlocks"); + m_IndentCaseLabels = new QComboBox(this); + m_IndentCaseLabels->addItems({"Default","true","false",}); + m_IndentCaseLabels->setObjectName("IndentCaseLabels"); + m_IndentGotoLabels = new QComboBox(this); m_IndentGotoLabels->addItems({"Default","true","false",}); m_IndentGotoLabels->setObjectName("IndentGotoLabels"); - m_IndentPPDirectives = new QComboBox(this); - m_IndentPPDirectives->addItems({"None","AfterHash","BeforeHash",}); - m_IndentPPDirectives->setObjectName("IndentPPDirectives"); - m_IndentExternBlock = new QComboBox(this); m_IndentExternBlock->addItems({"AfterExternBlock","NoIndent","Indent",}); m_IndentExternBlock->setObjectName("IndentExternBlock"); - m_IndentRequires = new QComboBox(this); - m_IndentRequires->addItems({"Default","true","false",}); - m_IndentRequires->setObjectName("IndentRequires"); + m_IndentPPDirectives = new QComboBox(this); + m_IndentPPDirectives->addItems({"None","AfterHash","BeforeHash",}); + m_IndentPPDirectives->setObjectName("IndentPPDirectives"); + + m_IndentRequiresClause = new QComboBox(this); + m_IndentRequiresClause->addItems({"Default","true","false",}); + m_IndentRequiresClause->setObjectName("IndentRequiresClause"); m_IndentWidth = new QLineEdit(this); m_IndentWidth->setObjectName("IndentWidth"); @@ -382,6 +408,18 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_IndentWrappedFunctionNames->addItems({"Default","true","false",}); m_IndentWrappedFunctionNames->setObjectName("IndentWrappedFunctionNames"); + m_InsertBraces = new QComboBox(this); + m_InsertBraces->addItems({"Default","true","false",}); + m_InsertBraces->setObjectName("InsertBraces"); + + m_InsertNewlineAtEOF = new QComboBox(this); + m_InsertNewlineAtEOF->addItems({"Default","true","false",}); + m_InsertNewlineAtEOF->setObjectName("InsertNewlineAtEOF"); + + m_InsertTrailingCommas = new QComboBox(this); + m_InsertTrailingCommas->addItems({"None","Wrapped",}); + m_InsertTrailingCommas->setObjectName("InsertTrailingCommas"); + m_JavaImportGroups = new QPlainTextEdit(this); m_JavaImportGroups->setObjectName("JavaImportGroups"); m_JavaImportGroups->setFixedHeight(100); @@ -400,14 +438,18 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_KeepEmptyLinesAtTheStartOfBlocks->addItems({"Default","true","false",}); m_KeepEmptyLinesAtTheStartOfBlocks->setObjectName("KeepEmptyLinesAtTheStartOfBlocks"); - m_Language = new QComboBox(this); - m_Language->addItems({"None","Cpp","CSharp","Java","JavaScript","Json","ObjC","Proto","TableGen","TextProto",}); - m_Language->setObjectName("Language"); - m_LambdaBodyIndentation = new QComboBox(this); m_LambdaBodyIndentation->addItems({"Signature","OuterScope",}); m_LambdaBodyIndentation->setObjectName("LambdaBodyIndentation"); + m_Language = new QComboBox(this); + m_Language->addItems({"None","Cpp","CSharp","Java","JavaScript","Json","ObjC","Proto","TableGen","TextProto","Verilog",}); + m_Language->setObjectName("Language"); + + m_LineEnding = new QComboBox(this); + m_LineEnding->addItems({"LF","CRLF","DeriveLF","DeriveCRLF",}); + m_LineEnding->setObjectName("LineEnding"); + m_MacroBlockBegin = new QLineEdit(this); m_MacroBlockBegin->setObjectName("MacroBlockBegin"); m_setMacroBlockBegin = new QPushButton("Set", this); @@ -427,6 +469,12 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_NamespaceIndentation->addItems({"None","Inner","All",}); m_NamespaceIndentation->setObjectName("NamespaceIndentation"); + m_NamespaceMacros = new QPlainTextEdit(this); + m_NamespaceMacros->setObjectName("NamespaceMacros"); + m_NamespaceMacros->setFixedHeight(100); + m_setNamespaceMacros = new QPushButton("Set", this); + + m_setNamespaceMacros->setObjectName("setNamespaceMacros"); m_ObjCBinPackProtocolList = new QComboBox(this); m_ObjCBinPackProtocolList->addItems({"Auto","Always","Never",}); m_ObjCBinPackProtocolList->setObjectName("ObjCBinPackProtocolList"); @@ -436,18 +484,22 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_setObjCBlockIndentWidth = new QPushButton("Set", this); m_setObjCBlockIndentWidth->setObjectName("setObjCBlockIndentWidth"); - m_ObjCSpaceAfterProperty = new QComboBox(this); - m_ObjCSpaceAfterProperty->addItems({"Default","true","false",}); - m_ObjCSpaceAfterProperty->setObjectName("ObjCSpaceAfterProperty"); - m_ObjCBreakBeforeNestedBlockParam = new QComboBox(this); m_ObjCBreakBeforeNestedBlockParam->addItems({"Default","true","false",}); m_ObjCBreakBeforeNestedBlockParam->setObjectName("ObjCBreakBeforeNestedBlockParam"); + m_ObjCSpaceAfterProperty = new QComboBox(this); + m_ObjCSpaceAfterProperty->addItems({"Default","true","false",}); + m_ObjCSpaceAfterProperty->setObjectName("ObjCSpaceAfterProperty"); + m_ObjCSpaceBeforeProtocolList = new QComboBox(this); m_ObjCSpaceBeforeProtocolList->addItems({"Default","true","false",}); m_ObjCSpaceBeforeProtocolList->setObjectName("ObjCSpaceBeforeProtocolList"); + m_PackConstructorInitializers = new QComboBox(this); + m_PackConstructorInitializers->addItems({"Never","BinPack","CurrentLine","NextLine",}); + m_PackConstructorInitializers->setObjectName("PackConstructorInitializers"); + m_PenaltyBreakAssignment = new QLineEdit(this); m_PenaltyBreakAssignment->setObjectName("PenaltyBreakAssignment"); m_setPenaltyBreakAssignment = new QPushButton("Set", this); @@ -488,16 +540,16 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_setPenaltyExcessCharacter = new QPushButton("Set", this); m_setPenaltyExcessCharacter->setObjectName("setPenaltyExcessCharacter"); - m_PenaltyReturnTypeOnItsOwnLine = new QLineEdit(this); - m_PenaltyReturnTypeOnItsOwnLine->setObjectName("PenaltyReturnTypeOnItsOwnLine"); - m_setPenaltyReturnTypeOnItsOwnLine = new QPushButton("Set", this); - - m_setPenaltyReturnTypeOnItsOwnLine->setObjectName("setPenaltyReturnTypeOnItsOwnLine"); m_PenaltyIndentedWhitespace = new QLineEdit(this); m_PenaltyIndentedWhitespace->setObjectName("PenaltyIndentedWhitespace"); m_setPenaltyIndentedWhitespace = new QPushButton("Set", this); m_setPenaltyIndentedWhitespace->setObjectName("setPenaltyIndentedWhitespace"); + m_PenaltyReturnTypeOnItsOwnLine = new QLineEdit(this); + m_PenaltyReturnTypeOnItsOwnLine->setObjectName("PenaltyReturnTypeOnItsOwnLine"); + m_setPenaltyReturnTypeOnItsOwnLine = new QPushButton("Set", this); + + m_setPenaltyReturnTypeOnItsOwnLine->setObjectName("setPenaltyReturnTypeOnItsOwnLine"); m_PointerAlignment = new QComboBox(this); m_PointerAlignment->addItems({"Left","Right","Middle",}); m_PointerAlignment->setObjectName("PointerAlignment"); @@ -507,6 +559,16 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_setPPIndentWidth = new QPushButton("Set", this); m_setPPIndentWidth->setObjectName("setPPIndentWidth"); + m_QualifierAlignment = new QComboBox(this); + m_QualifierAlignment->addItems({"Leave","Left","Right","Custom",}); + m_QualifierAlignment->setObjectName("QualifierAlignment"); + + m_QualifierOrder = new QPlainTextEdit(this); + m_QualifierOrder->setObjectName("QualifierOrder"); + m_QualifierOrder->setFixedHeight(100); + m_setQualifierOrder = new QPushButton("Set", this); + + m_setQualifierOrder->setObjectName("setQualifierOrder"); m_ReferenceAlignment = new QComboBox(this); m_ReferenceAlignment->addItems({"Pointer","Left","Right","Middle",}); m_ReferenceAlignment->setObjectName("ReferenceAlignment"); @@ -519,6 +581,18 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_RemoveBracesLLVM->addItems({"Default","true","false",}); m_RemoveBracesLLVM->setObjectName("RemoveBracesLLVM"); + m_RemoveSemicolon = new QComboBox(this); + m_RemoveSemicolon->addItems({"Default","true","false",}); + m_RemoveSemicolon->setObjectName("RemoveSemicolon"); + + m_RequiresClausePosition = new QComboBox(this); + m_RequiresClausePosition->addItems({"OwnLine","WithPreceding","WithFollowing","SingleLine",}); + m_RequiresClausePosition->setObjectName("RequiresClausePosition"); + + m_RequiresExpressionIndentation = new QComboBox(this); + m_RequiresExpressionIndentation->addItems({"OuterScope","Keyword",}); + m_RequiresExpressionIndentation->setObjectName("RequiresExpressionIndentation"); + m_SeparateDefinitionBlocks = new QComboBox(this); m_SeparateDefinitionBlocks->addItems({"Leave","Always","Never",}); m_SeparateDefinitionBlocks->setObjectName("SeparateDefinitionBlocks"); @@ -537,7 +611,7 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_SortJavaStaticImport->setObjectName("SortJavaStaticImport"); m_SortUsingDeclarations = new QComboBox(this); - m_SortUsingDeclarations->addItems({"Default","true","false",}); + m_SortUsingDeclarations->addItems({"Never","Lexicographic","LexicographicNumeric",}); m_SortUsingDeclarations->setObjectName("SortUsingDeclarations"); m_SpaceAfterCStyleCast = new QComboBox(this); @@ -580,33 +654,45 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_SpaceBeforeParens->addItems({"Never","ControlStatements","ControlStatementsExceptControlMacros","NonEmptyParentheses","Always","Custom",}); m_SpaceBeforeParens->setObjectName("SpaceBeforeParens"); - m_AfterControlStatements = new QComboBox(this); - m_AfterControlStatements->addItems({"Default","true","false",}); - m_AfterControlStatements->setObjectName("AfterControlStatements"); + m_SpaceBeforeParensOptionsAfterControlStatements = new QComboBox(this); + m_SpaceBeforeParensOptionsAfterControlStatements->addItems({"Default","true","false",}); + m_SpaceBeforeParensOptionsAfterControlStatements->setObjectName("SpaceBeforeParensOptionsAfterControlStatements"); - m_AfterForeachMacros = new QComboBox(this); - m_AfterForeachMacros->addItems({"Default","true","false",}); - m_AfterForeachMacros->setObjectName("AfterForeachMacros"); + m_SpaceBeforeParensOptionsAfterForeachMacros = new QComboBox(this); + m_SpaceBeforeParensOptionsAfterForeachMacros->addItems({"Default","true","false",}); + m_SpaceBeforeParensOptionsAfterForeachMacros->setObjectName("SpaceBeforeParensOptionsAfterForeachMacros"); - m_AfterFunctionDeclarationName = new QComboBox(this); - m_AfterFunctionDeclarationName->addItems({"Default","true","false",}); - m_AfterFunctionDeclarationName->setObjectName("AfterFunctionDeclarationName"); + m_SpaceBeforeParensOptionsAfterFunctionDeclarationName = new QComboBox(this); + m_SpaceBeforeParensOptionsAfterFunctionDeclarationName->addItems({"Default","true","false",}); + m_SpaceBeforeParensOptionsAfterFunctionDeclarationName->setObjectName("SpaceBeforeParensOptionsAfterFunctionDeclarationName"); - m_AfterFunctionDefinitionName = new QComboBox(this); - m_AfterFunctionDefinitionName->addItems({"Default","true","false",}); - m_AfterFunctionDefinitionName->setObjectName("AfterFunctionDefinitionName"); + m_SpaceBeforeParensOptionsAfterFunctionDefinitionName = new QComboBox(this); + m_SpaceBeforeParensOptionsAfterFunctionDefinitionName->addItems({"Default","true","false",}); + m_SpaceBeforeParensOptionsAfterFunctionDefinitionName->setObjectName("SpaceBeforeParensOptionsAfterFunctionDefinitionName"); - m_AfterIfMacros = new QComboBox(this); - m_AfterIfMacros->addItems({"Default","true","false",}); - m_AfterIfMacros->setObjectName("AfterIfMacros"); + m_SpaceBeforeParensOptionsAfterIfMacros = new QComboBox(this); + m_SpaceBeforeParensOptionsAfterIfMacros->addItems({"Default","true","false",}); + m_SpaceBeforeParensOptionsAfterIfMacros->setObjectName("SpaceBeforeParensOptionsAfterIfMacros"); - m_AfterOverloadedOperator = new QComboBox(this); - m_AfterOverloadedOperator->addItems({"Default","true","false",}); - m_AfterOverloadedOperator->setObjectName("AfterOverloadedOperator"); + m_SpaceBeforeParensOptionsAfterOverloadedOperator = new QComboBox(this); + m_SpaceBeforeParensOptionsAfterOverloadedOperator->addItems({"Default","true","false",}); + m_SpaceBeforeParensOptionsAfterOverloadedOperator->setObjectName("SpaceBeforeParensOptionsAfterOverloadedOperator"); - m_BeforeNonEmptyParentheses = new QComboBox(this); - m_BeforeNonEmptyParentheses->addItems({"Default","true","false",}); - m_BeforeNonEmptyParentheses->setObjectName("BeforeNonEmptyParentheses"); + m_SpaceBeforeParensOptionsAfterRequiresInClause = new QComboBox(this); + m_SpaceBeforeParensOptionsAfterRequiresInClause->addItems({"Default","true","false",}); + m_SpaceBeforeParensOptionsAfterRequiresInClause->setObjectName("SpaceBeforeParensOptionsAfterRequiresInClause"); + + m_SpaceBeforeParensOptionsAfterRequiresInExpression = new QComboBox(this); + m_SpaceBeforeParensOptionsAfterRequiresInExpression->addItems({"Default","true","false",}); + m_SpaceBeforeParensOptionsAfterRequiresInExpression->setObjectName("SpaceBeforeParensOptionsAfterRequiresInExpression"); + + m_SpaceBeforeParensOptionsBeforeNonEmptyParentheses = new QComboBox(this); + m_SpaceBeforeParensOptionsBeforeNonEmptyParentheses->addItems({"Default","true","false",}); + m_SpaceBeforeParensOptionsBeforeNonEmptyParentheses->setObjectName("SpaceBeforeParensOptionsBeforeNonEmptyParentheses"); + + m_SpaceBeforeSquareBrackets = new QComboBox(this); + m_SpaceBeforeSquareBrackets->addItems({"Default","true","false",}); + m_SpaceBeforeSquareBrackets->setObjectName("SpaceBeforeSquareBrackets"); m_SpaceBeforeRangeBasedForLoopColon = new QComboBox(this); m_SpaceBeforeRangeBasedForLoopColon->addItems({"Default","true","false",}); @@ -641,16 +727,16 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_SpacesInCStyleCastParentheses->addItems({"Default","true","false",}); m_SpacesInCStyleCastParentheses->setObjectName("SpacesInCStyleCastParentheses"); - m_Minimum = new QLineEdit(this); - m_Minimum->setObjectName("Minimum"); - m_setMinimum = new QPushButton("Set", this); + m_SpacesInLineCommentPrefixMinimum = new QLineEdit(this); + m_SpacesInLineCommentPrefixMinimum->setObjectName("SpacesInLineCommentPrefixMinimum"); + m_setSpacesInLineCommentPrefixMinimum = new QPushButton("Set", this); - m_setMinimum->setObjectName("setMinimum"); - m_Maximum = new QLineEdit(this); - m_Maximum->setObjectName("Maximum"); - m_setMaximum = new QPushButton("Set", this); + m_setSpacesInLineCommentPrefixMinimum->setObjectName("setSpacesInLineCommentPrefixMinimum"); + m_SpacesInLineCommentPrefixMaximum = new QLineEdit(this); + m_SpacesInLineCommentPrefixMaximum->setObjectName("SpacesInLineCommentPrefixMaximum"); + m_setSpacesInLineCommentPrefixMaximum = new QPushButton("Set", this); - m_setMaximum->setObjectName("setMaximum"); + m_setSpacesInLineCommentPrefixMaximum->setObjectName("setSpacesInLineCommentPrefixMaximum"); m_SpacesInParentheses = new QComboBox(this); m_SpacesInParentheses->addItems({"Default","true","false",}); m_SpacesInParentheses->setObjectName("SpacesInParentheses"); @@ -659,14 +745,6 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_SpacesInSquareBrackets->addItems({"Default","true","false",}); m_SpacesInSquareBrackets->setObjectName("SpacesInSquareBrackets"); - m_SpaceBeforeSquareBrackets = new QComboBox(this); - m_SpaceBeforeSquareBrackets->addItems({"Default","true","false",}); - m_SpaceBeforeSquareBrackets->setObjectName("SpaceBeforeSquareBrackets"); - - m_BitFieldColonSpacing = new QComboBox(this); - m_BitFieldColonSpacing->addItems({"Both","None","Before","After",}); - m_BitFieldColonSpacing->setObjectName("BitFieldColonSpacing"); - m_Standard = new QComboBox(this); m_Standard->addItems({"Cpp03","Cpp11","Cpp14","Cpp17","Cpp20","Latest","Auto",}); m_Standard->setObjectName("Standard"); @@ -677,19 +755,33 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_setStatementAttributeLikeMacros = new QPushButton("Set", this); m_setStatementAttributeLikeMacros->setObjectName("setStatementAttributeLikeMacros"); + m_StatementMacros = new QPlainTextEdit(this); + m_StatementMacros->setObjectName("StatementMacros"); + m_StatementMacros->setFixedHeight(100); + m_setStatementMacros = new QPushButton("Set", this); + + m_setStatementMacros->setObjectName("setStatementMacros"); m_TabWidth = new QLineEdit(this); m_TabWidth->setObjectName("TabWidth"); m_setTabWidth = new QPushButton("Set", this); m_setTabWidth->setObjectName("setTabWidth"); - m_UseCRLF = new QComboBox(this); - m_UseCRLF->addItems({"Default","true","false",}); - m_UseCRLF->setObjectName("UseCRLF"); + m_TypenameMacros = new QPlainTextEdit(this); + m_TypenameMacros->setObjectName("TypenameMacros"); + m_TypenameMacros->setFixedHeight(100); + m_setTypenameMacros = new QPushButton("Set", this); + m_setTypenameMacros->setObjectName("setTypenameMacros"); m_UseTab = new QComboBox(this); m_UseTab->addItems({"Never","ForIndentation","ForContinuationAndIndentation","AlignWithSpaces","Always",}); m_UseTab->setObjectName("UseTab"); + m_WhitespaceSensitiveMacros = new QPlainTextEdit(this); + m_WhitespaceSensitiveMacros->setObjectName("WhitespaceSensitiveMacros"); + m_WhitespaceSensitiveMacros->setFixedHeight(100); + m_setWhitespaceSensitiveMacros = new QPushButton("Set", this); + + m_setWhitespaceSensitiveMacros->setObjectName("setWhitespaceSensitiveMacros"); using namespace Layouting; @@ -699,18 +791,39 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) new QLabel("AccessModifierOffset"), Row {m_AccessModifierOffset, m_setAccessModifierOffset}, br, new QLabel("AlignAfterOpenBracket"), m_AlignAfterOpenBracket, br, new QLabel("AlignArrayOfStructures"), m_AlignArrayOfStructures, br, - new QLabel("AlignConsecutiveMacros"), m_AlignConsecutiveMacros, br, - new QLabel("AlignConsecutiveAssignments"), m_AlignConsecutiveAssignments, br, - new QLabel("AlignConsecutiveBitFields"), m_AlignConsecutiveBitFields, br, - new QLabel("AlignConsecutiveDeclarations"), m_AlignConsecutiveDeclarations, br, + new QLabel("AlignConsecutiveMacros"), br, + new QLabel(" Enabled"), m_AlignConsecutiveMacrosEnabled, br, + new QLabel(" AcrossEmptyLines"), m_AlignConsecutiveMacrosAcrossEmptyLines, br, + new QLabel(" AcrossComments"), m_AlignConsecutiveMacrosAcrossComments, br, + new QLabel(" AlignCompound"), m_AlignConsecutiveMacrosAlignCompound, br, + new QLabel(" PadOperators"), m_AlignConsecutiveMacrosPadOperators, br, + new QLabel("AlignConsecutiveAssignments"), br, + new QLabel(" Enabled"), m_AlignConsecutiveAssignmentsEnabled, br, + new QLabel(" AcrossEmptyLines"), m_AlignConsecutiveAssignmentsAcrossEmptyLines, br, + new QLabel(" AcrossComments"), m_AlignConsecutiveAssignmentsAcrossComments, br, + new QLabel(" AlignCompound"), m_AlignConsecutiveAssignmentsAlignCompound, br, + new QLabel(" PadOperators"), m_AlignConsecutiveAssignmentsPadOperators, br, + new QLabel("AlignConsecutiveBitFields"), br, + new QLabel(" Enabled"), m_AlignConsecutiveBitFieldsEnabled, br, + new QLabel(" AcrossEmptyLines"), m_AlignConsecutiveBitFieldsAcrossEmptyLines, br, + new QLabel(" AcrossComments"), m_AlignConsecutiveBitFieldsAcrossComments, br, + new QLabel(" AlignCompound"), m_AlignConsecutiveBitFieldsAlignCompound, br, + new QLabel(" PadOperators"), m_AlignConsecutiveBitFieldsPadOperators, br, + new QLabel("AlignConsecutiveDeclarations"), br, + new QLabel(" Enabled"), m_AlignConsecutiveDeclarationsEnabled, br, + new QLabel(" AcrossEmptyLines"), m_AlignConsecutiveDeclarationsAcrossEmptyLines, br, + new QLabel(" AcrossComments"), m_AlignConsecutiveDeclarationsAcrossComments, br, + new QLabel(" AlignCompound"), m_AlignConsecutiveDeclarationsAlignCompound, br, + new QLabel(" PadOperators"), m_AlignConsecutiveDeclarationsPadOperators, br, new QLabel("AlignEscapedNewlines"), m_AlignEscapedNewlines, br, new QLabel("AlignOperands"), m_AlignOperands, br, - new QLabel("AlignTrailingComments"), m_AlignTrailingComments, br, + new QLabel("AlignTrailingComments"), br, + new QLabel(" Kind"), m_AlignTrailingCommentsKind, br, + new QLabel(" OverEmptyLines"), Row {m_AlignTrailingCommentsOverEmptyLines, m_setAlignTrailingCommentsOverEmptyLines}, br, new QLabel("AllowAllArgumentsOnNextLine"), m_AllowAllArgumentsOnNextLine, br, - new QLabel("AllowAllParametersOfDeclarationOnNextLine"), m_AllowAllParametersOfDeclarationOnNextLine, br, - new QLabel("AllowShortEnumsOnASingleLine"), m_AllowShortEnumsOnASingleLine, br, new QLabel("AllowShortBlocksOnASingleLine"), m_AllowShortBlocksOnASingleLine, br, new QLabel("AllowShortCaseLabelsOnASingleLine"), m_AllowShortCaseLabelsOnASingleLine, br, + new QLabel("AllowShortEnumsOnASingleLine"), m_AllowShortEnumsOnASingleLine, br, new QLabel("AllowShortFunctionsOnASingleLine"), m_AllowShortFunctionsOnASingleLine, br, new QLabel("AllowShortIfStatementsOnASingleLine"), m_AllowShortIfStatementsOnASingleLine, br, new QLabel("AllowShortLambdasOnASingleLine"), m_AllowShortLambdasOnASingleLine, br, @@ -720,81 +833,81 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) new QLabel("AlwaysBreakTemplateDeclarations"), m_AlwaysBreakTemplateDeclarations, br, new QLabel("AttributeMacros"), Row {m_AttributeMacros, m_setAttributeMacros}, br, new QLabel("BinPackArguments"), m_BinPackArguments, br, - new QLabel("InsertTrailingCommas"), m_InsertTrailingCommas, br, new QLabel("BinPackParameters"), m_BinPackParameters, br, + new QLabel("BitFieldColonSpacing"), m_BitFieldColonSpacing, br, + new QLabel("BraceWrapping"), br, + new QLabel(" AfterCaseLabel"), m_BraceWrappingAfterCaseLabel, br, + new QLabel(" AfterClass"), m_BraceWrappingAfterClass, br, + new QLabel(" AfterControlStatement"), m_BraceWrappingAfterControlStatement, br, + new QLabel(" AfterEnum"), m_BraceWrappingAfterEnum, br, + new QLabel(" AfterFunction"), m_BraceWrappingAfterFunction, br, + new QLabel(" AfterNamespace"), m_BraceWrappingAfterNamespace, br, + new QLabel(" AfterObjCDeclaration"), m_BraceWrappingAfterObjCDeclaration, br, + new QLabel(" AfterStruct"), m_BraceWrappingAfterStruct, br, + new QLabel(" AfterUnion"), m_BraceWrappingAfterUnion, br, + new QLabel(" AfterExternBlock"), m_BraceWrappingAfterExternBlock, br, + new QLabel(" BeforeCatch"), m_BraceWrappingBeforeCatch, br, + new QLabel(" BeforeElse"), m_BraceWrappingBeforeElse, br, + new QLabel(" BeforeLambdaBody"), m_BraceWrappingBeforeLambdaBody, br, + new QLabel(" BeforeWhile"), m_BraceWrappingBeforeWhile, br, + new QLabel(" IndentBraces"), m_BraceWrappingIndentBraces, br, + new QLabel(" SplitEmptyFunction"), m_BraceWrappingSplitEmptyFunction, br, + new QLabel(" SplitEmptyRecord"), m_BraceWrappingSplitEmptyRecord, br, + new QLabel(" SplitEmptyNamespace"), m_BraceWrappingSplitEmptyNamespace, br, + new QLabel("BreakAfterAttributes"), m_BreakAfterAttributes, br, + new QLabel("BreakArrays"), m_BreakArrays, br, new QLabel("BreakBeforeBinaryOperators"), m_BreakBeforeBinaryOperators, br, new QLabel("BreakBeforeBraces"), m_BreakBeforeBraces, br, - new QLabel("BraceWrapping"), br, - new QLabel(" AfterCaseLabel"), m_AfterCaseLabel, br, - new QLabel(" AfterClass"), m_AfterClass, br, - new QLabel(" AfterControlStatement"), m_AfterControlStatement, br, - new QLabel(" AfterEnum"), m_AfterEnum, br, - new QLabel(" AfterFunction"), m_AfterFunction, br, - new QLabel(" AfterNamespace"), m_AfterNamespace, br, - new QLabel(" AfterObjCDeclaration"), m_AfterObjCDeclaration, br, - new QLabel(" AfterStruct"), m_AfterStruct, br, - new QLabel(" AfterUnion"), m_AfterUnion, br, - new QLabel(" AfterExternBlock"), m_AfterExternBlock, br, - new QLabel(" BeforeCatch"), m_BeforeCatch, br, - new QLabel(" BeforeElse"), m_BeforeElse, br, - new QLabel(" BeforeLambdaBody"), m_BeforeLambdaBody, br, - new QLabel(" BeforeWhile"), m_BeforeWhile, br, - new QLabel(" IndentBraces"), m_IndentBraces, br, - new QLabel(" SplitEmptyFunction"), m_SplitEmptyFunction, br, - new QLabel(" SplitEmptyRecord"), m_SplitEmptyRecord, br, - new QLabel(" SplitEmptyNamespace"), m_SplitEmptyNamespace, br, new QLabel("BreakBeforeConceptDeclarations"), m_BreakBeforeConceptDeclarations, br, + new QLabel("BreakBeforeInlineASMColon"), m_BreakBeforeInlineASMColon, br, new QLabel("BreakBeforeTernaryOperators"), m_BreakBeforeTernaryOperators, br, new QLabel("BreakConstructorInitializers"), m_BreakConstructorInitializers, br, new QLabel("BreakAfterJavaFieldAnnotations"), m_BreakAfterJavaFieldAnnotations, br, new QLabel("BreakStringLiterals"), m_BreakStringLiterals, br, new QLabel("ColumnLimit"), Row {m_ColumnLimit, m_setColumnLimit}, br, new QLabel("CommentPragmas"), Row {m_CommentPragmas, m_setCommentPragmas}, br, - new QLabel("QualifierAlignment"), m_QualifierAlignment, br, - new QLabel("QualifierOrder"), Row {m_QualifierOrder, m_setQualifierOrder}, br, new QLabel("BreakInheritanceList"), m_BreakInheritanceList, br, new QLabel("CompactNamespaces"), m_CompactNamespaces, br, - new QLabel("ConstructorInitializerIndentWidth"), Row {m_ConstructorInitializerIndentWidth, m_setConstructorInitializerIndentWidth}, br, new QLabel("ContinuationIndentWidth"), Row {m_ContinuationIndentWidth, m_setContinuationIndentWidth}, br, new QLabel("Cpp11BracedListStyle"), m_Cpp11BracedListStyle, br, - new QLabel("DeriveLineEnding"), m_DeriveLineEnding, br, - new QLabel("DerivePointerAlignment"), m_DerivePointerAlignment, br, new QLabel("DisableFormat"), m_DisableFormat, br, new QLabel("EmptyLineAfterAccessModifier"), m_EmptyLineAfterAccessModifier, br, new QLabel("EmptyLineBeforeAccessModifier"), m_EmptyLineBeforeAccessModifier, br, new QLabel("ExperimentalAutoDetectBinPacking"), m_ExperimentalAutoDetectBinPacking, br, - new QLabel("PackConstructorInitializers"), m_PackConstructorInitializers, br, new QLabel("FixNamespaceComments"), m_FixNamespaceComments, br, new QLabel("ForEachMacros"), Row {m_ForEachMacros, m_setForEachMacros}, br, new QLabel("IfMacros"), Row {m_IfMacros, m_setIfMacros}, br, - new QLabel("TypenameMacros"), Row {m_TypenameMacros, m_setTypenameMacros}, br, - new QLabel("StatementMacros"), Row {m_StatementMacros, m_setStatementMacros}, br, - new QLabel("NamespaceMacros"), Row {m_NamespaceMacros, m_setNamespaceMacros}, br, - new QLabel("WhitespaceSensitiveMacros"), Row {m_WhitespaceSensitiveMacros, m_setWhitespaceSensitiveMacros}, br, new QLabel("IndentAccessModifiers"), m_IndentAccessModifiers, br, - new QLabel("IndentCaseLabels"), m_IndentCaseLabels, br, new QLabel("IndentCaseBlocks"), m_IndentCaseBlocks, br, + new QLabel("IndentCaseLabels"), m_IndentCaseLabels, br, new QLabel("IndentGotoLabels"), m_IndentGotoLabels, br, - new QLabel("IndentPPDirectives"), m_IndentPPDirectives, br, new QLabel("IndentExternBlock"), m_IndentExternBlock, br, - new QLabel("IndentRequires"), m_IndentRequires, br, + new QLabel("IndentPPDirectives"), m_IndentPPDirectives, br, + new QLabel("IndentRequiresClause"), m_IndentRequiresClause, br, new QLabel("IndentWidth"), Row {m_IndentWidth, m_setIndentWidth}, br, new QLabel("IndentWrappedFunctionNames"), m_IndentWrappedFunctionNames, br, + new QLabel("InsertBraces"), m_InsertBraces, br, + new QLabel("InsertNewlineAtEOF"), m_InsertNewlineAtEOF, br, + new QLabel("InsertTrailingCommas"), m_InsertTrailingCommas, br, + new QLabel("IntegerLiteralSeparator"), br, new QLabel("JavaImportGroups"), Row {m_JavaImportGroups, m_setJavaImportGroups}, br, new QLabel("JavaScriptQuotes"), m_JavaScriptQuotes, br, new QLabel("JavaScriptWrapImports"), m_JavaScriptWrapImports, br, new QLabel("KeepEmptyLinesAtTheStartOfBlocks"), m_KeepEmptyLinesAtTheStartOfBlocks, br, - new QLabel("Language"), m_Language, br, new QLabel("LambdaBodyIndentation"), m_LambdaBodyIndentation, br, + new QLabel("Language"), m_Language, br, + new QLabel("LineEnding"), m_LineEnding, br, new QLabel("MacroBlockBegin"), Row {m_MacroBlockBegin, m_setMacroBlockBegin}, br, new QLabel("MacroBlockEnd"), Row {m_MacroBlockEnd, m_setMacroBlockEnd}, br, new QLabel("MaxEmptyLinesToKeep"), Row {m_MaxEmptyLinesToKeep, m_setMaxEmptyLinesToKeep}, br, new QLabel("NamespaceIndentation"), m_NamespaceIndentation, br, + new QLabel("NamespaceMacros"), Row {m_NamespaceMacros, m_setNamespaceMacros}, br, new QLabel("ObjCBinPackProtocolList"), m_ObjCBinPackProtocolList, br, new QLabel("ObjCBlockIndentWidth"), Row {m_ObjCBlockIndentWidth, m_setObjCBlockIndentWidth}, br, - new QLabel("ObjCSpaceAfterProperty"), m_ObjCSpaceAfterProperty, br, new QLabel("ObjCBreakBeforeNestedBlockParam"), m_ObjCBreakBeforeNestedBlockParam, br, + new QLabel("ObjCSpaceAfterProperty"), m_ObjCSpaceAfterProperty, br, new QLabel("ObjCSpaceBeforeProtocolList"), m_ObjCSpaceBeforeProtocolList, br, + new QLabel("PackConstructorInitializers"), m_PackConstructorInitializers, br, new QLabel("PenaltyBreakAssignment"), Row {m_PenaltyBreakAssignment, m_setPenaltyBreakAssignment}, br, new QLabel("PenaltyBreakBeforeFirstCallParameter"), Row {m_PenaltyBreakBeforeFirstCallParameter, m_setPenaltyBreakBeforeFirstCallParameter}, br, new QLabel("PenaltyBreakComment"), Row {m_PenaltyBreakComment, m_setPenaltyBreakComment}, br, @@ -803,13 +916,18 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) new QLabel("PenaltyBreakString"), Row {m_PenaltyBreakString, m_setPenaltyBreakString}, br, new QLabel("PenaltyBreakTemplateDeclaration"), Row {m_PenaltyBreakTemplateDeclaration, m_setPenaltyBreakTemplateDeclaration}, br, new QLabel("PenaltyExcessCharacter"), Row {m_PenaltyExcessCharacter, m_setPenaltyExcessCharacter}, br, - new QLabel("PenaltyReturnTypeOnItsOwnLine"), Row {m_PenaltyReturnTypeOnItsOwnLine, m_setPenaltyReturnTypeOnItsOwnLine}, br, new QLabel("PenaltyIndentedWhitespace"), Row {m_PenaltyIndentedWhitespace, m_setPenaltyIndentedWhitespace}, br, + new QLabel("PenaltyReturnTypeOnItsOwnLine"), Row {m_PenaltyReturnTypeOnItsOwnLine, m_setPenaltyReturnTypeOnItsOwnLine}, br, new QLabel("PointerAlignment"), m_PointerAlignment, br, new QLabel("PPIndentWidth"), Row {m_PPIndentWidth, m_setPPIndentWidth}, br, + new QLabel("QualifierAlignment"), m_QualifierAlignment, br, + new QLabel("QualifierOrder"), Row {m_QualifierOrder, m_setQualifierOrder}, br, new QLabel("ReferenceAlignment"), m_ReferenceAlignment, br, new QLabel("ReflowComments"), m_ReflowComments, br, new QLabel("RemoveBracesLLVM"), m_RemoveBracesLLVM, br, + new QLabel("RemoveSemicolon"), m_RemoveSemicolon, br, + new QLabel("RequiresClausePosition"), m_RequiresClausePosition, br, + new QLabel("RequiresExpressionIndentation"), m_RequiresExpressionIndentation, br, new QLabel("SeparateDefinitionBlocks"), m_SeparateDefinitionBlocks, br, new QLabel("ShortNamespaceLines"), Row {m_ShortNamespaceLines, m_setShortNamespaceLines}, br, new QLabel("SortIncludes"), m_SortIncludes, br, @@ -826,13 +944,16 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) new QLabel("SpaceBeforeInheritanceColon"), m_SpaceBeforeInheritanceColon, br, new QLabel("SpaceBeforeParens"), m_SpaceBeforeParens, br, new QLabel("SpaceBeforeParensOptions"), br, - new QLabel(" AfterControlStatements"), m_AfterControlStatements, br, - new QLabel(" AfterForeachMacros"), m_AfterForeachMacros, br, - new QLabel(" AfterFunctionDeclarationName"), m_AfterFunctionDeclarationName, br, - new QLabel(" AfterFunctionDefinitionName"), m_AfterFunctionDefinitionName, br, - new QLabel(" AfterIfMacros"), m_AfterIfMacros, br, - new QLabel(" AfterOverloadedOperator"), m_AfterOverloadedOperator, br, - new QLabel(" BeforeNonEmptyParentheses"), m_BeforeNonEmptyParentheses, br, + new QLabel(" AfterControlStatements"), m_SpaceBeforeParensOptionsAfterControlStatements, br, + new QLabel(" AfterForeachMacros"), m_SpaceBeforeParensOptionsAfterForeachMacros, br, + new QLabel(" AfterFunctionDeclarationName"), m_SpaceBeforeParensOptionsAfterFunctionDeclarationName, br, + new QLabel(" AfterFunctionDefinitionName"), m_SpaceBeforeParensOptionsAfterFunctionDefinitionName, br, + new QLabel(" AfterIfMacros"), m_SpaceBeforeParensOptionsAfterIfMacros, br, + new QLabel(" AfterOverloadedOperator"), m_SpaceBeforeParensOptionsAfterOverloadedOperator, br, + new QLabel(" AfterRequiresInClause"), m_SpaceBeforeParensOptionsAfterRequiresInClause, br, + new QLabel(" AfterRequiresInExpression"), m_SpaceBeforeParensOptionsAfterRequiresInExpression, br, + new QLabel(" BeforeNonEmptyParentheses"), m_SpaceBeforeParensOptionsBeforeNonEmptyParentheses, br, + new QLabel("SpaceBeforeSquareBrackets"), m_SpaceBeforeSquareBrackets, br, new QLabel("SpaceBeforeRangeBasedForLoopColon"), m_SpaceBeforeRangeBasedForLoopColon, br, new QLabel("SpaceInEmptyBlock"), m_SpaceInEmptyBlock, br, new QLabel("SpaceInEmptyParentheses"), m_SpaceInEmptyParentheses, br, @@ -842,16 +963,16 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) new QLabel("SpacesInContainerLiterals"), m_SpacesInContainerLiterals, br, new QLabel("SpacesInCStyleCastParentheses"), m_SpacesInCStyleCastParentheses, br, new QLabel("SpacesInLineCommentPrefix"), br, - new QLabel(" Minimum"), Row {m_Minimum, m_setMinimum}, br, - new QLabel(" Maximum"), Row {m_Maximum, m_setMaximum}, br, + new QLabel(" Minimum"), Row {m_SpacesInLineCommentPrefixMinimum, m_setSpacesInLineCommentPrefixMinimum}, br, + new QLabel(" Maximum"), Row {m_SpacesInLineCommentPrefixMaximum, m_setSpacesInLineCommentPrefixMaximum}, br, new QLabel("SpacesInParentheses"), m_SpacesInParentheses, br, new QLabel("SpacesInSquareBrackets"), m_SpacesInSquareBrackets, br, - new QLabel("SpaceBeforeSquareBrackets"), m_SpaceBeforeSquareBrackets, br, - new QLabel("BitFieldColonSpacing"), m_BitFieldColonSpacing, br, new QLabel("Standard"), m_Standard, br, new QLabel("StatementAttributeLikeMacros"), Row {m_StatementAttributeLikeMacros, m_setStatementAttributeLikeMacros}, br, + new QLabel("StatementMacros"), Row {m_StatementMacros, m_setStatementMacros}, br, new QLabel("TabWidth"), Row {m_TabWidth, m_setTabWidth}, br, - new QLabel("UseCRLF"), m_UseCRLF, br, + new QLabel("TypenameMacros"), Row {m_TypenameMacros, m_setTypenameMacros}, br, new QLabel("UseTab"), m_UseTab, br, + new QLabel("WhitespaceSensitiveMacros"), Row {m_WhitespaceSensitiveMacros, m_setWhitespaceSensitiveMacros}, br, }.attachTo(this); } diff --git a/src/plugins/clangformat/clangformatchecks.h b/src/plugins/clangformat/clangformatchecks.h index a0ce073365e..1c72aac1bee 100644 --- a/src/plugins/clangformat/clangformatchecks.h +++ b/src/plugins/clangformat/clangformatchecks.h @@ -32,18 +32,35 @@ private: QPushButton *m_setAccessModifierOffset = nullptr; QComboBox *m_AlignAfterOpenBracket = nullptr; QComboBox *m_AlignArrayOfStructures = nullptr; - QComboBox *m_AlignConsecutiveMacros = nullptr; - QComboBox *m_AlignConsecutiveAssignments = nullptr; - QComboBox *m_AlignConsecutiveBitFields = nullptr; - QComboBox *m_AlignConsecutiveDeclarations = nullptr; + QComboBox *m_AlignConsecutiveMacrosEnabled = nullptr; + QComboBox *m_AlignConsecutiveMacrosAcrossEmptyLines = nullptr; + QComboBox *m_AlignConsecutiveMacrosAcrossComments = nullptr; + QComboBox *m_AlignConsecutiveMacrosAlignCompound = nullptr; + QComboBox *m_AlignConsecutiveMacrosPadOperators = nullptr; + QComboBox *m_AlignConsecutiveAssignmentsEnabled = nullptr; + QComboBox *m_AlignConsecutiveAssignmentsAcrossEmptyLines = nullptr; + QComboBox *m_AlignConsecutiveAssignmentsAcrossComments = nullptr; + QComboBox *m_AlignConsecutiveAssignmentsAlignCompound = nullptr; + QComboBox *m_AlignConsecutiveAssignmentsPadOperators = nullptr; + QComboBox *m_AlignConsecutiveBitFieldsEnabled = nullptr; + QComboBox *m_AlignConsecutiveBitFieldsAcrossEmptyLines = nullptr; + QComboBox *m_AlignConsecutiveBitFieldsAcrossComments = nullptr; + QComboBox *m_AlignConsecutiveBitFieldsAlignCompound = nullptr; + QComboBox *m_AlignConsecutiveBitFieldsPadOperators = nullptr; + QComboBox *m_AlignConsecutiveDeclarationsEnabled = nullptr; + QComboBox *m_AlignConsecutiveDeclarationsAcrossEmptyLines = nullptr; + QComboBox *m_AlignConsecutiveDeclarationsAcrossComments = nullptr; + QComboBox *m_AlignConsecutiveDeclarationsAlignCompound = nullptr; + QComboBox *m_AlignConsecutiveDeclarationsPadOperators = nullptr; QComboBox *m_AlignEscapedNewlines = nullptr; QComboBox *m_AlignOperands = nullptr; - QComboBox *m_AlignTrailingComments = nullptr; + QComboBox *m_AlignTrailingCommentsKind = nullptr; + QLineEdit *m_AlignTrailingCommentsOverEmptyLines = nullptr; + QPushButton *m_setAlignTrailingCommentsOverEmptyLines = nullptr; QComboBox *m_AllowAllArgumentsOnNextLine = nullptr; - QComboBox *m_AllowAllParametersOfDeclarationOnNextLine = nullptr; - QComboBox *m_AllowShortEnumsOnASingleLine = nullptr; QComboBox *m_AllowShortBlocksOnASingleLine = nullptr; QComboBox *m_AllowShortCaseLabelsOnASingleLine = nullptr; + QComboBox *m_AllowShortEnumsOnASingleLine = nullptr; QComboBox *m_AllowShortFunctionsOnASingleLine = nullptr; QComboBox *m_AllowShortIfStatementsOnASingleLine = nullptr; QComboBox *m_AllowShortLambdasOnASingleLine = nullptr; @@ -54,29 +71,32 @@ private: QPlainTextEdit *m_AttributeMacros = nullptr; QPushButton *m_setAttributeMacros = nullptr; QComboBox *m_BinPackArguments = nullptr; - QComboBox *m_InsertTrailingCommas = nullptr; QComboBox *m_BinPackParameters = nullptr; + QComboBox *m_BitFieldColonSpacing = nullptr; + QComboBox *m_BraceWrappingAfterCaseLabel = nullptr; + QComboBox *m_BraceWrappingAfterClass = nullptr; + QComboBox *m_BraceWrappingAfterControlStatement = nullptr; + QComboBox *m_BraceWrappingAfterEnum = nullptr; + QComboBox *m_BraceWrappingAfterFunction = nullptr; + QComboBox *m_BraceWrappingAfterNamespace = nullptr; + QComboBox *m_BraceWrappingAfterObjCDeclaration = nullptr; + QComboBox *m_BraceWrappingAfterStruct = nullptr; + QComboBox *m_BraceWrappingAfterUnion = nullptr; + QComboBox *m_BraceWrappingAfterExternBlock = nullptr; + QComboBox *m_BraceWrappingBeforeCatch = nullptr; + QComboBox *m_BraceWrappingBeforeElse = nullptr; + QComboBox *m_BraceWrappingBeforeLambdaBody = nullptr; + QComboBox *m_BraceWrappingBeforeWhile = nullptr; + QComboBox *m_BraceWrappingIndentBraces = nullptr; + QComboBox *m_BraceWrappingSplitEmptyFunction = nullptr; + QComboBox *m_BraceWrappingSplitEmptyRecord = nullptr; + QComboBox *m_BraceWrappingSplitEmptyNamespace = nullptr; + QComboBox *m_BreakAfterAttributes = nullptr; + QComboBox *m_BreakArrays = nullptr; QComboBox *m_BreakBeforeBinaryOperators = nullptr; QComboBox *m_BreakBeforeBraces = nullptr; - QComboBox *m_AfterCaseLabel = nullptr; - QComboBox *m_AfterClass = nullptr; - QComboBox *m_AfterControlStatement = nullptr; - QComboBox *m_AfterEnum = nullptr; - QComboBox *m_AfterFunction = nullptr; - QComboBox *m_AfterNamespace = nullptr; - QComboBox *m_AfterObjCDeclaration = nullptr; - QComboBox *m_AfterStruct = nullptr; - QComboBox *m_AfterUnion = nullptr; - QComboBox *m_AfterExternBlock = nullptr; - QComboBox *m_BeforeCatch = nullptr; - QComboBox *m_BeforeElse = nullptr; - QComboBox *m_BeforeLambdaBody = nullptr; - QComboBox *m_BeforeWhile = nullptr; - QComboBox *m_IndentBraces = nullptr; - QComboBox *m_SplitEmptyFunction = nullptr; - QComboBox *m_SplitEmptyRecord = nullptr; - QComboBox *m_SplitEmptyNamespace = nullptr; QComboBox *m_BreakBeforeConceptDeclarations = nullptr; + QComboBox *m_BreakBeforeInlineASMColon = nullptr; QComboBox *m_BreakBeforeTernaryOperators = nullptr; QComboBox *m_BreakConstructorInitializers = nullptr; QComboBox *m_BreakAfterJavaFieldAnnotations = nullptr; @@ -85,53 +105,41 @@ private: QPushButton *m_setColumnLimit = nullptr; QLineEdit *m_CommentPragmas = nullptr; QPushButton *m_setCommentPragmas = nullptr; - QComboBox *m_QualifierAlignment = nullptr; - QPlainTextEdit *m_QualifierOrder = nullptr; - QPushButton *m_setQualifierOrder = nullptr; QComboBox *m_BreakInheritanceList = nullptr; QComboBox *m_CompactNamespaces = nullptr; - QLineEdit *m_ConstructorInitializerIndentWidth = nullptr; - QPushButton *m_setConstructorInitializerIndentWidth = nullptr; QLineEdit *m_ContinuationIndentWidth = nullptr; QPushButton *m_setContinuationIndentWidth = nullptr; QComboBox *m_Cpp11BracedListStyle = nullptr; - QComboBox *m_DeriveLineEnding = nullptr; - QComboBox *m_DerivePointerAlignment = nullptr; QComboBox *m_DisableFormat = nullptr; QComboBox *m_EmptyLineAfterAccessModifier = nullptr; QComboBox *m_EmptyLineBeforeAccessModifier = nullptr; QComboBox *m_ExperimentalAutoDetectBinPacking = nullptr; - QComboBox *m_PackConstructorInitializers = nullptr; QComboBox *m_FixNamespaceComments = nullptr; QPlainTextEdit *m_ForEachMacros = nullptr; QPushButton *m_setForEachMacros = nullptr; QPlainTextEdit *m_IfMacros = nullptr; QPushButton *m_setIfMacros = nullptr; - QPlainTextEdit *m_TypenameMacros = nullptr; - QPushButton *m_setTypenameMacros = nullptr; - QPlainTextEdit *m_StatementMacros = nullptr; - QPushButton *m_setStatementMacros = nullptr; - QPlainTextEdit *m_NamespaceMacros = nullptr; - QPushButton *m_setNamespaceMacros = nullptr; - QPlainTextEdit *m_WhitespaceSensitiveMacros = nullptr; - QPushButton *m_setWhitespaceSensitiveMacros = nullptr; QComboBox *m_IndentAccessModifiers = nullptr; - QComboBox *m_IndentCaseLabels = nullptr; QComboBox *m_IndentCaseBlocks = nullptr; + QComboBox *m_IndentCaseLabels = nullptr; QComboBox *m_IndentGotoLabels = nullptr; - QComboBox *m_IndentPPDirectives = nullptr; QComboBox *m_IndentExternBlock = nullptr; - QComboBox *m_IndentRequires = nullptr; + QComboBox *m_IndentPPDirectives = nullptr; + QComboBox *m_IndentRequiresClause = nullptr; QLineEdit *m_IndentWidth = nullptr; QPushButton *m_setIndentWidth = nullptr; QComboBox *m_IndentWrappedFunctionNames = nullptr; + QComboBox *m_InsertBraces = nullptr; + QComboBox *m_InsertNewlineAtEOF = nullptr; + QComboBox *m_InsertTrailingCommas = nullptr; QPlainTextEdit *m_JavaImportGroups = nullptr; QPushButton *m_setJavaImportGroups = nullptr; QComboBox *m_JavaScriptQuotes = nullptr; QComboBox *m_JavaScriptWrapImports = nullptr; QComboBox *m_KeepEmptyLinesAtTheStartOfBlocks = nullptr; - QComboBox *m_Language = nullptr; QComboBox *m_LambdaBodyIndentation = nullptr; + QComboBox *m_Language = nullptr; + QComboBox *m_LineEnding = nullptr; QLineEdit *m_MacroBlockBegin = nullptr; QPushButton *m_setMacroBlockBegin = nullptr; QLineEdit *m_MacroBlockEnd = nullptr; @@ -139,12 +147,15 @@ private: QLineEdit *m_MaxEmptyLinesToKeep = nullptr; QPushButton *m_setMaxEmptyLinesToKeep = nullptr; QComboBox *m_NamespaceIndentation = nullptr; + QPlainTextEdit *m_NamespaceMacros = nullptr; + QPushButton *m_setNamespaceMacros = nullptr; QComboBox *m_ObjCBinPackProtocolList = nullptr; QLineEdit *m_ObjCBlockIndentWidth = nullptr; QPushButton *m_setObjCBlockIndentWidth = nullptr; - QComboBox *m_ObjCSpaceAfterProperty = nullptr; QComboBox *m_ObjCBreakBeforeNestedBlockParam = nullptr; + QComboBox *m_ObjCSpaceAfterProperty = nullptr; QComboBox *m_ObjCSpaceBeforeProtocolList = nullptr; + QComboBox *m_PackConstructorInitializers = nullptr; QLineEdit *m_PenaltyBreakAssignment = nullptr; QPushButton *m_setPenaltyBreakAssignment = nullptr; QLineEdit *m_PenaltyBreakBeforeFirstCallParameter = nullptr; @@ -161,16 +172,22 @@ private: QPushButton *m_setPenaltyBreakTemplateDeclaration = nullptr; QLineEdit *m_PenaltyExcessCharacter = nullptr; QPushButton *m_setPenaltyExcessCharacter = nullptr; - QLineEdit *m_PenaltyReturnTypeOnItsOwnLine = nullptr; - QPushButton *m_setPenaltyReturnTypeOnItsOwnLine = nullptr; QLineEdit *m_PenaltyIndentedWhitespace = nullptr; QPushButton *m_setPenaltyIndentedWhitespace = nullptr; + QLineEdit *m_PenaltyReturnTypeOnItsOwnLine = nullptr; + QPushButton *m_setPenaltyReturnTypeOnItsOwnLine = nullptr; QComboBox *m_PointerAlignment = nullptr; QLineEdit *m_PPIndentWidth = nullptr; QPushButton *m_setPPIndentWidth = nullptr; + QComboBox *m_QualifierAlignment = nullptr; + QPlainTextEdit *m_QualifierOrder = nullptr; + QPushButton *m_setQualifierOrder = nullptr; QComboBox *m_ReferenceAlignment = nullptr; QComboBox *m_ReflowComments = nullptr; QComboBox *m_RemoveBracesLLVM = nullptr; + QComboBox *m_RemoveSemicolon = nullptr; + QComboBox *m_RequiresClausePosition = nullptr; + QComboBox *m_RequiresExpressionIndentation = nullptr; QComboBox *m_SeparateDefinitionBlocks = nullptr; QLineEdit *m_ShortNamespaceLines = nullptr; QPushButton *m_setShortNamespaceLines = nullptr; @@ -187,13 +204,16 @@ private: QComboBox *m_SpaceBeforeCtorInitializerColon = nullptr; QComboBox *m_SpaceBeforeInheritanceColon = nullptr; QComboBox *m_SpaceBeforeParens = nullptr; - QComboBox *m_AfterControlStatements = nullptr; - QComboBox *m_AfterForeachMacros = nullptr; - QComboBox *m_AfterFunctionDeclarationName = nullptr; - QComboBox *m_AfterFunctionDefinitionName = nullptr; - QComboBox *m_AfterIfMacros = nullptr; - QComboBox *m_AfterOverloadedOperator = nullptr; - QComboBox *m_BeforeNonEmptyParentheses = nullptr; + QComboBox *m_SpaceBeforeParensOptionsAfterControlStatements = nullptr; + QComboBox *m_SpaceBeforeParensOptionsAfterForeachMacros = nullptr; + QComboBox *m_SpaceBeforeParensOptionsAfterFunctionDeclarationName = nullptr; + QComboBox *m_SpaceBeforeParensOptionsAfterFunctionDefinitionName = nullptr; + QComboBox *m_SpaceBeforeParensOptionsAfterIfMacros = nullptr; + QComboBox *m_SpaceBeforeParensOptionsAfterOverloadedOperator = nullptr; + QComboBox *m_SpaceBeforeParensOptionsAfterRequiresInClause = nullptr; + QComboBox *m_SpaceBeforeParensOptionsAfterRequiresInExpression = nullptr; + QComboBox *m_SpaceBeforeParensOptionsBeforeNonEmptyParentheses = nullptr; + QComboBox *m_SpaceBeforeSquareBrackets = nullptr; QComboBox *m_SpaceBeforeRangeBasedForLoopColon = nullptr; QComboBox *m_SpaceInEmptyBlock = nullptr; QComboBox *m_SpaceInEmptyParentheses = nullptr; @@ -203,21 +223,24 @@ private: QComboBox *m_SpacesInConditionalStatement = nullptr; QComboBox *m_SpacesInContainerLiterals = nullptr; QComboBox *m_SpacesInCStyleCastParentheses = nullptr; - QLineEdit *m_Minimum = nullptr; - QPushButton *m_setMinimum = nullptr; - QLineEdit *m_Maximum = nullptr; - QPushButton *m_setMaximum = nullptr; + QLineEdit *m_SpacesInLineCommentPrefixMinimum = nullptr; + QPushButton *m_setSpacesInLineCommentPrefixMinimum = nullptr; + QLineEdit *m_SpacesInLineCommentPrefixMaximum = nullptr; + QPushButton *m_setSpacesInLineCommentPrefixMaximum = nullptr; QComboBox *m_SpacesInParentheses = nullptr; QComboBox *m_SpacesInSquareBrackets = nullptr; - QComboBox *m_SpaceBeforeSquareBrackets = nullptr; - QComboBox *m_BitFieldColonSpacing = nullptr; QComboBox *m_Standard = nullptr; QPlainTextEdit *m_StatementAttributeLikeMacros = nullptr; QPushButton *m_setStatementAttributeLikeMacros = nullptr; + QPlainTextEdit *m_StatementMacros = nullptr; + QPushButton *m_setStatementMacros = nullptr; QLineEdit *m_TabWidth = nullptr; QPushButton *m_setTabWidth = nullptr; - QComboBox *m_UseCRLF = nullptr; + QPlainTextEdit *m_TypenameMacros = nullptr; + QPushButton *m_setTypenameMacros = nullptr; QComboBox *m_UseTab = nullptr; + QPlainTextEdit *m_WhitespaceSensitiveMacros = nullptr; + QPushButton *m_setWhitespaceSensitiveMacros = nullptr; }; diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index 9a1f1d4dd52..26abaab009a 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -3,6 +3,7 @@ #include "clangformatconfigwidget.h" +// the file below was generated by scripts/generateClangFormatChecksLayout.py #include "clangformatchecks.h" #include "clangformatconstants.h" #include "clangformatfile.h" @@ -10,8 +11,6 @@ #include "clangformattr.h" #include "clangformatutils.h" -// the file was generated by scripts/generateClangFormatChecksLayout.py - #include <coreplugin/icore.h> #include <cppeditor/cppcodestylepreferences.h> @@ -245,77 +244,6 @@ void ClangFormatConfigWidget::updatePreview() d->preview->textDocument()->autoIndent(cursor); } -static inline void ltrim(std::string &s) -{ - s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int ch) { return !std::isspace(ch); })); -} - -static inline void rtrim(std::string &s) -{ - s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) { return !std::isspace(ch); }).base(), - s.end()); -} - -static inline void trim(std::string &s) -{ - ltrim(s); - rtrim(s); -} - -static void fillPlainText(QPlainTextEdit *plainText, const std::string &text, size_t index) -{ - if (index == std::string::npos) { - plainText->setPlainText(""); - return; - } - size_t valueStart = text.find('\n', index + 1); - size_t valueEnd; - std::string value; - QTC_ASSERT(valueStart != std::string::npos, return;); - do { - valueEnd = text.find('\n', valueStart + 1); - if (valueEnd == std::string::npos) - break; - // Skip also 2 spaces - start with valueStart + 1 + 2. - std::string line = text.substr(valueStart + 3, valueEnd - valueStart - 3); - rtrim(line); - value += value.empty() ? line : '\n' + line; - valueStart = valueEnd; - } while (valueEnd < text.size() - 1 && text.at(valueEnd + 1) == ' '); - plainText->setPlainText(QString::fromStdString(value)); -} - -static void fillComboBoxOrLineEdit(QObject *object, const std::string &text, size_t index) -{ - auto *comboBox = qobject_cast<QComboBox *>(object); - auto *lineEdit = qobject_cast<QLineEdit *>(object); - if (index == std::string::npos) { - if (comboBox) - comboBox->setCurrentIndex(0); - else - lineEdit->setText(""); - return; - } - - const size_t valueStart = text.find(':', index + 1); - QTC_ASSERT(valueStart != std::string::npos, return;); - const size_t valueEnd = text.find('\n', valueStart + 1); - QTC_ASSERT(valueEnd != std::string::npos, return;); - std::string value = text.substr(valueStart + 1, valueEnd - valueStart - 1); - trim(value); - - if (comboBox) { - if (comboBox->findText(QString::fromStdString(value)) == -1) { - comboBox->setCurrentIndex(0); - return; - } - comboBox->setCurrentText(QString::fromStdString(value)); - return; - } - - lineEdit->setText(QString::fromStdString(value)); -} - std::string ClangFormatConfigWidget::readFile(const QString &path) { const std::string defaultStyle = clang::format::configurationAsText(qtcStyle()); @@ -348,11 +276,55 @@ std::string ClangFormatConfigWidget::readFile(const QString &path) return settings; } +static std::map<QString, QString> getMapFromString(const QString &text) +{ + std::map<QString, QString> objectNameMap; + + QString parentName; + for (QString line : text.split('\n')) { + if (line.isEmpty()) + continue; + + QStringList list = line.split(':'); + QString key = !list.isEmpty() ? list[0] : ""; + QString value = line.mid(key.size() + 1).trimmed(); + + if (line.contains(':') && value.isEmpty()) { + parentName = key; + continue; + } + + if (!value.isEmpty() && !line.startsWith(" ")) + parentName = ""; + + if (line.startsWith(" - ") || line.startsWith(" ")) { + line.remove(0, 2); + if (objectNameMap.find(parentName) == objectNameMap.end()) + objectNameMap[parentName] = line + "\n"; + else + objectNameMap[parentName] += line + "\n"; + continue; + } + + if (line.startsWith(" ")) { + key.remove(0, 2); + key = parentName + key; + objectNameMap.insert(std::make_pair(key, value)); + continue; + } + + objectNameMap.insert(std::make_pair(key, value)); + } + + return objectNameMap; +} + void ClangFormatConfigWidget::fillTable() { Utils::GuardLocker locker(d->ignoreChanges); - const std::string configText = readFile(d->config->filePath().path()); + const QString configText = QString::fromStdString(readFile(d->config->filePath().path())); + std::map<QString, QString> objectNameMap = getMapFromString(configText); for (QObject *child : d->checksWidget->children()) { if (!qobject_cast<QComboBox *>(child) && !qobject_cast<QLineEdit *>(child) @@ -360,14 +332,27 @@ void ClangFormatConfigWidget::fillTable() continue; } - size_t index = configText.find('\n' + child->objectName().toStdString()); - if (index == std::string::npos) - index = configText.find("\n " + child->objectName().toStdString()); + if (objectNameMap.find(child->objectName()) == objectNameMap.end()) + continue; - if (qobject_cast<QPlainTextEdit *>(child)) - fillPlainText(qobject_cast<QPlainTextEdit *>(child), configText, index); - else - fillComboBoxOrLineEdit(child, configText, index); + if (QPlainTextEdit *plainText = qobject_cast<QPlainTextEdit *>(child)) { + plainText->setPlainText(objectNameMap[child->objectName()]); + continue; + } + + if (QComboBox *comboBox = qobject_cast<QComboBox *>(child)) { + if (comboBox->findText(objectNameMap[child->objectName()]) == -1) { + comboBox->setCurrentIndex(0); + } else { + comboBox->setCurrentText(objectNameMap[child->objectName()]); + } + continue; + } + + if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(child)) { + lineEdit->setText(objectNameMap[child->objectName()]); + continue; + } } } @@ -378,6 +363,7 @@ void ClangFormatConfigWidget::saveChanges(QObject *sender) d->config->setBasedOnStyle(basedOnStyle->currentText()); } else { QList<ClangFormatFile::Field> fields; + QString parentName; for (QObject *child : d->checksWidget->children()) { if (child->objectName() == "BasedOnStyle") @@ -386,13 +372,31 @@ void ClangFormatConfigWidget::saveChanges(QObject *sender) if (!label) continue; - QWidget *valueWidget = d->checksWidget->findChild<QWidget *>(label->text().trimmed()); - if (!valueWidget) { + // reset parent name if label starts without " " + if (!label->text().startsWith(" ")) + parentName = ""; + + QList<QWidget *> valueWidgets = d->checksWidget->findChildren<QWidget *>( + parentName + label->text().trimmed()); + + if (valueWidgets.empty()) { // Currently BraceWrapping only. fields.append({label->text(), ""}); + // save parent name + parentName = label->text().trimmed(); continue; } + QWidget *valueWidget = valueWidgets.first(); + if (valueWidgets.size() > 1) { + for (QWidget *w : valueWidgets) { + if (w->objectName() == parentName + label->text().trimmed()) { + valueWidget = w; + break; + } + } + } + if (!qobject_cast<QComboBox *>(valueWidget) && !qobject_cast<QLineEdit *>(valueWidget) && !qobject_cast<QPlainTextEdit *>(valueWidget)) { continue; @@ -403,7 +407,6 @@ void ClangFormatConfigWidget::saveChanges(QObject *sender) if (plainText->toPlainText().trimmed().isEmpty()) continue; - std::stringstream content; QStringList list = plainText->toPlainText().split('\n'); for (const QString &line : list) From 35422ad25b9e5f16ab5b0517c854f4eaadd3c4b9 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 19 Jul 2023 11:53:34 +0200 Subject: [PATCH 0600/1777] Editors: Persist history of open files in the session. The state of the editor views and editors was already saved, but the history of editors was missing. Affects the open document window (Ctrl+Tab). Change-Id: I2ee8d96c27d8ab72022c6335d42455395380f124 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- .../coreplugin/editormanager/editorview.cpp | 58 ++++++++++++++++--- .../coreplugin/editormanager/editorview.h | 7 ++- 2 files changed, 55 insertions(+), 10 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 3ac8405ea26..dd248ba4b73 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -876,6 +876,20 @@ void SplitterOrView::unsplit() emit splitStateChanged(); } +static QByteArrayList saveHistory(const QList<EditLocation> &history) +{ + const QList<EditLocation> nonTempHistory = Utils::filtered(history, [](const EditLocation &loc) { + const bool isTemp = loc.filePath.isEmpty() || (loc.document && loc.document->isTemporary()); + return !isTemp; + }); + return Utils::transform(nonTempHistory, [](const EditLocation &loc) { return loc.save(); }); +} + +static QList<EditLocation> loadHistory(const QByteArrayList &data) +{ + return Utils::transform(data, + [](const QByteArray &locData) { return EditLocation::load(locData); }); +} QByteArray SplitterOrView::saveState() const { @@ -902,16 +916,17 @@ QByteArray SplitterOrView::saveState() const if (!e) { stream << QByteArray("empty"); - } else if (e == EditorManager::currentEditor()) { - stream << QByteArray("currenteditor") - << e->document()->filePath().toString() - << e->document()->id().toString() - << e->saveState(); } else { - stream << QByteArray("editor") - << e->document()->filePath().toString() - << e->document()->id().toString() - << e->saveState(); + if (e == EditorManager::currentEditor()) { + stream << QByteArray("currenteditor") << e->document()->filePath().toString() + << e->document()->id().toString() << e->saveState(); + } else { + stream << QByteArray("editor") << e->document()->filePath().toString() + << e->document()->id().toString() << e->saveState(); + } + + // save edit history + stream << saveHistory(view()->editorHistory()); } } return bytes; @@ -934,7 +949,12 @@ void SplitterOrView::restoreState(const QByteArray &state) QString fileName; QString id; QByteArray editorState; + QByteArrayList historyData; stream >> fileName >> id >> editorState; + if (!stream.atEnd()) + stream >> historyData; + view()->m_editorHistory = loadHistory(historyData); + if (!QFile::exists(fileName)) return; IEditor *e = EditorManagerPrivate::openEditor(view(), FilePath::fromString(fileName), Id::fromString(id), @@ -956,3 +976,23 @@ void SplitterOrView::restoreState(const QByteArray &state) } } } + +QByteArray EditLocation::save() const +{ + QByteArray data; + QDataStream stream(&data, QIODevice::WriteOnly); + stream << filePath.toFSPathString() << id << state; + return data; +} + +EditLocation EditLocation::load(const QByteArray &data) +{ + EditLocation loc; + QDataStream stream(data); + QString fp; + stream >> fp; + loc.filePath = FilePath::fromString(fp); + stream >> loc.id; + stream >> loc.state; + return loc; +} diff --git a/src/plugins/coreplugin/editormanager/editorview.h b/src/plugins/coreplugin/editormanager/editorview.h index 20cf782bc14..4bf172d26b5 100644 --- a/src/plugins/coreplugin/editormanager/editorview.h +++ b/src/plugins/coreplugin/editormanager/editorview.h @@ -39,7 +39,12 @@ class EditorToolBar; namespace Internal { -struct EditLocation { +class EditLocation +{ +public: + QByteArray save() const; + static EditLocation load(const QByteArray &data); + QPointer<IDocument> document; Utils::FilePath filePath; Utils::Id id; From d685c7d950272e5c074dbbcc9ee9af53399db559 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 3 Aug 2023 14:58:54 +0200 Subject: [PATCH 0601/1777] Utils: Fix FancyMainWindow The FancyMainWindow::dockWidgets() function did find all children, even if there was another FancyMainWindow in the hierarchy with its own dock widget children. Change-Id: I44c2fe669d08a938e86e889caa570d2b19a0cac7 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/fancymainwindow.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/fancymainwindow.cpp b/src/libs/utils/fancymainwindow.cpp index 323e2508eba..cd8deebb976 100644 --- a/src/libs/utils/fancymainwindow.cpp +++ b/src/libs/utils/fancymainwindow.cpp @@ -478,9 +478,25 @@ void FancyMainWindow::restoreSettings(const QHash<QString, QVariant> &settings) } } +static void findDockChildren(QWidget *parent, QList<QDockWidget *> &result) +{ + for (QObject *child : parent->children()) { + QWidget *childWidget = qobject_cast<QWidget *>(child); + if (!childWidget) + continue; + + if (auto dockWidget = qobject_cast<QDockWidget *>(child)) + result.append(dockWidget); + else if (!qobject_cast<QMainWindow *>(child)) + findDockChildren(qobject_cast<QWidget *>(child), result); + } +} + const QList<QDockWidget *> FancyMainWindow::dockWidgets() const { - return findChildren<QDockWidget *>(); + QList<QDockWidget *> result; + findDockChildren((QWidget *) this, result); + return result; } bool FancyMainWindow::autoHideTitleBars() const From 94aff7cf5099f4245f4a54f4074ae9dd8dad7a67 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 4 Aug 2023 09:43:08 +0200 Subject: [PATCH 0602/1777] GlyphCache: Avoid potential use of deleted object The QCache::insert() may delete the inserted object. In this case it returns false. Make use of the returned value and don't use the object anymore in false case. Change-Id: I1519766f77fa5965268a327d3159a357135e142b Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/solutions/terminal/glyphcache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/solutions/terminal/glyphcache.cpp b/src/libs/solutions/terminal/glyphcache.cpp index d5e4b306e16..1941f1c0366 100644 --- a/src/libs/solutions/terminal/glyphcache.cpp +++ b/src/libs/solutions/terminal/glyphcache.cpp @@ -38,8 +38,8 @@ const QGlyphRun *GlyphCache::get(const QFont &font, const QString &text) const auto runs = line.glyphRuns(); if (!runs.isEmpty()) { QGlyphRun *run = new QGlyphRun(layout.lineAt(0).glyphRuns().first()); - insert(key, run); - return run; + if (insert(key, run)) + return run; } } return nullptr; From a9eabeacefb8dbeeeef67ef47c5dea45fef8d92d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 4 Aug 2023 10:07:30 +0200 Subject: [PATCH 0603/1777] TerminalSurface: Fix sendKey() Pass mod into vterm_keyboard_unichar(), instead of unconditional VTERM_MOD_NONE. Change-Id: I850c5cb6d00302e46cfce6e695e159a5ce99dafb Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/solutions/terminal/terminalsurface.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libs/solutions/terminal/terminalsurface.cpp b/src/libs/solutions/terminal/terminalsurface.cpp index 8baf743e2f0..47dfb743454 100644 --- a/src/libs/solutions/terminal/terminalsurface.cpp +++ b/src/libs/solutions/terminal/terminalsurface.cpp @@ -573,11 +573,10 @@ void TerminalSurface::sendKey(QKeyEvent *event) // like ctrl+i for tab or ctrl+j for newline. // Workaround for "ALT+SHIFT+/" (\ on german mac keyboards) - if (mod == (VTERM_MOD_SHIFT | VTERM_MOD_ALT) && event->key() == Qt::Key_Slash) { + if (mod == (VTERM_MOD_SHIFT | VTERM_MOD_ALT) && event->key() == Qt::Key_Slash) mod = VTERM_MOD_NONE; - } - vterm_keyboard_unichar(d->m_vterm.get(), event->text().toUcs4()[0], VTERM_MOD_NONE); + vterm_keyboard_unichar(d->m_vterm.get(), event->text().toUcs4()[0], mod); } else if (mod == VTERM_MOD_CTRL && event->key() >= Qt::Key_A && event->key() < Qt::Key_Z) { vterm_keyboard_unichar(d->m_vterm.get(), 'a' + (event->key() - Qt::Key_A), mod); } From f2f0e420b0e3116a2016985104e39006282221cf Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 4 Aug 2023 09:55:55 +0200 Subject: [PATCH 0604/1777] libvterm: Update to 0.3.3 See also: https://bazaar.launchpad.net/~libvterm/libvterm/trunk/revision/839?compare_revid=829 Change-Id: Ifbee08cfb5cbc1ebfa61e3a70daf751a7a798a5b Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/3rdparty/libvterm/include/vterm.h | 2 + src/libs/3rdparty/libvterm/src/mouse.c | 2 +- src/libs/3rdparty/libvterm/src/parser.c | 2 +- src/libs/3rdparty/libvterm/src/state.c | 51 ++++++++++++------- src/libs/3rdparty/libvterm/src/vterm.c | 1 + .../3rdparty/libvterm/src/vterm_internal.h | 1 + .../solutions/terminal/terminalsurface.cpp | 2 + 7 files changed, 42 insertions(+), 19 deletions(-) diff --git a/src/libs/3rdparty/libvterm/include/vterm.h b/src/libs/3rdparty/libvterm/include/vterm.h index cb16ff2a044..d08dd382db3 100644 --- a/src/libs/3rdparty/libvterm/include/vterm.h +++ b/src/libs/3rdparty/libvterm/include/vterm.h @@ -13,6 +13,7 @@ extern "C" { #define VTERM_VERSION_MAJOR 0 #define VTERM_VERSION_MINOR 3 +#define VTERM_VERSION_PATCH 3 #define VTERM_CHECK_VERSION \ vterm_check_version(VTERM_VERSION_MAJOR, VTERM_VERSION_MINOR) @@ -258,6 +259,7 @@ typedef enum { VTERM_PROP_REVERSE, // bool VTERM_PROP_CURSORSHAPE, // number VTERM_PROP_MOUSE, // number + VTERM_PROP_FOCUSREPORT, // bool VTERM_N_PROPS } VTermProp; diff --git a/src/libs/3rdparty/libvterm/src/mouse.c b/src/libs/3rdparty/libvterm/src/mouse.c index bd713f8106a..f74abc3d9d2 100644 --- a/src/libs/3rdparty/libvterm/src/mouse.c +++ b/src/libs/3rdparty/libvterm/src/mouse.c @@ -93,7 +93,7 @@ void vterm_mouse_button(VTerm *vt, int button, bool pressed, VTermModifier mod) if(button < 4) { output_mouse(state, button-1, pressed, mod, state->mouse_col, state->mouse_row); } - else if(button < 6) { + else if(button < 8) { output_mouse(state, button-4 + 0x40, pressed, mod, state->mouse_col, state->mouse_row); } } diff --git a/src/libs/3rdparty/libvterm/src/parser.c b/src/libs/3rdparty/libvterm/src/parser.c index b8959fdfe5b..b43a549cefc 100644 --- a/src/libs/3rdparty/libvterm/src/parser.c +++ b/src/libs/3rdparty/libvterm/src/parser.c @@ -203,7 +203,7 @@ size_t vterm_input_write(VTerm *vt, const char *bytes, size_t len) switch(vt->parser.state) { case CSI_LEADER: /* Extract leader bytes 0x3c to 0x3f */ - if(c >= 0x3c && c <= 0x3f || c == '!') { + if(c >= 0x3c && c <= 0x3f) { if(vt->parser.v.csi.leaderlen < CSI_LEADER_MAX-1) vt->parser.v.csi.leader[vt->parser.v.csi.leaderlen++] = c; break; diff --git a/src/libs/3rdparty/libvterm/src/state.c b/src/libs/3rdparty/libvterm/src/state.c index 45db3fca2ea..ce8e0342370 100644 --- a/src/libs/3rdparty/libvterm/src/state.c +++ b/src/libs/3rdparty/libvterm/src/state.c @@ -801,6 +801,7 @@ static void set_dec_mode(VTermState *state, int num, int val) break; case 1004: + settermprop_bool(state, VTERM_PROP_FOCUSREPORT, val); state->mode.report_focus = val; break; @@ -934,7 +935,6 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha return 0; switch(leader[0]) { - case '!': case '?': case '>': leader_byte = leader[0]; @@ -950,6 +950,7 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha switch(intermed[0]) { case ' ': + case '!': case '"': case '$': case '\'': @@ -1312,9 +1313,9 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha break; case LEADER('?', 0x68): // DEC private mode set - for (int i = 0; i < argcount; i++) { - if (!CSI_ARG_IS_MISSING(args[i])) - set_dec_mode(state, CSI_ARG(args[i]), 1); + for(int i = 0; i < argcount; i++) { + if(!CSI_ARG_IS_MISSING(args[i])) + set_dec_mode(state, CSI_ARG(args[i]), 1); } break; @@ -1336,8 +1337,8 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha break; case LEADER('?', 0x6c): // DEC private mode reset - for (int i = 0; i < argcount; i++) { - if (!CSI_ARG_IS_MISSING(args[i])) + for(int i = 0; i < argcount; i++) { + if(!CSI_ARG_IS_MISSING(args[i])) set_dec_mode(state, CSI_ARG(args[i]), 0); } break; @@ -1391,7 +1392,7 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha break; - case LEADER('!', 0x70): // DECSTR - DEC soft terminal reset + case INTERMED('!', 0x70): // DECSTR - DEC soft terminal reset vterm_state_reset(state, 0); break; @@ -1658,12 +1659,12 @@ static void osc_selection(VTermState *state, VTermStringFragment frag) } if(!frag.len) { - // Clear selection - if(state->selection.callbacks->set) { + /* Clear selection if we're already finished but didn't do anything */ + if(frag.final && state->selection.callbacks->set) { (*state->selection.callbacks->set)(state->tmp.selection.mask, (VTermStringFragment){ - .str = 0, + .str = NULL, .len = 0, - .initial = true, + .initial = state->tmp.selection.state != SELECTION_SET, .final = true, }, state->selection.user); } @@ -1686,6 +1687,9 @@ static void osc_selection(VTermState *state, VTermStringFragment frag) return; } + if(state->tmp.selection.state == SELECTION_INVALID) + return; + if(state->selection.callbacks->set) { size_t bufcur = 0; char *buffer = state->selection.buffer; @@ -1721,11 +1725,21 @@ static void osc_selection(VTermState *state, VTermStringFragment frag) uint8_t b = unbase64one(frag.str[0]); if(b == 0xFF) { DEBUG_LOG("base64decode bad input %02X\n", (uint8_t)frag.str[0]); + + state->tmp.selection.state = SELECTION_INVALID; + if(state->selection.callbacks->set) { + (*state->selection.callbacks->set)(state->tmp.selection.mask, (VTermStringFragment){ + .str = NULL, + .len = 0, + .initial = true, + .final = true, + }, state->selection.user); + } + break; } - else { - x = (x << 6) | b; - n++; - } + + x = (x << 6) | b; + n++; frag.str++, frag.len--; if(n == 4) { @@ -1745,7 +1759,7 @@ static void osc_selection(VTermState *state, VTermStringFragment frag) .str = state->selection.buffer, .len = bufcur, .initial = state->tmp.selection.state == SELECTION_SET_INITIAL, - .final = frag.final && frag.len == 0, + .final = frag.final && !frag.len, }, state->selection.user); state->tmp.selection.state = SELECTION_SET; } @@ -1857,7 +1871,7 @@ static void request_status_string(VTermState *state, VTermStringFragment frag) case ' '|('q'<<8): { // Query DECSCUSR - int reply = 2; + int reply; switch(state->mode.cursor_shape) { case VTERM_PROP_CURSORSHAPE_BLOCK: reply = 2; break; case VTERM_PROP_CURSORSHAPE_UNDERLINE: reply = 4; break; @@ -2211,6 +2225,9 @@ int vterm_state_set_termprop(VTermState *state, VTermProp prop, VTermValue *val) if(val->number == VTERM_PROP_MOUSE_MOVE) state->mouse_flags |= MOUSE_WANT_MOVE; return 1; + case VTERM_PROP_FOCUSREPORT: + state->mode.report_focus = val->boolean; + return 1; case VTERM_N_PROPS: return 0; diff --git a/src/libs/3rdparty/libvterm/src/vterm.c b/src/libs/3rdparty/libvterm/src/vterm.c index 0997887f5fb..e1f676f5b62 100644 --- a/src/libs/3rdparty/libvterm/src/vterm.c +++ b/src/libs/3rdparty/libvterm/src/vterm.c @@ -295,6 +295,7 @@ VTermValueType vterm_get_prop_type(VTermProp prop) case VTERM_PROP_REVERSE: return VTERM_VALUETYPE_BOOL; case VTERM_PROP_CURSORSHAPE: return VTERM_VALUETYPE_INT; case VTERM_PROP_MOUSE: return VTERM_VALUETYPE_INT; + case VTERM_PROP_FOCUSREPORT: return VTERM_VALUETYPE_BOOL; case VTERM_N_PROPS: return 0; } diff --git a/src/libs/3rdparty/libvterm/src/vterm_internal.h b/src/libs/3rdparty/libvterm/src/vterm_internal.h index ad61bff8b0f..5d934aff071 100644 --- a/src/libs/3rdparty/libvterm/src/vterm_internal.h +++ b/src/libs/3rdparty/libvterm/src/vterm_internal.h @@ -158,6 +158,7 @@ struct VTermState SELECTION_QUERY, SELECTION_SET_INITIAL, SELECTION_SET, + SELECTION_INVALID, } state : 8; uint32_t recvpartial; uint32_t sendpartial; diff --git a/src/libs/solutions/terminal/terminalsurface.cpp b/src/libs/solutions/terminal/terminalsurface.cpp index 47dfb743454..fe565fd8b6b 100644 --- a/src/libs/solutions/terminal/terminalsurface.cpp +++ b/src/libs/solutions/terminal/terminalsurface.cpp @@ -354,6 +354,8 @@ struct TerminalSurfacePrivate break; case VTERM_N_PROPS: break; + case VTERM_PROP_FOCUSREPORT: + break; } return 1; } From fa753a69de6d0584a418583ecf248aa654d4ee90 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 4 Aug 2023 10:18:57 +0200 Subject: [PATCH 0605/1777] Terminal: Support focus reports Change-Id: If1e81b87b9c05c657453c9dbb51f82217d29a61d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/libs/solutions/terminal/terminalsurface.cpp | 16 ++++++++++++++++ src/libs/solutions/terminal/terminalsurface.h | 2 ++ src/libs/solutions/terminal/terminalview.cpp | 2 ++ 3 files changed, 20 insertions(+) diff --git a/src/libs/solutions/terminal/terminalsurface.cpp b/src/libs/solutions/terminal/terminalsurface.cpp index fe565fd8b6b..12bfd381f3e 100644 --- a/src/libs/solutions/terminal/terminalsurface.cpp +++ b/src/libs/solutions/terminal/terminalsurface.cpp @@ -629,6 +629,12 @@ void TerminalSurface::mouseButton(Qt::MouseButton button, case Qt::ExtraButton2: btnIdx = 5; break; + case Qt::ExtraButton3: + btnIdx = 6; + break; + case Qt::ExtraButton4: + btnIdx = 7; + break; default: return; } @@ -636,6 +642,16 @@ void TerminalSurface::mouseButton(Qt::MouseButton button, vterm_mouse_button(d->m_vterm.get(), btnIdx, pressed, qtModifierToVTerm(modifiers)); } +void TerminalSurface::sendFocus(bool hasFocus) +{ + VTermState *vts = vterm_obtain_state(d->m_vterm.get()); + + if (hasFocus) + vterm_state_focus_in(vts); + else + vterm_state_focus_out(vts); +} + void TerminalSurface::setWriteToPty(WriteToPty writeToPty) { d->m_writeToPty = writeToPty; diff --git a/src/libs/solutions/terminal/terminalsurface.h b/src/libs/solutions/terminal/terminalsurface.h index 765e3a59402..a8cc12fa4b0 100644 --- a/src/libs/solutions/terminal/terminalsurface.h +++ b/src/libs/solutions/terminal/terminalsurface.h @@ -103,6 +103,8 @@ public: void mouseMove(QPoint pos, Qt::KeyboardModifiers modifiers); void mouseButton(Qt::MouseButton button, bool pressed, Qt::KeyboardModifiers modifiers); + + void sendFocus(bool hasFocus); signals: void invalidated(QRect grid); void fullSizeChanged(QSize newSize); diff --git a/src/libs/solutions/terminal/terminalview.cpp b/src/libs/solutions/terminal/terminalview.cpp index 3ccef4ab94f..edb0b2c21b4 100644 --- a/src/libs/solutions/terminal/terminalview.cpp +++ b/src/libs/solutions/terminal/terminalview.cpp @@ -990,11 +990,13 @@ void TerminalView::focusInEvent(QFocusEvent *) updateViewport(); configBlinkTimer(); selectionChanged(d->m_selection); + d->m_surface->sendFocus(true); } void TerminalView::focusOutEvent(QFocusEvent *) { updateViewport(); configBlinkTimer(); + d->m_surface->sendFocus(false); } void TerminalView::inputMethodEvent(QInputMethodEvent *event) From 8819034e043e6433bc93ed4a9df2467582f8da20 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 4 Aug 2023 10:16:13 +0200 Subject: [PATCH 0606/1777] tst_dumpers: Verify that debugger has started OK Change-Id: Icb2c9ff2f56ac959ce3b87ff333a9f58fd146464 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- tests/auto/debugger/tst_dumpers.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index a1df2ae70c5..d3c9640d49c 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1203,6 +1203,7 @@ void tst_Dumpers::initTestCase() QProcess debugger; debugger.start(m_debuggerBinary, {"-i", "mi", "-quiet", "-nx"}); bool ok = debugger.waitForStarted(); + QVERIFY(ok); debugger.write("set confirm off\npython print 43\nshow version\nquit\n"); ok = debugger.waitForFinished(); QVERIFY(ok); From f313c5538f70ef745a2184aaa702435f0394b0d4 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 2 Aug 2023 23:22:06 +0200 Subject: [PATCH 0607/1777] Android: Simplify return statements Change-Id: I100b16a1fd74c4528f61f681bbeb5cdb4adddee5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/android/androidbuildapkstep.cpp | 3 +-- src/plugins/android/androidconfigurations.cpp | 8 ++++---- src/plugins/android/androidextralibrarylistmodel.cpp | 2 +- src/plugins/android/androidmanager.cpp | 6 +++--- src/plugins/android/androidmanifesteditorwidget.cpp | 2 +- src/plugins/android/androidsdkmodel.cpp | 12 ++++++------ src/plugins/android/certificatesmodel.cpp | 2 +- 7 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 7fc98f6c450..c80eb9cd4ca 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -450,8 +450,7 @@ QString AndroidBuildApkWidget::openSslIncludeFileContent(const FilePath &project return "android: include(" + openSslPath + "/openssl.pri)"; if (projectPath.endsWith("CMakeLists.txt")) return "if (ANDROID)\n include(" + openSslPath + "/CMakeLists.txt)\nendif()"; - - return QString(); + return {}; } void AndroidBuildApkWidget::setCertificates() diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index afc0db6ce3f..3ef93640c0d 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -675,7 +675,7 @@ QString AndroidConfig::getDeviceProperty(const QString &device, const QString &p adbProc.setCommand(cmd); adbProc.runBlocking(); if (adbProc.result() != ProcessResult::FinishedWithSuccess) - return QString(); + return {}; return adbProc.allOutput(); } @@ -692,18 +692,18 @@ QString AndroidConfig::getAvdName(const QString &serialnumber) { int index = serialnumber.indexOf(QLatin1String("-")); if (index == -1) - return QString(); + return {}; bool ok; int port = serialnumber.mid(index + 1).toInt(&ok); if (!ok) - return QString(); + return {}; const QByteArray avdName = "avd name\n"; QTcpSocket tcpSocket; tcpSocket.connectToHost(QHostAddress(QHostAddress::LocalHost), port); if (!tcpSocket.waitForConnected(100)) // Don't wait more than 100ms for a local connection - return QString{}; + return {}; tcpSocket.write(avdName + "exit\n"); tcpSocket.waitForDisconnected(500); diff --git a/src/plugins/android/androidextralibrarylistmodel.cpp b/src/plugins/android/androidextralibrarylistmodel.cpp index 9ee0c94010f..77a29020eb4 100644 --- a/src/plugins/android/androidextralibrarylistmodel.cpp +++ b/src/plugins/android/androidextralibrarylistmodel.cpp @@ -43,7 +43,7 @@ QModelIndex AndroidExtraLibraryListModel::index(int row, int column, const QMode QModelIndex AndroidExtraLibraryListModel::parent(const QModelIndex &) const { - return QModelIndex(); + return {}; } int AndroidExtraLibraryListModel::rowCount(const QModelIndex &) const diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index 9458df2a3b9..22fe6412688 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -91,7 +91,7 @@ QString AndroidManager::packageName(const Target *target) { QDomDocument doc; if (!openManifest(target, doc)) - return QString(); + return {}; QDomElement manifestElem = doc.documentElement(); return manifestElem.attribute(QLatin1String("package")); } @@ -100,7 +100,7 @@ QString AndroidManager::packageName(const FilePath &manifestFile) { QDomDocument doc; if (!openXmlFile(doc, manifestFile)) - return QString(); + return {}; QDomElement manifestElem = doc.documentElement(); return manifestElem.attribute(QLatin1String("package")); } @@ -109,7 +109,7 @@ QString AndroidManager::activityName(const Target *target) { QDomDocument doc; if (!openManifest(target, doc)) - return QString(); + return {}; QDomElement activityElem = doc.documentElement().firstChildElement( QLatin1String("application")).firstChildElement(QLatin1String("activity")); return activityElem.attribute(QLatin1String("android:name")); diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index 434af007891..36135f55713 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -1387,7 +1387,7 @@ void PermissionsModel::removePermission(int index) QVariant PermissionsModel::data(const QModelIndex &index, int role) const { if (role != Qt::DisplayRole || !index.isValid()) - return QVariant(); + return {}; return m_permissions[index.row()]; } diff --git a/src/plugins/android/androidsdkmodel.cpp b/src/plugins/android/androidsdkmodel.cpp index 4bf70f6b857..f470f7b9083 100644 --- a/src/plugins/android/androidsdkmodel.cpp +++ b/src/plugins/android/androidsdkmodel.cpp @@ -84,14 +84,14 @@ QModelIndex AndroidSdkModel::index(int row, int column, const QModelIndex &paren return createIndex(row, column); // Top level items (Tools & platform) } - return QModelIndex(); + return {}; } QModelIndex AndroidSdkModel::parent(const QModelIndex &index) const { void *ip = index.internalPointer(); if (!ip) - return QModelIndex(); + return {}; auto package = static_cast<const AndroidSdkPackage *>(ip); if (package->type() == AndroidSdkPackage::SystemImagePackage) { @@ -107,7 +107,7 @@ QModelIndex AndroidSdkModel::parent(const QModelIndex &index) const return createIndex(0, 0); // Tools } - return QModelIndex(); + return {}; } int AndroidSdkModel::rowCount(const QModelIndex &parent) const @@ -137,7 +137,7 @@ int AndroidSdkModel::columnCount(const QModelIndex &parent) const QVariant AndroidSdkModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) - return QVariant(); + return {}; if (!index.parent().isValid()) { // Top level tools @@ -160,7 +160,7 @@ QVariant AndroidSdkModel::data(const QModelIndex &index, int role) const return platform->apiLevel(); } } - return QVariant(); + return {}; } auto p = static_cast<const AndroidSdkPackage *>(index.internalPointer()); @@ -213,7 +213,7 @@ QVariant AndroidSdkModel::data(const QModelIndex &index, int role) const if (role == PackageStateRole) return p->state(); - return QVariant(); + return {}; } QHash<int, QByteArray> AndroidSdkModel::roleNames() const diff --git a/src/plugins/android/certificatesmodel.cpp b/src/plugins/android/certificatesmodel.cpp index 47aa3701cc8..4c80fe3972a 100644 --- a/src/plugins/android/certificatesmodel.cpp +++ b/src/plugins/android/certificatesmodel.cpp @@ -40,7 +40,7 @@ int CertificatesModel::rowCount(const QModelIndex &parent) const QVariant CertificatesModel::data(const QModelIndex &index, int role) const { if (!index.isValid() || (role != Qt::DisplayRole && role != Qt::ToolTipRole)) - return QVariant(); + return {}; if (role == Qt::DisplayRole) return m_certs[index.row()].first; return m_certs[index.row()].second; From 4d5752edc46423044fda644f830e5a6cadf887d8 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Date: Fri, 4 Aug 2023 20:01:19 +0900 Subject: [PATCH 0608/1777] RunControl: Revert reject button's text to keep apps running Previously, when a user attempted to switch sessions or quit Qt Creator, a dialog would appear asking whether to continue running the current app. The options were: - Force Quit - Keep Running However, in Qt Creator 10, the 'Keep Running' button was mislabelled as 'Cancel', which does not accurately represent its function. This commit corrects this issue by reverting the button's text back to 'Keep Running'. Change-Id: Ic48648baf6b166907d986d58e827cb52adfd551c Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/projectexplorer/runcontrol.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index c8418d82798..9b52213f065 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1120,7 +1120,9 @@ bool RunControl::showPromptToStopDialog(const QString &title, text, decider, QMessageBox::Yes | QMessageBox::Cancel, - QMessageBox::Yes); + QMessageBox::Yes, + QMessageBox::Yes, + buttonTexts); return selected == QMessageBox::Yes; } From 351c2cc4638c6e1d2ba5ef2feef1ac58de1d147a Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 4 Aug 2023 11:12:22 +0200 Subject: [PATCH 0609/1777] FossilPlugin: Drop namespace specifiers Remove some unused headers. Change-Id: Ied6c6994604d567503b00bfb9e822e8e3784cca6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/fossil/fossilclient.cpp | 4 +- src/plugins/fossil/fossilplugin.cpp | 243 ++++++++++++++-------------- src/plugins/fossil/fossilplugin.h | 2 - 3 files changed, 125 insertions(+), 124 deletions(-) diff --git a/src/plugins/fossil/fossilclient.cpp b/src/plugins/fossil/fossilclient.cpp index 7f4ebd206c5..3c3de5e523c 100644 --- a/src/plugins/fossil/fossilclient.cpp +++ b/src/plugins/fossil/fossilclient.cpp @@ -884,7 +884,7 @@ void FossilLogHighlighter::highlightBlock(const QString &text) void FossilClient::log(const FilePath &workingDir, const QStringList &files, const QStringList &extraOptions, bool enableAnnotationContextMenu, - const std::function<void(Utils::CommandLine &)> &addAuthOptions) + const std::function<void(CommandLine &)> &addAuthOptions) { // Show timeline for both repository and a file or path (--path <file-or-path>) // When used for log repository, the files list is empty @@ -940,7 +940,7 @@ void FossilClient::log(const FilePath &workingDir, const QStringList &files, void FossilClient::logCurrentFile(const FilePath &workingDir, const QStringList &files, const QStringList &extraOptions, bool enableAnnotationContextMenu, - const std::function<void(Utils::CommandLine &)> &addAuthOptions) + const std::function<void(CommandLine &)> &addAuthOptions) { // Show commit history for the given file/file-revision // NOTE: 'fossil finfo' shows full history from all branches. diff --git a/src/plugins/fossil/fossilplugin.cpp b/src/plugins/fossil/fossilplugin.cpp index 38aabc4c667..2e4d4f09611 100644 --- a/src/plugins/fossil/fossilplugin.cpp +++ b/src/plugins/fossil/fossilplugin.cpp @@ -16,15 +16,14 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/command.h> -#include <coreplugin/vcsmanager.h> #include <coreplugin/coreconstants.h> -#include <coreplugin/helpmanager.h> -#include <coreplugin/icore.h> -#include <coreplugin/idocument.h> #include <coreplugin/documentmanager.h> #include <coreplugin/editormanager/editormanager.h> -#include <coreplugin/locator/commandlocator.h> +#include <coreplugin/icore.h> +#include <coreplugin/idocument.h> #include <coreplugin/jsexpander.h> +#include <coreplugin/locator/commandlocator.h> +#include <coreplugin/vcsmanager.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projecttree.h> @@ -39,7 +38,6 @@ #include <vcsbase/basevcseditorfactory.h> #include <vcsbase/basevcssubmiteditorfactory.h> #include <vcsbase/vcsbaseclient.h> -#include <vcsbase/vcsbaseconstants.h> #include <vcsbase/vcsbaseeditor.h> #include <vcsbase/vcsbasesubmiteditor.h> #include <vcsbase/vcscommand.h> @@ -49,12 +47,10 @@ #include <QDialog> #include <QDialogButtonBox> #include <QDir> -#include <QFileDialog> #include <QGroupBox> #include <QMenu> #include <QMessageBox> #include <QRegularExpression> -#include <QtPlugin> using namespace Core; using namespace Utils; @@ -64,7 +60,7 @@ using namespace std::placeholders; namespace Fossil { namespace Internal { -class FossilTopicCache : public Core::IVersionControl::TopicCache +class FossilTopicCache : public IVersionControl::TopicCache { public: FossilTopicCache(FossilClient *client) : @@ -115,7 +111,7 @@ const VcsBaseSubmitEditorParameters submitEditorParameters { }; -class FossilPluginPrivate final : public VcsBase::VcsBasePluginPrivate +class FossilPluginPrivate final : public VcsBasePluginPrivate { public: enum SyncMode { @@ -146,11 +142,11 @@ public: void vcsDescribe(const FilePath &source, const QString &id) final; VcsCommand *createInitialCheckoutCommand(const QString &url, - const Utils::FilePath &baseDirectory, + const FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs) final; - void updateActions(VcsBase::VcsBasePluginPrivate::ActionState) override; + void updateActions(VcsBasePluginPrivate::ActionState) override; bool activateCommit() override; // File menu action slots @@ -174,15 +170,15 @@ public: void update(); void configureRepository(); void commit(); - void showCommitWidget(const QList<VcsBase::VcsBaseClient::StatusItem> &status); + void showCommitWidget(const QList<VcsBaseClient::StatusItem> &status); void diffFromEditorSelected(const QStringList &files); void createRepository(); // Methods - void createMenu(const Core::Context &context); - void createFileActions(const Core::Context &context); - void createDirectoryActions(const Core::Context &context); - void createRepositoryActions(const Core::Context &context); + void createMenu(const Context &context); + void createFileActions(const Context &context); + void createDirectoryActions(const Context &context); + void createRepositoryActions(const Context &context); bool pullOrPush(SyncMode mode); @@ -213,26 +209,26 @@ public: std::bind(&FossilPluginPrivate::vcsDescribe, this, _1, _2) }; - Core::CommandLocator *m_commandLocator = nullptr; - Core::ActionContainer *m_fossilContainer = nullptr; + CommandLocator *m_commandLocator = nullptr; + ActionContainer *m_fossilContainer = nullptr; QList<QAction *> m_repositoryActionList; // Menu Items (file actions) - Utils::ParameterAction *m_addAction = nullptr; - Utils::ParameterAction *m_deleteAction = nullptr; - Utils::ParameterAction *m_annotateFile = nullptr; - Utils::ParameterAction *m_diffFile = nullptr; - Utils::ParameterAction *m_logFile = nullptr; - Utils::ParameterAction *m_revertFile = nullptr; - Utils::ParameterAction *m_statusFile = nullptr; + ParameterAction *m_addAction = nullptr; + ParameterAction *m_deleteAction = nullptr; + ParameterAction *m_annotateFile = nullptr; + ParameterAction *m_diffFile = nullptr; + ParameterAction *m_logFile = nullptr; + ParameterAction *m_revertFile = nullptr; + ParameterAction *m_statusFile = nullptr; QAction *m_createRepositoryAction = nullptr; // Submit editor actions QAction *m_menuAction = nullptr; - Utils::FilePath m_submitRepository; + FilePath m_submitRepository; // To be connected to the VcsTask's success signal to emit the repository/ // files changed signals according to the variant's type: @@ -279,18 +275,18 @@ FossilClient *FossilPlugin::client() } FossilPluginPrivate::FossilPluginPrivate() - : VcsBase::VcsBasePluginPrivate(Core::Context(Constants::FOSSIL_CONTEXT)) + : VcsBasePluginPrivate(Context(Constants::FOSSIL_CONTEXT)) { - Core::Context context(Constants::FOSSIL_CONTEXT); + Context context(Constants::FOSSIL_CONTEXT); setTopicCache(new FossilTopicCache(&m_client)); - connect(&m_client, &VcsBase::VcsBaseClient::changed, this, &FossilPluginPrivate::changed); + connect(&m_client, &VcsBaseClient::changed, this, &FossilPluginPrivate::changed); - m_commandLocator = new Core::CommandLocator("Fossil", "fossil", "fossil", this); + m_commandLocator = new CommandLocator("Fossil", "fossil", "fossil", this); m_commandLocator->setDescription(Tr::tr("Triggers a Fossil version control operation.")); - ProjectExplorer::JsonWizardFactory::addWizardPath(Utils::FilePath::fromString(Constants::WIZARD_PATH)); - Core::JsExpander::registerGlobalObject("Fossil", [] { return new FossilJsExtension; }); + ProjectExplorer::JsonWizardFactory::addWizardPath(FilePath::fromString(Constants::WIZARD_PATH)); + JsExpander::registerGlobalObject("Fossil", [] { return new FossilJsExtension; }); connect(&settings(), &AspectContainer::changed, this, &IVersionControl::configurationChanged); @@ -298,10 +294,10 @@ FossilPluginPrivate::FossilPluginPrivate() createMenu(context); } -void FossilPluginPrivate::createMenu(const Core::Context &context) +void FossilPluginPrivate::createMenu(const Context &context) { // Create menu item for Fossil - m_fossilContainer = Core::ActionManager::createMenu("Fossil.FossilMenu"); + m_fossilContainer = ActionManager::createMenu("Fossil.FossilMenu"); QMenu *menu = m_fossilContainer->menu(); menu->setTitle(Tr::tr("&Fossil")); @@ -313,43 +309,47 @@ void FossilPluginPrivate::createMenu(const Core::Context &context) m_fossilContainer->addSeparator(context); // Request the Tools menu and add the Fossil menu to it - Core::ActionContainer *toolsMenu = Core::ActionManager::actionContainer(Core::Constants::M_TOOLS); + ActionContainer *toolsMenu = ActionManager::actionContainer(Core::Constants::M_TOOLS); toolsMenu->addMenu(m_fossilContainer); m_menuAction = m_fossilContainer->menu()->menuAction(); } -void FossilPluginPrivate::createFileActions(const Core::Context &context) +void FossilPluginPrivate::createFileActions(const Context &context) { - Core::Command *command; + Command *command; - m_annotateFile = new Utils::ParameterAction(Tr::tr("Annotate Current File"), Tr::tr("Annotate \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); - command = Core::ActionManager::registerAction(m_annotateFile, Constants::ANNOTATE, context); - command->setAttribute(Core::Command::CA_UpdateText); + m_annotateFile = new ParameterAction(Tr::tr("Annotate Current File"), Tr::tr("Annotate \"%1\""), + ParameterAction::EnabledWithParameter, this); + command = ActionManager::registerAction(m_annotateFile, Constants::ANNOTATE, context); + command->setAttribute(Command::CA_UpdateText); connect(m_annotateFile, &QAction::triggered, this, &FossilPluginPrivate::annotateCurrentFile); m_fossilContainer->addAction(command); m_commandLocator->appendCommand(command); - m_diffFile = new Utils::ParameterAction(Tr::tr("Diff Current File"), Tr::tr("Diff \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); - command = Core::ActionManager::registerAction(m_diffFile, Constants::DIFF, context); - command->setAttribute(Core::Command::CA_UpdateText); + m_diffFile = new ParameterAction(Tr::tr("Diff Current File"), Tr::tr("Diff \"%1\""), + ParameterAction::EnabledWithParameter, this); + command = ActionManager::registerAction(m_diffFile, Constants::DIFF, context); + command->setAttribute(Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+I,Meta+D") : Tr::tr("Alt+I,Alt+D"))); connect(m_diffFile, &QAction::triggered, this, &FossilPluginPrivate::diffCurrentFile); m_fossilContainer->addAction(command); m_commandLocator->appendCommand(command); - m_logFile = new Utils::ParameterAction(Tr::tr("Timeline Current File"), Tr::tr("Timeline \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); - command = Core::ActionManager::registerAction(m_logFile, Constants::LOG, context); - command->setAttribute(Core::Command::CA_UpdateText); + m_logFile = new ParameterAction(Tr::tr("Timeline Current File"), Tr::tr("Timeline \"%1\""), + ParameterAction::EnabledWithParameter, this); + command = ActionManager::registerAction(m_logFile, Constants::LOG, context); + command->setAttribute(Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+I,Meta+L") : Tr::tr("Alt+I,Alt+L"))); connect(m_logFile, &QAction::triggered, this, &FossilPluginPrivate::logCurrentFile); m_fossilContainer->addAction(command); m_commandLocator->appendCommand(command); - m_statusFile = new Utils::ParameterAction(Tr::tr("Status Current File"), Tr::tr("Status \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); - command = Core::ActionManager::registerAction(m_statusFile, Constants::STATUS, context); - command->setAttribute(Core::Command::CA_UpdateText); + m_statusFile = new ParameterAction(Tr::tr("Status Current File"), Tr::tr("Status \"%1\""), + ParameterAction::EnabledWithParameter, this); + command = ActionManager::registerAction(m_statusFile, Constants::STATUS, context); + command->setAttribute(Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+I,Meta+S") : Tr::tr("Alt+I,Alt+S"))); connect(m_statusFile, &QAction::triggered, this, &FossilPluginPrivate::statusCurrentFile); @@ -358,23 +358,26 @@ void FossilPluginPrivate::createFileActions(const Core::Context &context) m_fossilContainer->addSeparator(context); - m_addAction = new Utils::ParameterAction(Tr::tr("Add Current File"), Tr::tr("Add \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); - command = Core::ActionManager::registerAction(m_addAction, Constants::ADD, context); - command->setAttribute(Core::Command::CA_UpdateText); + m_addAction = new ParameterAction(Tr::tr("Add Current File"), Tr::tr("Add \"%1\""), + ParameterAction::EnabledWithParameter, this); + command = ActionManager::registerAction(m_addAction, Constants::ADD, context); + command->setAttribute(Command::CA_UpdateText); connect(m_addAction, &QAction::triggered, this, &FossilPluginPrivate::addCurrentFile); m_fossilContainer->addAction(command); m_commandLocator->appendCommand(command); - m_deleteAction = new Utils::ParameterAction(Tr::tr("Delete Current File..."), Tr::tr("Delete \"%1\"..."), Utils::ParameterAction::EnabledWithParameter, this); - command = Core::ActionManager::registerAction(m_deleteAction, Constants::DELETE, context); - command->setAttribute(Core::Command::CA_UpdateText); + m_deleteAction = new ParameterAction(Tr::tr("Delete Current File..."), Tr::tr("Delete \"%1\"..."), + ParameterAction::EnabledWithParameter, this); + command = ActionManager::registerAction(m_deleteAction, Constants::DELETE, context); + command->setAttribute(Command::CA_UpdateText); connect(m_deleteAction, &QAction::triggered, this, &FossilPluginPrivate::deleteCurrentFile); m_fossilContainer->addAction(command); m_commandLocator->appendCommand(command); - m_revertFile = new Utils::ParameterAction(Tr::tr("Revert Current File..."), Tr::tr("Revert \"%1\"..."), Utils::ParameterAction::EnabledWithParameter, this); - command = Core::ActionManager::registerAction(m_revertFile, Constants::REVERT, context); - command->setAttribute(Core::Command::CA_UpdateText); + m_revertFile = new ParameterAction(Tr::tr("Revert Current File..."), Tr::tr("Revert \"%1\"..."), + ParameterAction::EnabledWithParameter, this); + command = ActionManager::registerAction(m_revertFile, Constants::REVERT, context); + command->setAttribute(Command::CA_UpdateText); connect(m_revertFile, &QAction::triggered, this, &FossilPluginPrivate::revertCurrentFile); m_fossilContainer->addAction(command); m_commandLocator->appendCommand(command); @@ -382,7 +385,7 @@ void FossilPluginPrivate::createFileActions(const Core::Context &context) void FossilPluginPrivate::addCurrentFile() { - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); m_client.synchronousAdd(state.currentFileTopLevel(), state.relativeCurrentFile()); } @@ -394,22 +397,22 @@ void FossilPluginPrivate::deleteCurrentFile() void FossilPluginPrivate::annotateCurrentFile() { - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); - const int lineNumber = VcsBase::VcsBaseEditor::lineNumberOfCurrentEditor(state.currentFile()); + const int lineNumber = VcsBaseEditor::lineNumberOfCurrentEditor(state.currentFile()); m_client.annotate(state.currentFileTopLevel(), state.relativeCurrentFile(), lineNumber); } void FossilPluginPrivate::diffCurrentFile() { - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); m_client.diff(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile())); } void FossilPluginPrivate::logCurrentFile() { - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); FossilClient::SupportedFeatures features = m_client.supportedFeatures(); QStringList extraOptions; @@ -427,10 +430,10 @@ void FossilPluginPrivate::logCurrentFile() void FossilPluginPrivate::revertCurrentFile() { - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); - RevertDialog dialog(Tr::tr("Revert"), Core::ICore::dialogParent()); + RevertDialog dialog(Tr::tr("Revert"), ICore::dialogParent()); if (dialog.exec() == QDialog::Accepted) { m_client.revertFile(state.currentFileTopLevel(), state.relativeCurrentFile(), dialog.revision()); @@ -439,26 +442,26 @@ void FossilPluginPrivate::revertCurrentFile() void FossilPluginPrivate::statusCurrentFile() { - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); m_client.status(state.currentFileTopLevel(), state.relativeCurrentFile()); } -void FossilPluginPrivate::createDirectoryActions(const Core::Context &context) +void FossilPluginPrivate::createDirectoryActions(const Context &context) { QAction *action; - Core::Command *command; + Command *command; action = new QAction(Tr::tr("Diff"), this); m_repositoryActionList.append(action); - command = Core::ActionManager::registerAction(action, Constants::DIFFMULTI, context); + command = ActionManager::registerAction(action, Constants::DIFFMULTI, context); connect(action, &QAction::triggered, this, &FossilPluginPrivate::diffRepository); m_fossilContainer->addAction(command); m_commandLocator->appendCommand(command); action = new QAction(Tr::tr("Timeline"), this); m_repositoryActionList.append(action); - command = Core::ActionManager::registerAction(action, Constants::LOGMULTI, context); + command = ActionManager::registerAction(action, Constants::LOGMULTI, context); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+I,Meta+T") : Tr::tr("Alt+I,Alt+T"))); connect(action, &QAction::triggered, this, &FossilPluginPrivate::logRepository); @@ -467,14 +470,14 @@ void FossilPluginPrivate::createDirectoryActions(const Core::Context &context) action = new QAction(Tr::tr("Revert..."), this); m_repositoryActionList.append(action); - command = Core::ActionManager::registerAction(action, Constants::REVERTMULTI, context); + command = ActionManager::registerAction(action, Constants::REVERTMULTI, context); connect(action, &QAction::triggered, this, &FossilPluginPrivate::revertAll); m_fossilContainer->addAction(command); m_commandLocator->appendCommand(command); action = new QAction(Tr::tr("Status"), this); m_repositoryActionList.append(action); - command = Core::ActionManager::registerAction(action, Constants::STATUSMULTI, context); + command = ActionManager::registerAction(action, Constants::STATUSMULTI, context); connect(action, &QAction::triggered, this, &FossilPluginPrivate::statusMulti); m_fossilContainer->addAction(command); m_commandLocator->appendCommand(command); @@ -483,14 +486,14 @@ void FossilPluginPrivate::createDirectoryActions(const Core::Context &context) void FossilPluginPrivate::diffRepository() { - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); m_client.diff(state.topLevel()); } void FossilPluginPrivate::logRepository() { - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); FossilClient::SupportedFeatures features = m_client.supportedFeatures(); QStringList extraOptions; @@ -504,43 +507,43 @@ void FossilPluginPrivate::logRepository() void FossilPluginPrivate::revertAll() { - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - RevertDialog dialog(Tr::tr("Revert"), Core::ICore::dialogParent()); + RevertDialog dialog(Tr::tr("Revert"), ICore::dialogParent()); if (dialog.exec() == QDialog::Accepted) m_client.revertAll(state.topLevel(), dialog.revision()); } void FossilPluginPrivate::statusMulti() { - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); m_client.status(state.topLevel()); } -void FossilPluginPrivate::createRepositoryActions(const Core::Context &context) +void FossilPluginPrivate::createRepositoryActions(const Context &context) { QAction *action = 0; - Core::Command *command = 0; + Command *command = 0; action = new QAction(Tr::tr("Pull..."), this); m_repositoryActionList.append(action); - command = Core::ActionManager::registerAction(action, Constants::PULL, context); + command = ActionManager::registerAction(action, Constants::PULL, context); connect(action, &QAction::triggered, this, &FossilPluginPrivate::pull); m_fossilContainer->addAction(command); m_commandLocator->appendCommand(command); action = new QAction(Tr::tr("Push..."), this); m_repositoryActionList.append(action); - command = Core::ActionManager::registerAction(action, Constants::PUSH, context); + command = ActionManager::registerAction(action, Constants::PUSH, context); connect(action, &QAction::triggered, this, &FossilPluginPrivate::push); m_fossilContainer->addAction(command); m_commandLocator->appendCommand(command); action = new QAction(Tr::tr("Update..."), this); m_repositoryActionList.append(action); - command = Core::ActionManager::registerAction(action, Constants::UPDATE, context); + command = ActionManager::registerAction(action, Constants::UPDATE, context); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+I,Meta+U") : Tr::tr("Alt+I,Alt+U"))); connect(action, &QAction::triggered, this, &FossilPluginPrivate::update); @@ -549,7 +552,7 @@ void FossilPluginPrivate::createRepositoryActions(const Core::Context &context) action = new QAction(Tr::tr("Commit..."), this); m_repositoryActionList.append(action); - command = Core::ActionManager::registerAction(action, Constants::COMMIT, context); + command = ActionManager::registerAction(action, Constants::COMMIT, context); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+I,Meta+C") : Tr::tr("Alt+I,Alt+C"))); connect(action, &QAction::triggered, this, &FossilPluginPrivate::commit); @@ -558,7 +561,7 @@ void FossilPluginPrivate::createRepositoryActions(const Core::Context &context) action = new QAction(Tr::tr("Settings..."), this); m_repositoryActionList.append(action); - command = Core::ActionManager::registerAction(action, Constants::CONFIGURE_REPOSITORY, context); + command = ActionManager::registerAction(action, Constants::CONFIGURE_REPOSITORY, context); connect(action, &QAction::triggered, this, &FossilPluginPrivate::configureRepository); m_fossilContainer->addAction(command); m_commandLocator->appendCommand(command); @@ -566,7 +569,7 @@ void FossilPluginPrivate::createRepositoryActions(const Core::Context &context) // Register "Create Repository..." action in global context, so that it's visible // without active repository to allow creating a new one. m_createRepositoryAction = new QAction(Tr::tr("Create Repository..."), this); - command = Core::ActionManager::registerAction(m_createRepositoryAction, Constants::CREATE_REPOSITORY); + command = ActionManager::registerAction(m_createRepositoryAction, Constants::CREATE_REPOSITORY); connect(m_createRepositoryAction, &QAction::triggered, this, &FossilPluginPrivate::createRepository); m_fossilContainer->addAction(command); } @@ -585,10 +588,10 @@ bool FossilPluginPrivate::pullOrPush(FossilPluginPrivate::SyncMode mode) return false; } - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return false); - PullOrPushDialog dialog(pullOrPushMode, Core::ICore::dialogParent()); + PullOrPushDialog dialog(pullOrPushMode, ICore::dialogParent()); dialog.setLocalBaseDirectory(m_client.settings().defaultRepoPath()); const QString defaultURL(m_client.synchronousGetRepositoryURL(state.topLevel())); dialog.setDefaultRemoteLocation(defaultURL); @@ -597,7 +600,7 @@ bool FossilPluginPrivate::pullOrPush(FossilPluginPrivate::SyncMode mode) QString remoteLocation(dialog.remoteLocation()); if (remoteLocation.isEmpty() && defaultURL.isEmpty()) { - VcsBase::VcsOutputWindow::appendError(Tr::tr("Remote repository is not defined.")); + VcsOutputWindow::appendError(Tr::tr("Remote repository is not defined.")); return false; } else if (remoteLocation == defaultURL) { remoteLocation.clear(); @@ -620,17 +623,17 @@ bool FossilPluginPrivate::pullOrPush(FossilPluginPrivate::SyncMode mode) void FossilPluginPrivate::update() { - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - RevertDialog dialog(Tr::tr("Update"), Core::ICore::dialogParent()); + RevertDialog dialog(Tr::tr("Update"), ICore::dialogParent()); if (dialog.exec() == QDialog::Accepted) m_client.update(state.topLevel(), dialog.revision()); } void FossilPluginPrivate::configureRepository() { - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); ConfigureDialog dialog; @@ -654,7 +657,7 @@ void FossilPluginPrivate::commit() if (raiseSubmitEditor()) return; - const VcsBase::VcsBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); m_submitRepository = state.topLevel(); @@ -662,36 +665,36 @@ void FossilPluginPrivate::commit() m_client.emitParsedStatus(m_submitRepository, {}); } -void FossilPluginPrivate::showCommitWidget(const QList<VcsBase::VcsBaseClient::StatusItem> &status) +void FossilPluginPrivate::showCommitWidget(const QList<VcsBaseClient::StatusItem> &status) { //Once we receive our data release the connection so it can be reused elsewhere disconnect(&m_client, &VcsBaseClient::parsedStatus, this, &FossilPluginPrivate::showCommitWidget); if (status.isEmpty()) { - VcsBase::VcsOutputWindow::appendError(Tr::tr("There are no changes to commit.")); + VcsOutputWindow::appendError(Tr::tr("There are no changes to commit.")); return; } // Start new temp file for commit message - Utils::TempFileSaver saver; + TempFileSaver saver; // Keep the file alive, else it removes self and forgets its name saver.setAutoRemove(false); if (!saver.finalize()) { - VcsBase::VcsOutputWindow::appendError(saver.errorString()); + VcsOutputWindow::appendError(saver.errorString()); return; } - Core::IEditor *editor = Core::EditorManager::openEditor(saver.filePath(), Constants::COMMIT_ID); + IEditor *editor = EditorManager::openEditor(saver.filePath(), Constants::COMMIT_ID); if (!editor) { - VcsBase::VcsOutputWindow::appendError(Tr::tr("Unable to create an editor for the commit.")); + VcsOutputWindow::appendError(Tr::tr("Unable to create an editor for the commit.")); return; } CommitEditor *commitEditor = qobject_cast<CommitEditor *>(editor); if (!commitEditor) { - VcsBase::VcsOutputWindow::appendError(Tr::tr("Unable to create a commit editor.")); + VcsOutputWindow::appendError(Tr::tr("Unable to create a commit editor.")); return; } setSubmitEditor(commitEditor); @@ -707,7 +710,7 @@ void FossilPluginPrivate::showCommitWidget(const QList<VcsBase::VcsBaseClient::S tags.removeAll(currentBranch.name); commitEditor->setFields(m_submitRepository, currentBranch, tags, currentUser, status); - connect(commitEditor, &VcsBase::VcsBaseSubmitEditor::diffSelectedFiles, + connect(commitEditor, &VcsBaseSubmitEditor::diffSelectedFiles, this, &FossilPluginPrivate::diffFromEditorSelected); commitEditor->setCheckScriptWorkingDirectory(m_submitRepository); } @@ -729,16 +732,16 @@ void FossilPluginPrivate::createRepository() // re-implemented from void VcsBasePlugin::createRepository() // Find current starting directory - Utils::FilePath directory; + FilePath directory; if (const ProjectExplorer::Project *currentProject = ProjectExplorer::ProjectTree::currentProject()) directory = currentProject->projectDirectory(); // Prompt for a directory that is not under version control yet - QWidget *mw = Core::ICore::dialogParent(); + QWidget *mw = ICore::dialogParent(); do { directory = FileUtils::getExistingDirectory(nullptr, Tr::tr("Choose Checkout Directory"), directory); if (directory.isEmpty()) return; - const Core::IVersionControl *managingControl = Core::VcsManager::findVersionControlForDirectory(directory); + const IVersionControl *managingControl = VcsManager::findVersionControlForDirectory(directory); if (managingControl == 0) break; const QString question = Tr::tr("The directory \"%1\" is already managed by a version control system (%2)." @@ -765,13 +768,13 @@ bool FossilPluginPrivate::activateCommit() { CommitEditor *commitEditor = qobject_cast<CommitEditor *>(submitEditor()); QTC_ASSERT(commitEditor, return true); - Core::IDocument *editorDocument = commitEditor->document(); + IDocument *editorDocument = commitEditor->document(); QTC_ASSERT(editorDocument, return true); QStringList files = commitEditor->checkedFiles(); if (!files.empty()) { //save the commit message - if (!Core::DocumentManager::saveDocument(editorDocument)) + if (!DocumentManager::saveDocument(editorDocument)) return false; //rewrite entries of the form 'file => newfile' to 'newfile' because @@ -811,7 +814,7 @@ bool FossilPluginPrivate::activateCommit() } -void FossilPluginPrivate::updateActions(VcsBase::VcsBasePluginPrivate::ActionState as) +void FossilPluginPrivate::updateActions(VcsBasePluginPrivate::ActionState as) { m_createRepositoryAction->setEnabled(true); @@ -885,14 +888,14 @@ bool FossilPluginPrivate::supportsOperation(Operation operation) const bool supported = isConfigured(); switch (operation) { - case Core::IVersionControl::AddOperation: - case Core::IVersionControl::DeleteOperation: - case Core::IVersionControl::MoveOperation: - case Core::IVersionControl::CreateRepositoryOperation: - case Core::IVersionControl::AnnotateOperation: - case Core::IVersionControl::InitialCheckoutOperation: + case IVersionControl::AddOperation: + case IVersionControl::DeleteOperation: + case IVersionControl::MoveOperation: + case IVersionControl::CreateRepositoryOperation: + case IVersionControl::AnnotateOperation: + case IVersionControl::InitialCheckoutOperation: break; - case Core::IVersionControl::SnapshotOperations: + case IVersionControl::SnapshotOperations: supported = false; break; } @@ -956,9 +959,9 @@ VcsCommand *FossilPluginPrivate::createInitialCheckoutCommand(const QString &sou // -- open/checkout an existing local fossil // Clone URL is an absolute local path and is the same as the local fossil. - const Utils::FilePath checkoutPath = baseDirectory.pathAppended(localName); + const FilePath checkoutPath = baseDirectory.pathAppended(localName); const QString fossilFile = options.value("fossil-file"); - const Utils::FilePath fossilFilePath = Utils::FilePath::fromUserInput(QDir::fromNativeSeparators(fossilFile)); + const FilePath fossilFilePath = FilePath::fromUserInput(QDir::fromNativeSeparators(fossilFile)); const QString fossilFileNative = fossilFilePath.toUserOutput(); const QFileInfo cloneRepository(fossilFilePath.toString()); @@ -990,7 +993,7 @@ VcsCommand *FossilPluginPrivate::createInitialCheckoutCommand(const QString &sou && !cloneRepository.exists()) { const QString sslIdentityFile = options.value("ssl-identity"); - const Utils::FilePath sslIdentityFilePath = Utils::FilePath::fromUserInput(QDir::fromNativeSeparators(sslIdentityFile)); + const FilePath sslIdentityFilePath = FilePath::fromUserInput(QDir::fromNativeSeparators(sslIdentityFile)); const bool includePrivate = (options.value("include-private") == "true"); QStringList extraOptions; @@ -1052,7 +1055,7 @@ void FossilPluginPrivate::changed(const QVariant &v) { switch (v.type()) { case QVariant::String: - emit repositoryChanged(Utils::FilePath::fromVariant(v)); + emit repositoryChanged(FilePath::fromVariant(v)); break; case QVariant::StringList: emit filesChanged(v.toStringList()); @@ -1132,7 +1135,7 @@ void Fossil::Internal::FossilPlugin::testDiffFileResolving_data() void Fossil::Internal::FossilPlugin::testDiffFileResolving() { - VcsBase::VcsBaseEditorWidget::testDiffFileResolving(dd->diffFactory); + VcsBaseEditorWidget::testDiffFileResolving(dd->diffFactory); } void Fossil::Internal::FossilPlugin::testLogResolving() @@ -1145,6 +1148,6 @@ void Fossil::Internal::FossilPlugin::testLogResolving() " EDITED src/core/scaler.cpp\n" " EDITED src/core/scaler.h\n" ); - VcsBase::VcsBaseEditorWidget::testLogResolving(dd->fileLogFactory, data, "ac6d1129b8", "56d6917c3b"); + VcsBaseEditorWidget::testLogResolving(dd->fileLogFactory, data, "ac6d1129b8", "56d6917c3b"); } #endif diff --git a/src/plugins/fossil/fossilplugin.h b/src/plugins/fossil/fossilplugin.h index 7297cd05ae9..033e22822c0 100644 --- a/src/plugins/fossil/fossilplugin.h +++ b/src/plugins/fossil/fossilplugin.h @@ -3,9 +3,7 @@ #pragma once -#include <vcsbase/vcsbaseclient.h> #include <vcsbase/vcsbaseplugin.h> -#include <coreplugin/icontext.h> namespace Fossil { namespace Internal { From 11127056194dba21af4fdc0140ac24ccb6a94387 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 3 Aug 2023 18:37:19 +0200 Subject: [PATCH 0610/1777] ClangFormat: Mention generator script in header warning Change-Id: Iaaeb7b35088e0f9e3e724aaca161894b8fee6ffb Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- scripts/generateClangFormatChecksLayout.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/generateClangFormatChecksLayout.py b/scripts/generateClangFormatChecksLayout.py index db28ddd6ec7..85bd82257cc 100755 --- a/scripts/generateClangFormatChecksLayout.py +++ b/scripts/generateClangFormatChecksLayout.py @@ -17,10 +17,10 @@ def parse_arguments(): def full_header_content(header_code): - return '''// Copyright (C) 2022 The Qt Company Ltd. + return '''// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT! +// THIS FILE IS AUTOMATICALLY GENERATED by generateClangFormatChecksLayout. DO NOT EDIT! #pragma once @@ -53,10 +53,10 @@ private: def full_source_content(source_code, layout_code): - return '''// Copyright (C) 2022 The Qt Company Ltd. + return '''// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT! +// THIS FILE IS AUTOMATICALLY GENERATED by generateClangFormatChecksLayout. DO NOT EDIT! #include "clangformatchecks.h" From f0e7ab6228cc03e55239ebb76c02a3132a37cde2 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 4 Aug 2023 18:47:35 +0200 Subject: [PATCH 0611/1777] UnixPtyProcess: Get rid of foreach Change-Id: I9ca9092c874960e63d6a29bcd11181bb571c3615 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/3rdparty/libptyqt/unixptyprocess.cpp | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/libs/3rdparty/libptyqt/unixptyprocess.cpp b/src/libs/3rdparty/libptyqt/unixptyprocess.cpp index 4c67ee28fb0..b40c8933ac7 100644 --- a/src/libs/3rdparty/libptyqt/unixptyprocess.cpp +++ b/src/libs/3rdparty/libptyqt/unixptyprocess.cpp @@ -184,34 +184,33 @@ bool UnixPtyProcess::startProcess(const QString &shellPath, m_readMasterNotify->disconnect(); }); - QStringList defaultVars; - - defaultVars.append("TERM=xterm-256color"); - defaultVars.append("ITERM_PROFILE=Default"); - defaultVars.append("XPC_FLAGS=0x0"); - defaultVars.append("XPC_SERVICE_NAME=0"); - defaultVars.append("LANG=en_US.UTF-8"); - defaultVars.append("LC_ALL=en_US.UTF-8"); - defaultVars.append("LC_CTYPE=UTF-8"); - defaultVars.append("INIT_CWD=" + QCoreApplication::applicationDirPath()); - defaultVars.append("COMMAND_MODE=unix2003"); - defaultVars.append("COLORTERM=truecolor"); + const QStringList defaultVars = { + "TERM=xterm-256color", + "ITERM_PROFILE=Default", + "XPC_FLAGS=0x0", + "XPC_SERVICE_NAME=0", + "LANG=en_US.UTF-8", + "LC_ALL=en_US.UTF-8", + "LC_CTYPE=UTF-8", + "INIT_CWD=" + QCoreApplication::applicationDirPath(), + "COMMAND_MODE=unix2003", + "COLORTERM=truecolor" + }; QStringList varNames; - foreach (QString line, environment) { + for (const QString &line : std::as_const(environment)) varNames.append(line.split("=").first()); - } //append default env vars only if they don't exists in current env - foreach (QString defVar, defaultVars) { + for (const QString &defVar : defaultVars) { if (!varNames.contains(defVar.split("=").first())) environment.append(defVar); } QProcessEnvironment envFormat; - foreach (QString line, environment) { + for (const QString &line : std::as_const(environment)) envFormat.insert(line.split("=").first(), line.split("=").last()); - } + m_shellProcess.setWorkingDirectory(workingDir); m_shellProcess.setProcessEnvironment(envFormat); m_shellProcess.setReadChannel(QProcess::StandardOutput); From 7946abce355082b125eabc6d1ee0447298c1652a Mon Sep 17 00:00:00 2001 From: Andre Hartmann <aha_1980@gmx.de> Date: Sat, 5 Aug 2023 13:31:43 +0200 Subject: [PATCH 0612/1777] Texteditor: Fix clazy-strict-iterators warning In line 860: `list.insert(it, elem);` textdocumentlayout.cpp:860:17: Mixing iterators with const_iterators [clazy-strict-iterators] Change-Id: I2a9413552a6060157efcea79f274fee11086d34e Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/texteditor/textdocumentlayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/textdocumentlayout.cpp b/src/plugins/texteditor/textdocumentlayout.cpp index a1a04e44479..9caa5e59532 100644 --- a/src/plugins/texteditor/textdocumentlayout.cpp +++ b/src/plugins/texteditor/textdocumentlayout.cpp @@ -856,7 +856,7 @@ bool Parenthesis::operator==(const Parenthesis &other) const void insertSorted(Parentheses &list, const Parenthesis &elem) { - const auto it = std::lower_bound(list.begin(), list.end(), elem, + const auto it = std::lower_bound(list.constBegin(), list.constEnd(), elem, [](const auto &p1, const auto &p2) { return p1.pos < p2.pos; }); list.insert(it, elem); } From bf5296292ab27763201c747ef7622384189cfbb4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 28 Jul 2023 17:12:21 +0200 Subject: [PATCH 0613/1777] Utils: Rename LabelPlacement::AtCheckBoxWithoutDummyLabel to Compact In BoolAspect. Felt a bit too descriptive by now. Change-Id: I0cf2eb88576da3d3741d146a8274cf8a85bc7c83 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 2 +- src/libs/utils/aspects.h | 2 +- src/plugins/autotest/boost/boosttestframework.cpp | 8 ++++---- src/plugins/autotest/ctest/ctesttool.cpp | 6 +++--- src/plugins/autotest/gtest/gtestframework.cpp | 10 +++++----- src/plugins/coreplugin/systemsettings.cpp | 14 +++++--------- 6 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index aee58f74fdd..2ec4bfe280f 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1612,7 +1612,7 @@ void BoolAspect::addToLayout(Layouting::LayoutItem &parent) d->m_button = createSubWidget<QCheckBox>(); } switch (d->m_labelPlacement) { - case LabelPlacement::AtCheckBoxWithoutDummyLabel: + case LabelPlacement::Compact: d->m_button->setText(labelText()); parent.addItem(d->m_button.data()); break; diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index c2acbc5041d..14bb3ed6f73 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -419,7 +419,7 @@ public: QAction *action() override; - enum class LabelPlacement { AtCheckBox, AtCheckBoxWithoutDummyLabel, InExtraLabel }; + enum class LabelPlacement { AtCheckBox, Compact, InExtraLabel }; void setLabel(const QString &labelText, LabelPlacement labelPlacement = LabelPlacement::InExtraLabel); void setLabelPlacement(LabelPlacement labelPlacement); diff --git a/src/plugins/autotest/boost/boosttestframework.cpp b/src/plugins/autotest/boost/boosttestframework.cpp index 546f124220d..28c1b001be9 100644 --- a/src/plugins/autotest/boost/boosttestframework.cpp +++ b/src/plugins/autotest/boost/boosttestframework.cpp @@ -77,22 +77,22 @@ BoostTestFramework::BoostTestFramework() seed.setEnabler(&randomize); randomize.setSettingsKey("Randomize"); - randomize.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + randomize.setLabelPlacement(BoolAspect::LabelPlacement::Compact); randomize.setLabelText(Tr::tr("Randomize")); randomize.setToolTip(Tr::tr("Randomize execution order.")); systemErrors.setSettingsKey("SystemErrors"); - systemErrors.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + systemErrors.setLabelPlacement(BoolAspect::LabelPlacement::Compact); systemErrors.setLabelText(Tr::tr("Catch system errors")); systemErrors.setToolTip(Tr::tr("Catch or ignore system errors.")); fpExceptions.setSettingsKey("FPExceptions"); - fpExceptions.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + fpExceptions.setLabelPlacement(BoolAspect::LabelPlacement::Compact); fpExceptions.setLabelText(Tr::tr("Floating point exceptions")); fpExceptions.setToolTip(Tr::tr("Enable floating point exception traps.")); memLeaks.setSettingsKey("MemoryLeaks"); - memLeaks.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + memLeaks.setLabelPlacement(BoolAspect::LabelPlacement::Compact); memLeaks.setDefaultValue(true); memLeaks.setLabelText(Tr::tr("Detect memory leaks")); memLeaks.setToolTip(Tr::tr("Enable memory leak detection.")); diff --git a/src/plugins/autotest/ctest/ctesttool.cpp b/src/plugins/autotest/ctest/ctesttool.cpp index c8274498d67..885191eea23 100644 --- a/src/plugins/autotest/ctest/ctesttool.cpp +++ b/src/plugins/autotest/ctest/ctesttool.cpp @@ -58,7 +58,7 @@ CTestTool::CTestTool() outputOnFail.setSettingsKey("OutputOnFail"); outputOnFail.setLabelText(Tr::tr("Output on failure")); - outputOnFail.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + outputOnFail.setLabelPlacement(BoolAspect::LabelPlacement::Compact); outputOnFail.setDefaultValue(true); outputMode.setSettingsKey("OutputMode"); @@ -85,11 +85,11 @@ CTestTool::CTestTool() scheduleRandom.setSettingsKey("ScheduleRandom"); scheduleRandom.setLabelText(Tr::tr("Schedule random")); - scheduleRandom.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + scheduleRandom.setLabelPlacement(BoolAspect::LabelPlacement::Compact); stopOnFailure.setSettingsKey("StopOnFail"); stopOnFailure.setLabelText(Tr::tr("Stop on failure")); - stopOnFailure.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + stopOnFailure.setLabelPlacement(BoolAspect::LabelPlacement::Compact); parallel.setSettingsKey("Parallel"); parallel.setToolTip(Tr::tr("Run tests in parallel mode using given number of jobs.")); diff --git a/src/plugins/autotest/gtest/gtestframework.cpp b/src/plugins/autotest/gtest/gtestframework.cpp index c046ad774c9..859fe38d376 100644 --- a/src/plugins/autotest/gtest/gtestframework.cpp +++ b/src/plugins/autotest/gtest/gtestframework.cpp @@ -64,29 +64,29 @@ GTestFramework::GTestFramework() runDisabled.setSettingsKey("RunDisabled"); runDisabled.setLabelText(Tr::tr("Run disabled tests")); - runDisabled.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + runDisabled.setLabelPlacement(BoolAspect::LabelPlacement::Compact); runDisabled.setToolTip(Tr::tr("Executes disabled tests when performing a test run.")); shuffle.setSettingsKey("Shuffle"); shuffle.setLabelText(Tr::tr("Shuffle tests")); - shuffle.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + shuffle.setLabelPlacement(BoolAspect::LabelPlacement::Compact); shuffle.setToolTip(Tr::tr("Shuffles tests automatically on every iteration by the given seed.")); repeat.setSettingsKey("Repeat"); repeat.setLabelText(Tr::tr("Repeat tests")); - repeat.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + repeat.setLabelPlacement(BoolAspect::LabelPlacement::Compact); repeat.setToolTip(Tr::tr("Repeats a test run (you might be required to increase the timeout to " "avoid canceling the tests).")); throwOnFailure.setSettingsKey("ThrowOnFailure"); throwOnFailure.setLabelText(Tr::tr("Throw on failure")); - throwOnFailure.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + throwOnFailure.setLabelPlacement(BoolAspect::LabelPlacement::Compact); throwOnFailure.setToolTip(Tr::tr("Turns assertion failures into C++ exceptions.")); breakOnFailure.setSettingsKey("BreakOnFailure"); breakOnFailure.setDefaultValue(true); breakOnFailure.setLabelText(Tr::tr("Break on failure while debugging")); - breakOnFailure.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + breakOnFailure.setLabelPlacement(BoolAspect::LabelPlacement::Compact); breakOnFailure.setToolTip(Tr::tr("Turns failures into debugger breakpoints.")); groupMode.setSettingsKey("GroupMode"); diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index fa474059f5f..1fbede37599 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -73,8 +73,7 @@ SystemSettings::SystemSettings() autoSaveModifiedFiles.setSettingsKey("EditorManager/AutoSaveEnabled"); autoSaveModifiedFiles.setDefaultValue(true); autoSaveModifiedFiles.setLabelText(Tr::tr("Auto-save modified files")); - autoSaveModifiedFiles.setLabelPlacement( - BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + autoSaveModifiedFiles.setLabelPlacement(BoolAspect::LabelPlacement::Compact); autoSaveModifiedFiles.setToolTip( Tr::tr("Automatically creates temporary copies of modified files. " "If %1 is restarted after a crash or power failure, it asks whether to " @@ -90,8 +89,7 @@ SystemSettings::SystemSettings() autoSaveAfterRefactoring.setSettingsKey("EditorManager/AutoSaveAfterRefactoring"); autoSaveAfterRefactoring.setDefaultValue(true); - autoSaveAfterRefactoring.setLabelPlacement( - BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + autoSaveAfterRefactoring.setLabelPlacement(BoolAspect::LabelPlacement::Compact); autoSaveAfterRefactoring.setLabelText(Tr::tr("Auto-save files after refactoring")); autoSaveAfterRefactoring.setToolTip( Tr::tr("Automatically saves all open files affected by a refactoring operation,\n" @@ -100,8 +98,7 @@ SystemSettings::SystemSettings() autoSuspendEnabled.setSettingsKey("EditorManager/AutoSuspendEnabled"); autoSuspendEnabled.setDefaultValue(true); autoSuspendEnabled.setLabelText(Tr::tr("Auto-suspend unmodified files")); - autoSuspendEnabled.setLabelPlacement( - BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + autoSuspendEnabled.setLabelPlacement(BoolAspect::LabelPlacement::Compact); autoSuspendEnabled.setToolTip( Tr::tr("Automatically free resources of old documents that are not visible and not " "modified. They stay visible in the list of open documents.")); @@ -117,8 +114,7 @@ SystemSettings::SystemSettings() warnBeforeOpeningBigFiles.setSettingsKey("EditorManager/WarnBeforeOpeningBigTextFiles"); warnBeforeOpeningBigFiles.setDefaultValue(true); - warnBeforeOpeningBigFiles.setLabelPlacement( - BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + warnBeforeOpeningBigFiles.setLabelPlacement(BoolAspect::LabelPlacement::Compact); warnBeforeOpeningBigFiles.setLabelText(Tr::tr("Warn before opening text files greater than")); bigFileSizeLimitInMB.setSettingsKey("EditorManager/BigTextFileSizeLimitInMB"); @@ -141,7 +137,7 @@ SystemSettings::SystemSettings() askBeforeExit.setSettingsKey("AskBeforeExit"); askBeforeExit.setLabelText(Tr::tr("Ask for confirmation before exiting")); - askBeforeExit.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + askBeforeExit.setLabelPlacement(BoolAspect::LabelPlacement::Compact); #ifdef ENABLE_CRASHPAD enableCrashReporting.setSettingsKey("CrashReportingEnabled"); From 2c56fa8084f28d27d0183b6428b0ab9c1594de48 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 28 Jul 2023 18:24:24 +0200 Subject: [PATCH 0614/1777] Autotest: Hide TestNavigationWidget implementation Also, de-Q_OBJECT-ify. Change-Id: I6e527bb36e9f38a702604f9c6c3923e62bf921c9 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/autotest/testnavigationwidget.cpp | 63 ++++++++++++++---- src/plugins/autotest/testnavigationwidget.h | 65 +------------------ 2 files changed, 51 insertions(+), 77 deletions(-) diff --git a/src/plugins/autotest/testnavigationwidget.cpp b/src/plugins/autotest/testnavigationwidget.cpp index 431f5a3af89..d7f26e655fa 100644 --- a/src/plugins/autotest/testnavigationwidget.cpp +++ b/src/plugins/autotest/testnavigationwidget.cpp @@ -6,6 +6,7 @@ #include "autotestconstants.h" #include "autotesticons.h" #include "autotesttr.h" +#include "itemdatacache.h" #include "testcodeparser.h" #include "testframeworkmanager.h" #include "testrunner.h" @@ -25,6 +26,7 @@ #include <utils/algorithm.h> #include <utils/link.h> +#include <utils/navigationtreeview.h> #include <utils/progressindicator.h> #include <utils/stylehelper.h> #include <utils/utilsicons.h> @@ -35,13 +37,45 @@ #include <QToolButton> #include <QVBoxLayout> +using namespace Core; using namespace Utils; -namespace Autotest { -namespace Internal { +namespace Autotest::Internal { -TestNavigationWidget::TestNavigationWidget(QWidget *parent) : - QWidget(parent) +class TestNavigationWidget : public QWidget +{ +public: + TestNavigationWidget(); + + void contextMenuEvent(QContextMenuEvent *event) override; + QList<QToolButton *> createToolButtons(); + + void updateExpandedStateCache(); + +private: + void onItemActivated(const QModelIndex &index); + void onSortClicked(); + void onFilterMenuTriggered(QAction *action); + void onParsingStarted(); + void onParsingFinished(); + void initializeFilterMenu(); + void onRunThisTestTriggered(TestRunMode runMode); + void reapplyCachedExpandedState(); + + TestTreeModel *m_model; + TestTreeSortFilterModel *m_sortFilterModel; + TestTreeView *m_view; + QToolButton *m_sort; + QToolButton *m_filterButton; + QMenu *m_filterMenu; + bool m_sortAlphabetically; + Utils::ProgressIndicator *m_progressIndicator; + QTimer *m_progressTimer; + QFrame *m_missingFrameworksWidget; + ItemDataCache<bool> m_expandedStateCache; +}; + +TestNavigationWidget::TestNavigationWidget() { setWindowTitle(Tr::tr("Tests")); m_model = TestTreeModel::instance(); @@ -68,7 +102,7 @@ TestNavigationWidget::TestNavigationWidget(QWidget *parent) : layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); layout->addWidget(m_missingFrameworksWidget); - layout->addWidget(Core::ItemViewFind::createSearchableWrapper(m_view)); + layout->addWidget(ItemViewFind::createSearchableWrapper(m_view)); setLayout(layout); connect(m_view, &TestTreeView::activated, this, &TestNavigationWidget::onItemActivated); @@ -150,14 +184,14 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event) } } - QAction *runAll = Core::ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action(); - QAction *runSelected = Core::ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action(); - QAction *runAllNoDeploy = Core::ActionManager::command(Constants::ACTION_RUN_ALL_NODEPLOY_ID)->action(); - QAction *runSelectedNoDeploy = Core::ActionManager::command(Constants::ACTION_RUN_SELECTED_NODEPLOY_ID)->action(); + QAction *runAll = ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action(); + QAction *runSelected = ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action(); + QAction *runAllNoDeploy = ActionManager::command(Constants::ACTION_RUN_ALL_NODEPLOY_ID)->action(); + QAction *runSelectedNoDeploy = ActionManager::command(Constants::ACTION_RUN_SELECTED_NODEPLOY_ID)->action(); QAction *selectAll = new QAction(Tr::tr("Select All"), &menu); QAction *deselectAll = new QAction(Tr::tr("Deselect All"), &menu); // TODO remove? - QAction *rescan = Core::ActionManager::command(Constants::ACTION_SCAN_ID)->action(); + QAction *rescan = ActionManager::command(Constants::ACTION_SCAN_ID)->action(); connect(selectAll, &QAction::triggered, m_view, &TestTreeView::selectAll); connect(deselectAll, &QAction::triggered, m_view, &TestTreeView::deselectAll); @@ -247,7 +281,7 @@ void TestNavigationWidget::onItemActivated(const QModelIndex &index) { const Link link = index.data(LinkRole).value<Link>(); if (link.hasValidTarget()) - Core::EditorManager::openEditorAt(link); + EditorManager::openEditorAt(link); } void TestNavigationWidget::onSortClicked() @@ -326,6 +360,8 @@ void TestNavigationWidget::reapplyCachedExpandedState() } } +// TestNavigationWidgetFactory + TestNavigationWidgetFactory::TestNavigationWidgetFactory() { setDisplayName(Tr::tr("Tests")); @@ -333,11 +369,10 @@ TestNavigationWidgetFactory::TestNavigationWidgetFactory() setPriority(666); } -Core::NavigationView TestNavigationWidgetFactory::createWidget() +NavigationView TestNavigationWidgetFactory::createWidget() { TestNavigationWidget *treeViewWidget = new TestNavigationWidget; return {treeViewWidget, treeViewWidget->createToolButtons()}; } -} // namespace Internal -} // namespace Autotest +} // Autotest::Internal diff --git a/src/plugins/autotest/testnavigationwidget.h b/src/plugins/autotest/testnavigationwidget.h index 53c2bb293d6..3b598a670fc 100644 --- a/src/plugins/autotest/testnavigationwidget.h +++ b/src/plugins/autotest/testnavigationwidget.h @@ -3,78 +3,17 @@ #pragma once -#include "itemdatacache.h" - #include <coreplugin/inavigationwidgetfactory.h> -#include <utils/navigationtreeview.h> - -QT_BEGIN_NAMESPACE -class QAction; -class QMenu; -class QTimer; -class QToolButton; -QT_END_NAMESPACE - -namespace Utils { -class ProgressIndicator; -} - -namespace Autotest { - -class TestTreeModel; - -namespace Internal { - -class TestRunner; -class TestTreeSortFilterModel; -class TestTreeView; - -class TestNavigationWidget : public QWidget -{ - Q_OBJECT - -public: - explicit TestNavigationWidget(QWidget *parent = nullptr); - void contextMenuEvent(QContextMenuEvent *event) override; - QList<QToolButton *> createToolButtons(); - - void updateExpandedStateCache(); - -private: - void onItemActivated(const QModelIndex &index); - void onSortClicked(); - void onFilterMenuTriggered(QAction *action); - void onParsingStarted(); - void onParsingFinished(); - void initializeFilterMenu(); - void onRunThisTestTriggered(TestRunMode runMode); - void reapplyCachedExpandedState(); - - TestTreeModel *m_model; - TestTreeSortFilterModel *m_sortFilterModel; - TestTreeView *m_view; - QToolButton *m_sort; - QToolButton *m_filterButton; - QMenu *m_filterMenu; - bool m_sortAlphabetically; - Utils::ProgressIndicator *m_progressIndicator; - QTimer *m_progressTimer; - QFrame *m_missingFrameworksWidget; - ItemDataCache<bool> m_expandedStateCache; -}; +namespace Autotest::Internal { class TestNavigationWidgetFactory : public Core::INavigationWidgetFactory { - Q_OBJECT - public: TestNavigationWidgetFactory(); private: Core::NavigationView createWidget() override; - }; -} // namespace Internal -} // namespace Autotest +} // Autotest::Internal From 68fbfe671c7c8f520c652a8050a2f7680cb40853 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 28 Jul 2023 18:30:38 +0200 Subject: [PATCH 0615/1777] Ios: Merge settings page related file pairs [1/2] Move all to *widget.cpp, to keep the diff small. Will be renamed in step #2 to *page.cpp again. Change-Id: I391e4c823d796f5af0970067642e1b3eaec2637e Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/ios/CMakeLists.txt | 1 - src/plugins/ios/ios.qbs | 2 -- src/plugins/ios/iosplugin.cpp | 2 +- src/plugins/ios/iossettingspage.cpp | 22 -------------- src/plugins/ios/iossettingspage.h | 16 ---------- src/plugins/ios/iossettingswidget.cpp | 43 ++++++++++++++++++++++++++- src/plugins/ios/iossettingswidget.h | 35 ++-------------------- 7 files changed, 45 insertions(+), 76 deletions(-) delete mode 100644 src/plugins/ios/iossettingspage.cpp delete mode 100644 src/plugins/ios/iossettingspage.h diff --git a/src/plugins/ios/CMakeLists.txt b/src/plugins/ios/CMakeLists.txt index ebfaa6fc69b..eaef034cc40 100644 --- a/src/plugins/ios/CMakeLists.txt +++ b/src/plugins/ios/CMakeLists.txt @@ -16,7 +16,6 @@ add_qtc_plugin(Ios iosqtversion.cpp iosqtversion.h iosrunconfiguration.cpp iosrunconfiguration.h iosrunner.cpp iosrunner.h - iossettingspage.cpp iossettingspage.h iossettingswidget.cpp iossettingswidget.h iossimulator.cpp iossimulator.h iostoolhandler.cpp iostoolhandler.h diff --git a/src/plugins/ios/ios.qbs b/src/plugins/ios/ios.qbs index ac4575c4e3d..721151afeb7 100644 --- a/src/plugins/ios/ios.qbs +++ b/src/plugins/ios/ios.qbs @@ -41,8 +41,6 @@ QtcPlugin { "iosrunconfiguration.h", "iosrunner.cpp", "iosrunner.h", - "iossettingspage.cpp", - "iossettingspage.h", "iossettingswidget.cpp", "iossettingswidget.h", "iossimulator.cpp", diff --git a/src/plugins/ios/iosplugin.cpp b/src/plugins/ios/iosplugin.cpp index 9f790aa17f9..f61bd55525f 100644 --- a/src/plugins/ios/iosplugin.cpp +++ b/src/plugins/ios/iosplugin.cpp @@ -12,7 +12,7 @@ #include "iosdsymbuildstep.h" #include "iosqtversion.h" #include "iosrunner.h" -#include "iossettingspage.h" +#include "iossettingswidget.h" #include "iossimulator.h" #include "iostoolhandler.h" #include "iostr.h" diff --git a/src/plugins/ios/iossettingspage.cpp b/src/plugins/ios/iossettingspage.cpp deleted file mode 100644 index 7a4f306f659..00000000000 --- a/src/plugins/ios/iossettingspage.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "iossettingspage.h" - -#include "iosconstants.h" -#include "iossettingswidget.h" -#include "iostr.h" - -#include <projectexplorer/projectexplorerconstants.h> - -namespace Ios::Internal { - -IosSettingsPage::IosSettingsPage() -{ - setId(Constants::IOS_SETTINGS_ID); - setDisplayName(Tr::tr("iOS")); - setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY); - setWidgetCreator([] { return new IosSettingsWidget; }); -} - -} // Ios::Internal diff --git a/src/plugins/ios/iossettingspage.h b/src/plugins/ios/iossettingspage.h deleted file mode 100644 index b58d8bfb8c6..00000000000 --- a/src/plugins/ios/iossettingspage.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <coreplugin/dialogs/ioptionspage.h> - -namespace Ios::Internal { - -class IosSettingsPage final : public Core::IOptionsPage -{ -public: - IosSettingsPage(); -}; - -} // Ios::Internal diff --git a/src/plugins/ios/iossettingswidget.cpp b/src/plugins/ios/iossettingswidget.cpp index bb0bc36d61a..c131de0bac7 100644 --- a/src/plugins/ios/iossettingswidget.cpp +++ b/src/plugins/ios/iossettingswidget.cpp @@ -5,12 +5,14 @@ #include "createsimulatordialog.h" #include "iosconfigurations.h" -#include "iosconfigurations.h" +#include "iosconstants.h" #include "iostr.h" #include "simulatorcontrol.h" #include "simulatorinfomodel.h" #include "simulatoroperationdialog.h" +#include <projectexplorer/projectexplorerconstants.h> + #include <utils/algorithm.h> #include <utils/async.h> #include <utils/layoutbuilder.h> @@ -32,6 +34,35 @@ using namespace std::placeholders; namespace Ios::Internal { +class IosSettingsWidget final : public Core::IOptionsPageWidget +{ +public: + IosSettingsWidget(); + ~IosSettingsWidget() final; + +private: + void apply() final; + + void saveSettings(); + + void onStart(); + void onCreate(); + void onReset(); + void onRename(); + void onDelete(); + void onScreenshot(); + void onSelectionChanged(); + +private: + Utils::PathChooser *m_pathWidget; + QPushButton *m_startButton; + QPushButton *m_renameButton; + QPushButton *m_deleteButton; + QPushButton *m_resetButton; + QTreeView *m_deviceView; + QCheckBox *m_deviceAskCheckBox; +}; + const int simStartWarnCount = 4; static SimulatorInfoList selectedSimulators(const QTreeView *deviceTreeView) @@ -358,5 +389,15 @@ void IosSettingsWidget::saveSettings() IosConfigurations::setScreenshotDir(m_pathWidget->filePath()); } +// IosSettingsPage + +IosSettingsPage::IosSettingsPage() +{ + setId(Constants::IOS_SETTINGS_ID); + setDisplayName(Tr::tr("iOS")); + setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY); + setWidgetCreator([] { return new IosSettingsWidget; }); +} + } // Ios::Internal diff --git a/src/plugins/ios/iossettingswidget.h b/src/plugins/ios/iossettingswidget.h index 6d315db6906..7617f08207e 100644 --- a/src/plugins/ios/iossettingswidget.h +++ b/src/plugins/ios/iossettingswidget.h @@ -5,43 +5,12 @@ #include <coreplugin/dialogs/ioptionspage.h> -QT_BEGIN_NAMESPACE -class QCheckBox; -class QPushButton; -class QTreeView; -QT_END_NAMESPACE - -namespace Utils { class PathChooser; } - namespace Ios::Internal { -class IosSettingsWidget final : public Core::IOptionsPageWidget +class IosSettingsPage final : public Core::IOptionsPage { public: - IosSettingsWidget(); - ~IosSettingsWidget() final; - -private: - void apply() final; - - void saveSettings(); - - void onStart(); - void onCreate(); - void onReset(); - void onRename(); - void onDelete(); - void onScreenshot(); - void onSelectionChanged(); - -private: - Utils::PathChooser *m_pathWidget; - QPushButton *m_startButton; - QPushButton *m_renameButton; - QPushButton *m_deleteButton; - QPushButton *m_resetButton; - QTreeView *m_deviceView; - QCheckBox *m_deviceAskCheckBox; + IosSettingsPage(); }; } // Ios::Internal From e421ca97a17d0e6e3474333d1b7962e31ae487e0 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 3 Aug 2023 13:29:44 +0200 Subject: [PATCH 0616/1777] TextEditor: Introduce dedicated comments settings page We will soon add more comments settings. Change-Id: I91798b9d1071acefda70db523dcc72fdc2480cd7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/cppeditor/cppdoxygen_test.cpp | 10 +- src/plugins/cppeditor/cppdoxygen_test.h | 4 +- src/plugins/cppeditor/cppeditorwidget.cpp | 14 +- src/plugins/cppeditor/cpptoolssettings.cpp | 6 +- src/plugins/cppeditor/cpptoolssettings.h | 6 +- src/plugins/texteditor/commentssettings.cpp | 140 +++++++++++++++--- src/plugins/texteditor/commentssettings.h | 44 ++++-- .../texteditor/completionsettingspage.cpp | 53 +------ .../texteditor/completionsettingspage.h | 3 - src/plugins/texteditor/texteditorsettings.cpp | 6 +- src/plugins/texteditor/texteditorsettings.h | 5 +- 11 files changed, 182 insertions(+), 109 deletions(-) diff --git a/src/plugins/cppeditor/cppdoxygen_test.cpp b/src/plugins/cppeditor/cppdoxygen_test.cpp index d784c008c91..ad4f44c9efb 100644 --- a/src/plugins/cppeditor/cppdoxygen_test.cpp +++ b/src/plugins/cppeditor/cppdoxygen_test.cpp @@ -393,9 +393,9 @@ void DoxygenTest::testNoLeadingAsterisks() QFETCH(QByteArray, given); QFETCH(QByteArray, expected); - TextEditor::CommentsSettings injection; - injection.m_enableDoxygen = true; - injection.m_leadingAsterisks = false; + TextEditor::CommentsSettings::Data injection; + injection.enableDoxygen = true; + injection.leadingAsterisks = false; runTest(given, expected, &injection); } @@ -410,7 +410,7 @@ void DoxygenTest::verifyCleanState() const /// The '|' in the input denotes the cursor position. void DoxygenTest::runTest(const QByteArray &original, const QByteArray &expected, - TextEditor::CommentsSettings *settings, + TextEditor::CommentsSettings::Data *settings, const TestDocuments &includedHeaderDocuments) { // Write files to disk @@ -434,7 +434,7 @@ void DoxygenTest::runTest(const QByteArray &original, &testDocument.m_editorWidget)); if (settings) { - oldSettings.reset(new TextEditor::CommentsSettings(CppToolsSettings::commentsSettings())); + oldSettings.reset(new TextEditor::CommentsSettings::Data(CppToolsSettings::commentsSettings())); CppToolsSettings::setCommentsSettings(*settings); } diff --git a/src/plugins/cppeditor/cppdoxygen_test.h b/src/plugins/cppeditor/cppdoxygen_test.h index 8a323a526c9..362bf925cd1 100644 --- a/src/plugins/cppeditor/cppdoxygen_test.h +++ b/src/plugins/cppeditor/cppdoxygen_test.h @@ -36,10 +36,10 @@ private: void verifyCleanState() const; void runTest(const QByteArray &original, const QByteArray &expected, - TextEditor::CommentsSettings *settings = 0, + TextEditor::CommentsSettings::Data *settings = 0, const TestDocuments &includedHeaderDocuments = TestDocuments()); - QScopedPointer<TextEditor::CommentsSettings> oldSettings; + QScopedPointer<TextEditor::CommentsSettings::Data> oldSettings; }; } // namespace Tests diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index f7305ff85f0..563d65a304c 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -307,8 +307,8 @@ bool handleDoxygenContinuation(QTextCursor &cursor, static bool trySplitComment(TextEditor::TextEditorWidget *editorWidget, const CPlusPlus::Snapshot &snapshot) { - const TextEditor::CommentsSettings &settings = CppToolsSettings::instance()->commentsSettings(); - if (!settings.m_enableDoxygen && !settings.m_leadingAsterisks) + const TextEditor::CommentsSettings::Data &settings = CppToolsSettings::instance()->commentsSettings(); + if (!settings.enableDoxygen && !settings.leadingAsterisks) return false; if (editorWidget->multiTextCursor().hasMultipleCursors()) @@ -325,7 +325,7 @@ static bool trySplitComment(TextEditor::TextEditorWidget *editorWidget, // enter. If leading asterisk(s) is set we need to write a comment continuation // with those. - if (settings.m_enableDoxygen && cursor.positionInBlock() >= 3) { + if (settings.enableDoxygen && cursor.positionInBlock() >= 3) { const int pos = cursor.position(); if (isStartOfDoxygenComment(cursor)) { QTextDocument *textDocument = editorWidget->document(); @@ -340,8 +340,8 @@ static bool trySplitComment(TextEditor::TextEditorWidget *editorWidget, DoxygenGenerator doxygen; doxygen.setStyle(style); - doxygen.setAddLeadingAsterisks(settings.m_leadingAsterisks); - doxygen.setGenerateBrief(settings.m_generateBrief); + doxygen.setAddLeadingAsterisks(settings.leadingAsterisks); + doxygen.setGenerateBrief(settings.generateBrief); doxygen.setStartComment(false); // Move until we reach any possibly meaningful content. @@ -369,8 +369,8 @@ static bool trySplitComment(TextEditor::TextEditorWidget *editorWidget, return handleDoxygenContinuation(cursor, editorWidget, - settings.m_enableDoxygen, - settings.m_leadingAsterisks); + settings.enableDoxygen, + settings.leadingAsterisks); } } // anonymous namespace diff --git a/src/plugins/cppeditor/cpptoolssettings.cpp b/src/plugins/cppeditor/cpptoolssettings.cpp index abc0558e069..d0aa6d9159d 100644 --- a/src/plugins/cppeditor/cpptoolssettings.cpp +++ b/src/plugins/cppeditor/cpptoolssettings.cpp @@ -33,7 +33,7 @@ namespace Internal { class CppToolsSettingsPrivate { public: - CommentsSettings m_commentsSettings; + CommentsSettings::Data m_commentsSettings; CppCodeStylePreferences *m_globalCodeStyle = nullptr; }; @@ -164,12 +164,12 @@ CppCodeStylePreferences *CppToolsSettings::cppCodeStyle() return d->m_globalCodeStyle; } -const CommentsSettings &CppToolsSettings::commentsSettings() +const CommentsSettings::Data &CppToolsSettings::commentsSettings() { return d->m_commentsSettings; } -void CppToolsSettings::setCommentsSettings(const CommentsSettings &commentsSettings) +void CppToolsSettings::setCommentsSettings(const CommentsSettings::Data &commentsSettings) { d->m_commentsSettings = commentsSettings; } diff --git a/src/plugins/cppeditor/cpptoolssettings.h b/src/plugins/cppeditor/cpptoolssettings.h index b95b9b2569c..910bae75050 100644 --- a/src/plugins/cppeditor/cpptoolssettings.h +++ b/src/plugins/cppeditor/cpptoolssettings.h @@ -5,6 +5,8 @@ #include "cppeditor_global.h" +#include <texteditor/texteditorsettings.h> + #include <QObject> namespace TextEditor { class CommentsSettings; } @@ -25,8 +27,8 @@ public: static CppCodeStylePreferences *cppCodeStyle(); - static const TextEditor::CommentsSettings &commentsSettings(); - static void setCommentsSettings(const TextEditor::CommentsSettings &commentsSettings); + static const TextEditor::CommentsSettings::Data &commentsSettings(); + static void setCommentsSettings(const TextEditor::CommentsSettings::Data &commentsSettings); static bool sortedEditorDocumentOutline(); static void setSortedEditorDocumentOutline(bool sorted); diff --git a/src/plugins/texteditor/commentssettings.cpp b/src/plugins/texteditor/commentssettings.cpp index 4585d358499..041ca3e15c4 100644 --- a/src/plugins/texteditor/commentssettings.cpp +++ b/src/plugins/texteditor/commentssettings.cpp @@ -3,46 +3,148 @@ #include "commentssettings.h" +#include "texteditorconstants.h" +#include "texteditorsettings.h" +#include "texteditortr.h" + +#include <coreplugin/icore.h> +#include <utils/layoutbuilder.h> + +#include <QCheckBox> #include <QSettings> -using namespace TextEditor; +using namespace Layouting; + +namespace TextEditor { namespace { - const char kDocumentationCommentsGroup[] = "CppToolsDocumentationComments"; const char kEnableDoxygenBlocks[] = "EnableDoxygenBlocks"; const char kGenerateBrief[] = "GenerateBrief"; const char kAddLeadingAsterisks[] = "AddLeadingAsterisks"; +} +bool operator==(const CommentsSettings::Data &a, const CommentsSettings::Data &b) +{ + return a.enableDoxygen == b.enableDoxygen + && a.generateBrief == b.generateBrief + && a.leadingAsterisks == b.leadingAsterisks; +} + +void CommentsSettings::setData(const Data &data) +{ + if (data == instance().m_data) + return; + instance().m_data = data; + instance().save(); + emit TextEditorSettings::instance()->commentsSettingsChanged(data); } CommentsSettings::CommentsSettings() - : m_enableDoxygen(true) - , m_generateBrief(true) - , m_leadingAsterisks(true) -{} - -void CommentsSettings::toSettings(QSettings *s) const { + load(); +} + +CommentsSettings &CommentsSettings::instance() +{ + static CommentsSettings settings; + return settings; +} + +void CommentsSettings::save() const +{ + Utils::QtcSettings * const s = Core::ICore::settings(); s->beginGroup(kDocumentationCommentsGroup); - s->setValue(kEnableDoxygenBlocks, m_enableDoxygen); - s->setValue(kGenerateBrief, m_generateBrief); - s->setValue(kAddLeadingAsterisks, m_leadingAsterisks); + s->setValue(kEnableDoxygenBlocks, m_data.enableDoxygen); + s->setValue(kGenerateBrief, m_data.generateBrief); + s->setValue(kAddLeadingAsterisks, m_data.leadingAsterisks); s->endGroup(); } -void CommentsSettings::fromSettings(QSettings *s) +void CommentsSettings::load() { + Utils::QtcSettings * const s = Core::ICore::settings(); s->beginGroup(kDocumentationCommentsGroup); - m_enableDoxygen = s->value(kEnableDoxygenBlocks, true).toBool(); - m_generateBrief = m_enableDoxygen && s->value(kGenerateBrief, true).toBool(); - m_leadingAsterisks = s->value(kAddLeadingAsterisks, true).toBool(); + m_data.enableDoxygen = s->value(kEnableDoxygenBlocks, true).toBool(); + m_data.generateBrief = m_data.enableDoxygen && s->value(kGenerateBrief, true).toBool(); + m_data.leadingAsterisks = s->value(kAddLeadingAsterisks, true).toBool(); s->endGroup(); } -bool CommentsSettings::equals(const CommentsSettings &other) const +namespace Internal { + +class CommentsSettingsWidget final : public Core::IOptionsPageWidget { - return m_enableDoxygen == other.m_enableDoxygen - && m_generateBrief == other.m_generateBrief - && m_leadingAsterisks == other.m_leadingAsterisks; +public: + explicit CommentsSettingsWidget() + { + initFromSettings(); + + m_enableDoxygenCheckBox.setText(Tr::tr("Enable Doxygen blocks")); + m_enableDoxygenCheckBox.setToolTip( + Tr::tr("Automatically creates a Doxygen comment upon pressing " + "enter after a '/**', '/*!', '//!' or '///'.")); + + m_generateBriefCheckBox.setText(Tr::tr("Generate brief description")); + m_generateBriefCheckBox.setToolTip( + Tr::tr("Generates a <i>brief</i> command with an initial " + "description for the corresponding declaration.")); + + m_leadingAsterisksCheckBox.setText(Tr::tr("Add leading asterisks")); + m_leadingAsterisksCheckBox.setToolTip( + Tr::tr("Adds leading asterisks when continuing C/C++ \"/*\", Qt \"/*!\" " + "and Java \"/**\" style comments on new lines.")); + + Column { + &m_enableDoxygenCheckBox, + Row { Space(30), &m_generateBriefCheckBox }, + &m_leadingAsterisksCheckBox, + st + }.attachTo(this); + + connect(&m_enableDoxygenCheckBox, &QCheckBox::toggled, + &m_generateBriefCheckBox, &QCheckBox::setEnabled); + } + +private: + void initFromSettings() + { + const CommentsSettings::Data &settings = CommentsSettings::data(); + m_enableDoxygenCheckBox.setChecked(settings.enableDoxygen); + m_generateBriefCheckBox.setEnabled(m_enableDoxygenCheckBox.isChecked()); + m_generateBriefCheckBox.setChecked(settings.generateBrief); + m_leadingAsterisksCheckBox.setChecked(settings.leadingAsterisks); + } + + CommentsSettings::Data toSettings() const + { + CommentsSettings::Data settings; + settings.enableDoxygen = m_enableDoxygenCheckBox.isChecked(); + settings.generateBrief = m_generateBriefCheckBox.isChecked(); + settings.leadingAsterisks = m_leadingAsterisksCheckBox.isChecked(); + return settings; + } + + void apply() override + { + CommentsSettings::setData(toSettings()); + } + + QCheckBox m_overwriteClosingChars; + QCheckBox m_enableDoxygenCheckBox; + QCheckBox m_generateBriefCheckBox; + QCheckBox m_leadingAsterisksCheckBox; +}; + +CommentsSettingsPage::CommentsSettingsPage() +{ + setId("Q.Comments"); + setDisplayName(Tr::tr("Documentation Comments")); + setCategory(TextEditor::Constants::TEXT_EDITOR_SETTINGS_CATEGORY); + setDisplayCategory(Tr::tr("Text Editor")); + setCategoryIconPath(TextEditor::Constants::TEXT_EDITOR_SETTINGS_CATEGORY_ICON_PATH); + setWidgetCreator([] { return new CommentsSettingsWidget; }); } + +} // namespace Internal +} // namespace TextEditor diff --git a/src/plugins/texteditor/commentssettings.h b/src/plugins/texteditor/commentssettings.h index b5844d3a0f8..2f3e5682bd0 100644 --- a/src/plugins/texteditor/commentssettings.h +++ b/src/plugins/texteditor/commentssettings.h @@ -5,6 +5,8 @@ #include "texteditor_global.h" +#include <coreplugin/dialogs/ioptionspage.h> + QT_BEGIN_NAMESPACE class QSettings; QT_END_NAMESPACE @@ -14,22 +16,36 @@ namespace TextEditor { class TEXTEDITOR_EXPORT CommentsSettings { public: + class Data { + public: + friend bool operator==(const Data &a, const Data &b); + friend bool operator!=(const Data &a, const Data &b) { return !(a == b); } + + bool enableDoxygen = true; + bool generateBrief = true; + bool leadingAsterisks = true; + }; + + static Data data() { return instance().m_data; } + static void setData(const Data &data); + +private: CommentsSettings(); + static CommentsSettings &instance(); + void save() const; + void load(); - void toSettings(QSettings *s) const; - void fromSettings(QSettings *s); - - bool equals(const CommentsSettings &other) const; - - friend bool operator==(const CommentsSettings &a, const CommentsSettings &b) - { return a.equals(b); } - - friend bool operator!=(const CommentsSettings &a, const CommentsSettings &b) - { return !(a == b); } - - bool m_enableDoxygen; - bool m_generateBrief; - bool m_leadingAsterisks; + Data m_data; }; +namespace Internal { + +class CommentsSettingsPage : public Core::IOptionsPage +{ +public: + CommentsSettingsPage(); +}; + +} // namespace Internal + } // namespace TextEditor diff --git a/src/plugins/texteditor/completionsettingspage.cpp b/src/plugins/texteditor/completionsettingspage.cpp index 167cde25a75..3d93af5226c 100644 --- a/src/plugins/texteditor/completionsettingspage.cpp +++ b/src/plugins/texteditor/completionsettingspage.cpp @@ -38,7 +38,7 @@ private: CaseSensitivity caseSensitivity() const; CompletionTrigger completionTrigger() const; - void settingsFromUi(CompletionSettings &completion, CommentsSettings &comment) const; + void settingsFromUi(CompletionSettings &completion) const; CompletionSettingsPage *m_owner = nullptr; @@ -58,9 +58,6 @@ private: QCheckBox *m_skipAutoComplete; QCheckBox *m_removeAutoComplete; QCheckBox *m_overwriteClosingChars; - QCheckBox *m_enableDoxygenCheckBox; - QCheckBox *m_generateBriefCheckBox; - QCheckBox *m_leadingAsterisksCheckBox; }; CompletionSettingsPageWidget::CompletionSettingsPageWidget(CompletionSettingsPage *owner) @@ -147,19 +144,6 @@ CompletionSettingsPageWidget::CompletionSettingsPageWidget(CompletionSettingsPag m_overwriteClosingChars = new QCheckBox(Tr::tr("Overwrite closing punctuation")); m_overwriteClosingChars->setToolTip(Tr::tr("Automatically overwrite closing parentheses and quotes.")); - m_enableDoxygenCheckBox = new QCheckBox(Tr::tr("Enable Doxygen blocks")); - m_enableDoxygenCheckBox->setToolTip(Tr::tr("Automatically creates a Doxygen comment upon pressing " - "enter after a '/**', '/*!', '//!' or '///'.")); - - m_generateBriefCheckBox = new QCheckBox(Tr::tr("Generate brief description")); - m_generateBriefCheckBox->setToolTip(Tr::tr("Generates a <i>brief</i> command with an initial " - "description for the corresponding declaration.")); - - m_leadingAsterisksCheckBox = new QCheckBox(Tr::tr("Add leading asterisks")); - m_leadingAsterisksCheckBox->setToolTip( - Tr::tr("Adds leading asterisks when continuing C/C++ \"/*\", Qt \"/*!\" " - "and Java \"/**\" style comments on new lines.")); - connect(m_completionTrigger, &QComboBox::currentIndexChanged, this, [this, automaticProposalTimeoutLabel] { const bool enableTimeoutWidgets = completionTrigger() == AutomaticCompletion; @@ -211,11 +195,6 @@ CompletionSettingsPageWidget::CompletionSettingsPageWidget(CompletionSettingsPag m_skipAutoComplete->setChecked(m_owner->m_completionSettings.m_skipAutoCompletedText); m_removeAutoComplete->setChecked(m_owner->m_completionSettings.m_autoRemove); - m_enableDoxygenCheckBox->setChecked(m_owner->m_commentsSettings.m_enableDoxygen); - m_generateBriefCheckBox->setChecked(m_owner->m_commentsSettings.m_generateBrief); - m_leadingAsterisksCheckBox->setChecked(m_owner->m_commentsSettings.m_leadingAsterisks); - - m_generateBriefCheckBox->setEnabled(m_enableDoxygenCheckBox->isChecked()); m_skipAutoComplete->setEnabled(m_highlightAutoComplete->isChecked()); m_removeAutoComplete->setEnabled(m_highlightAutoComplete->isChecked()); @@ -254,18 +233,9 @@ CompletionSettingsPageWidget::CompletionSettingsPageWidget(CompletionSettingsPag } } }, - Group { - title(Tr::tr("Documentation Comments")), - Column { - m_enableDoxygenCheckBox, - indent(m_generateBriefCheckBox), - m_leadingAsterisksCheckBox - } - }, st }.attachTo(this); - connect(m_enableDoxygenCheckBox, &QCheckBox::toggled, m_generateBriefCheckBox, &QCheckBox::setEnabled); connect(m_highlightAutoComplete, &QCheckBox::toggled, m_skipAutoComplete, &QCheckBox::setEnabled); connect(m_highlightAutoComplete, &QCheckBox::toggled, m_removeAutoComplete, &QCheckBox::setEnabled); } @@ -273,21 +243,14 @@ CompletionSettingsPageWidget::CompletionSettingsPageWidget(CompletionSettingsPag void CompletionSettingsPageWidget::apply() { CompletionSettings completionSettings; - CommentsSettings commentsSettings; - settingsFromUi(completionSettings, commentsSettings); + settingsFromUi(completionSettings); if (m_owner->m_completionSettings != completionSettings) { m_owner->m_completionSettings = completionSettings; m_owner->m_completionSettings.toSettings(Core::ICore::settings()); emit TextEditorSettings::instance()->completionSettingsChanged(completionSettings); } - - if (m_owner->m_commentsSettings != commentsSettings) { - m_owner->m_commentsSettings = commentsSettings; - m_owner->m_commentsSettings.toSettings(Core::ICore::settings()); - emit TextEditorSettings::instance()->commentsSettingsChanged(commentsSettings); - } } CaseSensitivity CompletionSettingsPageWidget::caseSensitivity() const @@ -314,8 +277,7 @@ CompletionTrigger CompletionSettingsPageWidget::completionTrigger() const } } -void CompletionSettingsPageWidget::settingsFromUi(CompletionSettings &completion, - CommentsSettings &comment) const +void CompletionSettingsPageWidget::settingsFromUi(CompletionSettings &completion) const { completion.m_caseSensitivity = caseSensitivity(); completion.m_completionTrigger = completionTrigger(); @@ -334,10 +296,6 @@ void CompletionSettingsPageWidget::settingsFromUi(CompletionSettings &completion completion.m_highlightAutoComplete = m_highlightAutoComplete->isChecked(); completion.m_skipAutoCompletedText = m_skipAutoComplete->isChecked(); completion.m_autoRemove = m_removeAutoComplete->isChecked(); - - comment.m_enableDoxygen = m_enableDoxygenCheckBox->isChecked(); - comment.m_generateBrief = m_generateBriefCheckBox->isChecked(); - comment.m_leadingAsterisks = m_leadingAsterisksCheckBox->isChecked(); } const CompletionSettings &CompletionSettingsPage::completionSettings() const @@ -345,10 +303,6 @@ const CompletionSettings &CompletionSettingsPage::completionSettings() const return m_completionSettings; } -const CommentsSettings &CompletionSettingsPage::commentsSettings() const -{ - return m_commentsSettings; -} CompletionSettingsPage::CompletionSettingsPage() { @@ -361,7 +315,6 @@ CompletionSettingsPage::CompletionSettingsPage() QSettings *s = Core::ICore::settings(); m_completionSettings.fromSettings(s); - m_commentsSettings.fromSettings(s); } } // Internal diff --git a/src/plugins/texteditor/completionsettingspage.h b/src/plugins/texteditor/completionsettingspage.h index e3921348a3a..286f2508033 100644 --- a/src/plugins/texteditor/completionsettingspage.h +++ b/src/plugins/texteditor/completionsettingspage.h @@ -3,7 +3,6 @@ #pragma once -#include "commentssettings.h" #include "completionsettings.h" #include <coreplugin/dialogs/ioptionspage.h> @@ -17,12 +16,10 @@ public: CompletionSettingsPage(); const CompletionSettings &completionSettings() const; - const CommentsSettings &commentsSettings() const; private: friend class CompletionSettingsPageWidget; - CommentsSettings m_commentsSettings; CompletionSettings m_completionSettings; }; diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index 6b3ee6e7b50..95d0fbfe78c 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -5,6 +5,7 @@ #include "behaviorsettings.h" #include "behaviorsettingspage.h" +#include "commentssettings.h" #include "completionsettings.h" #include "completionsettingspage.h" #include "displaysettings.h" @@ -47,6 +48,7 @@ public: HighlighterSettingsPage m_highlighterSettingsPage; SnippetsSettingsPage m_snippetsSettingsPage; CompletionSettingsPage m_completionSettingsPage; + CommentsSettingsPage m_commentsSettingsPage; QMap<Utils::Id, ICodeStylePreferencesFactory *> m_languageToFactory; @@ -501,9 +503,9 @@ const ExtraEncodingSettings &TextEditorSettings::extraEncodingSettings() return d->m_behaviorSettingsPage.extraEncodingSettings(); } -const CommentsSettings &TextEditorSettings::commentsSettings() +CommentsSettings::Data TextEditorSettings::commentsSettings() { - return d->m_completionSettingsPage.commentsSettings(); + return CommentsSettings::data(); } void TextEditorSettings::registerCodeStyleFactory(ICodeStylePreferencesFactory *factory) diff --git a/src/plugins/texteditor/texteditorsettings.h b/src/plugins/texteditor/texteditorsettings.h index 62f36980ef4..88cf707aa39 100644 --- a/src/plugins/texteditor/texteditorsettings.h +++ b/src/plugins/texteditor/texteditorsettings.h @@ -3,6 +3,7 @@ #pragma once +#include "commentssettings.h" #include "texteditor_global.h" #include <utils/id.h> @@ -54,7 +55,7 @@ public: static const CompletionSettings &completionSettings(); static const HighlighterSettings &highlighterSettings(); static const ExtraEncodingSettings &extraEncodingSettings(); - static const CommentsSettings &commentsSettings(); + static CommentsSettings::Data commentsSettings(); static ICodeStylePreferencesFactory *codeStyleFactory(Utils::Id languageId); static const QMap<Utils::Id, ICodeStylePreferencesFactory *> &codeStyleFactories(); @@ -86,7 +87,7 @@ signals: void displaySettingsChanged(const TextEditor::DisplaySettings &); void completionSettingsChanged(const TextEditor::CompletionSettings &); void extraEncodingSettingsChanged(const TextEditor::ExtraEncodingSettings &); - void commentsSettingsChanged(const TextEditor::CommentsSettings &); + void commentsSettingsChanged(const TextEditor::CommentsSettings::Data &); }; } // namespace TextEditor From cb6a5f611995719383fb92843be0e32ba74efefc Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 28 Jul 2023 18:46:13 +0200 Subject: [PATCH 0617/1777] Ios: Merge settings page related file pairs [2/2] Rename *settingswidget* into *settingspage*. Change-Id: Ib635ed0dc8b7d2bf3979977e89206b194b116d47 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/ios/CMakeLists.txt | 2 +- src/plugins/ios/ios.qbs | 4 ++-- src/plugins/ios/iosplugin.cpp | 2 +- .../ios/{iossettingswidget.cpp => iossettingspage.cpp} | 2 +- src/plugins/ios/{iossettingswidget.h => iossettingspage.h} | 0 5 files changed, 5 insertions(+), 5 deletions(-) rename src/plugins/ios/{iossettingswidget.cpp => iossettingspage.cpp} (99%) rename src/plugins/ios/{iossettingswidget.h => iossettingspage.h} (100%) diff --git a/src/plugins/ios/CMakeLists.txt b/src/plugins/ios/CMakeLists.txt index eaef034cc40..d26bcdf1034 100644 --- a/src/plugins/ios/CMakeLists.txt +++ b/src/plugins/ios/CMakeLists.txt @@ -16,7 +16,7 @@ add_qtc_plugin(Ios iosqtversion.cpp iosqtversion.h iosrunconfiguration.cpp iosrunconfiguration.h iosrunner.cpp iosrunner.h - iossettingswidget.cpp iossettingswidget.h + iossettingspage.cpp iossettingspage.h iossimulator.cpp iossimulator.h iostoolhandler.cpp iostoolhandler.h iostr.h diff --git a/src/plugins/ios/ios.qbs b/src/plugins/ios/ios.qbs index 721151afeb7..e60edb7315f 100644 --- a/src/plugins/ios/ios.qbs +++ b/src/plugins/ios/ios.qbs @@ -41,8 +41,8 @@ QtcPlugin { "iosrunconfiguration.h", "iosrunner.cpp", "iosrunner.h", - "iossettingswidget.cpp", - "iossettingswidget.h", + "iossettingspage.cpp", + "iossettingspage.h", "iossimulator.cpp", "iossimulator.h", "iostoolhandler.cpp", diff --git a/src/plugins/ios/iosplugin.cpp b/src/plugins/ios/iosplugin.cpp index f61bd55525f..9f790aa17f9 100644 --- a/src/plugins/ios/iosplugin.cpp +++ b/src/plugins/ios/iosplugin.cpp @@ -12,7 +12,7 @@ #include "iosdsymbuildstep.h" #include "iosqtversion.h" #include "iosrunner.h" -#include "iossettingswidget.h" +#include "iossettingspage.h" #include "iossimulator.h" #include "iostoolhandler.h" #include "iostr.h" diff --git a/src/plugins/ios/iossettingswidget.cpp b/src/plugins/ios/iossettingspage.cpp similarity index 99% rename from src/plugins/ios/iossettingswidget.cpp rename to src/plugins/ios/iossettingspage.cpp index c131de0bac7..3292fefc079 100644 --- a/src/plugins/ios/iossettingswidget.cpp +++ b/src/plugins/ios/iossettingspage.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "iossettingswidget.h" +#include "iossettingspage.h" #include "createsimulatordialog.h" #include "iosconfigurations.h" diff --git a/src/plugins/ios/iossettingswidget.h b/src/plugins/ios/iossettingspage.h similarity index 100% rename from src/plugins/ios/iossettingswidget.h rename to src/plugins/ios/iossettingspage.h From 33d628f111587f2d2f1d9b7309f3cf0365e6e0a6 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 5 Aug 2023 09:21:04 +0200 Subject: [PATCH 0618/1777] PerfParser: Update the tool Change-Id: Ie79c28b39f62af91843106bc1e312d6be27ba9cf Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/tools/perfparser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/perfparser b/src/tools/perfparser index 5444f962076..9cd74c87df4 160000 --- a/src/tools/perfparser +++ b/src/tools/perfparser @@ -1 +1 @@ -Subproject commit 5444f96207616f922f3093e9d64bd6000f168c51 +Subproject commit 9cd74c87df440e34ac4593b1a16ec6f7b7843d86 From 66929b96a492e950c96999d343adef0f7e3fdfba Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 4 Aug 2023 19:15:37 +0200 Subject: [PATCH 0619/1777] Debugger test: Get rid of foreach Change-Id: Ia3414cffe9b88cfb5abbdd24eda5c36aa163c4f9 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- tests/manual/debugger/gui/mainwindow.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/manual/debugger/gui/mainwindow.cpp b/tests/manual/debugger/gui/mainwindow.cpp index 831f266ca0b..bea62f56a5e 100644 --- a/tests/manual/debugger/gui/mainwindow.cpp +++ b/tests/manual/debugger/gui/mainwindow.cpp @@ -306,9 +306,8 @@ void MainWindow::on_actionExtTypes_triggered() void MainWindow::on_actionForeach_triggered() { - QStringList sl; - sl << "1" << "2" << "3"; - foreach(const QString &s, sl) + QStringList sl {"1", "2", "3"}; + for (const QString &s : std::as_const(sl)) qDebug() << s; sl.clear(); qDebug() << sl; From 7a8c4adf95c607afa33863f7967310bc9b36c504 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 1 Aug 2023 15:24:12 +0200 Subject: [PATCH 0620/1777] Utils: Don't complain about non-existing devices FilePath::exists() does not need to warn if the device does not exist. Change-Id: I2ce6a5dec8806a8ee0a2f0e53a2c556c1d8c9e5b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/filepath.cpp | 151 ++++++++++++++++++++++-------------- 1 file changed, 94 insertions(+), 57 deletions(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index e3ae97267dd..796f887cc23 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -455,30 +455,6 @@ void FilePath::setParts(const QStringView scheme, const QStringView host, QStrin m_pathLen = path.size(); } -/*! - Returns a bool indicating whether a file or directory with this FilePath exists. -*/ -bool FilePath::exists() const -{ - return fileAccess()->exists(*this); -} - -/*! - Returns a bool indicating whether this is a writable directory. -*/ -bool FilePath::isWritableDir() const -{ - return fileAccess()->isWritableDirectory(*this); -} - -/*! - Returns a bool indicating whether this is a writable file. -*/ -bool FilePath::isWritableFile() const -{ - return fileAccess()->isWritableFile(*this); -} - /*! \brief Re-uses or creates a directory in this location. @@ -496,14 +472,6 @@ bool FilePath::ensureExistingFile() const return fileAccess()->ensureExistingFile(*this); } -/*! - Returns a bool indicating whether this is an executable file. -*/ -bool FilePath::isExecutableFile() const -{ - return fileAccess()->isExecutableFile(*this); -} - /*! Returns a bool indicating on whether a process with this FilePath's native path is likely to start. @@ -551,31 +519,6 @@ expected_str<FilePath> FilePath::createTempFile() const return fileAccess()->createTempFile(*this); } -bool FilePath::isReadableFile() const -{ - return fileAccess()->isReadableFile(*this); -} - -bool FilePath::isReadableDir() const -{ - return fileAccess()->isReadableDirectory(*this); -} - -bool FilePath::isFile() const -{ - return fileAccess()->isFile(*this); -} - -bool FilePath::isDir() const -{ - return fileAccess()->isDirectory(*this); -} - -bool FilePath::isSymLink() const -{ - return fileAccess()->isSymLink(*this); -} - bool FilePath::hasHardLinks() const { return fileAccess()->hasHardLinks(*this); @@ -1217,6 +1160,100 @@ bool FilePath::hasFileAccess() const return access && access.value(); } +/*! + Returns a bool indicating whether a file or directory with this FilePath exists. +*/ +bool FilePath::exists() const +{ + const expected_str<DeviceFileAccess *> access = getFileAccess(*this); + if (!access) + return false; + + return (*access)->exists(*this); +} + +/*! + Returns a bool indicating whether this is an executable file. +*/ +bool FilePath::isExecutableFile() const +{ + const expected_str<DeviceFileAccess *> access = getFileAccess(*this); + if (!access) + return false; + + return (*access)->isExecutableFile(*this); +} + +/*! + Returns a bool indicating whether this is a writable directory. +*/ +bool FilePath::isWritableDir() const +{ + const expected_str<DeviceFileAccess *> access = getFileAccess(*this); + if (!access) + return false; + + return (*access)->isWritableDirectory(*this); +} + +/*! + Returns a bool indicating whether this is a writable file. +*/ +bool FilePath::isWritableFile() const +{ + const expected_str<DeviceFileAccess *> access = getFileAccess(*this); + if (!access) + return false; + + return (*access)->isWritableFile(*this); +} + + +bool FilePath::isReadableFile() const +{ + const expected_str<DeviceFileAccess *> access = getFileAccess(*this); + if (!access) + return false; + + return (*access)->isReadableFile(*this); +} + +bool FilePath::isReadableDir() const +{ + const expected_str<DeviceFileAccess *> access = getFileAccess(*this); + if (!access) + return false; + + return (*access)->isReadableDirectory(*this); +} + +bool FilePath::isFile() const +{ + const expected_str<DeviceFileAccess *> access = getFileAccess(*this); + if (!access) + return false; + + return (*access)->isFile(*this); +} + +bool FilePath::isDir() const +{ + const expected_str<DeviceFileAccess *> access = getFileAccess(*this); + if (!access) + return false; + + return (*access)->isDirectory(*this); +} + +bool FilePath::isSymLink() const +{ + const expected_str<DeviceFileAccess *> access = getFileAccess(*this); + if (!access) + return false; + + return (*access)->isSymLink(*this); +} + /*! Constructs a FilePath from \a filepath. The \a defaultExtension is appended to \a filepath if that does not have an extension already. From f93836b25d57fed5888b1376e1e1b2d084fcb98d Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 10 Jul 2023 12:58:26 +0200 Subject: [PATCH 0621/1777] CppEditor: Add quickfix for converting comments from C++ to C style ... and vice versa. Fixes: QTCREATORBUG-27501 Change-Id: I8584cc1e86718b3fe0f0ead2a3436495303ca3c8 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- .../3rdparty/cplusplus/TranslationUnit.cpp | 73 +++++- src/libs/3rdparty/cplusplus/TranslationUnit.h | 11 + src/plugins/cppeditor/cppquickfix_test.cpp | 197 +++++++++++++++ src/plugins/cppeditor/cppquickfix_test.h | 3 + src/plugins/cppeditor/cppquickfixes.cpp | 226 ++++++++++++++++++ src/plugins/cppeditor/cppquickfixes.h | 8 + .../cppeditor/cpprefactoringchanges.cpp | 50 ++++ src/plugins/cppeditor/cpprefactoringchanges.h | 7 + 8 files changed, 567 insertions(+), 8 deletions(-) diff --git a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp index d5c7a5fc9b8..848f61285cb 100644 --- a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp +++ b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp @@ -105,6 +105,35 @@ int TranslationUnit::commentCount() const const Token &TranslationUnit::commentAt(int index) const { return _comments->at(index); } +std::vector<Token> TranslationUnit::allTokens() const +{ + std::vector<Token> all; + int tokIndex = 0; + int commentIndex = 0; + while (true) { + if (tokIndex == tokenCount()) { + for (int i = commentIndex; i < commentCount(); ++i) + all.push_back(commentAt(i)); + break; + } + if (commentIndex == commentCount()) { + for (int i = tokIndex; i < tokenCount(); ++i) + all.push_back(tokenAt(i)); + break; + } + const Token &tok = tokenAt(tokIndex); + const Token &comment = commentAt(commentIndex); + if (tok.utf16charsBegin() < comment.utf16charsBegin()) { + all.push_back(tok); + ++tokIndex; + } else { + all.push_back(comment); + ++commentIndex; + } + } + return all; +} + const Identifier *TranslationUnit::identifier(int index) const { return tokenAt(index).identifier; } @@ -381,27 +410,55 @@ int TranslationUnit::findColumnNumber(int utf16CharOffset, int lineNumber) const int TranslationUnit::getTokenPositionInDocument(int index, const QTextDocument *doc) const { - int line, column; - getTokenPosition(index, &line, &column); - return Utils::Text::positionInText(doc, line, column); + return getTokenPositionInDocument(_tokens->at(index), doc); } int TranslationUnit::getTokenEndPositionInDocument(int index, const QTextDocument *doc) const { - int line, column; - getTokenEndPosition(index, &line, &column); - return Utils::Text::positionInText(doc, line, column); + return getTokenEndPositionInDocument(_tokens->at(index), doc); } void TranslationUnit::getTokenPosition(int index, int *line, int *column, const StringLiteral **fileName) const -{ return getPosition(tokenAt(index).utf16charsBegin(), line, column, fileName); } +{ + return getTokenPosition(_tokens->at(index), line, column, fileName); +} void TranslationUnit::getTokenEndPosition(int index, int *line, int *column, const StringLiteral **fileName) const -{ return getPosition(tokenAt(index).utf16charsEnd(), line, column, fileName); } +{ + return getTokenEndPosition(_tokens->at(index), line, column, fileName); +} + +void TranslationUnit::getTokenPosition(const Token &token, int *line, int *column, + const StringLiteral **fileName) const +{ + return getPosition(token.utf16charsBegin(), line, column, fileName); +} + +void TranslationUnit::getTokenEndPosition(const Token &token, int *line, + int *column, const StringLiteral **fileName) const +{ + return getPosition(token.utf16charsEnd(), line, column, fileName); +} + +int TranslationUnit::getTokenPositionInDocument(const Token token, + const QTextDocument *doc) const +{ + int line, column; + getTokenPosition(token, &line, &column); + return Utils::Text::positionInText(doc, line, column); +} + +int TranslationUnit::getTokenEndPositionInDocument(const Token &token, + const QTextDocument *doc) const +{ + int line, column; + getTokenEndPosition(token, &line, &column); + return Utils::Text::positionInText(doc, line, column); +} void TranslationUnit::getPosition(int utf16charOffset, int *line, diff --git a/src/libs/3rdparty/cplusplus/TranslationUnit.h b/src/libs/3rdparty/cplusplus/TranslationUnit.h index 9ae01755fb5..40f79d0091d 100644 --- a/src/libs/3rdparty/cplusplus/TranslationUnit.h +++ b/src/libs/3rdparty/cplusplus/TranslationUnit.h @@ -65,6 +65,9 @@ public: int commentCount() const; const Token &commentAt(int index) const; + // Including comments. + std::vector<Token> allTokens() const; + int matchingBrace(int index) const; const Identifier *identifier(int index) const; const Literal *literal(int index) const; @@ -120,9 +123,17 @@ public: int *line, int *column = nullptr, const StringLiteral **fileName = nullptr) const; + int getTokenPositionInDocument(int index, const QTextDocument *doc) const; int getTokenEndPositionInDocument(int index, const QTextDocument *doc) const; + void getTokenPosition(const Token &token, int *line, int *column = nullptr, + const StringLiteral **fileName = nullptr) const; + void getTokenEndPosition(const Token &token, int *line, int *column = nullptr, + const StringLiteral **fileName = nullptr) const; + int getTokenPositionInDocument(const Token token, const QTextDocument *doc) const; + int getTokenEndPositionInDocument(const Token &token, const QTextDocument *doc) const; + void pushLineOffset(int offset); void pushPreprocessorLine(int utf16charOffset, int line, diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 3f292769f1e..72f4f1b0833 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -8982,4 +8982,201 @@ void QuickfixTest::testGenerateConstructor() QuickFixOperationTest(testDocuments, &factory); } +void QuickfixTest::testChangeCommentType_data() +{ + QTest::addColumn<QString>("input"); + QTest::addColumn<QString>("expectedOutput"); + + QTest::newRow("C -> C++ / no selection / single line") << R"( +int var1; +/* Other comment, unaffected */ +/* Our @comment */ +/* Another unaffected comment */ +int var2;)" << R"( +int var1; +/* Other comment, unaffected */ +// Our comment +/* Another unaffected comment */ +int var2;)"; + + QTest::newRow("C -> C++ / no selection / multi-line / preserved header and footer") << R"( +/**************************************************** + * some info + * more @info + ***************************************************/)" << R"( +///////////////////////////////////////////////////// +// some info +// more info +/////////////////////////////////////////////////////)"; + + QTest::newRow("C -> C++ / no selection / multi-line / non-preserved header and footer") << R"( +/* + * some info + * more @info + */)" << R"( +// some info +// more info +)"; + + QTest::newRow("C -> C++ / no selection / qdoc") << R"( +/*! + \qmlproperty string Type::element.name + \qmlproperty int Type::element.id + + \brief Holds the @element name and id. +*/)" << R"( +//! \qmlproperty string Type::element.name +//! \qmlproperty @int Type::element.id +//! +//! \brief Holds the element name and id. +)"; + + QTest::newRow("C -> C++ / no selection / doxygen") << R"( +/*! \class Test + \brief A test class. + + A more detailed @class description. +*/)" << R"( +//! \class Test +//! \brief A test class. +//! +//! A more detailed class description. +)"; + + QTest::newRow("C -> C++ / selection / single line") << R"( +int var1; +/* Other comment, unaffected */ +@{start}/* Our comment */@{end} +/* Another unaffected comment */ +int var2;)" << R"( +int var1; +/* Other comment, unaffected */ +// Our comment +/* Another unaffected comment */ +int var2;)"; + + QTest::newRow("C -> C++ / selection / multi-line / preserved header and footer") << R"( +/**************************************************** + * @{start}some info + * more info@{end} + ***************************************************/)" << R"( +///////////////////////////////////////////////////// +// some info +// more info +/////////////////////////////////////////////////////)"; + + QTest::newRow("C -> C++ / selection / multi-line / non-preserved header and footer") << R"( +/*@{start} + * some in@{end}fo + * more info + */)" << R"( +// some info +// more info +)"; + + QTest::newRow("C -> C++ / selection / qdoc") << R"( +/*!@{start} + \qmlproperty string Type::element.name + \qmlproperty int Type::element.id + + \brief Holds the element name and id. +*/@{end})" << R"( +//! \qmlproperty string Type::element.name +//! \qmlproperty int Type::element.id +//! +//! \brief Holds the element name and id. +)"; + + QTest::newRow("C -> C++ / selection / doxygen") << R"( +/** Expand envi@{start}ronment variables in a string. + * + * Environment variables are accepted in the @{end}following forms: + * $SOMEVAR, ${SOMEVAR} on Unix and %SOMEVAR% on Windows. + * No escapes and quoting are supported. + * If a variable is not found, it is not substituted. + */)" << R"( +//! Expand environment variables in a string. +//! +//! Environment variables are accepted in the following forms: +//! $SOMEVAR, ${SOMEVAR} on Unix and %SOMEVAR% on Windows. +//! No escapes and quoting are supported. +//! If a variable is not found, it is not substituted. +)"; + + QTest::newRow("C -> C++ / selection / multiple comments") << R"( +@{start}/* Affected comment */ +/* Another affected comment */ +/* A third affected comment */@{end} +/* An unaffected comment */)" << R"( +// Affected comment +// Another affected comment +// A third affected comment +/* An unaffected comment */)"; + + QTest::newRow("C++ -> C / no selection / single line") << R"( +// Other comment, unaffected +// Our @comment +// Another unaffected comment)" << R"( +// Other comment, unaffected +/* Our comment */ +// Another unaffected comment)"; + + QTest::newRow("C++ -> C / selection / single line") << R"( +// Other comment, unaffected +@{start}// Our comment@{end} +// Another unaffected comment)" << R"( +// Other comment, unaffected +/* Our comment */ +// Another unaffected comment)"; + + QTest::newRow("C++ -> C / selection / multi-line / preserved header and footer") << R"( +@{start}///////////////////////////////////////////////////// +// some info +// more info +/////////////////////////////////////////////////////@{end})" << R"( +/****************************************************/ +/* some info */ +/* more info */ +/****************************************************/)"; + + QTest::newRow("C++ -> C / selection / qdoc") << R"( +@{start}//! \qmlproperty string Type::element.name +//! \qmlproperty int Type::element.id +//! +//! \brief Holds the element name and id.@{end} +)" << R"( +/*! + \qmlproperty string Type::element.name + \qmlproperty int Type::element.id + + \brief Holds the element name and id. +*/ +)"; + + QTest::newRow("C++ -> C / selection / doxygen") << R"( +@{start}//! \class Test +//! \brief A test class. +//! +//! A more detailed class description.@{end} +)" << R"( +/*! + \class Test + \brief A test class. + + A more detailed class description. +*/ +)"; +} + +void QuickfixTest::testChangeCommentType() +{ + QFETCH(QString, input); + QFETCH(QString, expectedOutput); + + ConvertCommentStyle factory; + QuickFixOperationTest( + {CppTestDocument::create("file.h", input.toUtf8(), expectedOutput.toUtf8())}, + &factory); +} + } // namespace CppEditor::Internal::Tests diff --git a/src/plugins/cppeditor/cppquickfix_test.h b/src/plugins/cppeditor/cppquickfix_test.h index 53926630cab..ef1af4440b3 100644 --- a/src/plugins/cppeditor/cppquickfix_test.h +++ b/src/plugins/cppeditor/cppquickfix_test.h @@ -219,6 +219,9 @@ private slots: void testGenerateConstructor_data(); void testGenerateConstructor(); + + void testChangeCommentType_data(); + void testChangeCommentType(); }; } // namespace Tests diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 43c96cf383b..727f0c84970 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -9306,6 +9306,231 @@ void GenerateConstructor::match(const CppQuickFixInterface &interface, QuickFixO result << op; } +namespace { +class ConvertCommentStyleOp : public CppQuickFixOperation +{ +public: + ConvertCommentStyleOp(const CppQuickFixInterface &interface, const QList<Token> &tokens, + Kind kind) + : CppQuickFixOperation(interface), + m_tokens(tokens), + m_kind(kind), + m_wasCxxStyle(m_kind == T_CPP_COMMENT || m_kind == T_CPP_DOXY_COMMENT), + m_isDoxygen(m_kind == T_DOXY_COMMENT || m_kind == T_CPP_DOXY_COMMENT) + { + setDescription(m_wasCxxStyle ? Tr::tr("Convert comment to C style") + : Tr::tr("Convert comment to C++ style")); + } + +private: + // Turns every line of a C-style comment into a C++-style comment and vice versa. + // For C++ -> C, we use one /* */ comment block per line. However, doxygen + // requires a single comment, so there we just replace the prefix with whitespace and + // add the start and end comment in extra lines. + // For cosmetic reasons, we offer some convenience functionality: + // - Turn /***** ... into ////// ... and vice versa + // - With C -> C++, remove leading asterisks. + // - With C -> C++, remove the first and last line of a block if they have no content + // other than the comment start and end characters. + // - With C++ -> C, try to align the end comment characters. + // These are obviously heuristics; we do not guarantee perfect results for everybody. + // We also don't second-guess the users's selection: E.g. if there is an empty + // line between the tokens, then it's not the same doxygen comment, but we merge + // it anyway in C++ to C mode. + void perform() override + { + TranslationUnit * const tu = currentFile()->cppDocument()->translationUnit(); + const QString newCommentStart = getNewCommentStart(); + ChangeSet changeSet; + int endCommentColumn = -1; + const QChar oldFillChar = m_wasCxxStyle ? '/' : '*'; + const QChar newFillChar = m_wasCxxStyle ? '*' : '/'; + + for (const Token &token : m_tokens) { + const int startPos = tu->getTokenPositionInDocument(token, textDocument()); + const int endPos = tu->getTokenEndPositionInDocument(token, textDocument()); + + if (m_wasCxxStyle && m_isDoxygen) { + // Replace "///" characters with whitespace (to keep alignment). + // The insertion of "/*" and "*/" is done once after the loop. + changeSet.replace(startPos, startPos + 3, " "); + continue; + } + + const QTextBlock firstBlock = textDocument()->findBlock(startPos); + const QTextBlock lastBlock = textDocument()->findBlock(endPos); + for (QTextBlock block = firstBlock; block.isValid() && block.position() <= endPos; + block = block.next()) { + const QString &blockText = block.text(); + const int firstColumn = block == firstBlock ? startPos - block.position() : 0; + const int endColumn = block == lastBlock ? endPos - block.position() + : block.length(); + + // Returns true if the current line looks like "/********/" or "//////////", + // as is often the case at the start and end of comment blocks. + const auto fillChecker = [&] { + if (m_isDoxygen) + return false; + QString textToCheck = blockText; + if (block == firstBlock) + textToCheck.remove(0, 1); + if (block == lastBlock) + textToCheck.chop(block.length() - endColumn); + return Utils::allOf(textToCheck, [oldFillChar](const QChar &c) + { return c == oldFillChar || c == ' '; + }) && textToCheck.count(oldFillChar) > 2; + }; + + // Returns the index of the first character of actual comment content, + // as opposed to visual stuff like slashes, stars or whitespace. + const auto indexOfActualContent = [&] { + const int offset = block == firstBlock ? firstColumn + newCommentStart.length() + : firstColumn; + + for (int i = offset, lastFillChar = -1; i < blockText.length(); ++i) { + if (blockText.at(i) == oldFillChar) { + lastFillChar = i; + continue; + } + if (!blockText.at(i).isSpace()) + return lastFillChar + 1; + } + return -1; + }; + + if (fillChecker()) { + const QString replacement = QString(endColumn - 1 - firstColumn, newFillChar); + changeSet.replace(block.position() + firstColumn, + block.position() + endColumn - 1, + replacement); + if (m_wasCxxStyle) { + changeSet.replace(block.position() + firstColumn, + block.position() + firstColumn + 1, "/"); + changeSet.insert(block.position() + endColumn - 1, "*"); + endCommentColumn = endColumn - 1; + } + continue; + } + + // Remove leading noise or even the entire block, if applicable. + const bool blockIsRemovable = (block == firstBlock || block == lastBlock) + && firstBlock != lastBlock; + const auto removeBlock = [&] { + changeSet.remove(block.position() + firstColumn, block.position() + endColumn); + }; + const int contentIndex = indexOfActualContent(); + if (contentIndex == -1) { + if (blockIsRemovable) { + removeBlock(); + continue; + } else if (!m_wasCxxStyle) { + changeSet.replace(block.position() + firstColumn, + block.position() + endColumn - 1, newCommentStart); + continue; + } + } else if (block == lastBlock && contentIndex == endColumn - 1) { + if (blockIsRemovable) { + removeBlock(); + break; + } + } else { + changeSet.remove(block.position() + firstColumn, + block.position() + firstColumn + contentIndex); + } + + if (block == firstBlock) { + changeSet.replace(startPos, startPos + newCommentStart.length(), + newCommentStart); + } else { + // If the line starts with enough whitespace, replace it with the + // comment start characters, so we don't move the content to the right + // unnecessarily. Otherwise, insert the comment start characters. + if (blockText.startsWith(QString(newCommentStart.size() + 1, ' '))) { + changeSet.replace(block.position(), + block.position() + newCommentStart.length(), + newCommentStart); + } else { + changeSet.insert(block.position(), newCommentStart); + } + } + + if (block == lastBlock) { + if (m_wasCxxStyle) { + // This is for proper alignment of the end comment character. + if (endCommentColumn != -1) { + const int endCommentPos = block.position() + endCommentColumn; + if (endPos < endCommentPos) + changeSet.insert(endPos, QString(endCommentPos - endPos - 1, ' ')); + } + changeSet.insert(endPos, " */"); + } else { + changeSet.remove(endPos - 2, endPos); + } + } + } + } + + if (m_wasCxxStyle && m_isDoxygen) { + const int startPos = tu->getTokenPositionInDocument(m_tokens.first(), textDocument()); + const int endPos = tu->getTokenEndPositionInDocument(m_tokens.last(), textDocument()); + changeSet.insert(startPos, "/*!\n"); + changeSet.insert(endPos, "\n*/"); + } + + changeSet.apply(textDocument()); + } + + QString getNewCommentStart() const + { + if (m_wasCxxStyle) { + if (m_isDoxygen) + return "/*!"; + return "/*"; + } + if (m_isDoxygen) + return "//!"; + return "//"; + } + + const QList<Token> m_tokens; + const Kind m_kind; + const bool m_wasCxxStyle; + const bool m_isDoxygen; +}; +} // namespace + +void ConvertCommentStyle::match(const CppQuickFixInterface &interface, + TextEditor::QuickFixOperations &result) +{ + // If there's a selection, then it must entirely consist of comment tokens. + // If there's no selection, the cursor must be on a comment. + const QList<Token> &cursorTokens = interface.currentFile()->tokensForCursor(); + if (cursorTokens.empty()) + return; + if (!cursorTokens.front().isComment()) + return; + + // All tokens must be the same kind of comment, but we make an exception for doxygen comments + // that start with "///", as these are often not intended to be doxygen. For our purposes, + // we treat them as normal comments. + const auto effectiveKind = [&interface](const Token &token) { + if (token.kind() != T_CPP_DOXY_COMMENT) + return token.kind(); + TranslationUnit * const tu = interface.currentFile()->cppDocument()->translationUnit(); + const int startPos = tu->getTokenPositionInDocument(token, interface.textDocument()); + const QString commentStart = interface.textAt(startPos, 3); + return commentStart == "///" ? T_CPP_COMMENT : T_CPP_DOXY_COMMENT; + }; + const Kind kind = effectiveKind(cursorTokens.first()); + for (int i = 1; i < cursorTokens.count(); ++i) { + if (effectiveKind(cursorTokens.at(i)) != kind) + return; + } + + // Ok, all tokens are of same(ish) comment type, offer quickfix. + result << new ConvertCommentStyleOp(interface, cursorTokens, kind); +} + void createCppQuickFixes() { new AddIncludeForUndefinedIdentifier; @@ -9362,6 +9587,7 @@ void createCppQuickFixes() new RemoveUsingNamespace; new GenerateConstructor; + new ConvertCommentStyle; } void destroyCppQuickFixes() diff --git a/src/plugins/cppeditor/cppquickfixes.h b/src/plugins/cppeditor/cppquickfixes.h index 1b19c23b60d..62e1b1f981c 100644 --- a/src/plugins/cppeditor/cppquickfixes.h +++ b/src/plugins/cppeditor/cppquickfixes.h @@ -585,5 +585,13 @@ private: bool m_test = false; }; +//! Converts C-style to C++-style comments and vice versa +class ConvertCommentStyle : public CppQuickFixFactory +{ +private: + void match(const CppQuickFixInterface &interface, + TextEditor::QuickFixOperations &result) override; +}; + } // namespace Internal } // namespace CppEditor diff --git a/src/plugins/cppeditor/cpprefactoringchanges.cpp b/src/plugins/cppeditor/cpprefactoringchanges.cpp index 9ed1fc284cf..32b6b9d88c9 100644 --- a/src/plugins/cppeditor/cpprefactoringchanges.cpp +++ b/src/plugins/cppeditor/cpprefactoringchanges.cpp @@ -16,6 +16,8 @@ #include <QTextDocument> +#include <utility> + using namespace CPlusPlus; using namespace Utils; @@ -138,6 +140,31 @@ bool CppRefactoringFile::isCursorOn(const AST *ast) const return cursorBegin >= start && cursorBegin <= end; } +QList<Token> CppRefactoringFile::tokensForCursor() const +{ + QTextCursor c = cursor(); + int pos = c.selectionStart(); + int endPos = c.selectionEnd(); + if (pos > endPos) + std::swap(pos, endPos); + + const std::vector<Token> &allTokens = m_cppDocument->translationUnit()->allTokens(); + const int firstIndex = tokenIndexForPosition(allTokens, pos, 0); + if (firstIndex == -1) + return {}; + + const int lastIndex = pos == endPos + ? firstIndex + : tokenIndexForPosition(allTokens, endPos, firstIndex); + if (lastIndex == -1) + return {}; + QTC_ASSERT(lastIndex >= firstIndex, return {}); + QList<Token> result; + for (int i = firstIndex; i <= lastIndex; ++i) + result.push_back(allTokens.at(i)); + return result; +} + ChangeSet::Range CppRefactoringFile::range(unsigned tokenIndex) const { const Token &token = tokenAt(tokenIndex); @@ -215,6 +242,29 @@ void CppRefactoringFile::fileChanged() RefactoringFile::fileChanged(); } +int CppRefactoringFile::tokenIndexForPosition(const std::vector<CPlusPlus::Token> &tokens, + int pos, int startIndex) const +{ + const TranslationUnit * const tu = m_cppDocument->translationUnit(); + + // Binary search + for (int l = startIndex, u = int(tokens.size()) - 1; l <= u; ) { + const int i = (l + u) / 2; + const int tokenPos = tu->getTokenPositionInDocument(tokens.at(i), document()); + if (pos < tokenPos) { + u = i - 1; + continue; + } + const int tokenEndPos = tu->getTokenEndPositionInDocument(tokens.at(i), document()); + if (pos > tokenEndPos) { + l = i + 1; + continue; + } + return i; + } + return -1; +} + CppRefactoringChangesData::CppRefactoringChangesData(const Snapshot &snapshot) : m_snapshot(snapshot) , m_workingCopy(CppModelManager::workingCopy()) diff --git a/src/plugins/cppeditor/cpprefactoringchanges.h b/src/plugins/cppeditor/cpprefactoringchanges.h index 5dca8a9ca51..602efaf6d04 100644 --- a/src/plugins/cppeditor/cpprefactoringchanges.h +++ b/src/plugins/cppeditor/cpprefactoringchanges.h @@ -12,6 +12,8 @@ #include <texteditor/refactoringchanges.h> +#include <optional> + namespace CppEditor { class CppRefactoringChanges; @@ -44,6 +46,8 @@ public: void startAndEndOf(unsigned index, int *start, int *end) const; + QList<CPlusPlus::Token> tokensForCursor() const; + using TextEditor::RefactoringFile::textOf; QString textOf(const CPlusPlus::AST *ast) const; @@ -55,6 +59,9 @@ protected: CppRefactoringChangesData *data() const; void fileChanged() override; + int tokenIndexForPosition(const std::vector<CPlusPlus::Token> &tokens, int pos, + int startIndex) const; + mutable CPlusPlus::Document::Ptr m_cppDocument; friend class CppRefactoringChanges; // for access to constructor From 099fe7d5d1cfddec3e5ace152da671942a68e813 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 3 Aug 2023 17:15:08 +0200 Subject: [PATCH 0622/1777] CppEditor: Let users fold/unfold all comment blocks Fixes: QTCREATORBUG-2449 Change-Id: Ib090f1bb0d0866f14ddb6dfb10bf2ff2563585e0 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/cppeditor/cppeditorplugin.cpp | 13 +++++ src/plugins/cppeditor/cppmodelmanager.cpp | 49 +++++++++++++++++++ src/plugins/cppeditor/cppmodelmanager.h | 3 +- src/plugins/texteditor/texteditor.cpp | 36 +++++++++----- src/plugins/texteditor/texteditor.h | 6 ++- .../texteditor/texteditoractionhandler.cpp | 4 +- 6 files changed, 93 insertions(+), 18 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index e47c939d280..b1f69fbacf7 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -396,6 +396,19 @@ void CppEditorPlugin::initialize() connect(showPreprocessedInSplitAction, &QAction::triggered, this, [] { CppModelManager::showPreprocessedFile(true); }); + QAction * const foldCommentsAction = new QAction(Tr::tr("Fold All Comment Blocks"), this); + command = ActionManager::registerAction(foldCommentsAction, + "CppTools.FoldCommentBlocks", context); + mcpptools->addAction(command); + contextMenu->addAction(command, Constants::G_CONTEXT_FIRST); + connect(foldCommentsAction, &QAction::triggered, this, [] { CppModelManager::foldComments(); }); + QAction * const unfoldCommentsAction = new QAction(Tr::tr("Unfold All Comment Blocks"), this); + command = ActionManager::registerAction(unfoldCommentsAction, + "CppTools.UnfoldCommentBlocks", context); + mcpptools->addAction(command); + contextMenu->addAction(command, Constants::G_CONTEXT_FIRST); + connect(unfoldCommentsAction, &QAction::triggered, this, [] { CppModelManager::unfoldComments(); }); + QAction *const findUnusedFunctionsAction = new QAction(Tr::tr("Find Unused Functions"), this); command = ActionManager::registerAction(findUnusedFunctionsAction, "CppTools.FindUnusedFunctions"); diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index c95567eb3b6..d24a30d226c 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -12,6 +12,7 @@ #include "cppcodemodelsettings.h" #include "cppeditorconstants.h" #include "cppeditortr.h" +#include "cppeditorwidget.h" #include "cppfindreferences.h" #include "cppincludesfilter.h" #include "cppindexingsupport.h" @@ -59,6 +60,7 @@ #include <projectexplorer/target.h> #include <texteditor/textdocument.h> +#include <texteditor/textdocumentlayout.h> #include <utils/algorithm.h> #include <utils/environment.h> @@ -469,6 +471,53 @@ void CppModelManager::showPreprocessedFile(bool inNextSplit) compiler->start(); } +static void foldOrUnfoldComments(bool unfold) +{ + IEditor * const currentEditor = EditorManager::currentEditor(); + if (!currentEditor) + return; + const auto editorWidget = qobject_cast<CppEditorWidget*>(currentEditor->widget()); + if (!editorWidget) + return; + TextEditor::TextDocument * const textDoc = editorWidget->textDocument(); + QTC_ASSERT(textDoc, return); + + const Document::Ptr cppDoc = CppModelManager::snapshot().preprocessedDocument( + textDoc->contents(), textDoc->filePath()); + QTC_ASSERT(cppDoc, return); + cppDoc->tokenize(); + TranslationUnit * const tu = cppDoc->translationUnit(); + if (!tu || !tu->isTokenized()) + return; + + for (int commentTokIndex = 0; commentTokIndex < tu->commentCount(); ++commentTokIndex) { + const Token &tok = tu->commentAt(commentTokIndex); + if (tok.kind() != T_COMMENT && tok.kind() != T_DOXY_COMMENT) + continue; + const int tokenPos = tu->getTokenPositionInDocument(tok, textDoc->document()); + const int tokenEndPos = tu->getTokenEndPositionInDocument(tok, textDoc->document()); + const QTextBlock tokenBlock = textDoc->document()->findBlock(tokenPos); + if (!tokenBlock.isValid()) + continue; + const QTextBlock nextBlock = tokenBlock.next(); + if (!nextBlock.isValid()) + continue; + if (tokenEndPos < nextBlock.position()) + continue; + if (TextEditor::TextDocumentLayout::foldingIndent(tokenBlock) + >= TextEditor::TextDocumentLayout::foldingIndent(nextBlock)) { + continue; + } + if (unfold) + editorWidget->unfold(tokenBlock); + else + editorWidget->fold(tokenBlock); + } +} + +void CppModelManager::foldComments() { foldOrUnfoldComments(false); } +void CppModelManager::unfoldComments() { foldOrUnfoldComments(true); } + class FindUnusedActionsEnabledSwitcher { public: diff --git a/src/plugins/cppeditor/cppmodelmanager.h b/src/plugins/cppeditor/cppmodelmanager.h index 2e78042eb79..bdda63ee550 100644 --- a/src/plugins/cppeditor/cppmodelmanager.h +++ b/src/plugins/cppeditor/cppmodelmanager.h @@ -190,12 +190,13 @@ public: static void findUsages(const CursorInEditor &data, Backend backend = Backend::Best); static void switchHeaderSource(bool inNextSplit, Backend backend = Backend::Best); static void showPreprocessedFile(bool inNextSplit); + static void foldComments(); + static void unfoldComments(); static void findUnusedFunctions(const Utils::FilePath &folder); static void checkForUnusedSymbol(Core::SearchResult *search, const Utils::Link &link, CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context, const Utils::LinkHandler &callback); - static CppIndexingSupport *indexingSupport(); static Utils::FilePaths projectFiles(); diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 8d16d57922e..9cee311e6d9 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -7881,40 +7881,50 @@ void TextEditorWidget::setExtraEncodingSettings(const ExtraEncodingSettings &ext d->m_document->setExtraEncodingSettings(extraEncodingSettings); } -void TextEditorWidget::fold() +void TextEditorWidget::foldCurrentBlock() +{ + fold(textCursor().block()); +} + +void TextEditorWidget::fold(const QTextBlock &block) { QTextDocument *doc = document(); auto documentLayout = qobject_cast<TextDocumentLayout*>(doc->documentLayout()); QTC_ASSERT(documentLayout, return); - QTextBlock block = textCursor().block(); - if (!(TextDocumentLayout::canFold(block) && block.next().isVisible())) { + QTextBlock b = block; + if (!(TextDocumentLayout::canFold(b) && b.next().isVisible())) { // find the closest previous block which can fold - int indent = TextDocumentLayout::foldingIndent(block); - while (block.isValid() && (TextDocumentLayout::foldingIndent(block) >= indent || !block.isVisible())) - block = block.previous(); + int indent = TextDocumentLayout::foldingIndent(b); + while (b.isValid() && (TextDocumentLayout::foldingIndent(b) >= indent || !b.isVisible())) + b = b.previous(); } - if (block.isValid()) { - TextDocumentLayout::doFoldOrUnfold(block, false); + if (b.isValid()) { + TextDocumentLayout::doFoldOrUnfold(b, false); d->moveCursorVisible(); documentLayout->requestUpdate(); documentLayout->emitDocumentSizeChanged(); } } -void TextEditorWidget::unfold() +void TextEditorWidget::unfold(const QTextBlock &block) { QTextDocument *doc = document(); auto documentLayout = qobject_cast<TextDocumentLayout*>(doc->documentLayout()); QTC_ASSERT(documentLayout, return); - QTextBlock block = textCursor().block(); - while (block.isValid() && !block.isVisible()) - block = block.previous(); - TextDocumentLayout::doFoldOrUnfold(block, true); + QTextBlock b = block; + while (b.isValid() && !b.isVisible()) + b = b.previous(); + TextDocumentLayout::doFoldOrUnfold(b, true); d->moveCursorVisible(); documentLayout->requestUpdate(); documentLayout->emitDocumentSizeChanged(); } +void TextEditorWidget::unfoldCurrentBlock() +{ + unfold(textCursor().block()); +} + void TextEditorWidget::unfoldAll() { QTextDocument *doc = document(); diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index c05425a5b07..0540c86be57 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -363,8 +363,10 @@ public: void deleteStartOfWord(); void deleteStartOfWordCamelCase(); void unfoldAll(); - void fold(); - void unfold(); + void fold(const QTextBlock &block); + void foldCurrentBlock(); + void unfold(const QTextBlock &block); + void unfoldCurrentBlock(); void selectEncoding(); void updateTextCodecLabel(); void selectLineEnding(int index); diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 00ed94a5ee7..4224b504433 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -344,11 +344,11 @@ void TextEditorActionHandlerPrivate::createActions() QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+Shift+S") : Tr::tr("Alt+Shift+S")), G_EDIT_TEXT, advancedEditMenu); registerAction(FOLD, - [] (TextEditorWidget *w) { w->fold(); }, true, Tr::tr("Fold"), + [] (TextEditorWidget *w) { w->foldCurrentBlock(); }, true, Tr::tr("Fold"), QKeySequence(Tr::tr("Ctrl+<")), G_EDIT_COLLAPSING, advancedEditMenu); registerAction(UNFOLD, - [] (TextEditorWidget *w) { w->unfold(); }, true, Tr::tr("Unfold"), + [] (TextEditorWidget *w) { w->unfoldCurrentBlock(); }, true, Tr::tr("Unfold"), QKeySequence(Tr::tr("Ctrl+>")), G_EDIT_COLLAPSING, advancedEditMenu); m_unfoldAllAction = registerAction(UNFOLD_ALL, From 4e56305a017c1aec5359fd68e50ca255a879409d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 7 Aug 2023 16:58:29 +0200 Subject: [PATCH 0623/1777] MemcheckToolRunner: Remove unused suppressionCount() signal Change-Id: I887f4bf9f373da07389e84bf62829a17debc103d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/memchecktool.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 70bc01f7e7c..b7f54c9a107 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -107,7 +107,6 @@ public: signals: void internalParserError(const QString &errorString); void parserError(const Valgrind::XmlProtocol::Error &error); - void suppressionCount(const QString &name, qint64 count); private: QString progressTitle() const override; @@ -1157,8 +1156,6 @@ MemcheckToolRunner::MemcheckToolRunner(RunControl *runControl) setId("MemcheckToolRunner"); connect(m_runner.parser(), &XmlProtocol::ThreadedParser::error, this, &MemcheckToolRunner::parserError); - connect(m_runner.parser(), &XmlProtocol::ThreadedParser::suppressionCount, - this, &MemcheckToolRunner::suppressionCount); if (m_withGdb) { connect(&m_runner, &ValgrindRunner::valgrindStarted, From 43dca6ec781711cee14cfc752e5b2b60e0fb311b Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 7 Aug 2023 16:59:53 +0200 Subject: [PATCH 0624/1777] ThreadedParser: Remove unused signals Change-Id: Ib158902f9d433cc48bdba58aa6b685aa7d41f5b4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/xmlprotocol/threadedparser.cpp | 6 ------ src/plugins/valgrind/xmlprotocol/threadedparser.h | 2 -- 2 files changed, 8 deletions(-) diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp index 788d95aafaf..d42b17a58c7 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp @@ -83,12 +83,6 @@ void ThreadedParser::parse(QIODevice *device) connect(parser, &Parser::internalError, this, &ThreadedParser::slotInternalError, Qt::QueuedConnection); - connect(parser, &Parser::errorCount, - this, &ThreadedParser::errorCount, - Qt::QueuedConnection); - connect(parser, &Parser::suppressionCount, - this, &ThreadedParser::suppressionCount, - Qt::QueuedConnection); connect(parser, &Parser::finished, this, &ThreadedParser::finished, Qt::QueuedConnection); diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.h b/src/plugins/valgrind/xmlprotocol/threadedparser.h index 08d9cd760b9..59cd811ad98 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.h +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.h @@ -43,8 +43,6 @@ signals: void status(const Valgrind::XmlProtocol::Status &status); void error(const Valgrind::XmlProtocol::Error &error); void internalError(const QString &errorString); - void errorCount(qint64 unique, qint64 count); - void suppressionCount(const QString &name, qint64 count); void finished(); private: From 91f01c17f9fcb25f41625e24bd59dc34ffd8720c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 5 Aug 2023 10:17:55 +0200 Subject: [PATCH 0625/1777] ValgrindRunner: Hide ThreadedParser Expose its signals instead. Change-Id: I0daeb2e510c30678f4f13d880bc8108510c4f32e Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/valgrind/memchecktool.cpp | 7 +++---- src/plugins/valgrind/valgrindmemcheckparsertest.h | 10 +++------- src/plugins/valgrind/valgrindrunner.cpp | 11 +++++------ src/plugins/valgrind/valgrindrunner.h | 12 +++++++++--- src/plugins/valgrind/valgrindtestrunnertest.cpp | 7 ++----- tests/auto/valgrind/memcheck/modeldemo.cpp | 6 ++---- 6 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index b7f54c9a107..192791d5569 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -175,7 +175,7 @@ void MemcheckToolRunner::start() void MemcheckToolRunner::stop() { - disconnect(m_runner.parser(), &ThreadedParser::internalError, + disconnect(&m_runner, &ValgrindRunner::internalError, this, &MemcheckToolRunner::internalParserError); ValgrindToolRunner::stop(); } @@ -1154,8 +1154,7 @@ MemcheckToolRunner::MemcheckToolRunner(RunControl *runControl) m_localServerAddress(QHostAddress::LocalHost) { setId("MemcheckToolRunner"); - connect(m_runner.parser(), &XmlProtocol::ThreadedParser::error, - this, &MemcheckToolRunner::parserError); + connect(&m_runner, &ValgrindRunner::error, this, &MemcheckToolRunner::parserError); if (m_withGdb) { connect(&m_runner, &ValgrindRunner::valgrindStarted, @@ -1164,7 +1163,7 @@ MemcheckToolRunner::MemcheckToolRunner(RunControl *runControl) this, &MemcheckToolRunner::appendLog); // m_runner.disableXml(); } else { - connect(m_runner.parser(), &XmlProtocol::ThreadedParser::internalError, + connect(&m_runner, &ValgrindRunner::internalError, this, &MemcheckToolRunner::internalParserError); } diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.h b/src/plugins/valgrind/valgrindmemcheckparsertest.h index 96fd6ad186d..a5dbcf7153e 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.h +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.h @@ -11,7 +11,6 @@ #include "xmlprotocol/error.h" #include "xmlprotocol/status.h" -#include "xmlprotocol/threadedparser.h" #include "xmlprotocol/parser.h" #include "valgrindrunner.h" @@ -66,12 +65,9 @@ class RunnerDumper : public QObject public: explicit RunnerDumper(ValgrindRunner *runner) { - connect(runner->parser(), &XmlProtocol::ThreadedParser::error, - this, &RunnerDumper::error); - connect(runner->parser(), &XmlProtocol::ThreadedParser::internalError, - this, &RunnerDumper::internalError); - connect(runner->parser(), &XmlProtocol::ThreadedParser::status, - this, &RunnerDumper::status); + connect(runner, &ValgrindRunner::error, this, &RunnerDumper::error); + connect(runner, &ValgrindRunner::internalError, this, &RunnerDumper::internalError); + connect(runner, &ValgrindRunner::status, this, &RunnerDumper::status); connect(runner, &ValgrindRunner::logMessageReceived, this, &RunnerDumper::logMessageReceived); connect(runner, &ValgrindRunner::processErrorReceived, diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index fd265444226..804167b7bce 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -18,6 +18,7 @@ using namespace ProjectExplorer; using namespace Utils; +using namespace Valgrind::XmlProtocol; namespace Valgrind { @@ -58,7 +59,7 @@ public: QHostAddress m_localServerAddress; QTcpServer m_xmlServer; - XmlProtocol::ThreadedParser m_parser; + ThreadedParser m_parser; QTcpServer m_logServer; }; @@ -159,6 +160,9 @@ bool ValgrindRunner::Private::run() ValgrindRunner::ValgrindRunner(QObject *parent) : QObject(parent), d(new Private(this)) { + connect(&d->m_parser, &ThreadedParser::status, this, &ValgrindRunner::status); + connect(&d->m_parser, &ThreadedParser::error, this, &ValgrindRunner::error); + connect(&d->m_parser, &ThreadedParser::internalError, this, &ValgrindRunner::internalError); } ValgrindRunner::~ValgrindRunner() @@ -225,9 +229,4 @@ void ValgrindRunner::stop() d->m_process.stop(); } -XmlProtocol::ThreadedParser *ValgrindRunner::parser() const -{ - return &d->m_parser; -} - } // namespace Valgrind diff --git a/src/plugins/valgrind/valgrindrunner.h b/src/plugins/valgrind/valgrindrunner.h index c6426fba830..c90be9cf927 100644 --- a/src/plugins/valgrind/valgrindrunner.h +++ b/src/plugins/valgrind/valgrindrunner.h @@ -16,7 +16,10 @@ namespace ProjectExplorer { class Runnable; } namespace Valgrind { -namespace XmlProtocol { class ThreadedParser; } +namespace XmlProtocol { +class Error; +class Status; +} class ValgrindRunner : public QObject { @@ -39,8 +42,6 @@ public: bool start(); void stop(); - XmlProtocol::ThreadedParser *parser() const; - signals: void appendMessage(const QString &, Utils::OutputFormat); @@ -50,6 +51,11 @@ signals: void valgrindStarted(qint64 pid); void finished(); + // Parser's signals + void status(const Valgrind::XmlProtocol::Status &status); + void error(const Valgrind::XmlProtocol::Error &error); + void internalError(const QString &errorString); + private: class Private; Private *d; diff --git a/src/plugins/valgrind/valgrindtestrunnertest.cpp b/src/plugins/valgrind/valgrindtestrunnertest.cpp index 4e42572ce72..427b83617af 100644 --- a/src/plugins/valgrind/valgrindtestrunnertest.cpp +++ b/src/plugins/valgrind/valgrindtestrunnertest.cpp @@ -5,7 +5,6 @@ #include "xmlprotocol/frame.h" #include "xmlprotocol/stack.h" -#include "xmlprotocol/threadedparser.h" #include "valgrindrunner.h" #include <projectexplorer/devicesupport/devicemanager.h> @@ -117,10 +116,8 @@ void ValgrindTestRunnerTest::init() this, &ValgrindTestRunnerTest::logMessageReceived); connect(m_runner, &ValgrindRunner::processErrorReceived, this, &ValgrindTestRunnerTest::internalError); - connect(m_runner->parser(), &ThreadedParser::internalError, - this, &ValgrindTestRunnerTest::internalError); - connect(m_runner->parser(), &ThreadedParser::error, - this, &ValgrindTestRunnerTest::error); + connect(m_runner, &ValgrindRunner::internalError, this, &ValgrindTestRunnerTest::internalError); + connect(m_runner, &ValgrindRunner::error, this, &ValgrindTestRunnerTest::error); } //BEGIN: Actual test cases diff --git a/tests/auto/valgrind/memcheck/modeldemo.cpp b/tests/auto/valgrind/memcheck/modeldemo.cpp index 7739b441307..493e9820c42 100644 --- a/tests/auto/valgrind/memcheck/modeldemo.cpp +++ b/tests/auto/valgrind/memcheck/modeldemo.cpp @@ -34,11 +34,9 @@ int main(int argc, char *argv[]) runner.setValgrindCommand({VALGRIND_FAKE_PATH, {"-i", PARSERTESTS_DATA_DIR "/memcheck-output-sample1.xml"}}); ModelDemo demo(&runner); - QObject::connect(&runner, &ValgrindRunner::finished, - &demo, &ModelDemo::finished); + QObject::connect(&runner, &ValgrindRunner::finished, &demo, &ModelDemo::finished); ErrorListModel model; - QObject::connect(runner.parser(), &ThreadedParser::error, - &model, &ErrorListModel::addError, + QObject::connect(&runner, &ValgrindRunner::error, &model, &ErrorListModel::addError, Qt::QueuedConnection); QTreeView errorview; From 00a34e60fc307d3828b765aab88e5d2c9f31d2eb Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 5 Aug 2023 10:33:26 +0200 Subject: [PATCH 0626/1777] Valgrind test: Hide Recorder and Dumper in cpp file Inline Recorder's and Dumper's slots. Clean some namespace specifiers. Change-Id: I1111e8fb3c912dc1f253ebb2ed7f8e9c3fff67e0 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- .../valgrind/valgrindmemcheckparsertest.cpp | 80 ++++++++++----- .../valgrind/valgrindmemcheckparsertest.h | 97 +------------------ 2 files changed, 62 insertions(+), 115 deletions(-) diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp index 256557c178c..7c5a9725119 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -3,23 +3,21 @@ #include "valgrindmemcheckparsertest.h" +#include "valgrindrunner.h" +#include "xmlprotocol/error.h" #include "xmlprotocol/frame.h" #include "xmlprotocol/parser.h" #include "xmlprotocol/stack.h" +#include "xmlprotocol/status.h" #include "xmlprotocol/suppression.h" -#include <projectexplorer/projectexplorer.h> -#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runcontrol.h> -#include <QFile> #include <QFileInfo> #include <QProcess> -#include <QString> -#include <QTest> #include <QTcpServer> #include <QTcpSocket> -#include <QSignalSpy> +#include <QTest> using namespace Utils; using namespace Valgrind::XmlProtocol; @@ -43,16 +41,9 @@ inline bool qCompare(const QString &t1, char const *t2, } // namespace QTest QT_END_NAMESPACE -namespace Valgrind { -namespace Test { +namespace Valgrind::Test { -static void dumpFrame(const Frame &f) -{ - qDebug() << f.instructionPointer() << f.directory() << f.fileName() << f.functionName() - << f.line() << f.object(); -} - -void dumpError(const Error &e) +static void dumpError(const Error &e) { qDebug() << e.kind() << e.leakedBlocks() << e.leakedBytes() << e.what() << e.tid() << e.unique(); qDebug() << "stacks:" << e.stacks().size(); @@ -60,15 +51,61 @@ void dumpError(const Error &e) qDebug() << s.auxWhat() << s.directory() << s.file() << s.line() << s.helgrindThreadId(); qDebug() << "frames:"; for (const Frame &f : s.frames()) { - dumpFrame(f); + qDebug() << f.instructionPointer() << f.directory() << f.fileName() << f.functionName() + << f.line() << f.object(); } } } +class Recorder : public QObject +{ +public: + explicit Recorder(Parser *parser) + { + connect(parser, &Parser::error, this, [this](const Error &err) { errors.append(err); }); + connect(parser, &Parser::errorCount, this, [this](qint64 unique, qint64 count) { + errorcounts.push_back({unique, count}); + }); + connect(parser, &Parser::suppressionCount, this, [this](const QString &name, qint64 count) { + suppcounts.push_back({name, count}); + }); + } + + QList<Error> errors; + QList<QPair<qint64, qint64>> errorcounts; + QList<QPair<QString, qint64>> suppcounts; +}; + +class RunnerDumper : public QObject +{ +public: + explicit RunnerDumper(ValgrindRunner *runner) + { + connect(runner, &ValgrindRunner::error, this, [](const Error &err) { + qDebug() << "error received"; + dumpError(err); + }); + connect(runner, &ValgrindRunner::internalError, this, [](const QString &err) { + qDebug() << "internal error received:" << err; + }); + connect(runner, &ValgrindRunner::status, this, [](const Status &status) { + qDebug() << "status received:" << status.state() << status.time(); + }); + connect(runner, &ValgrindRunner::logMessageReceived, this, [](const QByteArray &log) { + qDebug() << "log message received:" << log; + }); + connect(runner, &ValgrindRunner::processErrorReceived, this, [this](const QString &) { + m_errorReceived = true; + }); + } + + bool m_errorReceived = false; +}; + static QString fakeValgrindExecutable() { - QString valgrindFakePath(VALGRIND_FAKE_PATH); - if (Utils::HostOsInfo::isWindowsHost()) { + const QString valgrindFakePath(VALGRIND_FAKE_PATH); + if (HostOsInfo::isWindowsHost()) { QFileInfo fi(QString(valgrindFakePath + "/debug"), "valgrind-fake.exe"); if (fi.exists()) return fi.canonicalFilePath(); @@ -465,7 +502,7 @@ void ValgrindMemcheckParserTest::testParserStop() void ValgrindMemcheckParserTest::testRealValgrind() { - const Utils::Environment &sysEnv = Utils::Environment::systemEnvironment(); + const Environment &sysEnv = Environment::systemEnvironment(); auto fileName = sysEnv.searchInPath("valgrind"); if (fileName.isEmpty()) QSKIP("This test needs valgrind in PATH"); @@ -510,7 +547,7 @@ void ValgrindMemcheckParserTest::testValgrindStartError() ProjectExplorer::Runnable debuggeeExecutable; debuggeeExecutable.command.setExecutable(FilePath::fromString(debuggee)); debuggeeExecutable.command.setArguments(debuggeeArgs); - debuggeeExecutable.environment = Utils::Environment::systemEnvironment(); + debuggeeExecutable.environment = Environment::systemEnvironment(); ValgrindRunner runner; runner.setValgrindCommand({FilePath::fromString(valgrindExe), valgrindArgs}); @@ -522,5 +559,4 @@ void ValgrindMemcheckParserTest::testValgrindStartError() // just finish without deadlock and we are fine } -} // namespace Test -} // namespace Valgrind +} // namespace Valgrind::Test diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.h b/src/plugins/valgrind/valgrindmemcheckparsertest.h index a5dbcf7153e..76575349185 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.h +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.h @@ -4,103 +4,15 @@ #pragma once #include <QObject> -#include <QPair> #include <QStringList> -#include <QVector> -#include <QDebug> - -#include "xmlprotocol/error.h" -#include "xmlprotocol/status.h" -#include "xmlprotocol/parser.h" -#include "valgrindrunner.h" QT_BEGIN_NAMESPACE +class QProcess; class QTcpServer; class QTcpSocket; -class QProcess; QT_END_NAMESPACE -namespace Valgrind { -namespace Test { - -void dumpError(const Valgrind::XmlProtocol::Error &e); - -class Recorder : public QObject -{ -public: - explicit Recorder(XmlProtocol::Parser *parser) - { - connect(parser, &XmlProtocol::Parser::error, - this, &Recorder::error); - connect(parser, &XmlProtocol::Parser::errorCount, - this, &Recorder::errorCount); - connect(parser, &XmlProtocol::Parser::suppressionCount, - this, &Recorder::suppressionCount); - } - - QList<Valgrind::XmlProtocol::Error> errors; - QVector<QPair<qint64,qint64> > errorcounts; - QVector<QPair<QString,qint64> > suppcounts; - -public: - void error(const Valgrind::XmlProtocol::Error &err) - { - errors.append(err); - } - - void errorCount(qint64 unique, qint64 count) - { - errorcounts.push_back({unique, count}); - } - - void suppressionCount(const QString &name, qint64 count) - { - suppcounts.push_back({name, count}); - } - -}; - -class RunnerDumper : public QObject -{ -public: - explicit RunnerDumper(ValgrindRunner *runner) - { - connect(runner, &ValgrindRunner::error, this, &RunnerDumper::error); - connect(runner, &ValgrindRunner::internalError, this, &RunnerDumper::internalError); - connect(runner, &ValgrindRunner::status, this, &RunnerDumper::status); - connect(runner, &ValgrindRunner::logMessageReceived, - this, &RunnerDumper::logMessageReceived); - connect(runner, &ValgrindRunner::processErrorReceived, - this, &RunnerDumper::processErrorReceived); - } - - void error(const Valgrind::XmlProtocol::Error &e) - { - qDebug() << "error received"; - dumpError(e); - } - void internalError(const QString& error) - { - qDebug() << "internal error received:" << error; - } - void status(const Valgrind::XmlProtocol::Status &status) - { - qDebug() << "status received:" << status.state() << status.time(); - } - void logMessageReceived(const QByteArray &log) - { - qDebug() << "log message received:" << log; - } - void processErrorReceived(const QString &s) - { - Q_UNUSED(s) - // qDebug() << "error received:" << s; // this can be a lot of text - m_errorReceived = true; - } - -public: - bool m_errorReceived = false; -}; +namespace Valgrind::Test { class ValgrindMemcheckParserTest : public QObject { @@ -125,12 +37,11 @@ private slots: void testValgrindStartError(); private: - void initTest(const QString &testfile, const QStringList &otherArgs = QStringList()); + void initTest(const QString &testfile, const QStringList &otherArgs = {}); QTcpServer *m_server = nullptr; QProcess *m_process = nullptr; QTcpSocket *m_socket = nullptr; }; -} // namespace Test -} // namespace Valgrind +} // namespace Valgrind::Test From fbf932539535f43cc80849c2710bd98878aea124 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 5 Aug 2023 10:55:52 +0200 Subject: [PATCH 0627/1777] ValgrindPlugin: Use QList instead of QVector Change-Id: Ib1bd223b73d1f7399008f91a3c26ff515ab03a0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../valgrind/callgrind/callgrindcallmodel.cpp | 8 ++++---- .../valgrind/callgrind/callgrindcallmodel.h | 4 ++-- .../valgrind/callgrind/callgrindcostitem.cpp | 10 +++++----- .../valgrind/callgrind/callgrindcostitem.h | 6 +++--- .../callgrind/callgrindcycledetection.cpp | 6 +++--- .../callgrind/callgrindcycledetection.h | 4 ++-- .../valgrind/callgrind/callgrinddatamodel.cpp | 4 ++-- .../valgrind/callgrind/callgrindfunction.cpp | 14 ++++++------- .../valgrind/callgrind/callgrindfunction.h | 10 +++++----- .../valgrind/callgrind/callgrindfunction_p.h | 18 ++++++++--------- .../callgrind/callgrindfunctioncall.cpp | 14 ++++++------- .../callgrind/callgrindfunctioncall.h | 10 +++++----- .../callgrind/callgrindfunctioncycle.cpp | 10 +++++----- .../callgrind/callgrindfunctioncycle.h | 4 ++-- .../valgrind/callgrind/callgrindparsedata.cpp | 17 ++++++++-------- .../valgrind/callgrind/callgrindparsedata.h | 4 ++-- .../valgrind/callgrind/callgrindparser.cpp | 14 ++++++------- .../callgrind/callgrindproxymodel.cpp | 2 +- src/plugins/valgrind/callgrindtool.cpp | 2 +- .../valgrind/callgrindvisualisation.cpp | 4 ++-- src/plugins/valgrind/memchecktool.cpp | 6 +++--- .../valgrind/valgrindmemcheckparsertest.cpp | 20 +++++++++---------- .../valgrind/xmlprotocol/announcethread.cpp | 8 ++++---- .../valgrind/xmlprotocol/announcethread.h | 6 +++--- src/plugins/valgrind/xmlprotocol/error.cpp | 10 +++++----- src/plugins/valgrind/xmlprotocol/error.h | 6 +++--- .../valgrind/xmlprotocol/errorlistmodel.cpp | 16 +++++++-------- src/plugins/valgrind/xmlprotocol/parser.cpp | 16 +++++++-------- src/plugins/valgrind/xmlprotocol/stack.cpp | 8 ++++---- src/plugins/valgrind/xmlprotocol/stack.h | 6 +++--- .../valgrind/xmlprotocol/stackmodel.cpp | 4 ++-- .../valgrind/xmlprotocol/suppression.cpp | 1 - .../valgrind/xmlprotocol/suppression.h | 4 ++-- 33 files changed, 137 insertions(+), 139 deletions(-) diff --git a/src/plugins/valgrind/callgrind/callgrindcallmodel.cpp b/src/plugins/valgrind/callgrind/callgrindcallmodel.cpp index 31c00067f13..b341e29d5d1 100644 --- a/src/plugins/valgrind/callgrind/callgrindcallmodel.cpp +++ b/src/plugins/valgrind/callgrind/callgrindcallmodel.cpp @@ -10,7 +10,7 @@ #include <utils/qtcassert.h> -#include <QVector> +#include <QList> namespace Valgrind::Callgrind { @@ -18,7 +18,7 @@ class CallModel::Private { public: const ParseData *m_data = nullptr; - QVector<const FunctionCall *> m_calls; + QList<const FunctionCall *> m_calls; int m_event = 0; const Function *m_function = nullptr; }; @@ -41,7 +41,7 @@ void CallModel::clear() endResetModel(); } -void CallModel::setCalls(const QVector<const FunctionCall *> &calls, const Function *function) +void CallModel::setCalls(const QList<const FunctionCall *> &calls, const Function *function) { beginResetModel(); d->m_function = function; @@ -49,7 +49,7 @@ void CallModel::setCalls(const QVector<const FunctionCall *> &calls, const Funct endResetModel(); } -QVector<const FunctionCall *> CallModel::calls() const +QList<const FunctionCall *> CallModel::calls() const { return d->m_calls; } diff --git a/src/plugins/valgrind/callgrind/callgrindcallmodel.h b/src/plugins/valgrind/callgrind/callgrindcallmodel.h index 8a45671de67..4b8e6f631e4 100644 --- a/src/plugins/valgrind/callgrind/callgrindcallmodel.h +++ b/src/plugins/valgrind/callgrind/callgrindcallmodel.h @@ -32,8 +32,8 @@ public: virtual void setParseData(const ParseData *data); virtual const ParseData *parseData() const; - void setCalls(const QVector<const FunctionCall *> &calls, const Function *function); - QVector<const FunctionCall *> calls() const; + void setCalls(const QList<const FunctionCall *> &calls, const Function *function); + QList<const FunctionCall *> calls() const; const Function *function() const; int rowCount(const QModelIndex &parent = QModelIndex()) const override; diff --git a/src/plugins/valgrind/callgrind/callgrindcostitem.cpp b/src/plugins/valgrind/callgrind/callgrindcostitem.cpp index 3bbf71fc419..40aa56de31e 100644 --- a/src/plugins/valgrind/callgrind/callgrindcostitem.cpp +++ b/src/plugins/valgrind/callgrind/callgrindcostitem.cpp @@ -6,9 +6,9 @@ #include "callgrindparsedata.h" #include "callgrindfunctioncall.h" +#include <QList> #include <QString> #include <QStringList> -#include <QVector> namespace Valgrind::Callgrind { @@ -18,8 +18,8 @@ public: Private(ParseData *data); ~Private(); - QVector<quint64> m_positions; - QVector<quint64> m_events; + QList<quint64> m_positions; + QList<quint64> m_events; const FunctionCall *m_call = nullptr; const ParseData *m_data = nullptr; @@ -60,7 +60,7 @@ void CostItem::setPosition(int posIdx, quint64 position) d->m_positions[posIdx] = position; } -QVector< quint64 > CostItem::positions() const +QList<quint64> CostItem::positions() const { return d->m_positions; } @@ -75,7 +75,7 @@ void CostItem::setCost(int event, quint64 cost) d->m_events[event] = cost; } -QVector< quint64 > CostItem::costs() const +QList<quint64> CostItem::costs() const { return d->m_events; } diff --git a/src/plugins/valgrind/callgrind/callgrindcostitem.h b/src/plugins/valgrind/callgrind/callgrindcostitem.h index 3b69d688925..3cc54df1dab 100644 --- a/src/plugins/valgrind/callgrind/callgrindcostitem.h +++ b/src/plugins/valgrind/callgrind/callgrindcostitem.h @@ -3,7 +3,7 @@ #pragma once -#include <QVector> +#include <QList> namespace Valgrind::Callgrind { @@ -27,7 +27,7 @@ public: */ quint64 position(int posIdx) const; void setPosition(int posIdx, quint64 position); - QVector<quint64> positions() const; + QList<quint64> positions() const; /** * Cost data for the given event-index @p event @@ -35,7 +35,7 @@ public: */ quint64 cost(int event) const; void setCost(int event, quint64 cost); - QVector<quint64> costs() const; + QList<quint64> costs() const; /** * If this cost item represents a function call, this will return the @c Callee. diff --git a/src/plugins/valgrind/callgrind/callgrindcycledetection.cpp b/src/plugins/valgrind/callgrind/callgrindcycledetection.cpp index ef8ab008091..c32e0ec9b7b 100644 --- a/src/plugins/valgrind/callgrind/callgrindcycledetection.cpp +++ b/src/plugins/valgrind/callgrind/callgrindcycledetection.cpp @@ -19,7 +19,7 @@ CycleDetection::CycleDetection(ParseData *data) { } -QVector<const Function *> CycleDetection::run(const QVector<const Function *> &input) +QList<const Function *> CycleDetection::run(const QList<const Function *> &input) { for (const Function *function : input) { Node *node = new Node; @@ -45,12 +45,12 @@ void CycleDetection::tarjan(Node *node) m_depth++; m_stack.push(node); - const QVector<const FunctionCall *> calls = node->function->outgoingCalls(); + const QList<const FunctionCall *> calls = node->function->outgoingCalls(); for (const FunctionCall *call : calls) tarjanForChildNode(node, m_nodes.value(call->callee())); if (node->dfs == node->lowlink) { - QVector<const Function *> functions; + QList<const Function *> functions; Node *n; do { n = m_stack.pop(); diff --git a/src/plugins/valgrind/callgrind/callgrindcycledetection.h b/src/plugins/valgrind/callgrind/callgrindcycledetection.h index 68eead96083..f38412fe549 100644 --- a/src/plugins/valgrind/callgrind/callgrindcycledetection.h +++ b/src/plugins/valgrind/callgrind/callgrindcycledetection.h @@ -25,7 +25,7 @@ class CycleDetection { public: explicit CycleDetection(ParseData *data); - QVector<const Function *> run(const QVector<const Function *> &input); + QList<const Function *> run(const QList<const Function *> &input); private: ParseData *m_data; @@ -41,7 +41,7 @@ private: QHash<const Function *, Node *> m_nodes; QStack<Node *> m_stack; - QVector<const Function *> m_ret; + QList<const Function *> m_ret; int m_depth = 0; int m_cycle = 0; diff --git a/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp b/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp index d5e9f370421..49d26262471 100644 --- a/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp +++ b/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp @@ -13,9 +13,9 @@ #include <QChar> #include <QDebug> +#include <QList> #include <QStringList> #include <QTextDocument> -#include <QVector> namespace Valgrind { namespace Callgrind { @@ -30,7 +30,7 @@ public: bool m_verboseToolTips = true; bool m_cycleDetection = false; bool m_shortenTemplates = false; - QVector<const Function *> m_functions; + QList<const Function *> m_functions; }; void DataModel::Private::updateFunctions() diff --git a/src/plugins/valgrind/callgrind/callgrindfunction.cpp b/src/plugins/valgrind/callgrind/callgrindfunction.cpp index ef10ec2ed98..0ec72d095d8 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunction.cpp +++ b/src/plugins/valgrind/callgrind/callgrindfunction.cpp @@ -39,7 +39,7 @@ Function::Private::~Private() qDeleteAll(m_outgoingCalls); } -void Function::Private::accumulateCost(QVector<quint64> &base, const QVector<quint64> &add) +void Function::Private::accumulateCost(QList<quint64> &base, const QList<quint64> &add) { if (base.isEmpty()) { base = add; @@ -72,7 +72,7 @@ FunctionCall *Function::Private::accumulateCall(const FunctionCall *call, CallTy accumulatedCall->setCosts(call->costs()); } else { - QVector<quint64> costs = accumulatedCall->costs(); + QList<quint64> costs = accumulatedCall->costs(); accumulateCost(costs, call->costs()); accumulatedCall->setCosts(costs); } @@ -206,7 +206,7 @@ quint64 Function::selfCost(int event) const return d->m_selfCost.at(event); } -QVector< quint64 > Function::selfCosts() const +QList<quint64> Function::selfCosts() const { return d->m_selfCost; } @@ -216,7 +216,7 @@ quint64 Function::inclusiveCost(int event) const return d->m_inclusiveCost.at(event) + d->m_selfCost.at(event); } -QVector<const FunctionCall *> Function::outgoingCalls() const +QList<const FunctionCall *> Function::outgoingCalls() const { return d->m_outgoingCalls; } @@ -228,7 +228,7 @@ void Function::addOutgoingCall(const FunctionCall *call) d->accumulateCall(call, Private::Outgoing); } -QVector<const FunctionCall *> Function::incomingCalls() const +QList<const FunctionCall *> Function::incomingCalls() const { return d->m_incomingCalls; } @@ -245,7 +245,7 @@ quint64 Function::called() const return d->m_called; } -QVector<const CostItem *> Function::costItems() const +QList<const CostItem *> Function::costItems() const { return d->m_costItems; } @@ -281,7 +281,7 @@ void Function::finalize() d->m_inclusiveCost.fill(0); for (const FunctionCall *call : std::as_const(d->m_incomingCalls)) { if (call->caller() != this) { - const QVector<const CostItem *> costItems = call->caller()->costItems(); + const QList<const CostItem *> costItems = call->caller()->costItems(); for (const CostItem *costItem : costItems) { if (costItem->call() && costItem->call()->callee() == this) d->accumulateCost(d->m_inclusiveCost, costItem->costs()); diff --git a/src/plugins/valgrind/callgrind/callgrindfunction.h b/src/plugins/valgrind/callgrind/callgrindfunction.h index 57d757cbbd6..491ee53dedd 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunction.h +++ b/src/plugins/valgrind/callgrind/callgrindfunction.h @@ -3,8 +3,8 @@ #pragma once +#include <QList> #include <QMetaType> -#include <QVector> namespace Valgrind { namespace Callgrind { @@ -67,7 +67,7 @@ public: * @see ParseData::events() */ quint64 selfCost(int event) const; - QVector<quint64> selfCosts() const; + QList<quint64> selfCosts() const; /** * total accumulated inclusive cost of @p event @@ -76,7 +76,7 @@ public: quint64 inclusiveCost(int event) const; /// calls from other functions to this function - QVector<const FunctionCall *> incomingCalls() const; + QList<const FunctionCall *> incomingCalls() const; void addIncomingCall(const FunctionCall *call); /// @return how often this function was called in total quint64 called() const; @@ -86,7 +86,7 @@ public: * a detailed view of the function's source code annotated with * cost per line. */ - QVector<const CostItem *> costItems() const; + QList<const CostItem *> costItems() const; /** * Add parsed @c CostItem @p item to this function. @@ -98,7 +98,7 @@ public: /** * Function calls from this function to others. */ - QVector<const FunctionCall *> outgoingCalls() const; + QList<const FunctionCall *> outgoingCalls() const; void addOutgoingCall(const FunctionCall *call); /** diff --git a/src/plugins/valgrind/callgrind/callgrindfunction_p.h b/src/plugins/valgrind/callgrind/callgrindfunction_p.h index bc648cc0249..8ec54200c76 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunction_p.h +++ b/src/plugins/valgrind/callgrind/callgrindfunction_p.h @@ -3,13 +3,13 @@ #pragma once -#include "callgrindfunction.h" -#include "callgrindparsedata.h" #include "callgrindcostitem.h" +#include "callgrindfunction.h" #include "callgrindfunctioncall.h" +#include "callgrindparsedata.h" -#include <QVector> #include <QHash> +#include <QList> namespace Valgrind { namespace Callgrind { @@ -20,7 +20,7 @@ public: Private(const ParseData *data); virtual ~Private(); - static void accumulateCost(QVector<quint64> &base, const QVector<quint64> &add); + static void accumulateCost(QList<quint64> &base, const QList<quint64> &add); enum CallType { Incoming, Outgoing @@ -33,16 +33,16 @@ public: qint64 m_objectId = -1; qint64 m_nameId = -1; - QVector<quint64> m_selfCost; - QVector<quint64> m_inclusiveCost; + QList<quint64> m_selfCost; + QList<quint64> m_inclusiveCost; - QVector<const CostItem *> m_costItems; + QList<const CostItem *> m_costItems; // used to accumulate, hence values not const QHash<const Function *, FunctionCall *> m_outgoingCallMap; QHash<const Function *, FunctionCall *> m_incomingCallMap; // used in public api, hence const - QVector<const FunctionCall *> m_outgoingCalls; - QVector<const FunctionCall *> m_incomingCalls; + QList<const FunctionCall *> m_outgoingCalls; + QList<const FunctionCall *> m_incomingCalls; quint64 m_called = 0; }; diff --git a/src/plugins/valgrind/callgrind/callgrindfunctioncall.cpp b/src/plugins/valgrind/callgrind/callgrindfunctioncall.cpp index 190edc23e10..aa59a2a1cc8 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunctioncall.cpp +++ b/src/plugins/valgrind/callgrind/callgrindfunctioncall.cpp @@ -7,7 +7,7 @@ #include <utils/qtcassert.h> -#include <QVector> +#include <QList> namespace Valgrind { namespace Callgrind { @@ -20,8 +20,8 @@ public: const Function *m_caller = nullptr; quint64 m_calls = 0; quint64 m_totalInclusiveCost = 0; - QVector<quint64> m_destinations; - QVector<quint64> m_costs; + QList<quint64> m_destinations; + QList<quint64> m_costs; }; //BEGIN FunctionCall @@ -71,12 +71,12 @@ quint64 FunctionCall::destination(int posIdx) const return d->m_destinations.at(posIdx); } -QVector<quint64> FunctionCall::destinations() const +QList<quint64> FunctionCall::destinations() const { return d->m_destinations; } -void FunctionCall::setDestinations(const QVector<quint64> &destinations) +void FunctionCall::setDestinations(const QList<quint64> &destinations) { d->m_destinations = destinations; } @@ -87,12 +87,12 @@ quint64 FunctionCall::cost(int event) const return d->m_costs.at(event); } -QVector<quint64> FunctionCall::costs() const +QList<quint64> FunctionCall::costs() const { return d->m_costs; } -void FunctionCall::setCosts(const QVector<quint64> &costs) +void FunctionCall::setCosts(const QList<quint64> &costs) { d->m_costs = costs; } diff --git a/src/plugins/valgrind/callgrind/callgrindfunctioncall.h b/src/plugins/valgrind/callgrind/callgrindfunctioncall.h index 961e71cb624..817e221ee98 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunctioncall.h +++ b/src/plugins/valgrind/callgrind/callgrindfunctioncall.h @@ -4,7 +4,7 @@ #pragma once #include <QMetaType> -#include <QVector> +#include <QList> namespace Valgrind { namespace Callgrind { @@ -37,16 +37,16 @@ public: * @see ParseData::positions() */ quint64 destination(int posIdx) const; - QVector<quint64> destinations() const; - void setDestinations(const QVector<quint64> &destinations); + QList<quint64> destinations() const; + void setDestinations(const QList<quint64> &destinations); /** * Inclusive cost of the function call. * @see ParseData::events() */ quint64 cost(int event) const; - QVector<quint64> costs() const; - void setCosts(const QVector<quint64> &costs); + QList<quint64> costs() const; + void setCosts(const QList<quint64> &costs); private: Q_DISABLE_COPY(FunctionCall) diff --git a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp index 92f4938b82e..f4d3fdfdedc 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp +++ b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp @@ -19,7 +19,7 @@ class FunctionCycle::Private : public Function::Private { public: Private(const ParseData *data); - QVector<const Function *> m_functions; + QList<const Function *> m_functions; }; FunctionCycle::Private::Private(const ParseData *data) @@ -39,7 +39,7 @@ FunctionCycle::FunctionCycle(const ParseData *data) // d should be deleted by Function::~Function() FunctionCycle::~FunctionCycle() = default; -void FunctionCycle::setFunctions(const QVector<const Function *> &functions) +void FunctionCycle::setFunctions(const QList<const Function *> &functions) { Private *d = CYCLE_D; @@ -55,13 +55,13 @@ void FunctionCycle::setFunctions(const QVector<const Function *> &functions) // just add up self cost Private::accumulateCost(d->m_selfCost, func->selfCosts()); // add outgoing calls to functions that are not part of the cycle - const QVector<const FunctionCall *> calls = func->outgoingCalls(); + const QList<const FunctionCall *> calls = func->outgoingCalls(); for (const FunctionCall *call : calls) { if (!functions.contains(call->callee())) d->accumulateCall(call, Function::Private::Outgoing); } // add incoming calls from functions that are not part of the cycle - const QVector<const FunctionCall *> inCalls = func->incomingCalls(); + const QList<const FunctionCall *> inCalls = func->incomingCalls(); for (const FunctionCall *call : inCalls) { if (!functions.contains(call->caller())) { d->accumulateCall(call, Function::Private::Incoming); @@ -80,7 +80,7 @@ void FunctionCycle::setFunctions(const QVector<const Function *> &functions) } } -QVector<const Function *> FunctionCycle::functions() const +QList<const Function *> FunctionCycle::functions() const { return CYCLE_D->m_functions; } diff --git a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.h b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.h index d25b54a7660..320219bc167 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.h +++ b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.h @@ -24,9 +24,9 @@ public: /// sets the list of functions that make up this cycle /// NOTE: ownership is *not* transferred to the cycle - void setFunctions(const QVector<const Function *> &functions); + void setFunctions(const QList<const Function *> &functions); /// @return the functions that make up this cycle - QVector<const Function *> functions() const; + QList<const Function *> functions() const; private: class Private; diff --git a/src/plugins/valgrind/callgrind/callgrindparsedata.cpp b/src/plugins/valgrind/callgrind/callgrindparsedata.cpp index 0f6f8285f64..7b7f2a3e672 100644 --- a/src/plugins/valgrind/callgrind/callgrindparsedata.cpp +++ b/src/plugins/valgrind/callgrind/callgrindparsedata.cpp @@ -3,17 +3,16 @@ #include "callgrindparsedata.h" -#include "callgrindfunction.h" #include "callgrindcycledetection.h" +#include "callgrindfunction.h" #include "callgrindfunctioncycle.h" #include "../valgrindtr.h" #include <utils/qtcassert.h> -#include <QStringList> -#include <QVector> -#include <QHash> #include <QCoreApplication> +#include <QHash> +#include <QStringList> namespace Valgrind { namespace Callgrind { @@ -32,8 +31,8 @@ public: QString m_fileName; QStringList m_events; QStringList m_positions; - QVector<quint64> m_totalCosts; - QVector<const Function *> m_functions; + QList<quint64> m_totalCosts; + QList<const Function *> m_functions; QString m_command; quint64 m_pid = 0; int m_lineNumberPositionIndex = -1; @@ -43,7 +42,7 @@ public: QStringList m_descriptions; QString m_creator; - QHash<qint64, QHash<qint64, QVector<Function *> > > functionLookup; + QHash<qint64, QHash<qint64, QList<Function *>>> functionLookup; using NameLookupTable = QHash<qint64, QString>; QString stringForCompression(const NameLookupTable &lookup, qint64 id); @@ -55,7 +54,7 @@ public: void cycleDetection(); void cleanupFunctionCycles(); - QVector<const Function *> m_cycleCache; + QList<const Function *> m_cycleCache; ParseData *m_q; }; @@ -233,7 +232,7 @@ void ParseData::setTotalCost(uint event, quint64 cost) d->m_totalCosts[event] = cost; } -QVector<const Function *> ParseData::functions(bool detectCycles) const +QList<const Function *> ParseData::functions(bool detectCycles) const { if (detectCycles) { d->cycleDetection(); diff --git a/src/plugins/valgrind/callgrind/callgrindparsedata.h b/src/plugins/valgrind/callgrind/callgrindparsedata.h index d74efa4b169..84a3b327a30 100644 --- a/src/plugins/valgrind/callgrind/callgrindparsedata.h +++ b/src/plugins/valgrind/callgrind/callgrindparsedata.h @@ -3,7 +3,7 @@ #pragma once -#include <QVector> +#include <QList> QT_BEGIN_NAMESPACE class QString; @@ -53,7 +53,7 @@ public: * * @return All functions that where reported in the data file. */ - QVector<const Function *> functions(bool detectCycles = false) const; + QList<const Function *> functions(bool detectCycles = false) const; /// NOTE: The @c ParseData will take ownership. void addFunction(const Function *function); diff --git a/src/plugins/valgrind/callgrind/callgrindparser.cpp b/src/plugins/valgrind/callgrind/callgrindparser.cpp index 4d22fcb695f..434e7751083 100644 --- a/src/plugins/valgrind/callgrind/callgrindparser.cpp +++ b/src/plugins/valgrind/callgrind/callgrindparser.cpp @@ -12,10 +12,10 @@ #include <utils/qtcassert.h> #include <utils/stringutils.h> -#include <QHash> -#include <QVector> -#include <QStringList> #include <QDebug> +#include <QHash> +#include <QList> +#include <QStringList> // #define DEBUG_PARSER @@ -162,13 +162,13 @@ public: FunctionCall *call = nullptr; }; CallData currentCallData; - QVector<quint64> callDestinations; + QList<quint64> callDestinations; // we can only resolve callees after parsing the whole file so save that data here for now - QVector<CallData> pendingCallees; + QList<CallData> pendingCallees; // id(s) for the ??? file - QVector<quint64> unknownFiles; + QList<quint64> unknownFiles; // functions which call themselves QSet<Function *> recursiveFunctions; @@ -197,7 +197,7 @@ void Parser::Private::parse(const FilePath &filePath) // build fast lookup of functions by their nameId QHash<qint64, QList<const Function *> > functionLookup; - const QVector<const Function *> functions = data->functions(); + const QList<const Function *> functions = data->functions(); for (const Function *function : functions) { functionLookup[function->nameId()].append(function); } diff --git a/src/plugins/valgrind/callgrind/callgrindproxymodel.cpp b/src/plugins/valgrind/callgrind/callgrindproxymodel.cpp index d13ec0c06e1..9d0c8353e6d 100644 --- a/src/plugins/valgrind/callgrind/callgrindproxymodel.cpp +++ b/src/plugins/valgrind/callgrind/callgrindproxymodel.cpp @@ -108,7 +108,7 @@ bool DataProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_ // check if the function from this index is a child of (called by) the filter function if (m_function) { bool isValid = false; - const QVector<const FunctionCall *> calls = func->incomingCalls(); + const QList<const FunctionCall *> calls = func->incomingCalls(); for (const FunctionCall *call : calls) { if (call->caller() == m_function) { isValid = true; diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 6062b95ea40..fb16a4441ef 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -187,7 +187,7 @@ public: QTimer m_updateTimer; - QVector<CallgrindTextMark *> m_textMarks; + QList<CallgrindTextMark *> m_textMarks; QAction *m_startAction = nullptr; QAction *m_stopAction = nullptr; diff --git a/src/plugins/valgrind/callgrindvisualisation.cpp b/src/plugins/valgrind/callgrindvisualisation.cpp index 4120dc53de2..d0673bbf849 100644 --- a/src/plugins/valgrind/callgrindvisualisation.cpp +++ b/src/plugins/valgrind/callgrindvisualisation.cpp @@ -18,11 +18,11 @@ #include <QGraphicsRectItem> #include <QGraphicsScene> #include <QGraphicsSimpleTextItem> +#include <QList> #include <QMouseEvent> #include <QPair> #include <QStaticText> #include <QStyleOptionGraphicsItem> -#include <QVector> #define VISUALISATION_DEBUG 0 // Margin from hardcoded value in: @@ -345,7 +345,7 @@ void Visualization::populateScene() qreal total = 0; using Pair = QPair<QModelIndex, qreal>; - QVector<Pair> costs; + QList<Pair> costs; for (int row = 0; row < d->m_model->rowCount(); ++row) { const QModelIndex index = d->m_model->index(row, DataModel::InclusiveCostColumn); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 192791d5569..4a353f7e908 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -245,11 +245,11 @@ static ErrorListModel::RelevantFrameFinder makeFrameFinder(const QStringList &pr { return [projectFiles](const Error &error) { const Frame defaultFrame = Frame(); - const QVector<Stack> stacks = error.stacks(); + const QList<Stack> stacks = error.stacks(); if (stacks.isEmpty()) return defaultFrame; const Stack &stack = stacks[0]; - const QVector<Frame> frames = stack.frames(); + const QList<Frame> frames = stack.frames(); if (frames.isEmpty()) return defaultFrame; @@ -348,7 +348,7 @@ bool MemcheckErrorFilterProxyModel::filterAcceptsRow(int sourceRow, const QModel } } - const QVector<Frame> frames = error.stacks().constFirst().frames(); + const QList<Frame> frames = error.stacks().constFirst().frames(); const int framesToLookAt = qMin(6, frames.size()); diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp index 7c5a9725119..5b6aeaa96a2 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -212,7 +212,7 @@ void ValgrindMemcheckParserTest::testHelgrindSample1() frame12.setDirectory("/home/frank/source/tarballs/qt-4.6.3-build/src/corelib/../../include/QtCore/../../src/corelib/thread"); frame12.setFileName("qmutex.h"); frame12.setLine(120); - stack1.setFrames(QVector<Frame>() << frame11 << frame12); + stack1.setFrames(QList<Frame>() << frame11 << frame12); Stack stack2; stack2.setAuxWhat("Required order was established by acquisition of lock at 0xA39C270"); @@ -230,7 +230,7 @@ void ValgrindMemcheckParserTest::testHelgrindSample1() frame22.setDirectory("/home/frank/source/tarballs/qt-4.6.3-build/src/corelib/../../include/QtCore/../../src/corelib/thread"); frame22.setFileName("qmutex.h"); frame22.setLine(121); - stack2.setFrames(QVector<Frame>() << frame21 << frame22); + stack2.setFrames(QList<Frame>() << frame21 << frame22); Stack stack3; stack3.setAuxWhat("followed by a later acquisition of lock at 0xA3AC010"); @@ -249,8 +249,8 @@ void ValgrindMemcheckParserTest::testHelgrindSample1() frame32.setFileName("qmutex.h"); frame32.setLine(122); - stack3.setFrames(QVector<Frame>() << frame31 << frame32); - error1.setStacks(QVector<Stack>() << stack1 << stack2 << stack3); + stack3.setFrames(QList<Frame>() << frame31 << frame32); + error1.setStacks(QList<Stack>() << stack1 << stack2 << stack3); expectedErrors.append(error1); } @@ -316,14 +316,14 @@ void ValgrindMemcheckParserTest::testMemcheckSample1() f4.setLine(4396); Stack s1; s1.setAuxWhat("Address 0x11527cb8 is not stack'd, malloc'd or (recently) free'd"); - s1.setFrames(QVector<Frame>() << f1 << f2 << f3 << f4); - error.setStacks( QVector<Stack>() << s1 ); + s1.setFrames(QList<Frame>() << f1 << f2 << f3 << f4); + error.setStacks(QList<Stack>() << s1); expectedErrors << error; } - const QVector<QPair<qint64,qint64>> expectedErrorCounts{{9, 2}}; - const QVector<QPair<QString,qint64>> expectedSuppCounts{ + const QList<QPair<qint64, qint64>> expectedErrorCounts{{9, 2}}; + const QList<QPair<QString, qint64>> expectedSuppCounts{ {QString("X on SUSE11 writev uninit padding"), 12}, {QString("dl-hack3-cond-1"), 2}, {QString("glibc-2.5.x-on-SUSE-10.2-(PPC)-2a"), 2}}; @@ -375,7 +375,7 @@ void ValgrindMemcheckParserTest::testMemcheckSample2() //the first auxwhat should be assigned to the _second_ stack. const QList<Error> errors = rec.errors; QCOMPARE(errors.size(), 1); - const QVector<Stack> stacks = errors.first().stacks(); + const QList<Stack> stacks = errors.first().stacks(); QCOMPARE(stacks.size(), 2); QCOMPARE(stacks.first().auxWhat(), QString()); QCOMPARE(stacks.last().auxWhat(), "Address 0x11b66c50 is 0 bytes inside a block of size 16 free'd"); @@ -404,7 +404,7 @@ void ValgrindMemcheckParserTest::testMemcheckSample3() { const Error error = errors.at(0); - const QVector<Stack> stacks = error.stacks(); + const QList<Stack> stacks = error.stacks(); QCOMPARE(error.unique(), 0x1ll); QCOMPARE(error.what(), "Conditional jump or move depends on uninitialised value(s)"); diff --git a/src/plugins/valgrind/xmlprotocol/announcethread.cpp b/src/plugins/valgrind/xmlprotocol/announcethread.cpp index 6d4b33b40ed..c693005adcd 100644 --- a/src/plugins/valgrind/xmlprotocol/announcethread.cpp +++ b/src/plugins/valgrind/xmlprotocol/announcethread.cpp @@ -5,7 +5,7 @@ #include "frame.h" #include <QSharedData> -#include <QVector> +#include <QList> #include <algorithm> @@ -16,7 +16,7 @@ class AnnounceThread::Private : public QSharedData { public: qint64 hThreadId = -1; - QVector<Frame> stack; + QList<Frame> stack; }; AnnounceThread::AnnounceThread() @@ -56,12 +56,12 @@ void AnnounceThread::setHelgrindThreadId(qint64 id) d->hThreadId = id; } -QVector<Frame> AnnounceThread::stack() const +QList<Frame> AnnounceThread::stack() const { return d->stack; } -void AnnounceThread::setStack(const QVector<Frame> &stack) +void AnnounceThread::setStack(const QList<Frame> &stack) { d->stack = stack; } diff --git a/src/plugins/valgrind/xmlprotocol/announcethread.h b/src/plugins/valgrind/xmlprotocol/announcethread.h index 6e427d4ab20..ac5f9cab993 100644 --- a/src/plugins/valgrind/xmlprotocol/announcethread.h +++ b/src/plugins/valgrind/xmlprotocol/announcethread.h @@ -4,7 +4,7 @@ #pragma once #include <QSharedDataPointer> -#include <QVector> +#include <QList> namespace Valgrind { namespace XmlProtocol { @@ -23,8 +23,8 @@ public: qint64 helgrindThreadId() const; void setHelgrindThreadId(qint64 id); - QVector<Frame> stack() const; - void setStack(const QVector<Frame> &stack); + QList<Frame> stack() const; + void setStack(const QList<Frame> &stack); private: class Private; diff --git a/src/plugins/valgrind/xmlprotocol/error.cpp b/src/plugins/valgrind/xmlprotocol/error.cpp index a062eb1693d..3b67ce76d11 100644 --- a/src/plugins/valgrind/xmlprotocol/error.cpp +++ b/src/plugins/valgrind/xmlprotocol/error.cpp @@ -6,10 +6,10 @@ #include "stack.h" #include "suppression.h" +#include <QList> #include <QSharedData> #include <QString> #include <QTextStream> -#include <QVector> #include <algorithm> @@ -23,7 +23,7 @@ public: qint64 tid = 0; QString what; int kind = 0; - QVector<Stack> stacks; + QList<Stack> stacks; Suppression suppression; quint64 leakedBytes = 0; qint64 leakedBlocks = 0; @@ -144,12 +144,12 @@ void Error::setKind(int k) d->kind = k; } -QVector<Stack> Error::stacks() const +QList<Stack> Error::stacks() const { return d->stacks; } -void Error::setStacks(const QVector<Stack> &stacks) +void Error::setStacks(const QList<Stack> &stacks) { d->stacks = stacks; } @@ -187,7 +187,7 @@ QString Error::toXml() const stream << " <auxwhat>" << stack.auxWhat() << "</auxwhat>\n"; stream << " <stack>\n"; - const QVector<Frame> frames = stack.frames(); + const QList<Frame> frames = stack.frames(); for (const Frame &frame : frames) { stream << " <frame>\n"; stream << " <ip>0x" << QString::number(frame.instructionPointer(), 16) << "</ip>\n"; diff --git a/src/plugins/valgrind/xmlprotocol/error.h b/src/plugins/valgrind/xmlprotocol/error.h index 758091c8d91..d3bf646d188 100644 --- a/src/plugins/valgrind/xmlprotocol/error.h +++ b/src/plugins/valgrind/xmlprotocol/error.h @@ -3,9 +3,9 @@ #pragma once +#include <QList> #include <QMetaType> #include <QSharedDataPointer> -#include <QVector> QT_BEGIN_NAMESPACE class QString; @@ -89,8 +89,8 @@ public: int kind() const; void setKind(int kind); - QVector<Stack> stacks() const; - void setStacks(const QVector<Stack> &stacks); + QList<Stack> stacks() const; + void setStacks(const QList<Stack> &stacks); Suppression suppression() const; void setSuppression(const Suppression &suppression); diff --git a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp index a44aa73a35a..aa5fa1c016a 100644 --- a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp +++ b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp @@ -13,7 +13,7 @@ #include <QCoreApplication> #include <QDir> -#include <QVector> +#include <QList> #include <cmath> @@ -72,11 +72,11 @@ Frame ErrorListModel::findRelevantFrame(const Error &error) const { if (m_relevantFrameFinder) return m_relevantFrameFinder(error); - const QVector<Stack> stacks = error.stacks(); + const QList<Stack> stacks = error.stacks(); if (stacks.isEmpty()) return Frame(); const Stack &stack = stacks[0]; - const QVector<Frame> frames = stack.frames(); + const QList<Frame> frames = stack.frames(); if (!frames.isEmpty()) return frames.first(); return Frame(); @@ -142,11 +142,11 @@ ErrorItem::ErrorItem(const ErrorListModel *model, const Error &error) // just annoy the user. // The same goes for the frame level. if (m_error.stacks().count() > 1) { - const QVector<Stack> stacks = m_error.stacks(); + const QList<Stack> stacks = m_error.stacks(); for (const Stack &s : stacks) appendChild(new StackItem(s)); } else if (m_error.stacks().constFirst().frames().count() > 1) { - const QVector<Frame> frames = m_error.stacks().constFirst().frames(); + const QList<Frame> frames = m_error.stacks().constFirst().frames(); for (const Frame &f : frames) appendChild(new FrameItem(f)); } @@ -176,12 +176,12 @@ QVariant ErrorItem::data(int column, int role) const << m_model->errorLocation(m_error) << "\n"; - const QVector<Stack> stacks = m_error.stacks(); + const QList<Stack> stacks = m_error.stacks(); for (const Stack &stack : stacks) { if (!stack.auxWhat().isEmpty()) stream << stack.auxWhat(); int i = 1; - const QVector<Frame> frames = stack.frames(); + const QList<Frame> frames = stack.frames(); for (const Frame &frame : frames) stream << " " << i++ << ": " << makeFrameName(frame, true) << "\n"; } @@ -210,7 +210,7 @@ QVariant ErrorItem::data(int column, int role) const StackItem::StackItem(const Stack &stack) : m_stack(stack) { - const QVector<Frame> frames = m_stack.frames(); + const QList<Frame> frames = m_stack.frames(); for (const Frame &f : frames) appendChild(new FrameItem(f)); } diff --git a/src/plugins/valgrind/xmlprotocol/parser.cpp b/src/plugins/valgrind/xmlprotocol/parser.cpp index f498fcf4fa5..96813fd11b4 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.cpp +++ b/src/plugins/valgrind/xmlprotocol/parser.cpp @@ -76,7 +76,7 @@ public: private: void parseError(); - QVector<Frame> parseStack(); + QList<Frame> parseStack(); Suppression parseSuppression(); SuppressionFrame parseSuppressionFrame(); Frame parseFrame(); @@ -318,7 +318,7 @@ void Parser::Private::reportInternalError(const QString &e) emit q->internalError(e); } -static Stack makeStack(const XauxWhat &xauxwhat, const QVector<Frame> &frames) +static Stack makeStack(const XauxWhat &xauxwhat, const QList<Frame> &frames) { Stack s; s.setFrames(frames); @@ -333,9 +333,9 @@ static Stack makeStack(const XauxWhat &xauxwhat, const QVector<Frame> &frames) void Parser::Private::parseError() { Error e; - QVector<QVector<Frame> > frames; + QList<QList<Frame>> frames; XauxWhat currentAux; - QVector<XauxWhat> auxs; + QList<XauxWhat> auxs; int lastAuxWhat = -1; while (notAtEnd()) { @@ -396,9 +396,9 @@ void Parser::Private::parseError() //add empty stacks until sizes match while (frames.size() < auxs.size()) - frames.push_back(QVector<Frame>()); + frames.push_back({}); - QVector<Stack> stacks; + QList<Stack> stacks; for (int i = 0; i < auxs.size(); ++i) stacks.append(makeStack(auxs[i], frames[i])); e.setStacks(stacks); @@ -543,9 +543,9 @@ void Parser::Private::parseStatus() emit q->status(s); } -QVector<Frame> Parser::Private::parseStack() +QList<Frame> Parser::Private::parseStack() { - QVector<Frame> frames; + QList<Frame> frames; while (notAtEnd()) { blockingReadNext(); if (reader.isEndElement()) diff --git a/src/plugins/valgrind/xmlprotocol/stack.cpp b/src/plugins/valgrind/xmlprotocol/stack.cpp index 5d977bbad12..973aaf9b2a2 100644 --- a/src/plugins/valgrind/xmlprotocol/stack.cpp +++ b/src/plugins/valgrind/xmlprotocol/stack.cpp @@ -4,9 +4,9 @@ #include "stack.h" #include "frame.h" +#include <QList> #include <QSharedData> #include <QString> -#include <QVector> namespace Valgrind { namespace XmlProtocol { @@ -19,7 +19,7 @@ public: QString dir; qint64 line = -1; qint64 hthreadid = -1; - QVector<Frame> frames; + QList<Frame> frames; }; Stack::Stack() @@ -62,12 +62,12 @@ void Stack::setAuxWhat(const QString &auxwhat) d->auxwhat = auxwhat; } -QVector<Frame> Stack::frames() const +QList<Frame> Stack::frames() const { return d->frames; } -void Stack::setFrames(const QVector<Frame> &frames) +void Stack::setFrames(const QList<Frame> &frames) { d->frames = frames; } diff --git a/src/plugins/valgrind/xmlprotocol/stack.h b/src/plugins/valgrind/xmlprotocol/stack.h index 8945984186b..333c1dc3201 100644 --- a/src/plugins/valgrind/xmlprotocol/stack.h +++ b/src/plugins/valgrind/xmlprotocol/stack.h @@ -3,8 +3,8 @@ #pragma once +#include <QList> #include <QSharedDataPointer> -#include <QVector> namespace Valgrind { namespace XmlProtocol { @@ -24,8 +24,8 @@ public: QString auxWhat() const; void setAuxWhat(const QString &auxwhat); - QVector<Frame> frames() const; - void setFrames(const QVector<Frame> &frames); + QList<Frame> frames() const; + void setFrames(const QList<Frame> &frames); //memcheck, ptrcheck, helgrind: QString file() const; diff --git a/src/plugins/valgrind/xmlprotocol/stackmodel.cpp b/src/plugins/valgrind/xmlprotocol/stackmodel.cpp index fceee892bb4..99ff1cacb25 100644 --- a/src/plugins/valgrind/xmlprotocol/stackmodel.cpp +++ b/src/plugins/valgrind/xmlprotocol/stackmodel.cpp @@ -11,7 +11,7 @@ #include <utils/qtcassert.h> #include <QDir> -#include <QVector> +#include <QList> namespace Valgrind { namespace XmlProtocol { @@ -76,7 +76,7 @@ QVariant StackModel::data(const QModelIndex &index, int role) const } } else { const Stack stack = d->stack(index.parent().row()); - const QVector<Frame> frames = stack.frames(); + const QList<Frame> frames = stack.frames(); const int fidx = index.row(); if (fidx < 0 || fidx >= frames.size()) return QVariant(); diff --git a/src/plugins/valgrind/xmlprotocol/suppression.cpp b/src/plugins/valgrind/xmlprotocol/suppression.cpp index 5d86d9a0db1..c76caf7bed5 100644 --- a/src/plugins/valgrind/xmlprotocol/suppression.cpp +++ b/src/plugins/valgrind/xmlprotocol/suppression.cpp @@ -5,7 +5,6 @@ #include <QSharedData> #include <QString> -#include <QVector> #include <QTextStream> #include <algorithm> diff --git a/src/plugins/valgrind/xmlprotocol/suppression.h b/src/plugins/valgrind/xmlprotocol/suppression.h index 328166ca23f..60f40cd638b 100644 --- a/src/plugins/valgrind/xmlprotocol/suppression.h +++ b/src/plugins/valgrind/xmlprotocol/suppression.h @@ -3,8 +3,8 @@ #pragma once +#include <QList> #include <QSharedDataPointer> -#include <QVector> QT_BEGIN_NAMESPACE class QString; @@ -40,7 +40,7 @@ private: QSharedDataPointer<Private> d; }; -using SuppressionFrames = QVector<SuppressionFrame>; +using SuppressionFrames = QList<SuppressionFrame>; class Suppression { From 94f4c21740898fb40d9de9d21a9016b782b66937 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 5 Aug 2023 14:02:34 +0200 Subject: [PATCH 0628/1777] ValgrindMemcheckParserTest: Fix const correctness Simplify list c'tors. Change-Id: Ib2534acfda1e0b24d8cfd10c7f48b585c881929a Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../valgrind/valgrindmemcheckparsertest.cpp | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp index 5b6aeaa96a2..c4ac4148a6f 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -131,12 +131,12 @@ static QString extraDataFile(const QString &file) // Clone test data from: https://git.qt.io/chstenge/creator-test-data static QString prefix = qtcEnvironmentVariable("QTC_TEST_EXTRADATALOCATION"); if (prefix.isEmpty()) - return QString(); + return {}; - QFileInfo fi(QString(prefix + "/valgrind"), file); + const QFileInfo fi(QString(prefix + "/valgrind"), file); if (fi.exists()) return fi.canonicalFilePath(); - return QString(); + return {}; } void ValgrindMemcheckParserTest::initTestCase() @@ -152,7 +152,7 @@ void ValgrindMemcheckParserTest::initTest(const QString &testfile, const QString m_process = new QProcess(m_server); m_process->setProcessChannelMode(QProcess::ForwardedChannels); const QString fakeValgrind = fakeValgrindExecutable(); - QFileInfo fileInfo(fakeValgrind); + const QFileInfo fileInfo(fakeValgrind); QVERIFY2(fileInfo.isExecutable(), qPrintable(fakeValgrind)); QVERIFY2(!fileInfo.isDir(), qPrintable(fakeValgrind)); @@ -212,7 +212,7 @@ void ValgrindMemcheckParserTest::testHelgrindSample1() frame12.setDirectory("/home/frank/source/tarballs/qt-4.6.3-build/src/corelib/../../include/QtCore/../../src/corelib/thread"); frame12.setFileName("qmutex.h"); frame12.setLine(120); - stack1.setFrames(QList<Frame>() << frame11 << frame12); + stack1.setFrames({frame11, frame12}); Stack stack2; stack2.setAuxWhat("Required order was established by acquisition of lock at 0xA39C270"); @@ -230,7 +230,7 @@ void ValgrindMemcheckParserTest::testHelgrindSample1() frame22.setDirectory("/home/frank/source/tarballs/qt-4.6.3-build/src/corelib/../../include/QtCore/../../src/corelib/thread"); frame22.setFileName("qmutex.h"); frame22.setLine(121); - stack2.setFrames(QList<Frame>() << frame21 << frame22); + stack2.setFrames({frame21, frame22}); Stack stack3; stack3.setAuxWhat("followed by a later acquisition of lock at 0xA3AC010"); @@ -249,8 +249,8 @@ void ValgrindMemcheckParserTest::testHelgrindSample1() frame32.setFileName("qmutex.h"); frame32.setLine(122); - stack3.setFrames(QList<Frame>() << frame31 << frame32); - error1.setStacks(QList<Stack>() << stack1 << stack2 << stack3); + stack3.setFrames({frame31, frame32}); + error1.setStacks({stack1, stack2, stack3}); expectedErrors.append(error1); } @@ -316,8 +316,8 @@ void ValgrindMemcheckParserTest::testMemcheckSample1() f4.setLine(4396); Stack s1; s1.setAuxWhat("Address 0x11527cb8 is not stack'd, malloc'd or (recently) free'd"); - s1.setFrames(QList<Frame>() << f1 << f2 << f3 << f4); - error.setStacks(QList<Stack>() << s1); + s1.setFrames({f1, f2, f3, f4}); + error.setStacks({s1}); expectedErrors << error; } @@ -503,10 +503,11 @@ void ValgrindMemcheckParserTest::testParserStop() void ValgrindMemcheckParserTest::testRealValgrind() { const Environment &sysEnv = Environment::systemEnvironment(); - auto fileName = sysEnv.searchInPath("valgrind"); + const auto fileName = sysEnv.searchInPath("valgrind"); if (fileName.isEmpty()) QSKIP("This test needs valgrind in PATH"); - QString executable = QProcessEnvironment::systemEnvironment().value("VALGRIND_TEST_BIN", fakeValgrindExecutable()); + QString executable = QProcessEnvironment::systemEnvironment().value("VALGRIND_TEST_BIN", + fakeValgrindExecutable()); qDebug() << "running exe:" << executable << " HINT: set VALGRIND_TEST_BIN to change this"; ProjectExplorer::Runnable debuggee; From ec53435e04c9cbe420ff0371c8a29192934e8b2d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Sat, 5 Aug 2023 15:25:05 +0200 Subject: [PATCH 0629/1777] ThreadedParser: Simplify implementation Get rid of unused errorString(). Remove pimpl and keep the QPointer to the Thread. Change-Id: I6398d35b4df17b548ff06185fe516d0d19ed9bc0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../valgrind/xmlprotocol/threadedparser.cpp | 101 +++++------------- .../valgrind/xmlprotocol/threadedparser.h | 21 ++-- 2 files changed, 36 insertions(+), 86 deletions(-) diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp index d42b17a58c7..d7385e60943 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp @@ -2,8 +2,9 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "threadedparser.h" -#include "parser.h" + #include "error.h" +#include "parser.h" #include "status.h" #include <utils/qtcassert.h> @@ -11,9 +12,8 @@ #include <QIODevice> #include <QMetaType> #include <QThread> -#include <QPointer> -namespace { +namespace Valgrind::XmlProtocol { class Thread : public QThread { @@ -21,95 +21,52 @@ public: void run() override { QTC_ASSERT(QThread::currentThread() == this, return); - parser->parse(device); - delete parser; - parser = nullptr; - delete device; - device = nullptr; + m_parser->parse(m_device); + delete m_parser; + m_parser = nullptr; + delete m_device; + m_device = nullptr; } - Valgrind::XmlProtocol::Parser *parser = nullptr; - QIODevice *device = nullptr; + Valgrind::XmlProtocol::Parser *m_parser = nullptr; + QIODevice *m_device = nullptr; }; -} // namespace anon - - -namespace Valgrind { -namespace XmlProtocol { - -class ThreadedParser::Private -{ -public: - QPointer<Thread> parserThread; - QString errorString; -}; - - ThreadedParser::ThreadedParser(QObject *parent) - : QObject(parent), - d(new Private) -{ -} - -ThreadedParser::~ThreadedParser() -{ - delete d; -} - -QString ThreadedParser::errorString() const -{ - return d->errorString; -} + : QObject(parent) +{} bool ThreadedParser::isRunning() const { - return d->parserThread ? d->parserThread.data()->isRunning() : false; + return m_parserThread ? m_parserThread->isRunning() : false; } void ThreadedParser::parse(QIODevice *device) { - QTC_ASSERT(!d->parserThread, return); + QTC_ASSERT(!m_parserThread, return); auto parser = new Parser; - qRegisterMetaType<Valgrind::XmlProtocol::Status>(); - qRegisterMetaType<Valgrind::XmlProtocol::Error>(); - connect(parser, &Parser::status, - this, &ThreadedParser::status, - Qt::QueuedConnection); - connect(parser, &Parser::error, - this, &ThreadedParser::error, - Qt::QueuedConnection); - connect(parser, &Parser::internalError, - this, &ThreadedParser::slotInternalError, - Qt::QueuedConnection); - connect(parser, &Parser::finished, - this, &ThreadedParser::finished, + qRegisterMetaType<Status>(); + qRegisterMetaType<Error>(); + connect(parser, &Parser::status, this, &ThreadedParser::status, Qt::QueuedConnection); + connect(parser, &Parser::error, this, &ThreadedParser::error, Qt::QueuedConnection); + connect(parser, &Parser::internalError, this, &ThreadedParser::internalError, Qt::QueuedConnection); + connect(parser, &Parser::finished, this, &ThreadedParser::finished, Qt::QueuedConnection); - - auto thread = new Thread; - d->parserThread = thread; - connect(thread, &QThread::finished, - thread, &QObject::deleteLater); + m_parserThread = new Thread; + connect(m_parserThread.get(), &QThread::finished, m_parserThread.get(), &QObject::deleteLater); device->setParent(nullptr); - device->moveToThread(thread); - parser->moveToThread(thread); - thread->device = device; - thread->parser = parser; - thread->start(); -} - -void ThreadedParser::slotInternalError(const QString &errorString) -{ - d->errorString = errorString; - emit internalError(errorString); + device->moveToThread(m_parserThread); + parser->moveToThread(m_parserThread); + m_parserThread->m_device = device; + m_parserThread->m_parser = parser; + m_parserThread->start(); } bool ThreadedParser::waitForFinished() { - return d->parserThread ? d->parserThread.data()->wait() : true; + return m_parserThread ? m_parserThread->wait() : true; } -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.h b/src/plugins/valgrind/xmlprotocol/threadedparser.h index 59cd811ad98..c88abf3fe68 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.h +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.h @@ -4,16 +4,17 @@ #pragma once #include <QObject> +#include <QPointer> QT_BEGIN_NAMESPACE class QIODevice; QT_END_NAMESPACE -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class Error; class Status; +class Thread; /** * ThreadedParser for the Valgrind Output XmlProtocol 4 @@ -24,9 +25,6 @@ class ThreadedParser : public QObject public: explicit ThreadedParser(QObject *parent = nullptr); - ~ThreadedParser() override; - - QString errorString() const; /// interface additions relative to Parser because Parser is synchronous and this /// class parses asynchronously in a non-public secondary thread. @@ -36,19 +34,14 @@ public: ///@warning will move @p stream to a different thread and take ownership of it void parse(QIODevice *stream); -private: - void slotInternalError(const QString &errorString); - signals: - void status(const Valgrind::XmlProtocol::Status &status); - void error(const Valgrind::XmlProtocol::Error &error); + void status(const Status &status); + void error(const Error &error); void internalError(const QString &errorString); void finished(); private: - class Private; - Private *const d; + QPointer<Thread> m_parserThread; }; -} // XmlProtocol -} // Valgrind +} // Valgrind::XmlProtocol From fbb06f1a024a11073caea90bb4cdd948b598558d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 7 Aug 2023 10:47:48 +0200 Subject: [PATCH 0630/1777] ToolChain: Introduce asGccToolChain() Instead of downcasting by qobject_cast. Change-Id: If868a41eb6233e18e0ea96441001fe02b5f3090e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/projectexplorer/gcctoolchain.h | 3 +-- src/plugins/projectexplorer/toolchain.h | 2 ++ src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index fb59f64354e..3e92ea01c69 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -45,8 +45,6 @@ inline const QStringList gccPredefinedMacrosOptions(Utils::Id languageId) class PROJECTEXPLORER_EXPORT GccToolChain : public ToolChain { - Q_OBJECT - public: GccToolChain(Utils::Id typeId); @@ -95,6 +93,7 @@ public: Abis supportedAbis; QString originalTargetTriple; }; + GccToolChain *asGccToolChain() final { return this; } protected: using CacheItem = QPair<QStringList, Macros>; diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index d6f2221cb82..023f729fec1 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -44,6 +44,7 @@ QString languageId(Language l); } // namespace Toolchain } // namespace Deprecated +class GccToolChain; class ToolChainConfigWidget; class ToolChainFactory; class Kit; @@ -165,6 +166,7 @@ public: }; virtual int priority() const { return PriorityNormal; } + virtual GccToolChain *asGccToolChain() { return nullptr; } protected: explicit ToolChain(Utils::Id typeId); diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 67779062eea..24894105ee0 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -336,7 +336,7 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor } data.insert(QLatin1String(CPP_TOOLCHAINPATH), mainFilePath.absolutePath().toString()); - if (auto gcc = qobject_cast<ProjectExplorer::GccToolChain *>(mainTc)) { + if (auto gcc = mainTc->asGccToolChain()) { QStringList compilerFlags = gcc->platformCodeGenFlags(); filterCompilerLinkerFlags(targetAbi, compilerFlags); data.insert(QLatin1String(CPP_PLATFORMCOMMONCOMPILERFLAGS), compilerFlags); From 7e572841f7fe264c09d941ce72d81ac06140fc80 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 7 Aug 2023 11:53:52 +0200 Subject: [PATCH 0631/1777] Valgrind: Make tool name hash static Change-Id: I326c45e1be293dc5066271839b26b7f22d53eabb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/valgrind/xmlprotocol/parser.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/plugins/valgrind/xmlprotocol/parser.cpp b/src/plugins/valgrind/xmlprotocol/parser.cpp index 96813fd11b4..b3e6a41c0b9 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.cpp +++ b/src/plugins/valgrind/xmlprotocol/parser.cpp @@ -66,6 +66,17 @@ enum class Tool { Helgrind }; +const QHash<QString, Tool> &toolByName() +{ + static const QHash<QString, Tool> theHash { + {"memcheck", Tool::Memcheck}, + {"ptrcheck", Tool::Ptrcheck}, + {"exp-ptrcheck", Tool::Ptrcheck}, + {"helgrind", Tool::Helgrind} + }; + return theHash; +} + class Parser::Private { public: @@ -97,7 +108,6 @@ private: Tool tool = Tool::Unknown; QXmlStreamReader reader; - QHash<QString, Tool> toolsByName; private: Parser *const q; @@ -106,10 +116,6 @@ private: Parser::Private::Private(Parser *qq) : q(qq) { - toolsByName.insert("memcheck", Tool::Memcheck); - toolsByName.insert("ptrcheck", Tool::Ptrcheck); - toolsByName.insert("exp-ptrcheck", Tool::Ptrcheck); - toolsByName.insert("helgrind", Tool::Helgrind); } static quint64 parseHex(const QString &str, const QString &context) @@ -223,8 +229,8 @@ void Parser::Private::checkProtocolVersion(const QString &versionStr) void Parser::Private::checkTool(const QString &reportedStr) { - const auto reported = toolsByName.constFind(reportedStr); - if (reported == toolsByName.constEnd()) + const auto reported = toolByName().constFind(reportedStr); + if (reported == toolByName().constEnd()) throw ParserException(Tr::tr("Valgrind tool \"%1\" not supported").arg(reportedStr)); tool = reported.value(); From 8b0b190b49daa1a0bd94f60fc174d4fb5ba162f1 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 3 Aug 2023 13:23:03 +0200 Subject: [PATCH 0632/1777] DAP: Fix breakpoint behavior Before adding and removing breakpoints when debugging is running didn't work for cmake debugging. Fixes that. Change-Id: I59fd4ec3905365647b552753bc06da855e83ac7c Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/debugger/dap/dapengine.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 2720adb04de..6a8a0244dd0 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -132,7 +132,14 @@ public: bool isRunning() const override { return m_socket.isOpen(); } void writeRaw(const QByteArray &data) override { m_socket.write(data); } - void kill() override { m_socket.disconnectFromServer(); } + void kill() override { + if (m_socket.isOpen()) + m_socket.disconnectFromServer(); + else { + m_socket.abort(); + emit done(); + } + } QByteArray readAllStandardOutput() override { return m_socket.readAll(); } QString readAllStandardError() override { return QString(); } int exitCode() const override { return 0; } @@ -253,7 +260,6 @@ void DapEngine::setupEngine() if (currentPerspective->parentPerspectiveId() == Constants::CMAKE_PERSPECTIVE_ID) { qCDebug(dapEngineLog) << "build system name" << ProjectExplorer::ProjectTree::currentBuildSystem()->name(); - m_nextBreakpointId = 0; m_dataGenerator = std::make_unique<LocalSocketDataProvider>( TemporaryDirectory::masterDirectoryPath() + "/cmake-dap.sock"); connectDataGeneratorSignals(); @@ -541,6 +547,7 @@ void DapEngine::insertBreakpoint(const Breakpoint &bp) }} }); + notifyBreakpointChangeOk(bp); qCDebug(dapEngineLog) << "insertBreakpoint" << bp->modelId() << bp->responseId(); } @@ -594,6 +601,7 @@ void DapEngine::removeBreakpoint(const Breakpoint &bp) }); qCDebug(dapEngineLog) << "removeBreakpoint" << bp->modelId() << bp->responseId(); + notifyBreakpointRemoveOk(bp); } void DapEngine::loadSymbols(const Utils::FilePath &/*moduleName*/) From c6587de68482f70400cdc8a16ea60ebf4001b29e Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 4 Aug 2023 18:55:09 +0200 Subject: [PATCH 0633/1777] QmlProjectManager: Get rid of foreach Change-Id: Iab2933ac8cf06c81d667ab94a26b86241a3a0c24 Reviewed-by: Burak Hancerli <burak.hancerli@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../buildsystem/projectitem/converters.cpp | 26 +++++++++---------- .../projectitem/qmlprojectitem.cpp | 4 +-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/plugins/qmlprojectmanager/buildsystem/projectitem/converters.cpp b/src/plugins/qmlprojectmanager/buildsystem/projectitem/converters.cpp index 7f01e33f435..adcb504fe8a 100644 --- a/src/plugins/qmlprojectmanager/buildsystem/projectitem/converters.cpp +++ b/src/plugins/qmlprojectmanager/buildsystem/projectitem/converters.cpp @@ -63,9 +63,8 @@ QString jsonToQmlProject(const QJsonObject &rootObject) auto appendArray = [&appendItem](const QString &key, const QStringList &vals) { QString finalString; - foreach (const QString &value, vals) { + for (const QString &value : vals) finalString.append("\"").append(value).append("\"").append(","); - } finalString.remove(finalString.length() - 1, 1); finalString.prepend("[ ").append(" ]"); appendItem(key, finalString, false); @@ -86,8 +85,8 @@ QString jsonToQmlProject(const QJsonObject &rootObject) [&startObject, &endObject, &appendString, &filesConfig](const QString &jsonKey, const QString &qmlKey) { QJsonValue dirsObj = filesConfig[jsonKey].toObject()["directories"]; - QStringList dirs = dirsObj.toVariant().toStringList(); - foreach (const QString &directory, dirs) { + const QStringList dirs = dirsObj.toVariant().toStringList(); + for (const QString &directory : dirs) { startObject(qmlKey); appendString("directory", directory); endObject(); @@ -103,16 +102,17 @@ QString jsonToQmlProject(const QJsonObject &rootObject) QJsonValue filesObj = filesConfig[jsonKey].toObject()["files"]; QJsonValue filtersObj = filesConfig[jsonKey].toObject()["filters"]; - foreach (const QString &directory, dirsObj.toVariant().toStringList()) { + const QStringList directories = dirsObj.toVariant().toStringList(); + for (const QString &directory : directories) { startObject(qmlKey); appendString("directory", directory); appendString("filters", filtersObj.toVariant().toStringList().join(";")); if (!filesObj.toArray().isEmpty()) { QStringList fileList; - foreach (const QJsonValue &file, filesObj.toArray()) { + const QJsonArray files = filesObj.toArray(); + for (const QJsonValue &file : files) fileList.append(file.toObject()["name"].toString()); - } appendArray("files", fileList); } endObject(); @@ -147,9 +147,9 @@ QString jsonToQmlProject(const QJsonObject &rootObject) { // append Environment object startObject("Environment"); - foreach (const QString &key, environmentConfig.keys()) { + const QStringList keys = environmentConfig.keys(); + for (const QString &key : keys) appendItem(key, environmentConfig[key].toString(), true); - } endObject(); } @@ -201,9 +201,9 @@ QJsonObject qmlProjectTojson(const Utils::FilePath &projectFile) auto nodeToJsonObject = [](const QmlJS::SimpleReaderNode::Ptr &node) { QJsonObject tObj; - foreach (const QString &childPropName, node->propertyNames()) { + const QStringList childPropNames = node->propertyNames(); + for (const QString &childPropName : childPropNames) tObj.insert(childPropName, node->property(childPropName).value.toJsonValue()); - } return tObj; }; @@ -336,9 +336,9 @@ QJsonObject qmlProjectTojson(const Utils::FilePath &projectFile) // populate & update files if (childNodeFiles.isValid()) { - foreach (const QJsonValue &file, childNodeFiles.value.toJsonArray()) { + const QJsonArray fileList = childNodeFiles.value.toJsonArray(); + for (const QJsonValue &file : fileList) files.append(QJsonObject{{"name", file.toString()}}); - } } // put everything back into the root object diff --git a/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp b/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp index 5b56c8f37ca..99ad0826549 100644 --- a/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp +++ b/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp @@ -114,9 +114,9 @@ Utils::EnvironmentItems QmlProjectItem::environment() const { Utils::EnvironmentItems envItems; QJsonObject envVariables = m_project["environment"].toObject(); - foreach (const QString &variableName, envVariables.keys()) { + const QStringList variableNames = envVariables.keys(); + for (const QString &variableName : variableNames) envItems.append(Utils::EnvironmentItem(variableName, envVariables[variableName].toString())); - } return envItems; } From 68c76e072dae305fe4c7f4e7a4c24d975c395d42 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 8 Aug 2023 10:44:48 +0200 Subject: [PATCH 0634/1777] CppEditor: De-obfuscate DoxygenGenerator - m_startComment was always false. - One of the two public generate() functions is an internal helper. Change-Id: I03a860bf7f44aab8f98c5656bc2b36f9fe5e1ef2 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/cppeditor/cppeditorwidget.cpp | 1 - src/plugins/cppeditor/doxygengenerator.cpp | 24 ---------------------- src/plugins/cppeditor/doxygengenerator.h | 6 +----- 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index 563d65a304c..3950da53c08 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -342,7 +342,6 @@ static bool trySplitComment(TextEditor::TextEditorWidget *editorWidget, doxygen.setStyle(style); doxygen.setAddLeadingAsterisks(settings.leadingAsterisks); doxygen.setGenerateBrief(settings.generateBrief); - doxygen.setStartComment(false); // Move until we reach any possibly meaningful content. while (textDocument->characterAt(cursor.position()).isSpace() diff --git a/src/plugins/cppeditor/doxygengenerator.cpp b/src/plugins/cppeditor/doxygengenerator.cpp index 5a57fdc3a3f..ae83e0e23d4 100644 --- a/src/plugins/cppeditor/doxygengenerator.cpp +++ b/src/plugins/cppeditor/doxygengenerator.cpp @@ -29,11 +29,6 @@ void DoxygenGenerator::setStyle(DocumentationStyle style) m_style = style; } -void DoxygenGenerator::setStartComment(bool start) -{ - m_startComment = start; -} - void DoxygenGenerator::setGenerateBrief(bool get) { m_generateBrief = get; @@ -136,8 +131,6 @@ QString DoxygenGenerator::generate(QTextCursor cursor, DeclarationAST *decl) assignCommentOffset(cursor); QString comment; - if (m_startComment) - writeStart(&comment); writeNewLine(&comment); writeContinuation(&comment); @@ -221,13 +214,6 @@ QString DoxygenGenerator::generate(QTextCursor cursor, DeclarationAST *decl) return comment; } -QChar DoxygenGenerator::startMark() const -{ - if (m_style == QtStyle) - return QLatin1Char('!'); - return QLatin1Char('*'); -} - QChar DoxygenGenerator::styleMark() const { if (m_style == QtStyle || m_style == CppStyleA || m_style == CppStyleB) @@ -246,16 +232,6 @@ QString DoxygenGenerator::commandSpelling(Command command) return QLatin1String("brief "); } -void DoxygenGenerator::writeStart(QString *comment) const -{ - if (m_style == CppStyleA) - comment->append(QLatin1String("///")); - if (m_style == CppStyleB) - comment->append(QLatin1String("//!")); - else - comment->append(offsetString() + "/*" + startMark()); -} - void DoxygenGenerator::writeEnd(QString *comment) const { if (m_style == CppStyleA) diff --git a/src/plugins/cppeditor/doxygengenerator.h b/src/plugins/cppeditor/doxygengenerator.h index 3b80f83c73c..32d23945bb2 100644 --- a/src/plugins/cppeditor/doxygengenerator.h +++ b/src/plugins/cppeditor/doxygengenerator.h @@ -26,17 +26,15 @@ public: }; void setStyle(DocumentationStyle style); - void setStartComment(bool start); void setGenerateBrief(bool gen); void setAddLeadingAsterisks(bool add); QString generate(QTextCursor cursor, const CPlusPlus::Snapshot &snapshot, const Utils::FilePath &documentFilePath); - QString generate(QTextCursor cursor, CPlusPlus::DeclarationAST *decl); private: - QChar startMark() const; + QString generate(QTextCursor cursor, CPlusPlus::DeclarationAST *decl); QChar styleMark() const; enum Command { @@ -46,7 +44,6 @@ private: }; static QString commandSpelling(Command command); - void writeStart(QString *comment) const; void writeEnd(QString *comment) const; void writeContinuation(QString *comment) const; void writeNewLine(QString *comment) const; @@ -63,7 +60,6 @@ private: bool m_addLeadingAsterisks = true; bool m_generateBrief = true; - bool m_startComment = true; DocumentationStyle m_style = QtStyle; CPlusPlus::Overview m_printer; QString m_commentOffset; From 45f4ea6da51057164a252ffde7397668a272ba3d Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 8 Aug 2023 10:51:53 +0200 Subject: [PATCH 0635/1777] CppEditor: Pass CommentsSettings into DoxygenGenerator ... instead of forwarding each member separately. Change-Id: I0639cc81716df70e8f286cb4b5f02554e1f56b95 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/cppeditor/cppeditorwidget.cpp | 3 +-- src/plugins/cppeditor/doxygengenerator.cpp | 21 +++------------------ src/plugins/cppeditor/doxygengenerator.h | 12 ++++++------ 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index 3950da53c08..20c3f596ce1 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -340,8 +340,7 @@ static bool trySplitComment(TextEditor::TextEditorWidget *editorWidget, DoxygenGenerator doxygen; doxygen.setStyle(style); - doxygen.setAddLeadingAsterisks(settings.leadingAsterisks); - doxygen.setGenerateBrief(settings.generateBrief); + doxygen.setSettings(settings); // Move until we reach any possibly meaningful content. while (textDocument->characterAt(cursor.position()).isSpace() diff --git a/src/plugins/cppeditor/doxygengenerator.cpp b/src/plugins/cppeditor/doxygengenerator.cpp index ae83e0e23d4..ac79cb0d839 100644 --- a/src/plugins/cppeditor/doxygengenerator.cpp +++ b/src/plugins/cppeditor/doxygengenerator.cpp @@ -24,21 +24,6 @@ namespace CppEditor::Internal { DoxygenGenerator::DoxygenGenerator() = default; -void DoxygenGenerator::setStyle(DocumentationStyle style) -{ - m_style = style; -} - -void DoxygenGenerator::setGenerateBrief(bool get) -{ - m_generateBrief = get; -} - -void DoxygenGenerator::setAddLeadingAsterisks(bool add) -{ - m_addLeadingAsterisks = add; -} - QString DoxygenGenerator::generate(QTextCursor cursor, const CPlusPlus::Snapshot &snapshot, const Utils::FilePath &documentFilePath) @@ -139,7 +124,7 @@ QString DoxygenGenerator::generate(QTextCursor cursor, DeclarationAST *decl) && decltr->core_declarator->asDeclaratorId() && decltr->core_declarator->asDeclaratorId()->name) { CoreDeclaratorAST *coreDecl = decltr->core_declarator; - if (m_generateBrief) + if (m_settings.generateBrief) writeBrief(&comment, m_printer.prettyName(coreDecl->asDeclaratorId()->name->name)); else writeNewLine(&comment); @@ -177,7 +162,7 @@ QString DoxygenGenerator::generate(QTextCursor cursor, DeclarationAST *decl) writeCommand(&comment, ReturnCommand); } } - } else if (spec && m_generateBrief) { + } else if (spec && m_settings.generateBrief) { bool briefWritten = false; if (ClassSpecifierAST *classSpec = spec->asClassSpecifier()) { if (classSpec->name) { @@ -248,7 +233,7 @@ void DoxygenGenerator::writeContinuation(QString *comment) const comment->append(offsetString() + "///"); else if (m_style == CppStyleB) comment->append(offsetString() + "//!"); - else if (m_addLeadingAsterisks) + else if (m_settings.leadingAsterisks) comment->append(offsetString() + " *"); else comment->append(offsetString() + " "); diff --git a/src/plugins/cppeditor/doxygengenerator.h b/src/plugins/cppeditor/doxygengenerator.h index 32d23945bb2..4bb11f72892 100644 --- a/src/plugins/cppeditor/doxygengenerator.h +++ b/src/plugins/cppeditor/doxygengenerator.h @@ -3,6 +3,8 @@ #pragma once +#include <texteditor/commentssettings.h> + #include <cplusplus/Overview.h> QT_FORWARD_DECLARE_CLASS(QTextCursor) @@ -25,9 +27,8 @@ public: CppStyleB ///< CppStyle comment variant B: //! }; - void setStyle(DocumentationStyle style); - void setGenerateBrief(bool gen); - void setAddLeadingAsterisks(bool add); + void setStyle(DocumentationStyle style) { m_style = style; } + void setSettings(const TextEditor::CommentsSettings::Data &settings) { m_settings = settings; } QString generate(QTextCursor cursor, const CPlusPlus::Snapshot &snapshot, @@ -58,11 +59,10 @@ private: void assignCommentOffset(QTextCursor cursor); QString offsetString() const; - bool m_addLeadingAsterisks = true; - bool m_generateBrief = true; - DocumentationStyle m_style = QtStyle; + TextEditor::CommentsSettings::Data m_settings; CPlusPlus::Overview m_printer; QString m_commentOffset; + DocumentationStyle m_style = QtStyle; }; } // namespace CppEditor::Internal From d7d7b4bbcaa2eb240ebf47574c37a3cf59d40960 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 8 Aug 2023 12:52:19 +0200 Subject: [PATCH 0636/1777] Terminal: Compile with Qt 6.2.x Change-Id: Id98d6073205b2d40fe114e66e2bac65e1a628cdc Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Mehdi Salem --- src/libs/solutions/terminal/terminalview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/solutions/terminal/terminalview.cpp b/src/libs/solutions/terminal/terminalview.cpp index edb0b2c21b4..aeaede23d57 100644 --- a/src/libs/solutions/terminal/terminalview.cpp +++ b/src/libs/solutions/terminal/terminalview.cpp @@ -972,7 +972,7 @@ QRect TerminalView::gridToViewport(QRect rect) const QPoint TerminalView::toGridPos(QMouseEvent *event) const { - return globalToGrid(event->pos().toPointF() + QPointF(0, -topMargin() + 0.5)); + return globalToGrid(QPointF(event->pos()) + QPointF(0, -topMargin() + 0.5)); } void TerminalView::updateViewport() From f09b61651e5f075535bfe60bfa77e22f9104085e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 28 Jul 2023 11:08:37 +0200 Subject: [PATCH 0637/1777] Utils: Approach aspect update signalling more systematicly This was pretty much ad-hoc so far. Now do the actual value proliferation inside the aspect first and collect information on what changed. Signal changes in the end centrally. At that time the aspect internal state is consistent again. Additional design desision implemented here: setDefaultValue and fromMap/readSetting do _not_ signal, user code with unusual needs has to check on its own. Change-Id: I1e46282558e014f51933d1044a72bf5c67437ec5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/aspects.cpp | 110 +++++++--------- src/libs/utils/aspects.h | 124 ++++++++---------- .../cmakebuildconfiguration.cpp | 7 +- .../debugger/registerpostmortemaction.cpp | 2 +- src/plugins/projectexplorer/processstep.cpp | 2 +- 5 files changed, 108 insertions(+), 137 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 2ec4bfe280f..2fc74b144b4 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -47,9 +47,12 @@ QSettings *BaseAspect::settings() return theSettings; } -namespace Internal { +BaseAspect::Changes::Changes() +{ + memset(this, 0, sizeof(*this)); +} -class BaseAspectPrivate +class Internal::BaseAspectPrivate { public: explicit BaseAspectPrivate(AspectContainer *container) : m_container(container) {} @@ -82,8 +85,6 @@ public: QList<BaseAspect::DataExtractor> m_dataExtractors; }; -} // Internal - /*! \class Utils::BaseAspect \inmodule QtCreator @@ -144,9 +145,10 @@ QVariant BaseAspect::variantValue() const Prefer the typed setValue() of derived classes. */ -void BaseAspect::setVariantValue(const QVariant &value) +void BaseAspect::setVariantValue(const QVariant &value, Announcement howToAnnounce) { Q_UNUSED(value) + Q_UNUSED(howToAnnounce) QTC_CHECK(false); } @@ -156,19 +158,6 @@ void BaseAspect::setDefaultVariantValue(const QVariant &value) QTC_CHECK(false); } -/*! - \internal - - Sets \a value without emitting signals. - - Prefer the typed setValueQuietly() of derived classes. -*/ -void BaseAspect::setVariantValueQuietly(const QVariant &value) -{ - Q_UNUSED(value) - QTC_CHECK(false); -} - QVariant BaseAspect::defaultVariantValue() const { return {}; @@ -488,26 +477,18 @@ void createItem(Layouting::LayoutItem *item, const BaseAspect *aspect) */ void BaseAspect::apply() { - if (isDirty()) { - silentApply(); - if (hasAction()) - emit action()->triggered(variantValue().toBool()); - emit changed(); - } + // We assume m_buffer to reflect current gui state as invariant after signalling settled down. + // It's an aspect (-subclass) implementation problem if this doesn't hold. Fix it up and bark. + QTC_CHECK(!guiToBuffer()); + + if (!bufferToInternal()) // Nothing to do. + return; + + Changes changes; + changes.internalFromBuffer = true; + announceChanges(changes); } -/*! - Updates this aspect's value from user-initiated changes in the widget. - - \returns whether the value changed. Does not emit signals. -*/ - -void BaseAspect::silentApply() -{ - guiToBuffer(); - bufferToInternal(); - internalToExternal(); -} /*! Discard user changes in the widget and restore widget contents from aspect's value. @@ -532,6 +513,21 @@ bool BaseAspect::hasAction() const return d->m_action != nullptr; } +void BaseAspect::announceChanges(Changes changes, Announcement howToAnnounce) +{ + if (howToAnnounce == BeQuiet) + return; + + if (changes.bufferFromInternal || changes.bufferFromOutside || changes.bufferFromGui) + emit volatileValueChanged(); + + if (changes.internalFromOutside || changes.internalFromBuffer) { + emit changed(); + if (hasAction()) + emit action()->triggered(variantValue().toBool()); + } +} + bool BaseAspect::isDirty() { return false; @@ -578,7 +574,7 @@ void BaseAspect::fromMap(const QVariantMap &map) if (settingsKey().isEmpty()) return; const QVariant val = map.value(settingsKey(), toSettingsValue(defaultVariantValue())); - setVariantValue(fromSettingsValue(val)); + setVariantValue(fromSettingsValue(val), BeQuiet); } /*! @@ -596,7 +592,7 @@ void BaseAspect::readSettings() if (settingsKey().isEmpty()) return; const QVariant val = settings()->value(settingsKey()); - setVariantValue(val.isValid() ? fromSettingsValue(val) : defaultVariantValue()); + setVariantValue(val.isValid() ? fromSettingsValue(val) : defaultVariantValue(), BeQuiet); } void BaseAspect::writeSettings() const @@ -908,7 +904,7 @@ void StringAspect::setValueAcceptor(StringAspect::ValueAcceptor &&acceptor) void StringAspect::fromMap(const QVariantMap &map) { if (!settingsKey().isEmpty()) - setValueQuietly(map.value(settingsKey(), defaultValue()).toString()); + setValue(map.value(settingsKey(), defaultValue()).toString(), BeQuiet); d->m_checkerImpl.fromMap(map); } @@ -1112,6 +1108,12 @@ void StringAspect::addToLayout(LayoutItem &parent) d->m_checkerImpl.addToLayoutLast(parent); } +QString StringAspect::expandedValue() const +{ + // FIXME: Use macroexpander here later. + return m_internal; +} + bool StringAspect::guiToBuffer() { if (d->m_lineEditDisplay) @@ -1266,9 +1268,14 @@ QString FilePathAspect::value() const a file path. */ -void FilePathAspect::setValue(const FilePath &filePath) +void FilePathAspect::setValue(const FilePath &filePath, Announcement howToAnnounce) { - TypedAspect::setValue(filePath.toUserOutput()); + TypedAspect::setValue(filePath.toUserOutput(), howToAnnounce); +} + +void FilePathAspect::setValue(const QString &filePath, Announcement howToAnnounce) +{ + TypedAspect::setValue(filePath, howToAnnounce); } void FilePathAspect::setDefaultValue(const FilePath &filePath) @@ -1402,7 +1409,7 @@ void FilePathAspect::addToLayout(Layouting::LayoutItem &parent) void FilePathAspect::fromMap(const QVariantMap &map) { if (!settingsKey().isEmpty()) - setValueQuietly(map.value(settingsKey(), defaultValue()).toString()); + setValue(map.value(settingsKey(), defaultValue()).toString(), BeQuiet); d->m_checkerImpl.fromMap(map); } @@ -2545,7 +2552,7 @@ void AspectContainer::finish() void AspectContainer::reset() { for (BaseAspect *aspect : std::as_const(d->m_items)) - aspect->setVariantValueQuietly(aspect->defaultVariantValue()); + aspect->setVariantValue(aspect->defaultVariantValue()); } void AspectContainer::setAutoApply(bool on) @@ -2643,23 +2650,6 @@ bool BaseAspect::internalToBuffer() return false; } -/* - Applies common postprocessing like macro expansion. -*/ - -bool BaseAspect::internalToExternal() -{ - return false; -} - -/* - Mirrors externally visible value to internal volatile value. -*/ -bool BaseAspect::externalToInternal() -{ - return false; -} - void BaseAspect::handleGuiChanged() { if (guiToBuffer()) diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 14bb3ed6f73..b4b2d4099a9 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -53,9 +53,10 @@ public: Id id() const; void setId(Id id); + enum Announcement { DoEmit, BeQuiet }; + virtual QVariant variantValue() const; - virtual void setVariantValue(const QVariant &value); - virtual void setVariantValueQuietly(const QVariant &value); + virtual void setVariantValue(const QVariant &value, Announcement = DoEmit); virtual QVariant defaultVariantValue() const; virtual void setDefaultVariantValue(const QVariant &value); @@ -114,12 +115,24 @@ public: QVariant fromSettingsValue(const QVariant &val) const; virtual void apply(); - virtual void silentApply(); virtual void cancel(); virtual void finish(); virtual bool isDirty(); bool hasAction() const; + struct QTCREATOR_UTILS_EXPORT Changes + { + Changes(); + + unsigned internalFromOutside : 1; + unsigned internalFromBuffer : 1; + unsigned bufferFromOutside : 1; + unsigned bufferFromInternal : 1; + unsigned bufferFromGui : 1; + }; + + void announceChanges(Changes changes, Announcement howToAnnounce = DoEmit); + class QTCREATOR_UTILS_EXPORT Data { public: @@ -172,7 +185,6 @@ public: signals: void changed(); // "internal" void volatileValueChanged(); - void externalValueChanged(); void labelLinkActivated(const QString &link); void checkedChanged(); @@ -181,8 +193,6 @@ protected: virtual bool bufferToInternal(); virtual void bufferToGui(); virtual bool guiToBuffer(); - virtual bool internalToExternal(); - virtual bool externalToInternal(); virtual void handleGuiChanged(); @@ -253,48 +263,41 @@ public: ValueType value; }; - ValueType operator()() const { return m_external; } - ValueType value() const { return m_external; } + ValueType operator()() const { return m_internal; } + ValueType value() const { return m_internal; } ValueType defaultValue() const { return m_default; } + ValueType volatileValue() const { return m_buffer; } + // We assume that this is only used in the ctor and no signalling is needed. + // If it is used elsewhere changes have to be detected and signalled externally. void setDefaultValue(const ValueType &value) { m_default = value; - setValue(value); - } - - void setValue(const ValueType &value) - { - const bool changes = m_internal != value; m_internal = value; - if (internalToBuffer()) - emit volatileValueChanged(); - bufferToGui(); - internalToExternal(); - if (changes) - emit changed(); + internalToBuffer(); // Might be more than a plain copy. } - void setValueQuietly(const ValueType &value) + void setValue(const ValueType &value, Announcement howToAnnounce = DoEmit) { - m_internal = value; - internalToBuffer(); - bufferToGui(); - internalToExternal(); + Changes changes; + changes.internalFromOutside = updateStorage(m_internal, value); + if (internalToBuffer()) { + changes.bufferFromInternal = true; + bufferToGui(); + } + announceChanges(changes, howToAnnounce); } - ValueType volatileValue() const + void setVolatileValue(const ValueType &value, Announcement howToAnnounce = DoEmit) { - return m_buffer; - } - - void setVolatileValue(const ValueType &value) - { - if (m_buffer == value) - return; - m_buffer = value; - bufferToGui(); - emit volatileValueChanged(); + Changes changes; + if (updateStorage(m_buffer, value)) { + changes.bufferFromOutside = true; + bufferToGui(); + } + if (isAutoApply() && bufferToInternal()) + changes.internalFromBuffer = true; + announceChanges(changes, howToAnnounce); } protected: @@ -313,29 +316,14 @@ protected: return updateStorage(m_internal, m_buffer); } - bool internalToExternal() override - { - return updateStorage(m_external, m_internal); - } - - bool externalToInternal() override - { - return updateStorage(m_internal, m_external); - } - QVariant variantValue() const override { - return QVariant::fromValue<ValueType>(m_external); + return QVariant::fromValue<ValueType>(m_internal); } - void setVariantValue(const QVariant &value) override + void setVariantValue(const QVariant &value, Announcement howToAnnounce = DoEmit) override { - setValue(value.value<ValueType>()); - } - - void setVariantValueQuietly(const QVariant &value) override - { - setValueQuietly(value.value<ValueType>()); + setValue(value.value<ValueType>(), howToAnnounce); } QVariant defaultVariantValue() const override @@ -345,11 +333,10 @@ protected: void setDefaultVariantValue(const QVariant &value) override { - m_default = value.value<ValueType>(); + setDefaultValue(value.value<ValueType>()); } ValueType m_default{}; - ValueType m_external{}; ValueType m_internal{}; ValueType m_buffer{}; }; @@ -366,7 +353,6 @@ public: void setInternalToBuffer(const Updater &updater) { m_internalToBuffer = updater; } void setBufferToInternal(const Updater &updater) { m_bufferToInternal = updater; } void setInternalToExternal(const Updater &updater) { m_internalToExternal = updater; } - void setExternalToInternal(const Updater &updater) { m_externalToInternal = updater; } protected: bool internalToBuffer() override @@ -383,24 +369,18 @@ protected: return Base::bufferToInternal(); } - bool internalToExternal() override + ValueType expandedValue() { - if (m_internalToExternal) - return m_internalToExternal(Base::m_external, Base::m_internal); - return Base::internalToExternal(); - } - - bool externalToInternal() override - { - if (m_externalToInternal) - return m_externalToInternal(Base::m_internal, Base::m_external); - return Base::externalToInternal(); + if (!m_internalToExternal) + return Base::m_internal; + ValueType val; + m_internalToExternal(val, Base::m_internal); + return val; } Updater m_internalToBuffer; Updater m_bufferToInternal; Updater m_internalToExternal; - Updater m_externalToInternal; }; class QTCREATOR_UTILS_EXPORT BoolAspect : public TypedAspect<bool> @@ -536,6 +516,9 @@ public: void addToLayout(Layouting::LayoutItem &parent) override; + QString operator()() const { return expandedValue(); } + QString expandedValue() const; + // Hook between UI and StringAspect: using ValueAcceptor = std::function<std::optional<QString>(const QString &, const QString &)>; void setValueAcceptor(ValueAcceptor &&acceptor); @@ -599,7 +582,8 @@ public: FilePath operator()() const; FilePath expandedValue() const; QString value() const; - void setValue(const FilePath &filePath); + void setValue(const FilePath &filePath, Announcement howToAnnounce = DoEmit); + void setValue(const QString &filePath, Announcement howToAnnounce = DoEmit); void setDefaultValue(const FilePath &filePath); void setPromptDialogFilter(const QString &filter); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index d2653baefeb..746c78f5491 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -2071,10 +2071,7 @@ QString CMakeBuildSystem::cmakeBuildType() const void CMakeBuildConfiguration::setCMakeBuildType(const QString &cmakeBuildType, bool quiet) { - if (quiet) - buildTypeAspect.setValueQuietly(cmakeBuildType); - else - buildTypeAspect.setValue(cmakeBuildType); + buildTypeAspect.setValue(cmakeBuildType, quiet ? BaseAspect::BeQuiet : BaseAspect::DoEmit); } namespace Internal { @@ -2134,7 +2131,7 @@ void InitialCMakeArgumentsAspect::setAllValues(const QString &values, QStringLis // Display the unknown arguments in "Additional CMake Options" const QString additionalOptionsValue = ProcessArgs::joinArgs(additionalOptions); - setValueQuietly(additionalOptionsValue); + setValue(additionalOptionsValue, BeQuiet); } void InitialCMakeArgumentsAspect::setCMakeConfiguration(const CMakeConfig &config) diff --git a/src/plugins/debugger/registerpostmortemaction.cpp b/src/plugins/debugger/registerpostmortemaction.cpp index a7f68083180..4cfbdc02e94 100644 --- a/src/plugins/debugger/registerpostmortemaction.cpp +++ b/src/plugins/debugger/registerpostmortemaction.cpp @@ -60,7 +60,7 @@ void RegisterPostMortemAction::readSettings() registered = isRegistered(handle, debuggerCall(), &errorMessage); if (handle) RegCloseKey(handle); - setValueQuietly(registered); + setValue(registered, BaseAspect::BeQuiet); } } // namespace Internal diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index e2aa69dff9b..782eadf91df 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -37,7 +37,7 @@ public: arguments.setLabelText(Tr::tr("Arguments:")); workingDirectory.setSettingsKey(PROCESS_WORKINGDIRECTORY_KEY); - workingDirectory.setValue(Constants::DEFAULT_WORKING_DIR); + workingDirectory.setValue(QString(Constants::DEFAULT_WORKING_DIR)); workingDirectory.setLabelText(Tr::tr("Working directory:")); workingDirectory.setExpectedKind(PathChooser::Directory); From f65b343c8ac6dd4b68a98d56207274f0ccbe2a51 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 8 Aug 2023 13:04:39 +0200 Subject: [PATCH 0638/1777] Utils: Allow (encoded) colons in host parts of FilePath Change-Id: I6acd8ac8ab44cb895cc08ce6b1972802f79a2a53 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/filepath.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 796f887cc23..c6d92cff082 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -213,12 +213,13 @@ QString FilePath::encodedHost() const QString result = host().toString(); result.replace('%', "%25"); result.replace('/', "%2f"); + result.replace(':', "%3a"); return result; } QString decodeHost(QString host) { - return host.replace("%25", "%").replace("%2f", "/"); + return host.replace("%25", "%").replace("%2f", "/").replace("%3a", ":"); } /*! From 468a08bb2b6f23e2b7121587784b9e3414d0ed83 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 14:31:17 +0200 Subject: [PATCH 0639/1777] DirectoryFilter: Set future synchronizer for the async recipe task Change-Id: I2c337f35b818e4c1748e34a2479dc21f66bd50de Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/coreplugin/locator/directoryfilter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/coreplugin/locator/directoryfilter.cpp b/src/plugins/coreplugin/locator/directoryfilter.cpp index 4a0f11d3877..4b22bcbf63d 100644 --- a/src/plugins/coreplugin/locator/directoryfilter.cpp +++ b/src/plugins/coreplugin/locator/directoryfilter.cpp @@ -6,6 +6,8 @@ #include "locator.h" #include "../coreplugintr.h" +#include <extensionsystem/pluginmanager.h> + #include <utils/algorithm.h> #include <utils/async.h> #include <utils/fileutils.h> @@ -87,6 +89,7 @@ DirectoryFilter::DirectoryFilter(Id id) return SetupResult::StopWithDone; // Group stops, skips async task }; const auto asyncSetup = [this](Async<FilePaths> &async) { + async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer()); async.setConcurrentCallData(&refresh, m_directories, m_filters, m_exclusionFilters, displayName()); }; From b92ac9a941281b22c6da551e1407314291aabcc8 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 4 Aug 2023 13:20:13 +0200 Subject: [PATCH 0640/1777] TextEditor: Introduce a per-project variant of the comments settings These settings can clearly differ per project. Note that the classes have to live in the ProjectExplorer plugin, which has a (questionable) dependency on TextEditor. Change-Id: I7e3816da30cecd1ccb66549a2226b44dc0a26cb4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/cppeditor/cppdoxygen_test.cpp | 28 ++-- src/plugins/cppeditor/cppdoxygen_test.h | 5 - src/plugins/cppeditor/cppeditorwidget.cpp | 3 +- src/plugins/cppeditor/cpptoolssettings.cpp | 16 -- src/plugins/cppeditor/cpptoolssettings.h | 7 - src/plugins/projectexplorer/CMakeLists.txt | 1 + .../projectcommentssettings.cpp | 128 ++++++++++++++++ .../projectexplorer/projectcommentssettings.h | 49 ++++++ .../projectexplorer/projectexplorer.cpp | 13 ++ .../projectexplorer/projectexplorer.qbs | 1 + src/plugins/texteditor/commentssettings.cpp | 139 +++++++++--------- src/plugins/texteditor/commentssettings.h | 45 +++++- src/plugins/texteditor/texteditorconstants.h | 1 + src/plugins/texteditor/texteditorplugin.cpp | 3 + src/plugins/texteditor/texteditorsettings.cpp | 13 +- src/plugins/texteditor/texteditorsettings.h | 9 +- 16 files changed, 344 insertions(+), 117 deletions(-) create mode 100644 src/plugins/projectexplorer/projectcommentssettings.cpp create mode 100644 src/plugins/projectexplorer/projectcommentssettings.h diff --git a/src/plugins/cppeditor/cppdoxygen_test.cpp b/src/plugins/cppeditor/cppdoxygen_test.cpp index ad4f44c9efb..5e7c0f87722 100644 --- a/src/plugins/cppeditor/cppdoxygen_test.cpp +++ b/src/plugins/cppeditor/cppdoxygen_test.cpp @@ -8,6 +8,7 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/documentmodel.h> +#include <texteditor/commentssettings.h> #include <QCoreApplication> #include <QDebug> @@ -20,6 +21,7 @@ namespace { typedef QByteArray _; } using CppEditor::Tests::TemporaryDir; using CppEditor::Tests::TestCase; using CppEditor::Internal::Tests::VerifyCleanCppModelManager; +using namespace TextEditor; using namespace Utils; @@ -27,6 +29,19 @@ namespace CppEditor { namespace Internal { namespace Tests { +class SettingsInjector +{ +public: + SettingsInjector(const CommentsSettings::Data &tempSettings) + { + CommentsSettings::setData(tempSettings); + } + ~SettingsInjector() { CommentsSettings::setData(m_oldSettings); } + +private: + const CommentsSettings::Data m_oldSettings = CommentsSettings::data(); +}; + void DoxygenTest::initTestCase() { verifyCleanState(); @@ -39,8 +54,6 @@ void DoxygenTest::cleanTestCase() void DoxygenTest::cleanup() { - if (oldSettings) - CppToolsSettings::setCommentsSettings(*oldSettings); QVERIFY(Core::EditorManager::closeAllEditors(false)); QVERIFY(TestCase::garbageCollectGlobalSnapshot()); } @@ -372,7 +385,7 @@ void DoxygenTest::testWithMacroFromHeaderBeforeFunction() const CppTestDocument headerDocumentDefiningMacro("header.h", "#define API\n"); - runTest(given, expected, /*settings=*/ 0, {headerDocumentDefiningMacro}); + runTest(given, expected, {headerDocumentDefiningMacro}); } void DoxygenTest::testNoLeadingAsterisks_data() @@ -396,8 +409,9 @@ void DoxygenTest::testNoLeadingAsterisks() TextEditor::CommentsSettings::Data injection; injection.enableDoxygen = true; injection.leadingAsterisks = false; + const SettingsInjector injector(injection); - runTest(given, expected, &injection); + runTest(given, expected); } void DoxygenTest::verifyCleanState() const @@ -410,7 +424,6 @@ void DoxygenTest::verifyCleanState() const /// The '|' in the input denotes the cursor position. void DoxygenTest::runTest(const QByteArray &original, const QByteArray &expected, - TextEditor::CommentsSettings::Data *settings, const TestDocuments &includedHeaderDocuments) { // Write files to disk @@ -433,11 +446,6 @@ void DoxygenTest::runTest(const QByteArray &original, QVERIFY(TestCase::openCppEditor(testDocument.filePath(), &testDocument.m_editor, &testDocument.m_editorWidget)); - if (settings) { - oldSettings.reset(new TextEditor::CommentsSettings::Data(CppToolsSettings::commentsSettings())); - CppToolsSettings::setCommentsSettings(*settings); - } - // We want to test documents that start with a comment. By default, the // editor will fold the very first comment it encounters, assuming // it is a license header. Currently unfoldAll() does not work as diff --git a/src/plugins/cppeditor/cppdoxygen_test.h b/src/plugins/cppeditor/cppdoxygen_test.h index 362bf925cd1..512d37a03ef 100644 --- a/src/plugins/cppeditor/cppdoxygen_test.h +++ b/src/plugins/cppeditor/cppdoxygen_test.h @@ -5,8 +5,6 @@ #include "cpptoolstestcase.h" -#include <texteditor/commentssettings.h> - #include <QObject> #include <QScopedPointer> @@ -36,10 +34,7 @@ private: void verifyCleanState() const; void runTest(const QByteArray &original, const QByteArray &expected, - TextEditor::CommentsSettings::Data *settings = 0, const TestDocuments &includedHeaderDocuments = TestDocuments()); - - QScopedPointer<TextEditor::CommentsSettings::Data> oldSettings; }; } // namespace Tests diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index 20c3f596ce1..821217873e9 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -307,7 +307,8 @@ bool handleDoxygenContinuation(QTextCursor &cursor, static bool trySplitComment(TextEditor::TextEditorWidget *editorWidget, const CPlusPlus::Snapshot &snapshot) { - const TextEditor::CommentsSettings::Data &settings = CppToolsSettings::instance()->commentsSettings(); + const TextEditor::CommentsSettings::Data &settings + = TextEditorSettings::commentsSettings(editorWidget->textDocument()->filePath()); if (!settings.enableDoxygen && !settings.leadingAsterisks) return false; diff --git a/src/plugins/cppeditor/cpptoolssettings.cpp b/src/plugins/cppeditor/cpptoolssettings.cpp index d0aa6d9159d..da01d9c09e5 100644 --- a/src/plugins/cppeditor/cpptoolssettings.cpp +++ b/src/plugins/cppeditor/cpptoolssettings.cpp @@ -9,7 +9,6 @@ #include "cppcodestylepreferencesfactory.h" #include <coreplugin/icore.h> -#include <texteditor/commentssettings.h> #include <texteditor/completionsettingspage.h> #include <texteditor/codestylepool.h> #include <texteditor/tabsettings.h> @@ -33,7 +32,6 @@ namespace Internal { class CppToolsSettingsPrivate { public: - CommentsSettings::Data m_commentsSettings; CppCodeStylePreferences *m_globalCodeStyle = nullptr; }; @@ -50,10 +48,6 @@ CppToolsSettings::CppToolsSettings() qRegisterMetaType<CppCodeStyleSettings>("CppEditor::CppCodeStyleSettings"); - d->m_commentsSettings = TextEditorSettings::commentsSettings(); - connect(TextEditorSettings::instance(), &TextEditorSettings::commentsSettingsChanged, - this, &CppToolsSettings::setCommentsSettings); - // code style factory ICodeStylePreferencesFactory *factory = new CppCodeStylePreferencesFactory(); TextEditorSettings::registerCodeStyleFactory(factory); @@ -164,16 +158,6 @@ CppCodeStylePreferences *CppToolsSettings::cppCodeStyle() return d->m_globalCodeStyle; } -const CommentsSettings::Data &CppToolsSettings::commentsSettings() -{ - return d->m_commentsSettings; -} - -void CppToolsSettings::setCommentsSettings(const CommentsSettings::Data &commentsSettings) -{ - d->m_commentsSettings = commentsSettings; -} - static QString sortEditorDocumentOutlineKey() { return QLatin1String(Constants::CPPEDITOR_SETTINGSGROUP) diff --git a/src/plugins/cppeditor/cpptoolssettings.h b/src/plugins/cppeditor/cpptoolssettings.h index 910bae75050..674b0d0053b 100644 --- a/src/plugins/cppeditor/cpptoolssettings.h +++ b/src/plugins/cppeditor/cpptoolssettings.h @@ -5,12 +5,8 @@ #include "cppeditor_global.h" -#include <texteditor/texteditorsettings.h> - #include <QObject> -namespace TextEditor { class CommentsSettings; } - namespace CppEditor { class CppCodeStylePreferences; @@ -27,9 +23,6 @@ public: static CppCodeStylePreferences *cppCodeStyle(); - static const TextEditor::CommentsSettings::Data &commentsSettings(); - static void setCommentsSettings(const TextEditor::CommentsSettings::Data &commentsSettings); - static bool sortedEditorDocumentOutline(); static void setSortedEditorDocumentOutline(bool sorted); }; diff --git a/src/plugins/projectexplorer/CMakeLists.txt b/src/plugins/projectexplorer/CMakeLists.txt index eccfecea050..63b511368c0 100644 --- a/src/plugins/projectexplorer/CMakeLists.txt +++ b/src/plugins/projectexplorer/CMakeLists.txt @@ -124,6 +124,7 @@ add_qtc_plugin(ProjectExplorer processparameters.cpp processparameters.h processstep.cpp processstep.h project.cpp project.h + projectcommentssettings.cpp projectcommentssettings.h projectconfiguration.cpp projectconfiguration.h projectconfigurationmodel.cpp projectconfigurationmodel.h projectexplorer.cpp projectexplorer.h diff --git a/src/plugins/projectexplorer/projectcommentssettings.cpp b/src/plugins/projectexplorer/projectcommentssettings.cpp new file mode 100644 index 00000000000..e08638e028a --- /dev/null +++ b/src/plugins/projectexplorer/projectcommentssettings.cpp @@ -0,0 +1,128 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "projectcommentssettings.h" + +#include "project.h" + +#include <texteditor/texteditorconstants.h> +#include <texteditor/texteditorsettings.h> + +#include <QCheckBox> +#include <QVBoxLayout> + +using namespace TextEditor; + +namespace ProjectExplorer { +namespace Internal { +const char kUseGlobalKey[] = "UseGlobalKey"; + +ProjectCommentsSettings::ProjectCommentsSettings(ProjectExplorer::Project *project) + : m_project(project) +{ + loadSettings(); +} + +CommentsSettings::Data ProjectCommentsSettings::settings() const +{ + return m_useGlobalSettings ? CommentsSettings::data() : m_customSettings; +} + +void ProjectCommentsSettings::setSettings(const CommentsSettings::Data &settings) +{ + if (settings == m_customSettings) + return; + m_customSettings = settings; + saveSettings(); + emit TextEditorSettings::instance()->commentsSettingsChanged(); +} + +void ProjectCommentsSettings::setUseGlobalSettings(bool useGlobal) +{ + if (useGlobal == m_useGlobalSettings) + return; + m_useGlobalSettings = useGlobal; + saveSettings(); + emit TextEditorSettings::instance()->commentsSettingsChanged(); +} + +void ProjectCommentsSettings::loadSettings() +{ + if (!m_project) + return; + + const QVariant entry = m_project->namedSettings(CommentsSettings::mainSettingsKey()); + if (!entry.isValid()) + return; + + const QVariantMap data = entry.toMap(); + m_useGlobalSettings = data.value(kUseGlobalKey, true).toBool(); + m_customSettings.enableDoxygen = data.value(CommentsSettings::enableDoxygenSettingsKey(), + m_customSettings.enableDoxygen).toBool(); + m_customSettings.generateBrief = data.value(CommentsSettings::generateBriefSettingsKey(), + m_customSettings.generateBrief).toBool(); + m_customSettings.leadingAsterisks = data.value(CommentsSettings::leadingAsterisksSettingsKey(), + m_customSettings.leadingAsterisks).toBool(); +} + +void ProjectCommentsSettings::saveSettings() +{ + if (!m_project) + return; + + // Optimization: Don't save anything if the user never switched away from the default. + if (m_useGlobalSettings && !m_project->namedSettings + (CommentsSettings::mainSettingsKey()).isValid()) { + return; + } + + QVariantMap data; + data.insert(kUseGlobalKey, m_useGlobalSettings); + data.insert(CommentsSettings::enableDoxygenSettingsKey(), m_customSettings.enableDoxygen); + data.insert(CommentsSettings::generateBriefSettingsKey(), m_customSettings.generateBrief); + data.insert(CommentsSettings::leadingAsterisksSettingsKey(), m_customSettings.leadingAsterisks); + m_project->setNamedSettings(CommentsSettings::mainSettingsKey(), data); +} + +class ProjectCommentsSettingsWidget::Private +{ +public: + Private(ProjectExplorer::Project *project) : settings(project) {} + + ProjectCommentsSettings settings; + CommentsSettingsWidget widget{settings.settings()}; + QCheckBox useGlobalSettingsCheckBox; +}; + +ProjectCommentsSettingsWidget::ProjectCommentsSettingsWidget(ProjectExplorer::Project *project) + : d(new Private(project)) +{ + setGlobalSettingsId(TextEditor::Constants::TEXT_EDITOR_COMMENTS_SETTINGS); + const auto layout = new QVBoxLayout(this); + layout->setContentsMargins(0, 0, 0, 0); + layout->addWidget(&d->widget); + + const auto updateGlobalSettingsCheckBox = [this] { + setUseGlobalSettingsCheckBoxEnabled(true); + setUseGlobalSettings(d->settings.useGlobalSettings()); + d->widget.setEnabled(!useGlobalSettings()); + }; + updateGlobalSettingsCheckBox(); + connect(TextEditorSettings::instance(), &TextEditorSettings::commentsSettingsChanged, + this, updateGlobalSettingsCheckBox); + connect(this, &ProjectSettingsWidget::useGlobalSettingsChanged, this, + [this](bool checked) { + d->widget.setEnabled(!checked); + d->settings.setUseGlobalSettings(checked); + if (!checked) + d->settings.setSettings(d->widget.settingsData()); + }); + connect(&d->widget, &CommentsSettingsWidget::settingsChanged, this, [this] { + d->settings.setSettings(d->widget.settingsData()); + }); +} + +ProjectCommentsSettingsWidget::~ProjectCommentsSettingsWidget() { delete d; } + +} // namespace Internal +} // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/projectcommentssettings.h b/src/plugins/projectexplorer/projectcommentssettings.h new file mode 100644 index 00000000000..5beb4f27a7a --- /dev/null +++ b/src/plugins/projectexplorer/projectcommentssettings.h @@ -0,0 +1,49 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "projectsettingswidget.h" + +#include <texteditor/commentssettings.h> + +namespace ProjectExplorer { +class Project; + +namespace Internal { + +class ProjectCommentsSettings +{ +public: + // Passing a null ptr is allowed and yields the global settings, so you can use + // this class transparently for both cases. + ProjectCommentsSettings(Project *project); + + TextEditor::CommentsSettings::Data settings() const; + void setSettings(const TextEditor::CommentsSettings::Data &settings); + bool useGlobalSettings() const { return m_useGlobalSettings; } + void setUseGlobalSettings(bool useGlobal); + +private: + void loadSettings(); + void saveSettings(); + + ProjectExplorer::Project * const m_project; + TextEditor::CommentsSettings::Data m_customSettings; + bool m_useGlobalSettings = true; +}; + +class ProjectCommentsSettingsWidget : public ProjectSettingsWidget +{ +public: + ProjectCommentsSettingsWidget(ProjectExplorer::Project *project); + ~ProjectCommentsSettingsWidget(); + +private: + class Private; + Private * const d; +}; + +} // namespace Internal +} // namespace ProjectExplorer + diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index d31f2a7a8ab..8f5edad0bc4 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -55,6 +55,7 @@ #include "parseissuesdialog.h" #include "processstep.h" #include "project.h" +#include "projectcommentssettings.h" #include "projectexplorericons.h" #include "projectexplorersettings.h" #include "projectexplorertr.h" @@ -115,6 +116,7 @@ #include <texteditor/findinfiles.h> #include <texteditor/textdocument.h> #include <texteditor/texteditorconstants.h> +#include <texteditor/texteditorsettings.h> #include <utils/algorithm.h> #include <utils/fileutils.h> @@ -883,6 +885,17 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er panelFactory->setCreateWidgetFunction([](Project *project) { return new CodeStyleSettingsWidget(project); }); ProjectPanelFactory::registerFactory(panelFactory); + panelFactory = new ProjectExplorer::ProjectPanelFactory; + panelFactory->setPriority(45); + panelFactory->setDisplayName(Tr::tr("Documentation Comments")); + panelFactory->setCreateWidgetFunction([](ProjectExplorer::Project *project) { + return new ProjectCommentsSettingsWidget(project); + }); + ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory); + TextEditor::TextEditorSettings::setCommentsSettingsRetriever([](const FilePath &filePath) { + return ProjectCommentsSettings(ProjectManager::projectForFile(filePath)).settings(); + }); + panelFactory = new ProjectPanelFactory; panelFactory->setPriority(50); panelFactory->setDisplayName(Tr::tr("Dependencies")); diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 0b3cbe5fe01..f398bb8b7cf 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -101,6 +101,7 @@ Project { "processparameters.cpp", "processparameters.h", "processstep.cpp", "processstep.h", "project.cpp", "project.h", + "projectcommentssettings.cpp", "projectcommentssettings.h", "projectconfiguration.cpp", "projectconfiguration.h", "projectconfigurationmodel.cpp", "projectconfigurationmodel.h", "projectexplorer.cpp", "projectexplorer.h", diff --git a/src/plugins/texteditor/commentssettings.cpp b/src/plugins/texteditor/commentssettings.cpp index 041ca3e15c4..5c6f533d254 100644 --- a/src/plugins/texteditor/commentssettings.cpp +++ b/src/plugins/texteditor/commentssettings.cpp @@ -8,6 +8,7 @@ #include "texteditortr.h" #include <coreplugin/icore.h> +#include <projectexplorer/project.h> #include <utils/layoutbuilder.h> #include <QCheckBox> @@ -24,22 +25,19 @@ const char kGenerateBrief[] = "GenerateBrief"; const char kAddLeadingAsterisks[] = "AddLeadingAsterisks"; } -bool operator==(const CommentsSettings::Data &a, const CommentsSettings::Data &b) -{ - return a.enableDoxygen == b.enableDoxygen - && a.generateBrief == b.generateBrief - && a.leadingAsterisks == b.leadingAsterisks; -} - void CommentsSettings::setData(const Data &data) { if (data == instance().m_data) return; instance().m_data = data; instance().save(); - emit TextEditorSettings::instance()->commentsSettingsChanged(data); } +QString CommentsSettings::mainSettingsKey() { return kDocumentationCommentsGroup; } +QString CommentsSettings::enableDoxygenSettingsKey() { return kEnableDoxygenBlocks; } +QString CommentsSettings::generateBriefSettingsKey() { return kGenerateBrief; } +QString CommentsSettings::leadingAsterisksSettingsKey() { return kAddLeadingAsterisks; } + CommentsSettings::CommentsSettings() { load(); @@ -71,79 +69,86 @@ void CommentsSettings::load() s->endGroup(); } -namespace Internal { - -class CommentsSettingsWidget final : public Core::IOptionsPageWidget +class CommentsSettingsWidget::Private { public: - explicit CommentsSettingsWidget() - { - initFromSettings(); - - m_enableDoxygenCheckBox.setText(Tr::tr("Enable Doxygen blocks")); - m_enableDoxygenCheckBox.setToolTip( - Tr::tr("Automatically creates a Doxygen comment upon pressing " - "enter after a '/**', '/*!', '//!' or '///'.")); - - m_generateBriefCheckBox.setText(Tr::tr("Generate brief description")); - m_generateBriefCheckBox.setToolTip( - Tr::tr("Generates a <i>brief</i> command with an initial " - "description for the corresponding declaration.")); - - m_leadingAsterisksCheckBox.setText(Tr::tr("Add leading asterisks")); - m_leadingAsterisksCheckBox.setToolTip( - Tr::tr("Adds leading asterisks when continuing C/C++ \"/*\", Qt \"/*!\" " - "and Java \"/**\" style comments on new lines.")); - - Column { - &m_enableDoxygenCheckBox, - Row { Space(30), &m_generateBriefCheckBox }, - &m_leadingAsterisksCheckBox, - st - }.attachTo(this); - - connect(&m_enableDoxygenCheckBox, &QCheckBox::toggled, - &m_generateBriefCheckBox, &QCheckBox::setEnabled); - } - -private: - void initFromSettings() - { - const CommentsSettings::Data &settings = CommentsSettings::data(); - m_enableDoxygenCheckBox.setChecked(settings.enableDoxygen); - m_generateBriefCheckBox.setEnabled(m_enableDoxygenCheckBox.isChecked()); - m_generateBriefCheckBox.setChecked(settings.generateBrief); - m_leadingAsterisksCheckBox.setChecked(settings.leadingAsterisks); - } - - CommentsSettings::Data toSettings() const - { - CommentsSettings::Data settings; - settings.enableDoxygen = m_enableDoxygenCheckBox.isChecked(); - settings.generateBrief = m_generateBriefCheckBox.isChecked(); - settings.leadingAsterisks = m_leadingAsterisksCheckBox.isChecked(); - return settings; - } - - void apply() override - { - CommentsSettings::setData(toSettings()); - } - QCheckBox m_overwriteClosingChars; QCheckBox m_enableDoxygenCheckBox; QCheckBox m_generateBriefCheckBox; QCheckBox m_leadingAsterisksCheckBox; }; +CommentsSettingsWidget::CommentsSettingsWidget(const CommentsSettings::Data &settings) + : d(new Private) +{ + initFromSettings(settings); + + d->m_enableDoxygenCheckBox.setText(Tr::tr("Enable Doxygen blocks")); + d->m_enableDoxygenCheckBox.setToolTip( + Tr::tr("Automatically creates a Doxygen comment upon pressing " + "enter after a '/**', '/*!', '//!' or '///'.")); + + d->m_generateBriefCheckBox.setText(Tr::tr("Generate brief description")); + d->m_generateBriefCheckBox.setToolTip( + Tr::tr("Generates a <i>brief</i> command with an initial " + "description for the corresponding declaration.")); + + d->m_leadingAsterisksCheckBox.setText(Tr::tr("Add leading asterisks")); + d->m_leadingAsterisksCheckBox.setToolTip( + Tr::tr("Adds leading asterisks when continuing C/C++ \"/*\", Qt \"/*!\" " + "and Java \"/**\" style comments on new lines.")); + + Column { + &d->m_enableDoxygenCheckBox, + Row { Space(30), &d->m_generateBriefCheckBox }, + &d->m_leadingAsterisksCheckBox, + st + }.attachTo(this); + + connect(&d->m_enableDoxygenCheckBox, &QCheckBox::toggled, + &d->m_generateBriefCheckBox, &QCheckBox::setEnabled); + + for (QCheckBox *checkBox : {&d->m_enableDoxygenCheckBox, &d->m_generateBriefCheckBox, + &d->m_leadingAsterisksCheckBox}) { + connect(checkBox, &QCheckBox::clicked, this, &CommentsSettingsWidget::settingsChanged); + } +} + +CommentsSettingsWidget::~CommentsSettingsWidget() { delete d; } + +CommentsSettings::Data CommentsSettingsWidget::settingsData() const +{ + CommentsSettings::Data settings; + settings.enableDoxygen = d->m_enableDoxygenCheckBox.isChecked(); + settings.generateBrief = d->m_generateBriefCheckBox.isChecked(); + settings.leadingAsterisks = d->m_leadingAsterisksCheckBox.isChecked(); + return settings; +} + +void CommentsSettingsWidget::apply() +{ + // This function is only ever called for the global settings page. + CommentsSettings::setData(settingsData()); +} + +void CommentsSettingsWidget::initFromSettings(const CommentsSettings::Data &settings) +{ + d->m_enableDoxygenCheckBox.setChecked(settings.enableDoxygen); + d->m_generateBriefCheckBox.setEnabled(d->m_enableDoxygenCheckBox.isChecked()); + d->m_generateBriefCheckBox.setChecked(settings.generateBrief); + d->m_leadingAsterisksCheckBox.setChecked(settings.leadingAsterisks); +} + +namespace Internal { + CommentsSettingsPage::CommentsSettingsPage() { - setId("Q.Comments"); + setId(Constants::TEXT_EDITOR_COMMENTS_SETTINGS); setDisplayName(Tr::tr("Documentation Comments")); setCategory(TextEditor::Constants::TEXT_EDITOR_SETTINGS_CATEGORY); setDisplayCategory(Tr::tr("Text Editor")); setCategoryIconPath(TextEditor::Constants::TEXT_EDITOR_SETTINGS_CATEGORY_ICON_PATH); - setWidgetCreator([] { return new CommentsSettingsWidget; }); + setWidgetCreator([] { return new CommentsSettingsWidget(CommentsSettings::data()); }); } } // namespace Internal diff --git a/src/plugins/texteditor/commentssettings.h b/src/plugins/texteditor/commentssettings.h index 2f3e5682bd0..b14bd376ae5 100644 --- a/src/plugins/texteditor/commentssettings.h +++ b/src/plugins/texteditor/commentssettings.h @@ -7,9 +7,7 @@ #include <coreplugin/dialogs/ioptionspage.h> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace ProjectExplorer { class Project; } namespace TextEditor { @@ -18,9 +16,6 @@ class TEXTEDITOR_EXPORT CommentsSettings public: class Data { public: - friend bool operator==(const Data &a, const Data &b); - friend bool operator!=(const Data &a, const Data &b) { return !(a == b); } - bool enableDoxygen = true; bool generateBrief = true; bool leadingAsterisks = true; @@ -29,6 +24,11 @@ public: static Data data() { return instance().m_data; } static void setData(const Data &data); + static QString mainSettingsKey(); + static QString enableDoxygenSettingsKey(); + static QString generateBriefSettingsKey(); + static QString leadingAsterisksSettingsKey(); + private: CommentsSettings(); static CommentsSettings &instance(); @@ -37,6 +37,38 @@ private: Data m_data; }; +inline bool operator==(const CommentsSettings::Data &a, const CommentsSettings::Data &b) +{ + return a.enableDoxygen == b.enableDoxygen + && a.generateBrief == b.generateBrief + && a.leadingAsterisks == b.leadingAsterisks; +} +inline bool operator!=(const CommentsSettings::Data &a, const CommentsSettings::Data &b) +{ + return !(a == b); +} + + +class TEXTEDITOR_EXPORT CommentsSettingsWidget final : public Core::IOptionsPageWidget +{ + Q_OBJECT +public: + CommentsSettingsWidget(const CommentsSettings::Data &settings); + ~CommentsSettingsWidget(); + + CommentsSettings::Data settingsData() const; + +signals: + void settingsChanged(); + +private: + void apply() override; + + void initFromSettings(const CommentsSettings::Data &settings); + + class Private; + Private * const d; +}; namespace Internal { @@ -47,5 +79,4 @@ public: }; } // namespace Internal - } // namespace TextEditor diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index 946b2b2f890..9da6b86eb37 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -226,6 +226,7 @@ const char TEXT_EDITOR_BEHAVIOR_SETTINGS[] = "B.BehaviourSettings"; const char TEXT_EDITOR_DISPLAY_SETTINGS[] = "D.DisplaySettings"; const char TEXT_EDITOR_HIGHLIGHTER_SETTINGS[] = "E.HighlighterSettings"; const char TEXT_EDITOR_SNIPPETS_SETTINGS[] = "F.SnippetsSettings"; +const char TEXT_EDITOR_COMMENTS_SETTINGS[] = "Q.CommentsSettings"; const char HIGHLIGHTER_SETTINGS_CATEGORY[] = "HighlighterSettings"; diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index f82155c0a54..70a50856145 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -3,6 +3,7 @@ #include "texteditorplugin.h" +#include "commentssettings.h" #include "findincurrentfile.h" #include "findinfiles.h" #include "findinopenfiles.h" @@ -35,6 +36,8 @@ #include <extensionsystem/pluginmanager.h> +#include <projectexplorer/projectpanelfactory.h> + #include <utils/fancylineedit.h> #include <utils/qtcassert.h> #include <utils/macroexpander.h> diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index 95d0fbfe78c..d2ac16eb65d 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -56,6 +56,8 @@ public: QMap<Utils::Id, CodeStylePool *> m_languageToCodeStylePool; QMap<QString, Utils::Id> m_mimeTypeToLanguage; + std::function<CommentsSettings::Data(const Utils::FilePath &)> m_retrieveCommentsSettings; + private: static std::vector<FormatDescription> initialFormats(); }; @@ -503,9 +505,16 @@ const ExtraEncodingSettings &TextEditorSettings::extraEncodingSettings() return d->m_behaviorSettingsPage.extraEncodingSettings(); } -CommentsSettings::Data TextEditorSettings::commentsSettings() +void TextEditorSettings::setCommentsSettingsRetriever( + const std::function<CommentsSettings::Data(const Utils::FilePath &)> &retrieve) { - return CommentsSettings::data(); + d->m_retrieveCommentsSettings = retrieve; +} + +CommentsSettings::Data TextEditorSettings::commentsSettings(const Utils::FilePath &filePath) +{ + QTC_ASSERT(d->m_retrieveCommentsSettings, return CommentsSettings::data()); + return d->m_retrieveCommentsSettings(filePath); } void TextEditorSettings::registerCodeStyleFactory(ICodeStylePreferencesFactory *factory) diff --git a/src/plugins/texteditor/texteditorsettings.h b/src/plugins/texteditor/texteditorsettings.h index 88cf707aa39..f5ebccc0cd1 100644 --- a/src/plugins/texteditor/texteditorsettings.h +++ b/src/plugins/texteditor/texteditorsettings.h @@ -10,6 +10,8 @@ #include <QObject> +#include <functional> + QT_BEGIN_NAMESPACE template <typename Key, typename T> class QMap; @@ -55,7 +57,10 @@ public: static const CompletionSettings &completionSettings(); static const HighlighterSettings &highlighterSettings(); static const ExtraEncodingSettings &extraEncodingSettings(); - static CommentsSettings::Data commentsSettings(); + + static void setCommentsSettingsRetriever( + const std::function<CommentsSettings::Data(const Utils::FilePath &)> &); + static CommentsSettings::Data commentsSettings(const Utils::FilePath &filePath); static ICodeStylePreferencesFactory *codeStyleFactory(Utils::Id languageId); static const QMap<Utils::Id, ICodeStylePreferencesFactory *> &codeStyleFactories(); @@ -87,7 +92,7 @@ signals: void displaySettingsChanged(const TextEditor::DisplaySettings &); void completionSettingsChanged(const TextEditor::CompletionSettings &); void extraEncodingSettingsChanged(const TextEditor::ExtraEncodingSettings &); - void commentsSettingsChanged(const TextEditor::CommentsSettings::Data &); + void commentsSettingsChanged(); }; } // namespace TextEditor From f3e1aece8305976a48ab2fa898bc5e7f41cc3d2a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 8 Aug 2023 15:00:18 +0200 Subject: [PATCH 0641/1777] QtSupport: De-Q_OBJECT-ify UicGenerator Change-Id: I6934fc1553b2f32e042aef0c8a0141fee93a52cd Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/qtsupport/uicgenerator.cpp | 37 ++++++++++++++------------ src/plugins/qtsupport/uicgenerator.h | 16 +---------- 2 files changed, 21 insertions(+), 32 deletions(-) diff --git a/src/plugins/qtsupport/uicgenerator.cpp b/src/plugins/qtsupport/uicgenerator.cpp index 4c68d5efa54..e49b2eb66db 100644 --- a/src/plugins/qtsupport/uicgenerator.cpp +++ b/src/plugins/qtsupport/uicgenerator.cpp @@ -14,22 +14,30 @@ #include <utils/qtcassert.h> #include <QDateTime> -#include <QDir> -#include <QFileInfo> #include <QLoggingCategory> using namespace ProjectExplorer; +using namespace Utils; namespace QtSupport { -UicGenerator::UicGenerator(const Project *project, const Utils::FilePath &source, - const Utils::FilePaths &targets, QObject *parent) : - ProcessExtraCompiler(project, source, targets, parent) +class UicGenerator final : public ProcessExtraCompiler { - QTC_ASSERT(targets.count() == 1, return); -} +public: + UicGenerator(const Project *project, const FilePath &source, + const FilePaths &targets, QObject *parent) + : ProcessExtraCompiler(project, source, targets, parent) + { + QTC_ASSERT(targets.count() == 1, return); + } -Utils::FilePath UicGenerator::command() const +protected: + FilePath command() const override; + QStringList arguments() const override { return {"-p"}; } + FileNameToContentsHash handleProcessFinished(Process *process) override; +}; + +FilePath UicGenerator::command() const { QtSupport::QtVersion *version = nullptr; Target *target; @@ -44,18 +52,13 @@ Utils::FilePath UicGenerator::command() const return version->uicFilePath(); } -QStringList UicGenerator::arguments() const -{ - return {"-p"}; -} - -FileNameToContentsHash UicGenerator::handleProcessFinished(Utils::Process *process) +FileNameToContentsHash UicGenerator::handleProcessFinished(Process *process) { FileNameToContentsHash result; if (process->exitStatus() != QProcess::NormalExit && process->exitCode() != 0) return result; - const Utils::FilePaths targetList = targets(); + const FilePaths targetList = targets(); if (targetList.size() != 1) return result; // As far as I can discover in the UIC sources, it writes out local 8-bit encoding. The @@ -77,8 +80,8 @@ QString UicGeneratorFactory::sourceTag() const } ExtraCompiler *UicGeneratorFactory::create(const Project *project, - const Utils::FilePath &source, - const Utils::FilePaths &targets) + const FilePath &source, + const FilePaths &targets) { return new UicGenerator(project, source, targets, this); } diff --git a/src/plugins/qtsupport/uicgenerator.h b/src/plugins/qtsupport/uicgenerator.h index d68b6814c22..b3b1de17e4a 100644 --- a/src/plugins/qtsupport/uicgenerator.h +++ b/src/plugins/qtsupport/uicgenerator.h @@ -4,26 +4,12 @@ #pragma once #include <projectexplorer/extracompiler.h> -#include <utils/fileutils.h> +#include <utils/filepath.h> namespace QtSupport { -class UicGenerator : public ProjectExplorer::ProcessExtraCompiler -{ - Q_OBJECT -public: - UicGenerator(const ProjectExplorer::Project *project, const Utils::FilePath &source, - const Utils::FilePaths &targets, QObject *parent = nullptr); - -protected: - Utils::FilePath command() const override; - QStringList arguments() const override; - ProjectExplorer::FileNameToContentsHash handleProcessFinished(Utils::Process *process) override; -}; - class UicGeneratorFactory : public ProjectExplorer::ExtraCompilerFactory { - Q_OBJECT public: UicGeneratorFactory() = default; From 8fcf3a695f677baa7374e8c9aadcaa518205befd Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Tue, 8 Aug 2023 11:46:12 +0200 Subject: [PATCH 0642/1777] DAP: Fix windows support - Added using named pipe for windows Change-Id: I45561481d63c5dd81bda14e6ace4fb0374d1b488 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/fileapireader.cpp | 12 +++++++++--- src/plugins/debugger/dap/dapengine.cpp | 8 ++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp index 8cc8fc572b1..b43c7d239ed 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.cpp +++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp @@ -98,9 +98,15 @@ void FileApiReader::parse(bool forceCMakeRun, + m_parameters.additionalCMakeArguments) : QStringList()); if (debugging) { - FilePath file = FilePath::fromString(TemporaryDirectory::masterDirectoryPath() + "/cmake-dap.sock"); - file.removeFile(); - args << "--debugger" << "--debugger-pipe=" + file.path(); + if (TemporaryDirectory::masterDirectoryFilePath().osType() == Utils::OsType::OsTypeWindows) { + args << "--debugger" + << "--debugger-pipe \\\\.\\pipe\\cmake-dap"; + } else { + FilePath file = TemporaryDirectory::masterDirectoryFilePath() / "cmake-dap.sock"; + file.removeFile(); + args << "--debugger" + << "--debugger-pipe=" + file.path(); + } } qCDebug(cmakeFileApiMode) << "Parameters request these CMake arguments:" << args; diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 6a8a0244dd0..2535e8daf7b 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -260,8 +260,12 @@ void DapEngine::setupEngine() if (currentPerspective->parentPerspectiveId() == Constants::CMAKE_PERSPECTIVE_ID) { qCDebug(dapEngineLog) << "build system name" << ProjectExplorer::ProjectTree::currentBuildSystem()->name(); - m_dataGenerator = std::make_unique<LocalSocketDataProvider>( - TemporaryDirectory::masterDirectoryPath() + "/cmake-dap.sock"); + if (TemporaryDirectory::masterDirectoryFilePath().osType() == Utils::OsType::OsTypeWindows) { + m_dataGenerator = std::make_unique<LocalSocketDataProvider>("\\\\.\\pipe\\cmake-dap"); + } else { + m_dataGenerator = std::make_unique<LocalSocketDataProvider>( + TemporaryDirectory::masterDirectoryPath() + "/cmake-dap.sock"); + } connectDataGeneratorSignals(); connect(ProjectExplorer::ProjectTree::currentBuildSystem(), From 1836b50f5da0cdfa82c171bd328ea6c29211c4cd Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Tue, 8 Aug 2023 15:37:39 +0200 Subject: [PATCH 0643/1777] DAP: Separate CMake and Gdb logic in DAP engine This commit refactors the Debug Adapter Protocol (DAP) engine to separate the logic for CMake-based projects and Gdb-based debugging. - Moved CMake-specific code to a new CMakeDAPEngine class - Moved Gdb-specific code to a new GdbDAPEngine class Change-Id: Ia616e7b7ea2ff2071bcadd26b28b620f9aca6ac4 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/CMakeLists.txt | 2 + src/plugins/debugger/dap/cmakedapengine.cpp | 118 +++++++++++++ src/plugins/debugger/dap/cmakedapengine.h | 20 +++ src/plugins/debugger/dap/dapengine.cpp | 181 +++----------------- src/plugins/debugger/dap/dapengine.h | 6 +- src/plugins/debugger/dap/gdbdapengine.cpp | 97 +++++++++++ src/plugins/debugger/dap/gdbdapengine.h | 19 ++ src/plugins/debugger/debuggerruncontrol.cpp | 4 +- 8 files changed, 287 insertions(+), 160 deletions(-) create mode 100644 src/plugins/debugger/dap/cmakedapengine.cpp create mode 100644 src/plugins/debugger/dap/cmakedapengine.h create mode 100644 src/plugins/debugger/dap/gdbdapengine.cpp create mode 100644 src/plugins/debugger/dap/gdbdapengine.h diff --git a/src/plugins/debugger/CMakeLists.txt b/src/plugins/debugger/CMakeLists.txt index 4280af0235c..08998caf3e2 100644 --- a/src/plugins/debugger/CMakeLists.txt +++ b/src/plugins/debugger/CMakeLists.txt @@ -27,7 +27,9 @@ add_qtc_plugin(Debugger console/consoleitemmodel.cpp console/consoleitemmodel.h console/consoleproxymodel.cpp console/consoleproxymodel.h console/consoleview.cpp console/consoleview.h + dap/cmakedapengine.cpp dap/cmakedapengine.h dap/dapengine.cpp dap/dapengine.h + dap/gdbdapengine.cpp dap/gdbdapengine.h debugger.qrc debugger_global.h debuggeractions.cpp debuggeractions.h diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp new file mode 100644 index 00000000000..d43646f408a --- /dev/null +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -0,0 +1,118 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 + +#include "cmakedapengine.h" + +#include <debugger/debuggermainwindow.h> + +#include <utils/temporarydirectory.h> + +#include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/buildsystem.h> +#include <projectexplorer/projecttree.h> + +#include <QDebug> +#include <QLocalSocket> +#include <QLoggingCategory> + +using namespace Core; +using namespace Utils; +static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg) + +namespace Debugger::Internal { + +class LocalSocketDataProvider : public IDataProvider +{ +public: + LocalSocketDataProvider(const QString &socketName) + : m_socketName(socketName) + { + connect(&m_socket, &QLocalSocket::connected, this, &IDataProvider::started); + connect(&m_socket, &QLocalSocket::disconnected, this, &IDataProvider::done); + connect(&m_socket, &QLocalSocket::readyRead, this, &IDataProvider::readyReadStandardOutput); + connect(&m_socket, + &QLocalSocket::errorOccurred, + this, + &IDataProvider::readyReadStandardError); + } + + ~LocalSocketDataProvider() { m_socket.disconnectFromServer(); } + + void start() override { m_socket.connectToServer(m_socketName, QIODevice::ReadWrite); } + + bool isRunning() const override { return m_socket.isOpen(); } + void writeRaw(const QByteArray &data) override { m_socket.write(data); } + void kill() override + { + if (m_socket.isOpen()) + m_socket.disconnectFromServer(); + else { + m_socket.abort(); + emit done(); + } + } + QByteArray readAllStandardOutput() override { return m_socket.readAll(); } + QString readAllStandardError() override { return QString(); } + int exitCode() const override { return 0; } + QString executable() const override { return m_socket.serverName(); } + + QProcess::ExitStatus exitStatus() const override { return QProcess::NormalExit; } + QProcess::ProcessError error() const override { return QProcess::UnknownError; } + Utils::ProcessResult result() const override { return ProcessResult::FinishedWithSuccess; } + QString exitMessage() const override { return QString(); }; + +private: + QLocalSocket m_socket; + const QString m_socketName; +}; + +CMakeDapEngine::CMakeDapEngine() + : DapEngine() +{ + setObjectName("CmakeDapEngine"); + setDebuggerName("CmakeDAP"); +} + +void CMakeDapEngine::handleDapStarted() +{ + QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); + + postDirectCommand({ + {"command", "initialize"}, + {"type", "request"}, + {"arguments", QJsonObject { + {"clientID", "QtCreator"}, // The ID of the client using this adapter. + {"clientName", "QtCreator"}, // The human-readable name of the client using this adapter. + {"adapterID", "cmake"}, + {"pathFormat", "path"} + }} + }); + + qCDebug(dapEngineLog) << "handleDapStarted"; +} + +void CMakeDapEngine::setupEngine() +{ + QTC_ASSERT(state() == EngineSetupRequested, qCDebug(dapEngineLog) << state()); + + qCDebug(dapEngineLog) << "build system name" + << ProjectExplorer::ProjectTree::currentBuildSystem()->name(); + + if (TemporaryDirectory::masterDirectoryFilePath().osType() == Utils::OsType::OsTypeWindows) { + m_dataGenerator = std::make_unique<LocalSocketDataProvider>("\\\\.\\pipe\\cmake-dap"); + } else { + m_dataGenerator = std::make_unique<LocalSocketDataProvider>( + TemporaryDirectory::masterDirectoryPath() + "/cmake-dap.sock"); + } + connectDataGeneratorSignals(); + + connect(ProjectExplorer::ProjectTree::currentBuildSystem(), + &ProjectExplorer::BuildSystem::debuggingStarted, + this, + [this] { m_dataGenerator->start(); }); + + ProjectExplorer::ProjectTree::currentBuildSystem()->requestDebugging(); + notifyEngineSetupOk(); +} + +} // namespace Debugger::Internal diff --git a/src/plugins/debugger/dap/cmakedapengine.h b/src/plugins/debugger/dap/cmakedapengine.h new file mode 100644 index 00000000000..59a536fee0c --- /dev/null +++ b/src/plugins/debugger/dap/cmakedapengine.h @@ -0,0 +1,20 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "dapengine.h" + +namespace Debugger::Internal { + +class CMakeDapEngine : public DapEngine +{ +public: + CMakeDapEngine(); + +private: + void handleDapStarted() override; + void setupEngine() override; +}; + +} // Debugger::Internal diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 2535e8daf7b..db4ef9da69e 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -2,6 +2,8 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "dapengine.h" +#include "cmakedapengine.h" +#include "gdbdapengine.h" #include <debugger/breakhandler.h> #include <debugger/debuggeractions.h> @@ -40,6 +42,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildsystem.h> #include <projectexplorer/projecttree.h> +#include <projectexplorer/projectexplorerconstants.h> #include <QDateTime> #include <QDebug> @@ -59,106 +62,8 @@ static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg) namespace Debugger::Internal { -class ProcessDataProvider : public IDataProvider -{ -public: - ProcessDataProvider(const DebuggerRunParameters &rp, const CommandLine &cmd) - : m_runParameters(rp) - , m_cmd(cmd) - { - connect(&m_proc, &Process::started, this, &IDataProvider::started); - connect(&m_proc, &Process::done, this, &IDataProvider::done); - connect(&m_proc, - &Process::readyReadStandardOutput, - this, - &IDataProvider::readyReadStandardOutput); - connect(&m_proc, - &Process::readyReadStandardError, - this, - &IDataProvider::readyReadStandardError); - } - - ~ProcessDataProvider() - { - m_proc.kill(); - m_proc.waitForFinished(); - } - - void start() override - { - m_proc.setProcessMode(ProcessMode::Writer); - m_proc.setEnvironment(m_runParameters.debugger.environment); - m_proc.setCommand(m_cmd); - m_proc.start(); - } - - bool isRunning() const override { return m_proc.isRunning(); } - void writeRaw(const QByteArray &data) override { m_proc.writeRaw(data); } - void kill() override { m_proc.kill(); } - QByteArray readAllStandardOutput() override { return m_proc.readAllStandardOutput().toUtf8(); } - QString readAllStandardError() override { return m_proc.readAllStandardError(); } - int exitCode() const override { return m_proc.exitCode(); } - QString executable() const override { return m_proc.commandLine().executable().toUserOutput(); } - - QProcess::ExitStatus exitStatus() const override { return m_proc.exitStatus(); } - QProcess::ProcessError error() const override { return m_proc.error(); } - Utils::ProcessResult result() const override { return m_proc.result(); } - QString exitMessage() const override { return m_proc.exitMessage(); }; - -private: - Utils::Process m_proc; - const DebuggerRunParameters m_runParameters; - const CommandLine m_cmd; -}; - -class LocalSocketDataProvider : public IDataProvider -{ -public: - LocalSocketDataProvider(const QString &socketName) - : m_socketName(socketName) - { - connect(&m_socket, &QLocalSocket::connected, this, &IDataProvider::started); - connect(&m_socket, &QLocalSocket::disconnected, this, &IDataProvider::done); - connect(&m_socket, &QLocalSocket::readyRead, this, &IDataProvider::readyReadStandardOutput); - connect(&m_socket, - &QLocalSocket::errorOccurred, - this, - &IDataProvider::readyReadStandardError); - } - - ~LocalSocketDataProvider() { m_socket.disconnectFromServer(); } - - void start() override { m_socket.connectToServer(m_socketName, QIODevice::ReadWrite); } - - bool isRunning() const override { return m_socket.isOpen(); } - void writeRaw(const QByteArray &data) override { m_socket.write(data); } - void kill() override { - if (m_socket.isOpen()) - m_socket.disconnectFromServer(); - else { - m_socket.abort(); - emit done(); - } - } - QByteArray readAllStandardOutput() override { return m_socket.readAll(); } - QString readAllStandardError() override { return QString(); } - int exitCode() const override { return 0; } - QString executable() const override { return m_socket.serverName(); } - - QProcess::ExitStatus exitStatus() const override { return QProcess::NormalExit; } - QProcess::ProcessError error() const override { return QProcess::UnknownError; } - Utils::ProcessResult result() const override { return ProcessResult::FinishedWithSuccess; } - QString exitMessage() const override { return QString(); }; - -private: - QLocalSocket m_socket; - const QString m_socketName; -}; - DapEngine::DapEngine() { - setObjectName("DapEngine"); - setDebuggerName("DAP"); m_rootWatchItem = new WatchItem(); m_currentWatchItem = m_rootWatchItem; } @@ -236,58 +141,6 @@ void DapEngine::shutdownEngine() m_dataGenerator->kill(); } -void DapEngine::setupEngine() -{ - QTC_ASSERT(state() == EngineSetupRequested, qCDebug(dapEngineLog) << state()); - - const auto connectDataGeneratorSignals = [this] { - if (!m_dataGenerator) - return; - - connect(m_dataGenerator.get(), &IDataProvider::started, this, &DapEngine::handleDapStarted); - connect(m_dataGenerator.get(), &IDataProvider::done, this, &DapEngine::handleDapDone); - connect(m_dataGenerator.get(), - &IDataProvider::readyReadStandardOutput, - this, - &DapEngine::readDapStandardOutput); - connect(m_dataGenerator.get(), - &IDataProvider::readyReadStandardError, - this, - &DapEngine::readDapStandardError); - }; - - Perspective *currentPerspective = DebuggerMainWindow::instance()->currentPerspective(); - if (currentPerspective->parentPerspectiveId() == Constants::CMAKE_PERSPECTIVE_ID) { - qCDebug(dapEngineLog) << "build system name" << ProjectExplorer::ProjectTree::currentBuildSystem()->name(); - - if (TemporaryDirectory::masterDirectoryFilePath().osType() == Utils::OsType::OsTypeWindows) { - m_dataGenerator = std::make_unique<LocalSocketDataProvider>("\\\\.\\pipe\\cmake-dap"); - } else { - m_dataGenerator = std::make_unique<LocalSocketDataProvider>( - TemporaryDirectory::masterDirectoryPath() + "/cmake-dap.sock"); - } - connectDataGeneratorSignals(); - - connect(ProjectExplorer::ProjectTree::currentBuildSystem(), - &ProjectExplorer::BuildSystem::debuggingStarted, - this, - [this] { - m_dataGenerator->start(); - }); - - ProjectExplorer::ProjectTree::currentBuildSystem()->requestDebugging(); - } else { - const DebuggerRunParameters &rp = runParameters(); - const CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}}; - - m_dataGenerator = std::make_unique<ProcessDataProvider>(rp, cmd); - connectDataGeneratorSignals(); - m_dataGenerator->start(); - - } - notifyEngineSetupOk(); -} - // From the docs: // The sequence of events/requests is as follows: // * adapters sends initialized event (after the initialize request has returned) @@ -310,9 +163,7 @@ void DapEngine::handleDapStarted() {"type", "request"}, {"arguments", QJsonObject { {"clientID", "QtCreator"}, // The ID of the client using this adapter. - {"clientName", "QtCreator"}, // The human-readable name of the client using this adapter. - {"adapterID", "cmake"}, - {"pathFormat", "path"} + {"clientName", "QtCreator"} // The human-readable name of the client using this adapter. }} }); @@ -1083,9 +934,29 @@ void DapEngine::claimInitialBreakpoints() qCDebug(dapEngineLog) << "claimInitialBreakpoints"; } -DebuggerEngine *createDapEngine() +void DapEngine::connectDataGeneratorSignals() { - return new DapEngine; + if (!m_dataGenerator) + return; + + connect(m_dataGenerator.get(), &IDataProvider::started, this, &DapEngine::handleDapStarted); + connect(m_dataGenerator.get(), &IDataProvider::done, this, &DapEngine::handleDapDone); + connect(m_dataGenerator.get(), + &IDataProvider::readyReadStandardOutput, + this, + &DapEngine::readDapStandardOutput); + connect(m_dataGenerator.get(), + &IDataProvider::readyReadStandardError, + this, + &DapEngine::readDapStandardError); +} + +DebuggerEngine *createDapEngine(Utils::Id runMode) +{ + if (runMode == ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE) + return new CMakeDapEngine; + + return new GdbDapEngine; } } // Debugger::Internal diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 5a0c34492f9..1950713f15d 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -50,12 +50,11 @@ class DapEngine : public DebuggerEngine public: DapEngine(); -private: +protected: void executeStepIn(bool) override; void executeStepOut() override; void executeStepOver(bool) override; - void setupEngine() override; void shutdownInferior() override; void shutdownEngine() override; @@ -106,7 +105,7 @@ private: void claimInitialBreakpoints(); - void handleDapStarted(); + virtual void handleDapStarted(); void handleDapLaunch(); void handleDapConfigurationDone(); @@ -122,6 +121,7 @@ private: void handleResponse(const QString &ba); void updateAll() override; void updateLocals() override; + void connectDataGeneratorSignals(); QByteArray m_inbuffer; std::unique_ptr<IDataProvider> m_dataGenerator = nullptr; diff --git a/src/plugins/debugger/dap/gdbdapengine.cpp b/src/plugins/debugger/dap/gdbdapengine.cpp new file mode 100644 index 00000000000..316a0c7d547 --- /dev/null +++ b/src/plugins/debugger/dap/gdbdapengine.cpp @@ -0,0 +1,97 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 + +#include "gdbdapengine.h" + +#include <debugger/debuggermainwindow.h> + +#include <utils/temporarydirectory.h> + +#include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/buildsystem.h> +#include <projectexplorer/projecttree.h> + +#include <QDebug> +#include <QLocalSocket> +#include <QLoggingCategory> + +using namespace Core; +using namespace Utils; +static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg) + +namespace Debugger::Internal { + +class ProcessDataProvider : public IDataProvider +{ +public: + ProcessDataProvider(const DebuggerRunParameters &rp, const CommandLine &cmd) + : m_runParameters(rp) + , m_cmd(cmd) + { + connect(&m_proc, &Process::started, this, &IDataProvider::started); + connect(&m_proc, &Process::done, this, &IDataProvider::done); + connect(&m_proc, + &Process::readyReadStandardOutput, + this, + &IDataProvider::readyReadStandardOutput); + connect(&m_proc, + &Process::readyReadStandardError, + this, + &IDataProvider::readyReadStandardError); + } + + ~ProcessDataProvider() + { + m_proc.kill(); + m_proc.waitForFinished(); + } + + void start() override + { + m_proc.setProcessMode(ProcessMode::Writer); + m_proc.setEnvironment(m_runParameters.debugger.environment); + m_proc.setCommand(m_cmd); + m_proc.start(); + } + + bool isRunning() const override { return m_proc.isRunning(); } + void writeRaw(const QByteArray &data) override { m_proc.writeRaw(data); } + void kill() override { m_proc.kill(); } + QByteArray readAllStandardOutput() override { return m_proc.readAllStandardOutput().toUtf8(); } + QString readAllStandardError() override { return m_proc.readAllStandardError(); } + int exitCode() const override { return m_proc.exitCode(); } + QString executable() const override { return m_proc.commandLine().executable().toUserOutput(); } + + QProcess::ExitStatus exitStatus() const override { return m_proc.exitStatus(); } + QProcess::ProcessError error() const override { return m_proc.error(); } + Utils::ProcessResult result() const override { return m_proc.result(); } + QString exitMessage() const override { return m_proc.exitMessage(); }; + +private: + Utils::Process m_proc; + const DebuggerRunParameters m_runParameters; + const CommandLine m_cmd; +}; + +GdbDapEngine::GdbDapEngine() + : DapEngine() +{ + setObjectName("GdbDapEngine"); + setDebuggerName("GdbDAP"); +} + +void GdbDapEngine::setupEngine() +{ + QTC_ASSERT(state() == EngineSetupRequested, qCDebug(dapEngineLog) << state()); + + const DebuggerRunParameters &rp = runParameters(); + const CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}}; + + m_dataGenerator = std::make_unique<ProcessDataProvider>(rp, cmd); + connectDataGeneratorSignals(); + m_dataGenerator->start(); + + notifyEngineSetupOk(); +} + +} // namespace Debugger::Internal diff --git a/src/plugins/debugger/dap/gdbdapengine.h b/src/plugins/debugger/dap/gdbdapengine.h new file mode 100644 index 00000000000..a968ab4a5ac --- /dev/null +++ b/src/plugins/debugger/dap/gdbdapengine.h @@ -0,0 +1,19 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "dapengine.h" + +namespace Debugger::Internal { + +class GdbDapEngine : public DapEngine +{ +public: + GdbDapEngine(); + +private: + void setupEngine() override; +}; + +} // Debugger::Internal diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 0a04eb61bcc..84c8837757f 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -70,7 +70,7 @@ DebuggerEngine *createPdbEngine(); DebuggerEngine *createQmlEngine(); DebuggerEngine *createLldbEngine(); DebuggerEngine *createUvscEngine(); -DebuggerEngine *createDapEngine(); +DebuggerEngine *createDapEngine(Utils::Id runMode = ProjectExplorer::Constants::NO_RUN_MODE); static QString noEngineMessage() { @@ -483,7 +483,7 @@ void DebuggerRunTool::start() if (!m_engine) { if (runControl()->runMode() == ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE) - m_engine = createDapEngine(); + m_engine = createDapEngine(runControl()->runMode()); else if (m_runParameters.isCppDebugging()) { switch (m_runParameters.cppEngineType) { case GdbEngineType: From bb6c26cac915b557356a99913eda631158252ac5 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 8 Aug 2023 15:15:28 +0200 Subject: [PATCH 0644/1777] QtSuppoer: De-O_OBJECT-ify QScxmlGenerator Change-Id: I2732aaf838144d6da4c0b51bdfc2c8bb6cc8e21b Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/qtsupport/qscxmlcgenerator.cpp | 91 +++++++++++++--------- src/plugins/qtsupport/qscxmlcgenerator.h | 28 +------ 2 files changed, 55 insertions(+), 64 deletions(-) diff --git a/src/plugins/qtsupport/qscxmlcgenerator.cpp b/src/plugins/qtsupport/qscxmlcgenerator.cpp index f3245bd9432..130ac8d9dd3 100644 --- a/src/plugins/qtsupport/qscxmlcgenerator.cpp +++ b/src/plugins/qtsupport/qscxmlcgenerator.cpp @@ -6,29 +6,62 @@ #include <qtsupport/baseqtversion.h> #include <qtsupport/qtkitinformation.h> #include <projectexplorer/target.h> + #include <utils/qtcassert.h> +#include <utils/temporarydirectory.h> #include <QDateTime> #include <QLoggingCategory> -#include <QUuid> using namespace ProjectExplorer; +using namespace Utils; namespace QtSupport { static QLoggingCategory log("qtc.qscxmlcgenerator", QtWarningMsg); -static const char TaskCategory[] = "Task.Category.ExtraCompiler.QScxmlc"; -QScxmlcGenerator::QScxmlcGenerator(const Project *project, - const Utils::FilePath &source, - const Utils::FilePaths &targets, QObject *parent) : - ProcessExtraCompiler(project, source, targets, parent), - m_tmpdir("qscxmlgenerator") +const char TaskCategory[] = "Task.Category.ExtraCompiler.QScxmlc"; + +class QScxmlcGenerator final : public ProcessExtraCompiler { - QTC_ASSERT(targets.count() == 2, return); - m_header = m_tmpdir.filePath(targets[0].fileName()).toString(); - m_impl = m_tmpdir.filePath(targets[1].fileName()).toString(); -} +public: + QScxmlcGenerator(const Project *project, const FilePath &source, + const FilePaths &targets, QObject *parent) + : ProcessExtraCompiler(project, source, targets, parent) + , m_tmpdir("qscxmlgenerator") + { + QTC_ASSERT(targets.count() == 2, return); + m_header = m_tmpdir.filePath(targets[0].fileName()).toString(); + QTC_ASSERT(!m_header.isEmpty(), return); + m_impl = m_tmpdir.filePath(targets[1].fileName()).toString(); + } + +private: + FilePath command() const override; + + QStringList arguments() const override + { + return {"--header", m_header, "--impl", m_impl, tmpFile().fileName()}; + } + + FilePath workingDirectory() const override + { + return m_tmpdir.path(); + } + + FilePath tmpFile() const + { + return workingDirectory().pathAppended(source().fileName()); + } + + FileNameToContentsHash handleProcessFinished(Process *process) override; + bool prepareToRun(const QByteArray &sourceContents) override; + Tasks parseIssues(const QByteArray &processStderr) override; + + TemporaryDirectory m_tmpdir; + QString m_header; + QString m_impl; +}; Tasks QScxmlcGenerator::parseIssues(const QByteArray &processStderr) { @@ -38,7 +71,7 @@ Tasks QScxmlcGenerator::parseIssues(const QByteArray &processStderr) QByteArrayList tokens = line.split(':'); if (tokens.length() > 4) { - Utils::FilePath file = Utils::FilePath::fromUtf8(tokens[0]); + FilePath file = FilePath::fromUtf8(tokens[0]); int line = tokens[1].toInt(); // int column = tokens[2].toInt(); <- nice, but not needed for now. Task::TaskType type = tokens[3].trimmed() == "error" ? @@ -50,8 +83,7 @@ Tasks QScxmlcGenerator::parseIssues(const QByteArray &processStderr) return issues; } - -Utils::FilePath QScxmlcGenerator::command() const +FilePath QScxmlcGenerator::command() const { QtSupport::QtVersion *version = nullptr; Target *target; @@ -66,21 +98,9 @@ Utils::FilePath QScxmlcGenerator::command() const return version->qscxmlcFilePath(); } -QStringList QScxmlcGenerator::arguments() const -{ - QTC_ASSERT(!m_header.isEmpty(), return {}); - - return {"--header", m_header, "--impl", m_impl, tmpFile().fileName()}; -} - -Utils::FilePath QScxmlcGenerator::workingDirectory() const -{ - return m_tmpdir.path(); -} - bool QScxmlcGenerator::prepareToRun(const QByteArray &sourceContents) { - const Utils::FilePath fn = tmpFile(); + const FilePath fn = tmpFile(); QFile input(fn.toString()); if (!input.open(QIODevice::WriteOnly)) return false; @@ -90,13 +110,13 @@ bool QScxmlcGenerator::prepareToRun(const QByteArray &sourceContents) return true; } -FileNameToContentsHash QScxmlcGenerator::handleProcessFinished(Utils::Process *process) +FileNameToContentsHash QScxmlcGenerator::handleProcessFinished(Process *process) { Q_UNUSED(process) - const Utils::FilePath wd = workingDirectory(); + const FilePath wd = workingDirectory(); FileNameToContentsHash result; - forEachTarget([&](const Utils::FilePath &target) { - const Utils::FilePath file = wd.pathAppended(target.fileName()); + forEachTarget([&](const FilePath &target) { + const FilePath file = wd.pathAppended(target.fileName()); QFile generated(file.toString()); if (!generated.open(QIODevice::ReadOnly)) return; @@ -105,11 +125,6 @@ FileNameToContentsHash QScxmlcGenerator::handleProcessFinished(Utils::Process *p return result; } -Utils::FilePath QScxmlcGenerator::tmpFile() const -{ - return workingDirectory().pathAppended(source().fileName()); -} - FileType QScxmlcGeneratorFactory::sourceType() const { return FileType::StateChart; @@ -121,8 +136,8 @@ QString QScxmlcGeneratorFactory::sourceTag() const } ExtraCompiler *QScxmlcGeneratorFactory::create( - const Project *project, const Utils::FilePath &source, - const Utils::FilePaths &targets) + const Project *project, const FilePath &source, + const FilePaths &targets) { return new QScxmlcGenerator(project, source, targets, this); } diff --git a/src/plugins/qtsupport/qscxmlcgenerator.h b/src/plugins/qtsupport/qscxmlcgenerator.h index 342db3cb096..9bfe8591033 100644 --- a/src/plugins/qtsupport/qscxmlcgenerator.h +++ b/src/plugins/qtsupport/qscxmlcgenerator.h @@ -4,37 +4,13 @@ #pragma once #include <projectexplorer/extracompiler.h> -#include <utils/fileutils.h> -#include <utils/temporarydirectory.h> + +#include <utils/filepath.h> namespace QtSupport { -class QScxmlcGenerator : public ProjectExplorer::ProcessExtraCompiler -{ - Q_OBJECT -public: - QScxmlcGenerator(const ProjectExplorer::Project *project, const Utils::FilePath &source, - const Utils::FilePaths &targets, QObject *parent = nullptr); - -protected: - Utils::FilePath command() const override; - QStringList arguments() const override; - Utils::FilePath workingDirectory() const override; - -private: - Utils::FilePath tmpFile() const; - ProjectExplorer::FileNameToContentsHash handleProcessFinished(Utils::Process *process) override; - bool prepareToRun(const QByteArray &sourceContents) override; - ProjectExplorer::Tasks parseIssues(const QByteArray &processStderr) override; - - Utils::TemporaryDirectory m_tmpdir; - QString m_header; - QString m_impl; -}; - class QScxmlcGeneratorFactory : public ProjectExplorer::ExtraCompilerFactory { - Q_OBJECT public: QScxmlcGeneratorFactory() = default; From 3970a834bcc0b158a577134b32cb9992c847cd1a Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 13:58:56 +0200 Subject: [PATCH 0645/1777] Valgrind: Replace global toolTipForFrame() with Frame::toolTip() Change-Id: I66cc481d588c468b9388e3b3863ed35aab406fa2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/valgrind/CMakeLists.txt | 1 - src/plugins/valgrind/valgrind.qbs | 1 - .../valgrind/xmlprotocol/errorlistmodel.cpp | 7 ++- src/plugins/valgrind/xmlprotocol/frame.cpp | 48 +++++++++++++++-- src/plugins/valgrind/xmlprotocol/frame.h | 8 +-- .../valgrind/xmlprotocol/modelhelpers.cpp | 53 ------------------- .../valgrind/xmlprotocol/modelhelpers.h | 20 ------- .../valgrind/xmlprotocol/stackmodel.cpp | 3 +- tests/auto/valgrind/valgrind.cmake | 1 - .../testdata/projecttree_creator.tsv | 4 -- .../testdata/projecttree_creator.tsv | 6 --- 11 files changed, 52 insertions(+), 100 deletions(-) delete mode 100644 src/plugins/valgrind/xmlprotocol/modelhelpers.cpp delete mode 100644 src/plugins/valgrind/xmlprotocol/modelhelpers.h diff --git a/src/plugins/valgrind/CMakeLists.txt b/src/plugins/valgrind/CMakeLists.txt index f3f1fce9bcb..df4c430ea00 100644 --- a/src/plugins/valgrind/CMakeLists.txt +++ b/src/plugins/valgrind/CMakeLists.txt @@ -34,7 +34,6 @@ add_qtc_plugin(Valgrind xmlprotocol/error.cpp xmlprotocol/error.h xmlprotocol/errorlistmodel.cpp xmlprotocol/errorlistmodel.h xmlprotocol/frame.cpp xmlprotocol/frame.h - xmlprotocol/modelhelpers.cpp xmlprotocol/modelhelpers.h xmlprotocol/parser.cpp xmlprotocol/parser.h xmlprotocol/stack.cpp xmlprotocol/stack.h xmlprotocol/stackmodel.cpp xmlprotocol/stackmodel.h diff --git a/src/plugins/valgrind/valgrind.qbs b/src/plugins/valgrind/valgrind.qbs index d5ca08f7806..378f0a57bb8 100644 --- a/src/plugins/valgrind/valgrind.qbs +++ b/src/plugins/valgrind/valgrind.qbs @@ -64,7 +64,6 @@ QtcPlugin { "error.cpp", "error.h", "errorlistmodel.cpp", "errorlistmodel.h", "frame.cpp", "frame.h", - "modelhelpers.cpp", "modelhelpers.h", "parser.cpp", "parser.h", "stack.cpp", "stack.h", "stackmodel.cpp", "stackmodel.h", diff --git a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp index aa5fa1c016a..96c1819b284 100644 --- a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp +++ b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp @@ -5,7 +5,6 @@ #include "error.h" #include "frame.h" #include "stack.h" -#include "modelhelpers.h" #include "../valgrindtr.h" #include <debugger/analyzer/diagnosticlocation.h> @@ -201,7 +200,7 @@ QVariant ErrorItem::data(int column, int role) const return Tr::tr("%1 in function %2") .arg(m_error.what(), m_error.stacks().constFirst().frames().constFirst().functionName()); case Qt::ToolTipRole: - return toolTipForFrame(m_model->findRelevantFrame(m_error)); + return m_model->findRelevantFrame(m_error).toolTip(); default: return QVariant(); } @@ -228,7 +227,7 @@ QVariant StackItem::data(int column, int role) const case Qt::DisplayRole: return m_stack.auxWhat().isEmpty() ? errorItem->error().what() : m_stack.auxWhat(); case Qt::ToolTipRole: - return toolTipForFrame(errorItem->modelPrivate()->findRelevantFrame(errorItem->error())); + return errorItem->modelPrivate()->findRelevantFrame(errorItem->error()).toolTip(); default: return QVariant(); } @@ -263,7 +262,7 @@ QVariant FrameItem::data(int column, int role) const .arg(makeFrameName(m_frame, false)); } case Qt::ToolTipRole: - return toolTipForFrame(m_frame); + return m_frame.toolTip(); default: return QVariant(); } diff --git a/src/plugins/valgrind/xmlprotocol/frame.cpp b/src/plugins/valgrind/xmlprotocol/frame.cpp index 17c8e951719..a7e157c8fd5 100644 --- a/src/plugins/valgrind/xmlprotocol/frame.cpp +++ b/src/plugins/valgrind/xmlprotocol/frame.cpp @@ -3,12 +3,15 @@ #include "frame.h" +#include "../valgrindtr.h" + +#include <QList> +#include <QPair> #include <QString> #include <algorithm> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class Frame::Private : public QSharedData { @@ -129,5 +132,42 @@ void Frame::setLine(int line) d->line = line; } -} // namespace XmlProtocol -} // namespace Valgrind +QString Frame::toolTip() const +{ + QString location; + if (!fileName().isEmpty()) { + location = filePath(); + if (line() > 0) + location += ':' + QString::number(line()); + } + + using StringPair = QPair<QString, QString>; + QList<StringPair> lines; + + if (!functionName().isEmpty()) + lines.append({Tr::tr("Function:"), functionName()}); + if (!location.isEmpty()) + lines.append({Tr::tr("Location:"), location}); + if (instructionPointer()) { + lines.append({Tr::tr("Instruction pointer:"), + QString("0x%1").arg(instructionPointer(), 0, 16)}); + } + if (!object().isEmpty()) + lines.append({Tr::tr("Object:"), object()}); + + QString html = "<html><head>" + "<style>dt { font-weight:bold; } dd { font-family: monospace; }</style>\n" + "</head><body><dl>"; + + for (const StringPair &pair : std::as_const(lines)) { + html += "<dt>"; + html += pair.first; + html += "</dt><dd>"; + html += pair.second; + html += "</dd>\n"; + } + html += "</dl></body></html>"; + return html; +} + +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/frame.h b/src/plugins/valgrind/xmlprotocol/frame.h index 727466e74d1..07c6e9c6576 100644 --- a/src/plugins/valgrind/xmlprotocol/frame.h +++ b/src/plugins/valgrind/xmlprotocol/frame.h @@ -5,8 +5,7 @@ #include <QSharedDataPointer> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class Frame { @@ -41,10 +40,11 @@ public: int line() const; void setLine(int line); + QString toolTip() const; + private: class Private; QSharedDataPointer<Private> d; }; -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/modelhelpers.cpp b/src/plugins/valgrind/xmlprotocol/modelhelpers.cpp deleted file mode 100644 index 9df22ef9a06..00000000000 --- a/src/plugins/valgrind/xmlprotocol/modelhelpers.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "modelhelpers.h" -#include "frame.h" -#include "../valgrindtr.h" - -#include <QString> -#include <QDir> -#include <QPair> - -namespace Valgrind { -namespace XmlProtocol { - -QString toolTipForFrame(const Frame &frame) -{ - QString location; - if (!frame.fileName().isEmpty()) { - location = frame.filePath(); - if (frame.line() > 0) - location += ':' + QString::number(frame.line()); - } - - using StringPair = QPair<QString, QString>; - QList<StringPair> lines; - - if (!frame.functionName().isEmpty()) - lines << qMakePair(Tr::tr("Function:"), frame.functionName()); - if (!location.isEmpty()) - lines << qMakePair(Tr::tr("Location:"), location); - if (frame.instructionPointer()) - lines << qMakePair(Tr::tr("Instruction pointer:"), - QString("0x%1").arg(frame.instructionPointer(), 0, 16)); - if (!frame.object().isEmpty()) - lines << qMakePair(Tr::tr("Object:"), frame.object()); - - QString html = "<html><head>" - "<style>dt { font-weight:bold; } dd { font-family: monospace; }</style>\n" - "</head><body><dl>"; - - for (const StringPair &pair : std::as_const(lines)) { - html += "<dt>"; - html += pair.first; - html += "</dt><dd>"; - html += pair.second; - html += "</dd>\n"; - } - html += "</dl></body></html>"; - return html; -} - -} // namespace XmlProtocol -} // namespace Valgrind diff --git a/src/plugins/valgrind/xmlprotocol/modelhelpers.h b/src/plugins/valgrind/xmlprotocol/modelhelpers.h deleted file mode 100644 index 000d57c4bf0..00000000000 --- a/src/plugins/valgrind/xmlprotocol/modelhelpers.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <QtGlobal> - -QT_BEGIN_NAMESPACE -class QString; -QT_END_NAMESPACE - -namespace Valgrind { -namespace XmlProtocol { - -class Frame; - -QString toolTipForFrame(const Frame &frame); - -} // namespace XmlProtocol -} // namespace Valgrind diff --git a/src/plugins/valgrind/xmlprotocol/stackmodel.cpp b/src/plugins/valgrind/xmlprotocol/stackmodel.cpp index 99ff1cacb25..535ceb38f9b 100644 --- a/src/plugins/valgrind/xmlprotocol/stackmodel.cpp +++ b/src/plugins/valgrind/xmlprotocol/stackmodel.cpp @@ -5,7 +5,6 @@ #include "error.h" #include "frame.h" #include "stack.h" -#include "modelhelpers.h" #include "../valgrindtr.h" #include <utils/qtcassert.h> @@ -106,7 +105,7 @@ QVariant StackModel::data(const QModelIndex &index, int role) const break; } case Qt::ToolTipRole: - return toolTipForFrame(frame); + return frame.toolTip(); case ObjectRole: return frame.object(); case FunctionNameRole: diff --git a/tests/auto/valgrind/valgrind.cmake b/tests/auto/valgrind/valgrind.cmake index fa7d8b4b60b..945e86fe09a 100644 --- a/tests/auto/valgrind/valgrind.cmake +++ b/tests/auto/valgrind/valgrind.cmake @@ -19,7 +19,6 @@ function(extend_valgrind_test targetName) xmlprotocol/error.h xmlprotocol/error.cpp xmlprotocol/errorlistmodel.h xmlprotocol/errorlistmodel.cpp xmlprotocol/frame.h xmlprotocol/frame.cpp - xmlprotocol/modelhelpers.h xmlprotocol/modelhelpers.cpp xmlprotocol/parser.h xmlprotocol/parser.cpp xmlprotocol/stack.h xmlprotocol/stack.cpp xmlprotocol/stackmodel.h xmlprotocol/stackmodel.cpp diff --git a/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv b/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv index 241ce7f8791..b9eb11f57d5 100644 --- a/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv +++ b/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv @@ -12738,8 +12738,6 @@ "errorlistmodel.h" "4" "frame.cpp" "4" "frame.h" "4" -"modelhelpers.cpp" "4" -"modelhelpers.h" "4" "parser.cpp" "4" "parser.h" "4" "stack.cpp" "4" @@ -14811,8 +14809,6 @@ "errorlistmodel.h" "6" "frame.cpp" "6" "frame.h" "6" -"modelhelpers.cpp" "6" -"modelhelpers.h" "6" "parser.cpp" "6" "parser.h" "6" "stack.cpp" "6" diff --git a/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv b/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv index 662eb4fe255..adf91e771ab 100644 --- a/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv +++ b/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv @@ -15805,7 +15805,6 @@ "error.h" "5" "errorlistmodel.h" "5" "frame.h" "5" -"modelhelpers.h" "5" "parser.h" "5" "stack.h" "5" "stackmodel.h" "5" @@ -15817,7 +15816,6 @@ "error.cpp" "5" "errorlistmodel.cpp" "5" "frame.cpp" "5" -"modelhelpers.cpp" "5" "parser.cpp" "5" "stack.cpp" "5" "stackmodel.cpp" "5" @@ -20145,7 +20143,6 @@ "error.h" "8" "errorlistmodel.h" "8" "frame.h" "8" -"modelhelpers.h" "8" "parser.h" "8" "stack.h" "8" "stackmodel.h" "8" @@ -20172,7 +20169,6 @@ "error.cpp" "8" "errorlistmodel.cpp" "8" "frame.cpp" "8" -"modelhelpers.cpp" "8" "parser.cpp" "8" "stack.cpp" "8" "stackmodel.cpp" "8" @@ -20258,7 +20254,6 @@ "error.h" "8" "errorlistmodel.h" "8" "frame.h" "8" -"modelhelpers.h" "8" "parser.h" "8" "stack.h" "8" "stackmodel.h" "8" @@ -20285,7 +20280,6 @@ "error.cpp" "8" "errorlistmodel.cpp" "8" "frame.cpp" "8" -"modelhelpers.cpp" "8" "parser.cpp" "8" "stack.cpp" "8" "stackmodel.cpp" "8" From 0a320185dcf3511ed468f90a21d3e7ca96944678 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 17:03:08 +0200 Subject: [PATCH 0646/1777] Valgrind: Merge parsers' finished() and internalError() signals Replace them with done() signal. Change-Id: I5f03df927ddefd803d9cb0b06d3f4c1601a15381 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/memchecktool.cpp | 12 ++++++------ src/plugins/valgrind/valgrindrunner.cpp | 5 ++++- src/plugins/valgrind/xmlprotocol/parser.cpp | 16 +++++++--------- src/plugins/valgrind/xmlprotocol/parser.h | 3 +-- .../valgrind/xmlprotocol/threadedparser.cpp | 4 +--- .../valgrind/xmlprotocol/threadedparser.h | 3 +-- 6 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 4a353f7e908..89cf1b0351b 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -1058,12 +1058,12 @@ void MemcheckToolPrivate::loadXmlLogFile(const QString &filePath) auto parser = new ThreadedParser; connect(parser, &ThreadedParser::error, this, &MemcheckToolPrivate::parserError); - connect(parser, &ThreadedParser::internalError, - this, &MemcheckToolPrivate::internalParserError); - connect(parser, &ThreadedParser::finished, - this, &MemcheckToolPrivate::loadingExternalXmlLogFileFinished); - connect(parser, &ThreadedParser::finished, - parser, &ThreadedParser::deleteLater); + connect(parser, &ThreadedParser::done, this, [this, parser](bool success, const QString &err) { + if (!success) + internalParserError(err); + loadingExternalXmlLogFileFinished(); + parser->deleteLater(); + }); parser->parse(logFile); // ThreadedParser owns the file } diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index 804167b7bce..bfbf168faae 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -162,7 +162,10 @@ ValgrindRunner::ValgrindRunner(QObject *parent) { connect(&d->m_parser, &ThreadedParser::status, this, &ValgrindRunner::status); connect(&d->m_parser, &ThreadedParser::error, this, &ValgrindRunner::error); - connect(&d->m_parser, &ThreadedParser::internalError, this, &ValgrindRunner::internalError); + connect(&d->m_parser, &ThreadedParser::done, this, [this](bool success, const QString &err) { + if (!success) + emit internalError(err); + }); } ValgrindRunner::~ValgrindRunner() diff --git a/src/plugins/valgrind/xmlprotocol/parser.cpp b/src/plugins/valgrind/xmlprotocol/parser.cpp index b3e6a41c0b9..790a383d69c 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.cpp +++ b/src/plugins/valgrind/xmlprotocol/parser.cpp @@ -318,12 +318,6 @@ static Status::State parseState(const QString &state) throw ParserException(Tr::tr("Unknown state \"%1\"").arg(state)); } -void Parser::Private::reportInternalError(const QString &e) -{ - errorString = e; - emit q->internalError(e); -} - static Stack makeStack(const XauxWhat &xauxwhat, const QList<Frame> &frames) { Stack s; @@ -618,7 +612,9 @@ void Parser::Private::parse(QIODevice *device) { QTC_ASSERT(device, return); reader.setDevice(device); + errorString.clear(); + bool success = true; try { while (notAtEnd()) { blockingReadNext(); @@ -639,11 +635,13 @@ void Parser::Private::parse(QIODevice *device) checkTool(blockingReadElementText()); } } catch (const ParserException &e) { - reportInternalError(e.message()); + errorString = e.message(); + success = false; } catch (...) { - reportInternalError(Tr::tr("Unexpected exception caught during parsing.")); + errorString = Tr::tr("Unexpected exception caught during parsing."); + success = false; } - emit q->finished(); + emit q->done(success, errorString); } Parser::Parser(QObject *parent) diff --git a/src/plugins/valgrind/xmlprotocol/parser.h b/src/plugins/valgrind/xmlprotocol/parser.h index 069696cba64..b38d9058953 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.h +++ b/src/plugins/valgrind/xmlprotocol/parser.h @@ -33,11 +33,10 @@ public: signals: void status(const Valgrind::XmlProtocol::Status &status); void error(const Valgrind::XmlProtocol::Error &error); - void internalError(const QString &errorString); void errorCount(qint64 unique, qint64 count); void suppressionCount(const QString &name, qint64 count); void announceThread(const Valgrind::XmlProtocol::AnnounceThread &announceThread); - void finished(); + void done(bool success, const QString &errorString); private: class Private; diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp index d7385e60943..af38da7bcfe 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp @@ -50,9 +50,7 @@ void ThreadedParser::parse(QIODevice *device) qRegisterMetaType<Error>(); connect(parser, &Parser::status, this, &ThreadedParser::status, Qt::QueuedConnection); connect(parser, &Parser::error, this, &ThreadedParser::error, Qt::QueuedConnection); - connect(parser, &Parser::internalError, this, &ThreadedParser::internalError, - Qt::QueuedConnection); - connect(parser, &Parser::finished, this, &ThreadedParser::finished, Qt::QueuedConnection); + connect(parser, &Parser::done, this, &ThreadedParser::done, Qt::QueuedConnection); m_parserThread = new Thread; connect(m_parserThread.get(), &QThread::finished, m_parserThread.get(), &QObject::deleteLater); diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.h b/src/plugins/valgrind/xmlprotocol/threadedparser.h index c88abf3fe68..8def97f00c5 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.h +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.h @@ -37,8 +37,7 @@ public: signals: void status(const Status &status); void error(const Error &error); - void internalError(const QString &errorString); - void finished(); + void done(bool success, const QString &errorString); private: QPointer<Thread> m_parserThread; From f573af5f69a05159ae3a20f05c487e76488494e9 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 18:18:25 +0200 Subject: [PATCH 0647/1777] Valgrind: Split parse() into setIODevice() and start() Make the API more TaskTree friendly. Change-Id: I5119e38b5fc3cce234395fc5db5c73cf0c474ac0 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/memchecktool.cpp | 3 ++- src/plugins/valgrind/valgrindrunner.cpp | 3 ++- .../valgrind/xmlprotocol/threadedparser.cpp | 16 ++++++++++++---- .../valgrind/xmlprotocol/threadedparser.h | 5 ++++- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 89cf1b0351b..92de06ed6a3 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -1065,7 +1065,8 @@ void MemcheckToolPrivate::loadXmlLogFile(const QString &filePath) parser->deleteLater(); }); - parser->parse(logFile); // ThreadedParser owns the file + parser->setIODevice(logFile); + parser->start(); } void MemcheckToolPrivate::parserError(const Error &error) diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index bfbf168faae..196fba7d7b0 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -68,7 +68,8 @@ void ValgrindRunner::Private::xmlSocketConnected() QTcpSocket *socket = m_xmlServer.nextPendingConnection(); QTC_ASSERT(socket, return); m_xmlServer.close(); - m_parser.parse(socket); + m_parser.setIODevice(socket); + m_parser.start(); } void ValgrindRunner::Private::logSocketConnected() diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp index af38da7bcfe..561535a6292 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp @@ -41,9 +41,17 @@ bool ThreadedParser::isRunning() const return m_parserThread ? m_parserThread->isRunning() : false; } -void ThreadedParser::parse(QIODevice *device) +void ThreadedParser::setIODevice(QIODevice *device) +{ + QTC_ASSERT(device, return); + QTC_ASSERT(device->isOpen(), return); + m_device.reset(device); +} + +void ThreadedParser::start() { QTC_ASSERT(!m_parserThread, return); + QTC_ASSERT(m_device, return); auto parser = new Parser; qRegisterMetaType<Status>(); @@ -54,10 +62,10 @@ void ThreadedParser::parse(QIODevice *device) m_parserThread = new Thread; connect(m_parserThread.get(), &QThread::finished, m_parserThread.get(), &QObject::deleteLater); - device->setParent(nullptr); - device->moveToThread(m_parserThread); + m_device->setParent(nullptr); + m_device->moveToThread(m_parserThread); parser->moveToThread(m_parserThread); - m_parserThread->m_device = device; + m_parserThread->m_device = m_device.release(); m_parserThread->m_parser = parser; m_parserThread->start(); } diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.h b/src/plugins/valgrind/xmlprotocol/threadedparser.h index 8def97f00c5..51d3fb4cfd8 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.h +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.h @@ -31,8 +31,10 @@ public: bool waitForFinished(); bool isRunning() const; + // The passed device needs to be open. The parser takes ownership of the passed device. + void setIODevice(QIODevice *device); ///@warning will move @p stream to a different thread and take ownership of it - void parse(QIODevice *stream); + void start(); signals: void status(const Status &status); @@ -40,6 +42,7 @@ signals: void done(bool success, const QString &errorString); private: + std::unique_ptr<QIODevice> m_device; QPointer<Thread> m_parserThread; }; From 130f92c4d9da4f508e302a85435fe56745baee45 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 8 Aug 2023 16:37:58 +0200 Subject: [PATCH 0648/1777] VcsBase: Remove a few now unnecessary Q_OBJECT uses Change-Id: I41d50e437b3bcfb964d2ef27541ea6a55855ec2f Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/vcsbase/diffandloghighlighter.h | 2 -- src/plugins/vcsbase/nicknamedialog.h | 2 -- src/plugins/vcsbase/vcsbaseclient.h | 2 -- src/plugins/vcsbase/vcsbasediffeditorcontroller.h | 2 -- src/plugins/vcsbase/vcsbaseeditor.h | 1 + src/plugins/vcsbase/vcsoutputformatter.h | 1 - src/plugins/vcsbase/wizard/vcscommandpage.h | 2 -- src/plugins/vcsbase/wizard/vcsconfigurationpage.h | 2 -- 8 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/plugins/vcsbase/diffandloghighlighter.h b/src/plugins/vcsbase/diffandloghighlighter.h index 85750960426..6318de941f3 100644 --- a/src/plugins/vcsbase/diffandloghighlighter.h +++ b/src/plugins/vcsbase/diffandloghighlighter.h @@ -17,8 +17,6 @@ class DiffAndLogHighlighterPrivate; class VCSBASE_EXPORT DiffAndLogHighlighter : public TextEditor::SyntaxHighlighter { - Q_OBJECT - public: explicit DiffAndLogHighlighter(const QRegularExpression &filePattern, const QRegularExpression &changePattern); diff --git a/src/plugins/vcsbase/nicknamedialog.h b/src/plugins/vcsbase/nicknamedialog.h index 481633fe16d..9fc0c3d4fa2 100644 --- a/src/plugins/vcsbase/nicknamedialog.h +++ b/src/plugins/vcsbase/nicknamedialog.h @@ -22,8 +22,6 @@ namespace VcsBase::Internal { class NickNameDialog : public QDialog { - Q_OBJECT - public: explicit NickNameDialog(QStandardItemModel *model, QWidget *parent = nullptr); ~NickNameDialog() override; diff --git a/src/plugins/vcsbase/vcsbaseclient.h b/src/plugins/vcsbase/vcsbaseclient.h index 1c22fbf968e..ee578a7cd79 100644 --- a/src/plugins/vcsbase/vcsbaseclient.h +++ b/src/plugins/vcsbase/vcsbaseclient.h @@ -38,8 +38,6 @@ using CommandHandler = std::function<void(const CommandResult &)>; class VCSBASE_EXPORT VcsBaseClientImpl : public QObject { - Q_OBJECT - public: explicit VcsBaseClientImpl(VcsBaseSettings *baseSettings); ~VcsBaseClientImpl() override = default; diff --git a/src/plugins/vcsbase/vcsbasediffeditorcontroller.h b/src/plugins/vcsbase/vcsbasediffeditorcontroller.h index 9c9b8fd7513..2cd2ece26c8 100644 --- a/src/plugins/vcsbase/vcsbasediffeditorcontroller.h +++ b/src/plugins/vcsbase/vcsbasediffeditorcontroller.h @@ -18,8 +18,6 @@ class VcsBaseDiffEditorControllerPrivate; class VCSBASE_EXPORT VcsBaseDiffEditorController : public DiffEditor::DiffEditorController { - Q_OBJECT - public: explicit VcsBaseDiffEditorController(Core::IDocument *document); ~VcsBaseDiffEditorController() override; diff --git a/src/plugins/vcsbase/vcsbaseeditor.h b/src/plugins/vcsbase/vcsbaseeditor.h index 81028f3b709..1b588b3e6e7 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.h +++ b/src/plugins/vcsbase/vcsbaseeditor.h @@ -60,6 +60,7 @@ public: class VCSBASE_EXPORT VcsBaseEditor : public TextEditor::BaseTextEditor { Q_OBJECT + public: VcsBaseEditor(); diff --git a/src/plugins/vcsbase/vcsoutputformatter.h b/src/plugins/vcsbase/vcsoutputformatter.h index a7c25fbacea..d12561d3758 100644 --- a/src/plugins/vcsbase/vcsoutputformatter.h +++ b/src/plugins/vcsbase/vcsoutputformatter.h @@ -14,7 +14,6 @@ namespace VcsBase { class VcsOutputLineParser : public Utils::OutputLineParser { - Q_OBJECT public: VcsOutputLineParser(); void fillLinkContextMenu(QMenu *menu, const Utils::FilePath &workingDirectory, const QString &href); diff --git a/src/plugins/vcsbase/wizard/vcscommandpage.h b/src/plugins/vcsbase/wizard/vcscommandpage.h index c36e3a76c19..20524184835 100644 --- a/src/plugins/vcsbase/wizard/vcscommandpage.h +++ b/src/plugins/vcsbase/wizard/vcscommandpage.h @@ -33,8 +33,6 @@ public: class VcsCommandPage : public Utils::WizardPage { - Q_OBJECT - public: VcsCommandPage(); ~VcsCommandPage() override; diff --git a/src/plugins/vcsbase/wizard/vcsconfigurationpage.h b/src/plugins/vcsbase/wizard/vcsconfigurationpage.h index d36f4934346..ceceb515079 100644 --- a/src/plugins/vcsbase/wizard/vcsconfigurationpage.h +++ b/src/plugins/vcsbase/wizard/vcsconfigurationpage.h @@ -30,8 +30,6 @@ public: class VCSBASE_EXPORT VcsConfigurationPage : public Utils::WizardPage { - Q_OBJECT - public: VcsConfigurationPage(); ~VcsConfigurationPage() override; From 5a9cc840d548f1d2042067656f87b7a21f856734 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 8 Aug 2023 18:18:02 +0200 Subject: [PATCH 0649/1777] Perforce: Allow delay-created settings ... in theory. The first argument of the connect() call in perforceplugin.cpp:555 currently spoils the fun. Change-Id: I041c7707264d8ba64098c37f8fbb5ee4ea1e1753 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/perforce/perforceplugin.cpp | 97 +++++++++++------------ src/plugins/perforce/perforcesettings.cpp | 26 ++++-- src/plugins/perforce/perforcesettings.h | 6 +- 3 files changed, 67 insertions(+), 62 deletions(-) diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 64ad692c889..f477144e153 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -340,9 +340,6 @@ public: mutable QString m_tempFilePattern; QAction *m_menuAction = nullptr; - PerforceSettings m_settings; - PerforceSettingsPage m_settingsPage{&m_settings}; - ManagedDirectoryCache m_managedDirectoryCache; VcsSubmitEditorFactory submitEditorFactory { @@ -379,8 +376,6 @@ PerforcePluginPrivate::PerforcePluginPrivate() dd = this; - m_settings.readSettings(); - const QString prefix = QLatin1String("p4"); m_commandLocator = new CommandLocator("Perforce", prefix, prefix, this); m_commandLocator->setDescription(Tr::tr("Triggers a Perforce version control operation.")); @@ -556,8 +551,8 @@ PerforcePluginPrivate::PerforcePluginPrivate() connect(m_filelogAction, &QAction::triggered, this, &PerforcePluginPrivate::filelogFile); perforceContainer->addAction(command); - QObject::connect(&m_settings, &AspectContainer::applied, this, [this] { - m_settings.clearTopLevel(); + QObject::connect(&settings(), &AspectContainer::applied, this, [this] { + settings().clearTopLevel(); applySettings(); }); } @@ -633,7 +628,7 @@ void PerforcePluginPrivate::diffCurrentProject() void PerforcePluginPrivate::diffAllOpened() { - p4Diff(m_settings.topLevel(), QStringList()); + p4Diff(settings().topLevel(), QStringList()); } void PerforcePluginPrivate::updateCurrentProject() @@ -645,7 +640,7 @@ void PerforcePluginPrivate::updateCurrentProject() void PerforcePluginPrivate::updateAll() { - updateCheckout(m_settings.topLevel()); + updateCheckout(settings().topLevel()); } void PerforcePluginPrivate::revertCurrentProject() @@ -695,7 +690,7 @@ void PerforcePluginPrivate::updateCheckout(const FilePath &workingDir, const QSt void PerforcePluginPrivate::printOpenedFileList() { - const PerforceResponse perforceResponse = runP4Cmd(m_settings.topLevel(), {"opened"}, + const PerforceResponse perforceResponse = runP4Cmd(settings().topLevel(), {"opened"}, CommandToWindow|StdErrToWindow|ErrorToWindow); if (perforceResponse.error || perforceResponse.stdOut.isEmpty()) return; @@ -791,7 +786,7 @@ IEditor *PerforcePluginPrivate::openPerforceSubmitEditor(const QString &fileName submitEditor->restrictToProjectFiles(depotFileNames); connect(submitEditor, &VcsBaseSubmitEditor::diffSelectedFiles, this, &PerforcePluginPrivate::slotSubmitDiff); - submitEditor->setCheckScriptWorkingDirectory(m_settings.topLevel()); + submitEditor->setCheckScriptWorkingDirectory(settings().topLevel()); return editor; } @@ -804,7 +799,7 @@ void PerforcePluginPrivate::printPendingChanges() const int i = dia.changeNumber(); QStringList args(QLatin1String("submit")); args << QLatin1String("-c") << QString::number(i); - runP4Cmd(m_settings.topLevel(), args, + runP4Cmd(settings().topLevel(), args, CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow); } } @@ -893,8 +888,8 @@ void PerforcePluginPrivate::filelog(const FilePath &workingDir, const QString &f QTextCodec *codec = VcsBaseEditor::getCodec(workingDir, QStringList(fileName)); QStringList args; args << QLatin1String("filelog") << QLatin1String("-li"); - if (m_settings.logCount() > 0) - args << "-m" << QString::number(m_settings.logCount()); + if (settings().logCount() > 0) + args << "-m" << QString::number(settings().logCount()); if (!fileName.isEmpty()) args.append(fileName); const PerforceResponse result = runP4Cmd(workingDir, args, @@ -915,8 +910,8 @@ void PerforcePluginPrivate::changelists(const FilePath &workingDir, const QStrin QTextCodec *codec = VcsBaseEditor::getCodec(workingDir, QStringList(fileName)); QStringList args; args << QLatin1String("changelists") << QLatin1String("-lit"); - if (m_settings.logCount() > 0) - args << "-m" << QString::number(m_settings.logCount()); + if (settings().logCount() > 0) + args << "-m" << QString::number(settings().logCount()); if (!fileName.isEmpty()) args.append(fileName); const PerforceResponse result = runP4Cmd(workingDir, args, @@ -961,7 +956,7 @@ bool PerforcePluginPrivate::managesDirectory(const FilePath &directory, FilePath const bool rc = const_cast<PerforcePluginPrivate *>(this)->managesDirectoryFstat(directory); if (topLevel) { if (rc) - *topLevel = m_settings.topLevelSymLinkTarget(); + *topLevel = settings().topLevelSymLinkTarget(); else topLevel->clear(); } @@ -985,20 +980,20 @@ bool PerforcePluginPrivate::managesDirectoryFstat(const FilePath &directory) setTopLevel(entry.m_topLevel); return entry.m_isManaged; } - if (!m_settings.isValid()) { - if (m_settings.topLevel().isEmpty()) + if (!settings().isValid()) { + if (settings().topLevel().isEmpty()) getTopLevel(directory, true); - if (!m_settings.isValid()) + if (!settings().isValid()) return false; } // Determine value and insert into cache bool managed = false; do { // Quick check: Must be at or below top level and not "../../other_path" - const QString relativeDirArgs = m_settings.relativeToTopLevelArguments(directory.toString()); + const QString relativeDirArgs = settings().relativeToTopLevelArguments(directory.toString()); if (!relativeDirArgs.isEmpty() && relativeDirArgs.startsWith(QLatin1String(".."))) { - if (!m_settings.defaultEnv()) + if (!settings().defaultEnv()) break; else getTopLevel(directory, true); @@ -1006,14 +1001,14 @@ bool PerforcePluginPrivate::managesDirectoryFstat(const FilePath &directory) // Is it actually managed by perforce? QStringList args; args << QLatin1String("fstat") << QLatin1String("-m1") << perforceRelativeFileArguments(relativeDirArgs); - const PerforceResponse result = runP4Cmd(m_settings.topLevel(), args, + const PerforceResponse result = runP4Cmd(settings().topLevel(), args, RunFullySynchronous); managed = result.stdOut.contains(QLatin1String("depotFile")) || result.stdErr.contains(QLatin1String("... - no such file(s)")); } while (false); - m_managedDirectoryCache.insert(directory, DirectoryCacheEntry(managed, m_settings.topLevel())); + m_managedDirectoryCache.insert(directory, DirectoryCacheEntry(managed, settings().topLevel())); return managed; } @@ -1117,7 +1112,7 @@ bool PerforcePluginPrivate::isVcsFileOrDirectory(const FilePath &filePath) const bool PerforcePluginPrivate::isConfigured() const { - const FilePath binary = m_settings.p4BinaryPath(); + const FilePath binary = settings().p4BinaryPath(); return !binary.isEmpty() && binary.isExecutableFile(); } @@ -1152,7 +1147,7 @@ bool PerforcePluginPrivate::vcsOpen(const FilePath &filePath) IVersionControl::SettingsFlags PerforcePluginPrivate::settingsFlags() const { SettingsFlags rc; - if (m_settings.autoOpen()) + if (settings().autoOpen()) rc |= AutoOpen; return rc; } @@ -1228,7 +1223,7 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki // Run, connect stderr to the output window Process process; - const int timeOutS = (flags & LongTimeOut) ? m_settings.longTimeOutS() : m_settings.timeOutS(); + const int timeOutS = (flags & LongTimeOut) ? settings().longTimeOutS() : settings().timeOutS(); process.setTimeoutS(timeOutS); if (outputCodec) process.setCodec(outputCodec); @@ -1249,7 +1244,7 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki process.setStdOutCallback([](const QString &lines) { VcsOutputWindow::append(lines); }); } process.setTimeOutMessageBoxEnabled(true); - process.setCommand({m_settings.p4BinaryPath(), args}); + process.setCommand({settings().p4BinaryPath(), args}); process.runBlocking(EventLoopMode::On); PerforceResponse response; @@ -1269,7 +1264,7 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki response.message = msgCrash(); break; case ProcessResult::StartFailed: - response.message = msgNotStarted(m_settings.p4BinaryPath()); + response.message = msgNotStarted(settings().p4BinaryPath()); break; case ProcessResult::Hang: response.message = msgCrash(); @@ -1293,19 +1288,19 @@ PerforceResponse PerforcePluginPrivate::fullySynchronousProcess(const FilePath & process.setWorkingDirectory(workingDir); PerforceResponse response; - process.setCommand({m_settings.p4BinaryPath(), args}); + process.setCommand({settings().p4BinaryPath(), args}); process.setWriteData(stdInput); process.start(); if (!process.waitForStarted(3000)) { response.error = true; - response.message = msgNotStarted(m_settings.p4BinaryPath()); + response.message = msgNotStarted(settings().p4BinaryPath()); return response; } QByteArray stdOut; QByteArray stdErr; - const int timeOutS = (flags & LongTimeOut) ? m_settings.longTimeOutS() : m_settings.timeOutS(); + const int timeOutS = (flags & LongTimeOut) ? settings().longTimeOutS() : settings().timeOutS(); if (!process.readDataFromProcess(&stdOut, &stdErr, timeOutS)) { process.stop(); process.waitForFinished(); @@ -1341,14 +1336,14 @@ PerforceResponse PerforcePluginPrivate::runP4Cmd(const FilePath &workingDir, const QByteArray &stdInput, QTextCodec *outputCodec) const { - if (!m_settings.isValid()) { + if (!settings().isValid()) { PerforceResponse invalidConfigResponse; invalidConfigResponse.error = true; invalidConfigResponse.message = Tr::tr("Perforce is not correctly configured."); VcsOutputWindow::appendError(invalidConfigResponse.message); return invalidConfigResponse; } - QStringList actualArgs = m_settings.commonP4Arguments(workingDir.toString()); + QStringList actualArgs = settings().commonP4Arguments(workingDir.toString()); QString errorMessage; QSharedPointer<TempFileSaver> tempFile = createTemporaryArgumentFile(extraArgs, &errorMessage); if (!tempFile.isNull()) { @@ -1362,7 +1357,7 @@ PerforceResponse PerforcePluginPrivate::runP4Cmd(const FilePath &workingDir, actualArgs.append(args); if (flags & CommandToWindow) - VcsOutputWindow::appendCommand(workingDir, {m_settings.p4BinaryPath(), actualArgs}); + VcsOutputWindow::appendCommand(workingDir, {settings().p4BinaryPath(), actualArgs}); if (flags & ShowBusyCursor) QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); @@ -1410,7 +1405,7 @@ IEditor *PerforcePluginPrivate::showOutputInEditor(const QString &title, void PerforcePluginPrivate::slotSubmitDiff(const QStringList &files) { - p4Diff(m_settings.topLevel(), files); + p4Diff(settings().topLevel(), files); } // Parameter widget controlling whitespace diff mode, associated with a parameter @@ -1525,7 +1520,7 @@ void PerforcePluginPrivate::vcsDescribe(const FilePath &source, const QString &n : VcsBaseEditor::getCodec(source); QStringList args; args << QLatin1String("describe") << QLatin1String("-du") << n; - const PerforceResponse result = runP4Cmd(m_settings.topLevel(), args, CommandToWindow|StdErrToWindow|ErrorToWindow, + const PerforceResponse result = runP4Cmd(settings().topLevel(), args, CommandToWindow|StdErrToWindow|ErrorToWindow, {}, {}, codec); if (!result.error) showOutputInEditor(Tr::tr("p4 describe %1").arg(n), result.stdOut, diffEditorParameters.id, source, codec); @@ -1565,7 +1560,7 @@ bool PerforcePluginPrivate::activateCommit() QStringList submitArgs; submitArgs << QLatin1String("submit") << QLatin1String("-i"); - const PerforceResponse submitResponse = runP4Cmd(m_settings.topLevelSymLinkTarget(), submitArgs, + const PerforceResponse submitResponse = runP4Cmd(settings().topLevelSymLinkTarget(), submitArgs, LongTimeOut|RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow|ShowBusyCursor, {}, reader.data()); if (submitResponse.error) { @@ -1582,11 +1577,11 @@ bool PerforcePluginPrivate::activateCommit() QString PerforcePluginPrivate::clientFilePath(const QString &serverFilePath) { - QTC_ASSERT(m_settings.isValid(), return QString()); + QTC_ASSERT(settings().isValid(), return QString()); QStringList args; args << QLatin1String("fstat") << serverFilePath; - const PerforceResponse response = runP4Cmd(m_settings.topLevelSymLinkTarget(), args, + const PerforceResponse response = runP4Cmd(settings().topLevelSymLinkTarget(), args, ShowBusyCursor|RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow); if (response.error) return {}; @@ -1598,10 +1593,10 @@ QString PerforcePluginPrivate::clientFilePath(const QString &serverFilePath) QString PerforcePluginPrivate::pendingChangesData() { - QTC_ASSERT(m_settings.isValid(), return QString()); + QTC_ASSERT(settings().isValid(), return QString()); QStringList args = QStringList(QLatin1String("info")); - const PerforceResponse userResponse = runP4Cmd(m_settings.topLevelSymLinkTarget(), args, + const PerforceResponse userResponse = runP4Cmd(settings().topLevelSymLinkTarget(), args, RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow); if (userResponse.error) return {}; @@ -1614,7 +1609,7 @@ QString PerforcePluginPrivate::pendingChangesData() return {}; args.clear(); args << QLatin1String("changes") << QLatin1String("-s") << QLatin1String("pending") << QLatin1String("-u") << user; - const PerforceResponse dataResponse = runP4Cmd(m_settings.topLevelSymLinkTarget(), args, + const PerforceResponse dataResponse = runP4Cmd(settings().topLevelSymLinkTarget(), args, RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow); return dataResponse.error ? QString() : dataResponse.stdOut; } @@ -1641,7 +1636,7 @@ QString PerforcePlugin::fileNameFromPerforceName(const QString& perforceName, unsigned flags = RunFullySynchronous; if (!quiet) flags |= CommandToWindow|StdErrToWindow|ErrorToWindow; - const PerforceResponse response = dd->runP4Cmd(dd->m_settings.topLevelSymLinkTarget(), args, flags); + const PerforceResponse response = dd->runP4Cmd(settings().topLevelSymLinkTarget(), args, flags); if (response.error) { *errorMessage = msgWhereFailed(perforceName, response.message); return {}; @@ -1659,15 +1654,15 @@ QString PerforcePlugin::fileNameFromPerforceName(const QString& perforceName, return {}; } const QString p4fileSpec = output.mid(output.lastIndexOf(QLatin1Char(' ')) + 1); - return dd->m_settings.mapToFileSystem(p4fileSpec); + return settings().mapToFileSystem(p4fileSpec); } void PerforcePluginPrivate::setTopLevel(const FilePath &topLevel) { - if (m_settings.topLevel() == topLevel) + if (settings().topLevel() == topLevel) return; - m_settings.setTopLevel(topLevel.toString()); + settings().setTopLevel(topLevel.toString()); const QString msg = Tr::tr("Perforce repository: %1").arg(topLevel.toUserOutput()); VcsOutputWindow::appendSilently(msg); @@ -1675,7 +1670,7 @@ void PerforcePluginPrivate::setTopLevel(const FilePath &topLevel) void PerforcePluginPrivate::applySettings() { - m_settings.writeSettings(); + settings().writeSettings(); m_managedDirectoryCache.clear(); getTopLevel(); emit configurationChanged(); @@ -1689,7 +1684,7 @@ void PerforcePluginPrivate::slotTopLevelFailed(const QString &errorMessage) void PerforcePluginPrivate::getTopLevel(const FilePath &workingDirectory, bool isSync) { // Run a new checker - if (m_settings.p4BinaryPath().isEmpty()) + if (settings().p4BinaryPath().isEmpty()) return; auto checker = new PerforceChecker(dd); connect(checker, &PerforceChecker::failed, dd, &PerforcePluginPrivate::slotTopLevelFailed); @@ -1697,8 +1692,8 @@ void PerforcePluginPrivate::getTopLevel(const FilePath &workingDirectory, bool i connect(checker, &PerforceChecker::succeeded, dd, &PerforcePluginPrivate::setTopLevel); connect(checker, &PerforceChecker::succeeded,checker, &QObject::deleteLater); - checker->start(m_settings.p4BinaryPath(), workingDirectory, - m_settings.commonP4Arguments(QString()), 30000); + checker->start(settings().p4BinaryPath(), workingDirectory, + settings().commonP4Arguments(QString()), 30000); if (isSync) checker->waitForFinished(); diff --git a/src/plugins/perforce/perforcesettings.cpp b/src/plugins/perforce/perforcesettings.cpp index eba981115f5..93648a55c87 100644 --- a/src/plugins/perforce/perforcesettings.cpp +++ b/src/plugins/perforce/perforcesettings.cpp @@ -30,6 +30,12 @@ static QString defaultCommand() return QLatin1String("p4" QTC_HOST_EXE_SUFFIX); } +PerforceSettings &settings() +{ + static PerforceSettings theSettings; + return theSettings; +} + PerforceSettings::PerforceSettings() { setSettingsGroup("Perforce"); @@ -138,6 +144,8 @@ PerforceSettings::PerforceSettings() st }; }); + + readSettings(); } // --------------------PerforceSettings @@ -270,13 +278,19 @@ QString PerforceSettings::mapToFileSystem(const QString &perforceFilePath) const // SettingsPage -PerforceSettingsPage::PerforceSettingsPage(PerforceSettings *settings) +class PerforceSettingsPage final : public Core::IOptionsPage { - setId(VcsBase::Constants::VCS_ID_PERFORCE); - setDisplayName(Tr::tr("Perforce")); - setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); - setSettings(settings); +public: + explicit PerforceSettingsPage() + { + setId(VcsBase::Constants::VCS_ID_PERFORCE); + setDisplayName(Tr::tr("Perforce")); + setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); + setSettingsProvider([] { return &settings(); }); -} + } +}; + +const PerforceSettingsPage settingsPage; } // Perforce::Internal diff --git a/src/plugins/perforce/perforcesettings.h b/src/plugins/perforce/perforcesettings.h index bbd8e43ef65..d1d8265157f 100644 --- a/src/plugins/perforce/perforcesettings.h +++ b/src/plugins/perforce/perforcesettings.h @@ -84,10 +84,6 @@ private: QDir *m_topLevelDir = nullptr; }; -class PerforceSettingsPage final : public Core::IOptionsPage -{ -public: - explicit PerforceSettingsPage(PerforceSettings *settings); -}; +PerforceSettings &settings(); } // Perforce::Internal From 2c353c37eac6f31dd10456b63c429930489b9d06 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 21 Jul 2023 18:58:18 +0200 Subject: [PATCH 0650/1777] Utils: Base AspectContainer on BaseAspect Change-Id: I78b11727af6e465da5731ba36bbae476d11d11ee Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/app/main.cpp | 2 +- src/libs/utils/aspects.cpp | 12 +++++----- src/libs/utils/aspects.h | 22 +++++++++---------- src/plugins/autotest/testsettings.cpp | 4 ++-- src/plugins/clangtools/clangtoolssettings.cpp | 4 ++-- src/plugins/clangtools/clangtoolssettings.h | 10 +++------ .../debuggersourcepathmappingwidget.cpp | 4 ++-- .../projectexplorer/projectconfiguration.h | 4 ++-- 8 files changed, 30 insertions(+), 32 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index f92930d0aa4..741b85b7149 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -655,7 +655,7 @@ int main(int argc, char **argv) PluginManager::setInstallSettings(installSettings); PluginManager::setSettings(settings); - Utils::BaseAspect::setSettings(settings); + Utils::BaseAspect::setQtcSettings(settings); using namespace Core; Utils::AppInfo info; diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 2fc74b144b4..7742edc4d91 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -37,12 +37,12 @@ namespace Utils { static QSettings *theSettings = nullptr; -void BaseAspect::setSettings(QSettings *settings) +void BaseAspect::setQtcSettings(QSettings *settings) { theSettings = settings; } -QSettings *BaseAspect::settings() +QSettings *BaseAspect::qtcSettings() { return theSettings; } @@ -591,7 +591,8 @@ void BaseAspect::readSettings() { if (settingsKey().isEmpty()) return; - const QVariant val = settings()->value(settingsKey()); + QTC_ASSERT(theSettings, return); + const QVariant val = theSettings->value(settingsKey()); setVariantValue(val.isValid() ? fromSettingsValue(val) : defaultVariantValue(), BeQuiet); } @@ -599,7 +600,8 @@ void BaseAspect::writeSettings() const { if (settingsKey().isEmpty()) return; - QtcSettings::setValueWithDefault(settings(), + QTC_ASSERT(theSettings, return); + QtcSettings::setValueWithDefault(theSettings, settingsKey(), toSettingsValue(variantValue()), toSettingsValue(defaultVariantValue())); @@ -2562,7 +2564,7 @@ void AspectContainer::setAutoApply(bool on) aspect->setAutoApply(on); } -bool AspectContainer::isDirty() const +bool AspectContainer::isDirty() { for (BaseAspect *aspect : std::as_const(d->m_items)) { if (aspect->isDirty()) diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index b4b2d4099a9..3d7b3ca84a9 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -176,8 +176,8 @@ public: Data::Ptr extractData() const; - static void setSettings(QSettings *settings); - static QSettings *settings(); + static void setQtcSettings(QSettings *settings); + static QSettings *qtcSettings(); // This is expensive. Do not use without good reason void writeToSettingsImmediatly() const; @@ -809,7 +809,7 @@ private: const int m_groupCount; }; -class QTCREATOR_UTILS_EXPORT AspectContainer : public QObject +class QTCREATOR_UTILS_EXPORT AspectContainer : public BaseAspect { Q_OBJECT @@ -823,25 +823,25 @@ public: void registerAspect(BaseAspect *aspect, bool takeOwnership = false); void registerAspects(const AspectContainer &aspects); - void fromMap(const QVariantMap &map); - void toMap(QVariantMap &map) const; + void fromMap(const QVariantMap &map) override; + void toMap(QVariantMap &map) const override; - void readSettings(); - void writeSettings() const; + void readSettings() override; + void writeSettings() const override; void setSettingsGroup(const QString &groupKey); void setSettingsGroups(const QString &groupKey, const QString &subGroupKey); QStringList settingsGroups() const; - void apply(); - void cancel(); - void finish(); + void apply() override; + void cancel() override; + void finish() override; void reset(); bool equals(const AspectContainer &other) const; void copyFrom(const AspectContainer &other); void setAutoApply(bool on); - bool isDirty() const; + bool isDirty() override; template <typename T> T *aspect() const { diff --git a/src/plugins/autotest/testsettings.cpp b/src/plugins/autotest/testsettings.cpp index 2e7926617d8..c2293a0b4ff 100644 --- a/src/plugins/autotest/testsettings.cpp +++ b/src/plugins/autotest/testsettings.cpp @@ -109,7 +109,7 @@ void TestSettings::toSettings() const { AspectContainer::writeSettings(); - QSettings *s = Utils::BaseAspect::settings(); + QSettings *s = Utils::BaseAspect::qtcSettings(); s->beginGroup(Constants::SETTINGSGROUP); // store frameworks and their current active and grouping state @@ -128,7 +128,7 @@ void TestSettings::fromSettings() { AspectContainer::readSettings(); - QSettings *s = Utils::BaseAspect::settings(); + QSettings *s = Utils::BaseAspect::qtcSettings(); s->beginGroup(Constants::SETTINGSGROUP); // try to get settings for registered frameworks diff --git a/src/plugins/clangtools/clangtoolssettings.cpp b/src/plugins/clangtools/clangtoolssettings.cpp index ba819231890..440bde4ecc6 100644 --- a/src/plugins/clangtools/clangtoolssettings.cpp +++ b/src/plugins/clangtools/clangtoolssettings.cpp @@ -176,7 +176,7 @@ void ClangToolsSettings::readSettings() writeSettings(); } -void ClangToolsSettings::writeSettings() +void ClangToolsSettings::writeSettings() const { AspectContainer::writeSettings(); @@ -192,7 +192,7 @@ void ClangToolsSettings::writeSettings() s->endGroup(); - emit changed(); + emit const_cast<ClangToolsSettings *>(this)->changed(); // FIXME: This is the wrong place } FilePath ClangToolsSettings::executable(ClangToolType tool) const diff --git a/src/plugins/clangtools/clangtoolssettings.h b/src/plugins/clangtools/clangtoolssettings.h index ddc4b9157e4..920a185d7df 100644 --- a/src/plugins/clangtools/clangtoolssettings.h +++ b/src/plugins/clangtools/clangtoolssettings.h @@ -58,12 +58,11 @@ private: class ClangToolsSettings : public Utils::AspectContainer { - Q_OBJECT - ClangToolsSettings(); + public: static ClangToolsSettings *instance(); - void writeSettings(); + void writeSettings() const override; // Executables Utils::FilePathAspect clangTidyExecutable{this}; @@ -82,11 +81,8 @@ public: static VersionAndSuffix clangTidyVersion(); static QVersionNumber clazyVersion(); -signals: - void changed(); - private: - void readSettings(); + void readSettings() override; // Diagnostic Configs CppEditor::ClangDiagnosticConfigs m_diagnosticConfigs; diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 244264bf793..c0ca4bb2f6b 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -491,7 +491,7 @@ const char sourcePathMappingTargetKeyC[] = "Target"; void SourcePathMapAspect::writeSettings() const { const SourcePathMap sourcePathMap = value(); - QSettings *s = settings(); + QSettings *s = qtcSettings(); s->beginWriteArray(sourcePathMappingArrayNameC); if (!sourcePathMap.isEmpty()) { const QString sourcePathMappingSourceKey(sourcePathMappingSourceKeyC); @@ -510,7 +510,7 @@ void SourcePathMapAspect::writeSettings() const void SourcePathMapAspect::readSettings() { - QSettings *s = settings(); + QSettings *s = qtcSettings(); SourcePathMap sourcePathMap; if (const int count = s->beginReadArray(sourcePathMappingArrayNameC)) { const QString sourcePathMappingSourceKey(sourcePathMappingSourceKeyC); diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h index a28c1d44152..b0f722d8054 100644 --- a/src/plugins/projectexplorer/projectconfiguration.h +++ b/src/plugins/projectexplorer/projectconfiguration.h @@ -47,9 +47,9 @@ public: bool hasError() const { return m_hasError; } // Note: Make sure subclasses call the superclasses' fromMap() function! - virtual void fromMap(const QVariantMap &map); + virtual void fromMap(const QVariantMap &map) override; // Note: Make sure subclasses call the superclasses' toMap() function! - virtual void toMap(QVariantMap &map) const; + virtual void toMap(QVariantMap &map) const override; Target *target() const; Project *project() const; From aa5b3b670e4d5fbec264f7eafeecd5bb90b470bb Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 9 Aug 2023 09:06:15 +0200 Subject: [PATCH 0651/1777] Beautifier: Rename settingspage classes *SettingsPage is the predominant name. Also move the code to the canonical location at the end of the file. Change-Id: Ib8e0d1f7a87576c4fd8019896102907c77c30f2f Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../artisticstyle/artisticstyle.cpp | 36 ++++++++++--------- .../beautifier/clangformat/clangformat.cpp | 36 ++++++++++--------- .../beautifier/uncrustify/uncrustify.cpp | 35 +++++++++--------- 3 files changed, 57 insertions(+), 50 deletions(-) diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp index 20a9f41e221..14d8ea1c246 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp @@ -182,10 +182,10 @@ static ArtisticStyleSettings &settings() // ArtisticStyleOptionsPage -class ArtisticStyleOptionsPageWidget : public Core::IOptionsPageWidget +class ArtisticStyleSettingsPageWidget : public Core::IOptionsPageWidget { public: - ArtisticStyleOptionsPageWidget() + ArtisticStyleSettingsPageWidget() { QGroupBox *options = nullptr; @@ -231,21 +231,6 @@ public: } }; -class ArtisticStyleOptionsPage final : public Core::IOptionsPage -{ -public: - ArtisticStyleOptionsPage() - { - setId("ArtisticStyle"); - setDisplayName(asDisplayName()); - setCategory(Constants::OPTION_CATEGORY); - setWidgetCreator([] { return new ArtisticStyleOptionsPageWidget; }); - } -}; - -const ArtisticStyleOptionsPage settingsPage; - - // Style ArtisticStyle::ArtisticStyle() @@ -350,4 +335,21 @@ Command ArtisticStyle::textCommand(const QString &cfgFile) const return cmd; } + +// ArtisticStyleSettingsPage + +class ArtisticStyleSettingsPage final : public Core::IOptionsPage +{ +public: + ArtisticStyleSettingsPage() + { + setId("ArtisticStyle"); + setDisplayName(asDisplayName()); + setCategory(Constants::OPTION_CATEGORY); + setWidgetCreator([] { return new ArtisticStyleSettingsPageWidget; }); + } +}; + +const ArtisticStyleSettingsPage settingsPage; + } // Beautifier::Internal diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index 43580eeff0e..6662a6423c5 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -235,10 +235,10 @@ static ClangFormatSettings &settings() return theSettings; } -class ClangFormatOptionsPageWidget : public Core::IOptionsPageWidget +class ClangFormatSettingsPageWidget : public Core::IOptionsPageWidget { public: - explicit ClangFormatOptionsPageWidget() + ClangFormatSettingsPageWidget() { ClangFormatSettings &s = settings(); QGroupBox *options = nullptr; @@ -310,21 +310,6 @@ public: } }; -class ClangFormatOptionsPage final : public Core::IOptionsPage -{ -public: - ClangFormatOptionsPage() - { - setId("ClangFormat"); - setDisplayName(Tr::tr("Clang Format")); - setCategory(Constants::OPTION_CATEGORY); - setWidgetCreator([] { return new ClangFormatOptionsPageWidget; }); - } -}; - -const ClangFormatOptionsPage settingsPage; - - // ClangFormat ClangFormat::ClangFormat() @@ -516,4 +501,21 @@ Command ClangFormat::textCommand(int offset, int length) const return cmd; } + +// ClangFormatSettingsPage + +class ClangFormatSettingsPage final : public Core::IOptionsPage +{ +public: + ClangFormatSettingsPage() + { + setId("ClangFormat"); + setDisplayName(Tr::tr("Clang Format")); + setCategory(Constants::OPTION_CATEGORY); + setWidgetCreator([] { return new ClangFormatSettingsPageWidget; }); + } +}; + +const ClangFormatSettingsPage settingsPage; + } // Beautifier::Internal diff --git a/src/plugins/beautifier/uncrustify/uncrustify.cpp b/src/plugins/beautifier/uncrustify/uncrustify.cpp index fb69eac520c..f04e5e61800 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustify.cpp @@ -177,10 +177,10 @@ static UncrustifySettings &settings() return theSettings; } -class UncrustifyOptionsPageWidget : public Core::IOptionsPageWidget +class UncrustifySettingsPageWidget : public Core::IOptionsPageWidget { public: - explicit UncrustifyOptionsPageWidget() + UncrustifySettingsPageWidget() { UncrustifySettings &s = settings(); @@ -227,20 +227,6 @@ public: } }; -class UncrustifyOptionsPage final : public Core::IOptionsPage -{ -public: - UncrustifyOptionsPage() - { - setId("Uncrustify"); - setDisplayName(uDisplayName()); - setCategory(Constants::OPTION_CATEGORY); - setWidgetCreator([] { return new UncrustifyOptionsPageWidget; }); - } -}; - -const UncrustifyOptionsPage settingsPage; - // Uncrustify @@ -381,4 +367,21 @@ Command Uncrustify::textCommand(const FilePath &cfgFile, bool fragment) const return cmd; } + +// UncrustifySettingsPage + +class UncrustifySettingsPage final : public Core::IOptionsPage +{ +public: + UncrustifySettingsPage() + { + setId("Uncrustify"); + setDisplayName(uDisplayName()); + setCategory(Constants::OPTION_CATEGORY); + setWidgetCreator([] { return new UncrustifySettingsPageWidget; }); + } +}; + +const UncrustifySettingsPage settingsPage; + } // Beautifier::Internal From 048f77b96166fb0d3a654e34f01a790a8493b7e2 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 8 Aug 2023 17:02:38 +0200 Subject: [PATCH 0652/1777] CppEditor: Let users specify a preferred doxygen command prefix Fixes: QTCREATORBUG-8096 Change-Id: I08bf4e3e0092fc775b50be6e5f4cefb9ed6979a5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/cppeditor/cppdoxygen_test.cpp | 117 +++++++++++------- src/plugins/cppeditor/doxygengenerator.cpp | 6 + .../projectcommentssettings.cpp | 4 + src/plugins/texteditor/commentssettings.cpp | 27 +++- src/plugins/texteditor/commentssettings.h | 4 + 5 files changed, 112 insertions(+), 46 deletions(-) diff --git a/src/plugins/cppeditor/cppdoxygen_test.cpp b/src/plugins/cppeditor/cppdoxygen_test.cpp index 5e7c0f87722..2cab76ee493 100644 --- a/src/plugins/cppeditor/cppdoxygen_test.cpp +++ b/src/plugins/cppeditor/cppdoxygen_test.cpp @@ -62,7 +62,9 @@ void DoxygenTest::testBasic_data() { QTest::addColumn<QByteArray>("given"); QTest::addColumn<QByteArray>("expected"); + QTest::addColumn<int>("commandPrefix"); + using CommandPrefix = CommentsSettings::CommandPrefix; QTest::newRow("qt_style") << _( "bool preventFolding;\n" "/*!|\n" @@ -72,8 +74,29 @@ void DoxygenTest::testBasic_data() "/*!\n" " * \\brief a\n" " */\n" + "int a;\n") << int(CommandPrefix::Auto); + + QTest::newRow("qt_style_settings_override") << _( + "bool preventFolding;\n" + "/*!|\n" "int a;\n" - ); + ) << _( + "bool preventFolding;\n" + "/*!\n" + " * @brief a\n" + " */\n" + "int a;\n") << int(CommandPrefix::At); + + QTest::newRow("qt_style_settings_override_redundant") << _( + "bool preventFolding;\n" + "/*!|\n" + "int a;\n" + ) << _( + "bool preventFolding;\n" + "/*!\n" + " * \\brief a\n" + " */\n" + "int a;\n") << int(CommandPrefix::Backslash); QTest::newRow("qt_style_cursor_before_existing_comment") << _( "bool preventFolding;\n" @@ -87,8 +110,7 @@ void DoxygenTest::testBasic_data() " * \n" " * \\brief something\n" " */\n" - "int a;\n" - ); + "int a;\n") << int(CommandPrefix::Auto); QTest::newRow("qt_style_continuation") << _( "bool preventFolding;\n" @@ -102,8 +124,7 @@ void DoxygenTest::testBasic_data() " * \\brief a\n" " * \n" " */\n" - "int a;\n" - ); + "int a;\n") << int(CommandPrefix::Auto); QTest::newRow("java_style") << _( "bool preventFolding;\n" @@ -114,8 +135,29 @@ void DoxygenTest::testBasic_data() "/**\n" " * @brief a\n" " */\n" + "int a;\n") << int(CommandPrefix::Auto); + + QTest::newRow("java_style_settings_override") << _( + "bool preventFolding;\n" + "/**|\n" "int a;\n" - ); + ) << _( + "bool preventFolding;\n" + "/**\n" + " * \\brief a\n" + " */\n" + "int a;\n") << int(CommandPrefix::Backslash); + + QTest::newRow("java_style_settings_override_redundant") << _( + "bool preventFolding;\n" + "/**|\n" + "int a;\n" + ) << _( + "bool preventFolding;\n" + "/**\n" + " * @brief a\n" + " */\n" + "int a;\n") << int(CommandPrefix::At); QTest::newRow("java_style_continuation") << _( "bool preventFolding;\n" @@ -129,8 +171,7 @@ void DoxygenTest::testBasic_data() " * @brief a\n" " * \n" " */\n" - "int a;\n" - ); + "int a;\n") << int(CommandPrefix::Auto); QTest::newRow("cpp_styleA") << _( "bool preventFolding;\n" @@ -141,8 +182,7 @@ void DoxygenTest::testBasic_data() "///\n" "/// \\brief a\n" "///\n" - "int a;\n" - ); + "int a;\n") << int(CommandPrefix::Auto); QTest::newRow("cpp_styleB") << _( "bool preventFolding;\n" @@ -153,8 +193,7 @@ void DoxygenTest::testBasic_data() "//!\n" "//! \\brief a\n" "//!\n" - "int a;\n" - ); + "int a;\n") << int(CommandPrefix::Auto); QTest::newRow("cpp_styleA_continuation") << _( "bool preventFolding;\n" @@ -168,8 +207,7 @@ void DoxygenTest::testBasic_data() "/// \\brief a\n" "/// \n" "///\n" - "int a;\n" - ); + "int a;\n") << int(CommandPrefix::Auto); QTest::newRow("cpp_styleB_continuation") << _( "bool preventFolding;\n" @@ -183,8 +221,7 @@ void DoxygenTest::testBasic_data() "//! \\brief a\n" "//! \n" "//!\n" - "int a;\n" - ); + "int a;\n") << int(CommandPrefix::Auto); /// test cpp style doxygen comment when inside a indented scope QTest::newRow("cpp_styleA_indented") << _( @@ -196,8 +233,7 @@ void DoxygenTest::testBasic_data() " ///\n" " /// \\brief a\n" " ///\n" - " int a;\n" - ); + " int a;\n") << int(CommandPrefix::Auto); QTest::newRow("cpp_styleB_indented") << _( " bool preventFolding;\n" @@ -208,8 +244,7 @@ void DoxygenTest::testBasic_data() " //!\n" " //! \\brief a\n" " //!\n" - " int a;\n" - ); + " int a;\n") << int(CommandPrefix::Auto); QTest::newRow("cpp_styleA_indented_preserve_mixed_indention_continuation") << _( "\t bool preventFolding;\n" @@ -219,8 +254,7 @@ void DoxygenTest::testBasic_data() "\t bool preventFolding;\n" "\t /// \\brief a\n" "\t /// \n" - "\t int a;\n" - ); + "\t int a;\n") << int(CommandPrefix::Auto); /// test cpp style doxygen comment continuation when inside a indented scope QTest::newRow("cpp_styleA_indented_continuation") << _( @@ -235,8 +269,7 @@ void DoxygenTest::testBasic_data() " /// \\brief a\n" " /// \n" " ///\n" - " int a;\n" - ); + " int a;\n") << int(CommandPrefix::Auto); QTest::newRow("cpp_styleB_indented_continuation") << _( " bool preventFolding;\n" @@ -250,8 +283,7 @@ void DoxygenTest::testBasic_data() " //! \\brief a\n" " //! \n" " //!\n" - " int a;\n" - ); + " int a;\n") << int(CommandPrefix::Auto); QTest::newRow("cpp_styleA_corner_case") << _( "bool preventFolding;\n" @@ -261,8 +293,7 @@ void DoxygenTest::testBasic_data() "bool preventFolding;\n" "///\n" "void d(); ///\n" - "\n" - ); + "\n") << int(CommandPrefix::Auto); QTest::newRow("cpp_styleB_corner_case") << _( "bool preventFolding;\n" @@ -272,8 +303,7 @@ void DoxygenTest::testBasic_data() "bool preventFolding;\n" "//!\n" "void d(); //!\n" - "\n" - ); + "\n") << int(CommandPrefix::Auto); QTest::newRow("noContinuationForExpressionAndComment1") << _( "bool preventFolding;\n" @@ -281,8 +311,7 @@ void DoxygenTest::testBasic_data() ) << _( "bool preventFolding;\n" "*foo //\n" - "\n" - ); + "\n") << int(CommandPrefix::Auto); QTest::newRow("noContinuationForExpressionAndComment2") << _( "bool preventFolding;\n" @@ -290,8 +319,7 @@ void DoxygenTest::testBasic_data() ) << _( "bool preventFolding;\n" "*foo /*\n" - " \n" - ); + " \n") << int(CommandPrefix::Auto); QTest::newRow("withMacroFromDocumentBeforeFunction") << _( "#define API\n" @@ -302,8 +330,7 @@ void DoxygenTest::testBasic_data() "/**\n" " * @brief f\n" " */\n" - "API void f();\n" - ); + "API void f();\n") << int(CommandPrefix::Auto); QTest::newRow("withAccessSpecifierBeforeFunction") << _( "class C {\n" @@ -316,8 +343,7 @@ void DoxygenTest::testBasic_data() " * @brief f\n" " */\n" " public: void f();\n" - "};\n" - ); + "};\n") << int(CommandPrefix::Auto); QTest::newRow("classTemplate") << _( "bool preventFolding;\n" @@ -330,8 +356,7 @@ void DoxygenTest::testBasic_data() " * @brief The C class\n" " */\n" "template<typename T> class C {\n" - "};\n" - ); + "};\n") << int(CommandPrefix::Auto); QTest::newRow("continuation_after_text_in_first_line") << _( "bool preventFolding;\n" @@ -343,8 +368,7 @@ void DoxygenTest::testBasic_data() "/*! leading comment\n" " * \n" " */\n" - "int a;\n" - ); + "int a;\n") << int(CommandPrefix::Auto); QTest::newRow("continuation_after_extra_indent") << _( "bool preventFolding;\n" @@ -358,14 +382,19 @@ void DoxygenTest::testBasic_data() " * cont\n" " * \n" " */\n" - "int a;\n" - ); + "int a;\n") << int(CommandPrefix::Auto); } void DoxygenTest::testBasic() { QFETCH(QByteArray, given); QFETCH(QByteArray, expected); + QFETCH(int, commandPrefix); + + CommentsSettings::Data settings = CommentsSettings::data(); + settings.commandPrefix = static_cast<CommentsSettings::CommandPrefix>(commandPrefix); + const SettingsInjector injector(settings); + runTest(given, expected); } diff --git a/src/plugins/cppeditor/doxygengenerator.cpp b/src/plugins/cppeditor/doxygengenerator.cpp index ac79cb0d839..c77f3de7769 100644 --- a/src/plugins/cppeditor/doxygengenerator.cpp +++ b/src/plugins/cppeditor/doxygengenerator.cpp @@ -201,6 +201,12 @@ QString DoxygenGenerator::generate(QTextCursor cursor, DeclarationAST *decl) QChar DoxygenGenerator::styleMark() const { + switch (m_settings.commandPrefix) { + case TextEditor::CommentsSettings::CommandPrefix::At: return '@'; + case TextEditor::CommentsSettings::CommandPrefix::Backslash: return '\\'; + case TextEditor::CommentsSettings::CommandPrefix::Auto: break; + } + if (m_style == QtStyle || m_style == CppStyleA || m_style == CppStyleB) return QLatin1Char('\\'); return QLatin1Char('@'); diff --git a/src/plugins/projectexplorer/projectcommentssettings.cpp b/src/plugins/projectexplorer/projectcommentssettings.cpp index e08638e028a..6d41244eea1 100644 --- a/src/plugins/projectexplorer/projectcommentssettings.cpp +++ b/src/plugins/projectexplorer/projectcommentssettings.cpp @@ -63,6 +63,9 @@ void ProjectCommentsSettings::loadSettings() m_customSettings.generateBrief).toBool(); m_customSettings.leadingAsterisks = data.value(CommentsSettings::leadingAsterisksSettingsKey(), m_customSettings.leadingAsterisks).toBool(); + m_customSettings.commandPrefix = static_cast<CommentsSettings::CommandPrefix>( + data.value(CommentsSettings::commandPrefixKey(), + int(m_customSettings.commandPrefix)).toInt()); } void ProjectCommentsSettings::saveSettings() @@ -81,6 +84,7 @@ void ProjectCommentsSettings::saveSettings() data.insert(CommentsSettings::enableDoxygenSettingsKey(), m_customSettings.enableDoxygen); data.insert(CommentsSettings::generateBriefSettingsKey(), m_customSettings.generateBrief); data.insert(CommentsSettings::leadingAsterisksSettingsKey(), m_customSettings.leadingAsterisks); + data.insert(CommentsSettings::commandPrefixKey(), int(m_customSettings.commandPrefix)); m_project->setNamedSettings(CommentsSettings::mainSettingsKey(), data); } diff --git a/src/plugins/texteditor/commentssettings.cpp b/src/plugins/texteditor/commentssettings.cpp index 5c6f533d254..441d01c3538 100644 --- a/src/plugins/texteditor/commentssettings.cpp +++ b/src/plugins/texteditor/commentssettings.cpp @@ -12,6 +12,7 @@ #include <utils/layoutbuilder.h> #include <QCheckBox> +#include <QComboBox> #include <QSettings> using namespace Layouting; @@ -23,6 +24,7 @@ const char kDocumentationCommentsGroup[] = "CppToolsDocumentationComments"; const char kEnableDoxygenBlocks[] = "EnableDoxygenBlocks"; const char kGenerateBrief[] = "GenerateBrief"; const char kAddLeadingAsterisks[] = "AddLeadingAsterisks"; +const char kCommandPrefix[] = "CommandPrefix"; } void CommentsSettings::setData(const Data &data) @@ -37,6 +39,7 @@ QString CommentsSettings::mainSettingsKey() { return kDocumentationCommentsGroup QString CommentsSettings::enableDoxygenSettingsKey() { return kEnableDoxygenBlocks; } QString CommentsSettings::generateBriefSettingsKey() { return kGenerateBrief; } QString CommentsSettings::leadingAsterisksSettingsKey() { return kAddLeadingAsterisks; } +QString CommentsSettings::commandPrefixKey() { return kCommandPrefix; } CommentsSettings::CommentsSettings() { @@ -56,6 +59,7 @@ void CommentsSettings::save() const s->setValue(kEnableDoxygenBlocks, m_data.enableDoxygen); s->setValue(kGenerateBrief, m_data.generateBrief); s->setValue(kAddLeadingAsterisks, m_data.leadingAsterisks); + s->setValueWithDefault(kCommandPrefix, int(m_data.commandPrefix)); s->endGroup(); } @@ -66,6 +70,8 @@ void CommentsSettings::load() m_data.enableDoxygen = s->value(kEnableDoxygenBlocks, true).toBool(); m_data.generateBrief = m_data.enableDoxygen && s->value(kGenerateBrief, true).toBool(); m_data.leadingAsterisks = s->value(kAddLeadingAsterisks, true).toBool(); + m_data.commandPrefix = static_cast<CommandPrefix>( + s->value(kCommandPrefix, int(m_data.commandPrefix)).toInt()); s->endGroup(); } @@ -76,13 +82,12 @@ public: QCheckBox m_enableDoxygenCheckBox; QCheckBox m_generateBriefCheckBox; QCheckBox m_leadingAsterisksCheckBox; + QComboBox m_commandPrefixComboBox; }; CommentsSettingsWidget::CommentsSettingsWidget(const CommentsSettings::Data &settings) : d(new Private) { - initFromSettings(settings); - d->m_enableDoxygenCheckBox.setText(Tr::tr("Enable Doxygen blocks")); d->m_enableDoxygenCheckBox.setToolTip( Tr::tr("Automatically creates a Doxygen comment upon pressing " @@ -98,10 +103,23 @@ CommentsSettingsWidget::CommentsSettingsWidget(const CommentsSettings::Data &set Tr::tr("Adds leading asterisks when continuing C/C++ \"/*\", Qt \"/*!\" " "and Java \"/**\" style comments on new lines.")); + const auto commandPrefixLabel = new QLabel(Tr::tr("Doxygen command prefix:")); + const QString commandPrefixToolTip = Tr::tr(R"(Doxygen allows "@" and "\" to start commands. +By default, "@" is used if the surrounding comment starts with "/**" or "///", and "\" is used +if the comment starts with "/*!" or "//!)"); + commandPrefixLabel->setToolTip(commandPrefixToolTip); + d->m_commandPrefixComboBox.setToolTip(commandPrefixToolTip); + d->m_commandPrefixComboBox.addItem(Tr::tr("Automatic")); + d->m_commandPrefixComboBox.addItem("@"); + d->m_commandPrefixComboBox.addItem("\\"); + + initFromSettings(settings); + Column { &d->m_enableDoxygenCheckBox, Row { Space(30), &d->m_generateBriefCheckBox }, &d->m_leadingAsterisksCheckBox, + Row { commandPrefixLabel, &d->m_commandPrefixComboBox, st }, st }.attachTo(this); @@ -112,6 +130,8 @@ CommentsSettingsWidget::CommentsSettingsWidget(const CommentsSettings::Data &set &d->m_leadingAsterisksCheckBox}) { connect(checkBox, &QCheckBox::clicked, this, &CommentsSettingsWidget::settingsChanged); } + connect(&d->m_commandPrefixComboBox, &QComboBox::currentIndexChanged, + this, &CommentsSettingsWidget::settingsChanged); } CommentsSettingsWidget::~CommentsSettingsWidget() { delete d; } @@ -122,6 +142,8 @@ CommentsSettings::Data CommentsSettingsWidget::settingsData() const settings.enableDoxygen = d->m_enableDoxygenCheckBox.isChecked(); settings.generateBrief = d->m_generateBriefCheckBox.isChecked(); settings.leadingAsterisks = d->m_leadingAsterisksCheckBox.isChecked(); + settings.commandPrefix = static_cast<CommentsSettings::CommandPrefix>( + d->m_commandPrefixComboBox.currentIndex()); return settings; } @@ -137,6 +159,7 @@ void CommentsSettingsWidget::initFromSettings(const CommentsSettings::Data &sett d->m_generateBriefCheckBox.setEnabled(d->m_enableDoxygenCheckBox.isChecked()); d->m_generateBriefCheckBox.setChecked(settings.generateBrief); d->m_leadingAsterisksCheckBox.setChecked(settings.leadingAsterisks); + d->m_commandPrefixComboBox.setCurrentIndex(int(settings.commandPrefix)); } namespace Internal { diff --git a/src/plugins/texteditor/commentssettings.h b/src/plugins/texteditor/commentssettings.h index b14bd376ae5..7206a8ccc4c 100644 --- a/src/plugins/texteditor/commentssettings.h +++ b/src/plugins/texteditor/commentssettings.h @@ -14,8 +14,10 @@ namespace TextEditor { class TEXTEDITOR_EXPORT CommentsSettings { public: + enum class CommandPrefix { Auto, At, Backslash }; class Data { public: + CommandPrefix commandPrefix = CommandPrefix::Auto; bool enableDoxygen = true; bool generateBrief = true; bool leadingAsterisks = true; @@ -28,6 +30,7 @@ public: static QString enableDoxygenSettingsKey(); static QString generateBriefSettingsKey(); static QString leadingAsterisksSettingsKey(); + static QString commandPrefixKey(); private: CommentsSettings(); @@ -40,6 +43,7 @@ private: inline bool operator==(const CommentsSettings::Data &a, const CommentsSettings::Data &b) { return a.enableDoxygen == b.enableDoxygen + && a.commandPrefix == b.commandPrefix && a.generateBrief == b.generateBrief && a.leadingAsterisks == b.leadingAsterisks; } From 9f1c99cb98c384a9ca101b7fbbb61ce2f5e79eae Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 9 Aug 2023 10:47:36 +0200 Subject: [PATCH 0653/1777] Debugger: Call DebuggerItemManager::restoreDebuggers() more directly Change-Id: I77a293a8754e2aa3dd521e0810006c5f10ae23ff Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/debugger/debuggeritemmanager.cpp | 11 ++--------- src/plugins/debugger/debuggeritemmanager.h | 2 +- src/plugins/debugger/debuggerplugin.cpp | 4 +--- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index c672cf4b94d..ff08d9d8d89 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -64,8 +64,6 @@ public: DebuggerItemManagerPrivate(); ~DebuggerItemManagerPrivate(); - void extensionsInitialized(); - void restoreDebuggers(); void saveDebuggers(); @@ -896,11 +894,6 @@ DebuggerItemManagerPrivate::DebuggerItemManagerPrivate() m_optionsPage = new DebuggerOptionsPage; } -void DebuggerItemManagerPrivate::extensionsInitialized() -{ - restoreDebuggers(); -} - DebuggerItemManagerPrivate::~DebuggerItemManagerPrivate() { delete m_optionsPage; @@ -1038,9 +1031,9 @@ DebuggerItemManager::~DebuggerItemManager() delete d; } -void DebuggerItemManager::extensionsInitialized() +void DebuggerItemManager::restoreDebuggers() { - d->extensionsInitialized(); + d->restoreDebuggers(); } const QList<DebuggerItem> DebuggerItemManager::debuggers() diff --git a/src/plugins/debugger/debuggeritemmanager.h b/src/plugins/debugger/debuggeritemmanager.h index 9be8c4faf6b..2fa588414f0 100644 --- a/src/plugins/debugger/debuggeritemmanager.h +++ b/src/plugins/debugger/debuggeritemmanager.h @@ -22,7 +22,7 @@ public: DebuggerItemManager(); ~DebuggerItemManager(); - void extensionsInitialized(); + static void restoreDebuggers(); static const QList<DebuggerItem> debuggers(); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index e9acc715755..fcd918038be 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -2059,9 +2059,7 @@ void DebuggerPluginPrivate::remoteCommand(const QStringList &options) void DebuggerPluginPrivate::extensionsInitialized() { - QTimer::singleShot(0, this, [this]{ - m_debuggerItemManager.extensionsInitialized(); - }); + QTimer::singleShot(0, this, &DebuggerItemManager::restoreDebuggers); // If the CppEditor or QmlJS editor plugin is there, we want to add something to // the editor context menu. From 4b4cbd142cca05e03d6a182030cf58d4cca60e1b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 9 Aug 2023 09:26:57 +0200 Subject: [PATCH 0654/1777] Debugger: Rename main option page to DebuggerSettingsPage That's the page in the 'Kits' category. Also, move code to the canonical place at the end of the file and self-register the factory at plugin load. Change-Id: I6bdf7288a6a475447ea8a5a57b9118d49831a7b2 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/debugger/debuggeritemmanager.cpp | 327 +++++++++---------- 1 file changed, 162 insertions(+), 165 deletions(-) diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index ff08d9d8d89..62c58e5abc6 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -79,7 +79,6 @@ public: PersistentSettingsWriter m_writer; DebuggerItemModel *m_model = nullptr; - IOptionsPage *m_optionsPage = nullptr; }; static DebuggerItemManagerPrivate *d = nullptr; @@ -493,168 +492,6 @@ void DebuggerItemConfigWidget::binaryPathHasChanged() store(); } -// -------------------------------------------------------------------------- -// DebuggerConfigWidget -// -------------------------------------------------------------------------- - -class DebuggerConfigWidget : public IOptionsPageWidget -{ -public: - DebuggerConfigWidget() - { - m_addButton = new QPushButton(Tr::tr("Add"), this); - - m_cloneButton = new QPushButton(Tr::tr("Clone"), this); - m_cloneButton->setEnabled(false); - - m_delButton = new QPushButton(this); - m_delButton->setEnabled(false); - - m_container = new DetailsWidget(this); - m_container->setState(DetailsWidget::NoSummary); - m_container->setVisible(false); - - m_debuggerView = new QTreeView(this); - m_debuggerView->setModel(d->m_model); - m_debuggerView->setUniformRowHeights(true); - m_debuggerView->setSelectionMode(QAbstractItemView::SingleSelection); - m_debuggerView->setSelectionBehavior(QAbstractItemView::SelectRows); - m_debuggerView->expandAll(); - - auto header = m_debuggerView->header(); - header->setStretchLastSection(false); - header->setSectionResizeMode(0, QHeaderView::ResizeToContents); - header->setSectionResizeMode(1, QHeaderView::ResizeToContents); - header->setSectionResizeMode(2, QHeaderView::Stretch); - - auto buttonLayout = new QVBoxLayout(); - buttonLayout->setSpacing(6); - buttonLayout->setContentsMargins(0, 0, 0, 0); - buttonLayout->addWidget(m_addButton); - buttonLayout->addWidget(m_cloneButton); - buttonLayout->addWidget(m_delButton); - buttonLayout->addItem(new QSpacerItem(10, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); - - auto verticalLayout = new QVBoxLayout(); - verticalLayout->addWidget(m_debuggerView); - verticalLayout->addWidget(m_container); - - auto horizontalLayout = new QHBoxLayout(this); - horizontalLayout->addLayout(verticalLayout); - horizontalLayout->addLayout(buttonLayout); - - connect(m_debuggerView->selectionModel(), &QItemSelectionModel::currentChanged, - this, &DebuggerConfigWidget::currentDebuggerChanged, Qt::QueuedConnection); - - connect(m_addButton, &QAbstractButton::clicked, - this, &DebuggerConfigWidget::addDebugger, Qt::QueuedConnection); - connect(m_cloneButton, &QAbstractButton::clicked, - this, &DebuggerConfigWidget::cloneDebugger, Qt::QueuedConnection); - connect(m_delButton, &QAbstractButton::clicked, - this, &DebuggerConfigWidget::removeDebugger, Qt::QueuedConnection); - - m_itemConfigWidget = new DebuggerItemConfigWidget; - m_container->setWidget(m_itemConfigWidget); - updateButtons(); - } - - void apply() final - { - m_itemConfigWidget->store(); - d->m_model->apply(); - } - - void finish() final - { - d->m_model->cancel(); - } - - void cloneDebugger(); - void addDebugger(); - void removeDebugger(); - void currentDebuggerChanged(const QModelIndex &newCurrent); - void updateButtons(); - - QTreeView *m_debuggerView; - QPushButton *m_addButton; - QPushButton *m_cloneButton; - QPushButton *m_delButton; - DetailsWidget *m_container; - DebuggerItemConfigWidget *m_itemConfigWidget; -}; - -void DebuggerConfigWidget::cloneDebugger() -{ - DebuggerTreeItem *treeItem = d->m_model->currentTreeItem(); - if (!treeItem) - return; - - DebuggerItem *item = &treeItem->m_item; - DebuggerItem newItem; - newItem.createId(); - newItem.setCommand(item->command()); - newItem.setUnexpandedDisplayName(d->uniqueDisplayName(Tr::tr("Clone of %1").arg(item->displayName()))); - newItem.reinitializeFromFile(); - newItem.setAutoDetected(false); - newItem.setGeneric(item->isGeneric()); - newItem.setEngineType(item->engineType()); - auto addedItem = d->m_model->addDebugger(newItem, true); - m_debuggerView->setCurrentIndex(d->m_model->indexForItem(addedItem)); -} - -void DebuggerConfigWidget::addDebugger() -{ - DebuggerItem item; - item.createId(); - item.setEngineType(NoEngineType); - item.setUnexpandedDisplayName(d->uniqueDisplayName(Tr::tr("New Debugger"))); - item.setAutoDetected(false); - auto addedItem = d->m_model->addDebugger(item, true); - m_debuggerView->setCurrentIndex(d->m_model->indexForItem(addedItem)); -} - -void DebuggerConfigWidget::removeDebugger() -{ - DebuggerTreeItem *treeItem = d->m_model->currentTreeItem(); - QTC_ASSERT(treeItem, return); - treeItem->m_removed = !treeItem->m_removed; - treeItem->update(); - updateButtons(); -} - -void DebuggerConfigWidget::currentDebuggerChanged(const QModelIndex &newCurrent) -{ - d->m_model->setCurrentIndex(newCurrent); - updateButtons(); -} - -void DebuggerConfigWidget::updateButtons() -{ - DebuggerTreeItem *titem = d->m_model->currentTreeItem(); - DebuggerItem *item = titem ? &titem->m_item : nullptr; - - m_itemConfigWidget->load(item); - m_container->setVisible(item != nullptr); - m_cloneButton->setEnabled(item && item->isValid() && item->canClone()); - m_delButton->setEnabled(item && !item->isAutoDetected()); - m_delButton->setText(item && titem->m_removed ? Tr::tr("Restore") : Tr::tr("Remove")); -} - -// -------------------------------------------------------------------------- -// DebuggerOptionsPage -// -------------------------------------------------------------------------- - -class DebuggerOptionsPage : public Core::IOptionsPage -{ -public: - DebuggerOptionsPage() { - setId(ProjectExplorer::Constants::DEBUGGER_SETTINGS_PAGE_ID); - setDisplayName(Tr::tr("Debuggers")); - setCategory(ProjectExplorer::Constants::KITS_SETTINGS_CATEGORY); - setWidgetCreator([] { return new DebuggerConfigWidget; }); - } -}; - void DebuggerItemManagerPrivate::autoDetectCdbDebuggers() { FilePaths cdbs; @@ -891,12 +728,10 @@ DebuggerItemManagerPrivate::DebuggerItemManagerPrivate() { d = this; m_model = new DebuggerItemModel; - m_optionsPage = new DebuggerOptionsPage; } DebuggerItemManagerPrivate::~DebuggerItemManagerPrivate() { - delete m_optionsPage; delete m_model; } @@ -1120,4 +955,166 @@ void DebuggerItemManager::listDetectedDebuggers(const QString &detectionSource, *logMessage = logMessages.join('\n'); } + +// DebuggerSettingsPageWidget + +class DebuggerSettingsPageWidget : public IOptionsPageWidget +{ +public: + DebuggerSettingsPageWidget() + { + m_addButton = new QPushButton(Tr::tr("Add"), this); + + m_cloneButton = new QPushButton(Tr::tr("Clone"), this); + m_cloneButton->setEnabled(false); + + m_delButton = new QPushButton(this); + m_delButton->setEnabled(false); + + m_container = new DetailsWidget(this); + m_container->setState(DetailsWidget::NoSummary); + m_container->setVisible(false); + + m_debuggerView = new QTreeView(this); + m_debuggerView->setModel(d->m_model); + m_debuggerView->setUniformRowHeights(true); + m_debuggerView->setSelectionMode(QAbstractItemView::SingleSelection); + m_debuggerView->setSelectionBehavior(QAbstractItemView::SelectRows); + m_debuggerView->expandAll(); + + auto header = m_debuggerView->header(); + header->setStretchLastSection(false); + header->setSectionResizeMode(0, QHeaderView::ResizeToContents); + header->setSectionResizeMode(1, QHeaderView::ResizeToContents); + header->setSectionResizeMode(2, QHeaderView::Stretch); + + auto buttonLayout = new QVBoxLayout(); + buttonLayout->setSpacing(6); + buttonLayout->setContentsMargins(0, 0, 0, 0); + buttonLayout->addWidget(m_addButton); + buttonLayout->addWidget(m_cloneButton); + buttonLayout->addWidget(m_delButton); + buttonLayout->addItem(new QSpacerItem(10, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); + + auto verticalLayout = new QVBoxLayout(); + verticalLayout->addWidget(m_debuggerView); + verticalLayout->addWidget(m_container); + + auto horizontalLayout = new QHBoxLayout(this); + horizontalLayout->addLayout(verticalLayout); + horizontalLayout->addLayout(buttonLayout); + + connect(m_debuggerView->selectionModel(), &QItemSelectionModel::currentChanged, + this, &DebuggerSettingsPageWidget::currentDebuggerChanged, Qt::QueuedConnection); + + connect(m_addButton, &QAbstractButton::clicked, + this, &DebuggerSettingsPageWidget::addDebugger, Qt::QueuedConnection); + connect(m_cloneButton, &QAbstractButton::clicked, + this, &DebuggerSettingsPageWidget::cloneDebugger, Qt::QueuedConnection); + connect(m_delButton, &QAbstractButton::clicked, + this, &DebuggerSettingsPageWidget::removeDebugger, Qt::QueuedConnection); + + m_itemConfigWidget = new DebuggerItemConfigWidget; + m_container->setWidget(m_itemConfigWidget); + updateButtons(); + } + + void apply() final + { + m_itemConfigWidget->store(); + d->m_model->apply(); + } + + void finish() final + { + d->m_model->cancel(); + } + + void cloneDebugger(); + void addDebugger(); + void removeDebugger(); + void currentDebuggerChanged(const QModelIndex &newCurrent); + void updateButtons(); + + QTreeView *m_debuggerView; + QPushButton *m_addButton; + QPushButton *m_cloneButton; + QPushButton *m_delButton; + DetailsWidget *m_container; + DebuggerItemConfigWidget *m_itemConfigWidget; +}; + +void DebuggerSettingsPageWidget::cloneDebugger() +{ + DebuggerTreeItem *treeItem = d->m_model->currentTreeItem(); + if (!treeItem) + return; + + DebuggerItem *item = &treeItem->m_item; + DebuggerItem newItem; + newItem.createId(); + newItem.setCommand(item->command()); + newItem.setUnexpandedDisplayName(d->uniqueDisplayName(Tr::tr("Clone of %1").arg(item->displayName()))); + newItem.reinitializeFromFile(); + newItem.setAutoDetected(false); + newItem.setGeneric(item->isGeneric()); + newItem.setEngineType(item->engineType()); + auto addedItem = d->m_model->addDebugger(newItem, true); + m_debuggerView->setCurrentIndex(d->m_model->indexForItem(addedItem)); +} + +void DebuggerSettingsPageWidget::addDebugger() +{ + DebuggerItem item; + item.createId(); + item.setEngineType(NoEngineType); + item.setUnexpandedDisplayName(d->uniqueDisplayName(Tr::tr("New Debugger"))); + item.setAutoDetected(false); + auto addedItem = d->m_model->addDebugger(item, true); + m_debuggerView->setCurrentIndex(d->m_model->indexForItem(addedItem)); +} + +void DebuggerSettingsPageWidget::removeDebugger() +{ + DebuggerTreeItem *treeItem = d->m_model->currentTreeItem(); + QTC_ASSERT(treeItem, return); + treeItem->m_removed = !treeItem->m_removed; + treeItem->update(); + updateButtons(); +} + +void DebuggerSettingsPageWidget::currentDebuggerChanged(const QModelIndex &newCurrent) +{ + d->m_model->setCurrentIndex(newCurrent); + updateButtons(); +} + +void DebuggerSettingsPageWidget::updateButtons() +{ + DebuggerTreeItem *titem = d->m_model->currentTreeItem(); + DebuggerItem *item = titem ? &titem->m_item : nullptr; + + m_itemConfigWidget->load(item); + m_container->setVisible(item != nullptr); + m_cloneButton->setEnabled(item && item->isValid() && item->canClone()); + m_delButton->setEnabled(item && !item->isAutoDetected()); + m_delButton->setText(item && titem->m_removed ? Tr::tr("Restore") : Tr::tr("Remove")); +} + + +// DebuggerSettingsPage + +class DebuggerSettingsPage : public Core::IOptionsPage +{ +public: + DebuggerSettingsPage() { + setId(ProjectExplorer::Constants::DEBUGGER_SETTINGS_PAGE_ID); + setDisplayName(Tr::tr("Debuggers")); + setCategory(ProjectExplorer::Constants::KITS_SETTINGS_CATEGORY); + setWidgetCreator([] { return new DebuggerSettingsPageWidget; }); + } +}; + +const DebuggerSettingsPage settingsPage; + } // namespace Debugger From fe1aeb3057b90eb10c478b72fd9f886ce65e1b85 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 4 Aug 2023 12:26:02 +0200 Subject: [PATCH 0655/1777] EasingCurve: Avoid iterating double Iterate int instead. Store the x() value of QPointF, instead of storing the whold QPointF instance. Change-Id: I8c19eaa81cd60c4a164392afd5429ad9a2d222bd Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Knud Dollereder <knud.dollereder@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- .../components/timelineeditor/easingcurve.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plugins/qmldesigner/components/timelineeditor/easingcurve.cpp b/src/plugins/qmldesigner/components/timelineeditor/easingcurve.cpp index ae9833e46ec..133beaae154 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/easingcurve.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/easingcurve.cpp @@ -65,15 +65,14 @@ int EasingCurve::segmentCount() const bool EasingCurve::isLegal() const { QPainterPath painterPath(path()); - - double increment = 1.0 / 30.0; - QPointF max = painterPath.pointAtPercent(0.0); - for (double i = increment; i <= 1.0; i += increment) { - QPointF current = painterPath.pointAtPercent(i); - if (current.x() < max.x()) + qreal maxX = painterPath.pointAtPercent(0.0).x(); + const int denominator = 30; + for (int i = 1; i <= denominator; ++i) { + const qreal currentX = painterPath.pointAtPercent(qreal(i) / denominator).x(); + if (currentX < maxX) return false; else - max = current; + maxX = currentX; } return true; } From 81d38bb711a857653fab1e8661d1618ebcdeb650 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 21:47:23 +0200 Subject: [PATCH 0656/1777] AndroidRunnerWorker: Replace adbLogcat process with Utils::Process Change-Id: Ia4e0e7e0b49ca1847bac537a7672c39b069bf767 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/android/androidrunnerworker.cpp | 16 ++++++++-------- src/plugins/android/androidrunnerworker.h | 7 +++++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 96b79989f39..71a465cad05 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -215,7 +215,6 @@ static FilePath debugServer(bool useLldb, const Target *target) AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packageName) : m_packageName(packageName) - , m_adbLogcatProcess(nullptr, deleter) , m_psIsAlive(nullptr, deleter) , m_debugServerProcess(nullptr, deleter) , m_jdbProcess(nullptr, deleter) @@ -406,13 +405,13 @@ void AndroidRunnerWorker::forceStop() void AndroidRunnerWorker::logcatReadStandardError() { if (m_processPID != -1) - logcatProcess(m_adbLogcatProcess->readAllStandardError(), m_stderrBuffer, true); + logcatProcess(m_adbLogcatProcess->readAllRawStandardError(), m_stderrBuffer, true); } void AndroidRunnerWorker::logcatReadStandardOutput() { if (m_processPID != -1) - logcatProcess(m_adbLogcatProcess->readAllStandardOutput(), m_stdoutBuffer, false); + logcatProcess(m_adbLogcatProcess->readAllRawStandardOutput(), m_stdoutBuffer, false); } void AndroidRunnerWorker::logcatProcess(const QByteArray &text, QByteArray &buffer, bool onlyError) @@ -504,16 +503,16 @@ void Android::Internal::AndroidRunnerWorker::asyncStartLogcat() { // Its assumed that the device or avd returned by selector() is online. // Start the logcat process before app starts. - QTC_ASSERT(!m_adbLogcatProcess, /**/); + QTC_CHECK(!m_adbLogcatProcess); // Ideally AndroidManager::runAdbCommandDetached() should be used, but here // we need to connect the readyRead signals from logcat otherwise we might // lost some output between the process start and connecting those signals. - m_adbLogcatProcess.reset(new QProcess()); + m_adbLogcatProcess.reset(new Process); - connect(m_adbLogcatProcess.get(), &QProcess::readyReadStandardOutput, + connect(m_adbLogcatProcess.get(), &Process::readyReadStandardOutput, this, &AndroidRunnerWorker::logcatReadStandardOutput); - connect(m_adbLogcatProcess.get(), &QProcess::readyReadStandardError, + connect(m_adbLogcatProcess.get(), &Process::readyReadStandardError, this, &AndroidRunnerWorker::logcatReadStandardError); // Get target current time to fetch only recent logs @@ -529,7 +528,8 @@ void Android::Internal::AndroidRunnerWorker::asyncStartLogcat() const FilePath adb = AndroidConfigurations::currentConfig().adbToolPath(); qCDebug(androidRunWorkerLog).noquote() << "Running logcat command (async):" << CommandLine(adb, logcatArgs).toUserOutput(); - m_adbLogcatProcess->start(adb.toString(), logcatArgs); + m_adbLogcatProcess->setCommand({adb, logcatArgs}); + m_adbLogcatProcess->start(); if (m_adbLogcatProcess->waitForStarted(500) && m_adbLogcatProcess->state() == QProcess::Running) m_adbLogcatProcess->setObjectName("AdbLogcatProcess"); } diff --git a/src/plugins/android/androidrunnerworker.h b/src/plugins/android/androidrunnerworker.h index 7e41d2e9c73..559e07d73cd 100644 --- a/src/plugins/android/androidrunnerworker.h +++ b/src/plugins/android/androidrunnerworker.h @@ -16,7 +16,10 @@ QT_BEGIN_NAMESPACE class QProcess; QT_END_NAMESPACE -namespace Utils { class FilePath; } +namespace Utils { +class FilePath; +class Process; +} namespace ProjectExplorer { class RunWorker; } namespace Android { @@ -88,7 +91,7 @@ private: QStringList m_amStartExtraArgs; qint64 m_processPID = -1; qint64 m_processUser = -1; - std::unique_ptr<QProcess, Deleter> m_adbLogcatProcess; + std::unique_ptr<Utils::Process> m_adbLogcatProcess; std::unique_ptr<QProcess, Deleter> m_psIsAlive; QByteArray m_stdoutBuffer; QByteArray m_stderrBuffer; From af731de4df8a623198e842b26a9f9e27f03c57c3 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 4 Aug 2023 13:07:49 +0200 Subject: [PATCH 0657/1777] CubicSegment: Avoid iterating double Change-Id: I7f98247a20228a1087291138394ebc7469ad7b18 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Knud Dollereder <knud.dollereder@qt.io> --- .../qmldesigner/components/pathtool/cubicsegment.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/pathtool/cubicsegment.cpp b/src/plugins/qmldesigner/components/pathtool/cubicsegment.cpp index e0e090338ff..ee968e38548 100644 --- a/src/plugins/qmldesigner/components/pathtool/cubicsegment.cpp +++ b/src/plugins/qmldesigner/components/pathtool/cubicsegment.cpp @@ -247,15 +247,15 @@ QPointF CubicSegment::sample(double t) const double CubicSegment::minimumDistance(const QPointF &pickPoint, double &tReturnValue) const { double actualMinimumDistance = 10000000.; - for (double t = 0.0; t <= 1.0; t += 0.1) { - QPointF samplePoint = sample(t); - QPointF distanceVector = pickPoint - samplePoint; + const int tMax = 10; + for (int t = 0; t <= tMax; ++t) { + const QPointF samplePoint = sample(double(t) / tMax); + const QPointF distanceVector = pickPoint - samplePoint; if (distanceVector.manhattanLength() < actualMinimumDistance) { actualMinimumDistance = distanceVector.manhattanLength(); tReturnValue = t; } } - return actualMinimumDistance; } From 97461f6f189e7bfbc0aff7c567f21230b7a22226 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 21:58:37 +0200 Subject: [PATCH 0658/1777] AndroidRunnerWorker: Replace jdb process with Utils::Process Change-Id: I269c9910a6d0ca1f259a3632abe3601bcdb19f8e Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/android/androidrunnerworker.cpp | 36 +++++++++------------ src/plugins/android/androidrunnerworker.h | 2 +- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 71a465cad05..3553f87ad38 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -53,6 +53,8 @@ namespace Internal { static const QString pidPollingScript = QStringLiteral("while [ -d /proc/%1 ]; do sleep 1; done"); static const QRegularExpression userIdPattern("u(\\d+)_a"); +static const int s_jdbTimeout = 5000; + static int APP_START_TIMEOUT = 45000; static bool isTimedOut(const chrono::high_resolution_clock::time_point &start, int msecs = APP_START_TIMEOUT) @@ -217,8 +219,6 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa : m_packageName(packageName) , m_psIsAlive(nullptr, deleter) , m_debugServerProcess(nullptr, deleter) - , m_jdbProcess(nullptr, deleter) - { auto runControl = runner->runControl(); m_useLldb = Debugger::DebuggerKitAspect::engineType(runControl->kit()) @@ -755,7 +755,7 @@ void AndroidRunnerWorker::handleJdbWaiting() } m_afterFinishAdbCommands.push_back(removeForward.join(' ')); - FilePath jdbPath = AndroidConfigurations::currentConfig().openJDKLocation() + const FilePath jdbPath = AndroidConfigurations::currentConfig().openJDKLocation() .pathAppended("bin/jdb").withExecutableSuffix(); QStringList jdbArgs("-connect"); @@ -763,14 +763,16 @@ void AndroidRunnerWorker::handleJdbWaiting() .arg(m_localJdbServerPort.toString()); qCDebug(androidRunWorkerLog).noquote() << "Starting JDB:" << CommandLine(jdbPath, jdbArgs).toUserOutput(); - std::unique_ptr<QProcess, Deleter> jdbProcess(new QProcess, &deleter); - jdbProcess->setProcessChannelMode(QProcess::MergedChannels); - jdbProcess->start(jdbPath.toString(), jdbArgs); - if (!jdbProcess->waitForStarted()) { + m_jdbProcess.reset(new Process); + m_jdbProcess->setProcessChannelMode(QProcess::MergedChannels); + m_jdbProcess->setCommand({jdbPath, jdbArgs}); + m_jdbProcess->setReaperTimeout(s_jdbTimeout); + m_jdbProcess->start(); + if (!m_jdbProcess->waitForStarted()) { emit remoteProcessFinished(Tr::tr("Failed to start JDB.")); + m_jdbProcess.reset(); return; } - m_jdbProcess = std::move(jdbProcess); m_jdbProcess->setObjectName("JdbProcess"); } @@ -780,7 +782,7 @@ void AndroidRunnerWorker::handleJdbSettled() auto waitForCommand = [this] { for (int i = 0; i < 120 && m_jdbProcess->state() == QProcess::Running; ++i) { m_jdbProcess->waitForReadyRead(500); - QByteArray lines = m_jdbProcess->readAll(); + const QByteArray lines = m_jdbProcess->readAllRawStandardOutput(); const auto linesList = lines.split('\n'); for (const auto &line : linesList) { auto msg = line.trimmed(); @@ -792,22 +794,14 @@ void AndroidRunnerWorker::handleJdbSettled() }; const QStringList commands{"threads", "cont", "exit"}; - const int jdbTimeout = 5000; for (const QString &command : commands) { - if (waitForCommand()) { - m_jdbProcess->write(QString("%1\n").arg(command).toLatin1()); - m_jdbProcess->waitForBytesWritten(jdbTimeout); - } + if (waitForCommand()) + m_jdbProcess->write(QString("%1\n").arg(command)); } - if (!m_jdbProcess->waitForFinished(jdbTimeout)) { - m_jdbProcess->terminate(); - if (!m_jdbProcess->waitForFinished(jdbTimeout)) { - qCDebug(androidRunWorkerLog) << "Killing JDB process"; - m_jdbProcess->kill(); - m_jdbProcess->waitForFinished(); - } + if (!m_jdbProcess->waitForFinished(s_jdbTimeout)) { + m_jdbProcess.reset(); } else if (m_jdbProcess->exitStatus() == QProcess::NormalExit && m_jdbProcess->exitCode() == 0) { qCDebug(androidRunWorkerLog) << "JDB settled"; return; diff --git a/src/plugins/android/androidrunnerworker.h b/src/plugins/android/androidrunnerworker.h index 559e07d73cd..d927a7c4ff8 100644 --- a/src/plugins/android/androidrunnerworker.h +++ b/src/plugins/android/androidrunnerworker.h @@ -104,7 +104,7 @@ private: JDBState m_jdbState = JDBState::Idle; Utils::Port m_localJdbServerPort; std::unique_ptr<QProcess, Deleter> m_debugServerProcess; // gdbserver or lldb-server - std::unique_ptr<QProcess, Deleter> m_jdbProcess; + std::unique_ptr<Utils::Process> m_jdbProcess; QString m_deviceSerialNumber; int m_apiLevel = -1; QString m_extraAppParams; From e84369bbfa8e1a3d2f5a2dff6f28da867e19e2f7 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 8 Aug 2023 18:20:15 +0200 Subject: [PATCH 0659/1777] Core: Remove IOptionPage::setSettings() The last user is gone, setSettingsProvider is the thing to use, and allows delay-created settings. Change-Id: Ic6491e2b0ba2ceaad7786cf37248d734f9714437 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/coreplugin/dialogs/ioptionspage.cpp | 5 ----- src/plugins/coreplugin/dialogs/ioptionspage.h | 1 - 2 files changed, 6 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.cpp b/src/plugins/coreplugin/dialogs/ioptionspage.cpp index dc751eddc98..175e8289600 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.cpp +++ b/src/plugins/coreplugin/dialogs/ioptionspage.cpp @@ -207,11 +207,6 @@ void IOptionsPage::setCategoryIconPath(const FilePath &categoryIconPath) m_categoryIconPath = categoryIconPath; } -void IOptionsPage::setSettings(AspectContainer *settings) -{ - m_settingsProvider = [settings] { return settings; }; -} - void IOptionsPage::setSettingsProvider(const std::function<AspectContainer *()> &provider) { m_settingsProvider = provider; diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index 54617d6e602..cccab844374 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -67,7 +67,6 @@ protected: void setCategory(Utils::Id category) { m_category = category; } void setDisplayCategory(const QString &displayCategory) { m_displayCategory = displayCategory; } void setCategoryIconPath(const Utils::FilePath &categoryIconPath); - void setSettings(Utils::AspectContainer *settings); // FIXME: Remove. void setSettingsProvider(const std::function<Utils::AspectContainer *()> &provider); private: From 76308012930b44d2a1ce9e2688de7792818fc684 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 20:05:56 +0200 Subject: [PATCH 0660/1777] Valgrind: Make Parser's API similar to the ThreadedParser's API Change-Id: I39634c881dac44fc857a4aa2049e9c2618daec9b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- .../valgrind/valgrindmemcheckparsertest.cpp | 31 ++++++++++--------- .../valgrind/valgrindmemcheckparsertest.h | 4 +-- src/plugins/valgrind/xmlprotocol/parser.cpp | 28 ++++++++++------- src/plugins/valgrind/xmlprotocol/parser.h | 16 +++++----- .../valgrind/xmlprotocol/threadedparser.cpp | 9 ++---- 5 files changed, 45 insertions(+), 43 deletions(-) diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp index c4ac4148a6f..d8f453830cc 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -16,7 +16,6 @@ #include <QFileInfo> #include <QProcess> #include <QTcpServer> -#include <QTcpSocket> #include <QTest> using namespace Utils; @@ -165,16 +164,13 @@ void ValgrindMemcheckParserTest::initTest(const QString &testfile, const QString QCOMPARE(m_process->state(), QProcess::Running); QVERIFY2(m_process->error() == QProcess::UnknownError, qPrintable(m_process->errorString())); QVERIFY(m_server->waitForNewConnection(5000)); - m_socket = m_server->nextPendingConnection(); + m_socket.reset(m_server->nextPendingConnection()); QVERIFY(m_socket); } void ValgrindMemcheckParserTest::cleanup() { - if (m_socket) { - delete m_socket; - m_socket = nullptr; - } + m_socket.reset(); if (m_process) { delete m_process; m_process = nullptr; @@ -257,7 +253,8 @@ void ValgrindMemcheckParserTest::testHelgrindSample1() Parser parser; Recorder rec(&parser); - parser.parse(m_socket); + parser.setIODevice(m_socket.release()); + parser.start(); m_process->waitForFinished(); QCOMPARE(m_process->exitStatus(), QProcess::NormalExit); @@ -331,7 +328,8 @@ void ValgrindMemcheckParserTest::testMemcheckSample1() Parser parser; Recorder rec(&parser); - parser.parse(m_socket); + parser.setIODevice(m_socket.release()); + parser.start(); m_process->waitForFinished(); QCOMPARE(m_process->exitStatus(), QProcess::NormalExit); @@ -364,7 +362,8 @@ void ValgrindMemcheckParserTest::testMemcheckSample2() Parser parser; Recorder rec(&parser); - parser.parse(m_socket); + parser.setIODevice(m_socket.release()); + parser.start(); m_process->waitForFinished(); QCOMPARE(m_process->exitStatus(), QProcess::NormalExit); @@ -392,7 +391,8 @@ void ValgrindMemcheckParserTest::testMemcheckSample3() Parser parser; Recorder rec(&parser); - parser.parse(m_socket); + parser.setIODevice(m_socket.release()); + parser.start(); m_process->waitForFinished(); QCOMPARE(m_process->exitStatus(), QProcess::NormalExit); @@ -447,7 +447,8 @@ void ValgrindMemcheckParserTest::testMemcheckCharm() Parser parser; Recorder rec(&parser); - parser.parse(m_socket); + parser.setIODevice(m_socket.release()); + parser.start(); m_process->waitForFinished(); QCOMPARE(m_process->exitStatus(), QProcess::NormalExit); @@ -463,14 +464,13 @@ void ValgrindMemcheckParserTest::testValgrindCrash() initTest(dataFile("memcheck-output-sample1.xml"), QStringList("--crash")); Parser parser; - parser.parse(m_socket); + parser.setIODevice(m_socket.release()); + parser.start(); m_process->waitForFinished(); QCOMPARE(m_process->state(), QProcess::NotRunning); QCOMPARE(m_process->exitStatus(), QProcess::CrashExit); QVERIFY(!parser.errorString().isEmpty()); - QCOMPARE(m_socket->error(), QAbstractSocket::RemoteHostClosedError); - QCOMPARE(parser.errorString(), m_socket->errorString()); } void ValgrindMemcheckParserTest::testValgrindGarbage() @@ -478,7 +478,8 @@ void ValgrindMemcheckParserTest::testValgrindGarbage() initTest(dataFile("memcheck-output-sample1.xml"), QStringList("--garbage")); Parser parser; - parser.parse(m_socket); + parser.setIODevice(m_socket.release()); + parser.start(); m_process->waitForFinished(); QCOMPARE(m_process->state(), QProcess::NotRunning); QCOMPARE(m_process->exitStatus(), QProcess::NormalExit); diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.h b/src/plugins/valgrind/valgrindmemcheckparsertest.h index 76575349185..f2f2bb0073c 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.h +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.h @@ -5,11 +5,11 @@ #include <QObject> #include <QStringList> +#include <QTcpSocket> QT_BEGIN_NAMESPACE class QProcess; class QTcpServer; -class QTcpSocket; QT_END_NAMESPACE namespace Valgrind::Test { @@ -41,7 +41,7 @@ private: QTcpServer *m_server = nullptr; QProcess *m_process = nullptr; - QTcpSocket *m_socket = nullptr; + std::unique_ptr<QTcpSocket> m_socket; }; } // namespace Valgrind::Test diff --git a/src/plugins/valgrind/xmlprotocol/parser.cpp b/src/plugins/valgrind/xmlprotocol/parser.cpp index 790a383d69c..36d0ba24971 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.cpp +++ b/src/plugins/valgrind/xmlprotocol/parser.cpp @@ -56,8 +56,7 @@ namespace { } // namespace anon -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { enum class Tool { Unknown, @@ -82,8 +81,9 @@ class Parser::Private public: explicit Private(Parser *qq); - void parse(QIODevice *device); + void start(); QString errorString; + std::unique_ptr<QIODevice> m_device; private: void parseError(); @@ -108,8 +108,6 @@ private: Tool tool = Tool::Unknown; QXmlStreamReader reader; - -private: Parser *const q; }; @@ -608,10 +606,9 @@ Suppression Parser::Private::parseSuppression() return supp; } -void Parser::Private::parse(QIODevice *device) +void Parser::Private::start() { - QTC_ASSERT(device, return); - reader.setDevice(device); + reader.setDevice(m_device.get()); errorString.clear(); bool success = true; @@ -660,10 +657,17 @@ QString Parser::errorString() const return d->errorString; } -void Parser::parse(QIODevice *device) +void Parser::setIODevice(QIODevice *device) { - d->parse(device); + QTC_ASSERT(device, return); + QTC_ASSERT(device->isOpen(), return); + d->m_device.reset(device); } -} // namespace XmlParser -} // namespace Valgrind +void Parser::start() +{ + QTC_ASSERT(d->m_device, return); + d->start(); +} + +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/parser.h b/src/plugins/valgrind/xmlprotocol/parser.h index b38d9058953..21f7e5957bc 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.h +++ b/src/plugins/valgrind/xmlprotocol/parser.h @@ -9,8 +9,7 @@ QT_BEGIN_NAMESPACE class QIODevice; QT_END_NAMESPACE -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class AnnounceThread; class Error; @@ -28,14 +27,16 @@ public: ~Parser() override; QString errorString() const; - void parse(QIODevice *stream); + // The passed device needs to be open. The parser takes ownership of the passed device. + void setIODevice(QIODevice *device); + void start(); signals: - void status(const Valgrind::XmlProtocol::Status &status); - void error(const Valgrind::XmlProtocol::Error &error); + void status(const Status &status); + void error(const Error &error); void errorCount(qint64 unique, qint64 count); void suppressionCount(const QString &name, qint64 count); - void announceThread(const Valgrind::XmlProtocol::AnnounceThread &announceThread); + void announceThread(const AnnounceThread &announceThread); void done(bool success, const QString &errorString); private: @@ -43,5 +44,4 @@ private: Private *const d; }; -} // XmlProtocol -} // Valgrind +} // Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp index 561535a6292..5df623aa2b8 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp @@ -21,15 +21,12 @@ public: void run() override { QTC_ASSERT(QThread::currentThread() == this, return); - m_parser->parse(m_device); + m_parser->start(); delete m_parser; m_parser = nullptr; - delete m_device; - m_device = nullptr; } - Valgrind::XmlProtocol::Parser *m_parser = nullptr; - QIODevice *m_device = nullptr; + Parser *m_parser = nullptr; }; ThreadedParser::ThreadedParser(QObject *parent) @@ -64,8 +61,8 @@ void ThreadedParser::start() connect(m_parserThread.get(), &QThread::finished, m_parserThread.get(), &QObject::deleteLater); m_device->setParent(nullptr); m_device->moveToThread(m_parserThread); + parser->setIODevice(m_device.release()); parser->moveToThread(m_parserThread); - m_parserThread->m_device = m_device.release(); m_parserThread->m_parser = parser; m_parserThread->start(); } From 8ac37d3df49b0cd8da2c63a1ddbe0ca493369d5f Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 9 Aug 2023 13:41:06 +0200 Subject: [PATCH 0661/1777] Qt: Fix slow options page For remote devices, reading and parsing all the information of a qt version, can take a long time. This patch delays the read until the user actually opens the details widget. Change-Id: I7bd34d05acc8d01f17609996e84630f958091b3a Reviewed-by: hjk <hjk@qt.io> --- src/plugins/qtsupport/qtoptionspage.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 2a7c3069001..322de3ba480 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -436,7 +436,15 @@ void QtOptionsPageWidget::toolChainsUpdated() void QtOptionsPageWidget::setInfoWidgetVisibility() { - m_versionInfoWidget->setVisible(m_infoWidget->state() == DetailsWidget::Collapsed); + bool isExpanded = m_infoWidget->state() == DetailsWidget::Expanded; + if (isExpanded && m_infoBrowser->toPlainText().isEmpty()) { + QtVersionItem *item = currentItem(); + const QtVersion *version = item ? item->version() : nullptr; + if (version) + m_infoBrowser->setHtml(version->toHtml(true)); + } + + m_versionInfoWidget->setVisible(!isExpanded); m_infoWidget->setVisible(true); } @@ -755,11 +763,10 @@ void QtOptionsPageWidget::updateDescriptionLabel() if (item) item->setIcon(info.icon); + m_infoBrowser->clear(); if (version) { - m_infoBrowser->setHtml(version->toHtml(true)); setInfoWidgetVisibility(); } else { - m_infoBrowser->clear(); m_versionInfoWidget->setVisible(false); m_infoWidget->setVisible(false); } From cf0cf0fa9bd50fc27b8a145dd07f37dc6deafb86 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 9 Aug 2023 15:24:02 +0200 Subject: [PATCH 0662/1777] Debugger: Make DebuggerItemManager a namespace It had only static functions left. Change-Id: If0c76373a8428ae7015017b4644e3f974e14a36e Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/debugger/debuggeritem.h | 3 - src/plugins/debugger/debuggeritemmanager.cpp | 162 ++++++++----------- src/plugins/debugger/debuggeritemmanager.h | 36 ++--- src/plugins/debugger/debuggerplugin.cpp | 8 +- 4 files changed, 85 insertions(+), 124 deletions(-) diff --git a/src/plugins/debugger/debuggeritem.h b/src/plugins/debugger/debuggeritem.h index 95993665b67..7341f759357 100644 --- a/src/plugins/debugger/debuggeritem.h +++ b/src/plugins/debugger/debuggeritem.h @@ -17,8 +17,6 @@ namespace Debugger { -class DebuggerItemManager; - namespace Internal { class DebuggerConfigWidget; class DebuggerItemConfigWidget; @@ -107,7 +105,6 @@ private: friend class Internal::DebuggerConfigWidget; friend class Internal::DebuggerItemConfigWidget; friend class Internal::DebuggerItemModel; - friend class DebuggerItemManager; }; } // namespace Debugger diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index 62c58e5abc6..dccc18290e7 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -56,32 +56,10 @@ const char DEBUGGER_FILE_VERSION_KEY[] = "Version"; const char DEBUGGER_FILENAME[] = "debuggers.xml"; const char debuggingToolsWikiLinkC[] = "http://wiki.qt.io/Qt_Creator_Windows_Debugging"; -class DebuggerItemModel; - -class DebuggerItemManagerPrivate +static FilePath userSettingsFileName() { -public: - DebuggerItemManagerPrivate(); - ~DebuggerItemManagerPrivate(); - - void restoreDebuggers(); - void saveDebuggers(); - - void addDebugger(const DebuggerItem &item); - QVariant registerDebugger(const DebuggerItem &item); - void readDebuggers(const FilePath &fileName, bool isSystem); - void autoDetectCdbDebuggers(); - void autoDetectGdbOrLldbDebuggers(const FilePaths &searchPaths, - const QString &detectionSource, - QString *logMessage = nullptr); - void autoDetectUvscDebuggers(); - QString uniqueDisplayName(const QString &base); - - PersistentSettingsWriter m_writer; - DebuggerItemModel *m_model = nullptr; -}; - -static DebuggerItemManagerPrivate *d = nullptr; + return ICore::userResourcePath(DEBUGGER_FILENAME); +} // ----------------------------------------------------------------------- // DebuggerItemConfigWidget @@ -177,19 +155,39 @@ public: QModelIndex lastIndex() const; void setCurrentIndex(const QModelIndex &index); - DebuggerTreeItem *addDebugger(const DebuggerItem &item, bool changed = false); + DebuggerTreeItem *addDebuggerItem(const DebuggerItem &item, bool changed = false); void updateDebugger(const DebuggerItem &item); void apply(); void cancel(); DebuggerTreeItem *currentTreeItem(); + void restoreDebuggers(); + void saveDebuggers(); + + void addDebugger(const DebuggerItem &item); + QVariant registerDebugger(const DebuggerItem &item); + void readDebuggers(const FilePath &fileName, bool isSystem); + void autoDetectCdbDebuggers(); + void autoDetectGdbOrLldbDebuggers(const FilePaths &searchPaths, + const QString &detectionSource, + QString *logMessage = nullptr); + void autoDetectUvscDebuggers(); + QString uniqueDisplayName(const QString &base); + + PersistentSettingsWriter m_writer{userSettingsFileName(), "QtCreatorDebuggers"}; QPersistentModelIndex m_currentIndex; }; +static DebuggerItemModel &itemModel() +{ + static DebuggerItemModel theModel; + return theModel; +} + template <typename Predicate> void forAllDebuggers(const Predicate &pred) { - d->m_model->forItemsAtLevel<2>([pred](DebuggerTreeItem *titem) { + itemModel().forItemsAtLevel<2>([pred](DebuggerTreeItem *titem) { pred(titem->m_item); }); } @@ -197,7 +195,7 @@ void forAllDebuggers(const Predicate &pred) template <typename Predicate> const DebuggerItem *findDebugger(const Predicate &pred) { - DebuggerTreeItem *titem = d->m_model->findItemAtLevel<2>([pred](DebuggerTreeItem *titem) { + DebuggerTreeItem *titem = itemModel().findItemAtLevel<2>([pred](DebuggerTreeItem *titem) { return pred(titem->m_item); }); return titem ? &titem->m_item : nullptr; @@ -231,9 +229,12 @@ DebuggerItemModel::DebuggerItemModel() genericLldb.setCommand("lldb"); genericLldb.setUnexpandedDisplayName(Tr::tr("LLDB from PATH on Build Device")); generic->appendChild(new DebuggerTreeItem(genericLldb, false)); + + connect(ICore::instance(), &ICore::saveSettingsRequested, + this, &DebuggerItemModel::saveDebuggers); } -DebuggerTreeItem *DebuggerItemModel::addDebugger(const DebuggerItem &item, bool changed) +DebuggerTreeItem *DebuggerItemModel::addDebuggerItem(const DebuggerItem &item, bool changed) { QTC_ASSERT(item.id().isValid(), return {}); int group = item.isGeneric() ? Generic : (item.isAutoDetected() ? AutoDetected : Manual); @@ -410,7 +411,7 @@ DebuggerItem DebuggerItemConfigWidget::item() const void DebuggerItemConfigWidget::store() const { if (!m_id.isNull()) - d->m_model->updateDebugger(item()); + itemModel().updateDebugger(item()); } void DebuggerItemConfigWidget::setAbis(const QStringList &abiNames) @@ -492,7 +493,7 @@ void DebuggerItemConfigWidget::binaryPathHasChanged() store(); } -void DebuggerItemManagerPrivate::autoDetectCdbDebuggers() +void DebuggerItemModel::autoDetectCdbDebuggers() { FilePaths cdbs; @@ -563,7 +564,7 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers() item.setEngineType(CdbEngineType); item.setUnexpandedDisplayName(uniqueDisplayName(Tr::tr("Auto-detected CDB at %1").arg(cdb.toUserOutput()))); item.reinitializeFromFile(); // collect version number - m_model->addDebugger(item); + addDebuggerItem(item); } } @@ -599,7 +600,7 @@ static Utils::FilePaths searchGdbPathsFromRegistry() return searchPaths; } -void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePaths &searchPaths, +void DebuggerItemModel::autoDetectGdbOrLldbDebuggers(const FilePaths &searchPaths, const QString &detectionSource, QString *logMessage) { @@ -646,7 +647,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePaths &s const auto commandMatches = [command](const DebuggerTreeItem *titem) { return titem->m_item.command() == command; }; - if (DebuggerTreeItem *existingItem = m_model->findItemAtLevel<2>(commandMatches)) { + if (DebuggerTreeItem *existingItem = findItemAtLevel<2>(commandMatches)) { if (command.lastModified() != existingItem->m_item.lastModified()) existingItem->m_item.reinitializeFromFile(); continue; @@ -662,14 +663,14 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePaths &s //: %1: Debugger engine type (GDB, LLDB, CDB...), %2: Path const QString name = detectionSource.isEmpty() ? Tr::tr("System %1 at %2") : Tr::tr("Detected %1 at %2"); item.setUnexpandedDisplayName(name.arg(item.engineTypeName()).arg(command.toUserOutput())); - m_model->addDebugger(item); + addDebuggerItem(item); logMessages.append(Tr::tr("Found: \"%1\"").arg(command.toUserOutput())); if (item.engineType() == GdbEngineType) { if (item.version().startsWith("GNU gdb (GDB) 14.0.50.2023")) { // FIXME: Use something more robust item.setEngineType(DapEngineType); - m_model->addDebugger(item); + addDebuggerItem(item); } } } @@ -677,7 +678,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePaths &s *logMessage = logMessages.join('\n'); } -void DebuggerItemManagerPrivate::autoDetectUvscDebuggers() +void DebuggerItemModel::autoDetectUvscDebuggers() { if (!HostOsInfo::isWindowsHost()) return; @@ -714,28 +715,11 @@ void DebuggerItemManagerPrivate::autoDetectUvscDebuggers() item.setUnexpandedDisplayName( uniqueDisplayName(Tr::tr("Auto-detected uVision at %1") .arg(uVision.toUserOutput()))); - m_model->addDebugger(item); + addDebuggerItem(item); } } -static FilePath userSettingsFileName() -{ - return ICore::userResourcePath(DEBUGGER_FILENAME); -} - -DebuggerItemManagerPrivate::DebuggerItemManagerPrivate() - : m_writer(userSettingsFileName(), "QtCreatorDebuggers") -{ - d = this; - m_model = new DebuggerItemModel; -} - -DebuggerItemManagerPrivate::~DebuggerItemManagerPrivate() -{ - delete m_model; -} - -QString DebuggerItemManagerPrivate::uniqueDisplayName(const QString &base) +QString DebuggerItemModel::uniqueDisplayName(const QString &base) { const DebuggerItem *item = findDebugger([base](const DebuggerItem &item) { return item.unexpandedDisplayName() == base; @@ -743,10 +727,10 @@ QString DebuggerItemManagerPrivate::uniqueDisplayName(const QString &base) return item ? uniqueDisplayName(base + " (1)") : base; } -QVariant DebuggerItemManagerPrivate::registerDebugger(const DebuggerItem &item) +QVariant DebuggerItemModel::registerDebugger(const DebuggerItem &item) { // Try re-using existing item first. - DebuggerTreeItem *titem = m_model->findItemAtLevel<2>([item](DebuggerTreeItem *titem) { + DebuggerTreeItem *titem = findItemAtLevel<2>([item](DebuggerTreeItem *titem) { const DebuggerItem &d = titem->m_item; return d.command() == item.command() && d.isAutoDetected() == item.isAutoDetected() @@ -762,11 +746,11 @@ QVariant DebuggerItemManagerPrivate::registerDebugger(const DebuggerItem &item) if (!di.id().isValid()) di.createId(); - m_model->addDebugger(di); + addDebuggerItem(di); return di.id(); } -void DebuggerItemManagerPrivate::readDebuggers(const FilePath &fileName, bool isSystem) +void DebuggerItemModel::readDebuggers(const FilePath &fileName, bool isSystem) { PersistentSettingsReader reader; if (!reader.load(fileName)) @@ -809,7 +793,7 @@ void DebuggerItemManagerPrivate::readDebuggers(const FilePath &fileName, bool is } } -void DebuggerItemManagerPrivate::restoreDebuggers() +void DebuggerItemModel::restoreDebuggers() { // Read debuggers from SDK readDebuggers(ICore::installerResourcePath(DEBUGGER_FILENAME), true); @@ -825,7 +809,7 @@ void DebuggerItemManagerPrivate::restoreDebuggers() autoDetectUvscDebuggers(); } -void DebuggerItemManagerPrivate::saveDebuggers() +void DebuggerItemModel::saveDebuggers() { QVariantMap data; data.insert(DEBUGGER_FILE_VERSION_KEY, 1); @@ -854,21 +838,9 @@ void DebuggerItemManagerPrivate::saveDebuggers() // DebuggerItemManager // -------------------------------------------------------------------------- -DebuggerItemManager::DebuggerItemManager() -{ - new DebuggerItemManagerPrivate; - QObject::connect(ICore::instance(), &ICore::saveSettingsRequested, - [] { d->saveDebuggers(); }); -} - -DebuggerItemManager::~DebuggerItemManager() -{ - delete d; -} - void DebuggerItemManager::restoreDebuggers() { - d->restoreDebuggers(); + itemModel().restoreDebuggers(); } const QList<DebuggerItem> DebuggerItemManager::debuggers() @@ -901,14 +873,14 @@ const DebuggerItem *DebuggerItemManager::findByEngineType(DebuggerEngineType eng QVariant DebuggerItemManager::registerDebugger(const DebuggerItem &item) { - return d->registerDebugger(item); + return itemModel().registerDebugger(item); } void DebuggerItemManager::deregisterDebugger(const QVariant &id) { - d->m_model->forItemsAtLevel<2>([id](DebuggerTreeItem *titem) { + itemModel().forItemsAtLevel<2>([id](DebuggerTreeItem *titem) { if (titem->m_item.id() == id) - d->m_model->destroyItem(titem); + itemModel().destroyItem(titem); }); } @@ -916,7 +888,7 @@ void DebuggerItemManager::autoDetectDebuggersForDevice(const FilePaths &searchPa const QString &detectionSource, QString *logMessage) { - d->autoDetectGdbOrLldbDebuggers(searchPaths, detectionSource, logMessage); + itemModel().autoDetectGdbOrLldbDebuggers(searchPaths, detectionSource, logMessage); } void DebuggerItemManager::removeDetectedDebuggers(const QString &detectionSource, @@ -925,7 +897,7 @@ void DebuggerItemManager::removeDetectedDebuggers(const QString &detectionSource QStringList logMessages{Tr::tr("Removing debugger entries...")}; QList<DebuggerTreeItem *> toBeRemoved; - d->m_model->forItemsAtLevel<2>([detectionSource, &toBeRemoved](DebuggerTreeItem *titem) { + itemModel().forItemsAtLevel<2>([detectionSource, &toBeRemoved](DebuggerTreeItem *titem) { if (titem->m_item.detectionSource() == detectionSource) { toBeRemoved.append(titem); return; @@ -937,7 +909,7 @@ void DebuggerItemManager::removeDetectedDebuggers(const QString &detectionSource }); for (DebuggerTreeItem *current : toBeRemoved) { logMessages.append(Tr::tr("Removed \"%1\"").arg(current->m_item.displayName())); - d->m_model->destroyItem(current); + itemModel().destroyItem(current); } if (logMessage) @@ -948,7 +920,7 @@ void DebuggerItemManager::listDetectedDebuggers(const QString &detectionSource, { QTC_ASSERT(logMessage, return); QStringList logMessages{Tr::tr("Debuggers:")}; - d->m_model->forItemsAtLevel<2>([detectionSource, &logMessages](DebuggerTreeItem *titem) { + itemModel().forItemsAtLevel<2>([detectionSource, &logMessages](DebuggerTreeItem *titem) { if (titem->m_item.detectionSource() == detectionSource) logMessages.append(titem->m_item.displayName()); }); @@ -976,7 +948,7 @@ public: m_container->setVisible(false); m_debuggerView = new QTreeView(this); - m_debuggerView->setModel(d->m_model); + m_debuggerView->setModel(&itemModel()); m_debuggerView->setUniformRowHeights(true); m_debuggerView->setSelectionMode(QAbstractItemView::SingleSelection); m_debuggerView->setSelectionBehavior(QAbstractItemView::SelectRows); @@ -1022,12 +994,12 @@ public: void apply() final { m_itemConfigWidget->store(); - d->m_model->apply(); + itemModel().apply(); } void finish() final { - d->m_model->cancel(); + itemModel().cancel(); } void cloneDebugger(); @@ -1046,7 +1018,7 @@ public: void DebuggerSettingsPageWidget::cloneDebugger() { - DebuggerTreeItem *treeItem = d->m_model->currentTreeItem(); + DebuggerTreeItem *treeItem = itemModel().currentTreeItem(); if (!treeItem) return; @@ -1054,13 +1026,13 @@ void DebuggerSettingsPageWidget::cloneDebugger() DebuggerItem newItem; newItem.createId(); newItem.setCommand(item->command()); - newItem.setUnexpandedDisplayName(d->uniqueDisplayName(Tr::tr("Clone of %1").arg(item->displayName()))); + newItem.setUnexpandedDisplayName(itemModel().uniqueDisplayName(Tr::tr("Clone of %1").arg(item->displayName()))); newItem.reinitializeFromFile(); newItem.setAutoDetected(false); newItem.setGeneric(item->isGeneric()); newItem.setEngineType(item->engineType()); - auto addedItem = d->m_model->addDebugger(newItem, true); - m_debuggerView->setCurrentIndex(d->m_model->indexForItem(addedItem)); + auto addedItem = itemModel().addDebuggerItem(newItem, true); + m_debuggerView->setCurrentIndex(itemModel().indexForItem(addedItem)); } void DebuggerSettingsPageWidget::addDebugger() @@ -1068,15 +1040,15 @@ void DebuggerSettingsPageWidget::addDebugger() DebuggerItem item; item.createId(); item.setEngineType(NoEngineType); - item.setUnexpandedDisplayName(d->uniqueDisplayName(Tr::tr("New Debugger"))); + item.setUnexpandedDisplayName(itemModel().uniqueDisplayName(Tr::tr("New Debugger"))); item.setAutoDetected(false); - auto addedItem = d->m_model->addDebugger(item, true); - m_debuggerView->setCurrentIndex(d->m_model->indexForItem(addedItem)); + auto addedItem = itemModel().addDebuggerItem(item, true); + m_debuggerView->setCurrentIndex(itemModel().indexForItem(addedItem)); } void DebuggerSettingsPageWidget::removeDebugger() { - DebuggerTreeItem *treeItem = d->m_model->currentTreeItem(); + DebuggerTreeItem *treeItem = itemModel().currentTreeItem(); QTC_ASSERT(treeItem, return); treeItem->m_removed = !treeItem->m_removed; treeItem->update(); @@ -1085,13 +1057,13 @@ void DebuggerSettingsPageWidget::removeDebugger() void DebuggerSettingsPageWidget::currentDebuggerChanged(const QModelIndex &newCurrent) { - d->m_model->setCurrentIndex(newCurrent); + itemModel().setCurrentIndex(newCurrent); updateButtons(); } void DebuggerSettingsPageWidget::updateButtons() { - DebuggerTreeItem *titem = d->m_model->currentTreeItem(); + DebuggerTreeItem *titem = itemModel().currentTreeItem(); DebuggerItem *item = titem ? &titem->m_item : nullptr; m_itemConfigWidget->load(item); diff --git a/src/plugins/debugger/debuggeritemmanager.h b/src/plugins/debugger/debuggeritemmanager.h index 2fa588414f0..662306a3f31 100644 --- a/src/plugins/debugger/debuggeritemmanager.h +++ b/src/plugins/debugger/debuggeritemmanager.h @@ -14,30 +14,24 @@ namespace Debugger { class DebuggerItem; -class DEBUGGER_EXPORT DebuggerItemManager -{ - Q_DISABLE_COPY_MOVE(DebuggerItemManager) +namespace DebuggerItemManager { -public: - DebuggerItemManager(); - ~DebuggerItemManager(); +DEBUGGER_EXPORT void restoreDebuggers(); - static void restoreDebuggers(); +DEBUGGER_EXPORT const QList<DebuggerItem> debuggers(); - static const QList<DebuggerItem> debuggers(); +DEBUGGER_EXPORT QVariant registerDebugger(const DebuggerItem &item); +DEBUGGER_EXPORT void deregisterDebugger(const QVariant &id); - static QVariant registerDebugger(const DebuggerItem &item); - static void deregisterDebugger(const QVariant &id); +DEBUGGER_EXPORT void autoDetectDebuggersForDevice(const Utils::FilePaths &searchPaths, + const QString &detectionSource, + QString *logMessage); +DEBUGGER_EXPORT void removeDetectedDebuggers(const QString &detectionSource, QString *logMessage); +DEBUGGER_EXPORT void listDetectedDebuggers(const QString &detectionSource, QString *logMessage); - static void autoDetectDebuggersForDevice(const Utils::FilePaths &searchPaths, - const QString &detectionSource, - QString *logMessage); - static void removeDetectedDebuggers(const QString &detectionSource, QString *logMessage); - static void listDetectedDebuggers(const QString &detectionSource, QString *logMessage); +DEBUGGER_EXPORT const DebuggerItem *findByCommand(const Utils::FilePath &command); +DEBUGGER_EXPORT const DebuggerItem *findById(const QVariant &id); +DEBUGGER_EXPORT const DebuggerItem *findByEngineType(DebuggerEngineType engineType); - static const DebuggerItem *findByCommand(const Utils::FilePath &command); - static const DebuggerItem *findById(const QVariant &id); - static const DebuggerItem *findByEngineType(DebuggerEngineType engineType); -}; - -} // namespace Debugger +} // DebuggerItemManager +} // Debugger diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index fcd918038be..6523b1675c8 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -681,8 +681,6 @@ public: Console m_console; // ensure Debugger Console is created before settings are taken into account QStringList m_arguments; - DebuggerItemManager m_debuggerItemManager; - QList<IOptionsPage *> m_optionPages; IContext m_debugModeContext; @@ -1772,17 +1770,17 @@ void DebuggerPlugin::autoDetectDebuggersForDevice(const FilePaths &searchPaths, const QString &detectionSource, QString *logMessage) { - dd->m_debuggerItemManager.autoDetectDebuggersForDevice(searchPaths, detectionSource, logMessage); + DebuggerItemManager::autoDetectDebuggersForDevice(searchPaths, detectionSource, logMessage); } void DebuggerPlugin::removeDetectedDebuggers(const QString &detectionSource, QString *logMessage) { - dd->m_debuggerItemManager.removeDetectedDebuggers(detectionSource, logMessage); + DebuggerItemManager::removeDetectedDebuggers(detectionSource, logMessage); } void DebuggerPlugin::listDetectedDebuggers(const QString &detectionSource, QString *logMessage) { - dd->m_debuggerItemManager.listDetectedDebuggers(detectionSource, logMessage); + DebuggerItemManager::listDetectedDebuggers(detectionSource, logMessage); } void DebuggerPluginPrivate::attachToQmlPort() From 0e4710b70853067cca222face6cfb329bae47326 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 9 Aug 2023 17:15:19 +0200 Subject: [PATCH 0663/1777] BareMetal: Move some code from *.h to *.cpp Change-Id: I4acedd7ca6c27e371fe2c651e0d769591bed99ff Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../baremetal/debugserverprovidermanager.h | 2 +- .../gdb/eblinkgdbserverprovider.cpp | 89 +++++++++++-- .../gdb/eblinkgdbserverprovider.h | 90 +------------ .../gdb/genericgdbserverprovider.cpp | 38 ++++++ .../gdb/genericgdbserverprovider.h | 46 ------- .../gdb/jlinkgdbserverprovider.cpp | 76 +++++++++++ .../debugservers/gdb/jlinkgdbserverprovider.h | 88 +------------ .../gdb/openocdgdbserverprovider.cpp | 55 ++++++++ .../gdb/openocdgdbserverprovider.h | 66 +--------- .../gdb/stlinkutilgdbserverprovider.cpp | 82 ++++++++++-- .../gdb/stlinkutilgdbserverprovider.h | 77 +----------- .../uvsc/jlinkuvscserverprovider.cpp | 118 +++++++++++++++--- .../uvsc/jlinkuvscserverprovider.h | 91 -------------- .../uvsc/stlinkuvscserverprovider.cpp | 92 +++++++++++++- .../uvsc/stlinkuvscserverprovider.h | 94 -------------- 15 files changed, 516 insertions(+), 588 deletions(-) diff --git a/src/plugins/baremetal/debugserverprovidermanager.h b/src/plugins/baremetal/debugserverprovidermanager.h index 9e8661590e9..08a9d3b51d6 100644 --- a/src/plugins/baremetal/debugserverprovidermanager.h +++ b/src/plugins/baremetal/debugserverprovidermanager.h @@ -6,7 +6,7 @@ #include <QList> #include <QObject> -#include <utils/fileutils.h> +#include <utils/filepath.h> namespace Utils { class PersistentSettingsWriter; } diff --git a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp index b8071ce3a86..202ddcd77c9 100644 --- a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp @@ -34,8 +34,81 @@ const char targetDisableStackC[] = "TargetDisableStack"; const char gdbShutDownAfterDisconnectC[] = "GdbShutDownAfterDisconnect"; const char gdbNotUseCacheC[] = "GdbNotUseCache"; +enum InterfaceType { SWD, JTAG }; + +// EBlinkGdbServerProviderWidget + +class EBlinkGdbServerProvider; + +class EBlinkGdbServerProviderConfigWidget final : public GdbServerProviderConfigWidget +{ +public: + explicit EBlinkGdbServerProviderConfigWidget(EBlinkGdbServerProvider *provider); + +private: + void apply() final; + void discard() final; + + InterfaceType interfaceTypeToWidget(int idx) const; + InterfaceType interfaceTypeFromWidget() const; + + void populateInterfaceTypes(); + void setFromProvider(); + + HostWidget *m_gdbHostWidget = nullptr; + PathChooser *m_executableFileChooser = nullptr; + QSpinBox *m_verboseLevelSpinBox = nullptr; + QCheckBox *m_resetOnConnectCheckBox = nullptr; + QCheckBox *m_notUseCacheCheckBox = nullptr; + QCheckBox *m_shutDownAfterDisconnectCheckBox = nullptr; + QComboBox *m_interfaceTypeComboBox = nullptr; + //QLineEdit *m_deviceScriptLineEdit = nullptr; + PathChooser *m_scriptFileChooser = nullptr; + QSpinBox *m_interfaceSpeedSpinBox = nullptr; + QPlainTextEdit *m_initCommandsTextEdit = nullptr; + QPlainTextEdit *m_resetCommandsTextEdit = nullptr; +}; + // EBlinkGdbServerProvider +class EBlinkGdbServerProvider final : public GdbServerProvider +{ +public: + void toMap(QVariantMap &data) const final; + void fromMap(const QVariantMap &data) final; + + bool operator==(const IDebugServerProvider &other) const final; + + QString channelString() const final; + Utils::CommandLine command() const final; + + QSet<StartupMode> supportedStartupModes() const final; + bool isValid() const final; + +private: + EBlinkGdbServerProvider(); + + static QString defaultInitCommands(); + static QString defaultResetCommands(); + + Utils::FilePath m_executableFile = "eblink"; // server execute filename + int m_verboseLevel = 0; // verbose <0..7> Specify generally verbose logging + InterfaceType m_interfaceType = SWD; // -I stlink ;swd(default) jtag + Utils::FilePath m_deviceScript = "stm32-auto.script"; // -D <script> ;Select the device script <>.script + bool m_interfaceResetOnConnect = true; // (inversed)-I stlink,dr ;Disable reset at connection (hotplug) + int m_interfaceSpeed = 4000; // -I stlink,speed=4000 + QString m_interfaceExplicidDevice; // device=<usb_bus>:<usb_addr> ; Set device explicit + QString m_targetName = {"cortex-m"}; // -T cortex-m(default) + bool m_targetDisableStack = false; // -T cortex-m,nu ;Disable stack unwind at exception + bool m_gdbShutDownAfterDisconnect = true;// -G S ; Shutdown after disconnect + bool m_gdbNotUseCache = false; // -G nc ; Don't use EBlink flash cache + + QString scriptFileWoExt() const; + + friend class EBlinkGdbServerProviderConfigWidget; + friend class EBlinkGdbServerProviderFactory; +}; + EBlinkGdbServerProvider::EBlinkGdbServerProvider() : GdbServerProvider(Constants::GDBSERVER_EBLINK_PROVIDER_ID) { @@ -205,6 +278,7 @@ EBlinkGdbServerProviderFactory::EBlinkGdbServerProviderFactory() // EBlinkGdbServerProviderConfigWidget + EBlinkGdbServerProviderConfigWidget::EBlinkGdbServerProviderConfigWidget( EBlinkGdbServerProvider *p) : GdbServerProviderConfigWidget(p) @@ -291,26 +365,21 @@ EBlinkGdbServerProviderConfigWidget::EBlinkGdbServerProviderConfigWidget( this, &GdbServerProviderConfigWidget::dirty); } -EBlinkGdbServerProvider::InterfaceType -EBlinkGdbServerProviderConfigWidget::interfaceTypeToWidget(int idx) const +InterfaceType EBlinkGdbServerProviderConfigWidget::interfaceTypeToWidget(int idx) const { m_interfaceTypeComboBox->setCurrentIndex(idx); return interfaceTypeFromWidget(); } -EBlinkGdbServerProvider::InterfaceType -EBlinkGdbServerProviderConfigWidget::interfaceTypeFromWidget() const +InterfaceType EBlinkGdbServerProviderConfigWidget::interfaceTypeFromWidget() const { - return static_cast<EBlinkGdbServerProvider::InterfaceType>( - m_interfaceTypeComboBox->currentIndex()); + return static_cast<InterfaceType>(m_interfaceTypeComboBox->currentIndex()); } void EBlinkGdbServerProviderConfigWidget::populateInterfaceTypes() { - m_interfaceTypeComboBox->insertItem(EBlinkGdbServerProvider::SWD, Tr::tr("SWD"), - EBlinkGdbServerProvider::SWD); - m_interfaceTypeComboBox->insertItem(EBlinkGdbServerProvider::JTAG, Tr::tr("JTAG"), - EBlinkGdbServerProvider::JTAG); + m_interfaceTypeComboBox->insertItem(SWD, Tr::tr("SWD"), SWD); + m_interfaceTypeComboBox->insertItem(JTAG, Tr::tr("JTAG"), JTAG); } void EBlinkGdbServerProviderConfigWidget::setFromProvider() diff --git a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.h index efc794c8e0b..276f42b9c29 100644 --- a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.h @@ -5,98 +5,12 @@ #include "gdbserverprovider.h" -QT_BEGIN_NAMESPACE -class QCheckBox; -class QPlainTextEdit; -QT_END_NAMESPACE - -namespace Utils { class PathChooser; } - namespace BareMetal::Internal { -// EBlinkGdbServerProvider - -class EBlinkGdbServerProvider final : public GdbServerProvider +class EBlinkGdbServerProviderFactory final : public IDebugServerProviderFactory { public: - enum InterfaceType { SWD, JTAG }; - - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; - - bool operator==(const IDebugServerProvider &other) const final; - - QString channelString() const final; - Utils::CommandLine command() const final; - - QSet<StartupMode> supportedStartupModes() const final; - bool isValid() const final; - -private: - EBlinkGdbServerProvider(); - - static QString defaultInitCommands(); - static QString defaultResetCommands(); - - Utils::FilePath m_executableFile = "eblink"; // server execute filename - int m_verboseLevel = 0; // verbose <0..7> Specify generally verbose logging - InterfaceType m_interfaceType = SWD; // -I stlink ;swd(default) jtag - Utils::FilePath m_deviceScript = "stm32-auto.script"; // -D <script> ;Select the device script <>.script - bool m_interfaceResetOnConnect = true; // (inversed)-I stlink,dr ;Disable reset at connection (hotplug) - int m_interfaceSpeed = 4000; // -I stlink,speed=4000 - QString m_interfaceExplicidDevice; // device=<usb_bus>:<usb_addr> ; Set device explicit - QString m_targetName = {"cortex-m"}; // -T cortex-m(default) - bool m_targetDisableStack = false; // -T cortex-m,nu ;Disable stack unwind at exception - bool m_gdbShutDownAfterDisconnect = true;// -G S ; Shutdown after disconnect - bool m_gdbNotUseCache = false; // -G nc ; Don't use EBlink flash cache - - QString scriptFileWoExt() const; - - friend class EBlinkGdbServerProviderConfigWidget; - friend class EBlinkGdbServerProviderFactory; -}; - -// EBlinkGdbServerProviderFactory - -class EBlinkGdbServerProviderFactory final - : public IDebugServerProviderFactory -{ -public: - explicit EBlinkGdbServerProviderFactory(); -}; - -// EBlinkGdbServerProviderConfigWidget - -class EBlinkGdbServerProviderConfigWidget final - : public GdbServerProviderConfigWidget -{ -public: - explicit EBlinkGdbServerProviderConfigWidget( - EBlinkGdbServerProvider *provider); - -private: - void apply() final; - void discard() final; - - EBlinkGdbServerProvider::InterfaceType interfaceTypeToWidget(int idx) const; - EBlinkGdbServerProvider::InterfaceType interfaceTypeFromWidget() const; - - void populateInterfaceTypes(); - void setFromProvider(); - - HostWidget *m_gdbHostWidget = nullptr; - Utils::PathChooser *m_executableFileChooser = nullptr; - QSpinBox *m_verboseLevelSpinBox = nullptr; - QCheckBox *m_resetOnConnectCheckBox = nullptr; - QCheckBox *m_notUseCacheCheckBox = nullptr; - QCheckBox *m_shutDownAfterDisconnectCheckBox = nullptr; - QComboBox *m_interfaceTypeComboBox = nullptr; - //QLineEdit *m_deviceScriptLineEdit = nullptr; - Utils::PathChooser *m_scriptFileChooser = nullptr; - QSpinBox *m_interfaceSpeedSpinBox = nullptr; - QPlainTextEdit *m_initCommandsTextEdit = nullptr; - QPlainTextEdit *m_resetCommandsTextEdit = nullptr; + EBlinkGdbServerProviderFactory(); }; } // BareMetal::Internal - diff --git a/src/plugins/baremetal/debugservers/gdb/genericgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/genericgdbserverprovider.cpp index 418de9b2016..b882cf6ec22 100644 --- a/src/plugins/baremetal/debugservers/gdb/genericgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/genericgdbserverprovider.cpp @@ -16,8 +16,46 @@ namespace BareMetal::Internal { +// GenericGdbServerProviderConfigWidget + +class GenericGdbServerProvider; + +class GenericGdbServerProviderConfigWidget final : public GdbServerProviderConfigWidget +{ +public: + explicit GenericGdbServerProviderConfigWidget(GenericGdbServerProvider *provider); + +private: + void apply() final; + void discard() final; + + void setFromProvider(); + + HostWidget *m_hostWidget = nullptr; + QCheckBox *m_useExtendedRemoteCheckBox = nullptr; + QPlainTextEdit *m_initCommandsTextEdit = nullptr; + QPlainTextEdit *m_resetCommandsTextEdit = nullptr; +}; + // GenericGdbServerProvider +class GenericGdbServerProvider final : public GdbServerProvider +{ +private: + GenericGdbServerProvider(); + QSet<StartupMode> supportedStartupModes() const final; + ProjectExplorer::RunWorker *targetRunner(ProjectExplorer::RunControl *runControl) const final { + Q_UNUSED(runControl) + // Generic Runner assumes GDB Server already running + return nullptr; + } + + friend class GenericGdbServerProviderConfigWidget; + friend class GenericGdbServerProviderFactory; +}; + +// GenericGdbServerProviderFactory + GenericGdbServerProvider::GenericGdbServerProvider() : GdbServerProvider(Constants::GDBSERVER_GENERIC_PROVIDER_ID) { diff --git a/src/plugins/baremetal/debugservers/gdb/genericgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/genericgdbserverprovider.h index 98ca17451c1..e44122c2007 100644 --- a/src/plugins/baremetal/debugservers/gdb/genericgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/genericgdbserverprovider.h @@ -5,58 +5,12 @@ #include "gdbserverprovider.h" -QT_BEGIN_NAMESPACE -class QCheckBox; -class QPlainTextEdit; -QT_END_NAMESPACE - namespace BareMetal::Internal { -// GenericGdbServerProvider - -class GenericGdbServerProvider final : public GdbServerProvider -{ -private: - GenericGdbServerProvider(); - QSet<StartupMode> supportedStartupModes() const final; - ProjectExplorer::RunWorker *targetRunner(ProjectExplorer::RunControl *runControl) const final { - Q_UNUSED(runControl) - // Generic Runner assumes GDB Server already running - return nullptr; - } - - friend class GenericGdbServerProviderConfigWidget; - friend class GenericGdbServerProviderFactory; - friend class BareMetalDevice; -}; - -// GenericGdbServerProviderFactory - class GenericGdbServerProviderFactory final : public IDebugServerProviderFactory { public: GenericGdbServerProviderFactory(); }; -// GenericGdbServerProviderConfigWidget - -class GenericGdbServerProviderConfigWidget final - : public GdbServerProviderConfigWidget -{ -public: - explicit GenericGdbServerProviderConfigWidget( - GenericGdbServerProvider *provider); - -private: - void apply() final; - void discard() final; - - void setFromProvider(); - - HostWidget *m_hostWidget = nullptr; - QCheckBox *m_useExtendedRemoteCheckBox = nullptr; - QPlainTextEdit *m_initCommandsTextEdit = nullptr; - QPlainTextEdit *m_resetCommandsTextEdit = nullptr; -}; - } // BareMetal::Internal diff --git a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp index 9b02e9742f5..e046a8244e6 100644 --- a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp @@ -32,8 +32,84 @@ const char jlinkTargetInterfaceKeyC[] = "JLinkTargetInterface"; const char jlinkTargetInterfaceSpeedKeyC[] = "JLinkTargetInterfaceSpeed"; const char additionalArgumentsKeyC[] = "AdditionalArguments"; +// JLinkGdbServerProviderConfigWidget + +class JLinkGdbServerProvider; + +class JLinkGdbServerProviderConfigWidget final : public GdbServerProviderConfigWidget +{ +public: + explicit JLinkGdbServerProviderConfigWidget(JLinkGdbServerProvider *provider); + +private: + void apply() final; + void discard() final; + + void populateHostInterfaces(); + void populateTargetInterfaces(); + void populateTargetSpeeds(); + + void setHostInterface(const QString &newIface); + void setTargetInterface(const QString &newIface); + void setTargetSpeed(const QString &newSpeed); + + void updateAllowedControls(); + + void setFromProvider(); + + HostWidget *m_hostWidget = nullptr; + PathChooser *m_executableFileChooser = nullptr; + + QWidget *m_hostInterfaceWidget = nullptr; + QComboBox *m_hostInterfaceComboBox = nullptr; + QLabel *m_hostInterfaceAddressLabel = nullptr; + QLineEdit *m_hostInterfaceAddressLineEdit = nullptr; + + QWidget *m_targetInterfaceWidget = nullptr; + QComboBox *m_targetInterfaceComboBox = nullptr; + QLabel *m_targetInterfaceSpeedLabel = nullptr; + QComboBox *m_targetInterfaceSpeedComboBox = nullptr; + + QLineEdit *m_jlinkDeviceLineEdit = nullptr; + QPlainTextEdit *m_additionalArgumentsTextEdit = nullptr; + QPlainTextEdit *m_initCommandsTextEdit = nullptr; + QPlainTextEdit *m_resetCommandsTextEdit = nullptr; +}; + // JLinkGdbServerProvider +class JLinkGdbServerProvider final : public GdbServerProvider +{ +public: + void toMap(QVariantMap &data) const final; + void fromMap(const QVariantMap &data) final; + + bool operator==(const IDebugServerProvider &other) const final; + + QString channelString() const final; + CommandLine command() const final; + + QSet<StartupMode> supportedStartupModes() const final; + bool isValid() const final; + +private: + JLinkGdbServerProvider(); + + static QString defaultInitCommands(); + static QString defaultResetCommands(); + + FilePath m_executableFile; + QString m_jlinkDevice; + QString m_jlinkHost = {"USB"}; + QString m_jlinkHostAddr; + QString m_jlinkTargetIface = {"SWD"}; + QString m_jlinkTargetIfaceSpeed = {"12000"}; + QString m_additionalArguments; + + friend class JLinkGdbServerProviderConfigWidget; + friend class JLinkGdbServerProviderFactory; +}; + JLinkGdbServerProvider::JLinkGdbServerProvider() : GdbServerProvider(Constants::GDBSERVER_JLINK_PROVIDER_ID) { diff --git a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.h index 75d9140a6ee..1b88c2ce07b 100644 --- a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.h @@ -5,98 +5,12 @@ #include "gdbserverprovider.h" -QT_BEGIN_NAMESPACE -class QPlainTextEdit; -QT_END_NAMESPACE - -namespace Utils { class PathChooser; } - namespace BareMetal::Internal { -// JLinkGdbServerProvider - -class JLinkGdbServerProvider final : public GdbServerProvider -{ -public: - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; - - bool operator==(const IDebugServerProvider &other) const final; - - QString channelString() const final; - Utils::CommandLine command() const final; - - QSet<StartupMode> supportedStartupModes() const final; - bool isValid() const final; - -private: - JLinkGdbServerProvider(); - - static QString defaultInitCommands(); - static QString defaultResetCommands(); - - Utils::FilePath m_executableFile; - QString m_jlinkDevice; - QString m_jlinkHost = {"USB"}; - QString m_jlinkHostAddr; - QString m_jlinkTargetIface = {"SWD"}; - QString m_jlinkTargetIfaceSpeed = {"12000"}; - QString m_additionalArguments; - - friend class JLinkGdbServerProviderConfigWidget; - friend class JLinkGdbServerProviderFactory; -}; - -// JLinkGdbServerProviderFactory - -class JLinkGdbServerProviderFactory final - : public IDebugServerProviderFactory +class JLinkGdbServerProviderFactory final : public IDebugServerProviderFactory { public: JLinkGdbServerProviderFactory(); }; -// JLinkGdbServerProviderConfigWidget - -class JLinkGdbServerProviderConfigWidget final - : public GdbServerProviderConfigWidget -{ -public: - explicit JLinkGdbServerProviderConfigWidget(JLinkGdbServerProvider *provider); - -private: - void apply() final; - void discard() final; - - void populateHostInterfaces(); - void populateTargetInterfaces(); - void populateTargetSpeeds(); - - void setHostInterface(const QString &newIface); - void setTargetInterface(const QString &newIface); - void setTargetSpeed(const QString &newSpeed); - - void updateAllowedControls(); - - void setFromProvider(); - - HostWidget *m_hostWidget = nullptr; - Utils::PathChooser *m_executableFileChooser = nullptr; - - QWidget *m_hostInterfaceWidget = nullptr; - QComboBox *m_hostInterfaceComboBox = nullptr; - QLabel *m_hostInterfaceAddressLabel = nullptr; - QLineEdit *m_hostInterfaceAddressLineEdit = nullptr; - - QWidget *m_targetInterfaceWidget = nullptr; - QComboBox *m_targetInterfaceComboBox = nullptr; - QLabel *m_targetInterfaceSpeedLabel = nullptr; - QComboBox *m_targetInterfaceSpeedComboBox = nullptr; - - QLineEdit *m_jlinkDeviceLineEdit = nullptr; - QPlainTextEdit *m_additionalArgumentsTextEdit = nullptr; - QPlainTextEdit *m_initCommandsTextEdit = nullptr; - QPlainTextEdit *m_resetCommandsTextEdit = nullptr; -}; - } // BareMetal::Internal diff --git a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp index 5ff5047c87b..5299ac6121e 100644 --- a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp @@ -27,8 +27,63 @@ const char rootScriptsDirKeyC[] = "RootScriptsDir"; const char configurationFileKeyC[] = "ConfigurationPath"; const char additionalArgumentsKeyC[] = "AdditionalArguments"; +// OpenOcdGdbServerProviderConfigWidget + +class OpenOcdGdbServerProvider; + +class OpenOcdGdbServerProviderConfigWidget final : public GdbServerProviderConfigWidget +{ +public: + explicit OpenOcdGdbServerProviderConfigWidget(OpenOcdGdbServerProvider *provider); + +private: + void apply() final; + void discard() final; + + void startupModeChanged(); + void setFromProvider(); + + HostWidget *m_hostWidget = nullptr; + Utils::PathChooser *m_executableFileChooser = nullptr; + Utils::PathChooser *m_rootScriptsDirChooser = nullptr; + Utils::PathChooser *m_configurationFileChooser = nullptr; + QLineEdit *m_additionalArgumentsLineEdit = nullptr; + QPlainTextEdit *m_initCommandsTextEdit = nullptr; + QPlainTextEdit *m_resetCommandsTextEdit = nullptr; +}; + // OpenOcdGdbServerProvider +class OpenOcdGdbServerProvider final : public GdbServerProvider +{ +public: + void toMap(QVariantMap &data) const final; + void fromMap(const QVariantMap &data) final; + + bool operator==(const IDebugServerProvider &other) const final; + + QString channelString() const final; + Utils::CommandLine command() const final; + + QSet<StartupMode> supportedStartupModes() const final; + bool isValid() const final; + +private: + explicit OpenOcdGdbServerProvider(); + + static QString defaultInitCommands(); + static QString defaultResetCommands(); + + Utils::FilePath m_executableFile = "openocd"; + Utils::FilePath m_rootScriptsDir; + Utils::FilePath m_configurationFile; + QString m_additionalArguments; + + friend class OpenOcdGdbServerProviderConfigWidget; + friend class OpenOcdGdbServerProviderFactory; +}; + + OpenOcdGdbServerProvider::OpenOcdGdbServerProvider() : GdbServerProvider(Constants::GDBSERVER_OPENOCD_PROVIDER_ID) { diff --git a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.h index 49884e4bb14..8c6e89b2cd0 100644 --- a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.h @@ -5,76 +5,12 @@ #include "gdbserverprovider.h" -QT_BEGIN_NAMESPACE -class QPlainTextEdit; -QT_END_NAMESPACE - -namespace Utils { class PathChooser; } - namespace BareMetal::Internal { -// OpenOcdGdbServerProvider - -class OpenOcdGdbServerProvider final : public GdbServerProvider -{ -public: - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; - - bool operator==(const IDebugServerProvider &other) const final; - - QString channelString() const final; - Utils::CommandLine command() const final; - - QSet<StartupMode> supportedStartupModes() const final; - bool isValid() const final; - -private: - explicit OpenOcdGdbServerProvider(); - - static QString defaultInitCommands(); - static QString defaultResetCommands(); - - Utils::FilePath m_executableFile = "openocd"; - Utils::FilePath m_rootScriptsDir; - Utils::FilePath m_configurationFile; - QString m_additionalArguments; - - friend class OpenOcdGdbServerProviderConfigWidget; - friend class OpenOcdGdbServerProviderFactory; -}; - -// OpenOcdGdbServerProviderFactory - -class OpenOcdGdbServerProviderFactory final - : public IDebugServerProviderFactory +class OpenOcdGdbServerProviderFactory final : public IDebugServerProviderFactory { public: OpenOcdGdbServerProviderFactory(); }; -// OpenOcdGdbServerProviderConfigWidget - -class OpenOcdGdbServerProviderConfigWidget final - : public GdbServerProviderConfigWidget -{ -public: - explicit OpenOcdGdbServerProviderConfigWidget(OpenOcdGdbServerProvider *provider); - -private: - void apply() final; - void discard() final; - - void startupModeChanged(); - void setFromProvider(); - - HostWidget *m_hostWidget = nullptr; - Utils::PathChooser *m_executableFileChooser = nullptr; - Utils::PathChooser *m_rootScriptsDirChooser = nullptr; - Utils::PathChooser *m_configurationFileChooser = nullptr; - QLineEdit *m_additionalArgumentsLineEdit = nullptr; - QPlainTextEdit *m_initCommandsTextEdit = nullptr; - QPlainTextEdit *m_resetCommandsTextEdit = nullptr; -}; - } // BareMetal::Internal diff --git a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp index 66e1a67f980..72b5bc3708a 100644 --- a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp @@ -29,8 +29,72 @@ const char resetBoardKeyC[] = "ResetBoard"; const char transportLayerKeyC[] = "TransportLayer"; const char connectUnderResetKeyC[] = "ConnectUnderReset"; +class StLinkUtilGdbServerProvider; + +enum TransportLayer { ScsiOverUsb = 1, RawUsb = 2, UnspecifiedTransport }; + +// StLinkUtilGdbServerProviderConfigWidget + +class StLinkUtilGdbServerProviderConfigWidget final : public GdbServerProviderConfigWidget +{ +public: + explicit StLinkUtilGdbServerProviderConfigWidget(StLinkUtilGdbServerProvider *provider); + +private: + void apply() final; + void discard() final; + + TransportLayer transportLayerFromIndex(int idx) const; + TransportLayer transportLayer() const; + void setTransportLayer(TransportLayer); + + void populateTransportLayers(); + void setFromProvider(); + + HostWidget *m_hostWidget = nullptr; + Utils::PathChooser *m_executableFileChooser = nullptr; + QSpinBox *m_verboseLevelSpinBox = nullptr; + QCheckBox *m_extendedModeCheckBox = nullptr; + QCheckBox *m_resetOnConnectCheckBox = nullptr; + QCheckBox *m_resetBoardCheckBox = nullptr; + QComboBox *m_transportLayerComboBox = nullptr; + QPlainTextEdit *m_initCommandsTextEdit = nullptr; + QPlainTextEdit *m_resetCommandsTextEdit = nullptr; +}; + // StLinkUtilGdbServerProvider +class StLinkUtilGdbServerProvider final : public GdbServerProvider +{ +public: + void toMap(QVariantMap &data) const final; + void fromMap(const QVariantMap &data) final; + + bool operator==(const IDebugServerProvider &other) const final; + + QString channelString() const final; + Utils::CommandLine command() const final; + + QSet<StartupMode> supportedStartupModes() const final; + bool isValid() const final; + +private: + StLinkUtilGdbServerProvider(); + + static QString defaultInitCommands(); + static QString defaultResetCommands(); + + Utils::FilePath m_executableFile = "st-util"; + int m_verboseLevel = 0; // 0..99 + bool m_extendedMode = false; // Listening for connections after disconnect + bool m_resetBoard = true; + bool m_connectUnderReset = false; // Makes it possible to connect to the device before code execution + TransportLayer m_transport = RawUsb; + + friend class StLinkUtilGdbServerProviderConfigWidget; + friend class StLinkUtilGdbServerProviderFactory; +}; + StLinkUtilGdbServerProvider::StLinkUtilGdbServerProvider() : GdbServerProvider(Constants::GDBSERVER_STLINK_UTIL_PROVIDER_ID) { @@ -257,22 +321,18 @@ void StLinkUtilGdbServerProviderConfigWidget::discard() GdbServerProviderConfigWidget::discard(); } -StLinkUtilGdbServerProvider::TransportLayer -StLinkUtilGdbServerProviderConfigWidget::transportLayerFromIndex(int idx) const +TransportLayer StLinkUtilGdbServerProviderConfigWidget::transportLayerFromIndex(int idx) const { - return static_cast<StLinkUtilGdbServerProvider::TransportLayer>( - m_transportLayerComboBox->itemData(idx).toInt()); + return static_cast<TransportLayer>(m_transportLayerComboBox->itemData(idx).toInt()); } -StLinkUtilGdbServerProvider::TransportLayer -StLinkUtilGdbServerProviderConfigWidget::transportLayer() const +TransportLayer StLinkUtilGdbServerProviderConfigWidget::transportLayer() const { const int idx = m_transportLayerComboBox->currentIndex(); return transportLayerFromIndex(idx); } -void StLinkUtilGdbServerProviderConfigWidget::setTransportLayer( - StLinkUtilGdbServerProvider::TransportLayer tl) +void StLinkUtilGdbServerProviderConfigWidget::setTransportLayer(TransportLayer tl) { for (int idx = 0; idx < m_transportLayerComboBox->count(); ++idx) { if (tl == transportLayerFromIndex(idx)) { @@ -286,13 +346,13 @@ void StLinkUtilGdbServerProviderConfigWidget::populateTransportLayers() { m_transportLayerComboBox->insertItem( m_transportLayerComboBox->count(), Tr::tr("ST-LINK/V1"), - StLinkUtilGdbServerProvider::ScsiOverUsb); + ScsiOverUsb); m_transportLayerComboBox->insertItem( m_transportLayerComboBox->count(), Tr::tr("ST-LINK/V2"), - StLinkUtilGdbServerProvider::RawUsb); + RawUsb); m_transportLayerComboBox->insertItem( m_transportLayerComboBox->count(), Tr::tr("Keep unspecified"), - StLinkUtilGdbServerProvider::UnspecifiedTransport); + UnspecifiedTransport); } void StLinkUtilGdbServerProviderConfigWidget::setFromProvider() diff --git a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.h index 82f1bfa6b63..8b96150abc1 100644 --- a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.h @@ -5,87 +5,12 @@ #include "gdbserverprovider.h" -QT_BEGIN_NAMESPACE -class QCheckBox; -class QPlainTextEdit; -QT_END_NAMESPACE - -namespace Utils { class PathChooser; } - namespace BareMetal::Internal { -// StLinkUtilGdbServerProvider - -class StLinkUtilGdbServerProvider final : public GdbServerProvider -{ -public: - enum TransportLayer { ScsiOverUsb = 1, RawUsb = 2, UnspecifiedTransport }; - - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; - - bool operator==(const IDebugServerProvider &other) const final; - - QString channelString() const final; - Utils::CommandLine command() const final; - - QSet<StartupMode> supportedStartupModes() const final; - bool isValid() const final; - -private: - StLinkUtilGdbServerProvider(); - - static QString defaultInitCommands(); - static QString defaultResetCommands(); - - Utils::FilePath m_executableFile = "st-util"; - int m_verboseLevel = 0; // 0..99 - bool m_extendedMode = false; // Listening for connections after disconnect - bool m_resetBoard = true; - bool m_connectUnderReset = false; // Makes it possible to connect to the device before code execution - TransportLayer m_transport = RawUsb; - - friend class StLinkUtilGdbServerProviderConfigWidget; - friend class StLinkUtilGdbServerProviderFactory; -}; - -// StLinkUtilGdbServerProviderFactory - -class StLinkUtilGdbServerProviderFactory final - : public IDebugServerProviderFactory +class StLinkUtilGdbServerProviderFactory final : public IDebugServerProviderFactory { public: StLinkUtilGdbServerProviderFactory(); }; -// StLinkUtilGdbServerProviderConfigWidget - -class StLinkUtilGdbServerProviderConfigWidget final - : public GdbServerProviderConfigWidget -{ -public: - explicit StLinkUtilGdbServerProviderConfigWidget(StLinkUtilGdbServerProvider *provider); - -private: - void apply() final; - void discard() final; - - StLinkUtilGdbServerProvider::TransportLayer transportLayerFromIndex(int idx) const; - StLinkUtilGdbServerProvider::TransportLayer transportLayer() const; - void setTransportLayer(StLinkUtilGdbServerProvider::TransportLayer); - - void populateTransportLayers(); - void setFromProvider(); - - HostWidget *m_hostWidget = nullptr; - Utils::PathChooser *m_executableFileChooser = nullptr; - QSpinBox *m_verboseLevelSpinBox = nullptr; - QCheckBox *m_extendedModeCheckBox = nullptr; - QCheckBox *m_resetOnConnectCheckBox = nullptr; - QCheckBox *m_resetBoardCheckBox = nullptr; - QComboBox *m_transportLayerComboBox = nullptr; - QPlainTextEdit *m_initCommandsTextEdit = nullptr; - QPlainTextEdit *m_resetCommandsTextEdit = nullptr; -}; - } // BareMetal::Internal diff --git a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp index 78b05754481..256f95be986 100644 --- a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp @@ -32,6 +32,24 @@ constexpr char adapterOptionsKeyC[] = "AdapterOptions"; constexpr char adapterPortKeyC[] = "AdapterPort"; constexpr char adapterSpeedKeyC[] = "AdapterSpeed"; +class JLinkUvscAdapterOptions final +{ +public: + enum Port { JTAG, SWD }; + enum Speed { + Speed_50MHz = 50000, Speed_33MHz = 33000, Speed_25MHz = 25000, + Speed_20MHz = 20000, Speed_10MHz = 10000, Speed_5MHz = 5000, + Speed_3MHz = 3000, Speed_2MHz = 2000, Speed_1MHz = 1000, + Speed_500kHz = 500, Speed_200kHz = 200, Speed_100kHz = 100, + }; + Port port = Port::SWD; + Speed speed = Speed::Speed_1MHz; + + QVariantMap toMap() const; + bool fromMap(const QVariantMap &data); + bool operator==(const JLinkUvscAdapterOptions &other) const; +}; + static int decodeSpeedCode(JLinkUvscAdapterOptions::Speed speed) { switch (speed) { @@ -102,6 +120,49 @@ static QString buildDllRegistryName(const DeviceSelection &device, return content; } +// JLinkUvscAdapterOptions + +QVariantMap JLinkUvscAdapterOptions::toMap() const +{ + QVariantMap map; + map.insert(adapterPortKeyC, port); + map.insert(adapterSpeedKeyC, speed); + return map; +} + +bool JLinkUvscAdapterOptions::fromMap(const QVariantMap &data) +{ + port = static_cast<Port>(data.value(adapterPortKeyC, SWD).toInt()); + speed = static_cast<Speed>(data.value(adapterSpeedKeyC, Speed_1MHz).toInt()); + return true; +} + +bool JLinkUvscAdapterOptions::operator==(const JLinkUvscAdapterOptions &other) const +{ + return port == other.port && speed == other.speed; +} + +// JLinkUvscServerProvider + +class JLinkUvscServerProvider final : public UvscServerProvider +{ +public: + void toMap(QVariantMap &data) const final; + void fromMap(const QVariantMap &data) final; + + bool operator==(const IDebugServerProvider &other) const final; + Utils::FilePath optionsFilePath(Debugger::DebuggerRunTool *runTool, + QString &errorMessage) const final; +private: + explicit JLinkUvscServerProvider(); + + JLinkUvscAdapterOptions m_adapterOpts; + + friend class JLinkUvscServerProviderConfigWidget; + friend class JLinkUvscServerProviderFactory; + friend class JLinkUvProjectOptions; +}; + // JLinkUvProjectOptions class JLinkUvProjectOptions final : public Uv::ProjectOptions @@ -126,29 +187,50 @@ public: } }; -// JLinkUvscAdapterOptions +// JLinkUvscServerProviderFactory -QVariantMap JLinkUvscAdapterOptions::toMap() const +class JLinkUvscAdapterOptionsWidget; + +class JLinkUvscServerProviderConfigWidget final : public UvscServerProviderConfigWidget { - QVariantMap map; - map.insert(adapterPortKeyC, port); - map.insert(adapterSpeedKeyC, speed); - return map; -} +public: + explicit JLinkUvscServerProviderConfigWidget(JLinkUvscServerProvider *provider); -bool JLinkUvscAdapterOptions::fromMap(const QVariantMap &data) +private: + void apply() override; + void discard() override; + + void setAdapterOpitons(const JLinkUvscAdapterOptions &adapterOpts); + JLinkUvscAdapterOptions adapterOptions() const; + void setFromProvider(); + + JLinkUvscAdapterOptionsWidget *m_adapterOptionsWidget = nullptr; +}; + +// JLinkUvscAdapterOptionsWidget + +class JLinkUvscAdapterOptionsWidget final : public QWidget { - port = static_cast<Port>(data.value(adapterPortKeyC, SWD).toInt()); - speed = static_cast<Speed>(data.value(adapterSpeedKeyC, Speed_1MHz).toInt()); - return true; -} + Q_OBJECT -bool JLinkUvscAdapterOptions::operator==(const JLinkUvscAdapterOptions &other) const -{ - return port == other.port && speed == other.speed; -} +public: + explicit JLinkUvscAdapterOptionsWidget(QWidget *parent = nullptr); + void setAdapterOptions(const JLinkUvscAdapterOptions &adapterOpts); + JLinkUvscAdapterOptions adapterOptions() const; -// JLinkUvscServerProvider +signals: + void optionsChanged(); + +private: + JLinkUvscAdapterOptions::Port portAt(int index) const; + JLinkUvscAdapterOptions::Speed speedAt(int index) const; + + void populatePorts(); + void populateSpeeds(); + + QComboBox *m_portBox = nullptr; + QComboBox *m_speedBox = nullptr; +}; JLinkUvscServerProvider::JLinkUvscServerProvider() : UvscServerProvider(Constants::UVSC_JLINK_PROVIDER_ID) @@ -340,3 +422,5 @@ void JLinkUvscAdapterOptionsWidget::populateSpeeds() } } // BareMetal::Internal + +#include "jlinkuvscserverprovider.moc" diff --git a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.h index 5b989679922..110763f4334 100644 --- a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.h @@ -5,103 +5,12 @@ #include "uvscserverprovider.h" -QT_BEGIN_NAMESPACE -class QComboBox; -QT_END_NAMESPACE - namespace BareMetal::Internal { -// JLinkUvscAdapterOptions - -class JLinkUvscAdapterOptions final -{ -public: - enum Port { JTAG, SWD }; - enum Speed { - Speed_50MHz = 50000, Speed_33MHz = 33000, Speed_25MHz = 25000, - Speed_20MHz = 20000, Speed_10MHz = 10000, Speed_5MHz = 5000, - Speed_3MHz = 3000, Speed_2MHz = 2000, Speed_1MHz = 1000, - Speed_500kHz = 500, Speed_200kHz = 200, Speed_100kHz = 100, - }; - Port port = Port::SWD; - Speed speed = Speed::Speed_1MHz; - - QVariantMap toMap() const; - bool fromMap(const QVariantMap &data); - bool operator==(const JLinkUvscAdapterOptions &other) const; -}; - -// JLinkUvscServerProvider - -class JLinkUvscServerProvider final : public UvscServerProvider -{ -public: - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; - - bool operator==(const IDebugServerProvider &other) const final; - Utils::FilePath optionsFilePath(Debugger::DebuggerRunTool *runTool, - QString &errorMessage) const final; -private: - explicit JLinkUvscServerProvider(); - - JLinkUvscAdapterOptions m_adapterOpts; - - friend class JLinkUvscServerProviderConfigWidget; - friend class JLinkUvscServerProviderFactory; - friend class JLinkUvProjectOptions; -}; - -// JLinkUvscServerProviderFactory - class JLinkUvscServerProviderFactory final : public IDebugServerProviderFactory { public: JLinkUvscServerProviderFactory(); }; -// JLinkUvscServerProviderConfigWidget - -class JLinkUvscAdapterOptionsWidget; -class JLinkUvscServerProviderConfigWidget final : public UvscServerProviderConfigWidget -{ -public: - explicit JLinkUvscServerProviderConfigWidget(JLinkUvscServerProvider *provider); - -private: - void apply() override; - void discard() override; - - void setAdapterOpitons(const JLinkUvscAdapterOptions &adapterOpts); - JLinkUvscAdapterOptions adapterOptions() const; - void setFromProvider(); - - JLinkUvscAdapterOptionsWidget *m_adapterOptionsWidget = nullptr; -}; - -// JLinkUvscAdapterOptionsWidget - -class JLinkUvscAdapterOptionsWidget final : public QWidget -{ - Q_OBJECT - -public: - explicit JLinkUvscAdapterOptionsWidget(QWidget *parent = nullptr); - void setAdapterOptions(const JLinkUvscAdapterOptions &adapterOpts); - JLinkUvscAdapterOptions adapterOptions() const; - -signals: - void optionsChanged(); - -private: - JLinkUvscAdapterOptions::Port portAt(int index) const; - JLinkUvscAdapterOptions::Speed speedAt(int index) const; - - void populatePorts(); - void populateSpeeds(); - - QComboBox *m_portBox = nullptr; - QComboBox *m_speedBox = nullptr; -}; - } // BareMetal::Internal diff --git a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp index 316adbb0fcd..e41fa381b60 100644 --- a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp @@ -32,6 +32,29 @@ constexpr char adapterOptionsKeyC[] = "AdapterOptions"; constexpr char adapterPortKeyC[] = "AdapterPort"; constexpr char adapterSpeedKeyC[] = "AdapterSpeed"; +// StLinkUvscAdapterOptions + +class StLinkUvscAdapterOptions final +{ +public: + enum Port { JTAG, SWD }; + enum Speed { + // SWD speeds. + Speed_4MHz = 0, Speed_1_8MHz, Speed_950kHz, Speed_480kHz, + Speed_240kHz, Speed_125kHz, Speed_100kHz, Speed_50kHz, + Speed_25kHz, Speed_15kHz, Speed_5kHz, + // JTAG speeds. + Speed_9MHz = 256, Speed_4_5MHz, Speed_2_25MHz, Speed_1_12MHz, + Speed_560kHz, Speed_280kHz, Speed_140kHz, + }; + Port port = Port::SWD; + Speed speed = Speed::Speed_4MHz; + + QVariantMap toMap() const; + bool fromMap(const QVariantMap &data); + bool operator==(const StLinkUvscAdapterOptions &other) const; +}; + static QString buildAdapterOptions(const StLinkUvscAdapterOptions &opts) { QString s; @@ -58,6 +81,27 @@ static QString buildDllRegistryName(const DeviceSelection &device, .arg(path.fileName(), flashStart, flashSize, device.name, path.filePath(), adaptOpts); } +// StLinkUvscServerProvider + +class StLinkUvscServerProvider final : public UvscServerProvider +{ +public: + void toMap(QVariantMap &data) const final; + void fromMap(const QVariantMap &data) final; + + bool operator==(const IDebugServerProvider &other) const final; + Utils::FilePath optionsFilePath(Debugger::DebuggerRunTool *runTool, + QString &errorMessage) const final; +private: + explicit StLinkUvscServerProvider(); + + StLinkUvscAdapterOptions m_adapterOpts; + + friend class StLinkUvscServerProviderConfigWidget; + friend class StLinkUvscServerProviderFactory; + friend class StLinkUvProjectOptions; +}; + // StLinkUvProjectOptions class StLinkUvProjectOptions final : public Uv::ProjectOptions @@ -82,8 +126,6 @@ public: } }; -// StLinkUvscAdapterOptions - QVariantMap StLinkUvscAdapterOptions::toMap() const { QVariantMap map; @@ -104,6 +146,50 @@ bool StLinkUvscAdapterOptions::operator==(const StLinkUvscAdapterOptions &other) return port == other.port && speed == other.speed; } +// StLinkUvscServerProviderConfigWidget + +class StLinkUvscAdapterOptionsWidget; +class StLinkUvscServerProviderConfigWidget final : public UvscServerProviderConfigWidget +{ +public: + explicit StLinkUvscServerProviderConfigWidget(StLinkUvscServerProvider *provider); + +private: + void apply() override; + void discard() override; + + void setAdapterOpitons(const StLinkUvscAdapterOptions &adapterOpts); + StLinkUvscAdapterOptions adapterOptions() const; + void setFromProvider(); + + StLinkUvscAdapterOptionsWidget *m_adapterOptionsWidget = nullptr; +}; + +// StLinkUvscAdapterOptionsWidget + +class StLinkUvscAdapterOptionsWidget final : public QWidget +{ + Q_OBJECT + +public: + explicit StLinkUvscAdapterOptionsWidget(QWidget *parent = nullptr); + void setAdapterOptions(const StLinkUvscAdapterOptions &adapterOpts); + StLinkUvscAdapterOptions adapterOptions() const; + +signals: + void optionsChanged(); + +private: + StLinkUvscAdapterOptions::Port portAt(int index) const; + StLinkUvscAdapterOptions::Speed speedAt(int index) const; + + void populatePorts(); + void populateSpeeds(); + + QComboBox *m_portBox = nullptr; + QComboBox *m_speedBox = nullptr; +}; + // StLinkUvscServerProvider StLinkUvscServerProvider::StLinkUvscServerProvider() @@ -307,3 +393,5 @@ void StLinkUvscAdapterOptionsWidget::populateSpeeds() } } // BareMetal::Internal + +#include "stlinkuvscserverprovider.moc" diff --git a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.h index 6e6b2d9a1dd..c6f2a89aa3d 100644 --- a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.h @@ -5,106 +5,12 @@ #include "uvscserverprovider.h" -QT_BEGIN_NAMESPACE -class QComboBox; -QT_END_NAMESPACE - namespace BareMetal::Internal { -// StLinkUvscAdapterOptions - -class StLinkUvscAdapterOptions final -{ -public: - enum Port { JTAG, SWD }; - enum Speed { - // SWD speeds. - Speed_4MHz = 0, Speed_1_8MHz, Speed_950kHz, Speed_480kHz, - Speed_240kHz, Speed_125kHz, Speed_100kHz, Speed_50kHz, - Speed_25kHz, Speed_15kHz, Speed_5kHz, - // JTAG speeds. - Speed_9MHz = 256, Speed_4_5MHz, Speed_2_25MHz, Speed_1_12MHz, - Speed_560kHz, Speed_280kHz, Speed_140kHz, - }; - Port port = Port::SWD; - Speed speed = Speed::Speed_4MHz; - - QVariantMap toMap() const; - bool fromMap(const QVariantMap &data); - bool operator==(const StLinkUvscAdapterOptions &other) const; -}; - -// StLinkUvscServerProvider - -class StLinkUvscServerProvider final : public UvscServerProvider -{ -public: - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; - - bool operator==(const IDebugServerProvider &other) const final; - Utils::FilePath optionsFilePath(Debugger::DebuggerRunTool *runTool, - QString &errorMessage) const final; -private: - explicit StLinkUvscServerProvider(); - - StLinkUvscAdapterOptions m_adapterOpts; - - friend class StLinkUvscServerProviderConfigWidget; - friend class StLinkUvscServerProviderFactory; - friend class StLinkUvProjectOptions; -}; - -// StLinkUvscServerProviderFactory - class StLinkUvscServerProviderFactory final : public IDebugServerProviderFactory { public: StLinkUvscServerProviderFactory(); }; -// StLinkUvscServerProviderConfigWidget - -class StLinkUvscAdapterOptionsWidget; -class StLinkUvscServerProviderConfigWidget final : public UvscServerProviderConfigWidget -{ -public: - explicit StLinkUvscServerProviderConfigWidget(StLinkUvscServerProvider *provider); - -private: - void apply() override; - void discard() override; - - void setAdapterOpitons(const StLinkUvscAdapterOptions &adapterOpts); - StLinkUvscAdapterOptions adapterOptions() const; - void setFromProvider(); - - StLinkUvscAdapterOptionsWidget *m_adapterOptionsWidget = nullptr; -}; - -// StLinkUvscAdapterOptionsWidget - -class StLinkUvscAdapterOptionsWidget final : public QWidget -{ - Q_OBJECT - -public: - explicit StLinkUvscAdapterOptionsWidget(QWidget *parent = nullptr); - void setAdapterOptions(const StLinkUvscAdapterOptions &adapterOpts); - StLinkUvscAdapterOptions adapterOptions() const; - -signals: - void optionsChanged(); - -private: - StLinkUvscAdapterOptions::Port portAt(int index) const; - StLinkUvscAdapterOptions::Speed speedAt(int index) const; - - void populatePorts(); - void populateSpeeds(); - - QComboBox *m_portBox = nullptr; - QComboBox *m_speedBox = nullptr; -}; - } // BareMetal::Internal From bce2dde117d2bcd711a37e04eefad95d8a1c3a3d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 20:50:00 +0200 Subject: [PATCH 0664/1777] Valgrind test: Use Utils::Process instead of QProcess Change-Id: Id7a0611fd7d36adc22993f50cce87cd30c6a336c Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../valgrind/valgrindmemcheckparsertest.cpp | 16 ++++++---------- .../valgrind/valgrindmemcheckparsertest.h | 6 +++--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp index d8f453830cc..5598f7cdb03 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -14,7 +14,6 @@ #include <projectexplorer/runcontrol.h> #include <QFileInfo> -#include <QProcess> #include <QTcpServer> #include <QTest> @@ -148,17 +147,17 @@ void ValgrindMemcheckParserTest::initTest(const QString &testfile, const QString { QVERIFY(!m_server->hasPendingConnections()); - m_process = new QProcess(m_server); + m_process.reset(new Process); m_process->setProcessChannelMode(QProcess::ForwardedChannels); const QString fakeValgrind = fakeValgrindExecutable(); const QFileInfo fileInfo(fakeValgrind); QVERIFY2(fileInfo.isExecutable(), qPrintable(fakeValgrind)); QVERIFY2(!fileInfo.isDir(), qPrintable(fakeValgrind)); - m_process->start( - fakeValgrind, - QStringList({QString("--xml-socket=127.0.0.1:%1").arg(m_server->serverPort()), "-i", - testfile}) << otherArgs); + const QStringList args = {QString("--xml-socket=127.0.0.1:%1").arg(m_server->serverPort()), + "-i", testfile}; + m_process->setCommand({FilePath::fromString(fakeValgrind), args + otherArgs}); + m_process->start(); QVERIFY(m_process->waitForStarted(5000)); QCOMPARE(m_process->state(), QProcess::Running); @@ -171,10 +170,7 @@ void ValgrindMemcheckParserTest::initTest(const QString &testfile, const QString void ValgrindMemcheckParserTest::cleanup() { m_socket.reset(); - if (m_process) { - delete m_process; - m_process = nullptr; - } + m_process.reset(); } void ValgrindMemcheckParserTest::testHelgrindSample1() diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.h b/src/plugins/valgrind/valgrindmemcheckparsertest.h index f2f2bb0073c..0d10ac0617f 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.h +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.h @@ -3,12 +3,12 @@ #pragma once -#include <QObject> +#include <utils/process.h> + #include <QStringList> #include <QTcpSocket> QT_BEGIN_NAMESPACE -class QProcess; class QTcpServer; QT_END_NAMESPACE @@ -40,7 +40,7 @@ private: void initTest(const QString &testfile, const QStringList &otherArgs = {}); QTcpServer *m_server = nullptr; - QProcess *m_process = nullptr; + std::unique_ptr<Utils::Process> m_process; std::unique_ptr<QTcpSocket> m_socket; }; From 98aacfd688b5e8cedd8e8f5048f0a54e52b01989 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 10 Aug 2023 11:21:50 +0200 Subject: [PATCH 0665/1777] Debugger tests: Bump min cpp version to 17 Change-Id: I0fa3c153d1533f7f0390134d4b046e00c0368d9d Reviewed-by: hjk <hjk@qt.io> --- tests/manual/debugger/gui/CMakeLists.txt | 2 +- tests/manual/debugger/simple/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/manual/debugger/gui/CMakeLists.txt b/tests/manual/debugger/gui/CMakeLists.txt index 15c0aeb9491..412b0cdc429 100644 --- a/tests/manual/debugger/gui/CMakeLists.txt +++ b/tests/manual/debugger/gui/CMakeLists.txt @@ -5,7 +5,7 @@ project(manual_test_debugger_gui LANGUAGES CXX) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets) diff --git a/tests/manual/debugger/simple/CMakeLists.txt b/tests/manual/debugger/simple/CMakeLists.txt index 3701d58bbd7..abe4c5b7812 100644 --- a/tests/manual/debugger/simple/CMakeLists.txt +++ b/tests/manual/debugger/simple/CMakeLists.txt @@ -5,7 +5,7 @@ project(simple_test_app LANGUAGES CXX) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) if (WINDOWS) From 256ee1c05aee7adfe9d419df2ec5fbf113ed65f4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 8 Aug 2023 18:32:55 +0200 Subject: [PATCH 0666/1777] Perforce: Inline PerforcePluginPrivate::applySettings ... into its only user, hope is to move it into the settings proper at some time. Change-Id: I5877e7e19f4c3ef0ad5dba2761b12545ab59a1e8 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/perforce/perforceplugin.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index f477144e153..aa4d9e90c0c 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -312,8 +312,6 @@ public: bool revertProject(const FilePath &workingDir, const QStringList &args, bool unchangedOnly); bool managesDirectoryFstat(const FilePath &directory); - void applySettings(); - CommandLocator *m_commandLocator = nullptr; ParameterAction *m_editAction = nullptr; ParameterAction *m_addAction = nullptr; @@ -553,7 +551,10 @@ PerforcePluginPrivate::PerforcePluginPrivate() QObject::connect(&settings(), &AspectContainer::applied, this, [this] { settings().clearTopLevel(); - applySettings(); + settings().writeSettings(); + m_managedDirectoryCache.clear(); + getTopLevel(); + emit configurationChanged(); }); } @@ -1668,14 +1669,6 @@ void PerforcePluginPrivate::setTopLevel(const FilePath &topLevel) VcsOutputWindow::appendSilently(msg); } -void PerforcePluginPrivate::applySettings() -{ - settings().writeSettings(); - m_managedDirectoryCache.clear(); - getTopLevel(); - emit configurationChanged(); -} - void PerforcePluginPrivate::slotTopLevelFailed(const QString &errorMessage) { VcsOutputWindow::appendSilently(Tr::tr("Perforce: Unable to determine the repository: %1").arg(errorMessage)); From 3ad1a6ecdd63265061cd4ff12444ff311352adbc Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 10 Aug 2023 11:03:07 +0200 Subject: [PATCH 0667/1777] Revert "Utils: Allow (encoded) colons in host parts of FilePath" This reverts commit f65b343c8ac6dd4b68a98d56207274f0ccbe2a51. It's not needed anymore for the problem it was supposed to help with (bad docker imange/qmake paths written by sdktool) and complicates reasoning in this area. Change-Id: Idef2ef9147d73e83461589907aa68c09721755cb Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/filepath.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 7c4383c2949..8349fb68180 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -213,13 +213,12 @@ QString FilePath::encodedHost() const QString result = host().toString(); result.replace('%', "%25"); result.replace('/', "%2f"); - result.replace(':', "%3a"); return result; } QString decodeHost(QString host) { - return host.replace("%25", "%").replace("%2f", "/").replace("%3a", ":"); + return host.replace("%25", "%").replace("%2f", "/"); } /*! From cb50a675216d39ac972cfb22886604aa91315963 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 10 Aug 2023 11:32:07 +0200 Subject: [PATCH 0668/1777] Utils: Fix FilePath tests Change-Id: I2751cd9393baa836715f778a9bcbc47a445c264c Reviewed-by: hjk <hjk@qt.io> --- tests/auto/utils/filepath/tst_filepath.cpp | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/auto/utils/filepath/tst_filepath.cpp b/tests/auto/utils/filepath/tst_filepath.cpp index f9e10d5e207..f09665abc90 100644 --- a/tests/auto/utils/filepath/tst_filepath.cpp +++ b/tests/auto/utils/filepath/tst_filepath.cpp @@ -623,15 +623,15 @@ void tst_filepath::toString_data() << "c:/__qtc_devices__/docker" << "c:/__qtc_devices__/docker"; QTest::newRow("qtc-root-folder") << "docker" - << "alpine:latest" + << "alpine.latest" << "/" - << "docker://alpine:latest/" - << "docker://alpine:latest/"; + << "docker://alpine.latest/" + << "docker://alpine.latest/"; QTest::newRow("qtc-root-folder-rel") << "docker" - << "alpine:latest" + << "alpine.latest" << "" - << "docker://alpine:latest" - << "docker://alpine:latest"; + << "docker://alpine.latest" + << "docker://alpine.latest"; } void tst_filepath::toString() @@ -690,14 +690,14 @@ void tst_filepath::toFSPathString_data() << QDir::rootPath() + "__qtc_devices__/docker"; QTest::newRow("qtc-root-folder") << "docker" - << "alpine:latest" - << "/" << QDir::rootPath() + "__qtc_devices__/docker/alpine:latest/" - << "docker://alpine:latest/"; + << "alpine.latest" + << "/" << QDir::rootPath() + "__qtc_devices__/docker/alpine.latest/" + << "docker://alpine.latest/"; QTest::newRow("qtc-root-folder-rel") << "docker" - << "alpine:latest" - << "" << QDir::rootPath() + "__qtc_devices__/docker/alpine:latest" - << "docker://alpine:latest"; + << "alpine.latest" + << "" << QDir::rootPath() + "__qtc_devices__/docker/alpine.latest" + << "docker://alpine.latest"; } void tst_filepath::toFSPathString() From 2732b6e939a3f6ba58b60b2449b2b279dbf3df73 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 10 Aug 2023 13:23:26 +0200 Subject: [PATCH 0669/1777] Creator: Block the usage of foreach Change-Id: I5557b1eccb8bd1e4acdc519ded799ce21c5be45e Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- cmake/QtCreatorAPIInternal.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index 99e87540624..a2fbd6f055d 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -21,7 +21,7 @@ include(FeatureSummary) list(APPEND DEFAULT_DEFINES QT_CREATOR QT_NO_JAVA_STYLE_ITERATORS - QT_NO_CAST_TO_ASCII QT_RESTRICTED_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII QT_RESTRICTED_CAST_FROM_ASCII QT_NO_FOREACH QT_DISABLE_DEPRECATED_BEFORE=0x050900 QT_USE_QSTRINGBUILDER ) From 973f74bad36802ea9930333445ddc48eebcd320e Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 10 Aug 2023 11:28:41 +0200 Subject: [PATCH 0670/1777] Tests: Add NEEDS_GUI flag to add platform argument Tests that create a QApplication need to be started with "-platform minimal" so that they won't fail on build servers without Display. This also keeps them from distracting you if you run them while working. Change-Id: I05df258b2204a3abd3cdea446d6a52f3e57a4a62 Reviewed-by: David Schulz <david.schulz@qt.io> --- cmake/QtCreatorAPI.cmake | 8 ++++++-- tests/auto/qml/qmldesigner/coretests/CMakeLists.txt | 1 + tests/auto/texteditor/highlighter/CMakeLists.txt | 1 + tests/auto/tracing/flamegraphview/CMakeLists.txt | 1 + tests/auto/tracing/timelineitemsrenderpass/CMakeLists.txt | 1 + tests/auto/tracing/timelinenotesrenderpass/CMakeLists.txt | 1 + .../tracing/timelineselectionrenderpass/CMakeLists.txt | 1 + tests/auto/treeviewfind/CMakeLists.txt | 1 + tests/auto/utils/multicursor/CMakeLists.txt | 1 + 9 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 34549c6ca30..d799637d645 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -811,7 +811,7 @@ function(extend_qtc_executable name) endfunction() function(add_qtc_test name) - cmake_parse_arguments(_arg "GTEST;MANUALTEST;EXCLUDE_FROM_PRECHECK" "TIMEOUT" + cmake_parse_arguments(_arg "GTEST;MANUALTEST;EXCLUDE_FROM_PRECHECK;NEEDS_GUI" "TIMEOUT" "DEFINES;DEPENDS;INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;SKIP_PCH;CONDITION;PROPERTIES" ${ARGN}) if (${_arg_UNPARSED_ARGUMENTS}) @@ -878,8 +878,12 @@ function(add_qtc_test name) enable_pch(${name}) endif() + if (_arg_NEEDS_GUI) + set(EXTRA_ARGUMENTS "-platform" "minimal") + endif() + if (NOT _arg_GTEST AND NOT _arg_MANUALTEST) - add_test(NAME ${name} COMMAND ${name}) + add_test(NAME ${name} COMMAND ${name} ${EXTRA_ARGUMENTS}) if (_arg_EXCLUDE_FROM_PRECHECK) set_tests_properties(${name} PROPERTIES LABELS exclude_from_precheck) endif() diff --git a/tests/auto/qml/qmldesigner/coretests/CMakeLists.txt b/tests/auto/qml/qmldesigner/coretests/CMakeLists.txt index e80627a00e1..1eaf90376d8 100644 --- a/tests/auto/qml/qmldesigner/coretests/CMakeLists.txt +++ b/tests/auto/qml/qmldesigner/coretests/CMakeLists.txt @@ -1,4 +1,5 @@ add_qtc_test(tst_qml_testcore + NEEDS_GUI EXCLUDE_FROM_PRECHECK CONDITION TARGET QmlProjectManager DEPENDS diff --git a/tests/auto/texteditor/highlighter/CMakeLists.txt b/tests/auto/texteditor/highlighter/CMakeLists.txt index 76370bf8255..99fb136b320 100644 --- a/tests/auto/texteditor/highlighter/CMakeLists.txt +++ b/tests/auto/texteditor/highlighter/CMakeLists.txt @@ -1,4 +1,5 @@ add_qtc_test(tst_highlighter + NEEDS_GUI DEPENDS TextEditor Utils Qt::Widgets SOURCES tst_highlighter.cpp ) diff --git a/tests/auto/tracing/flamegraphview/CMakeLists.txt b/tests/auto/tracing/flamegraphview/CMakeLists.txt index b1c53558a3a..22e5c9471d6 100644 --- a/tests/auto/tracing/flamegraphview/CMakeLists.txt +++ b/tests/auto/tracing/flamegraphview/CMakeLists.txt @@ -4,6 +4,7 @@ set(TSTFLAMEGRAPHVIEW_CPP_SOURCES ) add_qtc_test(tst_tracing_flamegraphview + NEEDS_GUI EXCLUDE_FROM_PRECHECK DEPENDS Tracing Qt::QuickWidgets Qt::Quick Utils ) diff --git a/tests/auto/tracing/timelineitemsrenderpass/CMakeLists.txt b/tests/auto/tracing/timelineitemsrenderpass/CMakeLists.txt index 5af1116952e..228fed76e68 100644 --- a/tests/auto/tracing/timelineitemsrenderpass/CMakeLists.txt +++ b/tests/auto/tracing/timelineitemsrenderpass/CMakeLists.txt @@ -1,4 +1,5 @@ add_qtc_test(tst_tracing_timelineitemsrenderpass + NEEDS_GUI DEPENDS Tracing Qt::Quick SOURCES tst_timelineitemsrenderpass.cpp ) diff --git a/tests/auto/tracing/timelinenotesrenderpass/CMakeLists.txt b/tests/auto/tracing/timelinenotesrenderpass/CMakeLists.txt index f0d6f0397ad..6355651f13e 100644 --- a/tests/auto/tracing/timelinenotesrenderpass/CMakeLists.txt +++ b/tests/auto/tracing/timelinenotesrenderpass/CMakeLists.txt @@ -1,4 +1,5 @@ add_qtc_test(tst_tracing_timelinenotesrenderpass + NEEDS_GUI DEPENDS Tracing Qt::Quick SOURCES tst_timelinenotesrenderpass.cpp ) diff --git a/tests/auto/tracing/timelineselectionrenderpass/CMakeLists.txt b/tests/auto/tracing/timelineselectionrenderpass/CMakeLists.txt index acb8f54220c..163400a4554 100644 --- a/tests/auto/tracing/timelineselectionrenderpass/CMakeLists.txt +++ b/tests/auto/tracing/timelineselectionrenderpass/CMakeLists.txt @@ -1,4 +1,5 @@ add_qtc_test(tst_tracing_timelineselectionrenderpass + NEEDS_GUI DEPENDS Tracing Qt::Quick SOURCES tst_timelineselectionrenderpass.cpp ) diff --git a/tests/auto/treeviewfind/CMakeLists.txt b/tests/auto/treeviewfind/CMakeLists.txt index 6ce09aa2097..00ac4a52f31 100644 --- a/tests/auto/treeviewfind/CMakeLists.txt +++ b/tests/auto/treeviewfind/CMakeLists.txt @@ -1,4 +1,5 @@ add_qtc_test(tst_treeviewfind + NEEDS_GUI DEPENDS Core SOURCES tst_treeviewfind.cpp ) diff --git a/tests/auto/utils/multicursor/CMakeLists.txt b/tests/auto/utils/multicursor/CMakeLists.txt index 7b8be63f836..9300e38b632 100644 --- a/tests/auto/utils/multicursor/CMakeLists.txt +++ b/tests/auto/utils/multicursor/CMakeLists.txt @@ -1,4 +1,5 @@ add_qtc_test(tst_utils_multicursor + NEEDS_GUI DEPENDS Utils SOURCES tst_multicursor.cpp ) From b3c7e3abd65e406b16faf65a6b67a428267e7fe6 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 10 Aug 2023 14:22:17 +0200 Subject: [PATCH 0671/1777] Valgrind: Fix build Amends ec53435e04c9cbe420ff0371c8a29192934e8b2d. Change-Id: Iaee2b355a98bf92c94bd66a8a615befec08b11c3 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/valgrind/xmlprotocol/threadedparser.cpp | 2 ++ src/plugins/valgrind/xmlprotocol/threadedparser.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp index 5df623aa2b8..8b9ef43d905 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp @@ -33,6 +33,8 @@ ThreadedParser::ThreadedParser(QObject *parent) : QObject(parent) {} +ThreadedParser::~ThreadedParser() = default; + bool ThreadedParser::isRunning() const { return m_parserThread ? m_parserThread->isRunning() : false; diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.h b/src/plugins/valgrind/xmlprotocol/threadedparser.h index 51d3fb4cfd8..3380d0d3438 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.h +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.h @@ -25,6 +25,7 @@ class ThreadedParser : public QObject public: explicit ThreadedParser(QObject *parent = nullptr); + ~ThreadedParser(); /// interface additions relative to Parser because Parser is synchronous and this /// class parses asynchronously in a non-public secondary thread. From 88dc7cf7e01314e2918ff4b746f0e83fadf1b078 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 10 Aug 2023 14:27:12 +0200 Subject: [PATCH 0672/1777] Debugger: Fix qbs build Change-Id: I660bfd4053ef52881c9a64f1492631819321d2c1 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/debugger.qbs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 1d6bb5022ed..a2aff836719 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -124,7 +124,11 @@ Project { Group { name: "dap" prefix: "dap/" - files: ["dapengine.cpp", "dapengine.h"] + files: [ + "cmakedapengine.cpp", "cmakedapengine.h", + "dapengine.cpp", "dapengine.h", + "gdbdapengine.cpp", "gdbdapengine.h", + ] } Group { From 26853ee7a9cde43388db7188f9f11dbc3fad6256 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 10 Aug 2023 14:33:44 +0200 Subject: [PATCH 0673/1777] Creator: Block the usage of foreach in qbs build Change-Id: If1fc3a69505cf8c2b7e931861a07991643d5e8d5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- qbs/modules/qtc/qtc.qbs | 1 + 1 file changed, 1 insertion(+) diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 75f85ab79dc..a7fff4132ef 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -92,6 +92,7 @@ Module { 'RELATIVE_DOC_PATH="' + FileInfo.relativePath('/' + ide_bin_path, '/' + ide_doc_path) + '"', "QT_NO_CAST_TO_ASCII", "QT_RESTRICTED_CAST_FROM_ASCII", + "QT_NO_FOREACH", "QT_DISABLE_DEPRECATED_BEFORE=0x050900", "QT_USE_QSTRINGBUILDER", ].concat(testsEnabled ? ["WITH_TESTS"] : []) From fde372b81edee174653ea4f7bc2ea1e812b6ffaf Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 10 Aug 2023 13:00:40 +0200 Subject: [PATCH 0674/1777] ProjectExplorer: Rename KitAspect related classes KitAspect -> KitAspectFactory KitAspectWidget -> KitAspect KitAspect::createConfigWidget() -> KitAspectFactory::createKitAspect() Possibly not perfect yet, but closer to what it does and is. There will be follow-ups to rename derived classes. Change-Id: I226f6f025f1e6462c348b68663f776f5a2e8c42d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../cmakebuildconfiguration.cpp | 6 +- .../cmakekitinformation.cpp | 30 ++++----- .../cmakeprojectmanager/cmakekitinformation.h | 12 ++-- .../debugger/debuggerkitinformation.cpp | 10 +-- src/plugins/debugger/debuggerkitinformation.h | 4 +- src/plugins/mcusupport/mcukitinformation.cpp | 10 +-- src/plugins/mcusupport/mcukitinformation.h | 4 +- .../mesontoolkitaspect.cpp | 4 +- .../mesonprojectmanager/mesontoolkitaspect.h | 4 +- .../ninjatoolkitaspect.cpp | 4 +- .../mesonprojectmanager/ninjatoolkitaspect.h | 4 +- .../toolkitaspectwidget.cpp | 4 +- .../mesonprojectmanager/toolkitaspectwidget.h | 4 +- .../filterkitaspectsdialog.cpp | 6 +- src/plugins/projectexplorer/kit.cpp | 34 +++++----- src/plugins/projectexplorer/kit.h | 2 +- src/plugins/projectexplorer/kitchooser.cpp | 2 +- .../projectexplorer/kitinformation.cpp | 56 ++++++++--------- src/plugins/projectexplorer/kitinformation.h | 26 ++++---- src/plugins/projectexplorer/kitmanager.cpp | 62 +++++++++---------- src/plugins/projectexplorer/kitmanager.h | 38 +++++------- .../kitmanagerconfigwidget.cpp | 18 +++--- .../projectexplorer/kitmanagerconfigwidget.h | 4 +- .../miniprojecttargetselector.cpp | 16 ++--- .../projectexplorer/targetsetupwidget.cpp | 2 +- .../qbsprojectmanager/qbskitinformation.cpp | 10 +-- .../qbsprojectmanager/qbskitinformation.h | 4 +- .../qmakekitinformation.cpp | 10 +-- .../qmakeprojectmanager/qmakekitinformation.h | 4 +- src/plugins/qtsupport/qtkitinformation.cpp | 8 +-- src/plugins/qtsupport/qtkitinformation.h | 4 +- 31 files changed, 201 insertions(+), 205 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 746c78f5491..b601e723cd5 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -651,13 +651,13 @@ void CMakeBuildSettingsWidget::kitCMakeConfiguration() CMakeConfigurationKitAspect configurationKitAspect; Layouting::Grid grid; - KitAspectWidget *widget = kitAspect.createConfigWidget(m_buildConfig->kit()); + KitAspect *widget = kitAspect.createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); widget->addToLayoutWithLabel(grid, dialog); - widget = generatorAspect.createConfigWidget(m_buildConfig->kit()); + widget = generatorAspect.createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); widget->addToLayoutWithLabel(grid, dialog); - widget = configurationKitAspect.createConfigWidget(m_buildConfig->kit()); + widget = configurationKitAspect.createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); widget->addToLayoutWithLabel(grid, dialog); grid.attachTo(dialog); diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 14ee7fa6a8b..cb5d018db8f 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -63,10 +63,10 @@ static Id defaultCMakeToolId() return defaultTool ? defaultTool->id() : Id(); } -class CMakeKitAspectWidget final : public KitAspectWidget +class CMakeKitAspectWidget final : public KitAspect { public: - CMakeKitAspectWidget(Kit *kit, const KitAspect *ki) : KitAspectWidget(kit, ki), + CMakeKitAspectWidget(Kit *kit, const KitAspectFactory *ki) : KitAspect(kit, ki), m_comboBox(createSubWidget<QComboBox>()), m_manageButton(createManageButton(Constants::Settings::TOOLS_ID)) { @@ -242,13 +242,13 @@ void CMakeKitAspect::fix(Kit *k) setup(k); } -KitAspect::ItemList CMakeKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList CMakeKitAspect::toUserOutput(const Kit *k) const { const CMakeTool *const tool = cmakeTool(k); return {{Tr::tr("CMake"), tool ? tool->displayName() : Tr::tr("Unconfigured")}}; } -KitAspectWidget *CMakeKitAspect::createConfigWidget(Kit *k) const +KitAspect *CMakeKitAspect::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); return new CMakeKitAspectWidget(k, this); @@ -289,16 +289,16 @@ const char EXTRA_GENERATOR_KEY[] = "ExtraGenerator"; const char PLATFORM_KEY[] = "Platform"; const char TOOLSET_KEY[] = "Toolset"; -class CMakeGeneratorKitAspectWidget final : public KitAspectWidget +class CMakeGeneratorKitAspectWidget final : public KitAspect { public: - CMakeGeneratorKitAspectWidget(Kit *kit, const KitAspect *ki) - : KitAspectWidget(kit, ki), + CMakeGeneratorKitAspectWidget(Kit *kit, const KitAspectFactory *ki) + : KitAspect(kit, ki), m_label(createSubWidget<ElidingLabel>()), m_changeButton(createSubWidget<QPushButton>()) { const CMakeTool *tool = CMakeKitAspect::cmakeTool(kit); - connect(this, &KitAspectWidget::labelLinkActivated, this, [=](const QString &) { + connect(this, &KitAspect::labelLinkActivated, this, [=](const QString &) { CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-generators.7.html"); }); @@ -798,7 +798,7 @@ void CMakeGeneratorKitAspect::upgrade(Kit *k) } } -KitAspect::ItemList CMakeGeneratorKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList CMakeGeneratorKitAspect::toUserOutput(const Kit *k) const { const GeneratorInfo info = generatorInfo(k); QString message; @@ -814,7 +814,7 @@ KitAspect::ItemList CMakeGeneratorKitAspect::toUserOutput(const Kit *k) const return {{Tr::tr("CMake Generator"), message}}; } -KitAspectWidget *CMakeGeneratorKitAspect::createConfigWidget(Kit *k) const +KitAspect *CMakeGeneratorKitAspect::createKitAspect(Kit *k) const { return new CMakeGeneratorKitAspectWidget(k, this); } @@ -843,11 +843,11 @@ const char CMAKE_QMAKE_KEY[] = "QT_QMAKE_EXECUTABLE"; const char CMAKE_PREFIX_PATH_KEY[] = "CMAKE_PREFIX_PATH"; const char QTC_CMAKE_PRESET_KEY[] = "QTC_CMAKE_PRESET"; -class CMakeConfigurationKitAspectWidget final : public KitAspectWidget +class CMakeConfigurationKitAspectWidget final : public KitAspect { public: - CMakeConfigurationKitAspectWidget(Kit *kit, const KitAspect *ki) - : KitAspectWidget(kit, ki), + CMakeConfigurationKitAspectWidget(Kit *kit, const KitAspectFactory *ki) + : KitAspect(kit, ki), m_summaryLabel(createSubWidget<ElidingLabel>()), m_manageButton(createSubWidget<QPushButton>()) { @@ -1217,12 +1217,12 @@ void CMakeConfigurationKitAspect::fix(Kit *k) Q_UNUSED(k) } -KitAspect::ItemList CMakeConfigurationKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList CMakeConfigurationKitAspect::toUserOutput(const Kit *k) const { return {{Tr::tr("CMake Configuration"), toStringList(k).join("<br>")}}; } -KitAspectWidget *CMakeConfigurationKitAspect::createConfigWidget(Kit *k) const +KitAspect *CMakeConfigurationKitAspect::createKitAspect(Kit *k) const { if (!k) return nullptr; diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.h b/src/plugins/cmakeprojectmanager/cmakekitinformation.h index 3b85235d917..eee96fd88d1 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.h +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.h @@ -13,7 +13,7 @@ namespace CMakeProjectManager { class CMakeTool; -class CMAKE_EXPORT CMakeKitAspect : public ProjectExplorer::KitAspect +class CMAKE_EXPORT CMakeKitAspect : public ProjectExplorer::KitAspectFactory { public: CMakeKitAspect(); @@ -29,7 +29,7 @@ public: void setup(ProjectExplorer::Kit *k) final; void fix(ProjectExplorer::Kit *k) final; ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; - ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const final; + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const final; void addToMacroExpander(ProjectExplorer::Kit *k, Utils::MacroExpander *expander) const final; @@ -38,7 +38,7 @@ public: static QString msgUnsupportedVersion(const QByteArray &versionString); }; -class CMAKE_EXPORT CMakeGeneratorKitAspect : public ProjectExplorer::KitAspect +class CMAKE_EXPORT CMakeGeneratorKitAspect : public ProjectExplorer::KitAspectFactory { public: CMakeGeneratorKitAspect(); @@ -63,14 +63,14 @@ public: void fix(ProjectExplorer::Kit *k) final; void upgrade(ProjectExplorer::Kit *k) final; ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; - ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const final; + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const final; void addToBuildEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const final; private: QVariant defaultValue(const ProjectExplorer::Kit *k) const; }; -class CMAKE_EXPORT CMakeConfigurationKitAspect : public ProjectExplorer::KitAspect +class CMAKE_EXPORT CMakeConfigurationKitAspect : public ProjectExplorer::KitAspectFactory { public: CMakeConfigurationKitAspect(); @@ -96,7 +96,7 @@ public: void setup(ProjectExplorer::Kit *k) final; void fix(ProjectExplorer::Kit *k) final; ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; - ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const final; + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const final; private: QVariant defaultValue(const ProjectExplorer::Kit *k) const; diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index f2c149ad5a4..35c5b4d26a0 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -35,11 +35,11 @@ namespace Debugger { namespace Internal { -class DebuggerKitAspectWidget final : public KitAspectWidget +class DebuggerKitAspectWidget final : public KitAspect { public: - DebuggerKitAspectWidget(Kit *workingCopy, const KitAspect *ki) - : KitAspectWidget(workingCopy, ki) + DebuggerKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki) + : KitAspect(workingCopy, ki) { m_comboBox = createSubWidget<QComboBox>(); m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy()); @@ -348,7 +348,7 @@ Tasks DebuggerKitAspect::validateDebugger(const Kit *k) return result; } -KitAspectWidget *DebuggerKitAspect::createConfigWidget(Kit *k) const +KitAspect *DebuggerKitAspect::createKitAspect(Kit *k) const { return new Internal::DebuggerKitAspectWidget(k, this); } @@ -384,7 +384,7 @@ void DebuggerKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) co }); } -KitAspect::ItemList DebuggerKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList DebuggerKitAspect::toUserOutput(const Kit *k) const { return {{Tr::tr("Debugger"), displayString(k)}}; } diff --git a/src/plugins/debugger/debuggerkitinformation.h b/src/plugins/debugger/debuggerkitinformation.h index 548f76793bb..401b4079972 100644 --- a/src/plugins/debugger/debuggerkitinformation.h +++ b/src/plugins/debugger/debuggerkitinformation.h @@ -12,7 +12,7 @@ namespace Debugger { class DebuggerItem; -class DEBUGGER_EXPORT DebuggerKitAspect : public ProjectExplorer::KitAspect +class DEBUGGER_EXPORT DebuggerKitAspect : public ProjectExplorer::KitAspectFactory { public: DebuggerKitAspect(); @@ -39,7 +39,7 @@ public: static ProjectExplorer::Tasks validateDebugger(const ProjectExplorer::Kit *k); static ConfigurationErrors configurationErrors(const ProjectExplorer::Kit *k); - ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const override; + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const override; void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override; ItemList toUserOutput(const ProjectExplorer::Kit *k) const override; diff --git a/src/plugins/mcusupport/mcukitinformation.cpp b/src/plugins/mcusupport/mcukitinformation.cpp index 2fd6f846e1e..924cd7006bb 100644 --- a/src/plugins/mcusupport/mcukitinformation.cpp +++ b/src/plugins/mcusupport/mcukitinformation.cpp @@ -13,11 +13,11 @@ using namespace ProjectExplorer; namespace { -class McuDependenciesKitAspectWidget final : public KitAspectWidget +class McuDependenciesKitAspectWidget final : public KitAspect { public: - McuDependenciesKitAspectWidget(Kit *workingCopy, const KitAspect *ki) - : KitAspectWidget(workingCopy, ki) + McuDependenciesKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki) + : KitAspect(workingCopy, ki) {} void makeReadOnly() override {} @@ -83,13 +83,13 @@ void McuDependenciesKitAspect::fix(Kit *kit) } } -KitAspectWidget *McuDependenciesKitAspect::createConfigWidget(Kit *kit) const +KitAspect *McuDependenciesKitAspect::createKitAspect(Kit *kit) const { QTC_ASSERT(kit, return nullptr); return new McuDependenciesKitAspectWidget(kit, this); } -KitAspect::ItemList McuDependenciesKitAspect::toUserOutput(const Kit *kit) const +KitAspectFactory::ItemList McuDependenciesKitAspect::toUserOutput(const Kit *kit) const { Q_UNUSED(kit) diff --git a/src/plugins/mcusupport/mcukitinformation.h b/src/plugins/mcusupport/mcukitinformation.h index f0bafd34c1b..72429b8db6e 100644 --- a/src/plugins/mcusupport/mcukitinformation.h +++ b/src/plugins/mcusupport/mcukitinformation.h @@ -8,7 +8,7 @@ namespace McuSupport { namespace Internal { -class McuDependenciesKitAspect final : public ProjectExplorer::KitAspect +class McuDependenciesKitAspect final : public ProjectExplorer::KitAspectFactory { Q_OBJECT @@ -18,7 +18,7 @@ public: ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *kit) const override; void fix(ProjectExplorer::Kit *kit) override; - ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *kit) const override; + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *kit) const override; ItemList toUserOutput(const ProjectExplorer::Kit *kit) const override; diff --git a/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp b/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp index 3c3298bc642..024606d933a 100644 --- a/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp +++ b/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp @@ -48,7 +48,7 @@ void MesonToolKitAspect::fix(ProjectExplorer::Kit *k) setup(k); } -ProjectExplorer::KitAspect::ItemList MesonToolKitAspect::toUserOutput( +ProjectExplorer::KitAspectFactory::ItemList MesonToolKitAspect::toUserOutput( const ProjectExplorer::Kit *k) const { const auto tool = mesonTool(k); @@ -57,7 +57,7 @@ ProjectExplorer::KitAspect::ItemList MesonToolKitAspect::toUserOutput( return {{Tr::tr("Meson"), Tr::tr("Unconfigured")}}; } -ProjectExplorer::KitAspectWidget *MesonToolKitAspect::createConfigWidget(ProjectExplorer::Kit *k) const +ProjectExplorer::KitAspect *MesonToolKitAspect::createKitAspect(ProjectExplorer::Kit *k) const { QTC_ASSERT(k, return nullptr); return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Meson}; diff --git a/src/plugins/mesonprojectmanager/mesontoolkitaspect.h b/src/plugins/mesonprojectmanager/mesontoolkitaspect.h index 7fb45be5873..a53f49a7678 100644 --- a/src/plugins/mesonprojectmanager/mesontoolkitaspect.h +++ b/src/plugins/mesonprojectmanager/mesontoolkitaspect.h @@ -11,7 +11,7 @@ namespace MesonProjectManager { namespace Internal { -class MesonToolKitAspect final : public ProjectExplorer::KitAspect +class MesonToolKitAspect final : public ProjectExplorer::KitAspectFactory { public: MesonToolKitAspect(); @@ -20,7 +20,7 @@ public: void setup(ProjectExplorer::Kit *k) final; void fix(ProjectExplorer::Kit *k) final; ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; - ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *) const final; + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const final; static void setMesonTool(ProjectExplorer::Kit *kit, Utils::Id id); static Utils::Id mesonToolId(const ProjectExplorer::Kit *kit); diff --git a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp index 409765e8441..61d117f61ac 100644 --- a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp +++ b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp @@ -48,7 +48,7 @@ void NinjaToolKitAspect::fix(ProjectExplorer::Kit *k) setup(k); } -ProjectExplorer::KitAspect::ItemList NinjaToolKitAspect::toUserOutput( +ProjectExplorer::KitAspectFactory::ItemList NinjaToolKitAspect::toUserOutput( const ProjectExplorer::Kit *k) const { const auto tool = ninjaTool(k); @@ -57,7 +57,7 @@ ProjectExplorer::KitAspect::ItemList NinjaToolKitAspect::toUserOutput( return {{Tr::tr("Ninja"), Tr::tr("Unconfigured")}}; } -ProjectExplorer::KitAspectWidget *NinjaToolKitAspect::createConfigWidget(ProjectExplorer::Kit *k) const +ProjectExplorer::KitAspect *NinjaToolKitAspect::createKitAspect(ProjectExplorer::Kit *k) const { QTC_ASSERT(k, return nullptr); return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Ninja}; diff --git a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.h b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.h index 36b0af57f68..19cfa0760a0 100644 --- a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.h +++ b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.h @@ -11,7 +11,7 @@ namespace MesonProjectManager { namespace Internal { -class NinjaToolKitAspect final : public ProjectExplorer::KitAspect +class NinjaToolKitAspect final : public ProjectExplorer::KitAspectFactory { public: NinjaToolKitAspect(); @@ -20,7 +20,7 @@ public: void setup(ProjectExplorer::Kit *k) final; void fix(ProjectExplorer::Kit *k) final; ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; - ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *) const final; + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const final; static void setNinjaTool(ProjectExplorer::Kit *kit, Utils::Id id); static Utils::Id ninjaToolId(const ProjectExplorer::Kit *kit); diff --git a/src/plugins/mesonprojectmanager/toolkitaspectwidget.cpp b/src/plugins/mesonprojectmanager/toolkitaspectwidget.cpp index d556ab2ebbc..26c6ee8e9f7 100644 --- a/src/plugins/mesonprojectmanager/toolkitaspectwidget.cpp +++ b/src/plugins/mesonprojectmanager/toolkitaspectwidget.cpp @@ -13,9 +13,9 @@ namespace MesonProjectManager { namespace Internal { ToolKitAspectWidget::ToolKitAspectWidget(ProjectExplorer::Kit *kit, - const ProjectExplorer::KitAspect *ki, + const ProjectExplorer::KitAspectFactory *ki, ToolType type) - : ProjectExplorer::KitAspectWidget(kit, ki) + : ProjectExplorer::KitAspect(kit, ki) , m_toolsComboBox(createSubWidget<QComboBox>()) , m_manageButton(createManageButton(Constants::SettingsPage::TOOLS_ID)) , m_type{type} diff --git a/src/plugins/mesonprojectmanager/toolkitaspectwidget.h b/src/plugins/mesonprojectmanager/toolkitaspectwidget.h index c327fb4e2b1..26d73788d7f 100644 --- a/src/plugins/mesonprojectmanager/toolkitaspectwidget.h +++ b/src/plugins/mesonprojectmanager/toolkitaspectwidget.h @@ -15,13 +15,13 @@ namespace MesonProjectManager { namespace Internal { -class ToolKitAspectWidget final : public ProjectExplorer::KitAspectWidget +class ToolKitAspectWidget final : public ProjectExplorer::KitAspect { public: enum class ToolType { Meson, Ninja }; ToolKitAspectWidget(ProjectExplorer::Kit *kit, - const ProjectExplorer::KitAspect *ki, + const ProjectExplorer::KitAspectFactory *ki, ToolType type); ~ToolKitAspectWidget(); diff --git a/src/plugins/projectexplorer/filterkitaspectsdialog.cpp b/src/plugins/projectexplorer/filterkitaspectsdialog.cpp index 389165976b4..db3fc75b798 100644 --- a/src/plugins/projectexplorer/filterkitaspectsdialog.cpp +++ b/src/plugins/projectexplorer/filterkitaspectsdialog.cpp @@ -24,7 +24,7 @@ namespace Internal { class FilterTreeItem : public TreeItem { public: - FilterTreeItem(const KitAspect *aspect, bool enabled) : m_aspect(aspect), m_enabled(enabled) + FilterTreeItem(const KitAspectFactory *aspect, bool enabled) : m_aspect(aspect), m_enabled(enabled) { } QString displayName() const { @@ -72,7 +72,7 @@ private: return flags; } - const KitAspect * const m_aspect; + const KitAspectFactory * const m_aspect; bool m_enabled; }; @@ -82,7 +82,7 @@ public: FilterKitAspectsModel(const Kit *kit, QObject *parent) : TreeModel(parent) { setHeader({Tr::tr("Setting"), Tr::tr("Visible")}); - for (const KitAspect * const aspect : KitManager::kitAspects()) { + for (const KitAspectFactory * const aspect : KitManager::kitAspects()) { if (kit && !aspect->isApplicableToKit(kit)) continue; const QSet<Utils::Id> irrelevantAspects = kit ? kit->irrelevantAspects() diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index 27bad16e8c8..933fff2fb8f 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -69,7 +69,7 @@ public: [kit] { return kit->id().toString(); }); m_macroExpander.registerVariable("Kit:FileSystemName", Tr::tr("Kit filesystem-friendly name"), [kit] { return kit->fileSystemFriendlyName(); }); - for (KitAspect *aspect : KitManager::kitAspects()) + for (KitAspectFactory *aspect : KitManager::kitAspects()) aspect->addToMacroExpander(kit, &m_macroExpander); m_macroExpander.registerVariable("Kit:Name", @@ -235,7 +235,7 @@ bool Kit::hasWarning() const Tasks Kit::validate() const { Tasks result; - for (KitAspect *aspect : KitManager::kitAspects()) + for (KitAspectFactory *aspect : KitManager::kitAspects()) result.append(aspect->validate(this)); d->m_hasError = containsType(result, Task::TaskType::Error); @@ -248,15 +248,15 @@ Tasks Kit::validate() const void Kit::fix() { KitGuard g(this); - for (KitAspect *aspect : KitManager::kitAspects()) + for (KitAspectFactory *aspect : KitManager::kitAspects()) aspect->fix(this); } void Kit::setup() { KitGuard g(this); - const QList<KitAspect *> aspects = KitManager::kitAspects(); - for (KitAspect * const aspect : aspects) + const QList<KitAspectFactory *> aspects = KitManager::kitAspects(); + for (KitAspectFactory * const aspect : aspects) aspect->setup(this); } @@ -265,7 +265,7 @@ void Kit::upgrade() KitGuard g(this); // Process the KitAspects in reverse order: They may only be based on other information // lower in the stack. - for (KitAspect *aspect : KitManager::kitAspects()) + for (KitAspectFactory *aspect : KitManager::kitAspects()) aspect->upgrade(this); } @@ -336,9 +336,9 @@ Id Kit::id() const int Kit::weight() const { - const QList<KitAspect *> &aspects = KitManager::kitAspects(); + const QList<KitAspectFactory *> &aspects = KitManager::kitAspects(); return std::accumulate(aspects.begin(), aspects.end(), 0, - [this](int sum, const KitAspect *aspect) { + [this](int sum, const KitAspectFactory *aspect) { return sum + aspect->weight(this); }); } @@ -526,13 +526,13 @@ QVariantMap Kit::toMap() const void Kit::addToBuildEnvironment(Environment &env) const { - for (KitAspect *aspect : KitManager::kitAspects()) + for (KitAspectFactory *aspect : KitManager::kitAspects()) aspect->addToBuildEnvironment(this, env); } void Kit::addToRunEnvironment(Environment &env) const { - for (KitAspect *aspect : KitManager::kitAspects()) + for (KitAspectFactory *aspect : KitManager::kitAspects()) aspect->addToRunEnvironment(this, env); } @@ -555,7 +555,7 @@ Environment Kit::runEnvironment() const QList<OutputLineParser *> Kit::createOutputParsers() const { QList<OutputLineParser *> parsers{new OsParser}; - for (KitAspect *aspect : KitManager::kitAspects()) + for (KitAspectFactory *aspect : KitManager::kitAspects()) parsers << aspect->createOutputParsers(this); return parsers; } @@ -574,9 +574,9 @@ QString Kit::toHtml(const Tasks &additional, const QString &extraText) const str << "<p>" << ProjectExplorer::toHtml(additional + validate()) << "</p>"; str << "<dl style=\"white-space:pre\">"; - for (KitAspect *aspect : KitManager::kitAspects()) { - const KitAspect::ItemList list = aspect->toUserOutput(this); - for (const KitAspect::Item &j : list) { + for (KitAspectFactory *aspect : KitManager::kitAspects()) { + const KitAspectFactory::ItemList list = aspect->toUserOutput(this); + for (const KitAspectFactory::Item &j : list) { QString contents = j.second; if (contents.size() > 256) { int pos = contents.lastIndexOf("<br>", 256); @@ -619,7 +619,7 @@ void Kit::setSdkProvided(bool sdkProvided) void Kit::makeSticky() { - for (KitAspect *aspect : KitManager::kitAspects()) { + for (KitAspectFactory *aspect : KitManager::kitAspects()) { if (hasValue(aspect->id())) setSticky(aspect->id(), true); } @@ -675,7 +675,7 @@ QSet<Id> Kit::irrelevantAspects() const QSet<Id> Kit::supportedPlatforms() const { QSet<Id> platforms; - for (const KitAspect *aspect : KitManager::kitAspects()) { + for (const KitAspectFactory *aspect : KitManager::kitAspects()) { const QSet<Id> ip = aspect->supportedPlatforms(this); if (ip.isEmpty()) continue; @@ -690,7 +690,7 @@ QSet<Id> Kit::supportedPlatforms() const QSet<Id> Kit::availableFeatures() const { QSet<Id> features; - for (const KitAspect *aspect : KitManager::kitAspects()) + for (const KitAspectFactory *aspect : KitManager::kitAspects()) features |= aspect->availableFeatures(this); return features; } diff --git a/src/plugins/projectexplorer/kit.h b/src/plugins/projectexplorer/kit.h index 6f140d827b5..18c0cc4298f 100644 --- a/src/plugins/projectexplorer/kit.h +++ b/src/plugins/projectexplorer/kit.h @@ -142,7 +142,7 @@ private: const std::unique_ptr<Internal::KitPrivate> d; - friend class KitAspect; + friend class KitAspectFactory; friend class KitManager; friend class Internal::KitManagerPrivate; friend class Internal::KitModel; // needed for setAutoDetected() when cloning kits diff --git a/src/plugins/projectexplorer/kitchooser.cpp b/src/plugins/projectexplorer/kitchooser.cpp index 9e45cacd7dd..f5eff5dc88f 100644 --- a/src/plugins/projectexplorer/kitchooser.cpp +++ b/src/plugins/projectexplorer/kitchooser.cpp @@ -29,7 +29,7 @@ KitChooser::KitChooser(QWidget *parent) : { m_chooser = new QComboBox(this); m_chooser->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - m_manageButton = new QPushButton(KitAspectWidget::msgManage(), this); + m_manageButton = new QPushButton(KitAspect::msgManage(), this); auto layout = new QHBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index 12aac6ebae9..cd35f6e8389 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -46,10 +46,10 @@ const char KITINFORMATION_ID_V3[] = "PE.Profile.ToolChainsV3"; // -------------------------------------------------------------------------- namespace Internal { -class SysRootKitAspectWidget : public KitAspectWidget +class SysRootKitAspectWidget : public KitAspect { public: - SysRootKitAspectWidget(Kit *k, const KitAspect *ki) : KitAspectWidget(k, ki) + SysRootKitAspectWidget(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki) { m_chooser = createSubWidget<PathChooser>(); m_chooser->setExpectedKind(PathChooser::ExistingDirectory); @@ -120,14 +120,14 @@ Tasks SysRootKitAspect::validate(const Kit *k) const return result; } -KitAspectWidget *SysRootKitAspect::createConfigWidget(Kit *k) const +KitAspect *SysRootKitAspect::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); return new Internal::SysRootKitAspectWidget(k, this); } -KitAspect::ItemList SysRootKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList SysRootKitAspect::toUserOutput(const Kit *k) const { return {{Tr::tr("Sys Root"), sysRoot(k).toUserOutput()}}; } @@ -184,10 +184,10 @@ void SysRootKitAspect::setSysRoot(Kit *k, const FilePath &v) // -------------------------------------------------------------------------- namespace Internal { -class ToolChainKitAspectWidget final : public KitAspectWidget +class ToolChainKitAspectWidget final : public KitAspect { public: - ToolChainKitAspectWidget(Kit *k, const KitAspect *ki) : KitAspectWidget(k, ki) + ToolChainKitAspectWidget(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki) { m_mainWidget = createSubWidget<QWidget>(); m_mainWidget->setContentsMargins(0, 0, 0, 0); @@ -502,7 +502,7 @@ void ToolChainKitAspect::setup(Kit *k) k->setSticky(id(), lockToolchains); } -KitAspectWidget *ToolChainKitAspect::createConfigWidget(Kit *k) const +KitAspect *ToolChainKitAspect::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); return new Internal::ToolChainKitAspectWidget(k, this); @@ -514,7 +514,7 @@ QString ToolChainKitAspect::displayNamePostfix(const Kit *k) const return tc ? tc->displayName() : QString(); } -KitAspect::ItemList ToolChainKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList ToolChainKitAspect::toUserOutput(const Kit *k) const { ToolChain *tc = cxxToolChain(k); return {{Tr::tr("Compiler"), tc ? tc->displayName() : Tr::tr("None")}}; @@ -755,11 +755,11 @@ void ToolChainKitAspect::toolChainRemoved(ToolChain *tc) // DeviceTypeKitAspect: // -------------------------------------------------------------------------- namespace Internal { -class DeviceTypeKitAspectWidget final : public KitAspectWidget +class DeviceTypeKitAspectWidget final : public KitAspect { public: - DeviceTypeKitAspectWidget(Kit *workingCopy, const KitAspect *ki) - : KitAspectWidget(workingCopy, ki), m_comboBox(createSubWidget<QComboBox>()) + DeviceTypeKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki) + : KitAspect(workingCopy, ki), m_comboBox(createSubWidget<QComboBox>()) { for (IDeviceFactory *factory : IDeviceFactory::allDeviceFactories()) m_comboBox->addItem(factory->displayName(), factory->deviceType().toSetting()); @@ -825,13 +825,13 @@ Tasks DeviceTypeKitAspect::validate(const Kit *k) const return {}; } -KitAspectWidget *DeviceTypeKitAspect::createConfigWidget(Kit *k) const +KitAspect *DeviceTypeKitAspect::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); return new Internal::DeviceTypeKitAspectWidget(k, this); } -KitAspect::ItemList DeviceTypeKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList DeviceTypeKitAspect::toUserOutput(const Kit *k) const { QTC_ASSERT(k, return {}); Id type = deviceTypeId(k); @@ -876,11 +876,11 @@ QSet<Id> DeviceTypeKitAspect::availableFeatures(const Kit *k) const // DeviceKitAspect: // -------------------------------------------------------------------------- namespace Internal { -class DeviceKitAspectWidget final : public KitAspectWidget +class DeviceKitAspectWidget final : public KitAspect { public: - DeviceKitAspectWidget(Kit *workingCopy, const KitAspect *ki) - : KitAspectWidget(workingCopy, ki), + DeviceKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki) + : KitAspect(workingCopy, ki), m_comboBox(createSubWidget<QComboBox>()), m_model(new DeviceManagerModel(DeviceManager::instance())) { @@ -1014,7 +1014,7 @@ void DeviceKitAspect::setup(Kit *k) setDeviceId(k, Id::fromSetting(defaultValue(k))); } -KitAspectWidget *DeviceKitAspect::createConfigWidget(Kit *k) const +KitAspect *DeviceKitAspect::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); return new Internal::DeviceKitAspectWidget(k, this); @@ -1026,7 +1026,7 @@ QString DeviceKitAspect::displayNamePostfix(const Kit *k) const return dev.isNull() ? QString() : dev->displayName(); } -KitAspect::ItemList DeviceKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList DeviceKitAspect::toUserOutput(const Kit *k) const { IDevice::ConstPtr dev = device(k); return {{Tr::tr("Device"), dev.isNull() ? Tr::tr("Unconfigured") : dev->displayName()}}; @@ -1138,11 +1138,11 @@ void DeviceKitAspect::devicesChanged() // BuildDeviceKitAspect: // -------------------------------------------------------------------------- namespace Internal { -class BuildDeviceKitAspectWidget final : public KitAspectWidget +class BuildDeviceKitAspectWidget final : public KitAspect { public: - BuildDeviceKitAspectWidget(Kit *workingCopy, const KitAspect *ki) - : KitAspectWidget(workingCopy, ki), + BuildDeviceKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki) + : KitAspect(workingCopy, ki), m_comboBox(createSubWidget<QComboBox>()), m_model(new DeviceManagerModel(DeviceManager::instance())) { @@ -1256,7 +1256,7 @@ Tasks BuildDeviceKitAspect::validate(const Kit *k) const return result; } -KitAspectWidget *BuildDeviceKitAspect::createConfigWidget(Kit *k) const +KitAspect *BuildDeviceKitAspect::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); return new Internal::BuildDeviceKitAspectWidget(k, this); @@ -1268,7 +1268,7 @@ QString BuildDeviceKitAspect::displayNamePostfix(const Kit *k) const return dev.isNull() ? QString() : dev->displayName(); } -KitAspect::ItemList BuildDeviceKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList BuildDeviceKitAspect::toUserOutput(const Kit *k) const { IDevice::ConstPtr dev = device(k); return {{Tr::tr("Build device"), dev.isNull() ? Tr::tr("Unconfigured") : dev->displayName()}}; @@ -1388,11 +1388,11 @@ static bool enforcesMSVCEnglish(const EnvironmentItems &changes) } namespace Internal { -class EnvironmentKitAspectWidget final : public KitAspectWidget +class EnvironmentKitAspectWidget final : public KitAspect { public: - EnvironmentKitAspectWidget(Kit *workingCopy, const KitAspect *ki) - : KitAspectWidget(workingCopy, ki), + EnvironmentKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki) + : KitAspect(workingCopy, ki), m_summaryLabel(createSubWidget<ElidingLabel>()), m_manageButton(createSubWidget<QPushButton>()), m_mainWidget(createSubWidget<QWidget>()) @@ -1532,13 +1532,13 @@ void EnvironmentKitAspect::addToRunEnvironment(const Kit *k, Environment &env) c addToBuildEnvironment(k, env); } -KitAspectWidget *EnvironmentKitAspect::createConfigWidget(Kit *k) const +KitAspect *EnvironmentKitAspect::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); return new Internal::EnvironmentKitAspectWidget(k, this); } -KitAspect::ItemList EnvironmentKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList EnvironmentKitAspect::toUserOutput(const Kit *k) const { return {{Tr::tr("Environment"), EnvironmentItem::toStringList(environmentChanges(k)).join("<br>")}}; } diff --git a/src/plugins/projectexplorer/kitinformation.h b/src/plugins/projectexplorer/kitinformation.h index 65924ec1aec..8a9a79b57a0 100644 --- a/src/plugins/projectexplorer/kitinformation.h +++ b/src/plugins/projectexplorer/kitinformation.h @@ -16,13 +16,13 @@ namespace ProjectExplorer { class OutputTaskParser; class ToolChain; -class KitAspectWidget; +class KitAspect; // -------------------------------------------------------------------------- // SysRootInformation: // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT SysRootKitAspect : public KitAspect +class PROJECTEXPLORER_EXPORT SysRootKitAspect : public KitAspectFactory { Q_OBJECT @@ -30,7 +30,7 @@ public: SysRootKitAspect(); Tasks validate(const Kit *k) const override; - KitAspectWidget *createConfigWidget(Kit *k) const override; + KitAspect *createKitAspect(Kit *k) const override; ItemList toUserOutput(const Kit *k) const override; void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override; @@ -43,7 +43,7 @@ public: // ToolChainInformation: // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT ToolChainKitAspect : public KitAspect +class PROJECTEXPLORER_EXPORT ToolChainKitAspect : public KitAspectFactory { Q_OBJECT @@ -55,7 +55,7 @@ public: void fix(Kit *k) override; void setup(Kit *k) override; - KitAspectWidget *createConfigWidget(Kit *k) const override; + KitAspect *createKitAspect(Kit *k) const override; QString displayNamePostfix(const Kit *k) const override; @@ -91,7 +91,7 @@ private: // DeviceTypeInformation: // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT DeviceTypeKitAspect : public KitAspect +class PROJECTEXPLORER_EXPORT DeviceTypeKitAspect : public KitAspectFactory { Q_OBJECT @@ -100,7 +100,7 @@ public: void setup(Kit *k) override; Tasks validate(const Kit *k) const override; - KitAspectWidget *createConfigWidget(Kit *k) const override; + KitAspect *createKitAspect(Kit *k) const override; ItemList toUserOutput(const Kit *k) const override; static const Utils::Id id(); @@ -115,7 +115,7 @@ public: // DeviceInformation: // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT DeviceKitAspect : public KitAspect +class PROJECTEXPLORER_EXPORT DeviceKitAspect : public KitAspectFactory { Q_OBJECT @@ -126,7 +126,7 @@ public: void fix(Kit *k) override; void setup(Kit *k) override; - KitAspectWidget *createConfigWidget(Kit *k) const override; + KitAspect *createKitAspect(Kit *k) const override; QString displayNamePostfix(const Kit *k) const override; @@ -154,7 +154,7 @@ private: // BuildDeviceInformation: // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT BuildDeviceKitAspect : public KitAspect +class PROJECTEXPLORER_EXPORT BuildDeviceKitAspect : public KitAspectFactory { Q_OBJECT @@ -164,7 +164,7 @@ public: void setup(Kit *k) override; Tasks validate(const Kit *k) const override; - KitAspectWidget *createConfigWidget(Kit *k) const override; + KitAspect *createKitAspect(Kit *k) const override; QString displayNamePostfix(const Kit *k) const override; @@ -191,7 +191,7 @@ private: // EnvironmentKitAspect: // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT EnvironmentKitAspect : public KitAspect +class PROJECTEXPLORER_EXPORT EnvironmentKitAspect : public KitAspectFactory { Q_OBJECT @@ -204,7 +204,7 @@ public: void addToBuildEnvironment(const Kit *k, Utils::Environment &env) const override; void addToRunEnvironment(const Kit *, Utils::Environment &) const override; - KitAspectWidget *createConfigWidget(Kit *k) const override; + KitAspect *createKitAspect(Kit *k) const override; ItemList toUserOutput(const Kit *k) const override; diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 7c1eaa83f05..2da4794ca0b 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -75,23 +75,23 @@ public: std::unique_ptr<PersistentSettingsWriter> m_writer; QSet<Id> m_irrelevantAspects; - void addKitAspect(KitAspect *ki) + void addKitAspect(KitAspectFactory *ki) { QTC_ASSERT(!m_aspectList.contains(ki), return); m_aspectList.append(ki); m_aspectListIsSorted = false; } - void removeKitAspect(KitAspect *ki) + void removeKitAspect(KitAspectFactory *ki) { int removed = m_aspectList.removeAll(ki); QTC_CHECK(removed == 1); } - const QList<KitAspect *> kitAspects() + const QList<KitAspectFactory *> kitAspects() { if (!m_aspectListIsSorted) { - Utils::sort(m_aspectList, [](const KitAspect *a, const KitAspect *b) { + Utils::sort(m_aspectList, [](const KitAspectFactory *a, const KitAspectFactory *b) { return a->priority() > b->priority(); }); m_aspectListIsSorted = true; @@ -104,7 +104,7 @@ public: private: // Sorted by priority, in descending order... - QList<KitAspect *> m_aspectList; + QList<KitAspectFactory *> m_aspectList; // ... if this here is set: bool m_aspectListIsSorted = true; @@ -196,7 +196,7 @@ void KitManager::restoreKits() Kit *ptr = i->get(); // Overwrite settings that the SDK sets to those values: - for (const KitAspect *aspect : KitManager::kitAspects()) { + for (const KitAspectFactory *aspect : KitManager::kitAspects()) { // Copy sticky settings over: ptr->setSticky(aspect->id(), toStore->isSticky(aspect->id())); if (ptr->isSticky(aspect->id())) @@ -455,7 +455,7 @@ bool KitManager::isLoaded() return d->m_initialized; } -void KitManager::registerKitAspect(KitAspect *ki) +void KitManager::registerKitAspect(KitAspectFactory *ki) { instance(); QTC_ASSERT(d, return); @@ -468,7 +468,7 @@ void KitManager::registerKitAspect(KitAspect *ki) QTC_CHECK(d->m_kitList.empty()); } -void KitManager::deregisterKitAspect(KitAspect *ki) +void KitManager::deregisterKitAspect(KitAspectFactory *ki) { // Happens regularly for the aspects from the ProjectExplorerPlugin as these // are destroyed after the manual call to KitManager::destroy() there, but as @@ -578,7 +578,7 @@ Kit *KitManager::defaultKit() return d->m_defaultKit; } -const QList<KitAspect *> KitManager::kitAspects() +const QList<KitAspectFactory *> KitManager::kitAspects() { return d->kitAspects(); } @@ -653,7 +653,7 @@ void KitManager::completeKit(Kit *k) { QTC_ASSERT(k, return); KitGuard g(k); - for (KitAspect *ki : d->kitAspects()) { + for (KitAspectFactory *ki : d->kitAspects()) { ki->upgrade(k); if (!k->hasValue(ki->id())) ki->setup(k); @@ -666,73 +666,73 @@ void KitManager::completeKit(Kit *k) // KitAspect: // -------------------------------------------------------------------- -KitAspect::KitAspect() +KitAspectFactory::KitAspectFactory() { KitManager::registerKitAspect(this); } -KitAspect::~KitAspect() +KitAspectFactory::~KitAspectFactory() { KitManager::deregisterKitAspect(this); } -int KitAspect::weight(const Kit *k) const +int KitAspectFactory::weight(const Kit *k) const { return k->value(id()).isValid() ? 1 : 0; } -void KitAspect::addToBuildEnvironment(const Kit *k, Environment &env) const +void KitAspectFactory::addToBuildEnvironment(const Kit *k, Environment &env) const { Q_UNUSED(k) Q_UNUSED(env) } -void KitAspect::addToRunEnvironment(const Kit *k, Environment &env) const +void KitAspectFactory::addToRunEnvironment(const Kit *k, Environment &env) const { Q_UNUSED(k) Q_UNUSED(env) } -QList<OutputLineParser *> KitAspect::createOutputParsers(const Kit *k) const +QList<OutputLineParser *> KitAspectFactory::createOutputParsers(const Kit *k) const { Q_UNUSED(k) return {}; } -QString KitAspect::displayNamePostfix(const Kit *k) const +QString KitAspectFactory::displayNamePostfix(const Kit *k) const { Q_UNUSED(k) return {}; } -QSet<Id> KitAspect::supportedPlatforms(const Kit *k) const +QSet<Id> KitAspectFactory::supportedPlatforms(const Kit *k) const { Q_UNUSED(k) return {}; } -QSet<Id> KitAspect::availableFeatures(const Kit *k) const +QSet<Id> KitAspectFactory::availableFeatures(const Kit *k) const { Q_UNUSED(k) return {}; } -void KitAspect::addToMacroExpander(Kit *k, MacroExpander *expander) const +void KitAspectFactory::addToMacroExpander(Kit *k, MacroExpander *expander) const { Q_UNUSED(k) Q_UNUSED(expander) } -void KitAspect::notifyAboutUpdate(Kit *k) +void KitAspectFactory::notifyAboutUpdate(Kit *k) { if (k) k->kitUpdated(); } -KitAspectWidget::KitAspectWidget(Kit *kit, const KitAspect *ki) - : m_kit(kit), m_kitInformation(ki) +KitAspect::KitAspect(Kit *kit, const KitAspectFactory *factory) + : m_kit(kit), m_factory(factory) { - const Id id = ki->id(); + const Id id = factory->id(); m_mutableAction = new QAction(Tr::tr("Mark as Mutable")); m_mutableAction->setCheckable(true); m_mutableAction->setChecked(m_kit->isMutable(id)); @@ -742,16 +742,16 @@ KitAspectWidget::KitAspectWidget(Kit *kit, const KitAspect *ki) }); } -KitAspectWidget::~KitAspectWidget() +KitAspect::~KitAspect() { delete m_mutableAction; } -void KitAspectWidget::addToLayoutWithLabel(Layouting::LayoutItem &parentItem, QWidget *parent) +void KitAspect::addToLayoutWithLabel(Layouting::LayoutItem &parentItem, QWidget *parent) { QTC_ASSERT(parent, return); - auto label = createSubWidget<QLabel>(m_kitInformation->displayName() + ':'); - label->setToolTip(m_kitInformation->description()); + auto label = createSubWidget<QLabel>(m_factory->displayName() + ':'); + label->setToolTip(m_factory->description()); connect(label, &QLabel::linkActivated, this, [this](const QString &link) { emit labelLinkActivated(link); }); @@ -761,14 +761,14 @@ void KitAspectWidget::addToLayoutWithLabel(Layouting::LayoutItem &parentItem, QW parentItem.addItem(Layouting::br); } -void KitAspectWidget::addMutableAction(QWidget *child) +void KitAspect::addMutableAction(QWidget *child) { QTC_ASSERT(child, return); child->addAction(m_mutableAction); child->setContextMenuPolicy(Qt::ActionsContextMenu); } -QWidget *KitAspectWidget::createManageButton(Id pageId) +QWidget *KitAspect::createManageButton(Id pageId) { auto button = createSubWidget<QPushButton>(msgManage()); connect(button, &QPushButton::clicked, this, [pageId] { @@ -777,7 +777,7 @@ QWidget *KitAspectWidget::createManageButton(Id pageId) return button; } -QString KitAspectWidget::msgManage() +QString KitAspect::msgManage() { return Tr::tr("Manage..."); } diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index f25f83ca7f4..ced98ef3e14 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -17,10 +17,6 @@ #include <functional> -QT_BEGIN_NAMESPACE -class QLabel; -QT_END_NAMESPACE - namespace Utils { class Environment; class FilePath; @@ -29,8 +25,7 @@ class OutputLineParser; } // namespace Utils namespace ProjectExplorer { -class Task; -class KitAspectWidget; +class KitAspect; class KitManager; namespace Internal { @@ -38,13 +33,14 @@ class KitManagerConfigWidget; } // namespace Internal /** - * @brief The KitAspect class + * @brief The KitAspectFactory class * - * One piece of information stored in the kit. + * A KitAspectFactory can create instances of one type of KitAspect. + * A KitAspect handles a specific piece of information stored in the kit. * * They auto-register with the \a KitManager for their life time */ -class PROJECTEXPLORER_EXPORT KitAspect : public QObject +class PROJECTEXPLORER_EXPORT KitAspectFactory : public QObject { Q_OBJECT @@ -71,7 +67,7 @@ public: virtual ItemList toUserOutput(const Kit *) const = 0; - virtual KitAspectWidget *createConfigWidget(Kit *) const = 0; + virtual KitAspect *createKitAspect(Kit *) const = 0; virtual void addToBuildEnvironment(const Kit *k, Utils::Environment &env) const; virtual void addToRunEnvironment(const Kit *k, Utils::Environment &env) const; @@ -88,8 +84,8 @@ public: virtual bool isApplicableToKit(const Kit *) const { return true; } protected: - KitAspect(); - ~KitAspect(); + KitAspectFactory(); + ~KitAspectFactory(); void setId(Utils::Id id) { m_id = id; } void setDisplayName(const QString &name) { m_displayName = name; } @@ -106,13 +102,13 @@ private: bool m_essential = false; }; -class PROJECTEXPLORER_EXPORT KitAspectWidget : public Utils::BaseAspect +class PROJECTEXPLORER_EXPORT KitAspect : public Utils::BaseAspect { Q_OBJECT public: - KitAspectWidget(Kit *kit, const KitAspect *ki); - ~KitAspectWidget(); + KitAspect(Kit *kit, const KitAspectFactory *factory); + ~KitAspect(); virtual void makeReadOnly() = 0; virtual void refresh() = 0; @@ -122,14 +118,14 @@ public: static QString msgManage(); Kit *kit() const { return m_kit; } - const KitAspect *kitInformation() const { return m_kitInformation; } + const KitAspectFactory *kitInformation() const { return m_factory; } QAction *mutableAction() const { return m_mutableAction; } void addMutableAction(QWidget *child); QWidget *createManageButton(Utils::Id pageId); protected: Kit *m_kit; - const KitAspect *m_kitInformation; + const KitAspectFactory *m_factory; QAction *m_mutableAction = nullptr; }; @@ -146,7 +142,7 @@ public: static Kit *kit(Utils::Id id); static Kit *defaultKit(); - static const QList<KitAspect *> kitAspects(); + static const QList<KitAspectFactory *> kitAspects(); static const QSet<Utils::Id> irrelevantAspects(); static void setIrrelevantAspects(const QSet<Utils::Id> &aspects); @@ -179,8 +175,8 @@ private: static void destroy(); - static void registerKitAspect(KitAspect *ki); - static void deregisterKitAspect(KitAspect *ki); + static void registerKitAspect(KitAspectFactory *ki); + static void deregisterKitAspect(KitAspectFactory *ki); static void setBinaryForKit(const Utils::FilePath &binary); @@ -194,7 +190,7 @@ private: friend class ProjectExplorerPlugin; // for constructor friend class Kit; friend class Internal::KitManagerConfigWidget; - friend class KitAspect; // for notifyAboutUpdate and self-registration + friend class KitAspectFactory; // for notifyAboutUpdate and self-registration }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index 822844f57d0..9fca99b0948 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -102,7 +102,7 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, bool &isDefaultKit, bool chooser->addSupportedWidget(m_nameEdit); chooser->addMacroExpanderProvider([this] { return m_modifiedKit->macroExpander(); }); - for (KitAspect *aspect : KitManager::kitAspects()) + for (KitAspectFactory *aspect : KitManager::kitAspects()) addAspectToWorkingCopy(page, aspect); page.attachTo(this); @@ -195,10 +195,10 @@ QString KitManagerConfigWidget::validityMessage() const return m_modifiedKit->toHtml(tmp); } -void KitManagerConfigWidget::addAspectToWorkingCopy(Layouting::LayoutItem &parent, KitAspect *aspect) +void KitManagerConfigWidget::addAspectToWorkingCopy(Layouting::LayoutItem &parent, KitAspectFactory *factory) { - QTC_ASSERT(aspect, return); - KitAspectWidget *widget = aspect->createConfigWidget(workingCopy()); + QTC_ASSERT(factory, return); + KitAspect *widget = factory->createKitAspect(workingCopy()); QTC_ASSERT(widget, return); QTC_ASSERT(!m_widgets.contains(widget), return); @@ -213,8 +213,8 @@ void KitManagerConfigWidget::updateVisibility() { int count = m_widgets.count(); for (int i = 0; i < count; ++i) { - KitAspectWidget *widget = m_widgets.at(i); - const KitAspect *ki = widget->kitInformation(); + KitAspect *widget = m_widgets.at(i); + const KitAspectFactory *ki = widget->kitInformation(); const bool visibleInKit = ki->isApplicableToKit(m_modifiedKit.get()); const bool irrelevant = m_modifiedKit->irrelevantAspects().contains(ki->id()); widget->setVisible(visibleInKit && !irrelevant); @@ -223,7 +223,7 @@ void KitManagerConfigWidget::updateVisibility() void KitManagerConfigWidget::makeStickySubWidgetsReadOnly() { - for (KitAspectWidget *w : std::as_const(m_widgets)) { + for (KitAspect *w : std::as_const(m_widgets)) { if (w->kit()->isSticky(w->kitInformation()->id())) w->makeReadOnly(); } @@ -314,7 +314,7 @@ void KitManagerConfigWidget::workingCopyWasUpdated(Kit *k) k->fix(); m_fixingKit = false; - for (KitAspectWidget *w : std::as_const(m_widgets)) + for (KitAspect *w : std::as_const(m_widgets)) w->refresh(); m_cachedDisplayName.clear(); @@ -342,7 +342,7 @@ void KitManagerConfigWidget::kitWasUpdated(Kit *k) void KitManagerConfigWidget::showEvent(QShowEvent *event) { Q_UNUSED(event) - for (KitAspectWidget *widget : std::as_const(m_widgets)) + for (KitAspect *widget : std::as_const(m_widgets)) widget->refresh(); } diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.h b/src/plugins/projectexplorer/kitmanagerconfigwidget.h index 94218c5de8a..5e516184a6d 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.h +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.h @@ -35,7 +35,7 @@ public: void discard(); bool isDirty() const; QString validityMessage() const; - void addAspectToWorkingCopy(Layouting::LayoutItem &parent, KitAspect *aspect); + void addAspectToWorkingCopy(Layouting::LayoutItem &parent, KitAspectFactory *factory); void makeStickySubWidgetsReadOnly(); Kit *workingCopy() const; @@ -66,7 +66,7 @@ private: QToolButton *m_iconButton; QLineEdit *m_nameEdit; QLineEdit *m_fileSystemFriendlyNameLineEdit; - QList<KitAspectWidget *> m_widgets; + QList<KitAspect *> m_widgets; Kit *m_kit; std::unique_ptr<Kit> m_modifiedKit; bool &m_isDefaultKit; diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 3a1b01b724b..44438dfe1d3 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -565,7 +565,7 @@ int SelectorView::padding() ///////// // KitAreaWidget ///////// -void doLayout(KitAspectWidget *widget, Layouting::LayoutItem &builder) +void doLayout(KitAspect *widget, Layouting::LayoutItem &builder) { widget->addToLayout(builder); } @@ -593,9 +593,9 @@ public: delete layout(); Layouting::Grid grid; - for (KitAspect *aspect : KitManager::kitAspects()) { + for (KitAspectFactory *aspect : KitManager::kitAspects()) { if (k && k->isMutable(aspect->id())) { - KitAspectWidget *widget = aspect->createConfigWidget(k); + KitAspect *widget = aspect->createKitAspect(k); m_widgets << widget; grid.addItems({aspect->displayName(), widget, Layouting::br}); } @@ -615,10 +615,10 @@ private: return; bool addedMutables = false; - QList<const KitAspect *> knownList - = Utils::transform(m_widgets, &KitAspectWidget::kitInformation); + QList<const KitAspectFactory *> knownList + = Utils::transform(m_widgets, &KitAspect::kitInformation); - for (KitAspect *aspect : KitManager::kitAspects()) { + for (KitAspectFactory *aspect : KitManager::kitAspects()) { const Utils::Id currentId = aspect->id(); if (m_kit->isMutable(currentId) && !knownList.removeOne(aspect)) { addedMutables = true; @@ -632,13 +632,13 @@ private: setKit(m_kit); } else { // Refresh all widgets if the number of mutable settings did not change - for (KitAspectWidget *w : std::as_const(m_widgets)) + for (KitAspect *w : std::as_const(m_widgets)) w->refresh(); } } Kit *m_kit = nullptr; - QList<KitAspectWidget *> m_widgets; + QList<KitAspect *> m_widgets; }; ///////// diff --git a/src/plugins/projectexplorer/targetsetupwidget.cpp b/src/plugins/projectexplorer/targetsetupwidget.cpp index 63b61401d5f..50e86ef02b8 100644 --- a/src/plugins/projectexplorer/targetsetupwidget.cpp +++ b/src/plugins/projectexplorer/targetsetupwidget.cpp @@ -52,7 +52,7 @@ TargetSetupWidget::TargetSetupWidget(Kit *k, const FilePath &projectPath) : auto panel = new FadingWidget(m_detailsWidget); auto panelLayout = new QHBoxLayout(panel); - m_manageButton = new QPushButton(KitAspectWidget::msgManage()); + m_manageButton = new QPushButton(KitAspect::msgManage()); panelLayout->addWidget(m_manageButton); m_detailsWidget->setToolWidget(panel); diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.cpp b/src/plugins/qbsprojectmanager/qbskitinformation.cpp index b9cb79231d9..6a93a73ef16 100644 --- a/src/plugins/qbsprojectmanager/qbskitinformation.cpp +++ b/src/plugins/qbsprojectmanager/qbskitinformation.cpp @@ -20,11 +20,11 @@ using namespace ProjectExplorer; namespace QbsProjectManager { namespace Internal { -class AspectWidget final : public KitAspectWidget +class AspectWidget final : public KitAspect { public: - AspectWidget(Kit *kit, const KitAspect *kitInfo) - : KitAspectWidget(kit, kitInfo), + AspectWidget(Kit *kit, const KitAspectFactory *kitInfo) + : KitAspect(kit, kitInfo), m_contentLabel(createSubWidget<Utils::ElidingLabel>()), m_changeButton(createSubWidget<QPushButton>(Tr::tr("Change..."))) { @@ -92,12 +92,12 @@ Utils::Id QbsKitAspect::id() Tasks QbsKitAspect::validate(const Kit *) const { return {}; } -KitAspect::ItemList QbsKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList QbsKitAspect::toUserOutput(const Kit *k) const { return {{displayName(), representation(k)}}; } -KitAspectWidget *QbsKitAspect::createConfigWidget(Kit *k) const +KitAspect *QbsKitAspect::createKitAspect(Kit *k) const { return new AspectWidget(k, this); } diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.h b/src/plugins/qbsprojectmanager/qbskitinformation.h index 95276df31eb..737e1ba384d 100644 --- a/src/plugins/qbsprojectmanager/qbskitinformation.h +++ b/src/plugins/qbsprojectmanager/qbskitinformation.h @@ -8,7 +8,7 @@ namespace QbsProjectManager { namespace Internal { -class QbsKitAspect final : public ProjectExplorer::KitAspect +class QbsKitAspect final : public ProjectExplorer::KitAspectFactory { Q_OBJECT @@ -24,7 +24,7 @@ private: ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *) const override; ItemList toUserOutput(const ProjectExplorer::Kit *) const override; - ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *) const override; + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const override; }; } // namespace Internal diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp index c413758048c..7ad0fbf94f5 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp @@ -26,11 +26,11 @@ using namespace Utils; namespace QmakeProjectManager { namespace Internal { -class QmakeKitAspectWidget final : public KitAspectWidget +class QmakeKitAspectWidget final : public KitAspect { public: - QmakeKitAspectWidget(Kit *k, const KitAspect *ki) - : KitAspectWidget(k, ki), m_lineEdit(createSubWidget<QLineEdit>()) + QmakeKitAspectWidget(Kit *k, const KitAspectFactory *ki) + : KitAspect(k, ki), m_lineEdit(createSubWidget<QLineEdit>()) { refresh(); // set up everything according to kit m_lineEdit->setToolTip(ki->description()); @@ -89,12 +89,12 @@ Tasks QmakeKitAspect::validate(const Kit *k) const return result; } -KitAspectWidget *QmakeKitAspect::createConfigWidget(Kit *k) const +KitAspect *QmakeKitAspect::createKitAspect(Kit *k) const { return new Internal::QmakeKitAspectWidget(k, this); } -KitAspect::ItemList QmakeKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList QmakeKitAspect::toUserOutput(const Kit *k) const { return {{Tr::tr("mkspec"), QDir::toNativeSeparators(mkspec(k))}}; } diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.h b/src/plugins/qmakeprojectmanager/qmakekitinformation.h index 0db044b8309..6d2b0ab2cde 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.h +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.h @@ -8,7 +8,7 @@ namespace QmakeProjectManager { namespace Internal { -class QmakeKitAspect : public ProjectExplorer::KitAspect +class QmakeKitAspect : public ProjectExplorer::KitAspectFactory { Q_OBJECT @@ -17,7 +17,7 @@ public: ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override; - ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const override; + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const override; ItemList toUserOutput(const ProjectExplorer::Kit *k) const override; diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitinformation.cpp index fe773f4995e..020c35523a4 100644 --- a/src/plugins/qtsupport/qtkitinformation.cpp +++ b/src/plugins/qtsupport/qtkitinformation.cpp @@ -30,10 +30,10 @@ using namespace Utils; namespace QtSupport { namespace Internal { -class QtKitAspectWidget final : public KitAspectWidget +class QtKitAspectWidget final : public KitAspect { public: - QtKitAspectWidget(Kit *k, const KitAspect *ki) : KitAspectWidget(k, ki) + QtKitAspectWidget(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki) { m_combo = createSubWidget<QComboBox>(); m_combo->setSizePolicy(QSizePolicy::Ignored, m_combo->sizePolicy().verticalPolicy()); @@ -260,7 +260,7 @@ void QtKitAspect::fix(Kit *k) } } -KitAspectWidget *QtKitAspect::createConfigWidget(Kit *k) const +KitAspect *QtKitAspect::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); return new Internal::QtKitAspectWidget(k, this); @@ -272,7 +272,7 @@ QString QtKitAspect::displayNamePostfix(const Kit *k) const return version ? version->displayName() : QString(); } -KitAspect::ItemList QtKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList QtKitAspect::toUserOutput(const Kit *k) const { QtVersion *version = qtVersion(k); return {{Tr::tr("Qt version"), version ? version->displayName() : Tr::tr("None")}}; diff --git a/src/plugins/qtsupport/qtkitinformation.h b/src/plugins/qtsupport/qtkitinformation.h index c2808514b3f..367ab560ffc 100644 --- a/src/plugins/qtsupport/qtkitinformation.h +++ b/src/plugins/qtsupport/qtkitinformation.h @@ -13,7 +13,7 @@ namespace Utils { class MacroExpander; } namespace QtSupport { -class QTSUPPORT_EXPORT QtKitAspect : public ProjectExplorer::KitAspect +class QTSUPPORT_EXPORT QtKitAspect : public ProjectExplorer::KitAspectFactory { Q_OBJECT @@ -25,7 +25,7 @@ public: ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override; void fix(ProjectExplorer::Kit *) override; - ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *k) const override; + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const override; QString displayNamePostfix(const ProjectExplorer::Kit *k) const override; From 0a3aad0093957a45ec0feb95be169adfb3b7689f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 10 Aug 2023 13:30:29 +0200 Subject: [PATCH 0675/1777] Debugger: Name KitAspect related classes more similar to their bases Change-Id: I2f18f382ccedfde343c72f8a9562f900faa43756 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../debugger/debuggerkitinformation.cpp | 51 +++++++++---------- src/plugins/debugger/debuggerkitinformation.h | 35 ++++++------- src/plugins/debugger/debuggerplugin.cpp | 2 +- 3 files changed, 42 insertions(+), 46 deletions(-) diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index 35c5b4d26a0..28b85b939ab 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -35,10 +35,10 @@ namespace Debugger { namespace Internal { -class DebuggerKitAspectWidget final : public KitAspect +class DebuggerKitAspectImpl final : public KitAspect { public: - DebuggerKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki) + DebuggerKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki) : KitAspect(workingCopy, ki) { m_comboBox = createSubWidget<QComboBox>(); @@ -47,13 +47,19 @@ public: refresh(); m_comboBox->setToolTip(ki->description()); - connect(m_comboBox, &QComboBox::currentIndexChanged, - this, &DebuggerKitAspectWidget::currentDebuggerChanged); + connect(m_comboBox, &QComboBox::currentIndexChanged, this, [this] { + if (m_ignoreChanges.isLocked()) + return; + + int currentIndex = m_comboBox->currentIndex(); + QVariant id = m_comboBox->itemData(currentIndex); + m_kit->setValue(DebuggerKitAspect::id(), id); + }); m_manageButton = createManageButton(ProjectExplorer::Constants::DEBUGGER_SETTINGS_PAGE_ID); } - ~DebuggerKitAspectWidget() override + ~DebuggerKitAspectImpl() override { delete m_comboBox; delete m_manageButton; @@ -103,17 +109,6 @@ private: updateComboBox(item ? item->id() : QVariant()); } - void currentDebuggerChanged(int idx) - { - Q_UNUSED(idx) - if (m_ignoreChanges.isLocked()) - return; - - int currentIndex = m_comboBox->currentIndex(); - QVariant id = m_comboBox->itemData(currentIndex); - m_kit->setValue(DebuggerKitAspect::id(), id); - } - QVariant currentId() const { return m_comboBox->itemData(m_comboBox->currentIndex()); } void updateComboBox(const QVariant &id) @@ -133,7 +128,7 @@ private: }; } // namespace Internal -DebuggerKitAspect::DebuggerKitAspect() +DebuggerKitAspectFactory::DebuggerKitAspectFactory() { setObjectName("DebuggerKitAspect"); setId(DebuggerKitAspect::id()); @@ -142,7 +137,7 @@ DebuggerKitAspect::DebuggerKitAspect() setPriority(28000); } -void DebuggerKitAspect::setup(Kit *k) +void DebuggerKitAspectFactory::setup(Kit *k) { QTC_ASSERT(k, return); @@ -159,7 +154,7 @@ void DebuggerKitAspect::setup(Kit *k) // <value type="QString" key="Binary">auto</value> // <value type="int" key="EngineType">4</value> // </valuemap> - const QVariant rawId = k->value(DebuggerKitAspect::id()); + const QVariant rawId = k->value(DebuggerKitAspectFactory::id()); const Abi tcAbi = ToolChainKitAspect::targetAbi(k); @@ -348,45 +343,45 @@ Tasks DebuggerKitAspect::validateDebugger(const Kit *k) return result; } -KitAspect *DebuggerKitAspect::createKitAspect(Kit *k) const +KitAspect *DebuggerKitAspectFactory::createKitAspect(Kit *k) const { - return new Internal::DebuggerKitAspectWidget(k, this); + return new Internal::DebuggerKitAspectImpl(k, this); } -void DebuggerKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const +void DebuggerKitAspectFactory::addToMacroExpander(Kit *kit, MacroExpander *expander) const { QTC_ASSERT(kit, return); expander->registerVariable("Debugger:Name", Tr::tr("Name of Debugger"), [kit]() -> QString { - const DebuggerItem *item = debugger(kit); + const DebuggerItem *item = DebuggerKitAspect::debugger(kit); return item ? item->displayName() : Tr::tr("Unknown debugger"); }); expander->registerVariable("Debugger:Type", Tr::tr("Type of Debugger Backend"), [kit]() -> QString { - const DebuggerItem *item = debugger(kit); + const DebuggerItem *item = DebuggerKitAspect::debugger(kit); return item ? item->engineTypeName() : Tr::tr("Unknown debugger type"); }); expander->registerVariable("Debugger:Version", Tr::tr("Debugger"), [kit]() -> QString { - const DebuggerItem *item = debugger(kit); + const DebuggerItem *item = DebuggerKitAspect::debugger(kit); return item && !item->version().isEmpty() ? item->version() : Tr::tr("Unknown debugger version"); }); expander->registerVariable("Debugger:Abi", Tr::tr("Debugger"), [kit]() -> QString { - const DebuggerItem *item = debugger(kit); + const DebuggerItem *item = DebuggerKitAspect::debugger(kit); return item && !item->abis().isEmpty() ? item->abiNames().join(' ') : Tr::tr("Unknown debugger ABI"); }); } -KitAspectFactory::ItemList DebuggerKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList DebuggerKitAspectFactory::toUserOutput(const Kit *k) const { - return {{Tr::tr("Debugger"), displayString(k)}}; + return {{Tr::tr("Debugger"), DebuggerKitAspect::displayString(k)}}; } DebuggerEngineType DebuggerKitAspect::engineType(const Kit *k) diff --git a/src/plugins/debugger/debuggerkitinformation.h b/src/plugins/debugger/debuggerkitinformation.h index 401b4079972..22379a332be 100644 --- a/src/plugins/debugger/debuggerkitinformation.h +++ b/src/plugins/debugger/debuggerkitinformation.h @@ -12,19 +12,9 @@ namespace Debugger { class DebuggerItem; -class DEBUGGER_EXPORT DebuggerKitAspect : public ProjectExplorer::KitAspectFactory +class DEBUGGER_EXPORT DebuggerKitAspect { public: - DebuggerKitAspect(); - - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override - { return DebuggerKitAspect::validateDebugger(k); } - - void setup(ProjectExplorer::Kit *k) override; - - static const DebuggerItem *debugger(const ProjectExplorer::Kit *kit); - static ProjectExplorer::Runnable runnable(const ProjectExplorer::Kit *kit); - enum ConfigurationError { NoConfigurationError = 0x0, @@ -38,17 +28,28 @@ public: static ProjectExplorer::Tasks validateDebugger(const ProjectExplorer::Kit *k); static ConfigurationErrors configurationErrors(const ProjectExplorer::Kit *k); + static const DebuggerItem *debugger(const ProjectExplorer::Kit *kit); + static ProjectExplorer::Runnable runnable(const ProjectExplorer::Kit *kit); + static void setDebugger(ProjectExplorer::Kit *k, const QVariant &id); + static DebuggerEngineType engineType(const ProjectExplorer::Kit *k); + static QString displayString(const ProjectExplorer::Kit *k); + static Utils::Id id(); +}; + +class DEBUGGER_EXPORT DebuggerKitAspectFactory : public ProjectExplorer::KitAspectFactory +{ +public: + DebuggerKitAspectFactory(); + + ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override + { return DebuggerKitAspect::validateDebugger(k); } + + void setup(ProjectExplorer::Kit *k) override; ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const override; void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override; ItemList toUserOutput(const ProjectExplorer::Kit *k) const override; - - static void setDebugger(ProjectExplorer::Kit *k, const QVariant &id); - - static Utils::Id id(); - static DebuggerEngineType engineType(const ProjectExplorer::Kit *k); - static QString displayString(const ProjectExplorer::Kit *k); }; } // Debugger diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 6523b1675c8..7d39b9ed725 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -687,7 +687,7 @@ public: Perspective m_perspective{Constants::PRESET_PERSPECTIVE_ID, Tr::tr("Debugger")}; std::unique_ptr<Perspective> m_perspectiveCmake; - DebuggerKitAspect debuggerKitAspect; + DebuggerKitAspectFactory debuggerKitAspect; DebuggerRunWorkerFactory debuggerWorkerFactory; From b128c585d951082f23faf609f1599944812dcdfa Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 10 Aug 2023 14:34:39 +0200 Subject: [PATCH 0676/1777] TextEditor: render suggestion with the tab width of the editor Fixes: QTCREATORBUG-29483 Change-Id: Id8da019130055ce40bd639d038eb1e74d9787884 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/texteditor/texteditor.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 9cee311e6d9..82948a8c16d 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -1735,6 +1735,10 @@ void TextEditorWidgetPrivate::insertSuggestion(std::unique_ptr<TextSuggestion> & auto cursor = q->textCursor(); cursor.setPosition(suggestion->position()); + QTextOption option = suggestion->document()->defaultTextOption(); + option.setTabStopDistance(charWidth() * m_document->tabSettings().m_tabSize); + suggestion->document()->setDefaultTextOption(option); + auto options = suggestion->document()->defaultTextOption(); m_suggestionBlock = cursor.block(); m_document->insertSuggestion(std::move(suggestion)); } @@ -8731,6 +8735,11 @@ void TextEditorWidgetPrivate::updateTabStops() QTextOption option = q->document()->defaultTextOption(); option.setTabStopDistance(charWidth() * m_document->tabSettings().m_tabSize); q->document()->setDefaultTextOption(option); + if (TextSuggestion *suggestion = TextDocumentLayout::suggestion(m_suggestionBlock)) { + QTextOption option = suggestion->document()->defaultTextOption(); + option.setTabStopDistance(option.tabStopDistance()); + suggestion->document()->setDefaultTextOption(option); + } } void TextEditorWidgetPrivate::applyTabSettings() From 74a0313fcf0aeffdaad9583db2ca8dc5f78e99a7 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 8 Aug 2023 12:50:01 +0200 Subject: [PATCH 0677/1777] CPlusPlus: Support associating comments with a declaration This will serve as the basic building block for several comment-related features. Task-number: QTCREATORBUG-6934 Task-number: QTCREATORBUG-12051 Task-number: QTCREATORBUG-13877 Change-Id: Ic68587c0d7985dc731da9f539884590fcec764de Reviewed-by: David Schulz <david.schulz@qt.io> --- src/libs/cplusplus/CMakeLists.txt | 1 + src/libs/cplusplus/cplusplus.qbs | 1 + src/libs/cplusplus/declarationcomments.cpp | 145 +++++++++++ src/libs/cplusplus/declarationcomments.h | 21 ++ tests/auto/cplusplus/CMakeLists.txt | 1 + tests/auto/cplusplus/cplusplus.qbs | 1 + .../declarationcomments/CMakeLists.txt | 4 + .../declarationcomments.qbs | 6 + .../tst_declarationcomments.cpp | 225 ++++++++++++++++++ 9 files changed, 405 insertions(+) create mode 100644 src/libs/cplusplus/declarationcomments.cpp create mode 100644 src/libs/cplusplus/declarationcomments.h create mode 100644 tests/auto/cplusplus/declarationcomments/CMakeLists.txt create mode 100644 tests/auto/cplusplus/declarationcomments/declarationcomments.qbs create mode 100644 tests/auto/cplusplus/declarationcomments/tst_declarationcomments.cpp diff --git a/src/libs/cplusplus/CMakeLists.txt b/src/libs/cplusplus/CMakeLists.txt index c99a66c1f89..2fe5c63fe17 100644 --- a/src/libs/cplusplus/CMakeLists.txt +++ b/src/libs/cplusplus/CMakeLists.txt @@ -32,6 +32,7 @@ add_qtc_library(CPlusPlus TypeOfExpression.cpp TypeOfExpression.h TypePrettyPrinter.cpp TypePrettyPrinter.h cppmodelmanagerbase.cpp cppmodelmanagerbase.h + declarationcomments.cpp declarationcomments.h findcdbbreakpoint.cpp findcdbbreakpoint.h pp-cctype.h pp-engine.cpp pp-engine.h pp-scanner.cpp diff --git a/src/libs/cplusplus/cplusplus.qbs b/src/libs/cplusplus/cplusplus.qbs index 0aed0ab438f..b774618f75c 100644 --- a/src/libs/cplusplus/cplusplus.qbs +++ b/src/libs/cplusplus/cplusplus.qbs @@ -96,6 +96,7 @@ Project { "CppDocument.cpp", "CppDocument.h", "CppRewriter.cpp", "CppRewriter.h", "cppmodelmanagerbase.cpp", "cppmodelmanagerbase.h", + "declarationcomments.cpp", "declarationcomments.h", "DependencyTable.cpp", "DependencyTable.h", "DeprecatedGenTemplateInstance.cpp", "DeprecatedGenTemplateInstance.h", "ExpressionUnderCursor.cpp", "ExpressionUnderCursor.h", diff --git a/src/libs/cplusplus/declarationcomments.cpp b/src/libs/cplusplus/declarationcomments.cpp new file mode 100644 index 00000000000..2283fa847ff --- /dev/null +++ b/src/libs/cplusplus/declarationcomments.cpp @@ -0,0 +1,145 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "declarationcomments.h" + +#include <cplusplus/ASTPath.h> +#include <cplusplus/CppDocument.h> +#include <cplusplus/Overview.h> + +#include <utils/algorithm.h> + +#include <QRegularExpression> +#include <QTextBlock> +#include <QTextDocument> + +namespace CPlusPlus { + +QList<Token> commentsForDeclaration(const Symbol *symbol, const Snapshot &snapshot, + const QTextDocument &textDoc) +{ + // Set up cpp document. + const Document::Ptr cppDoc = snapshot.preprocessedDocument(textDoc.toPlainText().toUtf8(), + symbol->filePath()); + cppDoc->parse(); + TranslationUnit * const tu = cppDoc->translationUnit(); + if (!tu || !tu->isParsed()) + return {}; + + // Find the symbol declaration's AST node. + // We stop at the last declaration node that precedes the symbol, except: + // - For parameter declarations, we just continue, because we are interested in the function. + // - If the declaration node is preceded directly by another one, we choose that one instead, + // because with nested declarations we want the outer one (e.g. templates). + int line, column; + tu->getTokenPosition(symbol->sourceLocation(), &line, &column); + const QList<AST *> astPath = ASTPath(cppDoc)(line, column); + if (astPath.isEmpty()) + return {}; + if (astPath.last()->firstToken() != symbol->sourceLocation()) + return {}; + const AST *declAst = nullptr; + bool needsSymbolReference = false; + bool isParameter = false; + for (auto it = std::next(std::rbegin(astPath)); it != std::rend(astPath); ++it) { + AST * const node = *it; + if (node->asParameterDeclaration()) { + needsSymbolReference = true; + isParameter = true; + continue; + } + if (node->asDeclaration()) { + declAst = node; + continue; + } + if (declAst) + break; + } + if (!declAst) + return {}; + + // Get the list of all tokens (including comments) and find the declaration start token there. + const Token &declToken = tu->tokenAt(declAst->firstToken()); + std::vector<Token> allTokens = tu->allTokens(); + QTC_ASSERT(!allTokens.empty(), return {}); + int tokenPos = -1; + for (int i = 0; i < int(allTokens.size()); ++i) { + if (allTokens.at(i).byteOffset == declToken.byteOffset) { + tokenPos = i; + break; + } + } + if (tokenPos == -1) + return {}; + + // Go backwards in the token list and collect all associated comments. + struct Comment { + Token token; + QTextBlock startBlock; + QTextBlock endBlock; + }; + QList<Comment> comments; + Kind commentKind = T_EOF_SYMBOL; + const auto blockForTokenStart = [&](const Token &tok) { + return textDoc.findBlock(tu->getTokenPositionInDocument(tok, &textDoc)); + }; + const auto blockForTokenEnd = [&](const Token &tok) { + return textDoc.findBlock(tu->getTokenEndPositionInDocument(tok, &textDoc)); + }; + for (int i = tokenPos - 1; i >= 0; --i) { + const Token &tok = allTokens.at(i); + if (!tok.isComment()) + break; + const QTextBlock tokenEndBlock = blockForTokenEnd(tok); + if (commentKind == T_EOF_SYMBOL) { + if (tokenEndBlock.next() != blockForTokenStart(declToken)) + needsSymbolReference = true; + commentKind = tok.kind(); + } else { + // If it's not the same kind of comment, it's not part of our comment block. + if (tok.kind() != commentKind) + break; + + // If there are empty lines between the comments, we don't consider them as + // belonging together. + if (tokenEndBlock.next() != comments.first().startBlock) + break; + } + + comments.push_front({tok, blockForTokenStart(tok), tokenEndBlock}); + } + + if (comments.isEmpty()) + return {}; + + const auto tokenList = [&] { + return Utils::transform<QList<Token>>(comments, &Comment::token); + }; + + // We consider the comment block as associated with the symbol if it + // a) precedes it directly, without any empty lines in between or + // b) the symbol name occurs in it. + // Obviously, this heuristic can yield false positives in the case of very short names, + // but if a symbol is important enough to get documented, it should also have a proper name. + // Note that for function parameters, we always require the name to occur in the comment. + + if (!needsSymbolReference) // a) + return tokenList(); + + // b) + const QString symbolName = Overview().prettyName(symbol->name()); + const Kind tokenKind = comments.first().token.kind(); + const bool isDoxygenComment = tokenKind == T_DOXY_COMMENT || tokenKind == T_CPP_DOXY_COMMENT; + const QRegularExpression symbolRegExp(QString("%1\\b%2\\b").arg( + isParameter && isDoxygenComment ? "[\\@]param\\s+" : QString(), symbolName)); + for (const Comment &c : std::as_const(comments)) { + for (QTextBlock b = c.startBlock; b.blockNumber() <= c.endBlock.blockNumber(); + b = b.next()) { + if (b.text().contains(symbolRegExp)) + return tokenList(); + } + } + return {}; +} + +} // namespace CPlusPlus diff --git a/src/libs/cplusplus/declarationcomments.h b/src/libs/cplusplus/declarationcomments.h new file mode 100644 index 00000000000..490290450ce --- /dev/null +++ b/src/libs/cplusplus/declarationcomments.h @@ -0,0 +1,21 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <cplusplus/Token.h> + +#include <QList> + +QT_BEGIN_NAMESPACE +class QTextDocument; +QT_END_NAMESPACE + +namespace CPlusPlus { +class Snapshot; + +QList<Token> CPLUSPLUS_EXPORT commentsForDeclaration(const Symbol *symbol, + const Snapshot &snapshot, + const QTextDocument &textDoc); + +} // namespace CPlusPlus diff --git a/tests/auto/cplusplus/CMakeLists.txt b/tests/auto/cplusplus/CMakeLists.txt index 1c85a988cc9..ab83eb9b542 100644 --- a/tests/auto/cplusplus/CMakeLists.txt +++ b/tests/auto/cplusplus/CMakeLists.txt @@ -4,6 +4,7 @@ add_subdirectory(checksymbols) add_subdirectory(codeformatter) add_subdirectory(cppselectionchanger) add_subdirectory(cxx11) +add_subdirectory(declarationcomments) add_subdirectory(fileiterationorder) add_subdirectory(findusages) add_subdirectory(lexer) diff --git a/tests/auto/cplusplus/cplusplus.qbs b/tests/auto/cplusplus/cplusplus.qbs index e50b6881ef5..44b6bde7fae 100644 --- a/tests/auto/cplusplus/cplusplus.qbs +++ b/tests/auto/cplusplus/cplusplus.qbs @@ -9,6 +9,7 @@ Project { "codeformatter/codeformatter.qbs", "cppselectionchanger/cppselectionchanger.qbs", "cxx11/cxx11.qbs", + "declarationcomments/declarationcomments.qbs", "fileiterationorder/fileiterationorder.qbs", "findusages/findusages.qbs", "lexer/lexer.qbs", diff --git a/tests/auto/cplusplus/declarationcomments/CMakeLists.txt b/tests/auto/cplusplus/declarationcomments/CMakeLists.txt new file mode 100644 index 00000000000..bb36a8e306d --- /dev/null +++ b/tests/auto/cplusplus/declarationcomments/CMakeLists.txt @@ -0,0 +1,4 @@ +add_qtc_test(tst_cplusplus_declarationcomments + DEPENDS CppEditor Utils + SOURCES tst_declarationcomments.cpp +) diff --git a/tests/auto/cplusplus/declarationcomments/declarationcomments.qbs b/tests/auto/cplusplus/declarationcomments/declarationcomments.qbs new file mode 100644 index 00000000000..601eb30ec0b --- /dev/null +++ b/tests/auto/cplusplus/declarationcomments/declarationcomments.qbs @@ -0,0 +1,6 @@ +import "../cplusplusautotest.qbs" as CPlusPlusAutotest + +CPlusPlusAutotest { + name: "declaration comments autotest" + files: "tst_declarationcomments.cpp" +} diff --git a/tests/auto/cplusplus/declarationcomments/tst_declarationcomments.cpp b/tests/auto/cplusplus/declarationcomments/tst_declarationcomments.cpp new file mode 100644 index 00000000000..0a92cfbbd61 --- /dev/null +++ b/tests/auto/cplusplus/declarationcomments/tst_declarationcomments.cpp @@ -0,0 +1,225 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "cplusplus/Overview.h" +#include <cplusplus/declarationcomments.h> +#include <cplusplus/CppDocument.h> +#include <cplusplus/SymbolVisitor.h> + +#include <QtTest> +#include <QTextDocument> + +using namespace CPlusPlus; +using namespace Utils; + +const char testSource[] = R"TheFile( +//! Unrelated comment, even though it mentions MyEnum. + +//! Related comment because of proximity. +//! Related comment that mentions MyEnum. +//! Related comment that mentions MyEnumA. + +enum MyEnum { MyEnumA, MyEnumB }; + +// Unrelated comment because of different comment type. +//! Related comment that mentions MyEnumClass::A. + +enum class MyEnumClass { A, B }; + +// Related comment because of proximity. +void myFunc(); + +/* + * Related comment because of proximity. + */ +template<typename T> class MyClassTemplate {}; + +/* + * Related comment, because it mentions MyOtherClass. + */ + +class MyOtherClass { + /// Related comment for function and parameter a2, but not parameter a. + /// @param a2 + void memberFunc(int a, int a2); +}; + +//! Comment for member function at implementation site. +void MyOtherClass::memberFunc(int, int) {} + +//! An unrelated comment + +void funcWithoutComment(); + +)TheFile"; + +class SymbolFinder : public SymbolVisitor +{ +public: + SymbolFinder(const QString &name, Document *doc, int expectedOccurrence) + : m_name(name), m_doc(doc), m_expectedOccurrence(expectedOccurrence) {} + const Symbol *find(); + +private: + bool preVisit(Symbol *) override { return !m_symbol; } + bool visit(Namespace *ns) override { return visitScope(ns); } + bool visit(Enum *e) override { return visitScope(e); } + bool visit(Class *c) override { return visitScope(c); } + bool visit(Function *f) override { return visitScope(f); } + bool visit(Argument *a) override; + bool visit(Declaration *d) override; + + bool visitScope(Scope *scope); + + const QString &m_name; + Document * const m_doc; + const Symbol *m_symbol = nullptr; + const int m_expectedOccurrence; + int m_tokenLocation = -1; +}; + +class TestDeclarationComments : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void initTestCase(); + + void commentsForDecl_data(); + void commentsForDecl(); + +private: + Snapshot m_snapshot; + Document::Ptr m_cppDoc; + QTextDocument m_textDoc; +}; + +void TestDeclarationComments::initTestCase() +{ + m_cppDoc = m_snapshot.preprocessedDocument(testSource, "dummy.cpp"); + m_cppDoc->check(); + const bool hasErrors = !m_cppDoc->diagnosticMessages().isEmpty(); + if (hasErrors) { + for (const Document::DiagnosticMessage &msg : m_cppDoc->diagnosticMessages()) + qDebug() << '\t' << msg.text(); + } + QVERIFY(!hasErrors); + m_textDoc.setPlainText(testSource); +} + +void TestDeclarationComments::commentsForDecl_data() +{ + QTest::addColumn<QString>("symbolName"); + QTest::addColumn<QString>("expectedCommentPrefix"); + QTest::addColumn<int>("occurrence"); + + QTest::newRow("enum type") << "MyEnum" << "//! Related comment because of proximity" << 1; + QTest::newRow("enum value (positive)") << "MyEnumA" + << "//! Related comment because of proximity" << 1; + QTest::newRow("enum value (negative") << "MyEnumB" << QString() << 1; + + QTest::newRow("enum class type") << "MyEnumClass" + << "//! Related comment that mentions MyEnumClass::A" << 1; + QTest::newRow("enum class value (positive)") + << "A" << "//! Related comment that mentions MyEnumClass::A" << 1; + QTest::newRow("enum class value (negative") << "B" << QString() << 1; + + QTest::newRow("function declaration with comment") + << "myFunc" << "// Related comment because of proximity" << 1; + + QTest::newRow("class template") + << "MyClassTemplate" << "/*\n * Related comment because of proximity." << 1; + + QTest::newRow("class") + << "MyOtherClass" << "/*\n * Related comment, because it mentions MyOtherClass." << 1; + QTest::newRow("member function declaration") + << "memberFunc" << "/// Related comment for function and parameter a2, but not parameter a." + << 1; + QTest::newRow("function parameter (negative)") << "a" << QString() << 1; + QTest::newRow("function parameter (positive)") << "a2" << "/// Related comment for function " + "and parameter a2, but not parameter a." << 1; + + QTest::newRow("member function definition") << "memberFunc" << + "//! Comment for member function at implementation site." << 2; + + QTest::newRow("function declaration without comment") << "funcWithoutComment" << QString() << 1; +} + +void TestDeclarationComments::commentsForDecl() +{ + QFETCH(QString, symbolName); + QFETCH(QString, expectedCommentPrefix); + QFETCH(int, occurrence); + + SymbolFinder finder(symbolName, m_cppDoc.get(), occurrence); + const Symbol * const symbol = finder.find(); + QVERIFY(symbol); + + const QList<Token> commentTokens = commentsForDeclaration(symbol, m_snapshot, m_textDoc); + if (expectedCommentPrefix.isEmpty()) { + QVERIFY(commentTokens.isEmpty()); + return; + } + QVERIFY(!commentTokens.isEmpty()); + + const int firstCommentPos = m_cppDoc->translationUnit()->getTokenPositionInDocument( + commentTokens.first(), &m_textDoc); + const QString actualCommentPrefix = m_textDoc.toPlainText().mid(firstCommentPos, + expectedCommentPrefix.length()); + QCOMPARE(actualCommentPrefix, expectedCommentPrefix); +} + + +const Symbol *SymbolFinder::find() +{ + for (int i = 0, occurrences = 0; i < m_doc->translationUnit()->tokenCount(); ++i) { + const Token &tok = m_doc->translationUnit()->tokenAt(i); + if (tok.kind() != T_IDENTIFIER) + continue; + if (tok.spell() != m_name) + continue; + if (++occurrences == m_expectedOccurrence) { + m_tokenLocation = i; + break; + } + } + if (m_tokenLocation == -1) + return nullptr; + + visit(m_doc->globalNamespace()); + return m_symbol; +} + +bool SymbolFinder::visit(Argument *a) +{ + if (a->sourceLocation() == m_tokenLocation) + m_symbol = a; + return false; +} + +bool SymbolFinder::visit(Declaration *d) +{ + if (d->sourceLocation() == m_tokenLocation) { + m_symbol = d; + return false; + } + if (const auto func = d->type().type()->asFunctionType()) + return visit(func); + return true; +} + +bool SymbolFinder::visitScope(Scope *scope) +{ + for (int i = 0; i < scope->memberCount(); ++i) { + Symbol * const s = scope->memberAt(i); + if (s->sourceLocation() == m_tokenLocation) { + m_symbol = s; + return false; + } + accept(s); + } + return false; +} + +QTEST_APPLESS_MAIN(TestDeclarationComments) +#include "tst_declarationcomments.moc" From cde3156050b8c3668f6b59fb02bf31ee57cd6fb5 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 10 Aug 2023 17:01:28 +0200 Subject: [PATCH 0678/1777] Qmake: Rename some of the KitAspect related classes ... and split out the static interface. Change-Id: I9767c858a850b1fe16c97acc4848e8f69ae3342e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../qmakekitinformation.cpp | 24 +++++++-------- .../qmakeprojectmanager/qmakekitinformation.h | 30 +++++++++++-------- .../qmakeprojectmanagerplugin.cpp | 2 +- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp index 7ad0fbf94f5..c1ae89a9718 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp @@ -26,18 +26,18 @@ using namespace Utils; namespace QmakeProjectManager { namespace Internal { -class QmakeKitAspectWidget final : public KitAspect +class QmakeKitAspectImpl final : public KitAspect { public: - QmakeKitAspectWidget(Kit *k, const KitAspectFactory *ki) + QmakeKitAspectImpl(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki), m_lineEdit(createSubWidget<QLineEdit>()) { refresh(); // set up everything according to kit m_lineEdit->setToolTip(ki->description()); - connect(m_lineEdit, &QLineEdit::textEdited, this, &QmakeKitAspectWidget::mkspecWasChanged); + connect(m_lineEdit, &QLineEdit::textEdited, this, &QmakeKitAspectImpl::mkspecWasChanged); } - ~QmakeKitAspectWidget() override { delete m_lineEdit; } + ~QmakeKitAspectImpl() override { delete m_lineEdit; } private: void addToLayout(Layouting::LayoutItem &parent) override @@ -65,7 +65,7 @@ private: }; -QmakeKitAspect::QmakeKitAspect() +QmakeKitAspectFactory::QmakeKitAspectFactory() { setObjectName(QLatin1String("QmakeKitAspect")); setId(QmakeKitAspect::id()); @@ -75,7 +75,7 @@ QmakeKitAspect::QmakeKitAspect() setPriority(24000); } -Tasks QmakeKitAspect::validate(const Kit *k) const +Tasks QmakeKitAspectFactory::validate(const Kit *k) const { Tasks result; QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(k); @@ -89,21 +89,21 @@ Tasks QmakeKitAspect::validate(const Kit *k) const return result; } -KitAspect *QmakeKitAspect::createKitAspect(Kit *k) const +KitAspect *QmakeKitAspectFactory::createKitAspect(Kit *k) const { - return new Internal::QmakeKitAspectWidget(k, this); + return new Internal::QmakeKitAspectImpl(k, this); } -KitAspectFactory::ItemList QmakeKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList QmakeKitAspectFactory::toUserOutput(const Kit *k) const { - return {{Tr::tr("mkspec"), QDir::toNativeSeparators(mkspec(k))}}; + return {{Tr::tr("mkspec"), QDir::toNativeSeparators(QmakeKitAspect::mkspec(k))}}; } -void QmakeKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const +void QmakeKitAspectFactory::addToMacroExpander(Kit *kit, MacroExpander *expander) const { expander->registerVariable("Qmake:mkspec", Tr::tr("Mkspec configured for qmake by the kit."), [kit]() -> QString { - return QDir::toNativeSeparators(mkspec(kit)); + return QDir::toNativeSeparators(QmakeKitAspect::mkspec(kit)); }); } diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.h b/src/plugins/qmakeprojectmanager/qmakekitinformation.h index 6d2b0ab2cde..85592c9ca06 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.h +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.h @@ -8,21 +8,9 @@ namespace QmakeProjectManager { namespace Internal { -class QmakeKitAspect : public ProjectExplorer::KitAspectFactory +class QmakeKitAspect { - Q_OBJECT - public: - QmakeKitAspect(); - - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override; - - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const override; - - ItemList toUserOutput(const ProjectExplorer::Kit *k) const override; - - void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override; - static Utils::Id id(); enum class MkspecSource { User, Code }; static void setMkspec(ProjectExplorer::Kit *k, const QString &mkspec, MkspecSource source); @@ -31,5 +19,21 @@ public: static QString defaultMkspec(const ProjectExplorer::Kit *k); }; +class QmakeKitAspectFactory : public ProjectExplorer::KitAspectFactory +{ + Q_OBJECT + +public: + QmakeKitAspectFactory(); + + ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override; + + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const override; + + ItemList toUserOutput(const ProjectExplorer::Kit *k) const override; + + void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override; +}; + } // namespace Internal } // namespace QmakeProjectManager diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp index c9665280b4d..a9b2c7e591e 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp @@ -96,7 +96,7 @@ public: QAction *m_addLibraryAction = nullptr; QAction *m_addLibraryActionContextMenu = nullptr; - QmakeKitAspect qmakeKitAspect; + QmakeKitAspectFactory qmakeKitAspectFactory; void addLibrary(); void addLibraryContextMenu(); From 329541a42c34492f2ea05dd713a23c8cc634a5b6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 10 Aug 2023 15:47:26 +0200 Subject: [PATCH 0679/1777] ProjectExplorer: Rename some of the KitAspect related classes ... and split out the static interface. Change-Id: I0a1bb1c2fa71fa41fe54a3cbedd69f5a8f73713b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../projectexplorer/kitinformation.cpp | 290 +++++++++--------- src/plugins/projectexplorer/kitinformation.h | 126 ++++---- .../projectexplorer/projectexplorer.cpp | 12 +- 3 files changed, 227 insertions(+), 201 deletions(-) diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index cd35f6e8389..3b53e1893d4 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -46,20 +46,20 @@ const char KITINFORMATION_ID_V3[] = "PE.Profile.ToolChainsV3"; // -------------------------------------------------------------------------- namespace Internal { -class SysRootKitAspectWidget : public KitAspect +class SysRootKitAspectImpl : public KitAspect { public: - SysRootKitAspectWidget(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki) + SysRootKitAspectImpl(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki) { m_chooser = createSubWidget<PathChooser>(); m_chooser->setExpectedKind(PathChooser::ExistingDirectory); m_chooser->setHistoryCompleter(QLatin1String("PE.SysRoot.History")); m_chooser->setFilePath(SysRootKitAspect::sysRoot(k)); connect(m_chooser, &PathChooser::textChanged, - this, &SysRootKitAspectWidget::pathWasChanged); + this, &SysRootKitAspectImpl::pathWasChanged); } - ~SysRootKitAspectWidget() override { delete m_chooser; } + ~SysRootKitAspectImpl() override { delete m_chooser; } private: void makeReadOnly() override { m_chooser->setReadOnly(true); } @@ -87,7 +87,7 @@ private: }; } // namespace Internal -SysRootKitAspect::SysRootKitAspect() +SysRootKitAspectFactory::SysRootKitAspectFactory() { setObjectName(QLatin1String("SysRootInformation")); setId(SysRootKitAspect::id()); @@ -97,7 +97,7 @@ SysRootKitAspect::SysRootKitAspect() setPriority(31000); } -Tasks SysRootKitAspect::validate(const Kit *k) const +Tasks SysRootKitAspectFactory::validate(const Kit *k) const { Tasks result; const FilePath dir = SysRootKitAspect::sysRoot(k); @@ -120,19 +120,19 @@ Tasks SysRootKitAspect::validate(const Kit *k) const return result; } -KitAspect *SysRootKitAspect::createKitAspect(Kit *k) const +KitAspect *SysRootKitAspectFactory::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); - return new Internal::SysRootKitAspectWidget(k, this); + return new Internal::SysRootKitAspectImpl(k, this); } -KitAspectFactory::ItemList SysRootKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList SysRootKitAspectFactory::toUserOutput(const Kit *k) const { - return {{Tr::tr("Sys Root"), sysRoot(k).toUserOutput()}}; + return {{Tr::tr("Sys Root"), SysRootKitAspect::sysRoot(k).toUserOutput()}}; } -void SysRootKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const +void SysRootKitAspectFactory::addToMacroExpander(Kit *kit, MacroExpander *expander) const { QTC_ASSERT(kit, return); @@ -184,10 +184,10 @@ void SysRootKitAspect::setSysRoot(Kit *k, const FilePath &v) // -------------------------------------------------------------------------- namespace Internal { -class ToolChainKitAspectWidget final : public KitAspect +class ToolChainKitAspectImpl final : public KitAspect { public: - ToolChainKitAspectWidget(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki) + ToolChainKitAspectImpl(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki) { m_mainWidget = createSubWidget<QWidget>(); m_mainWidget->setContentsMargins(0, 0, 0, 0); @@ -222,7 +222,7 @@ public: m_manageButton = createManageButton(Constants::TOOLCHAIN_SETTINGS_PAGE_ID); } - ~ToolChainKitAspectWidget() override + ~ToolChainKitAspectImpl() override { delete m_mainWidget; delete m_manageButton; @@ -312,7 +312,7 @@ private: }; } // namespace Internal -ToolChainKitAspect::ToolChainKitAspect() +ToolChainKitAspectFactory::ToolChainKitAspectFactory() { setObjectName(QLatin1String("ToolChainInformation")); setId(ToolChainKitAspect::id()); @@ -323,7 +323,7 @@ ToolChainKitAspect::ToolChainKitAspect() setPriority(30000); connect(KitManager::instance(), &KitManager::kitsLoaded, - this, &ToolChainKitAspect::kitsWereLoaded); + this, &ToolChainKitAspectFactory::kitsWereLoaded); } // language id -> tool chain id @@ -351,11 +351,11 @@ static QVariant defaultToolChainValue() return result; } -Tasks ToolChainKitAspect::validate(const Kit *k) const +Tasks ToolChainKitAspectFactory::validate(const Kit *k) const { Tasks result; - const QList<ToolChain*> tcList = toolChains(k); + const QList<ToolChain*> tcList = ToolChainKitAspect::toolChains(k); if (tcList.isEmpty()) { result << BuildSystemTask(Task::Warning, ToolChainKitAspect::msgNoToolChainInTarget()); } else { @@ -373,7 +373,7 @@ Tasks ToolChainKitAspect::validate(const Kit *k) const return result; } -void ToolChainKitAspect::upgrade(Kit *k) +void ToolChainKitAspectFactory::upgrade(Kit *k) { QTC_ASSERT(k, return); @@ -437,17 +437,17 @@ void ToolChainKitAspect::upgrade(Kit *k) } } -void ToolChainKitAspect::fix(Kit *k) +void ToolChainKitAspectFactory::fix(Kit *k) { QTC_ASSERT(ToolChainManager::isLoaded(), return); const QList<Id> languages = ToolChainManager::allLanguages(); for (const Id l : languages) { - const QByteArray tcId = toolChainId(k, l); + const QByteArray tcId = ToolChainKitAspect::toolChainId(k, l); if (!tcId.isEmpty() && !ToolChainManager::findToolChain(tcId)) { qWarning("Tool chain set up in kit \"%s\" for \"%s\" not found.", qPrintable(k->displayName()), qPrintable(ToolChainManager::displayNameOfLanguageId(l))); - clearToolChain(k, l); // make sure to clear out no longer known tool chains + ToolChainKitAspect::clearToolChain(k, l); // make sure to clear out no longer known tool chains } } } @@ -459,7 +459,7 @@ static Id findLanguage(const QString &ls) [lsUpper](Id l) { return lsUpper == l.toString().toUpper(); }); } -void ToolChainKitAspect::setup(Kit *k) +void ToolChainKitAspectFactory::setup(Kit *k) { QTC_ASSERT(ToolChainManager::isLoaded(), return); QTC_ASSERT(k, return); @@ -494,82 +494,82 @@ void ToolChainKitAspect::setup(Kit *k) bestTc = tc; } if (bestTc) - setToolChain(k, bestTc); + ToolChainKitAspect::setToolChain(k, bestTc); else - clearToolChain(k, l); + ToolChainKitAspect::clearToolChain(k, l); } k->setSticky(id(), lockToolchains); } -KitAspect *ToolChainKitAspect::createKitAspect(Kit *k) const +KitAspect *ToolChainKitAspectFactory::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); - return new Internal::ToolChainKitAspectWidget(k, this); + return new Internal::ToolChainKitAspectImpl(k, this); } -QString ToolChainKitAspect::displayNamePostfix(const Kit *k) const +QString ToolChainKitAspectFactory::displayNamePostfix(const Kit *k) const { - ToolChain *tc = cxxToolChain(k); + ToolChain *tc = ToolChainKitAspect::cxxToolChain(k); return tc ? tc->displayName() : QString(); } -KitAspectFactory::ItemList ToolChainKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList ToolChainKitAspectFactory::toUserOutput(const Kit *k) const { - ToolChain *tc = cxxToolChain(k); + ToolChain *tc = ToolChainKitAspect::cxxToolChain(k); return {{Tr::tr("Compiler"), tc ? tc->displayName() : Tr::tr("None")}}; } -void ToolChainKitAspect::addToBuildEnvironment(const Kit *k, Environment &env) const +void ToolChainKitAspectFactory::addToBuildEnvironment(const Kit *k, Environment &env) const { - ToolChain *tc = cxxToolChain(k); + ToolChain *tc = ToolChainKitAspect::cxxToolChain(k); if (tc) tc->addToEnvironment(env); } -void ToolChainKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const +void ToolChainKitAspectFactory::addToMacroExpander(Kit *kit, MacroExpander *expander) const { QTC_ASSERT(kit, return); // Compatibility with Qt Creator < 4.2: expander->registerVariable("Compiler:Name", Tr::tr("Compiler"), [kit] { - const ToolChain *tc = cxxToolChain(kit); + const ToolChain *tc = ToolChainKitAspect::cxxToolChain(kit); return tc ? tc->displayName() : Tr::tr("None"); }); expander->registerVariable("Compiler:Executable", Tr::tr("Path to the compiler executable"), [kit] { - const ToolChain *tc = cxxToolChain(kit); + const ToolChain *tc = ToolChainKitAspect::cxxToolChain(kit); return tc ? tc->compilerCommand().path() : QString(); }); // After 4.2 expander->registerPrefix("Compiler:Name", Tr::tr("Compiler for different languages"), [kit](const QString &ls) { - const ToolChain *tc = toolChain(kit, findLanguage(ls)); + const ToolChain *tc = ToolChainKitAspect::toolChain(kit, findLanguage(ls)); return tc ? tc->displayName() : Tr::tr("None"); }); expander->registerPrefix("Compiler:Executable", Tr::tr("Compiler executable for different languages"), [kit](const QString &ls) { - const ToolChain *tc = toolChain(kit, findLanguage(ls)); + const ToolChain *tc = ToolChainKitAspect::toolChain(kit, findLanguage(ls)); return tc ? tc->compilerCommand().path() : QString(); }); } -QList<OutputLineParser *> ToolChainKitAspect::createOutputParsers(const Kit *k) const +QList<OutputLineParser *> ToolChainKitAspectFactory::createOutputParsers(const Kit *k) const { for (const Id langId : {Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID}) { - if (const ToolChain * const tc = toolChain(k, langId)) + if (const ToolChain * const tc = ToolChainKitAspect::toolChain(k, langId)) return tc->createOutputParsers(); } return {}; } -QSet<Id> ToolChainKitAspect::availableFeatures(const Kit *k) const +QSet<Id> ToolChainKitAspectFactory::availableFeatures(const Kit *k) const { QSet<Id> result; - for (ToolChain *tc : toolChains(k)) + for (ToolChain *tc : ToolChainKitAspect::toolChains(k)) result.insert(tc->typeId().withPrefix("ToolChain.")); return result; } @@ -723,27 +723,27 @@ QString ToolChainKitAspect::msgNoToolChainInTarget() return Tr::tr("No compiler set in kit."); } -void ToolChainKitAspect::kitsWereLoaded() +void ToolChainKitAspectFactory::kitsWereLoaded() { const QList<Kit *> kits = KitManager::kits(); for (Kit *k : kits) fix(k); connect(ToolChainManager::instance(), &ToolChainManager::toolChainRemoved, - this, &ToolChainKitAspect::toolChainRemoved); + this, &ToolChainKitAspectFactory::toolChainRemoved); connect(ToolChainManager::instance(), &ToolChainManager::toolChainUpdated, - this, &ToolChainKitAspect::toolChainUpdated); + this, &ToolChainKitAspectFactory::toolChainUpdated); } -void ToolChainKitAspect::toolChainUpdated(ToolChain *tc) +void ToolChainKitAspectFactory::toolChainUpdated(ToolChain *tc) { for (Kit *k : KitManager::kits()) { - if (toolChain(k, tc->language()) == tc) + if (ToolChainKitAspect::toolChain(k, tc->language()) == tc) notifyAboutUpdate(k); } } -void ToolChainKitAspect::toolChainRemoved(ToolChain *tc) +void ToolChainKitAspectFactory::toolChainRemoved(ToolChain *tc) { Q_UNUSED(tc) const QList<Kit *> kits = KitManager::kits(); @@ -755,10 +755,10 @@ void ToolChainKitAspect::toolChainRemoved(ToolChain *tc) // DeviceTypeKitAspect: // -------------------------------------------------------------------------- namespace Internal { -class DeviceTypeKitAspectWidget final : public KitAspect +class DeviceTypeKitAspectImpl final : public KitAspect { public: - DeviceTypeKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki) + DeviceTypeKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki) : KitAspect(workingCopy, ki), m_comboBox(createSubWidget<QComboBox>()) { for (IDeviceFactory *factory : IDeviceFactory::allDeviceFactories()) @@ -766,10 +766,10 @@ public: m_comboBox->setToolTip(ki->description()); refresh(); connect(m_comboBox, &QComboBox::currentIndexChanged, - this, &DeviceTypeKitAspectWidget::currentTypeChanged); + this, &DeviceTypeKitAspectImpl::currentTypeChanged); } - ~DeviceTypeKitAspectWidget() override { delete m_comboBox; } + ~DeviceTypeKitAspectImpl() override { delete m_comboBox; } private: void addToLayout(Layouting::LayoutItem &builder) override @@ -803,7 +803,7 @@ private: }; } // namespace Internal -DeviceTypeKitAspect::DeviceTypeKitAspect() +DeviceTypeKitAspectFactory::DeviceTypeKitAspectFactory() { setObjectName(QLatin1String("DeviceTypeInformation")); setId(DeviceTypeKitAspect::id()); @@ -813,28 +813,28 @@ DeviceTypeKitAspect::DeviceTypeKitAspect() makeEssential(); } -void DeviceTypeKitAspect::setup(Kit *k) +void DeviceTypeKitAspectFactory::setup(Kit *k) { if (k && !k->hasValue(id())) k->setValue(id(), QByteArray(Constants::DESKTOP_DEVICE_TYPE)); } -Tasks DeviceTypeKitAspect::validate(const Kit *k) const +Tasks DeviceTypeKitAspectFactory::validate(const Kit *k) const { Q_UNUSED(k) return {}; } -KitAspect *DeviceTypeKitAspect::createKitAspect(Kit *k) const +KitAspect *DeviceTypeKitAspectFactory::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); - return new Internal::DeviceTypeKitAspectWidget(k, this); + return new Internal::DeviceTypeKitAspectImpl(k, this); } -KitAspectFactory::ItemList DeviceTypeKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList DeviceTypeKitAspectFactory::toUserOutput(const Kit *k) const { QTC_ASSERT(k, return {}); - Id type = deviceTypeId(k); + Id type = DeviceTypeKitAspect::deviceTypeId(k); QString typeDisplayName = Tr::tr("Unknown device type"); if (type.isValid()) { if (IDeviceFactory *factory = IDeviceFactory::find(type)) @@ -859,12 +859,12 @@ void DeviceTypeKitAspect::setDeviceTypeId(Kit *k, Id type) k->setValue(DeviceTypeKitAspect::id(), type.toSetting()); } -QSet<Id> DeviceTypeKitAspect::supportedPlatforms(const Kit *k) const +QSet<Id> DeviceTypeKitAspectFactory::supportedPlatforms(const Kit *k) const { - return {deviceTypeId(k)}; + return {DeviceTypeKitAspect::deviceTypeId(k)}; } -QSet<Id> DeviceTypeKitAspect::availableFeatures(const Kit *k) const +QSet<Id> DeviceTypeKitAspectFactory::availableFeatures(const Kit *k) const { Id id = DeviceTypeKitAspect::deviceTypeId(k); if (id.isValid()) @@ -876,10 +876,10 @@ QSet<Id> DeviceTypeKitAspect::availableFeatures(const Kit *k) const // DeviceKitAspect: // -------------------------------------------------------------------------- namespace Internal { -class DeviceKitAspectWidget final : public KitAspect +class DeviceKitAspectImpl final : public KitAspect { public: - DeviceKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki) + DeviceKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki) : KitAspect(workingCopy, ki), m_comboBox(createSubWidget<QComboBox>()), m_model(new DeviceManagerModel(DeviceManager::instance())) @@ -893,14 +893,14 @@ public: m_comboBox->setToolTip(ki->description()); connect(m_model, &QAbstractItemModel::modelAboutToBeReset, - this, &DeviceKitAspectWidget::modelAboutToReset); + this, &DeviceKitAspectImpl::modelAboutToReset); connect(m_model, &QAbstractItemModel::modelReset, - this, &DeviceKitAspectWidget::modelReset); + this, &DeviceKitAspectImpl::modelReset); connect(m_comboBox, &QComboBox::currentIndexChanged, - this, &DeviceKitAspectWidget::currentDeviceChanged); + this, &DeviceKitAspectImpl::currentDeviceChanged); } - ~DeviceKitAspectWidget() override + ~DeviceKitAspectImpl() override { delete m_comboBox; delete m_model; @@ -950,7 +950,7 @@ private: }; } // namespace Internal -DeviceKitAspect::DeviceKitAspect() +DeviceKitAspectFactory::DeviceKitAspectFactory() { setObjectName(QLatin1String("DeviceInformation")); setId(DeviceKitAspect::id()); @@ -959,10 +959,10 @@ DeviceKitAspect::DeviceKitAspect() setPriority(32000); connect(KitManager::instance(), &KitManager::kitsLoaded, - this, &DeviceKitAspect::kitsWereLoaded); + this, &DeviceKitAspectFactory::kitsWereLoaded); } -QVariant DeviceKitAspect::defaultValue(const Kit *k) const +QVariant DeviceKitAspectFactory::defaultValue(const Kit *k) const { Id type = DeviceTypeKitAspect::deviceTypeId(k); // Use default device if that is compatible: @@ -979,7 +979,7 @@ QVariant DeviceKitAspect::defaultValue(const Kit *k) const return {}; } -Tasks DeviceKitAspect::validate(const Kit *k) const +Tasks DeviceKitAspectFactory::validate(const Kit *k) const { IDevice::ConstPtr dev = DeviceKitAspect::device(k); Tasks result; @@ -994,45 +994,45 @@ Tasks DeviceKitAspect::validate(const Kit *k) const return result; } -void DeviceKitAspect::fix(Kit *k) +void DeviceKitAspectFactory::fix(Kit *k) { IDevice::ConstPtr dev = DeviceKitAspect::device(k); if (!dev.isNull() && !dev->isCompatibleWith(k)) { qWarning("Device is no longer compatible with kit \"%s\", removing it.", qPrintable(k->displayName())); - setDeviceId(k, Id()); + DeviceKitAspect::setDeviceId(k, Id()); } } -void DeviceKitAspect::setup(Kit *k) +void DeviceKitAspectFactory::setup(Kit *k) { QTC_ASSERT(DeviceManager::instance()->isLoaded(), return); IDevice::ConstPtr dev = DeviceKitAspect::device(k); if (!dev.isNull() && dev->isCompatibleWith(k)) return; - setDeviceId(k, Id::fromSetting(defaultValue(k))); + DeviceKitAspect::setDeviceId(k, Id::fromSetting(defaultValue(k))); } -KitAspect *DeviceKitAspect::createKitAspect(Kit *k) const +KitAspect *DeviceKitAspectFactory::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); - return new Internal::DeviceKitAspectWidget(k, this); + return new Internal::DeviceKitAspectImpl(k, this); } -QString DeviceKitAspect::displayNamePostfix(const Kit *k) const +QString DeviceKitAspectFactory::displayNamePostfix(const Kit *k) const { - IDevice::ConstPtr dev = device(k); + IDevice::ConstPtr dev = DeviceKitAspect::device(k); return dev.isNull() ? QString() : dev->displayName(); } -KitAspectFactory::ItemList DeviceKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList DeviceKitAspectFactory::toUserOutput(const Kit *k) const { - IDevice::ConstPtr dev = device(k); + IDevice::ConstPtr dev = DeviceKitAspect::device(k); return {{Tr::tr("Device"), dev.isNull() ? Tr::tr("Unconfigured") : dev->displayName()}}; } -void DeviceKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const +void DeviceKitAspectFactory::addToMacroExpander(Kit *kit, MacroExpander *expander) const { QTC_ASSERT(kit, return); expander->registerVariable("Device:HostAddress", Tr::tr("Host address"), [kit] { @@ -1095,39 +1095,39 @@ FilePath DeviceKitAspect::deviceFilePath(const Kit *k, const QString &pathOnDevi return FilePath::fromString(pathOnDevice); } -void DeviceKitAspect::kitsWereLoaded() +void DeviceKitAspectFactory::kitsWereLoaded() { const QList<Kit *> kits = KitManager::kits(); for (Kit *k : kits) fix(k); DeviceManager *dm = DeviceManager::instance(); - connect(dm, &DeviceManager::deviceListReplaced, this, &DeviceKitAspect::devicesChanged); - connect(dm, &DeviceManager::deviceAdded, this, &DeviceKitAspect::devicesChanged); - connect(dm, &DeviceManager::deviceRemoved, this, &DeviceKitAspect::devicesChanged); - connect(dm, &DeviceManager::deviceUpdated, this, &DeviceKitAspect::deviceUpdated); + connect(dm, &DeviceManager::deviceListReplaced, this, &DeviceKitAspectFactory::devicesChanged); + connect(dm, &DeviceManager::deviceAdded, this, &DeviceKitAspectFactory::devicesChanged); + connect(dm, &DeviceManager::deviceRemoved, this, &DeviceKitAspectFactory::devicesChanged); + connect(dm, &DeviceManager::deviceUpdated, this, &DeviceKitAspectFactory::deviceUpdated); connect(KitManager::instance(), &KitManager::kitUpdated, - this, &DeviceKitAspect::kitUpdated); + this, &DeviceKitAspectFactory::kitUpdated); connect(KitManager::instance(), &KitManager::unmanagedKitUpdated, - this, &DeviceKitAspect::kitUpdated); + this, &DeviceKitAspectFactory::kitUpdated); } -void DeviceKitAspect::deviceUpdated(Id id) +void DeviceKitAspectFactory::deviceUpdated(Id id) { const QList<Kit *> kits = KitManager::kits(); for (Kit *k : kits) { - if (deviceId(k) == id) + if (DeviceKitAspect::deviceId(k) == id) notifyAboutUpdate(k); } } -void DeviceKitAspect::kitUpdated(Kit *k) +void DeviceKitAspectFactory::kitUpdated(Kit *k) { setup(k); // Set default device if necessary } -void DeviceKitAspect::devicesChanged() +void DeviceKitAspectFactory::devicesChanged() { const QList<Kit *> kits = KitManager::kits(); for (Kit *k : kits) @@ -1138,10 +1138,10 @@ void DeviceKitAspect::devicesChanged() // BuildDeviceKitAspect: // -------------------------------------------------------------------------- namespace Internal { -class BuildDeviceKitAspectWidget final : public KitAspect +class BuildDeviceKitAspectImpl final : public KitAspect { public: - BuildDeviceKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki) + BuildDeviceKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki) : KitAspect(workingCopy, ki), m_comboBox(createSubWidget<QComboBox>()), m_model(new DeviceManagerModel(DeviceManager::instance())) @@ -1153,14 +1153,14 @@ public: m_comboBox->setToolTip(ki->description()); connect(m_model, &QAbstractItemModel::modelAboutToBeReset, - this, &BuildDeviceKitAspectWidget::modelAboutToReset); + this, &BuildDeviceKitAspectImpl::modelAboutToReset); connect(m_model, &QAbstractItemModel::modelReset, - this, &BuildDeviceKitAspectWidget::modelReset); + this, &BuildDeviceKitAspectImpl::modelReset); connect(m_comboBox, &QComboBox::currentIndexChanged, - this, &BuildDeviceKitAspectWidget::currentDeviceChanged); + this, &BuildDeviceKitAspectImpl::currentDeviceChanged); } - ~BuildDeviceKitAspectWidget() override + ~BuildDeviceKitAspectImpl() override { delete m_comboBox; delete m_model; @@ -1218,7 +1218,7 @@ private: }; } // namespace Internal -BuildDeviceKitAspect::BuildDeviceKitAspect() +BuildDeviceKitAspectFactory::BuildDeviceKitAspectFactory() { setObjectName("BuildDeviceInformation"); setId(BuildDeviceKitAspect::id()); @@ -1227,10 +1227,15 @@ BuildDeviceKitAspect::BuildDeviceKitAspect() setPriority(31900); connect(KitManager::instance(), &KitManager::kitsLoaded, - this, &BuildDeviceKitAspect::kitsWereLoaded); + this, &BuildDeviceKitAspectFactory::kitsWereLoaded); } -void BuildDeviceKitAspect::setup(Kit *k) +static IDeviceConstPtr defaultDevice() +{ + return DeviceManager::defaultDesktopDevice(); +} + +void BuildDeviceKitAspectFactory::setup(Kit *k) { QTC_ASSERT(DeviceManager::instance()->isLoaded(), return ); IDevice::ConstPtr dev = BuildDeviceKitAspect::device(k); @@ -1238,15 +1243,10 @@ void BuildDeviceKitAspect::setup(Kit *k) return; dev = defaultDevice(); - setDeviceId(k, dev ? dev->id() : Id()); + BuildDeviceKitAspect::setDeviceId(k, dev ? dev->id() : Id()); } -IDevice::ConstPtr BuildDeviceKitAspect::defaultDevice() -{ - return DeviceManager::defaultDesktopDevice(); -} - -Tasks BuildDeviceKitAspect::validate(const Kit *k) const +Tasks BuildDeviceKitAspectFactory::validate(const Kit *k) const { IDevice::ConstPtr dev = BuildDeviceKitAspect::device(k); Tasks result; @@ -1256,25 +1256,25 @@ Tasks BuildDeviceKitAspect::validate(const Kit *k) const return result; } -KitAspect *BuildDeviceKitAspect::createKitAspect(Kit *k) const +KitAspect *BuildDeviceKitAspectFactory::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); - return new Internal::BuildDeviceKitAspectWidget(k, this); + return new Internal::BuildDeviceKitAspectImpl(k, this); } -QString BuildDeviceKitAspect::displayNamePostfix(const Kit *k) const +QString BuildDeviceKitAspectFactory::displayNamePostfix(const Kit *k) const { - IDevice::ConstPtr dev = device(k); + IDevice::ConstPtr dev = BuildDeviceKitAspect::device(k); return dev.isNull() ? QString() : dev->displayName(); } -KitAspectFactory::ItemList BuildDeviceKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList BuildDeviceKitAspectFactory::toUserOutput(const Kit *k) const { - IDevice::ConstPtr dev = device(k); + IDevice::ConstPtr dev = BuildDeviceKitAspect::device(k); return {{Tr::tr("Build device"), dev.isNull() ? Tr::tr("Unconfigured") : dev->displayName()}}; } -void BuildDeviceKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const +void BuildDeviceKitAspectFactory::addToMacroExpander(Kit *kit, MacroExpander *expander) const { QTC_ASSERT(kit, return); expander->registerVariable("BuildDevice:HostAddress", Tr::tr("Build host address"), [kit] { @@ -1334,39 +1334,42 @@ void BuildDeviceKitAspect::setDeviceId(Kit *k, Id id) k->setValue(BuildDeviceKitAspect::id(), id.toSetting()); } -void BuildDeviceKitAspect::kitsWereLoaded() +void BuildDeviceKitAspectFactory::kitsWereLoaded() { const QList<Kit *> kits = KitManager::kits(); for (Kit *k : kits) fix(k); DeviceManager *dm = DeviceManager::instance(); - connect(dm, &DeviceManager::deviceListReplaced, this, &BuildDeviceKitAspect::devicesChanged); - connect(dm, &DeviceManager::deviceAdded, this, &BuildDeviceKitAspect::devicesChanged); - connect(dm, &DeviceManager::deviceRemoved, this, &BuildDeviceKitAspect::devicesChanged); - connect(dm, &DeviceManager::deviceUpdated, this, &BuildDeviceKitAspect::deviceUpdated); - + connect(dm, &DeviceManager::deviceListReplaced, + this, &BuildDeviceKitAspectFactory::devicesChanged); + connect(dm, &DeviceManager::deviceAdded, + this, &BuildDeviceKitAspectFactory::devicesChanged); + connect(dm, &DeviceManager::deviceRemoved, + this, &BuildDeviceKitAspectFactory::devicesChanged); + connect(dm, &DeviceManager::deviceUpdated, + this, &BuildDeviceKitAspectFactory::deviceUpdated); connect(KitManager::instance(), &KitManager::kitUpdated, - this, &BuildDeviceKitAspect::kitUpdated); + this, &BuildDeviceKitAspectFactory::kitUpdated); connect(KitManager::instance(), &KitManager::unmanagedKitUpdated, - this, &BuildDeviceKitAspect::kitUpdated); + this, &BuildDeviceKitAspectFactory::kitUpdated); } -void BuildDeviceKitAspect::deviceUpdated(Id id) +void BuildDeviceKitAspectFactory::deviceUpdated(Id id) { const QList<Kit *> kits = KitManager::kits(); for (Kit *k : kits) { - if (deviceId(k) == id) + if (BuildDeviceKitAspect::deviceId(k) == id) notifyAboutUpdate(k); } } -void BuildDeviceKitAspect::kitUpdated(Kit *k) +void BuildDeviceKitAspectFactory::kitUpdated(Kit *k) { setup(k); // Set default device if necessary } -void BuildDeviceKitAspect::devicesChanged() +void BuildDeviceKitAspectFactory::devicesChanged() { const QList<Kit *> kits = KitManager::kits(); for (Kit *k : kits) @@ -1388,10 +1391,10 @@ static bool enforcesMSVCEnglish(const EnvironmentItems &changes) } namespace Internal { -class EnvironmentKitAspectWidget final : public KitAspect +class EnvironmentKitAspectImpl final : public KitAspect { public: - EnvironmentKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki) + EnvironmentKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki) : KitAspect(workingCopy, ki), m_summaryLabel(createSubWidget<ElidingLabel>()), m_manageButton(createSubWidget<QPushButton>()), @@ -1406,7 +1409,7 @@ public: refresh(); m_manageButton->setText(Tr::tr("Change...")); connect(m_manageButton, &QAbstractButton::clicked, - this, &EnvironmentKitAspectWidget::editEnvironmentChanges); + this, &EnvironmentKitAspectImpl::editEnvironmentChanges); } private: @@ -1487,7 +1490,7 @@ private: }; } // namespace Internal -EnvironmentKitAspect::EnvironmentKitAspect() +EnvironmentKitAspectFactory::EnvironmentKitAspectFactory() { setObjectName(QLatin1String("EnvironmentKitAspect")); setId(EnvironmentKitAspect::id()); @@ -1496,7 +1499,7 @@ EnvironmentKitAspect::EnvironmentKitAspect() setPriority(29000); } -Tasks EnvironmentKitAspect::validate(const Kit *k) const +Tasks EnvironmentKitAspectFactory::validate(const Kit *k) const { Tasks result; QTC_ASSERT(k, return result); @@ -1508,39 +1511,40 @@ Tasks EnvironmentKitAspect::validate(const Kit *k) const return result; } -void EnvironmentKitAspect::fix(Kit *k) +void EnvironmentKitAspectFactory::fix(Kit *k) { QTC_ASSERT(k, return); const QVariant variant = k->value(EnvironmentKitAspect::id()); if (!variant.isNull() && !variant.canConvert(QVariant::List)) { qWarning("Kit \"%s\" has a wrong environment value set.", qPrintable(k->displayName())); - setEnvironmentChanges(k, EnvironmentItems()); + EnvironmentKitAspect::setEnvironmentChanges(k, EnvironmentItems()); } } -void EnvironmentKitAspect::addToBuildEnvironment(const Kit *k, Environment &env) const +void EnvironmentKitAspectFactory::addToBuildEnvironment(const Kit *k, Environment &env) const { const QStringList values - = transform(EnvironmentItem::toStringList(environmentChanges(k)), + = transform(EnvironmentItem::toStringList(EnvironmentKitAspect::environmentChanges(k)), [k](const QString &v) { return k->macroExpander()->expand(v); }); env.modify(EnvironmentItem::fromStringList(values)); } -void EnvironmentKitAspect::addToRunEnvironment(const Kit *k, Environment &env) const +void EnvironmentKitAspectFactory::addToRunEnvironment(const Kit *k, Environment &env) const { addToBuildEnvironment(k, env); } -KitAspect *EnvironmentKitAspect::createKitAspect(Kit *k) const +KitAspect *EnvironmentKitAspectFactory::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); - return new Internal::EnvironmentKitAspectWidget(k, this); + return new Internal::EnvironmentKitAspectImpl(k, this); } -KitAspectFactory::ItemList EnvironmentKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList EnvironmentKitAspectFactory::toUserOutput(const Kit *k) const { - return {{Tr::tr("Environment"), EnvironmentItem::toStringList(environmentChanges(k)).join("<br>")}}; + return {{Tr::tr("Environment"), + EnvironmentItem::toStringList(EnvironmentKitAspect::environmentChanges(k)).join("<br>")}}; } Id EnvironmentKitAspect::id() diff --git a/src/plugins/projectexplorer/kitinformation.h b/src/plugins/projectexplorer/kitinformation.h index 8a9a79b57a0..99c99227b9d 100644 --- a/src/plugins/projectexplorer/kitinformation.h +++ b/src/plugins/projectexplorer/kitinformation.h @@ -22,33 +22,54 @@ class KitAspect; // SysRootInformation: // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT SysRootKitAspect : public KitAspectFactory +class PROJECTEXPLORER_EXPORT SysRootKitAspect +{ +public: + static Utils::Id id(); + static Utils::FilePath sysRoot(const Kit *k); + static void setSysRoot(Kit *k, const Utils::FilePath &v); +}; + +class PROJECTEXPLORER_EXPORT SysRootKitAspectFactory : public KitAspectFactory { Q_OBJECT public: - SysRootKitAspect(); + SysRootKitAspectFactory(); Tasks validate(const Kit *k) const override; KitAspect *createKitAspect(Kit *k) const override; ItemList toUserOutput(const Kit *k) const override; void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override; - - static Utils::Id id(); - static Utils::FilePath sysRoot(const Kit *k); - static void setSysRoot(Kit *k, const Utils::FilePath &v); }; // -------------------------------------------------------------------------- // ToolChainInformation: // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT ToolChainKitAspect : public KitAspectFactory +class PROJECTEXPLORER_EXPORT ToolChainKitAspect +{ +public: + static Utils::Id id(); + static QByteArray toolChainId(const Kit *k, Utils::Id language); + static ToolChain *toolChain(const Kit *k, Utils::Id language); + static ToolChain *cToolChain(const Kit *k); + static ToolChain *cxxToolChain(const Kit *k); + static QList<ToolChain *> toolChains(const Kit *k); + static void setToolChain(Kit *k, ToolChain *tc); + static void setAllToolChainsToMatch(Kit *k, ToolChain *tc); + static void clearToolChain(Kit *k, Utils::Id language); + static Abi targetAbi(const Kit *k); + + static QString msgNoToolChainInTarget(); +}; + +class PROJECTEXPLORER_EXPORT ToolChainKitAspectFactory : public KitAspectFactory { Q_OBJECT public: - ToolChainKitAspect(); + ToolChainKitAspectFactory(); Tasks validate(const Kit *k) const override; void upgrade(Kit *k) override; @@ -68,19 +89,6 @@ public: QList<Utils::OutputLineParser *> createOutputParsers(const Kit *k) const override; QSet<Utils::Id> availableFeatures(const Kit *k) const override; - static Utils::Id id(); - static QByteArray toolChainId(const Kit *k, Utils::Id language); - static ToolChain *toolChain(const Kit *k, Utils::Id language); - static ToolChain *cToolChain(const Kit *k); - static ToolChain *cxxToolChain(const Kit *k); - static QList<ToolChain *> toolChains(const Kit *k); - static void setToolChain(Kit *k, ToolChain *tc); - static void setAllToolChainsToMatch(Kit *k, ToolChain *tc); - static void clearToolChain(Kit *k, Utils::Id language); - static Abi targetAbi(const Kit *k); - - static QString msgNoToolChainInTarget(); - private: void kitsWereLoaded(); void toolChainUpdated(ProjectExplorer::ToolChain *tc); @@ -91,22 +99,26 @@ private: // DeviceTypeInformation: // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT DeviceTypeKitAspect : public KitAspectFactory +class PROJECTEXPLORER_EXPORT DeviceTypeKitAspect +{ +public: + static const Utils::Id id(); + static const Utils::Id deviceTypeId(const Kit *k); + static void setDeviceTypeId(Kit *k, Utils::Id type); +}; + +class PROJECTEXPLORER_EXPORT DeviceTypeKitAspectFactory : public KitAspectFactory { Q_OBJECT public: - DeviceTypeKitAspect(); + DeviceTypeKitAspectFactory(); void setup(Kit *k) override; Tasks validate(const Kit *k) const override; KitAspect *createKitAspect(Kit *k) const override; ItemList toUserOutput(const Kit *k) const override; - static const Utils::Id id(); - static const Utils::Id deviceTypeId(const Kit *k); - static void setDeviceTypeId(Kit *k, Utils::Id type); - QSet<Utils::Id> supportedPlatforms(const Kit *k) const override; QSet<Utils::Id> availableFeatures(const Kit *k) const override; }; @@ -115,12 +127,23 @@ public: // DeviceInformation: // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT DeviceKitAspect : public KitAspectFactory +class PROJECTEXPLORER_EXPORT DeviceKitAspect +{ +public: + static Utils::Id id(); + static IDeviceConstPtr device(const Kit *k); + static Utils::Id deviceId(const Kit *k); + static void setDevice(Kit *k, IDeviceConstPtr dev); + static void setDeviceId(Kit *k, Utils::Id dataId); + static Utils::FilePath deviceFilePath(const Kit *k, const QString &pathOnDevice); +}; + +class PROJECTEXPLORER_EXPORT DeviceKitAspectFactory : public KitAspectFactory { Q_OBJECT public: - DeviceKitAspect(); + DeviceKitAspectFactory(); Tasks validate(const Kit *k) const override; void fix(Kit *k) override; @@ -134,13 +157,6 @@ public: void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override; - static Utils::Id id(); - static IDeviceConstPtr device(const Kit *k); - static Utils::Id deviceId(const Kit *k); - static void setDevice(Kit *k, IDeviceConstPtr dev); - static void setDeviceId(Kit *k, Utils::Id dataId); - static Utils::FilePath deviceFilePath(const Kit *k, const QString &pathOnDevice); - private: QVariant defaultValue(const Kit *k) const; @@ -154,12 +170,22 @@ private: // BuildDeviceInformation: // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT BuildDeviceKitAspect : public KitAspectFactory +class PROJECTEXPLORER_EXPORT BuildDeviceKitAspect +{ +public: + static Utils::Id id(); + static IDeviceConstPtr device(const Kit *k); + static Utils::Id deviceId(const Kit *k); + static void setDevice(Kit *k, IDeviceConstPtr dev); + static void setDeviceId(Kit *k, Utils::Id dataId); +}; + +class PROJECTEXPLORER_EXPORT BuildDeviceKitAspectFactory : public KitAspectFactory { Q_OBJECT public: - BuildDeviceKitAspect(); + BuildDeviceKitAspectFactory(); void setup(Kit *k) override; Tasks validate(const Kit *k) const override; @@ -172,15 +198,7 @@ public: void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override; - static Utils::Id id(); - static IDeviceConstPtr device(const Kit *k); - static Utils::Id deviceId(const Kit *k); - static void setDevice(Kit *k, IDeviceConstPtr dev); - static void setDeviceId(Kit *k, Utils::Id dataId); - private: - static IDeviceConstPtr defaultDevice(); - void kitsWereLoaded(); void deviceUpdated(Utils::Id dataId); void devicesChanged(); @@ -191,12 +209,20 @@ private: // EnvironmentKitAspect: // -------------------------------------------------------------------------- -class PROJECTEXPLORER_EXPORT EnvironmentKitAspect : public KitAspectFactory +class PROJECTEXPLORER_EXPORT EnvironmentKitAspect +{ +public: + static Utils::Id id(); + static Utils::EnvironmentItems environmentChanges(const Kit *k); + static void setEnvironmentChanges(Kit *k, const Utils::EnvironmentItems &changes); +}; + +class PROJECTEXPLORER_EXPORT EnvironmentKitAspectFactory : public KitAspectFactory { Q_OBJECT public: - EnvironmentKitAspect(); + EnvironmentKitAspectFactory(); Tasks validate(const Kit *k) const override; void fix(Kit *k) override; @@ -207,10 +233,6 @@ public: KitAspect *createKitAspect(Kit *k) const override; ItemList toUserOutput(const Kit *k) const override; - - static Utils::Id id(); - static Utils::EnvironmentItems environmentChanges(const Kit *k); - static void setEnvironmentChanges(Kit *k, const Utils::EnvironmentItems &changes); }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 8f5edad0bc4..636e4937b7f 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -677,12 +677,12 @@ public: IDocumentFactory m_taskFileFactory; StopMonitoringHandler closeTaskFile; - DeviceTypeKitAspect deviceTypeKitAspect; - DeviceKitAspect deviceKitAspect; - BuildDeviceKitAspect buildDeviceKitAspect; - ToolChainKitAspect toolChainKitAspect; - SysRootKitAspect sysRootKitAspect; - EnvironmentKitAspect environmentKitAspect; + DeviceTypeKitAspectFactory deviceTypeKitAspectFactory; + DeviceKitAspectFactory deviceKitAspectFactory; + BuildDeviceKitAspectFactory buildDeviceKitAspectFactory; + ToolChainKitAspectFactory toolChainKitAspectFactory; + SysRootKitAspectFactory sysRootKitAspectFactory; + EnvironmentKitAspectFactory environmentKitAspectFactory; DesktopQmakeRunConfigurationFactory qmakeRunConfigFactory; QbsRunConfigurationFactory qbsRunConfigFactory; From e9266f53ecad01723122edab6a981989ee7bdbe4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 10 Aug 2023 16:09:07 +0200 Subject: [PATCH 0680/1777] CMakeProjectManager: Rename some of the KitAspect related classes ... and split out the static interface. Change-Id: I28cdb2765a00d1bd19790f46a3b2b0da8690e929 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../cmakebuildconfiguration.cpp | 12 +-- .../cmakekitinformation.cpp | 91 ++++++++++--------- .../cmakeprojectmanager/cmakekitinformation.h | 34 ++++--- .../cmakeprojectplugin.cpp | 6 +- 4 files changed, 77 insertions(+), 66 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index b601e723cd5..25acfcb0fec 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -646,18 +646,18 @@ void CMakeBuildSettingsWidget::kitCMakeConfiguration() m_buildConfig->kit()->unblockNotification(); }); - CMakeKitAspect kitAspect; - CMakeGeneratorKitAspect generatorAspect; - CMakeConfigurationKitAspect configurationKitAspect; + CMakeKitAspectFactory kitAspectFactory; + CMakeGeneratorKitAspectFactory generatorAspectFactory; + CMakeConfigurationKitAspectFactory configurationKitAspectFactory; Layouting::Grid grid; - KitAspect *widget = kitAspect.createKitAspect(m_buildConfig->kit()); + KitAspect *widget = kitAspectFactory.createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); widget->addToLayoutWithLabel(grid, dialog); - widget = generatorAspect.createKitAspect(m_buildConfig->kit()); + widget = generatorAspectFactory.createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); widget->addToLayoutWithLabel(grid, dialog); - widget = configurationKitAspect.createKitAspect(m_buildConfig->kit()); + widget = configurationKitAspectFactory.createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); widget->addToLayoutWithLabel(grid, dialog); grid.attachTo(dialog); diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index cb5d018db8f..436c225a5db 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -63,10 +63,10 @@ static Id defaultCMakeToolId() return defaultTool ? defaultTool->id() : Id(); } -class CMakeKitAspectWidget final : public KitAspect +class CMakeKitAspectImpl final : public KitAspect { public: - CMakeKitAspectWidget(Kit *kit, const KitAspectFactory *ki) : KitAspect(kit, ki), + CMakeKitAspectImpl(Kit *kit, const KitAspectFactory *ki) : KitAspect(kit, ki), m_comboBox(createSubWidget<QComboBox>()), m_manageButton(createManageButton(Constants::Settings::TOOLS_ID)) { @@ -77,15 +77,15 @@ public: refresh(); connect(m_comboBox, &QComboBox::currentIndexChanged, - this, &CMakeKitAspectWidget::currentCMakeToolChanged); + this, &CMakeKitAspectImpl::currentCMakeToolChanged); CMakeToolManager *cmakeMgr = CMakeToolManager::instance(); - connect(cmakeMgr, &CMakeToolManager::cmakeAdded, this, &CMakeKitAspectWidget::refresh); - connect(cmakeMgr, &CMakeToolManager::cmakeRemoved, this, &CMakeKitAspectWidget::refresh); - connect(cmakeMgr, &CMakeToolManager::cmakeUpdated, this, &CMakeKitAspectWidget::refresh); + connect(cmakeMgr, &CMakeToolManager::cmakeAdded, this, &CMakeKitAspectImpl::refresh); + connect(cmakeMgr, &CMakeToolManager::cmakeRemoved, this, &CMakeKitAspectImpl::refresh); + connect(cmakeMgr, &CMakeToolManager::cmakeUpdated, this, &CMakeKitAspectImpl::refresh); } - ~CMakeKitAspectWidget() override + ~CMakeKitAspectImpl() override { delete m_comboBox; delete m_manageButton; @@ -162,7 +162,7 @@ private: QWidget *m_manageButton; }; -CMakeKitAspect::CMakeKitAspect() +CMakeKitAspectFactory::CMakeKitAspectFactory() { setObjectName(QLatin1String("CMakeKitAspect")); setId(Constants::TOOL_ID); @@ -205,20 +205,21 @@ void CMakeKitAspect::setCMakeTool(Kit *k, const Id id) k->setValue(Constants::TOOL_ID, toSet.toSetting()); } -Tasks CMakeKitAspect::validate(const Kit *k) const +Tasks CMakeKitAspectFactory::validate(const Kit *k) const { Tasks result; CMakeTool *tool = CMakeKitAspect::cmakeTool(k); if (tool && tool->isValid()) { CMakeTool::Version version = tool->version(); if (version.major < 3 || (version.major == 3 && version.minor < 14)) { - result << BuildSystemTask(Task::Warning, msgUnsupportedVersion(version.fullVersion)); + result << BuildSystemTask(Task::Warning, + CMakeKitAspect::msgUnsupportedVersion(version.fullVersion)); } } return result; } -void CMakeKitAspect::setup(Kit *k) +void CMakeKitAspectFactory::setup(Kit *k) { CMakeTool *tool = CMakeKitAspect::cmakeTool(k); if (tool) @@ -229,32 +230,32 @@ void CMakeKitAspect::setup(Kit *k) for (CMakeTool *tool : CMakeToolManager::cmakeTools()) { const QString toolSource = tool->detectionSource(); if (!toolSource.isEmpty() && toolSource == kitSource) { - setCMakeTool(k, tool->id()); + CMakeKitAspect::setCMakeTool(k, tool->id()); return; } } - setCMakeTool(k, defaultCMakeToolId()); + CMakeKitAspect::setCMakeTool(k, defaultCMakeToolId()); } -void CMakeKitAspect::fix(Kit *k) +void CMakeKitAspectFactory::fix(Kit *k) { setup(k); } -KitAspectFactory::ItemList CMakeKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList CMakeKitAspectFactory::toUserOutput(const Kit *k) const { - const CMakeTool *const tool = cmakeTool(k); + const CMakeTool *const tool = CMakeKitAspect::cmakeTool(k); return {{Tr::tr("CMake"), tool ? tool->displayName() : Tr::tr("Unconfigured")}}; } -KitAspect *CMakeKitAspect::createKitAspect(Kit *k) const +KitAspect *CMakeKitAspectFactory::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); - return new CMakeKitAspectWidget(k, this); + return new CMakeKitAspectImpl(k, this); } -void CMakeKitAspect::addToMacroExpander(Kit *k, MacroExpander *expander) const +void CMakeKitAspectFactory::addToMacroExpander(Kit *k, MacroExpander *expander) const { QTC_ASSERT(k, return); expander->registerFileVariables("CMake:Executable", Tr::tr("Path to the cmake executable"), @@ -264,9 +265,9 @@ void CMakeKitAspect::addToMacroExpander(Kit *k, MacroExpander *expander) const }); } -QSet<Id> CMakeKitAspect::availableFeatures(const Kit *k) const +QSet<Id> CMakeKitAspectFactory::availableFeatures(const Kit *k) const { - if (cmakeTool(k)) + if (CMakeKitAspect::cmakeTool(k)) return { CMakeProjectManager::Constants::CMAKE_FEATURE_ID }; return {}; } @@ -289,10 +290,10 @@ const char EXTRA_GENERATOR_KEY[] = "ExtraGenerator"; const char PLATFORM_KEY[] = "Platform"; const char TOOLSET_KEY[] = "Toolset"; -class CMakeGeneratorKitAspectWidget final : public KitAspect +class CMakeGeneratorKitAspectImpl final : public KitAspect { public: - CMakeGeneratorKitAspectWidget(Kit *kit, const KitAspectFactory *ki) + CMakeGeneratorKitAspectImpl(Kit *kit, const KitAspectFactory *ki) : KitAspect(kit, ki), m_label(createSubWidget<ElidingLabel>()), m_changeButton(createSubWidget<QPushButton>()) @@ -306,10 +307,10 @@ public: m_changeButton->setText(Tr::tr("Change...")); refresh(); connect(m_changeButton, &QPushButton::clicked, - this, &CMakeGeneratorKitAspectWidget::changeGenerator); + this, &CMakeGeneratorKitAspectImpl::changeGenerator); } - ~CMakeGeneratorKitAspectWidget() override + ~CMakeGeneratorKitAspectImpl() override { delete m_label; delete m_changeButton; @@ -511,7 +512,7 @@ static void setGeneratorInfo(Kit *k, const GeneratorInfo &info) k->setValue(GENERATOR_ID, info.toVariant()); } -CMakeGeneratorKitAspect::CMakeGeneratorKitAspect() +CMakeGeneratorKitAspectFactory::CMakeGeneratorKitAspectFactory() { setObjectName(QLatin1String("CMakeGeneratorKitAspect")); setId(GENERATOR_ID); @@ -631,7 +632,7 @@ bool CMakeGeneratorKitAspect::isMultiConfigGenerator(const Kit *k) generator == "Ninja Multi-Config"; } -QVariant CMakeGeneratorKitAspect::defaultValue(const Kit *k) const +QVariant CMakeGeneratorKitAspectFactory::defaultValue(const Kit *k) const { QTC_ASSERT(k, return QVariant()); @@ -708,7 +709,7 @@ QVariant CMakeGeneratorKitAspect::defaultValue(const Kit *k) const return GeneratorInfo(it->name).toVariant(); } -Tasks CMakeGeneratorKitAspect::validate(const Kit *k) const +Tasks CMakeGeneratorKitAspectFactory::validate(const Kit *k) const { CMakeTool *tool = CMakeKitAspect::cmakeTool(k); if (!tool) @@ -745,7 +746,7 @@ Tasks CMakeGeneratorKitAspect::validate(const Kit *k) const return result; } -void CMakeGeneratorKitAspect::setup(Kit *k) +void CMakeGeneratorKitAspectFactory::setup(Kit *k) { if (!k || k->hasValue(id())) return; @@ -754,7 +755,7 @@ void CMakeGeneratorKitAspect::setup(Kit *k) setGeneratorInfo(k, info); } -void CMakeGeneratorKitAspect::fix(Kit *k) +void CMakeGeneratorKitAspectFactory::fix(Kit *k) { const CMakeTool *tool = CMakeKitAspect::cmakeTool(k); const GeneratorInfo info = generatorInfo(k); @@ -779,7 +780,7 @@ void CMakeGeneratorKitAspect::fix(Kit *k) } } -void CMakeGeneratorKitAspect::upgrade(Kit *k) +void CMakeGeneratorKitAspectFactory::upgrade(Kit *k) { QTC_ASSERT(k, return); @@ -798,7 +799,7 @@ void CMakeGeneratorKitAspect::upgrade(Kit *k) } } -KitAspectFactory::ItemList CMakeGeneratorKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList CMakeGeneratorKitAspectFactory::toUserOutput(const Kit *k) const { const GeneratorInfo info = generatorInfo(k); QString message; @@ -814,12 +815,12 @@ KitAspectFactory::ItemList CMakeGeneratorKitAspect::toUserOutput(const Kit *k) c return {{Tr::tr("CMake Generator"), message}}; } -KitAspect *CMakeGeneratorKitAspect::createKitAspect(Kit *k) const +KitAspect *CMakeGeneratorKitAspectFactory::createKitAspect(Kit *k) const { - return new CMakeGeneratorKitAspectWidget(k, this); + return new CMakeGeneratorKitAspectImpl(k, this); } -void CMakeGeneratorKitAspect::addToBuildEnvironment(const Kit *k, Environment &env) const +void CMakeGeneratorKitAspectFactory::addToBuildEnvironment(const Kit *k, Environment &env) const { GeneratorInfo info = generatorInfo(k); if (info.generator == "NMake Makefiles JOM") { @@ -1001,7 +1002,7 @@ private: }; -CMakeConfigurationKitAspect::CMakeConfigurationKitAspect() +CMakeConfigurationKitAspectFactory::CMakeConfigurationKitAspectFactory() { setObjectName(QLatin1String("CMakeConfigurationKitAspect")); setId(CONFIGURATION_ID); @@ -1102,16 +1103,16 @@ CMakeConfigItem CMakeConfigurationKitAspect::cmakePresetConfigItem(const Project }); } -QVariant CMakeConfigurationKitAspect::defaultValue(const Kit *k) const +QVariant CMakeConfigurationKitAspectFactory::defaultValue(const Kit *k) const { // FIXME: Convert preload scripts - CMakeConfig config = defaultConfiguration(k); + CMakeConfig config = CMakeConfigurationKitAspect::defaultConfiguration(k); const QStringList tmp = Utils::transform(config.toList(), [](const CMakeConfigItem &i) { return i.toString(); }); return tmp; } -Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const +Tasks CMakeConfigurationKitAspectFactory::validate(const Kit *k) const { QTC_ASSERT(k, return Tasks()); @@ -1122,7 +1123,7 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const const QtSupport::QtVersion *const version = QtSupport::QtKitAspect::qtVersion(k); const ToolChain *const tcC = ToolChainKitAspect::cToolChain(k); const ToolChain *const tcCxx = ToolChainKitAspect::cxxToolChain(k); - const CMakeConfig config = configuration(k); + const CMakeConfig config = CMakeConfigurationKitAspect::configuration(k); const bool isQt4 = version && version->qtVersion() < QVersionNumber(5, 0, 0); FilePath qmakePath; // This is relative to the cmake used for building. @@ -1206,23 +1207,23 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const return result; } -void CMakeConfigurationKitAspect::setup(Kit *k) +void CMakeConfigurationKitAspectFactory::setup(Kit *k) { if (k && !k->hasValue(CONFIGURATION_ID)) k->setValue(CONFIGURATION_ID, defaultValue(k)); } -void CMakeConfigurationKitAspect::fix(Kit *k) +void CMakeConfigurationKitAspectFactory::fix(Kit *k) { Q_UNUSED(k) } -KitAspectFactory::ItemList CMakeConfigurationKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList CMakeConfigurationKitAspectFactory::toUserOutput(const Kit *k) const { - return {{Tr::tr("CMake Configuration"), toStringList(k).join("<br>")}}; + return {{Tr::tr("CMake Configuration"), CMakeConfigurationKitAspect::toStringList(k).join("<br>")}}; } -KitAspect *CMakeConfigurationKitAspect::createKitAspect(Kit *k) const +KitAspect *CMakeConfigurationKitAspectFactory::createKitAspect(Kit *k) const { if (!k) return nullptr; diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.h b/src/plugins/cmakeprojectmanager/cmakekitinformation.h index eee96fd88d1..eca84c46d90 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.h +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.h @@ -13,16 +13,21 @@ namespace CMakeProjectManager { class CMakeTool; -class CMAKE_EXPORT CMakeKitAspect : public ProjectExplorer::KitAspectFactory +class CMAKE_EXPORT CMakeKitAspect { public: - CMakeKitAspect(); - static Utils::Id id(); static Utils::Id cmakeToolId(const ProjectExplorer::Kit *k); static CMakeTool *cmakeTool(const ProjectExplorer::Kit *k); static void setCMakeTool(ProjectExplorer::Kit *k, const Utils::Id id); + static QString msgUnsupportedVersion(const QByteArray &versionString); +}; + +class CMAKE_EXPORT CMakeKitAspectFactory : public ProjectExplorer::KitAspectFactory +{ +public: + CMakeKitAspectFactory(); // KitAspect interface ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; @@ -34,15 +39,11 @@ public: void addToMacroExpander(ProjectExplorer::Kit *k, Utils::MacroExpander *expander) const final; QSet<Utils::Id> availableFeatures(const ProjectExplorer::Kit *k) const final; - - static QString msgUnsupportedVersion(const QByteArray &versionString); }; -class CMAKE_EXPORT CMakeGeneratorKitAspect : public ProjectExplorer::KitAspectFactory +class CMAKE_EXPORT CMakeGeneratorKitAspect { public: - CMakeGeneratorKitAspect(); - static QString generator(const ProjectExplorer::Kit *k); static QString extraGenerator(const ProjectExplorer::Kit *k); static QString platform(const ProjectExplorer::Kit *k); @@ -56,8 +57,13 @@ public: static QStringList generatorArguments(const ProjectExplorer::Kit *k); static CMakeConfig generatorCMakeConfig(const ProjectExplorer::Kit *k); static bool isMultiConfigGenerator(const ProjectExplorer::Kit *k); +}; + +class CMAKE_EXPORT CMakeGeneratorKitAspectFactory : public ProjectExplorer::KitAspectFactory +{ +public: + CMakeGeneratorKitAspectFactory(); - // KitAspect interface ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; void setup(ProjectExplorer::Kit *k) final; void fix(ProjectExplorer::Kit *k) final; @@ -70,11 +76,9 @@ private: QVariant defaultValue(const ProjectExplorer::Kit *k) const; }; -class CMAKE_EXPORT CMakeConfigurationKitAspect : public ProjectExplorer::KitAspectFactory +class CMAKE_EXPORT CMakeConfigurationKitAspect { public: - CMakeConfigurationKitAspect(); - static CMakeConfig configuration(const ProjectExplorer::Kit *k); static void setConfiguration(ProjectExplorer::Kit *k, const CMakeConfig &config); @@ -90,6 +94,12 @@ public: static void setCMakePreset(ProjectExplorer::Kit *k, const QString &presetName); static CMakeConfigItem cmakePresetConfigItem(const ProjectExplorer::Kit *k); +}; + +class CMAKE_EXPORT CMakeConfigurationKitAspectFactory : public ProjectExplorer::KitAspectFactory +{ +public: + CMakeConfigurationKitAspectFactory(); // KitAspect interface ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index 38352126e81..226398fb4d9 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -62,9 +62,9 @@ public: CMakeBuildTargetFilter cMakeBuildTargetFilter; CMakeOpenTargetFilter cMakeOpenTargetFilter; - CMakeKitAspect cmakeKitAspect; - CMakeGeneratorKitAspect cmakeGeneratorKitAspect; - CMakeConfigurationKitAspect cmakeConfigurationKitAspect; + CMakeKitAspectFactory cmakeKitAspectFactory; + CMakeGeneratorKitAspectFactory cmakeGeneratorKitAspectFactory; + CMakeConfigurationKitAspectFactory cmakeConfigurationKitAspectFactory; CMakeFormatter cmakeFormatter; }; From bb06155f090b3e47e0e92ea26b9ef54715c7d086 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 10 Aug 2023 16:20:25 +0200 Subject: [PATCH 0681/1777] Meson: Rename some of the KitAspect related classes ... and split out the static interface. Change-Id: Iaa92ab8e0b29e47736af6c2b5ed146369f2d7294 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../mesonprojectplugin.cpp | 4 +-- .../mesontoolkitaspect.cpp | 27 +++++++++-------- .../mesonprojectmanager/mesontoolkitaspect.h | 29 ++++++++++--------- .../ninjatoolkitaspect.cpp | 27 +++++++++-------- .../mesonprojectmanager/ninjatoolkitaspect.h | 28 +++++++++--------- 5 files changed, 59 insertions(+), 56 deletions(-) diff --git a/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp b/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp index 1b71ff5e3f2..e7518d74013 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp +++ b/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp @@ -46,8 +46,8 @@ public: private: ToolsSettingsPage m_toolslSettingsPage; ToolsSettingsAccessor m_toolsSettings; - MesonToolKitAspect m_mesonKitAspect; - NinjaToolKitAspect m_ninjaKitAspect; + MesonToolKitAspectFactory m_mesonKitAspectFactory; + NinjaToolKitAspectFactory m_ninjaKitAspectFactory; MesonBuildStepFactory m_buildStepFactory; MesonBuildConfigurationFactory m_buildConfigurationFactory; MesonRunConfigurationFactory m_runConfigurationFactory; diff --git a/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp b/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp index 024606d933a..b5b494064a0 100644 --- a/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp +++ b/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp @@ -8,12 +8,11 @@ #include <utils/qtcassert.h> -namespace MesonProjectManager { -namespace Internal { +namespace MesonProjectManager::Internal { static const char TOOL_ID[] = "MesonProjectManager.MesonKitInformation.Meson"; -MesonToolKitAspect::MesonToolKitAspect() +MesonToolKitAspectFactory::MesonToolKitAspectFactory() { setObjectName(QLatin1String("MesonKitAspect")); setId(TOOL_ID); @@ -23,41 +22,41 @@ MesonToolKitAspect::MesonToolKitAspect() setPriority(9000); } -ProjectExplorer::Tasks MesonToolKitAspect::validate(const ProjectExplorer::Kit *k) const +ProjectExplorer::Tasks MesonToolKitAspectFactory::validate(const ProjectExplorer::Kit *k) const { ProjectExplorer::Tasks tasks; - const auto tool = mesonTool(k); + const auto tool = MesonToolKitAspect::mesonTool(k); if (tool && !tool->isValid()) tasks << ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::Warning, Tr::tr("Cannot validate this meson executable.")}; return tasks; } -void MesonToolKitAspect::setup(ProjectExplorer::Kit *k) +void MesonToolKitAspectFactory::setup(ProjectExplorer::Kit *k) { - const auto tool = mesonTool(k); + const auto tool = MesonToolKitAspect::mesonTool(k); if (!tool) { const auto autoDetected = MesonTools::mesonWrapper(); if (autoDetected) - setMesonTool(k, autoDetected->id()); + MesonToolKitAspect::setMesonTool(k, autoDetected->id()); } } -void MesonToolKitAspect::fix(ProjectExplorer::Kit *k) +void MesonToolKitAspectFactory::fix(ProjectExplorer::Kit *k) { setup(k); } -ProjectExplorer::KitAspectFactory::ItemList MesonToolKitAspect::toUserOutput( +ProjectExplorer::KitAspectFactory::ItemList MesonToolKitAspectFactory::toUserOutput( const ProjectExplorer::Kit *k) const { - const auto tool = mesonTool(k); + const auto tool = MesonToolKitAspect::mesonTool(k); if (tool) return {{Tr::tr("Meson"), tool->name()}}; return {{Tr::tr("Meson"), Tr::tr("Unconfigured")}}; } -ProjectExplorer::KitAspect *MesonToolKitAspect::createKitAspect(ProjectExplorer::Kit *k) const +ProjectExplorer::KitAspect *MesonToolKitAspectFactory::createKitAspect(ProjectExplorer::Kit *k) const { QTC_ASSERT(k, return nullptr); return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Meson}; @@ -74,5 +73,5 @@ Utils::Id MesonToolKitAspect::mesonToolId(const ProjectExplorer::Kit *kit) QTC_ASSERT(kit, return {}); return Utils::Id::fromSetting(kit->value(TOOL_ID)); } -} // namespace Internal -} // namespace MesonProjectManager + +} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/mesontoolkitaspect.h b/src/plugins/mesonprojectmanager/mesontoolkitaspect.h index a53f49a7678..b6764c2ea91 100644 --- a/src/plugins/mesonprojectmanager/mesontoolkitaspect.h +++ b/src/plugins/mesonprojectmanager/mesontoolkitaspect.h @@ -8,20 +8,11 @@ #include <projectexplorer/kit.h> #include <projectexplorer/kitmanager.h> -namespace MesonProjectManager { -namespace Internal { +namespace MesonProjectManager::Internal { -class MesonToolKitAspect final : public ProjectExplorer::KitAspectFactory +class MesonToolKitAspect final { public: - MesonToolKitAspect(); - - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; - void setup(ProjectExplorer::Kit *k) final; - void fix(ProjectExplorer::Kit *k) final; - ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const final; - static void setMesonTool(ProjectExplorer::Kit *kit, Utils::Id id); static Utils::Id mesonToolId(const ProjectExplorer::Kit *kit); @@ -37,5 +28,17 @@ public: } }; -} // namespace Internal -} // namespace MesonProjectManager +class MesonToolKitAspectFactory final : public ProjectExplorer::KitAspectFactory +{ +public: + MesonToolKitAspectFactory(); + + ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; + void setup(ProjectExplorer::Kit *k) final; + void fix(ProjectExplorer::Kit *k) final; + ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const final; + +}; + +} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp index 61d117f61ac..1e093588252 100644 --- a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp +++ b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp @@ -8,12 +8,11 @@ #include <utils/qtcassert.h> -namespace MesonProjectManager { -namespace Internal { +namespace MesonProjectManager::Internal { static const char TOOL_ID[] = "MesonProjectManager.MesonKitInformation.Ninja"; -NinjaToolKitAspect::NinjaToolKitAspect() +NinjaToolKitAspectFactory::NinjaToolKitAspectFactory() { setObjectName(QLatin1String("NinjaKitAspect")); setId(TOOL_ID); @@ -23,41 +22,41 @@ NinjaToolKitAspect::NinjaToolKitAspect() setPriority(9000); } -ProjectExplorer::Tasks NinjaToolKitAspect::validate(const ProjectExplorer::Kit *k) const +ProjectExplorer::Tasks NinjaToolKitAspectFactory::validate(const ProjectExplorer::Kit *k) const { ProjectExplorer::Tasks tasks; - const auto tool = ninjaTool(k); + const auto tool = NinjaToolKitAspect::ninjaTool(k); if (tool && !tool->isValid()) tasks << ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::Warning, Tr::tr("Cannot validate this Ninja executable.")}; return tasks; } -void NinjaToolKitAspect::setup(ProjectExplorer::Kit *k) +void NinjaToolKitAspectFactory::setup(ProjectExplorer::Kit *k) { - const auto tool = ninjaTool(k); + const auto tool = NinjaToolKitAspect::ninjaTool(k); if (!tool) { const auto autoDetected = MesonTools::ninjaWrapper(); if (autoDetected) - setNinjaTool(k, autoDetected->id()); + NinjaToolKitAspect::setNinjaTool(k, autoDetected->id()); } } -void NinjaToolKitAspect::fix(ProjectExplorer::Kit *k) +void NinjaToolKitAspectFactory::fix(ProjectExplorer::Kit *k) { setup(k); } -ProjectExplorer::KitAspectFactory::ItemList NinjaToolKitAspect::toUserOutput( +ProjectExplorer::KitAspectFactory::ItemList NinjaToolKitAspectFactory::toUserOutput( const ProjectExplorer::Kit *k) const { - const auto tool = ninjaTool(k); + const auto tool = NinjaToolKitAspect::ninjaTool(k); if (tool) return {{Tr::tr("Ninja"), tool->name()}}; return {{Tr::tr("Ninja"), Tr::tr("Unconfigured")}}; } -ProjectExplorer::KitAspect *NinjaToolKitAspect::createKitAspect(ProjectExplorer::Kit *k) const +ProjectExplorer::KitAspect *NinjaToolKitAspectFactory::createKitAspect(ProjectExplorer::Kit *k) const { QTC_ASSERT(k, return nullptr); return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Ninja}; @@ -74,5 +73,5 @@ Utils::Id NinjaToolKitAspect::ninjaToolId(const ProjectExplorer::Kit *kit) QTC_ASSERT(kit, return {}); return Utils::Id::fromSetting(kit->value(TOOL_ID)); } -} // namespace Internal -} // namespace MesonProjectManager + +} // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.h b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.h index 19cfa0760a0..ce080d1e676 100644 --- a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.h +++ b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.h @@ -8,20 +8,11 @@ #include <projectexplorer/kit.h> #include <projectexplorer/kitmanager.h> -namespace MesonProjectManager { -namespace Internal { +namespace MesonProjectManager::Internal { -class NinjaToolKitAspect final : public ProjectExplorer::KitAspectFactory +class NinjaToolKitAspect final { public: - NinjaToolKitAspect(); - - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; - void setup(ProjectExplorer::Kit *k) final; - void fix(ProjectExplorer::Kit *k) final; - ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const final; - static void setNinjaTool(ProjectExplorer::Kit *kit, Utils::Id id); static Utils::Id ninjaToolId(const ProjectExplorer::Kit *kit); @@ -36,5 +27,16 @@ public: } }; -} // namespace Internal -} // namespace MesonProjectManager +class NinjaToolKitAspectFactory final : public ProjectExplorer::KitAspectFactory +{ +public: + NinjaToolKitAspectFactory(); + + ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; + void setup(ProjectExplorer::Kit *k) final; + void fix(ProjectExplorer::Kit *k) final; + ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; + ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const final; +}; + +} // MesonProjectManager::Internal From 1fa67e1c678959fc104bd9d7aa533b1434e0360a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 10 Aug 2023 16:33:11 +0200 Subject: [PATCH 0682/1777] Qbs: Rename some of the KitAspect related classes ... and split out the static interface. Change-Id: I62d2a188e75bbc3e3d912c3ebf0c4300bec9fb79 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../qbsprojectmanager/qbskitinformation.cpp | 23 +++++++++++-------- .../qbsprojectmanager/qbskitinformation.h | 16 ++++++++----- .../qbsprojectmanagerplugin.cpp | 2 +- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.cpp b/src/plugins/qbsprojectmanager/qbskitinformation.cpp index 6a93a73ef16..84ad6d34a47 100644 --- a/src/plugins/qbsprojectmanager/qbskitinformation.cpp +++ b/src/plugins/qbsprojectmanager/qbskitinformation.cpp @@ -20,15 +20,15 @@ using namespace ProjectExplorer; namespace QbsProjectManager { namespace Internal { -class AspectWidget final : public KitAspect +class QbsKitAspectImpl final : public KitAspect { public: - AspectWidget(Kit *kit, const KitAspectFactory *kitInfo) + QbsKitAspectImpl(Kit *kit, const KitAspectFactory *kitInfo) : KitAspect(kit, kitInfo), m_contentLabel(createSubWidget<Utils::ElidingLabel>()), m_changeButton(createSubWidget<QPushButton>(Tr::tr("Change..."))) { - connect(m_changeButton, &QPushButton::clicked, this, &AspectWidget::changeProperties); + connect(m_changeButton, &QPushButton::clicked, this, &QbsKitAspectImpl::changeProperties); } private: @@ -53,7 +53,7 @@ private: QPushButton * const m_changeButton; }; -QbsKitAspect::QbsKitAspect() +QbsKitAspectFactory::QbsKitAspectFactory() { setObjectName(QLatin1String("QbsKitAspect")); setId(QbsKitAspect::id()); @@ -90,16 +90,19 @@ Utils::Id QbsKitAspect::id() return "Qbs.KitInformation"; } -Tasks QbsKitAspect::validate(const Kit *) const { return {}; } - -KitAspectFactory::ItemList QbsKitAspect::toUserOutput(const Kit *k) const +Tasks QbsKitAspectFactory::validate(const Kit *) const { - return {{displayName(), representation(k)}}; + return {}; } -KitAspect *QbsKitAspect::createKitAspect(Kit *k) const +KitAspectFactory::ItemList QbsKitAspectFactory::toUserOutput(const Kit *k) const { - return new AspectWidget(k, this); + return {{displayName(), QbsKitAspect::representation(k)}}; +} + +KitAspect *QbsKitAspectFactory::createKitAspect(Kit *k) const +{ + return new QbsKitAspectImpl(k, this); } } // namespace Internal diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.h b/src/plugins/qbsprojectmanager/qbskitinformation.h index 737e1ba384d..f6f846ecb41 100644 --- a/src/plugins/qbsprojectmanager/qbskitinformation.h +++ b/src/plugins/qbsprojectmanager/qbskitinformation.h @@ -8,20 +8,24 @@ namespace QbsProjectManager { namespace Internal { -class QbsKitAspect final : public ProjectExplorer::KitAspectFactory +class QbsKitAspect final { - Q_OBJECT - public: - QbsKitAspect(); - static QString representation(const ProjectExplorer::Kit *kit); static QVariantMap properties(const ProjectExplorer::Kit *kit); static void setProperties(ProjectExplorer::Kit *kit, const QVariantMap &properties); -private: static Utils::Id id(); +}; +class QbsKitAspectFactory final : public ProjectExplorer::KitAspectFactory +{ + Q_OBJECT + +public: + QbsKitAspectFactory(); + +private: ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *) const override; ItemList toUserOutput(const ProjectExplorer::Kit *) const override; ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const override; diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp index acb6dc45e49..0f4a08aad11 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp @@ -74,7 +74,7 @@ public: QbsInstallStepFactory installStepFactory; QbsSettingsPage settingsPage; QbsProfilesSettingsPage profilesSetttingsPage; - QbsKitAspect qbsKitAspect; + QbsKitAspectFactory qbsKitAspectFactory; }; QbsProjectManagerPlugin::~QbsProjectManagerPlugin() From 3e9886bd9085854f11c99676214c894b45368fb1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 10 Aug 2023 16:49:55 +0200 Subject: [PATCH 0683/1777] QtSupport: Rename some of the KitAspect related classes ... and split out the static interface. Change-Id: I5fdd851bd230a062440be6be9a4bf1fce4f00861 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/qtsupport/qtkitinformation.cpp | 62 +++++++++++----------- src/plugins/qtsupport/qtkitinformation.h | 36 +++++++------ src/plugins/qtsupport/qtsupportplugin.cpp | 2 +- 3 files changed, 52 insertions(+), 48 deletions(-) diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitinformation.cpp index 020c35523a4..2ad9d78af3e 100644 --- a/src/plugins/qtsupport/qtkitinformation.cpp +++ b/src/plugins/qtsupport/qtkitinformation.cpp @@ -130,7 +130,7 @@ private: }; } // namespace Internal -QtKitAspect::QtKitAspect() +QtKitAspectFactory::QtKitAspectFactory() { setObjectName(QLatin1String("QtKitAspect")); setId(QtKitAspect::id()); @@ -141,10 +141,10 @@ QtKitAspect::QtKitAspect() setPriority(26000); connect(KitManager::instance(), &KitManager::kitsLoaded, - this, &QtKitAspect::kitsWereLoaded); + this, &QtKitAspectFactory::kitsWereLoaded); } -void QtKitAspect::setup(Kit *k) +void QtKitAspectFactory::setup(Kit *k) { if (!k || k->hasValue(id())) return; @@ -175,25 +175,25 @@ void QtKitAspect::setup(Kit *k) k->setValue(id(), candidates.first()->uniqueId()); } -Tasks QtKitAspect::validate(const Kit *k) const +Tasks QtKitAspectFactory::validate(const Kit *k) const { QTC_ASSERT(QtVersionManager::isLoaded(), return {}); - QtVersion *version = qtVersion(k); + QtVersion *version = QtKitAspect::qtVersion(k); if (!version) return {}; return version->validateKit(k); } -void QtKitAspect::fix(Kit *k) +void QtKitAspectFactory::fix(Kit *k) { QTC_ASSERT(QtVersionManager::isLoaded(), return); - QtVersion *version = qtVersion(k); + QtVersion *version = QtKitAspect::qtVersion(k); if (!version) { - if (qtVersionId(k) >= 0) { + if (QtKitAspect::qtVersionId(k) >= 0) { qWarning("Qt version is no longer known, removing from kit \"%s\".", qPrintable(k->displayName())); - setQtVersionId(k, -1); + QtKitAspect::setQtVersionId(k, -1); } return; } @@ -260,34 +260,34 @@ void QtKitAspect::fix(Kit *k) } } -KitAspect *QtKitAspect::createKitAspect(Kit *k) const +KitAspect *QtKitAspectFactory::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); return new Internal::QtKitAspectWidget(k, this); } -QString QtKitAspect::displayNamePostfix(const Kit *k) const +QString QtKitAspectFactory::displayNamePostfix(const Kit *k) const { - QtVersion *version = qtVersion(k); + QtVersion *version = QtKitAspect::qtVersion(k); return version ? version->displayName() : QString(); } -KitAspectFactory::ItemList QtKitAspect::toUserOutput(const Kit *k) const +KitAspectFactory::ItemList QtKitAspectFactory::toUserOutput(const Kit *k) const { - QtVersion *version = qtVersion(k); + QtVersion *version = QtKitAspect::qtVersion(k); return {{Tr::tr("Qt version"), version ? version->displayName() : Tr::tr("None")}}; } -void QtKitAspect::addToBuildEnvironment(const Kit *k, Environment &env) const +void QtKitAspectFactory::addToBuildEnvironment(const Kit *k, Environment &env) const { - QtVersion *version = qtVersion(k); + QtVersion *version = QtKitAspect::qtVersion(k); if (version) version->addToEnvironment(k, env); } -QList<OutputLineParser *> QtKitAspect::createOutputParsers(const Kit *k) const +QList<OutputLineParser *> QtKitAspectFactory::createOutputParsers(const Kit *k) const { - if (qtVersion(k)) + if (QtKitAspect::qtVersion(k)) return {new Internal::QtTestParser, new QtParser}; return {}; } @@ -308,19 +308,19 @@ public: std::shared_ptr<MacroExpander> expander; }; -void QtKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const +void QtKitAspectFactory::addToMacroExpander(Kit *kit, MacroExpander *expander) const { QTC_ASSERT(kit, return); expander->registerSubProvider(QtMacroSubProvider(kit)); expander->registerVariable("Qt:Name", Tr::tr("Name of Qt Version"), [kit]() -> QString { - QtVersion *version = qtVersion(kit); + QtVersion *version = QtKitAspect::qtVersion(kit); return version ? version->displayName() : Tr::tr("unknown"); }); expander->registerVariable("Qt:qmakeExecutable", Tr::tr("Path to the qmake executable"), [kit]() -> QString { - QtVersion *version = qtVersion(kit); + QtVersion *version = QtKitAspect::qtVersion(kit); return version ? version->qmakeFilePath().path() : QString(); }); } @@ -385,27 +385,27 @@ void QtKitAspect::addHostBinariesToPath(const Kit *k, Environment &env) env.prependOrSetPath(qt->hostBinPath()); } -void QtKitAspect::qtVersionsChanged(const QList<int> &addedIds, - const QList<int> &removedIds, - const QList<int> &changedIds) +void QtKitAspectFactory::qtVersionsChanged(const QList<int> &addedIds, + const QList<int> &removedIds, + const QList<int> &changedIds) { Q_UNUSED(addedIds) Q_UNUSED(removedIds) for (Kit *k : KitManager::kits()) { - if (changedIds.contains(qtVersionId(k))) { + if (changedIds.contains(QtKitAspect::qtVersionId(k))) { k->validate(); // Qt version may have become (in)valid notifyAboutUpdate(k); } } } -void QtKitAspect::kitsWereLoaded() +void QtKitAspectFactory::kitsWereLoaded() { for (Kit *k : KitManager::kits()) fix(k); connect(QtVersionManager::instance(), &QtVersionManager::qtVersionsChanged, - this, &QtKitAspect::qtVersionsChanged); + this, &QtKitAspectFactory::qtVersionsChanged); } Kit::Predicate QtKitAspect::platformPredicate(Id platform) @@ -433,21 +433,21 @@ Kit::Predicate QtKitAspect::qtVersionPredicate(const QSet<Id> &required, }; } -QSet<Id> QtKitAspect::supportedPlatforms(const Kit *k) const +QSet<Id> QtKitAspectFactory::supportedPlatforms(const Kit *k) const { QtVersion *version = QtKitAspect::qtVersion(k); return version ? version->targetDeviceTypes() : QSet<Id>(); } -QSet<Id> QtKitAspect::availableFeatures(const Kit *k) const +QSet<Id> QtKitAspectFactory::availableFeatures(const Kit *k) const { QtVersion *version = QtKitAspect::qtVersion(k); return version ? version->features() : QSet<Id>(); } -int QtKitAspect::weight(const Kit *k) const +int QtKitAspectFactory::weight(const Kit *k) const { - const QtVersion * const qt = qtVersion(k); + const QtVersion * const qt = QtKitAspect::qtVersion(k); if (!qt) return 0; if (!qt->targetDeviceTypes().contains(DeviceTypeKitAspect::deviceTypeId(k))) diff --git a/src/plugins/qtsupport/qtkitinformation.h b/src/plugins/qtsupport/qtkitinformation.h index 367ab560ffc..2d1a86e88c4 100644 --- a/src/plugins/qtsupport/qtkitinformation.h +++ b/src/plugins/qtsupport/qtkitinformation.h @@ -13,12 +13,30 @@ namespace Utils { class MacroExpander; } namespace QtSupport { -class QTSUPPORT_EXPORT QtKitAspect : public ProjectExplorer::KitAspectFactory +class QTSUPPORT_EXPORT QtKitAspect +{ +public: + static Utils::Id id(); + static int qtVersionId(const ProjectExplorer::Kit *k); + static void setQtVersionId(ProjectExplorer::Kit *k, const int id); + static QtVersion *qtVersion(const ProjectExplorer::Kit *k); + static void setQtVersion(ProjectExplorer::Kit *k, const QtVersion *v); + + static void addHostBinariesToPath(const ProjectExplorer::Kit *k, Utils::Environment &env); + + static ProjectExplorer::Kit::Predicate platformPredicate(Utils::Id availablePlatforms); + static ProjectExplorer::Kit::Predicate + qtVersionPredicate(const QSet<Utils::Id> &required = QSet<Utils::Id>(), + const QVersionNumber &min = QVersionNumber(0, 0, 0), + const QVersionNumber &max = QVersionNumber(INT_MAX, INT_MAX, INT_MAX)); +}; + +class QTSUPPORT_EXPORT QtKitAspectFactory : public ProjectExplorer::KitAspectFactory { Q_OBJECT public: - QtKitAspect(); + QtKitAspectFactory(); void setup(ProjectExplorer::Kit *k) override; @@ -35,20 +53,6 @@ public: QList<Utils::OutputLineParser *> createOutputParsers(const ProjectExplorer::Kit *k) const override; void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override; - static Utils::Id id(); - static int qtVersionId(const ProjectExplorer::Kit *k); - static void setQtVersionId(ProjectExplorer::Kit *k, const int id); - static QtVersion *qtVersion(const ProjectExplorer::Kit *k); - static void setQtVersion(ProjectExplorer::Kit *k, const QtVersion *v); - - static void addHostBinariesToPath(const ProjectExplorer::Kit *k, Utils::Environment &env); - - static ProjectExplorer::Kit::Predicate platformPredicate(Utils::Id availablePlatforms); - static ProjectExplorer::Kit::Predicate - qtVersionPredicate(const QSet<Utils::Id> &required = QSet<Utils::Id>(), - const QVersionNumber &min = QVersionNumber(0, 0, 0), - const QVersionNumber &max = QVersionNumber(INT_MAX, INT_MAX, INT_MAX)); - QSet<Utils::Id> supportedPlatforms(const ProjectExplorer::Kit *k) const override; QSet<Utils::Id> availableFeatures(const ProjectExplorer::Kit *k) const override; diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index ed0cb998ff7..7a2ebc48954 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -58,7 +58,7 @@ public: ExamplesWelcomePage examplesPage{true}; ExamplesWelcomePage tutorialPage{false}; - QtKitAspect qtKiAspect; + QtKitAspectFactory qtKitAspectFactory; QtOutputFormatterFactory qtOutputFormatterFactory; From a7fcb71b90be3bff1bcaccffe23ed5dc9a4a50d0 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Fri, 4 Aug 2023 14:06:39 +0200 Subject: [PATCH 0684/1777] ClangFormat: Add warning for clangformat version Added warning when current clangformat major version does not match with version what checks was generated for. Change-Id: I818c9a4f79385cba4e492ea5428bb051f329a9d4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../clangformat/clangformatconfigwidget.cpp | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index 26abaab009a..e736570058c 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -31,6 +31,7 @@ #include <utils/guard.h> #include <utils/layoutbuilder.h> #include <utils/qtcassert.h> +#include <utils/utilsicons.h> #include <QComboBox> #include <QLabel> @@ -39,9 +40,11 @@ #include <QScrollArea> #include <QSharedPointer> #include <QVBoxLayout> +#include <QVersionNumber> #include <QWeakPointer> #include <QWidget> +#include <clang/Basic/Version.h> #include <clang/Format/Format.h> #include <sstream> @@ -62,6 +65,9 @@ public: clang::format::FormatStyle style; Utils::Guard ignoreChanges; QLabel *fallbackConfig; + QLabel *clangVersion; + QLabel *clangWarningText; + QLabel *clangWarningIcon; }; bool ClangFormatConfigWidget::eventFilter(QObject *object, QEvent *event) @@ -90,6 +96,28 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferenc d->checksWidget->setEnabled(!codeStyle->isReadOnly() && !codeStyle->isTemporarilyReadOnly() && !codeStyle->isAdditionalTabDisabled()); + + static const int expectedMajorVersion = 16; + d->clangVersion = new QLabel(Tr::tr("Current clang-format version: ") + LLVM_VERSION_STRING, + this); + d->clangWarningText + = new QLabel(Tr::tr("The widget was generated for ClangFormat %1. " + "If you use a different version, the widget may work incorrectly.") + .arg(expectedMajorVersion), + this); + + QPalette palette = d->clangWarningText->palette(); + palette.setColor(QPalette::WindowText, Qt::red); + d->clangWarningText->setPalette(palette); + + d->clangWarningIcon = new QLabel(this); + d->clangWarningIcon->setPixmap(Utils::Icons::WARNING.icon().pixmap(16, 16)); + + if (LLVM_VERSION_MAJOR == expectedMajorVersion) { + d->clangWarningText->hide(); + d->clangWarningIcon->hide(); + } + FilePath fileName; if (d->project) fileName = d->project->projectFilePath().pathAppended("snippet.cpp"); @@ -110,6 +138,8 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferenc Column { d->fallbackConfig, + Row {d->clangWarningIcon, d->clangWarningText, st}, + d->clangVersion, Row { d->checksScrollArea, d->preview }, }.attachTo(this); From 605e23a3ce35737bd52ed607783266ea19f9495e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 11 Aug 2023 09:14:17 +0200 Subject: [PATCH 0685/1777] McuSupport: Rename some of the KitAspect related classes ... and split out the static interface. Change-Id: I5f9e3ed1e0c75fe26fa843858014070cb6cc0e6f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/mcusupport/mcukitinformation.cpp | 22 ++++++++++---------- src/plugins/mcusupport/mcukitinformation.h | 20 ++++++++++-------- src/plugins/mcusupport/mcusupportplugin.cpp | 2 +- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/plugins/mcusupport/mcukitinformation.cpp b/src/plugins/mcusupport/mcukitinformation.cpp index 924cd7006bb..bf2eb489b3e 100644 --- a/src/plugins/mcusupport/mcukitinformation.cpp +++ b/src/plugins/mcusupport/mcukitinformation.cpp @@ -13,10 +13,10 @@ using namespace ProjectExplorer; namespace { -class McuDependenciesKitAspectWidget final : public KitAspect +class McuDependenciesKitAspectImpl final : public KitAspect { public: - McuDependenciesKitAspectWidget(Kit *workingCopy, const KitAspectFactory *ki) + McuDependenciesKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki) : KitAspect(workingCopy, ki) {} @@ -30,7 +30,7 @@ public: namespace McuSupport { namespace Internal { -McuDependenciesKitAspect::McuDependenciesKitAspect() +McuDependenciesKitAspectFactory::McuDependenciesKitAspectFactory() { setObjectName(QLatin1String("McuDependenciesKitAspect")); setId(McuDependenciesKitAspect::id()); @@ -39,7 +39,7 @@ McuDependenciesKitAspect::McuDependenciesKitAspect() setPriority(28500); } -Tasks McuDependenciesKitAspect::validate(const Kit *kit) const +Tasks McuDependenciesKitAspectFactory::validate(const Kit *kit) const { Tasks result; QTC_ASSERT(kit, return result); @@ -52,8 +52,8 @@ Tasks McuDependenciesKitAspect::validate(const Kit *kit) const return {BuildSystemTask(Task::Error, Tr::tr("The MCU dependencies setting value is invalid."))}; // check paths defined in cmake variables for given dependencies exist - const auto cMakeEntries = Utils::NameValueDictionary(configuration(kit)); - for (const auto &dependency : dependencies(kit)) { + const auto cMakeEntries = Utils::NameValueDictionary(McuDependenciesKitAspect::configuration(kit)); + for (const auto &dependency : McuDependenciesKitAspect::dependencies(kit)) { auto givenPath = Utils::FilePath::fromUserInput(cMakeEntries.value(dependency.name)); if (givenPath.isEmpty()) { result << BuildSystemTask(Task::Warning, @@ -71,7 +71,7 @@ Tasks McuDependenciesKitAspect::validate(const Kit *kit) const return result; } -void McuDependenciesKitAspect::fix(Kit *kit) +void McuDependenciesKitAspectFactory::fix(Kit *kit) { QTC_ASSERT(kit, return ); @@ -79,17 +79,17 @@ void McuDependenciesKitAspect::fix(Kit *kit) if (!variant.isNull() && !variant.canConvert(QVariant::List)) { qWarning("Kit \"%s\" has a wrong mcu dependencies value set.", qPrintable(kit->displayName())); - setDependencies(kit, Utils::NameValueItems()); + McuDependenciesKitAspect::setDependencies(kit, Utils::NameValueItems()); } } -KitAspect *McuDependenciesKitAspect::createKitAspect(Kit *kit) const +KitAspect *McuDependenciesKitAspectFactory::createKitAspect(Kit *kit) const { QTC_ASSERT(kit, return nullptr); - return new McuDependenciesKitAspectWidget(kit, this); + return new McuDependenciesKitAspectImpl(kit, this); } -KitAspectFactory::ItemList McuDependenciesKitAspect::toUserOutput(const Kit *kit) const +KitAspectFactory::ItemList McuDependenciesKitAspectFactory::toUserOutput(const Kit *kit) const { Q_UNUSED(kit) diff --git a/src/plugins/mcusupport/mcukitinformation.h b/src/plugins/mcusupport/mcukitinformation.h index 72429b8db6e..80a18e3c345 100644 --- a/src/plugins/mcusupport/mcukitinformation.h +++ b/src/plugins/mcusupport/mcukitinformation.h @@ -8,12 +8,19 @@ namespace McuSupport { namespace Internal { -class McuDependenciesKitAspect final : public ProjectExplorer::KitAspectFactory +class McuDependenciesKitAspect final { - Q_OBJECT - public: - McuDependenciesKitAspect(); + static Utils::Id id(); + static Utils::NameValueItems dependencies(const ProjectExplorer::Kit *kit); + static void setDependencies(ProjectExplorer::Kit *kit, const Utils::NameValueItems &dependencies); + static Utils::NameValuePairs configuration(const ProjectExplorer::Kit *kit); +}; + +class McuDependenciesKitAspectFactory final : public ProjectExplorer::KitAspectFactory +{ +public: + McuDependenciesKitAspectFactory(); ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *kit) const override; void fix(ProjectExplorer::Kit *kit) override; @@ -21,11 +28,6 @@ public: ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *kit) const override; ItemList toUserOutput(const ProjectExplorer::Kit *kit) const override; - - static Utils::Id id(); - static Utils::NameValueItems dependencies(const ProjectExplorer::Kit *kit); - static void setDependencies(ProjectExplorer::Kit *kit, const Utils::NameValueItems &dependencies); - static Utils::NameValuePairs configuration(const ProjectExplorer::Kit *kit); }; } // namespace Internal diff --git a/src/plugins/mcusupport/mcusupportplugin.cpp b/src/plugins/mcusupport/mcusupportplugin.cpp index 05f457689d8..8c521fb41b0 100644 --- a/src/plugins/mcusupport/mcusupportplugin.cpp +++ b/src/plugins/mcusupport/mcusupportplugin.cpp @@ -102,7 +102,7 @@ public: SettingsHandler::Ptr m_settingsHandler{new SettingsHandler}; McuSupportOptions m_options{m_settingsHandler}; McuSupportOptionsPage optionsPage{m_options, m_settingsHandler}; - McuDependenciesKitAspect environmentPathsKitAspect; + McuDependenciesKitAspectFactory mcuDependenciesKitAspectFactory; MCUBuildStepFactory mcuBuildStepFactory; }; // class McuSupportPluginPrivate From 658db809ef611a0f684ca47490390402ecaeabd9 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 11 Aug 2023 08:57:54 +0200 Subject: [PATCH 0686/1777] ProjectExplorer: Remove Q_OBJECT from KitAspectFactories None of the functionality it provides is actively used. The QObject inheritance itself is left as the factories act as guard objects in some connections. Change-Id: Ia6f2707a3a0a4e2810acdb4dd566afee855468b4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/kitinformation.h | 12 ------------ src/plugins/projectexplorer/kitmanager.h | 2 -- src/plugins/qbsprojectmanager/qbskitinformation.h | 2 -- .../qmakeprojectmanager/qmakekitinformation.h | 2 -- src/plugins/qtsupport/qtkitinformation.h | 2 -- 5 files changed, 20 deletions(-) diff --git a/src/plugins/projectexplorer/kitinformation.h b/src/plugins/projectexplorer/kitinformation.h index 99c99227b9d..3acbcdf05ff 100644 --- a/src/plugins/projectexplorer/kitinformation.h +++ b/src/plugins/projectexplorer/kitinformation.h @@ -32,8 +32,6 @@ public: class PROJECTEXPLORER_EXPORT SysRootKitAspectFactory : public KitAspectFactory { - Q_OBJECT - public: SysRootKitAspectFactory(); @@ -66,8 +64,6 @@ public: class PROJECTEXPLORER_EXPORT ToolChainKitAspectFactory : public KitAspectFactory { - Q_OBJECT - public: ToolChainKitAspectFactory(); @@ -109,8 +105,6 @@ public: class PROJECTEXPLORER_EXPORT DeviceTypeKitAspectFactory : public KitAspectFactory { - Q_OBJECT - public: DeviceTypeKitAspectFactory(); @@ -140,8 +134,6 @@ public: class PROJECTEXPLORER_EXPORT DeviceKitAspectFactory : public KitAspectFactory { - Q_OBJECT - public: DeviceKitAspectFactory(); @@ -182,8 +174,6 @@ public: class PROJECTEXPLORER_EXPORT BuildDeviceKitAspectFactory : public KitAspectFactory { - Q_OBJECT - public: BuildDeviceKitAspectFactory(); @@ -219,8 +209,6 @@ public: class PROJECTEXPLORER_EXPORT EnvironmentKitAspectFactory : public KitAspectFactory { - Q_OBJECT - public: EnvironmentKitAspectFactory(); diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index ced98ef3e14..b10ddf5af62 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -42,8 +42,6 @@ class KitManagerConfigWidget; */ class PROJECTEXPLORER_EXPORT KitAspectFactory : public QObject { - Q_OBJECT - public: using Item = QPair<QString, QString>; using ItemList = QList<Item>; diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.h b/src/plugins/qbsprojectmanager/qbskitinformation.h index f6f846ecb41..34d3537e3b0 100644 --- a/src/plugins/qbsprojectmanager/qbskitinformation.h +++ b/src/plugins/qbsprojectmanager/qbskitinformation.h @@ -20,8 +20,6 @@ public: class QbsKitAspectFactory final : public ProjectExplorer::KitAspectFactory { - Q_OBJECT - public: QbsKitAspectFactory(); diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.h b/src/plugins/qmakeprojectmanager/qmakekitinformation.h index 85592c9ca06..c40e8d01aa5 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.h +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.h @@ -21,8 +21,6 @@ public: class QmakeKitAspectFactory : public ProjectExplorer::KitAspectFactory { - Q_OBJECT - public: QmakeKitAspectFactory(); diff --git a/src/plugins/qtsupport/qtkitinformation.h b/src/plugins/qtsupport/qtkitinformation.h index 2d1a86e88c4..f1f0a0b6a0b 100644 --- a/src/plugins/qtsupport/qtkitinformation.h +++ b/src/plugins/qtsupport/qtkitinformation.h @@ -33,8 +33,6 @@ public: class QTSUPPORT_EXPORT QtKitAspectFactory : public ProjectExplorer::KitAspectFactory { - Q_OBJECT - public: QtKitAspectFactory(); From 8b1047aa8fd1ddf21032baa4fab19f98f4dc2b74 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Wed, 9 Aug 2023 14:09:02 +0200 Subject: [PATCH 0687/1777] DAP: Refactor dap responses handling Change-Id: Iebc16d7e497b4f3a1deec6f52f7b89815c2cde3b Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/dapengine.cpp | 416 +++++++++++++----------- src/plugins/debugger/dap/dapengine.h | 12 +- src/plugins/debugger/debuggerplugin.cpp | 1 - 3 files changed, 231 insertions(+), 198 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index db4ef9da69e..bafd90d5004 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -141,23 +141,10 @@ void DapEngine::shutdownEngine() m_dataGenerator->kill(); } -// From the docs: -// The sequence of events/requests is as follows: -// * adapters sends initialized event (after the initialize request has returned) -// * client sends zero or more setBreakpoints requests -// * client sends one setFunctionBreakpoints request -// (if corresponding capability supportsFunctionBreakpoints is true) -// * client sends a setExceptionBreakpoints request if one or more exceptionBreakpointFilters -// have been defined (or if supportsConfigurationDoneRequest is not true) -// * client sends other future configuration requests -// * client sends one configurationDone request to indicate the end of the configuration. - void DapEngine::handleDapStarted() { QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); -// CHECK_STATE(EngineRunRequested); - postDirectCommand({ {"command", "initialize"}, {"type", "request"}, @@ -174,8 +161,6 @@ void DapEngine::handleDapConfigurationDone() { QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); - // CHECK_STATE(EngineRunRequested); - postDirectCommand({ {"command", "configurationDone"}, {"type", "request"} @@ -402,7 +387,7 @@ void DapEngine::insertBreakpoint(const Breakpoint &bp) }} }); - notifyBreakpointChangeOk(bp); + notifyBreakpointInsertOk(bp); qCDebug(dapEngineLog) << "insertBreakpoint" << bp->modelId() << bp->responseId(); } @@ -662,197 +647,236 @@ void DapEngine::handleOutput(const QJsonDocument &data) const QJsonValue t = ob.value("type"); const QString type = t.toString(); - qCDebug(dapEngineLog) << "response" << ob; + + qCDebug(dapEngineLog) << "dap response" << ob; if (type == "response") { - const QString command = ob.value("command").toString(); - if (command == "configurationDone") { - showMessage("configurationDone", LogDebug); - qCDebug(dapEngineLog) << "configurationDone success"; - notifyEngineRunAndInferiorRunOk(); - return; - } - - if (command == "continue") { - showMessage("continue", LogDebug); - qCDebug(dapEngineLog) << "continue success"; - notifyInferiorRunOk(); - return; - } - - if (command == "stackTrace") { - QJsonArray stackFrames = ob.value("body").toObject().value("stackFrames").toArray(); - if (stackFrames.isEmpty()) - return; - - QJsonObject stackFrame = stackFrames[0].toObject(); - const FilePath file = FilePath::fromString( - stackFrame.value("source").toObject().value("path").toString()); - const int line = stackFrame.value("line").toInt(); - qCDebug(dapEngineLog) << "stackTrace success" << file << line; - gotoLocation(Location(file, line)); - - refreshStack(stackFrames); - dapScopes(stackFrame.value("id").toInt()); - return; - } - - if (command == "scopes") { - if (ob.value("success").toBool()) { - auto scopes = ob.value("body").toObject().value("scopes").toArray(); - for (auto scope : scopes) { - const QString name = scope.toObject().value("name").toString(); - const int variablesReference = scope.toObject().value("variablesReference").toInt(); - qCDebug(dapEngineLog) << "scoped success" << name << variablesReference; - if (name == "Locals") { // Fix for several scopes - m_rootWatchItem = new WatchItem(); - m_currentWatchItem = m_rootWatchItem; - watchHandler()->removeAllData(); - watchHandler()->notifyUpdateStarted(); - dapVariables(variablesReference); - } - } - } - } - - if (command == "variables") { - auto variables = ob.value("body").toObject().value("variables").toArray(); - refreshLocals(variables); - } - - if (command == "stepIn" || command == "stepOut" || command == "next") { - if (ob.value("success").toBool()) { - showMessage(command, LogDebug); - notifyInferiorRunOk(); - } else { - notifyInferiorRunFailed(); - } - return; - } - - if (command == "threads") { - QJsonArray threads = ob.value("body").toObject().value("threads").toArray(); - - if (threads.isEmpty()) - return; - - ThreadsHandler *handler = threadsHandler(); - for (auto thread : threads) { - ThreadData threadData; - threadData.id = QString::number(thread.toObject().value("id").toInt()); - threadData.name = thread.toObject().value("name").toString(); - handler->updateThread(threadData); - } - - if (m_currentThreadId) - handler->setCurrentThread( - threadsHandler()->threadForId(QString::number(m_currentThreadId))); - return; - } + handleResponse(ob); + return; } if (type == "event") { - const QString event = ob.value("event").toString(); - const QJsonObject body = ob.value("body").toObject(); - - if (event == "exited") { - notifyInferiorExited(); - showMessage("exited", LogDebug); - return; - } - - if (event == "output") { - const QString category = body.value("category").toString(); - const QString output = body.value("output").toString(); - if (category == "stdout") - showMessage(output, AppOutput); - else if (category == "stderr") - showMessage(output, AppError); - else - showMessage(output, LogDebug); - return; - } - qCDebug(dapEngineLog) << data; - - if (event == "initialized") { - showMessage(event, LogDebug); - qCDebug(dapEngineLog) << "initialize success"; - handleDapLaunch(); - handleDapConfigurationDone(); - return; - } - - if (event == "stopped") { - m_currentThreadId = body.value("threadId").toInt(); - showMessage(event, LogDebug); - if (body.value("reason").toString() == "breakpoint") { - QString id = QString::number( - body.value("hitBreakpointIds").toArray().first().toInteger()); - - Breakpoint bp = breakHandler()->findBreakpointByResponseId(id); - if (bp) { - const BreakpointParameters ¶ms = bp->requestedParameters(); - gotoLocation(Location(params.fileName, params.textPosition)); - } - } - - if (state() == InferiorStopRequested) - notifyInferiorStopOk(); - else - notifyInferiorSpontaneousStop(); - - dapStackTrace(); - threads(); - return; - } - - if (event == "thread") { - // threads(); // breaks cmake debugging for now - - showMessage(event, LogDebug); - if (body.value("reason").toString() == "started" && body.value("threadId").toInt() == 1) - claimInitialBreakpoints(); - return; - } - - if (event == "breakpoint") { - showMessage(event, LogDebug); - QJsonObject breakpoint = body.value("breakpoint").toObject(); - Breakpoint bp = breakHandler()->findBreakpointByResponseId( - QString::number(breakpoint.value("id").toInt())); - qCDebug(dapEngineLog) << "breakpoint id :" << breakpoint.value("id").toInt(); - - if (body.value("reason").toString() == "new") { - if (breakpoint.value("verified").toBool()) { - notifyBreakpointInsertOk(bp); - qCDebug(dapEngineLog) << "breakpoint inserted"; - } else { - notifyBreakpointInsertFailed(bp); - qCDebug(dapEngineLog) << "breakpoint insertion failed"; - } - return; - } - - if (body.value("reason").toString() == "removed") { - if (breakpoint.value("verified").toBool()) { - notifyBreakpointRemoveOk(bp); - qCDebug(dapEngineLog) << "breakpoint removed"; - } else { - notifyBreakpointRemoveFailed(bp); - qCDebug(dapEngineLog) << "breakpoint remove failed"; - } - return; - } - return; - } - - showMessage("UNKNOWN EVENT:" + event); + handleEvent(ob); return; } showMessage("UNKNOWN TYPE:" + type); } +void DapEngine::handleResponse(const QJsonObject &response) +{ + const QString command = response.value("command").toString(); + + if (command == "configurationDone") { + showMessage("configurationDone", LogDebug); + qCDebug(dapEngineLog) << "configurationDone success"; + notifyEngineRunAndInferiorRunOk(); + return; + } + + if (command == "continue") { + showMessage("continue", LogDebug); + qCDebug(dapEngineLog) << "continue success"; + notifyInferiorRunOk(); + return; + } + + if (command == "stackTrace") { + handleStackTraceResponse(response); + return; + } + + if (command == "scopes") { + handleScopesResponse(response); + return; + } + + if (command == "variables") { + auto variables = response.value("body").toObject().value("variables").toArray(); + refreshLocals(variables); + return; + } + + if (command == "stepIn" || command == "stepOut" || command == "next") { + if (response.value("success").toBool()) { + showMessage(command, LogDebug); + notifyInferiorRunOk(); + } else { + notifyInferiorRunFailed(); + } + return; + } + + if (command == "threads") { + handleThreadsResponse(response); + return; + } + + showMessage("UNKNOWN RESPONSE:" + command); +} + +void DapEngine::handleStackTraceResponse(const QJsonObject &response) +{ + QJsonArray stackFrames = response.value("body").toObject().value("stackFrames").toArray(); + if (stackFrames.isEmpty()) + return; + + QJsonObject stackFrame = stackFrames[0].toObject(); + const FilePath file = FilePath::fromString( + stackFrame.value("source").toObject().value("path").toString()); + const int line = stackFrame.value("line").toInt(); + qCDebug(dapEngineLog) << "stackTrace success" << file << line; + gotoLocation(Location(file, line)); + + refreshStack(stackFrames); + dapScopes(stackFrame.value("id").toInt()); +} + +void DapEngine::handleScopesResponse(const QJsonObject &response) +{ + if (!response.value("success").toBool()) + return; + + QJsonArray scopes = response.value("body").toObject().value("scopes").toArray(); + for (const QJsonValueRef &scope : scopes) { + const QString name = scope.toObject().value("name").toString(); + const int variablesReference = scope.toObject().value("variablesReference").toInt(); + qCDebug(dapEngineLog) << "scoped success" << name << variablesReference; + if (name == "Locals") { // Fix for several scopes + m_rootWatchItem = new WatchItem(); + m_currentWatchItem = m_rootWatchItem; + watchHandler()->removeAllData(); + watchHandler()->notifyUpdateStarted(); + dapVariables(variablesReference); + } + } +} + +void DapEngine::handleThreadsResponse(const QJsonObject &response) +{ + QJsonArray threads = response.value("body").toObject().value("threads").toArray(); + + if (threads.isEmpty()) + return; + + ThreadsHandler *handler = threadsHandler(); + for (const QJsonValueRef &thread : threads) { + ThreadData threadData; + threadData.id = QString::number(thread.toObject().value("id").toInt()); + threadData.name = thread.toObject().value("name").toString(); + handler->updateThread(threadData); + } + + if (m_currentThreadId) + handler->setCurrentThread(threadsHandler()->threadForId(QString::number(m_currentThreadId))); +} + +void DapEngine::handleEvent(const QJsonObject &event) +{ + const QString eventType = event.value("event").toString(); + const QJsonObject body = event.value("body").toObject(); + showMessage(eventType, LogDebug); + + if (eventType == "exited") { + notifyInferiorExited(); + return; + } + + if (eventType == "output") { + const QString category = body.value("category").toString(); + const QString output = body.value("output").toString(); + if (category == "stdout") + showMessage(output, AppOutput); + else if (category == "stderr") + showMessage(output, AppError); + else + showMessage(output, LogDebug); + return; + } + + if (eventType == "initialized") { + qCDebug(dapEngineLog) << "initialize success"; + handleDapLaunch(); + handleDapConfigurationDone(); + return; + } + + if (eventType == "stopped") { + handleStoppedEvent(event); + return; + } + + if (eventType == "thread") { + threads(); + if (body.value("reason").toString() == "started" && body.value("threadId").toInt() == 1) + claimInitialBreakpoints(); + return; + } + + if (eventType == "breakpoint") { + handleBreakpointEvent(event); + return; + } + + showMessage("UNKNOWN EVENT:" + eventType); +} + +void DapEngine::handleStoppedEvent(const QJsonObject &event) +{ + const QJsonObject body = event.value("body").toObject(); + m_currentThreadId = body.value("threadId").toInt(); + + if (body.value("reason").toString() == "breakpoint") { + QString id = QString::number(body.value("hitBreakpointIds").toArray().first().toInteger()); + + Breakpoint bp = breakHandler()->findBreakpointByResponseId(id); + if (bp) { + const BreakpointParameters ¶ms = bp->requestedParameters(); + gotoLocation(Location(params.fileName, params.textPosition)); + } + } + + if (state() == InferiorStopRequested) + notifyInferiorStopOk(); + else + notifyInferiorSpontaneousStop(); + + dapStackTrace(); + threads(); +} + +void DapEngine::handleBreakpointEvent(const QJsonObject &event) +{ + const QJsonObject body = event.value("body").toObject(); + QJsonObject breakpoint = body.value("breakpoint").toObject(); + + Breakpoint bp = breakHandler()->findBreakpointByResponseId( + QString::number(breakpoint.value("id").toInt())); + qCDebug(dapEngineLog) << "breakpoint id :" << breakpoint.value("id").toInt(); + + if (body.value("reason").toString() == "new") { + if (breakpoint.value("verified").toBool()) { + notifyBreakpointInsertOk(bp); + qCDebug(dapEngineLog) << "breakpoint inserted"; + } else { + notifyBreakpointInsertFailed(bp); + qCDebug(dapEngineLog) << "breakpoint insertion failed"; + } + return; + } + + if (body.value("reason").toString() == "removed") { + if (breakpoint.value("verified").toBool()) { + notifyBreakpointRemoveOk(bp); + qCDebug(dapEngineLog) << "breakpoint removed"; + } else { + notifyBreakpointRemoveFailed(bp); + qCDebug(dapEngineLog) << "breakpoint remove failed"; + } + return; + } +} + void DapEngine::refreshLocals(const QJsonArray &variables) { for (auto variable : variables) { diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 1950713f15d..acc36d1182c 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -117,8 +117,18 @@ protected: void handleDapDone(); void readDapStandardOutput(); void readDapStandardError(); + void handleOutput(const QJsonDocument &data); - void handleResponse(const QString &ba); + + void handleResponse(const QJsonObject &response); + void handleStackTraceResponse(const QJsonObject &response); + void handleScopesResponse(const QJsonObject &response); + void handleThreadsResponse(const QJsonObject &response); + + void handleEvent(const QJsonObject &event); + void handleBreakpointEvent(const QJsonObject &event); + void handleStoppedEvent(const QJsonObject &event); + void updateAll() override; void updateLocals() override; void connectDataGeneratorSignals(); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 7d39b9ed725..6e557c4c2b2 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1179,7 +1179,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) m_startCmakeAction.setText(Tr::tr("Start CMake Debugging")); m_startCmakeAction.setEnabled(true); m_startCmakeAction.setIcon(startIcon(true)); - m_startCmakeAction.setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_startCmakeAction.setVisible(true); m_perspectiveCmake->addToolBarAction(&m_startCmakeAction); From 888e7e0c6d55ac959f1e328007240e91d74fafb1 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Wed, 9 Aug 2023 17:08:54 +0200 Subject: [PATCH 0688/1777] DAP: Add select thread support Change-Id: Ib85d7d4413284d5919a2b19016aec503c9cb5fca Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/dapengine.cpp | 9 +++++++++ src/plugins/debugger/dap/dapengine.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index bafd90d5004..a18c1d431b4 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -336,6 +336,9 @@ void DapEngine::activateFrame(int frameIndex) void DapEngine::selectThread(const Thread &thread) { Q_UNUSED(thread) + m_currentThreadId = thread->id().toInt(); + threadsHandler()->setCurrentThread(thread); + updateLocals(); } bool DapEngine::acceptsBreakpoint(const BreakpointParameters &) const @@ -935,6 +938,11 @@ void DapEngine::refreshStack(const QJsonArray &stackFrames) gotoLocation(handler->frameAt(index)); } +void DapEngine::reloadFullStack() +{ + updateAll(); +} + void DapEngine::updateAll() { runCommand({"stackListFrames"}); @@ -943,6 +951,7 @@ void DapEngine::updateAll() void DapEngine::updateLocals() { + dapStackTrace(); } bool DapEngine::hasCapability(unsigned cap) const diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index acc36d1182c..935350e4698 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -85,7 +85,7 @@ protected: void reloadModules() override; void reloadRegisters() override {} void reloadSourceFiles() override {} - void reloadFullStack() override {} + void reloadFullStack() override; bool supportsThreads() const { return true; } void updateItem(const QString &iname) override; From 83d2ee56b70501d0d1277ebbf766cd85e0f62a4f Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Fri, 11 Aug 2023 13:04:41 +0200 Subject: [PATCH 0689/1777] DAP: Add run to line support Note: "Run to line" feature is disabled for CMake. Change-Id: If8dc271fe51c6e5695f2544a71be544c7575bfa9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/cmakedapengine.cpp | 8 +++++++ src/plugins/debugger/dap/cmakedapengine.h | 2 ++ src/plugins/debugger/dap/dapengine.cpp | 23 ++++++++++++++++++--- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp index d43646f408a..0775b05004f 100644 --- a/src/plugins/debugger/dap/cmakedapengine.cpp +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -115,4 +115,12 @@ void CMakeDapEngine::setupEngine() notifyEngineSetupOk(); } +bool CMakeDapEngine::hasCapability(unsigned cap) const +{ + return cap & (ReloadModuleCapability + | BreakConditionCapability + | ShowModuleSymbolsCapability + /*| RunToLineCapability*/); // disable while the #25176 bug is not fixed +} + } // namespace Debugger::Internal diff --git a/src/plugins/debugger/dap/cmakedapengine.h b/src/plugins/debugger/dap/cmakedapengine.h index 59a536fee0c..00b0ac7044d 100644 --- a/src/plugins/debugger/dap/cmakedapengine.h +++ b/src/plugins/debugger/dap/cmakedapengine.h @@ -15,6 +15,8 @@ public: private: void handleDapStarted() override; void setupEngine() override; + + bool hasCapability(unsigned cap) const override; }; } // Debugger::Internal diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index a18c1d431b4..075eb908c36 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -305,8 +305,19 @@ void DapEngine::continueInferior() void DapEngine::executeRunToLine(const ContextData &data) { - Q_UNUSED(data) - QTC_CHECK("FIXME: DapEngine::runToLineExec()" && false); + // Add one-shot breakpoint + BreakpointParameters bp; + bp.oneShot = true; + if (data.address) { + bp.type = BreakpointByAddress; + bp.address = data.address; + } else { + bp.type = BreakpointByFileAndLine; + bp.fileName = data.fileName; + bp.textPosition = data.textPosition; + } + + BreakpointManager::createBreakpointForEngine(bp, this); } void DapEngine::executeRunToFunction(const QString &functionName) @@ -836,6 +847,8 @@ void DapEngine::handleStoppedEvent(const QJsonObject &event) if (bp) { const BreakpointParameters ¶ms = bp->requestedParameters(); gotoLocation(Location(params.fileName, params.textPosition)); + if (params.oneShot) + removeBreakpoint(bp); } } @@ -860,6 +873,9 @@ void DapEngine::handleBreakpointEvent(const QJsonObject &event) if (body.value("reason").toString() == "new") { if (breakpoint.value("verified").toBool()) { notifyBreakpointInsertOk(bp); + const BreakpointParameters ¶ms = bp->requestedParameters(); + if (params.oneShot) + continueInferior(); qCDebug(dapEngineLog) << "breakpoint inserted"; } else { notifyBreakpointInsertFailed(bp); @@ -958,7 +974,8 @@ bool DapEngine::hasCapability(unsigned cap) const { return cap & (ReloadModuleCapability | BreakConditionCapability - | ShowModuleSymbolsCapability); + | ShowModuleSymbolsCapability + | RunToLineCapability); } void DapEngine::claimInitialBreakpoints() From 3ab2da691df5f43b94effc6266c7642df65fdcf0 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 3 Aug 2023 14:39:33 +0200 Subject: [PATCH 0690/1777] DAP: Add check that cmake 3.27 or higher If CMake version is lower then 3.27 - Shows the warning in general message - Starts CMake without debugging - Stops debugging correctly Change-Id: Ibb13555c20ae2961c0a3c2ef6ec0fcc25930dddc Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 6 +++++- src/plugins/debugger/dap/cmakedapengine.cpp | 13 +++++++++++++ src/plugins/debugger/dap/dapengine.cpp | 2 +- src/plugins/debugger/debuggerplugin.cpp | 4 ++-- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index d269c1b607d..8e693ba331c 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -191,11 +191,15 @@ void CMakeBuildSystem::triggerParsing() // active code model updater when the next one will be triggered. m_cppCodeModelUpdater->cancel(); + const CMakeTool *tool = m_parameters.cmakeTool(); + CMakeTool::Version version = tool ? tool->version() : CMakeTool::Version(); + const bool isDebuggable = (version.major == 3 && version.minor >= 27) || version.major > 3; + qCDebug(cmakeBuildSystemLog) << "Asking reader to parse"; m_reader.parse(reparseParameters & REPARSE_FORCE_CMAKE_RUN, reparseParameters & REPARSE_FORCE_INITIAL_CONFIGURATION, reparseParameters & REPARSE_FORCE_EXTRA_CONFIGURATION, - reparseParameters & REPARSE_DEBUG); + (reparseParameters & REPARSE_DEBUG) && isDebuggable); } void CMakeBuildSystem::requestDebugging() diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp index 0775b05004f..d4e766521cf 100644 --- a/src/plugins/debugger/dap/cmakedapengine.cpp +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -3,6 +3,8 @@ #include "cmakedapengine.h" +#include <coreplugin/messagemanager.h> + #include <debugger/debuggermainwindow.h> #include <utils/temporarydirectory.h> @@ -14,6 +16,7 @@ #include <QDebug> #include <QLocalSocket> #include <QLoggingCategory> +#include <QTimer> using namespace Core; using namespace Utils; @@ -112,6 +115,16 @@ void CMakeDapEngine::setupEngine() [this] { m_dataGenerator->start(); }); ProjectExplorer::ProjectTree::currentBuildSystem()->requestDebugging(); + + QTimer::singleShot(5000, this, [this] { + if (!m_dataGenerator->isRunning()) { + m_dataGenerator->kill(); + MessageManager::writeDisrupting( + "CMake server is not running. Please check that your CMake is 3.27 or higher."); + return; + } + }); + notifyEngineSetupOk(); } diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 075eb908c36..be299018d2c 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -41,8 +41,8 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildsystem.h> -#include <projectexplorer/projecttree.h> #include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/projecttree.h> #include <QDateTime> #include <QDebug> diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 6e557c4c2b2..9c313d45d16 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -830,8 +830,8 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) }); connect(&m_startCmakeAction, &QAction::triggered, this, [] { -// ProjectTree::currentBuildSystem()->requestDebugging(); - ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE, true); + ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE, + true); }); connect(&m_debugWithoutDeployAction, &QAction::triggered, this, [] { From 5bce234986201691839928a0e9a3e5b7bfc023af Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 9 Aug 2023 12:40:40 +0200 Subject: [PATCH 0691/1777] Valgrind: Refactor Parser Make it implicitly threaded. Get rid of ThreadedParser. Don't move QTcpSocket instances, received by QTcpServer::nextPendingConnection(), into another thread, as docs says it's not safe. Use wait condition for waiting for new data. Don't potentially leak the Parser in loadXmlLogFile(): store a unique pointer to the running parser. Introduce Parser::setData() method and use it with QFile device in loadXmlLogFile(). Pass QAbstractSocket into the parser instead of QIODevice and get rid of downcasting. The QIODevice couldn't really work with non-socket and non-file devices (like e.g. QProcess), as it lacks general error and finished reporting signals (it has only general readyRead() signal). Change-Id: I9352aec694564d4d2a26898841ed964bed470d82 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/CMakeLists.txt | 1 - src/plugins/valgrind/memchecktool.cpp | 21 +- src/plugins/valgrind/valgrind.qbs | 1 - .../valgrind/valgrindmemcheckparsertest.cpp | 32 +- src/plugins/valgrind/valgrindrunner.cpp | 12 +- src/plugins/valgrind/xmlprotocol/parser.cpp | 569 +++++++++++------- src/plugins/valgrind/xmlprotocol/parser.h | 13 +- .../valgrind/xmlprotocol/threadedparser.cpp | 77 --- .../valgrind/xmlprotocol/threadedparser.h | 50 -- tests/auto/valgrind/memcheck/modeldemo.cpp | 1 - tests/auto/valgrind/valgrind.cmake | 1 - .../testdata/projecttree_creator.tsv | 4 - .../testdata/projecttree_creator.tsv | 6 - 13 files changed, 389 insertions(+), 399 deletions(-) delete mode 100644 src/plugins/valgrind/xmlprotocol/threadedparser.cpp delete mode 100644 src/plugins/valgrind/xmlprotocol/threadedparser.h diff --git a/src/plugins/valgrind/CMakeLists.txt b/src/plugins/valgrind/CMakeLists.txt index df4c430ea00..0142fe61c3a 100644 --- a/src/plugins/valgrind/CMakeLists.txt +++ b/src/plugins/valgrind/CMakeLists.txt @@ -39,7 +39,6 @@ add_qtc_plugin(Valgrind xmlprotocol/stackmodel.cpp xmlprotocol/stackmodel.h xmlprotocol/status.cpp xmlprotocol/status.h xmlprotocol/suppression.cpp xmlprotocol/suppression.h - xmlprotocol/threadedparser.cpp xmlprotocol/threadedparser.h ) extend_qtc_plugin(Valgrind diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 92de06ed6a3..53d256ce806 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -13,8 +13,8 @@ #include "xmlprotocol/error.h" #include "xmlprotocol/errorlistmodel.h" #include "xmlprotocol/frame.h" +#include "xmlprotocol/parser.h" #include "xmlprotocol/stack.h" -#include "xmlprotocol/threadedparser.h" #include <debugger/debuggerkitinformation.h> #include <debugger/debuggerruncontrol.h> @@ -438,6 +438,7 @@ private: QAction *m_goNext; bool m_toolBusy = false; + std::unique_ptr<Parser> m_logParser; QString m_exitMsg; Perspective m_perspective{"Memcheck.Perspective", Tr::tr("Memcheck")}; @@ -1034,9 +1035,8 @@ void MemcheckToolPrivate::loadExternalXmlLogFile() void MemcheckToolPrivate::loadXmlLogFile(const QString &filePath) { - auto logFile = new QFile(filePath); - if (!logFile->open(QIODevice::ReadOnly | QIODevice::Text)) { - delete logFile; + QFile logFile(filePath); + if (!logFile.open(QIODevice::ReadOnly | QIODevice::Text)) { QString msg = Tr::tr("Memcheck: Failed to open file for reading: %1").arg(filePath); TaskHub::addTask(Task::Error, msg, Debugger::Constants::ANALYZERTASK_ID); TaskHub::requestPopup(); @@ -1055,18 +1055,17 @@ void MemcheckToolPrivate::loadXmlLogFile(const QString &filePath) updateFromSettings(); } - auto parser = new ThreadedParser; - connect(parser, &ThreadedParser::error, - this, &MemcheckToolPrivate::parserError); - connect(parser, &ThreadedParser::done, this, [this, parser](bool success, const QString &err) { + m_logParser.reset(new Parser); + connect(m_logParser.get(), &Parser::error, this, &MemcheckToolPrivate::parserError); + connect(m_logParser.get(), &Parser::done, this, [this](bool success, const QString &err) { if (!success) internalParserError(err); loadingExternalXmlLogFileFinished(); - parser->deleteLater(); + m_logParser.release()->deleteLater(); }); - parser->setIODevice(logFile); - parser->start(); + m_logParser->setData(logFile.readAll()); + m_logParser->start(); } void MemcheckToolPrivate::parserError(const Error &error) diff --git a/src/plugins/valgrind/valgrind.qbs b/src/plugins/valgrind/valgrind.qbs index 378f0a57bb8..065006352e3 100644 --- a/src/plugins/valgrind/valgrind.qbs +++ b/src/plugins/valgrind/valgrind.qbs @@ -69,7 +69,6 @@ QtcPlugin { "stackmodel.cpp", "stackmodel.h", "status.cpp", "status.h", "suppression.cpp", "suppression.h", - "threadedparser.cpp", "threadedparser.h", ] } diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp index 5598f7cdb03..f74df7d80d6 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -249,8 +249,8 @@ void ValgrindMemcheckParserTest::testHelgrindSample1() Parser parser; Recorder rec(&parser); - parser.setIODevice(m_socket.release()); - parser.start(); + parser.setSocket(m_socket.release()); + parser.runBlocking(); m_process->waitForFinished(); QCOMPARE(m_process->exitStatus(), QProcess::NormalExit); @@ -258,7 +258,7 @@ void ValgrindMemcheckParserTest::testHelgrindSample1() QVERIFY2(parser.errorString().isEmpty(), qPrintable(parser.errorString())); const QList<Error> actualErrors = rec.errors; - + QVERIFY(!actualErrors.isEmpty()); if (actualErrors.first() != expectedErrors.first()) { dumpError(actualErrors.first()); dumpError(expectedErrors.first()); @@ -324,8 +324,8 @@ void ValgrindMemcheckParserTest::testMemcheckSample1() Parser parser; Recorder rec(&parser); - parser.setIODevice(m_socket.release()); - parser.start(); + parser.setSocket(m_socket.release()); + parser.runBlocking(); m_process->waitForFinished(); QCOMPARE(m_process->exitStatus(), QProcess::NormalExit); @@ -333,7 +333,7 @@ void ValgrindMemcheckParserTest::testMemcheckSample1() QVERIFY2(parser.errorString().isEmpty(), qPrintable(parser.errorString())); const QList<Error> actualErrors = rec.errors; - + QVERIFY(!actualErrors.isEmpty()); if (actualErrors.first() != expectedErrors.first()) { dumpError(actualErrors.first()); dumpError(expectedErrors.first()); @@ -358,8 +358,8 @@ void ValgrindMemcheckParserTest::testMemcheckSample2() Parser parser; Recorder rec(&parser); - parser.setIODevice(m_socket.release()); - parser.start(); + parser.setSocket(m_socket.release()); + parser.runBlocking(); m_process->waitForFinished(); QCOMPARE(m_process->exitStatus(), QProcess::NormalExit); @@ -387,8 +387,8 @@ void ValgrindMemcheckParserTest::testMemcheckSample3() Parser parser; Recorder rec(&parser); - parser.setIODevice(m_socket.release()); - parser.start(); + parser.setSocket(m_socket.release()); + parser.runBlocking(); m_process->waitForFinished(); QCOMPARE(m_process->exitStatus(), QProcess::NormalExit); @@ -443,8 +443,8 @@ void ValgrindMemcheckParserTest::testMemcheckCharm() Parser parser; Recorder rec(&parser); - parser.setIODevice(m_socket.release()); - parser.start(); + parser.setSocket(m_socket.release()); + parser.runBlocking(); m_process->waitForFinished(); QCOMPARE(m_process->exitStatus(), QProcess::NormalExit); @@ -460,8 +460,8 @@ void ValgrindMemcheckParserTest::testValgrindCrash() initTest(dataFile("memcheck-output-sample1.xml"), QStringList("--crash")); Parser parser; - parser.setIODevice(m_socket.release()); - parser.start(); + parser.setSocket(m_socket.release()); + parser.runBlocking(); m_process->waitForFinished(); QCOMPARE(m_process->state(), QProcess::NotRunning); QCOMPARE(m_process->exitStatus(), QProcess::CrashExit); @@ -474,8 +474,8 @@ void ValgrindMemcheckParserTest::testValgrindGarbage() initTest(dataFile("memcheck-output-sample1.xml"), QStringList("--garbage")); Parser parser; - parser.setIODevice(m_socket.release()); - parser.start(); + parser.setSocket(m_socket.release()); + parser.runBlocking(); m_process->waitForFinished(); QCOMPARE(m_process->state(), QProcess::NotRunning); QCOMPARE(m_process->exitStatus(), QProcess::NormalExit); diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index 196fba7d7b0..1447cf1e4d9 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -4,7 +4,7 @@ #include "valgrindrunner.h" #include "valgrindtr.h" -#include "xmlprotocol/threadedparser.h" +#include "xmlprotocol/parser.h" #include <projectexplorer/runcontrol.h> @@ -59,7 +59,7 @@ public: QHostAddress m_localServerAddress; QTcpServer m_xmlServer; - ThreadedParser m_parser; + Parser m_parser; QTcpServer m_logServer; }; @@ -68,7 +68,7 @@ void ValgrindRunner::Private::xmlSocketConnected() QTcpSocket *socket = m_xmlServer.nextPendingConnection(); QTC_ASSERT(socket, return); m_xmlServer.close(); - m_parser.setIODevice(socket); + m_parser.setSocket(socket); m_parser.start(); } @@ -161,9 +161,9 @@ bool ValgrindRunner::Private::run() ValgrindRunner::ValgrindRunner(QObject *parent) : QObject(parent), d(new Private(this)) { - connect(&d->m_parser, &ThreadedParser::status, this, &ValgrindRunner::status); - connect(&d->m_parser, &ThreadedParser::error, this, &ValgrindRunner::error); - connect(&d->m_parser, &ThreadedParser::done, this, [this](bool success, const QString &err) { + connect(&d->m_parser, &Parser::status, this, &ValgrindRunner::status); + connect(&d->m_parser, &Parser::error, this, &ValgrindRunner::error); + connect(&d->m_parser, &Parser::done, this, [this](bool success, const QString &err) { if (!success) emit internalError(err); }); diff --git a/src/plugins/valgrind/xmlprotocol/parser.cpp b/src/plugins/valgrind/xmlprotocol/parser.cpp index 36d0ba24971..6b11ad0a3ca 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.cpp +++ b/src/plugins/valgrind/xmlprotocol/parser.cpp @@ -10,61 +10,51 @@ #include "suppression.h" #include "../valgrindtr.h" +#include <extensionsystem/pluginmanager.h> + +#include <utils/async.h> +#include <utils/expected.h> +#include <utils/futuresynchronizer.h> #include <utils/qtcassert.h> #include <QAbstractSocket> #include <QHash> -#include <QIODevice> #include <QMetaEnum> +#include <QMutex> +#include <QPromise> +#include <QWaitCondition> #include <QXmlStreamReader> -namespace { - - class ParserException - { - public: - explicit ParserException(const QString &message) - : m_message(message) - {} - - ~ParserException() noexcept = default; - - QString message() const { return m_message; } - - private: - QString m_message; - }; - - struct XWhat - { - QString text; - qint64 leakedblocks = 0; - qint64 leakedbytes = 0; - qint64 hthreadid = -1; - }; - - struct XauxWhat - { - void clear() { *this = XauxWhat(); } - - QString text; - QString file; - QString dir; - qint64 line = -1; - qint64 hthreadid = -1; - }; - -} // namespace anon +using namespace Utils; namespace Valgrind::XmlProtocol { -enum class Tool { - Unknown, - Memcheck, - Ptrcheck, - Helgrind +struct ParserException +{ + QString message; }; +struct XWhat +{ + QString text; + qint64 leakedblocks = 0; + qint64 leakedbytes = 0; + qint64 hthreadid = -1; +}; + +struct XauxWhat +{ + void clear() { *this = XauxWhat(); } + + QString text; + QString file; + QString dir; + qint64 line = -1; + qint64 hthreadid = -1; +}; + +enum class Tool { Unknown, Memcheck, Ptrcheck, Helgrind }; + const QHash<QString, Tool> &toolByName() { static const QHash<QString, Tool> theHash { @@ -76,16 +66,78 @@ const QHash<QString, Tool> &toolByName() return theHash; } -class Parser::Private +struct OutputData +{ + std::optional<Status> m_status = {}; + std::optional<Error> m_error = {}; + std::optional<QPair<qint64, qint64>> m_errorCount = {}; + std::optional<QPair<QString, qint64>> m_suppressionCount = {}; + std::optional<AnnounceThread> m_announceThread = {}; + std::optional<QString> m_internalError = {}; +}; + +class ParserThread { public: - explicit Private(Parser *qq); + // Called from the other thread, scheduled from the main thread through the queued + // invocation. + void run(QPromise<OutputData> &promise) { + if (promise.isCanceled()) + return; + m_promise = &promise; + start(); + m_promise = nullptr; + } - void start(); - QString errorString; - std::unique_ptr<QIODevice> m_device; + // Called from the main thread exclusively + void cancel() + { + QMutexLocker locker(&m_mutex); + m_state = State::Canceled; + m_waitCondition.wakeOne(); + } + // Called from the main thread exclusively + void finalize() + { + QMutexLocker locker(&m_mutex); + if (m_state != State::Awaiting) + return; + m_state = State::Finalized; + m_waitCondition.wakeOne(); + } + // Called from the main thread exclusively + void addData(const QByteArray &input) + { + if (input.isEmpty()) + return; + QMutexLocker locker(&m_mutex); + if (m_state != State::Awaiting) + return; + m_inputBuffer.append(input); + m_waitCondition.wakeOne(); + } private: + // Called from the separate thread, exclusively by run(). Checks if the new data already + // came before sleeping with wait condition. If so, it doesn't sleep with wait condition, + // but returns the data collected in meantime. Otherwise, it calls wait() on wait condition. + expected_str<QByteArray> waitForData() + { + QMutexLocker locker(&m_mutex); + while (true) { + if (m_state == State::Canceled) + return make_unexpected(Tr::tr("Parsing canceled")); + if (!m_inputBuffer.isEmpty()) + return std::exchange(m_inputBuffer, {}); + if (m_state == State::Finalized) + return make_unexpected(Tr::tr("Premature end of XML document")); + m_waitCondition.wait(&m_mutex); + } + QTC_CHECK(false); + return {}; + } + + void start(); void parseError(); QList<Frame> parseStack(); Suppression parseSuppression(); @@ -101,27 +153,43 @@ private: XauxWhat parseXauxWhat(); int parseErrorKind(const QString &kind); - void reportInternalError(const QString &errorString); QXmlStreamReader::TokenType blockingReadNext(); bool notAtEnd() const; QString blockingReadElementText(); - Tool tool = Tool::Unknown; - QXmlStreamReader reader; - Parser *const q; -}; + void emitStatus(const Status &status) { m_promise->addResult(OutputData{{status}}); } + void emitError(const Error &error) { m_promise->addResult(OutputData{{}, {error}}); } + void emitErrorCount(qint64 unique, qint64 count) { + m_promise->addResult(OutputData{{}, {}, {{unique, count}}}); + } + void emitSuppressionCount(const QString &name, qint64 count) { + m_promise->addResult(OutputData{{}, {}, {}, {{name, count}}}); + } + void emitAnnounceThread(const AnnounceThread &announceThread) { + m_promise->addResult(OutputData{{}, {}, {}, {}, {announceThread}}); + } + void emitInternalError(const QString &errorString) { + m_promise->addResult(OutputData{{}, {}, {}, {}, {}, {errorString}}); + } -Parser::Private::Private(Parser *qq) - : q(qq) -{ -} + enum class State { Awaiting, Finalized, Canceled }; + + Tool m_tool = Tool::Unknown; // Accessed only from the other thread. + QXmlStreamReader m_reader; // Accessed only from the other thread. + + QMutex m_mutex; + QWaitCondition m_waitCondition; + QPromise<OutputData> *m_promise = nullptr; + State m_state = State::Awaiting; // Accessed from both threads, needs mutex. + QByteArray m_inputBuffer; // Accessed from both threads, needs mutex. +}; static quint64 parseHex(const QString &str, const QString &context) { bool ok; const quint64 v = str.toULongLong(&ok, 16); if (!ok) - throw ParserException(Tr::tr("Could not parse hex number from \"%1\" (%2)").arg(str, context)); + throw ParserException{Tr::tr("Could not parse hex number from \"%1\" (%2)").arg(str, context)}; return v; } @@ -130,74 +198,56 @@ static qint64 parseInt64(const QString &str, const QString &context) bool ok; const quint64 v = str.toLongLong(&ok); if (!ok) - throw ParserException(Tr::tr("Could not parse hex number from \"%1\" (%2)").arg(str, context)); + throw ParserException{Tr::tr("Could not parse hex number from \"%1\" (%2)").arg(str, context)}; return v; } -QXmlStreamReader::TokenType Parser::Private::blockingReadNext() +QXmlStreamReader::TokenType ParserThread::blockingReadNext() { QXmlStreamReader::TokenType token = QXmlStreamReader::Invalid; - - forever { - token = reader.readNext(); - - if (reader.error() == QXmlStreamReader::PrematureEndOfDocumentError) { - if (reader.device()->waitForReadyRead(1000)) { - // let's try again + while (true) { + token = m_reader.readNext(); + if (m_reader.error() == QXmlStreamReader::PrematureEndOfDocumentError) { + const auto data = waitForData(); + if (data) { + m_reader.addData(*data); continue; } else { - // device error, e.g. remote host closed connection, or timeout - // ### we have no way to know if waitForReadyRead() timed out or failed with a real - // error, and sensible heuristics based on QIODevice fail. - // - error strings are translated and in any case not guaranteed to stay the same, - // so we can't use them. - // - errorString().isEmpty() does not work because errorString() is - // "network timeout error" if the waitFor... timed out. - // - isSequential() [for socket] && isOpen() doesn't work because isOpen() - // returns true if the remote host closed the connection. - // ...so we fall back to knowing it might be a QAbstractSocket. - - QIODevice *dev = reader.device(); - auto sock = qobject_cast<const QAbstractSocket *>(dev); - - if (!sock || sock->state() != QAbstractSocket::ConnectedState) - throw ParserException(dev->errorString()); + throw ParserException{data.error()}; } - } else if (reader.hasError()) { - throw ParserException(reader.errorString()); //TODO add line, column? + } else if (m_reader.hasError()) { + throw ParserException{m_reader.errorString()}; //TODO add line, column? break; } else { // read a valid next token break; } } - return token; } -bool Parser::Private::notAtEnd() const +bool ParserThread::notAtEnd() const { - return !reader.atEnd() - || reader.error() == QXmlStreamReader::PrematureEndOfDocumentError; + return !m_reader.atEnd() || m_reader.error() == QXmlStreamReader::PrematureEndOfDocumentError; } -QString Parser::Private::blockingReadElementText() +QString ParserThread::blockingReadElementText() { //analogous to QXmlStreamReader::readElementText(), but blocking. readElementText() doesn't recover from PrematureEndOfData, //but always returns a null string if isStartElement() is false (which is the case if it already parts of the text) //affects at least Qt <= 4.7.1. Reported as QTBUG-14661. - if (!reader.isStartElement()) - throw ParserException(Tr::tr("trying to read element text although current position is not start of element")); + if (!m_reader.isStartElement()) + throw ParserException{Tr::tr("Trying to read element text although current position is not start of element")}; QString result; - forever { + while (true) { const QXmlStreamReader::TokenType type = blockingReadNext(); switch (type) { case QXmlStreamReader::Characters: case QXmlStreamReader::EntityReference: - result += reader.text(); + result += m_reader.text(); break; case QXmlStreamReader::EndElement: return result; @@ -205,43 +255,42 @@ QString Parser::Private::blockingReadElementText() case QXmlStreamReader::Comment: break; case QXmlStreamReader::StartElement: - throw ParserException(Tr::tr("Unexpected child element while reading element text")); + throw ParserException{Tr::tr("Unexpected child element while reading element text")}; default: //TODO handle - throw ParserException(Tr::tr("Unexpected token type %1").arg(type)); + throw ParserException{Tr::tr("Unexpected token type %1").arg(type)}; break; } } - return QString(); + return {}; } -void Parser::Private::checkProtocolVersion(const QString &versionStr) +void ParserThread::checkProtocolVersion(const QString &versionStr) { bool ok; const int version = versionStr.toInt(&ok); if (!ok) - throw ParserException(Tr::tr("Could not parse protocol version from \"%1\"").arg(versionStr)); + throw ParserException{Tr::tr("Could not parse protocol version from \"%1\"").arg(versionStr)}; if (version != 4) - throw ParserException(Tr::tr("XmlProtocol version %1 not supported (supported version: 4)").arg(version)); + throw ParserException{Tr::tr("XmlProtocol version %1 not supported (supported version: 4)").arg(version)}; } -void Parser::Private::checkTool(const QString &reportedStr) +void ParserThread::checkTool(const QString &reportedStr) { const auto reported = toolByName().constFind(reportedStr); if (reported == toolByName().constEnd()) - throw ParserException(Tr::tr("Valgrind tool \"%1\" not supported").arg(reportedStr)); - - tool = reported.value(); + throw ParserException{Tr::tr("Valgrind tool \"%1\" not supported").arg(reportedStr)}; + m_tool = reported.value(); } -XWhat Parser::Private::parseXWhat() +XWhat ParserThread::parseXWhat() { XWhat what; while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - const auto name = reader.name(); + const auto name = m_reader.name(); if (name == QLatin1String("text")) what.text = blockingReadElementText(); else if (name == QLatin1String("leakedbytes")) @@ -250,20 +299,20 @@ XWhat Parser::Private::parseXWhat() what.leakedblocks = parseInt64(blockingReadElementText(), "error/xwhat[memcheck]/leakedblocks"); else if (name == QLatin1String("hthreadid")) what.hthreadid = parseInt64(blockingReadElementText(), "error/xwhat[memcheck]/hthreadid"); - else if (reader.isStartElement()) - reader.skipCurrentElement(); + else if (m_reader.isStartElement()) + m_reader.skipCurrentElement(); } return what; } -XauxWhat Parser::Private::parseXauxWhat() +XauxWhat ParserThread::parseXauxWhat() { XauxWhat what; while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - const auto name = reader.name(); + const auto name = m_reader.name(); if (name == QLatin1String("text")) what.text = blockingReadElementText(); else if (name == QLatin1String("file")) @@ -274,8 +323,8 @@ XauxWhat Parser::Private::parseXauxWhat() what.line = parseInt64(blockingReadElementText(), "error/xauxwhat/line"); else if (name == QLatin1String("hthreadid")) what.hthreadid = parseInt64(blockingReadElementText(), "error/xauxwhat/hthreadid"); - else if (reader.isStartElement()) - reader.skipCurrentElement(); + else if (m_reader.isStartElement()) + m_reader.skipCurrentElement(); } return what; } @@ -287,13 +336,13 @@ int parseErrorEnum(const QString &kind) const int value = metaEnum.keyToValue(kind.toUtf8()); if (value >= 0) return value; - throw ParserException(Tr::tr("Unknown %1 kind \"%2\"") - .arg(QString::fromUtf8(metaEnum.enumName()), kind)); + throw ParserException{Tr::tr("Unknown %1 kind \"%2\"") + .arg(QString::fromUtf8(metaEnum.enumName()), kind)}; } -int Parser::Private::parseErrorKind(const QString &kind) +int ParserThread::parseErrorKind(const QString &kind) { - switch (tool) { + switch (m_tool) { case Tool::Memcheck: return parseErrorEnum<MemcheckError>(kind); case Tool::Ptrcheck: @@ -304,7 +353,7 @@ int Parser::Private::parseErrorKind(const QString &kind) default: break; } - throw ParserException(Tr::tr("Could not parse error kind, tool not yet set.")); + throw ParserException{Tr::tr("Could not parse error kind, tool not yet set.")}; } static Status::State parseState(const QString &state) @@ -313,7 +362,7 @@ static Status::State parseState(const QString &state) return Status::Running; if (state == "FINISHED") return Status::Finished; - throw ParserException(Tr::tr("Unknown state \"%1\"").arg(state)); + throw ParserException{Tr::tr("Unknown state \"%1\"").arg(state)}; } static Stack makeStack(const XauxWhat &xauxwhat, const QList<Frame> &frames) @@ -328,21 +377,20 @@ static Stack makeStack(const XauxWhat &xauxwhat, const QList<Frame> &frames) return s; } -void Parser::Private::parseError() +void ParserThread::parseError() { Error e; QList<QList<Frame>> frames; XauxWhat currentAux; QList<XauxWhat> auxs; - int lastAuxWhat = -1; while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - if (reader.isStartElement()) + if (m_reader.isStartElement()) lastAuxWhat++; - const auto name = reader.name(); + const auto name = m_reader.name(); if (name == QLatin1String("unique")) { e.setUnique(parseHex(blockingReadElementText(), "unique")); } else if (name == QLatin1String("tid")) { @@ -379,8 +427,8 @@ void Parser::Private::parseError() lastAuxWhat = 0; } else if (name == QLatin1String("stack")) { frames.push_back(parseStack()); - } else if (reader.isStartElement()) { - reader.skipCurrentElement(); + } else if (m_reader.isStartElement()) { + m_reader.skipCurrentElement(); } } @@ -401,19 +449,18 @@ void Parser::Private::parseError() stacks.append(makeStack(auxs[i], frames[i])); e.setStacks(stacks); - emit q->error(e); + emitError(e); } -Frame Parser::Private::parseFrame() +Frame ParserThread::parseFrame() { Frame frame; - while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - if (reader.isStartElement()) { - const auto name = reader.name(); + if (m_reader.isStartElement()) { + const auto name = m_reader.name(); if (name == QLatin1String("ip")) frame.setInstructionPointer(parseHex(blockingReadElementText(), "error/frame/ip")); else if (name == QLatin1String("obj")) @@ -426,169 +473,160 @@ Frame Parser::Private::parseFrame() frame.setFileName(blockingReadElementText()); else if (name == QLatin1String("line")) frame.setLine(parseInt64(blockingReadElementText(), "error/frame/line")); - else if (reader.isStartElement()) - reader.skipCurrentElement(); + else if (m_reader.isStartElement()) + m_reader.skipCurrentElement(); } } - return frame; } -void Parser::Private::parseAnnounceThread() +void ParserThread::parseAnnounceThread() { AnnounceThread at; - while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - if (reader.isStartElement()) { - const auto name = reader.name(); + if (m_reader.isStartElement()) { + const auto name = m_reader.name(); if (name == QLatin1String("hthreadid")) at.setHelgrindThreadId(parseInt64(blockingReadElementText(), "announcethread/hthreadid")); else if (name == QLatin1String("stack")) at.setStack(parseStack()); - else if (reader.isStartElement()) - reader.skipCurrentElement(); + else if (m_reader.isStartElement()) + m_reader.skipCurrentElement(); } } - - emit q->announceThread(at); + emitAnnounceThread(at); } -void Parser::Private::parseErrorCounts() +void ParserThread::parseErrorCounts() { while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - if (reader.isStartElement()) { - if (reader.name() == QLatin1String("pair")) { + if (m_reader.isStartElement()) { + if (m_reader.name() == QLatin1String("pair")) { qint64 unique = 0; qint64 count = 0; while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - if (reader.isStartElement()) { - const auto name = reader.name(); + if (m_reader.isStartElement()) { + const auto name = m_reader.name(); if (name == QLatin1String("unique")) unique = parseHex(blockingReadElementText(), "errorcounts/pair/unique"); else if (name == QLatin1String("count")) count = parseInt64(blockingReadElementText(), "errorcounts/pair/count"); - else if (reader.isStartElement()) - reader.skipCurrentElement(); + else if (m_reader.isStartElement()) + m_reader.skipCurrentElement(); } } - emit q->errorCount(unique, count); - } else if (reader.isStartElement()) - reader.skipCurrentElement(); + emitErrorCount(unique, count); + } else if (m_reader.isStartElement()) + m_reader.skipCurrentElement(); } } } - -void Parser::Private::parseSuppressionCounts() +void ParserThread::parseSuppressionCounts() { while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - if (reader.isStartElement()) { - if (reader.name() == QLatin1String("pair")) { + if (m_reader.isStartElement()) { + if (m_reader.name() == QLatin1String("pair")) { QString pairName; qint64 count = 0; while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - if (reader.isStartElement()) { - const auto name = reader.name(); + if (m_reader.isStartElement()) { + const auto name = m_reader.name(); if (name == QLatin1String("name")) pairName = blockingReadElementText(); else if (name == QLatin1String("count")) count = parseInt64(blockingReadElementText(), "suppcounts/pair/count"); - else if (reader.isStartElement()) - reader.skipCurrentElement(); + else if (m_reader.isStartElement()) + m_reader.skipCurrentElement(); } } - emit q->suppressionCount(pairName, count); - } else if (reader.isStartElement()) - reader.skipCurrentElement(); + emitSuppressionCount(pairName, count); + } else if (m_reader.isStartElement()) + m_reader.skipCurrentElement(); } } } -void Parser::Private::parseStatus() +void ParserThread::parseStatus() { Status s; - while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - if (reader.isStartElement()) { - const auto name = reader.name(); + if (m_reader.isStartElement()) { + const auto name = m_reader.name(); if (name == QLatin1String("state")) s.setState(parseState(blockingReadElementText())); else if (name == QLatin1String("time")) s.setTime(blockingReadElementText()); - else if (reader.isStartElement()) - reader.skipCurrentElement(); + else if (m_reader.isStartElement()) + m_reader.skipCurrentElement(); } } - - emit q->status(s); + emitStatus(s); } -QList<Frame> Parser::Private::parseStack() +QList<Frame> ParserThread::parseStack() { QList<Frame> frames; while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - if (reader.isStartElement()) { - if (reader.name() == QLatin1String("frame")) + if (m_reader.isStartElement()) { + if (m_reader.name() == QLatin1String("frame")) frames.append(parseFrame()); } } - return frames; } -SuppressionFrame Parser::Private::parseSuppressionFrame() +SuppressionFrame ParserThread::parseSuppressionFrame() { SuppressionFrame frame; - while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - if (reader.isStartElement()) { - const auto name = reader.name(); + if (m_reader.isStartElement()) { + const auto name = m_reader.name(); if (name == QLatin1String("obj")) frame.setObject(blockingReadElementText()); else if (name == QLatin1String("fun")) frame.setFunction( blockingReadElementText()); - else if (reader.isStartElement()) - reader.skipCurrentElement(); + else if (m_reader.isStartElement()) + m_reader.skipCurrentElement(); } } - return frame; } -Suppression Parser::Private::parseSuppression() +Suppression ParserThread::parseSuppression() { Suppression supp; SuppressionFrames frames; while (notAtEnd()) { blockingReadNext(); - if (reader.isEndElement()) + if (m_reader.isEndElement()) break; - if (reader.isStartElement()) { - const auto name = reader.name(); + if (m_reader.isStartElement()) { + const auto name = m_reader.name(); if (name == QLatin1String("sname")) supp.setName(blockingReadElementText()); else if (name == QLatin1String("skind")) @@ -601,21 +639,16 @@ Suppression Parser::Private::parseSuppression() frames.push_back(parseSuppressionFrame()); } } - supp.setFrames(frames); return supp; } -void Parser::Private::start() +void ParserThread::start() { - reader.setDevice(m_device.get()); - errorString.clear(); - - bool success = true; try { while (notAtEnd()) { blockingReadNext(); - const auto name = reader.name(); + const auto name = m_reader.name(); if (name == QLatin1String("error")) parseError(); else if (name == QLatin1String("announcethread")) @@ -632,42 +665,136 @@ void Parser::Private::start() checkTool(blockingReadElementText()); } } catch (const ParserException &e) { - errorString = e.message(); - success = false; + emitInternalError(e.message); } catch (...) { - errorString = Tr::tr("Unexpected exception caught during parsing."); - success = false; + emitInternalError(Tr::tr("Unexpected exception caught during parsing.")); } - emit q->done(success, errorString); } +class ParserPrivate +{ +public: + ParserPrivate(Parser *parser) + : q(parser) + {} + + ~ParserPrivate() + { + if (!m_watcher) + return; + m_thread->cancel(); + ExtensionSystem::PluginManager::futureSynchronizer()->addFuture(m_watcher->future()); + } + + void start() + { + QTC_ASSERT(!m_watcher, return); + QTC_ASSERT(m_socket || !m_data.isEmpty(), return); + + m_errorString = {}; + m_thread.reset(new ParserThread); + m_watcher.reset(new QFutureWatcher<OutputData>); + QObject::connect(m_watcher.get(), &QFutureWatcherBase::resultReadyAt, q, [this](int index) { + const OutputData data = m_watcher->resultAt(index); + if (data.m_status) + emit q->status(*data.m_status); + if (data.m_error) + emit q->error(*data.m_error); + if (data.m_errorCount) + emit q->errorCount(data.m_errorCount->first, data.m_errorCount->second); + if (data.m_suppressionCount) + emit q->suppressionCount(data.m_suppressionCount->first, data.m_suppressionCount->second); + if (data.m_announceThread) + emit q->announceThread(*data.m_announceThread); + if (data.m_internalError) + m_errorString = data.m_internalError; + }); + QObject::connect(m_watcher.get(), &QFutureWatcherBase::finished, q, [this] { + emit q->done(!m_errorString, *m_errorString); + m_watcher.release()->deleteLater(); + m_thread.reset(); + m_socket.reset(); + }); + if (m_socket) { + QObject::connect(m_socket.get(), &QIODevice::readyRead, q, [this] { + if (m_thread) + m_thread->addData(m_socket->readAll()); + }); + QObject::connect(m_socket.get(), &QAbstractSocket::disconnected, q, [this] { + if (m_thread) + m_thread->finalize(); + }); + m_thread->addData(m_socket->readAll()); + } else { + m_thread->addData(m_data); + m_thread->finalize(); + } + auto parse = [](QPromise<OutputData> &promise, const std::shared_ptr<ParserThread> &thread) { + thread->run(promise); + }; + m_watcher->setFuture(Utils::asyncRun(parse, m_thread)); + } + + Parser *q = nullptr; + + QByteArray m_data; + std::unique_ptr<QAbstractSocket> m_socket; + std::unique_ptr<QFutureWatcher<OutputData>> m_watcher; + std::shared_ptr<ParserThread> m_thread; + std::optional<QString> m_errorString; +}; + Parser::Parser(QObject *parent) : QObject(parent) - , d(new Private(this)) -{ -} + , d(new ParserPrivate(this)) +{} -Parser::~Parser() -{ - delete d; -} +Parser::~Parser() = default; QString Parser::errorString() const { - return d->errorString; + return d->m_errorString.value_or(QString()); } -void Parser::setIODevice(QIODevice *device) +void Parser::setSocket(QAbstractSocket *socket) { - QTC_ASSERT(device, return); - QTC_ASSERT(device->isOpen(), return); - d->m_device.reset(device); + QTC_ASSERT(socket, return); + QTC_ASSERT(socket->isOpen(), return); + QTC_ASSERT(!isRunning(), return); + d->m_socket.reset(socket); +} + +void Parser::setData(const QByteArray &data) +{ + QTC_ASSERT(!isRunning(), return); + d->m_data = data; } void Parser::start() { - QTC_ASSERT(d->m_device, return); d->start(); } +bool Parser::isRunning() const +{ + return d->m_watcher.get(); +} + +bool Parser::runBlocking() +{ + bool ok = false; + QEventLoop loop; + + const auto finalize = [&loop, &ok](bool success) { + ok = success; + // Refer to the QObject::deleteLater() docs. + QMetaObject::invokeMethod(&loop, [&loop] { loop.quit(); }, Qt::QueuedConnection); + }; + + connect(this, &Parser::done, &loop, finalize); + QTimer::singleShot(0, this, &Parser::start); + loop.exec(QEventLoop::ExcludeUserInputEvents); + return ok; +} + } // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/parser.h b/src/plugins/valgrind/xmlprotocol/parser.h index 21f7e5957bc..dcf435f9675 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.h +++ b/src/plugins/valgrind/xmlprotocol/parser.h @@ -6,13 +6,14 @@ #include <QObject> QT_BEGIN_NAMESPACE -class QIODevice; +class QAbstractSocket; QT_END_NAMESPACE namespace Valgrind::XmlProtocol { class AnnounceThread; class Error; +class ParserPrivate; class Status; /** @@ -28,8 +29,13 @@ public: QString errorString() const; // The passed device needs to be open. The parser takes ownership of the passed device. - void setIODevice(QIODevice *device); + void setSocket(QAbstractSocket *socket); + // Alternatively, the data to be parsed may be set manually + void setData(const QByteArray &data); + void start(); + bool isRunning() const; + bool runBlocking(); signals: void status(const Status &status); @@ -40,8 +46,7 @@ signals: void done(bool success, const QString &errorString); private: - class Private; - Private *const d; + std::unique_ptr<ParserPrivate> d; }; } // Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp deleted file mode 100644 index 8b9ef43d905..00000000000 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "threadedparser.h" - -#include "error.h" -#include "parser.h" -#include "status.h" - -#include <utils/qtcassert.h> - -#include <QIODevice> -#include <QMetaType> -#include <QThread> - -namespace Valgrind::XmlProtocol { - -class Thread : public QThread -{ -public: - void run() override - { - QTC_ASSERT(QThread::currentThread() == this, return); - m_parser->start(); - delete m_parser; - m_parser = nullptr; - } - - Parser *m_parser = nullptr; -}; - -ThreadedParser::ThreadedParser(QObject *parent) - : QObject(parent) -{} - -ThreadedParser::~ThreadedParser() = default; - -bool ThreadedParser::isRunning() const -{ - return m_parserThread ? m_parserThread->isRunning() : false; -} - -void ThreadedParser::setIODevice(QIODevice *device) -{ - QTC_ASSERT(device, return); - QTC_ASSERT(device->isOpen(), return); - m_device.reset(device); -} - -void ThreadedParser::start() -{ - QTC_ASSERT(!m_parserThread, return); - QTC_ASSERT(m_device, return); - - auto parser = new Parser; - qRegisterMetaType<Status>(); - qRegisterMetaType<Error>(); - connect(parser, &Parser::status, this, &ThreadedParser::status, Qt::QueuedConnection); - connect(parser, &Parser::error, this, &ThreadedParser::error, Qt::QueuedConnection); - connect(parser, &Parser::done, this, &ThreadedParser::done, Qt::QueuedConnection); - - m_parserThread = new Thread; - connect(m_parserThread.get(), &QThread::finished, m_parserThread.get(), &QObject::deleteLater); - m_device->setParent(nullptr); - m_device->moveToThread(m_parserThread); - parser->setIODevice(m_device.release()); - parser->moveToThread(m_parserThread); - m_parserThread->m_parser = parser; - m_parserThread->start(); -} - -bool ThreadedParser::waitForFinished() -{ - return m_parserThread ? m_parserThread->wait() : true; -} - -} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.h b/src/plugins/valgrind/xmlprotocol/threadedparser.h deleted file mode 100644 index 3380d0d3438..00000000000 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <QObject> -#include <QPointer> - -QT_BEGIN_NAMESPACE -class QIODevice; -QT_END_NAMESPACE - -namespace Valgrind::XmlProtocol { - -class Error; -class Status; -class Thread; - -/** - * ThreadedParser for the Valgrind Output XmlProtocol 4 - */ -class ThreadedParser : public QObject -{ - Q_OBJECT - -public: - explicit ThreadedParser(QObject *parent = nullptr); - ~ThreadedParser(); - - /// interface additions relative to Parser because Parser is synchronous and this - /// class parses asynchronously in a non-public secondary thread. - bool waitForFinished(); - bool isRunning() const; - - // The passed device needs to be open. The parser takes ownership of the passed device. - void setIODevice(QIODevice *device); - ///@warning will move @p stream to a different thread and take ownership of it - void start(); - -signals: - void status(const Status &status); - void error(const Error &error); - void done(bool success, const QString &errorString); - -private: - std::unique_ptr<QIODevice> m_device; - QPointer<Thread> m_parserThread; -}; - -} // Valgrind::XmlProtocol diff --git a/tests/auto/valgrind/memcheck/modeldemo.cpp b/tests/auto/valgrind/memcheck/modeldemo.cpp index 493e9820c42..c7c3f4fc962 100644 --- a/tests/auto/valgrind/memcheck/modeldemo.cpp +++ b/tests/auto/valgrind/memcheck/modeldemo.cpp @@ -9,7 +9,6 @@ #include <valgrind/xmlprotocol/parser.h> #include <valgrind/xmlprotocol/stack.h> #include <valgrind/xmlprotocol/status.h> -#include <valgrind/xmlprotocol/threadedparser.h> #include "modeldemo.h" diff --git a/tests/auto/valgrind/valgrind.cmake b/tests/auto/valgrind/valgrind.cmake index 945e86fe09a..11c9abfd21d 100644 --- a/tests/auto/valgrind/valgrind.cmake +++ b/tests/auto/valgrind/valgrind.cmake @@ -24,6 +24,5 @@ function(extend_valgrind_test targetName) xmlprotocol/stackmodel.h xmlprotocol/stackmodel.cpp xmlprotocol/status.h xmlprotocol/status.cpp xmlprotocol/suppression.h xmlprotocol/suppression.cpp - xmlprotocol/threadedparser.h xmlprotocol/threadedparser.cpp ) endfunction() diff --git a/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv b/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv index b9eb11f57d5..38d08efa6c1 100644 --- a/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv +++ b/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv @@ -12748,8 +12748,6 @@ "status.h" "4" "suppression.cpp" "4" "suppression.h" "4" -"threadedparser.cpp" "4" -"threadedparser.h" "4" "VcsBase" "2" "vcsbase.qbs:3" "3" "PluginMetaData" "3" @@ -14819,8 +14817,6 @@ "status.h" "6" "suppression.cpp" "6" "suppression.h" "6" -"threadedparser.cpp" "6" -"threadedparser.h" "6" "callgrindparsertests.cpp" "5" "callgrindparsertests.h" "5" "QtcManualtests" "1" diff --git a/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv b/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv index adf91e771ab..6c5372af0a2 100644 --- a/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv +++ b/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv @@ -15810,7 +15810,6 @@ "stackmodel.h" "5" "status.h" "5" "suppression.h" "5" -"threadedparser.h" "5" "Sources" "4" "announcethread.cpp" "5" "error.cpp" "5" @@ -15821,7 +15820,6 @@ "stackmodel.cpp" "5" "status.cpp" "5" "suppression.cpp" "5" -"threadedparser.cpp" "5" "Headers" "3" "callgrindcostdelegate.h" "4" "callgrindcostview.h" "4" @@ -20148,7 +20146,6 @@ "stackmodel.h" "8" "status.h" "8" "suppression.h" "8" -"threadedparser.h" "8" "valgrindrunner.h" "7" "Sources" "6" "callgrind" "7" @@ -20174,7 +20171,6 @@ "stackmodel.cpp" "8" "status.cpp" "8" "suppression.cpp" "8" -"threadedparser.cpp" "8" "valgrindrunner.cpp" "7" "Headers" "5" "callgrindparsertests.h" "6" @@ -20259,7 +20255,6 @@ "stackmodel.h" "8" "status.h" "8" "suppression.h" "8" -"threadedparser.h" "8" "valgrindrunner.h" "7" "Sources" "6" "callgrind" "7" @@ -20285,7 +20280,6 @@ "stackmodel.cpp" "8" "status.cpp" "8" "suppression.cpp" "8" -"threadedparser.cpp" "8" "valgrindrunner.cpp" "7" "Headers" "5" "modeldemo.h" "6" From 1748ce68221257f2ec17a837e747278a61e2efcf Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 14 Aug 2023 12:48:44 +0200 Subject: [PATCH 0692/1777] Utils: Reduce default indent for navigation tree levels Further, from 90% to 70%. Change-Id: Ief5407933a43b1fcdf906e431221dc664ae78d28 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/navigationtreeview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/navigationtreeview.cpp b/src/libs/utils/navigationtreeview.cpp index 7a6bd4be234..b19935f1689 100644 --- a/src/libs/utils/navigationtreeview.cpp +++ b/src/libs/utils/navigationtreeview.cpp @@ -24,7 +24,7 @@ NavigationTreeView::NavigationTreeView(QWidget *parent) : TreeView(parent) { setFrameStyle(QFrame::NoFrame); - setIndentation(indentation() * 9/10); + setIndentation(indentation() * 7/10); setUniformRowHeights(true); setTextElideMode(Qt::ElideNone); setAttribute(Qt::WA_MacShowFocusRect, false); From 576769e54c2b291e3c5f379264d157eae84e9209 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 11 Aug 2023 18:33:18 +0200 Subject: [PATCH 0693/1777] ProjectExplorer: Fully pimpl TargetSetupPage Just re-organization relate to, but not a fix for the linked issue. Task-number: QTCREATORBUG-29494 Change-Id: I0c5413b2dc97738a03b737e764194c4d90d3f086 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../projectexplorer/targetsetuppage.cpp | 343 +++++++++++------- src/plugins/projectexplorer/targetsetuppage.h | 69 +--- 2 files changed, 208 insertions(+), 204 deletions(-) diff --git a/src/plugins/projectexplorer/targetsetuppage.cpp b/src/plugins/projectexplorer/targetsetuppage.cpp index fd1e8a78c64..573fcad099a 100644 --- a/src/plugins/projectexplorer/targetsetuppage.cpp +++ b/src/plugins/projectexplorer/targetsetuppage.cpp @@ -11,6 +11,7 @@ #include "project.h" #include "projectexplorerconstants.h" #include "projectexplorertr.h" +#include "projectimporter.h" #include "target.h" #include "targetsetupwidget.h" #include "task.h" @@ -58,19 +59,30 @@ static FilePath importDirectory(const FilePath &projectPath) return path; } -class TargetSetupPageUi +static TasksGenerator defaultTasksGenerator(const TasksGenerator &childGenerator) +{ + return [childGenerator](const Kit *k) -> Tasks { + if (!k->isValid()) + return {CompileTask(Task::Error, Tr::tr("Kit is not valid."))}; + if (childGenerator) + return childGenerator(k); + return {}; + }; +} + +class TargetSetupPagePrivate : public QObject { public: - QWidget *centralWidget; - QWidget *scrollAreaWidget; - QScrollArea *scrollArea; - QLabel *headerLabel; - QLabel *noValidKitLabel; - QCheckBox *allKitsCheckBox; - FancyLineEdit *kitFilterLineEdit; - - void setupUi(TargetSetupPage *q) + explicit TargetSetupPagePrivate(TargetSetupPage *parent) + : q(parent) { + m_tasksGenerator = defaultTasksGenerator({}); + + m_importWidget = new ImportWidget(q); + m_importWidget->setVisible(false); + + m_spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); + auto setupTargetPage = new QWidget(q); headerLabel = new QLabel(setupTargetPage); @@ -95,12 +107,12 @@ public: kitFilterLineEdit->setFiltering(true); kitFilterLineEdit->setPlaceholderText(Tr::tr("Type to filter kits by name...")); - centralWidget = new QWidget(setupTargetPage); + m_centralWidget = new QWidget(setupTargetPage); QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Fixed); policy.setHorizontalStretch(0); policy.setVerticalStretch(0); - policy.setHeightForWidth(centralWidget->sizePolicy().hasHeightForWidth()); - centralWidget->setSizePolicy(policy); + policy.setHeightForWidth(m_centralWidget->sizePolicy().hasHeightForWidth()); + m_centralWidget->setSizePolicy(policy); scrollAreaWidget = new QWidget(setupTargetPage); scrollArea = new QScrollArea(scrollAreaWidget); @@ -124,13 +136,20 @@ public: verticalLayout_2->addWidget(headerLabel); verticalLayout_2->addLayout(horizontalLayout); verticalLayout_2->addWidget(noValidKitLabel); - verticalLayout_2->addWidget(centralWidget); + verticalLayout_2->addWidget(m_centralWidget); verticalLayout_2->addWidget(scrollAreaWidget); auto verticalLayout_3 = new QVBoxLayout(q); verticalLayout_3->setContentsMargins(0, 0, 0, -1); verticalLayout_3->addWidget(setupTargetPage); + auto centralWidget = new QWidget(q); + scrollArea->setWidget(centralWidget); + centralWidget->setLayout(new QVBoxLayout); + + m_centralWidget->setLayout(new QVBoxLayout); + m_centralWidget->layout()->setContentsMargins(0, 0, 0, 0); + QObject::connect(noValidKitLabel, &QLabel::linkActivated, q, &TargetSetupPage::openOptions); @@ -138,91 +157,128 @@ public: q, &TargetSetupPage::changeAllKitsSelections); QObject::connect(kitFilterLineEdit, &FancyLineEdit::filterChanged, - q, &TargetSetupPage::kitFilterChanged); + this, &TargetSetupPagePrivate::kitFilterChanged); + + for (IPotentialKit *pk : std::as_const(g_potentialKits)) { + if (pk->isEnabled()) + m_potentialWidgets.append(pk->createWidget(q)); + } + + setUseScrollArea(true); + + KitManager *km = KitManager::instance(); + // do note that those slots are triggered once *per* targetsetuppage + // thus the same slot can be triggered multiple times on different instances! + connect(km, &KitManager::kitAdded, this, &TargetSetupPagePrivate::handleKitAddition); + connect(km, &KitManager::kitRemoved, this, &TargetSetupPagePrivate::handleKitRemoval); + connect(km, &KitManager::kitUpdated, this, &TargetSetupPagePrivate::handleKitUpdate); + connect(m_importWidget, &ImportWidget::importFrom, + this, [this](const FilePath &dir) { import(dir); }); + connect(KitManager::instance(), &KitManager::kitsChanged, + this, &TargetSetupPagePrivate::updateVisibility); + } + + void doInitializePage(); + void handleKitAddition(Kit *k); + void handleKitRemoval(Kit *k); + void handleKitUpdate(Kit *k); + void updateVisibility(); + + void reLayout(); + static bool compareKits(const Kit *k1, const Kit *k2); + std::vector<Internal::TargetSetupWidget *> sortedWidgetList() const; + + void kitSelectionChanged(); + + bool isUpdating() const; + void selectAtLeastOneEnabledKit(); + void removeWidget(Kit *k) { removeWidget(widget(k)); } + void removeWidget(Internal::TargetSetupWidget *w); + Internal::TargetSetupWidget *addWidget(Kit *k); + void addAdditionalWidgets(); + void removeAdditionalWidgets(QLayout *layout); + void removeAdditionalWidgets(); + void updateWidget(Internal::TargetSetupWidget *widget); + bool isUsable(const Kit *kit) const; + + void setupImports(); + void import(const FilePath &path, bool silent = false); + + void setupWidgets(const QString &filterText = QString()); + void reset(); + + TargetSetupWidget *widget(const Id kitId, TargetSetupWidget *fallback = nullptr) const; + TargetSetupWidget *widget(const Kit *k, TargetSetupWidget *fallback = nullptr) const + { + return k ? widget(k->id(), fallback) : fallback; + } + + void setUseScrollArea(bool b); + void kitFilterChanged(const QString &filterText); + + TargetSetupPage *q; + QWidget *m_centralWidget; + QWidget *scrollAreaWidget; + QScrollArea *scrollArea; + QLabel *headerLabel; + QLabel *noValidKitLabel; + QCheckBox *allKitsCheckBox; + FancyLineEdit *kitFilterLineEdit; + + TasksGenerator m_tasksGenerator; + QPointer<ProjectImporter> m_importer; + QLayout *m_baseLayout = nullptr; + FilePath m_projectPath; + QString m_defaultShadowBuildLocation; + std::vector<Internal::TargetSetupWidget *> m_widgets; + + Internal::ImportWidget *m_importWidget = nullptr; + QSpacerItem *m_spacer; + QList<QWidget *> m_potentialWidgets; + + bool m_widgetsWereSetUp = false; }; } // namespace Internal -static TasksGenerator defaultTasksGenerator(const TasksGenerator &childGenerator) -{ - return [childGenerator](const Kit *k) -> Tasks { - if (!k->isValid()) - return {CompileTask(Task::Error, Tr::tr("Kit is not valid."))}; - if (childGenerator) - return childGenerator(k); - return {}; - }; -} - using namespace Internal; TargetSetupPage::TargetSetupPage(QWidget *parent) : WizardPage(parent) - , m_tasksGenerator(defaultTasksGenerator({})) - , m_ui(new TargetSetupPageUi) - , m_importWidget(new ImportWidget(this)) - , m_spacer(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)) + , d(new TargetSetupPagePrivate(this)) { - m_importWidget->setVisible(false); - setObjectName(QLatin1String("TargetSetupPage")); setWindowTitle(Tr::tr("Select Kits for Your Project")); - m_ui->setupUi(this); + setTitle(Tr::tr("Kit Selection")); QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Preferred); policy.setHorizontalStretch(0); policy.setVerticalStretch(0); - policy.setHeightForWidth(sizePolicy().hasHeightForWidth()); setSizePolicy(policy); - auto centralWidget = new QWidget(this); - m_ui->scrollArea->setWidget(centralWidget); - centralWidget->setLayout(new QVBoxLayout); - m_ui->centralWidget->setLayout(new QVBoxLayout); - m_ui->centralWidget->layout()->setContentsMargins(0, 0, 0, 0); - - setTitle(Tr::tr("Kit Selection")); - - for (IPotentialKit *pk : std::as_const(g_potentialKits)) - if (pk->isEnabled()) - m_potentialWidgets.append(pk->createWidget(this)); - - setUseScrollArea(true); - - KitManager *km = KitManager::instance(); - // do note that those slots are triggered once *per* targetsetuppage - // thus the same slot can be triggered multiple times on different instances! - connect(km, &KitManager::kitAdded, this, &TargetSetupPage::handleKitAddition); - connect(km, &KitManager::kitRemoved, this, &TargetSetupPage::handleKitRemoval); - connect(km, &KitManager::kitUpdated, this, &TargetSetupPage::handleKitUpdate); - connect(m_importWidget, &ImportWidget::importFrom, - this, [this](const FilePath &dir) { import(dir); }); - connect(KitManager::instance(), &KitManager::kitsChanged, - this, &TargetSetupPage::updateVisibility); - setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Kits")); } void TargetSetupPage::initializePage() { if (KitManager::isLoaded()) { - doInitializePage(); + d->doInitializePage(); } else { connect(KitManager::instance(), &KitManager::kitsLoaded, - this, &TargetSetupPage::doInitializePage); + d, &TargetSetupPagePrivate::doInitializePage); } } void TargetSetupPage::setTasksGenerator(const TasksGenerator &tasksGenerator) { - m_tasksGenerator = defaultTasksGenerator(tasksGenerator); + d->m_tasksGenerator = defaultTasksGenerator(tasksGenerator); } -QList<Utils::Id> TargetSetupPage::selectedKits() const +QList<Id> TargetSetupPage::selectedKits() const { - QList<Utils::Id> result; - for (TargetSetupWidget *w : m_widgets) { + QList<Id> result; + for (TargetSetupWidget *w : d->m_widgets) { if (w->isKitSelected()) result.append(w->kit()->id()); } @@ -232,19 +288,19 @@ QList<Utils::Id> TargetSetupPage::selectedKits() const TargetSetupPage::~TargetSetupPage() { disconnect(); - reset(); - delete m_spacer; - delete m_ui; + d->reset(); + delete d->m_spacer; + delete d; } bool TargetSetupPage::isComplete() const { - return anyOf(m_widgets, [](const TargetSetupWidget *w) { + return anyOf(d->m_widgets, [](const TargetSetupWidget *w) { return w->isKitSelected(); }); } -void TargetSetupPage::setupWidgets(const QString &filterText) +void TargetSetupPagePrivate::setupWidgets(const QString &filterText) { const auto kitList = KitManager::sortKits(KitManager::kits()); for (Kit *k : kitList) { @@ -252,8 +308,9 @@ void TargetSetupPage::setupWidgets(const QString &filterText) continue; const auto widget = new TargetSetupWidget(k, m_projectPath); connect(widget, &TargetSetupWidget::selectedToggled, - this, &TargetSetupPage::kitSelectionChanged); - connect(widget, &TargetSetupWidget::selectedToggled, this, &QWizardPage::completeChanged); + this, &TargetSetupPagePrivate::kitSelectionChanged); + connect(widget, &TargetSetupWidget::selectedToggled, + q, &QWizardPage::completeChanged); updateWidget(widget); m_widgets.push_back(widget); m_baseLayout->addWidget(widget); @@ -267,7 +324,7 @@ void TargetSetupPage::setupWidgets(const QString &filterText) updateVisibility(); } -void TargetSetupPage::reset() +void TargetSetupPagePrivate::reset() { removeAdditionalWidgets(); while (m_widgets.size() > 0) { @@ -280,11 +337,10 @@ void TargetSetupPage::reset() removeWidget(w); } - m_ui->allKitsCheckBox->setChecked(false); + allKitsCheckBox->setChecked(false); } -TargetSetupWidget *TargetSetupPage::widget(const Utils::Id kitId, - TargetSetupWidget *fallback) const +TargetSetupWidget *TargetSetupPagePrivate::widget(const Id kitId, TargetSetupWidget *fallback) const { return findOr(m_widgets, fallback, [kitId](const TargetSetupWidget *w) { return w->kit() && w->kit()->id() == kitId; @@ -293,40 +349,40 @@ TargetSetupWidget *TargetSetupPage::widget(const Utils::Id kitId, void TargetSetupPage::setProjectPath(const FilePath &path) { - m_projectPath = path; - if (!m_projectPath.isEmpty()) { + d->m_projectPath = path; + if (!d->m_projectPath.isEmpty()) { QFileInfo fileInfo(QDir::cleanPath(path.toString())); QStringList subDirsList = fileInfo.absolutePath().split('/'); - m_ui->headerLabel->setText(Tr::tr("The following kits can be used for project <b>%1</b>:", + d->headerLabel->setText(Tr::tr("The following kits can be used for project <b>%1</b>:", "%1: Project name").arg(subDirsList.last())); } - m_ui->headerLabel->setVisible(!m_projectPath.isEmpty()); + d->headerLabel->setVisible(!d->m_projectPath.isEmpty()); - if (m_widgetsWereSetUp) + if (d->m_widgetsWereSetUp) initializePage(); } void TargetSetupPage::setProjectImporter(ProjectImporter *importer) { - if (importer == m_importer) + if (importer == d->m_importer) return; - if (m_widgetsWereSetUp) - reset(); // Reset before changing the importer! + if (d->m_widgetsWereSetUp) + d->reset(); // Reset before changing the importer! - m_importer = importer; - m_importWidget->setVisible(m_importer); + d->m_importer = importer; + d->m_importWidget->setVisible(d->m_importer); - if (m_widgetsWereSetUp) + if (d->m_widgetsWereSetUp) initializePage(); } bool TargetSetupPage::importLineEditHasFocus() const { - return m_importWidget->ownsReturnKey(); + return d->m_importWidget->ownsReturnKey(); } -void TargetSetupPage::setupImports() +void TargetSetupPagePrivate::setupImports() { if (!m_importer || m_projectPath.isEmpty()) return; @@ -336,18 +392,18 @@ void TargetSetupPage::setupImports() import(path, true); } -void TargetSetupPage::handleKitAddition(Kit *k) +void TargetSetupPagePrivate::handleKitAddition(Kit *k) { if (isUpdating()) return; - Q_ASSERT(!widget(k)); + QTC_ASSERT(!widget(k), return); addWidget(k); kitSelectionChanged(); updateVisibility(); } -void TargetSetupPage::handleKitRemoval(Kit *k) +void TargetSetupPagePrivate::handleKitRemoval(Kit *k) { if (isUpdating()) return; @@ -360,7 +416,7 @@ void TargetSetupPage::handleKitRemoval(Kit *k) updateVisibility(); } -void TargetSetupPage::handleKitUpdate(Kit *k) +void TargetSetupPagePrivate::handleKitUpdate(Kit *k) { if (isUpdating()) return; @@ -378,7 +434,7 @@ void TargetSetupPage::handleKitUpdate(Kit *k) updateVisibility(); } -void TargetSetupPage::selectAtLeastOneEnabledKit() +void TargetSetupPagePrivate::selectAtLeastOneEnabledKit() { if (anyOf(m_widgets, [](const TargetSetupWidget *w) { return w->isKitSelected(); })) { // Something is already selected, we are done. @@ -420,24 +476,24 @@ void TargetSetupPage::selectAtLeastOneEnabledKit() if (toCheckWidget) { toCheckWidget->setKitSelected(true); - emit completeChanged(); // Is this necessary? + emit q->completeChanged(); // FIXME: Is this necessary? } } -void TargetSetupPage::updateVisibility() +void TargetSetupPagePrivate::updateVisibility() { // Always show the widgets, the import widget always makes sense to show. - m_ui->scrollAreaWidget->setVisible(m_baseLayout == m_ui->scrollArea->widget()->layout()); - m_ui->centralWidget->setVisible(m_baseLayout == m_ui->centralWidget->layout()); + scrollAreaWidget->setVisible(m_baseLayout == scrollArea->widget()->layout()); + m_centralWidget->setVisible(m_baseLayout == m_centralWidget->layout()); const bool hasUsableKits = KitManager::kit([this](const Kit *k) { return isUsable(k); }); - m_ui->noValidKitLabel->setVisible(!hasUsableKits); - m_ui->allKitsCheckBox->setVisible(hasUsableKits); + noValidKitLabel->setVisible(!hasUsableKits); + allKitsCheckBox->setVisible(hasUsableKits); - emit completeChanged(); + emit q->completeChanged(); } -void TargetSetupPage::reLayout() +void TargetSetupPagePrivate::reLayout() { removeAdditionalWidgets(); for (TargetSetupWidget * const w : std::as_const(m_widgets)) @@ -447,7 +503,7 @@ void TargetSetupPage::reLayout() addAdditionalWidgets(); } -bool TargetSetupPage::compareKits(const Kit *k1, const Kit *k2) +bool TargetSetupPagePrivate::compareKits(const Kit *k1, const Kit *k2) { const QString name1 = k1->displayName(); const QString name2 = k2->displayName(); @@ -458,7 +514,7 @@ bool TargetSetupPage::compareKits(const Kit *k1, const Kit *k2) return k1 < k2; } -std::vector<TargetSetupWidget *> TargetSetupPage::sortedWidgetList() const +std::vector<TargetSetupWidget *> TargetSetupPagePrivate::sortedWidgetList() const { return sorted(m_widgets, [](const TargetSetupWidget *w1, const TargetSetupWidget *w2) { return compareKits(w1->kit(), w2->kit()); @@ -470,7 +526,7 @@ void TargetSetupPage::openOptions() Core::ICore::showOptionsDialog(Constants::KITS_SETTINGS_PAGE_ID, this); } -void TargetSetupPage::kitSelectionChanged() +void TargetSetupPagePrivate::kitSelectionChanged() { int selected = 0; int deselected = 0; @@ -481,20 +537,20 @@ void TargetSetupPage::kitSelectionChanged() ++deselected; } if (selected > 0 && deselected > 0) - m_ui->allKitsCheckBox->setCheckState(Qt::PartiallyChecked); + allKitsCheckBox->setCheckState(Qt::PartiallyChecked); else if (selected > 0 && deselected == 0) - m_ui->allKitsCheckBox->setCheckState(Qt::Checked); + allKitsCheckBox->setCheckState(Qt::Checked); else - m_ui->allKitsCheckBox->setCheckState(Qt::Unchecked); + allKitsCheckBox->setCheckState(Qt::Unchecked); } -void TargetSetupPage::kitFilterChanged(const QString &filterText) +void TargetSetupPagePrivate::kitFilterChanged(const QString &filterText) { QPointer<QWidget> focusWidget = QApplication::focusWidget(); // Remember selected kits: const std::vector<TargetSetupWidget *> selectedWidgets = filtered(m_widgets, &TargetSetupWidget::isKitSelected); - const QVector<Utils::Id> selectedKitIds = transform<QVector>(selectedWidgets, + const QVector<Id> selectedKitIds = transform<QVector>(selectedWidgets, [](const TargetSetupWidget *w) { return w->kit()->id(); }); @@ -507,13 +563,13 @@ void TargetSetupPage::kitFilterChanged(const QString &filterText) for (TargetSetupWidget *w : std::as_const(m_widgets)) w->setKitSelected(selectedKitIds.contains(w->kit()->id())); - emit completeChanged(); + emit q->completeChanged(); if (focusWidget) focusWidget->setFocus(); } -void TargetSetupPage::doInitializePage() +void TargetSetupPagePrivate::doInitializePage() { reset(); setupWidgets(); @@ -527,25 +583,25 @@ void TargetSetupPage::doInitializePage() void TargetSetupPage::showEvent(QShowEvent *event) { WizardPage::showEvent(event); - m_ui->kitFilterLineEdit->setFocus(); // Ensure "Configure Project" gets triggered on <Return> + d->kitFilterLineEdit->setFocus(); // Ensure "Configure Project" gets triggered on <Return> } void TargetSetupPage::changeAllKitsSelections() { - if (m_ui->allKitsCheckBox->checkState() == Qt::PartiallyChecked) - m_ui->allKitsCheckBox->setCheckState(Qt::Checked); - bool checked = m_ui->allKitsCheckBox->isChecked(); - for (TargetSetupWidget *widget : m_widgets) + if (d->allKitsCheckBox->checkState() == Qt::PartiallyChecked) + d->allKitsCheckBox->setCheckState(Qt::Checked); + bool checked = d->allKitsCheckBox->isChecked(); + for (TargetSetupWidget *widget : d->m_widgets) widget->setKitSelected(checked); emit completeChanged(); } -bool TargetSetupPage::isUpdating() const +bool TargetSetupPagePrivate::isUpdating() const { return m_importer && m_importer->isUpdating(); } -void TargetSetupPage::import(const FilePath &path, bool silent) +void TargetSetupPagePrivate::import(const FilePath &path, bool silent) { if (!m_importer) return; @@ -554,7 +610,7 @@ void TargetSetupPage::import(const FilePath &path, bool silent) TargetSetupWidget *w = widget(info.kitId); if (!w) { Kit *k = KitManager::kit(info.kitId); - Q_ASSERT(k); + QTC_CHECK(k); addWidget(k); } w = widget(info.kitId); @@ -566,10 +622,10 @@ void TargetSetupPage::import(const FilePath &path, bool silent) w->expandWidget(); kitSelectionChanged(); } - emit completeChanged(); + emit q->completeChanged(); } -void TargetSetupPage::removeWidget(TargetSetupWidget *w) +void TargetSetupPagePrivate::removeWidget(TargetSetupWidget *w) { if (!w) return; @@ -578,13 +634,14 @@ void TargetSetupPage::removeWidget(TargetSetupWidget *w) m_widgets.erase(std::find(m_widgets.begin(), m_widgets.end(), w)); } -TargetSetupWidget *TargetSetupPage::addWidget(Kit *k) +TargetSetupWidget *TargetSetupPagePrivate::addWidget(Kit *k) { const auto widget = new TargetSetupWidget(k, m_projectPath); updateWidget(widget); connect(widget, &TargetSetupWidget::selectedToggled, - this, &TargetSetupPage::kitSelectionChanged); - connect(widget, &TargetSetupWidget::selectedToggled, this, &QWizardPage::completeChanged); + this, &TargetSetupPagePrivate::kitSelectionChanged); + connect(widget, &TargetSetupWidget::selectedToggled, + q, &QWizardPage::completeChanged); // Insert widget, sorted. @@ -605,7 +662,7 @@ TargetSetupWidget *TargetSetupPage::addWidget(Kit *k) return widget; } -void TargetSetupPage::addAdditionalWidgets() +void TargetSetupPagePrivate::addAdditionalWidgets() { m_baseLayout->addWidget(m_importWidget); for (QWidget * const widget : std::as_const(m_potentialWidgets)) @@ -613,7 +670,7 @@ void TargetSetupPage::addAdditionalWidgets() m_baseLayout->addItem(m_spacer); } -void TargetSetupPage::removeAdditionalWidgets(QLayout *layout) +void TargetSetupPagePrivate::removeAdditionalWidgets(QLayout *layout) { layout->removeWidget(m_importWidget); for (QWidget * const potentialWidget : std::as_const(m_potentialWidgets)) @@ -621,13 +678,18 @@ void TargetSetupPage::removeAdditionalWidgets(QLayout *layout) layout->removeItem(m_spacer); } -void TargetSetupPage::updateWidget(TargetSetupWidget *widget) +void TargetSetupPagePrivate::removeAdditionalWidgets() +{ + removeAdditionalWidgets(m_baseLayout); +} + +void TargetSetupPagePrivate::updateWidget(TargetSetupWidget *widget) { QTC_ASSERT(widget, return ); widget->update(m_tasksGenerator); } -bool TargetSetupPage::isUsable(const Kit *kit) const +bool TargetSetupPagePrivate::isUsable(const Kit *kit) const { return !containsType(m_tasksGenerator(kit), Task::Error); } @@ -635,14 +697,14 @@ bool TargetSetupPage::isUsable(const Kit *kit) const bool TargetSetupPage::setupProject(Project *project) { QList<BuildInfo> toSetUp; - for (TargetSetupWidget *widget : m_widgets) { + for (TargetSetupWidget *widget : d->m_widgets) { if (!widget->isKitSelected()) continue; Kit *k = widget->kit(); - if (k && m_importer) - m_importer->makePersistent(k); + if (k && d->m_importer) + d->m_importer->makePersistent(k); toSetUp << widget->selectedBuildInfoList(); widget->clearKit(); } @@ -651,11 +713,11 @@ bool TargetSetupPage::setupProject(Project *project) toSetUp.clear(); // Only reset now that toSetUp has been cleared! - reset(); + d->reset(); Target *activeTarget = nullptr; - if (m_importer) - activeTarget = m_importer->preferredTarget(project->targets()); + if (d->m_importer) + activeTarget = d->m_importer->preferredTarget(project->targets()); if (activeTarget) project->setActiveTarget(activeTarget, SetActive::NoCascade); @@ -663,13 +725,18 @@ bool TargetSetupPage::setupProject(Project *project) } void TargetSetupPage::setUseScrollArea(bool b) +{ + d->setUseScrollArea(b); +} + +void TargetSetupPagePrivate::setUseScrollArea(bool b) { QLayout *oldBaseLayout = m_baseLayout; - m_baseLayout = b ? m_ui->scrollArea->widget()->layout() : m_ui->centralWidget->layout(); + m_baseLayout = b ? scrollArea->widget()->layout() : m_centralWidget->layout(); if (oldBaseLayout == m_baseLayout) return; - m_ui->scrollAreaWidget->setVisible(b); - m_ui->centralWidget->setVisible(!b); + scrollAreaWidget->setVisible(b); + m_centralWidget->setVisible(!b); if (oldBaseLayout) removeAdditionalWidgets(oldBaseLayout); diff --git a/src/plugins/projectexplorer/targetsetuppage.h b/src/plugins/projectexplorer/targetsetuppage.h index 99448693c6f..ecff0fa6391 100644 --- a/src/plugins/projectexplorer/targetsetuppage.h +++ b/src/plugins/projectexplorer/targetsetuppage.h @@ -6,27 +6,17 @@ #include "projectexplorer_export.h" #include "kit.h" -#include "projectimporter.h" #include <utils/wizardpage.h> -#include <QPointer> -#include <QString> -#include <QMap> - -QT_FORWARD_DECLARE_CLASS(QSpacerItem) - namespace Utils { class FilePath; } namespace ProjectExplorer { class Kit; class Project; +class ProjectImporter; -namespace Internal { -class ImportWidget; -class TargetSetupPageUi; -class TargetSetupWidget; -} // namespace Internal +namespace Internal { class TargetSetupPagePrivate; } /// \internal class PROJECTEXPLORER_EXPORT TargetSetupPage : public Utils::WizardPage @@ -59,63 +49,10 @@ public: void openOptions(); void changeAllKitsSelections(); - void kitFilterChanged(const QString &filterText); - private: - void doInitializePage(); - void showEvent(QShowEvent *event) final; - void handleKitAddition(Kit *k); - void handleKitRemoval(Kit *k); - void handleKitUpdate(Kit *k); - void updateVisibility(); - - void reLayout(); - static bool compareKits(const Kit *k1, const Kit *k2); - std::vector<Internal::TargetSetupWidget *> sortedWidgetList() const; - - void kitSelectionChanged(); - - bool isUpdating() const; - void selectAtLeastOneEnabledKit(); - void removeWidget(Kit *k) { removeWidget(widget(k)); } - void removeWidget(Internal::TargetSetupWidget *w); - Internal::TargetSetupWidget *addWidget(Kit *k); - void addAdditionalWidgets(); - void removeAdditionalWidgets(QLayout *layout); - void removeAdditionalWidgets() { removeAdditionalWidgets(m_baseLayout); } - void updateWidget(Internal::TargetSetupWidget *widget); - bool isUsable(const Kit *kit) const; - - void setupImports(); - void import(const Utils::FilePath &path, bool silent = false); - - void setupWidgets(const QString &filterText = QString()); - void reset(); - - Internal::TargetSetupWidget *widget(const Kit *k, - Internal::TargetSetupWidget *fallback = nullptr) const - { - return k ? widget(k->id(), fallback) : fallback; - } - Internal::TargetSetupWidget *widget(const Utils::Id kitId, - Internal::TargetSetupWidget *fallback = nullptr) const; - - TasksGenerator m_tasksGenerator; - QPointer<ProjectImporter> m_importer; - QLayout *m_baseLayout = nullptr; - Utils::FilePath m_projectPath; - QString m_defaultShadowBuildLocation; - std::vector<Internal::TargetSetupWidget *> m_widgets; - - Internal::TargetSetupPageUi *m_ui; - - Internal::ImportWidget *m_importWidget; - QSpacerItem *m_spacer; - QList<QWidget *> m_potentialWidgets; - - bool m_widgetsWereSetUp = false; + Internal::TargetSetupPagePrivate *d; }; } // namespace ProjectExplorer From 1818236b2bd52da570e774b99df3d56d2113d84e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 11 Aug 2023 16:13:29 +0200 Subject: [PATCH 0694/1777] Utils/QmlJS: Move contents of utils/json.{h,cpp} to qmljs This is a special version of JSON only used in the QmlJSEditor, demote it accordingly. Change-Id: Id21ea16c022fb8554d87e9ba90c3494978e4cd80 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/qmljs/jsoncheck.cpp | 720 ++++++++++++++++- src/libs/qmljs/jsoncheck.h | 390 +++++++++- src/libs/qmljs/qmljsbundle.cpp | 22 +- src/libs/qmljs/qmljsbundle.h | 7 +- src/libs/utils/CMakeLists.txt | 1 - src/libs/utils/json.cpp | 722 ------------------ src/libs/utils/json.h | 397 ---------- src/libs/utils/utils.qbs | 2 - src/plugins/qmljseditor/qmljseditorplugin.cpp | 11 +- src/plugins/qmljseditor/qmljseditorplugin.h | 4 +- .../qmljseditor/qmljssemanticinfoupdater.cpp | 4 +- 11 files changed, 1126 insertions(+), 1154 deletions(-) delete mode 100644 src/libs/utils/json.cpp delete mode 100644 src/libs/utils/json.h diff --git a/src/libs/qmljs/jsoncheck.cpp b/src/libs/qmljs/jsoncheck.cpp index 366c150c95c..1d7c04e50cf 100644 --- a/src/libs/qmljs/jsoncheck.cpp +++ b/src/libs/qmljs/jsoncheck.cpp @@ -4,19 +4,24 @@ #include "jsoncheck.h" #include <qmljs/parser/qmljsast_p.h> + +#include <utils/fileutils.h> #include <utils/qtcassert.h> #include <QDebug> +#include <QDir> +#include <QJsonDocument> #include <QLatin1String> #include <QRegularExpression> #include <cmath> -using namespace QmlJS; using namespace QmlJS::AST; using namespace QmlJS::StaticAnalysis; using namespace Utils; +namespace QmlJS { + JsonCheck::JsonCheck(Document::Ptr doc) : m_doc(doc) , m_schema(nullptr) @@ -384,3 +389,716 @@ JsonCheck::AnalysisData *JsonCheck::analysis() { return &m_analysis.top(); } + + +JsonMemoryPool::~JsonMemoryPool() +{ + for (char *obj : std::as_const(_objs)) { + reinterpret_cast<JsonValue *>(obj)->~JsonValue(); + delete[] obj; + } +} + +JsonValue::JsonValue(Kind kind) + : m_kind(kind) +{} + +JsonValue::~JsonValue() = default; + +JsonValue *JsonValue::create(const QString &s, JsonMemoryPool *pool) +{ + const QJsonDocument document = QJsonDocument::fromJson(s.toUtf8()); + if (document.isNull()) + return nullptr; + + return build(document.toVariant(), pool); +} + +void *JsonValue::operator new(size_t size, JsonMemoryPool *pool) +{ return pool->allocate(size); } + +void JsonValue::operator delete(void *) +{ } + +void JsonValue::operator delete(void *, JsonMemoryPool *) +{ } + +QString JsonValue::kindToString(JsonValue::Kind kind) +{ + if (kind == String) + return QLatin1String("string"); + if (kind == Double) + return QLatin1String("number"); + if (kind == Int) + return QLatin1String("integer"); + if (kind == Object) + return QLatin1String("object"); + if (kind == Array) + return QLatin1String("array"); + if (kind == Boolean) + return QLatin1String("boolean"); + if (kind == Null) + return QLatin1String("null"); + + return QLatin1String("unknown"); +} + +JsonValue *JsonValue::build(const QVariant &variant, JsonMemoryPool *pool) +{ + switch (variant.typeId()) { + + case QVariant::List: { + auto newValue = new (pool) JsonArrayValue; + const QList<QVariant> list = variant.toList(); + for (const QVariant &element : list) + newValue->addElement(build(element, pool)); + return newValue; + } + + case QVariant::Map: { + auto newValue = new (pool) JsonObjectValue; + const QVariantMap variantMap = variant.toMap(); + for (QVariantMap::const_iterator it = variantMap.begin(); it != variantMap.end(); ++it) + newValue->addMember(it.key(), build(it.value(), pool)); + return newValue; + } + + case QVariant::String: + return new (pool) JsonStringValue(variant.toString()); + + case QVariant::Int: + return new (pool) JsonIntValue(variant.toInt()); + + case QVariant::Double: + return new (pool) JsonDoubleValue(variant.toDouble()); + + case QVariant::Bool: + return new (pool) JsonBooleanValue(variant.toBool()); + + case QVariant::Invalid: + return new (pool) JsonNullValue; + + default: + break; + } + + return nullptr; +} + + +/////////////////////////////////////////////////////////////////////////////// + +QString JsonSchema::kType() { return QStringLiteral("type"); } +QString JsonSchema::kProperties() { return QStringLiteral("properties"); } +QString JsonSchema::kPatternProperties() { return QStringLiteral("patternProperties"); } +QString JsonSchema::kAdditionalProperties() { return QStringLiteral("additionalProperties"); } +QString JsonSchema::kItems() { return QStringLiteral("items"); } +QString JsonSchema::kAdditionalItems() { return QStringLiteral("additionalItems"); } +QString JsonSchema::kRequired() { return QStringLiteral("required"); } +QString JsonSchema::kDependencies() { return QStringLiteral("dependencies"); } +QString JsonSchema::kMinimum() { return QStringLiteral("minimum"); } +QString JsonSchema::kMaximum() { return QStringLiteral("maximum"); } +QString JsonSchema::kExclusiveMinimum() { return QStringLiteral("exclusiveMinimum"); } +QString JsonSchema::kExclusiveMaximum() { return QStringLiteral("exclusiveMaximum"); } +QString JsonSchema::kMinItems() { return QStringLiteral("minItems"); } +QString JsonSchema::kMaxItems() { return QStringLiteral("maxItems"); } +QString JsonSchema::kUniqueItems() { return QStringLiteral("uniqueItems"); } +QString JsonSchema::kPattern() { return QStringLiteral("pattern"); } +QString JsonSchema::kMinLength() { return QStringLiteral("minLength"); } +QString JsonSchema::kMaxLength() { return QStringLiteral("maxLength"); } +QString JsonSchema::kTitle() { return QStringLiteral("title"); } +QString JsonSchema::kDescription() { return QStringLiteral("description"); } +QString JsonSchema::kExtends() { return QStringLiteral("extends"); } +QString JsonSchema::kRef() { return QStringLiteral("$ref"); } + +JsonSchema::JsonSchema(JsonObjectValue *rootObject, const JsonSchemaManager *manager) + : m_manager(manager) +{ + enter(rootObject); +} + +bool JsonSchema::isTypeConstrained() const +{ + // Simple types + if (JsonStringValue *sv = getStringValue(kType(), currentValue())) + return isCheckableType(sv->value()); + + // Union types + if (JsonArrayValue *av = getArrayValue(kType(), currentValue())) { + QTC_ASSERT(currentIndex() != -1, return false); + QTC_ASSERT(av->elements().at(currentIndex())->kind() == JsonValue::String, return false); + JsonStringValue *sv = av->elements().at(currentIndex())->toString(); + return isCheckableType(sv->value()); + } + + return false; +} + +bool JsonSchema::acceptsType(const QString &type) const +{ + // Simple types + if (JsonStringValue *sv = getStringValue(kType(), currentValue())) + return typeMatches(sv->value(), type); + + // Union types + if (JsonArrayValue *av = getArrayValue(kType(), currentValue())) { + QTC_ASSERT(currentIndex() != -1, return false); + QTC_ASSERT(av->elements().at(currentIndex())->kind() == JsonValue::String, return false); + JsonStringValue *sv = av->elements().at(currentIndex())->toString(); + return typeMatches(sv->value(), type); + } + + return false; +} + +QStringList JsonSchema::validTypes(JsonObjectValue *v) +{ + QStringList all; + + if (JsonStringValue *sv = getStringValue(kType(), v)) + all.append(sv->value()); + + if (JsonObjectValue *ov = getObjectValue(kType(), v)) + return validTypes(ov); + + if (JsonArrayValue *av = getArrayValue(kType(), v)) { + const QList<JsonValue *> elements = av->elements(); + for (JsonValue *v : elements) { + if (JsonStringValue *sv = v->toString()) + all.append(sv->value()); + else if (JsonObjectValue *ov = v->toObject()) + all.append(validTypes(ov)); + } + } + + return all; +} + +bool JsonSchema::typeMatches(const QString &expected, const QString &actual) +{ + if (expected == QLatin1String("number") && actual == QLatin1String("integer")) + return true; + + return expected == actual; +} + +bool JsonSchema::isCheckableType(const QString &s) +{ + return s == QLatin1String("string") + || s == QLatin1String("number") + || s == QLatin1String("integer") + || s == QLatin1String("boolean") + || s == QLatin1String("object") + || s == QLatin1String("array") + || s == QLatin1String("null"); +} + +QStringList JsonSchema::validTypes() const +{ + return validTypes(currentValue()); +} + +bool JsonSchema::hasTypeSchema() const +{ + return getObjectValue(kType(), currentValue()); +} + +void JsonSchema::enterNestedTypeSchema() +{ + QTC_ASSERT(hasTypeSchema(), return); + + enter(getObjectValue(kType(), currentValue())); +} + +QStringList JsonSchema::properties(JsonObjectValue *v) const +{ + using Members = QHash<QString, JsonValue *>; + + QStringList all; + + if (JsonObjectValue *ov = getObjectValue(kProperties(), v)) { + const Members members = ov->members(); + const Members::ConstIterator cend = members.constEnd(); + for (Members::ConstIterator it = members.constBegin(); it != cend; ++it) + if (hasPropertySchema(it.key())) + all.append(it.key()); + } + + if (JsonObjectValue *base = resolveBase(v)) + all.append(properties(base)); + + return all; +} + +QStringList JsonSchema::properties() const +{ + QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Object)), return {}); + + return properties(currentValue()); +} + +JsonObjectValue *JsonSchema::propertySchema(const QString &property, + JsonObjectValue *v) const +{ + if (JsonObjectValue *ov = getObjectValue(kProperties(), v)) { + JsonValue *member = ov->member(property); + if (member && member->kind() == JsonValue::Object) + return member->toObject(); + } + + if (JsonObjectValue *base = resolveBase(v)) + return propertySchema(property, base); + + return nullptr; +} + +bool JsonSchema::hasPropertySchema(const QString &property) const +{ + return propertySchema(property, currentValue()); +} + +void JsonSchema::enterNestedPropertySchema(const QString &property) +{ + QTC_ASSERT(hasPropertySchema(property), return); + + JsonObjectValue *schema = propertySchema(property, currentValue()); + + enter(schema); +} + +/*! + * An array schema is allowed to have its \e items specification in the form of + * another schema + * or in the form of an array of schemas [Sec. 5.5]. This functions checks whether this is case + * in which the items are a schema. + * + * Returns whether or not the items from the array are a schema. + */ +bool JsonSchema::hasItemSchema() const +{ + QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Array)), return false); + + return getObjectValue(kItems(), currentValue()); +} + +void JsonSchema::enterNestedItemSchema() +{ + QTC_ASSERT(hasItemSchema(), return); + + enter(getObjectValue(kItems(), currentValue())); +} + +/*! + * An array schema is allowed to have its \e items specification in the form of another schema + * or in the form of an array of schemas [Sec. 5.5]. This functions checks whether this is case + * in which the items are an array of schemas. + * + * Returns whether or not the items from the array are a an array of schemas. + */ +bool JsonSchema::hasItemArraySchema() const +{ + QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Array)), return false); + + return getArrayValue(kItems(), currentValue()); +} + +int JsonSchema::itemArraySchemaSize() const +{ + QTC_ASSERT(hasItemArraySchema(), return false); + + return getArrayValue(kItems(), currentValue())->size(); +} + +/*! + * When evaluating the items of an array it might be necessary to \e enter a + * particular schema, + * since this API assumes that there's always a valid schema in context (the one the user is + * interested on). This shall only happen if the item at the supplied array index is of type + * object, which is then assumed to be a schema. + * + * The function also marks the context as being inside an array evaluation. + * + * Returns whether it was necessary to enter a schema for the supplied + * array \a index, false if index is out of bounds. + */ +bool JsonSchema::maybeEnterNestedArraySchema(int index) +{ + QTC_ASSERT(itemArraySchemaSize(), return false); + QTC_ASSERT(index >= 0 && index < itemArraySchemaSize(), return false); + + JsonValue *v = getArrayValue(kItems(), currentValue())->elements().at(index); + + return maybeEnter(v, Array, index); +} + +/*! + * The type of a schema can be specified in the form of a union type, which is basically an + * array of allowed types for the particular instance [Sec. 5.1]. This function checks whether + * the current schema is one of such. + * + * Returns whether or not the current schema specifies a union type. + */ +bool JsonSchema::hasUnionSchema() const +{ + return getArrayValue(kType(), currentValue()); +} + +int JsonSchema::unionSchemaSize() const +{ + return getArrayValue(kType(), currentValue())->size(); +} + +/*! + * When evaluating union types it might be necessary to enter a particular + * schema, since this + * API assumes that there's always a valid schema in context (the one the user is interested on). + * This shall only happen if the item at the supplied union \a index, which is then assumed to be + * a schema. + * + * The function also marks the context as being inside an union evaluation. + * + * Returns whether or not it was necessary to enter a schema for the + * supplied union index. + */ +bool JsonSchema::maybeEnterNestedUnionSchema(int index) +{ + QTC_ASSERT(unionSchemaSize(), return false); + QTC_ASSERT(index >= 0 && index < unionSchemaSize(), return false); + + JsonValue *v = getArrayValue(kType(), currentValue())->elements().at(index); + + return maybeEnter(v, Union, index); +} + +void JsonSchema::leaveNestedSchema() +{ + QTC_ASSERT(!m_schemas.isEmpty(), return); + + leave(); +} + +bool JsonSchema::required() const +{ + if (JsonBooleanValue *bv = getBooleanValue(kRequired(), currentValue())) + return bv->value(); + + return false; +} + +bool JsonSchema::hasMinimum() const +{ + QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Int)), return false); + + return getDoubleValue(kMinimum(), currentValue()); +} + +double JsonSchema::minimum() const +{ + QTC_ASSERT(hasMinimum(), return 0); + + return getDoubleValue(kMinimum(), currentValue())->value(); +} + +bool JsonSchema::hasExclusiveMinimum() +{ + QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Int)), return false); + + if (JsonBooleanValue *bv = getBooleanValue(kExclusiveMinimum(), currentValue())) + return bv->value(); + + return false; +} + +bool JsonSchema::hasMaximum() const +{ + QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Int)), return false); + + return getDoubleValue(kMaximum(), currentValue()); +} + +double JsonSchema::maximum() const +{ + QTC_ASSERT(hasMaximum(), return 0); + + return getDoubleValue(kMaximum(), currentValue())->value(); +} + +bool JsonSchema::hasExclusiveMaximum() +{ + QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Int)), return false); + + if (JsonBooleanValue *bv = getBooleanValue(kExclusiveMaximum(), currentValue())) + return bv->value(); + + return false; +} + +QString JsonSchema::pattern() const +{ + QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::String)), return QString()); + + if (JsonStringValue *sv = getStringValue(kPattern(), currentValue())) + return sv->value(); + + return QString(); +} + +int JsonSchema::minimumLength() const +{ + QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::String)), return -1); + + if (JsonDoubleValue *dv = getDoubleValue(kMinLength(), currentValue())) + return dv->value(); + + return -1; +} + +int JsonSchema::maximumLength() const +{ + QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::String)), return -1); + + if (JsonDoubleValue *dv = getDoubleValue(kMaxLength(), currentValue())) + return dv->value(); + + return -1; +} + +bool JsonSchema::hasAdditionalItems() const +{ + QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Array)), return false); + + return currentValue()->member(kAdditionalItems()); +} + +bool JsonSchema::maybeSchemaName(const QString &s) +{ + if (s.isEmpty() || s == QLatin1String("any")) + return false; + + return !isCheckableType(s); +} + +JsonObjectValue *JsonSchema::rootValue() const +{ + QTC_ASSERT(!m_schemas.isEmpty(), return nullptr); + + return m_schemas.first().m_value; +} + +JsonObjectValue *JsonSchema::currentValue() const +{ + QTC_ASSERT(!m_schemas.isEmpty(), return nullptr); + + return m_schemas.last().m_value; +} + +int JsonSchema::currentIndex() const +{ + QTC_ASSERT(!m_schemas.isEmpty(), return 0); + + return m_schemas.last().m_index; +} + +void JsonSchema::evaluate(EvaluationMode eval, int index) +{ + QTC_ASSERT(!m_schemas.isEmpty(), return); + + m_schemas.last().m_eval = eval; + m_schemas.last().m_index = index; +} + +void JsonSchema::enter(JsonObjectValue *ov, EvaluationMode eval, int index) +{ + Context context; + context.m_eval = eval; + context.m_index = index; + context.m_value = resolveReference(ov); + + m_schemas.push_back(context); +} + +bool JsonSchema::maybeEnter(JsonValue *v, EvaluationMode eval, int index) +{ + evaluate(eval, index); + + if (v->kind() == JsonValue::Object) { + enter(v->toObject()); + return true; + } + + if (v->kind() == JsonValue::String) { + const QString &s = v->toString()->value(); + if (maybeSchemaName(s)) { + JsonSchema *schema = m_manager->schemaByName(s); + if (schema) { + enter(schema->rootValue()); + return true; + } + } + } + + return false; +} + +void JsonSchema::leave() +{ + QTC_ASSERT(!m_schemas.isEmpty(), return); + + m_schemas.pop_back(); +} + +JsonObjectValue *JsonSchema::resolveReference(JsonObjectValue *ov) const +{ + if (JsonStringValue *sv = getStringValue(kRef(), ov)) { + JsonSchema *referenced = m_manager->schemaByName(sv->value()); + if (referenced) + return referenced->rootValue(); + } + + return ov; +} + +JsonObjectValue *JsonSchema::resolveBase(JsonObjectValue *ov) const +{ + if (JsonValue *v = ov->member(kExtends())) { + if (v->kind() == JsonValue::String) { + JsonSchema *schema = m_manager->schemaByName(v->toString()->value()); + if (schema) + return schema->rootValue(); + } else if (v->kind() == JsonValue::Object) { + return resolveReference(v->toObject()); + } + } + + return nullptr; +} + +JsonStringValue *JsonSchema::getStringValue(const QString &name, JsonObjectValue *value) +{ + JsonValue *v = value->member(name); + if (!v) + return nullptr; + + return v->toString(); +} + +JsonObjectValue *JsonSchema::getObjectValue(const QString &name, JsonObjectValue *value) +{ + JsonValue *v = value->member(name); + if (!v) + return nullptr; + + return v->toObject(); +} + +JsonBooleanValue *JsonSchema::getBooleanValue(const QString &name, JsonObjectValue *value) +{ + JsonValue *v = value->member(name); + if (!v) + return nullptr; + + return v->toBoolean(); +} + +JsonArrayValue *JsonSchema::getArrayValue(const QString &name, JsonObjectValue *value) +{ + JsonValue *v = value->member(name); + if (!v) + return nullptr; + + return v->toArray(); +} + +JsonDoubleValue *JsonSchema::getDoubleValue(const QString &name, JsonObjectValue *value) +{ + JsonValue *v = value->member(name); + if (!v) + return nullptr; + + return v->toDouble(); +} + + +/////////////////////////////////////////////////////////////////////////////// + +JsonSchemaManager::JsonSchemaManager(const QStringList &searchPaths) + : m_searchPaths(searchPaths) +{ + for (const QString &path : searchPaths) { + QDir dir(path); + if (!dir.exists()) + continue; + dir.setNameFilters(QStringList(QLatin1String("*.json"))); + const QList<QFileInfo> entries = dir.entryInfoList(); + for (const QFileInfo &fi : entries) + m_schemas.insert(fi.baseName(), JsonSchemaData(fi.absoluteFilePath())); + } +} + +JsonSchemaManager::~JsonSchemaManager() +{ + for (const JsonSchemaData &schemaData : std::as_const(m_schemas)) + delete schemaData.m_schema; +} + +/*! + * Tries to find a JSON schema to validate \a fileName against. According + * to the specification, how the schema/instance association is done is implementation defined. + * Currently we use a quite naive approach which is simply based on file names. Specifically, + * if one opens a foo.json file we'll look for a schema named foo.json. We should probably + * investigate alternative settings later. + * + * Returns a valid schema or 0. + */ +JsonSchema *JsonSchemaManager::schemaForFile(const QString &fileName) const +{ + QString baseName(QFileInfo(fileName).baseName()); + + return schemaByName(baseName); +} + +JsonSchema *JsonSchemaManager::schemaByName(const QString &baseName) const +{ + QHash<QString, JsonSchemaData>::iterator it = m_schemas.find(baseName); + if (it == m_schemas.end()) { + for (const QString &path : m_searchPaths) { + QFileInfo candidate(path + baseName + ".json"); + if (candidate.exists()) { + m_schemas.insert(baseName, candidate.absoluteFilePath()); + break; + } + } + } + + it = m_schemas.find(baseName); + if (it == m_schemas.end()) + return nullptr; + + JsonSchemaData *schemaData = &it.value(); + if (!schemaData->m_schema) { + // Schemas are built on-demand. + QFileInfo currentSchema(schemaData->m_absoluteFileName); + Q_ASSERT(currentSchema.exists()); + if (schemaData->m_lastParseAttempt.isNull() + || schemaData->m_lastParseAttempt < currentSchema.lastModified()) { + schemaData->m_schema = parseSchema(currentSchema.absoluteFilePath()); + } + } + + return schemaData->m_schema; +} + +JsonSchema *JsonSchemaManager::parseSchema(const QString &schemaFileName) const +{ + FileReader reader; + if (reader.fetch(FilePath::fromString(schemaFileName), QIODevice::Text)) { + const QString &contents = QString::fromUtf8(reader.data()); + JsonValue *json = JsonValue::create(contents, &m_pool); + if (json && json->kind() == JsonValue::Object) + return new JsonSchema(json->toObject(), this); + } + + return nullptr; +} + +} // QmlJs diff --git a/src/libs/qmljs/jsoncheck.h b/src/libs/qmljs/jsoncheck.h index 6050ff72897..261c349cc30 100644 --- a/src/libs/qmljs/jsoncheck.h +++ b/src/libs/qmljs/jsoncheck.h @@ -9,21 +9,397 @@ #include <qmljs/parser/qmljsastvisitor_p.h> #include <qmljs/qmljsstaticanalysismessage.h> -#include <utils/json.h> - #include <QStack> #include <QList> - namespace QmlJS { +class JsonStringValue; +class JsonDoubleValue; +class JsonIntValue; +class JsonObjectValue; +class JsonArrayValue; +class JsonBooleanValue; +class JsonNullValue; + +class QMLJS_EXPORT JsonMemoryPool +{ +public: + ~JsonMemoryPool(); + + inline void *allocate(size_t size) + { + auto obj = new char[size]; + _objs.append(obj); + return obj; + } + +private: + QList<char *> _objs; +}; + +/*! + * \brief The JsonValue class + */ +class QMLJS_EXPORT JsonValue +{ +public: + enum Kind { + String, + Double, + Int, + Object, + Array, + Boolean, + Null, + Unknown + }; + + virtual ~JsonValue(); + + Kind kind() const { return m_kind; } + static QString kindToString(Kind kind); + + virtual JsonStringValue *toString() { return nullptr; } + virtual JsonDoubleValue *toDouble() { return nullptr; } + virtual JsonIntValue *toInt() { return nullptr; } + virtual JsonObjectValue *toObject() { return nullptr; } + virtual JsonArrayValue *toArray() { return nullptr; } + virtual JsonBooleanValue *toBoolean() { return nullptr; } + virtual JsonNullValue *toNull() { return nullptr; } + + static JsonValue *create(const QString &s, JsonMemoryPool *pool); + void *operator new(size_t size, JsonMemoryPool *pool); + void operator delete(void *); + void operator delete(void *, JsonMemoryPool *); + +protected: + JsonValue(Kind kind); + +private: + static JsonValue *build(const QVariant &varixant, JsonMemoryPool *pool); + + Kind m_kind; +}; + + +/*! + * \brief The JsonStringValue class + */ +class QMLJS_EXPORT JsonStringValue : public JsonValue +{ +public: + JsonStringValue(const QString &value) + : JsonValue(String) + , m_value(value) + {} + + JsonStringValue *toString() override { return this; } + + const QString &value() const { return m_value; } + +private: + QString m_value; +}; + + +/*! + * \brief The JsonDoubleValue class + */ +class QMLJS_EXPORT JsonDoubleValue : public JsonValue +{ +public: + JsonDoubleValue(double value) + : JsonValue(Double) + , m_value(value) + {} + + JsonDoubleValue *toDouble() override { return this; } + + double value() const { return m_value; } + +private: + double m_value; +}; + +/*! + * \brief The JsonIntValue class + */ +class QMLJS_EXPORT JsonIntValue : public JsonValue +{ +public: + JsonIntValue(int value) + : JsonValue(Int) + , m_value(value) + {} + + JsonIntValue *toInt() override { return this; } + + int value() const { return m_value; } + +private: + int m_value; +}; + + +/*! + * \brief The JsonObjectValue class + */ +class QMLJS_EXPORT JsonObjectValue : public JsonValue +{ +public: + JsonObjectValue() + : JsonValue(Object) + {} + + JsonObjectValue *toObject() override { return this; } + + void addMember(const QString &name, JsonValue *value) { m_members.insert(name, value); } + bool hasMember(const QString &name) const { return m_members.contains(name); } + JsonValue *member(const QString &name) const { return m_members.value(name); } + QHash<QString, JsonValue *> members() const { return m_members; } + bool isEmpty() const { return m_members.isEmpty(); } + +protected: + JsonObjectValue(Kind kind) + : JsonValue(kind) + {} + +private: + QHash<QString, JsonValue *> m_members; +}; + + +/*! + * \brief The JsonArrayValue class + */ +class QMLJS_EXPORT JsonArrayValue : public JsonValue +{ +public: + JsonArrayValue() + : JsonValue(Array) + {} + + JsonArrayValue *toArray() override { return this; } + + void addElement(JsonValue *value) { m_elements.append(value); } + QList<JsonValue *> elements() const { return m_elements; } + int size() const { return m_elements.size(); } + +private: + QList<JsonValue *> m_elements; +}; + + +/*! + * \brief The JsonBooleanValue class + */ +class QMLJS_EXPORT JsonBooleanValue : public JsonValue +{ +public: + JsonBooleanValue(bool value) + : JsonValue(Boolean) + , m_value(value) + {} + + JsonBooleanValue *toBoolean() override { return this; } + + bool value() const { return m_value; } + +private: + bool m_value; +}; + +class QMLJS_EXPORT JsonNullValue : public JsonValue +{ +public: + JsonNullValue() + : JsonValue(Null) + {} + + JsonNullValue *toNull() override { return this; } +}; + +class JsonSchemaManager; + +/*! + * \brief The JsonSchema class + * + * [NOTE: This is an incomplete implementation and a work in progress.] + * + * This class provides an interface for traversing and evaluating a JSON schema, as described + * in the draft http://tools.ietf.org/html/draft-zyp-json-schema-03. + * + * JSON schemas are recursive in concept. This means that a particular attribute from a schema + * might be also another schema. Therefore, the basic working principle of this API is that + * from within some schema, one can investigate its attributes and if necessary "enter" a + * corresponding nested schema. Afterwards, it's expected that one would "leave" such nested + * schema. + * + * All functions assume that the current "context" is a valid schema. Once an instance of this + * class is created the root schema is put on top of the stack. + * + */ +class QMLJS_EXPORT JsonSchema +{ +public: + bool isTypeConstrained() const; + bool acceptsType(const QString &type) const; + QStringList validTypes() const; + + // Applicable on schemas of any type. + bool required() const; + + bool hasTypeSchema() const; + void enterNestedTypeSchema(); + + bool hasUnionSchema() const; + int unionSchemaSize() const; + bool maybeEnterNestedUnionSchema(int index); + + void leaveNestedSchema(); + + // Applicable on schemas of type number/integer. + bool hasMinimum() const; + bool hasMaximum() const; + bool hasExclusiveMinimum(); + bool hasExclusiveMaximum(); + double minimum() const; + double maximum() const; + + // Applicable on schemas of type string. + QString pattern() const; + int minimumLength() const; + int maximumLength() const; + + // Applicable on schemas of type object. + QStringList properties() const; + bool hasPropertySchema(const QString &property) const; + void enterNestedPropertySchema(const QString &property); + + // Applicable on schemas of type array. + bool hasAdditionalItems() const; + + bool hasItemSchema() const; + void enterNestedItemSchema(); + + bool hasItemArraySchema() const; + int itemArraySchemaSize() const; + bool maybeEnterNestedArraySchema(int index); + +private: + friend class JsonSchemaManager; + JsonSchema(JsonObjectValue *rootObject, const JsonSchemaManager *manager); + Q_DISABLE_COPY(JsonSchema) + + enum EvaluationMode { + Normal, + Array, + Union + }; + + void enter(JsonObjectValue *ov, EvaluationMode eval = Normal, int index = -1); + bool maybeEnter(JsonValue *v, EvaluationMode eval, int index); + void evaluate(EvaluationMode eval, int index); + void leave(); + + JsonObjectValue *resolveReference(JsonObjectValue *ov) const; + JsonObjectValue *resolveBase(JsonObjectValue *ov) const; + + JsonObjectValue *currentValue() const; + int currentIndex() const; + + JsonObjectValue *rootValue() const; + + static JsonStringValue *getStringValue(const QString &name, JsonObjectValue *value); + static JsonObjectValue *getObjectValue(const QString &name, JsonObjectValue *value); + static JsonBooleanValue *getBooleanValue(const QString &name, JsonObjectValue *value); + static JsonArrayValue *getArrayValue(const QString &name, JsonObjectValue *value); + static JsonDoubleValue *getDoubleValue(const QString &name, JsonObjectValue *value); + + static QStringList validTypes(JsonObjectValue *v); + static bool typeMatches(const QString &expected, const QString &actual); + static bool isCheckableType(const QString &s); + + QStringList properties(JsonObjectValue *v) const; + JsonObjectValue *propertySchema(const QString &property, JsonObjectValue *v) const; + // TODO: Similar functions for other attributes which require looking into base schemas. + + static bool maybeSchemaName(const QString &s); + + static QString kType(); + static QString kProperties(); + static QString kPatternProperties(); + static QString kAdditionalProperties(); + static QString kItems(); + static QString kAdditionalItems(); + static QString kRequired(); + static QString kDependencies(); + static QString kMinimum(); + static QString kMaximum(); + static QString kExclusiveMinimum(); + static QString kExclusiveMaximum(); + static QString kMinItems(); + static QString kMaxItems(); + static QString kUniqueItems(); + static QString kPattern(); + static QString kMinLength(); + static QString kMaxLength(); + static QString kTitle(); + static QString kDescription(); + static QString kExtends(); + static QString kRef(); + + struct Context + { + JsonObjectValue *m_value; + EvaluationMode m_eval; + int m_index; + }; + + QList<Context> m_schemas; + const JsonSchemaManager *m_manager; +}; + + +/*! + * \brief The JsonSchemaManager class + */ +class QMLJS_EXPORT JsonSchemaManager +{ +public: + JsonSchemaManager(const QStringList &searchPaths); + ~JsonSchemaManager(); + + JsonSchema *schemaForFile(const QString &fileName) const; + JsonSchema *schemaByName(const QString &baseName) const; + +private: + struct JsonSchemaData + { + JsonSchemaData(const QString &absoluteFileName, JsonSchema *schema = nullptr) + : m_absoluteFileName(absoluteFileName) + , m_schema(schema) + {} + QString m_absoluteFileName; + JsonSchema *m_schema; + QDateTime m_lastParseAttempt; + }; + + JsonSchema *parseSchema(const QString &schemaFileName) const; + + QStringList m_searchPaths; + mutable QHash<QString, JsonSchemaData> m_schemas; + mutable JsonMemoryPool m_pool; +}; + class QMLJS_EXPORT JsonCheck : public AST::Visitor { public: JsonCheck(Document::Ptr doc); ~JsonCheck(); - QList<StaticAnalysis::Message> operator()(Utils::JsonSchema *schema); + QList<StaticAnalysis::Message> operator()(JsonSchema *schema); private: bool preVisit(AST::Node *) override; @@ -52,14 +428,14 @@ private: }; void processSchema(AST::Node *ast); - bool proceedCheck(Utils::JsonValue::Kind kind, const SourceLocation &location); + bool proceedCheck(JsonValue::Kind kind, const SourceLocation &location); AnalysisData *analysis(); Document::Ptr m_doc; SourceLocation m_firstLoc; - Utils::JsonSchema *m_schema; + JsonSchema *m_schema; QStack<AnalysisData> m_analysis; }; -} // QmlJs +} // QmlJS diff --git a/src/libs/qmljs/qmljsbundle.cpp b/src/libs/qmljs/qmljsbundle.cpp index e4d536a3da2..28f88fca452 100644 --- a/src/libs/qmljs/qmljsbundle.cpp +++ b/src/libs/qmljs/qmljsbundle.cpp @@ -3,7 +3,7 @@ #include "qmljsbundle.h" -#include <utils/json.h> +#include "jsoncheck.h" #include <QString> #include <QFile> @@ -11,6 +11,7 @@ #include <QTextStream> #include <QHash> + namespace QmlJS { typedef PersistentTrie::Trie Trie; @@ -45,19 +46,16 @@ Trie QmlBundle::implicitImports() const return m_implicitImports; } - Trie QmlBundle::supportedImports() const { return m_supportedImports; } - void QmlBundle::merge(const QmlBundle &o) { *this = mergeF(o); } - void QmlBundle::intersect(const QmlBundle &o) { *this = intersectF(o); @@ -186,7 +184,7 @@ QString QmlBundle::toString(const QString &indent) return res; } -QStringList QmlBundle::maybeReadTrie(Trie &trie, Utils::JsonObjectValue *config, +QStringList QmlBundle::maybeReadTrie(Trie &trie, JsonObjectValue *config, const QString &path, const QString &propertyName, bool required, bool stripVersions) { @@ -198,12 +196,13 @@ QStringList QmlBundle::maybeReadTrie(Trie &trie, Utils::JsonObjectValue *config, path); return res; } - Utils::JsonValue *imp0 = config->member(propertyName); - Utils::JsonArrayValue *imp = ((imp0 != nullptr) ? imp0->toArray() : nullptr); + + JsonValue *imp0 = config->member(propertyName); + JsonArrayValue *imp = ((imp0 != nullptr) ? imp0->toArray() : nullptr); if (imp != nullptr) { - const QList<Utils::JsonValue *> elements = imp->elements(); - for (Utils::JsonValue *v : elements) { - Utils::JsonStringValue *impStr = ((v != nullptr) ? v->toString() : nullptr); + const QList<JsonValue *> elements = imp->elements(); + for (JsonValue *v : elements) { + JsonStringValue *impStr = ((v != nullptr) ? v->toString() : nullptr); if (impStr != nullptr) { QString value = impStr->value(); if (stripVersions) { @@ -228,9 +227,8 @@ QStringList QmlBundle::maybeReadTrie(Trie &trie, Utils::JsonObjectValue *config, bool QmlBundle::readFrom(QString path, bool stripVersions, QStringList *errors) { - Utils::JsonMemoryPool pool; + JsonMemoryPool pool; - using namespace Utils; QFile f(path); if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) { if (errors) diff --git a/src/libs/qmljs/qmljsbundle.h b/src/libs/qmljs/qmljsbundle.h index 5d2058eef48..ebc0d49e251 100644 --- a/src/libs/qmljs/qmljsbundle.h +++ b/src/libs/qmljs/qmljsbundle.h @@ -12,10 +12,10 @@ QT_FORWARD_DECLARE_CLASS(QTextStream) -namespace Utils { class JsonObjectValue; } - namespace QmlJS { +class JsonObjectValue; + /* ! \class QmlJS::QmlBundle @@ -59,7 +59,7 @@ public: private: static void printEscaped(QTextStream &s, const QString &str); static void writeTrie(QTextStream &stream, const Trie &t, const QString &indent); - QStringList maybeReadTrie(Trie &trie, Utils::JsonObjectValue *config, const QString &path, + QStringList maybeReadTrie(Trie &trie, JsonObjectValue *config, const QString &path, const QString &propertyName, bool required = false, bool stripVersions = false); @@ -80,4 +80,5 @@ public: private: QHash<Dialect,QmlBundle> m_bundles; }; + } // namespace QmlJS diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 357ca1f85b9..1885bc013ad 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -80,7 +80,6 @@ add_qtc_library(Utils infobar.cpp infobar.h infolabel.cpp infolabel.h itemviews.cpp itemviews.h - json.cpp json.h jsontreeitem.cpp jsontreeitem.h launcherinterface.cpp launcherinterface.h launcherpackets.cpp launcherpackets.h diff --git a/src/libs/utils/json.cpp b/src/libs/utils/json.cpp deleted file mode 100644 index d0f2518af32..00000000000 --- a/src/libs/utils/json.cpp +++ /dev/null @@ -1,722 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "json.h" - -#include "fileutils.h" -#include "qtcassert.h" - -#include <QDir> -#include <QJsonDocument> - -using namespace Utils; - -JsonMemoryPool::~JsonMemoryPool() -{ - for (char *obj : std::as_const(_objs)) { - reinterpret_cast<JsonValue *>(obj)->~JsonValue(); - delete[] obj; - } -} - -JsonValue::JsonValue(Kind kind) - : m_kind(kind) -{} - -JsonValue::~JsonValue() = default; - -JsonValue *JsonValue::create(const QString &s, JsonMemoryPool *pool) -{ - const QJsonDocument document = QJsonDocument::fromJson(s.toUtf8()); - if (document.isNull()) - return nullptr; - - return build(document.toVariant(), pool); -} - -void *JsonValue::operator new(size_t size, JsonMemoryPool *pool) -{ return pool->allocate(size); } - -void JsonValue::operator delete(void *) -{ } - -void JsonValue::operator delete(void *, JsonMemoryPool *) -{ } - -QString JsonValue::kindToString(JsonValue::Kind kind) -{ - if (kind == String) - return QLatin1String("string"); - if (kind == Double) - return QLatin1String("number"); - if (kind == Int) - return QLatin1String("integer"); - if (kind == Object) - return QLatin1String("object"); - if (kind == Array) - return QLatin1String("array"); - if (kind == Boolean) - return QLatin1String("boolean"); - if (kind == Null) - return QLatin1String("null"); - - return QLatin1String("unknown"); -} - -JsonValue *JsonValue::build(const QVariant &variant, JsonMemoryPool *pool) -{ - switch (variant.typeId()) { - - case QVariant::List: { - auto newValue = new (pool) JsonArrayValue; - const QList<QVariant> list = variant.toList(); - for (const QVariant &element : list) - newValue->addElement(build(element, pool)); - return newValue; - } - - case QVariant::Map: { - auto newValue = new (pool) JsonObjectValue; - const QVariantMap variantMap = variant.toMap(); - for (QVariantMap::const_iterator it = variantMap.begin(); it != variantMap.end(); ++it) - newValue->addMember(it.key(), build(it.value(), pool)); - return newValue; - } - - case QVariant::String: - return new (pool) JsonStringValue(variant.toString()); - - case QVariant::Int: - return new (pool) JsonIntValue(variant.toInt()); - - case QVariant::Double: - return new (pool) JsonDoubleValue(variant.toDouble()); - - case QVariant::Bool: - return new (pool) JsonBooleanValue(variant.toBool()); - - case QVariant::Invalid: - return new (pool) JsonNullValue; - - default: - break; - } - - return nullptr; -} - - -/////////////////////////////////////////////////////////////////////////////// - -QString JsonSchema::kType() { return QStringLiteral("type"); } -QString JsonSchema::kProperties() { return QStringLiteral("properties"); } -QString JsonSchema::kPatternProperties() { return QStringLiteral("patternProperties"); } -QString JsonSchema::kAdditionalProperties() { return QStringLiteral("additionalProperties"); } -QString JsonSchema::kItems() { return QStringLiteral("items"); } -QString JsonSchema::kAdditionalItems() { return QStringLiteral("additionalItems"); } -QString JsonSchema::kRequired() { return QStringLiteral("required"); } -QString JsonSchema::kDependencies() { return QStringLiteral("dependencies"); } -QString JsonSchema::kMinimum() { return QStringLiteral("minimum"); } -QString JsonSchema::kMaximum() { return QStringLiteral("maximum"); } -QString JsonSchema::kExclusiveMinimum() { return QStringLiteral("exclusiveMinimum"); } -QString JsonSchema::kExclusiveMaximum() { return QStringLiteral("exclusiveMaximum"); } -QString JsonSchema::kMinItems() { return QStringLiteral("minItems"); } -QString JsonSchema::kMaxItems() { return QStringLiteral("maxItems"); } -QString JsonSchema::kUniqueItems() { return QStringLiteral("uniqueItems"); } -QString JsonSchema::kPattern() { return QStringLiteral("pattern"); } -QString JsonSchema::kMinLength() { return QStringLiteral("minLength"); } -QString JsonSchema::kMaxLength() { return QStringLiteral("maxLength"); } -QString JsonSchema::kTitle() { return QStringLiteral("title"); } -QString JsonSchema::kDescription() { return QStringLiteral("description"); } -QString JsonSchema::kExtends() { return QStringLiteral("extends"); } -QString JsonSchema::kRef() { return QStringLiteral("$ref"); } - -JsonSchema::JsonSchema(JsonObjectValue *rootObject, const JsonSchemaManager *manager) - : m_manager(manager) -{ - enter(rootObject); -} - -bool JsonSchema::isTypeConstrained() const -{ - // Simple types - if (JsonStringValue *sv = getStringValue(kType(), currentValue())) - return isCheckableType(sv->value()); - - // Union types - if (JsonArrayValue *av = getArrayValue(kType(), currentValue())) { - QTC_ASSERT(currentIndex() != -1, return false); - QTC_ASSERT(av->elements().at(currentIndex())->kind() == JsonValue::String, return false); - JsonStringValue *sv = av->elements().at(currentIndex())->toString(); - return isCheckableType(sv->value()); - } - - return false; -} - -bool JsonSchema::acceptsType(const QString &type) const -{ - // Simple types - if (JsonStringValue *sv = getStringValue(kType(), currentValue())) - return typeMatches(sv->value(), type); - - // Union types - if (JsonArrayValue *av = getArrayValue(kType(), currentValue())) { - QTC_ASSERT(currentIndex() != -1, return false); - QTC_ASSERT(av->elements().at(currentIndex())->kind() == JsonValue::String, return false); - JsonStringValue *sv = av->elements().at(currentIndex())->toString(); - return typeMatches(sv->value(), type); - } - - return false; -} - -QStringList JsonSchema::validTypes(JsonObjectValue *v) -{ - QStringList all; - - if (JsonStringValue *sv = getStringValue(kType(), v)) - all.append(sv->value()); - - if (JsonObjectValue *ov = getObjectValue(kType(), v)) - return validTypes(ov); - - if (JsonArrayValue *av = getArrayValue(kType(), v)) { - const QList<JsonValue *> elements = av->elements(); - for (JsonValue *v : elements) { - if (JsonStringValue *sv = v->toString()) - all.append(sv->value()); - else if (JsonObjectValue *ov = v->toObject()) - all.append(validTypes(ov)); - } - } - - return all; -} - -bool JsonSchema::typeMatches(const QString &expected, const QString &actual) -{ - if (expected == QLatin1String("number") && actual == QLatin1String("integer")) - return true; - - return expected == actual; -} - -bool JsonSchema::isCheckableType(const QString &s) -{ - return s == QLatin1String("string") - || s == QLatin1String("number") - || s == QLatin1String("integer") - || s == QLatin1String("boolean") - || s == QLatin1String("object") - || s == QLatin1String("array") - || s == QLatin1String("null"); -} - -QStringList JsonSchema::validTypes() const -{ - return validTypes(currentValue()); -} - -bool JsonSchema::hasTypeSchema() const -{ - return getObjectValue(kType(), currentValue()); -} - -void JsonSchema::enterNestedTypeSchema() -{ - QTC_ASSERT(hasTypeSchema(), return); - - enter(getObjectValue(kType(), currentValue())); -} - -QStringList JsonSchema::properties(JsonObjectValue *v) const -{ - using Members = QHash<QString, JsonValue *>; - - QStringList all; - - if (JsonObjectValue *ov = getObjectValue(kProperties(), v)) { - const Members members = ov->members(); - const Members::ConstIterator cend = members.constEnd(); - for (Members::ConstIterator it = members.constBegin(); it != cend; ++it) - if (hasPropertySchema(it.key())) - all.append(it.key()); - } - - if (JsonObjectValue *base = resolveBase(v)) - all.append(properties(base)); - - return all; -} - -QStringList JsonSchema::properties() const -{ - QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Object)), return {}); - - return properties(currentValue()); -} - -JsonObjectValue *JsonSchema::propertySchema(const QString &property, - JsonObjectValue *v) const -{ - if (JsonObjectValue *ov = getObjectValue(kProperties(), v)) { - JsonValue *member = ov->member(property); - if (member && member->kind() == JsonValue::Object) - return member->toObject(); - } - - if (JsonObjectValue *base = resolveBase(v)) - return propertySchema(property, base); - - return nullptr; -} - -bool JsonSchema::hasPropertySchema(const QString &property) const -{ - return propertySchema(property, currentValue()); -} - -void JsonSchema::enterNestedPropertySchema(const QString &property) -{ - QTC_ASSERT(hasPropertySchema(property), return); - - JsonObjectValue *schema = propertySchema(property, currentValue()); - - enter(schema); -} - -/*! - * An array schema is allowed to have its \e items specification in the form of - * another schema - * or in the form of an array of schemas [Sec. 5.5]. This functions checks whether this is case - * in which the items are a schema. - * - * Returns whether or not the items from the array are a schema. - */ -bool JsonSchema::hasItemSchema() const -{ - QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Array)), return false); - - return getObjectValue(kItems(), currentValue()); -} - -void JsonSchema::enterNestedItemSchema() -{ - QTC_ASSERT(hasItemSchema(), return); - - enter(getObjectValue(kItems(), currentValue())); -} - -/*! - * An array schema is allowed to have its \e items specification in the form of another schema - * or in the form of an array of schemas [Sec. 5.5]. This functions checks whether this is case - * in which the items are an array of schemas. - * - * Returns whether or not the items from the array are a an array of schemas. - */ -bool JsonSchema::hasItemArraySchema() const -{ - QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Array)), return false); - - return getArrayValue(kItems(), currentValue()); -} - -int JsonSchema::itemArraySchemaSize() const -{ - QTC_ASSERT(hasItemArraySchema(), return false); - - return getArrayValue(kItems(), currentValue())->size(); -} - -/*! - * When evaluating the items of an array it might be necessary to \e enter a - * particular schema, - * since this API assumes that there's always a valid schema in context (the one the user is - * interested on). This shall only happen if the item at the supplied array index is of type - * object, which is then assumed to be a schema. - * - * The function also marks the context as being inside an array evaluation. - * - * Returns whether it was necessary to enter a schema for the supplied - * array \a index, false if index is out of bounds. - */ -bool JsonSchema::maybeEnterNestedArraySchema(int index) -{ - QTC_ASSERT(itemArraySchemaSize(), return false); - QTC_ASSERT(index >= 0 && index < itemArraySchemaSize(), return false); - - JsonValue *v = getArrayValue(kItems(), currentValue())->elements().at(index); - - return maybeEnter(v, Array, index); -} - -/*! - * The type of a schema can be specified in the form of a union type, which is basically an - * array of allowed types for the particular instance [Sec. 5.1]. This function checks whether - * the current schema is one of such. - * - * Returns whether or not the current schema specifies a union type. - */ -bool JsonSchema::hasUnionSchema() const -{ - return getArrayValue(kType(), currentValue()); -} - -int JsonSchema::unionSchemaSize() const -{ - return getArrayValue(kType(), currentValue())->size(); -} - -/*! - * When evaluating union types it might be necessary to enter a particular - * schema, since this - * API assumes that there's always a valid schema in context (the one the user is interested on). - * This shall only happen if the item at the supplied union \a index, which is then assumed to be - * a schema. - * - * The function also marks the context as being inside an union evaluation. - * - * Returns whether or not it was necessary to enter a schema for the - * supplied union index. - */ -bool JsonSchema::maybeEnterNestedUnionSchema(int index) -{ - QTC_ASSERT(unionSchemaSize(), return false); - QTC_ASSERT(index >= 0 && index < unionSchemaSize(), return false); - - JsonValue *v = getArrayValue(kType(), currentValue())->elements().at(index); - - return maybeEnter(v, Union, index); -} - -void JsonSchema::leaveNestedSchema() -{ - QTC_ASSERT(!m_schemas.isEmpty(), return); - - leave(); -} - -bool JsonSchema::required() const -{ - if (JsonBooleanValue *bv = getBooleanValue(kRequired(), currentValue())) - return bv->value(); - - return false; -} - -bool JsonSchema::hasMinimum() const -{ - QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Int)), return false); - - return getDoubleValue(kMinimum(), currentValue()); -} - -double JsonSchema::minimum() const -{ - QTC_ASSERT(hasMinimum(), return 0); - - return getDoubleValue(kMinimum(), currentValue())->value(); -} - -bool JsonSchema::hasExclusiveMinimum() -{ - QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Int)), return false); - - if (JsonBooleanValue *bv = getBooleanValue(kExclusiveMinimum(), currentValue())) - return bv->value(); - - return false; -} - -bool JsonSchema::hasMaximum() const -{ - QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Int)), return false); - - return getDoubleValue(kMaximum(), currentValue()); -} - -double JsonSchema::maximum() const -{ - QTC_ASSERT(hasMaximum(), return 0); - - return getDoubleValue(kMaximum(), currentValue())->value(); -} - -bool JsonSchema::hasExclusiveMaximum() -{ - QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Int)), return false); - - if (JsonBooleanValue *bv = getBooleanValue(kExclusiveMaximum(), currentValue())) - return bv->value(); - - return false; -} - -QString JsonSchema::pattern() const -{ - QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::String)), return QString()); - - if (JsonStringValue *sv = getStringValue(kPattern(), currentValue())) - return sv->value(); - - return QString(); -} - -int JsonSchema::minimumLength() const -{ - QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::String)), return -1); - - if (JsonDoubleValue *dv = getDoubleValue(kMinLength(), currentValue())) - return dv->value(); - - return -1; -} - -int JsonSchema::maximumLength() const -{ - QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::String)), return -1); - - if (JsonDoubleValue *dv = getDoubleValue(kMaxLength(), currentValue())) - return dv->value(); - - return -1; -} - -bool JsonSchema::hasAdditionalItems() const -{ - QTC_ASSERT(acceptsType(JsonValue::kindToString(JsonValue::Array)), return false); - - return currentValue()->member(kAdditionalItems()); -} - -bool JsonSchema::maybeSchemaName(const QString &s) -{ - if (s.isEmpty() || s == QLatin1String("any")) - return false; - - return !isCheckableType(s); -} - -JsonObjectValue *JsonSchema::rootValue() const -{ - QTC_ASSERT(!m_schemas.isEmpty(), return nullptr); - - return m_schemas.first().m_value; -} - -JsonObjectValue *JsonSchema::currentValue() const -{ - QTC_ASSERT(!m_schemas.isEmpty(), return nullptr); - - return m_schemas.last().m_value; -} - -int JsonSchema::currentIndex() const -{ - QTC_ASSERT(!m_schemas.isEmpty(), return 0); - - return m_schemas.last().m_index; -} - -void JsonSchema::evaluate(EvaluationMode eval, int index) -{ - QTC_ASSERT(!m_schemas.isEmpty(), return); - - m_schemas.last().m_eval = eval; - m_schemas.last().m_index = index; -} - -void JsonSchema::enter(JsonObjectValue *ov, EvaluationMode eval, int index) -{ - Context context; - context.m_eval = eval; - context.m_index = index; - context.m_value = resolveReference(ov); - - m_schemas.push_back(context); -} - -bool JsonSchema::maybeEnter(JsonValue *v, EvaluationMode eval, int index) -{ - evaluate(eval, index); - - if (v->kind() == JsonValue::Object) { - enter(v->toObject()); - return true; - } - - if (v->kind() == JsonValue::String) { - const QString &s = v->toString()->value(); - if (maybeSchemaName(s)) { - JsonSchema *schema = m_manager->schemaByName(s); - if (schema) { - enter(schema->rootValue()); - return true; - } - } - } - - return false; -} - -void JsonSchema::leave() -{ - QTC_ASSERT(!m_schemas.isEmpty(), return); - - m_schemas.pop_back(); -} - -JsonObjectValue *JsonSchema::resolveReference(JsonObjectValue *ov) const -{ - if (JsonStringValue *sv = getStringValue(kRef(), ov)) { - JsonSchema *referenced = m_manager->schemaByName(sv->value()); - if (referenced) - return referenced->rootValue(); - } - - return ov; -} - -JsonObjectValue *JsonSchema::resolveBase(JsonObjectValue *ov) const -{ - if (JsonValue *v = ov->member(kExtends())) { - if (v->kind() == JsonValue::String) { - JsonSchema *schema = m_manager->schemaByName(v->toString()->value()); - if (schema) - return schema->rootValue(); - } else if (v->kind() == JsonValue::Object) { - return resolveReference(v->toObject()); - } - } - - return nullptr; -} - -JsonStringValue *JsonSchema::getStringValue(const QString &name, JsonObjectValue *value) -{ - JsonValue *v = value->member(name); - if (!v) - return nullptr; - - return v->toString(); -} - -JsonObjectValue *JsonSchema::getObjectValue(const QString &name, JsonObjectValue *value) -{ - JsonValue *v = value->member(name); - if (!v) - return nullptr; - - return v->toObject(); -} - -JsonBooleanValue *JsonSchema::getBooleanValue(const QString &name, JsonObjectValue *value) -{ - JsonValue *v = value->member(name); - if (!v) - return nullptr; - - return v->toBoolean(); -} - -JsonArrayValue *JsonSchema::getArrayValue(const QString &name, JsonObjectValue *value) -{ - JsonValue *v = value->member(name); - if (!v) - return nullptr; - - return v->toArray(); -} - -JsonDoubleValue *JsonSchema::getDoubleValue(const QString &name, JsonObjectValue *value) -{ - JsonValue *v = value->member(name); - if (!v) - return nullptr; - - return v->toDouble(); -} - - -/////////////////////////////////////////////////////////////////////////////// - -JsonSchemaManager::JsonSchemaManager(const QStringList &searchPaths) - : m_searchPaths(searchPaths) -{ - for (const QString &path : searchPaths) { - QDir dir(path); - if (!dir.exists()) - continue; - dir.setNameFilters(QStringList(QLatin1String("*.json"))); - const QList<QFileInfo> entries = dir.entryInfoList(); - for (const QFileInfo &fi : entries) - m_schemas.insert(fi.baseName(), JsonSchemaData(fi.absoluteFilePath())); - } -} - -JsonSchemaManager::~JsonSchemaManager() -{ - for (const JsonSchemaData &schemaData : std::as_const(m_schemas)) - delete schemaData.m_schema; -} - -/*! - * Tries to find a JSON schema to validate \a fileName against. According - * to the specification, how the schema/instance association is done is implementation defined. - * Currently we use a quite naive approach which is simply based on file names. Specifically, - * if one opens a foo.json file we'll look for a schema named foo.json. We should probably - * investigate alternative settings later. - * - * Returns a valid schema or 0. - */ -JsonSchema *JsonSchemaManager::schemaForFile(const QString &fileName) const -{ - QString baseName(QFileInfo(fileName).baseName()); - - return schemaByName(baseName); -} - -JsonSchema *JsonSchemaManager::schemaByName(const QString &baseName) const -{ - QHash<QString, JsonSchemaData>::iterator it = m_schemas.find(baseName); - if (it == m_schemas.end()) { - for (const QString &path : m_searchPaths) { - QFileInfo candidate(path + baseName + ".json"); - if (candidate.exists()) { - m_schemas.insert(baseName, candidate.absoluteFilePath()); - break; - } - } - } - - it = m_schemas.find(baseName); - if (it == m_schemas.end()) - return nullptr; - - JsonSchemaData *schemaData = &it.value(); - if (!schemaData->m_schema) { - // Schemas are built on-demand. - QFileInfo currentSchema(schemaData->m_absoluteFileName); - Q_ASSERT(currentSchema.exists()); - if (schemaData->m_lastParseAttempt.isNull() - || schemaData->m_lastParseAttempt < currentSchema.lastModified()) { - schemaData->m_schema = parseSchema(currentSchema.absoluteFilePath()); - } - } - - return schemaData->m_schema; -} - -JsonSchema *JsonSchemaManager::parseSchema(const QString &schemaFileName) const -{ - FileReader reader; - if (reader.fetch(FilePath::fromString(schemaFileName), QIODevice::Text)) { - const QString &contents = QString::fromUtf8(reader.data()); - JsonValue *json = JsonValue::create(contents, &m_pool); - if (json && json->kind() == JsonValue::Object) - return new JsonSchema(json->toObject(), this); - } - - return nullptr; -} diff --git a/src/libs/utils/json.h b/src/libs/utils/json.h deleted file mode 100644 index 4872760ed30..00000000000 --- a/src/libs/utils/json.h +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "utils_global.h" - -#include <QDateTime> -#include <QHash> -#include <QStringList> - -QT_BEGIN_NAMESPACE -class QVariant; -QT_END_NAMESPACE - -namespace Utils { - -class JsonStringValue; -class JsonDoubleValue; -class JsonIntValue; -class JsonObjectValue; -class JsonArrayValue; -class JsonBooleanValue; -class JsonNullValue; - -class QTCREATOR_UTILS_EXPORT JsonMemoryPool -{ -public: - ~JsonMemoryPool(); - - inline void *allocate(size_t size) - { - auto obj = new char[size]; - _objs.append(obj); - return obj; - } - -private: - QList<char *> _objs; -}; - -/*! - * \brief The JsonValue class - */ -class QTCREATOR_UTILS_EXPORT JsonValue -{ -public: - enum Kind { - String, - Double, - Int, - Object, - Array, - Boolean, - Null, - Unknown - }; - - virtual ~JsonValue(); - - Kind kind() const { return m_kind; } - static QString kindToString(Kind kind); - - virtual JsonStringValue *toString() { return nullptr; } - virtual JsonDoubleValue *toDouble() { return nullptr; } - virtual JsonIntValue *toInt() { return nullptr; } - virtual JsonObjectValue *toObject() { return nullptr; } - virtual JsonArrayValue *toArray() { return nullptr; } - virtual JsonBooleanValue *toBoolean() { return nullptr; } - virtual JsonNullValue *toNull() { return nullptr; } - - static JsonValue *create(const QString &s, JsonMemoryPool *pool); - void *operator new(size_t size, JsonMemoryPool *pool); - void operator delete(void *); - void operator delete(void *, JsonMemoryPool *); - -protected: - JsonValue(Kind kind); - -private: - static JsonValue *build(const QVariant &varixant, JsonMemoryPool *pool); - - Kind m_kind; -}; - - -/*! - * \brief The JsonStringValue class - */ -class QTCREATOR_UTILS_EXPORT JsonStringValue : public JsonValue -{ -public: - JsonStringValue(const QString &value) - : JsonValue(String) - , m_value(value) - {} - - JsonStringValue *toString() override { return this; } - - const QString &value() const { return m_value; } - -private: - QString m_value; -}; - - -/*! - * \brief The JsonDoubleValue class - */ -class QTCREATOR_UTILS_EXPORT JsonDoubleValue : public JsonValue -{ -public: - JsonDoubleValue(double value) - : JsonValue(Double) - , m_value(value) - {} - - JsonDoubleValue *toDouble() override { return this; } - - double value() const { return m_value; } - -private: - double m_value; -}; - -/*! - * \brief The JsonIntValue class - */ -class QTCREATOR_UTILS_EXPORT JsonIntValue : public JsonValue -{ -public: - JsonIntValue(int value) - : JsonValue(Int) - , m_value(value) - {} - - JsonIntValue *toInt() override { return this; } - - int value() const { return m_value; } - -private: - int m_value; -}; - - -/*! - * \brief The JsonObjectValue class - */ -class QTCREATOR_UTILS_EXPORT JsonObjectValue : public JsonValue -{ -public: - JsonObjectValue() - : JsonValue(Object) - {} - - JsonObjectValue *toObject() override { return this; } - - void addMember(const QString &name, JsonValue *value) { m_members.insert(name, value); } - bool hasMember(const QString &name) const { return m_members.contains(name); } - JsonValue *member(const QString &name) const { return m_members.value(name); } - QHash<QString, JsonValue *> members() const { return m_members; } - bool isEmpty() const { return m_members.isEmpty(); } - -protected: - JsonObjectValue(Kind kind) - : JsonValue(kind) - {} - -private: - QHash<QString, JsonValue *> m_members; -}; - - -/*! - * \brief The JsonArrayValue class - */ -class QTCREATOR_UTILS_EXPORT JsonArrayValue : public JsonValue -{ -public: - JsonArrayValue() - : JsonValue(Array) - {} - - JsonArrayValue *toArray() override { return this; } - - void addElement(JsonValue *value) { m_elements.append(value); } - QList<JsonValue *> elements() const { return m_elements; } - int size() const { return m_elements.size(); } - -private: - QList<JsonValue *> m_elements; -}; - - -/*! - * \brief The JsonBooleanValue class - */ -class QTCREATOR_UTILS_EXPORT JsonBooleanValue : public JsonValue -{ -public: - JsonBooleanValue(bool value) - : JsonValue(Boolean) - , m_value(value) - {} - - JsonBooleanValue *toBoolean() override { return this; } - - bool value() const { return m_value; } - -private: - bool m_value; -}; - -class QTCREATOR_UTILS_EXPORT JsonNullValue : public JsonValue -{ -public: - JsonNullValue() - : JsonValue(Null) - {} - - JsonNullValue *toNull() override { return this; } -}; - -class JsonSchemaManager; - -/*! - * \brief The JsonSchema class - * - * [NOTE: This is an incomplete implementation and a work in progress.] - * - * This class provides an interface for traversing and evaluating a JSON schema, as described - * in the draft http://tools.ietf.org/html/draft-zyp-json-schema-03. - * - * JSON schemas are recursive in concept. This means that a particular attribute from a schema - * might be also another schema. Therefore, the basic working principle of this API is that - * from within some schema, one can investigate its attributes and if necessary "enter" a - * corresponding nested schema. Afterwards, it's expected that one would "leave" such nested - * schema. - * - * All functions assume that the current "context" is a valid schema. Once an instance of this - * class is created the root schema is put on top of the stack. - * - */ -class QTCREATOR_UTILS_EXPORT JsonSchema -{ -public: - bool isTypeConstrained() const; - bool acceptsType(const QString &type) const; - QStringList validTypes() const; - - // Applicable on schemas of any type. - bool required() const; - - bool hasTypeSchema() const; - void enterNestedTypeSchema(); - - bool hasUnionSchema() const; - int unionSchemaSize() const; - bool maybeEnterNestedUnionSchema(int index); - - void leaveNestedSchema(); - - // Applicable on schemas of type number/integer. - bool hasMinimum() const; - bool hasMaximum() const; - bool hasExclusiveMinimum(); - bool hasExclusiveMaximum(); - double minimum() const; - double maximum() const; - - // Applicable on schemas of type string. - QString pattern() const; - int minimumLength() const; - int maximumLength() const; - - // Applicable on schemas of type object. - QStringList properties() const; - bool hasPropertySchema(const QString &property) const; - void enterNestedPropertySchema(const QString &property); - - // Applicable on schemas of type array. - bool hasAdditionalItems() const; - - bool hasItemSchema() const; - void enterNestedItemSchema(); - - bool hasItemArraySchema() const; - int itemArraySchemaSize() const; - bool maybeEnterNestedArraySchema(int index); - -private: - friend class JsonSchemaManager; - JsonSchema(JsonObjectValue *rootObject, const JsonSchemaManager *manager); - Q_DISABLE_COPY(JsonSchema) - - enum EvaluationMode { - Normal, - Array, - Union - }; - - void enter(JsonObjectValue *ov, EvaluationMode eval = Normal, int index = -1); - bool maybeEnter(JsonValue *v, EvaluationMode eval, int index); - void evaluate(EvaluationMode eval, int index); - void leave(); - - JsonObjectValue *resolveReference(JsonObjectValue *ov) const; - JsonObjectValue *resolveBase(JsonObjectValue *ov) const; - - JsonObjectValue *currentValue() const; - int currentIndex() const; - - JsonObjectValue *rootValue() const; - - static JsonStringValue *getStringValue(const QString &name, JsonObjectValue *value); - static JsonObjectValue *getObjectValue(const QString &name, JsonObjectValue *value); - static JsonBooleanValue *getBooleanValue(const QString &name, JsonObjectValue *value); - static JsonArrayValue *getArrayValue(const QString &name, JsonObjectValue *value); - static JsonDoubleValue *getDoubleValue(const QString &name, JsonObjectValue *value); - - static QStringList validTypes(JsonObjectValue *v); - static bool typeMatches(const QString &expected, const QString &actual); - static bool isCheckableType(const QString &s); - - QStringList properties(JsonObjectValue *v) const; - JsonObjectValue *propertySchema(const QString &property, JsonObjectValue *v) const; - // TODO: Similar functions for other attributes which require looking into base schemas. - - static bool maybeSchemaName(const QString &s); - - static QString kType(); - static QString kProperties(); - static QString kPatternProperties(); - static QString kAdditionalProperties(); - static QString kItems(); - static QString kAdditionalItems(); - static QString kRequired(); - static QString kDependencies(); - static QString kMinimum(); - static QString kMaximum(); - static QString kExclusiveMinimum(); - static QString kExclusiveMaximum(); - static QString kMinItems(); - static QString kMaxItems(); - static QString kUniqueItems(); - static QString kPattern(); - static QString kMinLength(); - static QString kMaxLength(); - static QString kTitle(); - static QString kDescription(); - static QString kExtends(); - static QString kRef(); - - struct Context - { - JsonObjectValue *m_value; - EvaluationMode m_eval; - int m_index; - }; - - QList<Context> m_schemas; - const JsonSchemaManager *m_manager; -}; - - -/*! - * \brief The JsonSchemaManager class - */ -class QTCREATOR_UTILS_EXPORT JsonSchemaManager -{ -public: - JsonSchemaManager(const QStringList &searchPaths); - ~JsonSchemaManager(); - - JsonSchema *schemaForFile(const QString &fileName) const; - JsonSchema *schemaByName(const QString &baseName) const; - -private: - struct JsonSchemaData - { - JsonSchemaData(const QString &absoluteFileName, JsonSchema *schema = nullptr) - : m_absoluteFileName(absoluteFileName) - , m_schema(schema) - {} - QString m_absoluteFileName; - JsonSchema *m_schema; - QDateTime m_lastParseAttempt; - }; - - JsonSchema *parseSchema(const QString &schemaFileName) const; - - QStringList m_searchPaths; - mutable QHash<QString, JsonSchemaData> m_schemas; - mutable JsonMemoryPool m_pool; -}; - -} // namespace Utils diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index da82da0608c..fc59852fab1 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -171,8 +171,6 @@ Project { "infolabel.h", "itemviews.cpp", "itemviews.h", - "json.cpp", - "json.h", "jsontreeitem.cpp", "jsontreeitem.h", "launcherinterface.cpp", diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp index b0736b29d15..e4b2538dcb9 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.cpp +++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp @@ -7,15 +7,16 @@ #include "qmljseditordocument.h" #include "qmljseditorplugin.h" #include "qmljseditortr.h" -#include "qmljshighlighter.h" #include "qmljsoutline.h" #include "qmljsquickfixassist.h" #include "qmltaskmanager.h" #include "quicktoolbar.h" +#include <qmljs/jsoncheck.h> #include <qmljs/qmljsicons.h> #include <qmljs/qmljsmodelmanagerinterface.h> #include <qmljs/qmljsreformatter.h> + #include <qmljstools/qmljstoolsconstants.h> #include <qmljstools/qmljstoolssettings.h> #include <qmljstools/qmljscodestylepreferences.h> @@ -26,18 +27,20 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/icore.h> + #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projecttree.h> #include <projectexplorer/taskhub.h> + #include <texteditor/command.h> #include <texteditor/formattexteditor.h> #include <texteditor/snippets/snippetprovider.h> #include <texteditor/tabsettings.h> #include <texteditor/texteditor.h> #include <texteditor/texteditorconstants.h> + #include <utils/fsengine/fileiconprovider.h> -#include <utils/json.h> #include <utils/macroexpander.h> #include <utils/qtcassert.h> @@ -77,7 +80,7 @@ public: QPointer<QmlJSEditorDocument> m_currentDocument; - Utils::JsonSchemaManager m_jsonManager{ + QmlJS::JsonSchemaManager m_jsonManager{ {ICore::userResourcePath("json/").toString(), ICore::resourcePath("json/").toString()}}; QmlJSEditorFactory m_qmlJSEditorFactory; @@ -215,7 +218,7 @@ void QmlJSEditorPlugin::extensionsInitialized() QmllsSettingsManager::instance()->setupAutoupdate(); } -Utils::JsonSchemaManager *QmlJSEditorPlugin::jsonManager() +QmlJS::JsonSchemaManager *QmlJSEditorPlugin::jsonManager() { return &m_instance->d->m_jsonManager; } diff --git a/src/plugins/qmljseditor/qmljseditorplugin.h b/src/plugins/qmljseditor/qmljseditorplugin.h index aa653ac6cb0..69d1c477086 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.h +++ b/src/plugins/qmljseditor/qmljseditorplugin.h @@ -5,7 +5,7 @@ #include <extensionsystem/iplugin.h> -namespace Utils { class JsonSchemaManager; } +namespace QmlJS { class JsonSchemaManager; } namespace QmlJSEditor { class QuickToolBar; @@ -23,7 +23,7 @@ public: ~QmlJSEditorPlugin() final; static QmlJSQuickFixAssistProvider *quickFixAssistProvider(); - static Utils::JsonSchemaManager *jsonManager(); + static QmlJS::JsonSchemaManager *jsonManager(); static QuickToolBar *quickToolBar(); private: diff --git a/src/plugins/qmljseditor/qmljssemanticinfoupdater.cpp b/src/plugins/qmljseditor/qmljssemanticinfoupdater.cpp index 764f125e543..44c1a72f952 100644 --- a/src/plugins/qmljseditor/qmljssemanticinfoupdater.cpp +++ b/src/plugins/qmljseditor/qmljssemanticinfoupdater.cpp @@ -14,8 +14,6 @@ #include <coreplugin/icore.h> -#include <utils/json.h> - namespace QmlJSEditor { namespace Internal { @@ -97,7 +95,7 @@ QmlJSTools::SemanticInfo SemanticInfoUpdater::makeNewSemanticInfo(const QmlJS::D semanticInfo.setRootScopeChain(QSharedPointer<const ScopeChain>(scopeChain)); if (doc->language() == Dialect::Json) { - Utils::JsonSchema *schema = QmlJSEditorPlugin::jsonManager()->schemaForFile( + JsonSchema *schema = QmlJSEditorPlugin::jsonManager()->schemaForFile( doc->fileName().toString()); if (schema) { JsonCheck jsonChecker(doc); From e2a370f280d6ba70267b979c6f9c407523539cdc Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 11 Aug 2023 17:30:01 +0200 Subject: [PATCH 0695/1777] LSP: Use 8-bit keys in Json wrapper Sufficient, smaller, faster. Change-Id: I0d740785109538e04fc674c11d578ded8d2815fb Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../clientcapabilities.h | 2 +- src/libs/languageserverprotocol/jsonkeys.h | 430 +++++++++--------- .../languageserverprotocol/jsonobject.cpp | 8 +- src/libs/languageserverprotocol/jsonobject.h | 65 +-- .../languagefeatures.cpp | 4 +- .../languageserverprotocol/languagefeatures.h | 4 +- src/libs/languageserverprotocol/workspace.h | 2 +- src/plugins/clangcodemodel/clangdast.cpp | 4 +- src/plugins/clangcodemodel/clangdclient.cpp | 16 +- .../clangcodemodel/clangdcompletion.cpp | 2 +- .../clangdmemoryusagewidget.cpp | 11 +- .../clangdsemantichighlighting.cpp | 4 +- src/plugins/coco/cocolanguageclient.cpp | 2 +- src/plugins/copilot/requests/checkstatus.h | 8 +- src/plugins/copilot/requests/getcompletions.h | 8 +- src/plugins/copilot/requests/signinconfirm.h | 2 +- src/plugins/copilot/requests/signininitiate.h | 4 +- 17 files changed, 288 insertions(+), 288 deletions(-) diff --git a/src/libs/languageserverprotocol/clientcapabilities.h b/src/libs/languageserverprotocol/clientcapabilities.h index 92f78ae0562..7b18c24a762 100644 --- a/src/libs/languageserverprotocol/clientcapabilities.h +++ b/src/libs/languageserverprotocol/clientcapabilities.h @@ -628,7 +628,7 @@ public: void clearWorkDoneProgress() { remove(workDoneProgressKey); } private: - constexpr static const char16_t workDoneProgressKey[] = u"workDoneProgress"; + constexpr static const char workDoneProgressKey[] = "workDoneProgress"; }; class LANGUAGESERVERPROTOCOL_EXPORT ClientCapabilities : public JsonObject diff --git a/src/libs/languageserverprotocol/jsonkeys.h b/src/libs/languageserverprotocol/jsonkeys.h index 302c57bc209..e7190afce2e 100644 --- a/src/libs/languageserverprotocol/jsonkeys.h +++ b/src/libs/languageserverprotocol/jsonkeys.h @@ -5,220 +5,220 @@ namespace LanguageServerProtocol { -constexpr char16_t actionsKey[] = u"actions"; -constexpr char16_t activeParameterKey[] = u"activeParameter"; -constexpr char16_t activeParameterSupportKey[] = u"activeParameterSupport"; -constexpr char16_t activeSignatureKey[] = u"activeSignature"; -constexpr char16_t addedKey[] = u"added"; -constexpr char16_t additionalTextEditsKey[] = u"additionalTextEdits"; -constexpr char16_t alphaKey[] = u"alpha"; -constexpr char16_t appliedKey[] = u"applied"; -constexpr char16_t applyEditKey[] = u"applyEdit"; -constexpr char16_t argumentsKey[] = u"arguments"; -constexpr char16_t blueKey[] = u"blue"; -constexpr char16_t callHierarchyKey[] = u"callHierarchy"; -constexpr char16_t callHierarchyProviderKey[] = u"callHierarchyProvider"; -constexpr char16_t cancellableKey[] = u"cancellable"; -constexpr char16_t capabilitiesKey[] = u"capabilities"; -constexpr char16_t chKey[] = u"ch"; -constexpr char16_t changeKey[] = u"change"; -constexpr char16_t changeNotificationsKey[] = u"changeNotifications"; -constexpr char16_t changesKey[] = u"changes"; -constexpr char16_t characterKey[] = u"character"; -constexpr char16_t childrenKey[] = u"children"; -constexpr char16_t clientInfoKey[] = u"clientInfo"; -constexpr char16_t codeActionKey[] = u"codeAction"; -constexpr char16_t codeActionKindKey[] = u"codeActionKind"; -constexpr char16_t codeActionKindsKey[] = u"codeActionKinds"; -constexpr char16_t codeActionLiteralSupportKey[] = u"codeActionLiteralSupport"; -constexpr char16_t codeActionProviderKey[] = u"codeActionProvider"; -constexpr char16_t codeKey[] = u"code"; -constexpr char16_t codeLensKey[] = u"codeLens"; -constexpr char16_t codeLensProviderKey[] = u"codeLensProvider"; -constexpr char16_t colorInfoKey[] = u"colorInfo"; -constexpr char16_t colorKey[] = u"color"; -constexpr char16_t colorProviderKey[] = u"colorProvider"; -constexpr char16_t commandKey[] = u"command"; -constexpr char16_t commandsKey[] = u"commands"; -constexpr char16_t commitCharacterSupportKey[] = u"commitCharacterSupport"; -constexpr char16_t commitCharactersKey[] = u"commitCharacters"; -constexpr char16_t completionItemKey[] = u"completionItem"; -constexpr char16_t completionItemKindKey[] = u"completionItemKind"; -constexpr char16_t completionKey[] = u"completion"; -constexpr char16_t completionProviderKey[] = u"completionProvider"; -constexpr char16_t configurationKey[] = u"configuration"; -constexpr char16_t containerNameKey[] = u"containerName"; -constexpr char16_t contentChangesKey[] = u"contentChanges"; -constexpr char16_t contentFormatKey[] = u"contentFormat"; -constexpr char16_t contentKey[] = u"value"; -constexpr char16_t contentsKey[] = u"contents"; -constexpr char16_t contextKey[] = u"context"; -constexpr char16_t contextSupportKey[] = u"contextSupport"; -constexpr char16_t dataKey[] = u"data"; -constexpr char16_t definitionKey[] = u"definition"; -constexpr char16_t definitionProviderKey[] = u"definitionProvider"; -constexpr char16_t deleteCountKey[] = u"deleteCount"; -constexpr char16_t deltaKey[] = u"delta"; -constexpr char16_t deprecatedKey[] = u"deprecated"; -constexpr char16_t detailKey[] = u"detail"; -constexpr char16_t diagnosticsKey[] = u"diagnostics"; -constexpr char16_t didChangeConfigurationKey[] = u"didChangeConfiguration"; -constexpr char16_t didChangeWatchedFilesKey[] = u"didChangeWatchedFiles"; -constexpr char16_t didSaveKey[] = u"didSave"; -constexpr char16_t documentChangesKey[] = u"documentChanges"; -constexpr char16_t documentFormattingProviderKey[] = u"documentFormattingProvider"; -constexpr char16_t documentHighlightKey[] = u"documentHighlight"; -constexpr char16_t documentHighlightProviderKey[] = u"documentHighlightProvider"; -constexpr char16_t documentLinkKey[] = u"documentLink"; -constexpr char16_t documentLinkProviderKey[] = u"documentLinkProvider"; -constexpr char16_t documentRangeFormattingProviderKey[] = u"documentRangeFormattingProvider"; -constexpr char16_t documentSelectorKey[] = u"documentSelector"; -constexpr char16_t documentSymbolKey[] = u"documentSymbol"; -constexpr char16_t documentSymbolProviderKey[] = u"documentSymbolProvider"; -constexpr char16_t documentationFormatKey[] = u"documentationFormat"; -constexpr char16_t documentationKey[] = u"documentation"; -constexpr char16_t dynamicRegistrationKey[] = u"dynamicRegistration"; -constexpr char16_t editKey[] = u"edit"; -constexpr char16_t editsKey[] = u"edits"; -constexpr char16_t endKey[] = u"end"; -constexpr char16_t errorKey[] = u"error"; -constexpr char16_t eventKey[] = u"event"; -constexpr char16_t executeCommandKey[] = u"executeCommand"; -constexpr char16_t executeCommandProviderKey[] = u"executeCommandProvider"; -constexpr char16_t experimentalKey[] = u"experimental"; -constexpr char16_t filterTextKey[] = u"filterText"; -constexpr char16_t firstTriggerCharacterKey[] = u"firstTriggerCharacter"; -constexpr char16_t formatsKey[] = u"formats"; -constexpr char16_t formattingKey[] = u"formatting"; -constexpr char16_t fromKey[] = u"from"; -constexpr char16_t fromRangesKey[] = u"fromRanges"; -constexpr char16_t fullKey[] = u"full"; -constexpr char16_t greenKey[] = u"green"; -constexpr char16_t hierarchicalDocumentSymbolSupportKey[] = u"hierarchicalDocumentSymbolSupport"; -constexpr char16_t hoverKey[] = u"hover"; -constexpr char16_t hoverProviderKey[] = u"hoverProvider"; -constexpr char16_t idKey[] = u"id"; -constexpr char16_t implementationKey[] = u"implementation"; -constexpr char16_t implementationProviderKey[] = u"implementationProvider"; -constexpr char16_t includeDeclarationKey[] = u"includeDeclaration"; -constexpr char16_t includeTextKey[] = u"includeText"; -constexpr char16_t initializationOptionsKey[] = u"initializationOptions"; -constexpr char16_t insertFinalNewlineKey[] = u"insertFinalNewline"; -constexpr char16_t insertSpaceKey[] = u"insertSpace"; -constexpr char16_t insertTextFormatKey[] = u"insertTextFormat"; -constexpr char16_t insertTextKey[] = u"insertText"; -constexpr char16_t isIncompleteKey[] = u"isIncomplete"; -constexpr char16_t itemKey[] = u"item"; -constexpr char16_t itemsKey[] = u"items"; -constexpr char16_t jsonRpcVersionKey[] = u"jsonrpc"; -constexpr char16_t kindKey[] = u"kind"; -constexpr char16_t labelKey[] = u"label"; -constexpr char16_t languageIdKey[] = u"languageId"; -constexpr char16_t languageKey[] = u"language"; -constexpr char16_t legendKey[] = u"legend"; -constexpr char16_t limitKey[] = u"limit"; -constexpr char16_t lineKey[] = u"line"; -constexpr char16_t linesKey[] = u"lines"; -constexpr char16_t locationKey[] = u"location"; -constexpr char16_t messageKey[] = u"message"; -constexpr char16_t methodKey[] = u"method"; -constexpr char16_t moreTriggerCharacterKey[] = u"moreTriggerCharacter"; -constexpr char16_t multiLineTokenSupportKey[] = u"multiLineTokenSupport"; -constexpr char16_t nameKey[] = u"name"; -constexpr char16_t newNameKey[] = u"newName"; -constexpr char16_t newTextKey[] = u"newText"; -constexpr char16_t onTypeFormattingKey[] = u"onTypeFormatting"; -constexpr char16_t onlyKey[] = u"only"; -constexpr char16_t openCloseKey[] = u"openClose"; -constexpr char16_t optionsKey[] = u"options"; -constexpr char16_t overlappingTokenSupportKey[] = u"overlappingTokenSupport"; -constexpr char16_t parametersKey[] = u"parameters"; -constexpr char16_t paramsKey[] = u"params"; -constexpr char16_t patternKey[] = u"pattern"; -constexpr char16_t percentageKey[] = u"percentage"; -constexpr char16_t placeHolderKey[] = u"placeHolder"; -constexpr char16_t positionKey[] = u"position"; -constexpr char16_t prepareProviderKey[] = u"prepareProvider"; -constexpr char16_t prepareSupportKey[] = u"prepareSupport"; -constexpr char16_t previousResultIdKey[] = u"previousResultId"; -constexpr char16_t processIdKey[] = u"processId"; -constexpr char16_t queryKey[] = u"query"; -constexpr char16_t rangeFormattingKey[] = u"rangeFormatting"; -constexpr char16_t rangeKey[] = u"range"; -constexpr char16_t rangeLengthKey[] = u"rangeLength"; -constexpr char16_t reasonKey[] = u"reason"; -constexpr char16_t redKey[] = u"red"; -constexpr char16_t referencesKey[] = u"references"; -constexpr char16_t referencesProviderKey[] = u"referencesProvider"; -constexpr char16_t refreshSupportKey[] = u"refreshSupport"; -constexpr char16_t registerOptionsKey[] = u"registerOptions"; -constexpr char16_t registrationsKey[] = u"registrations"; -constexpr char16_t removedKey[] = u"removed"; -constexpr char16_t renameKey[] = u"rename"; -constexpr char16_t renameProviderKey[] = u"renameProvider"; -constexpr char16_t requestsKey[] = u"requests"; -constexpr char16_t resolveProviderKey[] = u"resolveProvider"; -constexpr char16_t resultIdKey[] = u"resultId"; -constexpr char16_t resultKey[] = u"result"; -constexpr char16_t retryKey[] = u"retry"; -constexpr char16_t rootPathKey[] = u"rootPath"; -constexpr char16_t rootUriKey[] = u"rootUri"; -constexpr char16_t saveKey[] = u"save"; -constexpr char16_t schemeKey[] = u"scheme"; -constexpr char16_t scopeUriKey[] = u"scopeUri"; -constexpr char16_t sectionKey[] = u"section"; -constexpr char16_t selectionRangeKey[] = u"selectionRange"; -constexpr char16_t semanticTokensKey[] = u"semanticTokens"; -constexpr char16_t semanticTokensProviderKey[] = u"semanticTokensProvider"; -constexpr char16_t serverInfoKey[] = u"serverInfo"; -constexpr char16_t settingsKey[] = u"settings"; -constexpr char16_t severityKey[] = u"severity"; -constexpr char16_t signatureHelpKey[] = u"signatureHelp"; -constexpr char16_t signatureHelpProviderKey[] = u"signatureHelpProvider"; -constexpr char16_t signatureInformationKey[] = u"signatureInformation"; -constexpr char16_t signaturesKey[] = u"signatures"; -constexpr char16_t snippetSupportKey[] = u"snippetSupport"; -constexpr char16_t sortTextKey[] = u"sortText"; -constexpr char16_t sourceKey[] = u"source"; -constexpr char16_t startKey[] = u"start"; -constexpr char16_t supportedKey[] = u"supported"; -constexpr char16_t symbolKey[] = u"symbol"; -constexpr char16_t symbolKindKey[] = u"symbolKind"; -constexpr char16_t syncKindKey[] = u"syncKind"; -constexpr char16_t synchronizationKey[] = u"synchronization"; -constexpr char16_t tabSizeKey[] = u"tabSize"; -constexpr char16_t tagsKey[] = u"tags"; -constexpr char16_t targetKey[] = u"target"; -constexpr char16_t textDocumentKey[] = u"textDocument"; -constexpr char16_t textDocumentSyncKey[] = u"textDocumentSync"; -constexpr char16_t textEditKey[] = u"textEdit"; -constexpr char16_t textKey[] = u"text"; -constexpr char16_t titleKey[] = u"title"; -constexpr char16_t tokenKey[] = u"token"; -constexpr char16_t toKey[] = u"to"; -constexpr char16_t tokenModifiersKey[] = u"tokenModifiers"; -constexpr char16_t tokenTypesKey[] = u"tokenTypes"; -constexpr char16_t traceKey[] = u"trace"; -constexpr char16_t triggerCharacterKey[] = u"triggerCharacter"; -constexpr char16_t triggerCharactersKey[] = u"triggerCharacters"; -constexpr char16_t triggerKindKey[] = u"triggerKind"; -constexpr char16_t trimFinalNewlinesKey[] = u"trimFinalNewlines"; -constexpr char16_t trimTrailingWhitespaceKey[] = u"trimTrailingWhitespace"; -constexpr char16_t typeDefinitionKey[] = u"typeDefinition"; -constexpr char16_t typeDefinitionProviderKey[] = u"typeDefinitionProvider"; -constexpr char16_t typeKey[] = u"type"; -constexpr char16_t unregistrationsKey[] = u"unregistrations"; -constexpr char16_t uriKey[] = u"uri"; -constexpr char16_t valueKey[] = u"value"; -constexpr char16_t valueSetKey[] = u"valueSet"; -constexpr char16_t versionKey[] = u"version"; -constexpr char16_t willSaveKey[] = u"willSave"; -constexpr char16_t willSaveWaitUntilKey[] = u"willSaveWaitUntil"; -constexpr char16_t windowKey[] = u"window"; -constexpr char16_t workDoneProgressKey[] = u"workDoneProgress"; -constexpr char16_t workspaceEditKey[] = u"workspaceEdit"; -constexpr char16_t workspaceFoldersKey[] = u"workspaceFolders"; -constexpr char16_t workspaceKey[] = u"workspace"; -constexpr char16_t workspaceSymbolProviderKey[] = u"workspaceSymbolProvider"; +constexpr char actionsKey[] = "actions"; +constexpr char activeParameterKey[] = "activeParameter"; +constexpr char activeParameterSupportKey[] = "activeParameterSupport"; +constexpr char activeSignatureKey[] = "activeSignature"; +constexpr char addedKey[] = "added"; +constexpr char additionalTextEditsKey[] = "additionalTextEdits"; +constexpr char alphaKey[] = "alpha"; +constexpr char appliedKey[] = "applied"; +constexpr char applyEditKey[] = "applyEdit"; +constexpr char argumentsKey[] = "arguments"; +constexpr char blueKey[] = "blue"; +constexpr char callHierarchyKey[] = "callHierarchy"; +constexpr char callHierarchyProviderKey[] = "callHierarchyProvider"; +constexpr char cancellableKey[] = "cancellable"; +constexpr char capabilitiesKey[] = "capabilities"; +constexpr char chKey[] = "ch"; +constexpr char changeKey[] = "change"; +constexpr char changeNotificationsKey[] = "changeNotifications"; +constexpr char changesKey[] = "changes"; +constexpr char characterKey[] = "character"; +constexpr char childrenKey[] = "children"; +constexpr char clientInfoKey[] = "clientInfo"; +constexpr char codeActionKey[] = "codeAction"; +constexpr char codeActionKindKey[] = "codeActionKind"; +constexpr char codeActionKindsKey[] = "codeActionKinds"; +constexpr char codeActionLiteralSupportKey[] = "codeActionLiteralSupport"; +constexpr char codeActionProviderKey[] = "codeActionProvider"; +constexpr char codeKey[] = "code"; +constexpr char codeLensKey[] = "codeLens"; +constexpr char codeLensProviderKey[] = "codeLensProvider"; +constexpr char colorInfoKey[] = "colorInfo"; +constexpr char colorKey[] = "color"; +constexpr char colorProviderKey[] = "colorProvider"; +constexpr char commandKey[] = "command"; +constexpr char commandsKey[] = "commands"; +constexpr char commitCharacterSupportKey[] = "commitCharacterSupport"; +constexpr char commitCharactersKey[] = "commitCharacters"; +constexpr char completionItemKey[] = "completionItem"; +constexpr char completionItemKindKey[] = "completionItemKind"; +constexpr char completionKey[] = "completion"; +constexpr char completionProviderKey[] = "completionProvider"; +constexpr char configurationKey[] = "configuration"; +constexpr char containerNameKey[] = "containerName"; +constexpr char contentChangesKey[] = "contentChanges"; +constexpr char contentFormatKey[] = "contentFormat"; +constexpr char contentKey[] = "value"; +constexpr char contentsKey[] = "contents"; +constexpr char contextKey[] = "context"; +constexpr char contextSupportKey[] = "contextSupport"; +constexpr char dataKey[] = "data"; +constexpr char definitionKey[] = "definition"; +constexpr char definitionProviderKey[] = "definitionProvider"; +constexpr char deleteCountKey[] = "deleteCount"; +constexpr char deltaKey[] = "delta"; +constexpr char deprecatedKey[] = "deprecated"; +constexpr char detailKey[] = "detail"; +constexpr char diagnosticsKey[] = "diagnostics"; +constexpr char didChangeConfigurationKey[] = "didChangeConfiguration"; +constexpr char didChangeWatchedFilesKey[] = "didChangeWatchedFiles"; +constexpr char didSaveKey[] = "didSave"; +constexpr char documentChangesKey[] = "documentChanges"; +constexpr char documentFormattingProviderKey[] = "documentFormattingProvider"; +constexpr char documentHighlightKey[] = "documentHighlight"; +constexpr char documentHighlightProviderKey[] = "documentHighlightProvider"; +constexpr char documentLinkKey[] = "documentLink"; +constexpr char documentLinkProviderKey[] = "documentLinkProvider"; +constexpr char documentRangeFormattingProviderKey[] = "documentRangeFormattingProvider"; +constexpr char documentSelectorKey[] = "documentSelector"; +constexpr char documentSymbolKey[] = "documentSymbol"; +constexpr char documentSymbolProviderKey[] = "documentSymbolProvider"; +constexpr char documentationFormatKey[] = "documentationFormat"; +constexpr char documentationKey[] = "documentation"; +constexpr char dynamicRegistrationKey[] = "dynamicRegistration"; +constexpr char editKey[] = "edit"; +constexpr char editsKey[] = "edits"; +constexpr char endKey[] = "end"; +constexpr char errorKey[] = "error"; +constexpr char eventKey[] = "event"; +constexpr char executeCommandKey[] = "executeCommand"; +constexpr char executeCommandProviderKey[] = "executeCommandProvider"; +constexpr char experimentalKey[] = "experimental"; +constexpr char filterTextKey[] = "filterText"; +constexpr char firstTriggerCharacterKey[] = "firstTriggerCharacter"; +constexpr char formatsKey[] = "formats"; +constexpr char formattingKey[] = "formatting"; +constexpr char fromKey[] = "from"; +constexpr char fromRangesKey[] = "fromRanges"; +constexpr char fullKey[] = "full"; +constexpr char greenKey[] = "green"; +constexpr char hierarchicalDocumentSymbolSupportKey[] = "hierarchicalDocumentSymbolSupport"; +constexpr char hoverKey[] = "hover"; +constexpr char hoverProviderKey[] = "hoverProvider"; +constexpr char idKey[] = "id"; +constexpr char implementationKey[] = "implementation"; +constexpr char implementationProviderKey[] = "implementationProvider"; +constexpr char includeDeclarationKey[] = "includeDeclaration"; +constexpr char includeTextKey[] = "includeText"; +constexpr char initializationOptionsKey[] = "initializationOptions"; +constexpr char insertFinalNewlineKey[] = "insertFinalNewline"; +constexpr char insertSpaceKey[] = "insertSpace"; +constexpr char insertTextFormatKey[] = "insertTextFormat"; +constexpr char insertTextKey[] = "insertText"; +constexpr char isIncompleteKey[] = "isIncomplete"; +constexpr char itemKey[] = "item"; +constexpr char itemsKey[] = "items"; +constexpr char jsonRpcVersionKey[] = "jsonrpc"; +constexpr char kindKey[] = "kind"; +constexpr char labelKey[] = "label"; +constexpr char languageIdKey[] = "languageId"; +constexpr char languageKey[] = "language"; +constexpr char legendKey[] = "legend"; +constexpr char limitKey[] = "limit"; +constexpr char lineKey[] = "line"; +constexpr char linesKey[] = "lines"; +constexpr char locationKey[] = "location"; +constexpr char messageKey[] = "message"; +constexpr char methodKey[] = "method"; +constexpr char moreTriggerCharacterKey[] = "moreTriggerCharacter"; +constexpr char multiLineTokenSupportKey[] = "multiLineTokenSupport"; +constexpr char nameKey[] = "name"; +constexpr char newNameKey[] = "newName"; +constexpr char newTextKey[] = "newText"; +constexpr char onTypeFormattingKey[] = "onTypeFormatting"; +constexpr char onlyKey[] = "only"; +constexpr char openCloseKey[] = "openClose"; +constexpr char optionsKey[] = "options"; +constexpr char overlappingTokenSupportKey[] = "overlappingTokenSupport"; +constexpr char parametersKey[] = "parameters"; +constexpr char paramsKey[] = "params"; +constexpr char patternKey[] = "pattern"; +constexpr char percentageKey[] = "percentage"; +constexpr char placeHolderKey[] = "placeHolder"; +constexpr char positionKey[] = "position"; +constexpr char prepareProviderKey[] = "prepareProvider"; +constexpr char prepareSupportKey[] = "prepareSupport"; +constexpr char previousResultIdKey[] = "previousResultId"; +constexpr char processIdKey[] = "processId"; +constexpr char queryKey[] = "query"; +constexpr char rangeFormattingKey[] = "rangeFormatting"; +constexpr char rangeKey[] = "range"; +constexpr char rangeLengthKey[] = "rangeLength"; +constexpr char reasonKey[] = "reason"; +constexpr char redKey[] = "red"; +constexpr char referencesKey[] = "references"; +constexpr char referencesProviderKey[] = "referencesProvider"; +constexpr char refreshSupportKey[] = "refreshSupport"; +constexpr char registerOptionsKey[] = "registerOptions"; +constexpr char registrationsKey[] = "registrations"; +constexpr char removedKey[] = "removed"; +constexpr char renameKey[] = "rename"; +constexpr char renameProviderKey[] = "renameProvider"; +constexpr char requestsKey[] = "requests"; +constexpr char resolveProviderKey[] = "resolveProvider"; +constexpr char resultIdKey[] = "resultId"; +constexpr char resultKey[] = "result"; +constexpr char retryKey[] = "retry"; +constexpr char rootPathKey[] = "rootPath"; +constexpr char rootUriKey[] = "rootUri"; +constexpr char saveKey[] = "save"; +constexpr char schemeKey[] = "scheme"; +constexpr char scopeUriKey[] = "scopeUri"; +constexpr char sectionKey[] = "section"; +constexpr char selectionRangeKey[] = "selectionRange"; +constexpr char semanticTokensKey[] = "semanticTokens"; +constexpr char semanticTokensProviderKey[] = "semanticTokensProvider"; +constexpr char serverInfoKey[] = "serverInfo"; +constexpr char settingsKey[] = "settings"; +constexpr char severityKey[] = "severity"; +constexpr char signatureHelpKey[] = "signatureHelp"; +constexpr char signatureHelpProviderKey[] = "signatureHelpProvider"; +constexpr char signatureInformationKey[] = "signatureInformation"; +constexpr char signaturesKey[] = "signatures"; +constexpr char snippetSupportKey[] = "snippetSupport"; +constexpr char sortTextKey[] = "sortText"; +constexpr char sourceKey[] = "source"; +constexpr char startKey[] = "start"; +constexpr char supportedKey[] = "supported"; +constexpr char symbolKey[] = "symbol"; +constexpr char symbolKindKey[] = "symbolKind"; +constexpr char syncKindKey[] = "syncKind"; +constexpr char synchronizationKey[] = "synchronization"; +constexpr char tabSizeKey[] = "tabSize"; +constexpr char tagsKey[] = "tags"; +constexpr char targetKey[] = "target"; +constexpr char textDocumentKey[] = "textDocument"; +constexpr char textDocumentSyncKey[] = "textDocumentSync"; +constexpr char textEditKey[] = "textEdit"; +constexpr char textKey[] = "text"; +constexpr char titleKey[] = "title"; +constexpr char tokenKey[] = "token"; +constexpr char toKey[] = "to"; +constexpr char tokenModifiersKey[] = "tokenModifiers"; +constexpr char tokenTypesKey[] = "tokenTypes"; +constexpr char traceKey[] = "trace"; +constexpr char triggerCharacterKey[] = "triggerCharacter"; +constexpr char triggerCharactersKey[] = "triggerCharacters"; +constexpr char triggerKindKey[] = "triggerKind"; +constexpr char trimFinalNewlinesKey[] = "trimFinalNewlines"; +constexpr char trimTrailingWhitespaceKey[] = "trimTrailingWhitespace"; +constexpr char typeDefinitionKey[] = "typeDefinition"; +constexpr char typeDefinitionProviderKey[] = "typeDefinitionProvider"; +constexpr char typeKey[] = "type"; +constexpr char unregistrationsKey[] = "unregistrations"; +constexpr char uriKey[] = "uri"; +constexpr char valueKey[] = "value"; +constexpr char valueSetKey[] = "valueSet"; +constexpr char versionKey[] = "version"; +constexpr char willSaveKey[] = "willSave"; +constexpr char willSaveWaitUntilKey[] = "willSaveWaitUntil"; +constexpr char windowKey[] = "window"; +constexpr char workDoneProgressKey[] = "workDoneProgress"; +constexpr char workspaceEditKey[] = "workspaceEdit"; +constexpr char workspaceFoldersKey[] = "workspaceFolders"; +constexpr char workspaceKey[] = "workspace"; +constexpr char workspaceSymbolProviderKey[] = "workspaceSymbolProvider"; } // namespace LanguageServerProtocol diff --git a/src/libs/languageserverprotocol/jsonobject.cpp b/src/libs/languageserverprotocol/jsonobject.cpp index 2a89f34a6ea..3fac8df20df 100644 --- a/src/libs/languageserverprotocol/jsonobject.cpp +++ b/src/libs/languageserverprotocol/jsonobject.cpp @@ -15,14 +15,14 @@ JsonObject &JsonObject::operator=(JsonObject &&other) return *this; } -QJsonObject::iterator JsonObject::insert(const QStringView key, const JsonObject &object) +QJsonObject::iterator JsonObject::insert(const std::string_view key, const JsonObject &object) { - return m_jsonObject.insert(key, object.m_jsonObject); + return m_jsonObject.insert(QLatin1StringView(key), object.m_jsonObject); } -QJsonObject::iterator JsonObject::insert(const QStringView key, const QJsonValue &value) +QJsonObject::iterator JsonObject::insert(const std::string_view key, const QJsonValue &value) { - return m_jsonObject.insert(key, value); + return m_jsonObject.insert(QLatin1StringView(key), value); } } // namespace LanguageServerProtocol diff --git a/src/libs/languageserverprotocol/jsonobject.h b/src/libs/languageserverprotocol/jsonobject.h index 8f773d283ff..2212c0a68f8 100644 --- a/src/libs/languageserverprotocol/jsonobject.h +++ b/src/libs/languageserverprotocol/jsonobject.h @@ -43,97 +43,98 @@ public: const_iterator end() const { return m_jsonObject.end(); } protected: - iterator insert(const QStringView key, const JsonObject &value); - iterator insert(const QStringView key, const QJsonValue &value); + iterator insert(const std::string_view key, const JsonObject &value); + iterator insert(const std::string_view key, const QJsonValue &value); template <typename T, typename V> - iterator insertVariant(const QStringView key, const V &variant); + iterator insertVariant(const std::string_view key, const V &variant); template <typename T1, typename T2, typename... Args, typename V> - iterator insertVariant(const QStringView key, const V &variant); + iterator insertVariant(const std::string_view key, const V &variant); // QJSonObject redirections - QJsonValue value(const QStringView key) const { return m_jsonObject.value(key); } - bool contains(const QStringView key) const { return m_jsonObject.contains(key); } - iterator find(const QStringView key) { return m_jsonObject.find(key); } - const_iterator find(const QStringView key) const { return m_jsonObject.find(key); } - void remove(const QStringView key) { m_jsonObject.remove(key); } + QJsonValue value(const std::string_view key) const { return m_jsonObject.value(QLatin1StringView(key)); } + bool contains(const std::string_view key) const { return m_jsonObject.contains(QLatin1StringView(key)); } + iterator find(const std::string_view key) { return m_jsonObject.find(QLatin1StringView(key)); } + const_iterator find(const std::string_view key) const { return m_jsonObject.find(QLatin1StringView(key)); } + void remove(const std::string_view key) { m_jsonObject.remove(QLatin1StringView(key)); } QStringList keys() const { return m_jsonObject.keys(); } // convenience value access template<typename T> - T typedValue(const QStringView key) const; + T typedValue(const std::string_view key) const; template<typename T> - std::optional<T> optionalValue(const QStringView key) const; + std::optional<T> optionalValue(const std::string_view key) const; template<typename T> - LanguageClientValue<T> clientValue(const QStringView key) const; + LanguageClientValue<T> clientValue(const std::string_view key) const; template<typename T> - std::optional<LanguageClientValue<T>> optionalClientValue(const QStringView key) const; + std::optional<LanguageClientValue<T>> optionalClientValue(const std::string_view key) const; template<typename T> - QList<T> array(const QStringView key) const; + QList<T> array(const std::string_view key) const; template<typename T> - std::optional<QList<T>> optionalArray(const QStringView key) const; + std::optional<QList<T>> optionalArray(const std::string_view key) const; template<typename T> - LanguageClientArray<T> clientArray(const QStringView key) const; + LanguageClientArray<T> clientArray(const std::string_view key) const; template<typename T> - std::optional<LanguageClientArray<T>> optionalClientArray(const QStringView key) const; + std::optional<LanguageClientArray<T>> optionalClientArray(const std::string_view key) const; template<typename T> - void insertArray(const QStringView key, const QList<T> &array); + void insertArray(const std::string_view key, const QList<T> &array); template<typename> - void insertArray(const QStringView key, const QList<JsonObject> &array); + void insertArray(const std::string_view key, const QList<JsonObject> &array); private: QJsonObject m_jsonObject; }; template<typename T, typename V> -JsonObject::iterator JsonObject::insertVariant(const QStringView key, const V &variant) +JsonObject::iterator JsonObject::insertVariant(const std::string_view key, const V &variant) { return std::holds_alternative<T>(variant) ? insert(key, std::get<T>(variant)) : end(); } template<typename T1, typename T2, typename... Args, typename V> -JsonObject::iterator JsonObject::insertVariant(const QStringView key, const V &variant) +JsonObject::iterator JsonObject::insertVariant(const std::string_view key, const V &variant) { auto result = insertVariant<T1>(key, variant); return result != end() ? result : insertVariant<T2, Args...>(key, variant); } template<typename T> -T JsonObject::typedValue(const QStringView key) const +T JsonObject::typedValue(const std::string_view key) const { return fromJsonValue<T>(value(key)); } template<typename T> -std::optional<T> JsonObject::optionalValue(const QStringView key) const +std::optional<T> JsonObject::optionalValue(const std::string_view key) const { const QJsonValue &val = value(key); return val.isUndefined() ? std::nullopt : std::make_optional(fromJsonValue<T>(val)); } template<typename T> -LanguageClientValue<T> JsonObject::clientValue(const QStringView key) const +LanguageClientValue<T> JsonObject::clientValue(const std::string_view key) const { return LanguageClientValue<T>(value(key)); } template<typename T> -std::optional<LanguageClientValue<T>> JsonObject::optionalClientValue(const QStringView key) const +std::optional<LanguageClientValue<T>> JsonObject::optionalClientValue(const std::string_view key) const { return contains(key) ? std::make_optional(clientValue<T>(key)) : std::nullopt; } template<typename T> -QList<T> JsonObject::array(const QStringView key) const +QList<T> JsonObject::array(const std::string_view key) const { if (const std::optional<QList<T>> &array = optionalArray<T>(key)) return *array; - qCDebug(conversionLog) << QString("Expected array under %1 in:").arg(key) << *this; + qCDebug(conversionLog) << QString("Expected array under %1 in:") + .arg(QLatin1String(key)) << *this; return {}; } template<typename T> -std::optional<QList<T>> JsonObject::optionalArray(const QStringView key) const +std::optional<QList<T>> JsonObject::optionalArray(const std::string_view key) const { const QJsonValue &jsonValue = value(key); if (jsonValue.isUndefined()) @@ -142,13 +143,13 @@ std::optional<QList<T>> JsonObject::optionalArray(const QStringView key) const } template<typename T> -LanguageClientArray<T> JsonObject::clientArray(const QStringView key) const +LanguageClientArray<T> JsonObject::clientArray(const std::string_view key) const { return LanguageClientArray<T>(value(key)); } template<typename T> -std::optional<LanguageClientArray<T>> JsonObject::optionalClientArray(const QStringView key) const +std::optional<LanguageClientArray<T>> JsonObject::optionalClientArray(const std::string_view key) const { const QJsonValue &val = value(key); return !val.isUndefined() ? std::make_optional(LanguageClientArray<T>(value(key))) @@ -156,7 +157,7 @@ std::optional<LanguageClientArray<T>> JsonObject::optionalClientArray(const QStr } template<typename T> -void JsonObject::insertArray(const QStringView key, const QList<T> &array) +void JsonObject::insertArray(const std::string_view key, const QList<T> &array) { QJsonArray jsonArray; for (const T &item : array) @@ -165,7 +166,7 @@ void JsonObject::insertArray(const QStringView key, const QList<T> &array) } template<typename > -void JsonObject::insertArray(const QStringView key, const QList<JsonObject> &array) +void JsonObject::insertArray(const std::string_view key, const QList<JsonObject> &array) { QJsonArray jsonArray; for (const JsonObject &item : array) diff --git a/src/libs/languageserverprotocol/languagefeatures.cpp b/src/libs/languageserverprotocol/languagefeatures.cpp index 24a160f4b39..b4d124f96be 100644 --- a/src/libs/languageserverprotocol/languagefeatures.cpp +++ b/src/libs/languageserverprotocol/languagefeatures.cpp @@ -125,7 +125,7 @@ QHash<QString, DocumentFormattingProperty> FormattingOptions::properties() const for (const QString &key : keys()) { if (key == tabSizeKey || key == insertSpaceKey) continue; - QJsonValue property = value(key); + QJsonValue property = value(key.toStdString()); if (property.isBool()) ret[key] = property.toBool(); if (property.isDouble()) @@ -136,7 +136,7 @@ QHash<QString, DocumentFormattingProperty> FormattingOptions::properties() const return ret; } -void FormattingOptions::setProperty(const QString &key, const DocumentFormattingProperty &property) +void FormattingOptions::setProperty(const std::string_view key, const DocumentFormattingProperty &property) { using namespace std; if (auto val = get_if<double>(&property)) diff --git a/src/libs/languageserverprotocol/languagefeatures.h b/src/libs/languageserverprotocol/languagefeatures.h index 2fc3a991f96..b82b893f49d 100644 --- a/src/libs/languageserverprotocol/languagefeatures.h +++ b/src/libs/languageserverprotocol/languagefeatures.h @@ -678,8 +678,8 @@ public: void clearTrimFinalNewlines() { remove(trimFinalNewlinesKey); } QHash<QString, DocumentFormattingProperty> properties() const; - void setProperty(const QString &key, const DocumentFormattingProperty &property); - void removeProperty(const QString &key) { remove(key); } + void setProperty(const std::string_view key, const DocumentFormattingProperty &property); + void removeProperty(const std::string_view &key) { remove(key); } bool isValid() const override { return contains(insertSpaceKey) && contains(tabSizeKey); } }; diff --git a/src/libs/languageserverprotocol/workspace.h b/src/libs/languageserverprotocol/workspace.h index 42cfcf451d2..f99dded8386 100644 --- a/src/libs/languageserverprotocol/workspace.h +++ b/src/libs/languageserverprotocol/workspace.h @@ -166,7 +166,7 @@ public: QString query() const { return typedValue<QString>(queryKey); } void setQuery(const QString &query) { insert(queryKey, query); } - void setLimit(int limit) { insert(u"limit", limit); } // clangd extension + void setLimit(int limit) { insert("limit", limit); } // clangd extension bool isValid() const override { return contains(queryKey); } }; diff --git a/src/plugins/clangcodemodel/clangdast.cpp b/src/plugins/clangcodemodel/clangdast.cpp index 01f12d1177e..0c4f4bf5d3e 100644 --- a/src/plugins/clangcodemodel/clangdast.cpp +++ b/src/plugins/clangcodemodel/clangdast.cpp @@ -18,8 +18,8 @@ using namespace Utils; namespace ClangCodeModel::Internal { -static constexpr char16_t roleKey[] = u"role"; -static constexpr char16_t arcanaKey[] = u"arcana"; +static constexpr char roleKey[] = "role"; +static constexpr char arcanaKey[] = "arcana"; QString ClangdAstNode::role() const { return typedValue<QString>(roleKey); } QString ClangdAstNode::kind() const { return typedValue<QString>(kindKey); } diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index f4ff68f52ee..c7edf2b8b58 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -99,7 +99,7 @@ class SymbolDetails : public JsonObject public: using JsonObject::JsonObject; - static constexpr char16_t usrKey[] = u"usr"; + static constexpr char usrKey[] = "usr"; // the unqualified name of the symbol QString name() const { return typedValue<QString>(nameKey); } @@ -226,15 +226,15 @@ class DiagnosticsCapabilities : public JsonObject { public: using JsonObject::JsonObject; - void enableCategorySupport() { insert(u"categorySupport", true); } - void enableCodeActionsInline() {insert(u"codeActionsInline", true);} + void enableCategorySupport() { insert("categorySupport", true); } + void enableCodeActionsInline() {insert("codeActionsInline", true);} }; class InactiveRegionsCapabilities : public JsonObject { public: using JsonObject::JsonObject; - void enableInactiveRegionsSupport() { insert(u"inactiveRegions", true); } + void enableInactiveRegionsSupport() { insert("inactiveRegions", true); } }; class ClangdTextDocumentClientCapabilities : public TextDocumentClientCapabilities @@ -243,9 +243,9 @@ public: using TextDocumentClientCapabilities::TextDocumentClientCapabilities; void setPublishDiagnostics(const DiagnosticsCapabilities &caps) - { insert(u"publishDiagnostics", caps); } + { insert("publishDiagnostics", caps); } void setInactiveRegionsCapabilities(const InactiveRegionsCapabilities &caps) - { insert(u"inactiveRegionsCapabilities", caps); } + { insert("inactiveRegionsCapabilities", caps); } }; static qint64 getRevision(const TextDocument *doc) @@ -1572,7 +1572,7 @@ void ClangdClient::Private::handleSemanticTokens(TextDocument *doc, std::optional<QList<CodeAction> > ClangdDiagnostic::codeActions() const { - auto actions = optionalArray<LanguageServerProtocol::CodeAction>(u"codeActions"); + auto actions = optionalArray<LanguageServerProtocol::CodeAction>("codeActions"); if (!actions) return actions; static const QStringList badCodeActions{ @@ -1589,7 +1589,7 @@ std::optional<QList<CodeAction> > ClangdDiagnostic::codeActions() const QString ClangdDiagnostic::category() const { - return typedValue<QString>(u"category"); + return typedValue<QString>("category"); } MessageId ClangdClient::Private::getAndHandleAst(const TextDocOrFile &doc, diff --git a/src/plugins/clangcodemodel/clangdcompletion.cpp b/src/plugins/clangcodemodel/clangdcompletion.cpp index 08179005bc7..9141d39228d 100644 --- a/src/plugins/clangcodemodel/clangdcompletion.cpp +++ b/src/plugins/clangcodemodel/clangdcompletion.cpp @@ -635,7 +635,7 @@ IAssistProposal *ClangdFunctionHintProcessor::perform() ClangdCompletionCapabilities::ClangdCompletionCapabilities(const JsonObject &object) : TextDocumentClientCapabilities::CompletionCapabilities(object) { - insert(u"editsNearCursor", true); // For dot-to-arrow correction. + insert("editsNearCursor", true); // For dot-to-arrow correction. if (std::optional<CompletionItemCapbilities> completionItemCaps = completionItem()) { completionItemCaps->setSnippetSupport(false); setCompletionItem(*completionItemCaps); diff --git a/src/plugins/clangcodemodel/clangdmemoryusagewidget.cpp b/src/plugins/clangcodemodel/clangdmemoryusagewidget.cpp index 58c8c9e4056..fb5c88ec222 100644 --- a/src/plugins/clangcodemodel/clangdmemoryusagewidget.cpp +++ b/src/plugins/clangcodemodel/clangdmemoryusagewidget.cpp @@ -27,10 +27,10 @@ public: using JsonObject::JsonObject; // number of bytes used, including child components - qint64 total() const { return qint64(typedValue<double>(totalKey())); } + qint64 total() const { return qint64(typedValue<double>(totalKey)); } // number of bytes used, excluding child components - qint64 self() const { return qint64(typedValue<double>(selfKey())); } + qint64 self() const { return qint64(typedValue<double>(selfKey)); } // named child components using NamedComponent = std::pair<MemoryTree, QString>; @@ -39,16 +39,15 @@ public: QList<NamedComponent> components; const auto obj = operator const QJsonObject &(); for (auto it = obj.begin(); it != obj.end(); ++it) { - if (it.key() == totalKey() || it.key() == selfKey()) + if (it.key() == QLatin1String(totalKey) || it.key() == QLatin1String(selfKey)) continue; components.push_back({MemoryTree(it.value()), it.key()}); } return components; } -private: - static QString totalKey() { return QLatin1String("_total"); } - static QString selfKey() { return QLatin1String("_self"); } + static constexpr char totalKey[] = "_total"; + static constexpr char selfKey[] = "_self"; }; diff --git a/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp b/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp index 378e0f9346f..33594efc4c3 100644 --- a/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp +++ b/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp @@ -967,8 +967,8 @@ class InactiveRegionsParams : public JsonObject public: using JsonObject::JsonObject; - DocumentUri uri() const { return TextDocumentIdentifier(value(u"textDocument")).uri(); } - QList<Range> inactiveRegions() const { return array<Range>(u"regions"); } + DocumentUri uri() const { return TextDocumentIdentifier(value("textDocument")).uri(); } + QList<Range> inactiveRegions() const { return array<Range>("regions"); } }; class InactiveRegionsNotification : public Notification<InactiveRegionsParams> diff --git a/src/plugins/coco/cocolanguageclient.cpp b/src/plugins/coco/cocolanguageclient.cpp index 83089cb751b..b0841791f89 100644 --- a/src/plugins/coco/cocolanguageclient.cpp +++ b/src/plugins/coco/cocolanguageclient.cpp @@ -239,7 +239,7 @@ public: void enableCodecoverageSupport() { JsonObject coverageSupport(QJsonObject{{"codeCoverageSupport", true}}); - insert(u"publishDiagnostics", coverageSupport); + insert("publishDiagnostics", coverageSupport); } }; diff --git a/src/plugins/copilot/requests/checkstatus.h b/src/plugins/copilot/requests/checkstatus.h index 20e77eb1457..8e9badfc4e0 100644 --- a/src/plugins/copilot/requests/checkstatus.h +++ b/src/plugins/copilot/requests/checkstatus.h @@ -10,8 +10,8 @@ namespace Copilot { class CheckStatusParams : public LanguageServerProtocol::JsonObject { - static constexpr char16_t optionsKey[] = u"options"; - static constexpr char16_t localChecksOnlyKey[] = u"options"; + static constexpr char optionsKey[] = "options"; + static constexpr char localChecksOnlyKey[] = "options"; public: using JsonObject::JsonObject; @@ -30,8 +30,8 @@ public: class CheckStatusResponse : public LanguageServerProtocol::JsonObject { - static constexpr char16_t userKey[] = u"user"; - static constexpr char16_t statusKey[] = u"status"; + static constexpr char userKey[] = "user"; + static constexpr char statusKey[] = "status"; public: using JsonObject::JsonObject; diff --git a/src/plugins/copilot/requests/getcompletions.h b/src/plugins/copilot/requests/getcompletions.h index 2280cfc73df..7b652ee4d71 100644 --- a/src/plugins/copilot/requests/getcompletions.h +++ b/src/plugins/copilot/requests/getcompletions.h @@ -11,8 +11,8 @@ namespace Copilot { class Completion : public LanguageServerProtocol::JsonObject { - static constexpr char16_t displayTextKey[] = u"displayText"; - static constexpr char16_t uuidKey[] = u"uuid"; + static constexpr char displayTextKey[] = "displayText"; + static constexpr char uuidKey[] = "uuid"; public: using JsonObject::JsonObject; @@ -41,7 +41,7 @@ public: class GetCompletionParams : public LanguageServerProtocol::JsonObject { public: - static constexpr char16_t docKey[] = u"doc"; + static constexpr char docKey[] = "doc"; GetCompletionParams(const LanguageServerProtocol::TextDocumentIdentifier &document, int version, @@ -95,7 +95,7 @@ public: class GetCompletionResponse : public LanguageServerProtocol::JsonObject { - static constexpr char16_t completionKey[] = u"completions"; + static constexpr char completionKey[] = "completions"; public: using JsonObject::JsonObject; diff --git a/src/plugins/copilot/requests/signinconfirm.h b/src/plugins/copilot/requests/signinconfirm.h index 64f4ce7d53d..39ab1ce58cb 100644 --- a/src/plugins/copilot/requests/signinconfirm.h +++ b/src/plugins/copilot/requests/signinconfirm.h @@ -12,7 +12,7 @@ namespace Copilot { class SignInConfirmParams : public LanguageServerProtocol::JsonObject { - static constexpr char16_t userCodeKey[] = u"userCode"; + static constexpr char userCodeKey[] = "userCode"; public: using JsonObject::JsonObject; diff --git a/src/plugins/copilot/requests/signininitiate.h b/src/plugins/copilot/requests/signininitiate.h index 005205e6e01..94084d85bc3 100644 --- a/src/plugins/copilot/requests/signininitiate.h +++ b/src/plugins/copilot/requests/signininitiate.h @@ -17,8 +17,8 @@ using SignInInitiateParams = LanguageServerProtocol::JsonObject; class SignInInitiateResponse : public LanguageServerProtocol::JsonObject { - static constexpr char16_t verificationUriKey[] = u"verificationUri"; - static constexpr char16_t userCodeKey[] = u"userCode"; + static constexpr char verificationUriKey[] = "verificationUri"; + static constexpr char userCodeKey[] = "userCode"; public: using JsonObject::JsonObject; From 9a69c20c40ab9873f90bb60aab08b07f2ce3b806 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 14 Aug 2023 11:01:18 +0200 Subject: [PATCH 0696/1777] ProjectExplorer: Hide filtered items on TargetSetupPage Instead of destroying/recreating them. Fixes: QTCREATORBUG-29494 Change-Id: I70e673bf2fb72c0ed31248c6ea18b1fb1a8f30a8 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../projectexplorer/targetsetuppage.cpp | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/plugins/projectexplorer/targetsetuppage.cpp b/src/plugins/projectexplorer/targetsetuppage.cpp index 573fcad099a..24f31fe2304 100644 --- a/src/plugins/projectexplorer/targetsetuppage.cpp +++ b/src/plugins/projectexplorer/targetsetuppage.cpp @@ -546,27 +546,10 @@ void TargetSetupPagePrivate::kitSelectionChanged() void TargetSetupPagePrivate::kitFilterChanged(const QString &filterText) { - QPointer<QWidget> focusWidget = QApplication::focusWidget(); - // Remember selected kits: - const std::vector<TargetSetupWidget *> selectedWidgets - = filtered(m_widgets, &TargetSetupWidget::isKitSelected); - const QVector<Id> selectedKitIds = transform<QVector>(selectedWidgets, - [](const TargetSetupWidget *w) { - return w->kit()->id(); - }); - - // Reset currently shown kits - reset(); - setupWidgets(filterText); - - // Re-select kits: - for (TargetSetupWidget *w : std::as_const(m_widgets)) - w->setKitSelected(selectedKitIds.contains(w->kit()->id())); - - emit q->completeChanged(); - - if (focusWidget) - focusWidget->setFocus(); + for (TargetSetupWidget *widget : m_widgets) { + Kit *kit = widget->kit(); + widget->setVisible(filterText.isEmpty() || kit->displayName().contains(filterText, Qt::CaseInsensitive)); + } } void TargetSetupPagePrivate::doInitializePage() From 017d7c0e47393be4e420015199b82f4f22d6c53b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 11 Aug 2023 09:18:56 +0200 Subject: [PATCH 0697/1777] ProjectExplorer: Rename kitinformation.{h,cpp} to kitaspects.{h,cpp} Change-Id: I069bddeb457366210d339edcbb8ffb359a40fab8 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/android/androidconfigurations.cpp | 2 +- src/plugins/android/androiddevice.cpp | 2 +- src/plugins/android/androidmanifesteditorwidget.cpp | 6 +++--- .../android/androidpackageinstallationstep.cpp | 4 ++-- src/plugins/android/androidplugin.cpp | 2 +- src/plugins/android/androidpotentialkit.cpp | 4 ++-- src/plugins/android/androidrunconfiguration.cpp | 2 +- src/plugins/android/javalanguageserver.cpp | 2 +- src/plugins/autotest/autotestunittests.cpp | 2 +- src/plugins/autotest/testconfiguration.cpp | 2 +- src/plugins/baremetal/baremetaldebugsupport.cpp | 2 +- .../boot2qt/qdbdeployconfigurationfactory.cpp | 2 +- src/plugins/boot2qt/qdbplugin.cpp | 2 +- src/plugins/boot2qt/qdbrunconfiguration.cpp | 2 +- src/plugins/boot2qt/qdbstopapplicationstep.cpp | 2 +- src/plugins/clangcodemodel/clangdclient.cpp | 2 +- src/plugins/clangcodemodel/clangutils.cpp | 2 +- src/plugins/clangtools/clangtool.cpp | 2 +- src/plugins/clangtools/clangtoolsplugin.cpp | 2 +- .../clangtoolspreconfiguredsessiontests.cpp | 2 +- src/plugins/clangtools/clangtoolsunittests.cpp | 2 +- .../cmakeprojectmanager/builddirparameters.cpp | 2 +- .../cmakeprojectmanager/cmakebuildconfiguration.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 2 +- .../cmakeprojectmanager/cmakekitinformation.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakeproject.cpp | 2 +- .../cmakeprojectmanager/cmakeprojectimporter.cpp | 2 +- .../compilationdatabaseproject.cpp | 2 +- .../compilationdatabasetests.cpp | 2 +- src/plugins/conan/conaninstallstep.cpp | 2 +- src/plugins/cppcheck/cppcheckplugin.cpp | 2 +- src/plugins/cppeditor/cppmodelmanager.cpp | 2 +- src/plugins/cppeditor/projectinfo.cpp | 2 +- src/plugins/debugger/analyzer/startremotedialog.cpp | 2 +- src/plugins/debugger/debuggerdialogs.cpp | 2 +- src/plugins/debugger/debuggerkitinformation.h | 2 +- .../debugger/debuggerrunconfigurationaspect.cpp | 2 +- src/plugins/docker/dockerdevice.cpp | 2 +- src/plugins/genericprojectmanager/genericproject.cpp | 2 +- src/plugins/incredibuild/makecommandbuilder.cpp | 4 ++-- src/plugins/ios/iosbuildconfiguration.cpp | 2 +- src/plugins/ios/iosbuildstep.cpp | 2 +- src/plugins/ios/iosconfigurations.cpp | 2 +- src/plugins/ios/iosdeploystep.cpp | 2 +- src/plugins/ios/iosdevice.cpp | 2 +- src/plugins/ios/iosdsymbuildstep.cpp | 2 +- src/plugins/ios/iosrunconfiguration.cpp | 2 +- src/plugins/ios/iosrunner.cpp | 2 +- src/plugins/ios/iossimulator.cpp | 2 +- src/plugins/mcusupport/mcukitinformation.h | 2 +- src/plugins/mcusupport/test/unittest.cpp | 2 +- src/plugins/mesonprojectmanager/kithelper.h | 2 +- src/plugins/mesonprojectmanager/mesonbuildsystem.cpp | 2 +- src/plugins/mesonprojectmanager/mesonproject.cpp | 2 +- src/plugins/nim/project/nimbuildsystem.cpp | 2 +- src/plugins/nim/project/nimcompilerbuildstep.cpp | 2 +- src/plugins/nim/project/nimproject.cpp | 2 +- src/plugins/perfprofiler/perfdatareader.cpp | 4 ++-- src/plugins/perfprofiler/perfprofilerruncontrol.cpp | 2 +- src/plugins/perfprofiler/perfprofilertool.cpp | 4 ++-- src/plugins/perfprofiler/perfsettings.cpp | 2 +- src/plugins/perfprofiler/perftracepointdialog.cpp | 2 +- src/plugins/projectexplorer/CMakeLists.txt | 2 +- src/plugins/projectexplorer/buildaspects.cpp | 2 +- src/plugins/projectexplorer/buildconfiguration.cpp | 2 +- src/plugins/projectexplorer/buildmanager.cpp | 2 +- src/plugins/projectexplorer/buildstep.cpp | 2 +- src/plugins/projectexplorer/deployconfiguration.cpp | 2 +- .../devicesupport/devicecheckbuildstep.cpp | 2 +- .../devicesupport/deviceprocessesdialog.cpp | 2 +- .../projectexplorer/devicesupport/idevice.cpp | 2 +- src/plugins/projectexplorer/extracompiler.cpp | 2 +- src/plugins/projectexplorer/kit.cpp | 2 +- .../{kitinformation.cpp => kitaspects.cpp} | 2 +- .../{kitinformation.h => kitaspects.h} | 0 src/plugins/projectexplorer/kitmanager.cpp | 2 +- .../projectexplorer/kitmanagerconfigwidget.cpp | 2 +- src/plugins/projectexplorer/makestep.cpp | 2 +- src/plugins/projectexplorer/parseissuesdialog.cpp | 2 +- src/plugins/projectexplorer/project.cpp | 2 +- src/plugins/projectexplorer/projectexplorer.cpp | 2 +- src/plugins/projectexplorer/projectexplorer.qbs | 2 +- src/plugins/projectexplorer/projectimporter.cpp | 2 +- src/plugins/projectexplorer/rawprojectpart.cpp | 2 +- src/plugins/projectexplorer/runconfiguration.cpp | 3 +-- .../projectexplorer/runconfigurationaspects.cpp | 2 +- src/plugins/projectexplorer/runcontrol.cpp | 2 +- src/plugins/projectexplorer/target.cpp | 2 +- src/plugins/python/pythonrunconfiguration.cpp | 2 +- .../qbsprojectmanager/defaultpropertyprovider.cpp | 2 +- .../qbsprojectmanager/qbsbuildconfiguration.cpp | 2 +- src/plugins/qbsprojectmanager/qbskitinformation.h | 2 +- src/plugins/qbsprojectmanager/qbsproject.cpp | 2 +- src/plugins/qbsprojectmanager/qbsprojectimporter.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakemakestep.cpp | 6 +++--- src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp | 2 +- .../qmlpreviewplugin/qmlpreviewactions.cpp | 2 +- .../qmlpreview/qmlpreviewfileontargetfinder.cpp | 2 +- src/plugins/qmlpreview/qmlpreviewplugin.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilerattachdialog.cpp | 2 +- .../qmlprofiler/qmlprofilerdetailsrewriter.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilerplugin.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilertool.cpp | 2 +- .../tests/qmlprofilerdetailsrewriter_test.cpp | 2 +- .../qmlprojectmanager/buildsystem/qmlbuildsystem.cpp | 2 +- .../qmlprojectmanager/qmlprojectrunconfiguration.cpp | 2 +- src/plugins/qnx/qnxdebugsupport.cpp | 2 +- src/plugins/qnx/qnxplugin.cpp | 12 ++++++------ src/plugins/qtsupport/qtkitinformation.h | 2 +- .../remotelinux/abstractremotelinuxdeploystep.cpp | 2 +- src/plugins/remotelinux/deploymenttimeinfo.cpp | 2 +- src/plugins/remotelinux/makeinstallstep.cpp | 2 +- .../remotelinux/remotelinuxdeployconfiguration.cpp | 2 +- .../remotelinux/remotelinuxenvironmentaspect.cpp | 2 +- src/plugins/remotelinux/remotelinuxplugin.cpp | 2 +- .../remotelinux/remotelinuxrunconfiguration.cpp | 2 +- src/plugins/remotelinux/rsyncdeploystep.cpp | 2 +- src/plugins/studiowelcome/studiowelcomeplugin.cpp | 2 +- src/plugins/valgrind/memchecktool.cpp | 2 +- src/plugins/valgrind/valgrindengine.cpp | 2 +- 122 files changed, 135 insertions(+), 136 deletions(-) rename src/plugins/projectexplorer/{kitinformation.cpp => kitaspects.cpp} (99%) rename src/plugins/projectexplorer/{kitinformation.h => kitaspects.h} (100%) diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index 3ef93640c0d..0a1e9d60ff8 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -15,7 +15,7 @@ #include <coreplugin/messagemanager.h> #include <projectexplorer/devicesupport/devicemanager.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index 6a6ffcd5c1b..a74e94272e1 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -15,7 +15,7 @@ #include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/idevicewidget.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runconfiguration.h> #include <projectexplorer/projectmanager.h> diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index 36135f55713..1e932b4413d 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -17,13 +17,13 @@ #include <qtsupport/qtkitinformation.h> #include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> -#include <projectexplorer/projectnodes.h> +#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectmanager.h> +#include <projectexplorer/projectnodes.h> #include <projectexplorer/projectwindow.h> #include <projectexplorer/target.h> -#include <projectexplorer/projectexplorer.h> -#include <projectexplorer/kitinformation.h> #include <texteditor/texteditoractionhandler.h> #include <texteditor/texteditor.h> diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp index eaa8dc84162..e26e2ec009d 100644 --- a/src/plugins/android/androidpackageinstallationstep.cpp +++ b/src/plugins/android/androidpackageinstallationstep.cpp @@ -9,14 +9,14 @@ #include <projectexplorer/abstractprocessstep.h> #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildsteplist.h> +#include <projectexplorer/buildsystem.h> #include <projectexplorer/gnumakeparser.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/processparameters.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> #include <projectexplorer/taskhub.h> #include <projectexplorer/toolchain.h> -#include <projectexplorer/buildsystem.h> #include <qtsupport/baseqtversion.h> #include <qtsupport/qtkitinformation.h> diff --git a/src/plugins/android/androidplugin.cpp b/src/plugins/android/androidplugin.cpp index 916600c1df7..82a1bbfca0f 100644 --- a/src/plugins/android/androidplugin.cpp +++ b/src/plugins/android/androidplugin.cpp @@ -41,7 +41,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/deployconfiguration.h> #include <projectexplorer/devicesupport/devicemanager.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/project.h> #include <projectexplorer/projectmanager.h> diff --git a/src/plugins/android/androidpotentialkit.cpp b/src/plugins/android/androidpotentialkit.cpp index 0529df10e1e..08089d5f7f3 100644 --- a/src/plugins/android/androidpotentialkit.cpp +++ b/src/plugins/android/androidpotentialkit.cpp @@ -9,9 +9,9 @@ #include <coreplugin/coreicons.h> #include <coreplugin/icore.h> -#include <projectexplorer/kitmanager.h> #include <projectexplorer/kit.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> +#include <projectexplorer/kitmanager.h> #include <qtsupport/qtversionmanager.h> #include <qtsupport/baseqtversion.h> diff --git a/src/plugins/android/androidrunconfiguration.cpp b/src/plugins/android/androidrunconfiguration.cpp index 28d9862a70c..f8fb1b16487 100644 --- a/src/plugins/android/androidrunconfiguration.cpp +++ b/src/plugins/android/androidrunconfiguration.cpp @@ -8,7 +8,7 @@ #include "androidtr.h" #include <projectexplorer/buildsystem.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/target.h> diff --git a/src/plugins/android/javalanguageserver.cpp b/src/plugins/android/javalanguageserver.cpp index 977b3fc61a9..b36f8f861dc 100644 --- a/src/plugins/android/javalanguageserver.cpp +++ b/src/plugins/android/javalanguageserver.cpp @@ -10,7 +10,7 @@ #include <languageclient/client.h> #include <languageclient/languageclientinterface.h> #include <languageclient/languageclientutils.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectnodes.h> #include <projectexplorer/target.h> diff --git a/src/plugins/autotest/autotestunittests.cpp b/src/plugins/autotest/autotestunittests.cpp index 7ed1a097d48..b036570d6e8 100644 --- a/src/plugins/autotest/autotestunittests.cpp +++ b/src/plugins/autotest/autotestunittests.cpp @@ -15,7 +15,7 @@ #include <extensionsystem/pluginmanager.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/toolchain.h> diff --git a/src/plugins/autotest/testconfiguration.cpp b/src/plugins/autotest/testconfiguration.cpp index 5f225db1972..0f948adff5a 100644 --- a/src/plugins/autotest/testconfiguration.cpp +++ b/src/plugins/autotest/testconfiguration.cpp @@ -10,7 +10,7 @@ #include <projectexplorer/buildsystem.h> #include <projectexplorer/buildtargetinfo.h> #include <projectexplorer/deploymentdata.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/runconfiguration.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/target.h> diff --git a/src/plugins/baremetal/baremetaldebugsupport.cpp b/src/plugins/baremetal/baremetaldebugsupport.cpp index 4475be0b964..113e784dd14 100644 --- a/src/plugins/baremetal/baremetaldebugsupport.cpp +++ b/src/plugins/baremetal/baremetaldebugsupport.cpp @@ -15,7 +15,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildsteplist.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runconfiguration.h> diff --git a/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp b/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp index eb5a180500e..b5a58792985 100644 --- a/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp +++ b/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp @@ -8,7 +8,7 @@ #include <projectexplorer/deploymentdataview.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> diff --git a/src/plugins/boot2qt/qdbplugin.cpp b/src/plugins/boot2qt/qdbplugin.cpp index 8c806cb158f..4d0eef65acf 100644 --- a/src/plugins/boot2qt/qdbplugin.cpp +++ b/src/plugins/boot2qt/qdbplugin.cpp @@ -20,7 +20,7 @@ #include <coreplugin/icore.h> #include <projectexplorer/devicesupport/devicemanager.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> diff --git a/src/plugins/boot2qt/qdbrunconfiguration.cpp b/src/plugins/boot2qt/qdbrunconfiguration.cpp index 976483faf9b..55d84445f40 100644 --- a/src/plugins/boot2qt/qdbrunconfiguration.cpp +++ b/src/plugins/boot2qt/qdbrunconfiguration.cpp @@ -10,7 +10,7 @@ #include <projectexplorer/buildtargetinfo.h> #include <projectexplorer/deploymentdata.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/target.h> diff --git a/src/plugins/boot2qt/qdbstopapplicationstep.cpp b/src/plugins/boot2qt/qdbstopapplicationstep.cpp index ea69b6ac1d5..4a51f843904 100644 --- a/src/plugins/boot2qt/qdbstopapplicationstep.cpp +++ b/src/plugins/boot2qt/qdbstopapplicationstep.cpp @@ -7,7 +7,7 @@ #include "qdbtr.h" #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index c7edf2b8b58..43db68c24b7 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -44,7 +44,7 @@ #include <languageserverprotocol/progresssupport.h> #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projecttree.h> #include <projectexplorer/projectmanager.h> diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp index d5d7868137b..ce9f09126a6 100644 --- a/src/plugins/clangcodemodel/clangutils.cpp +++ b/src/plugins/clangcodemodel/clangutils.cpp @@ -16,7 +16,7 @@ #include <cppeditor/editordocumenthandle.h> #include <cppeditor/projectpart.h> #include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> #include <texteditor/codeassist/textdocumentmanipulatorinterface.h> diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index 493bd4e41d1..8c1b12c557f 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -27,7 +27,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildmanager.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorericons.h> diff --git a/src/plugins/clangtools/clangtoolsplugin.cpp b/src/plugins/clangtools/clangtoolsplugin.cpp index dda49864eff..5f4ed2654c2 100644 --- a/src/plugins/clangtools/clangtoolsplugin.cpp +++ b/src/plugins/clangtools/clangtoolsplugin.cpp @@ -35,7 +35,7 @@ #include <texteditor/texteditor.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectpanelfactory.h> #include <projectexplorer/target.h> #include <projectexplorer/taskhub.h> diff --git a/src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp b/src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp index 4c858451fa3..ce5c7a52549 100644 --- a/src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp +++ b/src/plugins/clangtools/clangtoolspreconfiguredsessiontests.cpp @@ -12,7 +12,7 @@ #include <cppeditor/compileroptionsbuilder.h> #include <cppeditor/projectinfo.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> diff --git a/src/plugins/clangtools/clangtoolsunittests.cpp b/src/plugins/clangtools/clangtoolsunittests.cpp index 34ecf11e9a8..0148f67c0d8 100644 --- a/src/plugins/clangtools/clangtoolsunittests.cpp +++ b/src/plugins/clangtools/clangtoolsunittests.cpp @@ -14,7 +14,7 @@ #include <cppeditor/cpptoolsreuse.h> #include <cppeditor/cpptoolstestcase.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/cmakeprojectmanager/builddirparameters.cpp b/src/plugins/cmakeprojectmanager/builddirparameters.cpp index fe4c63af3f7..75be66533f8 100644 --- a/src/plugins/cmakeprojectmanager/builddirparameters.cpp +++ b/src/plugins/cmakeprojectmanager/builddirparameters.cpp @@ -8,7 +8,7 @@ #include "cmakekitinformation.h" #include "cmaketoolmanager.h" -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/target.h> #include <projectexplorer/toolchain.h> diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 25acfcb0fec..a6ce7499249 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -34,7 +34,7 @@ #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/environmentaspectwidget.h> #include <projectexplorer/environmentwidget.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/namedwidget.h> #include <projectexplorer/processparameters.h> #include <projectexplorer/project.h> diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index c9fd39d71d1..c0cfffbb233 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -23,7 +23,7 @@ #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/environmentwidget.h> #include <projectexplorer/gnumakeparser.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/processparameters.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 8e693ba331c..113388cc507 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -26,7 +26,7 @@ #include <cppeditor/cppprojectupdater.h> #include <projectexplorer/extracompiler.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 436c225a5db..9085cff2dd8 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -15,7 +15,7 @@ #include <ios/iosconstants.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorersettings.h> diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 44ebaff555e..95dd9d4f135 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -12,7 +12,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildinfo.h> #include <projectexplorer/buildsteplist.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectnodes.h> #include <projectexplorer/target.h> diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index a005bd79fa7..45a7df0a116 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -14,7 +14,7 @@ #include <coreplugin/messagemanager.h> #include <projectexplorer/buildinfo.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> #include <projectexplorer/toolchainmanager.h> diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp index ad614e7e23a..37c0d29d8d6 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp @@ -16,7 +16,7 @@ #include <projectexplorer/deploymentdata.h> #include <projectexplorer/gcctoolchain.h> #include <projectexplorer/headerpath.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/namedwidget.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabasetests.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabasetests.cpp index f8b25747716..96b7e423d42 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabasetests.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabasetests.cpp @@ -9,7 +9,7 @@ #include <cppeditor/cpptoolstestcase.h> #include <cppeditor/projectinfo.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/conan/conaninstallstep.cpp b/src/plugins/conan/conaninstallstep.cpp index 839261304d0..0a1182eced2 100644 --- a/src/plugins/conan/conaninstallstep.cpp +++ b/src/plugins/conan/conaninstallstep.cpp @@ -11,7 +11,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildsteplist.h> #include <projectexplorer/gnumakeparser.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/processparameters.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/project.h> diff --git a/src/plugins/cppcheck/cppcheckplugin.cpp b/src/plugins/cppcheck/cppcheckplugin.cpp index 8f80707a240..44381c235ee 100644 --- a/src/plugins/cppcheck/cppcheckplugin.cpp +++ b/src/plugins/cppcheck/cppcheckplugin.cpp @@ -13,7 +13,7 @@ #include "cppcheckdiagnosticsmodel.h" #include "cppcheckmanualrundialog.h" -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index d24a30d226c..a2f93635fea 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -48,7 +48,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/gcctoolchain.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> diff --git a/src/plugins/cppeditor/projectinfo.cpp b/src/plugins/cppeditor/projectinfo.cpp index 3e1f5154e12..d7b0b58a7a1 100644 --- a/src/plugins/cppeditor/projectinfo.cpp +++ b/src/plugins/cppeditor/projectinfo.cpp @@ -4,7 +4,7 @@ #include "projectinfo.h" #include <projectexplorer/abi.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/rawprojectpart.h> #include <projectexplorer/toolchain.h> diff --git a/src/plugins/debugger/analyzer/startremotedialog.cpp b/src/plugins/debugger/analyzer/startremotedialog.cpp index 44447ad7017..f5e6fad3fe2 100644 --- a/src/plugins/debugger/analyzer/startremotedialog.cpp +++ b/src/plugins/debugger/analyzer/startremotedialog.cpp @@ -9,8 +9,8 @@ #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/devicesupport/sshparameters.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitchooser.h> -#include <projectexplorer/kitinformation.h> #include <utils/commandline.h> diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index 9ddd7fa6f73..a6b38c479db 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -10,7 +10,7 @@ #include <coreplugin/icore.h> #include <projectexplorer/devicesupport/sshparameters.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/toolchain.h> diff --git a/src/plugins/debugger/debuggerkitinformation.h b/src/plugins/debugger/debuggerkitinformation.h index 22379a332be..c6f8add9254 100644 --- a/src/plugins/debugger/debuggerkitinformation.h +++ b/src/plugins/debugger/debuggerkitinformation.h @@ -6,7 +6,7 @@ #include "debugger_global.h" #include "debuggerconstants.h" -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/runconfiguration.h> namespace Debugger { diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp index cc1c0b855c1..78ea55f2a19 100644 --- a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp +++ b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp @@ -14,7 +14,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildstep.h> #include <projectexplorer/buildsteplist.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runconfiguration.h> diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index c25f9458dae..484c9857dad 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -18,7 +18,7 @@ #include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/idevicewidget.h> #include <projectexplorer/devicesupport/processlist.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorertr.h> diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 6a718e92a44..edfed66d477 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -24,7 +24,7 @@ #include <projectexplorer/customexecutablerunconfiguration.h> #include <projectexplorer/deploymentdata.h> #include <projectexplorer/headerpath.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectnodes.h> #include <projectexplorer/selectablefilesmodel.h> diff --git a/src/plugins/incredibuild/makecommandbuilder.cpp b/src/plugins/incredibuild/makecommandbuilder.cpp index f5baa68a46a..0d5caa548ec 100644 --- a/src/plugins/incredibuild/makecommandbuilder.cpp +++ b/src/plugins/incredibuild/makecommandbuilder.cpp @@ -7,11 +7,11 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildstep.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> +#include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> #include <projectexplorer/toolchain.h> -#include <projectexplorer/project.h> #include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> // Compile-time only diff --git a/src/plugins/ios/iosbuildconfiguration.cpp b/src/plugins/ios/iosbuildconfiguration.cpp index 93838793d93..1254115d666 100644 --- a/src/plugins/ios/iosbuildconfiguration.cpp +++ b/src/plugins/ios/iosbuildconfiguration.cpp @@ -7,7 +7,7 @@ #include "iosconstants.h" #include "iostr.h" -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/namedwidget.h> #include <projectexplorer/target.h> diff --git a/src/plugins/ios/iosbuildstep.cpp b/src/plugins/ios/iosbuildstep.cpp index bbc8d878101..c017c77408c 100644 --- a/src/plugins/ios/iosbuildstep.cpp +++ b/src/plugins/ios/iosbuildstep.cpp @@ -11,7 +11,7 @@ #include <projectexplorer/buildsteplist.h> #include <projectexplorer/gcctoolchain.h> #include <projectexplorer/gnumakeparser.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/processparameters.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> diff --git a/src/plugins/ios/iosconfigurations.cpp b/src/plugins/ios/iosconfigurations.cpp index 04e4363a2a1..fe2dcaf4227 100644 --- a/src/plugins/ios/iosconfigurations.cpp +++ b/src/plugins/ios/iosconfigurations.cpp @@ -12,8 +12,8 @@ #include <coreplugin/icore.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> -#include <projectexplorer/kitinformation.h> #include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/toolchainmanager.h> diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index 3e86d9ec860..bd0dabc6f33 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -14,8 +14,8 @@ #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> #include <projectexplorer/taskhub.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> -#include <projectexplorer/kitinformation.h> #include <projectexplorer/devicesupport/devicemanager.h> #include <solutions/tasking/tasktree.h> diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index 326092fccc3..b2cf10f5da3 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -13,7 +13,7 @@ #include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/idevicewidget.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <utils/portlist.h> diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index b7eb1f6abc1..d8dd96c5a92 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -12,7 +12,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildsteplist.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/processparameters.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index 2012dfcc8f2..c0169af68b3 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -13,7 +13,7 @@ #include <projectexplorer/buildsteplist.h> #include <projectexplorer/deployconfiguration.h> #include <projectexplorer/devicesupport/devicemanager.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectnodes.h> #include <projectexplorer/runconfigurationaspects.h> diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index 8237a19c43a..973185f041d 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -16,7 +16,7 @@ #include <debugger/debuggerplugin.h> #include <debugger/debuggerruncontrol.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/target.h> diff --git a/src/plugins/ios/iossimulator.cpp b/src/plugins/ios/iossimulator.cpp index fa68c4031e3..d646052126a 100644 --- a/src/plugins/ios/iossimulator.cpp +++ b/src/plugins/ios/iossimulator.cpp @@ -5,7 +5,7 @@ #include "iosconstants.h" #include "iostr.h" -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <utils/port.h> #include <utils/process.h> diff --git a/src/plugins/mcusupport/mcukitinformation.h b/src/plugins/mcusupport/mcukitinformation.h index 80a18e3c345..c138ba2fe6c 100644 --- a/src/plugins/mcusupport/mcukitinformation.h +++ b/src/plugins/mcusupport/mcukitinformation.h @@ -3,7 +3,7 @@ #pragma once -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> namespace McuSupport { namespace Internal { diff --git a/src/plugins/mcusupport/test/unittest.cpp b/src/plugins/mcusupport/test/unittest.cpp index 697472c23fe..54933ca3da6 100644 --- a/src/plugins/mcusupport/test/unittest.cpp +++ b/src/plugins/mcusupport/test/unittest.cpp @@ -38,7 +38,7 @@ #include <gmock/gmock.h> #include <projectexplorer/customtoolchain.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/toolchain.h> diff --git a/src/plugins/mesonprojectmanager/kithelper.h b/src/plugins/mesonprojectmanager/kithelper.h index 00db098251a..f0d8c5be142 100644 --- a/src/plugins/mesonprojectmanager/kithelper.h +++ b/src/plugins/mesonprojectmanager/kithelper.h @@ -7,7 +7,7 @@ #include "versionhelper.h" #include <projectexplorer/kit.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <utils/macroexpander.h> #include <utils/qtcassert.h> diff --git a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp index f7a6ea59b8b..5bf33fea35b 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp @@ -13,7 +13,7 @@ #include <coreplugin/icore.h> #include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/taskhub.h> diff --git a/src/plugins/mesonprojectmanager/mesonproject.cpp b/src/plugins/mesonprojectmanager/mesonproject.cpp index 546347d459f..1566aa25533 100644 --- a/src/plugins/mesonprojectmanager/mesonproject.cpp +++ b/src/plugins/mesonprojectmanager/mesonproject.cpp @@ -10,7 +10,7 @@ #include <coreplugin/icontext.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> diff --git a/src/plugins/nim/project/nimbuildsystem.cpp b/src/plugins/nim/project/nimbuildsystem.cpp index 00d68034eb2..f07d8f607f3 100644 --- a/src/plugins/nim/project/nimbuildsystem.cpp +++ b/src/plugins/nim/project/nimbuildsystem.cpp @@ -6,9 +6,9 @@ #include "nimconstants.h" #include "nimbleproject.h" +#include <projectexplorer/kitaspects.h> #include <projectexplorer/target.h> #include <projectexplorer/toolchain.h> -#include <projectexplorer/kitinformation.h> #include <utils/algorithm.h> #include <utils/fileutils.h> diff --git a/src/plugins/nim/project/nimcompilerbuildstep.cpp b/src/plugins/nim/project/nimcompilerbuildstep.cpp index 9e941e6893c..5b11856941a 100644 --- a/src/plugins/nim/project/nimcompilerbuildstep.cpp +++ b/src/plugins/nim/project/nimcompilerbuildstep.cpp @@ -10,7 +10,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/ioutputparser.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/processparameters.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp index ed74cf43744..f7cf92fd064 100644 --- a/src/plugins/nim/project/nimproject.cpp +++ b/src/plugins/nim/project/nimproject.cpp @@ -9,7 +9,7 @@ #include <coreplugin/icontext.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/toolchain.h> diff --git a/src/plugins/perfprofiler/perfdatareader.cpp b/src/plugins/perfprofiler/perfdatareader.cpp index a545dff913e..3ff74aaef20 100644 --- a/src/plugins/perfprofiler/perfdatareader.cpp +++ b/src/plugins/perfprofiler/perfdatareader.cpp @@ -15,10 +15,10 @@ #include <coreplugin/progressmanager/progressmanager.h> #include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> -#include <projectexplorer/runcontrol.h> #include <projectexplorer/projectmanager.h> +#include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> #include <projectexplorer/toolchain.h> diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp index 4368c713933..1919547383d 100644 --- a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp +++ b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp @@ -13,7 +13,7 @@ #include <coreplugin/messagemanager.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> diff --git a/src/plugins/perfprofiler/perfprofilertool.cpp b/src/plugins/perfprofiler/perfprofilertool.cpp index 4d2ed0b05a5..102b4941b28 100644 --- a/src/plugins/perfprofiler/perfprofilertool.cpp +++ b/src/plugins/perfprofiler/perfprofilertool.cpp @@ -21,12 +21,12 @@ #include <debugger/analyzer/analyzermanager.h> #include <debugger/debuggericons.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/runcontrol.h> #include <projectexplorer/projectmanager.h> +#include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> #include <qtsupport/qtkitinformation.h> diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp index 534af139615..84a8fdf736e 100644 --- a/src/plugins/perfprofiler/perfsettings.cpp +++ b/src/plugins/perfprofiler/perfsettings.cpp @@ -16,7 +16,7 @@ #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/kit.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/target.h> #include <utils/aspects.h> diff --git a/src/plugins/perfprofiler/perftracepointdialog.cpp b/src/plugins/perfprofiler/perftracepointdialog.cpp index 3920b526b89..d5cb2e16e3d 100644 --- a/src/plugins/perfprofiler/perftracepointdialog.cpp +++ b/src/plugins/perfprofiler/perftracepointdialog.cpp @@ -5,7 +5,7 @@ #include "perftracepointdialog.h" #include <projectexplorer/devicesupport/devicemanager.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectmanager.h> diff --git a/src/plugins/projectexplorer/CMakeLists.txt b/src/plugins/projectexplorer/CMakeLists.txt index 63b511368c0..1d092e28fd4 100644 --- a/src/plugins/projectexplorer/CMakeLists.txt +++ b/src/plugins/projectexplorer/CMakeLists.txt @@ -103,9 +103,9 @@ add_qtc_plugin(ProjectExplorer jsonwizard/wizarddebug.h jsonwizard/jsonwizardscannergenerator.cpp jsonwizard/jsonwizardscannergenerator.h kit.cpp kit.h + kitaspects.cpp kitaspects.h kitchooser.cpp kitchooser.h kitfeatureprovider.h - kitinformation.cpp kitinformation.h kitmanager.cpp kitmanager.h kitmanagerconfigwidget.cpp kitmanagerconfigwidget.h kitmodel.cpp kitmodel.h diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index fe6f95b86ce..d44ba31dfa8 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -6,7 +6,7 @@ #include "buildconfiguration.h" #include "buildpropertiessettings.h" #include "devicesupport/idevice.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "projectexplorerconstants.h" #include "projectexplorertr.h" #include "target.h" diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 2d8afbd4fdb..234d4935085 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -12,7 +12,7 @@ #include "customparser.h" #include "environmentwidget.h" #include "kit.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "namedwidget.h" #include "projectexplorerconstants.h" #include "projectexplorer.h" diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 38bc2e3bddc..596421b8f65 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -10,7 +10,7 @@ #include "deployconfiguration.h" #include "devicesupport/devicemanager.h" #include "kit.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "project.h" #include "projectexplorer.h" #include "projectexplorerconstants.h" diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 503d82d22e7..0f1ca94997a 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -7,7 +7,7 @@ #include "buildsteplist.h" #include "customparser.h" #include "deployconfiguration.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "project.h" #include "projectexplorerconstants.h" #include "sanitizerparser.h" diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp index a99bb447122..03761502d6e 100644 --- a/src/plugins/projectexplorer/deployconfiguration.cpp +++ b/src/plugins/projectexplorer/deployconfiguration.cpp @@ -5,7 +5,7 @@ #include "buildsteplist.h" #include "deploymentdataview.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "project.h" #include "projectexplorerconstants.h" #include "projectexplorertr.h" diff --git a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp index 9ccf0662d07..b01ecb47bc7 100644 --- a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp @@ -3,7 +3,7 @@ #include "devicecheckbuildstep.h" -#include "../kitinformation.h" +#include "../kitaspects.h" #include "../projectexplorerconstants.h" #include "../projectexplorertr.h" diff --git a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp index bd73abf0857..2c5acf105b2 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp @@ -5,8 +5,8 @@ #include "idevice.h" #include "processlist.h" +#include "../kitaspects.h" #include "../kitchooser.h" -#include "../kitinformation.h" #include "../projectexplorertr.h" #include <utils/fancylineedit.h> diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 926bc31790a..cc55991e66a 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -9,7 +9,7 @@ #include "sshparameters.h" #include "../kit.h" -#include "../kitinformation.h" +#include "../kitaspects.h" #include "../projectexplorertr.h" #include "../target.h" diff --git a/src/plugins/projectexplorer/extracompiler.cpp b/src/plugins/projectexplorer/extracompiler.cpp index 1d0cb765685..a81ddda93fe 100644 --- a/src/plugins/projectexplorer/extracompiler.cpp +++ b/src/plugins/projectexplorer/extracompiler.cpp @@ -4,7 +4,7 @@ #include "extracompiler.h" #include "buildmanager.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "projectmanager.h" #include "target.h" diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index 933fff2fb8f..20be63d68e9 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -5,7 +5,7 @@ #include "devicesupport/idevice.h" #include "devicesupport/idevicefactory.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "kitmanager.h" #include "ioutputparser.h" #include "osparser.h" diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitaspects.cpp similarity index 99% rename from src/plugins/projectexplorer/kitinformation.cpp rename to src/plugins/projectexplorer/kitaspects.cpp index 3b53e1893d4..9fa4abd502a 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "kitinformation.h" +#include "kitaspects.h" #include "abi.h" #include "devicesupport/devicemanager.h" diff --git a/src/plugins/projectexplorer/kitinformation.h b/src/plugins/projectexplorer/kitaspects.h similarity index 100% rename from src/plugins/projectexplorer/kitinformation.h rename to src/plugins/projectexplorer/kitaspects.h diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 2da4794ca0b..433d9df9d48 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -7,7 +7,7 @@ #include "devicesupport/idevicefactory.h" #include "kit.h" #include "kitfeatureprovider.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "projectexplorerconstants.h" #include "projectexplorertr.h" #include "toolchainmanager.h" diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index 9fca99b0948..97118f2bb27 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -5,7 +5,7 @@ #include "devicesupport/idevicefactory.h" #include "kit.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "kitmanager.h" #include "projectexplorertr.h" #include "task.h" diff --git a/src/plugins/projectexplorer/makestep.cpp b/src/plugins/projectexplorer/makestep.cpp index 6ec22628457..8f7f82da8f2 100644 --- a/src/plugins/projectexplorer/makestep.cpp +++ b/src/plugins/projectexplorer/makestep.cpp @@ -6,7 +6,7 @@ #include "buildconfiguration.h" #include "devicesupport/idevice.h" #include "gnumakeparser.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "processparameters.h" #include "projectexplorer.h" #include "projectexplorerconstants.h" diff --git a/src/plugins/projectexplorer/parseissuesdialog.cpp b/src/plugins/projectexplorer/parseissuesdialog.cpp index 331773fe7b6..4abf2d3f988 100644 --- a/src/plugins/projectexplorer/parseissuesdialog.cpp +++ b/src/plugins/projectexplorer/parseissuesdialog.cpp @@ -4,7 +4,7 @@ #include "parseissuesdialog.h" #include "ioutputparser.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "kitchooser.h" #include "kitmanager.h" #include "projectexplorerconstants.h" diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 85a3850447d..fd91b4aaf55 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -10,7 +10,7 @@ #include "editorconfiguration.h" #include "environmentaspect.h" #include "kit.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "msvctoolchain.h" #include "projectexplorer.h" #include "projectexplorerconstants.h" diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 636e4937b7f..e7d990a568e 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -47,7 +47,7 @@ #include "jsonwizard/jsonwizardgeneratorfactory.h" #include "jsonwizard/jsonwizardpagefactory_p.h" #include "kitfeatureprovider.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "kitmanager.h" #include "kitoptionspage.h" #include "miniprojecttargetselector.h" diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index f398bb8b7cf..00dd2779ec3 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -81,9 +81,9 @@ Project { "ipotentialkit.h", "itaskhandler.h", "kit.cpp", "kit.h", + "kitaspects.cpp", "kitaspects.h", "kitchooser.cpp", "kitchooser.h", "kitfeatureprovider.h", - "kitinformation.cpp", "kitinformation.h", "kitmanager.cpp", "kitmanager.h", "kitmanagerconfigwidget.cpp", "kitmanagerconfigwidget.h", "kitmodel.cpp", "kitmodel.h", diff --git a/src/plugins/projectexplorer/projectimporter.cpp b/src/plugins/projectexplorer/projectimporter.cpp index 9c9b1f707a5..fec26598c33 100644 --- a/src/plugins/projectexplorer/projectimporter.cpp +++ b/src/plugins/projectexplorer/projectimporter.cpp @@ -5,7 +5,7 @@ #include "buildinfo.h" #include "kit.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "kitmanager.h" #include "projectexplorerconstants.h" #include "projectexplorertr.h" diff --git a/src/plugins/projectexplorer/rawprojectpart.cpp b/src/plugins/projectexplorer/rawprojectpart.cpp index 81d4951ed0c..4ac7f3947a8 100644 --- a/src/plugins/projectexplorer/rawprojectpart.cpp +++ b/src/plugins/projectexplorer/rawprojectpart.cpp @@ -6,7 +6,7 @@ #include "abi.h" #include "buildconfiguration.h" #include "buildsystem.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "project.h" #include "target.h" diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 365fb1673d6..64fafeea397 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -6,8 +6,7 @@ #include "buildconfiguration.h" #include "buildsystem.h" #include "environmentaspect.h" -#include "kitinformation.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "project.h" #include "projectexplorer.h" #include "projectexplorerconstants.h" diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 806e387fdf8..7afe438ea6b 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -6,7 +6,7 @@ #include "devicesupport/devicemanager.h" #include "devicesupport/idevice.h" #include "environmentaspect.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "projectexplorer.h" #include "projectexplorersettings.h" #include "projectexplorertr.h" diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 9b52213f065..a62a4b49b69 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -9,7 +9,7 @@ #include "devicesupport/idevice.h" #include "devicesupport/idevicefactory.h" #include "devicesupport/sshsettings.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "project.h" #include "projectexplorer.h" #include "projectexplorerconstants.h" diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index 6f20ca8eaa3..deea1ef32ef 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -12,7 +12,7 @@ #include "deploymentdata.h" #include "devicesupport/devicemanager.h" #include "kit.h" -#include "kitinformation.h" +#include "kitaspects.h" #include "kitmanager.h" #include "miniprojecttargetselector.h" #include "project.h" diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 110b92a19e1..4675ef4b1bf 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -23,7 +23,7 @@ #include <projectexplorer/buildsteplist.h> #include <projectexplorer/buildsystem.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/target.h> #include <projectexplorer/taskhub.h> diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 24894105ee0..a2f425f32aa 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -13,7 +13,7 @@ #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/gcctoolchain.h> #include <projectexplorer/kit.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/toolchain.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/msvctoolchain.h> diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index ad7ce2e1719..46044748a58 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -15,7 +15,7 @@ #include <projectexplorer/buildsteplist.h> #include <projectexplorer/deployconfiguration.h> #include <projectexplorer/kit.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorertr.h> diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.h b/src/plugins/qbsprojectmanager/qbskitinformation.h index 34d3537e3b0..f454ed3a387 100644 --- a/src/plugins/qbsprojectmanager/qbskitinformation.h +++ b/src/plugins/qbsprojectmanager/qbskitinformation.h @@ -3,7 +3,7 @@ #pragma once -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> namespace QbsProjectManager { namespace Internal { diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index b0968da5a8a..bcca10081a6 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -35,7 +35,7 @@ #include <projectexplorer/deploymentdata.h> #include <projectexplorer/headerpath.h> #include <projectexplorer/kit.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> diff --git a/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp b/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp index 541cbbe5fb1..1d2cd4e4537 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp @@ -10,7 +10,7 @@ #include <coreplugin/documentmanager.h> #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildinfo.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> diff --git a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp index b79f79b7a6c..617c0d63e80 100644 --- a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp @@ -12,14 +12,14 @@ #include "qmakesettings.h" #include "qmakestep.h" -#include <projectexplorer/target.h> -#include <projectexplorer/toolchain.h> #include <projectexplorer/buildsteplist.h> #include <projectexplorer/gnumakeparser.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/processparameters.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/target.h> +#include <projectexplorer/toolchain.h> #include <projectexplorer/xcodebuildparser.h> #include <utils/process.h> diff --git a/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp b/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp index 16f533020db..d3d3c19b756 100644 --- a/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp +++ b/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp @@ -12,7 +12,7 @@ #include <cppeditor/cppeditorconstants.h> #include <cppeditor/cpptoolsreuse.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projecttree.h> diff --git a/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewactions.cpp b/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewactions.cpp index ccd9a970096..ebd53b7f649 100644 --- a/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewactions.cpp +++ b/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewactions.cpp @@ -10,7 +10,7 @@ #include <utils/utilsicons.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectmanager.h> diff --git a/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp b/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp index cf2ae2ef941..d1d9b4fced1 100644 --- a/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp +++ b/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp @@ -4,7 +4,7 @@ #include "qmlpreviewfileontargetfinder.h" #include <projectexplorer/deploymentdata.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectnodes.h> diff --git a/src/plugins/qmlpreview/qmlpreviewplugin.cpp b/src/plugins/qmlpreview/qmlpreviewplugin.cpp index d18b8c37b0e..5f0b23a3d61 100644 --- a/src/plugins/qmlpreview/qmlpreviewplugin.cpp +++ b/src/plugins/qmlpreview/qmlpreviewplugin.cpp @@ -21,7 +21,7 @@ #include <extensionsystem/pluginmanager.h> #include <projectexplorer/kit.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/qmlprofiler/qmlprofilerattachdialog.cpp b/src/plugins/qmlprofiler/qmlprofilerattachdialog.cpp index 1b52367eb12..679166b19c7 100644 --- a/src/plugins/qmlprofiler/qmlprofilerattachdialog.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerattachdialog.cpp @@ -4,8 +4,8 @@ #include "qmlprofilerattachdialog.h" #include "qmlprofilertr.h" +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitchooser.h> -#include <projectexplorer/kitinformation.h> #include <QDialogButtonBox> #include <QFormLayout> diff --git a/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp b/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp index ff386c7a5ba..5fb1f203ef6 100644 --- a/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp @@ -4,7 +4,7 @@ #include "qmlprofilerdetailsrewriter.h" #include <projectexplorer/kit.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/target.h> diff --git a/src/plugins/qmlprofiler/qmlprofilerplugin.cpp b/src/plugins/qmlprofiler/qmlprofilerplugin.cpp index b605b249ca7..d1f6ef58996 100644 --- a/src/plugins/qmlprofiler/qmlprofilerplugin.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerplugin.cpp @@ -41,7 +41,7 @@ #include <extensionsystem/pluginmanager.h> #include <projectexplorer/environmentaspect.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runconfiguration.h> #include <projectexplorer/target.h> diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp index 41b67edda78..6e762a8dc05 100644 --- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp @@ -8,7 +8,7 @@ #include <coreplugin/icore.h> #include <coreplugin/helpmanager.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorericons.h> #include <projectexplorer/runconfiguration.h> diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 1f27fb30124..bd2e8f54b8a 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -33,7 +33,7 @@ #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/environmentaspect.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp index 4cf135f0be7..4539948be37 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp @@ -6,7 +6,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildinfo.h> #include <projectexplorer/customexecutablerunconfiguration.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/project.h> #include <projectexplorer/projectmanager.h> diff --git a/src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.cpp b/src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.cpp index 307b6d61451..c8f7f63bffa 100644 --- a/src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.cpp +++ b/src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.cpp @@ -27,7 +27,7 @@ #include <projectexplorer/deploymentdata.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index b5385bb4124..7daae789916 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -15,7 +15,7 @@ #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/environmentaspect.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index 0d869d78673..f32f0a722b8 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -18,8 +18,8 @@ #include <projectexplorer/devicesupport/deviceusedportsgatherer.h> #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/kit.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitchooser.h> -#include <projectexplorer/kitinformation.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/runconfigurationaspects.h> diff --git a/src/plugins/qnx/qnxplugin.cpp b/src/plugins/qnx/qnxplugin.cpp index 09fd528086c..bd2aa2d8b18 100644 --- a/src/plugins/qnx/qnxplugin.cpp +++ b/src/plugins/qnx/qnxplugin.cpp @@ -19,16 +19,16 @@ #include <extensionsystem/iplugin.h> +#include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/deployconfiguration.h> #include <projectexplorer/devicesupport/devicecheckbuildstep.h> #include <projectexplorer/devicesupport/devicemanager.h> -#include <projectexplorer/deployconfiguration.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/environmentaspect.h> +#include <projectexplorer/kitaspects.h> +#include <projectexplorer/kitmanager.h> +#include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/kitmanager.h> -#include <projectexplorer/environmentaspect.h> -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/project.h> #include <projectexplorer/target.h> #include <projectexplorer/toolchain.h> diff --git a/src/plugins/qtsupport/qtkitinformation.h b/src/plugins/qtsupport/qtkitinformation.h index f1f0a0b6a0b..723a7c71aab 100644 --- a/src/plugins/qtsupport/qtkitinformation.h +++ b/src/plugins/qtsupport/qtkitinformation.h @@ -7,7 +7,7 @@ #include "baseqtversion.h" -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> namespace Utils { class MacroExpander; } diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index a8f3d31d1e9..6628d97615e 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -8,7 +8,7 @@ #include <projectexplorer/deployablefile.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <solutions/tasking/tasktree.h> diff --git a/src/plugins/remotelinux/deploymenttimeinfo.cpp b/src/plugins/remotelinux/deploymenttimeinfo.cpp index e9c59156158..d403534c60d 100644 --- a/src/plugins/remotelinux/deploymenttimeinfo.cpp +++ b/src/plugins/remotelinux/deploymenttimeinfo.cpp @@ -6,7 +6,7 @@ #include <projectexplorer/deployablefile.h> #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/devicesupport/sshparameters.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/target.h> #include <QDateTime> diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 022dc9fd7cf..7556ad9947e 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -11,7 +11,7 @@ #include <projectexplorer/buildsystem.h> #include <projectexplorer/deployconfiguration.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/makestep.h> #include <projectexplorer/processparameters.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp index 7615a4ef553..537ca8ebe44 100644 --- a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp @@ -8,7 +8,7 @@ #include <projectexplorer/devicesupport/filetransferinterface.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp index d2c19e29613..d94857c4d66 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp @@ -10,7 +10,7 @@ #include <projectexplorer/environmentaspectwidget.h> #include <projectexplorer/environmentwidget.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/target.h> #include <utils/algorithm.h> diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index b3af1fb873d..2cb96de7405 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -22,7 +22,7 @@ #include "filesystemaccess_test.h" #endif -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 0165b0268f8..37633d8f3ea 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -11,7 +11,7 @@ #include <projectexplorer/buildtargetinfo.h> #include <projectexplorer/deploymentdata.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/runcontrol.h> diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index 203fed34643..64544096b9c 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -12,7 +12,7 @@ #include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/filetransfer.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/target.h> diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index f2123cd2b2e..85f951cc632 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -18,7 +18,7 @@ #include "projectexplorer/target.h" #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/jsonwizard/jsonwizardfactory.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 53d256ce806..158f4bb6e62 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -25,7 +25,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/deploymentdata.h> #include <projectexplorer/devicesupport/devicemanager.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index fdbf6eb87db..601ba20ec9d 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -15,7 +15,7 @@ #include <extensionsystem/pluginmanager.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorericons.h> #include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfigurationaspects.h> From c82f06d8344784a7ccec0005e0f8af6d1c2d50bc Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 10 Aug 2023 14:35:32 +0200 Subject: [PATCH 0698/1777] Utils: Drop unneeded Q_OBJECT macros from public headers Change-Id: Ia495397179dc8fd1308bac982d5fb27903444884 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/detailsbutton.h | 3 --- src/libs/utils/environmentmodel.h | 2 -- src/libs/utils/faketooltip.h | 2 -- src/libs/utils/historycompleter.h | 8 ++------ src/libs/utils/infobar.h | 2 -- src/libs/utils/itemviews.h | 4 ---- src/libs/utils/launchersocket.h | 1 - src/libs/utils/minimizableinfobars.h | 3 --- src/libs/utils/namevaluesdialog.h | 2 -- src/libs/utils/namevaluevalidator.h | 2 +- src/libs/utils/navigationtreeview.h | 1 - src/libs/utils/networkaccessmanager.h | 1 - src/libs/utils/optionpushbutton.h | 2 -- src/libs/utils/overlaywidget.h | 1 - src/libs/utils/progressindicator.h | 1 - src/libs/utils/removefiledialog.h | 2 -- src/libs/utils/statuslabel.h | 2 -- src/libs/utils/styleanimator.h | 2 -- src/libs/utils/styledbar.h | 3 +-- src/libs/utils/tooltip/tips.h | 4 ---- src/libs/utils/transientscroll.h | 2 -- src/libs/utils/treeviewcombobox.h | 2 -- src/libs/utils/variablechooser.h | 2 -- 23 files changed, 4 insertions(+), 50 deletions(-) diff --git a/src/libs/utils/detailsbutton.h b/src/libs/utils/detailsbutton.h index 2f49980dbd5..1e222a0bcd1 100644 --- a/src/libs/utils/detailsbutton.h +++ b/src/libs/utils/detailsbutton.h @@ -15,8 +15,6 @@ QT_END_NAMESPACE namespace Utils { class QTCREATOR_UTILS_EXPORT FadingPanel : public QWidget { - Q_OBJECT - public: FadingPanel(QWidget *parent = nullptr) : QWidget(parent) @@ -27,7 +25,6 @@ public: class QTCREATOR_UTILS_EXPORT FadingWidget : public FadingPanel { - Q_OBJECT public: FadingWidget(QWidget *parent = nullptr); void fadeTo(qreal value) override; diff --git a/src/libs/utils/environmentmodel.h b/src/libs/utils/environmentmodel.h index 46c16b4e73c..82bf98d43f5 100644 --- a/src/libs/utils/environmentmodel.h +++ b/src/libs/utils/environmentmodel.h @@ -11,8 +11,6 @@ namespace Utils { class QTCREATOR_UTILS_EXPORT EnvironmentModel : public NameValueModel { - Q_OBJECT - public: Environment baseEnvironment() const; void setBaseEnvironment(const Environment &env); diff --git a/src/libs/utils/faketooltip.h b/src/libs/utils/faketooltip.h index 7df85a816ec..1f8f3acc57c 100644 --- a/src/libs/utils/faketooltip.h +++ b/src/libs/utils/faketooltip.h @@ -11,8 +11,6 @@ namespace Utils { class QTCREATOR_UTILS_EXPORT FakeToolTip : public QWidget { - Q_OBJECT - public: explicit FakeToolTip(QWidget *parent = nullptr); diff --git a/src/libs/utils/historycompleter.h b/src/libs/utils/historycompleter.h index 81335413edc..7a1fd2a4993 100644 --- a/src/libs/utils/historycompleter.h +++ b/src/libs/utils/historycompleter.h @@ -15,8 +15,6 @@ namespace Internal { class HistoryCompleterPrivate; } class QTCREATOR_UTILS_EXPORT HistoryCompleter : public QCompleter { - Q_OBJECT - public: static void setSettings(QtcSettings *settings); HistoryCompleter(const QString &historyKey, QObject *parent = nullptr); @@ -24,6 +22,8 @@ public: QString historyItem() const; bool hasHistory() const { return historySize() > 0; } static bool historyExistsFor(const QString &historyKey); + void clearHistory(); + void addEntry(const QString &str); private: ~HistoryCompleter() override; @@ -31,10 +31,6 @@ private: int maximalHistorySize() const; void setMaximalHistorySize(int numberOfEntries); -public Q_SLOTS: - void clearHistory(); - void addEntry(const QString &str); - private: Internal::HistoryCompleterPrivate *d; }; diff --git a/src/libs/utils/infobar.h b/src/libs/utils/infobar.h index 11657375c5b..8548b9ecdde 100644 --- a/src/libs/utils/infobar.h +++ b/src/libs/utils/infobar.h @@ -123,8 +123,6 @@ private: class QTCREATOR_UTILS_EXPORT InfoBarDisplay : public QObject { - Q_OBJECT - public: InfoBarDisplay(QObject *parent = nullptr); void setTarget(QBoxLayout *layout, int index); diff --git a/src/libs/utils/itemviews.h b/src/libs/utils/itemviews.h index 8b5074b20cc..cad6d12746a 100644 --- a/src/libs/utils/itemviews.h +++ b/src/libs/utils/itemviews.h @@ -63,7 +63,6 @@ public: class QTCREATOR_UTILS_EXPORT TreeView : public View<QTreeView> { - Q_OBJECT public: TreeView(QWidget *parent = nullptr) : View<QTreeView>(parent) @@ -72,7 +71,6 @@ public: class QTCREATOR_UTILS_EXPORT TreeWidget : public View<QTreeWidget> { - Q_OBJECT public: TreeWidget(QWidget *parent = nullptr) : View<QTreeWidget>(parent) @@ -81,7 +79,6 @@ public: class QTCREATOR_UTILS_EXPORT ListView : public View<QListView> { - Q_OBJECT public: ListView(QWidget *parent = nullptr) : View<QListView>(parent) @@ -90,7 +87,6 @@ public: class QTCREATOR_UTILS_EXPORT ListWidget : public View<QListWidget> { - Q_OBJECT public: ListWidget(QWidget *parent = nullptr) : View<QListWidget>(parent) diff --git a/src/libs/utils/launchersocket.h b/src/libs/utils/launchersocket.h index be1b7f7f9ba..54c212c479b 100644 --- a/src/libs/utils/launchersocket.h +++ b/src/libs/utils/launchersocket.h @@ -128,7 +128,6 @@ private: class LauncherHandle : public QObject { - Q_OBJECT public: // Called from caller's thread, moved to launcher's thread afterwards. LauncherHandle(quintptr token) : m_token(token) {} diff --git a/src/libs/utils/minimizableinfobars.h b/src/libs/utils/minimizableinfobars.h index a5818ac2cb6..ceba6b0e475 100644 --- a/src/libs/utils/minimizableinfobars.h +++ b/src/libs/utils/minimizableinfobars.h @@ -21,8 +21,6 @@ namespace Utils { class QTCREATOR_UTILS_EXPORT MinimizableInfoBars : public QObject { - Q_OBJECT - public: using ActionCreator = std::function<QAction *(QWidget *widget)>; @@ -47,7 +45,6 @@ private: void showInfoBar(const Id &id); -private: InfoBar &m_infoBar; QString m_settingsGroup; QHash<Id, QAction *> m_actions; diff --git a/src/libs/utils/namevaluesdialog.h b/src/libs/utils/namevaluesdialog.h index deb54b70538..ada71d61fcf 100644 --- a/src/libs/utils/namevaluesdialog.h +++ b/src/libs/utils/namevaluesdialog.h @@ -19,8 +19,6 @@ namespace Internal { class NameValueItemsWidget; } class QTCREATOR_UTILS_EXPORT NameValuesDialog : public QDialog { - Q_OBJECT - public: void setNameValueItems(const NameValueItems &items); NameValueItems nameValueItems() const; diff --git a/src/libs/utils/namevaluevalidator.h b/src/libs/utils/namevaluevalidator.h index c5c3aa23a69..2f11196eb6a 100644 --- a/src/libs/utils/namevaluevalidator.h +++ b/src/libs/utils/namevaluevalidator.h @@ -21,7 +21,6 @@ class NameValueModel; class QTCREATOR_UTILS_EXPORT NameValueValidator : public QValidator { - Q_OBJECT public: NameValueValidator(QWidget *parent, NameValueModel *model, @@ -40,4 +39,5 @@ private: QPersistentModelIndex m_index; mutable QTimer m_hideTipTimer; }; + } // namespace Utils diff --git a/src/libs/utils/navigationtreeview.h b/src/libs/utils/navigationtreeview.h index ab1b1b7b4a7..a3a0e2b07de 100644 --- a/src/libs/utils/navigationtreeview.h +++ b/src/libs/utils/navigationtreeview.h @@ -11,7 +11,6 @@ namespace Utils { class QTCREATOR_UTILS_EXPORT NavigationTreeView : public TreeView { - Q_OBJECT public: explicit NavigationTreeView(QWidget *parent = nullptr); void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override; diff --git a/src/libs/utils/networkaccessmanager.h b/src/libs/utils/networkaccessmanager.h index 725757c2fe6..33a479946b2 100644 --- a/src/libs/utils/networkaccessmanager.h +++ b/src/libs/utils/networkaccessmanager.h @@ -11,7 +11,6 @@ namespace Utils { class QTCREATOR_UTILS_EXPORT NetworkAccessManager : public QNetworkAccessManager { - Q_OBJECT public: NetworkAccessManager(QObject *parent = nullptr); diff --git a/src/libs/utils/optionpushbutton.h b/src/libs/utils/optionpushbutton.h index e0b5800fd39..143ec2477ea 100644 --- a/src/libs/utils/optionpushbutton.h +++ b/src/libs/utils/optionpushbutton.h @@ -16,8 +16,6 @@ namespace Utils { class QTCREATOR_UTILS_EXPORT OptionPushButton : public QPushButton { - Q_OBJECT - public: OptionPushButton(QWidget *parent = nullptr); OptionPushButton(const QString &text, QWidget *parent = nullptr); diff --git a/src/libs/utils/overlaywidget.h b/src/libs/utils/overlaywidget.h index 82e635c7ab6..8bc5b7d1eb5 100644 --- a/src/libs/utils/overlaywidget.h +++ b/src/libs/utils/overlaywidget.h @@ -13,7 +13,6 @@ namespace Utils { class QTCREATOR_UTILS_EXPORT OverlayWidget : public QWidget { - Q_OBJECT public: using PaintFunction = std::function<void(QWidget *, QPainter &, QPaintEvent *)>; diff --git a/src/libs/utils/progressindicator.h b/src/libs/utils/progressindicator.h index df2e587a849..71732570e8a 100644 --- a/src/libs/utils/progressindicator.h +++ b/src/libs/utils/progressindicator.h @@ -55,7 +55,6 @@ private: class QTCREATOR_UTILS_EXPORT ProgressIndicator : public OverlayWidget { - Q_OBJECT public: explicit ProgressIndicator(ProgressIndicatorSize size, QWidget *parent = nullptr); diff --git a/src/libs/utils/removefiledialog.h b/src/libs/utils/removefiledialog.h index 7fef70eb63f..a0a4299c253 100644 --- a/src/libs/utils/removefiledialog.h +++ b/src/libs/utils/removefiledialog.h @@ -17,8 +17,6 @@ class FilePath; class QTCREATOR_UTILS_EXPORT RemoveFileDialog : public QDialog { - Q_OBJECT - public: explicit RemoveFileDialog(const FilePath &filePath, QWidget *parent = nullptr); ~RemoveFileDialog() override; diff --git a/src/libs/utils/statuslabel.h b/src/libs/utils/statuslabel.h index 091c186bbf0..5fdf852a9e8 100644 --- a/src/libs/utils/statuslabel.h +++ b/src/libs/utils/statuslabel.h @@ -15,11 +15,9 @@ namespace Utils { class QTCREATOR_UTILS_EXPORT StatusLabel : public QLabel { - Q_OBJECT public: explicit StatusLabel(QWidget *parent = nullptr); -public slots: void showStatusMessage(const QString &message, int timeoutMS = 5000); void clearStatusMessage(); diff --git a/src/libs/utils/styleanimator.h b/src/libs/utils/styleanimator.h index 22ab0745b30..76576be8208 100644 --- a/src/libs/utils/styleanimator.h +++ b/src/libs/utils/styleanimator.h @@ -62,8 +62,6 @@ public : class QTCREATOR_UTILS_EXPORT StyleAnimator : public QObject { - Q_OBJECT - public: StyleAnimator(QObject *parent = nullptr) : QObject(parent) {} diff --git a/src/libs/utils/styledbar.h b/src/libs/utils/styledbar.h index c6c41575cfb..654a8f216e6 100644 --- a/src/libs/utils/styledbar.h +++ b/src/libs/utils/styledbar.h @@ -11,7 +11,6 @@ namespace Utils { class QTCREATOR_UTILS_EXPORT StyledBar : public QWidget { - Q_OBJECT public: StyledBar(QWidget *parent = nullptr); void setSingleRow(bool singleRow); @@ -26,9 +25,9 @@ protected: class QTCREATOR_UTILS_EXPORT StyledSeparator : public QWidget { - Q_OBJECT public: StyledSeparator(QWidget *parent = nullptr); + protected: void paintEvent(QPaintEvent *event) override; }; diff --git a/src/libs/utils/tooltip/tips.h b/src/libs/utils/tooltip/tips.h index 1eef42e8dcf..447c5e63439 100644 --- a/src/libs/utils/tooltip/tips.h +++ b/src/libs/utils/tooltip/tips.h @@ -3,8 +3,6 @@ #pragma once -#include "../utils_global.h" - #include <QLabel> #include <QPixmap> #include <QVariant> @@ -41,7 +39,6 @@ using TextItem = std::pair<QString, Qt::TextFormat>; class TextTip : public TipLabel { - Q_OBJECT public: TextTip(QWidget *parent); @@ -61,7 +58,6 @@ private: class ColorTip : public TipLabel { - Q_OBJECT public: ColorTip(QWidget *parent); diff --git a/src/libs/utils/transientscroll.h b/src/libs/utils/transientscroll.h index c48880caa78..98140764499 100644 --- a/src/libs/utils/transientscroll.h +++ b/src/libs/utils/transientscroll.h @@ -18,7 +18,6 @@ class ScrollBarPrivate; class QTCREATOR_UTILS_EXPORT TransientScrollAreaSupport : public QObject { - Q_OBJECT public: static void support(QAbstractScrollArea *scrollArea); virtual ~TransientScrollAreaSupport(); @@ -34,7 +33,6 @@ private: class QTCREATOR_UTILS_EXPORT ScrollBar : public QScrollBar { - Q_OBJECT public: explicit ScrollBar(QWidget *parent = nullptr); virtual ~ScrollBar(); diff --git a/src/libs/utils/treeviewcombobox.h b/src/libs/utils/treeviewcombobox.h index b8afc20bc88..32169f3db36 100644 --- a/src/libs/utils/treeviewcombobox.h +++ b/src/libs/utils/treeviewcombobox.h @@ -12,7 +12,6 @@ namespace Utils { class QTCREATOR_UTILS_EXPORT TreeViewComboBoxView : public QTreeView { - Q_OBJECT public: TreeViewComboBoxView(QWidget *parent = nullptr); void adjustWidth(int width); @@ -20,7 +19,6 @@ public: class QTCREATOR_UTILS_EXPORT TreeViewComboBox : public QComboBox { - Q_OBJECT public: TreeViewComboBox(QWidget *parent = nullptr); diff --git a/src/libs/utils/variablechooser.h b/src/libs/utils/variablechooser.h index 257dcea5e2c..2ad7aebfbf5 100644 --- a/src/libs/utils/variablechooser.h +++ b/src/libs/utils/variablechooser.h @@ -19,8 +19,6 @@ namespace Internal { class VariableChooserPrivate; } class QTCREATOR_UTILS_EXPORT VariableChooser : public QWidget { - Q_OBJECT - public: explicit VariableChooser(QWidget *parent = nullptr); ~VariableChooser() override; From aa25fdcc69419928b99f4b312f9b9f025ac5c332 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 11 Aug 2023 11:23:12 +0200 Subject: [PATCH 0699/1777] QtSupport: Rename qtkitinformation.{h,cpp} -> qtkitaspect.{h,cpp} Change-Id: I12229e5e98b468101d32edd35be74bbda0921d89 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/android/androidbuildapkstep.cpp | 2 +- src/plugins/android/androidconfigurations.cpp | 2 +- src/plugins/android/androiddebugsupport.cpp | 2 +- src/plugins/android/androiddeployqtstep.cpp | 2 +- src/plugins/android/androidmanager.cpp | 2 +- src/plugins/android/androidmanifesteditorwidget.cpp | 2 +- src/plugins/android/androidpackageinstallationstep.cpp | 2 +- src/plugins/android/androidqmlpreviewworker.cpp | 2 +- src/plugins/android/androidqtversion.cpp | 2 +- src/plugins/android/androidrunconfiguration.cpp | 2 +- src/plugins/android/androidrunner.cpp | 2 +- src/plugins/android/androidrunnerworker.cpp | 2 +- src/plugins/android/createandroidmanifestwizard.cpp | 2 +- src/plugins/android/javalanguageserver.cpp | 2 +- src/plugins/autotest/autotestunittests.cpp | 2 +- src/plugins/autotest/loadprojectscenario.cpp | 2 +- src/plugins/clangcodemodel/test/clangdtests.cpp | 2 +- src/plugins/clangtools/clangtoolsunittests.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakekitinformation.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakeproject.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp | 2 +- src/plugins/debugger/debuggerruncontrol.cpp | 2 +- src/plugins/docker/dockerdevice.cpp | 2 +- src/plugins/docker/kitdetector.cpp | 2 +- .../genericprojectmanager/genericbuildconfiguration.cpp | 2 +- src/plugins/genericprojectmanager/genericproject.cpp | 2 +- src/plugins/insight/insightmodel.cpp | 2 +- src/plugins/ios/iosconfigurations.cpp | 2 +- src/plugins/ios/iosdsymbuildstep.cpp | 2 +- src/plugins/ios/iosqtversion.cpp | 2 +- src/plugins/mcusupport/mcukitmanager.cpp | 2 +- src/plugins/mcusupport/mcusupportoptions.cpp | 2 +- src/plugins/mesonprojectmanager/mesonbuildsystem.cpp | 2 +- src/plugins/perfprofiler/perfdatareader.cpp | 2 +- src/plugins/perfprofiler/perfprofilertool.cpp | 2 +- src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp | 2 +- src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp | 2 +- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 2 +- src/plugins/qbsprojectmanager/qbsprofilemanager.cpp | 2 +- src/plugins/qbsprojectmanager/qbsproject.cpp | 2 +- src/plugins/qbsprojectmanager/qbsprojectimporter.cpp | 2 +- .../customwidgetwizard/customwidgetwizarddialog.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakekitinformation.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakenodes.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakeproject.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 2 +- src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp | 2 +- .../components/componentcore/modelnodeoperations.cpp | 2 +- .../components/contentlibrary/contentlibraryview.cpp | 2 +- src/plugins/qmldesigner/components/edit3d/edit3dview.cpp | 2 +- .../qmldesigner/components/integration/designdocument.cpp | 2 +- .../designercore/imagecache/meshimagecachecollector.cpp | 2 +- .../designercore/instances/nodeinstanceserverproxy.cpp | 2 +- .../qmldesigner/designercore/instances/nodeinstanceview.cpp | 2 +- src/plugins/qmldesigner/generateresource.cpp | 2 +- src/plugins/qmldesigner/puppetenvironmentbuilder.cpp | 2 +- src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp | 2 +- src/plugins/qmldesigner/qmldesignerprojectmanager.cpp | 2 +- src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp | 2 +- src/plugins/qmljstools/qmljsbundleprovider.cpp | 2 +- src/plugins/qmljstools/qmljsmodelmanager.cpp | 2 +- src/plugins/qmlpreview/qmlpreviewplugin.cpp | 2 +- src/plugins/qmlpreview/qmlpreviewruncontrol.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilertool.cpp | 2 +- src/plugins/qmlprojectmanager/qmlproject.cpp | 2 +- src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp | 2 +- src/plugins/qnx/qnxdebugsupport.cpp | 2 +- src/plugins/qnx/qnxsettingspage.cpp | 2 +- src/plugins/qtsupport/CMakeLists.txt | 2 +- src/plugins/qtsupport/baseqtversion.cpp | 2 +- src/plugins/qtsupport/exampleslistmodel.cpp | 2 +- src/plugins/qtsupport/externaleditors.cpp | 2 +- src/plugins/qtsupport/qscxmlcgenerator.cpp | 2 +- src/plugins/qtsupport/qtcppkitinfo.cpp | 2 +- .../qtsupport/{qtkitinformation.cpp => qtkitaspect.cpp} | 2 +- src/plugins/qtsupport/{qtkitinformation.h => qtkitaspect.h} | 0 src/plugins/qtsupport/qtoutputformatter.cpp | 2 +- src/plugins/qtsupport/qtprojectimporter.cpp | 2 +- src/plugins/qtsupport/qtsupport.qbs | 4 ++-- src/plugins/qtsupport/qtsupportplugin.cpp | 2 +- src/plugins/qtsupport/uicgenerator.cpp | 2 +- src/plugins/scxmleditor/scxmleditordocument.cpp | 2 +- src/plugins/studiowelcome/studiowelcomeplugin.cpp | 2 +- src/plugins/webassembly/webassemblytoolchain.cpp | 2 +- 90 files changed, 90 insertions(+), 90 deletions(-) rename src/plugins/qtsupport/{qtkitinformation.cpp => qtkitaspect.cpp} (99%) rename src/plugins/qtsupport/{qtkitinformation.h => qtkitaspect.h} (100%) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index c80eb9cd4ca..2018371e362 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -29,7 +29,7 @@ #include <projectexplorer/target.h> #include <projectexplorer/taskhub.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/fancylineedit.h> diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index 0a1e9d60ff8..b12014d4c7f 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -27,7 +27,7 @@ #include <debugger/debuggerkitinformation.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtversionmanager.h> #include <utils/algorithm.h> diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp index 354b8a77fda..ee72741d411 100644 --- a/src/plugins/android/androiddebugsupport.cpp +++ b/src/plugins/android/androiddebugsupport.cpp @@ -17,7 +17,7 @@ #include <projectexplorer/target.h> #include <projectexplorer/toolchain.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/fileutils.h> #include <utils/hostosinfo.h> diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index e91687f6db7..da00ac6396a 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -30,7 +30,7 @@ #include <projectexplorer/toolchain.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/async.h> diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index 22fe6412688..e1e5752d510 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -28,7 +28,7 @@ #include <projectexplorer/target.h> #include <projectexplorer/buildsystem.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> #include <qtsupport/baseqtversion.h> diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index 1e932b4413d..e6ad6ee0251 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -14,7 +14,7 @@ #include <coreplugin/icore.h> #include <coreplugin/editormanager/ieditor.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/kitaspects.h> diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp index e26e2ec009d..1cebb663ab0 100644 --- a/src/plugins/android/androidpackageinstallationstep.cpp +++ b/src/plugins/android/androidpackageinstallationstep.cpp @@ -19,7 +19,7 @@ #include <projectexplorer/toolchain.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/hostosinfo.h> #include <utils/process.h> diff --git a/src/plugins/android/androidqmlpreviewworker.cpp b/src/plugins/android/androidqmlpreviewworker.cpp index af238e00d0d..fc51e2a22dd 100644 --- a/src/plugins/android/androidqmlpreviewworker.cpp +++ b/src/plugins/android/androidqmlpreviewworker.cpp @@ -25,7 +25,7 @@ #include <qmlprojectmanager/qmlprojectmanagerconstants.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/async.h> #include <utils/process.h> diff --git a/src/plugins/android/androidqtversion.cpp b/src/plugins/android/androidqtversion.cpp index 3dc6561311a..68a1b94ca9e 100644 --- a/src/plugins/android/androidqtversion.cpp +++ b/src/plugins/android/androidqtversion.cpp @@ -12,7 +12,7 @@ #include <utils/fileutils.h> #include <utils/hostosinfo.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtversionmanager.h> diff --git a/src/plugins/android/androidrunconfiguration.cpp b/src/plugins/android/androidrunconfiguration.cpp index f8fb1b16487..98636857355 100644 --- a/src/plugins/android/androidrunconfiguration.cpp +++ b/src/plugins/android/androidrunconfiguration.cpp @@ -13,7 +13,7 @@ #include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/detailswidget.h> #include <utils/process.h> diff --git a/src/plugins/android/androidrunner.cpp b/src/plugins/android/androidrunner.cpp index c3212f8e68b..b62e5563413 100644 --- a/src/plugins/android/androidrunner.cpp +++ b/src/plugins/android/androidrunner.cpp @@ -18,7 +18,7 @@ #include <projectexplorer/projectexplorersettings.h> #include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/url.h> #include <QHostAddress> diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 3553f87ad38..3be19a69fad 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -18,7 +18,7 @@ #include <projectexplorer/target.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/async.h> #include <utils/fileutils.h> diff --git a/src/plugins/android/createandroidmanifestwizard.cpp b/src/plugins/android/createandroidmanifestwizard.cpp index 1eb979f7f59..7c334476a21 100644 --- a/src/plugins/android/createandroidmanifestwizard.cpp +++ b/src/plugins/android/createandroidmanifestwizard.cpp @@ -16,7 +16,7 @@ #include <projectexplorer/runconfiguration.h> #include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/infolabel.h> #include <utils/pathchooser.h> diff --git a/src/plugins/android/javalanguageserver.cpp b/src/plugins/android/javalanguageserver.cpp index b36f8f861dc..f3448461a1d 100644 --- a/src/plugins/android/javalanguageserver.cpp +++ b/src/plugins/android/javalanguageserver.cpp @@ -14,7 +14,7 @@ #include <projectexplorer/project.h> #include <projectexplorer/projectnodes.h> #include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/environment.h> #include <utils/pathchooser.h> #include <utils/temporarydirectory.h> diff --git a/src/plugins/autotest/autotestunittests.cpp b/src/plugins/autotest/autotestunittests.cpp index b036570d6e8..0ce52721e3f 100644 --- a/src/plugins/autotest/autotestunittests.cpp +++ b/src/plugins/autotest/autotestunittests.cpp @@ -20,7 +20,7 @@ #include <projectexplorer/projectexplorer.h> #include <projectexplorer/toolchain.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/environment.h> diff --git a/src/plugins/autotest/loadprojectscenario.cpp b/src/plugins/autotest/loadprojectscenario.cpp index fa0530cbc94..9dc136f4e49 100644 --- a/src/plugins/autotest/loadprojectscenario.cpp +++ b/src/plugins/autotest/loadprojectscenario.cpp @@ -6,7 +6,7 @@ #include <cppeditor/cpptoolstestcase.h> #include <cppeditor/projectinfo.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> diff --git a/src/plugins/clangcodemodel/test/clangdtests.cpp b/src/plugins/clangcodemodel/test/clangdtests.cpp index ceaf25787e8..190c0b55c76 100644 --- a/src/plugins/clangcodemodel/test/clangdtests.cpp +++ b/src/plugins/clangcodemodel/test/clangdtests.cpp @@ -25,7 +25,7 @@ #include <utils/environment.h> #include <utils/filepath.h> #include <utils/textutils.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <QElapsedTimer> #include <QEventLoop> diff --git a/src/plugins/clangtools/clangtoolsunittests.cpp b/src/plugins/clangtools/clangtoolsunittests.cpp index 0148f67c0d8..2ea61b7acd6 100644 --- a/src/plugins/clangtools/clangtoolsunittests.cpp +++ b/src/plugins/clangtools/clangtoolsunittests.cpp @@ -20,7 +20,7 @@ #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/toolchain.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/environment.h> #include <utils/fileutils.h> diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index a6ce7499249..a72c5b0c8ad 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -47,7 +47,7 @@ #include <qtsupport/baseqtversion.h> #include <qtsupport/qtbuildaspects.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/categorysortfiltermodel.h> diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 113388cc507..8b2454f6905 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -38,7 +38,7 @@ #include <qmljs/qmljsmodelmanagerinterface.h> #include <qmljstools/qmljstoolsconstants.h> #include <qtsupport/qtcppkitinfo.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/checkablemessagebox.h> diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 9085cff2dd8..6d27dfc77aa 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -23,7 +23,7 @@ #include <projectexplorer/toolchain.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/commandline.h> diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 95dd9d4f135..0c7aa9c8209 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -17,7 +17,7 @@ #include <projectexplorer/projectnodes.h> #include <projectexplorer/target.h> #include <projectexplorer/taskhub.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> using namespace ProjectExplorer; using namespace Utils; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index 45a7df0a116..bc3de03e720 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -19,7 +19,7 @@ #include <projectexplorer/target.h> #include <projectexplorer/toolchainmanager.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/process.h> diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 84c8837757f..2a578787426 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -49,7 +49,7 @@ #include <qmldebug/qmldebugcommandlinearguments.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <QTcpServer> #include <QTimer> diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 484c9857dad..bdb3a36d71e 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -27,7 +27,7 @@ #include <projectexplorer/toolchainmanager.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtversionfactory.h> #include <qtsupport/qtversionmanager.h> diff --git a/src/plugins/docker/kitdetector.cpp b/src/plugins/docker/kitdetector.cpp index 0b9e05b5892..2408d366dc1 100644 --- a/src/plugins/docker/kitdetector.cpp +++ b/src/plugins/docker/kitdetector.cpp @@ -13,7 +13,7 @@ #include <projectexplorer/toolchainmanager.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtversionfactory.h> #include <qtsupport/qtversionmanager.h> diff --git a/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp b/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp index 607a200dc90..5d1c4562762 100644 --- a/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp +++ b/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp @@ -12,7 +12,7 @@ #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorertr.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/aspects.h> #include <utils/qtcassert.h> diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index edfed66d477..1788997dc1e 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -33,7 +33,7 @@ #include <qtsupport/baseqtversion.h> #include <qtsupport/qtcppkitinfo.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/filesystemwatcher.h> diff --git a/src/plugins/insight/insightmodel.cpp b/src/plugins/insight/insightmodel.cpp index 2d2550aac55..feb24cddb1c 100644 --- a/src/plugins/insight/insightmodel.cpp +++ b/src/plugins/insight/insightmodel.cpp @@ -16,7 +16,7 @@ #include <projectexplorer/projecttree.h> #include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/filepath.h> #include <utils/qtcassert.h> diff --git a/src/plugins/ios/iosconfigurations.cpp b/src/plugins/ios/iosconfigurations.cpp index fe2dcaf4227..897f8e33ca1 100644 --- a/src/plugins/ios/iosconfigurations.cpp +++ b/src/plugins/ios/iosconfigurations.cpp @@ -26,7 +26,7 @@ #include <debugger/debuggerkitinformation.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtversionmanager.h> #include <qtsupport/qtversionfactory.h> diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index d8dd96c5a92..8bf2685a9fb 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -19,7 +19,7 @@ #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtparser.h> #include <utils/process.h> diff --git a/src/plugins/ios/iosqtversion.cpp b/src/plugins/ios/iosqtversion.cpp index fc772ce72fa..ab275590844 100644 --- a/src/plugins/ios/iosqtversion.cpp +++ b/src/plugins/ios/iosqtversion.cpp @@ -10,7 +10,7 @@ #include <utils/hostosinfo.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtversionmanager.h> diff --git a/src/plugins/mcusupport/mcukitmanager.cpp b/src/plugins/mcusupport/mcukitmanager.cpp index cadb583188e..edb861be464 100644 --- a/src/plugins/mcusupport/mcukitmanager.cpp +++ b/src/plugins/mcusupport/mcukitmanager.cpp @@ -25,7 +25,7 @@ #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/toolchain.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtversionmanager.h> #include <utils/algorithm.h> diff --git a/src/plugins/mcusupport/mcusupportoptions.cpp b/src/plugins/mcusupport/mcusupportoptions.cpp index 51cb1eacd81..59a24602b60 100644 --- a/src/plugins/mcusupport/mcusupportoptions.cpp +++ b/src/plugins/mcusupport/mcusupportoptions.cpp @@ -22,7 +22,7 @@ #include <utils/algorithm.h> #include <utils/filepath.h> #include <utils/infobar.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtversionmanager.h> #include <QMessageBox> diff --git a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp index 5bf33fea35b..ed160818b57 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp @@ -20,7 +20,7 @@ #include <projectexplorer/toolchain.h> #include <qtsupport/qtcppkitinfo.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/macroexpander.h> #include <utils/qtcassert.h> diff --git a/src/plugins/perfprofiler/perfdatareader.cpp b/src/plugins/perfprofiler/perfdatareader.cpp index 3ff74aaef20..91b40cbaec8 100644 --- a/src/plugins/perfprofiler/perfdatareader.cpp +++ b/src/plugins/perfprofiler/perfdatareader.cpp @@ -24,7 +24,7 @@ #include <utils/environment.h> #include <utils/qtcassert.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <QDateTime> #include <QDebug> diff --git a/src/plugins/perfprofiler/perfprofilertool.cpp b/src/plugins/perfprofiler/perfprofilertool.cpp index 102b4941b28..463ba45c067 100644 --- a/src/plugins/perfprofiler/perfprofilertool.cpp +++ b/src/plugins/perfprofiler/perfprofilertool.cpp @@ -29,7 +29,7 @@ #include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/fancymainwindow.h> diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index a2f425f32aa..a76e4f6295b 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -24,7 +24,7 @@ #include <android/androidconstants.h> #include <ios/iosconstants.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <QDir> #include <QFileInfo> diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index 46044748a58..1e389870429 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -23,7 +23,7 @@ #include <projectexplorer/target.h> #include <projectexplorer/toolchain.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/process.h> #include <utils/qtcassert.h> diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index f18b81adbfc..8729e806045 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -16,7 +16,7 @@ #include <projectexplorer/projectexplorertr.h> #include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/guard.h> diff --git a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp index 5a0fb654a3e..03988e529be 100644 --- a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp +++ b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp @@ -17,7 +17,7 @@ #include <projectexplorer/projectexplorer.h> #include <qmljstools/qmljstoolsconstants.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/process.h> #include <utils/qtcassert.h> diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index bcca10081a6..737f7fc17e9 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -49,7 +49,7 @@ #include <qmljs/qmljsmodelmanagerinterface.h> #include <qmljstools/qmljsmodelmanager.h> #include <qtsupport/qtcppkitinfo.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <QCoreApplication> #include <QElapsedTimer> diff --git a/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp b/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp index 1d2cd4e4537..6fbae2dc4ab 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp @@ -16,7 +16,7 @@ #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/toolchain.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/filepath.h> #include <utils/hostosinfo.h> diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwizarddialog.cpp b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwizarddialog.cpp index 2b9df3ee590..62bc9628f42 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwizarddialog.cpp +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwizarddialog.cpp @@ -9,7 +9,7 @@ #include <projectexplorer/projectexplorerconstants.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> namespace QmakeProjectManager { diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index ee71c7eb2db..4fd34fdf8be 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -33,7 +33,7 @@ #include <projectexplorer/toolchain.h> #include <qtsupport/qtbuildaspects.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtversionmanager.h> #include <utils/process.h> diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp index c1ae89a9718..89e4871fb47 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp @@ -10,7 +10,7 @@ #include <projectexplorer/toolchain.h> #include <projectexplorer/toolchainmanager.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/guard.h> diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index c83808e2d5f..d70efc763cc 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -11,7 +11,7 @@ #include <projectexplorer/target.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <resourceeditor/resourcenode.h> diff --git a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp index 528b18c95eb..914c15cf155 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp @@ -11,7 +11,7 @@ #include <projectexplorer/target.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <resourceeditor/resourcenode.h> diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 332b9e29bdd..119cb3669e9 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -45,7 +45,7 @@ #include <qtsupport/profilereader.h> #include <qtsupport/qtcppkitinfo.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtversionmanager.h> #include <utils/algorithm.h> diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp index 1a929bf9a49..8b947b91081 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp @@ -17,7 +17,7 @@ #include <projectexplorer/toolchain.h> #include <projectexplorer/toolchainmanager.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtversionfactory.h> #include <qtsupport/qtversionmanager.h> diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 27b75a4d7cb..b153b95ffd2 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -27,7 +27,7 @@ #include <coreplugin/icore.h> #include <coreplugin/icontext.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtversionmanager.h> #include <qtsupport/qtsupportconstants.h> diff --git a/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp b/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp index d3d3c19b756..2e1a6baf9bc 100644 --- a/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp +++ b/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp @@ -19,7 +19,7 @@ #include <projectexplorer/targetsetuppage.h> #include <projectexplorer/task.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> #include <utils/algorithm.h> diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp index d791b04672b..485130d6e9f 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp @@ -51,7 +51,7 @@ #include "projectexplorer/target.h" #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/fileutils.h> diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibraryview.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibraryview.cpp index 3f64f8d8b4f..b74c6c32a51 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibraryview.cpp +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibraryview.cpp @@ -25,7 +25,7 @@ #include <projectexplorer/projectmanager.h> #include <projectexplorer/target.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #endif #include <QVector3D> diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp b/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp index a96ca59cae7..5903c530369 100644 --- a/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp +++ b/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp @@ -31,7 +31,7 @@ #include <projectexplorer/target.h> #include <projectexplorer/kit.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/qtcassert.h> diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp index ed34abdc79d..600507823e9 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp @@ -23,7 +23,7 @@ #include <projectexplorer/target.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/kit.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtversionmanager.h> #include <coreplugin/icore.h> diff --git a/src/plugins/qmldesigner/designercore/imagecache/meshimagecachecollector.cpp b/src/plugins/qmldesigner/designercore/imagecache/meshimagecachecollector.cpp index 2063de8f3aa..31e4a07264d 100644 --- a/src/plugins/qmldesigner/designercore/imagecache/meshimagecachecollector.cpp +++ b/src/plugins/qmldesigner/designercore/imagecache/meshimagecachecollector.cpp @@ -6,7 +6,7 @@ #include <projectexplorer/target.h> #include <utils/smallstring.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <QTemporaryFile> diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp index 8b80a9c4af2..d430c957695 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp @@ -51,7 +51,7 @@ #include <utils/hostosinfo.h> #include <utils/qtcassert.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> #include <QCoreApplication> diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp index bdbb2b7ee7b..85cd634c605 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp @@ -81,7 +81,7 @@ #include <utils/theme/theme.h> #include <utils/threadutils.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <QDirIterator> #include <QFileSystemWatcher> diff --git a/src/plugins/qmldesigner/generateresource.cpp b/src/plugins/qmldesigner/generateresource.cpp index be7f536662c..e2d6dad9a95 100644 --- a/src/plugins/qmldesigner/generateresource.cpp +++ b/src/plugins/qmldesigner/generateresource.cpp @@ -19,7 +19,7 @@ #include <qmlprojectmanager/qmlprojectmanagerconstants.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/fileutils.h> #include <utils/process.h> diff --git a/src/plugins/qmldesigner/puppetenvironmentbuilder.cpp b/src/plugins/qmldesigner/puppetenvironmentbuilder.cpp index e413d66ba29..6e8ecb7e17a 100644 --- a/src/plugins/qmldesigner/puppetenvironmentbuilder.cpp +++ b/src/plugins/qmldesigner/puppetenvironmentbuilder.cpp @@ -13,7 +13,7 @@ #include <utils/hostosinfo.h> #include <qmlprojectmanager/qmlmultilanguageaspect.h> #include <qmlprojectmanager/qmlproject.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtversions.h> #include <QLibraryInfo> diff --git a/src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp b/src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp index 54549fa575f..a8ab2cff1d4 100644 --- a/src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp +++ b/src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp @@ -13,7 +13,7 @@ #include <puppetenvironmentbuilder.h> #include <qmlpuppetpaths.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qmlprojectmanager/buildsystem/qmlbuildsystem.h> #include <coreplugin/icore.h> diff --git a/src/plugins/qmldesigner/qmldesignerprojectmanager.cpp b/src/plugins/qmldesigner/qmldesignerprojectmanager.cpp index a45c015f481..a92b890da55 100644 --- a/src/plugins/qmldesigner/qmldesignerprojectmanager.cpp +++ b/src/plugins/qmldesigner/qmldesignerprojectmanager.cpp @@ -20,7 +20,7 @@ #include <sqlitedatabase.h> #include <qmlprojectmanager/qmlproject.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <asynchronousexplicitimagecache.h> #include <asynchronousimagecache.h> diff --git a/src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp b/src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp index 0878dc04e2e..cebac46568f 100644 --- a/src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp +++ b/src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp @@ -9,7 +9,7 @@ #include <projectexplorer/kit.h> #include <projectexplorer/target.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> namespace QmlDesigner { namespace QmlPuppetPaths { diff --git a/src/plugins/qmljstools/qmljsbundleprovider.cpp b/src/plugins/qmljstools/qmljsbundleprovider.cpp index 623a6f4684c..cc72e61276f 100644 --- a/src/plugins/qmljstools/qmljsbundleprovider.cpp +++ b/src/plugins/qmljstools/qmljsbundleprovider.cpp @@ -6,7 +6,7 @@ #include <coreplugin/icore.h> #include <qmljs/qmljsbundle.h> #include <qmljs/qmljsconstants.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> #include <QDir> diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index 23834e82aa4..35940de60f9 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -28,7 +28,7 @@ #include <qmljs/qmljsbind.h> #include <qmljs/qmljsfindexportedcpptypes.h> #include <qmljs/qmljsplugindumper.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> #include <texteditor/textdocument.h> diff --git a/src/plugins/qmlpreview/qmlpreviewplugin.cpp b/src/plugins/qmlpreview/qmlpreviewplugin.cpp index 5f0b23a3d61..550af3a6a90 100644 --- a/src/plugins/qmlpreview/qmlpreviewplugin.cpp +++ b/src/plugins/qmlpreview/qmlpreviewplugin.cpp @@ -37,7 +37,7 @@ #include <qmlprojectmanager/qmlmultilanguageaspect.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtversionmanager.h> #include <qtsupport/baseqtversion.h> diff --git a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp index ca43b07a42f..4c56cf316fe 100644 --- a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp +++ b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp @@ -14,7 +14,7 @@ #include <qmldebug/qmldebugcommandlinearguments.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/filepath.h> #include <utils/port.h> diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp index 6e762a8dc05..fce7eb944d1 100644 --- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp @@ -15,7 +15,7 @@ #include <projectexplorer/target.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> #include <qmldebug/qmldebugcommandlinearguments.h> diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index bd2e8f54b8a..f6de08d2de2 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -40,7 +40,7 @@ #include <projectexplorer/projectmanager.h> #include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <texteditor/texteditor.h> diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 12e1b9f7cbe..cbc2c9ebd16 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -4,7 +4,7 @@ #include "qmlproject.h" #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> #include <QTimer> diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 7daae789916..8fa5674970e 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -27,7 +27,7 @@ #include <qmldesignerbase/qmldesignerbaseplugin.h> #include <qmldesignerbase/utils/qmlpuppetpaths.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtsupportconstants.h> #include <utils/algorithm.h> diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index f32f0a722b8..e8473a2b3d2 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -28,7 +28,7 @@ #include <qmldebug/qmldebugcommandlinearguments.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/fileutils.h> #include <utils/pathchooser.h> diff --git a/src/plugins/qnx/qnxsettingspage.cpp b/src/plugins/qnx/qnxsettingspage.cpp index 5d685420dc3..12acfb43d36 100644 --- a/src/plugins/qnx/qnxsettingspage.cpp +++ b/src/plugins/qnx/qnxsettingspage.cpp @@ -24,7 +24,7 @@ #include <qtsupport/baseqtversion.h> #include <qtsupport/qtversionmanager.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qmakeprojectmanager/qmakeprojectmanagerconstants.h> diff --git a/src/plugins/qtsupport/CMakeLists.txt b/src/plugins/qtsupport/CMakeLists.txt index 5d69a7fc38a..f99973a97e0 100644 --- a/src/plugins/qtsupport/CMakeLists.txt +++ b/src/plugins/qtsupport/CMakeLists.txt @@ -17,7 +17,7 @@ add_qtc_plugin(QtSupport qtbuildaspects.cpp qtbuildaspects.h qtconfigwidget.cpp qtconfigwidget.h qtcppkitinfo.cpp qtcppkitinfo.h - qtkitinformation.cpp qtkitinformation.h + qtkitaspect.cpp qtkitaspect.h qtoptionspage.cpp qtoptionspage.h qtoutputformatter.cpp qtoutputformatter.h qtparser.cpp qtparser.h diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index a0ed8041b33..85e0e6af591 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -5,7 +5,7 @@ #include "profilereader.h" #include "qtconfigwidget.h" -#include "qtkitinformation.h" +#include "qtkitaspect.h" #include "qtsupportconstants.h" #include "qtsupporttr.h" #include "qtversionfactory.h" diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 3254df00a93..5ebf5ed02c8 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -17,7 +17,7 @@ #include <coreplugin/helpmanager.h> #include <coreplugin/icore.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qtsupport/qtversionmanager.h> #include <utils/algorithm.h> diff --git a/src/plugins/qtsupport/externaleditors.cpp b/src/plugins/qtsupport/externaleditors.cpp index dffd730d285..8e6b0bbcead 100644 --- a/src/plugins/qtsupport/externaleditors.cpp +++ b/src/plugins/qtsupport/externaleditors.cpp @@ -11,7 +11,7 @@ #include <projectexplorer/projectmanager.h> #include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <designer/designerconstants.h> diff --git a/src/plugins/qtsupport/qscxmlcgenerator.cpp b/src/plugins/qtsupport/qscxmlcgenerator.cpp index 130ac8d9dd3..e345488e95a 100644 --- a/src/plugins/qtsupport/qscxmlcgenerator.cpp +++ b/src/plugins/qtsupport/qscxmlcgenerator.cpp @@ -4,7 +4,7 @@ #include "qscxmlcgenerator.h" #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <projectexplorer/target.h> #include <utils/qtcassert.h> diff --git a/src/plugins/qtsupport/qtcppkitinfo.cpp b/src/plugins/qtsupport/qtcppkitinfo.cpp index 77caf01766d..6900122cad5 100644 --- a/src/plugins/qtsupport/qtcppkitinfo.cpp +++ b/src/plugins/qtsupport/qtcppkitinfo.cpp @@ -4,7 +4,7 @@ #include "qtcppkitinfo.h" #include "baseqtversion.h" -#include "qtkitinformation.h" +#include "qtkitaspect.h" namespace QtSupport { diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitaspect.cpp similarity index 99% rename from src/plugins/qtsupport/qtkitinformation.cpp rename to src/plugins/qtsupport/qtkitaspect.cpp index 2ad9d78af3e..22ae3a0bd56 100644 --- a/src/plugins/qtsupport/qtkitinformation.cpp +++ b/src/plugins/qtsupport/qtkitaspect.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "qtkitinformation.h" +#include "qtkitaspect.h" #include "qtparser.h" #include "qtsupportconstants.h" diff --git a/src/plugins/qtsupport/qtkitinformation.h b/src/plugins/qtsupport/qtkitaspect.h similarity index 100% rename from src/plugins/qtsupport/qtkitinformation.h rename to src/plugins/qtsupport/qtkitaspect.h diff --git a/src/plugins/qtsupport/qtoutputformatter.cpp b/src/plugins/qtsupport/qtoutputformatter.cpp index e54f8470574..a1f97c664d1 100644 --- a/src/plugins/qtsupport/qtoutputformatter.cpp +++ b/src/plugins/qtsupport/qtoutputformatter.cpp @@ -3,7 +3,7 @@ #include "qtoutputformatter.h" -#include "qtkitinformation.h" +#include "qtkitaspect.h" #include "qtsupportconstants.h" #include "qttestparser.h" diff --git a/src/plugins/qtsupport/qtprojectimporter.cpp b/src/plugins/qtsupport/qtprojectimporter.cpp index bc1dc75c06a..adbbd3b737a 100644 --- a/src/plugins/qtsupport/qtprojectimporter.cpp +++ b/src/plugins/qtsupport/qtprojectimporter.cpp @@ -3,7 +3,7 @@ #include "qtprojectimporter.h" -#include "qtkitinformation.h" +#include "qtkitaspect.h" #include "qtversionfactory.h" #include "qtversionmanager.h" diff --git a/src/plugins/qtsupport/qtsupport.qbs b/src/plugins/qtsupport/qtsupport.qbs index 502f13f7588..864f3d5fdd7 100644 --- a/src/plugins/qtsupport/qtsupport.qbs +++ b/src/plugins/qtsupport/qtsupport.qbs @@ -82,8 +82,8 @@ Project { "profilereader.h", "qscxmlcgenerator.cpp", "qscxmlcgenerator.h", - "qtkitinformation.cpp", - "qtkitinformation.h", + "qtkitaspect.cpp", + "qtkitaspect.h", "qtoptionspage.cpp", "qtoptionspage.h", "qtoutputformatter.cpp", diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index 7a2ebc48954..7e93652bad6 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -9,7 +9,7 @@ #include "gettingstartedwelcomepage.h" #include "profilereader.h" #include "qscxmlcgenerator.h" -#include "qtkitinformation.h" +#include "qtkitaspect.h" #include "qtoptionspage.h" #include "qtoutputformatter.h" #include "qtsupporttr.h" diff --git a/src/plugins/qtsupport/uicgenerator.cpp b/src/plugins/qtsupport/uicgenerator.cpp index e49b2eb66db..840bc585645 100644 --- a/src/plugins/qtsupport/uicgenerator.cpp +++ b/src/plugins/qtsupport/uicgenerator.cpp @@ -4,7 +4,7 @@ #include "uicgenerator.h" #include "baseqtversion.h" -#include "qtkitinformation.h" +#include "qtkitaspect.h" #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/kitmanager.h> diff --git a/src/plugins/scxmleditor/scxmleditordocument.cpp b/src/plugins/scxmleditor/scxmleditordocument.cpp index 1ee62362052..1459848800d 100644 --- a/src/plugins/scxmleditor/scxmleditordocument.cpp +++ b/src/plugins/scxmleditor/scxmleditordocument.cpp @@ -7,7 +7,7 @@ #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectmanager.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/fileutils.h> #include <utils/qtcassert.h> diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index 85f951cc632..a794a2c3fc3 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -28,7 +28,7 @@ #include <qmlprojectmanager/qmlproject.h> #include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <qmldesigner/components/componentcore/theme.h> #include <qmldesigner/dynamiclicensecheck.h> diff --git a/src/plugins/webassembly/webassemblytoolchain.cpp b/src/plugins/webassembly/webassemblytoolchain.cpp index ef9d449bdf7..3174e0e9548 100644 --- a/src/plugins/webassembly/webassemblytoolchain.cpp +++ b/src/plugins/webassembly/webassemblytoolchain.cpp @@ -14,7 +14,7 @@ #include <projectexplorer/projectmacro.h> #include <projectexplorer/toolchainmanager.h> -#include <qtsupport/qtkitinformation.h> +#include <qtsupport/qtkitaspect.h> #include <utils/algorithm.h> #include <utils/environment.h> From 86979b682de16dbde5247b0e5c59b2730a36ce51 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 11 Aug 2023 10:15:28 +0200 Subject: [PATCH 0700/1777] ProjectExplorer: Rename a few KitAspect related items Mostly local variables and KitManager::kitAspectFactories() to match closer what they are. Change-Id: I8f837357528f9e1110888898077f82b5097003f0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../filterkitaspectsdialog.cpp | 8 +-- src/plugins/projectexplorer/kit.cpp | 58 +++++++++---------- src/plugins/projectexplorer/kitmanager.cpp | 45 +++++++------- src/plugins/projectexplorer/kitmanager.h | 2 +- .../kitmanagerconfigwidget.cpp | 4 +- .../miniprojecttargetselector.cpp | 14 ++--- 6 files changed, 66 insertions(+), 65 deletions(-) diff --git a/src/plugins/projectexplorer/filterkitaspectsdialog.cpp b/src/plugins/projectexplorer/filterkitaspectsdialog.cpp index db3fc75b798..ebba30050ee 100644 --- a/src/plugins/projectexplorer/filterkitaspectsdialog.cpp +++ b/src/plugins/projectexplorer/filterkitaspectsdialog.cpp @@ -82,13 +82,13 @@ public: FilterKitAspectsModel(const Kit *kit, QObject *parent) : TreeModel(parent) { setHeader({Tr::tr("Setting"), Tr::tr("Visible")}); - for (const KitAspectFactory * const aspect : KitManager::kitAspects()) { - if (kit && !aspect->isApplicableToKit(kit)) + for (const KitAspectFactory * const factory : KitManager::kitAspectFactories()) { + if (kit && !factory->isApplicableToKit(kit)) continue; const QSet<Utils::Id> irrelevantAspects = kit ? kit->irrelevantAspects() : KitManager::irrelevantAspects(); - auto * const item = new FilterTreeItem(aspect, - !irrelevantAspects.contains(aspect->id())); + auto * const item = new FilterTreeItem(factory, + !irrelevantAspects.contains(factory->id())); rootItem()->appendChild(item); } static const auto cmp = [](const TreeItem *item1, const TreeItem *item2) { diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index 20be63d68e9..eb82ea20d45 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -69,8 +69,8 @@ public: [kit] { return kit->id().toString(); }); m_macroExpander.registerVariable("Kit:FileSystemName", Tr::tr("Kit filesystem-friendly name"), [kit] { return kit->fileSystemFriendlyName(); }); - for (KitAspectFactory *aspect : KitManager::kitAspects()) - aspect->addToMacroExpander(kit, &m_macroExpander); + for (KitAspectFactory *factory : KitManager::kitAspectFactories()) + factory->addToMacroExpander(kit, &m_macroExpander); m_macroExpander.registerVariable("Kit:Name", Tr::tr("The name of the kit."), @@ -235,8 +235,8 @@ bool Kit::hasWarning() const Tasks Kit::validate() const { Tasks result; - for (KitAspectFactory *aspect : KitManager::kitAspects()) - result.append(aspect->validate(this)); + for (KitAspectFactory *factory : KitManager::kitAspectFactories()) + result.append(factory->validate(this)); d->m_hasError = containsType(result, Task::TaskType::Error); d->m_hasWarning = containsType(result, Task::TaskType::Warning); @@ -248,16 +248,16 @@ Tasks Kit::validate() const void Kit::fix() { KitGuard g(this); - for (KitAspectFactory *aspect : KitManager::kitAspects()) - aspect->fix(this); + for (KitAspectFactory *factory : KitManager::kitAspectFactories()) + factory->fix(this); } void Kit::setup() { KitGuard g(this); - const QList<KitAspectFactory *> aspects = KitManager::kitAspects(); - for (KitAspectFactory * const aspect : aspects) - aspect->setup(this); + const QList<KitAspectFactory *> aspects = KitManager::kitAspectFactories(); + for (KitAspectFactory * const factory : aspects) + factory->setup(this); } void Kit::upgrade() @@ -265,8 +265,8 @@ void Kit::upgrade() KitGuard g(this); // Process the KitAspects in reverse order: They may only be based on other information // lower in the stack. - for (KitAspectFactory *aspect : KitManager::kitAspects()) - aspect->upgrade(this); + for (KitAspectFactory *factory : KitManager::kitAspectFactories()) + factory->upgrade(this); } QString Kit::unexpandedDisplayName() const @@ -336,10 +336,10 @@ Id Kit::id() const int Kit::weight() const { - const QList<KitAspectFactory *> &aspects = KitManager::kitAspects(); + const QList<KitAspectFactory *> &aspects = KitManager::kitAspectFactories(); return std::accumulate(aspects.begin(), aspects.end(), 0, - [this](int sum, const KitAspectFactory *aspect) { - return sum + aspect->weight(this); + [this](int sum, const KitAspectFactory *factory) { + return sum + factory->weight(this); }); } @@ -526,14 +526,14 @@ QVariantMap Kit::toMap() const void Kit::addToBuildEnvironment(Environment &env) const { - for (KitAspectFactory *aspect : KitManager::kitAspects()) - aspect->addToBuildEnvironment(this, env); + for (KitAspectFactory *factory : KitManager::kitAspectFactories()) + factory->addToBuildEnvironment(this, env); } void Kit::addToRunEnvironment(Environment &env) const { - for (KitAspectFactory *aspect : KitManager::kitAspects()) - aspect->addToRunEnvironment(this, env); + for (KitAspectFactory *factory : KitManager::kitAspectFactories()) + factory->addToRunEnvironment(this, env); } Environment Kit::buildEnvironment() const @@ -555,8 +555,8 @@ Environment Kit::runEnvironment() const QList<OutputLineParser *> Kit::createOutputParsers() const { QList<OutputLineParser *> parsers{new OsParser}; - for (KitAspectFactory *aspect : KitManager::kitAspects()) - parsers << aspect->createOutputParsers(this); + for (KitAspectFactory *factory : KitManager::kitAspectFactories()) + parsers << factory->createOutputParsers(this); return parsers; } @@ -574,8 +574,8 @@ QString Kit::toHtml(const Tasks &additional, const QString &extraText) const str << "<p>" << ProjectExplorer::toHtml(additional + validate()) << "</p>"; str << "<dl style=\"white-space:pre\">"; - for (KitAspectFactory *aspect : KitManager::kitAspects()) { - const KitAspectFactory::ItemList list = aspect->toUserOutput(this); + for (KitAspectFactory *factory : KitManager::kitAspectFactories()) { + const KitAspectFactory::ItemList list = factory->toUserOutput(this); for (const KitAspectFactory::Item &j : list) { QString contents = j.second; if (contents.size() > 256) { @@ -619,9 +619,9 @@ void Kit::setSdkProvided(bool sdkProvided) void Kit::makeSticky() { - for (KitAspectFactory *aspect : KitManager::kitAspects()) { - if (hasValue(aspect->id())) - setSticky(aspect->id(), true); + for (KitAspectFactory *factory : KitManager::kitAspectFactories()) { + if (hasValue(factory->id())) + setSticky(factory->id(), true); } } @@ -675,8 +675,8 @@ QSet<Id> Kit::irrelevantAspects() const QSet<Id> Kit::supportedPlatforms() const { QSet<Id> platforms; - for (const KitAspectFactory *aspect : KitManager::kitAspects()) { - const QSet<Id> ip = aspect->supportedPlatforms(this); + for (const KitAspectFactory *factory : KitManager::kitAspectFactories()) { + const QSet<Id> ip = factory->supportedPlatforms(this); if (ip.isEmpty()) continue; if (platforms.isEmpty()) @@ -690,8 +690,8 @@ QSet<Id> Kit::supportedPlatforms() const QSet<Id> Kit::availableFeatures() const { QSet<Id> features; - for (const KitAspectFactory *aspect : KitManager::kitAspects()) - features |= aspect->availableFeatures(this); + for (const KitAspectFactory *factory : KitManager::kitAspectFactories()) + features |= factory->availableFeatures(this); return features; } diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 433d9df9d48..feac7389b17 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -75,20 +75,20 @@ public: std::unique_ptr<PersistentSettingsWriter> m_writer; QSet<Id> m_irrelevantAspects; - void addKitAspect(KitAspectFactory *ki) + void addKitAspect(KitAspectFactory *factory) { - QTC_ASSERT(!m_aspectList.contains(ki), return); - m_aspectList.append(ki); + QTC_ASSERT(!m_aspectList.contains(factory), return); + m_aspectList.append(factory); m_aspectListIsSorted = false; } - void removeKitAspect(KitAspectFactory *ki) + void removeKitAspect(KitAspectFactory *factory) { - int removed = m_aspectList.removeAll(ki); + int removed = m_aspectList.removeAll(factory); QTC_CHECK(removed == 1); } - const QList<KitAspectFactory *> kitAspects() + const QList<KitAspectFactory *> kitAspectFactories() { if (!m_aspectListIsSorted) { Utils::sort(m_aspectList, [](const KitAspectFactory *a, const KitAspectFactory *b) { @@ -196,11 +196,12 @@ void KitManager::restoreKits() Kit *ptr = i->get(); // Overwrite settings that the SDK sets to those values: - for (const KitAspectFactory *aspect : KitManager::kitAspects()) { + for (const KitAspectFactory *factory : KitManager::kitAspectFactories()) { + const Id id = factory->id(); // Copy sticky settings over: - ptr->setSticky(aspect->id(), toStore->isSticky(aspect->id())); - if (ptr->isSticky(aspect->id())) - ptr->setValue(aspect->id(), toStore->value(aspect->id())); + ptr->setSticky(id, toStore->isSticky(id)); + if (ptr->isSticky(id)) + ptr->setValue(id, toStore->value(id)); } toStore = std::move(*i); kitsToCheck.erase(i); @@ -455,11 +456,11 @@ bool KitManager::isLoaded() return d->m_initialized; } -void KitManager::registerKitAspect(KitAspectFactory *ki) +void KitManager::registerKitAspect(KitAspectFactory *factory) { instance(); QTC_ASSERT(d, return); - d->addKitAspect(ki); + d->addKitAspect(factory); // Adding this aspect to possibly already existing kits is currently not // needed here as kits are only created after all aspects are created @@ -468,14 +469,14 @@ void KitManager::registerKitAspect(KitAspectFactory *ki) QTC_CHECK(d->m_kitList.empty()); } -void KitManager::deregisterKitAspect(KitAspectFactory *ki) +void KitManager::deregisterKitAspect(KitAspectFactory *factory) { // Happens regularly for the aspects from the ProjectExplorerPlugin as these // are destroyed after the manual call to KitManager::destroy() there, but as // this here is just for sanity reasons that the KitManager does not access // a destroyed aspect, a destroyed KitManager is not a problem. if (d) - d->removeKitAspect(ki); + d->removeKitAspect(factory); } void KitManager::setBinaryForKit(const FilePath &binary) @@ -578,9 +579,9 @@ Kit *KitManager::defaultKit() return d->m_defaultKit; } -const QList<KitAspectFactory *> KitManager::kitAspects() +const QList<KitAspectFactory *> KitManager::kitAspectFactories() { - return d->kitAspects(); + return d->kitAspectFactories(); } const QSet<Id> KitManager::irrelevantAspects() @@ -636,7 +637,7 @@ void KitManager::deregisterKit(Kit *k) Kit *newDefault = Utils::findOrDefault(kits(), [](Kit *k) { return k->isValid(); }); setDefaultKit(newDefault); } - emit m_instance->kitRemoved(k); + emit instance()->kitRemoved(k); } void KitManager::setDefaultKit(Kit *k) @@ -653,12 +654,12 @@ void KitManager::completeKit(Kit *k) { QTC_ASSERT(k, return); KitGuard g(k); - for (KitAspectFactory *ki : d->kitAspects()) { - ki->upgrade(k); - if (!k->hasValue(ki->id())) - ki->setup(k); + for (KitAspectFactory *factory : d->kitAspectFactories()) { + factory->upgrade(k); + if (!k->hasValue(factory->id())) + factory->setup(k); else - ki->fix(k); + factory->fix(k); } } diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index b10ddf5af62..a710d62d5f2 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -140,7 +140,7 @@ public: static Kit *kit(Utils::Id id); static Kit *defaultKit(); - static const QList<KitAspectFactory *> kitAspects(); + static const QList<KitAspectFactory *> kitAspectFactories(); static const QSet<Utils::Id> irrelevantAspects(); static void setIrrelevantAspects(const QSet<Utils::Id> &aspects); diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index 97118f2bb27..05f233fd0e3 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -102,8 +102,8 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, bool &isDefaultKit, bool chooser->addSupportedWidget(m_nameEdit); chooser->addMacroExpanderProvider([this] { return m_modifiedKit->macroExpander(); }); - for (KitAspectFactory *aspect : KitManager::kitAspects()) - addAspectToWorkingCopy(page, aspect); + for (KitAspectFactory *factory : KitManager::kitAspectFactories()) + addAspectToWorkingCopy(page, factory); page.attachTo(this); diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 44438dfe1d3..1ee113c7239 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -593,11 +593,11 @@ public: delete layout(); Layouting::Grid grid; - for (KitAspectFactory *aspect : KitManager::kitAspects()) { - if (k && k->isMutable(aspect->id())) { - KitAspect *widget = aspect->createKitAspect(k); + for (KitAspectFactory *factory : KitManager::kitAspectFactories()) { + if (k && k->isMutable(factory->id())) { + KitAspect *widget = factory->createKitAspect(k); m_widgets << widget; - grid.addItems({aspect->displayName(), widget, Layouting::br}); + grid.addItems({factory->displayName(), widget, Layouting::br}); } } grid.attachTo(this); @@ -618,9 +618,9 @@ private: QList<const KitAspectFactory *> knownList = Utils::transform(m_widgets, &KitAspect::kitInformation); - for (KitAspectFactory *aspect : KitManager::kitAspects()) { - const Utils::Id currentId = aspect->id(); - if (m_kit->isMutable(currentId) && !knownList.removeOne(aspect)) { + for (KitAspectFactory *factory : KitManager::kitAspectFactories()) { + const Utils::Id currentId = factory->id(); + if (m_kit->isMutable(currentId) && !knownList.removeOne(factory)) { addedMutables = true; break; } From 93c30c45860d639502073837912b0678062d7c7e Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 15 Aug 2023 10:30:52 +0200 Subject: [PATCH 0701/1777] UnixDeviceFileAccess test: Add a note about the usage of QProcess In order to prevent any possible further conversion. Change-Id: I0f8be7558affb36b3015144fe9c640a7bfcab295 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../auto/utils/unixdevicefileaccess/tst_unixdevicefileaccess.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/utils/unixdevicefileaccess/tst_unixdevicefileaccess.cpp b/tests/auto/utils/unixdevicefileaccess/tst_unixdevicefileaccess.cpp index 3e62be9147d..5eba8122241 100644 --- a/tests/auto/utils/unixdevicefileaccess/tst_unixdevicefileaccess.cpp +++ b/tests/auto/utils/unixdevicefileaccess/tst_unixdevicefileaccess.cpp @@ -33,6 +33,7 @@ public: virtual RunResult runInShell(const CommandLine &cmdLine, const QByteArray &inputData = {}) const override { + // Note: Don't convert into Utils::Process. See more comments in this change in gerrit. QProcess p; p.setProgram(cmdLine.executable().toString()); p.setArguments(cmdLine.splitArguments()); From 4cb6858410f4e8a29388a11e0e4f9b2c77400a1c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 11 Aug 2023 15:44:10 +0200 Subject: [PATCH 0702/1777] Meson: Remove unused header file Change-Id: Iff0793eef63094b5ab680c436963e77c92f278c8 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/mesonprojectmanager/CMakeLists.txt | 1 - src/plugins/mesonprojectmanager/kithelper.h | 14 -------------- .../mesonprojectmanager/mesonbuildsystem.cpp | 1 - .../mesonprojectmanager/mesonprojectmanager.qbs | 1 - 4 files changed, 17 deletions(-) delete mode 100644 src/plugins/mesonprojectmanager/kithelper.h diff --git a/src/plugins/mesonprojectmanager/CMakeLists.txt b/src/plugins/mesonprojectmanager/CMakeLists.txt index 2f0d61ad59a..33fc6b25b71 100644 --- a/src/plugins/mesonprojectmanager/CMakeLists.txt +++ b/src/plugins/mesonprojectmanager/CMakeLists.txt @@ -13,7 +13,6 @@ add_qtc_plugin(MesonProjectManager common.h infoparser.h kitdata.h - kithelper.h mesonactionsmanager.cpp mesonactionsmanager.h mesonbuildconfiguration.cpp diff --git a/src/plugins/mesonprojectmanager/kithelper.h b/src/plugins/mesonprojectmanager/kithelper.h deleted file mode 100644 index f0d8c5be142..00000000000 --- a/src/plugins/mesonprojectmanager/kithelper.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2020 Alexis Jeandet. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "kitdata.h" -#include "versionhelper.h" - -#include <projectexplorer/kit.h> -#include <projectexplorer/kitaspects.h> - -#include <utils/macroexpander.h> -#include <utils/qtcassert.h> - diff --git a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp index ed160818b57..8aacff10c92 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildsystem.cpp @@ -4,7 +4,6 @@ #include "mesonbuildsystem.h" #include "kitdata.h" -#include "kithelper.h" #include "mesonbuildconfiguration.h" #include "mesonprojectmanagertr.h" #include "mesontoolkitaspect.h" diff --git a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs index db81d16f1a7..c977f8b8283 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs +++ b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs @@ -27,7 +27,6 @@ Project { "toolwrapper.cpp", "toolwrapper.h", "kitdata.h", - "kithelper.h", "mesonactionsmanager.cpp", "mesonactionsmanager.h", "buildoptions.h", From 8f948c28a9e549077b2a81bb3cb414385e93fcd3 Mon Sep 17 00:00:00 2001 From: Yasser Grimes <yasser.grimes@qt.io> Date: Fri, 11 Aug 2023 16:20:45 +0300 Subject: [PATCH 0703/1777] McuSuport: Use qsTrId() instead of qsTr in QtMCUs templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTCREATORBUG-29258 Change-Id: I0e386b12308b04df0e2ca023d77c01a8d481b9a5 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io> --- src/plugins/mcusupport/mcusupport.qrc | 2 +- .../qmlproject-empty/project.qmlproject.tpl | 1 + .../wizards/qmlproject/main.qml.tpl | 3 +- .../wizards/qmlproject/main_big.qml.tpl | 30 ------------------- .../wizards/qmlproject/project.qmlproject.tpl | 8 +++-- .../wizards/qmlproject/translation.en_US.ts | 10 +++++++ .../wizards/qmlproject/translation.nb_NO.ts | 4 +-- .../mcusupport/wizards/qmlproject/wizard.json | 10 +++++-- 8 files changed, 29 insertions(+), 39 deletions(-) delete mode 100644 src/plugins/mcusupport/wizards/qmlproject/main_big.qml.tpl create mode 100644 src/plugins/mcusupport/wizards/qmlproject/translation.en_US.ts diff --git a/src/plugins/mcusupport/mcusupport.qrc b/src/plugins/mcusupport/mcusupport.qrc index dc64ac1ca2f..f6e5c151332 100644 --- a/src/plugins/mcusupport/mcusupport.qrc +++ b/src/plugins/mcusupport/mcusupport.qrc @@ -13,8 +13,8 @@ <file>wizards/qmlproject/DejaVuSansMono.ttf</file> <file>wizards/qmlproject/LICENSE</file> <file>wizards/qmlproject/translation.nb_NO.ts</file> + <file>wizards/qmlproject/translation.en_US.ts</file> <file>wizards/qmlproject/BackendObject.h</file> - <file>wizards/qmlproject/main_big.qml.tpl</file> <file>wizards/qmlproject/main.qml.tpl</file> <file>wizards/qmlproject/project.qmlproject.tpl</file> <file>wizards/qmlproject/module.qmlproject.tpl</file> diff --git a/src/plugins/mcusupport/wizards/qmlproject-empty/project.qmlproject.tpl b/src/plugins/mcusupport/wizards/qmlproject-empty/project.qmlproject.tpl index ab85861a5ec..ead4e315a36 100644 --- a/src/plugins/mcusupport/wizards/qmlproject-empty/project.qmlproject.tpl +++ b/src/plugins/mcusupport/wizards/qmlproject-empty/project.qmlproject.tpl @@ -5,6 +5,7 @@ Project { // importPaths: [] // Alternative API to ModuleFiles for importing modules. // projectRootPath: "." // Optional root path relative to qmlproject file path. mainFile: "%{MainQmlFile}" // The application's entrypoint + idBasedTranslations: true // Use qsTrId() instead of qsTr() MCU.Config { controlsStyle: "QtQuick.Controls.StyleDefault" diff --git a/src/plugins/mcusupport/wizards/qmlproject/main.qml.tpl b/src/plugins/mcusupport/wizards/qmlproject/main.qml.tpl index 44f4788740c..5097435e099 100644 --- a/src/plugins/mcusupport/wizards/qmlproject/main.qml.tpl +++ b/src/plugins/mcusupport/wizards/qmlproject/main.qml.tpl @@ -16,9 +16,10 @@ Rectangle { CustomButton { anchors.centerIn: parent - text: qsTr("Hello world!") + text: qsTrId("hello-world") onClicked: BackendObject.toggle() } BackendObject.onCustomPropertyChanged: Qt.uiLanguage = BackendObject.customProperty ? "en_US" : "nb_NO" + Component.onCompleted: Qt.uiLanguage = "en_US" } diff --git a/src/plugins/mcusupport/wizards/qmlproject/main_big.qml.tpl b/src/plugins/mcusupport/wizards/qmlproject/main_big.qml.tpl deleted file mode 100644 index 60f77144499..00000000000 --- a/src/plugins/mcusupport/wizards/qmlproject/main_big.qml.tpl +++ /dev/null @@ -1,30 +0,0 @@ -import QtQuick 2.0 -import CustomModule - -Rectangle { - // Component.onCompleted: Qt.uiLanguage = "nb_NO" // Uncomment to change the UI language //TODO: Is this the "official" method of setting ui language? - - Row { - visible: CustomObject.customProperty - Image { - anchors.centerIn: parent - id: icon - source: "assets/icon.png" - } - Text { - anchors.centerIn: parent - font.pixelSize: 28 - id: title - text: " for MCUs" - } - } - - CustomComponent { - anchors.centerIn: parent - } - - MouseArea { - anchors.fill: parent - onClicked: CustomObject.toggle() - } -} diff --git a/src/plugins/mcusupport/wizards/qmlproject/project.qmlproject.tpl b/src/plugins/mcusupport/wizards/qmlproject/project.qmlproject.tpl index 0c879ccfb0d..113cd1f07a7 100644 --- a/src/plugins/mcusupport/wizards/qmlproject/project.qmlproject.tpl +++ b/src/plugins/mcusupport/wizards/qmlproject/project.qmlproject.tpl @@ -5,6 +5,7 @@ Project { // importPaths: ["imports/CustomModule"] // Alternative API for importing modules. // projectRootPath: "." // Optional root path relative to qmlproject file path. mainFile: "%{MainQmlFile}" // The application's entrypoint + idBasedTranslations: true // Use qsTrId() instead of qsTr() /* Global configuration */ MCU.Config { @@ -88,8 +89,11 @@ Project { /* Translations */ TranslationFiles { - files: ["translations/%{TsFile}"] - MCU.omitSourceLanguage: false + files: [ + "translations/%{TsFileEn}", + "translations/%{TsFileNo}" + ] + MCU.omitSourceLanguage: true } FontFiles { diff --git a/src/plugins/mcusupport/wizards/qmlproject/translation.en_US.ts b/src/plugins/mcusupport/wizards/qmlproject/translation.en_US.ts new file mode 100644 index 00000000000..f4f94ed311c --- /dev/null +++ b/src/plugins/mcusupport/wizards/qmlproject/translation.en_US.ts @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="en_US"> +<context> + <name>%{CorrectedProjectName}</name> + <message id="hello-world"> + <translation>Hello world!</translation> + </message> +</context> +</TS> diff --git a/src/plugins/mcusupport/wizards/qmlproject/translation.nb_NO.ts b/src/plugins/mcusupport/wizards/qmlproject/translation.nb_NO.ts index 2cd70a44edd..10bdd92d377 100644 --- a/src/plugins/mcusupport/wizards/qmlproject/translation.nb_NO.ts +++ b/src/plugins/mcusupport/wizards/qmlproject/translation.nb_NO.ts @@ -3,9 +3,7 @@ <TS version="2.1" language="nb_NO"> <context> <name>%{CorrectedProjectName}</name> - <message> - <location filename="../%{MainQmlFile}" line="37"/> - <source>Hello world!</source> + <message id="hello-world"> <translation>Hallo verden!</translation> </message> </context> diff --git a/src/plugins/mcusupport/wizards/qmlproject/wizard.json b/src/plugins/mcusupport/wizards/qmlproject/wizard.json index 4a5f582d432..8375cfb212b 100644 --- a/src/plugins/mcusupport/wizards/qmlproject/wizard.json +++ b/src/plugins/mcusupport/wizards/qmlproject/wizard.json @@ -21,7 +21,8 @@ { "key": "ModuleFile", "value": "CustomModule.qmlproject"}, { "key": "QmlComponent", "value": "CustomButton.qml"}, { "key": "InterfaceFile", "value": "BackendObject.h"}, - { "key": "TsFile", "value": "%{CorrectedProjectName}.nb_NO.ts"} + { "key": "TsFileEn", "value": "%{CorrectedProjectName}.en_US.ts"}, + { "key": "TsFileNo", "value": "%{CorrectedProjectName}.nb_NO.ts"} ], "pages": @@ -103,7 +104,12 @@ }, { "source": "translation.nb_NO.ts", - "target": "%{QmlProjectDirectory}/translations/%{TsFile}", + "target": "%{QmlProjectDirectory}/translations/%{TsFileNo}", + "openInEditor": false + }, + { + "source": "translation.en_US.ts", + "target": "%{QmlProjectDirectory}/translations/%{TsFileEn}", "openInEditor": false }, { From 6ee7989c6104dba2177fe449c4ae252b7d3588c4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 11 Aug 2023 09:58:32 +0200 Subject: [PATCH 0704/1777] KitManager: Move the instance setup to a function Slightly nicer code and works well with settingspages nowadays. Change-Id: Ic12ff58f4b0f8db226843961eb2ab6fb8879429c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/projectexplorer/kitmanager.cpp | 22 ++++++++-------------- src/plugins/projectexplorer/kitmanager.h | 4 ++-- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index feac7389b17..786d1c48623 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -118,20 +118,16 @@ private: // -------------------------------------------------------------------------- static Internal::KitManagerPrivate *d = nullptr; -static KitManager *m_instance = nullptr; KitManager *KitManager::instance() { - if (!m_instance) - m_instance = new KitManager; - return m_instance; + static KitManager theManager; + return &theManager; } KitManager::KitManager() { d = new KitManagerPrivate; - QTC_CHECK(!m_instance); - m_instance = this; connect(ICore::instance(), &ICore::saveSettingsRequested, this, &KitManager::saveKits); @@ -144,8 +140,6 @@ void KitManager::destroy() { delete d; d = nullptr; - delete m_instance; - m_instance = nullptr; } void KitManager::restoreKits() @@ -417,8 +411,8 @@ void KitManager::restoreKits() d->m_writer = std::make_unique<PersistentSettingsWriter>(settingsFileName(), "QtCreatorProfiles"); d->m_initialized = true; - emit m_instance->kitsLoaded(); - emit m_instance->kitsChanged(); + emit instance()->kitsLoaded(); + emit instance()->kitsChanged(); } KitManager::~KitManager() @@ -600,9 +594,9 @@ void KitManager::notifyAboutUpdate(Kit *k) return; if (Utils::contains(d->m_kitList, k)) - emit m_instance->kitUpdated(k); + emit instance()->kitUpdated(k); else - emit m_instance->unmanagedKitUpdated(k); + emit instance()->unmanagedKitUpdated(k); } Kit *KitManager::registerKit(const std::function<void (Kit *)> &init, Utils::Id id) @@ -624,7 +618,7 @@ Kit *KitManager::registerKit(const std::function<void (Kit *)> &init, Utils::Id if (!d->m_defaultKit || (!d->m_defaultKit->isValid() && kptr->isValid())) setDefaultKit(kptr); - emit m_instance->kitAdded(kptr); + emit instance()->kitAdded(kptr); return kptr; } @@ -647,7 +641,7 @@ void KitManager::setDefaultKit(Kit *k) if (k && !Utils::contains(d->m_kitList, k)) return; d->m_defaultKit = k; - emit m_instance->defaultkitChanged(); + emit instance()->defaultkitChanged(); } void KitManager::completeKit(Kit *k) diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index a710d62d5f2..1fe676ed6b3 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -127,13 +127,12 @@ protected: QAction *m_mutableAction = nullptr; }; -class PROJECTEXPLORER_EXPORT KitManager : public QObject +class PROJECTEXPLORER_EXPORT KitManager final : public QObject { Q_OBJECT public: static KitManager *instance(); - ~KitManager() override; static const QList<Kit *> kits(); static Kit *kit(const Kit::Predicate &predicate); @@ -170,6 +169,7 @@ signals: private: KitManager(); + ~KitManager() override; static void destroy(); From ae51dedbd1e30459c032cb9a83c3d462ab6b5757 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 22:29:22 +0200 Subject: [PATCH 0705/1777] AndroidManager: Remove deleteOnFinish arg from runAdbCommandDetached() Change-Id: I6a54c85921e27a2256417f730f56c41b1152fefc Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/android/androidmanager.cpp | 16 ++++++++-------- src/plugins/android/androidmanager.h | 3 +-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index e1e5752d510..27c38f1ddb8 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -612,9 +612,14 @@ void AndroidManager::installQASIPackage(Target *target, const FilePath &packageP QStringList arguments = AndroidDeviceInfo::adbSelector(deviceSerialNumber); arguments << "install" << "-r " << packagePath.path(); QString error; - if (!runAdbCommandDetached(arguments, &error, true)) + QProcess *process = runAdbCommandDetached(arguments, &error); + if (process) { + // TODO: Potential leak when the process is still running on Creator shutdown. + QObject::connect(process, &QProcess::finished, process, &QObject::deleteLater); + } else { Core::MessageManager::writeDisrupting( Tr::tr("Android package installation failed.\n%1").arg(error)); + } } bool AndroidManager::checkKeystorePassword(const FilePath &keystorePath, @@ -666,20 +671,15 @@ bool AndroidManager::checkCertificateExists(const FilePath &keystorePath, return proc.result() == ProcessResult::FinishedWithSuccess; } -QProcess *AndroidManager::runAdbCommandDetached(const QStringList &args, QString *err, - bool deleteOnFinish) +QProcess *AndroidManager::runAdbCommandDetached(const QStringList &args, QString *err) { std::unique_ptr<QProcess> p(new QProcess); const FilePath adb = AndroidConfigurations::currentConfig().adbToolPath(); qCDebug(androidManagerLog).noquote() << "Running command (async):" << CommandLine(adb, args).toUserOutput(); p->start(adb.toString(), args); - if (p->waitForStarted(500) && p->state() == QProcess::Running) { - if (deleteOnFinish) { - connect(p.get(), &QProcess::finished, p.get(), &QObject::deleteLater); - } + if (p->waitForStarted(500) && p->state() == QProcess::Running) return p.release(); - } QString errorStr = QString::fromUtf8(p->readAllStandardError()); qCDebug(androidManagerLog).noquote() << "Running command (async) failed:" diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index ca8f9d0769f..fdb0973d9bc 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -97,8 +97,7 @@ public: static bool checkCertificateExists(const Utils::FilePath &keystorePath, const QString &keystorePasswd, const QString &alias); - static QProcess *runAdbCommandDetached(const QStringList &args, QString *err = nullptr, - bool deleteOnFinish = false); + static QProcess *runAdbCommandDetached(const QStringList &args, QString *err = nullptr); static SdkToolResult runAdbCommand(const QStringList &args, const QByteArray &writeData = {}, int timeoutS = 30); From b01fcf5e7a9c344f72ea33d27f31af121991cf0a Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 10 Aug 2023 12:25:59 +0200 Subject: [PATCH 0706/1777] DAP: Add enable/disable breakpoint support Change-Id: Ice1c17e1c1e257d9f828bb6a54c643f7ecf7b387 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/debugger/dap/cmakedapengine.cpp | 26 +++++++++++ src/plugins/debugger/dap/cmakedapengine.h | 6 +++ src/plugins/debugger/dap/dapengine.cpp | 48 +++++++++++++-------- src/plugins/debugger/dap/dapengine.h | 2 + 4 files changed, 63 insertions(+), 19 deletions(-) diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp index d4e766521cf..1b3614a5f12 100644 --- a/src/plugins/debugger/dap/cmakedapengine.cpp +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -136,4 +136,30 @@ bool CMakeDapEngine::hasCapability(unsigned cap) const /*| RunToLineCapability*/); // disable while the #25176 bug is not fixed } +void CMakeDapEngine::insertBreakpoint(const Breakpoint &bp) +{ + DapEngine::insertBreakpoint(bp); + notifyBreakpointInsertOk(bp); // Needed for CMake support issue:25176 +} + +void CMakeDapEngine::removeBreakpoint(const Breakpoint &bp) +{ + DapEngine::removeBreakpoint(bp); + notifyBreakpointRemoveOk(bp); // Needed for CMake support issue:25176 +} + +void CMakeDapEngine::updateBreakpoint(const Breakpoint &bp) +{ + DapEngine::updateBreakpoint(bp); + + /* Needed for CMake support issue:25176 */ + BreakpointParameters parameters = bp->requestedParameters(); + if (parameters.enabled != bp->isEnabled()) { + parameters.pending = false; + bp->setParameters(parameters); + } + notifyBreakpointChangeOk(bp); + /* Needed for CMake support issue:25176 */ +} + } // namespace Debugger::Internal diff --git a/src/plugins/debugger/dap/cmakedapengine.h b/src/plugins/debugger/dap/cmakedapengine.h index 00b0ac7044d..4d03249e348 100644 --- a/src/plugins/debugger/dap/cmakedapengine.h +++ b/src/plugins/debugger/dap/cmakedapengine.h @@ -16,6 +16,12 @@ private: void handleDapStarted() override; void setupEngine() override; + /* Needed for CMake support issue:25176 */ + void insertBreakpoint(const Breakpoint &bp) override; + void updateBreakpoint(const Breakpoint &bp) override; + void removeBreakpoint(const Breakpoint &bp) override; + /* Needed for CMake support issue:25176 */ + bool hasCapability(unsigned cap) const override; }; diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index be299018d2c..75497ed103d 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -378,8 +378,13 @@ void DapEngine::insertBreakpoint(const Breakpoint &bp) QTC_CHECK(bp->state() == BreakpointInsertionRequested); notifyBreakpointInsertProceeding(bp); - const BreakpointParameters ¶ms = bp->requestedParameters(); + dapInsertBreakpoint(bp); +} + +void DapEngine::dapInsertBreakpoint(const Breakpoint &bp) +{ bp->setResponseId(QString::number(m_nextBreakpointId++)); + const BreakpointParameters ¶ms = bp->requestedParameters(); QJsonArray breakpoints; for (const auto &breakpoint : breakHandler()->breakpoints()) { @@ -401,30 +406,21 @@ void DapEngine::insertBreakpoint(const Breakpoint &bp) }} }); - notifyBreakpointInsertOk(bp); qCDebug(dapEngineLog) << "insertBreakpoint" << bp->modelId() << bp->responseId(); } void DapEngine::updateBreakpoint(const Breakpoint &bp) { + BreakpointParameters parameters = bp->requestedParameters(); notifyBreakpointChangeProceeding(bp); -// QTC_ASSERT(bp, return); -// const BreakpointState state = bp->state(); -// if (QTC_GUARD(state == BreakpointUpdateRequested)) -// if (bp->responseId().isEmpty()) // FIXME postpone update somehow (QTimer::singleShot?) -// return; + qDebug() << "updateBreakpoint"; -// // FIXME figure out what needs to be changed (there might be more than enabled state) -// const BreakpointParameters &requested = bp->requestedParameters(); -// if (requested.enabled != bp->isEnabled()) { -// if (bp->isEnabled()) -// postDirectCommand("disable " + bp->responseId()); -// else -// postDirectCommand("enable " + bp->responseId()); -// bp->setEnabled(!bp->isEnabled()); -// } -// // Pretend it succeeds without waiting for response. - notifyBreakpointChangeOk(bp); + if (parameters.enabled != bp->isEnabled()) { + if (bp->isEnabled()) + dapRemoveBreakpoint(bp); + else + dapInsertBreakpoint(bp); + } } void DapEngine::removeBreakpoint(const Breakpoint &bp) @@ -433,6 +429,11 @@ void DapEngine::removeBreakpoint(const Breakpoint &bp) QTC_CHECK(bp->state() == BreakpointRemoveRequested); notifyBreakpointRemoveProceeding(bp); + dapRemoveBreakpoint(bp); +} + +void DapEngine::dapRemoveBreakpoint(const Breakpoint &bp) +{ const BreakpointParameters ¶ms = bp->requestedParameters(); QJsonArray breakpoints; @@ -455,7 +456,6 @@ void DapEngine::removeBreakpoint(const Breakpoint &bp) }); qCDebug(dapEngineLog) << "removeBreakpoint" << bp->modelId() << bp->responseId(); - notifyBreakpointRemoveOk(bp); } void DapEngine::loadSymbols(const Utils::FilePath &/*moduleName*/) @@ -870,6 +870,16 @@ void DapEngine::handleBreakpointEvent(const QJsonObject &event) QString::number(breakpoint.value("id").toInt())); qCDebug(dapEngineLog) << "breakpoint id :" << breakpoint.value("id").toInt(); + if (bp) { + BreakpointParameters parameters = bp->requestedParameters(); + if (parameters.enabled != bp->isEnabled()) { + parameters.pending = false; + bp->setParameters(parameters); + notifyBreakpointChangeOk(bp); + return; + } + } + if (body.value("reason").toString() == "new") { if (breakpoint.value("verified").toBool()) { notifyBreakpointInsertOk(bp); diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 935350e4698..6871e3e468e 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -113,6 +113,8 @@ protected: void dapScopes(int frameId); void threads(); void dapVariables(int variablesReference); + void dapRemoveBreakpoint(const Breakpoint &bp); + void dapInsertBreakpoint(const Breakpoint &bp); void handleDapDone(); void readDapStandardOutput(); From b8acef5d8c78c32662c87cbb8c8cb07016a59ad8 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 22:34:06 +0200 Subject: [PATCH 0707/1777] AndroidManager: Rename runAdbCommandDetached() into startAdbProcess() The process wasn't started detached in fact. Change-Id: I60aee6d4de3be2499727ea43c3492c1c478f5e94 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/android/androidmanager.cpp | 4 ++-- src/plugins/android/androidmanager.h | 2 +- src/plugins/android/androidrunnerworker.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index 27c38f1ddb8..a9639b0b750 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -612,7 +612,7 @@ void AndroidManager::installQASIPackage(Target *target, const FilePath &packageP QStringList arguments = AndroidDeviceInfo::adbSelector(deviceSerialNumber); arguments << "install" << "-r " << packagePath.path(); QString error; - QProcess *process = runAdbCommandDetached(arguments, &error); + QProcess *process = startAdbProcess(arguments, &error); if (process) { // TODO: Potential leak when the process is still running on Creator shutdown. QObject::connect(process, &QProcess::finished, process, &QObject::deleteLater); @@ -671,7 +671,7 @@ bool AndroidManager::checkCertificateExists(const FilePath &keystorePath, return proc.result() == ProcessResult::FinishedWithSuccess; } -QProcess *AndroidManager::runAdbCommandDetached(const QStringList &args, QString *err) +QProcess *AndroidManager::startAdbProcess(const QStringList &args, QString *err) { std::unique_ptr<QProcess> p(new QProcess); const FilePath adb = AndroidConfigurations::currentConfig().adbToolPath(); diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index fdb0973d9bc..772f3da5dc9 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -97,7 +97,7 @@ public: static bool checkCertificateExists(const Utils::FilePath &keystorePath, const QString &keystorePasswd, const QString &alias); - static QProcess *runAdbCommandDetached(const QStringList &args, QString *err = nullptr); + static QProcess *startAdbProcess(const QStringList &args, QString *err = nullptr); static SdkToolResult runAdbCommand(const QStringList &args, const QByteArray &writeData = {}, int timeoutS = 30); diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 3be19a69fad..f8dd558b224 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -674,7 +674,7 @@ bool AndroidRunnerWorker::startDebuggerServer(const QString &packageDir, << "platform" // << "--server" // Can lead to zombie servers << "--listen" << QString("*:%1").arg(m_localDebugServerPort.toString()); - m_debugServerProcess.reset(AndroidManager::runAdbCommandDetached(lldbServerArgs, &lldbServerErr)); + m_debugServerProcess.reset(AndroidManager::startAdbProcess(lldbServerArgs, &lldbServerErr)); if (!m_debugServerProcess) { qCDebug(androidRunWorkerLog) << "Debugger process failed to start" << lldbServerErr; @@ -694,7 +694,7 @@ bool AndroidRunnerWorker::startDebuggerServer(const QString &packageDir, gdbServerErr += adbArgs; gdbServerErr << debugServerFile << "--multi" << "+" + gdbServerSocket; - m_debugServerProcess.reset(AndroidManager::runAdbCommandDetached(gdbServerErr, &gdbProcessErr)); + m_debugServerProcess.reset(AndroidManager::startAdbProcess(gdbServerErr, &gdbProcessErr)); if (!m_debugServerProcess) { qCDebug(androidRunWorkerLog) << "Debugger process failed to start" << gdbServerErr; @@ -861,7 +861,7 @@ void AndroidRunnerWorker::onProcessIdChanged(PidUserPair pidUser) logcatReadStandardOutput(); QTC_ASSERT(!m_psIsAlive, /**/); QStringList isAliveArgs = selector() << "shell" << pidPollingScript.arg(m_processPID); - m_psIsAlive.reset(AndroidManager::runAdbCommandDetached(isAliveArgs)); + m_psIsAlive.reset(AndroidManager::startAdbProcess(isAliveArgs)); QTC_ASSERT(m_psIsAlive, return); m_psIsAlive->setObjectName("IsAliveProcess"); m_psIsAlive->setProcessChannelMode(QProcess::MergedChannels); From 01cac8299b8978f2cf883d3d17ca933767c15891 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 15 Aug 2023 10:01:33 +0200 Subject: [PATCH 0708/1777] ProjectExplorer: fix Interpreter::changed emits Only emit changed if the current interpreter changes. This is more in line with the other aspects. This fixes the pyside detection since the changed signal was not emitted in all relevant code paths. Change-Id: I53409b17f260b35914e39de894b48d7bd1ce27c0 Reviewed-by: hjk <hjk@qt.io> --- .../runconfigurationaspects.cpp | 22 ++++++++++++++----- .../projectexplorer/runconfigurationaspects.h | 1 + src/plugins/python/pythonrunconfiguration.cpp | 1 - 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 7afe438ea6b..158a102ad1b 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -809,6 +809,8 @@ Interpreter InterpreterAspect::currentInterpreter() const void InterpreterAspect::updateInterpreters(const QList<Interpreter> &interpreters) { + if (m_interpreters == interpreters) + return; m_interpreters = interpreters; if (m_comboBox) updateComboBox(); @@ -816,9 +818,11 @@ void InterpreterAspect::updateInterpreters(const QList<Interpreter> &interpreter void InterpreterAspect::setDefaultInterpreter(const Interpreter &interpreter) { + if (m_defaultId == interpreter.id) + return; m_defaultId = interpreter.id; if (m_currentId.isEmpty()) - m_currentId = m_defaultId; + setCurrentInterpreter(interpreter); } void InterpreterAspect::setCurrentInterpreter(const Interpreter &interpreter) @@ -829,14 +833,13 @@ void InterpreterAspect::setCurrentInterpreter(const Interpreter &interpreter) return; m_comboBox->setCurrentIndex(index); } else { - m_currentId = interpreter.id; + setCurrentInterpreterId(interpreter.id); } - emit changed(); } void InterpreterAspect::fromMap(const QVariantMap &map) { - m_currentId = map.value(settingsKey(), m_defaultId).toString(); + setCurrentInterpreterId(map.value(settingsKey(), m_defaultId).toString()); } void InterpreterAspect::toMap(QVariantMap &map) const @@ -862,15 +865,22 @@ void InterpreterAspect::addToLayout(LayoutItem &builder) builder.addItems({Tr::tr("Interpreter:"), m_comboBox.data(), manageButton}); } +void InterpreterAspect::setCurrentInterpreterId(const QString &id) +{ + if (id == m_currentId) + return; + m_currentId = id; + emit changed(); +} + void InterpreterAspect::updateCurrentInterpreter() { const int index = m_comboBox->currentIndex(); if (index < 0) return; QTC_ASSERT(index < m_interpreters.size(), return); - m_currentId = m_interpreters[index].id; m_comboBox->setToolTip(m_interpreters[index].command.toUserOutput()); - emit changed(); + setCurrentInterpreterId(m_interpreters[index].id); } void InterpreterAspect::updateComboBox() diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index 7865aef3775..e9f88d8a011 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -245,6 +245,7 @@ public: struct Data : Utils::BaseAspect::Data { Interpreter interpreter; }; private: + void setCurrentInterpreterId(const QString &id); void updateCurrentInterpreter(); void updateComboBox(); QList<Interpreter> m_interpreters; diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 4675ef4b1bf..05366abff24 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -127,7 +127,6 @@ public: { connect(q, &InterpreterAspect::changed, this, &PythonInterpreterAspectPrivate::currentInterpreterChanged); - currentInterpreterChanged(); connect(PySideInstaller::instance(), &PySideInstaller::pySideInstalled, this, [this](const FilePath &python) { From 9b18e73fac3ef03ae0bf293ce4618f2fba589b82 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 15 Aug 2023 09:37:43 +0200 Subject: [PATCH 0709/1777] Utils: Switch FileIconProviderImplementation::icon() overloads The FilePath based one seems to be called primarily, so make that the primary implementation, saving a FilePath <-> QFileInfo round trip. Change-Id: Ib3427a5168e559b8a583570ac1c82dfe658644da Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/fsengine/fileiconprovider.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/libs/utils/fsengine/fileiconprovider.cpp b/src/libs/utils/fsengine/fileiconprovider.cpp index cd2cc060a21..928789a4514 100644 --- a/src/libs/utils/fsengine/fileiconprovider.cpp +++ b/src/libs/utils/fsengine/fileiconprovider.cpp @@ -165,11 +165,9 @@ static const QIcon &dirIcon() return icon; } -QIcon FileIconProviderImplementation::icon(const QFileInfo &fi) const +QIcon FileIconProviderImplementation::icon(const FilePath &filePath) const { - qCDebug(fileIconProvider) << "FileIconProvider::icon" << fi.absoluteFilePath(); - - const FilePath filePath = FilePath::fromString(fi.filePath()); + qCDebug(fileIconProvider) << "FileIconProvider::icon" << filePath.absoluteFilePath(); if (filePath.isEmpty()) return unknownFileIcon(); @@ -181,17 +179,17 @@ QIcon FileIconProviderImplementation::icon(const QFileInfo &fi) const return dirIcon(); } - bool isDir = fi.isDir(); + const bool isDir = filePath.isDir(); // Check for cached overlay icons by file suffix. - const QString filename = !isDir ? fi.fileName() : QString(); + const QString filename = !isDir ? filePath.fileName() : QString(); if (!filename.isEmpty()) { const std::optional<QIcon> icon = getIcon(m_filenameCache, filename); if (icon) return *icon; } - const QString suffix = !isDir ? fi.suffix() : QString(); + const QString suffix = !isDir ? filePath.suffix() : QString(); if (!suffix.isEmpty()) { const std::optional<QIcon> icon = getIcon(m_suffixCache, suffix); if (icon) @@ -213,11 +211,11 @@ QIcon FileIconProviderImplementation::icon(const QFileInfo &fi) const return icon; } -QIcon FileIconProviderImplementation::icon(const FilePath &filePath) const +QIcon FileIconProviderImplementation::icon(const QFileInfo &fi) const { - qCDebug(fileIconProvider) << "FileIconProvider::icon" << filePath.absoluteFilePath(); + qCDebug(fileIconProvider) << "FileIconProvider::icon" << fi.absoluteFilePath(); - return icon(QFileInfo(filePath.toFSPathString())); + return icon(FilePath::fromString(fi.filePath())); } /*! From 5ae116618e919b91d8838fa01182209c6d81a3e3 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 11 Aug 2023 08:56:11 +0200 Subject: [PATCH 0710/1777] Tracing: Remove useless code runSceneGraphTest() did nothing but create an opengl context and offscreen surface. It did nothing with the provided QSGNode. The only thing it does is make the test fail if the opengl context can't be created for instance on test machines without opengl. Change-Id: I376c3565f5afcee6e123a7ef8b9832e679e645a0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> --- src/libs/tracing/CMakeLists.txt | 10 ------ src/libs/tracing/runscenegraphtest.cpp | 34 ------------------- src/libs/tracing/runscenegraphtest.h | 13 ------- src/libs/tracing/tracing.qbs | 8 ----- ...qmlprofilerbindingloopsrenderpass_test.cpp | 8 ++--- tests/auto/tracing/flamegraph/CMakeLists.txt | 1 + .../tst_timelineitemsrenderpass.cpp | 5 ++- .../tst_timelinenotesrenderpass.cpp | 5 ++- .../tst_timelineselectionrenderpass.cpp | 5 ++- 9 files changed, 11 insertions(+), 78 deletions(-) delete mode 100644 src/libs/tracing/runscenegraphtest.cpp delete mode 100644 src/libs/tracing/runscenegraphtest.h diff --git a/src/libs/tracing/CMakeLists.txt b/src/libs/tracing/CMakeLists.txt index 3e0a7237f6c..e89f31f9cc8 100644 --- a/src/libs/tracing/CMakeLists.txt +++ b/src/libs/tracing/CMakeLists.txt @@ -1,11 +1,3 @@ -if (WITH_TESTS) - set(TEST_SOURCES - runscenegraphtest.cpp runscenegraphtest.h - ) -else() - set(TEST_SOURCES "") -endif() - set(TRACING_CPP_SOURCES flamegraph.cpp flamegraph.h flamegraphattached.h @@ -40,8 +32,6 @@ add_qtc_library(Tracing FEATURE_INFO DEPENDS Utils Qt::Quick PUBLIC_DEPENDS Qt::Widgets Qt::Qml - SOURCES - ${TEST_SOURCES} ) if (NOT TARGET Tracing) diff --git a/src/libs/tracing/runscenegraphtest.cpp b/src/libs/tracing/runscenegraphtest.cpp deleted file mode 100644 index d88dd03271f..00000000000 --- a/src/libs/tracing/runscenegraphtest.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "runscenegraphtest.h" - -#include <QTest> -#include <QString> -#include <QOpenGLContext> -#include <QOffscreenSurface> - -namespace Timeline { - -void runSceneGraphTest(QSGNode *node) -{ - Q_UNUSED(node) - - QSurfaceFormat format; - format.setStencilBufferSize(8); - format.setDepthBufferSize(24); - - QOpenGLContext context; - context.setFormat(format); - QVERIFY(context.create()); - - QOffscreenSurface surface; - surface.setFormat(format); - surface.create(); - - QVERIFY(context.makeCurrent(&surface)); - - context.doneCurrent(); -} - -} // namespace Timeline diff --git a/src/libs/tracing/runscenegraphtest.h b/src/libs/tracing/runscenegraphtest.h deleted file mode 100644 index e76702d6818..00000000000 --- a/src/libs/tracing/runscenegraphtest.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "tracing_global.h" -#include <QSGNode> - -namespace Timeline { - -void TRACING_EXPORT runSceneGraphTest(QSGNode *node); - -} // namespace Timeline diff --git a/src/libs/tracing/tracing.qbs b/src/libs/tracing/tracing.qbs index 465a92c8ffe..b71fe1f6057 100644 --- a/src/libs/tracing/tracing.qbs +++ b/src/libs/tracing/tracing.qbs @@ -47,14 +47,6 @@ Project { files: "qml/**" } - Group { - name: "Unit test utilities" - condition: project.withAutotests - files: [ - "runscenegraphtest.cpp", "runscenegraphtest.h" - ] - } - cpp.defines: base.concat("TRACING_LIBRARY") } } diff --git a/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp index 2f720557524..0ddfc2bc927 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp @@ -4,10 +4,10 @@ #include "qmlprofilerbindingloopsrenderpass_test.h" +#include <tracing/timelineabstractrenderer.h> #include <qmlprofiler/qmlprofilerbindingloopsrenderpass.h> #include <qmlprofiler/qmlprofilerrangemodel.h> -#include <tracing/timelineabstractrenderer.h> -#include <tracing/runscenegraphtest.h> + #include <QtTest> namespace QmlProfiler { @@ -131,8 +131,8 @@ void QmlProfilerBindingLoopsRenderPassTest::testUpdate() parentState.setPassState(0, result); parentState.assembleNodeTree(&model, 1, 1); - Timeline::runSceneGraphTest(parentState.collapsedOverlayRoot()); - Timeline::runSceneGraphTest(parentState.expandedRowRoot()); + QVERIFY(parentState.collapsedOverlayRoot()); + QVERIFY(parentState.expandedRowRoot()); } } // namespace Internal diff --git a/tests/auto/tracing/flamegraph/CMakeLists.txt b/tests/auto/tracing/flamegraph/CMakeLists.txt index ae894557af4..8618fdf7d5e 100644 --- a/tests/auto/tracing/flamegraph/CMakeLists.txt +++ b/tests/auto/tracing/flamegraph/CMakeLists.txt @@ -1,4 +1,5 @@ add_qtc_test(tst_tracing_flamegraph + NEEDS_GUI DEPENDS Tracing Qt::Quick SOURCES tst_flamegraph.cpp ) diff --git a/tests/auto/tracing/timelineitemsrenderpass/tst_timelineitemsrenderpass.cpp b/tests/auto/tracing/timelineitemsrenderpass/tst_timelineitemsrenderpass.cpp index 10bc5c85e1a..0c42367a613 100644 --- a/tests/auto/tracing/timelineitemsrenderpass/tst_timelineitemsrenderpass.cpp +++ b/tests/auto/tracing/timelineitemsrenderpass/tst_timelineitemsrenderpass.cpp @@ -1,7 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include <tracing/runscenegraphtest.h> #include <tracing/timelineitemsrenderpass.h> #include <tracing/timelinemodelaggregator.h> #include <tracing/timelinerenderstate.h> @@ -124,8 +123,8 @@ void tst_TimelineItemsRenderPass::update() parentState.setPassState(0, result); parentState.assembleNodeTree(&model, 1, 1); - runSceneGraphTest(parentState.collapsedRowRoot()); - runSceneGraphTest(parentState.expandedRowRoot()); + QVERIFY(parentState.collapsedRowRoot()); + QVERIFY(parentState.expandedRowRoot()); } QTEST_MAIN(tst_TimelineItemsRenderPass) diff --git a/tests/auto/tracing/timelinenotesrenderpass/tst_timelinenotesrenderpass.cpp b/tests/auto/tracing/timelinenotesrenderpass/tst_timelinenotesrenderpass.cpp index ea08ed7d823..77447f53ed3 100644 --- a/tests/auto/tracing/timelinenotesrenderpass/tst_timelinenotesrenderpass.cpp +++ b/tests/auto/tracing/timelinenotesrenderpass/tst_timelinenotesrenderpass.cpp @@ -1,7 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include <tracing/runscenegraphtest.h> #include <tracing/timelinemodelaggregator.h> #include <tracing/timelinenotesrenderpass.h> #include <tracing/timelinerenderstate.h> @@ -110,8 +109,8 @@ void tst_TimelineNotesRenderPass::update() parentState.setPassState(0, result); parentState.assembleNodeTree(&model, 1, 1); - runSceneGraphTest(parentState.collapsedOverlayRoot()); - runSceneGraphTest(parentState.expandedRowRoot()); + QVERIFY(parentState.collapsedOverlayRoot()); + QVERIFY(parentState.expandedRowRoot()); } QTEST_MAIN(tst_TimelineNotesRenderPass) diff --git a/tests/auto/tracing/timelineselectionrenderpass/tst_timelineselectionrenderpass.cpp b/tests/auto/tracing/timelineselectionrenderpass/tst_timelineselectionrenderpass.cpp index 411d42a7173..94a49d5fdba 100644 --- a/tests/auto/tracing/timelineselectionrenderpass/tst_timelineselectionrenderpass.cpp +++ b/tests/auto/tracing/timelineselectionrenderpass/tst_timelineselectionrenderpass.cpp @@ -1,7 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include <tracing/runscenegraphtest.h> #include <tracing/timelineselectionrenderpass.h> #include <tracing/timelinerenderstate.h> #include <tracing/timelineabstractrenderer_p.h> @@ -150,8 +149,8 @@ void tst_TimelineSelectionRenderPass::update() parentState.setPassState(0, result); parentState.assembleNodeTree(&model, 1, 1); - runSceneGraphTest(parentState.collapsedOverlayRoot()); - runSceneGraphTest(parentState.expandedOverlayRoot()); + QVERIFY(parentState.collapsedOverlayRoot()); + QVERIFY(parentState.expandedOverlayRoot()); } QTEST_MAIN(tst_TimelineSelectionRenderPass) From 10feedf9de541665ad7465e56d2635e44592f417 Mon Sep 17 00:00:00 2001 From: Mehdi Salem <mehdi.salem@qt.io> Date: Wed, 9 Aug 2023 15:52:36 +0200 Subject: [PATCH 0711/1777] Axivion: integrate generated DTOs We are not yet making use of the integrated DTOs as this will happen in a future commit along with the network requests to fetch the data. Change-Id: I72cf9005cae052c41a7e906e0fae5dbe176e0882 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Andreas Loth <andreas.loth@qt.io> --- src/plugins/axivion/CMakeLists.txt | 2 + src/plugins/axivion/dashboard/concat.cpp | 41 + src/plugins/axivion/dashboard/concat.h | 30 + src/plugins/axivion/dashboard/dto.cpp | 4228 ++++++++++++++++++++++ src/plugins/axivion/dashboard/dto.h | 2994 +++++++++++++++ 5 files changed, 7295 insertions(+) create mode 100644 src/plugins/axivion/dashboard/concat.cpp create mode 100644 src/plugins/axivion/dashboard/concat.h create mode 100644 src/plugins/axivion/dashboard/dto.cpp create mode 100644 src/plugins/axivion/dashboard/dto.h diff --git a/src/plugins/axivion/CMakeLists.txt b/src/plugins/axivion/CMakeLists.txt index b346cc276dc..e855e419f07 100644 --- a/src/plugins/axivion/CMakeLists.txt +++ b/src/plugins/axivion/CMakeLists.txt @@ -12,4 +12,6 @@ add_qtc_plugin(Axivion axivionsettings.cpp axivionsettings.h axivionsettingspage.cpp axivionsettingspage.h axiviontr.h + dashboard/dto.cpp dashboard/dto.h + dashboard/concat.cpp dashboard/concat.h ) diff --git a/src/plugins/axivion/dashboard/concat.cpp b/src/plugins/axivion/dashboard/concat.cpp new file mode 100644 index 00000000000..837cf4a311a --- /dev/null +++ b/src/plugins/axivion/dashboard/concat.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022-current by Axivion GmbH + * https://www.axivion.com/ + * + * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + * + * Purpose: Helper functions to concatenate strings/bytes + * + * !!!!!! GENERATED, DO NOT EDIT !!!!!! + * + * This file was generated with the script at + * <AxivionSuiteRepo>/projects/libs/dashboard_cpp_api/generator/generate_dashboard_cpp_api.py + */ + +#include "dashboard/concat.h" + +#include <utility> + +template<typename Input, typename Output> +static Output concat(const std::initializer_list<const Input> &args) { + size_t size = 0; + for (const Input &arg : args) + size += arg.size(); + Output output; + output.reserve(size); + for (const Input &arg : args) + output += arg; + return output; +} + +std::string concat(const std::initializer_list<const std::string_view> &args) { + return concat<std::string_view, std::string>(args); +} + +QString concat(const std::initializer_list<const QStringView> &args) { + return concat<QStringView, QString>(args); +} + +QByteArray concat_bytes(const std::initializer_list<const QByteArrayView> &args) { + return concat<QByteArrayView, QByteArray>(args); +} diff --git a/src/plugins/axivion/dashboard/concat.h b/src/plugins/axivion/dashboard/concat.h new file mode 100644 index 00000000000..591b4ffeca3 --- /dev/null +++ b/src/plugins/axivion/dashboard/concat.h @@ -0,0 +1,30 @@ +#pragma once + +/* + * Copyright (C) 2022-current by Axivion GmbH + * https://www.axivion.com/ + * + * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + * + * Purpose: Helper functions to concatenate strings/bytes + * + * !!!!!! GENERATED, DO NOT EDIT !!!!!! + * + * This file was generated with the script at + * <AxivionSuiteRepo>/projects/libs/dashboard_cpp_api/generator/generate_dashboard_cpp_api.py + */ + +#include <QByteArray> +#include <QByteArrayView> +#include <QString> +#include <QStringView> + +#include <string> +#include <string_view> + +std::string concat(const std::initializer_list<const std::string_view> &args); + +QString concat(const std::initializer_list<const QStringView> &args); + +QByteArray concat_bytes(const std::initializer_list<const QByteArrayView> &args); + diff --git a/src/plugins/axivion/dashboard/dto.cpp b/src/plugins/axivion/dashboard/dto.cpp new file mode 100644 index 00000000000..5c0747ea9e5 --- /dev/null +++ b/src/plugins/axivion/dashboard/dto.cpp @@ -0,0 +1,4228 @@ +/* + * Copyright (C) 2022-current by Axivion GmbH + * https://www.axivion.com/ + * + * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + * + * Purpose: Dashboard C++ API Implementation + * + * !!!!!! GENERATED, DO NOT EDIT !!!!!! + * + * This file was generated with the script at + * <AxivionSuiteRepo>/projects/libs/dashboard_cpp_api/generator/generate_dashboard_cpp_api.py + */ + +#undef QT_RESTRICTED_CAST_FROM_ASCII +#define QT_NO_CAST_FROM_ASCII 1 +#define QT_NO_CAST_TO_ASCII 1 +#define QT_NO_CAST_FROM_BYTEARRAY 1 + +#include "dashboard/dto.h" + +#include "dashboard/concat.h" + +#include <QJsonValue> +#include <QJsonObject> +#include <QJsonArray> +#include <QJsonDocument> + +#include <cmath> +#include <cstdint> +#include <initializer_list> +#include <limits> +#include <string> +#include <typeinfo> +#include <utility> + +namespace Axivion::Internal::Dto { + + template<typename T> + static std::string to_std_string(const T &e) + { + return std::to_string(e); + } + + template<> + std::string to_std_string(const QString &qstr) + { + return qstr.toStdString(); + } + + template<> + std::string to_std_string(const QAnyStringView &qasv) + { + return to_std_string(qasv.toString()); + } + + // exceptions + + invalid_dto_exception::invalid_dto_exception(const std::string_view type_name, const std::exception &ex) : + std::runtime_error(concat({ type_name, u8": ", ex.what() })) + {} + + invalid_dto_exception::invalid_dto_exception(const std::string_view type_name, const std::string_view message) : + std::runtime_error(concat({ type_name, u8": ", message })) + {} + + // throws Axivion::Internal::Dto::invalid_dto_exception + template<typename T> + [[noreturn]] static void throw_invalid_dto_exception(const std::exception &ex) + { + throw invalid_dto_exception(typeid(T).name(), ex); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + template<typename T> + [[noreturn]] static void throw_invalid_dto_exception(std::string_view message) + { + throw invalid_dto_exception(typeid(T).name(), message); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + template<typename T> + [[noreturn]] static void throw_json_type_conversion(QJsonValue::Type type) { + throw_invalid_dto_exception<T>(concat({ + u8"Error parsing JSON: Cannot convert type ", + to_std_string(type) + })); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + template<typename T, typename V> + [[noreturn]] static void throw_json_value_conversion(const V &raw_value) { + throw_invalid_dto_exception<T>(concat({ + u8"Error parsing JSON: Cannot convert raw value ", + to_std_string(raw_value) + })); + } + + // basic json (de)serialization + + // throws Axivion::Internal::Dto::invalid_dto_exception + template<typename T> + static QJsonObject toJsonObject(const QJsonValue &json) + { + if (json.isObject()) + { + return json.toObject(); + } + throw_json_type_conversion<std::map<QString, T>>(json.type()); + } + + template<typename T> + class de_serializer final + { + public: + // Require usage of template specializations. + // This static members have to be implemented: + // + // // throws Axivion::Internal::Dto::invalid_dto_exception + // static T deserialize(const QJsonValue &json); + // + // static QJsonValue serialize(const T &value); + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + template<typename T> + static T deserialize_json(const QJsonValue &json) + { + return de_serializer<T>::deserialize(json); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + template<typename T> + static T deserialize_bytes(const QByteArray &json) + { + QJsonValue qjv; + { + QJsonParseError error; + const QJsonDocument qjd = QJsonDocument::fromJson(json, &error); + if (error.error != QJsonParseError::ParseError::NoError) + { + throw_invalid_dto_exception<T>(concat({ + u8"Error parsing JSON - ", + to_std_string(error.error), + u8" at ", + to_std_string(error.offset), + u8": ", + to_std_string(error.errorString()) + })); + } + if (!qjd.isObject()) + { + throw_invalid_dto_exception<T>(u8"Error parsing JSON: parsed data is no JSON object"); + } + qjv = QJsonValue(qjd.object()); + } + return deserialize_json<T>(qjv); + } + + template<typename T> + static QJsonValue serialize_json(const T &value) + { + return de_serializer<T>::serialize(value); + } + + template<typename T> + static QByteArray serialize_bytes(const T &value) + { + QJsonDocument qjd; + { + QJsonValue qjv = serialize_json(value); + if (qjv.isObject()) + { + qjd = QJsonDocument(qjv.toObject()); + } + else if (qjv.isArray()) + { + qjd = QJsonDocument(qjv.toArray()); + } + else + { + throw std::domain_error(concat({ + u8"Error serializing JSON - value is not an object or array:", + to_std_string(qjv.type()) + })); + } + } + return qjd.toJson(QJsonDocument::JsonFormat::Indented); + } + + template<> + class de_serializer<std::nullptr_t> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static std::nullptr_t deserialize(const QJsonValue &json) + { + if (json.isNull()) + { + return nullptr; + } + throw_json_type_conversion<std::nullptr_t>(json.type()); + } + + static QJsonValue serialize(const std::nullptr_t&) + { + return {}; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template<> + class de_serializer<QString> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static QString deserialize(const QJsonValue &json) + { + if (json.isString()) + { + return json.toString(); + } + throw_json_type_conversion<QString>(json.type()); + } + + static QJsonValue serialize(const QString &value) + { + return { value }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template<> + class de_serializer<bool> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static bool deserialize(const QJsonValue &json) + { + if (json.isBool()) + { + return json.toBool(); + } + throw_json_type_conversion<bool>(json.type()); + } + + static QJsonValue serialize(const bool &value) + { + return { value }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template<> + class de_serializer<qint32> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static qint32 deserialize(const QJsonValue &json) + { + if (!json.isDouble()) + { + throw_json_type_conversion<qint32>(json.type()); + } + const double rawValue = json.toDouble(); + const qint32 value = static_cast<qint32>(rawValue); + if (static_cast<double>(value) != rawValue) + { + throw_json_value_conversion<qint32>(rawValue); + } + return value; + } + + static QJsonValue serialize(const qint32 &value) + { + return { static_cast<qint64>(value) }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template<> + class de_serializer<qint64> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static qint64 deserialize(const QJsonValue &json) + { + if (!json.isDouble()) + { + throw_json_type_conversion<qint64>(json.type()); + } + const double rawValue = json.toDouble(); + const qint64 value = static_cast<qint64>(rawValue); + if (static_cast<double>(value) != rawValue) + { + throw_json_value_conversion<qint64>(rawValue); + } + return value; + } + + static QJsonValue serialize(const qint64 &value) + { + return { value }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + static const QLatin1String deSerializerDoublePositiveInfinity{"Infinity"}; + static const QLatin1String deSerializerDoubleNegativeInfinity{"-Infinity"}; + static const QLatin1String deSerializerDoubleNAN{"NaN"}; + + template<> + class de_serializer<double> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static double deserialize(const QJsonValue &json) + { + if (json.isDouble()) + { + return json.toDouble(); + } + if (json.isString()) + { + const QString rawValue = json.toString(); + if (rawValue == deSerializerDoublePositiveInfinity) + { + return std::numeric_limits<double>::infinity(); + } + if (rawValue == deSerializerDoubleNegativeInfinity) + { + return -std::numeric_limits<double>::infinity(); + } + if (rawValue == deSerializerDoubleNAN) + { + return std::numeric_limits<double>::quiet_NaN(); + } + throw_json_value_conversion<double>(rawValue); + } + throw_json_type_conversion<double>(json.type()); + } + + static QJsonValue serialize(const double &value) + { + if (value == std::numeric_limits<double>::infinity()) + { + return { deSerializerDoublePositiveInfinity }; + } + if (value == -std::numeric_limits<double>::infinity()) + { + return { deSerializerDoubleNegativeInfinity }; + } + if (std::isnan(value)) + { + return { deSerializerDoubleNAN }; + } + return { value }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template<typename T> + class de_serializer<std::optional<T>> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static std::optional<T> deserialize(const QJsonValue &json) + { + if (json.isNull()) + { + return std::nullopt; + } + return deserialize_json<T>(json); + } + + static QJsonValue serialize(const std::optional<T> &value) + { + if (value.has_value()) { + return serialize_json(*value); + } + return serialize_json(nullptr); + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template<typename T> + class de_serializer<std::vector<T>> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static std::vector<T> deserialize(const QJsonValue &json) + { + if (!json.isArray()) + { + throw_json_type_conversion<std::vector<T>>(json.type()); + } + const QJsonArray ja = json.toArray(); + std::vector<T> value; + value.reserve(ja.size()); + for (const auto item : ja) + { + value.push_back(deserialize_json<T>(item)); + } + return value; + } + + static QJsonValue serialize(const std::vector<T> &value) + { + QJsonArray ja; + for (const T &e : value) + { + ja.push_back(serialize_json(e)); + } + return { ja }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template<typename T> + class de_serializer<std::unordered_set<T>> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static std::unordered_set<T> deserialize(const QJsonValue &json) + { + if (!json.isArray()) + { + throw_json_type_conversion<std::unordered_set<T>>(json.type()); + } + const QJsonArray ja = json.toArray(); + std::unordered_set<T> value; + value.reserve(ja.size()); + for (const auto item : ja) + { + value.insert(deserialize_json<T>(item)); + } + return value; + } + + static QJsonValue serialize(const std::unordered_set<T> &value) + { + QJsonArray ja; + for (const T &e : value) + { + ja.push_back(serialize_json(e)); + } + return { ja }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template<typename T> + class de_serializer<std::map<QString, T>> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static std::map<QString, T> deserialize(const QJsonValue &json) + { + const QJsonObject jo = toJsonObject<std::map<QString, T>>(json); + std::map<QString, T> value; + // value.reserve(jo.size()); + for (auto it = jo.constBegin(), end = jo.constEnd(); it != end; ++it) + { + value[it.key()] = deserialize_json<T>(it.value()); + } + return value; + } + + static QJsonValue serialize(const std::map<QString, T> &value) + { + QJsonObject jo; + for (const auto &[key, val] : value) + { + jo.insert(key, serialize_json(val)); + } + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // field (de)serialization + + template<typename T> + class field_de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static T deserialize(const QJsonObject &jo, const QString &key) + { + const auto it = jo.constFind(key); + if (it == jo.constEnd()) + { + throw_invalid_dto_exception<T>(concat({ + u8"Error parsing JSON: key not found ", + to_std_string(key) + })); + } + return deserialize_json<T>(it.value()); + } + + static void serialize(QJsonObject &json, const QString &key, const T &value) + { + json.insert(key, serialize_json(value)); + } + + field_de_serializer() = delete; + ~field_de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + template<typename T> + static T deserialize_field(const QJsonObject &jo, const QString &key) + { + return field_de_serializer<T>::deserialize(jo, key); + } + + template<typename T> + static void serialize_field(QJsonObject &jo, const QString &key, const T &value) + { + field_de_serializer<T>::serialize(jo, key, value); + } + + template<typename T> + class field_de_serializer<std::optional<T>> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static std::optional<T> deserialize(const QJsonObject &jo, const QString &key) + { + const auto it = jo.constFind(key); + if (it == jo.constEnd()) + { + return std::nullopt; + } + const auto value = it.value(); + if (value.isNull()) + { + return std::nullopt; + } + return deserialize_json<T>(value); + } + + static void serialize(QJsonObject &json, const QString &key, const std::optional<T> &value) + { + if (value.has_value()) + { + serialize_field(json, key, *value); + } + } + + field_de_serializer() = delete; + ~field_de_serializer() = delete; + }; + + // any + + template<> + class de_serializer<Any> final + { + public: + static Any deserialize(const QJsonValue &json) + { + if (json.isNull()) + { + return Any(); + } + if (json.isString()) + { + return Any(deserialize_json<QString>(json)); + } + if (json.isDouble()) + { + return Any(deserialize_json<double>(json)); + } + if (json.isObject()) + { + return Any(deserialize_json<std::map<QString, Any>>(json)); + } + if (json.isArray()) + { + return Any(deserialize_json<std::vector<Any>>(json)); + } + if (json.isBool()) + { + return Any(deserialize_json<bool>(json)); + } + throw std::domain_error(concat({ + u8"Unknown json value type: ", + to_std_string(json.type()) + })); + } + + static QJsonValue serialize(const Any &value) { + if (value.isNull()) + { + return serialize_json(nullptr); + } + if (value.isString()) + { + return serialize_json(value.getString()); + } + if (value.isDouble()) + { + return serialize_json(value.getDouble()); + } + if (value.isMap()) + { + return serialize_json(value.getMap()); + } + if (value.isList()) + { + return serialize_json(value.getList()); + } + if (value.isBool()) + { + return serialize_json(value.getBool()); + } + throw std::domain_error(u8"Unknown Axivion::Internal::Dto::any variant"); + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + Any Any::deserialize(const QByteArray &json) + { + return deserialize_bytes<Any>(json); + } + + Any::Any() {} + + Any::Any(QString value) : data(std::move(value)) {} + + Any::Any(double value) : data(std::move(value)) {} + + Any::Any(std::map<QString, Any> value) : data(std::move(value)) {} + + Any::Any(std::vector<Any> value) : data(std::move(value)) {} + + Any::Any(bool value) : data(std::move(value)) {} + + bool Any::isNull() const + { + return this->data.index() == 0; + } + + bool Any::isString() const + { + return this->data.index() == 1; + } + + QString &Any::getString() + { + return std::get<1>(this->data); + } + + const QString &Any::getString() const { + return std::get<1>(this->data); + } + + bool Any::isDouble() const + { + return this->data.index() == 2; + } + + double &Any::getDouble() + { + return std::get<2>(this->data); + } + + const double &Any::getDouble() const + { + return std::get<2>(this->data); + } + + bool Any::isMap() const + { + return this->data.index() == 3; + } + + std::map<QString, Any> &Any::getMap() + { + return std::get<3>(this->data); + } + + const std::map<QString, Any> &Any::getMap() const + { + return std::get<3>(this->data); + } + + bool Any::isList() const + { + return this->data.index() == 4; + } + + std::vector<Any> &Any::getList() + { + return std::get<4>(this->data); + } + + const std::vector<Any> &Any::getList() const + { + return std::get<4>(this->data); + } + + bool Any::isBool() const + { + return this->data.index() == 5; + } + + bool &Any::getBool() + { + return std::get<5>(this->data); + } + + const bool &Any::getBool() const + { + return std::get<5>(this->data); + } + + QByteArray Any::serialize() const + { + return serialize_bytes(*this); + } + + // version + + constexpr std::array<qint32, 4> ApiVersion::number{7,6,2,12725}; + const QLatin1String ApiVersion::string{"7.6.2.12725"}; + const QLatin1String ApiVersion::name{"7.6.2"}; + const QLatin1String ApiVersion::timestamp{"2023-08-07 14:38:01 +00:00"}; + + // AnalyzedFileDto + + static const QLatin1String analyzedFileKeyPath{"path"}; + static const QLatin1String analyzedFileKeyIsSystemHeader{"isSystemHeader"}; + static const QLatin1String analyzedFileKeyLanguageName{"languageName"}; + + template<> + class de_serializer<AnalyzedFileDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static AnalyzedFileDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<AnalyzedFileDto>(json); + return { + deserialize_field<QString>(jo, analyzedFileKeyPath), + deserialize_field<std::optional<bool>>(jo, analyzedFileKeyIsSystemHeader), + deserialize_field<std::optional<QString>>(jo, analyzedFileKeyLanguageName) + }; + } + + static QJsonValue serialize(const AnalyzedFileDto &value) { + QJsonObject jo; + serialize_field(jo, analyzedFileKeyPath, value.path); + serialize_field(jo, analyzedFileKeyIsSystemHeader, value.isSystemHeader); + serialize_field(jo, analyzedFileKeyLanguageName, value.languageName); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + AnalyzedFileDto AnalyzedFileDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<AnalyzedFileDto>(json); + } + + AnalyzedFileDto::AnalyzedFileDto( + QString path, + std::optional<bool> isSystemHeader, + std::optional<QString> languageName + ) : + path(std::move(path)), + isSystemHeader(std::move(isSystemHeader)), + languageName(std::move(languageName)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray AnalyzedFileDto::serialize() const + { + return serialize_bytes(*this); + } + + // ApiTokenType + + const QLatin1String ApiTokenTypeMeta::sourcefetch{"SourceFetch"}; + const QLatin1String ApiTokenTypeMeta::general{"General"}; + const QLatin1String ApiTokenTypeMeta::ideplugin{"IdePlugin"}; + const QLatin1String ApiTokenTypeMeta::login{"LogIn"}; + const QLatin1String ApiTokenTypeMeta::continuousintegration{"ContinuousIntegration"}; + + // throws std::range_error + ApiTokenType ApiTokenTypeMeta::strToEnum(QAnyStringView str) + { + if (str == ApiTokenTypeMeta::sourcefetch) + { + return ApiTokenType::sourcefetch; + } + if (str == ApiTokenTypeMeta::general) + { + return ApiTokenType::general; + } + if (str == ApiTokenTypeMeta::ideplugin) + { + return ApiTokenType::ideplugin; + } + if (str == ApiTokenTypeMeta::login) + { + return ApiTokenType::login; + } + if (str == ApiTokenTypeMeta::continuousintegration) + { + return ApiTokenType::continuousintegration; + } + throw std::range_error(concat({ u8"Unknown ApiTokenType str: ", to_std_string(str) })); + } + + QLatin1String ApiTokenTypeMeta::enumToStr(ApiTokenType e) + { + switch (e) + { + case ApiTokenType::sourcefetch: + return ApiTokenTypeMeta::sourcefetch; + case ApiTokenType::general: + return ApiTokenTypeMeta::general; + case ApiTokenType::ideplugin: + return ApiTokenTypeMeta::ideplugin; + case ApiTokenType::login: + return ApiTokenTypeMeta::login; + case ApiTokenType::continuousintegration: + return ApiTokenTypeMeta::continuousintegration;; + default: + throw std::domain_error(concat({ + u8"Unknown ApiTokenType enum: ", + to_std_string(static_cast<int>(e)) + })); + } + } + + // ChangePasswordFormDto + + static const QLatin1String changePasswordFormKeyCurrentPassword{"currentPassword"}; + static const QLatin1String changePasswordFormKeyNewPassword{"newPassword"}; + + template<> + class de_serializer<ChangePasswordFormDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ChangePasswordFormDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<ChangePasswordFormDto>(json); + return { + deserialize_field<QString>(jo, changePasswordFormKeyCurrentPassword), + deserialize_field<QString>(jo, changePasswordFormKeyNewPassword) + }; + } + + static QJsonValue serialize(const ChangePasswordFormDto &value) { + QJsonObject jo; + serialize_field(jo, changePasswordFormKeyCurrentPassword, value.currentPassword); + serialize_field(jo, changePasswordFormKeyNewPassword, value.newPassword); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ChangePasswordFormDto ChangePasswordFormDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<ChangePasswordFormDto>(json); + } + + ChangePasswordFormDto::ChangePasswordFormDto( + QString currentPassword, + QString newPassword + ) : + currentPassword(std::move(currentPassword)), + newPassword(std::move(newPassword)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ChangePasswordFormDto::serialize() const + { + return serialize_bytes(*this); + } + + // ColumnTypeOptionDto + + static const QLatin1String columnTypeOptionKeyKey{"key"}; + static const QLatin1String columnTypeOptionKeyDisplayName{"displayName"}; + static const QLatin1String columnTypeOptionKeyDisplayColor{"displayColor"}; + + template<> + class de_serializer<ColumnTypeOptionDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ColumnTypeOptionDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<ColumnTypeOptionDto>(json); + return { + deserialize_field<QString>(jo, columnTypeOptionKeyKey), + deserialize_field<std::optional<QString>>(jo, columnTypeOptionKeyDisplayName), + deserialize_field<QString>(jo, columnTypeOptionKeyDisplayColor) + }; + } + + static QJsonValue serialize(const ColumnTypeOptionDto &value) { + QJsonObject jo; + serialize_field(jo, columnTypeOptionKeyKey, value.key); + serialize_field(jo, columnTypeOptionKeyDisplayName, value.displayName); + serialize_field(jo, columnTypeOptionKeyDisplayColor, value.displayColor); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ColumnTypeOptionDto ColumnTypeOptionDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<ColumnTypeOptionDto>(json); + } + + ColumnTypeOptionDto::ColumnTypeOptionDto( + QString key, + std::optional<QString> displayName, + QString displayColor + ) : + key(std::move(key)), + displayName(std::move(displayName)), + displayColor(std::move(displayColor)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ColumnTypeOptionDto::serialize() const + { + return serialize_bytes(*this); + } + + // CommentRequestDto + + static const QLatin1String commentRequestKeyText{"text"}; + + template<> + class de_serializer<CommentRequestDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static CommentRequestDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<CommentRequestDto>(json); + return { + deserialize_field<QString>(jo, commentRequestKeyText) + }; + } + + static QJsonValue serialize(const CommentRequestDto &value) { + QJsonObject jo; + serialize_field(jo, commentRequestKeyText, value.text); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + CommentRequestDto CommentRequestDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<CommentRequestDto>(json); + } + + CommentRequestDto::CommentRequestDto( + QString text + ) : + text(std::move(text)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray CommentRequestDto::serialize() const + { + return serialize_bytes(*this); + } + + // EntityDto + + static const QLatin1String entityKeyId{"id"}; + static const QLatin1String entityKeyName{"name"}; + static const QLatin1String entityKeyType{"type"}; + static const QLatin1String entityKeyPath{"path"}; + static const QLatin1String entityKeyLine{"line"}; + + template<> + class de_serializer<EntityDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static EntityDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<EntityDto>(json); + return { + deserialize_field<QString>(jo, entityKeyId), + deserialize_field<QString>(jo, entityKeyName), + deserialize_field<QString>(jo, entityKeyType), + deserialize_field<std::optional<QString>>(jo, entityKeyPath), + deserialize_field<std::optional<qint32>>(jo, entityKeyLine) + }; + } + + static QJsonValue serialize(const EntityDto &value) { + QJsonObject jo; + serialize_field(jo, entityKeyId, value.id); + serialize_field(jo, entityKeyName, value.name); + serialize_field(jo, entityKeyType, value.type); + serialize_field(jo, entityKeyPath, value.path); + serialize_field(jo, entityKeyLine, value.line); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + EntityDto EntityDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<EntityDto>(json); + } + + EntityDto::EntityDto( + QString id, + QString name, + QString type, + std::optional<QString> path, + std::optional<qint32> line + ) : + id(std::move(id)), + name(std::move(name)), + type(std::move(type)), + path(std::move(path)), + line(std::move(line)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray EntityDto::serialize() const + { + return serialize_bytes(*this); + } + + // ErrorDto + + static const QLatin1String errorKeyDashboardVersionNumber{"dashboardVersionNumber"}; + static const QLatin1String errorKeyType{"type"}; + static const QLatin1String errorKeyMessage{"message"}; + static const QLatin1String errorKeyLocalizedMessage{"localizedMessage"}; + static const QLatin1String errorKeyDetails{"details"}; + static const QLatin1String errorKeyLocalizedDetails{"localizedDetails"}; + static const QLatin1String errorKeySupportAddress{"supportAddress"}; + static const QLatin1String errorKeyDisplayServerBugHint{"displayServerBugHint"}; + static const QLatin1String errorKeyData{"data"}; + + template<> + class de_serializer<ErrorDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ErrorDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<ErrorDto>(json); + return { + deserialize_field<std::optional<QString>>(jo, errorKeyDashboardVersionNumber), + deserialize_field<QString>(jo, errorKeyType), + deserialize_field<QString>(jo, errorKeyMessage), + deserialize_field<QString>(jo, errorKeyLocalizedMessage), + deserialize_field<std::optional<QString>>(jo, errorKeyDetails), + deserialize_field<std::optional<QString>>(jo, errorKeyLocalizedDetails), + deserialize_field<std::optional<QString>>(jo, errorKeySupportAddress), + deserialize_field<std::optional<bool>>(jo, errorKeyDisplayServerBugHint), + deserialize_field<std::optional<std::map<QString, Any>>>(jo, errorKeyData) + }; + } + + static QJsonValue serialize(const ErrorDto &value) { + QJsonObject jo; + serialize_field(jo, errorKeyDashboardVersionNumber, value.dashboardVersionNumber); + serialize_field(jo, errorKeyType, value.type); + serialize_field(jo, errorKeyMessage, value.message); + serialize_field(jo, errorKeyLocalizedMessage, value.localizedMessage); + serialize_field(jo, errorKeyDetails, value.details); + serialize_field(jo, errorKeyLocalizedDetails, value.localizedDetails); + serialize_field(jo, errorKeySupportAddress, value.supportAddress); + serialize_field(jo, errorKeyDisplayServerBugHint, value.displayServerBugHint); + serialize_field(jo, errorKeyData, value.data); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ErrorDto ErrorDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<ErrorDto>(json); + } + + ErrorDto::ErrorDto( + std::optional<QString> dashboardVersionNumber, + QString type, + QString message, + QString localizedMessage, + std::optional<QString> details, + std::optional<QString> localizedDetails, + std::optional<QString> supportAddress, + std::optional<bool> displayServerBugHint, + std::optional<std::map<QString, Any>> data + ) : + dashboardVersionNumber(std::move(dashboardVersionNumber)), + type(std::move(type)), + message(std::move(message)), + localizedMessage(std::move(localizedMessage)), + details(std::move(details)), + localizedDetails(std::move(localizedDetails)), + supportAddress(std::move(supportAddress)), + displayServerBugHint(std::move(displayServerBugHint)), + data(std::move(data)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ErrorDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueCommentDto + + static const QLatin1String issueCommentKeyUsername{"username"}; + static const QLatin1String issueCommentKeyUserDisplayName{"userDisplayName"}; + static const QLatin1String issueCommentKeyDate{"date"}; + static const QLatin1String issueCommentKeyDisplayDate{"displayDate"}; + static const QLatin1String issueCommentKeyText{"text"}; + static const QLatin1String issueCommentKeyHtml{"html"}; + static const QLatin1String issueCommentKeyCommentDeletionId{"commentDeletionId"}; + + template<> + class de_serializer<IssueCommentDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueCommentDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<IssueCommentDto>(json); + return { + deserialize_field<QString>(jo, issueCommentKeyUsername), + deserialize_field<QString>(jo, issueCommentKeyUserDisplayName), + deserialize_field<QString>(jo, issueCommentKeyDate), + deserialize_field<QString>(jo, issueCommentKeyDisplayDate), + deserialize_field<QString>(jo, issueCommentKeyText), + deserialize_field<std::optional<QString>>(jo, issueCommentKeyHtml), + deserialize_field<std::optional<QString>>(jo, issueCommentKeyCommentDeletionId) + }; + } + + static QJsonValue serialize(const IssueCommentDto &value) { + QJsonObject jo; + serialize_field(jo, issueCommentKeyUsername, value.username); + serialize_field(jo, issueCommentKeyUserDisplayName, value.userDisplayName); + serialize_field(jo, issueCommentKeyDate, value.date); + serialize_field(jo, issueCommentKeyDisplayDate, value.displayDate); + serialize_field(jo, issueCommentKeyText, value.text); + serialize_field(jo, issueCommentKeyHtml, value.html); + serialize_field(jo, issueCommentKeyCommentDeletionId, value.commentDeletionId); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueCommentDto IssueCommentDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<IssueCommentDto>(json); + } + + IssueCommentDto::IssueCommentDto( + QString username, + QString userDisplayName, + QString date, + QString displayDate, + QString text, + std::optional<QString> html, + std::optional<QString> commentDeletionId + ) : + username(std::move(username)), + userDisplayName(std::move(userDisplayName)), + date(std::move(date)), + displayDate(std::move(displayDate)), + text(std::move(text)), + html(std::move(html)), + commentDeletionId(std::move(commentDeletionId)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueCommentDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueKind + + const QLatin1String IssueKindMeta::av{"AV"}; + const QLatin1String IssueKindMeta::cl{"CL"}; + const QLatin1String IssueKindMeta::cy{"CY"}; + const QLatin1String IssueKindMeta::de{"DE"}; + const QLatin1String IssueKindMeta::mv{"MV"}; + const QLatin1String IssueKindMeta::sv{"SV"}; + + // throws std::range_error + IssueKind IssueKindMeta::strToEnum(QAnyStringView str) + { + if (str == IssueKindMeta::av) + { + return IssueKind::av; + } + if (str == IssueKindMeta::cl) + { + return IssueKind::cl; + } + if (str == IssueKindMeta::cy) + { + return IssueKind::cy; + } + if (str == IssueKindMeta::de) + { + return IssueKind::de; + } + if (str == IssueKindMeta::mv) + { + return IssueKind::mv; + } + if (str == IssueKindMeta::sv) + { + return IssueKind::sv; + } + throw std::range_error(concat({ u8"Unknown IssueKind str: ", to_std_string(str) })); + } + + QLatin1String IssueKindMeta::enumToStr(IssueKind e) + { + switch (e) + { + case IssueKind::av: + return IssueKindMeta::av; + case IssueKind::cl: + return IssueKindMeta::cl; + case IssueKind::cy: + return IssueKindMeta::cy; + case IssueKind::de: + return IssueKindMeta::de; + case IssueKind::mv: + return IssueKindMeta::mv; + case IssueKind::sv: + return IssueKindMeta::sv;; + default: + throw std::domain_error(concat({ + u8"Unknown IssueKind enum: ", + to_std_string(static_cast<int>(e)) + })); + } + } + + // IssueKindForNamedFilterCreation + + const QLatin1String IssueKindForNamedFilterCreationMeta::av{"AV"}; + const QLatin1String IssueKindForNamedFilterCreationMeta::cl{"CL"}; + const QLatin1String IssueKindForNamedFilterCreationMeta::cy{"CY"}; + const QLatin1String IssueKindForNamedFilterCreationMeta::de{"DE"}; + const QLatin1String IssueKindForNamedFilterCreationMeta::mv{"MV"}; + const QLatin1String IssueKindForNamedFilterCreationMeta::sv{"SV"}; + const QLatin1String IssueKindForNamedFilterCreationMeta::universal{"UNIVERSAL"}; + + // throws std::range_error + IssueKindForNamedFilterCreation IssueKindForNamedFilterCreationMeta::strToEnum(QAnyStringView str) + { + if (str == IssueKindForNamedFilterCreationMeta::av) + { + return IssueKindForNamedFilterCreation::av; + } + if (str == IssueKindForNamedFilterCreationMeta::cl) + { + return IssueKindForNamedFilterCreation::cl; + } + if (str == IssueKindForNamedFilterCreationMeta::cy) + { + return IssueKindForNamedFilterCreation::cy; + } + if (str == IssueKindForNamedFilterCreationMeta::de) + { + return IssueKindForNamedFilterCreation::de; + } + if (str == IssueKindForNamedFilterCreationMeta::mv) + { + return IssueKindForNamedFilterCreation::mv; + } + if (str == IssueKindForNamedFilterCreationMeta::sv) + { + return IssueKindForNamedFilterCreation::sv; + } + if (str == IssueKindForNamedFilterCreationMeta::universal) + { + return IssueKindForNamedFilterCreation::universal; + } + throw std::range_error(concat({ u8"Unknown IssueKindForNamedFilterCreation str: ", to_std_string(str) })); + } + + QLatin1String IssueKindForNamedFilterCreationMeta::enumToStr(IssueKindForNamedFilterCreation e) + { + switch (e) + { + case IssueKindForNamedFilterCreation::av: + return IssueKindForNamedFilterCreationMeta::av; + case IssueKindForNamedFilterCreation::cl: + return IssueKindForNamedFilterCreationMeta::cl; + case IssueKindForNamedFilterCreation::cy: + return IssueKindForNamedFilterCreationMeta::cy; + case IssueKindForNamedFilterCreation::de: + return IssueKindForNamedFilterCreationMeta::de; + case IssueKindForNamedFilterCreation::mv: + return IssueKindForNamedFilterCreationMeta::mv; + case IssueKindForNamedFilterCreation::sv: + return IssueKindForNamedFilterCreationMeta::sv; + case IssueKindForNamedFilterCreation::universal: + return IssueKindForNamedFilterCreationMeta::universal;; + default: + throw std::domain_error(concat({ + u8"Unknown IssueKindForNamedFilterCreation enum: ", + to_std_string(static_cast<int>(e)) + })); + } + } + + // IssueSourceLocationDto + + static const QLatin1String issueSourceLocationKeyFileName{"fileName"}; + static const QLatin1String issueSourceLocationKeyRole{"role"}; + static const QLatin1String issueSourceLocationKeySourceCodeUrl{"sourceCodeUrl"}; + static const QLatin1String issueSourceLocationKeyStartLine{"startLine"}; + static const QLatin1String issueSourceLocationKeyStartColumn{"startColumn"}; + static const QLatin1String issueSourceLocationKeyEndLine{"endLine"}; + static const QLatin1String issueSourceLocationKeyEndColumn{"endColumn"}; + + template<> + class de_serializer<IssueSourceLocationDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueSourceLocationDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<IssueSourceLocationDto>(json); + return { + deserialize_field<QString>(jo, issueSourceLocationKeyFileName), + deserialize_field<std::optional<QString>>(jo, issueSourceLocationKeyRole), + deserialize_field<QString>(jo, issueSourceLocationKeySourceCodeUrl), + deserialize_field<qint32>(jo, issueSourceLocationKeyStartLine), + deserialize_field<qint32>(jo, issueSourceLocationKeyStartColumn), + deserialize_field<qint32>(jo, issueSourceLocationKeyEndLine), + deserialize_field<qint32>(jo, issueSourceLocationKeyEndColumn) + }; + } + + static QJsonValue serialize(const IssueSourceLocationDto &value) { + QJsonObject jo; + serialize_field(jo, issueSourceLocationKeyFileName, value.fileName); + serialize_field(jo, issueSourceLocationKeyRole, value.role); + serialize_field(jo, issueSourceLocationKeySourceCodeUrl, value.sourceCodeUrl); + serialize_field(jo, issueSourceLocationKeyStartLine, value.startLine); + serialize_field(jo, issueSourceLocationKeyStartColumn, value.startColumn); + serialize_field(jo, issueSourceLocationKeyEndLine, value.endLine); + serialize_field(jo, issueSourceLocationKeyEndColumn, value.endColumn); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueSourceLocationDto IssueSourceLocationDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<IssueSourceLocationDto>(json); + } + + IssueSourceLocationDto::IssueSourceLocationDto( + QString fileName, + std::optional<QString> role, + QString sourceCodeUrl, + qint32 startLine, + qint32 startColumn, + qint32 endLine, + qint32 endColumn + ) : + fileName(std::move(fileName)), + role(std::move(role)), + sourceCodeUrl(std::move(sourceCodeUrl)), + startLine(std::move(startLine)), + startColumn(std::move(startColumn)), + endLine(std::move(endLine)), + endColumn(std::move(endColumn)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueSourceLocationDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueTagDto + + static const QLatin1String issueTagKeyTag{"tag"}; + static const QLatin1String issueTagKeyColor{"color"}; + + template<> + class de_serializer<IssueTagDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTagDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<IssueTagDto>(json); + return { + deserialize_field<QString>(jo, issueTagKeyTag), + deserialize_field<QString>(jo, issueTagKeyColor) + }; + } + + static QJsonValue serialize(const IssueTagDto &value) { + QJsonObject jo; + serialize_field(jo, issueTagKeyTag, value.tag); + serialize_field(jo, issueTagKeyColor, value.color); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueTagDto IssueTagDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<IssueTagDto>(json); + } + + IssueTagDto::IssueTagDto( + QString tag, + QString color + ) : + tag(std::move(tag)), + color(std::move(color)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueTagDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueTagTypeDto + + static const QLatin1String issueTagTypeKeyId{"id"}; + static const QLatin1String issueTagTypeKeyText{"text"}; + static const QLatin1String issueTagTypeKeyTag{"tag"}; + static const QLatin1String issueTagTypeKeyColor{"color"}; + static const QLatin1String issueTagTypeKeyDescription{"description"}; + static const QLatin1String issueTagTypeKeySelected{"selected"}; + + template<> + class de_serializer<IssueTagTypeDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTagTypeDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<IssueTagTypeDto>(json); + return { + deserialize_field<QString>(jo, issueTagTypeKeyId), + deserialize_field<std::optional<QString>>(jo, issueTagTypeKeyText), + deserialize_field<std::optional<QString>>(jo, issueTagTypeKeyTag), + deserialize_field<QString>(jo, issueTagTypeKeyColor), + deserialize_field<std::optional<QString>>(jo, issueTagTypeKeyDescription), + deserialize_field<std::optional<bool>>(jo, issueTagTypeKeySelected) + }; + } + + static QJsonValue serialize(const IssueTagTypeDto &value) { + QJsonObject jo; + serialize_field(jo, issueTagTypeKeyId, value.id); + serialize_field(jo, issueTagTypeKeyText, value.text); + serialize_field(jo, issueTagTypeKeyTag, value.tag); + serialize_field(jo, issueTagTypeKeyColor, value.color); + serialize_field(jo, issueTagTypeKeyDescription, value.description); + serialize_field(jo, issueTagTypeKeySelected, value.selected); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueTagTypeDto IssueTagTypeDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<IssueTagTypeDto>(json); + } + + IssueTagTypeDto::IssueTagTypeDto( + QString id, + std::optional<QString> text, + std::optional<QString> tag, + QString color, + std::optional<QString> description, + std::optional<bool> selected + ) : + id(std::move(id)), + text(std::move(text)), + tag(std::move(tag)), + color(std::move(color)), + description(std::move(description)), + selected(std::move(selected)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueTagTypeDto::serialize() const + { + return serialize_bytes(*this); + } + + // MessageSeverity + + const QLatin1String MessageSeverityMeta::debug{"DEBUG"}; + const QLatin1String MessageSeverityMeta::info{"INFO"}; + const QLatin1String MessageSeverityMeta::warning{"WARNING"}; + const QLatin1String MessageSeverityMeta::error{"ERROR"}; + const QLatin1String MessageSeverityMeta::fatal{"FATAL"}; + + // throws std::range_error + MessageSeverity MessageSeverityMeta::strToEnum(QAnyStringView str) + { + if (str == MessageSeverityMeta::debug) + { + return MessageSeverity::debug; + } + if (str == MessageSeverityMeta::info) + { + return MessageSeverity::info; + } + if (str == MessageSeverityMeta::warning) + { + return MessageSeverity::warning; + } + if (str == MessageSeverityMeta::error) + { + return MessageSeverity::error; + } + if (str == MessageSeverityMeta::fatal) + { + return MessageSeverity::fatal; + } + throw std::range_error(concat({ u8"Unknown MessageSeverity str: ", to_std_string(str) })); + } + + QLatin1String MessageSeverityMeta::enumToStr(MessageSeverity e) + { + switch (e) + { + case MessageSeverity::debug: + return MessageSeverityMeta::debug; + case MessageSeverity::info: + return MessageSeverityMeta::info; + case MessageSeverity::warning: + return MessageSeverityMeta::warning; + case MessageSeverity::error: + return MessageSeverityMeta::error; + case MessageSeverity::fatal: + return MessageSeverityMeta::fatal;; + default: + throw std::domain_error(concat({ + u8"Unknown MessageSeverity enum: ", + to_std_string(static_cast<int>(e)) + })); + } + } + + // MetricDto + + static const QLatin1String metricKeyName{"name"}; + static const QLatin1String metricKeyDisplayName{"displayName"}; + static const QLatin1String metricKeyMinValue{"minValue"}; + static const QLatin1String metricKeyMaxValue{"maxValue"}; + + template<> + class de_serializer<MetricDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static MetricDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<MetricDto>(json); + return { + deserialize_field<QString>(jo, metricKeyName), + deserialize_field<QString>(jo, metricKeyDisplayName), + deserialize_field<Any>(jo, metricKeyMinValue), + deserialize_field<Any>(jo, metricKeyMaxValue) + }; + } + + static QJsonValue serialize(const MetricDto &value) { + QJsonObject jo; + serialize_field(jo, metricKeyName, value.name); + serialize_field(jo, metricKeyDisplayName, value.displayName); + serialize_field(jo, metricKeyMinValue, value.minValue); + serialize_field(jo, metricKeyMaxValue, value.maxValue); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + MetricDto MetricDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<MetricDto>(json); + } + + MetricDto::MetricDto( + QString name, + QString displayName, + Any minValue, + Any maxValue + ) : + name(std::move(name)), + displayName(std::move(displayName)), + minValue(std::move(minValue)), + maxValue(std::move(maxValue)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray MetricDto::serialize() const + { + return serialize_bytes(*this); + } + + // MetricValueTableRowDto + + static const QLatin1String metricValueTableRowKeyMetric{"metric"}; + static const QLatin1String metricValueTableRowKeyPath{"path"}; + static const QLatin1String metricValueTableRowKeyLine{"line"}; + static const QLatin1String metricValueTableRowKeyValue{"value"}; + static const QLatin1String metricValueTableRowKeyEntity{"entity"}; + static const QLatin1String metricValueTableRowKeyEntityType{"entityType"}; + static const QLatin1String metricValueTableRowKeyEntityId{"entityId"}; + + template<> + class de_serializer<MetricValueTableRowDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static MetricValueTableRowDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<MetricValueTableRowDto>(json); + return { + deserialize_field<QString>(jo, metricValueTableRowKeyMetric), + deserialize_field<std::optional<QString>>(jo, metricValueTableRowKeyPath), + deserialize_field<std::optional<qint32>>(jo, metricValueTableRowKeyLine), + deserialize_field<std::optional<double>>(jo, metricValueTableRowKeyValue), + deserialize_field<QString>(jo, metricValueTableRowKeyEntity), + deserialize_field<QString>(jo, metricValueTableRowKeyEntityType), + deserialize_field<QString>(jo, metricValueTableRowKeyEntityId) + }; + } + + static QJsonValue serialize(const MetricValueTableRowDto &value) { + QJsonObject jo; + serialize_field(jo, metricValueTableRowKeyMetric, value.metric); + serialize_field(jo, metricValueTableRowKeyPath, value.path); + serialize_field(jo, metricValueTableRowKeyLine, value.line); + serialize_field(jo, metricValueTableRowKeyValue, value.value); + serialize_field(jo, metricValueTableRowKeyEntity, value.entity); + serialize_field(jo, metricValueTableRowKeyEntityType, value.entityType); + serialize_field(jo, metricValueTableRowKeyEntityId, value.entityId); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + MetricValueTableRowDto MetricValueTableRowDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<MetricValueTableRowDto>(json); + } + + MetricValueTableRowDto::MetricValueTableRowDto( + QString metric, + std::optional<QString> path, + std::optional<qint32> line, + std::optional<double> value, + QString entity, + QString entityType, + QString entityId + ) : + metric(std::move(metric)), + path(std::move(path)), + line(std::move(line)), + value(std::move(value)), + entity(std::move(entity)), + entityType(std::move(entityType)), + entityId(std::move(entityId)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray MetricValueTableRowDto::serialize() const + { + return serialize_bytes(*this); + } + + // NamedFilterType + + const QLatin1String NamedFilterTypeMeta::predefined{"PREDEFINED"}; + const QLatin1String NamedFilterTypeMeta::global{"GLOBAL"}; + const QLatin1String NamedFilterTypeMeta::custom{"CUSTOM"}; + + // throws std::range_error + NamedFilterType NamedFilterTypeMeta::strToEnum(QAnyStringView str) + { + if (str == NamedFilterTypeMeta::predefined) + { + return NamedFilterType::predefined; + } + if (str == NamedFilterTypeMeta::global) + { + return NamedFilterType::global; + } + if (str == NamedFilterTypeMeta::custom) + { + return NamedFilterType::custom; + } + throw std::range_error(concat({ u8"Unknown NamedFilterType str: ", to_std_string(str) })); + } + + QLatin1String NamedFilterTypeMeta::enumToStr(NamedFilterType e) + { + switch (e) + { + case NamedFilterType::predefined: + return NamedFilterTypeMeta::predefined; + case NamedFilterType::global: + return NamedFilterTypeMeta::global; + case NamedFilterType::custom: + return NamedFilterTypeMeta::custom;; + default: + throw std::domain_error(concat({ + u8"Unknown NamedFilterType enum: ", + to_std_string(static_cast<int>(e)) + })); + } + } + + // NamedFilterVisibilityDto + + static const QLatin1String namedFilterVisibilityKeyGroups{"groups"}; + + template<> + class de_serializer<NamedFilterVisibilityDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterVisibilityDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<NamedFilterVisibilityDto>(json); + return { + deserialize_field<std::optional<std::vector<QString>>>(jo, namedFilterVisibilityKeyGroups) + }; + } + + static QJsonValue serialize(const NamedFilterVisibilityDto &value) { + QJsonObject jo; + serialize_field(jo, namedFilterVisibilityKeyGroups, value.groups); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + NamedFilterVisibilityDto NamedFilterVisibilityDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<NamedFilterVisibilityDto>(json); + } + + NamedFilterVisibilityDto::NamedFilterVisibilityDto( + std::optional<std::vector<QString>> groups + ) : + groups(std::move(groups)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray NamedFilterVisibilityDto::serialize() const + { + return serialize_bytes(*this); + } + + // ProjectReferenceDto + + static const QLatin1String projectReferenceKeyName{"name"}; + static const QLatin1String projectReferenceKeyUrl{"url"}; + + template<> + class de_serializer<ProjectReferenceDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ProjectReferenceDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<ProjectReferenceDto>(json); + return { + deserialize_field<QString>(jo, projectReferenceKeyName), + deserialize_field<QString>(jo, projectReferenceKeyUrl) + }; + } + + static QJsonValue serialize(const ProjectReferenceDto &value) { + QJsonObject jo; + serialize_field(jo, projectReferenceKeyName, value.name); + serialize_field(jo, projectReferenceKeyUrl, value.url); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ProjectReferenceDto ProjectReferenceDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<ProjectReferenceDto>(json); + } + + ProjectReferenceDto::ProjectReferenceDto( + QString name, + QString url + ) : + name(std::move(name)), + url(std::move(url)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ProjectReferenceDto::serialize() const + { + return serialize_bytes(*this); + } + + // RuleDto + + static const QLatin1String ruleKeyName{"name"}; + static const QLatin1String ruleKeyOriginal_name{"original_name"}; + static const QLatin1String ruleKeyDisabled{"disabled"}; + + template<> + class de_serializer<RuleDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static RuleDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<RuleDto>(json); + return { + deserialize_field<QString>(jo, ruleKeyName), + deserialize_field<QString>(jo, ruleKeyOriginal_name), + deserialize_field<std::optional<bool>>(jo, ruleKeyDisabled) + }; + } + + static QJsonValue serialize(const RuleDto &value) { + QJsonObject jo; + serialize_field(jo, ruleKeyName, value.name); + serialize_field(jo, ruleKeyOriginal_name, value.original_name); + serialize_field(jo, ruleKeyDisabled, value.disabled); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + RuleDto RuleDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<RuleDto>(json); + } + + RuleDto::RuleDto( + QString name, + QString original_name, + std::optional<bool> disabled + ) : + name(std::move(name)), + original_name(std::move(original_name)), + disabled(std::move(disabled)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray RuleDto::serialize() const + { + return serialize_bytes(*this); + } + + // SortDirection + + const QLatin1String SortDirectionMeta::asc{"ASC"}; + const QLatin1String SortDirectionMeta::desc{"DESC"}; + + // throws std::range_error + SortDirection SortDirectionMeta::strToEnum(QAnyStringView str) + { + if (str == SortDirectionMeta::asc) + { + return SortDirection::asc; + } + if (str == SortDirectionMeta::desc) + { + return SortDirection::desc; + } + throw std::range_error(concat({ u8"Unknown SortDirection str: ", to_std_string(str) })); + } + + QLatin1String SortDirectionMeta::enumToStr(SortDirection e) + { + switch (e) + { + case SortDirection::asc: + return SortDirectionMeta::asc; + case SortDirection::desc: + return SortDirectionMeta::desc;; + default: + throw std::domain_error(concat({ + u8"Unknown SortDirection enum: ", + to_std_string(static_cast<int>(e)) + })); + } + } + + // TableCellAlignment + + const QLatin1String TableCellAlignmentMeta::left{"left"}; + const QLatin1String TableCellAlignmentMeta::right{"right"}; + const QLatin1String TableCellAlignmentMeta::center{"center"}; + + // throws std::range_error + TableCellAlignment TableCellAlignmentMeta::strToEnum(QAnyStringView str) + { + if (str == TableCellAlignmentMeta::left) + { + return TableCellAlignment::left; + } + if (str == TableCellAlignmentMeta::right) + { + return TableCellAlignment::right; + } + if (str == TableCellAlignmentMeta::center) + { + return TableCellAlignment::center; + } + throw std::range_error(concat({ u8"Unknown TableCellAlignment str: ", to_std_string(str) })); + } + + QLatin1String TableCellAlignmentMeta::enumToStr(TableCellAlignment e) + { + switch (e) + { + case TableCellAlignment::left: + return TableCellAlignmentMeta::left; + case TableCellAlignment::right: + return TableCellAlignmentMeta::right; + case TableCellAlignment::center: + return TableCellAlignmentMeta::center;; + default: + throw std::domain_error(concat({ + u8"Unknown TableCellAlignment enum: ", + to_std_string(static_cast<int>(e)) + })); + } + } + + // ToolsVersionDto + + static const QLatin1String toolsVersionKeyName{"name"}; + static const QLatin1String toolsVersionKeyNumber{"number"}; + static const QLatin1String toolsVersionKeyBuildDate{"buildDate"}; + + template<> + class de_serializer<ToolsVersionDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ToolsVersionDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<ToolsVersionDto>(json); + return { + deserialize_field<QString>(jo, toolsVersionKeyName), + deserialize_field<QString>(jo, toolsVersionKeyNumber), + deserialize_field<QString>(jo, toolsVersionKeyBuildDate) + }; + } + + static QJsonValue serialize(const ToolsVersionDto &value) { + QJsonObject jo; + serialize_field(jo, toolsVersionKeyName, value.name); + serialize_field(jo, toolsVersionKeyNumber, value.number); + serialize_field(jo, toolsVersionKeyBuildDate, value.buildDate); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ToolsVersionDto ToolsVersionDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<ToolsVersionDto>(json); + } + + ToolsVersionDto::ToolsVersionDto( + QString name, + QString number, + QString buildDate + ) : + name(std::move(name)), + number(std::move(number)), + buildDate(std::move(buildDate)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ToolsVersionDto::serialize() const + { + return serialize_bytes(*this); + } + + // UserRefType + + const QLatin1String UserRefTypeMeta::virtual_user{"VIRTUAL_USER"}; + const QLatin1String UserRefTypeMeta::dashboard_user{"DASHBOARD_USER"}; + const QLatin1String UserRefTypeMeta::unmapped_user{"UNMAPPED_USER"}; + + // throws std::range_error + UserRefType UserRefTypeMeta::strToEnum(QAnyStringView str) + { + if (str == UserRefTypeMeta::virtual_user) + { + return UserRefType::virtual_user; + } + if (str == UserRefTypeMeta::dashboard_user) + { + return UserRefType::dashboard_user; + } + if (str == UserRefTypeMeta::unmapped_user) + { + return UserRefType::unmapped_user; + } + throw std::range_error(concat({ u8"Unknown UserRefType str: ", to_std_string(str) })); + } + + QLatin1String UserRefTypeMeta::enumToStr(UserRefType e) + { + switch (e) + { + case UserRefType::virtual_user: + return UserRefTypeMeta::virtual_user; + case UserRefType::dashboard_user: + return UserRefTypeMeta::dashboard_user; + case UserRefType::unmapped_user: + return UserRefTypeMeta::unmapped_user;; + default: + throw std::domain_error(concat({ + u8"Unknown UserRefType enum: ", + to_std_string(static_cast<int>(e)) + })); + } + } + + // VersionKindCountDto + + static const QLatin1String versionKindCountKeyTotal{"Total"}; + static const QLatin1String versionKindCountKeyAdded{"Added"}; + static const QLatin1String versionKindCountKeyRemoved{"Removed"}; + + template<> + class de_serializer<VersionKindCountDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static VersionKindCountDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<VersionKindCountDto>(json); + return { + deserialize_field<qint32>(jo, versionKindCountKeyTotal), + deserialize_field<qint32>(jo, versionKindCountKeyAdded), + deserialize_field<qint32>(jo, versionKindCountKeyRemoved) + }; + } + + static QJsonValue serialize(const VersionKindCountDto &value) { + QJsonObject jo; + serialize_field(jo, versionKindCountKeyTotal, value.Total); + serialize_field(jo, versionKindCountKeyAdded, value.Added); + serialize_field(jo, versionKindCountKeyRemoved, value.Removed); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + VersionKindCountDto VersionKindCountDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<VersionKindCountDto>(json); + } + + VersionKindCountDto::VersionKindCountDto( + qint32 Total, + qint32 Added, + qint32 Removed + ) : + Total(std::move(Total)), + Added(std::move(Added)), + Removed(std::move(Removed)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray VersionKindCountDto::serialize() const + { + return serialize_bytes(*this); + } + + // AnalysisVersionDto + + static const QLatin1String analysisVersionKeyDate{"date"}; + static const QLatin1String analysisVersionKeyLabel{"label"}; + static const QLatin1String analysisVersionKeyIndex{"index"}; + static const QLatin1String analysisVersionKeyName{"name"}; + static const QLatin1String analysisVersionKeyMillis{"millis"}; + static const QLatin1String analysisVersionKeyIssueCounts{"issueCounts"}; + static const QLatin1String analysisVersionKeyToolsVersion{"toolsVersion"}; + static const QLatin1String analysisVersionKeyLinesOfCode{"linesOfCode"}; + static const QLatin1String analysisVersionKeyCloneRatio{"cloneRatio"}; + + template<> + class de_serializer<AnalysisVersionDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static AnalysisVersionDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<AnalysisVersionDto>(json); + return { + deserialize_field<QString>(jo, analysisVersionKeyDate), + deserialize_field<std::optional<QString>>(jo, analysisVersionKeyLabel), + deserialize_field<qint32>(jo, analysisVersionKeyIndex), + deserialize_field<std::optional<QString>>(jo, analysisVersionKeyName), + deserialize_field<qint64>(jo, analysisVersionKeyMillis), + deserialize_field<Any>(jo, analysisVersionKeyIssueCounts), + deserialize_field<std::optional<ToolsVersionDto>>(jo, analysisVersionKeyToolsVersion), + deserialize_field<std::optional<qint64>>(jo, analysisVersionKeyLinesOfCode), + deserialize_field<std::optional<double>>(jo, analysisVersionKeyCloneRatio) + }; + } + + static QJsonValue serialize(const AnalysisVersionDto &value) { + QJsonObject jo; + serialize_field(jo, analysisVersionKeyDate, value.date); + serialize_field(jo, analysisVersionKeyLabel, value.label); + serialize_field(jo, analysisVersionKeyIndex, value.index); + serialize_field(jo, analysisVersionKeyName, value.name); + serialize_field(jo, analysisVersionKeyMillis, value.millis); + serialize_field(jo, analysisVersionKeyIssueCounts, value.issueCounts); + serialize_field(jo, analysisVersionKeyToolsVersion, value.toolsVersion); + serialize_field(jo, analysisVersionKeyLinesOfCode, value.linesOfCode); + serialize_field(jo, analysisVersionKeyCloneRatio, value.cloneRatio); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + AnalysisVersionDto AnalysisVersionDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<AnalysisVersionDto>(json); + } + + AnalysisVersionDto::AnalysisVersionDto( + QString date, + std::optional<QString> label, + qint32 index, + std::optional<QString> name, + qint64 millis, + Any issueCounts, + std::optional<ToolsVersionDto> toolsVersion, + std::optional<qint64> linesOfCode, + std::optional<double> cloneRatio + ) : + date(std::move(date)), + label(std::move(label)), + index(std::move(index)), + name(std::move(name)), + millis(std::move(millis)), + issueCounts(std::move(issueCounts)), + toolsVersion(std::move(toolsVersion)), + linesOfCode(std::move(linesOfCode)), + cloneRatio(std::move(cloneRatio)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray AnalysisVersionDto::serialize() const + { + return serialize_bytes(*this); + } + + // ApiTokenCreationRequestDto + + static const QLatin1String apiTokenCreationRequestKeyPassword{"password"}; + static const QLatin1String apiTokenCreationRequestKeyType{"type"}; + static const QLatin1String apiTokenCreationRequestKeyDescription{"description"}; + static const QLatin1String apiTokenCreationRequestKeyMaxAgeMillis{"maxAgeMillis"}; + + template<> + class de_serializer<ApiTokenCreationRequestDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ApiTokenCreationRequestDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<ApiTokenCreationRequestDto>(json); + return { + deserialize_field<QString>(jo, apiTokenCreationRequestKeyPassword), + deserialize_field<QString>(jo, apiTokenCreationRequestKeyType), + deserialize_field<QString>(jo, apiTokenCreationRequestKeyDescription), + deserialize_field<qint64>(jo, apiTokenCreationRequestKeyMaxAgeMillis) + }; + } + + static QJsonValue serialize(const ApiTokenCreationRequestDto &value) { + QJsonObject jo; + serialize_field(jo, apiTokenCreationRequestKeyPassword, value.password); + serialize_field(jo, apiTokenCreationRequestKeyType, value.type); + serialize_field(jo, apiTokenCreationRequestKeyDescription, value.description); + serialize_field(jo, apiTokenCreationRequestKeyMaxAgeMillis, value.maxAgeMillis); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ApiTokenCreationRequestDto ApiTokenCreationRequestDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<ApiTokenCreationRequestDto>(json); + } + + ApiTokenCreationRequestDto::ApiTokenCreationRequestDto( + QString password, + QString type, + QString description, + qint64 maxAgeMillis + ) : + password(std::move(password)), + type(std::move(type)), + description(std::move(description)), + maxAgeMillis(std::move(maxAgeMillis)) + { } + + ApiTokenCreationRequestDto::ApiTokenCreationRequestDto( + QString password, + ApiTokenType type, + QString description, + qint64 maxAgeMillis + ) : ApiTokenCreationRequestDto( + std::move(password), + ApiTokenTypeMeta::enumToStr(type), + std::move(description), + std::move(maxAgeMillis)) + { } + + // throws std::range_error + ApiTokenType ApiTokenCreationRequestDto::getTypeEnum() const + { + return ApiTokenTypeMeta::strToEnum(type); + } + + void ApiTokenCreationRequestDto::setTypeEnum(ApiTokenType newValue) + { + type = ApiTokenTypeMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ApiTokenCreationRequestDto::serialize() const + { + return serialize_bytes(*this); + } + + // ApiTokenInfoDto + + static const QLatin1String apiTokenInfoKeyId{"id"}; + static const QLatin1String apiTokenInfoKeyUrl{"url"}; + static const QLatin1String apiTokenInfoKeyIsValid{"isValid"}; + static const QLatin1String apiTokenInfoKeyType{"type"}; + static const QLatin1String apiTokenInfoKeyDescription{"description"}; + static const QLatin1String apiTokenInfoKeyToken{"token"}; + static const QLatin1String apiTokenInfoKeyCreationDate{"creationDate"}; + static const QLatin1String apiTokenInfoKeyDisplayCreationDate{"displayCreationDate"}; + static const QLatin1String apiTokenInfoKeyExpirationDate{"expirationDate"}; + static const QLatin1String apiTokenInfoKeyDisplayExpirationDate{"displayExpirationDate"}; + static const QLatin1String apiTokenInfoKeyLastUseDate{"lastUseDate"}; + static const QLatin1String apiTokenInfoKeyDisplayLastUseDate{"displayLastUseDate"}; + static const QLatin1String apiTokenInfoKeyUsedByCurrentRequest{"usedByCurrentRequest"}; + + template<> + class de_serializer<ApiTokenInfoDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ApiTokenInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<ApiTokenInfoDto>(json); + return { + deserialize_field<QString>(jo, apiTokenInfoKeyId), + deserialize_field<QString>(jo, apiTokenInfoKeyUrl), + deserialize_field<bool>(jo, apiTokenInfoKeyIsValid), + deserialize_field<QString>(jo, apiTokenInfoKeyType), + deserialize_field<QString>(jo, apiTokenInfoKeyDescription), + deserialize_field<std::optional<QString>>(jo, apiTokenInfoKeyToken), + deserialize_field<QString>(jo, apiTokenInfoKeyCreationDate), + deserialize_field<QString>(jo, apiTokenInfoKeyDisplayCreationDate), + deserialize_field<QString>(jo, apiTokenInfoKeyExpirationDate), + deserialize_field<QString>(jo, apiTokenInfoKeyDisplayExpirationDate), + deserialize_field<std::optional<QString>>(jo, apiTokenInfoKeyLastUseDate), + deserialize_field<QString>(jo, apiTokenInfoKeyDisplayLastUseDate), + deserialize_field<bool>(jo, apiTokenInfoKeyUsedByCurrentRequest) + }; + } + + static QJsonValue serialize(const ApiTokenInfoDto &value) { + QJsonObject jo; + serialize_field(jo, apiTokenInfoKeyId, value.id); + serialize_field(jo, apiTokenInfoKeyUrl, value.url); + serialize_field(jo, apiTokenInfoKeyIsValid, value.isValid); + serialize_field(jo, apiTokenInfoKeyType, value.type); + serialize_field(jo, apiTokenInfoKeyDescription, value.description); + serialize_field(jo, apiTokenInfoKeyToken, value.token); + serialize_field(jo, apiTokenInfoKeyCreationDate, value.creationDate); + serialize_field(jo, apiTokenInfoKeyDisplayCreationDate, value.displayCreationDate); + serialize_field(jo, apiTokenInfoKeyExpirationDate, value.expirationDate); + serialize_field(jo, apiTokenInfoKeyDisplayExpirationDate, value.displayExpirationDate); + serialize_field(jo, apiTokenInfoKeyLastUseDate, value.lastUseDate); + serialize_field(jo, apiTokenInfoKeyDisplayLastUseDate, value.displayLastUseDate); + serialize_field(jo, apiTokenInfoKeyUsedByCurrentRequest, value.usedByCurrentRequest); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ApiTokenInfoDto ApiTokenInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<ApiTokenInfoDto>(json); + } + + ApiTokenInfoDto::ApiTokenInfoDto( + QString id, + QString url, + bool isValid, + QString type, + QString description, + std::optional<QString> token, + QString creationDate, + QString displayCreationDate, + QString expirationDate, + QString displayExpirationDate, + std::optional<QString> lastUseDate, + QString displayLastUseDate, + bool usedByCurrentRequest + ) : + id(std::move(id)), + url(std::move(url)), + isValid(std::move(isValid)), + type(std::move(type)), + description(std::move(description)), + token(std::move(token)), + creationDate(std::move(creationDate)), + displayCreationDate(std::move(displayCreationDate)), + expirationDate(std::move(expirationDate)), + displayExpirationDate(std::move(displayExpirationDate)), + lastUseDate(std::move(lastUseDate)), + displayLastUseDate(std::move(displayLastUseDate)), + usedByCurrentRequest(std::move(usedByCurrentRequest)) + { } + + ApiTokenInfoDto::ApiTokenInfoDto( + QString id, + QString url, + bool isValid, + ApiTokenType type, + QString description, + std::optional<QString> token, + QString creationDate, + QString displayCreationDate, + QString expirationDate, + QString displayExpirationDate, + std::optional<QString> lastUseDate, + QString displayLastUseDate, + bool usedByCurrentRequest + ) : ApiTokenInfoDto( + std::move(id), + std::move(url), + std::move(isValid), + ApiTokenTypeMeta::enumToStr(type), + std::move(description), + std::move(token), + std::move(creationDate), + std::move(displayCreationDate), + std::move(expirationDate), + std::move(displayExpirationDate), + std::move(lastUseDate), + std::move(displayLastUseDate), + std::move(usedByCurrentRequest)) + { } + + // throws std::range_error + ApiTokenType ApiTokenInfoDto::getTypeEnum() const + { + return ApiTokenTypeMeta::strToEnum(type); + } + + void ApiTokenInfoDto::setTypeEnum(ApiTokenType newValue) + { + type = ApiTokenTypeMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ApiTokenInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // ColumnInfoDto + + static const QLatin1String columnInfoKeyKey{"key"}; + static const QLatin1String columnInfoKeyHeader{"header"}; + static const QLatin1String columnInfoKeyCanSort{"canSort"}; + static const QLatin1String columnInfoKeyCanFilter{"canFilter"}; + static const QLatin1String columnInfoKeyAlignment{"alignment"}; + static const QLatin1String columnInfoKeyType{"type"}; + static const QLatin1String columnInfoKeyTypeOptions{"typeOptions"}; + static const QLatin1String columnInfoKeyWidth{"width"}; + static const QLatin1String columnInfoKeyShowByDefault{"showByDefault"}; + static const QLatin1String columnInfoKeyLinkKey{"linkKey"}; + + template<> + class de_serializer<ColumnInfoDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ColumnInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<ColumnInfoDto>(json); + return { + deserialize_field<QString>(jo, columnInfoKeyKey), + deserialize_field<std::optional<QString>>(jo, columnInfoKeyHeader), + deserialize_field<bool>(jo, columnInfoKeyCanSort), + deserialize_field<bool>(jo, columnInfoKeyCanFilter), + deserialize_field<QString>(jo, columnInfoKeyAlignment), + deserialize_field<QString>(jo, columnInfoKeyType), + deserialize_field<std::optional<std::vector<ColumnTypeOptionDto>>>(jo, columnInfoKeyTypeOptions), + deserialize_field<qint32>(jo, columnInfoKeyWidth), + deserialize_field<bool>(jo, columnInfoKeyShowByDefault), + deserialize_field<std::optional<QString>>(jo, columnInfoKeyLinkKey) + }; + } + + static QJsonValue serialize(const ColumnInfoDto &value) { + QJsonObject jo; + serialize_field(jo, columnInfoKeyKey, value.key); + serialize_field(jo, columnInfoKeyHeader, value.header); + serialize_field(jo, columnInfoKeyCanSort, value.canSort); + serialize_field(jo, columnInfoKeyCanFilter, value.canFilter); + serialize_field(jo, columnInfoKeyAlignment, value.alignment); + serialize_field(jo, columnInfoKeyType, value.type); + serialize_field(jo, columnInfoKeyTypeOptions, value.typeOptions); + serialize_field(jo, columnInfoKeyWidth, value.width); + serialize_field(jo, columnInfoKeyShowByDefault, value.showByDefault); + serialize_field(jo, columnInfoKeyLinkKey, value.linkKey); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ColumnInfoDto ColumnInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<ColumnInfoDto>(json); + } + + ColumnInfoDto::ColumnInfoDto( + QString key, + std::optional<QString> header, + bool canSort, + bool canFilter, + QString alignment, + QString type, + std::optional<std::vector<ColumnTypeOptionDto>> typeOptions, + qint32 width, + bool showByDefault, + std::optional<QString> linkKey + ) : + key(std::move(key)), + header(std::move(header)), + canSort(std::move(canSort)), + canFilter(std::move(canFilter)), + alignment(std::move(alignment)), + type(std::move(type)), + typeOptions(std::move(typeOptions)), + width(std::move(width)), + showByDefault(std::move(showByDefault)), + linkKey(std::move(linkKey)) + { } + + ColumnInfoDto::ColumnInfoDto( + QString key, + std::optional<QString> header, + bool canSort, + bool canFilter, + TableCellAlignment alignment, + QString type, + std::optional<std::vector<ColumnTypeOptionDto>> typeOptions, + qint32 width, + bool showByDefault, + std::optional<QString> linkKey + ) : ColumnInfoDto( + std::move(key), + std::move(header), + std::move(canSort), + std::move(canFilter), + TableCellAlignmentMeta::enumToStr(alignment), + std::move(type), + std::move(typeOptions), + std::move(width), + std::move(showByDefault), + std::move(linkKey)) + { } + + // throws std::range_error + TableCellAlignment ColumnInfoDto::getAlignmentEnum() const + { + return TableCellAlignmentMeta::strToEnum(alignment); + } + + void ColumnInfoDto::setAlignmentEnum(TableCellAlignment newValue) + { + alignment = TableCellAlignmentMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ColumnInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // DashboardInfoDto + + static const QLatin1String dashboardInfoKeyMainUrl{"mainUrl"}; + static const QLatin1String dashboardInfoKeyDashboardVersion{"dashboardVersion"}; + static const QLatin1String dashboardInfoKeyDashboardVersionNumber{"dashboardVersionNumber"}; + static const QLatin1String dashboardInfoKeyDashboardBuildDate{"dashboardBuildDate"}; + static const QLatin1String dashboardInfoKeyUsername{"username"}; + static const QLatin1String dashboardInfoKeyCsrfTokenHeader{"csrfTokenHeader"}; + static const QLatin1String dashboardInfoKeyCsrfToken{"csrfToken"}; + static const QLatin1String dashboardInfoKeyCheckCredentialsUrl{"checkCredentialsUrl"}; + static const QLatin1String dashboardInfoKeyNamedFiltersUrl{"namedFiltersUrl"}; + static const QLatin1String dashboardInfoKeyProjects{"projects"}; + static const QLatin1String dashboardInfoKeyUserApiTokenUrl{"userApiTokenUrl"}; + static const QLatin1String dashboardInfoKeyUserNamedFiltersUrl{"userNamedFiltersUrl"}; + static const QLatin1String dashboardInfoKeySupportAddress{"supportAddress"}; + static const QLatin1String dashboardInfoKeyIssueFilterHelp{"issueFilterHelp"}; + + template<> + class de_serializer<DashboardInfoDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static DashboardInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<DashboardInfoDto>(json); + return { + deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyMainUrl), + deserialize_field<QString>(jo, dashboardInfoKeyDashboardVersion), + deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyDashboardVersionNumber), + deserialize_field<QString>(jo, dashboardInfoKeyDashboardBuildDate), + deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyUsername), + deserialize_field<QString>(jo, dashboardInfoKeyCsrfTokenHeader), + deserialize_field<QString>(jo, dashboardInfoKeyCsrfToken), + deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyCheckCredentialsUrl), + deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyNamedFiltersUrl), + deserialize_field<std::optional<std::vector<ProjectReferenceDto>>>(jo, dashboardInfoKeyProjects), + deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyUserApiTokenUrl), + deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyUserNamedFiltersUrl), + deserialize_field<std::optional<QString>>(jo, dashboardInfoKeySupportAddress), + deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyIssueFilterHelp) + }; + } + + static QJsonValue serialize(const DashboardInfoDto &value) { + QJsonObject jo; + serialize_field(jo, dashboardInfoKeyMainUrl, value.mainUrl); + serialize_field(jo, dashboardInfoKeyDashboardVersion, value.dashboardVersion); + serialize_field(jo, dashboardInfoKeyDashboardVersionNumber, value.dashboardVersionNumber); + serialize_field(jo, dashboardInfoKeyDashboardBuildDate, value.dashboardBuildDate); + serialize_field(jo, dashboardInfoKeyUsername, value.username); + serialize_field(jo, dashboardInfoKeyCsrfTokenHeader, value.csrfTokenHeader); + serialize_field(jo, dashboardInfoKeyCsrfToken, value.csrfToken); + serialize_field(jo, dashboardInfoKeyCheckCredentialsUrl, value.checkCredentialsUrl); + serialize_field(jo, dashboardInfoKeyNamedFiltersUrl, value.namedFiltersUrl); + serialize_field(jo, dashboardInfoKeyProjects, value.projects); + serialize_field(jo, dashboardInfoKeyUserApiTokenUrl, value.userApiTokenUrl); + serialize_field(jo, dashboardInfoKeyUserNamedFiltersUrl, value.userNamedFiltersUrl); + serialize_field(jo, dashboardInfoKeySupportAddress, value.supportAddress); + serialize_field(jo, dashboardInfoKeyIssueFilterHelp, value.issueFilterHelp); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + DashboardInfoDto DashboardInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<DashboardInfoDto>(json); + } + + DashboardInfoDto::DashboardInfoDto( + std::optional<QString> mainUrl, + QString dashboardVersion, + std::optional<QString> dashboardVersionNumber, + QString dashboardBuildDate, + std::optional<QString> username, + QString csrfTokenHeader, + QString csrfToken, + std::optional<QString> checkCredentialsUrl, + std::optional<QString> namedFiltersUrl, + std::optional<std::vector<ProjectReferenceDto>> projects, + std::optional<QString> userApiTokenUrl, + std::optional<QString> userNamedFiltersUrl, + std::optional<QString> supportAddress, + std::optional<QString> issueFilterHelp + ) : + mainUrl(std::move(mainUrl)), + dashboardVersion(std::move(dashboardVersion)), + dashboardVersionNumber(std::move(dashboardVersionNumber)), + dashboardBuildDate(std::move(dashboardBuildDate)), + username(std::move(username)), + csrfTokenHeader(std::move(csrfTokenHeader)), + csrfToken(std::move(csrfToken)), + checkCredentialsUrl(std::move(checkCredentialsUrl)), + namedFiltersUrl(std::move(namedFiltersUrl)), + projects(std::move(projects)), + userApiTokenUrl(std::move(userApiTokenUrl)), + userNamedFiltersUrl(std::move(userNamedFiltersUrl)), + supportAddress(std::move(supportAddress)), + issueFilterHelp(std::move(issueFilterHelp)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray DashboardInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueCommentListDto + + static const QLatin1String issueCommentListKeyComments{"comments"}; + + template<> + class de_serializer<IssueCommentListDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueCommentListDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<IssueCommentListDto>(json); + return { + deserialize_field<std::vector<IssueCommentDto>>(jo, issueCommentListKeyComments) + }; + } + + static QJsonValue serialize(const IssueCommentListDto &value) { + QJsonObject jo; + serialize_field(jo, issueCommentListKeyComments, value.comments); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueCommentListDto IssueCommentListDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<IssueCommentListDto>(json); + } + + IssueCommentListDto::IssueCommentListDto( + std::vector<IssueCommentDto> comments + ) : + comments(std::move(comments)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueCommentListDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueKindInfoDto + + static const QLatin1String issueKindInfoKeyPrefix{"prefix"}; + static const QLatin1String issueKindInfoKeyNiceSingularName{"niceSingularName"}; + static const QLatin1String issueKindInfoKeyNicePluralName{"nicePluralName"}; + + template<> + class de_serializer<IssueKindInfoDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueKindInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<IssueKindInfoDto>(json); + return { + deserialize_field<QString>(jo, issueKindInfoKeyPrefix), + deserialize_field<QString>(jo, issueKindInfoKeyNiceSingularName), + deserialize_field<QString>(jo, issueKindInfoKeyNicePluralName) + }; + } + + static QJsonValue serialize(const IssueKindInfoDto &value) { + QJsonObject jo; + serialize_field(jo, issueKindInfoKeyPrefix, value.prefix); + serialize_field(jo, issueKindInfoKeyNiceSingularName, value.niceSingularName); + serialize_field(jo, issueKindInfoKeyNicePluralName, value.nicePluralName); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueKindInfoDto IssueKindInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<IssueKindInfoDto>(json); + } + + IssueKindInfoDto::IssueKindInfoDto( + QString prefix, + QString niceSingularName, + QString nicePluralName + ) : + prefix(std::move(prefix)), + niceSingularName(std::move(niceSingularName)), + nicePluralName(std::move(nicePluralName)) + { } + + IssueKindInfoDto::IssueKindInfoDto( + IssueKind prefix, + QString niceSingularName, + QString nicePluralName + ) : IssueKindInfoDto( + IssueKindMeta::enumToStr(prefix), + std::move(niceSingularName), + std::move(nicePluralName)) + { } + + // throws std::range_error + IssueKind IssueKindInfoDto::getPrefixEnum() const + { + return IssueKindMeta::strToEnum(prefix); + } + + void IssueKindInfoDto::setPrefixEnum(IssueKind newValue) + { + prefix = IssueKindMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueKindInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueTagTypeListDto + + static const QLatin1String issueTagTypeListKeyTags{"tags"}; + + template<> + class de_serializer<IssueTagTypeListDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTagTypeListDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<IssueTagTypeListDto>(json); + return { + deserialize_field<std::vector<IssueTagTypeDto>>(jo, issueTagTypeListKeyTags) + }; + } + + static QJsonValue serialize(const IssueTagTypeListDto &value) { + QJsonObject jo; + serialize_field(jo, issueTagTypeListKeyTags, value.tags); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueTagTypeListDto IssueTagTypeListDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<IssueTagTypeListDto>(json); + } + + IssueTagTypeListDto::IssueTagTypeListDto( + std::vector<IssueTagTypeDto> tags + ) : + tags(std::move(tags)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueTagTypeListDto::serialize() const + { + return serialize_bytes(*this); + } + + // LineMarkerDto + + static const QLatin1String lineMarkerKeyKind{"kind"}; + static const QLatin1String lineMarkerKeyId{"id"}; + static const QLatin1String lineMarkerKeyStartLine{"startLine"}; + static const QLatin1String lineMarkerKeyStartColumn{"startColumn"}; + static const QLatin1String lineMarkerKeyEndLine{"endLine"}; + static const QLatin1String lineMarkerKeyEndColumn{"endColumn"}; + static const QLatin1String lineMarkerKeyDescription{"description"}; + static const QLatin1String lineMarkerKeyIssueUrl{"issueUrl"}; + static const QLatin1String lineMarkerKeyIsNew{"isNew"}; + + template<> + class de_serializer<LineMarkerDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static LineMarkerDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<LineMarkerDto>(json); + return { + deserialize_field<QString>(jo, lineMarkerKeyKind), + deserialize_field<std::optional<qint64>>(jo, lineMarkerKeyId), + deserialize_field<qint32>(jo, lineMarkerKeyStartLine), + deserialize_field<qint32>(jo, lineMarkerKeyStartColumn), + deserialize_field<qint32>(jo, lineMarkerKeyEndLine), + deserialize_field<qint32>(jo, lineMarkerKeyEndColumn), + deserialize_field<QString>(jo, lineMarkerKeyDescription), + deserialize_field<std::optional<QString>>(jo, lineMarkerKeyIssueUrl), + deserialize_field<std::optional<bool>>(jo, lineMarkerKeyIsNew) + }; + } + + static QJsonValue serialize(const LineMarkerDto &value) { + QJsonObject jo; + serialize_field(jo, lineMarkerKeyKind, value.kind); + serialize_field(jo, lineMarkerKeyId, value.id); + serialize_field(jo, lineMarkerKeyStartLine, value.startLine); + serialize_field(jo, lineMarkerKeyStartColumn, value.startColumn); + serialize_field(jo, lineMarkerKeyEndLine, value.endLine); + serialize_field(jo, lineMarkerKeyEndColumn, value.endColumn); + serialize_field(jo, lineMarkerKeyDescription, value.description); + serialize_field(jo, lineMarkerKeyIssueUrl, value.issueUrl); + serialize_field(jo, lineMarkerKeyIsNew, value.isNew); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + LineMarkerDto LineMarkerDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<LineMarkerDto>(json); + } + + LineMarkerDto::LineMarkerDto( + QString kind, + std::optional<qint64> id, + qint32 startLine, + qint32 startColumn, + qint32 endLine, + qint32 endColumn, + QString description, + std::optional<QString> issueUrl, + std::optional<bool> isNew + ) : + kind(std::move(kind)), + id(std::move(id)), + startLine(std::move(startLine)), + startColumn(std::move(startColumn)), + endLine(std::move(endLine)), + endColumn(std::move(endColumn)), + description(std::move(description)), + issueUrl(std::move(issueUrl)), + isNew(std::move(isNew)) + { } + + LineMarkerDto::LineMarkerDto( + IssueKind kind, + std::optional<qint64> id, + qint32 startLine, + qint32 startColumn, + qint32 endLine, + qint32 endColumn, + QString description, + std::optional<QString> issueUrl, + std::optional<bool> isNew + ) : LineMarkerDto( + IssueKindMeta::enumToStr(kind), + std::move(id), + std::move(startLine), + std::move(startColumn), + std::move(endLine), + std::move(endColumn), + std::move(description), + std::move(issueUrl), + std::move(isNew)) + { } + + // throws std::range_error + IssueKind LineMarkerDto::getKindEnum() const + { + return IssueKindMeta::strToEnum(kind); + } + + void LineMarkerDto::setKindEnum(IssueKind newValue) + { + kind = IssueKindMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray LineMarkerDto::serialize() const + { + return serialize_bytes(*this); + } + + // RepositoryUpdateMessageDto + + static const QLatin1String repositoryUpdateMessageKeySeverity{"severity"}; + static const QLatin1String repositoryUpdateMessageKeyMessage{"message"}; + + template<> + class de_serializer<RepositoryUpdateMessageDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static RepositoryUpdateMessageDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<RepositoryUpdateMessageDto>(json); + return { + deserialize_field<std::optional<QString>>(jo, repositoryUpdateMessageKeySeverity), + deserialize_field<std::optional<QString>>(jo, repositoryUpdateMessageKeyMessage) + }; + } + + static QJsonValue serialize(const RepositoryUpdateMessageDto &value) { + QJsonObject jo; + serialize_field(jo, repositoryUpdateMessageKeySeverity, value.severity); + serialize_field(jo, repositoryUpdateMessageKeyMessage, value.message); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + RepositoryUpdateMessageDto RepositoryUpdateMessageDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<RepositoryUpdateMessageDto>(json); + } + + RepositoryUpdateMessageDto::RepositoryUpdateMessageDto( + std::optional<QString> severity, + std::optional<QString> message + ) : + severity(std::move(severity)), + message(std::move(message)) + { } + + RepositoryUpdateMessageDto::RepositoryUpdateMessageDto( + std::optional<MessageSeverity> severity, + std::optional<QString> message + ) : RepositoryUpdateMessageDto( + optionalTransform<QString, MessageSeverity>(severity, MessageSeverityMeta::enumToStr), + std::move(message)) + { } + + // throws std::range_error + std::optional<MessageSeverity> RepositoryUpdateMessageDto::getSeverityEnum() const + { + return optionalTransform<MessageSeverity, QString>(severity, MessageSeverityMeta::strToEnum); + } + + void RepositoryUpdateMessageDto::setSeverityEnum(std::optional<MessageSeverity> newValue) + { + severity = optionalTransform<QString, MessageSeverity>(newValue, MessageSeverityMeta::enumToStr); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray RepositoryUpdateMessageDto::serialize() const + { + return serialize_bytes(*this); + } + + // RuleListDto + + static const QLatin1String ruleListKeyRules{"rules"}; + + template<> + class de_serializer<RuleListDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static RuleListDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<RuleListDto>(json); + return { + deserialize_field<std::vector<RuleDto>>(jo, ruleListKeyRules) + }; + } + + static QJsonValue serialize(const RuleListDto &value) { + QJsonObject jo; + serialize_field(jo, ruleListKeyRules, value.rules); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + RuleListDto RuleListDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<RuleListDto>(json); + } + + RuleListDto::RuleListDto( + std::vector<RuleDto> rules + ) : + rules(std::move(rules)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray RuleListDto::serialize() const + { + return serialize_bytes(*this); + } + + // SortInfoDto + + static const QLatin1String sortInfoKeyKey{"key"}; + static const QLatin1String sortInfoKeyDirection{"direction"}; + + template<> + class de_serializer<SortInfoDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static SortInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<SortInfoDto>(json); + return { + deserialize_field<QString>(jo, sortInfoKeyKey), + deserialize_field<QString>(jo, sortInfoKeyDirection) + }; + } + + static QJsonValue serialize(const SortInfoDto &value) { + QJsonObject jo; + serialize_field(jo, sortInfoKeyKey, value.key); + serialize_field(jo, sortInfoKeyDirection, value.direction); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + SortInfoDto SortInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<SortInfoDto>(json); + } + + SortInfoDto::SortInfoDto( + QString key, + QString direction + ) : + key(std::move(key)), + direction(std::move(direction)) + { } + + SortInfoDto::SortInfoDto( + QString key, + SortDirection direction + ) : SortInfoDto( + std::move(key), + SortDirectionMeta::enumToStr(direction)) + { } + + // throws std::range_error + SortDirection SortInfoDto::getDirectionEnum() const + { + return SortDirectionMeta::strToEnum(direction); + } + + void SortInfoDto::setDirectionEnum(SortDirection newValue) + { + direction = SortDirectionMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray SortInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // UserRefDto + + static const QLatin1String userRefKeyName{"name"}; + static const QLatin1String userRefKeyDisplayName{"displayName"}; + static const QLatin1String userRefKeyType{"type"}; + static const QLatin1String userRefKeyIsPublic{"isPublic"}; + + template<> + class de_serializer<UserRefDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static UserRefDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<UserRefDto>(json); + return { + deserialize_field<QString>(jo, userRefKeyName), + deserialize_field<QString>(jo, userRefKeyDisplayName), + deserialize_field<std::optional<QString>>(jo, userRefKeyType), + deserialize_field<std::optional<bool>>(jo, userRefKeyIsPublic) + }; + } + + static QJsonValue serialize(const UserRefDto &value) { + QJsonObject jo; + serialize_field(jo, userRefKeyName, value.name); + serialize_field(jo, userRefKeyDisplayName, value.displayName); + serialize_field(jo, userRefKeyType, value.type); + serialize_field(jo, userRefKeyIsPublic, value.isPublic); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + UserRefDto UserRefDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<UserRefDto>(json); + } + + UserRefDto::UserRefDto( + QString name, + QString displayName, + std::optional<QString> type, + std::optional<bool> isPublic + ) : + name(std::move(name)), + displayName(std::move(displayName)), + type(std::move(type)), + isPublic(std::move(isPublic)) + { } + + UserRefDto::UserRefDto( + QString name, + QString displayName, + std::optional<UserRefType> type, + std::optional<bool> isPublic + ) : UserRefDto( + std::move(name), + std::move(displayName), + optionalTransform<QString, UserRefType>(type, UserRefTypeMeta::enumToStr), + std::move(isPublic)) + { } + + // throws std::range_error + std::optional<UserRefType> UserRefDto::getTypeEnum() const + { + return optionalTransform<UserRefType, QString>(type, UserRefTypeMeta::strToEnum); + } + + void UserRefDto::setTypeEnum(std::optional<UserRefType> newValue) + { + type = optionalTransform<QString, UserRefType>(newValue, UserRefTypeMeta::enumToStr); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray UserRefDto::serialize() const + { + return serialize_bytes(*this); + } + + // AnalyzedFileListDto + + static const QLatin1String analyzedFileListKeyVersion{"version"}; + static const QLatin1String analyzedFileListKeyRows{"rows"}; + + template<> + class de_serializer<AnalyzedFileListDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static AnalyzedFileListDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<AnalyzedFileListDto>(json); + return { + deserialize_field<AnalysisVersionDto>(jo, analyzedFileListKeyVersion), + deserialize_field<std::vector<AnalyzedFileDto>>(jo, analyzedFileListKeyRows) + }; + } + + static QJsonValue serialize(const AnalyzedFileListDto &value) { + QJsonObject jo; + serialize_field(jo, analyzedFileListKeyVersion, value.version); + serialize_field(jo, analyzedFileListKeyRows, value.rows); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + AnalyzedFileListDto AnalyzedFileListDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<AnalyzedFileListDto>(json); + } + + AnalyzedFileListDto::AnalyzedFileListDto( + AnalysisVersionDto version, + std::vector<AnalyzedFileDto> rows + ) : + version(std::move(version)), + rows(std::move(rows)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray AnalyzedFileListDto::serialize() const + { + return serialize_bytes(*this); + } + + // EntityListDto + + static const QLatin1String entityListKeyVersion{"version"}; + static const QLatin1String entityListKeyEntities{"entities"}; + + template<> + class de_serializer<EntityListDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static EntityListDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<EntityListDto>(json); + return { + deserialize_field<std::optional<AnalysisVersionDto>>(jo, entityListKeyVersion), + deserialize_field<std::vector<EntityDto>>(jo, entityListKeyEntities) + }; + } + + static QJsonValue serialize(const EntityListDto &value) { + QJsonObject jo; + serialize_field(jo, entityListKeyVersion, value.version); + serialize_field(jo, entityListKeyEntities, value.entities); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + EntityListDto EntityListDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<EntityListDto>(json); + } + + EntityListDto::EntityListDto( + std::optional<AnalysisVersionDto> version, + std::vector<EntityDto> entities + ) : + version(std::move(version)), + entities(std::move(entities)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray EntityListDto::serialize() const + { + return serialize_bytes(*this); + } + + // FileViewDto + + static const QLatin1String fileViewKeyFileName{"fileName"}; + static const QLatin1String fileViewKeyVersion{"version"}; + static const QLatin1String fileViewKeySourceCodeUrl{"sourceCodeUrl"}; + static const QLatin1String fileViewKeyLineMarkers{"lineMarkers"}; + + template<> + class de_serializer<FileViewDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static FileViewDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<FileViewDto>(json); + return { + deserialize_field<QString>(jo, fileViewKeyFileName), + deserialize_field<std::optional<QString>>(jo, fileViewKeyVersion), + deserialize_field<std::optional<QString>>(jo, fileViewKeySourceCodeUrl), + deserialize_field<std::vector<LineMarkerDto>>(jo, fileViewKeyLineMarkers) + }; + } + + static QJsonValue serialize(const FileViewDto &value) { + QJsonObject jo; + serialize_field(jo, fileViewKeyFileName, value.fileName); + serialize_field(jo, fileViewKeyVersion, value.version); + serialize_field(jo, fileViewKeySourceCodeUrl, value.sourceCodeUrl); + serialize_field(jo, fileViewKeyLineMarkers, value.lineMarkers); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + FileViewDto FileViewDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<FileViewDto>(json); + } + + FileViewDto::FileViewDto( + QString fileName, + std::optional<QString> version, + std::optional<QString> sourceCodeUrl, + std::vector<LineMarkerDto> lineMarkers + ) : + fileName(std::move(fileName)), + version(std::move(version)), + sourceCodeUrl(std::move(sourceCodeUrl)), + lineMarkers(std::move(lineMarkers)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray FileViewDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueDto + + static const QLatin1String issueKeyKind{"kind"}; + static const QLatin1String issueKeyId{"id"}; + static const QLatin1String issueKeyParentProject{"parentProject"}; + static const QLatin1String issueKeySourceLocations{"sourceLocations"}; + static const QLatin1String issueKeyIssueKind{"issueKind"}; + static const QLatin1String issueKeyIsHidden{"isHidden"}; + static const QLatin1String issueKeyIssueViewUrl{"issueViewUrl"}; + + template<> + class de_serializer<IssueDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<IssueDto>(json); + return { + deserialize_field<QString>(jo, issueKeyKind), + deserialize_field<qint64>(jo, issueKeyId), + deserialize_field<ProjectReferenceDto>(jo, issueKeyParentProject), + deserialize_field<std::vector<IssueSourceLocationDto>>(jo, issueKeySourceLocations), + deserialize_field<IssueKindInfoDto>(jo, issueKeyIssueKind), + deserialize_field<bool>(jo, issueKeyIsHidden), + deserialize_field<std::optional<QString>>(jo, issueKeyIssueViewUrl) + }; + } + + static QJsonValue serialize(const IssueDto &value) { + QJsonObject jo; + serialize_field(jo, issueKeyKind, value.kind); + serialize_field(jo, issueKeyId, value.id); + serialize_field(jo, issueKeyParentProject, value.parentProject); + serialize_field(jo, issueKeySourceLocations, value.sourceLocations); + serialize_field(jo, issueKeyIssueKind, value.issueKind); + serialize_field(jo, issueKeyIsHidden, value.isHidden); + serialize_field(jo, issueKeyIssueViewUrl, value.issueViewUrl); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueDto IssueDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<IssueDto>(json); + } + + IssueDto::IssueDto( + QString kind, + qint64 id, + ProjectReferenceDto parentProject, + std::vector<IssueSourceLocationDto> sourceLocations, + IssueKindInfoDto issueKind, + bool isHidden, + std::optional<QString> issueViewUrl + ) : + kind(std::move(kind)), + id(std::move(id)), + parentProject(std::move(parentProject)), + sourceLocations(std::move(sourceLocations)), + issueKind(std::move(issueKind)), + isHidden(std::move(isHidden)), + issueViewUrl(std::move(issueViewUrl)) + { } + + IssueDto::IssueDto( + IssueKind kind, + qint64 id, + ProjectReferenceDto parentProject, + std::vector<IssueSourceLocationDto> sourceLocations, + IssueKindInfoDto issueKind, + bool isHidden, + std::optional<QString> issueViewUrl + ) : IssueDto( + IssueKindMeta::enumToStr(kind), + std::move(id), + std::move(parentProject), + std::move(sourceLocations), + std::move(issueKind), + std::move(isHidden), + std::move(issueViewUrl)) + { } + + // throws std::range_error + IssueKind IssueDto::getKindEnum() const + { + return IssueKindMeta::strToEnum(kind); + } + + void IssueDto::setKindEnum(IssueKind newValue) + { + kind = IssueKindMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueTableDto + + static const QLatin1String issueTableKeyStartVersion{"startVersion"}; + static const QLatin1String issueTableKeyEndVersion{"endVersion"}; + static const QLatin1String issueTableKeyTableViewUrl{"tableViewUrl"}; + static const QLatin1String issueTableKeyColumns{"columns"}; + static const QLatin1String issueTableKeyRows{"rows"}; + static const QLatin1String issueTableKeyTotalRowCount{"totalRowCount"}; + static const QLatin1String issueTableKeyTotalAddedCount{"totalAddedCount"}; + static const QLatin1String issueTableKeyTotalRemovedCount{"totalRemovedCount"}; + + template<> + class de_serializer<IssueTableDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTableDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<IssueTableDto>(json); + return { + deserialize_field<std::optional<AnalysisVersionDto>>(jo, issueTableKeyStartVersion), + deserialize_field<AnalysisVersionDto>(jo, issueTableKeyEndVersion), + deserialize_field<std::optional<QString>>(jo, issueTableKeyTableViewUrl), + deserialize_field<std::optional<std::vector<ColumnInfoDto>>>(jo, issueTableKeyColumns), + deserialize_field<std::vector<std::map<QString, Any>>>(jo, issueTableKeyRows), + deserialize_field<std::optional<qint32>>(jo, issueTableKeyTotalRowCount), + deserialize_field<std::optional<qint32>>(jo, issueTableKeyTotalAddedCount), + deserialize_field<std::optional<qint32>>(jo, issueTableKeyTotalRemovedCount) + }; + } + + static QJsonValue serialize(const IssueTableDto &value) { + QJsonObject jo; + serialize_field(jo, issueTableKeyStartVersion, value.startVersion); + serialize_field(jo, issueTableKeyEndVersion, value.endVersion); + serialize_field(jo, issueTableKeyTableViewUrl, value.tableViewUrl); + serialize_field(jo, issueTableKeyColumns, value.columns); + serialize_field(jo, issueTableKeyRows, value.rows); + serialize_field(jo, issueTableKeyTotalRowCount, value.totalRowCount); + serialize_field(jo, issueTableKeyTotalAddedCount, value.totalAddedCount); + serialize_field(jo, issueTableKeyTotalRemovedCount, value.totalRemovedCount); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueTableDto IssueTableDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<IssueTableDto>(json); + } + + IssueTableDto::IssueTableDto( + std::optional<AnalysisVersionDto> startVersion, + AnalysisVersionDto endVersion, + std::optional<QString> tableViewUrl, + std::optional<std::vector<ColumnInfoDto>> columns, + std::vector<std::map<QString, Any>> rows, + std::optional<qint32> totalRowCount, + std::optional<qint32> totalAddedCount, + std::optional<qint32> totalRemovedCount + ) : + startVersion(std::move(startVersion)), + endVersion(std::move(endVersion)), + tableViewUrl(std::move(tableViewUrl)), + columns(std::move(columns)), + rows(std::move(rows)), + totalRowCount(std::move(totalRowCount)), + totalAddedCount(std::move(totalAddedCount)), + totalRemovedCount(std::move(totalRemovedCount)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueTableDto::serialize() const + { + return serialize_bytes(*this); + } + + // MetricListDto + + static const QLatin1String metricListKeyVersion{"version"}; + static const QLatin1String metricListKeyMetrics{"metrics"}; + + template<> + class de_serializer<MetricListDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static MetricListDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<MetricListDto>(json); + return { + deserialize_field<std::optional<AnalysisVersionDto>>(jo, metricListKeyVersion), + deserialize_field<std::vector<MetricDto>>(jo, metricListKeyMetrics) + }; + } + + static QJsonValue serialize(const MetricListDto &value) { + QJsonObject jo; + serialize_field(jo, metricListKeyVersion, value.version); + serialize_field(jo, metricListKeyMetrics, value.metrics); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + MetricListDto MetricListDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<MetricListDto>(json); + } + + MetricListDto::MetricListDto( + std::optional<AnalysisVersionDto> version, + std::vector<MetricDto> metrics + ) : + version(std::move(version)), + metrics(std::move(metrics)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray MetricListDto::serialize() const + { + return serialize_bytes(*this); + } + + // MetricValueRangeDto + + static const QLatin1String metricValueRangeKeyStartVersion{"startVersion"}; + static const QLatin1String metricValueRangeKeyEndVersion{"endVersion"}; + static const QLatin1String metricValueRangeKeyEntity{"entity"}; + static const QLatin1String metricValueRangeKeyMetric{"metric"}; + static const QLatin1String metricValueRangeKeyValues{"values"}; + + template<> + class de_serializer<MetricValueRangeDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static MetricValueRangeDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<MetricValueRangeDto>(json); + return { + deserialize_field<AnalysisVersionDto>(jo, metricValueRangeKeyStartVersion), + deserialize_field<AnalysisVersionDto>(jo, metricValueRangeKeyEndVersion), + deserialize_field<QString>(jo, metricValueRangeKeyEntity), + deserialize_field<QString>(jo, metricValueRangeKeyMetric), + deserialize_field<std::vector<std::optional<double>>>(jo, metricValueRangeKeyValues) + }; + } + + static QJsonValue serialize(const MetricValueRangeDto &value) { + QJsonObject jo; + serialize_field(jo, metricValueRangeKeyStartVersion, value.startVersion); + serialize_field(jo, metricValueRangeKeyEndVersion, value.endVersion); + serialize_field(jo, metricValueRangeKeyEntity, value.entity); + serialize_field(jo, metricValueRangeKeyMetric, value.metric); + serialize_field(jo, metricValueRangeKeyValues, value.values); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + MetricValueRangeDto MetricValueRangeDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<MetricValueRangeDto>(json); + } + + MetricValueRangeDto::MetricValueRangeDto( + AnalysisVersionDto startVersion, + AnalysisVersionDto endVersion, + QString entity, + QString metric, + std::vector<std::optional<double>> values + ) : + startVersion(std::move(startVersion)), + endVersion(std::move(endVersion)), + entity(std::move(entity)), + metric(std::move(metric)), + values(std::move(values)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray MetricValueRangeDto::serialize() const + { + return serialize_bytes(*this); + } + + // MetricValueTableDto + + static const QLatin1String metricValueTableKeyColumns{"columns"}; + static const QLatin1String metricValueTableKeyRows{"rows"}; + + template<> + class de_serializer<MetricValueTableDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static MetricValueTableDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<MetricValueTableDto>(json); + return { + deserialize_field<std::vector<ColumnInfoDto>>(jo, metricValueTableKeyColumns), + deserialize_field<std::vector<MetricValueTableRowDto>>(jo, metricValueTableKeyRows) + }; + } + + static QJsonValue serialize(const MetricValueTableDto &value) { + QJsonObject jo; + serialize_field(jo, metricValueTableKeyColumns, value.columns); + serialize_field(jo, metricValueTableKeyRows, value.rows); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + MetricValueTableDto MetricValueTableDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<MetricValueTableDto>(json); + } + + MetricValueTableDto::MetricValueTableDto( + std::vector<ColumnInfoDto> columns, + std::vector<MetricValueTableRowDto> rows + ) : + columns(std::move(columns)), + rows(std::move(rows)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray MetricValueTableDto::serialize() const + { + return serialize_bytes(*this); + } + + // NamedFilterCreateDto + + static const QLatin1String namedFilterCreateKeyDisplayName{"displayName"}; + static const QLatin1String namedFilterCreateKeyKind{"kind"}; + static const QLatin1String namedFilterCreateKeyFilters{"filters"}; + static const QLatin1String namedFilterCreateKeySorters{"sorters"}; + static const QLatin1String namedFilterCreateKeyVisibility{"visibility"}; + + template<> + class de_serializer<NamedFilterCreateDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterCreateDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<NamedFilterCreateDto>(json); + return { + deserialize_field<QString>(jo, namedFilterCreateKeyDisplayName), + deserialize_field<QString>(jo, namedFilterCreateKeyKind), + deserialize_field<std::map<QString, QString>>(jo, namedFilterCreateKeyFilters), + deserialize_field<std::vector<SortInfoDto>>(jo, namedFilterCreateKeySorters), + deserialize_field<std::optional<NamedFilterVisibilityDto>>(jo, namedFilterCreateKeyVisibility) + }; + } + + static QJsonValue serialize(const NamedFilterCreateDto &value) { + QJsonObject jo; + serialize_field(jo, namedFilterCreateKeyDisplayName, value.displayName); + serialize_field(jo, namedFilterCreateKeyKind, value.kind); + serialize_field(jo, namedFilterCreateKeyFilters, value.filters); + serialize_field(jo, namedFilterCreateKeySorters, value.sorters); + serialize_field(jo, namedFilterCreateKeyVisibility, value.visibility); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + NamedFilterCreateDto NamedFilterCreateDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<NamedFilterCreateDto>(json); + } + + NamedFilterCreateDto::NamedFilterCreateDto( + QString displayName, + QString kind, + std::map<QString, QString> filters, + std::vector<SortInfoDto> sorters, + std::optional<NamedFilterVisibilityDto> visibility + ) : + displayName(std::move(displayName)), + kind(std::move(kind)), + filters(std::move(filters)), + sorters(std::move(sorters)), + visibility(std::move(visibility)) + { } + + NamedFilterCreateDto::NamedFilterCreateDto( + QString displayName, + IssueKindForNamedFilterCreation kind, + std::map<QString, QString> filters, + std::vector<SortInfoDto> sorters, + std::optional<NamedFilterVisibilityDto> visibility + ) : NamedFilterCreateDto( + std::move(displayName), + IssueKindForNamedFilterCreationMeta::enumToStr(kind), + std::move(filters), + std::move(sorters), + std::move(visibility)) + { } + + // throws std::range_error + IssueKindForNamedFilterCreation NamedFilterCreateDto::getKindEnum() const + { + return IssueKindForNamedFilterCreationMeta::strToEnum(kind); + } + + void NamedFilterCreateDto::setKindEnum(IssueKindForNamedFilterCreation newValue) + { + kind = IssueKindForNamedFilterCreationMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray NamedFilterCreateDto::serialize() const + { + return serialize_bytes(*this); + } + + // NamedFilterInfoDto + + static const QLatin1String namedFilterInfoKeyKey{"key"}; + static const QLatin1String namedFilterInfoKeyDisplayName{"displayName"}; + static const QLatin1String namedFilterInfoKeyUrl{"url"}; + static const QLatin1String namedFilterInfoKeyIsPredefined{"isPredefined"}; + static const QLatin1String namedFilterInfoKeyType{"type"}; + static const QLatin1String namedFilterInfoKeyCanWrite{"canWrite"}; + static const QLatin1String namedFilterInfoKeyFilters{"filters"}; + static const QLatin1String namedFilterInfoKeySorters{"sorters"}; + static const QLatin1String namedFilterInfoKeySupportsAllIssueKinds{"supportsAllIssueKinds"}; + static const QLatin1String namedFilterInfoKeyIssueKindRestrictions{"issueKindRestrictions"}; + static const QLatin1String namedFilterInfoKeyVisibility{"visibility"}; + + template<> + class de_serializer<NamedFilterInfoDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<NamedFilterInfoDto>(json); + return { + deserialize_field<QString>(jo, namedFilterInfoKeyKey), + deserialize_field<QString>(jo, namedFilterInfoKeyDisplayName), + deserialize_field<std::optional<QString>>(jo, namedFilterInfoKeyUrl), + deserialize_field<bool>(jo, namedFilterInfoKeyIsPredefined), + deserialize_field<std::optional<QString>>(jo, namedFilterInfoKeyType), + deserialize_field<bool>(jo, namedFilterInfoKeyCanWrite), + deserialize_field<std::map<QString, QString>>(jo, namedFilterInfoKeyFilters), + deserialize_field<std::optional<std::vector<SortInfoDto>>>(jo, namedFilterInfoKeySorters), + deserialize_field<bool>(jo, namedFilterInfoKeySupportsAllIssueKinds), + deserialize_field<std::optional<std::unordered_set<QString>>>(jo, namedFilterInfoKeyIssueKindRestrictions), + deserialize_field<std::optional<NamedFilterVisibilityDto>>(jo, namedFilterInfoKeyVisibility) + }; + } + + static QJsonValue serialize(const NamedFilterInfoDto &value) { + QJsonObject jo; + serialize_field(jo, namedFilterInfoKeyKey, value.key); + serialize_field(jo, namedFilterInfoKeyDisplayName, value.displayName); + serialize_field(jo, namedFilterInfoKeyUrl, value.url); + serialize_field(jo, namedFilterInfoKeyIsPredefined, value.isPredefined); + serialize_field(jo, namedFilterInfoKeyType, value.type); + serialize_field(jo, namedFilterInfoKeyCanWrite, value.canWrite); + serialize_field(jo, namedFilterInfoKeyFilters, value.filters); + serialize_field(jo, namedFilterInfoKeySorters, value.sorters); + serialize_field(jo, namedFilterInfoKeySupportsAllIssueKinds, value.supportsAllIssueKinds); + serialize_field(jo, namedFilterInfoKeyIssueKindRestrictions, value.issueKindRestrictions); + serialize_field(jo, namedFilterInfoKeyVisibility, value.visibility); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + NamedFilterInfoDto NamedFilterInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<NamedFilterInfoDto>(json); + } + + NamedFilterInfoDto::NamedFilterInfoDto( + QString key, + QString displayName, + std::optional<QString> url, + bool isPredefined, + std::optional<QString> type, + bool canWrite, + std::map<QString, QString> filters, + std::optional<std::vector<SortInfoDto>> sorters, + bool supportsAllIssueKinds, + std::optional<std::unordered_set<QString>> issueKindRestrictions, + std::optional<NamedFilterVisibilityDto> visibility + ) : + key(std::move(key)), + displayName(std::move(displayName)), + url(std::move(url)), + isPredefined(std::move(isPredefined)), + type(std::move(type)), + canWrite(std::move(canWrite)), + filters(std::move(filters)), + sorters(std::move(sorters)), + supportsAllIssueKinds(std::move(supportsAllIssueKinds)), + issueKindRestrictions(std::move(issueKindRestrictions)), + visibility(std::move(visibility)) + { } + + NamedFilterInfoDto::NamedFilterInfoDto( + QString key, + QString displayName, + std::optional<QString> url, + bool isPredefined, + std::optional<NamedFilterType> type, + bool canWrite, + std::map<QString, QString> filters, + std::optional<std::vector<SortInfoDto>> sorters, + bool supportsAllIssueKinds, + std::optional<std::unordered_set<QString>> issueKindRestrictions, + std::optional<NamedFilterVisibilityDto> visibility + ) : NamedFilterInfoDto( + std::move(key), + std::move(displayName), + std::move(url), + std::move(isPredefined), + optionalTransform<QString, NamedFilterType>(type, NamedFilterTypeMeta::enumToStr), + std::move(canWrite), + std::move(filters), + std::move(sorters), + std::move(supportsAllIssueKinds), + std::move(issueKindRestrictions), + std::move(visibility)) + { } + + // throws std::range_error + std::optional<NamedFilterType> NamedFilterInfoDto::getTypeEnum() const + { + return optionalTransform<NamedFilterType, QString>(type, NamedFilterTypeMeta::strToEnum); + } + + void NamedFilterInfoDto::setTypeEnum(std::optional<NamedFilterType> newValue) + { + type = optionalTransform<QString, NamedFilterType>(newValue, NamedFilterTypeMeta::enumToStr); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray NamedFilterInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // NamedFilterUpdateDto + + static const QLatin1String namedFilterUpdateKeyName{"name"}; + static const QLatin1String namedFilterUpdateKeyFilters{"filters"}; + static const QLatin1String namedFilterUpdateKeySorters{"sorters"}; + static const QLatin1String namedFilterUpdateKeyVisibility{"visibility"}; + + template<> + class de_serializer<NamedFilterUpdateDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterUpdateDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<NamedFilterUpdateDto>(json); + return { + deserialize_field<std::optional<QString>>(jo, namedFilterUpdateKeyName), + deserialize_field<std::optional<std::map<QString, QString>>>(jo, namedFilterUpdateKeyFilters), + deserialize_field<std::optional<std::vector<SortInfoDto>>>(jo, namedFilterUpdateKeySorters), + deserialize_field<std::optional<NamedFilterVisibilityDto>>(jo, namedFilterUpdateKeyVisibility) + }; + } + + static QJsonValue serialize(const NamedFilterUpdateDto &value) { + QJsonObject jo; + serialize_field(jo, namedFilterUpdateKeyName, value.name); + serialize_field(jo, namedFilterUpdateKeyFilters, value.filters); + serialize_field(jo, namedFilterUpdateKeySorters, value.sorters); + serialize_field(jo, namedFilterUpdateKeyVisibility, value.visibility); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + NamedFilterUpdateDto NamedFilterUpdateDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<NamedFilterUpdateDto>(json); + } + + NamedFilterUpdateDto::NamedFilterUpdateDto( + std::optional<QString> name, + std::optional<std::map<QString, QString>> filters, + std::optional<std::vector<SortInfoDto>> sorters, + std::optional<NamedFilterVisibilityDto> visibility + ) : + name(std::move(name)), + filters(std::move(filters)), + sorters(std::move(sorters)), + visibility(std::move(visibility)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray NamedFilterUpdateDto::serialize() const + { + return serialize_bytes(*this); + } + + // ProjectInfoDto + + static const QLatin1String projectInfoKeyName{"name"}; + static const QLatin1String projectInfoKeyIssueFilterHelp{"issueFilterHelp"}; + static const QLatin1String projectInfoKeyTableMetaUri{"tableMetaUri"}; + static const QLatin1String projectInfoKeyUsers{"users"}; + static const QLatin1String projectInfoKeyVersions{"versions"}; + static const QLatin1String projectInfoKeyIssueKinds{"issueKinds"}; + static const QLatin1String projectInfoKeyHasHiddenIssues{"hasHiddenIssues"}; + + template<> + class de_serializer<ProjectInfoDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ProjectInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<ProjectInfoDto>(json); + return { + deserialize_field<QString>(jo, projectInfoKeyName), + deserialize_field<std::optional<QString>>(jo, projectInfoKeyIssueFilterHelp), + deserialize_field<std::optional<QString>>(jo, projectInfoKeyTableMetaUri), + deserialize_field<std::vector<UserRefDto>>(jo, projectInfoKeyUsers), + deserialize_field<std::vector<AnalysisVersionDto>>(jo, projectInfoKeyVersions), + deserialize_field<std::vector<IssueKindInfoDto>>(jo, projectInfoKeyIssueKinds), + deserialize_field<bool>(jo, projectInfoKeyHasHiddenIssues) + }; + } + + static QJsonValue serialize(const ProjectInfoDto &value) { + QJsonObject jo; + serialize_field(jo, projectInfoKeyName, value.name); + serialize_field(jo, projectInfoKeyIssueFilterHelp, value.issueFilterHelp); + serialize_field(jo, projectInfoKeyTableMetaUri, value.tableMetaUri); + serialize_field(jo, projectInfoKeyUsers, value.users); + serialize_field(jo, projectInfoKeyVersions, value.versions); + serialize_field(jo, projectInfoKeyIssueKinds, value.issueKinds); + serialize_field(jo, projectInfoKeyHasHiddenIssues, value.hasHiddenIssues); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ProjectInfoDto ProjectInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<ProjectInfoDto>(json); + } + + ProjectInfoDto::ProjectInfoDto( + QString name, + std::optional<QString> issueFilterHelp, + std::optional<QString> tableMetaUri, + std::vector<UserRefDto> users, + std::vector<AnalysisVersionDto> versions, + std::vector<IssueKindInfoDto> issueKinds, + bool hasHiddenIssues + ) : + name(std::move(name)), + issueFilterHelp(std::move(issueFilterHelp)), + tableMetaUri(std::move(tableMetaUri)), + users(std::move(users)), + versions(std::move(versions)), + issueKinds(std::move(issueKinds)), + hasHiddenIssues(std::move(hasHiddenIssues)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ProjectInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // RepositoryUpdateResponseDto + + static const QLatin1String repositoryUpdateResponseKeyMessages{"messages"}; + static const QLatin1String repositoryUpdateResponseKeyHasErrors{"hasErrors"}; + static const QLatin1String repositoryUpdateResponseKeyHasWarnings{"hasWarnings"}; + + template<> + class de_serializer<RepositoryUpdateResponseDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static RepositoryUpdateResponseDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<RepositoryUpdateResponseDto>(json); + return { + deserialize_field<std::vector<RepositoryUpdateMessageDto>>(jo, repositoryUpdateResponseKeyMessages), + deserialize_field<bool>(jo, repositoryUpdateResponseKeyHasErrors), + deserialize_field<bool>(jo, repositoryUpdateResponseKeyHasWarnings) + }; + } + + static QJsonValue serialize(const RepositoryUpdateResponseDto &value) { + QJsonObject jo; + serialize_field(jo, repositoryUpdateResponseKeyMessages, value.messages); + serialize_field(jo, repositoryUpdateResponseKeyHasErrors, value.hasErrors); + serialize_field(jo, repositoryUpdateResponseKeyHasWarnings, value.hasWarnings); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + RepositoryUpdateResponseDto RepositoryUpdateResponseDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<RepositoryUpdateResponseDto>(json); + } + + RepositoryUpdateResponseDto::RepositoryUpdateResponseDto( + std::vector<RepositoryUpdateMessageDto> messages, + bool hasErrors, + bool hasWarnings + ) : + messages(std::move(messages)), + hasErrors(std::move(hasErrors)), + hasWarnings(std::move(hasWarnings)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray RepositoryUpdateResponseDto::serialize() const + { + return serialize_bytes(*this); + } + + // TableInfoDto + + static const QLatin1String tableInfoKeyTableDataUri{"tableDataUri"}; + static const QLatin1String tableInfoKeyIssueBaseViewUri{"issueBaseViewUri"}; + static const QLatin1String tableInfoKeyColumns{"columns"}; + static const QLatin1String tableInfoKeyFilters{"filters"}; + static const QLatin1String tableInfoKeyUserDefaultFilter{"userDefaultFilter"}; + static const QLatin1String tableInfoKeyAxivionDefaultFilter{"axivionDefaultFilter"}; + + template<> + class de_serializer<TableInfoDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static TableInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<TableInfoDto>(json); + return { + deserialize_field<QString>(jo, tableInfoKeyTableDataUri), + deserialize_field<std::optional<QString>>(jo, tableInfoKeyIssueBaseViewUri), + deserialize_field<std::vector<ColumnInfoDto>>(jo, tableInfoKeyColumns), + deserialize_field<std::vector<NamedFilterInfoDto>>(jo, tableInfoKeyFilters), + deserialize_field<std::optional<QString>>(jo, tableInfoKeyUserDefaultFilter), + deserialize_field<QString>(jo, tableInfoKeyAxivionDefaultFilter) + }; + } + + static QJsonValue serialize(const TableInfoDto &value) { + QJsonObject jo; + serialize_field(jo, tableInfoKeyTableDataUri, value.tableDataUri); + serialize_field(jo, tableInfoKeyIssueBaseViewUri, value.issueBaseViewUri); + serialize_field(jo, tableInfoKeyColumns, value.columns); + serialize_field(jo, tableInfoKeyFilters, value.filters); + serialize_field(jo, tableInfoKeyUserDefaultFilter, value.userDefaultFilter); + serialize_field(jo, tableInfoKeyAxivionDefaultFilter, value.axivionDefaultFilter); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + TableInfoDto TableInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<TableInfoDto>(json); + } + + TableInfoDto::TableInfoDto( + QString tableDataUri, + std::optional<QString> issueBaseViewUri, + std::vector<ColumnInfoDto> columns, + std::vector<NamedFilterInfoDto> filters, + std::optional<QString> userDefaultFilter, + QString axivionDefaultFilter + ) : + tableDataUri(std::move(tableDataUri)), + issueBaseViewUri(std::move(issueBaseViewUri)), + columns(std::move(columns)), + filters(std::move(filters)), + userDefaultFilter(std::move(userDefaultFilter)), + axivionDefaultFilter(std::move(axivionDefaultFilter)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray TableInfoDto::serialize() const + { + return serialize_bytes(*this); + } +} diff --git a/src/plugins/axivion/dashboard/dto.h b/src/plugins/axivion/dashboard/dto.h new file mode 100644 index 00000000000..fe36257afb2 --- /dev/null +++ b/src/plugins/axivion/dashboard/dto.h @@ -0,0 +1,2994 @@ +#pragma once + +/* + * Copyright (C) 2022-current by Axivion GmbH + * https://www.axivion.com/ + * + * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + * + * Purpose: Dashboard C++ API Header + * + * !!!!!! GENERATED, DO NOT EDIT !!!!!! + * + * This file was generated with the script at + * <AxivionSuiteRepo>/projects/libs/dashboard_cpp_api/generator/generate_dashboard_cpp_api.py + */ + +#include <QAnyStringView> +#include <QByteArray> +#include <QHashFunctions> +#include <QLatin1String> +#include <QString> +#include <QStringView> +#include <QtGlobal> + +#include <array> +#include <cstddef> +#include <exception> +#include <functional> +#include <optional> +#include <stdexcept> +#include <string_view> +#include <map> +#include <unordered_set> +#include <variant> +#include <vector> + +namespace Axivion::Internal::Dto +{ + class invalid_dto_exception : public std::runtime_error + { + public: + invalid_dto_exception(const std::string_view type_name, const std::exception &ex); + + invalid_dto_exception(const std::string_view type_name, const std::string_view message); + }; + + template<typename O, typename I> + std::optional<O> optionalTransform(const std::optional<I> &input, const std::function<O(const I&)> &transformer) + { + if (input.has_value()) + { + return transformer(*input); + } + return std::nullopt; + } + + class Serializable + { + public: + virtual QByteArray serialize() const = 0; + + virtual ~Serializable() = default; + }; + + class Any : public Serializable { + private: + std::variant< + std::nullptr_t, // .index() == 0 + QString, // .index() == 1 + double, // .index() == 2 + std::map<QString, Any>, // .index() == 3 + std::vector<Any>, // .index() == 4 + bool // .index() == 5 + > data; + + public: + // Throws Axivion::Internal::Dto::invalid_dto_exception + static Any deserialize(const QByteArray &json); + + Any(); + + Any(QString value); + + Any(double value); + + Any(std::map<QString, Any> value); + + Any(std::vector<Any> value); + + Any(bool value); + + bool isNull() const; + + bool isString() const; + + // Throws std::bad_variant_access + QString &getString(); + + // Throws std::bad_variant_access + const QString &getString() const; + + bool isDouble() const; + + // Throws std::bad_variant_access + double &getDouble(); + + // Throws std::bad_variant_access + const double &getDouble() const; + + bool isMap() const; + + // Throws std::bad_variant_access + std::map<QString, Any> &getMap(); + + // Throws std::bad_variant_access + const std::map<QString, Any> &getMap() const; + + bool isList() const; + + // Throws std::bad_variant_access + std::vector<Any> &getList(); + + // Throws std::bad_variant_access + const std::vector<Any> &getList() const; + + bool isBool() const; + + // Throws std::bad_variant_access + bool &getBool(); + + // Throws std::bad_variant_access + const bool &getBool() const; + + virtual QByteArray serialize() const override; + }; + + class ApiVersion { + public: + static const std::array<qint32, 4> number; + static const QLatin1String string; + static const QLatin1String name; + static const QLatin1String timestamp; + }; + + /** + * Describes an analyzed file in a version. + */ + class AnalyzedFileDto : public Serializable + { + public: + + /** + * <p>The absolute path of the file. + */ + QString path; + + /** + * <p>Indicates whether this file is a system header file. + */ + std::optional<bool> isSystemHeader; + + /** + * <p>The name of the language used to analyze this file. + */ + std::optional<QString> languageName; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static AnalyzedFileDto deserialize(const QByteArray &json); + + AnalyzedFileDto( + QString path, + std::optional<bool> isSystemHeader, + std::optional<QString> languageName + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Available types of ApiToken + * + * <p>* `General` - Powerful token kind granting the same permissions as + * a regular password based login. + * * `IdePlugin` - Limits user permissions to those typically needed by IDE + * plugins. + * * `SourceFetch` - Used internally for local build. Cannot be created via this API. + * * `LogIn` - Used internally by browsers for the "Keep me logged in" functionality. Cannot be created via this API. + * * `ContinuousIntegration` - Limits user permissions to those typically needed for CI purposes. + * + * <p>For the types `IdePlugin` and `LogIn` the Dashboard will automatically + * delete the tokens when the owner changes his password. The Dashboard + * will try to detect this for external password changes as well + * but cannot guarantee this will always work. + * + * @since 7.1.0 + */ + enum class ApiTokenType + { + sourcefetch, + general, + ideplugin, + login, + continuousintegration + }; + + class ApiTokenTypeMeta final + { + public: + static const QLatin1String sourcefetch; + static const QLatin1String general; + static const QLatin1String ideplugin; + static const QLatin1String login; + static const QLatin1String continuousintegration; + + // Throws std::range_error + static ApiTokenType strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(ApiTokenType e); + + ApiTokenTypeMeta() = delete; + ~ApiTokenTypeMeta() = delete; + }; + + /** + * Request data for changing a user password + */ + class ChangePasswordFormDto : public Serializable + { + public: + + /** + * <p>The current password + */ + QString currentPassword; + + /** + * <p>The new password + */ + QString newPassword; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ChangePasswordFormDto deserialize(const QByteArray &json); + + ChangePasswordFormDto( + QString currentPassword, + QString newPassword + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Additional TypeInfo of a ColumnType + */ + class ColumnTypeOptionDto : public Serializable + { + public: + + /** + * <p>The name of the option that shall be used for displaying and filtering as well. + */ + QString key; + + /** + * <p>Name for displaying the option in UIs. + * + * <p>Deprecated since 6.9.0. Use `key` instead. # Older aclipse versions rely on the field being non-null + * + * @deprecated + */ + std::optional<QString> displayName; + + /** + * <p>A color hex code recommended for displaying the value in GUIs. + * + * <p>Example colors are: "#FF0000" - red "#008000" - green + */ + QString displayColor; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ColumnTypeOptionDto deserialize(const QByteArray &json); + + ColumnTypeOptionDto( + QString key, + std::optional<QString> displayName, + QString displayColor + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Describes a Comment Request + */ + class CommentRequestDto : public Serializable + { + public: + + /** + * <p>The comment text + */ + QString text; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static CommentRequestDto deserialize(const QByteArray &json); + + CommentRequestDto( + QString text + ); + + virtual QByteArray serialize() const override; + }; + + /** + * A Project Entity such as a Class, a Method, a File or a Module + * or the System Entity. + */ + class EntityDto : public Serializable + { + public: + + /** + * <p>The project-wide ID used to refer to this entity. + */ + QString id; + + /** + * <p>a non-unique name of the entity + */ + QString name; + + /** + * <p>The type of the entity + */ + QString type; + + /** + * <p>The file path of an entity if it can be associated with a file + */ + std::optional<QString> path; + + /** + * <p>The line number of an entity if it can be associated with a file location + */ + std::optional<qint32> line; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static EntityDto deserialize(const QByteArray &json); + + EntityDto( + QString id, + QString name, + QString type, + std::optional<QString> path, + std::optional<qint32> line + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Describes an error returned from the server + * + * <p>Usually they are caused by wrong API usage but they may also happen + * in case of bugs in the server + */ + class ErrorDto : public Serializable + { + public: + + /** + * <p>a parseable version number indicating the server version + * + * @since 6.6.0 + */ + std::optional<QString> dashboardVersionNumber; + + /** + * <p>the name of the error kind + */ + QString type; + + /** + * <p>A human readable short english message describing the error. + * Ideally it does not contain any linebreaks. + */ + QString message; + + /** + * <p>use this instead of message in order to display a message translated + * according to your language preferences. Will contain exactly the same + * contents as `message` in case no translation is available. + */ + QString localizedMessage; + + /** + * <p>Optional error details. + * Consumers should expect this to be a multiline string and display it + * in a mono-space font without adding additional linebreaks. + * + * @since 7.5.0 + */ + std::optional<QString> details; + + /** + * <p>Optional translation of `details` according to your language preferences. + * Will not be available in case no translation is available. + * + * @since 7.5.0 + */ + std::optional<QString> localizedDetails; + + /** + * <p>E-mail address for support requests + * + * @since 7.5.0 + */ + std::optional<QString> supportAddress; + + /** + * <p>If this is `true`, this is an indication by the server, that this error + * is probably a bug on server-side and clients are encouraged to encourage + * users to escalate this problem, e.g. using `supportAddress`. + * + * <p>Keep in mind that this boolean may be wrong in both directions, e.g.: + * * if a timeout is configured too low, then this can be a false positive + * * if the bug lies in the exception judgment than this is a false negative + * + * <p>So it should always be clear to users that they have the ultimate choice + * on what to do with an error popup. + * + * @since 7.5.0 + */ + std::optional<bool> displayServerBugHint; + + /** + * <p>Optional field containing additional error information meant for automatic processing. + * + * <p>* This data is meant for helping software that uses the API to better understand and communicate + * certain types of error to the user. + * * Always inspect the `type` so you know what keys you can expect. + * + * <p>Error types having additional information: + * + * <p> * type = InvalidFilterException (since 6.5.0): + * + * <p> * optionally has a string datum 'column' referencing the column that has the invalid + * filter value. The file filter is referred to by the string "any path". + * * optionally has a string datum 'help' providing an ascii-encoded URL + * pointing to human-readable help that might help a user understanding + * and resolving the error. If the URL is relative, then it is meant + * relative to the Dashboard the error originated from. + * + * <p> * type = PasswordVerificationException (since 7.1.0): + * + * <p> * optionally has a boolean flag 'passwordMayBeUsedAsApiToken' to indicate that the + * provided password may be used as API token with the respective API. E.g. use + * 'Authorization: AxToken ...' header instead of HTTP basic auth. + * + * @since 6.5.0 + */ + std::optional<std::map<QString, Any>> data; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ErrorDto deserialize(const QByteArray &json); + + ErrorDto( + std::optional<QString> dashboardVersionNumber, + QString type, + QString message, + QString localizedMessage, + std::optional<QString> details, + std::optional<QString> localizedDetails, + std::optional<QString> supportAddress, + std::optional<bool> displayServerBugHint, + std::optional<std::map<QString, Any>> data + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Describes an issue comment + */ + class IssueCommentDto : public Serializable + { + public: + + /** + * <p>The loginname of the user that created the comment. + */ + QString username; + + /** + * <p>The recommended display name of the user that wrote the comment. + */ + QString userDisplayName; + + /** + * <p>The Date when the comment was created as a ISO8601-parseable string. + */ + QString date; + + /** + * <p>The Date when the comment was created for UI-display. + * + * <p>It is formatted as a human-readable string relative to query time, e.g. + * ``2 minutes ago``. + */ + QString displayDate; + + /** + * <p>The comment text. + */ + QString text; + + /** + * <p>The linkified comment text. + * + * @since 7.6.0 + */ + std::optional<QString> html; + + /** + * <p>The id for comment deletion. + * + * <p>When the requesting user is allowed to delete the comment, contains an id + * that can be used to mark the comment as deleted using another API. This is + * never set when the Comment is returned as the result of an Issue-List query. + */ + std::optional<QString> commentDeletionId; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueCommentDto deserialize(const QByteArray &json); + + IssueCommentDto( + QString username, + QString userDisplayName, + QString date, + QString displayDate, + QString text, + std::optional<QString> html, + std::optional<QString> commentDeletionId + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Shortname for an erosion issue kind + * + * <p>one of ``AV``, ``CL``, ``CY``, ``DE``, ``MV``, ``SV`` + */ + enum class IssueKind + { + av, + cl, + cy, + de, + mv, + sv + }; + + class IssueKindMeta final + { + public: + static const QLatin1String av; + static const QLatin1String cl; + static const QLatin1String cy; + static const QLatin1String de; + static const QLatin1String mv; + static const QLatin1String sv; + + // Throws std::range_error + static IssueKind strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(IssueKind e); + + IssueKindMeta() = delete; + ~IssueKindMeta() = delete; + }; + + /** + * IssueKind for Named-Filter creation + * + * <p>one of ``AV``, ``CL``, ``CY``, ``DE``, ``MV``, ``SV``, ``UNIVERSAL`` + */ + enum class IssueKindForNamedFilterCreation + { + av, + cl, + cy, + de, + mv, + sv, + universal + }; + + class IssueKindForNamedFilterCreationMeta final + { + public: + static const QLatin1String av; + static const QLatin1String cl; + static const QLatin1String cy; + static const QLatin1String de; + static const QLatin1String mv; + static const QLatin1String sv; + static const QLatin1String universal; + + // Throws std::range_error + static IssueKindForNamedFilterCreation strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(IssueKindForNamedFilterCreation e); + + IssueKindForNamedFilterCreationMeta() = delete; + ~IssueKindForNamedFilterCreationMeta() = delete; + }; + + /** + * <p>Identifies a source code location which may be a single line of code or an + * couple of adjacent lines (fragment) inside the same source file. + */ + class IssueSourceLocationDto : public Serializable + { + public: + + /** + * <p>Refers to the file with a normalized path relative to the current project + * root. + */ + QString fileName; + + /** + * <p>A user-readable description of this source location's role in the + * issue (e.g. 'Source' or 'Target') + */ + std::optional<QString> role; + + /** + * <p>Host-relative URL of the source code version for which these + * startLine/endLine values are valid + */ + QString sourceCodeUrl; + + /** + * <p>The first line of the fragment + */ + qint32 startLine; + + /** + * The column of the start line in which the issue starts. + * + * <p>1-relative + * + * <p>0 iff unknown + * + * @since 7.2.0 + */ + qint32 startColumn; + + /** + * The last line of the fragment (inclusive) + * + * <p>This is the same as `startLine` if the location has only one line. + */ + qint32 endLine; + + /** + * The column of the end line in which the issue ends. + * + * <p>1-relative + * + * <p>0 iff unknown + * + * @since 7.2.0 + */ + qint32 endColumn; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueSourceLocationDto deserialize(const QByteArray &json); + + IssueSourceLocationDto( + QString fileName, + std::optional<QString> role, + QString sourceCodeUrl, + qint32 startLine, + qint32 startColumn, + qint32 endLine, + qint32 endColumn + ); + + virtual QByteArray serialize() const override; + }; + + /** + * An issue tag as returned by the Issue-List API. + */ + class IssueTagDto : public Serializable + { + public: + + /** + * <p>Use this for displaying the tag + */ + QString tag; + + /** + * <p>An RGB hex color in the form #RRGGBB directly usable by css. + * + * <p>The colors are best suited to draw a label on bright background and to + * contain white letters for labeling. + */ + QString color; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTagDto deserialize(const QByteArray &json); + + IssueTagDto( + QString tag, + QString color + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Describes an issue tag as returned by the Issue-Tags API. + */ + class IssueTagTypeDto : public Serializable + { + public: + + /** + * <p>A canonicalized variant of the tag name that can be used for client-side equality checks and sorting. + */ + QString id; + + /** + * <p>Deprecated since 6.9.0, use ``tag`` instead. + * + * @deprecated + */ + std::optional<QString> text; + + /** + * <p>Use this for displaying the tag + * + * @since 6.9.0 + */ + std::optional<QString> tag; + + /** + * <p>An RGB hex color in the form #RRGGBB directly usable by css. + * + * <p>The colors are best suited to draw a label on bright background and to + * contain white letters for labeling. + */ + QString color; + + /** + * <p>The description of the tag. It can be assumed to be plain text with no need for further + * syntactic interpretation. + */ + std::optional<QString> description; + + /** + * <p>Whether the tag is attached to the issue or only proposed. + */ + std::optional<bool> selected; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTagTypeDto deserialize(const QByteArray &json); + + IssueTagTypeDto( + QString id, + std::optional<QString> text, + std::optional<QString> tag, + QString color, + std::optional<QString> description, + std::optional<bool> selected + ); + + virtual QByteArray serialize() const override; + }; + + /** + * The log-level of a message + * + * <p>* `DEBUG` + * * `INFO` + * * `WARNING` + * * `ERROR` + * * `FATAL` + */ + enum class MessageSeverity + { + debug, + info, + warning, + error, + fatal + }; + + class MessageSeverityMeta final + { + public: + static const QLatin1String debug; + static const QLatin1String info; + static const QLatin1String warning; + static const QLatin1String error; + static const QLatin1String fatal; + + // Throws std::range_error + static MessageSeverity strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(MessageSeverity e); + + MessageSeverityMeta() = delete; + ~MessageSeverityMeta() = delete; + }; + + /** + * Describes a Metric as configured for a project in a version + */ + class MetricDto : public Serializable + { + public: + + /** + * <p>The ID of the metric + */ + QString name; + + /** + * <p>a more descriptive name of the metric + */ + QString displayName; + + /** + * <p>The configured minimum threshold for the metric. + * + * <p>Can have two possible string values ``-Infinity`` and ``Infinity`` + * otherwise it is a number. If not configured, this field will not + * be available. + */ + Any minValue; + + /** + * <p>The configured maximum threshold for the metric. + * + * <p>Can have two possible string values ``-Infinity`` and ``Infinity`` + * otherwise it is a number. If not configured, this field will not + * be available. + */ + Any maxValue; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static MetricDto deserialize(const QByteArray &json); + + MetricDto( + QString name, + QString displayName, + Any minValue, + Any maxValue + ); + + virtual QByteArray serialize() const override; + }; + + /** + * An entity table row + * + * <p>Note, that if you specify ``forceStrings=true`` when querying the table, + * the field types will all be ``string`` and the empty string will indicate + * an absent value. + */ + class MetricValueTableRowDto : public Serializable + { + public: + + /** + * <p>The Metric Id + */ + QString metric; + + /** + * <p>The source file of the entity definition + */ + std::optional<QString> path; + + /** + * <p>The source file line number of the entity definition + */ + std::optional<qint32> line; + + /** + * <p>The measured or aggregated metric value + */ + std::optional<double> value; + + /** + * <p>The non-unique entity name + */ + QString entity; + + /** + * <p>The entity type + */ + QString entityType; + + /** + * <p>The project-wide entity ID + */ + QString entityId; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static MetricValueTableRowDto deserialize(const QByteArray &json); + + MetricValueTableRowDto( + QString metric, + std::optional<QString> path, + std::optional<qint32> line, + std::optional<double> value, + QString entity, + QString entityType, + QString entityId + ); + + virtual QByteArray serialize() const override; + }; + + /** + * A named filter type + * + * <p>* `PREDEFINED` - Named filters of this type are immutable and exist out of the box and can be used by everyone + * * `GLOBAL` - Named filters of this type are usable by everyone and managed by the so called filter managers + * * `CUSTOM` - Named filters of this type are creatable by everyone but only visible to their owner + */ + enum class NamedFilterType + { + predefined, + global, + custom + }; + + class NamedFilterTypeMeta final + { + public: + static const QLatin1String predefined; + static const QLatin1String global; + static const QLatin1String custom; + + // Throws std::range_error + static NamedFilterType strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(NamedFilterType e); + + NamedFilterTypeMeta() = delete; + ~NamedFilterTypeMeta() = delete; + }; + + /** + * NamedFilter visibility configuration + * + * <p>Only applicable for global named filters. + * + * <p>You may not have access to this information depending on your permissions. + * + * @since 7.3.0 + */ + class NamedFilterVisibilityDto : public Serializable + { + public: + + /** + * <p>IDs of user-groups, that are allowed to see the named filter. + * + * <p>The named filter is visible to all users, if this property is not given. + */ + std::optional<std::vector<QString>> groups; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterVisibilityDto deserialize(const QByteArray &json); + + NamedFilterVisibilityDto( + std::optional<std::vector<QString>> groups + ); + + virtual QByteArray serialize() const override; + }; + + /** + * A reference to a project + */ + class ProjectReferenceDto : public Serializable + { + public: + + /** + * <p>The name of the project. Use this string to refer to the project. + */ + QString name; + + /** + * <p>URI to get further information about the project. + */ + QString url; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ProjectReferenceDto deserialize(const QByteArray &json); + + ProjectReferenceDto( + QString name, + QString url + ); + + virtual QByteArray serialize() const override; + }; + + /** + * A rule configured on a project + * + * @since 6.5.0 + */ + class RuleDto : public Serializable + { + public: + + /** + * <p>the rule name (possibly renamed via configuration) + */ + QString name; + + /** + * <p>the original (unrenamed) rule name + */ + QString original_name; + + /** + * <p>Whether or not the rule was disabled. + * + * <p>Note, that this value is only available for analysis runs + * done with at least 6.5.0 + */ + std::optional<bool> disabled; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static RuleDto deserialize(const QByteArray &json); + + RuleDto( + QString name, + QString original_name, + std::optional<bool> disabled + ); + + virtual QByteArray serialize() const override; + }; + + /** + * A sorting direction + * + * <p>* `ASC` - `smaller` values first + * * `DESC` - `greater` values first + */ + enum class SortDirection + { + asc, + desc + }; + + class SortDirectionMeta final + { + public: + static const QLatin1String asc; + static const QLatin1String desc; + + // Throws std::range_error + static SortDirection strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(SortDirection e); + + SortDirectionMeta() = delete; + ~SortDirectionMeta() = delete; + }; + + /** + * How the column values should be aligned. + * + * <p>* `left` - Align value to the left of its cell + * * `right` - Align value to the right of its cell + * * `center` - Center value in its cell + */ + enum class TableCellAlignment + { + left, + right, + center + }; + + class TableCellAlignmentMeta final + { + public: + static const QLatin1String left; + static const QLatin1String right; + static const QLatin1String center; + + // Throws std::range_error + static TableCellAlignment strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(TableCellAlignment e); + + TableCellAlignmentMeta() = delete; + ~TableCellAlignmentMeta() = delete; + }; + + /** + * Refers to a specific version of the Axivion Suite + */ + class ToolsVersionDto : public Serializable + { + public: + + /** + * <p>Version number for display purposes + */ + QString name; + + /** + * <p>Parseable, numeric version number suitable for version comparisons + */ + QString number; + + /** + * <p>Build date in an ISO8601-parseable string of the form YYYY-MM-DD + */ + QString buildDate; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ToolsVersionDto deserialize(const QByteArray &json); + + ToolsVersionDto( + QString name, + QString number, + QString buildDate + ); + + virtual QByteArray serialize() const override; + }; + + /** + * User Type + * + * <p>* `VIRTUAL_USER` - virtual user that does not represent a specific person + * * `DASHBOARD_USER` - a `regular`, explicitly managed user + * * `UNMAPPED_USER` - a user that is not explicitly managed and e.g. only known via an analysis result + * + * @since 7.1.0 + */ + enum class UserRefType + { + virtual_user, + dashboard_user, + unmapped_user + }; + + class UserRefTypeMeta final + { + public: + static const QLatin1String virtual_user; + static const QLatin1String dashboard_user; + static const QLatin1String unmapped_user; + + // Throws std::range_error + static UserRefType strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(UserRefType e); + + UserRefTypeMeta() = delete; + ~UserRefTypeMeta() = delete; + }; + + /** + * Kind-specific issue count statistics that are cheaply available. + */ + class VersionKindCountDto : public Serializable + { + public: + + /** + * <p>The number of issues of a kind in a version. + */ + qint32 Total; + + /** + * <p>The number of issues of a kind present in a version that were not present in the previous version. + */ + qint32 Added; + + /** + * <p>The number of issues of a kind that were present in the previous version and are not present in the current version any more. + */ + qint32 Removed; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static VersionKindCountDto deserialize(const QByteArray &json); + + VersionKindCountDto( + qint32 Total, + qint32 Added, + qint32 Removed + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Describes the version of analysis data of a certain Project. + */ + class AnalysisVersionDto : public Serializable + { + public: + + /** + * <p>The ID used to refer to an `AnalysisVersion` in this API. + * + * <p>ISO8601 compatible date-strings that are guaranteed to + * contain time zone information. + * + * <p>An example version string is `2020-11-23T09:37:04.797286Z`. + * + * <p>The precision of these dates is undefined, thus in order to be sure to refer + * to exactly the same version when specifying a version as an argument e.g. + * when querying issues, you must use this exact string. + * + * <p>If you want to interpret the version-date e.g. for passing it to a + * graph-drawing library or to order a list of `AnalysisVersion`s, + * it is easier to use the field `millis` instead of parsing these dates. + */ + QString date; + + /** + * <p>Optional label of the version. + * + * @since 7.6.0 + */ + std::optional<QString> label; + + /** + * <p>The 0-based index of all the known analysis versions of a project. + * + * <p>The version with index 0 never contains actual analysis data but always + * refers to a fictional version without any issues that happened before + * version 1. + */ + qint32 index; + + /** + * <p>The legacy display name of a version. + * + * <p>It is not recommended to use this anymore. It contains the + * date of the analysis version creation in an arbitrary time zone which is not + * indicated in the timestamp. In recent versions most probably UTC is used but + * this can change at any time - which would be regarded as a non-breaking + * change. + * + * <p>Instead, clients should craft their own display name from the other + * available properties (date, label) and maybe adjust displayed dates + * according to their system timezone. + * + * @deprecated + */ + std::optional<QString> name; + + /** + * <p>Analysis version timestamp in milliseconds + * + * <p>The number of milliseconds passed since 1970-01-01T00:00:00 UTC + * + * <p>Meant for programmatic interpretation of the actual instant in time that + * represents a version. + */ + qint64 millis; + + /** + * <p>For every Issue Kind contains some Issue counts. + * + * <p>Namely the Total count, as well as the newly Added and newly Removed issues in comparison + * with the version before. + * + * <p>N.B. The Bauhaus Version used to analyze the project must be at least 6.5.0 in order for + * these values to be available. + * + * @since 6.6.0 + */ + Any issueCounts; + + /** + * Refers to a specific version of the Axivion Suite + * + * <p>Version information of the Axivion Suite used to do this analysis run. + * + * <p>Note, that this field is only available when the analysis was done with at least version + * 6.5.0. + * + * @since 6.9.15 + */ + std::optional<ToolsVersionDto> toolsVersion; + + /** + * <p>The total lines of code of the project at the current version if available + * + * @since 7.0.4 + */ + std::optional<qint64> linesOfCode; + + /** + * <p>The clone ratio of the project at the current version if available + * + * @since 7.0.4 + */ + std::optional<double> cloneRatio; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static AnalysisVersionDto deserialize(const QByteArray &json); + + AnalysisVersionDto( + QString date, + std::optional<QString> label, + qint32 index, + std::optional<QString> name, + qint64 millis, + Any issueCounts, + std::optional<ToolsVersionDto> toolsVersion, + std::optional<qint64> linesOfCode, + std::optional<double> cloneRatio + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains Request-Data for creating an ApiToken + * + * @since 7.1.0 + */ + class ApiTokenCreationRequestDto : public Serializable + { + public: + + /** + * <p>Dashboard password of the user that requests the token creation + */ + QString password; + + /** + * Available types of ApiToken + * + * <p>the type of the token to create + * + * @since 7.1.0 + */ + QString type; + + /** + * <p>Purpose of the Token + */ + QString description; + + /** + * <p>Used for configuring the Token expiration. + * + * <p>* positive values are maxAge in milliseconds + * * 0 means: choose a default for me (recommended) + * * negative values are not allowed + * + * <p>Note, that the server clock is decisive for when the actual token expiration will occur. + * Expired tokens will be invalidated or deleted on the server depending on their type. + */ + qint64 maxAgeMillis; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ApiTokenCreationRequestDto deserialize(const QByteArray &json); + + ApiTokenCreationRequestDto( + QString password, + QString type, + QString description, + qint64 maxAgeMillis + ); + + ApiTokenCreationRequestDto( + QString password, + ApiTokenType type, + QString description, + qint64 maxAgeMillis + ); + + // Throws std::range_error + ApiTokenType getTypeEnum() const; + + void setTypeEnum(ApiTokenType newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains Meta-Data of an ApiToken + * + * <p>When this is returned as response of a creation request it will also + * contain the token secret + * + * @since 7.1.0 + */ + class ApiTokenInfoDto : public Serializable + { + public: + + /** + * <p>The unique Token-ID. + */ + QString id; + + /** + * <p>The token URL + */ + QString url; + + /** + * <p>Whether the token was still valid at query time. + * + * <p>Invalid Tokens are effectively tombstones and cannot be used for + * authentication any more. + * Note, that this field is no indication on whether or not this object + * is transporting the secret. + */ + bool isValid; + + /** + * Available types of ApiToken + * + * <p>The type of the Token + * + * @since 7.1.0 + */ + QString type; + + /** + * <p>Description that was given on token creation. + */ + QString description; + + /** + * <p>The secret token value. + * + * <p>This is only initialized upon token creation. Use this to authenticate + * against the Dashboard as described in :ref:`authentication`. + */ + std::optional<QString> token; + + /** + * <p>ISO8601 format date string + */ + QString creationDate; + + /** + * <p>Alternative representation of the token creation date, like "2 days ago" etc + */ + QString displayCreationDate; + + /** + * <p>ISO8601 format date string + */ + QString expirationDate; + + /** + * <p>Alternative representation of the token expiration date, like "3 months from now" etc + */ + QString displayExpirationDate; + + /** + * <p>ISO8601 format date if the token has already been used + */ + std::optional<QString> lastUseDate; + + /** + * <p>Alternative representation of the token last use date, e.g. "2 days ago" or "Never" + */ + QString displayLastUseDate; + + /** + * <p>Whether this token is used by the current request. + * + * <p>Deletion of this token will invalidate the currently used credentials + */ + bool usedByCurrentRequest; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ApiTokenInfoDto deserialize(const QByteArray &json); + + ApiTokenInfoDto( + QString id, + QString url, + bool isValid, + QString type, + QString description, + std::optional<QString> token, + QString creationDate, + QString displayCreationDate, + QString expirationDate, + QString displayExpirationDate, + std::optional<QString> lastUseDate, + QString displayLastUseDate, + bool usedByCurrentRequest + ); + + ApiTokenInfoDto( + QString id, + QString url, + bool isValid, + ApiTokenType type, + QString description, + std::optional<QString> token, + QString creationDate, + QString displayCreationDate, + QString expirationDate, + QString displayExpirationDate, + std::optional<QString> lastUseDate, + QString displayLastUseDate, + bool usedByCurrentRequest + ); + + // Throws std::range_error + ApiTokenType getTypeEnum() const; + + void setTypeEnum(ApiTokenType newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Represents a table column. + */ + class ColumnInfoDto : public Serializable + { + public: + + /** + * <p>Key used to identify the column in the rows and for sorting/filtering. + * + * <p>For Issue-Table columns, see :ref:`column <issue-table-columns>`. + */ + QString key; + + /** + * <p>Nice header name for the column for UI display purposes. + */ + std::optional<QString> header; + + /** + * <p>Specifies whether this column can be sorted. + */ + bool canSort; + + /** + * <p>Specifies whether this column can be filtered. + */ + bool canFilter; + + /** + * How the column values should be aligned. + * + * <p>How the column values should be aligned. + */ + QString alignment; + + /** + * <p>The column type. + * + * <p>Possible values: + * * `string` - a unicode string or ``null`` + * * `number` - either ``null`` or ``"Infinity"`` or ``"-Infinity"`` or ``"NaN"`` (string!) or a decimal number with base 10. + * * `state` - The fields are strings. Possible values are defined via ``typeOptions``. + * * `boolean` - The fields are boolean values, either ``false`` or ``true``. Has ``typeOptions``. + * * `path` - **Since 6.4.1** similar to ``string`` or ``null``, however they are normalized (guaranteed single-slash separators) for easy parsing as path + * * `tags` - **Since 6.5.0** an array of :json:object:`IssueTag` + * * `comments` - **Since 6.9.0** array of :json:object:`IssueComment` + * * `owners` - **Since 7.0.0** array of :json:object:`UserRef` + */ + QString type; + + /** + * <p>Describes possible values for the field. + * + * <p>Currently this is only used for the types ``state`` and ``boolean``. + * In case of type ``boolean`` this always contains exactly 2 elements, + * the first describing the false-equivalent, the second describing the + * true-equivalent. In case of type ``state`` this contains the possible string + * values the field may have. + */ + std::optional<std::vector<ColumnTypeOptionDto>> typeOptions; + + /** + * <p>Suggested column width in pixels + */ + qint32 width; + + /** + * <p>whether a gui should show this column by default. + */ + bool showByDefault; + + /** + * <p>Key used to identify a column that provides the hyperlink targets + * for this column ('ErrorLink' or null) + */ + std::optional<QString> linkKey; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ColumnInfoDto deserialize(const QByteArray &json); + + ColumnInfoDto( + QString key, + std::optional<QString> header, + bool canSort, + bool canFilter, + QString alignment, + QString type, + std::optional<std::vector<ColumnTypeOptionDto>> typeOptions, + qint32 width, + bool showByDefault, + std::optional<QString> linkKey + ); + + ColumnInfoDto( + QString key, + std::optional<QString> header, + bool canSort, + bool canFilter, + TableCellAlignment alignment, + QString type, + std::optional<std::vector<ColumnTypeOptionDto>> typeOptions, + qint32 width, + bool showByDefault, + std::optional<QString> linkKey + ); + + // Throws std::range_error + TableCellAlignment getAlignmentEnum() const; + + void setAlignmentEnum(TableCellAlignment newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Main API endpoint response + */ + class DashboardInfoDto : public Serializable + { + public: + + /** + * <p>The complete dashboard base URL. + * + * <p>Use this to point your browser to the Dashboard or + * combine it with the other host-relative URLs returned by this API + * in order to get complete URLs. + * + * <p>Note, that this URL may be different from the URL you are currently + * accessing the Dashboard with for various reasons. + * + * <p>Also note, that the Dashboard cannot always know the proper value + * to return here, e.g. when running behind a proxy. So an administrator + * might need to help out the Dashboard by configuring the proper value + * in the global settings. + * + * @since 7.4.0 + */ + std::optional<QString> mainUrl; + + /** + * <p>Axivion Dashboard version serving this API. + */ + QString dashboardVersion; + + /** + * <p>Parseable Axivion Dashboard Version. + * + * @since 6.6.0 + */ + std::optional<QString> dashboardVersionNumber; + + /** + * <p>Dashboard Server Build date. + */ + QString dashboardBuildDate; + + /** + * <p>Name of the successfully authenticated user if a dashboard-user is associated with the request. + */ + std::optional<QString> username; + + /** + * <p>The HTTP-Request Header expected present for all HTTP requests that are not GET, HEAD, OPTIONS or TRACE. + */ + QString csrfTokenHeader; + + /** + * <p>The value expected to be sent along the ``csrfTokenHeader`` for all HTTP requests that are not GET, HEAD, OPTIONS or TRACE. + * + * <p>Note, that this does not replace authentication of subsequent requests. Also the token is combined with the authentication + * data, so will not work when authenticating as another user. Its lifetime is limited, so when creating a very long-running + * application you should consider refreshing this token from time to time. + */ + QString csrfToken; + + /** + * <p>An URI that can be used to check credentials via GET. It returns `"ok"` in case of valid credentials. + * + * @since 6.5.4 + */ + std::optional<QString> checkCredentialsUrl; + + /** + * <p>Endpoint for managing global named filters + * + * @since 7.3.0 + */ + std::optional<QString> namedFiltersUrl; + + /** + * <p>List of references to the projects visible to the authenticated user. + */ + std::optional<std::vector<ProjectReferenceDto>> projects; + + /** + * <p>Endpoint for creating and listing api tokens of the current user + * + * @since 7.1.0 + */ + std::optional<QString> userApiTokenUrl; + + /** + * <p>Endpoint for managing custom named filters of the current user + * + * @since 7.3.0 + */ + std::optional<QString> userNamedFiltersUrl; + + /** + * <p>E-mail address for support requests + * + * @since 7.4.3 + */ + std::optional<QString> supportAddress; + + /** + * <p>A host-relative URL that can be used to display filter-help meant for humans. + * + * @since 7.4.3 + */ + std::optional<QString> issueFilterHelp; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static DashboardInfoDto deserialize(const QByteArray &json); + + DashboardInfoDto( + std::optional<QString> mainUrl, + QString dashboardVersion, + std::optional<QString> dashboardVersionNumber, + QString dashboardBuildDate, + std::optional<QString> username, + QString csrfTokenHeader, + QString csrfToken, + std::optional<QString> checkCredentialsUrl, + std::optional<QString> namedFiltersUrl, + std::optional<std::vector<ProjectReferenceDto>> projects, + std::optional<QString> userApiTokenUrl, + std::optional<QString> userNamedFiltersUrl, + std::optional<QString> supportAddress, + std::optional<QString> issueFilterHelp + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Response when listing comments of an issue + */ + class IssueCommentListDto : public Serializable + { + public: + + /** + * <p>Comments in chronological order + */ + std::vector<IssueCommentDto> comments; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueCommentListDto deserialize(const QByteArray &json); + + IssueCommentListDto( + std::vector<IssueCommentDto> comments + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Describes an Issue Kind. + */ + class IssueKindInfoDto : public Serializable + { + public: + + /** + * Shortname for an erosion issue kind + * + * <p>one of ``AV``, ``CL``, ``CY``, ``DE``, ``MV``, ``SV`` + */ + QString prefix; + + /** + * <p>A singular string for using in UI texts about the issue kind. + */ + QString niceSingularName; + + /** + * <p>A plural string for using in UI texts about the issue kind. + */ + QString nicePluralName; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueKindInfoDto deserialize(const QByteArray &json); + + IssueKindInfoDto( + QString prefix, + QString niceSingularName, + QString nicePluralName + ); + + IssueKindInfoDto( + IssueKind prefix, + QString niceSingularName, + QString nicePluralName + ); + + // Throws std::range_error + IssueKind getPrefixEnum() const; + + void setPrefixEnum(IssueKind newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * List of Issue Tag Types + */ + class IssueTagTypeListDto : public Serializable + { + public: + + /** + * <p>Result when querying tags of a given issue + */ + std::vector<IssueTagTypeDto> tags; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTagTypeListDto deserialize(const QByteArray &json); + + IssueTagTypeListDto( + std::vector<IssueTagTypeDto> tags + ); + + virtual QByteArray serialize() const override; + }; + + /** + * <p>Describes a tainted location of a source file + */ + class LineMarkerDto : public Serializable + { + public: + + /** + * The issue kind + * + * <p>one of ``AV``, ``CL``, ``CY``, ``DE``, ``MV``, ``SV`` + */ + QString kind; + + /** + * The issue id. + * + * <p>This id is not global. It is only unique for the same project and kind. + * + * <p>Note, that this may not be available e.g. when served by the PluginARServer. + */ + std::optional<qint64> id; + + /** + * The first tainted line. + * + * <p>First line in file is line 1. + */ + qint32 startLine; + + /** + * The column of the start line in which the issue starts. + * + * <p>First column in line is column 1. + * + * <p>0 iff unknown + * + * @since 7.2.0 + */ + qint32 startColumn; + + /** + * The last tainted line. + * + * <p>First line in file is line 1. + */ + qint32 endLine; + + /** + * The column of the end line in which the issue ends. + * + * <p>First column in line is column 1. + * + * <p>0 iff unknown + * + * @since 7.2.0 + */ + qint32 endColumn; + + /** + * <p>A prosaic (one-liner) description of the issue. + */ + QString description; + + /** + * <p>Host-relative API URI to access further information about the issue. + * + * <p>Note, that this may not be available e.g. when served by the PluginARServer. + */ + std::optional<QString> issueUrl; + + /** + * <p>Determines, whether the issue is new in the given version, i.e. it did not + * exist in the version before the given version and the given version is not + * the first analyzed version. + * + * @since 6.5.0 + */ + std::optional<bool> isNew; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static LineMarkerDto deserialize(const QByteArray &json); + + LineMarkerDto( + QString kind, + std::optional<qint64> id, + qint32 startLine, + qint32 startColumn, + qint32 endLine, + qint32 endColumn, + QString description, + std::optional<QString> issueUrl, + std::optional<bool> isNew + ); + + LineMarkerDto( + IssueKind kind, + std::optional<qint64> id, + qint32 startLine, + qint32 startColumn, + qint32 endLine, + qint32 endColumn, + QString description, + std::optional<QString> issueUrl, + std::optional<bool> isNew + ); + + // Throws std::range_error + IssueKind getKindEnum() const; + + void setKindEnum(IssueKind newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * A log message with an associated log level + * + * <p>Contains messages returned from the VCS-adapters reporting on + * the VCS update result. + */ + class RepositoryUpdateMessageDto : public Serializable + { + public: + + /** + * The log-level of a message + * + * <p>The log-level of the message. + */ + std::optional<QString> severity; + + /** + * <p>the log-message. It may contain new-lines. + */ + std::optional<QString> message; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static RepositoryUpdateMessageDto deserialize(const QByteArray &json); + + RepositoryUpdateMessageDto( + std::optional<QString> severity, + std::optional<QString> message + ); + + RepositoryUpdateMessageDto( + std::optional<MessageSeverity> severity, + std::optional<QString> message + ); + + // Throws std::range_error + std::optional<MessageSeverity> getSeverityEnum() const; + + void setSeverityEnum(std::optional<MessageSeverity> newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains a list of rules + * + * @since 6.5.0 + */ + class RuleListDto : public Serializable + { + public: + + + std::vector<RuleDto> rules; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static RuleListDto deserialize(const QByteArray &json); + + RuleListDto( + std::vector<RuleDto> rules + ); + + virtual QByteArray serialize() const override; + }; + + /** + * A Column Key + Sort Direction to indicate table sort preferences. + */ + class SortInfoDto : public Serializable + { + public: + + /** + * <p>The :ref:`column key<issue-table-columns>` + */ + QString key; + + /** + * A sorting direction + * + * <p>The sort direction associated with this column. + */ + QString direction; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static SortInfoDto deserialize(const QByteArray &json); + + SortInfoDto( + QString key, + QString direction + ); + + SortInfoDto( + QString key, + SortDirection direction + ); + + // Throws std::range_error + SortDirection getDirectionEnum() const; + + void setDirectionEnum(SortDirection newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Information about a user + */ + class UserRefDto : public Serializable + { + public: + + /** + * <p>User name. Use this to refer to the same user. + */ + QString name; + + /** + * <p>Use this for display of the user in a UI. + */ + QString displayName; + + /** + * User Type + * + * <p>User Type + * + * @since 7.1.0 + */ + std::optional<QString> type; + + /** + * <p>Whether this user is a so-called `public` user. + * + * @since 7.1.0 + */ + std::optional<bool> isPublic; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static UserRefDto deserialize(const QByteArray &json); + + UserRefDto( + QString name, + QString displayName, + std::optional<QString> type, + std::optional<bool> isPublic + ); + + UserRefDto( + QString name, + QString displayName, + std::optional<UserRefType> type, + std::optional<bool> isPublic + ); + + // Throws std::range_error + std::optional<UserRefType> getTypeEnum() const; + + void setTypeEnum(std::optional<UserRefType> newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains a list of analyzed file descriptions. + */ + class AnalyzedFileListDto : public Serializable + { + public: + + /** + * Describes the version of analysis data of a certain Project. + * + * <p>The version this list was queried with. + */ + AnalysisVersionDto version; + + + std::vector<AnalyzedFileDto> rows; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static AnalyzedFileListDto deserialize(const QByteArray &json); + + AnalyzedFileListDto( + AnalysisVersionDto version, + std::vector<AnalyzedFileDto> rows + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains a list of entities and the version of their versioned aspects + */ + class EntityListDto : public Serializable + { + public: + + /** + * Describes the version of analysis data of a certain Project. + * + * <p>The version this entity list was queried with. + */ + std::optional<AnalysisVersionDto> version; + + + std::vector<EntityDto> entities; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static EntityListDto deserialize(const QByteArray &json); + + EntityListDto( + std::optional<AnalysisVersionDto> version, + std::vector<EntityDto> entities + ); + + virtual QByteArray serialize() const override; + }; + + /** + * <p>Describes information that can be used to display a file with erosion information. + * + * @since 6.2.0 + */ + class FileViewDto : public Serializable + { + public: + + /** + * <p>The complete path of the file relative to the projects file-root + */ + QString fileName; + + /** + * <p>ISO-8601 Datestring of the file's version that can be used when manually + * constructing an URL to retrieve the file's source-code. + * + * <p>The format used is yyyy-MM-ddTHH:mm:ss.SSSZZ + * + * @since 6.4.2 + */ + std::optional<QString> version; + + /** + * <p>Refers to the source code which can be gotten as text/plain or as an + * application/json object containing a token-sequence + * + * <p>Note, that this may not be available e.g. when served by the PluginARServer. + */ + std::optional<QString> sourceCodeUrl; + + /** + * <p>The erosion information associated with the file + */ + std::vector<LineMarkerDto> lineMarkers; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static FileViewDto deserialize(const QByteArray &json); + + FileViewDto( + QString fileName, + std::optional<QString> version, + std::optional<QString> sourceCodeUrl, + std::vector<LineMarkerDto> lineMarkers + ); + + virtual QByteArray serialize() const override; + }; + + /** + * <p>Describes an issue + */ + class IssueDto : public Serializable + { + public: + + /** + * The issue kind + * + * <p>one of ``AV``, ``CL``, ``CY``, ``DE``, ``MV``, ``SV`` + */ + QString kind; + + /** + * The issue id + * + * <p>This id is not global. It is only unique for the same project and kind. + */ + qint64 id; + + /** + * The Project the issue belongs to + */ + ProjectReferenceDto parentProject; + + /** + * Source locations associated with the issue + */ + std::vector<IssueSourceLocationDto> sourceLocations; + + /** + * The issue kind + */ + IssueKindInfoDto issueKind; + + /** + * Whether or not the issue is hidden + * + * @since 6.4.0 + */ + bool isHidden; + + /** + * <p>Versioned host relative URL to view issue in browser + * + * @since 7.2.1 + */ + std::optional<QString> issueViewUrl; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueDto deserialize(const QByteArray &json); + + IssueDto( + QString kind, + qint64 id, + ProjectReferenceDto parentProject, + std::vector<IssueSourceLocationDto> sourceLocations, + IssueKindInfoDto issueKind, + bool isHidden, + std::optional<QString> issueViewUrl + ); + + IssueDto( + IssueKind kind, + qint64 id, + ProjectReferenceDto parentProject, + std::vector<IssueSourceLocationDto> sourceLocations, + IssueKindInfoDto issueKind, + bool isHidden, + std::optional<QString> issueViewUrl + ); + + // Throws std::range_error + IssueKind getKindEnum() const; + + void setKindEnum(IssueKind newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Result of querying the issue-list retrieval entry point mainly + * containing a list of issues. + */ + class IssueTableDto : public Serializable + { + public: + + /** + * Describes the version of analysis data of a certain Project. + * + * <p>The version of the ``removed`` issues. + * + * <p>If the query was not an actual diff query this will be unset. + */ + std::optional<AnalysisVersionDto> startVersion; + + /** + * Describes the version of analysis data of a certain Project. + * + * <p>The version of the ``added`` issues for a diff query + * or simply the version of a normal issue list query (no startVersion) + */ + AnalysisVersionDto endVersion; + + /** + * <p>Url to view the issues in the Dashboard Browser UI + * + * @since 7.2.1 + */ + std::optional<QString> tableViewUrl; + + /** + * <p>The Issue Table Columns describing the issue fields. + * + * <p>Deprecated since 7.1.0. Use :json:object`TableInfo` instead + * + * @deprecated + */ + std::optional<std::vector<ColumnInfoDto>> columns; + + /** + * <p>The actual issue data objects. + * + * <p>The issue object contents are dynamic and depend on the queried + * issue kind. See :ref:`here<issue-table-columns>` for the individual field + * descriptions depending on the issue kind. The values need to be interpreted + * according to their columntype. + * + * <p>This only contains a subset of the complete data if paging is enabled via + * ``offset`` and ``limit``. + */ + std::vector<std::map<QString, Any>> rows; + + /** + * <p>The total number of issues. + * + * <p>Only available when ``computeTotalRowCount`` was specified as ``true``. + * Mostly useful when doing paged queries using the query parameters ``limit`` + * and ``offset``. + */ + std::optional<qint32> totalRowCount; + + /** + * <p>The total number of issues existing in the ``current`` version and not in + * the ``baseline`` version. + * + * <p>Only useful in diff queries and only calculated when + * ``computeTotalRowCount`` was specified as ``true``. + */ + std::optional<qint32> totalAddedCount; + + /** + * <p>The total number of issues existing in the ``baseline`` version and not in + * the ``current`` version. + * + * <p>Only useful in diff queries and only calculated when + * ``computeTotalRowCount`` was specified as ``true``. + */ + std::optional<qint32> totalRemovedCount; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTableDto deserialize(const QByteArray &json); + + IssueTableDto( + std::optional<AnalysisVersionDto> startVersion, + AnalysisVersionDto endVersion, + std::optional<QString> tableViewUrl, + std::optional<std::vector<ColumnInfoDto>> columns, + std::vector<std::map<QString, Any>> rows, + std::optional<qint32> totalRowCount, + std::optional<qint32> totalAddedCount, + std::optional<qint32> totalRemovedCount + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains a list of metric descriptions + */ + class MetricListDto : public Serializable + { + public: + + /** + * Describes the version of analysis data of a certain Project. + * + * <p>The version this metric list was queried with. + */ + std::optional<AnalysisVersionDto> version; + + + std::vector<MetricDto> metrics; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static MetricListDto deserialize(const QByteArray &json); + + MetricListDto( + std::optional<AnalysisVersionDto> version, + std::vector<MetricDto> metrics + ); + + virtual QByteArray serialize() const override; + }; + + /** + * The result of a metric values query + */ + class MetricValueRangeDto : public Serializable + { + public: + + /** + * Describes the version of analysis data of a certain Project. + * + * <p>The start version of the metric value range. + */ + AnalysisVersionDto startVersion; + + /** + * Describes the version of analysis data of a certain Project. + * + * <p>The end version of the metric value range. + */ + AnalysisVersionDto endVersion; + + /** + * <p>The id of the entity + */ + QString entity; + + /** + * <p>The id of the metric + */ + QString metric; + + /** + * <p>An array with the metric values. + * + * <p>The array size is ``endVersion.index - startVersion.index + 1``. + * Its values are numbers or ``null`` if no value is available. + * They correspond to the range defined by ``startVersion`` and ``endVersion``. + */ + std::vector<std::optional<double>> values; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static MetricValueRangeDto deserialize(const QByteArray &json); + + MetricValueRangeDto( + AnalysisVersionDto startVersion, + AnalysisVersionDto endVersion, + QString entity, + QString metric, + std::vector<std::optional<double>> values + ); + + virtual QByteArray serialize() const override; + }; + + /** + * The result of a metric value table query + */ + class MetricValueTableDto : public Serializable + { + public: + + /** + * <p>The column descriptions of the entity columns. + * + * <p>Only contains the two fields ``key`` and ``header``. + */ + std::vector<ColumnInfoDto> columns; + + /** + * <p>The entity data. + */ + std::vector<MetricValueTableRowDto> rows; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static MetricValueTableDto deserialize(const QByteArray &json); + + MetricValueTableDto( + std::vector<ColumnInfoDto> columns, + std::vector<MetricValueTableRowDto> rows + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Named Filter Creation Request Data + * + * <p>Contains information to create a named filter from scratch + * + * @since 7.3.0 + */ + class NamedFilterCreateDto : public Serializable + { + public: + + + QString displayName; + + /** + * IssueKind for Named-Filter creation + * + * <p>one of ``AV``, ``CL``, ``CY``, ``DE``, ``MV``, ``SV``, ``UNIVERSAL`` + */ + QString kind; + + /** + * <p>The actual filters with column-id as key and filter-value as value + * + * <p>* Possible keys are described here :ref:`column keys<issue-table-columns>` + * * This does not necessarily contain an entry for every column. In fact it may even be empty. + * * A filter value can never be null. + * * May contain references to columns that do not exist in the table column configuration. + */ + std::map<QString, QString> filters; + + /** + * <p>Defines the sort order to apply. + * + * <p>* The first entry has the highest sort priority and the last one the lowest. + * * No column key may be referenced twice. + * * May contain references to columns that do not exist in the table column configuration. + */ + std::vector<SortInfoDto> sorters; + + /** + * NamedFilter visibility configuration + * + * <p>Only applicable for global named filters. + * + * <p>You may not have access to this information depending on your permissions. + * + * @since 7.3.0 + */ + std::optional<NamedFilterVisibilityDto> visibility; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterCreateDto deserialize(const QByteArray &json); + + NamedFilterCreateDto( + QString displayName, + QString kind, + std::map<QString, QString> filters, + std::vector<SortInfoDto> sorters, + std::optional<NamedFilterVisibilityDto> visibility + ); + + NamedFilterCreateDto( + QString displayName, + IssueKindForNamedFilterCreation kind, + std::map<QString, QString> filters, + std::vector<SortInfoDto> sorters, + std::optional<NamedFilterVisibilityDto> visibility + ); + + // Throws std::range_error + IssueKindForNamedFilterCreation getKindEnum() const; + + void setKindEnum(IssueKindForNamedFilterCreation newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * A Named Filter configuration. + * + * <p>It can consist of the following: + * - Filter values for the individual columns and the path-filter + * - A sort configuration indicating how to sort the table columns + * + * @since 6.9.0 + */ + class NamedFilterInfoDto : public Serializable + { + public: + + /** + * <p>Uniquely identifies this filter configuration. + */ + QString key; + + /** + * <p>The name to use when displaying this filter. + */ + QString displayName; + + /** + * <p>The URL for getting/updating/deleting this named filter. + * + * @since 7.3.0 + */ + std::optional<QString> url; + + /** + * <p>Whether this filter is a predefined filter. + */ + bool isPredefined; + + /** + * A named filter type + * + * <p>* `PREDEFINED` - Named filters of this type are immutable and exist out of the box and can be used by everyone + * * `GLOBAL` - Named filters of this type are usable by everyone and managed by the so called filter managers + * * `CUSTOM` - Named filters of this type are creatable by everyone but only visible to their owner + * + * @since 7.3.0 + */ + std::optional<QString> type; + + /** + * <p>Whether the user that requested this object can change or delete this filter configuration + */ + bool canWrite; + + /** + * <p>The actual filters with column-id as key and filter-value as value + * + * <p>* Possible keys are described here :ref:`column keys<issue-table-columns>` + * * This does not necessarily contain an entry for every column. In fact it may even be empty. + * * A filter value can never be null. + * * May contain references to columns that do not exist in the table column configuration. + */ + std::map<QString, QString> filters; + + /** + * <p>Defines the sort order to apply. + * + * <p>* The first entry has the highest sort priority and the last one the lowest. + * * No column key may be referenced twice. + * * May contain references to columns that do not exist in the table column configuration. + */ + std::optional<std::vector<SortInfoDto>> sorters; + + /** + * <p>True if this filter is valid for all issue kinds, false otherwise. + */ + bool supportsAllIssueKinds; + + /** + * <p>Supported Issue Kinds. + * + * <p>If ``supportsAllIssueKinds`` is false, then this set indicates, which issue kinds are supported. + */ + std::optional<std::unordered_set<QString>> issueKindRestrictions; + + /** + * NamedFilter visibility configuration + * + * <p>Only applicable for global named filters. + * + * <p>You may not have access to this information depending on your permissions. + * + * @since 7.3.0 + */ + std::optional<NamedFilterVisibilityDto> visibility; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterInfoDto deserialize(const QByteArray &json); + + NamedFilterInfoDto( + QString key, + QString displayName, + std::optional<QString> url, + bool isPredefined, + std::optional<QString> type, + bool canWrite, + std::map<QString, QString> filters, + std::optional<std::vector<SortInfoDto>> sorters, + bool supportsAllIssueKinds, + std::optional<std::unordered_set<QString>> issueKindRestrictions, + std::optional<NamedFilterVisibilityDto> visibility + ); + + NamedFilterInfoDto( + QString key, + QString displayName, + std::optional<QString> url, + bool isPredefined, + std::optional<NamedFilterType> type, + bool canWrite, + std::map<QString, QString> filters, + std::optional<std::vector<SortInfoDto>> sorters, + bool supportsAllIssueKinds, + std::optional<std::unordered_set<QString>> issueKindRestrictions, + std::optional<NamedFilterVisibilityDto> visibility + ); + + // Throws std::range_error + std::optional<NamedFilterType> getTypeEnum() const; + + void setTypeEnum(std::optional<NamedFilterType> newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Named Filter Update Request Data + * + * <p>Contains information to update an existing named filter. + * Fields that are not given, won't be touched. + * + * @since 7.3.0 + */ + class NamedFilterUpdateDto : public Serializable + { + public: + + /** + * <p>An optional new name for the named filter. + * + * <p>Changing this will also result in a changed ID and URL. + */ + std::optional<QString> name; + + /** + * <p>The actual filters with column-id as key and filter-value as value + * + * <p>* Possible keys are described here :ref:`column keys<issue-table-columns>` + * * This does not necessarily contain an entry for every column. In fact it may even be empty. + * * A filter value can never be null. + * * May contain references to columns that do not exist in the table column configuration. + */ + std::optional<std::map<QString, QString>> filters; + + /** + * <p>Defines the sort order to apply. + * + * <p>* The first entry has the highest sort priority and the last one the lowest. + * * No column key may be referenced twice. + * * May contain references to columns that do not exist in the table column configuration. + */ + std::optional<std::vector<SortInfoDto>> sorters; + + /** + * NamedFilter visibility configuration + * + * <p>Only applicable for global named filters. + * + * <p>You may not have access to this information depending on your permissions. + * + * @since 7.3.0 + */ + std::optional<NamedFilterVisibilityDto> visibility; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterUpdateDto deserialize(const QByteArray &json); + + NamedFilterUpdateDto( + std::optional<QString> name, + std::optional<std::map<QString, QString>> filters, + std::optional<std::vector<SortInfoDto>> sorters, + std::optional<NamedFilterVisibilityDto> visibility + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Information about a project + */ + class ProjectInfoDto : public Serializable + { + public: + + /** + * <p>The name of the project. Use this string to refer to the project. + */ + QString name; + + /** + * <p>A host-relative URL that can be used to display filter-help meant for humans. + * + * @since 6.5.0 + */ + std::optional<QString> issueFilterHelp; + + /** + * <p>URL to query the table meta data (column definitions). Needs the issue kind as a query parameter ``kind``. + * + * @since 6.9.0 + */ + std::optional<QString> tableMetaUri; + + /** + * <p>List of users associated with the project and visible to the authenticated user. + */ + std::vector<UserRefDto> users; + + /** + * <p>List of analysis versions associated with the project. + */ + std::vector<AnalysisVersionDto> versions; + + /** + * <p>List of IssueKinds associated with the project. + */ + std::vector<IssueKindInfoDto> issueKinds; + + /** + * <p>Whether or not the project has hidden issues. When this is false then UI should try to hide all the complexity related with hidden issues. + */ + bool hasHiddenIssues; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ProjectInfoDto deserialize(const QByteArray &json); + + ProjectInfoDto( + QString name, + std::optional<QString> issueFilterHelp, + std::optional<QString> tableMetaUri, + std::vector<UserRefDto> users, + std::vector<AnalysisVersionDto> versions, + std::vector<IssueKindInfoDto> issueKinds, + bool hasHiddenIssues + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Response to Repository Update Request + * + * <p>Contains messages returned from the VCS-adapters reporting on + * the VCS update result. + */ + class RepositoryUpdateResponseDto : public Serializable + { + public: + + /** + * <p>The messages returned from the VCS-adapters + */ + std::vector<RepositoryUpdateMessageDto> messages; + + /** + * <p>Whether at least one of the messages is at least an ERROR + */ + bool hasErrors; + + /** + * <p>Whether at least one of the messages is at least a WARNING + */ + bool hasWarnings; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static RepositoryUpdateResponseDto deserialize(const QByteArray &json); + + RepositoryUpdateResponseDto( + std::vector<RepositoryUpdateMessageDto> messages, + bool hasErrors, + bool hasWarnings + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains meta information for issuelist querying of a specific issue kind. + * + * @since 6.9.0 + */ + class TableInfoDto : public Serializable + { + public: + + /** + * <p>Host-relative URL to query the rows of the issue table. + * + * <p>Needs get parameters to specify which data is requested exactly. + */ + QString tableDataUri; + + /** + * <p>Host-relative URL base to view an issue in the dashboard. + * + * <p>In order to construct the issue URL it is necessary to append the issue-id (e.g. SV123) + * to the URL path. Also the query-parameter is not part of the URL base and can be added. + * + * @since 7.2.1 + */ + std::optional<QString> issueBaseViewUri; + + /** + * <p>Columns with detailed information on how to create a table to display the data. + */ + std::vector<ColumnInfoDto> columns; + + /** + * <p>The ``Named Filters`` available for the chosen issue kind. + * + * <p>This will contain predefined and custom filter configurations and never be empty. + * + * <p>The list order is a recommendation for UI display. + */ + std::vector<NamedFilterInfoDto> filters; + + /** + * <p>The key of the configured default filter. + * + * <p>This will not be given if the configured default is not also visible + * to the requesting user. + */ + std::optional<QString> userDefaultFilter; + + /** + * <p>The key of the factory default filter. + * + * <p>This will always point to an existing and visible named filter. + */ + QString axivionDefaultFilter; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static TableInfoDto deserialize(const QByteArray &json); + + TableInfoDto( + QString tableDataUri, + std::optional<QString> issueBaseViewUri, + std::vector<ColumnInfoDto> columns, + std::vector<NamedFilterInfoDto> filters, + std::optional<QString> userDefaultFilter, + QString axivionDefaultFilter + ); + + virtual QByteArray serialize() const override; + }; + +} From d6068c3ce5fa9e53a0eba93594b8481b6f449c8c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 15 Aug 2023 13:05:06 +0200 Subject: [PATCH 0712/1777] TaskTree: Make TreeStorage final Allow TreeStorageBase to be subclasses only by TreeStorage. Change-Id: I6e119d6b6f2f99cc7846752cf55f9fb92f3834c7 Reviewed-by: hjk <hjk@qt.io> --- src/libs/solutions/tasking/tasktree.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h index 94db0d7c7ea..9478ac10250 100644 --- a/src/libs/solutions/tasking/tasktree.h +++ b/src/libs/solutions/tasking/tasktree.h @@ -41,14 +41,13 @@ class TASKING_EXPORT TreeStorageBase public: bool isValid() const; -protected: +private: using StorageConstructor = std::function<void *(void)>; using StorageDestructor = std::function<void(void *)>; TreeStorageBase(StorageConstructor ctor, StorageDestructor dtor); void *activeStorageVoid() const; -private: int createStorage() const; void deleteStorage(int id) const; void activateStorage(int id) const; @@ -71,13 +70,15 @@ private: int m_storageCounter = 0; }; QSharedPointer<StorageData> m_storageData; + + template <typename StorageStruct> friend class TreeStorage; friend ExecutionContextActivator; friend TaskContainer; friend TaskTreePrivate; }; template <typename StorageStruct> -class TreeStorage : public TreeStorageBase +class TreeStorage final : public TreeStorageBase { public: TreeStorage() : TreeStorageBase(TreeStorage::ctor(), TreeStorage::dtor()) {} From 876d9fb1e07adaef876c4e1958c9a0ac17d2012c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 15 Aug 2023 14:14:00 +0200 Subject: [PATCH 0713/1777] ProjectExplorer: Separate KitAspectFactory storage from live kits Change-Id: Ic4d4f4938a11e209c31dcba73d1a793d359fe135 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/projectexplorer/kitmanager.cpp | 70 ++++++++++------------ src/plugins/projectexplorer/kitmanager.h | 4 -- 2 files changed, 32 insertions(+), 42 deletions(-) diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 786d1c48623..011e9ccc7db 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -66,15 +66,9 @@ static FilePath settingsFileName() // KitManagerPrivate: // -------------------------------------------------------------------------- -class KitManagerPrivate +class KitAspectFactories { public: - Kit *m_defaultKit = nullptr; - bool m_initialized = false; - std::vector<std::unique_ptr<Kit>> m_kitList; - std::unique_ptr<PersistentSettingsWriter> m_writer; - QSet<Id> m_irrelevantAspects; - void addKitAspect(KitAspectFactory *factory) { QTC_ASSERT(!m_aspectList.contains(factory), return); @@ -99,15 +93,31 @@ public: return m_aspectList; } - void setBinaryForKit(const FilePath &fp) { m_binaryForKit = fp; } - FilePath binaryForKit() const { return m_binaryForKit; } - -private: // Sorted by priority, in descending order... QList<KitAspectFactory *> m_aspectList; // ... if this here is set: bool m_aspectListIsSorted = true; +}; +static KitAspectFactories &kitAspectFactoriesStorage() +{ + static KitAspectFactories theKitAspectFactories; + return theKitAspectFactories; +} + +class KitManagerPrivate +{ +public: + Kit *m_defaultKit = nullptr; + bool m_initialized = false; + std::vector<std::unique_ptr<Kit>> m_kitList; + std::unique_ptr<PersistentSettingsWriter> m_writer; + QSet<Id> m_irrelevantAspects; + + void setBinaryForKit(const FilePath &fp) { m_binaryForKit = fp; } + FilePath binaryForKit() const { return m_binaryForKit; } + +private: FilePath m_binaryForKit; }; @@ -450,29 +460,6 @@ bool KitManager::isLoaded() return d->m_initialized; } -void KitManager::registerKitAspect(KitAspectFactory *factory) -{ - instance(); - QTC_ASSERT(d, return); - d->addKitAspect(factory); - - // Adding this aspect to possibly already existing kits is currently not - // needed here as kits are only created after all aspects are created - // in *Plugin::initialize(). - // Make sure we notice when this assumption breaks: - QTC_CHECK(d->m_kitList.empty()); -} - -void KitManager::deregisterKitAspect(KitAspectFactory *factory) -{ - // Happens regularly for the aspects from the ProjectExplorerPlugin as these - // are destroyed after the manual call to KitManager::destroy() there, but as - // this here is just for sanity reasons that the KitManager does not access - // a destroyed aspect, a destroyed KitManager is not a problem. - if (d) - d->removeKitAspect(factory); -} - void KitManager::setBinaryForKit(const FilePath &binary) { QTC_ASSERT(d, return); @@ -575,7 +562,7 @@ Kit *KitManager::defaultKit() const QList<KitAspectFactory *> KitManager::kitAspectFactories() { - return d->kitAspectFactories(); + return kitAspectFactoriesStorage().m_aspectList; } const QSet<Id> KitManager::irrelevantAspects() @@ -648,7 +635,7 @@ void KitManager::completeKit(Kit *k) { QTC_ASSERT(k, return); KitGuard g(k); - for (KitAspectFactory *factory : d->kitAspectFactories()) { + for (KitAspectFactory *factory : kitAspectFactories()) { factory->upgrade(k); if (!k->hasValue(factory->id())) factory->setup(k); @@ -663,12 +650,19 @@ void KitManager::completeKit(Kit *k) KitAspectFactory::KitAspectFactory() { - KitManager::registerKitAspect(this); + kitAspectFactoriesStorage().addKitAspect(this); + + // Adding aspects created by this factory to possibly already existing kits is + // currently not needed here as kits are only created after all factories + // are created in *Plugin::initialize() or plugin load. + // Make sure we notice when this assumption breaks: + KitManager::instance(); // Ensure existence + QTC_CHECK(d->m_kitList.empty()); } KitAspectFactory::~KitAspectFactory() { - KitManager::deregisterKitAspect(this); + kitAspectFactoriesStorage().removeKitAspect(this); } int KitAspectFactory::weight(const Kit *k) const diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index 1fe676ed6b3..284683e7e34 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -173,9 +173,6 @@ private: static void destroy(); - static void registerKitAspect(KitAspectFactory *ki); - static void deregisterKitAspect(KitAspectFactory *ki); - static void setBinaryForKit(const Utils::FilePath &binary); // Make sure the this is only called after all @@ -188,7 +185,6 @@ private: friend class ProjectExplorerPlugin; // for constructor friend class Kit; friend class Internal::KitManagerConfigWidget; - friend class KitAspectFactory; // for notifyAboutUpdate and self-registration }; } // namespace ProjectExplorer From b0d5e44235bcc87dee759bd8abc38134b60e3fcb Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 15 Aug 2023 10:43:28 +0200 Subject: [PATCH 0714/1777] Utils: Add Password display to StringAspect Task-number: QTCREATORBUG-29485 Change-Id: I8da46be4c63f97595aa1e93b6ac4905bdbb54799 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 19 +++++++++++++++++++ src/libs/utils/aspects.h | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 7742edc4d91..7092ded9f40 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -8,6 +8,7 @@ #include "environment.h" #include "fancylineedit.h" #include "layoutbuilder.h" +#include "passworddialog.h" #include "pathchooser.h" #include "qtcassert.h" #include "qtcolorbutton.h" @@ -777,6 +778,7 @@ public: QString m_historyCompleterKey; QPointer<ElidingLabel> m_labelDisplay; QPointer<FancyLineEdit> m_lineEditDisplay; + QPointer<ShowPasswordButton> m_showPasswordButton; QPointer<QTextEdit> m_textEditDisplay; MacroExpanderProvider m_expanderProvider; StringAspect::ValueAcceptor m_valueAcceptor; @@ -856,6 +858,9 @@ public: \value PathChooserDisplay Based on Utils::PathChooser. + \value PasswordLineEditDisplay + Based on QLineEdit, used for password strings + \sa Utils::PathChooser */ @@ -1047,6 +1052,7 @@ void StringAspect::addToLayout(LayoutItem &parent) const QString displayedString = d->m_displayFilter ? d->m_displayFilter(value()) : value(); switch (d->m_displayStyle) { + case PasswordLineEditDisplay: case LineEditDisplay: d->m_lineEditDisplay = createSubWidget<FancyLineEdit>(); d->m_lineEditDisplay->setPlaceholderText(d->m_placeHolderText); @@ -1081,6 +1087,19 @@ void StringAspect::addToLayout(LayoutItem &parent) connect(d->m_lineEditDisplay, &QLineEdit::textEdited, this, &StringAspect::handleGuiChanged); } + if (d->m_displayStyle == PasswordLineEditDisplay) { + d->m_showPasswordButton = createSubWidget<ShowPasswordButton>(); + d->m_lineEditDisplay->setEchoMode(QLineEdit::PasswordEchoOnEdit); + parent.addItem(d->m_showPasswordButton); + connect(d->m_showPasswordButton, + &ShowPasswordButton::toggled, + d->m_lineEditDisplay, + [this] { + d->m_lineEditDisplay->setEchoMode(d->m_showPasswordButton->isChecked() + ? QLineEdit::Normal + : QLineEdit::PasswordEchoOnEdit); + }); + } break; case TextEditDisplay: d->m_textEditDisplay = createSubWidget<QTextEdit>(); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 3d7b3ca84a9..352d0f84f8b 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -545,7 +545,8 @@ public: enum DisplayStyle { LabelDisplay, LineEditDisplay, - TextEditDisplay + TextEditDisplay, + PasswordLineEditDisplay, }; void setDisplayStyle(DisplayStyle style); From 123793fbb18254a1a15c782444b0bf357ea538c1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 15 Aug 2023 14:14:16 +0200 Subject: [PATCH 0715/1777] Utils: Add an 'If' LayoutItem Change-Id: I700e28d03b6dc39e96fa969152f236760989bdb7 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/layoutbuilder.cpp | 7 +++++++ src/libs/utils/layoutbuilder.h | 6 ++++++ tests/manual/layoutbuilder/demo/main.cpp | 14 +++++++++++--- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/layoutbuilder.cpp b/src/libs/utils/layoutbuilder.cpp index a45469882e8..6f10220aaf1 100644 --- a/src/libs/utils/layoutbuilder.cpp +++ b/src/libs/utils/layoutbuilder.cpp @@ -819,6 +819,13 @@ Tab::Tab(const QString &tabName, const LayoutItem &item) }; } +// Special If + +If::If(bool condition, const LayoutItems &items, const LayoutItems &other) +{ + subItems.append(condition ? items : other); +} + // Special Application Application::Application(std::initializer_list<LayoutItem> items) diff --git a/src/libs/utils/layoutbuilder.h b/src/libs/utils/layoutbuilder.h index 63eeee34d50..c9fac7d8383 100644 --- a/src/libs/utils/layoutbuilder.h +++ b/src/libs/utils/layoutbuilder.h @@ -141,6 +141,12 @@ public: Tab(const QString &tabName, const LayoutItem &item); }; +class QTCREATOR_UTILS_EXPORT If : public LayoutItem +{ +public: + If(bool condition, const LayoutItems &item, const LayoutItems &other = {}); +}; + class QTCREATOR_UTILS_EXPORT Group : public LayoutItem { public: diff --git a/tests/manual/layoutbuilder/demo/main.cpp b/tests/manual/layoutbuilder/demo/main.cpp index 2dd95dfddbf..586a572a9b4 100644 --- a/tests/manual/layoutbuilder/demo/main.cpp +++ b/tests/manual/layoutbuilder/demo/main.cpp @@ -17,9 +17,17 @@ int main(int argc, char *argv[]) title("Hello World"), Column { - TextEdit { - id(textId), - text("Hallo") + If { false, { + TextEdit { + id(textId), + text("Hallo") + }, + }, { + TextEdit { + id(textId), + text("Och noe") + }, + } }, Row { From bc1ab260b42383de0ba72921161c22acb4b74517 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 15 Aug 2023 08:40:46 +0200 Subject: [PATCH 0716/1777] Utils: Add password input dialog Task-number: QTCREATORBUG-29485 Change-Id: I2b55e7d39f848f1c89d3a365a2cadd44e8aac97c Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/CMakeLists.txt | 1 + src/libs/utils/passworddialog.cpp | 204 ++++++++++++++++++++++++++++++ src/libs/utils/passworddialog.h | 68 ++++++++++ src/libs/utils/utils.qbs | 4 +- 4 files changed, 276 insertions(+), 1 deletion(-) create mode 100644 src/libs/utils/passworddialog.cpp create mode 100644 src/libs/utils/passworddialog.h diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 1885bc013ad..d1ad5ee298b 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -114,6 +114,7 @@ add_qtc_library(Utils overlaywidget.cpp overlaywidget.h overridecursor.cpp overridecursor.h parameteraction.cpp parameteraction.h + passworddialog.cpp passworddialog.h pathchooser.cpp pathchooser.h pathlisteditor.cpp pathlisteditor.h persistentsettings.cpp persistentsettings.h diff --git a/src/libs/utils/passworddialog.cpp b/src/libs/utils/passworddialog.cpp new file mode 100644 index 00000000000..3d2f0853ccd --- /dev/null +++ b/src/libs/utils/passworddialog.cpp @@ -0,0 +1,204 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "passworddialog.h" + +#include "layoutbuilder.h" +#include "stylehelper.h" +#include "utilsicons.h" +#include "utilstr.h" + +#include <QAbstractButton> +#include <QCheckBox> +#include <QDialogButtonBox> +#include <QEnterEvent> +#include <QLineEdit> +#include <QPainter> + +namespace Utils { + +ShowPasswordButton::ShowPasswordButton(QWidget *parent) + : QAbstractButton(parent) +{ + setAttribute(Qt::WA_Hover); + setCheckable(true); + setToolTip(Tr::tr("Show/hide password")); +} + +void ShowPasswordButton::paintEvent(QPaintEvent *e) +{ + Q_UNUSED(e); + QIcon icon = isChecked() ? Utils::Icons::EYE_OPEN_TOOLBAR.icon() + : Utils::Icons::EYE_CLOSED_TOOLBAR.icon(); + QPainter p(this); + QRect r(QPoint(), size()); + + if (m_containsMouse) + StyleHelper::drawPanelBgRect(&p, r, creatorTheme()->color(Theme::FancyToolButtonHoverColor)); + + QWindow *window = this->window()->windowHandle(); + QSize s = icon.actualSize(window, QSize(32, 16)); + + QPixmap px = icon.pixmap(s); + QRect iRect(QPoint(), s); + iRect.moveCenter(r.center()); + p.drawPixmap(iRect, px); +} + +void ShowPasswordButton::enterEvent(QEnterEvent *e) +{ + m_containsMouse = true; + e->accept(); + update(); +} + +void ShowPasswordButton::leaveEvent(QEvent *e) +{ + m_containsMouse = false; + e->accept(); + update(); +} + +QSize ShowPasswordButton::sizeHint() const +{ + QWindow *window = this->window()->windowHandle(); + QSize s = Utils::Icons::EYE_OPEN_TOOLBAR.icon().actualSize(window, QSize(32, 16)) + QSize(8, 8); + + if (StyleHelper::toolbarStyle() == StyleHelper::ToolbarStyleRelaxed) + s += QSize(5, 5); + + return s; +} + +class PasswordDialogPrivate +{ +public: + QLineEdit *m_userNameLineEdit{nullptr}; + QLineEdit *m_passwordLineEdit{nullptr}; + QCheckBox *m_checkBox{nullptr}; + QDialogButtonBox *m_buttonBox{nullptr}; +}; + +PasswordDialog::PasswordDialog(const QString &title, + const QString &prompt, + const QString &doNotAskAgainLabel, + bool withUsername, + QWidget *parent) + : QDialog(parent) + , d(new PasswordDialogPrivate) +{ + setWindowTitle(title); + + d->m_passwordLineEdit = new QLineEdit(); + d->m_passwordLineEdit->setEchoMode(QLineEdit::Password); + + if (withUsername) + d->m_userNameLineEdit = new QLineEdit(); + + d->m_checkBox = new QCheckBox(); + d->m_checkBox->setText(doNotAskAgainLabel); + + auto *showPasswordButton = new ShowPasswordButton; + + connect(showPasswordButton, &QAbstractButton::toggled, this, [this, showPasswordButton] { + d->m_passwordLineEdit->setEchoMode(showPasswordButton->isChecked() ? QLineEdit::Normal + : QLineEdit::Password); + }); + + d->m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + + connect(d->m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); + connect(d->m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); + + using namespace Layouting; + + // clang-format off + Column { + prompt, + If { + withUsername, { + Form { + Tr::tr("User:"), d->m_userNameLineEdit, br, + Tr::tr("Password:"), Row { d->m_passwordLineEdit, showPasswordButton }, br, + } + }, { + Row { + d->m_passwordLineEdit, showPasswordButton, + }, + } + }, + Row { + d->m_checkBox, + d->m_buttonBox, + } + }.attachTo(this); + // clang-format on + + d->m_passwordLineEdit->setMinimumWidth(d->m_passwordLineEdit->width() / 2); + setFixedSize(sizeHint()); +} + +PasswordDialog::~PasswordDialog() = default; + +void PasswordDialog::setUser(const QString &user) +{ + QTC_ASSERT(d->m_userNameLineEdit, return); + d->m_userNameLineEdit->setText(user); +} + +QString PasswordDialog::user() const +{ + QTC_ASSERT(d->m_userNameLineEdit, return {}); + return d->m_userNameLineEdit->text(); +} + +QString PasswordDialog::password() const +{ + return d->m_passwordLineEdit->text(); +} + +std::optional<QPair<QString, QString>> PasswordDialog::getUserAndPassword( + const QString &title, + const QString &prompt, + const QString &doNotAskAgainLabel, + const QString &userName, + const CheckableDecider &decider, + QWidget *parent) +{ + if (!decider.shouldAskAgain()) + return std::nullopt; + + PasswordDialog dialog(title, prompt, doNotAskAgainLabel, true, parent); + + dialog.setUser(userName); + + if (dialog.exec() == QDialog::Accepted) + return qMakePair(dialog.user(), dialog.password()); + + if (dialog.d->m_checkBox->isChecked()) + decider.doNotAskAgain(); + + return std::nullopt; +} + +std::optional<QString> PasswordDialog::getPassword(const QString &title, + const QString &prompt, + const QString &doNotAskAgainLabel, + const CheckableDecider &decider, + QWidget *parent) +{ + if (!decider.shouldAskAgain()) + return std::nullopt; + + PasswordDialog dialog(title, prompt, doNotAskAgainLabel, false, parent); + + if (dialog.exec() == QDialog::Accepted) + return dialog.password(); + + if (dialog.d->m_checkBox->isChecked()) + decider.doNotAskAgain(); + + return std::nullopt; +} + +} // namespace Utils diff --git a/src/libs/utils/passworddialog.h b/src/libs/utils/passworddialog.h new file mode 100644 index 00000000000..a3cdb98b0f6 --- /dev/null +++ b/src/libs/utils/passworddialog.h @@ -0,0 +1,68 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "utils_global.h" + +#include "checkablemessagebox.h" + +#include <QAbstractButton> +#include <QDialog> + +#include <memory> +#include <optional> + +namespace Utils { + +class PasswordDialogPrivate; + +class QTCREATOR_UTILS_EXPORT ShowPasswordButton : public QAbstractButton +{ +public: + ShowPasswordButton(QWidget *parent = nullptr); + + void paintEvent(QPaintEvent *e) override; + void enterEvent(QEnterEvent *e) override; + void leaveEvent(QEvent *e) override; + + QSize sizeHint() const override; + +private: + bool m_containsMouse{false}; +}; + +class QTCREATOR_UTILS_EXPORT PasswordDialog : public QDialog +{ +public: + PasswordDialog(const QString &title, + const QString &prompt, + const QString &doNotAskAgainLabel, + bool withUsername, + QWidget *parent = nullptr); + virtual ~PasswordDialog(); + + void setUser(const QString &user); + QString user() const; + + QString password() const; + + static std::optional<QPair<QString, QString>> getUserAndPassword( + const QString &title, + const QString &prompt, + const QString &doNotAskAgainLabel, + const QString &userName, + const CheckableDecider &decider, + QWidget *parent = nullptr); + + static std::optional<QString> getPassword(const QString &title, + const QString &prompt, + const QString &doNotAskAgainLabel, + const CheckableDecider &decider, + QWidget *parent = nullptr); + +private: + std::unique_ptr<PasswordDialogPrivate> d; +}; + +} // namespace Utils diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index fc59852fab1..0dcda50bbae 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -220,18 +220,20 @@ Project { "overridecursor.h", "parameteraction.cpp", "parameteraction.h", + "passworddialog.cpp", + "passworddialog.h", "pathchooser.cpp", "pathchooser.h", "pathlisteditor.cpp", "pathlisteditor.h", "persistentsettings.cpp", "persistentsettings.h", - "predicates.h", "pointeralgorithm.h", "port.cpp", "port.h", "portlist.cpp", "portlist.h", + "predicates.h", "process.cpp", "process.h", "processenums.h", From 013b71b301ff8c00508fefb0a2dac0757bd206c4 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 15 Aug 2023 14:24:32 +0200 Subject: [PATCH 0717/1777] Utils: Allow cascaded aspect "setEnabler" Change-Id: I4e519c0ef27460b42c4e44a755e5e6cbbf49ebdf Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 24 ++++++++++++++++-------- src/libs/utils/aspects.h | 1 + 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 7092ded9f40..9268d325860 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -299,11 +299,16 @@ bool BaseAspect::isEnabled() const void BaseAspect::setEnabled(bool enabled) { - d->m_enabled = enabled; for (QWidget *w : std::as_const(d->m_subWidgets)) { QTC_ASSERT(w, continue); w->setEnabled(enabled); } + + if (enabled == d->m_enabled) + return; + + d->m_enabled = enabled; + emit enabledChanged(); } /*! @@ -312,13 +317,16 @@ void BaseAspect::setEnabled(bool enabled) void BaseAspect::setEnabler(BoolAspect *checker) { QTC_ASSERT(checker, return); - setEnabled(checker->value()); - connect(checker, &BoolAspect::volatileValueChanged, this, [this, checker] { - BaseAspect::setEnabled(checker->volatileValue()); - }); - connect(checker, &BoolAspect::changed, this, [this, checker] { - BaseAspect::setEnabled(checker->volatileValue()); - }); + + auto update = [this, checker] { + BaseAspect::setEnabled(checker->isEnabled() && checker->volatileValue()); + }; + + connect(checker, &BoolAspect::volatileValueChanged, this, update); + connect(checker, &BoolAspect::changed, this, update); + connect(checker, &BaseAspect::enabledChanged, this, update); + + update(); } bool BaseAspect::isReadOnly() const diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 352d0f84f8b..b460356851a 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -187,6 +187,7 @@ signals: void volatileValueChanged(); void labelLinkActivated(const QString &link); void checkedChanged(); + void enabledChanged(); protected: virtual bool internalToBuffer(); From 5aa138bb6841ef043a779daa952a236484e89d50 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 15 Aug 2023 12:45:54 +0200 Subject: [PATCH 0718/1777] ProjectExplorer: Hide some KitAspectFactory implementations Change-Id: If84dd7aeb72e87d2cb35635689ad1c9c2e09a825 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/projectexplorer/kitaspects.cpp | 132 +++++++++++++++- src/plugins/projectexplorer/kitaspects.h | 148 +----------------- .../projectexplorer/projectexplorer.cpp | 7 - 3 files changed, 138 insertions(+), 149 deletions(-) diff --git a/src/plugins/projectexplorer/kitaspects.cpp b/src/plugins/projectexplorer/kitaspects.cpp index 9fa4abd502a..4175ebceb3c 100644 --- a/src/plugins/projectexplorer/kitaspects.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -87,6 +87,17 @@ private: }; } // namespace Internal +class SysRootKitAspectFactory : public KitAspectFactory +{ +public: + SysRootKitAspectFactory(); + + Tasks validate(const Kit *k) const override; + KitAspect *createKitAspect(Kit *k) const override; + ItemList toUserOutput(const Kit *k) const override; + void addToMacroExpander(Kit *kit, MacroExpander *expander) const override; +}; + SysRootKitAspectFactory::SysRootKitAspectFactory() { setObjectName(QLatin1String("SysRootInformation")); @@ -141,7 +152,7 @@ void SysRootKitAspectFactory::addToMacroExpander(Kit *kit, MacroExpander *expand }); } -Utils::Id SysRootKitAspect::id() +Id SysRootKitAspect::id() { return "PE.Profile.SysRoot"; } @@ -179,6 +190,8 @@ void SysRootKitAspect::setSysRoot(Kit *k, const FilePath &v) k->setValue(SysRootKitAspect::id(), v.toString()); } +const SysRootKitAspectFactory theSyRootKitAspectFactory; + // -------------------------------------------------------------------------- // ToolChainKitAspect: // -------------------------------------------------------------------------- @@ -312,6 +325,35 @@ private: }; } // namespace Internal +class ToolChainKitAspectFactory : public KitAspectFactory +{ +public: + ToolChainKitAspectFactory(); + + Tasks validate(const Kit *k) const override; + void upgrade(Kit *k) override; + void fix(Kit *k) override; + void setup(Kit *k) override; + + KitAspect *createKitAspect(Kit *k) const override; + + QString displayNamePostfix(const Kit *k) const override; + + ItemList toUserOutput(const Kit *k) const override; + + void addToBuildEnvironment(const Kit *k, Environment &env) const override; + void addToRunEnvironment(const Kit *, Environment &) const override {} + + void addToMacroExpander(Kit *kit, MacroExpander *expander) const override; + QList<OutputLineParser *> createOutputParsers(const Kit *k) const override; + QSet<Id> availableFeatures(const Kit *k) const override; + +private: + void kitsWereLoaded(); + void toolChainUpdated(ToolChain *tc); + void toolChainRemoved(ToolChain *tc); +}; + ToolChainKitAspectFactory::ToolChainKitAspectFactory() { setObjectName(QLatin1String("ToolChainInformation")); @@ -751,6 +793,8 @@ void ToolChainKitAspectFactory::toolChainRemoved(ToolChain *tc) fix(k); } +const ToolChainKitAspectFactory thsToolChainKitAspectFactory; + // -------------------------------------------------------------------------- // DeviceTypeKitAspect: // -------------------------------------------------------------------------- @@ -803,6 +847,20 @@ private: }; } // namespace Internal +class DeviceTypeKitAspectFactory : public KitAspectFactory +{ +public: + DeviceTypeKitAspectFactory(); + + void setup(Kit *k) override; + Tasks validate(const Kit *k) const override; + KitAspect *createKitAspect(Kit *k) const override; + ItemList toUserOutput(const Kit *k) const override; + + QSet<Id> supportedPlatforms(const Kit *k) const override; + QSet<Id> availableFeatures(const Kit *k) const override; +}; + DeviceTypeKitAspectFactory::DeviceTypeKitAspectFactory() { setObjectName(QLatin1String("DeviceTypeInformation")); @@ -950,6 +1008,32 @@ private: }; } // namespace Internal +class DeviceKitAspectFactory : public KitAspectFactory +{ +public: + DeviceKitAspectFactory(); + + Tasks validate(const Kit *k) const override; + void fix(Kit *k) override; + void setup(Kit *k) override; + + KitAspect *createKitAspect(Kit *k) const override; + + QString displayNamePostfix(const Kit *k) const override; + + ItemList toUserOutput(const Kit *k) const override; + + void addToMacroExpander(Kit *kit, MacroExpander *expander) const override; + +private: + QVariant defaultValue(const Kit *k) const; + + void kitsWereLoaded(); + void deviceUpdated(Id dataId); + void devicesChanged(); + void kitUpdated(Kit *k); +}; + DeviceKitAspectFactory::DeviceKitAspectFactory() { setObjectName(QLatin1String("DeviceInformation")); @@ -1134,6 +1218,9 @@ void DeviceKitAspectFactory::devicesChanged() setup(k); // Set default device if necessary } +const DeviceKitAspectFactory theDeviceKitAspectFactory; + + // -------------------------------------------------------------------------- // BuildDeviceKitAspect: // -------------------------------------------------------------------------- @@ -1218,6 +1305,29 @@ private: }; } // namespace Internal +class BuildDeviceKitAspectFactory : public KitAspectFactory +{ +public: + BuildDeviceKitAspectFactory(); + + void setup(Kit *k) override; + Tasks validate(const Kit *k) const override; + + KitAspect *createKitAspect(Kit *k) const override; + + QString displayNamePostfix(const Kit *k) const override; + + ItemList toUserOutput(const Kit *k) const override; + + void addToMacroExpander(Kit *kit, MacroExpander *expander) const override; + +private: + void kitsWereLoaded(); + void deviceUpdated(Id dataId); + void devicesChanged(); + void kitUpdated(Kit *k); +}; + BuildDeviceKitAspectFactory::BuildDeviceKitAspectFactory() { setObjectName("BuildDeviceInformation"); @@ -1376,6 +1486,8 @@ void BuildDeviceKitAspectFactory::devicesChanged() setup(k); // Set default device if necessary } +const BuildDeviceKitAspectFactory theBuildDeviceKitAspectFactory; + // -------------------------------------------------------------------------- // EnvironmentKitAspect: // -------------------------------------------------------------------------- @@ -1490,6 +1602,22 @@ private: }; } // namespace Internal +class EnvironmentKitAspectFactory : public KitAspectFactory +{ +public: + EnvironmentKitAspectFactory(); + + Tasks validate(const Kit *k) const override; + void fix(Kit *k) override; + + void addToBuildEnvironment(const Kit *k, Environment &env) const override; + void addToRunEnvironment(const Kit *, Environment &) const override; + + KitAspect *createKitAspect(Kit *k) const override; + + ItemList toUserOutput(const Kit *k) const override; +}; + EnvironmentKitAspectFactory::EnvironmentKitAspectFactory() { setObjectName(QLatin1String("EnvironmentKitAspect")); @@ -1565,4 +1693,6 @@ void EnvironmentKitAspect::setEnvironmentChanges(Kit *k, const EnvironmentItems k->setValue(EnvironmentKitAspect::id(), EnvironmentItem::toStringList(changes)); } +const EnvironmentKitAspectFactory theEnvironmentKitAspectFactory; + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/kitaspects.h b/src/plugins/projectexplorer/kitaspects.h index 3acbcdf05ff..049116a21ee 100644 --- a/src/plugins/projectexplorer/kitaspects.h +++ b/src/plugins/projectexplorer/kitaspects.h @@ -10,17 +10,11 @@ #include <utils/environment.h> -#include <QVariant> - namespace ProjectExplorer { -class OutputTaskParser; + class ToolChain; -class KitAspect; - -// -------------------------------------------------------------------------- -// SysRootInformation: -// -------------------------------------------------------------------------- +// SysRootKitAspect class PROJECTEXPLORER_EXPORT SysRootKitAspect { @@ -30,20 +24,7 @@ public: static void setSysRoot(Kit *k, const Utils::FilePath &v); }; -class PROJECTEXPLORER_EXPORT SysRootKitAspectFactory : public KitAspectFactory -{ -public: - SysRootKitAspectFactory(); - - Tasks validate(const Kit *k) const override; - KitAspect *createKitAspect(Kit *k) const override; - ItemList toUserOutput(const Kit *k) const override; - void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override; -}; - -// -------------------------------------------------------------------------- -// ToolChainInformation: -// -------------------------------------------------------------------------- +// ToolChainKitAspect class PROJECTEXPLORER_EXPORT ToolChainKitAspect { @@ -62,38 +43,7 @@ public: static QString msgNoToolChainInTarget(); }; -class PROJECTEXPLORER_EXPORT ToolChainKitAspectFactory : public KitAspectFactory -{ -public: - ToolChainKitAspectFactory(); - - Tasks validate(const Kit *k) const override; - void upgrade(Kit *k) override; - void fix(Kit *k) override; - void setup(Kit *k) override; - - KitAspect *createKitAspect(Kit *k) const override; - - QString displayNamePostfix(const Kit *k) const override; - - ItemList toUserOutput(const Kit *k) const override; - - void addToBuildEnvironment(const Kit *k, Utils::Environment &env) const override; - void addToRunEnvironment(const Kit *, Utils::Environment &) const override {} - - void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override; - QList<Utils::OutputLineParser *> createOutputParsers(const Kit *k) const override; - QSet<Utils::Id> availableFeatures(const Kit *k) const override; - -private: - void kitsWereLoaded(); - void toolChainUpdated(ProjectExplorer::ToolChain *tc); - void toolChainRemoved(ProjectExplorer::ToolChain *tc); -}; - -// -------------------------------------------------------------------------- -// DeviceTypeInformation: -// -------------------------------------------------------------------------- +// DeviceTypeKitAspect class PROJECTEXPLORER_EXPORT DeviceTypeKitAspect { @@ -103,23 +53,7 @@ public: static void setDeviceTypeId(Kit *k, Utils::Id type); }; -class PROJECTEXPLORER_EXPORT DeviceTypeKitAspectFactory : public KitAspectFactory -{ -public: - DeviceTypeKitAspectFactory(); - - void setup(Kit *k) override; - Tasks validate(const Kit *k) const override; - KitAspect *createKitAspect(Kit *k) const override; - ItemList toUserOutput(const Kit *k) const override; - - QSet<Utils::Id> supportedPlatforms(const Kit *k) const override; - QSet<Utils::Id> availableFeatures(const Kit *k) const override; -}; - -// -------------------------------------------------------------------------- -// DeviceInformation: -// -------------------------------------------------------------------------- +// DeviceKitAspect class PROJECTEXPLORER_EXPORT DeviceKitAspect { @@ -132,35 +66,8 @@ public: static Utils::FilePath deviceFilePath(const Kit *k, const QString &pathOnDevice); }; -class PROJECTEXPLORER_EXPORT DeviceKitAspectFactory : public KitAspectFactory -{ -public: - DeviceKitAspectFactory(); - Tasks validate(const Kit *k) const override; - void fix(Kit *k) override; - void setup(Kit *k) override; - - KitAspect *createKitAspect(Kit *k) const override; - - QString displayNamePostfix(const Kit *k) const override; - - ItemList toUserOutput(const Kit *k) const override; - - void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override; - -private: - QVariant defaultValue(const Kit *k) const; - - void kitsWereLoaded(); - void deviceUpdated(Utils::Id dataId); - void devicesChanged(); - void kitUpdated(ProjectExplorer::Kit *k); -}; - -// -------------------------------------------------------------------------- -// BuildDeviceInformation: -// -------------------------------------------------------------------------- +// BuildDeviceKitAspect class PROJECTEXPLORER_EXPORT BuildDeviceKitAspect { @@ -172,32 +79,7 @@ public: static void setDeviceId(Kit *k, Utils::Id dataId); }; -class PROJECTEXPLORER_EXPORT BuildDeviceKitAspectFactory : public KitAspectFactory -{ -public: - BuildDeviceKitAspectFactory(); - - void setup(Kit *k) override; - Tasks validate(const Kit *k) const override; - - KitAspect *createKitAspect(Kit *k) const override; - - QString displayNamePostfix(const Kit *k) const override; - - ItemList toUserOutput(const Kit *k) const override; - - void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override; - -private: - void kitsWereLoaded(); - void deviceUpdated(Utils::Id dataId); - void devicesChanged(); - void kitUpdated(ProjectExplorer::Kit *k); -}; - -// -------------------------------------------------------------------------- -// EnvironmentKitAspect: -// -------------------------------------------------------------------------- +// EnvironmentKitAspect class PROJECTEXPLORER_EXPORT EnvironmentKitAspect { @@ -207,20 +89,4 @@ public: static void setEnvironmentChanges(Kit *k, const Utils::EnvironmentItems &changes); }; -class PROJECTEXPLORER_EXPORT EnvironmentKitAspectFactory : public KitAspectFactory -{ -public: - EnvironmentKitAspectFactory(); - - Tasks validate(const Kit *k) const override; - void fix(Kit *k) override; - - void addToBuildEnvironment(const Kit *k, Utils::Environment &env) const override; - void addToRunEnvironment(const Kit *, Utils::Environment &) const override; - - KitAspect *createKitAspect(Kit *k) const override; - - ItemList toUserOutput(const Kit *k) const override; -}; - } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index e7d990a568e..62c05eaceac 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -677,13 +677,6 @@ public: IDocumentFactory m_taskFileFactory; StopMonitoringHandler closeTaskFile; - DeviceTypeKitAspectFactory deviceTypeKitAspectFactory; - DeviceKitAspectFactory deviceKitAspectFactory; - BuildDeviceKitAspectFactory buildDeviceKitAspectFactory; - ToolChainKitAspectFactory toolChainKitAspectFactory; - SysRootKitAspectFactory sysRootKitAspectFactory; - EnvironmentKitAspectFactory environmentKitAspectFactory; - DesktopQmakeRunConfigurationFactory qmakeRunConfigFactory; QbsRunConfigurationFactory qbsRunConfigFactory; CMakeRunConfigurationFactory cmakeRunConfigFactory; From 0690b65abcc063de14d6eee5be9d398eda8d3aec Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 15 Aug 2023 17:43:42 +0200 Subject: [PATCH 0719/1777] LanguageServer: Compile fix for Qt 6.2 QLatin1StringView ist ein alias fuer QLatin1String, aber erst ab 6.4 Change-Id: I9b04d39722bf2707c327c6596a4bfe9ee719bae8 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/libs/languageserverprotocol/jsonobject.cpp | 4 ++-- src/libs/languageserverprotocol/jsonobject.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libs/languageserverprotocol/jsonobject.cpp b/src/libs/languageserverprotocol/jsonobject.cpp index 3fac8df20df..aed754a10f7 100644 --- a/src/libs/languageserverprotocol/jsonobject.cpp +++ b/src/libs/languageserverprotocol/jsonobject.cpp @@ -17,12 +17,12 @@ JsonObject &JsonObject::operator=(JsonObject &&other) QJsonObject::iterator JsonObject::insert(const std::string_view key, const JsonObject &object) { - return m_jsonObject.insert(QLatin1StringView(key), object.m_jsonObject); + return m_jsonObject.insert(QLatin1String(key), object.m_jsonObject); } QJsonObject::iterator JsonObject::insert(const std::string_view key, const QJsonValue &value) { - return m_jsonObject.insert(QLatin1StringView(key), value); + return m_jsonObject.insert(QLatin1String(key), value); } } // namespace LanguageServerProtocol diff --git a/src/libs/languageserverprotocol/jsonobject.h b/src/libs/languageserverprotocol/jsonobject.h index 2212c0a68f8..fd87d6c4663 100644 --- a/src/libs/languageserverprotocol/jsonobject.h +++ b/src/libs/languageserverprotocol/jsonobject.h @@ -52,11 +52,11 @@ protected: iterator insertVariant(const std::string_view key, const V &variant); // QJSonObject redirections - QJsonValue value(const std::string_view key) const { return m_jsonObject.value(QLatin1StringView(key)); } - bool contains(const std::string_view key) const { return m_jsonObject.contains(QLatin1StringView(key)); } - iterator find(const std::string_view key) { return m_jsonObject.find(QLatin1StringView(key)); } - const_iterator find(const std::string_view key) const { return m_jsonObject.find(QLatin1StringView(key)); } - void remove(const std::string_view key) { m_jsonObject.remove(QLatin1StringView(key)); } + QJsonValue value(const std::string_view key) const { return m_jsonObject.value(QLatin1String(key)); } + bool contains(const std::string_view key) const { return m_jsonObject.contains(QLatin1String(key)); } + iterator find(const std::string_view key) { return m_jsonObject.find(QLatin1String(key)); } + const_iterator find(const std::string_view key) const { return m_jsonObject.find(QLatin1String(key)); } + void remove(const std::string_view key) { m_jsonObject.remove(QLatin1String(key)); } QStringList keys() const { return m_jsonObject.keys(); } // convenience value access From f53e18ee7346db46d9dd3dfe566b00f8d34435a4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 28 Jul 2023 18:11:19 +0200 Subject: [PATCH 0720/1777] Test: Avoid some Id::withSuffix calls Saves cycles and is arguably clearer. Change-Id: Ib53207704806d4b6ea184633a15ab98fb2eeb89a Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/autotest/boost/boosttestconstants.h | 2 +- src/plugins/autotest/boost/boosttestframework.cpp | 7 +++---- src/plugins/autotest/boost/boosttestresult.cpp | 4 ++-- src/plugins/autotest/catch/catchtestframework.cpp | 2 +- src/plugins/autotest/ctest/ctesttool.cpp | 4 ++-- src/plugins/autotest/gtest/gtestconstants.h | 2 +- src/plugins/autotest/gtest/gtestframework.cpp | 10 ++++------ src/plugins/autotest/gtest/gtestresult.cpp | 3 +-- src/plugins/autotest/itestframework.cpp | 5 ----- src/plugins/autotest/itestframework.h | 7 +++---- src/plugins/autotest/qtest/qttestconstants.h | 2 +- src/plugins/autotest/qtest/qttestframework.cpp | 7 +++---- src/plugins/autotest/qtest/qttestresult.cpp | 8 ++++---- src/plugins/autotest/quick/quicktestframework.cpp | 2 +- src/plugins/autotest/quick/quicktestframework.h | 2 +- 15 files changed, 28 insertions(+), 39 deletions(-) diff --git a/src/plugins/autotest/boost/boosttestconstants.h b/src/plugins/autotest/boost/boosttestconstants.h index c56ca447a9d..8b8e668f04f 100644 --- a/src/plugins/autotest/boost/boosttestconstants.h +++ b/src/plugins/autotest/boost/boosttestconstants.h @@ -9,7 +9,7 @@ namespace Autotest { namespace BoostTest { namespace Constants { -const char FRAMEWORK_NAME[] = "Boost"; +const char FRAMEWORK_ID[] = "AutoTest.Framework.Boost"; const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("QtC::Autotest", "Boost Test"); const unsigned FRAMEWORK_PRIORITY = 11; const char BOOST_MASTER_SUITE[] = "Master Test Suite"; diff --git a/src/plugins/autotest/boost/boosttestframework.cpp b/src/plugins/autotest/boost/boosttestframework.cpp index 28c1b001be9..38f800357b4 100644 --- a/src/plugins/autotest/boost/boosttestframework.cpp +++ b/src/plugins/autotest/boost/boosttestframework.cpp @@ -28,7 +28,7 @@ BoostTestFramework::BoostTestFramework() { setActive(true); setSettingsGroups("Autotest", "BoostTest"); - setName(BoostTest::Constants::FRAMEWORK_NAME); + setId(BoostTest::Constants::FRAMEWORK_ID); setDisplayName(Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setPriority(BoostTest::Constants::FRAMEWORK_PRIORITY); @@ -144,9 +144,8 @@ class BoostSettingsPage final : public Core::IOptionsPage public: BoostSettingsPage() { - setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.%2") - .arg(BoostTest::Constants::FRAMEWORK_PRIORITY) - .arg(BoostTest::Constants::FRAMEWORK_NAME))); + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.Boost") + .arg(BoostTest::Constants::FRAMEWORK_PRIORITY))); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); setDisplayName(Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setSettingsProvider([] { return &theBoostTestFramework() ; }); diff --git a/src/plugins/autotest/boost/boosttestresult.cpp b/src/plugins/autotest/boost/boosttestresult.cpp index 80cca80cc4b..72d89dfcfe5 100644 --- a/src/plugins/autotest/boost/boosttestresult.cpp +++ b/src/plugins/autotest/boost/boosttestresult.cpp @@ -73,8 +73,8 @@ static ResultHooks::FindTestItemHook findTestItemHook(const FilePath &projectFil const QString &testSuiteName) { return [=](const TestResult &result) -> ITestTreeItem * { - const Id id = Id(Constants::FRAMEWORK_PREFIX).withSuffix(BoostTest::Constants::FRAMEWORK_NAME); - ITestFramework *framework = TestFrameworkManager::frameworkForId(id); + ITestFramework *framework = + TestFrameworkManager::frameworkForId(BoostTest::Constants::FRAMEWORK_ID); QTC_ASSERT(framework, return nullptr); const TestTreeItem *rootNode = framework->rootNode(); if (!rootNode) diff --git a/src/plugins/autotest/catch/catchtestframework.cpp b/src/plugins/autotest/catch/catchtestframework.cpp index b29a6aa7be6..8c312f65d15 100644 --- a/src/plugins/autotest/catch/catchtestframework.cpp +++ b/src/plugins/autotest/catch/catchtestframework.cpp @@ -29,7 +29,7 @@ CatchFramework::CatchFramework() setActive(true); setSettingsGroups("Autotest", "Catch2"); setPriority(12); - setName("Catch"); + setId("AutoTest.Framework.Catch"); setDisplayName(Tr::tr("Catch Test")); setLayouter([this] { diff --git a/src/plugins/autotest/ctest/ctesttool.cpp b/src/plugins/autotest/ctest/ctesttool.cpp index 885191eea23..2dee957194f 100644 --- a/src/plugins/autotest/ctest/ctesttool.cpp +++ b/src/plugins/autotest/ctest/ctesttool.cpp @@ -31,7 +31,7 @@ CTestTool::CTestTool() setActive(false); setSettingsGroups("Autotest", "CTest"); setAutoApply(false); - setName("CTest"); + setId("AutoTest.Framework.CTest"); setDisplayName(Tr::tr("CTest")); setLayouter([this] { @@ -171,7 +171,7 @@ class CTestToolSettingsPage final : public Core::IOptionsPage public: CTestToolSettingsPage() { - setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("255.CTest"))); + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix("255.CTest")); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); setDisplayName(Tr::tr("CTest")); setSettingsProvider([] { return &theCTestTool(); }); diff --git a/src/plugins/autotest/gtest/gtestconstants.h b/src/plugins/autotest/gtest/gtestconstants.h index 7d422e8df8b..e2a39b4b0df 100644 --- a/src/plugins/autotest/gtest/gtestconstants.h +++ b/src/plugins/autotest/gtest/gtestconstants.h @@ -9,7 +9,7 @@ namespace Autotest { namespace GTest { namespace Constants { -const char FRAMEWORK_NAME[] = "GTest"; +const char FRAMEWORK_ID[] = "Autotest.Framework.GTest"; const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("QtC::Autotest", "Google Test"); const unsigned FRAMEWORK_PRIORITY = 10; const char DEFAULT_FILTER[] = "*.*"; diff --git a/src/plugins/autotest/gtest/gtestframework.cpp b/src/plugins/autotest/gtest/gtestframework.cpp index 859fe38d376..8e54e1d7255 100644 --- a/src/plugins/autotest/gtest/gtestframework.cpp +++ b/src/plugins/autotest/gtest/gtestframework.cpp @@ -32,7 +32,7 @@ GTestFramework::GTestFramework() { setActive(true); setSettingsGroups("Autotest", "GTest"); - setName(GTest::Constants::FRAMEWORK_NAME); + setId(GTest::Constants::FRAMEWORK_ID); setDisplayName(Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setPriority(GTest::Constants::FRAMEWORK_PRIORITY); @@ -130,8 +130,7 @@ GTestFramework::GTestFramework() == GTest::Constants::GTestFilter); }); connect(this, &AspectContainer::applied, this, [] { - Id id = Id(Constants::FRAMEWORK_PREFIX).withSuffix(GTest::Constants::FRAMEWORK_NAME); - TestTreeModel::instance()->rebuild({id}); + TestTreeModel::instance()->rebuild({GTest::Constants::FRAMEWORK_ID}); }); } @@ -178,9 +177,8 @@ class GTestSettingsPage final : public Core::IOptionsPage public: GTestSettingsPage() { - setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.%2") - .arg(GTest::Constants::FRAMEWORK_PRIORITY) - .arg(GTest::Constants::FRAMEWORK_NAME))); + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.GTest") + .arg(GTest::Constants::FRAMEWORK_PRIORITY))); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); setDisplayName(Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setSettingsProvider([] { return &theGTestFramework(); }); diff --git a/src/plugins/autotest/gtest/gtestresult.cpp b/src/plugins/autotest/gtest/gtestresult.cpp index f34b8f069d7..070aa837d38 100644 --- a/src/plugins/autotest/gtest/gtestresult.cpp +++ b/src/plugins/autotest/gtest/gtestresult.cpp @@ -84,8 +84,7 @@ static ResultHooks::FindTestItemHook findTestItemHook(const FilePath &projectFil const QString &testCaseName) { return [=](const TestResult &result) -> ITestTreeItem * { - const Id id = Id(Constants::FRAMEWORK_PREFIX).withSuffix(GTest::Constants::FRAMEWORK_NAME); - ITestFramework *framework = TestFrameworkManager::frameworkForId(id); + ITestFramework *framework = TestFrameworkManager::frameworkForId(GTest::Constants::FRAMEWORK_ID); QTC_ASSERT(framework, return nullptr); const TestTreeItem *rootNode = framework->rootNode(); if (!rootNode) diff --git a/src/plugins/autotest/itestframework.cpp b/src/plugins/autotest/itestframework.cpp index 513fa96411d..4dd176b169c 100644 --- a/src/plugins/autotest/itestframework.cpp +++ b/src/plugins/autotest/itestframework.cpp @@ -15,11 +15,6 @@ namespace Autotest { ITestBase::ITestBase() {} -Id ITestBase::id() const -{ - return Id(Constants::FRAMEWORK_PREFIX).withSuffix(name()); -} - void ITestBase::resetRootNode() { if (!m_rootNode) diff --git a/src/plugins/autotest/itestframework.h b/src/plugins/autotest/itestframework.h index 8eff4e30458..ac7b85eda42 100644 --- a/src/plugins/autotest/itestframework.h +++ b/src/plugins/autotest/itestframework.h @@ -30,10 +30,9 @@ public: ITestBase(); virtual ~ITestBase() = default; - const char *name() const { return m_name; } QString displayName() const { return m_displayName; } TestBaseType type() const { return m_type; } - Utils::Id id() const; + Utils::Id id() const { return m_id; } int priority() const { return m_priority; } bool active() const { return m_active; } @@ -48,7 +47,7 @@ protected: void setPriority(int priority) { m_priority = priority; } void setDisplayName(const QString &displayName) { m_displayName = displayName; } void setType(const TestBaseType type) { m_type = type; } - void setName(const char *name) { m_name = name; } + void setId(const Utils::Id id) { m_id = id; } virtual ITestTreeItem *createRootNode() = 0; @@ -58,7 +57,7 @@ private: TestBaseType m_type = None; int m_priority = 0; QString m_displayName; - const char *m_name = nullptr; + Utils::Id m_id; friend class ITestFramework; friend class ITestTool; diff --git a/src/plugins/autotest/qtest/qttestconstants.h b/src/plugins/autotest/qtest/qttestconstants.h index 10042a1c961..d3e7a59334b 100644 --- a/src/plugins/autotest/qtest/qttestconstants.h +++ b/src/plugins/autotest/qtest/qttestconstants.h @@ -9,7 +9,7 @@ namespace Autotest { namespace QtTest { namespace Constants { -const char FRAMEWORK_NAME[] = "QtTest"; +const char FRAMEWORK_ID[] = "AutoTest.Framework.QtTest"; const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("QtC::Autotest", "Qt Test"); const unsigned FRAMEWORK_PRIORITY = 1; diff --git a/src/plugins/autotest/qtest/qttestframework.cpp b/src/plugins/autotest/qtest/qttestframework.cpp index bdbbc2b07d8..a406506a675 100644 --- a/src/plugins/autotest/qtest/qttestframework.cpp +++ b/src/plugins/autotest/qtest/qttestframework.cpp @@ -28,7 +28,7 @@ QtTestFramework &theQtTestFramework() QtTestFramework::QtTestFramework() { setActive(true); - setName(QtTest::Constants::FRAMEWORK_NAME); + setId(QtTest::Constants::FRAMEWORK_ID); setDisplayName(Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setPriority(QtTest::Constants::FRAMEWORK_PRIORITY); setSettingsGroups("Autotest", "QtTest"); @@ -144,9 +144,8 @@ class QtTestSettingPage final : public Core::IOptionsPage public: QtTestSettingPage() { - setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.%2") - .arg(QtTest::Constants::FRAMEWORK_PRIORITY) - .arg(QtTest::Constants::FRAMEWORK_NAME))); + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.QtTest") + .arg(QtTest::Constants::FRAMEWORK_PRIORITY))); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); setDisplayName(Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setSettingsProvider([] { return &theQtTestFramework(); }); diff --git a/src/plugins/autotest/qtest/qttestresult.cpp b/src/plugins/autotest/qtest/qttestresult.cpp index 1f15b3e82dc..581a334efc6 100644 --- a/src/plugins/autotest/qtest/qttestresult.cpp +++ b/src/plugins/autotest/qtest/qttestresult.cpp @@ -130,8 +130,8 @@ static ResultHooks::FindTestItemHook findTestItemHook(const FilePath &projectFil { return [=](const TestResult &result) -> ITestTreeItem * { const Id id = type == TestType::QtTest - ? Id(Constants::FRAMEWORK_PREFIX).withSuffix(QtTest::Constants::FRAMEWORK_NAME) - : Id(Constants::FRAMEWORK_PREFIX).withSuffix(QuickTest::Constants::FRAMEWORK_NAME); + ? Id(QtTest::Constants::FRAMEWORK_ID) + : Id(QuickTest::Constants::FRAMEWORK_ID); ITestFramework *framework = TestFrameworkManager::frameworkForId(id); QTC_ASSERT(framework, return nullptr); const TestTreeItem *rootNode = framework->rootNode(); @@ -151,8 +151,8 @@ struct QtTestData TestType m_type; QString m_function; QString m_dataTag; - bool isTestFunction() const { return !m_function.isEmpty() && m_dataTag.isEmpty(); }; - bool isDataTag() const { return !m_function.isEmpty() && !m_dataTag.isEmpty(); }; + bool isTestFunction() const { return !m_function.isEmpty() && m_dataTag.isEmpty(); } + bool isDataTag() const { return !m_function.isEmpty() && !m_dataTag.isEmpty(); } }; static ResultHooks::DirectParentHook directParentHook(const QString &functionName, diff --git a/src/plugins/autotest/quick/quicktestframework.cpp b/src/plugins/autotest/quick/quicktestframework.cpp index 8e91638e553..875520a5e70 100644 --- a/src/plugins/autotest/quick/quicktestframework.cpp +++ b/src/plugins/autotest/quick/quicktestframework.cpp @@ -18,7 +18,7 @@ QuickTestFramework &theQuickTestFramework() QuickTestFramework::QuickTestFramework() { - setName(QuickTest::Constants::FRAMEWORK_NAME); + setId(QuickTest::Constants::FRAMEWORK_ID); setDisplayName(Tr::tr("Quick Test")); setPriority(5); } diff --git a/src/plugins/autotest/quick/quicktestframework.h b/src/plugins/autotest/quick/quicktestframework.h index a5de159671b..0bfc1f7c11d 100644 --- a/src/plugins/autotest/quick/quicktestframework.h +++ b/src/plugins/autotest/quick/quicktestframework.h @@ -11,7 +11,7 @@ namespace Autotest { namespace QuickTest { namespace Constants { -const char FRAMEWORK_NAME[] = "QtQuickTest"; +const char FRAMEWORK_ID[] = "Autotest.Framework.QtQuickTest"; } // namespace Constants } // namespace QuickTest From 91596316f215713ca9fb3c8a1d2797ce5ebc3b8d Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 16 Aug 2023 07:56:42 +0200 Subject: [PATCH 0721/1777] WinPty: Fix qbs build on Windows Change-Id: I993fa3c8d9bc364c00e9e9eedba021a7432d908f Reviewed-by: hjk <hjk@qt.io> --- src/libs/3rdparty/libptyqt/winptyprocess.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/3rdparty/libptyqt/winptyprocess.cpp b/src/libs/3rdparty/libptyqt/winptyprocess.cpp index 0509bb77c37..7a781bc1953 100644 --- a/src/libs/3rdparty/libptyqt/winptyprocess.cpp +++ b/src/libs/3rdparty/libptyqt/winptyprocess.cpp @@ -77,7 +77,7 @@ bool WinPtyProcess::startProcess(const QString &executable, //env std::wstringstream envBlock; - foreach (QString line, environment) + for (const QString &line : environment) { envBlock << line.toStdWString() << L'\0'; } From f2d62c6d91e4d92abd1e910ae3024f5c242d5a10 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 14 Aug 2023 09:48:14 +0200 Subject: [PATCH 0722/1777] Copilot: Add support for proxy settings For easier testing a docker file is added. You can start "buildandrun.sh" in copilot/tests/proxy to get a simple proxy server up and running. The argument "PWDMODE" in buildandrun.sh can be set to "with" and "without" to get a proxy server that needs a password or not. The username and password are user/1234. Fixes: QTCREATORBUG-29485 Change-Id: I3859c9ad04ebd4f9349e25665ba710e23fb64dea Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/copilot/authwidget.cpp | 45 ++++--- src/plugins/copilot/authwidget.h | 2 +- src/plugins/copilot/copilotclient.cpp | 93 ++++++++++++- src/plugins/copilot/copilotclient.h | 6 + src/plugins/copilot/copilotsettings.cpp | 122 +++++++++++++---- src/plugins/copilot/copilotsettings.h | 9 ++ src/plugins/copilot/requests/seteditorinfo.h | 126 ++++++++++++++++++ src/plugins/copilot/tests/proxy/Dockerfile | 20 +++ .../copilot/tests/proxy/buildandrun.sh | 4 + src/plugins/copilot/tests/proxy/noauth.conf | 1 + src/plugins/copilot/tests/proxy/run.sh | 7 + src/plugins/copilot/tests/proxy/userauth.conf | 4 + 12 files changed, 390 insertions(+), 49 deletions(-) create mode 100644 src/plugins/copilot/requests/seteditorinfo.h create mode 100644 src/plugins/copilot/tests/proxy/Dockerfile create mode 100755 src/plugins/copilot/tests/proxy/buildandrun.sh create mode 100644 src/plugins/copilot/tests/proxy/noauth.conf create mode 100755 src/plugins/copilot/tests/proxy/run.sh create mode 100644 src/plugins/copilot/tests/proxy/userauth.conf diff --git a/src/plugins/copilot/authwidget.cpp b/src/plugins/copilot/authwidget.cpp index 07071d98f7e..a0890cae3dc 100644 --- a/src/plugins/copilot/authwidget.cpp +++ b/src/plugins/copilot/authwidget.cpp @@ -44,18 +44,21 @@ AuthWidget::AuthWidget(QWidget *parent) }.attachTo(this); // clang-format on - connect(m_button, &QPushButton::clicked, this, [this]() { - if (m_status == Status::SignedIn) - signOut(); - else if (m_status == Status::SignedOut) - signIn(); - }); - auto update = [this] { updateClient(FilePath::fromUserInput(settings().nodeJsPath.volatileValue()), FilePath::fromUserInput(settings().distPath.volatileValue())); }; + connect(m_button, &QPushButton::clicked, this, [this, update]() { + if (m_status == Status::SignedIn) + signOut(); + else if (m_status == Status::SignedOut) + signIn(); + else + update(); + }); + + connect(&settings(), &CopilotSettings::applied, this, update); connect(settings().nodeJsPath.pathChooser(), &PathChooser::textChanged, this, update); connect(settings().distPath.pathChooser(), &PathChooser::textChanged, this, update); @@ -68,35 +71,39 @@ AuthWidget::~AuthWidget() LanguageClientManager::shutdownClient(m_client); } -void AuthWidget::setState(const QString &buttonText, bool working) +void AuthWidget::setState(const QString &buttonText, const QString &errorText, bool working) { m_button->setText(buttonText); m_button->setVisible(true); m_progressIndicator->setVisible(working); + m_statusLabel->setText(errorText); m_statusLabel->setVisible(!m_statusLabel->text().isEmpty()); m_button->setEnabled(!working); } void AuthWidget::checkStatus() { + if (!isEnabled()) + return; + QTC_ASSERT(m_client && m_client->reachable(), return); - setState("Checking status ...", true); + setState("Checking status ...", {}, true); m_client->requestCheckStatus(false, [this](const CheckStatusRequest::Response &response) { if (response.error()) { - setState("failed: " + response.error()->message(), false); + setState("Failed to authenticate", response.error()->message(), false); return; } const CheckStatusResponse result = *response.result(); if (result.user().isEmpty()) { - setState("Sign in", false); + setState("Sign in", {}, false); m_status = Status::SignedOut; return; } - setState("Sign out " + result.user(), false); + setState("Sign out " + result.user(), {}, false); m_status = Status::SignedIn; }); } @@ -105,12 +112,12 @@ void AuthWidget::updateClient(const FilePath &nodeJs, const FilePath &agent) { LanguageClientManager::shutdownClient(m_client); m_client = nullptr; - setState(Tr::tr("Sign In"), false); + setState(Tr::tr("Sign In"), {}, false); m_button->setEnabled(false); if (!nodeJs.isExecutableFile() || !agent.exists()) return; - setState(Tr::tr("Sign In"), true); + setState(Tr::tr("Sign In"), {}, true); m_client = new CopilotClient(nodeJs, agent); connect(m_client, &Client::initialized, this, &AuthWidget::checkStatus); @@ -127,7 +134,7 @@ void AuthWidget::signIn() qCritical() << "Not implemented"; QTC_ASSERT(m_client && m_client->reachable(), return); - setState("Signing in ...", true); + setState("Signing in ...", {}, true); m_client->requestSignInInitiate([this](const SignInInitiateRequest::Response &response) { QTC_ASSERT(!response.error(), return); @@ -144,19 +151,17 @@ void AuthWidget::signIn() m_client ->requestSignInConfirm(response.result()->userCode(), [this](const SignInConfirmRequest::Response &response) { - m_statusLabel->setText(""); - if (response.error()) { QMessageBox::critical(this, Tr::tr("Login Failed"), Tr::tr( "The login request failed: ") + response.error()->message()); - setState("Sign in", false); + setState("Sign in", response.error()->message(), false); return; } - setState("Sign Out " + response.result()->user(), false); + setState("Sign Out " + response.result()->user(), {}, false); }); }); } @@ -165,7 +170,7 @@ void AuthWidget::signOut() { QTC_ASSERT(m_client && m_client->reachable(), return); - setState("Signing out ...", true); + setState("Signing out ...", {}, true); m_client->requestSignOut([this](const SignOutRequest::Response &response) { QTC_ASSERT(!response.error(), return); diff --git a/src/plugins/copilot/authwidget.h b/src/plugins/copilot/authwidget.h index acb18810fe4..6da873bd001 100644 --- a/src/plugins/copilot/authwidget.h +++ b/src/plugins/copilot/authwidget.h @@ -30,7 +30,7 @@ public: void updateClient(const Utils::FilePath &nodeJs, const Utils::FilePath &agent); private: - void setState(const QString &buttonText, bool working); + void setState(const QString &buttonText, const QString &errorText, bool working); void checkStatus(); diff --git a/src/plugins/copilot/copilotclient.cpp b/src/plugins/copilot/copilotclient.cpp index 3f624ca071c..d5592b7861c 100644 --- a/src/plugins/copilot/copilotclient.cpp +++ b/src/plugins/copilot/copilotclient.cpp @@ -2,26 +2,32 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "copilotclient.h" -#include "copilotconstants.h" #include "copilotsettings.h" #include "copilotsuggestion.h" +#include "copilottr.h" + +#include <app/app_version.h> #include <languageclient/languageclientinterface.h> #include <languageclient/languageclientmanager.h> #include <languageclient/languageclientsettings.h> +#include <languageserverprotocol/lsptypes.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/editormanager/editormanager.h> +#include <coreplugin/icore.h> #include <projectexplorer/projectmanager.h> -#include <utils/filepath.h> - #include <texteditor/textdocumentlayout.h> #include <texteditor/texteditor.h> -#include <languageserverprotocol/lsptypes.h> +#include <utils/checkablemessagebox.h> +#include <utils/filepath.h> +#include <utils/passworddialog.h> +#include <QInputDialog> +#include <QLoggingCategory> #include <QTimer> #include <QToolButton> @@ -31,6 +37,8 @@ using namespace Utils; using namespace ProjectExplorer; using namespace Core; +Q_LOGGING_CATEGORY(copilotClientLog, "qtc.copilot.client", QtWarningMsg) + namespace Copilot::Internal { static LanguageClient::BaseClientInterface *clientInterface(const FilePath &nodePath, @@ -52,6 +60,23 @@ CopilotClient::CopilotClient(const FilePath &nodePath, const FilePath &distPath) langFilter.filePattern = {"*"}; setSupportedLanguage(langFilter); + + registerCustomMethod("LogMessage", [this](const LanguageServerProtocol::JsonRpcMessage &message) { + QString msg = message.toJsonObject().value("params").toObject().value("message").toString(); + qCDebug(copilotClientLog) << message.toJsonObject() + .value("params") + .toObject() + .value("message") + .toString(); + + if (msg.contains("Socket Connect returned status code,407")) { + qCWarning(copilotClientLog) << "Proxy authentication required"; + QMetaObject::invokeMethod(this, + &CopilotClient::proxyAuthenticationFailed, + Qt::QueuedConnection); + } + }); + start(); auto openDoc = [this](IDocument *document) { @@ -68,6 +93,8 @@ CopilotClient::CopilotClient(const FilePath &nodePath, const FilePath &distPath) closeDocument(textDocument); }); + connect(this, &LanguageClient::Client::initialized, this, &CopilotClient::requestSetEditorInfo); + for (IDocument *doc : DocumentModel::openedDocuments()) openDoc(doc); } @@ -218,6 +245,32 @@ void CopilotClient::cancelRunningRequest(TextEditor::TextEditorWidget *editor) m_runningRequests.erase(it); } +static QString currentProxyPassword; + +void CopilotClient::requestSetEditorInfo() +{ + if (settings().saveProxyPassword()) + currentProxyPassword = settings().proxyPassword(); + + const EditorInfo editorInfo{Core::Constants::IDE_VERSION_DISPLAY, "Qt Creator"}; + const EditorPluginInfo editorPluginInfo{Core::Constants::IDE_VERSION_DISPLAY, + "Qt Creator Copilot plugin"}; + + SetEditorInfoParams params(editorInfo, editorPluginInfo); + + if (settings().useProxy()) { + params.setNetworkProxy( + Copilot::NetworkProxy{settings().proxyHost(), + static_cast<int>(settings().proxyPort()), + settings().proxyUser(), + currentProxyPassword, + settings().proxyRejectUnauthorized()}); + } + + SetEditorInfoRequest request(params); + sendMessage(request); +} + void CopilotClient::requestCheckStatus( bool localChecksOnly, std::function<void(const CheckStatusRequest::Response &response)> callback) { @@ -269,4 +322,36 @@ bool CopilotClient::isEnabled(Project *project) return settings.isEnabled(); } +void CopilotClient::proxyAuthenticationFailed() +{ + static bool doNotAskAgain = false; + + if (m_isAskingForPassword || !settings().enableCopilot()) + return; + + m_isAskingForPassword = true; + + auto answer = Utils::PasswordDialog::getUserAndPassword( + Tr::tr("Copilot"), + Tr::tr("Proxy username and password required:"), + Tr::tr("Do not ask again. This will disable Copilot for now."), + settings().proxyUser(), + &doNotAskAgain, + Core::ICore::dialogParent()); + + if (answer) { + settings().proxyUser.setValue(answer->first); + currentProxyPassword = answer->second; + } else { + settings().enableCopilot.setValue(false); + } + + if (settings().saveProxyPassword()) + settings().proxyPassword.setValue(currentProxyPassword); + + settings().apply(); + + m_isAskingForPassword = false; +} + } // namespace Copilot::Internal diff --git a/src/plugins/copilot/copilotclient.h b/src/plugins/copilot/copilotclient.h index 47208236b52..aa03b70960f 100644 --- a/src/plugins/copilot/copilotclient.h +++ b/src/plugins/copilot/copilotclient.h @@ -6,6 +6,7 @@ #include "copilothoverhandler.h" #include "requests/checkstatus.h" #include "requests/getcompletions.h" +#include "requests/seteditorinfo.h" #include "requests/signinconfirm.h" #include "requests/signininitiate.h" #include "requests/signout.h" @@ -50,7 +51,11 @@ public: bool isEnabled(ProjectExplorer::Project *project); + void proxyAuthenticationFailed(); + private: + void requestSetEditorInfo(); + QMap<TextEditor::TextEditorWidget *, GetCompletionRequest> m_runningRequests; struct ScheduleData { @@ -59,6 +64,7 @@ private: }; QMap<TextEditor::TextEditorWidget *, ScheduleData> m_scheduledRequests; CopilotHoverHandler m_hoverHandler; + bool m_isAskingForPassword{false}; }; } // namespace Copilot::Internal diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index c03ada7dce5..ef064372ca5 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -44,7 +44,6 @@ CopilotSettings::CopilotSettings() const FilePath nodeFromPath = FilePath("node").searchInPath(); const FilePaths searchDirs - = {FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/dist/agent.js"), FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/copilot/dist/agent.js"), FilePath::fromUserInput( @@ -80,13 +79,75 @@ CopilotSettings::CopilotSettings() autoComplete.setDisplayName(Tr::tr("Auto Complete")); autoComplete.setSettingsKey("Copilot.Autocomplete"); - autoComplete.setLabelText(Tr::tr("Request completions automatically")); + autoComplete.setLabelText(Tr::tr("Auto request")); autoComplete.setDefaultValue(true); autoComplete.setEnabler(&enableCopilot); autoComplete.setToolTip(Tr::tr("Automatically request suggestions for the current text cursor " "position after changes to the document.")); + autoComplete.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); + + useProxy.setDisplayName(Tr::tr("Use Proxy")); + useProxy.setSettingsKey("Copilot.UseProxy"); + useProxy.setLabelText(Tr::tr("Use Proxy")); + useProxy.setDefaultValue(false); + useProxy.setEnabler(&enableCopilot); + useProxy.setToolTip(Tr::tr("Use a proxy to connect to the Copilot servers.")); + useProxy.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); + + proxyHost.setDisplayName(Tr::tr("Proxy Host")); + proxyHost.setDisplayStyle(StringAspect::LineEditDisplay); + proxyHost.setSettingsKey("Copilot.ProxyHost"); + proxyHost.setLabelText(Tr::tr("Proxy Host")); + proxyHost.setDefaultValue(""); + proxyHost.setEnabler(&useProxy); + proxyHost.setToolTip(Tr::tr("The host name of the proxy server.")); + proxyHost.setHistoryCompleter("Copilot.ProxyHost.History"); + + proxyPort.setDisplayName(Tr::tr("Proxy Port")); + proxyPort.setSettingsKey("Copilot.ProxyPort"); + proxyPort.setLabelText(Tr::tr("Proxy Port")); + proxyPort.setDefaultValue(3128); + proxyPort.setEnabler(&useProxy); + proxyPort.setToolTip(Tr::tr("The port of the proxy server.")); + proxyPort.setRange(1, 65535); + + proxyUser.setDisplayName(Tr::tr("Proxy User")); + proxyUser.setDisplayStyle(StringAspect::LineEditDisplay); + proxyUser.setSettingsKey("Copilot.ProxyUser"); + proxyUser.setLabelText(Tr::tr("Proxy User")); + proxyUser.setDefaultValue(""); + proxyUser.setEnabler(&useProxy); + proxyUser.setToolTip(Tr::tr("The user name for the proxy server.")); + proxyUser.setHistoryCompleter("Copilot.ProxyUser.History"); + + saveProxyPassword.setDisplayName(Tr::tr("Save Proxy Password")); + saveProxyPassword.setSettingsKey("Copilot.SaveProxyPassword"); + saveProxyPassword.setLabelText(Tr::tr("Save Proxy Password")); + saveProxyPassword.setDefaultValue(false); + saveProxyPassword.setEnabler(&useProxy); + saveProxyPassword.setToolTip( + Tr::tr("Save the password for the proxy server (Password is stored insecurely!).")); + saveProxyPassword.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); + + proxyPassword.setDisplayName(Tr::tr("Proxy Password")); + proxyPassword.setDisplayStyle(StringAspect::PasswordLineEditDisplay); + proxyPassword.setSettingsKey("Copilot.ProxyPassword"); + proxyPassword.setLabelText(Tr::tr("Proxy Password")); + proxyPassword.setDefaultValue(""); + proxyPassword.setEnabler(&saveProxyPassword); + proxyPassword.setToolTip(Tr::tr("The password for the proxy server.")); + + proxyRejectUnauthorized.setDisplayName(Tr::tr("Reject Unauthorized")); + proxyRejectUnauthorized.setSettingsKey("Copilot.ProxyRejectUnauthorized"); + proxyRejectUnauthorized.setLabelText(Tr::tr("Reject Unauthorized")); + proxyRejectUnauthorized.setDefaultValue(true); + proxyRejectUnauthorized.setEnabler(&useProxy); + proxyRejectUnauthorized.setToolTip(Tr::tr("Reject unauthorized certificates from the proxy " + "server. This is a security risk.")); + proxyRejectUnauthorized.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); initEnableAspect(enableCopilot); + enableCopilot.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); readSettings(); } @@ -140,25 +201,24 @@ public: auto warningLabel = new QLabel; warningLabel->setWordWrap(true); - warningLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse - | Qt::LinksAccessibleByKeyboard - | Qt::TextSelectableByMouse); - warningLabel->setText(Tr::tr( - "Enabling %1 is subject to your agreement and abidance with your applicable " - "%1 terms. It is your responsibility to know and accept the requirements and " - "parameters of using tools like %1. This may include, but is not limited to, " - "ensuring you have the rights to allow %1 access to your code, as well as " - "understanding any implications of your use of %1 and suggestions produced " - "(like copyright, accuracy, etc.)." ).arg("Copilot")); + warningLabel->setTextInteractionFlags( + Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard | Qt::TextSelectableByMouse); + warningLabel->setText( + Tr::tr("Enabling %1 is subject to your agreement and abidance with your applicable " + "%1 terms. It is your responsibility to know and accept the requirements and " + "parameters of using tools like %1. This may include, but is not limited to, " + "ensuring you have the rights to allow %1 access to your code, as well as " + "understanding any implications of your use of %1 and suggestions produced " + "(like copyright, accuracy, etc.).") + .arg("Copilot")); auto authWidget = new AuthWidget(); auto helpLabel = new QLabel(); helpLabel->setTextFormat(Qt::MarkdownText); helpLabel->setWordWrap(true); - helpLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse - | Qt::LinksAccessibleByKeyboard - | Qt::TextSelectableByMouse); + helpLabel->setTextInteractionFlags( + Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard | Qt::TextSelectableByMouse); helpLabel->setOpenExternalLinks(true); connect(helpLabel, &QLabel::linkHovered, [](const QString &link) { QToolTip::showText(QCursor::pos(), link); @@ -176,14 +236,28 @@ public: .arg("[agent.js](https://github.com/github/copilot.vim/tree/release/dist)")); Column { - QString("<b>" + Tr::tr("Note:") + "</b>"), br, - warningLabel, br, - settings().enableCopilot, br, - authWidget, br, - settings().nodeJsPath, br, - settings().distPath, br, - settings().autoComplete, br, - helpLabel, br, + Group { + title(Tr::tr("Note")), + Column { + warningLabel, br, + helpLabel, br, + } + }, + Form { + authWidget, br, + settings().enableCopilot, br, + settings().nodeJsPath, br, + settings().distPath, br, + settings().autoComplete, br, + hr, br, + settings().useProxy, br, + settings().proxyHost, br, + settings().proxyPort, br, + settings().proxyRejectUnauthorized, br, + settings().proxyUser, br, + settings().saveProxyPassword, br, + settings().proxyPassword, br, + }, st }.attachTo(this); // clang-format on @@ -211,4 +285,4 @@ public: const CopilotSettingsPage settingsPage; -} // Copilot +} // namespace Copilot diff --git a/src/plugins/copilot/copilotsettings.h b/src/plugins/copilot/copilotsettings.h index 11e9ace9c6b..b92106c3f73 100644 --- a/src/plugins/copilot/copilotsettings.h +++ b/src/plugins/copilot/copilotsettings.h @@ -18,6 +18,15 @@ public: Utils::FilePathAspect distPath{this}; Utils::BoolAspect autoComplete{this}; Utils::BoolAspect enableCopilot{this}; + + Utils::BoolAspect useProxy{this}; + Utils::StringAspect proxyHost{this}; + Utils::IntegerAspect proxyPort{this}; + Utils::StringAspect proxyUser{this}; + + Utils::BoolAspect saveProxyPassword{this}; + Utils::StringAspect proxyPassword{this}; + Utils::BoolAspect proxyRejectUnauthorized{this}; }; CopilotSettings &settings(); diff --git a/src/plugins/copilot/requests/seteditorinfo.h b/src/plugins/copilot/requests/seteditorinfo.h new file mode 100644 index 00000000000..321a2e43755 --- /dev/null +++ b/src/plugins/copilot/requests/seteditorinfo.h @@ -0,0 +1,126 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "checkstatus.h" + +#include <languageserverprotocol/jsonrpcmessages.h> +#include <languageserverprotocol/lsptypes.h> + +namespace Copilot { + +class EditorPluginInfo : public LanguageServerProtocol::JsonObject +{ + static constexpr char version[] = "version"; + static constexpr char name[] = "name"; + +public: + using JsonObject::JsonObject; + + EditorPluginInfo(const QString &version, const QString &name) + { + setEditorVersion(version); + setEditorName(name); + } + + void setEditorVersion(const QString &v) { insert(version, v); } + void setEditorName(const QString &n) { insert(name, n); } +}; + +class EditorInfo : public LanguageServerProtocol::JsonObject +{ + static constexpr char version[] = "version"; + static constexpr char name[] = "name"; + +public: + using JsonObject::JsonObject; + + EditorInfo(const QString &version, const QString &name) + { + setEditorVersion(version); + setEditorName(name); + } + + void setEditorVersion(const QString &v) { insert(version, v); } + void setEditorName(const QString &n) { insert(name, n); } +}; + +class NetworkProxy : public LanguageServerProtocol::JsonObject +{ + static constexpr char host[] = "host"; + static constexpr char port[] = "port"; + static constexpr char user[] = "username"; + static constexpr char password[] = "password"; + static constexpr char rejectUnauthorized[] = "rejectUnauthorized"; + +public: + using JsonObject::JsonObject; + + NetworkProxy(const QString &host, + int port, + const QString &user, + const QString &password, + bool rejectUnauthorized) + { + setHost(host); + setPort(port); + setUser(user); + setPassword(password); + setRejectUnauthorized(rejectUnauthorized); + } + + void insertIfNotEmpty(const std::string_view key, const QString &value) + { + if (!value.isEmpty()) + insert(key, value); + } + + void setHost(const QString &h) { insert(host, h); } + void setPort(int p) { insert(port, p); } + void setUser(const QString &u) { insertIfNotEmpty(user, u); } + void setPassword(const QString &p) { insertIfNotEmpty(password, p); } + void setRejectUnauthorized(bool r) { insert(rejectUnauthorized, r); } +}; + +class SetEditorInfoParams : public LanguageServerProtocol::JsonObject +{ + static constexpr char editorInfo[] = "editorInfo"; + static constexpr char editorPluginInfo[] = "editorPluginInfo"; + static constexpr char networkProxy[] = "networkProxy"; + +public: + using JsonObject::JsonObject; + + SetEditorInfoParams(const EditorInfo &editorInfo, const EditorPluginInfo &editorPluginInfo) + { + setEditorInfo(editorInfo); + setEditorPluginInfo(editorPluginInfo); + } + + SetEditorInfoParams(const EditorInfo &editorInfo, + const EditorPluginInfo &editorPluginInfo, + const NetworkProxy &networkProxy) + { + setEditorInfo(editorInfo); + setEditorPluginInfo(editorPluginInfo); + setNetworkProxy(networkProxy); + } + + void setEditorInfo(const EditorInfo &info) { insert(editorInfo, info); } + void setEditorPluginInfo(const EditorPluginInfo &info) { insert(editorPluginInfo, info); } + void setNetworkProxy(const NetworkProxy &proxy) { insert(networkProxy, proxy); } +}; + +class SetEditorInfoRequest + : public LanguageServerProtocol::Request<CheckStatusResponse, std::nullptr_t, SetEditorInfoParams> +{ +public: + explicit SetEditorInfoRequest(const SetEditorInfoParams ¶ms) + : Request(methodName, params) + {} + using Request::Request; + constexpr static const char methodName[] = "setEditorInfo"; +}; + +} // namespace Copilot diff --git a/src/plugins/copilot/tests/proxy/Dockerfile b/src/plugins/copilot/tests/proxy/Dockerfile new file mode 100644 index 00000000000..ee053080402 --- /dev/null +++ b/src/plugins/copilot/tests/proxy/Dockerfile @@ -0,0 +1,20 @@ +ARG PWDMODE=with + + +FROM ubuntu:20.04 AS base +ARG DEBIAN_FRONTEND=noninteractive +ENV TZ=Etc/UTC +RUN apt-get update && apt-get install -y squid apache2-utils && rm -rf /var/lib/apt/lists/* +COPY run.sh / +RUN chmod +x /run.sh + + +FROM base as image-with-pwd +RUN echo 1234 | htpasswd -i -c /etc/squid/pswds user +COPY userauth.conf /etc/squid/conf.d/ + +FROM base as image-without-pwd +COPY noauth.conf /etc/squid/conf.d/ + +FROM image-${PWDMODE}-pwd AS final +CMD [ "/run.sh" ] diff --git a/src/plugins/copilot/tests/proxy/buildandrun.sh b/src/plugins/copilot/tests/proxy/buildandrun.sh new file mode 100755 index 00000000000..1bffd699bc5 --- /dev/null +++ b/src/plugins/copilot/tests/proxy/buildandrun.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker build --build-arg PWDMODE=with -t copilot-proxy-test . && \ +docker run --rm -it -p 3128:3128 copilot-proxy-test diff --git a/src/plugins/copilot/tests/proxy/noauth.conf b/src/plugins/copilot/tests/proxy/noauth.conf new file mode 100644 index 00000000000..04c7e12eecf --- /dev/null +++ b/src/plugins/copilot/tests/proxy/noauth.conf @@ -0,0 +1 @@ +http_access allow all diff --git a/src/plugins/copilot/tests/proxy/run.sh b/src/plugins/copilot/tests/proxy/run.sh new file mode 100755 index 00000000000..2a0d77d481c --- /dev/null +++ b/src/plugins/copilot/tests/proxy/run.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +touch /var/log/squid/access.log +chmod 640 /var/log/squid/access.log +chown proxy:proxy /var/log/squid/access.log +tail -f /var/log/squid/access.log & +exec squid --foreground diff --git a/src/plugins/copilot/tests/proxy/userauth.conf b/src/plugins/copilot/tests/proxy/userauth.conf new file mode 100644 index 00000000000..1a344e04657 --- /dev/null +++ b/src/plugins/copilot/tests/proxy/userauth.conf @@ -0,0 +1,4 @@ +auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid/pswds +auth_param basic realm proxy +acl authenticated proxy_auth REQUIRED +http_access allow authenticated From ae51ad8c92fd7fb63bd8dc62313d49ff9558ce92 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 15 Aug 2023 14:58:42 +0200 Subject: [PATCH 0723/1777] Copilot: Move to Settings::setLayouter() Change-Id: I1d7d9872f12aa5436f03107bdd5fedfbe2829700 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/copilot/copilotsettings.cpp | 148 +++++++++++------------- 1 file changed, 68 insertions(+), 80 deletions(-) diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index ef064372ca5..d5f8639d0c6 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -150,6 +150,73 @@ CopilotSettings::CopilotSettings() enableCopilot.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); readSettings(); + + setLayouter([this] { + using namespace Layouting; + + auto warningLabel = new QLabel; + warningLabel->setWordWrap(true); + warningLabel->setTextInteractionFlags( + Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard | Qt::TextSelectableByMouse); + warningLabel->setText( + Tr::tr("Enabling %1 is subject to your agreement and abidance with your applicable " + "%1 terms. It is your responsibility to know and accept the requirements and " + "parameters of using tools like %1. This may include, but is not limited to, " + "ensuring you have the rights to allow %1 access to your code, as well as " + "understanding any implications of your use of %1 and suggestions produced " + "(like copyright, accuracy, etc.).") + .arg("Copilot")); + + auto authWidget = new AuthWidget(); + + auto helpLabel = new QLabel(); + helpLabel->setTextFormat(Qt::MarkdownText); + helpLabel->setWordWrap(true); + helpLabel->setTextInteractionFlags( + Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard | Qt::TextSelectableByMouse); + helpLabel->setOpenExternalLinks(true); + connect(helpLabel, &QLabel::linkHovered, [](const QString &link) { + QToolTip::showText(QCursor::pos(), link); + }); + + // clang-format off + helpLabel->setText(Tr::tr( + "The Copilot plugin requires node.js and the Copilot neovim plugin. " + "If you install the neovim plugin as described in %1, " + "the plugin will find the agent.js file automatically.\n\n" + "Otherwise you need to specify the path to the %2 " + "file from the Copilot neovim plugin.", + "Markdown text for the copilot instruction label") + .arg("[README.md](https://github.com/github/copilot.vim)") + .arg("[agent.js](https://github.com/github/copilot.vim/tree/release/dist)")); + + return Column { + Group { + title(Tr::tr("Note")), + Column { + warningLabel, br, + helpLabel, br, + } + }, + Form { + authWidget, br, + enableCopilot, br, + nodeJsPath, br, + distPath, br, + autoComplete, br, + hr, br, + useProxy, br, + proxyHost, br, + proxyPort, br, + proxyRejectUnauthorized, br, + proxyUser, br, + saveProxyPassword, br, + proxyPassword, br, + }, + st + }; + // clang-format on + }); } CopilotProjectSettings::CopilotProjectSettings(ProjectExplorer::Project *project) @@ -190,85 +257,6 @@ void CopilotProjectSettings::save(ProjectExplorer::Project *project) settings().apply(); } -// CopilotOptionsPageWidget - -class CopilotOptionsPageWidget : public Core::IOptionsPageWidget -{ -public: - CopilotOptionsPageWidget() - { - using namespace Layouting; - - auto warningLabel = new QLabel; - warningLabel->setWordWrap(true); - warningLabel->setTextInteractionFlags( - Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard | Qt::TextSelectableByMouse); - warningLabel->setText( - Tr::tr("Enabling %1 is subject to your agreement and abidance with your applicable " - "%1 terms. It is your responsibility to know and accept the requirements and " - "parameters of using tools like %1. This may include, but is not limited to, " - "ensuring you have the rights to allow %1 access to your code, as well as " - "understanding any implications of your use of %1 and suggestions produced " - "(like copyright, accuracy, etc.).") - .arg("Copilot")); - - auto authWidget = new AuthWidget(); - - auto helpLabel = new QLabel(); - helpLabel->setTextFormat(Qt::MarkdownText); - helpLabel->setWordWrap(true); - helpLabel->setTextInteractionFlags( - Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard | Qt::TextSelectableByMouse); - helpLabel->setOpenExternalLinks(true); - connect(helpLabel, &QLabel::linkHovered, [](const QString &link) { - QToolTip::showText(QCursor::pos(), link); - }); - - // clang-format off - helpLabel->setText(Tr::tr( - "The Copilot plugin requires node.js and the Copilot neovim plugin. " - "If you install the neovim plugin as described in %1, " - "the plugin will find the agent.js file automatically.\n\n" - "Otherwise you need to specify the path to the %2 " - "file from the Copilot neovim plugin.", - "Markdown text for the copilot instruction label") - .arg("[README.md](https://github.com/github/copilot.vim)") - .arg("[agent.js](https://github.com/github/copilot.vim/tree/release/dist)")); - - Column { - Group { - title(Tr::tr("Note")), - Column { - warningLabel, br, - helpLabel, br, - } - }, - Form { - authWidget, br, - settings().enableCopilot, br, - settings().nodeJsPath, br, - settings().distPath, br, - settings().autoComplete, br, - hr, br, - settings().useProxy, br, - settings().proxyHost, br, - settings().proxyPort, br, - settings().proxyRejectUnauthorized, br, - settings().proxyUser, br, - settings().saveProxyPassword, br, - settings().proxyPassword, br, - }, - st - }.attachTo(this); - // clang-format on - - setOnApply([] { - settings().apply(); - settings().writeSettings(); - }); - } -}; - class CopilotSettingsPage : public Core::IOptionsPage { public: @@ -279,7 +267,7 @@ public: setCategory(Constants::COPILOT_GENERAL_OPTIONS_CATEGORY); setDisplayCategory(Constants::COPILOT_GENERAL_OPTIONS_DISPLAY_CATEGORY); setCategoryIconPath(":/copilot/images/settingscategory_copilot.png"); - setWidgetCreator([] { return new CopilotOptionsPageWidget; }); + setSettingsProvider([] { return &settings(); }); } }; From a3b93481dae200660113ee8bd9b29da39f783e8a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 10 Aug 2023 14:29:21 +0200 Subject: [PATCH 0724/1777] Debugger: Hide KitAspectFactory Change-Id: If98f4598efb273852a602a9ed7379341a3720a60 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- .../debugger/debuggerkitinformation.cpp | 322 +++++++++--------- src/plugins/debugger/debuggerkitinformation.h | 21 +- src/plugins/debugger/debuggerplugin.cpp | 3 +- .../debugger/unstartedappwatcherdialog.cpp | 1 + 4 files changed, 172 insertions(+), 175 deletions(-) diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index 28b85b939ab..aedfae32dc7 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -8,6 +8,7 @@ #include "debuggertr.h" #include <projectexplorer/devicesupport/idevice.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runcontrol.h> #include <projectexplorer/toolchain.h> @@ -20,7 +21,6 @@ #include <utils/qtcassert.h> #include <QComboBox> -#include <QFileInfo> #include <utility> @@ -128,119 +128,6 @@ private: }; } // namespace Internal -DebuggerKitAspectFactory::DebuggerKitAspectFactory() -{ - setObjectName("DebuggerKitAspect"); - setId(DebuggerKitAspect::id()); - setDisplayName(Tr::tr("Debugger")); - setDescription(Tr::tr("The debugger to use for this kit.")); - setPriority(28000); -} - -void DebuggerKitAspectFactory::setup(Kit *k) -{ - QTC_ASSERT(k, return); - - // This can be anything (Id, binary path, "auto") - // With 3.0 we have: - // <value type="QString" key="Debugger.Information">{75ecf347-f221-44c3-b613-ea1d29929cd4}</value> - // Before we had: - // <valuemap type="QVariantMap" key="Debugger.Information"> - // <value type="QString" key="Binary">/data/dev/debugger/gdb-git/gdb/gdb</value> - // <value type="int" key="EngineType">1</value> - // </valuemap> - // Or for force auto-detected CDB - // <valuemap type="QVariantMap" key="Debugger.Information"> - // <value type="QString" key="Binary">auto</value> - // <value type="int" key="EngineType">4</value> - // </valuemap> - const QVariant rawId = k->value(DebuggerKitAspectFactory::id()); - - const Abi tcAbi = ToolChainKitAspect::targetAbi(k); - - // Get the best of the available debugger matching the kit's toolchain. - // The general idea is to find an item that exactly matches what - // is stored in the kit information, but also accept item based - // on toolchain matching as fallback with a lower priority. - - DebuggerItem bestItem; - DebuggerItem::MatchLevel bestLevel = DebuggerItem::DoesNotMatch; - const Environment systemEnvironment = Environment::systemEnvironment(); - for (const DebuggerItem &item : DebuggerItemManager::debuggers()) { - DebuggerItem::MatchLevel level = DebuggerItem::DoesNotMatch; - - if (rawId.isNull()) { - // Initial setup of a kit. - level = item.matchTarget(tcAbi); - // Hack to prefer a debugger from PATH (e.g. autodetected) over other matches. - // This improves the situation a bit if a cross-compilation tool chain has the - // same ABI as the host. - if (level == DebuggerItem::MatchesPerfectly - && !item.command().needsDevice() - && systemEnvironment.path().contains(item.command().parentDir())) { - level = DebuggerItem::MatchesPerfectlyInPath; - } - if (!item.detectionSource().isEmpty() && item.detectionSource() == k->autoDetectionSource()) - level = DebuggerItem::MatchLevel(level + 2); - } else if (rawId.type() == QVariant::String) { - // New structure. - if (item.id() == rawId) { - // Detected by ID. - level = DebuggerItem::MatchesPerfectly; - } else { - // This item does not match by ID, and is an unlikely candidate. - // However, consider using it as fallback if the tool chain fits. - level = std::min(item.matchTarget(tcAbi), DebuggerItem::MatchesSomewhat); - } - } else { - // Old structure. - const QMap<QString, QVariant> map = rawId.toMap(); - QString binary = map.value("Binary").toString(); - if (binary == "auto") { - // This is close to the "new kit" case, except that we know - // an engine type. - DebuggerEngineType autoEngine = DebuggerEngineType(map.value("EngineType").toInt()); - if (item.engineType() == autoEngine) { - // Use item if host toolchain fits, but only as fallback. - level = std::min(item.matchTarget(tcAbi), DebuggerItem::MatchesSomewhat); - } - } else { - // We have an executable path. - FilePath fileName = FilePath::fromUserInput(binary); - if (item.command() == fileName) { - // And it's is the path of this item. - level = std::min(item.matchTarget(tcAbi), DebuggerItem::MatchesSomewhat); - } else { - // This item does not match by filename, and is an unlikely candidate. - // However, consider using it as fallback if the tool chain fits. - level = std::min(item.matchTarget(tcAbi), DebuggerItem::MatchesSomewhat); - } - } - } - - if (level > bestLevel) { - bestLevel = level; - bestItem = item; - } else if (level == bestLevel) { - if (item.engineType() == bestItem.engineType()) { - const QStringList itemVersion = item.version().split('.'); - const QStringList bestItemVersion = bestItem.version().split('.'); - int end = qMax(item.version().size(), bestItemVersion.size()); - for (int i = 0; i < end; ++i) { - if (itemVersion.value(i) == bestItemVersion.value(i)) - continue; - if (itemVersion.value(i).toInt() > bestItemVersion.value(i).toInt()) - bestItem = item; - break; - } - } - } - } - - // Use the best id we found, or an invalid one. - k->setValue(DebuggerKitAspect::id(), bestLevel != DebuggerItem::DoesNotMatch ? bestItem.id() : QVariant()); -} - // Check the configuration errors and return a flag mask. Provide a quick check and // a verbose one with a list of errors. @@ -343,46 +230,6 @@ Tasks DebuggerKitAspect::validateDebugger(const Kit *k) return result; } -KitAspect *DebuggerKitAspectFactory::createKitAspect(Kit *k) const -{ - return new Internal::DebuggerKitAspectImpl(k, this); -} - -void DebuggerKitAspectFactory::addToMacroExpander(Kit *kit, MacroExpander *expander) const -{ - QTC_ASSERT(kit, return); - expander->registerVariable("Debugger:Name", Tr::tr("Name of Debugger"), - [kit]() -> QString { - const DebuggerItem *item = DebuggerKitAspect::debugger(kit); - return item ? item->displayName() : Tr::tr("Unknown debugger"); - }); - - expander->registerVariable("Debugger:Type", Tr::tr("Type of Debugger Backend"), - [kit]() -> QString { - const DebuggerItem *item = DebuggerKitAspect::debugger(kit); - return item ? item->engineTypeName() : Tr::tr("Unknown debugger type"); - }); - - expander->registerVariable("Debugger:Version", Tr::tr("Debugger"), - [kit]() -> QString { - const DebuggerItem *item = DebuggerKitAspect::debugger(kit); - return item && !item->version().isEmpty() - ? item->version() : Tr::tr("Unknown debugger version"); - }); - - expander->registerVariable("Debugger:Abi", Tr::tr("Debugger"), - [kit]() -> QString { - const DebuggerItem *item = DebuggerKitAspect::debugger(kit); - return item && !item->abis().isEmpty() - ? item->abiNames().join(' ') - : Tr::tr("Unknown debugger ABI"); - }); -} - -KitAspectFactory::ItemList DebuggerKitAspectFactory::toUserOutput(const Kit *k) const -{ - return {{Tr::tr("Debugger"), DebuggerKitAspect::displayString(k)}}; -} DebuggerEngineType DebuggerKitAspect::engineType(const Kit *k) { @@ -414,4 +261,171 @@ Utils::Id DebuggerKitAspect::id() return "Debugger.Information"; } +// DebuggerKitAspectFactory + +class DebuggerKitAspectFactory : public KitAspectFactory +{ +public: + DebuggerKitAspectFactory() + { + setObjectName("DebuggerKitAspect"); + setId(DebuggerKitAspect::id()); + setDisplayName(Tr::tr("Debugger")); + setDescription(Tr::tr("The debugger to use for this kit.")); + setPriority(28000); + } + + Tasks validate(const Kit *k) const override + { + return DebuggerKitAspect::validateDebugger(k); + } + + void setup(Kit *k) override + { + QTC_ASSERT(k, return); + + // This can be anything (Id, binary path, "auto") + // With 3.0 we have: + // <value type="QString" key="Debugger.Information">{75ecf347-f221-44c3-b613-ea1d29929cd4}</value> + // Before we had: + // <valuemap type="QVariantMap" key="Debugger.Information"> + // <value type="QString" key="Binary">/data/dev/debugger/gdb-git/gdb/gdb</value> + // <value type="int" key="EngineType">1</value> + // </valuemap> + // Or for force auto-detected CDB + // <valuemap type="QVariantMap" key="Debugger.Information"> + // <value type="QString" key="Binary">auto</value> + // <value type="int" key="EngineType">4</value> + // </valuemap> + const QVariant rawId = k->value(DebuggerKitAspectFactory::id()); + + const Abi tcAbi = ToolChainKitAspect::targetAbi(k); + + // Get the best of the available debugger matching the kit's toolchain. + // The general idea is to find an item that exactly matches what + // is stored in the kit information, but also accept item based + // on toolchain matching as fallback with a lower priority. + + DebuggerItem bestItem; + DebuggerItem::MatchLevel bestLevel = DebuggerItem::DoesNotMatch; + const Environment systemEnvironment = Environment::systemEnvironment(); + for (const DebuggerItem &item : DebuggerItemManager::debuggers()) { + DebuggerItem::MatchLevel level = DebuggerItem::DoesNotMatch; + + if (rawId.isNull()) { + // Initial setup of a kit. + level = item.matchTarget(tcAbi); + // Hack to prefer a debugger from PATH (e.g. autodetected) over other matches. + // This improves the situation a bit if a cross-compilation tool chain has the + // same ABI as the host. + if (level == DebuggerItem::MatchesPerfectly + && !item.command().needsDevice() + && systemEnvironment.path().contains(item.command().parentDir())) { + level = DebuggerItem::MatchesPerfectlyInPath; + } + if (!item.detectionSource().isEmpty() && item.detectionSource() == k->autoDetectionSource()) + level = DebuggerItem::MatchLevel(level + 2); + } else if (rawId.type() == QVariant::String) { + // New structure. + if (item.id() == rawId) { + // Detected by ID. + level = DebuggerItem::MatchesPerfectly; + } else { + // This item does not match by ID, and is an unlikely candidate. + // However, consider using it as fallback if the tool chain fits. + level = std::min(item.matchTarget(tcAbi), DebuggerItem::MatchesSomewhat); + } + } else { + // Old structure. + const QMap<QString, QVariant> map = rawId.toMap(); + QString binary = map.value("Binary").toString(); + if (binary == "auto") { + // This is close to the "new kit" case, except that we know + // an engine type. + DebuggerEngineType autoEngine = DebuggerEngineType(map.value("EngineType").toInt()); + if (item.engineType() == autoEngine) { + // Use item if host toolchain fits, but only as fallback. + level = std::min(item.matchTarget(tcAbi), DebuggerItem::MatchesSomewhat); + } + } else { + // We have an executable path. + FilePath fileName = FilePath::fromUserInput(binary); + if (item.command() == fileName) { + // And it's is the path of this item. + level = std::min(item.matchTarget(tcAbi), DebuggerItem::MatchesSomewhat); + } else { + // This item does not match by filename, and is an unlikely candidate. + // However, consider using it as fallback if the tool chain fits. + level = std::min(item.matchTarget(tcAbi), DebuggerItem::MatchesSomewhat); + } + } + } + + if (level > bestLevel) { + bestLevel = level; + bestItem = item; + } else if (level == bestLevel) { + if (item.engineType() == bestItem.engineType()) { + const QStringList itemVersion = item.version().split('.'); + const QStringList bestItemVersion = bestItem.version().split('.'); + int end = qMax(item.version().size(), bestItemVersion.size()); + for (int i = 0; i < end; ++i) { + if (itemVersion.value(i) == bestItemVersion.value(i)) + continue; + if (itemVersion.value(i).toInt() > bestItemVersion.value(i).toInt()) + bestItem = item; + break; + } + } + } + } + + // Use the best id we found, or an invalid one. + k->setValue(DebuggerKitAspect::id(), bestLevel != DebuggerItem::DoesNotMatch ? bestItem.id() : QVariant()); + } + + KitAspect *createKitAspect(Kit *k) const override + { + return new Internal::DebuggerKitAspectImpl(k, this); + } + + void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override + { + QTC_ASSERT(kit, return); + expander->registerVariable("Debugger:Name", Tr::tr("Name of Debugger"), + [kit]() -> QString { + const DebuggerItem *item = DebuggerKitAspect::debugger(kit); + return item ? item->displayName() : Tr::tr("Unknown debugger"); + }); + + expander->registerVariable("Debugger:Type", Tr::tr("Type of Debugger Backend"), + [kit]() -> QString { + const DebuggerItem *item = DebuggerKitAspect::debugger(kit); + return item ? item->engineTypeName() : Tr::tr("Unknown debugger type"); + }); + + expander->registerVariable("Debugger:Version", Tr::tr("Debugger"), + [kit]() -> QString { + const DebuggerItem *item = DebuggerKitAspect::debugger(kit); + return item && !item->version().isEmpty() + ? item->version() : Tr::tr("Unknown debugger version"); + }); + + expander->registerVariable("Debugger:Abi", Tr::tr("Debugger"), + [kit]() -> QString { + const DebuggerItem *item = DebuggerKitAspect::debugger(kit); + return item && !item->abis().isEmpty() + ? item->abiNames().join(' ') + : Tr::tr("Unknown debugger ABI"); + }); + } + + ItemList toUserOutput(const Kit *k) const override + { + return {{Tr::tr("Debugger"), DebuggerKitAspect::displayString(k)}}; + } +}; + +const DebuggerKitAspectFactory debuggerKitAspectFactory; + } // namespace Debugger diff --git a/src/plugins/debugger/debuggerkitinformation.h b/src/plugins/debugger/debuggerkitinformation.h index c6f8add9254..f4619892c3a 100644 --- a/src/plugins/debugger/debuggerkitinformation.h +++ b/src/plugins/debugger/debuggerkitinformation.h @@ -7,10 +7,9 @@ #include "debuggerconstants.h" #include <projectexplorer/kitaspects.h> -#include <projectexplorer/runconfiguration.h> +#include <projectexplorer/runcontrol.h> namespace Debugger { -class DebuggerItem; class DEBUGGER_EXPORT DebuggerKitAspect { @@ -28,7 +27,7 @@ public: static ProjectExplorer::Tasks validateDebugger(const ProjectExplorer::Kit *k); static ConfigurationErrors configurationErrors(const ProjectExplorer::Kit *k); - static const DebuggerItem *debugger(const ProjectExplorer::Kit *kit); + static const class DebuggerItem *debugger(const ProjectExplorer::Kit *kit); static ProjectExplorer::Runnable runnable(const ProjectExplorer::Kit *kit); static void setDebugger(ProjectExplorer::Kit *k, const QVariant &id); static DebuggerEngineType engineType(const ProjectExplorer::Kit *k); @@ -36,20 +35,4 @@ public: static Utils::Id id(); }; -class DEBUGGER_EXPORT DebuggerKitAspectFactory : public ProjectExplorer::KitAspectFactory -{ -public: - DebuggerKitAspectFactory(); - - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override - { return DebuggerKitAspect::validateDebugger(k); } - - void setup(ProjectExplorer::Kit *k) override; - - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const override; - void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override; - - ItemList toUserOutput(const ProjectExplorer::Kit *k) const override; -}; - } // Debugger diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 9c313d45d16..5fcef5bc33c 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -60,6 +60,7 @@ #include <projectexplorer/devicesupport/deviceprocessesdialog.h> #include <projectexplorer/devicesupport/sshparameters.h> #include <projectexplorer/itaskhandler.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorericons.h> @@ -687,8 +688,6 @@ public: Perspective m_perspective{Constants::PRESET_PERSPECTIVE_ID, Tr::tr("Debugger")}; std::unique_ptr<Perspective> m_perspectiveCmake; - DebuggerKitAspectFactory debuggerKitAspect; - DebuggerRunWorkerFactory debuggerWorkerFactory; // FIXME: Needed? diff --git a/src/plugins/debugger/unstartedappwatcherdialog.cpp b/src/plugins/debugger/unstartedappwatcherdialog.cpp index 84cdc73c16b..248d90c0398 100644 --- a/src/plugins/debugger/unstartedappwatcherdialog.cpp +++ b/src/plugins/debugger/unstartedappwatcherdialog.cpp @@ -12,6 +12,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/kit.h> #include <projectexplorer/kitchooser.h> +#include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> From 1036c776f5b46558b54b36652bcbe1012f713840 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 15 Aug 2023 14:10:23 +0200 Subject: [PATCH 0725/1777] CMake: add environment variable for ccache support Add another environment variable whether CMake should check for ccache and adjust the compiler options accordingly when building Qt Creator. Change-Id: I796f29d7f6ad4a1f054f978d50dbd0120b873aea Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- cmake/QtCreatorAPI.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index d799637d645..5d2a251f6ee 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -37,13 +37,14 @@ list(APPEND DEFAULT_DEFINES # use CMAKE_CURRENT_FUNCTION_LIST_DIR when we can require CMake 3.17 set(_THIS_MODULE_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}") +env_with_default("QTC_WITH_CCACHE_SUPPORT" ENV_WITH_CCACHE_SUPPORT OFF) option(BUILD_PLUGINS_BY_DEFAULT "Build plugins by default. This can be used to build all plugins by default, or none." ON) option(BUILD_EXECUTABLES_BY_DEFAULT "Build executables by default. This can be used to build all executables by default, or none." ON) option(BUILD_LIBRARIES_BY_DEFAULT "Build libraries by default. This can be used to build all libraries by default, or none." ON) option(BUILD_TESTS_BY_DEFAULT "Build tests by default. This can be used to build all tests by default, or none." ON) option(QTC_SEPARATE_DEBUG_INFO "Extract debug information from binary files." OFF) option(WITH_SCCACHE_SUPPORT "Enables support for building with SCCACHE and separate debug info with MSVC, which SCCACHE normally doesn't support." OFF) -option(WITH_CCACHE_SUPPORT "Enables support for building with CCACHE and separate debug info with MSVC, which CCACHE normally doesn't support." OFF) +option(WITH_CCACHE_SUPPORT "Enables support for building with CCACHE and separate debug info with MSVC, which CCACHE normally doesn't support." "${ENV_WITH_CCACHE_SUPPORT}") option(QTC_STATIC_BUILD "Builds libraries and plugins as static libraries" OFF) # If we provide a list of plugins, executables, libraries, then the BUILD_<type>_BY_DEFAULT will be set to OFF From 2a07253a424fb31ab139a6a8bb2ddc26082817d2 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 15 Aug 2023 15:47:33 +0200 Subject: [PATCH 0726/1777] Debugger: Rename debuggerkitinformation.{cpp,h} ... to debuggerkitaspect.{cpp,h} Change-Id: Ia6316fcdc893ca066933658a52c78ef1587a76e8 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/android/androidconfigurations.cpp | 2 +- src/plugins/android/androiddebugsupport.cpp | 2 +- src/plugins/android/androidrunnerworker.cpp | 2 +- src/plugins/autotest/testrunner.cpp | 2 +- src/plugins/baremetal/baremetaldebugsupport.cpp | 2 +- src/plugins/baremetal/debugservers/uvsc/uvproject.cpp | 2 +- src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp | 2 +- src/plugins/debugger/CMakeLists.txt | 2 +- src/plugins/debugger/debugger.qbs | 2 +- .../{debuggerkitinformation.cpp => debuggerkitaspect.cpp} | 2 +- .../debugger/{debuggerkitinformation.h => debuggerkitaspect.h} | 0 src/plugins/debugger/debuggerplugin.cpp | 2 +- src/plugins/debugger/debuggerruncontrol.cpp | 2 +- src/plugins/debugger/loadcoredialog.cpp | 2 +- src/plugins/debugger/unstartedappwatcherdialog.cpp | 2 +- src/plugins/ios/iosconfigurations.cpp | 2 +- src/plugins/ios/iosrunner.cpp | 2 +- src/plugins/mcusupport/mcukitmanager.cpp | 2 +- src/plugins/mcusupport/mcusupportoptions.cpp | 2 +- src/plugins/qnx/qnxdebugsupport.cpp | 2 +- src/plugins/qnx/qnxsettingspage.cpp | 2 +- src/plugins/valgrind/memchecktool.cpp | 2 +- 22 files changed, 21 insertions(+), 21 deletions(-) rename src/plugins/debugger/{debuggerkitinformation.cpp => debuggerkitaspect.cpp} (99%) rename src/plugins/debugger/{debuggerkitinformation.h => debuggerkitaspect.h} (100%) diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index b12014d4c7f..a4c73f8e6d6 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -24,7 +24,7 @@ #include <debugger/debuggeritemmanager.h> #include <debugger/debuggeritem.h> -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <qtsupport/baseqtversion.h> #include <qtsupport/qtkitaspect.h> diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp index ee72741d411..7b836171502 100644 --- a/src/plugins/android/androiddebugsupport.cpp +++ b/src/plugins/android/androiddebugsupport.cpp @@ -8,7 +8,7 @@ #include "androidmanager.h" #include "androidqtversion.h" -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <debugger/debuggerrunconfigurationaspect.h> #include <debugger/debuggerruncontrol.h> diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index f8dd558b224..3dd6182b87a 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -7,7 +7,7 @@ #include "androidrunnerworker.h" #include "androidtr.h" -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <debugger/debuggerrunconfigurationaspect.h> #include <projectexplorer/buildconfiguration.h> diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index f1a878a23cc..6c21d9f657e 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -16,7 +16,7 @@ #include <coreplugin/icore.h> #include <coreplugin/progressmanager/taskprogress.h> -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <debugger/debuggerruncontrol.h> #include <projectexplorer/buildconfiguration.h> diff --git a/src/plugins/baremetal/baremetaldebugsupport.cpp b/src/plugins/baremetal/baremetaldebugsupport.cpp index 113e784dd14..18aad498535 100644 --- a/src/plugins/baremetal/baremetaldebugsupport.cpp +++ b/src/plugins/baremetal/baremetaldebugsupport.cpp @@ -10,7 +10,7 @@ #include "debugserverprovidermanager.h" #include "idebugserverprovider.h" -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <debugger/debuggerruncontrol.h> #include <projectexplorer/buildconfiguration.h> diff --git a/src/plugins/baremetal/debugservers/uvsc/uvproject.cpp b/src/plugins/baremetal/debugservers/uvsc/uvproject.cpp index 6b3bd5b42ed..abe6fecdc3c 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvproject.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvproject.cpp @@ -6,7 +6,7 @@ #include <cppeditor/cppmodelmanager.h> -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <debugger/debuggerruncontrol.h> #include <projectexplorer/projectmanager.h> diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index bb894a688d7..951f0391ec7 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -13,7 +13,7 @@ #include <baremetal/baremetaltr.h> #include <baremetal/debugserverprovidermanager.h> -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <debugger/debuggerruncontrol.h> #include <projectexplorer/project.h> diff --git a/src/plugins/debugger/CMakeLists.txt b/src/plugins/debugger/CMakeLists.txt index 08998caf3e2..aea2effcf2e 100644 --- a/src/plugins/debugger/CMakeLists.txt +++ b/src/plugins/debugger/CMakeLists.txt @@ -41,7 +41,7 @@ add_qtc_plugin(Debugger debuggerinternalconstants.h debuggeritem.cpp debuggeritem.h debuggeritemmanager.cpp debuggeritemmanager.h - debuggerkitinformation.cpp debuggerkitinformation.h + debuggerkitaspect.cpp debuggerkitaspect.h debuggermainwindow.cpp debuggermainwindow.h debuggerplugin.cpp debuggerplugin.h debuggerprotocol.cpp debuggerprotocol.h diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index a2aff836719..5433184ffe9 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -47,7 +47,7 @@ Project { "debuggerinternalconstants.h", "debuggeritem.cpp", "debuggeritem.h", "debuggeritemmanager.cpp", "debuggeritemmanager.h", - "debuggerkitinformation.cpp", "debuggerkitinformation.h", + "debuggerkitaspect.cpp", "debuggerkitaspect.h", "debuggermainwindow.cpp", "debuggermainwindow.h", "debuggerplugin.cpp", "debuggerplugin.h", "debuggerprotocol.cpp", "debuggerprotocol.h", diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitaspect.cpp similarity index 99% rename from src/plugins/debugger/debuggerkitinformation.cpp rename to src/plugins/debugger/debuggerkitaspect.cpp index aedfae32dc7..54318360b82 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitaspect.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "debuggerkitinformation.h" +#include "debuggerkitaspect.h" #include "debuggeritemmanager.h" #include "debuggeritem.h" diff --git a/src/plugins/debugger/debuggerkitinformation.h b/src/plugins/debugger/debuggerkitaspect.h similarity index 100% rename from src/plugins/debugger/debuggerkitinformation.h rename to src/plugins/debugger/debuggerkitaspect.h diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 5fcef5bc33c..cf14b8ec280 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -14,7 +14,7 @@ #include "debuggermainwindow.h" #include "debuggerrunconfigurationaspect.h" #include "debuggerruncontrol.h" -#include "debuggerkitinformation.h" +#include "debuggerkitaspect.h" #include "debuggertr.h" #include "breakhandler.h" #include "enginemanager.h" diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 2a578787426..a1c1f8b0331 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -11,7 +11,7 @@ #include "debuggeractions.h" #include "debuggerengine.h" #include "debuggerinternalconstants.h" -#include "debuggerkitinformation.h" +#include "debuggerkitaspect.h" #include "debuggerrunconfigurationaspect.h" #include "breakhandler.h" #include "enginemanager.h" diff --git a/src/plugins/debugger/loadcoredialog.cpp b/src/plugins/debugger/loadcoredialog.cpp index 6c57b593e13..f78c18344e3 100644 --- a/src/plugins/debugger/loadcoredialog.cpp +++ b/src/plugins/debugger/loadcoredialog.cpp @@ -3,7 +3,7 @@ #include "loadcoredialog.h" -#include "debuggerkitinformation.h" +#include "debuggerkitaspect.h" #include "debuggertr.h" #include "gdb/gdbengine.h" diff --git a/src/plugins/debugger/unstartedappwatcherdialog.cpp b/src/plugins/debugger/unstartedappwatcherdialog.cpp index 248d90c0398..936d4f1be5f 100644 --- a/src/plugins/debugger/unstartedappwatcherdialog.cpp +++ b/src/plugins/debugger/unstartedappwatcherdialog.cpp @@ -4,7 +4,7 @@ #include "unstartedappwatcherdialog.h" #include "debuggeritem.h" -#include "debuggerkitinformation.h" +#include "debuggerkitaspect.h" #include "debuggertr.h" #include <utils/pathchooser.h> diff --git a/src/plugins/ios/iosconfigurations.cpp b/src/plugins/ios/iosconfigurations.cpp index 897f8e33ca1..a2dcdf2f940 100644 --- a/src/plugins/ios/iosconfigurations.cpp +++ b/src/plugins/ios/iosconfigurations.cpp @@ -23,7 +23,7 @@ #include <debugger/debuggeritemmanager.h> #include <debugger/debuggeritem.h> -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <qtsupport/baseqtversion.h> #include <qtsupport/qtkitaspect.h> diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index 973185f041d..979ada34746 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -12,7 +12,7 @@ #include "iostr.h" #include <debugger/debuggerconstants.h> -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <debugger/debuggerplugin.h> #include <debugger/debuggerruncontrol.h> diff --git a/src/plugins/mcusupport/mcukitmanager.cpp b/src/plugins/mcusupport/mcukitmanager.cpp index edb861be464..f027c3df56e 100644 --- a/src/plugins/mcusupport/mcukitmanager.cpp +++ b/src/plugins/mcusupport/mcukitmanager.cpp @@ -20,7 +20,7 @@ #include <debugger/debuggeritem.h> #include <debugger/debuggeritemmanager.h> -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/toolchain.h> diff --git a/src/plugins/mcusupport/mcusupportoptions.cpp b/src/plugins/mcusupport/mcusupportoptions.cpp index 59a24602b60..f77aff8a8e1 100644 --- a/src/plugins/mcusupport/mcusupportoptions.cpp +++ b/src/plugins/mcusupport/mcusupportoptions.cpp @@ -18,7 +18,7 @@ #include <cmakeprojectmanager/cmaketoolmanager.h> #include <coreplugin/helpmanager.h> #include <coreplugin/icore.h> -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <utils/algorithm.h> #include <utils/filepath.h> #include <utils/infobar.h> diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index e8473a2b3d2..7d915bb70c8 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -10,7 +10,7 @@ #include <coreplugin/icore.h> -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <debugger/debuggerruncontrol.h> #include <debugger/debuggertr.h> diff --git a/src/plugins/qnx/qnxsettingspage.cpp b/src/plugins/qnx/qnxsettingspage.cpp index 12acfb43d36..a337bb3c51b 100644 --- a/src/plugins/qnx/qnxsettingspage.cpp +++ b/src/plugins/qnx/qnxsettingspage.cpp @@ -13,7 +13,7 @@ #include <debugger/debuggeritem.h> #include <debugger/debuggeritemmanager.h> -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/projectexplorerconstants.h> diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 158f4bb6e62..cc5aff5e987 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -16,7 +16,7 @@ #include "xmlprotocol/parser.h" #include "xmlprotocol/stack.h" -#include <debugger/debuggerkitinformation.h> +#include <debugger/debuggerkitaspect.h> #include <debugger/debuggerruncontrol.h> #include <debugger/analyzer/analyzerconstants.h> #include <debugger/analyzer/analyzermanager.h> From 0ad7ec451876924a64b420b25189fcf6d8eb286e Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 15 Aug 2023 18:16:27 +0200 Subject: [PATCH 0727/1777] RunWorker: Remove unused method Change-Id: I02da4d0336949c24000a70a6f4364fe80b14dae8 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/runcontrol.cpp | 5 ----- src/plugins/projectexplorer/runcontrol.h | 1 - 2 files changed, 6 deletions(-) diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index a62a4b49b69..3d0fffecc7e 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1751,11 +1751,6 @@ void RunWorker::setSupportsReRunning(bool reRunningSupported) d->supportsReRunning = reRunningSupported; } -bool RunWorker::supportsReRunning() const -{ - return d->supportsReRunning; -} - QString RunWorker::userMessageForProcessError(QProcess::ProcessError error, const FilePath &program) { QString failedToStart = Tr::tr("The process failed to start."); diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index 5a31af66efe..5260a7bbecb 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -83,7 +83,6 @@ public: void reportFailure(const QString &msg = QString()); void setSupportsReRunning(bool reRunningSupported); - bool supportsReRunning() const; static QString userMessageForProcessError(QProcess::ProcessError, const Utils::FilePath &programName); From cf35cf326bfa8a7f7b305102900b3bc2b1092960 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 16 Aug 2023 09:41:52 +0200 Subject: [PATCH 0728/1777] ProjectExplorer: Use some better names for local variables In KitManagerConfigWidget, plus a bit of style cleanup. Change-Id: I6e28f697267c5e51d95a734cb2fe989346ac016b Reviewed-by: David Schulz <david.schulz@qt.io> --- .../kitmanagerconfigwidget.cpp | 48 +++++++++---------- .../projectexplorer/kitmanagerconfigwidget.h | 2 +- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index 05f233fd0e3..da825d5169d 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -30,19 +30,18 @@ #include <QToolButton> #include <QSizePolicy> -static const char WORKING_COPY_KIT_ID[] = "modified kit"; +const char WORKING_COPY_KIT_ID[] = "modified kit"; using namespace Utils; -namespace ProjectExplorer { -namespace Internal { +namespace ProjectExplorer::Internal { KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, bool &isDefaultKit, bool &hasUniqueName) : m_iconButton(new QToolButton), m_nameEdit(new QLineEdit), m_fileSystemFriendlyNameLineEdit(new QLineEdit), m_kit(k), - m_modifiedKit(std::make_unique<Kit>(Utils::Id(WORKING_COPY_KIT_ID))), + m_modifiedKit(std::make_unique<Kit>(Id(WORKING_COPY_KIT_ID))), m_isDefaultKit(isDefaultKit), m_hasUniqueName(hasUniqueName) { @@ -116,8 +115,8 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k, bool &isDefaultKit, bool KitManagerConfigWidget::~KitManagerConfigWidget() { - qDeleteAll(m_widgets); - m_widgets.clear(); + qDeleteAll(m_kitAspects); + m_kitAspects.clear(); // Make sure our workingCopy did not get registered somehow: QTC_CHECK(!Utils::contains(KitManager::kits(), @@ -135,7 +134,7 @@ QIcon KitManagerConfigWidget::displayIcon() const { // Special case: Extra warning if there are no errors but name is not unique. if (m_modifiedKit->isValid() && !m_hasUniqueName) { - static const QIcon warningIcon(Utils::Icons::WARNING.icon()); + static const QIcon warningIcon(Icons::WARNING.icon()); return warningIcon; } @@ -198,32 +197,32 @@ QString KitManagerConfigWidget::validityMessage() const void KitManagerConfigWidget::addAspectToWorkingCopy(Layouting::LayoutItem &parent, KitAspectFactory *factory) { QTC_ASSERT(factory, return); - KitAspect *widget = factory->createKitAspect(workingCopy()); - QTC_ASSERT(widget, return); - QTC_ASSERT(!m_widgets.contains(widget), return); + KitAspect *aspect = factory->createKitAspect(workingCopy()); + QTC_ASSERT(aspect, return); + QTC_ASSERT(!m_kitAspects.contains(aspect), return); - widget->addToLayoutWithLabel(parent, this); - m_widgets.append(widget); + aspect->addToLayoutWithLabel(parent, this); + m_kitAspects.append(aspect); - connect(widget->mutableAction(), &QAction::toggled, + connect(aspect->mutableAction(), &QAction::toggled, this, &KitManagerConfigWidget::dirty); } void KitManagerConfigWidget::updateVisibility() { - int count = m_widgets.count(); + int count = m_kitAspects.count(); for (int i = 0; i < count; ++i) { - KitAspect *widget = m_widgets.at(i); - const KitAspectFactory *ki = widget->kitInformation(); + KitAspect *aspect = m_kitAspects.at(i); + const KitAspectFactory *ki = aspect->kitInformation(); const bool visibleInKit = ki->isApplicableToKit(m_modifiedKit.get()); const bool irrelevant = m_modifiedKit->irrelevantAspects().contains(ki->id()); - widget->setVisible(visibleInKit && !irrelevant); + aspect->setVisible(visibleInKit && !irrelevant); } } void KitManagerConfigWidget::makeStickySubWidgetsReadOnly() { - for (KitAspect *w : std::as_const(m_widgets)) { + for (KitAspect *w : std::as_const(m_kitAspects)) { if (w->kit()->isSticky(w->kitInformation()->id())) w->makeReadOnly(); } @@ -241,7 +240,7 @@ bool KitManagerConfigWidget::isDefaultKit() const void KitManagerConfigWidget::setIcon() { - const Utils::Id deviceType = DeviceTypeKitAspect::deviceTypeId(m_modifiedKit.get()); + const Id deviceType = DeviceTypeKitAspect::deviceTypeId(m_modifiedKit.get()); QList<IDeviceFactory *> allDeviceFactories = IDeviceFactory::allDeviceFactories(); if (deviceType.isValid()) { const auto less = [deviceType](const IDeviceFactory *f1, const IDeviceFactory *f2) { @@ -286,7 +285,7 @@ void KitManagerConfigWidget::setIcon() void KitManagerConfigWidget::resetIcon() { - m_modifiedKit->setIconPath(Utils::FilePath()); + m_modifiedKit->setIconPath({}); emit dirty(); } @@ -314,7 +313,7 @@ void KitManagerConfigWidget::workingCopyWasUpdated(Kit *k) k->fix(); m_fixingKit = false; - for (KitAspect *w : std::as_const(m_widgets)) + for (KitAspect *w : std::as_const(m_kitAspects)) w->refresh(); m_cachedDisplayName.clear(); @@ -342,9 +341,8 @@ void KitManagerConfigWidget::kitWasUpdated(Kit *k) void KitManagerConfigWidget::showEvent(QShowEvent *event) { Q_UNUSED(event) - for (KitAspect *widget : std::as_const(m_widgets)) - widget->refresh(); + for (KitAspect *aspect : std::as_const(m_kitAspects)) + aspect->refresh(); } -} // namespace Internal -} // namespace ProjectExplorer +} // ProjectExplorer::Internal diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.h b/src/plugins/projectexplorer/kitmanagerconfigwidget.h index 5e516184a6d..86f637c5e35 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.h +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.h @@ -66,7 +66,7 @@ private: QToolButton *m_iconButton; QLineEdit *m_nameEdit; QLineEdit *m_fileSystemFriendlyNameLineEdit; - QList<KitAspect *> m_widgets; + QList<KitAspect *> m_kitAspects; Kit *m_kit; std::unique_ptr<Kit> m_modifiedKit; bool &m_isDefaultKit; From e9c1901bad44addf1f442f337ddc2b4f5f3d4d5a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 28 Jul 2023 17:02:51 +0200 Subject: [PATCH 0729/1777] Core: Use an aspect for the Patch tool path setting Change-Id: Ifc758fb4ac5d00a7b755ea06f3f6b98d53e7cc46 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/aspects.cpp | 5 +++++ src/libs/utils/aspects.h | 6 +++++ src/plugins/coreplugin/patchtool.cpp | 27 ++++++----------------- src/plugins/coreplugin/patchtool.h | 1 - src/plugins/coreplugin/systemsettings.cpp | 26 ++++++++-------------- src/plugins/coreplugin/systemsettings.h | 2 ++ 6 files changed, 29 insertions(+), 38 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 9268d325860..5cbd8f9bdbe 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -159,6 +159,11 @@ void BaseAspect::setDefaultVariantValue(const QVariant &value) QTC_CHECK(false); } +bool BaseAspect::isDefaultValue() const +{ + return defaultVariantValue() == variantValue(); +} + QVariant BaseAspect::defaultVariantValue() const { return {}; diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index b460356851a..33e72604753 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -60,6 +60,7 @@ public: virtual QVariant defaultVariantValue() const; virtual void setDefaultVariantValue(const QVariant &value); + virtual bool isDefaultValue() const; QString settingsKey() const; void setSettingsKey(const QString &settingsKey); @@ -278,6 +279,11 @@ public: internalToBuffer(); // Might be more than a plain copy. } + bool isDefaultValue() const override + { + return m_default == m_internal; + } + void setValue(const ValueType &value, Announcement howToAnnounce = DoEmit) { Changes changes; diff --git a/src/plugins/coreplugin/patchtool.cpp b/src/plugins/coreplugin/patchtool.cpp index 744282728a8..89144f7a27d 100644 --- a/src/plugins/coreplugin/patchtool.cpp +++ b/src/plugins/coreplugin/patchtool.cpp @@ -1,10 +1,12 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#include "patchtool.h" + #include "coreplugintr.h" #include "icore.h" #include "messagemanager.h" -#include "patchtool.h" +#include "systemsettings.h" #include <utils/environment.h> #include <utils/process.h> @@ -12,41 +14,26 @@ #include <QMessageBox> using namespace Utils; +using namespace Core::Internal; namespace Core { -const char settingsGroupC[] = "General"; -const char patchCommandKeyC[] = "PatchCommand"; -const char patchCommandDefaultC[] = "patch"; - FilePath PatchTool::patchCommand() { - QSettings *s = ICore::settings(); + FilePath command = systemSettings().patchCommand(); - s->beginGroup(settingsGroupC); - FilePath command = FilePath::fromSettings(s->value(patchCommandKeyC, patchCommandDefaultC)); - s->endGroup(); - - if (HostOsInfo::isWindowsHost() && command.path() == patchCommandDefaultC) { + if (HostOsInfo::isWindowsHost() && systemSettings().patchCommand.isDefaultValue()) { const QSettings settings(R"(HKEY_LOCAL_MACHINE\SOFTWARE\GitForWindows)", QSettings::NativeFormat); const FilePath gitInstall = FilePath::fromUserInput(settings.value("InstallPath").toString()); if (gitInstall.exists()) command = command.searchInPath({gitInstall.pathAppended("usr/bin")}, - Utils::FilePath::PrependToPath); + FilePath::PrependToPath); } return command; } -void PatchTool::setPatchCommand(const FilePath &newCommand) -{ - Utils::QtcSettings *s = ICore::settings(); - s->beginGroup(settingsGroupC); - s->setValueWithDefault(patchCommandKeyC, newCommand.toSettings(), QVariant(QString(patchCommandDefaultC))); - s->endGroup(); -} - bool PatchTool::confirmPatching(QWidget *parent, PatchAction patchAction, bool isModified) { const QString title = patchAction == PatchAction::Apply ? Tr::tr("Apply Chunk") diff --git a/src/plugins/coreplugin/patchtool.h b/src/plugins/coreplugin/patchtool.h index 020ab72eb6e..c509b502a2f 100644 --- a/src/plugins/coreplugin/patchtool.h +++ b/src/plugins/coreplugin/patchtool.h @@ -18,7 +18,6 @@ class CORE_EXPORT PatchTool { public: static Utils::FilePath patchCommand(); - static void setPatchCommand(const Utils::FilePath &newCommand); static bool confirmPatching(QWidget *parent, PatchAction patchAction, bool isModified); diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index 1fbede37599..a40930b980f 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -13,7 +13,6 @@ #include "icore.h" #include "iversioncontrol.h" #include "mainwindow.h" -#include "patchtool.h" #include "vcsmanager.h" #include <utils/algorithm.h> @@ -27,15 +26,12 @@ #include <utils/terminalcommand.h> #include <utils/unixutils.h> -#include <QCheckBox> #include <QComboBox> -#include <QCoreApplication> #include <QGuiApplication> #include <QLineEdit> #include <QMessageBox> #include <QPushButton> #include <QSettings> -#include <QSpinBox> #include <QToolButton> using namespace Utils; @@ -70,6 +66,13 @@ SystemSettings::SystemSettings() { setAutoApply(false); + patchCommand.setSettingsKey("General/PatchCommand"); + patchCommand.setDefaultValue("patch"); + patchCommand.setExpectedKind(PathChooser::ExistingCommand); + patchCommand.setHistoryCompleter("General.PatchCommand.History"); + patchCommand.setLabelText(Tr::tr("Patch command:")); + patchCommand.setToolTip(Tr::tr("Command used for reverting diff chunks.")); + autoSaveModifiedFiles.setSettingsKey("EditorManager/AutoSaveEnabled"); autoSaveModifiedFiles.setDefaultValue(true); autoSaveModifiedFiles.setLabelText(Tr::tr("Auto-save modified files")); @@ -163,7 +166,6 @@ public: , m_terminalComboBox(new QComboBox) , m_terminalOpenArgs(new QLineEdit) , m_terminalExecuteArgs(new QLineEdit) - , m_patchChooser(new Utils::PathChooser) , m_environmentChangesLabel(new Utils::ElidingLabel) , m_clearCrashReportsButton(new QPushButton(Tr::tr("Clear Local Crash Reports"))) , m_crashReportsSizeText(new QLabel) @@ -195,7 +197,6 @@ public: helpCrashReportingButton->setText(Tr::tr("?")); auto resetTerminalButton = new QPushButton(Tr::tr("Reset")); resetTerminalButton->setToolTip(Tr::tr("Reset to default.", "Terminal")); - auto patchCommandLabel = new QLabel(Tr::tr("Patch command:")); auto environmentButton = new QPushButton(Tr::tr("Change...")); environmentButton->setSizePolicy(QSizePolicy::Fixed, environmentButton->sizePolicy().verticalPolicy()); @@ -218,7 +219,7 @@ public: resetFileBrowserButton, helpExternalFileBrowserButton})}); } - form.addRow({patchCommandLabel, Span(2, m_patchChooser)}); + form.addRow({Span(3, s.patchCommand)}); if (HostOsInfo::isMacHost()) { form.addRow({fileSystemCaseSensitivityLabel, Span(2, Row{m_fileSystemCaseSensitivityChooser, st})}); @@ -258,13 +259,6 @@ public: m_externalFileBrowserEdit->setText(UnixUtils::fileBrowser(ICore::settings())); } - const QString patchToolTip = Tr::tr("Command used for reverting diff chunks."); - patchCommandLabel->setToolTip(patchToolTip); - m_patchChooser->setToolTip(patchToolTip); - m_patchChooser->setExpectedKind(PathChooser::ExistingCommand); - m_patchChooser->setHistoryCompleter(QLatin1String("General.PatchCommand.History")); - m_patchChooser->setFilePath(PatchTool::patchCommand()); - #ifdef ENABLE_CRASHPAD if (s.showCrashButton()) { auto crashButton = new QPushButton("CRASH!!!"); @@ -374,7 +368,6 @@ private: QComboBox *m_terminalComboBox; QLineEdit *m_terminalOpenArgs; QLineEdit *m_terminalExecuteArgs; - Utils::PathChooser *m_patchChooser; Utils::ElidingLabel *m_environmentChangesLabel; QPushButton *m_clearCrashReportsButton; QLabel *m_crashReportsSizeText; @@ -398,7 +391,6 @@ void SystemSettingsWidget::apply() UnixUtils::setFileBrowser(settings, m_externalFileBrowserEdit->text()); } } - PatchTool::setPatchCommand(m_patchChooser->filePath()); if (HostOsInfo::isMacHost()) { const Qt::CaseSensitivity sensitivity = EditorManagerPrivate::readFileSystemSensitivity( @@ -440,7 +432,7 @@ void SystemSettingsWidget::updatePath() { Environment env; env.appendToPath(VcsManager::additionalToolsPath()); - m_patchChooser->setEnvironment(env); + systemSettings().patchCommand.setEnvironment(env); } void SystemSettingsWidget::updateEnvironmentChangesLabel() diff --git a/src/plugins/coreplugin/systemsettings.h b/src/plugins/coreplugin/systemsettings.h index 18126e29fc9..1b0415faf91 100644 --- a/src/plugins/coreplugin/systemsettings.h +++ b/src/plugins/coreplugin/systemsettings.h @@ -12,6 +12,8 @@ class SystemSettings final : public Utils::AspectContainer public: SystemSettings(); + Utils::FilePathAspect patchCommand{this}; + Utils::BoolAspect autoSaveModifiedFiles{this}; Utils::IntegerAspect autoSaveInterval{this}; From b79ffcf8a21f1e41c88b6b7272d3486ff8eefdb1 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 16 Aug 2023 10:36:55 +0200 Subject: [PATCH 0730/1777] Copilot: Fix qbs build Change-Id: I2fad66854b69345150fdd19fa7da18125f8590d9 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/copilot/copilot.qbs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/copilot/copilot.qbs b/src/plugins/copilot/copilot.qbs index 6d2b2100472..f95f17912a9 100644 --- a/src/plugins/copilot/copilot.qbs +++ b/src/plugins/copilot/copilot.qbs @@ -7,6 +7,7 @@ QtcPlugin { Depends { name: "LanguageClient" } Depends { name: "ProjectExplorer" } Depends { name: "TextEditor" } + Depends { name: "app_version_header" } Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] } files: [ From fa011af1a06bca730a682e99fd50d8abe937b401 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 16 Aug 2023 08:07:33 +0200 Subject: [PATCH 0731/1777] ProjectExplorer: Avoid early creation of KitManager This was only meant as part of a safety net, but in the case that the situation this was guarding against actually happens we'd also notice by simply not seeing the effect. This is not different to any other place in the code where we e.g. create objects/widgets/... and don't put them in the right container. Change-Id: I0700fd3ca235662b718cf01229211a4eebec8a9a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/kitmanager.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 011e9ccc7db..989cd99e79d 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -651,13 +651,6 @@ void KitManager::completeKit(Kit *k) KitAspectFactory::KitAspectFactory() { kitAspectFactoriesStorage().addKitAspect(this); - - // Adding aspects created by this factory to possibly already existing kits is - // currently not needed here as kits are only created after all factories - // are created in *Plugin::initialize() or plugin load. - // Make sure we notice when this assumption breaks: - KitManager::instance(); // Ensure existence - QTC_CHECK(d->m_kitList.empty()); } KitAspectFactory::~KitAspectFactory() From f21282cb2d73ebd1e09968eb97d1e656b39019dd Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 16 Aug 2023 08:33:06 +0200 Subject: [PATCH 0732/1777] ProjectExplorer: Simplify KitManagerPrivate access Change-Id: Ia4e97a93899c7cd90d97a4cfaa6098cd2b395cc8 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/projectexplorer/kitmanager.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 989cd99e79d..b16bb466932 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -113,11 +113,6 @@ public: std::vector<std::unique_ptr<Kit>> m_kitList; std::unique_ptr<PersistentSettingsWriter> m_writer; QSet<Id> m_irrelevantAspects; - - void setBinaryForKit(const FilePath &fp) { m_binaryForKit = fp; } - FilePath binaryForKit() const { return m_binaryForKit; } - -private: FilePath m_binaryForKit; }; @@ -243,8 +238,8 @@ void KitManager::restoreKits() return false; }; - const Abis abisOfBinary = d->binaryForKit().isEmpty() - ? Abis() : Abi::abisOfBinary(d->binaryForKit()); + const Abis abisOfBinary = d->m_binaryForKit.isEmpty() + ? Abis() : Abi::abisOfBinary(d->m_binaryForKit); const auto kitMatchesAbiOfBinary = [&abisOfBinary](const Kit *kit) { return kitMatchesAbiList(kit, abisOfBinary); }; @@ -463,7 +458,7 @@ bool KitManager::isLoaded() void KitManager::setBinaryForKit(const FilePath &binary) { QTC_ASSERT(d, return); - d->setBinaryForKit(binary); + d->m_binaryForKit = binary; } QList<Kit *> KitManager::sortKits(const QList<Kit *> &kits) From c40a802e70c2d0e93d262f437b0524d1f723ccd4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 16 Aug 2023 08:20:31 +0200 Subject: [PATCH 0733/1777] ProjectExplorer: Postpone set up of kit save connection Does not require early access to ICore::instance(), and there's no point in attempting to save kits before they werde set up. Change-Id: I68953c6019e14e88655ddb46b30ebb9f1916ec46 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/projectexplorer/kitmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index b16bb466932..2c95c1edf05 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -134,8 +134,6 @@ KitManager::KitManager() { d = new KitManagerPrivate; - connect(ICore::instance(), &ICore::saveSettingsRequested, this, &KitManager::saveKits); - connect(this, &KitManager::kitAdded, this, &KitManager::kitsChanged); connect(this, &KitManager::kitRemoved, this, &KitManager::kitsChanged); connect(this, &KitManager::kitUpdated, this, &KitManager::kitsChanged); @@ -151,6 +149,8 @@ void KitManager::restoreKits() { QTC_ASSERT(!d->m_initialized, return ); + connect(ICore::instance(), &ICore::saveSettingsRequested, &KitManager::saveKits); + std::vector<std::unique_ptr<Kit>> resultList; // read all kits from user file From 6f2b237ecf8930b7b262ed41abf9f6e197f8c11b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 16 Aug 2023 09:03:06 +0200 Subject: [PATCH 0734/1777] ProjectExplorer: Change KitManager::sortKits() ... to sortedKits(). Simplifies the caller side and saves one temporary container. Change-Id: Id87a1ba0779e6f09cd6575808c4d05c126900f0f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/projectexplorer/kitchooser.cpp | 3 +-- src/plugins/projectexplorer/kitmanager.cpp | 9 +++++---- src/plugins/projectexplorer/kitmanager.h | 3 +-- src/plugins/projectexplorer/kitmodel.cpp | 3 +-- src/plugins/projectexplorer/targetsettingspanel.cpp | 3 +-- src/plugins/projectexplorer/targetsetuppage.cpp | 3 +-- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/plugins/projectexplorer/kitchooser.cpp b/src/plugins/projectexplorer/kitchooser.cpp index f5eff5dc88f..b4d0031cd45 100644 --- a/src/plugins/projectexplorer/kitchooser.cpp +++ b/src/plugins/projectexplorer/kitchooser.cpp @@ -102,8 +102,7 @@ void KitChooser::populate() m_hasStartupKit = true; } } - const QList<Kit *> kits = KitManager::sortKits(KitManager::kits()); - for (Kit *kit : kits) { + for (Kit *kit : KitManager::sortedKits()) { if (m_kitPredicate(kit)) { m_chooser->addItem(kitText(kit), kit->id().toSetting()); const int pos = m_chooser->count() - 1; diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 2c95c1edf05..7f7658cf4cc 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -461,15 +461,16 @@ void KitManager::setBinaryForKit(const FilePath &binary) d->m_binaryForKit = binary; } -QList<Kit *> KitManager::sortKits(const QList<Kit *> &kits) +const QList<Kit *> KitManager::sortedKits() { // This method was added to delay the sorting of kits as long as possible. // Since the displayName can contain variables it can be costly (e.g. involve // calling executables to find version information, etc.) to call that // method! // Avoid lots of potentially expensive calls to Kit::displayName(): - QList<QPair<QString, Kit *>> sortList = Utils::transform(kits, [](Kit *k) { - return qMakePair(k->displayName(), k); + std::vector<QPair<QString, Kit *>> sortList = + Utils::transform(d->m_kitList, [](const std::unique_ptr<Kit> &k) { + return qMakePair(k->displayName(), k.get()); }); Utils::sort(sortList, [](const QPair<QString, Kit *> &a, const QPair<QString, Kit *> &b) -> bool { @@ -477,7 +478,7 @@ QList<Kit *> KitManager::sortKits(const QList<Kit *> &kits) return a.second < b.second; return a.first < b.first; }); - return Utils::transform(sortList, &QPair<QString, Kit *>::second); + return Utils::transform<QList>(sortList, &QPair<QString, Kit *>::second); } static KitList restoreKitsHelper(const FilePath &fileName) diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index 284683e7e34..f90e0a0b5c1 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -135,6 +135,7 @@ public: static KitManager *instance(); static const QList<Kit *> kits(); + static const QList<Kit *> sortedKits(); // Avoid sorting whenever possible! static Kit *kit(const Kit::Predicate &predicate); static Kit *kit(Utils::Id id); static Kit *defaultKit(); @@ -147,8 +148,6 @@ public: static void deregisterKit(Kit *k); static void setDefaultKit(Kit *k); - static QList<Kit *> sortKits(const QList<Kit *> &kits); // Avoid sorting whenever possible! - static void saveKits(); static bool isLoaded(); diff --git a/src/plugins/projectexplorer/kitmodel.cpp b/src/plugins/projectexplorer/kitmodel.cpp index 1011ffd100f..4981a19d25b 100644 --- a/src/plugins/projectexplorer/kitmodel.cpp +++ b/src/plugins/projectexplorer/kitmodel.cpp @@ -159,8 +159,7 @@ KitModel::KitModel(QBoxLayout *parentLayout, QObject *parent) rootItem()->appendChild(m_autoRoot); rootItem()->appendChild(m_manualRoot); - const QList<Kit *> kits = KitManager::sortKits(KitManager::kits()); - for (Kit *k : kits) + for (Kit *k : KitManager::sortedKits()) addKit(k); changeDefaultKit(); diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index 313588c8006..0a95a7219b5 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -764,8 +764,7 @@ void TargetGroupItemPrivate::rebuildContents() { q->removeChildren(); - const QList<Kit *> kits = KitManager::sortKits(KitManager::kits()); - for (Kit *kit : kits) + for (Kit *kit : KitManager::sortedKits()) q->appendChild(new TargetItem(m_project, kit->id(), m_project->projectIssues(kit))); if (q->parent()) diff --git a/src/plugins/projectexplorer/targetsetuppage.cpp b/src/plugins/projectexplorer/targetsetuppage.cpp index 24f31fe2304..5c18b017927 100644 --- a/src/plugins/projectexplorer/targetsetuppage.cpp +++ b/src/plugins/projectexplorer/targetsetuppage.cpp @@ -302,8 +302,7 @@ bool TargetSetupPage::isComplete() const void TargetSetupPagePrivate::setupWidgets(const QString &filterText) { - const auto kitList = KitManager::sortKits(KitManager::kits()); - for (Kit *k : kitList) { + for (Kit *k : KitManager::sortedKits()) { if (!filterText.isEmpty() && !k->displayName().contains(filterText, Qt::CaseInsensitive)) continue; const auto widget = new TargetSetupWidget(k, m_projectPath); From 054394eec24aa5933d73d100e9e538eaaa1d4784 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 11:55:13 +0200 Subject: [PATCH 0735/1777] Valgrind: Add task adapter for Parser Change-Id: I164305299edf4ce3c665034c7c1f8d7ad2ee9b66 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/xmlprotocol/parser.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/valgrind/xmlprotocol/parser.h b/src/plugins/valgrind/xmlprotocol/parser.h index dcf435f9675..61050076b78 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.h +++ b/src/plugins/valgrind/xmlprotocol/parser.h @@ -3,6 +3,8 @@ #pragma once +#include <solutions/tasking/tasktree.h> + #include <QObject> QT_BEGIN_NAMESPACE @@ -49,4 +51,13 @@ private: std::unique_ptr<ParserPrivate> d; }; +class ParserTaskAdapter : public Tasking::TaskAdapter<Parser> +{ +public: + ParserTaskAdapter() { connect(task(), &Parser::done, this, &Tasking::TaskInterface::done); } + void start() final { task()->start(); } +}; + } // Valgrind::XmlProtocol + +TASKING_DECLARE_TASK(ParserTask, Valgrind::XmlProtocol::ParserTaskAdapter); From 74c7ec35bcecee31c393d7baa90fa3ad1dde2b19 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 12:01:36 +0200 Subject: [PATCH 0736/1777] ValgrindRunner: Establish connections in private c'tor Change-Id: I3238c1dc09008484b270a0904688bc4a7b6e10cc Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/valgrindrunner.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index 1447cf1e4d9..d6dd5eb7496 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -43,6 +43,13 @@ public: connect(&m_xmlServer, &QTcpServer::newConnection, this, &Private::xmlSocketConnected); connect(&m_logServer, &QTcpServer::newConnection, this, &Private::logSocketConnected); + + connect(&m_parser, &Parser::status, q, &ValgrindRunner::status); + connect(&m_parser, &Parser::error, q, &ValgrindRunner::error); + connect(&m_parser, &Parser::done, this, [this](bool success, const QString &err) { + if (!success) + emit q->internalError(err); + }); } void xmlSocketConnected(); @@ -159,15 +166,9 @@ bool ValgrindRunner::Private::run() } ValgrindRunner::ValgrindRunner(QObject *parent) - : QObject(parent), d(new Private(this)) -{ - connect(&d->m_parser, &Parser::status, this, &ValgrindRunner::status); - connect(&d->m_parser, &Parser::error, this, &ValgrindRunner::error); - connect(&d->m_parser, &Parser::done, this, [this](bool success, const QString &err) { - if (!success) - emit internalError(err); - }); -} + : QObject(parent) + , d(new Private(this)) +{} ValgrindRunner::~ValgrindRunner() { From 604cf67a0c47d3c28c5536b03058199e4e278b2c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 12:15:18 +0200 Subject: [PATCH 0737/1777] ValgrindRunner: Get rid of valgrindExecuted() signal Use appendMessage() signal instead. Change-Id: I2beb70d1c9f59e6b8b3b1ad03ec7707d67aa50cd Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/valgrindengine.cpp | 8 +------- src/plugins/valgrind/valgrindrunner.cpp | 2 +- src/plugins/valgrind/valgrindrunner.h | 2 -- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index 601ba20ec9d..c837b7097b2 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -37,14 +37,8 @@ ValgrindToolRunner::ValgrindToolRunner(RunControl *runControl) m_settings.fromMap(runControl->settingsData(ANALYZER_VALGRIND_SETTINGS)); - connect(&m_runner, - &ValgrindRunner::appendMessage, - this, + connect(&m_runner, &ValgrindRunner::appendMessage, this, [this](const QString &msg, Utils::OutputFormat format) { appendMessage(msg, format); }); - connect(&m_runner, &ValgrindRunner::valgrindExecuted, - this, [this](const QString &commandLine) { - appendMessage(commandLine, NormalMessageFormat); - }); connect(&m_runner, &ValgrindRunner::processErrorReceived, this, &ValgrindToolRunner::receiveProcessError); connect(&m_runner, &ValgrindRunner::finished, diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index d6dd5eb7496..8b4e36f728d 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -156,7 +156,7 @@ bool ValgrindRunner::Private::run() cmd.addCommandLineAsArgs(m_debuggee.command); - emit q->valgrindExecuted(cmd.toUserOutput()); + emit q->appendMessage(cmd.toUserOutput(), NormalMessageFormat); m_process.setCommand(cmd); m_process.setWorkingDirectory(m_debuggee.workingDirectory); diff --git a/src/plugins/valgrind/valgrindrunner.h b/src/plugins/valgrind/valgrindrunner.h index c90be9cf927..e7fabc68bf5 100644 --- a/src/plugins/valgrind/valgrindrunner.h +++ b/src/plugins/valgrind/valgrindrunner.h @@ -44,10 +44,8 @@ public: signals: void appendMessage(const QString &, Utils::OutputFormat); - void logMessageReceived(const QByteArray &); void processErrorReceived(const QString &, QProcess::ProcessError); - void valgrindExecuted(const QString &); void valgrindStarted(qint64 pid); void finished(); From 89343f6574bba592cf070a54c39e81f7205b498c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 13:22:31 +0200 Subject: [PATCH 0738/1777] ValgrindRunner: Store the input data outside of the process Apply it when process is started. This is a preparation step before employing the task tree inside the ValgrindRunner. Change-Id: I4cb64ef72b353af7ca97ae61fded23d9cea5e365 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/valgrindrunner.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index 8b4e36f728d..ca6029646cf 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -57,17 +57,18 @@ public: bool startServers(); bool run(); - ValgrindRunner *q; + ValgrindRunner *q = nullptr; + + CommandLine m_valgrindCommand; Runnable m_debuggee; - - CommandLine m_command; - Process m_process; - + QProcess::ProcessChannelMode m_channelMode = QProcess::SeparateChannels; QHostAddress m_localServerAddress; + bool m_useTerminal = false; + Process m_process; QTcpServer m_xmlServer; - Parser m_parser; QTcpServer m_logServer; + Parser m_parser; }; void ValgrindRunner::Private::xmlSocketConnected() @@ -112,7 +113,7 @@ bool ValgrindRunner::Private::startServers() bool ValgrindRunner::Private::run() { CommandLine cmd; - cmd.setExecutable(m_command.executable()); + cmd.setExecutable(m_valgrindCommand.executable()); if (!m_localServerAddress.isNull()) { if (!startServers()) @@ -144,7 +145,7 @@ bool ValgrindRunner::Private::run() if (enableXml) cmd.addArg("--xml=yes"); } - cmd.addArgs(m_command.arguments(), CommandLine::Raw); + cmd.addArgs(m_valgrindCommand.arguments(), CommandLine::Raw); // consider appending our options last so they override any interfering user-supplied options // -q as suggested by valgrind manual @@ -161,6 +162,8 @@ bool ValgrindRunner::Private::run() m_process.setCommand(cmd); m_process.setWorkingDirectory(m_debuggee.workingDirectory); m_process.setEnvironment(m_debuggee.environment); + m_process.setProcessChannelMode(m_channelMode); + m_process.setTerminalMode(m_useTerminal ? TerminalMode::Run : TerminalMode::Off); m_process.start(); return true; } @@ -186,7 +189,7 @@ ValgrindRunner::~ValgrindRunner() void ValgrindRunner::setValgrindCommand(const CommandLine &command) { - d->m_command = command; + d->m_valgrindCommand = command; } void ValgrindRunner::setDebuggee(const Runnable &debuggee) @@ -196,7 +199,7 @@ void ValgrindRunner::setDebuggee(const Runnable &debuggee) void ValgrindRunner::setProcessChannelMode(QProcess::ProcessChannelMode mode) { - d->m_process.setProcessChannelMode(mode); + d->m_channelMode = mode; } void ValgrindRunner::setLocalServerAddress(const QHostAddress &localServerAddress) @@ -206,7 +209,7 @@ void ValgrindRunner::setLocalServerAddress(const QHostAddress &localServerAddres void ValgrindRunner::setUseTerminal(bool on) { - d->m_process.setTerminalMode(on ? TerminalMode::Run : TerminalMode::Off); + d->m_useTerminal = on; } void ValgrindRunner::waitForFinished() const From 19bc9e69c90bb2b53bc739eafb85a576a5515e08 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 14:11:40 +0200 Subject: [PATCH 0739/1777] ValgrindRunner: Inline some slots Change-Id: I29b099694fd0cbbd29bbd34362f2d93074b125d1 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/valgrindrunner.cpp | 38 ++++++++++--------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index ca6029646cf..a643a90def0 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -41,8 +41,21 @@ public: emit q->appendMessage(m_process.readAllStandardError(), StdErrFormat); }); - connect(&m_xmlServer, &QTcpServer::newConnection, this, &Private::xmlSocketConnected); - connect(&m_logServer, &QTcpServer::newConnection, this, &Private::logSocketConnected); + connect(&m_xmlServer, &QTcpServer::newConnection, this, [this] { + QTcpSocket *socket = m_xmlServer.nextPendingConnection(); + QTC_ASSERT(socket, return); + m_xmlServer.close(); + m_parser.setSocket(socket); + m_parser.start(); + }); + connect(&m_logServer, &QTcpServer::newConnection, this, [this] { + QTcpSocket *socket = m_logServer.nextPendingConnection(); + QTC_ASSERT(socket, return); + connect(socket, &QIODevice::readyRead, this, [this, socket] { + emit q->logMessageReceived(socket->readAll()); + }); + m_logServer.close(); + }); connect(&m_parser, &Parser::status, q, &ValgrindRunner::status); connect(&m_parser, &Parser::error, q, &ValgrindRunner::error); @@ -52,8 +65,6 @@ public: }); } - void xmlSocketConnected(); - void logSocketConnected(); bool startServers(); bool run(); @@ -71,25 +82,6 @@ public: Parser m_parser; }; -void ValgrindRunner::Private::xmlSocketConnected() -{ - QTcpSocket *socket = m_xmlServer.nextPendingConnection(); - QTC_ASSERT(socket, return); - m_xmlServer.close(); - m_parser.setSocket(socket); - m_parser.start(); -} - -void ValgrindRunner::Private::logSocketConnected() -{ - QTcpSocket *logSocket = m_logServer.nextPendingConnection(); - QTC_ASSERT(logSocket, return); - connect(logSocket, &QIODevice::readyRead, this, [this, logSocket] { - emit q->logMessageReceived(logSocket->readAll()); - }); - m_logServer.close(); -} - bool ValgrindRunner::Private::startServers() { const bool xmlOK = m_xmlServer.listen(m_localServerAddress); From aa093c1e91f9e000dc8582ace032ec3e294b947f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 17:05:24 +0200 Subject: [PATCH 0740/1777] Axivion: Move query error handling closer to query code Change-Id: I6c57c0578b284f20e23312bf748c5efbe0ac3c3e Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/axivion/axivionplugin.cpp | 20 -------------------- src/plugins/axivion/axivionplugin.h | 1 - src/plugins/axivion/axivionquery.cpp | 24 +++++++++++++++++++++++- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index 7703fede02c..e068287290f 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -13,7 +13,6 @@ #include <coreplugin/editormanager/documentmodel.h> #include <coreplugin/editormanager/editormanager.h> -#include <coreplugin/icore.h> #include <coreplugin/messagemanager.h> #include <extensionsystem/pluginmanager.h> @@ -31,7 +30,6 @@ #include <utils/utilsicons.h> #include <QAction> -#include <QMessageBox> #include <QTimer> constexpr char AxivionTextMarkId[] = "AxivionTextMark"; @@ -150,24 +148,6 @@ AxivionProjectSettings *AxivionPlugin::projectSettings(ProjectExplorer::Project return dd->projectSettings(project); } -bool AxivionPlugin::handleCertificateIssue() -{ - QTC_ASSERT(dd, return false); - - const QString serverHost = QUrl(dd->m_axivionSettings.server.dashboard).host(); - if (QMessageBox::question(Core::ICore::dialogParent(), Tr::tr("Certificate Error"), - Tr::tr("Server certificate for %1 cannot be authenticated.\n" - "Do you want to disable SSL verification for this server?\n" - "Note: This can expose you to man-in-the-middle attack.") - .arg(serverHost)) - != QMessageBox::Yes) { - return false; - } - dd->m_axivionSettings.server.validateCert = false; - emit s_instance->settingsChanged(); - return true; -} - void AxivionPlugin::fetchProjectInfo(const QString &projectName) { QTC_ASSERT(dd, return); diff --git a/src/plugins/axivion/axivionplugin.h b/src/plugins/axivion/axivionplugin.h index 992971b6bd6..9422ab8b968 100644 --- a/src/plugins/axivion/axivionplugin.h +++ b/src/plugins/axivion/axivionplugin.h @@ -26,7 +26,6 @@ public: static AxivionSettings *settings(); static AxivionProjectSettings *projectSettings(ProjectExplorer::Project *project); - static bool handleCertificateIssue(); static void fetchProjectInfo(const QString &projectName); static ProjectInfo projectInfo(); signals: diff --git a/src/plugins/axivion/axivionquery.cpp b/src/plugins/axivion/axivionquery.cpp index fda0eccf128..deb85ba4417 100644 --- a/src/plugins/axivion/axivionquery.cpp +++ b/src/plugins/axivion/axivionquery.cpp @@ -5,10 +5,14 @@ #include "axivionplugin.h" #include "axivionsettings.h" +#include "axiviontr.h" + +#include <coreplugin/icore.h> #include <utils/processenums.h> #include <utils/qtcassert.h> +#include <QMessageBox> #include <QUrl> using namespace Utils; @@ -50,6 +54,24 @@ QString AxivionQuery::toString() const return {}; } +static bool handleCertificateIssue() +{ + AxivionSettings *settings = AxivionPlugin::settings(); + const QString serverHost = QUrl(settings->server.dashboard).host(); + if (QMessageBox::question(Core::ICore::dialogParent(), Tr::tr("Certificate Error"), + Tr::tr("Server certificate for %1 cannot be authenticated.\n" + "Do you want to disable SSL verification for this server?\n" + "Note: This can expose you to man-in-the-middle attack.") + .arg(serverHost)) + != QMessageBox::Yes) { + return false; + } + settings->server.validateCert = false; + settings->apply(); + + return true; +} + AxivionQueryRunner::AxivionQueryRunner(const AxivionQuery &query, QObject *parent) : QObject(parent) { @@ -71,7 +93,7 @@ AxivionQueryRunner::AxivionQueryRunner(const AxivionQuery &query, QObject *paren const int exitCode = m_process.exitCode(); if (m_process.exitStatus() == QProcess::NormalExit && (exitCode == 35 || exitCode == 60) - && AxivionPlugin::handleCertificateIssue()) { + && handleCertificateIssue()) { // prepend -k for re-requesting same query CommandLine cmdline = m_process.commandLine(); cmdline.prependArgs({"-k"}); From e02de2ddde05bcf022bdcdf077e0a372debfc2d9 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 16 Aug 2023 10:20:01 +0200 Subject: [PATCH 0741/1777] ProjectExplorer: More KitAspect related renamings Change-Id: I10ad7aacaaf7346f91cadec479f4bba8481b1502 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../cmakekitinformation.cpp | 14 +++++----- src/plugins/debugger/debuggerkitaspect.cpp | 6 ++-- src/plugins/mcusupport/mcukitinformation.cpp | 4 +-- .../toolkitaspectwidget.cpp | 6 ++-- .../mesonprojectmanager/toolkitaspectwidget.h | 2 +- src/plugins/projectexplorer/kitaspects.cpp | 28 +++++++++---------- src/plugins/projectexplorer/kitmanager.h | 2 +- .../kitmanagerconfigwidget.cpp | 16 +++++------ .../miniprojecttargetselector.cpp | 28 +++++++++---------- 9 files changed, 51 insertions(+), 55 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 6d27dfc77aa..9861c0ff8d8 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -66,13 +66,13 @@ static Id defaultCMakeToolId() class CMakeKitAspectImpl final : public KitAspect { public: - CMakeKitAspectImpl(Kit *kit, const KitAspectFactory *ki) : KitAspect(kit, ki), + CMakeKitAspectImpl(Kit *kit, const KitAspectFactory *factory) : KitAspect(kit, factory), m_comboBox(createSubWidget<QComboBox>()), m_manageButton(createManageButton(Constants::Settings::TOOLS_ID)) { m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy()); m_comboBox->setEnabled(false); - m_comboBox->setToolTip(ki->description()); + m_comboBox->setToolTip(factory->description()); refresh(); @@ -293,8 +293,8 @@ const char TOOLSET_KEY[] = "Toolset"; class CMakeGeneratorKitAspectImpl final : public KitAspect { public: - CMakeGeneratorKitAspectImpl(Kit *kit, const KitAspectFactory *ki) - : KitAspect(kit, ki), + CMakeGeneratorKitAspectImpl(Kit *kit, const KitAspectFactory *factory) + : KitAspect(kit, factory), m_label(createSubWidget<ElidingLabel>()), m_changeButton(createSubWidget<QPushButton>()) { @@ -303,7 +303,7 @@ public: CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-generators.7.html"); }); - m_label->setToolTip(ki->description()); + m_label->setToolTip(factory->description()); m_changeButton->setText(Tr::tr("Change...")); refresh(); connect(m_changeButton, &QPushButton::clicked, @@ -847,8 +847,8 @@ const char QTC_CMAKE_PRESET_KEY[] = "QTC_CMAKE_PRESET"; class CMakeConfigurationKitAspectWidget final : public KitAspect { public: - CMakeConfigurationKitAspectWidget(Kit *kit, const KitAspectFactory *ki) - : KitAspect(kit, ki), + CMakeConfigurationKitAspectWidget(Kit *kit, const KitAspectFactory *factory) + : KitAspect(kit, factory), m_summaryLabel(createSubWidget<ElidingLabel>()), m_manageButton(createSubWidget<QPushButton>()) { diff --git a/src/plugins/debugger/debuggerkitaspect.cpp b/src/plugins/debugger/debuggerkitaspect.cpp index 54318360b82..bcf3faee62c 100644 --- a/src/plugins/debugger/debuggerkitaspect.cpp +++ b/src/plugins/debugger/debuggerkitaspect.cpp @@ -38,15 +38,15 @@ namespace Internal { class DebuggerKitAspectImpl final : public KitAspect { public: - DebuggerKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki) - : KitAspect(workingCopy, ki) + DebuggerKitAspectImpl(Kit *workingCopy, const KitAspectFactory *factory) + : KitAspect(workingCopy, factory) { m_comboBox = createSubWidget<QComboBox>(); m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy()); m_comboBox->setEnabled(true); refresh(); - m_comboBox->setToolTip(ki->description()); + m_comboBox->setToolTip(factory->description()); connect(m_comboBox, &QComboBox::currentIndexChanged, this, [this] { if (m_ignoreChanges.isLocked()) return; diff --git a/src/plugins/mcusupport/mcukitinformation.cpp b/src/plugins/mcusupport/mcukitinformation.cpp index bf2eb489b3e..1d95f877cd1 100644 --- a/src/plugins/mcusupport/mcukitinformation.cpp +++ b/src/plugins/mcusupport/mcukitinformation.cpp @@ -16,8 +16,8 @@ namespace { class McuDependenciesKitAspectImpl final : public KitAspect { public: - McuDependenciesKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki) - : KitAspect(workingCopy, ki) + McuDependenciesKitAspectImpl(Kit *workingCopy, const KitAspectFactory *factory) + : KitAspect(workingCopy, factory) {} void makeReadOnly() override {} diff --git a/src/plugins/mesonprojectmanager/toolkitaspectwidget.cpp b/src/plugins/mesonprojectmanager/toolkitaspectwidget.cpp index 26c6ee8e9f7..e3398aa9f79 100644 --- a/src/plugins/mesonprojectmanager/toolkitaspectwidget.cpp +++ b/src/plugins/mesonprojectmanager/toolkitaspectwidget.cpp @@ -13,9 +13,9 @@ namespace MesonProjectManager { namespace Internal { ToolKitAspectWidget::ToolKitAspectWidget(ProjectExplorer::Kit *kit, - const ProjectExplorer::KitAspectFactory *ki, + const ProjectExplorer::KitAspectFactory *factory, ToolType type) - : ProjectExplorer::KitAspect(kit, ki) + : ProjectExplorer::KitAspect(kit, factory) , m_toolsComboBox(createSubWidget<QComboBox>()) , m_manageButton(createManageButton(Constants::SettingsPage::TOOLS_ID)) , m_type{type} @@ -23,7 +23,7 @@ ToolKitAspectWidget::ToolKitAspectWidget(ProjectExplorer::Kit *kit, m_toolsComboBox->setSizePolicy(QSizePolicy::Ignored, m_toolsComboBox->sizePolicy().verticalPolicy()); m_toolsComboBox->setEnabled(false); - m_toolsComboBox->setToolTip(ki->description()); + m_toolsComboBox->setToolTip(factory->description()); loadTools(); connect(MesonTools::instance(), &MesonTools::toolAdded, diff --git a/src/plugins/mesonprojectmanager/toolkitaspectwidget.h b/src/plugins/mesonprojectmanager/toolkitaspectwidget.h index 26d73788d7f..3cfb186b4f9 100644 --- a/src/plugins/mesonprojectmanager/toolkitaspectwidget.h +++ b/src/plugins/mesonprojectmanager/toolkitaspectwidget.h @@ -21,7 +21,7 @@ public: enum class ToolType { Meson, Ninja }; ToolKitAspectWidget(ProjectExplorer::Kit *kit, - const ProjectExplorer::KitAspectFactory *ki, + const ProjectExplorer::KitAspectFactory *factory, ToolType type); ~ToolKitAspectWidget(); diff --git a/src/plugins/projectexplorer/kitaspects.cpp b/src/plugins/projectexplorer/kitaspects.cpp index 4175ebceb3c..c7fe79debc4 100644 --- a/src/plugins/projectexplorer/kitaspects.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -49,7 +49,7 @@ namespace Internal { class SysRootKitAspectImpl : public KitAspect { public: - SysRootKitAspectImpl(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki) + SysRootKitAspectImpl(Kit *k, const KitAspectFactory *factory) : KitAspect(k, factory) { m_chooser = createSubWidget<PathChooser>(); m_chooser->setExpectedKind(PathChooser::ExistingDirectory); @@ -200,7 +200,7 @@ namespace Internal { class ToolChainKitAspectImpl final : public KitAspect { public: - ToolChainKitAspectImpl(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki) + ToolChainKitAspectImpl(Kit *k, const KitAspectFactory *factory) : KitAspect(k, factory) { m_mainWidget = createSubWidget<QWidget>(); m_mainWidget->setContentsMargins(0, 0, 0, 0); @@ -219,7 +219,7 @@ public: layout->addWidget(new QLabel(ToolChainManager::displayNameOfLanguageId(l) + ':'), row, 0); auto cb = new QComboBox; cb->setSizePolicy(QSizePolicy::Ignored, cb->sizePolicy().verticalPolicy()); - cb->setToolTip(ki->description()); + cb->setToolTip(factory->description()); m_languageComboboxMap.insert(l, cb); layout->addWidget(cb, row, 1); @@ -802,12 +802,12 @@ namespace Internal { class DeviceTypeKitAspectImpl final : public KitAspect { public: - DeviceTypeKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki) - : KitAspect(workingCopy, ki), m_comboBox(createSubWidget<QComboBox>()) + DeviceTypeKitAspectImpl(Kit *workingCopy, const KitAspectFactory *factory) + : KitAspect(workingCopy, factory), m_comboBox(createSubWidget<QComboBox>()) { for (IDeviceFactory *factory : IDeviceFactory::allDeviceFactories()) m_comboBox->addItem(factory->displayName(), factory->deviceType().toSetting()); - m_comboBox->setToolTip(ki->description()); + m_comboBox->setToolTip(factory->description()); refresh(); connect(m_comboBox, &QComboBox::currentIndexChanged, this, &DeviceTypeKitAspectImpl::currentTypeChanged); @@ -937,8 +937,8 @@ namespace Internal { class DeviceKitAspectImpl final : public KitAspect { public: - DeviceKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki) - : KitAspect(workingCopy, ki), + DeviceKitAspectImpl(Kit *workingCopy, const KitAspectFactory *factory) + : KitAspect(workingCopy, factory), m_comboBox(createSubWidget<QComboBox>()), m_model(new DeviceManagerModel(DeviceManager::instance())) { @@ -948,7 +948,7 @@ public: m_comboBox->setMinimumContentsLength(16); // Don't stretch too much for Kit Page m_manageButton = createManageButton(Constants::DEVICE_SETTINGS_PAGE_ID); refresh(); - m_comboBox->setToolTip(ki->description()); + m_comboBox->setToolTip(factory->description()); connect(m_model, &QAbstractItemModel::modelAboutToBeReset, this, &DeviceKitAspectImpl::modelAboutToReset); @@ -1228,8 +1228,8 @@ namespace Internal { class BuildDeviceKitAspectImpl final : public KitAspect { public: - BuildDeviceKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki) - : KitAspect(workingCopy, ki), + BuildDeviceKitAspectImpl(Kit *workingCopy, const KitAspectFactory *factory) + : KitAspect(workingCopy, factory), m_comboBox(createSubWidget<QComboBox>()), m_model(new DeviceManagerModel(DeviceManager::instance())) { @@ -1237,7 +1237,7 @@ public: m_comboBox->setModel(m_model); m_manageButton = createManageButton(Constants::DEVICE_SETTINGS_PAGE_ID); refresh(); - m_comboBox->setToolTip(ki->description()); + m_comboBox->setToolTip(factory->description()); connect(m_model, &QAbstractItemModel::modelAboutToBeReset, this, &BuildDeviceKitAspectImpl::modelAboutToReset); @@ -1506,8 +1506,8 @@ namespace Internal { class EnvironmentKitAspectImpl final : public KitAspect { public: - EnvironmentKitAspectImpl(Kit *workingCopy, const KitAspectFactory *ki) - : KitAspect(workingCopy, ki), + EnvironmentKitAspectImpl(Kit *workingCopy, const KitAspectFactory *factory) + : KitAspect(workingCopy, factory), m_summaryLabel(createSubWidget<ElidingLabel>()), m_manageButton(createSubWidget<QPushButton>()), m_mainWidget(createSubWidget<QWidget>()) diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index f90e0a0b5c1..bb5de22bf0f 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -116,7 +116,7 @@ public: static QString msgManage(); Kit *kit() const { return m_kit; } - const KitAspectFactory *kitInformation() const { return m_factory; } + const KitAspectFactory *factory() const { return m_factory; } QAction *mutableAction() const { return m_mutableAction; } void addMutableAction(QWidget *child); QWidget *createManageButton(Utils::Id pageId); diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index da825d5169d..9aa111bd693 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -210,21 +210,19 @@ void KitManagerConfigWidget::addAspectToWorkingCopy(Layouting::LayoutItem &paren void KitManagerConfigWidget::updateVisibility() { - int count = m_kitAspects.count(); - for (int i = 0; i < count; ++i) { - KitAspect *aspect = m_kitAspects.at(i); - const KitAspectFactory *ki = aspect->kitInformation(); - const bool visibleInKit = ki->isApplicableToKit(m_modifiedKit.get()); - const bool irrelevant = m_modifiedKit->irrelevantAspects().contains(ki->id()); + for (KitAspect *aspect : std::as_const(m_kitAspects)) { + const KitAspectFactory *factory = aspect->factory(); + const bool visibleInKit = factory->isApplicableToKit(m_modifiedKit.get()); + const bool irrelevant = m_modifiedKit->irrelevantAspects().contains(factory->id()); aspect->setVisible(visibleInKit && !irrelevant); } } void KitManagerConfigWidget::makeStickySubWidgetsReadOnly() { - for (KitAspect *w : std::as_const(m_kitAspects)) { - if (w->kit()->isSticky(w->kitInformation()->id())) - w->makeReadOnly(); + for (KitAspect *aspect : std::as_const(m_kitAspects)) { + if (aspect->kit()->isSticky(aspect->factory()->id())) + aspect->makeReadOnly(); } } diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 1ee113c7239..8163e6693e6 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -49,8 +49,7 @@ using namespace Utils; -namespace ProjectExplorer { -namespace Internal { +namespace ProjectExplorer::Internal { const int RunColumnWidth = 30; @@ -565,9 +564,9 @@ int SelectorView::padding() ///////// // KitAreaWidget ///////// -void doLayout(KitAspect *widget, Layouting::LayoutItem &builder) +void doLayout(KitAspect *aspect, Layouting::LayoutItem &builder) { - widget->addToLayout(builder); + aspect->addToLayout(builder); } class KitAreaWidget : public QWidget @@ -584,8 +583,8 @@ public: void setKit(Kit *k) { - qDeleteAll(m_widgets); - m_widgets.clear(); + qDeleteAll(m_kitAspects); + m_kitAspects.clear(); if (!k) return; @@ -595,9 +594,9 @@ public: Layouting::Grid grid; for (KitAspectFactory *factory : KitManager::kitAspectFactories()) { if (k && k->isMutable(factory->id())) { - KitAspect *widget = factory->createKitAspect(k); - m_widgets << widget; - grid.addItems({factory->displayName(), widget, Layouting::br}); + KitAspect *aspect = factory->createKitAspect(k); + m_kitAspects << aspect; + grid.addItems({factory->displayName(), aspect, Layouting::br}); } } grid.attachTo(this); @@ -605,7 +604,7 @@ public: m_kit = k; - setHidden(m_widgets.isEmpty()); + setHidden(m_kitAspects.isEmpty()); } private: @@ -616,7 +615,7 @@ private: bool addedMutables = false; QList<const KitAspectFactory *> knownList - = Utils::transform(m_widgets, &KitAspect::kitInformation); + = Utils::transform(m_kitAspects, &KitAspect::factory); for (KitAspectFactory *factory : KitManager::kitAspectFactories()) { const Utils::Id currentId = factory->id(); @@ -632,13 +631,13 @@ private: setKit(m_kit); } else { // Refresh all widgets if the number of mutable settings did not change - for (KitAspect *w : std::as_const(m_widgets)) + for (KitAspect *w : std::as_const(m_kitAspects)) w->refresh(); } } Kit *m_kit = nullptr; - QList<KitAspect *> m_widgets; + QList<KitAspect *> m_kitAspects; }; ///////// @@ -1592,7 +1591,6 @@ void MiniProjectTargetSelector::switchToProjectsMode() hide(); } -} // namespace Internal -} // namespace ProjectExplorer +} // ProjectExplorer::Internal #include <miniprojecttargetselector.moc> From 62ed7f7c395037f212593162d4c5e55ed3c88d50 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 14:38:00 +0200 Subject: [PATCH 0742/1777] ValgrindRunner: Add setupValgrindProcess() helper Move all process related setup there. Change-Id: I26943a844bef5411ee018cc2b1d390aa33b4c257 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/valgrindrunner.cpp | 73 +++++++++++++------------ 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index a643a90def0..68b968cd147 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -26,21 +26,6 @@ class ValgrindRunner::Private : public QObject { public: Private(ValgrindRunner *owner) : q(owner) { - connect(&m_process, &Process::started, this, [this] { - emit q->valgrindStarted(m_process.processId()); - }); - connect(&m_process, &Process::done, this, [this] { - if (m_process.result() != ProcessResult::FinishedWithSuccess) - emit q->processErrorReceived(m_process.errorString(), m_process.error()); - emit q->finished(); - }); - connect(&m_process, &Process::readyReadStandardOutput, this, [this] { - emit q->appendMessage(m_process.readAllStandardOutput(), StdOutFormat); - }); - connect(&m_process, &Process::readyReadStandardError, this, [this] { - emit q->appendMessage(m_process.readAllStandardError(), StdErrFormat); - }); - connect(&m_xmlServer, &QTcpServer::newConnection, this, [this] { QTcpSocket *socket = m_xmlServer.nextPendingConnection(); QTC_ASSERT(socket, return); @@ -65,6 +50,44 @@ public: }); } + void setupValgrindProcess(Process *process, const CommandLine &command) const { + CommandLine cmd = command; + cmd.addArgs(m_valgrindCommand.arguments(), CommandLine::Raw); + + // consider appending our options last so they override any interfering user-supplied + // options -q as suggested by valgrind manual + + if (cmd.executable().osType() == OsTypeMac) { + // May be slower to start but without it we get no filenames for symbols. + cmd.addArg("--dsymutil=yes"); + } + + cmd.addCommandLineAsArgs(m_debuggee.command); + + emit q->appendMessage(cmd.toUserOutput(), NormalMessageFormat); + + process->setCommand(cmd); + process->setWorkingDirectory(m_debuggee.workingDirectory); + process->setEnvironment(m_debuggee.environment); + process->setProcessChannelMode(m_channelMode); + process->setTerminalMode(m_useTerminal ? TerminalMode::Run : TerminalMode::Off); + + connect(process, &Process::started, this, [this, process] { + emit q->valgrindStarted(process->processId()); + }); + connect(process, &Process::done, this, [this, process] { + if (process->result() != ProcessResult::FinishedWithSuccess) + emit q->processErrorReceived(process->errorString(), process->error()); + emit q->finished(); + }); + connect(process, &Process::readyReadStandardOutput, this, [this, process] { + emit q->appendMessage(process->readAllStandardOutput(), StdOutFormat); + }); + connect(process, &Process::readyReadStandardError, this, [this, process] { + emit q->appendMessage(process->readAllStandardError(), StdErrFormat); + }); + } + bool startServers(); bool run(); @@ -137,25 +160,7 @@ bool ValgrindRunner::Private::run() if (enableXml) cmd.addArg("--xml=yes"); } - cmd.addArgs(m_valgrindCommand.arguments(), CommandLine::Raw); - - // consider appending our options last so they override any interfering user-supplied options - // -q as suggested by valgrind manual - - if (cmd.executable().osType() == OsTypeMac) { - // May be slower to start but without it we get no filenames for symbols. - cmd.addArg("--dsymutil=yes"); - } - - cmd.addCommandLineAsArgs(m_debuggee.command); - - emit q->appendMessage(cmd.toUserOutput(), NormalMessageFormat); - - m_process.setCommand(cmd); - m_process.setWorkingDirectory(m_debuggee.workingDirectory); - m_process.setEnvironment(m_debuggee.environment); - m_process.setProcessChannelMode(m_channelMode); - m_process.setTerminalMode(m_useTerminal ? TerminalMode::Run : TerminalMode::Off); + setupValgrindProcess(&m_process, cmd); m_process.start(); return true; } From 3ca0a9d23ce509e7adaba69a4403f0ca8b7e2c15 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 15:20:39 +0200 Subject: [PATCH 0743/1777] ValgrindRunner: Add valgrindCommand() helper Change-Id: I8c480911a13aa80b2d58e49c6b03da55b37090a6 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/valgrindrunner.cpp | 61 ++++++++++++++----------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index 68b968cd147..6b05d58884e 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -22,6 +22,40 @@ using namespace Valgrind::XmlProtocol; namespace Valgrind { +static CommandLine valgrindCommand(const CommandLine &command, + const QTcpServer &xmlServer, + const QTcpServer &logServer) +{ + CommandLine cmd = command; + cmd.addArg("--child-silent-after-fork=yes"); + + // Workaround for valgrind bug when running vgdb with xml output + // https://bugs.kde.org/show_bug.cgi?id=343902 + bool enableXml = true; + + auto handleSocketParameter = [&enableXml, &cmd](const QString &prefix, + const QTcpServer &tcpServer) + { + QHostAddress serverAddress = tcpServer.serverAddress(); + if (serverAddress.protocol() != QAbstractSocket::IPv4Protocol) { + // Report will end up in the Application Output pane, i.e. not have + // clickable items, but that's better than nothing. + qWarning("Need IPv4 for valgrind"); + enableXml = false; + } else { + cmd.addArg(QString("%1=%2:%3").arg(prefix).arg(serverAddress.toString()) + .arg(tcpServer.serverPort())); + } + }; + + handleSocketParameter("--xml-socket", xmlServer); + handleSocketParameter("--log-socket", logServer); + + if (enableXml) + cmd.addArg("--xml=yes"); + return cmd; +} + class ValgrindRunner::Private : public QObject { public: @@ -133,32 +167,7 @@ bool ValgrindRunner::Private::run() if (!m_localServerAddress.isNull()) { if (!startServers()) return false; - - cmd.addArg("--child-silent-after-fork=yes"); - - // Workaround for valgrind bug when running vgdb with xml output - // https://bugs.kde.org/show_bug.cgi?id=343902 - bool enableXml = true; - - auto handleSocketParameter = [&enableXml, &cmd](const QString &prefix, const QTcpServer &tcpServer) - { - QHostAddress serverAddress = tcpServer.serverAddress(); - if (serverAddress.protocol() != QAbstractSocket::IPv4Protocol) { - // Report will end up in the Application Output pane, i.e. not have - // clickable items, but that's better than nothing. - qWarning("Need IPv4 for valgrind"); - enableXml = false; - } else { - cmd.addArg(QString("%1=%2:%3").arg(prefix).arg(serverAddress.toString()) - .arg(tcpServer.serverPort())); - } - }; - - handleSocketParameter("--xml-socket", m_xmlServer); - handleSocketParameter("--log-socket", m_logServer); - - if (enableXml) - cmd.addArg("--xml=yes"); + cmd = valgrindCommand(cmd, m_xmlServer, m_logServer); } setupValgrindProcess(&m_process, cmd); m_process.start(); From 45246834cc5229e8b9286ee7748c5a157c432b82 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 16:55:15 +0200 Subject: [PATCH 0744/1777] ValgrindRunner: Rename finished() into done() Add bool success arg into done signal. Change-Id: Id39a727860e0e705513917f69ecd38e455078b5a Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/callgrindengine.cpp | 2 +- src/plugins/valgrind/valgrindengine.cpp | 2 +- src/plugins/valgrind/valgrindrunner.cpp | 7 ++++--- src/plugins/valgrind/valgrindrunner.h | 2 +- tests/auto/valgrind/memcheck/modeldemo.cpp | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/valgrind/callgrindengine.cpp b/src/plugins/valgrind/callgrindengine.cpp index 92b13b4f77b..192174c6e54 100644 --- a/src/plugins/valgrind/callgrindengine.cpp +++ b/src/plugins/valgrind/callgrindengine.cpp @@ -40,7 +40,7 @@ CallgrindToolRunner::CallgrindToolRunner(RunControl *runControl) connect(&m_runner, &ValgrindRunner::valgrindStarted, this, [this](qint64 pid) { m_pid = pid; }); - connect(&m_runner, &ValgrindRunner::finished, this, [this] { + connect(&m_runner, &ValgrindRunner::done, this, [this] { triggerParse(); emit parserDataReady(this); }); diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index c837b7097b2..0b6abb771f9 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -41,7 +41,7 @@ ValgrindToolRunner::ValgrindToolRunner(RunControl *runControl) [this](const QString &msg, Utils::OutputFormat format) { appendMessage(msg, format); }); connect(&m_runner, &ValgrindRunner::processErrorReceived, this, &ValgrindToolRunner::receiveProcessError); - connect(&m_runner, &ValgrindRunner::finished, + connect(&m_runner, &ValgrindRunner::done, this, &ValgrindToolRunner::runnerFinished); } diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index 6b05d58884e..621e837e1c1 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -110,9 +110,10 @@ public: emit q->valgrindStarted(process->processId()); }); connect(process, &Process::done, this, [this, process] { - if (process->result() != ProcessResult::FinishedWithSuccess) + const bool success = process->result() == ProcessResult::FinishedWithSuccess; + if (!success) emit q->processErrorReceived(process->errorString(), process->error()); - emit q->finished(); + emit q->done(success); }); connect(process, &Process::readyReadStandardOutput, this, [this, process] { emit q->appendMessage(process->readAllStandardOutput(), StdOutFormat); @@ -224,7 +225,7 @@ void ValgrindRunner::waitForFinished() const return; QEventLoop loop; - connect(this, &ValgrindRunner::finished, &loop, &QEventLoop::quit); + connect(this, &ValgrindRunner::done, &loop, &QEventLoop::quit); loop.exec(); } diff --git a/src/plugins/valgrind/valgrindrunner.h b/src/plugins/valgrind/valgrindrunner.h index e7fabc68bf5..ff7dea0dde6 100644 --- a/src/plugins/valgrind/valgrindrunner.h +++ b/src/plugins/valgrind/valgrindrunner.h @@ -47,7 +47,7 @@ signals: void logMessageReceived(const QByteArray &); void processErrorReceived(const QString &, QProcess::ProcessError); void valgrindStarted(qint64 pid); - void finished(); + void done(bool success); // Parser's signals void status(const Valgrind::XmlProtocol::Status &status); diff --git a/tests/auto/valgrind/memcheck/modeldemo.cpp b/tests/auto/valgrind/memcheck/modeldemo.cpp index c7c3f4fc962..9eaf314e0ab 100644 --- a/tests/auto/valgrind/memcheck/modeldemo.cpp +++ b/tests/auto/valgrind/memcheck/modeldemo.cpp @@ -33,7 +33,7 @@ int main(int argc, char *argv[]) runner.setValgrindCommand({VALGRIND_FAKE_PATH, {"-i", PARSERTESTS_DATA_DIR "/memcheck-output-sample1.xml"}}); ModelDemo demo(&runner); - QObject::connect(&runner, &ValgrindRunner::finished, &demo, &ModelDemo::finished); + QObject::connect(&runner, &ValgrindRunner::done, &demo, &ModelDemo::finished); ErrorListModel model; QObject::connect(&runner, &ValgrindRunner::error, &model, &ErrorListModel::addError, Qt::QueuedConnection); From b32333343bda560ab6065821cd3250ec7c358639 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 17:40:24 +0200 Subject: [PATCH 0745/1777] Valgrind: Make socket parentless when passed to Parser Otherwise, when the socket is a child of QTcpServer, it may be deleted together with a server, while it's still held in Parser instance. Change-Id: I600e9cef1268ffc93e1e86d317e087df8b4d70cb Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/xmlprotocol/parser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/valgrind/xmlprotocol/parser.cpp b/src/plugins/valgrind/xmlprotocol/parser.cpp index 6b11ad0a3ca..33d78b3ef49 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.cpp +++ b/src/plugins/valgrind/xmlprotocol/parser.cpp @@ -761,6 +761,7 @@ void Parser::setSocket(QAbstractSocket *socket) QTC_ASSERT(socket, return); QTC_ASSERT(socket->isOpen(), return); QTC_ASSERT(!isRunning(), return); + socket->setParent(nullptr); // Don't delete it together with parent QTcpServer anymore. d->m_socket.reset(socket); } From 8dc3b0abc53139c6869111afbf9468e6f7fcac0b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 16 Aug 2023 17:42:00 +0200 Subject: [PATCH 0746/1777] ProjectExplorer: Hide CustomToolChainConfigWidget implementation Also, remove unneeded Q_OBJECT. Change-Id: I6cefce78356011d97f281d4fcb023806d52d9452 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../projectexplorer/customtoolchain.cpp | 71 ++++++++++++++----- src/plugins/projectexplorer/customtoolchain.h | 54 -------------- 2 files changed, 52 insertions(+), 73 deletions(-) diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp index 9ad4551c57d..cd769df5688 100644 --- a/src/plugins/projectexplorer/customtoolchain.cpp +++ b/src/plugins/projectexplorer/customtoolchain.cpp @@ -13,6 +13,7 @@ #include "projectexplorerconstants.h" #include "projectexplorertr.h" #include "projectmacro.h" +#include "toolchainconfigwidget.h" #include <utils/algorithm.h> #include <utils/detailswidget.h> @@ -279,26 +280,8 @@ QList<CustomToolChain::Parser> CustomToolChain::parsers() return result; } -std::unique_ptr<ToolChainConfigWidget> CustomToolChain::createConfigurationWidget() -{ - return std::make_unique<Internal::CustomToolChainConfigWidget>(this); -} - namespace Internal { -// -------------------------------------------------------------------------- -// CustomToolChainFactory -// -------------------------------------------------------------------------- - -CustomToolChainFactory::CustomToolChainFactory() -{ - setDisplayName(Tr::tr("Custom")); - setSupportedToolChainType(Constants::CUSTOM_TOOLCHAIN_TYPEID); - setSupportsAllLanguages(true); - setToolchainConstructor([] { return new CustomToolChain; }); - setUserCreatable(true); -} - // -------------------------------------------------------------------------- // Helper for ConfigWidget // -------------------------------------------------------------------------- @@ -311,7 +294,7 @@ public: setWidget(textEdit); } - inline QPlainTextEdit *textEditWidget() const + QPlainTextEdit *textEditWidget() const { return static_cast<QPlainTextEdit *>(widget()); } @@ -347,6 +330,34 @@ public: // CustomToolChainConfigWidget // -------------------------------------------------------------------------- +class CustomToolChainConfigWidget final : public ToolChainConfigWidget +{ +public: + explicit CustomToolChainConfigWidget(CustomToolChain *); + +private: + void updateSummaries(TextEditDetailsWidget *detailsWidget); + void errorParserChanged(int index = -1); + + void applyImpl() override; + void discardImpl() override { setFromToolchain(); } + bool isDirtyImpl() const override; + void makeReadOnlyImpl() override; + + void setFromToolchain(); + + Utils::PathChooser *m_compilerCommand; + Utils::PathChooser *m_makeCommand; + AbiWidget *m_abiWidget; + QPlainTextEdit *m_predefinedMacros; + QPlainTextEdit *m_headerPaths; + TextEditDetailsWidget *m_predefinedDetails; + TextEditDetailsWidget *m_headerDetails; + QLineEdit *m_cxx11Flags; + QLineEdit *m_mkspecs; + QComboBox *m_errorParserComboBox; +}; + CustomToolChainConfigWidget::CustomToolChainConfigWidget(CustomToolChain *tc) : ToolChainConfigWidget(tc), m_compilerCommand(new PathChooser), @@ -487,5 +498,27 @@ void CustomToolChainConfigWidget::makeReadOnlyImpl() m_mainLayout->setEnabled(false); } +} // Internal + +std::unique_ptr<ToolChainConfigWidget> CustomToolChain::createConfigurationWidget() +{ + return std::make_unique<Internal::CustomToolChainConfigWidget>(this); +} + +namespace Internal { + +// -------------------------------------------------------------------------- +// CustomToolChainFactory +// -------------------------------------------------------------------------- + +CustomToolChainFactory::CustomToolChainFactory() +{ + setDisplayName(Tr::tr("Custom")); + setSupportedToolChainType(Constants::CUSTOM_TOOLCHAIN_TYPEID); + setSupportsAllLanguages(true); + setToolchainConstructor([] { return new CustomToolChain; }); + setUserCreatable(true); +} + } // namespace Internal } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/customtoolchain.h b/src/plugins/projectexplorer/customtoolchain.h index 13a16139293..73ea98c97c6 100644 --- a/src/plugins/projectexplorer/customtoolchain.h +++ b/src/plugins/projectexplorer/customtoolchain.h @@ -9,28 +9,11 @@ #include "customparser.h" #include "headerpath.h" #include "toolchain.h" -#include "toolchainconfigwidget.h" - -#include <utils/fileutils.h> - -QT_BEGIN_NAMESPACE -class QPlainTextEdit; -class QTextEdit; -class QComboBox; -QT_END_NAMESPACE - -namespace Utils { class PathChooser; } namespace ProjectExplorer { -class AbiWidget; - namespace Internal { class CustomToolChainFactory; } -// -------------------------------------------------------------------------- -// CustomToolChain -// -------------------------------------------------------------------------- - class PROJECTEXPLORER_EXPORT CustomToolChain : public ToolChain { public: @@ -102,42 +85,5 @@ public: CustomToolChainFactory(); }; -// -------------------------------------------------------------------------- -// CustomToolChainConfigWidget -// -------------------------------------------------------------------------- - -class TextEditDetailsWidget; - -class CustomToolChainConfigWidget : public ToolChainConfigWidget -{ - Q_OBJECT - -public: - CustomToolChainConfigWidget(CustomToolChain *); - -private: - void updateSummaries(TextEditDetailsWidget *detailsWidget); - void errorParserChanged(int index = -1); - -protected: - void applyImpl() override; - void discardImpl() override { setFromToolchain(); } - bool isDirtyImpl() const override; - void makeReadOnlyImpl() override; - - void setFromToolchain(); - - Utils::PathChooser *m_compilerCommand; - Utils::PathChooser *m_makeCommand; - AbiWidget *m_abiWidget; - QPlainTextEdit *m_predefinedMacros; - QPlainTextEdit *m_headerPaths; - TextEditDetailsWidget *m_predefinedDetails; - TextEditDetailsWidget *m_headerDetails; - QLineEdit *m_cxx11Flags; - QLineEdit *m_mkspecs; - QComboBox *m_errorParserComboBox; -}; - } // namespace Internal } // namespace ProjectExplorer From 2119a6c254dbb4bf0f3a600f24c3ba44f677b664 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 17:54:33 +0200 Subject: [PATCH 0747/1777] ValgrindRunner: Get rid of errorString() Change-Id: I5ef4d911f0986a721855525f6b2b7645253606fe Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/valgrindrunner.cpp | 5 ----- src/plugins/valgrind/valgrindrunner.h | 2 -- tests/auto/valgrind/memcheck/modeldemo.cpp | 7 ++++++- tests/auto/valgrind/memcheck/modeldemo.h | 6 ------ 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index 621e837e1c1..79615d41e7b 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -229,11 +229,6 @@ void ValgrindRunner::waitForFinished() const loop.exec(); } -QString ValgrindRunner::errorString() const -{ - return d->m_process.errorString(); -} - bool ValgrindRunner::start() { return d->run(); diff --git a/src/plugins/valgrind/valgrindrunner.h b/src/plugins/valgrind/valgrindrunner.h index ff7dea0dde6..b9f90636f41 100644 --- a/src/plugins/valgrind/valgrindrunner.h +++ b/src/plugins/valgrind/valgrindrunner.h @@ -37,8 +37,6 @@ public: void waitForFinished() const; - QString errorString() const; - bool start(); void stop(); diff --git a/tests/auto/valgrind/memcheck/modeldemo.cpp b/tests/auto/valgrind/memcheck/modeldemo.cpp index 9eaf314e0ab..6d0ff1b4e1e 100644 --- a/tests/auto/valgrind/memcheck/modeldemo.cpp +++ b/tests/auto/valgrind/memcheck/modeldemo.cpp @@ -33,7 +33,12 @@ int main(int argc, char *argv[]) runner.setValgrindCommand({VALGRIND_FAKE_PATH, {"-i", PARSERTESTS_DATA_DIR "/memcheck-output-sample1.xml"}}); ModelDemo demo(&runner); - QObject::connect(&runner, &ValgrindRunner::done, &demo, &ModelDemo::finished); + QObject::connect(&runner, &ValgrindRunner::processErrorReceived, &app, [](const QString &err) { + qDebug() << err; + }); + QObject::connect(&runner, &ValgrindRunner::done, &app, [](bool success) { + qApp->exit(success ? 0 : 1); + }); ErrorListModel model; QObject::connect(&runner, &ValgrindRunner::error, &model, &ErrorListModel::addError, Qt::QueuedConnection); diff --git a/tests/auto/valgrind/memcheck/modeldemo.h b/tests/auto/valgrind/memcheck/modeldemo.h index 0950c66d53c..59c38f0c3f9 100644 --- a/tests/auto/valgrind/memcheck/modeldemo.h +++ b/tests/auto/valgrind/memcheck/modeldemo.h @@ -27,11 +27,6 @@ public: Valgrind::XmlProtocol::StackModel* stackModel; public Q_SLOTS: - void finished() { - qDebug() << runner->errorString(); - qApp->exit(!runner->errorString().isEmpty()); - } - void selectionChanged(const QItemSelection &sel, const QItemSelection &) { if (sel.indexes().isEmpty()) return; @@ -41,7 +36,6 @@ public Q_SLOTS: stackModel->setError(err); } - private: Valgrind::ValgrindRunner *runner; }; From 9335cca24951c8f26c6dd4cb768e9701634a2b7f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 16 Aug 2023 18:04:41 +0200 Subject: [PATCH 0748/1777] ProjectExplorer: Hide CustomToolChain implementation Also un-unexport it. Change-Id: If2b47fbaaedd15f0d5b9de62a6964dacb09f8ae9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../projectexplorer/customtoolchain.cpp | 122 ++++++++++++------ src/plugins/projectexplorer/customtoolchain.h | 77 +---------- .../projectexplorer/projectexplorer.cpp | 1 + 3 files changed, 87 insertions(+), 113 deletions(-) diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp index cd769df5688..74356e8d7a4 100644 --- a/src/plugins/projectexplorer/customtoolchain.cpp +++ b/src/plugins/projectexplorer/customtoolchain.cpp @@ -31,31 +31,84 @@ using namespace Utils; -namespace ProjectExplorer { +namespace ProjectExplorer::Internal { -// -------------------------------------------------------------------------- -// Helpers: -// -------------------------------------------------------------------------- - -static const char makeCommandKeyC[] = "ProjectExplorer.CustomToolChain.MakePath"; -static const char predefinedMacrosKeyC[] = "ProjectExplorer.CustomToolChain.PredefinedMacros"; -static const char headerPathsKeyC[] = "ProjectExplorer.CustomToolChain.HeaderPaths"; -static const char cxx11FlagsKeyC[] = "ProjectExplorer.CustomToolChain.Cxx11Flags"; -static const char mkspecsKeyC[] = "ProjectExplorer.CustomToolChain.Mkspecs"; -static const char outputParserKeyC[] = "ProjectExplorer.CustomToolChain.OutputParser"; +const char makeCommandKeyC[] = "ProjectExplorer.CustomToolChain.MakePath"; +const char predefinedMacrosKeyC[] = "ProjectExplorer.CustomToolChain.PredefinedMacros"; +const char headerPathsKeyC[] = "ProjectExplorer.CustomToolChain.HeaderPaths"; +const char cxx11FlagsKeyC[] = "ProjectExplorer.CustomToolChain.Cxx11Flags"; +const char mkspecsKeyC[] = "ProjectExplorer.CustomToolChain.Mkspecs"; +const char outputParserKeyC[] = "ProjectExplorer.CustomToolChain.OutputParser"; // -------------------------------------------------------------------------- // CustomToolChain // -------------------------------------------------------------------------- -CustomToolChain::CustomToolChain() : - ToolChain(Constants::CUSTOM_TOOLCHAIN_TYPEID), - m_outputParserId(GccParser::id()) +class CustomToolChain : public ToolChain { - setTypeDisplayName(Tr::tr("Custom")); - setTargetAbiKey("ProjectExplorer.CustomToolChain.TargetAbi"); - setCompilerCommandKey("ProjectExplorer.CustomToolChain.CompilerPath"); -} +public: + CustomToolChain() + : ToolChain(Constants::CUSTOM_TOOLCHAIN_TYPEID) + , m_outputParserId(GccParser::id()) + { + setTypeDisplayName(Tr::tr("Custom")); + setTargetAbiKey("ProjectExplorer.CustomToolChain.TargetAbi"); + setCompilerCommandKey("ProjectExplorer.CustomToolChain.CompilerPath"); + } + + class Parser { + public: + Id parserId; ///< A unique id identifying a parser + QString displayName; ///< A translateable name to show in the user interface + }; + + bool isValid() const override; + + MacroInspectionRunner createMacroInspectionRunner() const override; + LanguageExtensions languageExtensions(const QStringList &cxxflags) const override; + WarningFlags warningFlags(const QStringList &cxxflags) const override; + const Macros &rawPredefinedMacros() const; + void setPredefinedMacros(const Macros ¯os); + + BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Environment &) const override; + void addToEnvironment(Environment &env) const override; + QStringList suggestedMkspecList() const override; + QList<OutputLineParser *> createOutputParsers() const override; + QStringList headerPathsList() const; + void setHeaderPaths(const QStringList &list); + + void toMap(QVariantMap &data) const override; + void fromMap(const QVariantMap &data) override; + + std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; + + bool operator ==(const ToolChain &) const override; + + void setMakeCommand(const FilePath &); + FilePath makeCommand(const Environment &environment) const override; + + void setCxx11Flags(const QStringList &); + const QStringList &cxx11Flags() const; + + void setMkspecs(const QString &); + QString mkspecs() const; + + Id outputParserId() const; + void setOutputParserId(Id parserId); + static QList<CustomToolChain::Parser> parsers(); + + CustomParserSettings customParserSettings() const; + +private: + FilePath m_makeCommand; + + Macros m_predefinedMacros; + HeaderPaths m_builtInHeaderPaths; + QStringList m_cxx11Flags; + QStringList m_mkspecs; + + Id m_outputParserId; +}; CustomParserSettings CustomToolChain::customParserSettings() const { @@ -73,7 +126,7 @@ bool CustomToolChain::isValid() const ToolChain::MacroInspectionRunner CustomToolChain::createMacroInspectionRunner() const { const Macros theMacros = m_predefinedMacros; - const Utils::Id lang = language(); + const Id lang = language(); // This runner must be thread-safe! return [theMacros, lang](const QStringList &cxxflags){ @@ -89,7 +142,7 @@ ToolChain::MacroInspectionRunner CustomToolChain::createMacroInspectionRunner() }; } -Utils::LanguageExtensions CustomToolChain::languageExtensions(const QStringList &) const +LanguageExtensions CustomToolChain::languageExtensions(const QStringList &) const { return LanguageExtension::None; } @@ -148,7 +201,7 @@ QStringList CustomToolChain::suggestedMkspecList() const return m_mkspecs; } -QList<Utils::OutputLineParser *> CustomToolChain::createOutputParsers() const +QList<OutputLineParser *> CustomToolChain::createOutputParsers() const { if (m_outputParserId == GccParser::id()) return GccParser::gccParserSuite(); @@ -158,7 +211,7 @@ QList<Utils::OutputLineParser *> CustomToolChain::createOutputParsers() const return LinuxIccParser::iccParserSuite(); if (m_outputParserId == MsvcParser::id()) return {new MsvcParser}; - return {new Internal::CustomParser(customParserSettings())}; + return {new CustomParser(customParserSettings())}; } QStringList CustomToolChain::headerPathsList() const @@ -242,7 +295,7 @@ void CustomToolChain::fromMap(const QVariantMap &data) setHeaderPaths(data.value(QLatin1String(headerPathsKeyC)).toStringList()); m_cxx11Flags = data.value(QLatin1String(cxx11FlagsKeyC)).toStringList(); setMkspecs(data.value(QLatin1String(mkspecsKeyC)).toString()); - setOutputParserId(Utils::Id::fromSetting(data.value(QLatin1String(outputParserKeyC)))); + setOutputParserId(Id::fromSetting(data.value(QLatin1String(outputParserKeyC)))); } bool CustomToolChain::operator ==(const ToolChain &other) const @@ -257,12 +310,12 @@ bool CustomToolChain::operator ==(const ToolChain &other) const && m_builtInHeaderPaths == customTc->m_builtInHeaderPaths; } -Utils::Id CustomToolChain::outputParserId() const +Id CustomToolChain::outputParserId() const { return m_outputParserId; } -void CustomToolChain::setOutputParserId(Utils::Id parserId) +void CustomToolChain::setOutputParserId(Id parserId) { if (m_outputParserId == parserId) return; @@ -280,8 +333,6 @@ QList<CustomToolChain::Parser> CustomToolChain::parsers() return result; } -namespace Internal { - // -------------------------------------------------------------------------- // Helper for ConfigWidget // -------------------------------------------------------------------------- @@ -346,8 +397,8 @@ private: void setFromToolchain(); - Utils::PathChooser *m_compilerCommand; - Utils::PathChooser *m_makeCommand; + PathChooser *m_compilerCommand; + PathChooser *m_makeCommand; AbiWidget *m_abiWidget; QPlainTextEdit *m_predefinedMacros; QPlainTextEdit *m_headerPaths; @@ -454,7 +505,7 @@ void CustomToolChainConfigWidget::applyImpl() tc->setCxx11Flags(m_cxx11Flags->text().split(QLatin1Char(','))); tc->setMkspecs(m_mkspecs->text()); tc->setDisplayName(displayName); // reset display name - tc->setOutputParserId(Utils::Id::fromSetting(m_errorParserComboBox->currentData())); + tc->setOutputParserId(Id::fromSetting(m_errorParserComboBox->currentData())); setFromToolchain(); // Refresh with actual data from the toolchain. This shows what e.g. the // macro parser did with the input. @@ -490,7 +541,7 @@ bool CustomToolChainConfigWidget::isDirtyImpl() const || m_headerDetails->entries() != tc->headerPathsList() || m_cxx11Flags->text().split(QLatin1Char(',')) != tc->cxx11Flags() || m_mkspecs->text() != tc->mkspecs() - || Utils::Id::fromSetting(m_errorParserComboBox->currentData()) == tc->outputParserId(); + || Id::fromSetting(m_errorParserComboBox->currentData()) == tc->outputParserId(); } void CustomToolChainConfigWidget::makeReadOnlyImpl() @@ -498,15 +549,11 @@ void CustomToolChainConfigWidget::makeReadOnlyImpl() m_mainLayout->setEnabled(false); } -} // Internal - std::unique_ptr<ToolChainConfigWidget> CustomToolChain::createConfigurationWidget() { - return std::make_unique<Internal::CustomToolChainConfigWidget>(this); + return std::make_unique<CustomToolChainConfigWidget>(this); } -namespace Internal { - // -------------------------------------------------------------------------- // CustomToolChainFactory // -------------------------------------------------------------------------- @@ -520,5 +567,4 @@ CustomToolChainFactory::CustomToolChainFactory() setUserCreatable(true); } -} // namespace Internal -} // namespace ProjectExplorer +} // ProjectExplorer::Internal diff --git a/src/plugins/projectexplorer/customtoolchain.h b/src/plugins/projectexplorer/customtoolchain.h index 73ea98c97c6..a8d8616efb9 100644 --- a/src/plugins/projectexplorer/customtoolchain.h +++ b/src/plugins/projectexplorer/customtoolchain.h @@ -3,81 +3,9 @@ #pragma once -#include "projectexplorer_export.h" - -#include "abi.h" -#include "customparser.h" -#include "headerpath.h" #include "toolchain.h" -namespace ProjectExplorer { - -namespace Internal { class CustomToolChainFactory; } - -class PROJECTEXPLORER_EXPORT CustomToolChain : public ToolChain -{ -public: - class Parser { - public: - Utils::Id parserId; ///< A unique id identifying a parser - QString displayName; ///< A translateable name to show in the user interface - }; - - bool isValid() const override; - - MacroInspectionRunner createMacroInspectionRunner() const override; - Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const override; - Utils::WarningFlags warningFlags(const QStringList &cxxflags) const override; - const Macros &rawPredefinedMacros() const; - void setPredefinedMacros(const Macros ¯os); - - BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner( - const Utils::Environment &) const override; - void addToEnvironment(Utils::Environment &env) const override; - QStringList suggestedMkspecList() const override; - QList<Utils::OutputLineParser *> createOutputParsers() const override; - QStringList headerPathsList() const; - void setHeaderPaths(const QStringList &list); - - void toMap(QVariantMap &data) const override; - void fromMap(const QVariantMap &data) override; - - std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; - - bool operator ==(const ToolChain &) const override; - - void setMakeCommand(const Utils::FilePath &); - Utils::FilePath makeCommand(const Utils::Environment &environment) const override; - - void setCxx11Flags(const QStringList &); - const QStringList &cxx11Flags() const; - - void setMkspecs(const QString &); - QString mkspecs() const; - - Utils::Id outputParserId() const; - void setOutputParserId(Utils::Id parserId); - static QList<CustomToolChain::Parser> parsers(); - -private: - CustomToolChain(); - - CustomParserSettings customParserSettings() const; - - Utils::FilePath m_makeCommand; - - Macros m_predefinedMacros; - HeaderPaths m_builtInHeaderPaths; - QStringList m_cxx11Flags; - QStringList m_mkspecs; - - Utils::Id m_outputParserId; - - friend class Internal::CustomToolChainFactory; - friend class ToolChainFactory; -}; - -namespace Internal { +namespace ProjectExplorer::Internal { class CustomToolChainFactory : public ToolChainFactory { @@ -85,5 +13,4 @@ public: CustomToolChainFactory(); }; -} // namespace Internal -} // namespace ProjectExplorer +} // ProjectExplorer::Interna; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 62c05eaceac..45e805620c1 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -82,6 +82,7 @@ #include "msvctoolchain.h" #endif +#include "customparser.h" #include "projecttree.h" #include "projectwelcomepage.h" From b1304de6cf1bca02bc6a6447700aa425b1fb7627 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 16:41:44 +0200 Subject: [PATCH 0749/1777] ValgrindRunner: Employ task tree internally Change-Id: I32f674d7ea93e5825eba0912c98cc0280802c483 Reviewed-by: hjk <hjk@qt.io> --- .../valgrind/valgrindmemcheckparsertest.cpp | 6 +- src/plugins/valgrind/valgrindrunner.cpp | 215 +++++++++++------- src/plugins/valgrind/valgrindrunner.h | 8 +- .../valgrind/valgrindtestrunnertest.cpp | 3 +- 4 files changed, 137 insertions(+), 95 deletions(-) diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp index f74df7d80d6..4b16f42efdf 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -514,8 +514,7 @@ void ValgrindMemcheckParserTest::testRealValgrind() runner.setValgrindCommand({"valgrind", {}}); runner.setDebuggee(debuggee); RunnerDumper dumper(&runner); - runner.start(); - runner.waitForFinished(); + runner.runBlocking(); } void ValgrindMemcheckParserTest::testValgrindStartError_data() @@ -551,8 +550,7 @@ void ValgrindMemcheckParserTest::testValgrindStartError() runner.setValgrindCommand({FilePath::fromString(valgrindExe), valgrindArgs}); runner.setDebuggee(debuggeeExecutable); RunnerDumper dumper(&runner); - runner.start(); - runner.waitForFinished(); + runner.runBlocking(); QVERIFY(dumper.m_errorReceived); // just finish without deadlock and we are fine } diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index 79615d41e7b..e6502bb3e89 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -8,15 +8,18 @@ #include <projectexplorer/runcontrol.h> -#include <utils/hostosinfo.h> +#include <solutions/tasking/barrier.h> + #include <utils/process.h> #include <utils/qtcassert.h> #include <QEventLoop> #include <QTcpServer> #include <QTcpSocket> +#include <QTimer> using namespace ProjectExplorer; +using namespace Tasking; using namespace Utils; using namespace Valgrind::XmlProtocol; @@ -56,33 +59,12 @@ static CommandLine valgrindCommand(const CommandLine &command, return cmd; } -class ValgrindRunner::Private : public QObject +class ValgrindRunnerPrivate : public QObject { public: - Private(ValgrindRunner *owner) : q(owner) { - connect(&m_xmlServer, &QTcpServer::newConnection, this, [this] { - QTcpSocket *socket = m_xmlServer.nextPendingConnection(); - QTC_ASSERT(socket, return); - m_xmlServer.close(); - m_parser.setSocket(socket); - m_parser.start(); - }); - connect(&m_logServer, &QTcpServer::newConnection, this, [this] { - QTcpSocket *socket = m_logServer.nextPendingConnection(); - QTC_ASSERT(socket, return); - connect(socket, &QIODevice::readyRead, this, [this, socket] { - emit q->logMessageReceived(socket->readAll()); - }); - m_logServer.close(); - }); - - connect(&m_parser, &Parser::status, q, &ValgrindRunner::status); - connect(&m_parser, &Parser::error, q, &ValgrindRunner::error); - connect(&m_parser, &Parser::done, this, [this](bool success, const QString &err) { - if (!success) - emit q->internalError(err); - }); - } + ValgrindRunnerPrivate(ValgrindRunner *owner) + : q(owner) + {} void setupValgrindProcess(Process *process, const CommandLine &command) const { CommandLine cmd = command; @@ -123,7 +105,8 @@ public: }); } - bool startServers(); + Group runRecipe() const; + bool run(); ValgrindRunner *q = nullptr; @@ -134,65 +117,120 @@ public: QHostAddress m_localServerAddress; bool m_useTerminal = false; - Process m_process; - QTcpServer m_xmlServer; - QTcpServer m_logServer; - Parser m_parser; + std::unique_ptr<TaskTree> m_taskTree; }; -bool ValgrindRunner::Private::startServers() +Group ValgrindRunnerPrivate::runRecipe() const { - const bool xmlOK = m_xmlServer.listen(m_localServerAddress); - const QString ip = m_localServerAddress.toString(); - if (!xmlOK) { - emit q->processErrorReceived(Tr::tr("XmlServer on %1:").arg(ip) + ' ' - + m_xmlServer.errorString(), QProcess::FailedToStart ); - return false; - } - m_xmlServer.setMaxPendingConnections(1); - const bool logOK = m_logServer.listen(m_localServerAddress); - if (!logOK) { - emit q->processErrorReceived(Tr::tr("LogServer on %1:").arg(ip) + ' ' - + m_logServer.errorString(), QProcess::FailedToStart ); - return false; - } - m_logServer.setMaxPendingConnections(1); - return true; + struct ValgrindStorage { + CommandLine m_valgrindCommand; + std::unique_ptr<QTcpServer> m_xmlServer; + std::unique_ptr<QTcpServer> m_logServer; + std::unique_ptr<QTcpSocket> m_xmlSocket; + }; + + TreeStorage<ValgrindStorage> storage; + SingleBarrier xmlBarrier; + + const auto onSetup = [this, storage, xmlBarrier] { + ValgrindStorage *storagePtr = storage.activeStorage(); + storagePtr->m_valgrindCommand.setExecutable(m_valgrindCommand.executable()); + if (!m_localServerAddress.isNull()) { + Barrier *barrier = xmlBarrier->barrier(); + const QString ip = m_localServerAddress.toString(); + + QTcpServer *xmlServer = new QTcpServer; + storagePtr->m_xmlServer.reset(xmlServer); + connect(xmlServer, &QTcpServer::newConnection, this, [xmlServer, storagePtr, barrier] { + QTcpSocket *socket = xmlServer->nextPendingConnection(); + QTC_ASSERT(socket, return); + xmlServer->close(); + storagePtr->m_xmlSocket.reset(socket); + barrier->advance(); // Release Parser task + }); + if (!xmlServer->listen(m_localServerAddress)) { + emit q->processErrorReceived(Tr::tr("XmlServer on %1:").arg(ip) + ' ' + + xmlServer->errorString(), QProcess::FailedToStart); + return SetupResult::StopWithError; + } + xmlServer->setMaxPendingConnections(1); + + QTcpServer *logServer = new QTcpServer; + storagePtr->m_logServer.reset(logServer); + connect(logServer, &QTcpServer::newConnection, this, [this, logServer] { + QTcpSocket *socket = logServer->nextPendingConnection(); + QTC_ASSERT(socket, return); + connect(socket, &QIODevice::readyRead, this, [this, socket] { + emit q->logMessageReceived(socket->readAll()); + }); + logServer->close(); + }); + if (!logServer->listen(m_localServerAddress)) { + emit q->processErrorReceived(Tr::tr("LogServer on %1:").arg(ip) + ' ' + + logServer->errorString(), QProcess::FailedToStart); + return SetupResult::StopWithError; + } + logServer->setMaxPendingConnections(1); + + storagePtr->m_valgrindCommand = valgrindCommand(storagePtr->m_valgrindCommand, + *xmlServer, *logServer); + } + return SetupResult::Continue; + }; + + const auto onProcessSetup = [this, storage](Process &process) { + setupValgrindProcess(&process, storage->m_valgrindCommand); + }; + + const auto onParserGroupSetup = [this] { + return m_localServerAddress.isNull() ? SetupResult::StopWithDone : SetupResult::Continue; + }; + + const auto onParserSetup = [this, storage](Parser &parser) { + connect(&parser, &Parser::status, q, &ValgrindRunner::status); + connect(&parser, &Parser::error, q, &ValgrindRunner::error); + parser.setSocket(storage->m_xmlSocket.release()); + }; + + const auto onParserError = [this](const Parser &parser) { + emit q->internalError(parser.errorString()); + }; + + const Group root { + parallel, + Storage(storage), + Storage(xmlBarrier), + onGroupSetup(onSetup), + ProcessTask(onProcessSetup), + Group { + onGroupSetup(onParserGroupSetup), + waitForBarrierTask(xmlBarrier), + ParserTask(onParserSetup, {}, onParserError) + } + }; + return root; } -bool ValgrindRunner::Private::run() +bool ValgrindRunnerPrivate::run() { - CommandLine cmd; - cmd.setExecutable(m_valgrindCommand.executable()); - - if (!m_localServerAddress.isNull()) { - if (!startServers()) - return false; - cmd = valgrindCommand(cmd, m_xmlServer, m_logServer); - } - setupValgrindProcess(&m_process, cmd); - m_process.start(); - return true; + m_taskTree.reset(new TaskTree); + m_taskTree->setRecipe(runRecipe()); + const auto finalize = [this](bool success) { + m_taskTree.release()->deleteLater(); + emit q->done(success); + }; + connect(m_taskTree.get(), &TaskTree::done, this, [finalize] { finalize(true); }); + connect(m_taskTree.get(), &TaskTree::errorOccurred, this, [finalize] { finalize(false); }); + m_taskTree->start(); + return bool(m_taskTree); } ValgrindRunner::ValgrindRunner(QObject *parent) : QObject(parent) - , d(new Private(this)) + , d(new ValgrindRunnerPrivate(this)) {} -ValgrindRunner::~ValgrindRunner() -{ - if (d->m_process.isRunning()) { - // make sure we don't delete the thread while it's still running - waitForFinished(); - } - if (d->m_parser.isRunning()) { - // make sure we don't delete the thread while it's still running - waitForFinished(); - } - delete d; - d = nullptr; -} +ValgrindRunner::~ValgrindRunner() = default; void ValgrindRunner::setValgrindCommand(const CommandLine &command) { @@ -219,16 +257,6 @@ void ValgrindRunner::setUseTerminal(bool on) d->m_useTerminal = on; } -void ValgrindRunner::waitForFinished() const -{ - if (d->m_process.state() == QProcess::NotRunning) - return; - - QEventLoop loop; - connect(this, &ValgrindRunner::done, &loop, &QEventLoop::quit); - loop.exec(); -} - bool ValgrindRunner::start() { return d->run(); @@ -236,7 +264,24 @@ bool ValgrindRunner::start() void ValgrindRunner::stop() { - d->m_process.stop(); + d->m_taskTree.reset(); +} + +bool ValgrindRunner::runBlocking() +{ + bool ok = false; + QEventLoop loop; + + const auto finalize = [&loop, &ok](bool success) { + ok = success; + // Refer to the QObject::deleteLater() docs. + QMetaObject::invokeMethod(&loop, [&loop] { loop.quit(); }, Qt::QueuedConnection); + }; + + connect(this, &ValgrindRunner::done, &loop, finalize); + QTimer::singleShot(0, this, &ValgrindRunner::start); + loop.exec(QEventLoop::ExcludeUserInputEvents); + return ok; } } // namespace Valgrind diff --git a/src/plugins/valgrind/valgrindrunner.h b/src/plugins/valgrind/valgrindrunner.h index b9f90636f41..508b896e3aa 100644 --- a/src/plugins/valgrind/valgrindrunner.h +++ b/src/plugins/valgrind/valgrindrunner.h @@ -21,6 +21,8 @@ class Error; class Status; } +class ValgrindRunnerPrivate; + class ValgrindRunner : public QObject { Q_OBJECT @@ -35,10 +37,9 @@ public: void setLocalServerAddress(const QHostAddress &localServerAddress); void setUseTerminal(bool on); - void waitForFinished() const; - bool start(); void stop(); + bool runBlocking(); signals: void appendMessage(const QString &, Utils::OutputFormat); @@ -53,8 +54,7 @@ signals: void internalError(const QString &errorString); private: - class Private; - Private *d; + std::unique_ptr<ValgrindRunnerPrivate> d; }; } // namespace Valgrind diff --git a/src/plugins/valgrind/valgrindtestrunnertest.cpp b/src/plugins/valgrind/valgrindtestrunnertest.cpp index 427b83617af..09f316eea7b 100644 --- a/src/plugins/valgrind/valgrindtestrunnertest.cpp +++ b/src/plugins/valgrind/valgrindtestrunnertest.cpp @@ -66,8 +66,7 @@ QString ValgrindTestRunnerTest::runTestBinary(const QString &binary, const QStri m_runner->setLocalServerAddress(QHostAddress::LocalHost); m_runner->setValgrindCommand(valgrind); m_runner->setDebuggee(debuggee); - m_runner->start(); - m_runner->waitForFinished(); + m_runner->runBlocking(); return binPath; } From ec4c85bab45cad72b077e4de9e04865fd991d233 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 15 Aug 2023 14:59:07 +0200 Subject: [PATCH 0750/1777] Copilot: Enabler readSettings workaround readSettings does not trigger signals when values change, so other aspects that have setEnabler set will not realize that the enablers changed and possibly not update. Calling setEnabler after read settings ensures that the correct value is used. Change-Id: Ifff3ff13d9c78e16bddf8032b891a5004a035496 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/copilot/copilotsettings.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index d5f8639d0c6..4a224c96b12 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -61,7 +61,6 @@ CopilotSettings::CopilotSettings() nodeJsPath.setLabelText(Tr::tr("Node.js path:")); nodeJsPath.setHistoryCompleter("Copilot.NodePath.History"); nodeJsPath.setDisplayName(Tr::tr("Node.js Path")); - nodeJsPath.setEnabler(&enableCopilot); nodeJsPath.setToolTip( Tr::tr("Select path to node.js executable. See https://nodejs.org/en/download/" "for installation instructions.")); @@ -72,7 +71,6 @@ CopilotSettings::CopilotSettings() distPath.setLabelText(Tr::tr("Path to agent.js:")); distPath.setHistoryCompleter("Copilot.DistPath.History"); distPath.setDisplayName(Tr::tr("Agent.js path")); - distPath.setEnabler(&enableCopilot); distPath.setToolTip(Tr::tr( "Select path to agent.js in Copilot Neovim plugin. See " "https://github.com/github/copilot.vim#getting-started for installation instructions.")); @@ -81,7 +79,6 @@ CopilotSettings::CopilotSettings() autoComplete.setSettingsKey("Copilot.Autocomplete"); autoComplete.setLabelText(Tr::tr("Auto request")); autoComplete.setDefaultValue(true); - autoComplete.setEnabler(&enableCopilot); autoComplete.setToolTip(Tr::tr("Automatically request suggestions for the current text cursor " "position after changes to the document.")); autoComplete.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); @@ -90,7 +87,6 @@ CopilotSettings::CopilotSettings() useProxy.setSettingsKey("Copilot.UseProxy"); useProxy.setLabelText(Tr::tr("Use Proxy")); useProxy.setDefaultValue(false); - useProxy.setEnabler(&enableCopilot); useProxy.setToolTip(Tr::tr("Use a proxy to connect to the Copilot servers.")); useProxy.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); @@ -99,7 +95,6 @@ CopilotSettings::CopilotSettings() proxyHost.setSettingsKey("Copilot.ProxyHost"); proxyHost.setLabelText(Tr::tr("Proxy Host")); proxyHost.setDefaultValue(""); - proxyHost.setEnabler(&useProxy); proxyHost.setToolTip(Tr::tr("The host name of the proxy server.")); proxyHost.setHistoryCompleter("Copilot.ProxyHost.History"); @@ -107,7 +102,6 @@ CopilotSettings::CopilotSettings() proxyPort.setSettingsKey("Copilot.ProxyPort"); proxyPort.setLabelText(Tr::tr("Proxy Port")); proxyPort.setDefaultValue(3128); - proxyPort.setEnabler(&useProxy); proxyPort.setToolTip(Tr::tr("The port of the proxy server.")); proxyPort.setRange(1, 65535); @@ -116,7 +110,6 @@ CopilotSettings::CopilotSettings() proxyUser.setSettingsKey("Copilot.ProxyUser"); proxyUser.setLabelText(Tr::tr("Proxy User")); proxyUser.setDefaultValue(""); - proxyUser.setEnabler(&useProxy); proxyUser.setToolTip(Tr::tr("The user name for the proxy server.")); proxyUser.setHistoryCompleter("Copilot.ProxyUser.History"); @@ -124,7 +117,6 @@ CopilotSettings::CopilotSettings() saveProxyPassword.setSettingsKey("Copilot.SaveProxyPassword"); saveProxyPassword.setLabelText(Tr::tr("Save Proxy Password")); saveProxyPassword.setDefaultValue(false); - saveProxyPassword.setEnabler(&useProxy); saveProxyPassword.setToolTip( Tr::tr("Save the password for the proxy server (Password is stored insecurely!).")); saveProxyPassword.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); @@ -134,14 +126,12 @@ CopilotSettings::CopilotSettings() proxyPassword.setSettingsKey("Copilot.ProxyPassword"); proxyPassword.setLabelText(Tr::tr("Proxy Password")); proxyPassword.setDefaultValue(""); - proxyPassword.setEnabler(&saveProxyPassword); proxyPassword.setToolTip(Tr::tr("The password for the proxy server.")); proxyRejectUnauthorized.setDisplayName(Tr::tr("Reject Unauthorized")); proxyRejectUnauthorized.setSettingsKey("Copilot.ProxyRejectUnauthorized"); proxyRejectUnauthorized.setLabelText(Tr::tr("Reject Unauthorized")); proxyRejectUnauthorized.setDefaultValue(true); - proxyRejectUnauthorized.setEnabler(&useProxy); proxyRejectUnauthorized.setToolTip(Tr::tr("Reject unauthorized certificates from the proxy " "server. This is a security risk.")); proxyRejectUnauthorized.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); @@ -151,6 +141,21 @@ CopilotSettings::CopilotSettings() readSettings(); + // TODO: As a workaround we set the enabler after reading the settings, as that does not signal + // a change. + nodeJsPath.setEnabler(&enableCopilot); + distPath.setEnabler(&enableCopilot); + autoComplete.setEnabler(&enableCopilot); + useProxy.setEnabler(&enableCopilot); + + proxyHost.setEnabler(&useProxy); + proxyPort.setEnabler(&useProxy); + proxyUser.setEnabler(&useProxy); + saveProxyPassword.setEnabler(&useProxy); + proxyRejectUnauthorized.setEnabler(&useProxy); + + proxyPassword.setEnabler(&saveProxyPassword); + setLayouter([this] { using namespace Layouting; From f1411c580dd7f3c2b7ca28843973d78f2686c5d2 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 4 Aug 2023 14:56:13 +0200 Subject: [PATCH 0751/1777] LanguageClient: only restart successfully initialized clients Change-Id: I09174ae1b5cec088e22e5de8634af90687faf109 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/languageclient/languageclientmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index 54b3f5205a5..a71f09255aa 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -165,7 +165,7 @@ void LanguageClientManager::clientFinished(Client *client) if (!PluginManager::isShuttingDown()) { const QList<TextEditor::TextDocument *> &clientDocs = managerInstance->m_clientForDocument.keys(client); - if (client->reset()) { + if (client->state() == Client::Initialized && client->reset()) { qCDebug(Log) << "restart unexpectedly finished client: " << client->name() << client; client->log( Tr::tr("Unexpectedly finished. Restarting in %1 seconds.").arg(restartTimeoutS)); From 8815d5974e04ab3c40c23abc69ba39e441c9cf6c Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 17 Aug 2023 07:20:43 +0200 Subject: [PATCH 0752/1777] Copilot: Fix build Change-Id: I4fb0df318ec6eff50f2ddca476195882f1c6910d Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/copilot/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/copilot/CMakeLists.txt b/src/plugins/copilot/CMakeLists.txt index f50890d0fd2..8ae844b8790 100644 --- a/src/plugins/copilot/CMakeLists.txt +++ b/src/plugins/copilot/CMakeLists.txt @@ -1,5 +1,5 @@ add_qtc_plugin(Copilot - PLUGIN_DEPENDS Core LanguageClient + PLUGIN_DEPENDS Core LanguageClient app_version SOURCES authwidget.cpp authwidget.h copilot.qrc From 5e70029e87e8ffef3c34accd611c49be46515846 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 15 Aug 2023 15:48:57 +0200 Subject: [PATCH 0753/1777] Utils: ShowPwdButton paint while not enabled Change-Id: Ie76413b91d91e703e108192b04e8bbfeed2774f0 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/libs/utils/passworddialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/passworddialog.cpp b/src/libs/utils/passworddialog.cpp index 3d2f0853ccd..05bdf268da9 100644 --- a/src/libs/utils/passworddialog.cpp +++ b/src/libs/utils/passworddialog.cpp @@ -33,7 +33,7 @@ void ShowPasswordButton::paintEvent(QPaintEvent *e) QPainter p(this); QRect r(QPoint(), size()); - if (m_containsMouse) + if (m_containsMouse && isEnabled()) StyleHelper::drawPanelBgRect(&p, r, creatorTheme()->color(Theme::FancyToolButtonHoverColor)); QWindow *window = this->window()->windowHandle(); From a93040185d537cdd06d33e18a91740af719d6cde Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 17 Aug 2023 08:29:08 +0200 Subject: [PATCH 0754/1777] AutoTest: Fix used IDs Amends f53e18ee7346db46d9dd3dfe566b00f8d34435a4. Change-Id: Ib807eaaa6f211d3661a447e5d02bc0cce108ff2f Reviewed-by: hjk <hjk@qt.io> --- src/plugins/autotest/gtest/gtestconstants.h | 2 +- src/plugins/autotest/quick/quicktestframework.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/autotest/gtest/gtestconstants.h b/src/plugins/autotest/gtest/gtestconstants.h index e2a39b4b0df..378efd6d1e8 100644 --- a/src/plugins/autotest/gtest/gtestconstants.h +++ b/src/plugins/autotest/gtest/gtestconstants.h @@ -9,7 +9,7 @@ namespace Autotest { namespace GTest { namespace Constants { -const char FRAMEWORK_ID[] = "Autotest.Framework.GTest"; +const char FRAMEWORK_ID[] = "AutoTest.Framework.GTest"; const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("QtC::Autotest", "Google Test"); const unsigned FRAMEWORK_PRIORITY = 10; const char DEFAULT_FILTER[] = "*.*"; diff --git a/src/plugins/autotest/quick/quicktestframework.h b/src/plugins/autotest/quick/quicktestframework.h index 0bfc1f7c11d..d07732b9108 100644 --- a/src/plugins/autotest/quick/quicktestframework.h +++ b/src/plugins/autotest/quick/quicktestframework.h @@ -11,7 +11,7 @@ namespace Autotest { namespace QuickTest { namespace Constants { -const char FRAMEWORK_ID[] = "Autotest.Framework.QtQuickTest"; +const char FRAMEWORK_ID[] = "AutoTest.Framework.QtQuickTest"; } // namespace Constants } // namespace QuickTest From 62969fe567b6ee0bbd2260d6c57f29875aa78a07 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 16 Aug 2023 17:15:44 +0200 Subject: [PATCH 0755/1777] ProjectExplorer: Remove unneeded #include Change-Id: Ib835409781ad1ebf8efa184e69c5adf20436b6ad Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/projectexplorer/toolchain.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 2c7a81acc98..1091b1a9a63 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -5,16 +5,12 @@ #include "abi.h" #include "devicesupport/idevice.h" -#include "headerpath.h" #include "projectexplorerconstants.h" #include "toolchainmanager.h" #include "task.h" -#include <utils/fileutils.h> #include <utils/qtcassert.h> -#include <QCoreApplication> -#include <QFileInfo> #include <QUuid> #include <utility> From ccb66ea64dd6243ab96fc7e65c2f5c9862593fe7 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 17 Aug 2023 08:10:57 +0200 Subject: [PATCH 0756/1777] Copilot: Don't use app_version Change-Id: I10c1bfaa6befe49ba7261afe14c457a5f33c887f Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/copilot/CMakeLists.txt | 2 +- src/plugins/copilot/copilot.qbs | 1 - src/plugins/copilot/copilotclient.cpp | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/plugins/copilot/CMakeLists.txt b/src/plugins/copilot/CMakeLists.txt index 8ae844b8790..f50890d0fd2 100644 --- a/src/plugins/copilot/CMakeLists.txt +++ b/src/plugins/copilot/CMakeLists.txt @@ -1,5 +1,5 @@ add_qtc_plugin(Copilot - PLUGIN_DEPENDS Core LanguageClient app_version + PLUGIN_DEPENDS Core LanguageClient SOURCES authwidget.cpp authwidget.h copilot.qrc diff --git a/src/plugins/copilot/copilot.qbs b/src/plugins/copilot/copilot.qbs index f95f17912a9..6d2b2100472 100644 --- a/src/plugins/copilot/copilot.qbs +++ b/src/plugins/copilot/copilot.qbs @@ -7,7 +7,6 @@ QtcPlugin { Depends { name: "LanguageClient" } Depends { name: "ProjectExplorer" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] } files: [ diff --git a/src/plugins/copilot/copilotclient.cpp b/src/plugins/copilot/copilotclient.cpp index d5592b7861c..c166e2e37f6 100644 --- a/src/plugins/copilot/copilotclient.cpp +++ b/src/plugins/copilot/copilotclient.cpp @@ -6,8 +6,6 @@ #include "copilotsuggestion.h" #include "copilottr.h" -#include <app/app_version.h> - #include <languageclient/languageclientinterface.h> #include <languageclient/languageclientmanager.h> #include <languageclient/languageclientsettings.h> @@ -26,6 +24,7 @@ #include <utils/filepath.h> #include <utils/passworddialog.h> +#include <QGuiApplication> #include <QInputDialog> #include <QLoggingCategory> #include <QTimer> @@ -252,8 +251,9 @@ void CopilotClient::requestSetEditorInfo() if (settings().saveProxyPassword()) currentProxyPassword = settings().proxyPassword(); - const EditorInfo editorInfo{Core::Constants::IDE_VERSION_DISPLAY, "Qt Creator"}; - const EditorPluginInfo editorPluginInfo{Core::Constants::IDE_VERSION_DISPLAY, + const EditorInfo editorInfo{QCoreApplication::applicationVersion(), + QGuiApplication::applicationDisplayName()}; + const EditorPluginInfo editorPluginInfo{QCoreApplication::applicationVersion(), "Qt Creator Copilot plugin"}; SetEditorInfoParams params(editorInfo, editorPluginInfo); From d611fe6821347858e435e88efe98d972e29d2c91 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 17 Aug 2023 08:52:19 +0200 Subject: [PATCH 0757/1777] Axivion: Add generated files to qbs build They have been added for future use for the cmake build. Do so as well for qbs. Change-Id: I0cb9bb161090a9c84e8c36567d6555bc0096b0e4 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/axivion/axivion.qbs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/plugins/axivion/axivion.qbs b/src/plugins/axivion/axivion.qbs index bfe8efe6cf5..965fe0c0b57 100644 --- a/src/plugins/axivion/axivion.qbs +++ b/src/plugins/axivion/axivion.qbs @@ -29,4 +29,18 @@ QtcPlugin { "axivionsettingspage.h", "axiviontr.h", ] + + cpp.includePaths: base.concat(["."]) // needed for the generated stuff below + + Group { + name: "Generated DTOs" + prefix: "dashboard/" + + files: [ + "concat.cpp", + "concat.h", + "dto.cpp", + "dto.h", + ] + } } From 92355bf40d2ff6a44465aa085fe018db2e50e919 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 10 Aug 2023 06:44:27 +0200 Subject: [PATCH 0758/1777] Terminal: Lazily open remote terminals Move the burden of finding the shell of a device from the shell menu to the TerminalWidget, so that opening the shell menu does not block the ui. Change-Id: I7f2e5a891f20faa53a1e3eec879866219f9bee0b Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/terminalhooks.cpp | 11 ++------ src/libs/utils/terminalhooks.h | 4 --- .../devicesupport/devicemanager.cpp | 24 ++++++---------- .../devicesupport/devicemanager.h | 2 ++ src/plugins/terminal/shellmodel.cpp | 23 ++++++++------- src/plugins/terminal/terminalwidget.cpp | 28 +++++++++++++++++++ src/plugins/terminal/terminalwidget.h | 6 ++++ 7 files changed, 60 insertions(+), 38 deletions(-) diff --git a/src/libs/utils/terminalhooks.cpp b/src/libs/utils/terminalhooks.cpp index 3bda25b109c..f1420755c59 100644 --- a/src/libs/utils/terminalhooks.cpp +++ b/src/libs/utils/terminalhooks.cpp @@ -17,6 +17,9 @@ FilePath defaultShellForDevice(const FilePath &deviceRoot) return deviceRoot.withNewPath("cmd.exe").searchInPath(); const Environment env = deviceRoot.deviceEnvironment(); + if (!env.hasChanges()) + return {}; + FilePath shell = FilePath::fromUserInput(env.value_or("SHELL", "/bin/sh")); if (!shell.isAbsolutePath()) @@ -32,7 +35,6 @@ class HooksPrivate { public: HooksPrivate() - : m_getTerminalCommandsForDevicesHook([] { return QList<NameAndCommandLine>{}; }) { auto openTerminal = [](const OpenTerminalParameters ¶meters) { DeviceFileHooks::instance().openTerminal(parameters.workingDirectory.value_or( @@ -79,8 +81,6 @@ public: return m_openTerminal; } - Hooks::GetTerminalCommandsForDevicesHook m_getTerminalCommandsForDevicesHook; - private: Hooks::OpenTerminal m_openTerminal; Hooks::CreateTerminalProcessInterface m_createTerminalProcessInterface; @@ -111,11 +111,6 @@ ProcessInterface *Hooks::createTerminalProcessInterface() const return d->createTerminalProcessInterface()(); } -Hooks::GetTerminalCommandsForDevicesHook &Hooks::getTerminalCommandsForDevicesHook() -{ - return d->m_getTerminalCommandsForDevicesHook; -} - void Hooks::addCallbackSet(const QString &name, const CallbackSet &callbackSet) { d->addCallbackSet(name, callbackSet); diff --git a/src/libs/utils/terminalhooks.h b/src/libs/utils/terminalhooks.h index 02e37e84972..f5b55111c1e 100644 --- a/src/libs/utils/terminalhooks.h +++ b/src/libs/utils/terminalhooks.h @@ -85,14 +85,10 @@ public: CreateTerminalProcessInterface createTerminalProcessInterface; }; - using GetTerminalCommandsForDevicesHook = Hook<QList<NameAndCommandLine>>; - public: static Hooks &instance(); ~Hooks(); - GetTerminalCommandsForDevicesHook &getTerminalCommandsForDevicesHook(); - void openTerminal(const OpenTerminalParameters ¶meters) const; ProcessInterface *createTerminalProcessInterface() const; diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index aa017df46b0..f783ea18139 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -465,22 +465,6 @@ DeviceManager::DeviceManager(bool isInstance) : d(std::make_unique<DeviceManager }; Process::setRemoteProcessHooks(processHooks); - - Terminal::Hooks::instance().getTerminalCommandsForDevicesHook().set( - [this]() -> QList<Terminal::NameAndCommandLine> { - QList<Terminal::NameAndCommandLine> result; - for (const IDevice::ConstPtr device : d->devices) { - if (device->type() == Constants::DESKTOP_DEVICE_TYPE) - continue; - - const FilePath shell = Terminal::defaultShellForDevice(device->rootPath()); - - if (!shell.isEmpty()) - result << Terminal::NameAndCommandLine{device->displayName(), - CommandLine{shell, {}}}; - } - return result; - }); } DeviceManager::~DeviceManager() @@ -497,6 +481,14 @@ IDevice::ConstPtr DeviceManager::deviceAt(int idx) const return d->devices.at(idx); } +void DeviceManager::forEachDevice(const std::function<void(const IDeviceConstPtr &)> &func) const +{ + const QList<IDevice::Ptr> devices = d->deviceList(); + + for (const IDevice::Ptr &device : devices) + func(device); +} + IDevice::Ptr DeviceManager::mutableDevice(Id id) const { const int index = d->indexForId(id); diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.h b/src/plugins/projectexplorer/devicesupport/devicemanager.h index 213624971b8..ce12ccf1b83 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.h +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.h @@ -35,6 +35,8 @@ public: int deviceCount() const; IDevice::ConstPtr deviceAt(int index) const; + void forEachDevice(const std::function<void(const IDeviceConstPtr &)> &) const; + IDevice::ConstPtr find(Utils::Id id) const; IDevice::ConstPtr defaultDevice(Utils::Id deviceType) const; bool hasDevice(const QString &name) const; diff --git a/src/plugins/terminal/shellmodel.cpp b/src/plugins/terminal/shellmodel.cpp index 0cc58f1fe6c..a9667c95e13 100644 --- a/src/plugins/terminal/shellmodel.cpp +++ b/src/plugins/terminal/shellmodel.cpp @@ -3,6 +3,9 @@ #include "shellmodel.h" +#include <projectexplorer/devicesupport/devicemanager.h> +#include <projectexplorer/projectexplorerconstants.h> + #include <utils/algorithm.h> #include <utils/environment.h> #include <utils/filepath.h> @@ -138,11 +141,10 @@ ShellModelPrivate::ShellModelPrivate() }); // ... and filter out non-existing shells. - localShells = Utils::transform( - Utils::filtered(shells, [](const FilePath &shell) {return shell.exists(); }), - [&iconProvider](const FilePath &shell) { - return ShellItemBuilder(iconProvider, shell).item(); - }); + localShells = Utils::transform(Utils::filtered(shells, &FilePath::exists), + [&iconProvider](const FilePath &shell) { + return ShellItemBuilder(iconProvider, shell).item(); + }); } } @@ -161,14 +163,15 @@ QList<ShellModelItem> ShellModel::local() const QList<ShellModelItem> ShellModel::remote() const { - const auto deviceCmds = Utils::Terminal::Hooks::instance().getTerminalCommandsForDevicesHook()(); + QList<ShellModelItem> result; - const QList<ShellModelItem> deviceItems = Utils::transform( - deviceCmds, [](const Utils::Terminal::NameAndCommandLine &item) -> ShellModelItem { - return ShellModelItem{item.name, {item.commandLine}}; + ProjectExplorer::DeviceManager::instance()->forEachDevice( + [&result](const QSharedPointer<const ProjectExplorer::IDevice> &device) { + if (device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) + result << ShellModelItem{device->displayName(), {{device->rootPath(), {}}}}; }); - return deviceItems; + return result; } } // namespace Terminal::Internal diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 4b06c353433..326ed523915 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -16,6 +16,7 @@ #include <coreplugin/messagemanager.h> #include <utils/algorithm.h> +#include <utils/async.h> #include <utils/environment.h> #include <utils/fileutils.h> #include <utils/hostosinfo.h> @@ -82,6 +83,33 @@ void TerminalWidget::setupPty() CommandLine shellCommand = m_openParameters.shellCommand.value_or( CommandLine{settings().shell(), settings().shellArguments(), CommandLine::Raw}); + if (shellCommand.executable().isRootPath()) { + writeToTerminal(Tr::tr("Connecting ...\r\n").toUtf8(), true); + // We still have to find the shell to start ... + m_findShellWatcher.reset(new QFutureWatcher<FilePath>()); + connect(m_findShellWatcher.get(), &QFutureWatcher<FilePath>::finished, this, [this] { + const FilePath result = m_findShellWatcher->result(); + if (!result.isEmpty()) { + m_openParameters.shellCommand->setExecutable(m_findShellWatcher->result()); + restart(m_openParameters); + return; + } + + writeToTerminal( + ("\r\n\033[31m" + Tr::tr("Could not find shell to start.") + "\r\n").toUtf8(), true); + }); + + m_findShellWatcher->setFuture(Utils::asyncRun([shellCommand] { + const FilePath result = Utils::Terminal::defaultShellForDevice( + shellCommand.executable()); + if (result.isExecutableFile()) + return result; + return FilePath{}; + })); + + return; + } + Environment env = m_openParameters.environment.value_or(Environment{}) .appliedToEnvironment(shellCommand.executable().deviceEnvironment()); diff --git a/src/plugins/terminal/terminalwidget.h b/src/plugins/terminal/terminalwidget.h index dd20b3dfc0a..b696d8af1c0 100644 --- a/src/plugins/terminal/terminalwidget.h +++ b/src/plugins/terminal/terminalwidget.h @@ -16,6 +16,10 @@ #include <utils/process.h> #include <utils/terminalhooks.h> +#include <QFutureWatcher> + +#include <memory> + namespace Terminal { using RegisteredAction = std::unique_ptr<QAction, std::function<void(QAction *)>>; @@ -105,6 +109,8 @@ private: RegisteredAction m_close; Internal::ShortcutMap m_shortcutMap; + + std::unique_ptr<QFutureWatcher<Utils::FilePath>> m_findShellWatcher; }; } // namespace Terminal From e34762c84436c9b8b3d35f119a893dcd6cb4f4db Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 6 Jul 2023 14:11:36 +0200 Subject: [PATCH 0759/1777] Add CompilerExplorer plugin Change-Id: I534dea195a0b74f177fc227483752777485be177 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/dropsupport.cpp | 7 +- src/plugins/CMakeLists.txt | 1 + src/plugins/compilerexplorer/CMakeLists.txt | 30 ++ .../compilerexplorer/CompilerExplorer.json.in | 19 + src/plugins/compilerexplorer/api/compile.cpp | 29 ++ src/plugins/compilerexplorer/api/compile.h | 341 +++++++++++++++ src/plugins/compilerexplorer/api/compiler.cpp | 65 +++ src/plugins/compilerexplorer/api/compiler.h | 34 ++ .../api/compilerexplorerapi.h | 9 + src/plugins/compilerexplorer/api/config.h | 30 ++ src/plugins/compilerexplorer/api/language.cpp | 43 ++ src/plugins/compilerexplorer/api/language.h | 27 ++ src/plugins/compilerexplorer/api/library.cpp | 48 +++ src/plugins/compilerexplorer/api/library.h | 32 ++ src/plugins/compilerexplorer/api/request.h | 139 +++++++ .../compilerexplorer/compilerexplorer.qbs | 37 ++ .../compilerexploreraspects.cpp | 262 ++++++++++++ .../compilerexploreraspects.h | 70 ++++ .../compilerexplorerconstants.h | 9 + .../compilerexplorereditor.cpp | 391 ++++++++++++++++++ .../compilerexplorer/compilerexplorereditor.h | 95 +++++ .../compilerexploreroptions.cpp | 34 ++ .../compilerexploreroptions.h | 18 + .../compilerexplorerplugin.cpp | 56 +++ .../compilerexplorer/compilerexplorerplugin.h | 24 ++ .../compilerexplorersettings.cpp | 252 +++++++++++ .../compilerexplorersettings.h | 70 ++++ .../compilerexplorer/compilerexplorertr.h | 15 + src/plugins/compilerexplorer/logos/logos.qrc | 3 + src/plugins/compilerexplorer/test.rest | 50 +++ .../coreplugin/editormanager/editorview.cpp | 4 +- src/plugins/coreplugin/mainwindow.cpp | 4 +- src/shared/qbs | 2 +- 33 files changed, 2242 insertions(+), 8 deletions(-) create mode 100644 src/plugins/compilerexplorer/CMakeLists.txt create mode 100644 src/plugins/compilerexplorer/CompilerExplorer.json.in create mode 100644 src/plugins/compilerexplorer/api/compile.cpp create mode 100644 src/plugins/compilerexplorer/api/compile.h create mode 100644 src/plugins/compilerexplorer/api/compiler.cpp create mode 100644 src/plugins/compilerexplorer/api/compiler.h create mode 100644 src/plugins/compilerexplorer/api/compilerexplorerapi.h create mode 100644 src/plugins/compilerexplorer/api/config.h create mode 100644 src/plugins/compilerexplorer/api/language.cpp create mode 100644 src/plugins/compilerexplorer/api/language.h create mode 100644 src/plugins/compilerexplorer/api/library.cpp create mode 100644 src/plugins/compilerexplorer/api/library.h create mode 100644 src/plugins/compilerexplorer/api/request.h create mode 100644 src/plugins/compilerexplorer/compilerexplorer.qbs create mode 100644 src/plugins/compilerexplorer/compilerexploreraspects.cpp create mode 100644 src/plugins/compilerexplorer/compilerexploreraspects.h create mode 100644 src/plugins/compilerexplorer/compilerexplorerconstants.h create mode 100644 src/plugins/compilerexplorer/compilerexplorereditor.cpp create mode 100644 src/plugins/compilerexplorer/compilerexplorereditor.h create mode 100644 src/plugins/compilerexplorer/compilerexploreroptions.cpp create mode 100644 src/plugins/compilerexplorer/compilerexploreroptions.h create mode 100644 src/plugins/compilerexplorer/compilerexplorerplugin.cpp create mode 100644 src/plugins/compilerexplorer/compilerexplorerplugin.h create mode 100644 src/plugins/compilerexplorer/compilerexplorersettings.cpp create mode 100644 src/plugins/compilerexplorer/compilerexplorersettings.h create mode 100644 src/plugins/compilerexplorer/compilerexplorertr.h create mode 100644 src/plugins/compilerexplorer/logos/logos.qrc create mode 100644 src/plugins/compilerexplorer/test.rest diff --git a/src/libs/utils/dropsupport.cpp b/src/libs/utils/dropsupport.cpp index 7416edf9c37..95d3678719f 100644 --- a/src/libs/utils/dropsupport.cpp +++ b/src/libs/utils/dropsupport.cpp @@ -86,10 +86,11 @@ bool DropSupport::eventFilter(QObject *obj, QEvent *event) auto dee = static_cast<QDragEnterEvent *>(event); if ((isFileDrop(dee) || isValueDrop(dee)) && (!m_filterFunction || m_filterFunction(dee, this))) { event->accept(); - } else { - event->ignore(); + return true; } - return true; + // event->ignore(); + return false; + } else if (event->type() == QEvent::DragMove) { event->accept(); return true; diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 4fd8b655730..0be2b224cb6 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -112,3 +112,4 @@ add_subdirectory(mcusupport) add_subdirectory(saferenderer) add_subdirectory(copilot) add_subdirectory(terminal) +add_subdirectory(compilerexplorer) diff --git a/src/plugins/compilerexplorer/CMakeLists.txt b/src/plugins/compilerexplorer/CMakeLists.txt new file mode 100644 index 00000000000..1c5608234b5 --- /dev/null +++ b/src/plugins/compilerexplorer/CMakeLists.txt @@ -0,0 +1,30 @@ +add_qtc_plugin(CompilerExplorer + PLUGIN_DEPENDS Core TextEditor + DEPENDS Qt::Network TerminalLib Spinner + SOURCES + api/config.h + api/compile.cpp + api/compile.h + api/compiler.cpp + api/compiler.h + api/compilerexplorerapi.h + api/language.cpp + api/language.h + api/library.cpp + api/library.h + api/request.h + + compilerexploreraspects.cpp + compilerexploreraspects.h + compilerexplorerplugin.cpp + compilerexplorerplugin.h + compilerexplorertr.h + compilerexplorereditor.cpp + compilerexplorereditor.h + compilerexplorersettings.cpp + compilerexplorersettings.h + compilerexploreroptions.cpp + compilerexploreroptions.h + + logos/logos.qrc +) diff --git a/src/plugins/compilerexplorer/CompilerExplorer.json.in b/src/plugins/compilerexplorer/CompilerExplorer.json.in new file mode 100644 index 00000000000..f8363936bd0 --- /dev/null +++ b/src/plugins/compilerexplorer/CompilerExplorer.json.in @@ -0,0 +1,19 @@ +{ + "Name" : "CompilerExplorer", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "DisabledByDefault" : true, + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." + ], + "Description" : "Integrates https://godbolt.org into Qt Creator.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} +} diff --git a/src/plugins/compilerexplorer/api/compile.cpp b/src/plugins/compilerexplorer/api/compile.cpp new file mode 100644 index 00000000000..8a159dcf369 --- /dev/null +++ b/src/plugins/compilerexplorer/api/compile.cpp @@ -0,0 +1,29 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "compile.h" + +#include "request.h" + +namespace CompilerExplorer::Api { +QFuture<CompileResult> compile(const Config &config, const CompileParameters ¶meters) +{ + const QUrl url = config.url({"api/compiler", parameters.compilerId, "compile"}); + + QNetworkRequest req(url); + req.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + req.setRawHeader("Accept", "application/json"); + + return jsonRequest<CompileResult>( + config.networkManager, + req, + [](const QJsonDocument &response) { + CompileResult result; + + QJsonObject obj = response.object(); + return CompileResult::fromJson(obj); + }, + QNetworkAccessManager::PostOperation, + parameters.toByteArray()); +} +} // namespace CompilerExplorer::Api diff --git a/src/plugins/compilerexplorer/api/compile.h b/src/plugins/compilerexplorer/api/compile.h new file mode 100644 index 00000000000..fe07f22995f --- /dev/null +++ b/src/plugins/compilerexplorer/api/compile.h @@ -0,0 +1,341 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "compiler.h" +#include "compilerexploreraspects.h" +#include "config.h" + +#include <QList> +#include <QString> + +#include <QFuture> +#include <QJsonArray> +#include <QJsonDocument> +#include <QJsonObject> +#include <QNetworkAccessManager> + +namespace CompilerExplorer::Api { + +struct ExecuteParameters +{ + ExecuteParameters &args(QStringList args) + { + obj["args"] = QJsonArray::fromStringList(args); + return *this; + } + ExecuteParameters &stdIn(const QString &stdIn) + { + obj["stdin"] = stdIn; + return *this; + } + QJsonObject obj; +}; + +struct CompileParameters +{ + CompileParameters() = delete; + CompileParameters(const QString &cId) + : compilerId(cId) + { + obj["compiler"] = cId; + } + CompileParameters(const Compiler &compiler) + : compilerId(compiler.id) + { + obj["compiler"] = compiler.id; + } + + QByteArray toByteArray() const { return QJsonDocument(obj).toJson(QJsonDocument::Compact); } + + struct Options + { + Options &userArguments(const QString &userArguments) + { + obj["userArguments"] = userArguments; + return *this; + } + + struct CompilerOptions + { + bool skipAsm{false}; + bool executorRequest{false}; + }; + + Options &compilerOptions(CompilerOptions compilerOptions) + { + QJsonObject co; + co["skipAsm"] = compilerOptions.skipAsm; + co["executorRequest"] = compilerOptions.executorRequest; + + obj["compilerOptions"] = co; + return *this; + } + + Options &executeParameters(ExecuteParameters executeParameters) + { + obj["executeParameters"] = executeParameters.obj; + return *this; + } + + struct Filters + { + bool binary{false}; + bool binaryObject{false}; + bool commentOnly{true}; + bool demangle{true}; + bool directives{true}; + bool execute{false}; + bool intel{true}; + bool labels{true}; + bool libraryCode{false}; + bool trim{false}; + bool debugCalls{false}; + }; + + Options &filters(Filters filters) + { + QJsonObject filter; + filter["binary"] = filters.binary; + filter["binaryObject"] = filters.binaryObject; + filter["commentOnly"] = filters.commentOnly; + filter["demangle"] = filters.demangle; + filter["directives"] = filters.directives; + filter["execute"] = filters.execute; + filter["intel"] = filters.intel; + filter["labels"] = filters.labels; + filter["libraryCode"] = filters.libraryCode; + filter["trim"] = filters.trim; + filter["debugCalls"] = filters.debugCalls; + + obj["filters"] = filter; + return *this; + } + + struct Libraries + { + QJsonArray array; + Libraries &add(const QString id, const QString version) + { + QJsonObject obj; + obj["id"] = id; + obj["version"] = version; + array.append(obj); + return *this; + } + }; + + Options &libraries(const Libraries &libraries) + { + obj["libraries"] = libraries.array; + return *this; + } + + Options &libraries(const CompilerExplorer::LibrarySelectionAspect &aspect) + { + Libraries result; + for (const auto &key : aspect.value().keys()) { + result.add(key, aspect.value()[key]); + } + obj["libraries"] = result.array; + return *this; + } + + QJsonObject obj; + }; + + CompileParameters &source(const QString &source) + { + obj["source"] = source; + return *this; + } + CompileParameters &language(const QString &languageId) + { + obj["lang"] = languageId; + return *this; + } + CompileParameters &options(Options options) + { + obj["options"] = options.obj; + return *this; + } + + QJsonObject obj; + QString compilerId; +}; + +struct CompilerResult +{ + struct Line + { + QString text; + struct Tag + { + int column; + QString file; + int line; + int severity; + QString text; + static Tag fromJson(const QJsonObject &obj) + { + Tag tag; + tag.column = obj["column"].toInt(); + tag.file = obj["file"].toString(); + tag.line = obj["line"].toInt(); + tag.severity = obj["severity"].toInt(); + tag.text = obj["text"].toString(); + return tag; + } + }; + std::optional<Tag> tag; + + static Line fromJson(const QJsonObject &obj) + { + Line line; + line.text = obj["text"].toString(); + if (obj.contains("tag")) { + line.tag = Tag::fromJson(obj["tag"].toObject()); + } + return line; + } + }; + + int code; + bool timedOut; + bool truncated; + QList<Line> stdErr; + QList<Line> stdOut; + + static CompilerResult fromJson(const QJsonObject &object) + { + CompilerResult result; + + result.timedOut = object["timedOut"].toBool(); + result.truncated = object["truncated"].toBool(); + result.code = object["code"].toInt(); + for (const auto &line : object["stderr"].toArray()) + result.stdErr.append(Line::fromJson(line.toObject())); + for (const auto &line : object["stdout"].toArray()) + result.stdOut.append(Line::fromJson(line.toObject())); + + return result; + } +}; + +struct CompileResult : CompilerResult +{ + struct Asm + { + // A part of the asm that is a (hyper)link to a label (the name references labelDefinitions) + struct Label + { + QString name; + struct Range + { + int startCol; + int endCol; + } range; + + static Label fromJson(const QJsonObject &object) + { + Label label; + label.name = object["name"].toString(); + label.range.startCol = object["range"]["startCol"].toInt(); + label.range.endCol = object["range"]["endCol"].toInt(); + return label; + } + }; + QList<Label> labels; + // The part of the source that generated this asm + struct + { + int column; + QString file; + int line; + } source; + + QString text; + QStringList opcodes; + + static Asm fromJson(const QJsonObject &object) + { + Asm asm_; + asm_.text = object["text"].toString(); + auto opcodes = object["opcodes"].toArray(); + for (const auto &opcode : opcodes) + asm_.opcodes.append(opcode.toString()); + asm_.source.column = object["source"]["column"].toInt(); + asm_.source.file = object["source"]["file"].toString(); + asm_.source.line = object["source"]["line"].toInt(); + for (const auto &label : object["labels"].toArray()) { + asm_.labels.append(Label::fromJson(label.toObject())); + } + return asm_; + } + }; + + struct ExecResult + { + int code; + bool didExecute; + bool timedOut; + bool truncated; + QStringList stdOutLines; + QStringList stdErrLines; + + CompilerResult buildResult; + + static ExecResult fromJson(const QJsonObject &object) + { + ExecResult result; + result.code = object["code"].toInt(); + result.didExecute = object["didExecute"].toBool(); + result.timedOut = object["timedOut"].toBool(); + result.truncated = object["truncated"].toBool(); + for (const auto &line : object["stdout"].toArray()) + result.stdOutLines.append(line.toObject()["text"].toString()); + for (const auto &line : object["stderr"].toArray()) + result.stdErrLines.append(line.toObject()["text"].toString()); + result.buildResult = CompilerResult::fromJson(object["buildResult"].toObject()); + return result; + } + }; + + QMap<QString, int> labelDefinitions; + QList<Asm> assemblyLines; + + std::optional<ExecResult> execResult; + + static CompileResult fromJson(const QJsonObject &object) + { + CompilerResult compilerResult = CompilerResult::fromJson(object); + + CompileResult result; + result.code = compilerResult.code; + result.timedOut = compilerResult.timedOut; + result.truncated = compilerResult.truncated; + result.stdOut = compilerResult.stdOut; + result.stdErr = compilerResult.stdErr; + + if (object.contains("labelDefinitions")) { + QJsonObject labelDefinitions = object["labelDefinitions"].toObject(); + for (const QString &key : labelDefinitions.keys()) + result.labelDefinitions[key] = labelDefinitions[key].toInt(); + } + + if (object.contains("asm")) { + for (const auto &asmLine : object["asm"].toArray()) + result.assemblyLines.append(Asm::fromJson(asmLine.toObject())); + } + + if (object.contains("execResult")) + result.execResult = ExecResult::fromJson(object["execResult"].toObject()); + + return result; + } +}; + +QFuture<CompileResult> compile(const Config &config, const CompileParameters ¶meters); + +} // namespace CompilerExplorer::Api diff --git a/src/plugins/compilerexplorer/api/compiler.cpp b/src/plugins/compilerexplorer/api/compiler.cpp new file mode 100644 index 00000000000..9bc7a57033d --- /dev/null +++ b/src/plugins/compilerexplorer/api/compiler.cpp @@ -0,0 +1,65 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "compiler.h" + +#include "request.h" + +#include <QFutureWatcher> +#include <QUrlQuery> + +namespace CompilerExplorer::Api { + +QFuture<Compilers> compilers(const Config &config, + const QString &languageId, + const QSet<QString> &extraFields) +{ + QUrl url = config.url(QStringList{"api/compilers"} + << (languageId.isEmpty() ? QString() : languageId)); + + QString fieldParam; + + if (!extraFields.isEmpty()) { + QSet<QString> fields = {"id", "name", "lang", "compilerType", "semver"}; + fields.unite(extraFields); + for (const auto &field : fields) { + if (!fieldParam.isEmpty()) + fieldParam += ","; + fieldParam += field; + } + } + + if (!fieldParam.isEmpty()) + url.setQuery(QUrlQuery{{"fields", fieldParam}}); + + QNetworkRequest req(url); + req.setRawHeader("Accept", "application/json"); + + auto fromJson = [extraFields](const QJsonDocument &doc) { + QJsonArray compilers = doc.array(); + Compilers result; + + for (const auto &compiler : compilers) { + QJsonObject obj = compiler.toObject(); + Compiler c; + c.id = obj["id"].toString(); + c.name = obj["name"].toString(); + c.languageId = obj["lang"].toString(); + c.compilerType = obj["compilerType"].toString(); + c.version = obj["semver"].toString(); + c.instructionSet = obj["instructionSet"].toString(); + + for (const auto &field : extraFields) { + c.extraFields[field] = obj[field].toString(); + } + + result.append(c); + } + + return result; + }; + + return jsonRequest<Compilers>(config.networkManager, req, fromJson); +} + +} // namespace CompilerExplorer::Api diff --git a/src/plugins/compilerexplorer/api/compiler.h b/src/plugins/compilerexplorer/api/compiler.h new file mode 100644 index 00000000000..070817206e2 --- /dev/null +++ b/src/plugins/compilerexplorer/api/compiler.h @@ -0,0 +1,34 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "config.h" + +#include <QFuture> +#include <QList> +#include <QMap> +#include <QNetworkAccessManager> +#include <QSet> +#include <QString> + +namespace CompilerExplorer::Api { + +struct Compiler +{ + QString id; + QString name; + QString languageId; + QString compilerType; + QString version; + QString instructionSet; + QMap<QString, QString> extraFields; +}; + +using Compilers = QList<Compiler>; + +QFuture<Compilers> compilers(const Config &config, + const QString &languageId = {}, + const QSet<QString> &extraFields = {}); + +} // namespace CompilerExplorer::Api diff --git a/src/plugins/compilerexplorer/api/compilerexplorerapi.h b/src/plugins/compilerexplorer/api/compilerexplorerapi.h new file mode 100644 index 00000000000..abba7313074 --- /dev/null +++ b/src/plugins/compilerexplorer/api/compilerexplorerapi.h @@ -0,0 +1,9 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "compile.h" +#include "compiler.h" +#include "language.h" +#include "library.h" diff --git a/src/plugins/compilerexplorer/api/config.h b/src/plugins/compilerexplorer/api/config.h new file mode 100644 index 00000000000..c574c8e0e95 --- /dev/null +++ b/src/plugins/compilerexplorer/api/config.h @@ -0,0 +1,30 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <QNetworkAccessManager> +#include <QUrl> + +namespace CompilerExplorer::Api { + +struct Config +{ + Config(QNetworkAccessManager *networkManager) + : networkManager(networkManager) + {} + Config(QNetworkAccessManager *networkManager, const QUrl &baseUrl) + : networkManager(networkManager) + , baseUrl(baseUrl){}; + + Config(QNetworkAccessManager *networkManager, const QString &baseUrl) + : networkManager(networkManager) + , baseUrl(QUrl::fromUserInput(baseUrl)){}; + + QNetworkAccessManager *networkManager; + QUrl baseUrl{"https://godbolt.org/"}; + + QUrl url(const QStringList &paths) const { return baseUrl.resolved(paths.join("/")); } +}; + +} // namespace CompilerExplorer::Api diff --git a/src/plugins/compilerexplorer/api/language.cpp b/src/plugins/compilerexplorer/api/language.cpp new file mode 100644 index 00000000000..0b95c7d2be6 --- /dev/null +++ b/src/plugins/compilerexplorer/api/language.cpp @@ -0,0 +1,43 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "language.h" + +#include "request.h" + +#include <QUrlQuery> + +namespace CompilerExplorer::Api { + +QFuture<Languages> languages(const Config &config) +{ + QUrl url = config.url({"api/languages"}); + url.setQuery(QUrlQuery{{"fields", "id,name,extensions,logoUrl"}}); + QNetworkRequest req(url); + req.setRawHeader("Accept", "application/json"); + + return jsonRequest<Languages>(config.networkManager, req, [](const QJsonDocument &doc) { + QJsonArray languages = doc.array(); + Languages result; + for (const auto &language : languages) { + QJsonObject obj = language.toObject(); + Language l; + l.id = obj["id"].toString(); + l.name = obj["name"].toString(); + l.logoUrl = obj["logoUrl"].toString(); + QJsonArray extensions = obj["extensions"].toArray(); + for (const auto &extension : extensions) { + l.extensions.append(extension.toString()); + } + + result.append(l); + } + std::sort(result.begin(), result.end(), [](const Language &a, const Language &b) { + return a.name < b.name; + }); + + return result; + }); +} + +} // namespace CompilerExplorer::Api diff --git a/src/plugins/compilerexplorer/api/language.h b/src/plugins/compilerexplorer/api/language.h new file mode 100644 index 00000000000..85780b7466a --- /dev/null +++ b/src/plugins/compilerexplorer/api/language.h @@ -0,0 +1,27 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "config.h" + +#include <QFuture> +#include <QNetworkAccessManager> +#include <QString> +#include <QStringList> + +namespace CompilerExplorer::Api { + +struct Language +{ + QString id; + QString name; + QString logoUrl; + QStringList extensions; + QString monaco; +}; + +using Languages = QList<Language>; +QFuture<Languages> languages(const Config &config); + +} // namespace CompilerExplorer::Api diff --git a/src/plugins/compilerexplorer/api/library.cpp b/src/plugins/compilerexplorer/api/library.cpp new file mode 100644 index 00000000000..8015beced73 --- /dev/null +++ b/src/plugins/compilerexplorer/api/library.cpp @@ -0,0 +1,48 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "library.h" + +#include "request.h" + +#include <utils/qtcassert.h> + +namespace CompilerExplorer::Api { + +QFuture<Libraries> libraries(const Config &config, const QString &languageId) +{ + QTC_ASSERT(!languageId.isEmpty(), + return QtFuture::makeExceptionalFuture<Libraries>( + std::make_exception_ptr(std::runtime_error("Language ID is empty.")))); + + const QUrl url = config.url({"api/libraries", languageId}); + + QNetworkRequest req(url); + req.setRawHeader("Accept", "application/json"); + + return jsonRequest<Libraries>(config.networkManager, req, [](const QJsonDocument &doc) { + QJsonArray libraries = doc.array(); + Libraries result; + + for (const auto &library : libraries) { + QJsonObject obj = library.toObject(); + Library l; + l.id = obj["id"].toString(); + l.name = obj["name"].toString(); + l.url = QUrl::fromUserInput(obj["url"].toString()); + + QJsonArray versions = obj["versions"].toArray(); + for (const auto &version : versions) { + l.versions.append({ + version.toObject()["version"].toString(), + version.toObject()["id"].toString(), + }); + } + + result.append(l); + } + + return result; + }); +} +} // namespace CompilerExplorer::Api diff --git a/src/plugins/compilerexplorer/api/library.h b/src/plugins/compilerexplorer/api/library.h new file mode 100644 index 00000000000..07e8a117341 --- /dev/null +++ b/src/plugins/compilerexplorer/api/library.h @@ -0,0 +1,32 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "config.h" + +#include <QFuture> +#include <QList> +#include <QNetworkAccessManager> +#include <QString> +#include <QUrl> + +namespace CompilerExplorer::Api { +struct Library +{ + QString id; + QString name; + QUrl url; + + struct Version + { + QString version; + QString id; + }; + QList<Version> versions; +}; + +using Libraries = QList<Library>; + +QFuture<Libraries> libraries(const Config &config, const QString &languageId); +} // namespace CompilerExplorer::Api diff --git a/src/plugins/compilerexplorer/api/request.h b/src/plugins/compilerexplorer/api/request.h new file mode 100644 index 00000000000..81b892c42dd --- /dev/null +++ b/src/plugins/compilerexplorer/api/request.h @@ -0,0 +1,139 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <QFuture> +#include <QJsonArray> +#include <QJsonDocument> +#include <QJsonObject> +#include <QLoggingCategory> +#include <QNetworkAccessManager> +#include <QNetworkReply> +#include <QString> + +static Q_LOGGING_CATEGORY(apiLog, "qtc.compilerexplorer.api", QtWarningMsg); + +namespace CompilerExplorer::Api { + +static inline QString toString(QNetworkAccessManager::Operation op) +{ + switch (op) { + case QNetworkAccessManager::GetOperation: + return QStringLiteral("GET"); + case QNetworkAccessManager::PostOperation: + return QStringLiteral("POST"); + case QNetworkAccessManager::PutOperation: + return QStringLiteral("PUT"); + case QNetworkAccessManager::DeleteOperation: + return QStringLiteral("DELETE"); + case QNetworkAccessManager::HeadOperation: + return QStringLiteral("HEAD"); + case QNetworkAccessManager::CustomOperation: + return QStringLiteral("CUSTOM"); + case QNetworkAccessManager::UnknownOperation: + break; + } + + return "<unknown>"; +} + +static int debugRequestId = 0; + +template<typename Result> +QFuture<Result> request( + QNetworkAccessManager *networkManager, + const QNetworkRequest &req, + std::function<void(const QByteArray &, QSharedPointer<QPromise<Result>>)> callback, + QNetworkAccessManager::Operation op = QNetworkAccessManager::GetOperation, + const QByteArray &outData = {}) +{ + QSharedPointer<QPromise<Result>> p(new QPromise<Result>); + p->start(); + + // For logging purposes only + debugRequestId += 1; + + const auto reqId = [r = debugRequestId] { return QString("[%1]").arg(r); }; + + if (outData.isEmpty()) + qCDebug(apiLog).noquote() << reqId() << "Requesting" << toString(op) + << req.url().toString(); + else + qCDebug(apiLog).noquote() << reqId() << "Requesting" << toString(op) << req.url().toString() + << "with payload:" << QString::fromUtf8(outData); + + QNetworkReply *reply = nullptr; + + switch (op) { + case QNetworkAccessManager::GetOperation: + reply = networkManager->get(req); + break; + case QNetworkAccessManager::PostOperation: + reply = networkManager->post(req, outData); + break; + case QNetworkAccessManager::PutOperation: + reply = networkManager->put(req, outData); + break; + case QNetworkAccessManager::DeleteOperation: + reply = networkManager->deleteResource(req); + break; + default: + return QtFuture::makeExceptionalFuture<Result>( + std::make_exception_ptr(std::runtime_error("Unsupported operation"))); + } + + QObject::connect(reply, &QNetworkReply::finished, [p, reply, callback, reqId] { + if (reply->error() != QNetworkReply::NoError) { + qCWarning(apiLog).noquote() + << reqId() << "Request failed:" << reply->error() << reply->errorString(); + + QString errorMessage; + if (reply->error() == QNetworkReply::ContentNotFoundError) { + errorMessage = QObject::tr("Not found"); + } else + errorMessage = reply->errorString(); + + p->setException(std::make_exception_ptr(std::runtime_error(errorMessage.toUtf8()))); + reply->deleteLater(); + p->finish(); + return; + } + QByteArray data = reply->readAll(); + qCDebug(apiLog).noquote() << reqId() << "Request finished:" << data; + + callback(data, p); + + reply->deleteLater(); + p->finish(); + }); + + return p->future(); +} + +template<typename Result> +QFuture<Result> jsonRequest(QNetworkAccessManager *networkManager, + const QNetworkRequest &req, + std::function<Result(QJsonDocument)> callback, + QNetworkAccessManager::Operation op + = QNetworkAccessManager::GetOperation, + const QByteArray &outData = {}) +{ + return request<Result>( + networkManager, + req, + [callback](const QByteArray &reply, auto promise) { + QJsonParseError error; + QJsonDocument doc = QJsonDocument::fromJson(reply, &error); + if (error.error != QJsonParseError::NoError) { + promise->setException( + std::make_exception_ptr(std::runtime_error(error.errorString().toUtf8()))); + return; + } + promise->addResult(callback(doc)); + }, + op, + outData); +} + +} // namespace CompilerExplorer::Api diff --git a/src/plugins/compilerexplorer/compilerexplorer.qbs b/src/plugins/compilerexplorer/compilerexplorer.qbs new file mode 100644 index 00000000000..756bb57d7e8 --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexplorer.qbs @@ -0,0 +1,37 @@ +import qbs 1.0 + +QtcPlugin { + name: "CompilerExplorer" + + Depends { name: "Core" } + Depends { name: "Qt"; submodules: ["widgets", "network"] } + + files: [ + "api/compile.cpp", + "api/compile.h", + "api/compiler.cpp", + "api/compiler.h", + "api/compilerexplorerapi.h", + "api/config.h", + "api/language.cpp", + "api/language.h", + "api/library.cpp", + "api/library.h", + "api/request.h", + + "compilerexploreraspects.cpp", + "compilerexploreraspects.h", + "compilerexplorerconstants.h", + "compilerexplorereditor.cpp", + "compilerexplorereditor.h", + "compilerexploreroptions.cpp", + "compilerexploreroptions.h", + "compilerexplorerplugin.cpp", + "compilerexplorerplugin.h", + "compilerexplorersettings.cpp", + "compilerexplorersettings.h", + "compilerexplorertr.h", + + "logos/logos.qrc" + ] +} diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.cpp b/src/plugins/compilerexplorer/compilerexploreraspects.cpp new file mode 100644 index 00000000000..71b4d45cb43 --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexploreraspects.cpp @@ -0,0 +1,262 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "compilerexploreraspects.h" +#include "compilerexplorertr.h" + +#include "api/library.h" + +#include <utils/layoutbuilder.h> + +#include <QComboBox> +#include <QCompleter> +#include <QFutureWatcher> +#include <QPushButton> +#include <QStackedLayout> + +using namespace Utils; + +namespace CompilerExplorer { + +StringSelectionAspect::StringSelectionAspect(AspectContainer *container) + : TypedAspect<QString>(container) +{} + +void StringSelectionAspect::bufferToGui() +{ + if (!m_model) + return; + + for (int i = 0; i < m_model->rowCount(); ++i) { + auto cur = m_model->item(i); + if (cur->data() == m_buffer) { + m_selectionModel->setCurrentIndex(cur->index(), + QItemSelectionModel::SelectionFlag::ClearAndSelect); + return; + } + } + if (m_model->rowCount() > 0) + m_selectionModel->setCurrentIndex(m_model->item(0)->index(), + QItemSelectionModel::SelectionFlag::ClearAndSelect); + else + m_selectionModel->setCurrentIndex(QModelIndex(), QItemSelectionModel::SelectionFlag::Clear); + + handleGuiChanged(); +} + +bool StringSelectionAspect::guiToBuffer() +{ + if (!m_model) + return false; + + auto oldBuffer = m_buffer; + + QModelIndex index = m_selectionModel->currentIndex(); + if (index.isValid()) + m_buffer = index.data(Qt::UserRole + 1).toString(); + else + m_buffer.clear(); + + return oldBuffer != m_buffer; +} + +void StringSelectionAspect::addToLayout(Layouting::LayoutItem &parent) +{ + QTC_ASSERT(m_fillCallback, return); + + auto cb = [this](const QList<QStandardItem *> &items) { + m_model->clear(); + for (QStandardItem *item : items) + m_model->appendRow(item); + + bufferToGui(); + }; + + if (!m_model) { + m_model = new QStandardItemModel(this); + m_selectionModel = new QItemSelectionModel(m_model); + + connect(this, &StringSelectionAspect::refillRequested, this, [this, cb] { + m_fillCallback(cb); + }); + + m_fillCallback(cb); + } + + QComboBox *comboBox = new QComboBox(); + comboBox->setInsertPolicy(QComboBox::InsertPolicy::NoInsert); + comboBox->setEditable(true); + comboBox->completer()->setCompletionMode(QCompleter::PopupCompletion); + comboBox->completer()->setFilterMode(Qt::MatchContains); + + comboBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon); + comboBox->setCurrentText(value()); + comboBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); + + comboBox->setModel(m_model); + + connect(m_selectionModel, + &QItemSelectionModel::currentChanged, + comboBox, + [comboBox](QModelIndex currentIdx) { + if (currentIdx.isValid() && comboBox->currentIndex() != currentIdx.row()) + comboBox->setCurrentIndex(currentIdx.row()); + }); + + connect(comboBox, &QComboBox::activated, this, [this, comboBox] { + m_selectionModel->setCurrentIndex(m_model->index(comboBox->currentIndex(), 0), + QItemSelectionModel::SelectionFlag::ClearAndSelect); + handleGuiChanged(); + }); + + if (m_selectionModel->currentIndex().isValid()) + comboBox->setCurrentIndex(m_selectionModel->currentIndex().row()); + + return addLabeledItem(parent, comboBox); +} + +LibrarySelectionAspect::LibrarySelectionAspect(AspectContainer *container) + : TypedAspect<QMap<QString, QString>>(container) +{} + +void LibrarySelectionAspect::bufferToGui() +{ + if (!m_model) + return; + + for (int i = 0; i < m_model->rowCount(); i++) { + QModelIndex idx = m_model->index(i, 0); + if (m_buffer.contains(qvariant_cast<Api::Library>(idx.data(LibraryData)).id)) + m_model->setData(idx, + m_buffer[qvariant_cast<Api::Library>(idx.data(LibraryData)).id], + SelectedVersion); + else + m_model->setData(idx, QVariant(), SelectedVersion); + } + + handleGuiChanged(); +} + +bool LibrarySelectionAspect::guiToBuffer() +{ + if (!m_model) + return false; + + auto oldBuffer = m_buffer; + + m_buffer.clear(); + + for (int i = 0; i < m_model->rowCount(); i++) { + if (m_model->item(i)->data(SelectedVersion).isValid()) { + m_buffer.insert(qvariant_cast<Api::Library>(m_model->item(i)->data(LibraryData)).id, + m_model->item(i)->data(SelectedVersion).toString()); + } + } + return oldBuffer != m_buffer; +} + +void LibrarySelectionAspect::addToLayout(Layouting::LayoutItem &parent) +{ + using namespace Layouting; + + QTC_ASSERT(m_fillCallback, return); + + auto cb = [this](const QList<QStandardItem *> &items) { + for (QStandardItem *item : items) + m_model->appendRow(item); + + bufferToGui(); + }; + + if (!m_model) { + m_model = new QStandardItemModel(this); + + connect(this, &LibrarySelectionAspect::refillRequested, this, [this, cb] { + m_model->clear(); + m_fillCallback(cb); + }); + + m_fillCallback(cb); + } + + QComboBox *nameCombo = new QComboBox(); + nameCombo->setInsertPolicy(QComboBox::InsertPolicy::NoInsert); + nameCombo->setEditable(true); + nameCombo->completer()->setCompletionMode(QCompleter::PopupCompletion); + nameCombo->completer()->setFilterMode(Qt::MatchContains); + + nameCombo->setModel(m_model); + + QComboBox *versionCombo = new QComboBox(); + versionCombo->addItem("--"); + + auto refreshVersionCombo = [nameCombo, versionCombo] { + versionCombo->clear(); + versionCombo->addItem("--"); + QString selected = nameCombo->currentData(SelectedVersion).toString(); + Api::Library lib = qvariant_cast<Api::Library>(nameCombo->currentData(LibraryData)); + for (const auto &version : lib.versions) { + versionCombo->addItem(version.version, version.id); + if (version.id == selected) + versionCombo->setCurrentIndex(versionCombo->count() - 1); + } + }; + + refreshVersionCombo(); + + connect(nameCombo, &QComboBox::currentIndexChanged, this, refreshVersionCombo); + + connect(versionCombo, &QComboBox::activated, this, [this, nameCombo, versionCombo] { + m_model->setData(m_model->index(nameCombo->currentIndex(), 0), + versionCombo->currentData(), + SelectedVersion); + handleGuiChanged(); + }); + + QPushButton *clearBtn = new QPushButton("Clear All"); + connect(clearBtn, &QPushButton::clicked, clearBtn, [this, refreshVersionCombo] { + for (int i = 0; i < m_model->rowCount(); i++) + m_model->setData(m_model->index(i, 0), QVariant(), SelectedVersion); + handleGuiChanged(); + refreshVersionCombo(); + }); + + ElidingLabel *displayLabel = new ElidingLabel(); + + auto updateLabel = [displayLabel, this] { + QStringList libs; + for (int i = 0; i < m_model->rowCount(); i++) { + QModelIndex idx = m_model->index(i, 0); + if (idx.data(SelectedVersion).isValid()) + libs.append(QString("%1 %2") + .arg(idx.data().toString()) + .arg(idx.data(SelectedVersion).toString())); + } + if (libs.empty()) + displayLabel->setText(Tr::tr("No libraries selected")); + else + displayLabel->setText(libs.join(", ")); + }; + + connect(m_model, &QStandardItemModel::itemChanged, displayLabel, updateLabel); + + updateLabel(); + + QPushButton *editBtn = new QPushButton(Tr::tr("Edit")); + + QStackedLayout *stack{nullptr}; + + // clang-format off + auto s = Stack { + bindTo(&stack), + noMargin, + Row { noMargin, displayLabel, editBtn }.emerge(), + Row { noMargin, nameCombo, versionCombo, clearBtn }.emerge() + }.emerge(); + // clang-format on + connect(editBtn, &QPushButton::clicked, this, [stack] { stack->setCurrentIndex(1); }); + + addLabeledItem(parent, s); +} + +} // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.h b/src/plugins/compilerexplorer/compilerexploreraspects.h new file mode 100644 index 00000000000..dfd0a46b73e --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexploreraspects.h @@ -0,0 +1,70 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <utils/aspects.h> + +#include <QComboBox> +#include <QItemSelectionModel> +#include <QStandardItemModel> + +namespace CompilerExplorer { + +class StringSelectionAspect : public Utils::TypedAspect<QString> +{ + Q_OBJECT +public: + StringSelectionAspect(Utils::AspectContainer *container = nullptr); + + void addToLayout(Layouting::LayoutItem &parent) override; + + using ResultCallback = std::function<void(QList<QStandardItem *> items)>; + using FillCallback = std::function<void(ResultCallback)>; + void setFillCallback(FillCallback callback) { m_fillCallback = callback; } + + void refill() { emit refillRequested(); } + + void bufferToGui() override; + bool guiToBuffer() override; + +signals: + void refillRequested(); + +private: + FillCallback m_fillCallback; + QStandardItemModel *m_model{nullptr}; + QItemSelectionModel *m_selectionModel{nullptr}; +}; + +// QMap<Library.Id, Library.Version.Id> +class LibrarySelectionAspect : public Utils::TypedAspect<QMap<QString, QString>> +{ + Q_OBJECT +public: + enum Roles { + LibraryData = Qt::UserRole + 1, + SelectedVersion, + }; + + LibrarySelectionAspect(Utils::AspectContainer *container = nullptr); + + void addToLayout(Layouting::LayoutItem &parent) override; + + using ResultCallback = std::function<void(QList<QStandardItem *>)>; + using FillCallback = std::function<void(ResultCallback)>; + void setFillCallback(FillCallback callback) { m_fillCallback = callback; } + void refill() { emit refillRequested(); } + + void bufferToGui() override; + bool guiToBuffer() override; + +signals: + void refillRequested(); + +private: + FillCallback m_fillCallback; + QStandardItemModel *m_model{nullptr}; +}; + +} // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorerconstants.h b/src/plugins/compilerexplorer/compilerexplorerconstants.h new file mode 100644 index 00000000000..33a7d528df3 --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexplorerconstants.h @@ -0,0 +1,9 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +namespace CompilerExplorer::Constants { +const char CE_EDITOR_ID[] = "CompilerExplorer.Editor"; +const char CE_EDITOR_CONTEXT_ID[] = "CompilerExplorer.Editor.Context"; +} diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp new file mode 100644 index 00000000000..122a32c21e4 --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -0,0 +1,391 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "compilerexplorereditor.h" +#include "compilerexplorerconstants.h" +#include "compilerexploreroptions.h" +#include "compilerexplorersettings.h" +#include "compilerexplorertr.h" + +#include <aggregation/aggregate.h> + +#include <coreplugin/coreconstants.h> +#include <coreplugin/icontext.h> +#include <coreplugin/icore.h> + +#include <texteditor/textdocument.h> +#include <texteditor/texteditor.h> +#include <texteditor/texteditoractionhandler.h> +#include <texteditor/textmark.h> + +#include <projectexplorer/projectexplorerconstants.h> + +#include <utils/hostosinfo.h> +#include <utils/layoutbuilder.h> +#include <utils/mimeutils.h> +#include <utils/mimetypes2/mimetype.h> +#include <utils/utilsicons.h> + +#include <QCompleter> +#include <QDockWidget> +#include <QNetworkAccessManager> +#include <QPushButton> +#include <QSplitter> +#include <QStackedLayout> +#include <QStandardItemModel> +#include <QTemporaryFile> +#include <QTimer> +#include <QToolButton> + +#include <chrono> +#include <iostream> + +using namespace std::chrono_literals; +using namespace Aggregation; +using namespace TextEditor; + +namespace CompilerExplorer { + +class CodeEditorWidget : public TextEditorWidget +{ +public: + CodeEditorWidget(Settings *settings) + : m_settings(settings){}; + + void updateHighlighter() + { + const QString ext = m_settings->languageExtension(); + if (ext.isEmpty()) + return; + + Utils::MimeType mimeType = Utils::mimeTypeForFile("foo" + ext); + configureGenericHighlighter(mimeType); + } + +private: + Settings *m_settings; +}; + +CompilerWidget::CompilerWidget() + : m_compilerSettings(&settings()) +{ + using namespace Layouting; + QVariantMap map; + + m_compilerSettings.setAutoApply(true); + + m_delayTimer = new QTimer(this); + m_delayTimer->setSingleShot(true); + m_delayTimer->setInterval(500ms); + connect(m_delayTimer, &QTimer::timeout, this, &CompilerWidget::doCompile); + + for (const auto &aspect : m_compilerSettings.aspects()) + QTC_CHECK( + connect(aspect, &Utils::BaseAspect::changed, m_delayTimer, qOverload<>(&QTimer::start))); + + m_asmEditor = new TextEditorWidget; + m_asmDocument = QSharedPointer<TextDocument>(new TextDocument); + m_asmDocument->setFilePath("asm.asm"); + m_asmEditor->setTextDocument(m_asmDocument); + m_asmEditor->configureGenericHighlighter(Utils::mimeTypeForName("text/x-asm")); + + auto advButton = new QPushButton; + QSplitter *splitter{nullptr}; + + auto advDlg = new QAction; + advDlg->setIcon(Utils::Icons::SETTINGS_TOOLBAR.icon()); + advDlg->setIconText(Tr::tr("Advanced Options")); + connect(advDlg, &QAction::triggered, this, [advButton, this] { + CompilerExplorerOptions *dlg = new CompilerExplorerOptions(m_compilerSettings, advButton); + dlg->setAttribute(Qt::WA_DeleteOnClose); + dlg->setWindowFlag(Qt::WindowType::Popup); + dlg->show(); + QRect rect = dlg->geometry(); + rect.moveTopRight(advButton->mapToGlobal(QPoint(advButton->width(), advButton->height()))); + dlg->setGeometry(rect); + }); + + connect(advButton, &QPushButton::clicked, advDlg, &QAction::trigger); + advButton->setIcon(advDlg->icon()); + + // clang-format off + Column { + Row { + m_compilerSettings.compiler, + advButton, + }, + Splitter { + bindTo(&splitter), + m_asmEditor, + createTerminal() + } + }.attachTo(this); + // clang-format on + + m_spinner = new SpinnerSolution::Spinner(SpinnerSolution::SpinnerSize::Large, this); +} + +Core::SearchableTerminal *CompilerWidget::createTerminal() +{ + m_resultTerminal = new Core::SearchableTerminal(); + m_resultTerminal->setAllowBlinkingCursor(false); + std::array<QColor, 20> colors{Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi0), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi1), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi2), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi3), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi4), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi5), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi6), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi7), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi8), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi9), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi10), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi11), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi12), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi13), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi14), + Utils::creatorTheme()->color(Utils::Theme::TerminalAnsi15), + + Utils::creatorTheme()->color(Utils::Theme::TerminalForeground), + Utils::creatorTheme()->color(Utils::Theme::TerminalBackground), + Utils::creatorTheme()->color(Utils::Theme::TerminalSelection), + Utils::creatorTheme()->color(Utils::Theme::TerminalFindMatch)}; + + m_resultTerminal->setColors(colors); + + return m_resultTerminal; +} + +void CompilerWidget::compile(const QString &source) +{ + m_source = source; + m_delayTimer->start(); +} + +void CompilerWidget::doCompile() +{ + using namespace Api; + + QString compilerId = m_compilerSettings.compiler(); + if (compilerId.isEmpty()) + compilerId = "clang_trunk"; + + m_spinner->setVisible(true); + m_asmEditor->setEnabled(false); + + CompileParameters params = CompileParameters(compilerId) + .source(m_source) + .language(settings().languageId()) + .options(CompileParameters::Options() + .userArguments(m_compilerSettings.compilerOptions()) + .compilerOptions({false, false}) + .filters({false, + m_compilerSettings.compileToBinaryObject(), + true, + m_compilerSettings.demangleIdentifiers(), + true, + m_compilerSettings.executeCode(), + m_compilerSettings.intelAsmSyntax(), + true, + false, + false, + false}) + .libraries(m_compilerSettings.libraries)); + + auto f = Api::compile(settings().apiConfig(), params); + + m_compileWatcher.reset(new QFutureWatcher<CompileResult>); + + connect( + m_compileWatcher.get(), &QFutureWatcher<CompileResult>::finished, this, [this] { + m_spinner->setVisible(false); + m_asmEditor->setEnabled(true); + + try { + Api::CompileResult r = m_compileWatcher->result(); + + m_resultTerminal->restart(); + m_resultTerminal->writeToTerminal("\x1b[?25l", false); + + for (const auto &err : r.stdErr) + m_resultTerminal->writeToTerminal((err.text + "\r\n").toUtf8(), false); + for (const auto &out : r.stdOut) + m_resultTerminal->writeToTerminal((out.text + "\r\n").toUtf8(), false); + + m_resultTerminal->writeToTerminal( + QString("ASM generation compiler returned: %1\r\n\r\n").arg(r.code).toUtf8(), + true); + + if (r.execResult) { + for (const auto &err : r.execResult->buildResult.stdErr) + m_resultTerminal->writeToTerminal((err.text + "\r\n").toUtf8(), false); + for (const auto &out : r.execResult->buildResult.stdOut) + m_resultTerminal->writeToTerminal((out.text + "\r\n").toUtf8(), false); + + m_resultTerminal + ->writeToTerminal(QString("Execution build compiler returned: %1\r\n\r\n") + .arg(r.execResult->buildResult.code) + .toUtf8(), + true); + + if (r.execResult->didExecute) { + m_resultTerminal->writeToTerminal(QString("Program returned: %1\r\n") + .arg(r.execResult->code) + .toUtf8(), + true); + + for (const auto &err : r.execResult->stdErrLines) + m_resultTerminal + ->writeToTerminal((" \033[0;31m" + err + "\033[0m\r\n").toUtf8(), + false); + for (const auto &out : r.execResult->stdOutLines) + m_resultTerminal->writeToTerminal((" " + out + "\r\n").toUtf8(), false); + } + } + for (auto mark : m_marks) { + delete mark; + } + m_marks.clear(); + + QString asmText; + for (auto l : r.assemblyLines) + asmText += l.text + "\n"; + + m_asmDocument->setPlainText(asmText); + + int i = 0; + for (auto l : r.assemblyLines) { + i++; + if (l.opcodes.empty()) + continue; + + auto mark = new TextMark(m_asmDocument.get(), + i, + TextMarkCategory{"Bytes", "Bytes"}); + mark->setLineAnnotation(l.opcodes.join(' ')); + m_marks.append(mark); + } + } catch (const std::exception &e) { + qCritical() << "Exception: " << e.what(); + } + }); + + m_compileWatcher->setFuture(f); +} + +EditorWidget::EditorWidget(TextDocumentPtr document, QWidget *parent) + : Utils::FancyMainWindow(parent) +{ + setAutoHideTitleBars(false); + setDockNestingEnabled(true); + setDocumentMode(true); + setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::TabPosition::South); + + using namespace Layouting; + + m_codeEditor = new CodeEditorWidget(&settings()); + m_codeEditor->setTextDocument(document); + m_codeEditor->updateHighlighter(); + + auto addCompilerButton = new QPushButton; + addCompilerButton->setText(Tr::tr("Add compiler")); + connect(addCompilerButton, &QPushButton::clicked, this, &EditorWidget::addCompiler); + + // clang-format off + auto source = + Column { + Row { + settings().languageId, + settings().compilerExplorerUrl, + addCompilerButton, + }, + m_codeEditor, + }.emerge(); + // clang-format on + + source->setWindowTitle("Source code"); + source->setObjectName("source_code"); + addDockWidget(Qt::LeftDockWidgetArea, addDockForWidget(source)); + + addCompiler(); + + Aggregate *agg = Aggregate::parentAggregate(m_codeEditor); + if (!agg) { + agg = new Aggregate; + agg->add(m_codeEditor); + } + agg->add(this); + + m_context = new Core::IContext(this); + m_context->setWidget(this); + m_context->setContext(Core::Context(Constants::CE_EDITOR_CONTEXT_ID)); + Core::ICore::addContextObject(m_context); + + connect(m_codeEditor, &QPlainTextEdit::textChanged, this, &EditorWidget::sourceCodeChanged); + + connect(&settings(), + &Settings::languagesChanged, + m_codeEditor, + &CodeEditorWidget::updateHighlighter); + + connect(&settings().languageId, + &StringSelectionAspect::changed, + this, + &EditorWidget::onLanguageChanged); + + setFocusProxy(m_codeEditor); +} + +void EditorWidget::onLanguageChanged() +{ + m_codeEditor->updateHighlighter(); +} + +void EditorWidget::addCompiler() +{ + m_compilerCount++; + + auto compiler = new CompilerWidget; + compiler->setWindowTitle("Compiler #" + QString::number(m_compilerCount)); + compiler->setObjectName("compiler_" + QString::number(m_compilerCount)); + + addDockWidget(Qt::RightDockWidgetArea, addDockForWidget(compiler)); + + if (m_codeEditor && m_codeEditor->textDocument()) + compiler->compile(QString::fromUtf8(m_codeEditor->textDocument()->contents())); + + connect(this, &EditorWidget::sourceCodeChanged, compiler, [this, compiler] { + compiler->compile(QString::fromUtf8(m_codeEditor->textDocument()->contents())); + }); +} + +class Editor : public Core::IEditor +{ +public: + Editor() + : m_document(new TextDocument(Constants::CE_EDITOR_ID)) + { + setWidget(new EditorWidget(m_document)); + } + + Core::IDocument *document() const override { return m_document.data(); } + QWidget *toolBar() override { return nullptr; } + + TextDocumentPtr m_document; +}; + +EditorFactory::EditorFactory() + : m_actionHandler(Constants::CE_EDITOR_ID, + Constants::CE_EDITOR_CONTEXT_ID, + TextEditor::TextEditorActionHandler::None, + [](Core::IEditor *editor) -> TextEditorWidget * { + return Aggregation::query<TextEditorWidget>(editor->widget()); + }) +{ + setId(Constants::CE_EDITOR_ID); + setDisplayName(Tr::tr("Compiler Explorer Editor")); + + setEditorCreator([]() { return new Editor(); }); +} + +} // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.h b/src/plugins/compilerexplorer/compilerexplorereditor.h new file mode 100644 index 00000000000..1eec159c0c6 --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexplorereditor.h @@ -0,0 +1,95 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "api/compile.h" +#include "compilerexplorersettings.h" + +#include <coreplugin/terminal/searchableterminal.h> + +#include <solutions/spinner/spinner.h> + +#include <texteditor/texteditor.h> +#include <texteditor/texteditoractionhandler.h> + +#include <utils/fancymainwindow.h> + +#include <QFutureWatcher> +#include <QMainWindow> +#include <QSplitter> + +#include <memory> + +namespace CppEditor { +class CppEditorWidget; +} + +namespace CompilerExplorer { + +class CodeEditorWidget; + +class CompilerWidget : public QWidget +{ + Q_OBJECT +public: + CompilerWidget(); + + Core::SearchableTerminal *createTerminal(); + + void compile(const QString &source); + +private: + void doCompile(); + +private: + TextEditor::TextEditorWidget *m_asmEditor{nullptr}; + Core::SearchableTerminal *m_resultTerminal{nullptr}; + + SpinnerSolution::Spinner *m_spinner{nullptr}; + QSharedPointer<TextEditor::TextDocument> m_asmDocument; + + std::unique_ptr<QFutureWatcher<Api::CompileResult>> m_compileWatcher; + + CompilerExplorer::CompilerSettings m_compilerSettings; + + QString m_source; + QTimer *m_delayTimer{nullptr}; + QList<TextEditor::TextMark *> m_marks; +}; + +class EditorWidget : public Utils::FancyMainWindow +{ + Q_OBJECT +public: + EditorWidget(QSharedPointer<TextEditor::TextDocument> document = nullptr, QWidget *parent = nullptr); + + void addCompiler(); + +protected: + Core::SearchableTerminal *createTerminal(); + + void onLanguageChanged(); + +signals: + void sourceCodeChanged(); + +private: + CodeEditorWidget *m_codeEditor; + CompilerExplorer::Settings m_currentSettings; + QSplitter *m_mainSplitter; + int m_compilerCount{0}; + + Core::IContext *m_context; +}; + +class EditorFactory : public Core::IEditorFactory +{ +public: + EditorFactory(); + +private: + TextEditor::TextEditorActionHandler m_actionHandler; +}; + +} // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexploreroptions.cpp b/src/plugins/compilerexplorer/compilerexploreroptions.cpp new file mode 100644 index 00000000000..64ed6513f45 --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexploreroptions.cpp @@ -0,0 +1,34 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "compilerexploreroptions.h" + +#include "compilerexplorersettings.h" + +#include <utils/layoutbuilder.h> + +#include <QFutureWatcher> +#include <QScrollArea> +#include <QStandardItemModel> + +namespace CompilerExplorer { + +CompilerExplorerOptions::CompilerExplorerOptions(CompilerSettings &compilerSettings, QWidget *parent) + : QDialog(parent, Qt::Popup) +{ + using namespace Layouting; + + // clang-format off + Form { + compilerSettings.compiler, br, + compilerSettings.compilerOptions, br, + compilerSettings.libraries, br, + compilerSettings.compileToBinaryObject, br, + compilerSettings.executeCode, br, + compilerSettings.intelAsmSyntax, br, + compilerSettings.demangleIdentifiers, br, + }.attachTo(this); + // clang-format on +} + +} // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexploreroptions.h b/src/plugins/compilerexplorer/compilerexploreroptions.h new file mode 100644 index 00000000000..5802ce3c38b --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexploreroptions.h @@ -0,0 +1,18 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "compilerexplorersettings.h" + +#include <QDialog> + +namespace CompilerExplorer { + +class CompilerExplorerOptions : public QDialog +{ +public: + CompilerExplorerOptions(CompilerSettings &settings, QWidget *parent = nullptr); +}; + +} // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp new file mode 100644 index 00000000000..44a3e3fafc8 --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp @@ -0,0 +1,56 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "compilerexplorerplugin.h" + +#include "compilerexplorerconstants.h" +#include "compilerexplorereditor.h" +#include "compilerexplorersettings.h" +#include "compilerexplorertr.h" + +#include <coreplugin/actionmanager/actioncontainer.h> +#include <coreplugin/actionmanager/actionmanager.h> +#include <coreplugin/coreconstants.h> +#include <coreplugin/editormanager/editormanager.h> +#include <coreplugin/icore.h> + +#include <cppeditor/cppeditorconstants.h> + +#include <QMenu> + +namespace CompilerExplorer { +namespace Internal { + +CompilerExplorerPlugin::CompilerExplorerPlugin() {} + +CompilerExplorerPlugin::~CompilerExplorerPlugin() {} + +void CompilerExplorerPlugin::initialize() +{ + static CompilerExplorer::EditorFactory ceEditorFactory; + + auto action = new QAction(Tr::tr("Open Compiler Explorer"), this); + connect(action, &QAction::triggered, this, [] { + CompilerExplorer::Settings settings; + + const QString src = settings.source(); + QString name("Compiler Explorer"); + Core::EditorManager::openEditorWithContents(Constants::CE_EDITOR_ID, &name, src.toUtf8()); + }); + + Core::ActionContainer *mtools = Core::ActionManager::actionContainer(Core::Constants::M_TOOLS); + Core::ActionContainer *mCompilerExplorer = Core::ActionManager::createMenu( + "Tools.CompilerExplorer"); + QMenu *menu = mCompilerExplorer->menu(); + menu->setTitle(Tr::tr("Compiler Explorer")); + mtools->addMenu(mCompilerExplorer); + + Core::Command *cmd + = Core::ActionManager::registerAction(action, "CompilerExplorer.CompilerExplorerAction"); + mCompilerExplorer->addAction(cmd); +} + +void CompilerExplorerPlugin::extensionsInitialized() {} + +} // namespace Internal +} // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorerplugin.h b/src/plugins/compilerexplorer/compilerexplorerplugin.h new file mode 100644 index 00000000000..8379a2c8e0f --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexplorerplugin.h @@ -0,0 +1,24 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <extensionsystem/iplugin.h> + +namespace CompilerExplorer::Internal { + +class CompilerExplorerPlugin : public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CompilerExplorer.json") + +public: + CompilerExplorerPlugin(); + ~CompilerExplorerPlugin() override; + + void initialize() override; + + void extensionsInitialized() override; +}; + +} // namespace CompilerExplorer::Internal diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp new file mode 100644 index 00000000000..1dbd34f888d --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -0,0 +1,252 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "compilerexplorersettings.h" +#include "compilerexplorertr.h" + +#include "api/compiler.h" +#include "api/language.h" +#include "api/library.h" + +#include <QComboBox> +#include <QFutureWatcher> +#include <QNetworkAccessManager> + +namespace CompilerExplorer { + +Settings &settings() +{ + static Settings instance; + return instance; +} + +static Api::Languages &cachedLanguages() +{ + static Api::Languages instance; + return instance; +} + +static QMap<QString, Api::Libraries> &cachedLibraries() +{ + static QMap<QString, Api::Libraries> instance; + return instance; +} + +static Api::Libraries &cachedLibraries(const QString &languageId) +{ + return cachedLibraries()[languageId]; +} + +static QMap<QString, QMap<QString, QString>> &cachedCompilers() +{ + static QMap<QString, QMap<QString, QString>> instance; + return instance; +} + +Settings::Settings() +{ + static QNetworkAccessManager networkManager; + m_networkAccessManager = &networkManager; + + setSettingsGroup("CompilerExplorer"); + + source.setDefaultValue(R"( +int main() +{ + return 0; +} + +)"); + + compilerExplorerUrl.setLabelText(Tr::tr("Compiler Explorer URL:")); + compilerExplorerUrl.setToolTip(Tr::tr("URL of the Compiler Explorer instance to use")); + compilerExplorerUrl.setDefaultValue("https://godbolt.org/"); + compilerExplorerUrl.setDisplayStyle(Utils::StringAspect::DisplayStyle::LineEditDisplay); + compilerExplorerUrl.setHistoryCompleter("CompilerExplorer.Url.History"); + + languageId.setDefaultValue("c++"); + languageId.setLabelText(Tr::tr("Language:")); + languageId.setFillCallback([this](auto cb) { fillLanguageIdModel(cb); }); + + connect(&compilerExplorerUrl, &Utils::StringAspect::changed, this, [this] { + languageId.setValue(languageId.defaultValue()); + cachedLanguages().clear(); + languageId.refill(); + }); + + readSettings(); +} + +QString Settings::languageExtension() const +{ + auto it = std::find_if(std::begin(cachedLanguages()), + std::end(cachedLanguages()), + [this](const Api::Language &lang) { return lang.id == languageId(); }); + + if (it != cachedLanguages().end()) + return it->extensions.first(); + + return ".cpp"; +} + +CompilerSettings::CompilerSettings(Settings *settings) + : m_parent(settings) +{ + setAutoApply(true); + compilerOptions.setDefaultValue("-O3"); + compilerOptions.setLabelText(Tr::tr("Compiler options:")); + compilerOptions.setToolTip(Tr::tr("Arguments passed to the compiler")); + compilerOptions.setDisplayStyle(Utils::StringAspect::DisplayStyle::LineEditDisplay); + + compiler.setDefaultValue("clang_trunk"); + compiler.setLabelText(Tr::tr("Compiler:")); + compiler.setFillCallback([this](auto cb) { fillCompilerModel(cb); }); + + libraries.setLabelText(Tr::tr("Libraries:")); + libraries.setFillCallback([this](auto cb) { fillLibraries(cb); }); + + executeCode.setLabelText(Tr::tr("Execute the code")); + compileToBinaryObject.setLabelText(Tr::tr("Compile to binary object")); + intelAsmSyntax.setLabelText(Tr::tr("Intel asm syntax")); + intelAsmSyntax.setDefaultValue(true); + demangleIdentifiers.setLabelText(Tr::tr("Demangle identifiers")); + demangleIdentifiers.setDefaultValue(true); + + connect(&settings->compilerExplorerUrl, &Utils::StringAspect::changed, this, [this] { + cachedCompilers().clear(); + cachedLibraries().clear(); + + compiler.refill(); + libraries.refill(); + }); + + connect(&settings->languageId, &StringSelectionAspect::changed, this, [this] { + compiler.refill(); + libraries.refill(); + if (m_parent->languageId() == "c++") + compilerOptions.setValue("-O3"); + else + compilerOptions.setValue(""); + }); +} + +void CompilerSettings::fillLibraries(LibrarySelectionAspect::ResultCallback cb) +{ + const QString lang = m_parent->languageId(); + auto fillFromCache = [cb, lang] { + QList<QStandardItem *> items; + for (const Api::Library &lib : cachedLibraries(lang)) { + QStandardItem *newItem = new QStandardItem(lib.name); + newItem->setData(QVariant::fromValue(lib), LibrarySelectionAspect::LibraryData); + items.append(newItem); + } + cb(items); + }; + + if (!cachedLibraries(lang).isEmpty()) { + fillFromCache(); + return; + } + + auto future = Api::libraries(m_parent->apiConfig(), lang); + + auto watcher = new QFutureWatcher<Api::Libraries>(this); + watcher->setFuture(future); + QObject::connect(watcher, + &QFutureWatcher<Api::Libraries>::finished, + this, + [watcher, fillFromCache, lang]() { + try { + cachedLibraries(lang) = watcher->result(); + fillFromCache(); + } catch (const std::exception &e) { + qCritical() << e.what(); + return; + } + }); +} + +void Settings::fillLanguageIdModel(StringSelectionAspect::ResultCallback cb) +{ + auto fillFromCache = [cb, this] { + QList<QStandardItem *> items; + for (const Api::Language &language : cachedLanguages()) { + auto *newItem = new QStandardItem(language.name); + newItem->setData(language.id); + + if (QFile::exists(":/compilerexplorer/logos/" + language.logoUrl)) { + QIcon icon(":/compilerexplorer/logos/" + language.logoUrl); + newItem->setIcon(icon); + } + + items.append(newItem); + } + cb(items); + emit languagesChanged(); + }; + + if (!cachedLanguages().isEmpty()) { + fillFromCache(); + return; + } + + auto future = Api::languages(apiConfig()); + + auto watcher = new QFutureWatcher<Api::Languages>(this); + watcher->setFuture(future); + QObject::connect(watcher, + &QFutureWatcher<Api::Languages>::finished, + this, + [watcher, fillFromCache]() { + try { + cachedLanguages() = watcher->result(); + fillFromCache(); + } catch (const std::exception &e) { + qCritical() << e.what(); + return; + } + }); +} + +void CompilerSettings::fillCompilerModel(StringSelectionAspect::ResultCallback cb) +{ + auto fillFromCache = [cb](auto it) { + QList<QStandardItem *> items; + for (const QString &key : it->keys()) { + QStandardItem *newItem = new QStandardItem(key); + newItem->setData(it->value(key)); + items.append(newItem); + } + cb(items); + }; + + auto it = cachedCompilers().find(m_parent->languageId()); + if (it != cachedCompilers().end()) { + fillFromCache(it); + return; + } + + auto future = Api::compilers(m_parent->apiConfig(), m_parent->languageId()); + + auto watcher = new QFutureWatcher<Api::Compilers>(this); + watcher->setFuture(future); + QObject::connect(watcher, + &QFutureWatcher<Api::Compilers>::finished, + this, + [watcher, this, fillFromCache]() { + try { + auto result = watcher->result(); + auto itCache = cachedCompilers().insert(m_parent->languageId(), {}); + + for (const Api::Compiler &compiler : result) + itCache->insert(compiler.name, compiler.id); + + fillFromCache(itCache); + } catch (const std::exception &e) { + qCritical() << e.what(); + return; + } + }); +} + +} // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.h b/src/plugins/compilerexplorer/compilerexplorersettings.h new file mode 100644 index 00000000000..4d93f86c254 --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexplorersettings.h @@ -0,0 +1,70 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "api/config.h" +#include "compilerexploreraspects.h" + +#include <utils/aspects.h> + +#include <QNetworkAccessManager> + +namespace CompilerExplorer { +class Settings; + +class CompilerSettings : public Utils::AspectContainer +{ +public: + CompilerSettings(Settings *settings); + + StringSelectionAspect compiler{this}; + + Utils::StringAspect compilerOptions{this}; + LibrarySelectionAspect libraries{this}; + + // "Filters" + Utils::BoolAspect executeCode{this}; + Utils::BoolAspect compileToBinaryObject{this}; + Utils::BoolAspect intelAsmSyntax{this}; + Utils::BoolAspect demangleIdentifiers{this}; + +private: + void fillCompilerModel(StringSelectionAspect::ResultCallback cb); + void fillLibraries(LibrarySelectionAspect::ResultCallback cb); + + Settings *m_parent; +}; + +class Settings : public Utils::AspectContainer +{ + Q_OBJECT +public: + Settings(); + + StringSelectionAspect languageId{this}; + Utils::StringAspect compilerExplorerUrl{this}; + + Utils::StringAspect source{this}; + + QNetworkAccessManager *networkAccessManager() const { return m_networkAccessManager; } + + Api::Config apiConfig() const + { + return Api::Config(m_networkAccessManager, compilerExplorerUrl()); + } + + QString languageExtension() const; + +signals: + void languagesChanged(); + +private: + void fillLanguageIdModel(StringSelectionAspect::ResultCallback cb); + + QNetworkAccessManager *m_networkAccessManager{nullptr}; +}; + +Settings &settings(); + +} // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorertr.h b/src/plugins/compilerexplorer/compilerexplorertr.h new file mode 100644 index 00000000000..b5aef408395 --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexplorertr.h @@ -0,0 +1,15 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <QCoreApplication> + +namespace CompilerExplorer { + +struct Tr +{ + Q_DECLARE_TR_FUNCTIONS(QtC::CompilerExplorer) +}; + +} // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/logos/logos.qrc b/src/plugins/compilerexplorer/logos/logos.qrc new file mode 100644 index 00000000000..501cafddfcb --- /dev/null +++ b/src/plugins/compilerexplorer/logos/logos.qrc @@ -0,0 +1,3 @@ +<RCC> + <qresource prefix="/compilerexplorer/logos/"></qresource> +</RCC> diff --git a/src/plugins/compilerexplorer/test.rest b/src/plugins/compilerexplorer/test.rest new file mode 100644 index 00000000000..a6babdf5c21 --- /dev/null +++ b/src/plugins/compilerexplorer/test.rest @@ -0,0 +1,50 @@ + +POST https://godbolt.org/api/compiler/clang_trunk/compile HTTP/1.1 +content-type: application/json +Accept: application/json + +{ + "source": "int test() {return 20;};\nint main()\n{ return test();}", + "compiler": "clang_trunk", + "options": { + "userArguments": "", + "compilerOptions": { + "producePp": null, + "produceGccDump": {}, + "produceOptInfo": false, + "produceCfg": false, + "produceIr": null, + "produceLLVMOptPipeline": null, + "produceDevice": false, + "overrides": [] + }, + "filters": { + "binaryObject": false, + "binary": false, + "execute": true, + "intel": false, + "demangle": true, + "labels": true, + "libraryCode": false, + "directives": true, + "commentOnly": true, + "trim": false, + "debugCalls": false + }, + "tools": [], + "libraries": [], + "executeParameters": { + "args": "", + "stdin": "" + } + }, + "lang": "c++", + "files": [], + "bypassCache": 0, + "allowStoreCodeDebug": true +} + +### + +GET https://godbolt.org/api/compilers/c++ +Accept: application/json diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index dd248ba4b73..90aeb397525 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -114,7 +114,7 @@ EditorView::EditorView(SplitterOrView *parentSplitterOrView, QWidget *parent) : m_container->addWidget(empty); m_widgetEditorMap.insert(empty, nullptr); - const auto dropSupport = new DropSupport(this, [this](QDropEvent *event, DropSupport *) { + /*const auto dropSupport = new DropSupport(this, [this](QDropEvent *event, DropSupport *) { // do not accept move events except from other editor views (i.e. their tool bars) // otherwise e.g. item views that support moving items within themselves would // also "move" the item into the editor view, i.e. the item would be removed from the @@ -127,7 +127,7 @@ EditorView::EditorView(SplitterOrView *parentSplitterOrView, QWidget *parent) : }); connect(dropSupport, &DropSupport::filesDropped, this, &EditorView::openDroppedFiles); - +*/ updateNavigatorActions(); } diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 5b3eaca50c0..ce961c5e26c 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -203,12 +203,12 @@ MainWindow::MainWindow() statusBar()->setProperty("p_styled", true); - auto dropSupport = new DropSupport(this, [](QDropEvent *event, DropSupport *) { + /*auto dropSupport = new DropSupport(this, [](QDropEvent *event, DropSupport *) { return event->source() == nullptr; // only accept drops from the "outside" (e.g. file manager) }); connect(dropSupport, &DropSupport::filesDropped, this, &MainWindow::openDroppedFiles); - +*/ if (HostOsInfo::isLinuxHost()) { m_trimTimer.setSingleShot(true); m_trimTimer.setInterval(60000); diff --git a/src/shared/qbs b/src/shared/qbs index d8c97a5f0b1..2e6eb75c76c 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit d8c97a5f0b1f85e79829dbcc63b82bc5b1d83233 +Subproject commit 2e6eb75c76c2d042eb07a8e6bcb4aa03b8843205 From a9ac5b7b6e890fb330815361d8706773214fb0ab Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 20:20:22 +0200 Subject: [PATCH 0760/1777] ProjectExplorer: Remove unused function Change-Id: I7c0ea4445283fb38ca46aa3cd9690778389f3afa Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/projectexplorer.cpp | 11 ----------- src/plugins/projectexplorer/projectexplorer.h | 6 +----- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 45e805620c1..ea166ae7aa0 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2964,17 +2964,6 @@ void ProjectExplorerPlugin::runRunConfiguration(RunConfiguration *rc, dd->doUpdateRunActions(); } -QList<QPair<CommandLine, ProcessHandle>> ProjectExplorerPlugin::runningRunControlProcesses() -{ - QList<QPair<CommandLine, ProcessHandle>> processes; - const QList<RunControl *> runControls = allRunControls(); - for (RunControl *rc : runControls) { - if (rc->isRunning()) - processes.push_back({rc->commandLine(), rc->applicationProcessHandle()}); - } - return processes; -} - QList<RunControl *> ProjectExplorerPlugin::allRunControls() { return dd->m_outputPane.allRunControls(); diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index 8ba0b646f08..33dcbe2ad17 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -22,10 +22,7 @@ namespace Core { class OutputWindow; } // Core -namespace Utils { -class CommandLine; -class ProcessHandle; -} // Utils +namespace Utils { class CommandLine; } namespace ProjectExplorer { class CustomParserSettings; @@ -140,7 +137,6 @@ public: static void runStartupProject(Utils::Id runMode, bool forceSkipDeploy = false); static void runRunConfiguration(RunConfiguration *rc, Utils::Id runMode, const bool forceSkipDeploy = false); - static QList<QPair<Utils::CommandLine, Utils::ProcessHandle>> runningRunControlProcesses(); static QList<RunControl *> allRunControls(); static void addExistingFiles(FolderNode *folderNode, const Utils::FilePaths &filePaths); From 635fc9bb1f0278e4d4d83b06c112288f86711623 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 17 Aug 2023 09:38:39 +0200 Subject: [PATCH 0761/1777] Fix accidental submodule update Amends e34762c84436c9b8b3d35f119a893dcd6cb4f4db. Change-Id: I22b5599289ba314fb9d8897f8f5b45cb099ef9d7 Reviewed-by: hjk <hjk@qt.io> --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 2e6eb75c76c..d8c97a5f0b1 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 2e6eb75c76c2d042eb07a8e6bcb4aa03b8843205 +Subproject commit d8c97a5f0b1f85e79829dbcc63b82bc5b1d83233 From 123eb073caacae6548d083ce34a94848147a4254 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 18:50:51 +0200 Subject: [PATCH 0762/1777] Runnable: Keep extraData separately It's rarely used. Change-Id: I11e6546e5991ba2332943eb4900190f937d1db1d Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/runconfiguration.cpp | 10 ++++++++-- src/plugins/projectexplorer/runconfiguration.h | 1 + src/plugins/projectexplorer/runcontrol.cpp | 6 ++++-- src/plugins/projectexplorer/runcontrol.h | 3 --- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 64fafeea397..58c5e44c9f7 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -419,13 +419,19 @@ Runnable RunConfiguration::runnable() const r.workingDirectory = r.command.executable().withNewMappedPath(workingDirectoryAspect->workingDirectory()); if (auto environmentAspect = aspect<EnvironmentAspect>()) r.environment = environmentAspect->environment(); - if (auto forwardingAspect = aspect<X11ForwardingAspect>()) - r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display()); if (m_runnableModifier) m_runnableModifier(r); return r; } +QVariantHash RunConfiguration::extraData() const +{ + QVariantHash data; + if (auto forwardingAspect = aspect<X11ForwardingAspect>()) + data.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display()); + return data; +} + /*! \class ProjectExplorer::RunConfigurationFactory \inmodule QtCreator diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index ba4fb4d4c95..79322daa6c8 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -96,6 +96,7 @@ public: void setRunnableModifier(const RunnableModifier &extraModifier); virtual Runnable runnable() const; + virtual QVariantHash extraData() const; // Return a handle to the build system target that created this run configuration. // May return an empty string if no target built the executable! diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 3d0fffecc7e..acc78386e34 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -235,6 +235,7 @@ class RunControlPrivateData public: QString displayName; Runnable runnable; + QVariantHash extraData; IDevice::ConstPtr device; Icon icon; const MacroExpander *macroExpander = nullptr; @@ -336,6 +337,7 @@ void RunControl::copyDataFromRunConfiguration(RunConfiguration *runConfig) QTC_ASSERT(runConfig, return); d->runConfigId = runConfig->id(); d->runnable = runConfig->runnable(); + d->extraData = runConfig->extraData(); d->displayName = runConfig->expandedDisplayName(); d->buildKey = runConfig->buildKey(); d->settingsData = runConfig->settingsData(); @@ -880,12 +882,12 @@ void RunControl::setEnvironment(const Environment &environment) const QVariantHash &RunControl::extraData() const { - return d->runnable.extraData; + return d->extraData; } void RunControl::setExtraData(const QVariantHash &extraData) { - d->runnable.extraData = extraData; + d->extraData = extraData; } QString RunControl::displayName() const diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index 5260a7bbecb..e5c34d24e2a 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -42,12 +42,9 @@ class SimpleTargetRunnerPrivate; class PROJECTEXPLORER_EXPORT Runnable { public: - Runnable() = default; - Utils::CommandLine command; Utils::FilePath workingDirectory; Utils::Environment environment; - QVariantHash extraData; }; class PROJECTEXPLORER_EXPORT RunWorker : public QObject From 121d73b30f9349c739ab972162b429b3de078a00 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 19:24:06 +0200 Subject: [PATCH 0763/1777] Utils: Rename ProjectExplorer::Runnable into Utils::ProcessRunData Move it into Utils lib. Change-Id: I3b6c16d18439cabddf59afc03116f13c1970102c Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/processinterface.h | 8 ++++++++ src/plugins/autotest/autotestplugin.cpp | 4 ++-- src/plugins/autotest/testconfiguration.cpp | 4 ++-- src/plugins/autotest/testconfiguration.h | 13 +++++++++---- src/plugins/autotest/testrunconfiguration.h | 4 ++-- src/plugins/autotest/testrunner.cpp | 2 +- .../debugservers/gdb/gdbserverprovider.cpp | 2 +- .../debugservers/uvsc/uvscserverprovider.cpp | 8 ++++---- .../debugservers/uvsc/uvscserverprovider.h | 2 +- src/plugins/cmakeprojectmanager/cmakeprocess.cpp | 1 - src/plugins/debugger/debuggerdialogs.cpp | 4 ++-- src/plugins/debugger/debuggerengine.h | 8 +++++--- src/plugins/debugger/debuggerkitaspect.cpp | 6 +++--- src/plugins/debugger/debuggerkitaspect.h | 5 +++-- src/plugins/debugger/debuggerruncontrol.cpp | 4 ++-- src/plugins/debugger/debuggerruncontrol.h | 2 +- src/plugins/debugger/gdb/gdbengine.cpp | 2 +- src/plugins/debugger/gdb/gdbengine.h | 2 +- src/plugins/debugger/loadcoredialog.cpp | 2 +- src/plugins/debugger/terminal.cpp | 5 +++-- src/plugins/debugger/terminal.h | 9 ++++++--- .../debugger/unstartedappwatcherdialog.cpp | 7 ++++--- src/plugins/haskell/haskellrunconfiguration.cpp | 7 ++++--- src/plugins/perfprofiler/perfdatareader.cpp | 4 ---- src/plugins/perfprofiler/perfprofilertool.cpp | 1 - src/plugins/projectexplorer/buildsystem.cpp | 2 +- .../customexecutablerunconfiguration.cpp | 6 ++++-- .../customexecutablerunconfiguration.h | 2 +- src/plugins/projectexplorer/projectexplorer.cpp | 3 ++- src/plugins/projectexplorer/runconfiguration.cpp | 6 +++--- src/plugins/projectexplorer/runconfiguration.h | 10 ++++++---- src/plugins/projectexplorer/runcontrol.cpp | 4 ++-- src/plugins/projectexplorer/runcontrol.h | 16 ++++------------ .../qmlprojectrunconfiguration.cpp | 4 ++-- src/plugins/qnx/qnxrunconfiguration.cpp | 4 +++- src/plugins/remotelinux/killappstep.cpp | 3 ++- .../remotelinuxcustomrunconfiguration.cpp | 1 - .../remotelinux/remotelinuxrunconfiguration.cpp | 1 - src/plugins/valgrind/callgrindengine.h | 3 ++- src/plugins/valgrind/memchecktool.cpp | 2 +- .../valgrind/valgrindmemcheckparsertest.cpp | 6 +++--- src/plugins/valgrind/valgrindrunner.cpp | 8 +++----- src/plugins/valgrind/valgrindrunner.h | 8 +++++--- src/plugins/valgrind/valgrindtestrunnertest.cpp | 5 ++--- 44 files changed, 112 insertions(+), 98 deletions(-) diff --git a/src/libs/utils/processinterface.h b/src/libs/utils/processinterface.h index a0460c5af3a..8dedd0183ef 100644 --- a/src/libs/utils/processinterface.h +++ b/src/libs/utils/processinterface.h @@ -43,6 +43,14 @@ private: } // namespace Pty +class QTCREATOR_UTILS_EXPORT ProcessRunData +{ +public: + Utils::CommandLine command; + Utils::FilePath workingDirectory; + Utils::Environment environment; +}; + class QTCREATOR_UTILS_EXPORT ProcessSetupData { public: diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index 72dbaf08418..b3fccb48d20 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -13,7 +13,6 @@ #include "testprojectsettings.h" #include "testresultspane.h" #include "testrunner.h" -#include "testsettings.h" #include "testsettingspage.h" #include "testtreeitem.h" #include "testtreemodel.h" @@ -47,13 +46,14 @@ #include <projectexplorer/projectexplorericons.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/projectpanelfactory.h> -#include <projectexplorer/runcontrol.h> +#include <projectexplorer/runconfiguration.h> #include <projectexplorer/target.h> #include <texteditor/textdocument.h> #include <texteditor/texteditor.h> #include <utils/algorithm.h> +#include <utils/processinterface.h> #include <utils/textutils.h> #include <utils/utilsicons.h> diff --git a/src/plugins/autotest/testconfiguration.cpp b/src/plugins/autotest/testconfiguration.cpp index 0f948adff5a..3312704a56e 100644 --- a/src/plugins/autotest/testconfiguration.cpp +++ b/src/plugins/autotest/testconfiguration.cpp @@ -214,7 +214,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode) continue; } - const Runnable runnable = runConfig->runnable(); + const ProcessRunData runnable = runConfig->runnable(); // not the best approach - but depending on the build system and whether the executables // are going to get installed or not we have to soften the condition... const FilePath currentExecutable = ensureExeEnding(runnable.command.executable()); @@ -246,7 +246,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode) // we failed to find a valid runconfiguration - but we've got the executable already if (auto rc = target->activeRunConfiguration()) { if (isLocal(target)) { // FIXME for now only Desktop support - const Runnable runnable = rc->runnable(); + const ProcessRunData runnable = rc->runnable(); m_runnable.environment = runnable.environment; m_deducedConfiguration = true; m_deducedFrom = rc->displayName(); diff --git a/src/plugins/autotest/testconfiguration.h b/src/plugins/autotest/testconfiguration.h index 6292ef8204c..a7f4eabf5bf 100644 --- a/src/plugins/autotest/testconfiguration.h +++ b/src/plugins/autotest/testconfiguration.h @@ -6,13 +6,18 @@ #include "autotestconstants.h" #include <projectexplorer/project.h> -#include <projectexplorer/runcontrol.h> +#include <projectexplorer/runconfiguration.h> + #include <utils/environment.h> +#include <utils/processinterface.h> #include <QPointer> #include <QStringList> -namespace Utils { class Process; } +namespace Utils { +class Process; +class ProcessRunData; +} namespace Autotest { namespace Internal { @@ -49,10 +54,10 @@ public: void setTestCaseCount(int count) { m_testCaseCount = count; } int testCaseCount() const { return m_testCaseCount; } ProjectExplorer::Project *project() const { return m_project.data(); } - ProjectExplorer::Runnable runnable() const { return m_runnable; } + Utils::ProcessRunData runnable() const { return m_runnable; } protected: - ProjectExplorer::Runnable m_runnable; + Utils::ProcessRunData m_runnable; private: ITestBase *m_testBase = nullptr; diff --git a/src/plugins/autotest/testrunconfiguration.h b/src/plugins/autotest/testrunconfiguration.h index 5468ea36056..fb81fb4d890 100644 --- a/src/plugins/autotest/testrunconfiguration.h +++ b/src/plugins/autotest/testrunconfiguration.h @@ -38,9 +38,9 @@ public: m_testConfig = config; } - ProjectExplorer::Runnable runnable() const override + Utils::ProcessRunData runnable() const override { - ProjectExplorer::Runnable r; + Utils::ProcessRunData r; QTC_ASSERT(m_testConfig, return r); r.command.setExecutable(m_testConfig->executableFilePath()); r.command.addArgs(m_testConfig->argumentsForTestRunner().join(' '), Utils::CommandLine::Raw); diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index 6c21d9f657e..dac0db19377 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -539,7 +539,7 @@ void TestRunner::debugTests() runControl->copyDataFromRunConfiguration(config->runConfiguration()); QStringList omitted; - Runnable inferior = config->runnable(); + ProcessRunData inferior = config->runnable(); inferior.command.setExecutable(commandFilePath); const QStringList args = config->argumentsForTestRunner(&omitted); diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp index 8bd2b3fdcc2..802d691c689 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp @@ -153,7 +153,7 @@ bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessa return false; } - Runnable inferior; + ProcessRunData inferior; inferior.command.setExecutable(bin); if (const auto argAspect = runControl->aspect<ArgumentsAspect>()) inferior.command.setArguments(argAspect->arguments); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index 951f0391ec7..9b20bea548f 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -192,7 +192,7 @@ bool UvscServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMess const FilePath peripheralDescriptionFile = FilePath::fromString(m_deviceSelection.svd); - Runnable inferior; + ProcessRunData inferior; inferior.command.setExecutable(bin); runTool->runParameters().peripheralDescriptionFile = peripheralDescriptionFile; runTool->runParameters().uVisionProjectFilePath = projFilePath; @@ -209,12 +209,12 @@ bool UvscServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMess ProjectExplorer::RunWorker *UvscServerProvider::targetRunner(RunControl *runControl) const { // Get uVision executable path. - const Runnable uv = DebuggerKitAspect::runnable(runControl->kit()); + const ProcessRunData uv = DebuggerKitAspect::runnable(runControl->kit()); CommandLine server(uv.command.executable()); server.addArg("-j0"); server.addArg(QStringLiteral("-s%1").arg(m_channel.port())); - Runnable r; + ProcessRunData r; r.command = server; return new UvscServerProviderRunner(runControl, r); } @@ -348,7 +348,7 @@ void UvscServerProviderConfigWidget::setFromProvider() // UvscServerProviderRunner UvscServerProviderRunner::UvscServerProviderRunner(ProjectExplorer::RunControl *runControl, - const Runnable &runnable) + const ProcessRunData &runnable) : RunWorker(runControl) { setId("BareMetalUvscServer"); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h index 3363a519392..82988965ed8 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h @@ -121,7 +121,7 @@ class UvscServerProviderRunner final : public ProjectExplorer::RunWorker { public: explicit UvscServerProviderRunner(ProjectExplorer::RunControl *runControl, - const ProjectExplorer::Runnable &runnable); + const Utils::ProcessRunData &runnable); private: void start() final; diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index 5b9da361e57..1294f597297 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -14,7 +14,6 @@ #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/taskhub.h> #include <projectexplorer/kitchooser.h> -#include <projectexplorer/runcontrol.h> #include <extensionsystem/invoker.h> #include <extensionsystem/pluginmanager.h> diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index a6b38c479db..26fa01b1243 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -95,7 +95,7 @@ public: Id kitId; uint serverPort; QString serverAddress; - Runnable runnable; + ProcessRunData runnable; bool breakAtMain = false; bool runInTerminal = false; bool useTargetExtendedRemote = false; @@ -399,7 +399,7 @@ void StartApplicationDialog::run(bool attachRemote) } IDevice::ConstPtr dev = DeviceKitAspect::device(k); - Runnable inferior = newParameters.runnable; + ProcessRunData inferior = newParameters.runnable; const QString inputAddress = dialog.d->channelOverrideEdit->text(); if (!inputAddress.isEmpty()) debugger->setRemoteChannel(inputAddress); diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index cc6baf32d28..a1eb1091d71 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -13,11 +13,13 @@ #include <projectexplorer/abi.h> #include <projectexplorer/devicesupport/idevicefwd.h> -#include <projectexplorer/runcontrol.h> #include <texteditor/textmark.h> #include <utils/filepath.h> +#include <utils/outputformat.h> +#include <utils/processhandle.h> +#include <utils/processinterface.h> QT_BEGIN_NAMESPACE class QDebug; @@ -99,7 +101,7 @@ public: DebuggerStartMode startMode = NoStartMode; DebuggerCloseMode closeMode = KillAtClose; - ProjectExplorer::Runnable inferior; + Utils::ProcessRunData inferior; QString displayName; // Used in the Snapshots view. Utils::ProcessHandle attachPID; Utils::FilePaths solibSearchPath; @@ -151,7 +153,7 @@ public: bool useTerminal = false; bool runAsRoot = false; - ProjectExplorer::Runnable debugger; + Utils::ProcessRunData debugger; Utils::FilePath overrideStartScript; // Used in attach to core and remote debugging QString startMessage; // First status message shown. Utils::FilePath debugInfoLocation; // Gdb "set-debug-file-directory". diff --git a/src/plugins/debugger/debuggerkitaspect.cpp b/src/plugins/debugger/debuggerkitaspect.cpp index bcf3faee62c..ddbdf7bfd29 100644 --- a/src/plugins/debugger/debuggerkitaspect.cpp +++ b/src/plugins/debugger/debuggerkitaspect.cpp @@ -10,7 +10,6 @@ #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/runcontrol.h> #include <projectexplorer/toolchain.h> #include <utils/environment.h> @@ -18,6 +17,7 @@ #include <utils/filepath.h> #include <utils/layoutbuilder.h> #include <utils/macroexpander.h> +#include <utils/processinterface.h> #include <utils/qtcassert.h> #include <QComboBox> @@ -177,9 +177,9 @@ const DebuggerItem *DebuggerKitAspect::debugger(const Kit *kit) return DebuggerItemManager::findById(id); } -Runnable DebuggerKitAspect::runnable(const Kit *kit) +ProcessRunData DebuggerKitAspect::runnable(const Kit *kit) { - Runnable runnable; + ProcessRunData runnable; if (const DebuggerItem *item = debugger(kit)) { FilePath cmd = item->command(); if (cmd.isRelativePath()) { diff --git a/src/plugins/debugger/debuggerkitaspect.h b/src/plugins/debugger/debuggerkitaspect.h index f4619892c3a..9a8e12f95b1 100644 --- a/src/plugins/debugger/debuggerkitaspect.h +++ b/src/plugins/debugger/debuggerkitaspect.h @@ -7,7 +7,8 @@ #include "debuggerconstants.h" #include <projectexplorer/kitaspects.h> -#include <projectexplorer/runcontrol.h> + +namespace Utils { class ProcessRunData; } namespace Debugger { @@ -28,7 +29,7 @@ public: static ProjectExplorer::Tasks validateDebugger(const ProjectExplorer::Kit *k); static ConfigurationErrors configurationErrors(const ProjectExplorer::Kit *k); static const class DebuggerItem *debugger(const ProjectExplorer::Kit *kit); - static ProjectExplorer::Runnable runnable(const ProjectExplorer::Kit *kit); + static Utils::ProcessRunData runnable(const ProjectExplorer::Kit *kit); static void setDebugger(ProjectExplorer::Kit *k, const QVariant &id); static DebuggerEngineType engineType(const ProjectExplorer::Kit *k); static QString displayString(const ProjectExplorer::Kit *k); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index a1c1f8b0331..d9c15776a47 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -354,7 +354,7 @@ void DebuggerRunTool::setAbi(const Abi &abi) m_runParameters.toolChainAbi = abi; } -void DebuggerRunTool::setInferior(const Runnable &runnable) +void DebuggerRunTool::setInferior(const ProcessRunData &runnable) { m_runParameters.inferior = runnable; } @@ -882,7 +882,7 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm } } - Runnable inferior = runControl->runnable(); + ProcessRunData inferior = runControl->runnable(); // Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...) inferior.workingDirectory = inferior.workingDirectory.normalizedPathName(); m_runParameters.inferior = inferior; diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index c4fbb3110e8..fdba73c83e2 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -39,7 +39,7 @@ public: static void setBreakOnMainNextTime(); - void setInferior(const ProjectExplorer::Runnable &runnable); + void setInferior(const Utils::ProcessRunData &runnable); void setInferiorExecutable(const Utils::FilePath &executable); void setInferiorEnvironment(const Utils::Environment &env); // Used by GammaRay plugin void setRunControlName(const QString &name); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 6e4f6384366..8dd4ae7755e 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -5033,7 +5033,7 @@ static FilePath findExecutableFromName(const QString &fileNameFromCore, const Fi return {}; } -CoreInfo CoreInfo::readExecutableNameFromCore(const Runnable &debugger, const FilePath &coreFile) +CoreInfo CoreInfo::readExecutableNameFromCore(const ProcessRunData &debugger, const FilePath &coreFile) { CoreInfo cinfo; #if 0 diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 64a2eddd4eb..a60cdc59162 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -37,7 +37,7 @@ struct CoreInfo Utils::FilePath foundExecutableName; // empty if no corresponding exec could be found bool isCore = false; - static CoreInfo readExecutableNameFromCore(const ProjectExplorer::Runnable &debugger, + static CoreInfo readExecutableNameFromCore(const Utils::ProcessRunData &debugger, const Utils::FilePath &coreFile); }; diff --git a/src/plugins/debugger/loadcoredialog.cpp b/src/plugins/debugger/loadcoredialog.cpp index f78c18344e3..d52d52e1115 100644 --- a/src/plugins/debugger/loadcoredialog.cpp +++ b/src/plugins/debugger/loadcoredialog.cpp @@ -275,7 +275,7 @@ void AttachCoreDialog::coreFileChanged(const FilePath &coreFile) if (coreFile.osType() != OsType::OsTypeWindows && coreFile.exists()) { Kit *k = d->kitChooser->currentKit(); QTC_ASSERT(k, return); - Runnable debugger = DebuggerKitAspect::runnable(k); + ProcessRunData debugger = DebuggerKitAspect::runnable(k); CoreInfo cinfo = CoreInfo::readExecutableNameFromCore(debugger, coreFile); if (!cinfo.foundExecutableName.isEmpty()) d->symbolFileName->setFilePath(cinfo.foundExecutableName); diff --git a/src/plugins/debugger/terminal.cpp b/src/plugins/debugger/terminal.cpp index 86531d0e0ad..18092f132fe 100644 --- a/src/plugins/debugger/terminal.cpp +++ b/src/plugins/debugger/terminal.cpp @@ -13,6 +13,7 @@ #include <utils/environment.h> #include <utils/hostosinfo.h> #include <utils/process.h> +#include <utils/processinterface.h> #include <utils/qtcassert.h> #include <QDebug> @@ -149,7 +150,7 @@ void Terminal::onSlaveReaderActivated(int fd) } TerminalRunner::TerminalRunner(RunControl *runControl, - const std::function<Runnable()> &stubRunnable) + const std::function<ProcessRunData()> &stubRunnable) : RunWorker(runControl), m_stubRunnable(stubRunnable) { setId("TerminalRunner"); @@ -171,7 +172,7 @@ void TerminalRunner::start() { QTC_ASSERT(m_stubRunnable, reportFailure({}); return); QTC_ASSERT(!m_stubProc, reportFailure({}); return); - Runnable stub = m_stubRunnable(); + ProcessRunData stub = m_stubRunnable(); bool runAsRoot = false; if (auto runAsRootAspect = runControl()->aspect<RunAsRootAspect>()) diff --git a/src/plugins/debugger/terminal.h b/src/plugins/debugger/terminal.h index cd57e9eea21..07f334fbe8a 100644 --- a/src/plugins/debugger/terminal.h +++ b/src/plugins/debugger/terminal.h @@ -8,7 +8,10 @@ #include <projectexplorer/runcontrol.h> -namespace Utils { class Process; } +namespace Utils { +class Process; +class ProcessRunData; +} namespace Debugger { @@ -50,7 +53,7 @@ class TerminalRunner : public ProjectExplorer::RunWorker { public: TerminalRunner(ProjectExplorer::RunControl *runControl, - const std::function<ProjectExplorer::Runnable()> &stubRunnable); + const std::function<Utils::ProcessRunData()> &stubRunnable); qint64 applicationPid() const { return m_applicationPid; } qint64 applicationMainThreadId() const { return m_applicationMainThreadId; } @@ -66,7 +69,7 @@ private: void stubDone(); Utils::Process *m_stubProc = nullptr; - std::function<ProjectExplorer::Runnable()> m_stubRunnable; + std::function<Utils::ProcessRunData()> m_stubRunnable; qint64 m_applicationPid = 0; qint64 m_applicationMainThreadId = 0; }; diff --git a/src/plugins/debugger/unstartedappwatcherdialog.cpp b/src/plugins/debugger/unstartedappwatcherdialog.cpp index 936d4f1be5f..95926afcbcf 100644 --- a/src/plugins/debugger/unstartedappwatcherdialog.cpp +++ b/src/plugins/debugger/unstartedappwatcherdialog.cpp @@ -18,9 +18,10 @@ #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projecttree.h> #include <projectexplorer/runconfiguration.h> -#include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> +#include <utils/processinterface.h> + #include <QCheckBox> #include <QDialogButtonBox> #include <QFileDialog> @@ -98,7 +99,7 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent) pathLayout->addWidget(resetExecutable); if (activeTarget) { if (RunConfiguration *runConfig = activeTarget->activeRunConfiguration()) { - const Runnable runnable = runConfig->runnable(); + const ProcessRunData runnable = runConfig->runnable(); if (isLocal(runConfig)) { resetExecutable->setEnabled(true); connect(resetExecutable, &QPushButton::clicked, this, [this, runnable] { @@ -179,7 +180,7 @@ void UnstartedAppWatcherDialog::selectExecutable() if (activeTarget) { if (RunConfiguration *runConfig = activeTarget->activeRunConfiguration()) { - const Runnable runnable = runConfig->runnable(); + const ProcessRunData runnable = runConfig->runnable(); if (isLocal(runConfig)) path = runnable.command.executable().parentDir(); } diff --git a/src/plugins/haskell/haskellrunconfiguration.cpp b/src/plugins/haskell/haskellrunconfiguration.cpp index fbcf9589aeb..0381f86784a 100644 --- a/src/plugins/haskell/haskellrunconfiguration.cpp +++ b/src/plugins/haskell/haskellrunconfiguration.cpp @@ -12,9 +12,10 @@ #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runconfigurationaspects.h> -#include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> +#include <utils/processinterface.h> + using namespace ProjectExplorer; using namespace Utils; @@ -45,10 +46,10 @@ public: } private: - ProjectExplorer::Runnable runnable() const final + Utils::ProcessRunData runnable() const final { const FilePath projectDirectory = project()->projectDirectory(); - Runnable r; + ProcessRunData r; QStringList args; if (BuildConfiguration *buildConfiguration = target()->activeBuildConfiguration()) { args << "--work-dir" diff --git a/src/plugins/perfprofiler/perfdatareader.cpp b/src/plugins/perfprofiler/perfdatareader.cpp index 91b40cbaec8..222e1c9788e 100644 --- a/src/plugins/perfprofiler/perfdatareader.cpp +++ b/src/plugins/perfprofiler/perfdatareader.cpp @@ -3,11 +3,7 @@ #include "perfdatareader.h" #include "perfprofilerconstants.h" -#include "perfprofilerplugin.h" #include "perfprofilertr.h" -#include "perfrunconfigurationaspect.h" -#include "perfsettings.h" -#include "perftimelinemodel.h" #include <coreplugin/icore.h> #include <coreplugin/messagemanager.h> diff --git a/src/plugins/perfprofiler/perfprofilertool.cpp b/src/plugins/perfprofiler/perfprofilertool.cpp index 463ba45c067..9c9e9d5ec54 100644 --- a/src/plugins/perfprofiler/perfprofilertool.cpp +++ b/src/plugins/perfprofiler/perfprofilertool.cpp @@ -4,7 +4,6 @@ #include "perfprofilertool.h" #include "perfloaddialog.h" -#include "perfprofilerplugin.h" #include "perfprofilertr.h" #include "perfsettings.h" #include "perftracepointdialog.h" diff --git a/src/plugins/projectexplorer/buildsystem.cpp b/src/plugins/projectexplorer/buildsystem.cpp index b0103a52f7c..583e532cc4b 100644 --- a/src/plugins/projectexplorer/buildsystem.cpp +++ b/src/plugins/projectexplorer/buildsystem.cpp @@ -9,7 +9,6 @@ #include "projectexplorertr.h" #include "projectmanager.h" #include "runconfiguration.h" -#include "runcontrol.h" #include "target.h" #include <coreplugin/messagemanager.h> @@ -20,6 +19,7 @@ #include <projectexplorer/makestep.h> #include <utils/algorithm.h> +#include <utils/processinterface.h> #include <utils/qtcassert.h> #include <QTimer> diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index ca8979b4e35..4341e14cf77 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -8,6 +8,8 @@ #include "runconfigurationaspects.h" #include "target.h" +#include <utils/processinterface.h> + using namespace Utils; namespace ProjectExplorer { @@ -49,9 +51,9 @@ bool CustomExecutableRunConfiguration::isEnabled() const return true; } -Runnable CustomExecutableRunConfiguration::runnable() const +ProcessRunData CustomExecutableRunConfiguration::runnable() const { - Runnable r; + ProcessRunData r; r.command = commandLine(); r.environment = environment.environment(); r.workingDirectory = workingDir(); diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.h b/src/plugins/projectexplorer/customexecutablerunconfiguration.h index 5eaced5c493..39199f4b4a1 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.h +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.h @@ -20,7 +20,7 @@ public: QString defaultDisplayName() const; private: - Runnable runnable() const override; + Utils::ProcessRunData runnable() const override; bool isEnabled() const override; Tasks checkForIssues() const override; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index ea166ae7aa0..8493bf275ab 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -125,6 +125,7 @@ #include <utils/mimeutils.h> #include <utils/parameteraction.h> #include <utils/processhandle.h> +#include <utils/processinterface.h> #include <utils/proxyaction.h> #include <utils/qtcassert.h> #include <utils/removefiledialog.h> @@ -3646,7 +3647,7 @@ void ProjectExplorerPluginPrivate::openTerminalHereWithRunEnv() currentNode->asProjectNode()); QTC_ASSERT(runConfig, return); - const Runnable runnable = runConfig->runnable(); + const ProcessRunData runnable = runConfig->runnable(); IDevice::ConstPtr device = DeviceManager::deviceForPath(runnable.command.executable()); if (!device) device = DeviceKitAspect::device(target->kit()); diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 58c5e44c9f7..1fdb80a0b87 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -14,7 +14,6 @@ #include "projectmanager.h" #include "projectnodes.h" #include "runconfigurationaspects.h" -#include "runcontrol.h" #include "target.h" #include <coreplugin/icontext.h> @@ -28,6 +27,7 @@ #include <utils/detailswidget.h> #include <utils/layoutbuilder.h> #include <utils/outputformatter.h> +#include <utils/processinterface.h> #include <utils/qtcassert.h> #include <utils/utilsicons.h> #include <utils/variablechooser.h> @@ -411,9 +411,9 @@ void RunConfiguration::fromMap(const QVariantMap &map) \brief Returns a \l Runnable described by this RunConfiguration. */ -Runnable RunConfiguration::runnable() const +ProcessRunData RunConfiguration::runnable() const { - Runnable r; + ProcessRunData r; r.command = commandLine(); if (auto workingDirectoryAspect = aspect<WorkingDirectoryAspect>()) r.workingDirectory = r.command.executable().withNewMappedPath(workingDirectoryAspect->workingDirectory()); diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 79322daa6c8..6caf5775b4d 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -14,14 +14,16 @@ #include <functional> #include <memory> -namespace Utils { class OutputFormatter; } +namespace Utils { +class OutputFormatter; +class ProcessRunData; +} namespace ProjectExplorer { class BuildConfiguration; class BuildSystem; class GlobalOrProjectAspect; class ProjectNode; -class Runnable; class RunConfigurationFactory; class RunConfiguration; class RunConfigurationCreationInfo; @@ -92,10 +94,10 @@ public: Utils::CommandLine commandLine() const; bool isPrintEnvironmentEnabled() const; - using RunnableModifier = std::function<void(Runnable &)>; + using RunnableModifier = std::function<void(Utils::ProcessRunData &)>; void setRunnableModifier(const RunnableModifier &extraModifier); - virtual Runnable runnable() const; + virtual Utils::ProcessRunData runnable() const; virtual QVariantHash extraData() const; // Return a handle to the build system target that created this run configuration. diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index acc78386e34..6624a8b2918 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -234,7 +234,7 @@ class RunControlPrivateData { public: QString displayName; - Runnable runnable; + ProcessRunData runnable; QVariantHash extraData; IDevice::ConstPtr device; Icon icon; @@ -845,7 +845,7 @@ bool RunControl::isPrintEnvironmentEnabled() const return d->printEnvironment; } -const Runnable &RunControl::runnable() const +const ProcessRunData &RunControl::runnable() const { return d->runnable; } diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index e5c34d24e2a..b1b9f83cf52 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -25,6 +25,7 @@ namespace Utils { class Icon; class MacroExpander; class OutputLineParser; +class ProcessRunData; } // Utils namespace ProjectExplorer { @@ -38,15 +39,6 @@ class RunWorkerPrivate; class SimpleTargetRunnerPrivate; } // Internal - -class PROJECTEXPLORER_EXPORT Runnable -{ -public: - Utils::CommandLine command; - Utils::FilePath workingDirectory; - Utils::Environment environment; -}; - class PROJECTEXPLORER_EXPORT RunWorker : public QObject { Q_OBJECT @@ -208,7 +200,7 @@ public: Utils::Id runMode() const; bool isPrintEnvironmentEnabled() const; - const Runnable &runnable() const; + const Utils::ProcessRunData &runnable() const; const Utils::CommandLine &commandLine() const; void setCommandLine(const Utils::CommandLine &command); @@ -280,8 +272,8 @@ private: void start() final; void stop() final; - const Runnable &runnable() const = delete; - void setRunnable(const Runnable &) = delete; + const Utils::ProcessRunData &runnable() const = delete; + void setRunnable(const Utils::ProcessRunData &) = delete; const std::unique_ptr<Internal::SimpleTargetRunnerPrivate> d; }; diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 8fa5674970e..2bd1318e85d 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -20,7 +20,6 @@ #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runconfigurationaspects.h> -#include <projectexplorer/runcontrol.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/target.h> @@ -35,6 +34,7 @@ #include <utils/environment.h> #include <utils/fileutils.h> #include <utils/process.h> +#include <utils/processinterface.h> #include <utils/winutils.h> #include <qmljstools/qmljstoolsconstants.h> @@ -168,7 +168,7 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) x11Forwarding.setMacroExpander(macroExpander()); - setRunnableModifier([this](Runnable &r) { + setRunnableModifier([this](ProcessRunData &r) { const QmlBuildSystem *bs = static_cast<QmlBuildSystem *>(activeBuildSystem()); r.workingDirectory = bs->targetDirectory(); }); diff --git a/src/plugins/qnx/qnxrunconfiguration.cpp b/src/plugins/qnx/qnxrunconfiguration.cpp index 12ae568bddd..26616e4e252 100644 --- a/src/plugins/qnx/qnxrunconfiguration.cpp +++ b/src/plugins/qnx/qnxrunconfiguration.cpp @@ -16,6 +16,8 @@ #include <qtsupport/qtoutputformatter.h> +#include <utils/processinterface.h> + using namespace ProjectExplorer; using namespace RemoteLinux; using namespace Utils; @@ -57,7 +59,7 @@ public: symbolFile.setValue(localExecutable); }); - setRunnableModifier([this](Runnable &r) { + setRunnableModifier([this](ProcessRunData &r) { QString libPath = qtLibraries(); if (!libPath.isEmpty()) { r.environment.appendOrSet("LD_LIBRARY_PATH", libPath + "/lib:$LD_LIBRARY_PATH"); diff --git a/src/plugins/remotelinux/killappstep.cpp b/src/plugins/remotelinux/killappstep.cpp index c94f5a41e40..b70e597fb84 100644 --- a/src/plugins/remotelinux/killappstep.cpp +++ b/src/plugins/remotelinux/killappstep.cpp @@ -9,9 +9,10 @@ #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/runcontrol.h> +#include <projectexplorer/runconfiguration.h> #include <projectexplorer/target.h> +#include <utils/processinterface.h> #include <utils/qtcassert.h> using namespace ProjectExplorer; diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp index 478fc1b1b40..fd94144215c 100644 --- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp @@ -8,7 +8,6 @@ #include "remotelinuxenvironmentaspect.h" #include <projectexplorer/runconfigurationaspects.h> -#include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> #include <utils/hostosinfo.h> diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 37633d8f3ea..6e154f41aef 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -14,7 +14,6 @@ #include <projectexplorer/kitaspects.h> #include <projectexplorer/project.h> #include <projectexplorer/runconfigurationaspects.h> -#include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> #include <utils/hostosinfo.h> diff --git a/src/plugins/valgrind/callgrindengine.h b/src/plugins/valgrind/callgrindengine.h index d5d26e113a5..755c75d38c0 100644 --- a/src/plugins/valgrind/callgrindengine.h +++ b/src/plugins/valgrind/callgrindengine.h @@ -9,6 +9,7 @@ #include "callgrind/callgrindparser.h" #include <utils/process.h> +#include <utils/processinterface.h> namespace Valgrind { namespace Internal { @@ -74,7 +75,7 @@ private: bool m_markAsPaused = false; std::unique_ptr<Utils::Process> m_controllerProcess; - ProjectExplorer::Runnable m_valgrindRunnable; + Utils::ProcessRunData m_valgrindRunnable; qint64 m_pid = 0; Option m_lastOption = Unknown; diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index cc5aff5e987..599dec740b7 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -712,7 +712,7 @@ MemcheckToolPrivate::~MemcheckToolPrivate() void MemcheckToolPrivate::heobAction() { - Runnable sr; + ProcessRunData sr; Abi abi; bool hasLocalRc = false; Kit *kit = nullptr; diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp index 4b16f42efdf..a9c0669cd14 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -11,7 +11,7 @@ #include "xmlprotocol/status.h" #include "xmlprotocol/suppression.h" -#include <projectexplorer/runcontrol.h> +#include <utils/processinterface.h> #include <QFileInfo> #include <QTcpServer> @@ -507,7 +507,7 @@ void ValgrindMemcheckParserTest::testRealValgrind() fakeValgrindExecutable()); qDebug() << "running exe:" << executable << " HINT: set VALGRIND_TEST_BIN to change this"; - ProjectExplorer::Runnable debuggee; + ProcessRunData debuggee; debuggee.command.setExecutable(FilePath::fromString(executable)); debuggee.environment = sysEnv; ValgrindRunner runner; @@ -541,7 +541,7 @@ void ValgrindMemcheckParserTest::testValgrindStartError() QFETCH(QString, debuggee); QFETCH(QString, debuggeeArgs); - ProjectExplorer::Runnable debuggeeExecutable; + ProcessRunData debuggeeExecutable; debuggeeExecutable.command.setExecutable(FilePath::fromString(debuggee)); debuggeeExecutable.command.setArguments(debuggeeArgs); debuggeeExecutable.environment = Environment::systemEnvironment(); diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index e6502bb3e89..e39bdcf402e 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -6,11 +6,10 @@ #include "valgrindtr.h" #include "xmlprotocol/parser.h" -#include <projectexplorer/runcontrol.h> - #include <solutions/tasking/barrier.h> #include <utils/process.h> +#include <utils/processinterface.h> #include <utils/qtcassert.h> #include <QEventLoop> @@ -18,7 +17,6 @@ #include <QTcpSocket> #include <QTimer> -using namespace ProjectExplorer; using namespace Tasking; using namespace Utils; using namespace Valgrind::XmlProtocol; @@ -112,7 +110,7 @@ public: ValgrindRunner *q = nullptr; CommandLine m_valgrindCommand; - Runnable m_debuggee; + ProcessRunData m_debuggee; QProcess::ProcessChannelMode m_channelMode = QProcess::SeparateChannels; QHostAddress m_localServerAddress; bool m_useTerminal = false; @@ -237,7 +235,7 @@ void ValgrindRunner::setValgrindCommand(const CommandLine &command) d->m_valgrindCommand = command; } -void ValgrindRunner::setDebuggee(const Runnable &debuggee) +void ValgrindRunner::setDebuggee(const ProcessRunData &debuggee) { d->m_debuggee = debuggee; } diff --git a/src/plugins/valgrind/valgrindrunner.h b/src/plugins/valgrind/valgrindrunner.h index 508b896e3aa..1edbdf81515 100644 --- a/src/plugins/valgrind/valgrindrunner.h +++ b/src/plugins/valgrind/valgrindrunner.h @@ -11,8 +11,10 @@ QT_BEGIN_NAMESPACE class QHostAddress; QT_END_NAMESPACE -namespace Utils { class CommandLine; } -namespace ProjectExplorer { class Runnable; } +namespace Utils { +class CommandLine; +class ProcessRunData; +} namespace Valgrind { @@ -32,7 +34,7 @@ public: ~ValgrindRunner() override; void setValgrindCommand(const Utils::CommandLine &command); - void setDebuggee(const ProjectExplorer::Runnable &debuggee); + void setDebuggee(const Utils::ProcessRunData &debuggee); void setProcessChannelMode(QProcess::ProcessChannelMode mode); void setLocalServerAddress(const QHostAddress &localServerAddress); void setUseTerminal(bool on); diff --git a/src/plugins/valgrind/valgrindtestrunnertest.cpp b/src/plugins/valgrind/valgrindtestrunnertest.cpp index 09f316eea7b..e8678329ed8 100644 --- a/src/plugins/valgrind/valgrindtestrunnertest.cpp +++ b/src/plugins/valgrind/valgrindtestrunnertest.cpp @@ -9,10 +9,9 @@ #include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/projectexplorer.h> -#include <projectexplorer/runconfiguration.h> -#include <projectexplorer/runcontrol.h> #include <utils/algorithm.h> +#include <utils/processinterface.h> #include <QDebug> #include <QTest> @@ -55,7 +54,7 @@ QString ValgrindTestRunnerTest::runTestBinary(const QString &binary, const QStri if (!binPathFileInfo.isExecutable()) return QString(); - Runnable debuggee; + ProcessRunData debuggee; const QString &binPath = binPathFileInfo.canonicalFilePath(); debuggee.command.setExecutable(Utils::FilePath::fromString(binPath)); debuggee.environment = Utils::Environment::systemEnvironment(); From 8642dd3b682d0444a51951e415079fd99808172e Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 16 Aug 2023 17:15:52 +0200 Subject: [PATCH 0764/1777] CMake: Fix build for Windows The `env_with_default` function is part of Utils.cmake, which would need to be deployed. But it can't be part of QtCreatorAPIInternal.cmake due to its usage before the inclusion of QtCreatorAPIInternal.cmake in the main QtCreator CMakeLists.txt file. A sepparate function needs to do the task. Amends 1036c776f5b46558b54b36652bcbe1012f713840 Change-Id: I95344dd98c5fa0258303ed8d02855584a1945144 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- cmake/QtCreatorAPI.cmake | 2 +- cmake/QtCreatorAPIInternal.cmake | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 5d2a251f6ee..ce43bf6b8f5 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -37,7 +37,7 @@ list(APPEND DEFAULT_DEFINES # use CMAKE_CURRENT_FUNCTION_LIST_DIR when we can require CMake 3.17 set(_THIS_MODULE_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}") -env_with_default("QTC_WITH_CCACHE_SUPPORT" ENV_WITH_CCACHE_SUPPORT OFF) +qtc_env_with_default("QTC_WITH_CCACHE_SUPPORT" ENV_WITH_CCACHE_SUPPORT OFF) option(BUILD_PLUGINS_BY_DEFAULT "Build plugins by default. This can be used to build all plugins by default, or none." ON) option(BUILD_EXECUTABLES_BY_DEFAULT "Build executables by default. This can be used to build all executables by default, or none." ON) option(BUILD_LIBRARIES_BY_DEFAULT "Build libraries by default. This can be used to build all libraries by default, or none." ON) diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index a2fbd6f055d..c91f5779836 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -550,3 +550,12 @@ function(extend_qtc_target target_name) set_source_files_properties(${_arg_SOURCES} PROPERTIES ${_arg_SOURCES_PROPERTIES}) endif() endfunction() + +function (qtc_env_with_default envName varToSet default) + if(DEFINED ENV{${envName}}) + set(${varToSet} $ENV{${envName}} PARENT_SCOPE) + else() + set(${varToSet} ${default} PARENT_SCOPE) + endif() +endfunction() + From 8cf7ac4ac7631c8f12b2f8d88b1fa248c80c30f3 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 16 Aug 2023 18:20:46 +0200 Subject: [PATCH 0765/1777] Android: Avoid some cast for tool chains targetAbi() is available in the base and non-virtual. Change-Id: I1c65dccec98b7df5211b2ecfa1e91a4bb4b6e98f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/android/androidconfigurations.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index a4c73f8e6d6..1aff2e32c14 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -1131,9 +1131,7 @@ static bool matchToolChain(const ToolChain *atc, const ToolChain *btc) if (atc->typeId() != Constants::ANDROID_TOOLCHAIN_TYPEID || btc->typeId() != Constants::ANDROID_TOOLCHAIN_TYPEID) return false; - auto aatc = static_cast<const AndroidToolChain *>(atc); - auto abtc = static_cast<const AndroidToolChain *>(btc); - return aatc->targetAbi() == abtc->targetAbi(); + return atc->targetAbi() == btc->targetAbi(); } void AndroidConfigurations::registerNewToolChains() From f4eb25ccec252a1e97a5f0827ce5a1dc720eb86d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 20:08:48 +0200 Subject: [PATCH 0766/1777] Process: Add setRunData() helper It allows to set command/workingDir/env in one go. Fix condition for setCommand() to match the one for setWorkingDir(). Change-Id: I0aa4639f3357c387a0fe8da321e94e34a3ea232d Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/process.cpp | 17 ++++++++++++++++- src/libs/utils/process.h | 31 ++++++++++++++++++------------- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/libs/utils/process.cpp b/src/libs/utils/process.cpp index 8721d6c4214..01e3b7747af 100644 --- a/src/libs/utils/process.cpp +++ b/src/libs/utils/process.cpp @@ -1183,10 +1183,25 @@ const Environment &Process::controlEnvironment() const return d->m_setup.m_controlEnvironment; } +void Process::setRunData(const ProcessRunData &data) +{ + if (data.workingDirectory.needsDevice() && data.command.executable().needsDevice()) { + QTC_CHECK(data.workingDirectory.isSameDevice(data.command.executable())); + } + d->m_setup.m_commandLine = data.command; + d->m_setup.m_workingDirectory = data.workingDirectory; + d->m_setup.m_environment = data.environment; +} + +ProcessRunData Process::runData() const +{ + return {d->m_setup.m_commandLine, d->m_setup.m_workingDirectory, d->m_setup.m_environment}; +} + void Process::setCommand(const CommandLine &cmdLine) { if (d->m_setup.m_workingDirectory.needsDevice() && cmdLine.executable().needsDevice()) { - QTC_CHECK(d->m_setup.m_workingDirectory.host() == cmdLine.executable().host()); + QTC_CHECK(d->m_setup.m_workingDirectory.isSameDevice(cmdLine.executable())); } d->m_setup.m_commandLine = cmdLine; } diff --git a/src/libs/utils/process.h b/src/libs/utils/process.h index 83f1bb990b4..016d80e3279 100644 --- a/src/libs/utils/process.h +++ b/src/libs/utils/process.h @@ -30,6 +30,7 @@ class Environment; class DeviceProcessHooks; class ProcessInterface; class ProcessResultData; +class ProcessRunData; class QTCREATOR_UTILS_EXPORT Process final : public QObject { @@ -78,6 +79,21 @@ public: // ProcessSetupData related + void setRunData(const ProcessRunData &data); + ProcessRunData runData() const; + + void setCommand(const CommandLine &cmdLine); + const CommandLine &commandLine() const; + + void setWorkingDirectory(const FilePath &dir); + FilePath workingDirectory() const; + + void setEnvironment(const Environment &env); // Main process + const Environment &environment() const; + + void setControlEnvironment(const Environment &env); // Possible helper process (ssh on host etc) + const Environment &controlEnvironment() const; + void setProcessImpl(ProcessImpl processImpl); void setPtyData(const std::optional<Pty::Data> &data); @@ -90,18 +106,6 @@ public: void setProcessMode(ProcessMode processMode); ProcessMode processMode() const; - void setEnvironment(const Environment &env); // Main process - const Environment &environment() const; - - void setControlEnvironment(const Environment &env); // Possible helper process (ssh on host etc) - const Environment &controlEnvironment() const; - - void setCommand(const CommandLine &cmdLine); - const CommandLine &commandLine() const; - - void setWorkingDirectory(const FilePath &dir); - FilePath workingDirectory() const; - void setWriteData(const QByteArray &writeData); void setUseCtrlCStub(bool enabled); // release only @@ -111,8 +115,9 @@ public: bool isRunAsRoot() const; void setAbortOnMetaChars(bool abort); - QProcess::ProcessChannelMode processChannelMode() const; void setProcessChannelMode(QProcess::ProcessChannelMode mode); + QProcess::ProcessChannelMode processChannelMode() const; + void setStandardInputFile(const QString &inputFile); void setExtraData(const QString &key, const QVariant &value); From e8510501d85e17f69bd1a32270f527257044ae67 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 22:43:41 +0200 Subject: [PATCH 0767/1777] Valgrind: Fix includes Change-Id: I30248edc9f536cd3865799dd0b56c1360e72aa2f Reviewed-by: hjk <hjk@qt.io> --- .../valgrind/callgrind/callgrindcostitem.cpp | 2 - .../callgrind/callgrindcycledetection.cpp | 4 +- .../valgrind/callgrind/callgrinddatamodel.cpp | 4 -- .../valgrind/callgrind/callgrindfunction.cpp | 6 +-- .../callgrind/callgrindfunctioncycle.cpp | 5 +-- .../valgrind/callgrind/callgrindparsedata.cpp | 1 - .../valgrind/callgrind/callgrindparser.cpp | 5 +-- .../callgrind/callgrindproxymodel.cpp | 2 - .../valgrind/callgrindcostdelegate.cpp | 3 +- src/plugins/valgrind/callgrindcostview.cpp | 10 +---- src/plugins/valgrind/callgrindengine.cpp | 9 +--- src/plugins/valgrind/callgrindtextmark.cpp | 5 +-- src/plugins/valgrind/callgrindtool.cpp | 41 ++++++++----------- .../valgrind/callgrindvisualisation.cpp | 10 ++--- src/plugins/valgrind/memcheckerrorview.cpp | 1 - src/plugins/valgrind/memchecktool.cpp | 34 ++++++--------- src/plugins/valgrind/valgrindengine.cpp | 8 +--- src/plugins/valgrind/valgrindengine.h | 2 +- src/plugins/valgrind/valgrindsettings.cpp | 9 +--- .../valgrind/valgrindtestrunnertest.cpp | 9 +--- .../valgrind/xmlprotocol/errorlistmodel.cpp | 4 +- .../valgrind/xmlprotocol/stackmodel.cpp | 3 -- 22 files changed, 51 insertions(+), 126 deletions(-) diff --git a/src/plugins/valgrind/callgrind/callgrindcostitem.cpp b/src/plugins/valgrind/callgrind/callgrindcostitem.cpp index 40aa56de31e..d6fa4f99013 100644 --- a/src/plugins/valgrind/callgrind/callgrindcostitem.cpp +++ b/src/plugins/valgrind/callgrind/callgrindcostitem.cpp @@ -6,8 +6,6 @@ #include "callgrindparsedata.h" #include "callgrindfunctioncall.h" -#include <QList> -#include <QString> #include <QStringList> namespace Valgrind::Callgrind { diff --git a/src/plugins/valgrind/callgrind/callgrindcycledetection.cpp b/src/plugins/valgrind/callgrind/callgrindcycledetection.cpp index c32e0ec9b7b..68f6964c344 100644 --- a/src/plugins/valgrind/callgrind/callgrindcycledetection.cpp +++ b/src/plugins/valgrind/callgrind/callgrindcycledetection.cpp @@ -5,13 +5,11 @@ #include "callgrindfunction.h" #include "callgrindfunctioncall.h" -#include "callgrindparsedata.h" #include "callgrindfunctioncycle.h" +#include "callgrindparsedata.h" #include <utils/qtcassert.h> -#include <QDebug> - namespace Valgrind::Callgrind::Internal { CycleDetection::CycleDetection(ParseData *data) diff --git a/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp b/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp index 49d26262471..a623a6a8c98 100644 --- a/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp +++ b/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp @@ -11,11 +11,7 @@ #include <utils/algorithm.h> #include <utils/qtcassert.h> -#include <QChar> -#include <QDebug> -#include <QList> #include <QStringList> -#include <QTextDocument> namespace Valgrind { namespace Callgrind { diff --git a/src/plugins/valgrind/callgrind/callgrindfunction.cpp b/src/plugins/valgrind/callgrind/callgrindfunction.cpp index 0ec72d095d8..4015ae7d5b9 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunction.cpp +++ b/src/plugins/valgrind/callgrind/callgrindfunction.cpp @@ -2,20 +2,16 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "callgrindfunction.h" -#include "callgrindfunction_p.h" #include "callgrindcostitem.h" +#include "callgrindfunction_p.h" #include "callgrindfunctioncall.h" #include "callgrindparsedata.h" #include "../valgrindtr.h" #include <utils/qtcassert.h> -#include <QString> -#include <QStringList> -#include <QDebug> #include <QFileInfo> -#include <QCoreApplication> namespace Valgrind { namespace Callgrind { diff --git a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp index f4d3fdfdedc..64dd7374bcb 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp +++ b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp @@ -2,14 +2,11 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "callgrindfunctioncycle.h" -#include "callgrindfunction_p.h" +#include "callgrindfunction_p.h" #include "callgrindfunctioncall.h" #include "callgrindparsedata.h" -#include <QStringList> -#include <QDebug> - namespace Valgrind { namespace Callgrind { diff --git a/src/plugins/valgrind/callgrind/callgrindparsedata.cpp b/src/plugins/valgrind/callgrind/callgrindparsedata.cpp index 7b7f2a3e672..62fc8a7cd2f 100644 --- a/src/plugins/valgrind/callgrind/callgrindparsedata.cpp +++ b/src/plugins/valgrind/callgrind/callgrindparsedata.cpp @@ -10,7 +10,6 @@ #include <utils/qtcassert.h> -#include <QCoreApplication> #include <QHash> #include <QStringList> diff --git a/src/plugins/valgrind/callgrind/callgrindparser.cpp b/src/plugins/valgrind/callgrind/callgrindparser.cpp index 434e7751083..58964172306 100644 --- a/src/plugins/valgrind/callgrind/callgrindparser.cpp +++ b/src/plugins/valgrind/callgrind/callgrindparser.cpp @@ -3,10 +3,10 @@ #include "callgrindparser.h" -#include "callgrindparsedata.h" -#include "callgrindfunctioncall.h" #include "callgrindcostitem.h" #include "callgrindfunction.h" +#include "callgrindfunctioncall.h" +#include "callgrindparsedata.h" #include <utils/filepath.h> #include <utils/qtcassert.h> @@ -14,7 +14,6 @@ #include <QDebug> #include <QHash> -#include <QList> #include <QStringList> // #define DEBUG_PARSER diff --git a/src/plugins/valgrind/callgrind/callgrindproxymodel.cpp b/src/plugins/valgrind/callgrind/callgrindproxymodel.cpp index 9d0c8353e6d..3ba426a93d3 100644 --- a/src/plugins/valgrind/callgrind/callgrindproxymodel.cpp +++ b/src/plugins/valgrind/callgrind/callgrindproxymodel.cpp @@ -10,8 +10,6 @@ #include <utils/qtcassert.h> -#include <QDebug> - namespace Valgrind { namespace Callgrind { diff --git a/src/plugins/valgrind/callgrindcostdelegate.cpp b/src/plugins/valgrind/callgrindcostdelegate.cpp index e6afe5df32f..e6ca54756c8 100644 --- a/src/plugins/valgrind/callgrindcostdelegate.cpp +++ b/src/plugins/valgrind/callgrindcostdelegate.cpp @@ -3,9 +3,8 @@ #include "callgrindcostdelegate.h" -#include "callgrindhelper.h" - #include "callgrind/callgrindabstractmodel.h" +#include "callgrindhelper.h" #include <utils/qtcassert.h> diff --git a/src/plugins/valgrind/callgrindcostview.cpp b/src/plugins/valgrind/callgrindcostview.cpp index 3d54a99c295..4181abf6a99 100644 --- a/src/plugins/valgrind/callgrindcostview.cpp +++ b/src/plugins/valgrind/callgrindcostview.cpp @@ -3,17 +3,11 @@ #include "callgrindcostview.h" +#include "callgrind/callgrinddatamodel.h" +#include "callgrind/callgrindcallmodel.h" #include "callgrindnamedelegate.h" -#include <valgrind/callgrind/callgrindabstractmodel.h> -#include <valgrind/callgrind/callgrinddatamodel.h> -#include <valgrind/callgrind/callgrindfunction.h> -#include <valgrind/callgrind/callgrindcallmodel.h> - #include <QAbstractProxyModel> -#include <QContextMenuEvent> -#include <QMenu> -#include <QDebug> using namespace Valgrind::Callgrind; diff --git a/src/plugins/valgrind/callgrindengine.cpp b/src/plugins/valgrind/callgrindengine.cpp index 192174c6e54..3d86b192db6 100644 --- a/src/plugins/valgrind/callgrindengine.cpp +++ b/src/plugins/valgrind/callgrindengine.cpp @@ -3,11 +3,8 @@ #include "callgrindengine.h" -#include "valgrindsettings.h" - -#include <valgrind/callgrind/callgrindparser.h> -#include <valgrind/valgrindrunner.h> -#include <valgrind/valgrindtr.h> +#include "callgrind/callgrindparser.h" +#include "valgrindtr.h" #include <debugger/analyzer/analyzermanager.h> @@ -17,8 +14,6 @@ #include <utils/qtcassert.h> #include <utils/temporaryfile.h> -#include <QDebug> - #define CALLGRIND_CONTROL_DEBUG 0 using namespace ProjectExplorer; diff --git a/src/plugins/valgrind/callgrindtextmark.cpp b/src/plugins/valgrind/callgrindtextmark.cpp index 07b6af16c24..39cbf3803a5 100644 --- a/src/plugins/valgrind/callgrindtextmark.cpp +++ b/src/plugins/valgrind/callgrindtextmark.cpp @@ -3,18 +3,15 @@ #include "callgrindtextmark.h" -#include "callgrindhelper.h" - #include "callgrind/callgrinddatamodel.h" #include "callgrind/callgrindfunction.h" +#include "callgrindhelper.h" #include "valgrindtr.h" #include <utils/qtcassert.h> -#include <QDebug> #include <QLabel> #include <QLayout> -#include <QPainter> using namespace Utils; using namespace Valgrind::Internal; diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index fb16a4441ef..219fe800bc1 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -3,30 +3,22 @@ #include "callgrindtool.h" +#include "callgrind/callgrindcallmodel.h" +#include "callgrind/callgrinddatamodel.h" +#include "callgrind/callgrindfunction.h" +#include "callgrind/callgrindfunctioncall.h" +#include "callgrind/callgrindparsedata.h" +#include "callgrind/callgrindparser.h" +#include "callgrind/callgrindproxymodel.h" +#include "callgrind/callgrindstackbrowser.h" #include "callgrindcostdelegate.h" #include "callgrindcostview.h" #include "callgrindengine.h" #include "callgrindtextmark.h" #include "callgrindvisualisation.h" +#include "valgrindsettings.h" #include "valgrindtr.h" -#include <valgrind/callgrind/callgrindcallmodel.h> -#include <valgrind/callgrind/callgrindcostitem.h> -#include <valgrind/callgrind/callgrinddatamodel.h> -#include <valgrind/callgrind/callgrindfunction.h> -#include <valgrind/callgrind/callgrindfunctioncall.h> -#include <valgrind/callgrind/callgrindparsedata.h> -#include <valgrind/callgrind/callgrindparser.h> -#include <valgrind/callgrind/callgrindproxymodel.h> -#include <valgrind/callgrind/callgrindstackbrowser.h> -#include <valgrind/valgrindsettings.h> - -#include <debugger/debuggerconstants.h> -#include <debugger/analyzer/analyzerconstants.h> -#include <debugger/analyzer/analyzermanager.h> -#include <debugger/analyzer/analyzerutils.h> -#include <debugger/analyzer/startremotedialog.h> - #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/command.h> @@ -39,10 +31,10 @@ #include <cppeditor/cppeditorconstants.h> -#include <extensionsystem/pluginmanager.h> - -#include <texteditor/texteditor.h> -#include <texteditor/textdocument.h> +#include <debugger/debuggerconstants.h> +#include <debugger/analyzer/analyzermanager.h> +#include <debugger/analyzer/analyzerutils.h> +#include <debugger/analyzer/startremotedialog.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> @@ -51,23 +43,22 @@ #include <projectexplorer/projecttree.h> #include <projectexplorer/taskhub.h> -#include <utils/fancymainwindow.h> +#include <texteditor/texteditor.h> +#include <texteditor/textdocument.h> + #include <utils/process.h> #include <utils/qtcassert.h> -#include <utils/styledbar.h> #include <utils/utilsicons.h> #include <QAction> #include <QActionGroup> #include <QComboBox> #include <QFile> -#include <QFileDialog> #include <QFileInfo> #include <QLineEdit> #include <QMenu> #include <QSortFilterProxyModel> #include <QTimer> -#include <QToolBar> #include <QToolButton> using namespace Debugger; diff --git a/src/plugins/valgrind/callgrindvisualisation.cpp b/src/plugins/valgrind/callgrindvisualisation.cpp index d0673bbf849..93d129ae48c 100644 --- a/src/plugins/valgrind/callgrindvisualisation.cpp +++ b/src/plugins/valgrind/callgrindvisualisation.cpp @@ -3,22 +3,18 @@ #include "callgrindvisualisation.h" +#include "callgrind/callgrinddatamodel.h" +#include "callgrind/callgrindfunction.h" +#include "callgrind/callgrindproxymodel.h" #include "callgrindhelper.h" #include "valgrindtr.h" -#include <valgrind/callgrind/callgrindabstractmodel.h> -#include <valgrind/callgrind/callgrinddatamodel.h> -#include <valgrind/callgrind/callgrindfunction.h> -#include <valgrind/callgrind/callgrindproxymodel.h> - #include <utils/qtcassert.h> #include <QAbstractItemModel> -#include <QDebug> #include <QGraphicsRectItem> #include <QGraphicsScene> #include <QGraphicsSimpleTextItem> -#include <QList> #include <QMouseEvent> #include <QPair> #include <QStaticText> diff --git a/src/plugins/valgrind/memcheckerrorview.cpp b/src/plugins/valgrind/memcheckerrorview.cpp index ef6ab2856e1..695a1446faa 100644 --- a/src/plugins/valgrind/memcheckerrorview.cpp +++ b/src/plugins/valgrind/memcheckerrorview.cpp @@ -5,7 +5,6 @@ #include "valgrindsettings.h" #include "valgrindtr.h" - #include "xmlprotocol/error.h" #include "xmlprotocol/errorlistmodel.h" #include "xmlprotocol/frame.h" diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 599dec740b7..5f5a82df832 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -16,6 +16,14 @@ #include "xmlprotocol/parser.h" #include "xmlprotocol/stack.h" +#include <coreplugin/actionmanager/actioncontainer.h> +#include <coreplugin/actionmanager/actionmanager.h> +#include <coreplugin/actionmanager/command.h> +#include <coreplugin/editormanager/editormanager.h> +#include <coreplugin/helpmanager.h> +#include <coreplugin/icore.h> +#include <coreplugin/modemanager.h> + #include <debugger/debuggerkitaspect.h> #include <debugger/debuggerruncontrol.h> #include <debugger/analyzer/analyzerconstants.h> @@ -35,19 +43,7 @@ #include <projectexplorer/taskhub.h> #include <projectexplorer/toolchain.h> -#include <extensionsystem/iplugin.h> -#include <extensionsystem/pluginmanager.h> - -#include <coreplugin/actionmanager/actioncontainer.h> -#include <coreplugin/actionmanager/actionmanager.h> -#include <coreplugin/actionmanager/command.h> -#include <coreplugin/editormanager/editormanager.h> -#include <coreplugin/helpmanager.h> -#include <coreplugin/icore.h> -#include <coreplugin/modemanager.h> - #include <utils/checkablemessagebox.h> -#include <utils/fancymainwindow.h> #include <utils/pathchooser.h> #include <utils/process.h> #include <utils/qtcassert.h> @@ -55,22 +51,20 @@ #include <utils/utilsicons.h> #include <QAction> +#include <QCheckBox> +#include <QComboBox> #include <QFile> -#include <QFileDialog> #include <QFileInfo> #include <QHostAddress> #include <QInputDialog> #include <QLabel> -#include <QMenu> -#include <QToolButton> -#include <QSortFilterProxyModel> - -#include <QCheckBox> -#include <QComboBox> #include <QLineEdit> +#include <QMenu> #include <QPushButton> #include <QSpinBox> #include <QStandardPaths> +#include <QToolButton> +#include <QSortFilterProxyModel> #include <QVBoxLayout> #ifdef Q_OS_WIN @@ -1161,7 +1155,6 @@ MemcheckToolRunner::MemcheckToolRunner(RunControl *runControl) this, &MemcheckToolRunner::startDebugger); connect(&m_runner, &ValgrindRunner::logMessageReceived, this, &MemcheckToolRunner::appendLog); -// m_runner.disableXml(); } else { connect(&m_runner, &ValgrindRunner::internalError, this, &MemcheckToolRunner::internalParserError); @@ -1177,7 +1170,6 @@ MemcheckToolRunner::MemcheckToolRunner(RunControl *runControl) dd->setupRunner(this); } - const char heobProfileC[] = "Heob/Profile"; const char heobProfileNameC[] = "Name"; const char heobXmlC[] = "Xml"; diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index 0b6abb771f9..4af25d2c7ca 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -6,23 +6,19 @@ #include "valgrindsettings.h" #include "valgrindtr.h" -#include <debugger/analyzer/analyzermanager.h> - #include <coreplugin/icore.h> #include <coreplugin/ioutputpane.h> -#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/futureprogress.h> +#include <coreplugin/progressmanager/progressmanager.h> + #include <extensionsystem/pluginmanager.h> #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/kitaspects.h> #include <projectexplorer/projectexplorericons.h> -#include <projectexplorer/runconfiguration.h> -#include <projectexplorer/runconfigurationaspects.h> #include <QApplication> -using namespace Debugger; using namespace Core; using namespace Utils; using namespace ProjectExplorer; diff --git a/src/plugins/valgrind/valgrindengine.h b/src/plugins/valgrind/valgrindengine.h index d8c5a0ae690..5644e92d9b7 100644 --- a/src/plugins/valgrind/valgrindengine.h +++ b/src/plugins/valgrind/valgrindengine.h @@ -3,10 +3,10 @@ #pragma once +#include "valgrindrunner.h" #include "valgrindsettings.h" #include <projectexplorer/runcontrol.h> -#include <valgrind/valgrindrunner.h> #include <QFutureInterface> diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 3f81f05b20d..6c23677face 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -5,26 +5,21 @@ #include "callgrindcostdelegate.h" #include "valgrindtr.h" - -#include <coreplugin/icore.h> +#include "xmlprotocol/error.h" #include <coreplugin/dialogs/ioptionspage.h> + #include <debugger/analyzer/analyzericons.h> #include <debugger/debuggertr.h> #include <utils/algorithm.h> #include <utils/layoutbuilder.h> #include <utils/qtcassert.h> -#include <utils/treemodel.h> #include <utils/utilsicons.h> -#include <valgrind/xmlprotocol/error.h> - -#include <QDebug> #include <QListView> #include <QMetaEnum> #include <QPushButton> -#include <QSettings> #include <QStandardItemModel> using namespace Utils; diff --git a/src/plugins/valgrind/valgrindtestrunnertest.cpp b/src/plugins/valgrind/valgrindtestrunnertest.cpp index e8678329ed8..5ae6ee04179 100644 --- a/src/plugins/valgrind/valgrindtestrunnertest.cpp +++ b/src/plugins/valgrind/valgrindtestrunnertest.cpp @@ -3,24 +3,19 @@ #include "valgrindtestrunnertest.h" +#include "valgrindrunner.h" #include "xmlprotocol/frame.h" #include "xmlprotocol/stack.h" -#include "valgrindrunner.h" - -#include <projectexplorer/devicesupport/devicemanager.h> -#include <projectexplorer/projectexplorer.h> #include <utils/algorithm.h> #include <utils/processinterface.h> #include <QDebug> -#include <QTest> #include <QDir> -#include <QSignalSpy> +#include <QTest> #define HEADER_LENGTH 3 -using namespace ProjectExplorer; using namespace Valgrind::XmlProtocol; using namespace Utils; diff --git a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp index 96c1819b284..34276dc54c1 100644 --- a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp +++ b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp @@ -8,14 +8,12 @@ #include "../valgrindtr.h" #include <debugger/analyzer/diagnosticlocation.h> + #include <utils/qtcassert.h> -#include <QCoreApplication> #include <QDir> #include <QList> -#include <cmath> - namespace Valgrind { namespace XmlProtocol { diff --git a/src/plugins/valgrind/xmlprotocol/stackmodel.cpp b/src/plugins/valgrind/xmlprotocol/stackmodel.cpp index 535ceb38f9b..1027456b8c7 100644 --- a/src/plugins/valgrind/xmlprotocol/stackmodel.cpp +++ b/src/plugins/valgrind/xmlprotocol/stackmodel.cpp @@ -9,9 +9,6 @@ #include <utils/qtcassert.h> -#include <QDir> -#include <QList> - namespace Valgrind { namespace XmlProtocol { From 1d5102781d0035c5a3ea72eee8a05531563fd0dc Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 23:17:10 +0200 Subject: [PATCH 0768/1777] Valgrind: Rename ValgrindRunner -> ValgrindProcess Change-Id: I5e7d704c749e53672915c5f7aab64abb68353f24 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/callgrindengine.cpp | 4 +- src/plugins/valgrind/memchecktool.cpp | 10 ++--- src/plugins/valgrind/valgrindengine.cpp | 6 +-- src/plugins/valgrind/valgrindengine.h | 2 +- .../valgrind/valgrindmemcheckparsertest.cpp | 18 ++++----- src/plugins/valgrind/valgrindrunner.cpp | 40 +++++++++---------- src/plugins/valgrind/valgrindrunner.h | 10 ++--- .../valgrind/valgrindtestrunnertest.cpp | 10 ++--- src/plugins/valgrind/valgrindtestrunnertest.h | 4 +- tests/auto/valgrind/memcheck/modeldemo.cpp | 8 ++-- tests/auto/valgrind/memcheck/modeldemo.h | 4 +- 11 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/plugins/valgrind/callgrindengine.cpp b/src/plugins/valgrind/callgrindengine.cpp index 3d86b192db6..189da274db6 100644 --- a/src/plugins/valgrind/callgrindengine.cpp +++ b/src/plugins/valgrind/callgrindengine.cpp @@ -32,10 +32,10 @@ CallgrindToolRunner::CallgrindToolRunner(RunControl *runControl) { setId("CallgrindToolRunner"); - connect(&m_runner, &ValgrindRunner::valgrindStarted, this, [this](qint64 pid) { + connect(&m_runner, &ValgrindProcess::valgrindStarted, this, [this](qint64 pid) { m_pid = pid; }); - connect(&m_runner, &ValgrindRunner::done, this, [this] { + connect(&m_runner, &ValgrindProcess::done, this, [this] { triggerParse(); emit parserDataReady(this); }); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 5f5a82df832..6606af2edfc 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -169,7 +169,7 @@ void MemcheckToolRunner::start() void MemcheckToolRunner::stop() { - disconnect(&m_runner, &ValgrindRunner::internalError, + disconnect(&m_runner, &ValgrindProcess::internalError, this, &MemcheckToolRunner::internalParserError); ValgrindToolRunner::stop(); } @@ -1148,15 +1148,15 @@ MemcheckToolRunner::MemcheckToolRunner(RunControl *runControl) m_localServerAddress(QHostAddress::LocalHost) { setId("MemcheckToolRunner"); - connect(&m_runner, &ValgrindRunner::error, this, &MemcheckToolRunner::parserError); + connect(&m_runner, &ValgrindProcess::error, this, &MemcheckToolRunner::parserError); if (m_withGdb) { - connect(&m_runner, &ValgrindRunner::valgrindStarted, + connect(&m_runner, &ValgrindProcess::valgrindStarted, this, &MemcheckToolRunner::startDebugger); - connect(&m_runner, &ValgrindRunner::logMessageReceived, + connect(&m_runner, &ValgrindProcess::logMessageReceived, this, &MemcheckToolRunner::appendLog); } else { - connect(&m_runner, &ValgrindRunner::internalError, + connect(&m_runner, &ValgrindProcess::internalError, this, &MemcheckToolRunner::internalParserError); } diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index 4af25d2c7ca..8254f9284bd 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -33,11 +33,11 @@ ValgrindToolRunner::ValgrindToolRunner(RunControl *runControl) m_settings.fromMap(runControl->settingsData(ANALYZER_VALGRIND_SETTINGS)); - connect(&m_runner, &ValgrindRunner::appendMessage, this, + connect(&m_runner, &ValgrindProcess::appendMessage, this, [this](const QString &msg, Utils::OutputFormat format) { appendMessage(msg, format); }); - connect(&m_runner, &ValgrindRunner::processErrorReceived, + connect(&m_runner, &ValgrindProcess::processErrorReceived, this, &ValgrindToolRunner::receiveProcessError); - connect(&m_runner, &ValgrindRunner::done, + connect(&m_runner, &ValgrindProcess::done, this, &ValgrindToolRunner::runnerFinished); } diff --git a/src/plugins/valgrind/valgrindengine.h b/src/plugins/valgrind/valgrindengine.h index 5644e92d9b7..9325d11e245 100644 --- a/src/plugins/valgrind/valgrindengine.h +++ b/src/plugins/valgrind/valgrindengine.h @@ -26,7 +26,7 @@ protected: ValgrindSettings m_settings{false}; QFutureInterface<void> m_progress; - ValgrindRunner m_runner; + ValgrindProcess m_runner; private: void handleProgressCanceled(); diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp index a9c0669cd14..bef03884a91 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -77,22 +77,22 @@ public: class RunnerDumper : public QObject { public: - explicit RunnerDumper(ValgrindRunner *runner) + explicit RunnerDumper(ValgrindProcess *runner) { - connect(runner, &ValgrindRunner::error, this, [](const Error &err) { + connect(runner, &ValgrindProcess::error, this, [](const Error &err) { qDebug() << "error received"; dumpError(err); }); - connect(runner, &ValgrindRunner::internalError, this, [](const QString &err) { + connect(runner, &ValgrindProcess::internalError, this, [](const QString &err) { qDebug() << "internal error received:" << err; }); - connect(runner, &ValgrindRunner::status, this, [](const Status &status) { + connect(runner, &ValgrindProcess::status, this, [](const Status &status) { qDebug() << "status received:" << status.state() << status.time(); }); - connect(runner, &ValgrindRunner::logMessageReceived, this, [](const QByteArray &log) { + connect(runner, &ValgrindProcess::logMessageReceived, this, [](const QByteArray &log) { qDebug() << "log message received:" << log; }); - connect(runner, &ValgrindRunner::processErrorReceived, this, [this](const QString &) { + connect(runner, &ValgrindProcess::processErrorReceived, this, [this](const QString &) { m_errorReceived = true; }); } @@ -486,7 +486,7 @@ void ValgrindMemcheckParserTest::testValgrindGarbage() void ValgrindMemcheckParserTest::testParserStop() { - ValgrindRunner runner; + ValgrindProcess runner; runner.setValgrindCommand({FilePath::fromString(fakeValgrindExecutable()), {QString("--xml-socket=127.0.0.1:%1").arg(m_server->serverPort()), "-i", dataFile("memcheck-output-sample1.xml"), "--wait", "5" }}); @@ -510,7 +510,7 @@ void ValgrindMemcheckParserTest::testRealValgrind() ProcessRunData debuggee; debuggee.command.setExecutable(FilePath::fromString(executable)); debuggee.environment = sysEnv; - ValgrindRunner runner; + ValgrindProcess runner; runner.setValgrindCommand({"valgrind", {}}); runner.setDebuggee(debuggee); RunnerDumper dumper(&runner); @@ -546,7 +546,7 @@ void ValgrindMemcheckParserTest::testValgrindStartError() debuggeeExecutable.command.setArguments(debuggeeArgs); debuggeeExecutable.environment = Environment::systemEnvironment(); - ValgrindRunner runner; + ValgrindProcess runner; runner.setValgrindCommand({FilePath::fromString(valgrindExe), valgrindArgs}); runner.setDebuggee(debuggeeExecutable); RunnerDumper dumper(&runner); diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index e39bdcf402e..84cbd4a83b4 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -57,10 +57,10 @@ static CommandLine valgrindCommand(const CommandLine &command, return cmd; } -class ValgrindRunnerPrivate : public QObject +class ValgrindProcessPrivate : public QObject { public: - ValgrindRunnerPrivate(ValgrindRunner *owner) + ValgrindProcessPrivate(ValgrindProcess *owner) : q(owner) {} @@ -107,7 +107,7 @@ public: bool run(); - ValgrindRunner *q = nullptr; + ValgrindProcess *q = nullptr; CommandLine m_valgrindCommand; ProcessRunData m_debuggee; @@ -118,7 +118,7 @@ public: std::unique_ptr<TaskTree> m_taskTree; }; -Group ValgrindRunnerPrivate::runRecipe() const +Group ValgrindProcessPrivate::runRecipe() const { struct ValgrindStorage { CommandLine m_valgrindCommand; @@ -185,8 +185,8 @@ Group ValgrindRunnerPrivate::runRecipe() const }; const auto onParserSetup = [this, storage](Parser &parser) { - connect(&parser, &Parser::status, q, &ValgrindRunner::status); - connect(&parser, &Parser::error, q, &ValgrindRunner::error); + connect(&parser, &Parser::status, q, &ValgrindProcess::status); + connect(&parser, &Parser::error, q, &ValgrindProcess::error); parser.setSocket(storage->m_xmlSocket.release()); }; @@ -209,7 +209,7 @@ Group ValgrindRunnerPrivate::runRecipe() const return root; } -bool ValgrindRunnerPrivate::run() +bool ValgrindProcessPrivate::run() { m_taskTree.reset(new TaskTree); m_taskTree->setRecipe(runRecipe()); @@ -223,49 +223,49 @@ bool ValgrindRunnerPrivate::run() return bool(m_taskTree); } -ValgrindRunner::ValgrindRunner(QObject *parent) +ValgrindProcess::ValgrindProcess(QObject *parent) : QObject(parent) - , d(new ValgrindRunnerPrivate(this)) + , d(new ValgrindProcessPrivate(this)) {} -ValgrindRunner::~ValgrindRunner() = default; +ValgrindProcess::~ValgrindProcess() = default; -void ValgrindRunner::setValgrindCommand(const CommandLine &command) +void ValgrindProcess::setValgrindCommand(const CommandLine &command) { d->m_valgrindCommand = command; } -void ValgrindRunner::setDebuggee(const ProcessRunData &debuggee) +void ValgrindProcess::setDebuggee(const ProcessRunData &debuggee) { d->m_debuggee = debuggee; } -void ValgrindRunner::setProcessChannelMode(QProcess::ProcessChannelMode mode) +void ValgrindProcess::setProcessChannelMode(QProcess::ProcessChannelMode mode) { d->m_channelMode = mode; } -void ValgrindRunner::setLocalServerAddress(const QHostAddress &localServerAddress) +void ValgrindProcess::setLocalServerAddress(const QHostAddress &localServerAddress) { d->m_localServerAddress = localServerAddress; } -void ValgrindRunner::setUseTerminal(bool on) +void ValgrindProcess::setUseTerminal(bool on) { d->m_useTerminal = on; } -bool ValgrindRunner::start() +bool ValgrindProcess::start() { return d->run(); } -void ValgrindRunner::stop() +void ValgrindProcess::stop() { d->m_taskTree.reset(); } -bool ValgrindRunner::runBlocking() +bool ValgrindProcess::runBlocking() { bool ok = false; QEventLoop loop; @@ -276,8 +276,8 @@ bool ValgrindRunner::runBlocking() QMetaObject::invokeMethod(&loop, [&loop] { loop.quit(); }, Qt::QueuedConnection); }; - connect(this, &ValgrindRunner::done, &loop, finalize); - QTimer::singleShot(0, this, &ValgrindRunner::start); + connect(this, &ValgrindProcess::done, &loop, finalize); + QTimer::singleShot(0, this, &ValgrindProcess::start); loop.exec(QEventLoop::ExcludeUserInputEvents); return ok; } diff --git a/src/plugins/valgrind/valgrindrunner.h b/src/plugins/valgrind/valgrindrunner.h index 1edbdf81515..0e71a529c50 100644 --- a/src/plugins/valgrind/valgrindrunner.h +++ b/src/plugins/valgrind/valgrindrunner.h @@ -23,15 +23,15 @@ class Error; class Status; } -class ValgrindRunnerPrivate; +class ValgrindProcessPrivate; -class ValgrindRunner : public QObject +class ValgrindProcess : public QObject { Q_OBJECT public: - explicit ValgrindRunner(QObject *parent = nullptr); - ~ValgrindRunner() override; + explicit ValgrindProcess(QObject *parent = nullptr); + ~ValgrindProcess() override; void setValgrindCommand(const Utils::CommandLine &command); void setDebuggee(const Utils::ProcessRunData &debuggee); @@ -56,7 +56,7 @@ signals: void internalError(const QString &errorString); private: - std::unique_ptr<ValgrindRunnerPrivate> d; + std::unique_ptr<ValgrindProcessPrivate> d; }; } // namespace Valgrind diff --git a/src/plugins/valgrind/valgrindtestrunnertest.cpp b/src/plugins/valgrind/valgrindtestrunnertest.cpp index 5ae6ee04179..a470e27736e 100644 --- a/src/plugins/valgrind/valgrindtestrunnertest.cpp +++ b/src/plugins/valgrind/valgrindtestrunnertest.cpp @@ -103,14 +103,14 @@ void ValgrindTestRunnerTest::init() Q_ASSERT(m_logMessages.isEmpty()); Q_ASSERT(!m_runner); - m_runner = new ValgrindRunner; + m_runner = new ValgrindProcess; m_runner->setProcessChannelMode(QProcess::ForwardedChannels); - connect(m_runner, &ValgrindRunner::logMessageReceived, + connect(m_runner, &ValgrindProcess::logMessageReceived, this, &ValgrindTestRunnerTest::logMessageReceived); - connect(m_runner, &ValgrindRunner::processErrorReceived, + connect(m_runner, &ValgrindProcess::processErrorReceived, this, &ValgrindTestRunnerTest::internalError); - connect(m_runner, &ValgrindRunner::internalError, this, &ValgrindTestRunnerTest::internalError); - connect(m_runner, &ValgrindRunner::error, this, &ValgrindTestRunnerTest::error); + connect(m_runner, &ValgrindProcess::internalError, this, &ValgrindTestRunnerTest::internalError); + connect(m_runner, &ValgrindProcess::error, this, &ValgrindTestRunnerTest::error); } //BEGIN: Actual test cases diff --git a/src/plugins/valgrind/valgrindtestrunnertest.h b/src/plugins/valgrind/valgrindtestrunnertest.h index 1fb0b3670ad..600ca3f0a17 100644 --- a/src/plugins/valgrind/valgrindtestrunnertest.h +++ b/src/plugins/valgrind/valgrindtestrunnertest.h @@ -10,7 +10,7 @@ namespace Valgrind { -class ValgrindRunner; +class ValgrindProcess; namespace Test { @@ -48,7 +48,7 @@ private slots: private: QString runTestBinary(const QString &binary, const QStringList &vArgs = QStringList()); - ValgrindRunner *m_runner = nullptr; + ValgrindProcess *m_runner = nullptr; QList<QByteArray> m_logMessages; QList<XmlProtocol::Error> m_errors; bool m_expectCrash = false; diff --git a/tests/auto/valgrind/memcheck/modeldemo.cpp b/tests/auto/valgrind/memcheck/modeldemo.cpp index 6d0ff1b4e1e..4fe18f1bf8b 100644 --- a/tests/auto/valgrind/memcheck/modeldemo.cpp +++ b/tests/auto/valgrind/memcheck/modeldemo.cpp @@ -29,18 +29,18 @@ int main(int argc, char *argv[]) qRegisterMetaType<Error>(); - ValgrindRunner runner; + ValgrindProcess runner; runner.setValgrindCommand({VALGRIND_FAKE_PATH, {"-i", PARSERTESTS_DATA_DIR "/memcheck-output-sample1.xml"}}); ModelDemo demo(&runner); - QObject::connect(&runner, &ValgrindRunner::processErrorReceived, &app, [](const QString &err) { + QObject::connect(&runner, &ValgrindProcess::processErrorReceived, &app, [](const QString &err) { qDebug() << err; }); - QObject::connect(&runner, &ValgrindRunner::done, &app, [](bool success) { + QObject::connect(&runner, &ValgrindProcess::done, &app, [](bool success) { qApp->exit(success ? 0 : 1); }); ErrorListModel model; - QObject::connect(&runner, &ValgrindRunner::error, &model, &ErrorListModel::addError, + QObject::connect(&runner, &ValgrindProcess::error, &model, &ErrorListModel::addError, Qt::QueuedConnection); QTreeView errorview; diff --git a/tests/auto/valgrind/memcheck/modeldemo.h b/tests/auto/valgrind/memcheck/modeldemo.h index 59c38f0c3f9..76192015b91 100644 --- a/tests/auto/valgrind/memcheck/modeldemo.h +++ b/tests/auto/valgrind/memcheck/modeldemo.h @@ -18,7 +18,7 @@ class ModelDemo : public QObject { Q_OBJECT public: - explicit ModelDemo(Valgrind::ValgrindRunner *r, QObject *parent = 0) + explicit ModelDemo(Valgrind::ValgrindProcess *r, QObject *parent = 0) : QObject(parent) , runner(r) { @@ -37,5 +37,5 @@ public Q_SLOTS: } private: - Valgrind::ValgrindRunner *runner; + Valgrind::ValgrindProcess *runner; }; From 6c5f39c5d248cb0786c2d2e7f97c21fd873be247 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 23:30:35 +0200 Subject: [PATCH 0769/1777] Valgrind: Rename valgrindrunner.{cpp,h} -> valgrindprocess.{cpp.h} Change-Id: I17f8e55ee97567b98f2260d1a79413bd26d02314 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/CMakeLists.txt | 2 +- src/plugins/valgrind/memchecktool.cpp | 2 +- src/plugins/valgrind/valgrind.qbs | 2 +- src/plugins/valgrind/valgrindengine.h | 2 +- src/plugins/valgrind/valgrindmemcheckparsertest.cpp | 2 +- .../valgrind/{valgrindrunner.cpp => valgrindprocess.cpp} | 2 +- src/plugins/valgrind/{valgrindrunner.h => valgrindprocess.h} | 0 src/plugins/valgrind/valgrindtestrunnertest.cpp | 2 +- tests/auto/valgrind/memcheck/modeldemo.h | 2 +- tests/auto/valgrind/valgrind.cmake | 2 +- tests/auto/valgrind/valgrindautotest.qbs | 2 +- 11 files changed, 10 insertions(+), 10 deletions(-) rename src/plugins/valgrind/{valgrindrunner.cpp => valgrindprocess.cpp} (99%) rename src/plugins/valgrind/{valgrindrunner.h => valgrindprocess.h} (100%) diff --git a/src/plugins/valgrind/CMakeLists.txt b/src/plugins/valgrind/CMakeLists.txt index 0142fe61c3a..0efcd67c623 100644 --- a/src/plugins/valgrind/CMakeLists.txt +++ b/src/plugins/valgrind/CMakeLists.txt @@ -27,7 +27,7 @@ add_qtc_plugin(Valgrind valgrind.qrc valgrindengine.cpp valgrindengine.h valgrindplugin.cpp - valgrindrunner.cpp valgrindrunner.h + valgrindprocess.cpp valgrindprocess.h valgrindsettings.cpp valgrindsettings.h valgrindtr.h xmlprotocol/announcethread.cpp xmlprotocol/announcethread.h diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 6606af2edfc..bb26655dfb6 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -5,7 +5,7 @@ #include "memcheckerrorview.h" #include "valgrindengine.h" -#include "valgrindrunner.h" +#include "valgrindprocess.h" #include "valgrindsettings.h" #include "valgrindtr.h" diff --git a/src/plugins/valgrind/valgrind.qbs b/src/plugins/valgrind/valgrind.qbs index 065006352e3..049f75fc77d 100644 --- a/src/plugins/valgrind/valgrind.qbs +++ b/src/plugins/valgrind/valgrind.qbs @@ -31,7 +31,7 @@ QtcPlugin { "valgrind.qrc", "valgrindengine.cpp", "valgrindengine.h", "valgrindplugin.cpp", - "valgrindrunner.cpp", "valgrindrunner.h", + "valgrindprocess.cpp", "valgrindprocess.h", "valgrindsettings.cpp", "valgrindsettings.h", "valgrindtr.h", ] diff --git a/src/plugins/valgrind/valgrindengine.h b/src/plugins/valgrind/valgrindengine.h index 9325d11e245..c3d23e7e7ab 100644 --- a/src/plugins/valgrind/valgrindengine.h +++ b/src/plugins/valgrind/valgrindengine.h @@ -3,7 +3,7 @@ #pragma once -#include "valgrindrunner.h" +#include "valgrindprocess.h" #include "valgrindsettings.h" #include <projectexplorer/runcontrol.h> diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp index bef03884a91..45780602d9d 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -3,7 +3,7 @@ #include "valgrindmemcheckparsertest.h" -#include "valgrindrunner.h" +#include "valgrindprocess.h" #include "xmlprotocol/error.h" #include "xmlprotocol/frame.h" #include "xmlprotocol/parser.h" diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindprocess.cpp similarity index 99% rename from src/plugins/valgrind/valgrindrunner.cpp rename to src/plugins/valgrind/valgrindprocess.cpp index 84cbd4a83b4..1280014f952 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindprocess.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "valgrindrunner.h" +#include "valgrindprocess.h" #include "valgrindtr.h" #include "xmlprotocol/parser.h" diff --git a/src/plugins/valgrind/valgrindrunner.h b/src/plugins/valgrind/valgrindprocess.h similarity index 100% rename from src/plugins/valgrind/valgrindrunner.h rename to src/plugins/valgrind/valgrindprocess.h diff --git a/src/plugins/valgrind/valgrindtestrunnertest.cpp b/src/plugins/valgrind/valgrindtestrunnertest.cpp index a470e27736e..a5aa7bd18ab 100644 --- a/src/plugins/valgrind/valgrindtestrunnertest.cpp +++ b/src/plugins/valgrind/valgrindtestrunnertest.cpp @@ -3,7 +3,7 @@ #include "valgrindtestrunnertest.h" -#include "valgrindrunner.h" +#include "valgrindprocess.h" #include "xmlprotocol/frame.h" #include "xmlprotocol/stack.h" diff --git a/tests/auto/valgrind/memcheck/modeldemo.h b/tests/auto/valgrind/memcheck/modeldemo.h index 76192015b91..6694bc57fe1 100644 --- a/tests/auto/valgrind/memcheck/modeldemo.h +++ b/tests/auto/valgrind/memcheck/modeldemo.h @@ -12,7 +12,7 @@ #include <valgrind/xmlprotocol/error.h> #include <valgrind/xmlprotocol/errorlistmodel.h> #include <valgrind/xmlprotocol/stackmodel.h> -#include <valgrind/valgrindrunner.h> +#include <valgrind/valgrindprocess.h> class ModelDemo : public QObject { diff --git a/tests/auto/valgrind/valgrind.cmake b/tests/auto/valgrind/valgrind.cmake index 11c9abfd21d..e502c0c69d4 100644 --- a/tests/auto/valgrind/valgrind.cmake +++ b/tests/auto/valgrind/valgrind.cmake @@ -14,7 +14,7 @@ function(extend_valgrind_test targetName) callgrind/callgrindparser.h callgrind/callgrindparser.cpp callgrind/callgrindproxymodel.h callgrind/callgrindproxymodel.cpp callgrind/callgrindstackbrowser.h callgrind/callgrindstackbrowser.cpp - valgrindrunner.h valgrindrunner.cpp + valgrindprocess.h valgrindprocess.cpp xmlprotocol/announcethread.h xmlprotocol/announcethread.cpp xmlprotocol/error.h xmlprotocol/error.cpp xmlprotocol/errorlistmodel.h xmlprotocol/errorlistmodel.cpp diff --git a/tests/auto/valgrind/valgrindautotest.qbs b/tests/auto/valgrind/valgrindautotest.qbs index 88b52b61393..92b695241de 100644 --- a/tests/auto/valgrind/valgrindautotest.qbs +++ b/tests/auto/valgrind/valgrindautotest.qbs @@ -26,7 +26,7 @@ QtcAutotest { name: "Other files from plugin" prefix: product.pluginDir + "/" files: [ - "valgrindrunner.h", "valgrindrunner.cpp", + "valgrindprocess.h", "valgrindprocess.cpp", ] } cpp.includePaths: base.concat([project.ide_source_tree + "/src/plugins"]) From 78a034f721e2680e66a183defcb78f9ce59bd43b Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 23:33:59 +0200 Subject: [PATCH 0770/1777] ValgrindProcess: Make it taskable Change-Id: I39af67619b7808e349d3a71414e0eebb956331f6 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/valgrindprocess.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/valgrind/valgrindprocess.h b/src/plugins/valgrind/valgrindprocess.h index 0e71a529c50..d400dc2572d 100644 --- a/src/plugins/valgrind/valgrindprocess.h +++ b/src/plugins/valgrind/valgrindprocess.h @@ -3,6 +3,8 @@ #pragma once +#include <solutions/tasking/tasktree.h> + #include <utils/outputformat.h> #include <QProcess> @@ -59,4 +61,15 @@ private: std::unique_ptr<ValgrindProcessPrivate> d; }; +class ValgrindProcessTaskAdapter : public Tasking::TaskAdapter<ValgrindProcess> +{ +public: + ValgrindProcessTaskAdapter() { + connect(task(), &ValgrindProcess::done, this, &Tasking::TaskInterface::done); + } + void start() final { task()->start(); } +}; + } // namespace Valgrind + +TASKING_DECLARE_TASK(ValgrindProcessTask, Valgrind::ValgrindProcessTaskAdapter); From dd253a394068b2575e99e7924d059c4d501d0a2e Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 16 Aug 2023 23:56:20 +0200 Subject: [PATCH 0771/1777] Valgrind: Squash nested namespaces Change-Id: I45fd17c091ac588c30cd360efb6116365ebd73d7 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/callgrind/callgrinddatamodel.h | 6 ++---- src/plugins/valgrind/callgrind/callgrindfunction.cpp | 6 ++---- src/plugins/valgrind/callgrind/callgrindfunction.h | 6 ++---- src/plugins/valgrind/callgrind/callgrindfunction_p.h | 6 ++---- .../valgrind/callgrind/callgrindfunctioncall.cpp | 6 ++---- src/plugins/valgrind/callgrind/callgrindfunctioncall.h | 6 ++---- .../valgrind/callgrind/callgrindfunctioncycle.cpp | 6 ++---- .../valgrind/callgrind/callgrindfunctioncycle.h | 6 ++---- src/plugins/valgrind/callgrind/callgrindparsedata.cpp | 6 ++---- src/plugins/valgrind/callgrind/callgrindparsedata.h | 6 ++---- src/plugins/valgrind/callgrind/callgrindparser.cpp | 6 ++---- src/plugins/valgrind/callgrind/callgrindparser.h | 6 ++---- src/plugins/valgrind/callgrind/callgrindproxymodel.cpp | 6 ++---- src/plugins/valgrind/callgrind/callgrindproxymodel.h | 6 ++---- .../valgrind/callgrind/callgrindstackbrowser.cpp | 6 ++---- src/plugins/valgrind/callgrind/callgrindstackbrowser.h | 6 ++---- src/plugins/valgrind/callgrindcostdelegate.cpp | 6 ++---- src/plugins/valgrind/callgrindcostdelegate.h | 6 ++---- src/plugins/valgrind/callgrindcostview.cpp | 6 ++---- src/plugins/valgrind/callgrindcostview.h | 6 ++---- src/plugins/valgrind/callgrindengine.cpp | 6 ++---- src/plugins/valgrind/callgrindengine.h | 6 ++---- src/plugins/valgrind/callgrindhelper.cpp | 6 ++---- src/plugins/valgrind/callgrindhelper.h | 6 ++---- src/plugins/valgrind/callgrindnamedelegate.cpp | 6 ++---- src/plugins/valgrind/callgrindnamedelegate.h | 6 ++---- src/plugins/valgrind/callgrindtextmark.h | 9 +++------ src/plugins/valgrind/callgrindvisualisation.cpp | 6 ++---- src/plugins/valgrind/callgrindvisualisation.h | 10 +++------- src/plugins/valgrind/memcheckerrorview.cpp | 6 ++---- src/plugins/valgrind/memcheckerrorview.h | 6 ++---- src/plugins/valgrind/valgrindtestrunnertest.cpp | 6 ++---- src/plugins/valgrind/valgrindtestrunnertest.h | 9 +++------ src/plugins/valgrind/xmlprotocol/announcethread.cpp | 6 ++---- src/plugins/valgrind/xmlprotocol/announcethread.h | 6 ++---- src/plugins/valgrind/xmlprotocol/error.cpp | 6 ++---- src/plugins/valgrind/xmlprotocol/error.h | 6 ++---- src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp | 6 ++---- src/plugins/valgrind/xmlprotocol/errorlistmodel.h | 6 ++---- src/plugins/valgrind/xmlprotocol/stack.cpp | 6 ++---- src/plugins/valgrind/xmlprotocol/stack.h | 6 ++---- src/plugins/valgrind/xmlprotocol/stackmodel.cpp | 6 ++---- src/plugins/valgrind/xmlprotocol/stackmodel.h | 6 ++---- src/plugins/valgrind/xmlprotocol/status.cpp | 6 ++---- src/plugins/valgrind/xmlprotocol/status.h | 6 ++---- src/plugins/valgrind/xmlprotocol/suppression.h | 6 ++---- 46 files changed, 95 insertions(+), 191 deletions(-) diff --git a/src/plugins/valgrind/callgrind/callgrinddatamodel.h b/src/plugins/valgrind/callgrind/callgrinddatamodel.h index 89aba60fb97..136ea4a0d7f 100644 --- a/src/plugins/valgrind/callgrind/callgrinddatamodel.h +++ b/src/plugins/valgrind/callgrind/callgrinddatamodel.h @@ -7,8 +7,7 @@ #include <QAbstractItemModel> -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { class Function; class ParseData; @@ -69,5 +68,4 @@ private: Private *d; }; -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindfunction.cpp b/src/plugins/valgrind/callgrind/callgrindfunction.cpp index 4015ae7d5b9..a0d63300fd2 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunction.cpp +++ b/src/plugins/valgrind/callgrind/callgrindfunction.cpp @@ -13,8 +13,7 @@ #include <QFileInfo> -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { //BEGIN Function::Private @@ -294,5 +293,4 @@ void Function::finalize() } } -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindfunction.h b/src/plugins/valgrind/callgrind/callgrindfunction.h index 491ee53dedd..a6d314189e5 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunction.h +++ b/src/plugins/valgrind/callgrind/callgrindfunction.h @@ -6,8 +6,7 @@ #include <QList> #include <QMetaType> -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { class FunctionCall; class CostItem; @@ -118,7 +117,6 @@ private: Q_DISABLE_COPY(Function) }; -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind Q_DECLARE_METATYPE(const Valgrind::Callgrind::Function *) diff --git a/src/plugins/valgrind/callgrind/callgrindfunction_p.h b/src/plugins/valgrind/callgrind/callgrindfunction_p.h index 8ec54200c76..8ea1ecf0324 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunction_p.h +++ b/src/plugins/valgrind/callgrind/callgrindfunction_p.h @@ -11,8 +11,7 @@ #include <QHash> #include <QList> -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { class Function::Private { @@ -46,5 +45,4 @@ public: quint64 m_called = 0; }; -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindfunctioncall.cpp b/src/plugins/valgrind/callgrind/callgrindfunctioncall.cpp index aa59a2a1cc8..a5ef8e8fabc 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunctioncall.cpp +++ b/src/plugins/valgrind/callgrind/callgrindfunctioncall.cpp @@ -9,8 +9,7 @@ #include <QList> -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { //BEGIN FunctionCall::Private class FunctionCall::Private @@ -97,5 +96,4 @@ void FunctionCall::setCosts(const QList<quint64> &costs) d->m_costs = costs; } -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindfunctioncall.h b/src/plugins/valgrind/callgrind/callgrindfunctioncall.h index 817e221ee98..60131d37c60 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunctioncall.h +++ b/src/plugins/valgrind/callgrind/callgrindfunctioncall.h @@ -6,8 +6,7 @@ #include <QMetaType> #include <QList> -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { class Function; @@ -55,7 +54,6 @@ private: Private *d; }; -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind Q_DECLARE_METATYPE(const Valgrind::Callgrind::FunctionCall *) diff --git a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp index 64dd7374bcb..6a92b13c553 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp +++ b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.cpp @@ -7,8 +7,7 @@ #include "callgrindfunctioncall.h" #include "callgrindparsedata.h" -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { //BEGIN FunctionCycle::Private @@ -82,5 +81,4 @@ QList<const Function *> FunctionCycle::functions() const return CYCLE_D->m_functions; } -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.h b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.h index 320219bc167..8ba7a2fe71d 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.h +++ b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.h @@ -5,8 +5,7 @@ #include "callgrindfunction.h" -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { /** * self cost of a function cycle: sum of self costs of functions in the cycle @@ -32,5 +31,4 @@ private: class Private; }; -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindparsedata.cpp b/src/plugins/valgrind/callgrind/callgrindparsedata.cpp index 62fc8a7cd2f..d58450b9684 100644 --- a/src/plugins/valgrind/callgrind/callgrindparsedata.cpp +++ b/src/plugins/valgrind/callgrind/callgrindparsedata.cpp @@ -13,8 +13,7 @@ #include <QHash> #include <QStringList> -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { class ParseData::Private { @@ -341,5 +340,4 @@ void ParseData::addCompressedFunction(const QString &function, qint64 &id) d->addCompressedString(d->m_functionCompression, function, id); } -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindparsedata.h b/src/plugins/valgrind/callgrind/callgrindparsedata.h index 84a3b327a30..e6c7b0b8cb1 100644 --- a/src/plugins/valgrind/callgrind/callgrindparsedata.h +++ b/src/plugins/valgrind/callgrind/callgrindparsedata.h @@ -9,8 +9,7 @@ QT_BEGIN_NAMESPACE class QString; QT_END_NAMESPACE -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { class Function; @@ -110,5 +109,4 @@ private: Private *d; }; -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindparser.cpp b/src/plugins/valgrind/callgrind/callgrindparser.cpp index 58964172306..b2d4b166835 100644 --- a/src/plugins/valgrind/callgrind/callgrindparser.cpp +++ b/src/plugins/valgrind/callgrind/callgrindparser.cpp @@ -20,8 +20,7 @@ using namespace Utils; -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { static void skipSpace(const char **current, const char *end) { @@ -642,5 +641,4 @@ ParseData *Parser::takeData() return data; } -} //Callgrind -} //Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindparser.h b/src/plugins/valgrind/callgrind/callgrindparser.h index 9b5661b0b59..6355a5859e8 100644 --- a/src/plugins/valgrind/callgrind/callgrindparser.h +++ b/src/plugins/valgrind/callgrind/callgrindparser.h @@ -7,8 +7,7 @@ namespace Utils { class FilePath; } -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { class ParseData; @@ -42,5 +41,4 @@ private: Private *const d; }; -} // Callgrind -} // Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindproxymodel.cpp b/src/plugins/valgrind/callgrind/callgrindproxymodel.cpp index 3ba426a93d3..d9bad9daefc 100644 --- a/src/plugins/valgrind/callgrind/callgrindproxymodel.cpp +++ b/src/plugins/valgrind/callgrind/callgrindproxymodel.cpp @@ -10,8 +10,7 @@ #include <utils/qtcassert.h> -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { DataProxyModel::DataProxyModel(QObject *parent) : QSortFilterProxyModel(parent) @@ -133,5 +132,4 @@ bool DataProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_ return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent); } -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindproxymodel.h b/src/plugins/valgrind/callgrind/callgrindproxymodel.h index c90b653f1a3..b11186a6c27 100644 --- a/src/plugins/valgrind/callgrind/callgrindproxymodel.h +++ b/src/plugins/valgrind/callgrind/callgrindproxymodel.h @@ -5,8 +5,7 @@ #include <QSortFilterProxyModel> -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { class DataModel; class Function; @@ -52,5 +51,4 @@ private: double m_minimumInclusiveCostRatio = 0; }; -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindstackbrowser.cpp b/src/plugins/valgrind/callgrind/callgrindstackbrowser.cpp index 7b780d0dfa3..34ce812127e 100644 --- a/src/plugins/valgrind/callgrind/callgrindstackbrowser.cpp +++ b/src/plugins/valgrind/callgrind/callgrindstackbrowser.cpp @@ -3,8 +3,7 @@ #include "callgrindstackbrowser.h" -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { StackBrowser::StackBrowser(QObject *parent) : QObject(parent) @@ -51,5 +50,4 @@ void StackBrowser::goNext() emit currentChanged(); } -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrind/callgrindstackbrowser.h b/src/plugins/valgrind/callgrind/callgrindstackbrowser.h index d9ece6c1ae3..62d829c69e0 100644 --- a/src/plugins/valgrind/callgrind/callgrindstackbrowser.h +++ b/src/plugins/valgrind/callgrind/callgrindstackbrowser.h @@ -6,8 +6,7 @@ #include <QObject> #include <QStack> -namespace Valgrind { -namespace Callgrind { +namespace Valgrind::Callgrind { class Function; @@ -35,5 +34,4 @@ private: QStack<const Function *> m_redoStack; }; -} // namespace Callgrind -} // namespace Valgrind +} // namespace Valgrind::Callgrind diff --git a/src/plugins/valgrind/callgrindcostdelegate.cpp b/src/plugins/valgrind/callgrindcostdelegate.cpp index e6ca54756c8..a280a0edba9 100644 --- a/src/plugins/valgrind/callgrindcostdelegate.cpp +++ b/src/plugins/valgrind/callgrindcostdelegate.cpp @@ -13,8 +13,7 @@ using namespace Valgrind::Callgrind; -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { class CostDelegate::Private { @@ -134,5 +133,4 @@ QSize CostDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd return size; } -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/callgrindcostdelegate.h b/src/plugins/valgrind/callgrindcostdelegate.h index b8f7f01d016..94a0940462c 100644 --- a/src/plugins/valgrind/callgrindcostdelegate.h +++ b/src/plugins/valgrind/callgrindcostdelegate.h @@ -5,8 +5,7 @@ #include <QStyledItemDelegate> -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { class CostDelegate : public QStyledItemDelegate { @@ -37,7 +36,6 @@ private: Private *d; }; -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal Q_DECLARE_METATYPE(Valgrind::Internal::CostDelegate::CostFormat) diff --git a/src/plugins/valgrind/callgrindcostview.cpp b/src/plugins/valgrind/callgrindcostview.cpp index 4181abf6a99..ffc883cb280 100644 --- a/src/plugins/valgrind/callgrindcostview.cpp +++ b/src/plugins/valgrind/callgrindcostview.cpp @@ -11,8 +11,7 @@ using namespace Valgrind::Callgrind; -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { CostView::CostView(QWidget *parent) : Utils::BaseTreeView(parent) @@ -66,5 +65,4 @@ CostDelegate::CostFormat CostView::costFormat() const return m_costDelegate->format(); } -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/callgrindcostview.h b/src/plugins/valgrind/callgrindcostview.h index 48a04e5fb4f..5448db86a6c 100644 --- a/src/plugins/valgrind/callgrindcostview.h +++ b/src/plugins/valgrind/callgrindcostview.h @@ -7,8 +7,7 @@ #include <utils/basetreeview.h> -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { class CostDelegate; class NameDelegate; @@ -38,5 +37,4 @@ private: NameDelegate *m_nameDelegate; }; -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/callgrindengine.cpp b/src/plugins/valgrind/callgrindengine.cpp index 189da274db6..06ff38f5abe 100644 --- a/src/plugins/valgrind/callgrindengine.cpp +++ b/src/plugins/valgrind/callgrindengine.cpp @@ -20,8 +20,7 @@ using namespace ProjectExplorer; using namespace Valgrind::Callgrind; using namespace Utils; -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { const char CALLGRIND_CONTROL_BINARY[] = "callgrind_control"; @@ -269,5 +268,4 @@ void CallgrindToolRunner::cleanupTempFile() m_hostOutputFile.clear(); } -} // Internal -} // Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/callgrindengine.h b/src/plugins/valgrind/callgrindengine.h index 755c75d38c0..2379e917374 100644 --- a/src/plugins/valgrind/callgrindengine.h +++ b/src/plugins/valgrind/callgrindengine.h @@ -11,8 +11,7 @@ #include <utils/process.h> #include <utils/processinterface.h> -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { class CallgrindToolRunner : public ValgrindToolRunner { @@ -90,5 +89,4 @@ private: QString m_argumentForToggleCollect; }; -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/callgrindhelper.cpp b/src/plugins/valgrind/callgrindhelper.cpp index 29a57f5af09..62dd37b0723 100644 --- a/src/plugins/valgrind/callgrindhelper.cpp +++ b/src/plugins/valgrind/callgrindhelper.cpp @@ -10,8 +10,7 @@ #include <QRandomGenerator> #include <QString> -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { QColor CallgrindHelper::colorForString(const QString &text) { @@ -46,5 +45,4 @@ QString CallgrindHelper::toPercent(float costs, const QLocale &locale) return '<' + locale.toString(0.01f) + locale.percent(); } -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/callgrindhelper.h b/src/plugins/valgrind/callgrindhelper.h index 3287e987265..16432777d85 100644 --- a/src/plugins/valgrind/callgrindhelper.h +++ b/src/plugins/valgrind/callgrindhelper.h @@ -10,8 +10,7 @@ class QColor; class QString; QT_END_NAMESPACE -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { namespace CallgrindHelper { @@ -32,5 +31,4 @@ namespace CallgrindHelper QString toPercent(float costs, const QLocale &locale = QLocale()); } -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/callgrindnamedelegate.cpp b/src/plugins/valgrind/callgrindnamedelegate.cpp index f5795def31a..614465e3d1e 100644 --- a/src/plugins/valgrind/callgrindnamedelegate.cpp +++ b/src/plugins/valgrind/callgrindnamedelegate.cpp @@ -8,8 +8,7 @@ #include <QApplication> #include <QPainter> -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { NameDelegate::NameDelegate(QObject *parent) : QStyledItemDelegate(parent) @@ -57,5 +56,4 @@ void NameDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, painter->restore(); } -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/callgrindnamedelegate.h b/src/plugins/valgrind/callgrindnamedelegate.h index 97580938dd5..4c6a5699851 100644 --- a/src/plugins/valgrind/callgrindnamedelegate.h +++ b/src/plugins/valgrind/callgrindnamedelegate.h @@ -5,8 +5,7 @@ #include <QStyledItemDelegate> -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { class NameDelegate : public QStyledItemDelegate { @@ -17,5 +16,4 @@ public: const QModelIndex &index) const override; }; -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/callgrindtextmark.h b/src/plugins/valgrind/callgrindtextmark.h index 3e0c3472f8e..998da19a7e2 100644 --- a/src/plugins/valgrind/callgrindtextmark.h +++ b/src/plugins/valgrind/callgrindtextmark.h @@ -7,11 +7,9 @@ #include <QPersistentModelIndex> -namespace Valgrind { +namespace Valgrind::Callgrind { class Function; } -namespace Callgrind { class Function; } - -namespace Internal { +namespace Valgrind::Internal { class CallgrindTextMark : public TextEditor::TextMark { @@ -34,5 +32,4 @@ private: QPersistentModelIndex m_modelIndex; }; -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/callgrindvisualisation.cpp b/src/plugins/valgrind/callgrindvisualisation.cpp index 93d129ae48c..15bc6b45d19 100644 --- a/src/plugins/valgrind/callgrindvisualisation.cpp +++ b/src/plugins/valgrind/callgrindvisualisation.cpp @@ -29,8 +29,7 @@ static const int FIT_IN_VIEW_MARGIN = 2; using namespace Valgrind::Callgrind; -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { class FunctionGraphicsTextItem : public QAbstractGraphicsShapeItem { @@ -415,5 +414,4 @@ void Visualization::resizeEvent(QResizeEvent *event) QGraphicsView::resizeEvent(event); } -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/callgrindvisualisation.h b/src/plugins/valgrind/callgrindvisualisation.h index 7c10ba75cc8..fda14eef487 100644 --- a/src/plugins/valgrind/callgrindvisualisation.h +++ b/src/plugins/valgrind/callgrindvisualisation.h @@ -9,12 +9,9 @@ QT_BEGIN_NAMESPACE class QAbstractItemModel; QT_END_NAMESPACE -namespace Valgrind { -namespace Callgrind { class Function; } -} +namespace Valgrind::Callgrind { class Function; } -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { class Visualization : public QGraphicsView { @@ -51,5 +48,4 @@ private: Private *d; }; -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/memcheckerrorview.cpp b/src/plugins/valgrind/memcheckerrorview.cpp index 695a1446faa..102a131f62c 100644 --- a/src/plugins/valgrind/memcheckerrorview.cpp +++ b/src/plugins/valgrind/memcheckerrorview.cpp @@ -33,8 +33,7 @@ using namespace Utils; using namespace Valgrind::XmlProtocol; -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { class SuppressionDialog : public QDialog { @@ -316,5 +315,4 @@ void SuppressionDialog::validate() m_buttonBox->button(QDialogButtonBox::Save)->setEnabled(valid); } -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/memcheckerrorview.h b/src/plugins/valgrind/memcheckerrorview.h index dbf7650e11f..025a78ce01b 100644 --- a/src/plugins/valgrind/memcheckerrorview.h +++ b/src/plugins/valgrind/memcheckerrorview.h @@ -9,8 +9,7 @@ #include <QListView> -namespace Valgrind { -namespace Internal { +namespace Valgrind::Internal { class ValgrindSettings; @@ -34,5 +33,4 @@ private: ValgrindSettings *m_settings = nullptr; }; -} // namespace Internal -} // namespace Valgrind +} // namespace Valgrind::Internal diff --git a/src/plugins/valgrind/valgrindtestrunnertest.cpp b/src/plugins/valgrind/valgrindtestrunnertest.cpp index a5aa7bd18ab..73371e09164 100644 --- a/src/plugins/valgrind/valgrindtestrunnertest.cpp +++ b/src/plugins/valgrind/valgrindtestrunnertest.cpp @@ -19,8 +19,7 @@ using namespace Valgrind::XmlProtocol; using namespace Utils; -namespace Valgrind { -namespace Test { +namespace Valgrind::Test { //BEGIN Test Helpers and boilerplate code @@ -750,5 +749,4 @@ void ValgrindTestRunnerTest::testOverlap() } } -} // namespace Test -} // namespace Valgrind +} // namespace Valgrind::Test diff --git a/src/plugins/valgrind/valgrindtestrunnertest.h b/src/plugins/valgrind/valgrindtestrunnertest.h index 600ca3f0a17..39ee370f44d 100644 --- a/src/plugins/valgrind/valgrindtestrunnertest.h +++ b/src/plugins/valgrind/valgrindtestrunnertest.h @@ -8,11 +8,9 @@ #include <QObject> #include <QStringList> -namespace Valgrind { +namespace Valgrind { class ValgrindProcess; } -class ValgrindProcess; - -namespace Test { +namespace Valgrind::Test { class ValgrindTestRunnerTest : public QObject { @@ -54,5 +52,4 @@ private: bool m_expectCrash = false; }; -} // namespace Test -} // namespace Valgrind +} // namespace Valgrind::Test diff --git a/src/plugins/valgrind/xmlprotocol/announcethread.cpp b/src/plugins/valgrind/xmlprotocol/announcethread.cpp index c693005adcd..97d414904c6 100644 --- a/src/plugins/valgrind/xmlprotocol/announcethread.cpp +++ b/src/plugins/valgrind/xmlprotocol/announcethread.cpp @@ -9,8 +9,7 @@ #include <algorithm> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class AnnounceThread::Private : public QSharedData { @@ -66,5 +65,4 @@ void AnnounceThread::setStack(const QList<Frame> &stack) d->stack = stack; } -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/announcethread.h b/src/plugins/valgrind/xmlprotocol/announcethread.h index ac5f9cab993..cf5afc42e01 100644 --- a/src/plugins/valgrind/xmlprotocol/announcethread.h +++ b/src/plugins/valgrind/xmlprotocol/announcethread.h @@ -6,8 +6,7 @@ #include <QSharedDataPointer> #include <QList> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class Frame; @@ -31,5 +30,4 @@ private: QSharedDataPointer<Private> d; }; -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/error.cpp b/src/plugins/valgrind/xmlprotocol/error.cpp index 3b67ce76d11..4c0707b3726 100644 --- a/src/plugins/valgrind/xmlprotocol/error.cpp +++ b/src/plugins/valgrind/xmlprotocol/error.cpp @@ -13,8 +13,7 @@ #include <algorithm> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class Error::Private : public QSharedData { @@ -212,5 +211,4 @@ QString Error::toXml() const return xml; } -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/error.h b/src/plugins/valgrind/xmlprotocol/error.h index d3bf646d188..749d3b72613 100644 --- a/src/plugins/valgrind/xmlprotocol/error.h +++ b/src/plugins/valgrind/xmlprotocol/error.h @@ -11,8 +11,7 @@ QT_BEGIN_NAMESPACE class QString; QT_END_NAMESPACE -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { Q_NAMESPACE @@ -113,7 +112,6 @@ private: QSharedDataPointer<Private> d; }; -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol Q_DECLARE_METATYPE(Valgrind::XmlProtocol::Error) diff --git a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp index 34276dc54c1..9832c16da3b 100644 --- a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp +++ b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp @@ -14,8 +14,7 @@ #include <QDir> #include <QList> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class ErrorItem : public Utils::TreeItem { @@ -277,5 +276,4 @@ const ErrorItem *FrameItem::getErrorItem() const return nullptr; } -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/errorlistmodel.h b/src/plugins/valgrind/xmlprotocol/errorlistmodel.h index 0d7840509a6..2136cf4f8b8 100644 --- a/src/plugins/valgrind/xmlprotocol/errorlistmodel.h +++ b/src/plugins/valgrind/xmlprotocol/errorlistmodel.h @@ -8,8 +8,7 @@ #include <functional> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class Error; class Frame; @@ -39,5 +38,4 @@ private: RelevantFrameFinder m_relevantFrameFinder; }; -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/stack.cpp b/src/plugins/valgrind/xmlprotocol/stack.cpp index 973aaf9b2a2..d7528251020 100644 --- a/src/plugins/valgrind/xmlprotocol/stack.cpp +++ b/src/plugins/valgrind/xmlprotocol/stack.cpp @@ -8,8 +8,7 @@ #include <QSharedData> #include <QString> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class Stack::Private : public QSharedData { @@ -112,5 +111,4 @@ void Stack::setHelgrindThreadId(qint64 id) d->hthreadid = id; } -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/stack.h b/src/plugins/valgrind/xmlprotocol/stack.h index 333c1dc3201..a22f23451cd 100644 --- a/src/plugins/valgrind/xmlprotocol/stack.h +++ b/src/plugins/valgrind/xmlprotocol/stack.h @@ -6,8 +6,7 @@ #include <QList> #include <QSharedDataPointer> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class Frame; @@ -46,5 +45,4 @@ private: QSharedDataPointer<Private> d; }; -} // namespace XmlProtocol -} // namespace Stack +} // namespace Stack::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/stackmodel.cpp b/src/plugins/valgrind/xmlprotocol/stackmodel.cpp index 1027456b8c7..8d96c0ff6e7 100644 --- a/src/plugins/valgrind/xmlprotocol/stackmodel.cpp +++ b/src/plugins/valgrind/xmlprotocol/stackmodel.cpp @@ -9,8 +9,7 @@ #include <utils/qtcassert.h> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class StackModel::Private { @@ -201,5 +200,4 @@ void StackModel::clear() endResetModel(); } -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/stackmodel.h b/src/plugins/valgrind/xmlprotocol/stackmodel.h index db2613fec60..ff1350108f6 100644 --- a/src/plugins/valgrind/xmlprotocol/stackmodel.h +++ b/src/plugins/valgrind/xmlprotocol/stackmodel.h @@ -5,8 +5,7 @@ #include <QAbstractItemModel> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class Error; @@ -51,5 +50,4 @@ private: Private *const d; }; -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/status.cpp b/src/plugins/valgrind/xmlprotocol/status.cpp index 3bf310ba5cc..a5f8cf4c871 100644 --- a/src/plugins/valgrind/xmlprotocol/status.cpp +++ b/src/plugins/valgrind/xmlprotocol/status.cpp @@ -6,8 +6,7 @@ #include <QSharedData> #include <QString> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class Status::Private : public QSharedData { @@ -62,5 +61,4 @@ QString Status::time() const return d->time; } -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol diff --git a/src/plugins/valgrind/xmlprotocol/status.h b/src/plugins/valgrind/xmlprotocol/status.h index 363fd09fcbe..d48748ad702 100644 --- a/src/plugins/valgrind/xmlprotocol/status.h +++ b/src/plugins/valgrind/xmlprotocol/status.h @@ -6,8 +6,7 @@ #include <QMetaType> #include <QSharedDataPointer> -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class Status { @@ -35,7 +34,6 @@ private: QSharedDataPointer<Private> d; }; -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol Q_DECLARE_METATYPE(Valgrind::XmlProtocol::Status) diff --git a/src/plugins/valgrind/xmlprotocol/suppression.h b/src/plugins/valgrind/xmlprotocol/suppression.h index 60f40cd638b..08c8861fd86 100644 --- a/src/plugins/valgrind/xmlprotocol/suppression.h +++ b/src/plugins/valgrind/xmlprotocol/suppression.h @@ -10,8 +10,7 @@ QT_BEGIN_NAMESPACE class QString; QT_END_NAMESPACE -namespace Valgrind { -namespace XmlProtocol { +namespace Valgrind::XmlProtocol { class SuppressionFrame { @@ -77,5 +76,4 @@ private: QSharedDataPointer<Private> d; }; -} // namespace XmlProtocol -} // namespace Valgrind +} // namespace Valgrind::XmlProtocol From 8542c982b4c23ca60c49f5e4c92a54a6f0518ea4 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 17 Aug 2023 09:47:42 +0200 Subject: [PATCH 0772/1777] CompilerExplorer: Add plugin to qbs build Amends e34762c84436c9b8b3d35f119a893dcd6cb4f4db. Change-Id: I6da9820b35df1783a6e99279f18d7e23a25c2a7e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/compilerexplorer/api/compile.h | 3 ++- src/plugins/compilerexplorer/compilerexplorer.qbs | 1 + src/plugins/plugins.qbs | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/compilerexplorer/api/compile.h b/src/plugins/compilerexplorer/api/compile.h index fe07f22995f..d5b93eaa469 100644 --- a/src/plugins/compilerexplorer/api/compile.h +++ b/src/plugins/compilerexplorer/api/compile.h @@ -4,9 +4,10 @@ #pragma once #include "compiler.h" -#include "compilerexploreraspects.h" #include "config.h" +#include "../compilerexploreraspects.h" + #include <QList> #include <QString> diff --git a/src/plugins/compilerexplorer/compilerexplorer.qbs b/src/plugins/compilerexplorer/compilerexplorer.qbs index 756bb57d7e8..acfee646d64 100644 --- a/src/plugins/compilerexplorer/compilerexplorer.qbs +++ b/src/plugins/compilerexplorer/compilerexplorer.qbs @@ -4,6 +4,7 @@ QtcPlugin { name: "CompilerExplorer" Depends { name: "Core" } + Depends { name: "TextEditor" } Depends { name: "Qt"; submodules: ["widgets", "network"] } files: [ diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs index 9f4ab0a2fad..6a1535db02a 100644 --- a/src/plugins/plugins.qbs +++ b/src/plugins/plugins.qbs @@ -20,6 +20,7 @@ Project { "classview/classview.qbs", "clearcase/clearcase.qbs", "cmakeprojectmanager/cmakeprojectmanager.qbs", + "compilerexplorer/compilerexplorer.qbs", "mesonprojectmanager/mesonprojectmanager.qbs", "coco/coco.qbs", "compilationdatabaseprojectmanager/compilationdatabaseprojectmanager.qbs", From 36e0ea27b97997ab5b57551b4558916fdf11704e Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 17 Aug 2023 00:20:09 +0200 Subject: [PATCH 0773/1777] VariousPlugins: Fix forward declarations The pattern is to use QT_[BEGIN/END]_NAMESPACE, instead of QT_FORWARD_DECLARE_CLASS. Change-Id: I9da39ee003e1d477a5f56980c218e275706bb3f4 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/autotoolsprojectmanager/makefileparser.h | 4 +++- src/plugins/designer/qtcreatorintegration.h | 4 +++- src/plugins/diffeditor/diffeditordocument.h | 2 -- src/plugins/diffeditor/diffeditorwidgetcontroller.h | 4 +++- src/plugins/diffeditor/diffview.h | 4 +++- src/plugins/emacskeys/emacskeysplugin.h | 7 ++++--- src/plugins/emacskeys/emacskeysstate.h | 4 +++- src/plugins/git/gerrit/gerritparameters.h | 4 +++- src/plugins/help/searchtaskhandler.h | 4 +++- src/plugins/imageviewer/exportdialog.h | 4 +++- src/plugins/imageviewer/imageview.h | 4 +++- src/plugins/imageviewer/multiexportdialog.h | 4 +++- src/plugins/mcusupport/mcupackage.h | 2 -- src/plugins/mcusupport/mcusupportoptions.h | 2 -- .../qmakeprojectmanager/customwidgetwizard/classlist.h | 2 -- src/plugins/qtsupport/codegensettings.h | 4 +++- src/plugins/todo/settings.h | 4 +++- 17 files changed, 40 insertions(+), 23 deletions(-) diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.h b/src/plugins/autotoolsprojectmanager/makefileparser.h index 2d4786e0dab..17d39b73533 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparser.h +++ b/src/plugins/autotoolsprojectmanager/makefileparser.h @@ -12,7 +12,9 @@ #include <atomic> -QT_FORWARD_DECLARE_CLASS(QDir) +QT_BEGIN_NAMESPACE +class QDir; +QT_END_NAMESPACE namespace AutotoolsProjectManager::Internal { diff --git a/src/plugins/designer/qtcreatorintegration.h b/src/plugins/designer/qtcreatorintegration.h index c27d296ab0b..31e3cdcb32c 100644 --- a/src/plugins/designer/qtcreatorintegration.h +++ b/src/plugins/designer/qtcreatorintegration.h @@ -6,7 +6,9 @@ #include <QtGlobal> #include <QDesignerIntegration> -QT_FORWARD_DECLARE_CLASS(QUrl) +QT_BEGIN_NAMESPACE +class QUrl; +QT_END_NAMESPACE namespace Designer { namespace Internal { diff --git a/src/plugins/diffeditor/diffeditordocument.h b/src/plugins/diffeditor/diffeditordocument.h index 6a7e72ae373..287e53de592 100644 --- a/src/plugins/diffeditor/diffeditordocument.h +++ b/src/plugins/diffeditor/diffeditordocument.h @@ -8,8 +8,6 @@ #include <coreplugin/patchtool.h> #include <coreplugin/textdocument.h> -QT_FORWARD_DECLARE_CLASS(QMenu) - namespace DiffEditor { class DiffEditorController; diff --git a/src/plugins/diffeditor/diffeditorwidgetcontroller.h b/src/plugins/diffeditor/diffeditorwidgetcontroller.h index 81baef980a5..7364cf1a637 100644 --- a/src/plugins/diffeditor/diffeditorwidgetcontroller.h +++ b/src/plugins/diffeditor/diffeditorwidgetcontroller.h @@ -12,7 +12,9 @@ #include <QTextCharFormat> #include <QTimer> -QT_FORWARD_DECLARE_CLASS(QMenu) +QT_BEGIN_NAMESPACE +class QMenu; +QT_END_NAMESPACE namespace Core { class IDocument; } namespace TextEditor { class FontSettings; } diff --git a/src/plugins/diffeditor/diffview.h b/src/plugins/diffeditor/diffview.h index 9028f83c636..07e4c1d1863 100644 --- a/src/plugins/diffeditor/diffview.h +++ b/src/plugins/diffeditor/diffview.h @@ -11,7 +11,9 @@ #include <QString> #include <QObject> -QT_FORWARD_DECLARE_CLASS(QWidget) +QT_BEGIN_NAMESPACE +class QWidget; +QT_END_NAMESPACE namespace TextEditor { class TextEditorWidget; } diff --git a/src/plugins/emacskeys/emacskeysplugin.h b/src/plugins/emacskeys/emacskeysplugin.h index ab124b47ce3..1e5300ff1be 100644 --- a/src/plugins/emacskeys/emacskeysplugin.h +++ b/src/plugins/emacskeys/emacskeysplugin.h @@ -30,9 +30,10 @@ #include <QTextCursor> -// forward declarations -QT_FORWARD_DECLARE_CLASS(QAction) -QT_FORWARD_DECLARE_CLASS(QPlainTextEdit) +QT_BEGIN_NAMESPACE +class QAction; +class QPlainTextEdit; +QT_END_NAMESPACE namespace Core { class IEditor; diff --git a/src/plugins/emacskeys/emacskeysstate.h b/src/plugins/emacskeys/emacskeysstate.h index a0de7ceffd6..43b65876674 100644 --- a/src/plugins/emacskeys/emacskeysstate.h +++ b/src/plugins/emacskeys/emacskeysstate.h @@ -26,7 +26,9 @@ #include <QObject> -QT_FORWARD_DECLARE_CLASS(QPlainTextEdit) +QT_BEGIN_NAMESPACE +class QPlainTextEdit; +QT_END_NAMESPACE namespace EmacsKeys { namespace Internal { diff --git a/src/plugins/git/gerrit/gerritparameters.h b/src/plugins/git/gerrit/gerritparameters.h index 75806aa4f57..38a65778853 100644 --- a/src/plugins/git/gerrit/gerritparameters.h +++ b/src/plugins/git/gerrit/gerritparameters.h @@ -7,7 +7,9 @@ #include <utils/filepath.h> -QT_FORWARD_DECLARE_CLASS(QSettings) +QT_BEGIN_NAMESPACE +class QSettings; +QT_END_NAMESPACE namespace Gerrit { namespace Internal { diff --git a/src/plugins/help/searchtaskhandler.h b/src/plugins/help/searchtaskhandler.h index 09e03f1e06a..e813afb9028 100644 --- a/src/plugins/help/searchtaskhandler.h +++ b/src/plugins/help/searchtaskhandler.h @@ -5,7 +5,9 @@ #include <projectexplorer/itaskhandler.h> -QT_FORWARD_DECLARE_CLASS(QUrl) +QT_BEGIN_NAMESPACE +class QUrl; +QT_END_NAMESPACE namespace Help { namespace Internal { diff --git a/src/plugins/imageviewer/exportdialog.h b/src/plugins/imageviewer/exportdialog.h index 5868cc7ef7c..f9e7cf939bc 100644 --- a/src/plugins/imageviewer/exportdialog.h +++ b/src/plugins/imageviewer/exportdialog.h @@ -5,7 +5,9 @@ #include <QDialog> -QT_FORWARD_DECLARE_CLASS(QSpinBox) +QT_BEGIN_NAMESPACE +class QSpinBox; +QT_END_NAMESPACE namespace Utils { class FilePath; diff --git a/src/plugins/imageviewer/imageview.h b/src/plugins/imageviewer/imageview.h index 6bee8e3243e..e5cf20ea808 100644 --- a/src/plugins/imageviewer/imageview.h +++ b/src/plugins/imageviewer/imageview.h @@ -8,7 +8,9 @@ #include <QGraphicsView> -QT_FORWARD_DECLARE_CLASS(QImage) +QT_BEGIN_NAMESPACE +class QImage; +QT_END_NAMESPACE namespace Utils { class QtcSettings; diff --git a/src/plugins/imageviewer/multiexportdialog.h b/src/plugins/imageviewer/multiexportdialog.h index bd8ed32b1a2..74eb33f4ca0 100644 --- a/src/plugins/imageviewer/multiexportdialog.h +++ b/src/plugins/imageviewer/multiexportdialog.h @@ -8,7 +8,9 @@ #include <QSize> #include <QVector> -QT_FORWARD_DECLARE_CLASS(QLineEdit) +QT_BEGIN_NAMESPACE +class QLineEdit; +QT_END_NAMESPACE namespace Utils { class FilePath; diff --git a/src/plugins/mcusupport/mcupackage.h b/src/plugins/mcusupport/mcupackage.h index 1bd3b26fb4d..df0f80ba657 100644 --- a/src/plugins/mcusupport/mcupackage.h +++ b/src/plugins/mcusupport/mcupackage.h @@ -12,8 +12,6 @@ #include <QObject> -QT_FORWARD_DECLARE_CLASS(QWidget) - namespace ProjectExplorer { class ToolChain; } diff --git a/src/plugins/mcusupport/mcusupportoptions.h b/src/plugins/mcusupport/mcusupportoptions.h index 1090f871004..5823bed4529 100644 --- a/src/plugins/mcusupport/mcusupportoptions.h +++ b/src/plugins/mcusupport/mcusupportoptions.h @@ -13,8 +13,6 @@ #include <QObject> #include <QVersionNumber> -QT_FORWARD_DECLARE_CLASS(QWidget) - namespace Utils { class FilePath; class PathChooser; diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/classlist.h b/src/plugins/qmakeprojectmanager/customwidgetwizard/classlist.h index 2cbab6c50d4..723d06f7089 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/classlist.h +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/classlist.h @@ -5,8 +5,6 @@ #include <QListView> -QT_FORWARD_DECLARE_CLASS(QModelIndex) - namespace QmakeProjectManager { namespace Internal { class ClassModel; diff --git a/src/plugins/qtsupport/codegensettings.h b/src/plugins/qtsupport/codegensettings.h index 6199754e362..a247ea43483 100644 --- a/src/plugins/qtsupport/codegensettings.h +++ b/src/plugins/qtsupport/codegensettings.h @@ -5,7 +5,9 @@ #include "qtsupport_global.h" -QT_FORWARD_DECLARE_CLASS(QSettings) +QT_BEGIN_NAMESPACE +class QSettings; +QT_END_NAMESPACE namespace QtSupport { diff --git a/src/plugins/todo/settings.h b/src/plugins/todo/settings.h index 0caae568e8f..57dc13990c1 100644 --- a/src/plugins/todo/settings.h +++ b/src/plugins/todo/settings.h @@ -6,7 +6,9 @@ #include "keyword.h" -QT_FORWARD_DECLARE_CLASS(QSettings) +QT_BEGIN_NAMESPACE +class QSettings; +QT_END_NAMESPACE namespace Todo { namespace Internal { From 98026b29c69953d47e99bb45d7fd559f51014cd9 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 17 Aug 2023 11:08:21 +0200 Subject: [PATCH 0774/1777] TaskTree: Get rid of registration macros Alias task types manually. Don't require the alias to be inside the Tasking namespace. Addresses the 22th point of the jira ticket below. Task-number: QTCREATORBUG-28741 Change-Id: I1bdda7fe5a01e4bcb5052ec328f4e0eace878651 Reviewed-by: hjk <hjk@qt.io> --- src/libs/solutions/tasking/barrier.h | 6 +----- src/libs/solutions/tasking/concurrentcall.h | 5 +++-- src/libs/solutions/tasking/networkquery.h | 4 ++-- src/libs/solutions/tasking/tasktree.h | 15 +++------------ src/libs/utils/async.h | 5 +++-- src/libs/utils/filestreamer.cpp | 8 ++------ src/libs/utils/filestreamer.h | 4 ++-- src/libs/utils/process.h | 4 ++-- src/libs/utils/unarchiver.h | 4 ++-- src/plugins/android/androiddeployqtstep.cpp | 2 +- src/plugins/clangtools/clangtool.cpp | 18 +++++++----------- .../cmakeprojectmanager/cmakebuildstep.cpp | 13 ++++--------- .../coreplugin/locator/ilocatorfilter.cpp | 6 +----- .../coreplugin/locator/javascriptfilter.cpp | 2 +- src/plugins/git/gitclient.cpp | 5 ----- src/plugins/git/gitclient.h | 2 +- src/plugins/ios/iosdeploystep.cpp | 6 +----- src/plugins/languageclient/clientrequesttask.h | 4 ++-- .../currentdocumentsymbolsrequest.h | 6 +++--- src/plugins/projectexplorer/buildmanager.cpp | 6 +----- .../devicesupport/deviceusedportsgatherer.h | 5 ++--- .../devicesupport/filetransfer.h | 6 +++--- .../projectexplorer/devicesupport/idevice.h | 4 ++-- src/plugins/qbsprojectmanager/qbsrequest.h | 4 ++-- src/plugins/updateinfo/updateinfoplugin.cpp | 2 -- src/plugins/valgrind/valgrindprocess.h | 4 ++-- src/plugins/valgrind/xmlprotocol/parser.h | 4 ++-- tests/auto/solutions/tasking/tst_tasking.cpp | 2 +- 28 files changed, 56 insertions(+), 100 deletions(-) diff --git a/src/libs/solutions/tasking/barrier.h b/src/libs/solutions/tasking/barrier.h index ba8319682e0..71081209f4d 100644 --- a/src/libs/solutions/tasking/barrier.h +++ b/src/libs/solutions/tasking/barrier.h @@ -41,11 +41,7 @@ public: void start() final { task()->start(); } }; -} // namespace Tasking - -TASKING_DECLARE_TASK(BarrierTask, Tasking::BarrierTaskAdapter); - -namespace Tasking { +using BarrierTask = CustomTask<BarrierTaskAdapter>; template <int Limit = 1> class SharedBarrier diff --git a/src/libs/solutions/tasking/concurrentcall.h b/src/libs/solutions/tasking/concurrentcall.h index d7799159447..7c0d1cf47ef 100644 --- a/src/libs/solutions/tasking/concurrentcall.h +++ b/src/libs/solutions/tasking/concurrentcall.h @@ -95,6 +95,7 @@ private: std::unique_ptr<QFutureWatcher<ResultType>> m_watcher; }; -} // namespace Tasking +template <typename T> +using ConcurrentCallTask = CustomTask<ConcurrentCallTaskAdapter<T>>; -TASKING_DECLARE_TEMPLATE_TASK(ConcurrentCallTask, Tasking::ConcurrentCallTaskAdapter); +} // namespace Tasking diff --git a/src/libs/solutions/tasking/networkquery.h b/src/libs/solutions/tasking/networkquery.h index faf482df90d..0cac720584a 100644 --- a/src/libs/solutions/tasking/networkquery.h +++ b/src/libs/solutions/tasking/networkquery.h @@ -50,6 +50,6 @@ public: void start() final { task()->start(); } }; -} // namespace Tasking +using NetworkQueryTask = CustomTask<NetworkQueryTaskAdapter>; -TASKING_DECLARE_TASK(NetworkQueryTask, Tasking::NetworkQueryTaskAdapter); +} // namespace Tasking diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h index 9478ac10250..29409a448b4 100644 --- a/src/libs/solutions/tasking/tasktree.h +++ b/src/libs/solutions/tasking/tasktree.h @@ -460,16 +460,7 @@ private: std::optional<int> m_timerId; }; +using TaskTreeTask = CustomTask<TaskTreeTaskAdapter>; +using TimeoutTask = CustomTask<TimeoutTaskAdapter>; + } // namespace Tasking - -#define TASKING_DECLARE_TASK(CustomTaskName, TaskAdapterClass)\ -namespace Tasking { using CustomTaskName = CustomTask<TaskAdapterClass>; } - -#define TASKING_DECLARE_TEMPLATE_TASK(CustomTaskName, TaskAdapterClass)\ -namespace Tasking {\ -template <typename ...Args>\ -using CustomTaskName = CustomTask<TaskAdapterClass<Args...>>;\ -} // namespace Tasking - -TASKING_DECLARE_TASK(TaskTreeTask, TaskTreeTaskAdapter); -TASKING_DECLARE_TASK(TimeoutTask, TimeoutTaskAdapter); diff --git a/src/libs/utils/async.h b/src/libs/utils/async.h index f8dc6813a7b..64ade0a9e3b 100644 --- a/src/libs/utils/async.h +++ b/src/libs/utils/async.h @@ -210,6 +210,7 @@ public: void start() final { this->task()->start(); } }; -} // namespace Utils +template <typename T> +using AsyncTask = Tasking::CustomTask<AsyncTaskAdapter<T>>; -TASKING_DECLARE_TEMPLATE_TASK(AsyncTask, Utils::AsyncTaskAdapter); +} // namespace Utils diff --git a/src/libs/utils/filestreamer.cpp b/src/libs/utils/filestreamer.cpp index e8ff353be81..24587563019 100644 --- a/src/libs/utils/filestreamer.cpp +++ b/src/libs/utils/filestreamer.cpp @@ -304,12 +304,8 @@ public: void start() override { task()->start(); } }; -} // namespace Utils - -TASKING_DECLARE_TASK(FileStreamReaderTask, Utils::FileStreamReaderAdapter); -TASKING_DECLARE_TASK(FileStreamWriterTask, Utils::FileStreamWriterAdapter); - -namespace Utils { +using FileStreamReaderTask = CustomTask<FileStreamReaderAdapter>; +using FileStreamWriterTask = CustomTask<FileStreamWriterAdapter>; static Group sameRemoteDeviceTransferTask(const FilePath &source, const FilePath &destination) { diff --git a/src/libs/utils/filestreamer.h b/src/libs/utils/filestreamer.h index a5b6ff4f256..828f27be8e1 100644 --- a/src/libs/utils/filestreamer.h +++ b/src/libs/utils/filestreamer.h @@ -58,6 +58,6 @@ public: void start() override { task()->start(); } }; -} // namespace Utils +using FileStreamerTask = Tasking::CustomTask<FileStreamerTaskAdapter>; -TASKING_DECLARE_TASK(FileStreamerTask, Utils::FileStreamerTaskAdapter); +} // namespace Utils diff --git a/src/libs/utils/process.h b/src/libs/utils/process.h index 016d80e3279..4bcbd767294 100644 --- a/src/libs/utils/process.h +++ b/src/libs/utils/process.h @@ -222,8 +222,8 @@ public: void start() final; }; +using ProcessTask = Tasking::CustomTask<ProcessTaskAdapter>; + } // namespace Utils -TASKING_DECLARE_TASK(ProcessTask, Utils::ProcessTaskAdapter); - #endif // UTILS_PROCESS_H diff --git a/src/libs/utils/unarchiver.h b/src/libs/utils/unarchiver.h index 0890bafa743..3e2b2f89386 100644 --- a/src/libs/utils/unarchiver.h +++ b/src/libs/utils/unarchiver.h @@ -52,6 +52,6 @@ public: void start() final; }; -} // namespace Utils +using UnarchiverTask = Tasking::CustomTask<UnarchiverTaskAdapter>; -TASKING_DECLARE_TASK(UnarchiverTask, Utils::UnarchiverTaskAdapter); +} // namespace Utils diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index da00ac6396a..d8e99a04f5b 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -565,7 +565,7 @@ Tasking::GroupItem AndroidDeployQtStep::runRecipe() async.setConcurrentCallData(&AndroidDeployQtStep::runImpl, this); async.setFutureSynchronizer(&m_synchronizer); }; - return Tasking::AsyncTask<void>(onSetup); + return AsyncTask<void>(onSetup); } void AndroidDeployQtStep::runCommand(const CommandLine &command) diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index 8c1b12c557f..aaea55d08c3 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -63,13 +63,14 @@ using namespace Core; using namespace CppEditor; using namespace Debugger; using namespace ProjectExplorer; +using namespace Tasking; using namespace Utils; static Q_LOGGING_CATEGORY(LOG, "qtc.clangtools.runcontrol", QtWarningMsg) namespace ClangTools::Internal { -class ProjectBuilderTaskAdapter : public Tasking::TaskAdapter<QPointer<Target>> +class ProjectBuilderTaskAdapter : public TaskAdapter<QPointer<Target>> { public: void start() final { @@ -82,11 +83,7 @@ public: } }; -} // namespace ClangTools::Internal - -TASKING_DECLARE_TASK(ProjectBuilderTask, ClangTools::Internal::ProjectBuilderTaskAdapter); - -namespace ClangTools::Internal { +using ProjectBuilderTask = CustomTask<ProjectBuilderTaskAdapter>; static QDebug operator<<(QDebug debug, const Environment &environment) { @@ -640,14 +637,13 @@ static bool continueDespiteReleaseBuild(const QString &toolName) == QMessageBox::Yes; } -Tasking::Group ClangTool::runRecipe(const RunSettings &runSettings, - const ClangDiagnosticConfig &diagnosticConfig, - const FileInfos &fileInfos, bool buildBeforeAnalysis) +Group ClangTool::runRecipe(const RunSettings &runSettings, + const ClangDiagnosticConfig &diagnosticConfig, + const FileInfos &fileInfos, + bool buildBeforeAnalysis) { m_filesCount = int(fileInfos.size()); - using namespace Tasking; - struct ClangStorage { ClangStorage() { m_timer.start(); } ~ClangStorage() { diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index c0cfffbb233..d892c38f7d0 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -44,6 +44,7 @@ using namespace Core; using namespace ProjectExplorer; +using namespace Tasking; using namespace Utils; namespace CMakeProjectManager::Internal { @@ -59,7 +60,7 @@ const char CLEAR_SYSTEM_ENVIRONMENT_KEY[] = "CMakeProjectManager.MakeStep.ClearS const char USER_ENVIRONMENT_CHANGES_KEY[] = "CMakeProjectManager.MakeStep.UserEnvironmentChanges"; const char BUILD_PRESET_KEY[] = "CMakeProjectManager.MakeStep.BuildPreset"; -class ProjectParserTaskAdapter : public Tasking::TaskAdapter<QPointer<Target>> +class ProjectParserTaskAdapter : public TaskAdapter<QPointer<Target>> { public: void start() final { @@ -72,11 +73,7 @@ public: } }; -} // namespace CMakeProjectManager::Internal - -TASKING_DECLARE_TASK(ProjectParserTask, CMakeProjectManager::Internal::ProjectParserTaskAdapter); - -namespace CMakeProjectManager::Internal { +using ProjectParserTask = CustomTask<ProjectParserTaskAdapter>; class CmakeProgressParser : public Utils::OutputLineParser { @@ -345,10 +342,8 @@ void CMakeBuildStep::setupOutputFormatter(Utils::OutputFormatter *formatter) CMakeAbstractProcessStep::setupOutputFormatter(formatter); } -Tasking::GroupItem CMakeBuildStep::runRecipe() +GroupItem CMakeBuildStep::runRecipe() { - using namespace Tasking; - const auto onParserSetup = [this](QPointer<Target> &parseTarget) { // Make sure CMake state was written to disk before trying to build: auto bs = qobject_cast<CMakeBuildSystem *>(buildSystem()); diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.cpp b/src/plugins/coreplugin/locator/ilocatorfilter.cpp index 7f272fd108d..feff0d9d1ca 100644 --- a/src/plugins/coreplugin/locator/ilocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/ilocatorfilter.cpp @@ -327,11 +327,7 @@ public: void start() final { task()->start(); } }; -} // namespace Core - -TASKING_DECLARE_TASK(ResultsCollectorTask, Core::ResultsCollectorTaskAdapter); - -namespace Core { +using ResultsCollectorTask = CustomTask<ResultsCollectorTaskAdapter>; class LocatorStoragePrivate { diff --git a/src/plugins/coreplugin/locator/javascriptfilter.cpp b/src/plugins/coreplugin/locator/javascriptfilter.cpp index a15cabd8d9d..21459d41dc6 100644 --- a/src/plugins/coreplugin/locator/javascriptfilter.cpp +++ b/src/plugins/coreplugin/locator/javascriptfilter.cpp @@ -349,7 +349,7 @@ public: void start() final { task()->start(); } }; -TASKING_DECLARE_TASK(JavaScriptRequestTask, JavaScriptRequestAdapter); +using JavaScriptRequestTask = CustomTask<JavaScriptRequestAdapter>; namespace Core::Internal { diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 12ca9e3e4db..bf568734667 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -236,8 +236,6 @@ GitDiffEditorController::GitDiffEditorController(IDocument *document, const QStringList &extraArgs) : GitBaseDiffEditorController(document) { - using namespace Tasking; - const TreeStorage<QString> diffInputStorage; const auto setupDiff = [=](Process &process) { @@ -296,8 +294,6 @@ FileListDiffController::FileListDiffController(IDocument *document, const QStrin const QStringList &unstagedFiles) : GitBaseDiffEditorController(document) { - using namespace Tasking; - struct DiffStorage { QString m_stagedOutput; QString m_unstagedOutput; @@ -363,7 +359,6 @@ ShowController::ShowController(IDocument *document, const QString &id) { setDisplayName("Git Show"); static const QString busyMessage = Tr::tr("<resolving>"); - using namespace Tasking; struct ReloadStorage { bool m_postProcessDescription = false; diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 85e00f0a48a..03649f0f4e1 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -245,7 +245,7 @@ public: QString synchronousTopic(const Utils::FilePath &workingDirectory) const; bool synchronousRevParseCmd(const Utils::FilePath &workingDirectory, const QString &ref, QString *output, QString *errorMessage = nullptr) const; - Tasking::ProcessTask topRevision(const Utils::FilePath &workingDirectory, + Utils::ProcessTask topRevision(const Utils::FilePath &workingDirectory, const std::function<void(const QString &, const QDateTime &)> &callback); bool isRemoteCommit(const Utils::FilePath &workingDirectory, const QString &commit); diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index bd0dabc6f33..3f80d9d931a 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -97,11 +97,7 @@ private: void start() final { task()->start(); } }; -} // Ios::Internal - -TASKING_DECLARE_TASK(IosTransferTask, Ios::Internal::IosTransferTaskAdapter); - -namespace Ios::Internal { +using IosTransferTask = CustomTask<IosTransferTaskAdapter>; class IosDeployStep final : public BuildStep { diff --git a/src/plugins/languageclient/clientrequesttask.h b/src/plugins/languageclient/clientrequesttask.h index 3e08e1a287f..92e72427a39 100644 --- a/src/plugins/languageclient/clientrequesttask.h +++ b/src/plugins/languageclient/clientrequesttask.h @@ -75,6 +75,6 @@ public: void start() final; }; -} // namespace LanguageClient +using SymbolRequest = Tasking::CustomTask<WorkspaceSymbolRequestTaskAdapter>; -TASKING_DECLARE_TASK(SymbolRequest, LanguageClient::WorkspaceSymbolRequestTaskAdapter); +} // namespace LanguageClient diff --git a/src/plugins/languageclient/currentdocumentsymbolsrequest.h b/src/plugins/languageclient/currentdocumentsymbolsrequest.h index 0b9c11a2215..ef124154dfd 100644 --- a/src/plugins/languageclient/currentdocumentsymbolsrequest.h +++ b/src/plugins/languageclient/currentdocumentsymbolsrequest.h @@ -47,7 +47,7 @@ public: void start() final; }; -} // namespace LanguageClient +using CurrentDocumentSymbolsRequestTask + = Tasking::CustomTask<CurrentDocumentSymbolsRequestTaskAdapter>; -TASKING_DECLARE_TASK(CurrentDocumentSymbolsRequestTask, - LanguageClient::CurrentDocumentSymbolsRequestTaskAdapter); +} // namespace LanguageClient diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 596421b8f65..f1a06df1f88 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -78,11 +78,7 @@ private: } }; -} // ProjectExplorer - -TASKING_DECLARE_TASK(ParserAwaiterTask, ProjectExplorer::ParserAwaiterTaskAdapter); - -namespace ProjectExplorer { +using ParserAwaiterTask = CustomTask<ParserAwaiterTaskAdapter>; static QString msgProgress(int progress, int total) { diff --git a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h index 20b0c9c9e8f..ee6b2760060 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h +++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h @@ -87,7 +87,6 @@ private: QVector<Internal::SubChannelProvider *> m_channelProviders; }; -} // namespace ProjectExplorer +using DeviceUsedPortsGathererTask = Tasking::CustomTask<DeviceUsedPortsGathererTaskAdapter>; -TASKING_DECLARE_TASK(DeviceUsedPortsGathererTask, - ProjectExplorer::DeviceUsedPortsGathererTaskAdapter); +} // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/filetransfer.h b/src/plugins/projectexplorer/devicesupport/filetransfer.h index f73a3741682..7ad6a5c5bc3 100644 --- a/src/plugins/projectexplorer/devicesupport/filetransfer.h +++ b/src/plugins/projectexplorer/devicesupport/filetransfer.h @@ -59,7 +59,7 @@ public: void start() final { task()->test(); } }; -} // namespace ProjectExplorer +using FileTransferTask = Tasking::CustomTask<FileTransferTaskAdapter>; +using FileTransferTestTask = Tasking::CustomTask<FileTransferTestTaskAdapter>; -TASKING_DECLARE_TASK(FileTransferTask, ProjectExplorer::FileTransferTaskAdapter); -TASKING_DECLARE_TASK(FileTransferTestTask, ProjectExplorer::FileTransferTestTaskAdapter); +} // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 2f1d60d288e..13b70892a70 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -282,6 +282,6 @@ public: void start() final; }; -} // namespace ProjectExplorer +using DeviceProcessKillerTask = Tasking::CustomTask<DeviceProcessKillerTaskAdapter>; -TASKING_DECLARE_TASK(DeviceProcessKillerTask, ProjectExplorer::DeviceProcessKillerTaskAdapter); +} // namespace ProjectExplorer diff --git a/src/plugins/qbsprojectmanager/qbsrequest.h b/src/plugins/qbsprojectmanager/qbsrequest.h index 94654284af3..e86909504b6 100644 --- a/src/plugins/qbsprojectmanager/qbsrequest.h +++ b/src/plugins/qbsprojectmanager/qbsrequest.h @@ -49,6 +49,6 @@ private: void start() final { task()->start(); } }; -} // namespace QbsProjectManager::Internal +using QbsRequestTask = Tasking::CustomTask<QbsRequestTaskAdapter>; -TASKING_DECLARE_TASK(QbsRequestTask, QbsProjectManager::Internal::QbsRequestTaskAdapter); +} // namespace QbsProjectManager::Internal diff --git a/src/plugins/updateinfo/updateinfoplugin.cpp b/src/plugins/updateinfo/updateinfoplugin.cpp index 985817720a1..ab134915257 100644 --- a/src/plugins/updateinfo/updateinfoplugin.cpp +++ b/src/plugins/updateinfo/updateinfoplugin.cpp @@ -118,8 +118,6 @@ void UpdateInfoPlugin::startCheckForUpdates() emit checkForUpdatesRunningChanged(true); - using namespace Tasking; - const auto doSetup = [this](Process &process, const QStringList &args) { process.setCommand({d->m_maintenanceTool, args}); process.setLowPriority(); diff --git a/src/plugins/valgrind/valgrindprocess.h b/src/plugins/valgrind/valgrindprocess.h index d400dc2572d..065d4ad47ad 100644 --- a/src/plugins/valgrind/valgrindprocess.h +++ b/src/plugins/valgrind/valgrindprocess.h @@ -70,6 +70,6 @@ public: void start() final { task()->start(); } }; -} // namespace Valgrind +using ValgrindProcessTask = Tasking::CustomTask<ValgrindProcessTaskAdapter>; -TASKING_DECLARE_TASK(ValgrindProcessTask, Valgrind::ValgrindProcessTaskAdapter); +} // namespace Valgrind diff --git a/src/plugins/valgrind/xmlprotocol/parser.h b/src/plugins/valgrind/xmlprotocol/parser.h index 61050076b78..df34601bc35 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.h +++ b/src/plugins/valgrind/xmlprotocol/parser.h @@ -58,6 +58,6 @@ public: void start() final { task()->start(); } }; -} // Valgrind::XmlProtocol +using ParserTask = Tasking::CustomTask<ParserTaskAdapter>; -TASKING_DECLARE_TASK(ParserTask, Valgrind::XmlProtocol::ParserTaskAdapter); +} // Valgrind::XmlProtocol diff --git a/tests/auto/solutions/tasking/tst_tasking.cpp b/tests/auto/solutions/tasking/tst_tasking.cpp index 316b3587038..e73589499f8 100644 --- a/tests/auto/solutions/tasking/tst_tasking.cpp +++ b/tests/auto/solutions/tasking/tst_tasking.cpp @@ -194,7 +194,7 @@ public: void start() final { task()->start(); } }; -TASKING_DECLARE_TASK(TickAndDoneTask, TickAndDoneTaskAdapter); +using TickAndDoneTask = CustomTask<TickAndDoneTaskAdapter>; template <typename SharedBarrierType> GroupItem createBarrierAdvance(const TreeStorage<CustomStorage> &storage, From 0192c3c26dc27f8d5c8c650db32a8af775a784fb Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Tue, 15 Aug 2023 16:48:15 +0200 Subject: [PATCH 0775/1777] DAP : Refactor DapEngine Extracted client part to additional class DapClient. Change-Id: Iba472d2fb2c2390f38ad9a3a75e9e1d9a76f912c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/CMakeLists.txt | 1 + src/plugins/debugger/dap/cmakedapengine.cpp | 49 +-- src/plugins/debugger/dap/cmakedapengine.h | 1 - src/plugins/debugger/dap/dapclient.cpp | 237 ++++++++++++ src/plugins/debugger/dap/dapclient.h | 113 ++++++ src/plugins/debugger/dap/dapengine.cpp | 385 +++++--------------- src/plugins/debugger/dap/dapengine.h | 45 +-- src/plugins/debugger/dap/gdbdapengine.cpp | 8 +- 8 files changed, 477 insertions(+), 362 deletions(-) create mode 100644 src/plugins/debugger/dap/dapclient.cpp create mode 100644 src/plugins/debugger/dap/dapclient.h diff --git a/src/plugins/debugger/CMakeLists.txt b/src/plugins/debugger/CMakeLists.txt index aea2effcf2e..cc632969e03 100644 --- a/src/plugins/debugger/CMakeLists.txt +++ b/src/plugins/debugger/CMakeLists.txt @@ -28,6 +28,7 @@ add_qtc_plugin(Debugger console/consoleproxymodel.cpp console/consoleproxymodel.h console/consoleview.cpp console/consoleview.h dap/cmakedapengine.cpp dap/cmakedapengine.h + dap/dapclient.cpp dap/dapclient.h dap/dapengine.cpp dap/dapengine.h dap/gdbdapengine.cpp dap/gdbdapengine.h debugger.qrc diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp index 1b3614a5f12..6d7996a1e1b 100644 --- a/src/plugins/debugger/dap/cmakedapengine.cpp +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -3,6 +3,8 @@ #include "cmakedapengine.h" +#include "dapclient.h" + #include <coreplugin/messagemanager.h> #include <debugger/debuggermainwindow.h> @@ -69,6 +71,23 @@ private: const QString m_socketName; }; +class CMakeDapClient : public DapClient +{ +public: + CMakeDapClient(std::unique_ptr<IDataProvider> provider) + : DapClient(std::move(provider)) + {} + + void sendInitialize() + { + postRequest("initialize", + QJsonObject{{"clientID", "QtCreator"}, + {"clientName", "QtCreator"}, + {"adapterID", "cmake"}, + {"pathFormat", "path"}}); + } +}; + CMakeDapEngine::CMakeDapEngine() : DapEngine() { @@ -76,24 +95,6 @@ CMakeDapEngine::CMakeDapEngine() setDebuggerName("CmakeDAP"); } -void CMakeDapEngine::handleDapStarted() -{ - QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); - - postDirectCommand({ - {"command", "initialize"}, - {"type", "request"}, - {"arguments", QJsonObject { - {"clientID", "QtCreator"}, // The ID of the client using this adapter. - {"clientName", "QtCreator"}, // The human-readable name of the client using this adapter. - {"adapterID", "cmake"}, - {"pathFormat", "path"} - }} - }); - - qCDebug(dapEngineLog) << "handleDapStarted"; -} - void CMakeDapEngine::setupEngine() { QTC_ASSERT(state() == EngineSetupRequested, qCDebug(dapEngineLog) << state()); @@ -101,24 +102,26 @@ void CMakeDapEngine::setupEngine() qCDebug(dapEngineLog) << "build system name" << ProjectExplorer::ProjectTree::currentBuildSystem()->name(); + std::unique_ptr<IDataProvider> dataProvider; if (TemporaryDirectory::masterDirectoryFilePath().osType() == Utils::OsType::OsTypeWindows) { - m_dataGenerator = std::make_unique<LocalSocketDataProvider>("\\\\.\\pipe\\cmake-dap"); + dataProvider = std::make_unique<LocalSocketDataProvider>("\\\\.\\pipe\\cmake-dap"); } else { - m_dataGenerator = std::make_unique<LocalSocketDataProvider>( + dataProvider = std::make_unique<LocalSocketDataProvider>( TemporaryDirectory::masterDirectoryPath() + "/cmake-dap.sock"); } + m_dapClient = std::make_unique<CMakeDapClient>(std::move(dataProvider)); connectDataGeneratorSignals(); connect(ProjectExplorer::ProjectTree::currentBuildSystem(), &ProjectExplorer::BuildSystem::debuggingStarted, this, - [this] { m_dataGenerator->start(); }); + [this] { m_dapClient->dataProvider()->start(); }); ProjectExplorer::ProjectTree::currentBuildSystem()->requestDebugging(); QTimer::singleShot(5000, this, [this] { - if (!m_dataGenerator->isRunning()) { - m_dataGenerator->kill(); + if (!m_dapClient->dataProvider()->isRunning()) { + m_dapClient->dataProvider()->kill(); MessageManager::writeDisrupting( "CMake server is not running. Please check that your CMake is 3.27 or higher."); return; diff --git a/src/plugins/debugger/dap/cmakedapengine.h b/src/plugins/debugger/dap/cmakedapengine.h index 4d03249e348..c385590779f 100644 --- a/src/plugins/debugger/dap/cmakedapengine.h +++ b/src/plugins/debugger/dap/cmakedapengine.h @@ -13,7 +13,6 @@ public: CMakeDapEngine(); private: - void handleDapStarted() override; void setupEngine() override; /* Needed for CMake support issue:25176 */ diff --git a/src/plugins/debugger/dap/dapclient.cpp b/src/plugins/debugger/dap/dapclient.cpp new file mode 100644 index 00000000000..41097123ba3 --- /dev/null +++ b/src/plugins/debugger/dap/dapclient.cpp @@ -0,0 +1,237 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 + +#include "dapclient.h" +#include "qjsonarray.h" + +#include <utils/process.h> + +#include <QDebug> +#include <QJsonDocument> +#include <QLoggingCategory> + +using namespace Core; +using namespace Utils; + +static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg); + +namespace Debugger::Internal { + +DapClient::DapClient(std::unique_ptr<IDataProvider> dataProvider) + : m_dataProvider(std::move(dataProvider)) +{ + connect(m_dataProvider.get(), + &IDataProvider::readyReadStandardOutput, + this, + &DapClient::readOutput); + connect(m_dataProvider.get(), + &IDataProvider::readyReadStandardError, + this, + &DapClient::readyReadStandardError); + + connect(m_dataProvider.get(), &IDataProvider::done, this, &DapClient::done); + connect(m_dataProvider.get(), &IDataProvider::started, this, &DapClient::started); +} + +DapClient::~DapClient() = default; + + +void DapClient::postRequest(const QString &command, const QJsonObject &arguments) +{ + QJsonObject ob = { + {"command", command}, + {"type", "request"}, + {"arguments", arguments} + }; + + static int seq = 1; + QJsonObject obseq = ob; + obseq.insert("seq", seq++); + + const QByteArray data = QJsonDocument(obseq).toJson(QJsonDocument::Compact); + const QByteArray msg = "Content-Length: " + QByteArray::number(data.size()) + "\r\n\r\n" + data; + qCDebug(dapEngineLog) << msg; + + m_dataProvider->writeRaw(msg); +} + +void DapClient::sendInitialize() +{ + postRequest("initialize", QJsonObject{{"clientID", "QtCreator"}, {"clientName", "QtCreator"}}); +} + +void DapClient::sendLaunch(const Utils::FilePath &executable) +{ + postRequest("launch", + QJsonObject{{"noDebug", false}, {"program", executable.path()}, {"__restart", ""}}); +} + +void DapClient::sendConfigurationDone() +{ + postRequest("configurationDone"); +} + +void DapClient::sendDisconnect() +{ + postRequest("disconnect", QJsonObject{{"restart", false}, {"terminateDebuggee", true}}); +} + +void DapClient::sendTerminate() +{ + postRequest("terminate", QJsonObject{{"restart", false}}); +} + +void DapClient::sendContinue(int threadId) +{ + QTC_ASSERT(threadId != -1, return); + postRequest("continue", QJsonObject{{"threadId", threadId}}); +} + +void DapClient::sendPause() +{ + postRequest("pause"); +} + + +void DapClient::sendStepIn(int threadId) +{ + QTC_ASSERT(threadId != -1, return); + postRequest("stepIn", QJsonObject{{"threadId", threadId}}); +} + +void DapClient::sendStepOut(int threadId) +{ + QTC_ASSERT(threadId != -1, return); + postRequest("stepOut", QJsonObject{{"threadId", threadId}}); +} + +void DapClient::sendStepOver(int threadId) +{ + QTC_ASSERT(threadId != -1, return); + postRequest("next", QJsonObject{{"threadId", threadId}}); +} + +void DapClient::stackTrace(int threadId) +{ + QTC_ASSERT(threadId != -1, return); + postRequest("stackTrace", + QJsonObject{{"threadId", threadId}, {"startFrame", 0}, {"levels", 10}}); +} + +void DapClient::scopes(int frameId) +{ + postRequest("scopes", QJsonObject{{"frameId", frameId}}); +} + +void DapClient::threads() +{ + postRequest("threads"); +} + +void DapClient::variables(int variablesReference) +{ + postRequest("variables", QJsonObject{{"variablesReference", variablesReference}}); +} + +void DapClient::setBreakpoints(const QJsonArray &breakpoints, const FilePath &fileName) +{ + postRequest("setBreakpoints", + QJsonObject{{"source", QJsonObject{{"path", fileName.path()}}}, + {"breakpoints", breakpoints}}); +} + +void DapClient::readOutput() +{ + m_inbuffer.append(m_dataProvider->readAllStandardOutput()); + + qCDebug(dapEngineLog) << m_inbuffer; + + while (true) { + // Something like + // Content-Length: 128\r\n + // {"type": "event", "event": "output", "body": {"category": "stdout", "output": "...\n"}, "seq": 1}\r\n + // FIXME: There coud be more than one header line. + int pos1 = m_inbuffer.indexOf("Content-Length:"); + if (pos1 == -1) + break; + pos1 += 15; + + int pos2 = m_inbuffer.indexOf('\n', pos1); + if (pos2 == -1) + break; + + const int len = m_inbuffer.mid(pos1, pos2 - pos1).trimmed().toInt(); + if (len < 4) + break; + + pos2 += 3; // Skip \r\n\r + + if (pos2 + len > m_inbuffer.size()) + break; + + QJsonParseError error; + const QJsonDocument doc = QJsonDocument::fromJson(m_inbuffer.mid(pos2, len), &error); + + m_inbuffer = m_inbuffer.mid(pos2 + len); + + emitSignals(doc); + } +} + +void DapClient::emitSignals(const QJsonDocument &doc) +{ + QJsonObject ob = doc.object(); + const QJsonValue t = ob.value("type"); + const QString type = t.toString(); + + qCDebug(dapEngineLog) << "dap response" << ob; + + if (type == "response") { + DapResponseType type = DapResponseType::Unknown; + const QString command = ob.value("command").toString(); + if (command == "configurationDone") { + type = DapResponseType::ConfigurationDone; + } else if (command == "continue") { + type = DapResponseType::Continue; + } else if (command == "stackTrace") { + type = DapResponseType::StackTrace; + } else if (command == "scopes") { + type = DapResponseType::Scopes; + } else if (command == "variables") { + type = DapResponseType::Variables; + } else if (command == "stepIn") { + type = DapResponseType::StepIn; + } else if (command == "stepOut") { + type = DapResponseType::StepOut; + } else if (command == "next") { + type = DapResponseType::StepOver; + } else if (command == "threads") { + type = DapResponseType::DapThreads; + } + emit responseReady(type, ob); + return; + } + + if (type == "event") { + const QString event = ob.value("event").toString(); + + DapEventType type = DapEventType::Unknown; + if (event == "initialized") { + type = DapEventType::Initialized; + } else if (event == "stopped") { + type = DapEventType::Stopped; + } else if (event == "thread") { + type = DapEventType::DapThread; + } else if (event == "output") { + type = DapEventType::Output; + } else if (event == "breakpoint") { + type = DapEventType::DapBreakpoint; + } else if (event == "exited") { + type = DapEventType::Exited; + } + emit eventReady(type, ob); + } +} + +} // namespace Debugger::Internal + diff --git a/src/plugins/debugger/dap/dapclient.h b/src/plugins/debugger/dap/dapclient.h new file mode 100644 index 00000000000..3cb2d49b4d5 --- /dev/null +++ b/src/plugins/debugger/dap/dapclient.h @@ -0,0 +1,113 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <debugger/debuggerengine.h> + +#include <utils/process.h> + +namespace Debugger::Internal { + +class IDataProvider : public QObject +{ + Q_OBJECT +public: + virtual void start() = 0; + virtual bool isRunning() const = 0; + virtual void writeRaw(const QByteArray &input) = 0; + virtual void kill() = 0; + virtual QByteArray readAllStandardOutput() = 0; + virtual QString readAllStandardError() = 0; + virtual int exitCode() const = 0; + virtual QString executable() const = 0; + + virtual QProcess::ExitStatus exitStatus() const = 0; + virtual QProcess::ProcessError error() const = 0; + virtual Utils::ProcessResult result() const = 0; + virtual QString exitMessage() const = 0; + +signals: + void started(); + void done(); + void readyReadStandardOutput(); + void readyReadStandardError(); +}; + +enum class DapResponseType +{ + ConfigurationDone, + Continue, + StackTrace, + Scopes, + DapThreads, + Variables, + StepIn, + StepOut, + StepOver, + Unknown +}; + +enum class DapEventType +{ + Initialized, + Stopped, + Exited, + DapThread, + Output, + DapBreakpoint, + Unknown +}; + +class DapClient : public QObject +{ + Q_OBJECT + +public: + DapClient(std::unique_ptr<IDataProvider> dataProvider); + ~DapClient(); + + IDataProvider *dataProvider() const { return m_dataProvider.get(); } + + void postRequest(const QString &command, const QJsonObject &arguments = {}); + + virtual void sendInitialize(); + + void sendLaunch(const Utils::FilePath &executable); + void sendConfigurationDone(); + + void sendDisconnect(); + void sendTerminate(); + + void sendPause(); + void sendContinue(int threadId); + + void sendStepIn(int threadId); + void sendStepOut(int threadId); + void sendStepOver(int threadId); + + void stackTrace(int threadId); + void scopes(int frameId); + void threads(); + void variables(int variablesReference); + void setBreakpoints(const QJsonArray &breakpoints, const Utils::FilePath &fileName); + void emitSignals(const QJsonDocument &doc); + +signals: + void started(); + void done(); + void readyReadStandardError(); + + void responseReady(DapResponseType type, const QJsonObject &response); + void eventReady(DapEventType type, const QJsonObject &response); + +private: + void readOutput(); + +private: + std::unique_ptr<IDataProvider> m_dataProvider = nullptr; + + QByteArray m_inbuffer; +}; + +} // namespace Debugger::Internal diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 75497ed103d..c6fb33fc0c2 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -2,7 +2,9 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "dapengine.h" + #include "cmakedapengine.h" +#include "dapclient.h" #include "gdbdapengine.h" #include <debugger/breakhandler.h> @@ -79,28 +81,13 @@ void DapEngine::executeDebuggerCommand(const QString &/*command*/) // postDirectCommand(command); } -void DapEngine::postDirectCommand(const QJsonObject &ob) -{ - static int seq = 1; - QJsonObject obseq = ob; - obseq.insert("seq", seq++); - - const QByteArray data = QJsonDocument(obseq).toJson(QJsonDocument::Compact); - const QByteArray msg = "Content-Length: " + QByteArray::number(data.size()) + "\r\n\r\n" + data; - qCDebug(dapEngineLog) << msg; - - m_dataGenerator->writeRaw(msg); - - showMessage(QString::fromUtf8(msg), LogInput); -} - void DapEngine::runCommand(const DebuggerCommand &cmd) { if (state() == EngineSetupRequested) { // cmd has been triggered too early showMessage("IGNORED COMMAND: " + cmd.function); return; } - QTC_ASSERT(m_dataGenerator->isRunning(), notifyEngineIll()); + QTC_ASSERT(m_dapClient->dataProvider()->isRunning(), notifyEngineIll()); // postDirectCommand(cmd.args.toObject()); // const QByteArray data = QJsonDocument(cmd.args.toObject()).toJson(QJsonDocument::Compact); // m_proc.writeRaw("Content-Length: " + QByteArray::number(data.size()) + "\r\n" + data + "\r\n"); @@ -112,14 +99,7 @@ void DapEngine::shutdownInferior() { QTC_ASSERT(state() == InferiorShutdownRequested, qCDebug(dapEngineLog) << state()); - postDirectCommand({ - {"command", "disconnect"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"restart", false}, - {"terminateDebuggee", true} - }} - }); + m_dapClient->sendDisconnect(); qCDebug(dapEngineLog) << "DapEngine::shutdownInferior()"; notifyInferiorShutdownFinished(); @@ -129,30 +109,17 @@ void DapEngine::shutdownEngine() { QTC_ASSERT(state() == EngineShutdownRequested, qCDebug(dapEngineLog) << state()); - postDirectCommand({ - {"command", "terminate"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"restart", false} - }} - }); + m_dapClient->sendTerminate(); qCDebug(dapEngineLog) << "DapEngine::shutdownEngine()"; - m_dataGenerator->kill(); + m_dapClient->dataProvider()->kill(); } void DapEngine::handleDapStarted() { QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); - postDirectCommand({ - {"command", "initialize"}, - {"type", "request"}, - {"arguments", QJsonObject { - {"clientID", "QtCreator"}, // The ID of the client using this adapter. - {"clientName", "QtCreator"} // The human-readable name of the client using this adapter. - }} - }); + m_dapClient->sendInitialize(); qCDebug(dapEngineLog) << "handleDapStarted"; } @@ -161,10 +128,7 @@ void DapEngine::handleDapConfigurationDone() { QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); - postDirectCommand({ - {"command", "configurationDone"}, - {"type", "request"} - }); + m_dapClient->sendConfigurationDone(); qCDebug(dapEngineLog) << "handleDapConfigurationDone"; } @@ -174,70 +138,14 @@ void DapEngine::handleDapLaunch() { QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); - postDirectCommand({ - {"command", "launch"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"noDebug", false}, - {"program", runParameters().inferior.command.executable().path()}, - {"__restart", ""} - }} - }); + m_dapClient->sendLaunch(runParameters().inferior.command.executable()); + qCDebug(dapEngineLog) << "handleDapLaunch"; } void DapEngine::interruptInferior() { - postDirectCommand({ - {"command", "pause"}, - {"type", "request"} - }); -} - -void DapEngine::dapStackTrace() -{ - if (m_currentThreadId == -1) - return; - - postDirectCommand({ - {"command", "stackTrace"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"threadId", m_currentThreadId}, - {"startFrame", 0}, - {"levels", 10} - }} - }); -} - -void DapEngine::dapScopes(int frameId) -{ - postDirectCommand({ - {"command", "scopes"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"frameId", frameId} - }} - }); -} - -void DapEngine::threads() -{ - postDirectCommand({ - {"command", "threads"}, - {"type", "request"} - }); -} - -void DapEngine::dapVariables(int variablesReference) -{ - postDirectCommand({ - {"command", "variables"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"variablesReference", variablesReference} - }} - }); + m_dapClient->sendPause(); } void DapEngine::executeStepIn(bool) @@ -246,15 +154,7 @@ void DapEngine::executeStepIn(bool) return; notifyInferiorRunRequested(); - - postDirectCommand({ - {"command", "stepIn"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"threadId", m_currentThreadId}, - }} - }); - + m_dapClient->sendStepIn(m_currentThreadId); } void DapEngine::executeStepOut() @@ -263,15 +163,7 @@ void DapEngine::executeStepOut() return; notifyInferiorRunRequested(); - - postDirectCommand({ - {"command", "stepOut"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"threadId", m_currentThreadId}, - }} - }); - + m_dapClient->sendStepOut(m_currentThreadId); } void DapEngine::executeStepOver(bool) @@ -281,26 +173,13 @@ void DapEngine::executeStepOver(bool) notifyInferiorRunRequested(); - postDirectCommand({ - {"command", "next"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"threadId", m_currentThreadId}, - }} - }); - + m_dapClient->sendStepOver(m_currentThreadId); } void DapEngine::continueInferior() { notifyInferiorRunRequested(); - postDirectCommand({ - {"command", "continue"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"threadId", m_currentThreadId}, - }} - }); + m_dapClient->sendContinue(m_currentThreadId); } void DapEngine::executeRunToLine(const ContextData &data) @@ -395,16 +274,7 @@ void DapEngine::dapInsertBreakpoint(const Breakpoint &bp) } } - postDirectCommand( { - {"command", "setBreakpoints"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"source", QJsonObject{ - {"path", params.fileName.path()} - }}, - {"breakpoints", breakpoints} - }} - }); + m_dapClient->setBreakpoints(breakpoints, params.fileName); qCDebug(dapEngineLog) << "insertBreakpoint" << bp->modelId() << bp->responseId(); } @@ -437,23 +307,15 @@ void DapEngine::dapRemoveBreakpoint(const Breakpoint &bp) const BreakpointParameters ¶ms = bp->requestedParameters(); QJsonArray breakpoints; - for (const auto &breakpoint : breakHandler()->breakpoints()) + for (const auto &breakpoint : breakHandler()->breakpoints()) { if (breakpoint->responseId() != bp->responseId() && params.fileName == breakpoint->requestedParameters().fileName) { QJsonObject jsonBp = createBreakpoint(breakpoint); breakpoints.append(jsonBp); } + } - postDirectCommand({ - {"command", "setBreakpoints"}, - {"type", "request"}, - {"arguments", QJsonObject{ - {"source", QJsonObject{ - {"path", params.fileName.path()} - }}, - {"breakpoints", breakpoints} - }} - }); + m_dapClient->setBreakpoints(breakpoints, params.fileName); qCDebug(dapEngineLog) << "removeBreakpoint" << bp->modelId() << bp->responseId(); } @@ -566,7 +428,7 @@ QString DapEngine::errorMessage(QProcess::ProcessError error) const return Tr::tr("The DAP process failed to start. Either the " "invoked program \"%1\" is missing, or you may have insufficient " "permissions to invoke the program.") - .arg(m_dataGenerator->executable()); + .arg(m_dapClient->dataProvider()->executable()); case QProcess::Crashed: return Tr::tr("The DAP process crashed some time after starting " "successfully."); @@ -588,14 +450,15 @@ QString DapEngine::errorMessage(QProcess::ProcessError error) const void DapEngine::handleDapDone() { - if (m_dataGenerator->result() == ProcessResult::StartFailed) { + if (m_dapClient->dataProvider()->result() == ProcessResult::StartFailed) { notifyEngineSetupFailed(); showMessage("ADAPTER START FAILED"); - ICore::showWarningWithOptions(Tr::tr("Adapter start failed"), m_dataGenerator->exitMessage()); + ICore::showWarningWithOptions(Tr::tr("Adapter start failed"), + m_dapClient->dataProvider()->exitMessage()); return; } - const QProcess::ProcessError error = m_dataGenerator->error(); + const QProcess::ProcessError error = m_dapClient->dataProvider()->error(); if (error != QProcess::UnknownError) { showMessage("HANDLE DAP ERROR"); if (error != QProcess::Crashed) @@ -604,129 +467,62 @@ void DapEngine::handleDapDone() return; } showMessage(QString("DAP PROCESS FINISHED, status %1, code %2") - .arg(m_dataGenerator->exitStatus()).arg(m_dataGenerator->exitCode())); + .arg(m_dapClient->dataProvider()->exitStatus()).arg(m_dapClient->dataProvider()->exitCode())); notifyEngineSpontaneousShutdown(); } void DapEngine::readDapStandardError() { - QString err = m_dataGenerator->readAllStandardError(); + QString err = m_dapClient->dataProvider()->readAllStandardError(); qCDebug(dapEngineLog) << "DAP STDERR:" << err; //qWarning() << "Unexpected DAP stderr:" << err; showMessage("Unexpected DAP stderr: " + err); //handleOutput(err); } -void DapEngine::readDapStandardOutput() -{ - m_inbuffer.append(m_dataGenerator->readAllStandardOutput()); - - qCDebug(dapEngineLog) << m_inbuffer; - - while (true) { - // Something like - // Content-Length: 128\r\n - // {"type": "event", "event": "output", "body": {"category": "stdout", "output": "...\n"}, "seq": 1}\r\n - // FIXME: There coud be more than one header line. - int pos1 = m_inbuffer.indexOf("Content-Length:"); - if (pos1 == -1) - break; - pos1 += 15; - - int pos2 = m_inbuffer.indexOf('\n', pos1); - if (pos2 == -1) - break; - - const int len = m_inbuffer.mid(pos1, pos2 - pos1).trimmed().toInt(); - if (len < 4) - break; - - pos2 += 3; // Skip \r\n\r - - if (pos2 + len > m_inbuffer.size()) - break; - - QJsonParseError error; - const auto doc = QJsonDocument::fromJson(m_inbuffer.mid(pos2, len), &error); - - m_inbuffer = m_inbuffer.mid(pos2 + len); - - handleOutput(doc); - } -} - -void DapEngine::handleOutput(const QJsonDocument &data) -{ - QJsonObject ob = data.object(); - - const QJsonValue t = ob.value("type"); - const QString type = t.toString(); - - qCDebug(dapEngineLog) << "dap response" << ob; - - if (type == "response") { - handleResponse(ob); - return; - } - - if (type == "event") { - handleEvent(ob); - return; - } - - showMessage("UNKNOWN TYPE:" + type); -} - -void DapEngine::handleResponse(const QJsonObject &response) +void DapEngine::handleResponse(DapResponseType type, const QJsonObject &response) { const QString command = response.value("command").toString(); - if (command == "configurationDone") { + switch (type) { + case DapResponseType::ConfigurationDone: showMessage("configurationDone", LogDebug); qCDebug(dapEngineLog) << "configurationDone success"; notifyEngineRunAndInferiorRunOk(); - return; - } - - if (command == "continue") { + break; + case DapResponseType::Continue: showMessage("continue", LogDebug); qCDebug(dapEngineLog) << "continue success"; notifyInferiorRunOk(); - return; - } - - if (command == "stackTrace") { + break; + case DapResponseType::StackTrace: handleStackTraceResponse(response); - return; - } - - if (command == "scopes") { + break; + case DapResponseType::Scopes: handleScopesResponse(response); - return; - } - - if (command == "variables") { + break; + case DapResponseType::Variables: { auto variables = response.value("body").toObject().value("variables").toArray(); refreshLocals(variables); - return; + break; } - - if (command == "stepIn" || command == "stepOut" || command == "next") { + case DapResponseType::StepIn: + case DapResponseType::StepOut: + case DapResponseType::StepOver: if (response.value("success").toBool()) { showMessage(command, LogDebug); notifyInferiorRunOk(); } else { notifyInferiorRunFailed(); } - return; - } - - if (command == "threads") { + break; + case DapResponseType::DapThreads: handleThreadsResponse(response); - return; - } + break; - showMessage("UNKNOWN RESPONSE:" + command); + default: + showMessage("UNKNOWN RESPONSE:" + command); + }; } void DapEngine::handleStackTraceResponse(const QJsonObject &response) @@ -743,7 +539,7 @@ void DapEngine::handleStackTraceResponse(const QJsonObject &response) gotoLocation(Location(file, line)); refreshStack(stackFrames); - dapScopes(stackFrame.value("id").toInt()); + m_dapClient->scopes(stackFrame.value("id").toInt()); } void DapEngine::handleScopesResponse(const QJsonObject &response) @@ -761,7 +557,7 @@ void DapEngine::handleScopesResponse(const QJsonObject &response) m_currentWatchItem = m_rootWatchItem; watchHandler()->removeAllData(); watchHandler()->notifyUpdateStarted(); - dapVariables(variablesReference); + m_dapClient->variables(variablesReference); } } } @@ -785,18 +581,33 @@ void DapEngine::handleThreadsResponse(const QJsonObject &response) handler->setCurrentThread(threadsHandler()->threadForId(QString::number(m_currentThreadId))); } -void DapEngine::handleEvent(const QJsonObject &event) +void DapEngine::handleEvent(DapEventType type, const QJsonObject &event) { const QString eventType = event.value("event").toString(); const QJsonObject body = event.value("body").toObject(); showMessage(eventType, LogDebug); - if (eventType == "exited") { + switch (type) { + case DapEventType::Initialized: + qCDebug(dapEngineLog) << "initialize success"; + handleDapLaunch(); + handleDapConfigurationDone(); + break; + case DapEventType::Stopped: + handleStoppedEvent(event); + break; + case DapEventType::Exited: notifyInferiorExited(); - return; - } - - if (eventType == "output") { + break; + case DapEventType::DapThread: + m_dapClient->threads(); + if (body.value("reason").toString() == "started" && body.value("threadId").toInt() == 1) + claimInitialBreakpoints(); + break; + case DapEventType::DapBreakpoint: + handleBreakpointEvent(event); + break; + case DapEventType::Output: { const QString category = body.value("category").toString(); const QString output = body.value("output").toString(); if (category == "stdout") @@ -805,34 +616,11 @@ void DapEngine::handleEvent(const QJsonObject &event) showMessage(output, AppError); else showMessage(output, LogDebug); - return; + break; } - - if (eventType == "initialized") { - qCDebug(dapEngineLog) << "initialize success"; - handleDapLaunch(); - handleDapConfigurationDone(); - return; - } - - if (eventType == "stopped") { - handleStoppedEvent(event); - return; - } - - if (eventType == "thread") { - threads(); - if (body.value("reason").toString() == "started" && body.value("threadId").toInt() == 1) - claimInitialBreakpoints(); - return; - } - - if (eventType == "breakpoint") { - handleBreakpointEvent(event); - return; - } - - showMessage("UNKNOWN EVENT:" + eventType); + default: + showMessage("UNKNOWN EVENT:" + eventType); + }; } void DapEngine::handleStoppedEvent(const QJsonObject &event) @@ -857,8 +645,8 @@ void DapEngine::handleStoppedEvent(const QJsonObject &event) else notifyInferiorSpontaneousStop(); - dapStackTrace(); - threads(); + m_dapClient->stackTrace(m_currentThreadId); + m_dapClient->threads(); } void DapEngine::handleBreakpointEvent(const QJsonObject &event) @@ -936,7 +724,7 @@ void DapEngine::refreshLocals(const QJsonArray &variables) const auto front = m_variablesReferenceQueue.front(); m_variablesReferenceQueue.pop(); - dapVariables(front.first); + m_dapClient->variables(front.first); m_currentWatchItem = front.second; } @@ -977,7 +765,7 @@ void DapEngine::updateAll() void DapEngine::updateLocals() { - dapStackTrace(); + m_dapClient->stackTrace(m_currentThreadId); } bool DapEngine::hasCapability(unsigned cap) const @@ -996,19 +784,18 @@ void DapEngine::claimInitialBreakpoints() void DapEngine::connectDataGeneratorSignals() { - if (!m_dataGenerator) + if (!m_dapClient) return; - connect(m_dataGenerator.get(), &IDataProvider::started, this, &DapEngine::handleDapStarted); - connect(m_dataGenerator.get(), &IDataProvider::done, this, &DapEngine::handleDapDone); - connect(m_dataGenerator.get(), - &IDataProvider::readyReadStandardOutput, - this, - &DapEngine::readDapStandardOutput); - connect(m_dataGenerator.get(), - &IDataProvider::readyReadStandardError, + connect(m_dapClient.get(), &DapClient::started, this, &DapEngine::handleDapStarted); + connect(m_dapClient.get(), &DapClient::done, this, &DapEngine::handleDapDone); + connect(m_dapClient.get(), + &DapClient::readyReadStandardError, this, &DapEngine::readDapStandardError); + + connect(m_dapClient.get(), &DapClient::responseReady, this, &DapEngine::handleResponse); + connect(m_dapClient.get(), &DapClient::eventReady, this, &DapEngine::handleEvent); } DebuggerEngine *createDapEngine(Utils::Id runMode) diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 6871e3e468e..c4f332668e5 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -13,38 +13,16 @@ namespace Debugger::Internal { +class DapClient; class DebuggerCommand; +class IDataProvider; class GdbMi; +enum class DapResponseType; +enum class DapEventType; /* * A debugger engine for the debugger adapter protocol. */ - -class IDataProvider : public QObject -{ - Q_OBJECT -public: - virtual void start() = 0; - virtual bool isRunning() const = 0; - virtual void writeRaw(const QByteArray &input) = 0; - virtual void kill() = 0; - virtual QByteArray readAllStandardOutput() = 0; - virtual QString readAllStandardError() = 0; - virtual int exitCode() const = 0; - virtual QString executable() const = 0; - - virtual QProcess::ExitStatus exitStatus() const = 0; - virtual QProcess::ProcessError error() const = 0; - virtual Utils::ProcessResult result() const = 0; - virtual QString exitMessage() const = 0; - -signals: - void started(); - void done(); - void readyReadStandardOutput(); - void readyReadStandardError(); -}; - class DapEngine : public DebuggerEngine { public: @@ -91,7 +69,6 @@ protected: void updateItem(const QString &iname) override; void runCommand(const DebuggerCommand &cmd) override; - void postDirectCommand(const QJsonObject &ob); void refreshLocation(const GdbMi &reportedLocation); void refreshStack(const QJsonArray &stackFrames); @@ -105,14 +82,10 @@ protected: void claimInitialBreakpoints(); - virtual void handleDapStarted(); + void handleDapStarted(); void handleDapLaunch(); void handleDapConfigurationDone(); - void dapStackTrace(); - void dapScopes(int frameId); - void threads(); - void dapVariables(int variablesReference); void dapRemoveBreakpoint(const Breakpoint &bp); void dapInsertBreakpoint(const Breakpoint &bp); @@ -120,14 +93,12 @@ protected: void readDapStandardOutput(); void readDapStandardError(); - void handleOutput(const QJsonDocument &data); - - void handleResponse(const QJsonObject &response); + void handleResponse(DapResponseType type, const QJsonObject &response); void handleStackTraceResponse(const QJsonObject &response); void handleScopesResponse(const QJsonObject &response); void handleThreadsResponse(const QJsonObject &response); - void handleEvent(const QJsonObject &event); + void handleEvent(DapEventType type, const QJsonObject &event); void handleBreakpointEvent(const QJsonObject &event); void handleStoppedEvent(const QJsonObject &event); @@ -136,7 +107,7 @@ protected: void connectDataGeneratorSignals(); QByteArray m_inbuffer; - std::unique_ptr<IDataProvider> m_dataGenerator = nullptr; + std::unique_ptr<DapClient> m_dapClient = nullptr; int m_nextBreakpointId = 1; int m_currentThreadId = -1; diff --git a/src/plugins/debugger/dap/gdbdapengine.cpp b/src/plugins/debugger/dap/gdbdapengine.cpp index 316a0c7d547..7d0cefaa9ca 100644 --- a/src/plugins/debugger/dap/gdbdapengine.cpp +++ b/src/plugins/debugger/dap/gdbdapengine.cpp @@ -3,6 +3,8 @@ #include "gdbdapengine.h" +#include "dapclient.h" + #include <debugger/debuggermainwindow.h> #include <utils/temporarydirectory.h> @@ -87,9 +89,11 @@ void GdbDapEngine::setupEngine() const DebuggerRunParameters &rp = runParameters(); const CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}}; - m_dataGenerator = std::make_unique<ProcessDataProvider>(rp, cmd); + std::unique_ptr<IDataProvider> dataProvider = std::make_unique<ProcessDataProvider>(rp, cmd); + m_dapClient = std::make_unique<DapClient>(std::move(dataProvider)); + connectDataGeneratorSignals(); - m_dataGenerator->start(); + m_dapClient->dataProvider()->start(); notifyEngineSetupOk(); } From 5b8600fd376334fbf3e3e1734a46af8fad7f7fb1 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 17 Aug 2023 11:43:23 +0200 Subject: [PATCH 0776/1777] LanguageClient: Rename ClientRequestTask -> ClientRequest Make naming consistent. Fixes: QTCREATORBUG-29102 Change-Id: I215cdc524168df2783497a56c7daf87563db716d Reviewed-by: David Schulz <david.schulz@qt.io> --- .../languageclient/clientrequesttask.cpp | 8 ++++---- src/plugins/languageclient/clientrequesttask.h | 17 +++++++++-------- src/plugins/languageclient/locatorfilter.cpp | 6 +++--- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/plugins/languageclient/clientrequesttask.cpp b/src/plugins/languageclient/clientrequesttask.cpp index 6da5be5704c..31635b3fc34 100644 --- a/src/plugins/languageclient/clientrequesttask.cpp +++ b/src/plugins/languageclient/clientrequesttask.cpp @@ -7,21 +7,21 @@ using namespace LanguageServerProtocol; namespace LanguageClient { -WorkspaceSymbolRequestTaskAdapter::WorkspaceSymbolRequestTaskAdapter() +ClientWorkspaceSymbolRequestTaskAdapter::ClientWorkspaceSymbolRequestTaskAdapter() { task()->setResponseCallback([this](const WorkspaceSymbolRequest::Response &response){ emit done(response.result().has_value()); }); } -void WorkspaceSymbolRequestTaskAdapter::start() +void ClientWorkspaceSymbolRequestTaskAdapter::start() { task()->start(); } -bool WorkspaceSymbolRequestTask::preStartCheck() +bool ClientWorkspaceSymbolRequest::preStartCheck() { - if (!ClientRequestTask::preStartCheck()) + if (!ClientRequest::preStartCheck()) return false; const std::optional<std::variant<bool, WorkDoneProgressOptions>> capability diff --git a/src/plugins/languageclient/clientrequesttask.h b/src/plugins/languageclient/clientrequesttask.h index 92e72427a39..d1ed3161741 100644 --- a/src/plugins/languageclient/clientrequesttask.h +++ b/src/plugins/languageclient/clientrequesttask.h @@ -16,10 +16,10 @@ namespace LanguageClient { template <typename Request> -class LANGUAGECLIENT_EXPORT ClientRequestTask +class LANGUAGECLIENT_EXPORT ClientRequest { public: - virtual ~ClientRequestTask() + virtual ~ClientRequest() { if (m_id) m_client->cancelRequest(*m_id); // In order to not to invoke a response callback anymore @@ -60,21 +60,22 @@ private: typename Request::Response m_response; }; -class LANGUAGECLIENT_EXPORT WorkspaceSymbolRequestTask - : public ClientRequestTask<LanguageServerProtocol::WorkspaceSymbolRequest> +class LANGUAGECLIENT_EXPORT ClientWorkspaceSymbolRequest + : public ClientRequest<LanguageServerProtocol::WorkspaceSymbolRequest> { public: bool preStartCheck() override; }; -class LANGUAGECLIENT_EXPORT WorkspaceSymbolRequestTaskAdapter - : public Tasking::TaskAdapter<WorkspaceSymbolRequestTask> +class LANGUAGECLIENT_EXPORT ClientWorkspaceSymbolRequestTaskAdapter + : public Tasking::TaskAdapter<ClientWorkspaceSymbolRequest> { public: - WorkspaceSymbolRequestTaskAdapter(); + ClientWorkspaceSymbolRequestTaskAdapter(); void start() final; }; -using SymbolRequest = Tasking::CustomTask<WorkspaceSymbolRequestTaskAdapter>; +using ClientWorkspaceSymbolRequestTask + = Tasking::CustomTask<ClientWorkspaceSymbolRequestTaskAdapter>; } // namespace LanguageClient diff --git a/src/plugins/languageclient/locatorfilter.cpp b/src/plugins/languageclient/locatorfilter.cpp index 61a6d187daa..9909e0e6c4d 100644 --- a/src/plugins/languageclient/locatorfilter.cpp +++ b/src/plugins/languageclient/locatorfilter.cpp @@ -51,7 +51,7 @@ LocatorMatcherTask locatorMatcher(Client *client, int maxResultCount, TreeStorage<LocatorStorage> storage; TreeStorage<QList<SymbolInformation>> resultStorage; - const auto onQuerySetup = [storage, client, maxResultCount](WorkspaceSymbolRequestTask &request) { + const auto onQuerySetup = [storage, client, maxResultCount](ClientWorkspaceSymbolRequest &request) { request.setClient(client); WorkspaceSymbolParams params; params.setQuery(storage->input()); @@ -59,7 +59,7 @@ LocatorMatcherTask locatorMatcher(Client *client, int maxResultCount, params.setLimit(maxResultCount); request.setParams(params); }; - const auto onQueryDone = [resultStorage](const WorkspaceSymbolRequestTask &request) { + const auto onQueryDone = [resultStorage](const ClientWorkspaceSymbolRequest &request) { const std::optional<LanguageClientArray<SymbolInformation>> result = request.response().result(); if (result.has_value()) @@ -77,7 +77,7 @@ LocatorMatcherTask locatorMatcher(Client *client, int maxResultCount, const Group root { Storage(resultStorage), - SymbolRequest(onQuerySetup, onQueryDone), + ClientWorkspaceSymbolRequestTask(onQuerySetup, onQueryDone), AsyncTask<void>(onFilterSetup) }; return {root, storage}; From 0ffc4ac89ebe57eb3130a9ab10f60ff3f7e1cc07 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 17 Aug 2023 11:49:12 +0200 Subject: [PATCH 0777/1777] LanguageClient: Rename clientrequesttask.{cpp,h} -> clientrequest.{cpp,h} Change-Id: Ia6a1b65564795c8f2931efb1030d7a189a18d68b Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/languageclient/CMakeLists.txt | 2 +- .../{clientrequesttask.cpp => clientrequest.cpp} | 2 +- .../languageclient/{clientrequesttask.h => clientrequest.h} | 0 src/plugins/languageclient/languageclient.qbs | 4 ++-- src/plugins/languageclient/locatorfilter.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename src/plugins/languageclient/{clientrequesttask.cpp => clientrequest.cpp} (96%) rename src/plugins/languageclient/{clientrequesttask.h => clientrequest.h} (100%) diff --git a/src/plugins/languageclient/CMakeLists.txt b/src/plugins/languageclient/CMakeLists.txt index 03924f62052..3bde89f27e3 100644 --- a/src/plugins/languageclient/CMakeLists.txt +++ b/src/plugins/languageclient/CMakeLists.txt @@ -10,7 +10,7 @@ add_qtc_plugin(LanguageClient SOURCES callhierarchy.cpp callhierarchy.h client.cpp client.h - clientrequesttask.cpp clientrequesttask.h + clientrequest.cpp clientrequest.h currentdocumentsymbolsrequest.cpp currentdocumentsymbolsrequest.h diagnosticmanager.cpp diagnosticmanager.h documentsymbolcache.cpp documentsymbolcache.h diff --git a/src/plugins/languageclient/clientrequesttask.cpp b/src/plugins/languageclient/clientrequest.cpp similarity index 96% rename from src/plugins/languageclient/clientrequesttask.cpp rename to src/plugins/languageclient/clientrequest.cpp index 31635b3fc34..630a1b01940 100644 --- a/src/plugins/languageclient/clientrequesttask.cpp +++ b/src/plugins/languageclient/clientrequest.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "clientrequesttask.h" +#include "clientrequest.h" using namespace LanguageServerProtocol; diff --git a/src/plugins/languageclient/clientrequesttask.h b/src/plugins/languageclient/clientrequest.h similarity index 100% rename from src/plugins/languageclient/clientrequesttask.h rename to src/plugins/languageclient/clientrequest.h diff --git a/src/plugins/languageclient/languageclient.qbs b/src/plugins/languageclient/languageclient.qbs index f036c44e994..bfb29ded282 100644 --- a/src/plugins/languageclient/languageclient.qbs +++ b/src/plugins/languageclient/languageclient.qbs @@ -22,8 +22,8 @@ QtcPlugin { "callhierarchy.h", "client.cpp", "client.h", - "clientrequesttask.cpp", - "clientrequesttask.h", + "clientrequest.cpp", + "clientrequest.h", "currentdocumentsymbolsrequest.cpp", "currentdocumentsymbolsrequest.h", "diagnosticmanager.cpp", diff --git a/src/plugins/languageclient/locatorfilter.cpp b/src/plugins/languageclient/locatorfilter.cpp index 9909e0e6c4d..f2f14e7d7c2 100644 --- a/src/plugins/languageclient/locatorfilter.cpp +++ b/src/plugins/languageclient/locatorfilter.cpp @@ -3,7 +3,7 @@ #include "locatorfilter.h" -#include "clientrequesttask.h" +#include "clientrequest.h" #include "currentdocumentsymbolsrequest.h" #include "languageclientmanager.h" #include "languageclienttr.h" From 886205b149d0aa3f5ca0a1ff8e761760dd1a2263 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 21:15:45 +0200 Subject: [PATCH 0778/1777] FileUtils: Use Process::startDetached() instead of QProcess Reading data from the detached process is no-op. Change-Id: I128ecc5298e0e6d4a73ecfceba55bc147ffd3a58 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/coreplugin/fileutils.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugins/coreplugin/fileutils.cpp b/src/plugins/coreplugin/fileutils.cpp index 8b1a5122d35..e432543604f 100644 --- a/src/plugins/coreplugin/fileutils.cpp +++ b/src/plugins/coreplugin/fileutils.cpp @@ -31,7 +31,6 @@ #include <QRegularExpression> #include <QTextStream> #include <QTextCodec> -#include <QWidget> using namespace Utils; @@ -82,12 +81,8 @@ void FileUtils::showInGraphicalShell(QWidget *parent, const FilePath &pathIn) if (browserArgs.isEmpty()) { error = Tr::tr("The command for file browser is not set."); } else { - QProcess browserProc; - browserProc.setProgram(browserArgs.takeFirst()); - browserProc.setArguments(browserArgs); - const bool success = browserProc.startDetached(); - error = QString::fromLocal8Bit(browserProc.readAllStandardError()); - if (!success && error.isEmpty()) + const QString executable = browserArgs.takeFirst(); + if (!Process::startDetached({FilePath::fromString(executable), browserArgs})) error = Tr::tr("Error while starting file browser."); } if (!error.isEmpty()) From 3fa4fa5cf331b81a12fedcf67514094c741f3bf0 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 28 Jul 2023 16:08:36 +0200 Subject: [PATCH 0779/1777] Wizards: Use simpler init() signature in the Creator Plugin template This is the most common case by far. Also add a hint for special needs. Change-Id: Ib4d708d90a3b2dd91d18fa53c3fb597304145697 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../templates/wizards/qtcreatorplugin/myplugin.cpp | 9 ++++----- .../templates/wizards/qtcreatorplugin/myplugin.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp index ae3082c357d..e25c6a22c33 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp @@ -26,7 +26,7 @@ namespace %{PluginName}::Internal { // Delete members } -bool %{CN}::initialize(const QStringList &arguments, QString *errorString) +void %{CN}::initialize() { // Register objects in the plugin manager's object pool // Load settings @@ -35,8 +35,9 @@ bool %{CN}::initialize(const QStringList &arguments, QString *errorString) // In the initialize function, a plugin can be sure that the plugins it // depends on have initialized their members. - Q_UNUSED(arguments) - Q_UNUSED(errorString) + // If you need access to command line arguments or to report errors, use the + // bool IPlugin::initialize(const QStringList &arguments, QString *errorString) + // overload. auto action = new QAction(tr("%{PluginName} Action"), this); Core::Command *cmd = Core::ActionManager::registerAction(action, Constants::ACTION_ID, @@ -48,8 +49,6 @@ bool %{CN}::initialize(const QStringList &arguments, QString *errorString) menu->menu()->setTitle(tr("%{PluginName}")); menu->addAction(cmd); Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu); - - return true; } void %{CN}::extensionsInitialized() diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h index f605c10da97..90051d00dbd 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h @@ -15,7 +15,7 @@ public: %{CN}(); ~%{CN}() override; - bool initialize(const QStringList &arguments, QString *errorString) override; + void initialize() override; void extensionsInitialized() override; ShutdownFlag aboutToShutdown() override; From ec7abcf98c5915364cd354d8ee62c645bcdd3a8d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 12:51:13 +0200 Subject: [PATCH 0780/1777] Utils: Make FilePathAspect::setDefaultValue take a QString This sets the unexpanded value, so going to a "cooked" FilePath can at least theoretically break. On the user side it saves a roundtrip in a few cases, but is more ugly when the input is already a proper FilePath. Change-Id: I8a7e8f6d46fcc34c96b55e41d656dca933fbef4e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 4 ++-- src/libs/utils/aspects.h | 2 +- src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | 2 +- src/plugins/conan/conansettings.cpp | 2 +- src/plugins/copilot/copilotsettings.cpp | 4 ++-- src/plugins/cpaster/fileshareprotocolsettingspage.cpp | 2 +- src/plugins/cppcheck/cppchecksettings.cpp | 4 ++-- src/plugins/docker/dockersettings.cpp | 2 +- src/plugins/haskell/haskellsettings.cpp | 4 ++-- src/plugins/perforce/perforcesettings.cpp | 3 ++- src/plugins/terminal/terminalsettings.cpp | 8 ++++---- src/plugins/vcpkg/vcpkgsettings.cpp | 4 ++-- src/plugins/vcsbase/commonvcssettings.cpp | 2 +- src/plugins/webassembly/webassemblysettings.cpp | 2 +- 14 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 5cbd8f9bdbe..cbb0b300708 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1312,9 +1312,9 @@ void FilePathAspect::setValue(const QString &filePath, Announcement howToAnnounc TypedAspect::setValue(filePath, howToAnnounce); } -void FilePathAspect::setDefaultValue(const FilePath &filePath) +void FilePathAspect::setDefaultValue(const QString &filePath) { - TypedAspect::setDefaultValue(filePath.toUserOutput()); + TypedAspect::setDefaultValue(filePath); } /*! diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 33e72604753..5779d45dd90 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -592,7 +592,7 @@ public: QString value() const; void setValue(const FilePath &filePath, Announcement howToAnnounce = DoEmit); void setValue(const QString &filePath, Announcement howToAnnounce = DoEmit); - void setDefaultValue(const FilePath &filePath); + void setDefaultValue(const QString &filePath); void setPromptDialogFilter(const QString &filter); void setPromptDialogTitle(const QString &title); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index d892c38f7d0..638586974ac 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -222,7 +222,7 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Id id) : stagingDir.setSettingsKey(STAGING_DIR_KEY); stagingDir.setLabelText(Tr::tr("Staging directory:")); - stagingDir.setDefaultValue(FilePath::fromUserInput(initialStagingDir(kit()))); + stagingDir.setDefaultValue(initialStagingDir(kit())); Kit *kit = buildConfiguration()->kit(); if (CMakeBuildConfiguration::isIos(kit)) { diff --git a/src/plugins/conan/conansettings.cpp b/src/plugins/conan/conansettings.cpp index d3e5d9d09b0..c6379e50826 100644 --- a/src/plugins/conan/conansettings.cpp +++ b/src/plugins/conan/conansettings.cpp @@ -22,7 +22,7 @@ ConanSettings::ConanSettings() conanFilePath.setSettingsKey("ConanFilePath"); conanFilePath.setExpectedKind(PathChooser::ExistingCommand); - conanFilePath.setDefaultValue(FilePath::fromString(HostOsInfo::withExecutableSuffix("conan"))); + conanFilePath.setDefaultValue(HostOsInfo::withExecutableSuffix("conan")); readSettings(); } diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index 4a224c96b12..74988ca774f 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -56,7 +56,7 @@ CopilotSettings::CopilotSettings() const FilePath distFromVim = findOrDefault(searchDirs, &FilePath::exists); nodeJsPath.setExpectedKind(PathChooser::ExistingCommand); - nodeJsPath.setDefaultValue(nodeFromPath); + nodeJsPath.setDefaultValue(nodeFromPath.toUserOutput()); nodeJsPath.setSettingsKey("Copilot.NodeJsPath"); nodeJsPath.setLabelText(Tr::tr("Node.js path:")); nodeJsPath.setHistoryCompleter("Copilot.NodePath.History"); @@ -66,7 +66,7 @@ CopilotSettings::CopilotSettings() "for installation instructions.")); distPath.setExpectedKind(PathChooser::File); - distPath.setDefaultValue(distFromVim); + distPath.setDefaultValue(distFromVim.toUserOutput()); distPath.setSettingsKey("Copilot.DistPath"); distPath.setLabelText(Tr::tr("Path to agent.js:")); distPath.setHistoryCompleter("Copilot.DistPath.History"); diff --git a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp index a5da0a6aa82..ad60a2ad840 100644 --- a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp +++ b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp @@ -26,7 +26,7 @@ FileShareProtocolSettings::FileShareProtocolSettings() path.setSettingsKey("Path"); path.setExpectedKind(PathChooser::ExistingDirectory); - path.setDefaultValue(TemporaryDirectory::masterDirectoryFilePath()); + path.setDefaultValue(TemporaryDirectory::masterDirectoryPath()); path.setLabelText(Tr::tr("&Path:")); displayCount.setSettingsKey("DisplayCount"); diff --git a/src/plugins/cppcheck/cppchecksettings.cpp b/src/plugins/cppcheck/cppchecksettings.cpp index 926a8f9813b..142d3ac236f 100644 --- a/src/plugins/cppcheck/cppchecksettings.cpp +++ b/src/plugins/cppcheck/cppchecksettings.cpp @@ -44,10 +44,10 @@ CppcheckSettings::CppcheckSettings() if (HostOsInfo::isAnyUnixHost()) { binary.setDefaultValue("cppcheck"); } else { - FilePath programFiles = FilePath::fromUserInput(qtcEnvironmentVariable("PROGRAMFILES")); + QString programFiles = qtcEnvironmentVariable("PROGRAMFILES"); if (programFiles.isEmpty()) programFiles = "C:/Program Files"; - binary.setDefaultValue(programFiles.pathAppended("Cppcheck/cppcheck.exe")); + binary.setDefaultValue(programFiles + "/Cppcheck/cppcheck.exe"); } warning.setSettingsKey("warning"); diff --git a/src/plugins/docker/dockersettings.cpp b/src/plugins/docker/dockersettings.cpp index 79ebb64841e..925ed6559b8 100644 --- a/src/plugins/docker/dockersettings.cpp +++ b/src/plugins/docker/dockersettings.cpp @@ -49,7 +49,7 @@ DockerSettings::DockerSettings() dockerBinaryPath.setExpectedKind(PathChooser::ExistingCommand); dockerBinaryPath.setDefaultValue( - FilePath::fromString("docker").searchInPath(additionalPaths)); + FilePath::fromString("docker").searchInPath(additionalPaths).toUserOutput()); dockerBinaryPath.setDisplayName(Tr::tr("Docker CLI")); dockerBinaryPath.setHistoryCompleter("Docker.Command.History"); dockerBinaryPath.setLabelText(Tr::tr("Command:")); diff --git a/src/plugins/haskell/haskellsettings.cpp b/src/plugins/haskell/haskellsettings.cpp index ce13a5fddda..ffc6fa066dc 100644 --- a/src/plugins/haskell/haskellsettings.cpp +++ b/src/plugins/haskell/haskellsettings.cpp @@ -33,8 +33,8 @@ HaskellSettings::HaskellSettings() // stack from brew or the installer script from https://docs.haskellstack.org // install to /usr/local/bin. stackPath.setDefaultValue(HostOsInfo::isAnyUnixHost() - ? FilePath::fromString("/usr/local/bin/stack") - : FilePath::fromString("stack")); + ? QLatin1String("/usr/local/bin/stack") + : QLatin1String("stack")); setLayouter([this] { using namespace Layouting; diff --git a/src/plugins/perforce/perforcesettings.cpp b/src/plugins/perforce/perforcesettings.cpp index 93648a55c87..6f7691c054f 100644 --- a/src/plugins/perforce/perforcesettings.cpp +++ b/src/plugins/perforce/perforcesettings.cpp @@ -42,7 +42,8 @@ PerforceSettings::PerforceSettings() setAutoApply(false); p4BinaryPath.setSettingsKey("Command"); - p4BinaryPath.setDefaultValue(Environment::systemEnvironment().searchInPath(defaultCommand())); + p4BinaryPath.setDefaultValue( + Environment::systemEnvironment().searchInPath(defaultCommand()).toUserOutput()); p4BinaryPath.setHistoryCompleter("Perforce.Command.History"); p4BinaryPath.setExpectedKind(PathChooser::Command); p4BinaryPath.setDisplayName(Tr::tr("Perforce Command")); diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index b86cce402d8..46fe21426d2 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -50,16 +50,16 @@ static int defaultFontSize() return 10; } -static FilePath defaultShell() +static QString defaultShell() { if (HostOsInfo::isWindowsHost()) - return FilePath::fromUserInput(qtcEnvironmentVariable("COMSPEC")); + return qtcEnvironmentVariable("COMSPEC"); FilePath defaultShell = FilePath::fromUserInput(qtcEnvironmentVariable("SHELL")); if (defaultShell.isExecutableFile()) - return defaultShell; + return defaultShell.toUserOutput(); - return Environment::systemEnvironment().searchInPath("sh"); + return Environment::systemEnvironment().searchInPath("sh").toUserOutput(); } void setupColor(TerminalSettings *settings, diff --git a/src/plugins/vcpkg/vcpkgsettings.cpp b/src/plugins/vcpkg/vcpkgsettings.cpp index 338c77df8df..da91ef486b6 100644 --- a/src/plugins/vcpkg/vcpkgsettings.cpp +++ b/src/plugins/vcpkg/vcpkgsettings.cpp @@ -37,10 +37,10 @@ VcpkgSettings::VcpkgSettings() vcpkgRoot.setExpectedKind(PathChooser::ExistingDirectory); FilePath defaultPath = Environment::systemEnvironment().searchInPath(Constants::VCPKG_COMMAND) .parentDir(); - if (!defaultPath.isDir()) + if (defaultPath.isDir()) defaultPath = FilePath::fromUserInput(qtcEnvironmentVariable(Constants::ENVVAR_VCPKG_ROOT)); if (defaultPath.isDir()) - vcpkgRoot.setDefaultValue(defaultPath); + vcpkgRoot.setDefaultValue(defaultPath.toUserOutput()); setLayouter([this] { using namespace Layouting; diff --git a/src/plugins/vcsbase/commonvcssettings.cpp b/src/plugins/vcsbase/commonvcssettings.cpp index f631c20d953..8b9d179c666 100644 --- a/src/plugins/vcsbase/commonvcssettings.cpp +++ b/src/plugins/vcsbase/commonvcssettings.cpp @@ -66,7 +66,7 @@ CommonVcsSettings::CommonVcsSettings() sshPasswordPrompt.setSettingsKey("SshPasswordPrompt"); sshPasswordPrompt.setExpectedKind(PathChooser::ExistingCommand); sshPasswordPrompt.setHistoryCompleter("Vcs.SshPrompt.History"); - sshPasswordPrompt.setDefaultValue(FilePath::fromUserInput(sshPasswordPromptDefault())); + sshPasswordPrompt.setDefaultValue(sshPasswordPromptDefault()); sshPasswordPrompt.setLabelText(Tr::tr("&SSH prompt command:")); sshPasswordPrompt.setToolTip(Tr::tr("Specifies a command that is executed to graphically prompt " "for a password,\nshould a repository require SSH-authentication " diff --git a/src/plugins/webassembly/webassemblysettings.cpp b/src/plugins/webassembly/webassemblysettings.cpp index 7c385e3851f..e6ad931ccb9 100644 --- a/src/plugins/webassembly/webassemblysettings.cpp +++ b/src/plugins/webassembly/webassemblysettings.cpp @@ -56,7 +56,7 @@ WebAssemblySettings::WebAssemblySettings() emSdk.setSettingsKey("EmSdk"); emSdk.setExpectedKind(Utils::PathChooser::ExistingDirectory); - emSdk.setDefaultValue(FileUtils::homePath()); + emSdk.setDefaultValue(QDir::homePath()); connect(this, &Utils::AspectContainer::applied, &WebAssemblyToolChain::registerToolChains); From 17d8f61f93d180f4b9d2091bd2a59ad48d5db791 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 17 Aug 2023 14:08:06 +0200 Subject: [PATCH 0781/1777] ProcessParameters: Reuse ProcessRunData Change-Id: I0fdde4303d23ed1350cc36846319264f952df42b Reviewed-by: hjk <hjk@qt.io> --- .../projectexplorer/processparameters.cpp | 30 +++++++++---------- .../projectexplorer/processparameters.h | 16 ++++------ 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/plugins/projectexplorer/processparameters.cpp b/src/plugins/projectexplorer/processparameters.cpp index 0b3d6d83c7a..d9338ad03a2 100644 --- a/src/plugins/projectexplorer/processparameters.cpp +++ b/src/plugins/projectexplorer/processparameters.cpp @@ -35,7 +35,7 @@ ProcessParameters::ProcessParameters() = default; */ void ProcessParameters::setCommandLine(const CommandLine &cmdLine) { - m_command = cmdLine; + m_runData.command = cmdLine; m_effectiveCommand.clear(); m_effectiveArguments.clear(); @@ -51,7 +51,7 @@ void ProcessParameters::setCommandLine(const CommandLine &cmdLine) void ProcessParameters::setWorkingDirectory(const FilePath &workingDirectory) { - m_workingDirectory = workingDirectory; + m_runData.workingDirectory = workingDirectory; m_effectiveWorkingDirectory.clear(); effectiveWorkingDirectory(); @@ -79,12 +79,12 @@ void ProcessParameters::setWorkingDirectory(const FilePath &workingDirectory) FilePath ProcessParameters::effectiveWorkingDirectory() const { if (m_effectiveWorkingDirectory.isEmpty()) { - m_effectiveWorkingDirectory = m_workingDirectory; - QString path = m_workingDirectory.path(); + m_effectiveWorkingDirectory = m_runData.workingDirectory; + QString path = m_runData.workingDirectory.path(); if (m_macroExpander) path = m_macroExpander->expand(path); - m_effectiveWorkingDirectory = - m_effectiveWorkingDirectory.withNewPath(QDir::cleanPath(m_environment.expandVariables(path))); + m_effectiveWorkingDirectory = m_effectiveWorkingDirectory.withNewPath( + QDir::cleanPath(m_runData.environment.expandVariables(path))); } return m_effectiveWorkingDirectory; } @@ -96,15 +96,15 @@ FilePath ProcessParameters::effectiveWorkingDirectory() const FilePath ProcessParameters::effectiveCommand() const { if (m_effectiveCommand.isEmpty()) { - FilePath cmd = m_command.executable(); + FilePath cmd = m_runData.command.executable(); if (m_macroExpander) cmd = m_macroExpander->expand(cmd); if (cmd.needsDevice()) { // Assume this is already good. FIXME: It is possibly not, so better fix searchInPath. m_effectiveCommand = cmd; } else { - m_effectiveCommand = m_environment.searchInPath(cmd.toString(), - {effectiveWorkingDirectory()}); + m_effectiveCommand = m_runData.environment.searchInPath(cmd.toString(), + {effectiveWorkingDirectory()}); } m_commandMissing = m_effectiveCommand.isEmpty(); if (m_commandMissing) @@ -126,7 +126,7 @@ bool ProcessParameters::commandMissing() const QString ProcessParameters::effectiveArguments() const { if (m_effectiveArguments.isEmpty()) { - m_effectiveArguments = m_command.arguments(); + m_effectiveArguments = m_runData.command.arguments(); if (m_macroExpander) m_effectiveArguments = m_macroExpander->expand(m_effectiveArguments); } @@ -135,7 +135,7 @@ QString ProcessParameters::effectiveArguments() const QString ProcessParameters::prettyCommand() const { - QString cmd = m_command.executable().toString(); + QString cmd = m_runData.command.executable().toString(); if (m_macroExpander) cmd = m_macroExpander->expand(cmd); return FilePath::fromString(cmd).fileName(); @@ -143,11 +143,11 @@ QString ProcessParameters::prettyCommand() const QString ProcessParameters::prettyArguments() const { - QString margs = effectiveArguments(); - FilePath workDir = effectiveWorkingDirectory(); + const QString margs = effectiveArguments(); + const FilePath workDir = effectiveWorkingDirectory(); ProcessArgs::SplitError err; - ProcessArgs args = - ProcessArgs::prepareArgs(margs, &err, HostOsInfo::hostOs(), &m_environment, &workDir); + const ProcessArgs args = ProcessArgs::prepareArgs(margs, &err, HostOsInfo::hostOs(), + &m_runData.environment, &workDir); if (err != ProcessArgs::SplitOk) return margs; // Sorry, too complex - just fall back. return args.toString(); diff --git a/src/plugins/projectexplorer/processparameters.h b/src/plugins/projectexplorer/processparameters.h index 23ebad028dc..ce418b65c28 100644 --- a/src/plugins/projectexplorer/processparameters.h +++ b/src/plugins/projectexplorer/processparameters.h @@ -5,9 +5,7 @@ #include "projectexplorer_export.h" -#include <utils/commandline.h> -#include <utils/environment.h> -#include <utils/fileutils.h> +#include <utils/processinterface.h> namespace Utils { class MacroExpander; @@ -22,13 +20,13 @@ public: ProcessParameters(); void setCommandLine(const Utils::CommandLine &cmdLine); - Utils::CommandLine command() const { return m_command; } + Utils::CommandLine command() const { return m_runData.command; } void setWorkingDirectory(const Utils::FilePath &workingDirectory); - Utils::FilePath workingDirectory() const { return m_workingDirectory; } + Utils::FilePath workingDirectory() const { return m_runData.workingDirectory; } - void setEnvironment(const Utils::Environment &env) { m_environment = env; } - Utils::Environment environment() const { return m_environment; } + void setEnvironment(const Utils::Environment &env) { m_runData.environment = env; } + Utils::Environment environment() const { return m_runData.environment; } void setMacroExpander(Utils::MacroExpander *mx) { m_macroExpander = mx; } Utils::MacroExpander *macroExpander() const { return m_macroExpander; } @@ -49,9 +47,7 @@ public: QString summaryInWorkdir(const QString &displayName) const; private: - Utils::FilePath m_workingDirectory; - Utils::CommandLine m_command; - Utils::Environment m_environment; + Utils::ProcessRunData m_runData; Utils::MacroExpander *m_macroExpander = nullptr; mutable Utils::FilePath m_effectiveWorkingDirectory; From e3808cf4f41a83b6a3a4980529c133dde90f52cd Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 17 Aug 2023 13:32:55 +0200 Subject: [PATCH 0782/1777] DAP: Change unique_ptr to QObject parenting Change-Id: I47f5db1823e69829294fb9f551a2edcb980d86dc Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/cmakedapengine.cpp | 20 +++++++++++--------- src/plugins/debugger/dap/dapclient.cpp | 13 +++++++------ src/plugins/debugger/dap/dapclient.h | 10 ++++++---- src/plugins/debugger/dap/dapengine.cpp | 15 ++++++++++----- src/plugins/debugger/dap/dapengine.h | 3 ++- src/plugins/debugger/dap/gdbdapengine.cpp | 11 +++++++---- 6 files changed, 43 insertions(+), 29 deletions(-) diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp index 6d7996a1e1b..696fff10040 100644 --- a/src/plugins/debugger/dap/cmakedapengine.cpp +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -29,8 +29,9 @@ namespace Debugger::Internal { class LocalSocketDataProvider : public IDataProvider { public: - LocalSocketDataProvider(const QString &socketName) - : m_socketName(socketName) + LocalSocketDataProvider(const QString &socketName, QObject *parent = nullptr) + : IDataProvider(parent) + , m_socketName(socketName) { connect(&m_socket, &QLocalSocket::connected, this, &IDataProvider::started); connect(&m_socket, &QLocalSocket::disconnected, this, &IDataProvider::done); @@ -74,8 +75,8 @@ private: class CMakeDapClient : public DapClient { public: - CMakeDapClient(std::unique_ptr<IDataProvider> provider) - : DapClient(std::move(provider)) + CMakeDapClient(IDataProvider *provider, QObject *parent = nullptr) + : DapClient(provider, parent) {} void sendInitialize() @@ -102,14 +103,15 @@ void CMakeDapEngine::setupEngine() qCDebug(dapEngineLog) << "build system name" << ProjectExplorer::ProjectTree::currentBuildSystem()->name(); - std::unique_ptr<IDataProvider> dataProvider; + IDataProvider *dataProvider; if (TemporaryDirectory::masterDirectoryFilePath().osType() == Utils::OsType::OsTypeWindows) { - dataProvider = std::make_unique<LocalSocketDataProvider>("\\\\.\\pipe\\cmake-dap"); + dataProvider = new LocalSocketDataProvider("\\\\.\\pipe\\cmake-dap", this); } else { - dataProvider = std::make_unique<LocalSocketDataProvider>( - TemporaryDirectory::masterDirectoryPath() + "/cmake-dap.sock"); + dataProvider = new LocalSocketDataProvider(TemporaryDirectory::masterDirectoryPath() + + "/cmake-dap.sock", + this); } - m_dapClient = std::make_unique<CMakeDapClient>(std::move(dataProvider)); + m_dapClient = new CMakeDapClient(dataProvider, this); connectDataGeneratorSignals(); connect(ProjectExplorer::ProjectTree::currentBuildSystem(), diff --git a/src/plugins/debugger/dap/dapclient.cpp b/src/plugins/debugger/dap/dapclient.cpp index 41097123ba3..4ad74b45586 100644 --- a/src/plugins/debugger/dap/dapclient.cpp +++ b/src/plugins/debugger/dap/dapclient.cpp @@ -17,20 +17,21 @@ static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg); namespace Debugger::Internal { -DapClient::DapClient(std::unique_ptr<IDataProvider> dataProvider) - : m_dataProvider(std::move(dataProvider)) +DapClient::DapClient(IDataProvider *dataProvider, QObject *parent) + : QObject(parent) + , m_dataProvider(dataProvider) { - connect(m_dataProvider.get(), + connect(m_dataProvider, &IDataProvider::readyReadStandardOutput, this, &DapClient::readOutput); - connect(m_dataProvider.get(), + connect(m_dataProvider, &IDataProvider::readyReadStandardError, this, &DapClient::readyReadStandardError); - connect(m_dataProvider.get(), &IDataProvider::done, this, &DapClient::done); - connect(m_dataProvider.get(), &IDataProvider::started, this, &DapClient::started); + connect(m_dataProvider, &IDataProvider::done, this, &DapClient::done); + connect(m_dataProvider, &IDataProvider::started, this, &DapClient::started); } DapClient::~DapClient() = default; diff --git a/src/plugins/debugger/dap/dapclient.h b/src/plugins/debugger/dap/dapclient.h index 3cb2d49b4d5..3570bd65ca0 100644 --- a/src/plugins/debugger/dap/dapclient.h +++ b/src/plugins/debugger/dap/dapclient.h @@ -13,6 +13,8 @@ class IDataProvider : public QObject { Q_OBJECT public: + IDataProvider(QObject *parent = nullptr) : QObject(parent) {} + ~IDataProvider() override = default; virtual void start() = 0; virtual bool isRunning() const = 0; virtual void writeRaw(const QByteArray &input) = 0; @@ -64,10 +66,10 @@ class DapClient : public QObject Q_OBJECT public: - DapClient(std::unique_ptr<IDataProvider> dataProvider); - ~DapClient(); + DapClient(IDataProvider *dataProvider, QObject *parent = nullptr); + ~DapClient() override; - IDataProvider *dataProvider() const { return m_dataProvider.get(); } + IDataProvider *dataProvider() const { return m_dataProvider; } void postRequest(const QString &command, const QJsonObject &arguments = {}); @@ -105,7 +107,7 @@ private: void readOutput(); private: - std::unique_ptr<IDataProvider> m_dataProvider = nullptr; + IDataProvider *m_dataProvider = nullptr; QByteArray m_inbuffer; }; diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index c6fb33fc0c2..6b2bb5d6e7d 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -70,6 +70,11 @@ DapEngine::DapEngine() m_currentWatchItem = m_rootWatchItem; } +DapEngine::~DapEngine() +{ + delete m_rootWatchItem; +} + void DapEngine::executeDebuggerCommand(const QString &/*command*/) { QTC_ASSERT(state() == InferiorStopOk, qCDebug(dapEngineLog) << state()); @@ -787,15 +792,15 @@ void DapEngine::connectDataGeneratorSignals() if (!m_dapClient) return; - connect(m_dapClient.get(), &DapClient::started, this, &DapEngine::handleDapStarted); - connect(m_dapClient.get(), &DapClient::done, this, &DapEngine::handleDapDone); - connect(m_dapClient.get(), + connect(m_dapClient, &DapClient::started, this, &DapEngine::handleDapStarted); + connect(m_dapClient, &DapClient::done, this, &DapEngine::handleDapDone); + connect(m_dapClient, &DapClient::readyReadStandardError, this, &DapEngine::readDapStandardError); - connect(m_dapClient.get(), &DapClient::responseReady, this, &DapEngine::handleResponse); - connect(m_dapClient.get(), &DapClient::eventReady, this, &DapEngine::handleEvent); + connect(m_dapClient, &DapClient::responseReady, this, &DapEngine::handleResponse); + connect(m_dapClient, &DapClient::eventReady, this, &DapEngine::handleEvent); } DebuggerEngine *createDapEngine(Utils::Id runMode) diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index c4f332668e5..adcfa807fe3 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -27,6 +27,7 @@ class DapEngine : public DebuggerEngine { public: DapEngine(); + ~DapEngine() override; protected: void executeStepIn(bool) override; @@ -107,7 +108,7 @@ protected: void connectDataGeneratorSignals(); QByteArray m_inbuffer; - std::unique_ptr<DapClient> m_dapClient = nullptr; + DapClient *m_dapClient = nullptr; int m_nextBreakpointId = 1; int m_currentThreadId = -1; diff --git a/src/plugins/debugger/dap/gdbdapengine.cpp b/src/plugins/debugger/dap/gdbdapengine.cpp index 7d0cefaa9ca..10eabd22c56 100644 --- a/src/plugins/debugger/dap/gdbdapengine.cpp +++ b/src/plugins/debugger/dap/gdbdapengine.cpp @@ -26,8 +26,11 @@ namespace Debugger::Internal { class ProcessDataProvider : public IDataProvider { public: - ProcessDataProvider(const DebuggerRunParameters &rp, const CommandLine &cmd) - : m_runParameters(rp) + ProcessDataProvider(const DebuggerRunParameters &rp, + const CommandLine &cmd, + QObject *parent = nullptr) + : IDataProvider(parent) + , m_runParameters(rp) , m_cmd(cmd) { connect(&m_proc, &Process::started, this, &IDataProvider::started); @@ -89,8 +92,8 @@ void GdbDapEngine::setupEngine() const DebuggerRunParameters &rp = runParameters(); const CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}}; - std::unique_ptr<IDataProvider> dataProvider = std::make_unique<ProcessDataProvider>(rp, cmd); - m_dapClient = std::make_unique<DapClient>(std::move(dataProvider)); + IDataProvider *dataProvider = new ProcessDataProvider(rp, cmd, this); + m_dapClient = new DapClient(dataProvider, this); connectDataGeneratorSignals(); m_dapClient->dataProvider()->start(); From 3cdfdf1dd28ab32cf83f86af3569d86bbf9e7822 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 17 Aug 2023 13:04:04 +0200 Subject: [PATCH 0783/1777] DAP: Fix several breakpoints windows during CMake debug - Added breakpointManagerWindow and engineManagerWindow for CMake debug mode - Made CMake debug feature enable by default Change-Id: I48fd62d8d63e991f31b245438ad8e7706552de32 Reviewed-by: hjk <hjk@qt.io> --- .../debugger/debuggerinternalconstants.h | 2 +- src/plugins/debugger/debuggerplugin.cpp | 206 ++++++++++++------ 2 files changed, 136 insertions(+), 72 deletions(-) diff --git a/src/plugins/debugger/debuggerinternalconstants.h b/src/plugins/debugger/debuggerinternalconstants.h index 024e2cd3e2a..035371498a3 100644 --- a/src/plugins/debugger/debuggerinternalconstants.h +++ b/src/plugins/debugger/debuggerinternalconstants.h @@ -41,7 +41,7 @@ const char C_QMLDEBUGGER[] = "Qml/JavaScript Debugger"; const char C_DEBUGGER_NOTRUNNING[] = "Debugger.NotRunning"; const char PRESET_PERSPECTIVE_ID[] = "Debugger.Perspective.Preset"; -const char CMAKE_PERSPECTIVE_ID[] = "Debugger.Perspective.Cmake"; +const char CMAKE_PERSPECTIVE_ID[] = "CMakeDebugger"; const char TASK_CATEGORY_DEBUGGER_RUNTIME[] = "DebugRuntime"; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index cf14b8ec280..bd5f72f6cec 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -610,6 +610,19 @@ public: BreakpointManager::setOrRemoveBreakpoint(data, message); } + void addFontSizeAdaptation(QWidget *widget); + BaseTreeView *createBreakpointManagerView(const QByteArray &settingsKey); + QWidget *createBreakpointManagerWindow(BaseTreeView *breakpointManagerView, + const QString &title, + const QString &objectName); + + BaseTreeView *createEngineManagerView(const QString &title, const QByteArray &settingsKey); + QWidget *createEngineManagerWindow(BaseTreeView *engineManagerView, + const QString &title, + const QString &objectName); + + void createCMakeDebuggerPerspective(QWidget *globalLogWindow); + void editorOpened(IEditor *editor); void updateBreakMenuItem(IEditor *editor); void requestMark(TextEditorWidget *widget, int lineNumber, @@ -696,6 +709,82 @@ public: // return isDebuggableScript; }; +static void addLabel(QWidget *widget, const QString &text) +{ + auto vbox = qobject_cast<QVBoxLayout *>(widget->layout()); + QTC_ASSERT(vbox, return); + auto label = new QLabel(widget); + label->setText(text); + label->setContentsMargins(6, 6, 6, 6); + vbox->insertWidget(0, label); +}; + +void DebuggerPluginPrivate::addFontSizeAdaptation(QWidget *widget) +{ + QObject::connect(TextEditorSettings::instance(), + &TextEditorSettings::fontSettingsChanged, + this, + [widget](const FontSettings &fs) { + if (!settings().fontSizeFollowsEditor()) + return; + qreal size = fs.fontZoom() * fs.fontSize() / 100.; + QFont font = widget->font(); + font.setPointSizeF(size); + widget->setFont(font); + }); +}; + +BaseTreeView *DebuggerPluginPrivate::createBreakpointManagerView(const QByteArray &settingsKey) +{ + auto breakpointManagerView = new BaseTreeView; + breakpointManagerView->setActivationMode(Utils::DoubleClickActivation); + breakpointManagerView->setIconSize(QSize(10, 10)); + breakpointManagerView->setWindowIcon(Icons::BREAKPOINTS.icon()); + breakpointManagerView->setSelectionMode(QAbstractItemView::ExtendedSelection); + breakpointManagerView->setSettings(ICore::settings(), settingsKey); + breakpointManagerView->setRootIsDecorated(true); + breakpointManagerView->setModel(BreakpointManager::model()); + breakpointManagerView->setSpanColumn(BreakpointFunctionColumn); + breakpointManagerView->enableColumnHiding(); + return breakpointManagerView; +} + +QWidget *DebuggerPluginPrivate::createBreakpointManagerWindow(BaseTreeView *breakpointManagerView, + const QString &title, + const QString &objectName) +{ + auto breakpointManagerWindow = addSearch(breakpointManagerView); + breakpointManagerWindow->setWindowTitle(title); + breakpointManagerWindow->setObjectName(objectName); + addLabel(breakpointManagerWindow, breakpointManagerWindow->windowTitle()); + addFontSizeAdaptation(breakpointManagerWindow); + return breakpointManagerWindow; +} + +BaseTreeView *DebuggerPluginPrivate::createEngineManagerView(const QString &title, const QByteArray &settingsKey) +{ + auto engineManagerView = new BaseTreeView; + engineManagerView->setWindowTitle(title); + engineManagerView->setSettings(ICore::settings(), settingsKey); + engineManagerView->setIconSize(QSize(10, 10)); + engineManagerView->setModel(EngineManager::model()); + engineManagerView->setSelectionMode(QAbstractItemView::SingleSelection); + engineManagerView->enableColumnHiding(); + return engineManagerView; +} + +QWidget *DebuggerPluginPrivate::createEngineManagerWindow(BaseTreeView *engineManagerView, + const QString &title, + const QString &objectName) +{ + auto engineManagerWindow = addSearch(engineManagerView); + engineManagerWindow->setWindowTitle(title); + engineManagerWindow->setObjectName(objectName); + addLabel(engineManagerWindow, engineManagerWindow->windowTitle()); + addFontSizeAdaptation(engineManagerWindow); + return engineManagerWindow; +} + DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) { qRegisterMetaType<ContextData>("ContextData"); @@ -762,58 +851,18 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) Tr::tr("Debugger Runtime"), Tr::tr("Issues with starting the debugger.")}); - const auto addLabel = [](QWidget *widget, const QString &text) { - auto vbox = qobject_cast<QVBoxLayout *>(widget->layout()); - QTC_ASSERT(vbox, return); - auto label = new QLabel(widget); - label->setText(text); - label->setContentsMargins(6, 6, 6, 6); - vbox->insertWidget(0, label); - }; - - const auto addFontSizeAdaptation = [this](QWidget *widget) { - QObject::connect(TextEditorSettings::instance(), &TextEditorSettings::fontSettingsChanged, - this, [widget](const FontSettings &fs) { - if (!settings().fontSizeFollowsEditor()) - return; - qreal size = fs.fontZoom() * fs.fontSize() / 100.; - QFont font = widget->font(); - font.setPointSizeF(size); - widget->setFont(font); - }); - }; - - auto breakpointManagerView = new BaseTreeView; - breakpointManagerView->setActivationMode(Utils::DoubleClickActivation); - breakpointManagerView->setIconSize(QSize(10, 10)); - breakpointManagerView->setWindowIcon(Icons::BREAKPOINTS.icon()); - breakpointManagerView->setSelectionMode(QAbstractItemView::ExtendedSelection); - breakpointManagerView->setSettings(ICore::settings(), "Debugger.BreakWindow"); - breakpointManagerView->setRootIsDecorated(true); - breakpointManagerView->setModel(BreakpointManager::model()); - breakpointManagerView->setSpanColumn(BreakpointFunctionColumn); - breakpointManagerView->enableColumnHiding(); - - auto breakpointManagerWindow = addSearch(breakpointManagerView); - breakpointManagerWindow->setWindowTitle(Tr::tr("Breakpoint Preset")); - breakpointManagerWindow->setObjectName("Debugger.Docks.BreakpointManager"); - addLabel(breakpointManagerWindow, breakpointManagerWindow->windowTitle()); - addFontSizeAdaptation(breakpointManagerWindow); + auto breakpointManagerView = createBreakpointManagerView("Debugger.BreakWindow"); + auto breakpointManagerWindow + = createBreakpointManagerWindow(breakpointManagerView, + Tr::tr("Breakpoint Preset"), + "Debugger.Docks.BreakpointManager"); // Snapshot - auto engineManagerView = new BaseTreeView; - engineManagerView->setWindowTitle(Tr::tr("Running Debuggers")); - engineManagerView->setSettings(ICore::settings(), "Debugger.SnapshotView"); - engineManagerView->setIconSize(QSize(10, 10)); - engineManagerView->setModel(EngineManager::model()); - engineManagerView->setSelectionMode(QAbstractItemView::SingleSelection); - engineManagerView->enableColumnHiding(); - - auto engineManagerWindow = addSearch(engineManagerView); - engineManagerWindow->setWindowTitle(Tr::tr("Debugger Perspectives")); - engineManagerWindow->setObjectName("Debugger.Docks.Snapshots"); - addLabel(engineManagerWindow, engineManagerWindow->windowTitle()); - addFontSizeAdaptation(engineManagerWindow); + auto engineManagerView = createEngineManagerView(Tr::tr("Running Debuggers"), + "Debugger.SnapshotView"); + auto engineManagerWindow = createEngineManagerWindow(engineManagerView, + Tr::tr("Debugger Perspectives"), + "Debugger.Docks.Snapshots"); // Logging auto globalLogWindow = new GlobalLogWindow; @@ -1172,27 +1221,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) m_perspective.addWindow(breakpointManagerWindow, Perspective::SplitHorizontal, engineManagerWindow); m_perspective.addWindow(globalLogWindow, Perspective::AddToTab, nullptr, false, Qt::TopDockWidgetArea); - if (qEnvironmentVariableIsSet("QTC_USE_CMAKE_DEBUGGER")) { - m_perspectiveCmake = std::make_unique<Perspective>(Constants::CMAKE_PERSPECTIVE_ID, - Tr::tr("CMake")); - m_startCmakeAction.setText(Tr::tr("Start CMake Debugging")); - m_startCmakeAction.setEnabled(true); - m_startCmakeAction.setIcon(startIcon(true)); - m_startCmakeAction.setVisible(true); - - m_perspectiveCmake->addToolBarAction(&m_startCmakeAction); - - m_perspectiveCmake->addWindow(engineManagerWindow, Perspective::SplitVertical, nullptr); - m_perspectiveCmake->addWindow(breakpointManagerWindow, - Perspective::SplitHorizontal, - engineManagerWindow); - m_perspectiveCmake->addWindow(globalLogWindow, - Perspective::AddToTab, - nullptr, - false, - Qt::TopDockWidgetArea); - } - + createCMakeDebuggerPerspective(globalLogWindow); setInitialState(); connect(ProjectManager::instance(), &ProjectManager::startupProjectChanged, @@ -1203,6 +1232,41 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) this, &DebuggerPluginPrivate::updatePresetState); } +void DebuggerPluginPrivate::createCMakeDebuggerPerspective(QWidget *globalLogWindow) +{ + auto breakpointManagerView = createBreakpointManagerView("CMake.BreakWindow"); + auto breakpointManagerWindow + = createBreakpointManagerWindow(breakpointManagerView, + Tr::tr("CMake Breakpoint Preset"), + "CMake.Docks.BreakpointManager"); + + // Snapshot + auto engineManagerView = createEngineManagerView(Tr::tr("Running Debuggers"), + "CMake.SnapshotView"); + auto engineManagerWindow = createEngineManagerWindow(engineManagerView, + Tr::tr("CMake Debugger Perspectives"), + "CMake.Docks.Snapshots"); + + m_perspectiveCmake = std::make_unique<Perspective>(Constants::CMAKE_PERSPECTIVE_ID, + Tr::tr("CMake")); + m_startCmakeAction.setText(Tr::tr("Start CMake Debugging")); + m_startCmakeAction.setEnabled(true); + m_startCmakeAction.setIcon(startIcon(true)); + m_startCmakeAction.setVisible(true); + + m_perspectiveCmake->addToolBarAction(&m_startCmakeAction); + + m_perspectiveCmake->addWindow(engineManagerWindow, Perspective::SplitVertical, nullptr); + m_perspectiveCmake->addWindow(breakpointManagerWindow, + Perspective::SplitHorizontal, + engineManagerWindow); + m_perspectiveCmake->addWindow(globalLogWindow, + Perspective::AddToTab, + nullptr, + false, + Qt::TopDockWidgetArea); +} + DebuggerPluginPrivate::~DebuggerPluginPrivate() { From d10bac53769e228145ba59d4b44798d86ce39a3b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 15:03:56 +0200 Subject: [PATCH 0784/1777] Subversion: Show settings page contents again Amends 9a69c78ca5d5aab6. Change-Id: If4cf85a5298b2e7f5d924c9bf3fabec9784049af Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/subversion/subversionsettings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/subversion/subversionsettings.cpp b/src/plugins/subversion/subversionsettings.cpp index 6fb5a83ff57..284472938ff 100644 --- a/src/plugins/subversion/subversionsettings.cpp +++ b/src/plugins/subversion/subversionsettings.cpp @@ -113,6 +113,7 @@ public: setId(VcsBase::Constants::VCS_ID_SUBVERSION); setDisplayName(Tr::tr("Subversion")); setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); + setSettingsProvider([] { return &settings(); }); } }; From 15fba14b79cad5d342c996aaac382740c14c9ce1 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 17 Aug 2023 13:59:54 +0200 Subject: [PATCH 0785/1777] Debugger: Add missing files to qbs build Change-Id: I6f20c4d4ab638537f448087a36195c5d201bf5e4 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/debugger/debugger.qbs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 5433184ffe9..9a0d75a7e70 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -126,6 +126,7 @@ Project { prefix: "dap/" files: [ "cmakedapengine.cpp", "cmakedapengine.h", + "dapclient.cpp", "dapclient.h", "dapengine.cpp", "dapengine.h", "gdbdapengine.cpp", "gdbdapengine.h", ] From 430c8faa1708c2d28e7e84fe152a679e670c23a6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 14 Jul 2023 16:59:32 +0200 Subject: [PATCH 0786/1777] Axivion: Move a bit closer towards latest settings setup pattern Change-Id: I5b99d53790818d353730d3af4409f95e5616ff00 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/axivion/CMakeLists.txt | 1 - src/plugins/axivion/axivion.qbs | 2 - src/plugins/axivion/axivionplugin.cpp | 22 -- src/plugins/axivion/axivionplugin.h | 7 +- .../axivion/axivionprojectsettings.cpp | 11 +- src/plugins/axivion/axivionprojectsettings.h | 1 - src/plugins/axivion/axivionquery.cpp | 12 +- src/plugins/axivion/axivionsettings.cpp | 250 ++++++++++++++++-- src/plugins/axivion/axivionsettings.h | 4 +- src/plugins/axivion/axivionsettingspage.cpp | 214 --------------- src/plugins/axivion/axivionsettingspage.h | 21 -- 11 files changed, 245 insertions(+), 300 deletions(-) delete mode 100644 src/plugins/axivion/axivionsettingspage.cpp delete mode 100644 src/plugins/axivion/axivionsettingspage.h diff --git a/src/plugins/axivion/CMakeLists.txt b/src/plugins/axivion/CMakeLists.txt index e855e419f07..8768544764c 100644 --- a/src/plugins/axivion/CMakeLists.txt +++ b/src/plugins/axivion/CMakeLists.txt @@ -10,7 +10,6 @@ add_qtc_plugin(Axivion axivionquery.h axivionquery.cpp axivionresultparser.h axivionresultparser.cpp axivionsettings.cpp axivionsettings.h - axivionsettingspage.cpp axivionsettingspage.h axiviontr.h dashboard/dto.cpp dashboard/dto.h dashboard/concat.cpp dashboard/concat.h diff --git a/src/plugins/axivion/axivion.qbs b/src/plugins/axivion/axivion.qbs index 965fe0c0b57..73db674adc4 100644 --- a/src/plugins/axivion/axivion.qbs +++ b/src/plugins/axivion/axivion.qbs @@ -25,8 +25,6 @@ QtcPlugin { "axivionresultparser.cpp", "axivionsettings.cpp", "axivionsettings.h", - "axivionsettingspage.cpp", - "axivionsettingspage.h", "axiviontr.h", ] diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index e068287290f..ddadf5b24ad 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -7,8 +7,6 @@ #include "axivionprojectsettings.h" #include "axivionquery.h" #include "axivionresultparser.h" -#include "axivionsettings.h" -#include "axivionsettingspage.h" #include "axiviontr.h" #include <coreplugin/editormanager/documentmodel.h> @@ -50,15 +48,12 @@ public: void handleIssuesForFile(const IssuesList &issues); void fetchRuleInfo(const QString &id); - AxivionSettings m_axivionSettings; - AxivionSettingsPage m_axivionSettingsPage{&m_axivionSettings}; AxivionOutputPane m_axivionOutputPane; QHash<ProjectExplorer::Project *, AxivionProjectSettings *> m_axivionProjectSettings; ProjectInfo m_currentProjectInfo; bool m_runningQuery = false; }; -static AxivionPlugin *s_instance = nullptr; static AxivionPluginPrivate *dd = nullptr; class AxivionTextMark : public TextEditor::TextMark @@ -89,11 +84,6 @@ AxivionTextMark::AxivionTextMark(const Utils::FilePath &filePath, const ShortIss }); } -AxivionPlugin::AxivionPlugin() -{ - s_instance = this; -} - AxivionPlugin::~AxivionPlugin() { if (dd && !dd->m_axivionProjectSettings.isEmpty()) { @@ -104,18 +94,12 @@ AxivionPlugin::~AxivionPlugin() dd = nullptr; } -AxivionPlugin *AxivionPlugin::instance() -{ - return s_instance; -} - bool AxivionPlugin::initialize(const QStringList &arguments, QString *errorMessage) { Q_UNUSED(arguments) Q_UNUSED(errorMessage) dd = new AxivionPluginPrivate; - dd->m_axivionSettings.fromSettings(); auto panelFactory = new ProjectExplorer::ProjectPanelFactory; panelFactory->setPriority(250); @@ -134,12 +118,6 @@ bool AxivionPlugin::initialize(const QStringList &arguments, QString *errorMessa return true; } -AxivionSettings *AxivionPlugin::settings() -{ - QTC_ASSERT(dd, return nullptr); - return &dd->m_axivionSettings; -} - AxivionProjectSettings *AxivionPlugin::projectSettings(ProjectExplorer::Project *project) { QTC_ASSERT(project, return nullptr); diff --git a/src/plugins/axivion/axivionplugin.h b/src/plugins/axivion/axivionplugin.h index 9422ab8b968..fc2bf3fb3ad 100644 --- a/src/plugins/axivion/axivionplugin.h +++ b/src/plugins/axivion/axivionplugin.h @@ -9,7 +9,6 @@ namespace ProjectExplorer { class Project; } namespace Axivion::Internal { -class AxivionSettings; class AxivionProjectSettings; class ProjectInfo; @@ -19,17 +18,13 @@ class AxivionPlugin final : public ExtensionSystem::IPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Axivion.json") public: - AxivionPlugin(); + AxivionPlugin() {} ~AxivionPlugin() final; - static AxivionPlugin *instance(); - static AxivionSettings *settings(); static AxivionProjectSettings *projectSettings(ProjectExplorer::Project *project); static void fetchProjectInfo(const QString &projectName); static ProjectInfo projectInfo(); -signals: - void settingsChanged(); private: bool initialize(const QStringList &arguments, QString *errorMessage) final; diff --git a/src/plugins/axivion/axivionprojectsettings.cpp b/src/plugins/axivion/axivionprojectsettings.cpp index 32689ae950d..d38f10f0e1d 100644 --- a/src/plugins/axivion/axivionprojectsettings.cpp +++ b/src/plugins/axivion/axivionprojectsettings.cpp @@ -17,6 +17,8 @@ #include <QTreeWidget> #include <QVBoxLayout> +using namespace Utils; + namespace Axivion::Internal { const char PSK_PROJECTNAME[] = "Axivion.ProjectName"; @@ -45,7 +47,6 @@ AxivionProjectSettingsWidget::AxivionProjectSettingsWidget(ProjectExplorer::Proj QWidget *parent) : ProjectExplorer::ProjectSettingsWidget{parent} , m_projectSettings(AxivionPlugin::projectSettings(project)) - , m_globalSettings(AxivionPlugin::settings()) { setUseGlobalSettingsCheckBoxVisible(false); setUseGlobalSettingsLabelVisible(true); @@ -87,7 +88,7 @@ AxivionProjectSettingsWidget::AxivionProjectSettingsWidget(ProjectExplorer::Proj this, &AxivionProjectSettingsWidget::linkProject); connect(m_unlink, &QPushButton::clicked, this, &AxivionProjectSettingsWidget::unlinkProject); - connect(AxivionPlugin::instance(), &AxivionPlugin::settingsChanged, + connect(&settings(), &AspectContainer::changed, this, &AxivionProjectSettingsWidget::onSettingsChanged); updateUi(); @@ -163,9 +164,9 @@ void AxivionProjectSettingsWidget::updateUi() void AxivionProjectSettingsWidget::updateEnabledStates() { - const bool hasDashboardSettings = m_globalSettings->curl().isExecutableFile() - && !m_globalSettings->server.dashboard.isEmpty() - && !m_globalSettings->server.token.isEmpty(); + const bool hasDashboardSettings = settings().curl().isExecutableFile() + && !settings().server.dashboard.isEmpty() + && !settings().server.token.isEmpty(); const bool linked = !m_projectSettings->dashboardProjectName().isEmpty(); const bool linkable = m_dashboardProjects->topLevelItemCount() && !m_dashboardProjects->selectedItems().isEmpty(); diff --git a/src/plugins/axivion/axivionprojectsettings.h b/src/plugins/axivion/axivionprojectsettings.h index d5bc1fd2e62..e3fa07cb5b5 100644 --- a/src/plugins/axivion/axivionprojectsettings.h +++ b/src/plugins/axivion/axivionprojectsettings.h @@ -55,7 +55,6 @@ private: void updateEnabledStates(); AxivionProjectSettings *m_projectSettings = nullptr; - AxivionSettings *m_globalSettings; QLabel *m_linkedProject = nullptr; QTreeWidget *m_dashboardProjects = nullptr; QPushButton *m_fetchProjects = nullptr; diff --git a/src/plugins/axivion/axivionquery.cpp b/src/plugins/axivion/axivionquery.cpp index deb85ba4417..b701c921371 100644 --- a/src/plugins/axivion/axivionquery.cpp +++ b/src/plugins/axivion/axivionquery.cpp @@ -56,8 +56,7 @@ QString AxivionQuery::toString() const static bool handleCertificateIssue() { - AxivionSettings *settings = AxivionPlugin::settings(); - const QString serverHost = QUrl(settings->server.dashboard).host(); + const QString serverHost = QUrl(settings().server.dashboard).host(); if (QMessageBox::question(Core::ICore::dialogParent(), Tr::tr("Certificate Error"), Tr::tr("Server certificate for %1 cannot be authenticated.\n" "Do you want to disable SSL verification for this server?\n" @@ -66,8 +65,8 @@ static bool handleCertificateIssue() != QMessageBox::Yes) { return false; } - settings->server.validateCert = false; - settings->apply(); + settings().server.validateCert = false; + settings().apply(); return true; } @@ -75,8 +74,7 @@ static bool handleCertificateIssue() AxivionQueryRunner::AxivionQueryRunner(const AxivionQuery &query, QObject *parent) : QObject(parent) { - const AxivionSettings *settings = AxivionPlugin::settings(); - const AxivionServer server = settings->server; + const AxivionServer server = settings().server; QStringList args = server.curlArguments(); args << "-i"; @@ -87,7 +85,7 @@ AxivionQueryRunner::AxivionQueryRunner(const AxivionQuery &query, QObject *paren url += query.toString(); args << url; - m_process.setCommand({settings->curl(), args}); + m_process.setCommand({settings().curl(), args}); connect(&m_process, &Process::done, this, [this]{ if (m_process.result() != ProcessResult::FinishedWithSuccess) { const int exitCode = m_process.exitCode(); diff --git a/src/plugins/axivion/axivionsettings.cpp b/src/plugins/axivion/axivionsettings.cpp index c6d3f310105..b18dcfa34aa 100644 --- a/src/plugins/axivion/axivionsettings.cpp +++ b/src/plugins/axivion/axivionsettings.cpp @@ -5,15 +5,26 @@ #include "axiviontr.h" +#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/icore.h> -#include <utils/filepath.h> #include <utils/hostosinfo.h> +#include <utils/id.h> +#include <utils/layoutbuilder.h> +#include <utils/pathchooser.h> +#include <QDialog> +#include <QDialogButtonBox> #include <QJsonDocument> #include <QJsonObject> -#include <QSettings> +#include <QLabel> +#include <QPushButton> +#include <QRegularExpression> #include <QStandardPaths> +#include <QUuid> +#include <QVBoxLayout> + +using namespace Utils; namespace Axivion::Internal { @@ -74,15 +85,6 @@ QStringList AxivionServer::curlArguments() const return args; } -AxivionSettings::AxivionSettings() -{ - setSettingsGroup("Axivion"); - - curl.setSettingsKey("Curl"); - curl.setLabelText(Tr::tr("curl:")); - curl.setExpectedKind(Utils::PathChooser::ExistingCommand); -} - static Utils::FilePath tokensFilePath() { return Utils::FilePath::fromString(Core::ICore::settings()->fileName()).parentDir() @@ -111,23 +113,231 @@ static AxivionServer readTokenFile(const Utils::FilePath &filePath) return AxivionServer::fromJson(doc.object()); } +// AxivionSetting + +AxivionSettings &settings() +{ + static AxivionSettings theSettings; + return theSettings; +} + +AxivionSettings::AxivionSettings() +{ + setSettingsGroup("Axivion"); + + curl.setSettingsKey("Curl"); + curl.setLabelText(Tr::tr("curl:")); + curl.setExpectedKind(Utils::PathChooser::ExistingCommand); + + AspectContainer::readSettings(); + + server = readTokenFile(tokensFilePath()); + + if (curl().isEmpty() || !curl().exists()) { + const QString curlPath = QStandardPaths::findExecutable( + HostOsInfo::withExecutableSuffix("curl")); + if (!curlPath.isEmpty()) + curl.setValue(FilePath::fromString(curlPath)); + } +} + void AxivionSettings::toSettings() const { writeTokenFile(tokensFilePath(), server); Utils::AspectContainer::writeSettings(); } -void AxivionSettings::fromSettings() -{ - Utils::AspectContainer::readSettings(); - server = readTokenFile(tokensFilePath()); +// AxivionSettingsPage - if (curl().isEmpty() || !curl().exists()) { - const QString curlPath = QStandardPaths::findExecutable( - Utils::HostOsInfo::withExecutableSuffix("curl")); - if (!curlPath.isEmpty()) - curl.setValue(Utils::FilePath::fromString(curlPath)); +// may allow some invalid, but does some minimal check for legality +static bool hostValid(const QString &host) +{ + static const QRegularExpression ip(R"(^(\d+).(\d+).(\d+).(\d+)$)"); + static const QRegularExpression dn(R"(^([a-zA-Z0-9][a-zA-Z0-9-]+\.)+[a-zA-Z0-9][a-zA-Z0-9-]+$)"); + const QRegularExpressionMatch match = ip.match(host); + if (match.hasMatch()) { + for (int i = 1; i < 5; ++i) { + int val = match.captured(i).toInt(); + if (val < 0 || val > 255) + return false; + } + return true; + } + return (host == "localhost") || dn.match(host).hasMatch(); +} + +static bool isUrlValid(const QString &in) +{ + const QUrl url(in); + return hostValid(url.host()) && (url.scheme() == "https" || url.scheme() == "http"); +} + +class DashboardSettingsWidget : public QWidget +{ +public: + enum Mode { Display, Edit }; + explicit DashboardSettingsWidget(Mode m, QWidget *parent, QPushButton *ok = nullptr); + + AxivionServer dashboardServer() const; + void setDashboardServer(const AxivionServer &server); + + bool isValid() const; + +private: + Mode m_mode = Display; + Id m_id; + StringAspect m_dashboardUrl; + StringAspect m_description; + StringAspect m_token; + BoolAspect m_valid; +}; + +DashboardSettingsWidget::DashboardSettingsWidget(Mode mode, QWidget *parent, QPushButton *ok) + : QWidget(parent) + , m_mode(mode) +{ + auto labelStyle = mode == Display ? StringAspect::LabelDisplay : StringAspect::LineEditDisplay; + m_dashboardUrl.setLabelText(Tr::tr("Dashboard URL:")); + m_dashboardUrl.setDisplayStyle(labelStyle); + m_dashboardUrl.setValidationFunction([](FancyLineEdit *edit, QString *){ + return isUrlValid(edit->text()); + }); + m_description.setLabelText(Tr::tr("Description:")); + m_description.setDisplayStyle(labelStyle); + m_description.setPlaceHolderText(Tr::tr("Non-empty description")); + + m_token.setLabelText(Tr::tr("Access token:")); + m_token.setDisplayStyle(labelStyle); + m_token.setPlaceHolderText(Tr::tr("IDE Access Token")); + m_token.setVisible(mode == Edit); + + using namespace Layouting; + + Form { + m_dashboardUrl, br, + m_description, br, + m_token, br, + mode == Edit ? normalMargin : noMargin + }.attachTo(this); + + if (mode == Edit) { + QTC_ASSERT(ok, return); + auto checkValidity = [this, ok] { + m_valid.setValue(isValid()); + ok->setEnabled(m_valid()); + }; + connect(&m_dashboardUrl, &BaseAspect::changed, this, checkValidity); + connect(&m_description, &BaseAspect::changed, this, checkValidity); + connect(&m_token, &BaseAspect::changed, this, checkValidity); } } +AxivionServer DashboardSettingsWidget::dashboardServer() const +{ + AxivionServer result; + if (m_id.isValid()) + result.id = m_id; + else + result.id = m_mode == Edit ? Utils::Id::fromName(QUuid::createUuid().toByteArray()) : m_id; + result.dashboard = m_dashboardUrl(); + result.description = m_description(); + result.token = m_token(); + return result; +} + +void DashboardSettingsWidget::setDashboardServer(const AxivionServer &server) +{ + m_id = server.id; + m_dashboardUrl.setValue(server.dashboard); + m_description.setValue(server.description); + m_token.setValue(server.token); +} + +bool DashboardSettingsWidget::isValid() const +{ + return !m_token().isEmpty() && !m_description().isEmpty() && isUrlValid(m_dashboardUrl()); +} + +class AxivionSettingsWidget : public Core::IOptionsPageWidget +{ +public: + AxivionSettingsWidget(); + + void apply() override; + +private: + void showEditServerDialog(); + + DashboardSettingsWidget *m_dashboardDisplay = nullptr; + QPushButton *m_edit = nullptr; +}; + +AxivionSettingsWidget::AxivionSettingsWidget() +{ + using namespace Layouting; + + m_dashboardDisplay = new DashboardSettingsWidget(DashboardSettingsWidget::Display, this); + m_dashboardDisplay->setDashboardServer(settings().server); + m_edit = new QPushButton(Tr::tr("Edit..."), this); + Row { + Form { + m_dashboardDisplay, br, + settings().curl, br, + }, Column { m_edit, st } + }.attachTo(this); + + connect(m_edit, &QPushButton::clicked, this, &AxivionSettingsWidget::showEditServerDialog); +} + +void AxivionSettingsWidget::apply() +{ + settings().server = m_dashboardDisplay->dashboardServer(); + settings().toSettings(); +} + +void AxivionSettingsWidget::showEditServerDialog() +{ + const AxivionServer old = m_dashboardDisplay->dashboardServer(); + QDialog d; + d.setWindowTitle(Tr::tr("Edit Dashboard Configuration")); + QVBoxLayout *layout = new QVBoxLayout; + auto buttons = new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok, this); + auto ok = buttons->button(QDialogButtonBox::Ok); + auto dashboardWidget = new DashboardSettingsWidget(DashboardSettingsWidget::Edit, this, ok); + dashboardWidget->setDashboardServer(old); + layout->addWidget(dashboardWidget); + ok->setEnabled(m_dashboardDisplay->isValid()); + connect(buttons->button(QDialogButtonBox::Cancel), &QPushButton::clicked, &d, &QDialog::reject); + connect(ok, &QPushButton::clicked, &d, &QDialog::accept); + layout->addWidget(buttons); + d.setLayout(layout); + d.resize(500, 200); + + if (d.exec() != QDialog::Accepted) + return; + if (dashboardWidget->isValid()) { + const AxivionServer server = dashboardWidget->dashboardServer(); + if (server != old) + m_dashboardDisplay->setDashboardServer(server); + } +} + +// AxivionSettingsPage + +class AxivionSettingsPage : public Core::IOptionsPage +{ +public: + AxivionSettingsPage() + { + setId("Axivion.Settings.General"); + setDisplayName(Tr::tr("General")); + setCategory("XY.Axivion"); + setDisplayCategory(Tr::tr("Axivion")); + setCategoryIconPath(":/axivion/images/axivion.png"); + setWidgetCreator([] { return new AxivionSettingsWidget; }); + } +}; + +const AxivionSettingsPage settingsPage; + } // Axivion::Internal diff --git a/src/plugins/axivion/axivionsettings.h b/src/plugins/axivion/axivionsettings.h index 81413732592..ef497b7182f 100644 --- a/src/plugins/axivion/axivionsettings.h +++ b/src/plugins/axivion/axivionsettings.h @@ -40,11 +40,13 @@ class AxivionSettings : public Utils::AspectContainer { public: AxivionSettings(); + void toSettings() const; - void fromSettings(); AxivionServer server; // shall we have more than one? Utils::FilePathAspect curl{this}; }; +AxivionSettings &settings(); + } // Axivion::Internal diff --git a/src/plugins/axivion/axivionsettingspage.cpp b/src/plugins/axivion/axivionsettingspage.cpp deleted file mode 100644 index e869b51d09b..00000000000 --- a/src/plugins/axivion/axivionsettingspage.cpp +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "axivionsettingspage.h" - -#include "axivionplugin.h" -#include "axivionsettings.h" -#include "axiviontr.h" - -#include <utils/aspects.h> -#include <utils/id.h> -#include <utils/layoutbuilder.h> -#include <utils/pathchooser.h> - -#include <QDialog> -#include <QDialogButtonBox> -#include <QLabel> -#include <QPushButton> -#include <QRegularExpression> -#include <QUuid> -#include <QVBoxLayout> - -using namespace Utils; - -namespace Axivion::Internal { - -// may allow some invalid, but does some minimal check for legality -static bool hostValid(const QString &host) -{ - static const QRegularExpression ip(R"(^(\d+).(\d+).(\d+).(\d+)$)"); - static const QRegularExpression dn(R"(^([a-zA-Z0-9][a-zA-Z0-9-]+\.)+[a-zA-Z0-9][a-zA-Z0-9-]+$)"); - const QRegularExpressionMatch match = ip.match(host); - if (match.hasMatch()) { - for (int i = 1; i < 5; ++i) { - int val = match.captured(i).toInt(); - if (val < 0 || val > 255) - return false; - } - return true; - } - return (host == "localhost") || dn.match(host).hasMatch(); -} - -static bool isUrlValid(const QString &in) -{ - const QUrl url(in); - return hostValid(url.host()) && (url.scheme() == "https" || url.scheme() == "http"); -} - -class DashboardSettingsWidget : public QWidget -{ -public: - enum Mode { Display, Edit }; - explicit DashboardSettingsWidget(Mode m, QWidget *parent, QPushButton *ok = nullptr); - - AxivionServer dashboardServer() const; - void setDashboardServer(const AxivionServer &server); - - bool isValid() const; - -private: - Mode m_mode = Display; - Id m_id; - StringAspect m_dashboardUrl; - StringAspect m_description; - StringAspect m_token; - BoolAspect m_valid; -}; - -DashboardSettingsWidget::DashboardSettingsWidget(Mode mode, QWidget *parent, QPushButton *ok) - : QWidget(parent) - , m_mode(mode) -{ - auto labelStyle = mode == Display ? StringAspect::LabelDisplay : StringAspect::LineEditDisplay; - m_dashboardUrl.setLabelText(Tr::tr("Dashboard URL:")); - m_dashboardUrl.setDisplayStyle(labelStyle); - m_dashboardUrl.setValidationFunction([](FancyLineEdit *edit, QString *){ - return isUrlValid(edit->text()); - }); - m_description.setLabelText(Tr::tr("Description:")); - m_description.setDisplayStyle(labelStyle); - m_description.setPlaceHolderText(Tr::tr("Non-empty description")); - - m_token.setLabelText(Tr::tr("Access token:")); - m_token.setDisplayStyle(labelStyle); - m_token.setPlaceHolderText(Tr::tr("IDE Access Token")); - m_token.setVisible(mode == Edit); - - using namespace Layouting; - - Form { - m_dashboardUrl, br, - m_description, br, - m_token, br, - mode == Edit ? normalMargin : noMargin - }.attachTo(this); - - if (mode == Edit) { - QTC_ASSERT(ok, return); - auto checkValidity = [this, ok] { - m_valid.setValue(isValid()); - ok->setEnabled(m_valid()); - }; - connect(&m_dashboardUrl, &BaseAspect::changed, this, checkValidity); - connect(&m_description, &BaseAspect::changed, this, checkValidity); - connect(&m_token, &BaseAspect::changed, this, checkValidity); - } -} - -AxivionServer DashboardSettingsWidget::dashboardServer() const -{ - AxivionServer result; - if (m_id.isValid()) - result.id = m_id; - else - result.id = m_mode == Edit ? Utils::Id::fromName(QUuid::createUuid().toByteArray()) : m_id; - result.dashboard = m_dashboardUrl(); - result.description = m_description(); - result.token = m_token(); - return result; -} - -void DashboardSettingsWidget::setDashboardServer(const AxivionServer &server) -{ - m_id = server.id; - m_dashboardUrl.setValue(server.dashboard); - m_description.setValue(server.description); - m_token.setValue(server.token); -} - -bool DashboardSettingsWidget::isValid() const -{ - return !m_token().isEmpty() && !m_description().isEmpty() && isUrlValid(m_dashboardUrl()); -} - -class AxivionSettingsWidget : public Core::IOptionsPageWidget -{ -public: - explicit AxivionSettingsWidget(AxivionSettings *settings); - - void apply() override; -private: - void showEditServerDialog(); - - AxivionSettings *m_settings; - - DashboardSettingsWidget *m_dashboardDisplay = nullptr; - QPushButton *m_edit = nullptr; -}; - -AxivionSettingsWidget::AxivionSettingsWidget(AxivionSettings *settings) - : m_settings(settings) -{ - using namespace Layouting; - - m_dashboardDisplay = new DashboardSettingsWidget(DashboardSettingsWidget::Display, this); - m_dashboardDisplay->setDashboardServer(m_settings->server); - m_edit = new QPushButton(Tr::tr("Edit..."), this); - Row { - Form { - m_dashboardDisplay, br, - m_settings->curl, br, - }, Column { m_edit, st } - }.attachTo(this); - - connect(m_edit, &QPushButton::clicked, this, &AxivionSettingsWidget::showEditServerDialog); -} - -void AxivionSettingsWidget::apply() -{ - m_settings->server = m_dashboardDisplay->dashboardServer(); - m_settings->toSettings(); - emit AxivionPlugin::instance()->settingsChanged(); -} - -void AxivionSettingsWidget::showEditServerDialog() -{ - const AxivionServer old = m_dashboardDisplay->dashboardServer(); - QDialog d; - d.setWindowTitle(Tr::tr("Edit Dashboard Configuration")); - QVBoxLayout *layout = new QVBoxLayout; - auto buttons = new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok, this); - auto ok = buttons->button(QDialogButtonBox::Ok); - auto dashboardWidget = new DashboardSettingsWidget(DashboardSettingsWidget::Edit, this, ok); - dashboardWidget->setDashboardServer(old); - layout->addWidget(dashboardWidget); - ok->setEnabled(m_dashboardDisplay->isValid()); - connect(buttons->button(QDialogButtonBox::Cancel), &QPushButton::clicked, &d, &QDialog::reject); - connect(ok, &QPushButton::clicked, &d, &QDialog::accept); - layout->addWidget(buttons); - d.setLayout(layout); - d.resize(500, 200); - - if (d.exec() != QDialog::Accepted) - return; - if (dashboardWidget->isValid()) { - const AxivionServer server = dashboardWidget->dashboardServer(); - if (server != old) - m_dashboardDisplay->setDashboardServer(server); - } -} - -AxivionSettingsPage::AxivionSettingsPage(AxivionSettings *settings) - : m_settings(settings) -{ - setId("Axivion.Settings.General"); - setDisplayName(Tr::tr("General")); - setCategory("XY.Axivion"); - setDisplayCategory(Tr::tr("Axivion")); - setCategoryIconPath(":/axivion/images/axivion.png"); - setWidgetCreator([this] { return new AxivionSettingsWidget(m_settings); }); -} - -} // Axivion::Internal diff --git a/src/plugins/axivion/axivionsettingspage.h b/src/plugins/axivion/axivionsettingspage.h deleted file mode 100644 index 744818300d9..00000000000 --- a/src/plugins/axivion/axivionsettingspage.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <coreplugin/dialogs/ioptionspage.h> - -namespace Axivion::Internal { - -class AxivionSettings; - -class AxivionSettingsPage : public Core::IOptionsPage -{ -public: - explicit AxivionSettingsPage(AxivionSettings *settings); - -private: - AxivionSettings *m_settings; -}; - -} // Axivion::Internal From 8fcd519d909c0732dd1ba3888de49d5757d95e79 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 16 Aug 2023 16:42:25 +0200 Subject: [PATCH 0787/1777] Axivion: Use simpler IPlugin::initialize() overload Change-Id: Ifd764b965b84dacec7a9f790d494852d0cafc946 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/axivion/axivionplugin.cpp | 6 +----- src/plugins/axivion/axivionplugin.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index ddadf5b24ad..41a4df12ca2 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -94,11 +94,8 @@ AxivionPlugin::~AxivionPlugin() dd = nullptr; } -bool AxivionPlugin::initialize(const QStringList &arguments, QString *errorMessage) +void AxivionPlugin::initialize() { - Q_UNUSED(arguments) - Q_UNUSED(errorMessage) - dd = new AxivionPluginPrivate; auto panelFactory = new ProjectExplorer::ProjectPanelFactory; @@ -115,7 +112,6 @@ bool AxivionPlugin::initialize(const QStringList &arguments, QString *errorMessa dd, &AxivionPluginPrivate::onDocumentOpened); connect(Core::EditorManager::instance(), &Core::EditorManager::documentClosed, dd, &AxivionPluginPrivate::onDocumentClosed); - return true; } AxivionProjectSettings *AxivionPlugin::projectSettings(ProjectExplorer::Project *project) diff --git a/src/plugins/axivion/axivionplugin.h b/src/plugins/axivion/axivionplugin.h index fc2bf3fb3ad..f4633cd378c 100644 --- a/src/plugins/axivion/axivionplugin.h +++ b/src/plugins/axivion/axivionplugin.h @@ -27,7 +27,7 @@ public: static ProjectInfo projectInfo(); private: - bool initialize(const QStringList &arguments, QString *errorMessage) final; + void initialize() final; void extensionsInitialized() final {} }; From 86a328f3a465fbf8fe70a4b5b4b86ab814599398 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 15:55:14 +0200 Subject: [PATCH 0788/1777] McuSupport: Hide McuDependenciesKitAspectFactory implemntation Change-Id: I8459f0c24f3884408c970900d4bb559e309506ee Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/mcusupport/mcukitinformation.cpp | 146 +++++++++---------- src/plugins/mcusupport/mcukitinformation.h | 19 +-- src/plugins/mcusupport/mcusupportplugin.cpp | 2 - 3 files changed, 74 insertions(+), 93 deletions(-) diff --git a/src/plugins/mcusupport/mcukitinformation.cpp b/src/plugins/mcusupport/mcukitinformation.cpp index 1d95f877cd1..b1771974375 100644 --- a/src/plugins/mcusupport/mcukitinformation.cpp +++ b/src/plugins/mcusupport/mcukitinformation.cpp @@ -5,13 +5,15 @@ #include "mcusupporttr.h" #include <cmakeprojectmanager/cmakekitinformation.h> + #include <utils/algorithm.h> #include <utils/filepath.h> #include <utils/qtcassert.h> using namespace ProjectExplorer; +using namespace Utils; -namespace { +namespace McuSupport::Internal { class McuDependenciesKitAspectImpl final : public KitAspect { @@ -25,77 +27,6 @@ public: void addToLayout(Layouting::LayoutItem &) override {} }; -} // anonymous namespace - -namespace McuSupport { -namespace Internal { - -McuDependenciesKitAspectFactory::McuDependenciesKitAspectFactory() -{ - setObjectName(QLatin1String("McuDependenciesKitAspect")); - setId(McuDependenciesKitAspect::id()); - setDisplayName(Tr::tr("MCU Dependencies")); - setDescription(Tr::tr("Paths to 3rd party dependencies")); - setPriority(28500); -} - -Tasks McuDependenciesKitAspectFactory::validate(const Kit *kit) const -{ - Tasks result; - QTC_ASSERT(kit, return result); - - // check dependencies are defined properly for this kit - const QVariant checkFormat = kit->value(McuDependenciesKitAspect::id()); - if (!checkFormat.isValid() || checkFormat.isNull()) - return result; - if (!checkFormat.canConvert(QVariant::List)) - return {BuildSystemTask(Task::Error, Tr::tr("The MCU dependencies setting value is invalid."))}; - - // check paths defined in cmake variables for given dependencies exist - const auto cMakeEntries = Utils::NameValueDictionary(McuDependenciesKitAspect::configuration(kit)); - for (const auto &dependency : McuDependenciesKitAspect::dependencies(kit)) { - auto givenPath = Utils::FilePath::fromUserInput(cMakeEntries.value(dependency.name)); - if (givenPath.isEmpty()) { - result << BuildSystemTask(Task::Warning, - Tr::tr("CMake variable %1 not defined.").arg(dependency.name)); - } else { - const auto detectionPath = givenPath.resolvePath(dependency.value); - if (!detectionPath.exists()) { - result << BuildSystemTask(Task::Warning, - Tr::tr("CMake variable %1: path %2 does not exist.") - .arg(dependency.name, detectionPath.toUserOutput())); - } - } - } - - return result; -} - -void McuDependenciesKitAspectFactory::fix(Kit *kit) -{ - QTC_ASSERT(kit, return ); - - const QVariant variant = kit->value(McuDependenciesKitAspect::id()); - if (!variant.isNull() && !variant.canConvert(QVariant::List)) { - qWarning("Kit \"%s\" has a wrong mcu dependencies value set.", - qPrintable(kit->displayName())); - McuDependenciesKitAspect::setDependencies(kit, Utils::NameValueItems()); - } -} - -KitAspect *McuDependenciesKitAspectFactory::createKitAspect(Kit *kit) const -{ - QTC_ASSERT(kit, return nullptr); - return new McuDependenciesKitAspectImpl(kit, this); -} - -KitAspectFactory::ItemList McuDependenciesKitAspectFactory::toUserOutput(const Kit *kit) const -{ - Q_UNUSED(kit) - - return {}; -} - Utils::Id McuDependenciesKitAspect::id() { return "PE.Profile.McuCMakeDependencies"; @@ -125,5 +56,72 @@ Utils::NameValuePairs McuDependenciesKitAspect::configuration(const Kit *kit) }); } -} // namespace Internal -} // namespace McuSupport +// McuDependenciesKitAspectFactory + +class McuDependenciesKitAspectFactory final : public KitAspectFactory +{ +public: + McuDependenciesKitAspectFactory() + { + setObjectName(QLatin1String("McuDependenciesKitAspect")); + setId(McuDependenciesKitAspect::id()); + setDisplayName(Tr::tr("MCU Dependencies")); + setDescription(Tr::tr("Paths to 3rd party dependencies")); + setPriority(28500); + } + + Tasks validate(const Kit *kit) const final + { + Tasks result; + QTC_ASSERT(kit, return result); + + // check dependencies are defined properly for this kit + const QVariant checkFormat = kit->value(McuDependenciesKitAspect::id()); + if (!checkFormat.isValid() || checkFormat.isNull()) + return result; + if (!checkFormat.canConvert(QVariant::List)) + return {BuildSystemTask(Task::Error, Tr::tr("The MCU dependencies setting value is invalid."))}; + + // check paths defined in cmake variables for given dependencies exist + const auto cMakeEntries = Utils::NameValueDictionary(McuDependenciesKitAspect::configuration(kit)); + for (const auto &dependency : McuDependenciesKitAspect::dependencies(kit)) { + auto givenPath = Utils::FilePath::fromUserInput(cMakeEntries.value(dependency.name)); + if (givenPath.isEmpty()) { + result << BuildSystemTask(Task::Warning, + Tr::tr("CMake variable %1 not defined.").arg(dependency.name)); + } else { + const auto detectionPath = givenPath.resolvePath(dependency.value); + if (!detectionPath.exists()) { + result << BuildSystemTask(Task::Warning, + Tr::tr("CMake variable %1: path %2 does not exist.") + .arg(dependency.name, detectionPath.toUserOutput())); + } + } + } + + return result; + } + void fix(Kit *kit) final + { + QTC_ASSERT(kit, return ); + + const QVariant variant = kit->value(McuDependenciesKitAspect::id()); + if (!variant.isNull() && !variant.canConvert(QVariant::List)) { + qWarning("Kit \"%s\" has a wrong mcu dependencies value set.", + qPrintable(kit->displayName())); + McuDependenciesKitAspect::setDependencies(kit, Utils::NameValueItems()); + } + } + + KitAspect *createKitAspect(Kit *kit) const final + { + QTC_ASSERT(kit, return nullptr); + return new McuDependenciesKitAspectImpl(kit, this); + } + + ItemList toUserOutput(const Kit *) const final { return {}; } +}; + +const McuDependenciesKitAspectFactory theMcuDependenciesKitAspectFactory; + +} // McuSupport::Internal diff --git a/src/plugins/mcusupport/mcukitinformation.h b/src/plugins/mcusupport/mcukitinformation.h index c138ba2fe6c..a86841a72aa 100644 --- a/src/plugins/mcusupport/mcukitinformation.h +++ b/src/plugins/mcusupport/mcukitinformation.h @@ -5,8 +5,7 @@ #include <projectexplorer/kitaspects.h> -namespace McuSupport { -namespace Internal { +namespace McuSupport::Internal { class McuDependenciesKitAspect final { @@ -17,18 +16,4 @@ public: static Utils::NameValuePairs configuration(const ProjectExplorer::Kit *kit); }; -class McuDependenciesKitAspectFactory final : public ProjectExplorer::KitAspectFactory -{ -public: - McuDependenciesKitAspectFactory(); - - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *kit) const override; - void fix(ProjectExplorer::Kit *kit) override; - - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *kit) const override; - - ItemList toUserOutput(const ProjectExplorer::Kit *kit) const override; -}; - -} // namespace Internal -} // namespace McuSupport +} // McuSupport::Internal diff --git a/src/plugins/mcusupport/mcusupportplugin.cpp b/src/plugins/mcusupport/mcusupportplugin.cpp index 8c521fb41b0..f531b93a2aa 100644 --- a/src/plugins/mcusupport/mcusupportplugin.cpp +++ b/src/plugins/mcusupport/mcusupportplugin.cpp @@ -4,7 +4,6 @@ #include "mcusupportplugin.h" #include "mcubuildstep.h" -#include "mcukitinformation.h" #include "mcukitmanager.h" #include "mcuqmlprojectnode.h" #include "mcusupportconstants.h" @@ -102,7 +101,6 @@ public: SettingsHandler::Ptr m_settingsHandler{new SettingsHandler}; McuSupportOptions m_options{m_settingsHandler}; McuSupportOptionsPage optionsPage{m_options, m_settingsHandler}; - McuDependenciesKitAspectFactory mcuDependenciesKitAspectFactory; MCUBuildStepFactory mcuBuildStepFactory; }; // class McuSupportPluginPrivate From ccfa32dda2ca88584e414fb0de01a503e7f2feb7 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh <orgad.shaneh@audiocodes.com> Date: Thu, 17 Aug 2023 17:48:12 +0300 Subject: [PATCH 0789/1777] PathChooser: Remove unused lambda captures Change-Id: I1f6763f20297e685c62c10195dfe74a5fddaf35a Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/pathchooser.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index c3054ec3cac..848e5619593 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -630,9 +630,7 @@ FancyLineEdit::AsyncValidationFunction PathChooser::defaultValidationFunction() return Utils::asyncRun( [expanded, defVal = d->m_defaultValue, - kind = d->m_acceptingKind, - env = d->m_environment, - baseDirectory = d->m_baseDirectory]() -> FancyLineEdit::AsyncValidationResult { + kind = d->m_acceptingKind]() -> FancyLineEdit::AsyncValidationResult { return validatePath(expanded, defVal, kind); }); }; From c9a9dbc96b62b78a86dcb4dddd3ef8b513608227 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 18 Aug 2023 08:12:21 +0200 Subject: [PATCH 0790/1777] CompilerExplorer: Fix qbs build on Windows Change-Id: If724adb055df235f3d806306e808470e5fd03ce6 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/compilerexplorer/compilerexplorer.qbs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/compilerexplorer/compilerexplorer.qbs b/src/plugins/compilerexplorer/compilerexplorer.qbs index acfee646d64..486d2c4931e 100644 --- a/src/plugins/compilerexplorer/compilerexplorer.qbs +++ b/src/plugins/compilerexplorer/compilerexplorer.qbs @@ -4,6 +4,8 @@ QtcPlugin { name: "CompilerExplorer" Depends { name: "Core" } + Depends { name: "Spinner" } + Depends { name: "TerminalLib" } Depends { name: "TextEditor" } Depends { name: "Qt"; submodules: ["widgets", "network"] } From 519a95ce5b85590913ce8fc8957630dc925c4f98 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 18:18:17 +0200 Subject: [PATCH 0791/1777] CompilerExplorer: Inline compilerexplorerplugin.h Makes adding unwanted functionality in this place harder. Change-Id: I2b36414b4bf6a58deff3c565936d433ebcdc9d5f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/compilerexplorer/CMakeLists.txt | 1 - .../compilerexplorer/compilerexplorer.qbs | 1 - .../compilerexplorerplugin.cpp | 60 ++++++++++--------- .../compilerexplorer/compilerexplorerplugin.h | 24 -------- 4 files changed, 32 insertions(+), 54 deletions(-) delete mode 100644 src/plugins/compilerexplorer/compilerexplorerplugin.h diff --git a/src/plugins/compilerexplorer/CMakeLists.txt b/src/plugins/compilerexplorer/CMakeLists.txt index 1c5608234b5..4df45f95f30 100644 --- a/src/plugins/compilerexplorer/CMakeLists.txt +++ b/src/plugins/compilerexplorer/CMakeLists.txt @@ -17,7 +17,6 @@ add_qtc_plugin(CompilerExplorer compilerexploreraspects.cpp compilerexploreraspects.h compilerexplorerplugin.cpp - compilerexplorerplugin.h compilerexplorertr.h compilerexplorereditor.cpp compilerexplorereditor.h diff --git a/src/plugins/compilerexplorer/compilerexplorer.qbs b/src/plugins/compilerexplorer/compilerexplorer.qbs index 486d2c4931e..88fda3bf616 100644 --- a/src/plugins/compilerexplorer/compilerexplorer.qbs +++ b/src/plugins/compilerexplorer/compilerexplorer.qbs @@ -30,7 +30,6 @@ QtcPlugin { "compilerexploreroptions.cpp", "compilerexploreroptions.h", "compilerexplorerplugin.cpp", - "compilerexplorerplugin.h", "compilerexplorersettings.cpp", "compilerexplorersettings.h", "compilerexplorertr.h", diff --git a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp index 44a3e3fafc8..f87dd780b1c 100644 --- a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp +++ b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp @@ -1,8 +1,6 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "compilerexplorerplugin.h" - #include "compilerexplorerconstants.h" #include "compilerexplorereditor.h" #include "compilerexplorersettings.h" @@ -18,39 +16,45 @@ #include <QMenu> -namespace CompilerExplorer { -namespace Internal { +#include <extensionsystem/iplugin.h> -CompilerExplorerPlugin::CompilerExplorerPlugin() {} +using namespace Core; -CompilerExplorerPlugin::~CompilerExplorerPlugin() {} +namespace CompilerExplorer::Internal { -void CompilerExplorerPlugin::initialize() +class CompilerExplorerPlugin : public ExtensionSystem::IPlugin { - static CompilerExplorer::EditorFactory ceEditorFactory; + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CompilerExplorer.json") - auto action = new QAction(Tr::tr("Open Compiler Explorer"), this); - connect(action, &QAction::triggered, this, [] { - CompilerExplorer::Settings settings; +public: + CompilerExplorerPlugin(); + ~CompilerExplorerPlugin() override; - const QString src = settings.source(); - QString name("Compiler Explorer"); - Core::EditorManager::openEditorWithContents(Constants::CE_EDITOR_ID, &name, src.toUtf8()); - }); + void initialize() override + { + static CompilerExplorer::EditorFactory ceEditorFactory; - Core::ActionContainer *mtools = Core::ActionManager::actionContainer(Core::Constants::M_TOOLS); - Core::ActionContainer *mCompilerExplorer = Core::ActionManager::createMenu( - "Tools.CompilerExplorer"); - QMenu *menu = mCompilerExplorer->menu(); - menu->setTitle(Tr::tr("Compiler Explorer")); - mtools->addMenu(mCompilerExplorer); + auto action = new QAction(Tr::tr("Open Compiler Explorer"), this); + connect(action, &QAction::triggered, this, [] { + CompilerExplorer::Settings settings; - Core::Command *cmd - = Core::ActionManager::registerAction(action, "CompilerExplorer.CompilerExplorerAction"); - mCompilerExplorer->addAction(cmd); -} + const QString src = settings.source(); + QString name("Compiler Explorer"); + EditorManager::openEditorWithContents(Constants::CE_EDITOR_ID, &name, src.toUtf8()); + }); -void CompilerExplorerPlugin::extensionsInitialized() {} + ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS); + ActionContainer *mCompilerExplorer = ActionManager::createMenu("Tools.CompilerExplorer"); + QMenu *menu = mCompilerExplorer->menu(); + menu->setTitle(Tr::tr("Compiler Explorer")); + mtools->addMenu(mCompilerExplorer); -} // namespace Internal -} // namespace CompilerExplorer + Command *cmd = ActionManager::registerAction(action, "CompilerExplorer.CompilerExplorerAction"); + mCompilerExplorer->addAction(cmd); + } +}; + +} // CompilerExplorer::Internl + +#include "compilerexplorerplugin.moc" diff --git a/src/plugins/compilerexplorer/compilerexplorerplugin.h b/src/plugins/compilerexplorer/compilerexplorerplugin.h deleted file mode 100644 index 8379a2c8e0f..00000000000 --- a/src/plugins/compilerexplorer/compilerexplorerplugin.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <extensionsystem/iplugin.h> - -namespace CompilerExplorer::Internal { - -class CompilerExplorerPlugin : public ExtensionSystem::IPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CompilerExplorer.json") - -public: - CompilerExplorerPlugin(); - ~CompilerExplorerPlugin() override; - - void initialize() override; - - void extensionsInitialized() override; -}; - -} // namespace CompilerExplorer::Internal From 26db9f2c9508c0165469fc1add6aba7172924505 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 18:48:45 +0200 Subject: [PATCH 0792/1777] Core: De-QObject-ify editor factories Change-Id: Iaf39ad29576638e994dd2f28d323e445ce2ee93f Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/bineditor/bineditorplugin.cpp | 2 +- .../coreplugin/editormanager/ieditorfactory.cpp | 11 ++++++----- src/plugins/coreplugin/editormanager/ieditorfactory.h | 7 ++----- .../coreplugin/editormanager/iexternaleditor.h | 2 -- src/plugins/coreplugin/editormanager/systemeditor.h | 2 -- src/plugins/haskell/haskelleditorfactory.cpp | 6 +++--- src/plugins/python/pythoneditor.cpp | 2 +- src/plugins/python/pythoneditor.h | 2 ++ src/plugins/qtsupport/externaleditors.cpp | 6 +++--- src/plugins/qtsupport/externaleditors.h | 3 +++ 10 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index c964030c990..bce951d6204 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -40,7 +40,7 @@ using namespace Core; namespace BinEditor::Internal { -class BinEditorFactory final : public IEditorFactory +class BinEditorFactory final : public QObject, public IEditorFactory { public: BinEditorFactory(); diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp index 878f7a5b5d8..87940075005 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp +++ b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp @@ -228,11 +228,12 @@ const EditorFactoryList IEditorFactory::allEditorFactories() const EditorFactoryList IEditorFactory::preferredEditorFactories(const FilePath &filePath) { const auto defaultEditorFactories = [](const MimeType &mimeType) { - const EditorTypeList types = defaultEditorTypes(mimeType); - const EditorTypeList ieditorTypes = Utils::filtered(types, [](EditorType *type) { - return type->asEditorFactory() != nullptr; - }); - return Utils::qobject_container_cast<IEditorFactory *>(ieditorTypes); + QList<IEditorFactory *> editorFactories; + for (EditorType *type : defaultEditorTypes(mimeType)) { + if (IEditorFactory *editorFactory = type->asEditorFactory()) + editorFactories.append(editorFactory); + } + return editorFactories; }; // default factories by mime type diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.h b/src/plugins/coreplugin/editormanager/ieditorfactory.h index a2f44d831d7..670bd5b4f5d 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory.h +++ b/src/plugins/coreplugin/editormanager/ieditorfactory.h @@ -27,11 +27,10 @@ class EditorType; using EditorFactoryList = QList<IEditorFactory *>; using EditorTypeList = QList<EditorType *>; -class CORE_EXPORT EditorType : public QObject +class CORE_EXPORT EditorType { - Q_OBJECT public: - ~EditorType() override; + virtual ~EditorType(); static const EditorTypeList allEditorTypes(); static EditorType *editorTypeForId(const Utils::Id &id); @@ -60,8 +59,6 @@ private: class CORE_EXPORT IEditorFactory : public EditorType { - Q_OBJECT - public: IEditorFactory(); ~IEditorFactory() override; diff --git a/src/plugins/coreplugin/editormanager/iexternaleditor.h b/src/plugins/coreplugin/editormanager/iexternaleditor.h index 28c331e5c40..49d0ffcfee9 100644 --- a/src/plugins/coreplugin/editormanager/iexternaleditor.h +++ b/src/plugins/coreplugin/editormanager/iexternaleditor.h @@ -24,8 +24,6 @@ using ExternalEditorList = QList<IExternalEditor *>; class CORE_EXPORT IExternalEditor : public EditorType { - Q_OBJECT - public: explicit IExternalEditor(); ~IExternalEditor() override; diff --git a/src/plugins/coreplugin/editormanager/systemeditor.h b/src/plugins/coreplugin/editormanager/systemeditor.h index 8d0e71c5961..96f29b8bf85 100644 --- a/src/plugins/coreplugin/editormanager/systemeditor.h +++ b/src/plugins/coreplugin/editormanager/systemeditor.h @@ -10,8 +10,6 @@ namespace Internal { class SystemEditor : public IExternalEditor { - Q_OBJECT - public: explicit SystemEditor(); diff --git a/src/plugins/haskell/haskelleditorfactory.cpp b/src/plugins/haskell/haskelleditorfactory.cpp index ba87f88ef70..f3e65ffcd8e 100644 --- a/src/plugins/haskell/haskelleditorfactory.cpp +++ b/src/plugins/haskell/haskelleditorfactory.cpp @@ -16,12 +16,12 @@ namespace Haskell::Internal { -static QWidget *createEditorWidget(QObject *guard) +static QWidget *createEditorWidget() { auto widget = new TextEditor::TextEditorWidget; auto ghciButton = new Core::CommandButton(Constants::A_RUN_GHCI, widget); ghciButton->setText(Tr::tr("GHCi")); - QObject::connect(ghciButton, &QToolButton::clicked, guard, [widget] { + QObject::connect(ghciButton, &QToolButton::clicked, widget, [widget] { HaskellManager::openGhci(widget->textDocument()->filePath()); }); widget->insertExtraToolBarWidget(TextEditor::TextEditorWidget::Left, ghciButton); @@ -37,7 +37,7 @@ HaskellEditorFactory::HaskellEditorFactory() | TextEditor::TextEditorActionHandler::FollowSymbolUnderCursor); setDocumentCreator([] { return new TextEditor::TextDocument(Constants::C_HASKELLEDITOR_ID); }); setIndenterCreator([](QTextDocument *doc) { return new TextEditor::TextIndenter(doc); }); - setEditorWidgetCreator([this] { return createEditorWidget(this); }); + setEditorWidgetCreator(&createEditorWidget); setCommentDefinition(Utils::CommentDefinition("--", "{-", "-}")); setParenthesesMatchingEnabled(true); setMarksVisible(true); diff --git a/src/plugins/python/pythoneditor.cpp b/src/plugins/python/pythoneditor.cpp index d23685bc3b7..6a6a377ba0a 100644 --- a/src/plugins/python/pythoneditor.cpp +++ b/src/plugins/python/pythoneditor.cpp @@ -268,7 +268,7 @@ void PythonEditorWidget::updateInterpretersSelector() PythonEditorFactory::PythonEditorFactory() { - registerReplAction(this); + registerReplAction(&m_guard); setId(Constants::C_PYTHONEDITOR_ID); setDisplayName(::Core::Tr::tr(Constants::C_EDITOR_DISPLAY_NAME)); diff --git a/src/plugins/python/pythoneditor.h b/src/plugins/python/pythoneditor.h index b713e3dbce3..e2eef32b88d 100644 --- a/src/plugins/python/pythoneditor.h +++ b/src/plugins/python/pythoneditor.h @@ -11,6 +11,8 @@ class PythonEditorFactory : public TextEditor::TextEditorFactory { public: PythonEditorFactory(); +private: + QObject m_guard; }; } // Python::Internal diff --git a/src/plugins/qtsupport/externaleditors.cpp b/src/plugins/qtsupport/externaleditors.cpp index 8e6b0bbcead..73bb1116144 100644 --- a/src/plugins/qtsupport/externaleditors.cpp +++ b/src/plugins/qtsupport/externaleditors.cpp @@ -307,12 +307,12 @@ bool DesignerExternalEditor::startEditor(const FilePath &filePath, QString *erro // Insert into cache if socket is created, else try again next time if (server.waitForNewConnection(3000)) { QTcpSocket *socket = server.nextPendingConnection(); - socket->setParent(this); + socket->setParent(&m_guard); const QString binary = data.binary; m_processCache.insert(binary, socket); auto mapSlot = [binary] { processTerminated(binary); }; - connect(socket, &QAbstractSocket::disconnected, this, mapSlot); - connect(socket, &QAbstractSocket::errorOccurred, this, mapSlot); + QObject::connect(socket, &QAbstractSocket::disconnected, &m_guard, mapSlot); + QObject::connect(socket, &QAbstractSocket::errorOccurred, &m_guard, mapSlot); } return true; } diff --git a/src/plugins/qtsupport/externaleditors.h b/src/plugins/qtsupport/externaleditors.h index 14fd2ea2272..455e34a208b 100644 --- a/src/plugins/qtsupport/externaleditors.h +++ b/src/plugins/qtsupport/externaleditors.h @@ -13,6 +13,9 @@ public: DesignerExternalEditor(); bool startEditor(const Utils::FilePath &filePath, QString *errorMessage) final; + +private: + QObject m_guard; }; class LinguistEditor : public Core::IExternalEditor From c96867655a73937d4b9fcdabe34261d15d7e3abc Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 16:27:44 +0200 Subject: [PATCH 0793/1777] Axivion: Move project settings storage closer to project settings Change-Id: I52122147f8d5ca24dd73db1408b60f8199878bdd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/axivion/axivionplugin.cpp | 25 +----------- src/plugins/axivion/axivionplugin.h | 2 - .../axivion/axivionprojectsettings.cpp | 39 ++++++++++++++++++- src/plugins/axivion/axivionprojectsettings.h | 5 ++- 4 files changed, 43 insertions(+), 28 deletions(-) diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index 41a4df12ca2..bec3718b466 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -37,7 +37,6 @@ namespace Axivion::Internal { class AxivionPluginPrivate : public QObject { public: - AxivionProjectSettings *projectSettings(ProjectExplorer::Project *project); void onStartupProjectChanged(); void fetchProjectInfo(const QString &projectName); void handleProjectInfo(const ProjectInfo &info); @@ -49,7 +48,6 @@ public: void fetchRuleInfo(const QString &id); AxivionOutputPane m_axivionOutputPane; - QHash<ProjectExplorer::Project *, AxivionProjectSettings *> m_axivionProjectSettings; ProjectInfo m_currentProjectInfo; bool m_runningQuery = false; }; @@ -86,10 +84,7 @@ AxivionTextMark::AxivionTextMark(const Utils::FilePath &filePath, const ShortIss AxivionPlugin::~AxivionPlugin() { - if (dd && !dd->m_axivionProjectSettings.isEmpty()) { - qDeleteAll(dd->m_axivionProjectSettings); - dd->m_axivionProjectSettings.clear(); - } + AxivionProjectSettings::destroyProjectSettings(); delete dd; dd = nullptr; } @@ -114,14 +109,6 @@ void AxivionPlugin::initialize() dd, &AxivionPluginPrivate::onDocumentClosed); } -AxivionProjectSettings *AxivionPlugin::projectSettings(ProjectExplorer::Project *project) -{ - QTC_ASSERT(project, return nullptr); - QTC_ASSERT(dd, return nullptr); - - return dd->projectSettings(project); -} - void AxivionPlugin::fetchProjectInfo(const QString &projectName) { QTC_ASSERT(dd, return); @@ -134,14 +121,6 @@ ProjectInfo AxivionPlugin::projectInfo() return dd->m_currentProjectInfo; } -AxivionProjectSettings *AxivionPluginPrivate::projectSettings(ProjectExplorer::Project *project) -{ - auto &settings = m_axivionProjectSettings[project]; - if (!settings) - settings = new AxivionProjectSettings(project); - return settings; -} - void AxivionPluginPrivate::onStartupProjectChanged() { ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject(); @@ -152,7 +131,7 @@ void AxivionPluginPrivate::onStartupProjectChanged() return; } - const AxivionProjectSettings *projSettings = projectSettings(project); + const AxivionProjectSettings *projSettings = AxivionProjectSettings::projectSettings(project); fetchProjectInfo(projSettings->dashboardProjectName()); } diff --git a/src/plugins/axivion/axivionplugin.h b/src/plugins/axivion/axivionplugin.h index f4633cd378c..9d71366fc45 100644 --- a/src/plugins/axivion/axivionplugin.h +++ b/src/plugins/axivion/axivionplugin.h @@ -21,8 +21,6 @@ public: AxivionPlugin() {} ~AxivionPlugin() final; - static AxivionProjectSettings *projectSettings(ProjectExplorer::Project *project); - static void fetchProjectInfo(const QString &projectName); static ProjectInfo projectInfo(); diff --git a/src/plugins/axivion/axivionprojectsettings.cpp b/src/plugins/axivion/axivionprojectsettings.cpp index d38f10f0e1d..58ec2eecd5e 100644 --- a/src/plugins/axivion/axivionprojectsettings.cpp +++ b/src/plugins/axivion/axivionprojectsettings.cpp @@ -17,12 +17,39 @@ #include <QTreeWidget> #include <QVBoxLayout> +using namespace ProjectExplorer; using namespace Utils; namespace Axivion::Internal { const char PSK_PROJECTNAME[] = "Axivion.ProjectName"; +class AxivionProjectSettingsHandler : public QObject +{ +public: + AxivionProjectSettings *projectSettings(ProjectExplorer::Project *project) + { + auto &settings = m_axivionProjectSettings[project]; + if (!settings) + settings = new AxivionProjectSettings(project); + return settings; + } + + void destroy() + { + qDeleteAll(m_axivionProjectSettings); + m_axivionProjectSettings.clear(); + } + + QHash<ProjectExplorer::Project *, AxivionProjectSettings *> m_axivionProjectSettings; +}; + +static AxivionProjectSettingsHandler &projectSettingsHandler() +{ + static AxivionProjectSettingsHandler theProjectSettingsHandler; + return theProjectSettingsHandler; +} + AxivionProjectSettings::AxivionProjectSettings(ProjectExplorer::Project *project) : m_project{project} { @@ -33,6 +60,16 @@ AxivionProjectSettings::AxivionProjectSettings(ProjectExplorer::Project *project this, &AxivionProjectSettings::save); } +AxivionProjectSettings *AxivionProjectSettings::projectSettings(ProjectExplorer::Project *project) +{ + return projectSettingsHandler().projectSettings(project); +} + +void AxivionProjectSettings::destroyProjectSettings() +{ + projectSettingsHandler().destroy(); +} + void AxivionProjectSettings::load() { m_dashboardProjectName = m_project->namedSettings(PSK_PROJECTNAME).toString(); @@ -46,7 +83,7 @@ void AxivionProjectSettings::save() AxivionProjectSettingsWidget::AxivionProjectSettingsWidget(ProjectExplorer::Project *project, QWidget *parent) : ProjectExplorer::ProjectSettingsWidget{parent} - , m_projectSettings(AxivionPlugin::projectSettings(project)) + , m_projectSettings(projectSettingsHandler().projectSettings(project)) { setUseGlobalSettingsCheckBoxVisible(false); setUseGlobalSettingsLabelVisible(true); diff --git a/src/plugins/axivion/axivionprojectsettings.h b/src/plugins/axivion/axivionprojectsettings.h index e3fa07cb5b5..e3d37210260 100644 --- a/src/plugins/axivion/axivionprojectsettings.h +++ b/src/plugins/axivion/axivionprojectsettings.h @@ -3,8 +3,6 @@ #pragma once -#include "axivionsettings.h" - #include <projectexplorer/projectsettingswidget.h> #include <QObject> @@ -31,6 +29,9 @@ public: void setDashboardProjectName(const QString &name) { m_dashboardProjectName = name; } QString dashboardProjectName() const { return m_dashboardProjectName; } + static AxivionProjectSettings *projectSettings(ProjectExplorer::Project *project); + static void destroyProjectSettings(); + private: void load(); void save(); From 48bb019027085d9a2db3aa1209541e9e8300bd56 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 18 Aug 2023 09:25:08 +0200 Subject: [PATCH 0794/1777] CompilerExplorer: Remove undefined functions Change-Id: I8ffe3b7ca77103bc88a6f994d58260b87e7f21fb Reviewed-by: hjk <hjk@qt.io> --- src/plugins/compilerexplorer/compilerexplorerplugin.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp index f87dd780b1c..542cc037b0a 100644 --- a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp +++ b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp @@ -28,9 +28,6 @@ class CompilerExplorerPlugin : public ExtensionSystem::IPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CompilerExplorer.json") public: - CompilerExplorerPlugin(); - ~CompilerExplorerPlugin() override; - void initialize() override { static CompilerExplorer::EditorFactory ceEditorFactory; From 7b0a3e7e28e5e57682e51fcfb5d0ef61e7e0f6e5 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 16:35:08 +0200 Subject: [PATCH 0795/1777] Axivion: Hide ProjectSettingsWidget Change-Id: Iaf5b0645953f31744fbf29995771d3e9d994c29b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/axivion/axivionplugin.cpp | 4 +- .../axivion/axivionprojectsettings.cpp | 42 +++++++++++++++++-- src/plugins/axivion/axivionprojectsettings.h | 42 +++---------------- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index bec3718b466..ef253e9c0d5 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -96,9 +96,7 @@ void AxivionPlugin::initialize() auto panelFactory = new ProjectExplorer::ProjectPanelFactory; panelFactory->setPriority(250); panelFactory->setDisplayName(Tr::tr("Axivion")); - panelFactory->setCreateWidgetFunction([](ProjectExplorer::Project *project){ - return new AxivionProjectSettingsWidget(project); - }); + panelFactory->setCreateWidgetFunction(&AxivionProjectSettings::createSettingsWidget); ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory); connect(ProjectExplorer::ProjectManager::instance(), &ProjectExplorer::ProjectManager::startupProjectChanged, diff --git a/src/plugins/axivion/axivionprojectsettings.cpp b/src/plugins/axivion/axivionprojectsettings.cpp index 58ec2eecd5e..d92a601435d 100644 --- a/src/plugins/axivion/axivionprojectsettings.cpp +++ b/src/plugins/axivion/axivionprojectsettings.cpp @@ -10,6 +10,8 @@ #include "axiviontr.h" #include <projectexplorer/project.h> +#include <projectexplorer/projectsettingswidget.h> + #include <utils/infolabel.h> #include <utils/qtcassert.h> @@ -24,6 +26,8 @@ namespace Axivion::Internal { const char PSK_PROJECTNAME[] = "Axivion.ProjectName"; +// AxivionProjectSettingsHandler + class AxivionProjectSettingsHandler : public QObject { public: @@ -50,6 +54,8 @@ static AxivionProjectSettingsHandler &projectSettingsHandler() return theProjectSettingsHandler; } +// AxivionProjectSettings + AxivionProjectSettings::AxivionProjectSettings(ProjectExplorer::Project *project) : m_project{project} { @@ -80,10 +86,33 @@ void AxivionProjectSettings::save() m_project->setNamedSettings(PSK_PROJECTNAME, m_dashboardProjectName); } -AxivionProjectSettingsWidget::AxivionProjectSettingsWidget(ProjectExplorer::Project *project, - QWidget *parent) - : ProjectExplorer::ProjectSettingsWidget{parent} - , m_projectSettings(projectSettingsHandler().projectSettings(project)) +// AxivionProjectSettingsWidget + +class AxivionProjectSettingsWidget : public ProjectExplorer::ProjectSettingsWidget +{ +public: + explicit AxivionProjectSettingsWidget(ProjectExplorer::Project *project); + +private: + void fetchProjects(); + void onDashboardInfoReceived(const DashboardInfo &info); + void onSettingsChanged(); + void linkProject(); + void unlinkProject(); + void updateUi(); + void updateEnabledStates(); + + AxivionProjectSettings *m_projectSettings = nullptr; + QLabel *m_linkedProject = nullptr; + QTreeWidget *m_dashboardProjects = nullptr; + QPushButton *m_fetchProjects = nullptr; + QPushButton *m_link = nullptr; + QPushButton *m_unlink = nullptr; + Utils::InfoLabel *m_infoLabel = nullptr; +}; + +AxivionProjectSettingsWidget::AxivionProjectSettingsWidget(ProjectExplorer::Project *project) + : m_projectSettings(projectSettingsHandler().projectSettings(project)) { setUseGlobalSettingsCheckBoxVisible(false); setUseGlobalSettingsLabelVisible(true); @@ -219,4 +248,9 @@ void AxivionProjectSettingsWidget::updateEnabledStates() } } +ProjectSettingsWidget *AxivionProjectSettings::createSettingsWidget(ProjectExplorer::Project *project) +{ + return new AxivionProjectSettingsWidget(project); +} + } // Axivion::Internal diff --git a/src/plugins/axivion/axivionprojectsettings.h b/src/plugins/axivion/axivionprojectsettings.h index e3d37210260..d11b001d9f3 100644 --- a/src/plugins/axivion/axivionprojectsettings.h +++ b/src/plugins/axivion/axivionprojectsettings.h @@ -3,24 +3,15 @@ #pragma once -#include <projectexplorer/projectsettingswidget.h> - #include <QObject> -QT_BEGIN_NAMESPACE -class QLabel; -class QPushButton; -class QTreeWidget; -QT_END_NAMESPACE - -namespace ProjectExplorer { class Project; } - -namespace Utils { class InfoLabel; } +namespace ProjectExplorer { +class Project; +class ProjectSettingsWidget; +} namespace Axivion::Internal { -class DashboardInfo; - class AxivionProjectSettings : public QObject { public: @@ -31,6 +22,7 @@ public: static AxivionProjectSettings *projectSettings(ProjectExplorer::Project *project); static void destroyProjectSettings(); + static ProjectExplorer::ProjectSettingsWidget *createSettingsWidget(ProjectExplorer::Project *project); private: void load(); @@ -40,28 +32,4 @@ private: QString m_dashboardProjectName; }; -class AxivionProjectSettingsWidget : public ProjectExplorer::ProjectSettingsWidget -{ -public: - explicit AxivionProjectSettingsWidget(ProjectExplorer::Project *project, - QWidget *parent = nullptr); - -private: - void fetchProjects(); - void onDashboardInfoReceived(const DashboardInfo &info); - void onSettingsChanged(); - void linkProject(); - void unlinkProject(); - void updateUi(); - void updateEnabledStates(); - - AxivionProjectSettings *m_projectSettings = nullptr; - QLabel *m_linkedProject = nullptr; - QTreeWidget *m_dashboardProjects = nullptr; - QPushButton *m_fetchProjects = nullptr; - QPushButton *m_link = nullptr; - QPushButton *m_unlink = nullptr; - Utils::InfoLabel *m_infoLabel = nullptr; -}; - } // Axivion::Internal From b48e10717f8914710c61491e8edc931f9d43dac2 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 11:02:25 +0200 Subject: [PATCH 0796/1777] ProjectExplorer: Self-register JsonWizardPage related factories Moves the using code closer to the common factory setup pattern. Change-Id: I2ee85b911d43b63730ff994a4b07568b23b14f00 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/designer/formeditorplugin.cpp | 3 +- .../jsonwizard/jsonwizardfactory.cpp | 65 +++++++++++-------- .../jsonwizard/jsonwizardfactory.h | 7 -- .../jsonwizard/jsonwizardgeneratorfactory.h | 3 + .../jsonwizard/jsonwizardpagefactory.cpp | 2 - .../jsonwizard/jsonwizardpagefactory.h | 1 + .../projectexplorer/projectexplorer.cpp | 19 +++--- src/plugins/python/pythonplugin.cpp | 2 +- src/plugins/qtsupport/qtsupportplugin.cpp | 3 +- src/plugins/squish/squishplugin.cpp | 10 +-- src/plugins/vcsbase/vcsplugin.cpp | 6 +- 11 files changed, 62 insertions(+), 59 deletions(-) diff --git a/src/plugins/designer/formeditorplugin.cpp b/src/plugins/designer/formeditorplugin.cpp index e839ce2b3a2..e997b26b939 100644 --- a/src/plugins/designer/formeditorplugin.cpp +++ b/src/plugins/designer/formeditorplugin.cpp @@ -52,6 +52,7 @@ public: FormEditorFactory formEditorFactory; SettingsPageProvider settingsPageProvider; QtDesignerFormClassCodeGenerator formClassCodeGenerator; + FormPageFactory formPageFactory; }; FormEditorPlugin::~FormEditorPlugin() @@ -99,8 +100,6 @@ bool FormEditorPlugin::initialize([[maybe_unused]] const QStringList &arguments, }); #endif - ProjectExplorer::JsonWizardFactory::registerPageFactory(new Internal::FormPageFactory); - // Ensure that loading designer translations is done before FormEditorW is instantiated const QString locale = ICore::userInterfaceLanguage(); if (!locale.isEmpty()) { diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp index 80a0b8e0dcb..4d364362fd1 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp @@ -68,8 +68,17 @@ const char OPTIONS_KEY[] = "options"; const char PLATFORM_INDEPENDENT_KEY[] = "platformIndependent"; const char DEFAULT_VALUES[] = "defaultValues"; -static QList<JsonWizardPageFactory *> s_pageFactories; -static QList<JsonWizardGeneratorFactory *> s_generatorFactories; +static QList<JsonWizardPageFactory *> &pageFactories() +{ + static QList<JsonWizardPageFactory *> thePageFactories; + return thePageFactories; +} + +static QList<JsonWizardGeneratorFactory *> &generatorFactories() +{ + static QList<JsonWizardGeneratorFactory *> theGeneratorFactories; + return theGeneratorFactories; +} int JsonWizardFactory::m_verbose = 0; @@ -115,11 +124,11 @@ static JsonWizardFactory::Generator parseGenerator(const QVariant &value, QStrin } Id typeId = Id::fromString(QLatin1String(Constants::GENERATOR_ID_PREFIX) + strVal); JsonWizardGeneratorFactory *factory - = findOr(s_generatorFactories, nullptr, [typeId](JsonWizardGeneratorFactory *f) { return f->canCreate(typeId); }); + = findOr(generatorFactories(), nullptr, [typeId](JsonWizardGeneratorFactory *f) { return f->canCreate(typeId); }); if (!factory) { *errorMessage = Tr::tr("TypeId \"%1\" of generator is unknown. Supported typeIds are: \"%2\".") .arg(strVal) - .arg(supportedTypeIds(s_generatorFactories).replace(QLatin1String(Constants::GENERATOR_ID_PREFIX), QLatin1String(""))); + .arg(supportedTypeIds(generatorFactories()).replace(QLatin1String(Constants::GENERATOR_ID_PREFIX), QLatin1String(""))); return gen; } @@ -133,6 +142,26 @@ static JsonWizardFactory::Generator parseGenerator(const QVariant &value, QStrin return gen; } +JsonWizardPageFactory::JsonWizardPageFactory() +{ + pageFactories().append(this); +} + +JsonWizardPageFactory::~JsonWizardPageFactory() +{ + pageFactories().removeOne(this); +} + +JsonWizardGeneratorFactory::JsonWizardGeneratorFactory() +{ + generatorFactories().append(this); +} + +JsonWizardGeneratorFactory::~JsonWizardGeneratorFactory() +{ + generatorFactories().removeOne(this); +} + //FIXME: createWizardFactories() has an almost identical loop. Make the loop return the results instead of //internal processing and create a separate function for it. Then process the results in //loadDefaultValues() and createWizardFactories() @@ -323,11 +352,11 @@ JsonWizardFactory::Page JsonWizardFactory::parsePage(const QVariant &value, QStr Id typeId = Id::fromString(QLatin1String(Constants::PAGE_ID_PREFIX) + strVal); JsonWizardPageFactory *factory - = Utils::findOr(s_pageFactories, nullptr, [typeId](JsonWizardPageFactory *f) { return f->canCreate(typeId); }); + = Utils::findOr(pageFactories(), nullptr, [typeId](JsonWizardPageFactory *f) { return f->canCreate(typeId); }); if (!factory) { *errorMessage = Tr::tr("TypeId \"%1\" of page is unknown. Supported typeIds are: \"%2\".") .arg(strVal) - .arg(supportedTypeIds(s_pageFactories).replace(QLatin1String(Constants::PAGE_ID_PREFIX), QLatin1String(""))); + .arg(supportedTypeIds(pageFactories()).replace(QLatin1String(Constants::PAGE_ID_PREFIX), QLatin1String(""))); return p; } @@ -519,18 +548,6 @@ int JsonWizardFactory::verbose() return m_verbose; } -void JsonWizardFactory::registerPageFactory(JsonWizardPageFactory *factory) -{ - QTC_ASSERT(!s_pageFactories.contains(factory), return); - s_pageFactories.append(factory); -} - -void JsonWizardFactory::registerGeneratorFactory(JsonWizardGeneratorFactory *factory) -{ - QTC_ASSERT(!s_generatorFactories.contains(factory), return); - s_generatorFactories.append(factory); -} - static QString qmlProjectName(const FilePath &folder) { FilePath currentFolder = folder; @@ -598,7 +615,7 @@ Wizard *JsonWizardFactory::runWizardImpl(const FilePath &path, QWidget *parent, continue; havePage = true; - JsonWizardPageFactory *factory = findOr(s_pageFactories, nullptr, + JsonWizardPageFactory *factory = findOr(pageFactories(), nullptr, [&data](JsonWizardPageFactory *f) { return f->canCreate(data.typeId); }); @@ -621,7 +638,7 @@ Wizard *JsonWizardFactory::runWizardImpl(const FilePath &path, QWidget *parent, for (const Generator &data : std::as_const(m_generators)) { QTC_ASSERT(data.isValid(), continue); - JsonWizardGeneratorFactory *factory = Utils::findOr(s_generatorFactories, nullptr, + JsonWizardGeneratorFactory *factory = Utils::findOr(generatorFactories(), nullptr, [&data](JsonWizardGeneratorFactory *f) { return f->canCreate(data.typeId); }); @@ -701,14 +718,6 @@ bool JsonWizardFactory::isAvailable(Id platformId) const return JsonWizard::boolFromVariant(m_enabledExpression, &expander); } -void JsonWizardFactory::destroyAllFactories() -{ - qDeleteAll(s_pageFactories); - s_pageFactories.clear(); - qDeleteAll(s_generatorFactories); - s_generatorFactories.clear(); -} - bool JsonWizardFactory::initialize(const QVariantMap &data, const FilePath &baseDir, QString *errorMessage) { QTC_ASSERT(errorMessage, return false); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.h b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.h index 95171f11dbd..118b20330f2 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.h @@ -15,9 +15,6 @@ namespace ProjectExplorer { -class JsonWizardFactory; -class JsonWizardPageFactory; -class JsonWizardGeneratorFactory; class ProjectExplorerPlugin; class ProjectExplorerPluginPrivate; @@ -52,9 +49,6 @@ public: QVariant data; }; - static void registerPageFactory(JsonWizardPageFactory *factory); - static void registerGeneratorFactory(JsonWizardGeneratorFactory *factory); - static QList<QVariant> objectOrList(const QVariant &data, QString *errorMessage); static QString localizedString(const QVariant &value); @@ -78,7 +72,6 @@ private: static void setVerbose(int level); static int verbose(); - static void destroyAllFactories(); bool initialize(const QVariantMap &data, const Utils::FilePath &baseDir, QString *errorMessage); JsonWizardFactory::Page parsePage(const QVariant &value, QString *errorMessage); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.h b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.h index 199e359bfb4..2b7683f661d 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.h @@ -47,6 +47,9 @@ class PROJECTEXPLORER_EXPORT JsonWizardGeneratorFactory : public QObject Q_OBJECT public: + JsonWizardGeneratorFactory(); + ~JsonWizardGeneratorFactory() override; + bool canCreate(Utils::Id typeId) const { return m_typeIds.contains(typeId); } QList<Utils::Id> supportedIds() const { return m_typeIds; } diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.cpp index 492b4406b4d..0961cfa9064 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.cpp @@ -13,8 +13,6 @@ namespace ProjectExplorer { // JsonWizardPageFactory: // -------------------------------------------------------------------- -JsonWizardPageFactory::~JsonWizardPageFactory() = default; - void JsonWizardPageFactory::setTypeIdsSuffixes(const QStringList &suffixes) { m_typeIds = Utils::transform(suffixes, [](const QString &suffix) { diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.h b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.h index 5558022a3e8..b6374772461 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.h @@ -18,6 +18,7 @@ class JsonWizard; class PROJECTEXPLORER_EXPORT JsonWizardPageFactory { public: + JsonWizardPageFactory(); virtual ~JsonWizardPageFactory(); bool canCreate(Utils::Id typeId) const { return m_typeIds.contains(typeId); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 8493bf275ab..2f2a9644532 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -690,6 +690,15 @@ public: DeviceCheckBuildStepFactory deviceCheckBuildStepFactory; SanitizerOutputFormatterFactory sanitizerFormatterFactory; + + // JsonWizard related + FieldPageFactory fieldPageFactory; + FilePageFactory filePageFactory; + KitsPageFactory kitsPageFactory; + ProjectPageFactory projectPageFactory; + SummaryPageFactory summaryPageFactory; + FileGeneratorFactory fileGeneratorFactory; + ScannerGeneratorFactory scannerGeneratorFactory; }; static ProjectExplorerPlugin *m_instance = nullptr; @@ -756,7 +765,6 @@ ProjectExplorerPlugin::~ProjectExplorerPlugin() QTC_ASSERT(dd, return); delete dd->m_proWindow; // Needs access to the kit manager. - JsonWizardFactory::destroyAllFactories(); // Force sequence of deletion: KitManager::destroy(); // remove all the profile information @@ -843,15 +851,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er : FilePath()); }); - // For JsonWizard: - JsonWizardFactory::registerPageFactory(new FieldPageFactory); - JsonWizardFactory::registerPageFactory(new FilePageFactory); - JsonWizardFactory::registerPageFactory(new KitsPageFactory); - JsonWizardFactory::registerPageFactory(new ProjectPageFactory); - JsonWizardFactory::registerPageFactory(new SummaryPageFactory); - JsonWizardFactory::registerGeneratorFactory(new FileGeneratorFactory); - JsonWizardFactory::registerGeneratorFactory(new ScannerGeneratorFactory); - dd->m_proWindow = new ProjectWindow; Context projectTreeContext(Constants::C_PROJECT_TREE); diff --git a/src/plugins/python/pythonplugin.cpp b/src/plugins/python/pythonplugin.cpp index bc95ddd2aa8..a7e8cc3c747 100644 --- a/src/plugins/python/pythonplugin.cpp +++ b/src/plugins/python/pythonplugin.cpp @@ -37,6 +37,7 @@ public: PySideBuildConfigurationFactory buildConfigFactory; SimpleTargetRunnerFactory runWorkerFactory{{runConfigFactory.runConfigurationId()}}; PythonSettings settings; + PythonWizardPageFactory pythonWizardPageFactory; }; PythonPlugin::PythonPlugin() @@ -61,7 +62,6 @@ void PythonPlugin::initialize() ProjectManager::registerProjectType<PythonProject>(PythonMimeType); ProjectManager::registerProjectType<PythonProject>(PythonMimeTypeLegacy); - JsonWizardFactory::registerPageFactory(new PythonWizardPageFactory); } void PythonPlugin::extensionsInitialized() diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index 7e93652bad6..2851c977b76 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -67,6 +67,8 @@ public: DesignerExternalEditor designerEditor; LinguistEditor linguistEditor; + + TranslationWizardPageFactory translationWizardPageFactory; }; QtSupportPlugin::~QtSupportPlugin() @@ -131,7 +133,6 @@ void QtSupportPlugin::initialize() new ProFileCacheManager(this); JsExpander::registerGlobalObject<CodeGenerator>("QtSupport"); - ProjectExplorer::JsonWizardFactory::registerPageFactory(new TranslationWizardPageFactory); BuildPropertiesSettings::showQtSettings(); diff --git a/src/plugins/squish/squishplugin.cpp b/src/plugins/squish/squishplugin.cpp index cb2da8c9e51..e86ec531662 100644 --- a/src/plugins/squish/squishplugin.cpp +++ b/src/plugins/squish/squishplugin.cpp @@ -48,6 +48,11 @@ public: ObjectsMapEditorFactory m_objectsMapEditorFactory; SquishOutputPane *m_outputPane = nullptr; SquishTools * m_squishTools = nullptr; + + SquishToolkitsPageFactory m_squishToolkitsPageFactory; + SquishScriptLanguagePageFactory m_squishScriptLanguagePageFactory; + SquishAUTPageFactory m_squishAUTPageFactory; + SquishGeneratorFactory m_squishGeneratorFactory; }; static SquishPluginPrivate *dd = nullptr; @@ -59,11 +64,6 @@ SquishPluginPrivate::SquishPluginPrivate() m_outputPane = SquishOutputPane::instance(); m_squishTools = new SquishTools; initializeMenuEntries(); - - ProjectExplorer::JsonWizardFactory::registerPageFactory(new SquishToolkitsPageFactory); - ProjectExplorer::JsonWizardFactory::registerPageFactory(new SquishScriptLanguagePageFactory); - ProjectExplorer::JsonWizardFactory::registerPageFactory(new SquishAUTPageFactory); - ProjectExplorer::JsonWizardFactory::registerGeneratorFactory(new SquishGeneratorFactory); } SquishPluginPrivate::~SquishPluginPrivate() diff --git a/src/plugins/vcsbase/vcsplugin.cpp b/src/plugins/vcsbase/vcsplugin.cpp index 62619b18d86..ee6461e603f 100644 --- a/src/plugins/vcsbase/vcsplugin.cpp +++ b/src/plugins/vcsbase/vcsplugin.cpp @@ -72,6 +72,9 @@ public: VcsPlugin *q; QStandardItemModel *m_nickNameModel = nullptr; + + VcsConfigurationPageFactory m_vcsConfigurationPageFactory; + VcsCommandPageFactory m_vcsCommandPageFactory; }; static VcsPlugin *m_instance = nullptr; @@ -100,9 +103,6 @@ void VcsPlugin::initialize() return result; }); - JsonWizardFactory::registerPageFactory(new Internal::VcsConfigurationPageFactory); - JsonWizardFactory::registerPageFactory(new Internal::VcsCommandPageFactory); - JsExpander::registerGlobalObject<VcsJsExtension>("Vcs"); MacroExpander *expander = globalMacroExpander(); From fa53cc1c7cdd984297dd7e67df362d179d663c90 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 11:20:51 +0200 Subject: [PATCH 0797/1777] Squish: Streamline plugin setup Change-Id: I661587f26e1f90ddd55ea109be53194831745659 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/squish/CMakeLists.txt | 2 +- src/plugins/squish/squish.qbs | 1 - src/plugins/squish/squishplugin.cpp | 68 +++++++++++++---------------- src/plugins/squish/squishplugin.h | 25 ----------- 4 files changed, 32 insertions(+), 64 deletions(-) delete mode 100644 src/plugins/squish/squishplugin.h diff --git a/src/plugins/squish/CMakeLists.txt b/src/plugins/squish/CMakeLists.txt index 476a4af2366..11b41a5a2c8 100644 --- a/src/plugins/squish/CMakeLists.txt +++ b/src/plugins/squish/CMakeLists.txt @@ -18,7 +18,7 @@ add_qtc_plugin(Squish squishnavigationwidget.cpp squishnavigationwidget.h squishoutputpane.cpp squishoutputpane.h squishperspective.cpp squishperspective.h - squishplugin.cpp squishplugin.h + squishplugin.cpp squishprocessbase.cpp squishprocessbase.h squishresultmodel.cpp squishresultmodel.h squishrunnerprocess.cpp squishrunnerprocess.h diff --git a/src/plugins/squish/squish.qbs b/src/plugins/squish/squish.qbs index 29dd1da4042..4b012b05123 100644 --- a/src/plugins/squish/squish.qbs +++ b/src/plugins/squish/squish.qbs @@ -44,7 +44,6 @@ QtcPlugin { "squishperspective.cpp", "squishperspective.h", "squishplugin.cpp", - "squishplugin.h", "squishplugin_global.h", "squishprocessbase.cpp", "squishprocessbase.h", diff --git a/src/plugins/squish/squishplugin.cpp b/src/plugins/squish/squishplugin.cpp index e86ec531662..67b21f36e33 100644 --- a/src/plugins/squish/squishplugin.cpp +++ b/src/plugins/squish/squishplugin.cpp @@ -1,8 +1,6 @@ // Copyright (C) 2022 The Qt Company Ltd // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "squishplugin.h" - #include "objectsmapeditor.h" #include "squishfilehandler.h" #include "squishmessages.h" @@ -20,6 +18,7 @@ #include <coreplugin/icore.h> #include <extensionsystem/pluginmanager.h> +#include <extensionsystem/iplugin.h> #include <projectexplorer/jsonwizard/jsonwizardfactory.h> @@ -31,10 +30,9 @@ using namespace Core; using namespace Utils; -namespace Squish { -namespace Internal { +namespace Squish::Internal { -class SquishPluginPrivate : public QObject +class SquishPluginPrivate final : public QObject { public: SquishPluginPrivate(); @@ -47,7 +45,7 @@ public: SquishNavigationWidgetFactory m_navigationWidgetFactory; ObjectsMapEditorFactory m_objectsMapEditorFactory; SquishOutputPane *m_outputPane = nullptr; - SquishTools * m_squishTools = nullptr; + SquishTools m_squishTools; SquishToolkitsPageFactory m_squishToolkitsPageFactory; SquishScriptLanguagePageFactory m_squishScriptLanguagePageFactory; @@ -55,27 +53,17 @@ public: SquishGeneratorFactory m_squishGeneratorFactory; }; -static SquishPluginPrivate *dd = nullptr; - SquishPluginPrivate::SquishPluginPrivate() { qRegisterMetaType<SquishResultItem*>("SquishResultItem*"); m_outputPane = SquishOutputPane::instance(); - m_squishTools = new SquishTools; initializeMenuEntries(); } SquishPluginPrivate::~SquishPluginPrivate() { delete m_outputPane; - delete m_squishTools; -} - -SquishPlugin::~SquishPlugin() -{ - delete dd; - dd = nullptr; } void SquishPluginPrivate::initializeMenuEntries() @@ -106,7 +94,6 @@ void SquishPluginPrivate::initializeMenuEntries() bool SquishPluginPrivate::initializeGlobalScripts() { - QTC_ASSERT(dd->m_squishTools, return false); SquishFileHandler::instance()->setSharedFolders({}); const FilePath squishserver = settings().squishPath().pathAppended( @@ -114,7 +101,7 @@ bool SquishPluginPrivate::initializeGlobalScripts() if (!squishserver.isExecutableFile()) return false; - dd->m_squishTools->queryGlobalScripts([](const QString &output, const QString &error) { + m_squishTools.queryGlobalScripts([](const QString &output, const QString &error) { if (output.isEmpty() || !error.isEmpty()) return; // ignore (for now?) @@ -126,31 +113,38 @@ bool SquishPluginPrivate::initializeGlobalScripts() return true; } -void SquishPlugin::initialize() +class SquishPlugin final : public ExtensionSystem::IPlugin { - dd = new SquishPluginPrivate; - ProjectExplorer::JsonWizardFactory::addWizardPath(":/squish/wizard/"); -} + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Squish.json") -bool SquishPlugin::delayedInitialize() -{ - connect(&settings().squishPath, &BaseAspect::changed, - dd, &SquishPluginPrivate::initializeGlobalScripts); +private: + void initialize() final + { + d.reset(new SquishPluginPrivate); + ProjectExplorer::JsonWizardFactory::addWizardPath(":/squish/wizard/"); + } - return dd->initializeGlobalScripts(); -} + bool delayedInitialize() final + { + connect(&settings().squishPath, &BaseAspect::changed, + d.get(), &SquishPluginPrivate::initializeGlobalScripts); -ExtensionSystem::IPlugin::ShutdownFlag SquishPlugin::aboutToShutdown() -{ - if (dd->m_squishTools) { - if (dd->m_squishTools->shutdown()) + return d->initializeGlobalScripts(); + } + + ShutdownFlag aboutToShutdown() final + { + if (d->m_squishTools.shutdown()) return SynchronousShutdown; - connect(dd->m_squishTools, &SquishTools::shutdownFinished, + connect(&d->m_squishTools, &SquishTools::shutdownFinished, this, &ExtensionSystem::IPlugin::asynchronousShutdownFinished); return AsynchronousShutdown; } - return SynchronousShutdown; -} -} // namespace Internal -} // namespace Squish + std::unique_ptr<SquishPluginPrivate> d; +}; + +} // Squish::Internal + +#include "squishplugin.moc" diff --git a/src/plugins/squish/squishplugin.h b/src/plugins/squish/squishplugin.h deleted file mode 100644 index c27a24bcd57..00000000000 --- a/src/plugins/squish/squishplugin.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2022 The Qt Company Ltd -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <extensionsystem/iplugin.h> - -namespace Squish { -namespace Internal { - -class SquishPlugin : public ExtensionSystem::IPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Squish.json") -public: - SquishPlugin() = default; - ~SquishPlugin() override; - - void initialize() override; - bool delayedInitialize() override; - ShutdownFlag aboutToShutdown() override; -}; - -} // namespace Internal -} // namespace Squish From c8d29522d725542071143718e81a90fe8dea09af Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 11:40:07 +0200 Subject: [PATCH 0798/1777] Squish: De-Q_OBJECT-ify SquishOutputPane Also, streamline surrounding code a bit. Change-Id: I884a3af78c7565efc64b8369fbde07b2cfdb572e Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/squish/squishoutputpane.cpp | 15 +++++---------- src/plugins/squish/squishoutputpane.h | 16 +++++----------- src/plugins/squish/squishplugin.cpp | 15 +-------------- 3 files changed, 11 insertions(+), 35 deletions(-) diff --git a/src/plugins/squish/squishoutputpane.cpp b/src/plugins/squish/squishoutputpane.cpp index da0c8792c45..33b86794e7a 100644 --- a/src/plugins/squish/squishoutputpane.cpp +++ b/src/plugins/squish/squishoutputpane.cpp @@ -16,22 +16,20 @@ #include <QVBoxLayout> #include <coreplugin/editormanager/editormanager.h> -#include <coreplugin/icontext.h> #include <utils/itemviews.h> #include <utils/stylehelper.h> #include <utils/theme/theme.h> #include <utils/utilsicons.h> -namespace Squish { -namespace Internal { +namespace Squish::Internal { static SquishOutputPane *m_instance = nullptr; -SquishOutputPane::SquishOutputPane(QObject *parent) - : Core::IOutputPane(parent) - , m_context(new Core::IContext(this)) +SquishOutputPane::SquishOutputPane() { + m_instance = this; + m_outputPane = new QTabWidget; m_outputPane->setDocumentMode(true); @@ -99,8 +97,6 @@ SquishOutputPane::SquishOutputPane(QObject *parent) SquishOutputPane *SquishOutputPane::instance() { - if (!m_instance) - m_instance = new SquishOutputPane; return m_instance; } @@ -395,5 +391,4 @@ void SquishOutputPane::enableAllFiltersTriggered() m_filterModel->enableAllResultTypes(); } -} // namespace Internal -} // namespace Squish +} // namespace Squish::Internal diff --git a/src/plugins/squish/squishoutputpane.h b/src/plugins/squish/squishoutputpane.h index 6f7b60f21f6..eac2ab1b614 100644 --- a/src/plugins/squish/squishoutputpane.h +++ b/src/plugins/squish/squishoutputpane.h @@ -16,22 +16,20 @@ class QTabWidget; class QToolButton; QT_END_NAMESPACE -namespace Core { class IContext; } - namespace Utils { class TreeView; } -namespace Squish { -namespace Internal { +namespace Squish::Internal { class TestResult; class SquishResultItem; class SquishResultModel; class SquishResultFilterModel; -class SquishOutputPane : public Core::IOutputPane +class SquishOutputPane final : public Core::IOutputPane { - Q_OBJECT public: + SquishOutputPane(); + static SquishOutputPane *instance(); // IOutputPane interface @@ -50,14 +48,12 @@ public: void goToNext() override; void goToPrev() override; -public slots: void addResultItem(SquishResultItem *item); void addLogOutput(const QString &output); void onTestRunFinished(); void clearOldResults(); private: - SquishOutputPane(QObject *parent = nullptr); void createToolButtons(); void initializeFilterMenu(); void onItemActivated(const QModelIndex &idx); @@ -67,7 +63,6 @@ private: void updateSummaryLabel(); QTabWidget *m_outputPane; - Core::IContext *m_context; QWidget *m_outputWidget; QFrame *m_summaryWidget; QLabel *m_summaryLabel; @@ -81,5 +76,4 @@ private: QMenu *m_filterMenu; }; -} // namespace Internal -} // namespace Squish +} // namespace Squish::Internal diff --git a/src/plugins/squish/squishplugin.cpp b/src/plugins/squish/squishplugin.cpp index 67b21f36e33..2e49410f7e3 100644 --- a/src/plugins/squish/squishplugin.cpp +++ b/src/plugins/squish/squishplugin.cpp @@ -36,15 +36,13 @@ class SquishPluginPrivate final : public QObject { public: SquishPluginPrivate(); - ~SquishPluginPrivate(); - void initializeMenuEntries(); bool initializeGlobalScripts(); SquishTestTreeModel m_treeModel; SquishNavigationWidgetFactory m_navigationWidgetFactory; ObjectsMapEditorFactory m_objectsMapEditorFactory; - SquishOutputPane *m_outputPane = nullptr; + SquishOutputPane m_outputPane; SquishTools m_squishTools; SquishToolkitsPageFactory m_squishToolkitsPageFactory; @@ -57,17 +55,6 @@ SquishPluginPrivate::SquishPluginPrivate() { qRegisterMetaType<SquishResultItem*>("SquishResultItem*"); - m_outputPane = SquishOutputPane::instance(); - initializeMenuEntries(); -} - -SquishPluginPrivate::~SquishPluginPrivate() -{ - delete m_outputPane; -} - -void SquishPluginPrivate::initializeMenuEntries() -{ ActionContainer *menu = ActionManager::createMenu("Squish.Menu"); menu->menu()->setTitle(Tr::tr("&Squish")); menu->setOnAllDisabledBehavior(ActionContainer::Show); From 1ed27cc2eb00b07f59bff097271c6cf271b4c54c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 18 Aug 2023 12:52:00 +0200 Subject: [PATCH 0799/1777] Boot2Qt: Inline QdbDeployConfigurationFactory Change-Id: I8257126a2ed53adca5b04e04a2182381afa7390c Reviewed-by: hjk <hjk@qt.io> --- src/plugins/boot2qt/CMakeLists.txt | 1 - src/plugins/boot2qt/boot2qt.qbs | 2 - .../boot2qt/qdbdeployconfigurationfactory.cpp | 62 ------------------- .../boot2qt/qdbdeployconfigurationfactory.h | 16 ----- src/plugins/boot2qt/qdbplugin.cpp | 47 +++++++++++++- 5 files changed, 46 insertions(+), 82 deletions(-) delete mode 100644 src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp delete mode 100644 src/plugins/boot2qt/qdbdeployconfigurationfactory.h diff --git a/src/plugins/boot2qt/CMakeLists.txt b/src/plugins/boot2qt/CMakeLists.txt index ba8faecd31b..156150422b6 100644 --- a/src/plugins/boot2qt/CMakeLists.txt +++ b/src/plugins/boot2qt/CMakeLists.txt @@ -6,7 +6,6 @@ add_qtc_plugin(Boot2Qt qdb.qrc qdb_global.h qdbconstants.h - qdbdeployconfigurationfactory.cpp qdbdeployconfigurationfactory.h qdbdevice.cpp qdbdevice.h qdbdevicedebugsupport.cpp qdbdevicedebugsupport.h qdbmakedefaultappstep.cpp qdbmakedefaultappstep.h diff --git a/src/plugins/boot2qt/boot2qt.qbs b/src/plugins/boot2qt/boot2qt.qbs index ba2a5cd6dc8..6be777e17c1 100644 --- a/src/plugins/boot2qt/boot2qt.qbs +++ b/src/plugins/boot2qt/boot2qt.qbs @@ -21,8 +21,6 @@ QtcPlugin { "qdbutils.h", "qdbconstants.h", "qdb_global.h", - "qdbdeployconfigurationfactory.cpp", - "qdbdeployconfigurationfactory.h", "qdbdevice.cpp", "qdbdevice.h", "qdbdevicedebugsupport.cpp", diff --git a/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp b/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp deleted file mode 100644 index b5a58792985..00000000000 --- a/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2019 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "qdbdeployconfigurationfactory.h" - -#include "qdbconstants.h" -#include "qdbtr.h" - -#include <projectexplorer/deploymentdataview.h> -#include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitaspects.h> -#include <projectexplorer/project.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/target.h> - -#include <remotelinux/remotelinux_constants.h> - -using namespace ProjectExplorer; - -namespace Qdb::Internal { - -QdbDeployConfigurationFactory::QdbDeployConfigurationFactory() -{ - setConfigBaseId(Constants::QdbDeployConfigurationId); - addSupportedTargetDeviceType(Constants::QdbLinuxOsType); - setDefaultDisplayName(Tr::tr("Deploy to Boot2Qt target")); - setUseDeploymentDataView(); - - addInitialStep(RemoteLinux::Constants::MakeInstallStepId, [](Target *target) { - const Project * const prj = target->project(); - return prj->deploymentKnowledge() == DeploymentKnowledge::Bad - && prj->hasMakeInstallEquivalent(); - }); - addInitialStep(Qdb::Constants::QdbStopApplicationStepId); - addInitialStep(RemoteLinux::Constants::RsyncDeployStepId, [](Target *target) { - auto device = DeviceKitAspect::device(target->kit()); - auto buildDevice = BuildDeviceKitAspect::device(target->kit()); - if (buildDevice && buildDevice->rootPath().needsDevice()) - return false; - return !device - || (device && device->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool()); - }); - addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) { - auto device = DeviceKitAspect::device(target->kit()); - auto buildDevice = BuildDeviceKitAspect::device(target->kit()); - if (buildDevice && buildDevice->rootPath().needsDevice()) - return false; - return device && !device->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool(); - }); - // This step is for: - // a) A remote build device, as they do not support real rsync yet. - // b) If there is no target device setup yet. - addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) { - auto device = DeviceKitAspect::device(target->kit()); - auto buildDevice = BuildDeviceKitAspect::device(target->kit()); - if (buildDevice && buildDevice->rootPath().needsDevice()) - return true; - return false; - }); -} - -} // Qdb::Internal diff --git a/src/plugins/boot2qt/qdbdeployconfigurationfactory.h b/src/plugins/boot2qt/qdbdeployconfigurationfactory.h deleted file mode 100644 index fa006613979..00000000000 --- a/src/plugins/boot2qt/qdbdeployconfigurationfactory.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2019 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <projectexplorer/deployconfiguration.h> - -namespace Qdb::Internal { - -class QdbDeployConfigurationFactory final : public ProjectExplorer::DeployConfigurationFactory -{ -public: - QdbDeployConfigurationFactory(); -}; - -} // Qdb::Internal diff --git a/src/plugins/boot2qt/qdbplugin.cpp b/src/plugins/boot2qt/qdbplugin.cpp index 4d0eef65acf..6557be0db66 100644 --- a/src/plugins/boot2qt/qdbplugin.cpp +++ b/src/plugins/boot2qt/qdbplugin.cpp @@ -5,7 +5,6 @@ #include "device-detection/devicedetector.h" #include "qdbconstants.h" -#include "qdbdeployconfigurationfactory.h" #include "qdbdevice.h" #include "qdbstopapplicationstep.h" #include "qdbmakedefaultappstep.h" @@ -19,9 +18,11 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/icore.h> +#include <projectexplorer/deployconfiguration.h> #include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> +#include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> @@ -107,6 +108,50 @@ public: } }; +class QdbDeployConfigurationFactory final : public DeployConfigurationFactory +{ +public: + QdbDeployConfigurationFactory() + { + setConfigBaseId(Constants::QdbDeployConfigurationId); + addSupportedTargetDeviceType(Constants::QdbLinuxOsType); + setDefaultDisplayName(Tr::tr("Deploy to Boot2Qt target")); + setUseDeploymentDataView(); + + addInitialStep(RemoteLinux::Constants::MakeInstallStepId, [](Target *target) { + const Project * const prj = target->project(); + return prj->deploymentKnowledge() == DeploymentKnowledge::Bad + && prj->hasMakeInstallEquivalent(); + }); + addInitialStep(Qdb::Constants::QdbStopApplicationStepId); + addInitialStep(RemoteLinux::Constants::RsyncDeployStepId, [](Target *target) { + auto device = DeviceKitAspect::device(target->kit()); + auto buildDevice = BuildDeviceKitAspect::device(target->kit()); + if (buildDevice && buildDevice->rootPath().needsDevice()) + return false; + return !device || (device + && device->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool()); + }); + addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) { + auto device = DeviceKitAspect::device(target->kit()); + auto buildDevice = BuildDeviceKitAspect::device(target->kit()); + if (buildDevice && buildDevice->rootPath().needsDevice()) + return false; + return device && !device->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool(); + }); + // This step is for: + // a) A remote build device, as they do not support real rsync yet. + // b) If there is no target device setup yet. + addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) { + auto device = DeviceKitAspect::device(target->kit()); + auto buildDevice = BuildDeviceKitAspect::device(target->kit()); + if (buildDevice && buildDevice->rootPath().needsDevice()) + return true; + return false; + }); + } +}; + class QdbPluginPrivate : public QObject { public: From f62575fd5db13a2a56087381c3d813ff91d6af5e Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 18 Aug 2023 12:59:14 +0200 Subject: [PATCH 0800/1777] RemoteLinux: Inline RemoteLinuxDeployConfigurationFactory Change-Id: I0459981d46561c63b0c4895c37e82b3bc5363777 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/remotelinux/CMakeLists.txt | 1 - src/plugins/remotelinux/remotelinux.qbs | 2 - .../remotelinuxdeployconfiguration.cpp | 47 ------------------- .../remotelinuxdeployconfiguration.h | 16 ------- src/plugins/remotelinux/remotelinuxplugin.cpp | 36 +++++++++++++- 5 files changed, 34 insertions(+), 68 deletions(-) delete mode 100644 src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp delete mode 100644 src/plugins/remotelinux/remotelinuxdeployconfiguration.h diff --git a/src/plugins/remotelinux/CMakeLists.txt b/src/plugins/remotelinux/CMakeLists.txt index 3b2133b85a5..b13dac3f7ed 100644 --- a/src/plugins/remotelinux/CMakeLists.txt +++ b/src/plugins/remotelinux/CMakeLists.txt @@ -18,7 +18,6 @@ add_qtc_plugin(RemoteLinux remotelinux_export.h remotelinuxcustomrunconfiguration.cpp remotelinuxcustomrunconfiguration.h remotelinuxdebugsupport.cpp remotelinuxdebugsupport.h - remotelinuxdeployconfiguration.cpp remotelinuxdeployconfiguration.h remotelinuxenvironmentaspect.cpp remotelinuxenvironmentaspect.h remotelinuxplugin.cpp remotelinuxplugin.h remotelinuxrunconfiguration.cpp remotelinuxrunconfiguration.h diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs index 3bf972697b2..519020b3f79 100644 --- a/src/plugins/remotelinux/remotelinux.qbs +++ b/src/plugins/remotelinux/remotelinux.qbs @@ -41,8 +41,6 @@ Project { "remotelinuxcustomrunconfiguration.h", "remotelinuxdebugsupport.cpp", "remotelinuxdebugsupport.h", - "remotelinuxdeployconfiguration.cpp", - "remotelinuxdeployconfiguration.h", "remotelinuxenvironmentaspect.cpp", "remotelinuxenvironmentaspect.h", "remotelinuxplugin.cpp", diff --git a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp deleted file mode 100644 index 537ca8ebe44..00000000000 --- a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "remotelinuxdeployconfiguration.h" - -#include "remotelinux_constants.h" -#include "remotelinuxtr.h" - -#include <projectexplorer/devicesupport/filetransferinterface.h> -#include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitaspects.h> -#include <projectexplorer/project.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/target.h> - -using namespace ProjectExplorer; - -namespace RemoteLinux::Internal { - -RemoteLinuxDeployConfigurationFactory::RemoteLinuxDeployConfigurationFactory() -{ - setConfigBaseId(RemoteLinux::Constants::DeployToGenericLinux); - addSupportedTargetDeviceType(RemoteLinux::Constants::GenericLinuxOsType); - setDefaultDisplayName(Tr::tr("Deploy to Remote Linux Host")); - setUseDeploymentDataView(); - - const auto needsMakeInstall = [](Target *target) - { - const Project * const prj = target->project(); - return prj->deploymentKnowledge() == DeploymentKnowledge::Bad - && prj->hasMakeInstallEquivalent(); - }; - setPostRestore([needsMakeInstall](DeployConfiguration *dc, const QVariantMap &map) { - // 4.9 -> 4.10. See QTCREATORBUG-22689. - if (map.value("_checkMakeInstall").toBool() && needsMakeInstall(dc->target())) { - dc->stepList()->insertStep(0, Constants::MakeInstallStepId); - } - }); - - addInitialStep(Constants::MakeInstallStepId, needsMakeInstall); - addInitialStep(Constants::KillAppStepId); - - // TODO: Rename RsyncDeployStep to something more generic. - addInitialStep(Constants::RsyncDeployStepId); -} - -} // RemoteLinux::Internal diff --git a/src/plugins/remotelinux/remotelinuxdeployconfiguration.h b/src/plugins/remotelinux/remotelinuxdeployconfiguration.h deleted file mode 100644 index 61959122b2c..00000000000 --- a/src/plugins/remotelinux/remotelinuxdeployconfiguration.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <projectexplorer/deployconfiguration.h> - -namespace RemoteLinux::Internal { - -class RemoteLinuxDeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory -{ -public: - RemoteLinuxDeployConfigurationFactory(); -}; - -} // RemoteLinux::Internal diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index 2cb96de7405..734c17408e9 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -9,11 +9,10 @@ #include "linuxdevice.h" #include "makeinstallstep.h" #include "remotelinux_constants.h" -#include "remotelinuxdeployconfiguration.h" #include "remotelinuxcustomrunconfiguration.h" #include "remotelinuxdebugsupport.h" -#include "remotelinuxdeployconfiguration.h" #include "remotelinuxrunconfiguration.h" +#include "remotelinuxtr.h" #include "rsyncdeploystep.h" #include "tarpackagecreationstep.h" #include "tarpackagedeploystep.h" @@ -22,7 +21,9 @@ #include "filesystemaccess_test.h" #endif +#include <projectexplorer/deployconfiguration.h> #include <projectexplorer/kitaspects.h> +#include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> @@ -45,6 +46,37 @@ public: } }; +class RemoteLinuxDeployConfigurationFactory : public DeployConfigurationFactory +{ +public: + RemoteLinuxDeployConfigurationFactory() + { + setConfigBaseId(RemoteLinux::Constants::DeployToGenericLinux); + addSupportedTargetDeviceType(RemoteLinux::Constants::GenericLinuxOsType); + setDefaultDisplayName(Tr::tr("Deploy to Remote Linux Host")); + setUseDeploymentDataView(); + + const auto needsMakeInstall = [](Target *target) + { + const Project * const prj = target->project(); + return prj->deploymentKnowledge() == DeploymentKnowledge::Bad + && prj->hasMakeInstallEquivalent(); + }; + setPostRestore([needsMakeInstall](DeployConfiguration *dc, const QVariantMap &map) { + // 4.9 -> 4.10. See QTCREATORBUG-22689. + if (map.value("_checkMakeInstall").toBool() && needsMakeInstall(dc->target())) { + dc->stepList()->insertStep(0, Constants::MakeInstallStepId); + } + }); + + addInitialStep(Constants::MakeInstallStepId, needsMakeInstall); + addInitialStep(Constants::KillAppStepId); + + // TODO: Rename RsyncDeployStep to something more generic. + addInitialStep(Constants::RsyncDeployStepId); + } +}; + class RemoteLinuxPluginPrivate { public: From 00fea961f3a4183db56e5a0018780d57961556ab Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 18 Aug 2023 13:03:50 +0200 Subject: [PATCH 0801/1777] ProjectExplorer: Inline DefaultDeployConfigurationFactory Change-Id: I03750e35b99ad42945312a3eb586016677a43428 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/deployconfiguration.cpp | 12 ------------ src/plugins/projectexplorer/deployconfiguration.h | 6 ------ src/plugins/projectexplorer/projectexplorer.cpp | 12 ++++++++++++ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp index 03761502d6e..3b267b59bb0 100644 --- a/src/plugins/projectexplorer/deployconfiguration.cpp +++ b/src/plugins/projectexplorer/deployconfiguration.cpp @@ -245,16 +245,4 @@ void DeployConfigurationFactory::addInitialStep(Utils::Id stepId, const std::fun m_initialSteps.append({stepId, condition}); } -/// -// DefaultDeployConfigurationFactory -/// - -DefaultDeployConfigurationFactory::DefaultDeployConfigurationFactory() -{ - setConfigBaseId("ProjectExplorer.DefaultDeployConfiguration"); - addSupportedTargetDeviceType(Constants::DESKTOP_DEVICE_TYPE); - //: Display name of the default deploy configuration - setDefaultDisplayName(Tr::tr("Deploy Configuration")); -} - } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/deployconfiguration.h b/src/plugins/projectexplorer/deployconfiguration.h index 9e0b40865c4..48f07d90906 100644 --- a/src/plugins/projectexplorer/deployconfiguration.h +++ b/src/plugins/projectexplorer/deployconfiguration.h @@ -100,10 +100,4 @@ private: PostRestore m_postRestore; }; -class DefaultDeployConfigurationFactory : public DeployConfigurationFactory -{ -public: - DefaultDeployConfigurationFactory(); -}; - } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 2f2a9644532..063196c65fd 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -426,6 +426,18 @@ private: Core::LocatorMatcherTasks matchers() final; }; +class DefaultDeployConfigurationFactory final : public DeployConfigurationFactory +{ +public: + DefaultDeployConfigurationFactory() + { + setConfigBaseId("ProjectExplorer.DefaultDeployConfiguration"); + addSupportedTargetDeviceType(Constants::DESKTOP_DEVICE_TYPE); + //: Display name of the default deploy configuration + setDefaultDisplayName(Tr::tr("Deploy Configuration")); + } +}; + class ProjectExplorerPluginPrivate : public QObject { public: From 2f344873002bac09ccec39023f2209237a6db1d0 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 11:56:25 +0200 Subject: [PATCH 0802/1777] Squish: Replace uses of HostOsInfo::withExecutableSuffix ... with FilePath::withExecutable suffix. This is no real change as long as the paths are local but better in the theoretical case of remote setups. Change-Id: I47e922b4488575ec7802d1794d8eb9a9e2e8ccaf Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/squish/squishplugin.cpp | 4 ++-- src/plugins/squish/squishtools.cpp | 13 ++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/plugins/squish/squishplugin.cpp b/src/plugins/squish/squishplugin.cpp index 2e49410f7e3..7ed6a8c7290 100644 --- a/src/plugins/squish/squishplugin.cpp +++ b/src/plugins/squish/squishplugin.cpp @@ -83,8 +83,8 @@ bool SquishPluginPrivate::initializeGlobalScripts() { SquishFileHandler::instance()->setSharedFolders({}); - const FilePath squishserver = settings().squishPath().pathAppended( - HostOsInfo::withExecutableSuffix("bin/squishserver")); + const FilePath squishserver = settings().squishPath().pathAppended("bin/squishserver") + .withExecutableSuffix(); if (!squishserver.isExecutableFile()) return false; diff --git a/src/plugins/squish/squishtools.cpp b/src/plugins/squish/squishtools.cpp index 9ee9a18cbec..9c3b074189c 100644 --- a/src/plugins/squish/squishtools.cpp +++ b/src/plugins/squish/squishtools.cpp @@ -20,14 +20,12 @@ #include <texteditor/textmark.h> #include <utils/algorithm.h> -#include <utils/hostosinfo.h> #include <utils/qtcassert.h> #include <utils/temporaryfile.h> #include <utils/utilsicons.h> #include <QApplication> #include <QDateTime> -#include <QDir> #include <QFile> #include <QFileSystemWatcher> #include <QLoggingCategory> @@ -169,13 +167,10 @@ struct SquishToolsSettings squishPath = settings().squishPath(); if (!squishPath.isEmpty()) { - const FilePath squishBin(squishPath.pathAppended("bin")); - serverPath = squishBin.pathAppended( - HostOsInfo::withExecutableSuffix("squishserver")).absoluteFilePath(); - runnerPath = squishBin.pathAppended( - HostOsInfo::withExecutableSuffix("squishrunner")).absoluteFilePath(); - processComPath = squishBin.pathAppended( - HostOsInfo::withExecutableSuffix("processcomm")).absoluteFilePath(); + const FilePath squishBin = squishPath.pathAppended("bin").absoluteFilePath(); + serverPath = squishBin.pathAppended("squishserver").withExecutableSuffix(); + runnerPath = squishBin.pathAppended("squishrunner").withExecutableSuffix(); + processComPath = squishBin.pathAppended("processcomm").withExecutableSuffix(); } isLocalServer = settings().local(); From 60bdb55fe5df91ebcf138333e9bdecb6e797f2a9 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 18 Aug 2023 14:12:19 +0200 Subject: [PATCH 0803/1777] ProjectExplorer: Replace some KitManager::onLoaded() connections ... by direct calls. More direct, and less use of QObject-ness of the KitAspectFactories. Change-Id: I7487875d95752b681475248ca0e5494d640e064e Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/kitaspects.cpp | 46 ++++++++-------------- src/plugins/projectexplorer/kitmanager.cpp | 9 +++++ src/plugins/projectexplorer/kitmanager.h | 2 + src/plugins/qtsupport/qtkitaspect.cpp | 5 +-- src/plugins/qtsupport/qtkitaspect.h | 4 +- 5 files changed, 30 insertions(+), 36 deletions(-) diff --git a/src/plugins/projectexplorer/kitaspects.cpp b/src/plugins/projectexplorer/kitaspects.cpp index c7fe79debc4..f1f3365499e 100644 --- a/src/plugins/projectexplorer/kitaspects.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -330,6 +330,7 @@ class ToolChainKitAspectFactory : public KitAspectFactory public: ToolChainKitAspectFactory(); +private: Tasks validate(const Kit *k) const override; void upgrade(Kit *k) override; void fix(Kit *k) override; @@ -348,8 +349,8 @@ public: QList<OutputLineParser *> createOutputParsers(const Kit *k) const override; QSet<Id> availableFeatures(const Kit *k) const override; -private: - void kitsWereLoaded(); + void onKitsLoaded() override; + void toolChainUpdated(ToolChain *tc); void toolChainRemoved(ToolChain *tc); }; @@ -363,9 +364,6 @@ ToolChainKitAspectFactory::ToolChainKitAspectFactory() "Make sure the compiler will produce binaries compatible " "with the target device, Qt version and other libraries used.")); setPriority(30000); - - connect(KitManager::instance(), &KitManager::kitsLoaded, - this, &ToolChainKitAspectFactory::kitsWereLoaded); } // language id -> tool chain id @@ -765,10 +763,9 @@ QString ToolChainKitAspect::msgNoToolChainInTarget() return Tr::tr("No compiler set in kit."); } -void ToolChainKitAspectFactory::kitsWereLoaded() +void ToolChainKitAspectFactory::onKitsLoaded() { - const QList<Kit *> kits = KitManager::kits(); - for (Kit *k : kits) + for (Kit *k : KitManager::kits()) fix(k); connect(ToolChainManager::instance(), &ToolChainManager::toolChainRemoved, @@ -788,8 +785,7 @@ void ToolChainKitAspectFactory::toolChainUpdated(ToolChain *tc) void ToolChainKitAspectFactory::toolChainRemoved(ToolChain *tc) { Q_UNUSED(tc) - const QList<Kit *> kits = KitManager::kits(); - for (Kit *k : kits) + for (Kit *k : KitManager::kits()) fix(k); } @@ -1013,6 +1009,7 @@ class DeviceKitAspectFactory : public KitAspectFactory public: DeviceKitAspectFactory(); +private: Tasks validate(const Kit *k) const override; void fix(Kit *k) override; void setup(Kit *k) override; @@ -1025,10 +1022,9 @@ public: void addToMacroExpander(Kit *kit, MacroExpander *expander) const override; -private: QVariant defaultValue(const Kit *k) const; - void kitsWereLoaded(); + void onKitsLoaded() override; void deviceUpdated(Id dataId); void devicesChanged(); void kitUpdated(Kit *k); @@ -1041,9 +1037,6 @@ DeviceKitAspectFactory::DeviceKitAspectFactory() setDisplayName(Tr::tr("Run device")); setDescription(Tr::tr("The device to run the applications on.")); setPriority(32000); - - connect(KitManager::instance(), &KitManager::kitsLoaded, - this, &DeviceKitAspectFactory::kitsWereLoaded); } QVariant DeviceKitAspectFactory::defaultValue(const Kit *k) const @@ -1179,10 +1172,9 @@ FilePath DeviceKitAspect::deviceFilePath(const Kit *k, const QString &pathOnDevi return FilePath::fromString(pathOnDevice); } -void DeviceKitAspectFactory::kitsWereLoaded() +void DeviceKitAspectFactory::onKitsLoaded() { - const QList<Kit *> kits = KitManager::kits(); - for (Kit *k : kits) + for (Kit *k : KitManager::kits()) fix(k); DeviceManager *dm = DeviceManager::instance(); @@ -1199,8 +1191,7 @@ void DeviceKitAspectFactory::kitsWereLoaded() void DeviceKitAspectFactory::deviceUpdated(Id id) { - const QList<Kit *> kits = KitManager::kits(); - for (Kit *k : kits) { + for (Kit *k : KitManager::kits()) { if (DeviceKitAspect::deviceId(k) == id) notifyAboutUpdate(k); } @@ -1213,8 +1204,7 @@ void DeviceKitAspectFactory::kitUpdated(Kit *k) void DeviceKitAspectFactory::devicesChanged() { - const QList<Kit *> kits = KitManager::kits(); - for (Kit *k : kits) + for (Kit *k : KitManager::kits()) setup(k); // Set default device if necessary } @@ -1310,6 +1300,7 @@ class BuildDeviceKitAspectFactory : public KitAspectFactory public: BuildDeviceKitAspectFactory(); +private: void setup(Kit *k) override; Tasks validate(const Kit *k) const override; @@ -1321,8 +1312,7 @@ public: void addToMacroExpander(Kit *kit, MacroExpander *expander) const override; -private: - void kitsWereLoaded(); + void onKitsLoaded() override; void deviceUpdated(Id dataId); void devicesChanged(); void kitUpdated(Kit *k); @@ -1335,9 +1325,6 @@ BuildDeviceKitAspectFactory::BuildDeviceKitAspectFactory() setDisplayName(Tr::tr("Build device")); setDescription(Tr::tr("The device used to build applications on.")); setPriority(31900); - - connect(KitManager::instance(), &KitManager::kitsLoaded, - this, &BuildDeviceKitAspectFactory::kitsWereLoaded); } static IDeviceConstPtr defaultDevice() @@ -1444,10 +1431,9 @@ void BuildDeviceKitAspect::setDeviceId(Kit *k, Id id) k->setValue(BuildDeviceKitAspect::id(), id.toSetting()); } -void BuildDeviceKitAspectFactory::kitsWereLoaded() +void BuildDeviceKitAspectFactory::onKitsLoaded() { - const QList<Kit *> kits = KitManager::kits(); - for (Kit *k : kits) + for (Kit *k : KitManager::kits()) fix(k); DeviceManager *dm = DeviceManager::instance(); diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 7f7658cf4cc..a147dd7f252 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -69,6 +69,12 @@ static FilePath settingsFileName() class KitAspectFactories { public: + void onKitsLoaded() const + { + for (KitAspectFactory *factory : m_aspectList) + factory->onKitsLoaded(); + } + void addKitAspect(KitAspectFactory *factory) { QTC_ASSERT(!m_aspectList.contains(factory), return); @@ -416,6 +422,9 @@ void KitManager::restoreKits() d->m_writer = std::make_unique<PersistentSettingsWriter>(settingsFileName(), "QtCreatorProfiles"); d->m_initialized = true; + + kitAspectFactoriesStorage().onKitsLoaded(); + emit instance()->kitsLoaded(); emit instance()->kitsChanged(); } diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index bb5de22bf0f..c3774cfe79b 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -81,6 +81,8 @@ public: virtual bool isApplicableToKit(const Kit *) const { return true; } + virtual void onKitsLoaded() {} + protected: KitAspectFactory(); ~KitAspectFactory(); diff --git a/src/plugins/qtsupport/qtkitaspect.cpp b/src/plugins/qtsupport/qtkitaspect.cpp index 22ae3a0bd56..6f366844407 100644 --- a/src/plugins/qtsupport/qtkitaspect.cpp +++ b/src/plugins/qtsupport/qtkitaspect.cpp @@ -139,9 +139,6 @@ QtKitAspectFactory::QtKitAspectFactory() "A Qt version is required for qmake-based projects " "and optional when using other build systems.")); setPriority(26000); - - connect(KitManager::instance(), &KitManager::kitsLoaded, - this, &QtKitAspectFactory::kitsWereLoaded); } void QtKitAspectFactory::setup(Kit *k) @@ -399,7 +396,7 @@ void QtKitAspectFactory::qtVersionsChanged(const QList<int> &addedIds, } } -void QtKitAspectFactory::kitsWereLoaded() +void QtKitAspectFactory::onKitsLoaded() { for (Kit *k : KitManager::kits()) fix(k); diff --git a/src/plugins/qtsupport/qtkitaspect.h b/src/plugins/qtsupport/qtkitaspect.h index 723a7c71aab..16d2ea65610 100644 --- a/src/plugins/qtsupport/qtkitaspect.h +++ b/src/plugins/qtsupport/qtkitaspect.h @@ -36,6 +36,7 @@ class QTSUPPORT_EXPORT QtKitAspectFactory : public ProjectExplorer::KitAspectFac public: QtKitAspectFactory(); +private: void setup(ProjectExplorer::Kit *k) override; ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override; @@ -54,13 +55,12 @@ public: QSet<Utils::Id> supportedPlatforms(const ProjectExplorer::Kit *k) const override; QSet<Utils::Id> availableFeatures(const ProjectExplorer::Kit *k) const override; -private: int weight(const ProjectExplorer::Kit *k) const override; void qtVersionsChanged(const QList<int> &addedIds, const QList<int> &removedIds, const QList<int> &changedIds); - void kitsWereLoaded(); + void onKitsLoaded() override; }; class QTSUPPORT_EXPORT SuppliesQtQuickImportPath From 743938b6cbc9704ee47f3d1270bf3a16ef6c908a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 18 Aug 2023 14:22:32 +0200 Subject: [PATCH 0804/1777] QtSupport: Hide QtKitAspectFactory implementation Change-Id: I89da5ef766cf6db48c9180dff566359bb27e87c1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/qtsupport/qtkitaspect.cpp | 34 +++++++++++++++++++++++ src/plugins/qtsupport/qtkitaspect.h | 34 ----------------------- src/plugins/qtsupport/qtsupportplugin.cpp | 2 -- 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/src/plugins/qtsupport/qtkitaspect.cpp b/src/plugins/qtsupport/qtkitaspect.cpp index 6f366844407..e3d86efc734 100644 --- a/src/plugins/qtsupport/qtkitaspect.cpp +++ b/src/plugins/qtsupport/qtkitaspect.cpp @@ -130,6 +130,40 @@ private: }; } // namespace Internal +class QtKitAspectFactory : public KitAspectFactory +{ +public: + QtKitAspectFactory(); + +private: + void setup(Kit *k) override; + + Tasks validate(const Kit *k) const override; + void fix(Kit *) override; + + KitAspect *createKitAspect(Kit *k) const override; + + QString displayNamePostfix(const Kit *k) const override; + + ItemList toUserOutput(const Kit *k) const override; + + void addToBuildEnvironment(const Kit *k, Environment &env) const override; + QList<OutputLineParser *> createOutputParsers(const Kit *k) const override; + void addToMacroExpander(Kit *kit, MacroExpander *expander) const override; + + QSet<Id> supportedPlatforms(const Kit *k) const override; + QSet<Id> availableFeatures(const Kit *k) const override; + + int weight(const Kit *k) const override; + + void qtVersionsChanged(const QList<int> &addedIds, + const QList<int> &removedIds, + const QList<int> &changedIds); + void onKitsLoaded() override; +}; + +const QtKitAspectFactory theQtKitAspectFactory; + QtKitAspectFactory::QtKitAspectFactory() { setObjectName(QLatin1String("QtKitAspect")); diff --git a/src/plugins/qtsupport/qtkitaspect.h b/src/plugins/qtsupport/qtkitaspect.h index 16d2ea65610..387151db378 100644 --- a/src/plugins/qtsupport/qtkitaspect.h +++ b/src/plugins/qtsupport/qtkitaspect.h @@ -9,8 +9,6 @@ #include <projectexplorer/kitaspects.h> -namespace Utils { class MacroExpander; } - namespace QtSupport { class QTSUPPORT_EXPORT QtKitAspect @@ -31,38 +29,6 @@ public: const QVersionNumber &max = QVersionNumber(INT_MAX, INT_MAX, INT_MAX)); }; -class QTSUPPORT_EXPORT QtKitAspectFactory : public ProjectExplorer::KitAspectFactory -{ -public: - QtKitAspectFactory(); - -private: - void setup(ProjectExplorer::Kit *k) override; - - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override; - void fix(ProjectExplorer::Kit *) override; - - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const override; - - QString displayNamePostfix(const ProjectExplorer::Kit *k) const override; - - ItemList toUserOutput(const ProjectExplorer::Kit *k) const override; - - void addToBuildEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const override; - QList<Utils::OutputLineParser *> createOutputParsers(const ProjectExplorer::Kit *k) const override; - void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override; - - QSet<Utils::Id> supportedPlatforms(const ProjectExplorer::Kit *k) const override; - QSet<Utils::Id> availableFeatures(const ProjectExplorer::Kit *k) const override; - - int weight(const ProjectExplorer::Kit *k) const override; - - void qtVersionsChanged(const QList<int> &addedIds, - const QList<int> &removedIds, - const QList<int> &changedIds); - void onKitsLoaded() override; -}; - class QTSUPPORT_EXPORT SuppliesQtQuickImportPath { public: diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index 2851c977b76..81687eda70e 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -58,8 +58,6 @@ public: ExamplesWelcomePage examplesPage{true}; ExamplesWelcomePage tutorialPage{false}; - QtKitAspectFactory qtKitAspectFactory; - QtOutputFormatterFactory qtOutputFormatterFactory; UicGeneratorFactory uicGeneratorFactory; From 8346905a51a87bf1c42f5350856ae36a084125ba Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 18 Aug 2023 14:40:01 +0200 Subject: [PATCH 0805/1777] QtSupport: Remove unusual access pattern to plugin constants Change-Id: Ifc21607cd9927e99b5c49f1631d8940725a058fd Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 8 +++++--- src/plugins/mcusupport/mcukitmanager.cpp | 19 ++++++++++--------- src/plugins/qmljstools/qmljsmodelmanager.cpp | 2 +- src/plugins/qtsupport/qtkitaspect.cpp | 15 --------------- src/plugins/qtsupport/qtkitaspect.h | 18 ------------------ 5 files changed, 16 insertions(+), 46 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 8b2454f6905..fb856a3f0fc 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -36,9 +36,11 @@ #include <texteditor/textdocument.h> #include <qmljs/qmljsmodelmanagerinterface.h> + #include <qmljstools/qmljstoolsconstants.h> + #include <qtsupport/qtcppkitinfo.h> -#include <qtsupport/qtkitaspect.h> +#include <qtsupport/qtsupportconstants.h> #include <utils/algorithm.h> #include <utils/checkablemessagebox.h> @@ -1017,7 +1019,7 @@ void CMakeBuildSystem::updateProjectData() { const bool mergedHeaderPathsAndQmlImportPaths = kit()->value( - QtSupport::KitHasMergedHeaderPathsWithQmlImportPaths::id(), false).toBool(); + QtSupport::Constants::KIT_HAS_MERGED_HEADER_PATHS_WITH_QML_IMPORT_PATHS, false).toBool(); QStringList extraHeaderPaths; QList<QByteArray> moduleMappings; for (const RawProjectPart &rpp : std::as_const(rpps)) { @@ -1575,7 +1577,7 @@ void CMakeBuildSystem::updateQmlJSCodeModel(const QStringList &extraHeaderPaths, const CMakeConfig &cm = configurationFromCMake(); addImports(cm.stringValueOf("QML_IMPORT_PATH")); - addImports(kit()->value(QtSupport::KitQmlImportPath::id()).toString()); + addImports(kit()->value(QtSupport::Constants::KIT_QML_IMPORT_PATH).toString()); for (const QString &extraHeaderPath : extraHeaderPaths) projectInfo.importPaths.maybeInsert(FilePath::fromString(extraHeaderPath), diff --git a/src/plugins/mcusupport/mcukitmanager.cpp b/src/plugins/mcusupport/mcukitmanager.cpp index f027c3df56e..2c13da6fc13 100644 --- a/src/plugins/mcusupport/mcukitmanager.cpp +++ b/src/plugins/mcusupport/mcukitmanager.cpp @@ -26,6 +26,7 @@ #include <projectexplorer/toolchain.h> #include <qtsupport/qtkitaspect.h> +#include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtversionmanager.h> #include <utils/algorithm.h> @@ -115,15 +116,15 @@ public: k->makeSticky(); if (mcuTarget->toolChainPackage()->isDesktopToolchain()) k->setDeviceTypeForIcon(DEVICE_TYPE); - k->setValue(QtSupport::SuppliesQtQuickImportPath::id(), true); + k->setValue(QtSupport::Constants::FLAGS_SUPPLIES_QTQUICK_IMPORT_PATH, true); // FIXME: This is treated as a pathlist in CMakeBuildSystem::updateQmlJSCodeModel - k->setValue(QtSupport::KitQmlImportPath::id(), (sdkPath / "include/qul").toString()); - k->setValue(QtSupport::KitHasMergedHeaderPathsWithQmlImportPaths::id(), true); + k->setValue(QtSupport::Constants::KIT_QML_IMPORT_PATH, (sdkPath / "include/qul").toString()); + k->setValue(QtSupport::Constants::KIT_HAS_MERGED_HEADER_PATHS_WITH_QML_IMPORT_PATHS, true); QSet<Id> irrelevant = { SysRootKitAspect::id(), - QtSupport::SuppliesQtQuickImportPath::id(), - QtSupport::KitQmlImportPath::id(), - QtSupport::KitHasMergedHeaderPathsWithQmlImportPaths::id(), + QtSupport::Constants::FLAGS_SUPPLIES_QTQUICK_IMPORT_PATH, + QtSupport::Constants::KIT_QML_IMPORT_PATH, + QtSupport::Constants::KIT_HAS_MERGED_HEADER_PATHS_WITH_QML_IMPORT_PATHS, }; if (!McuSupportOptions::kitsNeedQtVersion()) irrelevant.insert(QtSupport::QtKitAspect::id()); @@ -668,7 +669,7 @@ void fixExistingKits(const SettingsHandler::Ptr &settingsHandler) // Check if the MCU kits are flagged as supplying a QtQuick import path, in order // to tell the QMLJS code-model that it won't need to add a fall-back import // path. - const auto bringsQtQuickImportPath = QtSupport::SuppliesQtQuickImportPath::id(); + const Id bringsQtQuickImportPath = QtSupport::Constants::FLAGS_SUPPLIES_QTQUICK_IMPORT_PATH; auto irrelevantAspects = kit->irrelevantAspects(); if (!irrelevantAspects.contains(bringsQtQuickImportPath)) { irrelevantAspects.insert(bringsQtQuickImportPath); @@ -679,7 +680,7 @@ void fixExistingKits(const SettingsHandler::Ptr &settingsHandler) } // Check if the MCU kit supplies its import path. - const auto kitQmlImportPath = QtSupport::KitQmlImportPath::id(); + const Id kitQmlImportPath = QtSupport::Constants::KIT_QML_IMPORT_PATH; if (!irrelevantAspects.contains(kitQmlImportPath)) { irrelevantAspects.insert(kitQmlImportPath); kit->setIrrelevantAspects(irrelevantAspects); @@ -698,7 +699,7 @@ void fixExistingKits(const SettingsHandler::Ptr &settingsHandler) } // Check if the MCU kit has the flag for merged header/qml-import paths set. - const auto mergedPaths = QtSupport::KitHasMergedHeaderPathsWithQmlImportPaths::id(); + const Id mergedPaths = QtSupport::Constants::KIT_HAS_MERGED_HEADER_PATHS_WITH_QML_IMPORT_PATHS; if (!irrelevantAspects.contains(mergedPaths)) { irrelevantAspects.insert(mergedPaths); kit->setIrrelevantAspects(irrelevantAspects); diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index 35940de60f9..7ee672c99d8 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -200,7 +200,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject( auto v = qtVersion->qtVersion(); projectInfo.qmllsPath = ModelManagerInterface::qmllsForBinPath(qtVersion->hostBinPath(), v); projectInfo.qtVersionString = qtVersion->qtVersionString(); - } else if (!activeKit || !activeKit->value(QtSupport::SuppliesQtQuickImportPath::id(), false).toBool()) { + } else if (!activeKit || !activeKit->value(QtSupport::Constants::FLAGS_SUPPLIES_QTQUICK_IMPORT_PATH, false).toBool()) { projectInfo.qtQmlPath = FilePath::fromUserInput(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath)); projectInfo.qmllsPath = ModelManagerInterface::qmllsForBinPath( FilePath::fromUserInput(QLibraryInfo::path(QLibraryInfo::BinariesPath)), QLibraryInfo::version()); diff --git a/src/plugins/qtsupport/qtkitaspect.cpp b/src/plugins/qtsupport/qtkitaspect.cpp index e3d86efc734..d2b4309d04d 100644 --- a/src/plugins/qtsupport/qtkitaspect.cpp +++ b/src/plugins/qtsupport/qtkitaspect.cpp @@ -490,19 +490,4 @@ int QtKitAspectFactory::weight(const Kit *k) const return qtAbi.isCompatibleWith(tcAbi); }) ? 1 : 0; } -Id SuppliesQtQuickImportPath::id() -{ - return QtSupport::Constants::FLAGS_SUPPLIES_QTQUICK_IMPORT_PATH; -} - -Id KitQmlImportPath::id() -{ - return QtSupport::Constants::KIT_QML_IMPORT_PATH; -} - -Id KitHasMergedHeaderPathsWithQmlImportPaths::id() -{ - return QtSupport::Constants::KIT_HAS_MERGED_HEADER_PATHS_WITH_QML_IMPORT_PATHS; -} - } // namespace QtSupport diff --git a/src/plugins/qtsupport/qtkitaspect.h b/src/plugins/qtsupport/qtkitaspect.h index 387151db378..f73be247cb2 100644 --- a/src/plugins/qtsupport/qtkitaspect.h +++ b/src/plugins/qtsupport/qtkitaspect.h @@ -29,22 +29,4 @@ public: const QVersionNumber &max = QVersionNumber(INT_MAX, INT_MAX, INT_MAX)); }; -class QTSUPPORT_EXPORT SuppliesQtQuickImportPath -{ -public: - static Utils::Id id(); -}; - -class QTSUPPORT_EXPORT KitQmlImportPath -{ -public: - static Utils::Id id(); -}; - -class QTSUPPORT_EXPORT KitHasMergedHeaderPathsWithQmlImportPaths -{ -public: - static Utils::Id id(); -}; - } // namespace QtSupport From fd0a1a19225c3d92978b9292131b80bef828280d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 18 Aug 2023 11:52:20 +0200 Subject: [PATCH 0806/1777] Core: Merge iexternaleditor.{h,cpp} into ieditorfactory.{h,cpp} Naming is still inconsistent, these should be all some kind of factories, but now is at least the 'distance' to the base class ('EditorType') the same for both siblings. Also remove unneeded #include Change-Id: I73aa0cbc2aab14605fe6a1101d388b10a9108b63 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/coreplugin/CMakeLists.txt | 2 - src/plugins/coreplugin/coreplugin.qbs | 1 - src/plugins/coreplugin/documentmanager.cpp | 1 - .../editormanager/editormanager.cpp | 5 +- .../editormanager/ieditorfactory.cpp | 55 ++++++++++++++++ .../coreplugin/editormanager/ieditorfactory.h | 16 ++++- .../editormanager/iexternaleditor.cpp | 65 ------------------- .../editormanager/iexternaleditor.h | 39 ----------- .../coreplugin/editormanager/systemeditor.h | 8 +-- src/plugins/qtsupport/externaleditors.h | 4 +- 10 files changed, 78 insertions(+), 118 deletions(-) delete mode 100644 src/plugins/coreplugin/editormanager/iexternaleditor.cpp delete mode 100644 src/plugins/coreplugin/editormanager/iexternaleditor.h diff --git a/src/plugins/coreplugin/CMakeLists.txt b/src/plugins/coreplugin/CMakeLists.txt index 10b5475e5fe..da833620f31 100644 --- a/src/plugins/coreplugin/CMakeLists.txt +++ b/src/plugins/coreplugin/CMakeLists.txt @@ -86,8 +86,6 @@ add_qtc_plugin(Core editormanager/ieditorfactory.cpp editormanager/ieditorfactory.h editormanager/ieditorfactory_p.h - editormanager/iexternaleditor.cpp - editormanager/iexternaleditor.h editormanager/openeditorsview.cpp editormanager/openeditorsview.h editormanager/openeditorswindow.cpp diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index 63fbe1520b9..000fbc22883 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -232,7 +232,6 @@ Project { "editorwindow.cpp", "editorwindow.h", "ieditor.cpp", "ieditor.h", "ieditorfactory.cpp", "ieditorfactory.h", "ieditorfactory_p.h", - "iexternaleditor.cpp", "iexternaleditor.h", "openeditorsview.cpp", "openeditorsview.h", "openeditorswindow.cpp", "openeditorswindow.h", "systemeditor.cpp", "systemeditor.h", diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index a529cb6ff98..97667be0a67 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -21,7 +21,6 @@ #include <coreplugin/editormanager/editorview.h> #include <coreplugin/editormanager/ieditor.h> #include <coreplugin/editormanager/ieditorfactory.h> -#include <coreplugin/editormanager/iexternaleditor.h> #include <coreplugin/systemsettings.h> #include <extensionsystem/pluginmanager.h> diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index fdcefe841b7..c102d75fa43 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -9,6 +9,8 @@ #include "editorview.h" #include "editorwindow.h" #include "ieditor.h" +#include "ieditorfactory.h" +#include "ieditorfactory_p.h" #include "openeditorsview.h" #include "openeditorswindow.h" #include "../actionmanager/actioncontainer.h" @@ -20,9 +22,6 @@ #include "../dialogs/readonlyfilesdialog.h" #include "../diffservice.h" #include "../documentmanager.h" -#include "../editormanager/ieditorfactory.h" -#include "../editormanager/ieditorfactory_p.h" -#include "../editormanager/iexternaleditor.h" #include "../fileutils.h" #include "../findplaceholder.h" #include "../icore.h" diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp index 87940075005..eeb7e43ae34 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp +++ b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp @@ -298,4 +298,59 @@ void Internal::setUserPreferredEditorTypes(const QHash<Utils::MimeType, EditorTy g_userPreferredEditorTypes = factories; } +/*! + \class Core::IExternalEditor + \inheaderfile coreplugin/editormanager/ieditorfactory.h + \inmodule QtCreator + \ingroup mainclasses + + \brief The IExternalEditor class enables registering an external + editor in the \uicontrol{Open With} dialog. +*/ + +/*! + \fn bool Core::IExternalEditor::startEditor(const Utils::FilePath &fileName, QString *errorMessage) + + Opens the editor with \a fileName. Returns \c true on success or \c false + on failure along with the error in \a errorMessage. +*/ + +static QList<IExternalEditor *> g_externalEditors; + +/*! + \internal +*/ +IExternalEditor::IExternalEditor() +{ + g_externalEditors.append(this); +} + +/*! + \internal +*/ +IExternalEditor::~IExternalEditor() +{ + g_externalEditors.removeOne(this); +} + +/*! + Returns all available external editors. +*/ +const ExternalEditorList IExternalEditor::allExternalEditors() +{ + return g_externalEditors; +} + +/*! + Returns all external editors available for this \a mimeType in the default + order (editors ordered by MIME type hierarchy). +*/ +const ExternalEditorList IExternalEditor::externalEditors(const Utils::MimeType &mimeType) +{ + ExternalEditorList rc; + const ExternalEditorList allEditors = IExternalEditor::allExternalEditors(); + Internal::mimeTypeFactoryLookup(mimeType, allEditors, &rc); + return rc; +} + } // Core diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.h b/src/plugins/coreplugin/editormanager/ieditorfactory.h index 670bd5b4f5d..e28694ffa0d 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory.h +++ b/src/plugins/coreplugin/editormanager/ieditorfactory.h @@ -7,7 +7,6 @@ #include <utils/id.h> -#include <QObject> #include <QStringList> #include <functional> @@ -26,6 +25,7 @@ class EditorType; using EditorFactoryList = QList<IEditorFactory *>; using EditorTypeList = QList<EditorType *>; +using ExternalEditorList = QList<IExternalEditor *>; class CORE_EXPORT EditorType { @@ -77,4 +77,18 @@ private: std::function<IEditor *()> m_creator; }; +class CORE_EXPORT IExternalEditor : public EditorType +{ +public: + explicit IExternalEditor(); + ~IExternalEditor() override; + + static const ExternalEditorList allExternalEditors(); + static const ExternalEditorList externalEditors(const Utils::MimeType &mimeType); + + IExternalEditor *asExternalEditor() override { return this; } + + virtual bool startEditor(const Utils::FilePath &filePath, QString *errorMessage) = 0; +}; + } // namespace Core diff --git a/src/plugins/coreplugin/editormanager/iexternaleditor.cpp b/src/plugins/coreplugin/editormanager/iexternaleditor.cpp deleted file mode 100644 index 8176bf4d3ee..00000000000 --- a/src/plugins/coreplugin/editormanager/iexternaleditor.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "iexternaleditor.h" - -#include "ieditorfactory_p.h" - -namespace Core { - -/*! - \class Core::IExternalEditor - \inheaderfile coreplugin/editormanager/iexternaleditor.h - \inmodule QtCreator - \ingroup mainclasses - - \brief The IExternalEditor class enables registering an external - editor in the \uicontrol{Open With} dialog. -*/ - -/*! - \fn bool Core::IExternalEditor::startEditor(const Utils::FilePath &fileName, QString *errorMessage) - - Opens the editor with \a fileName. Returns \c true on success or \c false - on failure along with the error in \a errorMessage. -*/ - -static QList<IExternalEditor *> g_externalEditors; - -/*! - \internal -*/ -IExternalEditor::IExternalEditor() -{ - g_externalEditors.append(this); -} - -/*! - \internal -*/ -IExternalEditor::~IExternalEditor() -{ - g_externalEditors.removeOne(this); -} - -/*! - Returns all available external editors. -*/ -const ExternalEditorList IExternalEditor::allExternalEditors() -{ - return g_externalEditors; -} - -/*! - Returns all external editors available for this \a mimeType in the default - order (editors ordered by MIME type hierarchy). -*/ -const ExternalEditorList IExternalEditor::externalEditors(const Utils::MimeType &mimeType) -{ - ExternalEditorList rc; - const ExternalEditorList allEditors = IExternalEditor::allExternalEditors(); - Internal::mimeTypeFactoryLookup(mimeType, allEditors, &rc); - return rc; -} - -} // Core diff --git a/src/plugins/coreplugin/editormanager/iexternaleditor.h b/src/plugins/coreplugin/editormanager/iexternaleditor.h deleted file mode 100644 index 49d0ffcfee9..00000000000 --- a/src/plugins/coreplugin/editormanager/iexternaleditor.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "ieditorfactory.h" - -#include <coreplugin/core_global.h> - -#include <utils/id.h> - -#include <QObject> - -namespace Utils { -class FilePath; -class MimeType; -} - -namespace Core { - -class IExternalEditor; - -using ExternalEditorList = QList<IExternalEditor *>; - -class CORE_EXPORT IExternalEditor : public EditorType -{ -public: - explicit IExternalEditor(); - ~IExternalEditor() override; - - static const ExternalEditorList allExternalEditors(); - static const ExternalEditorList externalEditors(const Utils::MimeType &mimeType); - - IExternalEditor *asExternalEditor() override { return this; } - - virtual bool startEditor(const Utils::FilePath &filePath, QString *errorMessage) = 0; -}; - -} // namespace Core diff --git a/src/plugins/coreplugin/editormanager/systemeditor.h b/src/plugins/coreplugin/editormanager/systemeditor.h index 96f29b8bf85..6218e63335f 100644 --- a/src/plugins/coreplugin/editormanager/systemeditor.h +++ b/src/plugins/coreplugin/editormanager/systemeditor.h @@ -3,10 +3,9 @@ #pragma once -#include "iexternaleditor.h" +#include "ieditorfactory.h" -namespace Core { -namespace Internal { +namespace Core::Internal { class SystemEditor : public IExternalEditor { @@ -16,5 +15,4 @@ public: bool startEditor(const Utils::FilePath &filePath, QString *errorMessage) override; }; -} // namespace Internal -} // namespace Core +} // namespace Core::Internal diff --git a/src/plugins/qtsupport/externaleditors.h b/src/plugins/qtsupport/externaleditors.h index 455e34a208b..1901046b658 100644 --- a/src/plugins/qtsupport/externaleditors.h +++ b/src/plugins/qtsupport/externaleditors.h @@ -3,7 +3,9 @@ #pragma once -#include <coreplugin/editormanager/iexternaleditor.h> +#include <coreplugin/editormanager/ieditorfactory.h> + +#include <QObject> namespace QtSupport::Internal { From 30a7228c5fe457df008746643e7be36a58bf10d6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 18 Aug 2023 12:30:55 +0200 Subject: [PATCH 0807/1777] Core: Move some helper template closer to it's only user The _p.h is also #included in several places. Change-Id: I96c28ab0fada32e01e555d73ec619fe7fe992cf2 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../editormanager/ieditorfactory.cpp | 33 ++++++++++++++++--- .../editormanager/ieditorfactory_p.h | 26 --------------- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp index eeb7e43ae34..1b467837632 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp +++ b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp @@ -9,12 +9,35 @@ #include <utils/mimeutils.h> #include <utils/qtcassert.h> -#include <QFileInfo> - using namespace Utils; namespace Core { +/* Find the one best matching the mimetype passed in. + * Recurse over the parent classes of the mimetype to find them. */ +template<class EditorTypeLike> +static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType, + const QList<EditorTypeLike *> &allFactories, + QList<EditorTypeLike *> *list) +{ + QSet<EditorTypeLike *> matches; + Utils::visitMimeParents(mimeType, [&](const Utils::MimeType &mt) -> bool { + // check for matching factories + for (EditorTypeLike *factory : allFactories) { + if (!matches.contains(factory)) { + const QStringList mimeTypes = factory->mimeTypes(); + for (const QString &mimeName : mimeTypes) { + if (mt.matchesName(mimeName)) { + list->append(factory); + matches.insert(factory); + } + } + } + } + return true; // continue + }); +} + /*! \class Core::IEditorFactory \inheaderfile coreplugin/editormanager/ieditorfactory.h @@ -158,8 +181,8 @@ const EditorTypeList EditorType::defaultEditorTypes(const MimeType &mimeType) const EditorTypeList allExternalEditors = Utils::filtered(allTypes, [](EditorType *e) { return e->asExternalEditor() != nullptr; }); - Internal::mimeTypeFactoryLookup(mimeType, allEditorFactories, &result); - Internal::mimeTypeFactoryLookup(mimeType, allExternalEditors, &result); + mimeTypeFactoryLookup(mimeType, allEditorFactories, &result); + mimeTypeFactoryLookup(mimeType, allExternalEditors, &result); return result; } @@ -349,7 +372,7 @@ const ExternalEditorList IExternalEditor::externalEditors(const Utils::MimeType { ExternalEditorList rc; const ExternalEditorList allEditors = IExternalEditor::allExternalEditors(); - Internal::mimeTypeFactoryLookup(mimeType, allEditors, &rc); + mimeTypeFactoryLookup(mimeType, allEditors, &rc); return rc; } diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory_p.h b/src/plugins/coreplugin/editormanager/ieditorfactory_p.h index c25fa88711c..8f251728424 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory_p.h +++ b/src/plugins/coreplugin/editormanager/ieditorfactory_p.h @@ -6,7 +6,6 @@ #include <utils/mimeutils.h> #include <QHash> -#include <QSet> namespace Core { @@ -17,30 +16,5 @@ namespace Internal { QHash<Utils::MimeType, EditorType *> userPreferredEditorTypes(); void setUserPreferredEditorTypes(const QHash<Utils::MimeType, EditorType *> &factories); -/* Find the one best matching the mimetype passed in. - * Recurse over the parent classes of the mimetype to find them. */ -template<class EditorTypeLike> -static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType, - const QList<EditorTypeLike *> &allFactories, - QList<EditorTypeLike *> *list) -{ - QSet<EditorTypeLike *> matches; - Utils::visitMimeParents(mimeType, [&](const Utils::MimeType &mt) -> bool { - // check for matching factories - for (EditorTypeLike *factory : allFactories) { - if (!matches.contains(factory)) { - const QStringList mimeTypes = factory->mimeTypes(); - for (const QString &mimeName : mimeTypes) { - if (mt.matchesName(mimeName)) { - list->append(factory); - matches.insert(factory); - } - } - } - } - return true; // continue - }); -} - } // Internal } // Core From 8d5641847ff671b3daf9330ef62e9e62dc1986dc Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 18 Aug 2023 14:45:06 +0200 Subject: [PATCH 0808/1777] QmakeProjectManager: Hide QmakeKitAspectFactory implementation Change-Id: I9847c82f023d6b1620fdbf66f34b0fd845cfe721 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../qmakekitinformation.cpp | 99 ++++++++++--------- .../qmakeprojectmanager/qmakekitinformation.h | 20 +--- .../qmakeprojectmanagerplugin.cpp | 3 - 3 files changed, 54 insertions(+), 68 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp index 89e4871fb47..347b230aa33 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp @@ -23,8 +23,7 @@ using namespace ProjectExplorer; using namespace Utils; -namespace QmakeProjectManager { -namespace Internal { +namespace QmakeProjectManager::Internal { class QmakeKitAspectImpl final : public KitAspect { @@ -64,49 +63,6 @@ private: Guard m_ignoreChanges; }; - -QmakeKitAspectFactory::QmakeKitAspectFactory() -{ - setObjectName(QLatin1String("QmakeKitAspect")); - setId(QmakeKitAspect::id()); - setDisplayName(Tr::tr("Qt mkspec")); - setDescription(Tr::tr("The mkspec to use when building the project with qmake.<br>" - "This setting is ignored when using other build systems.")); - setPriority(24000); -} - -Tasks QmakeKitAspectFactory::validate(const Kit *k) const -{ - Tasks result; - QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(k); - - const QString mkspec = QmakeKitAspect::mkspec(k); - if (!version && !mkspec.isEmpty()) - result << BuildSystemTask(Task::Warning, Tr::tr("No Qt version set, so mkspec is ignored.")); - if (version && !version->hasMkspec(mkspec)) - result << BuildSystemTask(Task::Error, Tr::tr("Mkspec not found for Qt version.")); - - return result; -} - -KitAspect *QmakeKitAspectFactory::createKitAspect(Kit *k) const -{ - return new Internal::QmakeKitAspectImpl(k, this); -} - -KitAspectFactory::ItemList QmakeKitAspectFactory::toUserOutput(const Kit *k) const -{ - return {{Tr::tr("mkspec"), QDir::toNativeSeparators(QmakeKitAspect::mkspec(k))}}; -} - -void QmakeKitAspectFactory::addToMacroExpander(Kit *kit, MacroExpander *expander) const -{ - expander->registerVariable("Qmake:mkspec", Tr::tr("Mkspec configured for qmake by the kit."), - [kit]() -> QString { - return QDir::toNativeSeparators(QmakeKitAspect::mkspec(kit)); - }); -} - Id QmakeKitAspect::id() { return Constants::KIT_INFORMATION_ID; @@ -145,5 +101,54 @@ QString QmakeKitAspect::defaultMkspec(const Kit *k) return version->mkspecFor(ToolChainKitAspect::cxxToolChain(k)); } -} // namespace Internal -} // namespace QmakeProjectManager +// QmakeKitAspectFactory + +class QmakeKitAspectFactory : public KitAspectFactory +{ +public: + QmakeKitAspectFactory() + { + setObjectName(QLatin1String("QmakeKitAspect")); + setId(QmakeKitAspect::id()); + setDisplayName(Tr::tr("Qt mkspec")); + setDescription(Tr::tr("The mkspec to use when building the project with qmake.<br>" + "This setting is ignored when using other build systems.")); + setPriority(24000); + } + + Tasks validate(const Kit *k) const override + { + Tasks result; + QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(k); + + const QString mkspec = QmakeKitAspect::mkspec(k); + if (!version && !mkspec.isEmpty()) + result << BuildSystemTask(Task::Warning, Tr::tr("No Qt version set, so mkspec is ignored.")); + if (version && !version->hasMkspec(mkspec)) + result << BuildSystemTask(Task::Error, Tr::tr("Mkspec not found for Qt version.")); + + return result; + } + + KitAspect *createKitAspect(Kit *k) const override + { + return new QmakeKitAspectImpl(k, this); + } + + ItemList toUserOutput(const Kit *k) const override + { + return {{Tr::tr("mkspec"), QDir::toNativeSeparators(QmakeKitAspect::mkspec(k))}}; + } + + void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override + { + expander->registerVariable("Qmake:mkspec", Tr::tr("Mkspec configured for qmake by the kit."), + [kit]() -> QString { + return QDir::toNativeSeparators(QmakeKitAspect::mkspec(kit)); + }); + } +}; + +const QmakeKitAspectFactory theQmakeKitAspectFactory; + +} // QmakeProjectManager::Internal diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.h b/src/plugins/qmakeprojectmanager/qmakekitinformation.h index c40e8d01aa5..634facb6e3d 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.h +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.h @@ -5,8 +5,7 @@ #include <projectexplorer/kitmanager.h> -namespace QmakeProjectManager { -namespace Internal { +namespace QmakeProjectManager::Internal { class QmakeKitAspect { @@ -19,19 +18,4 @@ public: static QString defaultMkspec(const ProjectExplorer::Kit *k); }; -class QmakeKitAspectFactory : public ProjectExplorer::KitAspectFactory -{ -public: - QmakeKitAspectFactory(); - - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const override; - - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const override; - - ItemList toUserOutput(const ProjectExplorer::Kit *k) const override; - - void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override; -}; - -} // namespace Internal -} // namespace QmakeProjectManager +} // QmakeProjectManager::Internal diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp index a9b2c7e591e..7e06ff6bbab 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp @@ -7,7 +7,6 @@ #include "customwidgetwizard/customwidgetwizard.h" #include "profileeditor.h" #include "qmakebuildconfiguration.h" -#include "qmakekitinformation.h" #include "qmakemakestep.h" #include "qmakenodes.h" #include "qmakeproject.h" @@ -96,8 +95,6 @@ public: QAction *m_addLibraryAction = nullptr; QAction *m_addLibraryActionContextMenu = nullptr; - QmakeKitAspectFactory qmakeKitAspectFactory; - void addLibrary(); void addLibraryContextMenu(); void runQMake(); From e08b2fda4df375e0d8e083c338c711218e85cbfb Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 16:00:03 +0200 Subject: [PATCH 0809/1777] McuSupport: Rename mcukitinformation.{cpp,h} to mcukitaspect.{cpp,h} Change-Id: I23cb93b630599dafad5b161a049c8a230a0be1c9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/mcusupport/CMakeLists.txt | 2 +- .../{mcukitinformation.cpp => mcukitaspect.cpp} | 2 +- .../mcusupport/{mcukitinformation.h => mcukitaspect.h} | 0 src/plugins/mcusupport/mcukitmanager.cpp | 9 ++++----- src/plugins/mcusupport/mcusupport.qbs | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) rename src/plugins/mcusupport/{mcukitinformation.cpp => mcukitaspect.cpp} (99%) rename src/plugins/mcusupport/{mcukitinformation.h => mcukitaspect.h} (100%) diff --git a/src/plugins/mcusupport/CMakeLists.txt b/src/plugins/mcusupport/CMakeLists.txt index cebf2e1a038..c5ce1bfa64c 100644 --- a/src/plugins/mcusupport/CMakeLists.txt +++ b/src/plugins/mcusupport/CMakeLists.txt @@ -2,7 +2,7 @@ add_qtc_plugin(McuSupport DEPENDS Qt::Core QmlJS PLUGIN_DEPENDS Core BareMetal ProjectExplorer Debugger CMakeProjectManager QtSupport SOURCES - mcukitinformation.cpp mcukitinformation.h + mcukitaspect.cpp mcukitaspect.h mcusupport.qrc mcusupport_global.h mcusupporttr.h diff --git a/src/plugins/mcusupport/mcukitinformation.cpp b/src/plugins/mcusupport/mcukitaspect.cpp similarity index 99% rename from src/plugins/mcusupport/mcukitinformation.cpp rename to src/plugins/mcusupport/mcukitaspect.cpp index b1771974375..e8cbda6c3d9 100644 --- a/src/plugins/mcusupport/mcukitinformation.cpp +++ b/src/plugins/mcusupport/mcukitaspect.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "mcukitinformation.h" +#include "mcukitaspect.h" #include "mcusupporttr.h" #include <cmakeprojectmanager/cmakekitinformation.h> diff --git a/src/plugins/mcusupport/mcukitinformation.h b/src/plugins/mcusupport/mcukitaspect.h similarity index 100% rename from src/plugins/mcusupport/mcukitinformation.h rename to src/plugins/mcusupport/mcukitaspect.h diff --git a/src/plugins/mcusupport/mcukitmanager.cpp b/src/plugins/mcusupport/mcukitmanager.cpp index 2c13da6fc13..22741158390 100644 --- a/src/plugins/mcusupport/mcukitmanager.cpp +++ b/src/plugins/mcusupport/mcukitmanager.cpp @@ -2,13 +2,13 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "mcukitmanager.h" -#include "mculegacyconstants.h" -#include "mcusupport_global.h" -#include "mcusupportoptions.h" -#include "mcukitinformation.h" +#include "mcukitaspect.h" +#include "mculegacyconstants.h" #include "mcupackage.h" +#include "mcusupport_global.h" #include "mcusupportconstants.h" +#include "mcusupportoptions.h" #include "mcusupportplugin.h" #include "mcusupportsdk.h" #include "mcusupporttr.h" @@ -16,7 +16,6 @@ #include <cmakeprojectmanager/cmakekitinformation.h> #include <cmakeprojectmanager/cmaketoolmanager.h> -#include <coreplugin/icore.h> #include <debugger/debuggeritem.h> #include <debugger/debuggeritemmanager.h> diff --git a/src/plugins/mcusupport/mcusupport.qbs b/src/plugins/mcusupport/mcusupport.qbs index ca9f0eb4db4..752b6a3e6ff 100644 --- a/src/plugins/mcusupport/mcusupport.qbs +++ b/src/plugins/mcusupport/mcusupport.qbs @@ -52,8 +52,8 @@ QtcPlugin { "mcusupportversiondetection.cpp", "mcusupportversiondetection.h", "mcutargetdescription.h", - "mcukitinformation.cpp", - "mcukitinformation.h", + "mcukitaspect.cpp", + "mcukitaspect.h", "mcuhelpers.cpp", "mcuhelpers.h", "settingshandler.h", From b509006d1caf956dcf18f737ca59e4c1ad4fba5a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 18:12:06 +0200 Subject: [PATCH 0810/1777] MesonProjectManager: Hide KitAspectFactory implementations Change-Id: I7ba81771475905f63f4696b3d9073311eea0ee0a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../mesonprojectplugin.cpp | 4 - .../mesontoolkitaspect.cpp | 112 +++++++++--------- .../mesonprojectmanager/mesontoolkitaspect.h | 13 -- .../ninjatoolkitaspect.cpp | 109 +++++++++-------- .../mesonprojectmanager/ninjatoolkitaspect.h | 12 -- 5 files changed, 117 insertions(+), 133 deletions(-) diff --git a/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp b/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp index e7518d74013..cc1e3eb1e27 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp +++ b/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp @@ -8,9 +8,7 @@ #include "mesonbuildsystem.h" #include "mesonproject.h" #include "mesonrunconfiguration.h" -#include "mesontoolkitaspect.h" #include "ninjabuildstep.h" -#include "ninjatoolkitaspect.h" #include "toolssettingsaccessor.h" #include "toolssettingspage.h" @@ -46,8 +44,6 @@ public: private: ToolsSettingsPage m_toolslSettingsPage; ToolsSettingsAccessor m_toolsSettings; - MesonToolKitAspectFactory m_mesonKitAspectFactory; - NinjaToolKitAspectFactory m_ninjaKitAspectFactory; MesonBuildStepFactory m_buildStepFactory; MesonBuildConfigurationFactory m_buildConfigurationFactory; MesonRunConfigurationFactory m_runConfigurationFactory; diff --git a/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp b/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp index b5b494064a0..1e33a0ec650 100644 --- a/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp +++ b/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp @@ -8,70 +8,76 @@ #include <utils/qtcassert.h> +using namespace ProjectExplorer; + namespace MesonProjectManager::Internal { -static const char TOOL_ID[] = "MesonProjectManager.MesonKitInformation.Meson"; +const char TOOL_ID[] = "MesonProjectManager.MesonKitInformation.Meson"; -MesonToolKitAspectFactory::MesonToolKitAspectFactory() -{ - setObjectName(QLatin1String("MesonKitAspect")); - setId(TOOL_ID); - setDisplayName(Tr::tr("Meson Tool")); - setDescription(Tr::tr("The Meson tool to use when building a project with Meson.<br>" - "This setting is ignored when using other build systems.")); - setPriority(9000); -} - -ProjectExplorer::Tasks MesonToolKitAspectFactory::validate(const ProjectExplorer::Kit *k) const -{ - ProjectExplorer::Tasks tasks; - const auto tool = MesonToolKitAspect::mesonTool(k); - if (tool && !tool->isValid()) - tasks << ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::Warning, - Tr::tr("Cannot validate this meson executable.")}; - return tasks; -} - -void MesonToolKitAspectFactory::setup(ProjectExplorer::Kit *k) -{ - const auto tool = MesonToolKitAspect::mesonTool(k); - if (!tool) { - const auto autoDetected = MesonTools::mesonWrapper(); - if (autoDetected) - MesonToolKitAspect::setMesonTool(k, autoDetected->id()); - } -} - -void MesonToolKitAspectFactory::fix(ProjectExplorer::Kit *k) -{ - setup(k); -} - -ProjectExplorer::KitAspectFactory::ItemList MesonToolKitAspectFactory::toUserOutput( - const ProjectExplorer::Kit *k) const -{ - const auto tool = MesonToolKitAspect::mesonTool(k); - if (tool) - return {{Tr::tr("Meson"), tool->name()}}; - return {{Tr::tr("Meson"), Tr::tr("Unconfigured")}}; -} - -ProjectExplorer::KitAspect *MesonToolKitAspectFactory::createKitAspect(ProjectExplorer::Kit *k) const -{ - QTC_ASSERT(k, return nullptr); - return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Meson}; -} - -void MesonToolKitAspect::setMesonTool(ProjectExplorer::Kit *kit, Utils::Id id) +void MesonToolKitAspect::setMesonTool(Kit *kit, Utils::Id id) { QTC_ASSERT(kit && id.isValid(), return ); kit->setValue(TOOL_ID, id.toSetting()); } -Utils::Id MesonToolKitAspect::mesonToolId(const ProjectExplorer::Kit *kit) +Utils::Id MesonToolKitAspect::mesonToolId(const Kit *kit) { QTC_ASSERT(kit, return {}); return Utils::Id::fromSetting(kit->value(TOOL_ID)); } +// MesonToolKitAspectFactory + +class MesonToolKitAspectFactory final : public KitAspectFactory +{ +public: + MesonToolKitAspectFactory() + { + setObjectName(QLatin1String("MesonKitAspect")); + setId(TOOL_ID); + setDisplayName(Tr::tr("Meson Tool")); + setDescription(Tr::tr("The Meson tool to use when building a project with Meson.<br>" + "This setting is ignored when using other build systems.")); + setPriority(9000); + } + + Tasks validate(const Kit *k) const final + { + Tasks tasks; + const auto tool = MesonToolKitAspect::mesonTool(k); + if (tool && !tool->isValid()) + tasks << BuildSystemTask{Task::Warning, Tr::tr("Cannot validate this meson executable.")}; + return tasks; + } + + void setup(Kit *k) final + { + const auto tool = MesonToolKitAspect::mesonTool(k); + if (!tool) { + const auto autoDetected = MesonTools::mesonWrapper(); + if (autoDetected) + MesonToolKitAspect::setMesonTool(k, autoDetected->id()); + } + } + void fix(Kit *k) final + { + setup(k); + } + + KitAspect *createKitAspect(Kit *k) const + { + return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Meson}; + } + + ItemList toUserOutput( const Kit *k) const + { + const auto tool = MesonToolKitAspect::mesonTool(k); + if (tool) + return {{Tr::tr("Meson"), tool->name()}}; + return {{Tr::tr("Meson"), Tr::tr("Unconfigured")}}; + } +}; + +const MesonToolKitAspectFactory theMesonKitAspectFactory; + } // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/mesontoolkitaspect.h b/src/plugins/mesonprojectmanager/mesontoolkitaspect.h index b6764c2ea91..3924d455f47 100644 --- a/src/plugins/mesonprojectmanager/mesontoolkitaspect.h +++ b/src/plugins/mesonprojectmanager/mesontoolkitaspect.h @@ -28,17 +28,4 @@ public: } }; -class MesonToolKitAspectFactory final : public ProjectExplorer::KitAspectFactory -{ -public: - MesonToolKitAspectFactory(); - - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; - void setup(ProjectExplorer::Kit *k) final; - void fix(ProjectExplorer::Kit *k) final; - ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const final; - -}; - } // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp index 1e093588252..ccf393e4ded 100644 --- a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp +++ b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp @@ -8,59 +8,11 @@ #include <utils/qtcassert.h> +using namespace ProjectExplorer; + namespace MesonProjectManager::Internal { -static const char TOOL_ID[] = "MesonProjectManager.MesonKitInformation.Ninja"; - -NinjaToolKitAspectFactory::NinjaToolKitAspectFactory() -{ - setObjectName(QLatin1String("NinjaKitAspect")); - setId(TOOL_ID); - setDisplayName(Tr::tr("Ninja Tool")); - setDescription(Tr::tr("The Ninja tool to use when building a project with Meson.<br>" - "This setting is ignored when using other build systems.")); - setPriority(9000); -} - -ProjectExplorer::Tasks NinjaToolKitAspectFactory::validate(const ProjectExplorer::Kit *k) const -{ - ProjectExplorer::Tasks tasks; - const auto tool = NinjaToolKitAspect::ninjaTool(k); - if (tool && !tool->isValid()) - tasks << ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::Warning, - Tr::tr("Cannot validate this Ninja executable.")}; - return tasks; -} - -void NinjaToolKitAspectFactory::setup(ProjectExplorer::Kit *k) -{ - const auto tool = NinjaToolKitAspect::ninjaTool(k); - if (!tool) { - const auto autoDetected = MesonTools::ninjaWrapper(); - if (autoDetected) - NinjaToolKitAspect::setNinjaTool(k, autoDetected->id()); - } -} - -void NinjaToolKitAspectFactory::fix(ProjectExplorer::Kit *k) -{ - setup(k); -} - -ProjectExplorer::KitAspectFactory::ItemList NinjaToolKitAspectFactory::toUserOutput( - const ProjectExplorer::Kit *k) const -{ - const auto tool = NinjaToolKitAspect::ninjaTool(k); - if (tool) - return {{Tr::tr("Ninja"), tool->name()}}; - return {{Tr::tr("Ninja"), Tr::tr("Unconfigured")}}; -} - -ProjectExplorer::KitAspect *NinjaToolKitAspectFactory::createKitAspect(ProjectExplorer::Kit *k) const -{ - QTC_ASSERT(k, return nullptr); - return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Ninja}; -} +const char TOOL_ID[] = "MesonProjectManager.MesonKitInformation.Ninja"; void NinjaToolKitAspect::setNinjaTool(ProjectExplorer::Kit *kit, Utils::Id id) { @@ -74,4 +26,59 @@ Utils::Id NinjaToolKitAspect::ninjaToolId(const ProjectExplorer::Kit *kit) return Utils::Id::fromSetting(kit->value(TOOL_ID)); } +// NinjaToolKitAspectFactory + +class NinjaToolKitAspectFactory final : public ProjectExplorer::KitAspectFactory +{ +public: + NinjaToolKitAspectFactory() + { + setObjectName(QLatin1String("NinjaKitAspect")); + setId(TOOL_ID); + setDisplayName(Tr::tr("Ninja Tool")); + setDescription(Tr::tr("The Ninja tool to use when building a project with Meson.<br>" + "This setting is ignored when using other build systems.")); + setPriority(9000); + } + + Tasks validate(const Kit *k) const final + { + Tasks tasks; + const auto tool = NinjaToolKitAspect::ninjaTool(k); + if (tool && !tool->isValid()) + tasks << BuildSystemTask{Task::Warning, + Tr::tr("Cannot validate this Ninja executable.")}; + return tasks; + } + + void setup(Kit *k) final + { + const auto tool = NinjaToolKitAspect::ninjaTool(k); + if (!tool) { + const auto autoDetected = MesonTools::ninjaWrapper(); + if (autoDetected) + NinjaToolKitAspect::setNinjaTool(k, autoDetected->id()); + } + } + void fix(Kit *k) final + { + setup(k); + } + + ItemList toUserOutput( const Kit *k) const + { + const auto tool = NinjaToolKitAspect::ninjaTool(k); + if (tool) + return {{Tr::tr("Ninja"), tool->name()}}; + return {{Tr::tr("Ninja"), Tr::tr("Unconfigured")}}; + } + + KitAspect *createKitAspect(Kit *k) const final + { + return new ToolKitAspectWidget(k, this, ToolKitAspectWidget::ToolType::Ninja); + } +}; + +const NinjaToolKitAspectFactory theNinjaToolKitAspectFactory; + } // MesonProjectManager::Internal diff --git a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.h b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.h index ce080d1e676..d1ee50c7a38 100644 --- a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.h +++ b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.h @@ -27,16 +27,4 @@ public: } }; -class NinjaToolKitAspectFactory final : public ProjectExplorer::KitAspectFactory -{ -public: - NinjaToolKitAspectFactory(); - - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; - void setup(ProjectExplorer::Kit *k) final; - void fix(ProjectExplorer::Kit *k) final; - ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const final; -}; - } // MesonProjectManager::Internal From 36707dc90e351844f4d45d37c57a1bd0a6f2f752 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 18 Aug 2023 14:50:58 +0200 Subject: [PATCH 0811/1777] QbsProjectManager: Hide QbsKitAspectFactory implementation Change-Id: Ifbea98759283ea5017eb28ee4e0aec56cf1c5470 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../qbsprojectmanager/qbskitinformation.cpp | 50 ++++++++++--------- .../qbsprojectmanager/qbskitinformation.h | 17 +------ .../qbsprojectmanagerplugin.cpp | 2 - 3 files changed, 29 insertions(+), 40 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.cpp b/src/plugins/qbsprojectmanager/qbskitinformation.cpp index 84ad6d34a47..d944fb5ade1 100644 --- a/src/plugins/qbsprojectmanager/qbskitinformation.cpp +++ b/src/plugins/qbsprojectmanager/qbskitinformation.cpp @@ -17,8 +17,7 @@ using namespace ProjectExplorer; -namespace QbsProjectManager { -namespace Internal { +namespace QbsProjectManager::Internal { class QbsKitAspectImpl final : public KitAspect { @@ -53,14 +52,6 @@ private: QPushButton * const m_changeButton; }; -QbsKitAspectFactory::QbsKitAspectFactory() -{ - setObjectName(QLatin1String("QbsKitAspect")); - setId(QbsKitAspect::id()); - setDisplayName(Tr::tr("Additional Qbs Profile Settings")); - setPriority(22000); -} - QString QbsKitAspect::representation(const Kit *kit) { const QVariantMap props = properties(kit); @@ -90,20 +81,33 @@ Utils::Id QbsKitAspect::id() return "Qbs.KitInformation"; } -Tasks QbsKitAspectFactory::validate(const Kit *) const -{ - return {}; -} +// QbsKitAspectFactory -KitAspectFactory::ItemList QbsKitAspectFactory::toUserOutput(const Kit *k) const +class QbsKitAspectFactory final : public KitAspectFactory { - return {{displayName(), QbsKitAspect::representation(k)}}; -} +public: + QbsKitAspectFactory() + { + setObjectName(QLatin1String("QbsKitAspect")); + setId(QbsKitAspect::id()); + setDisplayName(Tr::tr("Additional Qbs Profile Settings")); + setPriority(22000); + } -KitAspect *QbsKitAspectFactory::createKitAspect(Kit *k) const -{ - return new QbsKitAspectImpl(k, this); -} +private: + Tasks validate(const Kit *) const override { return {}; } -} // namespace Internal -} // namespace QbsProjectManager + ItemList toUserOutput(const Kit *k) const override + { + return {{displayName(), QbsKitAspect::representation(k)}}; + } + + KitAspect *createKitAspect(Kit *k) const override + { + return new QbsKitAspectImpl(k, this); + } +}; + +const QbsKitAspectFactory theQbsKitAspectFactory; + +} // QbsProjectManager::Internal diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.h b/src/plugins/qbsprojectmanager/qbskitinformation.h index f454ed3a387..2ee4c60f42e 100644 --- a/src/plugins/qbsprojectmanager/qbskitinformation.h +++ b/src/plugins/qbsprojectmanager/qbskitinformation.h @@ -5,8 +5,7 @@ #include <projectexplorer/kitaspects.h> -namespace QbsProjectManager { -namespace Internal { +namespace QbsProjectManager::Internal { class QbsKitAspect final { @@ -18,16 +17,4 @@ public: static Utils::Id id(); }; -class QbsKitAspectFactory final : public ProjectExplorer::KitAspectFactory -{ -public: - QbsKitAspectFactory(); - -private: - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *) const override; - ItemList toUserOutput(const ProjectExplorer::Kit *) const override; - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *) const override; -}; - -} // namespace Internal -} // namespace QbsProjectManager +} // QbsProjectManager::Internal diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp index 0f4a08aad11..4299f22e293 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp @@ -7,7 +7,6 @@ #include "qbsbuildstep.h" #include "qbscleanstep.h" #include "qbsinstallstep.h" -#include "qbskitinformation.h" #include "qbsnodes.h" #include "qbsprofilemanager.h" #include "qbsprofilessettingspage.h" @@ -74,7 +73,6 @@ public: QbsInstallStepFactory installStepFactory; QbsSettingsPage settingsPage; QbsProfilesSettingsPage profilesSetttingsPage; - QbsKitAspectFactory qbsKitAspectFactory; }; QbsProjectManagerPlugin::~QbsProjectManagerPlugin() From 70aad61e9799ffa854b082b2bfd5d01d6ebc61ce Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 18 Aug 2023 15:51:44 +0200 Subject: [PATCH 0812/1777] ProjectExplorer: Remove QObject base from ICustomWizardMetaFactory Change-Id: I244436a5b953121f7e8cf93d06d3192ba546bcba Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/customwizard/customwizard.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/projectexplorer/customwizard/customwizard.h b/src/plugins/projectexplorer/customwizard/customwizard.h index ca98a2bffb3..c0a50a2fab7 100644 --- a/src/plugins/projectexplorer/customwizard/customwizard.h +++ b/src/plugins/projectexplorer/customwizard/customwizard.h @@ -28,13 +28,11 @@ class CustomWizardParameters; } // Documentation inside. -class PROJECTEXPLORER_EXPORT ICustomWizardMetaFactory : public QObject +class PROJECTEXPLORER_EXPORT ICustomWizardMetaFactory { - Q_OBJECT - public: ICustomWizardMetaFactory(const QString &klass, Core::IWizardFactory::WizardKind kind); - ~ICustomWizardMetaFactory() override; + virtual ~ICustomWizardMetaFactory(); virtual CustomWizard *create() const = 0; QString klass() const { return m_klass; } From c18de1ecb6dce46dbd85f9bad8a393b50edc65a7 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 18 Aug 2023 17:02:13 +0200 Subject: [PATCH 0813/1777] ProjectExplorer: Start with selected kit If there's one; when clicking "Manage Kits..." in project mode. Change-Id: I06a92d8e286f7b2b54844b7f41029d7c64684398 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/kitmodel.cpp | 6 ++ src/plugins/projectexplorer/kitmodel.h | 2 + .../projectexplorer/kitoptionspage.cpp | 81 ++++++++++--------- src/plugins/projectexplorer/kitoptionspage.h | 18 +---- .../projectexplorer/projectexplorer.cpp | 1 - src/plugins/projectexplorer/projectwindow.cpp | 13 ++- .../projectexplorer/targetsetupwidget.cpp | 2 +- 7 files changed, 68 insertions(+), 55 deletions(-) diff --git a/src/plugins/projectexplorer/kitmodel.cpp b/src/plugins/projectexplorer/kitmodel.cpp index 4981a19d25b..38ce4a576b2 100644 --- a/src/plugins/projectexplorer/kitmodel.cpp +++ b/src/plugins/projectexplorer/kitmodel.cpp @@ -188,6 +188,12 @@ KitNode *KitModel::kitNode(const QModelIndex &index) return (n && n->level() == 2) ? static_cast<KitNode *>(n) : nullptr; } +QModelIndex KitModel::indexOf(Id kitId) const +{ + KitNode *n = findItemAtLevel<2>([kitId](KitNode *n) { return n->kit()->id() == kitId; }); + return n ? indexForItem(n) : QModelIndex(); +} + QModelIndex KitModel::indexOf(Kit *k) const { KitNode *n = findWorkingCopy(k); diff --git a/src/plugins/projectexplorer/kitmodel.h b/src/plugins/projectexplorer/kitmodel.h index f402b265d40..249d485101e 100644 --- a/src/plugins/projectexplorer/kitmodel.h +++ b/src/plugins/projectexplorer/kitmodel.h @@ -5,6 +5,7 @@ #include "projectexplorer_export.h" +#include <utils/id.h> #include <utils/treemodel.h> QT_BEGIN_NAMESPACE @@ -36,6 +37,7 @@ public: Kit *kit(const QModelIndex &); KitNode *kitNode(const QModelIndex &); QModelIndex indexOf(Kit *k) const; + QModelIndex indexOf(Utils::Id kitId) const; void setDefaultKit(const QModelIndex &index); bool isDefaultKit(Kit *k) const; diff --git a/src/plugins/projectexplorer/kitoptionspage.cpp b/src/plugins/projectexplorer/kitoptionspage.cpp index 24bafc0eeb0..bf702cab13a 100644 --- a/src/plugins/projectexplorer/kitoptionspage.cpp +++ b/src/plugins/projectexplorer/kitoptionspage.cpp @@ -11,6 +11,8 @@ #include "kitmanagerconfigwidget.h" #include "kitmanager.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/qtcassert.h> #include <QHBoxLayout> @@ -20,15 +22,21 @@ #include <QTreeView> #include <QVBoxLayout> -namespace ProjectExplorer { -namespace Internal { +using namespace Utils; + +namespace ProjectExplorer::Internal { + +// Page pre-selection + +static Id selectedKitId; + +void setSelectectKitId(const Utils::Id &kitId) +{ + selectedKitId = kitId; +} // KitOptionsPageWidget -class KitOptionsPageWidget; - -static QPointer<KitOptionsPageWidget> kitOptionsPageWidget; - class KitOptionsPageWidget : public Core::IOptionsPageWidget { public: @@ -44,6 +52,8 @@ public: void makeDefaultKit(); void updateState(); + void scrollToSelectedKit(); + void apply() final { m_model->apply(); } public: @@ -62,7 +72,6 @@ public: KitOptionsPageWidget::KitOptionsPageWidget() { - kitOptionsPageWidget = this; m_kitsView = new QTreeView(this); m_kitsView->setUniformRowHeights(true); m_kitsView->header()->setStretchLastSection(true); @@ -140,9 +149,22 @@ KitOptionsPageWidget::KitOptionsPageWidget() m_model->updateVisibility(); } }); + + scrollToSelectedKit(); + updateState(); } +void KitOptionsPageWidget::scrollToSelectedKit() +{ + QModelIndex index = m_model->indexOf(selectedKitId); + m_selectionModel->select(index, + QItemSelectionModel::Clear + | QItemSelectionModel::SelectCurrent + | QItemSelectionModel::Rows); + m_kitsView->scrollTo(index); +} + void KitOptionsPageWidget::kitSelectionChanged() { QModelIndex current = currentIndex(); @@ -238,37 +260,22 @@ QModelIndex KitOptionsPageWidget::currentIndex() const return idxs.at(0); } -} // namespace Internal +// KitOptionsPage -// -------------------------------------------------------------------------- -// KitOptionsPage: -// -------------------------------------------------------------------------- - -KitOptionsPage::KitOptionsPage() +class KitsSettingsPage : public Core::IOptionsPage { - setId(Constants::KITS_SETTINGS_PAGE_ID); - setDisplayName(Tr::tr("Kits")); - setCategory(Constants::KITS_SETTINGS_CATEGORY); - setDisplayCategory(Tr::tr("Kits")); - setCategoryIconPath(":/projectexplorer/images/settingscategory_kits.png"); - setWidgetCreator([] { return new Internal::KitOptionsPageWidget; }); -} +public: + KitsSettingsPage() + { + setId(Constants::KITS_SETTINGS_PAGE_ID); + setDisplayName(Tr::tr("Kits")); + setCategory(Constants::KITS_SETTINGS_CATEGORY); + setDisplayCategory(Tr::tr("Kits")); + setCategoryIconPath(":/projectexplorer/images/settingscategory_kits.png"); + setWidgetCreator([] { return new Internal::KitOptionsPageWidget; }); + } +}; -void KitOptionsPage::showKit(Kit *k) -{ - if (!k) - return; +const KitsSettingsPage theKitsSettingsPage; - Internal::KitOptionsPageWidget *widget = Internal::kitOptionsPageWidget; - if (!widget) - return; - - QModelIndex index = widget->m_model->indexOf(k); - widget->m_selectionModel->select(index, - QItemSelectionModel::Clear - | QItemSelectionModel::SelectCurrent - | QItemSelectionModel::Rows); - widget->m_kitsView->scrollTo(index); -} - -} // namespace ProjectExplorer +} // ProjectExplorer::Internal diff --git a/src/plugins/projectexplorer/kitoptionspage.h b/src/plugins/projectexplorer/kitoptionspage.h index a7a4ba29dbc..ae8d42e88dc 100644 --- a/src/plugins/projectexplorer/kitoptionspage.h +++ b/src/plugins/projectexplorer/kitoptionspage.h @@ -3,20 +3,10 @@ #pragma once -#include "projectexplorer_export.h" +namespace Utils { class Id; } -#include <coreplugin/dialogs/ioptionspage.h> +namespace ProjectExplorer::Internal { -namespace ProjectExplorer { +void setSelectectKitId(const Utils::Id &kitId); -class Kit; - -class PROJECTEXPLORER_EXPORT KitOptionsPage : public Core::IOptionsPage -{ -public: - KitOptionsPage(); - - static void showKit(Kit *k); -}; - -} // namespace ProjectExplorer +} // ProjectExplorer::Internal diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 063196c65fd..55b4d28cc1a 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -636,7 +636,6 @@ public: DesktopDeviceFactory m_desktopDeviceFactory; ToolChainOptionsPage m_toolChainOptionsPage; - KitOptionsPage m_kitOptionsPage; TaskHub m_taskHub; diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 1ad0b256a2a..e9f5d82adb3 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -741,8 +741,17 @@ public: void handleManageKits() { - if (ProjectItem *projectItem = m_projectsModel.rootItem()->childAt(0)) { - KitOptionsPage::showKit(KitManager::kit(Id::fromSetting(projectItem->data(0, KitIdRole)))); + const QModelIndexList selected = m_selectorTree->selectionModel()->selectedIndexes(); + if (!selected.isEmpty()) { + TreeItem *treeItem = m_projectsModel.itemForIndex(selected.front()); + while (treeItem) { + const Id kitId = Id::fromSetting(treeItem->data(0, KitIdRole)); + if (kitId.isValid()) { + setSelectectKitId(kitId); + break; + } + treeItem = treeItem->parent(); + } } ICore::showOptionsDialog(Constants::KITS_SETTINGS_PAGE_ID); } diff --git a/src/plugins/projectexplorer/targetsetupwidget.cpp b/src/plugins/projectexplorer/targetsetupwidget.cpp index 50e86ef02b8..ea49a54c75b 100644 --- a/src/plugins/projectexplorer/targetsetupwidget.cpp +++ b/src/plugins/projectexplorer/targetsetupwidget.cpp @@ -180,7 +180,7 @@ void TargetSetupWidget::manageKit() if (!m_kit) return; - KitOptionsPage::showKit(m_kit); + setSelectectKitId(m_kit->id()); Core::ICore::showOptionsDialog(Constants::KITS_SETTINGS_PAGE_ID, parentWidget()); } From b17c83b5485f6d6e9ad67390653ec0dc9c28169f Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 21 Aug 2023 12:38:06 +0200 Subject: [PATCH 0814/1777] LanguageClient: Silence soft assert The reported path may be OS specific and can contain backslashes on Windows. Change-Id: I93d990c7fec84ae335d57a0671c12dcac3d2f939 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/languageclient/languageclientsymbolsupport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/languageclient/languageclientsymbolsupport.cpp b/src/plugins/languageclient/languageclientsymbolsupport.cpp index 89cc9f44e2b..546ad068e4b 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.cpp +++ b/src/plugins/languageclient/languageclientsymbolsupport.cpp @@ -577,7 +577,7 @@ void SymbolSupport::applyRename(const Utils::SearchResultItems &checkedItems, QSet<Utils::FilePath> affectedNonOpenFilePaths; QMap<Utils::FilePath, QList<TextEdit>> editsForDocuments; for (const Utils::SearchResultItem &item : checkedItems) { - const auto filePath = Utils::FilePath::fromString(item.path().value(0)); + const auto filePath = Utils::FilePath::fromUserInput(item.path().value(0)); if (!m_client->documentForFilePath(filePath)) affectedNonOpenFilePaths << filePath; TextEdit edit(item.userData().toJsonObject()); From e3d2967f636c673b08477caf1e76815bf5b6d697 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 21 Aug 2023 14:38:22 +0200 Subject: [PATCH 0815/1777] QmakeBuildSystem: Rename qmakekitinformation.{h,cpp} ... to qmakekitaspect.{h,cpp} Change-Id: I1220bb3d6aa85c4b0854b522bebc40d6d05290bb Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/qmakeprojectmanager/CMakeLists.txt | 2 +- src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp | 2 +- .../{qmakekitinformation.cpp => qmakekitaspect.cpp} | 2 +- .../{qmakekitinformation.h => qmakekitaspect.h} | 0 src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs | 2 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) rename src/plugins/qmakeprojectmanager/{qmakekitinformation.cpp => qmakekitaspect.cpp} (99%) rename src/plugins/qmakeprojectmanager/{qmakekitinformation.h => qmakekitaspect.h} (100%) diff --git a/src/plugins/qmakeprojectmanager/CMakeLists.txt b/src/plugins/qmakeprojectmanager/CMakeLists.txt index 83548526cd1..855aafbfc74 100644 --- a/src/plugins/qmakeprojectmanager/CMakeLists.txt +++ b/src/plugins/qmakeprojectmanager/CMakeLists.txt @@ -20,7 +20,7 @@ add_qtc_plugin(QmakeProjectManager profilehoverhandler.cpp profilehoverhandler.h qmakebuildconfiguration.cpp qmakebuildconfiguration.h qmakebuildinfo.h - qmakekitinformation.cpp qmakekitinformation.h + qmakekitaspect.cpp qmakekitaspect.h qmakemakestep.cpp qmakemakestep.h qmakenodes.cpp qmakenodes.h qmakenodetreebuilder.cpp qmakenodetreebuilder.h diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 4fd34fdf8be..36fcb2ea46b 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -6,7 +6,7 @@ #include "makefileparse.h" #include "qmakebuildconfiguration.h" #include "qmakebuildinfo.h" -#include "qmakekitinformation.h" +#include "qmakekitaspect.h" #include "qmakenodes.h" #include "qmakeproject.h" #include "qmakeprojectmanagerconstants.h" diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp b/src/plugins/qmakeprojectmanager/qmakekitaspect.cpp similarity index 99% rename from src/plugins/qmakeprojectmanager/qmakekitinformation.cpp rename to src/plugins/qmakeprojectmanager/qmakekitaspect.cpp index 347b230aa33..e55a91bfdd7 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitaspect.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "qmakekitinformation.h" +#include "qmakekitaspect.h" #include "qmakeprojectmanagerconstants.h" #include "qmakeprojectmanagertr.h" diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.h b/src/plugins/qmakeprojectmanager/qmakekitaspect.h similarity index 100% rename from src/plugins/qmakeprojectmanager/qmakekitinformation.h rename to src/plugins/qmakeprojectmanager/qmakekitaspect.h diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp index 8b947b91081..85316c7b772 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp @@ -6,7 +6,7 @@ #include "makefileparse.h" #include "qmakebuildconfiguration.h" #include "qmakebuildinfo.h" -#include "qmakekitinformation.h" +#include "qmakekitaspect.h" #include "qmakeproject.h" #include "qmakeprojectmanagertr.h" #include "qmakestep.h" diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs index 599441a0a87..a7fe09d05b0 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs @@ -26,7 +26,7 @@ Project { "profilehighlighter.cpp", "profilehighlighter.h", "profilehoverhandler.cpp", "profilehoverhandler.h", "qmakebuildinfo.h", - "qmakekitinformation.cpp", "qmakekitinformation.h", + "qmakekitaspect.cpp", "qmakekitaspect.h", "qmakemakestep.cpp", "qmakemakestep.h", "qmakeparser.cpp", "qmakeparser.h", "qmakeparsernodes.cpp", "qmakeparsernodes.h", diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index b153b95ffd2..893fd5192cb 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -4,7 +4,7 @@ #include "qmakestep.h" #include "qmakebuildconfiguration.h" -#include "qmakekitinformation.h" +#include "qmakekitaspect.h" #include "qmakenodes.h" #include "qmakeparser.h" #include "qmakeproject.h" From 9b05fc8ada9d51c25f693617e2dcd20a637286dd Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 21 Aug 2023 14:25:31 +0200 Subject: [PATCH 0816/1777] QbsProjectManager: Rename qbskitinformation.{h,cpp} ...to qbskitaspect.{h,cpp}. Follow-up to class renaming. Change-Id: I98786d76bb9fe9dc9a4a9b57fe7150eafca8e991 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/qbsprojectmanager/CMakeLists.txt | 2 +- src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp | 2 +- .../{qbskitinformation.cpp => qbskitaspect.cpp} | 2 +- .../qbsprojectmanager/{qbskitinformation.h => qbskitaspect.h} | 0 src/plugins/qbsprojectmanager/qbsprojectmanager.qbs | 4 ++-- 5 files changed, 5 insertions(+), 5 deletions(-) rename src/plugins/qbsprojectmanager/{qbskitinformation.cpp => qbskitaspect.cpp} (98%) rename src/plugins/qbsprojectmanager/{qbskitinformation.h => qbskitaspect.h} (100%) diff --git a/src/plugins/qbsprojectmanager/CMakeLists.txt b/src/plugins/qbsprojectmanager/CMakeLists.txt index 3408e3f3ad0..f039198419e 100644 --- a/src/plugins/qbsprojectmanager/CMakeLists.txt +++ b/src/plugins/qbsprojectmanager/CMakeLists.txt @@ -11,7 +11,7 @@ add_qtc_plugin(QbsProjectManager qbsbuildstep.cpp qbsbuildstep.h qbscleanstep.cpp qbscleanstep.h qbsinstallstep.cpp qbsinstallstep.h - qbskitinformation.cpp qbskitinformation.h + qbskitaspect.cpp qbskitaspect.h qbsnodes.cpp qbsnodes.h qbsnodetreebuilder.cpp qbsnodetreebuilder.h qbspmlogging.cpp qbspmlogging.h diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index a76e4f6295b..4f755b1f1a3 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -3,7 +3,7 @@ #include "defaultpropertyprovider.h" -#include "qbskitinformation.h" +#include "qbskitaspect.h" #include "qbsprojectmanagerconstants.h" #include "qbsprojectmanagertr.h" diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.cpp b/src/plugins/qbsprojectmanager/qbskitaspect.cpp similarity index 98% rename from src/plugins/qbsprojectmanager/qbskitinformation.cpp rename to src/plugins/qbsprojectmanager/qbskitaspect.cpp index d944fb5ade1..ef104cec687 100644 --- a/src/plugins/qbsprojectmanager/qbskitinformation.cpp +++ b/src/plugins/qbsprojectmanager/qbskitaspect.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "qbskitinformation.h" +#include "qbskitaspect.h" #include "customqbspropertiesdialog.h" #include "qbsprofilemanager.h" diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.h b/src/plugins/qbsprojectmanager/qbskitaspect.h similarity index 100% rename from src/plugins/qbsprojectmanager/qbskitinformation.h rename to src/plugins/qbsprojectmanager/qbskitaspect.h diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs index b5d671e8df9..dec42fd8902 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs +++ b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs @@ -31,8 +31,8 @@ QtcPlugin { "qbscleanstep.h", "qbsinstallstep.cpp", "qbsinstallstep.h", - "qbskitinformation.cpp", - "qbskitinformation.h", + "qbskitaspect.cpp", + "qbskitaspect.h", "qbsnodes.cpp", "qbsnodes.h", "qbsnodetreebuilder.cpp", From 4e0c4b0f23ef85cd7734f1de033caa19d5588004 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 21 Aug 2023 17:20:02 +0200 Subject: [PATCH 0817/1777] CMake: Rename cmakekitinformation.{h,cpp} to cmakekitaspect.{h,cpp} Follow up after renaming the contained classes. Change-Id: I9393c367abdd4eac487e17676c98a357ff33c98c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cmakeprojectmanager/CMakeLists.txt | 2 +- src/plugins/cmakeprojectmanager/builddirparameters.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakeabstractprocessstep.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp | 2 +- .../{cmakekitinformation.cpp => cmakekitaspect.cpp} | 2 +- .../{cmakekitinformation.h => cmakekitaspect.h} | 0 src/plugins/cmakeprojectmanager/cmakeproject.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs | 4 ++-- src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp | 2 +- src/plugins/mcusupport/mcubuildstep.cpp | 2 +- src/plugins/mcusupport/mcukitaspect.cpp | 2 +- src/plugins/mcusupport/mcukitmanager.cpp | 2 +- src/plugins/mcusupport/mcusupportoptions.cpp | 2 +- src/plugins/mcusupport/mcusupportrunconfiguration.cpp | 2 +- src/plugins/mcusupport/test/unittest.cpp | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) rename src/plugins/cmakeprojectmanager/{cmakekitinformation.cpp => cmakekitaspect.cpp} (99%) rename src/plugins/cmakeprojectmanager/{cmakekitinformation.h => cmakekitaspect.h} (100%) diff --git a/src/plugins/cmakeprojectmanager/CMakeLists.txt b/src/plugins/cmakeprojectmanager/CMakeLists.txt index 057b4139459..a7493597492 100644 --- a/src/plugins/cmakeprojectmanager/CMakeLists.txt +++ b/src/plugins/cmakeprojectmanager/CMakeLists.txt @@ -18,7 +18,7 @@ add_qtc_plugin(CMakeProjectManager cmakeformatter.cpp cmakeformatter.h cmakeindenter.cpp cmakeindenter.h cmakeinstallstep.cpp cmakeinstallstep.h - cmakekitinformation.cpp cmakekitinformation.h + cmakekitaspect.cpp cmakekitaspect.h cmakelocatorfilter.cpp cmakelocatorfilter.h cmakeparser.cpp cmakeparser.h cmakeprocess.cpp cmakeprocess.h diff --git a/src/plugins/cmakeprojectmanager/builddirparameters.cpp b/src/plugins/cmakeprojectmanager/builddirparameters.cpp index 75be66533f8..b231cc74b77 100644 --- a/src/plugins/cmakeprojectmanager/builddirparameters.cpp +++ b/src/plugins/cmakeprojectmanager/builddirparameters.cpp @@ -5,7 +5,7 @@ #include "cmakebuildconfiguration.h" #include "cmakebuildsystem.h" -#include "cmakekitinformation.h" +#include "cmakekitaspect.h" #include "cmaketoolmanager.h" #include <projectexplorer/kitaspects.h> diff --git a/src/plugins/cmakeprojectmanager/cmakeabstractprocessstep.cpp b/src/plugins/cmakeprojectmanager/cmakeabstractprocessstep.cpp index 29b4425d697..49438122eb1 100644 --- a/src/plugins/cmakeprojectmanager/cmakeabstractprocessstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeabstractprocessstep.cpp @@ -3,7 +3,7 @@ #include "cmakeabstractprocessstep.h" -#include "cmakekitinformation.h" +#include "cmakekitaspect.h" #include "cmakeprojectmanagertr.h" #include "cmaketool.h" diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index a72c5b0c8ad..c5330929043 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -6,7 +6,7 @@ #include "cmakebuildstep.h" #include "cmakebuildsystem.h" #include "cmakeconfigitem.h" -#include "cmakekitinformation.h" +#include "cmakekitaspect.h" #include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "cmakeprojectmanagertr.h" diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 638586974ac..294fb055c53 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -5,7 +5,7 @@ #include "cmakebuildconfiguration.h" #include "cmakebuildsystem.h" -#include "cmakekitinformation.h" +#include "cmakekitaspect.h" #include "cmakeparser.h" #include "cmakeproject.h" #include "cmakeprojectconstants.h" diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index fb856a3f0fc..e4b80768b55 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -7,7 +7,7 @@ #include "cmakebuildconfiguration.h" #include "cmakebuildstep.h" #include "cmakebuildtarget.h" -#include "cmakekitinformation.h" +#include "cmakekitaspect.h" #include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "cmakeprojectmanagertr.h" diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 01fbeaa2329..004dc7e092c 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -3,7 +3,7 @@ #include "cmakefilecompletionassist.h" -#include "cmakekitinformation.h" +#include "cmakekitaspect.h" #include "cmakeprojectconstants.h" #include "cmaketool.h" diff --git a/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp b/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp index d849a80a363..6043f11adfb 100644 --- a/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeinstallstep.cpp @@ -5,7 +5,7 @@ #include "cmakeabstractprocessstep.h" #include "cmakebuildsystem.h" -#include "cmakekitinformation.h" +#include "cmakekitaspect.h" #include "cmakeparser.h" #include "cmakeprojectconstants.h" #include "cmakeprojectmanagertr.h" diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp similarity index 99% rename from src/plugins/cmakeprojectmanager/cmakekitinformation.cpp rename to src/plugins/cmakeprojectmanager/cmakekitaspect.cpp index 9861c0ff8d8..7554c4ba6b5 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2016 Canonical Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "cmakekitinformation.h" +#include "cmakekitaspect.h" #include "cmakeconfigitem.h" #include "cmakeprojectconstants.h" diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.h b/src/plugins/cmakeprojectmanager/cmakekitaspect.h similarity index 100% rename from src/plugins/cmakeprojectmanager/cmakekitinformation.h rename to src/plugins/cmakeprojectmanager/cmakekitaspect.h diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 0c7aa9c8209..f29ef14ac23 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -3,7 +3,7 @@ #include "cmakeproject.h" -#include "cmakekitinformation.h" +#include "cmakekitaspect.h" #include "cmakeprojectconstants.h" #include "cmakeprojectimporter.h" #include "cmakeprojectmanagertr.h" diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index bc3de03e720..a0480f65acd 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -4,7 +4,7 @@ #include "cmakeprojectimporter.h" #include "cmakebuildconfiguration.h" -#include "cmakekitinformation.h" +#include "cmakekitaspect.h" #include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "cmakeprojectmanagertr.h" diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 1913e994bf8..bff808bba27 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -4,7 +4,7 @@ #include "cmakeprojectmanager.h" #include "cmakebuildsystem.h" -#include "cmakekitinformation.h" +#include "cmakekitaspect.h" #include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "cmakeprojectmanagertr.h" diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs index a7ec2612281..96520f9127d 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs @@ -36,8 +36,8 @@ QtcPlugin { "cmakeformatter.h", "cmakeinstallstep.cpp", "cmakeinstallstep.h", - "cmakekitinformation.h", - "cmakekitinformation.cpp", + "cmakekitaspect.h", + "cmakekitaspect.cpp", "cmakelocatorfilter.cpp", "cmakelocatorfilter.h", "cmakeparser.cpp", diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index 226398fb4d9..cb60f26f0ad 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -9,7 +9,7 @@ #include "cmakeeditor.h" #include "cmakeformatter.h" #include "cmakeinstallstep.h" -#include "cmakekitinformation.h" +#include "cmakekitaspect.h" #include "cmakelocatorfilter.h" #include "cmakeproject.h" #include "cmakeprojectconstants.h" diff --git a/src/plugins/mcusupport/mcubuildstep.cpp b/src/plugins/mcusupport/mcubuildstep.cpp index 83e68c43ef3..f49c7a5209a 100644 --- a/src/plugins/mcusupport/mcubuildstep.cpp +++ b/src/plugins/mcusupport/mcubuildstep.cpp @@ -7,7 +7,7 @@ #include "mculegacyconstants.h" #include "mcusupportconstants.h" -#include <cmakeprojectmanager/cmakekitinformation.h> +#include <cmakeprojectmanager/cmakekitaspect.h> #include <projectexplorer/abstractprocessstep.h> #include <projectexplorer/buildsteplist.h> diff --git a/src/plugins/mcusupport/mcukitaspect.cpp b/src/plugins/mcusupport/mcukitaspect.cpp index e8cbda6c3d9..1cabd21d682 100644 --- a/src/plugins/mcusupport/mcukitaspect.cpp +++ b/src/plugins/mcusupport/mcukitaspect.cpp @@ -4,7 +4,7 @@ #include "mcukitaspect.h" #include "mcusupporttr.h" -#include <cmakeprojectmanager/cmakekitinformation.h> +#include <cmakeprojectmanager/cmakekitaspect.h> #include <utils/algorithm.h> #include <utils/filepath.h> diff --git a/src/plugins/mcusupport/mcukitmanager.cpp b/src/plugins/mcusupport/mcukitmanager.cpp index 22741158390..39e13f80892 100644 --- a/src/plugins/mcusupport/mcukitmanager.cpp +++ b/src/plugins/mcusupport/mcukitmanager.cpp @@ -14,7 +14,7 @@ #include "mcusupporttr.h" #include "mcutarget.h" -#include <cmakeprojectmanager/cmakekitinformation.h> +#include <cmakeprojectmanager/cmakekitaspect.h> #include <cmakeprojectmanager/cmaketoolmanager.h> #include <debugger/debuggeritem.h> diff --git a/src/plugins/mcusupport/mcusupportoptions.cpp b/src/plugins/mcusupport/mcusupportoptions.cpp index f77aff8a8e1..187591298cf 100644 --- a/src/plugins/mcusupport/mcusupportoptions.cpp +++ b/src/plugins/mcusupport/mcusupportoptions.cpp @@ -14,7 +14,7 @@ #include "mcutarget.h" #include "settingshandler.h" -#include <cmakeprojectmanager/cmakekitinformation.h> +#include <cmakeprojectmanager/cmakekitaspect.h> #include <cmakeprojectmanager/cmaketoolmanager.h> #include <coreplugin/helpmanager.h> #include <coreplugin/icore.h> diff --git a/src/plugins/mcusupport/mcusupportrunconfiguration.cpp b/src/plugins/mcusupport/mcusupportrunconfiguration.cpp index d428074dc8b..5b397801c8f 100644 --- a/src/plugins/mcusupport/mcusupportrunconfiguration.cpp +++ b/src/plugins/mcusupport/mcusupportrunconfiguration.cpp @@ -11,7 +11,7 @@ #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> -#include <cmakeprojectmanager/cmakekitinformation.h> +#include <cmakeprojectmanager/cmakekitaspect.h> #include <cmakeprojectmanager/cmaketool.h> #include <utils/aspects.h> diff --git a/src/plugins/mcusupport/test/unittest.cpp b/src/plugins/mcusupport/test/unittest.cpp index 54933ca3da6..4ac73b992a8 100644 --- a/src/plugins/mcusupport/test/unittest.cpp +++ b/src/plugins/mcusupport/test/unittest.cpp @@ -33,7 +33,7 @@ #include <baremetal/baremetalconstants.h> #include <cmakeprojectmanager/cmakeconfigitem.h> -#include <cmakeprojectmanager/cmakekitinformation.h> +#include <cmakeprojectmanager/cmakekitaspect.h> #include <gmock/gmock-actions.h> #include <gmock/gmock.h> From 2ff5293c4a5f3b906498af46125715180f652700 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 9 Aug 2023 13:29:53 +0200 Subject: [PATCH 0818/1777] Python: Workaround pylsp rename bug upstream bug report: https://github.com/python-lsp/python-lsp-server/issues/413 Fixes: QTCREATORBUG-29389 Change-Id: I5b122b5e5c245cb5c43c32da1296b2132a07a9aa Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/languageclient/languageclientutils.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/languageclient/languageclientutils.cpp b/src/plugins/languageclient/languageclientutils.cpp index 06ed8dcae65..19cd740506b 100644 --- a/src/plugins/languageclient/languageclientutils.cpp +++ b/src/plugins/languageclient/languageclientutils.cpp @@ -44,9 +44,17 @@ QTextCursor rangeToTextCursor(const Range &range, QTextDocument *doc) ChangeSet::Range convertRange(const QTextDocument *doc, const Range &range) { - return ChangeSet::Range( - Text::positionInText(doc, range.start().line() + 1, range.start().character() + 1), - Text::positionInText(doc, range.end().line() + 1, range.end().character()) + 1); + int start = range.start().toPositionInDocument(doc); + int end = range.end().toPositionInDocument(doc); + // This addesses an issue from the python language server where the reported end line + // was behind the actual end of the document. As a workaround treat every position after + // the end of the document as the end of the document. + if (end < 0 && range.end().line() >= doc->blockCount()) { + QTextCursor tc(doc->firstBlock()); + tc.movePosition(QTextCursor::End); + end = tc.position(); + } + return ChangeSet::Range(start, end); } ChangeSet editsToChangeSet(const QList<TextEdit> &edits, const QTextDocument *doc) From 8f9e75a3b89f61995d233ebf4a062b796ebb2317 Mon Sep 17 00:00:00 2001 From: Andreas Loth <andreas.loth@qt.io> Date: Tue, 25 Jul 2023 18:48:18 +0200 Subject: [PATCH 0819/1777] Axivion: Use DTO for ProjectInfo deserialization This is a proof of concept that the DTOs can be used to deserialize and access the data the Axivion Dashboard returns. In future, this is going to replace all manual deserialization and manually written Dashboard interface classes. Change-Id: Ic3c997f6aca7fcb179cd19fa9b5107fe7d4dec03 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/axivion/axivionoutputpane.cpp | 90 +++++++---- src/plugins/axivion/axivionplugin.cpp | 35 ++--- src/plugins/axivion/axivionplugin.h | 6 +- src/plugins/axivion/axivionresultparser.cpp | 159 ++------------------ src/plugins/axivion/axivionresultparser.h | 49 +----- 5 files changed, 98 insertions(+), 241 deletions(-) diff --git a/src/plugins/axivion/axivionoutputpane.cpp b/src/plugins/axivion/axivionoutputpane.cpp index c2443223cdd..4e8326da0b5 100644 --- a/src/plugins/axivion/axivionoutputpane.cpp +++ b/src/plugins/axivion/axivionoutputpane.cpp @@ -4,8 +4,8 @@ #include "axivionoutputpane.h" #include "axivionplugin.h" -#include "axivionresultparser.h" #include "axiviontr.h" +#include "dashboard/dto.h" #include <utils/qtcassert.h> #include <utils/utilsicons.h> @@ -18,6 +18,9 @@ #include <QTextBrowser> #include <QToolButton> +#include <map> +#include <memory> + namespace Axivion::Internal { class DashboardWidget : public QScrollArea @@ -58,7 +61,7 @@ DashboardWidget::DashboardWidget(QWidget *parent) setWidgetResizable(true); } -static QPixmap trendIcon(int added, int removed) +static QPixmap trendIcon(qint64 added, qint64 removed) { static const QPixmap unchanged = Utils::Icons::NEXT.pixmap(); static const QPixmap increased = Utils::Icon( @@ -70,10 +73,20 @@ static QPixmap trendIcon(int added, int removed) return added < removed ? decreased : increased; } +static qint64 extract_value(const std::map<QString, Dto::Any> &map, const QString &key) +{ + const auto search = map.find(key); + if (search == map.end()) + return 0; + const Dto::Any &value = search->second; + if (!value.isDouble()) + return 0; + return static_cast<qint64>(value.getDouble()); +} + void DashboardWidget::updateUi() { - const ProjectInfo &info = AxivionPlugin::projectInfo(); - m_project->setText(info.name); + m_project->setText({}); m_loc->setText({}); m_timestamp->setText({}); QLayoutItem *child; @@ -81,60 +94,77 @@ void DashboardWidget::updateUi() delete child->widget(); delete child; } - - if (info.versions.isEmpty()) + std::shared_ptr<const Dto::ProjectInfoDto> info = AxivionPlugin::projectInfo(); + if (!info) + return; + m_project->setText(info->name); + if (info->versions.empty()) return; - const ResultVersion &last = info.versions.last(); - m_loc->setText(QString::number(last.linesOfCode)); - const QDateTime timeStamp = QDateTime::fromString(last.timeStamp, Qt::ISODate); - m_timestamp->setText(timeStamp.isValid() ? timeStamp.toString("yyyy-MM-dd HH:mm:ss") + const Dto::AnalysisVersionDto &last = info->versions.back(); + if (last.linesOfCode.has_value()) + m_loc->setText(QString::number(last.linesOfCode.value())); + const QDateTime timeStamp = QDateTime::fromString(last.date, Qt::ISODate); + m_timestamp->setText(timeStamp.isValid() ? timeStamp.toString("yyyy-MM-dd HH:mm:ss t") : Tr::tr("unknown")); - const QList<IssueKind> &issueKinds = info.issueKinds; + const std::vector<Dto::IssueKindInfoDto> &issueKinds = info->issueKinds; auto toolTip = [issueKinds](const QString &prefix){ - for (const IssueKind &kind : issueKinds) { + for (const Dto::IssueKindInfoDto &kind : issueKinds) { if (kind.prefix == prefix) - return kind.nicePlural; + return kind.nicePluralName; } return prefix; }; - auto addValuesWidgets = [this, &toolTip](const IssueCount &issueCount, int row){ - const QString currentToolTip = toolTip(issueCount.issueKind); - QLabel *label = new QLabel(issueCount.issueKind, this); + auto addValuesWidgets = [this, &toolTip](const QString &issueKind, qint64 total, qint64 added, qint64 removed, int row) { + const QString currentToolTip = toolTip(issueKind); + QLabel *label = new QLabel(issueKind, this); label->setToolTip(currentToolTip); m_gridLayout->addWidget(label, row, 0); - label = new QLabel(QString::number(issueCount.total), this); + label = new QLabel(QString::number(total), this); label->setToolTip(currentToolTip); label->setAlignment(Qt::AlignRight); m_gridLayout->addWidget(label, row, 1); label = new QLabel(this); - label->setPixmap(trendIcon(issueCount.added, issueCount.removed)); + label->setPixmap(trendIcon(added, removed)); label->setToolTip(currentToolTip); m_gridLayout->addWidget(label, row, 2); - label = new QLabel('+' + QString::number(issueCount.added)); + label = new QLabel('+' + QString::number(added)); label->setAlignment(Qt::AlignRight); label->setToolTip(currentToolTip); m_gridLayout->addWidget(label, row, 3); label = new QLabel("/"); label->setToolTip(currentToolTip); m_gridLayout->addWidget(label, row, 4); - label = new QLabel('-' + QString::number(issueCount.removed)); + label = new QLabel('-' + QString::number(removed)); label->setAlignment(Qt::AlignRight); label->setToolTip(currentToolTip); m_gridLayout->addWidget(label, row, 5); }; - int allTotal = 0, allAdded = 0, allRemoved = 0, row = 0; - for (auto issueCount : std::as_const(last.issueCounts)) { - allTotal += issueCount.total; - allAdded += issueCount.added; - allRemoved += issueCount.removed; - addValuesWidgets(issueCount, row); - ++row; + qint64 allTotal = 0; + qint64 allAdded = 0; + qint64 allRemoved = 0; + qint64 row = 0; + // This code is overly complex because of a heedlessness in the + // Axivion Dashboard API definition. Other Axivion IDE plugins do + // not use the issue counts, thus the QtCreator Axivion Plugin + // is going to stop using them, too. + if (last.issueCounts.isMap()) { + for (const auto &issueCount : last.issueCounts.getMap()) { + if (issueCount.second.isMap()) { + const auto &counts = issueCount.second.getMap(); + qint64 total = extract_value(counts, QStringLiteral(u"Total")); + allTotal += total; + qint64 added = extract_value(counts, QStringLiteral(u"Added")); + allAdded += added; + qint64 removed = extract_value(counts, QStringLiteral(u"Removed")); + allRemoved += removed; + addValuesWidgets(issueCount.first, total, added, removed, row); + ++row; + } + } } - - const IssueCount total{{}, Tr::tr("Total:"), allTotal, allAdded, allRemoved}; - addValuesWidgets(total, row); + addValuesWidgets(Tr::tr("Total:"), allTotal, allAdded, allRemoved, row); } AxivionOutputPane::AxivionOutputPane(QObject *parent) diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index ef253e9c0d5..3d89c8ba957 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -8,6 +8,7 @@ #include "axivionquery.h" #include "axivionresultparser.h" #include "axiviontr.h" +#include "dashboard/dto.h" #include <coreplugin/editormanager/documentmodel.h> #include <coreplugin/editormanager/editormanager.h> @@ -24,12 +25,16 @@ #include <texteditor/texteditor.h> #include <texteditor/textmark.h> +#include <utils/expected.h> #include <utils/qtcassert.h> #include <utils/utilsicons.h> #include <QAction> #include <QTimer> +#include <exception> +#include <memory> + constexpr char AxivionTextMarkId[] = "AxivionTextMark"; namespace Axivion::Internal { @@ -39,7 +44,7 @@ class AxivionPluginPrivate : public QObject public: void onStartupProjectChanged(); void fetchProjectInfo(const QString &projectName); - void handleProjectInfo(const ProjectInfo &info); + void handleProjectInfo(const QByteArray &result); void handleOpenedDocs(ProjectExplorer::Project *project); void onDocumentOpened(Core::IDocument *doc); void onDocumentClosed(Core::IDocument * doc); @@ -48,7 +53,7 @@ public: void fetchRuleInfo(const QString &id); AxivionOutputPane m_axivionOutputPane; - ProjectInfo m_currentProjectInfo; + std::shared_ptr<const Dto::ProjectInfoDto> m_currentProjectInfo; bool m_runningQuery = false; }; @@ -113,7 +118,7 @@ void AxivionPlugin::fetchProjectInfo(const QString &projectName) dd->fetchProjectInfo(projectName); } -ProjectInfo AxivionPlugin::projectInfo() +std::shared_ptr<const Dto::ProjectInfoDto> AxivionPlugin::projectInfo() { QTC_ASSERT(dd, return {}); return dd->m_currentProjectInfo; @@ -124,7 +129,7 @@ void AxivionPluginPrivate::onStartupProjectChanged() ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject(); if (!project) { clearAllMarks(); - m_currentProjectInfo = ProjectInfo(); + m_currentProjectInfo = {}; m_axivionOutputPane.updateDashboard(); return; } @@ -141,7 +146,7 @@ void AxivionPluginPrivate::fetchProjectInfo(const QString &projectName) } clearAllMarks(); if (projectName.isEmpty()) { - m_currentProjectInfo = ProjectInfo(); + m_currentProjectInfo = {}; m_axivionOutputPane.updateDashboard(); return; } @@ -150,7 +155,7 @@ void AxivionPluginPrivate::fetchProjectInfo(const QString &projectName) AxivionQuery query(AxivionQuery::ProjectInfo, {projectName}); AxivionQueryRunner *runner = new AxivionQueryRunner(query, this); connect(runner, &AxivionQueryRunner::resultRetrieved, this, [this](const QByteArray &result){ - handleProjectInfo(ResultParser::parseProjectInfo(result)); + handleProjectInfo(result); }); connect(runner, &AxivionQueryRunner::finished, [runner]{ runner->deleteLater(); }); runner->start(); @@ -196,20 +201,16 @@ void AxivionPluginPrivate::clearAllMarks() onDocumentClosed(doc); } -void AxivionPluginPrivate::handleProjectInfo(const ProjectInfo &info) +void AxivionPluginPrivate::handleProjectInfo(const QByteArray &result) { + Utils::expected_str<Dto::ProjectInfoDto> raw_info = ResultParser::parseProjectInfo(result); m_runningQuery = false; - if (!info.error.isEmpty()) { - Core::MessageManager::writeFlashing("Axivion: " + info.error); + if (!raw_info) { + Core::MessageManager::writeFlashing(QStringLiteral(u"Axivion: ") + raw_info.error()); return; } - - m_currentProjectInfo = info; + m_currentProjectInfo = std::make_shared<const Dto::ProjectInfoDto>(std::move(raw_info.value())); m_axivionOutputPane.updateDashboard(); - - if (m_currentProjectInfo.name.isEmpty()) - return; - // handle already opened documents if (auto buildSystem = ProjectExplorer::ProjectManager::startupBuildSystem(); !buildSystem || !buildSystem->isParsing()) { @@ -223,7 +224,7 @@ void AxivionPluginPrivate::handleProjectInfo(const ProjectInfo &info) void AxivionPluginPrivate::onDocumentOpened(Core::IDocument *doc) { - if (m_currentProjectInfo.name.isEmpty()) // we do not have a project info (yet) + if (!m_currentProjectInfo) // we do not have a project info (yet) return; ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject(); @@ -232,7 +233,7 @@ void AxivionPluginPrivate::onDocumentOpened(Core::IDocument *doc) Utils::FilePath relative = doc->filePath().relativeChildPath(project->projectDirectory()); // for now only style violations - AxivionQuery query(AxivionQuery::IssuesForFileList, {m_currentProjectInfo.name, "SV", + AxivionQuery query(AxivionQuery::IssuesForFileList, {m_currentProjectInfo->name, "SV", relative.path() } ); AxivionQueryRunner *runner = new AxivionQueryRunner(query, this); connect(runner, &AxivionQueryRunner::resultRetrieved, this, [this](const QByteArray &result){ diff --git a/src/plugins/axivion/axivionplugin.h b/src/plugins/axivion/axivionplugin.h index 9d71366fc45..ff235d393ce 100644 --- a/src/plugins/axivion/axivionplugin.h +++ b/src/plugins/axivion/axivionplugin.h @@ -3,8 +3,12 @@ #pragma once +#include "dashboard/dto.h" + #include <extensionsystem/iplugin.h> +#include <memory> + namespace ProjectExplorer { class Project; } namespace Axivion::Internal { @@ -22,7 +26,7 @@ public: ~AxivionPlugin() final; static void fetchProjectInfo(const QString &projectName); - static ProjectInfo projectInfo(); + static std::shared_ptr<const Dto::ProjectInfoDto> projectInfo(); private: void initialize() final; diff --git a/src/plugins/axivion/axivionresultparser.cpp b/src/plugins/axivion/axivionresultparser.cpp index 0d8bb27b7db..81ae9787170 100644 --- a/src/plugins/axivion/axivionresultparser.cpp +++ b/src/plugins/axivion/axivionresultparser.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "axivionresultparser.h" +#include "dashboard/dto.h" #include <utils/qtcassert.h> @@ -10,6 +11,7 @@ #include <QJsonObject> #include <QRegularExpression> +#include <stdexcept> #include <utility> namespace Axivion::Internal { @@ -79,124 +81,6 @@ static std::pair<BaseResult, QJsonDocument> prehandleHeaderAndBody(const QByteAr return {result, doc}; } -static User::UserType userTypeForString(const QString &type) -{ - if (type == "DASHBOARD_USER") - return User::Dashboard; - if (type == "VIRTUAL_USER") - return User::Virtual; - return User::Unknown; -} - -static User userFromJson(const QJsonObject &object) -{ - User result; - if (object.isEmpty()) { - result.error = "Not a user object."; - return result; - } - result.name = object.value("name").toString(); - result.displayName = object.value("displayName").toString(); - result.type = userTypeForString(object.value("type").toString()); - return result; -} - -static QList<User> usersFromJson(const QJsonArray &array) -{ - QList<User> result; - for (const QJsonValue &value : array) { - User user = userFromJson(value.toObject()); - if (!user.error.isEmpty()) // add this error to result.error? - continue; - result.append(user); - } - return result; -} - -static IssueCount issueCountFromJson(const QJsonObject &object) -{ - IssueCount result; - if (object.isEmpty()) { - result.error = "Not an issue count object."; - return result; - } - result.added = object.value("Added").toInt(); - result.removed = object.value("Removed").toInt(); - result.total = object.value("Total").toInt(); - return result; -} - -static QList<IssueCount> issueCountsFromJson(const QJsonObject &object) -{ - QList<IssueCount> result; - - const QStringList keys = object.keys(); - for (const QString &k : keys) { - IssueCount issue = issueCountFromJson(object.value(k).toObject()); - if (!issue.error.isEmpty()) // add this error to result.error? - continue; - issue.issueKind = k; - result.append(issue); - } - return result; -} - -static ResultVersion versionFromJson(const QJsonObject &object) -{ - ResultVersion result; - if (object.isEmpty()) { - result.error = "Not a version object."; - return result; - } - const QJsonValue issuesValue = object.value("issueCounts"); - if (!issuesValue.isObject()) { - result.error = "Not an object (issueCounts)."; - return result; - } - result.issueCounts = issueCountsFromJson(issuesValue.toObject()); - result.timeStamp = object.value("date").toString(); - result.name = object.value("name").toString(); - result.linesOfCode = object.value("linesOfCode").toInt(); - return result; -} - -static QList<ResultVersion> versionsFromJson(const QJsonArray &array) -{ - QList<ResultVersion> result; - for (const QJsonValue &value : array) { - ResultVersion version = versionFromJson(value.toObject()); - if (!version.error.isEmpty()) // add this error to result.error? - continue; - result.append(version); - } - return result; -} - -static IssueKind issueKindFromJson(const QJsonObject &object) -{ - IssueKind result; - if (object.isEmpty()) { - result.error = "Not an issue kind object."; - return result; - } - result.prefix = object.value("prefix").toString(); - result.niceSingular = object.value("niceSingularName").toString(); - result.nicePlural = object.value("nicePluralName").toString(); - return result; -} - -static QList<IssueKind> issueKindsFromJson(const QJsonArray &array) -{ - QList<IssueKind> result; - for (const QJsonValue &value : array) { - IssueKind kind = issueKindFromJson(value.toObject()); - if (!kind.error.isEmpty()) // add this error to result.error? - continue; - result.append(kind); - } - return result; -} - namespace ResultParser { DashboardInfo parseDashboardInfo(const QByteArray &input) @@ -236,41 +120,18 @@ DashboardInfo parseDashboardInfo(const QByteArray &input) return result; } -ProjectInfo parseProjectInfo(const QByteArray &input) +Utils::expected_str<Dto::ProjectInfoDto> parseProjectInfo(const QByteArray &input) { - ProjectInfo result; - auto [header, body] = splitHeaderAndBody(input); auto [error, doc] = prehandleHeaderAndBody(header, body); - if (!error.error.isEmpty()) { - result.error = error.error; - return result; + if (!error.error.isEmpty()) + return tl::make_unexpected(std::move(error.error)); + try + { + return { Dto::ProjectInfoDto::deserialize(body) }; + } catch (const Dto::invalid_dto_exception &e) { + return tl::make_unexpected(QString::fromUtf8(e.what())); } - - const QJsonObject object = doc.object(); - result.name = object.value("name").toString(); - - const QJsonValue usersValue = object.value("users"); - if (!usersValue.isArray()) { - result.error = "Malformed json response (users)."; - return result; - } - result.users = usersFromJson(usersValue.toArray()); - - const QJsonValue versionsValue = object.value("versions"); - if (!versionsValue.isArray()) { - result.error = "Malformed json response (versions)."; - return result; - } - result.versions = versionsFromJson(versionsValue.toArray()); - - const QJsonValue issueKindsValue = object.value("issueKinds"); - if (!issueKindsValue.isArray()) { - result.error = "Malformed json response (issueKinds)."; - return result; - } - result.issueKinds = issueKindsFromJson(issueKindsValue.toArray()); - return result; } static QRegularExpression issueCsvLineRegex(const QByteArray &firstCsvLine) diff --git a/src/plugins/axivion/axivionresultparser.h b/src/plugins/axivion/axivionresultparser.h index 84c5a6b8ca8..d8d4a39a72c 100644 --- a/src/plugins/axivion/axivionresultparser.h +++ b/src/plugins/axivion/axivionresultparser.h @@ -3,6 +3,10 @@ #pragma once +#include "dashboard/dto.h" + +#include <utils/expected.h> + #include <QList> namespace Axivion::Internal { @@ -27,49 +31,6 @@ public: QList<Project> projects; }; -class User : public BaseResult -{ -public: - QString name; - QString displayName; - enum UserType { Dashboard, Virtual, Unknown } type; -}; - -class IssueKind : public BaseResult -{ -public: - QString prefix; - QString niceSingular; - QString nicePlural; -}; - -class IssueCount : public BaseResult -{ -public: - QString issueKind; - int total = 0; - int added = 0; - int removed = 0; -}; - -class ResultVersion : public BaseResult -{ -public: - QString name; - QString timeStamp; - QList<IssueCount> issueCounts; - int linesOfCode = 0; -}; - -class ProjectInfo : public BaseResult -{ -public: - QString name; - QList<User> users; - QList<ResultVersion> versions; - QList<IssueKind> issueKinds; -}; - class ShortIssue : public BaseResult { public: @@ -92,7 +53,7 @@ public: namespace ResultParser { DashboardInfo parseDashboardInfo(const QByteArray &input); -ProjectInfo parseProjectInfo(const QByteArray &input); +Utils::expected_str<Dto::ProjectInfoDto> parseProjectInfo(const QByteArray &input); IssuesList parseIssuesList(const QByteArray &input); QString parseRuleInfo(const QByteArray &input); From e6b8791fa9ee3c0d4e4fd865da5f86ca21dfab12 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Mon, 21 Aug 2023 15:18:55 +0200 Subject: [PATCH 0820/1777] LanguageClient: correctly cancel running rename request When requesting rename results while we have not received the response to the previous rename request, we have to cancel that previous request otherwise we end up with duplicated replace operations that potentially can invalidate the document. Task-number: QTCREATORBUG-29389 Change-Id: I3be425b8306c18b64fca7bb71bf65c32ae50fed1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../languageclient/languageclientsymbolsupport.cpp | 10 +++++++--- .../languageclient/languageclientsymbolsupport.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/languageclient/languageclientsymbolsupport.cpp b/src/plugins/languageclient/languageclientsymbolsupport.cpp index 546ad068e4b..822d910ecf3 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.cpp +++ b/src/plugins/languageclient/languageclientsymbolsupport.cpp @@ -452,21 +452,24 @@ void SymbolSupport::requestPrepareRename(TextEditor::TextDocument *document, void SymbolSupport::requestRename(const TextDocumentPositionParams &positionParams, Core::SearchResult *search) { + if (m_renameRequestIds[search].isValid()) + m_client->cancelRequest(m_renameRequestIds[search]); RenameParams params(positionParams); params.setNewName(search->textToReplace()); RenameRequest request(params); request.setResponseCallback([this, search](const RenameRequest::Response &response) { handleRenameResponse(search, response); }); + m_renameRequestIds[search] = request.id(); m_client->sendMessage(request); if (search->isInteractive()) search->popup(); } Utils::SearchResultItems generateReplaceItems(const WorkspaceEdit &edits, - Core::SearchResult *search, - bool limitToProjects, - const DocumentUri::PathMapper &pathMapper) + Core::SearchResult *search, + bool limitToProjects, + const DocumentUri::PathMapper &pathMapper) { auto convertEdits = [](const QList<TextEdit> &edits) { return Utils::transform(edits, [](const TextEdit &edit) { @@ -546,6 +549,7 @@ void SymbolSupport::startRenameSymbol(const TextDocumentPositionParams &position void SymbolSupport::handleRenameResponse(Core::SearchResult *search, const RenameRequest::Response &response) { + m_renameRequestIds.remove(search); const std::optional<PrepareRenameRequest::Response::Error> &error = response.error(); QString errorMessage; if (error.has_value()) { diff --git a/src/plugins/languageclient/languageclientsymbolsupport.h b/src/plugins/languageclient/languageclientsymbolsupport.h index 3dcc7b0ddc3..a46ac4273a3 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.h +++ b/src/plugins/languageclient/languageclientsymbolsupport.h @@ -78,6 +78,7 @@ private: Client *m_client = nullptr; SymbolMapper m_defaultSymbolMapper; + QHash<Core::SearchResult *, LanguageServerProtocol::MessageId> m_renameRequestIds; bool m_limitRenamingToProjects = false; }; From 46e97ad08d9b7295b96edd9a19c6bb6703b58577 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 21 Aug 2023 17:10:56 +0200 Subject: [PATCH 0821/1777] ProjectExplorer: Always access kit aspects according to priority Change-Id: Ia2f95614ccaceca22702df1f16e21bdd900a75f2 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/kitmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index a147dd7f252..30a70abfbe7 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -567,7 +567,7 @@ Kit *KitManager::defaultKit() const QList<KitAspectFactory *> KitManager::kitAspectFactories() { - return kitAspectFactoriesStorage().m_aspectList; + return kitAspectFactoriesStorage().kitAspectFactories(); } const QSet<Id> KitManager::irrelevantAspects() From 6b82b29e23a068ac0c8425749ecb2885542d9a41 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 21 Aug 2023 17:06:04 +0200 Subject: [PATCH 0822/1777] ProjectExplorer: Down-prioritize SysRootKitAspect It's mostly used in connection with the debugger, so put it afterwards. Change-Id: I6351b4c3db34e1b740c444c04205544ea88b8e8a Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/projectexplorer/kitaspects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/kitaspects.cpp b/src/plugins/projectexplorer/kitaspects.cpp index f1f3365499e..5b3d49195d4 100644 --- a/src/plugins/projectexplorer/kitaspects.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -105,7 +105,7 @@ SysRootKitAspectFactory::SysRootKitAspectFactory() setDisplayName(Tr::tr("Sysroot")); setDescription(Tr::tr("The root directory of the system image to use.<br>" "Leave empty when building for the desktop.")); - setPriority(31000); + setPriority(27000); } Tasks SysRootKitAspectFactory::validate(const Kit *k) const From a066a0d290f2e48d67dba2e4ac3600a0cb65bcde Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Mon, 21 Aug 2023 15:55:44 +0200 Subject: [PATCH 0823/1777] LanguageClient: Fix ConfigurationItem scopeUri type 'scopeUri' should contain a DocumentUri and not a QString according to the protocol (https://microsoft.github.io/language-server-protocol/ specifications/lsp/3.17/specification/#configurationItem). Change-Id: Ibdec5f22cdce4dc1b5e3e0ef264cdc0458c124f1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/languageserverprotocol/workspace.cpp | 7 +++++++ src/libs/languageserverprotocol/workspace.h | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libs/languageserverprotocol/workspace.cpp b/src/libs/languageserverprotocol/workspace.cpp index c9d2aeb4130..2d49be2d5ff 100644 --- a/src/libs/languageserverprotocol/workspace.cpp +++ b/src/libs/languageserverprotocol/workspace.cpp @@ -72,4 +72,11 @@ LanguageServerProtocol::WorkSpaceFolderResult::operator const QJsonValue() const return array; } +std::optional<DocumentUri> ConfigurationParams::ConfigurationItem::scopeUri() const +{ + if (const std::optional<QString> optionalScope = optionalValue<QString>(scopeUriKey)) + return std::make_optional(DocumentUri::fromProtocol(*optionalScope)); + return std::nullopt; +} + } // namespace LanguageServerProtocol diff --git a/src/libs/languageserverprotocol/workspace.h b/src/libs/languageserverprotocol/workspace.h index f99dded8386..69c3ef9bd4f 100644 --- a/src/libs/languageserverprotocol/workspace.h +++ b/src/libs/languageserverprotocol/workspace.h @@ -92,8 +92,8 @@ public: public: using JsonObject::JsonObject; - std::optional<QString> scopeUri() const { return optionalValue<QString>(scopeUriKey); } - void setScopeUri(const QString &scopeUri) { insert(scopeUriKey, scopeUri); } + std::optional<DocumentUri> scopeUri() const; + void setScopeUri(const DocumentUri &scopeUri) { insert(scopeUriKey, scopeUri); } void clearScopeUri() { remove(scopeUriKey); } std::optional<QString> section() const { return optionalValue<QString>(sectionKey); } From 0a83f33bad9f3cc3c594fc97275a646afeca5696 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 22 Aug 2023 08:00:02 +0200 Subject: [PATCH 0824/1777] CMakePM: Remove unused include path Change-Id: Id48ea93a1b9728c7cd68cfa3f52620a799909371 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/CMakeLists.txt b/src/plugins/cmakeprojectmanager/CMakeLists.txt index a7493597492..679102c922b 100644 --- a/src/plugins/cmakeprojectmanager/CMakeLists.txt +++ b/src/plugins/cmakeprojectmanager/CMakeLists.txt @@ -2,7 +2,6 @@ add_qtc_plugin(CMakeProjectManager PLUGIN_CLASS CMakeProjectPlugin DEPENDS QmlJS PLUGIN_DEPENDS Core CppEditor ProjectExplorer TextEditor QtSupport - INCLUDES 3dparty/cmake SOURCES builddirparameters.cpp builddirparameters.h cmake_global.h From effcc0d4719c6dec8dfce38262578b2600da6401 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 18 Aug 2023 17:45:29 +0200 Subject: [PATCH 0825/1777] Project: Inline kitmodel.{h,cpp} into kitoptionspage.cpp The only user. Change-Id: I4fea0752c68b70eb1fe6d9db561d70830b6174aa Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/projectexplorer/CMakeLists.txt | 1 - src/plugins/projectexplorer/kitmodel.cpp | 399 ---------------- src/plugins/projectexplorer/kitmodel.h | 82 ---- .../projectexplorer/kitoptionspage.cpp | 442 +++++++++++++++++- .../projectexplorer/projectexplorer.qbs | 1 - 5 files changed, 436 insertions(+), 489 deletions(-) delete mode 100644 src/plugins/projectexplorer/kitmodel.cpp delete mode 100644 src/plugins/projectexplorer/kitmodel.h diff --git a/src/plugins/projectexplorer/CMakeLists.txt b/src/plugins/projectexplorer/CMakeLists.txt index 1d092e28fd4..26c7d39d70a 100644 --- a/src/plugins/projectexplorer/CMakeLists.txt +++ b/src/plugins/projectexplorer/CMakeLists.txt @@ -108,7 +108,6 @@ add_qtc_plugin(ProjectExplorer kitfeatureprovider.h kitmanager.cpp kitmanager.h kitmanagerconfigwidget.cpp kitmanagerconfigwidget.h - kitmodel.cpp kitmodel.h kitoptionspage.cpp kitoptionspage.h ldparser.cpp ldparser.h lldparser.cpp lldparser.h diff --git a/src/plugins/projectexplorer/kitmodel.cpp b/src/plugins/projectexplorer/kitmodel.cpp deleted file mode 100644 index 38ce4a576b2..00000000000 --- a/src/plugins/projectexplorer/kitmodel.cpp +++ /dev/null @@ -1,399 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "kitmodel.h" - -#include "kit.h" -#include "kitmanagerconfigwidget.h" -#include "kitmanager.h" -#include "projectexplorerconstants.h" -#include "projectexplorertr.h" - -#include <utils/algorithm.h> -#include <utils/qtcassert.h> -#include <utils/utilsicons.h> - -#include <QApplication> -#include <QBoxLayout> - -using namespace Utils; - -namespace ProjectExplorer { -namespace Internal { - -class KitNode : public TreeItem -{ -public: - KitNode(Kit *k, KitModel *m, QBoxLayout *parentLayout) - : m_kit(k), m_model(m), m_parentLayout(parentLayout) - {} - - ~KitNode() override { delete m_widget; } - - Kit *kit() const { return m_kit; } - - QVariant data(int, int role) const override - { - if (role == Qt::FontRole) { - QFont f = QApplication::font(); - if (isDirty()) - f.setBold(!f.bold()); - if (isDefaultKit()) - f.setItalic(f.style() != QFont::StyleItalic); - return f; - } - if (role == Qt::DisplayRole) { - QString baseName = displayName(); - if (isDefaultKit()) - //: Mark up a kit as the default one. - baseName = Tr::tr("%1 (default)").arg(baseName); - return baseName; - } - - if (role == Qt::DecorationRole) - return displayIcon(); - - if (role == Qt::ToolTipRole) - return widget()->validityMessage(); - - return {}; - } - - bool isDirty() const - { - if (m_widget) - return m_widget->isDirty(); - return false; - } - - QIcon displayIcon() const - { - if (m_widget) - return m_widget->displayIcon(); - QTC_ASSERT(m_kit, return {}); - return m_kit->displayIcon(); - } - - QString displayName() const - { - if (m_widget) - return m_widget->displayName(); - QTC_ASSERT(m_kit, return {}); - return m_kit->displayName(); - } - - bool isDefaultKit() const - { - return m_isDefaultKit; - } - - bool isRegistering() const - { - if (m_widget) - return m_widget->isRegistering(); - return false; - } - - void setIsDefaultKit(bool on) - { - if (m_isDefaultKit == on) - return; - m_isDefaultKit = on; - if (m_widget) - emit m_widget->dirty(); - } - - KitManagerConfigWidget *widget() const - { - const_cast<KitNode *>(this)->ensureWidget(); - return m_widget; - } - - void setHasUniqueName(bool on) - { - m_hasUniqueName = on; - } - -private: - void ensureWidget() - { - if (m_widget) - return; - - m_widget = new KitManagerConfigWidget(m_kit, m_isDefaultKit, m_hasUniqueName); - - QObject::connect(m_widget, &KitManagerConfigWidget::dirty, m_model, [this] { update(); }); - - QObject::connect(m_widget, &KitManagerConfigWidget::isAutoDetectedChanged, m_model, [this] { - TreeItem *oldParent = parent(); - TreeItem *newParent = - m_model->rootItem()->childAt(m_widget->workingCopy()->isAutoDetected() ? 0 : 1); - if (oldParent && oldParent != newParent) { - m_model->takeItem(this); - newParent->appendChild(this); - } - }); - m_parentLayout->addWidget(m_widget); - } - - Kit *m_kit = m_kit; - KitModel *m_model = nullptr; - KitManagerConfigWidget *m_widget = nullptr; - QBoxLayout *m_parentLayout = nullptr; - bool m_isDefaultKit = false; - bool m_hasUniqueName = true; -}; - -// -------------------------------------------------------------------------- -// KitModel -// -------------------------------------------------------------------------- - -KitModel::KitModel(QBoxLayout *parentLayout, QObject *parent) - : TreeModel<TreeItem, TreeItem, KitNode>(parent), - m_parentLayout(parentLayout) -{ - setHeader(QStringList(Tr::tr("Name"))); - m_autoRoot = new StaticTreeItem({ProjectExplorer::Constants::msgAutoDetected()}, - {ProjectExplorer::Constants::msgAutoDetectedToolTip()}); - m_manualRoot = new StaticTreeItem(ProjectExplorer::Constants::msgManual()); - rootItem()->appendChild(m_autoRoot); - rootItem()->appendChild(m_manualRoot); - - for (Kit *k : KitManager::sortedKits()) - addKit(k); - - changeDefaultKit(); - - connect(KitManager::instance(), &KitManager::kitAdded, - this, &KitModel::addKit); - connect(KitManager::instance(), &KitManager::kitUpdated, - this, &KitModel::updateKit); - connect(KitManager::instance(), &KitManager::unmanagedKitUpdated, - this, &KitModel::updateKit); - connect(KitManager::instance(), &KitManager::kitRemoved, - this, &KitModel::removeKit); - connect(KitManager::instance(), &KitManager::defaultkitChanged, - this, &KitModel::changeDefaultKit); -} - -Kit *KitModel::kit(const QModelIndex &index) -{ - KitNode *n = kitNode(index); - return n ? n->widget()->workingCopy() : nullptr; -} - -KitNode *KitModel::kitNode(const QModelIndex &index) -{ - TreeItem *n = itemForIndex(index); - return (n && n->level() == 2) ? static_cast<KitNode *>(n) : nullptr; -} - -QModelIndex KitModel::indexOf(Id kitId) const -{ - KitNode *n = findItemAtLevel<2>([kitId](KitNode *n) { return n->kit()->id() == kitId; }); - return n ? indexForItem(n) : QModelIndex(); -} - -QModelIndex KitModel::indexOf(Kit *k) const -{ - KitNode *n = findWorkingCopy(k); - return n ? indexForItem(n) : QModelIndex(); -} - -void KitModel::setDefaultKit(const QModelIndex &index) -{ - if (KitNode *n = kitNode(index)) - setDefaultNode(n); -} - -bool KitModel::isDefaultKit(Kit *k) const -{ - return m_defaultNode && m_defaultNode->widget()->workingCopy() == k; -} - -KitManagerConfigWidget *KitModel::widget(const QModelIndex &index) -{ - KitNode *n = kitNode(index); - return n ? n->widget() : nullptr; -} - -void KitModel::validateKitNames() -{ - QHash<QString, int> nameHash; - forItemsAtLevel<2>([&nameHash](KitNode *n) { - const QString displayName = n->displayName(); - if (nameHash.contains(displayName)) - ++nameHash[displayName]; - else - nameHash.insert(displayName, 1); - }); - - forItemsAtLevel<2>([&nameHash](KitNode *n) { - const QString displayName = n->displayName(); - n->setHasUniqueName(nameHash.value(displayName) == 1); - }); -} - -void KitModel::apply() -{ - // Add/update dirty nodes before removing kits. This ensures the right kit ends up as default. - forItemsAtLevel<2>([](KitNode *n) { - if (n->isDirty()) { - n->widget()->apply(); - n->update(); - } - }); - - // Remove unused kits: - const QList<KitNode *> removeList = m_toRemoveList; - for (KitNode *n : removeList) - KitManager::deregisterKit(n->kit()); - - emit layoutChanged(); // Force update. -} - -void KitModel::markForRemoval(Kit *k) -{ - KitNode *node = findWorkingCopy(k); - if (!node) - return; - - if (node == m_defaultNode) { - TreeItem *newDefault = m_autoRoot->firstChild(); - if (!newDefault) - newDefault = m_manualRoot->firstChild(); - setDefaultNode(static_cast<KitNode *>(newDefault)); - } - - if (node == m_defaultNode) - setDefaultNode(findItemAtLevel<2>([node](KitNode *kn) { return kn != node; })); - - takeItem(node); - if (node->kit() == nullptr) - delete node; - else - m_toRemoveList.append(node); - validateKitNames(); -} - -Kit *KitModel::markForAddition(Kit *baseKit) -{ - const QString newName = newKitName(baseKit ? baseKit->unexpandedDisplayName() : QString()); - KitNode *node = createNode(nullptr); - m_manualRoot->appendChild(node); - Kit *k = node->widget()->workingCopy(); - KitGuard g(k); - if (baseKit) { - k->copyFrom(baseKit); - k->setAutoDetected(false); // Make sure we have a manual kit! - k->setSdkProvided(false); - } else { - k->setup(); - } - k->setUnexpandedDisplayName(newName); - - if (!m_defaultNode) - setDefaultNode(node); - - return k; -} - -void KitModel::updateVisibility() -{ - forItemsAtLevel<2>([](const TreeItem *ti) { - static_cast<const KitNode *>(ti)->widget()->updateVisibility(); - }); -} - -QString KitModel::newKitName(const QString &sourceName) const -{ - QList<Kit *> allKits; - forItemsAtLevel<2>([&allKits](const TreeItem *ti) { - allKits << static_cast<const KitNode *>(ti)->widget()->workingCopy(); - }); - return Kit::newKitName(sourceName, allKits); -} - -KitNode *KitModel::findWorkingCopy(Kit *k) const -{ - return findItemAtLevel<2>([k](KitNode *n) { return n->widget()->workingCopy() == k; }); -} - -KitNode *KitModel::createNode(Kit *k) -{ - auto node = new KitNode(k, this, m_parentLayout); - return node; -} - -void KitModel::setDefaultNode(KitNode *node) -{ - if (m_defaultNode) { - m_defaultNode->setIsDefaultKit(false); - m_defaultNode->update(); - } - m_defaultNode = node; - if (m_defaultNode) { - m_defaultNode->setIsDefaultKit(true); - m_defaultNode->update(); - } -} - -void KitModel::addKit(Kit *k) -{ - for (TreeItem *n : *m_manualRoot) { - // Was added by us - if (static_cast<KitNode *>(n)->isRegistering()) - return; - } - - TreeItem *parent = k->isAutoDetected() ? m_autoRoot : m_manualRoot; - parent->appendChild(createNode(k)); - - validateKitNames(); - emit kitStateChanged(); -} - -void KitModel::updateKit(Kit *) -{ - validateKitNames(); - emit kitStateChanged(); -} - -void KitModel::removeKit(Kit *k) -{ - QList<KitNode *> nodes = m_toRemoveList; - for (KitNode *n : std::as_const(nodes)) { - if (n->kit() == k) { - m_toRemoveList.removeOne(n); - if (m_defaultNode == n) - m_defaultNode = nullptr; - delete n; - validateKitNames(); - return; - } - } - - KitNode *node = findItemAtLevel<2>([k](KitNode *n) { - return n->kit() == k; - }); - - if (node == m_defaultNode) - setDefaultNode(findItemAtLevel<2>([node](KitNode *kn) { return kn != node; })); - - destroyItem(node); - - validateKitNames(); - emit kitStateChanged(); -} - -void KitModel::changeDefaultKit() -{ - Kit *defaultKit = KitManager::defaultKit(); - KitNode *node = findItemAtLevel<2>([defaultKit](KitNode *n) { - return n->kit() == defaultKit; - }); - setDefaultNode(node); -} - -} // namespace Internal -} // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/kitmodel.h b/src/plugins/projectexplorer/kitmodel.h deleted file mode 100644 index 249d485101e..00000000000 --- a/src/plugins/projectexplorer/kitmodel.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "projectexplorer_export.h" - -#include <utils/id.h> -#include <utils/treemodel.h> - -QT_BEGIN_NAMESPACE -class QBoxLayout; -QT_END_NAMESPACE - -namespace ProjectExplorer { - -class Kit; -class KitFactory; -class KitManager; - -namespace Internal { - -class KitManagerConfigWidget; -class KitNode; - -// -------------------------------------------------------------------------- -// KitModel: -// -------------------------------------------------------------------------- - -class KitModel : public Utils::TreeModel<Utils::TreeItem, Utils::TreeItem, KitNode> -{ - Q_OBJECT - -public: - explicit KitModel(QBoxLayout *parentLayout, QObject *parent = nullptr); - - Kit *kit(const QModelIndex &); - KitNode *kitNode(const QModelIndex &); - QModelIndex indexOf(Kit *k) const; - QModelIndex indexOf(Utils::Id kitId) const; - - void setDefaultKit(const QModelIndex &index); - bool isDefaultKit(Kit *k) const; - - ProjectExplorer::Internal::KitManagerConfigWidget *widget(const QModelIndex &); - - void apply(); - - void markForRemoval(Kit *k); - Kit *markForAddition(Kit *baseKit); - - void updateVisibility(); - - QString newKitName(const QString &sourceName) const; - -signals: - void kitStateChanged(); - -private: - void addKit(ProjectExplorer::Kit *k); - void updateKit(ProjectExplorer::Kit *k); - void removeKit(ProjectExplorer::Kit *k); - void changeDefaultKit(); - void validateKitNames(); - - KitNode *findWorkingCopy(Kit *k) const; - KitNode *createNode(Kit *k); - void setDefaultNode(KitNode *node); - - Utils::TreeItem *m_autoRoot; - Utils::TreeItem *m_manualRoot; - - QList<KitNode *> m_toRemoveList; - - QBoxLayout *m_parentLayout; - KitNode *m_defaultNode = nullptr; - - bool m_keepUnique = true; -}; - -} // namespace Internal -} // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/kitoptionspage.cpp b/src/plugins/projectexplorer/kitoptionspage.cpp index bf702cab13a..6f7b4655b9c 100644 --- a/src/plugins/projectexplorer/kitoptionspage.cpp +++ b/src/plugins/projectexplorer/kitoptionspage.cpp @@ -1,20 +1,23 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "kitoptionspage.h" - #include "filterkitaspectsdialog.h" -#include "kitmodel.h" #include "kit.h" +#include "kitmanager.h" +#include "kitmanagerconfigwidget.h" #include "projectexplorerconstants.h" #include "projectexplorertr.h" -#include "kitmanagerconfigwidget.h" -#include "kitmanager.h" #include <coreplugin/dialogs/ioptionspage.h> +#include <utils/algorithm.h> +#include <utils/id.h> #include <utils/qtcassert.h> +#include <utils/treemodel.h> +#include <utils/utilsicons.h> +#include <QApplication> +#include <QBoxLayout> #include <QHBoxLayout> #include <QHeaderView> #include <QItemSelectionModel> @@ -30,11 +33,415 @@ namespace ProjectExplorer::Internal { static Id selectedKitId; -void setSelectectKitId(const Utils::Id &kitId) +void setSelectectKitId(const Id &kitId) { selectedKitId = kitId; } +class KitManagerConfigWidget; + +class KitNode : public TreeItem +{ +public: + KitNode(Kit *k, KitModel *m, QBoxLayout *parentLayout) + : m_kit(k), m_model(m), m_parentLayout(parentLayout) + {} + + ~KitNode() override { delete m_widget; } + + Kit *kit() const { return m_kit; } + + QVariant data(int, int role) const override + { + if (role == Qt::FontRole) { + QFont f = QApplication::font(); + if (isDirty()) + f.setBold(!f.bold()); + if (isDefaultKit()) + f.setItalic(f.style() != QFont::StyleItalic); + return f; + } + if (role == Qt::DisplayRole) { + QString baseName = displayName(); + if (isDefaultKit()) + //: Mark up a kit as the default one. + baseName = Tr::tr("%1 (default)").arg(baseName); + return baseName; + } + + if (role == Qt::DecorationRole) + return displayIcon(); + + if (role == Qt::ToolTipRole) + return widget()->validityMessage(); + + return {}; + } + + bool isDirty() const + { + if (m_widget) + return m_widget->isDirty(); + return false; + } + + QIcon displayIcon() const + { + if (m_widget) + return m_widget->displayIcon(); + QTC_ASSERT(m_kit, return {}); + return m_kit->displayIcon(); + } + + QString displayName() const + { + if (m_widget) + return m_widget->displayName(); + QTC_ASSERT(m_kit, return {}); + return m_kit->displayName(); + } + + bool isDefaultKit() const + { + return m_isDefaultKit; + } + + bool isRegistering() const + { + if (m_widget) + return m_widget->isRegistering(); + return false; + } + + void setIsDefaultKit(bool on) + { + if (m_isDefaultKit == on) + return; + m_isDefaultKit = on; + if (m_widget) + emit m_widget->dirty(); + } + + KitManagerConfigWidget *widget() const + { + const_cast<KitNode *>(this)->ensureWidget(); + return m_widget; + } + + void setHasUniqueName(bool on) + { + m_hasUniqueName = on; + } + +private: + void ensureWidget(); + + Kit *m_kit = m_kit; + KitModel *m_model = nullptr; + KitManagerConfigWidget *m_widget = nullptr; + QBoxLayout *m_parentLayout = nullptr; + bool m_isDefaultKit = false; + bool m_hasUniqueName = true; +}; + +// KitModel + +class KitModel : public TreeModel<TreeItem, TreeItem, KitNode> +{ + Q_OBJECT + +public: + explicit KitModel(QBoxLayout *parentLayout, QObject *parent = nullptr); + + Kit *kit(const QModelIndex &); + KitNode *kitNode(const QModelIndex &); + QModelIndex indexOf(Kit *k) const; + QModelIndex indexOf(Id kitId) const; + + void setDefaultKit(const QModelIndex &index); + bool isDefaultKit(Kit *k) const; + + KitManagerConfigWidget *widget(const QModelIndex &); + + void apply(); + + void markForRemoval(Kit *k); + Kit *markForAddition(Kit *baseKit); + + void updateVisibility(); + + QString newKitName(const QString &sourceName) const; + +signals: + void kitStateChanged(); + +private: + void addKit(Kit *k); + void updateKit(Kit *k); + void removeKit(Kit *k); + void changeDefaultKit(); + void validateKitNames(); + + KitNode *findWorkingCopy(Kit *k) const; + KitNode *createNode(Kit *k); + void setDefaultNode(KitNode *node); + + TreeItem *m_autoRoot; + TreeItem *m_manualRoot; + + QList<KitNode *> m_toRemoveList; + + QBoxLayout *m_parentLayout; + KitNode *m_defaultNode = nullptr; +}; + +KitModel::KitModel(QBoxLayout *parentLayout, QObject *parent) + : TreeModel<TreeItem, TreeItem, KitNode>(parent), + m_parentLayout(parentLayout) +{ + setHeader(QStringList(Tr::tr("Name"))); + m_autoRoot = new StaticTreeItem({ProjectExplorer::Constants::msgAutoDetected()}, + {ProjectExplorer::Constants::msgAutoDetectedToolTip()}); + m_manualRoot = new StaticTreeItem(ProjectExplorer::Constants::msgManual()); + rootItem()->appendChild(m_autoRoot); + rootItem()->appendChild(m_manualRoot); + + for (Kit *k : KitManager::sortedKits()) + addKit(k); + + changeDefaultKit(); + + connect(KitManager::instance(), &KitManager::kitAdded, + this, &KitModel::addKit); + connect(KitManager::instance(), &KitManager::kitUpdated, + this, &KitModel::updateKit); + connect(KitManager::instance(), &KitManager::unmanagedKitUpdated, + this, &KitModel::updateKit); + connect(KitManager::instance(), &KitManager::kitRemoved, + this, &KitModel::removeKit); + connect(KitManager::instance(), &KitManager::defaultkitChanged, + this, &KitModel::changeDefaultKit); +} + +Kit *KitModel::kit(const QModelIndex &index) +{ + KitNode *n = kitNode(index); + return n ? n->widget()->workingCopy() : nullptr; +} + +KitNode *KitModel::kitNode(const QModelIndex &index) +{ + TreeItem *n = itemForIndex(index); + return (n && n->level() == 2) ? static_cast<KitNode *>(n) : nullptr; +} + +QModelIndex KitModel::indexOf(Id kitId) const +{ + KitNode *n = findItemAtLevel<2>([kitId](KitNode *n) { return n->kit()->id() == kitId; }); + return n ? indexForItem(n) : QModelIndex(); +} + +QModelIndex KitModel::indexOf(Kit *k) const +{ + KitNode *n = findWorkingCopy(k); + return n ? indexForItem(n) : QModelIndex(); +} + +void KitModel::setDefaultKit(const QModelIndex &index) +{ + if (KitNode *n = kitNode(index)) + setDefaultNode(n); +} + +bool KitModel::isDefaultKit(Kit *k) const +{ + return m_defaultNode && m_defaultNode->widget()->workingCopy() == k; +} + +KitManagerConfigWidget *KitModel::widget(const QModelIndex &index) +{ + KitNode *n = kitNode(index); + return n ? n->widget() : nullptr; +} + +void KitModel::validateKitNames() +{ + QHash<QString, int> nameHash; + forItemsAtLevel<2>([&nameHash](KitNode *n) { + const QString displayName = n->displayName(); + if (nameHash.contains(displayName)) + ++nameHash[displayName]; + else + nameHash.insert(displayName, 1); + }); + + forItemsAtLevel<2>([&nameHash](KitNode *n) { + const QString displayName = n->displayName(); + n->setHasUniqueName(nameHash.value(displayName) == 1); + }); +} + +void KitModel::apply() +{ + // Add/update dirty nodes before removing kits. This ensures the right kit ends up as default. + forItemsAtLevel<2>([](KitNode *n) { + if (n->isDirty()) { + n->widget()->apply(); + n->update(); + } + }); + + // Remove unused kits: + const QList<KitNode *> removeList = m_toRemoveList; + for (KitNode *n : removeList) + KitManager::deregisterKit(n->kit()); + + emit layoutChanged(); // Force update. +} + +void KitModel::markForRemoval(Kit *k) +{ + KitNode *node = findWorkingCopy(k); + if (!node) + return; + + if (node == m_defaultNode) { + TreeItem *newDefault = m_autoRoot->firstChild(); + if (!newDefault) + newDefault = m_manualRoot->firstChild(); + setDefaultNode(static_cast<KitNode *>(newDefault)); + } + + if (node == m_defaultNode) + setDefaultNode(findItemAtLevel<2>([node](KitNode *kn) { return kn != node; })); + + takeItem(node); + if (node->kit() == nullptr) + delete node; + else + m_toRemoveList.append(node); + validateKitNames(); +} + +Kit *KitModel::markForAddition(Kit *baseKit) +{ + const QString newName = newKitName(baseKit ? baseKit->unexpandedDisplayName() : QString()); + KitNode *node = createNode(nullptr); + m_manualRoot->appendChild(node); + Kit *k = node->widget()->workingCopy(); + KitGuard g(k); + if (baseKit) { + k->copyFrom(baseKit); + k->setAutoDetected(false); // Make sure we have a manual kit! + k->setSdkProvided(false); + } else { + k->setup(); + } + k->setUnexpandedDisplayName(newName); + + if (!m_defaultNode) + setDefaultNode(node); + + return k; +} + +void KitModel::updateVisibility() +{ + forItemsAtLevel<2>([](const TreeItem *ti) { + static_cast<const KitNode *>(ti)->widget()->updateVisibility(); + }); +} + +QString KitModel::newKitName(const QString &sourceName) const +{ + QList<Kit *> allKits; + forItemsAtLevel<2>([&allKits](const TreeItem *ti) { + allKits << static_cast<const KitNode *>(ti)->widget()->workingCopy(); + }); + return Kit::newKitName(sourceName, allKits); +} + +KitNode *KitModel::findWorkingCopy(Kit *k) const +{ + return findItemAtLevel<2>([k](KitNode *n) { return n->widget()->workingCopy() == k; }); +} + +KitNode *KitModel::createNode(Kit *k) +{ + auto node = new KitNode(k, this, m_parentLayout); + return node; +} + +void KitModel::setDefaultNode(KitNode *node) +{ + if (m_defaultNode) { + m_defaultNode->setIsDefaultKit(false); + m_defaultNode->update(); + } + m_defaultNode = node; + if (m_defaultNode) { + m_defaultNode->setIsDefaultKit(true); + m_defaultNode->update(); + } +} + +void KitModel::addKit(Kit *k) +{ + for (TreeItem *n : *m_manualRoot) { + // Was added by us + if (static_cast<KitNode *>(n)->isRegistering()) + return; + } + + TreeItem *parent = k->isAutoDetected() ? m_autoRoot : m_manualRoot; + parent->appendChild(createNode(k)); + + validateKitNames(); + emit kitStateChanged(); +} + +void KitModel::updateKit(Kit *) +{ + validateKitNames(); + emit kitStateChanged(); +} + +void KitModel::removeKit(Kit *k) +{ + QList<KitNode *> nodes = m_toRemoveList; + for (KitNode *n : std::as_const(nodes)) { + if (n->kit() == k) { + m_toRemoveList.removeOne(n); + if (m_defaultNode == n) + m_defaultNode = nullptr; + delete n; + validateKitNames(); + return; + } + } + + KitNode *node = findItemAtLevel<2>([k](KitNode *n) { + return n->kit() == k; + }); + + if (node == m_defaultNode) + setDefaultNode(findItemAtLevel<2>([node](KitNode *kn) { return kn != node; })); + + destroyItem(node); + + validateKitNames(); + emit kitStateChanged(); +} + +void KitModel::changeDefaultKit() +{ + Kit *defaultKit = KitManager::defaultKit(); + KitNode *node = findItemAtLevel<2>([defaultKit](KitNode *n) { + return n->kit() == defaultKit; + }); + setDefaultNode(node); +} + // KitOptionsPageWidget class KitOptionsPageWidget : public Core::IOptionsPageWidget @@ -260,6 +667,27 @@ QModelIndex KitOptionsPageWidget::currentIndex() const return idxs.at(0); } +void KitNode::ensureWidget() +{ + if (m_widget) + return; + + m_widget = new KitManagerConfigWidget(m_kit, m_isDefaultKit, m_hasUniqueName); + + QObject::connect(m_widget, &KitManagerConfigWidget::dirty, m_model, [this] { update(); }); + + QObject::connect(m_widget, &KitManagerConfigWidget::isAutoDetectedChanged, m_model, [this] { + TreeItem *oldParent = parent(); + TreeItem *newParent = + m_model->rootItem()->childAt(m_widget->workingCopy()->isAutoDetected() ? 0 : 1); + if (oldParent && oldParent != newParent) { + m_model->takeItem(this); + newParent->appendChild(this); + } + }); + m_parentLayout->addWidget(m_widget); +} + // KitOptionsPage class KitsSettingsPage : public Core::IOptionsPage @@ -279,3 +707,5 @@ public: const KitsSettingsPage theKitsSettingsPage; } // ProjectExplorer::Internal + +#include "kitoptionspage.moc" diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 00dd2779ec3..611083439d0 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -86,7 +86,6 @@ Project { "kitfeatureprovider.h", "kitmanager.cpp", "kitmanager.h", "kitmanagerconfigwidget.cpp", "kitmanagerconfigwidget.h", - "kitmodel.cpp", "kitmodel.h", "kitoptionspage.cpp", "kitoptionspage.h", "ldparser.cpp", "ldparser.h", "lldparser.cpp", "lldparser.h", From 4e23f2a6eb5244971885140ae1ab076952ef9d88 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 21 Aug 2023 17:39:36 +0200 Subject: [PATCH 0826/1777] CMakeProjectManager: Hide kit aspect factory implementation Also avoid re-instantiation of factories in the build configurations. Closer to the setups of the other kit aspect(factories). Change-Id: I1b74a68287b63ee94ff18106d3a00b23624a601b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../cmakebuildconfiguration.cpp | 14 ++-- .../cmakeprojectmanager/cmakekitaspect.cpp | 83 ++++++++++++++++++- .../cmakeprojectmanager/cmakekitaspect.h | 50 +---------- .../cmakeprojectplugin.cpp | 4 - 4 files changed, 88 insertions(+), 63 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index c5330929043..23a46e7100e 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -215,7 +215,9 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) m_kitConfiguration = new QPushButton(Tr::tr("Kit Configuration")); m_kitConfiguration->setToolTip(Tr::tr("Edit the current kit's CMake configuration.")); m_kitConfiguration->setFixedWidth(m_kitConfiguration->sizeHint().width()); - connect(m_kitConfiguration, &QPushButton::clicked, this, [this] { kitCMakeConfiguration(); }); + connect(m_kitConfiguration, &QPushButton::clicked, + this, &CMakeBuildSettingsWidget::kitCMakeConfiguration, + Qt::QueuedConnection); m_filterEdit = new FancyLineEdit; m_filterEdit->setPlaceholderText(Tr::tr("Filter")); @@ -646,18 +648,14 @@ void CMakeBuildSettingsWidget::kitCMakeConfiguration() m_buildConfig->kit()->unblockNotification(); }); - CMakeKitAspectFactory kitAspectFactory; - CMakeGeneratorKitAspectFactory generatorAspectFactory; - CMakeConfigurationKitAspectFactory configurationKitAspectFactory; - Layouting::Grid grid; - KitAspect *widget = kitAspectFactory.createKitAspect(m_buildConfig->kit()); + KitAspect *widget = CMakeKitAspect::createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); widget->addToLayoutWithLabel(grid, dialog); - widget = generatorAspectFactory.createKitAspect(m_buildConfig->kit()); + widget = CMakeGeneratorKitAspect::createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); widget->addToLayoutWithLabel(grid, dialog); - widget = configurationKitAspectFactory.createKitAspect(m_buildConfig->kit()); + widget = CMakeConfigurationKitAspect::createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); widget->addToLayoutWithLabel(grid, dialog); grid.attachTo(dialog); diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp index 7554c4ba6b5..5deac770937 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp @@ -63,6 +63,60 @@ static Id defaultCMakeToolId() return defaultTool ? defaultTool->id() : Id(); } +// Factories + +class CMakeKitAspectFactory : public KitAspectFactory +{ +public: + CMakeKitAspectFactory(); + + // KitAspect interface + Tasks validate(const Kit *k) const final; + void setup(Kit *k) final; + void fix(Kit *k) final; + ItemList toUserOutput(const Kit *k) const final; + KitAspect *createKitAspect(Kit *k) const final; + + void addToMacroExpander(Kit *k, Utils::MacroExpander *expander) const final; + + QSet<Utils::Id> availableFeatures(const Kit *k) const final; +}; + +class CMakeGeneratorKitAspectFactory : public KitAspectFactory +{ +public: + CMakeGeneratorKitAspectFactory(); + + Tasks validate(const Kit *k) const final; + void setup(Kit *k) final; + void fix(Kit *k) final; + void upgrade(Kit *k) final; + ItemList toUserOutput(const Kit *k) const final; + KitAspect *createKitAspect(Kit *k) const final; + void addToBuildEnvironment(const Kit *k, Utils::Environment &env) const final; + +private: + QVariant defaultValue(const Kit *k) const; +}; + +class CMakeConfigurationKitAspectFactory : public KitAspectFactory +{ +public: + CMakeConfigurationKitAspectFactory(); + + // KitAspect interface + Tasks validate(const Kit *k) const final; + void setup(Kit *k) final; + void fix(Kit *k) final; + ItemList toUserOutput(const Kit *k) const final; + KitAspect *createKitAspect(Kit *k) const final; + +private: + QVariant defaultValue(const Kit *k) const; +}; + +// Implementations + class CMakeKitAspectImpl final : public KitAspect { public: @@ -602,7 +656,7 @@ QStringList CMakeGeneratorKitAspect::generatorArguments(const Kit *k) return result; } -CMakeConfig CMakeGeneratorKitAspect::generatorCMakeConfig(const ProjectExplorer::Kit *k) +CMakeConfig CMakeGeneratorKitAspect::generatorCMakeConfig(const Kit *k) { CMakeConfig config; @@ -1028,14 +1082,14 @@ void CMakeConfigurationKitAspect::setConfiguration(Kit *k, const CMakeConfig &co k->setValue(CONFIGURATION_ID, tmp); } -QString CMakeConfigurationKitAspect::additionalConfiguration(const ProjectExplorer::Kit *k) +QString CMakeConfigurationKitAspect::additionalConfiguration(const Kit *k) { if (!k) return QString(); return k->value(ADDITIONAL_CONFIGURATION_ID).toString(); } -void CMakeConfigurationKitAspect::setAdditionalConfiguration(ProjectExplorer::Kit *k, const QString &config) +void CMakeConfigurationKitAspect::setAdditionalConfiguration(Kit *k, const QString &config) { if (!k) return; @@ -1095,7 +1149,7 @@ void CMakeConfigurationKitAspect::setCMakePreset(Kit *k, const QString &presetNa setConfiguration(k, config); } -CMakeConfigItem CMakeConfigurationKitAspect::cmakePresetConfigItem(const ProjectExplorer::Kit *k) +CMakeConfigItem CMakeConfigurationKitAspect::cmakePresetConfigItem(const Kit *k) { const CMakeConfig config = configuration(k); return Utils::findOrDefault(config, [](const CMakeConfigItem &item) { @@ -1230,4 +1284,25 @@ KitAspect *CMakeConfigurationKitAspectFactory::createKitAspect(Kit *k) const return new CMakeConfigurationKitAspectWidget(k, this); } +// Factory instances; + +const CMakeKitAspectFactory theCMakeKitAspectFactory; +const CMakeGeneratorKitAspectFactory theCMakeGeneratorKitAspectFactory; +const CMakeConfigurationKitAspectFactory theCMakeConfigurationKitAspectFactory; + +KitAspect *CMakeKitAspect::createKitAspect(Kit *k) +{ + return theCMakeKitAspectFactory.createKitAspect(k); +} + +KitAspect *CMakeGeneratorKitAspect::createKitAspect(Kit *k) +{ + return theCMakeGeneratorKitAspectFactory.createKitAspect(k); +} + +KitAspect *CMakeConfigurationKitAspect::createKitAspect(Kit *k) +{ + return theCMakeConfigurationKitAspectFactory.createKitAspect(k); +} + } // namespace CMakeProjectManager diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.h b/src/plugins/cmakeprojectmanager/cmakekitaspect.h index eca84c46d90..bd421f4fb88 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.h +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.h @@ -22,23 +22,8 @@ public: static CMakeTool *cmakeTool(const ProjectExplorer::Kit *k); static void setCMakeTool(ProjectExplorer::Kit *k, const Utils::Id id); static QString msgUnsupportedVersion(const QByteArray &versionString); -}; -class CMAKE_EXPORT CMakeKitAspectFactory : public ProjectExplorer::KitAspectFactory -{ -public: - CMakeKitAspectFactory(); - - // KitAspect interface - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; - void setup(ProjectExplorer::Kit *k) final; - void fix(ProjectExplorer::Kit *k) final; - ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const final; - - void addToMacroExpander(ProjectExplorer::Kit *k, Utils::MacroExpander *expander) const final; - - QSet<Utils::Id> availableFeatures(const ProjectExplorer::Kit *k) const final; + static ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k); }; class CMAKE_EXPORT CMakeGeneratorKitAspect @@ -57,23 +42,8 @@ public: static QStringList generatorArguments(const ProjectExplorer::Kit *k); static CMakeConfig generatorCMakeConfig(const ProjectExplorer::Kit *k); static bool isMultiConfigGenerator(const ProjectExplorer::Kit *k); -}; -class CMAKE_EXPORT CMakeGeneratorKitAspectFactory : public ProjectExplorer::KitAspectFactory -{ -public: - CMakeGeneratorKitAspectFactory(); - - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; - void setup(ProjectExplorer::Kit *k) final; - void fix(ProjectExplorer::Kit *k) final; - void upgrade(ProjectExplorer::Kit *k) final; - ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const final; - void addToBuildEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const final; - -private: - QVariant defaultValue(const ProjectExplorer::Kit *k) const; + static ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k); }; class CMAKE_EXPORT CMakeConfigurationKitAspect @@ -94,22 +64,8 @@ public: static void setCMakePreset(ProjectExplorer::Kit *k, const QString &presetName); static CMakeConfigItem cmakePresetConfigItem(const ProjectExplorer::Kit *k); -}; -class CMAKE_EXPORT CMakeConfigurationKitAspectFactory : public ProjectExplorer::KitAspectFactory -{ -public: - CMakeConfigurationKitAspectFactory(); - - // KitAspect interface - ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; - void setup(ProjectExplorer::Kit *k) final; - void fix(ProjectExplorer::Kit *k) final; - ItemList toUserOutput(const ProjectExplorer::Kit *k) const final; - ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k) const final; - -private: - QVariant defaultValue(const ProjectExplorer::Kit *k) const; + static ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k); }; } // CMakeProjectManager diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index cb60f26f0ad..8d0d2f720c1 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -9,7 +9,6 @@ #include "cmakeeditor.h" #include "cmakeformatter.h" #include "cmakeinstallstep.h" -#include "cmakekitaspect.h" #include "cmakelocatorfilter.h" #include "cmakeproject.h" #include "cmakeprojectconstants.h" @@ -62,9 +61,6 @@ public: CMakeBuildTargetFilter cMakeBuildTargetFilter; CMakeOpenTargetFilter cMakeOpenTargetFilter; - CMakeKitAspectFactory cmakeKitAspectFactory; - CMakeGeneratorKitAspectFactory cmakeGeneratorKitAspectFactory; - CMakeConfigurationKitAspectFactory cmakeConfigurationKitAspectFactory; CMakeFormatter cmakeFormatter; }; From 45e3fa16213bea855bb6ec9abe22f1932ebffb23 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 21 Aug 2023 18:32:33 +0200 Subject: [PATCH 0827/1777] ProjectExplorer: Simplify KitAspect::addToLayoutWithLabel() The parent widget was not used anymore. Change-Id: I57bb024b770c01efc68bb722623bcc7fb565cfeb Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 6 +++--- src/plugins/projectexplorer/kitmanager.cpp | 3 +-- src/plugins/projectexplorer/kitmanager.h | 2 +- src/plugins/projectexplorer/kitmanagerconfigwidget.cpp | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 23a46e7100e..a6be87fd968 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -651,13 +651,13 @@ void CMakeBuildSettingsWidget::kitCMakeConfiguration() Layouting::Grid grid; KitAspect *widget = CMakeKitAspect::createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); - widget->addToLayoutWithLabel(grid, dialog); + widget->addToLayoutWithLabel(grid); widget = CMakeGeneratorKitAspect::createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); - widget->addToLayoutWithLabel(grid, dialog); + widget->addToLayoutWithLabel(grid); widget = CMakeConfigurationKitAspect::createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); - widget->addToLayoutWithLabel(grid, dialog); + widget->addToLayoutWithLabel(grid); grid.attachTo(dialog); auto layout = qobject_cast<QGridLayout *>(dialog->layout()); diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 30a70abfbe7..9685f35c2e9 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -734,9 +734,8 @@ KitAspect::~KitAspect() delete m_mutableAction; } -void KitAspect::addToLayoutWithLabel(Layouting::LayoutItem &parentItem, QWidget *parent) +void KitAspect::addToLayoutWithLabel(Layouting::LayoutItem &parentItem) { - QTC_ASSERT(parent, return); auto label = createSubWidget<QLabel>(m_factory->displayName() + ':'); label->setToolTip(m_factory->description()); connect(label, &QLabel::linkActivated, this, [this](const QString &link) { diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index c3774cfe79b..db11d3afb94 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -113,7 +113,7 @@ public: virtual void makeReadOnly() = 0; virtual void refresh() = 0; - void addToLayoutWithLabel(Layouting::LayoutItem &parentItem, QWidget *parent); + void addToLayoutWithLabel(Layouting::LayoutItem &parentItem); static QString msgManage(); diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index 9aa111bd693..98b14cee309 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -201,7 +201,7 @@ void KitManagerConfigWidget::addAspectToWorkingCopy(Layouting::LayoutItem &paren QTC_ASSERT(aspect, return); QTC_ASSERT(!m_kitAspects.contains(aspect), return); - aspect->addToLayoutWithLabel(parent, this); + aspect->addToLayoutWithLabel(parent); m_kitAspects.append(aspect); connect(aspect->mutableAction(), &QAction::toggled, From 806e24138b407375974e5068257403ca82c7c8eb Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Mon, 21 Aug 2023 16:16:13 +0200 Subject: [PATCH 0828/1777] LanguageClient: send out empty workspace configurations ... instead of an error when the server asks for the configuration even if we do not provide a way to configure workspace configurations yet. Change-Id: I0d330b47a12627af100bf9d9b1eec34a58d6471b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/languageserverprotocol/workspace.h | 4 ++-- src/plugins/languageclient/client.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/libs/languageserverprotocol/workspace.h b/src/libs/languageserverprotocol/workspace.h index 69c3ef9bd4f..703310caaa3 100644 --- a/src/libs/languageserverprotocol/workspace.h +++ b/src/libs/languageserverprotocol/workspace.h @@ -109,8 +109,8 @@ public: bool isValid() const override { return contains(itemsKey); } }; -class LANGUAGESERVERPROTOCOL_EXPORT ConfigurationRequest : public Request< - LanguageClientArray<QJsonValue>, std::nullptr_t, ConfigurationParams> +class LANGUAGESERVERPROTOCOL_EXPORT ConfigurationRequest + : public Request<QJsonArray, std::nullptr_t, ConfigurationParams> { public: explicit ConfigurationRequest(const ConfigurationParams ¶ms); diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 7e41452b2c6..1d18b0b189d 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1941,6 +1941,18 @@ void ClientPrivate::handleMethod(const QString &method, const MessageId &id, con if (ProgressManager::isProgressEndMessage(*params)) emit q->workDone(params->token()); } + } else if (method == ConfigurationRequest::methodName) { + ConfigurationRequest::Response response; + QJsonArray result; + if (QTC_GUARD(id.isValid())) + response.setId(id); + ConfigurationRequest configurationRequest(message.toJsonObject()); + if (auto params = configurationRequest.params()) { + for (int i = 0, end = params->items().count(); i < end; ++i) + result.append({}); + } + response.setResult(result); + sendResponse(response); } else if (isRequest) { Response<JsonObject, JsonObject> response(id); ResponseError<JsonObject> error; From 73c5cf29c45f4d6d098b4e52043661801a2ed499 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 22 Aug 2023 15:27:34 +0200 Subject: [PATCH 0829/1777] Utils: Add missing connections to validChanged FancyLineEdit and PathChoosers valid state can be asyncronously update, so users need to connect to the validChanged signal to correctly update the UI and not just to textChanged, or rawPathChanged etc. Fixes: QTCREATORBUG-29525 Change-Id: I706fef61f6228af7dae9271a146cf739c3202cc7 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/cppeditor/cppcodemodelsettingspage.cpp | 1 + src/plugins/debugger/debuggerdialogs.cpp | 7 +++++-- src/plugins/gitlab/gitlabclonedialog.cpp | 4 +++- src/plugins/qmljseditor/qmljscomponentnamedialog.cpp | 7 +++---- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp index 58db1673348..f2a96111f41 100644 --- a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp @@ -467,6 +467,7 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD labelSetter.setWarning(errorMessage); }; connect(&d->clangdChooser, &Utils::PathChooser::textChanged, this, updateWarningLabel); + connect(&d->clangdChooser, &Utils::PathChooser::validChanged, this, updateWarningLabel); updateWarningLabel(); connect(&d->useClangdCheckBox, &QCheckBox::toggled, diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index 26fa01b1243..a222432887b 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -290,8 +290,11 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent) verticalLayout->addWidget(Layouting::createHr()); verticalLayout->addWidget(d->buttonBox); - connect(d->localExecutablePathChooser, &PathChooser::rawPathChanged, - this, &StartApplicationDialog::updateState); + connect(d->localExecutablePathChooser, + &PathChooser::validChanged, + this, + &StartApplicationDialog::updateState); + connect(d->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); connect(d->historyComboBox, &QComboBox::currentIndexChanged, diff --git a/src/plugins/gitlab/gitlabclonedialog.cpp b/src/plugins/gitlab/gitlabclonedialog.cpp index 3a061b9cc57..0a884f5249a 100644 --- a/src/plugins/gitlab/gitlabclonedialog.cpp +++ b/src/plugins/gitlab/gitlabclonedialog.cpp @@ -95,9 +95,11 @@ GitLabCloneDialog::GitLabCloneDialog(const Project &project, QWidget *parent) connect(m_pathChooser, &PathChooser::textChanged, this, [this] { m_directoryLE->validate(); - GitLabCloneDialog::updateUi(); + updateUi(); }); + connect(m_pathChooser, &PathChooser::validChanged, this, &GitLabCloneDialog::updateUi); connect(m_directoryLE, &FancyLineEdit::textChanged, this, &GitLabCloneDialog::updateUi); + connect(m_directoryLE, &FancyLineEdit::validChanged, this, &GitLabCloneDialog::updateUi); connect(m_cloneButton, &QPushButton::clicked, this, &GitLabCloneDialog::cloneProject); connect(m_cancelButton, &QPushButton::clicked, this, &GitLabCloneDialog::cancel); diff --git a/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp b/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp index 91bcc0ac89d..ad7b664431c 100644 --- a/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp +++ b/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp @@ -48,10 +48,9 @@ ComponentNameDialog::ComponentNameDialog(QWidget *parent) : connect(m_buttonBox, &QDialogButtonBox::accepted, this, &ComponentNameDialog::accept); connect(m_buttonBox, &QDialogButtonBox::rejected, this, &ComponentNameDialog::reject); - connect(m_pathEdit, &Utils::PathChooser::rawPathChanged, - this, &ComponentNameDialog::validate); - connect(m_componentNameEdit, &QLineEdit::textChanged, - this, &ComponentNameDialog::validate); + connect(m_pathEdit, &Utils::PathChooser::rawPathChanged, this, &ComponentNameDialog::validate); + connect(m_pathEdit, &Utils::PathChooser::validChanged, this, &ComponentNameDialog::validate); + connect(m_componentNameEdit, &QLineEdit::textChanged, this, &ComponentNameDialog::validate); } bool ComponentNameDialog::go(QString *proposedName, From b33b99e2d9e4c343f7427bcf1ccdf652e7575557 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 22 Aug 2023 14:10:22 +0200 Subject: [PATCH 0830/1777] ClangCodeModel: Take changes from header files into account immediately ... in the dependent sources. That's also how the built-in code model behaves, but clangd itself only does this when a document is saved. Change-Id: I52d6badb0b7f063e5924c05dbf83a6e9849c9f6f Reviewed-by: David Schulz <david.schulz@qt.io> --- .../clangcodemodel/clangcodemodelplugin.cpp | 1 + .../clangeditordocumentprocessor.cpp | 11 +++++ .../clangeditordocumentprocessor.h | 3 +- .../clangcodemodel/test/clangdtests.cpp | 41 +++++++++++++++++++ src/plugins/clangcodemodel/test/clangdtests.h | 11 +++++ .../test/data/clangtestdata.qrc | 5 +++ .../test/data/indirect-changes/directheader.h | 1 + .../indirect-changes/indirect-changes.pro | 4 ++ .../data/indirect-changes/indirectheader.h | 0 .../test/data/indirect-changes/main.cpp | 3 ++ .../data/indirect-changes/unrelatedheader.h | 0 .../builtineditordocumentprocessor.cpp | 1 + .../builtineditordocumentprocessor.h | 2 + 13 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/plugins/clangcodemodel/test/data/indirect-changes/directheader.h create mode 100644 src/plugins/clangcodemodel/test/data/indirect-changes/indirect-changes.pro create mode 100644 src/plugins/clangcodemodel/test/data/indirect-changes/indirectheader.h create mode 100644 src/plugins/clangcodemodel/test/data/indirect-changes/main.cpp create mode 100644 src/plugins/clangcodemodel/test/data/indirect-changes/unrelatedheader.h diff --git a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp index 62dae070400..ac194abfbf9 100644 --- a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp +++ b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp @@ -90,6 +90,7 @@ void ClangCodeModelPlugin::initialize() addTest<Tests::ClangdTestFindReferences>(); addTest<Tests::ClangdTestFollowSymbol>(); addTest<Tests::ClangdTestHighlighting>(); + addTest<Tests::ClangdTestIndirectChanges>(); addTest<Tests::ClangdTestLocalReferences>(); addTest<Tests::ClangdTestTooltips>(); addTest<Tests::ClangFixItTest>(); diff --git a/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp b/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp index d7c94d81247..83667dde05e 100644 --- a/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp +++ b/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp @@ -3,6 +3,7 @@ #include "clangeditordocumentprocessor.h" +#include "clangdclient.h" #include "clangmodelmanagersupport.h" #include <cppeditor/builtincursorinfo.h> @@ -15,6 +16,8 @@ #include <cppeditor/cppworkingcopy.h> #include <cppeditor/editordocumenthandle.h> +#include <languageclient/languageclientmanager.h> + #include <texteditor/fontsettings.h> #include <texteditor/texteditor.h> #include <texteditor/texteditorconstants.h> @@ -77,5 +80,13 @@ ClangEditorDocumentProcessor *ClangEditorDocumentProcessor::get(const Utils::Fil CppEditor::CppModelManager::cppEditorDocumentProcessor(filePath)); } +void ClangEditorDocumentProcessor::forceUpdate(TextEditor::TextDocument *doc) +{ + if (const auto client = qobject_cast<ClangdClient *>( + LanguageClient::LanguageClientManager::clientForDocument(doc))) { + client->documentContentsChanged(doc, 0, 0, 0); + } +} + } // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangeditordocumentprocessor.h b/src/plugins/clangcodemodel/clangeditordocumentprocessor.h index bd151554003..fe2bc6a0166 100644 --- a/src/plugins/clangcodemodel/clangeditordocumentprocessor.h +++ b/src/plugins/clangcodemodel/clangeditordocumentprocessor.h @@ -22,7 +22,6 @@ public: void setParserConfig(const CppEditor::BaseEditorDocumentParser::Configuration &config) override; CppEditor::BaseEditorDocumentParser::Configuration parserConfig(); -public: static ClangEditorDocumentProcessor *get(const Utils::FilePath &filePath); signals: @@ -30,6 +29,8 @@ signals: const CppEditor::BaseEditorDocumentParser::Configuration &config); private: + void forceUpdate(TextEditor::TextDocument *doc) override; + TextEditor::TextDocument &m_document; }; diff --git a/src/plugins/clangcodemodel/test/clangdtests.cpp b/src/plugins/clangcodemodel/test/clangdtests.cpp index 190c0b55c76..54c9bfa7c1d 100644 --- a/src/plugins/clangcodemodel/test/clangdtests.cpp +++ b/src/plugins/clangcodemodel/test/clangdtests.cpp @@ -2061,6 +2061,47 @@ void ClangdTestExternalChanges::test() QVERIFY(waitForSignalOrTimeout(newClient, &ClangdClient::textMarkCreated, timeOutInMs())); } +ClangdTestIndirectChanges::ClangdTestIndirectChanges() +{ + setProjectFileName("indirect-changes.pro"); + setSourceFileNames({"main.cpp", "directheader.h", "indirectheader.h", "unrelatedheader.h"}); +} + +void ClangdTestIndirectChanges::test() +{ + // Initially, everything is fine. + const TextDocument * const src = document("main.cpp"); + QVERIFY(src); + QVERIFY(src->marks().isEmpty()); + + // Write into an indirectly included header file. Our source file should have diagnostics now. + const TextDocument * const indirectHeader = document("indirectheader.h"); + QVERIFY(indirectHeader); + QTextCursor cursor(indirectHeader->document()); + cursor.insertText("blubb"); + while (src->marks().isEmpty()) + QVERIFY(waitForSignalOrTimeout(client(), &ClangdClient::textMarkCreated, timeOutInMs())); + + // Remove the inserted text again; the diagnostics should disappear. + cursor.document()->undo(); + QVERIFY(cursor.document()->toPlainText().isEmpty()); + while (!src->marks().isEmpty()) { + QVERIFY(waitForSignalOrTimeout(client(), &ClangdClient::highlightingResultsReady, + timeOutInMs())); + } + + // Now write into a header file that is not included anywhere. + // We expect diagnostics only for the header itself. + const TextDocument * const unrelatedHeader = document("unrelatedheader.h"); + QVERIFY(indirectHeader); + QTextCursor cursor2(unrelatedHeader->document()); + cursor2.insertText("blubb"); + while (waitForSignalOrTimeout(client(), &ClangdClient::textMarkCreated, timeOutInMs())) + ; + QVERIFY(!unrelatedHeader->marks().isEmpty()); + QVERIFY(src->marks().isEmpty()); +} + } // namespace Tests } // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/test/clangdtests.h b/src/plugins/clangcodemodel/test/clangdtests.h index 92bf4efe90c..9d6e42d3a9e 100644 --- a/src/plugins/clangcodemodel/test/clangdtests.h +++ b/src/plugins/clangcodemodel/test/clangdtests.h @@ -188,6 +188,17 @@ private slots: void test(); }; +class ClangdTestIndirectChanges : public ClangdTest +{ + Q_OBJECT + +public: + ClangdTestIndirectChanges(); + +private slots: + void test(); +}; + } // namespace Tests } // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/test/data/clangtestdata.qrc b/src/plugins/clangcodemodel/test/data/clangtestdata.qrc index 1ee4bdee92c..f61e3f0633b 100644 --- a/src/plugins/clangcodemodel/test/data/clangtestdata.qrc +++ b/src/plugins/clangcodemodel/test/data/clangtestdata.qrc @@ -60,5 +60,10 @@ <file>fixits/diagnostic_comparison_fixit.cpp</file> <file>fixits/diagnostic_semicolon_fixit_expected.cpp</file> <file>fixits/diagnostic_semicolon_fixit.cpp</file> + <file>indirect-changes/directheader.h</file> + <file>indirect-changes/indirect-changes.pro</file> + <file>indirect-changes/indirectheader.h</file> + <file>indirect-changes/main.cpp</file> + <file>indirect-changes/unrelatedheader.h</file> </qresource> </RCC> diff --git a/src/plugins/clangcodemodel/test/data/indirect-changes/directheader.h b/src/plugins/clangcodemodel/test/data/indirect-changes/directheader.h new file mode 100644 index 00000000000..9ab7726e456 --- /dev/null +++ b/src/plugins/clangcodemodel/test/data/indirect-changes/directheader.h @@ -0,0 +1 @@ +#include "indirectheader.h" diff --git a/src/plugins/clangcodemodel/test/data/indirect-changes/indirect-changes.pro b/src/plugins/clangcodemodel/test/data/indirect-changes/indirect-changes.pro new file mode 100644 index 00000000000..b1648532ca6 --- /dev/null +++ b/src/plugins/clangcodemodel/test/data/indirect-changes/indirect-changes.pro @@ -0,0 +1,4 @@ +CONFIG -= qt + +SOURCES = main.cpp +HEADERS = directheader.h indirectheader.h unrelatedheader.h diff --git a/src/plugins/clangcodemodel/test/data/indirect-changes/indirectheader.h b/src/plugins/clangcodemodel/test/data/indirect-changes/indirectheader.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/clangcodemodel/test/data/indirect-changes/main.cpp b/src/plugins/clangcodemodel/test/data/indirect-changes/main.cpp new file mode 100644 index 00000000000..63ae802b071 --- /dev/null +++ b/src/plugins/clangcodemodel/test/data/indirect-changes/main.cpp @@ -0,0 +1,3 @@ +#include "directheader.h" + +int main() {} diff --git a/src/plugins/clangcodemodel/test/data/indirect-changes/unrelatedheader.h b/src/plugins/clangcodemodel/test/data/indirect-changes/unrelatedheader.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/cppeditor/builtineditordocumentprocessor.cpp b/src/plugins/cppeditor/builtineditordocumentprocessor.cpp index cb94e84a67b..94f86815f26 100644 --- a/src/plugins/cppeditor/builtineditordocumentprocessor.cpp +++ b/src/plugins/cppeditor/builtineditordocumentprocessor.cpp @@ -283,6 +283,7 @@ void BuiltinEditorDocumentProcessor::onParserFinished(CPlusPlus::Document::Ptr d if (!cppDoc->includedFiles().contains(document->filePath())) continue; cppEditorDoc->scheduleProcessDocument(); + forceUpdate(cppEditorDoc); } } diff --git a/src/plugins/cppeditor/builtineditordocumentprocessor.h b/src/plugins/cppeditor/builtineditordocumentprocessor.h index a061336587e..b33951aabe1 100644 --- a/src/plugins/cppeditor/builtineditordocumentprocessor.h +++ b/src/plugins/cppeditor/builtineditordocumentprocessor.h @@ -43,6 +43,8 @@ private: SemanticInfo::Source createSemanticInfoSource(bool force) const; + virtual void forceUpdate(TextEditor::TextDocument *) {} + private: BuiltinEditorDocumentParser::Ptr m_parser; QFuture<void> m_parserFuture; From 8bdf70e271072e38a9bcc41536f5bbf7b5e10048 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 22:45:36 +0200 Subject: [PATCH 0831/1777] AndroidManager: Use Utils::Process for startAdbProcess() Change-Id: I675d0103bee854af67d379d08a7e0ddbc6654e8d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/android/androidmanager.cpp | 26 ++++++++++----------- src/plugins/android/androidmanager.h | 7 ++---- src/plugins/android/androidrunnerworker.cpp | 18 +------------- src/plugins/android/androidrunnerworker.h | 9 ++----- 4 files changed, 18 insertions(+), 42 deletions(-) diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index a9639b0b750..9d82d5f7bea 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -264,7 +264,7 @@ FilePath AndroidManager::buildDirectory(const Target *target) if (isQt5CmakeProject(target)) { // Return the main build dir and not the android libs dir const QString libsDir = QString(Constants::ANDROID_BUILD_DIRECTORY) + "/libs"; - Utils::FilePath parentDuildDir = buildDir.parentDir(); + FilePath parentDuildDir = buildDir.parentDir(); if (parentDuildDir.endsWith(libsDir) || libsDir.endsWith(libsDir + "/")) return parentDuildDir.parentDir().parentDir(); } @@ -612,10 +612,10 @@ void AndroidManager::installQASIPackage(Target *target, const FilePath &packageP QStringList arguments = AndroidDeviceInfo::adbSelector(deviceSerialNumber); arguments << "install" << "-r " << packagePath.path(); QString error; - QProcess *process = startAdbProcess(arguments, &error); + Process *process = startAdbProcess(arguments, &error); if (process) { // TODO: Potential leak when the process is still running on Creator shutdown. - QObject::connect(process, &QProcess::finished, process, &QObject::deleteLater); + QObject::connect(process, &Process::done, process, &QObject::deleteLater); } else { Core::MessageManager::writeDisrupting( Tr::tr("Android package installation failed.\n%1").arg(error)); @@ -671,20 +671,20 @@ bool AndroidManager::checkCertificateExists(const FilePath &keystorePath, return proc.result() == ProcessResult::FinishedWithSuccess; } -QProcess *AndroidManager::startAdbProcess(const QStringList &args, QString *err) +Process *AndroidManager::startAdbProcess(const QStringList &args, QString *err) { - std::unique_ptr<QProcess> p(new QProcess); + std::unique_ptr<Process> process(new Process); const FilePath adb = AndroidConfigurations::currentConfig().adbToolPath(); - qCDebug(androidManagerLog).noquote() << "Running command (async):" - << CommandLine(adb, args).toUserOutput(); - p->start(adb.toString(), args); - if (p->waitForStarted(500) && p->state() == QProcess::Running) - return p.release(); + const CommandLine command{adb, args}; + qCDebug(androidManagerLog).noquote() << "Running command (async):" << command.toUserOutput(); + process->setCommand(command); + process->start(); + if (process->waitForStarted(500) && process->state() == QProcess::Running) + return process.release(); - QString errorStr = QString::fromUtf8(p->readAllStandardError()); + const QString errorStr = process->readAllStandardError(); qCDebug(androidManagerLog).noquote() << "Running command (async) failed:" - << CommandLine(adb, args).toUserOutput() - << "Output:" << errorStr; + << command.toUserOutput() << "Output:" << errorStr; if (err) *err = errorStr; return nullptr; diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index 772f3da5dc9..0d6db5369cd 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -12,10 +12,6 @@ #include <qtsupport/baseqtversion.h> #include <projectexplorer/abi.h> -QT_BEGIN_NAMESPACE -class QProcess; -QT_END_NAMESPACE - namespace ProjectExplorer { class Kit; class Target; @@ -24,6 +20,7 @@ class Target; namespace Utils { class CommandLine; class FilePath; +class Process; } namespace Android { @@ -97,7 +94,7 @@ public: static bool checkCertificateExists(const Utils::FilePath &keystorePath, const QString &keystorePasswd, const QString &alias); - static QProcess *startAdbProcess(const QStringList &args, QString *err = nullptr); + static Utils::Process *startAdbProcess(const QStringList &args, QString *err = nullptr); static SdkToolResult runAdbCommand(const QStringList &args, const QByteArray &writeData = {}, int timeoutS = 30); diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 3dd6182b87a..6be375f30f5 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -141,18 +141,6 @@ static void findProcessPIDAndUser(QPromise<PidUserPair> &promise, promise.addResult(PidUserPair(processPID, processUser)); } -static void deleter(QProcess *p) -{ - qCDebug(androidRunWorkerLog) << "Killing process:" << p->objectName(); - p->terminate(); - if (!p->waitForFinished(1000)) { - p->kill(); - p->waitForFinished(); - } - // Might get deleted from its own signal handler. - p->deleteLater(); -} - static QString gdbServerArch(const QString &androidAbi) { if (androidAbi == ProjectExplorer::Constants::ANDROID_ABI_ARM64_V8A) @@ -214,11 +202,8 @@ static FilePath debugServer(bool useLldb, const Target *target) return {}; } - AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packageName) : m_packageName(packageName) - , m_psIsAlive(nullptr, deleter) - , m_debugServerProcess(nullptr, deleter) { auto runControl = runner->runControl(); m_useLldb = Debugger::DebuggerKitAspect::engineType(runControl->kit()) @@ -865,8 +850,7 @@ void AndroidRunnerWorker::onProcessIdChanged(PidUserPair pidUser) QTC_ASSERT(m_psIsAlive, return); m_psIsAlive->setObjectName("IsAliveProcess"); m_psIsAlive->setProcessChannelMode(QProcess::MergedChannels); - connect(m_psIsAlive.get(), &QProcess::finished, - this, bind(&AndroidRunnerWorker::onProcessIdChanged, this, PidUserPair(-1, -1))); + connect(m_psIsAlive.get(), &Process::done, this, [this] { onProcessIdChanged({-1, -1}); }); } } diff --git a/src/plugins/android/androidrunnerworker.h b/src/plugins/android/androidrunnerworker.h index d927a7c4ff8..052fe2812cb 100644 --- a/src/plugins/android/androidrunnerworker.h +++ b/src/plugins/android/androidrunnerworker.h @@ -12,10 +12,6 @@ #include <QFuture> #include <utility> -QT_BEGIN_NAMESPACE -class QProcess; -QT_END_NAMESPACE - namespace Utils { class FilePath; class Process; @@ -80,7 +76,6 @@ private: Settled }; void onProcessIdChanged(PidUserPair pidUser); - using Deleter = void (*)(QProcess *); // Create the processes and timer in the worker thread, for correct thread affinity bool m_isPreNougat = false; @@ -92,7 +87,7 @@ private: qint64 m_processPID = -1; qint64 m_processUser = -1; std::unique_ptr<Utils::Process> m_adbLogcatProcess; - std::unique_ptr<QProcess, Deleter> m_psIsAlive; + std::unique_ptr<Utils::Process> m_psIsAlive; QByteArray m_stdoutBuffer; QByteArray m_stderrBuffer; QFuture<PidUserPair> m_pidFinder; @@ -103,7 +98,7 @@ private: QUrl m_qmlServer; JDBState m_jdbState = JDBState::Idle; Utils::Port m_localJdbServerPort; - std::unique_ptr<QProcess, Deleter> m_debugServerProcess; // gdbserver or lldb-server + std::unique_ptr<Utils::Process> m_debugServerProcess; // gdbserver or lldb-server std::unique_ptr<Utils::Process> m_jdbProcess; QString m_deviceSerialNumber; int m_apiLevel = -1; From c8a25e8fd96d4259726a9d3a4d93fb6ecea086d3 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 22:45:36 +0200 Subject: [PATCH 0832/1777] AndroidManager: Cleanup includes Change-Id: I779eadcc978e76adff8f6e4a0671f3db6a2a2402 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/android/androidmanager.cpp | 42 +++++++------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index 9d82d5f7bea..78a697cf7ef 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -1,55 +1,35 @@ // Copyright (C) 2016 BogDan Vatra <bog_dan_ro@yahoo.com> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#include "androidmanager.h" + #include "androidavdmanager.h" #include "androidbuildapkstep.h" -#include "androidconfigurations.h" #include "androidconstants.h" -#include "androiddeployqtstep.h" #include "androiddevice.h" -#include "androidglobal.h" -#include "androidmanager.h" #include "androidqtversion.h" -#include "androidrunconfiguration.h" -#include "androidsdkmanager.h" -#include "androidtoolchain.h" #include "androidtr.h" -#include <coreplugin/documentmanager.h> -#include <coreplugin/messagemanager.h> -#include <coreplugin/icore.h> - -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/project.h> -#include <projectexplorer/projectnodes.h> -#include <projectexplorer/projectexplorer.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/projectmanager.h> -#include <projectexplorer/target.h> -#include <projectexplorer/buildsystem.h> - -#include <qtsupport/qtkitaspect.h> -#include <qtsupport/qtsupportconstants.h> -#include <qtsupport/baseqtversion.h> - #include <cmakeprojectmanager/cmakeprojectconstants.h> +#include <coreplugin/messagemanager.h> + +#include <projectexplorer/buildsteplist.h> +#include <projectexplorer/buildsystem.h> +#include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/target.h> + +#include <qtsupport/qtkitaspect.h> + #include <utils/algorithm.h> -#include <utils/fileutils.h> #include <utils/process.h> #include <utils/qtcassert.h> -#include <utils/stringutils.h> -#include <QApplication> #include <QDomDocument> -#include <QFileSystemWatcher> #include <QJsonDocument> #include <QJsonObject> -#include <QList> #include <QLoggingCategory> #include <QMessageBox> -#include <QProcess> -#include <QRegularExpression> #include <QVersionNumber> using namespace ProjectExplorer; From 020d4c72e47e5e2a427293b33c22c19c265ba05d Mon Sep 17 00:00:00 2001 From: Andreas Loth <andreas.loth@qt.io> Date: Tue, 22 Aug 2023 15:55:28 +0200 Subject: [PATCH 0833/1777] Axivion: Use type aliases from updated Axivion Dashboard DTO generator Change-Id: I4e27c90d643d4e4ca33fde8dc0ae6e62e6a78fb6 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/axivion/axivionoutputpane.cpp | 4 +-- src/plugins/axivion/dashboard/concat.cpp | 12 ++++--- src/plugins/axivion/dashboard/dto.cpp | 16 ++++----- src/plugins/axivion/dashboard/dto.h | 42 +++++++++++++---------- 4 files changed, 42 insertions(+), 32 deletions(-) diff --git a/src/plugins/axivion/axivionoutputpane.cpp b/src/plugins/axivion/axivionoutputpane.cpp index 4e8326da0b5..8d33abba7b2 100644 --- a/src/plugins/axivion/axivionoutputpane.cpp +++ b/src/plugins/axivion/axivionoutputpane.cpp @@ -150,9 +150,9 @@ void DashboardWidget::updateUi() // not use the issue counts, thus the QtCreator Axivion Plugin // is going to stop using them, too. if (last.issueCounts.isMap()) { - for (const auto &issueCount : last.issueCounts.getMap()) { + for (const Dto::Any::MapEntry &issueCount : last.issueCounts.getMap()) { if (issueCount.second.isMap()) { - const auto &counts = issueCount.second.getMap(); + const Dto::Any::Map &counts = issueCount.second.getMap(); qint64 total = extract_value(counts, QStringLiteral(u"Total")); allTotal += total; qint64 added = extract_value(counts, QStringLiteral(u"Added")); diff --git a/src/plugins/axivion/dashboard/concat.cpp b/src/plugins/axivion/dashboard/concat.cpp index 837cf4a311a..1da7f2b081f 100644 --- a/src/plugins/axivion/dashboard/concat.cpp +++ b/src/plugins/axivion/dashboard/concat.cpp @@ -17,7 +17,8 @@ #include <utility> template<typename Input, typename Output> -static Output concat(const std::initializer_list<const Input> &args) { +static Output concat(const std::initializer_list<const Input> &args) +{ size_t size = 0; for (const Input &arg : args) size += arg.size(); @@ -28,14 +29,17 @@ static Output concat(const std::initializer_list<const Input> &args) { return output; } -std::string concat(const std::initializer_list<const std::string_view> &args) { +std::string concat(const std::initializer_list<const std::string_view> &args) +{ return concat<std::string_view, std::string>(args); } -QString concat(const std::initializer_list<const QStringView> &args) { +QString concat(const std::initializer_list<const QStringView> &args) +{ return concat<QStringView, QString>(args); } -QByteArray concat_bytes(const std::initializer_list<const QByteArrayView> &args) { +QByteArray concat_bytes(const std::initializer_list<const QByteArrayView> &args) +{ return concat<QByteArrayView, QByteArray>(args); } diff --git a/src/plugins/axivion/dashboard/dto.cpp b/src/plugins/axivion/dashboard/dto.cpp index 5c0747ea9e5..607c227816c 100644 --- a/src/plugins/axivion/dashboard/dto.cpp +++ b/src/plugins/axivion/dashboard/dto.cpp @@ -597,11 +597,11 @@ namespace Axivion::Internal::Dto { } if (json.isObject()) { - return Any(deserialize_json<std::map<QString, Any>>(json)); + return Any(deserialize_json<Any::Map>(json)); } if (json.isArray()) { - return Any(deserialize_json<std::vector<Any>>(json)); + return Any(deserialize_json<Any::Vector>(json)); } if (json.isBool()) { @@ -657,9 +657,9 @@ namespace Axivion::Internal::Dto { Any::Any(double value) : data(std::move(value)) {} - Any::Any(std::map<QString, Any> value) : data(std::move(value)) {} + Any::Any(Map value) : data(std::move(value)) {} - Any::Any(std::vector<Any> value) : data(std::move(value)) {} + Any::Any(Vector value) : data(std::move(value)) {} Any::Any(bool value) : data(std::move(value)) {} @@ -702,12 +702,12 @@ namespace Axivion::Internal::Dto { return this->data.index() == 3; } - std::map<QString, Any> &Any::getMap() + Any::Map &Any::getMap() { return std::get<3>(this->data); } - const std::map<QString, Any> &Any::getMap() const + const Any::Map &Any::getMap() const { return std::get<3>(this->data); } @@ -717,12 +717,12 @@ namespace Axivion::Internal::Dto { return this->data.index() == 4; } - std::vector<Any> &Any::getList() + Any::Vector &Any::getList() { return std::get<4>(this->data); } - const std::vector<Any> &Any::getList() const + const Any::Vector &Any::getList() const { return std::get<4>(this->data); } diff --git a/src/plugins/axivion/dashboard/dto.h b/src/plugins/axivion/dashboard/dto.h index fe36257afb2..bdede500c39 100644 --- a/src/plugins/axivion/dashboard/dto.h +++ b/src/plugins/axivion/dashboard/dto.h @@ -62,18 +62,13 @@ namespace Axivion::Internal::Dto virtual ~Serializable() = default; }; - class Any : public Serializable { - private: - std::variant< - std::nullptr_t, // .index() == 0 - QString, // .index() == 1 - double, // .index() == 2 - std::map<QString, Any>, // .index() == 3 - std::vector<Any>, // .index() == 4 - bool // .index() == 5 - > data; - + class Any : public Serializable + { public: + using Map = std::map<QString, Any>; + using MapEntry = std::pair<const QString, Any>; + using Vector = std::vector<Any>; + // Throws Axivion::Internal::Dto::invalid_dto_exception static Any deserialize(const QByteArray &json); @@ -83,9 +78,9 @@ namespace Axivion::Internal::Dto Any(double value); - Any(std::map<QString, Any> value); + Any(Map value); - Any(std::vector<Any> value); + Any(Vector value); Any(bool value); @@ -110,18 +105,18 @@ namespace Axivion::Internal::Dto bool isMap() const; // Throws std::bad_variant_access - std::map<QString, Any> &getMap(); + Map &getMap(); // Throws std::bad_variant_access - const std::map<QString, Any> &getMap() const; + const Map &getMap() const; bool isList() const; // Throws std::bad_variant_access - std::vector<Any> &getList(); + Vector &getList(); // Throws std::bad_variant_access - const std::vector<Any> &getList() const; + const Vector &getList() const; bool isBool() const; @@ -132,9 +127,20 @@ namespace Axivion::Internal::Dto const bool &getBool() const; virtual QByteArray serialize() const override; + + private: + std::variant< + std::nullptr_t, // .index() == 0 + QString, // .index() == 1 + double, // .index() == 2 + Map, // .index() == 3 + Vector, // .index() == 4 + bool // .index() == 5 + > data; }; - class ApiVersion { + class ApiVersion + { public: static const std::array<qint32, 4> number; static const QLatin1String string; From c72734e6781d16105382af5c0112f5bddd5f365d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 8 Aug 2023 22:23:43 +0200 Subject: [PATCH 0834/1777] AndroidManager: Make it a namespace Unexport it, as it seems that no method is used outside of the Android plugin. Change-Id: I5c76234a1f37ddfa3dcfa51ded5a441163ec9093 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/android/androidmanager.cpp | 97 +++++++++++------------- src/plugins/android/androidmanager.h | 101 +++++++++++-------------- 2 files changed, 89 insertions(+), 109 deletions(-) diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index 78a697cf7ef..e01fcf76ac7 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -37,7 +37,7 @@ using namespace Utils; using namespace Android::Internal; -namespace Android { +namespace Android::AndroidManager { const char AndroidManifestName[] = "AndroidManifest.xml"; const char AndroidDeviceSn[] = "AndroidDeviceSerialNumber"; @@ -67,7 +67,7 @@ static const ProjectNode *currentProjectNode(const Target *target) return target->project()->findNodeForBuildKey(target->activeBuildKey()); } -QString AndroidManager::packageName(const Target *target) +QString packageName(const Target *target) { QDomDocument doc; if (!openManifest(target, doc)) @@ -76,7 +76,7 @@ QString AndroidManager::packageName(const Target *target) return manifestElem.attribute(QLatin1String("package")); } -QString AndroidManager::packageName(const FilePath &manifestFile) +QString packageName(const FilePath &manifestFile) { QDomDocument doc; if (!openXmlFile(doc, manifestFile)) @@ -85,7 +85,7 @@ QString AndroidManager::packageName(const FilePath &manifestFile) return manifestElem.attribute(QLatin1String("package")); } -QString AndroidManager::activityName(const Target *target) +QString activityName(const Target *target) { QDomDocument doc; if (!openManifest(target, doc)) @@ -100,7 +100,7 @@ QString AndroidManager::activityName(const Target *target) of the kit is returned if the manifest file of the APK cannot be found or parsed. */ -int AndroidManager::minimumSDK(const Target *target) +int minimumSDK(const Target *target) { QDomDocument doc; if (!openXmlFile(doc, AndroidManager::manifestSourcePath(target))) @@ -115,7 +115,7 @@ int AndroidManager::minimumSDK(const Target *target) Returns the minimum Android API level required by the kit to compile. -1 is returned if the kit does not support Android. */ -int AndroidManager::minimumSDK(const Kit *kit) +int minimumSDK(const Kit *kit) { int minSdkVersion = -1; QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit); @@ -132,7 +132,7 @@ int AndroidManager::minimumSDK(const Kit *kit) return minSdkVersion; } -QString AndroidManager::buildTargetSDK(const Target *target) +QString buildTargetSDK(const Target *target) { if (auto bc = target->activeBuildConfiguration()) { if (auto androidBuildApkStep = bc->buildSteps()->firstOfType<AndroidBuildApkStep>()) @@ -144,13 +144,13 @@ QString AndroidManager::buildTargetSDK(const Target *target) return fallback; } -QStringList AndroidManager::applicationAbis(const Target *target) +QStringList applicationAbis(const Target *target) { auto qt = dynamic_cast<AndroidQtVersion *>(QtSupport::QtKitAspect::qtVersion(target->kit())); return qt ? qt->androidAbis() : QStringList(); } -QString AndroidManager::archTriplet(const QString &abi) +QString archTriplet(const QString &abi) { if (abi == ProjectExplorer::Constants::ANDROID_ABI_X86) { return {"i686-linux-android"}; @@ -162,7 +162,7 @@ QString AndroidManager::archTriplet(const QString &abi) return {"arm-linux-androideabi"}; } -QJsonObject AndroidManager::deploymentSettings(const Target *target) +QJsonObject deploymentSettings(const Target *target) { QtSupport::QtVersion *qt = QtSupport::QtKitAspect::qtVersion(target->kit()); if (!qt) @@ -196,7 +196,7 @@ QJsonObject AndroidManager::deploymentSettings(const Target *target) return settings; } -bool AndroidManager::isQtCreatorGenerated(const FilePath &deploymentFile) +bool isQtCreatorGenerated(const FilePath &deploymentFile) { QFile f{deploymentFile.toString()}; if (!f.open(QIODevice::ReadOnly)) @@ -204,17 +204,17 @@ bool AndroidManager::isQtCreatorGenerated(const FilePath &deploymentFile) return QJsonDocument::fromJson(f.readAll()).object()["_description"].toString() == qtcSignature; } -FilePath AndroidManager::androidBuildDirectory(const Target *target) +FilePath androidBuildDirectory(const Target *target) { return buildDirectory(target) / Constants::ANDROID_BUILD_DIRECTORY; } -FilePath AndroidManager::androidAppProcessDir(const Target *target) +FilePath androidAppProcessDir(const Target *target) { return buildDirectory(target) / Constants::ANDROID_APP_PROCESS_DIRECTORY; } -bool AndroidManager::isQt5CmakeProject(const ProjectExplorer::Target *target) +bool isQt5CmakeProject(const ProjectExplorer::Target *target) { const QtSupport::QtVersion *qt = QtSupport::QtKitAspect::qtVersion(target->kit()); const bool isQt5 = qt && qt->qtVersion() < QVersionNumber(6, 0, 0); @@ -223,7 +223,7 @@ bool AndroidManager::isQt5CmakeProject(const ProjectExplorer::Target *target) return isQt5 && isCmakeProject; } -FilePath AndroidManager::buildDirectory(const Target *target) +FilePath buildDirectory(const Target *target) { if (const BuildSystem *bs = target->buildSystem()) { const QString buildKey = target->activeBuildKey(); @@ -253,12 +253,10 @@ FilePath AndroidManager::buildDirectory(const Target *target) return {}; } -enum PackageFormat { - Apk, - Aab -}; +enum PackageFormat { Apk, Aab }; -QString packageSubPath(PackageFormat format, BuildConfiguration::BuildType buildType, bool sig) +static QString packageSubPath(PackageFormat format, BuildConfiguration::BuildType buildType, + bool sig) { const bool deb = (buildType == BuildConfiguration::Debug); @@ -274,7 +272,7 @@ QString packageSubPath(PackageFormat format, BuildConfiguration::BuildType build : "bundle/release/android-build-release.aab"); } -FilePath AndroidManager::packagePath(const Target *target) +FilePath packagePath(const Target *target) { QTC_ASSERT(target, return {}); @@ -291,7 +289,7 @@ FilePath AndroidManager::packagePath(const Target *target) return androidBuildDirectory(target) / "build/outputs" / subPath; } -bool AndroidManager::matchedAbis(const QStringList &deviceAbis, const QStringList &appAbis) +bool matchedAbis(const QStringList &deviceAbis, const QStringList &appAbis) { for (const auto &abi : appAbis) { if (deviceAbis.contains(abi)) @@ -300,7 +298,7 @@ bool AndroidManager::matchedAbis(const QStringList &deviceAbis, const QStringLis return false; } -QString AndroidManager::devicePreferredAbi(const QStringList &deviceAbis, const QStringList &appAbis) +QString devicePreferredAbi(const QStringList &deviceAbis, const QStringList &appAbis) { for (const auto &abi : appAbis) { if (deviceAbis.contains(abi)) @@ -309,7 +307,7 @@ QString AndroidManager::devicePreferredAbi(const QStringList &deviceAbis, const return {}; } -Abi AndroidManager::androidAbi2Abi(const QString &androidAbi) +Abi androidAbi2Abi(const QString &androidAbi) { if (androidAbi == ProjectExplorer::Constants::ANDROID_ABI_ARM64_V8A) { return Abi{Abi::Architecture::ArmArchitecture, @@ -344,7 +342,7 @@ Abi AndroidManager::androidAbi2Abi(const QString &androidAbi) } } -bool AndroidManager::skipInstallationAndPackageSteps(const Target *target) +bool skipInstallationAndPackageSteps(const Target *target) { // For projects using Qt 5.15 and Qt 6, the deployment settings file // is generated by CMake/qmake and not Qt Creator, so if such file doesn't exist @@ -367,7 +365,7 @@ bool AndroidManager::skipInstallationAndPackageSteps(const Target *target) return n == nullptr; // If no Application target found, then skip steps } -FilePath AndroidManager::manifestSourcePath(const Target *target) +FilePath manifestSourcePath(const Target *target) { if (const ProjectNode *node = currentProjectNode(target)) { const QString packageSource @@ -381,7 +379,7 @@ FilePath AndroidManager::manifestSourcePath(const Target *target) return manifestPath(target); } -FilePath AndroidManager::manifestPath(const Target *target) +FilePath manifestPath(const Target *target) { QVariant manifest = target->namedSettings(AndroidManifestName); if (manifest.isValid()) @@ -389,17 +387,17 @@ FilePath AndroidManager::manifestPath(const Target *target) return androidBuildDirectory(target).pathAppended(AndroidManifestName); } -void AndroidManager::setManifestPath(Target *target, const FilePath &path) +void setManifestPath(Target *target, const FilePath &path) { target->setNamedSettings(AndroidManifestName, QVariant::fromValue(path)); } -QString AndroidManager::deviceSerialNumber(const Target *target) +QString deviceSerialNumber(const Target *target) { return target->namedSettings(AndroidDeviceSn).toString(); } -void AndroidManager::setDeviceSerialNumber(Target *target, const QString &deviceSerialNumber) +void setDeviceSerialNumber(Target *target, const QString &deviceSerialNumber) { qCDebug(androidManagerLog) << "Target device serial changed:" << target->displayName() << deviceSerialNumber; @@ -416,7 +414,7 @@ static QString preferredAbi(const QStringList &appAbis, const Target *target) return {}; } -QString AndroidManager::apkDevicePreferredAbi(const Target *target) +QString apkDevicePreferredAbi(const Target *target) { const FilePath libsPath = androidBuildDirectory(target).pathAppended("libs"); if (!libsPath.exists()) { @@ -436,24 +434,24 @@ QString AndroidManager::apkDevicePreferredAbi(const Target *target) return preferredAbi(apkAbis, target); } -void AndroidManager::setDeviceAbis(Target *target, const QStringList &deviceAbis) +void setDeviceAbis(Target *target, const QStringList &deviceAbis) { target->setNamedSettings(AndroidDeviceAbis, deviceAbis); } -int AndroidManager::deviceApiLevel(const Target *target) +int deviceApiLevel(const Target *target) { return target->namedSettings(ApiLevelKey).toInt(); } -void AndroidManager::setDeviceApiLevel(Target *target, int level) +void setDeviceApiLevel(Target *target, int level) { qCDebug(androidManagerLog) << "Target device API level changed:" << target->displayName() << level; target->setNamedSettings(ApiLevelKey, level); } -int AndroidManager::defaultMinimumSDK(const QtSupport::QtVersion *qtVersion) +int defaultMinimumSDK(const QtSupport::QtVersion *qtVersion) { if (qtVersion && qtVersion->qtVersion() >= QVersionNumber(6, 0)) return 23; @@ -463,7 +461,7 @@ int AndroidManager::defaultMinimumSDK(const QtSupport::QtVersion *qtVersion) return 16; } -QString AndroidManager::androidNameForApiLevel(int x) +QString androidNameForApiLevel(int x) { switch (x) { case 2: @@ -572,7 +570,7 @@ static int parseMinSdk(const QDomElement &manifestElem) return 0; } -void AndroidManager::installQASIPackage(Target *target, const FilePath &packagePath) +void installQASIPackage(Target *target, const FilePath &packagePath) { const QStringList appAbis = AndroidManager::applicationAbis(target); if (appAbis.isEmpty()) @@ -602,8 +600,7 @@ void AndroidManager::installQASIPackage(Target *target, const FilePath &packageP } } -bool AndroidManager::checkKeystorePassword(const FilePath &keystorePath, - const QString &keystorePasswd) +bool checkKeystorePassword(const FilePath &keystorePath, const QString &keystorePasswd) { if (keystorePasswd.isEmpty()) return false; @@ -617,10 +614,8 @@ bool AndroidManager::checkKeystorePassword(const FilePath &keystorePath, return proc.result() == ProcessResult::FinishedWithSuccess; } -bool AndroidManager::checkCertificatePassword(const FilePath &keystorePath, - const QString &keystorePasswd, - const QString &alias, - const QString &certificatePasswd) +bool checkCertificatePassword(const FilePath &keystorePath, const QString &keystorePasswd, + const QString &alias, const QString &certificatePasswd) { // assumes that the keystore password is correct QStringList arguments = {"-certreq", "-keystore", keystorePath.toUserOutput(), @@ -637,8 +632,8 @@ bool AndroidManager::checkCertificatePassword(const FilePath &keystorePath, return proc.result() == ProcessResult::FinishedWithSuccess; } -bool AndroidManager::checkCertificateExists(const FilePath &keystorePath, - const QString &keystorePasswd, const QString &alias) +bool checkCertificateExists(const FilePath &keystorePath, const QString &keystorePasswd, + const QString &alias) { // assumes that the keystore password is correct QStringList arguments = { "-list", "-keystore", keystorePath.toUserOutput(), @@ -651,7 +646,7 @@ bool AndroidManager::checkCertificateExists(const FilePath &keystorePath, return proc.result() == ProcessResult::FinishedWithSuccess; } -Process *AndroidManager::startAdbProcess(const QStringList &args, QString *err) +Process *startAdbProcess(const QStringList &args, QString *err) { std::unique_ptr<Process> process(new Process); const FilePath adb = AndroidConfigurations::currentConfig().adbToolPath(); @@ -670,8 +665,8 @@ Process *AndroidManager::startAdbProcess(const QStringList &args, QString *err) return nullptr; } -SdkToolResult AndroidManager::runCommand(const CommandLine &command, - const QByteArray &writeData, int timeoutS) +static SdkToolResult runCommand(const CommandLine &command, const QByteArray &writeData, + int timeoutS) { Android::SdkToolResult cmdResult; Process cmdProc; @@ -691,10 +686,10 @@ SdkToolResult AndroidManager::runCommand(const CommandLine &command, return cmdResult; } -SdkToolResult AndroidManager::runAdbCommand(const QStringList &args, - const QByteArray &writeData, int timeoutS) +SdkToolResult runAdbCommand(const QStringList &args, const QByteArray &writeData, int timeoutS) { return runCommand({AndroidConfigurations::currentConfig().adbToolPath(), args}, writeData, timeoutS); } -} // namespace Android + +} // namespace Android::AndroidManager diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index 0d6db5369cd..b8ea9b167fb 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -3,12 +3,6 @@ #pragma once -#include "android_global.h" - -#include <QPair> -#include <QObject> -#include <QVersionNumber> - #include <qtsupport/baseqtversion.h> #include <projectexplorer/abi.h> @@ -18,7 +12,6 @@ class Target; } namespace Utils { -class CommandLine; class FilePath; class Process; } @@ -33,77 +26,69 @@ public: const QString &stdErr() const { return m_stdErr; } const QString &exitMessage() const { return m_exitMessage; } -private: bool m_success = false; QString m_stdOut; QString m_stdErr; QString m_exitMessage; - friend class AndroidManager; }; -class ANDROID_EXPORT AndroidManager : public QObject +namespace AndroidManager { - Q_OBJECT -public: - static QString packageName(const ProjectExplorer::Target *target); - static QString packageName(const Utils::FilePath &manifestFile); - static QString activityName(const ProjectExplorer::Target *target); +QString packageName(const ProjectExplorer::Target *target); +QString packageName(const Utils::FilePath &manifestFile); +QString activityName(const ProjectExplorer::Target *target); - static QString deviceSerialNumber(const ProjectExplorer::Target *target); - static void setDeviceSerialNumber(ProjectExplorer::Target *target, const QString &deviceSerialNumber); +QString deviceSerialNumber(const ProjectExplorer::Target *target); +void setDeviceSerialNumber(ProjectExplorer::Target *target, const QString &deviceSerialNumber); - static QString apkDevicePreferredAbi(const ProjectExplorer::Target *target); - static void setDeviceAbis(ProjectExplorer::Target *target, const QStringList &deviceAbis); +QString apkDevicePreferredAbi(const ProjectExplorer::Target *target); +void setDeviceAbis(ProjectExplorer::Target *target, const QStringList &deviceAbis); - static int deviceApiLevel(const ProjectExplorer::Target *target); - static void setDeviceApiLevel(ProjectExplorer::Target *target, int level); +int deviceApiLevel(const ProjectExplorer::Target *target); +void setDeviceApiLevel(ProjectExplorer::Target *target, int level); - static QString buildTargetSDK(const ProjectExplorer::Target *target); +QString buildTargetSDK(const ProjectExplorer::Target *target); - static int minimumSDK(const ProjectExplorer::Target *target); - static int minimumSDK(const ProjectExplorer::Kit *kit); - static int defaultMinimumSDK(const QtSupport::QtVersion *qtVersion); +int minimumSDK(const ProjectExplorer::Target *target); +int minimumSDK(const ProjectExplorer::Kit *kit); +int defaultMinimumSDK(const QtSupport::QtVersion *qtVersion); - static QStringList applicationAbis(const ProjectExplorer::Target *target); - static QString archTriplet(const QString &abi); +QStringList applicationAbis(const ProjectExplorer::Target *target); +QString archTriplet(const QString &abi); - static bool isQt5CmakeProject(const ProjectExplorer::Target *target); +bool isQt5CmakeProject(const ProjectExplorer::Target *target); - static Utils::FilePath androidBuildDirectory(const ProjectExplorer::Target *target); - static Utils::FilePath androidAppProcessDir(const ProjectExplorer::Target *target); - static Utils::FilePath buildDirectory(const ProjectExplorer::Target *target); - static Utils::FilePath manifestPath(const ProjectExplorer::Target *target); - static void setManifestPath(ProjectExplorer::Target *target, const Utils::FilePath &path); - static Utils::FilePath manifestSourcePath(const ProjectExplorer::Target *target); - static Utils::FilePath packagePath(const ProjectExplorer::Target *target); - static bool matchedAbis(const QStringList &deviceAbis, const QStringList &appAbis); - static QString devicePreferredAbi(const QStringList &deviceAbis, const QStringList &appAbis); - static ProjectExplorer::Abi androidAbi2Abi(const QString &androidAbi); - static bool skipInstallationAndPackageSteps(const ProjectExplorer::Target *target); +Utils::FilePath androidBuildDirectory(const ProjectExplorer::Target *target); +Utils::FilePath androidAppProcessDir(const ProjectExplorer::Target *target); +Utils::FilePath buildDirectory(const ProjectExplorer::Target *target); +Utils::FilePath manifestPath(const ProjectExplorer::Target *target); +void setManifestPath(ProjectExplorer::Target *target, const Utils::FilePath &path); +Utils::FilePath manifestSourcePath(const ProjectExplorer::Target *target); +Utils::FilePath packagePath(const ProjectExplorer::Target *target); +bool matchedAbis(const QStringList &deviceAbis, const QStringList &appAbis); +QString devicePreferredAbi(const QStringList &deviceAbis, const QStringList &appAbis); +ProjectExplorer::Abi androidAbi2Abi(const QString &androidAbi); +bool skipInstallationAndPackageSteps(const ProjectExplorer::Target *target); - static QString androidNameForApiLevel(int x); +QString androidNameForApiLevel(int x); - static void installQASIPackage(ProjectExplorer::Target *target, const Utils::FilePath &packagePath); +void installQASIPackage(ProjectExplorer::Target *target, const Utils::FilePath &packagePath); - static bool checkKeystorePassword(const Utils::FilePath &keystorePath, - const QString &keystorePasswd); - static bool checkCertificatePassword(const Utils::FilePath &keystorePath, - const QString &keystorePasswd, - const QString &alias, const QString &certificatePasswd); - static bool checkCertificateExists(const Utils::FilePath &keystorePath, - const QString &keystorePasswd, const QString &alias); +bool checkKeystorePassword(const Utils::FilePath &keystorePath, + const QString &keystorePasswd); +bool checkCertificatePassword(const Utils::FilePath &keystorePath, + const QString &keystorePasswd, + const QString &alias, const QString &certificatePasswd); +bool checkCertificateExists(const Utils::FilePath &keystorePath, + const QString &keystorePasswd, const QString &alias); - static Utils::Process *startAdbProcess(const QStringList &args, QString *err = nullptr); - static SdkToolResult runAdbCommand(const QStringList &args, const QByteArray &writeData = {}, - int timeoutS = 30); +Utils::Process *startAdbProcess(const QStringList &args, QString *err = nullptr); +SdkToolResult runAdbCommand(const QStringList &args, const QByteArray &writeData = {}, + int timeoutS = 30); - static QJsonObject deploymentSettings(const ProjectExplorer::Target *target); - static bool isQtCreatorGenerated(const Utils::FilePath &deploymentFile); - -private: - static SdkToolResult runCommand(const Utils::CommandLine &command, - const QByteArray &writeData = {}, int timeoutS = 30); -}; +QJsonObject deploymentSettings(const ProjectExplorer::Target *target); +bool isQtCreatorGenerated(const Utils::FilePath &deploymentFile); +} // namespace AndroidManager } // namespace Android From 53f16e9b4958088f9511a2e2244c9827d7f23641 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 9 Aug 2023 17:29:49 +0200 Subject: [PATCH 0835/1777] AndroidManager: Remove some unused functions Hide one internally used function. Change-Id: If286880397a1c6fd808b3eee22332e905911f4d1 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/android/androidmanager.cpp | 48 ++++++++------------------ src/plugins/android/androidmanager.h | 3 -- 2 files changed, 15 insertions(+), 36 deletions(-) diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index e01fcf76ac7..d8fd53432cc 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -95,6 +95,20 @@ QString activityName(const Target *target) return activityElem.attribute(QLatin1String("android:name")); } +static FilePath manifestSourcePath(const Target *target) +{ + if (const ProjectNode *node = currentProjectNode(target)) { + const QString packageSource + = node->data(Android::Constants::AndroidPackageSourceDir).toString(); + if (!packageSource.isEmpty()) { + const FilePath manifest = FilePath::fromUserInput(packageSource + "/AndroidManifest.xml"); + if (manifest.exists()) + return manifest; + } + } + return manifestPath(target); +} + /*! Returns the minimum Android API level set for the APK. Minimum API level of the kit is returned if the manifest file of the APK cannot be found @@ -103,7 +117,7 @@ QString activityName(const Target *target) int minimumSDK(const Target *target) { QDomDocument doc; - if (!openXmlFile(doc, AndroidManager::manifestSourcePath(target))) + if (!openXmlFile(doc, manifestSourcePath(target))) return minimumSDK(target->kit()); const int minSdkVersion = parseMinSdk(doc.documentElement()); if (minSdkVersion == 0) @@ -289,24 +303,6 @@ FilePath packagePath(const Target *target) return androidBuildDirectory(target) / "build/outputs" / subPath; } -bool matchedAbis(const QStringList &deviceAbis, const QStringList &appAbis) -{ - for (const auto &abi : appAbis) { - if (deviceAbis.contains(abi)) - return true; - } - return false; -} - -QString devicePreferredAbi(const QStringList &deviceAbis, const QStringList &appAbis) -{ - for (const auto &abi : appAbis) { - if (deviceAbis.contains(abi)) - return abi; - } - return {}; -} - Abi androidAbi2Abi(const QString &androidAbi) { if (androidAbi == ProjectExplorer::Constants::ANDROID_ABI_ARM64_V8A) { @@ -365,20 +361,6 @@ bool skipInstallationAndPackageSteps(const Target *target) return n == nullptr; // If no Application target found, then skip steps } -FilePath manifestSourcePath(const Target *target) -{ - if (const ProjectNode *node = currentProjectNode(target)) { - const QString packageSource - = node->data(Android::Constants::AndroidPackageSourceDir).toString(); - if (!packageSource.isEmpty()) { - const FilePath manifest = FilePath::fromUserInput(packageSource + "/AndroidManifest.xml"); - if (manifest.exists()) - return manifest; - } - } - return manifestPath(target); -} - FilePath manifestPath(const Target *target) { QVariant manifest = target->namedSettings(AndroidManifestName); diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index b8ea9b167fb..7a141b58ce5 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -64,10 +64,7 @@ Utils::FilePath androidAppProcessDir(const ProjectExplorer::Target *target); Utils::FilePath buildDirectory(const ProjectExplorer::Target *target); Utils::FilePath manifestPath(const ProjectExplorer::Target *target); void setManifestPath(ProjectExplorer::Target *target, const Utils::FilePath &path); -Utils::FilePath manifestSourcePath(const ProjectExplorer::Target *target); Utils::FilePath packagePath(const ProjectExplorer::Target *target); -bool matchedAbis(const QStringList &deviceAbis, const QStringList &appAbis); -QString devicePreferredAbi(const QStringList &deviceAbis, const QStringList &appAbis); ProjectExplorer::Abi androidAbi2Abi(const QString &androidAbi); bool skipInstallationAndPackageSteps(const ProjectExplorer::Target *target); From 201b28f362bb064b274b879b9c60c0b559786c92 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 18 Aug 2023 09:55:43 +0200 Subject: [PATCH 0836/1777] Android: Unexport Android plugin It doesn't seem that any class from this plugin is used outside. Change-Id: I88a63e4c41cbd4b20f0de8bbd05668f55bafdc97 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/android/CMakeLists.txt | 1 - src/plugins/android/android.qbs | 2 +- src/plugins/android/android_global.h | 14 -------------- src/plugins/android/androidconfigurations.h | 5 ++--- src/plugins/android/androidextralibrarylistmodel.h | 4 +--- src/plugins/android/androidrunconfiguration.h | 2 -- src/plugins/android/createandroidmanifestwizard.h | 2 -- 7 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 src/plugins/android/android_global.h diff --git a/src/plugins/android/CMakeLists.txt b/src/plugins/android/CMakeLists.txt index f49e57ba58c..6048a5ecd76 100644 --- a/src/plugins/android/CMakeLists.txt +++ b/src/plugins/android/CMakeLists.txt @@ -3,7 +3,6 @@ add_qtc_plugin(Android PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport LanguageClient SOURCES android.qrc - android_global.h androidtr.h androidavdmanager.cpp androidavdmanager.h androidbuildapkstep.cpp androidbuildapkstep.h diff --git a/src/plugins/android/android.qbs b/src/plugins/android/android.qbs index 2baca19e0f2..a8fbd7c818a 100644 --- a/src/plugins/android/android.qbs +++ b/src/plugins/android/android.qbs @@ -17,7 +17,7 @@ Project { Depends { name: "Utils" } files: [ - "android_global.h", "androidtr.h", + "androidtr.h", "android.qrc", "androidavdmanager.cpp", "androidavdmanager.h", diff --git a/src/plugins/android/android_global.h b/src/plugins/android/android_global.h deleted file mode 100644 index 377e46f773f..00000000000 --- a/src/plugins/android/android_global.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2016 BogDan Vatra <bog_dan_ro@yahoo.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <qglobal.h> - -#if defined(ANDROID_LIBRARY) -# define ANDROID_EXPORT Q_DECL_EXPORT -#elif defined(ANDROID_STATIC_LIBRARY) -# define ANDROID_EXPORT -#else -# define ANDROID_EXPORT Q_DECL_IMPORT -#endif diff --git a/src/plugins/android/androidconfigurations.h b/src/plugins/android/androidconfigurations.h index f55dbd14559..e0d74c05222 100644 --- a/src/plugins/android/androidconfigurations.h +++ b/src/plugins/android/androidconfigurations.h @@ -4,7 +4,6 @@ #pragma once -#include "android_global.h" #include "androiddeviceinfo.h" #include "androidsdkmanager.h" #include "androidsdkpackage.h" @@ -56,7 +55,7 @@ public: bool containsVersion(const QVersionNumber &qtVersion) const; }; -class ANDROID_EXPORT AndroidConfig +class AndroidConfig { public: void load(const QSettings &settings); @@ -183,7 +182,7 @@ private: mutable QHash<QString, QString> m_serialNumberToDeviceName; }; -class ANDROID_EXPORT AndroidConfigurations : public QObject +class AndroidConfigurations : public QObject { Q_OBJECT diff --git a/src/plugins/android/androidextralibrarylistmodel.h b/src/plugins/android/androidextralibrarylistmodel.h index 0d42d4d9602..6f236cb8eac 100644 --- a/src/plugins/android/androidextralibrarylistmodel.h +++ b/src/plugins/android/androidextralibrarylistmodel.h @@ -4,8 +4,6 @@ #pragma once -#include "android_global.h" - #include <QAbstractItemModel> #include <QStringList> @@ -13,7 +11,7 @@ namespace ProjectExplorer { class BuildSystem; } namespace Android { -class ANDROID_EXPORT AndroidExtraLibraryListModel : public QAbstractItemModel +class AndroidExtraLibraryListModel : public QAbstractItemModel { Q_OBJECT diff --git a/src/plugins/android/androidrunconfiguration.h b/src/plugins/android/androidrunconfiguration.h index 9ad677aeef3..8652c4ddfc6 100644 --- a/src/plugins/android/androidrunconfiguration.h +++ b/src/plugins/android/androidrunconfiguration.h @@ -3,8 +3,6 @@ #pragma once -#include "android_global.h" - #include <projectexplorer/runconfiguration.h> namespace Android { diff --git a/src/plugins/android/createandroidmanifestwizard.h b/src/plugins/android/createandroidmanifestwizard.h index e1552311317..4d5a309583f 100644 --- a/src/plugins/android/createandroidmanifestwizard.h +++ b/src/plugins/android/createandroidmanifestwizard.h @@ -3,8 +3,6 @@ #pragma once -#include "android_global.h" - #include <utils/fileutils.h> #include <utils/wizard.h> From 45bae4b5257e3746b3477fce7478c018d0813f7c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 22 Aug 2023 08:31:00 +0200 Subject: [PATCH 0837/1777] ProjectExplorer: De-Q_OBJECT-ify FilterTreeView ... and rename some local variables. Change-Id: Ia54a96a4f40c7f4b5ded29df34a12e718d86bd3c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../filterkitaspectsdialog.cpp | 24 +++++++++---------- .../projectexplorer/filterkitaspectsdialog.h | 1 - 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/plugins/projectexplorer/filterkitaspectsdialog.cpp b/src/plugins/projectexplorer/filterkitaspectsdialog.cpp index ebba30050ee..a6ff108dc5d 100644 --- a/src/plugins/projectexplorer/filterkitaspectsdialog.cpp +++ b/src/plugins/projectexplorer/filterkitaspectsdialog.cpp @@ -18,26 +18,25 @@ using namespace Utils; -namespace ProjectExplorer { -namespace Internal { +namespace ProjectExplorer::Internal { class FilterTreeItem : public TreeItem { public: - FilterTreeItem(const KitAspectFactory *aspect, bool enabled) : m_aspect(aspect), m_enabled(enabled) + FilterTreeItem(const KitAspectFactory *factory, bool enabled) : m_factory(factory), m_enabled(enabled) { } QString displayName() const { - if (m_aspect->displayName().indexOf('<') < 0) - return m_aspect->displayName(); + if (m_factory->displayName().indexOf('<') < 0) + return m_factory->displayName(); // removing HTML tag because KitAspect::displayName could contain html // e.g. "CMake <a href=\"generator\">generator</a>" (CMakeGeneratorKitAspect) QTextDocument html; - html.setHtml(m_aspect->displayName()); + html.setHtml(m_factory->displayName()); return html.toPlainText(); } - Utils::Id id() const { return m_aspect->id(); } + Utils::Id id() const { return m_factory->id(); } bool enabled() const { return m_enabled; } private: @@ -53,7 +52,7 @@ private: bool setData(int column, const QVariant &data, int role) override { - QTC_ASSERT(column == 1 && !m_aspect->isEssential(), return false); + QTC_ASSERT(column == 1 && !m_factory->isEssential(), return false); if (role == Qt::CheckStateRole) { m_enabled = data.toInt() == Qt::Checked; return true; @@ -65,14 +64,14 @@ private: { QTC_ASSERT(column < 2, return Qt::ItemFlags()); Qt::ItemFlags flags = Qt::ItemIsSelectable; - if (column == 0 || !m_aspect->isEssential()) + if (column == 0 || !m_factory->isEssential()) flags |= Qt::ItemIsEnabled; - if (column == 1 && !m_aspect->isEssential()) + if (column == 1 && !m_factory->isEssential()) flags |= Qt::ItemIsUserCheckable; return flags; } - const KitAspectFactory * const m_aspect; + const KitAspectFactory * const m_factory; bool m_enabled; }; @@ -148,5 +147,4 @@ QSet<Utils::Id> FilterKitAspectsDialog::irrelevantAspects() const return static_cast<FilterKitAspectsModel *>(m_model)->disabledItems(); } -} // namespace Internal -} // namespace ProjectExplorer +} // ProjectExplorer::Internal diff --git a/src/plugins/projectexplorer/filterkitaspectsdialog.h b/src/plugins/projectexplorer/filterkitaspectsdialog.h index 0f7e8c2d414..7ad98f3da25 100644 --- a/src/plugins/projectexplorer/filterkitaspectsdialog.h +++ b/src/plugins/projectexplorer/filterkitaspectsdialog.h @@ -15,7 +15,6 @@ namespace Internal { class FilterKitAspectsDialog : public QDialog { - Q_OBJECT public: FilterKitAspectsDialog(const Kit *kit, QWidget *parent); QSet<Utils::Id> irrelevantAspects() const; From a7630f999f60c448ae9c427fd708ea44280ccafe Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 17 Aug 2023 14:42:06 +0200 Subject: [PATCH 0838/1777] Android: Use a aspect for AndroidBuildStep::buildAAB Testing the water... Change-Id: Ic5bd970519f0ec11e03ba19a24e0aeb2a84a18e3 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/android/androidbuildapkstep.cpp | 34 ++++++++------------- src/plugins/android/androidbuildapkstep.h | 4 +-- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 2018371e362..4286fcc4e3a 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -302,17 +302,12 @@ QWidget *AndroidBuildApkWidget::createAdvancedGroup() auto verboseOutputCheckBox = new QCheckBox(Tr::tr("Verbose output"), group); verboseOutputCheckBox->setChecked(m_step->verboseOutput()); - auto vbox = new QVBoxLayout(group); - QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(m_step->kit()); - if (version && version->qtVersion() >= QVersionNumber(5, 14)) { - auto buildAAB = new QCheckBox(Tr::tr("Build Android App Bundle (*.aab)"), group); - buildAAB->setChecked(m_step->buildAAB()); - connect(buildAAB, &QAbstractButton::toggled, m_step, &AndroidBuildApkStep::setBuildAAB); - vbox->addWidget(buildAAB); - } - vbox->addWidget(openPackageLocationCheckBox); - vbox->addWidget(verboseOutputCheckBox); - vbox->addWidget(m_addDebuggerCheckBox); + Layouting::Column { + m_step->buildAAB, + openPackageLocationCheckBox, + verboseOutputCheckBox, + m_addDebuggerCheckBox + }.attachTo(group); connect(verboseOutputCheckBox, &QAbstractButton::toggled, this, [this](bool checked) { m_step->setVerboseOutput(checked); }); @@ -479,6 +474,11 @@ AndroidBuildApkStep::AndroidBuildApkStep(BuildStepList *parent, Utils::Id id) setImmutable(true); setDisplayName(Tr::tr("Build Android APK")); + QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit()); + + buildAAB.setLabelText(Tr::tr("Build Android App Bundle (*.aab)")); + buildAAB.setVisible(version && version->qtVersion() >= QVersionNumber(5, 14)); + connect(this, &BuildStep::addOutput, this, [this](const QString &string, OutputFormat format) { if (format == OutputFormat::Stderr) stdError(string); @@ -566,7 +566,7 @@ bool AndroidBuildApkStep::init() arguments << "--gradle"; - if (m_buildAAB) + if (buildAAB()) arguments << "--aab" << "--jarsigner"; if (buildType() == BuildConfiguration::Release) { @@ -997,16 +997,6 @@ void AndroidBuildApkStep::setSignPackage(bool b) m_signPackage = b; } -bool AndroidBuildApkStep::buildAAB() const -{ - return m_buildAAB; -} - -void AndroidBuildApkStep::setBuildAAB(bool aab) -{ - m_buildAAB = aab; -} - bool AndroidBuildApkStep::openPackageLocation() const { return m_openPackageLocation; diff --git a/src/plugins/android/androidbuildapkstep.h b/src/plugins/android/androidbuildapkstep.h index 2e41b0ddbb8..b746ddde064 100644 --- a/src/plugins/android/androidbuildapkstep.h +++ b/src/plugins/android/androidbuildapkstep.h @@ -37,8 +37,7 @@ public: bool signPackage() const; void setSignPackage(bool b); - bool buildAAB() const; - void setBuildAAB(bool aab); + Utils::BoolAspect buildAAB{this}; bool openPackageLocation() const; void setOpenPackageLocation(bool open); @@ -72,7 +71,6 @@ private: void reportWarningOrError(const QString &message, ProjectExplorer::Task::TaskType type); void updateBuildToolsVersionInJsonFile(); - bool m_buildAAB = false; bool m_signPackage = false; bool m_verbose = false; bool m_openPackageLocation = false; From 6216c0e9240322f8c79ee58385467f0184f1421f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 22 Aug 2023 10:45:18 +0200 Subject: [PATCH 0839/1777] ProjectExplorer: Don't use object names for KitAspectFactories Not used. Also the debugger knows the typename and these are singletons. Change-Id: I577241876318aa2930bbc36f454846ffa47cb571 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cmakeprojectmanager/cmakekitaspect.cpp | 3 --- src/plugins/debugger/debuggerkitaspect.cpp | 1 - src/plugins/mcusupport/mcukitaspect.cpp | 1 - src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp | 1 - src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp | 1 - src/plugins/projectexplorer/kitaspects.cpp | 6 ------ src/plugins/qbsprojectmanager/qbskitaspect.cpp | 1 - src/plugins/qmakeprojectmanager/qmakekitaspect.cpp | 1 - src/plugins/qtsupport/qtkitaspect.cpp | 1 - 9 files changed, 16 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp index 5deac770937..f2dbb7c9749 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp @@ -218,7 +218,6 @@ private: CMakeKitAspectFactory::CMakeKitAspectFactory() { - setObjectName(QLatin1String("CMakeKitAspect")); setId(Constants::TOOL_ID); setDisplayName(Tr::tr("CMake Tool")); setDescription(Tr::tr("The CMake Tool to use when building a project with CMake.<br>" @@ -568,7 +567,6 @@ static void setGeneratorInfo(Kit *k, const GeneratorInfo &info) CMakeGeneratorKitAspectFactory::CMakeGeneratorKitAspectFactory() { - setObjectName(QLatin1String("CMakeGeneratorKitAspect")); setId(GENERATOR_ID); setDisplayName(Tr::tr("CMake <a href=\"generator\">generator</a>")); setDescription(Tr::tr("CMake generator defines how a project is built when using CMake.<br>" @@ -1058,7 +1056,6 @@ private: CMakeConfigurationKitAspectFactory::CMakeConfigurationKitAspectFactory() { - setObjectName(QLatin1String("CMakeConfigurationKitAspect")); setId(CONFIGURATION_ID); setDisplayName(Tr::tr("CMake Configuration")); setDescription(Tr::tr("Default configuration passed to CMake when setting up a project.")); diff --git a/src/plugins/debugger/debuggerkitaspect.cpp b/src/plugins/debugger/debuggerkitaspect.cpp index ddbdf7bfd29..af3c4050cb6 100644 --- a/src/plugins/debugger/debuggerkitaspect.cpp +++ b/src/plugins/debugger/debuggerkitaspect.cpp @@ -268,7 +268,6 @@ class DebuggerKitAspectFactory : public KitAspectFactory public: DebuggerKitAspectFactory() { - setObjectName("DebuggerKitAspect"); setId(DebuggerKitAspect::id()); setDisplayName(Tr::tr("Debugger")); setDescription(Tr::tr("The debugger to use for this kit.")); diff --git a/src/plugins/mcusupport/mcukitaspect.cpp b/src/plugins/mcusupport/mcukitaspect.cpp index 1cabd21d682..3a26f37614d 100644 --- a/src/plugins/mcusupport/mcukitaspect.cpp +++ b/src/plugins/mcusupport/mcukitaspect.cpp @@ -63,7 +63,6 @@ class McuDependenciesKitAspectFactory final : public KitAspectFactory public: McuDependenciesKitAspectFactory() { - setObjectName(QLatin1String("McuDependenciesKitAspect")); setId(McuDependenciesKitAspect::id()); setDisplayName(Tr::tr("MCU Dependencies")); setDescription(Tr::tr("Paths to 3rd party dependencies")); diff --git a/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp b/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp index 1e33a0ec650..59fc7ffb4a6 100644 --- a/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp +++ b/src/plugins/mesonprojectmanager/mesontoolkitaspect.cpp @@ -33,7 +33,6 @@ class MesonToolKitAspectFactory final : public KitAspectFactory public: MesonToolKitAspectFactory() { - setObjectName(QLatin1String("MesonKitAspect")); setId(TOOL_ID); setDisplayName(Tr::tr("Meson Tool")); setDescription(Tr::tr("The Meson tool to use when building a project with Meson.<br>" diff --git a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp index ccf393e4ded..4dae32a7b0d 100644 --- a/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp +++ b/src/plugins/mesonprojectmanager/ninjatoolkitaspect.cpp @@ -33,7 +33,6 @@ class NinjaToolKitAspectFactory final : public ProjectExplorer::KitAspectFactory public: NinjaToolKitAspectFactory() { - setObjectName(QLatin1String("NinjaKitAspect")); setId(TOOL_ID); setDisplayName(Tr::tr("Ninja Tool")); setDescription(Tr::tr("The Ninja tool to use when building a project with Meson.<br>" diff --git a/src/plugins/projectexplorer/kitaspects.cpp b/src/plugins/projectexplorer/kitaspects.cpp index 5b3d49195d4..d0dea8501ef 100644 --- a/src/plugins/projectexplorer/kitaspects.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -100,7 +100,6 @@ public: SysRootKitAspectFactory::SysRootKitAspectFactory() { - setObjectName(QLatin1String("SysRootInformation")); setId(SysRootKitAspect::id()); setDisplayName(Tr::tr("Sysroot")); setDescription(Tr::tr("The root directory of the system image to use.<br>" @@ -357,7 +356,6 @@ private: ToolChainKitAspectFactory::ToolChainKitAspectFactory() { - setObjectName(QLatin1String("ToolChainInformation")); setId(ToolChainKitAspect::id()); setDisplayName(Tr::tr("Compiler")); setDescription(Tr::tr("The compiler to use for building.<br>" @@ -859,7 +857,6 @@ public: DeviceTypeKitAspectFactory::DeviceTypeKitAspectFactory() { - setObjectName(QLatin1String("DeviceTypeInformation")); setId(DeviceTypeKitAspect::id()); setDisplayName(Tr::tr("Run device type")); setDescription(Tr::tr("The type of device to run applications on.")); @@ -1032,7 +1029,6 @@ private: DeviceKitAspectFactory::DeviceKitAspectFactory() { - setObjectName(QLatin1String("DeviceInformation")); setId(DeviceKitAspect::id()); setDisplayName(Tr::tr("Run device")); setDescription(Tr::tr("The device to run the applications on.")); @@ -1320,7 +1316,6 @@ private: BuildDeviceKitAspectFactory::BuildDeviceKitAspectFactory() { - setObjectName("BuildDeviceInformation"); setId(BuildDeviceKitAspect::id()); setDisplayName(Tr::tr("Build device")); setDescription(Tr::tr("The device used to build applications on.")); @@ -1606,7 +1601,6 @@ public: EnvironmentKitAspectFactory::EnvironmentKitAspectFactory() { - setObjectName(QLatin1String("EnvironmentKitAspect")); setId(EnvironmentKitAspect::id()); setDisplayName(Tr::tr("Environment")); setDescription(Tr::tr("Additional build environment settings when using this kit.")); diff --git a/src/plugins/qbsprojectmanager/qbskitaspect.cpp b/src/plugins/qbsprojectmanager/qbskitaspect.cpp index ef104cec687..e709a0d2bcb 100644 --- a/src/plugins/qbsprojectmanager/qbskitaspect.cpp +++ b/src/plugins/qbsprojectmanager/qbskitaspect.cpp @@ -88,7 +88,6 @@ class QbsKitAspectFactory final : public KitAspectFactory public: QbsKitAspectFactory() { - setObjectName(QLatin1String("QbsKitAspect")); setId(QbsKitAspect::id()); setDisplayName(Tr::tr("Additional Qbs Profile Settings")); setPriority(22000); diff --git a/src/plugins/qmakeprojectmanager/qmakekitaspect.cpp b/src/plugins/qmakeprojectmanager/qmakekitaspect.cpp index e55a91bfdd7..7fc5bec0a58 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitaspect.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitaspect.cpp @@ -108,7 +108,6 @@ class QmakeKitAspectFactory : public KitAspectFactory public: QmakeKitAspectFactory() { - setObjectName(QLatin1String("QmakeKitAspect")); setId(QmakeKitAspect::id()); setDisplayName(Tr::tr("Qt mkspec")); setDescription(Tr::tr("The mkspec to use when building the project with qmake.<br>" diff --git a/src/plugins/qtsupport/qtkitaspect.cpp b/src/plugins/qtsupport/qtkitaspect.cpp index d2b4309d04d..5fcb91acdd8 100644 --- a/src/plugins/qtsupport/qtkitaspect.cpp +++ b/src/plugins/qtsupport/qtkitaspect.cpp @@ -166,7 +166,6 @@ const QtKitAspectFactory theQtKitAspectFactory; QtKitAspectFactory::QtKitAspectFactory() { - setObjectName(QLatin1String("QtKitAspect")); setId(QtKitAspect::id()); setDisplayName(Tr::tr("Qt version")); setDescription(Tr::tr("The Qt library to use for all projects using this kit.<br>" From 72480f5dd6c1b2512e7fbd9a1b3fc3b7a2b6e680 Mon Sep 17 00:00:00 2001 From: Dominic Ernst <qt@mca.dominic-ernst.com> Date: Wed, 23 Aug 2023 07:18:49 +0200 Subject: [PATCH 0840/1777] Todo plugin: add \todo keyword to default settings As Qt Creator supports Doxygen style comments, the Todo plugin should also find the \todo keyword by default. Change-Id: Ic0acbcfe610b7752acfd77dfcc6717895f6e97b7 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/todo/settings.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/todo/settings.cpp b/src/plugins/todo/settings.cpp index d6def9c58e8..cf6c0003de8 100644 --- a/src/plugins/todo/settings.cpp +++ b/src/plugins/todo/settings.cpp @@ -86,6 +86,11 @@ void Settings::setDefault() keyword.color = theme->color(Utils::Theme::OutputPanes_NormalMessageTextColor); keywords.append(keyword); + keyword.name = R"(\todo)"; + keyword.iconType = IconType::Todo; + keyword.color = theme->color(Utils::Theme::OutputPanes_NormalMessageTextColor); + keywords.append(keyword); + keyword.name = "NOTE"; keyword.iconType = IconType::Info; keyword.color = theme->color(Utils::Theme::OutputPanes_NormalMessageTextColor); From 6e6587c5287d0ac6edc2ca5c8577542517aff907 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 23 Aug 2023 10:43:59 +0200 Subject: [PATCH 0841/1777] ProjectExplorer: allow adding expanding project settings widgets Change-Id: I27dee2a8d1b14d1dcc535669e3dc9c5369ec2c81 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/panelswidget.cpp | 7 ++++--- src/plugins/projectexplorer/panelswidget.h | 2 +- src/plugins/projectexplorer/projectsettingswidget.cpp | 10 ++++++++++ src/plugins/projectexplorer/projectsettingswidget.h | 4 ++++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/plugins/projectexplorer/panelswidget.cpp b/src/plugins/projectexplorer/panelswidget.cpp index e327f05b542..e83eb9045c8 100644 --- a/src/plugins/projectexplorer/panelswidget.cpp +++ b/src/plugins/projectexplorer/panelswidget.cpp @@ -32,7 +32,7 @@ const int BELOW_CONTENTS_MARGIN = 16; // PanelsWidget /// -PanelsWidget::PanelsWidget(QWidget *parent) : QWidget(parent) +PanelsWidget::PanelsWidget(QWidget *parent, bool addStretch) : QWidget(parent) { m_root = new QWidget(nullptr); m_root->setFocusPolicy(Qt::NoFocus); @@ -53,7 +53,8 @@ PanelsWidget::PanelsWidget(QWidget *parent) : QWidget(parent) m_layout->setSpacing(0); topLayout->addLayout(m_layout); - topLayout->addStretch(100); + if (addStretch) + topLayout->addStretch(1); auto layout = new QVBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); @@ -72,7 +73,7 @@ PanelsWidget::PanelsWidget(const QString &displayName, QWidget *widget) } PanelsWidget::PanelsWidget(const QString &displayName, ProjectSettingsWidget *widget) - : PanelsWidget(nullptr) + : PanelsWidget(nullptr, !widget->expanding()) { addPropertiesPanel(displayName); addGlobalSettingsProperties(widget); diff --git a/src/plugins/projectexplorer/panelswidget.h b/src/plugins/projectexplorer/panelswidget.h index e5e117bab6b..3d5603d5400 100644 --- a/src/plugins/projectexplorer/panelswidget.h +++ b/src/plugins/projectexplorer/panelswidget.h @@ -19,7 +19,7 @@ class PROJECTEXPLORER_EXPORT PanelsWidget : public QWidget Q_OBJECT public: - explicit PanelsWidget(QWidget *parent = nullptr); + explicit PanelsWidget(QWidget *parent = nullptr, bool addStretch = true); PanelsWidget(const QString &displayName, QWidget *widget); PanelsWidget(const QString &displayName, ProjectSettingsWidget *widget); ~PanelsWidget() override; diff --git a/src/plugins/projectexplorer/projectsettingswidget.cpp b/src/plugins/projectexplorer/projectsettingswidget.cpp index ab8d4270b28..43912b4968c 100644 --- a/src/plugins/projectexplorer/projectsettingswidget.cpp +++ b/src/plugins/projectexplorer/projectsettingswidget.cpp @@ -65,4 +65,14 @@ void ProjectSettingsWidget::setGlobalSettingsId(Utils::Id globalId) m_globalSettingsId = globalId; } +bool ProjectSettingsWidget::expanding() const +{ + return m_expanding; +} + +void ProjectSettingsWidget::setExpanding(bool expanding) +{ + m_expanding = expanding; +} + } // ProjectExplorer diff --git a/src/plugins/projectexplorer/projectsettingswidget.h b/src/plugins/projectexplorer/projectsettingswidget.h index 3971acb0a88..a8d564eb291 100644 --- a/src/plugins/projectexplorer/projectsettingswidget.h +++ b/src/plugins/projectexplorer/projectsettingswidget.h @@ -27,6 +27,9 @@ public: bool isUseGlobalSettingsLabelVisible() const; Utils::Id globalSettingsId() const; + bool expanding() const; + void setExpanding(bool expanding); + protected: void setUseGlobalSettingsCheckBoxVisible(bool visible); void setUseGlobalSettingsLabelVisible(bool visible); @@ -41,6 +44,7 @@ private: bool m_useGlobalSettingsCheckBoxEnabled = true; bool m_useGlobalSettingsCheckBoxVisibleVisible = true; bool m_useGlobalSettingsLabelVisibleVisible = true; + bool m_expanding = false; Utils::Id m_globalSettingsId; }; From 55b5b8a975eb806594d1d0357293f40c27f01c06 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 23 Aug 2023 10:16:28 +0200 Subject: [PATCH 0842/1777] CMakeProjectManager: Fix connection to save tools settings Amends 4e23f2a6eb52. This should actually not be needed in the end, and rather steered by the auto registration and settings page apply. Change-Id: I7f94e776fec4394f539e32e5c527c367251654a8 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../cmakeprojectmanager/cmakekitaspect.cpp | 33 +++++++++++++++---- .../cmakeprojectmanager/cmakekitaspect.h | 4 +++ .../cmakeprojectplugin.cpp | 3 +- .../cmakeprojectmanager/cmaketoolmanager.cpp | 3 ++ 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp index f2dbb7c9749..b3c4826ef2c 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp @@ -1283,23 +1283,44 @@ KitAspect *CMakeConfigurationKitAspectFactory::createKitAspect(Kit *k) const // Factory instances; -const CMakeKitAspectFactory theCMakeKitAspectFactory; -const CMakeGeneratorKitAspectFactory theCMakeGeneratorKitAspectFactory; -const CMakeConfigurationKitAspectFactory theCMakeConfigurationKitAspectFactory; +CMakeKitAspectFactory &cmakeKitAspectFactory() +{ + static CMakeKitAspectFactory theCMakeKitAspectFactory; + return theCMakeKitAspectFactory; +} + +CMakeGeneratorKitAspectFactory &cmakeGeneratorKitAspectFactory() +{ + static CMakeGeneratorKitAspectFactory theCMakeGeneratorKitAspectFactory; + return theCMakeGeneratorKitAspectFactory; +} + +static CMakeConfigurationKitAspectFactory &cmakeConfigurationKitAspectFactory() +{ + static CMakeConfigurationKitAspectFactory theCMakeConfigurationKitAspectFactory; + return theCMakeConfigurationKitAspectFactory; +} KitAspect *CMakeKitAspect::createKitAspect(Kit *k) { - return theCMakeKitAspectFactory.createKitAspect(k); + return cmakeKitAspectFactory().createKitAspect(k); } KitAspect *CMakeGeneratorKitAspect::createKitAspect(Kit *k) { - return theCMakeGeneratorKitAspectFactory.createKitAspect(k); + return cmakeGeneratorKitAspectFactory().createKitAspect(k); } KitAspect *CMakeConfigurationKitAspect::createKitAspect(Kit *k) { - return theCMakeConfigurationKitAspectFactory.createKitAspect(k); + return cmakeConfigurationKitAspectFactory().createKitAspect(k); +} + +void CMakeKitAspect::createFactories() +{ + cmakeKitAspectFactory(); + cmakeGeneratorKitAspectFactory(); + cmakeConfigurationKitAspectFactory(); } } // namespace CMakeProjectManager diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.h b/src/plugins/cmakeprojectmanager/cmakekitaspect.h index bd421f4fb88..9b7f93e23b2 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.h +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.h @@ -24,6 +24,10 @@ public: static QString msgUnsupportedVersion(const QByteArray &versionString); static ProjectExplorer::KitAspect *createKitAspect(ProjectExplorer::Kit *k); + +private: + friend class CMakeToolManager; + static void createFactories(); }; class CMAKE_EXPORT CMakeGeneratorKitAspect diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index 8d0d2f720c1..811d2c0e4b3 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -43,7 +43,8 @@ namespace CMakeProjectManager::Internal { class CMakeProjectPluginPrivate : public QObject { public: - CMakeToolManager cmakeToolManager; // have that before the first CMakeKitAspect + // This can't be stand-alone yet as it registers in the plugin object pool + CMakeToolManager cmakeToolManager; ParameterAction buildTargetContextAction{ Tr::tr("Build"), diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index 08348a548a2..b5dd3601b0c 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -3,6 +3,7 @@ #include "cmaketoolmanager.h" +#include "cmakekitaspect.h" #include "cmakeprojectmanagertr.h" #include "cmakespecificsettings.h" #include "cmaketoolsettingsaccessor.h" @@ -49,6 +50,8 @@ CMakeToolManager::CMakeToolManager() setObjectName("CMakeToolManager"); ExtensionSystem::PluginManager::addObject(this); + + CMakeKitAspect::createFactories(); } CMakeToolManager::~CMakeToolManager() From dc6b40a5c008405606fc22092a9361786a047dda Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 23 Aug 2023 16:11:48 +0200 Subject: [PATCH 0843/1777] Use Utils::Storage instead of QVariantMap in a few places Change-Id: I02833cf2bc3caaadc22ff93ae530e4aebe4c3868 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 20 ++++++++-------- src/libs/utils/aspects.h | 19 ++++++++------- src/libs/utils/displayname.cpp | 4 ++-- src/libs/utils/displayname.h | 9 +++---- src/plugins/android/androidbuildapkstep.cpp | 4 ++-- src/plugins/android/androidbuildapkstep.h | 4 ++-- src/plugins/android/androiddevice.cpp | 2 +- src/plugins/android/androiddevice.h | 2 +- .../android/androidrunconfiguration.cpp | 4 ++-- src/plugins/android/androidsdkdownloader.cpp | 2 +- src/plugins/android/androidtoolchain.cpp | 2 +- src/plugins/android/androidtoolchain.h | 2 +- src/plugins/android/javalanguageserver.cpp | 2 +- src/plugins/android/javalanguageserver.h | 4 ++-- src/plugins/autotest/testrunner.cpp | 2 +- src/plugins/baremetal/baremetaldevice.cpp | 3 ++- src/plugins/baremetal/baremetaldevice.h | 4 ++-- .../gdb/eblinkgdbserverprovider.cpp | 8 +++---- .../debugservers/gdb/gdbserverprovider.cpp | 4 ++-- .../debugservers/gdb/gdbserverprovider.h | 4 ++-- .../gdb/jlinkgdbserverprovider.cpp | 8 +++---- .../gdb/openocdgdbserverprovider.cpp | 8 +++---- .../gdb/stlinkutilgdbserverprovider.cpp | 8 +++---- .../uvsc/jlinkuvscserverprovider.cpp | 12 +++++----- .../uvsc/simulatoruvscserverprovider.cpp | 4 ++-- .../uvsc/simulatoruvscserverprovider.h | 4 ++-- .../uvsc/stlinkuvscserverprovider.cpp | 12 +++++----- .../debugservers/uvsc/uvscserverprovider.cpp | 4 ++-- .../debugservers/uvsc/uvscserverprovider.h | 4 ++-- .../uvsc/uvtargetdeviceselection.cpp | 2 +- .../uvsc/uvtargetdeviceselection.h | 5 ++-- .../uvsc/uvtargetdriverselection.cpp | 2 +- .../uvsc/uvtargetdriverselection.h | 5 ++-- .../baremetal/idebugserverprovider.cpp | 5 ++-- src/plugins/baremetal/idebugserverprovider.h | 14 ++++++----- src/plugins/boot2qt/qdbdevice.cpp | 2 +- src/plugins/boot2qt/qdbdevice.h | 4 ++-- .../clangcodemodel/clangdlocatorfilters.cpp | 2 +- src/plugins/clangtools/clangtool.cpp | 2 +- src/plugins/clangtools/clangtoolrunner.cpp | 2 +- src/plugins/clangtools/clangtoolssettings.cpp | 4 ++-- src/plugins/clangtools/clangtoolssettings.h | 4 ++-- .../cmakebuildconfiguration.cpp | 8 +++---- .../cmakebuildconfiguration.h | 8 +++---- .../cmakeprojectmanager/cmakebuildstep.cpp | 4 ++-- .../cmakeprojectmanager/cmakebuildstep.h | 4 ++-- src/plugins/cmakeprojectmanager/cmaketool.h | 5 ++-- .../cppeditor/cppcodemodelsettings.cpp | 2 +- src/plugins/cppeditor/cppcodemodelsettings.h | 7 +++--- .../cppeditor/cppcodestylepreferences.cpp | 4 +++- .../cppeditor/cppcodestylepreferences.h | 4 ++-- .../cppeditor/cppcodestylesettings.cpp | 4 +++- src/plugins/cppeditor/cppcodestylesettings.h | 8 +++---- src/plugins/cppeditor/cppprojectupdater.cpp | 2 +- src/plugins/debugger/commonoptionspage.h | 4 ++-- src/plugins/debugger/debuggeritem.h | 5 ++-- .../debuggerrunconfigurationaspect.cpp | 4 ++-- .../debugger/debuggerrunconfigurationaspect.h | 4 ++-- .../debuggersourcepathmappingwidget.cpp | 4 ++-- src/plugins/docker/dockerdevice.cpp | 2 +- src/plugins/docker/dockerdevice.h | 4 ++-- .../genericprojectmanager/genericproject.cpp | 2 +- .../genericprojectmanager/genericproject.h | 2 +- src/plugins/git/branchview.cpp | 2 +- src/plugins/git/gitclient.cpp | 10 ++++---- src/plugins/incredibuild/commandbuilder.cpp | 2 +- src/plugins/incredibuild/commandbuilder.h | 2 +- .../incredibuild/commandbuilderaspect.cpp | 4 ++-- .../incredibuild/commandbuilderaspect.h | 4 ++-- src/plugins/ios/iosbuildconfiguration.cpp | 4 ++-- src/plugins/ios/iosbuildstep.cpp | 8 +++---- src/plugins/ios/iosdevice.cpp | 5 ++-- src/plugins/ios/iosdevice.h | 4 ++-- src/plugins/ios/iosdsymbuildstep.cpp | 8 +++---- src/plugins/ios/iosrunconfiguration.cpp | 4 ++-- src/plugins/ios/iosrunconfiguration.h | 4 ++-- src/plugins/ios/iossimulator.cpp | 3 ++- src/plugins/ios/iossimulator.h | 4 ++-- .../languageclient/languageclientsettings.cpp | 6 +++-- .../languageclient/languageclientsettings.h | 8 +++---- src/plugins/languageclient/locatorfilter.cpp | 4 ++-- src/plugins/mercurial/mercurialclient.cpp | 2 +- .../mesonbuildconfiguration.cpp | 4 ++-- .../mesonbuildconfiguration.h | 4 ++-- .../mesonprojectmanager/ninjabuildstep.cpp | 4 ++-- .../mesonprojectmanager/ninjabuildstep.h | 4 ++-- .../nim/project/nimblebuildconfiguration.cpp | 4 ++-- .../nim/project/nimblebuildconfiguration.h | 4 ++-- src/plugins/nim/project/nimbleproject.cpp | 5 ++-- src/plugins/nim/project/nimbleproject.h | 4 ++-- .../nim/project/nimcompilerbuildstep.cpp | 4 ++-- .../nim/project/nimcompilerbuildstep.h | 4 ++-- src/plugins/nim/project/nimproject.cpp | 8 +++---- src/plugins/nim/project/nimtoolchain.cpp | 2 +- src/plugins/nim/project/nimtoolchain.h | 2 +- src/plugins/projectexplorer/buildaspects.cpp | 4 ++-- src/plugins/projectexplorer/buildaspects.h | 4 ++-- .../projectexplorer/buildconfiguration.cpp | 4 ++-- .../projectexplorer/buildconfiguration.h | 6 ++--- src/plugins/projectexplorer/buildstep.cpp | 6 ++--- src/plugins/projectexplorer/buildstep.h | 6 ++--- src/plugins/projectexplorer/buildsteplist.cpp | 12 ++++++---- src/plugins/projectexplorer/buildsteplist.h | 6 ++--- src/plugins/projectexplorer/customparser.cpp | 8 +++---- src/plugins/projectexplorer/customparser.h | 12 +++++----- .../projectexplorer/customtoolchain.cpp | 8 +++---- .../projectexplorer/deployconfiguration.cpp | 14 +++++------ .../projectexplorer/deployconfiguration.h | 8 +++---- .../devicesupport/desktopdevice.cpp | 2 +- .../devicesupport/desktopdevice.h | 2 +- .../devicesupport/devicemanager.cpp | 2 +- .../devicesupport/devicemanager.h | 4 ++-- .../projectexplorer/devicesupport/idevice.cpp | 10 ++++---- .../projectexplorer/devicesupport/idevice.h | 10 ++++---- .../devicesupport/idevicefactory.cpp | 4 ++-- .../devicesupport/idevicefactory.h | 6 +++-- .../projectexplorer/editorconfiguration.cpp | 3 ++- .../projectexplorer/editorconfiguration.h | 6 ++--- .../projectexplorer/environmentaspect.cpp | 4 ++-- .../projectexplorer/environmentaspect.h | 8 +++---- src/plugins/projectexplorer/gcctoolchain.cpp | 8 +++---- src/plugins/projectexplorer/gcctoolchain.h | 8 +++---- src/plugins/projectexplorer/kit.h | 5 ++-- src/plugins/projectexplorer/msvctoolchain.cpp | 8 +++---- src/plugins/projectexplorer/msvctoolchain.h | 8 +++---- src/plugins/projectexplorer/project.cpp | 4 ++-- src/plugins/projectexplorer/project.h | 5 ++-- .../projectexplorer/projectconfiguration.cpp | 4 ++-- .../projectexplorer/projectconfiguration.h | 10 ++++---- .../projectexplorer/runconfiguration.cpp | 24 +++++++++---------- .../projectexplorer/runconfiguration.h | 18 +++++++------- .../runconfigurationaspects.cpp | 20 ++++++++-------- .../projectexplorer/runconfigurationaspects.h | 20 ++++++++-------- src/plugins/projectexplorer/target.cpp | 2 +- src/plugins/projectexplorer/target.h | 5 ++-- src/plugins/projectexplorer/toolchain.cpp | 6 ++--- src/plugins/projectexplorer/toolchain.h | 8 +++---- .../toolchainsettingsaccessor.cpp | 4 ++-- src/plugins/python/pythonproject.cpp | 2 +- src/plugins/python/pythonproject.h | 2 +- .../qbsbuildconfiguration.cpp | 2 +- .../qbsprojectmanager/qbsbuildconfiguration.h | 2 +- .../qbsprojectmanager/qbsbuildstep.cpp | 8 +++---- src/plugins/qbsprojectmanager/qbsbuildstep.h | 4 ++-- .../qmakebuildconfiguration.cpp | 4 ++-- .../qmakebuildconfiguration.h | 4 ++-- .../qmakeprojectmanager/qmakeproject.cpp | 2 +- .../qmakeprojectmanager/qmakeproject.h | 2 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 4 ++-- src/plugins/qmakeprojectmanager/qmakestep.h | 4 ++-- .../qmljstools/qmljscodestylepreferences.cpp | 4 +++- .../qmljstools/qmljscodestylepreferences.h | 4 ++-- .../qmljstools/qmljscodestylesettings.cpp | 6 +++-- .../qmljstools/qmljscodestylesettings.h | 6 ++--- .../qmlprojectmanager/qmlmainfileaspect.cpp | 4 ++-- .../qmlprojectmanager/qmlmainfileaspect.h | 4 ++-- .../qmlmultilanguageaspect.cpp | 4 ++-- .../qmlmultilanguageaspect.h | 4 ++-- src/plugins/qmlprojectmanager/qmlproject.cpp | 4 +++- src/plugins/qmlprojectmanager/qmlproject.h | 2 +- src/plugins/qnx/qnxqtversion.cpp | 2 +- src/plugins/qnx/qnxqtversion.h | 4 ++-- src/plugins/qnx/qnxsettingspage.cpp | 2 +- src/plugins/qtsupport/baseqtversion.cpp | 2 +- src/plugins/qtsupport/baseqtversion.h | 8 +++---- .../abstractremotelinuxdeploystep.cpp | 4 ++-- .../abstractremotelinuxdeploystep.h | 4 ++-- .../remotelinux/genericdirectuploadstep.cpp | 2 +- src/plugins/remotelinux/linuxdevicetester.cpp | 2 +- src/plugins/remotelinux/makeinstallstep.cpp | 4 ++-- .../remotelinuxenvironmentaspect.cpp | 4 ++-- .../remotelinuxenvironmentaspect.h | 4 ++-- .../remotelinux/tarpackagecreationstep.cpp | 14 +++++------ src/plugins/subversion/subversionclient.cpp | 2 +- src/plugins/texteditor/behaviorsettings.cpp | 4 +++- src/plugins/texteditor/behaviorsettings.h | 6 ++--- .../texteditor/extraencodingsettings.cpp | 4 +++- .../texteditor/extraencodingsettings.h | 6 ++--- .../texteditor/icodestylepreferences.cpp | 6 ++--- .../texteditor/icodestylepreferences.h | 6 +++-- src/plugins/texteditor/marginsettings.cpp | 12 ++++++---- src/plugins/texteditor/marginsettings.h | 6 ++--- src/plugins/texteditor/storagesettings.cpp | 6 +++-- src/plugins/texteditor/storagesettings.h | 6 ++--- src/plugins/texteditor/tabsettings.cpp | 5 ++-- src/plugins/texteditor/tabsettings.h | 6 +++-- src/plugins/texteditor/typingsettings.cpp | 5 ++-- src/plugins/texteditor/typingsettings.h | 6 ++--- src/plugins/valgrind/valgrindsettings.cpp | 4 ++-- src/plugins/valgrind/valgrindsettings.h | 4 ++-- .../webassemblyrunconfiguration.cpp | 4 ++-- 191 files changed, 525 insertions(+), 491 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index cbb0b300708..c02bba6a127 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -583,7 +583,7 @@ void BaseAspect::saveToMap(QVariantMap &data, const QVariant &value, /*! Retrieves the internal value of this BaseAspect from the QVariantMap \a map. */ -void BaseAspect::fromMap(const QVariantMap &map) +void BaseAspect::fromMap(const Storage &map) { if (settingsKey().isEmpty()) return; @@ -594,7 +594,7 @@ void BaseAspect::fromMap(const QVariantMap &map) /*! Stores the internal value of this BaseAspect into the QVariantMap \a map. */ -void BaseAspect::toMap(QVariantMap &map) const +void BaseAspect::toMap(Storage &map) const { if (settingsKey().isEmpty()) return; @@ -692,13 +692,13 @@ public: class CheckableAspectImplementation { public: - void fromMap(const QVariantMap &map) + void fromMap(const Storage &map) { if (m_checked) m_checked->fromMap(map); } - void toMap(QVariantMap &map) + void toMap(Storage &map) { if (m_checked) m_checked->toMap(map); @@ -921,7 +921,7 @@ void StringAspect::setValueAcceptor(StringAspect::ValueAcceptor &&acceptor) /*! \reimp */ -void StringAspect::fromMap(const QVariantMap &map) +void StringAspect::fromMap(const Storage &map) { if (!settingsKey().isEmpty()) setValue(map.value(settingsKey(), defaultValue()).toString(), BeQuiet); @@ -931,7 +931,7 @@ void StringAspect::fromMap(const QVariantMap &map) /*! \reimp */ -void StringAspect::toMap(QVariantMap &map) const +void StringAspect::toMap(Storage &map) const { saveToMap(map, value(), defaultValue(), settingsKey()); d->m_checkerImpl.toMap(map); @@ -1440,7 +1440,7 @@ void FilePathAspect::addToLayout(Layouting::LayoutItem &parent) /*! \reimp */ -void FilePathAspect::fromMap(const QVariantMap &map) +void FilePathAspect::fromMap(const Storage &map) { if (!settingsKey().isEmpty()) setValue(map.value(settingsKey(), defaultValue()).toString(), BeQuiet); @@ -1450,7 +1450,7 @@ void FilePathAspect::fromMap(const QVariantMap &map) /*! \reimp */ -void FilePathAspect::toMap(QVariantMap &map) const +void FilePathAspect::toMap(Storage &map) const { saveToMap(map, value(), defaultValue(), settingsKey()); d->m_checkerImpl.toMap(map); @@ -2514,7 +2514,7 @@ const QList<BaseAspect *> &AspectContainer::aspects() const return d->m_items; } -void AspectContainer::fromMap(const QVariantMap &map) +void AspectContainer::fromMap(const Storage &map) { for (BaseAspect *aspect : std::as_const(d->m_items)) aspect->fromMap(map); @@ -2523,7 +2523,7 @@ void AspectContainer::fromMap(const QVariantMap &map) } -void AspectContainer::toMap(QVariantMap &map) const +void AspectContainer::toMap(Storage &map) const { for (BaseAspect *aspect : std::as_const(d->m_items)) aspect->toMap(map); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 5779d45dd90..7e3b6942a88 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -8,6 +8,7 @@ #include "infolabel.h" #include "macroexpander.h" #include "pathchooser.h" +#include "storage.h" #include <functional> #include <memory> @@ -100,9 +101,9 @@ public: AspectContainer *container() const; - virtual void fromMap(const QVariantMap &map); - virtual void toMap(QVariantMap &map) const; - virtual void toActiveMap(QVariantMap &map) const { toMap(map); } + virtual void fromMap(const Utils::Storage &map); + virtual void toMap(Utils::Storage &map) const; + virtual void toActiveMap(Utils::Storage &map) const { toMap(map); } virtual void addToLayout(Layouting::LayoutItem &parent); @@ -557,8 +558,8 @@ public: }; void setDisplayStyle(DisplayStyle style); - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; signals: void validChanged(bool validState); @@ -626,8 +627,8 @@ public: void addToLayout(Layouting::LayoutItem &parent) override; - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; signals: void validChanged(bool validState); @@ -831,8 +832,8 @@ public: void registerAspect(BaseAspect *aspect, bool takeOwnership = false); void registerAspects(const AspectContainer &aspects); - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; void readSettings() override; void writeSettings() const override; diff --git a/src/libs/utils/displayname.cpp b/src/libs/utils/displayname.cpp index b8402c94021..9758b440c6e 100644 --- a/src/libs/utils/displayname.cpp +++ b/src/libs/utils/displayname.cpp @@ -35,13 +35,13 @@ bool DisplayName::usesDefaultValue() const return m_value.isEmpty(); } -void DisplayName::toMap(QVariantMap &map, const QString &key) const +void DisplayName::toMap(Storage &map, const QString &key) const { if (m_forceSerialization || !usesDefaultValue()) map.insert(key, m_value); } -void DisplayName::fromMap(const QVariantMap &map, const QString &key) +void DisplayName::fromMap(const Storage &map, const QString &key) { m_value = map.value(key).toString(); } diff --git a/src/libs/utils/displayname.h b/src/libs/utils/displayname.h index b7a9b5f90d0..0998eafd6eb 100644 --- a/src/libs/utils/displayname.h +++ b/src/libs/utils/displayname.h @@ -3,10 +3,7 @@ #pragma once -#include "utils_global.h" - -#include <QString> -#include <QVariantMap> +#include "storage.h" namespace Utils { @@ -24,8 +21,8 @@ public: bool usesDefaultValue() const; void forceSerialization() { m_forceSerialization = true; } - void toMap(QVariantMap &map, const QString &key) const; - void fromMap(const QVariantMap &map, const QString &key); + void toMap(Utils::Storage &map, const Key &key) const; + void fromMap(const Utils::Storage &map, const Key &key); private: QString m_value; diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 4286fcc4e3a..a98dad864c2 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -879,7 +879,7 @@ void AndroidBuildApkStep::updateBuildToolsVersionInJsonFile() } } -void AndroidBuildApkStep::fromMap(const QVariantMap &map) +void AndroidBuildApkStep::fromMap(const Storage &map) { m_keystorePath = FilePath::fromSettings(map.value(KeystoreLocationKey)); m_signPackage = false; // don't restore this @@ -893,7 +893,7 @@ void AndroidBuildApkStep::fromMap(const QVariantMap &map) ProjectExplorer::BuildStep::fromMap(map); } -void AndroidBuildApkStep::toMap(QVariantMap &map) const +void AndroidBuildApkStep::toMap(Storage &map) const { ProjectExplorer::AbstractProcessStep::toMap(map); map.insert(KeystoreLocationKey, m_keystorePath.toSettings()); diff --git a/src/plugins/android/androidbuildapkstep.h b/src/plugins/android/androidbuildapkstep.h index b746ddde064..956e91d8303 100644 --- a/src/plugins/android/androidbuildapkstep.h +++ b/src/plugins/android/androidbuildapkstep.h @@ -23,8 +23,8 @@ class AndroidBuildApkStep : public ProjectExplorer::AbstractProcessStep public: AndroidBuildApkStep(ProjectExplorer::BuildStepList *bc, Utils::Id id); - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; // signing Utils::FilePath keystorePath() const; diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index a74e94272e1..520aceb4eab 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -214,7 +214,7 @@ void AndroidDevice::addActionsIfNotFound() } } -void AndroidDevice::fromMap(const QVariantMap &map) +void AndroidDevice::fromMap(const Storage &map) { IDevice::fromMap(map); initAvdSettings(); diff --git a/src/plugins/android/androiddevice.h b/src/plugins/android/androiddevice.h index cf8046cfa95..1ac5d349c96 100644 --- a/src/plugins/android/androiddevice.h +++ b/src/plugins/android/androiddevice.h @@ -55,7 +55,7 @@ public: QString openGLStatus() const; protected: - void fromMap(const QVariantMap &map) final; + void fromMap(const Utils::Storage &map) final; private: void addActionsIfNotFound(); diff --git a/src/plugins/android/androidrunconfiguration.cpp b/src/plugins/android/androidrunconfiguration.cpp index 98636857355..ebfb40c6f4a 100644 --- a/src/plugins/android/androidrunconfiguration.cpp +++ b/src/plugins/android/androidrunconfiguration.cpp @@ -32,13 +32,13 @@ public: : StringAspect(container) {} - void fromMap(const QVariantMap &map) final + void fromMap(const Storage &map) final { // Pre Qt Creator 5.0 hack: Reads QStringList as QString setValue(map.value(settingsKey()).toStringList().join('\n')); } - void toMap(QVariantMap &map) const final + void toMap(Storage &map) const final { // Pre Qt Creator 5.0 hack: Writes QString as QStringList map.insert(settingsKey(), value().split('\n')); diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp index 4e465514622..ececc547481 100644 --- a/src/plugins/android/androidsdkdownloader.cpp +++ b/src/plugins/android/androidsdkdownloader.cpp @@ -183,7 +183,7 @@ void AndroidSdkDownloader::downloadAndExtractSdk() }; const Group root { - Storage(storage), + Tasking::Storage(storage), NetworkQueryTask(onQuerySetup, onQueryDone, onQueryError), UnarchiverTask(onUnarchiveSetup, onUnarchiverDone, onUnarchiverError) }; diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index 50a850aa192..e0d0e6180f5 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -101,7 +101,7 @@ void AndroidToolChain::addToEnvironment(Environment &env) const env.set(QLatin1String("ANDROID_SDK_ROOT"), config.sdkLocation().toUserOutput()); } -void AndroidToolChain::fromMap(const QVariantMap &data) +void AndroidToolChain::fromMap(const Storage &data) { ClangToolChain::fromMap(data); if (hasError()) diff --git a/src/plugins/android/androidtoolchain.h b/src/plugins/android/androidtoolchain.h index 707125391cb..c8605f5dd8b 100644 --- a/src/plugins/android/androidtoolchain.h +++ b/src/plugins/android/androidtoolchain.h @@ -22,7 +22,7 @@ public: QStringList suggestedMkspecList() const override; Utils::FilePath makeCommand(const Utils::Environment &environment) const override; - void fromMap(const QVariantMap &data) override; + void fromMap(const Utils::Storage &data) override; void setNdkLocation(const Utils::FilePath &ndkLocation); Utils::FilePath ndkLocation() const; diff --git a/src/plugins/android/javalanguageserver.cpp b/src/plugins/android/javalanguageserver.cpp index f3448461a1d..6cb10c1f6c9 100644 --- a/src/plugins/android/javalanguageserver.cpp +++ b/src/plugins/android/javalanguageserver.cpp @@ -143,7 +143,7 @@ QVariantMap JLSSettings::toMap() const return map; } -void JLSSettings::fromMap(const QVariantMap &map) +void JLSSettings::fromMap(const Storage &map) { StdIOSettings::fromMap(map); m_languageServer = FilePath::fromSettings(map[languageServerKey]); diff --git a/src/plugins/android/javalanguageserver.h b/src/plugins/android/javalanguageserver.h index 50e3fc72222..982ab566d0b 100644 --- a/src/plugins/android/javalanguageserver.h +++ b/src/plugins/android/javalanguageserver.h @@ -16,8 +16,8 @@ public: bool applyFromSettingsWidget(QWidget *widget) final; QWidget *createSettingsWidget(QWidget *parent) const final; bool isValid() const final; - QVariantMap toMap() const final; - void fromMap(const QVariantMap &map) final; + Utils::Storage toMap() const final; + void fromMap(const Utils::Storage &map) final; LanguageClient::BaseSettings *copy() const final; LanguageClient::Client *createClient(LanguageClient::BaseClientInterface *interface) const final; LanguageClient::BaseClientInterface *createInterface( diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index dac0db19377..ecfd2dc54dd 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -446,7 +446,7 @@ void TestRunner::runTestsHelper() }; const Group group { finishAllAndDone, - Storage(storage), + Tasking::Storage(storage), onGroupSetup(onSetup), ProcessTask(onProcessSetup, onProcessDone, onProcessDone) }; diff --git a/src/plugins/baremetal/baremetaldevice.cpp b/src/plugins/baremetal/baremetaldevice.cpp index d7754ebc9a0..4c72d51ac93 100644 --- a/src/plugins/baremetal/baremetaldevice.cpp +++ b/src/plugins/baremetal/baremetaldevice.cpp @@ -14,6 +14,7 @@ #include <utils/qtcassert.h> using namespace ProjectExplorer; +using namespace Utils; namespace BareMetal::Internal { @@ -62,7 +63,7 @@ void BareMetalDevice::unregisterDebugServerProvider(IDebugServerProvider *provid m_debugServerProviderId.clear(); } -void BareMetalDevice::fromMap(const QVariantMap &map) +void BareMetalDevice::fromMap(const Storage &map) { IDevice::fromMap(map); QString providerId = map.value(debugServerProviderIdKeyC).toString(); diff --git a/src/plugins/baremetal/baremetaldevice.h b/src/plugins/baremetal/baremetaldevice.h index 662f24c08bc..096e9f17dee 100644 --- a/src/plugins/baremetal/baremetaldevice.h +++ b/src/plugins/baremetal/baremetaldevice.h @@ -31,8 +31,8 @@ public: void unregisterDebugServerProvider(IDebugServerProvider *provider); protected: - void fromMap(const QVariantMap &map) final; - QVariantMap toMap() const final; + void fromMap(const Utils::Storage &map) final; + Utils::Storage toMap() const final; private: BareMetalDevice(); diff --git a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp index 202ddcd77c9..1054a76d29e 100644 --- a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp @@ -74,8 +74,8 @@ private: class EBlinkGdbServerProvider final : public GdbServerProvider { public: - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; + void toMap(Storage &data) const final; + void fromMap(const Storage &data) final; bool operator==(const IDebugServerProvider &other) const final; @@ -215,7 +215,7 @@ bool EBlinkGdbServerProvider::isValid() const } } -void EBlinkGdbServerProvider::toMap(QVariantMap &data) const +void EBlinkGdbServerProvider::toMap(Storage &data) const { GdbServerProvider::toMap(data); data.insert(executableFileKeyC, m_executableFile.toSettings()); @@ -231,7 +231,7 @@ void EBlinkGdbServerProvider::toMap(QVariantMap &data) const data.insert(gdbNotUseCacheC, m_gdbNotUseCache); } -void EBlinkGdbServerProvider::fromMap(const QVariantMap &data) +void EBlinkGdbServerProvider::fromMap(const Storage &data) { GdbServerProvider::fromMap(data); m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC)); diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp index 802d691c689..abf6e319b94 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp @@ -120,7 +120,7 @@ bool GdbServerProvider::operator==(const IDebugServerProvider &other) const && m_useExtendedRemote == p->m_useExtendedRemote; } -void GdbServerProvider::toMap(QVariantMap &data) const +void GdbServerProvider::toMap(Storage &data) const { IDebugServerProvider::toMap(data); data.insert(startupModeKeyC, m_startupMode); @@ -179,7 +179,7 @@ RunWorker *GdbServerProvider::targetRunner(RunControl *runControl) const return new GdbServerProviderRunner(runControl, command()); } -void GdbServerProvider::fromMap(const QVariantMap &data) +void GdbServerProvider::fromMap(const Storage &data) { IDebugServerProvider::fromMap(data); m_startupMode = static_cast<StartupMode>(data.value(startupModeKeyC).toInt()); diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h index d4aba6fd9be..073e0e212ea 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h @@ -33,7 +33,7 @@ public: bool operator==(const IDebugServerProvider &other) const override; - void toMap(QVariantMap &data) const override; + void toMap(Utils::Storage &data) const override; virtual Utils::CommandLine command() const; @@ -55,7 +55,7 @@ protected: void setResetCommands(const QString &); void setUseExtendedRemote(bool); - void fromMap(const QVariantMap &data) override; + void fromMap(const Utils::Storage &data) override; StartupMode m_startupMode = StartupOnNetwork; Utils::FilePath m_peripheralDescriptionFile; diff --git a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp index e046a8244e6..32e3eabb6d1 100644 --- a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp @@ -81,8 +81,8 @@ private: class JLinkGdbServerProvider final : public GdbServerProvider { public: - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; + void toMap(Storage &data) const final; + void fromMap(const Storage &data) final; bool operator==(const IDebugServerProvider &other) const final; @@ -194,7 +194,7 @@ bool JLinkGdbServerProvider::isValid() const return true; } -void JLinkGdbServerProvider::toMap(QVariantMap &data) const +void JLinkGdbServerProvider::toMap(Storage &data) const { GdbServerProvider::toMap(data); data.insert(executableFileKeyC, m_executableFile.toSettings()); @@ -206,7 +206,7 @@ void JLinkGdbServerProvider::toMap(QVariantMap &data) const data.insert(additionalArgumentsKeyC, m_additionalArguments); } -void JLinkGdbServerProvider::fromMap(const QVariantMap &data) +void JLinkGdbServerProvider::fromMap(const Storage &data) { GdbServerProvider::fromMap(data); m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC)); diff --git a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp index 5299ac6121e..2c5eb447d99 100644 --- a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp @@ -57,8 +57,8 @@ private: class OpenOcdGdbServerProvider final : public GdbServerProvider { public: - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; + void toMap(Storage &data) const final; + void fromMap(const Storage &data) final; bool operator==(const IDebugServerProvider &other) const final; @@ -180,7 +180,7 @@ bool OpenOcdGdbServerProvider::isValid() const return true; } -void OpenOcdGdbServerProvider::toMap(QVariantMap &data) const +void OpenOcdGdbServerProvider::toMap(Storage &data) const { GdbServerProvider::toMap(data); data.insert(executableFileKeyC, m_executableFile.toSettings()); @@ -189,7 +189,7 @@ void OpenOcdGdbServerProvider::toMap(QVariantMap &data) const data.insert(additionalArgumentsKeyC, m_additionalArguments); } -void OpenOcdGdbServerProvider::fromMap(const QVariantMap &data) +void OpenOcdGdbServerProvider::fromMap(const Storage &data) { GdbServerProvider::fromMap(data); m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC)); diff --git a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp index 72b5bc3708a..d8d3ff1b0d0 100644 --- a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp @@ -67,8 +67,8 @@ private: class StLinkUtilGdbServerProvider final : public GdbServerProvider { public: - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; + void toMap(Storage &data) const final; + void fromMap(const Storage &data) final; bool operator==(const IDebugServerProvider &other) const final; @@ -177,7 +177,7 @@ bool StLinkUtilGdbServerProvider::isValid() const return true; } -void StLinkUtilGdbServerProvider::toMap(QVariantMap &data) const +void StLinkUtilGdbServerProvider::toMap(Storage &data) const { GdbServerProvider::toMap(data); data.insert(executableFileKeyC, m_executableFile.toSettings()); @@ -188,7 +188,7 @@ void StLinkUtilGdbServerProvider::toMap(QVariantMap &data) const data.insert(connectUnderResetKeyC, m_connectUnderReset); } -void StLinkUtilGdbServerProvider::fromMap(const QVariantMap &data) +void StLinkUtilGdbServerProvider::fromMap(const Storage &data) { GdbServerProvider::fromMap(data); m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC)); diff --git a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp index 256f95be986..ebf1ea3a021 100644 --- a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp @@ -46,7 +46,7 @@ public: Speed speed = Speed::Speed_1MHz; QVariantMap toMap() const; - bool fromMap(const QVariantMap &data); + bool fromMap(const Storage &data); bool operator==(const JLinkUvscAdapterOptions &other) const; }; @@ -130,7 +130,7 @@ QVariantMap JLinkUvscAdapterOptions::toMap() const return map; } -bool JLinkUvscAdapterOptions::fromMap(const QVariantMap &data) +bool JLinkUvscAdapterOptions::fromMap(const Storage &data) { port = static_cast<Port>(data.value(adapterPortKeyC, SWD).toInt()); speed = static_cast<Speed>(data.value(adapterSpeedKeyC, Speed_1MHz).toInt()); @@ -147,8 +147,8 @@ bool JLinkUvscAdapterOptions::operator==(const JLinkUvscAdapterOptions &other) c class JLinkUvscServerProvider final : public UvscServerProvider { public: - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; + void toMap(Storage &data) const final; + void fromMap(const Storage &data) final; bool operator==(const IDebugServerProvider &other) const final; Utils::FilePath optionsFilePath(Debugger::DebuggerRunTool *runTool, @@ -240,13 +240,13 @@ JLinkUvscServerProvider::JLinkUvscServerProvider() setSupportedDrivers({"Segger\\JL2CM3.dll"}); } -void JLinkUvscServerProvider::toMap(QVariantMap &data) const +void JLinkUvscServerProvider::toMap(Storage &data) const { UvscServerProvider::toMap(data); data.insert(adapterOptionsKeyC, m_adapterOpts.toMap()); } -void JLinkUvscServerProvider::fromMap(const QVariantMap &data) +void JLinkUvscServerProvider::fromMap(const Storage &data) { UvscServerProvider::fromMap(data); m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).toMap()); diff --git a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp index 7f3824ccb80..764c682f87e 100644 --- a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp @@ -63,13 +63,13 @@ SimulatorUvscServerProvider::SimulatorUvscServerProvider() setDriverSelection(defaultSimulatorDriverSelection()); } -void SimulatorUvscServerProvider::toMap(QVariantMap &data) const +void SimulatorUvscServerProvider::toMap(Storage &data) const { UvscServerProvider::toMap(data); data.insert(limitSpeedKeyC, m_limitSpeed); } -void SimulatorUvscServerProvider::fromMap(const QVariantMap &data) +void SimulatorUvscServerProvider::fromMap(const Storage &data) { UvscServerProvider::fromMap(data); m_limitSpeed = data.value(limitSpeedKeyC).toBool(); diff --git a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h index 96305b06a21..5e1e918c305 100644 --- a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h @@ -16,8 +16,8 @@ namespace BareMetal::Internal { class SimulatorUvscServerProvider final : public UvscServerProvider { public: - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; + void toMap(Utils::Storage &data) const final; + void fromMap(const Utils::Storage &data) final; bool operator==(const IDebugServerProvider &other) const final; bool isSimulator() const final { return true; } diff --git a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp index e41fa381b60..164900adf0d 100644 --- a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp @@ -51,7 +51,7 @@ public: Speed speed = Speed::Speed_4MHz; QVariantMap toMap() const; - bool fromMap(const QVariantMap &data); + bool fromMap(const Storage &data); bool operator==(const StLinkUvscAdapterOptions &other) const; }; @@ -86,8 +86,8 @@ static QString buildDllRegistryName(const DeviceSelection &device, class StLinkUvscServerProvider final : public UvscServerProvider { public: - void toMap(QVariantMap &data) const final; - void fromMap(const QVariantMap &data) final; + void toMap(Storage &data) const final; + void fromMap(const Storage &data) final; bool operator==(const IDebugServerProvider &other) const final; Utils::FilePath optionsFilePath(Debugger::DebuggerRunTool *runTool, @@ -134,7 +134,7 @@ QVariantMap StLinkUvscAdapterOptions::toMap() const return map; } -bool StLinkUvscAdapterOptions::fromMap(const QVariantMap &data) +bool StLinkUvscAdapterOptions::fromMap(const Storage &data) { port = static_cast<Port>(data.value(adapterPortKeyC, SWD).toInt()); speed = static_cast<Speed>(data.value(adapterSpeedKeyC, Speed_4MHz).toInt()); @@ -200,13 +200,13 @@ StLinkUvscServerProvider::StLinkUvscServerProvider() setSupportedDrivers({"STLink\\ST-LINKIII-KEIL_SWO.dll"}); } -void StLinkUvscServerProvider::toMap(QVariantMap &data) const +void StLinkUvscServerProvider::toMap(Storage &data) const { UvscServerProvider::toMap(data); data.insert(adapterOptionsKeyC, m_adapterOpts.toMap()); } -void StLinkUvscServerProvider::fromMap(const QVariantMap &data) +void StLinkUvscServerProvider::fromMap(const Storage &data) { UvscServerProvider::fromMap(data); m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).toMap()); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index 9b20bea548f..3a360e7582a 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -147,7 +147,7 @@ FilePath UvscServerProvider::buildOptionsFilePath(DebuggerRunTool *runTool) cons return path; } -void UvscServerProvider::toMap(QVariantMap &data) const +void UvscServerProvider::toMap(Storage &data) const { IDebugServerProvider::toMap(data); data.insert(toolsIniKeyC, m_toolsIniFile.toSettings()); @@ -219,7 +219,7 @@ ProjectExplorer::RunWorker *UvscServerProvider::targetRunner(RunControl *runCont return new UvscServerProviderRunner(runControl, r); } -void UvscServerProvider::fromMap(const QVariantMap &data) +void UvscServerProvider::fromMap(const Storage &data) { IDebugServerProvider::fromMap(data); m_toolsIniFile = FilePath::fromSettings(data.value(toolsIniKeyC)); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h index 82988965ed8..d16ecb7f915 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h @@ -48,7 +48,7 @@ public: bool operator==(const IDebugServerProvider &other) const override; - void toMap(QVariantMap &map) const override; + void toMap(Utils::Storage &map) const override; bool aboutToRun(Debugger::DebuggerRunTool *runTool, QString &errorMessage) const final; ProjectExplorer::RunWorker *targetRunner(ProjectExplorer::RunControl *runControl) const final; @@ -69,7 +69,7 @@ protected: Utils::FilePath buildProjectFilePath(Debugger::DebuggerRunTool *runTool) const; Utils::FilePath buildOptionsFilePath(Debugger::DebuggerRunTool *runTool) const; - void fromMap(const QVariantMap &data) override; + void fromMap(const Utils::Storage &data) override; // uVision specific stuff. virtual Utils::FilePath projectFilePath(Debugger::DebuggerRunTool *runTool, diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp index b41f835c7b5..e165561c7dd 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp @@ -102,7 +102,7 @@ QVariantMap DeviceSelection::toMap() const return map; } -void DeviceSelection::fromMap(const QVariantMap &map) +void DeviceSelection::fromMap(const Storage &map) { // Software package. package.desc = map.value(packageDescrKeyC).toString(); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.h b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.h index cee1876f6d8..abfb8d7b49d 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.h +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.h @@ -5,6 +5,7 @@ #include <utils/basetreeview.h> #include <utils/treemodel.h> +#include <utils/storage.h> QT_BEGIN_NAMESPACE class QComboBox; @@ -71,8 +72,8 @@ public: Algorithms algorithms; int algorithmIndex = 0; - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); bool operator==(const DeviceSelection &other) const; }; diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.cpp b/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.cpp index 5b403737f0a..6c6a41955d5 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.cpp @@ -33,7 +33,7 @@ QVariantMap DriverSelection::toMap() const return map; } -void DriverSelection::fromMap(const QVariantMap &map) +void DriverSelection::fromMap(const Storage &map) { index = map.value(driverIndexKeyC).toInt(); cpuDllIndex = map.value(driverCpuDllIndexKeyC).toInt(); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.h b/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.h index 65bcd52d80d..11a66c2dcb9 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.h +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.h @@ -5,6 +5,7 @@ #include <utils/basetreeview.h> #include <utils/treemodel.h> +#include <utils/storage.h> QT_BEGIN_NAMESPACE class QComboBox; @@ -23,8 +24,8 @@ public: int index = 0; int cpuDllIndex = 0; - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); bool operator==(const DriverSelection &other) const; }; diff --git a/src/plugins/baremetal/idebugserverprovider.cpp b/src/plugins/baremetal/idebugserverprovider.cpp index 6bf5ea8cb6e..03ddc183c43 100644 --- a/src/plugins/baremetal/idebugserverprovider.cpp +++ b/src/plugins/baremetal/idebugserverprovider.cpp @@ -18,6 +18,7 @@ using namespace Debugger; using namespace ProjectExplorer; +using namespace Utils; namespace BareMetal::Internal { @@ -137,7 +138,7 @@ IDebugServerProviderConfigWidget *IDebugServerProvider::configurationWidget() co return m_configurationWidgetCreator(); } -void IDebugServerProvider::toMap(QVariantMap &data) const +void IDebugServerProvider::toMap(Storage &data) const { data.insert(idKeyC, m_id); data.insert(displayNameKeyC, m_displayName); @@ -166,7 +167,7 @@ void IDebugServerProvider::resetId() m_id = createId(m_id); } -void IDebugServerProvider::fromMap(const QVariantMap &data) +void IDebugServerProvider::fromMap(const Storage &data) { m_id = data.value(idKeyC).toString(); m_displayName = data.value(displayNameKeyC).toString(); diff --git a/src/plugins/baremetal/idebugserverprovider.h b/src/plugins/baremetal/idebugserverprovider.h index c28e8c50d8a..846be8ed893 100644 --- a/src/plugins/baremetal/idebugserverprovider.h +++ b/src/plugins/baremetal/idebugserverprovider.h @@ -4,12 +4,14 @@ #pragma once #include <debugger/debuggerconstants.h> -#include <projectexplorer/abi.h> -#include <utils/fileutils.h> -#include <QObject> +#include <projectexplorer/abi.h> + +#include <utils/filepath.h> +#include <utils/storage.h> + #include <QSet> -#include <QVariantMap> +#include <QUrl> #include <QWidget> QT_BEGIN_NAMESPACE @@ -65,8 +67,8 @@ public: void setConfigurationWidgetCreator (const std::function<IDebugServerProviderConfigWidget *()> &configurationWidgetCreator); - virtual void toMap(QVariantMap &data) const; - virtual void fromMap(const QVariantMap &data); + virtual void toMap(Utils::Storage &data) const; + virtual void fromMap(const Utils::Storage &data); virtual bool aboutToRun(Debugger::DebuggerRunTool *runTool, QString &errorMessage) const = 0; diff --git a/src/plugins/boot2qt/qdbdevice.cpp b/src/plugins/boot2qt/qdbdevice.cpp index 43783279d69..6fdd610d96b 100644 --- a/src/plugins/boot2qt/qdbdevice.cpp +++ b/src/plugins/boot2qt/qdbdevice.cpp @@ -137,7 +137,7 @@ QString QdbDevice::serialNumber() const return m_serialNumber; } -void QdbDevice::fromMap(const QVariantMap &map) +void QdbDevice::fromMap(const Storage &map) { ProjectExplorer::IDevice::fromMap(map); setSerialNumber(map.value("Qdb.SerialNumber").toString()); diff --git a/src/plugins/boot2qt/qdbdevice.h b/src/plugins/boot2qt/qdbdevice.h index 300fe826329..e0ccac65557 100644 --- a/src/plugins/boot2qt/qdbdevice.h +++ b/src/plugins/boot2qt/qdbdevice.h @@ -26,8 +26,8 @@ public: void setupDefaultNetworkSettings(const QString &host); protected: - void fromMap(const QVariantMap &map) final; - QVariantMap toMap() const final; + void fromMap(const Utils::Storage &map) final; + Utils::Storage toMap() const final; private: QdbDevice(); diff --git a/src/plugins/clangcodemodel/clangdlocatorfilters.cpp b/src/plugins/clangcodemodel/clangdlocatorfilters.cpp index f783a98499a..c3e9c42903f 100644 --- a/src/plugins/clangcodemodel/clangdlocatorfilters.cpp +++ b/src/plugins/clangcodemodel/clangdlocatorfilters.cpp @@ -192,7 +192,7 @@ LocatorMatcherTask currentDocumentMatcher() }; const Group root { - Storage(resultStorage), + Tasking::Storage(resultStorage), CurrentDocumentSymbolsRequestTask(onQuerySetup, onQueryDone), AsyncTask<void>(onFilterSetup) }; diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index aaea55d08c3..6fc8d3f06fb 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -813,7 +813,7 @@ Group ClangTool::runRecipe(const RunSettings &runSettings, NormalMessageFormat); }; - topTasks.append(Group { Storage(storage), TaskTreeTask(onTreeSetup, onTreeDone) }); + topTasks.append(Group { Tasking::Storage(storage), TaskTreeTask(onTreeSetup, onTreeDone) }); return {topTasks}; } diff --git a/src/plugins/clangtools/clangtoolrunner.cpp b/src/plugins/clangtools/clangtoolrunner.cpp index ecace1c7d36..20331566410 100644 --- a/src/plugins/clangtools/clangtoolrunner.cpp +++ b/src/plugins/clangtools/clangtoolrunner.cpp @@ -219,7 +219,7 @@ GroupItem clangToolTask(const AnalyzeInputData &input, const Group group { finishAllAndDone, - Storage(storage), + Tasking::Storage(storage), onGroupSetup(onSetup), Group { sequential, diff --git a/src/plugins/clangtools/clangtoolssettings.cpp b/src/plugins/clangtools/clangtoolssettings.cpp index 440bde4ecc6..6661a3b50cb 100644 --- a/src/plugins/clangtools/clangtoolssettings.cpp +++ b/src/plugins/clangtools/clangtoolssettings.cpp @@ -41,7 +41,7 @@ RunSettings::RunSettings() { } -void RunSettings::fromMap(const QVariantMap &map, const QString &prefix) +void RunSettings::fromMap(const Storage &map, const QString &prefix) { m_diagnosticConfigId = Id::fromSetting(map.value(prefix + diagnosticConfigIdKey)); m_parallelJobs = map.value(prefix + parallelJobsKey).toInt(); @@ -50,7 +50,7 @@ void RunSettings::fromMap(const QVariantMap &map, const QString &prefix) m_analyzeOpenFiles = map.value(prefix + analyzeOpenFilesKey).toBool(); } -void RunSettings::toMap(QVariantMap &map, const QString &prefix) const +void RunSettings::toMap(Storage &map, const QString &prefix) const { map.insert(prefix + diagnosticConfigIdKey, m_diagnosticConfigId.toSetting()); map.insert(prefix + parallelJobsKey, m_parallelJobs); diff --git a/src/plugins/clangtools/clangtoolssettings.h b/src/plugins/clangtools/clangtoolssettings.h index 920a185d7df..885674baba2 100644 --- a/src/plugins/clangtools/clangtoolssettings.h +++ b/src/plugins/clangtools/clangtoolssettings.h @@ -26,8 +26,8 @@ class RunSettings public: RunSettings(); - void fromMap(const QVariantMap &map, const QString &prefix = QString()); - void toMap(QVariantMap &map, const QString &prefix = QString()) const; + void fromMap(const Utils::Storage &map, const QString &prefix = QString()); + void toMap(Utils::Storage &map, const QString &prefix = QString()) const; Utils::Id diagnosticConfigId() const; void setDiagnosticConfigId(const Utils::Id &id) { m_diagnosticConfigId = id; } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index a6be87fd968..9a6383e552a 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -2139,14 +2139,14 @@ void InitialCMakeArgumentsAspect::setCMakeConfiguration(const CMakeConfig &confi ci.isInitial = true; } -void InitialCMakeArgumentsAspect::fromMap(const QVariantMap &map) +void InitialCMakeArgumentsAspect::fromMap(const Storage &map) { const QString value = map.value(settingsKey(), defaultValue()).toString(); QStringList additionalArguments; setAllValues(value, additionalArguments); } -void InitialCMakeArgumentsAspect::toMap(QVariantMap &map) const +void InitialCMakeArgumentsAspect::toMap(Storage &map) const { saveToMap(map, allValues().join('\n'), defaultValue(), settingsKey()); } @@ -2231,7 +2231,7 @@ ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(AspectContainer *containe }); } -void ConfigureEnvironmentAspect::fromMap(const QVariantMap &map) +void ConfigureEnvironmentAspect::fromMap(const Storage &map) { // Match the key values from Qt Creator 9.0.0/1 to the ones from EnvironmentAspect const bool cleanSystemEnvironment = map.value(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY)) @@ -2249,7 +2249,7 @@ void ConfigureEnvironmentAspect::fromMap(const QVariantMap &map) ProjectExplorer::EnvironmentAspect::fromMap(tmpMap); } -void ConfigureEnvironmentAspect::toMap(QVariantMap &map) const +void ConfigureEnvironmentAspect::toMap(Storage &map) const { QVariantMap tmpMap; ProjectExplorer::EnvironmentAspect::toMap(tmpMap); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index 4fe1fb6c6bc..e7df5d05b35 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -31,8 +31,8 @@ public: void setAllValues(const QString &values, QStringList &additionalArguments); void setCMakeConfiguration(const CMakeConfig &config); - void fromMap(const QVariantMap &map) final; - void toMap(QVariantMap &map) const final; + void fromMap(const Utils::Storage &map) final; + void toMap(Utils::Storage &map) const final; private: CMakeConfig m_cmakeConfiguration; @@ -44,8 +44,8 @@ public: ConfigureEnvironmentAspect(Utils::AspectContainer *container, ProjectExplorer::BuildConfiguration *buildConfig); - void fromMap(const QVariantMap &map); - void toMap(QVariantMap &map) const; + void fromMap(const Utils::Storage &map); + void toMap(Utils::Storage &map) const; }; } // namespace Internal diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index bff01796157..3fd1066468e 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -273,7 +273,7 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Id id) : this, &CMakeBuildStep::updateBuildTargetsModel); } -void CMakeBuildStep::toMap(QVariantMap &map) const +void CMakeBuildStep::toMap(Utils::Storage &map) const { CMakeAbstractProcessStep::toMap(map); map.insert(BUILD_TARGETS_KEY, m_buildTargets); @@ -282,7 +282,7 @@ void CMakeBuildStep::toMap(QVariantMap &map) const map.insert(QLatin1String(BUILD_PRESET_KEY), m_buildPreset); } -void CMakeBuildStep::fromMap(const QVariantMap &map) +void CMakeBuildStep::fromMap(const Utils::Storage &map) { setBuildTargets(map.value(BUILD_TARGETS_KEY).toStringList()); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h index f808b342de1..a202708a070 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h @@ -44,7 +44,7 @@ public: bool buildsBuildTarget(const QString &target) const; void setBuildsBuildTarget(const QString &target, bool on); - void toMap(QVariantMap &map) const override; + void toMap(Utils::Storage &map) const override; QString cleanTarget() const; QString allTarget() const ; @@ -83,7 +83,7 @@ signals: private: Utils::CommandLine cmakeCommand() const; - void fromMap(const QVariantMap &map) override; + void fromMap(const Utils::Storage &map) override; bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index 31b9e016276..744a34f2fb4 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -7,8 +7,9 @@ #include <texteditor/codeassist/keywordscompletionassist.h> -#include <utils/fileutils.h> +#include <utils/filepath.h> #include <utils/id.h> +#include <utils/storage.h> #include <optional> @@ -59,7 +60,7 @@ public: bool isValid() const; Utils::Id id() const { return m_id; } - QVariantMap toMap () const; + Utils::Storage toMap () const; void setAutorun(bool autoRun) { m_isAutoRun = autoRun; } diff --git a/src/plugins/cppeditor/cppcodemodelsettings.cpp b/src/plugins/cppeditor/cppcodemodelsettings.cpp index 7a32011cf54..239a5a8e1b1 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettings.cpp @@ -558,7 +558,7 @@ QVariantMap ClangdSettings::Data::toMap() const return map; } -void ClangdSettings::Data::fromMap(const QVariantMap &map) +void ClangdSettings::Data::fromMap(const Storage &map) { useClangd = map.value(useClangdKey(), true).toBool(); executableFilePath = FilePath::fromString(map.value(clangdPathKey()).toString()); diff --git a/src/plugins/cppeditor/cppcodemodelsettings.h b/src/plugins/cppeditor/cppcodemodelsettings.h index c22fb88faa5..c35ca854221 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.h +++ b/src/plugins/cppeditor/cppcodemodelsettings.h @@ -7,8 +7,9 @@ #include "cppeditor_global.h" #include <utils/clangutils.h> -#include <utils/fileutils.h> +#include <utils/filepath.h> #include <utils/id.h> +#include <utils/storage.h> #include <QObject> #include <QStringList> @@ -93,8 +94,8 @@ public: class CPPEDITOR_EXPORT Data { public: - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); friend bool operator==(const Data &s1, const Data &s2) { diff --git a/src/plugins/cppeditor/cppcodestylepreferences.cpp b/src/plugins/cppeditor/cppcodestylepreferences.cpp index b09537bc72c..27271edcfa0 100644 --- a/src/plugins/cppeditor/cppcodestylepreferences.cpp +++ b/src/plugins/cppeditor/cppcodestylepreferences.cpp @@ -3,6 +3,8 @@ #include "cppcodestylepreferences.h" +using namespace Utils; + namespace CppEditor { CppCodeStylePreferences::CppCodeStylePreferences(QObject *parent) : @@ -78,7 +80,7 @@ QVariantMap CppCodeStylePreferences::toMap() const return map; } -void CppCodeStylePreferences::fromMap(const QVariantMap &map) +void CppCodeStylePreferences::fromMap(const Storage &map) { ICodeStylePreferences::fromMap(map); if (!currentDelegate()) diff --git a/src/plugins/cppeditor/cppcodestylepreferences.h b/src/plugins/cppeditor/cppcodestylepreferences.h index e496de7c6b4..2d10ace3bbd 100644 --- a/src/plugins/cppeditor/cppcodestylepreferences.h +++ b/src/plugins/cppeditor/cppcodestylepreferences.h @@ -25,8 +25,8 @@ public: // tracks parent hierarchy until currentParentSettings is null CppCodeStyleSettings currentCodeStyleSettings() const; - QVariantMap toMap() const override; - void fromMap(const QVariantMap &map) override; + Utils::Storage toMap() const override; + void fromMap(const Utils::Storage &map) override; public slots: void setCodeStyleSettings(const CppCodeStyleSettings &data); diff --git a/src/plugins/cppeditor/cppcodestylesettings.cpp b/src/plugins/cppeditor/cppcodestylesettings.cpp index 0607ce52819..33dd4617f8b 100644 --- a/src/plugins/cppeditor/cppcodestylesettings.cpp +++ b/src/plugins/cppeditor/cppcodestylesettings.cpp @@ -40,6 +40,8 @@ static const char extraPaddingForConditionsIfConfusingAlignKey[] = "ExtraPadding static const char alignAssignmentsKey[] = "AlignAssignments"; static const char shortGetterNameKey[] = "ShortGetterName"; +using namespace Utils; + namespace CppEditor { // ------------------ CppCodeStyleSettingsWidget @@ -73,7 +75,7 @@ QVariantMap CppCodeStyleSettings::toMap() const }; } -void CppCodeStyleSettings::fromMap(const QVariantMap &map) +void CppCodeStyleSettings::fromMap(const Storage &map) { indentBlockBraces = map.value(indentBlockBracesKey, indentBlockBraces).toBool(); indentBlockBody = map.value(indentBlockBodyKey, indentBlockBody).toBool(); diff --git a/src/plugins/cppeditor/cppcodestylesettings.h b/src/plugins/cppeditor/cppcodestylesettings.h index 74de7df83af..38041ccbb3d 100644 --- a/src/plugins/cppeditor/cppcodestylesettings.h +++ b/src/plugins/cppeditor/cppcodestylesettings.h @@ -5,9 +5,7 @@ #include "cppeditor_global.h" -#include <QVariantMap> - -#include <optional> +#include <utils/storage.h> namespace CPlusPlus { class Overview; } namespace TextEditor { class TabSettings; } @@ -66,8 +64,8 @@ public: bool forceFormatting = false; #endif - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); bool equals(const CppCodeStyleSettings &rhs) const; bool operator==(const CppCodeStyleSettings &s) const { return equals(s); } diff --git a/src/plugins/cppeditor/cppprojectupdater.cpp b/src/plugins/cppeditor/cppprojectupdater.cpp index 4df4b5de4ae..c75ee0cb522 100644 --- a/src/plugins/cppeditor/cppprojectupdater.cpp +++ b/src/plugins/cppeditor/cppprojectupdater.cpp @@ -90,7 +90,7 @@ void CppProjectUpdater::update(const ProjectUpdateInfo &projectUpdateInfo, }; const Group root { - Storage(storage), + Tasking::Storage(storage), Group(tasks), onGroupDone(onDone), onGroupError(onError) diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h index 6b890b53a56..21a29fdf700 100644 --- a/src/plugins/debugger/commonoptionspage.h +++ b/src/plugins/debugger/commonoptionspage.h @@ -22,8 +22,8 @@ public: explicit SourcePathMapAspect(Utils::AspectContainer *container); ~SourcePathMapAspect() override; - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; void addToLayout(Layouting::LayoutItem &parent) override; diff --git a/src/plugins/debugger/debuggeritem.h b/src/plugins/debugger/debuggeritem.h index 7341f759357..49d6798ff9e 100644 --- a/src/plugins/debugger/debuggeritem.h +++ b/src/plugins/debugger/debuggeritem.h @@ -10,10 +10,9 @@ #include <utils/filepath.h> #include <utils/environment.h> +#include <utils/storage.h> #include <QDateTime> -#include <QList> -#include <QVariant> namespace Debugger { @@ -38,7 +37,7 @@ public: bool isValid() const; QString engineTypeName() const; - QVariantMap toMap() const; + Utils::Storage toMap() const; QVariant id() const { return m_id; } diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp index 78ea55f2a19..89ce34190dd 100644 --- a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp +++ b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp @@ -211,7 +211,7 @@ int DebuggerRunConfigurationAspect::portsUsedByDebugger() const return ports; } -void DebuggerRunConfigurationAspect::toMap(QVariantMap &map) const +void DebuggerRunConfigurationAspect::toMap(Storage &map) const { m_cppAspect->toMap(map); m_qmlAspect->toMap(map); @@ -223,7 +223,7 @@ void DebuggerRunConfigurationAspect::toMap(QVariantMap &map) const map.insert("RunConfiguration.UseQmlDebuggerAuto", m_qmlAspect->value() == TriState::Default); } -void DebuggerRunConfigurationAspect::fromMap(const QVariantMap &map) +void DebuggerRunConfigurationAspect::fromMap(const Storage &map) { m_cppAspect->fromMap(map); m_qmlAspect->fromMap(map); diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.h b/src/plugins/debugger/debuggerrunconfigurationaspect.h index 53b9c1f54d2..164f4d5eb28 100644 --- a/src/plugins/debugger/debuggerrunconfigurationaspect.h +++ b/src/plugins/debugger/debuggerrunconfigurationaspect.h @@ -17,8 +17,8 @@ public: DebuggerRunConfigurationAspect(ProjectExplorer::Target *target); ~DebuggerRunConfigurationAspect(); - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; bool useCppDebugger() const; bool useQmlDebugger() const; diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index c0ca4bb2f6b..8f74a24da5d 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -452,12 +452,12 @@ SourcePathMapAspect::~SourcePathMapAspect() delete d; } -void SourcePathMapAspect::fromMap(const QVariantMap &) +void SourcePathMapAspect::fromMap(const Storage &) { QTC_CHECK(false); // This is only used via read/writeSettings } -void SourcePathMapAspect::toMap(QVariantMap &) const +void SourcePathMapAspect::toMap(Storage &) const { QTC_CHECK(false); } diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index bdb3a36d71e..63b1604f725 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -778,7 +778,7 @@ const char DockerDeviceKeepEntryPoint[] = "DockerDeviceKeepEntryPoint"; const char DockerDeviceEnableLldbFlags[] = "DockerDeviceEnableLldbFlags"; const char DockerDeviceClangDExecutable[] = "DockerDeviceClangDExecutable"; -void DockerDevice::fromMap(const QVariantMap &map) +void DockerDevice::fromMap(const Storage &map) { ProjectExplorer::IDevice::fromMap(map); DockerDeviceData data; diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 6e40b585372..045cc6943b7 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -99,8 +99,8 @@ public: std::optional<Utils::FilePath> clangdExecutable() const override; protected: - void fromMap(const QVariantMap &map) final; - QVariantMap toMap() const final; + void fromMap(const Utils::Storage &map) final; + Utils::Storage toMap() const final; private: void aboutToBeRemoved() const final; diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 1788997dc1e..8c10ac4777a 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -619,7 +619,7 @@ void GenericBuildSystem::removeFiles(const FilePaths &filesToRemove) } } -Project::RestoreResult GenericProject::fromMap(const QVariantMap &map, QString *errorMessage) +Project::RestoreResult GenericProject::fromMap(const Storage &map, QString *errorMessage) { const RestoreResult result = Project::fromMap(map, errorMessage); if (result != RestoreResult::Ok) diff --git a/src/plugins/genericprojectmanager/genericproject.h b/src/plugins/genericprojectmanager/genericproject.h index a3848402244..40986ff660c 100644 --- a/src/plugins/genericprojectmanager/genericproject.h +++ b/src/plugins/genericprojectmanager/genericproject.h @@ -19,7 +19,7 @@ public: void removeFilesTriggered(const Utils::FilePaths &filesToRemove); private: - RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) final; + RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage) final; ProjectExplorer::DeploymentKnowledge deploymentKnowledge() const final; void configureAsExampleProject(ProjectExplorer::Kit *kit) override; }; diff --git a/src/plugins/git/branchview.cpp b/src/plugins/git/branchview.cpp index 53804efdd9c..77d700147ae 100644 --- a/src/plugins/git/branchview.cpp +++ b/src/plugins/git/branchview.cpp @@ -560,7 +560,7 @@ TaskTree *BranchView::onFastForwardMerge(const std::function<void()> &callback) }); const Group root { - Storage(storage), + Tasking::Storage(storage), parallel, ProcessTask(setupMergeBase, onMergeBaseDone), topRevisionProc, diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index bf568734667..be00253d826 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -248,7 +248,7 @@ GitDiffEditorController::GitDiffEditorController(IDocument *document, }; const Group root { - Storage(diffInputStorage), + Tasking::Storage(diffInputStorage), ProcessTask(setupDiff, onDiffDone), postProcessTask(diffInputStorage) }; @@ -333,8 +333,8 @@ FileListDiffController::FileListDiffController(IDocument *document, const QStrin }; const Group root { - Storage(storage), - Storage(diffInputStorage), + Tasking::Storage(storage), + Tasking::Storage(diffInputStorage), Group { parallel, continueOnDone, @@ -529,8 +529,8 @@ ShowController::ShowController(IDocument *document, const QString &id) }; const Group root { - Storage(storage), - Storage(diffInputStorage), + Tasking::Storage(storage), + Tasking::Storage(diffInputStorage), parallel, onGroupSetup([this] { setStartupFile(VcsBase::source(this->document()).toString()); }), Group { diff --git a/src/plugins/incredibuild/commandbuilder.cpp b/src/plugins/incredibuild/commandbuilder.cpp index 9febc343df0..73f9808a68f 100644 --- a/src/plugins/incredibuild/commandbuilder.cpp +++ b/src/plugins/incredibuild/commandbuilder.cpp @@ -17,7 +17,7 @@ QString CommandBuilder::displayName() const return Tr::tr("Custom Command"); } -void CommandBuilder::fromMap(const QVariantMap &map) +void CommandBuilder::fromMap(const Storage &map) { m_command = FilePath::fromSettings(map.value(QString(CUSTOMCOMMANDBUILDER_COMMAND).arg(id()))); m_args = map.value(QString(CUSTOMCOMMANDBUILDER_ARGS).arg(id())).toString(); diff --git a/src/plugins/incredibuild/commandbuilder.h b/src/plugins/incredibuild/commandbuilder.h index 7d800e91b6a..024b64f55f1 100644 --- a/src/plugins/incredibuild/commandbuilder.h +++ b/src/plugins/incredibuild/commandbuilder.h @@ -20,7 +20,7 @@ public: virtual QString id() const { return "CustomCommandBuilder"; } virtual QString displayName() const; - virtual void fromMap(const QVariantMap &map); + virtual void fromMap(const Utils::Storage &map); virtual void toMap(QVariantMap *map) const; virtual Utils::FilePath defaultCommand() const { return {}; } diff --git a/src/plugins/incredibuild/commandbuilderaspect.cpp b/src/plugins/incredibuild/commandbuilderaspect.cpp index 3eced7c144f..750ec43f09c 100644 --- a/src/plugins/incredibuild/commandbuilderaspect.cpp +++ b/src/plugins/incredibuild/commandbuilderaspect.cpp @@ -159,7 +159,7 @@ void CommandBuilderAspect::addToLayout(Layouting::LayoutItem &parent) updateGui(); } -void CommandBuilderAspect::fromMap(const QVariantMap &map) +void CommandBuilderAspect::fromMap(const Storage &map) { d->m_loadedFromMap = true; @@ -171,7 +171,7 @@ void CommandBuilderAspect::fromMap(const QVariantMap &map) updateGui(); } -void CommandBuilderAspect::toMap(QVariantMap &map) const +void CommandBuilderAspect::toMap(Storage &map) const { map[IncrediBuild::Constants::INCREDIBUILD_BUILDSTEP_TYPE] = QVariant(IncrediBuild::Constants::BUILDCONSOLE_BUILDSTEP_ID); diff --git a/src/plugins/incredibuild/commandbuilderaspect.h b/src/plugins/incredibuild/commandbuilderaspect.h index 6033e9036e5..f8fe6a9f055 100644 --- a/src/plugins/incredibuild/commandbuilderaspect.h +++ b/src/plugins/incredibuild/commandbuilderaspect.h @@ -24,8 +24,8 @@ public: private: void addToLayout(Layouting::LayoutItem &parent) final; - void fromMap(const QVariantMap &map) final; - void toMap(QVariantMap &map) const final; + void fromMap(const Utils::Storage &map) final; + void toMap(Utils::Storage &map) const final; void updateGui(); diff --git a/src/plugins/ios/iosbuildconfiguration.cpp b/src/plugins/ios/iosbuildconfiguration.cpp index 1254115d666..4e98ccb7670 100644 --- a/src/plugins/ios/iosbuildconfiguration.cpp +++ b/src/plugins/ios/iosbuildconfiguration.cpp @@ -376,7 +376,7 @@ public: private: QList<NamedWidget *> createSubConfigWidgets() override; - void fromMap(const QVariantMap &map) override; + void fromMap(const Storage &map) override; void updateQmakeCommand(); @@ -414,7 +414,7 @@ QList<NamedWidget *> IosQmakeBuildConfiguration::createSubConfigWidgets() return subConfigWidgets; } -void IosQmakeBuildConfiguration::fromMap(const QVariantMap &map) +void IosQmakeBuildConfiguration::fromMap(const Storage &map) { QmakeBuildConfiguration::fromMap(map); if (!hasError()) diff --git a/src/plugins/ios/iosbuildstep.cpp b/src/plugins/ios/iosbuildstep.cpp index c017c77408c..2b7faa7f7f4 100644 --- a/src/plugins/ios/iosbuildstep.cpp +++ b/src/plugins/ios/iosbuildstep.cpp @@ -56,8 +56,8 @@ private: bool init() final; void setupOutputFormatter(Utils::OutputFormatter *formatter) final; - void fromMap(const QVariantMap &map) final; - void toMap(QVariantMap &map) const final; + void fromMap(const Storage &map) final; + void toMap(Storage &map) const final; QStringList m_baseBuildArguments; QStringList m_extraArguments; @@ -166,7 +166,7 @@ void IosBuildStep::setupOutputFormatter(OutputFormatter *formatter) AbstractProcessStep::setupOutputFormatter(formatter); } -void IosBuildStep::toMap(QVariantMap &map) const +void IosBuildStep::toMap(Storage &map) const { AbstractProcessStep::toMap(map); @@ -177,7 +177,7 @@ void IosBuildStep::toMap(QVariantMap &map) const map.insert(CLEAN_KEY, stepList()->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN); } -void IosBuildStep::fromMap(const QVariantMap &map) +void IosBuildStep::fromMap(const Storage &map) { QVariant bArgs = map.value(BUILD_ARGUMENTS_KEY); m_baseBuildArguments = bArgs.toStringList(); diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index b2cf10f5da3..5264c763a77 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -20,8 +20,6 @@ #include <QFormLayout> #include <QLabel> #include <QMessageBox> -#include <QVariant> -#include <QVariantMap> #ifdef Q_OS_MAC #include <IOKit/IOKitLib.h> @@ -42,6 +40,7 @@ #include <exception> using namespace ProjectExplorer; +using namespace Utils; namespace { static Q_LOGGING_CATEGORY(detectLog, "qtc.ios.deviceDetect", QtWarningMsg) @@ -127,7 +126,7 @@ IDeviceWidget *IosDevice::createWidget() return new IosDeviceInfoWidget(sharedFromThis()); } -void IosDevice::fromMap(const QVariantMap &map) +void IosDevice::fromMap(const Storage &map) { IDevice::fromMap(map); diff --git a/src/plugins/ios/iosdevice.h b/src/plugins/ios/iosdevice.h index ada952037d9..6e5d6af9f36 100644 --- a/src/plugins/ios/iosdevice.h +++ b/src/plugins/ios/iosdevice.h @@ -40,8 +40,8 @@ public: static QString name(); protected: - void fromMap(const QVariantMap &map) final; - QVariantMap toMap() const final; + void fromMap(const Utils::Storage &map) final; + Utils::Storage toMap() const final; friend class IosDeviceFactory; friend class Ios::Internal::IosDeviceManager; diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index 8bf2685a9fb..b888c497b9a 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -59,8 +59,8 @@ public: private: void setupOutputFormatter(OutputFormatter *formatter) override; - void toMap(QVariantMap &map) const override; - void fromMap(const QVariantMap &map) override; + void toMap(Storage &map) const override; + void fromMap(const Storage &map) override; QStringList defaultCleanCmdList() const; QStringList defaultCmdList() const; @@ -83,7 +83,7 @@ IosDsymBuildStep::IosDsymBuildStep(BuildStepList *parent, Id id) : setIgnoreReturnValue(m_clean); } -void IosDsymBuildStep::toMap(QVariantMap &map) const +void IosDsymBuildStep::toMap(Storage &map) const { AbstractProcessStep::toMap(map); @@ -95,7 +95,7 @@ void IosDsymBuildStep::toMap(QVariantMap &map) const map.insert(id().withSuffix(COMMAND_PARTIAL_KEY).toString(), command().toSettings()); } -void IosDsymBuildStep::fromMap(const QVariantMap &map) +void IosDsymBuildStep::fromMap(const Storage &map) { QVariant bArgs = map.value(id().withSuffix(ARGUMENTS_PARTIAL_KEY).toString()); m_arguments = bArgs.toStringList(); diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index c0169af68b3..fdcc348c0a4 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -206,7 +206,7 @@ FilePath IosRunConfiguration::localExecutable() const return bundleDirectory().pathAppended(applicationName()); } -void IosDeviceTypeAspect::fromMap(const QVariantMap &map) +void IosDeviceTypeAspect::fromMap(const Storage &map) { bool deviceTypeIsInt; map.value(deviceTypeKey).toInt(&deviceTypeIsInt); @@ -216,7 +216,7 @@ void IosDeviceTypeAspect::fromMap(const QVariantMap &map) m_runConfiguration->update(); } -void IosDeviceTypeAspect::toMap(QVariantMap &map) const +void IosDeviceTypeAspect::toMap(Storage &map) const { map.insert(deviceTypeKey, deviceType().toMap()); } diff --git a/src/plugins/ios/iosrunconfiguration.h b/src/plugins/ios/iosrunconfiguration.h index 813a0c5524f..8c7c93bf3bc 100644 --- a/src/plugins/ios/iosrunconfiguration.h +++ b/src/plugins/ios/iosrunconfiguration.h @@ -27,8 +27,8 @@ public: explicit IosDeviceTypeAspect(Utils::AspectContainer *container, IosRunConfiguration *runConfiguration); - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; void addToLayout(Layouting::LayoutItem &parent) override; IosDeviceType deviceType() const; diff --git a/src/plugins/ios/iossimulator.cpp b/src/plugins/ios/iossimulator.cpp index d646052126a..391a77548bc 100644 --- a/src/plugins/ios/iossimulator.cpp +++ b/src/plugins/ios/iossimulator.cpp @@ -13,6 +13,7 @@ #include <QMapIterator> using namespace ProjectExplorer; +using namespace Utils; namespace Ios::Internal { @@ -72,7 +73,7 @@ IosDeviceType::IosDeviceType(IosDeviceType::Type type, const QString &identifier type(type), identifier(identifier), displayName(displayName) { } -bool IosDeviceType::fromMap(const QVariantMap &map) +bool IosDeviceType::fromMap(const Storage &map) { bool validType; displayName = map.value(iosDeviceTypeDisplayNameKey, QVariant()).toString(); diff --git a/src/plugins/ios/iossimulator.h b/src/plugins/ios/iossimulator.h index 988776e5086..c5b6d4c81e0 100644 --- a/src/plugins/ios/iossimulator.h +++ b/src/plugins/ios/iossimulator.h @@ -25,8 +25,8 @@ public: IosDeviceType(Type type = IosDevice, const QString &identifier = QString(), const QString &displayName = QString()); - bool fromMap(const QVariantMap &map); - QVariantMap toMap() const; + bool fromMap(const Utils::Storage &map); + Utils::Storage toMap() const; bool operator ==(const IosDeviceType &o) const; bool operator !=(const IosDeviceType &o) const { return !(*this == o); } diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index 349a84f7b88..6a700598461 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -66,6 +66,8 @@ constexpr char typedClientsKey[] = "typedClients"; constexpr char outlineSortedKey[] = "outlineSorted"; constexpr char mimeType[] = "application/language.client.setting"; +using namespace Utils; + namespace LanguageClient { class LanguageClientSettingsModel : public QAbstractListModel @@ -576,7 +578,7 @@ QVariantMap BaseSettings::toMap() const return map; } -void BaseSettings::fromMap(const QVariantMap &map) +void BaseSettings::fromMap(const Storage &map) { m_name = map[nameKey].toString(); m_id = map.value(idKey, QUuid::createUuid().toString()).toString(); @@ -720,7 +722,7 @@ QVariantMap StdIOSettings::toMap() const return map; } -void StdIOSettings::fromMap(const QVariantMap &map) +void StdIOSettings::fromMap(const Storage &map) { BaseSettings::fromMap(map); m_executable = Utils::FilePath::fromSettings(map[executableKey]); diff --git a/src/plugins/languageclient/languageclientsettings.h b/src/plugins/languageclient/languageclientsettings.h index bb8ebe631f9..9d32d9e6d76 100644 --- a/src/plugins/languageclient/languageclientsettings.h +++ b/src/plugins/languageclient/languageclientsettings.h @@ -79,8 +79,8 @@ public: virtual bool isValid() const; Client *createClient() const; Client *createClient(ProjectExplorer::Project *project) const; - virtual QVariantMap toMap() const; - virtual void fromMap(const QVariantMap &map); + virtual Utils::Storage toMap() const; + virtual void fromMap(const Utils::Storage &map); protected: virtual BaseClientInterface *createInterface(ProjectExplorer::Project *) const; @@ -108,8 +108,8 @@ public: QWidget *createSettingsWidget(QWidget *parent = nullptr) const override; BaseSettings *copy() const override { return new StdIOSettings(*this); } bool isValid() const override; - QVariantMap toMap() const override; - void fromMap(const QVariantMap &map) override; + Utils::Storage toMap() const override; + void fromMap(const Utils::Storage &map) override; QString arguments() const; Utils::CommandLine command() const; diff --git a/src/plugins/languageclient/locatorfilter.cpp b/src/plugins/languageclient/locatorfilter.cpp index f2f14e7d7c2..7f78130bdb0 100644 --- a/src/plugins/languageclient/locatorfilter.cpp +++ b/src/plugins/languageclient/locatorfilter.cpp @@ -76,7 +76,7 @@ LocatorMatcherTask locatorMatcher(Client *client, int maxResultCount, }; const Group root { - Storage(resultStorage), + Tasking::Storage(resultStorage), ClientWorkspaceSymbolRequestTask(onQuerySetup, onQueryDone), AsyncTask<void>(onFilterSetup) }; @@ -135,7 +135,7 @@ LocatorMatcherTask currentDocumentMatcher() }; const Group root { - Storage(resultStorage), + Tasking::Storage(resultStorage), CurrentDocumentSymbolsRequestTask(onQuerySetup, onQueryDone), AsyncTask<void>(onFilterSetup) }; diff --git a/src/plugins/mercurial/mercurialclient.cpp b/src/plugins/mercurial/mercurialclient.cpp index b2136e43afd..bd5e45f4e96 100644 --- a/src/plugins/mercurial/mercurialclient.cpp +++ b/src/plugins/mercurial/mercurialclient.cpp @@ -64,7 +64,7 @@ MercurialDiffEditorController::MercurialDiffEditorController(IDocument *document }; const Group root { - Storage(diffInputStorage), + Tasking::Storage(diffInputStorage), ProcessTask(setupDiff, onDiffDone), postProcessTask(diffInputStorage) }; diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp index 579efa7035f..0255bc282fa 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp @@ -137,14 +137,14 @@ void MesonBuildConfiguration::setParameters(const QString ¶ms) emit parametersChanged(); } -void MesonBuildConfiguration::toMap(QVariantMap &map) const +void MesonBuildConfiguration::toMap(Storage &map) const { ProjectExplorer::BuildConfiguration::toMap(map); map[Constants::BuildConfiguration::BUILD_TYPE_KEY] = mesonBuildTypeName(m_buildType); map[Constants::BuildConfiguration::PARAMETERS_KEY] = m_parameters; } -void MesonBuildConfiguration::fromMap(const QVariantMap &map) +void MesonBuildConfiguration::fromMap(const Storage &map) { ProjectExplorer::BuildConfiguration::fromMap(map); m_buildSystem = new MesonBuildSystem{this}; diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h index 5721ee5938e..cdd4465e477 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h +++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h @@ -30,8 +30,8 @@ signals: void parametersChanged(); private: - void toMap(QVariantMap &map) const override; - void fromMap(const QVariantMap &map) override; + void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Storage &map) override; MesonBuildType m_buildType; ProjectExplorer::NamedWidget *createConfigWidget() final; diff --git a/src/plugins/mesonprojectmanager/ninjabuildstep.cpp b/src/plugins/mesonprojectmanager/ninjabuildstep.cpp index 02065c12a98..ec63aa01b8b 100644 --- a/src/plugins/mesonprojectmanager/ninjabuildstep.cpp +++ b/src/plugins/mesonprojectmanager/ninjabuildstep.cpp @@ -199,14 +199,14 @@ void NinjaBuildStep::setCommandArgs(const QString &args) m_commandArgs = args.trimmed(); } -void NinjaBuildStep::toMap(QVariantMap &map) const +void NinjaBuildStep::toMap(Storage &map) const { AbstractProcessStep::toMap(map); map.insert(TARGETS_KEY, m_targetName); map.insert(TOOL_ARGUMENTS_KEY, m_commandArgs); } -void NinjaBuildStep::fromMap(const QVariantMap &map) +void NinjaBuildStep::fromMap(const Storage &map) { m_targetName = map.value(TARGETS_KEY).toString(); m_commandArgs = map.value(TOOL_ARGUMENTS_KEY).toString(); diff --git a/src/plugins/mesonprojectmanager/ninjabuildstep.h b/src/plugins/mesonprojectmanager/ninjabuildstep.h index 750ab6d9e0a..aa2eeefba59 100644 --- a/src/plugins/mesonprojectmanager/ninjabuildstep.h +++ b/src/plugins/mesonprojectmanager/ninjabuildstep.h @@ -26,8 +26,8 @@ public: Q_SIGNAL void targetListChanged(); Q_SIGNAL void commandChanged(); - void toMap(QVariantMap &map) const override; - void fromMap(const QVariantMap &map) override; + void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Storage &map) override; private: void update(bool parsingSuccessful); diff --git a/src/plugins/nim/project/nimblebuildconfiguration.cpp b/src/plugins/nim/project/nimblebuildconfiguration.cpp index 3a198474983..2df654cb414 100644 --- a/src/plugins/nim/project/nimblebuildconfiguration.cpp +++ b/src/plugins/nim/project/nimblebuildconfiguration.cpp @@ -37,13 +37,13 @@ BuildConfiguration::BuildType NimbleBuildConfiguration::buildType() const return m_buildType; } -void NimbleBuildConfiguration::fromMap(const QVariantMap &map) +void NimbleBuildConfiguration::fromMap(const Storage &map) { m_buildType = static_cast<BuildType>(map[Constants::C_NIMBLEBUILDCONFIGURATION_BUILDTYPE].toInt()); BuildConfiguration::fromMap(map); } -void NimbleBuildConfiguration::toMap(QVariantMap &map) const +void NimbleBuildConfiguration::toMap(Storage &map) const { BuildConfiguration::toMap(map); map[Constants::C_NIMBLEBUILDCONFIGURATION_BUILDTYPE] = buildType(); diff --git a/src/plugins/nim/project/nimblebuildconfiguration.h b/src/plugins/nim/project/nimblebuildconfiguration.h index 236ea3a15cc..882dd78f1bc 100644 --- a/src/plugins/nim/project/nimblebuildconfiguration.h +++ b/src/plugins/nim/project/nimblebuildconfiguration.h @@ -18,8 +18,8 @@ class NimbleBuildConfiguration : public ProjectExplorer::BuildConfiguration BuildType buildType() const override; - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; private: void setBuildType(BuildType buildType); diff --git a/src/plugins/nim/project/nimbleproject.cpp b/src/plugins/nim/project/nimbleproject.cpp index aeb16c8a8df..6c07aaad7bb 100644 --- a/src/plugins/nim/project/nimbleproject.cpp +++ b/src/plugins/nim/project/nimbleproject.cpp @@ -13,6 +13,7 @@ #include <utils/qtcassert.h> using namespace ProjectExplorer; +using namespace Utils; namespace Nim { @@ -26,13 +27,13 @@ NimbleProject::NimbleProject(const Utils::FilePath &fileName) setBuildSystemCreator([] (Target *t) { return new NimbleBuildSystem(t); }); } -void NimbleProject::toMap(QVariantMap &map) const +void NimbleProject::toMap(Storage &map) const { Project::toMap(map); map[Constants::C_NIMPROJECT_EXCLUDEDFILES] = m_excludedFiles; } -Project::RestoreResult NimbleProject::fromMap(const QVariantMap &map, QString *errorMessage) +Project::RestoreResult NimbleProject::fromMap(const Storage &map, QString *errorMessage) { auto result = Project::fromMap(map, errorMessage); m_excludedFiles = map.value(Constants::C_NIMPROJECT_EXCLUDEDFILES).toStringList(); diff --git a/src/plugins/nim/project/nimbleproject.h b/src/plugins/nim/project/nimbleproject.h index 4a71514e898..38038ca15ab 100644 --- a/src/plugins/nim/project/nimbleproject.h +++ b/src/plugins/nim/project/nimbleproject.h @@ -16,14 +16,14 @@ public: NimbleProject(const Utils::FilePath &filename); // Keep for compatibility with Qt Creator 4.10 - void toMap(QVariantMap &map) const final; + void toMap(Utils::Storage &map) const final; QStringList excludedFiles() const; void setExcludedFiles(const QStringList &excludedFiles); protected: // Keep for compatibility with Qt Creator 4.10 - RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) final; + RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage) final; QStringList m_excludedFiles; }; diff --git a/src/plugins/nim/project/nimcompilerbuildstep.cpp b/src/plugins/nim/project/nimcompilerbuildstep.cpp index 5b11856941a..2091e510246 100644 --- a/src/plugins/nim/project/nimcompilerbuildstep.cpp +++ b/src/plugins/nim/project/nimcompilerbuildstep.cpp @@ -121,7 +121,7 @@ QWidget *NimCompilerBuildStep::createConfigWidget() return widget; } -void NimCompilerBuildStep::fromMap(const QVariantMap &map) +void NimCompilerBuildStep::fromMap(const Storage &map) { AbstractProcessStep::fromMap(map); m_userCompilerOptions = map[Constants::C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS].toString().split('|'); @@ -129,7 +129,7 @@ void NimCompilerBuildStep::fromMap(const QVariantMap &map) m_targetNimFile = FilePath::fromString(map[Constants::C_NIMCOMPILERBUILDSTEP_TARGETNIMFILE].toString()); } -void NimCompilerBuildStep::toMap(QVariantMap &map) const +void NimCompilerBuildStep::toMap(Storage &map) const { AbstractProcessStep::toMap(map); map[Constants::C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS] = m_userCompilerOptions.join('|'); diff --git a/src/plugins/nim/project/nimcompilerbuildstep.h b/src/plugins/nim/project/nimcompilerbuildstep.h index fdd902af53d..97b1e448f18 100644 --- a/src/plugins/nim/project/nimcompilerbuildstep.h +++ b/src/plugins/nim/project/nimcompilerbuildstep.h @@ -26,8 +26,8 @@ private: void setupOutputFormatter(Utils::OutputFormatter *formatter) override; QWidget *createConfigWidget() override; - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; void updateTargetNimFile(); Utils::CommandLine commandLine(); diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp index f7cf92fd064..e7f971395f1 100644 --- a/src/plugins/nim/project/nimproject.cpp +++ b/src/plugins/nim/project/nimproject.cpp @@ -27,14 +27,14 @@ public: Tasks projectIssues(const Kit *k) const final; // Keep for compatibility with Qt Creator 4.10 - void toMap(QVariantMap &map) const final; + void toMap(Storage &map) const final; QStringList excludedFiles() const; void setExcludedFiles(const QStringList &excludedFiles); protected: // Keep for compatibility with Qt Creator 4.10 - RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) final; + RestoreResult fromMap(const Storage &map, QString *errorMessage) final; QStringList m_excludedFiles; }; @@ -63,13 +63,13 @@ Tasks NimProject::projectIssues(const Kit *k) const return result; } -void NimProject::toMap(QVariantMap &map) const +void NimProject::toMap(Storage &map) const { Project::toMap(map); map[Constants::C_NIMPROJECT_EXCLUDEDFILES] = m_excludedFiles; } -Project::RestoreResult NimProject::fromMap(const QVariantMap &map, QString *errorMessage) +Project::RestoreResult NimProject::fromMap(const Storage &map, QString *errorMessage) { auto result = Project::fromMap(map, errorMessage); m_excludedFiles = map.value(Constants::C_NIMPROJECT_EXCLUDEDFILES).toStringList(); diff --git a/src/plugins/nim/project/nimtoolchain.cpp b/src/plugins/nim/project/nimtoolchain.cpp index 871c4b14c33..52ac24e7767 100644 --- a/src/plugins/nim/project/nimtoolchain.cpp +++ b/src/plugins/nim/project/nimtoolchain.cpp @@ -89,7 +89,7 @@ QString NimToolChain::compilerVersion() const std::get<2>(m_version)); } -void NimToolChain::fromMap(const QVariantMap &data) +void NimToolChain::fromMap(const Storage &data) { ToolChain::fromMap(data); if (hasError()) diff --git a/src/plugins/nim/project/nimtoolchain.h b/src/plugins/nim/project/nimtoolchain.h index c86a35a91a2..82f0e2d8175 100644 --- a/src/plugins/nim/project/nimtoolchain.h +++ b/src/plugins/nim/project/nimtoolchain.h @@ -26,7 +26,7 @@ public: QList<Utils::OutputLineParser *> createOutputParsers() const final; std::unique_ptr<ProjectExplorer::ToolChainConfigWidget> createConfigurationWidget() final; - void fromMap(const QVariantMap &data) final; + void fromMap(const Utils::Storage &data) final; static bool parseVersion(const Utils::FilePath &path, std::tuple<int, int, int> &version); diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index d44ba31dfa8..79d6ed033b8 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -87,7 +87,7 @@ void BuildDirectoryAspect::setProblem(const QString &description) updateProblemLabel(); } -void BuildDirectoryAspect::toMap(QVariantMap &map) const +void BuildDirectoryAspect::toMap(Storage &map) const { FilePathAspect::toMap(map); if (!d->sourceDir.isEmpty()) { @@ -96,7 +96,7 @@ void BuildDirectoryAspect::toMap(QVariantMap &map) const } } -void BuildDirectoryAspect::fromMap(const QVariantMap &map) +void BuildDirectoryAspect::fromMap(const Storage &map) { FilePathAspect::fromMap(map); if (!d->sourceDir.isEmpty()) { diff --git a/src/plugins/projectexplorer/buildaspects.h b/src/plugins/projectexplorer/buildaspects.h index 5471ce893ae..ade7c14dad5 100644 --- a/src/plugins/projectexplorer/buildaspects.h +++ b/src/plugins/projectexplorer/buildaspects.h @@ -28,8 +28,8 @@ public: static Utils::FilePath fixupDir(const Utils::FilePath &dir); private: - void toMap(QVariantMap &map) const override; - void fromMap(const QVariantMap &map) override; + void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Storage &map) override; void updateProblemLabel(); diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 234d4935085..83710cae525 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -372,7 +372,7 @@ void BuildConfiguration::appendInitialCleanStep(Utils::Id id) d->m_initialCleanSteps.append(id); } -void BuildConfiguration::toMap(QVariantMap &map) const +void BuildConfiguration::toMap(Storage &map) const { ProjectConfiguration::toMap(map); @@ -388,7 +388,7 @@ void BuildConfiguration::toMap(QVariantMap &map) const map.insert(CUSTOM_PARSERS_KEY, transform(d->m_customParsers,&Utils::Id::toSetting)); } -void BuildConfiguration::fromMap(const QVariantMap &map) +void BuildConfiguration::fromMap(const Storage &map) { d->m_clearSystemEnvironment = map.value(QLatin1String(Constants::CLEAR_SYSTEM_ENVIRONMENT_KEY)) .toBool(); diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index 85ee42247bb..cc37e391967 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -68,8 +68,8 @@ public: void appendInitialBuildStep(Utils::Id id); void appendInitialCleanStep(Utils::Id id); - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; bool isEnabled() const; QString disabledReason() const; @@ -149,7 +149,7 @@ public: BuildConfiguration *create(Target *parent, const BuildInfo &info) const; - static BuildConfiguration *restore(Target *parent, const QVariantMap &map); + static BuildConfiguration *restore(Target *parent, const Utils::Storage &map); static BuildConfiguration *clone(Target *parent, const BuildConfiguration *source); static BuildConfigurationFactory *find(const Kit *k, const Utils::FilePath &projectPath); diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 0f1ca94997a..f30ca9e524a 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -126,13 +126,13 @@ QWidget *BuildStep::createConfigWidget() return widget; } -void BuildStep::fromMap(const QVariantMap &map) +void BuildStep::fromMap(const Storage &map) { m_enabled = map.value(buildStepEnabledKey, true).toBool(); ProjectConfiguration::fromMap(map); } -void BuildStep::toMap(QVariantMap &map) const +void BuildStep::toMap(Storage &map) const { ProjectConfiguration::toMap(map); map.insert(buildStepEnabledKey, m_enabled); @@ -397,7 +397,7 @@ BuildStep *BuildStepFactory::create(BuildStepList *parent) return step; } -BuildStep *BuildStepFactory::restore(BuildStepList *parent, const QVariantMap &map) +BuildStep *BuildStepFactory::restore(BuildStepList *parent, const Storage &map) { BuildStep *bs = create(parent); if (!bs) diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 8c37ff3ecde..9118e34db90 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -40,8 +40,8 @@ protected: public: virtual bool init() = 0; - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; bool enabled() const; void setEnabled(bool b); @@ -137,7 +137,7 @@ public: BuildStep::Flags stepFlags() const; Utils::Id stepId() const; BuildStep *create(BuildStepList *parent); - BuildStep *restore(BuildStepList *parent, const QVariantMap &map); + BuildStep *restore(BuildStepList *parent, const Utils::Storage &map); bool canHandle(BuildStepList *bsl) const; diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index c5a361a24e8..2895b7925e2 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -14,6 +14,8 @@ #include <QDebug> +using namespace Utils; + namespace ProjectExplorer { const char STEPS_COUNT_KEY[] = "ProjectExplorer.BuildStepList.StepsCount"; @@ -41,9 +43,9 @@ Target *BuildStepList::target() const return m_projectConfiguration->target(); } -QVariantMap BuildStepList::toMap() const +Storage BuildStepList::toMap() const { - QVariantMap map; + Storage map; { // Only written for compatibility reasons within the 4.11 cycle @@ -58,7 +60,7 @@ QVariantMap BuildStepList::toMap() const // Save build steps map.insert(QString::fromLatin1(STEPS_COUNT_KEY), m_steps.count()); for (int i = 0; i < m_steps.count(); ++i) { - QVariantMap data; + Storage data; m_steps.at(i)->toMap(data); map.insert(QString::fromLatin1(STEPS_PREFIX) + QString::number(i), data); } @@ -101,7 +103,7 @@ QString BuildStepList::displayName() const return {}; } -bool BuildStepList::fromMap(const QVariantMap &map) +bool BuildStepList::fromMap(const Storage &map) { clear(); @@ -109,7 +111,7 @@ bool BuildStepList::fromMap(const QVariantMap &map) int maxSteps = map.value(QString::fromLatin1(STEPS_COUNT_KEY), 0).toInt(); for (int i = 0; i < maxSteps; ++i) { - QVariantMap bsData(map.value(QString::fromLatin1(STEPS_PREFIX) + QString::number(i)).toMap()); + Storage bsData(map.value(QString::fromLatin1(STEPS_PREFIX) + QString::number(i)).toMap()); if (bsData.isEmpty()) { qWarning() << "No step data found for" << i << "(continuing)."; continue; diff --git a/src/plugins/projectexplorer/buildsteplist.h b/src/plugins/projectexplorer/buildsteplist.h index a5c32cf1a4a..6af0fc54372 100644 --- a/src/plugins/projectexplorer/buildsteplist.h +++ b/src/plugins/projectexplorer/buildsteplist.h @@ -6,9 +6,9 @@ #include "projectexplorer_export.h" #include <utils/id.h> +#include <utils/storage.h> #include <QObject> -#include <QVariantMap> namespace ProjectExplorer { @@ -60,8 +60,8 @@ public: ProjectConfiguration *projectConfiguration() const { return m_projectConfiguration; } Target *target() const; - QVariantMap toMap() const; - bool fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + bool fromMap(const Utils::Storage &map); Utils::Id id() const { return m_id; } QString displayName() const; diff --git a/src/plugins/projectexplorer/customparser.cpp b/src/plugins/projectexplorer/customparser.cpp index c04b240d12d..d406f0cf240 100644 --- a/src/plugins/projectexplorer/customparser.cpp +++ b/src/plugins/projectexplorer/customparser.cpp @@ -103,7 +103,7 @@ QVariantMap CustomParserExpression::toMap() const return map; } -void CustomParserExpression::fromMap(const QVariantMap &map) +void CustomParserExpression::fromMap(const Storage &map) { setPattern(map.value(patternKey).toString()); setMessageCap(map.value(messageCapKey).toInt()); @@ -149,7 +149,7 @@ QVariantMap CustomParserSettings::toMap() const return map; } -void CustomParserSettings::fromMap(const QVariantMap &map) +void CustomParserSettings::fromMap(const Storage &map) { id = Utils::Id::fromSetting(map.value(idKey)); displayName = map.value(nameKey).toString(); @@ -173,12 +173,12 @@ CustomParsersAspect::CustomParsersAspect(Target *target) }); } -void CustomParsersAspect::fromMap(const QVariantMap &map) +void CustomParsersAspect::fromMap(const Storage &map) { m_parsers = transform(map.value(settingsKey()).toList(), &Utils::Id::fromSetting); } -void CustomParsersAspect::toMap(QVariantMap &map) const +void CustomParsersAspect::toMap(Storage &map) const { map.insert(settingsKey(), transform(m_parsers, &Utils::Id::toSetting)); } diff --git a/src/plugins/projectexplorer/customparser.h b/src/plugins/projectexplorer/customparser.h index d11979bcc21..de49bc00993 100644 --- a/src/plugins/projectexplorer/customparser.h +++ b/src/plugins/projectexplorer/customparser.h @@ -44,8 +44,8 @@ public: int messageCap() const; void setMessageCap(int messageCap); - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); private: QRegularExpression m_regExp; @@ -62,8 +62,8 @@ public: bool operator ==(const CustomParserSettings &other) const; bool operator !=(const CustomParserSettings &other) const { return !operator==(other); } - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); Utils::Id id; QString displayName; @@ -86,8 +86,8 @@ public: }; private: - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; QList<Utils::Id> m_parsers; }; diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp index 74356e8d7a4..0e101b66e33 100644 --- a/src/plugins/projectexplorer/customtoolchain.cpp +++ b/src/plugins/projectexplorer/customtoolchain.cpp @@ -77,8 +77,8 @@ public: QStringList headerPathsList() const; void setHeaderPaths(const QStringList &list); - void toMap(QVariantMap &data) const override; - void fromMap(const QVariantMap &data) override; + void toMap(Storage &data) const override; + void fromMap(const Storage &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; @@ -271,7 +271,7 @@ QString CustomToolChain::mkspecs() const return m_mkspecs.join(','); } -void CustomToolChain::toMap(QVariantMap &data) const +void CustomToolChain::toMap(Storage &data) const { ToolChain::toMap(data); data.insert(QLatin1String(makeCommandKeyC), m_makeCommand.toString()); @@ -283,7 +283,7 @@ void CustomToolChain::toMap(QVariantMap &data) const data.insert(QLatin1String(outputParserKeyC), m_outputParserId.toSetting()); } -void CustomToolChain::fromMap(const QVariantMap &data) +void CustomToolChain::fromMap(const Storage &data) { ToolChain::fromMap(data); if (hasError()) diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp index 3b267b59bb0..6fddd289e05 100644 --- a/src/plugins/projectexplorer/deployconfiguration.cpp +++ b/src/plugins/projectexplorer/deployconfiguration.cpp @@ -50,13 +50,13 @@ QWidget *DeployConfiguration::createConfigWidget() return m_configWidgetCreator(this); } -void DeployConfiguration::toMap(QVariantMap &map) const +void DeployConfiguration::toMap(Storage &map) const { ProjectConfiguration::toMap(map); map.insert(QLatin1String(BUILD_STEP_LIST_COUNT), 1); map.insert(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1Char('0'), m_stepList.toMap()); map.insert(USES_DEPLOYMENT_DATA, usesCustomDeploymentData()); - QVariantMap deployData; + Storage deployData; for (int i = 0; i < m_customDeploymentData.fileCount(); ++i) { const DeployableFile &f = m_customDeploymentData.fileAt(i); deployData.insert(f.localFilePath().toString(), f.remoteDirectory()); @@ -64,7 +64,7 @@ void DeployConfiguration::toMap(QVariantMap &map) const map.insert(DEPLOYMENT_DATA, deployData); } -void DeployConfiguration::fromMap(const QVariantMap &map) +void DeployConfiguration::fromMap(const Storage &map) { ProjectConfiguration::fromMap(map); if (hasError()) @@ -75,7 +75,7 @@ void DeployConfiguration::fromMap(const QVariantMap &map) reportError(); return; } - QVariantMap data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1Char('0')).toMap(); + Storage data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1Char('0')).toMap(); if (!data.isEmpty()) { m_stepList.clear(); if (!m_stepList.fromMap(data)) { @@ -91,7 +91,7 @@ void DeployConfiguration::fromMap(const QVariantMap &map) } m_usesCustomDeploymentData = map.value(USES_DEPLOYMENT_DATA, false).toBool(); - const QVariantMap deployData = map.value(DEPLOYMENT_DATA).toMap(); + const Storage deployData = map.value(DEPLOYMENT_DATA).toMap(); for (auto it = deployData.begin(); it != deployData.end(); ++it) m_customDeploymentData.addFile(FilePath::fromString(it.key()), it.value().toString()); } @@ -188,12 +188,12 @@ DeployConfiguration *DeployConfigurationFactory::create(Target *parent) DeployConfiguration *DeployConfigurationFactory::clone(Target *parent, const DeployConfiguration *source) { - QVariantMap map; + Storage map; source->toMap(map); return restore(parent, map); } -DeployConfiguration *DeployConfigurationFactory::restore(Target *parent, const QVariantMap &map) +DeployConfiguration *DeployConfigurationFactory::restore(Target *parent, const Storage &map) { const Id id = idFromMap(map); DeployConfigurationFactory *factory = Utils::findOrDefault(g_deployConfigurationFactories, diff --git a/src/plugins/projectexplorer/deployconfiguration.h b/src/plugins/projectexplorer/deployconfiguration.h index 48f07d90906..599e424f3cf 100644 --- a/src/plugins/projectexplorer/deployconfiguration.h +++ b/src/plugins/projectexplorer/deployconfiguration.h @@ -31,8 +31,8 @@ public: QWidget *createConfigWidget(); - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; bool isActive() const; @@ -66,7 +66,7 @@ public: DeployConfiguration *create(Target *parent); static const QList<DeployConfigurationFactory *> find(Target *parent); - static DeployConfiguration *restore(Target *parent, const QVariantMap &map); + static DeployConfiguration *restore(Target *parent, const Utils::Storage &map); static DeployConfiguration *clone(Target *parent, const DeployConfiguration *dc); void addSupportedTargetDeviceType(Utils::Id id); @@ -81,7 +81,7 @@ public: void setConfigWidgetCreator(const DeployConfiguration::WidgetCreator &configWidgetCreator); void setUseDeploymentDataView(); - using PostRestore = std::function<void(DeployConfiguration *dc, const QVariantMap &)>; + using PostRestore = std::function<void(DeployConfiguration *dc, const Utils::Storage &)>; void setPostRestore(const PostRestore &postRestore) { m_postRestore = postRestore; } PostRestore postRestore() const { return m_postRestore; } diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 4f9e07ee64d..65285e9d9e1 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -129,7 +129,7 @@ FilePath DesktopDevice::rootPath() const return IDevice::rootPath(); } -void DesktopDevice::fromMap(const QVariantMap &map) +void DesktopDevice::fromMap(const Storage &map) { IDevice::fromMap(map); diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.h b/src/plugins/projectexplorer/devicesupport/desktopdevice.h index f37c3f7f948..71fff98d102 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.h @@ -36,7 +36,7 @@ public: Utils::FilePath rootPath() const override; Utils::FilePath filePath(const QString &pathOnDevice) const override; - void fromMap(const QVariantMap &map) override; + void fromMap(const Utils::Storage &map) override; protected: DesktopDevice(); diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index f783ea18139..bf12dc56416 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -204,7 +204,7 @@ static const IDeviceFactory *restoreFactory(const QVariantMap &map) return factory; } -QList<IDevice::Ptr> DeviceManager::fromMap(const QVariantMap &map, QHash<Id, Id> *defaultDevices) +QList<IDevice::Ptr> DeviceManager::fromMap(const Storage &map, QHash<Id, Id> *defaultDevices) { QList<IDevice::Ptr> devices; diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.h b/src/plugins/projectexplorer/devicesupport/devicemanager.h index ce12ccf1b83..2f5aa0ea45d 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.h +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.h @@ -65,8 +65,8 @@ private: DeviceManager(bool isInstance = true); void load(); - QList<IDevice::Ptr> fromMap(const QVariantMap &map, QHash<Utils::Id, Utils::Id> *defaultDevices); - QVariantMap toMap() const; + QList<IDevice::Ptr> fromMap(const Utils::Storage &map, QHash<Utils::Id, Utils::Id> *defaultDevices); + Utils::Storage toMap() const; // For SettingsWidget. IDevice::Ptr mutableDevice(Utils::Id id) const; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index cc55991e66a..3fe494eaa24 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -146,7 +146,7 @@ public: QList<Icon> deviceIcons; QList<IDevice::DeviceAction> deviceActions; - QVariantMap extraData; + Storage extraData; IDevice::OpenTerminal openTerminal; }; } // namespace Internal @@ -420,12 +420,12 @@ void IDevice::setDeviceState(const IDevice::DeviceState state) d->deviceState = state; } -Id IDevice::typeFromMap(const QVariantMap &map) +Id IDevice::typeFromMap(const Storage &map) { return Id::fromSetting(map.value(QLatin1String(TypeKey))); } -Id IDevice::idFromMap(const QVariantMap &map) +Id IDevice::idFromMap(const Storage &map) { return Id::fromSetting(map.value(QLatin1String(IdKey))); } @@ -436,7 +436,7 @@ Id IDevice::idFromMap(const QVariantMap &map) base class implementation. */ -void IDevice::fromMap(const QVariantMap &map) +void IDevice::fromMap(const Storage &map) { d->type = typeFromMap(map); d->displayName.fromMap(map, DisplayNameKey); @@ -485,7 +485,7 @@ void IDevice::fromMap(const QVariantMap &map) call the base class implementation. */ -QVariantMap IDevice::toMap() const +Storage IDevice::toMap() const { QVariantMap map; d->displayName.toMap(map, DisplayNameKey); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 13b70892a70..d34e49cd6c2 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -12,6 +12,7 @@ #include <utils/expected.h> #include <utils/filepath.h> #include <utils/hostosinfo.h> +#include <utils/storage.h> #include <QAbstractSocket> #include <QCoreApplication> @@ -19,7 +20,6 @@ #include <QObject> #include <QSharedPointer> #include <QUrl> -#include <QVariantMap> #include <functional> #include <memory> @@ -150,8 +150,8 @@ public: void setDeviceState(const DeviceState state); QString deviceStateToString() const; - static Utils::Id typeFromMap(const QVariantMap &map); - static Utils::Id idFromMap(const QVariantMap &map); + static Utils::Id typeFromMap(const Utils::Storage &map); + static Utils::Id idFromMap(const Utils::Storage &map); static QString defaultPrivateKeyFilePath(); static QString defaultPublicKeyFilePath(); @@ -218,8 +218,8 @@ public: protected: IDevice(); - virtual void fromMap(const QVariantMap &map); - virtual QVariantMap toMap() const; + virtual void fromMap(const Utils::Storage &map); + virtual Utils::Storage toMap() const; using OpenTerminal = std::function<void(const Utils::Environment &, const Utils::FilePath &)>; void setOpenTerminal(const OpenTerminal &openTerminal); diff --git a/src/plugins/projectexplorer/devicesupport/idevicefactory.cpp b/src/plugins/projectexplorer/devicesupport/idevicefactory.cpp index 2ff351a8c29..4a5b9b55308 100644 --- a/src/plugins/projectexplorer/devicesupport/idevicefactory.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevicefactory.cpp @@ -37,14 +37,14 @@ namespace ProjectExplorer { */ /*! - \fn virtual bool canRestore(const QVariantMap &map) const = 0 + \fn virtual bool canRestore(const Utils::Storage &map) const = 0 Checks whether this factory can restore a device from the serialized state specified by \a map. */ /*! - \fn virtual IDevice::Ptr restore(const QVariantMap &map) const = 0 + \fn virtual IDevice::Ptr restore(const Utils::Storage &map) const = 0 Loads a device from a serialized state. Only called if \c canRestore() returns true for \a map. diff --git a/src/plugins/projectexplorer/devicesupport/idevicefactory.h b/src/plugins/projectexplorer/devicesupport/idevicefactory.h index 665059f5b2c..c6af716ad73 100644 --- a/src/plugins/projectexplorer/devicesupport/idevicefactory.h +++ b/src/plugins/projectexplorer/devicesupport/idevicefactory.h @@ -4,11 +4,13 @@ #pragma once #include "idevicefwd.h" + #include <projectexplorer/projectexplorer_export.h> + #include <utils/id.h> +#include <utils/storage.h> #include <QIcon> -#include <QVariantMap> namespace Utils { class FilePath; } @@ -28,7 +30,7 @@ public: IDevicePtr create() const; bool quickCreationAllowed() const; - virtual bool canRestore(const QVariantMap &) const { return true; } + virtual bool canRestore(const Utils::Storage &) const { return true; } static IDeviceFactory *find(Utils::Id type); diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index ff99bc25e83..3642ec90a2c 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -34,6 +34,7 @@ static const QLatin1String kCodeStylePrefix("EditorConfiguration.CodeStyle."); static const QLatin1String kCodeStyleCount("EditorConfiguration.CodeStyle.Count"); using namespace TextEditor; +using namespace Utils; namespace ProjectExplorer { @@ -194,7 +195,7 @@ QVariantMap EditorConfiguration::toMap() const return map; } -void EditorConfiguration::fromMap(const QVariantMap &map) +void EditorConfiguration::fromMap(const Storage &map) { const QByteArray &codecName = map.value(kCodec, d->m_textCodec->name()).toByteArray(); d->m_textCodec = QTextCodec::codecForName(codecName); diff --git a/src/plugins/projectexplorer/editorconfiguration.h b/src/plugins/projectexplorer/editorconfiguration.h index 031e5762876..cee0d8e5e94 100644 --- a/src/plugins/projectexplorer/editorconfiguration.h +++ b/src/plugins/projectexplorer/editorconfiguration.h @@ -6,9 +6,9 @@ #include "projectexplorer_export.h" #include <utils/id.h> +#include <utils/storage.h> #include <QObject> -#include <QVariantMap> #include <memory> @@ -64,8 +64,8 @@ public: void configureEditor(TextEditor::BaseTextEditor *textEditor) const; void deconfigureEditor(TextEditor::BaseTextEditor *textEditor) const; - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); void setTypingSettings(const TextEditor::TypingSettings &settings); void setStorageSettings(const TextEditor::StorageSettings &settings); diff --git a/src/plugins/projectexplorer/environmentaspect.cpp b/src/plugins/projectexplorer/environmentaspect.cpp index cae48b2f329..cc6a2d79b4d 100644 --- a/src/plugins/projectexplorer/environmentaspect.cpp +++ b/src/plugins/projectexplorer/environmentaspect.cpp @@ -133,14 +133,14 @@ void EnvironmentAspect::setSupportForBuildEnvironment(Target *target) this, &EnvironmentAspect::environmentChanged); } -void EnvironmentAspect::fromMap(const QVariantMap &map) +void EnvironmentAspect::fromMap(const Storage &map) { m_base = map.value(QLatin1String(BASE_KEY), -1).toInt(); m_userChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(CHANGES_KEY)).toStringList()); m_printOnRun = map.value(PRINT_ON_RUN_KEY).toBool(); } -void EnvironmentAspect::toMap(QVariantMap &data) const +void EnvironmentAspect::toMap(Storage &data) const { data.insert(QLatin1String(BASE_KEY), m_base); data.insert(QLatin1String(CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_userChanges)); diff --git a/src/plugins/projectexplorer/environmentaspect.h b/src/plugins/projectexplorer/environmentaspect.h index ee1bb7e1831..9fd8ccacbba 100644 --- a/src/plugins/projectexplorer/environmentaspect.h +++ b/src/plugins/projectexplorer/environmentaspect.h @@ -9,9 +9,7 @@ #include <utils/aspects.h> #include <utils/environment.h> - -#include <QList> -#include <QVariantMap> +#include <utils/storage.h> namespace ProjectExplorer { @@ -73,8 +71,8 @@ signals: void environmentChanged(); protected: - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; void setIsLocal(bool local) { m_isLocal = local; } void setAllowPrintOnRun(bool allow) { m_allowPrintOnRun = allow; } diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index ccbf9f8db88..eb1deadaae9 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -795,7 +795,7 @@ QStringList GccToolChain::platformLinkerFlags() const return m_platformLinkerFlags; } -void GccToolChain::toMap(QVariantMap &data) const +void GccToolChain::toMap(Storage &data) const { ToolChain::toMap(data); data.insert(compilerPlatformCodeGenFlagsKeyC, m_platformCodeGenFlags); @@ -804,7 +804,7 @@ void GccToolChain::toMap(QVariantMap &data) const data.insert(supportedAbisKeyC, Utils::transform<QStringList>(m_supportedAbis, &Abi::toString)); } -void GccToolChain::fromMap(const QVariantMap &data) +void GccToolChain::fromMap(const Storage &data) { ToolChain::fromMap(data); if (hasError()) @@ -1711,14 +1711,14 @@ std::unique_ptr<ToolChainConfigWidget> ClangToolChain::createConfigurationWidget return std::make_unique<ClangToolChainConfigWidget>(this); } -void ClangToolChain::toMap(QVariantMap &data) const +void ClangToolChain::toMap(Storage &data) const { GccToolChain::toMap(data); data.insert(parentToolChainIdKeyC, m_parentToolChainId); data.insert(priorityKeyC, m_priority); } -void ClangToolChain::fromMap(const QVariantMap &data) +void ClangToolChain::fromMap(const Storage &data) { GccToolChain::fromMap(data); if (hasError()) diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 3e92ea01c69..d46af2471f7 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -66,8 +66,8 @@ public: QStringList suggestedMkspecList() const override; QList<Utils::OutputLineParser *> createOutputParsers() const override; - void toMap(QVariantMap &data) const override; - void fromMap(const QVariantMap &data) override; + void toMap(Utils::Storage &data) const override; + void fromMap(const Utils::Storage &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; @@ -207,8 +207,8 @@ public: std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; - void toMap(QVariantMap &data) const override; - void fromMap(const QVariantMap &data) override; + void toMap(Utils::Storage &data) const override; + void fromMap(const Utils::Storage &data) override; void setPriority(int priority) { m_priority = priority; } int priority() const override { return m_priority; } diff --git a/src/plugins/projectexplorer/kit.h b/src/plugins/projectexplorer/kit.h index 18c0cc4298f..ea8f04ea1c4 100644 --- a/src/plugins/projectexplorer/kit.h +++ b/src/plugins/projectexplorer/kit.h @@ -8,8 +8,9 @@ #include <coreplugin/featureprovider.h> +#include <utils/storage.h> + #include <QSet> -#include <QVariant> #include <memory> @@ -138,7 +139,7 @@ private: void kitUpdated(); - QVariantMap toMap() const; + Utils::Storage toMap() const; const std::unique_ptr<Internal::KitPrivate> d; diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 2e692287ebd..2e3dee898b2 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -978,7 +978,7 @@ Abis MsvcToolChain::supportedAbis() const return abis; } -void MsvcToolChain::toMap(QVariantMap &data) const +void MsvcToolChain::toMap(Storage &data) const { ToolChain::toMap(data); data.insert(QLatin1String(varsBatKeyC), m_vcvarsBat); @@ -989,7 +989,7 @@ void MsvcToolChain::toMap(QVariantMap &data) const Utils::EnvironmentItem::toVariantList(m_environmentModifications)); } -void MsvcToolChain::fromMap(const QVariantMap &data) +void MsvcToolChain::fromMap(const Storage &data) { ToolChain::fromMap(data); if (hasError()) { @@ -1727,13 +1727,13 @@ static inline QString llvmDirKey() return QStringLiteral("ProjectExplorer.ClangClToolChain.LlvmDir"); } -void ClangClToolChain::toMap(QVariantMap &data) const +void ClangClToolChain::toMap(Storage &data) const { MsvcToolChain::toMap(data); data.insert(llvmDirKey(), m_clangPath.toString()); } -void ClangClToolChain::fromMap(const QVariantMap &data) +void ClangClToolChain::fromMap(const Storage &data) { MsvcToolChain::fromMap(data); if (hasError()) diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index 9f0b867466a..79ecdc21c30 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -46,8 +46,8 @@ public: QStringList suggestedMkspecList() const override; Abis supportedAbis() const override; - void toMap(QVariantMap &data) const override; - void fromMap(const QVariantMap &data) override; + void toMap(Utils::Storage &data) const override; + void fromMap(const Utils::Storage &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; bool hostPrefersToolchain() const override; @@ -146,8 +146,8 @@ public: void addToEnvironment(Utils::Environment &env) const override; Utils::FilePath compilerCommand() const override; // FIXME: Remove QList<Utils::OutputLineParser *> createOutputParsers() const override; - void toMap(QVariantMap &data) const override; - void fromMap(const QVariantMap &data) override; + void toMap(Utils::Storage &data) const override; + void fromMap(const Utils::Storage &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner( const Utils::Environment &env) const override; diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index fd91b4aaf55..af61ba60a49 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -691,7 +691,7 @@ FilePaths Project::files(const NodeMatcher &filter) const creating new build configurations. */ -void Project::toMap(QVariantMap &map) const +void Project::toMap(Storage &map) const { const QList<Target *> ts = targets(); @@ -764,7 +764,7 @@ ContainerNode *Project::containerNode() const return d->m_containerNode.get(); } -Project::RestoreResult Project::fromMap(const QVariantMap &map, QString *errorMessage) +Project::RestoreResult Project::fromMap(const Storage &map, QString *errorMessage) { Q_UNUSED(errorMessage) if (map.contains(QLatin1String(EDITOR_SETTINGS_KEY))) { diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 93c1611bb1e..61df7925ce4 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -12,6 +12,7 @@ #include <utils/environmentfwd.h> #include <utils/filepath.h> +#include <utils/storage.h> #include <QFileSystemModel> @@ -111,7 +112,7 @@ public: const NodeMatcher &extraMatcher = {}) const; Utils::FilePaths binariesForSourceFile(const Utils::FilePath &sourceFile) const; - virtual void toMap(QVariantMap &map) const; + virtual void toMap(Utils::Storage &map) const; Core::Context projectContext() const; Core::Context projectLanguages() const; @@ -204,7 +205,7 @@ signals: #endif protected: - virtual RestoreResult fromMap(const QVariantMap &map, QString *errorMessage); + virtual RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage); void createTargetFromMap(const QVariantMap &map, int index); virtual bool setupTarget(Target *t); diff --git a/src/plugins/projectexplorer/projectconfiguration.cpp b/src/plugins/projectexplorer/projectconfiguration.cpp index e793ec920c3..f7fe5fdba07 100644 --- a/src/plugins/projectexplorer/projectconfiguration.cpp +++ b/src/plugins/projectexplorer/projectconfiguration.cpp @@ -72,7 +72,7 @@ QString ProjectConfiguration::toolTip() const return m_toolTip; } -void ProjectConfiguration::toMap(QVariantMap &map) const +void ProjectConfiguration::toMap(Storage &map) const { QTC_CHECK(m_id.isValid()); map.insert(QLatin1String(CONFIGURATION_ID_KEY), m_id.toSetting()); @@ -85,7 +85,7 @@ Target *ProjectConfiguration::target() const return m_target; } -void ProjectConfiguration::fromMap(const QVariantMap &map) +void ProjectConfiguration::fromMap(const Storage &map) { Utils::Id id = Utils::Id::fromSetting(map.value(QLatin1String(CONFIGURATION_ID_KEY))); // Note: This is only "startsWith", not ==, as RunConfigurations currently still diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h index b0f722d8054..debad33196f 100644 --- a/src/plugins/projectexplorer/projectconfiguration.h +++ b/src/plugins/projectexplorer/projectconfiguration.h @@ -8,11 +8,9 @@ #include <utils/aspects.h> #include <utils/displayname.h> #include <utils/id.h> +#include <utils/storage.h> -#include <QObject> #include <QPointer> -#include <QString> -#include <QVariantMap> #include <QWidget> namespace ProjectExplorer { @@ -47,9 +45,9 @@ public: bool hasError() const { return m_hasError; } // Note: Make sure subclasses call the superclasses' fromMap() function! - virtual void fromMap(const QVariantMap &map) override; + virtual void fromMap(const Utils::Storage &map) override; // Note: Make sure subclasses call the superclasses' toMap() function! - virtual void toMap(QVariantMap &map) const override; + virtual void toMap(Utils::Storage &map) const override; Target *target() const; Project *project() const; @@ -70,6 +68,6 @@ private: }; // helper function: -PROJECTEXPLORER_EXPORT Utils::Id idFromMap(const QVariantMap &map); +PROJECTEXPLORER_EXPORT Utils::Id idFromMap(const Utils::Storage &map); } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 1fdb80a0b87..f75344cf38c 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -85,21 +85,21 @@ AspectContainer *GlobalOrProjectAspect::currentSettings() const return m_useGlobalSettings ? m_globalSettings : m_projectSettings; } -void GlobalOrProjectAspect::fromMap(const QVariantMap &map) +void GlobalOrProjectAspect::fromMap(const Storage &map) { if (m_projectSettings) m_projectSettings->fromMap(map); m_useGlobalSettings = map.value(id().toString() + ".UseGlobalSettings", true).toBool(); } -void GlobalOrProjectAspect::toMap(QVariantMap &map) const +void GlobalOrProjectAspect::toMap(Storage &map) const { if (m_projectSettings) m_projectSettings->toMap(map); map.insert(id().toString() + ".UseGlobalSettings", m_useGlobalSettings); } -void GlobalOrProjectAspect::toActiveMap(QVariantMap &data) const +void GlobalOrProjectAspect::toActiveMap(Storage &data) const { if (m_useGlobalSettings) m_globalSettings->toMap(data); @@ -113,7 +113,7 @@ void GlobalOrProjectAspect::toActiveMap(QVariantMap &data) const void GlobalOrProjectAspect::resetProjectToGlobalSettings() { QTC_ASSERT(m_globalSettings, return); - QVariantMap map; + Storage map; m_globalSettings->toMap(map); if (m_projectSettings) m_projectSettings->fromMap(map); @@ -226,7 +226,7 @@ bool RunConfiguration::isCustomized() const { if (m_customized) return true; - QVariantMap state; + Storage state; toMapSimple(state); // TODO: Why do we save this at all? It's a computed value. @@ -257,9 +257,9 @@ void RunConfiguration::addAspectFactory(const AspectFactory &aspectFactory) theAspectFactories.push_back(aspectFactory); } -QMap<Utils::Id, QVariantMap> RunConfiguration::settingsData() const +QMap<Id, Storage> RunConfiguration::settingsData() const { - QMap<Utils::Id, QVariantMap> data; + QMap<Id, Storage> data; for (BaseAspect *aspect : *this) aspect->toActiveMap(data[aspect->id()]); return data; @@ -288,13 +288,13 @@ Task RunConfiguration::createConfigurationIssue(const QString &description) cons return BuildSystemTask(Task::Error, description); } -void RunConfiguration::toMap(QVariantMap &map) const +void RunConfiguration::toMap(Storage &map) const { toMapSimple(map); map.insert(CUSTOMIZED_KEY, isCustomized()); } -void RunConfiguration::toMapSimple(QVariantMap &map) const +void RunConfiguration::toMapSimple(Storage &map) const { ProjectConfiguration::toMap(map); map.insert(BUILD_KEY, m_buildKey); @@ -355,7 +355,7 @@ ProjectNode *RunConfiguration::productNode() const }); } -void RunConfiguration::fromMap(const QVariantMap &map) +void RunConfiguration::fromMap(const Storage &map) { ProjectConfiguration::fromMap(map); if (hasError()) @@ -611,7 +611,7 @@ RunConfiguration *RunConfigurationCreationInfo::create(Target *target) const return rc; } -RunConfiguration *RunConfigurationFactory::restore(Target *parent, const QVariantMap &map) +RunConfiguration *RunConfigurationFactory::restore(Target *parent, const Storage &map) { for (RunConfigurationFactory *factory : std::as_const(g_runConfigurationFactories)) { if (factory->canHandle(parent)) { @@ -634,7 +634,7 @@ RunConfiguration *RunConfigurationFactory::restore(Target *parent, const QVarian RunConfiguration *RunConfigurationFactory::clone(Target *parent, RunConfiguration *source) { - QVariantMap map; + Storage map; source->toMap(map); return restore(parent, map); } diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 6caf5775b4d..520b26f000c 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -60,9 +60,9 @@ public: protected: friend class RunConfiguration; - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &data) const override; - void toActiveMap(QVariantMap &data) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &data) const override; + void toActiveMap(Utils::Storage &data) const override; private: bool m_useGlobalSettings = false; @@ -122,7 +122,7 @@ public: addAspectFactory([](Target *target) { return new T(target); }); } - QMap<Utils::Id, QVariantMap> settingsData() const; // FIXME: Merge into aspectData? + QMap<Utils::Id, Utils::Storage> settingsData() const; // FIXME: Merge into aspectData? Utils::AspectContainerData aspectData() const; void update(); @@ -145,9 +145,9 @@ protected: private: // Any additional data should be handled by aspects. - void fromMap(const QVariantMap &map) final; - void toMap(QVariantMap &map) const final; - void toMapSimple(QVariantMap &map) const; + void fromMap(const Utils::Storage &map) final; + void toMap(Utils::Storage &map) const final; + void toMapSimple(Utils::Storage &map) const; static void addAspectFactory(const AspectFactory &aspectFactory); @@ -160,7 +160,7 @@ private: RunnableModifier m_runnableModifier; Updater m_updater; Utils::MacroExpander m_expander; - QVariantMap m_pristineState; + Utils::Storage m_pristineState; bool m_customized = false; }; @@ -187,7 +187,7 @@ public: RunConfigurationFactory operator=(const RunConfigurationFactory &) = delete; virtual ~RunConfigurationFactory(); - static RunConfiguration *restore(Target *parent, const QVariantMap &map); + static RunConfiguration *restore(Target *parent, const Utils::Storage &map); static RunConfiguration *clone(Target *parent, RunConfiguration *source); static const QList<RunConfigurationCreationInfo> creatorsForTarget(Target *parent); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 158a102ad1b..36f6ebd2722 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -80,7 +80,7 @@ void TerminalAspect::addToLayout(LayoutItem &parent) /*! \reimp */ -void TerminalAspect::fromMap(const QVariantMap &map) +void TerminalAspect::fromMap(const Storage &map) { if (map.contains(settingsKey())) { m_useTerminal = map.value(settingsKey()).toBool(); @@ -96,7 +96,7 @@ void TerminalAspect::fromMap(const QVariantMap &map) /*! \reimp */ -void TerminalAspect::toMap(QVariantMap &data) const +void TerminalAspect::toMap(Storage &data) const { if (m_userSet) data.insert(settingsKey(), m_useTerminal); @@ -214,7 +214,7 @@ void WorkingDirectoryAspect::resetPath() /*! \reimp */ -void WorkingDirectoryAspect::fromMap(const QVariantMap &map) +void WorkingDirectoryAspect::fromMap(const Storage &map) { m_workingDirectory = FilePath::fromString(map.value(settingsKey()).toString()); m_defaultWorkingDirectory = FilePath::fromString(map.value(settingsKey() + ".default").toString()); @@ -229,7 +229,7 @@ void WorkingDirectoryAspect::fromMap(const QVariantMap &map) /*! \reimp */ -void WorkingDirectoryAspect::toMap(QVariantMap &data) const +void WorkingDirectoryAspect::toMap(Storage &data) const { const QString wd = m_workingDirectory == m_defaultWorkingDirectory ? QString() : m_workingDirectory.toString(); @@ -397,7 +397,7 @@ void ArgumentsAspect::resetArguments() /*! \reimp */ -void ArgumentsAspect::fromMap(const QVariantMap &map) +void ArgumentsAspect::fromMap(const Storage &map) { QVariant args = map.value(settingsKey()); // Until 3.7 a QStringList was stored for Remote Linux @@ -419,7 +419,7 @@ void ArgumentsAspect::fromMap(const QVariantMap &map) /*! \reimp */ -void ArgumentsAspect::toMap(QVariantMap &map) const +void ArgumentsAspect::toMap(Storage &map) const { saveToMap(map, m_arguments, QString(), settingsKey()); saveToMap(map, m_multiLine, false, settingsKey() + ".multi"); @@ -693,7 +693,7 @@ void ExecutableAspect::setSettingsKey(const QString &key) /*! \reimp */ -void ExecutableAspect::fromMap(const QVariantMap &map) +void ExecutableAspect::fromMap(const Storage &map) { m_executable.fromMap(map); if (m_alternativeExecutable) @@ -703,7 +703,7 @@ void ExecutableAspect::fromMap(const QVariantMap &map) /*! \reimp */ -void ExecutableAspect::toMap(QVariantMap &map) const +void ExecutableAspect::toMap(Storage &map) const { m_executable.toMap(map); if (m_alternativeExecutable) @@ -837,12 +837,12 @@ void InterpreterAspect::setCurrentInterpreter(const Interpreter &interpreter) } } -void InterpreterAspect::fromMap(const QVariantMap &map) +void InterpreterAspect::fromMap(const Storage &map) { setCurrentInterpreterId(map.value(settingsKey(), m_defaultId).toString()); } -void InterpreterAspect::toMap(QVariantMap &map) const +void InterpreterAspect::toMap(Storage &map) const { if (m_currentId != m_defaultId) saveToMap(map, m_currentId, QString(), settingsKey()); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index e9f88d8a011..9a3cb812da4 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -43,8 +43,8 @@ public: }; private: - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; void calculateUseTerminal(); @@ -73,8 +73,8 @@ public: void setEnvironment(EnvironmentAspect *envAspect); private: - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; void resetPath(); @@ -111,8 +111,8 @@ public: }; private: - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; QWidget *setupChooser(); @@ -183,8 +183,8 @@ public: }; protected: - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; private: QString executableText() const; @@ -238,8 +238,8 @@ public: void setCurrentInterpreter(const Interpreter &interpreter); void setSettingsDialogId(Utils::Id id) { m_settingsDialogId = id; } - void fromMap(const QVariantMap &) override; - void toMap(QVariantMap &) const override; + void fromMap(const Utils::Storage &) override; + void toMap(Utils::Storage &) const override; void addToLayout(Layouting::LayoutItem &parent) override; struct Data : Utils::BaseAspect::Data { Interpreter interpreter; }; diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index deea1ef32ef..df6bbbe24be 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -885,7 +885,7 @@ void Target::updateDeviceState() setOverlayIcon(overlay); } -bool Target::fromMap(const QVariantMap &map) +bool Target::fromMap(const Storage &map) { QTC_ASSERT(d->m_kit == KitManager::kit(id()), return false); diff --git a/src/plugins/projectexplorer/target.h b/src/plugins/projectexplorer/target.h index 6e4f06abd04..f43d21eba55 100644 --- a/src/plugins/projectexplorer/target.h +++ b/src/plugins/projectexplorer/target.h @@ -6,6 +6,7 @@ #include "projectexplorer_export.h" #include <utils/id.h> +#include <utils/storage.h> #include <QObject> @@ -87,7 +88,7 @@ public: void setOverlayIcon(const QIcon &icon); QString overlayIconToolTip(); - QVariantMap toMap() const; + Utils::Storage toMap() const; void updateDefaultBuildConfigurations(); void updateDefaultDeployConfigurations(); @@ -145,7 +146,7 @@ signals: void deploymentDataChanged(); private: - bool fromMap(const QVariantMap &map); + bool fromMap(const Utils::Storage &map); void updateDeviceState(); diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 1091b1a9a63..e055b21b2c8 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -241,7 +241,7 @@ ToolChain *ToolChain::clone() const Make sure to call this function when deriving. */ -void ToolChain::toMap(QVariantMap &result) const +void ToolChain::toMap(Storage &result) const { AspectContainer::toMap(result); @@ -350,7 +350,7 @@ void ToolChain::setTypeDisplayName(const QString &typeName) Make sure to call this function when deriving. */ -void ToolChain::fromMap(const QVariantMap &data) +void ToolChain::fromMap(const Storage &data) { AspectContainer::fromMap(data); @@ -711,7 +711,7 @@ QVariantMap BadToolchain::toMap() const {badToolchainTimestampKey(), timestamp.toMSecsSinceEpoch()}}; } -BadToolchain BadToolchain::fromMap(const QVariantMap &map) +BadToolchain BadToolchain::fromMap(const Storage &map) { return { FilePath::fromSettings(map.value(badToolchainFilePathKey())), diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 023f729fec1..21efe430fbd 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -147,7 +147,7 @@ public: // Used by the toolchainmanager to save user-generated tool chains. // Make sure to call this function when deriving! - virtual void toMap(QVariantMap &map) const; + virtual void toMap(Utils::Storage &map) const; virtual Tasks validateKit(const Kit *k) const; virtual bool isJobCountSupported() const { return true; } @@ -184,7 +184,7 @@ protected: void toolChainUpdated(); // Make sure to call this function when deriving! - virtual void fromMap(const QVariantMap &data); + virtual void fromMap(const Utils::Storage &data); void reportError(); bool hasError() const; @@ -214,8 +214,8 @@ public: BadToolchain(const Utils::FilePath &filePath, const Utils::FilePath &symlinkTarget, const QDateTime ×tamp); - QVariantMap toMap() const; - static BadToolchain fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + static BadToolchain fromMap(const Utils::Storage &map); Utils::FilePath filePath; Utils::FilePath symlinkTarget; diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index 52af2cc5db3..df0d7a4aa5d 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -320,13 +320,13 @@ public: return static_cast<const TTC *>(&other)->token == token; } - void fromMap(const QVariantMap &data) final + void fromMap(const Storage &data) final { ToolChain::fromMap(data); token = data.value(TestTokenKey).toByteArray(); } - void toMap(QVariantMap &data) const final + void toMap(Storage &data) const final { ToolChain::toMap(data); data[TestTokenKey] = token; diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp index 85110be4863..b0610b85806 100644 --- a/src/plugins/python/pythonproject.cpp +++ b/src/plugins/python/pythonproject.cpp @@ -419,7 +419,7 @@ QList<PythonBuildSystem::FileEntry> PythonBuildSystem::processEntries( return processed; } -Project::RestoreResult PythonProject::fromMap(const QVariantMap &map, QString *errorMessage) +Project::RestoreResult PythonProject::fromMap(const Storage &map, QString *errorMessage) { Project::RestoreResult res = Project::fromMap(map, errorMessage); if (res == RestoreResult::Ok) { diff --git a/src/plugins/python/pythonproject.h b/src/plugins/python/pythonproject.h index 676e010a015..b4203fa54ad 100644 --- a/src/plugins/python/pythonproject.h +++ b/src/plugins/python/pythonproject.h @@ -21,7 +21,7 @@ public: bool needsConfiguration() const final { return false; } private: - RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override; + RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage) override; }; } // Python::Internal diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index 1e389870429..c3df267e3b7 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -152,7 +152,7 @@ void QbsBuildConfiguration::triggerReparseIfActive() m_buildSystem->delayParsing(); } -void QbsBuildConfiguration::fromMap(const QVariantMap &map) +void QbsBuildConfiguration::fromMap(const Storage &map) { BuildConfiguration::fromMap(map); if (hasError()) diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h index 5984a555b9e..b58da50bb42 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h @@ -71,7 +71,7 @@ signals: void qbsConfigurationChanged(); private: - void fromMap(const QVariantMap &map) override; + void fromMap(const Utils::Storage &map) override; void restrictNextBuild(const ProjectExplorer::RunConfiguration *rc) override; void triggerReparseIfActive(); diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 8729e806045..cab1607503b 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -45,7 +45,6 @@ const char QBS_CLEAN_INSTALL_ROOT[] = "Qbs.CleanInstallRoot"; using namespace ProjectExplorer; using namespace QtSupport; -using namespace Tasking; using namespace Utils; namespace QbsProjectManager::Internal { @@ -352,7 +351,7 @@ int QbsBuildStep::maxJobs() const return QThread::idealThreadCount(); } -void QbsBuildStep::fromMap(const QVariantMap &map) +void QbsBuildStep::fromMap(const Storage &map) { BuildStep::fromMap(map); if (hasError()) @@ -360,7 +359,7 @@ void QbsBuildStep::fromMap(const QVariantMap &map) setQbsConfiguration(map.value(QBS_CONFIG).toMap()); } -void QbsBuildStep::toMap(QVariantMap &map) const +void QbsBuildStep::toMap(Storage &map) const { ProjectExplorer::BuildStep::toMap(map); map.insert(QBS_CONFIG, m_qbsConfiguration); @@ -381,8 +380,9 @@ QbsBuildSystem *QbsBuildStep::qbsBuildSystem() const return static_cast<QbsBuildSystem *>(buildSystem()); } -GroupItem QbsBuildStep::runRecipe() +Tasking::GroupItem QbsBuildStep::runRecipe() { + using namespace Tasking; const auto onPreParserSetup = [this](QbsRequest &request) { request.setParseData(qbsBuildSystem()); }; diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index 1e5186a326b..8a4a2b3b6df 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -70,8 +70,8 @@ private: void setupOutputFormatter(Utils::OutputFormatter *formatter) override; Tasking::GroupItem runRecipe() final; QWidget *createConfigWidget() override; - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; QbsBuildConfiguration *qbsBuildConfiguration() const; QbsBuildSystem *qbsBuildSystem() const; diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 36fcb2ea46b..9d85fb2f73d 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -187,13 +187,13 @@ QmakeBuildConfiguration::~QmakeBuildConfiguration() delete m_buildSystem; } -void QmakeBuildConfiguration::toMap(QVariantMap &map) const +void QmakeBuildConfiguration::toMap(Storage &map) const { BuildConfiguration::toMap(map); map.insert(QLatin1String(BUILD_CONFIGURATION_KEY), int(m_qmakeBuildConfiguration)); } -void QmakeBuildConfiguration::fromMap(const QVariantMap &map) +void QmakeBuildConfiguration::fromMap(const Storage &map) { BuildConfiguration::fromMap(map); if (hasError()) diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h index a1813e6cd7f..3dca5b9dad8 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h @@ -67,7 +67,7 @@ public: QString *arguments, const Utils::FilePath &directory, const QtSupport::QtVersion *version, QStringList *outArgs = nullptr); - void toMap(QVariantMap &map) const override; + void toMap(Utils::Storage &map) const override; BuildType buildType() const override; @@ -99,7 +99,7 @@ signals: void useQtQuickCompilerChanged(); protected: - void fromMap(const QVariantMap &map) override; + void fromMap(const Utils::Storage &map) override; bool regenerateBuildFiles(ProjectExplorer::Node *node = nullptr) override; private: diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 119cb3669e9..e83dd5a0b7d 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -171,7 +171,7 @@ QmakeProject::~QmakeProject() setRootProjectNode(nullptr); } -Project::RestoreResult QmakeProject::fromMap(const QVariantMap &map, QString *errorMessage) +Project::RestoreResult QmakeProject::fromMap(const Storage &map, QString *errorMessage) { RestoreResult result = Project::fromMap(map, errorMessage); if (result != RestoreResult::Ok) diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.h b/src/plugins/qmakeprojectmanager/qmakeproject.h index 3097ae7b579..5d65de04c2f 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.h +++ b/src/plugins/qmakeprojectmanager/qmakeproject.h @@ -45,7 +45,7 @@ public: ProjectExplorer::ProjectImporter *projectImporter() const final; protected: - RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) final; + RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage) final; private: ProjectExplorer::DeploymentKnowledge deploymentKnowledge() const override; diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 893fd5192cb..39c5e0bc63e 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -403,14 +403,14 @@ QString QMakeStep::mkspec() const return QmakeKitAspect::effectiveMkspec(target()->kit()); } -void QMakeStep::toMap(QVariantMap &map) const +void QMakeStep::toMap(Storage &map) const { AbstractProcessStep::toMap(map); map.insert(QMAKE_FORCED_KEY, m_forced); map.insert(QMAKE_SELECTED_ABIS_KEY, m_selectedAbis); } -void QMakeStep::fromMap(const QVariantMap &map) +void QMakeStep::fromMap(const Storage &map) { m_forced = map.value(QMAKE_FORCED_KEY, false).toBool(); m_selectedAbis = map.value(QMAKE_SELECTED_ABIS_KEY).toStringList(); diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index b3177d1f7ae..673838ad7f5 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -124,14 +124,14 @@ public: QString makeArguments(const QString &makefile) const; QString effectiveQMakeCall() const; - void toMap(QVariantMap &map) const override; + void toMap(Utils::Storage &map) const override; Utils::SelectionAspect buildType{this}; ProjectExplorer::ArgumentsAspect userArguments{this}; Utils::StringAspect effectiveCall{this}; protected: - void fromMap(const QVariantMap &map) override; + void fromMap(const Utils::Storage &map) override; private: Tasking::GroupItem runRecipe() final; diff --git a/src/plugins/qmljstools/qmljscodestylepreferences.cpp b/src/plugins/qmljstools/qmljscodestylepreferences.cpp index b482c18fff9..8556bc649c1 100644 --- a/src/plugins/qmljstools/qmljscodestylepreferences.cpp +++ b/src/plugins/qmljstools/qmljscodestylepreferences.cpp @@ -3,6 +3,8 @@ #include "qmljscodestylepreferences.h" +using namespace Utils; + namespace QmlJSTools { QmlJSCodeStylePreferences::QmlJSCodeStylePreferences(QObject *parent) : @@ -78,7 +80,7 @@ QVariantMap QmlJSCodeStylePreferences::toMap() const return map; } -void QmlJSCodeStylePreferences::fromMap(const QVariantMap &map) +void QmlJSCodeStylePreferences::fromMap(const Storage &map) { ICodeStylePreferences::fromMap(map); if (!currentDelegate()) diff --git a/src/plugins/qmljstools/qmljscodestylepreferences.h b/src/plugins/qmljstools/qmljscodestylepreferences.h index da52de879d9..db0acc0d738 100644 --- a/src/plugins/qmljstools/qmljscodestylepreferences.h +++ b/src/plugins/qmljstools/qmljscodestylepreferences.h @@ -25,8 +25,8 @@ public: // tracks parent hierarchy until currentParentSettings is null QmlJSCodeStyleSettings currentCodeStyleSettings() const; - QVariantMap toMap() const override; - void fromMap(const QVariantMap &map) override; + Utils::Storage toMap() const override; + void fromMap(const Utils::Storage &map) override; public slots: void setCodeStyleSettings(const QmlJSCodeStyleSettings &data); diff --git a/src/plugins/qmljstools/qmljscodestylesettings.cpp b/src/plugins/qmljstools/qmljscodestylesettings.cpp index 90af4bec52c..7e69a1ee1ac 100644 --- a/src/plugins/qmljstools/qmljscodestylesettings.cpp +++ b/src/plugins/qmljstools/qmljscodestylesettings.cpp @@ -19,9 +19,11 @@ static const char lineLengthKey[] = "LineLength"; +using namespace Utils; + namespace QmlJSTools { -// ------------------ QmlJSCodeStyleSettingsWidget +// QmlJSCodeStyleSettings QmlJSCodeStyleSettings::QmlJSCodeStyleSettings() = default; @@ -32,7 +34,7 @@ QVariantMap QmlJSCodeStyleSettings::toMap() const }; } -void QmlJSCodeStyleSettings::fromMap(const QVariantMap &map) +void QmlJSCodeStyleSettings::fromMap(const Storage &map) { lineLength = map.value(lineLengthKey, lineLength).toInt(); } diff --git a/src/plugins/qmljstools/qmljscodestylesettings.h b/src/plugins/qmljstools/qmljscodestylesettings.h index 3b79fe092d0..54cc60c5215 100644 --- a/src/plugins/qmljstools/qmljscodestylesettings.h +++ b/src/plugins/qmljstools/qmljscodestylesettings.h @@ -5,7 +5,7 @@ #include "qmljstools_global.h" -#include <QVariantMap> +#include <utils/storage.h> #include <optional> @@ -20,8 +20,8 @@ public: int lineLength = 80; - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); bool equals(const QmlJSCodeStyleSettings &rhs) const; bool operator==(const QmlJSCodeStyleSettings &s) const { return equals(s); } diff --git a/src/plugins/qmlprojectmanager/qmlmainfileaspect.cpp b/src/plugins/qmlprojectmanager/qmlmainfileaspect.cpp index ea3edc3542c..6a2cc0e360e 100644 --- a/src/plugins/qmlprojectmanager/qmlmainfileaspect.cpp +++ b/src/plugins/qmlprojectmanager/qmlmainfileaspect.cpp @@ -70,12 +70,12 @@ void QmlMainFileAspect::addToLayout(Layouting::LayoutItem &parent) parent.addItems({Tr::tr("Main QML file:"), m_fileListCombo.data()}); } -void QmlMainFileAspect::toMap(QVariantMap &map) const +void QmlMainFileAspect::toMap(Storage &map) const { map.insert(Constants::QML_MAINSCRIPT_KEY, m_scriptFile); } -void QmlMainFileAspect::fromMap(const QVariantMap &map) +void QmlMainFileAspect::fromMap(const Storage &map) { m_scriptFile = map.value(Constants::QML_MAINSCRIPT_KEY, M_CURRENT_FILE).toString(); diff --git a/src/plugins/qmlprojectmanager/qmlmainfileaspect.h b/src/plugins/qmlprojectmanager/qmlmainfileaspect.h index bdf9f1d6a38..f71d186e9f7 100644 --- a/src/plugins/qmlprojectmanager/qmlmainfileaspect.h +++ b/src/plugins/qmlprojectmanager/qmlmainfileaspect.h @@ -43,8 +43,8 @@ public: }; void addToLayout(Layouting::LayoutItem &parent) final; - void toMap(QVariantMap &map) const final; - void fromMap(const QVariantMap &map) final; + void toMap(Utils::Storage &map) const final; + void fromMap(const Utils::Storage &map) final; void updateFileComboBox(); MainScriptSource mainScriptSource() const; diff --git a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp index 39c8213e849..cc522c0ae10 100644 --- a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp +++ b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp @@ -105,14 +105,14 @@ Utils::FilePath QmlMultiLanguageAspect::databaseFilePath() const return m_databaseFilePath; } -void QmlMultiLanguageAspect::toMap(QVariantMap &map) const +void QmlMultiLanguageAspect::toMap(Storage &map) const { BoolAspect::toMap(map); if (!m_currentLocale.isEmpty()) map.insert(Constants::LAST_USED_LANGUAGE, m_currentLocale); } -void QmlMultiLanguageAspect::fromMap(const QVariantMap &map) +void QmlMultiLanguageAspect::fromMap(const Storage &map) { BoolAspect::fromMap(map); setCurrentLocale(map.value(Constants::LAST_USED_LANGUAGE, "en").toString()); diff --git a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.h b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.h index b7188ce13f0..46f86273eaa 100644 --- a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.h +++ b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.h @@ -23,8 +23,8 @@ public: QString currentLocale() const; void setCurrentLocale(const QString &locale); Utils::FilePath databaseFilePath() const; - void toMap(QVariantMap &map) const final; - void fromMap(const QVariantMap &map) final; + void toMap(Utils::Storage &map) const final; + void fromMap(const Utils::Storage &map) final; static QmlMultiLanguageAspect *current(); static QmlMultiLanguageAspect *current(ProjectExplorer::Project *project); diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index cbc2c9ebd16..24a7120a7bb 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -40,8 +40,10 @@ using namespace Core; using namespace ProjectExplorer; +using namespace Utils; namespace QmlProjectManager { + QmlProject::QmlProject(const Utils::FilePath &fileName) : Project(QString::fromLatin1(Constants::QMLPROJECT_MIMETYPE), fileName) { @@ -87,7 +89,7 @@ void QmlProject::parsingFinished(const Target *target, bool success) openFile(fileToOpen); } -Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *errorMessage) +Project::RestoreResult QmlProject::fromMap(const Storage &map, QString *errorMessage) { RestoreResult result = Project::fromMap(map, errorMessage); if (result != RestoreResult::Ok) diff --git a/src/plugins/qmlprojectmanager/qmlproject.h b/src/plugins/qmlprojectmanager/qmlproject.h index 3a6d5badf79..04629bfe757 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.h +++ b/src/plugins/qmlprojectmanager/qmlproject.h @@ -24,7 +24,7 @@ public: ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final; protected: - RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override; + RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage) override; private: ProjectExplorer::DeploymentKnowledge deploymentKnowledge() const override; diff --git a/src/plugins/qnx/qnxqtversion.cpp b/src/plugins/qnx/qnxqtversion.cpp index 8de173e9f37..067245e2368 100644 --- a/src/plugins/qnx/qnxqtversion.cpp +++ b/src/plugins/qnx/qnxqtversion.cpp @@ -116,7 +116,7 @@ QVariantMap QnxQtVersion::toMap() const return result; } -void QnxQtVersion::fromMap(const QVariantMap &map, const Utils::FilePath &) +void QnxQtVersion::fromMap(const Storage &map, const Utils::FilePath &) { QtVersion::fromMap(map); setSdpPath(FilePath::fromSettings(map.value(SDP_PATH_KEY))); diff --git a/src/plugins/qnx/qnxqtversion.h b/src/plugins/qnx/qnxqtversion.h index bcea9b3be3e..04e9d3280d1 100644 --- a/src/plugins/qnx/qnxqtversion.h +++ b/src/plugins/qnx/qnxqtversion.h @@ -27,8 +27,8 @@ public: QString cpuDir() const; - QVariantMap toMap() const override; - void fromMap(const QVariantMap &map, const Utils::FilePath &filePath) override; + Utils::Storage toMap() const override; + void fromMap(const Utils::Storage &map, const Utils::FilePath &filePath) override; ProjectExplorer::Abis detectQtAbis() const override; diff --git a/src/plugins/qnx/qnxsettingspage.cpp b/src/plugins/qnx/qnxsettingspage.cpp index a337bb3c51b..7d6af6cce4f 100644 --- a/src/plugins/qnx/qnxsettingspage.cpp +++ b/src/plugins/qnx/qnxsettingspage.cpp @@ -74,7 +74,7 @@ public: QnxConfiguration() = default; explicit QnxConfiguration(const FilePath &envFile) { m_envFile = envFile; } - void fromMap(const QVariantMap &data) + void fromMap(const Storage &data) { QString envFilePath = data.value(QNXEnvFileKey).toString(); if (envFilePath.isEmpty()) diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 85e0e6af591..5f0929468e4 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -640,7 +640,7 @@ bool QtVersion::hasReleaseBuild() const return !d->m_defaultConfigIsDebug || d->m_defaultConfigIsDebugAndRelease; } -void QtVersion::fromMap(const QVariantMap &map, const FilePath &filePath) +void QtVersion::fromMap(const Storage &map, const FilePath &filePath) { d->m_id = map.value(Constants::QTVERSIONID).toInt(); if (d->m_id == -1) // this happens on adding from installer, see updateFromInstaller => get a new unique id diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index b590d15c28a..52e7822f59e 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -5,15 +5,15 @@ #include "qtsupport_global.h" -#include <utils/fileutils.h> +#include <utils/filepath.h> #include <utils/macroexpander.h> +#include <utils/storage.h> #include <projectexplorer/abi.h> #include <projectexplorer/task.h> #include <QSet> #include <QStringList> -#include <QVariantMap> #include <QVersionNumber> QT_BEGIN_NAMESPACE @@ -49,7 +49,7 @@ public: virtual ~QtVersion(); - virtual void fromMap(const QVariantMap &map, const Utils::FilePath &filePath = {}); + virtual void fromMap(const Utils::Storage &map, const Utils::FilePath &filePath = {}); virtual bool equals(QtVersion *other); bool isAutodetected() const; @@ -64,7 +64,7 @@ public: QString type() const; - virtual QVariantMap toMap() const; + virtual Utils::Storage toMap() const; virtual bool isValid() const; static Predicate isValidPredicate(const Predicate &predicate = {}); virtual QString invalidReason() const; diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index 6628d97615e..a3553eb6423 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -81,7 +81,7 @@ void AbstractRemoteLinuxDeployStep::setInternalInitializer( d->internalInit = init; } -void AbstractRemoteLinuxDeployStep::fromMap(const QVariantMap &map) +void AbstractRemoteLinuxDeployStep::fromMap(const Utils::Storage &map) { BuildStep::fromMap(map); if (hasError()) @@ -89,7 +89,7 @@ void AbstractRemoteLinuxDeployStep::fromMap(const QVariantMap &map) d->deployTimes.importDeployTimes(map); } -void AbstractRemoteLinuxDeployStep::toMap(QVariantMap &map) const +void AbstractRemoteLinuxDeployStep::toMap(Utils::Storage &map) const { BuildStep::toMap(map); map.insert(d->deployTimes.exportDeployTimes()); diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h index 78cfd532041..982c9f596dd 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h @@ -26,8 +26,8 @@ protected: void handleStdOutData(const QString &data); void handleStdErrData(const QString &data); - void fromMap(const QVariantMap &map) final; - void toMap(QVariantMap &map) const final; + void fromMap(const Utils::Storage &map) final; + void toMap(Utils::Storage &map) const final; bool init() final; void setInternalInitializer(const std::function<Utils::expected_str<void>()> &init); diff --git a/src/plugins/remotelinux/genericdirectuploadstep.cpp b/src/plugins/remotelinux/genericdirectuploadstep.cpp index 8c506772070..1bf020ecb23 100644 --- a/src/plugins/remotelinux/genericdirectuploadstep.cpp +++ b/src/plugins/remotelinux/genericdirectuploadstep.cpp @@ -289,7 +289,7 @@ GroupItem GenericDirectUploadStep::deployRecipe() const TreeStorage<UploadStorage> storage; const Group root { - Storage(storage), + Tasking::Storage(storage), statTree(storage, preFilesToStat, preStatEndHandler), uploadTask(storage), Group { diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp index b001fb8654f..9eb44b8f00c 100644 --- a/src/plugins/remotelinux/linuxdevicetester.cpp +++ b/src/plugins/remotelinux/linuxdevicetester.cpp @@ -221,7 +221,7 @@ GroupItem GenericLinuxDeviceTesterPrivate::transferTasks() const TreeStorage<TransferStorage> storage; return Group { continueOnDone, - Storage(storage), + Tasking::Storage(storage), transferTask(FileTransferMethod::GenericCopy, storage), transferTask(FileTransferMethod::Sftp, storage), transferTask(FileTransferMethod::Rsync, storage), diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 7556ad9947e..f13aecd7ab7 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -38,7 +38,7 @@ public: MakeInstallStep(BuildStepList *parent, Id id); private: - void fromMap(const QVariantMap &map) override; + void fromMap(const Storage &map) override; QWidget *createConfigWidget() override; bool init() override; Tasking::GroupItem runRecipe() final; @@ -257,7 +257,7 @@ void MakeInstallStep::updateFromCustomCommandLineAspect() setUserArguments(ProcessArgs::joinArgs(tokens.mid(1))); } -void MakeInstallStep::fromMap(const QVariantMap &map) +void MakeInstallStep::fromMap(const Storage &map) { MakeStep::fromMap(map); if (hasError()) diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp index d94857c4d66..e16b07ee06e 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp @@ -99,7 +99,7 @@ QString RemoteLinuxEnvironmentAspect::userEnvironmentChangesAsString() const return env.mid(0, env.size() - 1); } -void RemoteLinuxEnvironmentAspect::fromMap(const QVariantMap &map) +void RemoteLinuxEnvironmentAspect::fromMap(const Storage &map) { ProjectExplorer::EnvironmentAspect::fromMap(map); @@ -117,7 +117,7 @@ void RemoteLinuxEnvironmentAspect::fromMap(const QVariantMap &map) } } -void RemoteLinuxEnvironmentAspect::toMap(QVariantMap &map) const +void RemoteLinuxEnvironmentAspect::toMap(Storage &map) const { ProjectExplorer::EnvironmentAspect::toMap(map); map.insert(QLatin1String(VERSION_KEY), ENVIRONMENTASPECT_VERSION); diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h index 9041f68c5c6..be47bb489ce 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h @@ -21,8 +21,8 @@ public: QString userEnvironmentChangesAsString() const; protected: - void fromMap(const QVariantMap &map) override; - void toMap(QVariantMap &map) const override; + void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Storage &map) const override; private: Utils::Environment m_remoteEnvironment; diff --git a/src/plugins/remotelinux/tarpackagecreationstep.cpp b/src/plugins/remotelinux/tarpackagecreationstep.cpp index 4a3720d8c85..5fd83665c70 100644 --- a/src/plugins/remotelinux/tarpackagecreationstep.cpp +++ b/src/plugins/remotelinux/tarpackagecreationstep.cpp @@ -25,7 +25,6 @@ #include <cstring> using namespace ProjectExplorer; -using namespace Tasking; using namespace Utils; namespace RemoteLinux::Internal { @@ -61,9 +60,9 @@ public: private: bool init() final; - GroupItem runRecipe() final; - void fromMap(const QVariantMap &map) final; - void toMap(QVariantMap &map) const final; + Tasking::GroupItem runRecipe() final; + void fromMap(const Storage &map) final; + void toMap(Storage &map) const final; QVariant data(Id id) const final; void raiseError(const QString &errorMessage); @@ -129,8 +128,9 @@ bool TarPackageCreationStep::init() return true; } -GroupItem TarPackageCreationStep::runRecipe() +Tasking::GroupItem TarPackageCreationStep::runRecipe() { + using namespace Tasking; const auto onSetup = [this](Async<void> &async) { const QList<DeployableFile> &files = target()->deploymentData().allFiles(); if (m_incrementalDeployment()) { @@ -166,7 +166,7 @@ GroupItem TarPackageCreationStep::runRecipe() return AsyncTask<void>(onSetup, onDone, onError); } -void TarPackageCreationStep::fromMap(const QVariantMap &map) +void TarPackageCreationStep::fromMap(const Storage &map) { BuildStep::fromMap(map); if (hasError()) @@ -174,7 +174,7 @@ void TarPackageCreationStep::fromMap(const QVariantMap &map) m_deployTimes.importDeployTimes(map); } -void TarPackageCreationStep::toMap(QVariantMap &map) const +void TarPackageCreationStep::toMap(Storage &map) const { BuildStep::toMap(map); map.insert(m_deployTimes.exportDeployTimes()); diff --git a/src/plugins/subversion/subversionclient.cpp b/src/plugins/subversion/subversionclient.cpp index 27f1d7ca43b..98f0cfdde90 100644 --- a/src/plugins/subversion/subversionclient.cpp +++ b/src/plugins/subversion/subversionclient.cpp @@ -201,7 +201,7 @@ SubversionDiffEditorController::SubversionDiffEditorController(IDocument *docume }; const Group root { - Storage(diffInputStorage), + Tasking::Storage(diffInputStorage), parallel, Group { finishAllAndDone, diff --git a/src/plugins/texteditor/behaviorsettings.cpp b/src/plugins/texteditor/behaviorsettings.cpp index 635ddea0a23..83e0695383b 100644 --- a/src/plugins/texteditor/behaviorsettings.cpp +++ b/src/plugins/texteditor/behaviorsettings.cpp @@ -18,6 +18,8 @@ static const char keyboardTooltips[] = "KeyboardTooltips"; static const char groupPostfix[] = "BehaviorSettings"; static const char smartSelectionChanging[] = "SmartSelectionChanging"; +using namespace Utils; + namespace TextEditor { BehaviorSettings::BehaviorSettings() : @@ -55,7 +57,7 @@ QVariantMap BehaviorSettings::toMap() const }; } -void BehaviorSettings::fromMap(const QVariantMap &map) +void BehaviorSettings::fromMap(const Storage &map) { m_mouseHiding = map.value(mouseHidingKey, m_mouseHiding).toBool(); m_mouseNavigation = map.value(mouseNavigationKey, m_mouseNavigation).toBool(); diff --git a/src/plugins/texteditor/behaviorsettings.h b/src/plugins/texteditor/behaviorsettings.h index ec4746c6115..06a7830dc4b 100644 --- a/src/plugins/texteditor/behaviorsettings.h +++ b/src/plugins/texteditor/behaviorsettings.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include <QVariantMap> +#include <utils/storage.h> namespace TextEditor { @@ -21,8 +21,8 @@ public: void toSettings(const QString &category) const; void fromSettings(const QString &category); - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); bool equals(const BehaviorSettings &bs) const; diff --git a/src/plugins/texteditor/extraencodingsettings.cpp b/src/plugins/texteditor/extraencodingsettings.cpp index 638f749d7e0..216dcae524e 100644 --- a/src/plugins/texteditor/extraencodingsettings.cpp +++ b/src/plugins/texteditor/extraencodingsettings.cpp @@ -14,6 +14,8 @@ static const char kGroupPostfix[] = "EditorManager"; static const char kUtf8BomBehaviorKey[] = "Utf8BomBehavior"; +using namespace Utils; + namespace TextEditor { ExtraEncodingSettings::ExtraEncodingSettings() : m_utf8BomSetting(OnlyKeep) @@ -43,7 +45,7 @@ QVariantMap ExtraEncodingSettings::toMap() const }; } -void ExtraEncodingSettings::fromMap(const QVariantMap &map) +void ExtraEncodingSettings::fromMap(const Storage &map) { m_utf8BomSetting = (Utf8BomSetting)map.value(kUtf8BomBehaviorKey, m_utf8BomSetting).toInt(); } diff --git a/src/plugins/texteditor/extraencodingsettings.h b/src/plugins/texteditor/extraencodingsettings.h index 8f905e7a942..b9109d1b64c 100644 --- a/src/plugins/texteditor/extraencodingsettings.h +++ b/src/plugins/texteditor/extraencodingsettings.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include <QVariantMap> +#include <utils/storage.h> namespace TextEditor { @@ -18,8 +18,8 @@ public: void toSettings(const QString &category) const; void fromSettings(const QString &category); - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); bool equals(const ExtraEncodingSettings &s) const; diff --git a/src/plugins/texteditor/icodestylepreferences.cpp b/src/plugins/texteditor/icodestylepreferences.cpp index 1d92095d5a3..b3aa668ccae 100644 --- a/src/plugins/texteditor/icodestylepreferences.cpp +++ b/src/plugins/texteditor/icodestylepreferences.cpp @@ -9,7 +9,7 @@ #include <utils/settingsutils.h> -using namespace TextEditor; +using namespace Utils; static const char currentPreferencesKey[] = "CurrentPreferences"; @@ -222,14 +222,14 @@ void ICodeStylePreferences::fromSettings(const QString &category) Utils::fromSettings(d->m_settingsSuffix, category, Core::ICore::settings(), this); } -QVariantMap ICodeStylePreferences::toMap() const +Storage ICodeStylePreferences::toMap() const { if (!currentDelegate()) return d->m_tabSettings.toMap(); return {{currentPreferencesKey, currentDelegateId()}}; } -void ICodeStylePreferences::fromMap(const QVariantMap &map) +void ICodeStylePreferences::fromMap(const Storage &map) { d->m_tabSettings.fromMap(map); const QByteArray delegateId = map.value(currentPreferencesKey).toByteArray(); diff --git a/src/plugins/texteditor/icodestylepreferences.h b/src/plugins/texteditor/icodestylepreferences.h index 329e7eb4e5d..772c712e31d 100644 --- a/src/plugins/texteditor/icodestylepreferences.h +++ b/src/plugins/texteditor/icodestylepreferences.h @@ -5,6 +5,8 @@ #include "texteditor_global.h" +#include <utils/storage.h> + #include <QObject> QT_BEGIN_NAMESPACE @@ -67,8 +69,8 @@ public: void fromSettings(const QString &category); // make below 2 protected? - virtual QVariantMap toMap() const; - virtual void fromMap(const QVariantMap &map); + virtual Utils::Storage toMap() const; + virtual void fromMap(const Utils::Storage &map); signals: void tabSettingsChanged(const TextEditor::TabSettings &settings); diff --git a/src/plugins/texteditor/marginsettings.cpp b/src/plugins/texteditor/marginsettings.cpp index 8e58e012b8d..3f832b04e39 100644 --- a/src/plugins/texteditor/marginsettings.cpp +++ b/src/plugins/texteditor/marginsettings.cpp @@ -4,8 +4,6 @@ #include "marginsettings.h" #include <QSettings> -#include <QString> -#include <QVariantMap> static const char showWrapColumnKey[] = "ShowMargin"; static const char wrapColumnKey[] = "MarginColumn"; @@ -13,7 +11,9 @@ static const char groupPostfix[] = "textMarginSettings"; static const char useIndenterColumnKey[] = "UseIndenter"; static const char tintMarginAreaColumnKey[] = "tintMarginArea"; -using namespace TextEditor; +using namespace Utils; + +namespace TextEditor { MarginSettings::MarginSettings() : m_showMargin(false) @@ -45,7 +45,7 @@ void MarginSettings::fromSettings(QSettings *s) s->endGroup(); } -QVariantMap MarginSettings::toMap() const +Storage MarginSettings::toMap() const { return { {tintMarginAreaColumnKey, m_tintMarginArea}, @@ -55,7 +55,7 @@ QVariantMap MarginSettings::toMap() const }; } -void MarginSettings::fromMap(const QVariantMap &map) +void MarginSettings::fromMap(const Storage &map) { m_showMargin = map.value(showWrapColumnKey, m_showMargin).toBool(); m_tintMarginArea = map.value(tintMarginAreaColumnKey, m_tintMarginArea).toBool(); @@ -71,3 +71,5 @@ bool MarginSettings::equals(const MarginSettings &other) const && m_marginColumn == other.m_marginColumn ; } + +} // TextEditor diff --git a/src/plugins/texteditor/marginsettings.h b/src/plugins/texteditor/marginsettings.h index e98093042fb..78fc822e687 100644 --- a/src/plugins/texteditor/marginsettings.h +++ b/src/plugins/texteditor/marginsettings.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include <QVariantMap> +#include <utils/storage.h> QT_BEGIN_NAMESPACE class QSettings; @@ -21,8 +21,8 @@ public: void toSettings(QSettings *s) const; void fromSettings(QSettings *s); - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); bool equals(const MarginSettings &other) const; diff --git a/src/plugins/texteditor/storagesettings.cpp b/src/plugins/texteditor/storagesettings.cpp index adaf0be1030..34ecc8f67bd 100644 --- a/src/plugins/texteditor/storagesettings.cpp +++ b/src/plugins/texteditor/storagesettings.cpp @@ -11,6 +11,8 @@ #include <QRegularExpression> #include <QString> +using namespace Utils; + namespace TextEditor { static const char cleanWhitespaceKey[] = "cleanWhitespace"; @@ -43,7 +45,7 @@ void StorageSettings::fromSettings(const QString &category) Utils::fromSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); } -QVariantMap StorageSettings::toMap() const +Storage StorageSettings::toMap() const { return { {cleanWhitespaceKey, m_cleanWhitespace}, @@ -55,7 +57,7 @@ QVariantMap StorageSettings::toMap() const }; } -void StorageSettings::fromMap(const QVariantMap &map) +void StorageSettings::fromMap(const Storage &map) { m_cleanWhitespace = map.value(cleanWhitespaceKey, m_cleanWhitespace).toBool(); m_inEntireDocument = map.value(inEntireDocumentKey, m_inEntireDocument).toBool(); diff --git a/src/plugins/texteditor/storagesettings.h b/src/plugins/texteditor/storagesettings.h index 522c1039172..85a88a022f3 100644 --- a/src/plugins/texteditor/storagesettings.h +++ b/src/plugins/texteditor/storagesettings.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include <QVariantMap> +#include <utils/storage.h> namespace TextEditor { @@ -17,8 +17,8 @@ public: void toSettings(const QString &category) const; void fromSettings(const QString &category); - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); // calculated based on boolean setting plus file type blacklist examination bool removeTrailingWhitespace(const QString &filePattern) const; diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index 07660a55475..3fb2839adc2 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "tabsettings.h" -#include "texteditorplugin.h" #include <utils/settingsutils.h> @@ -19,6 +18,8 @@ static const char indentSizeKey[] = "IndentSize"; static const char groupPostfix[] = "TabSettings"; static const char paddingModeKey[] = "PaddingMode"; +using namespace Utils; + namespace TextEditor { TabSettings::TabSettings(TabSettings::TabPolicy tabPolicy, @@ -55,7 +56,7 @@ QVariantMap TabSettings::toMap() const }; } -void TabSettings::fromMap(const QVariantMap &map) +void TabSettings::fromMap(const Storage &map) { const bool spacesForTabs = map.value(spacesForTabsKey, true).toBool(); const bool autoSpacesForTabs = map.value(autoSpacesForTabsKey, false).toBool(); diff --git a/src/plugins/texteditor/tabsettings.h b/src/plugins/texteditor/tabsettings.h index e21ab9678b9..07512d6af37 100644 --- a/src/plugins/texteditor/tabsettings.h +++ b/src/plugins/texteditor/tabsettings.h @@ -5,6 +5,8 @@ #include "texteditor_global.h" +#include <utils/storage.h> + #include <QTextBlock> QT_BEGIN_NAMESPACE @@ -39,8 +41,8 @@ public: void toSettings(const QString &category, QSettings *s) const; void fromSettings(const QString &category, QSettings *s); - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); int lineIndentPosition(const QString &text) const; int columnAt(const QString &text, int position) const; diff --git a/src/plugins/texteditor/typingsettings.cpp b/src/plugins/texteditor/typingsettings.cpp index 83bbb800222..7956f7c291c 100644 --- a/src/plugins/texteditor/typingsettings.cpp +++ b/src/plugins/texteditor/typingsettings.cpp @@ -16,6 +16,7 @@ static const char smartBackspaceBehaviorKey[] = "SmartBackspaceBehavior"; static const char preferSingleLineCommentsKey[] = "PreferSingleLineComments"; static const char groupPostfix[] = "TypingSettings"; +using namespace Utils; namespace TextEditor { @@ -38,7 +39,7 @@ void TypingSettings::fromSettings(const QString &category) Utils::fromSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); } -QVariantMap TypingSettings::toMap() const +Storage TypingSettings::toMap() const { return { {autoIndentKey, m_autoIndent}, @@ -48,7 +49,7 @@ QVariantMap TypingSettings::toMap() const }; } -void TypingSettings::fromMap(const QVariantMap &map) +void TypingSettings::fromMap(const Storage &map) { m_autoIndent = map.value(autoIndentKey, m_autoIndent).toBool(); m_tabKeyBehavior = (TabKeyBehavior) map.value(tabKeyBehaviorKey, m_tabKeyBehavior).toInt(); diff --git a/src/plugins/texteditor/typingsettings.h b/src/plugins/texteditor/typingsettings.h index 03d3989b814..2ad06a23ab5 100644 --- a/src/plugins/texteditor/typingsettings.h +++ b/src/plugins/texteditor/typingsettings.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include <QVariantMap> +#include <utils/storage.h> QT_BEGIN_NAMESPACE class QTextDocument; @@ -38,8 +38,8 @@ public: void toSettings(const QString &category) const; void fromSettings(const QString &category); - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); + Utils::Storage toMap() const; + void fromMap(const Utils::Storage &map); bool equals(const TypingSettings &ts) const; diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 6c23677face..f02343ff158 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -146,12 +146,12 @@ void SuppressionAspect::addToLayout(Layouting::LayoutItem &parent) parent.addItem(Span { 2, group }); } -void SuppressionAspect::fromMap(const QVariantMap &map) +void SuppressionAspect::fromMap(const Storage &map) { BaseAspect::fromMap(map); // FIXME Looks wrong, as it skips the intermediate level } -void SuppressionAspect::toMap(QVariantMap &map) const +void SuppressionAspect::toMap(Storage &map) const { BaseAspect::toMap(map); } diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index b9de99db05b..b0c2c670153 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -22,8 +22,8 @@ public: void addToLayout(Layouting::LayoutItem &parent) final; - void fromMap(const QVariantMap &map) final; - void toMap(QVariantMap &map) const final; + void fromMap(const Utils::Storage &map) final; + void toMap(Utils::Storage &map) const final; void addSuppressionFile(const Utils::FilePath &suppressionFile); diff --git a/src/plugins/webassembly/webassemblyrunconfiguration.cpp b/src/plugins/webassembly/webassemblyrunconfiguration.cpp index a1bb735c3c3..02cbcd7d53d 100644 --- a/src/plugins/webassembly/webassemblyrunconfiguration.cpp +++ b/src/plugins/webassembly/webassemblyrunconfiguration.cpp @@ -144,13 +144,13 @@ public: parent.addItems({Tr::tr("Web browser:"), m_webBrowserComboBox}); } - void fromMap(const QVariantMap &map) override + void fromMap(const Storage &map) override { if (!m_availableBrowsers.isEmpty()) m_currentBrowser = map.value(BROWSER_KEY, m_availableBrowsers.first().first).toString(); } - void toMap(QVariantMap &map) const override + void toMap(Storage &map) const override { map.insert(BROWSER_KEY, m_currentBrowser); } From 753c00543d9c5c92cf685070364ecec67cf33e26 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 23 Aug 2023 14:10:58 +0200 Subject: [PATCH 0844/1777] Utils: Introduce a Storage class ... mapping Keys (currently QString) to Data (currently QVariant), i.e. effectively an oddly named QVariantMap. Plan is to 1. make QVariantMap using loading/saving related functions to use Storage instead of QVariant map, 2. replace QString by a UTF-8 container (QByteArray for starters) 3. add/remove parts of the map interface so that neither decoration of string literals in user code are needed, nor that unnecessary allocations happen. Long term Storage could cover some of the current JSON uses, with Storage's implementation possibly switching over to something based on JSON (or CBOR?) directly, to be closer what we typically send over the wire. Change-Id: Ic33b8e95fed5268d6298b5391ff42cbb582b56c4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/CMakeLists.txt | 1 + src/libs/utils/storage.cpp | 9 +++++++++ src/libs/utils/storage.h | 14 ++++++++++++++ src/libs/utils/utils.qbs | 2 ++ 4 files changed, 26 insertions(+) create mode 100644 src/libs/utils/storage.cpp create mode 100644 src/libs/utils/storage.h diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index d1ad5ee298b..0bce11fcb58 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -161,6 +161,7 @@ add_qtc_library(Utils sortfiltermodel.h span.h statuslabel.cpp statuslabel.h + storage.cpp storage.h stringtable.cpp stringtable.h stringutils.cpp stringutils.h styleanimator.cpp styleanimator.h diff --git a/src/libs/utils/storage.cpp b/src/libs/utils/storage.cpp new file mode 100644 index 00000000000..c443c48ba63 --- /dev/null +++ b/src/libs/utils/storage.cpp @@ -0,0 +1,9 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "storage.h" + + +namespace Utils { + +} // Utils diff --git a/src/libs/utils/storage.h b/src/libs/utils/storage.h new file mode 100644 index 00000000000..ddcdd233a94 --- /dev/null +++ b/src/libs/utils/storage.h @@ -0,0 +1,14 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <QVariantMap> + +namespace Utils { + +using Key = QString; +using Data = QVariant; +using Storage = QMap<Key, Data>; + +} // Utils diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 0dcda50bbae..d2f9c814bb5 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -293,6 +293,8 @@ Project { "../3rdparty/span/span.hpp", "statuslabel.cpp", "statuslabel.h", + "storage.cpp", + "storage.h", "stringtable.cpp", "stringtable.h", "stringutils.cpp", From 5aa503d3d390bf1cdb59e4107c3a16183c0f4b99 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 23 Aug 2023 17:01:56 +0200 Subject: [PATCH 0845/1777] Utils: Compile fix Change-Id: I7b3298313d16b778ba471330d4d019f7e6d92b92 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/displayname.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/utils/displayname.h b/src/libs/utils/displayname.h index 0998eafd6eb..71128fd10fb 100644 --- a/src/libs/utils/displayname.h +++ b/src/libs/utils/displayname.h @@ -3,6 +3,7 @@ #pragma once +#include "utils_global.h" #include "storage.h" namespace Utils { From 14d21f4f2cf0926ae9423450d646f5c21bdc3bdd Mon Sep 17 00:00:00 2001 From: Friedemann Kleint <Friedemann.Kleint@qt.io> Date: Wed, 23 Aug 2023 13:12:02 +0200 Subject: [PATCH 0846/1777] Designer plugin: Simplify connections Connect to members instead of using lambdas. Amends 93de403391b59acf90fbe7319a059382dfe458a6. Change-Id: I401f550ee3f2e3a12086b064f698ec2fc8b5aca6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/designer/formeditor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/designer/formeditor.cpp b/src/plugins/designer/formeditor.cpp index 93603e1a28e..436a8ca765f 100644 --- a/src/plugins/designer/formeditor.cpp +++ b/src/plugins/designer/formeditor.cpp @@ -519,7 +519,7 @@ void FormEditorData::setupActions() m_actionPrint = new QAction(this); bindShortcut(ActionManager::registerAction(m_actionPrint, Core::Constants::PRINT, m_contexts), m_actionPrint); - QObject::connect(m_actionPrint, &QAction::triggered, this, [this] { print(); }); + connect(m_actionPrint, &QAction::triggered, this, &FormEditorData::print); //'delete' action. Do not set a shortcut as Designer handles // the 'Delete' key by event filter. Setting a shortcut triggers @@ -771,7 +771,8 @@ IEditor *FormEditorData::createEditor() QDesignerFormWindowInterface *form = m_fwm->createFormWindow(nullptr); QTC_ASSERT(form, return nullptr); form->setPalette(Theme::initialPalette()); - QObject::connect(form, &QDesignerFormWindowInterface::toolChanged, this, [this](int i) { toolChanged(i); }); + connect(form, &QDesignerFormWindowInterface::toolChanged, + this, &FormEditorData::toolChanged); auto widgetHost = new SharedTools::WidgetHost( /* parent */ nullptr, form); FormWindowEditor *formWindowEditor = m_xmlEditorFactory->create(form); From 6e307be365d3a4fd79b44589bde58d75590b4064 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 23 Aug 2023 16:53:06 +0200 Subject: [PATCH 0847/1777] Utils: Rename the new Storage to Store Apparently that's what the young people on the web use for such a thing. Change-Id: I75d5396ff3cb3c26efd6008b5f2261354c4f7896 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/CMakeLists.txt | 2 +- src/libs/utils/aspects.cpp | 20 ++++++++-------- src/libs/utils/aspects.h | 20 ++++++++-------- src/libs/utils/displayname.cpp | 4 ++-- src/libs/utils/displayname.h | 7 +++--- src/libs/utils/{storage.cpp => store.cpp} | 2 +- src/libs/utils/{storage.h => store.h} | 2 +- src/libs/utils/utils.qbs | 4 ++-- src/plugins/android/androidbuildapkstep.cpp | 4 ++-- src/plugins/android/androidbuildapkstep.h | 4 ++-- src/plugins/android/androiddevice.cpp | 2 +- src/plugins/android/androiddevice.h | 2 +- .../android/androidrunconfiguration.cpp | 4 ++-- src/plugins/android/androidtoolchain.cpp | 2 +- src/plugins/android/androidtoolchain.h | 2 +- src/plugins/android/javalanguageserver.cpp | 2 +- src/plugins/android/javalanguageserver.h | 4 ++-- src/plugins/baremetal/baremetaldevice.cpp | 2 +- src/plugins/baremetal/baremetaldevice.h | 4 ++-- .../gdb/eblinkgdbserverprovider.cpp | 8 +++---- .../debugservers/gdb/gdbserverprovider.cpp | 4 ++-- .../debugservers/gdb/gdbserverprovider.h | 4 ++-- .../gdb/jlinkgdbserverprovider.cpp | 8 +++---- .../gdb/openocdgdbserverprovider.cpp | 8 +++---- .../gdb/stlinkutilgdbserverprovider.cpp | 8 +++---- .../uvsc/jlinkuvscserverprovider.cpp | 12 +++++----- .../uvsc/simulatoruvscserverprovider.cpp | 4 ++-- .../uvsc/simulatoruvscserverprovider.h | 4 ++-- .../uvsc/stlinkuvscserverprovider.cpp | 12 +++++----- .../debugservers/uvsc/uvscserverprovider.cpp | 4 ++-- .../debugservers/uvsc/uvscserverprovider.h | 4 ++-- .../uvsc/uvtargetdeviceselection.cpp | 2 +- .../uvsc/uvtargetdeviceselection.h | 6 ++--- .../uvsc/uvtargetdriverselection.cpp | 2 +- .../uvsc/uvtargetdriverselection.h | 6 ++--- .../baremetal/idebugserverprovider.cpp | 4 ++-- src/plugins/baremetal/idebugserverprovider.h | 6 ++--- src/plugins/boot2qt/qdbdevice.cpp | 2 +- src/plugins/boot2qt/qdbdevice.h | 4 ++-- src/plugins/clangtools/clangtoolssettings.cpp | 4 ++-- src/plugins/clangtools/clangtoolssettings.h | 4 ++-- .../cmakebuildconfiguration.cpp | 8 +++---- .../cmakebuildconfiguration.h | 8 +++---- .../cmakeprojectmanager/cmakebuildstep.cpp | 4 ++-- .../cmakeprojectmanager/cmakebuildstep.h | 4 ++-- src/plugins/cmakeprojectmanager/cmaketool.h | 4 ++-- .../cppeditor/cppcodemodelsettings.cpp | 2 +- src/plugins/cppeditor/cppcodemodelsettings.h | 6 ++--- .../cppeditor/cppcodestylepreferences.cpp | 2 +- .../cppeditor/cppcodestylepreferences.h | 4 ++-- .../cppeditor/cppcodestylesettings.cpp | 2 +- src/plugins/cppeditor/cppcodestylesettings.h | 6 ++--- src/plugins/debugger/commonoptionspage.h | 4 ++-- src/plugins/debugger/debuggeritem.h | 4 ++-- .../debuggerrunconfigurationaspect.cpp | 4 ++-- .../debugger/debuggerrunconfigurationaspect.h | 4 ++-- .../debuggersourcepathmappingwidget.cpp | 4 ++-- src/plugins/docker/dockerdevice.cpp | 2 +- src/plugins/docker/dockerdevice.h | 4 ++-- .../genericprojectmanager/genericproject.cpp | 2 +- .../genericprojectmanager/genericproject.h | 2 +- src/plugins/incredibuild/commandbuilder.cpp | 2 +- src/plugins/incredibuild/commandbuilder.h | 2 +- .../incredibuild/commandbuilderaspect.cpp | 4 ++-- .../incredibuild/commandbuilderaspect.h | 4 ++-- src/plugins/ios/iosbuildconfiguration.cpp | 4 ++-- src/plugins/ios/iosbuildstep.cpp | 8 +++---- src/plugins/ios/iosdevice.cpp | 2 +- src/plugins/ios/iosdevice.h | 4 ++-- src/plugins/ios/iosdsymbuildstep.cpp | 8 +++---- src/plugins/ios/iosrunconfiguration.cpp | 4 ++-- src/plugins/ios/iosrunconfiguration.h | 4 ++-- src/plugins/ios/iossimulator.cpp | 2 +- src/plugins/ios/iossimulator.h | 4 ++-- .../languageclient/languageclientsettings.cpp | 4 ++-- .../languageclient/languageclientsettings.h | 8 +++---- .../mesonbuildconfiguration.cpp | 4 ++-- .../mesonbuildconfiguration.h | 4 ++-- .../mesonprojectmanager/ninjabuildstep.cpp | 4 ++-- .../mesonprojectmanager/ninjabuildstep.h | 4 ++-- .../nim/project/nimblebuildconfiguration.cpp | 4 ++-- .../nim/project/nimblebuildconfiguration.h | 4 ++-- src/plugins/nim/project/nimbleproject.cpp | 4 ++-- src/plugins/nim/project/nimbleproject.h | 4 ++-- .../nim/project/nimcompilerbuildstep.cpp | 4 ++-- .../nim/project/nimcompilerbuildstep.h | 4 ++-- src/plugins/nim/project/nimproject.cpp | 8 +++---- src/plugins/nim/project/nimtoolchain.cpp | 2 +- src/plugins/nim/project/nimtoolchain.h | 2 +- src/plugins/projectexplorer/buildaspects.cpp | 4 ++-- src/plugins/projectexplorer/buildaspects.h | 4 ++-- .../projectexplorer/buildconfiguration.cpp | 4 ++-- .../projectexplorer/buildconfiguration.h | 6 ++--- src/plugins/projectexplorer/buildstep.cpp | 6 ++--- src/plugins/projectexplorer/buildstep.h | 6 ++--- src/plugins/projectexplorer/buildsteplist.cpp | 10 ++++---- src/plugins/projectexplorer/buildsteplist.h | 6 ++--- src/plugins/projectexplorer/customparser.cpp | 8 +++---- src/plugins/projectexplorer/customparser.h | 12 +++++----- .../projectexplorer/customtoolchain.cpp | 8 +++---- .../projectexplorer/deployconfiguration.cpp | 14 +++++------ .../projectexplorer/deployconfiguration.h | 8 +++---- .../devicesupport/desktopdevice.cpp | 2 +- .../devicesupport/desktopdevice.h | 2 +- .../devicesupport/devicemanager.cpp | 2 +- .../devicesupport/devicemanager.h | 4 ++-- .../projectexplorer/devicesupport/idevice.cpp | 10 ++++---- .../projectexplorer/devicesupport/idevice.h | 10 ++++---- .../devicesupport/idevicefactory.h | 4 ++-- .../projectexplorer/editorconfiguration.cpp | 2 +- .../projectexplorer/editorconfiguration.h | 6 ++--- .../projectexplorer/environmentaspect.cpp | 4 ++-- .../projectexplorer/environmentaspect.h | 6 ++--- src/plugins/projectexplorer/gcctoolchain.cpp | 8 +++---- src/plugins/projectexplorer/gcctoolchain.h | 8 +++---- src/plugins/projectexplorer/kit.h | 4 ++-- src/plugins/projectexplorer/msvctoolchain.cpp | 8 +++---- src/plugins/projectexplorer/msvctoolchain.h | 8 +++---- src/plugins/projectexplorer/project.cpp | 4 ++-- src/plugins/projectexplorer/project.h | 6 ++--- .../projectexplorer/projectconfiguration.cpp | 4 ++-- .../projectexplorer/projectconfiguration.h | 8 +++---- .../projectexplorer/runconfiguration.cpp | 24 +++++++++---------- .../projectexplorer/runconfiguration.h | 18 +++++++------- .../runconfigurationaspects.cpp | 20 ++++++++-------- .../projectexplorer/runconfigurationaspects.h | 20 ++++++++-------- src/plugins/projectexplorer/target.cpp | 2 +- src/plugins/projectexplorer/target.h | 6 ++--- src/plugins/projectexplorer/toolchain.cpp | 6 ++--- src/plugins/projectexplorer/toolchain.h | 8 +++---- .../toolchainsettingsaccessor.cpp | 4 ++-- src/plugins/python/pythonproject.cpp | 2 +- src/plugins/python/pythonproject.h | 2 +- .../qbsbuildconfiguration.cpp | 2 +- .../qbsprojectmanager/qbsbuildconfiguration.h | 2 +- .../qbsprojectmanager/qbsbuildstep.cpp | 4 ++-- src/plugins/qbsprojectmanager/qbsbuildstep.h | 4 ++-- .../qmakebuildconfiguration.cpp | 4 ++-- .../qmakebuildconfiguration.h | 4 ++-- .../qmakeprojectmanager/qmakeproject.cpp | 2 +- .../qmakeprojectmanager/qmakeproject.h | 2 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 4 ++-- src/plugins/qmakeprojectmanager/qmakestep.h | 4 ++-- .../qmljstools/qmljscodestylepreferences.cpp | 2 +- .../qmljstools/qmljscodestylepreferences.h | 4 ++-- .../qmljstools/qmljscodestylesettings.cpp | 2 +- .../qmljstools/qmljscodestylesettings.h | 6 ++--- .../qmlprojectmanager/qmlmainfileaspect.cpp | 4 ++-- .../qmlprojectmanager/qmlmainfileaspect.h | 4 ++-- .../qmlmultilanguageaspect.cpp | 4 ++-- .../qmlmultilanguageaspect.h | 4 ++-- src/plugins/qmlprojectmanager/qmlproject.cpp | 2 +- src/plugins/qmlprojectmanager/qmlproject.h | 2 +- src/plugins/qnx/qnxqtversion.cpp | 2 +- src/plugins/qnx/qnxqtversion.h | 4 ++-- src/plugins/qnx/qnxsettingspage.cpp | 2 +- src/plugins/qtsupport/baseqtversion.cpp | 2 +- src/plugins/qtsupport/baseqtversion.h | 6 ++--- .../abstractremotelinuxdeploystep.cpp | 4 ++-- .../abstractremotelinuxdeploystep.h | 4 ++-- src/plugins/remotelinux/makeinstallstep.cpp | 4 ++-- .../remotelinuxenvironmentaspect.cpp | 4 ++-- .../remotelinuxenvironmentaspect.h | 4 ++-- .../remotelinux/tarpackagecreationstep.cpp | 8 +++---- src/plugins/texteditor/behaviorsettings.cpp | 2 +- src/plugins/texteditor/behaviorsettings.h | 6 ++--- .../texteditor/extraencodingsettings.cpp | 2 +- .../texteditor/extraencodingsettings.h | 6 ++--- .../texteditor/icodestylepreferences.cpp | 4 ++-- .../texteditor/icodestylepreferences.h | 6 ++--- src/plugins/texteditor/marginsettings.cpp | 4 ++-- src/plugins/texteditor/marginsettings.h | 6 ++--- src/plugins/texteditor/storagesettings.cpp | 4 ++-- src/plugins/texteditor/storagesettings.h | 6 ++--- src/plugins/texteditor/tabsettings.cpp | 2 +- src/plugins/texteditor/tabsettings.h | 6 ++--- src/plugins/texteditor/typingsettings.cpp | 4 ++-- src/plugins/texteditor/typingsettings.h | 6 ++--- src/plugins/valgrind/valgrindsettings.cpp | 4 ++-- src/plugins/valgrind/valgrindsettings.h | 4 ++-- .../webassemblyrunconfiguration.cpp | 4 ++-- 181 files changed, 457 insertions(+), 456 deletions(-) rename src/libs/utils/{storage.cpp => store.cpp} (89%) rename src/libs/utils/{storage.h => store.h} (88%) diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 0bce11fcb58..5d9a8ffd442 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -161,7 +161,7 @@ add_qtc_library(Utils sortfiltermodel.h span.h statuslabel.cpp statuslabel.h - storage.cpp storage.h + store.cpp store.h stringtable.cpp stringtable.h stringutils.cpp stringutils.h styleanimator.cpp styleanimator.h diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index c02bba6a127..a0b7cf6754b 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -583,7 +583,7 @@ void BaseAspect::saveToMap(QVariantMap &data, const QVariant &value, /*! Retrieves the internal value of this BaseAspect from the QVariantMap \a map. */ -void BaseAspect::fromMap(const Storage &map) +void BaseAspect::fromMap(const Store &map) { if (settingsKey().isEmpty()) return; @@ -594,7 +594,7 @@ void BaseAspect::fromMap(const Storage &map) /*! Stores the internal value of this BaseAspect into the QVariantMap \a map. */ -void BaseAspect::toMap(Storage &map) const +void BaseAspect::toMap(Store &map) const { if (settingsKey().isEmpty()) return; @@ -692,13 +692,13 @@ public: class CheckableAspectImplementation { public: - void fromMap(const Storage &map) + void fromMap(const Store &map) { if (m_checked) m_checked->fromMap(map); } - void toMap(Storage &map) + void toMap(Store &map) { if (m_checked) m_checked->toMap(map); @@ -921,7 +921,7 @@ void StringAspect::setValueAcceptor(StringAspect::ValueAcceptor &&acceptor) /*! \reimp */ -void StringAspect::fromMap(const Storage &map) +void StringAspect::fromMap(const Store &map) { if (!settingsKey().isEmpty()) setValue(map.value(settingsKey(), defaultValue()).toString(), BeQuiet); @@ -931,7 +931,7 @@ void StringAspect::fromMap(const Storage &map) /*! \reimp */ -void StringAspect::toMap(Storage &map) const +void StringAspect::toMap(Store &map) const { saveToMap(map, value(), defaultValue(), settingsKey()); d->m_checkerImpl.toMap(map); @@ -1440,7 +1440,7 @@ void FilePathAspect::addToLayout(Layouting::LayoutItem &parent) /*! \reimp */ -void FilePathAspect::fromMap(const Storage &map) +void FilePathAspect::fromMap(const Store &map) { if (!settingsKey().isEmpty()) setValue(map.value(settingsKey(), defaultValue()).toString(), BeQuiet); @@ -1450,7 +1450,7 @@ void FilePathAspect::fromMap(const Storage &map) /*! \reimp */ -void FilePathAspect::toMap(Storage &map) const +void FilePathAspect::toMap(Store &map) const { saveToMap(map, value(), defaultValue(), settingsKey()); d->m_checkerImpl.toMap(map); @@ -2514,7 +2514,7 @@ const QList<BaseAspect *> &AspectContainer::aspects() const return d->m_items; } -void AspectContainer::fromMap(const Storage &map) +void AspectContainer::fromMap(const Store &map) { for (BaseAspect *aspect : std::as_const(d->m_items)) aspect->fromMap(map); @@ -2523,7 +2523,7 @@ void AspectContainer::fromMap(const Storage &map) } -void AspectContainer::toMap(Storage &map) const +void AspectContainer::toMap(Store &map) const { for (BaseAspect *aspect : std::as_const(d->m_items)) aspect->toMap(map); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 7e3b6942a88..00e452e3015 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -8,7 +8,7 @@ #include "infolabel.h" #include "macroexpander.h" #include "pathchooser.h" -#include "storage.h" +#include "store.h" #include <functional> #include <memory> @@ -101,9 +101,9 @@ public: AspectContainer *container() const; - virtual void fromMap(const Utils::Storage &map); - virtual void toMap(Utils::Storage &map) const; - virtual void toActiveMap(Utils::Storage &map) const { toMap(map); } + virtual void fromMap(const Store &map); + virtual void toMap(Store &map) const; + virtual void toActiveMap(Store &map) const { toMap(map); } virtual void addToLayout(Layouting::LayoutItem &parent); @@ -558,8 +558,8 @@ public: }; void setDisplayStyle(DisplayStyle style); - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; signals: void validChanged(bool validState); @@ -627,8 +627,8 @@ public: void addToLayout(Layouting::LayoutItem &parent) override; - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; signals: void validChanged(bool validState); @@ -832,8 +832,8 @@ public: void registerAspect(BaseAspect *aspect, bool takeOwnership = false); void registerAspects(const AspectContainer &aspects); - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; void readSettings() override; void writeSettings() const override; diff --git a/src/libs/utils/displayname.cpp b/src/libs/utils/displayname.cpp index 9758b440c6e..0046b50ae9e 100644 --- a/src/libs/utils/displayname.cpp +++ b/src/libs/utils/displayname.cpp @@ -35,13 +35,13 @@ bool DisplayName::usesDefaultValue() const return m_value.isEmpty(); } -void DisplayName::toMap(Storage &map, const QString &key) const +void DisplayName::toMap(Store &map, const QString &key) const { if (m_forceSerialization || !usesDefaultValue()) map.insert(key, m_value); } -void DisplayName::fromMap(const Storage &map, const QString &key) +void DisplayName::fromMap(const Store &map, const QString &key) { m_value = map.value(key).toString(); } diff --git a/src/libs/utils/displayname.h b/src/libs/utils/displayname.h index 71128fd10fb..fd4977c7586 100644 --- a/src/libs/utils/displayname.h +++ b/src/libs/utils/displayname.h @@ -4,7 +4,8 @@ #pragma once #include "utils_global.h" -#include "storage.h" + +#include "store.h" namespace Utils { @@ -22,8 +23,8 @@ public: bool usesDefaultValue() const; void forceSerialization() { m_forceSerialization = true; } - void toMap(Utils::Storage &map, const Key &key) const; - void fromMap(const Utils::Storage &map, const Key &key); + void toMap(Store &map, const Key &key) const; + void fromMap(const Store &map, const Key &key); private: QString m_value; diff --git a/src/libs/utils/storage.cpp b/src/libs/utils/store.cpp similarity index 89% rename from src/libs/utils/storage.cpp rename to src/libs/utils/store.cpp index c443c48ba63..b343d165fab 100644 --- a/src/libs/utils/storage.cpp +++ b/src/libs/utils/store.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "storage.h" +#include "store.h" namespace Utils { diff --git a/src/libs/utils/storage.h b/src/libs/utils/store.h similarity index 88% rename from src/libs/utils/storage.h rename to src/libs/utils/store.h index ddcdd233a94..d692216c301 100644 --- a/src/libs/utils/storage.h +++ b/src/libs/utils/store.h @@ -9,6 +9,6 @@ namespace Utils { using Key = QString; using Data = QVariant; -using Storage = QMap<Key, Data>; +using Store = QMap<Key, Data>; } // Utils diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index d2f9c814bb5..9e59cc2b86a 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -293,8 +293,8 @@ Project { "../3rdparty/span/span.hpp", "statuslabel.cpp", "statuslabel.h", - "storage.cpp", - "storage.h", + "store.cpp", + "store.h", "stringtable.cpp", "stringtable.h", "stringutils.cpp", diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index a98dad864c2..d76ea78c4d6 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -879,7 +879,7 @@ void AndroidBuildApkStep::updateBuildToolsVersionInJsonFile() } } -void AndroidBuildApkStep::fromMap(const Storage &map) +void AndroidBuildApkStep::fromMap(const Store &map) { m_keystorePath = FilePath::fromSettings(map.value(KeystoreLocationKey)); m_signPackage = false; // don't restore this @@ -893,7 +893,7 @@ void AndroidBuildApkStep::fromMap(const Storage &map) ProjectExplorer::BuildStep::fromMap(map); } -void AndroidBuildApkStep::toMap(Storage &map) const +void AndroidBuildApkStep::toMap(Store &map) const { ProjectExplorer::AbstractProcessStep::toMap(map); map.insert(KeystoreLocationKey, m_keystorePath.toSettings()); diff --git a/src/plugins/android/androidbuildapkstep.h b/src/plugins/android/androidbuildapkstep.h index 956e91d8303..cd003d3c85a 100644 --- a/src/plugins/android/androidbuildapkstep.h +++ b/src/plugins/android/androidbuildapkstep.h @@ -23,8 +23,8 @@ class AndroidBuildApkStep : public ProjectExplorer::AbstractProcessStep public: AndroidBuildApkStep(ProjectExplorer::BuildStepList *bc, Utils::Id id); - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; // signing Utils::FilePath keystorePath() const; diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index 520aceb4eab..155d30b8eba 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -214,7 +214,7 @@ void AndroidDevice::addActionsIfNotFound() } } -void AndroidDevice::fromMap(const Storage &map) +void AndroidDevice::fromMap(const Store &map) { IDevice::fromMap(map); initAvdSettings(); diff --git a/src/plugins/android/androiddevice.h b/src/plugins/android/androiddevice.h index 1ac5d349c96..53a5960e7cc 100644 --- a/src/plugins/android/androiddevice.h +++ b/src/plugins/android/androiddevice.h @@ -55,7 +55,7 @@ public: QString openGLStatus() const; protected: - void fromMap(const Utils::Storage &map) final; + void fromMap(const Utils::Store &map) final; private: void addActionsIfNotFound(); diff --git a/src/plugins/android/androidrunconfiguration.cpp b/src/plugins/android/androidrunconfiguration.cpp index ebfb40c6f4a..3f241fc50a4 100644 --- a/src/plugins/android/androidrunconfiguration.cpp +++ b/src/plugins/android/androidrunconfiguration.cpp @@ -32,13 +32,13 @@ public: : StringAspect(container) {} - void fromMap(const Storage &map) final + void fromMap(const Store &map) final { // Pre Qt Creator 5.0 hack: Reads QStringList as QString setValue(map.value(settingsKey()).toStringList().join('\n')); } - void toMap(Storage &map) const final + void toMap(Store &map) const final { // Pre Qt Creator 5.0 hack: Writes QString as QStringList map.insert(settingsKey(), value().split('\n')); diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index e0d0e6180f5..0323267daa0 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -101,7 +101,7 @@ void AndroidToolChain::addToEnvironment(Environment &env) const env.set(QLatin1String("ANDROID_SDK_ROOT"), config.sdkLocation().toUserOutput()); } -void AndroidToolChain::fromMap(const Storage &data) +void AndroidToolChain::fromMap(const Store &data) { ClangToolChain::fromMap(data); if (hasError()) diff --git a/src/plugins/android/androidtoolchain.h b/src/plugins/android/androidtoolchain.h index c8605f5dd8b..5bc66c0119b 100644 --- a/src/plugins/android/androidtoolchain.h +++ b/src/plugins/android/androidtoolchain.h @@ -22,7 +22,7 @@ public: QStringList suggestedMkspecList() const override; Utils::FilePath makeCommand(const Utils::Environment &environment) const override; - void fromMap(const Utils::Storage &data) override; + void fromMap(const Utils::Store &data) override; void setNdkLocation(const Utils::FilePath &ndkLocation); Utils::FilePath ndkLocation() const; diff --git a/src/plugins/android/javalanguageserver.cpp b/src/plugins/android/javalanguageserver.cpp index 6cb10c1f6c9..419edcabbd9 100644 --- a/src/plugins/android/javalanguageserver.cpp +++ b/src/plugins/android/javalanguageserver.cpp @@ -143,7 +143,7 @@ QVariantMap JLSSettings::toMap() const return map; } -void JLSSettings::fromMap(const Storage &map) +void JLSSettings::fromMap(const Store &map) { StdIOSettings::fromMap(map); m_languageServer = FilePath::fromSettings(map[languageServerKey]); diff --git a/src/plugins/android/javalanguageserver.h b/src/plugins/android/javalanguageserver.h index 982ab566d0b..a8d00ffcee5 100644 --- a/src/plugins/android/javalanguageserver.h +++ b/src/plugins/android/javalanguageserver.h @@ -16,8 +16,8 @@ public: bool applyFromSettingsWidget(QWidget *widget) final; QWidget *createSettingsWidget(QWidget *parent) const final; bool isValid() const final; - Utils::Storage toMap() const final; - void fromMap(const Utils::Storage &map) final; + Utils::Store toMap() const final; + void fromMap(const Utils::Store &map) final; LanguageClient::BaseSettings *copy() const final; LanguageClient::Client *createClient(LanguageClient::BaseClientInterface *interface) const final; LanguageClient::BaseClientInterface *createInterface( diff --git a/src/plugins/baremetal/baremetaldevice.cpp b/src/plugins/baremetal/baremetaldevice.cpp index 4c72d51ac93..4e90826a996 100644 --- a/src/plugins/baremetal/baremetaldevice.cpp +++ b/src/plugins/baremetal/baremetaldevice.cpp @@ -63,7 +63,7 @@ void BareMetalDevice::unregisterDebugServerProvider(IDebugServerProvider *provid m_debugServerProviderId.clear(); } -void BareMetalDevice::fromMap(const Storage &map) +void BareMetalDevice::fromMap(const Store &map) { IDevice::fromMap(map); QString providerId = map.value(debugServerProviderIdKeyC).toString(); diff --git a/src/plugins/baremetal/baremetaldevice.h b/src/plugins/baremetal/baremetaldevice.h index 096e9f17dee..b8aa72e12be 100644 --- a/src/plugins/baremetal/baremetaldevice.h +++ b/src/plugins/baremetal/baremetaldevice.h @@ -31,8 +31,8 @@ public: void unregisterDebugServerProvider(IDebugServerProvider *provider); protected: - void fromMap(const Utils::Storage &map) final; - Utils::Storage toMap() const final; + void fromMap(const Utils::Store &map) final; + Utils::Store toMap() const final; private: BareMetalDevice(); diff --git a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp index 1054a76d29e..7ce65d689ed 100644 --- a/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/eblinkgdbserverprovider.cpp @@ -74,8 +74,8 @@ private: class EBlinkGdbServerProvider final : public GdbServerProvider { public: - void toMap(Storage &data) const final; - void fromMap(const Storage &data) final; + void toMap(Store &data) const final; + void fromMap(const Store &data) final; bool operator==(const IDebugServerProvider &other) const final; @@ -215,7 +215,7 @@ bool EBlinkGdbServerProvider::isValid() const } } -void EBlinkGdbServerProvider::toMap(Storage &data) const +void EBlinkGdbServerProvider::toMap(Store &data) const { GdbServerProvider::toMap(data); data.insert(executableFileKeyC, m_executableFile.toSettings()); @@ -231,7 +231,7 @@ void EBlinkGdbServerProvider::toMap(Storage &data) const data.insert(gdbNotUseCacheC, m_gdbNotUseCache); } -void EBlinkGdbServerProvider::fromMap(const Storage &data) +void EBlinkGdbServerProvider::fromMap(const Store &data) { GdbServerProvider::fromMap(data); m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC)); diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp index abf6e319b94..3da6b06254f 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp @@ -120,7 +120,7 @@ bool GdbServerProvider::operator==(const IDebugServerProvider &other) const && m_useExtendedRemote == p->m_useExtendedRemote; } -void GdbServerProvider::toMap(Storage &data) const +void GdbServerProvider::toMap(Store &data) const { IDebugServerProvider::toMap(data); data.insert(startupModeKeyC, m_startupMode); @@ -179,7 +179,7 @@ RunWorker *GdbServerProvider::targetRunner(RunControl *runControl) const return new GdbServerProviderRunner(runControl, command()); } -void GdbServerProvider::fromMap(const Storage &data) +void GdbServerProvider::fromMap(const Store &data) { IDebugServerProvider::fromMap(data); m_startupMode = static_cast<StartupMode>(data.value(startupModeKeyC).toInt()); diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h index 073e0e212ea..f9b0887693c 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h @@ -33,7 +33,7 @@ public: bool operator==(const IDebugServerProvider &other) const override; - void toMap(Utils::Storage &data) const override; + void toMap(Utils::Store &data) const override; virtual Utils::CommandLine command() const; @@ -55,7 +55,7 @@ protected: void setResetCommands(const QString &); void setUseExtendedRemote(bool); - void fromMap(const Utils::Storage &data) override; + void fromMap(const Utils::Store &data) override; StartupMode m_startupMode = StartupOnNetwork; Utils::FilePath m_peripheralDescriptionFile; diff --git a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp index 32e3eabb6d1..56495e32c6f 100644 --- a/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/jlinkgdbserverprovider.cpp @@ -81,8 +81,8 @@ private: class JLinkGdbServerProvider final : public GdbServerProvider { public: - void toMap(Storage &data) const final; - void fromMap(const Storage &data) final; + void toMap(Store &data) const final; + void fromMap(const Store &data) final; bool operator==(const IDebugServerProvider &other) const final; @@ -194,7 +194,7 @@ bool JLinkGdbServerProvider::isValid() const return true; } -void JLinkGdbServerProvider::toMap(Storage &data) const +void JLinkGdbServerProvider::toMap(Store &data) const { GdbServerProvider::toMap(data); data.insert(executableFileKeyC, m_executableFile.toSettings()); @@ -206,7 +206,7 @@ void JLinkGdbServerProvider::toMap(Storage &data) const data.insert(additionalArgumentsKeyC, m_additionalArguments); } -void JLinkGdbServerProvider::fromMap(const Storage &data) +void JLinkGdbServerProvider::fromMap(const Store &data) { GdbServerProvider::fromMap(data); m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC)); diff --git a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp index 2c5eb447d99..ff4ae311afd 100644 --- a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp @@ -57,8 +57,8 @@ private: class OpenOcdGdbServerProvider final : public GdbServerProvider { public: - void toMap(Storage &data) const final; - void fromMap(const Storage &data) final; + void toMap(Store &data) const final; + void fromMap(const Store &data) final; bool operator==(const IDebugServerProvider &other) const final; @@ -180,7 +180,7 @@ bool OpenOcdGdbServerProvider::isValid() const return true; } -void OpenOcdGdbServerProvider::toMap(Storage &data) const +void OpenOcdGdbServerProvider::toMap(Store &data) const { GdbServerProvider::toMap(data); data.insert(executableFileKeyC, m_executableFile.toSettings()); @@ -189,7 +189,7 @@ void OpenOcdGdbServerProvider::toMap(Storage &data) const data.insert(additionalArgumentsKeyC, m_additionalArguments); } -void OpenOcdGdbServerProvider::fromMap(const Storage &data) +void OpenOcdGdbServerProvider::fromMap(const Store &data) { GdbServerProvider::fromMap(data); m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC)); diff --git a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp index d8d3ff1b0d0..b94012c9dc7 100644 --- a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp @@ -67,8 +67,8 @@ private: class StLinkUtilGdbServerProvider final : public GdbServerProvider { public: - void toMap(Storage &data) const final; - void fromMap(const Storage &data) final; + void toMap(Store &data) const final; + void fromMap(const Store &data) final; bool operator==(const IDebugServerProvider &other) const final; @@ -177,7 +177,7 @@ bool StLinkUtilGdbServerProvider::isValid() const return true; } -void StLinkUtilGdbServerProvider::toMap(Storage &data) const +void StLinkUtilGdbServerProvider::toMap(Store &data) const { GdbServerProvider::toMap(data); data.insert(executableFileKeyC, m_executableFile.toSettings()); @@ -188,7 +188,7 @@ void StLinkUtilGdbServerProvider::toMap(Storage &data) const data.insert(connectUnderResetKeyC, m_connectUnderReset); } -void StLinkUtilGdbServerProvider::fromMap(const Storage &data) +void StLinkUtilGdbServerProvider::fromMap(const Store &data) { GdbServerProvider::fromMap(data); m_executableFile = FilePath::fromSettings(data.value(executableFileKeyC)); diff --git a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp index ebf1ea3a021..0163d7b0d47 100644 --- a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp @@ -46,7 +46,7 @@ public: Speed speed = Speed::Speed_1MHz; QVariantMap toMap() const; - bool fromMap(const Storage &data); + bool fromMap(const Store &data); bool operator==(const JLinkUvscAdapterOptions &other) const; }; @@ -130,7 +130,7 @@ QVariantMap JLinkUvscAdapterOptions::toMap() const return map; } -bool JLinkUvscAdapterOptions::fromMap(const Storage &data) +bool JLinkUvscAdapterOptions::fromMap(const Store &data) { port = static_cast<Port>(data.value(adapterPortKeyC, SWD).toInt()); speed = static_cast<Speed>(data.value(adapterSpeedKeyC, Speed_1MHz).toInt()); @@ -147,8 +147,8 @@ bool JLinkUvscAdapterOptions::operator==(const JLinkUvscAdapterOptions &other) c class JLinkUvscServerProvider final : public UvscServerProvider { public: - void toMap(Storage &data) const final; - void fromMap(const Storage &data) final; + void toMap(Store &data) const final; + void fromMap(const Store &data) final; bool operator==(const IDebugServerProvider &other) const final; Utils::FilePath optionsFilePath(Debugger::DebuggerRunTool *runTool, @@ -240,13 +240,13 @@ JLinkUvscServerProvider::JLinkUvscServerProvider() setSupportedDrivers({"Segger\\JL2CM3.dll"}); } -void JLinkUvscServerProvider::toMap(Storage &data) const +void JLinkUvscServerProvider::toMap(Store &data) const { UvscServerProvider::toMap(data); data.insert(adapterOptionsKeyC, m_adapterOpts.toMap()); } -void JLinkUvscServerProvider::fromMap(const Storage &data) +void JLinkUvscServerProvider::fromMap(const Store &data) { UvscServerProvider::fromMap(data); m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).toMap()); diff --git a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp index 764c682f87e..57a52d2e850 100644 --- a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.cpp @@ -63,13 +63,13 @@ SimulatorUvscServerProvider::SimulatorUvscServerProvider() setDriverSelection(defaultSimulatorDriverSelection()); } -void SimulatorUvscServerProvider::toMap(Storage &data) const +void SimulatorUvscServerProvider::toMap(Store &data) const { UvscServerProvider::toMap(data); data.insert(limitSpeedKeyC, m_limitSpeed); } -void SimulatorUvscServerProvider::fromMap(const Storage &data) +void SimulatorUvscServerProvider::fromMap(const Store &data) { UvscServerProvider::fromMap(data); m_limitSpeed = data.value(limitSpeedKeyC).toBool(); diff --git a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h index 5e1e918c305..ea30b1dda1e 100644 --- a/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/simulatoruvscserverprovider.h @@ -16,8 +16,8 @@ namespace BareMetal::Internal { class SimulatorUvscServerProvider final : public UvscServerProvider { public: - void toMap(Utils::Storage &data) const final; - void fromMap(const Utils::Storage &data) final; + void toMap(Utils::Store &data) const final; + void fromMap(const Utils::Store &data) final; bool operator==(const IDebugServerProvider &other) const final; bool isSimulator() const final { return true; } diff --git a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp index 164900adf0d..ecad895da28 100644 --- a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp @@ -51,7 +51,7 @@ public: Speed speed = Speed::Speed_4MHz; QVariantMap toMap() const; - bool fromMap(const Storage &data); + bool fromMap(const Store &data); bool operator==(const StLinkUvscAdapterOptions &other) const; }; @@ -86,8 +86,8 @@ static QString buildDllRegistryName(const DeviceSelection &device, class StLinkUvscServerProvider final : public UvscServerProvider { public: - void toMap(Storage &data) const final; - void fromMap(const Storage &data) final; + void toMap(Store &data) const final; + void fromMap(const Store &data) final; bool operator==(const IDebugServerProvider &other) const final; Utils::FilePath optionsFilePath(Debugger::DebuggerRunTool *runTool, @@ -134,7 +134,7 @@ QVariantMap StLinkUvscAdapterOptions::toMap() const return map; } -bool StLinkUvscAdapterOptions::fromMap(const Storage &data) +bool StLinkUvscAdapterOptions::fromMap(const Store &data) { port = static_cast<Port>(data.value(adapterPortKeyC, SWD).toInt()); speed = static_cast<Speed>(data.value(adapterSpeedKeyC, Speed_4MHz).toInt()); @@ -200,13 +200,13 @@ StLinkUvscServerProvider::StLinkUvscServerProvider() setSupportedDrivers({"STLink\\ST-LINKIII-KEIL_SWO.dll"}); } -void StLinkUvscServerProvider::toMap(Storage &data) const +void StLinkUvscServerProvider::toMap(Store &data) const { UvscServerProvider::toMap(data); data.insert(adapterOptionsKeyC, m_adapterOpts.toMap()); } -void StLinkUvscServerProvider::fromMap(const Storage &data) +void StLinkUvscServerProvider::fromMap(const Store &data) { UvscServerProvider::fromMap(data); m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).toMap()); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index 3a360e7582a..ed054528cad 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -147,7 +147,7 @@ FilePath UvscServerProvider::buildOptionsFilePath(DebuggerRunTool *runTool) cons return path; } -void UvscServerProvider::toMap(Storage &data) const +void UvscServerProvider::toMap(Store &data) const { IDebugServerProvider::toMap(data); data.insert(toolsIniKeyC, m_toolsIniFile.toSettings()); @@ -219,7 +219,7 @@ ProjectExplorer::RunWorker *UvscServerProvider::targetRunner(RunControl *runCont return new UvscServerProviderRunner(runControl, r); } -void UvscServerProvider::fromMap(const Storage &data) +void UvscServerProvider::fromMap(const Store &data) { IDebugServerProvider::fromMap(data); m_toolsIniFile = FilePath::fromSettings(data.value(toolsIniKeyC)); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h index d16ecb7f915..2cce62f6c18 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.h @@ -48,7 +48,7 @@ public: bool operator==(const IDebugServerProvider &other) const override; - void toMap(Utils::Storage &map) const override; + void toMap(Utils::Store &map) const override; bool aboutToRun(Debugger::DebuggerRunTool *runTool, QString &errorMessage) const final; ProjectExplorer::RunWorker *targetRunner(ProjectExplorer::RunControl *runControl) const final; @@ -69,7 +69,7 @@ protected: Utils::FilePath buildProjectFilePath(Debugger::DebuggerRunTool *runTool) const; Utils::FilePath buildOptionsFilePath(Debugger::DebuggerRunTool *runTool) const; - void fromMap(const Utils::Storage &data) override; + void fromMap(const Utils::Store &data) override; // uVision specific stuff. virtual Utils::FilePath projectFilePath(Debugger::DebuggerRunTool *runTool, diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp index e165561c7dd..c7fa9ba1db0 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp @@ -102,7 +102,7 @@ QVariantMap DeviceSelection::toMap() const return map; } -void DeviceSelection::fromMap(const Storage &map) +void DeviceSelection::fromMap(const Store &map) { // Software package. package.desc = map.value(packageDescrKeyC).toString(); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.h b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.h index abfb8d7b49d..f750b3847fd 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.h +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.h @@ -5,7 +5,7 @@ #include <utils/basetreeview.h> #include <utils/treemodel.h> -#include <utils/storage.h> +#include <utils/store.h> QT_BEGIN_NAMESPACE class QComboBox; @@ -72,8 +72,8 @@ public: Algorithms algorithms; int algorithmIndex = 0; - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); bool operator==(const DeviceSelection &other) const; }; diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.cpp b/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.cpp index 6c6a41955d5..b153d5d4ad5 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.cpp @@ -33,7 +33,7 @@ QVariantMap DriverSelection::toMap() const return map; } -void DriverSelection::fromMap(const Storage &map) +void DriverSelection::fromMap(const Store &map) { index = map.value(driverIndexKeyC).toInt(); cpuDllIndex = map.value(driverCpuDllIndexKeyC).toInt(); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.h b/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.h index 11a66c2dcb9..8362e58fc1a 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.h +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.h @@ -5,7 +5,7 @@ #include <utils/basetreeview.h> #include <utils/treemodel.h> -#include <utils/storage.h> +#include <utils/store.h> QT_BEGIN_NAMESPACE class QComboBox; @@ -24,8 +24,8 @@ public: int index = 0; int cpuDllIndex = 0; - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); bool operator==(const DriverSelection &other) const; }; diff --git a/src/plugins/baremetal/idebugserverprovider.cpp b/src/plugins/baremetal/idebugserverprovider.cpp index 03ddc183c43..966c961ef9f 100644 --- a/src/plugins/baremetal/idebugserverprovider.cpp +++ b/src/plugins/baremetal/idebugserverprovider.cpp @@ -138,7 +138,7 @@ IDebugServerProviderConfigWidget *IDebugServerProvider::configurationWidget() co return m_configurationWidgetCreator(); } -void IDebugServerProvider::toMap(Storage &data) const +void IDebugServerProvider::toMap(Store &data) const { data.insert(idKeyC, m_id); data.insert(displayNameKeyC, m_displayName); @@ -167,7 +167,7 @@ void IDebugServerProvider::resetId() m_id = createId(m_id); } -void IDebugServerProvider::fromMap(const Storage &data) +void IDebugServerProvider::fromMap(const Store &data) { m_id = data.value(idKeyC).toString(); m_displayName = data.value(displayNameKeyC).toString(); diff --git a/src/plugins/baremetal/idebugserverprovider.h b/src/plugins/baremetal/idebugserverprovider.h index 846be8ed893..b06cdc5c2b9 100644 --- a/src/plugins/baremetal/idebugserverprovider.h +++ b/src/plugins/baremetal/idebugserverprovider.h @@ -8,7 +8,7 @@ #include <projectexplorer/abi.h> #include <utils/filepath.h> -#include <utils/storage.h> +#include <utils/store.h> #include <QSet> #include <QUrl> @@ -67,8 +67,8 @@ public: void setConfigurationWidgetCreator (const std::function<IDebugServerProviderConfigWidget *()> &configurationWidgetCreator); - virtual void toMap(Utils::Storage &data) const; - virtual void fromMap(const Utils::Storage &data); + virtual void toMap(Utils::Store &data) const; + virtual void fromMap(const Utils::Store &data); virtual bool aboutToRun(Debugger::DebuggerRunTool *runTool, QString &errorMessage) const = 0; diff --git a/src/plugins/boot2qt/qdbdevice.cpp b/src/plugins/boot2qt/qdbdevice.cpp index 6fdd610d96b..ff397e2ea75 100644 --- a/src/plugins/boot2qt/qdbdevice.cpp +++ b/src/plugins/boot2qt/qdbdevice.cpp @@ -137,7 +137,7 @@ QString QdbDevice::serialNumber() const return m_serialNumber; } -void QdbDevice::fromMap(const Storage &map) +void QdbDevice::fromMap(const Store &map) { ProjectExplorer::IDevice::fromMap(map); setSerialNumber(map.value("Qdb.SerialNumber").toString()); diff --git a/src/plugins/boot2qt/qdbdevice.h b/src/plugins/boot2qt/qdbdevice.h index e0ccac65557..6c502c2ab80 100644 --- a/src/plugins/boot2qt/qdbdevice.h +++ b/src/plugins/boot2qt/qdbdevice.h @@ -26,8 +26,8 @@ public: void setupDefaultNetworkSettings(const QString &host); protected: - void fromMap(const Utils::Storage &map) final; - Utils::Storage toMap() const final; + void fromMap(const Utils::Store &map) final; + Utils::Store toMap() const final; private: QdbDevice(); diff --git a/src/plugins/clangtools/clangtoolssettings.cpp b/src/plugins/clangtools/clangtoolssettings.cpp index 6661a3b50cb..31eb794957f 100644 --- a/src/plugins/clangtools/clangtoolssettings.cpp +++ b/src/plugins/clangtools/clangtoolssettings.cpp @@ -41,7 +41,7 @@ RunSettings::RunSettings() { } -void RunSettings::fromMap(const Storage &map, const QString &prefix) +void RunSettings::fromMap(const Store &map, const QString &prefix) { m_diagnosticConfigId = Id::fromSetting(map.value(prefix + diagnosticConfigIdKey)); m_parallelJobs = map.value(prefix + parallelJobsKey).toInt(); @@ -50,7 +50,7 @@ void RunSettings::fromMap(const Storage &map, const QString &prefix) m_analyzeOpenFiles = map.value(prefix + analyzeOpenFilesKey).toBool(); } -void RunSettings::toMap(Storage &map, const QString &prefix) const +void RunSettings::toMap(Store &map, const QString &prefix) const { map.insert(prefix + diagnosticConfigIdKey, m_diagnosticConfigId.toSetting()); map.insert(prefix + parallelJobsKey, m_parallelJobs); diff --git a/src/plugins/clangtools/clangtoolssettings.h b/src/plugins/clangtools/clangtoolssettings.h index 885674baba2..a49f021ae58 100644 --- a/src/plugins/clangtools/clangtoolssettings.h +++ b/src/plugins/clangtools/clangtoolssettings.h @@ -26,8 +26,8 @@ class RunSettings public: RunSettings(); - void fromMap(const Utils::Storage &map, const QString &prefix = QString()); - void toMap(Utils::Storage &map, const QString &prefix = QString()) const; + void fromMap(const Utils::Store &map, const QString &prefix = QString()); + void toMap(Utils::Store &map, const QString &prefix = QString()) const; Utils::Id diagnosticConfigId() const; void setDiagnosticConfigId(const Utils::Id &id) { m_diagnosticConfigId = id; } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 9a6383e552a..228e74336ca 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -2139,14 +2139,14 @@ void InitialCMakeArgumentsAspect::setCMakeConfiguration(const CMakeConfig &confi ci.isInitial = true; } -void InitialCMakeArgumentsAspect::fromMap(const Storage &map) +void InitialCMakeArgumentsAspect::fromMap(const Store &map) { const QString value = map.value(settingsKey(), defaultValue()).toString(); QStringList additionalArguments; setAllValues(value, additionalArguments); } -void InitialCMakeArgumentsAspect::toMap(Storage &map) const +void InitialCMakeArgumentsAspect::toMap(Store &map) const { saveToMap(map, allValues().join('\n'), defaultValue(), settingsKey()); } @@ -2231,7 +2231,7 @@ ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(AspectContainer *containe }); } -void ConfigureEnvironmentAspect::fromMap(const Storage &map) +void ConfigureEnvironmentAspect::fromMap(const Store &map) { // Match the key values from Qt Creator 9.0.0/1 to the ones from EnvironmentAspect const bool cleanSystemEnvironment = map.value(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY)) @@ -2249,7 +2249,7 @@ void ConfigureEnvironmentAspect::fromMap(const Storage &map) ProjectExplorer::EnvironmentAspect::fromMap(tmpMap); } -void ConfigureEnvironmentAspect::toMap(Storage &map) const +void ConfigureEnvironmentAspect::toMap(Store &map) const { QVariantMap tmpMap; ProjectExplorer::EnvironmentAspect::toMap(tmpMap); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index e7df5d05b35..a23ae568012 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -31,8 +31,8 @@ public: void setAllValues(const QString &values, QStringList &additionalArguments); void setCMakeConfiguration(const CMakeConfig &config); - void fromMap(const Utils::Storage &map) final; - void toMap(Utils::Storage &map) const final; + void fromMap(const Utils::Store &map) final; + void toMap(Utils::Store &map) const final; private: CMakeConfig m_cmakeConfiguration; @@ -44,8 +44,8 @@ public: ConfigureEnvironmentAspect(Utils::AspectContainer *container, ProjectExplorer::BuildConfiguration *buildConfig); - void fromMap(const Utils::Storage &map); - void toMap(Utils::Storage &map) const; + void fromMap(const Utils::Store &map); + void toMap(Utils::Store &map) const; }; } // namespace Internal diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 3fd1066468e..8ab20703aa5 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -273,7 +273,7 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Id id) : this, &CMakeBuildStep::updateBuildTargetsModel); } -void CMakeBuildStep::toMap(Utils::Storage &map) const +void CMakeBuildStep::toMap(Utils::Store &map) const { CMakeAbstractProcessStep::toMap(map); map.insert(BUILD_TARGETS_KEY, m_buildTargets); @@ -282,7 +282,7 @@ void CMakeBuildStep::toMap(Utils::Storage &map) const map.insert(QLatin1String(BUILD_PRESET_KEY), m_buildPreset); } -void CMakeBuildStep::fromMap(const Utils::Storage &map) +void CMakeBuildStep::fromMap(const Utils::Store &map) { setBuildTargets(map.value(BUILD_TARGETS_KEY).toStringList()); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h index a202708a070..34690950290 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h @@ -44,7 +44,7 @@ public: bool buildsBuildTarget(const QString &target) const; void setBuildsBuildTarget(const QString &target, bool on); - void toMap(Utils::Storage &map) const override; + void toMap(Utils::Store &map) const override; QString cleanTarget() const; QString allTarget() const ; @@ -83,7 +83,7 @@ signals: private: Utils::CommandLine cmakeCommand() const; - void fromMap(const Utils::Storage &map) override; + void fromMap(const Utils::Store &map) override; bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index 744a34f2fb4..5243ef06523 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -9,7 +9,7 @@ #include <utils/filepath.h> #include <utils/id.h> -#include <utils/storage.h> +#include <utils/store.h> #include <optional> @@ -60,7 +60,7 @@ public: bool isValid() const; Utils::Id id() const { return m_id; } - Utils::Storage toMap () const; + Utils::Store toMap () const; void setAutorun(bool autoRun) { m_isAutoRun = autoRun; } diff --git a/src/plugins/cppeditor/cppcodemodelsettings.cpp b/src/plugins/cppeditor/cppcodemodelsettings.cpp index 239a5a8e1b1..318efd14e5a 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettings.cpp @@ -558,7 +558,7 @@ QVariantMap ClangdSettings::Data::toMap() const return map; } -void ClangdSettings::Data::fromMap(const Storage &map) +void ClangdSettings::Data::fromMap(const Store &map) { useClangd = map.value(useClangdKey(), true).toBool(); executableFilePath = FilePath::fromString(map.value(clangdPathKey()).toString()); diff --git a/src/plugins/cppeditor/cppcodemodelsettings.h b/src/plugins/cppeditor/cppcodemodelsettings.h index c35ca854221..f4303146b71 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.h +++ b/src/plugins/cppeditor/cppcodemodelsettings.h @@ -9,7 +9,7 @@ #include <utils/clangutils.h> #include <utils/filepath.h> #include <utils/id.h> -#include <utils/storage.h> +#include <utils/store.h> #include <QObject> #include <QStringList> @@ -94,8 +94,8 @@ public: class CPPEDITOR_EXPORT Data { public: - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); friend bool operator==(const Data &s1, const Data &s2) { diff --git a/src/plugins/cppeditor/cppcodestylepreferences.cpp b/src/plugins/cppeditor/cppcodestylepreferences.cpp index 27271edcfa0..c6b497e021b 100644 --- a/src/plugins/cppeditor/cppcodestylepreferences.cpp +++ b/src/plugins/cppeditor/cppcodestylepreferences.cpp @@ -80,7 +80,7 @@ QVariantMap CppCodeStylePreferences::toMap() const return map; } -void CppCodeStylePreferences::fromMap(const Storage &map) +void CppCodeStylePreferences::fromMap(const Store &map) { ICodeStylePreferences::fromMap(map); if (!currentDelegate()) diff --git a/src/plugins/cppeditor/cppcodestylepreferences.h b/src/plugins/cppeditor/cppcodestylepreferences.h index 2d10ace3bbd..6ee7d8fc136 100644 --- a/src/plugins/cppeditor/cppcodestylepreferences.h +++ b/src/plugins/cppeditor/cppcodestylepreferences.h @@ -25,8 +25,8 @@ public: // tracks parent hierarchy until currentParentSettings is null CppCodeStyleSettings currentCodeStyleSettings() const; - Utils::Storage toMap() const override; - void fromMap(const Utils::Storage &map) override; + Utils::Store toMap() const override; + void fromMap(const Utils::Store &map) override; public slots: void setCodeStyleSettings(const CppCodeStyleSettings &data); diff --git a/src/plugins/cppeditor/cppcodestylesettings.cpp b/src/plugins/cppeditor/cppcodestylesettings.cpp index 33dd4617f8b..2e04d3caa48 100644 --- a/src/plugins/cppeditor/cppcodestylesettings.cpp +++ b/src/plugins/cppeditor/cppcodestylesettings.cpp @@ -75,7 +75,7 @@ QVariantMap CppCodeStyleSettings::toMap() const }; } -void CppCodeStyleSettings::fromMap(const Storage &map) +void CppCodeStyleSettings::fromMap(const Store &map) { indentBlockBraces = map.value(indentBlockBracesKey, indentBlockBraces).toBool(); indentBlockBody = map.value(indentBlockBodyKey, indentBlockBody).toBool(); diff --git a/src/plugins/cppeditor/cppcodestylesettings.h b/src/plugins/cppeditor/cppcodestylesettings.h index 38041ccbb3d..8369df099e8 100644 --- a/src/plugins/cppeditor/cppcodestylesettings.h +++ b/src/plugins/cppeditor/cppcodestylesettings.h @@ -5,7 +5,7 @@ #include "cppeditor_global.h" -#include <utils/storage.h> +#include <utils/store.h> namespace CPlusPlus { class Overview; } namespace TextEditor { class TabSettings; } @@ -64,8 +64,8 @@ public: bool forceFormatting = false; #endif - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); bool equals(const CppCodeStyleSettings &rhs) const; bool operator==(const CppCodeStyleSettings &s) const { return equals(s); } diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h index 21a29fdf700..91e9b45fdcd 100644 --- a/src/plugins/debugger/commonoptionspage.h +++ b/src/plugins/debugger/commonoptionspage.h @@ -22,8 +22,8 @@ public: explicit SourcePathMapAspect(Utils::AspectContainer *container); ~SourcePathMapAspect() override; - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; void addToLayout(Layouting::LayoutItem &parent) override; diff --git a/src/plugins/debugger/debuggeritem.h b/src/plugins/debugger/debuggeritem.h index 49d6798ff9e..e32ded91f86 100644 --- a/src/plugins/debugger/debuggeritem.h +++ b/src/plugins/debugger/debuggeritem.h @@ -10,7 +10,7 @@ #include <utils/filepath.h> #include <utils/environment.h> -#include <utils/storage.h> +#include <utils/store.h> #include <QDateTime> @@ -37,7 +37,7 @@ public: bool isValid() const; QString engineTypeName() const; - Utils::Storage toMap() const; + Utils::Store toMap() const; QVariant id() const { return m_id; } diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp index 89ce34190dd..173b6b1a5e5 100644 --- a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp +++ b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp @@ -211,7 +211,7 @@ int DebuggerRunConfigurationAspect::portsUsedByDebugger() const return ports; } -void DebuggerRunConfigurationAspect::toMap(Storage &map) const +void DebuggerRunConfigurationAspect::toMap(Store &map) const { m_cppAspect->toMap(map); m_qmlAspect->toMap(map); @@ -223,7 +223,7 @@ void DebuggerRunConfigurationAspect::toMap(Storage &map) const map.insert("RunConfiguration.UseQmlDebuggerAuto", m_qmlAspect->value() == TriState::Default); } -void DebuggerRunConfigurationAspect::fromMap(const Storage &map) +void DebuggerRunConfigurationAspect::fromMap(const Store &map) { m_cppAspect->fromMap(map); m_qmlAspect->fromMap(map); diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.h b/src/plugins/debugger/debuggerrunconfigurationaspect.h index 164f4d5eb28..c6357cf4a31 100644 --- a/src/plugins/debugger/debuggerrunconfigurationaspect.h +++ b/src/plugins/debugger/debuggerrunconfigurationaspect.h @@ -17,8 +17,8 @@ public: DebuggerRunConfigurationAspect(ProjectExplorer::Target *target); ~DebuggerRunConfigurationAspect(); - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; bool useCppDebugger() const; bool useQmlDebugger() const; diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 8f74a24da5d..5242ebfc2d2 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -452,12 +452,12 @@ SourcePathMapAspect::~SourcePathMapAspect() delete d; } -void SourcePathMapAspect::fromMap(const Storage &) +void SourcePathMapAspect::fromMap(const Store &) { QTC_CHECK(false); // This is only used via read/writeSettings } -void SourcePathMapAspect::toMap(Storage &) const +void SourcePathMapAspect::toMap(Store &) const { QTC_CHECK(false); } diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 63b1604f725..e37381f18de 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -778,7 +778,7 @@ const char DockerDeviceKeepEntryPoint[] = "DockerDeviceKeepEntryPoint"; const char DockerDeviceEnableLldbFlags[] = "DockerDeviceEnableLldbFlags"; const char DockerDeviceClangDExecutable[] = "DockerDeviceClangDExecutable"; -void DockerDevice::fromMap(const Storage &map) +void DockerDevice::fromMap(const Store &map) { ProjectExplorer::IDevice::fromMap(map); DockerDeviceData data; diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 045cc6943b7..59a11e436a4 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -99,8 +99,8 @@ public: std::optional<Utils::FilePath> clangdExecutable() const override; protected: - void fromMap(const Utils::Storage &map) final; - Utils::Storage toMap() const final; + void fromMap(const Utils::Store &map) final; + Utils::Store toMap() const final; private: void aboutToBeRemoved() const final; diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 8c10ac4777a..20afb9f99c1 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -619,7 +619,7 @@ void GenericBuildSystem::removeFiles(const FilePaths &filesToRemove) } } -Project::RestoreResult GenericProject::fromMap(const Storage &map, QString *errorMessage) +Project::RestoreResult GenericProject::fromMap(const Store &map, QString *errorMessage) { const RestoreResult result = Project::fromMap(map, errorMessage); if (result != RestoreResult::Ok) diff --git a/src/plugins/genericprojectmanager/genericproject.h b/src/plugins/genericprojectmanager/genericproject.h index 40986ff660c..db72c2b872f 100644 --- a/src/plugins/genericprojectmanager/genericproject.h +++ b/src/plugins/genericprojectmanager/genericproject.h @@ -19,7 +19,7 @@ public: void removeFilesTriggered(const Utils::FilePaths &filesToRemove); private: - RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage) final; + RestoreResult fromMap(const Utils::Store &map, QString *errorMessage) final; ProjectExplorer::DeploymentKnowledge deploymentKnowledge() const final; void configureAsExampleProject(ProjectExplorer::Kit *kit) override; }; diff --git a/src/plugins/incredibuild/commandbuilder.cpp b/src/plugins/incredibuild/commandbuilder.cpp index 73f9808a68f..ffe2f2f8c0d 100644 --- a/src/plugins/incredibuild/commandbuilder.cpp +++ b/src/plugins/incredibuild/commandbuilder.cpp @@ -17,7 +17,7 @@ QString CommandBuilder::displayName() const return Tr::tr("Custom Command"); } -void CommandBuilder::fromMap(const Storage &map) +void CommandBuilder::fromMap(const Store &map) { m_command = FilePath::fromSettings(map.value(QString(CUSTOMCOMMANDBUILDER_COMMAND).arg(id()))); m_args = map.value(QString(CUSTOMCOMMANDBUILDER_ARGS).arg(id())).toString(); diff --git a/src/plugins/incredibuild/commandbuilder.h b/src/plugins/incredibuild/commandbuilder.h index 024b64f55f1..2a2115344ff 100644 --- a/src/plugins/incredibuild/commandbuilder.h +++ b/src/plugins/incredibuild/commandbuilder.h @@ -20,7 +20,7 @@ public: virtual QString id() const { return "CustomCommandBuilder"; } virtual QString displayName() const; - virtual void fromMap(const Utils::Storage &map); + virtual void fromMap(const Utils::Store &map); virtual void toMap(QVariantMap *map) const; virtual Utils::FilePath defaultCommand() const { return {}; } diff --git a/src/plugins/incredibuild/commandbuilderaspect.cpp b/src/plugins/incredibuild/commandbuilderaspect.cpp index 750ec43f09c..ce499f28038 100644 --- a/src/plugins/incredibuild/commandbuilderaspect.cpp +++ b/src/plugins/incredibuild/commandbuilderaspect.cpp @@ -159,7 +159,7 @@ void CommandBuilderAspect::addToLayout(Layouting::LayoutItem &parent) updateGui(); } -void CommandBuilderAspect::fromMap(const Storage &map) +void CommandBuilderAspect::fromMap(const Store &map) { d->m_loadedFromMap = true; @@ -171,7 +171,7 @@ void CommandBuilderAspect::fromMap(const Storage &map) updateGui(); } -void CommandBuilderAspect::toMap(Storage &map) const +void CommandBuilderAspect::toMap(Store &map) const { map[IncrediBuild::Constants::INCREDIBUILD_BUILDSTEP_TYPE] = QVariant(IncrediBuild::Constants::BUILDCONSOLE_BUILDSTEP_ID); diff --git a/src/plugins/incredibuild/commandbuilderaspect.h b/src/plugins/incredibuild/commandbuilderaspect.h index f8fe6a9f055..3282a18415f 100644 --- a/src/plugins/incredibuild/commandbuilderaspect.h +++ b/src/plugins/incredibuild/commandbuilderaspect.h @@ -24,8 +24,8 @@ public: private: void addToLayout(Layouting::LayoutItem &parent) final; - void fromMap(const Utils::Storage &map) final; - void toMap(Utils::Storage &map) const final; + void fromMap(const Utils::Store &map) final; + void toMap(Utils::Store &map) const final; void updateGui(); diff --git a/src/plugins/ios/iosbuildconfiguration.cpp b/src/plugins/ios/iosbuildconfiguration.cpp index 4e98ccb7670..92c41179658 100644 --- a/src/plugins/ios/iosbuildconfiguration.cpp +++ b/src/plugins/ios/iosbuildconfiguration.cpp @@ -376,7 +376,7 @@ public: private: QList<NamedWidget *> createSubConfigWidgets() override; - void fromMap(const Storage &map) override; + void fromMap(const Store &map) override; void updateQmakeCommand(); @@ -414,7 +414,7 @@ QList<NamedWidget *> IosQmakeBuildConfiguration::createSubConfigWidgets() return subConfigWidgets; } -void IosQmakeBuildConfiguration::fromMap(const Storage &map) +void IosQmakeBuildConfiguration::fromMap(const Store &map) { QmakeBuildConfiguration::fromMap(map); if (!hasError()) diff --git a/src/plugins/ios/iosbuildstep.cpp b/src/plugins/ios/iosbuildstep.cpp index 2b7faa7f7f4..b6612336058 100644 --- a/src/plugins/ios/iosbuildstep.cpp +++ b/src/plugins/ios/iosbuildstep.cpp @@ -56,8 +56,8 @@ private: bool init() final; void setupOutputFormatter(Utils::OutputFormatter *formatter) final; - void fromMap(const Storage &map) final; - void toMap(Storage &map) const final; + void fromMap(const Store &map) final; + void toMap(Store &map) const final; QStringList m_baseBuildArguments; QStringList m_extraArguments; @@ -166,7 +166,7 @@ void IosBuildStep::setupOutputFormatter(OutputFormatter *formatter) AbstractProcessStep::setupOutputFormatter(formatter); } -void IosBuildStep::toMap(Storage &map) const +void IosBuildStep::toMap(Store &map) const { AbstractProcessStep::toMap(map); @@ -177,7 +177,7 @@ void IosBuildStep::toMap(Storage &map) const map.insert(CLEAN_KEY, stepList()->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN); } -void IosBuildStep::fromMap(const Storage &map) +void IosBuildStep::fromMap(const Store &map) { QVariant bArgs = map.value(BUILD_ARGUMENTS_KEY); m_baseBuildArguments = bArgs.toStringList(); diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index 5264c763a77..43ba1b5721e 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -126,7 +126,7 @@ IDeviceWidget *IosDevice::createWidget() return new IosDeviceInfoWidget(sharedFromThis()); } -void IosDevice::fromMap(const Storage &map) +void IosDevice::fromMap(const Store &map) { IDevice::fromMap(map); diff --git a/src/plugins/ios/iosdevice.h b/src/plugins/ios/iosdevice.h index 6e5d6af9f36..29d8fc24e43 100644 --- a/src/plugins/ios/iosdevice.h +++ b/src/plugins/ios/iosdevice.h @@ -40,8 +40,8 @@ public: static QString name(); protected: - void fromMap(const Utils::Storage &map) final; - Utils::Storage toMap() const final; + void fromMap(const Utils::Store &map) final; + Utils::Store toMap() const final; friend class IosDeviceFactory; friend class Ios::Internal::IosDeviceManager; diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index b888c497b9a..960658d5d2b 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -59,8 +59,8 @@ public: private: void setupOutputFormatter(OutputFormatter *formatter) override; - void toMap(Storage &map) const override; - void fromMap(const Storage &map) override; + void toMap(Store &map) const override; + void fromMap(const Store &map) override; QStringList defaultCleanCmdList() const; QStringList defaultCmdList() const; @@ -83,7 +83,7 @@ IosDsymBuildStep::IosDsymBuildStep(BuildStepList *parent, Id id) : setIgnoreReturnValue(m_clean); } -void IosDsymBuildStep::toMap(Storage &map) const +void IosDsymBuildStep::toMap(Store &map) const { AbstractProcessStep::toMap(map); @@ -95,7 +95,7 @@ void IosDsymBuildStep::toMap(Storage &map) const map.insert(id().withSuffix(COMMAND_PARTIAL_KEY).toString(), command().toSettings()); } -void IosDsymBuildStep::fromMap(const Storage &map) +void IosDsymBuildStep::fromMap(const Store &map) { QVariant bArgs = map.value(id().withSuffix(ARGUMENTS_PARTIAL_KEY).toString()); m_arguments = bArgs.toStringList(); diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index fdcc348c0a4..b165bfbef9c 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -206,7 +206,7 @@ FilePath IosRunConfiguration::localExecutable() const return bundleDirectory().pathAppended(applicationName()); } -void IosDeviceTypeAspect::fromMap(const Storage &map) +void IosDeviceTypeAspect::fromMap(const Store &map) { bool deviceTypeIsInt; map.value(deviceTypeKey).toInt(&deviceTypeIsInt); @@ -216,7 +216,7 @@ void IosDeviceTypeAspect::fromMap(const Storage &map) m_runConfiguration->update(); } -void IosDeviceTypeAspect::toMap(Storage &map) const +void IosDeviceTypeAspect::toMap(Store &map) const { map.insert(deviceTypeKey, deviceType().toMap()); } diff --git a/src/plugins/ios/iosrunconfiguration.h b/src/plugins/ios/iosrunconfiguration.h index 8c7c93bf3bc..da890ae3e5e 100644 --- a/src/plugins/ios/iosrunconfiguration.h +++ b/src/plugins/ios/iosrunconfiguration.h @@ -27,8 +27,8 @@ public: explicit IosDeviceTypeAspect(Utils::AspectContainer *container, IosRunConfiguration *runConfiguration); - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; void addToLayout(Layouting::LayoutItem &parent) override; IosDeviceType deviceType() const; diff --git a/src/plugins/ios/iossimulator.cpp b/src/plugins/ios/iossimulator.cpp index 391a77548bc..ee16f73277c 100644 --- a/src/plugins/ios/iossimulator.cpp +++ b/src/plugins/ios/iossimulator.cpp @@ -73,7 +73,7 @@ IosDeviceType::IosDeviceType(IosDeviceType::Type type, const QString &identifier type(type), identifier(identifier), displayName(displayName) { } -bool IosDeviceType::fromMap(const Storage &map) +bool IosDeviceType::fromMap(const Store &map) { bool validType; displayName = map.value(iosDeviceTypeDisplayNameKey, QVariant()).toString(); diff --git a/src/plugins/ios/iossimulator.h b/src/plugins/ios/iossimulator.h index c5b6d4c81e0..db0c81623da 100644 --- a/src/plugins/ios/iossimulator.h +++ b/src/plugins/ios/iossimulator.h @@ -25,8 +25,8 @@ public: IosDeviceType(Type type = IosDevice, const QString &identifier = QString(), const QString &displayName = QString()); - bool fromMap(const Utils::Storage &map); - Utils::Storage toMap() const; + bool fromMap(const Utils::Store &map); + Utils::Store toMap() const; bool operator ==(const IosDeviceType &o) const; bool operator !=(const IosDeviceType &o) const { return !(*this == o); } diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index 6a700598461..200f6772d22 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -578,7 +578,7 @@ QVariantMap BaseSettings::toMap() const return map; } -void BaseSettings::fromMap(const Storage &map) +void BaseSettings::fromMap(const Store &map) { m_name = map[nameKey].toString(); m_id = map.value(idKey, QUuid::createUuid().toString()).toString(); @@ -722,7 +722,7 @@ QVariantMap StdIOSettings::toMap() const return map; } -void StdIOSettings::fromMap(const Storage &map) +void StdIOSettings::fromMap(const Store &map) { BaseSettings::fromMap(map); m_executable = Utils::FilePath::fromSettings(map[executableKey]); diff --git a/src/plugins/languageclient/languageclientsettings.h b/src/plugins/languageclient/languageclientsettings.h index 9d32d9e6d76..a19219d21d5 100644 --- a/src/plugins/languageclient/languageclientsettings.h +++ b/src/plugins/languageclient/languageclientsettings.h @@ -79,8 +79,8 @@ public: virtual bool isValid() const; Client *createClient() const; Client *createClient(ProjectExplorer::Project *project) const; - virtual Utils::Storage toMap() const; - virtual void fromMap(const Utils::Storage &map); + virtual Utils::Store toMap() const; + virtual void fromMap(const Utils::Store &map); protected: virtual BaseClientInterface *createInterface(ProjectExplorer::Project *) const; @@ -108,8 +108,8 @@ public: QWidget *createSettingsWidget(QWidget *parent = nullptr) const override; BaseSettings *copy() const override { return new StdIOSettings(*this); } bool isValid() const override; - Utils::Storage toMap() const override; - void fromMap(const Utils::Storage &map) override; + Utils::Store toMap() const override; + void fromMap(const Utils::Store &map) override; QString arguments() const; Utils::CommandLine command() const; diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp index 0255bc282fa..b6c58a1f716 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp @@ -137,14 +137,14 @@ void MesonBuildConfiguration::setParameters(const QString ¶ms) emit parametersChanged(); } -void MesonBuildConfiguration::toMap(Storage &map) const +void MesonBuildConfiguration::toMap(Store &map) const { ProjectExplorer::BuildConfiguration::toMap(map); map[Constants::BuildConfiguration::BUILD_TYPE_KEY] = mesonBuildTypeName(m_buildType); map[Constants::BuildConfiguration::PARAMETERS_KEY] = m_parameters; } -void MesonBuildConfiguration::fromMap(const Storage &map) +void MesonBuildConfiguration::fromMap(const Store &map) { ProjectExplorer::BuildConfiguration::fromMap(map); m_buildSystem = new MesonBuildSystem{this}; diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h index cdd4465e477..278722fea73 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h +++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.h @@ -30,8 +30,8 @@ signals: void parametersChanged(); private: - void toMap(Utils::Storage &map) const override; - void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Store &map) const override; + void fromMap(const Utils::Store &map) override; MesonBuildType m_buildType; ProjectExplorer::NamedWidget *createConfigWidget() final; diff --git a/src/plugins/mesonprojectmanager/ninjabuildstep.cpp b/src/plugins/mesonprojectmanager/ninjabuildstep.cpp index ec63aa01b8b..59d10acd2ba 100644 --- a/src/plugins/mesonprojectmanager/ninjabuildstep.cpp +++ b/src/plugins/mesonprojectmanager/ninjabuildstep.cpp @@ -199,14 +199,14 @@ void NinjaBuildStep::setCommandArgs(const QString &args) m_commandArgs = args.trimmed(); } -void NinjaBuildStep::toMap(Storage &map) const +void NinjaBuildStep::toMap(Store &map) const { AbstractProcessStep::toMap(map); map.insert(TARGETS_KEY, m_targetName); map.insert(TOOL_ARGUMENTS_KEY, m_commandArgs); } -void NinjaBuildStep::fromMap(const Storage &map) +void NinjaBuildStep::fromMap(const Store &map) { m_targetName = map.value(TARGETS_KEY).toString(); m_commandArgs = map.value(TOOL_ARGUMENTS_KEY).toString(); diff --git a/src/plugins/mesonprojectmanager/ninjabuildstep.h b/src/plugins/mesonprojectmanager/ninjabuildstep.h index aa2eeefba59..fd8b21334ae 100644 --- a/src/plugins/mesonprojectmanager/ninjabuildstep.h +++ b/src/plugins/mesonprojectmanager/ninjabuildstep.h @@ -26,8 +26,8 @@ public: Q_SIGNAL void targetListChanged(); Q_SIGNAL void commandChanged(); - void toMap(Utils::Storage &map) const override; - void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Store &map) const override; + void fromMap(const Utils::Store &map) override; private: void update(bool parsingSuccessful); diff --git a/src/plugins/nim/project/nimblebuildconfiguration.cpp b/src/plugins/nim/project/nimblebuildconfiguration.cpp index 2df654cb414..a0efe78fa7b 100644 --- a/src/plugins/nim/project/nimblebuildconfiguration.cpp +++ b/src/plugins/nim/project/nimblebuildconfiguration.cpp @@ -37,13 +37,13 @@ BuildConfiguration::BuildType NimbleBuildConfiguration::buildType() const return m_buildType; } -void NimbleBuildConfiguration::fromMap(const Storage &map) +void NimbleBuildConfiguration::fromMap(const Store &map) { m_buildType = static_cast<BuildType>(map[Constants::C_NIMBLEBUILDCONFIGURATION_BUILDTYPE].toInt()); BuildConfiguration::fromMap(map); } -void NimbleBuildConfiguration::toMap(Storage &map) const +void NimbleBuildConfiguration::toMap(Store &map) const { BuildConfiguration::toMap(map); map[Constants::C_NIMBLEBUILDCONFIGURATION_BUILDTYPE] = buildType(); diff --git a/src/plugins/nim/project/nimblebuildconfiguration.h b/src/plugins/nim/project/nimblebuildconfiguration.h index 882dd78f1bc..4b1e9593097 100644 --- a/src/plugins/nim/project/nimblebuildconfiguration.h +++ b/src/plugins/nim/project/nimblebuildconfiguration.h @@ -18,8 +18,8 @@ class NimbleBuildConfiguration : public ProjectExplorer::BuildConfiguration BuildType buildType() const override; - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; private: void setBuildType(BuildType buildType); diff --git a/src/plugins/nim/project/nimbleproject.cpp b/src/plugins/nim/project/nimbleproject.cpp index 6c07aaad7bb..0a354832826 100644 --- a/src/plugins/nim/project/nimbleproject.cpp +++ b/src/plugins/nim/project/nimbleproject.cpp @@ -27,13 +27,13 @@ NimbleProject::NimbleProject(const Utils::FilePath &fileName) setBuildSystemCreator([] (Target *t) { return new NimbleBuildSystem(t); }); } -void NimbleProject::toMap(Storage &map) const +void NimbleProject::toMap(Store &map) const { Project::toMap(map); map[Constants::C_NIMPROJECT_EXCLUDEDFILES] = m_excludedFiles; } -Project::RestoreResult NimbleProject::fromMap(const Storage &map, QString *errorMessage) +Project::RestoreResult NimbleProject::fromMap(const Store &map, QString *errorMessage) { auto result = Project::fromMap(map, errorMessage); m_excludedFiles = map.value(Constants::C_NIMPROJECT_EXCLUDEDFILES).toStringList(); diff --git a/src/plugins/nim/project/nimbleproject.h b/src/plugins/nim/project/nimbleproject.h index 38038ca15ab..7664152c3f4 100644 --- a/src/plugins/nim/project/nimbleproject.h +++ b/src/plugins/nim/project/nimbleproject.h @@ -16,14 +16,14 @@ public: NimbleProject(const Utils::FilePath &filename); // Keep for compatibility with Qt Creator 4.10 - void toMap(Utils::Storage &map) const final; + void toMap(Utils::Store &map) const final; QStringList excludedFiles() const; void setExcludedFiles(const QStringList &excludedFiles); protected: // Keep for compatibility with Qt Creator 4.10 - RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage) final; + RestoreResult fromMap(const Utils::Store &map, QString *errorMessage) final; QStringList m_excludedFiles; }; diff --git a/src/plugins/nim/project/nimcompilerbuildstep.cpp b/src/plugins/nim/project/nimcompilerbuildstep.cpp index 2091e510246..eecd7d442c0 100644 --- a/src/plugins/nim/project/nimcompilerbuildstep.cpp +++ b/src/plugins/nim/project/nimcompilerbuildstep.cpp @@ -121,7 +121,7 @@ QWidget *NimCompilerBuildStep::createConfigWidget() return widget; } -void NimCompilerBuildStep::fromMap(const Storage &map) +void NimCompilerBuildStep::fromMap(const Store &map) { AbstractProcessStep::fromMap(map); m_userCompilerOptions = map[Constants::C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS].toString().split('|'); @@ -129,7 +129,7 @@ void NimCompilerBuildStep::fromMap(const Storage &map) m_targetNimFile = FilePath::fromString(map[Constants::C_NIMCOMPILERBUILDSTEP_TARGETNIMFILE].toString()); } -void NimCompilerBuildStep::toMap(Storage &map) const +void NimCompilerBuildStep::toMap(Store &map) const { AbstractProcessStep::toMap(map); map[Constants::C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS] = m_userCompilerOptions.join('|'); diff --git a/src/plugins/nim/project/nimcompilerbuildstep.h b/src/plugins/nim/project/nimcompilerbuildstep.h index 97b1e448f18..7de03659f18 100644 --- a/src/plugins/nim/project/nimcompilerbuildstep.h +++ b/src/plugins/nim/project/nimcompilerbuildstep.h @@ -26,8 +26,8 @@ private: void setupOutputFormatter(Utils::OutputFormatter *formatter) override; QWidget *createConfigWidget() override; - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; void updateTargetNimFile(); Utils::CommandLine commandLine(); diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp index e7f971395f1..215820818b2 100644 --- a/src/plugins/nim/project/nimproject.cpp +++ b/src/plugins/nim/project/nimproject.cpp @@ -27,14 +27,14 @@ public: Tasks projectIssues(const Kit *k) const final; // Keep for compatibility with Qt Creator 4.10 - void toMap(Storage &map) const final; + void toMap(Store &map) const final; QStringList excludedFiles() const; void setExcludedFiles(const QStringList &excludedFiles); protected: // Keep for compatibility with Qt Creator 4.10 - RestoreResult fromMap(const Storage &map, QString *errorMessage) final; + RestoreResult fromMap(const Store &map, QString *errorMessage) final; QStringList m_excludedFiles; }; @@ -63,13 +63,13 @@ Tasks NimProject::projectIssues(const Kit *k) const return result; } -void NimProject::toMap(Storage &map) const +void NimProject::toMap(Store &map) const { Project::toMap(map); map[Constants::C_NIMPROJECT_EXCLUDEDFILES] = m_excludedFiles; } -Project::RestoreResult NimProject::fromMap(const Storage &map, QString *errorMessage) +Project::RestoreResult NimProject::fromMap(const Store &map, QString *errorMessage) { auto result = Project::fromMap(map, errorMessage); m_excludedFiles = map.value(Constants::C_NIMPROJECT_EXCLUDEDFILES).toStringList(); diff --git a/src/plugins/nim/project/nimtoolchain.cpp b/src/plugins/nim/project/nimtoolchain.cpp index 52ac24e7767..9d264922e98 100644 --- a/src/plugins/nim/project/nimtoolchain.cpp +++ b/src/plugins/nim/project/nimtoolchain.cpp @@ -89,7 +89,7 @@ QString NimToolChain::compilerVersion() const std::get<2>(m_version)); } -void NimToolChain::fromMap(const Storage &data) +void NimToolChain::fromMap(const Store &data) { ToolChain::fromMap(data); if (hasError()) diff --git a/src/plugins/nim/project/nimtoolchain.h b/src/plugins/nim/project/nimtoolchain.h index 82f0e2d8175..f71edf44bbe 100644 --- a/src/plugins/nim/project/nimtoolchain.h +++ b/src/plugins/nim/project/nimtoolchain.h @@ -26,7 +26,7 @@ public: QList<Utils::OutputLineParser *> createOutputParsers() const final; std::unique_ptr<ProjectExplorer::ToolChainConfigWidget> createConfigurationWidget() final; - void fromMap(const Utils::Storage &data) final; + void fromMap(const Utils::Store &data) final; static bool parseVersion(const Utils::FilePath &path, std::tuple<int, int, int> &version); diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index 79d6ed033b8..42efc75da6f 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -87,7 +87,7 @@ void BuildDirectoryAspect::setProblem(const QString &description) updateProblemLabel(); } -void BuildDirectoryAspect::toMap(Storage &map) const +void BuildDirectoryAspect::toMap(Store &map) const { FilePathAspect::toMap(map); if (!d->sourceDir.isEmpty()) { @@ -96,7 +96,7 @@ void BuildDirectoryAspect::toMap(Storage &map) const } } -void BuildDirectoryAspect::fromMap(const Storage &map) +void BuildDirectoryAspect::fromMap(const Store &map) { FilePathAspect::fromMap(map); if (!d->sourceDir.isEmpty()) { diff --git a/src/plugins/projectexplorer/buildaspects.h b/src/plugins/projectexplorer/buildaspects.h index ade7c14dad5..f159cd9d37b 100644 --- a/src/plugins/projectexplorer/buildaspects.h +++ b/src/plugins/projectexplorer/buildaspects.h @@ -28,8 +28,8 @@ public: static Utils::FilePath fixupDir(const Utils::FilePath &dir); private: - void toMap(Utils::Storage &map) const override; - void fromMap(const Utils::Storage &map) override; + void toMap(Utils::Store &map) const override; + void fromMap(const Utils::Store &map) override; void updateProblemLabel(); diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 83710cae525..34738201266 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -372,7 +372,7 @@ void BuildConfiguration::appendInitialCleanStep(Utils::Id id) d->m_initialCleanSteps.append(id); } -void BuildConfiguration::toMap(Storage &map) const +void BuildConfiguration::toMap(Store &map) const { ProjectConfiguration::toMap(map); @@ -388,7 +388,7 @@ void BuildConfiguration::toMap(Storage &map) const map.insert(CUSTOM_PARSERS_KEY, transform(d->m_customParsers,&Utils::Id::toSetting)); } -void BuildConfiguration::fromMap(const Storage &map) +void BuildConfiguration::fromMap(const Store &map) { d->m_clearSystemEnvironment = map.value(QLatin1String(Constants::CLEAR_SYSTEM_ENVIRONMENT_KEY)) .toBool(); diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index cc37e391967..6ccb5188c52 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -68,8 +68,8 @@ public: void appendInitialBuildStep(Utils::Id id); void appendInitialCleanStep(Utils::Id id); - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; bool isEnabled() const; QString disabledReason() const; @@ -149,7 +149,7 @@ public: BuildConfiguration *create(Target *parent, const BuildInfo &info) const; - static BuildConfiguration *restore(Target *parent, const Utils::Storage &map); + static BuildConfiguration *restore(Target *parent, const Utils::Store &map); static BuildConfiguration *clone(Target *parent, const BuildConfiguration *source); static BuildConfigurationFactory *find(const Kit *k, const Utils::FilePath &projectPath); diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index f30ca9e524a..d575d9b7cc5 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -126,13 +126,13 @@ QWidget *BuildStep::createConfigWidget() return widget; } -void BuildStep::fromMap(const Storage &map) +void BuildStep::fromMap(const Store &map) { m_enabled = map.value(buildStepEnabledKey, true).toBool(); ProjectConfiguration::fromMap(map); } -void BuildStep::toMap(Storage &map) const +void BuildStep::toMap(Store &map) const { ProjectConfiguration::toMap(map); map.insert(buildStepEnabledKey, m_enabled); @@ -397,7 +397,7 @@ BuildStep *BuildStepFactory::create(BuildStepList *parent) return step; } -BuildStep *BuildStepFactory::restore(BuildStepList *parent, const Storage &map) +BuildStep *BuildStepFactory::restore(BuildStepList *parent, const Store &map) { BuildStep *bs = create(parent); if (!bs) diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 9118e34db90..0f8b762f313 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -40,8 +40,8 @@ protected: public: virtual bool init() = 0; - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; bool enabled() const; void setEnabled(bool b); @@ -137,7 +137,7 @@ public: BuildStep::Flags stepFlags() const; Utils::Id stepId() const; BuildStep *create(BuildStepList *parent); - BuildStep *restore(BuildStepList *parent, const Utils::Storage &map); + BuildStep *restore(BuildStepList *parent, const Utils::Store &map); bool canHandle(BuildStepList *bsl) const; diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index 2895b7925e2..085f0cd9bb8 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -43,9 +43,9 @@ Target *BuildStepList::target() const return m_projectConfiguration->target(); } -Storage BuildStepList::toMap() const +Store BuildStepList::toMap() const { - Storage map; + Store map; { // Only written for compatibility reasons within the 4.11 cycle @@ -60,7 +60,7 @@ Storage BuildStepList::toMap() const // Save build steps map.insert(QString::fromLatin1(STEPS_COUNT_KEY), m_steps.count()); for (int i = 0; i < m_steps.count(); ++i) { - Storage data; + Store data; m_steps.at(i)->toMap(data); map.insert(QString::fromLatin1(STEPS_PREFIX) + QString::number(i), data); } @@ -103,7 +103,7 @@ QString BuildStepList::displayName() const return {}; } -bool BuildStepList::fromMap(const Storage &map) +bool BuildStepList::fromMap(const Store &map) { clear(); @@ -111,7 +111,7 @@ bool BuildStepList::fromMap(const Storage &map) int maxSteps = map.value(QString::fromLatin1(STEPS_COUNT_KEY), 0).toInt(); for (int i = 0; i < maxSteps; ++i) { - Storage bsData(map.value(QString::fromLatin1(STEPS_PREFIX) + QString::number(i)).toMap()); + Store bsData(map.value(QString::fromLatin1(STEPS_PREFIX) + QString::number(i)).toMap()); if (bsData.isEmpty()) { qWarning() << "No step data found for" << i << "(continuing)."; continue; diff --git a/src/plugins/projectexplorer/buildsteplist.h b/src/plugins/projectexplorer/buildsteplist.h index 6af0fc54372..0e1f68e4203 100644 --- a/src/plugins/projectexplorer/buildsteplist.h +++ b/src/plugins/projectexplorer/buildsteplist.h @@ -6,7 +6,7 @@ #include "projectexplorer_export.h" #include <utils/id.h> -#include <utils/storage.h> +#include <utils/store.h> #include <QObject> @@ -60,8 +60,8 @@ public: ProjectConfiguration *projectConfiguration() const { return m_projectConfiguration; } Target *target() const; - Utils::Storage toMap() const; - bool fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + bool fromMap(const Utils::Store &map); Utils::Id id() const { return m_id; } QString displayName() const; diff --git a/src/plugins/projectexplorer/customparser.cpp b/src/plugins/projectexplorer/customparser.cpp index d406f0cf240..6b3c2d42d8e 100644 --- a/src/plugins/projectexplorer/customparser.cpp +++ b/src/plugins/projectexplorer/customparser.cpp @@ -103,7 +103,7 @@ QVariantMap CustomParserExpression::toMap() const return map; } -void CustomParserExpression::fromMap(const Storage &map) +void CustomParserExpression::fromMap(const Store &map) { setPattern(map.value(patternKey).toString()); setMessageCap(map.value(messageCapKey).toInt()); @@ -149,7 +149,7 @@ QVariantMap CustomParserSettings::toMap() const return map; } -void CustomParserSettings::fromMap(const Storage &map) +void CustomParserSettings::fromMap(const Store &map) { id = Utils::Id::fromSetting(map.value(idKey)); displayName = map.value(nameKey).toString(); @@ -173,12 +173,12 @@ CustomParsersAspect::CustomParsersAspect(Target *target) }); } -void CustomParsersAspect::fromMap(const Storage &map) +void CustomParsersAspect::fromMap(const Store &map) { m_parsers = transform(map.value(settingsKey()).toList(), &Utils::Id::fromSetting); } -void CustomParsersAspect::toMap(Storage &map) const +void CustomParsersAspect::toMap(Store &map) const { map.insert(settingsKey(), transform(m_parsers, &Utils::Id::toSetting)); } diff --git a/src/plugins/projectexplorer/customparser.h b/src/plugins/projectexplorer/customparser.h index de49bc00993..2416a6bed1f 100644 --- a/src/plugins/projectexplorer/customparser.h +++ b/src/plugins/projectexplorer/customparser.h @@ -44,8 +44,8 @@ public: int messageCap() const; void setMessageCap(int messageCap); - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); private: QRegularExpression m_regExp; @@ -62,8 +62,8 @@ public: bool operator ==(const CustomParserSettings &other) const; bool operator !=(const CustomParserSettings &other) const { return !operator==(other); } - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); Utils::Id id; QString displayName; @@ -86,8 +86,8 @@ public: }; private: - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; QList<Utils::Id> m_parsers; }; diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp index 0e101b66e33..302692c167e 100644 --- a/src/plugins/projectexplorer/customtoolchain.cpp +++ b/src/plugins/projectexplorer/customtoolchain.cpp @@ -77,8 +77,8 @@ public: QStringList headerPathsList() const; void setHeaderPaths(const QStringList &list); - void toMap(Storage &data) const override; - void fromMap(const Storage &data) override; + void toMap(Store &data) const override; + void fromMap(const Store &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; @@ -271,7 +271,7 @@ QString CustomToolChain::mkspecs() const return m_mkspecs.join(','); } -void CustomToolChain::toMap(Storage &data) const +void CustomToolChain::toMap(Store &data) const { ToolChain::toMap(data); data.insert(QLatin1String(makeCommandKeyC), m_makeCommand.toString()); @@ -283,7 +283,7 @@ void CustomToolChain::toMap(Storage &data) const data.insert(QLatin1String(outputParserKeyC), m_outputParserId.toSetting()); } -void CustomToolChain::fromMap(const Storage &data) +void CustomToolChain::fromMap(const Store &data) { ToolChain::fromMap(data); if (hasError()) diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp index 6fddd289e05..a5e8d16738c 100644 --- a/src/plugins/projectexplorer/deployconfiguration.cpp +++ b/src/plugins/projectexplorer/deployconfiguration.cpp @@ -50,13 +50,13 @@ QWidget *DeployConfiguration::createConfigWidget() return m_configWidgetCreator(this); } -void DeployConfiguration::toMap(Storage &map) const +void DeployConfiguration::toMap(Store &map) const { ProjectConfiguration::toMap(map); map.insert(QLatin1String(BUILD_STEP_LIST_COUNT), 1); map.insert(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1Char('0'), m_stepList.toMap()); map.insert(USES_DEPLOYMENT_DATA, usesCustomDeploymentData()); - Storage deployData; + Store deployData; for (int i = 0; i < m_customDeploymentData.fileCount(); ++i) { const DeployableFile &f = m_customDeploymentData.fileAt(i); deployData.insert(f.localFilePath().toString(), f.remoteDirectory()); @@ -64,7 +64,7 @@ void DeployConfiguration::toMap(Storage &map) const map.insert(DEPLOYMENT_DATA, deployData); } -void DeployConfiguration::fromMap(const Storage &map) +void DeployConfiguration::fromMap(const Store &map) { ProjectConfiguration::fromMap(map); if (hasError()) @@ -75,7 +75,7 @@ void DeployConfiguration::fromMap(const Storage &map) reportError(); return; } - Storage data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1Char('0')).toMap(); + Store data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1Char('0')).toMap(); if (!data.isEmpty()) { m_stepList.clear(); if (!m_stepList.fromMap(data)) { @@ -91,7 +91,7 @@ void DeployConfiguration::fromMap(const Storage &map) } m_usesCustomDeploymentData = map.value(USES_DEPLOYMENT_DATA, false).toBool(); - const Storage deployData = map.value(DEPLOYMENT_DATA).toMap(); + const Store deployData = map.value(DEPLOYMENT_DATA).toMap(); for (auto it = deployData.begin(); it != deployData.end(); ++it) m_customDeploymentData.addFile(FilePath::fromString(it.key()), it.value().toString()); } @@ -188,12 +188,12 @@ DeployConfiguration *DeployConfigurationFactory::create(Target *parent) DeployConfiguration *DeployConfigurationFactory::clone(Target *parent, const DeployConfiguration *source) { - Storage map; + Store map; source->toMap(map); return restore(parent, map); } -DeployConfiguration *DeployConfigurationFactory::restore(Target *parent, const Storage &map) +DeployConfiguration *DeployConfigurationFactory::restore(Target *parent, const Store &map) { const Id id = idFromMap(map); DeployConfigurationFactory *factory = Utils::findOrDefault(g_deployConfigurationFactories, diff --git a/src/plugins/projectexplorer/deployconfiguration.h b/src/plugins/projectexplorer/deployconfiguration.h index 599e424f3cf..a3ebac85b89 100644 --- a/src/plugins/projectexplorer/deployconfiguration.h +++ b/src/plugins/projectexplorer/deployconfiguration.h @@ -31,8 +31,8 @@ public: QWidget *createConfigWidget(); - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; bool isActive() const; @@ -66,7 +66,7 @@ public: DeployConfiguration *create(Target *parent); static const QList<DeployConfigurationFactory *> find(Target *parent); - static DeployConfiguration *restore(Target *parent, const Utils::Storage &map); + static DeployConfiguration *restore(Target *parent, const Utils::Store &map); static DeployConfiguration *clone(Target *parent, const DeployConfiguration *dc); void addSupportedTargetDeviceType(Utils::Id id); @@ -81,7 +81,7 @@ public: void setConfigWidgetCreator(const DeployConfiguration::WidgetCreator &configWidgetCreator); void setUseDeploymentDataView(); - using PostRestore = std::function<void(DeployConfiguration *dc, const Utils::Storage &)>; + using PostRestore = std::function<void(DeployConfiguration *dc, const Utils::Store &)>; void setPostRestore(const PostRestore &postRestore) { m_postRestore = postRestore; } PostRestore postRestore() const { return m_postRestore; } diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 65285e9d9e1..9f6c2a408f3 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -129,7 +129,7 @@ FilePath DesktopDevice::rootPath() const return IDevice::rootPath(); } -void DesktopDevice::fromMap(const Storage &map) +void DesktopDevice::fromMap(const Store &map) { IDevice::fromMap(map); diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.h b/src/plugins/projectexplorer/devicesupport/desktopdevice.h index 71fff98d102..fd9b81f123c 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.h @@ -36,7 +36,7 @@ public: Utils::FilePath rootPath() const override; Utils::FilePath filePath(const QString &pathOnDevice) const override; - void fromMap(const Utils::Storage &map) override; + void fromMap(const Utils::Store &map) override; protected: DesktopDevice(); diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index bf12dc56416..1934dbceee2 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -204,7 +204,7 @@ static const IDeviceFactory *restoreFactory(const QVariantMap &map) return factory; } -QList<IDevice::Ptr> DeviceManager::fromMap(const Storage &map, QHash<Id, Id> *defaultDevices) +QList<IDevice::Ptr> DeviceManager::fromMap(const Store &map, QHash<Id, Id> *defaultDevices) { QList<IDevice::Ptr> devices; diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.h b/src/plugins/projectexplorer/devicesupport/devicemanager.h index 2f5aa0ea45d..ab1b1b3af22 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.h +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.h @@ -65,8 +65,8 @@ private: DeviceManager(bool isInstance = true); void load(); - QList<IDevice::Ptr> fromMap(const Utils::Storage &map, QHash<Utils::Id, Utils::Id> *defaultDevices); - Utils::Storage toMap() const; + QList<IDevice::Ptr> fromMap(const Utils::Store &map, QHash<Utils::Id, Utils::Id> *defaultDevices); + Utils::Store toMap() const; // For SettingsWidget. IDevice::Ptr mutableDevice(Utils::Id id) const; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 3fe494eaa24..6ce9949efaf 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -146,7 +146,7 @@ public: QList<Icon> deviceIcons; QList<IDevice::DeviceAction> deviceActions; - Storage extraData; + Store extraData; IDevice::OpenTerminal openTerminal; }; } // namespace Internal @@ -420,12 +420,12 @@ void IDevice::setDeviceState(const IDevice::DeviceState state) d->deviceState = state; } -Id IDevice::typeFromMap(const Storage &map) +Id IDevice::typeFromMap(const Store &map) { return Id::fromSetting(map.value(QLatin1String(TypeKey))); } -Id IDevice::idFromMap(const Storage &map) +Id IDevice::idFromMap(const Store &map) { return Id::fromSetting(map.value(QLatin1String(IdKey))); } @@ -436,7 +436,7 @@ Id IDevice::idFromMap(const Storage &map) base class implementation. */ -void IDevice::fromMap(const Storage &map) +void IDevice::fromMap(const Store &map) { d->type = typeFromMap(map); d->displayName.fromMap(map, DisplayNameKey); @@ -485,7 +485,7 @@ void IDevice::fromMap(const Storage &map) call the base class implementation. */ -Storage IDevice::toMap() const +Store IDevice::toMap() const { QVariantMap map; d->displayName.toMap(map, DisplayNameKey); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index d34e49cd6c2..070eda339b7 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -12,7 +12,7 @@ #include <utils/expected.h> #include <utils/filepath.h> #include <utils/hostosinfo.h> -#include <utils/storage.h> +#include <utils/store.h> #include <QAbstractSocket> #include <QCoreApplication> @@ -150,8 +150,8 @@ public: void setDeviceState(const DeviceState state); QString deviceStateToString() const; - static Utils::Id typeFromMap(const Utils::Storage &map); - static Utils::Id idFromMap(const Utils::Storage &map); + static Utils::Id typeFromMap(const Utils::Store &map); + static Utils::Id idFromMap(const Utils::Store &map); static QString defaultPrivateKeyFilePath(); static QString defaultPublicKeyFilePath(); @@ -218,8 +218,8 @@ public: protected: IDevice(); - virtual void fromMap(const Utils::Storage &map); - virtual Utils::Storage toMap() const; + virtual void fromMap(const Utils::Store &map); + virtual Utils::Store toMap() const; using OpenTerminal = std::function<void(const Utils::Environment &, const Utils::FilePath &)>; void setOpenTerminal(const OpenTerminal &openTerminal); diff --git a/src/plugins/projectexplorer/devicesupport/idevicefactory.h b/src/plugins/projectexplorer/devicesupport/idevicefactory.h index c6af716ad73..8921128d808 100644 --- a/src/plugins/projectexplorer/devicesupport/idevicefactory.h +++ b/src/plugins/projectexplorer/devicesupport/idevicefactory.h @@ -8,7 +8,7 @@ #include <projectexplorer/projectexplorer_export.h> #include <utils/id.h> -#include <utils/storage.h> +#include <utils/store.h> #include <QIcon> @@ -30,7 +30,7 @@ public: IDevicePtr create() const; bool quickCreationAllowed() const; - virtual bool canRestore(const Utils::Storage &) const { return true; } + virtual bool canRestore(const Utils::Store &) const { return true; } static IDeviceFactory *find(Utils::Id type); diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index 3642ec90a2c..d0a3473d7df 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -195,7 +195,7 @@ QVariantMap EditorConfiguration::toMap() const return map; } -void EditorConfiguration::fromMap(const Storage &map) +void EditorConfiguration::fromMap(const Store &map) { const QByteArray &codecName = map.value(kCodec, d->m_textCodec->name()).toByteArray(); d->m_textCodec = QTextCodec::codecForName(codecName); diff --git a/src/plugins/projectexplorer/editorconfiguration.h b/src/plugins/projectexplorer/editorconfiguration.h index cee0d8e5e94..8b5aab4230a 100644 --- a/src/plugins/projectexplorer/editorconfiguration.h +++ b/src/plugins/projectexplorer/editorconfiguration.h @@ -6,7 +6,7 @@ #include "projectexplorer_export.h" #include <utils/id.h> -#include <utils/storage.h> +#include <utils/store.h> #include <QObject> @@ -64,8 +64,8 @@ public: void configureEditor(TextEditor::BaseTextEditor *textEditor) const; void deconfigureEditor(TextEditor::BaseTextEditor *textEditor) const; - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); void setTypingSettings(const TextEditor::TypingSettings &settings); void setStorageSettings(const TextEditor::StorageSettings &settings); diff --git a/src/plugins/projectexplorer/environmentaspect.cpp b/src/plugins/projectexplorer/environmentaspect.cpp index cc6a2d79b4d..a083e545a3c 100644 --- a/src/plugins/projectexplorer/environmentaspect.cpp +++ b/src/plugins/projectexplorer/environmentaspect.cpp @@ -133,14 +133,14 @@ void EnvironmentAspect::setSupportForBuildEnvironment(Target *target) this, &EnvironmentAspect::environmentChanged); } -void EnvironmentAspect::fromMap(const Storage &map) +void EnvironmentAspect::fromMap(const Store &map) { m_base = map.value(QLatin1String(BASE_KEY), -1).toInt(); m_userChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(CHANGES_KEY)).toStringList()); m_printOnRun = map.value(PRINT_ON_RUN_KEY).toBool(); } -void EnvironmentAspect::toMap(Storage &data) const +void EnvironmentAspect::toMap(Store &data) const { data.insert(QLatin1String(BASE_KEY), m_base); data.insert(QLatin1String(CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_userChanges)); diff --git a/src/plugins/projectexplorer/environmentaspect.h b/src/plugins/projectexplorer/environmentaspect.h index 9fd8ccacbba..6e36d7db63b 100644 --- a/src/plugins/projectexplorer/environmentaspect.h +++ b/src/plugins/projectexplorer/environmentaspect.h @@ -9,7 +9,7 @@ #include <utils/aspects.h> #include <utils/environment.h> -#include <utils/storage.h> +#include <utils/store.h> namespace ProjectExplorer { @@ -71,8 +71,8 @@ signals: void environmentChanged(); protected: - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; void setIsLocal(bool local) { m_isLocal = local; } void setAllowPrintOnRun(bool allow) { m_allowPrintOnRun = allow; } diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index eb1deadaae9..5302d8f0fe1 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -795,7 +795,7 @@ QStringList GccToolChain::platformLinkerFlags() const return m_platformLinkerFlags; } -void GccToolChain::toMap(Storage &data) const +void GccToolChain::toMap(Store &data) const { ToolChain::toMap(data); data.insert(compilerPlatformCodeGenFlagsKeyC, m_platformCodeGenFlags); @@ -804,7 +804,7 @@ void GccToolChain::toMap(Storage &data) const data.insert(supportedAbisKeyC, Utils::transform<QStringList>(m_supportedAbis, &Abi::toString)); } -void GccToolChain::fromMap(const Storage &data) +void GccToolChain::fromMap(const Store &data) { ToolChain::fromMap(data); if (hasError()) @@ -1711,14 +1711,14 @@ std::unique_ptr<ToolChainConfigWidget> ClangToolChain::createConfigurationWidget return std::make_unique<ClangToolChainConfigWidget>(this); } -void ClangToolChain::toMap(Storage &data) const +void ClangToolChain::toMap(Store &data) const { GccToolChain::toMap(data); data.insert(parentToolChainIdKeyC, m_parentToolChainId); data.insert(priorityKeyC, m_priority); } -void ClangToolChain::fromMap(const Storage &data) +void ClangToolChain::fromMap(const Store &data) { GccToolChain::fromMap(data); if (hasError()) diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index d46af2471f7..04a395c8188 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -66,8 +66,8 @@ public: QStringList suggestedMkspecList() const override; QList<Utils::OutputLineParser *> createOutputParsers() const override; - void toMap(Utils::Storage &data) const override; - void fromMap(const Utils::Storage &data) override; + void toMap(Utils::Store &data) const override; + void fromMap(const Utils::Store &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; @@ -207,8 +207,8 @@ public: std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; - void toMap(Utils::Storage &data) const override; - void fromMap(const Utils::Storage &data) override; + void toMap(Utils::Store &data) const override; + void fromMap(const Utils::Store &data) override; void setPriority(int priority) { m_priority = priority; } int priority() const override { return m_priority; } diff --git a/src/plugins/projectexplorer/kit.h b/src/plugins/projectexplorer/kit.h index ea8f04ea1c4..e2eb4f3a754 100644 --- a/src/plugins/projectexplorer/kit.h +++ b/src/plugins/projectexplorer/kit.h @@ -8,7 +8,7 @@ #include <coreplugin/featureprovider.h> -#include <utils/storage.h> +#include <utils/store.h> #include <QSet> @@ -139,7 +139,7 @@ private: void kitUpdated(); - Utils::Storage toMap() const; + Utils::Store toMap() const; const std::unique_ptr<Internal::KitPrivate> d; diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 2e3dee898b2..e8f3292217a 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -978,7 +978,7 @@ Abis MsvcToolChain::supportedAbis() const return abis; } -void MsvcToolChain::toMap(Storage &data) const +void MsvcToolChain::toMap(Store &data) const { ToolChain::toMap(data); data.insert(QLatin1String(varsBatKeyC), m_vcvarsBat); @@ -989,7 +989,7 @@ void MsvcToolChain::toMap(Storage &data) const Utils::EnvironmentItem::toVariantList(m_environmentModifications)); } -void MsvcToolChain::fromMap(const Storage &data) +void MsvcToolChain::fromMap(const Store &data) { ToolChain::fromMap(data); if (hasError()) { @@ -1727,13 +1727,13 @@ static inline QString llvmDirKey() return QStringLiteral("ProjectExplorer.ClangClToolChain.LlvmDir"); } -void ClangClToolChain::toMap(Storage &data) const +void ClangClToolChain::toMap(Store &data) const { MsvcToolChain::toMap(data); data.insert(llvmDirKey(), m_clangPath.toString()); } -void ClangClToolChain::fromMap(const Storage &data) +void ClangClToolChain::fromMap(const Store &data) { MsvcToolChain::fromMap(data); if (hasError()) diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index 79ecdc21c30..cfe2d4d7d9e 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -46,8 +46,8 @@ public: QStringList suggestedMkspecList() const override; Abis supportedAbis() const override; - void toMap(Utils::Storage &data) const override; - void fromMap(const Utils::Storage &data) override; + void toMap(Utils::Store &data) const override; + void fromMap(const Utils::Store &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; bool hostPrefersToolchain() const override; @@ -146,8 +146,8 @@ public: void addToEnvironment(Utils::Environment &env) const override; Utils::FilePath compilerCommand() const override; // FIXME: Remove QList<Utils::OutputLineParser *> createOutputParsers() const override; - void toMap(Utils::Storage &data) const override; - void fromMap(const Utils::Storage &data) override; + void toMap(Utils::Store &data) const override; + void fromMap(const Utils::Store &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner( const Utils::Environment &env) const override; diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index af61ba60a49..e47a26a3dfb 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -691,7 +691,7 @@ FilePaths Project::files(const NodeMatcher &filter) const creating new build configurations. */ -void Project::toMap(Storage &map) const +void Project::toMap(Store &map) const { const QList<Target *> ts = targets(); @@ -764,7 +764,7 @@ ContainerNode *Project::containerNode() const return d->m_containerNode.get(); } -Project::RestoreResult Project::fromMap(const Storage &map, QString *errorMessage) +Project::RestoreResult Project::fromMap(const Store &map, QString *errorMessage) { Q_UNUSED(errorMessage) if (map.contains(QLatin1String(EDITOR_SETTINGS_KEY))) { diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 61df7925ce4..468303670f5 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -12,7 +12,7 @@ #include <utils/environmentfwd.h> #include <utils/filepath.h> -#include <utils/storage.h> +#include <utils/store.h> #include <QFileSystemModel> @@ -112,7 +112,7 @@ public: const NodeMatcher &extraMatcher = {}) const; Utils::FilePaths binariesForSourceFile(const Utils::FilePath &sourceFile) const; - virtual void toMap(Utils::Storage &map) const; + virtual void toMap(Utils::Store &map) const; Core::Context projectContext() const; Core::Context projectLanguages() const; @@ -205,7 +205,7 @@ signals: #endif protected: - virtual RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage); + virtual RestoreResult fromMap(const Utils::Store &map, QString *errorMessage); void createTargetFromMap(const QVariantMap &map, int index); virtual bool setupTarget(Target *t); diff --git a/src/plugins/projectexplorer/projectconfiguration.cpp b/src/plugins/projectexplorer/projectconfiguration.cpp index f7fe5fdba07..5609bf9bbe1 100644 --- a/src/plugins/projectexplorer/projectconfiguration.cpp +++ b/src/plugins/projectexplorer/projectconfiguration.cpp @@ -72,7 +72,7 @@ QString ProjectConfiguration::toolTip() const return m_toolTip; } -void ProjectConfiguration::toMap(Storage &map) const +void ProjectConfiguration::toMap(Store &map) const { QTC_CHECK(m_id.isValid()); map.insert(QLatin1String(CONFIGURATION_ID_KEY), m_id.toSetting()); @@ -85,7 +85,7 @@ Target *ProjectConfiguration::target() const return m_target; } -void ProjectConfiguration::fromMap(const Storage &map) +void ProjectConfiguration::fromMap(const Store &map) { Utils::Id id = Utils::Id::fromSetting(map.value(QLatin1String(CONFIGURATION_ID_KEY))); // Note: This is only "startsWith", not ==, as RunConfigurations currently still diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h index debad33196f..ad3ecfcc901 100644 --- a/src/plugins/projectexplorer/projectconfiguration.h +++ b/src/plugins/projectexplorer/projectconfiguration.h @@ -8,7 +8,7 @@ #include <utils/aspects.h> #include <utils/displayname.h> #include <utils/id.h> -#include <utils/storage.h> +#include <utils/store.h> #include <QPointer> #include <QWidget> @@ -45,9 +45,9 @@ public: bool hasError() const { return m_hasError; } // Note: Make sure subclasses call the superclasses' fromMap() function! - virtual void fromMap(const Utils::Storage &map) override; + virtual void fromMap(const Utils::Store &map) override; // Note: Make sure subclasses call the superclasses' toMap() function! - virtual void toMap(Utils::Storage &map) const override; + virtual void toMap(Utils::Store &map) const override; Target *target() const; Project *project() const; @@ -68,6 +68,6 @@ private: }; // helper function: -PROJECTEXPLORER_EXPORT Utils::Id idFromMap(const Utils::Storage &map); +PROJECTEXPLORER_EXPORT Utils::Id idFromMap(const Utils::Store &map); } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index f75344cf38c..36370b446d8 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -85,21 +85,21 @@ AspectContainer *GlobalOrProjectAspect::currentSettings() const return m_useGlobalSettings ? m_globalSettings : m_projectSettings; } -void GlobalOrProjectAspect::fromMap(const Storage &map) +void GlobalOrProjectAspect::fromMap(const Store &map) { if (m_projectSettings) m_projectSettings->fromMap(map); m_useGlobalSettings = map.value(id().toString() + ".UseGlobalSettings", true).toBool(); } -void GlobalOrProjectAspect::toMap(Storage &map) const +void GlobalOrProjectAspect::toMap(Store &map) const { if (m_projectSettings) m_projectSettings->toMap(map); map.insert(id().toString() + ".UseGlobalSettings", m_useGlobalSettings); } -void GlobalOrProjectAspect::toActiveMap(Storage &data) const +void GlobalOrProjectAspect::toActiveMap(Store &data) const { if (m_useGlobalSettings) m_globalSettings->toMap(data); @@ -113,7 +113,7 @@ void GlobalOrProjectAspect::toActiveMap(Storage &data) const void GlobalOrProjectAspect::resetProjectToGlobalSettings() { QTC_ASSERT(m_globalSettings, return); - Storage map; + Store map; m_globalSettings->toMap(map); if (m_projectSettings) m_projectSettings->fromMap(map); @@ -226,7 +226,7 @@ bool RunConfiguration::isCustomized() const { if (m_customized) return true; - Storage state; + Store state; toMapSimple(state); // TODO: Why do we save this at all? It's a computed value. @@ -257,9 +257,9 @@ void RunConfiguration::addAspectFactory(const AspectFactory &aspectFactory) theAspectFactories.push_back(aspectFactory); } -QMap<Id, Storage> RunConfiguration::settingsData() const +QMap<Id, Store> RunConfiguration::settingsData() const { - QMap<Id, Storage> data; + QMap<Id, Store> data; for (BaseAspect *aspect : *this) aspect->toActiveMap(data[aspect->id()]); return data; @@ -288,13 +288,13 @@ Task RunConfiguration::createConfigurationIssue(const QString &description) cons return BuildSystemTask(Task::Error, description); } -void RunConfiguration::toMap(Storage &map) const +void RunConfiguration::toMap(Store &map) const { toMapSimple(map); map.insert(CUSTOMIZED_KEY, isCustomized()); } -void RunConfiguration::toMapSimple(Storage &map) const +void RunConfiguration::toMapSimple(Store &map) const { ProjectConfiguration::toMap(map); map.insert(BUILD_KEY, m_buildKey); @@ -355,7 +355,7 @@ ProjectNode *RunConfiguration::productNode() const }); } -void RunConfiguration::fromMap(const Storage &map) +void RunConfiguration::fromMap(const Store &map) { ProjectConfiguration::fromMap(map); if (hasError()) @@ -611,7 +611,7 @@ RunConfiguration *RunConfigurationCreationInfo::create(Target *target) const return rc; } -RunConfiguration *RunConfigurationFactory::restore(Target *parent, const Storage &map) +RunConfiguration *RunConfigurationFactory::restore(Target *parent, const Store &map) { for (RunConfigurationFactory *factory : std::as_const(g_runConfigurationFactories)) { if (factory->canHandle(parent)) { @@ -634,7 +634,7 @@ RunConfiguration *RunConfigurationFactory::restore(Target *parent, const Storage RunConfiguration *RunConfigurationFactory::clone(Target *parent, RunConfiguration *source) { - Storage map; + Store map; source->toMap(map); return restore(parent, map); } diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 520b26f000c..85c770a5d36 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -60,9 +60,9 @@ public: protected: friend class RunConfiguration; - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &data) const override; - void toActiveMap(Utils::Storage &data) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &data) const override; + void toActiveMap(Utils::Store &data) const override; private: bool m_useGlobalSettings = false; @@ -122,7 +122,7 @@ public: addAspectFactory([](Target *target) { return new T(target); }); } - QMap<Utils::Id, Utils::Storage> settingsData() const; // FIXME: Merge into aspectData? + QMap<Utils::Id, Utils::Store> settingsData() const; // FIXME: Merge into aspectData? Utils::AspectContainerData aspectData() const; void update(); @@ -145,9 +145,9 @@ protected: private: // Any additional data should be handled by aspects. - void fromMap(const Utils::Storage &map) final; - void toMap(Utils::Storage &map) const final; - void toMapSimple(Utils::Storage &map) const; + void fromMap(const Utils::Store &map) final; + void toMap(Utils::Store &map) const final; + void toMapSimple(Utils::Store &map) const; static void addAspectFactory(const AspectFactory &aspectFactory); @@ -160,7 +160,7 @@ private: RunnableModifier m_runnableModifier; Updater m_updater; Utils::MacroExpander m_expander; - Utils::Storage m_pristineState; + Utils::Store m_pristineState; bool m_customized = false; }; @@ -187,7 +187,7 @@ public: RunConfigurationFactory operator=(const RunConfigurationFactory &) = delete; virtual ~RunConfigurationFactory(); - static RunConfiguration *restore(Target *parent, const Utils::Storage &map); + static RunConfiguration *restore(Target *parent, const Utils::Store &map); static RunConfiguration *clone(Target *parent, RunConfiguration *source); static const QList<RunConfigurationCreationInfo> creatorsForTarget(Target *parent); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 36f6ebd2722..72149ae7b39 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -80,7 +80,7 @@ void TerminalAspect::addToLayout(LayoutItem &parent) /*! \reimp */ -void TerminalAspect::fromMap(const Storage &map) +void TerminalAspect::fromMap(const Store &map) { if (map.contains(settingsKey())) { m_useTerminal = map.value(settingsKey()).toBool(); @@ -96,7 +96,7 @@ void TerminalAspect::fromMap(const Storage &map) /*! \reimp */ -void TerminalAspect::toMap(Storage &data) const +void TerminalAspect::toMap(Store &data) const { if (m_userSet) data.insert(settingsKey(), m_useTerminal); @@ -214,7 +214,7 @@ void WorkingDirectoryAspect::resetPath() /*! \reimp */ -void WorkingDirectoryAspect::fromMap(const Storage &map) +void WorkingDirectoryAspect::fromMap(const Store &map) { m_workingDirectory = FilePath::fromString(map.value(settingsKey()).toString()); m_defaultWorkingDirectory = FilePath::fromString(map.value(settingsKey() + ".default").toString()); @@ -229,7 +229,7 @@ void WorkingDirectoryAspect::fromMap(const Storage &map) /*! \reimp */ -void WorkingDirectoryAspect::toMap(Storage &data) const +void WorkingDirectoryAspect::toMap(Store &data) const { const QString wd = m_workingDirectory == m_defaultWorkingDirectory ? QString() : m_workingDirectory.toString(); @@ -397,7 +397,7 @@ void ArgumentsAspect::resetArguments() /*! \reimp */ -void ArgumentsAspect::fromMap(const Storage &map) +void ArgumentsAspect::fromMap(const Store &map) { QVariant args = map.value(settingsKey()); // Until 3.7 a QStringList was stored for Remote Linux @@ -419,7 +419,7 @@ void ArgumentsAspect::fromMap(const Storage &map) /*! \reimp */ -void ArgumentsAspect::toMap(Storage &map) const +void ArgumentsAspect::toMap(Store &map) const { saveToMap(map, m_arguments, QString(), settingsKey()); saveToMap(map, m_multiLine, false, settingsKey() + ".multi"); @@ -693,7 +693,7 @@ void ExecutableAspect::setSettingsKey(const QString &key) /*! \reimp */ -void ExecutableAspect::fromMap(const Storage &map) +void ExecutableAspect::fromMap(const Store &map) { m_executable.fromMap(map); if (m_alternativeExecutable) @@ -703,7 +703,7 @@ void ExecutableAspect::fromMap(const Storage &map) /*! \reimp */ -void ExecutableAspect::toMap(Storage &map) const +void ExecutableAspect::toMap(Store &map) const { m_executable.toMap(map); if (m_alternativeExecutable) @@ -837,12 +837,12 @@ void InterpreterAspect::setCurrentInterpreter(const Interpreter &interpreter) } } -void InterpreterAspect::fromMap(const Storage &map) +void InterpreterAspect::fromMap(const Store &map) { setCurrentInterpreterId(map.value(settingsKey(), m_defaultId).toString()); } -void InterpreterAspect::toMap(Storage &map) const +void InterpreterAspect::toMap(Store &map) const { if (m_currentId != m_defaultId) saveToMap(map, m_currentId, QString(), settingsKey()); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index 9a3cb812da4..602ce39b3d4 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -43,8 +43,8 @@ public: }; private: - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; void calculateUseTerminal(); @@ -73,8 +73,8 @@ public: void setEnvironment(EnvironmentAspect *envAspect); private: - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; void resetPath(); @@ -111,8 +111,8 @@ public: }; private: - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; QWidget *setupChooser(); @@ -183,8 +183,8 @@ public: }; protected: - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; private: QString executableText() const; @@ -238,8 +238,8 @@ public: void setCurrentInterpreter(const Interpreter &interpreter); void setSettingsDialogId(Utils::Id id) { m_settingsDialogId = id; } - void fromMap(const Utils::Storage &) override; - void toMap(Utils::Storage &) const override; + void fromMap(const Utils::Store &) override; + void toMap(Utils::Store &) const override; void addToLayout(Layouting::LayoutItem &parent) override; struct Data : Utils::BaseAspect::Data { Interpreter interpreter; }; diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index df6bbbe24be..d8c459b7ad6 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -885,7 +885,7 @@ void Target::updateDeviceState() setOverlayIcon(overlay); } -bool Target::fromMap(const Storage &map) +bool Target::fromMap(const Store &map) { QTC_ASSERT(d->m_kit == KitManager::kit(id()), return false); diff --git a/src/plugins/projectexplorer/target.h b/src/plugins/projectexplorer/target.h index f43d21eba55..0b032d0577e 100644 --- a/src/plugins/projectexplorer/target.h +++ b/src/plugins/projectexplorer/target.h @@ -6,7 +6,7 @@ #include "projectexplorer_export.h" #include <utils/id.h> -#include <utils/storage.h> +#include <utils/store.h> #include <QObject> @@ -88,7 +88,7 @@ public: void setOverlayIcon(const QIcon &icon); QString overlayIconToolTip(); - Utils::Storage toMap() const; + Utils::Store toMap() const; void updateDefaultBuildConfigurations(); void updateDefaultDeployConfigurations(); @@ -146,7 +146,7 @@ signals: void deploymentDataChanged(); private: - bool fromMap(const Utils::Storage &map); + bool fromMap(const Utils::Store &map); void updateDeviceState(); diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index e055b21b2c8..861af665ec2 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -241,7 +241,7 @@ ToolChain *ToolChain::clone() const Make sure to call this function when deriving. */ -void ToolChain::toMap(Storage &result) const +void ToolChain::toMap(Store &result) const { AspectContainer::toMap(result); @@ -350,7 +350,7 @@ void ToolChain::setTypeDisplayName(const QString &typeName) Make sure to call this function when deriving. */ -void ToolChain::fromMap(const Storage &data) +void ToolChain::fromMap(const Store &data) { AspectContainer::fromMap(data); @@ -711,7 +711,7 @@ QVariantMap BadToolchain::toMap() const {badToolchainTimestampKey(), timestamp.toMSecsSinceEpoch()}}; } -BadToolchain BadToolchain::fromMap(const Storage &map) +BadToolchain BadToolchain::fromMap(const Store &map) { return { FilePath::fromSettings(map.value(badToolchainFilePathKey())), diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 21efe430fbd..e1f53787e45 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -147,7 +147,7 @@ public: // Used by the toolchainmanager to save user-generated tool chains. // Make sure to call this function when deriving! - virtual void toMap(Utils::Storage &map) const; + virtual void toMap(Utils::Store &map) const; virtual Tasks validateKit(const Kit *k) const; virtual bool isJobCountSupported() const { return true; } @@ -184,7 +184,7 @@ protected: void toolChainUpdated(); // Make sure to call this function when deriving! - virtual void fromMap(const Utils::Storage &data); + virtual void fromMap(const Utils::Store &data); void reportError(); bool hasError() const; @@ -214,8 +214,8 @@ public: BadToolchain(const Utils::FilePath &filePath, const Utils::FilePath &symlinkTarget, const QDateTime ×tamp); - Utils::Storage toMap() const; - static BadToolchain fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + static BadToolchain fromMap(const Utils::Store &map); Utils::FilePath filePath; Utils::FilePath symlinkTarget; diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index df0d7a4aa5d..3d369aba3fc 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -320,13 +320,13 @@ public: return static_cast<const TTC *>(&other)->token == token; } - void fromMap(const Storage &data) final + void fromMap(const Store &data) final { ToolChain::fromMap(data); token = data.value(TestTokenKey).toByteArray(); } - void toMap(Storage &data) const final + void toMap(Store &data) const final { ToolChain::toMap(data); data[TestTokenKey] = token; diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp index b0610b85806..96549ba9d9a 100644 --- a/src/plugins/python/pythonproject.cpp +++ b/src/plugins/python/pythonproject.cpp @@ -419,7 +419,7 @@ QList<PythonBuildSystem::FileEntry> PythonBuildSystem::processEntries( return processed; } -Project::RestoreResult PythonProject::fromMap(const Storage &map, QString *errorMessage) +Project::RestoreResult PythonProject::fromMap(const Store &map, QString *errorMessage) { Project::RestoreResult res = Project::fromMap(map, errorMessage); if (res == RestoreResult::Ok) { diff --git a/src/plugins/python/pythonproject.h b/src/plugins/python/pythonproject.h index b4203fa54ad..c249548d2a1 100644 --- a/src/plugins/python/pythonproject.h +++ b/src/plugins/python/pythonproject.h @@ -21,7 +21,7 @@ public: bool needsConfiguration() const final { return false; } private: - RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage) override; + RestoreResult fromMap(const Utils::Store &map, QString *errorMessage) override; }; } // Python::Internal diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index c3df267e3b7..efc029bce44 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -152,7 +152,7 @@ void QbsBuildConfiguration::triggerReparseIfActive() m_buildSystem->delayParsing(); } -void QbsBuildConfiguration::fromMap(const Storage &map) +void QbsBuildConfiguration::fromMap(const Store &map) { BuildConfiguration::fromMap(map); if (hasError()) diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h index b58da50bb42..2ea114864f2 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h @@ -71,7 +71,7 @@ signals: void qbsConfigurationChanged(); private: - void fromMap(const Utils::Storage &map) override; + void fromMap(const Utils::Store &map) override; void restrictNextBuild(const ProjectExplorer::RunConfiguration *rc) override; void triggerReparseIfActive(); diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index cab1607503b..de5ddba1bb7 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -351,7 +351,7 @@ int QbsBuildStep::maxJobs() const return QThread::idealThreadCount(); } -void QbsBuildStep::fromMap(const Storage &map) +void QbsBuildStep::fromMap(const Store &map) { BuildStep::fromMap(map); if (hasError()) @@ -359,7 +359,7 @@ void QbsBuildStep::fromMap(const Storage &map) setQbsConfiguration(map.value(QBS_CONFIG).toMap()); } -void QbsBuildStep::toMap(Storage &map) const +void QbsBuildStep::toMap(Store &map) const { ProjectExplorer::BuildStep::toMap(map); map.insert(QBS_CONFIG, m_qbsConfiguration); diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index 8a4a2b3b6df..c1b3b458830 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -70,8 +70,8 @@ private: void setupOutputFormatter(Utils::OutputFormatter *formatter) override; Tasking::GroupItem runRecipe() final; QWidget *createConfigWidget() override; - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; QbsBuildConfiguration *qbsBuildConfiguration() const; QbsBuildSystem *qbsBuildSystem() const; diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 9d85fb2f73d..4fb123079e7 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -187,13 +187,13 @@ QmakeBuildConfiguration::~QmakeBuildConfiguration() delete m_buildSystem; } -void QmakeBuildConfiguration::toMap(Storage &map) const +void QmakeBuildConfiguration::toMap(Store &map) const { BuildConfiguration::toMap(map); map.insert(QLatin1String(BUILD_CONFIGURATION_KEY), int(m_qmakeBuildConfiguration)); } -void QmakeBuildConfiguration::fromMap(const Storage &map) +void QmakeBuildConfiguration::fromMap(const Store &map) { BuildConfiguration::fromMap(map); if (hasError()) diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h index 3dca5b9dad8..05ccbb29836 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h @@ -67,7 +67,7 @@ public: QString *arguments, const Utils::FilePath &directory, const QtSupport::QtVersion *version, QStringList *outArgs = nullptr); - void toMap(Utils::Storage &map) const override; + void toMap(Utils::Store &map) const override; BuildType buildType() const override; @@ -99,7 +99,7 @@ signals: void useQtQuickCompilerChanged(); protected: - void fromMap(const Utils::Storage &map) override; + void fromMap(const Utils::Store &map) override; bool regenerateBuildFiles(ProjectExplorer::Node *node = nullptr) override; private: diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index e83dd5a0b7d..53639778950 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -171,7 +171,7 @@ QmakeProject::~QmakeProject() setRootProjectNode(nullptr); } -Project::RestoreResult QmakeProject::fromMap(const Storage &map, QString *errorMessage) +Project::RestoreResult QmakeProject::fromMap(const Store &map, QString *errorMessage) { RestoreResult result = Project::fromMap(map, errorMessage); if (result != RestoreResult::Ok) diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.h b/src/plugins/qmakeprojectmanager/qmakeproject.h index 5d65de04c2f..10f2a563709 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.h +++ b/src/plugins/qmakeprojectmanager/qmakeproject.h @@ -45,7 +45,7 @@ public: ProjectExplorer::ProjectImporter *projectImporter() const final; protected: - RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage) final; + RestoreResult fromMap(const Utils::Store &map, QString *errorMessage) final; private: ProjectExplorer::DeploymentKnowledge deploymentKnowledge() const override; diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 39c5e0bc63e..3935d237810 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -403,14 +403,14 @@ QString QMakeStep::mkspec() const return QmakeKitAspect::effectiveMkspec(target()->kit()); } -void QMakeStep::toMap(Storage &map) const +void QMakeStep::toMap(Store &map) const { AbstractProcessStep::toMap(map); map.insert(QMAKE_FORCED_KEY, m_forced); map.insert(QMAKE_SELECTED_ABIS_KEY, m_selectedAbis); } -void QMakeStep::fromMap(const Storage &map) +void QMakeStep::fromMap(const Store &map) { m_forced = map.value(QMAKE_FORCED_KEY, false).toBool(); m_selectedAbis = map.value(QMAKE_SELECTED_ABIS_KEY).toStringList(); diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index 673838ad7f5..e90139f279c 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -124,14 +124,14 @@ public: QString makeArguments(const QString &makefile) const; QString effectiveQMakeCall() const; - void toMap(Utils::Storage &map) const override; + void toMap(Utils::Store &map) const override; Utils::SelectionAspect buildType{this}; ProjectExplorer::ArgumentsAspect userArguments{this}; Utils::StringAspect effectiveCall{this}; protected: - void fromMap(const Utils::Storage &map) override; + void fromMap(const Utils::Store &map) override; private: Tasking::GroupItem runRecipe() final; diff --git a/src/plugins/qmljstools/qmljscodestylepreferences.cpp b/src/plugins/qmljstools/qmljscodestylepreferences.cpp index 8556bc649c1..4186197431b 100644 --- a/src/plugins/qmljstools/qmljscodestylepreferences.cpp +++ b/src/plugins/qmljstools/qmljscodestylepreferences.cpp @@ -80,7 +80,7 @@ QVariantMap QmlJSCodeStylePreferences::toMap() const return map; } -void QmlJSCodeStylePreferences::fromMap(const Storage &map) +void QmlJSCodeStylePreferences::fromMap(const Store &map) { ICodeStylePreferences::fromMap(map); if (!currentDelegate()) diff --git a/src/plugins/qmljstools/qmljscodestylepreferences.h b/src/plugins/qmljstools/qmljscodestylepreferences.h index db0acc0d738..7a8dcc83d86 100644 --- a/src/plugins/qmljstools/qmljscodestylepreferences.h +++ b/src/plugins/qmljstools/qmljscodestylepreferences.h @@ -25,8 +25,8 @@ public: // tracks parent hierarchy until currentParentSettings is null QmlJSCodeStyleSettings currentCodeStyleSettings() const; - Utils::Storage toMap() const override; - void fromMap(const Utils::Storage &map) override; + Utils::Store toMap() const override; + void fromMap(const Utils::Store &map) override; public slots: void setCodeStyleSettings(const QmlJSCodeStyleSettings &data); diff --git a/src/plugins/qmljstools/qmljscodestylesettings.cpp b/src/plugins/qmljstools/qmljscodestylesettings.cpp index 7e69a1ee1ac..cce1f4112f5 100644 --- a/src/plugins/qmljstools/qmljscodestylesettings.cpp +++ b/src/plugins/qmljstools/qmljscodestylesettings.cpp @@ -34,7 +34,7 @@ QVariantMap QmlJSCodeStyleSettings::toMap() const }; } -void QmlJSCodeStyleSettings::fromMap(const Storage &map) +void QmlJSCodeStyleSettings::fromMap(const Store &map) { lineLength = map.value(lineLengthKey, lineLength).toInt(); } diff --git a/src/plugins/qmljstools/qmljscodestylesettings.h b/src/plugins/qmljstools/qmljscodestylesettings.h index 54cc60c5215..a97cd5a5b9f 100644 --- a/src/plugins/qmljstools/qmljscodestylesettings.h +++ b/src/plugins/qmljstools/qmljscodestylesettings.h @@ -5,7 +5,7 @@ #include "qmljstools_global.h" -#include <utils/storage.h> +#include <utils/store.h> #include <optional> @@ -20,8 +20,8 @@ public: int lineLength = 80; - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); bool equals(const QmlJSCodeStyleSettings &rhs) const; bool operator==(const QmlJSCodeStyleSettings &s) const { return equals(s); } diff --git a/src/plugins/qmlprojectmanager/qmlmainfileaspect.cpp b/src/plugins/qmlprojectmanager/qmlmainfileaspect.cpp index 6a2cc0e360e..1f5b0e69a38 100644 --- a/src/plugins/qmlprojectmanager/qmlmainfileaspect.cpp +++ b/src/plugins/qmlprojectmanager/qmlmainfileaspect.cpp @@ -70,12 +70,12 @@ void QmlMainFileAspect::addToLayout(Layouting::LayoutItem &parent) parent.addItems({Tr::tr("Main QML file:"), m_fileListCombo.data()}); } -void QmlMainFileAspect::toMap(Storage &map) const +void QmlMainFileAspect::toMap(Store &map) const { map.insert(Constants::QML_MAINSCRIPT_KEY, m_scriptFile); } -void QmlMainFileAspect::fromMap(const Storage &map) +void QmlMainFileAspect::fromMap(const Store &map) { m_scriptFile = map.value(Constants::QML_MAINSCRIPT_KEY, M_CURRENT_FILE).toString(); diff --git a/src/plugins/qmlprojectmanager/qmlmainfileaspect.h b/src/plugins/qmlprojectmanager/qmlmainfileaspect.h index f71d186e9f7..4a64055b6c4 100644 --- a/src/plugins/qmlprojectmanager/qmlmainfileaspect.h +++ b/src/plugins/qmlprojectmanager/qmlmainfileaspect.h @@ -43,8 +43,8 @@ public: }; void addToLayout(Layouting::LayoutItem &parent) final; - void toMap(Utils::Storage &map) const final; - void fromMap(const Utils::Storage &map) final; + void toMap(Utils::Store &map) const final; + void fromMap(const Utils::Store &map) final; void updateFileComboBox(); MainScriptSource mainScriptSource() const; diff --git a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp index cc522c0ae10..cee980479c7 100644 --- a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp +++ b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp @@ -105,14 +105,14 @@ Utils::FilePath QmlMultiLanguageAspect::databaseFilePath() const return m_databaseFilePath; } -void QmlMultiLanguageAspect::toMap(Storage &map) const +void QmlMultiLanguageAspect::toMap(Store &map) const { BoolAspect::toMap(map); if (!m_currentLocale.isEmpty()) map.insert(Constants::LAST_USED_LANGUAGE, m_currentLocale); } -void QmlMultiLanguageAspect::fromMap(const Storage &map) +void QmlMultiLanguageAspect::fromMap(const Store &map) { BoolAspect::fromMap(map); setCurrentLocale(map.value(Constants::LAST_USED_LANGUAGE, "en").toString()); diff --git a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.h b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.h index 46f86273eaa..8f0b8af4617 100644 --- a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.h +++ b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.h @@ -23,8 +23,8 @@ public: QString currentLocale() const; void setCurrentLocale(const QString &locale); Utils::FilePath databaseFilePath() const; - void toMap(Utils::Storage &map) const final; - void fromMap(const Utils::Storage &map) final; + void toMap(Utils::Store &map) const final; + void fromMap(const Utils::Store &map) final; static QmlMultiLanguageAspect *current(); static QmlMultiLanguageAspect *current(ProjectExplorer::Project *project); diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 24a7120a7bb..5e7e5eacfef 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -89,7 +89,7 @@ void QmlProject::parsingFinished(const Target *target, bool success) openFile(fileToOpen); } -Project::RestoreResult QmlProject::fromMap(const Storage &map, QString *errorMessage) +Project::RestoreResult QmlProject::fromMap(const Store &map, QString *errorMessage) { RestoreResult result = Project::fromMap(map, errorMessage); if (result != RestoreResult::Ok) diff --git a/src/plugins/qmlprojectmanager/qmlproject.h b/src/plugins/qmlprojectmanager/qmlproject.h index 04629bfe757..f7855f48ee1 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.h +++ b/src/plugins/qmlprojectmanager/qmlproject.h @@ -24,7 +24,7 @@ public: ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final; protected: - RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage) override; + RestoreResult fromMap(const Utils::Store &map, QString *errorMessage) override; private: ProjectExplorer::DeploymentKnowledge deploymentKnowledge() const override; diff --git a/src/plugins/qnx/qnxqtversion.cpp b/src/plugins/qnx/qnxqtversion.cpp index 067245e2368..420b3fbb810 100644 --- a/src/plugins/qnx/qnxqtversion.cpp +++ b/src/plugins/qnx/qnxqtversion.cpp @@ -116,7 +116,7 @@ QVariantMap QnxQtVersion::toMap() const return result; } -void QnxQtVersion::fromMap(const Storage &map, const Utils::FilePath &) +void QnxQtVersion::fromMap(const Store &map, const Utils::FilePath &) { QtVersion::fromMap(map); setSdpPath(FilePath::fromSettings(map.value(SDP_PATH_KEY))); diff --git a/src/plugins/qnx/qnxqtversion.h b/src/plugins/qnx/qnxqtversion.h index 04e9d3280d1..3752fcb0e85 100644 --- a/src/plugins/qnx/qnxqtversion.h +++ b/src/plugins/qnx/qnxqtversion.h @@ -27,8 +27,8 @@ public: QString cpuDir() const; - Utils::Storage toMap() const override; - void fromMap(const Utils::Storage &map, const Utils::FilePath &filePath) override; + Utils::Store toMap() const override; + void fromMap(const Utils::Store &map, const Utils::FilePath &filePath) override; ProjectExplorer::Abis detectQtAbis() const override; diff --git a/src/plugins/qnx/qnxsettingspage.cpp b/src/plugins/qnx/qnxsettingspage.cpp index 7d6af6cce4f..210caba8783 100644 --- a/src/plugins/qnx/qnxsettingspage.cpp +++ b/src/plugins/qnx/qnxsettingspage.cpp @@ -74,7 +74,7 @@ public: QnxConfiguration() = default; explicit QnxConfiguration(const FilePath &envFile) { m_envFile = envFile; } - void fromMap(const Storage &data) + void fromMap(const Store &data) { QString envFilePath = data.value(QNXEnvFileKey).toString(); if (envFilePath.isEmpty()) diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 5f0929468e4..248eabfdd35 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -640,7 +640,7 @@ bool QtVersion::hasReleaseBuild() const return !d->m_defaultConfigIsDebug || d->m_defaultConfigIsDebugAndRelease; } -void QtVersion::fromMap(const Storage &map, const FilePath &filePath) +void QtVersion::fromMap(const Store &map, const FilePath &filePath) { d->m_id = map.value(Constants::QTVERSIONID).toInt(); if (d->m_id == -1) // this happens on adding from installer, see updateFromInstaller => get a new unique id diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index 52e7822f59e..f46d6c3e4b5 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -7,7 +7,7 @@ #include <utils/filepath.h> #include <utils/macroexpander.h> -#include <utils/storage.h> +#include <utils/store.h> #include <projectexplorer/abi.h> #include <projectexplorer/task.h> @@ -49,7 +49,7 @@ public: virtual ~QtVersion(); - virtual void fromMap(const Utils::Storage &map, const Utils::FilePath &filePath = {}); + virtual void fromMap(const Utils::Store &map, const Utils::FilePath &filePath = {}); virtual bool equals(QtVersion *other); bool isAutodetected() const; @@ -64,7 +64,7 @@ public: QString type() const; - virtual Utils::Storage toMap() const; + virtual Utils::Store toMap() const; virtual bool isValid() const; static Predicate isValidPredicate(const Predicate &predicate = {}); virtual QString invalidReason() const; diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index a3553eb6423..1debbc230c2 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -81,7 +81,7 @@ void AbstractRemoteLinuxDeployStep::setInternalInitializer( d->internalInit = init; } -void AbstractRemoteLinuxDeployStep::fromMap(const Utils::Storage &map) +void AbstractRemoteLinuxDeployStep::fromMap(const Utils::Store &map) { BuildStep::fromMap(map); if (hasError()) @@ -89,7 +89,7 @@ void AbstractRemoteLinuxDeployStep::fromMap(const Utils::Storage &map) d->deployTimes.importDeployTimes(map); } -void AbstractRemoteLinuxDeployStep::toMap(Utils::Storage &map) const +void AbstractRemoteLinuxDeployStep::toMap(Utils::Store &map) const { BuildStep::toMap(map); map.insert(d->deployTimes.exportDeployTimes()); diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h index 982c9f596dd..ee56491a8bf 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h @@ -26,8 +26,8 @@ protected: void handleStdOutData(const QString &data); void handleStdErrData(const QString &data); - void fromMap(const Utils::Storage &map) final; - void toMap(Utils::Storage &map) const final; + void fromMap(const Utils::Store &map) final; + void toMap(Utils::Store &map) const final; bool init() final; void setInternalInitializer(const std::function<Utils::expected_str<void>()> &init); diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index f13aecd7ab7..a061bc4215a 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -38,7 +38,7 @@ public: MakeInstallStep(BuildStepList *parent, Id id); private: - void fromMap(const Storage &map) override; + void fromMap(const Store &map) override; QWidget *createConfigWidget() override; bool init() override; Tasking::GroupItem runRecipe() final; @@ -257,7 +257,7 @@ void MakeInstallStep::updateFromCustomCommandLineAspect() setUserArguments(ProcessArgs::joinArgs(tokens.mid(1))); } -void MakeInstallStep::fromMap(const Storage &map) +void MakeInstallStep::fromMap(const Store &map) { MakeStep::fromMap(map); if (hasError()) diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp index e16b07ee06e..90014e362c5 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp @@ -99,7 +99,7 @@ QString RemoteLinuxEnvironmentAspect::userEnvironmentChangesAsString() const return env.mid(0, env.size() - 1); } -void RemoteLinuxEnvironmentAspect::fromMap(const Storage &map) +void RemoteLinuxEnvironmentAspect::fromMap(const Store &map) { ProjectExplorer::EnvironmentAspect::fromMap(map); @@ -117,7 +117,7 @@ void RemoteLinuxEnvironmentAspect::fromMap(const Storage &map) } } -void RemoteLinuxEnvironmentAspect::toMap(Storage &map) const +void RemoteLinuxEnvironmentAspect::toMap(Store &map) const { ProjectExplorer::EnvironmentAspect::toMap(map); map.insert(QLatin1String(VERSION_KEY), ENVIRONMENTASPECT_VERSION); diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h index be47bb489ce..6543d2f1208 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h @@ -21,8 +21,8 @@ public: QString userEnvironmentChangesAsString() const; protected: - void fromMap(const Utils::Storage &map) override; - void toMap(Utils::Storage &map) const override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; private: Utils::Environment m_remoteEnvironment; diff --git a/src/plugins/remotelinux/tarpackagecreationstep.cpp b/src/plugins/remotelinux/tarpackagecreationstep.cpp index 5fd83665c70..74b5a8fa423 100644 --- a/src/plugins/remotelinux/tarpackagecreationstep.cpp +++ b/src/plugins/remotelinux/tarpackagecreationstep.cpp @@ -61,8 +61,8 @@ public: private: bool init() final; Tasking::GroupItem runRecipe() final; - void fromMap(const Storage &map) final; - void toMap(Storage &map) const final; + void fromMap(const Store &map) final; + void toMap(Store &map) const final; QVariant data(Id id) const final; void raiseError(const QString &errorMessage); @@ -166,7 +166,7 @@ Tasking::GroupItem TarPackageCreationStep::runRecipe() return AsyncTask<void>(onSetup, onDone, onError); } -void TarPackageCreationStep::fromMap(const Storage &map) +void TarPackageCreationStep::fromMap(const Store &map) { BuildStep::fromMap(map); if (hasError()) @@ -174,7 +174,7 @@ void TarPackageCreationStep::fromMap(const Storage &map) m_deployTimes.importDeployTimes(map); } -void TarPackageCreationStep::toMap(Storage &map) const +void TarPackageCreationStep::toMap(Store &map) const { BuildStep::toMap(map); map.insert(m_deployTimes.exportDeployTimes()); diff --git a/src/plugins/texteditor/behaviorsettings.cpp b/src/plugins/texteditor/behaviorsettings.cpp index 83e0695383b..f8356d6916e 100644 --- a/src/plugins/texteditor/behaviorsettings.cpp +++ b/src/plugins/texteditor/behaviorsettings.cpp @@ -57,7 +57,7 @@ QVariantMap BehaviorSettings::toMap() const }; } -void BehaviorSettings::fromMap(const Storage &map) +void BehaviorSettings::fromMap(const Store &map) { m_mouseHiding = map.value(mouseHidingKey, m_mouseHiding).toBool(); m_mouseNavigation = map.value(mouseNavigationKey, m_mouseNavigation).toBool(); diff --git a/src/plugins/texteditor/behaviorsettings.h b/src/plugins/texteditor/behaviorsettings.h index 06a7830dc4b..a4a1f60fce7 100644 --- a/src/plugins/texteditor/behaviorsettings.h +++ b/src/plugins/texteditor/behaviorsettings.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include <utils/storage.h> +#include <utils/store.h> namespace TextEditor { @@ -21,8 +21,8 @@ public: void toSettings(const QString &category) const; void fromSettings(const QString &category); - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); bool equals(const BehaviorSettings &bs) const; diff --git a/src/plugins/texteditor/extraencodingsettings.cpp b/src/plugins/texteditor/extraencodingsettings.cpp index 216dcae524e..34c46e8cf62 100644 --- a/src/plugins/texteditor/extraencodingsettings.cpp +++ b/src/plugins/texteditor/extraencodingsettings.cpp @@ -45,7 +45,7 @@ QVariantMap ExtraEncodingSettings::toMap() const }; } -void ExtraEncodingSettings::fromMap(const Storage &map) +void ExtraEncodingSettings::fromMap(const Store &map) { m_utf8BomSetting = (Utf8BomSetting)map.value(kUtf8BomBehaviorKey, m_utf8BomSetting).toInt(); } diff --git a/src/plugins/texteditor/extraencodingsettings.h b/src/plugins/texteditor/extraencodingsettings.h index b9109d1b64c..1104bd0354b 100644 --- a/src/plugins/texteditor/extraencodingsettings.h +++ b/src/plugins/texteditor/extraencodingsettings.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include <utils/storage.h> +#include <utils/store.h> namespace TextEditor { @@ -18,8 +18,8 @@ public: void toSettings(const QString &category) const; void fromSettings(const QString &category); - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); bool equals(const ExtraEncodingSettings &s) const; diff --git a/src/plugins/texteditor/icodestylepreferences.cpp b/src/plugins/texteditor/icodestylepreferences.cpp index b3aa668ccae..1f98062712c 100644 --- a/src/plugins/texteditor/icodestylepreferences.cpp +++ b/src/plugins/texteditor/icodestylepreferences.cpp @@ -222,14 +222,14 @@ void ICodeStylePreferences::fromSettings(const QString &category) Utils::fromSettings(d->m_settingsSuffix, category, Core::ICore::settings(), this); } -Storage ICodeStylePreferences::toMap() const +Store ICodeStylePreferences::toMap() const { if (!currentDelegate()) return d->m_tabSettings.toMap(); return {{currentPreferencesKey, currentDelegateId()}}; } -void ICodeStylePreferences::fromMap(const Storage &map) +void ICodeStylePreferences::fromMap(const Store &map) { d->m_tabSettings.fromMap(map); const QByteArray delegateId = map.value(currentPreferencesKey).toByteArray(); diff --git a/src/plugins/texteditor/icodestylepreferences.h b/src/plugins/texteditor/icodestylepreferences.h index 772c712e31d..a3eedfb5c57 100644 --- a/src/plugins/texteditor/icodestylepreferences.h +++ b/src/plugins/texteditor/icodestylepreferences.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include <utils/storage.h> +#include <utils/store.h> #include <QObject> @@ -69,8 +69,8 @@ public: void fromSettings(const QString &category); // make below 2 protected? - virtual Utils::Storage toMap() const; - virtual void fromMap(const Utils::Storage &map); + virtual Utils::Store toMap() const; + virtual void fromMap(const Utils::Store &map); signals: void tabSettingsChanged(const TextEditor::TabSettings &settings); diff --git a/src/plugins/texteditor/marginsettings.cpp b/src/plugins/texteditor/marginsettings.cpp index 3f832b04e39..de564ba8486 100644 --- a/src/plugins/texteditor/marginsettings.cpp +++ b/src/plugins/texteditor/marginsettings.cpp @@ -45,7 +45,7 @@ void MarginSettings::fromSettings(QSettings *s) s->endGroup(); } -Storage MarginSettings::toMap() const +Store MarginSettings::toMap() const { return { {tintMarginAreaColumnKey, m_tintMarginArea}, @@ -55,7 +55,7 @@ Storage MarginSettings::toMap() const }; } -void MarginSettings::fromMap(const Storage &map) +void MarginSettings::fromMap(const Store &map) { m_showMargin = map.value(showWrapColumnKey, m_showMargin).toBool(); m_tintMarginArea = map.value(tintMarginAreaColumnKey, m_tintMarginArea).toBool(); diff --git a/src/plugins/texteditor/marginsettings.h b/src/plugins/texteditor/marginsettings.h index 78fc822e687..cf5c1c0aaab 100644 --- a/src/plugins/texteditor/marginsettings.h +++ b/src/plugins/texteditor/marginsettings.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include <utils/storage.h> +#include <utils/store.h> QT_BEGIN_NAMESPACE class QSettings; @@ -21,8 +21,8 @@ public: void toSettings(QSettings *s) const; void fromSettings(QSettings *s); - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); bool equals(const MarginSettings &other) const; diff --git a/src/plugins/texteditor/storagesettings.cpp b/src/plugins/texteditor/storagesettings.cpp index 34ecc8f67bd..b70eb3ec144 100644 --- a/src/plugins/texteditor/storagesettings.cpp +++ b/src/plugins/texteditor/storagesettings.cpp @@ -45,7 +45,7 @@ void StorageSettings::fromSettings(const QString &category) Utils::fromSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); } -Storage StorageSettings::toMap() const +Store StorageSettings::toMap() const { return { {cleanWhitespaceKey, m_cleanWhitespace}, @@ -57,7 +57,7 @@ Storage StorageSettings::toMap() const }; } -void StorageSettings::fromMap(const Storage &map) +void StorageSettings::fromMap(const Store &map) { m_cleanWhitespace = map.value(cleanWhitespaceKey, m_cleanWhitespace).toBool(); m_inEntireDocument = map.value(inEntireDocumentKey, m_inEntireDocument).toBool(); diff --git a/src/plugins/texteditor/storagesettings.h b/src/plugins/texteditor/storagesettings.h index 85a88a022f3..bff84b6fc00 100644 --- a/src/plugins/texteditor/storagesettings.h +++ b/src/plugins/texteditor/storagesettings.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include <utils/storage.h> +#include <utils/store.h> namespace TextEditor { @@ -17,8 +17,8 @@ public: void toSettings(const QString &category) const; void fromSettings(const QString &category); - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); // calculated based on boolean setting plus file type blacklist examination bool removeTrailingWhitespace(const QString &filePattern) const; diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index 3fb2839adc2..a11b564994c 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -56,7 +56,7 @@ QVariantMap TabSettings::toMap() const }; } -void TabSettings::fromMap(const Storage &map) +void TabSettings::fromMap(const Store &map) { const bool spacesForTabs = map.value(spacesForTabsKey, true).toBool(); const bool autoSpacesForTabs = map.value(autoSpacesForTabsKey, false).toBool(); diff --git a/src/plugins/texteditor/tabsettings.h b/src/plugins/texteditor/tabsettings.h index 07512d6af37..57adca91a05 100644 --- a/src/plugins/texteditor/tabsettings.h +++ b/src/plugins/texteditor/tabsettings.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include <utils/storage.h> +#include <utils/store.h> #include <QTextBlock> @@ -41,8 +41,8 @@ public: void toSettings(const QString &category, QSettings *s) const; void fromSettings(const QString &category, QSettings *s); - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); int lineIndentPosition(const QString &text) const; int columnAt(const QString &text, int position) const; diff --git a/src/plugins/texteditor/typingsettings.cpp b/src/plugins/texteditor/typingsettings.cpp index 7956f7c291c..7fa6b84c7e9 100644 --- a/src/plugins/texteditor/typingsettings.cpp +++ b/src/plugins/texteditor/typingsettings.cpp @@ -39,7 +39,7 @@ void TypingSettings::fromSettings(const QString &category) Utils::fromSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); } -Storage TypingSettings::toMap() const +Store TypingSettings::toMap() const { return { {autoIndentKey, m_autoIndent}, @@ -49,7 +49,7 @@ Storage TypingSettings::toMap() const }; } -void TypingSettings::fromMap(const Storage &map) +void TypingSettings::fromMap(const Store &map) { m_autoIndent = map.value(autoIndentKey, m_autoIndent).toBool(); m_tabKeyBehavior = (TabKeyBehavior) map.value(tabKeyBehaviorKey, m_tabKeyBehavior).toInt(); diff --git a/src/plugins/texteditor/typingsettings.h b/src/plugins/texteditor/typingsettings.h index 2ad06a23ab5..8cb9eee8d13 100644 --- a/src/plugins/texteditor/typingsettings.h +++ b/src/plugins/texteditor/typingsettings.h @@ -5,7 +5,7 @@ #include "texteditor_global.h" -#include <utils/storage.h> +#include <utils/store.h> QT_BEGIN_NAMESPACE class QTextDocument; @@ -38,8 +38,8 @@ public: void toSettings(const QString &category) const; void fromSettings(const QString &category); - Utils::Storage toMap() const; - void fromMap(const Utils::Storage &map); + Utils::Store toMap() const; + void fromMap(const Utils::Store &map); bool equals(const TypingSettings &ts) const; diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index f02343ff158..3e6046fdb60 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -146,12 +146,12 @@ void SuppressionAspect::addToLayout(Layouting::LayoutItem &parent) parent.addItem(Span { 2, group }); } -void SuppressionAspect::fromMap(const Storage &map) +void SuppressionAspect::fromMap(const Store &map) { BaseAspect::fromMap(map); // FIXME Looks wrong, as it skips the intermediate level } -void SuppressionAspect::toMap(Storage &map) const +void SuppressionAspect::toMap(Store &map) const { BaseAspect::toMap(map); } diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index b0c2c670153..93866bae862 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -22,8 +22,8 @@ public: void addToLayout(Layouting::LayoutItem &parent) final; - void fromMap(const Utils::Storage &map) final; - void toMap(Utils::Storage &map) const final; + void fromMap(const Utils::Store &map) final; + void toMap(Utils::Store &map) const final; void addSuppressionFile(const Utils::FilePath &suppressionFile); diff --git a/src/plugins/webassembly/webassemblyrunconfiguration.cpp b/src/plugins/webassembly/webassemblyrunconfiguration.cpp index 02cbcd7d53d..d3aaf00cd1f 100644 --- a/src/plugins/webassembly/webassemblyrunconfiguration.cpp +++ b/src/plugins/webassembly/webassemblyrunconfiguration.cpp @@ -144,13 +144,13 @@ public: parent.addItems({Tr::tr("Web browser:"), m_webBrowserComboBox}); } - void fromMap(const Storage &map) override + void fromMap(const Store &map) override { if (!m_availableBrowsers.isEmpty()) m_currentBrowser = map.value(BROWSER_KEY, m_availableBrowsers.first().first).toString(); } - void toMap(Storage &map) const override + void toMap(Store &map) const override { map.insert(BROWSER_KEY, m_currentBrowser); } From 2bf886ed7310d9d789849a528f34db71bf4f8602 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 23 Aug 2023 17:51:05 +0200 Subject: [PATCH 0848/1777] Utils: Use a bit more Key and Store Also, separate the Key into a separate header to minimiz impact on #include load. Change-Id: I4f719cad4d23a71a9c228d0b7f5c2409fd6e24d5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/CMakeLists.txt | 1 + src/libs/utils/aspects.cpp | 35 ++++++++++--------- src/libs/utils/aspects.h | 18 +++++----- src/libs/utils/delegates.cpp | 2 +- src/libs/utils/delegates.h | 4 +-- src/libs/utils/displayname.cpp | 4 +-- src/libs/utils/fancylineedit.cpp | 2 +- src/libs/utils/fancylineedit.h | 3 +- src/libs/utils/historycompleter.cpp | 11 +++--- src/libs/utils/historycompleter.h | 4 ++- src/libs/utils/minimizableinfobars.cpp | 6 ++-- src/libs/utils/minimizableinfobars.h | 7 ++-- src/libs/utils/pathchooser.cpp | 2 +- src/libs/utils/pathchooser.h | 2 +- src/libs/utils/qtcsettings.h | 18 +++++----- src/libs/utils/settingsutils.h | 21 +++++------ src/libs/utils/store.h | 10 +++--- src/libs/utils/storekey.h | 12 +++++++ src/libs/utils/utils.qbs | 1 + .../coreplugin/dialogs/settingsdialog.cpp | 2 +- .../coreplugin/foldernavigationwidget.cpp | 2 +- src/plugins/coreplugin/generalsettings.cpp | 2 +- src/plugins/coreplugin/ioutputpane.h | 2 +- src/plugins/coreplugin/navigationwidget.cpp | 14 ++++---- src/plugins/coreplugin/navigationwidget.h | 5 +-- src/plugins/coreplugin/outputpanemanager.cpp | 2 +- src/plugins/coreplugin/outputwindow.cpp | 4 +-- src/plugins/coreplugin/outputwindow.h | 3 +- src/plugins/texteditor/behaviorsettings.cpp | 10 +++--- src/plugins/texteditor/behaviorsettings.h | 4 +-- .../texteditor/behaviorsettingspage.cpp | 4 ++- .../texteditor/extraencodingsettings.cpp | 8 ++--- .../texteditor/extraencodingsettings.h | 2 +- src/plugins/texteditor/findinfiles.cpp | 3 +- .../texteditor/icodestylepreferences.cpp | 8 ++--- .../texteditor/icodestylepreferences.h | 4 +-- src/plugins/texteditor/storagesettings.cpp | 9 +++-- src/plugins/texteditor/storagesettings.h | 4 +-- src/plugins/texteditor/tabsettings.cpp | 11 +++--- src/plugins/texteditor/tabsettings.h | 4 +-- src/plugins/texteditor/typingsettings.cpp | 8 ++--- src/plugins/texteditor/typingsettings.h | 4 +-- 42 files changed, 152 insertions(+), 130 deletions(-) create mode 100644 src/libs/utils/storekey.h diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 5d9a8ffd442..72c18e3346f 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -162,6 +162,7 @@ add_qtc_library(Utils span.h statuslabel.cpp statuslabel.h store.cpp store.h + storekey.h stringtable.cpp stringtable.h stringutils.cpp stringutils.h styleanimator.cpp styleanimator.h diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index a0b7cf6754b..33eedd561d3 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -63,7 +63,7 @@ public: std::function<QVariant(const QVariant &)> m_fromSettings; QString m_displayName; - QString m_settingsKey; // Name of data in settings. + Key m_settingsKey; // Name of data in settings. QString m_tooltip; QString m_labelText; QPixmap m_labelPixmap; @@ -390,7 +390,7 @@ void BaseAspect::setConfigWidgetCreator(const ConfigWidgetCreator &configWidgetC \sa setSettingsKey() */ -QString BaseAspect::settingsKey() const +Key BaseAspect::settingsKey() const { return d->m_settingsKey; } @@ -400,7 +400,7 @@ QString BaseAspect::settingsKey() const \sa settingsKey() */ -void BaseAspect::setSettingsKey(const QString &key) +void BaseAspect::setSettingsKey(const Key &key) { d->m_settingsKey = key; } @@ -410,7 +410,7 @@ void BaseAspect::setSettingsKey(const QString &key) \sa settingsKey() */ -void BaseAspect::setSettingsKey(const QString &group, const QString &key) +void BaseAspect::setSettingsKey(const Key &group, const Key &key) { d->m_settingsKey = group + "/" + key; } @@ -569,8 +569,8 @@ void BaseAspect::registerSubWidget(QWidget *widget) widget->setVisible(d->m_visible); } -void BaseAspect::saveToMap(QVariantMap &data, const QVariant &value, - const QVariant &defaultValue, const QString &key) +void BaseAspect::saveToMap(Store &data, const QVariant &value, + const QVariant &defaultValue, const Key &key) { if (key.isEmpty()) return; @@ -581,7 +581,7 @@ void BaseAspect::saveToMap(QVariantMap &data, const QVariant &value, } /*! - Retrieves the internal value of this BaseAspect from the QVariantMap \a map. + Retrieves the internal value of this BaseAspect from the Store \a map. */ void BaseAspect::fromMap(const Store &map) { @@ -592,7 +592,7 @@ void BaseAspect::fromMap(const Store &map) } /*! - Stores the internal value of this BaseAspect into the QVariantMap \a map. + Stores the internal value of this BaseAspect into the Store \a map. */ void BaseAspect::toMap(Store &map) const { @@ -732,7 +732,7 @@ public: } void makeCheckable(CheckBoxPlacement checkBoxPlacement, const QString &checkerLabel, - const QString &checkerKey, BaseAspect *aspect) + const Key &checkerKey, BaseAspect *aspect) { QTC_ASSERT(!m_checked, return); m_checkBoxPlacement = checkBoxPlacement; @@ -788,7 +788,7 @@ public: Qt::TextElideMode m_elideMode = Qt::ElideNone; QString m_placeHolderText; - QString m_historyCompleterKey; + Key m_historyCompleterKey; QPointer<ElidingLabel> m_labelDisplay; QPointer<FancyLineEdit> m_lineEditDisplay; QPointer<ShowPasswordButton> m_showPasswordButton; @@ -996,7 +996,7 @@ void StringAspect::setElideMode(Qt::TextElideMode elideMode) \sa Utils::PathChooser::setExpectedKind() */ -void StringAspect::setHistoryCompleter(const QString &historyCompleterKey) +void StringAspect::setHistoryCompleter(const Key &historyCompleterKey) { d->m_historyCompleterKey = historyCompleterKey; if (d->m_lineEditDisplay) @@ -1202,7 +1202,7 @@ void StringAspect::bufferToGui() \a checkerKey. */ void StringAspect::makeCheckable(CheckBoxPlacement checkBoxPlacement, - const QString &checkerLabel, const QString &checkerKey) + const QString &checkerLabel, const Key &checkerKey) { d->m_checkerImpl.makeCheckable(checkBoxPlacement, checkerLabel, checkerKey, this); } @@ -1242,7 +1242,7 @@ public: QString m_prompDialogFilter; QString m_prompDialogTitle; QStringList m_commandVersionArguments; - QString m_historyCompleterKey; + Key m_historyCompleterKey; PathChooser::Kind m_expectedKind = PathChooser::File; Environment m_environment; QPointer<PathChooser> m_pathChooserDisplay; @@ -1325,7 +1325,8 @@ void FilePathAspect::setDefaultValue(const QString &filePath) \a checkerKey. */ void FilePathAspect::makeCheckable(CheckBoxPlacement checkBoxPlacement, - const QString &checkerLabel, const QString &checkerKey) + const QString &checkerLabel, + const Key &checkerKey) { d->m_checkerImpl.makeCheckable(checkBoxPlacement, checkerLabel, checkerKey, this); } @@ -1545,7 +1546,7 @@ void FilePathAspect::setDisplayFilter(const std::function<QString (const QString d->m_displayFilter = displayFilter; } -void FilePathAspect::setHistoryCompleter(const QString &historyCompleterKey) +void FilePathAspect::setHistoryCompleter(const Key &historyCompleterKey) { d->m_historyCompleterKey = historyCompleterKey; if (d->m_pathChooserDisplay) @@ -2608,7 +2609,7 @@ bool AspectContainer::isDirty() bool AspectContainer::equals(const AspectContainer &other) const { // FIXME: Expensive, but should not really be needed in a fully aspectified world. - QVariantMap thisMap, thatMap; + Store thisMap, thatMap; toMap(thisMap); other.toMap(thatMap); return thisMap == thatMap; @@ -2616,7 +2617,7 @@ bool AspectContainer::equals(const AspectContainer &other) const void AspectContainer::copyFrom(const AspectContainer &other) { - QVariantMap map; + Store map; other.toMap(map); fromMap(map); } diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 00e452e3015..b2b98937c7f 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -63,9 +63,9 @@ public: virtual void setDefaultVariantValue(const QVariant &value); virtual bool isDefaultValue() const; - QString settingsKey() const; - void setSettingsKey(const QString &settingsKey); - void setSettingsKey(const QString &group, const QString &key); + Key settingsKey() const; + void setSettingsKey(const Key &settingsKey); + void setSettingsKey(const Key &group, const Key &key); QString displayName() const; void setDisplayName(const QString &displayName); @@ -230,8 +230,8 @@ protected: } void registerSubWidget(QWidget *widget); - static void saveToMap(QVariantMap &data, const QVariant &value, - const QVariant &defaultValue, const QString &key); + static void saveToMap(Store &data, const QVariant &value, + const QVariant &defaultValue, const Key &key); protected: template <class Value> @@ -534,7 +534,7 @@ public: void setShowToolTipOnLabel(bool show); void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter); void setPlaceHolderText(const QString &placeHolderText); - void setHistoryCompleter(const QString &historyCompleterKey); + void setHistoryCompleter(const Key &historyCompleterKey); void setUndoRedoEnabled(bool readOnly); void setAcceptRichText(bool acceptRichText); void setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider); @@ -544,7 +544,7 @@ public: void setAutoApplyOnEditingFinished(bool applyOnEditingFinished); void setElideMode(Qt::TextElideMode elideMode); - void makeCheckable(CheckBoxPlacement checkBoxPlacement, const QString &optionalLabel, const QString &optionalBaseKey); + void makeCheckable(CheckBoxPlacement checkBoxPlacement, const QString &optionalLabel, const Key &optionalBaseKey); bool isChecked() const; void setChecked(bool checked); @@ -608,14 +608,14 @@ public: void setPlaceHolderText(const QString &placeHolderText); void setValidationFunction(const FancyLineEdit::ValidationFunction &validator); void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter); - void setHistoryCompleter(const QString &historyCompleterKey); + void setHistoryCompleter(const Key &historyCompleterKey); void setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider); void setShowToolTipOnLabel(bool show); void setAutoApplyOnEditingFinished(bool applyOnEditingFinished); void validateInput(); - void makeCheckable(CheckBoxPlacement checkBoxPlacement, const QString &optionalLabel, const QString &optionalBaseKey); + void makeCheckable(CheckBoxPlacement checkBoxPlacement, const QString &optionalLabel, const Key &optionalBaseKey); bool isChecked() const; void setChecked(bool checked); diff --git a/src/libs/utils/delegates.cpp b/src/libs/utils/delegates.cpp index 3b0623027b6..b384faba571 100644 --- a/src/libs/utils/delegates.cpp +++ b/src/libs/utils/delegates.cpp @@ -151,7 +151,7 @@ void PathChooserDelegate::updateEditorGeometry(QWidget *editor, const QStyleOpti editor->setGeometry(option.rect); } -void PathChooserDelegate::setHistoryCompleter(const QString &key) +void PathChooserDelegate::setHistoryCompleter(const Key &key) { m_historyKey = key; } diff --git a/src/libs/utils/delegates.h b/src/libs/utils/delegates.h index ff012152f5f..328798b4b8d 100644 --- a/src/libs/utils/delegates.h +++ b/src/libs/utils/delegates.h @@ -52,12 +52,12 @@ public: void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override; - void setHistoryCompleter(const QString &key); + void setHistoryCompleter(const Key &key); private: PathChooser::Kind m_kind = PathChooser::ExistingDirectory; QString m_filter; - QString m_historyKey; + Key m_historyKey; }; class QTCREATOR_UTILS_EXPORT CompleterDelegate : public QStyledItemDelegate diff --git a/src/libs/utils/displayname.cpp b/src/libs/utils/displayname.cpp index 0046b50ae9e..a2f622143c6 100644 --- a/src/libs/utils/displayname.cpp +++ b/src/libs/utils/displayname.cpp @@ -35,13 +35,13 @@ bool DisplayName::usesDefaultValue() const return m_value.isEmpty(); } -void DisplayName::toMap(Store &map, const QString &key) const +void DisplayName::toMap(Store &map, const Key &key) const { if (m_forceSerialization || !usesDefaultValue()) map.insert(key, m_value); } -void DisplayName::fromMap(const Store &map, const QString &key) +void DisplayName::fromMap(const Store &map, const Key &key) { m_value = map.value(key).toString(); } diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index 2ed8beabc5e..e5de16e3e84 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -346,7 +346,7 @@ bool FancyLineEdit::hasAutoHideButton(Side side) const return d->m_iconbutton[side]->hasAutoHide(); } -void FancyLineEdit::setHistoryCompleter(const QString &historyKey, bool restoreLastItemFromHistory) +void FancyLineEdit::setHistoryCompleter(const Key &historyKey, bool restoreLastItemFromHistory) { QTC_ASSERT(!d->m_historyCompleter, return); d->m_historyCompleter = new HistoryCompleter(historyKey, this); diff --git a/src/libs/utils/fancylineedit.h b/src/libs/utils/fancylineedit.h index 9f1e1693984..c5212aa6392 100644 --- a/src/libs/utils/fancylineedit.h +++ b/src/libs/utils/fancylineedit.h @@ -7,6 +7,7 @@ #include "completinglineedit.h" #include "expected.h" +#include "storekey.h" #include <QAbstractButton> #include <QFuture> @@ -86,7 +87,7 @@ public: // Completion // Enable a history completer with a history of entries. - void setHistoryCompleter(const QString &historyKey, bool restoreLastItemFromHistory = false); + void setHistoryCompleter(const Utils::Key &historyKey, bool restoreLastItemFromHistory = false); // Sets a completer that is not a history completer. void setSpecialCompleter(QCompleter *completer); diff --git a/src/libs/utils/historycompleter.cpp b/src/libs/utils/historycompleter.cpp index f8c93b9fbef..7f299af1372 100644 --- a/src/libs/utils/historycompleter.cpp +++ b/src/libs/utils/historycompleter.cpp @@ -30,8 +30,8 @@ public: void addEntry(const QString &str); QStringList list; - QString historyKey; - QString historyKeyIsLastItemEmpty; + Key historyKey; + Key historyKeyIsLastItemEmpty; int maxLines = 6; bool isLastItemEmpty = isLastItemEmptyDefault; }; @@ -174,17 +174,16 @@ void HistoryCompleterPrivate::addEntry(const QString &str) isLastItemEmptyDefault); } -HistoryCompleter::HistoryCompleter(const QString &historyKey, QObject *parent) +HistoryCompleter::HistoryCompleter(const Key &historyKey, QObject *parent) : QCompleter(parent), d(new HistoryCompleterPrivate) { QTC_ASSERT(!historyKey.isEmpty(), return); QTC_ASSERT(theSettings, return); - d->historyKey = QLatin1String("CompleterHistory/") + historyKey; + d->historyKey = "CompleterHistory/" + historyKey; d->list = theSettings->value(d->historyKey).toStringList(); - d->historyKeyIsLastItemEmpty = QLatin1String("CompleterHistory/") - + historyKey + QLatin1String(".IsLastItemEmpty"); + d->historyKeyIsLastItemEmpty = "CompleterHistory/" + historyKey + ".IsLastItemEmpty"; d->isLastItemEmpty = theSettings->value(d->historyKeyIsLastItemEmpty, isLastItemEmptyDefault) .toBool(); diff --git a/src/libs/utils/historycompleter.h b/src/libs/utils/historycompleter.h index 7a1fd2a4993..b0842549fef 100644 --- a/src/libs/utils/historycompleter.h +++ b/src/libs/utils/historycompleter.h @@ -5,6 +5,8 @@ #include "utils_global.h" +#include "storekey.h" + #include <QCompleter> namespace Utils { @@ -17,7 +19,7 @@ class QTCREATOR_UTILS_EXPORT HistoryCompleter : public QCompleter { public: static void setSettings(QtcSettings *settings); - HistoryCompleter(const QString &historyKey, QObject *parent = nullptr); + HistoryCompleter(const Key &historyKey, QObject *parent = nullptr); bool removeHistoryItem(int index); QString historyItem() const; bool hasHistory() const { return historySize() > 0; } diff --git a/src/libs/utils/minimizableinfobars.cpp b/src/libs/utils/minimizableinfobars.cpp index a4fcd478118..c3775bdf899 100644 --- a/src/libs/utils/minimizableinfobars.cpp +++ b/src/libs/utils/minimizableinfobars.cpp @@ -33,7 +33,7 @@ void MinimizableInfoBars::setPossibleInfoBarEntries(const QList<Utils::InfoBarEn createActions(); } -void MinimizableInfoBars::setSettingsGroup(const QString &settingsGroup) +void MinimizableInfoBars::setSettingsGroup(const Key &settingsGroup) { m_settingsGroup = settingsGroup; } @@ -55,10 +55,10 @@ void MinimizableInfoBars::createActions() } } -QString MinimizableInfoBars::settingsKey(const Id &id) const +Key MinimizableInfoBars::settingsKey(const Id &id) const { QTC_CHECK(!m_settingsGroup.isEmpty()); - return m_settingsGroup + '/' + SETTINGS_PREFIX + id.toString(); + return m_settingsGroup + '/' + SETTINGS_PREFIX + id.name(); } void MinimizableInfoBars::createShowInfoBarActions(const ActionCreator &actionCreator) const diff --git a/src/libs/utils/minimizableinfobars.h b/src/libs/utils/minimizableinfobars.h index ceba6b0e475..03430f513d1 100644 --- a/src/libs/utils/minimizableinfobars.h +++ b/src/libs/utils/minimizableinfobars.h @@ -7,6 +7,7 @@ #include "id.h" #include "infobar.h" +#include "store.h" #include <QHash> #include <QObject> @@ -27,7 +28,7 @@ public: public: explicit MinimizableInfoBars(InfoBar &infoBar); - void setSettingsGroup(const QString &settingsGroup); + void setSettingsGroup(const Key &settingsGroup); void setPossibleInfoBarEntries(const QList<InfoBarEntry> &entries); void createShowInfoBarActions(const ActionCreator &actionCreator) const; @@ -37,7 +38,7 @@ public: private: void createActions(); - QString settingsKey(const Id &id) const; + Key settingsKey(const Id &id) const; bool showInInfoBar(const Id &id) const; void setShowInInfoBar(const Id &id, bool show); @@ -46,7 +47,7 @@ private: void showInfoBar(const Id &id); InfoBar &m_infoBar; - QString m_settingsGroup; + Key m_settingsGroup; QHash<Id, QAction *> m_actions; QHash<Id, bool> m_isInfoVisible; QHash<Id, InfoBarEntry> m_infoEntries; diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 848e5619593..048fb57ddb7 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -735,7 +735,7 @@ void PathChooser::installLineEditVersionToolTip(QLineEdit *le, const QStringList ef->setArguments(arguments); } -void PathChooser::setHistoryCompleter(const QString &historyKey, bool restoreLastItemFromHistory) +void PathChooser::setHistoryCompleter(const Key &historyKey, bool restoreLastItemFromHistory) { d->m_lineEdit->setHistoryCompleter(historyKey, restoreLastItemFromHistory); } diff --git a/src/libs/utils/pathchooser.h b/src/libs/utils/pathchooser.h index 45930a61270..b7b4a040f31 100644 --- a/src/libs/utils/pathchooser.h +++ b/src/libs/utils/pathchooser.h @@ -105,7 +105,7 @@ public: static void installLineEditVersionToolTip(QLineEdit *le, const QStringList &arguments); // Enable a history completer with a history of entries. - void setHistoryCompleter(const QString &historyKey, bool restoreLastItemFromHistory = false); + void setHistoryCompleter(const Key &historyKey, bool restoreLastItemFromHistory = false); // Sets a macro expander that is used when producing path and fileName. // By default, the global expander is used. diff --git a/src/libs/utils/qtcsettings.h b/src/libs/utils/qtcsettings.h index 13e5ef4c3cb..05d44ef2ffd 100644 --- a/src/libs/utils/qtcsettings.h +++ b/src/libs/utils/qtcsettings.h @@ -5,6 +5,8 @@ #include "utils_global.h" +#include "store.h" + #include <QSettings> namespace Utils { @@ -15,34 +17,34 @@ public: using QSettings::QSettings; template<typename T> - void setValueWithDefault(const QString &key, const T &val, const T &defaultValue); + void setValueWithDefault(const Key &key, const T &val, const T &defaultValue); template<typename T> - void setValueWithDefault(const QString &key, const T &val); + void setValueWithDefault(const Key &key, const T &val); template<typename T> static void setValueWithDefault(QSettings *settings, - const QString &key, + const Key &key, const T &val, const T &defaultValue); template<typename T> - static void setValueWithDefault(QSettings *settings, const QString &key, const T &val); + static void setValueWithDefault(QSettings *settings, const Key &key, const T &val); }; template<typename T> -void QtcSettings::setValueWithDefault(const QString &key, const T &val, const T &defaultValue) +void QtcSettings::setValueWithDefault(const Key &key, const T &val, const T &defaultValue) { setValueWithDefault(this, key, val, defaultValue); } template<typename T> -void QtcSettings::setValueWithDefault(const QString &key, const T &val) +void QtcSettings::setValueWithDefault(const Key &key, const T &val) { setValueWithDefault(this, key, val); } template<typename T> void QtcSettings::setValueWithDefault(QSettings *settings, - const QString &key, + const Key &key, const T &val, const T &defaultValue) { @@ -53,7 +55,7 @@ void QtcSettings::setValueWithDefault(QSettings *settings, } template<typename T> -void QtcSettings::setValueWithDefault(QSettings *settings, const QString &key, const T &val) +void QtcSettings::setValueWithDefault(QSettings *settings, const Key &key, const T &val) { if (val == T()) settings->remove(key); diff --git a/src/libs/utils/settingsutils.h b/src/libs/utils/settingsutils.h index 2feb62380d1..97d8f285a98 100644 --- a/src/libs/utils/settingsutils.h +++ b/src/libs/utils/settingsutils.h @@ -3,38 +3,39 @@ #pragma once +#include "store.h" + #include <QSettings> -#include <QString> #include <QStringList> #include <QVariant> namespace Utils { template <class SettingsClassT> -void fromSettings(const QString &postFix, - const QString &category, +void fromSettings(const Key &postFix, + const Key &category, QSettings *s, SettingsClassT *obj) { - QVariantMap map; + Store map; s->beginGroup(category + postFix); - const QStringList keys = s->allKeys(); - for (const QString &key : keys) + const KeyList keys = s->allKeys(); + for (const Key &key : keys) map.insert(key, s->value(key)); s->endGroup(); obj->fromMap(map); } template <class SettingsClassT> -void toSettings(const QString &postFix, - const QString &category, +void toSettings(const Key &postFix, + const Key &category, QSettings *s, const SettingsClassT *obj) { - QString group = postFix; + Key group = postFix; if (!category.isEmpty()) group.insert(0, category); - const QVariantMap map = obj->toMap(); + const Store map = obj->toMap(); s->beginGroup(group); for (auto it = map.constBegin(), end = map.constEnd(); it != end; ++it) diff --git a/src/libs/utils/store.h b/src/libs/utils/store.h index d692216c301..7037f5b4a4e 100644 --- a/src/libs/utils/store.h +++ b/src/libs/utils/store.h @@ -3,12 +3,14 @@ #pragma once -#include <QVariantMap> +#include "storekey.h" + +#include <QMap> +#include <QVariant> namespace Utils { -using Key = QString; -using Data = QVariant; -using Store = QMap<Key, Data>; +using KeyList = QList<Key>; +using Store = QMap<Key, QVariant>; } // Utils diff --git a/src/libs/utils/storekey.h b/src/libs/utils/storekey.h new file mode 100644 index 00000000000..550bcda10cd --- /dev/null +++ b/src/libs/utils/storekey.h @@ -0,0 +1,12 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <QString> + +namespace Utils { + +using Key = QString; + +} // Utils diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 9e59cc2b86a..021c1d37f26 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -295,6 +295,7 @@ Project { "statuslabel.h", "store.cpp", "store.h", + "storekey.h", "stringtable.cpp", "stringtable.h", "stringutils.cpp", diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index c1410bf130f..79cd816e368 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -769,7 +769,7 @@ bool SettingsDialog::execDialog() if (!m_running) { m_running = true; m_finished = false; - static const QLatin1String kPreferenceDialogSize("Core/PreferenceDialogSize"); + static const char kPreferenceDialogSize[] = "Core/PreferenceDialogSize"; const QSize initialSize(kInitialWidth, kInitialHeight); resize(ICore::settings()->value(kPreferenceDialogSize, initialSize).toSize()); exec(); diff --git a/src/plugins/coreplugin/foldernavigationwidget.cpp b/src/plugins/coreplugin/foldernavigationwidget.cpp index 7460f427b5c..3bf45137557 100644 --- a/src/plugins/coreplugin/foldernavigationwidget.cpp +++ b/src/plugins/coreplugin/foldernavigationwidget.cpp @@ -841,7 +841,7 @@ void FolderNavigationWidgetFactory::saveSettings(Utils::QtcSettings *settings, { auto fnw = qobject_cast<FolderNavigationWidget *>(widget); QTC_ASSERT(fnw, return); - const QString base = kSettingsBase + QString::number(position); + const Key base = kSettingsBase + Key::number(position); settings->setValueWithDefault(base + kHiddenFilesKey, fnw->hiddenFilesFilter(), kHiddenFilesDefault); diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 1f7da60d157..13f853e7592 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -269,7 +269,7 @@ void GeneralSettingsWidget::setLanguage(const QString &locale) dialog.exec(); } - settings->setValueWithDefault(QLatin1String("General/OverrideLanguage"), locale, {}); + settings->setValueWithDefault("General/OverrideLanguage", locale, {}); } void GeneralSettingsWidget::fillCodecBox() const diff --git a/src/plugins/coreplugin/ioutputpane.h b/src/plugins/coreplugin/ioutputpane.h index 9193699ca4a..1b65bad61e9 100644 --- a/src/plugins/coreplugin/ioutputpane.h +++ b/src/plugins/coreplugin/ioutputpane.h @@ -81,7 +81,7 @@ signals: void fontChanged(const QFont &font); protected: - void setupFilterUi(const QString &historyKey); + void setupFilterUi(const Utils::Key &historyKey); QString filterText() const; bool filterUsesRegexp() const { return m_filterRegexp; } bool filterIsInverted() const { return m_invertFilter; } diff --git a/src/plugins/coreplugin/navigationwidget.cpp b/src/plugins/coreplugin/navigationwidget.cpp index 2c2634d9478..90b667b0500 100644 --- a/src/plugins/coreplugin/navigationwidget.cpp +++ b/src/plugins/coreplugin/navigationwidget.cpp @@ -249,11 +249,9 @@ void NavigationWidget::setFactories(const QList<INavigationWidgetFactory *> &fac updateToggleText(); } -QString NavigationWidget::settingsGroup() const +Key NavigationWidget::settingsGroup() const { - const QString side(d->m_side == Side::Left ? QStringLiteral("Left") - : QStringLiteral("Right")); - return QStringLiteral("Navigation%1").arg(side); + return d->m_side == Side::Left ? Key("NavigationLeft") : Key("NavigationRight"); } int NavigationWidget::storedWidth() @@ -400,12 +398,12 @@ void NavigationWidget::saveSettings(QtcSettings *settings) settings->setValue(settingsKey("VerticalPosition"), saveState()); settings->setValue(settingsKey("Width"), d->m_width); - const QString activationKey = QStringLiteral("ActivationPosition."); + const Key activationKey = "ActivationPosition."; const auto keys = NavigationWidgetPrivate::s_activationsMap.keys(); for (const auto &factoryId : keys) { const auto &info = NavigationWidgetPrivate::s_activationsMap[factoryId]; if (info.side == d->m_side) - settings->setValue(settingsKey(activationKey + factoryId.toString()), info.position); + settings->setValue(settingsKey(activationKey + factoryId.name()), info.position); } } @@ -524,9 +522,9 @@ int NavigationWidget::factoryIndex(Id id) return -1; } -QString NavigationWidget::settingsKey(const QString &key) const +Key NavigationWidget::settingsKey(const Key &key) const { - return QStringLiteral("%1/%2").arg(settingsGroup(), key); + return settingsGroup() + '/' + key; } QHash<Id, Command *> NavigationWidget::commandMap() const diff --git a/src/plugins/coreplugin/navigationwidget.h b/src/plugins/coreplugin/navigationwidget.h index 776fd682d49..bf5fceff880 100644 --- a/src/plugins/coreplugin/navigationwidget.h +++ b/src/plugins/coreplugin/navigationwidget.h @@ -6,6 +6,7 @@ #include <coreplugin/minisplitter.h> #include <utils/id.h> +#include <utils/store.h> #include <QHash> @@ -69,7 +70,7 @@ public: void setFactories(const QList<INavigationWidgetFactory*> &factories); - QString settingsGroup() const; + Utils::Key settingsGroup() const; void saveSettings(Utils::QtcSettings *settings); void restoreSettings(QSettings *settings); @@ -98,7 +99,7 @@ private: void updateToggleText(); Internal::NavigationSubWidget *insertSubItem(int position, int factoryIndex); int factoryIndex(Utils::Id id); - QString settingsKey(const QString &key) const; + Utils::Key settingsKey(const Utils::Key &key) const; NavigationWidgetPrivate *d; }; diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index 7f46e63f29c..04c61e35b61 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -117,7 +117,7 @@ void IOutputPane::setWheelZoomEnabled(bool enabled) emit wheelZoomEnabledChanged(enabled); } -void IOutputPane::setupFilterUi(const QString &historyKey) +void IOutputPane::setupFilterUi(const Key &historyKey) { m_filterOutputLineEdit = new FancyLineEdit; m_filterActionRegexp = new QAction(this); diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp index 2de95d1b0ba..dfc7e0c9d87 100644 --- a/src/plugins/coreplugin/outputwindow.cpp +++ b/src/plugins/coreplugin/outputwindow.cpp @@ -50,7 +50,7 @@ public: { } - QString settingsKey; + Key settingsKey; OutputFormatter formatter; QList<QPair<QString, OutputFormat>> queuedOutput; QTimer queueTimer; @@ -77,7 +77,7 @@ public: /*******************/ -OutputWindow::OutputWindow(Context context, const QString &settingsKey, QWidget *parent) +OutputWindow::OutputWindow(Context context, const Key &settingsKey, QWidget *parent) : QPlainTextEdit(parent) , d(new Internal::OutputWindowPrivate(document())) { diff --git a/src/plugins/coreplugin/outputwindow.h b/src/plugins/coreplugin/outputwindow.h index baf58cc22c4..83681a988e4 100644 --- a/src/plugins/coreplugin/outputwindow.h +++ b/src/plugins/coreplugin/outputwindow.h @@ -6,6 +6,7 @@ #include "core_global.h" #include "icontext.h" +#include <utils/storekey.h> #include <utils/outputformat.h> #include <QPlainTextEdit> @@ -32,7 +33,7 @@ public: }; Q_DECLARE_FLAGS(FilterModeFlags, FilterModeFlag) - OutputWindow(Context context, const QString &settingsKey, QWidget *parent = nullptr); + OutputWindow(Context context, const Utils::Key &settingsKey, QWidget *parent = nullptr); ~OutputWindow() override; void setLineParsers(const QList<Utils::OutputLineParser *> &parsers); diff --git a/src/plugins/texteditor/behaviorsettings.cpp b/src/plugins/texteditor/behaviorsettings.cpp index f8356d6916e..0a638867165 100644 --- a/src/plugins/texteditor/behaviorsettings.cpp +++ b/src/plugins/texteditor/behaviorsettings.cpp @@ -33,18 +33,18 @@ BehaviorSettings::BehaviorSettings() : { } -void BehaviorSettings::toSettings(const QString &category) const +void BehaviorSettings::toSettings(const Key &category) const { - Utils::toSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); + Utils::toSettings(groupPostfix, category, Core::ICore::settings(), this); } -void BehaviorSettings::fromSettings(const QString &category) +void BehaviorSettings::fromSettings(const Key &category) { *this = BehaviorSettings(); - Utils::fromSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); + Utils::fromSettings(groupPostfix, category, Core::ICore::settings(), this); } -QVariantMap BehaviorSettings::toMap() const +Store BehaviorSettings::toMap() const { return { {mouseHidingKey, m_mouseHiding}, diff --git a/src/plugins/texteditor/behaviorsettings.h b/src/plugins/texteditor/behaviorsettings.h index a4a1f60fce7..e33fe5a2573 100644 --- a/src/plugins/texteditor/behaviorsettings.h +++ b/src/plugins/texteditor/behaviorsettings.h @@ -18,8 +18,8 @@ class TEXTEDITOR_EXPORT BehaviorSettings public: BehaviorSettings(); - void toSettings(const QString &category) const; - void fromSettings(const QString &category); + void toSettings(const Utils::Key &category) const; + void fromSettings(const Utils::Key &category); Utils::Store toMap() const; void fromMap(const Utils::Store &map); diff --git a/src/plugins/texteditor/behaviorsettingspage.cpp b/src/plugins/texteditor/behaviorsettingspage.cpp index 2fcbdab4ccb..705f8ba8d20 100644 --- a/src/plugins/texteditor/behaviorsettingspage.cpp +++ b/src/plugins/texteditor/behaviorsettingspage.cpp @@ -33,6 +33,8 @@ #include <QPointer> #include <QSpacerItem> +using namespace Utils; + namespace TextEditor { class BehaviorSettingsPagePrivate : public QObject @@ -40,7 +42,7 @@ class BehaviorSettingsPagePrivate : public QObject public: BehaviorSettingsPagePrivate(); - const QString m_settingsPrefix{"text"}; + const Key m_settingsPrefix{"text"}; TextEditor::BehaviorSettingsWidget *m_behaviorWidget = nullptr; CodeStylePool *m_defaultCodeStylePool = nullptr; diff --git a/src/plugins/texteditor/extraencodingsettings.cpp b/src/plugins/texteditor/extraencodingsettings.cpp index 34c46e8cf62..91587f19464 100644 --- a/src/plugins/texteditor/extraencodingsettings.cpp +++ b/src/plugins/texteditor/extraencodingsettings.cpp @@ -23,19 +23,19 @@ ExtraEncodingSettings::ExtraEncodingSettings() : m_utf8BomSetting(OnlyKeep) ExtraEncodingSettings::~ExtraEncodingSettings() = default; -void ExtraEncodingSettings::toSettings(const QString &category) const +void ExtraEncodingSettings::toSettings(const Key &category) const { Q_UNUSED(category) - Utils::toSettings(QLatin1String(kGroupPostfix), QString(), Core::ICore::settings(), this); + Utils::toSettings(kGroupPostfix, Key(), Core::ICore::settings(), this); } -void ExtraEncodingSettings::fromSettings(const QString &category) +void ExtraEncodingSettings::fromSettings(const Key &category) { Q_UNUSED(category) *this = ExtraEncodingSettings(); - Utils::fromSettings(QLatin1String(kGroupPostfix), QString(), Core::ICore::settings(), this); + Utils::fromSettings(kGroupPostfix, Key(), Core::ICore::settings(), this); } QVariantMap ExtraEncodingSettings::toMap() const diff --git a/src/plugins/texteditor/extraencodingsettings.h b/src/plugins/texteditor/extraencodingsettings.h index 1104bd0354b..7f64dd09938 100644 --- a/src/plugins/texteditor/extraencodingsettings.h +++ b/src/plugins/texteditor/extraencodingsettings.h @@ -16,7 +16,7 @@ public: ~ExtraEncodingSettings(); void toSettings(const QString &category) const; - void fromSettings(const QString &category); + void fromSettings(const Utils::Key &category); Utils::Store toMap() const; void fromMap(const Utils::Store &map); diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index 64b2a78fb76..8156c10b18c 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -142,8 +142,7 @@ QWidget *FindInFiles::createConfigWidget() connect(m_directory.data(), &PathChooser::textChanged, this, [this] { setSearchDir(m_directory->filePath()); }); connect(this, &BaseFileFind::searchDirChanged, m_directory, &PathChooser::setFilePath); - m_directory->setHistoryCompleter(QLatin1String(HistoryKey), - /*restoreLastItemFromHistory=*/ true); + m_directory->setHistoryCompleter(HistoryKey, /*restoreLastItemFromHistory=*/ true); if (!HistoryCompleter::historyExistsFor(QLatin1String(HistoryKey))) { auto completer = static_cast<HistoryCompleter *>(m_directory->lineEdit()->completer()); const QStringList legacyHistory = ICore::settings()->value( diff --git a/src/plugins/texteditor/icodestylepreferences.cpp b/src/plugins/texteditor/icodestylepreferences.cpp index 1f98062712c..3fffa8401a3 100644 --- a/src/plugins/texteditor/icodestylepreferences.cpp +++ b/src/plugins/texteditor/icodestylepreferences.cpp @@ -27,7 +27,7 @@ public: bool m_readOnly = false; bool m_temporarilyReadOnly = false; bool m_isAdditionalTabDisabled = false; - QString m_settingsSuffix; + Key m_settingsSuffix; }; } @@ -207,17 +207,17 @@ void ICodeStylePreferences::setCurrentDelegate(const QByteArray &id) setCurrentDelegate(d->m_pool->codeStyle(id)); } -void ICodeStylePreferences::setSettingsSuffix(const QString &suffix) +void ICodeStylePreferences::setSettingsSuffix(const Key &suffix) { d->m_settingsSuffix = suffix; } -void ICodeStylePreferences::toSettings(const QString &category) const +void ICodeStylePreferences::toSettings(const Key &category) const { Utils::toSettings(d->m_settingsSuffix, category, Core::ICore::settings(), this); } -void ICodeStylePreferences::fromSettings(const QString &category) +void ICodeStylePreferences::fromSettings(const Key &category) { Utils::fromSettings(d->m_settingsSuffix, category, Core::ICore::settings(), this); } diff --git a/src/plugins/texteditor/icodestylepreferences.h b/src/plugins/texteditor/icodestylepreferences.h index a3eedfb5c57..1305e0679a6 100644 --- a/src/plugins/texteditor/icodestylepreferences.h +++ b/src/plugins/texteditor/icodestylepreferences.h @@ -64,9 +64,9 @@ public: QByteArray currentDelegateId() const; void setCurrentDelegate(const QByteArray &id); - void setSettingsSuffix(const QString &suffix); + void setSettingsSuffix(const Utils::Key &suffix); void toSettings(const QString &category) const; - void fromSettings(const QString &category); + void fromSettings(const Utils::Key &category); // make below 2 protected? virtual Utils::Store toMap() const; diff --git a/src/plugins/texteditor/storagesettings.cpp b/src/plugins/texteditor/storagesettings.cpp index b70eb3ec144..6352bf3e566 100644 --- a/src/plugins/texteditor/storagesettings.cpp +++ b/src/plugins/texteditor/storagesettings.cpp @@ -9,7 +9,6 @@ #include <utils/settingsutils.h> #include <QRegularExpression> -#include <QString> using namespace Utils; @@ -34,15 +33,15 @@ StorageSettings::StorageSettings() { } -void StorageSettings::toSettings(const QString &category) const +void StorageSettings::toSettings(const Key &category) const { - Utils::toSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); + Utils::toSettings(groupPostfix, category, Core::ICore::settings(), this); } -void StorageSettings::fromSettings(const QString &category) +void StorageSettings::fromSettings(const Key &category) { *this = StorageSettings(); - Utils::fromSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); + Utils::fromSettings(groupPostfix, category, Core::ICore::settings(), this); } Store StorageSettings::toMap() const diff --git a/src/plugins/texteditor/storagesettings.h b/src/plugins/texteditor/storagesettings.h index bff84b6fc00..bf3ac1ba32a 100644 --- a/src/plugins/texteditor/storagesettings.h +++ b/src/plugins/texteditor/storagesettings.h @@ -14,8 +14,8 @@ class TEXTEDITOR_EXPORT StorageSettings public: StorageSettings(); - void toSettings(const QString &category) const; - void fromSettings(const QString &category); + void toSettings(const Utils::Key &category) const; + void fromSettings(const Utils::Key &category); Utils::Store toMap() const; void fromMap(const Utils::Store &map); diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index a11b564994c..2668d4f88f6 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -7,7 +7,6 @@ #include <QDebug> #include <QSettings> -#include <QString> #include <QTextCursor> #include <QTextDocument> @@ -34,18 +33,18 @@ TabSettings::TabSettings(TabSettings::TabPolicy tabPolicy, } -void TabSettings::toSettings(const QString &category, QSettings *s) const +void TabSettings::toSettings(const Key &category, QSettings *s) const { - Utils::toSettings(QLatin1String(groupPostfix), category, s, this); + Utils::toSettings(groupPostfix, category, s, this); } -void TabSettings::fromSettings(const QString &category, QSettings *s) +void TabSettings::fromSettings(const Key &category, QSettings *s) { *this = TabSettings(); // Assign defaults - Utils::fromSettings(QLatin1String(groupPostfix), category, s, this); + Utils::fromSettings(groupPostfix, category, s, this); } -QVariantMap TabSettings::toMap() const +Store TabSettings::toMap() const { return { {spacesForTabsKey, m_tabPolicy != TabsOnlyTabPolicy}, diff --git a/src/plugins/texteditor/tabsettings.h b/src/plugins/texteditor/tabsettings.h index 57adca91a05..a4a6f1c3f27 100644 --- a/src/plugins/texteditor/tabsettings.h +++ b/src/plugins/texteditor/tabsettings.h @@ -38,8 +38,8 @@ public: TabSettings(TabPolicy tabPolicy, int tabSize, int indentSize, ContinuationAlignBehavior continuationAlignBehavior); - void toSettings(const QString &category, QSettings *s) const; - void fromSettings(const QString &category, QSettings *s); + void toSettings(const Utils::Key &category, QSettings *s) const; + void fromSettings(const Utils::Key &category, QSettings *s); Utils::Store toMap() const; void fromMap(const Utils::Store &map); diff --git a/src/plugins/texteditor/typingsettings.cpp b/src/plugins/texteditor/typingsettings.cpp index 7fa6b84c7e9..402d472848c 100644 --- a/src/plugins/texteditor/typingsettings.cpp +++ b/src/plugins/texteditor/typingsettings.cpp @@ -28,15 +28,15 @@ TypingSettings::TypingSettings(): { } -void TypingSettings::toSettings(const QString &category) const +void TypingSettings::toSettings(const Key &category) const { - Utils::toSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); + Utils::toSettings(groupPostfix, category, Core::ICore::settings(), this); } -void TypingSettings::fromSettings(const QString &category) +void TypingSettings::fromSettings(const Key &category) { *this = TypingSettings(); // Assign defaults - Utils::fromSettings(QLatin1String(groupPostfix), category, Core::ICore::settings(), this); + Utils::fromSettings(groupPostfix, category, Core::ICore::settings(), this); } Store TypingSettings::toMap() const diff --git a/src/plugins/texteditor/typingsettings.h b/src/plugins/texteditor/typingsettings.h index 8cb9eee8d13..63b1e6bea18 100644 --- a/src/plugins/texteditor/typingsettings.h +++ b/src/plugins/texteditor/typingsettings.h @@ -35,8 +35,8 @@ public: bool tabShouldIndent(const QTextDocument *document, const QTextCursor &cursor, int *suggestedPosition) const; - void toSettings(const QString &category) const; - void fromSettings(const QString &category); + void toSettings(const Utils::Key &category) const; + void fromSettings(const Utils::Key &category); Utils::Store toMap() const; void fromMap(const Utils::Store &map); From 0667bdaedcce5eaa89dd6ab0ed0895fe81988ebb Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 23 Aug 2023 18:32:14 +0200 Subject: [PATCH 0849/1777] Utils/TextEditor: More use of Store and Key Change-Id: I2feb47b2e6af7a299912b0c73a0c5d8a0e18a8aa Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/persistentsettings.cpp | 58 ++++++------- src/libs/utils/persistentsettings.h | 17 ++-- src/libs/utils/settingsaccessor.cpp | 86 +++++++++---------- src/libs/utils/settingsaccessor.h | 76 ++++++++-------- src/plugins/texteditor/codestylepool.cpp | 8 +- .../texteditor/extraencodingsettings.cpp | 2 +- .../texteditor/extraencodingsettings.h | 2 +- .../texteditor/icodestylepreferences.h | 2 +- 8 files changed, 126 insertions(+), 125 deletions(-) diff --git a/src/libs/utils/persistentsettings.cpp b/src/libs/utils/persistentsettings.cpp index 2daf2934c51..d73d74387f5 100644 --- a/src/libs/utils/persistentsettings.cpp +++ b/src/libs/utils/persistentsettings.cpp @@ -110,21 +110,21 @@ struct Context // Basic context containing element name string constants. struct ParseValueStackEntry { - explicit ParseValueStackEntry(QVariant::Type t = QVariant::Invalid, const QString &k = QString()) : type(t), key(k) {} - explicit ParseValueStackEntry(const QVariant &aSimpleValue, const QString &k); + explicit ParseValueStackEntry(QVariant::Type t = QVariant::Invalid, const Key &k = {}) : type(t), key(k) {} + explicit ParseValueStackEntry(const QVariant &aSimpleValue, const Key &k); QVariant value() const; - void addChild(const QString &key, const QVariant &v); + void addChild(const Key &key, const QVariant &v); QVariant::Type type; - QString key; + Key key; QVariant simpleValue; QVariantList listValue; - QVariantMap mapValue; + Store mapValue; }; -ParseValueStackEntry::ParseValueStackEntry(const QVariant &aSimpleValue, const QString &k) : - type(aSimpleValue.type()), key(k), simpleValue(aSimpleValue) +ParseValueStackEntry::ParseValueStackEntry(const QVariant &aSimpleValue, const Key &k) + : type(aSimpleValue.type()), key(k), simpleValue(aSimpleValue) { QTC_ASSERT(simpleValue.isValid(), return); } @@ -135,7 +135,7 @@ QVariant ParseValueStackEntry::value() const case QVariant::Invalid: return QVariant(); case QVariant::Map: - return QVariant(mapValue); + return QVariant::fromValue(mapValue); case QVariant::List: return QVariant(listValue); default: @@ -144,7 +144,7 @@ QVariant ParseValueStackEntry::value() const return simpleValue; } -void ParseValueStackEntry::addChild(const QString &key, const QVariant &v) +void ParseValueStackEntry::addChild(const Key &key, const QVariant &v) { switch (type) { case QVariant::Map: @@ -163,7 +163,7 @@ void ParseValueStackEntry::addChild(const QString &key, const QVariant &v) class ParseContext : public Context { public: - QVariantMap parse(const FilePath &file); + Store parse(const FilePath &file); private: enum Element { QtCreatorElement, DataElement, VariableElement, @@ -180,11 +180,11 @@ private: static QString formatWarning(const QXmlStreamReader &r, const QString &message); QStack<ParseValueStackEntry> m_valueStack; - QVariantMap m_result; - QString m_currentVariableName; + Store m_result; + Key m_currentVariableName; }; -QVariantMap ParseContext::parse(const FilePath &file) +Store ParseContext::parse(const FilePath &file) { QXmlStreamReader r(file.fileContents().value_or(QByteArray())); @@ -204,7 +204,7 @@ QVariantMap ParseContext::parse(const FilePath &file) case QXmlStreamReader::Invalid: qWarning("Error reading %s:%d: %s", qPrintable(file.fileName()), int(r.lineNumber()), qPrintable(r.errorString())); - return QVariantMap(); + return Store(); default: break; } // switch token @@ -224,8 +224,8 @@ bool ParseContext::handleStartElement(QXmlStreamReader &r) return false; const QXmlStreamAttributes attributes = r.attributes(); - const QString key = attributes.hasAttribute(keyAttribute) ? - attributes.value(keyAttribute).toString() : QString(); + const Key key = attributes.hasAttribute(keyAttribute) ? + attributes.value(keyAttribute).toString() : Key(); switch (e) { case SimpleValueElement: { // This reads away the end element, so, handle end element right here. @@ -318,14 +318,14 @@ QVariant ParseContext::readSimpleValue(QXmlStreamReader &r, const QXmlStreamAttr PersistentSettingsReader::PersistentSettingsReader() = default; -QVariant PersistentSettingsReader::restoreValue(const QString &variable, const QVariant &defaultValue) const +QVariant PersistentSettingsReader::restoreValue(const Key &variable, const QVariant &defaultValue) const { if (m_valueMap.contains(variable)) return m_valueMap.value(variable); return defaultValue; } -QVariantMap PersistentSettingsReader::restoreValues() const +Store PersistentSettingsReader::restoreValues() const { return m_valueMap; } @@ -352,13 +352,13 @@ FilePath PersistentSettingsReader::filePath() \class Utils::PersistentSettingsWriter \inmodule QtCreator - \brief The PersistentSettingsWriter class serializes a QVariantMap of + \brief The PersistentSettingsWriter class serializes a Store of arbitrary, nested data structures to an XML file. \sa Utils::PersistentSettingsReader */ static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx, - const QVariant &variant, const QString &key = QString()) + const QVariant &variant, const Key &key = {}) { switch (static_cast<int>(variant.type())) { case static_cast<int>(QVariant::StringList): @@ -378,9 +378,9 @@ static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx, w.writeAttribute(ctx.typeAttribute, QLatin1String(QVariant::typeToName(QVariant::Map))); if (!key.isEmpty()) w.writeAttribute(ctx.keyAttribute, key); - const QVariantMap varMap = variant.toMap(); - const QVariantMap::const_iterator cend = varMap.constEnd(); - for (QVariantMap::const_iterator i = varMap.constBegin(); i != cend; ++i) + const Store varMap = variant.value<Store>(); + const Store::const_iterator cend = varMap.constEnd(); + for (Store::const_iterator i = varMap.constBegin(); i != cend; ++i) writeVariantValue(w, ctx, i.value(), i.key()); w.writeEndElement(); } @@ -410,7 +410,7 @@ PersistentSettingsWriter::PersistentSettingsWriter(const FilePath &fileName, con m_fileName(fileName), m_docType(docType) { } -bool PersistentSettingsWriter::save(const QVariantMap &data, QString *errorString) const +bool PersistentSettingsWriter::save(const Store &data, QString *errorString) const { if (data == m_savedData) return true; @@ -418,7 +418,7 @@ bool PersistentSettingsWriter::save(const QVariantMap &data, QString *errorStrin } #ifdef QT_GUI_LIB -bool PersistentSettingsWriter::save(const QVariantMap &data, QWidget *parent) const +bool PersistentSettingsWriter::save(const Store &data, QWidget *parent) const { QString errorString; const bool success = save(data, &errorString); @@ -432,12 +432,12 @@ FilePath PersistentSettingsWriter::fileName() const { return m_fileName; } //** * @brief Set contents of file (e.g. from data read from it). */ -void PersistentSettingsWriter::setContents(const QVariantMap &data) +void PersistentSettingsWriter::setContents(const Store &data) { m_savedData = data; } -bool PersistentSettingsWriter::write(const QVariantMap &data, QString *errorString) const +bool PersistentSettingsWriter::write(const Store &data, QString *errorString) const { m_fileName.parentDir().ensureWritableDir(); FileSaver saver(m_fileName, QIODevice::Text); @@ -453,8 +453,8 @@ bool PersistentSettingsWriter::write(const QVariantMap &data, QString *errorStri QCoreApplication::applicationVersion(), QDateTime::currentDateTime().toString(Qt::ISODate))); w.writeStartElement(ctx.qtCreatorElement); - const QVariantMap::const_iterator cend = data.constEnd(); - for (QVariantMap::const_iterator it = data.constBegin(); it != cend; ++it) { + const Store::const_iterator cend = data.constEnd(); + for (Store::const_iterator it = data.constBegin(); it != cend; ++it) { w.writeStartElement(ctx.dataElement); w.writeTextElement(ctx.variableElement, it.key()); writeVariantValue(w, ctx, it.value()); diff --git a/src/libs/utils/persistentsettings.h b/src/libs/utils/persistentsettings.h index 7e07f0237c6..4997433ef68 100644 --- a/src/libs/utils/persistentsettings.h +++ b/src/libs/utils/persistentsettings.h @@ -6,6 +6,7 @@ #include "utils_global.h" #include "filepath.h" +#include "store.h" #include <QVariant> @@ -19,13 +20,13 @@ class QTCREATOR_UTILS_EXPORT PersistentSettingsReader { public: PersistentSettingsReader(); - QVariant restoreValue(const QString &variable, const QVariant &defaultValue = QVariant()) const; - QVariantMap restoreValues() const; + QVariant restoreValue(const Key &variable, const QVariant &defaultValue = {}) const; + Store restoreValues() const; bool load(const FilePath &fileName); FilePath filePath(); private: - QMap<QString, QVariant> m_valueMap; + Store m_valueMap; FilePath m_filePath; }; @@ -34,21 +35,21 @@ class QTCREATOR_UTILS_EXPORT PersistentSettingsWriter public: PersistentSettingsWriter(const FilePath &fileName, const QString &docType); - bool save(const QVariantMap &data, QString *errorString) const; + bool save(const Store &data, QString *errorString) const; #ifdef QT_GUI_LIB - bool save(const QVariantMap &data, QWidget *parent) const; + bool save(const Store &data, QWidget *parent) const; #endif FilePath fileName() const; - void setContents(const QVariantMap &data); + void setContents(const Store &data); private: - bool write(const QVariantMap &data, QString *errorString) const; + bool write(const Store &data, QString *errorString) const; const FilePath m_fileName; const QString m_docType; - mutable QMap<QString, QVariant> m_savedData; + mutable Store m_savedData; }; } // namespace Utils diff --git a/src/libs/utils/settingsaccessor.cpp b/src/libs/utils/settingsaccessor.cpp index 275290674fd..09ea90033f2 100644 --- a/src/libs/utils/settingsaccessor.cpp +++ b/src/libs/utils/settingsaccessor.cpp @@ -46,9 +46,9 @@ SettingsAccessor::~SettingsAccessor() = default; /*! * Restore settings from disk and report any issues in a message box centered on \a parent. */ -QVariantMap SettingsAccessor::restoreSettings(QWidget *parent) const +Store SettingsAccessor::restoreSettings(QWidget *parent) const { - QTC_ASSERT(!m_baseFilePath.isEmpty(), return QVariantMap()); + QTC_ASSERT(!m_baseFilePath.isEmpty(), return Store()); return restoreSettings(m_baseFilePath, parent); } @@ -56,7 +56,7 @@ QVariantMap SettingsAccessor::restoreSettings(QWidget *parent) const /*! * Save \a data to disk and report any issues in a message box centered on \a parent. */ -bool SettingsAccessor::saveSettings(const QVariantMap &data, QWidget *parent) const +bool SettingsAccessor::saveSettings(const Store &data, QWidget *parent) const { QTC_CHECK(!m_docType.isEmpty()); QTC_CHECK(!m_applicationDisplayName.isEmpty()); @@ -83,14 +83,14 @@ SettingsAccessor::RestoreData SettingsAccessor::readData(const FilePath &path, Q * Store the \a data in \a path on disk. Do all the necessary preprocessing of the data. */ std::optional<SettingsAccessor::Issue> SettingsAccessor::writeData(const FilePath &path, - const QVariantMap &data, + const Store &data, QWidget *parent) const { Q_UNUSED(parent) return writeFile(path, prepareToWriteSettings(data)); } -QVariantMap SettingsAccessor::restoreSettings(const FilePath &settingsPath, QWidget *parent) const +Store SettingsAccessor::restoreSettings(const FilePath &settingsPath, QWidget *parent) const { QTC_CHECK(!m_docType.isEmpty()); QTC_CHECK(!m_applicationDisplayName.isEmpty()); @@ -99,7 +99,7 @@ QVariantMap SettingsAccessor::restoreSettings(const FilePath &settingsPath, QWid const ProceedInfo pi = result.hasIssue() ? reportIssues(result.issue.value(), result.path, parent) : ProceedInfo::Continue; - return pi == ProceedInfo::DiscardAndContinue ? QVariantMap() : result.data; + return pi == ProceedInfo::DiscardAndContinue ? Store() : result.data; } /*! @@ -116,7 +116,7 @@ SettingsAccessor::RestoreData SettingsAccessor::readFile(const FilePath &path) c .arg(path.toUserOutput()), Issue::Type::ERROR)); } - const QVariantMap data = reader.restoreValues(); + const Store data = reader.restoreValues(); if (!m_readOnly && path == m_baseFilePath) { if (!m_writer) m_writer = std::make_unique<PersistentSettingsWriter>(m_baseFilePath, m_docType); @@ -132,7 +132,7 @@ SettingsAccessor::RestoreData SettingsAccessor::readFile(const FilePath &path) c * This method does not do *any* processing of the file contents. */ std::optional<SettingsAccessor::Issue> SettingsAccessor::writeFile(const FilePath &path, - const QVariantMap &data) const + const Store &data) const { if (data.isEmpty()) { return Issue(Tr::tr("Failed to Write File"), @@ -175,7 +175,7 @@ SettingsAccessor::reportIssues(const Issue &issue, const FilePath &path, QWidget /*! * This method is called right after reading data from disk and modifies \a data. */ -QVariantMap SettingsAccessor::preprocessReadSettings(const QVariantMap &data) const +Store SettingsAccessor::preprocessReadSettings(const Store &data) const { return data; } @@ -183,7 +183,7 @@ QVariantMap SettingsAccessor::preprocessReadSettings(const QVariantMap &data) co /*! * This method is called right before writing data to disk and modifies \a data. */ -QVariantMap SettingsAccessor::prepareToWriteSettings(const QVariantMap &data) const +Store SettingsAccessor::prepareToWriteSettings(const Store &data) const { return data; } @@ -212,9 +212,9 @@ int BackUpStrategy::compare(const SettingsAccessor::RestoreData &data1, return 0; } -std::optional<FilePath> BackUpStrategy::backupName(const QVariantMap &oldData, +std::optional<FilePath> BackUpStrategy::backupName(const Store &oldData, const FilePath &path, - const QVariantMap &data) const + const Store &data) const { if (oldData == data) return std::nullopt; @@ -230,7 +230,7 @@ BackingUpSettingsAccessor::readData(const FilePath &path, QWidget *parent) const { const FilePaths fileList = readFileCandidates(path); if (fileList.isEmpty()) // No settings found at all. - return RestoreData(path, QVariantMap()); + return RestoreData(path, Store()); RestoreData result = bestReadFileData(fileList, parent); if (result.path.isEmpty()) @@ -253,7 +253,7 @@ BackingUpSettingsAccessor::readData(const FilePath &path, QWidget *parent) const } std::optional<SettingsAccessor::Issue> BackingUpSettingsAccessor::writeData(const FilePath &path, - const QVariantMap &data, + const Store &data, QWidget *parent) const { if (data.isEmpty()) @@ -290,7 +290,7 @@ BackingUpSettingsAccessor::bestReadFileData(const FilePaths &candidates, QWidget return bestMatch; } -void BackingUpSettingsAccessor::backupFile(const FilePath &path, const QVariantMap &data, +void BackingUpSettingsAccessor::backupFile(const FilePath &path, const Store &data, QWidget *parent) const { RestoreData oldSettings = SettingsAccessor::readData(path, parent); @@ -331,9 +331,9 @@ int VersionedBackUpStrategy::compare(const SettingsAccessor::RestoreData &data1, return -1; } -std::optional<FilePath> VersionedBackUpStrategy::backupName(const QVariantMap &oldData, +std::optional<FilePath> VersionedBackUpStrategy::backupName(const Store &oldData, const FilePath &path, - const QVariantMap &data) const + const Store &data) const { Q_UNUSED(data) FilePath backupName = path; @@ -374,7 +374,7 @@ QString VersionUpgrader::backupExtension() const /*! * Performs a simple renaming of the listed keys in \a changes recursively on \a map. */ -QVariantMap VersionUpgrader::renameKeys(const QList<Change> &changes, QVariantMap map) const +Store VersionUpgrader::renameKeys(const QList<Change> &changes, Store map) const { for (const Change &change : changes) { const auto oldSetting = map.constFind(change.first); @@ -384,11 +384,11 @@ QVariantMap VersionUpgrader::renameKeys(const QList<Change> &changes, QVariantMa } } - QVariantMap::iterator i = map.begin(); + Store::iterator i = map.begin(); while (i != map.end()) { QVariant v = i.value(); if (v.type() == QVariant::Map) - i.value() = renameKeys(changes, v.toMap()); + i.value() = renameKeys(changes, v.value<Store>()); ++i; } @@ -433,9 +433,9 @@ SettingsAccessor::RestoreData UpgradingSettingsAccessor::readData(const FilePath return upgradeSettings(BackingUpSettingsAccessor::readData(path, parent), currentVersion()); } -QVariantMap UpgradingSettingsAccessor::prepareToWriteSettings(const QVariantMap &data) const +Store UpgradingSettingsAccessor::prepareToWriteSettings(const Store &data) const { - QVariantMap tmp = BackingUpSettingsAccessor::prepareToWriteSettings(data); + Store tmp = BackingUpSettingsAccessor::prepareToWriteSettings(data); setVersionInMap(tmp,currentVersion()); if (!m_id.isEmpty()) @@ -639,7 +639,7 @@ MergingSettingsAccessor::mergeSettings(const SettingsAccessor::RestoreData &main = [this](const SettingsMergeData &global, const SettingsMergeData &local) { return merge(global, local); }; - const QVariantMap result = mergeQVariantMaps(main.data, secondary.data, mergeFunction).toMap(); + const Store result = mergeQVariantMaps(main.data, secondary.data, mergeFunction).value<Store>(); // Update from the base version to Creator's version. return RestoreData(main.path, postprocessMerge(main.data, secondary.data, result)); @@ -653,9 +653,9 @@ bool MergingSettingsAccessor::isHouseKeepingKey(const QString &key) return key == VERSION_KEY || key == ORIGINAL_VERSION_KEY || key == SETTINGS_ID_KEY; } -QVariantMap MergingSettingsAccessor::postprocessMerge(const QVariantMap &main, - const QVariantMap &secondary, - const QVariantMap &result) const +Store MergingSettingsAccessor::postprocessMerge(const Store &main, + const Store &secondary, + const Store &result) const { Q_UNUSED(main) Q_UNUSED(secondary) @@ -666,56 +666,56 @@ QVariantMap MergingSettingsAccessor::postprocessMerge(const QVariantMap &main, // Helper functions: // -------------------------------------------------------------------- -int versionFromMap(const QVariantMap &data) +int versionFromMap(const Store &data) { return data.value(VERSION_KEY, -1).toInt(); } -int originalVersionFromMap(const QVariantMap &data) +int originalVersionFromMap(const Store &data) { return data.value(ORIGINAL_VERSION_KEY, versionFromMap(data)).toInt(); } -QByteArray settingsIdFromMap(const QVariantMap &data) +QByteArray settingsIdFromMap(const Store &data) { return data.value(SETTINGS_ID_KEY).toByteArray(); } -void setOriginalVersionInMap(QVariantMap &data, int version) +void setOriginalVersionInMap(Store &data, int version) { data.insert(ORIGINAL_VERSION_KEY, version); } -void setVersionInMap(QVariantMap &data, int version) +void setVersionInMap(Store &data, int version) { data.insert(VERSION_KEY, version); } -void setSettingsIdInMap(QVariantMap &data, const QByteArray &id) +void setSettingsIdInMap(Store &data, const QByteArray &id) { data.insert(SETTINGS_ID_KEY, id); } -static QVariant mergeQVariantMapsRecursion(const QVariantMap &mainTree, const QVariantMap &secondaryTree, +static QVariant mergeQVariantMapsRecursion(const Store &mainTree, const Store &secondaryTree, const QString &keyPrefix, - const QVariantMap &mainSubtree, const QVariantMap &secondarySubtree, + const Store &mainSubtree, const Store &secondarySubtree, const SettingsMergeFunction &merge) { - QVariantMap result; - const QList<QString> allKeys = filteredUnique(mainSubtree.keys() + secondarySubtree.keys()); + Store result; + const QList<Key> allKeys = filteredUnique(mainSubtree.keys() + secondarySubtree.keys()); - MergingSettingsAccessor::SettingsMergeData global = {mainTree, secondaryTree, QString()}; - MergingSettingsAccessor::SettingsMergeData local = {mainSubtree, secondarySubtree, QString()}; + MergingSettingsAccessor::SettingsMergeData global = {mainTree, secondaryTree, Key()}; + MergingSettingsAccessor::SettingsMergeData local = {mainSubtree, secondarySubtree, Key()}; - for (const QString &key : allKeys) { + for (const Key &key : allKeys) { global.key = keyPrefix + key; local.key = key; - std::optional<QPair<QString, QVariant>> mergeResult = merge(global, local); + std::optional<QPair<Key, QVariant>> mergeResult = merge(global, local); if (!mergeResult) continue; - QPair<QString, QVariant> kv = mergeResult.value(); + QPair<Key, QVariant> kv = mergeResult.value(); if (kv.second.type() == QVariant::Map) { const QString newKeyPrefix = keyPrefix + kv.first + '/'; @@ -727,10 +727,10 @@ static QVariant mergeQVariantMapsRecursion(const QVariantMap &mainTree, const QV result.insert(kv.first, kv.second); } - return result; + return QVariant::fromValue(result); } -QVariant mergeQVariantMaps(const QVariantMap &mainTree, const QVariantMap &secondaryTree, +QVariant mergeQVariantMaps(const Store &mainTree, const Store &secondaryTree, const SettingsMergeFunction &merge) { return mergeQVariantMapsRecursion(mainTree, secondaryTree, QString(), diff --git a/src/libs/utils/settingsaccessor.h b/src/libs/utils/settingsaccessor.h index 683743ac62f..b09c0958a3d 100644 --- a/src/libs/utils/settingsaccessor.h +++ b/src/libs/utils/settingsaccessor.h @@ -6,10 +6,10 @@ #include "utils_global.h" #include "filepath.h" +#include "store.h" #include <QHash> #include <QMessageBox> -#include <QVariantMap> #include <memory> #include <optional> @@ -20,25 +20,25 @@ namespace Utils { // Helper: // ----------------------------------------------------------------------------- -QTCREATOR_UTILS_EXPORT int versionFromMap(const QVariantMap &data); -QTCREATOR_UTILS_EXPORT int originalVersionFromMap(const QVariantMap &data); -QTCREATOR_UTILS_EXPORT QByteArray settingsIdFromMap(const QVariantMap &data); +QTCREATOR_UTILS_EXPORT int versionFromMap(const Store &data); +QTCREATOR_UTILS_EXPORT int originalVersionFromMap(const Store &data); +QTCREATOR_UTILS_EXPORT QByteArray settingsIdFromMap(const Store &data); -QTCREATOR_UTILS_EXPORT void setVersionInMap(QVariantMap &data, int version); -QTCREATOR_UTILS_EXPORT void setOriginalVersionInMap(QVariantMap &data, int version); -QTCREATOR_UTILS_EXPORT void setSettingsIdInMap(QVariantMap &data, const QByteArray &id); +QTCREATOR_UTILS_EXPORT void setVersionInMap(Store &data, int version); +QTCREATOR_UTILS_EXPORT void setOriginalVersionInMap(Store &data, int version); +QTCREATOR_UTILS_EXPORT void setSettingsIdInMap(Store &data, const QByteArray &id); // -------------------------------------------------------------------- // Helpers: // -------------------------------------------------------------------- -QTCREATOR_UTILS_EXPORT int versionFromMap(const QVariantMap &data); -QTCREATOR_UTILS_EXPORT int originalVersionFromMap(const QVariantMap &data); -QTCREATOR_UTILS_EXPORT QByteArray settingsIdFromMap(const QVariantMap &data); +QTCREATOR_UTILS_EXPORT int versionFromMap(const Store &data); +QTCREATOR_UTILS_EXPORT int originalVersionFromMap(const Store &data); +QTCREATOR_UTILS_EXPORT QByteArray settingsIdFromMap(const Store &data); -QTCREATOR_UTILS_EXPORT void setVersionInMap(QVariantMap &data, int version); -QTCREATOR_UTILS_EXPORT void setOriginalVersionInMap(QVariantMap &data, int version); -QTCREATOR_UTILS_EXPORT void setSettingsIdInMap(QVariantMap &data, const QByteArray &id); +QTCREATOR_UTILS_EXPORT void setVersionInMap(Store &data, int version); +QTCREATOR_UTILS_EXPORT void setOriginalVersionInMap(Store &data, int version); +QTCREATOR_UTILS_EXPORT void setSettingsIdInMap(Store &data, const QByteArray &id); class PersistentSettingsWriter; using SettingsMergeResult = std::optional<QPair<QString, QVariant>>; @@ -76,7 +76,7 @@ public: class RestoreData { public: RestoreData() = default; - RestoreData(const FilePath &path, const QVariantMap &data) : path{path}, data{data} { } + RestoreData(const FilePath &path, const Store &data) : path{path}, data{data} { } RestoreData(const QString &title, const QString &message, const Issue::Type type) : RestoreData(Issue(title, message, type)) { } @@ -87,12 +87,12 @@ public: bool hasWarning() const { return hasIssue() && issue.value().type == Issue::Type::WARNING; } FilePath path; - QVariantMap data; + Store data; std::optional<Issue> issue; }; - QVariantMap restoreSettings(QWidget *parent) const; - bool saveSettings(const QVariantMap &data, QWidget *parent) const; + Store restoreSettings(QWidget *parent) const; + bool saveSettings(const Store &data, QWidget *parent) const; void setBaseFilePath(const FilePath &baseFilePath) { m_baseFilePath = baseFilePath; } void setReadOnly() { m_readOnly = true; } @@ -100,7 +100,7 @@ public: virtual RestoreData readData(const FilePath &path, QWidget *parent) const; virtual std::optional<Issue> writeData(const FilePath &path, - const QVariantMap &data, + const Store &data, QWidget *parent) const; void setDocType(const QString &docType) { m_docType = docType; } @@ -108,14 +108,14 @@ public: protected: // Report errors: - QVariantMap restoreSettings(const FilePath &settingsPath, QWidget *parent) const; + Store restoreSettings(const FilePath &settingsPath, QWidget *parent) const; static ProceedInfo reportIssues(const Issue &issue, const FilePath &path, QWidget *parent); - virtual QVariantMap preprocessReadSettings(const QVariantMap &data) const; - virtual QVariantMap prepareToWriteSettings(const QVariantMap &data) const; + virtual Store preprocessReadSettings(const Store &data) const; + virtual Store prepareToWriteSettings(const Store &data) const; virtual RestoreData readFile(const FilePath &path) const; - virtual std::optional<Issue> writeFile(const FilePath &path, const QVariantMap &data) const; + virtual std::optional<Issue> writeFile(const FilePath &path, const Store &data) const; QString m_docType; QString m_applicationDisplayName; @@ -141,9 +141,9 @@ public: virtual int compare(const SettingsAccessor::RestoreData &data1, const SettingsAccessor::RestoreData &data2) const; - virtual std::optional<FilePath> backupName(const QVariantMap &oldData, + virtual std::optional<FilePath> backupName(const Store &oldData, const FilePath &path, - const QVariantMap &data) const; + const Store &data) const; }; class QTCREATOR_UTILS_EXPORT BackingUpSettingsAccessor : public SettingsAccessor @@ -153,7 +153,7 @@ public: RestoreData readData(const FilePath &path, QWidget *parent) const override; std::optional<Issue> writeData(const FilePath &path, - const QVariantMap &data, + const Store &data, QWidget *parent) const override; BackUpStrategy *strategy() const { return m_strategy.get(); } @@ -162,7 +162,7 @@ public: private: FilePaths readFileCandidates(const FilePath &path) const; RestoreData bestReadFileData(const FilePaths &candidates, QWidget *parent) const; - void backupFile(const FilePath &path, const QVariantMap &data, QWidget *parent) const; + void backupFile(const FilePath &path, const Store &data, QWidget *parent) const; std::unique_ptr<BackUpStrategy> m_strategy; }; @@ -183,9 +183,9 @@ public: int compare(const SettingsAccessor::RestoreData &data1, const SettingsAccessor::RestoreData &data2) const override; - std::optional<FilePath> backupName(const QVariantMap &oldData, + std::optional<FilePath> backupName(const Store &oldData, const FilePath &path, - const QVariantMap &data) const override; + const Store &data) const override; const UpgradingSettingsAccessor *accessor() const { return m_accessor; } @@ -193,7 +193,7 @@ protected: const UpgradingSettingsAccessor *m_accessor = nullptr; }; -// Handles updating a QVariantMap from version() to version() + 1 +// Handles updating a Store from version() to version() + 1 class QTCREATOR_UTILS_EXPORT VersionUpgrader { public: @@ -203,11 +203,11 @@ public: int version() const; QString backupExtension() const; - virtual QVariantMap upgrade(const QVariantMap &data) = 0; + virtual Store upgrade(const Store &data) = 0; protected: using Change = QPair<QLatin1String, QLatin1String>; - QVariantMap renameKeys(const QList<Change> &changes, QVariantMap map) const; + Store renameKeys(const QList<Change> &changes, Store map) const; private: const int m_version; @@ -233,7 +233,7 @@ public: RestoreData readData(const FilePath &path, QWidget *parent) const override; protected: - QVariantMap prepareToWriteSettings(const QVariantMap &data) const override; + Store prepareToWriteSettings(const Store &data) const override; void setSettingsId(const QByteArray &id) { m_id = id; } @@ -254,9 +254,9 @@ class QTCREATOR_UTILS_EXPORT MergingSettingsAccessor : public UpgradingSettingsA { public: struct SettingsMergeData { - QVariantMap main; - QVariantMap secondary; - QString key; + Store main; + Store secondary; + Key key; }; MergingSettingsAccessor(); @@ -273,8 +273,8 @@ protected: const SettingsMergeData &local) const = 0; static bool isHouseKeepingKey(const QString &key); - virtual QVariantMap postprocessMerge(const QVariantMap &main, const QVariantMap &secondary, - const QVariantMap &result) const; + virtual Store postprocessMerge(const Store &main, const Store &secondary, + const Store &result) const; private: std::unique_ptr<SettingsAccessor> m_secondaryAccessor; @@ -282,7 +282,7 @@ private: using SettingsMergeFunction = std::function<SettingsMergeResult(const MergingSettingsAccessor::SettingsMergeData &, const MergingSettingsAccessor::SettingsMergeData &)>; -QTCREATOR_UTILS_EXPORT QVariant mergeQVariantMaps(const QVariantMap &mainTree, const QVariantMap &secondaryTree, +QTCREATOR_UTILS_EXPORT QVariant mergeQVariantMaps(const Store &mainTree, const Store &secondaryTree, const SettingsMergeFunction &merge); } // namespace Utils diff --git a/src/plugins/texteditor/codestylepool.cpp b/src/plugins/texteditor/codestylepool.cpp index 573d5ea456e..30e74ecfca0 100644 --- a/src/plugins/texteditor/codestylepool.cpp +++ b/src/plugins/texteditor/codestylepool.cpp @@ -208,7 +208,7 @@ ICodeStylePreferences *CodeStylePool::loadCodeStyle(const FilePath &fileName) if (m.contains(QLatin1String(codeStyleDataKey))) { const QByteArray id = fileName.completeBaseName().toUtf8(); const QString displayName = reader.restoreValue(QLatin1String(displayNameKey)).toString(); - const QVariantMap map = reader.restoreValue(QLatin1String(codeStyleDataKey)).toMap(); + const Store map = reader.restoreValue(codeStyleDataKey).value<Store>(); if (d->m_factory) { codeStyle = d->m_factory->createCodeStyle(); codeStyle->setId(id); @@ -242,10 +242,10 @@ void CodeStylePool::saveCodeStyle(ICodeStylePreferences *codeStyle) const void CodeStylePool::exportCodeStyle(const FilePath &fileName, ICodeStylePreferences *codeStyle) const { - const QVariantMap map = codeStyle->toMap(); - const QVariantMap tmp = { + const Store map = codeStyle->toMap(); + const Store tmp = { {displayNameKey, codeStyle->displayName()}, - {codeStyleDataKey, map} + {codeStyleDataKey, QVariant::fromValue(map)} }; PersistentSettingsWriter writer(fileName, QLatin1String(codeStyleDocKey)); writer.save(tmp, Core::ICore::dialogParent()); diff --git a/src/plugins/texteditor/extraencodingsettings.cpp b/src/plugins/texteditor/extraencodingsettings.cpp index 91587f19464..dd724488ad8 100644 --- a/src/plugins/texteditor/extraencodingsettings.cpp +++ b/src/plugins/texteditor/extraencodingsettings.cpp @@ -38,7 +38,7 @@ void ExtraEncodingSettings::fromSettings(const Key &category) Utils::fromSettings(kGroupPostfix, Key(), Core::ICore::settings(), this); } -QVariantMap ExtraEncodingSettings::toMap() const +Store ExtraEncodingSettings::toMap() const { return { {kUtf8BomBehaviorKey, m_utf8BomSetting} diff --git a/src/plugins/texteditor/extraencodingsettings.h b/src/plugins/texteditor/extraencodingsettings.h index 7f64dd09938..6dcff332e4e 100644 --- a/src/plugins/texteditor/extraencodingsettings.h +++ b/src/plugins/texteditor/extraencodingsettings.h @@ -15,7 +15,7 @@ public: ExtraEncodingSettings(); ~ExtraEncodingSettings(); - void toSettings(const QString &category) const; + void toSettings(const Utils::Key &category) const; void fromSettings(const Utils::Key &category); Utils::Store toMap() const; diff --git a/src/plugins/texteditor/icodestylepreferences.h b/src/plugins/texteditor/icodestylepreferences.h index 1305e0679a6..450941997f8 100644 --- a/src/plugins/texteditor/icodestylepreferences.h +++ b/src/plugins/texteditor/icodestylepreferences.h @@ -65,7 +65,7 @@ public: void setCurrentDelegate(const QByteArray &id); void setSettingsSuffix(const Utils::Key &suffix); - void toSettings(const QString &category) const; + void toSettings(const Utils::Key &category) const; void fromSettings(const Utils::Key &category); // make below 2 protected? From 5254765e164611bf02ea03ec8c6ba7fa496b46a1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 22 Aug 2023 09:54:38 +0200 Subject: [PATCH 0850/1777] ProjectExplorer: Re-organize KitAspect layouting related functions Less obscure as it's fairly close to the standard pattern now. Change-Id: I4680465fbdb9fb6a458c18ef0534e4d8a4a31d1e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../cmakeprojectmanager/cmakebuildconfiguration.cpp | 6 +++--- src/plugins/cmakeprojectmanager/cmakekitaspect.cpp | 6 +++--- src/plugins/debugger/debuggerkitaspect.cpp | 2 +- src/plugins/mcusupport/mcukitaspect.cpp | 2 +- .../mesonprojectmanager/toolkitaspectwidget.h | 2 +- src/plugins/projectexplorer/kitaspects.cpp | 12 ++++++------ src/plugins/projectexplorer/kitmanager.cpp | 4 ++-- src/plugins/projectexplorer/kitmanager.h | 4 +++- .../projectexplorer/kitmanagerconfigwidget.cpp | 2 +- src/plugins/qbsprojectmanager/qbskitaspect.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakekitaspect.cpp | 2 +- src/plugins/qtsupport/qtkitaspect.cpp | 12 ++++++------ 12 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 228e74336ca..6fab3af48db 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -651,13 +651,13 @@ void CMakeBuildSettingsWidget::kitCMakeConfiguration() Layouting::Grid grid; KitAspect *widget = CMakeKitAspect::createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); - widget->addToLayoutWithLabel(grid); + widget->addToLayout(grid); widget = CMakeGeneratorKitAspect::createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); - widget->addToLayoutWithLabel(grid); + widget->addToLayout(grid); widget = CMakeConfigurationKitAspect::createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); - widget->addToLayoutWithLabel(grid); + widget->addToLayout(grid); grid.attachTo(dialog); auto layout = qobject_cast<QGridLayout *>(dialog->layout()); diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp index b3c4826ef2c..2c2b440b8ab 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp @@ -149,7 +149,7 @@ private: // KitAspectWidget interface void makeReadOnly() override { m_comboBox->setEnabled(false); } - void addToLayout(Layouting::LayoutItem &builder) override + void addToLayoutImpl(Layouting::LayoutItem &builder) override { addMutableAction(m_comboBox); builder.addItem(m_comboBox); @@ -373,7 +373,7 @@ private: // KitAspectWidget interface void makeReadOnly() override { m_changeButton->setEnabled(false); } - void addToLayout(Layouting::LayoutItem &parent) override + void addToLayoutImpl(Layouting::LayoutItem &parent) override { addMutableAction(m_label); parent.addItem(m_label); @@ -912,7 +912,7 @@ public: private: // KitAspectWidget interface - void addToLayout(Layouting::LayoutItem &parent) override + void addToLayoutImpl(Layouting::LayoutItem &parent) override { addMutableAction(m_summaryLabel); parent.addItem(m_summaryLabel); diff --git a/src/plugins/debugger/debuggerkitaspect.cpp b/src/plugins/debugger/debuggerkitaspect.cpp index af3c4050cb6..54548ced074 100644 --- a/src/plugins/debugger/debuggerkitaspect.cpp +++ b/src/plugins/debugger/debuggerkitaspect.cpp @@ -66,7 +66,7 @@ public: } private: - void addToLayout(Layouting::LayoutItem &parent) override + void addToLayoutImpl(Layouting::LayoutItem &parent) override { addMutableAction(m_comboBox); parent.addItem(m_comboBox); diff --git a/src/plugins/mcusupport/mcukitaspect.cpp b/src/plugins/mcusupport/mcukitaspect.cpp index 3a26f37614d..f53dcacfd04 100644 --- a/src/plugins/mcusupport/mcukitaspect.cpp +++ b/src/plugins/mcusupport/mcukitaspect.cpp @@ -24,7 +24,7 @@ public: void makeReadOnly() override {} void refresh() override {} - void addToLayout(Layouting::LayoutItem &) override {} + void addToLayoutImpl(Layouting::LayoutItem &) override {} }; Utils::Id McuDependenciesKitAspect::id() diff --git a/src/plugins/mesonprojectmanager/toolkitaspectwidget.h b/src/plugins/mesonprojectmanager/toolkitaspectwidget.h index 3cfb186b4f9..9a354dc1e75 100644 --- a/src/plugins/mesonprojectmanager/toolkitaspectwidget.h +++ b/src/plugins/mesonprojectmanager/toolkitaspectwidget.h @@ -36,7 +36,7 @@ private: void makeReadOnly() override { m_toolsComboBox->setEnabled(false); } - void addToLayout(Layouting::LayoutItem &parent) override + void addToLayoutImpl(Layouting::LayoutItem &parent) override { addMutableAction(m_toolsComboBox); parent.addItem(m_toolsComboBox); diff --git a/src/plugins/projectexplorer/kitaspects.cpp b/src/plugins/projectexplorer/kitaspects.cpp index 825af13628f..7bd7435d143 100644 --- a/src/plugins/projectexplorer/kitaspects.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -64,7 +64,7 @@ public: private: void makeReadOnly() override { m_chooser->setReadOnly(true); } - void addToLayout(Layouting::LayoutItem &builder) override + void addToLayoutImpl(Layouting::LayoutItem &builder) override { addMutableAction(m_chooser); builder.addItem(Layouting::Span(2, m_chooser)); @@ -241,7 +241,7 @@ public: } private: - void addToLayout(Layouting::LayoutItem &builder) override + void addToLayoutImpl(Layouting::LayoutItem &builder) override { addMutableAction(m_mainWidget); builder.addItem(m_mainWidget); @@ -810,7 +810,7 @@ public: ~DeviceTypeKitAspectImpl() override { delete m_comboBox; } private: - void addToLayout(Layouting::LayoutItem &builder) override + void addToLayoutImpl(Layouting::LayoutItem &builder) override { addMutableAction(m_comboBox); builder.addItem(m_comboBox); @@ -959,7 +959,7 @@ public: } private: - void addToLayout(Layouting::LayoutItem &builder) override + void addToLayoutImpl(Layouting::LayoutItem &builder) override { addMutableAction(m_comboBox); builder.addItem(m_comboBox); @@ -1241,7 +1241,7 @@ public: } private: - void addToLayout(Layouting::LayoutItem &builder) override + void addToLayoutImpl(Layouting::LayoutItem &builder) override { addMutableAction(m_comboBox); builder.addItem(m_comboBox); @@ -1506,7 +1506,7 @@ public: } private: - void addToLayout(Layouting::LayoutItem &builder) override + void addToLayoutImpl(Layouting::LayoutItem &builder) override { addMutableAction(m_mainWidget); builder.addItem(m_mainWidget); diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 9685f35c2e9..5215d15fbf0 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -734,7 +734,7 @@ KitAspect::~KitAspect() delete m_mutableAction; } -void KitAspect::addToLayoutWithLabel(Layouting::LayoutItem &parentItem) +void KitAspect::addToLayout(Layouting::LayoutItem &parentItem) { auto label = createSubWidget<QLabel>(m_factory->displayName() + ':'); label->setToolTip(m_factory->description()); @@ -743,7 +743,7 @@ void KitAspect::addToLayoutWithLabel(Layouting::LayoutItem &parentItem) }); parentItem.addItem(label); - addToLayout(parentItem); + addToLayoutImpl(parentItem); parentItem.addItem(Layouting::br); } diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index db11d3afb94..a71538cef9c 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -113,7 +113,7 @@ public: virtual void makeReadOnly() = 0; virtual void refresh() = 0; - void addToLayoutWithLabel(Layouting::LayoutItem &parentItem); + void addToLayout(Layouting::LayoutItem &parentItem) override; static QString msgManage(); @@ -124,6 +124,8 @@ public: QWidget *createManageButton(Utils::Id pageId); protected: + virtual void addToLayoutImpl(Layouting::LayoutItem &parentItem) = 0; + Kit *m_kit; const KitAspectFactory *m_factory; QAction *m_mutableAction = nullptr; diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index 98b14cee309..b939921ebec 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -201,7 +201,7 @@ void KitManagerConfigWidget::addAspectToWorkingCopy(Layouting::LayoutItem &paren QTC_ASSERT(aspect, return); QTC_ASSERT(!m_kitAspects.contains(aspect), return); - aspect->addToLayoutWithLabel(parent); + aspect->addToLayout(parent); m_kitAspects.append(aspect); connect(aspect->mutableAction(), &QAction::toggled, diff --git a/src/plugins/qbsprojectmanager/qbskitaspect.cpp b/src/plugins/qbsprojectmanager/qbskitaspect.cpp index e709a0d2bcb..647f44f02c7 100644 --- a/src/plugins/qbsprojectmanager/qbskitaspect.cpp +++ b/src/plugins/qbsprojectmanager/qbskitaspect.cpp @@ -34,7 +34,7 @@ private: void makeReadOnly() override { m_changeButton->setEnabled(false); } void refresh() override { m_contentLabel->setText(QbsKitAspect::representation(kit())); } - void addToLayout(Layouting::LayoutItem &parent) override + void addToLayoutImpl(Layouting::LayoutItem &parent) override { addMutableAction(m_contentLabel); parent.addItem(m_contentLabel); diff --git a/src/plugins/qmakeprojectmanager/qmakekitaspect.cpp b/src/plugins/qmakeprojectmanager/qmakekitaspect.cpp index 7fc5bec0a58..18033f9dfc1 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitaspect.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitaspect.cpp @@ -39,7 +39,7 @@ public: ~QmakeKitAspectImpl() override { delete m_lineEdit; } private: - void addToLayout(Layouting::LayoutItem &parent) override + void addToLayoutImpl(Layouting::LayoutItem &parent) override { addMutableAction(m_lineEdit); parent.addItem(m_lineEdit); diff --git a/src/plugins/qtsupport/qtkitaspect.cpp b/src/plugins/qtsupport/qtkitaspect.cpp index 5fcb91acdd8..d6fa4a21225 100644 --- a/src/plugins/qtsupport/qtkitaspect.cpp +++ b/src/plugins/qtsupport/qtkitaspect.cpp @@ -30,10 +30,10 @@ using namespace Utils; namespace QtSupport { namespace Internal { -class QtKitAspectWidget final : public KitAspect +class QtKitAspectImpl final : public KitAspect { public: - QtKitAspectWidget(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki) + QtKitAspectImpl(Kit *k, const KitAspectFactory *ki) : KitAspect(k, ki) { m_combo = createSubWidget<QComboBox>(); m_combo->setSizePolicy(QSizePolicy::Ignored, m_combo->sizePolicy().verticalPolicy()); @@ -51,10 +51,10 @@ public: connect(QtVersionManager::instance(), &QtVersionManager::qtVersionsChanged, this, - &QtKitAspectWidget::refresh); + &QtKitAspectImpl::refresh); } - ~QtKitAspectWidget() final + ~QtKitAspectImpl() final { delete m_combo; delete m_manageButton; @@ -63,7 +63,7 @@ public: private: void makeReadOnly() final { m_combo->setEnabled(false); } - void addToLayout(Layouting::LayoutItem &parent) + void addToLayoutImpl(Layouting::LayoutItem &parent) { addMutableAction(m_combo); parent.addItem(m_combo); @@ -293,7 +293,7 @@ void QtKitAspectFactory::fix(Kit *k) KitAspect *QtKitAspectFactory::createKitAspect(Kit *k) const { QTC_ASSERT(k, return nullptr); - return new Internal::QtKitAspectWidget(k, this); + return new Internal::QtKitAspectImpl(k, this); } QString QtKitAspectFactory::displayNamePostfix(const Kit *k) const From 91c1fdb457cece3080e1a44e05db7fdde6bd4dfb Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 23 Aug 2023 12:04:40 +0200 Subject: [PATCH 0851/1777] Android: Three more simple aspects for AndroidBuildApkStep Change-Id: Ida4012ab21aa6a05d2222f41350065a38618b9b0 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/android/androidbuildapkstep.cpp | 49 +++++---------------- src/plugins/android/androidbuildapkstep.h | 10 +---- 2 files changed, 13 insertions(+), 46 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index d76ea78c4d6..0337af54287 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -72,7 +72,6 @@ static Q_LOGGING_CATEGORY(buildapkstepLog, "qtc.android.build.androidbuildapkste const char KeystoreLocationKey[] = "KeystoreLocation"; const char BuildTargetSdkKey[] = "BuildTargetSdk"; const char BuildToolsVersionKey[] = "BuildToolsVersion"; -const char VerboseOutputKey[] = "VerboseOutput"; class PasswordInputDialog : public QDialog { @@ -286,11 +285,6 @@ QWidget *AndroidBuildApkWidget::createAdvancedGroup() { auto group = new QGroupBox(Tr::tr("Advanced Actions"), this); - auto openPackageLocationCheckBox = new QCheckBox(Tr::tr("Open package location after build"), group); - openPackageLocationCheckBox->setChecked(m_step->openPackageLocation()); - connect(openPackageLocationCheckBox, &QAbstractButton::toggled, - this, [this](bool checked) { m_step->setOpenPackageLocation(checked); }); - m_addDebuggerCheckBox = new QCheckBox(Tr::tr("Add debug server"), group); m_addDebuggerCheckBox->setEnabled(false); m_addDebuggerCheckBox->setToolTip(Tr::tr("Packages debug server with " @@ -299,19 +293,13 @@ QWidget *AndroidBuildApkWidget::createAdvancedGroup() connect(m_addDebuggerCheckBox, &QAbstractButton::toggled, m_step, &AndroidBuildApkStep::setAddDebugger); - auto verboseOutputCheckBox = new QCheckBox(Tr::tr("Verbose output"), group); - verboseOutputCheckBox->setChecked(m_step->verboseOutput()); - Layouting::Column { m_step->buildAAB, - openPackageLocationCheckBox, - verboseOutputCheckBox, + m_step->openPackageLocation, + m_step->verboseOutput, m_addDebuggerCheckBox }.attachTo(group); - connect(verboseOutputCheckBox, &QAbstractButton::toggled, - this, [this](bool checked) { m_step->setVerboseOutput(checked); }); - return group; } @@ -476,9 +464,16 @@ AndroidBuildApkStep::AndroidBuildApkStep(BuildStepList *parent, Utils::Id id) QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit()); + // FIXME: This is not saved due to missing setSettingsKey(). Intentional? buildAAB.setLabelText(Tr::tr("Build Android App Bundle (*.aab)")); buildAAB.setVisible(version && version->qtVersion() >= QVersionNumber(5, 14)); + // FIXME: This is not saved due to missing setSettingsKey(). Intentional? + openPackageLocation.setLabelText(Tr::tr("Open package location after build")); + + verboseOutput.setSettingsKey("VerboseOutput"); + verboseOutput.setLabelText(Tr::tr("Verbose output")); + connect(this, &BuildStep::addOutput, this, [this](const QString &string, OutputFormat format) { if (format == OutputFormat::Stderr) stdError(string); @@ -531,7 +526,7 @@ bool AndroidBuildApkStep::init() return false; } - m_openPackageLocationForRun = m_openPackageLocation; + m_openPackageLocationForRun = openPackageLocation(); const FilePath outputDir = AndroidManager::androidBuildDirectory(target()); m_packagePath = AndroidManager::packagePath(target()); @@ -561,7 +556,7 @@ bool AndroidBuildApkStep::init() "--android-platform", m_buildTargetSdk, "--jdk", AndroidConfigurations::currentConfig().openJDKLocation().path()}; - if (m_verbose) + if (verboseOutput()) arguments << "--verbose"; arguments << "--gradle"; @@ -889,7 +884,6 @@ void AndroidBuildApkStep::fromMap(const Store &map) m_buildTargetSdk = AndroidConfig::apiLevelNameFor(AndroidConfigurations:: sdkManager()->latestAndroidSdkPlatform()); } - m_verbose = map.value(VerboseOutputKey).toBool(); ProjectExplorer::BuildStep::fromMap(map); } @@ -899,7 +893,6 @@ void AndroidBuildApkStep::toMap(Store &map) const map.insert(KeystoreLocationKey, m_keystorePath.toSettings()); map.insert(BuildTargetSdkKey, m_buildTargetSdk); map.insert(BuildToolsVersionKey, m_buildToolsVersion.toString()); - map.insert(VerboseOutputKey, m_verbose); } Utils::FilePath AndroidBuildApkStep::keystorePath() const @@ -997,21 +990,6 @@ void AndroidBuildApkStep::setSignPackage(bool b) m_signPackage = b; } -bool AndroidBuildApkStep::openPackageLocation() const -{ - return m_openPackageLocation; -} - -void AndroidBuildApkStep::setOpenPackageLocation(bool open) -{ - m_openPackageLocation = open; -} - -void AndroidBuildApkStep::setVerboseOutput(bool verbose) -{ - m_verbose = verbose; -} - bool AndroidBuildApkStep::addDebugger() const { return m_addDebugger; @@ -1022,11 +1000,6 @@ void AndroidBuildApkStep::setAddDebugger(bool debug) m_addDebugger = debug; } -bool AndroidBuildApkStep::verboseOutput() const -{ - return m_verbose; -} - QAbstractItemModel *AndroidBuildApkStep::keystoreCertificates() { // check keystore passwords diff --git a/src/plugins/android/androidbuildapkstep.h b/src/plugins/android/androidbuildapkstep.h index cd003d3c85a..0280290dfd2 100644 --- a/src/plugins/android/androidbuildapkstep.h +++ b/src/plugins/android/androidbuildapkstep.h @@ -38,12 +38,8 @@ public: void setSignPackage(bool b); Utils::BoolAspect buildAAB{this}; - - bool openPackageLocation() const; - void setOpenPackageLocation(bool open); - - bool verboseOutput() const; - void setVerboseOutput(bool verbose); + Utils::BoolAspect openPackageLocation{this}; + Utils::BoolAspect verboseOutput{this}; bool addDebugger() const; void setAddDebugger(bool debug); @@ -72,8 +68,6 @@ private: void updateBuildToolsVersionInJsonFile(); bool m_signPackage = false; - bool m_verbose = false; - bool m_openPackageLocation = false; bool m_openPackageLocationForRun = false; bool m_addDebugger = true; QString m_buildTargetSdk; From 0490266723ac0424d1b44c907797038b2f6881e8 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 24 Aug 2023 09:35:48 +0200 Subject: [PATCH 0852/1777] Utils: Add Aspects::volatileToMap Change-Id: Ic4b77e27570485864cb4a9a412d685c400a9e7d1 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 39 ++++++++++++++++++++++++++++++++++++++ src/libs/utils/aspects.h | 10 ++++++++++ 2 files changed, 49 insertions(+) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 33eedd561d3..486563f6209 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -136,6 +136,11 @@ void BaseAspect::setId(Id id) d->m_id = id; } +QVariant BaseAspect::volatileVariantValue() const +{ + return {}; +} + QVariant BaseAspect::variantValue() const { return {}; @@ -601,6 +606,16 @@ void BaseAspect::toMap(Store &map) const saveToMap(map, toSettingsValue(variantValue()), toSettingsValue(defaultVariantValue()), settingsKey()); } +void BaseAspect::volatileToMap(Store &map) const +{ + if (settingsKey().isEmpty()) + return; + saveToMap(map, + toSettingsValue(volatileVariantValue()), + toSettingsValue(defaultVariantValue()), + settingsKey()); +} + void BaseAspect::readSettings() { if (settingsKey().isEmpty()) @@ -704,6 +719,12 @@ public: m_checked->toMap(map); } + void volatileToMap(Store &map) + { + if (m_checked) + m_checked->volatileToMap(map); + } + template<class Widget> void updateWidgetFromCheckStatus(BaseAspect *aspect, Widget *w) { @@ -937,6 +958,12 @@ void StringAspect::toMap(Store &map) const d->m_checkerImpl.toMap(map); } +void StringAspect::volatileToMap(Store &map) const +{ + saveToMap(map, volatileValue(), defaultValue(), settingsKey()); + d->m_checkerImpl.volatileToMap(map); +} + /*! \internal */ @@ -1457,6 +1484,12 @@ void FilePathAspect::toMap(Store &map) const d->m_checkerImpl.toMap(map); } +void FilePathAspect::volatileToMap(Store &map) const +{ + saveToMap(map, volatileValue(), defaultValue(), settingsKey()); + d->m_checkerImpl.volatileToMap(map); +} + void FilePathAspect::setPromptDialogFilter(const QString &filter) { d->m_prompDialogFilter = filter; @@ -2530,6 +2563,12 @@ void AspectContainer::toMap(Store &map) const aspect->toMap(map); } +void AspectContainer::volatileToMap(Store &map) const +{ + for (BaseAspect *aspect : std::as_const(d->m_items)) + aspect->volatileToMap(map); +} + void AspectContainer::readSettings() { const SettingsGroupNester nester(d->m_settingsGroup); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index b2b98937c7f..24d8b7a92f0 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -56,6 +56,7 @@ public: enum Announcement { DoEmit, BeQuiet }; + virtual QVariant volatileVariantValue() const; virtual QVariant variantValue() const; virtual void setVariantValue(const QVariant &value, Announcement = DoEmit); @@ -104,6 +105,7 @@ public: virtual void fromMap(const Store &map); virtual void toMap(Store &map) const; virtual void toActiveMap(Store &map) const { toMap(map); } + virtual void volatileToMap(Store &map) const; virtual void addToLayout(Layouting::LayoutItem &parent); @@ -329,6 +331,11 @@ protected: return QVariant::fromValue<ValueType>(m_internal); } + QVariant volatileVariantValue() const override + { + return QVariant::fromValue<ValueType>(m_buffer); + } + void setVariantValue(const QVariant &value, Announcement howToAnnounce = DoEmit) override { setValue(value.value<ValueType>(), howToAnnounce); @@ -560,6 +567,7 @@ public: void fromMap(const Utils::Store &map) override; void toMap(Utils::Store &map) const override; + void volatileToMap(Utils::Store &map) const override; signals: void validChanged(bool validState); @@ -629,6 +637,7 @@ public: void fromMap(const Utils::Store &map) override; void toMap(Utils::Store &map) const override; + void volatileToMap(Utils::Store &map) const override; signals: void validChanged(bool validState); @@ -834,6 +843,7 @@ public: void fromMap(const Utils::Store &map) override; void toMap(Utils::Store &map) const override; + void volatileToMap(Utils::Store &map) const override; void readSettings() override; void writeSettings() const override; From 621a2850d0ff084c5ebb119aae4fc96f6224b2ef Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 23 Aug 2023 18:18:46 +0200 Subject: [PATCH 0853/1777] Utils etc: More use of Key and Store Change-Id: Idd2d70617f775d783aee93a2fe82544ad335a739 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/persistentsettings.cpp | 4 +- src/libs/utils/settingsaccessor.cpp | 15 ++-- src/libs/utils/settingsaccessor.h | 6 +- src/libs/utils/settingsutils.h | 2 +- src/libs/utils/store.cpp | 10 +++ src/libs/utils/store.h | 7 ++ src/libs/utils/storekey.h | 17 +++++ src/plugins/coreplugin/session.cpp | 24 +++---- src/plugins/coreplugin/session.h | 8 +-- src/plugins/coreplugin/session_p.h | 5 +- src/plugins/fakevim/fakevimactions.cpp | 4 +- src/plugins/fakevim/fakevimactions.h | 23 ++++--- src/plugins/projectexplorer/buildaspects.cpp | 2 +- src/plugins/projectexplorer/buildsteplist.cpp | 14 ++-- .../customwizard/customwizardpage.cpp | 4 +- .../serialterminal/serialoutputpane.cpp | 4 +- src/plugins/texteditor/codestylepool.cpp | 6 +- .../tst_persistentsettings.cpp | 8 +-- tests/auto/utils/settings/tst_settings.cpp | 69 +++++++++---------- 19 files changed, 137 insertions(+), 95 deletions(-) diff --git a/src/libs/utils/persistentsettings.cpp b/src/libs/utils/persistentsettings.cpp index d73d74387f5..c95ef555b84 100644 --- a/src/libs/utils/persistentsettings.cpp +++ b/src/libs/utils/persistentsettings.cpp @@ -217,7 +217,7 @@ bool ParseContext::handleStartElement(QXmlStreamReader &r) const QStringView name = r.name(); const Element e = element(name); if (e == VariableElement) { - m_currentVariableName = r.readElementText(); + m_currentVariableName = keyFromString(r.readElementText()); return false; } if (!ParseContext::isValueElement(e)) @@ -225,7 +225,7 @@ bool ParseContext::handleStartElement(QXmlStreamReader &r) const QXmlStreamAttributes attributes = r.attributes(); const Key key = attributes.hasAttribute(keyAttribute) ? - attributes.value(keyAttribute).toString() : Key(); + keyFromString(attributes.value(keyAttribute).toString()) : Key(); switch (e) { case SimpleValueElement: { // This reads away the end element, so, handle end element right here. diff --git a/src/libs/utils/settingsaccessor.cpp b/src/libs/utils/settingsaccessor.cpp index 09ea90033f2..06dd1354c3d 100644 --- a/src/libs/utils/settingsaccessor.cpp +++ b/src/libs/utils/settingsaccessor.cpp @@ -388,7 +388,7 @@ Store VersionUpgrader::renameKeys(const QList<Change> &changes, Store map) const while (i != map.end()) { QVariant v = i.value(); if (v.type() == QVariant::Map) - i.value() = renameKeys(changes, v.value<Store>()); + i.value() = QVariant::fromValue(renameKeys(changes, v.value<Store>())); ++i; } @@ -648,7 +648,7 @@ MergingSettingsAccessor::mergeSettings(const SettingsAccessor::RestoreData &main /*! * Returns true for housekeeping related keys. */ -bool MergingSettingsAccessor::isHouseKeepingKey(const QString &key) +bool MergingSettingsAccessor::isHouseKeepingKey(const Key &key) { return key == VERSION_KEY || key == ORIGINAL_VERSION_KEY || key == SETTINGS_ID_KEY; } @@ -697,7 +697,7 @@ void setSettingsIdInMap(Store &data, const QByteArray &id) } static QVariant mergeQVariantMapsRecursion(const Store &mainTree, const Store &secondaryTree, - const QString &keyPrefix, + const Key &keyPrefix, const Store &mainSubtree, const Store &secondarySubtree, const SettingsMergeFunction &merge) { @@ -718,10 +718,11 @@ static QVariant mergeQVariantMapsRecursion(const Store &mainTree, const Store &s QPair<Key, QVariant> kv = mergeResult.value(); if (kv.second.type() == QVariant::Map) { - const QString newKeyPrefix = keyPrefix + kv.first + '/'; + const Key newKeyPrefix = keyPrefix + kv.first + '/'; kv.second = mergeQVariantMapsRecursion(mainTree, secondaryTree, newKeyPrefix, - kv.second.toMap(), secondarySubtree.value(kv.first) - .toMap(), merge); + kv.second.value<Store>(), + secondarySubtree.value(kv.first).value<Store>(), + merge); } if (!kv.second.isNull()) result.insert(kv.first, kv.second); @@ -733,7 +734,7 @@ static QVariant mergeQVariantMapsRecursion(const Store &mainTree, const Store &s QVariant mergeQVariantMaps(const Store &mainTree, const Store &secondaryTree, const SettingsMergeFunction &merge) { - return mergeQVariantMapsRecursion(mainTree, secondaryTree, QString(), + return mergeQVariantMapsRecursion(mainTree, secondaryTree, Key(), mainTree, secondaryTree, merge); } diff --git a/src/libs/utils/settingsaccessor.h b/src/libs/utils/settingsaccessor.h index b09c0958a3d..b882fbaeb78 100644 --- a/src/libs/utils/settingsaccessor.h +++ b/src/libs/utils/settingsaccessor.h @@ -41,7 +41,7 @@ QTCREATOR_UTILS_EXPORT void setOriginalVersionInMap(Store &data, int version); QTCREATOR_UTILS_EXPORT void setSettingsIdInMap(Store &data, const QByteArray &id); class PersistentSettingsWriter; -using SettingsMergeResult = std::optional<QPair<QString, QVariant>>; +using SettingsMergeResult = std::optional<QPair<Utils::Key, QVariant>>; // -------------------------------------------------------------------- // SettingsAccessor: @@ -206,7 +206,7 @@ public: virtual Store upgrade(const Store &data) = 0; protected: - using Change = QPair<QLatin1String, QLatin1String>; + using Change = QPair<Key, Key>; Store renameKeys(const QList<Change> &changes, Store map) const; private: @@ -271,7 +271,7 @@ protected: virtual SettingsMergeResult merge(const SettingsMergeData &global, const SettingsMergeData &local) const = 0; - static bool isHouseKeepingKey(const QString &key); + static bool isHouseKeepingKey(const Key &key); virtual Store postprocessMerge(const Store &main, const Store &secondary, const Store &result) const; diff --git a/src/libs/utils/settingsutils.h b/src/libs/utils/settingsutils.h index 97d8f285a98..f2efa39de2e 100644 --- a/src/libs/utils/settingsutils.h +++ b/src/libs/utils/settingsutils.h @@ -19,7 +19,7 @@ void fromSettings(const Key &postFix, { Store map; s->beginGroup(category + postFix); - const KeyList keys = s->allKeys(); + const KeyList keys = keyListFromStringList(s->allKeys()); for (const Key &key : keys) map.insert(key, s->value(key)); s->endGroup(); diff --git a/src/libs/utils/store.cpp b/src/libs/utils/store.cpp index b343d165fab..8775bce4ab1 100644 --- a/src/libs/utils/store.cpp +++ b/src/libs/utils/store.cpp @@ -3,7 +3,17 @@ #include "store.h" +#include "algorithm.h" namespace Utils { +KeyList keyListFromStringList(const QStringList &list) +{ +#ifdef QTC_USE_STORE + return transform(list, [](const QString &str) { return str.toUtf8(); }); +#else + return list; +#endif +} + } // Utils diff --git a/src/libs/utils/store.h b/src/libs/utils/store.h index 7037f5b4a4e..2a4663a07f3 100644 --- a/src/libs/utils/store.h +++ b/src/libs/utils/store.h @@ -11,6 +11,13 @@ namespace Utils { using KeyList = QList<Key>; + +#ifdef QTC_USE_STORE using Store = QMap<Key, QVariant>; +#else +using Store = QVariantMap; +#endif + +QTCREATOR_UTILS_EXPORT KeyList keyListFromStringList(const QStringList &list); } // Utils diff --git a/src/libs/utils/storekey.h b/src/libs/utils/storekey.h index 550bcda10cd..3b48d6c9c8b 100644 --- a/src/libs/utils/storekey.h +++ b/src/libs/utils/storekey.h @@ -3,10 +3,27 @@ #pragma once +#include "utils_global.h" + #include <QString> namespace Utils { +// Opt-in to new classes during the transition phase. +// #define QTC_USE_STORE + +#ifdef QTC_USE_STORE + +using Key = QByteArray; + +inline Key keyFromString(const QString &str) { return str.toUtf8(); } + +#else + using Key = QString; +inline Key keyFromString(const QString &str) { return str; } + +#endif + } // Utils diff --git a/src/plugins/coreplugin/session.cpp b/src/plugins/coreplugin/session.cpp index 7954b50e341..67b09d0ac45 100644 --- a/src/plugins/coreplugin/session.cpp +++ b/src/plugins/coreplugin/session.cpp @@ -156,7 +156,7 @@ bool SessionManager::isDefaultSession(const QString &session) void SessionManager::saveActiveMode(Id mode) { if (mode != Core::Constants::MODE_WELCOME) - setValue(QLatin1String("ActiveMode"), mode.toString()); + setValue("ActiveMode", mode.toString()); } bool SessionManager::isLoadingSession() @@ -169,25 +169,25 @@ bool SessionManager::isLoadingSession() within the session file. */ -void SessionManager::setValue(const QString &name, const QVariant &value) +void SessionManager::setValue(const Key &name, const QVariant &value) { if (sb_d->m_values.value(name) == value) return; sb_d->m_values.insert(name, value); } -QVariant SessionManager::value(const QString &name) +QVariant SessionManager::value(const Key &name) { auto it = sb_d->m_values.constFind(name); return (it == sb_d->m_values.constEnd()) ? QVariant() : *it; } -void SessionManager::setSessionValue(const QString &name, const QVariant &value) +void SessionManager::setSessionValue(const Key &name, const QVariant &value) { sb_d->m_sessionValues.insert(name, value); } -QVariant SessionManager::sessionValue(const QString &name, const QVariant &defaultValue) +QVariant SessionManager::sessionValue(const Key &name, const QVariant &defaultValue) { auto it = sb_d->m_sessionValues.constFind(name); return (it == sb_d->m_sessionValues.constEnd()) ? defaultValue : *it; @@ -488,16 +488,16 @@ void SessionManagerPrivate::updateSessionMenu() void SessionManagerPrivate::restoreValues(const PersistentSettingsReader &reader) { - const QStringList keys = reader.restoreValue(QLatin1String("valueKeys")).toStringList(); - for (const QString &key : keys) { - QVariant value = reader.restoreValue(QLatin1String("value-") + key); + const KeyList keys = keyListFromStringList(reader.restoreValue("valueKeys").toStringList()); + for (const Key &key : keys) { + QVariant value = reader.restoreValue("value-" + key); m_values.insert(key, value); } } void SessionManagerPrivate::restoreSessionValues(const PersistentSettingsReader &reader) { - const QVariantMap values = reader.restoreValues(); + const Store values = reader.restoreValues(); // restore toplevel items that are not restored by restoreValues const auto end = values.constEnd(); for (auto it = values.constBegin(); it != end; ++it) { @@ -680,7 +680,7 @@ bool SessionManager::saveSession() emit SessionManager::instance()->aboutToSaveSession(); const FilePath filePath = SessionManager::sessionNameToFileName(sb_d->m_sessionName); - QVariantMap data; + Store data; // See the explanation at loadSession() for how we handle the implicit default session. if (SessionManager::isDefaultVirgin()) { @@ -712,12 +712,12 @@ bool SessionManager::saveSession() } const auto end = sb_d->m_values.constEnd(); - QStringList keys; + KeyList keys; for (auto it = sb_d->m_values.constBegin(); it != end; ++it) { data.insert("value-" + it.key(), it.value()); keys << it.key(); } - data.insert("valueKeys", keys); + data.insert("valueKeys", QVariant::fromValue(keys)); if (!sb_d->m_writer || sb_d->m_writer->fileName() != filePath) { delete sb_d->m_writer; diff --git a/src/plugins/coreplugin/session.h b/src/plugins/coreplugin/session.h index 30dc70edf4d..f0c433e1cdc 100644 --- a/src/plugins/coreplugin/session.h +++ b/src/plugins/coreplugin/session.h @@ -50,13 +50,13 @@ public: // Let other plugins store persistent values within the session file // These are settings that are also saved and loaded at startup, and are taken over // to the default session when switching from implicit to explicit default session - static void setValue(const QString &name, const QVariant &value); - static QVariant value(const QString &name); + static void setValue(const Utils::Key &name, const QVariant &value); + static QVariant value(const Utils::Key &name); // These are settings that are specific to a session and are not loaded // at startup and also not taken over to the default session when switching from implicit - static void setSessionValue(const QString &name, const QVariant &value); - static QVariant sessionValue(const QString &name, const QVariant &defaultValue = {}); + static void setSessionValue(const Utils::Key &name, const QVariant &value); + static QVariant sessionValue(const Utils::Key &name, const QVariant &defaultValue = {}); static bool isLoadingSession(); static void markSessionFileDirty(); diff --git a/src/plugins/coreplugin/session_p.h b/src/plugins/coreplugin/session_p.h index 20ceecbcbc3..880e51d4db4 100644 --- a/src/plugins/coreplugin/session_p.h +++ b/src/plugins/coreplugin/session_p.h @@ -2,6 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include <utils/persistentsettings.h> +#include <utils/store.h> #include <QFutureInterface> @@ -43,8 +44,8 @@ public: mutable QHash<QString, QDateTime> m_sessionDateTimes; QHash<QString, QDateTime> m_lastActiveTimes; - QMap<QString, QVariant> m_values; - QMap<QString, QVariant> m_sessionValues; + QMap<Utils::Key, QVariant> m_values; + QMap<Utils::Key, QVariant> m_sessionValues; QFutureInterface<void> m_future; PersistentSettingsWriter *m_writer = nullptr; diff --git a/src/plugins/fakevim/fakevimactions.cpp b/src/plugins/fakevim/fakevimactions.cpp index 77707500947..dca99a23b53 100644 --- a/src/plugins/fakevim/fakevimactions.cpp +++ b/src/plugins/fakevim/fakevimactions.cpp @@ -265,7 +265,7 @@ QString FakeVimSettings::trySetValue(const QString &name, const QString &value) void FakeVimSettings::setup(FvBaseAspect *aspect, const QVariant &value, - const QString &settingsKey, + const Key &settingsKey, const QString &shortName, const QString &labelText) { @@ -282,7 +282,7 @@ void FakeVimSettings::setup(FvBaseAspect *aspect, Q_UNUSED(labelText) #endif - const QString longName = settingsKey.toLower(); + const Key longName = settingsKey.toLower(); if (!longName.isEmpty()) { m_nameToAspect[longName] = aspect; m_aspectToName[aspect] = longName; diff --git a/src/plugins/fakevim/fakevimactions.h b/src/plugins/fakevim/fakevimactions.h index 1d72080d9b2..18baecafecf 100644 --- a/src/plugins/fakevim/fakevimactions.h +++ b/src/plugins/fakevim/fakevimactions.h @@ -3,13 +3,15 @@ #pragma once -#ifndef FAKEVIM_STANDALONE +#ifdef FAKEVIM_STANDALONE -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/store.h> + +namespace Utils { class FilePath {}; } #else -namespace Utils { class FilePath {}; } +#include <coreplugin/dialogs/ioptionspage.h> #endif @@ -32,8 +34,11 @@ public: virtual void setDefaultVariantValue(const QVariant &) {} virtual QVariant variantValue() const { return {}; } virtual QVariant defaultVariantValue() const { return {}; } - +#ifdef QTC_USE_STORE + void setSettingsKey(const QString &group, const QByteArray &key); +#else void setSettingsKey(const QString &group, const QString &key); +#endif QString settingsKey() const; void setCheckable(bool) {} void setDisplayName(const QString &) {} @@ -155,12 +160,12 @@ public: private: void setup(FvBaseAspect *aspect, const QVariant &value, - const QString &settingsKey, - const QString &shortName, - const QString &label); + const Utils::Key &settingsKey, + const QString &shortName, + const QString &label); - QHash<QString, FvBaseAspect *> m_nameToAspect; - QHash<FvBaseAspect *, QString> m_aspectToName; + QHash<Utils::Key, FvBaseAspect *> m_nameToAspect; + QHash<FvBaseAspect *, Utils::Key> m_aspectToName; }; FakeVimSettings &settings(); diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index 42efc75da6f..a108558f360 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -72,7 +72,7 @@ BuildDirectoryAspect::~BuildDirectoryAspect() void BuildDirectoryAspect::allowInSourceBuilds(const FilePath &sourceDir) { d->sourceDir = sourceDir; - makeCheckable(CheckBoxPlacement::Top, Tr::tr("Shadow build:"), QString()); + makeCheckable(CheckBoxPlacement::Top, Tr::tr("Shadow build:"), Key()); setChecked(d->sourceDir != expandedValue()); } diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index 085f0cd9bb8..805c1fcf5b6 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -52,17 +52,17 @@ Store BuildStepList::toMap() const const char CONFIGURATION_ID_KEY[] = "ProjectExplorer.ProjectConfiguration.Id"; const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ProjectConfiguration.DisplayName"; const char DEFAULT_DISPLAY_NAME_KEY[] = "ProjectExplorer.ProjectConfiguration.DefaultDisplayName"; - map.insert(QLatin1String(CONFIGURATION_ID_KEY), m_id.toSetting()); - map.insert(QLatin1String(DISPLAY_NAME_KEY), displayName()); - map.insert(QLatin1String(DEFAULT_DISPLAY_NAME_KEY), displayName()); + map.insert(CONFIGURATION_ID_KEY, m_id.toSetting()); + map.insert(DISPLAY_NAME_KEY, displayName()); + map.insert(DEFAULT_DISPLAY_NAME_KEY, displayName()); } // Save build steps - map.insert(QString::fromLatin1(STEPS_COUNT_KEY), m_steps.count()); + map.insert(STEPS_COUNT_KEY, m_steps.count()); for (int i = 0; i < m_steps.count(); ++i) { Store data; m_steps.at(i)->toMap(data); - map.insert(QString::fromLatin1(STEPS_PREFIX) + QString::number(i), data); + map.insert(STEPS_PREFIX + Key::number(i), data); } return map; @@ -109,9 +109,9 @@ bool BuildStepList::fromMap(const Store &map) const QList<BuildStepFactory *> factories = BuildStepFactory::allBuildStepFactories(); - int maxSteps = map.value(QString::fromLatin1(STEPS_COUNT_KEY), 0).toInt(); + int maxSteps = map.value(STEPS_COUNT_KEY, 0).toInt(); for (int i = 0; i < maxSteps; ++i) { - Store bsData(map.value(QString::fromLatin1(STEPS_PREFIX) + QString::number(i)).toMap()); + Store bsData(map.value(STEPS_PREFIX + Key::number(i)).toMap()); if (bsData.isEmpty()) { qWarning() << "No step data found for" << i << "(continuing)."; continue; diff --git a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp index d25d59947e9..1e574b4815f 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp @@ -225,7 +225,7 @@ QWidget *CustomWizardFieldPage::registerPathChooser(const QString &fieldName, pathChooser->setExpectedKind(PathChooser::Command); else if (expectedKind == QLatin1String("any")) pathChooser->setExpectedKind(PathChooser::Any); - pathChooser->setHistoryCompleter(QString::fromLatin1("PE.Custom.") + m_parameters->id.toString() + QLatin1Char('.') + field.name); + pathChooser->setHistoryCompleter("PE.Custom." + m_parameters->id.name() + '.' + field.name); registerField(fieldName, pathChooser, "path", SIGNAL(rawPathChanged(QString))); // Connect to completeChanged() for derived classes that reimplement isComplete() @@ -407,7 +407,7 @@ CustomWizardPage::CustomWizardPage(const QSharedPointer<CustomWizardContext> &ct CustomWizardFieldPage(ctx, parameters, parent), m_pathChooser(new PathChooser) { - m_pathChooser->setHistoryCompleter(QLatin1String("PE.ProjectDir.History")); + m_pathChooser->setHistoryCompleter("PE.ProjectDir.History"); addRow(Tr::tr("Path:"), m_pathChooser); connect(m_pathChooser, &PathChooser::validChanged, this, &QWizardPage::completeChanged); } diff --git a/src/plugins/serialterminal/serialoutputpane.cpp b/src/plugins/serialterminal/serialoutputpane.cpp index b343ea478ee..0f11ceb9a96 100644 --- a/src/plugins/serialterminal/serialoutputpane.cpp +++ b/src/plugins/serialterminal/serialoutputpane.cpp @@ -33,6 +33,8 @@ #include <QToolButton> #include <QVBoxLayout> +using namespace Utils; + namespace SerialTerminal { namespace Internal { @@ -277,7 +279,7 @@ void SerialOutputPane::createNewOutputWindow(SerialControl *rc) static int counter = 0; Utils::Id contextId = Utils::Id(Constants::C_SERIAL_OUTPUT).withSuffix(counter++); Core::Context context(contextId); - auto ow = new Core::OutputWindow(context, QString(), m_tabWidget); + auto ow = new Core::OutputWindow(context, Key(), m_tabWidget); using TextEditor::TextEditorSettings; auto fontSettingsChanged = [ow] { ow->setBaseFont(TextEditorSettings::fontSettings().font()); diff --git a/src/plugins/texteditor/codestylepool.cpp b/src/plugins/texteditor/codestylepool.cpp index 30e74ecfca0..23b8aaccf8f 100644 --- a/src/plugins/texteditor/codestylepool.cpp +++ b/src/plugins/texteditor/codestylepool.cpp @@ -204,10 +204,10 @@ ICodeStylePreferences *CodeStylePool::loadCodeStyle(const FilePath &fileName) ICodeStylePreferences *codeStyle = nullptr; PersistentSettingsReader reader; reader.load(fileName); - QVariantMap m = reader.restoreValues(); - if (m.contains(QLatin1String(codeStyleDataKey))) { + Store m = reader.restoreValues(); + if (m.contains(codeStyleDataKey)) { const QByteArray id = fileName.completeBaseName().toUtf8(); - const QString displayName = reader.restoreValue(QLatin1String(displayNameKey)).toString(); + const QString displayName = reader.restoreValue(displayNameKey).toString(); const Store map = reader.restoreValue(codeStyleDataKey).value<Store>(); if (d->m_factory) { codeStyle = d->m_factory->createCodeStyle(); diff --git a/tests/auto/utils/persistentsettings/tst_persistentsettings.cpp b/tests/auto/utils/persistentsettings/tst_persistentsettings.cpp index d64867aef09..e2fde299096 100644 --- a/tests/auto/utils/persistentsettings/tst_persistentsettings.cpp +++ b/tests/auto/utils/persistentsettings/tst_persistentsettings.cpp @@ -19,9 +19,9 @@ private slots: void tst_readwrite(); }; -static const QVariantMap generateData() +static const Store generateData() { - QVariantMap result; + Store result; QByteArray barr("I am a byte array."); QString str("I am a string."); QColor color("#8b00d1"); @@ -44,7 +44,7 @@ void PersistentSettingsTest::tst_readwrite() qDebug() << "using" << fi.absoluteFilePath(); const FilePath filePath = FilePath::fromFileInfo(fi); PersistentSettingsWriter writer(filePath, "Narf"); - const QVariantMap originalData = generateData(); + const Store originalData = generateData(); QString error; bool success = writer.save(originalData, &error); QVERIFY2(success, error.toLocal8Bit()); @@ -54,7 +54,7 @@ void PersistentSettingsTest::tst_readwrite() success = reader.load(filePath); QVERIFY(success); - const QVariantMap restored = reader.restoreValues(); + const Store restored = reader.restoreValues(); QCOMPARE(restored.size(), originalData.size()); auto restoredEnd = restored.end(); for (auto it = originalData.cbegin(), end = originalData.cend(); it != end; ++it) { diff --git a/tests/auto/utils/settings/tst_settings.cpp b/tests/auto/utils/settings/tst_settings.cpp index d45d673e4d3..70637a6437b 100644 --- a/tests/auto/utils/settings/tst_settings.cpp +++ b/tests/auto/utils/settings/tst_settings.cpp @@ -13,9 +13,9 @@ using namespace Utils; const char TESTACCESSOR_APPLICATION_DN[] = "SettingsAccessor Test (Basic)"; const char TESTACCESSOR_DEFAULT_ID[] = "testId"; -QVariantMap generateExtraData() +Store generateExtraData() { - QVariantMap extra; + Store extra; extra.insert("Foo", "Bar"); extra.insert("Int", 42); return extra; @@ -28,14 +28,14 @@ QVariantMap generateExtraData() class TestVersionUpgrader : public Utils::VersionUpgrader { public: - TestVersionUpgrader(int version) : - Utils::VersionUpgrader(version, QString("v") + QString::number(version)) + TestVersionUpgrader(int version) + : VersionUpgrader(version, "v" + QString::number(version)) { } - QVariantMap upgrade(const QVariantMap &data) final + Store upgrade(const Store &data) final { - QVariantMap result = data; - result.insert(QString("VERSION_") + QString::number(version()), version()); + Store result = data; + result.insert("VERSION_" + Key::number(version()), version()); return result; } }; @@ -52,10 +52,10 @@ public: using Utils::MergingSettingsAccessor::addVersionUpgrader; - QHash<Utils::FilePath, QVariantMap> files() const { return m_files; } - void addFile(const Utils::FilePath &path, const QVariantMap &data) const { m_files.insert(path, data); } + QHash<Utils::FilePath, Store> files() const { return m_files; } + void addFile(const Utils::FilePath &path, const Store &data) const { m_files.insert(path, data); } Utils::FilePaths fileNames() const { return m_files.keys(); } - QVariantMap fileContents(const Utils::FilePath &path) const { return m_files.value(path); } + Store fileContents(const Utils::FilePath &path) const { return m_files.value(path); } protected: RestoreData readFile(const Utils::FilePath &path) const override @@ -71,7 +71,7 @@ protected: { Q_UNUSED(global) - const QString key = local.key; + const Key key = local.key; const QVariant main = local.main.value(key); const QVariant secondary = local.secondary.value(key); @@ -85,7 +85,7 @@ protected: return qMakePair(key, secondary); } - std::optional<Issue> writeFile(const Utils::FilePath &path, const QVariantMap &data) const override + std::optional<Issue> writeFile(const Utils::FilePath &path, const Store &data) const override { if (data.isEmpty()) { return Issue("Failed to Write File", "There was nothing to write.", @@ -97,7 +97,7 @@ protected: } private: - mutable QHash<Utils::FilePath, QVariantMap> m_files; + mutable QHash<Utils::FilePath, Store> m_files; }; // -------------------------------------------------------------------- @@ -200,10 +200,9 @@ private slots: void loadSettings_pickBest(); }; -static QVariantMap versionedMap(int version, const QByteArray &id = QByteArray(), - const QVariantMap &extra = QVariantMap()) +static Store versionedMap(int version, const QByteArray &id = {}, const Store &extra = {}) { - QVariantMap result; + Store result; result.insert("Version", version); if (!id.isEmpty()) result.insert("EnvironmentId", id); @@ -213,13 +212,13 @@ static QVariantMap versionedMap(int version, const QByteArray &id = QByteArray() } static Utils::SettingsAccessor::RestoreData restoreData(const Utils::FilePath &path, - const QVariantMap &data) + const Store &data) { return Utils::SettingsAccessor::RestoreData(path, data); } //static Utils::SettingsAccessor::RestoreData restoreData(const QByteArray &path, -// const QVariantMap &data) +// const Store &data) //{ // return restoreData(Utils::FilePath::fromUtf8(path), data); //} @@ -366,7 +365,7 @@ void tst_SettingsAccessor::RestoreDataCompare_emptyMap() { const TestSettingsAccessor accessor; - Utils::SettingsAccessor::RestoreData a = restoreData("/foo/bar", QVariantMap()); + Utils::SettingsAccessor::RestoreData a = restoreData("/foo/bar", Store()); Utils::SettingsAccessor::RestoreData b = restoreData("/foo/baz", versionedMap(7, TESTACCESSOR_DEFAULT_ID)); QCOMPARE(accessor.strategy()->compare(a, b), 1); @@ -377,8 +376,8 @@ void tst_SettingsAccessor::RestoreDataCompare_twoEmptyMaps() { const TestSettingsAccessor accessor; - Utils::SettingsAccessor::RestoreData a = restoreData("/foo/bar", QVariantMap()); - Utils::SettingsAccessor::RestoreData b = restoreData("/foo/baz", QVariantMap()); + Utils::SettingsAccessor::RestoreData a = restoreData("/foo/bar", Store()); + Utils::SettingsAccessor::RestoreData b = restoreData("/foo/baz", Store()); QCOMPARE(accessor.strategy()->compare(a, b), 0); QCOMPARE(accessor.strategy()->compare(b, a), 0); @@ -544,7 +543,7 @@ void tst_SettingsAccessor::upgradeSettings_partialUpdate() void tst_SettingsAccessor::upgradeSettings_targetVersionTooOld() { const TestSettingsAccessor accessor; - const QVariantMap extra = generateExtraData(); + const Store extra = generateExtraData(); const int startVersion = 6; const Utils::SettingsAccessor::RestoreData input = restoreData(accessor.baseFilePath(), @@ -560,7 +559,7 @@ void tst_SettingsAccessor::upgradeSettings_targetVersionTooOld() void tst_SettingsAccessor::upgradeSettings_targetVersionTooNew() { const TestSettingsAccessor accessor; - const QVariantMap extra = generateExtraData(); + const Store extra = generateExtraData(); const int startVersion = 6; const Utils::SettingsAccessor::RestoreData input = restoreData(accessor.baseFilePath(), @@ -578,7 +577,7 @@ void tst_SettingsAccessor::upgradeSettings_targetVersionTooNew() void tst_SettingsAccessor::findIssues_ok() { const TestSettingsAccessor accessor; - const QVariantMap data = versionedMap(6, TESTACCESSOR_DEFAULT_ID); + const Store data = versionedMap(6, TESTACCESSOR_DEFAULT_ID); const Utils::FilePath path = "/foo/baz.user"; const std::optional<Utils::SettingsAccessor::Issue> info = accessor.findIssues(data, path); @@ -589,7 +588,7 @@ void tst_SettingsAccessor::findIssues_ok() void tst_SettingsAccessor::findIssues_emptyData() { const TestSettingsAccessor accessor; - const QVariantMap data; + const Store data; const Utils::FilePath path = "/foo/bar.user"; const std::optional<Utils::SettingsAccessor::Issue> info = accessor.findIssues(data, path); @@ -600,7 +599,7 @@ void tst_SettingsAccessor::findIssues_emptyData() void tst_SettingsAccessor::findIssues_tooNew() { const TestSettingsAccessor accessor; - const QVariantMap data = versionedMap(42, TESTACCESSOR_DEFAULT_ID); + const Store data = versionedMap(42, TESTACCESSOR_DEFAULT_ID); const Utils::FilePath path = "/foo/bar.user"; const std::optional<Utils::SettingsAccessor::Issue> info = accessor.findIssues(data, path); @@ -611,7 +610,7 @@ void tst_SettingsAccessor::findIssues_tooNew() void tst_SettingsAccessor::findIssues_tooOld() { const TestSettingsAccessor accessor; - const QVariantMap data = versionedMap(2, TESTACCESSOR_DEFAULT_ID); + const Store data = versionedMap(2, TESTACCESSOR_DEFAULT_ID); const Utils::FilePath path = "/foo/bar.user"; const std::optional<Utils::SettingsAccessor::Issue> info = accessor.findIssues(data, path); @@ -622,7 +621,7 @@ void tst_SettingsAccessor::findIssues_tooOld() void tst_SettingsAccessor::findIssues_wrongId() { const TestSettingsAccessor accessor; - const QVariantMap data = versionedMap(6, "foo"); + const Store data = versionedMap(6, "foo"); const Utils::FilePath path = "/foo/bar.user"; const std::optional<Utils::SettingsAccessor::Issue> info = accessor.findIssues(data, path); @@ -633,7 +632,7 @@ void tst_SettingsAccessor::findIssues_wrongId() void tst_SettingsAccessor::findIssues_nonDefaultPath() { const TestSettingsAccessor accessor; - const QVariantMap data = versionedMap(6, TESTACCESSOR_DEFAULT_ID); + const Store data = versionedMap(6, TESTACCESSOR_DEFAULT_ID); const Utils::FilePath path = "/foo/bar.user.foobar"; const std::optional<Utils::SettingsAccessor::Issue> info = accessor.findIssues(data, path); @@ -646,12 +645,12 @@ void tst_SettingsAccessor::saveSettings() { const FilePath baseFile = "/tmp/foo/saveSettings"; const TestSettingsAccessor accessor(baseFile); - const QVariantMap data = versionedMap(6, TESTACCESSOR_DEFAULT_ID); + const Store data = versionedMap(6, TESTACCESSOR_DEFAULT_ID); QVERIFY(accessor.saveSettings(data, nullptr)); QCOMPARE(accessor.files().count(), 1); - const QVariantMap read = accessor.fileContents(baseFile); + const Store read = accessor.fileContents(baseFile); QVERIFY(!read.isEmpty()); for (auto it = read.cbegin(); it != read.cend(); ++it) { @@ -667,13 +666,13 @@ void tst_SettingsAccessor::saveSettings() void tst_SettingsAccessor::loadSettings() { - const QVariantMap data = versionedMap(6, "loadSettings", generateExtraData()); + const Store data = versionedMap(6, "loadSettings", generateExtraData()); const FilePath path = "/tmp/foo/loadSettings"; const TestSettingsAccessor accessor(path, "loadSettings"); accessor.addFile(path, data); QCOMPARE(accessor.files().count(), 1); // Catch changes early:-) - const QVariantMap read = accessor.restoreSettings(nullptr); + const Store read = accessor.restoreSettings(nullptr); QCOMPARE(accessor.files().count(), 1); // no files were created QVERIFY(!read.isEmpty()); @@ -700,7 +699,7 @@ void tst_SettingsAccessor::loadSettings_pickBest() const TestSettingsAccessor accessor(path, "loadSettings"); accessor.addFile(path, versionedMap(10, "loadSettings", generateExtraData())); // too new - const QVariantMap data = versionedMap(7, "loadSettings", generateExtraData()); + const Store data = versionedMap(7, "loadSettings", generateExtraData()); accessor.addFile("/tmp/foo/loadSettings.foo", data); // pick this! accessor.addFile("/tmp/foo/loadSettings.foo1", versionedMap(8, "fooSettings", generateExtraData())); // wrong environment @@ -710,7 +709,7 @@ void tst_SettingsAccessor::loadSettings_pickBest() versionedMap(1, "loadSettings", generateExtraData())); // much too old QCOMPARE(accessor.files().count(), 5); // Catch changes early:-) - const QVariantMap read = accessor.restoreSettings(nullptr); + const Store read = accessor.restoreSettings(nullptr); QCOMPARE(accessor.files().count(), 5); // no new files QVERIFY(!read.isEmpty()); From 16454e13ebc788173217eadcd3d04c56319b2766 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 24 Aug 2023 09:59:34 +0200 Subject: [PATCH 0854/1777] Core: Allow saving documents without filename In case a document does not yet have a filename, simply fall back to save as Change-Id: I3cb30ab39e30ecba5c720d4b7d4c955f9dd4609f Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/coreplugin/editormanager/editormanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index c102d75fa43..44e5f18ef35 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1916,7 +1916,7 @@ void EditorManagerPrivate::setupSaveActions(IDocument *document, QAction *saveAc QAction *saveAsAction, QAction *revertToSavedAction) { const bool hasFile = document && !document->filePath().isEmpty(); - saveAction->setEnabled(hasFile && document->isModified()); + saveAction->setEnabled(document && (document->isModified() || !hasFile)); saveAsAction->setEnabled(document && document->isSaveAsAllowed()); revertToSavedAction->setEnabled(hasFile); From 6c2864bd4b63b7a255d3b9f54c3c0da0969675dd Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 24 Aug 2023 12:41:45 +0200 Subject: [PATCH 0855/1777] ProjectExplorer: And more Key and Store Change-Id: Id5787890bdb46bfeef8e3f37923e6dc26cb56c31 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../projectexplorer/buildconfiguration.cpp | 10 +- .../projectexplorer/buildconfiguration.h | 4 +- src/plugins/projectexplorer/customparser.cpp | 22 +-- .../projectexplorer/customtoolchain.cpp | 28 ++-- .../devicesupport/devicemanager.cpp | 32 ++-- .../projectexplorer/devicesupport/idevice.cpp | 75 +++++---- .../projectexplorer/editorconfiguration.cpp | 34 ++--- .../jsonwizard/jsonfieldpage.cpp | 4 +- src/plugins/projectexplorer/kit.cpp | 55 ++++--- src/plugins/projectexplorer/kit.h | 4 +- src/plugins/projectexplorer/kitaspects.cpp | 2 +- src/plugins/projectexplorer/kitmanager.cpp | 24 +-- .../projectexplorer/projectconfiguration.cpp | 16 +- .../projectexplorer/projectconfiguration.h | 2 +- src/plugins/projectexplorer/projectmodels.cpp | 2 +- .../projectexplorer/projecttreewidget.cpp | 2 +- .../projectexplorer/runconfiguration.cpp | 4 +- .../runconfigurationaspects.cpp | 6 +- .../projectexplorer/runconfigurationaspects.h | 6 +- src/plugins/projectexplorer/target.cpp | 76 ++++----- src/plugins/projectexplorer/target.h | 8 +- .../projectexplorer/targetsetupwidget.cpp | 2 +- src/plugins/projectexplorer/taskwindow.cpp | 8 +- src/plugins/projectexplorer/toolchain.cpp | 32 ++-- src/plugins/projectexplorer/toolchain.h | 6 +- .../projectexplorer/userfileaccessor.cpp | 144 +++++++++--------- .../projectexplorer/userfileaccessor.h | 12 +- 27 files changed, 306 insertions(+), 314 deletions(-) diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 34738201266..9284fa572b6 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -393,7 +393,7 @@ void BuildConfiguration::fromMap(const Store &map) d->m_clearSystemEnvironment = map.value(QLatin1String(Constants::CLEAR_SYSTEM_ENVIRONMENT_KEY)) .toBool(); d->m_userEnvironmentChanges = EnvironmentItem::fromStringList( - map.value(QLatin1String(Constants::USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); + map.value(Constants::USER_ENVIRONMENT_CHANGES_KEY).toStringList()); updateCacheAndEmitEnvironmentChanged(); @@ -454,7 +454,7 @@ void BuildConfiguration::setConfigWidgetDisplayName(const QString &display) d->m_configWidgetDisplayName = display; } -void BuildConfiguration::setBuildDirectoryHistoryCompleter(const QString &history) +void BuildConfiguration::setBuildDirectoryHistoryCompleter(const Key &history) { d->m_buildDirectoryAspect.setHistoryCompleter(history); } @@ -464,7 +464,7 @@ void BuildConfiguration::setConfigWidgetHasFrame(bool configWidgetHasFrame) d->m_configWidgetHasFrame = configWidgetHasFrame; } -void BuildConfiguration::setBuildDirectorySettingsKey(const QString &key) +void BuildConfiguration::setBuildDirectorySettingsKey(const Key &key) { d->m_buildDirectoryAspect.setSettingsKey(key); } @@ -770,7 +770,7 @@ BuildConfiguration *BuildConfigurationFactory::create(Target *parent, const Buil return bc; } -BuildConfiguration *BuildConfigurationFactory::restore(Target *parent, const QVariantMap &map) +BuildConfiguration *BuildConfigurationFactory::restore(Target *parent, const Store &map) { const Utils::Id id = idFromMap(map); for (BuildConfigurationFactory *factory : std::as_const(g_buildConfigurationFactories)) { @@ -794,7 +794,7 @@ BuildConfiguration *BuildConfigurationFactory::restore(Target *parent, const QVa BuildConfiguration *BuildConfigurationFactory::clone(Target *parent, const BuildConfiguration *source) { - QVariantMap map; + Store map; source->toMap(map); return restore(parent, map); } diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index 6ccb5188c52..0b38b3b3a82 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -102,9 +102,9 @@ public: ProjectExplorer::BuildDirectoryAspect *buildDirectoryAspect() const; void setConfigWidgetDisplayName(const QString &display); - void setBuildDirectoryHistoryCompleter(const QString &history); + void setBuildDirectoryHistoryCompleter(const Utils::Key &history); void setConfigWidgetHasFrame(bool configWidgetHasFrame); - void setBuildDirectorySettingsKey(const QString &key); + void setBuildDirectorySettingsKey(const Utils::Key &key); void addConfigWidgets(const std::function<void (NamedWidget *)> &adder); diff --git a/src/plugins/projectexplorer/customparser.cpp b/src/plugins/projectexplorer/customparser.cpp index 6b3c2d42d8e..fae8af7841f 100644 --- a/src/plugins/projectexplorer/customparser.cpp +++ b/src/plugins/projectexplorer/customparser.cpp @@ -91,9 +91,9 @@ void CustomParserExpression::setMessageCap(int messageCap) m_messageCap = messageCap; } -QVariantMap CustomParserExpression::toMap() const +Store CustomParserExpression::toMap() const { - QVariantMap map; + Store map; map.insert(patternKey, pattern()); map.insert(messageCapKey, messageCap()); map.insert(fileNameCapKey, fileNameCap()); @@ -139,22 +139,22 @@ bool CustomParserSettings::operator ==(const CustomParserSettings &other) const && error == other.error && warning == other.warning; } -QVariantMap CustomParserSettings::toMap() const +Store CustomParserSettings::toMap() const { - QVariantMap map; + Store map; map.insert(idKey, id.toSetting()); map.insert(nameKey, displayName); - map.insert(errorKey, error.toMap()); - map.insert(warningKey, warning.toMap()); + map.insert(errorKey, QVariant::fromValue(error.toMap())); + map.insert(warningKey, QVariant::fromValue(warning.toMap())); return map; } void CustomParserSettings::fromMap(const Store &map) { - id = Utils::Id::fromSetting(map.value(idKey)); + id = Id::fromSetting(map.value(idKey)); displayName = map.value(nameKey).toString(); - error.fromMap(map.value(errorKey).toMap()); - warning.fromMap(map.value(warningKey).toMap()); + error.fromMap(map.value(errorKey).value<Store>()); + warning.fromMap(map.value(warningKey).value<Store>()); } CustomParsersAspect::CustomParsersAspect(Target *target) @@ -175,12 +175,12 @@ CustomParsersAspect::CustomParsersAspect(Target *target) void CustomParsersAspect::fromMap(const Store &map) { - m_parsers = transform(map.value(settingsKey()).toList(), &Utils::Id::fromSetting); + m_parsers = transform(map.value(settingsKey()).toList(), &Id::fromSetting); } void CustomParsersAspect::toMap(Store &map) const { - map.insert(settingsKey(), transform(m_parsers, &Utils::Id::toSetting)); + map.insert(settingsKey(), transform(m_parsers, &Id::toSetting)); } namespace Internal { diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp index 302692c167e..f2ec50ed54a 100644 --- a/src/plugins/projectexplorer/customtoolchain.cpp +++ b/src/plugins/projectexplorer/customtoolchain.cpp @@ -274,13 +274,13 @@ QString CustomToolChain::mkspecs() const void CustomToolChain::toMap(Store &data) const { ToolChain::toMap(data); - data.insert(QLatin1String(makeCommandKeyC), m_makeCommand.toString()); + data.insert(makeCommandKeyC, m_makeCommand.toString()); QStringList macros = Utils::transform<QList>(m_predefinedMacros, [](const Macro &m) { return QString::fromUtf8(m.toByteArray()); }); - data.insert(QLatin1String(predefinedMacrosKeyC), macros); - data.insert(QLatin1String(headerPathsKeyC), headerPathsList()); - data.insert(QLatin1String(cxx11FlagsKeyC), m_cxx11Flags); - data.insert(QLatin1String(mkspecsKeyC), mkspecs()); - data.insert(QLatin1String(outputParserKeyC), m_outputParserId.toSetting()); + data.insert(predefinedMacrosKeyC, macros); + data.insert(headerPathsKeyC, headerPathsList()); + data.insert(cxx11FlagsKeyC, m_cxx11Flags); + data.insert(mkspecsKeyC, mkspecs()); + data.insert(outputParserKeyC, m_outputParserId.toSetting()); } void CustomToolChain::fromMap(const Store &data) @@ -289,13 +289,13 @@ void CustomToolChain::fromMap(const Store &data) if (hasError()) return; - m_makeCommand = FilePath::fromString(data.value(QLatin1String(makeCommandKeyC)).toString()); - const QStringList macros = data.value(QLatin1String(predefinedMacrosKeyC)).toStringList(); + m_makeCommand = FilePath::fromString(data.value(makeCommandKeyC).toString()); + const QStringList macros = data.value(predefinedMacrosKeyC).toStringList(); m_predefinedMacros = Macro::toMacros(macros.join('\n').toUtf8()); - setHeaderPaths(data.value(QLatin1String(headerPathsKeyC)).toStringList()); - m_cxx11Flags = data.value(QLatin1String(cxx11FlagsKeyC)).toStringList(); - setMkspecs(data.value(QLatin1String(mkspecsKeyC)).toString()); - setOutputParserId(Id::fromSetting(data.value(QLatin1String(outputParserKeyC)))); + setHeaderPaths(data.value(headerPathsKeyC).toStringList()); + m_cxx11Flags = data.value(cxx11FlagsKeyC).toStringList(); + setMkspecs(data.value(mkspecsKeyC).toString()); + setOutputParserId(Id::fromSetting(data.value(outputParserKeyC))); } bool CustomToolChain::operator ==(const ToolChain &other) const @@ -441,9 +441,9 @@ CustomToolChainConfigWidget::CustomToolChainConfigWidget(CustomToolChain *tc) : m_cxx11Flags->setToolTip(Tr::tr("Comma-separated list of flags that turn on C++11 support.")); m_mkspecs->setToolTip(Tr::tr("Comma-separated list of mkspecs.")); m_compilerCommand->setExpectedKind(PathChooser::ExistingCommand); - m_compilerCommand->setHistoryCompleter(QLatin1String("PE.ToolChainCommand.History")); + m_compilerCommand->setHistoryCompleter("PE.ToolChainCommand.History"); m_makeCommand->setExpectedKind(PathChooser::ExistingCommand); - m_makeCommand->setHistoryCompleter(QLatin1String("PE.MakeCommand.History")); + m_makeCommand->setHistoryCompleter("PE.MakeCommand.History"); m_mainLayout->addRow(Tr::tr("&Compiler path:"), m_compilerCommand); m_mainLayout->addRow(Tr::tr("&Make path:"), m_makeCommand); m_mainLayout->addRow(Tr::tr("&ABI:"), m_abiWidget); diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 1934dbceee2..7bf43d55d8e 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -130,8 +130,8 @@ void DeviceManager::save() { if (d->clonedInstance == this || !d->writer) return; - QVariantMap data; - data.insert(QLatin1String(DeviceManagerKey), toMap()); + Store data; + data.insert(DeviceManagerKey, QVariant::fromValue(toMap())); d->writer->save(data, Core::ICore::dialogParent()); } @@ -157,11 +157,11 @@ void DeviceManager::load() QHash<Id, Id> defaultDevices; QList<IDevice::Ptr> sdkDevices; if (reader.load(systemSettingsFilePath("devices.xml"))) - sdkDevices = fromMap(reader.restoreValues().value(DeviceManagerKey).toMap(), &defaultDevices); + sdkDevices = fromMap(reader.restoreValues().value(DeviceManagerKey).value<Store>(), &defaultDevices); // read devices file from user settings path QList<IDevice::Ptr> userDevices; if (reader.load(settingsFilePath("devices.xml"))) - userDevices = fromMap(reader.restoreValues().value(DeviceManagerKey).toMap(), &defaultDevices); + userDevices = fromMap(reader.restoreValues().value(DeviceManagerKey).value<Store>(), &defaultDevices); // Insert devices into the model. Prefer the higher device version when there are multiple // devices with the same id. for (IDevice::ConstPtr device : std::as_const(userDevices)) { @@ -189,7 +189,7 @@ void DeviceManager::load() emit devicesLoaded(); } -static const IDeviceFactory *restoreFactory(const QVariantMap &map) +static const IDeviceFactory *restoreFactory(const Store &map) { const Id deviceType = IDevice::typeFromMap(map); IDeviceFactory *factory = Utils::findOrDefault(IDeviceFactory::allDeviceFactories(), @@ -209,13 +209,13 @@ QList<IDevice::Ptr> DeviceManager::fromMap(const Store &map, QHash<Id, Id> *defa QList<IDevice::Ptr> devices; if (defaultDevices) { - const QVariantMap defaultDevsMap = map.value(DefaultDevicesKey).toMap(); + const Store defaultDevsMap = map.value(DefaultDevicesKey).value<Store>(); for (auto it = defaultDevsMap.constBegin(); it != defaultDevsMap.constEnd(); ++it) - defaultDevices->insert(Id::fromString(it.key()), Id::fromSetting(it.value())); + defaultDevices->insert(Id::fromString(stringFromKey(it.key())), Id::fromSetting(it.value())); } - const QVariantList deviceList = map.value(QLatin1String(DeviceListKey)).toList(); + const QVariantList deviceList = map.value(DeviceListKey).toList(); for (const QVariant &v : deviceList) { - const QVariantMap map = v.toMap(); + const Store map = v.value<Store>(); const IDeviceFactory * const factory = restoreFactory(map); if (!factory) continue; @@ -227,18 +227,18 @@ QList<IDevice::Ptr> DeviceManager::fromMap(const Store &map, QHash<Id, Id> *defa return devices; } -QVariantMap DeviceManager::toMap() const +Store DeviceManager::toMap() const { - QVariantMap map; - QVariantMap defaultDeviceMap; + Store map; + Store defaultDeviceMap; for (auto it = d->defaultDevices.constBegin(); it != d->defaultDevices.constEnd(); ++it) - defaultDeviceMap.insert(it.key().toString(), it.value().toSetting()); + defaultDeviceMap.insert(keyFromString(it.key().toString()), it.value().toSetting()); - map.insert(QLatin1String(DefaultDevicesKey), defaultDeviceMap); + map.insert(DefaultDevicesKey, QVariant::fromValue(defaultDeviceMap)); QVariantList deviceList; for (const IDevice::Ptr &device : std::as_const(d->devices)) - deviceList << device->toMap(); - map.insert(QLatin1String(DeviceListKey), deviceList); + deviceList << QVariant::fromValue(device->toMap()); + map.insert(DeviceListKey, deviceList); return map; } diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 6ce9949efaf..5996ee57db0 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -422,12 +422,12 @@ void IDevice::setDeviceState(const IDevice::DeviceState state) Id IDevice::typeFromMap(const Store &map) { - return Id::fromSetting(map.value(QLatin1String(TypeKey))); + return Id::fromSetting(map.value(TypeKey)); } Id IDevice::idFromMap(const Store &map) { - return Id::fromSetting(map.value(QLatin1String(IdKey))); + return Id::fromSetting(map.value(IdKey)); } /*! @@ -440,20 +440,19 @@ void IDevice::fromMap(const Store &map) { d->type = typeFromMap(map); d->displayName.fromMap(map, DisplayNameKey); - d->id = Id::fromSetting(map.value(QLatin1String(IdKey))); - d->osType = osTypeFromString( - map.value(QLatin1String(ClientOsTypeKey), osTypeToString(OsTypeLinux)).toString()); + d->id = Id::fromSetting(map.value(IdKey)); + d->osType = osTypeFromString(map.value(ClientOsTypeKey, osTypeToString(OsTypeLinux)).toString()); if (!d->id.isValid()) d->id = newId(); - d->origin = static_cast<Origin>(map.value(QLatin1String(OriginKey), ManuallyAdded).toInt()); + d->origin = static_cast<Origin>(map.value(OriginKey, ManuallyAdded).toInt()); QWriteLocker locker(&d->lock); - d->sshParameters.setHost(map.value(QLatin1String(HostKey)).toString()); - d->sshParameters.setPort(map.value(QLatin1String(SshPortKey), 22).toInt()); - d->sshParameters.setUserName(map.value(QLatin1String(UserNameKey)).toString()); + d->sshParameters.setHost(map.value(HostKey).toString()); + d->sshParameters.setPort(map.value(SshPortKey, 22).toInt()); + d->sshParameters.setUserName(map.value(UserNameKey).toString()); // Pre-4.9, the authentication enum used to have more values - const int storedAuthType = map.value(QLatin1String(AuthKey), DefaultAuthType).toInt(); + const int storedAuthType = map.value(AuthKey, DefaultAuthType).toInt(); const bool outdatedAuthType = storedAuthType > SshParameters::AuthenticationTypeSpecificKey; d->sshParameters.authenticationType = outdatedAuthType @@ -461,22 +460,22 @@ void IDevice::fromMap(const Store &map) : static_cast<AuthType>(storedAuthType); d->sshParameters.privateKeyFile = - FilePath::fromSettings(map.value(QLatin1String(KeyFileKey), defaultPrivateKeyFilePath())); - d->sshParameters.timeout = map.value(QLatin1String(TimeoutKey), DefaultTimeout).toInt(); + FilePath::fromSettings(map.value(KeyFileKey, defaultPrivateKeyFilePath())); + d->sshParameters.timeout = map.value(TimeoutKey, DefaultTimeout).toInt(); d->sshParameters.hostKeyCheckingMode = static_cast<SshHostKeyCheckingMode> - (map.value(QLatin1String(HostKeyCheckingKey), SshHostKeyCheckingNone).toInt()); + (map.value(HostKeyCheckingKey, SshHostKeyCheckingNone).toInt()); QString portsSpec = map.value(PortsSpecKey).toString(); if (portsSpec.isEmpty()) portsSpec = "10000-10100"; d->freePorts = PortList::fromString(portsSpec); - d->machineType = static_cast<MachineType>(map.value(QLatin1String(MachineTypeKey), DefaultMachineType).toInt()); - d->version = map.value(QLatin1String(VersionKey), 0).toInt(); + d->machineType = static_cast<MachineType>(map.value(MachineTypeKey, DefaultMachineType).toInt()); + d->version = map.value(VersionKey, 0).toInt(); - d->debugServerPath = FilePath::fromSettings(map.value(QLatin1String(DebugServerKey))); - const FilePath qmlRunCmd = FilePath::fromSettings(map.value(QLatin1String(QmlRuntimeKey))); + d->debugServerPath = FilePath::fromSettings(map.value(DebugServerKey)); + const FilePath qmlRunCmd = FilePath::fromSettings(map.value(QmlRuntimeKey)); d->qmlRunCommand = qmlRunCmd; - d->extraData = map.value(ExtraDataKey).toMap(); + d->extraData = map.value(ExtraDataKey).value<Store>(); } /*! @@ -487,30 +486,30 @@ void IDevice::fromMap(const Store &map) Store IDevice::toMap() const { - QVariantMap map; + Store map; d->displayName.toMap(map, DisplayNameKey); - map.insert(QLatin1String(TypeKey), d->type.toString()); - map.insert(QLatin1String(ClientOsTypeKey), osTypeToString(d->osType)); - map.insert(QLatin1String(IdKey), d->id.toSetting()); - map.insert(QLatin1String(OriginKey), d->origin); + map.insert(TypeKey, d->type.toString()); + map.insert(ClientOsTypeKey, osTypeToString(d->osType)); + map.insert(IdKey, d->id.toSetting()); + map.insert(OriginKey, d->origin); QReadLocker locker(&d->lock); - map.insert(QLatin1String(MachineTypeKey), d->machineType); - map.insert(QLatin1String(HostKey), d->sshParameters.host()); - map.insert(QLatin1String(SshPortKey), d->sshParameters.port()); - map.insert(QLatin1String(UserNameKey), d->sshParameters.userName()); - map.insert(QLatin1String(AuthKey), d->sshParameters.authenticationType); - map.insert(QLatin1String(KeyFileKey), d->sshParameters.privateKeyFile.toSettings()); - map.insert(QLatin1String(TimeoutKey), d->sshParameters.timeout); - map.insert(QLatin1String(HostKeyCheckingKey), d->sshParameters.hostKeyCheckingMode); + map.insert(MachineTypeKey, d->machineType); + map.insert(HostKey, d->sshParameters.host()); + map.insert(SshPortKey, d->sshParameters.port()); + map.insert(UserNameKey, d->sshParameters.userName()); + map.insert(AuthKey, d->sshParameters.authenticationType); + map.insert(KeyFileKey, d->sshParameters.privateKeyFile.toSettings()); + map.insert(TimeoutKey, d->sshParameters.timeout); + map.insert(HostKeyCheckingKey, d->sshParameters.hostKeyCheckingMode); - map.insert(QLatin1String(PortsSpecKey), d->freePorts.toString()); - map.insert(QLatin1String(VersionKey), d->version); + map.insert(PortsSpecKey, d->freePorts.toString()); + map.insert(VersionKey, d->version); - map.insert(QLatin1String(DebugServerKey), d->debugServerPath.toSettings()); - map.insert(QLatin1String(QmlRuntimeKey), d->qmlRunCommand.toSettings()); + map.insert(DebugServerKey, d->debugServerPath.toSettings()); + map.insert(QmlRuntimeKey, d->qmlRunCommand.toSettings()); - map.insert(ExtraDataKey, d->extraData); + map.insert(ExtraDataKey, QVariant::fromValue(d->extraData)); return map; } @@ -608,12 +607,12 @@ void IDevice::setQmlRunCommand(const FilePath &path) void IDevice::setExtraData(Id kind, const QVariant &data) { - d->extraData.insert(kind.toString(), data); + d->extraData.insert(keyFromString(kind.toString()), data); } QVariant IDevice::extraData(Id kind) const { - return d->extraData.value(kind.toString()); + return d->extraData.value(keyFromString(kind.toString())); } int IDevice::version() const diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index d0a3473d7df..c174767fcd2 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -27,17 +27,17 @@ #include <QTextCodec> #include <QDebug> -static const QLatin1String kPrefix("EditorConfiguration."); -static const QLatin1String kUseGlobal("EditorConfiguration.UseGlobal"); -static const QLatin1String kCodec("EditorConfiguration.Codec"); -static const QLatin1String kCodeStylePrefix("EditorConfiguration.CodeStyle."); -static const QLatin1String kCodeStyleCount("EditorConfiguration.CodeStyle.Count"); - using namespace TextEditor; using namespace Utils; namespace ProjectExplorer { +const Key kPrefix("EditorConfiguration."); +const Key kUseGlobal("EditorConfiguration.UseGlobal"); +const Key kCodec("EditorConfiguration.Codec"); +const Key kCodeStylePrefix("EditorConfiguration.CodeStyle."); +const Key kCodeStyleCount("EditorConfiguration.CodeStyle.Count"); + struct EditorConfigurationPrivate { EditorConfigurationPrivate() : @@ -159,15 +159,15 @@ QMap<Utils::Id, ICodeStylePreferences *> EditorConfiguration::codeStyles() const return d->m_languageCodeStylePreferences; } -static void toMapWithPrefix(QVariantMap *map, const QVariantMap &source) +static void toMapWithPrefix(Store *map, const Store &source) { for (auto it = source.constBegin(), end = source.constEnd(); it != end; ++it) map->insert(kPrefix + it.key(), it.value()); } -QVariantMap EditorConfiguration::toMap() const +Store EditorConfiguration::toMap() const { - QVariantMap map = { + Store map = { {kUseGlobal, d->m_useGlobal}, {kCodec, d->m_textCodec->name()}, {kCodeStyleCount, d->m_languageCodeStylePreferences.count()} @@ -177,11 +177,11 @@ QVariantMap EditorConfiguration::toMap() const for (auto itCodeStyle = d->m_languageCodeStylePreferences.cbegin(), end = d->m_languageCodeStylePreferences.cend(); itCodeStyle != end; ++itCodeStyle) { - const QVariantMap settingsIdMap = { - {"language", itCodeStyle.key().toSetting()}, - {"value", itCodeStyle.value()->toMap()} + const Store settingsIdMap = { + {"language", QVariant::fromValue(itCodeStyle.key().toSetting())}, + {"value", QVariant::fromValue(itCodeStyle.value()->toMap())} }; - map.insert(kCodeStylePrefix + QString::number(i), settingsIdMap); + map.insert(kCodeStylePrefix + Key::number(i), QVariant::fromValue(settingsIdMap)); i++; } @@ -204,19 +204,19 @@ void EditorConfiguration::fromMap(const Store &map) const int codeStyleCount = map.value(kCodeStyleCount, 0).toInt(); for (int i = 0; i < codeStyleCount; ++i) { - QVariantMap settingsIdMap = map.value(kCodeStylePrefix + QString::number(i)).toMap(); + Store settingsIdMap = map.value(kCodeStylePrefix + Key::number(i)).value<Store>(); if (settingsIdMap.isEmpty()) { qWarning() << "No data for code style settings list" << i << "found!"; continue; } - Utils::Id languageId = Utils::Id::fromSetting(settingsIdMap.value(QLatin1String("language"))); - QVariantMap value = settingsIdMap.value(QLatin1String("value")).toMap(); + Id languageId = Id::fromSetting(settingsIdMap.value("language")); + Store value = settingsIdMap.value("value").value<Store>(); ICodeStylePreferences *preferences = d->m_languageCodeStylePreferences.value(languageId); if (preferences) preferences->fromMap(value); } - QVariantMap submap; + Store submap; for (auto it = map.constBegin(), end = map.constEnd(); it != end; ++it) { if (it.key().startsWith(kPrefix)) submap.insert(it.key().mid(kPrefix.size()), it.value()); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp index acb32043dc7..e3a522a3e40 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp @@ -525,7 +525,7 @@ QWidget *LineEditField::createWidget(const QString &displayName, JsonFieldPage * w->setFixupExpando(m_fixupExpando); if (!m_historyId.isEmpty()) - w->setHistoryCompleter(m_historyId, m_restoreLastHistoryItem); + w->setHistoryCompleter(keyFromString(m_historyId), m_restoreLastHistoryItem); w->setEchoMode(m_isPassword ? QLineEdit::Password : QLineEdit::Normal); QObject::connect(w, &FancyLineEdit::textEdited, [this] { setHasUserChanges(); }); @@ -800,7 +800,7 @@ QWidget *PathChooserField::createWidget(const QString &displayName, JsonFieldPag Q_UNUSED(page) auto w = new PathChooser; if (!m_historyId.isEmpty()) - w->setHistoryCompleter(m_historyId); + w->setHistoryCompleter(keyFromString(m_historyId)); QObject::connect(w, &PathChooser::textChanged, [this, w] { if (w->filePath() != m_path) setHasUserChanges(); diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index eb82ea20d45..931540e9b79 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -123,41 +123,40 @@ Kit::Kit(Id id) { } -Kit::Kit(const QVariantMap &data) : - d(std::make_unique<Internal::KitPrivate>(Id(), this)) +Kit::Kit(const Store &data) + : d(std::make_unique<Internal::KitPrivate>(Id(), this)) { - d->m_id = Id::fromSetting(data.value(QLatin1String(ID_KEY))); + d->m_id = Id::fromSetting(data.value(ID_KEY)); - d->m_autodetected = data.value(QLatin1String(AUTODETECTED_KEY)).toBool(); - d->m_autoDetectionSource = data.value(QLatin1String(AUTODETECTIONSOURCE_KEY)).toString(); + d->m_autodetected = data.value(AUTODETECTED_KEY).toBool(); + d->m_autoDetectionSource = data.value(AUTODETECTIONSOURCE_KEY).toString(); // if we don't have that setting assume that autodetected implies sdk - QVariant value = data.value(QLatin1String(SDK_PROVIDED_KEY)); + QVariant value = data.value(SDK_PROVIDED_KEY); if (value.isValid()) d->m_sdkProvided = value.toBool(); else d->m_sdkProvided = d->m_autodetected; d->m_unexpandedDisplayName.fromMap(data, DISPLAYNAME_KEY); - d->m_fileSystemFriendlyName = data.value(QLatin1String(FILESYSTEMFRIENDLYNAME_KEY)).toString(); - d->m_iconPath = FilePath::fromString(data.value(QLatin1String(ICON_KEY), - d->m_iconPath.toString()).toString()); + d->m_fileSystemFriendlyName = data.value(FILESYSTEMFRIENDLYNAME_KEY).toString(); + d->m_iconPath = FilePath::fromString(data.value(ICON_KEY, d->m_iconPath.toString()).toString()); d->m_deviceTypeForIcon = Id::fromSetting(data.value(DEVICE_TYPE_FOR_ICON_KEY)); const auto it = data.constFind(IRRELEVANT_ASPECTS_KEY); if (it != data.constEnd()) d->m_irrelevantAspects = transform<QSet<Id>>(it.value().toList(), &Id::fromSetting); - QVariantMap extra = data.value(QLatin1String(DATA_KEY)).toMap(); + Store extra = data.value(DATA_KEY).value<Store>(); d->m_data.clear(); // remove default values - const QVariantMap::ConstIterator cend = extra.constEnd(); - for (QVariantMap::ConstIterator it = extra.constBegin(); it != cend; ++it) - d->m_data.insert(Id::fromString(it.key()), it.value()); + const Store::ConstIterator cend = extra.constEnd(); + for (Store::ConstIterator it = extra.constBegin(); it != cend; ++it) + d->m_data.insert(Id::fromString(stringFromKey(it.key())), it.value()); - const QStringList mutableInfoList = data.value(QLatin1String(MUTABLE_INFO_KEY)).toStringList(); + const QStringList mutableInfoList = data.value(MUTABLE_INFO_KEY).toStringList(); for (const QString &mutableInfo : mutableInfoList) d->m_mutable.insert(Id::fromString(mutableInfo)); - const QStringList stickyInfoList = data.value(QLatin1String(STICKY_INFO_KEY)).toStringList(); + const QStringList stickyInfoList = data.value(STICKY_INFO_KEY).toStringList(); for (const QString &stickyInfo : stickyInfoList) d->m_sticky.insert(Id::fromString(stickyInfo)); } @@ -484,42 +483,42 @@ bool Kit::isEqual(const Kit *other) const && d->m_mutable == other->d->m_mutable; } -QVariantMap Kit::toMap() const +Store Kit::toMap() const { using IdVariantConstIt = QHash<Id, QVariant>::ConstIterator; - QVariantMap data; + Store data; d->m_unexpandedDisplayName.toMap(data, DISPLAYNAME_KEY); - data.insert(QLatin1String(ID_KEY), QString::fromLatin1(d->m_id.name())); - data.insert(QLatin1String(AUTODETECTED_KEY), d->m_autodetected); + data.insert(ID_KEY, QString::fromLatin1(d->m_id.name())); + data.insert(AUTODETECTED_KEY, d->m_autodetected); if (!d->m_fileSystemFriendlyName.isEmpty()) - data.insert(QLatin1String(FILESYSTEMFRIENDLYNAME_KEY), d->m_fileSystemFriendlyName); - data.insert(QLatin1String(AUTODETECTIONSOURCE_KEY), d->m_autoDetectionSource); - data.insert(QLatin1String(SDK_PROVIDED_KEY), d->m_sdkProvided); - data.insert(QLatin1String(ICON_KEY), d->m_iconPath.toString()); + data.insert(FILESYSTEMFRIENDLYNAME_KEY, d->m_fileSystemFriendlyName); + data.insert(AUTODETECTIONSOURCE_KEY, d->m_autoDetectionSource); + data.insert(SDK_PROVIDED_KEY, d->m_sdkProvided); + data.insert(ICON_KEY, d->m_iconPath.toString()); data.insert(DEVICE_TYPE_FOR_ICON_KEY, d->m_deviceTypeForIcon.toSetting()); QStringList mutableInfo; for (const Id id : std::as_const(d->m_mutable)) mutableInfo << id.toString(); - data.insert(QLatin1String(MUTABLE_INFO_KEY), mutableInfo); + data.insert(MUTABLE_INFO_KEY, mutableInfo); QStringList stickyInfo; for (const Id id : std::as_const(d->m_sticky)) stickyInfo << id.toString(); - data.insert(QLatin1String(STICKY_INFO_KEY), stickyInfo); + data.insert(STICKY_INFO_KEY, stickyInfo); if (d->m_irrelevantAspects) { data.insert(IRRELEVANT_ASPECTS_KEY, transform<QVariantList>(d->m_irrelevantAspects.value(), &Id::toSetting)); } - QVariantMap extra; + Store extra; const IdVariantConstIt cend = d->m_data.constEnd(); for (IdVariantConstIt it = d->m_data.constBegin(); it != cend; ++it) - extra.insert(QString::fromLatin1(it.key().name().constData()), it.value()); - data.insert(QLatin1String(DATA_KEY), extra); + extra.insert(keyFromString(QString::fromLatin1(it.key().name().constData())), it.value()); + data.insert(DATA_KEY, QVariant::fromValue(extra)); return data; } diff --git a/src/plugins/projectexplorer/kit.h b/src/plugins/projectexplorer/kit.h index e2eb4f3a754..e6611ed7212 100644 --- a/src/plugins/projectexplorer/kit.h +++ b/src/plugins/projectexplorer/kit.h @@ -40,8 +40,8 @@ public: using Predicate = std::function<bool(const Kit *)>; static Predicate defaultPredicate(); - explicit Kit(Utils::Id id = Utils::Id()); - explicit Kit(const QVariantMap &data); + explicit Kit(Utils::Id id = {}); + explicit Kit(const Utils::Store &data); ~Kit(); // Do not trigger evaluations diff --git a/src/plugins/projectexplorer/kitaspects.cpp b/src/plugins/projectexplorer/kitaspects.cpp index 7bd7435d143..c3230348088 100644 --- a/src/plugins/projectexplorer/kitaspects.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -53,7 +53,7 @@ public: { m_chooser = createSubWidget<PathChooser>(); m_chooser->setExpectedKind(PathChooser::ExistingDirectory); - m_chooser->setHistoryCompleter(QLatin1String("PE.SysRoot.History")); + m_chooser->setHistoryCompleter("PE.SysRoot.History"); m_chooser->setFilePath(SysRootKitAspect::sysRoot(k)); connect(m_chooser, &PathChooser::textChanged, this, &SysRootKitAspectImpl::pathWasChanged); diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 5215d15fbf0..6731089f6da 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -439,20 +439,20 @@ void KitManager::saveKits() if (!d->m_writer) // ignore save requests while we are not initialized. return; - QVariantMap data; - data.insert(QLatin1String(KIT_FILE_VERSION_KEY), 1); + Store data; + data.insert(KIT_FILE_VERSION_KEY, 1); int count = 0; const QList<Kit *> kits = KitManager::kits(); for (Kit *k : kits) { - QVariantMap tmp = k->toMap(); + Store tmp = k->toMap(); if (tmp.isEmpty()) continue; - data.insert(QString::fromLatin1(KIT_DATA_KEY) + QString::number(count), tmp); + data.insert(KIT_DATA_KEY + Key::number(count), QVariant::fromValue(tmp)); ++count; } - data.insert(QLatin1String(KIT_COUNT_KEY), count); - data.insert(QLatin1String(KIT_DEFAULT_KEY), + data.insert(KIT_COUNT_KEY, count); + data.insert(KIT_DEFAULT_KEY, d->m_defaultKit ? QString::fromLatin1(d->m_defaultKit->id().name()) : QString()); data.insert(KIT_IRRELEVANT_ASPECTS_KEY, transform<QVariantList>(d->m_irrelevantAspects, &Id::toSetting)); @@ -503,22 +503,22 @@ static KitList restoreKitsHelper(const FilePath &fileName) qPrintable(fileName.toUserOutput())); return result; } - QVariantMap data = reader.restoreValues(); + Store data = reader.restoreValues(); // Check version: - int version = data.value(QLatin1String(KIT_FILE_VERSION_KEY), 0).toInt(); + int version = data.value(KIT_FILE_VERSION_KEY, 0).toInt(); if (version < 1) { qWarning("Warning: Kit file version %d not supported, cannot restore kits!", version); return result; } - const int count = data.value(QLatin1String(KIT_COUNT_KEY), 0).toInt(); + const int count = data.value(KIT_COUNT_KEY, 0).toInt(); for (int i = 0; i < count; ++i) { - const QString key = QString::fromLatin1(KIT_DATA_KEY) + QString::number(i); + const Key key = KIT_DATA_KEY + Key::number(i); if (!data.contains(key)) break; - const QVariantMap stMap = data.value(key).toMap(); + const Store stMap = data.value(key).value<Store>(); auto k = std::make_unique<Kit>(stMap); if (k->id().isValid()) { @@ -529,7 +529,7 @@ static KitList restoreKitsHelper(const FilePath &fileName) i); } } - const Id id = Id::fromSetting(data.value(QLatin1String(KIT_DEFAULT_KEY))); + const Id id = Id::fromSetting(data.value(KIT_DEFAULT_KEY)); if (!id.isValid()) return result; diff --git a/src/plugins/projectexplorer/projectconfiguration.cpp b/src/plugins/projectexplorer/projectconfiguration.cpp index 5609bf9bbe1..33285507453 100644 --- a/src/plugins/projectexplorer/projectconfiguration.cpp +++ b/src/plugins/projectexplorer/projectconfiguration.cpp @@ -37,14 +37,14 @@ Kit *ProjectConfiguration::kit() const return m_target->kit(); } -Utils::Id ProjectConfiguration::id() const +Id ProjectConfiguration::id() const { return m_id; } -QString ProjectConfiguration::settingsIdKey() +Key ProjectConfiguration::settingsIdKey() { - return QString(CONFIGURATION_ID_KEY); + return CONFIGURATION_ID_KEY; } void ProjectConfiguration::setDisplayName(const QString &name) @@ -75,7 +75,7 @@ QString ProjectConfiguration::toolTip() const void ProjectConfiguration::toMap(Store &map) const { QTC_CHECK(m_id.isValid()); - map.insert(QLatin1String(CONFIGURATION_ID_KEY), m_id.toSetting()); + map.insert(CONFIGURATION_ID_KEY, m_id.toSetting()); m_displayName.toMap(map, DISPLAY_NAME_KEY); AspectContainer::toMap(map); } @@ -87,18 +87,18 @@ Target *ProjectConfiguration::target() const void ProjectConfiguration::fromMap(const Store &map) { - Utils::Id id = Utils::Id::fromSetting(map.value(QLatin1String(CONFIGURATION_ID_KEY))); + Id id = Id::fromSetting(map.value(CONFIGURATION_ID_KEY)); // Note: This is only "startsWith", not ==, as RunConfigurations currently still // mangle in their build keys. - QTC_ASSERT(id.toString().startsWith(m_id.toString()), reportError(); return); + QTC_ASSERT(id.name().startsWith(m_id.name()), reportError(); return); m_displayName.fromMap(map, DISPLAY_NAME_KEY); AspectContainer::fromMap(map); } -Id ProjectExplorer::idFromMap(const QVariantMap &map) +Id ProjectExplorer::idFromMap(const Store &map) { - return Id::fromSetting(map.value(QLatin1String(CONFIGURATION_ID_KEY))); + return Id::fromSetting(map.value(CONFIGURATION_ID_KEY)); } QString ProjectConfiguration::expandedDisplayName() const diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h index ad3ecfcc901..329c660916c 100644 --- a/src/plugins/projectexplorer/projectconfiguration.h +++ b/src/plugins/projectexplorer/projectconfiguration.h @@ -53,7 +53,7 @@ public: Project *project() const; Kit *kit() const; - static QString settingsIdKey(); + static Utils::Key settingsIdKey(); signals: void displayNameChanged(); diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 698fcc54daf..90da2076629 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -496,7 +496,7 @@ void FlatModel::saveExpandData() { // TODO if there are multiple ProjectTreeWidgets, the last one saves the data QList<QVariant> data = Utils::transform<QList>(m_toExpand, &ExpandData::toSettings); - SessionManager::setValue(QLatin1String("ProjectTree.ExpandData"), data); + SessionManager::setValue("ProjectTree.ExpandData", data); } void FlatModel::addFolderNode(WrapperNode *parent, FolderNode *folderNode, QSet<Node *> *seen) diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index a3d608ebd80..c0113118a81 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -638,7 +638,7 @@ void ProjectTreeWidgetFactory::saveSettings(QtcSettings *settings, int position, { auto ptw = qobject_cast<ProjectTreeWidget *>(widget); Q_ASSERT(ptw); - const QString baseKey = kBaseKey + QString::number(position); + const Key baseKey = kBaseKey + Key::number(position); settings->setValueWithDefault(baseKey + kProjectFilterKey, ptw->projectFilter(), kProjectFilterDefault); diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 36370b446d8..fcf57694c76 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -89,14 +89,14 @@ void GlobalOrProjectAspect::fromMap(const Store &map) { if (m_projectSettings) m_projectSettings->fromMap(map); - m_useGlobalSettings = map.value(id().toString() + ".UseGlobalSettings", true).toBool(); + m_useGlobalSettings = map.value(keyFromString(id().toString() + ".UseGlobalSettings"), true).toBool(); } void GlobalOrProjectAspect::toMap(Store &map) const { if (m_projectSettings) m_projectSettings->toMap(map); - map.insert(id().toString() + ".UseGlobalSettings", m_useGlobalSettings); + map.insert(keyFromString(id().toString() + ".UseGlobalSettings"), m_useGlobalSettings); } void GlobalOrProjectAspect::toActiveMap(Store &data) const diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 72149ae7b39..f9a3491de3d 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -564,7 +564,7 @@ void ExecutableAspect::setDeviceSelector(Target *target, ExecutionDeviceSelector \sa Utils::PathChooser::setHistoryCompleter() */ -void ExecutableAspect::setHistoryCompleter(const QString &historyCompleterKey) +void ExecutableAspect::setHistoryCompleter(const Key &historyCompleterKey) { m_executable.setHistoryCompleter(historyCompleterKey); if (m_alternativeExecutable) @@ -609,7 +609,7 @@ void ExecutableAspect::setReadOnly(bool readOnly) \sa Utils::StringAspect::makeCheckable() */ -void ExecutableAspect::makeOverridable(const QString &overridingKey, const QString &useOverridableKey) +void ExecutableAspect::makeOverridable(const Key &overridingKey, const Key &useOverridableKey) { QTC_ASSERT(!m_alternativeExecutable, return); m_alternativeExecutable = new FilePathAspect; @@ -684,7 +684,7 @@ void ExecutableAspect::setExecutable(const FilePath &executable) /*! Sets the settings key to \a key. */ -void ExecutableAspect::setSettingsKey(const QString &key) +void ExecutableAspect::setSettingsKey(const Key &key) { BaseAspect::setSettingsKey(key); m_executable.setSettingsKey(key); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index 602ce39b3d4..bec508d69e8 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -167,12 +167,12 @@ public: void setExecutable(const Utils::FilePath &executable); void setDeviceSelector(Target *target, ExecutionDeviceSelector selector); - void setSettingsKey(const QString &key); - void makeOverridable(const QString &overridingKey, const QString &useOverridableKey); + void setSettingsKey(const Utils::Key &key); + void makeOverridable(const Utils::Key &overridingKey, const Utils::Key &useOverridableKey); void addToLayout(Layouting::LayoutItem &parent) override; void setLabelText(const QString &labelText); void setPlaceHolderText(const QString &placeHolderText); - void setHistoryCompleter(const QString &historyCompleterKey); + void setHistoryCompleter(const Utils::Key &historyCompleterKey); void setExpectedKind(const Utils::PathChooser::Kind expectedKind); void setEnvironment(const Utils::Environment &env); void setReadOnly(bool readOnly); diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index d8c459b7ad6..54e0ade00b0 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -91,7 +91,7 @@ public: DeployConfiguration *m_activeDeployConfiguration = nullptr; QList<RunConfiguration *> m_runConfigurations; RunConfiguration* m_activeRunConfiguration = nullptr; - QVariantMap m_pluginSettings; + Store m_pluginSettings; Kit *const m_kit; MacroExpander m_macroExpander; @@ -321,14 +321,14 @@ QString Target::toolTip() const return d->m_kit->toHtml(); } -QString Target::displayNameKey() +Key Target::displayNameKey() { - return QString("ProjectExplorer.ProjectConfiguration.DisplayName"); + return "ProjectExplorer.ProjectConfiguration.DisplayName"; } -QString Target::deviceTypeKey() +Key Target::deviceTypeKey() { - return QString("DeviceType"); + return "DeviceType"; } void Target::addBuildConfiguration(BuildConfiguration *bc) @@ -581,12 +581,12 @@ QString Target::overlayIconToolTip() return current.isNull() ? QString() : formatDeviceInfo(current->deviceInformation()); } -QVariantMap Target::toMap() const +Store Target::toMap() const { if (!d->m_kit) // Kit was deleted, target is only around to be copied. return {}; - QVariantMap map; + Store map; map.insert(displayNameKey(), displayName()); map.insert(deviceTypeKey(), DeviceTypeKitAspect::deviceTypeId(kit()).toSetting()); @@ -595,39 +595,39 @@ QVariantMap Target::toMap() const // This is only read by older versions of Creator, but even there not actively used. const char CONFIGURATION_ID_KEY[] = "ProjectExplorer.ProjectConfiguration.Id"; const char DEFAULT_DISPLAY_NAME_KEY[] = "ProjectExplorer.ProjectConfiguration.DefaultDisplayName"; - map.insert(QLatin1String(CONFIGURATION_ID_KEY), id().toSetting()); - map.insert(QLatin1String(DEFAULT_DISPLAY_NAME_KEY), displayName()); + map.insert(CONFIGURATION_ID_KEY, id().toSetting()); + map.insert(DEFAULT_DISPLAY_NAME_KEY, displayName()); } const QList<BuildConfiguration *> bcs = buildConfigurations(); - map.insert(QLatin1String(ACTIVE_BC_KEY), bcs.indexOf(d->m_activeBuildConfiguration)); - map.insert(QLatin1String(BC_COUNT_KEY), bcs.size()); + map.insert(ACTIVE_BC_KEY, bcs.indexOf(d->m_activeBuildConfiguration)); + map.insert(BC_COUNT_KEY, bcs.size()); for (int i = 0; i < bcs.size(); ++i) { - QVariantMap data; + Store data; bcs.at(i)->toMap(data); - map.insert(QString::fromLatin1(BC_KEY_PREFIX) + QString::number(i), data); + map.insert(BC_KEY_PREFIX + Key::number(i), QVariant::fromValue(data)); } const QList<DeployConfiguration *> dcs = deployConfigurations(); - map.insert(QLatin1String(ACTIVE_DC_KEY), dcs.indexOf(d->m_activeDeployConfiguration)); - map.insert(QLatin1String(DC_COUNT_KEY), dcs.size()); + map.insert(ACTIVE_DC_KEY, dcs.indexOf(d->m_activeDeployConfiguration)); + map.insert(DC_COUNT_KEY, dcs.size()); for (int i = 0; i < dcs.size(); ++i) { - QVariantMap data; + Store data; dcs.at(i)->toMap(data); - map.insert(QString::fromLatin1(DC_KEY_PREFIX) + QString::number(i), data); + map.insert(DC_KEY_PREFIX + Key::number(i), QVariant::fromValue(data)); } const QList<RunConfiguration *> rcs = runConfigurations(); - map.insert(QLatin1String(ACTIVE_RC_KEY), rcs.indexOf(d->m_activeRunConfiguration)); - map.insert(QLatin1String(RC_COUNT_KEY), rcs.size()); + map.insert(ACTIVE_RC_KEY, rcs.indexOf(d->m_activeRunConfiguration)); + map.insert(RC_COUNT_KEY, rcs.size()); for (int i = 0; i < rcs.size(); ++i) { - QVariantMap data; + Store data; rcs.at(i)->toMap(data); - map.insert(QString::fromLatin1(RC_KEY_PREFIX) + QString::number(i), data); + map.insert(RC_KEY_PREFIX + Key::number(i), QVariant::fromValue(data)); } if (!d->m_pluginSettings.isEmpty()) - map.insert(QLatin1String(PLUGIN_SETTINGS_KEY), d->m_pluginSettings); + map.insert(PLUGIN_SETTINGS_KEY, d->m_pluginSettings); return map; } @@ -810,12 +810,12 @@ void Target::updateDefaultRunConfigurations() emit runConfigurationsUpdated(); } -QVariant Target::namedSettings(const QString &name) const +QVariant Target::namedSettings(const Key &name) const { return d->m_pluginSettings.value(name); } -void Target::setNamedSettings(const QString &name, const QVariant &value) +void Target::setNamedSettings(const Key &name, const QVariant &value) { if (value.isNull()) d->m_pluginSettings.remove(name); @@ -890,20 +890,20 @@ bool Target::fromMap(const Store &map) QTC_ASSERT(d->m_kit == KitManager::kit(id()), return false); bool ok; - int bcCount = map.value(QLatin1String(BC_COUNT_KEY), 0).toInt(&ok); + int bcCount = map.value(BC_COUNT_KEY, 0).toInt(&ok); if (!ok || bcCount < 0) bcCount = 0; - int activeConfiguration = map.value(QLatin1String(ACTIVE_BC_KEY), 0).toInt(&ok); + int activeConfiguration = map.value(ACTIVE_BC_KEY, 0).toInt(&ok); if (!ok || activeConfiguration < 0) activeConfiguration = 0; if (0 > activeConfiguration || bcCount < activeConfiguration) activeConfiguration = 0; for (int i = 0; i < bcCount; ++i) { - const QString key = QString::fromLatin1(BC_KEY_PREFIX) + QString::number(i); + const Key key = BC_KEY_PREFIX + Key::number(i); if (!map.contains(key)) return false; - const QVariantMap valueMap = map.value(key).toMap(); + const Store valueMap = map.value(key).toMap(); BuildConfiguration *bc = BuildConfigurationFactory::restore(this, valueMap); if (!bc) { qWarning("No factory found to restore build configuration!"); @@ -917,20 +917,20 @@ bool Target::fromMap(const Store &map) if (buildConfigurations().isEmpty() && BuildConfigurationFactory::find(this)) return false; - int dcCount = map.value(QLatin1String(DC_COUNT_KEY), 0).toInt(&ok); + int dcCount = map.value(DC_COUNT_KEY, 0).toInt(&ok); if (!ok || dcCount < 0) dcCount = 0; - activeConfiguration = map.value(QLatin1String(ACTIVE_DC_KEY), 0).toInt(&ok); + activeConfiguration = map.value(ACTIVE_DC_KEY, 0).toInt(&ok); if (!ok || activeConfiguration < 0) activeConfiguration = 0; if (0 > activeConfiguration || dcCount < activeConfiguration) activeConfiguration = 0; for (int i = 0; i < dcCount; ++i) { - const QString key = QString::fromLatin1(DC_KEY_PREFIX) + QString::number(i); + const Key key = DC_KEY_PREFIX + Key::number(i); if (!map.contains(key)) return false; - QVariantMap valueMap = map.value(key).toMap(); + Store valueMap = map.value(key).value<Store>(); DeployConfiguration *dc = DeployConfigurationFactory::restore(this, valueMap); if (!dc) { Utils::Id id = idFromMap(valueMap); @@ -944,22 +944,22 @@ bool Target::fromMap(const Store &map) setActiveDeployConfiguration(dc); } - int rcCount = map.value(QLatin1String(RC_COUNT_KEY), 0).toInt(&ok); + int rcCount = map.value(RC_COUNT_KEY, 0).toInt(&ok); if (!ok || rcCount < 0) rcCount = 0; - activeConfiguration = map.value(QLatin1String(ACTIVE_RC_KEY), 0).toInt(&ok); + activeConfiguration = map.value(ACTIVE_RC_KEY, 0).toInt(&ok); if (!ok || activeConfiguration < 0) activeConfiguration = 0; if (0 > activeConfiguration || rcCount < activeConfiguration) activeConfiguration = 0; for (int i = 0; i < rcCount; ++i) { - const QString key = QString::fromLatin1(RC_KEY_PREFIX) + QString::number(i); + const Key key = RC_KEY_PREFIX + Key::number(i); if (!map.contains(key)) return false; // Ignore missing RCs: We will just populate them using the default ones. - QVariantMap valueMap = map.value(key).toMap(); + Store valueMap = map.value(key).value<Store>(); RunConfiguration *rc = RunConfigurationFactory::restore(this, valueMap); if (!rc) continue; @@ -972,8 +972,8 @@ bool Target::fromMap(const Store &map) setActiveRunConfiguration(rc); } - if (map.contains(QLatin1String(PLUGIN_SETTINGS_KEY))) - d->m_pluginSettings = map.value(QLatin1String(PLUGIN_SETTINGS_KEY)).toMap(); + if (map.contains(PLUGIN_SETTINGS_KEY)) + d->m_pluginSettings = map.value(PLUGIN_SETTINGS_KEY).toMap(); return true; } diff --git a/src/plugins/projectexplorer/target.h b/src/plugins/projectexplorer/target.h index 0b032d0577e..fa8fa4b3b0e 100644 --- a/src/plugins/projectexplorer/target.h +++ b/src/plugins/projectexplorer/target.h @@ -57,8 +57,8 @@ public: QString displayName() const; QString toolTip() const; - static QString displayNameKey(); - static QString deviceTypeKey(); + static Utils::Key displayNameKey(); + static Utils::Key deviceTypeKey(); // Build configuration void addBuildConfiguration(BuildConfiguration *bc); @@ -94,8 +94,8 @@ public: void updateDefaultDeployConfigurations(); void updateDefaultRunConfigurations(); - QVariant namedSettings(const QString &name) const; - void setNamedSettings(const QString &name, const QVariant &value); + QVariant namedSettings(const Utils::Key &name) const; + void setNamedSettings(const Utils::Key &name, const QVariant &value); QVariant additionalData(Utils::Id id) const; diff --git a/src/plugins/projectexplorer/targetsetupwidget.cpp b/src/plugins/projectexplorer/targetsetupwidget.cpp index ea49a54c75b..99b08d45f97 100644 --- a/src/plugins/projectexplorer/targetsetupwidget.cpp +++ b/src/plugins/projectexplorer/targetsetupwidget.cpp @@ -138,7 +138,7 @@ void TargetSetupWidget::addBuildInfo(const BuildInfo &info, bool isImport) store.pathChooser = new PathChooser(); store.pathChooser->setExpectedKind(PathChooser::Directory); store.pathChooser->setFilePath(info.buildDirectory); - store.pathChooser->setHistoryCompleter(QLatin1String("TargetSetup.BuildDir.History")); + store.pathChooser->setHistoryCompleter("TargetSetup.BuildDir.History"); store.pathChooser->setReadOnly(isImport); m_newBuildsLayout->addWidget(store.pathChooser, pos * 2, 1); diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 7416c383e77..a7e419034d8 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -343,19 +343,19 @@ void TaskWindow::saveSettings() { const QStringList categories = Utils::toList( Utils::transform(d->m_filter->filteredCategories(), &Id::toString)); - SessionManager::setValue(QLatin1String(SESSION_FILTER_CATEGORIES), categories); - SessionManager::setValue(QLatin1String(SESSION_FILTER_WARNINGS), d->m_filter->filterIncludesWarnings()); + SessionManager::setValue(SESSION_FILTER_CATEGORIES, categories); + SessionManager::setValue(SESSION_FILTER_WARNINGS, d->m_filter->filterIncludesWarnings()); } void TaskWindow::loadSettings() { - QVariant value = SessionManager::value(QLatin1String(SESSION_FILTER_CATEGORIES)); + QVariant value = SessionManager::value(SESSION_FILTER_CATEGORIES); if (value.isValid()) { const QSet<Id> categories = Utils::toSet( Utils::transform(value.toStringList(), &Id::fromString)); d->m_filter->setFilteredCategories(categories); } - value = SessionManager::value(QLatin1String(SESSION_FILTER_WARNINGS)); + value = SessionManager::value(SESSION_FILTER_WARNINGS); if (value.isValid()) { bool includeWarnings = value.toBool(); d->m_filter->setFilterIncludesWarnings(includeWarnings); diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 861af665ec2..8cbf17f35f4 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -50,14 +50,14 @@ public: m_headerPathsCache(new ToolChain::HeaderPathsCache::element_type()) { QTC_ASSERT(m_typeId.isValid(), return); - QTC_ASSERT(!m_typeId.toString().contains(QLatin1Char(':')), return); + QTC_ASSERT(!m_typeId.name().contains(':'), return); } QByteArray m_id; FilePath m_compilerCommand; - QString m_compilerCommandKey; + Key m_compilerCommandKey; Abi m_targetAbi; - QString m_targetAbiKey; + Key m_targetAbiKey; QSet<Id> m_supportedLanguages; mutable QString m_displayName; QString m_typeDisplayName; @@ -223,7 +223,7 @@ ToolChain *ToolChain::clone() const if (f->supportedToolChainType() == d->m_typeId) { ToolChain *tc = f->create(); QTC_ASSERT(tc, return nullptr); - QVariantMap data; + Store data; toMap(data); tc->fromMap(data); // New ID for the clone. It's different. @@ -246,10 +246,10 @@ void ToolChain::toMap(Store &result) const AspectContainer::toMap(result); QString idToSave = d->m_typeId.toString() + QLatin1Char(':') + QString::fromUtf8(id()); - result.insert(QLatin1String(ID_KEY), idToSave); - result.insert(QLatin1String(DISPLAY_NAME_KEY), displayName()); - result.insert(QLatin1String(AUTODETECT_KEY), isAutoDetected()); - result.insert(QLatin1String(DETECTION_SOURCE_KEY), d->m_detectionSource); + result.insert(ID_KEY, idToSave); + result.insert(DISPLAY_NAME_KEY, displayName()); + result.insert(AUTODETECT_KEY, isAutoDetected()); + result.insert(DETECTION_SOURCE_KEY, d->m_detectionSource); result.insert(CODE_MODEL_TRIPLE_KEY, d->m_explicitCodeModelTargetTriple); // <Compatibility with QtC 4.2> int oldLanguageId = -1; @@ -260,7 +260,7 @@ void ToolChain::toMap(Store &result) const if (oldLanguageId >= 0) result.insert(LANGUAGE_KEY_V1, oldLanguageId); // </Compatibility> - result.insert(QLatin1String(LANGUAGE_KEY_V2), language().toSetting()); + result.insert(LANGUAGE_KEY_V2, language().toSetting()); if (!d->m_targetAbiKey.isEmpty()) result.insert(d->m_targetAbiKey, d->m_targetAbi.toString()); if (!d->m_compilerCommandKey.isEmpty()) @@ -553,7 +553,7 @@ void ToolChain::setExplicitCodeModelTargetTriple(const QString &triple) */ /*! - \fn bool ProjectExplorer::ToolChainFactory::canRestore(const QVariantMap &data) + \fn bool ProjectExplorer::ToolChainFactory::canRestore(const Store &data) Used by the tool chain manager to restore user-generated tool chains. */ @@ -594,7 +594,7 @@ ToolChain *ToolChainFactory::create() const return m_toolchainConstructor ? m_toolchainConstructor() : nullptr; } -ToolChain *ToolChainFactory::restore(const QVariantMap &data) +ToolChain *ToolChainFactory::restore(const Store &data) { if (!m_toolchainConstructor) return nullptr; @@ -610,7 +610,7 @@ ToolChain *ToolChainFactory::restore(const QVariantMap &data) return nullptr; } -static QPair<QString, QString> rawIdData(const QVariantMap &data) +static QPair<QString, QString> rawIdData(const Store &data) { const QString raw = data.value(QLatin1String(ID_KEY)).toString(); const int pos = raw.indexOf(QLatin1Char(':')); @@ -618,17 +618,17 @@ static QPair<QString, QString> rawIdData(const QVariantMap &data) return {raw.mid(0, pos), raw.mid(pos + 1)}; } -QByteArray ToolChainFactory::idFromMap(const QVariantMap &data) +QByteArray ToolChainFactory::idFromMap(const Store &data) { return rawIdData(data).second.toUtf8(); } -Id ToolChainFactory::typeIdFromMap(const QVariantMap &data) +Id ToolChainFactory::typeIdFromMap(const Store &data) { return Id::fromString(rawIdData(data).first); } -void ToolChainFactory::autoDetectionToMap(QVariantMap &data, bool detected) +void ToolChainFactory::autoDetectionToMap(Store &data, bool detected) { data.insert(QLatin1String(AUTODETECT_KEY), detected); } @@ -704,7 +704,7 @@ static QString badToolchainFilePathKey() { return {"FilePath"}; } static QString badToolchainSymlinkTargetKey() { return {"TargetFilePath"}; } static QString badToolchainTimestampKey() { return {"Timestamp"}; } -QVariantMap BadToolchain::toMap() const +Store BadToolchain::toMap() const { return {{badToolchainFilePathKey(), filePath.toSettings()}, {badToolchainSymlinkTargetKey(), symlinkTarget.toSettings()}, diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index e1f53787e45..40f619260f5 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -15,13 +15,9 @@ #include <utils/aspects.h> #include <utils/cpplanguage_details.h> #include <utils/environment.h> -#include <utils/fileutils.h> -#include <utils/id.h> +#include <utils/store.h> #include <QDateTime> -#include <QObject> -#include <QStringList> -#include <QVariantMap> #include <functional> #include <memory> diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index 4a174cdf837..568b5af7cf9 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -48,7 +48,7 @@ class UserFileVersion14Upgrader : public VersionUpgrader { public: UserFileVersion14Upgrader() : VersionUpgrader(14, "3.0-pre1") { } - QVariantMap upgrade(const QVariantMap &map) final; + Store upgrade(const Store &map) final; }; // Version 15 Use settingsaccessor based class for user file reading/writing @@ -56,7 +56,7 @@ class UserFileVersion15Upgrader : public VersionUpgrader { public: UserFileVersion15Upgrader() : VersionUpgrader(15, "3.2-pre1") { } - QVariantMap upgrade(const QVariantMap &map) final; + Store upgrade(const Store &map) final; }; // Version 16 Changed android deployment @@ -64,15 +64,15 @@ class UserFileVersion16Upgrader : public VersionUpgrader { public: UserFileVersion16Upgrader() : VersionUpgrader(16, "3.3-pre1") { } - QVariantMap upgrade(const QVariantMap &data) final; + Store upgrade(const Store &data) final; private: class OldStepMaps { public: QString defaultDisplayName; QString displayName; - QVariantMap androidPackageInstall; - QVariantMap androidDeployQt; + Store androidPackageInstall; + Store androidDeployQt; bool isEmpty() { return androidPackageInstall.isEmpty() || androidDeployQt.isEmpty(); @@ -80,10 +80,10 @@ private: }; - QVariantMap removeAndroidPackageStep(QVariantMap deployMap); - OldStepMaps extractStepMaps(const QVariantMap &deployMap); + Store removeAndroidPackageStep(Store deployMap); + OldStepMaps extractStepMaps(const Store &deployMap); enum NamePolicy { KeepName, RenameBuildConfiguration }; - QVariantMap insertSteps(QVariantMap buildConfigurationMap, + Store insertSteps(Store buildConfigurationMap, const OldStepMaps &oldStepMap, NamePolicy policy); }; @@ -93,7 +93,7 @@ class UserFileVersion17Upgrader : public VersionUpgrader { public: UserFileVersion17Upgrader() : VersionUpgrader(17, "3.3-pre2") { } - QVariantMap upgrade(const QVariantMap &map) final; + Store upgrade(const Store &map) final; QVariant process(const QVariant &entry); @@ -108,7 +108,7 @@ class UserFileVersion18Upgrader : public VersionUpgrader { public: UserFileVersion18Upgrader() : VersionUpgrader(18, "4.8-pre1") { } - QVariantMap upgrade(const QVariantMap &map) final; + Store upgrade(const Store &map) final; static QVariant process(const QVariant &entry); }; @@ -119,7 +119,7 @@ class UserFileVersion19Upgrader : public VersionUpgrader { public: UserFileVersion19Upgrader() : VersionUpgrader(19, "4.8-pre2") { } - QVariantMap upgrade(const QVariantMap &map) final; + Store upgrade(const Store &map) final; static QVariant process(const QVariant &entry, const QStringList &path); }; @@ -131,7 +131,7 @@ class UserFileVersion20Upgrader : public VersionUpgrader { public: UserFileVersion20Upgrader() : VersionUpgrader(20, "4.9-pre1") { } - QVariantMap upgrade(const QVariantMap &map) final; + Store upgrade(const Store &map) final; static QVariant process(const QVariant &entry); }; @@ -143,7 +143,7 @@ class UserFileVersion21Upgrader : public VersionUpgrader { public: UserFileVersion21Upgrader() : VersionUpgrader(21, "4.10-pre1") { } - QVariantMap upgrade(const QVariantMap &map) final; + Store upgrade(const Store &map) final; static QVariant process(const QVariant &entry); }; @@ -401,17 +401,17 @@ FilePath UserFileAccessor::sharedFile() const .stringAppended(generateSuffix(qtcExt.isEmpty() ? ".shared" : qtcExt)); } -QVariantMap UserFileAccessor::postprocessMerge(const QVariantMap &main, - const QVariantMap &secondary, - const QVariantMap &result) const +Store UserFileAccessor::postprocessMerge(const Store &main, + const Store &secondary, + const Store &result) const { project()->setProperty(SHARED_SETTINGS, secondary); return MergingSettingsAccessor::postprocessMerge(main, secondary, result); } -QVariantMap UserFileAccessor::preprocessReadSettings(const QVariantMap &data) const +Store UserFileAccessor::preprocessReadSettings(const Store &data) const { - QVariantMap tmp = MergingSettingsAccessor::preprocessReadSettings(data); + Store tmp = MergingSettingsAccessor::preprocessReadSettings(data); // Move from old Version field to new one: // This cannot be done in a normal upgrader since the version information is needed @@ -426,11 +426,11 @@ QVariantMap UserFileAccessor::preprocessReadSettings(const QVariantMap &data) co return tmp; } -QVariantMap UserFileAccessor::prepareToWriteSettings(const QVariantMap &data) const +Store UserFileAccessor::prepareToWriteSettings(const Store &data) const { - const QVariantMap tmp = MergingSettingsAccessor::prepareToWriteSettings(data); - const QVariantMap shared = retrieveSharedSettings().toMap(); - QVariantMap result; + const Store tmp = MergingSettingsAccessor::prepareToWriteSettings(data); + const Store shared = retrieveSharedSettings().toMap(); + Store result; if (!shared.isEmpty()) { QStringList stickyKeys; SettingsMergeFunction merge = userStickyTrackerFunction(stickyKeys); @@ -449,9 +449,9 @@ QVariantMap UserFileAccessor::prepareToWriteSettings(const QVariantMap &data) co // UserFileVersion14Upgrader: // -------------------------------------------------------------------- -QVariantMap UserFileVersion14Upgrader::upgrade(const QVariantMap &map) +Store UserFileVersion14Upgrader::upgrade(const Store &map) { - QVariantMap result; + Store result; for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) { if (it.value().typeId() == QVariant::Map) result.insert(it.key(), upgrade(it.value().toMap())); @@ -471,30 +471,30 @@ QVariantMap UserFileVersion14Upgrader::upgrade(const QVariantMap &map) // UserFileVersion15Upgrader: // -------------------------------------------------------------------- -QVariantMap UserFileVersion15Upgrader::upgrade(const QVariantMap &map) +Store UserFileVersion15Upgrader::upgrade(const Store &map) { const QList<Change> changes{{QLatin1String("ProjectExplorer.Project.Updater.EnvironmentId"), QLatin1String("EnvironmentId")}, {QLatin1String("ProjectExplorer.Project.UserStickyKeys"), QLatin1String("UserStickyKeys")}}; - return renameKeys(changes, QVariantMap(map)); + return renameKeys(changes, Store(map)); } // -------------------------------------------------------------------- // UserFileVersion16Upgrader: // -------------------------------------------------------------------- -UserFileVersion16Upgrader::OldStepMaps UserFileVersion16Upgrader::extractStepMaps(const QVariantMap &deployMap) +UserFileVersion16Upgrader::OldStepMaps UserFileVersion16Upgrader::extractStepMaps(const Store &deployMap) { OldStepMaps result; result.defaultDisplayName = deployMap.value("ProjectExplorer.ProjectConfiguration.DefaultDisplayName").toString(); result.displayName = deployMap.value("ProjectExplorer.ProjectConfiguration.DisplayName").toString(); const QString stepListKey = "ProjectExplorer.BuildConfiguration.BuildStepList.0"; - QVariantMap stepListMap = deployMap.value(stepListKey).toMap(); + Store stepListMap = deployMap.value(stepListKey).toMap(); int stepCount = stepListMap.value("ProjectExplorer.BuildStepList.StepsCount", 0).toInt(); QString stepKey = "ProjectExplorer.BuildStepList.Step."; for (int i = 0; i < stepCount; ++i) { - QVariantMap stepMap = stepListMap.value(stepKey + QString::number(i)).toMap(); + Store stepMap = stepListMap.value(stepKey + QString::number(i)).toMap(); const QString id = stepMap.value("ProjectExplorer.ProjectConfiguration.Id").toString(); if (id == "Qt4ProjectManager.AndroidDeployQtStep") result.androidDeployQt = stepMap; @@ -507,16 +507,16 @@ UserFileVersion16Upgrader::OldStepMaps UserFileVersion16Upgrader::extractStepMap return result; } -QVariantMap UserFileVersion16Upgrader::removeAndroidPackageStep(QVariantMap deployMap) +Store UserFileVersion16Upgrader::removeAndroidPackageStep(Store deployMap) { const QString stepListKey = "ProjectExplorer.BuildConfiguration.BuildStepList.0"; - QVariantMap stepListMap = deployMap.value(stepListKey).toMap(); + Store stepListMap = deployMap.value(stepListKey).toMap(); const QString stepCountKey = "ProjectExplorer.BuildStepList.StepsCount"; int stepCount = stepListMap.value(stepCountKey, 0).toInt(); QString stepKey = "ProjectExplorer.BuildStepList.Step."; int targetPosition = 0; for (int sourcePosition = 0; sourcePosition < stepCount; ++sourcePosition) { - QVariantMap stepMap = stepListMap.value(stepKey + QString::number(sourcePosition)).toMap(); + Store stepMap = stepListMap.value(stepKey + QString::number(sourcePosition)).toMap(); if (stepMap.value("ProjectExplorer.ProjectConfiguration.Id").toString() != "Qt4ProjectManager.AndroidPackageInstallationStep") { stepListMap.insert(stepKey + QString::number(targetPosition), stepMap); @@ -533,7 +533,7 @@ QVariantMap UserFileVersion16Upgrader::removeAndroidPackageStep(QVariantMap depl return deployMap; } -QVariantMap UserFileVersion16Upgrader::insertSteps(QVariantMap buildConfigurationMap, +Store UserFileVersion16Upgrader::insertSteps(Store buildConfigurationMap, const OldStepMaps &oldStepMap, NamePolicy policy) { @@ -543,7 +543,7 @@ QVariantMap UserFileVersion16Upgrader::insertSteps(QVariantMap buildConfiguratio const QString bslKey = "ProjectExplorer.BuildConfiguration.BuildStepList."; const QString bslTypeKey = "ProjectExplorer.ProjectConfiguration.Id"; for (int bslNumber = 0; bslNumber < stepListCount; ++bslNumber) { - QVariantMap buildStepListMap = buildConfigurationMap.value(bslKey + QString::number(bslNumber)).toMap(); + Store buildStepListMap = buildConfigurationMap.value(bslKey + QString::number(bslNumber)).toMap(); if (buildStepListMap.value(bslTypeKey) != "ProjectExplorer.BuildSteps.Build") continue; @@ -552,8 +552,8 @@ QVariantMap UserFileVersion16Upgrader::insertSteps(QVariantMap buildConfiguratio int stepCount = buildStepListMap.value(bslStepCountKey).toInt(); buildStepListMap.insert(bslStepCountKey, stepCount + 2); - QVariantMap androidPackageInstallStep; - QVariantMap androidBuildApkStep; + Store androidPackageInstallStep; + Store androidBuildApkStep; // common settings of all buildsteps const QString enabledKey = "ProjectExplorer.BuildStep.Enabled"; @@ -628,17 +628,17 @@ QVariantMap UserFileVersion16Upgrader::insertSteps(QVariantMap buildConfiguratio return buildConfigurationMap; } -QVariantMap UserFileVersion16Upgrader::upgrade(const QVariantMap &data) +Store UserFileVersion16Upgrader::upgrade(const Store &data) { int targetCount = data.value("ProjectExplorer.Project.TargetCount", 0).toInt(); if (!targetCount) return data; - QVariantMap result = data; + Store result = data; for (int i = 0; i < targetCount; ++i) { QString targetKey = QLatin1String("ProjectExplorer.Project.Target.") + QString::number(i); - QVariantMap targetMap = data.value(targetKey).toMap(); + Store targetMap = data.value(targetKey).toMap(); const QString dcCountKey = "ProjectExplorer.Target.DeployConfigurationCount"; int deployconfigurationCount = targetMap.value(dcCountKey).toInt(); @@ -646,11 +646,11 @@ QVariantMap UserFileVersion16Upgrader::upgrade(const QVariantMap &data) continue; QList<OldStepMaps> oldSteps; - QList<QVariantMap> oldBuildConfigurations; + QList<Store> oldBuildConfigurations; QString deployKey = "ProjectExplorer.Target.DeployConfiguration."; for (int j = 0; j < deployconfigurationCount; ++j) { - QVariantMap deployConfigurationMap + Store deployConfigurationMap = targetMap.value(deployKey + QString::number(j)).toMap(); OldStepMaps oldStep = extractStepMaps(deployConfigurationMap); if (!oldStep.isEmpty()) { @@ -672,17 +672,17 @@ QVariantMap UserFileVersion16Upgrader::upgrade(const QVariantMap &data) QString bcKey = "ProjectExplorer.Target.BuildConfiguration."; for (int j = 0; j < buildConfigurationCount; ++j) { - QVariantMap oldBuildConfigurationMap = targetMap.value(bcKey + QString::number(j)).toMap(); + Store oldBuildConfigurationMap = targetMap.value(bcKey + QString::number(j)).toMap(); oldBuildConfigurations.append(oldBuildConfigurationMap); } - QList<QVariantMap> newBuildConfigurations; + QList<Store> newBuildConfigurations; NamePolicy policy = oldSteps.size() > 1 ? RenameBuildConfiguration : KeepName; - for (const QVariantMap &oldBuildConfiguration : std::as_const(oldBuildConfigurations)) { + for (const Store &oldBuildConfiguration : std::as_const(oldBuildConfigurations)) { for (const OldStepMaps &oldStep : std::as_const(oldSteps)) { - QVariantMap newBuildConfiguration = insertSteps(oldBuildConfiguration, oldStep, policy); + Store newBuildConfiguration = insertSteps(oldBuildConfiguration, oldStep, policy); if (!newBuildConfiguration.isEmpty()) newBuildConfigurations.append(newBuildConfiguration); } @@ -698,7 +698,7 @@ QVariantMap UserFileVersion16Upgrader::upgrade(const QVariantMap &data) return result; } -QVariantMap UserFileVersion17Upgrader::upgrade(const QVariantMap &map) +Store UserFileVersion17Upgrader::upgrade(const Store &map) { m_sticky = map.value(USER_STICKY_KEYS_KEY).toList(); if (m_sticky.isEmpty()) @@ -716,8 +716,8 @@ QVariant UserFileVersion17Upgrader::process(const QVariant &entry) return result; } case QVariant::Map: { - QVariantMap result = entry.toMap(); - for (QVariantMap::iterator i = result.begin(), end = result.end(); i != end; ++i) { + Store result = entry.toMap(); + for (Store::iterator i = result.begin(), end = result.end(); i != end; ++i) { QVariant &v = i.value(); v = process(v); } @@ -729,7 +729,7 @@ QVariant UserFileVersion17Upgrader::process(const QVariant &entry) } } -QVariantMap UserFileVersion18Upgrader::upgrade(const QVariantMap &map) +Store UserFileVersion18Upgrader::upgrade(const Store &map) { return process(map).toMap(); } @@ -753,7 +753,7 @@ QVariant UserFileVersion18Upgrader::process(const QVariant &entry) } } -QVariantMap UserFileVersion19Upgrader::upgrade(const QVariantMap &map) +Store UserFileVersion19Upgrader::upgrade(const Store &map) { return process(map, QStringList()).toMap(); } @@ -795,7 +795,7 @@ QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const QString return Utils::transform(entry.toList(), std::bind(&UserFileVersion19Upgrader::process, std::placeholders::_1, path)); case QVariant::Map: - return Utils::transform<QVariantMap>(entry.toMap().toStdMap(), + return Utils::transform<Store>(entry.toMap().toStdMap(), [&](const StringVariantPair &item) -> StringVariantPair { if (path.size() == 2 && path.at(1).startsWith("ProjectExplorer.Target.RunConfiguration.")) { if (argsKeys.contains(item.first)) @@ -818,7 +818,7 @@ QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const QString } } -QVariantMap UserFileVersion20Upgrader::upgrade(const QVariantMap &map) +Store UserFileVersion20Upgrader::upgrade(const Store &map) { return process(map).toMap(); } @@ -844,7 +844,7 @@ QVariant UserFileVersion20Upgrader::process(const QVariant &entry) } } -QVariantMap UserFileVersion21Upgrader::upgrade(const QVariantMap &map) +Store UserFileVersion21Upgrader::upgrade(const Store &map) { return process(map).toMap(); } @@ -855,13 +855,13 @@ QVariant UserFileVersion21Upgrader::process(const QVariant &entry) case QVariant::List: return Utils::transform(entry.toList(), &UserFileVersion21Upgrader::process); case QVariant::Map: { - QVariantMap entryMap = entry.toMap(); + Store entryMap = entry.toMap(); if (entryMap.value("ProjectExplorer.ProjectConfiguration.Id").toString() == "DeployToGenericLinux") { entryMap.insert("_checkMakeInstall", true); return entryMap; } - return Utils::transform<QVariantMap>( + return Utils::transform<Store>( entryMap.toStdMap(), [](const StringVariantPair &item) -> StringVariantPair{ return {item.first, UserFileVersion21Upgrader::process(item.second)}; }); @@ -884,7 +884,7 @@ class TestUserFileAccessor : public UserFileAccessor public: TestUserFileAccessor(Project *project) : UserFileAccessor(project) { } - void storeSharedSettings(const QVariantMap &data) const { m_storedSettings = data; } + void storeSharedSettings(const Store &data) const { m_storedSettings = data; } QVariant retrieveSharedSettings() const override { return m_storedSettings; } using UserFileAccessor::preprocessReadSettings; @@ -893,7 +893,7 @@ public: using UserFileAccessor::mergeSettings; private: - mutable QVariantMap m_storedSettings; + mutable Store m_storedSettings; }; @@ -912,11 +912,11 @@ void ProjectExplorerPlugin::testUserFileAccessor_prepareToReadSettings() TestProject project; TestUserFileAccessor accessor(&project); - QVariantMap data; + Store data; data.insert("Version", 4); data.insert("Foo", "bar"); - QVariantMap result = accessor.preprocessReadSettings(data); + Store result = accessor.preprocessReadSettings(data); QCOMPARE(result, data); } @@ -926,11 +926,11 @@ void ProjectExplorerPlugin::testUserFileAccessor_prepareToReadSettingsObsoleteVe TestProject project; TestUserFileAccessor accessor(&project); - QVariantMap data; + Store data; data.insert("ProjectExplorer.Project.Updater.FileVersion", 4); data.insert("Foo", "bar"); - QVariantMap result = accessor.preprocessReadSettings(data); + Store result = accessor.preprocessReadSettings(data); QCOMPARE(result.count(), data.count()); QCOMPARE(result.value("Foo"), data.value("Foo")); @@ -942,12 +942,12 @@ void ProjectExplorerPlugin::testUserFileAccessor_prepareToReadSettingsObsoleteVe TestProject project; TestUserFileAccessor accessor(&project); - QVariantMap data; + Store data; data.insert("ProjectExplorer.Project.Updater.FileVersion", 4); data.insert("Version", 5); data.insert("Foo", "bar"); - QVariantMap result = accessor.preprocessReadSettings(data); + Store result = accessor.preprocessReadSettings(data); QCOMPARE(result.count(), data.count() - 1); QCOMPARE(result.value("Foo"), data.value("Foo")); @@ -959,7 +959,7 @@ void ProjectExplorerPlugin::testUserFileAccessor_prepareToWriteSettings() TestProject project; TestUserFileAccessor accessor(&project); - QVariantMap sharedData; + Store sharedData; sharedData.insert("Version", 10); sharedData.insert("shared1", "bar"); sharedData.insert("shared2", "baz"); @@ -967,12 +967,12 @@ void ProjectExplorerPlugin::testUserFileAccessor_prepareToWriteSettings() accessor.storeSharedSettings(sharedData); - QVariantMap data; + Store data; data.insert("Version", 10); data.insert("shared1", "bar1"); data.insert("unique1", 1234); data.insert("shared3", "foo"); - QVariantMap result = accessor.prepareToWriteSettings(data); + Store result = accessor.prepareToWriteSettings(data); QCOMPARE(result.count(), data.count() + 3); QCOMPARE(result.value("EnvironmentId").toByteArray(), @@ -990,14 +990,14 @@ void ProjectExplorerPlugin::testUserFileAccessor_mergeSettings() TestProject project; TestUserFileAccessor accessor(&project); - QVariantMap sharedData; + Store sharedData; sharedData.insert("Version", accessor.currentVersion()); sharedData.insert("shared1", "bar"); sharedData.insert("shared2", "baz"); sharedData.insert("shared3", "foooo"); TestUserFileAccessor::RestoreData shared("/shared/data", sharedData); - QVariantMap data; + Store data; data.insert("Version", accessor.currentVersion()); data.insert("EnvironmentId", projectExplorerSettings().environmentId.toByteArray()); data.insert("UserStickyKeys", QStringList({"shared1"})); @@ -1025,14 +1025,14 @@ void ProjectExplorerPlugin::testUserFileAccessor_mergeSettingsEmptyUser() TestProject project; TestUserFileAccessor accessor(&project); - QVariantMap sharedData; + Store sharedData; sharedData.insert("Version", accessor.currentVersion()); sharedData.insert("shared1", "bar"); sharedData.insert("shared2", "baz"); sharedData.insert("shared3", "foooo"); TestUserFileAccessor::RestoreData shared("/shared/data", sharedData); - QVariantMap data; + Store data; TestUserFileAccessor::RestoreData user("/shared/data", data); TestUserFileAccessor::RestoreData result = accessor.mergeSettings(user, shared); @@ -1046,10 +1046,10 @@ void ProjectExplorerPlugin::testUserFileAccessor_mergeSettingsEmptyShared() TestProject project; TestUserFileAccessor accessor(&project); - QVariantMap sharedData; + Store sharedData; TestUserFileAccessor::RestoreData shared("/shared/data", sharedData); - QVariantMap data; + Store data; data.insert("Version", accessor.currentVersion()); data.insert("OriginalVersion", accessor.currentVersion()); data.insert("EnvironmentId", projectExplorerSettings().environmentId.toByteArray()); diff --git a/src/plugins/projectexplorer/userfileaccessor.h b/src/plugins/projectexplorer/userfileaccessor.h index 287dbcc6699..b4ed20b498c 100644 --- a/src/plugins/projectexplorer/userfileaccessor.h +++ b/src/plugins/projectexplorer/userfileaccessor.h @@ -3,11 +3,9 @@ #pragma once -#include <utils/fileutils.h> #include <utils/settingsaccessor.h> #include <QHash> -#include <QVariantMap> #include <QMessageBox> namespace ProjectExplorer { @@ -30,12 +28,12 @@ public: Utils::FilePath sharedFile() const; protected: - QVariantMap postprocessMerge(const QVariantMap &main, - const QVariantMap &secondary, - const QVariantMap &result) const final; + Utils::Store postprocessMerge(const Utils::Store &main, + const Utils::Store &secondary, + const Utils::Store &result) const final; - QVariantMap preprocessReadSettings(const QVariantMap &data) const final; - QVariantMap prepareToWriteSettings(const QVariantMap &data) const final; + Utils::Store preprocessReadSettings(const Utils::Store &data) const final; + Utils::Store prepareToWriteSettings(const Utils::Store &data) const final; Utils::SettingsMergeResult merge(const SettingsMergeData &global, const SettingsMergeData &local) const final; From 301112adeb839f219784107e28d3a7f985aa68c2 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 24 Aug 2023 14:36:01 +0200 Subject: [PATCH 0856/1777] Fix compilation Change-Id: I1cdf177a3f183a330c405abae7232d7a08cc0742 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/utils/storekey.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/utils/storekey.h b/src/libs/utils/storekey.h index 3b48d6c9c8b..7a187082426 100644 --- a/src/libs/utils/storekey.h +++ b/src/libs/utils/storekey.h @@ -17,12 +17,14 @@ namespace Utils { using Key = QByteArray; inline Key keyFromString(const QString &str) { return str.toUtf8(); } +inline QString stringFromKey(const Key &key) { return QString::fromUtf8(key); } #else using Key = QString; inline Key keyFromString(const QString &str) { return str; } +inline QString stringFromKey(const Key &key) { return key; } #endif From 7fd8df9300927cd0906c09679f782a54f6d5284c Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 10 Aug 2023 17:25:09 +0200 Subject: [PATCH 0857/1777] Python: Allow installing requirement files Change-Id: If4ac1470fdba4b9f1070fc37d35d5d738a18865f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/python/pipsupport.cpp | 30 +++++++++++++++++++++++------- src/plugins/python/pipsupport.h | 3 +++ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/plugins/python/pipsupport.cpp b/src/plugins/python/pipsupport.cpp index d6070663fb6..6aa4e466ae5 100644 --- a/src/plugins/python/pipsupport.cpp +++ b/src/plugins/python/pipsupport.cpp @@ -35,6 +35,16 @@ PipInstallTask::PipInstallTask(const FilePath &python) m_watcher.setFuture(m_future.future()); } +void PipInstallTask::setRequirements(const Utils::FilePath &requirementFile) +{ + m_requirementsFile = requirementFile; +} + +void PipInstallTask::setWorkingDirectory(const Utils::FilePath &workingDirectory) +{ + m_process.setWorkingDirectory(workingDirectory); +} + void PipInstallTask::addPackage(const PipPackage &package) { m_packages << package; @@ -47,18 +57,22 @@ void PipInstallTask::setPackages(const QList<PipPackage> &packages) void PipInstallTask::run() { - if (m_packages.isEmpty()) { + if (m_packages.isEmpty() && m_requirementsFile.isEmpty()) { emit finished(false); return; } const QString taskTitle = Tr::tr("Install Python Packages"); Core::ProgressManager::addTask(m_future.future(), taskTitle, pipInstallTaskId); QStringList arguments = {"-m", "pip", "install"}; - for (const PipPackage &package : m_packages) { - QString pipPackage = package.packageName; - if (!package.version.isEmpty()) - pipPackage += "==" + package.version; - arguments << pipPackage; + if (!m_requirementsFile.isEmpty()) + arguments << "-r" << m_requirementsFile.toString(); + else { + for (const PipPackage &package : m_packages) { + QString pipPackage = package.packageName; + if (!package.version.isEmpty()) + pipPackage += "==" + package.version; + arguments << pipPackage; + } } // add --user to global pythons, but skip it for venv pythons @@ -115,7 +129,9 @@ void PipInstallTask::handleError() QString PipInstallTask::packagesDisplayName() const { - return Utils::transform(m_packages, &PipPackage::displayName).join(", "); + return m_requirementsFile.isEmpty() + ? Utils::transform(m_packages, &PipPackage::displayName).join(", ") + : m_requirementsFile.toUserOutput(); } void PipPackageInfo::parseField(const QString &field, const QStringList &data) diff --git a/src/plugins/python/pipsupport.h b/src/plugins/python/pipsupport.h index 4d08a3b1ea6..586a2f55e70 100644 --- a/src/plugins/python/pipsupport.h +++ b/src/plugins/python/pipsupport.h @@ -63,6 +63,8 @@ class PipInstallTask : public QObject Q_OBJECT public: explicit PipInstallTask(const Utils::FilePath &python); + void setRequirements(const Utils::FilePath &requirementFile); + void setWorkingDirectory(const Utils::FilePath &workingDirectory); void addPackage(const PipPackage &package); void setPackages(const QList<PipPackage> &packages); void run(); @@ -80,6 +82,7 @@ private: const Utils::FilePath m_python; QList<PipPackage> m_packages; + Utils::FilePath m_requirementsFile; Utils::Process m_process; QFutureInterface<void> m_future; QFutureWatcher<void> m_watcher; From 512da70456724eefac92ef02b8a4807ebb57c178 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 23 Aug 2023 10:50:22 +0200 Subject: [PATCH 0858/1777] LanguageClient: fill workspace configuration response There is already a way to programmatically set the configuration for a client, take this into account when generating the response for a workspace configuration response. Change-Id: Id59b643eefc59732c856c356317764e6c54af69a Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/languageclient/client.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 1d18b0b189d..ff646316e02 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1947,9 +1947,14 @@ void ClientPrivate::handleMethod(const QString &method, const MessageId &id, con if (QTC_GUARD(id.isValid())) response.setId(id); ConfigurationRequest configurationRequest(message.toJsonObject()); - if (auto params = configurationRequest.params()) { - for (int i = 0, end = params->items().count(); i < end; ++i) - result.append({}); + if (std::optional<ConfigurationParams> params = configurationRequest.params()) { + const QList<ConfigurationParams::ConfigurationItem> items = params->items(); + for (const ConfigurationParams::ConfigurationItem &item : items) { + if (const std::optional<QString> section = item.section()) + result.append(m_configuration[*section]); + else + result.append({}); + } } response.setResult(result); sendResponse(response); From 4943f387c728e40c050eb67b8604858dc89283fa Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 21 Aug 2023 11:42:56 +0200 Subject: [PATCH 0859/1777] Core: Merge editor factory classes Mainly to simplify the implementation and naming. Kind of follow-up to 862c9694. There is some consolidation needed as followup as well as some potential renamings. I'd leave that for separate patches to keep this here somewhat self-contained. Change-Id: I152e138a1d5baadec3f7542fed0894b8d4ffc8a3 Reviewed-by: David Schulz <david.schulz@qt.io> --- .../dialogs/filepropertiesdialog.cpp | 2 +- .../editormanager/editormanager.cpp | 76 ++--- .../editormanager/editormanager_p.h | 2 +- .../editormanager/ieditorfactory.cpp | 302 ++++++++---------- .../coreplugin/editormanager/ieditorfactory.h | 65 ++-- .../editormanager/ieditorfactory_p.h | 6 +- .../coreplugin/editormanager/systemeditor.cpp | 26 +- .../coreplugin/editormanager/systemeditor.h | 6 +- src/plugins/coreplugin/mimetypesettings.cpp | 28 +- src/plugins/qtsupport/externaleditors.cpp | 109 +++---- src/plugins/qtsupport/externaleditors.h | 8 +- 11 files changed, 278 insertions(+), 352 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/filepropertiesdialog.cpp b/src/plugins/coreplugin/dialogs/filepropertiesdialog.cpp index c37125d447a..de3362a408f 100644 --- a/src/plugins/coreplugin/dialogs/filepropertiesdialog.cpp +++ b/src/plugins/coreplugin/dialogs/filepropertiesdialog.cpp @@ -192,7 +192,7 @@ void FilePropertiesDialog::refresh() const Utils::MimeType mimeType = Utils::mimeTypeForFile(m_filePath); m_mimeType->setText(mimeType.name()); - const EditorTypeList factories = IEditorFactory::preferredEditorTypes(m_filePath); + const EditorFactories factories = IEditorFactory::preferredEditorTypes(m_filePath); m_defaultEditor->setText(!factories.isEmpty() ? factories.at(0)->displayName() : Tr::tr("Undefined")); diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 44e5f18ef35..245fc89ff6f 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -797,12 +797,10 @@ IEditor *EditorManagerPrivate::openEditor(EditorView *view, const FilePath &file realFp = filePath; } - EditorTypeList factories = EditorType::preferredEditorTypes(filePath); - if (!(flags & EditorManager::AllowExternalEditor)) { - factories = Utils::filtered(factories, [](EditorType *type) { - return type->asEditorFactory() != nullptr; - }); - } + EditorFactories factories = IEditorFactory::preferredEditorTypes(filePath); + if (!(flags & EditorManager::AllowExternalEditor)) + factories = Utils::filtered(factories, &IEditorFactory::isInternalEditor); + if (factories.isEmpty()) { Utils::MimeType mimeType = Utils::mimeTypeForFile(filePath); QMessageBox msgbox(QMessageBox::Critical, ::Core::Tr::tr("File Error"), @@ -813,9 +811,9 @@ IEditor *EditorManagerPrivate::openEditor(EditorView *view, const FilePath &file return nullptr; } if (editorId.isValid()) { - EditorType *factory = EditorType::editorTypeForId(editorId); + IEditorFactory *factory = IEditorFactory::editorFactoryForId(editorId); if (factory) { - QTC_CHECK(factory->asEditorFactory() || (flags & EditorManager::AllowExternalEditor)); + QTC_CHECK(factory->isInternalEditor() || (flags & EditorManager::AllowExternalEditor)); factories.removeOne(factory); factories.push_front(factory); } @@ -824,12 +822,12 @@ IEditor *EditorManagerPrivate::openEditor(EditorView *view, const FilePath &file IEditor *editor = nullptr; auto overrideCursor = Utils::OverrideCursor(QCursor(Qt::WaitCursor)); - EditorType *factory = factories.takeFirst(); + IEditorFactory *factory = factories.takeFirst(); while (factory) { QString errorString; - if (factory->asEditorFactory()) { - editor = createEditor(factory->asEditorFactory(), filePath); + if (factory->isInternalEditor()) { + editor = createEditor(factory, filePath); if (!editor) { factory = factories.isEmpty() ? nullptr : factories.takeFirst(); continue; @@ -857,10 +855,10 @@ IEditor *EditorManagerPrivate::openEditor(EditorView *view, const FilePath &file // can happen e.g. when trying to open an completely empty .qrc file QTC_CHECK(openResult == IDocument::OpenResult::CannotHandle); } else { - QTC_ASSERT(factory->asExternalEditor(), + QTC_ASSERT(factory->isExternalEditor(), factory = factories.isEmpty() ? nullptr : factories.takeFirst(); continue); - if (factory->asExternalEditor()->startEditor(filePath, &errorString)) + if (factory->startEditor(filePath, &errorString)) break; } @@ -873,12 +871,12 @@ IEditor *EditorManagerPrivate::openEditor(EditorView *view, const FilePath &file QMessageBox::Open | QMessageBox::Cancel, ICore::dialogParent()); - EditorType *selectedFactory = nullptr; + IEditorFactory *selectedFactory = nullptr; if (!factories.isEmpty()) { auto button = qobject_cast<QPushButton *>(msgbox.button(QMessageBox::Open)); QTC_ASSERT(button, return nullptr); auto menu = new QMenu(button); - for (EditorType *factory : std::as_const(factories)) { + for (IEditorFactory *factory : std::as_const(factories)) { QAction *action = menu->addAction(factory->displayName()); connect(action, &QAction::triggered, &msgbox, [&selectedFactory, factory, &msgbox] { selectedFactory = factory; @@ -1148,7 +1146,7 @@ Id EditorManagerPrivate::getOpenWithEditorId(const Utils::FilePath &fileName, bo QList<Id> allEditorIds; QStringList allEditorDisplayNames; // Built-in - const EditorTypeList editors = EditorType::preferredEditorTypes(fileName); + const EditorFactories editors = IEditorFactory::preferredEditorTypes(fileName); const int size = editors.size(); allEditorDisplayNames.reserve(size); for (int i = 0; i < size; i++) { @@ -1166,13 +1164,13 @@ Id EditorManagerPrivate::getOpenWithEditorId(const Utils::FilePath &fileName, bo return Id(); const Id selectedId = allEditorIds.at(dialog.editor()); if (isExternalEditor) { - EditorType *type = EditorType::editorTypeForId(selectedId); - *isExternalEditor = type && type->asExternalEditor() != nullptr; + IEditorFactory *type = IEditorFactory::editorFactoryForId(selectedId); + *isExternalEditor = type && type->isExternalEditor(); } return selectedId; } -static QMap<QString, QVariant> toMap(const QHash<Utils::MimeType, EditorType *> &hash) +static QMap<QString, QVariant> toMap(const QHash<Utils::MimeType, IEditorFactory *> &hash) { QMap<QString, QVariant> map; auto it = hash.begin(); @@ -1184,18 +1182,18 @@ static QMap<QString, QVariant> toMap(const QHash<Utils::MimeType, EditorType *> return map; } -static QHash<Utils::MimeType, EditorType *> fromMap(const QMap<QString, QVariant> &map) +static QHash<Utils::MimeType, IEditorFactory *> fromMap(const QMap<QString, QVariant> &map) { - const EditorTypeList factories = EditorType::allEditorTypes(); - QHash<Utils::MimeType, EditorType *> hash; + const EditorFactories factories = IEditorFactory::allEditorFactories(); + QHash<Utils::MimeType, IEditorFactory *> hash; auto it = map.begin(); const auto end = map.end(); while (it != end) { const Utils::MimeType mimeType = Utils::mimeTypeForName(it.key()); if (mimeType.isValid()) { const Id factoryId = Id::fromSetting(it.value()); - EditorType *factory = Utils::findOrDefault(factories, - Utils::equal(&EditorType::id, factoryId)); + IEditorFactory *factory = Utils::findOrDefault(factories, + Utils::equal(&IEditorFactory::id, factoryId)); if (factory) hash.insert(mimeType, factory); } @@ -1225,7 +1223,7 @@ void EditorManagerPrivate::readSettings() else HostOsInfo::setOverrideFileNameCaseSensitivity(sensitivity); - const QHash<Utils::MimeType, EditorType *> preferredEditorFactories = fromMap( + const QHash<Utils::MimeType, IEditorFactory *> preferredEditorFactories = fromMap( qs->value(preferredEditorFactoriesKey).toMap()); setUserPreferredEditorTypes(preferredEditorFactories); @@ -1266,12 +1264,12 @@ void EditorManagerPrivate::writeFileSystemSensitivity(Utils::QtcSettings *settin HostOsInfo::hostOs()))); } -EditorFactoryList EditorManagerPrivate::findFactories(Id editorId, const FilePath &filePath) +EditorFactories EditorManagerPrivate::findFactories(Id editorId, const FilePath &filePath) { if (debugEditorManager) qDebug() << Q_FUNC_INFO << editorId.name() << filePath; - EditorFactoryList factories; + EditorFactories factories; if (!editorId.isValid()) { factories = IEditorFactory::preferredEditorFactories(filePath); } else { @@ -2810,11 +2808,11 @@ void EditorManager::populateOpenWithMenu(QMenu *menu, const FilePath &filePath) { menu->clear(); - const EditorTypeList factories = IEditorFactory::preferredEditorTypes(filePath); + const EditorFactories factories = IEditorFactory::preferredEditorTypes(filePath); const bool anyMatches = !factories.empty(); if (anyMatches) { // Add all suitable editors - for (EditorType *editorType : factories) { + for (IEditorFactory *editorType : factories) { const Id editorId = editorType->id(); // Add action to open with this very editor factory QString const actionTitle = editorType->displayName(); @@ -2824,8 +2822,8 @@ void EditorManager::populateOpenWithMenu(QMenu *menu, const FilePath &filePath) // crashes happen, because the editor instance is deleted by openEditorWith // while the menu is still being processed. connect(action, &QAction::triggered, d, [filePath, editorId] { - EditorType *type = EditorType::editorTypeForId(editorId); - if (type && type->asExternalEditor()) + IEditorFactory *type = IEditorFactory::editorFactoryForId(editorId); + if (type && type->isExternalEditor()) EditorManager::openExternalEditor(filePath, editorId); else EditorManagerPrivate::openEditorWith(filePath, editorId); @@ -2839,11 +2837,10 @@ void EditorManager::runWithTemporaryEditor(const Utils::FilePath &filePath, const std::function<void (IEditor *)> &callback) { const MimeType mt = mimeTypeForFile(filePath, MimeMatchMode::MatchDefaultAndRemote); - const QList<IEditorFactory *> factories = Utils::transform( - EditorType::defaultEditorTypes(mt), [](EditorType *t) { - return t->asEditorFactory(); }); + const QList<IEditorFactory *> factories = IEditorFactory::defaultEditorFactories(mt); for (IEditorFactory * const factory : factories) { - if (!factory) + QTC_ASSERT(factory, continue); + if (!factory->isInternalEditor()) continue; std::unique_ptr<IEditor> editor(factory->createEditor()); if (!editor) @@ -3103,8 +3100,11 @@ bool EditorManager::autoSaveAfterRefactoring() */ bool EditorManager::openExternalEditor(const FilePath &filePath, Id editorId) { - IExternalEditor *ee = Utils::findOrDefault(IExternalEditor::allExternalEditors(), - Utils::equal(&IExternalEditor::id, editorId)); + IEditorFactory *ee = Utils::findOrDefault(IEditorFactory::allEditorFactories(), + [editorId](IEditorFactory *factory) { + return factory->isExternalEditor() && factory->id() == editorId; + }); + if (!ee) return false; QString errorMessage; @@ -3228,7 +3228,7 @@ IEditor *EditorManager::openEditorWithContents(Id editorId, } const FilePath filePath = FilePath::fromString(title); - EditorFactoryList factories = EditorManagerPrivate::findFactories(editorId, filePath); + EditorFactories factories = EditorManagerPrivate::findFactories(editorId, filePath); if (factories.isEmpty()) return nullptr; diff --git a/src/plugins/coreplugin/editormanager/editormanager_p.h b/src/plugins/coreplugin/editormanager/editormanager_p.h index 3cae95ba96e..1d8aba0b92e 100644 --- a/src/plugins/coreplugin/editormanager/editormanager_p.h +++ b/src/plugins/coreplugin/editormanager/editormanager_p.h @@ -167,7 +167,7 @@ private: static OpenEditorsWindow *windowPopup(); static void showPopupOrSelectDocument(); - static EditorFactoryList findFactories(Utils::Id editorId, const Utils::FilePath &filePath); + static EditorFactories findFactories(Utils::Id editorId, const Utils::FilePath &filePath); static IEditor *createEditor(IEditorFactory *factory, const Utils::FilePath &filePath); static void addEditor(IEditor *editor); static void removeEditor(IEditor *editor, bool removeSusependedEntry); diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp index 1b467837632..a87b427e62d 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp +++ b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp @@ -51,29 +51,26 @@ static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType, IEditorFactory is then asked to create an editor. Implementations should set the properties of the IEditorFactory subclass in - their constructor with EditorType::setId(), EditorType::setDisplayName(), - EditorType::setMimeTypes(), and setEditorCreator() + their constructor with IEditorFactory::setId(), IEditorFactory::setDisplayName(), + IEditorFactory::setMimeTypes(), and setEditorCreator() IEditorFactory instances automatically register themselves in \QC in their constructor. - \sa Core::EditorType + 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 + 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 + \sa Core::IEditor \sa Core::IDocument \sa Core::EditorManager */ /*! - \class Core::EditorType - \inheaderfile coreplugin/editormanager/ieditorfactory.h - \inmodule QtCreator - - \brief The EditorType class is the base class for Core::IEditorFactory and - Core::IExternalEditor. -*/ - -/*! - \fn void Core::EditorType::addMimeType(const QString &mimeType) + \fn void Core::IEditorFactory::addMimeType(const QString &mimeType) Adds \a mimeType to the list of MIME types supported by this editor type. @@ -82,7 +79,7 @@ static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType, */ /*! - \fn QString Core::EditorType::displayName() const + \fn QString Core::IEditorFactory::displayName() const Returns a user-visible description of the editor type. @@ -90,7 +87,7 @@ static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType, */ /*! - \fn Utils::Id Core::EditorType::id() const + \fn Utils::Id Core::IEditorFactory::id() const Returns the ID of the editors' document type. @@ -98,7 +95,7 @@ static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType, */ /*! - \fn QString Core::EditorType::mimeTypes() const + \fn QString Core::IEditorFactory::mimeTypes() const Returns the list of supported MIME types of this editor type. @@ -107,7 +104,7 @@ static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType, */ /*! - \fn void Core::EditorType::setDisplayName(const QString &displayName) + \fn void Core::IEditorFactory::setDisplayName(const QString &displayName) Sets the \a displayName of the editor type. This is for example shown in the \uicontrol {Open With} menu and the MIME type preferences. @@ -116,7 +113,7 @@ static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType, */ /*! - \fn void Core::EditorType::setId(Utils::Id id) + \fn void Core::IEditorFactory::setId(Utils::Id id) Sets the \a id of the editors' document type. This must be the same as the IDocument::id() of the documents returned by created editors. @@ -125,7 +122,7 @@ static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType, */ /*! - \fn void Core::EditorType::setMimeTypes(const QStringList &mimeTypes) + \fn void Core::IEditorFactory::setMimeTypes(const QStringList &mimeTypes) Sets the MIME types supported by the editor type to \a mimeTypes. @@ -133,88 +130,8 @@ static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType, \sa mimeTypes() */ -static QList<EditorType *> g_editorTypes; -static QHash<Utils::MimeType, EditorType *> g_userPreferredEditorTypes; static QList<IEditorFactory *> g_editorFactories; - -/*! - \internal -*/ -EditorType::EditorType() -{ - g_editorTypes.append(this); -} - -/*! - \internal -*/ -EditorType::~EditorType() -{ - g_editorTypes.removeOne(this); -} - -/*! - Returns all registered internal and external editors. -*/ -const EditorTypeList EditorType::allEditorTypes() -{ - return g_editorTypes; -} - -EditorType *EditorType::editorTypeForId(const Utils::Id &id) -{ - return Utils::findOrDefault(allEditorTypes(), Utils::equal(&EditorType::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 - first. -*/ -const EditorTypeList EditorType::defaultEditorTypes(const MimeType &mimeType) -{ - EditorTypeList result; - const EditorTypeList allTypes = EditorType::allEditorTypes(); - const EditorTypeList allEditorFactories = Utils::filtered(allTypes, [](EditorType *e) { - return e->asEditorFactory() != nullptr; - }); - const EditorTypeList allExternalEditors = Utils::filtered(allTypes, [](EditorType *e) { - return e->asExternalEditor() != nullptr; - }); - mimeTypeFactoryLookup(mimeType, allEditorFactories, &result); - mimeTypeFactoryLookup(mimeType, allExternalEditors, &result); - return result; -} - -const EditorTypeList EditorType::preferredEditorTypes(const FilePath &filePath) -{ - // default factories by mime type - const Utils::MimeType mimeType = Utils::mimeTypeForFile(filePath, - MimeMatchMode::MatchDefaultAndRemote); - EditorTypeList factories = defaultEditorTypes(mimeType); - // user preferred factory to front - EditorType *userPreferred = Internal::userPreferredEditorTypes().value(mimeType); - if (userPreferred) { - factories.removeAll(userPreferred); - factories.prepend(userPreferred); - } - // make binary editor first internal editor for text files > 48 MB - if (filePath.fileSize() > EditorManager::maxTextFileSize() && mimeType.inherits("text/plain")) { - const Utils::MimeType binary = Utils::mimeTypeForName("application/octet-stream"); - const EditorTypeList binaryEditors = defaultEditorTypes(binary); - if (!binaryEditors.isEmpty()) { - EditorType *binaryEditor = binaryEditors.first(); - factories.removeAll(binaryEditor); - int insertionIndex = 0; - while (factories.size() > insertionIndex - && factories.at(insertionIndex)->asExternalEditor() != nullptr) { - ++insertionIndex; - } - factories.insert(insertionIndex, binaryEditor); - } - } - return factories; -} +static QHash<Utils::MimeType, IEditorFactory *> g_userPreferredEditorTypes; /*! Creates an IEditorFactory. @@ -235,54 +152,124 @@ IEditorFactory::~IEditorFactory() } /*! - \internal + Returns all registered internal and external editors. */ -const EditorFactoryList IEditorFactory::allEditorFactories() +const EditorFactories IEditorFactory::allEditorFactories() { return g_editorFactories; } +IEditorFactory *IEditorFactory::editorFactoryForId(const Utils::Id &id) +{ + return Utils::findOrDefault(allEditorFactories(), Utils::equal(&IEditorFactory::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 + first. +*/ +const EditorFactories IEditorFactory::defaultEditorFactories(const MimeType &mimeType) +{ + EditorFactories result; + const EditorFactories allTypes = IEditorFactory::allEditorFactories(); + const EditorFactories allEditorFactories + = Utils::filtered(allTypes, &IEditorFactory::isInternalEditor); + const EditorFactories allExternalEditors + = Utils::filtered(allTypes, &IEditorFactory::isExternalEditor); + mimeTypeFactoryLookup(mimeType, allEditorFactories, &result); + mimeTypeFactoryLookup(mimeType, allExternalEditors, &result); + return result; +} + +// FIXME: Consolidate with preferredEditorFactories() +const EditorFactories IEditorFactory::preferredEditorTypes(const FilePath &filePath) +{ + // default factories by mime type + const Utils::MimeType mimeType = Utils::mimeTypeForFile(filePath, + MimeMatchMode::MatchDefaultAndRemote); + EditorFactories factories = defaultEditorFactories(mimeType); + // user preferred factory to front + IEditorFactory *userPreferred = Internal::userPreferredEditorTypes().value(mimeType); + if (userPreferred) { + factories.removeAll(userPreferred); + factories.prepend(userPreferred); + } + // make binary editor first internal editor for text files > 48 MB + if (filePath.fileSize() > EditorManager::maxTextFileSize() && mimeType.inherits("text/plain")) { + const Utils::MimeType binary = Utils::mimeTypeForName("application/octet-stream"); + const EditorFactories binaryEditors = defaultEditorFactories(binary); + if (!binaryEditors.isEmpty()) { + IEditorFactory *binaryEditor = binaryEditors.first(); + factories.removeAll(binaryEditor); + int insertionIndex = 0; + while (factories.size() > insertionIndex + && !factories.at(insertionIndex)->isInternalEditor()) { + ++insertionIndex; + } + factories.insert(insertionIndex, binaryEditor); + } + } + return factories; +} + /*! Returns the available editor factories for \a filePath in order of preference. That is the default order for the document's MIME type but with a user overridden default editor first, and the binary editor as the very first item if a text document is too large to be opened as a text file. */ -const EditorFactoryList IEditorFactory::preferredEditorFactories(const FilePath &filePath) +const EditorFactories IEditorFactory::preferredEditorFactories(const FilePath &filePath) { const auto defaultEditorFactories = [](const MimeType &mimeType) { QList<IEditorFactory *> editorFactories; - for (EditorType *type : defaultEditorTypes(mimeType)) { - if (IEditorFactory *editorFactory = type->asEditorFactory()) - editorFactories.append(editorFactory); + for (IEditorFactory *type : IEditorFactory::defaultEditorFactories(mimeType)) { + if (type->isInternalEditor()) + editorFactories.append(type); } return editorFactories; }; // default factories by mime type const Utils::MimeType mimeType = Utils::mimeTypeForFile(filePath); - EditorFactoryList factories = defaultEditorFactories(mimeType); + EditorFactories factories = defaultEditorFactories(mimeType); const auto factories_moveToFront = [&factories](IEditorFactory *f) { factories.removeAll(f); factories.prepend(f); }; // user preferred factory to front - EditorType *userPreferred = Internal::userPreferredEditorTypes().value(mimeType); - if (userPreferred && userPreferred->asEditorFactory()) - factories_moveToFront(userPreferred->asEditorFactory()); + IEditorFactory *userPreferred = Internal::userPreferredEditorTypes().value(mimeType); + if (userPreferred && userPreferred->isInternalEditor()) + factories_moveToFront(userPreferred); // open text files > 48 MB in binary editor if (filePath.fileSize() > EditorManager::maxTextFileSize() && mimeType.inherits("text/plain")) { const Utils::MimeType binary = Utils::mimeTypeForName("application/octet-stream"); - const EditorFactoryList binaryEditors = defaultEditorFactories(binary); + const EditorFactories binaryEditors = defaultEditorFactories(binary); if (!binaryEditors.isEmpty()) factories_moveToFront(binaryEditors.first()); } return factories; } +/** + Returns true if this factory creates internal editors. +*/ +bool IEditorFactory::isInternalEditor() const +{ + return bool(m_creator); +} + +/** + Returns true if this factory creates external editors. +*/ +bool IEditorFactory::isExternalEditor() const +{ + return bool(m_starter); +} + /*! - Creates an editor. + Creates an internal editor. Uses the function set with setEditorCreator() to create the editor. @@ -294,21 +281,54 @@ IEditor *IEditorFactory::createEditor() const return m_creator(); } +/*! + Starts an external editor. + + Uses the function set with setEditorStarter() to start the editor. + + \sa setEditorStarter() +*/ +bool IEditorFactory::startEditor(const FilePath &filePath, QString *errorMessage) +{ + QTC_ASSERT(m_starter, return false); + return m_starter(filePath, 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. + \sa createEditor() */ void IEditorFactory::setEditorCreator(const std::function<IEditor *()> &creator) { + QTC_CHECK(!m_starter); + // The check below triggers within the TextEditorFactory sub-hierarchy + // as the base TextEditorFactory already sets as simple creator. + //QTC_CHECK(!m_creator); m_creator = creator; } +/*! + Opens the editor with \a fileName. Returns \c true on success or \c false + on failure along with the error in \a errorMessage. + + This is mutually exclusive with the use of setEditorCreator. +*/ + +void IEditorFactory::setEditorStarter(const std::function<bool(const FilePath &, QString *)> &starter) +{ + QTC_CHECK(!m_starter); + QTC_CHECK(!m_creator); + m_starter = starter; +} + /*! \internal */ -QHash<Utils::MimeType, Core::EditorType *> Core::Internal::userPreferredEditorTypes() +QHash<Utils::MimeType, IEditorFactory *> Internal::userPreferredEditorTypes() { return g_userPreferredEditorTypes; } @@ -316,64 +336,10 @@ QHash<Utils::MimeType, Core::EditorType *> Core::Internal::userPreferredEditorTy /*! \internal */ -void Internal::setUserPreferredEditorTypes(const QHash<Utils::MimeType, EditorType *> &factories) +void Internal::setUserPreferredEditorTypes(const QHash<Utils::MimeType, IEditorFactory *> &factories) { g_userPreferredEditorTypes = factories; } -/*! - \class Core::IExternalEditor - \inheaderfile coreplugin/editormanager/ieditorfactory.h - \inmodule QtCreator - \ingroup mainclasses - - \brief The IExternalEditor class enables registering an external - editor in the \uicontrol{Open With} dialog. -*/ - -/*! - \fn bool Core::IExternalEditor::startEditor(const Utils::FilePath &fileName, QString *errorMessage) - - Opens the editor with \a fileName. Returns \c true on success or \c false - on failure along with the error in \a errorMessage. -*/ - -static QList<IExternalEditor *> g_externalEditors; - -/*! - \internal -*/ -IExternalEditor::IExternalEditor() -{ - g_externalEditors.append(this); -} - -/*! - \internal -*/ -IExternalEditor::~IExternalEditor() -{ - g_externalEditors.removeOne(this); -} - -/*! - Returns all available external editors. -*/ -const ExternalEditorList IExternalEditor::allExternalEditors() -{ - return g_externalEditors; -} - -/*! - Returns all external editors available for this \a mimeType in the default - order (editors ordered by MIME type hierarchy). -*/ -const ExternalEditorList IExternalEditor::externalEditors(const Utils::MimeType &mimeType) -{ - ExternalEditorList rc; - const ExternalEditorList allEditors = IExternalEditor::allExternalEditors(); - mimeTypeFactoryLookup(mimeType, allEditors, &rc); - return rc; -} } // Core diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.h b/src/plugins/coreplugin/editormanager/ieditorfactory.h index e28694ffa0d..29b07f384ff 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory.h +++ b/src/plugins/coreplugin/editormanager/ieditorfactory.h @@ -18,77 +18,48 @@ class MimeType; namespace Core { -class IExternalEditor; class IEditor; class IEditorFactory; -class EditorType; -using EditorFactoryList = QList<IEditorFactory *>; -using EditorTypeList = QList<EditorType *>; -using ExternalEditorList = QList<IExternalEditor *>; +using EditorFactories = QList<IEditorFactory *>; -class CORE_EXPORT EditorType +class CORE_EXPORT IEditorFactory { public: - virtual ~EditorType(); + virtual ~IEditorFactory(); - static const EditorTypeList allEditorTypes(); - static EditorType *editorTypeForId(const Utils::Id &id); - static const EditorTypeList defaultEditorTypes(const Utils::MimeType &mimeType); - static const EditorTypeList preferredEditorTypes(const Utils::FilePath &filePath); + static const EditorFactories allEditorFactories(); + static IEditorFactory *editorFactoryForId(const Utils::Id &id); + static const EditorFactories defaultEditorFactories(const Utils::MimeType &mimeType); + static const EditorFactories preferredEditorTypes(const Utils::FilePath &filePath); + static const EditorFactories preferredEditorFactories(const Utils::FilePath &filePath); Utils::Id id() const { return m_id; } QString displayName() const { return m_displayName; } QStringList mimeTypes() const { return m_mimeTypes; } - virtual IEditorFactory *asEditorFactory() { return nullptr; }; - virtual IExternalEditor *asExternalEditor() { return nullptr; }; + bool isInternalEditor() const; + bool isExternalEditor() const; + + IEditor *createEditor() const; + bool startEditor(const Utils::FilePath &filePath, QString *errorMessage); protected: - EditorType(); + IEditorFactory(); + void setId(Utils::Id id) { m_id = id; } void setDisplayName(const QString &displayName) { m_displayName = displayName; } void setMimeTypes(const QStringList &mimeTypes) { m_mimeTypes = mimeTypes; } void addMimeType(const QString &mimeType) { m_mimeTypes.append(mimeType); } + void setEditorCreator(const std::function<IEditor *()> &creator); + void setEditorStarter(const std::function<bool(const Utils::FilePath &, QString *)> &starter); private: Utils::Id m_id; QString m_displayName; QStringList m_mimeTypes; -}; - -class CORE_EXPORT IEditorFactory : public EditorType -{ -public: - IEditorFactory(); - ~IEditorFactory() override; - - static const EditorFactoryList allEditorFactories(); - static const EditorFactoryList preferredEditorFactories(const Utils::FilePath &filePath); - - IEditor *createEditor() const; - - IEditorFactory *asEditorFactory() override { return this; } - -protected: - void setEditorCreator(const std::function<IEditor *()> &creator); - -private: std::function<IEditor *()> m_creator; -}; - -class CORE_EXPORT IExternalEditor : public EditorType -{ -public: - explicit IExternalEditor(); - ~IExternalEditor() override; - - static const ExternalEditorList allExternalEditors(); - static const ExternalEditorList externalEditors(const Utils::MimeType &mimeType); - - IExternalEditor *asExternalEditor() override { return this; } - - virtual bool startEditor(const Utils::FilePath &filePath, QString *errorMessage) = 0; + std::function<bool(const Utils::FilePath &, QString *)> m_starter; }; } // namespace Core diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory_p.h b/src/plugins/coreplugin/editormanager/ieditorfactory_p.h index 8f251728424..338f5ea24df 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory_p.h +++ b/src/plugins/coreplugin/editormanager/ieditorfactory_p.h @@ -9,12 +9,12 @@ namespace Core { -class EditorType; +class IEditorFactory; namespace Internal { -QHash<Utils::MimeType, EditorType *> userPreferredEditorTypes(); -void setUserPreferredEditorTypes(const QHash<Utils::MimeType, EditorType *> &factories); +QHash<Utils::MimeType, IEditorFactory *> userPreferredEditorTypes(); +void setUserPreferredEditorTypes(const QHash<Utils::MimeType, IEditorFactory *> &factories); } // Internal } // Core diff --git a/src/plugins/coreplugin/editormanager/systemeditor.cpp b/src/plugins/coreplugin/editormanager/systemeditor.cpp index d54446aa480..2b0f91cbd2c 100644 --- a/src/plugins/coreplugin/editormanager/systemeditor.cpp +++ b/src/plugins/coreplugin/editormanager/systemeditor.cpp @@ -7,7 +7,6 @@ #include <utils/filepath.h> -#include <QStringList> #include <QUrl> #include <QDesktopServices> @@ -20,20 +19,19 @@ SystemEditor::SystemEditor() setId("CorePlugin.OpenWithSystemEditor"); setDisplayName(Tr::tr("System Editor")); setMimeTypes({"application/octet-stream"}); -} -bool SystemEditor::startEditor(const FilePath &filePath, QString *errorMessage) -{ - Q_UNUSED(errorMessage) - QUrl url; - url.setPath(filePath.toString()); - url.setScheme(QLatin1String("file")); - if (!QDesktopServices::openUrl(url)) { - if (errorMessage) - *errorMessage = Tr::tr("Could not open URL %1.").arg(url.toString()); - return false; - } - return true; + setEditorStarter([](const FilePath &filePath, QString *errorMessage) { + Q_UNUSED(errorMessage) + QUrl url; + url.setPath(filePath.toString()); + url.setScheme(QLatin1String("file")); + if (!QDesktopServices::openUrl(url)) { + if (errorMessage) + *errorMessage = Tr::tr("Could not open URL %1.").arg(url.toString()); + return false; + } + return true; + }); } } // Core::Internal diff --git a/src/plugins/coreplugin/editormanager/systemeditor.h b/src/plugins/coreplugin/editormanager/systemeditor.h index 6218e63335f..45cbd7d2406 100644 --- a/src/plugins/coreplugin/editormanager/systemeditor.h +++ b/src/plugins/coreplugin/editormanager/systemeditor.h @@ -7,12 +7,10 @@ namespace Core::Internal { -class SystemEditor : public IExternalEditor +class SystemEditor final : public IEditorFactory { public: - explicit SystemEditor(); - - bool startEditor(const Utils::FilePath &filePath, QString *errorMessage) override; + SystemEditor(); }; } // namespace Core::Internal diff --git a/src/plugins/coreplugin/mimetypesettings.cpp b/src/plugins/coreplugin/mimetypesettings.cpp index 7edba5625e9..347ece7fcec 100644 --- a/src/plugins/coreplugin/mimetypesettings.cpp +++ b/src/plugins/coreplugin/mimetypesettings.cpp @@ -98,13 +98,13 @@ public: void load(); - QList<EditorType *> handlersForMimeType(const Utils::MimeType &mimeType) const; - EditorType *defaultHandlerForMimeType(const Utils::MimeType &mimeType) const; + QList<IEditorFactory *> handlersForMimeType(const Utils::MimeType &mimeType) const; + IEditorFactory *defaultHandlerForMimeType(const Utils::MimeType &mimeType) const; void resetUserDefaults(); QList<Utils::MimeType> m_mimeTypes; - mutable QHash<Utils::MimeType, QList<EditorType *>> m_handlersByMimeType; - QHash<Utils::MimeType, EditorType *> m_userDefault; + mutable QHash<Utils::MimeType, QList<IEditorFactory *>> m_handlersByMimeType; + QHash<Utils::MimeType, IEditorFactory *> m_userDefault; }; int MimeTypeSettingsModel::rowCount(const QModelIndex &) const @@ -139,7 +139,7 @@ QVariant MimeTypeSettingsModel::data(const QModelIndex &modelIndex, int role) co if (column == 0) { return type.name(); } else { - EditorType *defaultHandler = defaultHandlerForMimeType(type); + IEditorFactory *defaultHandler = defaultHandlerForMimeType(type); return defaultHandler ? defaultHandler->displayName() : QString(); } } else if (role == Qt::EditRole) { @@ -166,12 +166,12 @@ bool MimeTypeSettingsModel::setData(const QModelIndex &index, const QVariant &va { if (role != int(Role::DefaultHandler) || index.column() != 1) return false; - auto factory = value.value<EditorType *>(); + auto factory = value.value<IEditorFactory *>(); QTC_ASSERT(factory, return false); const int row = index.row(); QTC_ASSERT(row >= 0 && row < m_mimeTypes.size(), return false); const Utils::MimeType mimeType = m_mimeTypes.at(row); - const QList<EditorType *> handlers = handlersForMimeType(mimeType); + const QList<IEditorFactory *> handlers = handlersForMimeType(mimeType); QTC_ASSERT(handlers.contains(factory), return false); if (handlers.first() == factory) // selection is the default anyhow m_userDefault.remove(mimeType); @@ -200,18 +200,18 @@ void MimeTypeSettingsModel::load() endResetModel(); } -QList<EditorType *> MimeTypeSettingsModel::handlersForMimeType(const Utils::MimeType &mimeType) const +QList<IEditorFactory *> MimeTypeSettingsModel::handlersForMimeType(const Utils::MimeType &mimeType) const { if (!m_handlersByMimeType.contains(mimeType)) - m_handlersByMimeType.insert(mimeType, EditorType::defaultEditorTypes(mimeType)); + m_handlersByMimeType.insert(mimeType, IEditorFactory::defaultEditorFactories(mimeType)); return m_handlersByMimeType.value(mimeType); } -EditorType *MimeTypeSettingsModel::defaultHandlerForMimeType(const Utils::MimeType &mimeType) const +IEditorFactory *MimeTypeSettingsModel::defaultHandlerForMimeType(const Utils::MimeType &mimeType) const { if (m_userDefault.contains(mimeType)) return m_userDefault.value(mimeType); - const QList<EditorType *> handlers = handlersForMimeType(mimeType); + const QList<IEditorFactory *> handlers = handlersForMimeType(mimeType); return handlers.isEmpty() ? nullptr : handlers.first(); } @@ -808,13 +808,13 @@ QWidget *MimeEditorDelegate::createEditor(QWidget *parent, void MimeEditorDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { auto box = static_cast<QComboBox *>(editor); - const auto factories = index.model()->data(index, Qt::EditRole).value<QList<EditorType *>>(); - for (EditorType *factory : factories) + const auto factories = index.model()->data(index, Qt::EditRole).value<QList<IEditorFactory *>>(); + for (IEditorFactory *factory : factories) box->addItem(factory->displayName(), QVariant::fromValue(factory)); int currentIndex = factories.indexOf( index.model() ->data(index, int(MimeTypeSettingsModel::Role::DefaultHandler)) - .value<EditorType *>()); + .value<IEditorFactory *>()); if (QTC_GUARD(currentIndex != -1)) box->setCurrentIndex(currentIndex); } diff --git a/src/plugins/qtsupport/externaleditors.cpp b/src/plugins/qtsupport/externaleditors.cpp index 73bb1116144..257347fa6bd 100644 --- a/src/plugins/qtsupport/externaleditors.cpp +++ b/src/plugins/qtsupport/externaleditors.cpp @@ -258,63 +258,62 @@ DesignerExternalEditor::DesignerExternalEditor() setId("Qt.Designer"); setDisplayName(::Core::Tr::tr("Qt Designer")); setMimeTypes({ProjectExplorer::Constants::FORM_MIMETYPE}); -} -bool DesignerExternalEditor::startEditor(const FilePath &filePath, QString *errorMessage) -{ - LaunchData data; + setEditorStarter([this](const FilePath &filePath, QString *errorMessage) { + LaunchData data; - // Find the editor binary - if (!getEditorLaunchData(designerBinary, filePath, &data, errorMessage)) - return false; + // Find the editor binary + if (!getEditorLaunchData(designerBinary, filePath, &data, errorMessage)) + return false; - if (HostOsInfo::isMacHost()) - return startEditorProcess(data, errorMessage); + if (HostOsInfo::isMacHost()) + return startEditorProcess(data, errorMessage); - /* Qt Designer on the remaining platforms: Uses Designer's own - * Tcp-based communication mechanism to ensure all files are opened - * in one instance (per version). */ + /* Qt Designer on the remaining platforms: Uses Designer's own + * Tcp-based communication mechanism to ensure all files are opened + * in one instance (per version). */ - // Known one? - const ProcessCache::iterator it = m_processCache.find(data.binary); - if (it != m_processCache.end()) { - // Process is known, write to its socket to cause it to open the file - if (debug) - qDebug() << Q_FUNC_INFO << "\nWriting to socket:" << data.binary << filePath; - QTcpSocket *socket = it.value(); - if (!socket->write(filePath.toString().toUtf8() + '\n')) { - *errorMessage = Tr::tr("Qt Designer is not responding (%1).").arg(socket->errorString()); + // Known one? + const ProcessCache::iterator it = m_processCache.find(data.binary); + if (it != m_processCache.end()) { + // Process is known, write to its socket to cause it to open the file + if (debug) + qDebug() << Q_FUNC_INFO << "\nWriting to socket:" << data.binary << filePath; + QTcpSocket *socket = it.value(); + if (!socket->write(filePath.toString().toUtf8() + '\n')) { + *errorMessage = Tr::tr("Qt Designer is not responding (%1).").arg(socket->errorString()); + return false; + } + return true; + } + // No process yet. Create socket & launch the process + QTcpServer server; + if (!server.listen(QHostAddress::LocalHost)) { + *errorMessage = Tr::tr("Unable to create server socket: %1").arg(server.errorString()); return false; } - return true; - } - // No process yet. Create socket & launch the process - QTcpServer server; - if (!server.listen(QHostAddress::LocalHost)) { - *errorMessage = Tr::tr("Unable to create server socket: %1").arg(server.errorString()); - return false; - } - const quint16 port = server.serverPort(); - if (debug) - qDebug() << Q_FUNC_INFO << "\nLaunching server:" << port << data.binary << filePath; - // Start first one with file and socket as '-client port file' - // Wait for the socket listening - data.arguments.push_front(QString::number(port)); - data.arguments.push_front(QLatin1String("-client")); + const quint16 port = server.serverPort(); + if (debug) + qDebug() << Q_FUNC_INFO << "\nLaunching server:" << port << data.binary << filePath; + // Start first one with file and socket as '-client port file' + // Wait for the socket listening + data.arguments.push_front(QString::number(port)); + data.arguments.push_front(QLatin1String("-client")); - if (!startEditorProcess(data, errorMessage)) - return false; - // Insert into cache if socket is created, else try again next time - if (server.waitForNewConnection(3000)) { - QTcpSocket *socket = server.nextPendingConnection(); - socket->setParent(&m_guard); - const QString binary = data.binary; - m_processCache.insert(binary, socket); - auto mapSlot = [binary] { processTerminated(binary); }; - QObject::connect(socket, &QAbstractSocket::disconnected, &m_guard, mapSlot); - QObject::connect(socket, &QAbstractSocket::errorOccurred, &m_guard, mapSlot); - } - return true; + if (!startEditorProcess(data, errorMessage)) + return false; + // Insert into cache if socket is created, else try again next time + if (server.waitForNewConnection(3000)) { + QTcpSocket *socket = server.nextPendingConnection(); + socket->setParent(&m_guard); + const QString binary = data.binary; + m_processCache.insert(binary, socket); + auto mapSlot = [binary] { processTerminated(binary); }; + QObject::connect(socket, &QAbstractSocket::disconnected, &m_guard, mapSlot); + QObject::connect(socket, &QAbstractSocket::errorOccurred, &m_guard, mapSlot); + } + return true; + }); } // Linguist @@ -331,13 +330,11 @@ LinguistEditor::LinguistEditor() setId("Qt.Linguist"); setDisplayName(::Core::Tr::tr("Qt Linguist")); setMimeTypes({ProjectExplorer::Constants::LINGUIST_MIMETYPE}); -} - -bool LinguistEditor::startEditor(const Utils::FilePath &filePath, QString *errorMessage) -{ - LaunchData data; - return getEditorLaunchData(linguistBinary, filePath, &data, errorMessage) - && startEditorProcess(data, errorMessage); + setEditorStarter([](const FilePath &filePath, QString *errorMessage) { + LaunchData data; + return getEditorLaunchData(linguistBinary, filePath, &data, errorMessage) + && startEditorProcess(data, errorMessage); + }); } } // QtSupport::Internal diff --git a/src/plugins/qtsupport/externaleditors.h b/src/plugins/qtsupport/externaleditors.h index 1901046b658..5c34940f572 100644 --- a/src/plugins/qtsupport/externaleditors.h +++ b/src/plugins/qtsupport/externaleditors.h @@ -9,23 +9,19 @@ namespace QtSupport::Internal { -class DesignerExternalEditor : public Core::IExternalEditor +class DesignerExternalEditor : public Core::IEditorFactory { public: DesignerExternalEditor(); - bool startEditor(const Utils::FilePath &filePath, QString *errorMessage) final; - private: QObject m_guard; }; -class LinguistEditor : public Core::IExternalEditor +class LinguistEditor : public Core::IEditorFactory { public: LinguistEditor(); - - bool startEditor(const Utils::FilePath &filePath, QString *errorMessage) final; }; } // QtSupport::Internal From f8005cced8d9940e8970ab755e91c6cba2364579 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 22 Aug 2023 09:11:06 +0200 Subject: [PATCH 0860/1777] Python: use internal terminal for pip install task Change-Id: I4125f8a12c7a6d2f7d5ebaaf5150051e330b6832 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/python/pipsupport.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/python/pipsupport.cpp b/src/plugins/python/pipsupport.cpp index 6aa4e466ae5..a4d29a56303 100644 --- a/src/plugins/python/pipsupport.cpp +++ b/src/plugins/python/pipsupport.cpp @@ -80,9 +80,10 @@ void PipInstallTask::run() arguments << "--user"; m_process.setCommand({m_python, arguments}); + m_process.setTerminalMode(TerminalMode::Run); m_process.start(); - Core::MessageManager::writeDisrupting( + Core::MessageManager::writeSilently( Tr::tr("Running \"%1\" to install %2.") .arg(m_process.commandLine().toUserOutput(), packagesDisplayName())); From dd1c9d1b71861563abb3fd4be11dc0cc91223b99 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 9 Aug 2023 13:48:24 +0200 Subject: [PATCH 0861/1777] App: Replace QtLockedFile usage with QLockFile We had an import of QtLockedFile from 2008. On Windows we could see a lot of QtLockedFile cycles for qtcreator.exe. The 2008 version was using a semaphore. I've tried the latest QtSolutions version from 2016, which was using only mutexes. qtcreator.exe would still show up lots of cycles for QtLockedFile. Then switched to QLockFile (added in Qt 5.1), and I couldn't see any more CPU usage! Task-number: QTCREATORBUG-29416 Change-Id: Ibfd102f3e90de39c807ff1140e597b79a7b6ca8e Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> (cherry picked from commit 1fca05959f0a321943d803941c2fcdb7f6f0258d) --- src/app/app.qbs | 18 -- src/shared/CMakeLists.txt | 1 - src/shared/qtlockedfile/CMakeLists.txt | 17 -- src/shared/qtlockedfile/README.txt | 10 -- src/shared/qtlockedfile/namespace.patch | 70 -------- src/shared/qtlockedfile/qtlockedfile.cpp | 132 -------------- src/shared/qtlockedfile/qtlockedfile.h | 48 ----- src/shared/qtlockedfile/qtlockedfile_unix.cpp | 82 --------- src/shared/qtlockedfile/qtlockedfile_win.cpp | 170 ------------------ src/shared/qtsingleapplication/CMakeLists.txt | 2 +- .../qtsingleapplication/qtlocalpeer.cpp | 7 +- src/shared/qtsingleapplication/qtlocalpeer.h | 9 +- .../qtsingleapplication.cpp | 15 +- 13 files changed, 15 insertions(+), 566 deletions(-) delete mode 100644 src/shared/qtlockedfile/CMakeLists.txt delete mode 100644 src/shared/qtlockedfile/README.txt delete mode 100644 src/shared/qtlockedfile/namespace.patch delete mode 100644 src/shared/qtlockedfile/qtlockedfile.cpp delete mode 100644 src/shared/qtlockedfile/qtlockedfile.h delete mode 100644 src/shared/qtlockedfile/qtlockedfile_unix.cpp delete mode 100644 src/shared/qtlockedfile/qtlockedfile_win.cpp diff --git a/src/app/app.qbs b/src/app/app.qbs index 8bce23f6424..5c293781c29 100644 --- a/src/app/app.qbs +++ b/src/app/app.qbs @@ -40,7 +40,6 @@ QtcProduct { : ["$ORIGIN/../" + qtc.libDirName + "/qtcreator"] cpp.includePaths: [ project.sharedSourcesDir + "/qtsingleapplication", - project.sharedSourcesDir + "/qtlockedfile", ] cpp.frameworks: base.concat(qbs.targetOS.contains("macos") ? ["Foundation"] : []) @@ -59,7 +58,6 @@ QtcProduct { "../shared/qtsingleapplication/qtsingleapplication.cpp", "../shared/qtsingleapplication/qtlocalpeer.h", "../shared/qtsingleapplication/qtlocalpeer.cpp", - "../shared/qtlockedfile/qtlockedfile.cpp", "../tools/qtcreatorcrashhandler/crashhandlersetup.cpp", "../tools/qtcreatorcrashhandler/crashhandlersetup.h" ] @@ -85,22 +83,6 @@ QtcProduct { qbs.installDir: "bin" } - Group { - name: "QtLockedFile_unix" - condition: qbs.targetOS.contains("unix") - files: [ - "../shared/qtlockedfile/qtlockedfile_unix.cpp" - ] - } - - Group { - name: "QtLockedFile_win" - condition: qbs.targetOS.contains("windows") - files: [ - "../shared/qtlockedfile/qtlockedfile_win.cpp" - ] - } - Group { name: "main_macos" condition: qbs.targetOS.contains("macos") diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index 7dc20458d2d..b945e8faa92 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -1,7 +1,6 @@ add_subdirectory(designerintegrationv2) add_subdirectory(proparser) add_subdirectory(qtsingleapplication) -add_subdirectory(qtlockedfile) add_subdirectory(help) add_subdirectory(registryaccess) diff --git a/src/shared/qtlockedfile/CMakeLists.txt b/src/shared/qtlockedfile/CMakeLists.txt deleted file mode 100644 index f7f8a1c6662..00000000000 --- a/src/shared/qtlockedfile/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -if (WIN32) - set(OS_SOURCES qtlockedfile_win.cpp) -else() - set(OS_SOURCES qtlockedfile_unix.cpp) -endif() - -add_library(shared_qtlockedfile STATIC ${OS_SOURCES} qtlockedfile.cpp qtlockedfile.h) -target_link_libraries(shared_qtlockedfile Qt::Core) -target_include_directories(shared_qtlockedfile PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -if (WIN32) - target_compile_definitions(shared_qtlockedfile PRIVATE - "QT_QTLOCKEDFILE_EXPORT=__declspec(dllexport)" _UNICODE UNICODE) -endif() - -if (WITH_SANITIZE) - qtc_enable_sanitize(shared_qtlockedfile ${SANITIZE_FLAGS}) -endif() diff --git a/src/shared/qtlockedfile/README.txt b/src/shared/qtlockedfile/README.txt deleted file mode 100644 index 6fcf2fd2954..00000000000 --- a/src/shared/qtlockedfile/README.txt +++ /dev/null @@ -1,10 +0,0 @@ -This is the src directory of the QtLockedFile -solution integrated over from addons/main/utils/qtlockedfile/src . - -namespace.patch was applied to introduce the SharedTools namespace. - -It is required by the QtSingleApplication solution. - -History: - -16.05.2008 Integrated diff --git a/src/shared/qtlockedfile/namespace.patch b/src/shared/qtlockedfile/namespace.patch deleted file mode 100644 index 301cae8cff7..00000000000 --- a/src/shared/qtlockedfile/namespace.patch +++ /dev/null @@ -1,70 +0,0 @@ - ---- qtlockedfile.cpp 1970-01-01 01:00:00.000000000 -+++ qtlockedfile.cpp 2008/05/16 10:51:19.000000000 -@@ -1,5 +1,7 @@ - #include "qtlockedfile.h" - -+namespace SharedTools { -+ - /*! - \class QtLockedFile - -@@ -123,3 +125,5 @@ - - Destroys the \e QtLockedFile object. If any locks were held, they are released. - */ -+ -+} - ---- qtlockedfile.h 1970-01-01 01:00:00.000000000 -+++ qtlockedfile.h 2008/05/16 10:51:19.000000000 -@@ -19,6 +19,8 @@ - # define QT_QTLOCKEDFILE_EXPORT - #endif - -+namespace SharedTools { -+ - class QT_QTLOCKEDFILE_EXPORT QtLockedFile : public QFile - { - public: -@@ -41,4 +43,6 @@ - LockMode m_lock_mode; - }; - -+} -+ - #endif - ---- qtlockedfile_unix.cpp 1970-01-01 01:00:00.000000000 -+++ qtlockedfile_unix.cpp 2008/05/16 10:51:19.000000000 -@@ -5,6 +5,8 @@ - - #include "qtlockedfile.h" - -+namespace SharedTools { -+ - bool QtLockedFile::lock(LockMode mode, bool block) - { - if (!isOpen()) { -@@ -73,3 +75,4 @@ - unlock(); - } - -+} - ---- qtlockedfile_win.cpp 1970-01-01 01:00:00.000000000 -+++ qtlockedfile_win.cpp 2008/05/16 10:51:19.000000000 -@@ -2,6 +2,8 @@ - #include <qt_windows.h> - #include <QtCore/QFileInfo> - -+namespace SharedTools { -+ - #define SEMAPHORE_PREFIX "QtLockedFile semaphore " - #define MUTEX_PREFIX "QtLockedFile mutex " - #define SEMAPHORE_MAX 100 -@@ -168,3 +170,4 @@ - } - } - -+} diff --git a/src/shared/qtlockedfile/qtlockedfile.cpp b/src/shared/qtlockedfile/qtlockedfile.cpp deleted file mode 100644 index a14c7e14b04..00000000000 --- a/src/shared/qtlockedfile/qtlockedfile.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "qtlockedfile.h" - -namespace SharedTools { - -/*! - \class QtLockedFile - - \brief The QtLockedFile class extends QFile with advisory locking functions. - - A file may be locked in read or write mode. Multiple instances of - \e QtLockedFile, created in multiple processes running on the same - machine, may have a file locked in read mode. Exactly one instance - may have it locked in write mode. A read and a write lock cannot - exist simultaneously on the same file. - - The file locks are advisory. This means that nothing prevents - another process from manipulating a locked file using QFile or - file system functions offered by the OS. Serialization is only - guaranteed if all processes that access the file use - QtLockedFile. Also, while holding a lock on a file, a process - must not open the same file again (through any API), or locks - can be unexpectedly lost. - - The lock provided by an instance of \e QtLockedFile is released - whenever the program terminates. This is true even when the - program crashes and no destructors are called. -*/ - -/*! \enum QtLockedFile::LockMode - - This enum describes the available lock modes. - - \value ReadLock A read lock. - \value WriteLock A write lock. - \value NoLock Neither a read lock nor a write lock. -*/ - -/*! - Constructs an unlocked \e QtLockedFile object. This constructor behaves in the same way - as \e QFile::QFile(). - - \sa QFile::QFile() -*/ -QtLockedFile::QtLockedFile() - : QFile() -{ -#ifdef Q_OS_WIN - m_semaphore_hnd = 0; - m_mutex_hnd = 0; -#endif - m_lock_mode = NoLock; -} - -/*! - Constructs an unlocked QtLockedFile object with file \a name. This constructor behaves in - the same way as \e QFile::QFile(const QString&). - - \sa QFile::QFile() -*/ -QtLockedFile::QtLockedFile(const QString &name) - : QFile(name) -{ -#ifdef Q_OS_WIN - m_semaphore_hnd = 0; - m_mutex_hnd = 0; -#endif - m_lock_mode = NoLock; -} - -/*! - Returns \e true if this object has a in read or write lock; - otherwise returns \e false. - - \sa lockMode() -*/ -bool QtLockedFile::isLocked() const -{ - return m_lock_mode != NoLock; -} - -/*! - Returns the type of lock currently held by this object, or \e QtLockedFile::NoLock. - - \sa isLocked() -*/ -QtLockedFile::LockMode QtLockedFile::lockMode() const -{ - return m_lock_mode; -} - -/*! - \fn bool QtLockedFile::lock(LockMode mode, bool block = true) - - Obtains a lock of type \a mode. - - If \a block is true, this - function will block until the lock is acquired. If \a block is - false, this function returns \e false immediately if the lock cannot - be acquired. - - If this object already has a lock of type \a mode, this function returns \e true immediately. If this object has a lock of a different type than \a mode, the lock - is first released and then a new lock is obtained. - - This function returns \e true if, after it executes, the file is locked by this object, - and \e false otherwise. - - \sa unlock(), isLocked(), lockMode() -*/ - -/*! - \fn bool QtLockedFile::unlock() - - Releases a lock. - - If the object has no lock, this function returns immediately. - - This function returns \e true if, after it executes, the file is not locked by - this object, and \e false otherwise. - - \sa lock(), isLocked(), lockMode() -*/ - -/*! - \fn QtLockedFile::~QtLockedFile() - - Destroys the \e QtLockedFile object. If any locks were held, they are released. -*/ - -} // namespace SharedTools diff --git a/src/shared/qtlockedfile/qtlockedfile.h b/src/shared/qtlockedfile/qtlockedfile.h deleted file mode 100644 index d4aa9a59c0d..00000000000 --- a/src/shared/qtlockedfile/qtlockedfile.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <QFile> - -#if defined(Q_OS_WIN) -# if !defined(QT_QTLOCKEDFILE_EXPORT) && !defined(QT_QTLOCKEDFILE_IMPORT) -# define QT_QTLOCKEDFILE_EXPORT -# elif defined(QT_QTLOCKEDFILE_IMPORT) -# if defined(QT_QTLOCKEDFILE_EXPORT) -# undef QT_QTLOCKEDFILE_EXPORT -# endif -# define QT_QTLOCKEDFILE_EXPORT __declspec(dllimport) -# elif defined(QT_QTLOCKEDFILE_EXPORT) -# undef QT_QTLOCKEDFILE_EXPORT -# define QT_QTLOCKEDFILE_EXPORT __declspec(dllexport) -# endif -#else -# define QT_QTLOCKEDFILE_EXPORT -#endif - -namespace SharedTools { - -class QT_QTLOCKEDFILE_EXPORT QtLockedFile : public QFile -{ -public: - enum LockMode { NoLock = 0, ReadLock, WriteLock }; - - QtLockedFile(); - QtLockedFile(const QString &name); - ~QtLockedFile(); - - bool lock(LockMode mode, bool block = true); - bool unlock(); - bool isLocked() const; - LockMode lockMode() const; - -private: -#ifdef Q_OS_WIN - Qt::HANDLE m_semaphore_hnd; - Qt::HANDLE m_mutex_hnd; -#endif - LockMode m_lock_mode; -}; - -} // namespace SharedTools diff --git a/src/shared/qtlockedfile/qtlockedfile_unix.cpp b/src/shared/qtlockedfile/qtlockedfile_unix.cpp deleted file mode 100644 index e189f31472d..00000000000 --- a/src/shared/qtlockedfile/qtlockedfile_unix.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "qtlockedfile.h" - -#include <string.h> -#include <errno.h> -#include <unistd.h> -#include <fcntl.h> - -namespace SharedTools { - -bool QtLockedFile::lock(LockMode mode, bool block) -{ - if (!isOpen()) { - qWarning("QtLockedFile::lock(): file is not opened"); - return false; - } - - if (mode == NoLock) - return unlock(); - - if (mode == m_lock_mode) - return true; - - if (m_lock_mode != NoLock) - unlock(); - - struct flock fl; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - fl.l_type = (mode == ReadLock) ? F_RDLCK : F_WRLCK; - int cmd = block ? F_SETLKW : F_SETLK; - int ret = fcntl(handle(), cmd, &fl); - - if (ret == -1) { - if (errno != EINTR && errno != EAGAIN) - qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno)); - return false; - } - - - m_lock_mode = mode; - return true; -} - - -bool QtLockedFile::unlock() -{ - if (!isOpen()) { - qWarning("QtLockedFile::unlock(): file is not opened"); - return false; - } - - if (!isLocked()) - return true; - - struct flock fl; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - fl.l_type = F_UNLCK; - int ret = fcntl(handle(), F_SETLKW, &fl); - - if (ret == -1) { - qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno)); - return false; - } - - m_lock_mode = NoLock; - remove(); - return true; -} - -QtLockedFile::~QtLockedFile() -{ - if (isOpen()) - unlock(); -} - -} // namespace SharedTools diff --git a/src/shared/qtlockedfile/qtlockedfile_win.cpp b/src/shared/qtlockedfile/qtlockedfile_win.cpp deleted file mode 100644 index 2f35635b55e..00000000000 --- a/src/shared/qtlockedfile/qtlockedfile_win.cpp +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "qtlockedfile.h" - -#include <qt_windows.h> -#include <QFileInfo> - -namespace SharedTools { - -#define SEMAPHORE_PREFIX "QtLockedFile semaphore " -#define MUTEX_PREFIX "QtLockedFile mutex " -#define SEMAPHORE_MAX 100 - -static QString errorCodeToString(DWORD errorCode) -{ - QString result; - char *data = 0; - FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - 0, errorCode, 0, - (char*)&data, 0, 0); - result = QString::fromLocal8Bit(data); - if (data != 0) - LocalFree(data); - - if (result.endsWith(QLatin1Char('\n'))) - result.truncate(result.length() - 1); - - return result; -} - -bool QtLockedFile::lock(LockMode mode, bool block) -{ - if (!isOpen()) { - qWarning("QtLockedFile::lock(): file is not opened"); - return false; - } - - if (mode == m_lock_mode) - return true; - - if (m_lock_mode != 0) - unlock(); - - if (m_semaphore_hnd == 0) { - QFileInfo fi(*this); - QString sem_name = QString::fromLatin1(SEMAPHORE_PREFIX) - + fi.absoluteFilePath().toLower(); - - m_semaphore_hnd = CreateSemaphoreW(0, SEMAPHORE_MAX, SEMAPHORE_MAX, - (TCHAR*)sem_name.utf16()); - - if (m_semaphore_hnd == 0) { - qWarning("QtLockedFile::lock(): CreateSemaphore: %s", - errorCodeToString(GetLastError()).toLatin1().constData()); - return false; - } - } - - bool gotMutex = false; - int decrement; - if (mode == ReadLock) { - decrement = 1; - } else { - decrement = SEMAPHORE_MAX; - if (m_mutex_hnd == 0) { - QFileInfo fi(*this); - QString mut_name = QString::fromLatin1(MUTEX_PREFIX) - + fi.absoluteFilePath().toLower(); - - m_mutex_hnd = CreateMutexW(NULL, FALSE, (TCHAR*)mut_name.utf16()); - - if (m_mutex_hnd == 0) { - qWarning("QtLockedFile::lock(): CreateMutex: %s", - errorCodeToString(GetLastError()).toLatin1().constData()); - return false; - } - } - DWORD res = WaitForSingleObject(m_mutex_hnd, block ? INFINITE : 0); - if (res == WAIT_TIMEOUT) - return false; - if (res == WAIT_FAILED) { - qWarning("QtLockedFile::lock(): WaitForSingleObject (mutex): %s", - errorCodeToString(GetLastError()).toLatin1().constData()); - return false; - } - gotMutex = true; - } - - for (int i = 0; i < decrement; ++i) { - DWORD res = WaitForSingleObject(m_semaphore_hnd, block ? INFINITE : 0); - if (res == WAIT_TIMEOUT) { - if (i) { - // A failed nonblocking rw locking. Undo changes to semaphore. - if (ReleaseSemaphore(m_semaphore_hnd, i, NULL) == 0) { - qWarning("QtLockedFile::unlock(): ReleaseSemaphore: %s", - errorCodeToString(GetLastError()).toLatin1().constData()); - // Fall through - } - } - if (gotMutex) - ReleaseMutex(m_mutex_hnd); - return false; - } - if (res != WAIT_OBJECT_0) { - if (gotMutex) - ReleaseMutex(m_mutex_hnd); - qWarning("QtLockedFile::lock(): WaitForSingleObject (semaphore): %s", - errorCodeToString(GetLastError()).toLatin1().constData()); - return false; - } - } - - m_lock_mode = mode; - if (gotMutex) - ReleaseMutex(m_mutex_hnd); - return true; -} - -bool QtLockedFile::unlock() -{ - if (!isOpen()) { - qWarning("QtLockedFile::unlock(): file is not opened"); - return false; - } - - if (!isLocked()) - return true; - - int increment; - if (m_lock_mode == ReadLock) - increment = 1; - else - increment = SEMAPHORE_MAX; - - DWORD ret = ReleaseSemaphore(m_semaphore_hnd, increment, 0); - if (ret == 0) { - qWarning("QtLockedFile::unlock(): ReleaseSemaphore: %s", - errorCodeToString(GetLastError()).toLatin1().constData()); - return false; - } - - m_lock_mode = QtLockedFile::NoLock; - remove(); - return true; -} - -QtLockedFile::~QtLockedFile() -{ - if (isOpen()) - unlock(); - if (m_mutex_hnd != 0) { - DWORD ret = CloseHandle(m_mutex_hnd); - if (ret == 0) { - qWarning("QtLockedFile::~QtLockedFile(): CloseHandle (mutex): %s", - errorCodeToString(GetLastError()).toLatin1().constData()); - } - m_mutex_hnd = 0; - } - if (m_semaphore_hnd != 0) { - DWORD ret = CloseHandle(m_semaphore_hnd); - if (ret == 0) { - qWarning("QtLockedFile::~QtLockedFile(): CloseHandle (semaphore): %s", - errorCodeToString(GetLastError()).toLatin1().constData()); - } - m_semaphore_hnd = 0; - } -} - -} // namespace SharedTools diff --git a/src/shared/qtsingleapplication/CMakeLists.txt b/src/shared/qtsingleapplication/CMakeLists.txt index fae6a085454..5b8e9c02713 100644 --- a/src/shared/qtsingleapplication/CMakeLists.txt +++ b/src/shared/qtsingleapplication/CMakeLists.txt @@ -2,7 +2,7 @@ add_library(shared_qtsingleapplication STATIC qtsingleapplication.cpp qtsingleapplication.h qtlocalpeer.cpp qtlocalpeer.h ) -target_link_libraries(shared_qtsingleapplication shared_qtlockedfile Qt::Core Qt::Network Qt::Widgets) +target_link_libraries(shared_qtsingleapplication Qt::Core Qt::Network Qt::Widgets) target_include_directories(shared_qtsingleapplication PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") if (WIN32) target_compile_definitions(shared_qtsingleapplication PRIVATE "QT_QTSINGLEAPPLICATION_EXPORT=__declspec(dllexport)") diff --git a/src/shared/qtsingleapplication/qtlocalpeer.cpp b/src/shared/qtsingleapplication/qtlocalpeer.cpp index af72ece772a..47dd3805bad 100644 --- a/src/shared/qtsingleapplication/qtlocalpeer.cpp +++ b/src/shared/qtsingleapplication/qtlocalpeer.cpp @@ -59,16 +59,15 @@ QtLocalPeer::QtLocalPeer(QObject *parent, const QString &appId) QString lockName = QDir(QDir::tempPath()).absolutePath() + QLatin1Char('/') + socketName + QLatin1String("-lockfile"); - lockFile.setFileName(lockName); - lockFile.open(QIODevice::ReadWrite); + lockFile.reset(new QLockFile(lockName)); } bool QtLocalPeer::isClient() { - if (lockFile.isLocked()) + if (lockFile->isLocked()) return false; - if (!lockFile.lock(QtLockedFile::WriteLock, false)) + if (!lockFile->tryLock()) return true; if (!QLocalServer::removeServer(socketName)) diff --git a/src/shared/qtsingleapplication/qtlocalpeer.h b/src/shared/qtsingleapplication/qtlocalpeer.h index 67a0d42e2c9..27578a7acac 100644 --- a/src/shared/qtsingleapplication/qtlocalpeer.h +++ b/src/shared/qtsingleapplication/qtlocalpeer.h @@ -3,11 +3,12 @@ #pragma once -#include <qtlockedfile.h> +#include <QDir> #include <QLocalServer> #include <QLocalSocket> -#include <QDir> +#include <QLockFile> +#include <QScopedPointer> namespace SharedTools { @@ -31,8 +32,8 @@ protected: QString id; QString socketName; - QLocalServer* server; - QtLockedFile lockFile; + QLocalServer* server{nullptr}; + QScopedPointer<QLockFile> lockFile; }; } // namespace SharedTools diff --git a/src/shared/qtsingleapplication/qtsingleapplication.cpp b/src/shared/qtsingleapplication/qtsingleapplication.cpp index 0f8fa8b6d13..b791d1875f7 100644 --- a/src/shared/qtsingleapplication/qtsingleapplication.cpp +++ b/src/shared/qtsingleapplication/qtsingleapplication.cpp @@ -4,10 +4,9 @@ #include "qtsingleapplication.h" #include "qtlocalpeer.h" -#include <qtlockedfile.h> - #include <QDir> #include <QFileOpenEvent> +#include <QLockFile> #include <QSharedMemory> #include <QWidget> @@ -50,11 +49,10 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char * } } - // QtLockedFile is used to workaround QTBUG-10364 - QtLockedFile lockfile(instancesLockFilename(appSessionId)); + // QLockFile is used to workaround QTBUG-10364 + QLockFile lockfile(instancesLockFilename(appSessionId)); - lockfile.open(QtLockedFile::ReadWrite); - lockfile.lock(QtLockedFile::WriteLock); + lockfile.lock(); qint64 *pids = static_cast<qint64 *>(instances->data()); if (!created) { // Find the first instance that it still running @@ -79,9 +77,8 @@ QtSingleApplication::~QtSingleApplication() if (!instances) return; const qint64 appPid = QCoreApplication::applicationPid(); - QtLockedFile lockfile(instancesLockFilename(QtLocalPeer::appSessionId(appId))); - lockfile.open(QtLockedFile::ReadWrite); - lockfile.lock(QtLockedFile::WriteLock); + QLockFile lockfile(instancesLockFilename(QtLocalPeer::appSessionId(appId))); + lockfile.lock(); // Rewrite array, removing current pid and previously crashed ones qint64 *pids = static_cast<qint64 *>(instances->data()); qint64 *newpids = pids; From 788eb8a72e65dd7ba01ed349550e04fc2ec368ad Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 24 Aug 2023 18:11:37 +0200 Subject: [PATCH 0862/1777] QtSupport: Make CodeGenSettingsPage use the standard settings pattern Change-Id: Idf4cf50f186e79981d64d9e9567b7fcbcb9eb1cd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../qtdesignerformclasscodegenerator.cpp | 32 +++-- src/plugins/qtsupport/CMakeLists.txt | 1 - src/plugins/qtsupport/codegenerator.cpp | 20 +-- src/plugins/qtsupport/codegensettings.cpp | 124 ++++++++++-------- src/plugins/qtsupport/codegensettings.h | 27 ++-- src/plugins/qtsupport/codegensettingspage.cpp | 124 ------------------ src/plugins/qtsupport/codegensettingspage.h | 16 --- src/plugins/qtsupport/qtsupport.qbs | 2 - src/plugins/qtsupport/qtsupportplugin.cpp | 2 - 9 files changed, 100 insertions(+), 248 deletions(-) delete mode 100644 src/plugins/qtsupport/codegensettingspage.cpp delete mode 100644 src/plugins/qtsupport/codegensettingspage.h diff --git a/src/plugins/designer/qtdesignerformclasscodegenerator.cpp b/src/plugins/designer/qtdesignerformclasscodegenerator.cpp index f5989840414..d935079cf43 100644 --- a/src/plugins/designer/qtdesignerformclasscodegenerator.cpp +++ b/src/plugins/designer/qtdesignerformclasscodegenerator.cpp @@ -14,7 +14,6 @@ #include <utils/codegeneration.h> #include <QTextStream> -#include <QSettings> #include <QFileInfo> #include <QDebug> @@ -30,7 +29,7 @@ namespace Designer { // Write out how to access the Ui class in the source code. static void writeUiMemberAccess(const QtSupport::CodeGenSettings &fp, QTextStream &str) { - switch (fp.embedding) { + switch (fp.embedding()) { case QtSupport::CodeGenSettings::PointerAggregatedUiClass: str << uiMemberC << "->"; break; @@ -45,8 +44,7 @@ static void writeUiMemberAccess(const QtSupport::CodeGenSettings &fp, QTextStrea bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParameters ¶meters, QString *header, QString *source, int indentation) { - QtSupport::CodeGenSettings generationParameters; - generationParameters.fromSettings(Core::ICore::settings()); + const QtSupport::CodeGenSettings &generationParameters = QtSupport::codeGenSettings(); const QString indent = QString(indentation, ' '); QString formBaseClass; @@ -91,14 +89,14 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete headerStr << "#ifndef " << guard << "\n#define " << guard << "\n\n"; // Include 'ui_' - if (generationParameters.embedding != QtSupport::CodeGenSettings::PointerAggregatedUiClass) { + if (generationParameters.embedding() != QtSupport::CodeGenSettings::PointerAggregatedUiClass) { Utils::writeIncludeFileDirective(uiInclude, false, headerStr); } else { // Todo: Can we obtain the header from the code model for custom widgets? // Alternatively, from Designer. if (formBaseClass.startsWith('Q')) { - if (generationParameters.includeQtModule) { - if (generationParameters.addQtVersionCheck) { + if (generationParameters.includeQtModule()) { + if (generationParameters.addQtVersionCheck()) { Utils::writeBeginQtVersionCheck(headerStr); Utils::writeIncludeFileDirective("QtWidgets/" + formBaseClass, true, headerStr); headerStr << "#else\n"; @@ -117,7 +115,7 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete headerStr); // Forward-declare the UI class - if (generationParameters.embedding == QtSupport::CodeGenSettings::PointerAggregatedUiClass) { + if (generationParameters.embedding() == QtSupport::CodeGenSettings::PointerAggregatedUiClass) { headerStr << '\n' << namespaceIndent << "namespace " << uiNamespaceC << " {\n" << namespaceIndent << indent << "class " << Internal::FormTemplateWizardPage::stripNamespaces(uiClassName) << ";\n" @@ -127,22 +125,22 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete // Class declaration headerStr << '\n' << namespaceIndent << "class " << unqualifiedClassName << " : public " << formBaseClass; - if (generationParameters.embedding == QtSupport::CodeGenSettings::InheritedUiClass) + if (generationParameters.embedding() == QtSupport::CodeGenSettings::InheritedUiClass) headerStr << ", private " << uiClassName; headerStr << "\n{\n" << namespaceIndent << indent << "Q_OBJECT\n\n" << namespaceIndent << "public:\n" << namespaceIndent << indent << "explicit " << unqualifiedClassName << "(QWidget *parent = nullptr);\n"; - if (generationParameters.embedding == QtSupport::CodeGenSettings::PointerAggregatedUiClass) + if (generationParameters.embedding() == QtSupport::CodeGenSettings::PointerAggregatedUiClass) headerStr << namespaceIndent << indent << "~" << unqualifiedClassName << "();\n"; // retranslation - if (generationParameters.retranslationSupport) + if (generationParameters.retranslationSupport()) headerStr << '\n' << namespaceIndent << "protected:\n" << namespaceIndent << indent << "void changeEvent(QEvent *e);\n"; // Member variable - if (generationParameters.embedding != QtSupport::CodeGenSettings::InheritedUiClass) { + if (generationParameters.embedding() != QtSupport::CodeGenSettings::InheritedUiClass) { headerStr << '\n' << namespaceIndent << "private:\n" << namespaceIndent << indent << uiClassName << ' '; - if (generationParameters.embedding == QtSupport::CodeGenSettings::PointerAggregatedUiClass) + if (generationParameters.embedding() == QtSupport::CodeGenSettings::PointerAggregatedUiClass) headerStr << '*'; headerStr << uiMemberC << ";\n"; } @@ -156,27 +154,27 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete QTextStream sourceStr(source); sourceStr << sourceLicense; Utils::writeIncludeFileDirective(parameters.headerFile, false, sourceStr); - if (generationParameters.embedding == QtSupport::CodeGenSettings::PointerAggregatedUiClass) + if (generationParameters.embedding() == QtSupport::CodeGenSettings::PointerAggregatedUiClass) Utils::writeIncludeFileDirective(uiInclude, false, sourceStr); // NameSpaces( Utils::writeOpeningNameSpaces(namespaceList, QString(), sourceStr); // Constructor with setupUi sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::" << unqualifiedClassName << "(QWidget *parent) :\n" << namespaceIndent << indent << formBaseClass << "(parent)"; - if (generationParameters.embedding == QtSupport::CodeGenSettings::PointerAggregatedUiClass) + if (generationParameters.embedding() == QtSupport::CodeGenSettings::PointerAggregatedUiClass) sourceStr << ",\n" << namespaceIndent << indent << uiMemberC << "(new " << uiClassName << ")"; sourceStr << '\n' << namespaceIndent << "{\n" << namespaceIndent << indent; writeUiMemberAccess(generationParameters, sourceStr); sourceStr << "setupUi(this);\n" << namespaceIndent << "}\n"; // Deleting destructor for ptr - if (generationParameters.embedding == QtSupport::CodeGenSettings::PointerAggregatedUiClass) { + if (generationParameters.embedding() == QtSupport::CodeGenSettings::PointerAggregatedUiClass) { sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::~" << unqualifiedClassName << "()\n" << namespaceIndent << "{\n" << namespaceIndent << indent << "delete " << uiMemberC << ";\n" << namespaceIndent << "}\n"; } // retranslation - if (generationParameters.retranslationSupport) { + if (generationParameters.retranslationSupport()) { sourceStr << '\n' << namespaceIndent << "void " << unqualifiedClassName << "::" << "changeEvent(QEvent *e)\n" << namespaceIndent << "{\n" << namespaceIndent << indent << formBaseClass << "::changeEvent(e);\n" diff --git a/src/plugins/qtsupport/CMakeLists.txt b/src/plugins/qtsupport/CMakeLists.txt index f99973a97e0..9cfbe0a6c0b 100644 --- a/src/plugins/qtsupport/CMakeLists.txt +++ b/src/plugins/qtsupport/CMakeLists.txt @@ -6,7 +6,6 @@ add_qtc_plugin(QtSupport baseqtversion.cpp baseqtversion.h codegenerator.cpp codegenerator.h codegensettings.cpp codegensettings.h - codegensettingspage.cpp codegensettingspage.h exampleslistmodel.cpp exampleslistmodel.h examplesparser.cpp examplesparser.h diff --git a/src/plugins/qtsupport/codegenerator.cpp b/src/plugins/qtsupport/codegenerator.cpp index eac195865c2..5e9437b8184 100644 --- a/src/plugins/qtsupport/codegenerator.cpp +++ b/src/plugins/qtsupport/codegenerator.cpp @@ -166,34 +166,28 @@ QString CodeGenerator::uiClassName(const QString &uiXml) QString CodeGenerator::qtIncludes(const QStringList &qt4, const QStringList &qt5) { - CodeGenSettings settings; - settings.fromSettings(Core::ICore::settings()); - QString result; QTextStream str(&result); - Utils::writeQtIncludeSection(qt4, qt5, settings.addQtVersionCheck, settings.includeQtModule, str); + Utils::writeQtIncludeSection(qt4, qt5, + codeGenSettings().addQtVersionCheck(), + codeGenSettings().includeQtModule(), + str); return result; } bool CodeGenerator::uiAsPointer() { - CodeGenSettings settings; - settings.fromSettings(Core::ICore::settings()); - return settings.embedding == CodeGenSettings::PointerAggregatedUiClass; + return codeGenSettings().embedding() == CodeGenSettings::PointerAggregatedUiClass; } bool CodeGenerator::uiAsMember() { - CodeGenSettings settings; - settings.fromSettings(Core::ICore::settings()); - return settings.embedding == CodeGenSettings::AggregatedUiClass; + return codeGenSettings().embedding() == CodeGenSettings::AggregatedUiClass; } bool CodeGenerator::uiAsInheritance() { - CodeGenSettings settings; - settings.fromSettings(Core::ICore::settings()); - return settings.embedding == CodeGenSettings::InheritedUiClass; + return codeGenSettings().embedding() == CodeGenSettings::InheritedUiClass; } } // namespace QtSupport diff --git a/src/plugins/qtsupport/codegensettings.cpp b/src/plugins/qtsupport/codegensettings.cpp index cbf12e31e07..007467e619d 100644 --- a/src/plugins/qtsupport/codegensettings.cpp +++ b/src/plugins/qtsupport/codegensettings.cpp @@ -3,73 +3,85 @@ #include "codegensettings.h" -#include <coreplugin/icore.h> -#include <utils/qtcsettings.h> +#include "qtsupportconstants.h" +#include "qtsupporttr.h" -#include <QSettings> +#include <coreplugin/dialogs/ioptionspage.h> + +#include <cppeditor/cppeditorconstants.h> +#include <cppeditor/cppeditortr.h> + +#include <utils/layoutbuilder.h> using namespace Utils; namespace QtSupport { -const char CODE_GEN_GROUP[] = "FormClassWizardPage"; -const char TRANSLATION_KEY[] = "RetranslationSupport"; -const char EMBEDDING_KEY[] = "Embedding"; -const char INCLUDE_QT_MODULE_KEY[] = "IncludeQtModule"; -const char ADD_QT_VERSION_CHECK_KEY[] = "AddQtVersionCheck"; - -const bool retranslationSupportDefault = false; -const CodeGenSettings::UiClassEmbedding embeddingDefault - = CodeGenSettings::PointerAggregatedUiClass; -const bool includeQtModuleDefault = false; -const bool addQtVersionCheckDefault = false; +CodeGenSettings &codeGenSettings() +{ + static CodeGenSettings theCodeGenSettings; + return theCodeGenSettings; +} CodeGenSettings::CodeGenSettings() - : embedding(embeddingDefault) - , retranslationSupport(retranslationSupportDefault) - , includeQtModule(includeQtModuleDefault) - , addQtVersionCheck(addQtVersionCheckDefault) { + setSettingsGroup("FormClassWizardPage"); + + embedding.setSettingsKey("Embedding"); + embedding.addOption(Tr::tr("Aggregation as a pointer member")); + embedding.addOption(Tr::tr("Aggregation")); + embedding.addOption(Tr::tr("Multiple inheritance")); + embedding.setDefaultValue(CodeGenSettings::PointerAggregatedUiClass); + + retranslationSupport.setSettingsKey("RetranslationSupport"); + retranslationSupport.setLabelText(Tr::tr("Support for changing languages at runtime")); + + includeQtModule.setSettingsKey("IncludeQtModule"); + includeQtModule.setLabelText(Tr::tr("Use Qt module name in #include-directive")); + + addQtVersionCheck.setSettingsKey("AddQtVersionCheck"); + addQtVersionCheck.setLabelText(Tr::tr("Add Qt version #ifdef for module names")); + addQtVersionCheck.setEnabler(&includeQtModule); + + setLayouter([this] { + using namespace Layouting; + return Column { + Group { + title(Tr::tr("Embedding of the UI Class")), + Column { + embedding, + } + }, + Group { + title(Tr::tr("Code Generation")), + Column { + retranslationSupport, + includeQtModule, + addQtVersionCheck + } + }, + st + }; + }); + + + readSettings(); } -bool CodeGenSettings::equals(const CodeGenSettings &rhs) const +class CodeGenSettingsPage final : public Core::IOptionsPage { - return embedding == rhs.embedding - && retranslationSupport == rhs.retranslationSupport - && includeQtModule == rhs.includeQtModule - && addQtVersionCheck == rhs.addQtVersionCheck; -} +public: + CodeGenSettingsPage() + { + setId(Constants::CODEGEN_SETTINGS_PAGE_ID); + setDisplayName(Tr::tr("Qt Class Generation")); + setCategory(CppEditor::Constants::CPP_SETTINGS_CATEGORY); + setDisplayCategory(::CppEditor::Tr::tr(CppEditor::Constants::CPP_SETTINGS_NAME)); + setCategoryIconPath(":/projectexplorer/images/settingscategory_cpp.png"); + setSettingsProvider([] { return &codeGenSettings(); }); + } +}; -void CodeGenSettings::fromSettings(const QSettings *settings) -{ - QString group = QLatin1String(CODE_GEN_GROUP) + '/'; +const CodeGenSettingsPage settingsPage; - retranslationSupport = settings->value(group + TRANSLATION_KEY, retranslationSupportDefault) - .toBool(); - embedding = static_cast<UiClassEmbedding>( - settings->value(group + EMBEDDING_KEY, int(embeddingDefault)).toInt()); - includeQtModule = settings->value(group + INCLUDE_QT_MODULE_KEY, includeQtModuleDefault).toBool(); - addQtVersionCheck = settings->value(group + ADD_QT_VERSION_CHECK_KEY, addQtVersionCheckDefault).toBool(); -} - -void CodeGenSettings::toSettings(QSettings *settings) const -{ - settings->beginGroup(CODE_GEN_GROUP); - QtcSettings::setValueWithDefault(settings, - TRANSLATION_KEY, - retranslationSupport, - retranslationSupportDefault); - QtcSettings::setValueWithDefault(settings, EMBEDDING_KEY, int(embedding), int(embeddingDefault)); - QtcSettings::setValueWithDefault(settings, - INCLUDE_QT_MODULE_KEY, - includeQtModule, - includeQtModuleDefault); - QtcSettings::setValueWithDefault(settings, - ADD_QT_VERSION_CHECK_KEY, - addQtVersionCheck, - addQtVersionCheckDefault); - settings->endGroup(); - -} - -} // namespace QtSupport +} // QtSupport diff --git a/src/plugins/qtsupport/codegensettings.h b/src/plugins/qtsupport/codegensettings.h index a247ea43483..e9ab3fb459e 100644 --- a/src/plugins/qtsupport/codegensettings.h +++ b/src/plugins/qtsupport/codegensettings.h @@ -5,15 +5,15 @@ #include "qtsupport_global.h" -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +#include <utils/aspects.h> namespace QtSupport { -class QTSUPPORT_EXPORT CodeGenSettings +class QTSUPPORT_EXPORT CodeGenSettings : public Utils::AspectContainer { public: + CodeGenSettings(); + // How to embed the Ui::Form class. enum UiClassEmbedding { @@ -22,19 +22,12 @@ public: InheritedUiClass // "...private Ui::Form..." }; - CodeGenSettings(); - bool equals(const CodeGenSettings &rhs) const; - - void fromSettings(const QSettings *settings); - void toSettings(QSettings *settings) const; - - friend bool operator==(const CodeGenSettings &p1, const CodeGenSettings &p2) { return p1.equals(p2); } - friend bool operator!=(const CodeGenSettings &p1, const CodeGenSettings &p2) { return !p1.equals(p2); } - - UiClassEmbedding embedding; - bool retranslationSupport; // Add handling for language change events - bool includeQtModule; // Include "<QtGui/[Class]>" or just "<[Class]>" - bool addQtVersionCheck; // Include #ifdef when using "#include <QtGui/..." + Utils::SelectionAspect embedding{this}; + Utils::BoolAspect retranslationSupport{this}; // Add handling for language change events + Utils::BoolAspect includeQtModule{this}; // Include "<QtGui/[Class]>" or just "<[Class]>" + Utils::BoolAspect addQtVersionCheck{this}; // Include #ifdef when using "#include <QtGui/..." }; +QTSUPPORT_EXPORT CodeGenSettings &codeGenSettings(); + } // namespace QtSupport diff --git a/src/plugins/qtsupport/codegensettingspage.cpp b/src/plugins/qtsupport/codegensettingspage.cpp deleted file mode 100644 index 4a30e5f969f..00000000000 --- a/src/plugins/qtsupport/codegensettingspage.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "codegensettingspage.h" - -#include "codegensettings.h" -#include "qtsupportconstants.h" -#include "qtsupporttr.h" - -#include <coreplugin/icore.h> - -#include <cppeditor/cppeditorconstants.h> -#include <cppeditor/cppeditortr.h> - -#include <utils/layoutbuilder.h> - -#include <QCheckBox> -#include <QRadioButton> - -namespace QtSupport::Internal { - -class CodeGenSettingsPageWidget : public Core::IOptionsPageWidget -{ -public: - CodeGenSettingsPageWidget(); - -private: - void apply() final; - - int uiEmbedding() const; - - QRadioButton *m_ptrAggregationRadioButton; - QRadioButton *m_aggregationButton; - QRadioButton *m_multipleInheritanceButton; - QCheckBox *m_retranslateCheckBox; - QCheckBox *m_includeQtModuleCheckBox; - QCheckBox *m_addQtVersionCheckBox; -}; - -CodeGenSettingsPageWidget::CodeGenSettingsPageWidget() -{ - CodeGenSettings parameters; - parameters.fromSettings(Core::ICore::settings()); - - using namespace Layouting; - - m_ptrAggregationRadioButton = new QRadioButton(Tr::tr("Aggregation as a pointer member")); - m_ptrAggregationRadioButton->setChecked - (parameters.embedding == CodeGenSettings::PointerAggregatedUiClass); - - m_aggregationButton = new QRadioButton(Tr::tr("Aggregation")); - m_aggregationButton->setChecked - (parameters.embedding == CodeGenSettings::AggregatedUiClass); - - m_multipleInheritanceButton = new QRadioButton(Tr::tr("Multiple inheritance")); - m_multipleInheritanceButton->setChecked - (parameters.embedding == CodeGenSettings::InheritedUiClass); - - m_retranslateCheckBox = new QCheckBox(Tr::tr("Support for changing languages at runtime")); - m_retranslateCheckBox->setChecked(parameters.retranslationSupport); - - m_includeQtModuleCheckBox = new QCheckBox(Tr::tr("Use Qt module name in #include-directive")); - m_includeQtModuleCheckBox->setChecked(parameters.includeQtModule); - - m_addQtVersionCheckBox = new QCheckBox(Tr::tr("Add Qt version #ifdef for module names")); - m_addQtVersionCheckBox->setChecked(parameters.addQtVersionCheck); - m_addQtVersionCheckBox->setEnabled(false); - - Column { - Group { - title(Tr::tr("Embedding of the UI Class")), - Column { - m_ptrAggregationRadioButton, - m_aggregationButton, - m_multipleInheritanceButton - } - }, - Group { - title(Tr::tr("Code Generation")), - Column { - m_retranslateCheckBox, - m_includeQtModuleCheckBox, - m_addQtVersionCheckBox - } - }, - st - }.attachTo(this); - - connect(m_includeQtModuleCheckBox, &QAbstractButton::toggled, - m_addQtVersionCheckBox, &QWidget::setEnabled); -} - -void CodeGenSettingsPageWidget::apply() -{ - CodeGenSettings rc; - rc.embedding = static_cast<CodeGenSettings::UiClassEmbedding>(uiEmbedding()); - rc.retranslationSupport = m_retranslateCheckBox->isChecked(); - rc.includeQtModule = m_includeQtModuleCheckBox->isChecked(); - rc.addQtVersionCheck = m_addQtVersionCheckBox->isChecked(); - rc.toSettings(Core::ICore::settings()); -} - -int CodeGenSettingsPageWidget::uiEmbedding() const -{ - if (m_ptrAggregationRadioButton->isChecked()) - return CodeGenSettings::PointerAggregatedUiClass; - if (m_aggregationButton->isChecked()) - return CodeGenSettings::AggregatedUiClass; - return CodeGenSettings::InheritedUiClass; -} - -// ---------- CodeGenSettingsPage - -CodeGenSettingsPage::CodeGenSettingsPage() -{ - setId(Constants::CODEGEN_SETTINGS_PAGE_ID); - setDisplayName(Tr::tr("Qt Class Generation")); - setCategory(CppEditor::Constants::CPP_SETTINGS_CATEGORY); - setDisplayCategory(::CppEditor::Tr::tr(CppEditor::Constants::CPP_SETTINGS_NAME)); - setCategoryIconPath(":/projectexplorer/images/settingscategory_cpp.png"); - setWidgetCreator([] { return new CodeGenSettingsPageWidget; }); -} - -} // QtSupport::Internal diff --git a/src/plugins/qtsupport/codegensettingspage.h b/src/plugins/qtsupport/codegensettingspage.h deleted file mode 100644 index 0f8bd4e196e..00000000000 --- a/src/plugins/qtsupport/codegensettingspage.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <coreplugin/dialogs/ioptionspage.h> - -namespace QtSupport::Internal { - -class CodeGenSettingsPage final : public Core::IOptionsPage -{ -public: - CodeGenSettingsPage(); -}; - -} // QtSupport::Internal diff --git a/src/plugins/qtsupport/qtsupport.qbs b/src/plugins/qtsupport/qtsupport.qbs index 864f3d5fdd7..cbfc055644e 100644 --- a/src/plugins/qtsupport/qtsupport.qbs +++ b/src/plugins/qtsupport/qtsupport.qbs @@ -61,8 +61,6 @@ Project { "codegenerator.h", "codegensettings.cpp", "codegensettings.h", - "codegensettingspage.cpp", - "codegensettingspage.h", "externaleditors.cpp", "externaleditors.h", "qtbuildaspects.cpp", diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index 81687eda70e..9a6875f3864 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -4,7 +4,6 @@ #include "qtsupportplugin.h" #include "codegenerator.h" -#include "codegensettingspage.h" #include "externaleditors.h" #include "gettingstartedwelcomepage.h" #include "profilereader.h" @@ -52,7 +51,6 @@ public: DesktopQtVersionFactory desktopQtVersionFactory; EmbeddedLinuxQtVersionFactory embeddedLinuxQtVersionFactory; - CodeGenSettingsPage codeGenSettingsPage; QtOptionsPage qtOptionsPage; ExamplesWelcomePage examplesPage{true}; From 648efd6524dc9bfa9a7e82a5a4d3dabd3e221478 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 24 Aug 2023 10:15:12 +0200 Subject: [PATCH 0863/1777] Utils etc: Even more Key and Store Change-Id: Id2405d8a89c47ea766439eec91db36ed7313eb92 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/fakevim/fakevimactions.cpp | 10 ++++---- src/plugins/fakevim/fakevimactions.h | 23 +++++++++++-------- src/plugins/fakevim/fakevimhandler.cpp | 2 +- src/plugins/fakevim/fakevimhandler.h | 3 +-- .../projectexplorer/buildconfiguration.cpp | 23 +++++++++---------- src/plugins/projectexplorer/buildsteplist.cpp | 4 ++-- .../customwizard/customwizardpage.cpp | 3 ++- .../projectexplorer/deployconfiguration.cpp | 16 ++++++------- .../devicesupport/deviceprocessesdialog.cpp | 2 +- .../projectexplorer/environmentaspect.cpp | 8 +++---- src/plugins/projectexplorer/extraabi.cpp | 11 +++++---- src/plugins/projectexplorer/importwidget.cpp | 2 +- src/plugins/projectexplorer/makestep.cpp | 13 ++++++----- 13 files changed, 62 insertions(+), 58 deletions(-) diff --git a/src/plugins/fakevim/fakevimactions.cpp b/src/plugins/fakevim/fakevimactions.cpp index dca99a23b53..7440257eead 100644 --- a/src/plugins/fakevim/fakevimactions.cpp +++ b/src/plugins/fakevim/fakevimactions.cpp @@ -29,13 +29,13 @@ namespace FakeVim::Internal { #ifdef FAKEVIM_STANDALONE -void FvBaseAspect::setSettingsKey(const QString &group, const QString &key) +void FvBaseAspect::setSettingsKey(const Key &group, const Key &key) { m_settingsGroup = group; m_settingsKey = key; } -QString FvBaseAspect::settingsKey() const +Key FvBaseAspect::settingsKey() const { return m_settingsKey; } @@ -244,14 +244,14 @@ FakeVimSettings::FakeVimSettings() FakeVimSettings::~FakeVimSettings() = default; -FvBaseAspect *FakeVimSettings::item(const QString &name) +FvBaseAspect *FakeVimSettings::item(const Key &name) { return m_nameToAspect.value(name, nullptr); } QString FakeVimSettings::trySetValue(const QString &name, const QString &value) { - FvBaseAspect *aspect = m_nameToAspect.value(name, nullptr); + FvBaseAspect *aspect = m_nameToAspect.value(keyFromString(name), nullptr); if (!aspect) return Tr::tr("Unknown option: %1").arg(name); if (aspect == &tabStop || aspect == &shiftWidth) { @@ -266,7 +266,7 @@ QString FakeVimSettings::trySetValue(const QString &name, const QString &value) void FakeVimSettings::setup(FvBaseAspect *aspect, const QVariant &value, const Key &settingsKey, - const QString &shortName, + const Key &shortName, const QString &labelText) { aspect->setSettingsKey("FakeVim", settingsKey); diff --git a/src/plugins/fakevim/fakevimactions.h b/src/plugins/fakevim/fakevimactions.h index 18baecafecf..29d4bbd7052 100644 --- a/src/plugins/fakevim/fakevimactions.h +++ b/src/plugins/fakevim/fakevimactions.h @@ -24,6 +24,13 @@ namespace Utils { class FilePath {}; } namespace FakeVim::Internal { #ifdef FAKEVIM_STANDALONE + +#ifdef QTC_USE_STORE +using Key = QByteArray; +#else +using Key = QString; +#endif + class FvBaseAspect { public: @@ -34,19 +41,15 @@ public: virtual void setDefaultVariantValue(const QVariant &) {} virtual QVariant variantValue() const { return {}; } virtual QVariant defaultVariantValue() const { return {}; } -#ifdef QTC_USE_STORE - void setSettingsKey(const QString &group, const QByteArray &key); -#else - void setSettingsKey(const QString &group, const QString &key); -#endif - QString settingsKey() const; + void setSettingsKey(const Key &group, const Key &key); + Key settingsKey() const; void setCheckable(bool) {} void setDisplayName(const QString &) {} void setToolTip(const QString &) {} private: - QString m_settingsGroup; - QString m_settingsKey; + Key m_settingsGroup; + Key m_settingsKey; }; template <class ValueType> @@ -104,7 +107,7 @@ public: FakeVimSettings(); ~FakeVimSettings(); - FvBaseAspect *item(const QString &name); + FvBaseAspect *item(const Utils::Key &name); QString trySetValue(const QString &name, const QString &value); FvBoolAspect useFakeVim; @@ -161,7 +164,7 @@ public: private: void setup(FvBaseAspect *aspect, const QVariant &value, const Utils::Key &settingsKey, - const QString &shortName, + const Utils::Key &shortName, const QString &label); QHash<Utils::Key, FvBaseAspect *> m_nameToAspect; diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 8a9adac4415..4a5d8e0415b 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -6125,7 +6125,7 @@ bool FakeVimHandler::Private::handleExSetCommand(const ExCommand &cmd) if (!error.isEmpty()) showMessage(MessageError, error); } else { - QString optionName = cmd.args; + Utils::Key optionName = Utils::keyFromString(cmd.args); bool toggleOption = optionName.endsWith('!'); bool printOption = !toggleOption && optionName.endsWith('?'); diff --git a/src/plugins/fakevim/fakevimhandler.h b/src/plugins/fakevim/fakevimhandler.h index 0b615e1657e..4532fa374cf 100644 --- a/src/plugins/fakevim/fakevimhandler.h +++ b/src/plugins/fakevim/fakevimhandler.h @@ -38,8 +38,7 @@ struct Range struct ExCommand { ExCommand() = default; - ExCommand(const QString &cmd, const QString &args = QString(), - const Range &range = Range()); + ExCommand(const QString &cmd, const QString &args = {}, const Range &range = {}); bool matches(const QString &min, const QString &full) const; diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 9284fa572b6..35c2314359f 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -376,22 +376,21 @@ void BuildConfiguration::toMap(Store &map) const { ProjectConfiguration::toMap(map); - map.insert(QLatin1String(Constants::CLEAR_SYSTEM_ENVIRONMENT_KEY), d->m_clearSystemEnvironment); - map.insert(QLatin1String(Constants::USER_ENVIRONMENT_CHANGES_KEY), + map.insert(Constants::CLEAR_SYSTEM_ENVIRONMENT_KEY, d->m_clearSystemEnvironment); + map.insert(Constants::USER_ENVIRONMENT_CHANGES_KEY, EnvironmentItem::toStringList(d->m_userEnvironmentChanges)); - map.insert(QLatin1String(BUILD_STEP_LIST_COUNT), 2); - map.insert(QLatin1String(BUILD_STEP_LIST_PREFIX) + QString::number(0), d->m_buildSteps.toMap()); - map.insert(QLatin1String(BUILD_STEP_LIST_PREFIX) + QString::number(1), d->m_cleanSteps.toMap()); + map.insert(BUILD_STEP_LIST_COUNT, 2); + map.insert(BUILD_STEP_LIST_PREFIX + Key::number(0), QVariant::fromValue(d->m_buildSteps.toMap())); + map.insert(BUILD_STEP_LIST_PREFIX + Key::number(1), QVariant::fromValue(d->m_cleanSteps.toMap())); map.insert(PARSE_STD_OUT_KEY, d->m_parseStdOut); - map.insert(CUSTOM_PARSERS_KEY, transform(d->m_customParsers,&Utils::Id::toSetting)); + map.insert(CUSTOM_PARSERS_KEY, transform(d->m_customParsers, &Id::toSetting)); } void BuildConfiguration::fromMap(const Store &map) { - d->m_clearSystemEnvironment = map.value(QLatin1String(Constants::CLEAR_SYSTEM_ENVIRONMENT_KEY)) - .toBool(); + d->m_clearSystemEnvironment = map.value(Constants::CLEAR_SYSTEM_ENVIRONMENT_KEY).toBool(); d->m_userEnvironmentChanges = EnvironmentItem::fromStringList( map.value(Constants::USER_ENVIRONMENT_CHANGES_KEY).toStringList()); @@ -400,14 +399,14 @@ void BuildConfiguration::fromMap(const Store &map) d->m_buildSteps.clear(); d->m_cleanSteps.clear(); - int maxI = map.value(QLatin1String(BUILD_STEP_LIST_COUNT), 0).toInt(); + int maxI = map.value(BUILD_STEP_LIST_COUNT, 0).toInt(); for (int i = 0; i < maxI; ++i) { - QVariantMap data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QString::number(i)).toMap(); + Store data = map.value(BUILD_STEP_LIST_PREFIX + Key::number(i)).value<Store>(); if (data.isEmpty()) { qWarning() << "No data for build step list" << i << "found!"; continue; } - Utils::Id id = idFromMap(data); + Id id = idFromMap(data); if (id == Constants::BUILDSTEPS_BUILD) { if (!d->m_buildSteps.fromMap(data)) qWarning() << "Failed to restore build step list"; @@ -420,7 +419,7 @@ void BuildConfiguration::fromMap(const Store &map) } d->m_parseStdOut = map.value(PARSE_STD_OUT_KEY).toBool(); - d->m_customParsers = transform(map.value(CUSTOM_PARSERS_KEY).toList(), &Utils::Id::fromSetting); + d->m_customParsers = transform(map.value(CUSTOM_PARSERS_KEY).toList(), &Id::fromSetting); ProjectConfiguration::fromMap(map); setToolTip(d->m_tooltipAspect()); diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index 805c1fcf5b6..d624fd5ad9f 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -62,7 +62,7 @@ Store BuildStepList::toMap() const for (int i = 0; i < m_steps.count(); ++i) { Store data; m_steps.at(i)->toMap(data); - map.insert(STEPS_PREFIX + Key::number(i), data); + map.insert(STEPS_PREFIX + Key::number(i), QVariant::fromValue(data)); } return map; @@ -111,7 +111,7 @@ bool BuildStepList::fromMap(const Store &map) int maxSteps = map.value(STEPS_COUNT_KEY, 0).toInt(); for (int i = 0; i < maxSteps; ++i) { - Store bsData(map.value(STEPS_PREFIX + Key::number(i)).toMap()); + Store bsData(map.value(STEPS_PREFIX + Key::number(i)).value<Store>()); if (bsData.isEmpty()) { qWarning() << "No step data found for" << i << "(continuing)."; continue; diff --git a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp index 1e574b4815f..7cfe6faba4f 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp @@ -225,7 +225,8 @@ QWidget *CustomWizardFieldPage::registerPathChooser(const QString &fieldName, pathChooser->setExpectedKind(PathChooser::Command); else if (expectedKind == QLatin1String("any")) pathChooser->setExpectedKind(PathChooser::Any); - pathChooser->setHistoryCompleter("PE.Custom." + m_parameters->id.name() + '.' + field.name); + pathChooser->setHistoryCompleter("PE.Custom." + m_parameters->id.name() + + '.' + keyFromString(field.name)); registerField(fieldName, pathChooser, "path", SIGNAL(rawPathChanged(QString))); // Connect to completeChanged() for derived classes that reimplement isComplete() diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp index a5e8d16738c..39a0c08bcea 100644 --- a/src/plugins/projectexplorer/deployconfiguration.cpp +++ b/src/plugins/projectexplorer/deployconfiguration.cpp @@ -53,15 +53,15 @@ QWidget *DeployConfiguration::createConfigWidget() void DeployConfiguration::toMap(Store &map) const { ProjectConfiguration::toMap(map); - map.insert(QLatin1String(BUILD_STEP_LIST_COUNT), 1); - map.insert(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1Char('0'), m_stepList.toMap()); + map.insert(BUILD_STEP_LIST_COUNT, 1); + map.insert(Key(BUILD_STEP_LIST_PREFIX) + '0', QVariant::fromValue(m_stepList.toMap())); map.insert(USES_DEPLOYMENT_DATA, usesCustomDeploymentData()); Store deployData; for (int i = 0; i < m_customDeploymentData.fileCount(); ++i) { const DeployableFile &f = m_customDeploymentData.fileAt(i); - deployData.insert(f.localFilePath().toString(), f.remoteDirectory()); + deployData.insert(keyFromString(f.localFilePath().toString()), f.remoteDirectory()); } - map.insert(DEPLOYMENT_DATA, deployData); + map.insert(DEPLOYMENT_DATA, QVariant::fromValue(deployData)); } void DeployConfiguration::fromMap(const Store &map) @@ -70,12 +70,12 @@ void DeployConfiguration::fromMap(const Store &map) if (hasError()) return; - int maxI = map.value(QLatin1String(BUILD_STEP_LIST_COUNT), 0).toInt(); + int maxI = map.value(BUILD_STEP_LIST_COUNT, 0).toInt(); if (maxI != 1) { reportError(); return; } - Store data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QLatin1Char('0')).toMap(); + Store data = map.value(Key(BUILD_STEP_LIST_PREFIX) + '0').value<Store>(); if (!data.isEmpty()) { m_stepList.clear(); if (!m_stepList.fromMap(data)) { @@ -91,9 +91,9 @@ void DeployConfiguration::fromMap(const Store &map) } m_usesCustomDeploymentData = map.value(USES_DEPLOYMENT_DATA, false).toBool(); - const Store deployData = map.value(DEPLOYMENT_DATA).toMap(); + const Store deployData = map.value(DEPLOYMENT_DATA).value<Store>(); for (auto it = deployData.begin(); it != deployData.end(); ++it) - m_customDeploymentData.addFile(FilePath::fromString(it.key()), it.value().toString()); + m_customDeploymentData.addFile(FilePath::fromString(stringFromKey(it.key())), it.value().toString()); } bool DeployConfiguration::isActive() const diff --git a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp index 2c5acf105b2..7aad3a4e1cf 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp @@ -111,7 +111,7 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(KitChooser *chooser, processFilterLineEdit = new FancyLineEdit(q); processFilterLineEdit->setPlaceholderText(Tr::tr("Filter")); processFilterLineEdit->setFocus(Qt::TabFocusReason); - processFilterLineEdit->setHistoryCompleter(QLatin1String("DeviceProcessDialogFilter"), + processFilterLineEdit->setHistoryCompleter("DeviceProcessDialogFilter", true /*restoreLastItemFromHistory*/); processFilterLineEdit->setFiltering(true); diff --git a/src/plugins/projectexplorer/environmentaspect.cpp b/src/plugins/projectexplorer/environmentaspect.cpp index a083e545a3c..89d75e36195 100644 --- a/src/plugins/projectexplorer/environmentaspect.cpp +++ b/src/plugins/projectexplorer/environmentaspect.cpp @@ -135,15 +135,15 @@ void EnvironmentAspect::setSupportForBuildEnvironment(Target *target) void EnvironmentAspect::fromMap(const Store &map) { - m_base = map.value(QLatin1String(BASE_KEY), -1).toInt(); - m_userChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(CHANGES_KEY)).toStringList()); + m_base = map.value(BASE_KEY, -1).toInt(); + m_userChanges = EnvironmentItem::fromStringList(map.value(CHANGES_KEY).toStringList()); m_printOnRun = map.value(PRINT_ON_RUN_KEY).toBool(); } void EnvironmentAspect::toMap(Store &data) const { - data.insert(QLatin1String(BASE_KEY), m_base); - data.insert(QLatin1String(CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_userChanges)); + data.insert(BASE_KEY, m_base); + data.insert(CHANGES_KEY, EnvironmentItem::toStringList(m_userChanges)); data.insert(PRINT_ON_RUN_KEY, m_printOnRun); } diff --git a/src/plugins/projectexplorer/extraabi.cpp b/src/plugins/projectexplorer/extraabi.cpp index 48a8b325e4f..baf7bd49b8b 100644 --- a/src/plugins/projectexplorer/extraabi.cpp +++ b/src/plugins/projectexplorer/extraabi.cpp @@ -8,7 +8,8 @@ #include <coreplugin/icore.h> #include <utils/algorithm.h> -#include <utils/fileutils.h> +#include <utils/filepath.h> +#include <utils/settingsaccessor.h> #include <utils/settingsaccessor.h> #include <QDebug> @@ -28,7 +29,7 @@ class AbiFlavorUpgraderV0 : public VersionUpgrader public: AbiFlavorUpgraderV0() : VersionUpgrader(0, "") { } - QVariantMap upgrade(const QVariantMap &data) override { return data; } + Store upgrade(const Store &data) override { return data; } }; class AbiFlavorAccessor : public UpgradingSettingsAccessor @@ -51,9 +52,9 @@ public: void ExtraAbi::load() { AbiFlavorAccessor accessor; - const QVariantMap data = accessor.restoreSettings(Core::ICore::dialogParent()).value("Flavors").toMap(); + const Store data = accessor.restoreSettings(Core::ICore::dialogParent()).value("Flavors").value<Store>(); for (auto it = data.constBegin(); it != data.constEnd(); ++it) { - const QString flavor = it.key(); + const Key flavor = it.key(); if (flavor.isEmpty()) continue; @@ -67,7 +68,7 @@ void ExtraAbi::load() oses.push_back(os); } - Abi::registerOsFlavor(oses, flavor); + Abi::registerOsFlavor(oses, stringFromKey(flavor)); } } diff --git a/src/plugins/projectexplorer/importwidget.cpp b/src/plugins/projectexplorer/importwidget.cpp index 623476b6748..1aa6064dc59 100644 --- a/src/plugins/projectexplorer/importwidget.cpp +++ b/src/plugins/projectexplorer/importwidget.cpp @@ -36,7 +36,7 @@ ImportWidget::ImportWidget(QWidget *parent) : layout->addWidget(m_pathChooser); m_pathChooser->setExpectedKind(Utils::PathChooser::ExistingDirectory); - m_pathChooser->setHistoryCompleter(QLatin1String("Import.SourceDir.History")); + m_pathChooser->setHistoryCompleter("Import.SourceDir.History"); auto importButton = new QPushButton(Tr::tr("Import"), widget); layout->addWidget(importButton); diff --git a/src/plugins/projectexplorer/makestep.cpp b/src/plugins/projectexplorer/makestep.cpp index 8f7f82da8f2..78b038681e9 100644 --- a/src/plugins/projectexplorer/makestep.cpp +++ b/src/plugins/projectexplorer/makestep.cpp @@ -47,23 +47,24 @@ MakeStep::MakeStep(BuildStepList *parent, Id id) setCommandLineProvider([this] { return effectiveMakeCommand(Execution); }); - m_makeCommandAspect.setSettingsKey(id.withSuffix(MAKE_COMMAND_SUFFIX).toString()); + // FIXME: Replace with id.name() + MAKE_COMMAND_SUFFIX after the Key/Store transition + m_makeCommandAspect.setSettingsKey(keyFromString(id.withSuffix(MAKE_COMMAND_SUFFIX).toString())); m_makeCommandAspect.setExpectedKind(PathChooser::ExistingCommand); m_makeCommandAspect.setBaseFileName(PathChooser::homePath()); m_makeCommandAspect.setHistoryCompleter("PE.MakeCommand.History"); - m_userArgumentsAspect.setSettingsKey(id.withSuffix(MAKE_ARGUMENTS_SUFFIX).toString()); + m_userArgumentsAspect.setSettingsKey(keyFromString(id.withSuffix(MAKE_ARGUMENTS_SUFFIX).toString())); m_userArgumentsAspect.setLabelText(Tr::tr("Make arguments:")); m_userArgumentsAspect.setDisplayStyle(StringAspect::LineEditDisplay); - m_jobCountAspect.setSettingsKey(id.withSuffix(JOBCOUNT_SUFFIX).toString()); + m_jobCountAspect.setSettingsKey(keyFromString(id.withSuffix(JOBCOUNT_SUFFIX).toString())); m_jobCountAspect.setLabel(Tr::tr("Parallel jobs:")); m_jobCountAspect.setRange(1, 999); m_jobCountAspect.setValue(defaultJobCount()); m_jobCountAspect.setDefaultValue(defaultJobCount()); const QString text = Tr::tr("Override MAKEFLAGS"); - m_overrideMakeflagsAspect.setSettingsKey(id.withSuffix(OVERRIDE_MAKEFLAGS_SUFFIX).toString()); + m_overrideMakeflagsAspect.setSettingsKey(keyFromString(id.withSuffix(OVERRIDE_MAKEFLAGS_SUFFIX).toString())); m_overrideMakeflagsAspect.setLabel(text, BoolAspect::LabelPlacement::AtCheckBox); m_nonOverrideWarning.setText("<html><body><p>" + @@ -71,11 +72,11 @@ MakeStep::MakeStep(BuildStepList *parent, Id id) .arg(text) + "</p></body></html>"); m_nonOverrideWarning.setIconType(InfoLabel::Warning); - m_disabledForSubdirsAspect.setSettingsKey(id.withSuffix(".disabledForSubdirs").toString()); + m_disabledForSubdirsAspect.setSettingsKey(keyFromString(id.withSuffix(".disabledForSubdirs").toString())); m_disabledForSubdirsAspect.setLabel(Tr::tr("Disable in subdirectories:")); m_disabledForSubdirsAspect.setToolTip(Tr::tr("Runs this step only for a top-level build.")); - m_buildTargetsAspect.setSettingsKey(id.withSuffix(BUILD_TARGETS_SUFFIX).toString()); + m_buildTargetsAspect.setSettingsKey(keyFromString(id.withSuffix(BUILD_TARGETS_SUFFIX).toString())); m_buildTargetsAspect.setLabelText(Tr::tr("Targets:")); const auto updateMakeLabel = [this] { From b9f9d2574e9e3b7f14af47af6a4180b77b78f726 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 24 Aug 2023 16:14:26 +0200 Subject: [PATCH 0864/1777] Utils/ProjectExplorer: More Key and Store Change-Id: Ic9cc3a36b320c7413c362d1a1cdf024298d25027 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/settingsutils.h | 2 +- src/libs/utils/store.cpp | 13 ++-- src/libs/utils/store.h | 3 +- src/plugins/coreplugin/session.cpp | 2 +- src/plugins/projectexplorer/msvctoolchain.cpp | 17 ++-- src/plugins/projectexplorer/project.cpp | 38 ++++----- .../projectexplorer/projectmanager.cpp | 7 +- src/plugins/projectexplorer/runcontrol.cpp | 10 +-- src/plugins/projectexplorer/runcontrol.h | 6 +- .../projectexplorer/selectablefilesmodel.cpp | 6 +- .../projectexplorer/selectablefilesmodel.h | 5 +- src/plugins/projectexplorer/target.cpp | 8 +- src/plugins/projectexplorer/toolchain.cpp | 30 +++---- src/plugins/projectexplorer/toolchain.h | 12 +-- .../toolchainsettingsaccessor.cpp | 14 ++-- .../toolchainsettingsaccessor.h | 2 +- .../projectexplorer/userfileaccessor.cpp | 78 +++++++++---------- .../projectexplorer/userfileaccessor.h | 3 +- 18 files changed, 130 insertions(+), 126 deletions(-) diff --git a/src/libs/utils/settingsutils.h b/src/libs/utils/settingsutils.h index f2efa39de2e..694d17503dd 100644 --- a/src/libs/utils/settingsutils.h +++ b/src/libs/utils/settingsutils.h @@ -19,7 +19,7 @@ void fromSettings(const Key &postFix, { Store map; s->beginGroup(category + postFix); - const KeyList keys = keyListFromStringList(s->allKeys()); + const KeyList keys = keysFromStrings(s->allKeys()); for (const Key &key : keys) map.insert(key, s->value(key)); s->endGroup(); diff --git a/src/libs/utils/store.cpp b/src/libs/utils/store.cpp index 8775bce4ab1..0fa2857742f 100644 --- a/src/libs/utils/store.cpp +++ b/src/libs/utils/store.cpp @@ -7,13 +7,14 @@ namespace Utils { -KeyList keyListFromStringList(const QStringList &list) +KeyList keysFromStrings(const QStringList &list) { -#ifdef QTC_USE_STORE - return transform(list, [](const QString &str) { return str.toUtf8(); }); -#else - return list; -#endif + return transform(list, &keyFromString); +} + +QStringList stringsFromKeys(const KeyList &list) +{ + return transform(list, &stringFromKey); } } // Utils diff --git a/src/libs/utils/store.h b/src/libs/utils/store.h index 2a4663a07f3..fdb4b36b301 100644 --- a/src/libs/utils/store.h +++ b/src/libs/utils/store.h @@ -18,6 +18,7 @@ using Store = QMap<Key, QVariant>; using Store = QVariantMap; #endif -QTCREATOR_UTILS_EXPORT KeyList keyListFromStringList(const QStringList &list); +QTCREATOR_UTILS_EXPORT KeyList keysFromStrings(const QStringList &list); +QTCREATOR_UTILS_EXPORT QStringList stringsFromKeys(const KeyList &list); } // Utils diff --git a/src/plugins/coreplugin/session.cpp b/src/plugins/coreplugin/session.cpp index 67b09d0ac45..2ad04e71fb3 100644 --- a/src/plugins/coreplugin/session.cpp +++ b/src/plugins/coreplugin/session.cpp @@ -488,7 +488,7 @@ void SessionManagerPrivate::updateSessionMenu() void SessionManagerPrivate::restoreValues(const PersistentSettingsReader &reader) { - const KeyList keys = keyListFromStringList(reader.restoreValue("valueKeys").toStringList()); + const KeyList keys = keysFromStrings(reader.restoreValue("valueKeys").toStringList()); for (const Key &key : keys) { QVariant value = reader.restoreValue("value-" + key); m_values.insert(key, value); diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index e8f3292217a..ad73c5e041d 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -981,12 +981,11 @@ Abis MsvcToolChain::supportedAbis() const void MsvcToolChain::toMap(Store &data) const { ToolChain::toMap(data); - data.insert(QLatin1String(varsBatKeyC), m_vcvarsBat); + data.insert(varsBatKeyC, m_vcvarsBat); if (!m_varsBatArg.isEmpty()) - data.insert(QLatin1String(varsBatArgKeyC), m_varsBatArg); - Utils::EnvironmentItem::sort(&m_environmentModifications); - data.insert(QLatin1String(environModsKeyC), - Utils::EnvironmentItem::toVariantList(m_environmentModifications)); + data.insert(varsBatArgKeyC, m_varsBatArg); + EnvironmentItem::sort(&m_environmentModifications); + data.insert(environModsKeyC, EnvironmentItem::toVariantList(m_environmentModifications)); } void MsvcToolChain::fromMap(const Store &data) @@ -996,11 +995,11 @@ void MsvcToolChain::fromMap(const Store &data) g_availableMsvcToolchains.removeOne(this); return; } - m_vcvarsBat = QDir::fromNativeSeparators(data.value(QLatin1String(varsBatKeyC)).toString()); - m_varsBatArg = data.value(QLatin1String(varsBatArgKeyC)).toString(); + m_vcvarsBat = QDir::fromNativeSeparators(data.value(varsBatKeyC).toString()); + m_varsBatArg = data.value(varsBatArgKeyC).toString(); - m_environmentModifications = Utils::EnvironmentItem::itemsFromVariantList( - data.value(QLatin1String(environModsKeyC)).toList()); + m_environmentModifications = EnvironmentItem::itemsFromVariantList( + data.value(environModsKeyC).toList()); rescanForCompiler(); initEnvModWatcher(Utils::asyncRun(envModThreadPool(), &MsvcToolChain::environmentModifications, diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index e47a26a3dfb..a41f9b0be5d 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -184,7 +184,7 @@ public: Target *m_activeTarget = nullptr; EditorConfiguration m_editorConfiguration; Context m_projectLanguages; - QVariantMap m_pluginSettings; + Store m_pluginSettings; std::unique_ptr<Internal::UserFileAccessor> m_accessor; QHash<Id, QPair<QString, std::function<void()>>> m_generators; @@ -194,7 +194,7 @@ public: FilePath m_rootProjectDirectory; mutable QVector<const Node *> m_sortedNodeList; - QVariantMap m_extraData; + Store m_extraData; }; ProjectPrivate::~ProjectPrivate() @@ -635,7 +635,7 @@ void Project::saveSettings() if (!d->m_accessor) d->m_accessor = std::make_unique<Internal::UserFileAccessor>(this); if (!targets().isEmpty()) { - QVariantMap map; + Store map; toMap(map); d->m_accessor->saveSettings(map, ICore::dialogParent()); } @@ -645,7 +645,7 @@ Project::RestoreResult Project::restoreSettings(QString *errorMessage) { if (!d->m_accessor) d->m_accessor = std::make_unique<Internal::UserFileAccessor>(this); - QVariantMap map(d->m_accessor->restoreSettings(ICore::dialogParent())); + Store map(d->m_accessor->restoreSettings(ICore::dialogParent())); RestoreResult result = fromMap(map, errorMessage); if (result == RestoreResult::Ok) emit settingsLoaded(); @@ -681,7 +681,7 @@ FilePaths Project::files(const NodeMatcher &filter) const } /*! - Serializes all data into a QVariantMap. + Serializes all data into a Store. This map is then saved in the .user file of the project. Just put all your data into the map. @@ -695,14 +695,14 @@ void Project::toMap(Store &map) const { const QList<Target *> ts = targets(); - map.insert(QLatin1String(ACTIVE_TARGET_KEY), ts.indexOf(d->m_activeTarget)); - map.insert(QLatin1String(TARGET_COUNT_KEY), ts.size()); + map.insert(ACTIVE_TARGET_KEY, ts.indexOf(d->m_activeTarget)); + map.insert(TARGET_COUNT_KEY, ts.size()); for (int i = 0; i < ts.size(); ++i) - map.insert(QString::fromLatin1(TARGET_KEY_PREFIX) + QString::number(i), ts.at(i)->toMap()); + map.insert(TARGET_KEY_PREFIX + Key::number(i), QVariant::fromValue(ts.at(i)->toMap())); - map.insert(QLatin1String(EDITOR_SETTINGS_KEY), d->m_editorConfiguration.toMap()); + map.insert(EDITOR_SETTINGS_KEY, QVariant::fromValue(d->m_editorConfiguration.toMap())); if (!d->m_pluginSettings.isEmpty()) - map.insert(QLatin1String(PLUGIN_SETTINGS_KEY), d->m_pluginSettings); + map.insert(PLUGIN_SETTINGS_KEY, QVariant::fromValue(d->m_pluginSettings)); } /*! @@ -767,19 +767,19 @@ ContainerNode *Project::containerNode() const Project::RestoreResult Project::fromMap(const Store &map, QString *errorMessage) { Q_UNUSED(errorMessage) - if (map.contains(QLatin1String(EDITOR_SETTINGS_KEY))) { - QVariantMap values(map.value(QLatin1String(EDITOR_SETTINGS_KEY)).toMap()); + if (map.contains(EDITOR_SETTINGS_KEY)) { + Store values(map.value(EDITOR_SETTINGS_KEY).value<Store>()); d->m_editorConfiguration.fromMap(values); } - if (map.contains(QLatin1String(PLUGIN_SETTINGS_KEY))) - d->m_pluginSettings = map.value(QLatin1String(PLUGIN_SETTINGS_KEY)).toMap(); + if (map.contains(PLUGIN_SETTINGS_KEY)) + d->m_pluginSettings = map.value(PLUGIN_SETTINGS_KEY).toMap(); bool ok; - int maxI(map.value(QLatin1String(TARGET_COUNT_KEY), 0).toInt(&ok)); + int maxI(map.value(TARGET_COUNT_KEY, 0).toInt(&ok)); if (!ok || maxI < 0) maxI = 0; - int active(map.value(QLatin1String(ACTIVE_TARGET_KEY), 0).toInt(&ok)); + int active(map.value(ACTIVE_TARGET_KEY, 0).toInt(&ok)); if (!ok || active < 0 || active >= maxI) active = 0; @@ -799,13 +799,13 @@ Project::RestoreResult Project::fromMap(const Store &map, QString *errorMessage) return RestoreResult::Ok; } -void Project::createTargetFromMap(const QVariantMap &map, int index) +void Project::createTargetFromMap(const Store &map, int index) { - const QString key = QString::fromLatin1(TARGET_KEY_PREFIX) + QString::number(index); + const Key key = TARGET_KEY_PREFIX + Key::number(index); if (!map.contains(key)) return; - const QVariantMap targetMap = map.value(key).toMap(); + const Store targetMap = map.value(key).toMap(); Id id = idFromMap(targetMap); if (target(id)) { diff --git a/src/plugins/projectexplorer/projectmanager.cpp b/src/plugins/projectexplorer/projectmanager.cpp index 007efe13332..3f2f9cee749 100644 --- a/src/plugins/projectexplorer/projectmanager.cpp +++ b/src/plugins/projectexplorer/projectmanager.cpp @@ -349,7 +349,7 @@ void ProjectManagerPrivate::saveSession() depMap.insert(key, values); ++i; } - SessionManager::setSessionValue(QLatin1String("ProjectDependencies"), QVariant(depMap)); + SessionManager::setSessionValue("ProjectDependencies", QVariant(depMap)); } /*! @@ -654,7 +654,7 @@ void ProjectManagerPrivate::loadSession() d->m_casadeSetActive = false; // not ideal that this is in ProjectManager - Id modeId = Id::fromSetting(SessionManager::value(QLatin1String("ActiveMode"))); + Id modeId = Id::fromSetting(SessionManager::value("ActiveMode")); if (!modeId.isValid()) modeId = Id(Core::Constants::MODE_EDIT); @@ -705,8 +705,7 @@ FilePaths ProjectManager::projectsForSessionName(const QString &session) return {}; } } - return transform(reader.restoreValue(QLatin1String("ProjectList")).toStringList(), - &FilePath::fromUserInput); + return transform(reader.restoreValue("ProjectList").toStringList(), &FilePath::fromUserInput); } #ifdef WITH_TESTS diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 6624a8b2918..8eb6f5e6ba0 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -202,7 +202,7 @@ public: QList<RunWorker *> stopDependencies; QString id; - QVariantMap data; + Store data; bool supportsReRunning = true; bool essential = false; }; @@ -241,7 +241,7 @@ public: const MacroExpander *macroExpander = nullptr; AspectContainerData aspectData; QString buildKey; - QMap<Id, QVariantMap> settingsData; + QMap<Id, Store> settingsData; Id runConfigId; BuildTargetInfo buildTargetInfo; FilePath buildDirectory; @@ -947,7 +947,7 @@ const BaseAspect::Data *RunControl::aspect(BaseAspect::Data::ClassId classId) co return d->aspectData.aspect(classId); } -QVariantMap RunControl::settingsData(Id id) const +Store RunControl::settingsData(Id id) const { return d->settingsData.value(id); } @@ -1738,12 +1738,12 @@ void RunWorker::setId(const QString &id) d->id = id; } -void RunWorker::recordData(const QString &channel, const QVariant &data) +void RunWorker::recordData(const Key &channel, const QVariant &data) { d->data[channel] = data; } -QVariant RunWorker::recordedData(const QString &channel) const +QVariant RunWorker::recordedData(const Key &channel) const { return d->data[channel]; } diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index b1b9f83cf52..b31aa21fc47 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -54,8 +54,8 @@ public: void setId(const QString &id); - void recordData(const QString &channel, const QVariant &data); - QVariant recordedData(const QString &channel) const; + void recordData(const Utils::Key &channel, const QVariant &data); + QVariant recordedData(const Utils::Key &channel) const; // Part of read-only interface of RunControl for convenience. void appendMessage(const QString &msg, Utils::OutputFormat format, bool appendNewLine = true); @@ -191,7 +191,7 @@ public: Utils::FilePath buildDirectory() const; Utils::Environment buildEnvironment() const; - QVariantMap settingsData(Utils::Id id) const; + Utils::Store settingsData(Utils::Id id) const; Utils::FilePath targetFilePath() const; Utils::FilePath projectFilePath() const; diff --git a/src/plugins/projectexplorer/selectablefilesmodel.cpp b/src/plugins/projectexplorer/selectablefilesmodel.cpp index 4bdc973e1b1..5c34bd1d9b6 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.cpp +++ b/src/plugins/projectexplorer/selectablefilesmodel.cpp @@ -22,6 +22,8 @@ #include <QPushButton> #include <QTreeView> +using namespace Utils; + namespace ProjectExplorer { const char HIDE_FILE_FILTER_DEFAULT[] = "Makefile*; *.o; *.lo; *.la; *.obj; *~; *.files;" @@ -534,7 +536,7 @@ SelectableFilesWidget::SelectableFilesWidget(QWidget *parent) : layout->setContentsMargins(0, 0, 0, 0); m_baseDirLabel->setText(Tr::tr("Source directory:")); - m_baseDirChooser->setHistoryCompleter(QLatin1String("PE.AddToProjectDir.History")); + m_baseDirChooser->setHistoryCompleter("PE.AddToProjectDir.History"); m_startParsingButton->setText(Tr::tr("Start Parsing")); layout->addWidget(m_baseDirLabel, static_cast<int>(SelectableFilesWidgetRows::BaseDirectory), 0); layout->addWidget(m_baseDirChooser->lineEdit(), static_cast<int>(SelectableFilesWidgetRows::BaseDirectory), 1); @@ -638,7 +640,7 @@ void SelectableFilesWidget::cancelParsing() m_model->cancel(); } -void SelectableFilesWidget::enableFilterHistoryCompletion(const QString &keyPrefix) +void SelectableFilesWidget::enableFilterHistoryCompletion(const Key &keyPrefix) { m_selectFilesFilterEdit->setHistoryCompleter(keyPrefix + ".select", true); m_hideFilesFilterEdit->setHistoryCompleter(keyPrefix + ".hide", true); diff --git a/src/plugins/projectexplorer/selectablefilesmodel.h b/src/plugins/projectexplorer/selectablefilesmodel.h index 8c47fbd990b..38553c375ac 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.h +++ b/src/plugins/projectexplorer/selectablefilesmodel.h @@ -5,7 +5,8 @@ #include "projectexplorer_export.h" -#include <utils/fileutils.h> +#include <utils/filepath.h> +#include <utils/storekey.h> #include <QAbstractItemModel> #include <QDialog> @@ -178,7 +179,7 @@ public: void resetModel(const Utils::FilePath &path, const Utils::FilePaths &files); void cancelParsing(); - void enableFilterHistoryCompletion(const QString &keyPrefix); + void enableFilterHistoryCompletion(const Utils::Key &keyPrefix); signals: void selectedFilesChanged(); diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index 54e0ade00b0..b050e11eeb9 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -627,7 +627,7 @@ Store Target::toMap() const } if (!d->m_pluginSettings.isEmpty()) - map.insert(PLUGIN_SETTINGS_KEY, d->m_pluginSettings); + map.insert(PLUGIN_SETTINGS_KEY, QVariant::fromValue(d->m_pluginSettings)); return map; } @@ -903,7 +903,7 @@ bool Target::fromMap(const Store &map) const Key key = BC_KEY_PREFIX + Key::number(i); if (!map.contains(key)) return false; - const Store valueMap = map.value(key).toMap(); + const Store valueMap = map.value(key).value<Store>(); BuildConfiguration *bc = BuildConfigurationFactory::restore(this, valueMap); if (!bc) { qWarning("No factory found to restore build configuration!"); @@ -964,7 +964,7 @@ bool Target::fromMap(const Store &map) if (!rc) continue; const Utils::Id theIdFromMap = ProjectExplorer::idFromMap(valueMap); - if (!theIdFromMap.toString().contains("///::///")) { // Hack for cmake 4.10 -> 4.11 + if (!theIdFromMap.name().contains("///::///")) { // Hack for cmake 4.10 -> 4.11 QTC_CHECK(rc->id().withSuffix(rc->buildKey()) == theIdFromMap); } addRunConfiguration(rc); @@ -973,7 +973,7 @@ bool Target::fromMap(const Store &map) } if (map.contains(PLUGIN_SETTINGS_KEY)) - d->m_pluginSettings = map.value(PLUGIN_SETTINGS_KEY).toMap(); + d->m_pluginSettings = map.value(PLUGIN_SETTINGS_KEY).value<Store>(); return true; } diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 8cbf17f35f4..0c70b0cccb1 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -309,7 +309,7 @@ void ToolChain::setTargetAbiNoSignal(const Abi &abi) d->m_targetAbi = abi; } -void ToolChain::setTargetAbiKey(const QString &abiKey) +void ToolChain::setTargetAbiKey(const Key &abiKey) { d->m_targetAbiKey = abiKey; } @@ -334,7 +334,7 @@ bool ToolChain::matchesCompilerCommand(const FilePath &command) const return compilerCommand().isSameExecutable(command); } -void ToolChain::setCompilerCommandKey(const QString &commandKey) +void ToolChain::setCompilerCommandKey(const Key &commandKey) { d->m_compilerCommandKey = commandKey; } @@ -354,16 +354,16 @@ void ToolChain::fromMap(const Store &data) { AspectContainer::fromMap(data); - d->m_displayName = data.value(QLatin1String(DISPLAY_NAME_KEY)).toString(); + d->m_displayName = data.value(DISPLAY_NAME_KEY).toString(); // make sure we have new style ids: - const QString id = data.value(QLatin1String(ID_KEY)).toString(); + const QString id = data.value(ID_KEY).toString(); int pos = id.indexOf(QLatin1Char(':')); QTC_ASSERT(pos > 0, reportError(); return); d->m_typeId = Id::fromString(id.left(pos)); d->m_id = id.mid(pos + 1).toUtf8(); - const bool autoDetect = data.value(QLatin1String(AUTODETECT_KEY), false).toBool(); + const bool autoDetect = data.value(AUTODETECT_KEY, false).toBool(); d->m_detection = autoDetect ? AutoDetection : ManualDetection; d->m_detectionSource = data.value(DETECTION_SOURCE_KEY).toString(); @@ -372,14 +372,14 @@ void ToolChain::fromMap(const Store &data) if (data.contains(LANGUAGE_KEY_V2)) { // remove hack to trim language id in 4.4: This is to fix up broken language // ids that happened in 4.3 master branch - const QString langId = data.value(QLatin1String(LANGUAGE_KEY_V2)).toString(); + const QString langId = data.value(LANGUAGE_KEY_V2).toString(); const int pos = langId.lastIndexOf('.'); if (pos >= 0) d->m_language = Id::fromString(langId.mid(pos + 1)); else d->m_language = Id::fromString(langId); } else if (data.contains(LANGUAGE_KEY_V1)) { // Import from old settings - d->m_language = Internal::fromLanguageV1(data.value(QLatin1String(LANGUAGE_KEY_V1)).toInt()); + d->m_language = Internal::fromLanguageV1(data.value(LANGUAGE_KEY_V1).toInt()); } if (!d->m_language.isValid()) @@ -612,7 +612,7 @@ ToolChain *ToolChainFactory::restore(const Store &data) static QPair<QString, QString> rawIdData(const Store &data) { - const QString raw = data.value(QLatin1String(ID_KEY)).toString(); + const QString raw = data.value(ID_KEY).toString(); const int pos = raw.indexOf(QLatin1Char(':')); QTC_ASSERT(pos > 0, return qMakePair(QString::fromLatin1("unknown"), QString::fromLatin1("unknown"))); return {raw.mid(0, pos), raw.mid(pos + 1)}; @@ -630,7 +630,7 @@ Id ToolChainFactory::typeIdFromMap(const Store &data) void ToolChainFactory::autoDetectionToMap(Store &data, bool detected) { - data.insert(QLatin1String(AUTODETECT_KEY), detected); + data.insert(AUTODETECT_KEY, detected); } ToolChain *ToolChainFactory::createToolChain(Id toolChainType) @@ -700,9 +700,9 @@ BadToolchain::BadToolchain(const FilePath &filePath, const FilePath &symlinkTarg {} -static QString badToolchainFilePathKey() { return {"FilePath"}; } -static QString badToolchainSymlinkTargetKey() { return {"TargetFilePath"}; } -static QString badToolchainTimestampKey() { return {"Timestamp"}; } +static Key badToolchainFilePathKey() { return {"FilePath"}; } +static Key badToolchainSymlinkTargetKey() { return {"TargetFilePath"}; } +static Key badToolchainTimestampKey() { return {"Timestamp"}; } Store BadToolchain::toMap() const { @@ -737,13 +737,15 @@ bool BadToolchains::isBadToolchain(const FilePath &toolchain) const QVariant BadToolchains::toVariant() const { - return Utils::transform<QVariantList>(toolchains, &BadToolchain::toMap); + return Utils::transform<QVariantList>(toolchains, [](const BadToolchain &bdc) { + return QVariant::fromValue(bdc.toMap()); + }); } BadToolchains BadToolchains::fromVariant(const QVariant &v) { return Utils::transform<QList<BadToolchain>>(v.toList(), - [](const QVariant &e) { return BadToolchain::fromMap(e.toMap()); }); + [](const QVariant &e) { return BadToolchain::fromMap(e.value<Store>()); }); } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 40f619260f5..ddbfff1be7d 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -170,9 +170,9 @@ protected: void setTypeDisplayName(const QString &typeName); void setTargetAbiNoSignal(const Abi &abi); - void setTargetAbiKey(const QString &abiKey); + void setTargetAbiKey(const Utils::Key &abiKey); - void setCompilerCommandKey(const QString &commandKey); + void setCompilerCommandKey(const Utils::Key &commandKey); const MacrosCache &predefinedMacrosCache() const; const HeaderPathsCache &headerPathsCache() const; @@ -265,11 +265,11 @@ public: virtual bool canCreate() const; virtual ToolChain *create() const; - ToolChain *restore(const QVariantMap &data); + ToolChain *restore(const Utils::Store &data); - static QByteArray idFromMap(const QVariantMap &data); - static Utils::Id typeIdFromMap(const QVariantMap &data); - static void autoDetectionToMap(QVariantMap &data, bool detected); + static QByteArray idFromMap(const Utils::Store &data); + static Utils::Id typeIdFromMap(const Utils::Store &data); + static void autoDetectionToMap(Utils::Store &data, bool detected); static ToolChain *createToolChain(Utils::Id toolChainType); diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index 3d369aba3fc..be152de187f 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -34,7 +34,7 @@ public: ToolChainSettingsUpgraderV0() : Utils::VersionUpgrader(0, "4.6") { } // NOOP - QVariantMap upgrade(const QVariantMap &data) final { return data; } + Store upgrade(const Store &data) final { return data; } }; // -------------------------------------------------------------------- @@ -214,17 +214,17 @@ Toolchains ToolChainSettingsAccessor::restoreToolChains(QWidget *parent) const void ToolChainSettingsAccessor::saveToolChains(const Toolchains &toolchains, QWidget *parent) { - QVariantMap data; + Store data; int count = 0; for (const ToolChain *tc : toolchains) { if (!tc || (!tc->isValid() && tc->isAutoDetected())) continue; - QVariantMap tmp; + Store tmp; tc->toMap(tmp); if (tmp.isEmpty()) continue; - data.insert(QString::fromLatin1(TOOLCHAIN_DATA_KEY) + QString::number(count), tmp); + data.insert(TOOLCHAIN_DATA_KEY + Key::number(count), QVariant::fromValue(tmp)); ++count; } data.insert(TOOLCHAIN_COUNT_KEY, count); @@ -234,18 +234,18 @@ void ToolChainSettingsAccessor::saveToolChains(const Toolchains &toolchains, QWi saveSettings(data, parent); } -Toolchains ToolChainSettingsAccessor::toolChains(const QVariantMap &data) const +Toolchains ToolChainSettingsAccessor::toolChains(const Store &data) const { Toolchains result; const QList<ToolChainFactory *> factories = ToolChainFactory::allToolChainFactories(); const int count = data.value(TOOLCHAIN_COUNT_KEY, 0).toInt(); for (int i = 0; i < count; ++i) { - const QString key = QString::fromLatin1(TOOLCHAIN_DATA_KEY) + QString::number(i); + const Key key = TOOLCHAIN_DATA_KEY + Key::number(i); if (!data.contains(key)) break; - const QVariantMap tcMap = data.value(key).toMap(); + const Store tcMap = data.value(key).value<Store>(); bool restored = false; const Utils::Id tcType = ToolChainFactory::typeIdFromMap(tcMap); diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.h b/src/plugins/projectexplorer/toolchainsettingsaccessor.h index 418a6ea3eef..aa2b44bc650 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.h +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.h @@ -23,7 +23,7 @@ public: void saveToolChains(const QList<ToolChain *> &toolchains, QWidget *parent); private: - QList<ToolChain *> toolChains(const QVariantMap &data) const; + QList<ToolChain *> toolChains(const Utils::Store &data) const; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index 568b5af7cf9..7163778ee6d 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -323,9 +323,9 @@ SettingsMergeResult UserFileAccessor::merge(const MergingSettingsAccessor::SettingsMergeData &global, const MergingSettingsAccessor::SettingsMergeData &local) const { - const QStringList stickyKeys = global.main.value(USER_STICKY_KEYS_KEY).toStringList(); + const KeyList stickyKeys = keyFromString(global.main.value(USER_STICKY_KEYS_KEY).toStringList()); - const QString key = local.key; + const Key key = local.key; const QVariant mainValue = local.main.value(key); const QVariant secondaryValue = local.secondary.value(key); @@ -350,11 +350,11 @@ UserFileAccessor::merge(const MergingSettingsAccessor::SettingsMergeData &global // Although this approach is more flexible than permanent/forever sticky settings, it has // the side-effect that if a particular value unintentionally becomes the same in both // the .user and .shared files, this setting will "unstick". -SettingsMergeFunction UserFileAccessor::userStickyTrackerFunction(QStringList &stickyKeys) const +SettingsMergeFunction UserFileAccessor::userStickyTrackerFunction(KeyList &stickyKeys) const { return [&stickyKeys](const SettingsMergeData &global, const SettingsMergeData &local) -> SettingsMergeResult { - const QString key = local.key; + const Key key = local.key; const QVariant main = local.main.value(key); const QVariant secondary = local.secondary.value(key); @@ -402,10 +402,10 @@ FilePath UserFileAccessor::sharedFile() const } Store UserFileAccessor::postprocessMerge(const Store &main, - const Store &secondary, - const Store &result) const + const Store &secondary, + const Store &result) const { - project()->setProperty(SHARED_SETTINGS, secondary); + project()->setProperty(SHARED_SETTINGS, QVariant::fromValue(secondary)); return MergingSettingsAccessor::postprocessMerge(main, secondary, result); } @@ -416,7 +416,7 @@ Store UserFileAccessor::preprocessReadSettings(const Store &data) const // Move from old Version field to new one: // This cannot be done in a normal upgrader since the version information is needed // to decide which upgraders to run - const QString obsoleteKey = OBSOLETE_VERSION_KEY; + const Key obsoleteKey = OBSOLETE_VERSION_KEY; const int obsoleteVersion = tmp.value(obsoleteKey, -1).toInt(); if (obsoleteVersion > versionFromMap(tmp)) @@ -429,13 +429,13 @@ Store UserFileAccessor::preprocessReadSettings(const Store &data) const Store UserFileAccessor::prepareToWriteSettings(const Store &data) const { const Store tmp = MergingSettingsAccessor::prepareToWriteSettings(data); - const Store shared = retrieveSharedSettings().toMap(); + const Store shared = retrieveSharedSettings().value<Store>(); Store result; if (!shared.isEmpty()) { - QStringList stickyKeys; + KeyList stickyKeys; SettingsMergeFunction merge = userStickyTrackerFunction(stickyKeys); - result = mergeQVariantMaps(tmp, shared, merge).toMap(); - result.insert(USER_STICKY_KEYS_KEY, stickyKeys); + result = mergeQVariantMaps(tmp, shared, merge).value<Store>(); + result.insert(USER_STICKY_KEYS_KEY, stringFromKey(stickyKeys)); } else { result = tmp; } @@ -454,7 +454,7 @@ Store UserFileVersion14Upgrader::upgrade(const Store &map) Store result; for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) { if (it.value().typeId() == QVariant::Map) - result.insert(it.key(), upgrade(it.value().toMap())); + result.insert(it.key(), upgrade(it.value().value<Store>())); else if (it.key() == "AutotoolsProjectManager.AutotoolsBuildConfiguration.BuildDirectory" || it.key() == "CMakeProjectManager.CMakeBuildConfiguration.BuildDirectory" || it.key() == "GenericProjectManager.GenericBuildConfiguration.BuildDirectory" @@ -473,11 +473,11 @@ Store UserFileVersion14Upgrader::upgrade(const Store &map) Store UserFileVersion15Upgrader::upgrade(const Store &map) { - const QList<Change> changes{{QLatin1String("ProjectExplorer.Project.Updater.EnvironmentId"), - QLatin1String("EnvironmentId")}, - {QLatin1String("ProjectExplorer.Project.UserStickyKeys"), - QLatin1String("UserStickyKeys")}}; - return renameKeys(changes, Store(map)); + const QList<Change> changes{ + {"ProjectExplorer.Project.Updater.EnvironmentId", "EnvironmentId"}, + {"ProjectExplorer.Project.UserStickyKeys", "UserStickyKeys"} + }; + return renameKeys(changes, map); } // -------------------------------------------------------------------- @@ -489,12 +489,12 @@ UserFileVersion16Upgrader::OldStepMaps UserFileVersion16Upgrader::extractStepMap OldStepMaps result; result.defaultDisplayName = deployMap.value("ProjectExplorer.ProjectConfiguration.DefaultDisplayName").toString(); result.displayName = deployMap.value("ProjectExplorer.ProjectConfiguration.DisplayName").toString(); - const QString stepListKey = "ProjectExplorer.BuildConfiguration.BuildStepList.0"; - Store stepListMap = deployMap.value(stepListKey).toMap(); + const Key stepListKey = "ProjectExplorer.BuildConfiguration.BuildStepList.0"; + Store stepListMap = deployMap.value(stepListKey).value<Store>(); int stepCount = stepListMap.value("ProjectExplorer.BuildStepList.StepsCount", 0).toInt(); - QString stepKey = "ProjectExplorer.BuildStepList.Step."; + Key stepKey = "ProjectExplorer.BuildStepList.Step."; for (int i = 0; i < stepCount; ++i) { - Store stepMap = stepListMap.value(stepKey + QString::number(i)).toMap(); + Store stepMap = stepListMap.value(stepKey + Key::number(i)).value<Store>(); const QString id = stepMap.value("ProjectExplorer.ProjectConfiguration.Id").toString(); if (id == "Qt4ProjectManager.AndroidDeployQtStep") result.androidDeployQt = stepMap; @@ -509,14 +509,14 @@ UserFileVersion16Upgrader::OldStepMaps UserFileVersion16Upgrader::extractStepMap Store UserFileVersion16Upgrader::removeAndroidPackageStep(Store deployMap) { - const QString stepListKey = "ProjectExplorer.BuildConfiguration.BuildStepList.0"; - Store stepListMap = deployMap.value(stepListKey).toMap(); + const Key stepListKey = "ProjectExplorer.BuildConfiguration.BuildStepList.0"; + Store stepListMap = deployMap.value(stepListKey).value<Store>(); const QString stepCountKey = "ProjectExplorer.BuildStepList.StepsCount"; int stepCount = stepListMap.value(stepCountKey, 0).toInt(); QString stepKey = "ProjectExplorer.BuildStepList.Step."; int targetPosition = 0; for (int sourcePosition = 0; sourcePosition < stepCount; ++sourcePosition) { - Store stepMap = stepListMap.value(stepKey + QString::number(sourcePosition)).toMap(); + Store stepMap = stepListMap.value(stepKey + QString::number(sourcePosition)).value<Store>(); if (stepMap.value("ProjectExplorer.ProjectConfiguration.Id").toString() != "Qt4ProjectManager.AndroidPackageInstallationStep") { stepListMap.insert(stepKey + QString::number(targetPosition), stepMap); @@ -543,7 +543,7 @@ Store UserFileVersion16Upgrader::insertSteps(Store buildConfigurationMap, const QString bslKey = "ProjectExplorer.BuildConfiguration.BuildStepList."; const QString bslTypeKey = "ProjectExplorer.ProjectConfiguration.Id"; for (int bslNumber = 0; bslNumber < stepListCount; ++bslNumber) { - Store buildStepListMap = buildConfigurationMap.value(bslKey + QString::number(bslNumber)).toMap(); + Store buildStepListMap = buildConfigurationMap.value(bslKey + QString::number(bslNumber)).value<Store>(); if (buildStepListMap.value(bslTypeKey) != "ProjectExplorer.BuildSteps.Build") continue; @@ -638,7 +638,7 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) for (int i = 0; i < targetCount; ++i) { QString targetKey = QLatin1String("ProjectExplorer.Project.Target.") + QString::number(i); - Store targetMap = data.value(targetKey).toMap(); + Store targetMap = data.value(targetKey).value<Store>(); const QString dcCountKey = "ProjectExplorer.Target.DeployConfigurationCount"; int deployconfigurationCount = targetMap.value(dcCountKey).toInt(); @@ -651,7 +651,7 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) QString deployKey = "ProjectExplorer.Target.DeployConfiguration."; for (int j = 0; j < deployconfigurationCount; ++j) { Store deployConfigurationMap - = targetMap.value(deployKey + QString::number(j)).toMap(); + = targetMap.value(deployKey + QString::number(j)).value<Store>(); OldStepMaps oldStep = extractStepMaps(deployConfigurationMap); if (!oldStep.isEmpty()) { oldSteps.append(oldStep); @@ -672,7 +672,7 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) QString bcKey = "ProjectExplorer.Target.BuildConfiguration."; for (int j = 0; j < buildConfigurationCount; ++j) { - Store oldBuildConfigurationMap = targetMap.value(bcKey + QString::number(j)).toMap(); + Store oldBuildConfigurationMap = targetMap.value(bcKey + QString::number(j)).value<Store>(); oldBuildConfigurations.append(oldBuildConfigurationMap); } @@ -703,7 +703,7 @@ Store UserFileVersion17Upgrader::upgrade(const Store &map) m_sticky = map.value(USER_STICKY_KEYS_KEY).toList(); if (m_sticky.isEmpty()) return map; - return process(map).toMap(); + return process(map).value<Store>(); } QVariant UserFileVersion17Upgrader::process(const QVariant &entry) @@ -716,7 +716,7 @@ QVariant UserFileVersion17Upgrader::process(const QVariant &entry) return result; } case QVariant::Map: { - Store result = entry.toMap(); + Store result = entry.value<Store>(); for (Store::iterator i = result.begin(), end = result.end(); i != end; ++i) { QVariant &v = i.value(); v = process(v); @@ -731,7 +731,7 @@ QVariant UserFileVersion17Upgrader::process(const QVariant &entry) Store UserFileVersion18Upgrader::upgrade(const Store &map) { - return process(map).toMap(); + return process(map).value<Store>(); } QVariant UserFileVersion18Upgrader::process(const QVariant &entry) @@ -741,7 +741,7 @@ QVariant UserFileVersion18Upgrader::process(const QVariant &entry) return Utils::transform(entry.toList(), &UserFileVersion18Upgrader::process); case QVariant::Map: return Utils::transform<QMap<QString, QVariant>>( - entry.toMap().toStdMap(), [](const StringVariantPair &item) -> StringVariantPair { + entry.value<Store>().toStdMap(), [](const StringVariantPair &item) -> StringVariantPair { const QString key = (item.first == "AutotoolsProjectManager.MakeStep.AdditionalArguments" ? QString("AutotoolsProjectManager.MakeStep.MakeArguments") @@ -755,7 +755,7 @@ QVariant UserFileVersion18Upgrader::process(const QVariant &entry) Store UserFileVersion19Upgrader::upgrade(const Store &map) { - return process(map, QStringList()).toMap(); + return process(map, QStringList()).value<Store>(); } QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const QStringList &path) @@ -795,7 +795,7 @@ QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const QString return Utils::transform(entry.toList(), std::bind(&UserFileVersion19Upgrader::process, std::placeholders::_1, path)); case QVariant::Map: - return Utils::transform<Store>(entry.toMap().toStdMap(), + return Utils::transform<Store>(entry.value<Store>().toStdMap(), [&](const StringVariantPair &item) -> StringVariantPair { if (path.size() == 2 && path.at(1).startsWith("ProjectExplorer.Target.RunConfiguration.")) { if (argsKeys.contains(item.first)) @@ -820,7 +820,7 @@ QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const QString Store UserFileVersion20Upgrader::upgrade(const Store &map) { - return process(map).toMap(); + return process(map).value<Store>(); } QVariant UserFileVersion20Upgrader::process(const QVariant &entry) @@ -830,7 +830,7 @@ QVariant UserFileVersion20Upgrader::process(const QVariant &entry) return Utils::transform(entry.toList(), &UserFileVersion20Upgrader::process); case QVariant::Map: return Utils::transform<QMap<QString, QVariant>>( - entry.toMap().toStdMap(), [](const StringVariantPair &item) { + entry.value<Store>().toStdMap(), [](const StringVariantPair &item) { StringVariantPair res = {item.first, item.second}; if (item.first == "ProjectExplorer.ProjectConfiguration.Id" && item.second == "Qbs.Deploy") @@ -846,7 +846,7 @@ QVariant UserFileVersion20Upgrader::process(const QVariant &entry) Store UserFileVersion21Upgrader::upgrade(const Store &map) { - return process(map).toMap(); + return process(map).value<Store>(); } QVariant UserFileVersion21Upgrader::process(const QVariant &entry) @@ -855,7 +855,7 @@ QVariant UserFileVersion21Upgrader::process(const QVariant &entry) case QVariant::List: return Utils::transform(entry.toList(), &UserFileVersion21Upgrader::process); case QVariant::Map: { - Store entryMap = entry.toMap(); + Store entryMap = entry.value<Store>(); if (entryMap.value("ProjectExplorer.ProjectConfiguration.Id").toString() == "DeployToGenericLinux") { entryMap.insert("_checkMakeInstall", true); diff --git a/src/plugins/projectexplorer/userfileaccessor.h b/src/plugins/projectexplorer/userfileaccessor.h index b4ed20b498c..3c37da84b22 100644 --- a/src/plugins/projectexplorer/userfileaccessor.h +++ b/src/plugins/projectexplorer/userfileaccessor.h @@ -6,7 +6,6 @@ #include <utils/settingsaccessor.h> #include <QHash> -#include <QMessageBox> namespace ProjectExplorer { @@ -38,7 +37,7 @@ protected: Utils::SettingsMergeResult merge(const SettingsMergeData &global, const SettingsMergeData &local) const final; private: - Utils::SettingsMergeFunction userStickyTrackerFunction(QStringList &stickyKeys) const; + Utils::SettingsMergeFunction userStickyTrackerFunction(Utils::KeyList &stickyKeys) const; Project *m_project; }; From e1e1af36d25b363850c970ff657bba910aaadd1d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 24 Aug 2023 17:49:37 +0200 Subject: [PATCH 0865/1777] Some more Key and Store Change-Id: I78d2c7cfda1f8ece3c6fd9a7d741ec526a9aa6e4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/bookmarks/bookmarkmanager.cpp | 4 +- .../cppeditor/cppcodemodelsettings.cpp | 77 ++---- .../cppeditor/cppcodestylepreferences.cpp | 6 +- .../cppeditor/cppcodestylesettings.cpp | 2 +- src/plugins/nim/nimconstants.h | 4 +- src/plugins/projectexplorer/msvctoolchain.cpp | 4 +- src/plugins/projectexplorer/project.cpp | 14 +- src/plugins/projectexplorer/project.h | 10 +- .../projectcommentssettings.cpp | 8 +- .../projectexplorer/projectexplorer.cpp | 6 +- .../projectexplorer/userfileaccessor.cpp | 257 +++++++++--------- src/plugins/texteditor/commentssettings.cpp | 11 +- src/plugins/texteditor/commentssettings.h | 10 +- 13 files changed, 205 insertions(+), 208 deletions(-) diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index 83a2650b750..2fecba07fc3 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -750,14 +750,14 @@ void BookmarkManager::saveBookmarks() for (const Bookmark *bookmark : std::as_const(m_bookmarksList)) list << bookmarkToString(bookmark); - SessionManager::setValue(QLatin1String("Bookmarks"), list); + SessionManager::setValue("Bookmarks", list); } /* Loads the bookmarks from the session settings. */ void BookmarkManager::loadBookmarks() { removeAllBookmarks(); - const QStringList &list = SessionManager::value(QLatin1String("Bookmarks")).toStringList(); + const QStringList &list = SessionManager::value("Bookmarks").toStringList(); for (const QString &bookmarkString : list) addBookmark(bookmarkString); diff --git a/src/plugins/cppeditor/cppcodemodelsettings.cpp b/src/plugins/cppeditor/cppcodemodelsettings.cpp index 318efd14e5a..d7f4888b077 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettings.cpp @@ -29,55 +29,36 @@ using namespace Utils; namespace CppEditor { -static Id initialClangDiagnosticConfigId() -{ return Constants::CPP_CLANG_DIAG_CONFIG_BUILDSYSTEM; } - +static Id initialClangDiagnosticConfigId() { return Constants::CPP_CLANG_DIAG_CONFIG_BUILDSYSTEM; } static CppCodeModelSettings::PCHUsage initialPchUsage() -{ return CppCodeModelSettings::PchUse_BuildSystem; } + { return CppCodeModelSettings::PchUse_BuildSystem; } +static Key enableLowerClazyLevelsKey() { return "enableLowerClazyLevels"; } +static Key pchUsageKey() { return Constants::CPPEDITOR_MODEL_MANAGER_PCH_USAGE; } +static Key interpretAmbiguousHeadersAsCHeadersKey() + { return Constants::CPPEDITOR_INTERPRET_AMBIGIUOUS_HEADERS_AS_C_HEADERS; } +static Key skipIndexingBigFilesKey() { return Constants::CPPEDITOR_SKIP_INDEXING_BIG_FILES; } +static Key ignoreFilesKey() { return Constants::CPPEDITOR_IGNORE_FILES; } +static Key ignorePatternKey() { return Constants::CPPEDITOR_IGNORE_PATTERN; } +static Key useBuiltinPreprocessorKey() { return Constants::CPPEDITOR_USE_BUILTIN_PREPROCESSOR; } +static Key indexerFileSizeLimitKey() { return Constants::CPPEDITOR_INDEXER_FILE_SIZE_LIMIT; } -static QString enableLowerClazyLevelsKey() -{ return QLatin1String("enableLowerClazyLevels"); } - -static QString pchUsageKey() -{ return QLatin1String(Constants::CPPEDITOR_MODEL_MANAGER_PCH_USAGE); } - -static QString interpretAmbiguousHeadersAsCHeadersKey() -{ return QLatin1String(Constants::CPPEDITOR_INTERPRET_AMBIGIUOUS_HEADERS_AS_C_HEADERS); } - -static QString skipIndexingBigFilesKey() -{ return QLatin1String(Constants::CPPEDITOR_SKIP_INDEXING_BIG_FILES); } - -static QString ignoreFilesKey() -{ return QLatin1String(Constants::CPPEDITOR_IGNORE_FILES); } - -static QString ignorePatternKey() -{ return QLatin1String(Constants::CPPEDITOR_IGNORE_PATTERN); } - -static QString useBuiltinPreprocessorKey() -{ return QLatin1String(Constants::CPPEDITOR_USE_BUILTIN_PREPROCESSOR); } - -static QString indexerFileSizeLimitKey() -{ return QLatin1String(Constants::CPPEDITOR_INDEXER_FILE_SIZE_LIMIT); } - -static QString clangdSettingsKey() { return QLatin1String("ClangdSettings"); } -static QString useClangdKey() { return QLatin1String("UseClangdV7"); } -static QString clangdPathKey() { return QLatin1String("ClangdPath"); } -static QString clangdIndexingKey() { return QLatin1String("ClangdIndexing"); } -static QString clangdIndexingPriorityKey() { return QLatin1String("ClangdIndexingPriority"); } -static QString clangdHeaderSourceSwitchModeKey() { - return QLatin1String("ClangdHeaderSourceSwitchMode"); -} -static QString clangdHeaderInsertionKey() { return QLatin1String("ClangdHeaderInsertion"); } -static QString clangdThreadLimitKey() { return QLatin1String("ClangdThreadLimit"); } -static QString clangdDocumentThresholdKey() { return QLatin1String("ClangdDocumentThreshold"); } -static QString clangdSizeThresholdEnabledKey() { return QLatin1String("ClangdSizeThresholdEnabled"); } -static QString clangdSizeThresholdKey() { return QLatin1String("ClangdSizeThreshold"); } -static QString clangdUseGlobalSettingsKey() { return QLatin1String("useGlobalSettings"); } -static QString clangdblockIndexingSettingsKey() { return QLatin1String("blockIndexing"); } -static QString sessionsWithOneClangdKey() { return QLatin1String("SessionsWithOneClangd"); } -static QString diagnosticConfigIdKey() { return QLatin1String("diagnosticConfigId"); } -static QString checkedHardwareKey() { return QLatin1String("checkedHardware"); } -static QString completionResultsKey() { return QLatin1String("completionResults"); } +static Key clangdSettingsKey() { return "ClangdSettings"; } +static Key useClangdKey() { return "UseClangdV7"; } +static Key clangdPathKey() { return "ClangdPath"; } +static Key clangdIndexingKey() { return "ClangdIndexing"; } +static Key clangdIndexingPriorityKey() { return "ClangdIndexingPriority"; } +static Key clangdHeaderSourceSwitchModeKey() { return "ClangdHeaderSourceSwitchMode"; } +static Key clangdHeaderInsertionKey() { return "ClangdHeaderInsertion"; } +static Key clangdThreadLimitKey() { return "ClangdThreadLimit"; } +static Key clangdDocumentThresholdKey() { return "ClangdDocumentThreshold"; } +static Key clangdSizeThresholdEnabledKey() { return "ClangdSizeThresholdEnabled"; } +static Key clangdSizeThresholdKey() { return "ClangdSizeThreshold"; } +static Key clangdUseGlobalSettingsKey() { return "useGlobalSettings"; } +static Key clangdblockIndexingSettingsKey() { return "blockIndexing"; } +static Key sessionsWithOneClangdKey() { return "SessionsWithOneClangd"; } +static Key diagnosticConfigIdKey() { return "diagnosticConfigId"; } +static Key checkedHardwareKey() { return "checkedHardware"; } +static Key completionResultsKey() { return "completionResults"; } static FilePath g_defaultClangdFilePath; static FilePath fallbackClangdFilePath() @@ -425,7 +406,7 @@ void ClangdSettings::loadSettings() m_data.customDiagnosticConfigs = diagnosticConfigsFromSettings(settings); // Pre-8.0 compat - static const QString oldKey("ClangDiagnosticConfig"); + static const Key oldKey("ClangDiagnosticConfig"); const QVariant configId = settings->value(oldKey); if (configId.isValid()) { m_data.diagnosticConfigId = Id::fromSetting(configId); diff --git a/src/plugins/cppeditor/cppcodestylepreferences.cpp b/src/plugins/cppeditor/cppcodestylepreferences.cpp index c6b497e021b..59d2bd232fe 100644 --- a/src/plugins/cppeditor/cppcodestylepreferences.cpp +++ b/src/plugins/cppeditor/cppcodestylepreferences.cpp @@ -69,11 +69,11 @@ void CppCodeStylePreferences::slotCurrentValueChanged(const QVariant &value) emit currentCodeStyleSettingsChanged(value.value<CppCodeStyleSettings>()); } -QVariantMap CppCodeStylePreferences::toMap() const +Store CppCodeStylePreferences::toMap() const { - QVariantMap map = ICodeStylePreferences::toMap(); + Store map = ICodeStylePreferences::toMap(); if (!currentDelegate()) { - const QVariantMap dataMap = m_data.toMap(); + const Store dataMap = m_data.toMap(); for (auto it = dataMap.begin(), end = dataMap.end(); it != end; ++it) map.insert(it.key(), it.value()); } diff --git a/src/plugins/cppeditor/cppcodestylesettings.cpp b/src/plugins/cppeditor/cppcodestylesettings.cpp index 2e04d3caa48..557940f7660 100644 --- a/src/plugins/cppeditor/cppcodestylesettings.cpp +++ b/src/plugins/cppeditor/cppcodestylesettings.cpp @@ -48,7 +48,7 @@ namespace CppEditor { CppCodeStyleSettings::CppCodeStyleSettings() = default; -QVariantMap CppCodeStyleSettings::toMap() const +Store CppCodeStyleSettings::toMap() const { return { {indentBlockBracesKey, indentBlockBraces}, diff --git a/src/plugins/nim/nimconstants.h b/src/plugins/nim/nimconstants.h index 868fb0b96ee..3c0b6f4cb31 100644 --- a/src/plugins/nim/nimconstants.h +++ b/src/plugins/nim/nimconstants.h @@ -30,8 +30,8 @@ const char C_NIMBLEBUILDSTEP_ARGUMENTS[] = "Nim.NimbleBuildStep.Arguments"; // NimbleTaskStep const char C_NIMBLETASKSTEP_ID[] = "Nim.NimbleTaskStep"; -const QString C_NIMBLETASKSTEP_TASKNAME = QStringLiteral("Nim.NimbleTaskStep.TaskName"); -const QString C_NIMBLETASKSTEP_TASKARGS = QStringLiteral("Nim.NimbleTaskStep.TaskArgs"); +const char C_NIMBLETASKSTEP_TASKNAME[] = "Nim.NimbleTaskStep.TaskName"; +const char C_NIMBLETASKSTEP_TASKARGS[] = "Nim.NimbleTaskStep.TaskArgs"; // NimCompilerBuildStep const char C_NIMCOMPILERBUILDSTEP_ID[] = "Nim.NimCompilerBuildStep"; diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index ad73c5e041d..d90f7d3d985 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -1721,9 +1721,9 @@ QList<OutputLineParser *> ClangClToolChain::createOutputParsers() const return {new ClangClParser}; } -static inline QString llvmDirKey() +static Key llvmDirKey() { - return QStringLiteral("ProjectExplorer.ClangClToolChain.LlvmDir"); + return "ProjectExplorer.ClangClToolChain.LlvmDir"; } void ClangClToolChain::toMap(Store &data) const diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index a41f9b0be5d..170419d2450 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -773,13 +773,13 @@ Project::RestoreResult Project::fromMap(const Store &map, QString *errorMessage) } if (map.contains(PLUGIN_SETTINGS_KEY)) - d->m_pluginSettings = map.value(PLUGIN_SETTINGS_KEY).toMap(); + d->m_pluginSettings = map.value(PLUGIN_SETTINGS_KEY).value<Store>(); bool ok; int maxI(map.value(TARGET_COUNT_KEY, 0).toInt(&ok)); if (!ok || maxI < 0) maxI = 0; - int active(map.value(ACTIVE_TARGET_KEY, 0).toInt(&ok)); + int active = map.value(ACTIVE_TARGET_KEY, 0).toInt(&ok); if (!ok || active < 0 || active >= maxI) active = 0; @@ -805,7 +805,7 @@ void Project::createTargetFromMap(const Store &map, int index) if (!map.contains(key)) return; - const Store targetMap = map.value(key).toMap(); + const Store targetMap = map.value(key).value<Store>(); Id id = idFromMap(targetMap); if (target(id)) { @@ -978,12 +978,12 @@ Context Project::projectLanguages() const return d->m_projectLanguages; } -QVariant Project::namedSettings(const QString &name) const +QVariant Project::namedSettings(const Key &name) const { return d->m_pluginSettings.value(name); } -void Project::setNamedSettings(const QString &name, const QVariant &value) +void Project::setNamedSettings(const Key &name, const QVariant &value) { if (value.isNull()) d->m_pluginSettings.remove(name); @@ -1075,12 +1075,12 @@ void Project::setCanBuildProducts() d->m_canBuildProducts = true; } -void Project::setExtraData(const QString &key, const QVariant &data) +void Project::setExtraData(const Key &key, const QVariant &data) { d->m_extraData.insert(key, data); } -QVariant Project::extraData(const QString &key) const +QVariant Project::extraData(const Key &key) const { return d->m_extraData.value(key); } diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 468303670f5..40b26d6faa0 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -117,8 +117,8 @@ public: Core::Context projectContext() const; Core::Context projectLanguages() const; - QVariant namedSettings(const QString &name) const; - void setNamedSettings(const QString &name, const QVariant &value); + QVariant namedSettings(const Utils::Key &name) const; + void setNamedSettings(const Utils::Key &name, const QVariant &value); void setAdditionalEnvironment(const Utils::EnvironmentItems &envItems); Utils::EnvironmentItems additionalEnvironment() const; @@ -156,8 +156,8 @@ public: void setDisplayName(const QString &name); void setProjectLanguage(Utils::Id id, bool enabled); - void setExtraData(const QString &key, const QVariant &data); - QVariant extraData(const QString &key) const; + void setExtraData(const Utils::Key &key, const QVariant &data); + QVariant extraData(const Utils::Key &key) const; QStringList availableQmlPreviewTranslations(QString *errorMessage); @@ -206,7 +206,7 @@ signals: protected: virtual RestoreResult fromMap(const Utils::Store &map, QString *errorMessage); - void createTargetFromMap(const QVariantMap &map, int index); + void createTargetFromMap(const Utils::Store &map, int index); virtual bool setupTarget(Target *t); void setCanBuildProducts(); diff --git a/src/plugins/projectexplorer/projectcommentssettings.cpp b/src/plugins/projectexplorer/projectcommentssettings.cpp index 6d41244eea1..57ced03d38f 100644 --- a/src/plugins/projectexplorer/projectcommentssettings.cpp +++ b/src/plugins/projectexplorer/projectcommentssettings.cpp @@ -12,9 +12,11 @@ #include <QVBoxLayout> using namespace TextEditor; +using namespace Utils; namespace ProjectExplorer { namespace Internal { + const char kUseGlobalKey[] = "UseGlobalKey"; ProjectCommentsSettings::ProjectCommentsSettings(ProjectExplorer::Project *project) @@ -55,7 +57,7 @@ void ProjectCommentsSettings::loadSettings() if (!entry.isValid()) return; - const QVariantMap data = entry.toMap(); + const Store data = entry.value<Store>(); m_useGlobalSettings = data.value(kUseGlobalKey, true).toBool(); m_customSettings.enableDoxygen = data.value(CommentsSettings::enableDoxygenSettingsKey(), m_customSettings.enableDoxygen).toBool(); @@ -79,13 +81,13 @@ void ProjectCommentsSettings::saveSettings() return; } - QVariantMap data; + Store data; data.insert(kUseGlobalKey, m_useGlobalSettings); data.insert(CommentsSettings::enableDoxygenSettingsKey(), m_customSettings.enableDoxygen); data.insert(CommentsSettings::generateBriefSettingsKey(), m_customSettings.generateBrief); data.insert(CommentsSettings::leadingAsterisksSettingsKey(), m_customSettings.leadingAsterisks); data.insert(CommentsSettings::commandPrefixKey(), int(m_customSettings.commandPrefix)); - m_project->setNamedSettings(CommentsSettings::mainSettingsKey(), data); + m_project->setNamedSettings(CommentsSettings::mainSettingsKey(), QVariant::fromValue(data)); } class ProjectCommentsSettingsWidget::Private diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 55b4d28cc1a..799f55ac17c 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1703,7 +1703,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er for (int i = 0; i < customParserCount; ++i) { CustomParserSettings settings; settings.fromMap(s->value(Constants::CUSTOM_PARSER_PREFIX_KEY - + QString::number(i)).toMap()); + + Key::number(i)).value<Store>()); dd->m_customParsers << settings; } @@ -2278,8 +2278,8 @@ void ProjectExplorerPluginPrivate::savePersistentSettings() s->setValueWithDefault(Constants::CUSTOM_PARSER_COUNT_KEY, int(dd->m_customParsers.count()), 0); for (int i = 0; i < dd->m_customParsers.count(); ++i) { - s->setValue(Constants::CUSTOM_PARSER_PREFIX_KEY + QString::number(i), - dd->m_customParsers.at(i).toMap()); + s->setValue(Constants::CUSTOM_PARSER_PREFIX_KEY + Key::number(i), + QVariant::fromValue(dd->m_customParsers.at(i).toMap())); } } diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index 7163778ee6d..a627e28d091 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -29,7 +29,7 @@ using namespace Utils; using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; -using StringVariantPair = std::pair<const QString, QVariant>; +using KeyVariantPair = std::pair<const Key, QVariant>; static QString userFileExtension() { @@ -121,7 +121,7 @@ public: UserFileVersion19Upgrader() : VersionUpgrader(19, "4.8-pre2") { } Store upgrade(const Store &map) final; - static QVariant process(const QVariant &entry, const QStringList &path); + static QVariant process(const QVariant &entry, const KeyList &path); }; // Version 20 renames "Qbs.Deploy" to "ProjectExplorer.DefaultDeployConfiguration" @@ -323,7 +323,7 @@ SettingsMergeResult UserFileAccessor::merge(const MergingSettingsAccessor::SettingsMergeData &global, const MergingSettingsAccessor::SettingsMergeData &local) const { - const KeyList stickyKeys = keyFromString(global.main.value(USER_STICKY_KEYS_KEY).toStringList()); + const KeyList stickyKeys = keysFromStrings(global.main.value(USER_STICKY_KEYS_KEY).toStringList()); const Key key = local.key; const QVariant mainValue = local.main.value(key); @@ -435,7 +435,7 @@ Store UserFileAccessor::prepareToWriteSettings(const Store &data) const KeyList stickyKeys; SettingsMergeFunction merge = userStickyTrackerFunction(stickyKeys); result = mergeQVariantMaps(tmp, shared, merge).value<Store>(); - result.insert(USER_STICKY_KEYS_KEY, stringFromKey(stickyKeys)); + result.insert(USER_STICKY_KEYS_KEY, stringsFromKeys(stickyKeys)); } else { result = tmp; } @@ -454,7 +454,7 @@ Store UserFileVersion14Upgrader::upgrade(const Store &map) Store result; for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) { if (it.value().typeId() == QVariant::Map) - result.insert(it.key(), upgrade(it.value().value<Store>())); + result.insert(it.key(), QVariant::fromValue(upgrade(it.value().value<Store>()))); else if (it.key() == "AutotoolsProjectManager.AutotoolsBuildConfiguration.BuildDirectory" || it.key() == "CMakeProjectManager.CMakeBuildConfiguration.BuildDirectory" || it.key() == "GenericProjectManager.GenericBuildConfiguration.BuildDirectory" @@ -511,15 +511,15 @@ Store UserFileVersion16Upgrader::removeAndroidPackageStep(Store deployMap) { const Key stepListKey = "ProjectExplorer.BuildConfiguration.BuildStepList.0"; Store stepListMap = deployMap.value(stepListKey).value<Store>(); - const QString stepCountKey = "ProjectExplorer.BuildStepList.StepsCount"; + const Key stepCountKey = "ProjectExplorer.BuildStepList.StepsCount"; int stepCount = stepListMap.value(stepCountKey, 0).toInt(); - QString stepKey = "ProjectExplorer.BuildStepList.Step."; + Key stepKey = "ProjectExplorer.BuildStepList.Step."; int targetPosition = 0; for (int sourcePosition = 0; sourcePosition < stepCount; ++sourcePosition) { - Store stepMap = stepListMap.value(stepKey + QString::number(sourcePosition)).value<Store>(); + Store stepMap = stepListMap.value(stepKey + Key::number(sourcePosition)).value<Store>(); if (stepMap.value("ProjectExplorer.ProjectConfiguration.Id").toString() != "Qt4ProjectManager.AndroidPackageInstallationStep") { - stepListMap.insert(stepKey + QString::number(targetPosition), stepMap); + stepListMap.insert(stepKey + Key::number(targetPosition), QVariant::fromValue(stepMap)); ++targetPosition; } } @@ -527,9 +527,9 @@ Store UserFileVersion16Upgrader::removeAndroidPackageStep(Store deployMap) stepListMap.insert(stepCountKey, targetPosition); for (int i = targetPosition; i < stepCount; ++i) - stepListMap.remove(stepKey + QString::number(i)); + stepListMap.remove(stepKey + Key::number(i)); - deployMap.insert(stepListKey, stepListMap); + deployMap.insert(stepListKey, QVariant::fromValue(stepListMap)); return deployMap; } @@ -537,17 +537,17 @@ Store UserFileVersion16Upgrader::insertSteps(Store buildConfigurationMap, const OldStepMaps &oldStepMap, NamePolicy policy) { - const QString bslCountKey = "ProjectExplorer.BuildConfiguration.BuildStepListCount"; + const Key bslCountKey = "ProjectExplorer.BuildConfiguration.BuildStepListCount"; int stepListCount = buildConfigurationMap.value(bslCountKey).toInt(); - const QString bslKey = "ProjectExplorer.BuildConfiguration.BuildStepList."; - const QString bslTypeKey = "ProjectExplorer.ProjectConfiguration.Id"; + const Key bslKey = "ProjectExplorer.BuildConfiguration.BuildStepList."; + const Key bslTypeKey = "ProjectExplorer.ProjectConfiguration.Id"; for (int bslNumber = 0; bslNumber < stepListCount; ++bslNumber) { - Store buildStepListMap = buildConfigurationMap.value(bslKey + QString::number(bslNumber)).value<Store>(); + Store buildStepListMap = buildConfigurationMap.value(bslKey + Key::number(bslNumber)).value<Store>(); if (buildStepListMap.value(bslTypeKey) != "ProjectExplorer.BuildSteps.Build") continue; - const QString bslStepCountKey = "ProjectExplorer.BuildStepList.StepsCount"; + const Key bslStepCountKey = "ProjectExplorer.BuildStepList.StepsCount"; int stepCount = buildStepListMap.value(bslStepCountKey).toInt(); buildStepListMap.insert(bslStepCountKey, stepCount + 2); @@ -556,10 +556,10 @@ Store UserFileVersion16Upgrader::insertSteps(Store buildConfigurationMap, Store androidBuildApkStep; // common settings of all buildsteps - const QString enabledKey = "ProjectExplorer.BuildStep.Enabled"; - const QString idKey = "ProjectExplorer.ProjectConfiguration.Id"; - const QString displayNameKey = "ProjectExplorer.ProjectConfiguration.DisplayName"; - const QString defaultDisplayNameKey = "ProjectExplorer.ProjectConfiguration.DefaultDisplayName"; + const Key enabledKey = "ProjectExplorer.BuildStep.Enabled"; + const Key idKey = "ProjectExplorer.ProjectConfiguration.Id"; + const Key displayNameKey = "ProjectExplorer.ProjectConfiguration.DisplayName"; + const Key defaultDisplayNameKey = "ProjectExplorer.ProjectConfiguration.DefaultDisplayName"; QString displayName = oldStepMap.androidPackageInstall.value(displayNameKey).toString(); QString defaultDisplayName = oldStepMap.androidPackageInstall.value(defaultDisplayNameKey).toString(); @@ -570,7 +570,7 @@ Store UserFileVersion16Upgrader::insertSteps(Store buildConfigurationMap, androidPackageInstallStep.insert(defaultDisplayNameKey, defaultDisplayName); androidPackageInstallStep.insert(enabledKey, enabled); - displayName = oldStepMap.androidDeployQt.value(displayName).toString(); + displayName = oldStepMap.androidDeployQt.value(keyFromString(displayName)).toString(); defaultDisplayName = oldStepMap.androidDeployQt.value(defaultDisplayNameKey).toString(); enabled = oldStepMap.androidDeployQt.value(enabledKey).toBool(); @@ -580,11 +580,11 @@ Store UserFileVersion16Upgrader::insertSteps(Store buildConfigurationMap, androidBuildApkStep.insert(enabledKey, enabled); // settings transferred from AndroidDeployQtStep to QmakeBuildApkStep - const QString ProFilePathForInputFile = "ProFilePathForInputFile"; - const QString DeployActionKey = "Qt4ProjectManager.AndroidDeployQtStep.DeployQtAction"; - const QString KeystoreLocationKey = "KeystoreLocation"; - const QString BuildTargetSdkKey = "BuildTargetSdk"; - const QString VerboseOutputKey = "VerboseOutput"; + const Key ProFilePathForInputFile = "ProFilePathForInputFile"; + const Key DeployActionKey = "Qt4ProjectManager.AndroidDeployQtStep.DeployQtAction"; + const Key KeystoreLocationKey = "KeystoreLocation"; + const Key BuildTargetSdkKey = "BuildTargetSdk"; + const Key VerboseOutputKey = "VerboseOutput"; QString inputFile = oldStepMap.androidDeployQt.value(ProFilePathForInputFile).toString(); int oldDeployAction = oldStepMap.androidDeployQt.value(DeployActionKey).toInt(); @@ -597,16 +597,16 @@ Store UserFileVersion16Upgrader::insertSteps(Store buildConfigurationMap, androidBuildApkStep.insert(BuildTargetSdkKey, buildTargetSdk); androidBuildApkStep.insert(VerboseOutputKey, verbose); - const QString buildStepKey = "ProjectExplorer.BuildStepList.Step."; - buildStepListMap.insert(buildStepKey + QString::number(stepCount), androidPackageInstallStep); - buildStepListMap.insert(buildStepKey + QString::number(stepCount + 1), androidBuildApkStep); + const Key buildStepKey = "ProjectExplorer.BuildStepList.Step."; + buildStepListMap.insert(buildStepKey + Key::number(stepCount), QVariant::fromValue(androidPackageInstallStep)); + buildStepListMap.insert(buildStepKey + Key::number(stepCount + 1), QVariant::fromValue(androidBuildApkStep)); - buildConfigurationMap.insert(bslKey + QString::number(bslNumber), buildStepListMap); + buildConfigurationMap.insert(bslKey + Key::number(bslNumber), QVariant::fromValue(buildStepListMap)); } if (policy == RenameBuildConfiguration) { - const QString displayNameKey = "ProjectExplorer.ProjectConfiguration.DisplayName"; - const QString defaultDisplayNameKey = "ProjectExplorer.ProjectConfiguration.DefaultDisplayName"; + const Key displayNameKey = "ProjectExplorer.ProjectConfiguration.DisplayName"; + const Key defaultDisplayNameKey = "ProjectExplorer.ProjectConfiguration.DefaultDisplayName"; QString defaultDisplayName = buildConfigurationMap.value(defaultDisplayNameKey).toString(); QString displayName = buildConfigurationMap.value(displayNameKey).toString(); @@ -637,10 +637,10 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) Store result = data; for (int i = 0; i < targetCount; ++i) { - QString targetKey = QLatin1String("ProjectExplorer.Project.Target.") + QString::number(i); + Key targetKey = "ProjectExplorer.Project.Target." + Key::number(i); Store targetMap = data.value(targetKey).value<Store>(); - const QString dcCountKey = "ProjectExplorer.Target.DeployConfigurationCount"; + const Key dcCountKey = "ProjectExplorer.Target.DeployConfigurationCount"; int deployconfigurationCount = targetMap.value(dcCountKey).toInt(); if (!deployconfigurationCount) // should never happen continue; @@ -648,31 +648,31 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) QList<OldStepMaps> oldSteps; QList<Store> oldBuildConfigurations; - QString deployKey = "ProjectExplorer.Target.DeployConfiguration."; + Key deployKey = "ProjectExplorer.Target.DeployConfiguration."; for (int j = 0; j < deployconfigurationCount; ++j) { Store deployConfigurationMap - = targetMap.value(deployKey + QString::number(j)).value<Store>(); + = targetMap.value(deployKey + Key::number(j)).value<Store>(); OldStepMaps oldStep = extractStepMaps(deployConfigurationMap); if (!oldStep.isEmpty()) { oldSteps.append(oldStep); deployConfigurationMap = removeAndroidPackageStep(deployConfigurationMap); - targetMap.insert(deployKey + QString::number(j), deployConfigurationMap); + targetMap.insert(deployKey + Key::number(j), QVariant::fromValue(deployConfigurationMap)); } } if (oldSteps.isEmpty()) // no android target? continue; - const QString bcCountKey = "ProjectExplorer.Target.BuildConfigurationCount"; + const Key bcCountKey = "ProjectExplorer.Target.BuildConfigurationCount"; int buildConfigurationCount = targetMap.value(bcCountKey).toInt(); if (!buildConfigurationCount) // should never happen continue; - QString bcKey = "ProjectExplorer.Target.BuildConfiguration."; + Key bcKey = "ProjectExplorer.Target.BuildConfiguration."; for (int j = 0; j < buildConfigurationCount; ++j) { - Store oldBuildConfigurationMap = targetMap.value(bcKey + QString::number(j)).value<Store>(); + Store oldBuildConfigurationMap = targetMap.value(bcKey + Key::number(j)).value<Store>(); oldBuildConfigurations.append(oldBuildConfigurationMap); } @@ -691,8 +691,8 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) targetMap.insert(bcCountKey, newBuildConfigurations.size()); for (int j = 0; j < newBuildConfigurations.size(); ++j) - targetMap.insert(bcKey + QString::number(j), newBuildConfigurations.at(j)); - result.insert(targetKey, targetMap); + targetMap.insert(bcKey + Key::number(j), QVariant::fromValue(newBuildConfigurations.at(j))); + result.insert(targetKey, QVariant::fromValue(targetMap)); } return result; @@ -703,7 +703,7 @@ Store UserFileVersion17Upgrader::upgrade(const Store &map) m_sticky = map.value(USER_STICKY_KEYS_KEY).toList(); if (m_sticky.isEmpty()) return map; - return process(map).value<Store>(); + return process(QVariant::fromValue(map)).value<Store>(); } QVariant UserFileVersion17Upgrader::process(const QVariant &entry) @@ -722,7 +722,7 @@ QVariant UserFileVersion17Upgrader::process(const QVariant &entry) v = process(v); } result.insert(USER_STICKY_KEYS_KEY, m_sticky); - return result; + return QVariant::fromValue(result); } default: return entry; @@ -731,7 +731,7 @@ QVariant UserFileVersion17Upgrader::process(const QVariant &entry) Store UserFileVersion18Upgrader::upgrade(const Store &map) { - return process(map).value<Store>(); + return process(QVariant::fromValue(map)).value<Store>(); } QVariant UserFileVersion18Upgrader::process(const QVariant &entry) @@ -739,15 +739,17 @@ QVariant UserFileVersion18Upgrader::process(const QVariant &entry) switch (entry.typeId()) { case QVariant::List: return Utils::transform(entry.toList(), &UserFileVersion18Upgrader::process); - case QVariant::Map: - return Utils::transform<QMap<QString, QVariant>>( - entry.value<Store>().toStdMap(), [](const StringVariantPair &item) -> StringVariantPair { - const QString key = (item.first - == "AutotoolsProjectManager.MakeStep.AdditionalArguments" - ? QString("AutotoolsProjectManager.MakeStep.MakeArguments") - : item.first); - return {key, UserFileVersion18Upgrader::process(item.second)}; - }); + case QVariant::Map: { + Store map = entry.value<Store>(); + Store result; + for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) { + Key key = it.key() == "AutotoolsProjectManager.MakeStep.AdditionalArguments" + ? Key("AutotoolsProjectManager.MakeStep.MakeArguments") + : it.key(); + result.insert(key, UserFileVersion18Upgrader::process(it.value())); + } + return QVariant::fromValue(result); + } default: return entry; } @@ -755,64 +757,71 @@ QVariant UserFileVersion18Upgrader::process(const QVariant &entry) Store UserFileVersion19Upgrader::upgrade(const Store &map) { - return process(map, QStringList()).value<Store>(); + return process(QVariant::fromValue(map), KeyList()).value<Store>(); } -QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const QStringList &path) +QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const KeyList &path) { - static const QStringList argsKeys = {"Qt4ProjectManager.MaemoRunConfiguration.Arguments", - "CMakeProjectManager.CMakeRunConfiguration.Arguments", - "Ios.run_arguments", - "Nim.NimRunConfiguration.ArgumentAspect", - "ProjectExplorer.CustomExecutableRunConfiguration.Arguments", - "PythonEditor.RunConfiguration.Arguments", - "Qbs.RunConfiguration.CommandLineArguments", - "Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments", - "RemoteLinux.CustomRunConfig.Arguments", - "WinRtRunConfigurationArgumentsId", - "CommandLineArgs"}; - static const QStringList wdKeys = {"BareMetal.RunConfig.WorkingDirectory", - "CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory", - "Nim.NimRunConfiguration.WorkingDirectoryAspect", - "ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory", - "Qbs.RunConfiguration.WorkingDirectory", - "Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory", - "RemoteLinux.CustomRunConfig.WorkingDirectory", - "RemoteLinux.RunConfig.WorkingDirectory", - "WorkingDir"}; - static const QStringList termKeys = {"CMakeProjectManager.CMakeRunConfiguration.UseTerminal", - "Nim.NimRunConfiguration.TerminalAspect", - "ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal", - "PythonEditor.RunConfiguration.UseTerminal", - "Qbs.RunConfiguration.UseTerminal", - "Qt4ProjectManager.Qt4RunConfiguration.UseTerminal"}; - static const QStringList libsKeys = {"Qbs.RunConfiguration.UsingLibraryPaths", - "QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath"}; - static const QStringList dyldKeys = {"Qbs.RunConfiguration.UseDyldImageSuffix", - "QmakeProjectManager.QmakeRunConfiguration.UseDyldImageSuffix"}; + static const KeyList argsKeys = {"Qt4ProjectManager.MaemoRunConfiguration.Arguments", + "CMakeProjectManager.CMakeRunConfiguration.Arguments", + "Ios.run_arguments", + "Nim.NimRunConfiguration.ArgumentAspect", + "ProjectExplorer.CustomExecutableRunConfiguration.Arguments", + "PythonEditor.RunConfiguration.Arguments", + "Qbs.RunConfiguration.CommandLineArguments", + "Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments", + "RemoteLinux.CustomRunConfig.Arguments", + "WinRtRunConfigurationArgumentsId", + "CommandLineArgs"}; + static const KeyList wdKeys = {"BareMetal.RunConfig.WorkingDirectory", + "CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory", + "Nim.NimRunConfiguration.WorkingDirectoryAspect", + "ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory", + "Qbs.RunConfiguration.WorkingDirectory", + "Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory", + "RemoteLinux.CustomRunConfig.WorkingDirectory", + "RemoteLinux.RunConfig.WorkingDirectory", + "WorkingDir"}; + static const KeyList termKeys = {"CMakeProjectManager.CMakeRunConfiguration.UseTerminal", + "Nim.NimRunConfiguration.TerminalAspect", + "ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal", + "PythonEditor.RunConfiguration.UseTerminal", + "Qbs.RunConfiguration.UseTerminal", + "Qt4ProjectManager.Qt4RunConfiguration.UseTerminal"}; + static const KeyList libsKeys = {"Qbs.RunConfiguration.UsingLibraryPaths", + "QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath"}; + static const KeyList dyldKeys = {"Qbs.RunConfiguration.UseDyldImageSuffix", + "QmakeProjectManager.QmakeRunConfiguration.UseDyldImageSuffix"}; switch (entry.typeId()) { case QVariant::List: return Utils::transform(entry.toList(), std::bind(&UserFileVersion19Upgrader::process, std::placeholders::_1, path)); - case QVariant::Map: - return Utils::transform<Store>(entry.value<Store>().toStdMap(), - [&](const StringVariantPair &item) -> StringVariantPair { + case QVariant::Map: { + Store map = entry.value<Store>(); + Store result; + for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) { + Key key = it.key(); + QVariant value = it.value(); if (path.size() == 2 && path.at(1).startsWith("ProjectExplorer.Target.RunConfiguration.")) { - if (argsKeys.contains(item.first)) - return {"RunConfiguration.Arguments", item.second}; - if (wdKeys.contains(item.first)) - return {"RunConfiguration.WorkingDirectory", item.second}; - if (termKeys.contains(item.first)) - return {"RunConfiguration.UseTerminal", item.second}; - if (libsKeys.contains(item.first)) - return {"RunConfiguration.UseLibrarySearchPath", item.second}; - if (dyldKeys.contains(item.first)) - return {"RunConfiguration.UseDyldImageSuffix", item.second}; + if (argsKeys.contains(key)) + key = "RunConfiguration.Arguments"; + else if (wdKeys.contains(key)) + key = "RunConfiguration.WorkingDirectory"; + else if (termKeys.contains(key)) + key = "RunConfiguration.UseTerminal"; + else if (libsKeys.contains(key)) + key = "RunConfiguration.UseLibrarySearchPath"; + else if (dyldKeys.contains(key)) + key = "RunConfiguration.UseDyldImageSuffix"; + else + value = UserFileVersion19Upgrader::process(value, path + KeyList{key}); + } else { + value = UserFileVersion19Upgrader::process(value, path + KeyList{key}); } - QStringList newPath = path; - newPath.append(item.first); - return {item.first, UserFileVersion19Upgrader::process(item.second, newPath)}; - }); + result.insert(key, value); + }; + return QVariant::fromValue(result); + } default: return entry; } @@ -820,7 +829,7 @@ QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const QString Store UserFileVersion20Upgrader::upgrade(const Store &map) { - return process(map).value<Store>(); + return process(QVariant::fromValue(map)).value<Store>(); } QVariant UserFileVersion20Upgrader::process(const QVariant &entry) @@ -828,17 +837,20 @@ QVariant UserFileVersion20Upgrader::process(const QVariant &entry) switch (entry.typeId()) { case QVariant::List: return Utils::transform(entry.toList(), &UserFileVersion20Upgrader::process); - case QVariant::Map: - return Utils::transform<QMap<QString, QVariant>>( - entry.value<Store>().toStdMap(), [](const StringVariantPair &item) { - StringVariantPair res = {item.first, item.second}; - if (item.first == "ProjectExplorer.ProjectConfiguration.Id" - && item.second == "Qbs.Deploy") - res.second = QVariant("ProjectExplorer.DefaultDeployConfiguration"); - else - res.second = UserFileVersion20Upgrader::process(item.second); - return res; - }); + case QVariant::Map: { + Store map = entry.value<Store>(); + Store result; + for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) { + Key key = it.key(); + QVariant value = it.value(); + if (key == "ProjectExplorer.ProjectConfiguration.Id" && value == "Qbs.Deploy") + value = "ProjectExplorer.DefaultDeployConfiguration"; + else + value = UserFileVersion20Upgrader::process(value); + result.insert(key, value); + } + return QVariant::fromValue(result); + } default: return entry; } @@ -846,7 +858,7 @@ QVariant UserFileVersion20Upgrader::process(const QVariant &entry) Store UserFileVersion21Upgrader::upgrade(const Store &map) { - return process(map).value<Store>(); + return process(QVariant::fromValue(map)).value<Store>(); } QVariant UserFileVersion21Upgrader::process(const QVariant &entry) @@ -859,12 +871,13 @@ QVariant UserFileVersion21Upgrader::process(const QVariant &entry) if (entryMap.value("ProjectExplorer.ProjectConfiguration.Id").toString() == "DeployToGenericLinux") { entryMap.insert("_checkMakeInstall", true); - return entryMap; + return QVariant::fromValue(entryMap); } - return Utils::transform<Store>( - entryMap.toStdMap(), [](const StringVariantPair &item) -> StringVariantPair{ - return {item.first, UserFileVersion21Upgrader::process(item.second)}; - }); + Store map = entry.value<Store>(); + Store result; + for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) + result.insert(it.key(), UserFileVersion21Upgrader::process(it.value())); + return QVariant::fromValue(result); } default: return entry; @@ -885,7 +898,7 @@ public: TestUserFileAccessor(Project *project) : UserFileAccessor(project) { } void storeSharedSettings(const Store &data) const { m_storedSettings = data; } - QVariant retrieveSharedSettings() const override { return m_storedSettings; } + QVariant retrieveSharedSettings() const override { return QVariant::fromValue(m_storedSettings); } using UserFileAccessor::preprocessReadSettings; using UserFileAccessor::prepareToWriteSettings; diff --git a/src/plugins/texteditor/commentssettings.cpp b/src/plugins/texteditor/commentssettings.cpp index 441d01c3538..533b9bab441 100644 --- a/src/plugins/texteditor/commentssettings.cpp +++ b/src/plugins/texteditor/commentssettings.cpp @@ -16,6 +16,7 @@ #include <QSettings> using namespace Layouting; +using namespace Utils; namespace TextEditor { @@ -35,11 +36,11 @@ void CommentsSettings::setData(const Data &data) instance().save(); } -QString CommentsSettings::mainSettingsKey() { return kDocumentationCommentsGroup; } -QString CommentsSettings::enableDoxygenSettingsKey() { return kEnableDoxygenBlocks; } -QString CommentsSettings::generateBriefSettingsKey() { return kGenerateBrief; } -QString CommentsSettings::leadingAsterisksSettingsKey() { return kAddLeadingAsterisks; } -QString CommentsSettings::commandPrefixKey() { return kCommandPrefix; } +Key CommentsSettings::mainSettingsKey() { return kDocumentationCommentsGroup; } +Key CommentsSettings::enableDoxygenSettingsKey() { return kEnableDoxygenBlocks; } +Key CommentsSettings::generateBriefSettingsKey() { return kGenerateBrief; } +Key CommentsSettings::leadingAsterisksSettingsKey() { return kAddLeadingAsterisks; } +Key CommentsSettings::commandPrefixKey() { return kCommandPrefix; } CommentsSettings::CommentsSettings() { diff --git a/src/plugins/texteditor/commentssettings.h b/src/plugins/texteditor/commentssettings.h index 7206a8ccc4c..fd37a8e5b74 100644 --- a/src/plugins/texteditor/commentssettings.h +++ b/src/plugins/texteditor/commentssettings.h @@ -26,11 +26,11 @@ public: static Data data() { return instance().m_data; } static void setData(const Data &data); - static QString mainSettingsKey(); - static QString enableDoxygenSettingsKey(); - static QString generateBriefSettingsKey(); - static QString leadingAsterisksSettingsKey(); - static QString commandPrefixKey(); + static Utils::Key mainSettingsKey(); + static Utils::Key enableDoxygenSettingsKey(); + static Utils::Key generateBriefSettingsKey(); + static Utils::Key leadingAsterisksSettingsKey(); + static Utils::Key commandPrefixKey(); private: CommentsSettings(); From 8d0aa34bfcd5604b9b93a8c002169b361db4316c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 24 Aug 2023 16:14:26 +0200 Subject: [PATCH 0866/1777] Plugins: A bit more Keys and Store Change-Id: Iee55eeaa881dd9f2047fdbe95ad8d827f4ba34e0 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/android/androidconfigurations.cpp | 74 +++++++++---------- src/plugins/baremetal/baremetaldevice.cpp | 4 +- .../clangtools/clangtoolsprojectsettings.cpp | 19 +++-- .../cmakebuildconfiguration.cpp | 29 ++++---- .../cmakeprojectmanager/cmakebuildstep.cpp | 13 ++-- .../cmakeprojectmanager/cmakesettingspage.cpp | 4 +- src/plugins/cmakeprojectmanager/cmaketool.cpp | 6 +- src/plugins/cmakeprojectmanager/cmaketool.h | 2 +- .../cmaketoolsettingsaccessor.cpp | 20 ++--- .../cmaketoolsettingsaccessor.h | 3 +- src/plugins/copilot/copilotsettings.cpp | 6 +- .../cppeditor/cppcodemodelsettings.cpp | 10 +-- .../cppeditor/cppcodestylesettingspage.cpp | 6 +- src/plugins/cppeditor/cppeditordocument.cpp | 6 +- src/plugins/cppeditor/cppfilesettingspage.cpp | 2 +- src/plugins/cppeditor/cppincludehierarchy.cpp | 4 +- .../cppeditor/cppinsertvirtualmethods.cpp | 15 ++-- .../cppeditor/cpppreprocessordialog.cpp | 4 +- .../cppeditor/cppquickfixprojectsettings.cpp | 4 +- src/plugins/cppeditor/cpptoolssettings.cpp | 10 +-- src/plugins/cvs/cvssettings.cpp | 2 +- src/plugins/debugger/commonoptionspage.cpp | 4 +- src/plugins/debugger/debuggeractions.cpp | 8 +- src/plugins/debugger/debuggeritem.cpp | 6 +- src/plugins/debugger/debuggeritem.h | 2 +- src/plugins/debugger/debuggeritemmanager.cpp | 12 +-- src/plugins/docker/dockerdevice.cpp | 4 +- .../incredibuild/buildconsolebuildstep.cpp | 4 +- src/plugins/incredibuild/commandbuilder.cpp | 15 ++-- src/plugins/incredibuild/commandbuilder.h | 2 +- .../languageclient/languageclientsettings.cpp | 14 ++-- .../mesonprojectmanager/mesonwrapper.h | 10 +-- .../mesonprojectmanager/ninjawrapper.h | 10 +-- .../mesonprojectmanager/toolitemsettings.cpp | 2 +- .../toolssettingsaccessor.cpp | 23 +++--- .../mesonprojectmanager/toolwrapper.cpp | 2 + src/plugins/mesonprojectmanager/toolwrapper.h | 39 +++++----- src/plugins/nim/nimconstants.h | 6 +- .../nim/settings/nimcodestylesettingspage.cpp | 4 +- .../customwidgetwizard/classdefinition.cpp | 2 +- .../qmakebuildconfiguration.cpp | 4 +- .../qmljseditor/qmljscomponentnamedialog.cpp | 2 +- .../qmljstools/qmljscodestylepreferences.cpp | 6 +- .../qmljstools/qmljscodestylesettings.cpp | 2 +- .../qmljstools/qmljscodestylesettingspage.cpp | 6 +- src/plugins/qmljstools/qmljstoolssettings.cpp | 2 +- .../qmlpreview/qmlpreviewruncontrol.cpp | 2 +- .../qmlmultilanguageaspect.cpp | 2 +- src/plugins/qtsupport/baseqtversion.cpp | 6 +- .../qtsupport/gettingstartedwelcomepage.cpp | 2 +- src/plugins/qtsupport/qtversionfactory.h | 4 +- src/plugins/qtsupport/qtversionmanager.cpp | 30 ++++---- src/plugins/terminal/terminalsettings.cpp | 2 +- 53 files changed, 243 insertions(+), 239 deletions(-) diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index 1aff2e32c14..cef297ac31d 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -89,52 +89,50 @@ const char LinuxOsKey[] = "linux"; const char WindowsOsKey[] = "windows"; const char macOsKey[] = "mac"; +const char SettingsGroup[] = "AndroidConfigurations"; +const char SDKLocationKey[] = "SDKLocation"; +const char CustomNdkLocationsKey[] = "CustomNdkLocations"; +const char DefaultNdkLocationKey[] = "DefaultNdkLocation"; +const char SdkFullyConfiguredKey[] = "AllEssentialsInstalled"; +const char SDKManagerToolArgsKey[] = "SDKManagerToolArgs"; +const char OpenJDKLocationKey[] = "OpenJDKLocation"; +const char OpenSslPriLocationKey[] = "OpenSSLPriLocation"; +const char AutomaticKitCreationKey[] = "AutomatiKitCreation"; +const char EmulatorArgsKey[] = "EmulatorArgs"; -namespace { - const QLatin1String SettingsGroup("AndroidConfigurations"); - const QLatin1String SDKLocationKey("SDKLocation"); - const QLatin1String CustomNdkLocationsKey("CustomNdkLocations"); - const QLatin1String DefaultNdkLocationKey("DefaultNdkLocation"); - const QLatin1String SdkFullyConfiguredKey("AllEssentialsInstalled"); - const QLatin1String SDKManagerToolArgsKey("SDKManagerToolArgs"); - const QLatin1String OpenJDKLocationKey("OpenJDKLocation"); - const QLatin1String OpenSslPriLocationKey("OpenSSLPriLocation"); - const QLatin1String AutomaticKitCreationKey("AutomatiKitCreation"); - const QLatin1String EmulatorArgsKey("EmulatorArgs"); +const QLatin1String ArmToolchainPrefix("arm-linux-androideabi"); +const QLatin1String X86ToolchainPrefix("x86"); +const QLatin1String AArch64ToolchainPrefix("aarch64-linux-android"); +const QLatin1String X86_64ToolchainPrefix("x86_64"); - const QLatin1String ArmToolchainPrefix("arm-linux-androideabi"); - const QLatin1String X86ToolchainPrefix("x86"); - const QLatin1String AArch64ToolchainPrefix("aarch64-linux-android"); - const QLatin1String X86_64ToolchainPrefix("x86_64"); +const QLatin1String ArmToolsPrefix ("arm-linux-androideabi"); +const QLatin1String X86ToolsPrefix("i686-linux-android"); +const QLatin1String AArch64ToolsPrefix("aarch64-linux-android"); +const QLatin1String X86_64ToolsPrefix("x86_64-linux-android"); - const QLatin1String ArmToolsPrefix("arm-linux-androideabi"); - const QLatin1String X86ToolsPrefix("i686-linux-android"); - const QLatin1String AArch64ToolsPrefix("aarch64-linux-android"); - const QLatin1String X86_64ToolsPrefix("x86_64-linux-android"); +const QLatin1String ArmToolsDisplayName("arm"); +const QLatin1String X86ToolsDisplayName("i686"); +const QLatin1String AArch64ToolsDisplayName("aarch64"); +const QLatin1String X86_64ToolsDisplayName("x86_64"); - const QLatin1String ArmToolsDisplayName("arm"); - const QLatin1String X86ToolsDisplayName("i686"); - const QLatin1String AArch64ToolsDisplayName("aarch64"); - const QLatin1String X86_64ToolsDisplayName("x86_64"); +const QLatin1String Unknown("unknown"); +const QLatin1String keytoolName("keytool"); +const QLatin1String changeTimeStamp("ChangeTimeStamp"); - const QLatin1String Unknown("unknown"); - const QLatin1String keytoolName("keytool"); - const QLatin1String changeTimeStamp("ChangeTimeStamp"); +const char sdkToolsVersionKey[] = "Pkg.Revision"; +const char ndkRevisionKey[] = "Pkg.Revision"; - const QLatin1String sdkToolsVersionKey("Pkg.Revision"); - const QLatin1String ndkRevisionKey("Pkg.Revision"); - - static QString sdkSettingsFileName() - { - return Core::ICore::installerResourcePath("android.xml").toString(); - } - - static QString ndkPackageMarker() - { - return QLatin1String(Constants::ndkPackageName) + ";"; - } +static QString sdkSettingsFileName() +{ + return Core::ICore::installerResourcePath("android.xml").toString(); } +static QString ndkPackageMarker() +{ + return QLatin1String(Constants::ndkPackageName) + ";"; +} + + ////////////////////////////////// // AndroidConfig ////////////////////////////////// diff --git a/src/plugins/baremetal/baremetaldevice.cpp b/src/plugins/baremetal/baremetaldevice.cpp index 4e90826a996..e0d271f2591 100644 --- a/src/plugins/baremetal/baremetaldevice.cpp +++ b/src/plugins/baremetal/baremetaldevice.cpp @@ -79,9 +79,9 @@ void BareMetalDevice::fromMap(const Store &map) } } -QVariantMap BareMetalDevice::toMap() const +Store BareMetalDevice::toMap() const { - QVariantMap map = IDevice::toMap(); + Store map = IDevice::toMap(); map.insert(debugServerProviderIdKeyC, debugServerProviderId()); return map; } diff --git a/src/plugins/clangtools/clangtoolsprojectsettings.cpp b/src/plugins/clangtools/clangtoolsprojectsettings.cpp index 581a8ca57b6..67b49dff705 100644 --- a/src/plugins/clangtools/clangtoolsprojectsettings.cpp +++ b/src/plugins/clangtools/clangtoolsprojectsettings.cpp @@ -8,6 +8,9 @@ #include <utils/algorithm.h> #include <utils/qtcassert.h> +#include <utils/store.h> + +using namespace Utils; namespace ClangTools { namespace Internal { @@ -97,10 +100,10 @@ void ClangToolsProjectSettings::removeAllSuppressedDiagnostics() emit suppressedDiagnosticsChanged(); } -static QVariantMap convertToMapFromVersionBefore410(ProjectExplorer::Project *p) +static Store convertToMapFromVersionBefore410(ProjectExplorer::Project *p) { // These keys haven't changed. - const QStringList keys = { + const Key keys[] = { SETTINGS_KEY_SELECTED_DIRS, SETTINGS_KEY_SELECTED_FILES, SETTINGS_KEY_SUPPRESSED_DIAGS, @@ -108,8 +111,8 @@ static QVariantMap convertToMapFromVersionBefore410(ProjectExplorer::Project *p) "ClangTools.BuildBeforeAnalysis", }; - QVariantMap map; - for (const QString &key : keys) + Store map; + for (const Key &key : keys) map.insert(key, p->namedSettings(key)); map.insert(SETTINGS_PREFIX + QString(diagnosticConfigIdKey), @@ -121,7 +124,7 @@ static QVariantMap convertToMapFromVersionBefore410(ProjectExplorer::Project *p) void ClangToolsProjectSettings::load() { // Load map - QVariantMap map = m_project->namedSettings(SETTINGS_KEY_MAIN).toMap(); + Store map = m_project->namedSettings(SETTINGS_KEY_MAIN).toMap(); bool write = false; if (map.isEmpty()) { @@ -145,7 +148,7 @@ void ClangToolsProjectSettings::load() const QVariantList list = map.value(SETTINGS_KEY_SUPPRESSED_DIAGS).toList(); for (const QVariant &v : list) { - const QVariantMap diag = v.toMap(); + const Store diag = v.toMap(); const QString fp = diag.value(SETTINGS_KEY_SUPPRESSED_DIAGS_FILEPATH).toString(); if (fp.isEmpty()) continue; @@ -172,7 +175,7 @@ void ClangToolsProjectSettings::load() void ClangToolsProjectSettings::store() { - QVariantMap map; + Store map; map.insert(SETTINGS_KEY_USE_GLOBAL_SETTINGS, m_useGlobalSettings); const QStringList dirs = Utils::transform<QList>(m_selectedDirs, &Utils::FilePath::toString); @@ -183,7 +186,7 @@ void ClangToolsProjectSettings::store() QVariantList list; for (const SuppressedDiagnostic &diag : std::as_const(m_suppressedDiagnostics)) { - QVariantMap diagMap; + Store diagMap; diagMap.insert(SETTINGS_KEY_SUPPRESSED_DIAGS_FILEPATH, diag.filePath.toString()); diagMap.insert(SETTINGS_KEY_SUPPRESSED_DIAGS_MESSAGE, diag.description); diagMap.insert(SETTINGS_KEY_SUPPRESSED_DIAGS_UNIQIFIER, diag.uniquifier); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 6fab3af48db..75a4b44073f 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1433,7 +1433,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) setInitializer([this, target](const BuildInfo &info) { const Kit *k = target->kit(); const QtSupport::QtVersion *qt = QtSupport::QtKitAspect::qtVersion(k); - const QVariantMap extraInfoMap = info.extraInfo.value<QVariantMap>(); + const Store extraInfoMap = info.extraInfo.value<Store>(); const QString buildType = extraInfoMap.contains(CMAKE_BUILD_TYPE) ? extraInfoMap.value(CMAKE_BUILD_TYPE).toString() : info.typeName; @@ -1939,7 +1939,7 @@ BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(BuildType buildType) info.typeName = "Debug"; info.displayName = ::ProjectExplorer::Tr::tr("Debug"); info.buildType = BuildConfiguration::Debug; - QVariantMap extraInfo; + Store extraInfo; // enable QML debugging by default extraInfo.insert(Constants::QML_DEBUG_SETTING, TriState::Enabled.toVariant()); info.extraInfo = extraInfo; @@ -1964,7 +1964,7 @@ BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(BuildType buildType) info.typeName = "Profile"; info.displayName = Tr::tr("Profile"); info.buildType = BuildConfiguration::Profile; - QVariantMap extraInfo; + Store extraInfo; // override CMake build type, which defaults to info.typeName extraInfo.insert(CMAKE_BUILD_TYPE, "RelWithDebInfo"); // enable QML debugging by default @@ -2234,32 +2234,29 @@ ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(AspectContainer *containe void ConfigureEnvironmentAspect::fromMap(const Store &map) { // Match the key values from Qt Creator 9.0.0/1 to the ones from EnvironmentAspect - const bool cleanSystemEnvironment = map.value(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY)) - .toBool(); + const bool cleanSystemEnvironment = map.value(CLEAR_SYSTEM_ENVIRONMENT_KEY).toBool(); const QStringList userEnvironmentChanges - = map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList(); + = map.value(USER_ENVIRONMENT_CHANGES_KEY).toStringList(); - const int baseEnvironmentIndex - = map.value(QLatin1String(BASE_ENVIRONMENT_KEY), baseEnvironmentBase()).toInt(); + const int baseEnvironmentIndex = map.value(BASE_ENVIRONMENT_KEY, baseEnvironmentBase()).toInt(); - QVariantMap tmpMap; - tmpMap.insert(QLatin1String(BASE_KEY), cleanSystemEnvironment ? 0 : baseEnvironmentIndex); - tmpMap.insert(QLatin1String(CHANGES_KEY), userEnvironmentChanges); + Store tmpMap; + tmpMap.insert(BASE_KEY, cleanSystemEnvironment ? 0 : baseEnvironmentIndex); + tmpMap.insert(CHANGES_KEY, userEnvironmentChanges); ProjectExplorer::EnvironmentAspect::fromMap(tmpMap); } void ConfigureEnvironmentAspect::toMap(Store &map) const { - QVariantMap tmpMap; + Store tmpMap; ProjectExplorer::EnvironmentAspect::toMap(tmpMap); const int baseKey = tmpMap.value(BASE_KEY).toInt(); - map.insert(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY), baseKey == 0); - map.insert(QLatin1String(BASE_ENVIRONMENT_KEY), baseKey); - map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), - tmpMap.value(CHANGES_KEY).toStringList()); + map.insert(CLEAR_SYSTEM_ENVIRONMENT_KEY, baseKey == 0); + map.insert(BASE_ENVIRONMENT_KEY, baseKey); + map.insert(USER_ENVIRONMENT_CHANGES_KEY, tmpMap.value(CHANGES_KEY).toStringList()); } } // namespace Internal diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 8ab20703aa5..4f31179d12f 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -277,23 +277,22 @@ void CMakeBuildStep::toMap(Utils::Store &map) const { CMakeAbstractProcessStep::toMap(map); map.insert(BUILD_TARGETS_KEY, m_buildTargets); - map.insert(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY), m_clearSystemEnvironment); - map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), EnvironmentItem::toStringList(m_userEnvironmentChanges)); - map.insert(QLatin1String(BUILD_PRESET_KEY), m_buildPreset); + map.insert(CLEAR_SYSTEM_ENVIRONMENT_KEY, m_clearSystemEnvironment); + map.insert(USER_ENVIRONMENT_CHANGES_KEY, EnvironmentItem::toStringList(m_userEnvironmentChanges)); + map.insert(BUILD_PRESET_KEY, m_buildPreset); } void CMakeBuildStep::fromMap(const Utils::Store &map) { setBuildTargets(map.value(BUILD_TARGETS_KEY).toStringList()); - m_clearSystemEnvironment = map.value(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY)) - .toBool(); + m_clearSystemEnvironment = map.value(CLEAR_SYSTEM_ENVIRONMENT_KEY).toBool(); m_userEnvironmentChanges = EnvironmentItem::fromStringList( - map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); + map.value(USER_ENVIRONMENT_CHANGES_KEY).toStringList()); updateAndEmitEnvironmentChanged(); - m_buildPreset = map.value(QLatin1String(BUILD_PRESET_KEY)).toString(); + m_buildPreset = map.value(BUILD_PRESET_KEY).toString(); BuildStep::fromMap(map); } diff --git a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp index ab950ebc82a..1bfb6cee658 100644 --- a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp +++ b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp @@ -409,14 +409,14 @@ CMakeToolItemConfigWidget::CMakeToolItemConfigWidget(CMakeToolItemModel *model) m_binaryChooser = new PathChooser(this); m_binaryChooser->setExpectedKind(PathChooser::ExistingCommand); m_binaryChooser->setMinimumWidth(400); - m_binaryChooser->setHistoryCompleter(QLatin1String("Cmake.Command.History")); + m_binaryChooser->setHistoryCompleter("Cmake.Command.History"); m_binaryChooser->setCommandVersionArguments({"--version"}); m_binaryChooser->setAllowPathFromDevice(true); m_qchFileChooser = new PathChooser(this); m_qchFileChooser->setExpectedKind(PathChooser::File); m_qchFileChooser->setMinimumWidth(400); - m_qchFileChooser->setHistoryCompleter(QLatin1String("Cmake.qchFile.History")); + m_qchFileChooser->setHistoryCompleter("Cmake.qchFile.History"); m_qchFileChooser->setPromptDialogFilter("*.qch"); m_qchFileChooser->setPromptDialogTitle(Tr::tr("CMake .qch File")); diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 9239ea54177..580db212507 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -105,7 +105,7 @@ CMakeTool::CMakeTool(Detection d, const Id &id) QTC_ASSERT(m_id.isValid(), m_id = Id::fromString(QUuid::createUuid().toString())); } -CMakeTool::CMakeTool(const QVariantMap &map, bool fromSdk) : +CMakeTool::CMakeTool(const Store &map, bool fromSdk) : CMakeTool(fromSdk ? CMakeTool::AutoDetection : CMakeTool::ManualDetection, Id::fromSetting(map.value(CMAKE_INFORMATION_ID))) { @@ -175,9 +175,9 @@ void CMakeTool::runCMake(Process &cmake, const QStringList &args, int timeoutS) cmake.runBlocking(); } -QVariantMap CMakeTool::toMap() const +Store CMakeTool::toMap() const { - QVariantMap data; + Store data; data.insert(CMAKE_INFORMATION_DISPLAYNAME, m_displayName); data.insert(CMAKE_INFORMATION_ID, m_id.toSetting()); data.insert(CMAKE_INFORMATION_COMMAND, m_executable.toString()); diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index 5243ef06523..838e9cf07e8 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -52,7 +52,7 @@ public: using PathMapper = std::function<Utils::FilePath (const Utils::FilePath &)>; explicit CMakeTool(Detection d, const Utils::Id &id); - explicit CMakeTool(const QVariantMap &map, bool fromSdk); + explicit CMakeTool(const Utils::Store &map, bool fromSdk); ~CMakeTool(); static Utils::Id createId(); diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp index 5b7b6aec9b3..6780163de79 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp @@ -30,7 +30,7 @@ public: CMakeToolSettingsUpgraderV0() : VersionUpgrader(0, "4.6") { } // NOOP - QVariantMap upgrade(const QVariantMap &data) final { return data; } + Store upgrade(const Store &data) final { return data; } }; // -------------------------------------------------------------------- @@ -170,8 +170,8 @@ void CMakeToolSettingsAccessor::saveCMakeTools(const QList<CMakeTool *> &cmakeTo const Id &defaultId, QWidget *parent) { - QVariantMap data; - data.insert(QLatin1String(CMAKE_TOOL_DEFAULT_KEY), defaultId.toSetting()); + Store data; + data.insert(CMAKE_TOOL_DEFAULT_KEY, defaultId.toSetting()); int count = 0; const bool autoRun = settings().autorunCMake(); @@ -183,30 +183,30 @@ void CMakeToolSettingsAccessor::saveCMakeTools(const QList<CMakeTool *> &cmakeTo item->setAutorun(autoRun); if (fi.needsDevice() || fi.isExecutableFile()) { // be graceful for device related stuff - QVariantMap tmp = item->toMap(); + Store tmp = item->toMap(); if (tmp.isEmpty()) continue; - data.insert(QString::fromLatin1(CMAKE_TOOL_DATA_KEY) + QString::number(count), tmp); + data.insert(CMAKE_TOOL_DATA_KEY + Key::number(count), QVariant::fromValue(tmp)); ++count; } } - data.insert(QLatin1String(CMAKE_TOOL_COUNT_KEY), count); + data.insert(CMAKE_TOOL_COUNT_KEY, count); saveSettings(data, parent); } CMakeToolSettingsAccessor::CMakeTools -CMakeToolSettingsAccessor::cmakeTools(const QVariantMap &data, bool fromSdk) const +CMakeToolSettingsAccessor::cmakeTools(const Store &data, bool fromSdk) const { CMakeTools result; - int count = data.value(QLatin1String(CMAKE_TOOL_COUNT_KEY), 0).toInt(); + int count = data.value(CMAKE_TOOL_COUNT_KEY, 0).toInt(); for (int i = 0; i < count; ++i) { - const QString key = QString::fromLatin1(CMAKE_TOOL_DATA_KEY) + QString::number(i); + const Key key = CMAKE_TOOL_DATA_KEY + Key::number(i); if (!data.contains(key)) continue; - const QVariantMap dbMap = data.value(key).toMap(); + const Store dbMap = data.value(key).value<Store>(); auto item = std::make_unique<CMakeTool>(dbMap, fromSdk); const FilePath cmakeExecutable = item->cmakeExecutable(); if (item->isAutoDetected() && !cmakeExecutable.needsDevice() && !cmakeExecutable.isExecutableFile()) { diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.h b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.h index e750770390c..e67ab6c0326 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.h +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.h @@ -5,6 +5,7 @@ #include <utils/id.h> #include <utils/settingsaccessor.h> +#include <utils/store.h> namespace CMakeProjectManager { @@ -29,7 +30,7 @@ public: QWidget *parent); private: - CMakeTools cmakeTools(const QVariantMap &data, bool fromSdk) const; + CMakeTools cmakeTools(const Utils::Store &data, bool fromSdk) const; }; } // namespace Internal diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index 74988ca774f..ec98469267e 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -233,7 +233,7 @@ CopilotProjectSettings::CopilotProjectSettings(ProjectExplorer::Project *project initEnableAspect(enableCopilot); - QVariantMap map = project->namedSettings(Constants::COPILOT_PROJECT_SETTINGS_ID).toMap(); + Store map = project->namedSettings(Constants::COPILOT_PROJECT_SETTINGS_ID).value<Store>(); fromMap(map); connect(&enableCopilot, &BaseAspect::changed, this, [this, project] { save(project); }); @@ -254,9 +254,9 @@ bool CopilotProjectSettings::isEnabled() const void CopilotProjectSettings::save(ProjectExplorer::Project *project) { - QVariantMap map; + Store map; toMap(map); - project->setNamedSettings(Constants::COPILOT_PROJECT_SETTINGS_ID, map); + project->setNamedSettings(Constants::COPILOT_PROJECT_SETTINGS_ID, QVariant::fromValue(map)); // This triggers a restart of the Copilot language server. settings().apply(); diff --git a/src/plugins/cppeditor/cppcodemodelsettings.cpp b/src/plugins/cppeditor/cppcodemodelsettings.cpp index d7f4888b077..6265c57b5b9 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettings.cpp @@ -498,7 +498,7 @@ void ClangdProjectSettings::loadSettings() { if (!m_project) return; - const QVariantMap data = m_project->namedSettings(clangdSettingsKey()).toMap(); + const Store data = m_project->namedSettings(clangdSettingsKey()).value<Store>(); m_useGlobalSettings = data.value(clangdUseGlobalSettingsKey(), true).toBool(); m_blockIndexing = data.value(clangdblockIndexingSettingsKey(), false).toBool(); if (!m_useGlobalSettings) @@ -509,17 +509,17 @@ void ClangdProjectSettings::saveSettings() { if (!m_project) return; - QVariantMap data; + Store data; if (!m_useGlobalSettings) data = m_customSettings.toMap(); data.insert(clangdUseGlobalSettingsKey(), m_useGlobalSettings); data.insert(clangdblockIndexingSettingsKey(), m_blockIndexing); - m_project->setNamedSettings(clangdSettingsKey(), data); + m_project->setNamedSettings(clangdSettingsKey(), QVariant::fromValue(data)); } -QVariantMap ClangdSettings::Data::toMap() const +Store ClangdSettings::Data::toMap() const { - QVariantMap map; + Store map; map.insert(useClangdKey(), useClangd); map.insert(clangdPathKey(), executableFilePath != fallbackClangdFilePath() ? executableFilePath.toString() diff --git a/src/plugins/cppeditor/cppcodestylesettingspage.cpp b/src/plugins/cppeditor/cppcodestylesettingspage.cpp index d580f4dd990..383efef58df 100644 --- a/src/plugins/cppeditor/cppcodestylesettingspage.cpp +++ b/src/plugins/cppeditor/cppcodestylesettingspage.cpp @@ -591,15 +591,15 @@ public: CppCodeStylePreferences *originalCppCodeStylePreferences = CppToolsSettings::cppCodeStyle(); if (originalCppCodeStylePreferences->codeStyleSettings() != m_pageCppCodeStylePreferences->codeStyleSettings()) { originalCppCodeStylePreferences->setCodeStyleSettings(m_pageCppCodeStylePreferences->codeStyleSettings()); - originalCppCodeStylePreferences->toSettings(QLatin1String(CppEditor::Constants::CPP_SETTINGS_ID)); + originalCppCodeStylePreferences->toSettings(CppEditor::Constants::CPP_SETTINGS_ID); } if (originalCppCodeStylePreferences->tabSettings() != m_pageCppCodeStylePreferences->tabSettings()) { originalCppCodeStylePreferences->setTabSettings(m_pageCppCodeStylePreferences->tabSettings()); - originalCppCodeStylePreferences->toSettings(QLatin1String(CppEditor::Constants::CPP_SETTINGS_ID)); + originalCppCodeStylePreferences->toSettings(CppEditor::Constants::CPP_SETTINGS_ID); } if (originalCppCodeStylePreferences->currentDelegate() != m_pageCppCodeStylePreferences->currentDelegate()) { originalCppCodeStylePreferences->setCurrentDelegate(m_pageCppCodeStylePreferences->currentDelegate()); - originalCppCodeStylePreferences->toSettings(QLatin1String(CppEditor::Constants::CPP_SETTINGS_ID)); + originalCppCodeStylePreferences->toSettings(CppEditor::Constants::CPP_SETTINGS_ID); } m_codeStyleEditor->apply(); diff --git a/src/plugins/cppeditor/cppeditordocument.cpp b/src/plugins/cppeditor/cppeditordocument.cpp index 3559fb7da73..16cae978a82 100644 --- a/src/plugins/cppeditor/cppeditordocument.cpp +++ b/src/plugins/cppeditor/cppeditordocument.cpp @@ -210,7 +210,7 @@ void CppEditorDocument::reparseWithPreferredParseContext(const QString &parseCon setPreferredParseContext(parseContextId); // Remember the setting - const QString key = Constants::PREFERRED_PARSE_CONTEXT + filePath().toString(); + const Key key = Constants::PREFERRED_PARSE_CONTEXT + keyFromString(filePath().toString()); Core::SessionManager::setValue(key, parseContextId); // Reprocess @@ -277,7 +277,7 @@ void CppEditorDocument::applyPreferredParseContextFromSettings() if (filePath().isEmpty()) return; - const QString key = Constants::PREFERRED_PARSE_CONTEXT + filePath().toString(); + const Key key = Constants::PREFERRED_PARSE_CONTEXT + keyFromString(filePath().toString()); const QString parseContextId = Core::SessionManager::value(key).toString(); setPreferredParseContext(parseContextId); @@ -288,7 +288,7 @@ void CppEditorDocument::applyExtraPreprocessorDirectivesFromSettings() if (filePath().isEmpty()) return; - const QString key = Constants::EXTRA_PREPROCESSOR_DIRECTIVES + filePath().toString(); + const Key key = Constants::EXTRA_PREPROCESSOR_DIRECTIVES + keyFromString(filePath().toString()); const QByteArray directives = Core::SessionManager::value(key).toString().toUtf8(); setExtraPreprocessorDirectives(directives); diff --git a/src/plugins/cppeditor/cppfilesettingspage.cpp b/src/plugins/cppeditor/cppfilesettingspage.cpp index 6b9bad8c9c9..a506dff8b8a 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.cpp +++ b/src/plugins/cppeditor/cppfilesettingspage.cpp @@ -336,7 +336,7 @@ CppFileSettingsWidget::CppFileSettingsWidget(CppFileSettings *settings) m_headerSuffixComboBox->addItem(suffix); } m_licenseTemplatePathChooser->setExpectedKind(PathChooser::File); - m_licenseTemplatePathChooser->setHistoryCompleter(QLatin1String("Cpp.LicenseTemplate.History")); + m_licenseTemplatePathChooser->setHistoryCompleter("Cpp.LicenseTemplate.History"); m_licenseTemplatePathChooser->addButton(Tr::tr("Edit..."), this, [this] { slotEdit(); }); setSettings(*m_settings); diff --git a/src/plugins/cppeditor/cppincludehierarchy.cpp b/src/plugins/cppeditor/cppincludehierarchy.cpp index 6b543f6163a..51c03797fd4 100644 --- a/src/plugins/cppeditor/cppincludehierarchy.cpp +++ b/src/plugins/cppeditor/cppincludehierarchy.cpp @@ -432,13 +432,13 @@ const bool kSyncDefault = false; void CppIncludeHierarchyWidget::saveSettings(QSettings *settings, int position) { - const QString key = QString("IncludeHierarchy.%1.SyncWithEditor").arg(position); + const Key key = keyFromString(QString("IncludeHierarchy.%1.SyncWithEditor").arg(position)); QtcSettings::setValueWithDefault(settings, key, m_toggleSync->isChecked(), kSyncDefault); } void CppIncludeHierarchyWidget::restoreSettings(QSettings *settings, int position) { - const QString key = QString("IncludeHierarchy.%1.SyncWithEditor").arg(position); + const Key key = keyFromString(QString("IncludeHierarchy.%1.SyncWithEditor").arg(position)); m_toggleSync->setChecked(settings->value(key, kSyncDefault).toBool()); } diff --git a/src/plugins/cppeditor/cppinsertvirtualmethods.cpp b/src/plugins/cppeditor/cppinsertvirtualmethods.cpp index 5fba144c0e2..6b8f77a0363 100644 --- a/src/plugins/cppeditor/cppinsertvirtualmethods.cpp +++ b/src/plugins/cppeditor/cppinsertvirtualmethods.cpp @@ -334,14 +334,13 @@ public: bool insertOverrideReplacement = kInsertOVerrideReplacementDefault; private: - using _ = QLatin1String; - static QString group() { return _("QuickFix/InsertVirtualMethods"); } - static QString insertVirtualKeywordKey() { return _("insertKeywordVirtual"); } - static QString insertOverrideReplacementKey() { return _("insertOverrideReplacement"); } - static QString overrideReplacementIndexKey() { return _("overrideReplacementIndex"); } - static QString userAddedOverrideReplacementsKey() { return _("userAddedOverrideReplacements"); } - static QString implementationModeKey() { return _("implementationMode"); } - static QString hideReimplementedFunctionsKey() { return _("hideReimplementedFunctions"); } + static Key group() { return "QuickFix/InsertVirtualMethods"; } + static Key insertVirtualKeywordKey() { return "insertKeywordVirtual"; } + static Key insertOverrideReplacementKey() { return "insertOverrideReplacement"; } + static Key overrideReplacementIndexKey() { return "overrideReplacementIndex"; } + static Key userAddedOverrideReplacementsKey() { return "userAddedOverrideReplacements"; } + static Key implementationModeKey() { return "implementationMode"; } + static Key hideReimplementedFunctionsKey() { return "hideReimplementedFunctions"; } }; class InsertVirtualMethodsModel : public QAbstractItemModel diff --git a/src/plugins/cppeditor/cpppreprocessordialog.cpp b/src/plugins/cppeditor/cpppreprocessordialog.cpp index 87afd9761a2..a7a39750e95 100644 --- a/src/plugins/cppeditor/cpppreprocessordialog.cpp +++ b/src/plugins/cppeditor/cpppreprocessordialog.cpp @@ -26,7 +26,7 @@ CppPreProcessorDialog::CppPreProcessorDialog(const FilePath &filePath, QWidget * resize(400, 300); setWindowTitle(Tr::tr("Additional C++ Preprocessor Directives")); - const QString key = Constants::EXTRA_PREPROCESSOR_DIRECTIVES + m_filePath.toString(); + const Key key = Constants::EXTRA_PREPROCESSOR_DIRECTIVES + keyFromString(m_filePath.toString()); const QString directives = Core::SessionManager::value(key).toString(); m_editWidget = new TextEditor::SnippetEditorWidget; @@ -55,7 +55,7 @@ int CppPreProcessorDialog::exec() if (QDialog::exec() == Rejected) return Rejected; - const QString key = Constants::EXTRA_PREPROCESSOR_DIRECTIVES + m_filePath.toString(); + const Key key = Constants::EXTRA_PREPROCESSOR_DIRECTIVES + keyFromString(m_filePath.toString()); Core::SessionManager::setValue(key, extraPreprocessorDirectives()); return Accepted; diff --git a/src/plugins/cppeditor/cppquickfixprojectsettings.cpp b/src/plugins/cppeditor/cppquickfixprojectsettings.cpp index d4d0f9b1de6..6c4c6cfbe68 100644 --- a/src/plugins/cppeditor/cppquickfixprojectsettings.cpp +++ b/src/plugins/cppeditor/cppquickfixprojectsettings.cpp @@ -13,6 +13,8 @@ #include <QSettings> #include <QtDebug> +using namespace Utils; + namespace CppEditor { namespace Internal { @@ -64,7 +66,7 @@ const Utils::FilePath &CppQuickFixProjectsSettings::filePathOfSettingsFile() con CppQuickFixProjectsSettings::CppQuickFixProjectsSettingsPtr CppQuickFixProjectsSettings::getSettings( ProjectExplorer::Project *project) { - const QString key = "CppQuickFixProjectsSettings"; + const Key key = "CppQuickFixProjectsSettings"; QVariant v = project->extraData(key); if (v.isNull()) { v = QVariant::fromValue( diff --git a/src/plugins/cppeditor/cpptoolssettings.cpp b/src/plugins/cppeditor/cpptoolssettings.cpp index da01d9c09e5..49ceb0c963b 100644 --- a/src/plugins/cppeditor/cpptoolssettings.cpp +++ b/src/plugins/cppeditor/cpptoolssettings.cpp @@ -25,6 +25,7 @@ const bool kSortEditorDocumentOutlineDefault = true; using namespace Core; using namespace TextEditor; +using namespace Utils; namespace CppEditor { namespace Internal { @@ -128,7 +129,7 @@ CppToolsSettings::CppToolsSettings() pool->loadCustomCodeStyles(); // load global settings (after built-in settings are added to the pool) - d->m_globalCodeStyle->fromSettings(QLatin1String(Constants::CPP_SETTINGS_ID)); + d->m_globalCodeStyle->fromSettings(Constants::CPP_SETTINGS_ID); // mimetypes to be handled TextEditorSettings::registerMimeTypeForLanguageId(Constants::C_SOURCE_MIMETYPE, Constants::CPP_SETTINGS_ID); @@ -158,11 +159,10 @@ CppCodeStylePreferences *CppToolsSettings::cppCodeStyle() return d->m_globalCodeStyle; } -static QString sortEditorDocumentOutlineKey() +static Key sortEditorDocumentOutlineKey() { - return QLatin1String(Constants::CPPEDITOR_SETTINGSGROUP) - + QLatin1Char('/') - + QLatin1String(Constants::CPPEDITOR_SORT_EDITOR_DOCUMENT_OUTLINE); + return Key(Constants::CPPEDITOR_SETTINGSGROUP) + + '/' + Constants::CPPEDITOR_SORT_EDITOR_DOCUMENT_OUTLINE; } bool CppToolsSettings::sortedEditorDocumentOutline() diff --git a/src/plugins/cvs/cvssettings.cpp b/src/plugins/cvs/cvssettings.cpp index c6f9350b256..3a653d3804e 100644 --- a/src/plugins/cvs/cvssettings.cpp +++ b/src/plugins/cvs/cvssettings.cpp @@ -31,7 +31,7 @@ CvsSettings::CvsSettings() binaryPath.setDefaultValue("cvs" QTC_HOST_EXE_SUFFIX); binaryPath.setExpectedKind(PathChooser::ExistingCommand); - binaryPath.setHistoryCompleter(QLatin1String("Cvs.Command.History")); + binaryPath.setHistoryCompleter("Cvs.Command.History"); binaryPath.setDisplayName(Tr::tr("CVS Command")); binaryPath.setLabelText(Tr::tr("CVS command:")); diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 9418c704d6f..bb24d674a09 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -34,7 +34,7 @@ CommonSettings &commonSettings() CommonSettings::CommonSettings() { setAutoApply(false); - const QString debugModeGroup("DebugMode"); + const Key debugModeGroup("DebugMode"); useAlternatingRowColors.setSettingsKey(debugModeGroup, "UseAlternatingRowColours"); useAlternatingRowColors.setLabelText(Tr::tr("Use alternating row colors in debug views")); @@ -220,7 +220,7 @@ LocalsAndExpressionsSettings::LocalsAndExpressionsSettings() { setAutoApply(false); - const QString debugModeGroup("DebugMode"); + const Key debugModeGroup("DebugMode"); useDebuggingHelpers.setSettingsKey(debugModeGroup, "UseDebuggingHelper"); useDebuggingHelpers.setDefaultValue(true); diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index c6f91192396..ab9d29eabf4 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -86,8 +86,8 @@ DebuggerSettings::DebuggerSettings() : displayStringLimit{localsAndExpressionSettings().displayStringLimit}, defaultArraySize{localsAndExpressionSettings().defaultArraySize} { - const QString debugModeGroup("DebugMode"); - const QString cdbSettingsGroup("CDB2"); + const Key debugModeGroup("DebugMode"); + const Key cdbSettingsGroup("CDB2"); settingsDialog.setLabelText(Tr::tr("Configure Debugger...")); @@ -238,7 +238,7 @@ DebuggerSettings::DebuggerSettings() : // // QML Tools // - const QString qmlInspectorGroup = "QML.Inspector"; + const Key qmlInspectorGroup = "QML.Inspector"; showAppOnTop.setSettingsKey(qmlInspectorGroup, "QmlInspector.ShowAppOnTop"); @@ -288,7 +288,7 @@ QString DebuggerSettings::dump() { QStringList msg; settings().all.forEachAspect([&msg](BaseAspect *aspect) { - QString key = aspect->settingsKey(); + Key key = aspect->settingsKey(); if (!key.isEmpty()) { const int pos = key.indexOf('/'); if (pos >= 0) diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index 241ac32ecdd..c80ce3deb17 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -78,7 +78,7 @@ DebuggerItem::DebuggerItem(const QVariant &id) m_id = id; } -DebuggerItem::DebuggerItem(const QVariantMap &data) +DebuggerItem::DebuggerItem(const Store &data) { m_id = data.value(DEBUGGER_INFORMATION_ID).toString(); m_command = FilePath::fromSettings(data.value(DEBUGGER_INFORMATION_COMMAND)); @@ -345,9 +345,9 @@ bool DebuggerItem::operator==(const DebuggerItem &other) const && m_workingDirectory == other.m_workingDirectory; } -QVariantMap DebuggerItem::toMap() const +Store DebuggerItem::toMap() const { - QVariantMap data; + Store data; data.insert(DEBUGGER_INFORMATION_DISPLAYNAME, m_unexpandedDisplayName); data.insert(DEBUGGER_INFORMATION_ID, m_id); data.insert(DEBUGGER_INFORMATION_COMMAND, m_command.toSettings()); diff --git a/src/plugins/debugger/debuggeritem.h b/src/plugins/debugger/debuggeritem.h index e32ded91f86..dcdd80ad7ce 100644 --- a/src/plugins/debugger/debuggeritem.h +++ b/src/plugins/debugger/debuggeritem.h @@ -30,7 +30,7 @@ class DEBUGGER_EXPORT DebuggerItem { public: DebuggerItem(); - DebuggerItem(const QVariantMap &data); + DebuggerItem(const Utils::Store &data); void createId(); bool canClone() const { return true; } diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index dccc18290e7..64ec70193c0 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -755,7 +755,7 @@ void DebuggerItemModel::readDebuggers(const FilePath &fileName, bool isSystem) PersistentSettingsReader reader; if (!reader.load(fileName)) return; - QVariantMap data = reader.restoreValues(); + Store data = reader.restoreValues(); // Check version int version = data.value(DEBUGGER_FILE_VERSION_KEY, 0).toInt(); @@ -764,10 +764,10 @@ void DebuggerItemModel::readDebuggers(const FilePath &fileName, bool isSystem) int count = data.value(DEBUGGER_COUNT_KEY, 0).toInt(); for (int i = 0; i < count; ++i) { - const QString key = DEBUGGER_DATA_KEY + QString::number(i); + const Key key = DEBUGGER_DATA_KEY + Key::number(i); if (!data.contains(key)) continue; - const QVariantMap dbMap = data.value(key).toMap(); + const Store dbMap = data.value(key).value<Store>(); DebuggerItem item(dbMap); if (isSystem) { item.setAutoDetected(true); @@ -811,7 +811,7 @@ void DebuggerItemModel::restoreDebuggers() void DebuggerItemModel::saveDebuggers() { - QVariantMap data; + Store data; data.insert(DEBUGGER_FILE_VERSION_KEY, 1); int count = 0; @@ -819,9 +819,9 @@ void DebuggerItemModel::saveDebuggers() if (item.isGeneric()) // do not store generic debuggers, these get added automatically return; if (item.isValid() && item.engineType() != NoEngineType) { - QVariantMap tmp = item.toMap(); + Store tmp = item.toMap(); if (!tmp.isEmpty()) { - data.insert(DEBUGGER_DATA_KEY + QString::number(count), tmp); + data.insert(DEBUGGER_DATA_KEY + Key::number(count), QVariant::fromValue(tmp)); ++count; } } diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index e37381f18de..b8e0f1344fd 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -795,9 +795,9 @@ void DockerDevice::fromMap(const Store &map) d->setData(data); } -QVariantMap DockerDevice::toMap() const +Store DockerDevice::toMap() const { - QVariantMap map = ProjectExplorer::IDevice::toMap(); + Store map = ProjectExplorer::IDevice::toMap(); DockerDeviceData data = d->data(); map.insert(DockerDeviceDataRepoKey, data.repo); diff --git a/src/plugins/incredibuild/buildconsolebuildstep.cpp b/src/plugins/incredibuild/buildconsolebuildstep.cpp index 19ac73dd0cf..61b40a8b2f9 100644 --- a/src/plugins/incredibuild/buildconsolebuildstep.cpp +++ b/src/plugins/incredibuild/buildconsolebuildstep.cpp @@ -155,7 +155,7 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id monFile.setLabelText(Tr::tr("Save IncrediBuild monitor file:")); monFile.setExpectedKind(PathChooser::Kind::Any); monFile.setBaseFileName(PathChooser::homePath()); - monFile.setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.MonFile.History")); + monFile.setHistoryCompleter("IncrediBuild.BuildConsole.MonFile.History"); monFile.setToolTip(Tr::tr("Writes a copy of the build progress file (.ib_mon) to the specified " "location. If only a folder name is given, a generated GUID will serve " "as the file name. The full path of the saved Build Monitor will be " @@ -169,7 +169,7 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id logFile.setLabelText(Tr::tr("Output Log file:")); logFile.setExpectedKind(PathChooser::Kind::SaveFile); logFile.setBaseFileName(PathChooser::homePath()); - logFile.setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.LogFile.History")); + logFile.setHistoryCompleter("IncrediBuild.BuildConsole.LogFile.History"); logFile.setToolTip(Tr::tr("Writes build output to a file.")); showCmd.setSettingsKey("IncrediBuild.BuildConsole.ShowCmd"); diff --git a/src/plugins/incredibuild/commandbuilder.cpp b/src/plugins/incredibuild/commandbuilder.cpp index ffe2f2f8c0d..5d99ed2e8ab 100644 --- a/src/plugins/incredibuild/commandbuilder.cpp +++ b/src/plugins/incredibuild/commandbuilder.cpp @@ -12,6 +12,11 @@ namespace IncrediBuild::Internal { const char CUSTOMCOMMANDBUILDER_COMMAND[] = "IncrediBuild.BuildConsole.%1.Command"; const char CUSTOMCOMMANDBUILDER_ARGS[] = "IncrediBuild.BuildConsole.%1.Arguments"; +static Key key(const QString &pattern, const QString &id) +{ + return keyFromString(pattern.arg(id)); +} + QString CommandBuilder::displayName() const { return Tr::tr("Custom Command"); @@ -19,14 +24,14 @@ QString CommandBuilder::displayName() const void CommandBuilder::fromMap(const Store &map) { - m_command = FilePath::fromSettings(map.value(QString(CUSTOMCOMMANDBUILDER_COMMAND).arg(id()))); - m_args = map.value(QString(CUSTOMCOMMANDBUILDER_ARGS).arg(id())).toString(); + m_command = FilePath::fromSettings(map.value(key(CUSTOMCOMMANDBUILDER_COMMAND, id()))); + m_args = map.value(key(CUSTOMCOMMANDBUILDER_ARGS, id())).toString(); } -void CommandBuilder::toMap(QVariantMap *map) const +void CommandBuilder::toMap(Store *map) const { - (*map)[QString(CUSTOMCOMMANDBUILDER_COMMAND).arg(id())] = m_command.toSettings(); - (*map)[QString(CUSTOMCOMMANDBUILDER_ARGS).arg(id())] = QVariant(m_args); + map->insert(key(CUSTOMCOMMANDBUILDER_COMMAND, id()), m_command.toSettings()); + map->insert(key(CUSTOMCOMMANDBUILDER_ARGS, id()), QVariant(m_args)); } void CommandBuilder::setCommand(const FilePath &command) diff --git a/src/plugins/incredibuild/commandbuilder.h b/src/plugins/incredibuild/commandbuilder.h index 2a2115344ff..bebc0934f12 100644 --- a/src/plugins/incredibuild/commandbuilder.h +++ b/src/plugins/incredibuild/commandbuilder.h @@ -21,7 +21,7 @@ public: virtual QString displayName() const; virtual void fromMap(const Utils::Store &map); - virtual void toMap(QVariantMap *map) const; + virtual void toMap(Utils::Store *map) const; virtual Utils::FilePath defaultCommand() const { return {}; } virtual QString defaultArguments() const { return QString(); } diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index 200f6772d22..1b1ff9e29ca 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -563,9 +563,9 @@ Client *BaseSettings::createClient(BaseClientInterface *interface) const return new Client(interface); } -QVariantMap BaseSettings::toMap() const +Store BaseSettings::toMap() const { - QVariantMap map; + Store map; map.insert(typeIdKey, m_settingsTypeId.toSetting()); map.insert(nameKey, m_name); map.insert(idKey, m_id); @@ -612,8 +612,8 @@ QList<BaseSettings *> LanguageClientSettings::fromSettings(QSettings *settingsIn for (auto varList : {settingsIn->value(clientsKey).toList(), settingsIn->value(typedClientsKey).toList()}) { for (const QVariant &var : varList) { - const QMap<QString, QVariant> &map = var.toMap(); - Utils::Id typeId = Utils::Id::fromSetting(map.value(typeIdKey)); + const Store map = var.value<Store>(); + Id typeId = Id::fromSetting(map.value(typeIdKey)); if (!typeId.isValid()) typeId = Constants::LANGUAGECLIENT_STDIO_SETTINGS_ID; if (BaseSettings *settings = generateSettings(typeId)) { @@ -659,7 +659,7 @@ void LanguageClientSettings::toSettings(QSettings *settings, settings->beginGroup(settingsGroupKey); auto transform = [](const QList<BaseSettings *> &settings) { return Utils::transform(settings, [](const BaseSettings *setting) { - return QVariant(setting->toMap()); + return QVariant::fromValue(setting->toMap()); }); }; auto isStdioSetting = Utils::equal(&BaseSettings::m_settingsTypeId, @@ -714,9 +714,9 @@ bool StdIOSettings::isValid() const return BaseSettings::isValid() && !m_executable.isEmpty(); } -QVariantMap StdIOSettings::toMap() const +Store StdIOSettings::toMap() const { - QVariantMap map = BaseSettings::toMap(); + Store map = BaseSettings::toMap(); map.insert(executableKey, m_executable.toSettings()); map.insert(argumentsKey, m_arguments); return map; diff --git a/src/plugins/mesonprojectmanager/mesonwrapper.h b/src/plugins/mesonprojectmanager/mesonwrapper.h index 6ec1e57a0f1..4312a63c34e 100644 --- a/src/plugins/mesonprojectmanager/mesonwrapper.h +++ b/src/plugins/mesonprojectmanager/mesonwrapper.h @@ -78,18 +78,18 @@ public: Command introspect(const Utils::FilePath &sourceDirectory) const; - static inline std::optional<Utils::FilePath> find() + static std::optional<Utils::FilePath> find() { return ToolWrapper::findTool({"meson.py", "meson"}); } - static inline QString toolName() { return {"Meson"}; }; + static QString toolName() { return {"Meson"}; } }; template<> -inline QVariantMap toVariantMap<MesonWrapper>(const MesonWrapper &meson) +inline Utils::Store toVariantMap<MesonWrapper>(const MesonWrapper &meson) { - QVariantMap data; + Utils::Store data; data.insert(Constants::ToolsSettings::NAME_KEY, meson.m_name); data.insert(Constants::ToolsSettings::EXE_KEY, meson.m_exe.toSettings()); data.insert(Constants::ToolsSettings::AUTO_DETECTED_KEY, meson.m_autoDetected); @@ -98,7 +98,7 @@ inline QVariantMap toVariantMap<MesonWrapper>(const MesonWrapper &meson) return data; } template<> -inline MesonWrapper *fromVariantMap<MesonWrapper *>(const QVariantMap &data) +inline MesonWrapper *fromVariantMap<MesonWrapper *>(const Utils::Store &data) { return new MesonWrapper(data[Constants::ToolsSettings::NAME_KEY].toString(), Utils::FilePath::fromSettings(data[Constants::ToolsSettings::EXE_KEY]), diff --git a/src/plugins/mesonprojectmanager/ninjawrapper.h b/src/plugins/mesonprojectmanager/ninjawrapper.h index 4b99fdf4020..93339d37f9e 100644 --- a/src/plugins/mesonprojectmanager/ninjawrapper.h +++ b/src/plugins/mesonprojectmanager/ninjawrapper.h @@ -14,17 +14,17 @@ class NinjaWrapper final : public ToolWrapper public: using ToolWrapper::ToolWrapper; - static inline std::optional<Utils::FilePath> find() + static std::optional<Utils::FilePath> find() { return ToolWrapper::findTool({"ninja", "ninja-build"}); } - static inline QString toolName() { return {"Ninja"}; }; + static QString toolName() { return {"Ninja"}; } }; template<> -inline QVariantMap toVariantMap<NinjaWrapper>(const NinjaWrapper &meson) +inline Utils::Store toVariantMap<NinjaWrapper>(const NinjaWrapper &meson) { - QVariantMap data; + Utils::Store data; data.insert(Constants::ToolsSettings::NAME_KEY, meson.m_name); data.insert(Constants::ToolsSettings::EXE_KEY, meson.m_exe.toSettings()); data.insert(Constants::ToolsSettings::AUTO_DETECTED_KEY, meson.m_autoDetected); @@ -33,7 +33,7 @@ inline QVariantMap toVariantMap<NinjaWrapper>(const NinjaWrapper &meson) return data; } template<> -inline NinjaWrapper *fromVariantMap<NinjaWrapper *>(const QVariantMap &data) +inline NinjaWrapper *fromVariantMap<NinjaWrapper *>(const Utils::Store &data) { return new NinjaWrapper(data[Constants::ToolsSettings::NAME_KEY].toString(), Utils::FilePath::fromSettings(data[Constants::ToolsSettings::EXE_KEY]), diff --git a/src/plugins/mesonprojectmanager/toolitemsettings.cpp b/src/plugins/mesonprojectmanager/toolitemsettings.cpp index a0591b905c5..1b66cc2d03d 100644 --- a/src/plugins/mesonprojectmanager/toolitemsettings.cpp +++ b/src/plugins/mesonprojectmanager/toolitemsettings.cpp @@ -22,7 +22,7 @@ ToolItemSettings::ToolItemSettings(QWidget *parent) m_mesonPathChooser = new PathChooser; m_mesonPathChooser->setExpectedKind(PathChooser::ExistingCommand); - m_mesonPathChooser->setHistoryCompleter(QLatin1String("Meson.Command.History")); + m_mesonPathChooser->setHistoryCompleter("Meson.Command.History"); using namespace Layouting; diff --git a/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp b/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp index 539e5c11243..92dc4f41d02 100644 --- a/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp +++ b/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp @@ -7,20 +7,23 @@ #include "mesonprojectmanagertr.h" #include <coreplugin/icore.h> -#include <utils/fileutils.h> + +#include <utils/filepath.h> +#include <utils/store.h> #include <QGuiApplication> -#include <QVariantMap> #include <iterator> #include <vector> +using namespace Utils; + namespace MesonProjectManager { namespace Internal { -static QString entryName(int index) +static Key entryName(int index) { - return QString("%1%2").arg(Constants::ToolsSettings::ENTRY_KEY).arg(index); + return Constants::ToolsSettings::ENTRY_KEY + Key::number(index); } ToolsSettingsAccessor::ToolsSettingsAccessor() @@ -34,16 +37,16 @@ void ToolsSettingsAccessor::saveMesonTools(const std::vector<MesonTools::Tool_t> QWidget *parent) { using namespace Constants; - QVariantMap data; + Store data; int entry_count = 0; for (const MesonTools::Tool_t &tool : tools) { auto asMeson = std::dynamic_pointer_cast<MesonWrapper>(tool); if (asMeson) - data.insert(entryName(entry_count), toVariantMap<MesonWrapper>(*asMeson)); + data.insert(entryName(entry_count), QVariant::fromValue(toVariantMap<MesonWrapper>(*asMeson))); else { auto asNinja = std::dynamic_pointer_cast<NinjaWrapper>(tool); if (asNinja) - data.insert(entryName(entry_count), toVariantMap<NinjaWrapper>(*asNinja)); + data.insert(entryName(entry_count), QVariant::fromValue(toVariantMap<NinjaWrapper>(*asNinja))); } entry_count++; } @@ -58,14 +61,14 @@ std::vector<MesonTools::Tool_t> ToolsSettingsAccessor::loadMesonTools(QWidget *p auto entry_count = data.value(ToolsSettings::ENTRY_COUNT, 0).toInt(); std::vector<MesonTools::Tool_t> result; for (auto toolIndex = 0; toolIndex < entry_count; toolIndex++) { - auto name = entryName(toolIndex); + Key name = entryName(toolIndex); if (data.contains(name)) { const auto map = data[name].toMap(); auto type = map.value(ToolsSettings::TOOL_TYPE_KEY, ToolsSettings::TOOL_TYPE_MESON); if (type == ToolsSettings::TOOL_TYPE_NINJA) - result.emplace_back(fromVariantMap<NinjaWrapper *>(data[name].toMap())); + result.emplace_back(fromVariantMap<NinjaWrapper *>(data[name].value<Store>())); else - result.emplace_back(fromVariantMap<MesonWrapper *>(data[name].toMap())); + result.emplace_back(fromVariantMap<MesonWrapper *>(data[name].value<Store>())); } } return result; diff --git a/src/plugins/mesonprojectmanager/toolwrapper.cpp b/src/plugins/mesonprojectmanager/toolwrapper.cpp index 83ed27f495d..632465c219e 100644 --- a/src/plugins/mesonprojectmanager/toolwrapper.cpp +++ b/src/plugins/mesonprojectmanager/toolwrapper.cpp @@ -5,6 +5,8 @@ #include <utils/process.h> +#include <QUuid> + namespace MesonProjectManager { namespace Internal { diff --git a/src/plugins/mesonprojectmanager/toolwrapper.h b/src/plugins/mesonprojectmanager/toolwrapper.h index be7bbb5a11d..47fe583eff3 100644 --- a/src/plugins/mesonprojectmanager/toolwrapper.h +++ b/src/plugins/mesonprojectmanager/toolwrapper.h @@ -7,14 +7,9 @@ #include <utils/commandline.h> #include <utils/environment.h> -#include <utils/fileutils.h> #include <utils/id.h> #include <utils/qtcassert.h> - -#include <QFileInfo> -#include <QUuid> -#include <QVariant> -#include <QVariantMap> +#include <utils/store.h> #include <optional> @@ -32,17 +27,17 @@ public: : m_cmd{exe, args} , m_workDir{workDir} {} - inline const Utils::CommandLine &cmdLine() const { return m_cmd; } - inline const Utils::FilePath &workDir() const { return m_workDir; } - inline Utils::FilePath executable() const { return m_cmd.executable(); } - inline QStringList arguments() const { return m_cmd.splitArguments(); } - inline QString toUserOutput() const { return m_cmd.toUserOutput(); }; + const Utils::CommandLine &cmdLine() const { return m_cmd; } + const Utils::FilePath &workDir() const { return m_workDir; } + Utils::FilePath executable() const { return m_cmd.executable(); } + QStringList arguments() const { return m_cmd.splitArguments(); } + QString toUserOutput() const { return m_cmd.toUserOutput(); } }; class ToolWrapper { public: - virtual ~ToolWrapper(){}; + virtual ~ToolWrapper() {} ToolWrapper() = delete; ToolWrapper(const QString &name, const Utils::FilePath &path, bool autoDetected = false); ToolWrapper(const QString &name, @@ -54,12 +49,12 @@ public: ToolWrapper &operator=(const ToolWrapper &other) = default; ToolWrapper &operator=(ToolWrapper &&other) = default; - inline const Version &version() const noexcept { return m_version; }; - inline bool isValid() const noexcept { return m_isValid; }; - inline bool autoDetected() const noexcept { return m_autoDetected; }; - inline Utils::Id id() const noexcept { return m_id; }; - inline Utils::FilePath exe() const noexcept { return m_exe; }; - inline QString name() const noexcept { return m_name; }; + const Version &version() const noexcept { return m_version; } + bool isValid() const noexcept { return m_isValid; } + bool autoDetected() const noexcept { return m_autoDetected; } + Utils::Id id() const noexcept { return m_id; } + Utils::FilePath exe() const noexcept { return m_exe; } + QString name() const noexcept { return m_name; } inline void setName(const QString &newName) { m_name = newName; } virtual void setExe(const Utils::FilePath &newExe); @@ -69,9 +64,9 @@ public: static std::optional<Utils::FilePath> findTool(const QStringList &exeNames); template<typename T> - friend QVariantMap toVariantMap(const T &); + friend Utils::Store toVariantMap(const T &); template<typename T> - friend T fromVariantMap(const QVariantMap &); + friend T fromVariantMap(const Utils::Store &); protected: Version m_version; @@ -83,9 +78,9 @@ protected: }; template<typename T> -QVariantMap toVariantMap(const T &); +Utils::Store toVariantMap(const T &); template<typename T> -T fromVariantMap(const QVariantMap &); +T fromVariantMap(const Utils::Store &); } // namespace Internal } // namespace MesonProjectManager diff --git a/src/plugins/nim/nimconstants.h b/src/plugins/nim/nimconstants.h index 3c0b6f4cb31..31dfd8c469e 100644 --- a/src/plugins/nim/nimconstants.h +++ b/src/plugins/nim/nimconstants.h @@ -35,9 +35,9 @@ const char C_NIMBLETASKSTEP_TASKARGS[] = "Nim.NimbleTaskStep.TaskArgs"; // NimCompilerBuildStep const char C_NIMCOMPILERBUILDSTEP_ID[] = "Nim.NimCompilerBuildStep"; -const QString C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS = QStringLiteral("Nim.NimCompilerBuildStep.UserCompilerOptions"); -const QString C_NIMCOMPILERBUILDSTEP_DEFAULTBUILDOPTIONS = QStringLiteral("Nim.NimCompilerBuildStep.DefaultBuildOptions"); -const QString C_NIMCOMPILERBUILDSTEP_TARGETNIMFILE = QStringLiteral("Nim.NimCompilerBuildStep.TargetNimFile"); +const char C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS[] = "Nim.NimCompilerBuildStep.UserCompilerOptions"; +const char C_NIMCOMPILERBUILDSTEP_DEFAULTBUILDOPTIONS[] = "Nim.NimCompilerBuildStep.DefaultBuildOptions"; +const char C_NIMCOMPILERBUILDSTEP_TARGETNIMFILE[] = "Nim.NimCompilerBuildStep.TargetNimFile"; // NimCompilerCleanStep const char C_NIMCOMPILERCLEANSTEP_ID[] = "Nim.NimCompilerCleanStep"; diff --git a/src/plugins/nim/settings/nimcodestylesettingspage.cpp b/src/plugins/nim/settings/nimcodestylesettingspage.cpp index c2b0d6d194b..270097508f8 100644 --- a/src/plugins/nim/settings/nimcodestylesettingspage.cpp +++ b/src/plugins/nim/settings/nimcodestylesettingspage.cpp @@ -67,7 +67,7 @@ static void createGlobalCodeStyle() pool->loadCustomCodeStyles(); // load global settings (after built-in settings are added to the pool) - m_globalCodeStyle->fromSettings(QLatin1String(Nim::Constants::C_NIMLANGUAGE_ID)); + m_globalCodeStyle->fromSettings(Nim::Constants::C_NIMLANGUAGE_ID); TextEditorSettings::registerMimeTypeForLanguageId(Nim::Constants::C_NIM_MIMETYPE, Nim::Constants::C_NIMLANGUAGE_ID); @@ -111,7 +111,7 @@ public: void apply() final { QTC_ASSERT(m_globalCodeStyle, return); - m_globalCodeStyle->toSettings(QLatin1String(Nim::Constants::C_NIMLANGUAGE_ID)); + m_globalCodeStyle->toSettings(Nim::Constants::C_NIMLANGUAGE_ID); } private: diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/classdefinition.cpp b/src/plugins/qmakeprojectmanager/customwidgetwizard/classdefinition.cpp index 22958e08197..d3c543ab9d7 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/classdefinition.cpp +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/classdefinition.cpp @@ -43,7 +43,7 @@ ClassDefinition::ClassDefinition(QWidget *parent) : m_pluginSourceEdit = new QLineEdit; m_iconPathChooser = new Utils::PathChooser; m_iconPathChooser->setExpectedKind(Utils::PathChooser::File); - m_iconPathChooser->setHistoryCompleter(QLatin1String("Qmake.Icon.History")); + m_iconPathChooser->setHistoryCompleter("Qmake.Icon.History"); m_iconPathChooser->setPromptDialogTitle(Tr::tr("Select Icon")); m_iconPathChooser->setPromptDialogFilter(Tr::tr("Icon files (*.png *.ico *.jpg *.xpm *.tif *.svg)")); Form { diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 4fb123079e7..8806e2a79b3 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -190,7 +190,7 @@ QmakeBuildConfiguration::~QmakeBuildConfiguration() void QmakeBuildConfiguration::toMap(Store &map) const { BuildConfiguration::toMap(map); - map.insert(QLatin1String(BUILD_CONFIGURATION_KEY), int(m_qmakeBuildConfiguration)); + map.insert(BUILD_CONFIGURATION_KEY, int(m_qmakeBuildConfiguration)); } void QmakeBuildConfiguration::fromMap(const Store &map) @@ -199,7 +199,7 @@ void QmakeBuildConfiguration::fromMap(const Store &map) if (hasError()) return; - m_qmakeBuildConfiguration = QtVersion::QmakeBuildConfigs(map.value(QLatin1String(BUILD_CONFIGURATION_KEY)).toInt()); + m_qmakeBuildConfiguration = QtVersion::QmakeBuildConfigs(map.value(BUILD_CONFIGURATION_KEY).toInt()); m_lastKitState = LastKitState(kit()); } diff --git a/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp b/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp index ad7b664431c..4917e8c59ac 100644 --- a/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp +++ b/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp @@ -75,7 +75,7 @@ bool ComponentNameDialog::go(QString *proposedName, *proposedName = QLatin1String("MyComponent"); d.m_componentNameEdit->setText(*proposedName); d.m_pathEdit->setExpectedKind(Utils::PathChooser::ExistingDirectory); - d.m_pathEdit->setHistoryCompleter(QLatin1String("QmlJs.Component.History")); + d.m_pathEdit->setHistoryCompleter("QmlJs.Component.History"); d.m_pathEdit->setPath(*proposedPath); d.m_label->setText(Tr::tr("Property assignments for %1:").arg(oldFileName)); d.m_checkBox->setChecked(isUiFile); diff --git a/src/plugins/qmljstools/qmljscodestylepreferences.cpp b/src/plugins/qmljstools/qmljscodestylepreferences.cpp index 4186197431b..f19c40a7b88 100644 --- a/src/plugins/qmljstools/qmljscodestylepreferences.cpp +++ b/src/plugins/qmljstools/qmljscodestylepreferences.cpp @@ -69,11 +69,11 @@ void QmlJSCodeStylePreferences::slotCurrentValueChanged(const QVariant &value) emit currentCodeStyleSettingsChanged(value.value<QmlJSCodeStyleSettings>()); } -QVariantMap QmlJSCodeStylePreferences::toMap() const +Store QmlJSCodeStylePreferences::toMap() const { - QVariantMap map = ICodeStylePreferences::toMap(); + Store map = ICodeStylePreferences::toMap(); if (!currentDelegate()) { - const QVariantMap dataMap = m_data.toMap(); + const Store dataMap = m_data.toMap(); for (auto it = dataMap.begin(), end = dataMap.end(); it != end; ++it) map.insert(it.key(), it.value()); } diff --git a/src/plugins/qmljstools/qmljscodestylesettings.cpp b/src/plugins/qmljstools/qmljscodestylesettings.cpp index cce1f4112f5..e08575af66a 100644 --- a/src/plugins/qmljstools/qmljscodestylesettings.cpp +++ b/src/plugins/qmljstools/qmljscodestylesettings.cpp @@ -27,7 +27,7 @@ namespace QmlJSTools { QmlJSCodeStyleSettings::QmlJSCodeStyleSettings() = default; -QVariantMap QmlJSCodeStyleSettings::toMap() const +Store QmlJSCodeStyleSettings::toMap() const { return { {lineLengthKey, lineLength} diff --git a/src/plugins/qmljstools/qmljscodestylesettingspage.cpp b/src/plugins/qmljstools/qmljscodestylesettingspage.cpp index a48ce825ea4..f332f1ad0dc 100644 --- a/src/plugins/qmljstools/qmljscodestylesettingspage.cpp +++ b/src/plugins/qmljstools/qmljscodestylesettingspage.cpp @@ -147,15 +147,15 @@ public: QmlJSCodeStylePreferences *originalPreferences = QmlJSToolsSettings::globalCodeStyle(); if (originalPreferences->codeStyleSettings() != m_preferences.codeStyleSettings()) { originalPreferences->setCodeStyleSettings(m_preferences.codeStyleSettings()); - originalPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID)); + originalPreferences->toSettings(QmlJSTools::Constants::QML_JS_SETTINGS_ID); } if (originalPreferences->tabSettings() != m_preferences.tabSettings()) { originalPreferences->setTabSettings(m_preferences.tabSettings()); - originalPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID)); + originalPreferences->toSettings(QmlJSTools::Constants::QML_JS_SETTINGS_ID); } if (originalPreferences->currentDelegate() != m_preferences.currentDelegate()) { originalPreferences->setCurrentDelegate(m_preferences.currentDelegate()); - originalPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID)); + originalPreferences->toSettings(QmlJSTools::Constants::QML_JS_SETTINGS_ID); } } diff --git a/src/plugins/qmljstools/qmljstoolssettings.cpp b/src/plugins/qmljstools/qmljstoolssettings.cpp index 5a7e0ac309e..bb4c813ce05 100644 --- a/src/plugins/qmljstools/qmljstoolssettings.cpp +++ b/src/plugins/qmljstools/qmljstoolssettings.cpp @@ -68,7 +68,7 @@ QmlJSToolsSettings::QmlJSToolsSettings() pool->loadCustomCodeStyles(); // load global settings (after built-in settings are added to the pool) - m_globalCodeStyle->fromSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID)); + m_globalCodeStyle->fromSettings(QmlJSTools::Constants::QML_JS_SETTINGS_ID); // mimetypes to be handled TextEditorSettings::registerMimeTypeForLanguageId(Constants::QML_MIMETYPE, Constants::QML_JS_SETTINGS_ID); diff --git a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp index 4c56cf316fe..19bf396ce7b 100644 --- a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp +++ b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp @@ -27,7 +27,7 @@ using namespace QmlPreview::Internal; namespace QmlPreview { -static const QString QmlServerUrl = "QmlServerUrl"; +static const Key QmlServerUrl = "QmlServerUrl"; class QmlPreviewRunner : public ProjectExplorer::RunWorker { diff --git a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp index cee980479c7..8ca68acbc3e 100644 --- a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp +++ b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp @@ -62,7 +62,7 @@ QmlMultiLanguageAspect::QmlMultiLanguageAspect(AspectContainer *container) setToolTip(Tr::tr("Reads translations from MultiLanguage plugin.")); setDefaultValue(!databaseFilePath().isEmpty()); - QVariantMap getDefaultValues; + Store getDefaultValues; fromMap(getDefaultValues); addDataExtractor(this, &QmlMultiLanguageAspect::origin, &Data::origin); diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 248eabfdd35..046154af645 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -682,9 +682,9 @@ void QtVersion::fromMap(const Store &map, const FilePath &filePath) d->m_qmlRuntimePath.clear(); } -QVariantMap QtVersion::toMap() const +Store QtVersion::toMap() const { - QVariantMap result; + Store result; result.insert(Constants::QTVERSIONID, uniqueId()); d->m_data.unexpandedDisplayName.toMap(result, Constants::QTVERSIONNAME); @@ -2323,7 +2323,7 @@ bool QtVersionFactory::canRestore(const QString &type) return type == m_supportedType; } -QtVersion *QtVersionFactory::restore(const QString &type, const QVariantMap &data, const FilePath &filePath) +QtVersion *QtVersionFactory::restore(const QString &type, const Store &data, const FilePath &filePath) { QTC_ASSERT(canRestore(type), return nullptr); QTC_ASSERT(m_creator, return nullptr); diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index 7bc7192185e..5e0292c7575 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp @@ -96,7 +96,7 @@ FilePath ExamplesWelcomePage::copyToAlternativeLocation(const FilePath &proFile, auto chooser = new PathChooser; txt->setBuddy(chooser); chooser->setExpectedKind(PathChooser::ExistingDirectory); - chooser->setHistoryCompleter(QLatin1String("Qt.WritableExamplesDir.History")); + chooser->setHistoryCompleter("Qt.WritableExamplesDir.History"); const FilePath defaultRootDirectory = DocumentManager::projectsDirectory(); QtcSettings *settings = ICore::settings(); chooser->setFilePath( diff --git a/src/plugins/qtsupport/qtversionfactory.h b/src/plugins/qtsupport/qtversionfactory.h index 1f29cf0394a..2832fe55fbc 100644 --- a/src/plugins/qtsupport/qtversionfactory.h +++ b/src/plugins/qtsupport/qtversionfactory.h @@ -5,7 +5,7 @@ #include "qtsupport_global.h" -#include <QVariantMap> +#include <utils/store.h> namespace Utils { class FilePath; } @@ -22,7 +22,7 @@ public: static const QList<QtVersionFactory *> allQtVersionFactories(); bool canRestore(const QString &type); - QtVersion *restore(const QString &type, const QVariantMap &data, const Utils::FilePath &workingDirectory); + QtVersion *restore(const QString &type, const Utils::Store &data, const Utils::FilePath &workingDirectory); /// factories with higher priority are asked first to identify /// a qtversion, the priority of the desktop factory is 0 and diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index b00291e6049..d8cb2407fc1 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -169,17 +169,17 @@ static bool restoreQtVersions() if (!reader.load(filename)) return false; - QVariantMap data = reader.restoreValues(); + Store data = reader.restoreValues(); // Check version: const int version = data.value(QTVERSION_FILE_VERSION_KEY, 0).toInt(); if (version < 1) return false; - const QString keyPrefix(QTVERSION_DATA_KEY); - const QVariantMap::ConstIterator dcend = data.constEnd(); - for (QVariantMap::ConstIterator it = data.constBegin(); it != dcend; ++it) { - const QString &key = it.key(); + const Key keyPrefix(QTVERSION_DATA_KEY); + const Store::ConstIterator dcend = data.constEnd(); + for (Store::ConstIterator it = data.constBegin(); it != dcend; ++it) { + const Key &key = it.key(); if (!key.startsWith(keyPrefix)) continue; bool ok; @@ -187,7 +187,7 @@ static bool restoreQtVersions() if (!ok || count < 0) continue; - const QVariantMap qtversionMap = it.value().toMap(); + const Store qtversionMap = it.value().value<Store>(); const QString type = qtversionMap.value(QTVERSION_TYPE_KEY).toString(); bool restored = false; @@ -234,7 +234,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) const QList<QtVersionFactory *> factories = QtVersionFactory::allQtVersionFactories(); PersistentSettingsReader reader; - QVariantMap data; + Store data; if (reader.load(path)) data = reader.restoreValues(); @@ -250,10 +250,10 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) QStringList sdkVersions; - const QString keyPrefix(QTVERSION_DATA_KEY); - const QVariantMap::ConstIterator dcend = data.constEnd(); - for (QVariantMap::ConstIterator it = data.constBegin(); it != dcend; ++it) { - const QString &key = it.key(); + const Key keyPrefix(QTVERSION_DATA_KEY); + const Store::ConstIterator dcend = data.constEnd(); + for (Store::ConstIterator it = data.constBegin(); it != dcend; ++it) { + const Key &key = it.key(); if (!key.startsWith(keyPrefix)) continue; bool ok; @@ -261,7 +261,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) if (!ok || count < 0) continue; - QVariantMap qtversionMap = it.value().toMap(); + Store qtversionMap = it.value().value<Store>(); const QString type = qtversionMap.value(QTVERSION_TYPE_KEY).toString(); const QString autoDetectionSource = qtversionMap.value("autodetectionSource").toString(); sdkVersions << autoDetectionSource; @@ -350,16 +350,16 @@ static void saveQtVersions() if (!m_writer) return; - QVariantMap data; + Store data; data.insert(QTVERSION_FILE_VERSION_KEY, 1); int count = 0; for (QtVersion *qtv : std::as_const(m_versions)) { - QVariantMap tmp = qtv->toMap(); + Store tmp = qtv->toMap(); if (tmp.isEmpty()) continue; tmp.insert(QTVERSION_TYPE_KEY, qtv->type()); - data.insert(QString::fromLatin1(QTVERSION_DATA_KEY) + QString::number(count), tmp); + data.insert(QTVERSION_DATA_KEY + Key::number(count), QVariant::fromValue(tmp)); ++count; } m_writer->save(data, Core::ICore::dialogParent()); diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index 46fe21426d2..ea7d48762fe 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -67,7 +67,7 @@ void setupColor(TerminalSettings *settings, const QString &label, const QColor &defaultColor) { - color.setSettingsKey(label); + color.setSettingsKey(keyFromString(label)); color.setDefaultValue(defaultColor); color.setToolTip(Tr::tr("The color used for %1.").arg(label)); settings->registerAspect(&color); From e98cc72980e45deb67af2e759dbae23f44dd3ef4 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 21 Jul 2023 11:50:15 +0200 Subject: [PATCH 0867/1777] Editors: Fix that history of editors could grow The "history of editors" is supposed to contain the order in which files/ documents were recently accessed. It is used for the "open documents window" (the Ctrl+Tab popup). In contrast to the "navigation history" it should contain each file/document only once. Since 324de13b4e6703db778010d0682ac26cff359516 items for suspended documents with the same file name were no longer removed. For suspended documents it is necessary to check for the same file name. This was so far not vital, but when we save the editor history in the session, these do not have a document when restoring, which would lead to an evergrowing editor history. Amends 324de13b4e6703db778010d0682ac26cff359516 Change-Id: Ia4b7848a1265024d0463afbf7c1cd69189c4be97 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/coreplugin/editormanager/editorview.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 90aeb397525..84297254919 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -245,8 +245,10 @@ void EditorView::updateEditorHistory(IEditor *editor, QList<EditLocation> &histo for (int i = 0; i < history.size(); ++i) { const EditLocation &item = history.at(i); - if (item.document == document - || (!item.document && !DocumentModel::indexOfFilePath(item.filePath))) { + // remove items that refer to the same document/file, + // or that are no longer in the "open documents" + if (item.document == document || (!item.document && item.filePath == document->filePath()) + || (!item.document && !DocumentModel::indexOfFilePath(item.filePath))) { history.removeAt(i--); } } From a280abe0c15255c0ec5efdc7b83acc5127d574c6 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 24 Aug 2023 10:47:46 +0200 Subject: [PATCH 0868/1777] Installer: Add README.md for mac specifics Change-Id: Ifd207bd7b1ec79f53060691dcc2bbfd6ebe6cd01 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- dist/installer/mac/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 dist/installer/mac/README.md diff --git a/dist/installer/mac/README.md b/dist/installer/mac/README.md new file mode 100644 index 00000000000..65bfa95ea2f --- /dev/null +++ b/dist/installer/mac/README.md @@ -0,0 +1,8 @@ +This folder contains various files used to build the Mac installer. + +# Entitlements + +The entitlements here will be picked up by [scripts/build.py](../../../scripts/build.py) +via [scripts/common.py](../../../scripts/common.py) `codesign_executable()` based on their name. +If you need a new application to be signed with specific entitlements, you can simply add a file +called `your-app-name.entitlements` to this folder. From 79d5493d36294240462b628063f2c07f13d6bb4c Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 24 Aug 2023 09:59:55 +0200 Subject: [PATCH 0869/1777] Utils: Warn if restoring FancyMainWindow fails Change-Id: Ia8321605d7aecab3149d1e9f7d9720bb9c3c27e6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/utils/fancymainwindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/fancymainwindow.cpp b/src/libs/utils/fancymainwindow.cpp index cd8deebb976..539df572b51 100644 --- a/src/libs/utils/fancymainwindow.cpp +++ b/src/libs/utils/fancymainwindow.cpp @@ -467,8 +467,10 @@ QHash<QString, QVariant> FancyMainWindow::saveSettings() const void FancyMainWindow::restoreSettings(const QHash<QString, QVariant> &settings) { QByteArray ba = settings.value(QLatin1String(StateKey), QByteArray()).toByteArray(); - if (!ba.isEmpty()) - restoreState(ba, settingsVersion); + if (!ba.isEmpty()) { + if (!restoreState(ba, settingsVersion)) + qWarning() << "Restoring the state of dock widgets failed."; + } bool on = settings.value(QLatin1String(AutoHideTitleBarsKey), true).toBool(); d->m_autoHideTitleBars.setChecked(on); d->m_showCentralWidget.setChecked(settings.value(ShowCentralWidgetKey, true).toBool()); From bd36af75eb4121a0ebfefc2c0f6d4685fec9df51 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 22 Aug 2023 18:44:59 +0200 Subject: [PATCH 0870/1777] CMakePM: Add F2 jump for CMAKE_SOURCE_DIR and more This will allow opening CMake files via F2 when using include statements like: include(${CMAKE_SOURCE_DIR}/cmake/api.cmake) CMAKE_BINARY_DIR and CMAKE_CURRENT_BINARY_DIR are also supported. Fixes: QTCREATORBUG-29467 Change-Id: I9adb417d98e8a8fccf6cd3e5038562db02cb28c2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../cmakeprojectmanager/cmakeeditor.cpp | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 0f2dbe39d54..4425281a9ee 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -11,6 +11,10 @@ #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/coreplugintr.h> +#include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/buildsystem.h> +#include <projectexplorer/project.h> +#include <projectexplorer/projecttree.h> #include <texteditor/textdocument.h> #include <texteditor/texteditoractionhandler.h> #include <utils/textutils.h> @@ -21,6 +25,7 @@ #include <functional> using namespace Core; +using namespace ProjectExplorer; using namespace TextEditor; namespace CMakeProjectManager::Internal { @@ -184,6 +189,26 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, QDir dir(textDocument()->filePath().toFileInfo().absolutePath()); buffer.replace("${CMAKE_CURRENT_SOURCE_DIR}", dir.path()); buffer.replace("${CMAKE_CURRENT_LIST_DIR}", dir.path()); + + if (auto project = ProjectTree::currentProject()) { + buffer.replace("${CMAKE_SOURCE_DIR}", project->projectDirectory().path()); + if (auto bs = ProjectTree::currentBuildSystem()) { + buffer.replace("${CMAKE_BINARY_DIR}", bs->buildConfiguration()->buildDirectory().path()); + + // Get the path suffix from current source dir to project source dir and apply it + // for the binary dir + const QString relativePathSuffix = textDocument() + ->filePath() + .parentDir() + .relativePathFrom(project->projectDirectory()) + .path(); + buffer.replace("${CMAKE_CURRENT_BINARY_DIR}", + bs->buildConfiguration() + ->buildDirectory() + .pathAppended(relativePathSuffix) + .path()); + } + } // TODO: Resolve more variables QString fileName = dir.filePath(unescape(buffer)); From d7d78df9dac84afc5326ec4e6015db1dce251d46 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 25 Aug 2023 13:19:26 +0200 Subject: [PATCH 0871/1777] Plugins: And more Store and Key After this one, is compiles with the opt-in macro. Not changed yet, though. Change-Id: I29a66ecb5daa71d0d97566b81fd9f47d92f6368a Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/android/androiddeployqtstep.cpp | 3 +- src/plugins/android/androidrunnerworker.cpp | 6 +- src/plugins/android/javalanguageserver.cpp | 4 +- .../baremetal/debugserverprovidermanager.cpp | 22 ++--- .../debugserverproviderssettingspage.cpp | 2 +- .../uvsc/jlinkuvscserverprovider.cpp | 4 +- .../uvsc/stlinkuvscserverprovider.cpp | 2 +- .../debugservers/uvsc/uvscserverprovider.cpp | 8 +- .../uvsc/uvtargetdeviceselection.cpp | 12 +-- .../uvsc/uvtargetdriverselection.cpp | 4 +- .../baremetal/idebugserverprovider.cpp | 8 +- src/plugins/baremetal/idebugserverprovider.h | 8 +- src/plugins/boot2qt/qdbdevice.cpp | 6 +- src/plugins/boot2qt/qdbdevicedebugsupport.cpp | 2 +- .../clangtools/clangtoolsprojectsettings.cpp | 12 +-- src/plugins/clangtools/clangtoolssettings.cpp | 18 ++-- src/plugins/clangtools/clangtoolssettings.h | 4 +- src/plugins/clangtools/settingswidget.cpp | 4 +- .../cmakebuildconfiguration.cpp | 4 +- src/plugins/ios/iosdevice.cpp | 20 ++--- src/plugins/ios/iosdevice.h | 6 +- src/plugins/ios/iosdsymbuildstep.cpp | 18 ++-- src/plugins/ios/iosrunconfiguration.cpp | 6 +- src/plugins/ios/iossimulator.cpp | 12 +-- src/plugins/mcusupport/mcuabstractpackage.h | 10 +-- src/plugins/mcusupport/mcupackage.cpp | 6 +- src/plugins/mcusupport/mcupackage.h | 11 ++- src/plugins/mcusupport/mcusupportsdk.cpp | 6 +- src/plugins/mcusupport/mcutargetdescription.h | 2 +- src/plugins/mcusupport/settingshandler.cpp | 26 +++--- src/plugins/mcusupport/settingshandler.h | 13 ++- src/plugins/mcusupport/test/packagemock.h | 7 +- .../mcusupport/test/settingshandlermock.h | 10 ++- src/plugins/mcusupport/test/unittest.cpp | 85 +++++++++---------- src/plugins/perfprofiler/perfsettings.cpp | 12 +-- .../qmlprofiler/qmlprofilerruncontrol.cpp | 2 +- src/plugins/qnx/qnxqtversion.cpp | 6 +- src/plugins/qnx/qnxsettingspage.cpp | 42 ++++----- src/plugins/qnx/qnxtoolchain.cpp | 4 +- .../abstractremotelinuxdeploystep.cpp | 4 +- .../remotelinux/deploymenttimeinfo.cpp | 34 ++++---- src/plugins/remotelinux/deploymenttimeinfo.h | 6 +- .../genericlinuxdeviceconfigurationwidget.cpp | 2 +- .../remotelinuxenvironmentaspect.cpp | 4 +- src/plugins/remotelinux/remotelinuxplugin.cpp | 2 +- src/plugins/valgrind/valgrindsettings.cpp | 2 +- 46 files changed, 246 insertions(+), 245 deletions(-) diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index d8e99a04f5b..36ea8d42dc8 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -57,7 +57,8 @@ namespace Android::Internal { static Q_LOGGING_CATEGORY(deployStepLog, "qtc.android.build.androiddeployqtstep", QtWarningMsg) -const QLatin1String UninstallPreviousPackageKey("UninstallPreviousPackage"); +const char UninstallPreviousPackageKey[] = "UninstallPreviousPackage"; + const QLatin1String InstallFailedInconsistentCertificatesString("INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES"); const QLatin1String InstallFailedUpdateIncompatible("INSTALL_FAILED_UPDATE_INCOMPATIBLE"); const QLatin1String InstallFailedPermissionModelDowngrade("INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE"); diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 6be375f30f5..b97cc7fac11 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -247,14 +247,14 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa if (target->buildConfigurations().first()->buildType() != BuildConfiguration::BuildType::Release) m_extraAppParams = runControl->commandLine().arguments(); - if (const QVariantMap sd = runControl->settingsData(Constants::ANDROID_AM_START_ARGS); + if (const Store sd = runControl->settingsData(Constants::ANDROID_AM_START_ARGS); !sd.values().isEmpty()) { QTC_CHECK(sd.first().type() == QVariant::String); const QString startArgs = sd.first().toString(); m_amStartExtraArgs = ProcessArgs::splitArgs(startArgs, OsTypeOtherUnix); } - if (const QVariantMap sd = runControl->settingsData(Constants::ANDROID_PRESTARTSHELLCMDLIST); + if (const Store sd = runControl->settingsData(Constants::ANDROID_PRESTARTSHELLCMDLIST); !sd.values().isEmpty()) { QTC_CHECK(sd.first().type() == QVariant::String); const QStringList commands = sd.first().toString().split('\n', Qt::SkipEmptyParts); @@ -262,7 +262,7 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa m_beforeStartAdbCommands.append(QString("shell %1").arg(shellCmd)); } - if (const QVariantMap sd = runControl->settingsData(Constants::ANDROID_POSTFINISHSHELLCMDLIST); + if (const Store sd = runControl->settingsData(Constants::ANDROID_POSTFINISHSHELLCMDLIST); !sd.values().isEmpty()) { QTC_CHECK(sd.first().type() == QVariant::String); const QStringList commands = sd.first().toString().split('\n', Qt::SkipEmptyParts); diff --git a/src/plugins/android/javalanguageserver.cpp b/src/plugins/android/javalanguageserver.cpp index 419edcabbd9..d6ea811f00b 100644 --- a/src/plugins/android/javalanguageserver.cpp +++ b/src/plugins/android/javalanguageserver.cpp @@ -136,9 +136,9 @@ bool JLSSettings::isValid() const return StdIOSettings::isValid() && !m_languageServer.isEmpty(); } -QVariantMap JLSSettings::toMap() const +Store JLSSettings::toMap() const { - QVariantMap map = StdIOSettings::toMap(); + Store map = StdIOSettings::toMap(); map.insert(languageServerKey, m_languageServer.toSettings()); return map; } diff --git a/src/plugins/baremetal/debugserverprovidermanager.cpp b/src/plugins/baremetal/debugserverprovidermanager.cpp index d56d81b2d9c..849c7c1079c 100644 --- a/src/plugins/baremetal/debugserverprovidermanager.cpp +++ b/src/plugins/baremetal/debugserverprovidermanager.cpp @@ -24,6 +24,8 @@ #include <utils/persistentsettings.h> #include <utils/qtcassert.h> +using namespace Utils; + namespace BareMetal::Internal { const char dataKeyC[] = "DebugServerProvider."; @@ -77,24 +79,24 @@ DebugServerProviderManager *DebugServerProviderManager::instance() void DebugServerProviderManager::restoreProviders() { - Utils::PersistentSettingsReader reader; + PersistentSettingsReader reader; if (!reader.load(m_configFile)) return; - const QVariantMap data = reader.restoreValues(); + const Store data = reader.restoreValues(); const int version = data.value(fileVersionKeyC, 0).toInt(); if (version < 1) return; const int count = data.value(countKeyC, 0).toInt(); for (int i = 0; i < count; ++i) { - const QString key = QString::fromLatin1(dataKeyC) + QString::number(i); + const Key key = dataKeyC + Key::number(i); if (!data.contains(key)) break; - QVariantMap map = data.value(key).toMap(); - const QStringList keys = map.keys(); - for (const QString &key : keys) { + Store map = data.value(key).value<Store>(); + const KeyList keys = map.keys(); + for (const Key &key : keys) { const int lastDot = key.lastIndexOf('.'); if (lastDot != -1) map[key.mid(lastDot + 1)] = map[key]; @@ -120,18 +122,18 @@ void DebugServerProviderManager::restoreProviders() void DebugServerProviderManager::saveProviders() { - QVariantMap data; + Store data; data.insert(fileVersionKeyC, 1); int count = 0; for (const IDebugServerProvider *p : std::as_const(m_providers)) { if (p->isValid()) { - QVariantMap tmp; + Store tmp; p->toMap(tmp); if (tmp.isEmpty()) continue; - const QString key = QString::fromLatin1(dataKeyC) + QString::number(count); - data.insert(key, tmp); + const Key key = dataKeyC + Key::number(count); + data.insert(key, QVariant::fromValue(tmp)); ++count; } } diff --git a/src/plugins/baremetal/debugserverproviderssettingspage.cpp b/src/plugins/baremetal/debugserverproviderssettingspage.cpp index bcb108f0ee8..5c7a1cda51d 100644 --- a/src/plugins/baremetal/debugserverproviderssettingspage.cpp +++ b/src/plugins/baremetal/debugserverproviderssettingspage.cpp @@ -347,7 +347,7 @@ DebugServerProvidersSettingsWidget::DebugServerProvidersSettingsWidget() for (const auto f : DebugServerProviderManager::factories()) { if (id.startsWith(f->id())) { IDebugServerProvider *p = f->create(); - QVariantMap map; + Store map; old->toMap(map); p->fromMap(map); p->setDisplayName(Tr::tr("Clone of %1").arg(old->displayName())); diff --git a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp index 0163d7b0d47..c9a22f7273c 100644 --- a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp @@ -243,13 +243,13 @@ JLinkUvscServerProvider::JLinkUvscServerProvider() void JLinkUvscServerProvider::toMap(Store &data) const { UvscServerProvider::toMap(data); - data.insert(adapterOptionsKeyC, m_adapterOpts.toMap()); + data.insert(adapterOptionsKeyC, QVariant::fromValue(m_adapterOpts.toMap())); } void JLinkUvscServerProvider::fromMap(const Store &data) { UvscServerProvider::fromMap(data); - m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).toMap()); + m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).value<Store>()); } bool JLinkUvscServerProvider::operator==(const IDebugServerProvider &other) const diff --git a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp index ecad895da28..3725b2fc6ec 100644 --- a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp @@ -209,7 +209,7 @@ void StLinkUvscServerProvider::toMap(Store &data) const void StLinkUvscServerProvider::fromMap(const Store &data) { UvscServerProvider::fromMap(data); - m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).toMap()); + m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).value<Store>()); } bool StLinkUvscServerProvider::operator==(const IDebugServerProvider &other) const diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index ed054528cad..31ebb34fb99 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -151,8 +151,8 @@ void UvscServerProvider::toMap(Store &data) const { IDebugServerProvider::toMap(data); data.insert(toolsIniKeyC, m_toolsIniFile.toSettings()); - data.insert(deviceSelectionKeyC, m_deviceSelection.toMap()); - data.insert(driverSelectionKeyC, m_driverSelection.toMap()); + data.insert(deviceSelectionKeyC, QVariant::fromValue(m_deviceSelection.toMap())); + data.insert(driverSelectionKeyC, QVariant::fromValue(m_driverSelection.toMap())); } bool UvscServerProvider::isValid() const @@ -223,8 +223,8 @@ void UvscServerProvider::fromMap(const Store &data) { IDebugServerProvider::fromMap(data); m_toolsIniFile = FilePath::fromSettings(data.value(toolsIniKeyC)); - m_deviceSelection.fromMap(data.value(deviceSelectionKeyC).toMap()); - m_driverSelection.fromMap(data.value(driverSelectionKeyC).toMap()); + m_deviceSelection.fromMap(data.value(deviceSelectionKeyC).value<Store>()); + m_driverSelection.fromMap(data.value(driverSelectionKeyC).value<Store>()); } FilePath UvscServerProvider::projectFilePath(DebuggerRunTool *runTool, QString &errorMessage) const diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp index c7fa9ba1db0..33d6f3c4569 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp @@ -52,9 +52,9 @@ constexpr char deviceAlgorithmIndexKeyC[] = "DeviceAlgorithmIndex"; // DeviceSelection -QVariantMap DeviceSelection::toMap() const +Store DeviceSelection::toMap() const { - QVariantMap map; + Store map; // Software package. map.insert(packageDescrKeyC, package.desc); map.insert(packageFileKeyC, package.file); @@ -79,23 +79,23 @@ QVariantMap DeviceSelection::toMap() const // Device MEMORY. QVariantList memoryList; for (const DeviceSelection::Memory &memory : std::as_const(memories)) { - QVariantMap m; + Store m; m.insert(deviceMemoryIdKeyC, memory.id); m.insert(deviceMemoryStartKeyC, memory.start); m.insert(deviceMemorySizeKeyC, memory.size); - memoryList.push_back(m); + memoryList.push_back(QVariant::fromValue(m)); } map.insert(deviceMemoryKeyC, memoryList); // Device ALGORITHM. QVariantList algorithmList; for (const DeviceSelection::Algorithm &algorithm : std::as_const(algorithms)) { - QVariantMap m; + Store m; m.insert(deviceAlgorithmPathKeyC, algorithm.path); m.insert(deviceAlgorithmFlashStartKeyC, algorithm.flashStart); m.insert(deviceAlgorithmFlashSizeKeyC, algorithm.flashSize); m.insert(deviceAlgorithmRamStartKeyC, algorithm.ramStart); m.insert(deviceAlgorithmRamSizeKeyC, algorithm.ramSize); - algorithmList.push_back(m); + algorithmList.push_back(QVariant::fromValue(m)); } map.insert(deviceAlgorithmKeyC, algorithmList); map.insert(deviceAlgorithmIndexKeyC, algorithmIndex); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.cpp b/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.cpp index b153d5d4ad5..2abe09305cc 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverselection.cpp @@ -22,9 +22,9 @@ constexpr char driverNameKeyC[] = "DriverName"; // DriverSelection -QVariantMap DriverSelection::toMap() const +Store DriverSelection::toMap() const { - QVariantMap map; + Store map; map.insert(driverIndexKeyC, index); map.insert(driverCpuDllIndexKeyC, cpuDllIndex); map.insert(driverDllKeyC, dll); diff --git a/src/plugins/baremetal/idebugserverprovider.cpp b/src/plugins/baremetal/idebugserverprovider.cpp index 966c961ef9f..8725b5eb316 100644 --- a/src/plugins/baremetal/idebugserverprovider.cpp +++ b/src/plugins/baremetal/idebugserverprovider.cpp @@ -206,14 +206,14 @@ IDebugServerProvider *IDebugServerProviderFactory::create() const return m_creator(); } -IDebugServerProvider *IDebugServerProviderFactory::restore(const QVariantMap &data) const +IDebugServerProvider *IDebugServerProviderFactory::restore(const Store &data) const { IDebugServerProvider *p = m_creator(); p->fromMap(data); return p; } -bool IDebugServerProviderFactory::canRestore(const QVariantMap &data) const +bool IDebugServerProviderFactory::canRestore(const Store &data) const { const QString id = idFromMap(data); return id.startsWith(m_id + ':'); @@ -229,12 +229,12 @@ void IDebugServerProviderFactory::setCreator(const std::function<IDebugServerPro m_creator = creator; } -QString IDebugServerProviderFactory::idFromMap(const QVariantMap &data) +QString IDebugServerProviderFactory::idFromMap(const Store &data) { return data.value(idKeyC).toString(); } -void IDebugServerProviderFactory::idToMap(QVariantMap &data, const QString &id) +void IDebugServerProviderFactory::idToMap(Store &data, const QString &id) { data.insert(idKeyC, id); } diff --git a/src/plugins/baremetal/idebugserverprovider.h b/src/plugins/baremetal/idebugserverprovider.h index b06cdc5c2b9..12b5fe7d10f 100644 --- a/src/plugins/baremetal/idebugserverprovider.h +++ b/src/plugins/baremetal/idebugserverprovider.h @@ -110,12 +110,12 @@ public: QString displayName() const; IDebugServerProvider *create() const; - IDebugServerProvider *restore(const QVariantMap &data) const; + IDebugServerProvider *restore(const Utils::Store &data) const; - bool canRestore(const QVariantMap &data) const; + bool canRestore(const Utils::Store &data) const; - static QString idFromMap(const QVariantMap &data); - static void idToMap(QVariantMap &data, const QString &id); + static QString idFromMap(const Utils::Store &data); + static void idToMap(Utils::Store &data, const QString &id); protected: IDebugServerProviderFactory(); diff --git a/src/plugins/boot2qt/qdbdevice.cpp b/src/plugins/boot2qt/qdbdevice.cpp index ff397e2ea75..68546d046e2 100644 --- a/src/plugins/boot2qt/qdbdevice.cpp +++ b/src/plugins/boot2qt/qdbdevice.cpp @@ -143,16 +143,16 @@ void QdbDevice::fromMap(const Store &map) setSerialNumber(map.value("Qdb.SerialNumber").toString()); } -QVariantMap QdbDevice::toMap() const +Store QdbDevice::toMap() const { - QVariantMap map = ProjectExplorer::IDevice::toMap(); + Store map = ProjectExplorer::IDevice::toMap(); map.insert("Qdb.SerialNumber", serialNumber()); return map; } void QdbDevice::setupDefaultNetworkSettings(const QString &host) { - setFreePorts(Utils::PortList::fromString("10000-10100")); + setFreePorts(PortList::fromString("10000-10100")); SshParameters parameters = sshParameters(); parameters.setHost(host); diff --git a/src/plugins/boot2qt/qdbdevicedebugsupport.cpp b/src/plugins/boot2qt/qdbdevicedebugsupport.cpp index d6e198538f9..f9cd3dd6d11 100644 --- a/src/plugins/boot2qt/qdbdevicedebugsupport.cpp +++ b/src/plugins/boot2qt/qdbdevicedebugsupport.cpp @@ -85,7 +85,7 @@ public: upperPort = qmlServerPort; } if (m_usePerf) { - QVariantMap settingsData = runControl()->settingsData("Analyzer.Perf.Settings"); + Store settingsData = runControl()->settingsData("Analyzer.Perf.Settings"); QVariant perfRecordArgs = settingsData.value("Analyzer.Perf.RecordArguments"); QString args = Utils::transform(perfRecordArgs.toStringList(), [](QString arg) { return arg.replace(',', ",,"); diff --git a/src/plugins/clangtools/clangtoolsprojectsettings.cpp b/src/plugins/clangtools/clangtoolsprojectsettings.cpp index 67b49dff705..e135cd15de0 100644 --- a/src/plugins/clangtools/clangtoolsprojectsettings.cpp +++ b/src/plugins/clangtools/clangtoolsprojectsettings.cpp @@ -115,7 +115,7 @@ static Store convertToMapFromVersionBefore410(ProjectExplorer::Project *p) for (const Key &key : keys) map.insert(key, p->namedSettings(key)); - map.insert(SETTINGS_PREFIX + QString(diagnosticConfigIdKey), + map.insert(SETTINGS_PREFIX + Key(diagnosticConfigIdKey), p->namedSettings("ClangTools.DiagnosticConfig")); return map; @@ -124,7 +124,7 @@ static Store convertToMapFromVersionBefore410(ProjectExplorer::Project *p) void ClangToolsProjectSettings::load() { // Load map - Store map = m_project->namedSettings(SETTINGS_KEY_MAIN).toMap(); + Store map = m_project->namedSettings(SETTINGS_KEY_MAIN).value<Store>(); bool write = false; if (map.isEmpty()) { @@ -148,7 +148,7 @@ void ClangToolsProjectSettings::load() const QVariantList list = map.value(SETTINGS_KEY_SUPPRESSED_DIAGS).toList(); for (const QVariant &v : list) { - const Store diag = v.toMap(); + const Store diag = v.value<Store>(); const QString fp = diag.value(SETTINGS_KEY_SUPPRESSED_DIAGS_FILEPATH).toString(); if (fp.isEmpty()) continue; @@ -190,19 +190,19 @@ void ClangToolsProjectSettings::store() diagMap.insert(SETTINGS_KEY_SUPPRESSED_DIAGS_FILEPATH, diag.filePath.toString()); diagMap.insert(SETTINGS_KEY_SUPPRESSED_DIAGS_MESSAGE, diag.description); diagMap.insert(SETTINGS_KEY_SUPPRESSED_DIAGS_UNIQIFIER, diag.uniquifier); - list << diagMap; + list << QVariant::fromValue(diagMap); } map.insert(SETTINGS_KEY_SUPPRESSED_DIAGS, list); m_runSettings.toMap(map, SETTINGS_PREFIX); - m_project->setNamedSettings(SETTINGS_KEY_MAIN, map); + m_project->setNamedSettings(SETTINGS_KEY_MAIN, QVariant::fromValue(map)); } ClangToolsProjectSettings::ClangToolsProjectSettingsPtr ClangToolsProjectSettings::getSettings(ProjectExplorer::Project *project) { - const QString key = "ClangToolsProjectSettings"; + const Key key = "ClangToolsProjectSettings"; QVariant v = project->extraData(key); if (v.isNull()) { v = QVariant::fromValue( diff --git a/src/plugins/clangtools/clangtoolssettings.cpp b/src/plugins/clangtools/clangtoolssettings.cpp index 31eb794957f..4c000abd34e 100644 --- a/src/plugins/clangtools/clangtoolssettings.cpp +++ b/src/plugins/clangtools/clangtoolssettings.cpp @@ -41,7 +41,7 @@ RunSettings::RunSettings() { } -void RunSettings::fromMap(const Store &map, const QString &prefix) +void RunSettings::fromMap(const Store &map, const Key &prefix) { m_diagnosticConfigId = Id::fromSetting(map.value(prefix + diagnosticConfigIdKey)); m_parallelJobs = map.value(prefix + parallelJobsKey).toInt(); @@ -50,7 +50,7 @@ void RunSettings::fromMap(const Store &map, const QString &prefix) m_analyzeOpenFiles = map.value(prefix + analyzeOpenFilesKey).toBool(); } -void RunSettings::toMap(Store &map, const QString &prefix) const +void RunSettings::toMap(Store &map, const Key &prefix) const { map.insert(prefix + diagnosticConfigIdKey, m_diagnosticConfigId.toSetting()); map.insert(prefix + parallelJobsKey, m_parallelJobs); @@ -104,12 +104,12 @@ ClangToolsSettings::ClangToolsSettings() readSettings(); } -static QVariantMap convertToMapFromVersionBefore410(QSettings *s) +static Store convertToMapFromVersionBefore410(QSettings *s) { const char oldParallelJobsKey[] = "simultaneousProcesses"; const char oldBuildBeforeAnalysisKey[] = "buildBeforeAnalysis"; - QVariantMap map; + Store map; map.insert(diagnosticConfigIdKey, s->value(oldDiagnosticConfigIdKey)); map.insert(parallelJobsKey, s->value(oldParallelJobsKey)); map.insert(buildBeforeAnalysisKey, s->value(oldBuildBeforeAnalysisKey)); @@ -151,19 +151,19 @@ void ClangToolsSettings::readSettings() s->beginGroup(Constants::SETTINGS_ID); m_diagnosticConfigs.append(diagnosticConfigsFromSettings(s)); - QVariantMap map; + Store map; if (!s->value(oldDiagnosticConfigIdKey).isNull()) { map = convertToMapFromVersionBefore410(s); write = true; } else { - QVariantMap defaults; + Store defaults; defaults.insert(diagnosticConfigIdKey, defaultDiagnosticId().toSetting()); defaults.insert(parallelJobsKey, m_runSettings.parallelJobs()); defaults.insert(preferConfigFileKey, m_runSettings.preferConfigFile()); defaults.insert(buildBeforeAnalysisKey, m_runSettings.buildBeforeAnalysis()); defaults.insert(analyzeOpenFilesKey, m_runSettings.analyzeOpenFiles()); map = defaults; - for (QVariantMap::ConstIterator it = defaults.constBegin(); it != defaults.constEnd(); ++it) + for (Store::ConstIterator it = defaults.constBegin(); it != defaults.constEnd(); ++it) map.insert(it.key(), s->value(it.key(), it.value())); } @@ -185,9 +185,9 @@ void ClangToolsSettings::writeSettings() const diagnosticConfigsToSettings(s, m_diagnosticConfigs); - QVariantMap map; + Store map; m_runSettings.toMap(map); - for (QVariantMap::ConstIterator it = map.constBegin(); it != map.constEnd(); ++it) + for (Store::ConstIterator it = map.constBegin(); it != map.constEnd(); ++it) s->setValue(it.key(), it.value()); s->endGroup(); diff --git a/src/plugins/clangtools/clangtoolssettings.h b/src/plugins/clangtools/clangtoolssettings.h index a49f021ae58..1c8656981df 100644 --- a/src/plugins/clangtools/clangtoolssettings.h +++ b/src/plugins/clangtools/clangtoolssettings.h @@ -26,8 +26,8 @@ class RunSettings public: RunSettings(); - void fromMap(const Utils::Store &map, const QString &prefix = QString()); - void toMap(Utils::Store &map, const QString &prefix = QString()) const; + void fromMap(const Utils::Store &map, const Utils::Key &prefix = {}); + void toMap(Utils::Store &map, const Utils::Key &prefix = {}) const; Utils::Id diagnosticConfigId() const; void setDiagnosticConfigId(const Utils::Id &id) { m_diagnosticConfigId = id; } diff --git a/src/plugins/clangtools/settingswidget.cpp b/src/plugins/clangtools/settingswidget.cpp index 80aad561b07..113373f57e0 100644 --- a/src/plugins/clangtools/settingswidget.cpp +++ b/src/plugins/clangtools/settingswidget.cpp @@ -49,8 +49,8 @@ SettingsWidget::SettingsWidget() pathChooser->setDefaultValue(placeHolderText); pathChooser->setFilePath(path); pathChooser->setHistoryCompleter(tool == ClangToolType::Tidy - ? QString("ClangTools.ClangTidyExecutable.History") - : QString("ClangTools.ClazyStandaloneExecutable.History")); + ? Key("ClangTools.ClangTidyExecutable.History") + : Key("ClangTools.ClazyStandaloneExecutable.History")); pathChooser->setCommandVersionArguments({"--version"}); return pathChooser; }; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 75a4b44073f..bec14ece1b6 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1942,7 +1942,7 @@ BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(BuildType buildType) Store extraInfo; // enable QML debugging by default extraInfo.insert(Constants::QML_DEBUG_SETTING, TriState::Enabled.toVariant()); - info.extraInfo = extraInfo; + info.extraInfo = QVariant::fromValue(extraInfo); break; } case BuildTypeRelease: @@ -1969,7 +1969,7 @@ BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(BuildType buildType) extraInfo.insert(CMAKE_BUILD_TYPE, "RelWithDebInfo"); // enable QML debugging by default extraInfo.insert(Constants::QML_DEBUG_SETTING, TriState::Enabled.toVariant()); - info.extraInfo = extraInfo; + info.extraInfo = QVariant::fromValue(extraInfo); break; } default: diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index 43ba1b5721e..4499be94175 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -131,18 +131,18 @@ void IosDevice::fromMap(const Store &map) IDevice::fromMap(map); m_extraInfo.clear(); - const QVariantMap vMap = map.value(QLatin1String(Constants::EXTRA_INFO_KEY)).toMap(); + const Store vMap = map.value(Constants::EXTRA_INFO_KEY).value<Store>(); for (auto i = vMap.cbegin(), end = vMap.cend(); i != end; ++i) - m_extraInfo.insert(i.key(), i.value().toString()); + m_extraInfo.insert(stringFromKey(i.key()), i.value().toString()); } -QVariantMap IosDevice::toMap() const +Store IosDevice::toMap() const { - QVariantMap res = IDevice::toMap(); - QVariantMap vMap; + Store res = IDevice::toMap(); + Store vMap; for (auto i = m_extraInfo.cbegin(), end = m_extraInfo.cend(); i != end; ++i) - vMap.insert(i.key(), i.value()); - res.insert(QLatin1String(Constants::EXTRA_INFO_KEY), vMap); + vMap.insert(keyFromString(i.key()), i.value()); + res.insert(Constants::EXTRA_INFO_KEY, QVariant::fromValue(vMap)); return res; } @@ -153,7 +153,7 @@ QString IosDevice::deviceName() const QString IosDevice::uniqueDeviceID() const { - return id().suffixAfter(Utils::Id(Constants::IOS_DEVICE_ID)); + return id().suffixAfter(Id(Constants::IOS_DEVICE_ID)); } QString IosDevice::uniqueInternalDeviceId() const @@ -543,9 +543,9 @@ IosDeviceFactory::IosDeviceFactory() setConstructionFunction([] { return IDevice::Ptr(new IosDevice); }); } -bool IosDeviceFactory::canRestore(const QVariantMap &map) const +bool IosDeviceFactory::canRestore(const Store &map) const { - QVariantMap vMap = map.value(QLatin1String(Constants::EXTRA_INFO_KEY)).toMap(); + Store vMap = map.value(Constants::EXTRA_INFO_KEY).value<Store>(); if (vMap.isEmpty() || vMap.value(kDeviceName).toString() == QLatin1String("*unknown*")) return false; // transient device (probably generated during an activation) return true; diff --git a/src/plugins/ios/iosdevice.h b/src/plugins/ios/iosdevice.h index 29d8fc24e43..24bee023de7 100644 --- a/src/plugins/ios/iosdevice.h +++ b/src/plugins/ios/iosdevice.h @@ -8,10 +8,6 @@ #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/devicesupport/idevicefactory.h> -#include <QVariantMap> -#include <QMap> -#include <QString> -#include <QStringList> #include <QTimer> namespace Ios { @@ -61,7 +57,7 @@ class IosDeviceFactory final : public ProjectExplorer::IDeviceFactory public: IosDeviceFactory(); - bool canRestore(const QVariantMap &map) const override; + bool canRestore(const Utils::Store &map) const override; }; class IosDeviceManager : public QObject diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index 960658d5d2b..44a01a75224 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -87,22 +87,24 @@ void IosDsymBuildStep::toMap(Store &map) const { AbstractProcessStep::toMap(map); - map.insert(id().withSuffix(ARGUMENTS_PARTIAL_KEY).toString(), + // FIXME: Clean up after QVariantMap -> Utils::Store transition + // This is map.insert(id().name() + ARGUMENTS_PARTIAL_KEY), arguments()) + map.insert(keyFromString(id().withSuffix(ARGUMENTS_PARTIAL_KEY).toString()), arguments()); - map.insert(id().withSuffix(USE_DEFAULT_ARGS_PARTIAL_KEY).toString(), + map.insert(keyFromString(id().withSuffix(USE_DEFAULT_ARGS_PARTIAL_KEY).toString()), isDefault()); - map.insert(id().withSuffix(CLEAN_PARTIAL_KEY).toString(), m_clean); - map.insert(id().withSuffix(COMMAND_PARTIAL_KEY).toString(), command().toSettings()); + map.insert(keyFromString(id().withSuffix(CLEAN_PARTIAL_KEY).toString()), m_clean); + map.insert(keyFromString(id().withSuffix(COMMAND_PARTIAL_KEY).toString()), command().toSettings()); } void IosDsymBuildStep::fromMap(const Store &map) { - QVariant bArgs = map.value(id().withSuffix(ARGUMENTS_PARTIAL_KEY).toString()); + QVariant bArgs = map.value(keyFromString(id().withSuffix(ARGUMENTS_PARTIAL_KEY).toString())); m_arguments = bArgs.toStringList(); bool useDefaultArguments = map.value( - id().withSuffix(USE_DEFAULT_ARGS_PARTIAL_KEY).toString()).toBool(); - m_clean = map.value(id().withSuffix(CLEAN_PARTIAL_KEY).toString(), m_clean).toBool(); - m_command = FilePath::fromSettings(map.value(id().withSuffix(COMMAND_PARTIAL_KEY).toString())); + keyFromString(id().withSuffix(USE_DEFAULT_ARGS_PARTIAL_KEY).toString())).toBool(); + m_clean = map.value(keyFromString(id().withSuffix(CLEAN_PARTIAL_KEY).toString()), m_clean).toBool(); + m_command = FilePath::fromSettings(map.value(keyFromString(id().withSuffix(COMMAND_PARTIAL_KEY).toString()))); if (useDefaultArguments) { m_command = defaultCommand(); m_arguments = defaultArguments(); diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index b165bfbef9c..772c6ab9223 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -40,7 +40,7 @@ using namespace Utils; namespace Ios::Internal { -const QLatin1String deviceTypeKey("Ios.device_type"); +const char deviceTypeKey[] = "Ios.device_type"; static QString displayName(const SimulatorInfo &device) { @@ -210,7 +210,7 @@ void IosDeviceTypeAspect::fromMap(const Store &map) { bool deviceTypeIsInt; map.value(deviceTypeKey).toInt(&deviceTypeIsInt); - if (deviceTypeIsInt || !m_deviceType.fromMap(map.value(deviceTypeKey).toMap())) + if (deviceTypeIsInt || !m_deviceType.fromMap(map.value(deviceTypeKey).value<Store>())) updateDeviceType(); m_runConfiguration->update(); @@ -218,7 +218,7 @@ void IosDeviceTypeAspect::fromMap(const Store &map) void IosDeviceTypeAspect::toMap(Store &map) const { - map.insert(deviceTypeKey, deviceType().toMap()); + map.insert(deviceTypeKey, QVariant::fromValue(deviceType().toMap())); } QString IosRunConfiguration::disabledReason() const diff --git a/src/plugins/ios/iossimulator.cpp b/src/plugins/ios/iossimulator.cpp index ee16f73277c..301d8d087e8 100644 --- a/src/plugins/ios/iossimulator.cpp +++ b/src/plugins/ios/iossimulator.cpp @@ -17,11 +17,11 @@ using namespace Utils; namespace Ios::Internal { -const QLatin1String iosDeviceTypeDisplayNameKey("displayName"); -const QLatin1String iosDeviceTypeTypeKey("type"); -const QLatin1String iosDeviceTypeIdentifierKey("identifier"); +const char iosDeviceTypeDisplayNameKey[] = "displayName"; +const char iosDeviceTypeTypeKey[] = "type"; +const char iosDeviceTypeIdentifierKey[] = "identifier"; -IosSimulator::IosSimulator(Utils::Id id) +IosSimulator::IosSimulator(Id id) : m_lastPort(Constants::IOS_SIMULATOR_PORT_START) { setupId(IDevice::AutoDetected, id); @@ -83,9 +83,9 @@ bool IosDeviceType::fromMap(const Store &map) && (type != IosDeviceType::SimulatedDevice || !identifier.isEmpty()); } -QVariantMap IosDeviceType::toMap() const +Store IosDeviceType::toMap() const { - QVariantMap res; + Store res; res[iosDeviceTypeDisplayNameKey] = displayName; res[iosDeviceTypeTypeKey] = type; res[iosDeviceTypeIdentifierKey] = identifier; diff --git a/src/plugins/mcusupport/mcuabstractpackage.h b/src/plugins/mcusupport/mcuabstractpackage.h index c319c32f03c..c6131919e54 100644 --- a/src/plugins/mcusupport/mcuabstractpackage.h +++ b/src/plugins/mcusupport/mcuabstractpackage.h @@ -3,11 +3,11 @@ #pragma once +#include <utils/store.h> + #include <QObject> -namespace Utils { -class FilePath; -} // namespace Utils +namespace Utils { class FilePath; } namespace McuSupport::Internal { @@ -39,7 +39,7 @@ public: virtual void setPath(const Utils::FilePath &) = 0; virtual Utils::FilePath defaultPath() const = 0; virtual Utils::FilePath detectionPath() const = 0; - virtual QString settingsKey() const = 0; + virtual Utils::Key settingsKey() const = 0; virtual void updateStatus() = 0; virtual Status status() const = 0; @@ -56,6 +56,6 @@ signals: void changed(); void statusChanged(); void reset(); +}; -}; // class McuAbstractPackage } // namespace McuSupport::Internal diff --git a/src/plugins/mcusupport/mcupackage.cpp b/src/plugins/mcusupport/mcupackage.cpp index 1c079eebdfb..84c9d7d2d5c 100644 --- a/src/plugins/mcusupport/mcupackage.cpp +++ b/src/plugins/mcusupport/mcupackage.cpp @@ -33,7 +33,7 @@ McuPackage::McuPackage(const SettingsHandler::Ptr &settingsHandler, const QString &label, const FilePath &defaultPath, const FilePath &detectionPath, - const QString &settingsKey, + const Key &settingsKey, const QString &cmakeVarName, const QString &envVarName, const QStringList &versions, @@ -65,7 +65,7 @@ QString McuPackage::label() const return m_label; } -QString McuPackage::settingsKey() const +Key McuPackage::settingsKey() const { return m_settingsKey; } @@ -334,7 +334,7 @@ McuToolChainPackage::McuToolChainPackage(const SettingsHandler::Ptr &settingsHan const QString &label, const FilePath &defaultPath, const FilePath &detectionPath, - const QString &settingsKey, + const Key &settingsKey, McuToolChainPackage::ToolChainType type, const QStringList &versions, const QString &cmakeVarName, diff --git a/src/plugins/mcusupport/mcupackage.h b/src/plugins/mcusupport/mcupackage.h index df0f80ba657..7008b2c499d 100644 --- a/src/plugins/mcusupport/mcupackage.h +++ b/src/plugins/mcusupport/mcupackage.h @@ -28,12 +28,11 @@ class McuPackage : public McuAbstractPackage Q_OBJECT public: - McuPackage( - const SettingsHandler::Ptr &settingsHandler, + McuPackage(const SettingsHandler::Ptr &settingsHandler, const QString &label, const Utils::FilePath &defaultPath, const Utils::FilePath &detectionPath, - const QString &settingsKey, + const Utils::Key &settingsKey, const QString &cmakeVarName, const QString &envVarName, const QStringList &versions = {}, @@ -56,7 +55,7 @@ public: Utils::FilePath path() const override; Utils::FilePath defaultPath() const override; Utils::FilePath detectionPath() const override; - QString settingsKey() const final; + Utils::Key settingsKey() const final; void updateStatus() override; Status status() const override; @@ -83,7 +82,7 @@ private: const QString m_label; Utils::FilePath m_defaultPath; const Utils::FilePath m_detectionPath; - const QString m_settingsKey; + const Utils::Key m_settingsKey; QScopedPointer<const McuPackageVersionDetector> m_versionDetector; Utils::FilePath m_path; @@ -108,7 +107,7 @@ public: const QString &label, const Utils::FilePath &defaultPath, const Utils::FilePath &detectionPath, - const QString &settingsKey, + const Utils::Key &settingsKey, ToolChainType toolchainType, const QStringList &versions, const QString &cmakeVarName, diff --git a/src/plugins/mcusupport/mcusupportsdk.cpp b/src/plugins/mcusupport/mcusupportsdk.cpp index d29aea4a54f..a3eb731ea2a 100644 --- a/src/plugins/mcusupport/mcusupportsdk.cpp +++ b/src/plugins/mcusupport/mcusupportsdk.cpp @@ -120,7 +120,7 @@ McuPackagePtr createBoardSdkPackage(const SettingsHandler::Ptr &settingsHandler, sdkName, defaultPath, {}, // detection path - desc.boardSdk.envVar, // settings key + keyFromString(desc.boardSdk.envVar), // settings key Constants::BOARD_SDK_CMAKE_VAR, // cmake var desc.boardSdk.envVar, // env var desc.boardSdk.versions, @@ -145,7 +145,7 @@ McuPackagePtr createFreeRTOSSourcesPackage(const SettingsHandler::Ptr &settingsH QString::fromLatin1("FreeRTOS Sources (%1)").arg(envVarPrefix), defaultPath, "tasks.c", // detection path - QString{Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(envVarPrefix), + Constants::SETTINGS_KEY_FREERTOS_PREFIX + keyFromString(envVarPrefix), "FREERTOS_DIR", // cmake var envVar, // env var {}, // versions @@ -687,7 +687,7 @@ static PackageDescription parsePackage(const QJsonObject &cmakeEntry) cmakeEntry["envVar"].toString(), cmakeEntry["cmakeVar"].toString(), cmakeEntry["description"].toString(), - cmakeEntry["setting"].toString(), + keyFromString(cmakeEntry["setting"].toString()), FilePath::fromUserInput(defaultPathString), FilePath::fromUserInput(detectionPathString), versions, diff --git a/src/plugins/mcusupport/mcutargetdescription.h b/src/plugins/mcusupport/mcutargetdescription.h index ebf7e8c7ef6..e495b261922 100644 --- a/src/plugins/mcusupport/mcutargetdescription.h +++ b/src/plugins/mcusupport/mcutargetdescription.h @@ -28,7 +28,7 @@ struct PackageDescription QString envVar; QString cmakeVar; QString description; - QString setting; + Utils::Key setting; Utils::FilePath defaultPath; Utils::FilePath detectionPath; QStringList versions; diff --git a/src/plugins/mcusupport/settingshandler.cpp b/src/plugins/mcusupport/settingshandler.cpp index 67fbd27f978..32bc9132d27 100644 --- a/src/plugins/mcusupport/settingshandler.cpp +++ b/src/plugins/mcusupport/settingshandler.cpp @@ -6,29 +6,28 @@ #include "mcusupportconstants.h" #include <coreplugin/icore.h> + #include <utils/filepath.h> +#include <utils/store.h> + +using namespace Utils; namespace McuSupport::Internal { -using Utils::FilePath; +const Key automaticKitCreationSettingsKey = Key(Constants::SETTINGS_GROUP) + '/' + + Constants::SETTINGS_KEY_AUTOMATIC_KIT_CREATION; -namespace { -const QString automaticKitCreationSettingsKey = QLatin1String(Constants::SETTINGS_GROUP) + '/' - + QLatin1String( - Constants::SETTINGS_KEY_AUTOMATIC_KIT_CREATION); -} - -static FilePath packagePathFromSettings(const QString &settingsKey, +static FilePath packagePathFromSettings(const Key &settingsKey, QSettings &settings, const FilePath &defaultPath) { - const QString key = QLatin1String(Constants::SETTINGS_GROUP) + '/' - + QLatin1String(Constants::SETTINGS_KEY_PACKAGE_PREFIX) + settingsKey; + const Key key = Key(Constants::SETTINGS_GROUP) + '/' + + Constants::SETTINGS_KEY_PACKAGE_PREFIX + settingsKey; const QString path = settings.value(key, defaultPath.toUserOutput()).toString(); return FilePath::fromUserInput(path); } -FilePath SettingsHandler::getPath(const QString &settingsKey, +FilePath SettingsHandler::getPath(const Key &settingsKey, QSettings::Scope scope, const FilePath &defaultPath) const { @@ -39,15 +38,14 @@ FilePath SettingsHandler::getPath(const QString &settingsKey, return packagePathFromSettings(settingsKey, *Core::ICore::settings(scope), defaultPath); } -bool SettingsHandler::write(const QString &settingsKey, +bool SettingsHandler::write(const Key &settingsKey, const FilePath &path, const FilePath &defaultPath) const { const FilePath savedPath = packagePathFromSettings(settingsKey, *Core::ICore::settings(QSettings::UserScope), defaultPath); - const QString key = QLatin1String(Constants::SETTINGS_GROUP) + '/' - + QLatin1String(Constants::SETTINGS_KEY_PACKAGE_PREFIX) + settingsKey; + const Key key = Key(Constants::SETTINGS_GROUP) + '/' + Constants::SETTINGS_KEY_PACKAGE_PREFIX + settingsKey; Core::ICore::settings()->setValueWithDefault(key, path.toUserOutput(), defaultPath.toUserOutput()); diff --git a/src/plugins/mcusupport/settingshandler.h b/src/plugins/mcusupport/settingshandler.h index 145049e31db..477f04da42a 100644 --- a/src/plugins/mcusupport/settingshandler.h +++ b/src/plugins/mcusupport/settingshandler.h @@ -2,13 +2,12 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #pragma once +#include <utils/storekey.h> + #include <QSettings> #include <QSharedPointer> -#include <QString> -namespace Utils { -class FilePath; -} //namespace Utils +namespace Utils { class FilePath; } namespace McuSupport::Internal { @@ -17,11 +16,11 @@ class SettingsHandler public: using Ptr = QSharedPointer<SettingsHandler>; virtual ~SettingsHandler() = default; - virtual Utils::FilePath getPath(const QString &settingsKey, + virtual Utils::FilePath getPath(const Utils::Key &settingsKey, QSettings::Scope scope, const Utils::FilePath &m_defaultPath) const; - virtual bool write(const QString &settingsKey, + virtual bool write(const Utils::Key &settingsKey, const Utils::FilePath &path, const Utils::FilePath &defaultPath) const; @@ -29,6 +28,6 @@ public: void setAutomaticKitCreation(bool isEnabled); void setInitialPlatformName(const QString &platform); QString initialPlatformName() const; +}; -}; //class SettingsHandler } // namespace McuSupport::Internal diff --git a/src/plugins/mcusupport/test/packagemock.h b/src/plugins/mcusupport/test/packagemock.h index 1e62fb77646..06d3be62305 100644 --- a/src/plugins/mcusupport/test/packagemock.h +++ b/src/plugins/mcusupport/test/packagemock.h @@ -6,7 +6,9 @@ #include "mcuabstractpackage.h" #include <gmock/gmock.h> + #include <utils/filepath.h> +#include <utils/storekey.h> namespace McuSupport::Internal { @@ -21,7 +23,7 @@ public: MOCK_METHOD(Utils::FilePath, detectionPath, (), (const)); MOCK_METHOD(QString, statusText, (), (const)); MOCK_METHOD(void, updateStatus, ()); - MOCK_METHOD(QString, settingsKey, (), (const)); + MOCK_METHOD(Utils::Key, settingsKey, (), (const)); MOCK_METHOD(Status, status, (), (const)); MOCK_METHOD(bool, isValidStatus, (), (const)); @@ -34,5 +36,6 @@ public: MOCK_METHOD(QWidget *, widget, ()); MOCK_METHOD(const McuPackageVersionDetector *, getVersionDetector, (), (const)); -}; // class PackageMock +}; + } // namespace McuSupport::Internal diff --git a/src/plugins/mcusupport/test/settingshandlermock.h b/src/plugins/mcusupport/test/settingshandlermock.h index cecf1415c2e..1cb3faf4730 100644 --- a/src/plugins/mcusupport/test/settingshandlermock.h +++ b/src/plugins/mcusupport/test/settingshandlermock.h @@ -5,7 +5,9 @@ #include "settingshandler.h" #include <gmock/gmock.h> + #include <utils/filepath.h> +#include <utils/storekey.h> namespace McuSupport::Internal { @@ -14,13 +16,15 @@ class SettingsHandlerMock : public SettingsHandler public: SettingsHandlerMock() = default; ~SettingsHandlerMock() override = default; + MOCK_METHOD(Utils::FilePath, getPath, - (const QString &, QSettings::Scope, const Utils::FilePath &), + (const Utils::Key &, QSettings::Scope, const Utils::FilePath &), (const, override)); MOCK_METHOD(bool, write, - (const QString &, const Utils::FilePath &, const Utils::FilePath &), + (const Utils::Key &, const Utils::FilePath &, const Utils::FilePath &), (const, override)); -}; //class SettingsHandler +}; + } // namespace McuSupport::Internal diff --git a/src/plugins/mcusupport/test/unittest.cpp b/src/plugins/mcusupport/test/unittest.cpp index 4ac73b992a8..136a0832883 100644 --- a/src/plugins/mcusupport/test/unittest.cpp +++ b/src/plugins/mcusupport/test/unittest.cpp @@ -293,7 +293,7 @@ void verifyTargetToolchains(const Targets &targets, const QString &toolchainFilePath, const QString &toolchainFileDefaultPath, const QString &compilerPath, - const QString &compilerSetting, + const Key &compilerSetting, const QStringList &versions) { QCOMPARE(targets.size(), 1); @@ -322,7 +322,7 @@ void verifyBoardSdk(const McuPackagePtr &boardSdk, QVERIFY(boardSdk); QCOMPARE(boardSdk->cmakeVariableName(), cmakeVariable); QCOMPARE(boardSdk->environmentVariableName(), environmentVariable); - QCOMPARE(boardSdk->settingsKey(), environmentVariable); + QCOMPARE(boardSdk->settingsKey(), keyFromString(environmentVariable)); QCOMPARE(boardSdk->detectionPath().toString(), empty); QCOMPARE(boardSdk->versions(), versions); } @@ -332,7 +332,7 @@ void verifyFreeRtosPackage(const McuPackagePtr &freeRtos, const FilePath &boardSdkDir, const QString &freeRtosPath, const QString &freeRtosDetectionPath, - const QString &expectedSettingsKey) + const Key &expectedSettingsKey) { QVERIFY(freeRtos); QCOMPARE(freeRtos->environmentVariableName(), envVar); @@ -346,7 +346,7 @@ void verifyFreeRtosPackage(const McuPackagePtr &freeRtos, void verifyPackage(const McuPackagePtr &package, const QString &path, const QString &defaultPath, - const QString &setting, + const Key &setting, const QString &cmakeVar, const QString &envVar, const QString &label, @@ -468,7 +468,7 @@ void McuSupportTest::initTestCase() ON_CALL(*sdkPackage, label()).WillByDefault(Return(QString{QUL_LABEL})); ON_CALL(*sdkPackage, settingsKey()) - .WillByDefault(Return(QString{Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK})); + .WillByDefault(Return(Key{Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK})); ON_CALL(*sdkPackage, environmentVariableName()).WillByDefault(Return(QString{QUL_ENV_VAR})); ON_CALL(*sdkPackage, cmakeVariableName()).WillByDefault(Return(QString{QUL_CMAKE_VAR})); ON_CALL(*sdkPackage, isValidStatus()).WillByDefault(Return(true)); @@ -487,7 +487,7 @@ void McuSupportTest::initTestCase() EXPECT_CALL(*armGccToolchainFilePackage, detectionPath()).WillRepeatedly(Return(FilePath{})); ON_CALL(*settingsMockPtr, getPath) - .WillByDefault([](const QString &, QSettings::Scope, const FilePath &m_defaultPath) { + .WillByDefault([](const Key &, QSettings::Scope, const FilePath &m_defaultPath) { return m_defaultPath; }); } @@ -685,41 +685,40 @@ void McuSupportTest::test_mapParsedToolchainIdToCorrespondingType() void McuSupportTest::test_legacy_createPackagesWithCorrespondingSettings_data() { QTest::addColumn<QString>("json"); - QTest::addColumn<QSet<QString>>("expectedSettings"); + QTest::addColumn<QSet<Key>>("expectedSettings"); - QSet<QString> commonSettings{{"CypressAutoFlashUtil"}, - {"MCUXpressoIDE"}, - {"RenesasFlashProgrammer"}, - {"Stm32CubeProgrammer"}}; + QSet<Key> commonSettings{{"CypressAutoFlashUtil"}, + {"MCUXpressoIDE"}, + {"RenesasFlashProgrammer"}, + {"Stm32CubeProgrammer"}}; QTest::newRow("iar_mimxrt1064_evk_freertos_json") << iar_mimxrt1064_evk_freertos_json - << QSet<QString>{{"EVK_MIMXRT1064_SDK_PATH"}, - {QString{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append( + << QSet<Key>{{"EVK_MIMXRT1064_SDK_PATH"}, + {Key{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append( "IMXRT1064")}, "IARToolchain"} .unite(commonSettings); QTest::newRow("stm32f469i") << iar_stm32f469i_discovery_baremetal_json - << QSet<QString>{{"STM32Cube_FW_F4_SDK_PATH"}, "IARToolchain"}.unite( + << QSet<Key>{{"STM32Cube_FW_F4_SDK_PATH"}, "IARToolchain"}.unite( commonSettings); QTest::newRow("nxp1050") << armgcc_mimxrt1050_evk_freertos_json - << QSet<QString>{{"EVKB_IMXRT1050_SDK_PATH"}, - {QString{ - Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX} + << QSet<Key>{{"EVKB_IMXRT1050_SDK_PATH"}, + {Key{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX} .append("IMXRT1050")}, "GNUArmEmbeddedToolchain"} .unite(commonSettings); QTest::newRow("armgcc_stm32h750b_discovery_baremetal_json") << armgcc_stm32h750b_discovery_baremetal_json - << QSet<QString>{{"STM32Cube_FW_H7_SDK_PATH"}, "GNUArmEmbeddedToolchain"}.unite( + << QSet<Key>{{"STM32Cube_FW_H7_SDK_PATH"}, "GNUArmEmbeddedToolchain"}.unite( commonSettings); QTest::newRow("armgcc_stm32f769i_discovery_freertos_json") << armgcc_stm32f769i_discovery_freertos_json - << QSet<QString>{{"STM32Cube_FW_F7_SDK_PATH"}, "GNUArmEmbeddedToolchain"}.unite( + << QSet<Key>{{"STM32Cube_FW_F7_SDK_PATH"}, "GNUArmEmbeddedToolchain"}.unite( commonSettings); QTest::newRow("ghs_rh850_d1m1a_baremetal_json") - << ghs_rh850_d1m1a_baremetal_json << QSet<QString>{"GHSToolchain"}.unite(commonSettings); + << ghs_rh850_d1m1a_baremetal_json << QSet<Key>{"GHSToolchain"}.unite(commonSettings); } void McuSupportTest::test_legacy_createPackagesWithCorrespondingSettings() @@ -730,10 +729,10 @@ void McuSupportTest::test_legacy_createPackagesWithCorrespondingSettings() targetsFromDescriptions({description}, settingsMockPtr, sdkPackagePtr, runLegacy)}; Q_UNUSED(targets); - QSet<QString> settings = transform<QSet<QString>>(packages, [](const auto &package) { + QSet<Key> settings = transform<QSet<Key>>(packages, [](const auto &package) { return package->settingsKey(); }); - QFETCH(QSet<QString>, expectedSettings); + QFETCH(QSet<Key>, expectedSettings); QVERIFY(settings.contains(expectedSettings)); } @@ -851,7 +850,7 @@ void McuSupportTest::test_useFallbackPathForToolchainWhenPathFromSettingsIsNotAv Utils::PathChooser::Kind::ExistingDirectory}; McuTargetDescription::Toolchain toolchainDescription{armGcc, {}, compilerDescription, {}}; - EXPECT_CALL(*settingsMockPtr, getPath(QString{armGccDirectorySetting}, _, FilePath{fallbackDir})) + EXPECT_CALL(*settingsMockPtr, getPath(Key{armGccDirectorySetting}, _, FilePath{fallbackDir})) .Times(2) .WillRepeatedly(Return(FilePath{fallbackDir})); @@ -875,7 +874,7 @@ void McuSupportTest::test_usePathFromSettingsForToolchainPath() Utils::PathChooser::Kind::ExistingDirectory}; McuTargetDescription::Toolchain toolchainDescription{armGcc, {}, compilerDescription, {}}; - EXPECT_CALL(*settingsMockPtr, getPath(QString{armGccDirectorySetting}, _, FilePath{empty})) + EXPECT_CALL(*settingsMockPtr, getPath(Key{armGccDirectorySetting}, _, FilePath{empty})) .Times(2) .WillOnce(Return(FilePath{empty})) // system scope settings .WillOnce(Return(FilePath{armGccDir})); // user scope settings @@ -951,7 +950,7 @@ void McuSupportTest::test_legacy_createTargetWithToolchainPackages_data() QTest::addColumn<QString>("toolchainFilePath"); QTest::addColumn<QString>("toolchainFileDefaultPath"); QTest::addColumn<QString>("compilerPath"); - QTest::addColumn<QString>("compilerSetting"); + QTest::addColumn<Key>("compilerSetting"); QTest::addColumn<QStringList>("versions"); QTest::newRow("armgcc_mimxrt1050_evk_freertos_json") @@ -992,13 +991,13 @@ void McuSupportTest::test_legacy_createTargetWithToolchainPackages() QFETCH(QString, toolchainFilePath); QFETCH(QString, toolchainFileDefaultPath); QFETCH(QString, compilerPath); - QFETCH(QString, compilerSetting); + QFETCH(Key, compilerSetting); QFETCH(QStringList, versions); const McuTargetDescription description = parseDescriptionJson(json.toLocal8Bit()); EXPECT_CALL(*settingsMockPtr, - getPath(QString{Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK}, _, _)) + getPath(Key{Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK}, _, _)) .WillRepeatedly(Return(FilePath::fromUserInput(qtForMcuSdkPath))); EXPECT_CALL(*settingsMockPtr, getPath(compilerSetting, _, _)) .WillRepeatedly(Return(FilePath::fromUserInput(compilerPath))); @@ -1026,14 +1025,14 @@ void McuSupportTest::test_createTargetWithToolchainPackages() QFETCH(QString, toolchainFilePath); QFETCH(QString, toolchainFileDefaultPath); QFETCH(QString, compilerPath); - QFETCH(QString, compilerSetting); + QFETCH(Key, compilerSetting); QFETCH(QStringList, versions); EXPECT_CALL(*settingsMockPtr, getPath(compilerSetting, _, _)) .WillRepeatedly(Return(FilePath::fromUserInput(compilerPath))); EXPECT_CALL(*settingsMockPtr, - getPath(QString{Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK}, _, _)) + getPath(Key{Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK}, _, _)) .WillRepeatedly(Return(FilePath::fromUserInput(qtForMcuSdkPath))); const McuTargetDescription description = parseDescriptionJson(json.toLocal8Bit()); @@ -1141,7 +1140,7 @@ void McuSupportTest::test_legacy_createFreeRtosPackage_data() { QTest::addColumn<QString>("json"); QTest::addColumn<QStringList>("versions"); - QTest::addColumn<QString>("expectedSettingsKey"); + QTest::addColumn<Key>("expectedSettingsKey"); QTest::addColumn<FilePath>("expectedPath"); QTest::addColumn<FilePath>("expectedDetectionPath"); @@ -1171,7 +1170,7 @@ void McuSupportTest::test_legacy_createFreeRtosPackage() { QFETCH(QString, json); QFETCH(QStringList, versions); - QFETCH(QString, expectedSettingsKey); + QFETCH(Key, expectedSettingsKey); QFETCH(FilePath, expectedPath); QFETCH(FilePath, expectedDetectionPath); @@ -1200,13 +1199,13 @@ void McuSupportTest::test_createFreeRtosPackage() { QFETCH(QString, json); QFETCH(QStringList, versions); - QFETCH(QString, expectedSettingsKey); + QFETCH(Key, expectedSettingsKey); QFETCH(FilePath, expectedPath); QFETCH(FilePath, expectedDetectionPath); McuTargetDescription targetDescription{parseDescriptionJson(json.toLocal8Bit())}; - EXPECT_CALL(*settingsMockPtr, getPath(targetDescription.boardSdk.envVar, _, _)) + EXPECT_CALL(*settingsMockPtr, getPath(keyFromString(targetDescription.boardSdk.envVar), _, _)) .WillRepeatedly(Return(FilePath::fromString(boardSdkDir))); auto [targets, packages]{targetFactory.createTargets(targetDescription, sdkPackagePtr)}; @@ -1254,7 +1253,7 @@ void McuSupportTest::test_legacy_doNOTcreateFreeRtosPackageForMetalVariants() void McuSupportTest::test_legacy_createQtMCUsPackage() { EXPECT_CALL(*settingsMockPtr, - getPath(QString{Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK}, _, _)) + getPath(Key{Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK}, _, _)) .WillRepeatedly(Return(FilePath::fromUserInput(qtForMcuSdkPath))); McuPackagePtr qtForMCUsSDK = createQtForMCUsPackage(settingsMockPtr); @@ -1550,13 +1549,13 @@ void McuSupportTest::test_legacy_createThirdPartyPackage() QFETCH(QString, json); QFETCH(QString, path); QFETCH(QString, defaultPath); - QFETCH(QString, setting); + QFETCH(Key, setting); QFETCH(QString, cmakeVar); QFETCH(QString, envVar); QFETCH(QString, label); QFETCH(QString, detectionPath); - EXPECT_CALL(*settingsMockPtr, getPath(QString{setting}, _, _)) + EXPECT_CALL(*settingsMockPtr, getPath(Key{setting}, _, _)) .Times(2) .WillRepeatedly(Return(FilePath::fromUserInput(defaultPath))); @@ -1577,7 +1576,7 @@ void McuSupportTest::test_createThirdPartyPackage_data() QTest::addColumn<QString>("json"); QTest::addColumn<QString>("path"); QTest::addColumn<QString>("defaultPath"); - QTest::addColumn<QString>("setting"); + QTest::addColumn<Key>("setting"); QTest::addColumn<QString>("cmakeVar"); QTest::addColumn<QString>("envVar"); QTest::addColumn<QString>("label"); @@ -1628,7 +1627,7 @@ void McuSupportTest::test_createThirdPartyPackage() QFETCH(QString, json); QFETCH(QString, path); QFETCH(QString, defaultPath); - QFETCH(QString, setting); + QFETCH(Key, setting); QFETCH(QString, cmakeVar); QFETCH(QString, envVar); QFETCH(QString, label); @@ -1636,11 +1635,11 @@ void McuSupportTest::test_createThirdPartyPackage() McuTargetDescription targetDescription{parseDescriptionJson(json.toLocal8Bit())}; - EXPECT_CALL(*settingsMockPtr, getPath(QString{setting}, QSettings::SystemScope, _)) + EXPECT_CALL(*settingsMockPtr, getPath(Key{setting}, QSettings::SystemScope, _)) .Times(testing::AtMost(1)) .WillOnce(Return(FilePath::fromUserInput(defaultPath))); - EXPECT_CALL(*settingsMockPtr, getPath(QString{setting}, QSettings::UserScope, _)) + EXPECT_CALL(*settingsMockPtr, getPath(Key{setting}, QSettings::UserScope, _)) .Times(testing::AtMost(1)) .WillOnce(Return(FilePath::fromUserInput(path))); @@ -1664,7 +1663,7 @@ void McuSupportTest::test_createThirdPartyPackage() void McuSupportTest::test_legacy_createCypressProgrammer3rdPartyPackage() { - EXPECT_CALL(*settingsMockPtr, getPath(QString{cypressProgrammerSetting}, _, _)) + EXPECT_CALL(*settingsMockPtr, getPath(Key{cypressProgrammerSetting}, _, _)) .Times(2) .WillRepeatedly(Return(FilePath::fromUserInput(defaultToolPath))); @@ -1684,11 +1683,11 @@ void McuSupportTest::test_createJLink3rdPartyPackage() { McuTargetDescription targetDescription{parseDescriptionJson(armgcc_ek_ra6m3g_baremetal_json)}; - EXPECT_CALL(*settingsMockPtr, getPath(QString{jlinkSetting}, QSettings::SystemScope, _)) + EXPECT_CALL(*settingsMockPtr, getPath(Key{jlinkSetting}, QSettings::SystemScope, _)) .Times(testing::AtMost(1)) .WillOnce(Return(FilePath::fromUserInput(jlinkPath))); - EXPECT_CALL(*settingsMockPtr, getPath(QString{jlinkSetting}, QSettings::UserScope, _)) + EXPECT_CALL(*settingsMockPtr, getPath(Key{jlinkSetting}, QSettings::UserScope, _)) .Times(testing::AtMost(1)) .WillOnce(Return(FilePath::fromUserInput(jlinkPath))); diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp index 84a8fdf736e..9e9781a4fda 100644 --- a/src/plugins/perfprofiler/perfsettings.cpp +++ b/src/plugins/perfprofiler/perfsettings.cpp @@ -425,13 +425,13 @@ PerfSettings::~PerfSettings() void PerfSettings::readGlobalSettings() { - QVariantMap defaults; + Store defaults; // Read stored values QSettings *settings = Core::ICore::settings(); settings->beginGroup(QLatin1String(Constants::AnalyzerSettingsGroupId)); - QVariantMap map = defaults; - for (QVariantMap::ConstIterator it = defaults.constBegin(); it != defaults.constEnd(); ++it) + Store map = defaults; + for (Store::ConstIterator it = defaults.constBegin(); it != defaults.constEnd(); ++it) map.insert(it.key(), settings->value(it.key(), it.value())); settings->endGroup(); @@ -442,9 +442,9 @@ void PerfSettings::writeGlobalSettings() const { QSettings *settings = Core::ICore::settings(); settings->beginGroup(QLatin1String(Constants::AnalyzerSettingsGroupId)); - QVariantMap map; + Store map; toMap(map); - for (QVariantMap::ConstIterator it = map.constBegin(); it != map.constEnd(); ++it) + for (Store::ConstIterator it = map.constBegin(); it != map.constEnd(); ++it) settings->setValue(it.key(), it.value()); settings->endGroup(); } @@ -474,7 +474,7 @@ void PerfSettings::addPerfRecordArguments(CommandLine *cmd) const void PerfSettings::resetToDefault() { PerfSettings defaults; - QVariantMap map; + Store map; defaults.toMap(map); fromMap(map); } diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp index fce7eb944d1..1fc8f83bd03 100644 --- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp @@ -31,7 +31,7 @@ using namespace ProjectExplorer; namespace QmlProfiler::Internal { -const QString QmlServerUrl = "QmlServerUrl"; +const char QmlServerUrl[] = "QmlServerUrl"; // // QmlProfilerRunControlPrivate diff --git a/src/plugins/qnx/qnxqtversion.cpp b/src/plugins/qnx/qnxqtversion.cpp index 420b3fbb810..d8e7ab5dcf5 100644 --- a/src/plugins/qnx/qnxqtversion.cpp +++ b/src/plugins/qnx/qnxqtversion.cpp @@ -109,14 +109,14 @@ QString QnxQtVersion::cpuDir() const return QnxUtils::cpuDirFromAbi(abis.at(0)); } -QVariantMap QnxQtVersion::toMap() const +Store QnxQtVersion::toMap() const { - QVariantMap result = QtVersion::toMap(); + Store result = QtVersion::toMap(); result.insert(SDP_PATH_KEY, sdpPath().toSettings()); return result; } -void QnxQtVersion::fromMap(const Store &map, const Utils::FilePath &) +void QnxQtVersion::fromMap(const Store &map, const FilePath &) { QtVersion::fromMap(map); setSdpPath(FilePath::fromSettings(map.value(SDP_PATH_KEY))); diff --git a/src/plugins/qnx/qnxsettingspage.cpp b/src/plugins/qnx/qnxsettingspage.cpp index 210caba8783..301bdec83b8 100644 --- a/src/plugins/qnx/qnxsettingspage.cpp +++ b/src/plugins/qnx/qnxsettingspage.cpp @@ -50,18 +50,18 @@ using namespace Debugger; namespace Qnx::Internal { -const QLatin1String QNXEnvFileKey("EnvFile"); -const QLatin1String QNXVersionKey("QNXVersion"); +const char QNXEnvFileKey[] = "EnvFile"; +const char QNXVersionKey[] = "QNXVersion"; // For backward compatibility -const QLatin1String SdpEnvFileKey("NDKEnvFile"); +const char SdpEnvFileKey[] = "NDKEnvFile"; -const QLatin1String QNXConfiguration("QNX_CONFIGURATION"); -const QLatin1String QNXTarget("QNX_TARGET"); -const QLatin1String QNXHost("QNX_HOST"); +const char QNXConfiguration[] = "QNX_CONFIGURATION"; +const char QNXTarget[] = "QNX_TARGET"; +const char QNXHost[] = "QNX_HOST"; -const QLatin1String QNXConfigDataKey("QNXConfiguration."); -const QLatin1String QNXConfigCountKey("QNXConfiguration.Count"); -const QLatin1String QNXConfigsFileVersionKey("Version"); +const char QNXConfigDataKey[] = "QNXConfiguration."; +const char QNXConfigCountKey[] = "QNXConfiguration.Count"; +const char QNXConfigsFileVersionKey[] = "Version"; static FilePath qnxConfigSettingsFileName() { @@ -84,11 +84,11 @@ public: m_envFile = FilePath::fromString(envFilePath); } - QVariantMap toMap() const + Store toMap() const { - QVariantMap data; - data.insert(QLatin1String(QNXEnvFileKey), m_envFile.toString()); - data.insert(QLatin1String(QNXVersionKey), m_version.toString()); + Store data; + data.insert(QNXEnvFileKey, m_envFile.toString()); + data.insert(QNXVersionKey, m_version.toString()); return data; } @@ -434,19 +434,19 @@ public: void saveConfigs() { - QVariantMap data; - data.insert(QLatin1String(QNXConfigsFileVersionKey), 1); + Store data; + data.insert(QNXConfigsFileVersionKey, 1); int count = 0; for (const QnxConfiguration &config : std::as_const(m_configurations)) { - QVariantMap tmp = config.toMap(); + Store tmp = config.toMap(); if (tmp.isEmpty()) continue; - data.insert(QNXConfigDataKey + QString::number(count), tmp); + data.insert(QNXConfigDataKey + Key::number(count), QVariant::fromValue(tmp)); ++count; } - data.insert(QLatin1String(QNXConfigCountKey), count); + data.insert(QNXConfigCountKey, count); m_writer.save(data, Core::ICore::dialogParent()); } @@ -456,15 +456,15 @@ public: if (!reader.load(qnxConfigSettingsFileName())) return; - QVariantMap data = reader.restoreValues(); + Store data = reader.restoreValues(); int count = data.value(QNXConfigCountKey, 0).toInt(); for (int i = 0; i < count; ++i) { - const QString key = QNXConfigDataKey + QString::number(i); + const Key key = QNXConfigDataKey + Key::number(i); if (!data.contains(key)) continue; QnxConfiguration config; - config.fromMap(data.value(key).toMap()); + config.fromMap(data.value(key).value<Store>()); m_configurations[config.m_envFile] = config; } } diff --git a/src/plugins/qnx/qnxtoolchain.cpp b/src/plugins/qnx/qnxtoolchain.cpp index 130945c976c..2e66fecacea 100644 --- a/src/plugins/qnx/qnxtoolchain.cpp +++ b/src/plugins/qnx/qnxtoolchain.cpp @@ -197,12 +197,12 @@ QnxToolChainConfigWidget::QnxToolChainConfigWidget(QnxToolChain *tc) , m_abiWidget(new AbiWidget) { m_compilerCommand->setExpectedKind(PathChooser::ExistingCommand); - m_compilerCommand->setHistoryCompleter(QLatin1String("Qnx.ToolChain.History")); + m_compilerCommand->setHistoryCompleter("Qnx.ToolChain.History"); m_compilerCommand->setFilePath(tc->compilerCommand()); m_compilerCommand->setEnabled(!tc->isAutoDetected()); m_sdpPath->setExpectedKind(PathChooser::ExistingDirectory); - m_sdpPath->setHistoryCompleter(QLatin1String("Qnx.Sdp.History")); + m_sdpPath->setHistoryCompleter("Qnx.Sdp.History"); m_sdpPath->setFilePath(tc->sdpPath()); m_sdpPath->setEnabled(!tc->isAutoDetected()); diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index 1debbc230c2..1130767a928 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -81,7 +81,7 @@ void AbstractRemoteLinuxDeployStep::setInternalInitializer( d->internalInit = init; } -void AbstractRemoteLinuxDeployStep::fromMap(const Utils::Store &map) +void AbstractRemoteLinuxDeployStep::fromMap(const Store &map) { BuildStep::fromMap(map); if (hasError()) @@ -89,7 +89,7 @@ void AbstractRemoteLinuxDeployStep::fromMap(const Utils::Store &map) d->deployTimes.importDeployTimes(map); } -void AbstractRemoteLinuxDeployStep::toMap(Utils::Store &map) const +void AbstractRemoteLinuxDeployStep::toMap(Store &map) const { BuildStep::toMap(map); map.insert(d->deployTimes.exportDeployTimes()); diff --git a/src/plugins/remotelinux/deploymenttimeinfo.cpp b/src/plugins/remotelinux/deploymenttimeinfo.cpp index d403534c60d..d3c9b028564 100644 --- a/src/plugins/remotelinux/deploymenttimeinfo.cpp +++ b/src/plugins/remotelinux/deploymenttimeinfo.cpp @@ -103,9 +103,9 @@ bool DeploymentTimeInfo::hasRemoteFileChanged(const DeployableFile &deployableFi return !lastDeployed.remote.isValid() || remoteTimestamp != lastDeployed.remote; } -QVariantMap DeploymentTimeInfo::exportDeployTimes() const +Store DeploymentTimeInfo::exportDeployTimes() const { - QVariantMap map; + Store map; QVariantList hostList; QVariantList fileList; QVariantList sysrootList; @@ -122,33 +122,31 @@ QVariantMap DeploymentTimeInfo::exportDeployTimes() const localTimeList << it.value().local; remoteTimeList << it.value().remote; } - map.insert(QLatin1String(LastDeployedHostsKey), hostList); - map.insert(QLatin1String(LastDeployedSysrootsKey), sysrootList); - map.insert(QLatin1String(LastDeployedFilesKey), fileList); - map.insert(QLatin1String(LastDeployedRemotePathsKey), remotePathList); - map.insert(QLatin1String(LastDeployedLocalTimesKey), localTimeList); - map.insert(QLatin1String(LastDeployedRemoteTimesKey), remoteTimeList); + map.insert(LastDeployedHostsKey, hostList); + map.insert(LastDeployedSysrootsKey, sysrootList); + map.insert(LastDeployedFilesKey, fileList); + map.insert(LastDeployedRemotePathsKey, remotePathList); + map.insert(LastDeployedLocalTimesKey, localTimeList); + map.insert(LastDeployedRemoteTimesKey, remoteTimeList); return map; } -void DeploymentTimeInfo::importDeployTimes(const QVariantMap &map) +void DeploymentTimeInfo::importDeployTimes(const Store &map) { - const QVariantList &hostList = map.value(QLatin1String(LastDeployedHostsKey)).toList(); - const QVariantList &sysrootList = map.value(QLatin1String(LastDeployedSysrootsKey)).toList(); - const QVariantList &fileList = map.value(QLatin1String(LastDeployedFilesKey)).toList(); - const QVariantList &remotePathList - = map.value(QLatin1String(LastDeployedRemotePathsKey)).toList(); + const QVariantList &hostList = map.value(LastDeployedHostsKey).toList(); + const QVariantList &sysrootList = map.value(LastDeployedSysrootsKey).toList(); + const QVariantList &fileList = map.value(LastDeployedFilesKey).toList(); + const QVariantList &remotePathList = map.value(LastDeployedRemotePathsKey).toList(); QVariantList localTimesList; - const auto localTimes = map.find(QLatin1String(LastDeployedLocalTimesKey)); + const auto localTimes = map.find(LastDeployedLocalTimesKey); if (localTimes != map.end()) { localTimesList = localTimes.value().toList(); } else { - localTimesList = map.value(QLatin1String(LastDeployedTimesKey)).toList(); + localTimesList = map.value(LastDeployedTimesKey).toList(); } - const QVariantList remoteTimesList - = map.value(QLatin1String(LastDeployedRemoteTimesKey)).toList(); + const QVariantList remoteTimesList = map.value(LastDeployedRemoteTimesKey).toList(); const int elemCount = qMin(qMin(qMin(hostList.size(), fileList.size()), qMin(remotePathList.size(), localTimesList.size())), diff --git a/src/plugins/remotelinux/deploymenttimeinfo.h b/src/plugins/remotelinux/deploymenttimeinfo.h index 6615dd1c616..69ec215bce3 100644 --- a/src/plugins/remotelinux/deploymenttimeinfo.h +++ b/src/plugins/remotelinux/deploymenttimeinfo.h @@ -3,7 +3,7 @@ #pragma once -#include <QVariantMap> +#include <utils/store.h> QT_BEGIN_NAMESPACE class QDateTime; @@ -24,8 +24,8 @@ public: DeploymentTimeInfo(); ~DeploymentTimeInfo(); - void importDeployTimes(const QVariantMap &map); - QVariantMap exportDeployTimes() const; + void importDeployTimes(const Utils::Store &map); + Utils::Store exportDeployTimes() const; void saveDeploymentTimeStamp(const ProjectExplorer::DeployableFile &deployableFile, const ProjectExplorer::Kit *kit, diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp index 566cf3e510f..09895a7ad76 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp @@ -283,7 +283,7 @@ void GenericLinuxDeviceConfigurationWidget::initGui() m_portsWarningLabel->setToolTip(QLatin1String("<font color=\"red\">") + Tr::tr("You will need at least one port.") + QLatin1String("</font>")); m_keyFileLineEdit->setExpectedKind(PathChooser::File); - m_keyFileLineEdit->setHistoryCompleter(QLatin1String("Ssh.KeyFile.History")); + m_keyFileLineEdit->setHistoryCompleter("Ssh.KeyFile.History"); m_keyFileLineEdit->lineEdit()->setMinimumWidth(0); QRegularExpressionValidator * const portsValidator = new QRegularExpressionValidator(QRegularExpression(PortList::regularExpression()), this); diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp index 90014e362c5..14005aa1a72 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp @@ -103,7 +103,7 @@ void RemoteLinuxEnvironmentAspect::fromMap(const Store &map) { ProjectExplorer::EnvironmentAspect::fromMap(map); - const auto version = map.value(QLatin1String(VERSION_KEY), 0).toInt(); + const auto version = map.value(VERSION_KEY, 0).toInt(); if (version == 0) { // In Qt Creator versions prior to 4.3 RemoteLinux included DISPLAY=:0.0 in the base // environment, if DISPLAY was not set. In order to keep existing projects expecting @@ -120,7 +120,7 @@ void RemoteLinuxEnvironmentAspect::fromMap(const Store &map) void RemoteLinuxEnvironmentAspect::toMap(Store &map) const { ProjectExplorer::EnvironmentAspect::toMap(map); - map.insert(QLatin1String(VERSION_KEY), ENVIRONMENTASPECT_VERSION); + map.insert(VERSION_KEY, ENVIRONMENTASPECT_VERSION); } } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index 734c17408e9..8d75e6e6c73 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -62,7 +62,7 @@ public: return prj->deploymentKnowledge() == DeploymentKnowledge::Bad && prj->hasMakeInstallEquivalent(); }; - setPostRestore([needsMakeInstall](DeployConfiguration *dc, const QVariantMap &map) { + setPostRestore([needsMakeInstall](DeployConfiguration *dc, const Store &map) { // 4.9 -> 4.10. See QTCREATORBUG-22689. if (map.value("_checkMakeInstall").toBool() && needsMakeInstall(dc->target())) { dc->stepList()->insertStep(0, Constants::MakeInstallStepId); diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 3e6046fdb60..b520f328921 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -187,7 +187,7 @@ ValgrindSettings::ValgrindSettings(bool global) // Note that this is used twice, once for project settings in the .user files // and once for global settings in QtCreator.ini. This uses intentionally // the same key to facilitate copying using fromMap/toMap. - QString base = "Analyzer.Valgrind."; + Key base = "Analyzer.Valgrind."; valgrindExecutable.setSettingsKey(base + "ValgrindExecutable"); valgrindExecutable.setDefaultValue("valgrind"); From 098ddf11e8a59bd60eb350c56bc63f54f8338755 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 24 Aug 2023 14:12:32 +0200 Subject: [PATCH 0872/1777] CppEditor: Introduce testing infrastructure for symbol renaming Also add two example tests. Change-Id: Ia76c4d92e7643971c1f201081b3df1f77f1e89a5 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/cppeditor/CMakeLists.txt | 1 + src/plugins/cppeditor/cppeditor.qbs | 2 + src/plugins/cppeditor/cppeditorplugin.cpp | 2 + src/plugins/cppeditor/cppfindreferences.cpp | 6 +- src/plugins/cppeditor/cppquickfix_test.h | 2 + src/plugins/cppeditor/cpprenaming_test.cpp | 146 ++++++++++++++++++++ src/plugins/cppeditor/cpprenaming_test.h | 19 +++ 7 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 src/plugins/cppeditor/cpprenaming_test.cpp create mode 100644 src/plugins/cppeditor/cpprenaming_test.h diff --git a/src/plugins/cppeditor/CMakeLists.txt b/src/plugins/cppeditor/CMakeLists.txt index 021bf0b7630..0c83b99b58f 100644 --- a/src/plugins/cppeditor/CMakeLists.txt +++ b/src/plugins/cppeditor/CMakeLists.txt @@ -129,6 +129,7 @@ extend_qtc_plugin(CppEditor cppmodelmanager_test.cpp cppmodelmanager_test.h cpppointerdeclarationformatter_test.cpp cpppointerdeclarationformatter_test.h cppquickfix_test.cpp cppquickfix_test.h + cpprenaming_test.cpp cpprenaming_test.h cppsourceprocessertesthelper.cpp cppsourceprocessertesthelper.h cppsourceprocessor_test.cpp cppsourceprocessor_test.h cpptoolstestcase.cpp cpptoolstestcase.h diff --git a/src/plugins/cppeditor/cppeditor.qbs b/src/plugins/cppeditor/cppeditor.qbs index 4e36279580a..2c0ff18dc30 100644 --- a/src/plugins/cppeditor/cppeditor.qbs +++ b/src/plugins/cppeditor/cppeditor.qbs @@ -265,6 +265,8 @@ QtcPlugin { "cpppointerdeclarationformatter_test.h", "cppquickfix_test.cpp", "cppquickfix_test.h", + "cpprenaming_test.cpp", + "cpprenaming_test.h", "cppsourceprocessor_test.cpp", "cppsourceprocessor_test.h", "cppsourceprocessertesthelper.cpp", diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index b1f69fbacf7..72d9eab85fd 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -42,6 +42,7 @@ #include "cppmodelmanager_test.h" #include "cpppointerdeclarationformatter_test.h" #include "cppquickfix_test.h" +#include "cpprenaming_test.h" #include "cppsourceprocessor_test.h" #include "cppuseselections_test.h" #include "fileandtokenactions_test.h" @@ -509,6 +510,7 @@ void CppEditorPlugin::initialize() addTest<Tests::IncludeHierarchyTest>(); addTest<Tests::InsertVirtualMethodsTest>(); addTest<Tests::QuickfixTest>(); + addTest<Tests::GlobalRenamingTest>(); addTest<Tests::SelectionsTest>(); #endif } diff --git a/src/plugins/cppeditor/cppfindreferences.cpp b/src/plugins/cppeditor/cppfindreferences.cpp index 78777021a7b..b933a0cde84 100644 --- a/src/plugins/cppeditor/cppfindreferences.cpp +++ b/src/plugins/cppeditor/cppfindreferences.cpp @@ -576,8 +576,10 @@ static void displayResults(SearchResult *search, item.setContainingFunctionName(result.containingFunction); item.setStyle(colorStyleForUsageType(result.tags)); item.setUseTextEditorFont(true); - if (search->supportsReplace()) - item.setSelectForReplacement(ProjectManager::projectForFile(result.path)); + if (search->supportsReplace()) { + item.setSelectForReplacement(!ProjectManager::hasProjects() + || ProjectManager::projectForFile(result.path)); + } search->addResult(item); if (parameters.prettySymbolName.isEmpty()) diff --git a/src/plugins/cppeditor/cppquickfix_test.h b/src/plugins/cppeditor/cppquickfix_test.h index ef1af4440b3..50dc29a213b 100644 --- a/src/plugins/cppeditor/cppquickfix_test.h +++ b/src/plugins/cppeditor/cppquickfix_test.h @@ -1,6 +1,8 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#pragma once + #include "cppquickfix.h" #include "cpptoolstestcase.h" diff --git a/src/plugins/cppeditor/cpprenaming_test.cpp b/src/plugins/cppeditor/cpprenaming_test.cpp new file mode 100644 index 00000000000..d1b9a9891df --- /dev/null +++ b/src/plugins/cppeditor/cpprenaming_test.cpp @@ -0,0 +1,146 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "cpprenaming_test.h" + +#include "cppeditorwidget.h" +#include "cppmodelmanager.h" +#include "cppquickfix_test.h" + +#include <texteditor/texteditor.h> + +#include <QEventLoop> +#include <QTimer> +#include <QtTest> + +namespace CppEditor::Internal::Tests { + +class RenamingTestRunner : public BaseQuickFixTestCase +{ +public: + RenamingTestRunner(const QList<TestDocumentPtr> &testDocuments, const QString &replacement) + : BaseQuickFixTestCase(testDocuments, {}) + { + QVERIFY(succeededSoFar()); + const TestDocumentPtr &doc = m_documentWithMarker; + const CursorInEditor cursorInEditor(doc->m_editor->textCursor(), doc->filePath(), + doc->m_editorWidget, doc->m_editor->textDocument()); + + QEventLoop loop; + CppModelManager::globalRename(cursorInEditor, replacement, [&loop]{ loop.quit(); }); + QTimer::singleShot(10000, &loop, [&loop] { loop.exit(1); }); + QVERIFY(loop.exec() == 0); + + // Compare all files + for (const TestDocumentPtr &testDocument : std::as_const(m_testDocuments)) { + QString result = testDocument->m_editorWidget->document()->toPlainText(); + if (result != testDocument->m_expectedSource) { + qDebug() << "---" << testDocument->m_expectedSource; + qDebug() << "+++" << result; + } + QCOMPARE(result, testDocument->m_expectedSource); + + // Undo the change + for (int i = 0; i < 100; ++i) + testDocument->m_editorWidget->undo(); + result = testDocument->m_editorWidget->document()->toPlainText(); + QCOMPARE(result, testDocument->m_source); + } + } +}; + +void GlobalRenamingTest::test_data() +{ + QTest::addColumn<QByteArrayList>("headers"); + QTest::addColumn<QByteArrayList>("sources"); + QTest::addColumn<QString>("replacement"); + + const char testClassHeader[] = R"cpp( +/** + * \brief MyClass + */ +class MyClass { + /** \brief MyClass::MyClass */ + MyClass() {} + ~MyClass(); + /** \brief MyClass::run */ + void run(); +}; +)cpp"; + + const char testClassSource[] = R"cpp( +#include "file.h" +/** \brief MyClass::~MyClass */ +MyClass::~MyClass() {} + +void MyClass::run() {} +)cpp"; + + QByteArray origHeaderClassName(testClassHeader); + const int classOffset = origHeaderClassName.indexOf("class MyClass"); + QVERIFY(classOffset != -1); + origHeaderClassName.insert(classOffset + 6, '@'); + const QByteArray newHeaderClassName = R"cpp( +/** + * \brief MyClass + */ +class MyNewClass { + /** \brief MyClass::MyClass */ + MyNewClass() {} + ~MyNewClass(); + /** \brief MyClass::run */ + void run(); +}; +)cpp"; + const QByteArray newSourceClassName = R"cpp( +#include "file.h" +/** \brief MyClass::~MyClass */ +MyNewClass::~MyNewClass() {} + +void MyNewClass::run() {} +)cpp"; + QTest::newRow("class name") << QByteArrayList{origHeaderClassName, newHeaderClassName} + << QByteArrayList{testClassSource, newSourceClassName} + << QString("MyNewClass"); + + QByteArray origSourceMethodName(testClassSource); + const int methodOffset = origSourceMethodName.indexOf("::run()"); + QVERIFY(methodOffset != -1); + origSourceMethodName.insert(methodOffset + 2, '@'); + const QByteArray newHeaderMethodName = R"cpp( +/** + * \brief MyClass + */ +class MyClass { + /** \brief MyClass::MyClass */ + MyClass() {} + ~MyClass(); + /** \brief MyClass::run */ + void runAgain(); +}; +)cpp"; + const QByteArray newSourceMethodName = R"cpp( +#include "file.h" +/** \brief MyClass::~MyClass */ +MyClass::~MyClass() {} + +void MyClass::runAgain() {} +)cpp"; + QTest::newRow("method name") << QByteArrayList{testClassHeader, newHeaderMethodName} + << QByteArrayList{origSourceMethodName, newSourceMethodName} + << QString("runAgain"); +} + +void GlobalRenamingTest::test() +{ + QFETCH(QByteArrayList, headers); + QFETCH(QByteArrayList, sources); + QFETCH(QString, replacement); + + QList<TestDocumentPtr> testDocuments( + {CppTestDocument::create("file.h", headers.at(0), headers.at(1)), + CppTestDocument::create("file.cpp", sources.at(0), sources.at(1))}); + RenamingTestRunner testRunner(testDocuments, replacement); +} + +} // namespace CppEditor::Internal::Tests diff --git a/src/plugins/cppeditor/cpprenaming_test.h b/src/plugins/cppeditor/cpprenaming_test.h new file mode 100644 index 00000000000..b7c651d306b --- /dev/null +++ b/src/plugins/cppeditor/cpprenaming_test.h @@ -0,0 +1,19 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <QObject> + +namespace CppEditor::Internal::Tests { + +class GlobalRenamingTest : public QObject +{ + Q_OBJECT + +private slots: + void test_data(); + void test(); +}; + +} // namespace CppEditor::Internal::Tests From a137f2b23d9cde2fb87296847ec5fd28d76c1f67 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 8 Aug 2023 15:30:55 +0200 Subject: [PATCH 0873/1777] LanguageClient: cancel find link at requests on rerequest This avoids triggering the callback if we already requested a find link at for a different position. Additionally we also cancel the request if the document changes or the cursor moves inbetween requesting the link and receiving the response. Change-Id: Iffc7b08012a649397e7ca7dfc99d314a1bbf19f7 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/languageclient/client.cpp | 22 +++++++++++++++++++ src/plugins/languageclient/client.h | 7 ++++++ .../languageclient/languageclientmanager.cpp | 2 +- .../languageclientsymbolsupport.cpp | 11 +++++----- .../languageclientsymbolsupport.h | 2 +- 5 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index ff646316e02..444d0d7589b 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -328,6 +328,7 @@ public: ProjectExplorer::Project *m_project = nullptr; QSet<TextEditor::IAssistProcessor *> m_runningAssistProcessors; SymbolSupport m_symbolSupport; + MessageId m_runningFindLinkRequest; ProgressManager m_progressManager; bool m_activateDocAutomatically = false; SemanticTokenSupport m_tokenSupport; @@ -1112,6 +1113,8 @@ void Client::documentContentsChanged(TextEditor::TextDocument *document, { if (!d->m_openedDocument.contains(document) || !reachable()) return; + if (d->m_runningFindLinkRequest.isValid()) + cancelRequest(d->m_runningFindLinkRequest); if (d->m_diagnosticManager) d->m_diagnosticManager->disableDiagnostics(document); const QString method(DidChangeTextDocumentNotification::methodName); @@ -1252,6 +1255,8 @@ TextEditor::HighlightingResult createHighlightingResult(const SymbolInformation void Client::cursorPositionChanged(TextEditor::TextEditorWidget *widget) { + if (d->m_runningFindLinkRequest.isValid()) + cancelRequest(d->m_runningFindLinkRequest); TextEditor::TextDocument *document = widget->textDocument(); if (d->m_documentsToUpdate.find(document) != d->m_documentsToUpdate.end()) return; // we are currently changing this document so postpone the DocumentHighlightsRequest @@ -1274,6 +1279,23 @@ SymbolSupport &Client::symbolSupport() return d->m_symbolSupport; } +void Client::findLinkAt(TextEditor::TextDocument *document, + const QTextCursor &cursor, + Utils::LinkHandler callback, + const bool resolveTarget) +{ + if (d->m_runningFindLinkRequest.isValid()) + cancelRequest(d->m_runningFindLinkRequest); + d->m_runningFindLinkRequest = symbolSupport().findLinkAt( + document, + cursor, + [this, callback](const Link &link) { + d->m_runningFindLinkRequest = {}; + callback(link); + }, + resolveTarget); +} + void Client::requestCodeActions(const LanguageServerProtocol::DocumentUri &uri, const LanguageServerProtocol::Diagnostic &diagnostic) { diff --git a/src/plugins/languageclient/client.h b/src/plugins/languageclient/client.h index 006559760c5..f0c071c2a1f 100644 --- a/src/plugins/languageclient/client.h +++ b/src/plugins/languageclient/client.h @@ -149,6 +149,13 @@ public: void addAssistProcessor(TextEditor::IAssistProcessor *processor); void removeAssistProcessor(TextEditor::IAssistProcessor *processor); SymbolSupport &symbolSupport(); + // In contrast to the findLinkAt of symbol support this find link makes sure that there is only + // one request running at a time and cancels the running request if the document changes, cursor + // moves or another link is requested + void findLinkAt(TextEditor::TextDocument *document, + const QTextCursor &cursor, + Utils::LinkHandler callback, + const bool resolveTarget); DocumentSymbolCache *documentSymbolCache(); HoverHandler *hoverHandler(); QList<LanguageServerProtocol::Diagnostic> diagnosticsAt(const Utils::FilePath &filePath, diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index a71f09255aa..dd369cfd4dc 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -463,7 +463,7 @@ void LanguageClientManager::editorOpened(Core::IEditor *editor) [document = textEditor->textDocument()] (const QTextCursor &cursor, const Utils::LinkHandler &callback, bool resolveTarget) { if (auto client = clientForDocument(document)) - client->symbolSupport().findLinkAt(document, cursor, callback, resolveTarget); + client->findLinkAt(document, cursor, callback, resolveTarget); }); connect(widget, &TextEditorWidget::requestUsages, this, [document = textEditor->textDocument()](const QTextCursor &cursor) { diff --git a/src/plugins/languageclient/languageclientsymbolsupport.cpp b/src/plugins/languageclient/languageclientsymbolsupport.cpp index 822d910ecf3..4ef534d7f3e 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.cpp +++ b/src/plugins/languageclient/languageclientsymbolsupport.cpp @@ -137,13 +137,13 @@ static TextDocumentPositionParams generateDocPosParams(TextEditor::TextDocument return TextDocumentPositionParams(documentId, pos); } -void SymbolSupport::findLinkAt(TextEditor::TextDocument *document, - const QTextCursor &cursor, - Utils::LinkHandler callback, - const bool resolveTarget) +MessageId SymbolSupport::findLinkAt(TextEditor::TextDocument *document, + const QTextCursor &cursor, + Utils::LinkHandler callback, + const bool resolveTarget) { if (!m_client->reachable()) - return; + return {}; GotoDefinitionRequest request(generateDocPosParams(document, cursor, m_client)); std::optional<Utils::Link> linkUnderCursor; if (!resolveTarget) { @@ -165,6 +165,7 @@ void SymbolSupport::findLinkAt(TextEditor::TextDocument *document, request, m_client->dynamicCapabilities(), m_client->capabilities()); + return request.id(); } bool SymbolSupport::supportsFindUsages(TextEditor::TextDocument *document) const diff --git a/src/plugins/languageclient/languageclientsymbolsupport.h b/src/plugins/languageclient/languageclientsymbolsupport.h index a46ac4273a3..a26c36e7ede 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.h +++ b/src/plugins/languageclient/languageclientsymbolsupport.h @@ -25,7 +25,7 @@ class LANGUAGECLIENT_EXPORT SymbolSupport : public QObject public: explicit SymbolSupport(Client *client); - void findLinkAt(TextEditor::TextDocument *document, + LanguageServerProtocol::MessageId findLinkAt(TextEditor::TextDocument *document, const QTextCursor &cursor, Utils::LinkHandler callback, const bool resolveTarget); From be54b3db2f4356d477b372bd4528415f2fa57e85 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 15 Aug 2023 15:37:51 +0200 Subject: [PATCH 0874/1777] Python: check for pyside in qt installation Fixes: PYSIDE-2153 Change-Id: I91ec24eb6a71d4f29edaf7a707b3c49a4deb725a Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/filepath.cpp | 7 +++ src/libs/utils/filepath.h | 1 + src/plugins/python/CMakeLists.txt | 2 +- src/plugins/python/pyside.cpp | 54 ++++++++++++++++++- src/plugins/python/python.qbs | 5 +- .../tests/qmlpreviewplugin_test.cpp | 3 +- src/plugins/qtsupport/qtoptionspage.cpp | 24 ++++++--- src/plugins/qtsupport/qtoptionspage.h | 19 +++++-- src/plugins/qtsupport/qtsupportplugin.cpp | 4 +- 9 files changed, 97 insertions(+), 22 deletions(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 42c1a19957f..abafc7748e8 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -1788,6 +1788,13 @@ FilePath FilePath::stringAppended(const QString &str) const return FilePath::fromString(toString() + str); } +std::optional<FilePath> FilePath::tailRemoved(const QString &str) const +{ + if (pathView().endsWith(str)) + return withNewPath(pathView().chopped(str.size()).toString()); + return {}; +} + QDateTime FilePath::lastModified() const { return fileAccess()->lastModified(*this); diff --git a/src/libs/utils/filepath.h b/src/libs/utils/filepath.h index ae71d3f2e31..a5605769866 100644 --- a/src/libs/utils/filepath.h +++ b/src/libs/utils/filepath.h @@ -97,6 +97,7 @@ public: [[nodiscard]] FilePath pathAppended(const QString &str) const; [[nodiscard]] FilePath stringAppended(const QString &str) const; + [[nodiscard]] std::optional<FilePath> tailRemoved(const QString &str) const; bool startsWith(const QString &s) const; bool endsWith(const QString &s) const; bool contains(const QString &s) const; diff --git a/src/plugins/python/CMakeLists.txt b/src/plugins/python/CMakeLists.txt index 0e4ca944194..25275cebdfc 100644 --- a/src/plugins/python/CMakeLists.txt +++ b/src/plugins/python/CMakeLists.txt @@ -1,6 +1,6 @@ add_qtc_plugin(Python DEPENDS QmlJS - PLUGIN_DEPENDS Core LanguageClient ProjectExplorer TextEditor + PLUGIN_DEPENDS Core LanguageClient ProjectExplorer TextEditor QtSupport SOURCES pipsupport.cpp pipsupport.h pyside.cpp pyside.h diff --git a/src/plugins/python/pyside.cpp b/src/plugins/python/pyside.cpp index 4b9df185a37..a2f1cac2fc1 100644 --- a/src/plugins/python/pyside.cpp +++ b/src/plugins/python/pyside.cpp @@ -13,6 +13,8 @@ #include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/target.h> +#include <qtsupport/qtoptionspage.h> + #include <texteditor/textdocument.h> #include <utils/algorithm.h> @@ -21,6 +23,9 @@ #include <utils/process.h> #include <utils/qtcassert.h> +#include <QBoxLayout> +#include <QComboBox> +#include <QDialogButtonBox> #include <QRegularExpression> #include <QTextCursor> @@ -79,7 +84,19 @@ void PySideInstaller::installPyside(const FilePath &python, const QString &pySide, TextEditor::TextDocument *document) { - document->infoBar()->removeInfo(installPySideInfoBarId); + QMap<QVersionNumber, Utils::FilePath> availablePySides; + + const std::optional<FilePath> qtInstallDir + = QtSupport::LinkWithQtSupport::linkedQt().tailRemoved("Tools/sdktool/share/qtcreator"); + if (qtInstallDir) { + const FilePath qtForPythonDir = qtInstallDir->pathAppended("QtForPython"); + for (const FilePath &versionDir : qtForPythonDir.dirEntries(QDir::Dirs | QDir::NoDotAndDotDot)) { + FilePath requirements = versionDir.pathAppended("requirements.txt"); + if (requirements.exists()) + availablePySides[QVersionNumber::fromString(versionDir.fileName())] = requirements; + } + } + auto install = new PipInstallTask(python); connect(install, &PipInstallTask::finished, install, &QObject::deleteLater); @@ -87,7 +104,40 @@ void PySideInstaller::installPyside(const FilePath &python, if (success) emit pySideInstalled(python, pySide); }); - install->setPackages({PipPackage(pySide)}); + if (qtInstallDir->isEmpty()) { + install->setPackages({PipPackage(pySide)}); + } else { + QDialog dialog; + dialog.setWindowTitle(Tr::tr("Select PySide version")); + dialog.setLayout(new QVBoxLayout()); + dialog.layout()->addWidget(new QLabel(Tr::tr("Select which PySide version to install:"))); + QComboBox *pySideSelector = new QComboBox(); + pySideSelector->addItem(Tr::tr("Latest PySide from the Python Package Index")); + for (const Utils::FilePath &version : availablePySides) { + const FilePath dir = version.parentDir(); + const QString text + = Tr::tr("PySide %1 wheel (%2)").arg(dir.fileName(), dir.toUserOutput()); + pySideSelector->addItem(text, version.toVariant()); + } + dialog.layout()->addWidget(pySideSelector); + QDialogButtonBox box; + box.setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + dialog.layout()->addWidget(&box); + connect(&box, &QDialogButtonBox::accepted, &dialog, &QDialog::accept); + connect(&box, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); + + if (dialog.exec() == QDialog::Rejected) + return; + + const FilePath requirementsFile = FilePath::fromVariant(pySideSelector->currentData()); + if (requirementsFile.isEmpty()) { + install->setPackages({PipPackage(pySide)}); + } else { + install->setWorkingDirectory(requirementsFile.parentDir()); + install->setRequirements(requirementsFile); + } + } + document->infoBar()->removeInfo(installPySideInfoBarId); install->run(); } diff --git a/src/plugins/python/python.qbs b/src/plugins/python/python.qbs index 5186dafcdcd..dd7aba1b697 100644 --- a/src/plugins/python/python.qbs +++ b/src/plugins/python/python.qbs @@ -9,10 +9,11 @@ QtcPlugin { Depends { name: "Utils" } Depends { name: "Core" } - Depends { name: "TextEditor" } - Depends { name: "ProjectExplorer" } Depends { name: "LanguageClient" } Depends { name: "LanguageServerProtocol" } + Depends { name: "ProjectExplorer" } + Depends { name: "QtSupport" } + Depends { name: "TextEditor" } Group { name: "General" diff --git a/src/plugins/qmlpreview/tests/qmlpreviewplugin_test.cpp b/src/plugins/qmlpreview/tests/qmlpreviewplugin_test.cpp index 21e1dd18466..2b06bd12e0d 100644 --- a/src/plugins/qmlpreview/tests/qmlpreviewplugin_test.cpp +++ b/src/plugins/qmlpreview/tests/qmlpreviewplugin_test.cpp @@ -15,8 +15,7 @@ Q_DECLARE_METATYPE(QmlPreview::TestFpsHandler) namespace QmlPreview { QmlPreviewPluginTest::QmlPreviewPluginTest(QObject *parent) : QObject(parent) -{ -} +{ } static ExtensionSystem::IPlugin *getPlugin() { diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 322de3ba480..bd41cfd068d 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -52,7 +52,8 @@ using namespace Utils; const char kInstallSettingsKey[] = "Settings/InstallSettings"; -namespace QtSupport::Internal { +namespace QtSupport { +namespace Internal { class QtVersionItem : public TreeItem { @@ -869,7 +870,7 @@ void QtOptionsPageWidget::setupLinkWithQtButton() const bool canLink = canLinkWithQt(&tip); m_linkWithQtButton->setEnabled(canLink); m_linkWithQtButton->setToolTip(tip); - connect(m_linkWithQtButton, &QPushButton::clicked, this, &QtOptionsPage::linkWithQt); + connect(m_linkWithQtButton, &QPushButton::clicked, this, &LinkWithQtSupport::linkWithQt); } void QtOptionsPageWidget::updateCurrentQtName() @@ -1080,19 +1081,26 @@ QStringList QtOptionsPage::keywords() const }; } -bool QtOptionsPage::canLinkWithQt() +} // Internal + +bool LinkWithQtSupport::canLinkWithQt() { return Internal::canLinkWithQt(nullptr); } -bool QtOptionsPage::isLinkedWithQt() +bool LinkWithQtSupport::isLinkedWithQt() { - return currentlyLinkedQtDir(nullptr).has_value(); + return Internal::currentlyLinkedQtDir(nullptr).has_value(); } -void QtOptionsPage::linkWithQt() +Utils::FilePath LinkWithQtSupport::linkedQt() { - QtOptionsPageWidget::linkWithQt(); + return Internal::currentlyLinkedQtDir(nullptr).value_or(Utils::FilePath()); } -} // QtSupport::Internal +void LinkWithQtSupport::linkWithQt() +{ + Internal::QtOptionsPageWidget::linkWithQt(); +} + +} // QtSupport diff --git a/src/plugins/qtsupport/qtoptionspage.h b/src/plugins/qtsupport/qtoptionspage.h index 8aa88ad5f3a..1ee0e28df8b 100644 --- a/src/plugins/qtsupport/qtoptionspage.h +++ b/src/plugins/qtsupport/qtoptionspage.h @@ -3,9 +3,12 @@ #pragma once +#include "qtsupport_global.h" + #include <coreplugin/dialogs/ioptionspage.h> -namespace QtSupport::Internal { +namespace QtSupport { +namespace Internal { class QtOptionsPage final : public Core::IOptionsPage { @@ -14,9 +17,15 @@ public: QStringList keywords() const final; - static bool canLinkWithQt(); - static bool isLinkedWithQt(); - static void linkWithQt(); }; -} // QtSupport::Internal +} // QtSupport + +namespace LinkWithQtSupport { +QTSUPPORT_EXPORT bool canLinkWithQt(); +QTSUPPORT_EXPORT bool isLinkedWithQt(); +QTSUPPORT_EXPORT Utils::FilePath linkedQt(); +QTSUPPORT_EXPORT void linkWithQt(); +} + +} // Internal diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index 9a6875f3864..93a62f0deb4 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -143,7 +143,7 @@ static void askAboutQtInstallation() { // if the install settings exist, the Qt Creator installation is (probably) already linked to // a Qt installation, so don't ask - if (!QtOptionsPage::canLinkWithQt() || QtOptionsPage::isLinkedWithQt() + if (!LinkWithQtSupport::canLinkWithQt() || LinkWithQtSupport::isLinkedWithQt() || !ICore::infoBar()->canInfoBeAdded(kLinkWithQtInstallationSetting)) return; @@ -155,7 +155,7 @@ static void askAboutQtInstallation() Utils::InfoBarEntry::GlobalSuppression::Enabled); info.addCustomButton(Tr::tr("Link with Qt"), [] { ICore::infoBar()->removeInfo(kLinkWithQtInstallationSetting); - QTimer::singleShot(0, ICore::dialogParent(), &QtOptionsPage::linkWithQt); + QTimer::singleShot(0, ICore::dialogParent(), &LinkWithQtSupport::linkWithQt); }); ICore::infoBar()->addInfo(info); } From 6c9d4a60e00cd00712d739746d9ded34876901a9 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 25 Aug 2023 12:55:14 +0200 Subject: [PATCH 0875/1777] Update yaml-cpp to 0.8.0 With removal of unneeded files similar to the original import, the patch in patches/0001-... generated with git format-patch -D HEAD~1 to show just the removed files. Change-Id: Ibfe64439bae5d1b1baa6b6bc47caf1ae030b3f9d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- cmake/Findyaml-cpp.cmake | 5 +- src/libs/3rdparty/yaml-cpp/README.md | 59 +- .../yaml-cpp/include/yaml-cpp/anchor.h | 2 +- .../yaml-cpp/include/yaml-cpp/binary.h | 12 +- .../yaml-cpp/include/yaml-cpp/depthguard.h | 77 + .../3rdparty/yaml-cpp/include/yaml-cpp/dll.h | 85 +- .../include/yaml-cpp/emitfromevents.h | 24 +- .../yaml-cpp/include/yaml-cpp/emitter.h | 35 +- .../yaml-cpp/include/yaml-cpp/emittermanip.h | 19 +- .../yaml-cpp/include/yaml-cpp/eventhandler.h | 9 +- .../yaml-cpp/include/yaml-cpp/exceptions.h | 94 +- .../yaml-cpp/include/yaml-cpp/node/convert.h | 276 +- .../include/yaml-cpp/node/detail/bool_type.h | 26 - .../include/yaml-cpp/node/detail/impl.h | 116 +- .../include/yaml-cpp/node/detail/iterator.h | 11 +- .../yaml-cpp/node/detail/iterator_fwd.h | 4 +- .../include/yaml-cpp/node/detail/memory.h | 7 +- .../include/yaml-cpp/node/detail/node.h | 32 +- .../include/yaml-cpp/node/detail/node_data.h | 24 +- .../yaml-cpp/node/detail/node_iterator.h | 28 +- .../yaml-cpp/include/yaml-cpp/node/impl.h | 173 +- .../yaml-cpp/include/yaml-cpp/node/iterator.h | 5 +- .../yaml-cpp/include/yaml-cpp/node/node.h | 11 +- .../yaml-cpp/include/yaml-cpp/node/ptr.h | 11 +- .../yaml-cpp/include/yaml-cpp/noexcept.h | 18 + .../yaml-cpp/include/yaml-cpp/noncopyable.h | 25 - .../include/yaml-cpp/ostream_wrapper.h | 10 +- .../yaml-cpp/include/yaml-cpp/parser.h | 10 +- .../yaml-cpp/include/yaml-cpp/stlemitter.h | 9 +- .../yaml-cpp/include/yaml-cpp/traits.h | 36 +- ...0001-yaml-cpp-Strip-unneeded-sources.patch | 2875 ++++++++--------- ...l.h-compatible-with-fvisibility-hidd.patch | 42 - ...x-unknown-override-specifier-for-_NO.patch | 52 - src/libs/3rdparty/yaml-cpp/src/binary.cpp | 17 +- .../3rdparty/yaml-cpp/src/collectionstack.h | 6 +- src/libs/3rdparty/yaml-cpp/src/convert.cpp | 21 +- src/libs/3rdparty/yaml-cpp/src/depthguard.cpp | 9 + src/libs/3rdparty/yaml-cpp/src/directives.cpp | 13 +- src/libs/3rdparty/yaml-cpp/src/directives.h | 2 +- src/libs/3rdparty/yaml-cpp/src/emit.cpp | 2 +- .../3rdparty/yaml-cpp/src/emitfromevents.cpp | 11 +- src/libs/3rdparty/yaml-cpp/src/emitter.cpp | 93 +- .../3rdparty/yaml-cpp/src/emitterstate.cpp | 95 +- src/libs/3rdparty/yaml-cpp/src/emitterstate.h | 17 +- .../3rdparty/yaml-cpp/src/emitterutils.cpp | 112 +- src/libs/3rdparty/yaml-cpp/src/emitterutils.h | 9 +- src/libs/3rdparty/yaml-cpp/src/exceptions.cpp | 35 +- src/libs/3rdparty/yaml-cpp/src/exp.cpp | 21 +- src/libs/3rdparty/yaml-cpp/src/exp.h | 66 +- src/libs/3rdparty/yaml-cpp/src/memory.cpp | 4 +- src/libs/3rdparty/yaml-cpp/src/node.cpp | 2 +- src/libs/3rdparty/yaml-cpp/src/node_data.cpp | 98 +- .../3rdparty/yaml-cpp/src/nodebuilder.cpp | 16 +- src/libs/3rdparty/yaml-cpp/src/nodebuilder.h | 36 +- src/libs/3rdparty/yaml-cpp/src/nodeevents.cpp | 31 +- src/libs/3rdparty/yaml-cpp/src/nodeevents.h | 12 +- src/libs/3rdparty/yaml-cpp/src/null.cpp | 2 +- .../3rdparty/yaml-cpp/src/ostream_wrapper.cpp | 17 +- src/libs/3rdparty/yaml-cpp/src/parse.cpp | 16 +- src/libs/3rdparty/yaml-cpp/src/parser.cpp | 28 +- src/libs/3rdparty/yaml-cpp/src/ptr_vector.h | 12 +- src/libs/3rdparty/yaml-cpp/src/regex_yaml.cpp | 20 +- src/libs/3rdparty/yaml-cpp/src/regex_yaml.h | 15 +- src/libs/3rdparty/yaml-cpp/src/regeximpl.h | 23 +- src/libs/3rdparty/yaml-cpp/src/scanner.cpp | 21 +- src/libs/3rdparty/yaml-cpp/src/scanner.h | 4 +- src/libs/3rdparty/yaml-cpp/src/scanscalar.cpp | 9 +- src/libs/3rdparty/yaml-cpp/src/scanscalar.h | 2 +- src/libs/3rdparty/yaml-cpp/src/scantag.cpp | 2 +- src/libs/3rdparty/yaml-cpp/src/scantoken.cpp | 10 +- src/libs/3rdparty/yaml-cpp/src/setting.h | 77 +- src/libs/3rdparty/yaml-cpp/src/simplekey.cpp | 8 +- .../3rdparty/yaml-cpp/src/singledocparser.cpp | 63 +- .../3rdparty/yaml-cpp/src/singledocparser.h | 18 +- src/libs/3rdparty/yaml-cpp/src/stream.cpp | 60 +- src/libs/3rdparty/yaml-cpp/src/stream.h | 12 +- .../3rdparty/yaml-cpp/src/streamcharsource.h | 18 +- src/libs/3rdparty/yaml-cpp/src/tag.cpp | 7 +- src/libs/3rdparty/yaml-cpp/src/tag.h | 2 +- src/libs/3rdparty/yaml-cpp/src/token.h | 17 +- src/libs/3rdparty/yaml-cpp/yaml-cpp.pc.cmake | 11 - src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs | 5 +- 82 files changed, 2885 insertions(+), 2544 deletions(-) create mode 100644 src/libs/3rdparty/yaml-cpp/include/yaml-cpp/depthguard.h delete mode 100644 src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/bool_type.h create mode 100644 src/libs/3rdparty/yaml-cpp/include/yaml-cpp/noexcept.h delete mode 100644 src/libs/3rdparty/yaml-cpp/include/yaml-cpp/noncopyable.h delete mode 100644 src/libs/3rdparty/yaml-cpp/patches/0002-yaml-cpp-Make-dll.h-compatible-with-fvisibility-hidd.patch delete mode 100644 src/libs/3rdparty/yaml-cpp/patches/0003-yaml-cpp-MSVC-Fix-unknown-override-specifier-for-_NO.patch create mode 100644 src/libs/3rdparty/yaml-cpp/src/depthguard.cpp delete mode 100644 src/libs/3rdparty/yaml-cpp/yaml-cpp.pc.cmake diff --git a/cmake/Findyaml-cpp.cmake b/cmake/Findyaml-cpp.cmake index 0b0e81418a2..87fbbcd63eb 100644 --- a/cmake/Findyaml-cpp.cmake +++ b/cmake/Findyaml-cpp.cmake @@ -37,6 +37,7 @@ else() ${YAML_SOURCE_DIR}/include/yaml-cpp ${YAML_SOURCE_DIR}/include/yaml-cpp/anchor.h ${YAML_SOURCE_DIR}/include/yaml-cpp/binary.h + ${YAML_SOURCE_DIR}/include/yaml-cpp/depthguard.h ${YAML_SOURCE_DIR}/include/yaml-cpp/dll.h ${YAML_SOURCE_DIR}/include/yaml-cpp/emitfromevents.h ${YAML_SOURCE_DIR}/include/yaml-cpp/emitter.h @@ -46,10 +47,10 @@ else() ${YAML_SOURCE_DIR}/include/yaml-cpp/eventhandler.h ${YAML_SOURCE_DIR}/include/yaml-cpp/exceptions.h ${YAML_SOURCE_DIR}/include/yaml-cpp/mark.h + ${YAML_SOURCE_DIR}/include/yaml-cpp/noexcept.h ${YAML_SOURCE_DIR}/include/yaml-cpp/node ${YAML_SOURCE_DIR}/include/yaml-cpp/node/convert.h ${YAML_SOURCE_DIR}/include/yaml-cpp/node/detail - ${YAML_SOURCE_DIR}/include/yaml-cpp/node/detail/bool_type.h ${YAML_SOURCE_DIR}/include/yaml-cpp/node/detail/impl.h ${YAML_SOURCE_DIR}/include/yaml-cpp/node/detail/iterator.h ${YAML_SOURCE_DIR}/include/yaml-cpp/node/detail/iterator_fwd.h @@ -65,7 +66,6 @@ else() ${YAML_SOURCE_DIR}/include/yaml-cpp/node/parse.h ${YAML_SOURCE_DIR}/include/yaml-cpp/node/ptr.h ${YAML_SOURCE_DIR}/include/yaml-cpp/node/type.h - ${YAML_SOURCE_DIR}/include/yaml-cpp/noncopyable.h ${YAML_SOURCE_DIR}/include/yaml-cpp/null.h ${YAML_SOURCE_DIR}/include/yaml-cpp/ostream_wrapper.h ${YAML_SOURCE_DIR}/include/yaml-cpp/parser.h @@ -75,6 +75,7 @@ else() ${YAML_SOURCE_DIR}/src/binary.cpp ${YAML_SOURCE_DIR}/src/collectionstack.h ${YAML_SOURCE_DIR}/src/convert.cpp + ${YAML_SOURCE_DIR}/src/depthguard.cpp ${YAML_SOURCE_DIR}/src/directives.cpp ${YAML_SOURCE_DIR}/src/directives.h ${YAML_SOURCE_DIR}/src/emit.cpp diff --git a/src/libs/3rdparty/yaml-cpp/README.md b/src/libs/3rdparty/yaml-cpp/README.md index f33d3503a15..70c231445d3 100644 --- a/src/libs/3rdparty/yaml-cpp/README.md +++ b/src/libs/3rdparty/yaml-cpp/README.md @@ -1,51 +1,58 @@ -# yaml-cpp [![Build Status](https://travis-ci.org/jbeder/yaml-cpp.svg?branch=master)](https://travis-ci.org/jbeder/yaml-cpp) [![Documentation](https://codedocs.xyz/jbeder/yaml-cpp.svg)](https://codedocs.xyz/jbeder/yaml-cpp/) +# yaml-cpp ![Build Status](https://github.com/jbeder/yaml-cpp/actions/workflows/build.yml/badge.svg) [![Documentation](https://codedocs.xyz/jbeder/yaml-cpp.svg)](https://codedocs.xyz/jbeder/yaml-cpp/) -yaml-cpp is a [YAML](http://www.yaml.org/) parser and emitter in C++ matching the [YAML 1.2 spec](http://www.yaml.org/spec/1.2/spec.html). +`yaml-cpp` is a [YAML](http://www.yaml.org/) parser and emitter in C++ matching the [YAML 1.2 spec](http://www.yaml.org/spec/1.2/spec.html). -To get a feel for how it can be used, see the [Tutorial](https://github.com/jbeder/yaml-cpp/wiki/Tutorial) or [How to Emit YAML](https://github.com/jbeder/yaml-cpp/wiki/How-To-Emit-YAML). For the old API (version < 0.5.0), see [How To Parse A Document](https://github.com/jbeder/yaml-cpp/wiki/How-To-Parse-A-Document-(Old-API)). +## Usage -# Problems? # +See [Tutorial](https://github.com/jbeder/yaml-cpp/wiki/Tutorial) and [How to Emit YAML](https://github.com/jbeder/yaml-cpp/wiki/How-To-Emit-YAML) for reference. For the old API (until 0.5.0), see [How To Parse A Document](https://github.com/jbeder/yaml-cpp/wiki/How-To-Parse-A-Document-(Old-API)). + +## Any Problems? If you find a bug, post an [issue](https://github.com/jbeder/yaml-cpp/issues)! If you have questions about how to use yaml-cpp, please post it on http://stackoverflow.com and tag it [`yaml-cpp`](http://stackoverflow.com/questions/tagged/yaml-cpp). -# How to Build # +## How to Build -yaml-cpp uses [CMake](http://www.cmake.org) to support cross-platform building. The basic steps to build are: +`yaml-cpp` uses [CMake](http://www.cmake.org) to support cross-platform building. Install [CMake](http://www.cmake.org) _(Resources -> Download)_ before proceeding. The basic steps to build are: -1. Download and install [CMake](http://www.cmake.org) (Resources -> Download). +**Note:** If you don't use the provided installer for your platform, make sure that you add `CMake`'s bin folder to your path. -**Note:** If you don't use the provided installer for your platform, make sure that you add CMake's bin folder to your path. +#### 1. Navigate into the source directory, create build folder and run `CMake`: -2. Navigate into the source directory, and type: - -``` +```sh mkdir build cd build +cmake [-G generator] [-DYAML_BUILD_SHARED_LIBS=on|OFF] .. ``` -3. Run CMake. The basic syntax is: + * The `generator` option is the build system you'd like to use. Run `cmake` without arguments to see a full list of available generators. + * On Windows, you might use "Visual Studio 12 2013" (VS 2013 32-bits), or "Visual Studio 14 2015 Win64" (VS 2015 64-bits). + * On OS X, you might use "Xcode". + * On a UNIX-like system, omit the option (for a Makefile). -``` -cmake [-G generator] [-DBUILD_SHARED_LIBS=ON|OFF] .. -``` - - * The `generator` is whatever type of build system you'd like to use. To see a full list of generators on your platform, just run `cmake` (with no arguments). For example: - * On Windows, you might use "Visual Studio 12 2013" to generate a Visual Studio 2013 solution or "Visual Studio 14 2015 Win64" to generate a 64-bit Visual Studio 2015 solution. - * On OS X, you might use "Xcode" to generate an Xcode project - * On a UNIX-y system, simply omit the option to generate a makefile - - * yaml-cpp defaults to building a static library, but you may build a shared library by specifying `-DBUILD_SHARED_LIBS=ON`. + * `yaml-cpp` builds a static library by default, you may want to build a shared library by specifying `-DYAML_BUILD_SHARED_LIBS=ON`. * For more options on customizing the build, see the [CMakeLists.txt](https://github.com/jbeder/yaml-cpp/blob/master/CMakeLists.txt) file. -4. Build it! +#### 2. Build it! + * The command you'll need to run depends on the generator you chose earlier. -5. To clean up, just remove the `build` directory. +**Note:** To clean up, just remove the `build` directory. -# Recent Release # +## Recent Releases -[yaml-cpp 0.6.0](https://github.com/jbeder/yaml-cpp/releases/tag/yaml-cpp-0.6.0) has been released! This release requires C++11, and no longer depends on Boost. +[yaml-cpp 0.6.0](https://github.com/jbeder/yaml-cpp/releases/tag/yaml-cpp-0.6.0) released! This release requires C++11, and no longer depends on Boost. [yaml-cpp 0.3.0](https://github.com/jbeder/yaml-cpp/releases/tag/release-0.3.0) is still available if you want the old API. **The old API will continue to be supported, and will still receive bugfixes!** The 0.3.x and 0.4.x versions will be old API releases, and 0.5.x and above will all be new API releases. + +# API Documentation + +The autogenerated API reference is hosted on [CodeDocs](https://codedocs.xyz/jbeder/yaml-cpp/index.html) + +# Third Party Integrations + +The following projects are not officially supported: + +- [Qt wrapper](https://gist.github.com/brcha/d392b2fe5f1e427cc8a6) +- [UnrealEngine Wrapper](https://github.com/jwindgassen/UnrealYAML) diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/anchor.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/anchor.h index 06759c724d2..f46d1d79dd8 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/anchor.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/anchor.h @@ -10,7 +10,7 @@ #include <cstddef> namespace YAML { -typedef std::size_t anchor_t; +using anchor_t = std::size_t; const anchor_t NullAnchor = 0; } diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/binary.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/binary.h index 29d5dbd027a..1050dae98c3 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/binary.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/binary.h @@ -19,9 +19,13 @@ YAML_CPP_API std::vector<unsigned char> DecodeBase64(const std::string &input); class YAML_CPP_API Binary { public: - Binary() : m_unownedData(0), m_unownedSize(0) {} Binary(const unsigned char *data_, std::size_t size_) - : m_unownedData(data_), m_unownedSize(size_) {} + : m_data{}, m_unownedData(data_), m_unownedSize(size_) {} + Binary() : Binary(nullptr, 0) {} + Binary(const Binary &) = default; + Binary(Binary &&) = default; + Binary &operator=(const Binary &) = default; + Binary &operator=(Binary &&) = default; bool owned() const { return !m_unownedData; } std::size_t size() const { return owned() ? m_data.size() : m_unownedSize; } @@ -35,7 +39,7 @@ class YAML_CPP_API Binary { rhs.clear(); rhs.resize(m_unownedSize); std::copy(m_unownedData, m_unownedData + m_unownedSize, rhs.begin()); - m_unownedData = 0; + m_unownedData = nullptr; m_unownedSize = 0; } else { m_data.swap(rhs); @@ -62,6 +66,6 @@ class YAML_CPP_API Binary { const unsigned char *m_unownedData; std::size_t m_unownedSize; }; -} +} // namespace YAML #endif // BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/depthguard.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/depthguard.h new file mode 100644 index 00000000000..8ca61ac6ccc --- /dev/null +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/depthguard.h @@ -0,0 +1,77 @@ +#ifndef DEPTH_GUARD_H_00000000000000000000000000000000000000000000000000000000 +#define DEPTH_GUARD_H_00000000000000000000000000000000000000000000000000000000 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include "exceptions.h" + +namespace YAML { + +/** + * @brief The DeepRecursion class + * An exception class which is thrown by DepthGuard. Ideally it should be + * a member of DepthGuard. However, DepthGuard is a templated class which means + * that any catch points would then need to know the template parameters. It is + * simpler for clients to not have to know at the catch point what was the + * maximum depth. + */ +class DeepRecursion : public ParserException { +public: + virtual ~DeepRecursion() = default; + + DeepRecursion(int depth, const Mark& mark_, const std::string& msg_); + + // Returns the recursion depth when the exception was thrown + int depth() const { + return m_depth; + } + +private: + int m_depth = 0; +}; + +/** + * @brief The DepthGuard class + * DepthGuard takes a reference to an integer. It increments the integer upon + * construction of DepthGuard and decrements the integer upon destruction. + * + * If the integer would be incremented past max_depth, then an exception is + * thrown. This is ideally geared toward guarding against deep recursion. + * + * @param max_depth + * compile-time configurable maximum depth. + */ +template <int max_depth = 2000> +class DepthGuard final { +public: + DepthGuard(int & depth_, const Mark& mark_, const std::string& msg_) : m_depth(depth_) { + ++m_depth; + if ( max_depth <= m_depth ) { + throw DeepRecursion{m_depth, mark_, msg_}; + } + } + + DepthGuard(const DepthGuard & copy_ctor) = delete; + DepthGuard(DepthGuard && move_ctor) = delete; + DepthGuard & operator=(const DepthGuard & copy_assign) = delete; + DepthGuard & operator=(DepthGuard && move_assign) = delete; + + ~DepthGuard() { + --m_depth; + } + + int current_depth() const { + return m_depth; + } + +private: + int & m_depth; +}; + +} // namespace YAML + +#endif // DEPTH_GUARD_H_00000000000000000000000000000000000000000000000000000000 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/dll.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/dll.h index 897f1533df6..eabdda1d95c 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/dll.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/dll.h @@ -1,42 +1,61 @@ #ifndef DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 #define DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 -#if defined(_MSC_VER) || \ - (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ - (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 -#pragma once -#endif +// Definition YAML_CPP_STATIC_DEFINE using to building YAML-CPP as static +// library (definition created by CMake or defined manually) -// The following ifdef block is the standard way of creating macros which make -// exporting from a DLL simpler. All files within this DLL are compiled with the -// yaml_cpp_EXPORTS symbol defined on the command line. This symbol should not -// be defined on any project that uses this DLL. This way any other project -// whose source files include this file see YAML_CPP_API functions as being -// imported from a DLL, whereas this DLL sees symbols defined with this macro as -// being exported. -#undef YAML_CPP_API +// Definition yaml_cpp_EXPORTS using to building YAML-CPP as dll/so library +// (definition created by CMake or defined manually) -#ifdef YAML_CPP_DLL // Using or Building YAML-CPP DLL (definition defined - // manually) - -#if defined(_WIN32) || defined(WIN32) -# define YAML_CPP_API_IMPORT __declspec(dllimport) -# define YAML_CPP_API_EXPORT __declspec(dllexport) +#ifdef YAML_CPP_STATIC_DEFINE +# define YAML_CPP_API +# define YAML_CPP_NO_EXPORT #else -# define YAML_CPP_API_IMPORT __attribute__((visibility("default"))) -# define YAML_CPP_API_EXPORT __attribute__((visibility("default"))) +# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) +# ifndef YAML_CPP_API +# ifdef yaml_cpp_EXPORTS + /* We are building this library */ +# pragma message( "Defining YAML_CPP_API for DLL export" ) +# define YAML_CPP_API __declspec(dllexport) +# else + /* We are using this library */ +# pragma message( "Defining YAML_CPP_API for DLL import" ) +# define YAML_CPP_API __declspec(dllimport) +# endif +# endif +# ifndef YAML_CPP_NO_EXPORT +# define YAML_CPP_NO_EXPORT +# endif +# else /* No _MSC_VER */ +# ifndef YAML_CPP_API +# ifdef yaml_cpp_EXPORTS + /* We are building this library */ +# define YAML_CPP_API __attribute__((visibility("default"))) +# else + /* We are using this library */ +# define YAML_CPP_API __attribute__((visibility("default"))) +# endif +# endif +# ifndef YAML_CPP_NO_EXPORT +# define YAML_CPP_NO_EXPORT __attribute__((visibility("hidden"))) +# endif +# endif /* _MSC_VER */ +#endif /* YAML_CPP_STATIC_DEFINE */ + +#ifndef YAML_CPP_DEPRECATED +# ifdef _MSC_VER +# define YAML_CPP_DEPRECATED __declspec(deprecated) +# else +# define YAML_CPP_DEPRECATED __attribute__ ((__deprecated__)) +# endif #endif -#ifdef yaml_cpp_EXPORTS // Building YAML-CPP DLL (definition created by CMake - // or defined manually) -// #pragma message( "Defining YAML_CPP_API for DLL export" ) -#define YAML_CPP_API YAML_CPP_API_EXPORT -#else // yaml_cpp_EXPORTS -// #pragma message( "Defining YAML_CPP_API for DLL import" ) -#define YAML_CPP_API YAML_CPP_API_IMPORT -#endif // yaml_cpp_EXPORTS -#else // YAML_CPP_DLL -#define YAML_CPP_API -#endif // YAML_CPP_DLL +#ifndef YAML_CPP_DEPRECATED_EXPORT +# define YAML_CPP_DEPRECATED_EXPORT YAML_CPP_API YAML_CPP_DEPRECATED +#endif -#endif // DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#ifndef YAML_CPP_DEPRECATED_NO_EXPORT +# define YAML_CPP_DEPRECATED_NO_EXPORT YAML_CPP_NO_EXPORT YAML_CPP_DEPRECATED +#endif + +#endif /* DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 */ diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/emitfromevents.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/emitfromevents.h index f14b051ab0e..1f389c5a138 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/emitfromevents.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/emitfromevents.h @@ -24,21 +24,21 @@ class EmitFromEvents : public EventHandler { public: EmitFromEvents(Emitter& emitter); - virtual void OnDocumentStart(const Mark& mark); - virtual void OnDocumentEnd(); + void OnDocumentStart(const Mark& mark) override; + void OnDocumentEnd() override; - virtual void OnNull(const Mark& mark, anchor_t anchor); - virtual void OnAlias(const Mark& mark, anchor_t anchor); - virtual void OnScalar(const Mark& mark, const std::string& tag, - anchor_t anchor, const std::string& value); + void OnNull(const Mark& mark, anchor_t anchor) override; + void OnAlias(const Mark& mark, anchor_t anchor) override; + void OnScalar(const Mark& mark, const std::string& tag, + anchor_t anchor, const std::string& value) override; - virtual void OnSequenceStart(const Mark& mark, const std::string& tag, - anchor_t anchor, EmitterStyle::value style); - virtual void OnSequenceEnd(); + void OnSequenceStart(const Mark& mark, const std::string& tag, + anchor_t anchor, EmitterStyle::value style) override; + void OnSequenceEnd() override; - virtual void OnMapStart(const Mark& mark, const std::string& tag, - anchor_t anchor, EmitterStyle::value style); - virtual void OnMapEnd(); + void OnMapStart(const Mark& mark, const std::string& tag, + anchor_t anchor, EmitterStyle::value style) override; + void OnMapEnd() override; private: void BeginNode(); diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/emitter.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/emitter.h index ef92cc4035b..210b1ec9744 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/emitter.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/emitter.h @@ -7,16 +7,18 @@ #pragma once #endif +#include <cmath> #include <cstddef> +#include <limits> #include <memory> #include <sstream> #include <string> +#include <type_traits> #include "yaml-cpp/binary.h" #include "yaml-cpp/dll.h" #include "yaml-cpp/emitterdef.h" #include "yaml-cpp/emittermanip.h" -#include "yaml-cpp/noncopyable.h" #include "yaml-cpp/null.h" #include "yaml-cpp/ostream_wrapper.h" @@ -28,10 +30,12 @@ struct _Null; namespace YAML { class EmitterState; -class YAML_CPP_API Emitter : private noncopyable { +class YAML_CPP_API Emitter { public: Emitter(); explicit Emitter(std::ostream& stream); + Emitter(const Emitter&) = delete; + Emitter& operator=(const Emitter&) = delete; ~Emitter(); // output @@ -46,6 +50,7 @@ class YAML_CPP_API Emitter : private noncopyable { bool SetOutputCharset(EMITTER_MANIP value); bool SetStringFormat(EMITTER_MANIP value); bool SetBoolFormat(EMITTER_MANIP value); + bool SetNullFormat(EMITTER_MANIP value); bool SetIntBase(EMITTER_MANIP value); bool SetSeqFormat(EMITTER_MANIP value); bool SetMapFormat(EMITTER_MANIP value); @@ -54,6 +59,7 @@ class YAML_CPP_API Emitter : private noncopyable { bool SetPostCommentIndent(std::size_t n); bool SetFloatPrecision(std::size_t n); bool SetDoublePrecision(std::size_t n); + void RestoreGlobalModifiedSettings(); // local setters Emitter& SetLocalValue(EMITTER_MANIP value); @@ -119,6 +125,7 @@ class YAML_CPP_API Emitter : private noncopyable { void SpaceOrIndentTo(bool requireSpace, std::size_t indent); const char* ComputeFullBoolName(bool b) const; + const char* ComputeNullName() const; bool CanEmitNewline() const; private: @@ -152,7 +159,27 @@ inline Emitter& Emitter::WriteStreamable(T value) { std::stringstream stream; SetStreamablePrecision<T>(stream); - stream << value; + + bool special = false; + if (std::is_floating_point<T>::value) { + if ((std::numeric_limits<T>::has_quiet_NaN || + std::numeric_limits<T>::has_signaling_NaN) && + std::isnan(value)) { + special = true; + stream << ".nan"; + } else if (std::numeric_limits<T>::has_infinity && std::isinf(value)) { + special = true; + if (std::signbit(value)) { + stream << "-.inf"; + } else { + stream << ".inf"; + } + } + } + + if (!special) { + stream << value; + } m_stream << stream.str(); StartedScalar(); @@ -249,6 +276,6 @@ inline Emitter& operator<<(Emitter& emitter, _Indent indent) { inline Emitter& operator<<(Emitter& emitter, _Precision precision) { return emitter.SetLocalPrecision(precision); } -} +} // namespace YAML #endif // EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/emittermanip.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/emittermanip.h index 89f7256714e..976d14950fc 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/emittermanip.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/emittermanip.h @@ -19,6 +19,7 @@ enum EMITTER_MANIP { // output character set EmitNonAscii, EscapeNonAscii, + EscapeAsJson, // string manipulators // Auto, // duplicate @@ -26,6 +27,12 @@ enum EMITTER_MANIP { DoubleQuoted, Literal, + // null manipulators + LowerNull, + UpperNull, + CamelNull, + TildeNull, + // bool manipulators YesNoBool, // yes, no TrueFalseBool, // true, false @@ -74,14 +81,14 @@ struct _Alias { std::string content; }; -inline _Alias Alias(const std::string content) { return _Alias(content); } +inline _Alias Alias(const std::string& content) { return _Alias(content); } struct _Anchor { _Anchor(const std::string& content_) : content(content_) {} std::string content; }; -inline _Anchor Anchor(const std::string content) { return _Anchor(content); } +inline _Anchor Anchor(const std::string& content) { return _Anchor(content); } struct _Tag { struct Type { @@ -96,11 +103,11 @@ struct _Tag { Type::value type; }; -inline _Tag VerbatimTag(const std::string content) { +inline _Tag VerbatimTag(const std::string& content) { return _Tag("", content, _Tag::Type::Verbatim); } -inline _Tag LocalTag(const std::string content) { +inline _Tag LocalTag(const std::string& content) { return _Tag("", content, _Tag::Type::PrimaryHandle); } @@ -108,7 +115,7 @@ inline _Tag LocalTag(const std::string& prefix, const std::string content) { return _Tag(prefix, content, _Tag::Type::NamedHandle); } -inline _Tag SecondaryTag(const std::string content) { +inline _Tag SecondaryTag(const std::string& content) { return _Tag("", content, _Tag::Type::NamedHandle); } @@ -117,7 +124,7 @@ struct _Comment { std::string content; }; -inline _Comment Comment(const std::string content) { return _Comment(content); } +inline _Comment Comment(const std::string& content) { return _Comment(content); } struct _Precision { _Precision(int floatPrecision_, int doublePrecision_) diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/eventhandler.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/eventhandler.h index efe381c6218..7242fe1f5ba 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/eventhandler.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/eventhandler.h @@ -17,7 +17,7 @@ struct Mark; class EventHandler { public: - virtual ~EventHandler() {} + virtual ~EventHandler() = default; virtual void OnDocumentStart(const Mark& mark) = 0; virtual void OnDocumentEnd() = 0; @@ -34,7 +34,12 @@ class EventHandler { virtual void OnMapStart(const Mark& mark, const std::string& tag, anchor_t anchor, EmitterStyle::value style) = 0; virtual void OnMapEnd() = 0; + + virtual void OnAnchor(const Mark& /*mark*/, + const std::string& /*anchor_name*/) { + // empty default implementation for compatibility + } }; -} +} // namespace YAML #endif // EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h index eae31968b7f..f6b2602ae1c 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h @@ -8,13 +8,12 @@ #endif #include "yaml-cpp/mark.h" +#include "yaml-cpp/noexcept.h" #include "yaml-cpp/traits.h" #include <sstream> #include <stdexcept> #include <string> -#define YAML_CPP_NOEXCEPT noexcept - namespace YAML { // error messages namespace ErrorMsg { @@ -66,7 +65,7 @@ const char* const ZERO_INDENT_IN_BLOCK = const char* const CHAR_IN_BLOCK = "unexpected character in block scalar"; const char* const AMBIGUOUS_ANCHOR = "cannot assign the same alias to multiple nodes"; -const char* const UNKNOWN_ANCHOR = "the referenced anchor is not defined"; +const char* const UNKNOWN_ANCHOR = "the referenced anchor is not defined: "; const char* const INVALID_NODE = "invalid node; this may result from using a map iterator as a sequence " @@ -101,6 +100,12 @@ inline const std::string KEY_NOT_FOUND_WITH_KEY(const std::string& key) { return stream.str(); } +inline const std::string KEY_NOT_FOUND_WITH_KEY(const char* key) { + std::stringstream stream; + stream << KEY_NOT_FOUND << ": " << key; + return stream.str(); +} + template <typename T> inline const std::string KEY_NOT_FOUND_WITH_KEY( const T& key, typename enable_if<is_numeric<T>>::type* = 0) { @@ -108,13 +113,48 @@ inline const std::string KEY_NOT_FOUND_WITH_KEY( stream << KEY_NOT_FOUND << ": " << key; return stream.str(); } + +template <typename T> +inline const std::string BAD_SUBSCRIPT_WITH_KEY( + const T&, typename disable_if<is_numeric<T>>::type* = nullptr) { + return BAD_SUBSCRIPT; } +inline const std::string BAD_SUBSCRIPT_WITH_KEY(const std::string& key) { + std::stringstream stream; + stream << BAD_SUBSCRIPT << " (key: \"" << key << "\")"; + return stream.str(); +} + +inline const std::string BAD_SUBSCRIPT_WITH_KEY(const char* key) { + std::stringstream stream; + stream << BAD_SUBSCRIPT << " (key: \"" << key << "\")"; + return stream.str(); +} + +template <typename T> +inline const std::string BAD_SUBSCRIPT_WITH_KEY( + const T& key, typename enable_if<is_numeric<T>>::type* = nullptr) { + std::stringstream stream; + stream << BAD_SUBSCRIPT << " (key: \"" << key << "\")"; + return stream.str(); +} + +inline const std::string INVALID_NODE_WITH_KEY(const std::string& key) { + std::stringstream stream; + if (key.empty()) { + return INVALID_NODE; + } + stream << "invalid node; first invalid key: \"" << key << "\""; + return stream.str(); +} +} // namespace ErrorMsg + class YAML_CPP_API Exception : public std::runtime_error { public: Exception(const Mark& mark_, const std::string& msg_) : std::runtime_error(build_what(mark_, msg_)), mark(mark_), msg(msg_) {} - virtual ~Exception() YAML_CPP_NOEXCEPT; + ~Exception() YAML_CPP_NOEXCEPT override; Exception(const Exception&) = default; @@ -125,7 +165,7 @@ class YAML_CPP_API Exception : public std::runtime_error { static const std::string build_what(const Mark& mark, const std::string& msg) { if (mark.is_null()) { - return msg.c_str(); + return msg; } std::stringstream output; @@ -140,7 +180,7 @@ class YAML_CPP_API ParserException : public Exception { ParserException(const Mark& mark_, const std::string& msg_) : Exception(mark_, msg_) {} ParserException(const ParserException&) = default; - virtual ~ParserException() YAML_CPP_NOEXCEPT; + ~ParserException() YAML_CPP_NOEXCEPT override; }; class YAML_CPP_API RepresentationException : public Exception { @@ -148,7 +188,7 @@ class YAML_CPP_API RepresentationException : public Exception { RepresentationException(const Mark& mark_, const std::string& msg_) : Exception(mark_, msg_) {} RepresentationException(const RepresentationException&) = default; - virtual ~RepresentationException() YAML_CPP_NOEXCEPT; + ~RepresentationException() YAML_CPP_NOEXCEPT override; }; // representation exceptions @@ -157,7 +197,7 @@ class YAML_CPP_API InvalidScalar : public RepresentationException { InvalidScalar(const Mark& mark_) : RepresentationException(mark_, ErrorMsg::INVALID_SCALAR) {} InvalidScalar(const InvalidScalar&) = default; - virtual ~InvalidScalar() YAML_CPP_NOEXCEPT; + ~InvalidScalar() YAML_CPP_NOEXCEPT override; }; class YAML_CPP_API KeyNotFound : public RepresentationException { @@ -167,7 +207,7 @@ class YAML_CPP_API KeyNotFound : public RepresentationException { : RepresentationException(mark_, ErrorMsg::KEY_NOT_FOUND_WITH_KEY(key_)) { } KeyNotFound(const KeyNotFound&) = default; - virtual ~KeyNotFound() YAML_CPP_NOEXCEPT; + ~KeyNotFound() YAML_CPP_NOEXCEPT override; }; template <typename T> @@ -175,7 +215,7 @@ class YAML_CPP_API TypedKeyNotFound : public KeyNotFound { public: TypedKeyNotFound(const Mark& mark_, const T& key_) : KeyNotFound(mark_, key_), key(key_) {} - virtual ~TypedKeyNotFound() YAML_CPP_NOEXCEPT {} + ~TypedKeyNotFound() YAML_CPP_NOEXCEPT override = default; T key; }; @@ -188,10 +228,11 @@ inline TypedKeyNotFound<T> MakeTypedKeyNotFound(const Mark& mark, class YAML_CPP_API InvalidNode : public RepresentationException { public: - InvalidNode() - : RepresentationException(Mark::null_mark(), ErrorMsg::INVALID_NODE) {} + InvalidNode(const std::string& key) + : RepresentationException(Mark::null_mark(), + ErrorMsg::INVALID_NODE_WITH_KEY(key)) {} InvalidNode(const InvalidNode&) = default; - virtual ~InvalidNode() YAML_CPP_NOEXCEPT; + ~InvalidNode() YAML_CPP_NOEXCEPT override; }; class YAML_CPP_API BadConversion : public RepresentationException { @@ -199,7 +240,7 @@ class YAML_CPP_API BadConversion : public RepresentationException { explicit BadConversion(const Mark& mark_) : RepresentationException(mark_, ErrorMsg::BAD_CONVERSION) {} BadConversion(const BadConversion&) = default; - virtual ~BadConversion() YAML_CPP_NOEXCEPT; + ~BadConversion() YAML_CPP_NOEXCEPT override; }; template <typename T> @@ -213,15 +254,16 @@ class YAML_CPP_API BadDereference : public RepresentationException { BadDereference() : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_DEREFERENCE) {} BadDereference(const BadDereference&) = default; - virtual ~BadDereference() YAML_CPP_NOEXCEPT; + ~BadDereference() YAML_CPP_NOEXCEPT override; }; class YAML_CPP_API BadSubscript : public RepresentationException { public: - BadSubscript() - : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_SUBSCRIPT) {} + template <typename Key> + BadSubscript(const Mark& mark_, const Key& key) + : RepresentationException(mark_, ErrorMsg::BAD_SUBSCRIPT_WITH_KEY(key)) {} BadSubscript(const BadSubscript&) = default; - virtual ~BadSubscript() YAML_CPP_NOEXCEPT; + ~BadSubscript() YAML_CPP_NOEXCEPT override; }; class YAML_CPP_API BadPushback : public RepresentationException { @@ -229,7 +271,7 @@ class YAML_CPP_API BadPushback : public RepresentationException { BadPushback() : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_PUSHBACK) {} BadPushback(const BadPushback&) = default; - virtual ~BadPushback() YAML_CPP_NOEXCEPT; + ~BadPushback() YAML_CPP_NOEXCEPT override; }; class YAML_CPP_API BadInsert : public RepresentationException { @@ -237,7 +279,7 @@ class YAML_CPP_API BadInsert : public RepresentationException { BadInsert() : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_INSERT) {} BadInsert(const BadInsert&) = default; - virtual ~BadInsert() YAML_CPP_NOEXCEPT; + ~BadInsert() YAML_CPP_NOEXCEPT override; }; class YAML_CPP_API EmitterException : public Exception { @@ -245,17 +287,17 @@ class YAML_CPP_API EmitterException : public Exception { EmitterException(const std::string& msg_) : Exception(Mark::null_mark(), msg_) {} EmitterException(const EmitterException&) = default; - virtual ~EmitterException() YAML_CPP_NOEXCEPT; + ~EmitterException() YAML_CPP_NOEXCEPT override; }; class YAML_CPP_API BadFile : public Exception { public: - BadFile() : Exception(Mark::null_mark(), ErrorMsg::BAD_FILE) {} + explicit BadFile(const std::string& filename) + : Exception(Mark::null_mark(), + std::string(ErrorMsg::BAD_FILE) + ": " + filename) {} BadFile(const BadFile&) = default; - virtual ~BadFile() YAML_CPP_NOEXCEPT; + ~BadFile() YAML_CPP_NOEXCEPT override; }; -} - -#undef YAML_CPP_NOEXCEPT +} // namespace YAML #endif // EXCEPTIONS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/convert.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/convert.h index 45a878ab0c0..d0eb450f731 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/convert.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/convert.h @@ -8,12 +8,20 @@ #endif #include <array> +#include <cmath> #include <limits> #include <list> #include <map> +#include <unordered_map> #include <sstream> +#include <type_traits> +#include <valarray> #include <vector> +#if __cplusplus >= 201703L +#include <string_view> +#endif + #include "yaml-cpp/binary.h" #include "yaml-cpp/node/impl.h" #include "yaml-cpp/node/iterator.h" @@ -21,6 +29,7 @@ #include "yaml-cpp/node/type.h" #include "yaml-cpp/null.h" + namespace YAML { class Binary; struct _Null; @@ -71,14 +80,33 @@ struct convert<std::string> { // C-strings can only be encoded template <> struct convert<const char*> { - static Node encode(const char*& rhs) { return Node(rhs); } + static Node encode(const char* rhs) { return Node(rhs); } +}; + +template <> +struct convert<char*> { + static Node encode(const char* rhs) { return Node(rhs); } }; template <std::size_t N> -struct convert<const char[N]> { - static Node encode(const char(&rhs)[N]) { return Node(rhs); } +struct convert<char[N]> { + static Node encode(const char* rhs) { return Node(rhs); } }; +#if __cplusplus >= 201703L +template <> +struct convert<std::string_view> { + static Node encode(std::string_view rhs) { return Node(std::string(rhs)); } + + static bool decode(const Node& node, std::string_view& rhs) { + if (!node.IsScalar()) + return false; + rhs = node.Scalar(); + return true; + } +}; +#endif + template <> struct convert<_Null> { static Node encode(const _Null& /* rhs */) { return Node(); } @@ -88,42 +116,98 @@ struct convert<_Null> { } }; -#define YAML_DEFINE_CONVERT_STREAMABLE(type, negative_op) \ - template <> \ - struct convert<type> { \ - static Node encode(const type& rhs) { \ - std::stringstream stream; \ - stream.precision(std::numeric_limits<type>::digits10 + 1); \ - stream << rhs; \ - return Node(stream.str()); \ - } \ - \ - static bool decode(const Node& node, type& rhs) { \ - if (node.Type() != NodeType::Scalar) \ - return false; \ - const std::string& input = node.Scalar(); \ - std::stringstream stream(input); \ - stream.unsetf(std::ios::dec); \ - if ((stream >> std::noskipws >> rhs) && (stream >> std::ws).eof()) \ - return true; \ - if (std::numeric_limits<type>::has_infinity) { \ - if (conversion::IsInfinity(input)) { \ - rhs = std::numeric_limits<type>::infinity(); \ - return true; \ - } else if (conversion::IsNegativeInfinity(input)) { \ - rhs = negative_op std::numeric_limits<type>::infinity(); \ - return true; \ - } \ - } \ - \ - if (std::numeric_limits<type>::has_quiet_NaN && \ - conversion::IsNaN(input)) { \ - rhs = std::numeric_limits<type>::quiet_NaN(); \ - return true; \ - } \ - \ - return false; \ - } \ +namespace conversion { +template <typename T> +typename std::enable_if< std::is_floating_point<T>::value, void>::type +inner_encode(const T& rhs, std::stringstream& stream){ + if (std::isnan(rhs)) { + stream << ".nan"; + } else if (std::isinf(rhs)) { + if (std::signbit(rhs)) { + stream << "-.inf"; + } else { + stream << ".inf"; + } + } else { + stream << rhs; + } +} + +template <typename T> +typename std::enable_if<!std::is_floating_point<T>::value, void>::type +inner_encode(const T& rhs, std::stringstream& stream){ + stream << rhs; +} + +template <typename T> +typename std::enable_if<(std::is_same<T, unsigned char>::value || + std::is_same<T, signed char>::value), bool>::type +ConvertStreamTo(std::stringstream& stream, T& rhs) { + int num; + if ((stream >> std::noskipws >> num) && (stream >> std::ws).eof()) { + if (num >= (std::numeric_limits<T>::min)() && + num <= (std::numeric_limits<T>::max)()) { + rhs = static_cast<T>(num); + return true; + } + } + return false; +} + +template <typename T> +typename std::enable_if<!(std::is_same<T, unsigned char>::value || + std::is_same<T, signed char>::value), bool>::type +ConvertStreamTo(std::stringstream& stream, T& rhs) { + if ((stream >> std::noskipws >> rhs) && (stream >> std::ws).eof()) { + return true; + } + return false; +} +} + +#define YAML_DEFINE_CONVERT_STREAMABLE(type, negative_op) \ + template <> \ + struct convert<type> { \ + \ + static Node encode(const type& rhs) { \ + std::stringstream stream; \ + stream.precision(std::numeric_limits<type>::max_digits10); \ + conversion::inner_encode(rhs, stream); \ + return Node(stream.str()); \ + } \ + \ + static bool decode(const Node& node, type& rhs) { \ + if (node.Type() != NodeType::Scalar) { \ + return false; \ + } \ + const std::string& input = node.Scalar(); \ + std::stringstream stream(input); \ + stream.unsetf(std::ios::dec); \ + if ((stream.peek() == '-') && std::is_unsigned<type>::value) { \ + return false; \ + } \ + if (conversion::ConvertStreamTo(stream, rhs)) { \ + return true; \ + } \ + if (std::numeric_limits<type>::has_infinity) { \ + if (conversion::IsInfinity(input)) { \ + rhs = std::numeric_limits<type>::infinity(); \ + return true; \ + } else if (conversion::IsNegativeInfinity(input)) { \ + rhs = negative_op std::numeric_limits<type>::infinity(); \ + return true; \ + } \ + } \ + \ + if (std::numeric_limits<type>::has_quiet_NaN) { \ + if (conversion::IsNaN(input)) { \ + rhs = std::numeric_limits<type>::quiet_NaN(); \ + return true; \ + } \ + } \ + \ + return false; \ + } \ } #define YAML_DEFINE_CONVERT_STREAMABLE_SIGNED(type) \ @@ -162,81 +246,104 @@ struct convert<bool> { }; // std::map -template <typename K, typename V> -struct convert<std::map<K, V>> { - static Node encode(const std::map<K, V>& rhs) { +template <typename K, typename V, typename C, typename A> +struct convert<std::map<K, V, C, A>> { + static Node encode(const std::map<K, V, C, A>& rhs) { Node node(NodeType::Map); - for (typename std::map<K, V>::const_iterator it = rhs.begin(); - it != rhs.end(); ++it) - node.force_insert(it->first, it->second); + for (const auto& element : rhs) + node.force_insert(element.first, element.second); return node; } - static bool decode(const Node& node, std::map<K, V>& rhs) { + static bool decode(const Node& node, std::map<K, V, C, A>& rhs) { if (!node.IsMap()) return false; rhs.clear(); - for (const_iterator it = node.begin(); it != node.end(); ++it) + for (const auto& element : node) #if defined(__GNUC__) && __GNUC__ < 4 // workaround for GCC 3: - rhs[it->first.template as<K>()] = it->second.template as<V>(); + rhs[element.first.template as<K>()] = element.second.template as<V>(); #else - rhs[it->first.as<K>()] = it->second.as<V>(); + rhs[element.first.as<K>()] = element.second.as<V>(); +#endif + return true; + } +}; + +// std::unordered_map +template <typename K, typename V, typename H, typename P, typename A> +struct convert<std::unordered_map<K, V, H, P, A>> { + static Node encode(const std::unordered_map<K, V, H, P, A>& rhs) { + Node node(NodeType::Map); + for (const auto& element : rhs) + node.force_insert(element.first, element.second); + return node; + } + + static bool decode(const Node& node, std::unordered_map<K, V, H, P, A>& rhs) { + if (!node.IsMap()) + return false; + + rhs.clear(); + for (const auto& element : node) +#if defined(__GNUC__) && __GNUC__ < 4 + // workaround for GCC 3: + rhs[element.first.template as<K>()] = element.second.template as<V>(); +#else + rhs[element.first.as<K>()] = element.second.as<V>(); #endif return true; } }; // std::vector -template <typename T> -struct convert<std::vector<T>> { - static Node encode(const std::vector<T>& rhs) { +template <typename T, typename A> +struct convert<std::vector<T, A>> { + static Node encode(const std::vector<T, A>& rhs) { Node node(NodeType::Sequence); - for (typename std::vector<T>::const_iterator it = rhs.begin(); - it != rhs.end(); ++it) - node.push_back(*it); + for (const auto& element : rhs) + node.push_back(element); return node; } - static bool decode(const Node& node, std::vector<T>& rhs) { + static bool decode(const Node& node, std::vector<T, A>& rhs) { if (!node.IsSequence()) return false; rhs.clear(); - for (const_iterator it = node.begin(); it != node.end(); ++it) + for (const auto& element : node) #if defined(__GNUC__) && __GNUC__ < 4 // workaround for GCC 3: - rhs.push_back(it->template as<T>()); + rhs.push_back(element.template as<T>()); #else - rhs.push_back(it->as<T>()); + rhs.push_back(element.as<T>()); #endif return true; } }; // std::list -template <typename T> -struct convert<std::list<T>> { - static Node encode(const std::list<T>& rhs) { +template <typename T, typename A> +struct convert<std::list<T,A>> { + static Node encode(const std::list<T,A>& rhs) { Node node(NodeType::Sequence); - for (typename std::list<T>::const_iterator it = rhs.begin(); - it != rhs.end(); ++it) - node.push_back(*it); + for (const auto& element : rhs) + node.push_back(element); return node; } - static bool decode(const Node& node, std::list<T>& rhs) { + static bool decode(const Node& node, std::list<T,A>& rhs) { if (!node.IsSequence()) return false; rhs.clear(); - for (const_iterator it = node.begin(); it != node.end(); ++it) + for (const auto& element : node) #if defined(__GNUC__) && __GNUC__ < 4 // workaround for GCC 3: - rhs.push_back(it->template as<T>()); + rhs.push_back(element.template as<T>()); #else - rhs.push_back(it->as<T>()); + rhs.push_back(element.as<T>()); #endif return true; } @@ -275,6 +382,37 @@ struct convert<std::array<T, N>> { } }; + +// std::valarray +template <typename T> +struct convert<std::valarray<T>> { + static Node encode(const std::valarray<T>& rhs) { + Node node(NodeType::Sequence); + for (const auto& element : rhs) { + node.push_back(element); + } + return node; + } + + static bool decode(const Node& node, std::valarray<T>& rhs) { + if (!node.IsSequence()) { + return false; + } + + rhs.resize(node.size()); + for (auto i = 0u; i < node.size(); ++i) { +#if defined(__GNUC__) && __GNUC__ < 4 + // workaround for GCC 3: + rhs[i] = node[i].template as<T>(); +#else + rhs[i] = node[i].as<T>(); +#endif + } + return true; + } +}; + + // std::pair template <typename T, typename U> struct convert<std::pair<T, U>> { diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/bool_type.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/bool_type.h deleted file mode 100644 index 2c80705c9ae..00000000000 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/bool_type.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef NODE_DETAIL_BOOL_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 -#define NODE_DETAIL_BOOL_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 - -#if defined(_MSC_VER) || \ - (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ - (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 -#pragma once -#endif - -namespace YAML { -namespace detail { -struct unspecified_bool { - struct NOT_ALLOWED; - static void true_value(NOT_ALLOWED*) {} -}; -typedef void (*unspecified_bool_type)(unspecified_bool::NOT_ALLOWED*); -} -} - -#define YAML_CPP_OPERATOR_BOOL() \ - operator YAML::detail::unspecified_bool_type() const { \ - return this->operator!() ? 0 \ - : &YAML::detail::unspecified_bool::true_value; \ - } - -#endif // NODE_DETAIL_BOOL_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/impl.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/impl.h index 09e55f838c2..b38038dfd22 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/impl.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/impl.h @@ -9,6 +9,8 @@ #include "yaml-cpp/node/detail/node.h" #include "yaml-cpp/node/detail/node_data.h" + +#include <algorithm> #include <type_traits> namespace YAML { @@ -17,7 +19,7 @@ template <typename Key, typename Enable = void> struct get_idx { static node* get(const std::vector<node*>& /* sequence */, const Key& /* key */, shared_memory_holder /* pMemory */) { - return 0; + return nullptr; } }; @@ -27,13 +29,13 @@ struct get_idx<Key, !std::is_same<Key, bool>::value>::type> { static node* get(const std::vector<node*>& sequence, const Key& key, shared_memory_holder /* pMemory */) { - return key < sequence.size() ? sequence[key] : 0; + return key < sequence.size() ? sequence[key] : nullptr; } static node* get(std::vector<node*>& sequence, const Key& key, shared_memory_holder pMemory) { - if (key > sequence.size() || (key > 0 && !sequence[key-1]->is_defined())) - return 0; + if (key > sequence.size() || (key > 0 && !sequence[key - 1]->is_defined())) + return nullptr; if (key == sequence.size()) sequence.push_back(&pMemory->create_node()); return sequence[key]; @@ -46,13 +48,51 @@ struct get_idx<Key, typename std::enable_if<std::is_signed<Key>::value>::type> { shared_memory_holder pMemory) { return key >= 0 ? get_idx<std::size_t>::get( sequence, static_cast<std::size_t>(key), pMemory) - : 0; + : nullptr; } static node* get(std::vector<node*>& sequence, const Key& key, shared_memory_holder pMemory) { return key >= 0 ? get_idx<std::size_t>::get( sequence, static_cast<std::size_t>(key), pMemory) - : 0; + : nullptr; + } +}; + +template <typename Key, typename Enable = void> +struct remove_idx { + static bool remove(std::vector<node*>&, const Key&, std::size_t&) { + return false; + } +}; + +template <typename Key> +struct remove_idx< + Key, typename std::enable_if<std::is_unsigned<Key>::value && + !std::is_same<Key, bool>::value>::type> { + + static bool remove(std::vector<node*>& sequence, const Key& key, + std::size_t& seqSize) { + if (key >= sequence.size()) { + return false; + } else { + sequence.erase(sequence.begin() + key); + if (seqSize > key) { + --seqSize; + } + return true; + } + } +}; + +template <typename Key> +struct remove_idx<Key, + typename std::enable_if<std::is_signed<Key>::value>::type> { + + static bool remove(std::vector<node*>& sequence, const Key& key, + std::size_t& seqSize) { + return key >= 0 ? remove_idx<std::size_t>::remove( + sequence, static_cast<std::size_t>(key), seqSize) + : false; } }; @@ -66,7 +106,11 @@ inline bool node::equals(const T& rhs, shared_memory_holder pMemory) { } inline bool node::equals(const char* rhs, shared_memory_holder pMemory) { - return equals<std::string>(rhs, pMemory); + std::string lhs; + if (convert<std::string>::decode(Node(*this, std::move(pMemory)), lhs)) { + return lhs == rhs; + } + return false; } // indexing @@ -78,22 +122,20 @@ inline node* node_data::get(const Key& key, break; case NodeType::Undefined: case NodeType::Null: - return NULL; + return nullptr; case NodeType::Sequence: if (node* pNode = get_idx<Key>::get(m_sequence, key, pMemory)) return pNode; - return NULL; + return nullptr; case NodeType::Scalar: - throw BadSubscript(); + throw BadSubscript(m_mark, key); } - for (node_map::const_iterator it = m_map.begin(); it != m_map.end(); ++it) { - if (it->first->equals(key, pMemory)) { - return it->second; - } - } + auto it = std::find_if(m_map.begin(), m_map.end(), [&](const kv_pair m) { + return m.first->equals(key, pMemory); + }); - return NULL; + return it != m_map.end() ? it->second : nullptr; } template <typename Key> @@ -112,13 +154,15 @@ inline node& node_data::get(const Key& key, shared_memory_holder pMemory) { convert_to_map(pMemory); break; case NodeType::Scalar: - throw BadSubscript(); + throw BadSubscript(m_mark, key); } - for (node_map::const_iterator it = m_map.begin(); it != m_map.end(); ++it) { - if (it->first->equals(key, pMemory)) { - return *it->second; - } + auto it = std::find_if(m_map.begin(), m_map.end(), [&](const kv_pair m) { + return m.first->equals(key, pMemory); + }); + + if (it != m_map.end()) { + return *it->second; } node& k = convert_to_node(key, pMemory); @@ -129,20 +173,26 @@ inline node& node_data::get(const Key& key, shared_memory_holder pMemory) { template <typename Key> inline bool node_data::remove(const Key& key, shared_memory_holder pMemory) { - if (m_type != NodeType::Map) - return false; - - for (kv_pairs::iterator it = m_undefinedPairs.begin(); - it != m_undefinedPairs.end();) { - kv_pairs::iterator jt = std::next(it); - if (it->first->equals(key, pMemory)) - m_undefinedPairs.erase(it); - it = jt; + if (m_type == NodeType::Sequence) { + return remove_idx<Key>::remove(m_sequence, key, m_seqSize); } - for (node_map::iterator it = m_map.begin(); it != m_map.end(); ++it) { - if (it->first->equals(key, pMemory)) { - m_map.erase(it); + if (m_type == NodeType::Map) { + kv_pairs::iterator it = m_undefinedPairs.begin(); + while (it != m_undefinedPairs.end()) { + kv_pairs::iterator jt = std::next(it); + if (it->first->equals(key, pMemory)) { + m_undefinedPairs.erase(it); + } + it = jt; + } + + auto iter = std::find_if(m_map.begin(), m_map.end(), [&](const kv_pair m) { + return m.first->equals(key, pMemory); + }); + + if (iter != m_map.end()) { + m_map.erase(iter); return true; } } diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/iterator.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/iterator.h index 0ea3bc3f0e3..997c69a14c5 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/iterator.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/iterator.h @@ -8,12 +8,13 @@ #endif #include "yaml-cpp/dll.h" +#include "yaml-cpp/node/detail/node_iterator.h" #include "yaml-cpp/node/node.h" #include "yaml-cpp/node/ptr.h" -#include "yaml-cpp/node/detail/node_iterator.h" #include <cstddef> #include <iterator> + namespace YAML { namespace detail { struct iterator_value; @@ -25,7 +26,7 @@ class iterator_base { template <typename> friend class iterator_base; struct enabler {}; - typedef node_iterator base_type; + using base_type = node_iterator; struct proxy { explicit proxy(const V& x) : m_ref(x) {} @@ -40,7 +41,7 @@ class iterator_base { using value_type = V; using difference_type = std::ptrdiff_t; using pointer = V*; - using reference = V&; + using reference = V; public: iterator_base() : m_iterator(), m_pMemory() {} @@ -89,7 +90,7 @@ class iterator_base { base_type m_iterator; shared_memory_holder m_pMemory; }; -} -} +} // namespace detail +} // namespace YAML #endif // VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/iterator_fwd.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/iterator_fwd.h index 5f1ffe7436d..75c9de086c0 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/iterator_fwd.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/iterator_fwd.h @@ -20,8 +20,8 @@ template <typename V> class iterator_base; } -typedef detail::iterator_base<detail::iterator_value> iterator; -typedef detail::iterator_base<const detail::iterator_value> const_iterator; +using iterator = detail::iterator_base<detail::iterator_value>; +using const_iterator = detail::iterator_base<const detail::iterator_value>; } #endif // VALUE_DETAIL_ITERATOR_FWD_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/memory.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/memory.h index 8f2bc2657a2..e881545bf2f 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/memory.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/memory.h @@ -22,11 +22,12 @@ namespace YAML { namespace detail { class YAML_CPP_API memory { public: + memory() : m_nodes{} {} node& create_node(); void merge(const memory& rhs); private: - typedef std::set<shared_node> Nodes; + using Nodes = std::set<shared_node>; Nodes m_nodes; }; @@ -40,7 +41,7 @@ class YAML_CPP_API memory_holder { private: shared_memory m_pMemory; }; -} -} +} // namespace detail +} // namespace YAML #endif // VALUE_DETAIL_MEMORY_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/node.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/node.h index 8a776f62a9e..acf60ffb6df 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/node.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/node.h @@ -7,18 +7,24 @@ #pragma once #endif -#include "yaml-cpp/emitterstyle.h" #include "yaml-cpp/dll.h" -#include "yaml-cpp/node/type.h" -#include "yaml-cpp/node/ptr.h" +#include "yaml-cpp/emitterstyle.h" #include "yaml-cpp/node/detail/node_ref.h" +#include "yaml-cpp/node/ptr.h" +#include "yaml-cpp/node/type.h" #include <set> +#include <atomic> namespace YAML { namespace detail { class node { + private: + struct less { + bool operator ()(const node* l, const node* r) const {return l->m_index < r->m_index;} + }; + public: - node() : m_pRef(new node_ref) {} + node() : m_pRef(new node_ref), m_dependencies{}, m_index{} {} node(const node&) = delete; node& operator=(const node&) = delete; @@ -42,9 +48,8 @@ class node { return; m_pRef->mark_defined(); - for (nodes::iterator it = m_dependencies.begin(); - it != m_dependencies.end(); ++it) - (*it)->mark_defined(); + for (node* dependency : m_dependencies) + dependency->mark_defined(); m_dependencies.clear(); } @@ -109,6 +114,7 @@ class node { void push_back(node& input, shared_memory_holder pMemory) { m_pRef->push_back(input, pMemory); input.add_dependency(*this); + m_index = m_amount.fetch_add(1); } void insert(node& key, node& value, shared_memory_holder pMemory) { m_pRef->insert(key, value, pMemory); @@ -120,7 +126,7 @@ class node { template <typename Key> node* get(const Key& key, shared_memory_holder pMemory) const { // NOTE: this returns a non-const node so that the top-level Node can wrap - // it, and returns a pointer so that it can be NULL (if there is no such + // it, and returns a pointer so that it can be nullptr (if there is no such // key). return static_cast<const node_ref&>(*m_pRef).get(key, pMemory); } @@ -137,7 +143,7 @@ class node { node* get(node& key, shared_memory_holder pMemory) const { // NOTE: this returns a non-const node so that the top-level Node can wrap - // it, and returns a pointer so that it can be NULL (if there is no such + // it, and returns a pointer so that it can be nullptr (if there is no such // key). return static_cast<const node_ref&>(*m_pRef).get(key, pMemory); } @@ -160,10 +166,12 @@ class node { private: shared_node_ref m_pRef; - typedef std::set<node*> nodes; + using nodes = std::set<node*, less>; nodes m_dependencies; + size_t m_index; + static YAML_CPP_API std::atomic<size_t> m_amount; }; -} -} +} // namespace detail +} // namespace YAML #endif // NODE_DETAIL_NODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/node_data.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/node_data.h index 50bcd74352d..07cf81aa099 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/node_data.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/node_data.h @@ -60,8 +60,8 @@ class YAML_CPP_API node_data { node_iterator end(); // sequence - void push_back(node& node, shared_memory_holder pMemory); - void insert(node& key, node& value, shared_memory_holder pMemory); + void push_back(node& node, const shared_memory_holder& pMemory); + void insert(node& key, node& value, const shared_memory_holder& pMemory); // indexing template <typename Key> @@ -71,9 +71,9 @@ class YAML_CPP_API node_data { template <typename Key> bool remove(const Key& key, shared_memory_holder pMemory); - node* get(node& key, shared_memory_holder pMemory) const; - node& get(node& key, shared_memory_holder pMemory); - bool remove(node& key, shared_memory_holder pMemory); + node* get(node& key, const shared_memory_holder& pMemory) const; + node& get(node& key, const shared_memory_holder& pMemory); + bool remove(node& key, const shared_memory_holder& pMemory); // map template <typename Key, typename Value> @@ -81,7 +81,7 @@ class YAML_CPP_API node_data { shared_memory_holder pMemory); public: - static std::string empty_scalar; + static const std::string& empty_scalar(); private: void compute_seq_size() const; @@ -91,8 +91,8 @@ class YAML_CPP_API node_data { void reset_map(); void insert_map_pair(node& key, node& value); - void convert_to_map(shared_memory_holder pMemory); - void convert_sequence_to_map(shared_memory_holder pMemory); + void convert_to_map(const shared_memory_holder& pMemory); + void convert_sequence_to_map(const shared_memory_holder& pMemory); template <typename T> static node& convert_to_node(const T& rhs, shared_memory_holder pMemory); @@ -108,17 +108,17 @@ class YAML_CPP_API node_data { std::string m_scalar; // sequence - typedef std::vector<node*> node_seq; + using node_seq = std::vector<node *>; node_seq m_sequence; mutable std::size_t m_seqSize; // map - typedef std::vector<std::pair<node*, node*>> node_map; + using node_map = std::vector<std::pair<node*, node*>>; node_map m_map; - typedef std::pair<node*, node*> kv_pair; - typedef std::list<kv_pair> kv_pairs; + using kv_pair = std::pair<node*, node*>; + using kv_pairs = std::list<kv_pair>; mutable kv_pairs m_undefinedPairs; }; } diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/node_iterator.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/node_iterator.h index 692afca3289..49dcf958dbb 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/node_iterator.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/detail/node_iterator.h @@ -24,11 +24,11 @@ struct iterator_type { template <typename V> struct node_iterator_value : public std::pair<V*, V*> { - typedef std::pair<V*, V*> kv; + using kv = std::pair<V*, V*>; - node_iterator_value() : kv(), pNode(0) {} + node_iterator_value() : kv(), pNode(nullptr) {} explicit node_iterator_value(V& rhs) : kv(), pNode(&rhs) {} - explicit node_iterator_value(V& key, V& value) : kv(&key, &value), pNode(0) {} + explicit node_iterator_value(V& key, V& value) : kv(&key, &value), pNode(nullptr) {} V& operator*() const { return *pNode; } V& operator->() const { return *pNode; } @@ -36,19 +36,19 @@ struct node_iterator_value : public std::pair<V*, V*> { V* pNode; }; -typedef std::vector<node*> node_seq; -typedef std::vector<std::pair<node*, node*>> node_map; +using node_seq = std::vector<node *>; +using node_map = std::vector<std::pair<node*, node*>>; template <typename V> struct node_iterator_type { - typedef node_seq::iterator seq; - typedef node_map::iterator map; + using seq = node_seq::iterator; + using map = node_map::iterator; }; template <typename V> struct node_iterator_type<const V> { - typedef node_seq::const_iterator seq; - typedef node_map::const_iterator map; + using seq = node_seq::const_iterator; + using map = node_map::const_iterator; }; template <typename V> @@ -65,13 +65,13 @@ class node_iterator_base { }; public: - typedef typename node_iterator_type<V>::seq SeqIter; - typedef typename node_iterator_type<V>::map MapIter; using iterator_category = std::forward_iterator_tag; using value_type = node_iterator_value<V>; using difference_type = std::ptrdiff_t; using pointer = node_iterator_value<V>*; - using reference = node_iterator_value<V>&; + using reference = node_iterator_value<V>; + using SeqIter = typename node_iterator_type<V>::seq; + using MapIter = typename node_iterator_type<V>::map; node_iterator_base() : m_type(iterator_type::NoneType), m_seqIt(), m_mapIt(), m_mapEnd() {} @@ -173,8 +173,8 @@ class node_iterator_base { MapIter m_mapIt, m_mapEnd; }; -typedef node_iterator_base<node> node_iterator; -typedef node_iterator_base<const node> const_node_iterator; +using node_iterator = node_iterator_base<node>; +using const_node_iterator = node_iterator_base<const node>; } } diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/impl.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/impl.h index 20c487a687f..312281f18cc 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/impl.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/impl.h @@ -7,18 +7,21 @@ #pragma once #endif -#include "yaml-cpp/node/node.h" -#include "yaml-cpp/node/iterator.h" +#include "yaml-cpp/exceptions.h" #include "yaml-cpp/node/detail/memory.h" #include "yaml-cpp/node/detail/node.h" -#include "yaml-cpp/exceptions.h" +#include "yaml-cpp/node/iterator.h" +#include "yaml-cpp/node/node.h" +#include <sstream> #include <string> namespace YAML { -inline Node::Node() : m_isValid(true), m_pNode(NULL) {} +inline Node::Node() + : m_isValid(true), m_invalidKey{}, m_pMemory(nullptr), m_pNode(nullptr) {} inline Node::Node(NodeType::value type) : m_isValid(true), + m_invalidKey{}, m_pMemory(new detail::memory_holder), m_pNode(&m_pMemory->create_node()) { m_pNode->set_type(type); @@ -27,6 +30,7 @@ inline Node::Node(NodeType::value type) template <typename T> inline Node::Node(const T& rhs) : m_isValid(true), + m_invalidKey{}, m_pMemory(new detail::memory_holder), m_pNode(&m_pMemory->create_node()) { Assign(rhs); @@ -34,24 +38,26 @@ inline Node::Node(const T& rhs) inline Node::Node(const detail::iterator_value& rhs) : m_isValid(rhs.m_isValid), + m_invalidKey(rhs.m_invalidKey), m_pMemory(rhs.m_pMemory), m_pNode(rhs.m_pNode) {} -inline Node::Node(const Node& rhs) - : m_isValid(rhs.m_isValid), - m_pMemory(rhs.m_pMemory), - m_pNode(rhs.m_pNode) {} +inline Node::Node(const Node&) = default; -inline Node::Node(Zombie) : m_isValid(false), m_pNode(NULL) {} +inline Node::Node(Zombie) + : m_isValid(false), m_invalidKey{}, m_pMemory{}, m_pNode(nullptr) {} + +inline Node::Node(Zombie, const std::string& key) + : m_isValid(false), m_invalidKey(key), m_pMemory{}, m_pNode(nullptr) {} inline Node::Node(detail::node& node, detail::shared_memory_holder pMemory) - : m_isValid(true), m_pMemory(pMemory), m_pNode(&node) {} + : m_isValid(true), m_invalidKey{}, m_pMemory(pMemory), m_pNode(&node) {} -inline Node::~Node() {} +inline Node::~Node() = default; inline void Node::EnsureNodeExists() const { if (!m_isValid) - throw InvalidNode(); + throw InvalidNode(m_invalidKey); if (!m_pNode) { m_pMemory.reset(new detail::memory_holder); m_pNode = &m_pMemory->create_node(); @@ -68,14 +74,14 @@ inline bool Node::IsDefined() const { inline Mark Node::Mark() const { if (!m_isValid) { - throw InvalidNode(); + throw InvalidNode(m_invalidKey); } return m_pNode ? m_pNode->mark() : Mark::null_mark(); } inline NodeType::value Node::Type() const { if (!m_isValid) - throw InvalidNode(); + throw InvalidNode(m_invalidKey); return m_pNode ? m_pNode->type() : NodeType::Null; } @@ -104,6 +110,8 @@ struct as_if<std::string, S> { const Node& node; std::string operator()(const S& fallback) const { + if (node.Type() == NodeType::Null) + return "null"; if (node.Type() != NodeType::Scalar) return fallback; return node.Scalar(); @@ -132,6 +140,8 @@ struct as_if<std::string, void> { const Node& node; std::string operator()() const { + if (node.Type() == NodeType::Null) + return "null"; if (node.Type() != NodeType::Scalar) throw TypedBadConversion<std::string>(node.Mark()); return node.Scalar(); @@ -142,7 +152,7 @@ struct as_if<std::string, void> { template <typename T> inline T Node::as() const { if (!m_isValid) - throw InvalidNode(); + throw InvalidNode(m_invalidKey); return as_if<T, void>(*this)(); } @@ -155,32 +165,28 @@ inline T Node::as(const S& fallback) const { inline const std::string& Node::Scalar() const { if (!m_isValid) - throw InvalidNode(); - return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar; + throw InvalidNode(m_invalidKey); + return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar(); } inline const std::string& Node::Tag() const { if (!m_isValid) - throw InvalidNode(); - return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar; + throw InvalidNode(m_invalidKey); + return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar(); } inline void Node::SetTag(const std::string& tag) { - if (!m_isValid) - throw InvalidNode(); EnsureNodeExists(); m_pNode->set_tag(tag); } inline EmitterStyle::value Node::Style() const { if (!m_isValid) - throw InvalidNode(); + throw InvalidNode(m_invalidKey); return m_pNode ? m_pNode->style() : EmitterStyle::Default; } inline void Node::SetStyle(EmitterStyle::value style) { - if (!m_isValid) - throw InvalidNode(); EnsureNodeExists(); m_pNode->set_style(style); } @@ -188,7 +194,7 @@ inline void Node::SetStyle(EmitterStyle::value style) { // assignment inline bool Node::is(const Node& rhs) const { if (!m_isValid || !rhs.m_isValid) - throw InvalidNode(); + throw InvalidNode(m_invalidKey); if (!m_pNode || !rhs.m_pNode) return false; return m_pNode->is(*rhs.m_pNode); @@ -196,15 +202,20 @@ inline bool Node::is(const Node& rhs) const { template <typename T> inline Node& Node::operator=(const T& rhs) { - if (!m_isValid) - throw InvalidNode(); Assign(rhs); return *this; } +inline Node& Node::operator=(const Node& rhs) { + if (is(rhs)) + return *this; + AssignNode(rhs); + return *this; +} + inline void Node::reset(const YAML::Node& rhs) { if (!m_isValid || !rhs.m_isValid) - throw InvalidNode(); + throw InvalidNode(m_invalidKey); m_pMemory = rhs.m_pMemory; m_pNode = rhs.m_pNode; } @@ -212,44 +223,27 @@ inline void Node::reset(const YAML::Node& rhs) { template <typename T> inline void Node::Assign(const T& rhs) { if (!m_isValid) - throw InvalidNode(); + throw InvalidNode(m_invalidKey); AssignData(convert<T>::encode(rhs)); } template <> inline void Node::Assign(const std::string& rhs) { - if (!m_isValid) - throw InvalidNode(); EnsureNodeExists(); m_pNode->set_scalar(rhs); } inline void Node::Assign(const char* rhs) { - if (!m_isValid) - throw InvalidNode(); EnsureNodeExists(); m_pNode->set_scalar(rhs); } inline void Node::Assign(char* rhs) { - if (!m_isValid) - throw InvalidNode(); EnsureNodeExists(); m_pNode->set_scalar(rhs); } -inline Node& Node::operator=(const Node& rhs) { - if (!m_isValid || !rhs.m_isValid) - throw InvalidNode(); - if (is(rhs)) - return *this; - AssignNode(rhs); - return *this; -} - inline void Node::AssignData(const Node& rhs) { - if (!m_isValid || !rhs.m_isValid) - throw InvalidNode(); EnsureNodeExists(); rhs.EnsureNodeExists(); @@ -258,8 +252,8 @@ inline void Node::AssignData(const Node& rhs) { } inline void Node::AssignNode(const Node& rhs) { - if (!m_isValid || !rhs.m_isValid) - throw InvalidNode(); + if (!m_isValid) + throw InvalidNode(m_invalidKey); rhs.EnsureNodeExists(); if (!m_pNode) { @@ -276,7 +270,7 @@ inline void Node::AssignNode(const Node& rhs) { // size/iterator inline std::size_t Node::size() const { if (!m_isValid) - throw InvalidNode(); + throw InvalidNode(m_invalidKey); return m_pNode ? m_pNode->size() : 0; } @@ -309,13 +303,11 @@ inline iterator Node::end() { template <typename T> inline void Node::push_back(const T& rhs) { if (!m_isValid) - throw InvalidNode(); + throw InvalidNode(m_invalidKey); push_back(Node(rhs)); } inline void Node::push_back(const Node& rhs) { - if (!m_isValid || !rhs.m_isValid) - throw InvalidNode(); EnsureNodeExists(); rhs.EnsureNodeExists(); @@ -323,99 +315,49 @@ inline void Node::push_back(const Node& rhs) { m_pMemory->merge(*rhs.m_pMemory); } -// helpers for indexing -namespace detail { -template <typename T> -struct to_value_t { - explicit to_value_t(const T& t_) : t(t_) {} - const T& t; - typedef const T& return_type; - - const T& operator()() const { return t; } -}; - -template <> -struct to_value_t<const char*> { - explicit to_value_t(const char* t_) : t(t_) {} - const char* t; - typedef std::string return_type; - - const std::string operator()() const { return t; } -}; - -template <> -struct to_value_t<char*> { - explicit to_value_t(char* t_) : t(t_) {} - const char* t; - typedef std::string return_type; - - const std::string operator()() const { return t; } -}; - -template <std::size_t N> -struct to_value_t<char[N]> { - explicit to_value_t(const char* t_) : t(t_) {} - const char* t; - typedef std::string return_type; - - const std::string operator()() const { return t; } -}; - -// converts C-strings to std::strings so they can be copied -template <typename T> -inline typename to_value_t<T>::return_type to_value(const T& t) { - return to_value_t<T>(t)(); -} +template<typename Key> +std::string key_to_string(const Key& key) { + return streamable_to_string<Key, is_streamable<std::stringstream, Key>::value>().impl(key); } // indexing template <typename Key> inline const Node Node::operator[](const Key& key) const { - if (!m_isValid) - throw InvalidNode(); EnsureNodeExists(); - detail::node* value = static_cast<const detail::node&>(*m_pNode) - .get(detail::to_value(key), m_pMemory); + detail::node* value = + static_cast<const detail::node&>(*m_pNode).get(key, m_pMemory); if (!value) { - return Node(ZombieNode); + return Node(ZombieNode, key_to_string(key)); } return Node(*value, m_pMemory); } template <typename Key> inline Node Node::operator[](const Key& key) { - if (!m_isValid) - throw InvalidNode(); EnsureNodeExists(); - detail::node& value = m_pNode->get(detail::to_value(key), m_pMemory); + detail::node& value = m_pNode->get(key, m_pMemory); return Node(value, m_pMemory); } template <typename Key> inline bool Node::remove(const Key& key) { - if (!m_isValid) - throw InvalidNode(); EnsureNodeExists(); - return m_pNode->remove(detail::to_value(key), m_pMemory); + return m_pNode->remove(key, m_pMemory); } inline const Node Node::operator[](const Node& key) const { - if (!m_isValid || !key.m_isValid) - throw InvalidNode(); EnsureNodeExists(); key.EnsureNodeExists(); m_pMemory->merge(*key.m_pMemory); detail::node* value = static_cast<const detail::node&>(*m_pNode).get(*key.m_pNode, m_pMemory); if (!value) { - return Node(ZombieNode); + return Node(ZombieNode, key_to_string(key)); } return Node(*value, m_pMemory); } inline Node Node::operator[](const Node& key) { - if (!m_isValid || !key.m_isValid) - throw InvalidNode(); EnsureNodeExists(); key.EnsureNodeExists(); m_pMemory->merge(*key.m_pMemory); @@ -424,8 +366,6 @@ inline Node Node::operator[](const Node& key) { } inline bool Node::remove(const Node& key) { - if (!m_isValid || !key.m_isValid) - throw InvalidNode(); EnsureNodeExists(); key.EnsureNodeExists(); return m_pNode->remove(*key.m_pNode, m_pMemory); @@ -434,15 +374,12 @@ inline bool Node::remove(const Node& key) { // map template <typename Key, typename Value> inline void Node::force_insert(const Key& key, const Value& value) { - if (!m_isValid) - throw InvalidNode(); EnsureNodeExists(); - m_pNode->force_insert(detail::to_value(key), detail::to_value(value), - m_pMemory); + m_pNode->force_insert(key, value, m_pMemory); } // free functions inline bool operator==(const Node& lhs, const Node& rhs) { return lhs.is(rhs); } -} +} // namespace YAML #endif // NODE_IMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/iterator.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/iterator.h index 366a9c807fe..1fcf6e400ff 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/iterator.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/iterator.h @@ -15,10 +15,13 @@ #include <utility> #include <vector> +// Assert in place so gcc + libc++ combination properly builds +static_assert(std::is_constructible<YAML::Node, const YAML::Node&>::value, "Node must be copy constructable"); + namespace YAML { namespace detail { struct iterator_value : public Node, std::pair<Node, Node> { - iterator_value() {} + iterator_value() = default; explicit iterator_value(const Node& rhs) : Node(rhs), std::pair<Node, Node>(Node(Node::ZombieNode), Node(Node::ZombieNode)) {} diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/node.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/node.h index 1ded7d27b72..c9e9a0a4bc1 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/node.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/node.h @@ -8,11 +8,11 @@ #endif #include <stdexcept> +#include <string> #include "yaml-cpp/dll.h" #include "yaml-cpp/emitterstyle.h" #include "yaml-cpp/mark.h" -#include "yaml-cpp/node/detail/bool_type.h" #include "yaml-cpp/node/detail/iterator_fwd.h" #include "yaml-cpp/node/ptr.h" #include "yaml-cpp/node/type.h" @@ -38,8 +38,8 @@ class YAML_CPP_API Node { template <typename T, typename S> friend struct as_if; - typedef YAML::iterator iterator; - typedef YAML::const_iterator const_iterator; + using iterator = YAML::iterator; + using const_iterator = YAML::const_iterator; Node(); explicit Node(NodeType::value type); @@ -58,7 +58,7 @@ class YAML_CPP_API Node { bool IsMap() const { return Type() == NodeType::Map; } // bool conversions - YAML_CPP_OPERATOR_BOOL() + explicit operator bool() const { return IsDefined(); } bool operator!() const { return !IsDefined(); } // access @@ -116,6 +116,7 @@ class YAML_CPP_API Node { private: enum Zombie { ZombieNode }; explicit Node(Zombie); + explicit Node(Zombie, const std::string&); explicit Node(detail::node& node, detail::shared_memory_holder pMemory); void EnsureNodeExists() const; @@ -130,6 +131,8 @@ class YAML_CPP_API Node { private: bool m_isValid; + // String representation of invalid key, if the node is invalid. + std::string m_invalidKey; mutable detail::shared_memory_holder m_pMemory; mutable detail::node* m_pNode; }; diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/ptr.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/ptr.h index ce085dd5cd8..f55d95ed9ca 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/ptr.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/node/ptr.h @@ -7,7 +7,6 @@ #pragma once #endif -#include "yaml-cpp/dll.h" #include <memory> namespace YAML { @@ -18,11 +17,11 @@ class node_data; class memory; class memory_holder; -typedef std::shared_ptr<node> shared_node; -typedef std::shared_ptr<node_ref> shared_node_ref; -typedef std::shared_ptr<node_data> shared_node_data; -typedef std::shared_ptr<memory_holder> shared_memory_holder; -typedef std::shared_ptr<memory> shared_memory; +using shared_node = std::shared_ptr<node>; +using shared_node_ref = std::shared_ptr<node_ref>; +using shared_node_data = std::shared_ptr<node_data>; +using shared_memory_holder = std::shared_ptr<memory_holder>; +using shared_memory = std::shared_ptr<memory>; } } diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/noexcept.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/noexcept.h new file mode 100644 index 00000000000..6aac63516f3 --- /dev/null +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/noexcept.h @@ -0,0 +1,18 @@ +#ifndef NOEXCEPT_H_768872DA_476C_11EA_88B8_90B11C0C0FF8 +#define NOEXCEPT_H_768872DA_476C_11EA_88B8_90B11C0C0FF8 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +// This is here for compatibility with older versions of Visual Studio +// which don't support noexcept. +#if defined(_MSC_VER) && _MSC_VER < 1900 + #define YAML_CPP_NOEXCEPT _NOEXCEPT +#else + #define YAML_CPP_NOEXCEPT noexcept +#endif + +#endif diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/noncopyable.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/noncopyable.h deleted file mode 100644 index a261040739b..00000000000 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/noncopyable.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef NONCOPYABLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 -#define NONCOPYABLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 - -#if defined(_MSC_VER) || \ - (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ - (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 -#pragma once -#endif - -#include "yaml-cpp/dll.h" - -namespace YAML { -// this is basically boost::noncopyable -class YAML_CPP_API noncopyable { - protected: - noncopyable() {} - ~noncopyable() {} - - private: - noncopyable(const noncopyable&); - const noncopyable& operator=(const noncopyable&); -}; -} - -#endif // NONCOPYABLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/ostream_wrapper.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/ostream_wrapper.h index 09d45f39b78..cf89741d093 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/ostream_wrapper.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/ostream_wrapper.h @@ -17,6 +17,10 @@ class YAML_CPP_API ostream_wrapper { public: ostream_wrapper(); explicit ostream_wrapper(std::ostream& stream); + ostream_wrapper(const ostream_wrapper&) = delete; + ostream_wrapper(ostream_wrapper&&) = delete; + ostream_wrapper& operator=(const ostream_wrapper&) = delete; + ostream_wrapper& operator=(ostream_wrapper&&) = delete; ~ostream_wrapper(); void write(const std::string& str); @@ -26,7 +30,7 @@ class YAML_CPP_API ostream_wrapper { const char* str() const { if (m_pStream) { - return 0; + return nullptr; } else { m_buffer[m_pos] = '\0'; return &m_buffer[0]; @@ -52,7 +56,7 @@ class YAML_CPP_API ostream_wrapper { template <std::size_t N> inline ostream_wrapper& operator<<(ostream_wrapper& stream, - const char(&str)[N]) { + const char (&str)[N]) { stream.write(str, N - 1); return stream; } @@ -67,6 +71,6 @@ inline ostream_wrapper& operator<<(ostream_wrapper& stream, char ch) { stream.write(&ch, 1); return stream; } -} +} // namespace YAML #endif // OSTREAM_WRAPPER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/parser.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/parser.h index ceac22d0268..2f403c35048 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/parser.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/parser.h @@ -11,7 +11,6 @@ #include <memory> #include "yaml-cpp/dll.h" -#include "yaml-cpp/noncopyable.h" namespace YAML { class EventHandler; @@ -24,11 +23,16 @@ struct Token; * A parser turns a stream of bytes into one stream of "events" per YAML * document in the input stream. */ -class YAML_CPP_API Parser : private noncopyable { +class YAML_CPP_API Parser { public: /** Constructs an empty parser (with no input. */ Parser(); + Parser(const Parser&) = delete; + Parser(Parser&&) = delete; + Parser& operator=(const Parser&) = delete; + Parser& operator=(Parser&&) = delete; + /** * Constructs a parser from the given input stream. The input stream must * live as long as the parser. @@ -81,6 +85,6 @@ class YAML_CPP_API Parser : private noncopyable { std::unique_ptr<Scanner> m_pScanner; std::unique_ptr<Directives> m_pDirectives; }; -} +} // namespace YAML #endif // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/stlemitter.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/stlemitter.h index 06780c861f1..210a2f64e6a 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/stlemitter.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/stlemitter.h @@ -16,8 +16,8 @@ namespace YAML { template <typename Seq> inline Emitter& EmitSeq(Emitter& emitter, const Seq& seq) { emitter << BeginSeq; - for (typename Seq::const_iterator it = seq.begin(); it != seq.end(); ++it) - emitter << *it; + for (const auto& v : seq) + emitter << v; emitter << EndSeq; return emitter; } @@ -39,10 +39,9 @@ inline Emitter& operator<<(Emitter& emitter, const std::set<T>& v) { template <typename K, typename V> inline Emitter& operator<<(Emitter& emitter, const std::map<K, V>& m) { - typedef typename std::map<K, V> map; emitter << BeginMap; - for (typename map::const_iterator it = m.begin(); it != m.end(); ++it) - emitter << Key << it->first << Value << it->second; + for (const auto& v : m) + emitter << Key << v.first << Value << v.second; emitter << EndMap; return emitter; } diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/traits.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/traits.h index f33d0e1f637..ffe9999f191 100644 --- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/traits.h +++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/traits.h @@ -7,6 +7,11 @@ #pragma once #endif +#include <type_traits> +#include <utility> +#include <string> +#include <sstream> + namespace YAML { template <typename> struct is_numeric { @@ -79,7 +84,7 @@ struct is_numeric<long double> { template <bool, class T = void> struct enable_if_c { - typedef T type; + using type = T; }; template <class T> @@ -90,7 +95,7 @@ struct enable_if : public enable_if_c<Cond::value, T> {}; template <bool, class T = void> struct disable_if_c { - typedef T type; + using type = T; }; template <class T> @@ -100,4 +105,31 @@ template <class Cond, class T = void> struct disable_if : public disable_if_c<Cond::value, T> {}; } +template <typename S, typename T> +struct is_streamable { + template <typename StreamT, typename ValueT> + static auto test(int) + -> decltype(std::declval<StreamT&>() << std::declval<ValueT>(), std::true_type()); + + template <typename, typename> + static auto test(...) -> std::false_type; + + static const bool value = decltype(test<S, T>(0))::value; +}; + +template<typename Key, bool Streamable> +struct streamable_to_string { + static std::string impl(const Key& key) { + std::stringstream ss; + ss << key; + return ss.str(); + } +}; + +template<typename Key> +struct streamable_to_string<Key, false> { + static std::string impl(const Key&) { + return ""; + } +}; #endif // TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/patches/0001-yaml-cpp-Strip-unneeded-sources.patch b/src/libs/3rdparty/yaml-cpp/patches/0001-yaml-cpp-Strip-unneeded-sources.patch index 93bdc64f64f..218b9e1ef79 100644 --- a/src/libs/3rdparty/yaml-cpp/patches/0001-yaml-cpp-Strip-unneeded-sources.patch +++ b/src/libs/3rdparty/yaml-cpp/patches/0001-yaml-cpp-Strip-unneeded-sources.patch @@ -1,1667 +1,1556 @@ -From dd3d5fa32be556e54d2ee2247a06e1fc7e5c8026 Mon Sep 17 00:00:00 2001 -From: Nikolai Kosjar <nikolai.kosjar@qt.io> -Date: Thu, 22 Aug 2019 15:00:03 +0200 +From 484b421d0004ce37d7abd63bd0043819ad3a9d9f Mon Sep 17 00:00:00 2001 +From: Eike Ziller <eike.ziller@qt.io> +Date: Fri, 25 Aug 2023 13:00:39 +0200 Subject: [PATCH] yaml-cpp: Strip unneeded sources -Change-Id: I2f863b06c1cd42abadc64897cd6282c4a2c8a8e3 --- - src/libs/3rdparty/yaml-cpp/.codedocs | 50 - - src/libs/3rdparty/yaml-cpp/.gitignore | 1 - - src/libs/3rdparty/yaml-cpp/.travis.yml | 28 - - src/libs/3rdparty/yaml-cpp/CMakeLists.txt | 365 - - src/libs/3rdparty/yaml-cpp/CONTRIBUTING.md | 26 - - .../include/yaml-cpp/contrib/anchordict.h | 39 - - .../include/yaml-cpp/contrib/graphbuilder.h | 149 - - src/libs/3rdparty/yaml-cpp/install.txt | 24 - - .../yaml-cpp/src/contrib/graphbuilder.cpp | 17 - - .../src/contrib/graphbuilderadapter.cpp | 94 - - .../src/contrib/graphbuilderadapter.h | 79 - - .../3rdparty/yaml-cpp/test/CMakeLists.txt | 44 - - .../yaml-cpp/test/create-emitter-tests.py | 211 - - .../yaml-cpp/test/gtest-1.8.0/.gitignore | 2 - - .../yaml-cpp/test/gtest-1.8.0/.travis.yml | 46 - - .../yaml-cpp/test/gtest-1.8.0/CMakeLists.txt | 16 - - .../yaml-cpp/test/gtest-1.8.0/README.md | 142 - - .../yaml-cpp/test/gtest-1.8.0/appveyor.yml | 71 - - .../test/gtest-1.8.0/googlemock/CHANGES | 126 - - .../gtest-1.8.0/googlemock/CMakeLists.txt | 202 - - .../test/gtest-1.8.0/googlemock/CONTRIBUTORS | 40 - - .../test/gtest-1.8.0/googlemock/LICENSE | 28 - - .../test/gtest-1.8.0/googlemock/README.md | 333 - - .../gtest-1.8.0/googlemock/build-aux/.keep | 0 - .../test/gtest-1.8.0/googlemock/configure.ac | 146 - - .../gtest-1.8.0/googlemock/docs/CheatSheet.md | 562 - - .../gtest-1.8.0/googlemock/docs/CookBook.md | 3675 ------- - .../gtest-1.8.0/googlemock/docs/DesignDoc.md | 280 - - .../gtest-1.8.0/googlemock/docs/DevGuide.md | 132 - - .../googlemock/docs/Documentation.md | 12 - - .../gtest-1.8.0/googlemock/docs/ForDummies.md | 439 - - .../docs/FrequentlyAskedQuestions.md | 628 -- - .../googlemock/docs/KnownIssues.md | 19 - - .../googlemock/docs/v1_5/CheatSheet.md | 525 - - .../googlemock/docs/v1_5/CookBook.md | 3250 ------ - .../googlemock/docs/v1_5/Documentation.md | 11 - - .../googlemock/docs/v1_5/ForDummies.md | 439 - - .../docs/v1_5/FrequentlyAskedQuestions.md | 624 -- - .../googlemock/docs/v1_6/CheatSheet.md | 534 - - .../googlemock/docs/v1_6/CookBook.md | 3342 ------ - .../googlemock/docs/v1_6/Documentation.md | 12 - - .../googlemock/docs/v1_6/ForDummies.md | 439 - - .../docs/v1_6/FrequentlyAskedQuestions.md | 628 -- - .../googlemock/docs/v1_7/CheatSheet.md | 556 - - .../googlemock/docs/v1_7/CookBook.md | 3432 ------ - .../googlemock/docs/v1_7/Documentation.md | 12 - - .../googlemock/docs/v1_7/ForDummies.md | 439 - - .../docs/v1_7/FrequentlyAskedQuestions.md | 628 -- - .../googlemock/include/gmock/gmock-actions.h | 1205 -- - .../include/gmock/gmock-cardinalities.h | 147 - - .../include/gmock/gmock-generated-actions.h | 2377 ---- - .../gmock/gmock-generated-actions.h.pump | 794 -- - .../gmock/gmock-generated-function-mockers.h | 1095 -- - .../gmock-generated-function-mockers.h.pump | 291 - - .../include/gmock/gmock-generated-matchers.h | 2179 ---- - .../gmock/gmock-generated-matchers.h.pump | 672 -- - .../gmock/gmock-generated-nice-strict.h | 397 - - .../gmock/gmock-generated-nice-strict.h.pump | 161 - - .../googlemock/include/gmock/gmock-matchers.h | 4399 -------- - .../include/gmock/gmock-more-actions.h | 246 - - .../include/gmock/gmock-more-matchers.h | 58 - - .../include/gmock/gmock-spec-builders.h | 1847 ---- - .../googlemock/include/gmock/gmock.h | 94 - - .../internal/custom/gmock-generated-actions.h | 8 - - .../custom/gmock-generated-actions.h.pump | 10 - - .../gmock/internal/custom/gmock-matchers.h | 39 - - .../gmock/internal/custom/gmock-port.h | 46 - - .../internal/gmock-generated-internal-utils.h | 279 - - .../gmock-generated-internal-utils.h.pump | 136 - - .../gmock/internal/gmock-internal-utils.h | 511 - - .../include/gmock/internal/gmock-port.h | 91 - - .../googlemock/msvc/2005/gmock_config.vsprops | 15 - - .../googlemock/msvc/2010/gmock_config.props | 19 - - .../googlemock/msvc/2015/gmock_config.props | 19 - - .../googlemock/scripts/fuse_gmock_files.py | 240 - + .codedocs | 50 - + .github/workflows/build.yml | 72 - + .gitignore | 3 - + BUILD.bazel | 21 - + CMakeLists.txt | 207 - + CONTRIBUTING.md | 26 - + SECURITY.md | 13 - + WORKSPACE | 10 - + cmake_uninstall.cmake.in | 21 - + docs/Breaking-Changes.md | 52 - + docs/How-To-Emit-YAML.md | 230 - + docs/How-To-Parse-A-Document-(Old-API).md | 265 - + docs/Strings.md | 18 - + docs/Tutorial.md | 201 - + docs/_config.yml | 1 - + docs/index.md | 1 - + include/yaml-cpp/contrib/anchordict.h | 40 - + include/yaml-cpp/contrib/graphbuilder.h | 149 - + install.txt | 24 - + src/contrib/graphbuilder.cpp | 16 - + src/contrib/graphbuilderadapter.cpp | 94 - + src/contrib/graphbuilderadapter.h | 86 - + src/contrib/yaml-cpp.natvis | 32 - + src/contrib/yaml-cpp.natvis.md | 9 - + test/BUILD.bazel | 14 - + test/CMakeLists.txt | 56 - + test/binary_test.cpp | 14 - + test/create-emitter-tests.py | 223 - + test/gtest-1.11.0/.clang-format | 4 - + .../.github/ISSUE_TEMPLATE/00-bug_report.md | 43 - + .../ISSUE_TEMPLATE/10-feature_request.md | 24 - + .../.github/ISSUE_TEMPLATE/config.yml | 1 - + test/gtest-1.11.0/.gitignore | 84 - + test/gtest-1.11.0/BUILD.bazel | 190 - + test/gtest-1.11.0/CMakeLists.txt | 32 - + test/gtest-1.11.0/CONTRIBUTING.md | 130 - + test/gtest-1.11.0/CONTRIBUTORS | 63 - + test/gtest-1.11.0/LICENSE | 28 - + test/gtest-1.11.0/README.md | 140 - + test/gtest-1.11.0/WORKSPACE | 24 - + test/gtest-1.11.0/ci/linux-presubmit.sh | 126 - + test/gtest-1.11.0/ci/macos-presubmit.sh | 73 - + test/gtest-1.11.0/docs/_config.yml | 1 - + test/gtest-1.11.0/docs/_data/navigation.yml | 43 - + test/gtest-1.11.0/docs/_layouts/default.html | 58 - + test/gtest-1.11.0/docs/_sass/main.scss | 200 - + test/gtest-1.11.0/docs/advanced.md | 2318 ---- + test/gtest-1.11.0/docs/assets/css/style.scss | 5 - + .../docs/community_created_documentation.md | 7 - + test/gtest-1.11.0/docs/faq.md | 693 -- + test/gtest-1.11.0/docs/gmock_cheat_sheet.md | 241 - + test/gtest-1.11.0/docs/gmock_cook_book.md | 4301 ------- + test/gtest-1.11.0/docs/gmock_faq.md | 390 - + test/gtest-1.11.0/docs/gmock_for_dummies.md | 700 -- + test/gtest-1.11.0/docs/index.md | 22 - + test/gtest-1.11.0/docs/pkgconfig.md | 148 - + test/gtest-1.11.0/docs/platforms.md | 35 - + test/gtest-1.11.0/docs/primer.md | 482 - + test/gtest-1.11.0/docs/quickstart-bazel.md | 161 - + test/gtest-1.11.0/docs/quickstart-cmake.md | 156 - + test/gtest-1.11.0/docs/reference/actions.md | 115 - + .../gtest-1.11.0/docs/reference/assertions.md | 633 -- + test/gtest-1.11.0/docs/reference/matchers.md | 283 - + test/gtest-1.11.0/docs/reference/mocking.md | 587 - + test/gtest-1.11.0/docs/reference/testing.md | 1431 --- + test/gtest-1.11.0/docs/samples.md | 22 - + test/gtest-1.11.0/googlemock/CMakeLists.txt | 218 - + test/gtest-1.11.0/googlemock/README.md | 44 - + .../gtest-1.11.0/googlemock/cmake/gmock.pc.in | 10 - + .../googlemock/cmake/gmock_main.pc.in | 10 - + test/gtest-1.11.0/googlemock/docs/README.md | 4 - + .../googlemock/include/gmock/gmock-actions.h | 1687 --- + .../include/gmock/gmock-cardinalities.h | 157 - + .../include/gmock/gmock-function-mocker.h | 479 - + .../googlemock/include/gmock/gmock-matchers.h | 5392 --------- + .../include/gmock/gmock-more-actions.h | 573 - + .../include/gmock/gmock-more-matchers.h | 92 - + .../include/gmock/gmock-nice-strict.h | 261 - + .../include/gmock/gmock-spec-builders.h | 2038 ---- + .../googlemock/include/gmock/gmock.h | 98 - + .../include/gmock/internal/custom/README.md | 16 - + .../internal/custom/gmock-generated-actions.h | 6 - + .../gmock/internal/custom/gmock-matchers.h | 36 - + .../gmock/internal/custom/gmock-port.h | 39 - + .../gmock/internal/gmock-internal-utils.h | 459 - + .../include/gmock/internal/gmock-port.h | 87 - + .../include/gmock/internal/gmock-pp.h | 279 - + .../gtest-1.11.0/googlemock/scripts/README.md | 5 - + .../googlemock/scripts/fuse_gmock_files.py | 256 - .../googlemock/scripts/generator/LICENSE | 203 - - .../googlemock/scripts/generator/README | 35 - + .../googlemock/scripts/generator/README | 34 - .../scripts/generator/README.cppclean | 115 - .../scripts/generator/cpp/__init__.py | 0 - .../googlemock/scripts/generator/cpp/ast.py | 1733 --- - .../scripts/generator/cpp/gmock_class.py | 227 - - .../scripts/generator/cpp/gmock_class_test.py | 448 - - .../scripts/generator/cpp/keywords.py | 59 - - .../scripts/generator/cpp/tokenize.py | 287 - - .../googlemock/scripts/generator/cpp/utils.py | 41 - - .../googlemock/scripts/generator/gmock_gen.py | 31 - - .../googlemock/scripts/gmock-config.in | 303 - - .../googlemock/scripts/gmock_doctor.py | 640 -- - .../gtest-1.8.0/googlemock/scripts/upload.py | 1387 --- - .../googlemock/scripts/upload_gmock.py | 78 - - .../gtest-1.8.0/googlemock/src/gmock-all.cc | 47 - - .../googlemock/src/gmock-cardinalities.cc | 156 - - .../googlemock/src/gmock-internal-utils.cc | 174 - - .../googlemock/src/gmock-matchers.cc | 498 - - .../googlemock/src/gmock-spec-builders.cc | 823 -- - .../test/gtest-1.8.0/googlemock/src/gmock.cc | 183 - - .../gtest-1.8.0/googlemock/src/gmock_main.cc | 54 - - .../googlemock/test/gmock-actions_test.cc | 1411 --- - .../test/gmock-cardinalities_test.cc | 428 - - .../test/gmock-generated-actions_test.cc | 1228 --- - .../gmock-generated-function-mockers_test.cc | 622 -- - .../gmock-generated-internal-utils_test.cc | 127 - - .../test/gmock-generated-matchers_test.cc | 1286 --- - .../test/gmock-internal-utils_test.cc | 699 -- - .../googlemock/test/gmock-matchers_test.cc | 5652 ---------- - .../test/gmock-more-actions_test.cc | 708 -- - .../googlemock/test/gmock-nice-strict_test.cc | 424 - - .../googlemock/test/gmock-port_test.cc | 43 - - .../test/gmock-spec-builders_test.cc | 2644 ----- - .../googlemock/test/gmock_all_test.cc | 51 - - .../googlemock/test/gmock_ex_test.cc | 81 - - .../googlemock/test/gmock_leak_test.py | 108 - - .../googlemock/test/gmock_leak_test_.cc | 100 - - .../googlemock/test/gmock_link2_test.cc | 40 - - .../googlemock/test/gmock_link_test.cc | 40 - - .../googlemock/test/gmock_link_test.h | 669 -- - .../googlemock/test/gmock_output_test.py | 180 - - .../googlemock/test/gmock_output_test_.cc | 291 - - .../test/gmock_output_test_golden.txt | 310 - - .../googlemock/test/gmock_stress_test.cc | 322 - - .../gtest-1.8.0/googlemock/test/gmock_test.cc | 220 - - .../googlemock/test/gmock_test_utils.py | 112 - - .../test/gtest-1.8.0/googletest/.gitignore | 2 - - .../test/gtest-1.8.0/googletest/CHANGES | 157 - - .../gtest-1.8.0/googletest/CMakeLists.txt | 286 - - .../test/gtest-1.8.0/googletest/CONTRIBUTORS | 37 - - .../test/gtest-1.8.0/googletest/LICENSE | 28 - - .../test/gtest-1.8.0/googletest/README.md | 280 - - .../gtest-1.8.0/googletest/build-aux/.keep | 0 - .../googletest/cmake/internal_utils.cmake | 254 - - .../googletest/codegear/gtest.cbproj | 138 - - .../googletest/codegear/gtest.groupproj | 54 - - .../googletest/codegear/gtest_all.cc | 38 - - .../googletest/codegear/gtest_link.cc | 40 - - .../googletest/codegear/gtest_main.cbproj | 82 - - .../googletest/codegear/gtest_unittest.cbproj | 88 - - .../test/gtest-1.8.0/googletest/configure.ac | 68 - - .../googletest/docs/AdvancedGuide.md | 2182 ---- - .../gtest-1.8.0/googletest/docs/DevGuide.md | 126 - - .../googletest/docs/Documentation.md | 14 - - .../test/gtest-1.8.0/googletest/docs/FAQ.md | 1087 -- - .../gtest-1.8.0/googletest/docs/Primer.md | 502 - - .../gtest-1.8.0/googletest/docs/PumpManual.md | 177 - - .../gtest-1.8.0/googletest/docs/Samples.md | 14 - - .../googletest/docs/V1_5_AdvancedGuide.md | 2096 ---- - .../googletest/docs/V1_5_Documentation.md | 12 - - .../gtest-1.8.0/googletest/docs/V1_5_FAQ.md | 886 -- - .../googletest/docs/V1_5_Primer.md | 497 - - .../googletest/docs/V1_5_PumpManual.md | 177 - - .../googletest/docs/V1_5_XcodeGuide.md | 93 - - .../googletest/docs/V1_6_AdvancedGuide.md | 2178 ---- - .../googletest/docs/V1_6_Documentation.md | 14 - - .../gtest-1.8.0/googletest/docs/V1_6_FAQ.md | 1038 -- - .../googletest/docs/V1_6_Primer.md | 501 - - .../googletest/docs/V1_6_PumpManual.md | 177 - - .../googletest/docs/V1_6_Samples.md | 14 - - .../googletest/docs/V1_6_XcodeGuide.md | 93 - - .../googletest/docs/V1_7_AdvancedGuide.md | 2181 ---- - .../googletest/docs/V1_7_Documentation.md | 14 - - .../gtest-1.8.0/googletest/docs/V1_7_FAQ.md | 1082 -- - .../googletest/docs/V1_7_Primer.md | 501 - - .../googletest/docs/V1_7_PumpManual.md | 177 - - .../googletest/docs/V1_7_Samples.md | 14 - - .../googletest/docs/V1_7_XcodeGuide.md | 93 - - .../gtest-1.8.0/googletest/docs/XcodeGuide.md | 93 - - .../include/gtest/gtest-death-test.h | 294 - - .../googletest/include/gtest/gtest-message.h | 250 - - .../include/gtest/gtest-param-test.h | 1444 --- - .../include/gtest/gtest-param-test.h.pump | 510 - - .../googletest/include/gtest/gtest-printers.h | 993 -- - .../googletest/include/gtest/gtest-spi.h | 232 - - .../include/gtest/gtest-test-part.h | 179 - - .../include/gtest/gtest-typed-test.h | 263 - - .../googletest/include/gtest/gtest.h | 2236 ---- - .../include/gtest/gtest_pred_impl.h | 358 - - .../googletest/include/gtest/gtest_prod.h | 58 - - .../gtest/internal/custom/gtest-port.h | 69 - + .../googlemock/scripts/generator/cpp/ast.py | 1773 --- + .../scripts/generator/cpp/gmock_class.py | 247 - + .../scripts/generator/cpp/gmock_class_test.py | 570 - + .../scripts/generator/cpp/keywords.py | 56 - + .../scripts/generator/cpp/tokenize.py | 284 - + .../googlemock/scripts/generator/cpp/utils.py | 37 - + .../googlemock/scripts/generator/gmock_gen.py | 30 - + test/gtest-1.11.0/googlemock/src/gmock-all.cc | 46 - + .../googlemock/src/gmock-cardinalities.cc | 155 - + .../googlemock/src/gmock-internal-utils.cc | 200 - + .../googlemock/src/gmock-matchers.cc | 459 - + .../googlemock/src/gmock-spec-builders.cc | 908 -- + test/gtest-1.11.0/googlemock/src/gmock.cc | 213 - + .../gtest-1.11.0/googlemock/src/gmock_main.cc | 72 - + test/gtest-1.11.0/googlemock/test/BUILD.bazel | 118 - + .../googlemock/test/gmock-actions_test.cc | 1583 --- + .../test/gmock-cardinalities_test.cc | 429 - + .../test/gmock-function-mocker_test.cc | 986 -- + .../test/gmock-internal-utils_test.cc | 720 -- + .../googlemock/test/gmock-matchers_test.cc | 8562 -------------- + .../test/gmock-more-actions_test.cc | 1547 --- + .../googlemock/test/gmock-nice-strict_test.cc | 539 - + .../googlemock/test/gmock-port_test.cc | 42 - + .../googlemock/test/gmock-pp-string_test.cc | 206 - + .../googlemock/test/gmock-pp_test.cc | 83 - + .../test/gmock-spec-builders_test.cc | 2775 ----- + .../googlemock/test/gmock_all_test.cc | 46 - + .../googlemock/test/gmock_ex_test.cc | 80 - + .../googlemock/test/gmock_leak_test.py | 104 - + .../googlemock/test/gmock_leak_test_.cc | 99 - + .../googlemock/test/gmock_link2_test.cc | 39 - + .../googlemock/test/gmock_link_test.cc | 39 - + .../googlemock/test/gmock_link_test.h | 690 -- + .../googlemock/test/gmock_output_test.py | 183 - + .../googlemock/test/gmock_output_test_.cc | 309 - + .../test/gmock_output_test_golden.txt | 317 - + .../googlemock/test/gmock_stress_test.cc | 240 - + .../googlemock/test/gmock_test.cc | 181 - + .../googlemock/test/gmock_test_utils.py | 108 - + test/gtest-1.11.0/googletest/CMakeLists.txt | 323 - + test/gtest-1.11.0/googletest/README.md | 215 - + .../googletest/cmake/Config.cmake.in | 9 - + .../gtest-1.11.0/googletest/cmake/gtest.pc.in | 9 - + .../googletest/cmake/gtest_main.pc.in | 10 - + .../googletest/cmake/internal_utils.cmake | 344 - + .../googletest/cmake/libgtest.la.in | 21 - + test/gtest-1.11.0/googletest/docs/README.md | 4 - + .../include/gtest/gtest-death-test.h | 346 - + .../googletest/include/gtest/gtest-matchers.h | 930 -- + .../googletest/include/gtest/gtest-message.h | 219 - + .../include/gtest/gtest-param-test.h | 507 - + .../googletest/include/gtest/gtest-printers.h | 1029 -- + .../googletest/include/gtest/gtest-spi.h | 238 - + .../include/gtest/gtest-test-part.h | 184 - + .../include/gtest/gtest-typed-test.h | 329 - + .../googletest/include/gtest/gtest.h | 2495 ----- + .../include/gtest/gtest_pred_impl.h | 359 - + .../googletest/include/gtest/gtest_prod.h | 61 - + .../include/gtest/internal/custom/README.md | 56 - + .../gtest/internal/custom/gtest-port.h | 37 - .../gtest/internal/custom/gtest-printers.h | 42 - - .../include/gtest/internal/custom/gtest.h | 41 - - .../internal/gtest-death-test-internal.h | 319 - - .../include/gtest/internal/gtest-filepath.h | 206 - - .../include/gtest/internal/gtest-internal.h | 1238 --- - .../include/gtest/internal/gtest-linked_ptr.h | 243 - - .../internal/gtest-param-util-generated.h | 5146 --------- - .../gtest-param-util-generated.h.pump | 286 - - .../include/gtest/internal/gtest-param-util.h | 731 -- - .../include/gtest/internal/gtest-port-arch.h | 93 - - .../include/gtest/internal/gtest-port.h | 2554 ----- - .../include/gtest/internal/gtest-string.h | 167 - - .../include/gtest/internal/gtest-tuple.h | 1020 -- - .../include/gtest/internal/gtest-tuple.h.pump | 347 - - .../include/gtest/internal/gtest-type-util.h | 3331 ------ - .../gtest/internal/gtest-type-util.h.pump | 297 - - .../gtest-1.8.0/googletest/m4/acx_pthread.m4 | 363 - - .../test/gtest-1.8.0/googletest/m4/gtest.m4 | 74 - - .../googletest/samples/prime_tables.h | 123 - - .../gtest-1.8.0/googletest/samples/sample1.cc | 68 - - .../gtest-1.8.0/googletest/samples/sample1.h | 43 - - .../googletest/samples/sample10_unittest.cc | 144 - - .../googletest/samples/sample1_unittest.cc | 153 - - .../gtest-1.8.0/googletest/samples/sample2.cc | 56 - - .../gtest-1.8.0/googletest/samples/sample2.h | 85 - - .../googletest/samples/sample2_unittest.cc | 109 - + .../include/gtest/internal/custom/gtest.h | 37 - + .../internal/gtest-death-test-internal.h | 304 - + .../include/gtest/internal/gtest-filepath.h | 211 - + .../include/gtest/internal/gtest-internal.h | 1560 --- + .../include/gtest/internal/gtest-param-util.h | 947 -- + .../include/gtest/internal/gtest-port-arch.h | 114 - + .../include/gtest/internal/gtest-port.h | 2389 ---- + .../include/gtest/internal/gtest-string.h | 175 - + .../include/gtest/internal/gtest-type-util.h | 183 - + .../googletest/samples/prime_tables.h | 126 - + .../googletest/samples/sample1.cc | 66 - + .../gtest-1.11.0/googletest/samples/sample1.h | 41 - + .../googletest/samples/sample10_unittest.cc | 139 - + .../googletest/samples/sample1_unittest.cc | 151 - + .../googletest/samples/sample2.cc | 54 - + .../gtest-1.11.0/googletest/samples/sample2.h | 80 - + .../googletest/samples/sample2_unittest.cc | 107 - .../googletest/samples/sample3-inl.h | 172 - - .../googletest/samples/sample3_unittest.cc | 151 - - .../gtest-1.8.0/googletest/samples/sample4.cc | 46 - - .../gtest-1.8.0/googletest/samples/sample4.h | 53 - - .../googletest/samples/sample4_unittest.cc | 45 - - .../googletest/samples/sample5_unittest.cc | 199 - - .../googletest/samples/sample6_unittest.cc | 224 - - .../googletest/samples/sample7_unittest.cc | 130 - - .../googletest/samples/sample8_unittest.cc | 173 - - .../googletest/samples/sample9_unittest.cc | 160 - - .../gtest-1.8.0/googletest/scripts/common.py | 83 - + .../googletest/samples/sample3_unittest.cc | 149 - + .../googletest/samples/sample4.cc | 54 - + .../gtest-1.11.0/googletest/samples/sample4.h | 53 - + .../googletest/samples/sample4_unittest.cc | 53 - + .../googletest/samples/sample5_unittest.cc | 196 - + .../googletest/samples/sample6_unittest.cc | 217 - + .../googletest/samples/sample7_unittest.cc | 117 - + .../googletest/samples/sample8_unittest.cc | 154 - + .../googletest/samples/sample9_unittest.cc | 156 - + .../gtest-1.11.0/googletest/scripts/README.md | 5 - + .../gtest-1.11.0/googletest/scripts/common.py | 83 - .../googletest/scripts/fuse_gtest_files.py | 253 - - .../googletest/scripts/gen_gtest_pred_impl.py | 730 -- + .../googletest/scripts/gen_gtest_pred_impl.py | 733 -- .../googletest/scripts/gtest-config.in | 274 - - .../gtest-1.8.0/googletest/scripts/pump.py | 855 -- .../googletest/scripts/release_docs.py | 158 - - .../gtest-1.8.0/googletest/scripts/upload.py | 1387 --- + .../googletest/scripts/run_with_path.py | 32 - + .../gtest-1.11.0/googletest/scripts/upload.py | 1402 --- .../googletest/scripts/upload_gtest.py | 78 - - .../gtest-1.8.0/googletest/src/gtest-all.cc | 48 - - .../googletest/src/gtest-death-test.cc | 1342 --- - .../googletest/src/gtest-filepath.cc | 387 - - .../googletest/src/gtest-internal-inl.h | 1183 -- - .../gtest-1.8.0/googletest/src/gtest-port.cc | 1259 --- - .../googletest/src/gtest-printers.cc | 373 - - .../googletest/src/gtest-test-part.cc | 110 - - .../googletest/src/gtest-typed-test.cc | 118 - - .../test/gtest-1.8.0/googletest/src/gtest.cc | 5388 --------- - .../gtest-1.8.0/googletest/src/gtest_main.cc | 38 - - .../test/gtest-death-test_ex_test.cc | 93 - - .../googletest/test/gtest-death-test_test.cc | 1427 --- - .../googletest/test/gtest-filepath_test.cc | 662 -- - .../googletest/test/gtest-linked_ptr_test.cc | 154 - - .../googletest/test/gtest-listener_test.cc | 311 - - .../googletest/test/gtest-message_test.cc | 159 - - .../googletest/test/gtest-options_test.cc | 215 - - .../googletest/test/gtest-param-test2_test.cc | 65 - - .../googletest/test/gtest-param-test_test.cc | 1055 -- - .../googletest/test/gtest-param-test_test.h | 57 - - .../googletest/test/gtest-port_test.cc | 1304 --- - .../googletest/test/gtest-printers_test.cc | 1635 --- - .../googletest/test/gtest-test-part_test.cc | 208 - - .../googletest/test/gtest-tuple_test.cc | 320 - - .../googletest/test/gtest-typed-test2_test.cc | 45 - - .../googletest/test/gtest-typed-test_test.cc | 380 - - .../googletest/test/gtest-typed-test_test.h | 66 - - .../test/gtest-unittest-api_test.cc | 341 - - .../googletest/test/gtest_all_test.cc | 47 - - .../test/gtest_break_on_failure_unittest.py | 212 - - .../test/gtest_break_on_failure_unittest_.cc | 88 - - .../test/gtest_catch_exceptions_test.py | 237 - - .../test/gtest_catch_exceptions_test_.cc | 311 - - .../googletest/test/gtest_color_test.py | 130 - - .../googletest/test/gtest_color_test_.cc | 71 - - .../googletest/test/gtest_env_var_test.py | 117 - - .../googletest/test/gtest_env_var_test_.cc | 126 - - .../googletest/test/gtest_environment_test.cc | 192 - - .../googletest/test/gtest_filter_unittest.py | 636 -- - .../googletest/test/gtest_filter_unittest_.cc | 140 - + test/gtest-1.11.0/googletest/src/gtest-all.cc | 48 - + .../googletest/src/gtest-death-test.cc | 1644 --- + .../googletest/src/gtest-filepath.cc | 369 - + .../googletest/src/gtest-internal-inl.h | 1221 -- + .../googletest/src/gtest-matchers.cc | 97 - + .../gtest-1.11.0/googletest/src/gtest-port.cc | 1433 --- + .../googletest/src/gtest-printers.cc | 533 - + .../googletest/src/gtest-test-part.cc | 108 - + .../googletest/src/gtest-typed-test.cc | 107 - + test/gtest-1.11.0/googletest/src/gtest.cc | 6746 ----------- + .../gtest-1.11.0/googletest/src/gtest_main.cc | 54 - + test/gtest-1.11.0/googletest/test/BUILD.bazel | 590 - + .../googletest-break-on-failure-unittest.py | 208 - + .../googletest-break-on-failure-unittest_.cc | 86 - + .../test/googletest-catch-exceptions-test.py | 236 - + .../test/googletest-catch-exceptions-test_.cc | 293 - + .../googletest/test/googletest-color-test.py | 127 - + .../googletest/test/googletest-color-test_.cc | 62 - + .../test/googletest-death-test-test.cc | 1542 --- + .../test/googletest-death-test_ex_test.cc | 92 - + .../test/googletest-env-var-test.py | 120 - + .../test/googletest-env-var-test_.cc | 132 - + .../test/googletest-failfast-unittest.py | 410 - + .../test/googletest-failfast-unittest_.cc | 167 - + .../test/googletest-filepath-test.cc | 649 -- + .../test/googletest-filter-unittest.py | 639 -- + .../test/googletest-filter-unittest_.cc | 137 - + .../googletest-global-environment-unittest.py | 72 - + ...googletest-global-environment-unittest_.cc | 58 - + .../test/googletest-json-outfiles-test.py | 191 - + .../test/googletest-json-output-unittest.py | 848 -- + .../test/googletest-list-tests-unittest.py | 205 - + .../test/googletest-list-tests-unittest_.cc | 156 - + .../test/googletest-listener-test.cc | 518 - + .../test/googletest-message-test.cc | 158 - + .../test/googletest-options-test.cc | 219 - + .../googletest-output-test-golden-lin.txt | 1180 -- + .../googletest/test/googletest-output-test.py | 346 - + .../test/googletest-output-test_.cc | 1108 -- + ...oogletest-param-test-invalid-name1-test.py | 63 - + ...ogletest-param-test-invalid-name1-test_.cc | 50 - + ...oogletest-param-test-invalid-name2-test.py | 62 - + ...ogletest-param-test-invalid-name2-test_.cc | 55 - + .../test/googletest-param-test-test.cc | 1119 -- + .../test/googletest-param-test-test.h | 51 - + .../test/googletest-param-test2-test.cc | 61 - + .../googletest/test/googletest-port-test.cc | 1276 --- + .../test/googletest-printers-test.cc | 1962 ---- + .../test/googletest-setuptestsuite-test.py | 54 - + .../test/googletest-setuptestsuite-test_.cc | 49 - + .../test/googletest-shuffle-test.py | 323 - + .../test/googletest-shuffle-test_.cc | 101 - + .../test/googletest-test-part-test.cc | 230 - + .../test/googletest-throw-on-failure-test.py | 168 - + .../test/googletest-throw-on-failure-test_.cc | 71 - + .../test/googletest-uninitialized-test.py | 67 - + .../test/googletest-uninitialized-test_.cc | 42 - + .../googletest/test/gtest-typed-test2_test.cc | 40 - + .../googletest/test/gtest-typed-test_test.cc | 437 - + .../googletest/test/gtest-typed-test_test.h | 60 - + .../test/gtest-unittest-api_test.cc | 328 - + .../googletest/test/gtest_all_test.cc | 46 - + .../test/gtest_assert_by_exception_test.cc | 116 - + .../googletest/test/gtest_environment_test.cc | 188 - .../googletest/test/gtest_help_test.py | 172 - - .../googletest/test/gtest_help_test_.cc | 46 - - .../test/gtest_list_tests_unittest.py | 207 - - .../test/gtest_list_tests_unittest_.cc | 157 - - .../googletest/test/gtest_main_unittest.cc | 45 - - .../googletest/test/gtest_no_test_unittest.cc | 56 - - .../googletest/test/gtest_output_test.py | 340 - - .../googletest/test/gtest_output_test_.cc | 1062 -- - .../test/gtest_output_test_golden_lin.txt | 743 -- - .../test/gtest_pred_impl_unittest.cc | 2427 ---- - .../test/gtest_premature_exit_test.cc | 127 - - .../googletest/test/gtest_prod_test.cc | 57 - - .../googletest/test/gtest_repeat_test.cc | 253 - - .../googletest/test/gtest_shuffle_test.py | 325 - - .../googletest/test/gtest_shuffle_test_.cc | 103 - - .../googletest/test/gtest_sole_header_test.cc | 57 - - .../googletest/test/gtest_stress_test.cc | 256 - - .../googletest/test/gtest_test_utils.py | 320 - - .../test/gtest_throw_on_failure_ex_test.cc | 92 - - .../test/gtest_throw_on_failure_test.py | 171 - - .../test/gtest_throw_on_failure_test_.cc | 72 - - .../test/gtest_uninitialized_test.py | 70 - - .../test/gtest_uninitialized_test_.cc | 43 - - .../googletest/test/gtest_unittest.cc | 7706 ------------- - .../test/gtest_xml_outfile1_test_.cc | 49 - - .../test/gtest_xml_outfile2_test_.cc | 49 - - .../test/gtest_xml_outfiles_test.py | 132 - - .../test/gtest_xml_output_unittest.py | 308 - - .../test/gtest_xml_output_unittest_.cc | 181 - - .../googletest/test/gtest_xml_test_utils.py | 194 - - .../gtest-1.8.0/googletest/test/production.cc | 36 - - .../gtest-1.8.0/googletest/test/production.h | 55 - - .../xcode/Config/DebugProject.xcconfig | 30 - - .../xcode/Config/FrameworkTarget.xcconfig | 17 - - .../googletest/xcode/Config/General.xcconfig | 41 - - .../xcode/Config/ReleaseProject.xcconfig | 32 - - .../xcode/Config/StaticLibraryTarget.xcconfig | 18 - - .../xcode/Config/TestTarget.xcconfig | 8 - - .../googletest/xcode/Resources/Info.plist | 30 - - .../xcode/Samples/FrameworkSample/Info.plist | 28 - - .../WidgetFramework.xcodeproj/project.pbxproj | 457 - - .../xcode/Samples/FrameworkSample/runtests.sh | 62 - - .../xcode/Samples/FrameworkSample/widget.cc | 63 - - .../xcode/Samples/FrameworkSample/widget.h | 59 - - .../Samples/FrameworkSample/widget_test.cc | 68 - - .../googletest/xcode/Scripts/runtests.sh | 65 - - .../xcode/Scripts/versiongenerate.py | 100 - - .../xcode/gtest.xcodeproj/project.pbxproj | 1135 -- - .../yaml-cpp/test/gtest-1.8.0/travis.sh | 15 - - .../3rdparty/yaml-cpp/test/handler_test.h | 32 - - .../test/integration/emitter_test.cpp | 1038 -- - .../test/integration/encoding_test.cpp | 182 - - .../test/integration/gen_emitter_test.cpp | 9759 ----------------- - .../test/integration/handler_spec_test.cpp | 1611 --- - .../test/integration/handler_test.cpp | 76 - - .../test/integration/load_node_test.cpp | 241 - - .../test/integration/node_spec_test.cpp | 1131 -- - src/libs/3rdparty/yaml-cpp/test/main.cpp | 6 - - .../yaml-cpp/test/mock_event_handler.h | 26 - - .../3rdparty/yaml-cpp/test/node/node_test.cpp | 517 - - .../yaml-cpp/test/ostream_wrapper_test.cpp | 66 - - .../3rdparty/yaml-cpp/test/regex_test.cpp | 177 - - .../3rdparty/yaml-cpp/test/specexamples.h | 846 -- - .../3rdparty/yaml-cpp/util/CMakeLists.txt | 14 - - src/libs/3rdparty/yaml-cpp/util/api.cpp | 137 - - src/libs/3rdparty/yaml-cpp/util/parse.cpp | 61 - - src/libs/3rdparty/yaml-cpp/util/read.cpp | 103 - - src/libs/3rdparty/yaml-cpp/util/sandbox.cpp | 36 - - .../yaml-cpp/yaml-cpp-config-version.cmake.in | 11 - - .../yaml-cpp/yaml-cpp-config.cmake.in | 14 - - 331 files changed, 167784 deletions(-) - delete mode 100644 src/libs/3rdparty/yaml-cpp/.codedocs - delete mode 100644 src/libs/3rdparty/yaml-cpp/.gitignore - delete mode 100644 src/libs/3rdparty/yaml-cpp/.travis.yml - delete mode 100644 src/libs/3rdparty/yaml-cpp/CMakeLists.txt - delete mode 100644 src/libs/3rdparty/yaml-cpp/CONTRIBUTING.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/include/yaml-cpp/contrib/anchordict.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/include/yaml-cpp/contrib/graphbuilder.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/install.txt - delete mode 100644 src/libs/3rdparty/yaml-cpp/src/contrib/graphbuilder.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/src/contrib/graphbuilderadapter.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/src/contrib/graphbuilderadapter.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/CMakeLists.txt - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/create-emitter-tests.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/.gitignore - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/.travis.yml - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/CMakeLists.txt - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/README.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/appveyor.yml - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/CHANGES - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/CMakeLists.txt - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/CONTRIBUTORS - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/LICENSE - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/README.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/build-aux/.keep - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/configure.ac - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/CheatSheet.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/CookBook.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/DesignDoc.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/DevGuide.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/Documentation.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/ForDummies.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/FrequentlyAskedQuestions.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/KnownIssues.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/CheatSheet.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/CookBook.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/Documentation.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/ForDummies.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/FrequentlyAskedQuestions.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/CheatSheet.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/CookBook.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/Documentation.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/ForDummies.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/FrequentlyAskedQuestions.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/CheatSheet.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/CookBook.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/Documentation.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/ForDummies.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/FrequentlyAskedQuestions.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-actions.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-cardinalities.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-actions.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-actions.h.pump - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-function-mockers.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-function-mockers.h.pump - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-matchers.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-matchers.h.pump - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-nice-strict.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-nice-strict.h.pump - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-matchers.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-more-actions.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-more-matchers.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/custom/gmock-generated-actions.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/custom/gmock-matchers.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/custom/gmock-port.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/gmock-generated-internal-utils.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/gmock-internal-utils.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/gmock-port.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/msvc/2005/gmock_config.vsprops - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/msvc/2010/gmock_config.props - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/msvc/2015/gmock_config.props - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/fuse_gmock_files.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/LICENSE - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/README - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/README.cppclean - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/__init__.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/ast.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/gmock_class.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/gmock_class_test.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/keywords.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/tokenize.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/utils.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/gmock_gen.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/gmock-config.in - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/gmock_doctor.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/upload.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/upload_gmock.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-all.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-cardinalities.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-internal-utils.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-matchers.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-spec-builders.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock_main.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-actions_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-cardinalities_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-generated-actions_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-generated-function-mockers_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-generated-internal-utils_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-generated-matchers_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-internal-utils_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-matchers_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-more-actions_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-nice-strict_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-port_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-spec-builders_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_all_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_ex_test.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_leak_test.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_leak_test_.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_link2_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_link_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_link_test.h - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_output_test.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_output_test_.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_output_test_golden.txt - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_stress_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_test.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_test_utils.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/.gitignore - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/CHANGES - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/CMakeLists.txt - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/CONTRIBUTORS - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/LICENSE - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/README.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/build-aux/.keep - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/cmake/internal_utils.cmake - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest.cbproj - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest.groupproj - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest_all.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest_link.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest_main.cbproj - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest_unittest.cbproj - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/configure.ac - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/AdvancedGuide.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/DevGuide.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/Documentation.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/FAQ.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/Primer.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/PumpManual.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/Samples.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_AdvancedGuide.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_Documentation.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_FAQ.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_Primer.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_PumpManual.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_XcodeGuide.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_AdvancedGuide.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_Documentation.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_FAQ.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_Primer.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_PumpManual.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_Samples.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_XcodeGuide.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_AdvancedGuide.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_Documentation.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_FAQ.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_Primer.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_PumpManual.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_Samples.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_XcodeGuide.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/XcodeGuide.md - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-death-test.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-message.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-param-test.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-param-test.h.pump - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-printers.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-spi.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-test-part.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-typed-test.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest_pred_impl.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest_prod.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/custom/gtest-port.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/custom/gtest-printers.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/custom/gtest.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-death-test-internal.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-filepath.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-internal.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-linked_ptr.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-param-util-generated.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-param-util-generated.h.pump - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-param-util.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-port-arch.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-port.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-string.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-tuple.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-tuple.h.pump - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-type-util.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-type-util.h.pump - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/m4/acx_pthread.m4 - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/m4/gtest.m4 - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/prime_tables.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample1.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample1.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample10_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample1_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample2.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample2.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample2_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample3-inl.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample3_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample4.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample4.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample4_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample5_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample6_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample7_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample8_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample9_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/common.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/fuse_gtest_files.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/gen_gtest_pred_impl.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/gtest-config.in - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/pump.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/release_docs.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/upload.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/upload_gtest.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-all.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-death-test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-filepath.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-internal-inl.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-port.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-printers.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-test-part.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-typed-test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest_main.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-death-test_ex_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-death-test_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-filepath_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-linked_ptr_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-listener_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-message_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-options_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-param-test2_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-param-test_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-param-test_test.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-port_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-printers_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-test-part_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-tuple_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-typed-test2_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-typed-test_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-typed-test_test.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-unittest-api_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_all_test.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_break_on_failure_unittest.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_break_on_failure_unittest_.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_catch_exceptions_test.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_catch_exceptions_test_.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_color_test.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_color_test_.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_env_var_test.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_env_var_test_.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_environment_test.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_filter_unittest.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_filter_unittest_.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_help_test.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_help_test_.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_list_tests_unittest.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_list_tests_unittest_.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_main_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_no_test_unittest.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_output_test.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_output_test_.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_output_test_golden_lin.txt - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_pred_impl_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_premature_exit_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_prod_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_repeat_test.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_shuffle_test.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_shuffle_test_.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_sole_header_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_stress_test.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_test_utils.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_throw_on_failure_ex_test.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_throw_on_failure_test.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_throw_on_failure_test_.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_uninitialized_test.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_uninitialized_test_.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_unittest.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_outfile1_test_.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_outfile2_test_.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_outfiles_test.py - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_output_unittest.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_output_unittest_.cc - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_test_utils.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/production.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/production.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/DebugProject.xcconfig - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/FrameworkTarget.xcconfig - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/General.xcconfig - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/ReleaseProject.xcconfig - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/StaticLibraryTarget.xcconfig - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/TestTarget.xcconfig - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Resources/Info.plist - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/Info.plist - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/runtests.sh - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/widget.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/widget.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/widget_test.cc - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Scripts/runtests.sh - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Scripts/versiongenerate.py - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/gtest.xcodeproj/project.pbxproj - delete mode 100755 src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/travis.sh - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/handler_test.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/integration/emitter_test.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/integration/encoding_test.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/integration/gen_emitter_test.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/integration/handler_spec_test.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/integration/handler_test.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/integration/load_node_test.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/integration/node_spec_test.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/main.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/mock_event_handler.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/node/node_test.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/ostream_wrapper_test.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/regex_test.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/test/specexamples.h - delete mode 100644 src/libs/3rdparty/yaml-cpp/util/CMakeLists.txt - delete mode 100644 src/libs/3rdparty/yaml-cpp/util/api.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/util/parse.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/util/read.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/util/sandbox.cpp - delete mode 100644 src/libs/3rdparty/yaml-cpp/yaml-cpp-config-version.cmake.in - delete mode 100644 src/libs/3rdparty/yaml-cpp/yaml-cpp-config.cmake.in + .../googletest/test/gtest_help_test_.cc | 45 - + .../googletest/test/gtest_json_test_utils.py | 60 - + .../test/gtest_list_output_unittest.py | 286 - + .../test/gtest_list_output_unittest_.cc | 77 - + .../googletest/test/gtest_main_unittest.cc | 44 - + .../googletest/test/gtest_no_test_unittest.cc | 54 - + .../test/gtest_pred_impl_unittest.cc | 2422 ---- + .../test/gtest_premature_exit_test.cc | 126 - + .../googletest/test/gtest_prod_test.cc | 56 - + .../googletest/test/gtest_repeat_test.cc | 233 - + .../test/gtest_skip_check_output_test.py | 59 - + ...test_skip_environment_check_output_test.py | 54 - + .../gtest_skip_in_environment_setup_test.cc | 49 - + .../googletest/test/gtest_skip_test.cc | 55 - + .../googletest/test/gtest_sole_header_test.cc | 56 - + .../googletest/test/gtest_stress_test.cc | 248 - + .../gtest_test_macro_stack_footprint_test.cc | 89 - + .../googletest/test/gtest_test_utils.py | 312 - + .../googletest/test/gtest_testbridge_test.py | 63 - + .../googletest/test/gtest_testbridge_test_.cc | 43 - + .../test/gtest_throw_on_failure_ex_test.cc | 90 - + .../googletest/test/gtest_unittest.cc | 7784 ------------- + .../test/gtest_xml_outfile1_test_.cc | 43 - + .../test/gtest_xml_outfile2_test_.cc | 43 - + .../test/gtest_xml_outfiles_test.py | 135 - + .../test/gtest_xml_output_unittest.py | 415 - + .../test/gtest_xml_output_unittest_.cc | 193 - + .../googletest/test/gtest_xml_test_utils.py | 197 - + .../googletest/test/production.cc | 35 - + .../gtest-1.11.0/googletest/test/production.h | 54 - + test/gtest-1.11.0/library.json | 62 - + test/handler_test.h | 32 - + test/integration/emitter_test.cpp | 1740 --- + test/integration/encoding_test.cpp | 182 - + test/integration/error_messages_test.cpp | 61 - + test/integration/gen_emitter_test.cpp | 9936 ----------------- + test/integration/handler_spec_test.cpp | 1686 --- + test/integration/handler_test.cpp | 76 - + test/integration/load_node_test.cpp | 364 - + test/integration/node_spec_test.cpp | 1136 -- + test/main.cpp | 6 - + test/mock_event_handler.h | 30 - + test/node/node_test.cpp | 853 -- + test/ostream_wrapper_test.cpp | 66 - + test/parser_test.cpp | 64 - + test/regex_test.cpp | 177 - + test/specexamples.h | 868 -- + util/CMakeLists.txt | 32 - + util/api.cpp | 137 - + util/parse.cpp | 46 - + util/read.cpp | 103 - + util/sandbox.cpp | 36 - + yaml-cpp-config.cmake.in | 22 - + yaml-cpp.pc.in | 11 - + 309 files changed, 133651 deletions(-) + delete mode 100644 .codedocs + delete mode 100644 .github/workflows/build.yml + delete mode 100644 .gitignore + delete mode 100644 BUILD.bazel + delete mode 100644 CMakeLists.txt + delete mode 100644 CONTRIBUTING.md + delete mode 100644 SECURITY.md + delete mode 100644 WORKSPACE + delete mode 100644 cmake_uninstall.cmake.in + delete mode 100644 docs/Breaking-Changes.md + delete mode 100644 docs/How-To-Emit-YAML.md + delete mode 100644 docs/How-To-Parse-A-Document-(Old-API).md + delete mode 100644 docs/Strings.md + delete mode 100644 docs/Tutorial.md + delete mode 100644 docs/_config.yml + delete mode 100644 docs/index.md + delete mode 100644 include/yaml-cpp/contrib/anchordict.h + delete mode 100644 include/yaml-cpp/contrib/graphbuilder.h + delete mode 100644 install.txt + delete mode 100644 src/contrib/graphbuilder.cpp + delete mode 100644 src/contrib/graphbuilderadapter.cpp + delete mode 100644 src/contrib/graphbuilderadapter.h + delete mode 100644 src/contrib/yaml-cpp.natvis + delete mode 100644 src/contrib/yaml-cpp.natvis.md + delete mode 100644 test/BUILD.bazel + delete mode 100644 test/CMakeLists.txt + delete mode 100644 test/binary_test.cpp + delete mode 100644 test/create-emitter-tests.py + delete mode 100644 test/gtest-1.11.0/.clang-format + delete mode 100644 test/gtest-1.11.0/.github/ISSUE_TEMPLATE/00-bug_report.md + delete mode 100644 test/gtest-1.11.0/.github/ISSUE_TEMPLATE/10-feature_request.md + delete mode 100644 test/gtest-1.11.0/.github/ISSUE_TEMPLATE/config.yml + delete mode 100644 test/gtest-1.11.0/.gitignore + delete mode 100644 test/gtest-1.11.0/BUILD.bazel + delete mode 100644 test/gtest-1.11.0/CMakeLists.txt + delete mode 100644 test/gtest-1.11.0/CONTRIBUTING.md + delete mode 100644 test/gtest-1.11.0/CONTRIBUTORS + delete mode 100644 test/gtest-1.11.0/LICENSE + delete mode 100644 test/gtest-1.11.0/README.md + delete mode 100644 test/gtest-1.11.0/WORKSPACE + delete mode 100644 test/gtest-1.11.0/ci/linux-presubmit.sh + delete mode 100644 test/gtest-1.11.0/ci/macos-presubmit.sh + delete mode 100644 test/gtest-1.11.0/docs/_config.yml + delete mode 100644 test/gtest-1.11.0/docs/_data/navigation.yml + delete mode 100644 test/gtest-1.11.0/docs/_layouts/default.html + delete mode 100644 test/gtest-1.11.0/docs/_sass/main.scss + delete mode 100644 test/gtest-1.11.0/docs/advanced.md + delete mode 100644 test/gtest-1.11.0/docs/assets/css/style.scss + delete mode 100644 test/gtest-1.11.0/docs/community_created_documentation.md + delete mode 100644 test/gtest-1.11.0/docs/faq.md + delete mode 100644 test/gtest-1.11.0/docs/gmock_cheat_sheet.md + delete mode 100644 test/gtest-1.11.0/docs/gmock_cook_book.md + delete mode 100644 test/gtest-1.11.0/docs/gmock_faq.md + delete mode 100644 test/gtest-1.11.0/docs/gmock_for_dummies.md + delete mode 100644 test/gtest-1.11.0/docs/index.md + delete mode 100644 test/gtest-1.11.0/docs/pkgconfig.md + delete mode 100644 test/gtest-1.11.0/docs/platforms.md + delete mode 100644 test/gtest-1.11.0/docs/primer.md + delete mode 100644 test/gtest-1.11.0/docs/quickstart-bazel.md + delete mode 100644 test/gtest-1.11.0/docs/quickstart-cmake.md + delete mode 100644 test/gtest-1.11.0/docs/reference/actions.md + delete mode 100644 test/gtest-1.11.0/docs/reference/assertions.md + delete mode 100644 test/gtest-1.11.0/docs/reference/matchers.md + delete mode 100644 test/gtest-1.11.0/docs/reference/mocking.md + delete mode 100644 test/gtest-1.11.0/docs/reference/testing.md + delete mode 100644 test/gtest-1.11.0/docs/samples.md + delete mode 100644 test/gtest-1.11.0/googlemock/CMakeLists.txt + delete mode 100644 test/gtest-1.11.0/googlemock/README.md + delete mode 100644 test/gtest-1.11.0/googlemock/cmake/gmock.pc.in + delete mode 100644 test/gtest-1.11.0/googlemock/cmake/gmock_main.pc.in + delete mode 100644 test/gtest-1.11.0/googlemock/docs/README.md + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/gmock-actions.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/gmock-cardinalities.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/gmock-function-mocker.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/gmock-matchers.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/gmock-more-actions.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/gmock-more-matchers.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/gmock-nice-strict.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/gmock-spec-builders.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/gmock.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/internal/custom/README.md + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/internal/custom/gmock-generated-actions.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/internal/custom/gmock-matchers.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/internal/custom/gmock-port.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/internal/gmock-internal-utils.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/internal/gmock-port.h + delete mode 100644 test/gtest-1.11.0/googlemock/include/gmock/internal/gmock-pp.h + delete mode 100644 test/gtest-1.11.0/googlemock/scripts/README.md + delete mode 100755 test/gtest-1.11.0/googlemock/scripts/fuse_gmock_files.py + delete mode 100644 test/gtest-1.11.0/googlemock/scripts/generator/LICENSE + delete mode 100644 test/gtest-1.11.0/googlemock/scripts/generator/README + delete mode 100644 test/gtest-1.11.0/googlemock/scripts/generator/README.cppclean + delete mode 100755 test/gtest-1.11.0/googlemock/scripts/generator/cpp/__init__.py + delete mode 100755 test/gtest-1.11.0/googlemock/scripts/generator/cpp/ast.py + delete mode 100755 test/gtest-1.11.0/googlemock/scripts/generator/cpp/gmock_class.py + delete mode 100755 test/gtest-1.11.0/googlemock/scripts/generator/cpp/gmock_class_test.py + delete mode 100755 test/gtest-1.11.0/googlemock/scripts/generator/cpp/keywords.py + delete mode 100755 test/gtest-1.11.0/googlemock/scripts/generator/cpp/tokenize.py + delete mode 100755 test/gtest-1.11.0/googlemock/scripts/generator/cpp/utils.py + delete mode 100755 test/gtest-1.11.0/googlemock/scripts/generator/gmock_gen.py + delete mode 100644 test/gtest-1.11.0/googlemock/src/gmock-all.cc + delete mode 100644 test/gtest-1.11.0/googlemock/src/gmock-cardinalities.cc + delete mode 100644 test/gtest-1.11.0/googlemock/src/gmock-internal-utils.cc + delete mode 100644 test/gtest-1.11.0/googlemock/src/gmock-matchers.cc + delete mode 100644 test/gtest-1.11.0/googlemock/src/gmock-spec-builders.cc + delete mode 100644 test/gtest-1.11.0/googlemock/src/gmock.cc + delete mode 100644 test/gtest-1.11.0/googlemock/src/gmock_main.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/BUILD.bazel + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock-actions_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock-cardinalities_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock-function-mocker_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock-internal-utils_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock-matchers_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock-more-actions_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock-nice-strict_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock-port_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock-pp-string_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock-pp_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock-spec-builders_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock_all_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock_ex_test.cc + delete mode 100755 test/gtest-1.11.0/googlemock/test/gmock_leak_test.py + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock_leak_test_.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock_link2_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock_link_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock_link_test.h + delete mode 100755 test/gtest-1.11.0/googlemock/test/gmock_output_test.py + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock_output_test_.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock_output_test_golden.txt + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock_stress_test.cc + delete mode 100644 test/gtest-1.11.0/googlemock/test/gmock_test.cc + delete mode 100755 test/gtest-1.11.0/googlemock/test/gmock_test_utils.py + delete mode 100644 test/gtest-1.11.0/googletest/CMakeLists.txt + delete mode 100644 test/gtest-1.11.0/googletest/README.md + delete mode 100644 test/gtest-1.11.0/googletest/cmake/Config.cmake.in + delete mode 100644 test/gtest-1.11.0/googletest/cmake/gtest.pc.in + delete mode 100644 test/gtest-1.11.0/googletest/cmake/gtest_main.pc.in + delete mode 100644 test/gtest-1.11.0/googletest/cmake/internal_utils.cmake + delete mode 100644 test/gtest-1.11.0/googletest/cmake/libgtest.la.in + delete mode 100644 test/gtest-1.11.0/googletest/docs/README.md + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/gtest-death-test.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/gtest-matchers.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/gtest-message.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/gtest-param-test.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/gtest-printers.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/gtest-spi.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/gtest-test-part.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/gtest-typed-test.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/gtest.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/gtest_pred_impl.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/gtest_prod.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/internal/custom/README.md + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/internal/custom/gtest-port.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/internal/custom/gtest-printers.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/internal/custom/gtest.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/internal/gtest-death-test-internal.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/internal/gtest-filepath.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/internal/gtest-internal.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/internal/gtest-param-util.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/internal/gtest-port-arch.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/internal/gtest-port.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/internal/gtest-string.h + delete mode 100644 test/gtest-1.11.0/googletest/include/gtest/internal/gtest-type-util.h + delete mode 100644 test/gtest-1.11.0/googletest/samples/prime_tables.h + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample1.cc + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample1.h + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample10_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample1_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample2.cc + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample2.h + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample2_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample3-inl.h + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample3_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample4.cc + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample4.h + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample4_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample5_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample6_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample7_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample8_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/samples/sample9_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/scripts/README.md + delete mode 100644 test/gtest-1.11.0/googletest/scripts/common.py + delete mode 100755 test/gtest-1.11.0/googletest/scripts/fuse_gtest_files.py + delete mode 100755 test/gtest-1.11.0/googletest/scripts/gen_gtest_pred_impl.py + delete mode 100755 test/gtest-1.11.0/googletest/scripts/gtest-config.in + delete mode 100755 test/gtest-1.11.0/googletest/scripts/release_docs.py + delete mode 100755 test/gtest-1.11.0/googletest/scripts/run_with_path.py + delete mode 100755 test/gtest-1.11.0/googletest/scripts/upload.py + delete mode 100755 test/gtest-1.11.0/googletest/scripts/upload_gtest.py + delete mode 100644 test/gtest-1.11.0/googletest/src/gtest-all.cc + delete mode 100644 test/gtest-1.11.0/googletest/src/gtest-death-test.cc + delete mode 100644 test/gtest-1.11.0/googletest/src/gtest-filepath.cc + delete mode 100644 test/gtest-1.11.0/googletest/src/gtest-internal-inl.h + delete mode 100644 test/gtest-1.11.0/googletest/src/gtest-matchers.cc + delete mode 100644 test/gtest-1.11.0/googletest/src/gtest-port.cc + delete mode 100644 test/gtest-1.11.0/googletest/src/gtest-printers.cc + delete mode 100644 test/gtest-1.11.0/googletest/src/gtest-test-part.cc + delete mode 100644 test/gtest-1.11.0/googletest/src/gtest-typed-test.cc + delete mode 100644 test/gtest-1.11.0/googletest/src/gtest.cc + delete mode 100644 test/gtest-1.11.0/googletest/src/gtest_main.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/BUILD.bazel + delete mode 100755 test/gtest-1.11.0/googletest/test/googletest-break-on-failure-unittest.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-break-on-failure-unittest_.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/googletest-catch-exceptions-test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-catch-exceptions-test_.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/googletest-color-test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-color-test_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-death-test-test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-death-test_ex_test.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/googletest-env-var-test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-env-var-test_.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/googletest-failfast-unittest.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-failfast-unittest_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-filepath-test.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/googletest-filter-unittest.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-filter-unittest_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-global-environment-unittest.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-global-environment-unittest_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-json-outfiles-test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-json-output-unittest.py + delete mode 100755 test/gtest-1.11.0/googletest/test/googletest-list-tests-unittest.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-list-tests-unittest_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-listener-test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-message-test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-options-test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-output-test-golden-lin.txt + delete mode 100755 test/gtest-1.11.0/googletest/test/googletest-output-test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-output-test_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name1-test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name1-test_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name2-test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name2-test_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-param-test-test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-param-test-test.h + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-param-test2-test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-port-test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-printers-test.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/googletest-setuptestsuite-test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-setuptestsuite-test_.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/googletest-shuffle-test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-shuffle-test_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-test-part-test.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/googletest-throw-on-failure-test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-throw-on-failure-test_.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/googletest-uninitialized-test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/googletest-uninitialized-test_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest-typed-test2_test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest-typed-test_test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest-typed-test_test.h + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest-unittest-api_test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_all_test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_assert_by_exception_test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_environment_test.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/gtest_help_test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_help_test_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_json_test_utils.py + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_list_output_unittest.py + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_list_output_unittest_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_main_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_no_test_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_pred_impl_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_premature_exit_test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_prod_test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_repeat_test.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/gtest_skip_check_output_test.py + delete mode 100755 test/gtest-1.11.0/googletest/test/gtest_skip_environment_check_output_test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_skip_in_environment_setup_test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_skip_test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_sole_header_test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_stress_test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_test_macro_stack_footprint_test.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/gtest_test_utils.py + delete mode 100755 test/gtest-1.11.0/googletest/test/gtest_testbridge_test.py + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_testbridge_test_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_throw_on_failure_ex_test.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_unittest.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_xml_outfile1_test_.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_xml_outfile2_test_.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/gtest_xml_outfiles_test.py + delete mode 100755 test/gtest-1.11.0/googletest/test/gtest_xml_output_unittest.py + delete mode 100644 test/gtest-1.11.0/googletest/test/gtest_xml_output_unittest_.cc + delete mode 100755 test/gtest-1.11.0/googletest/test/gtest_xml_test_utils.py + delete mode 100644 test/gtest-1.11.0/googletest/test/production.cc + delete mode 100644 test/gtest-1.11.0/googletest/test/production.h + delete mode 100644 test/gtest-1.11.0/library.json + delete mode 100644 test/handler_test.h + delete mode 100644 test/integration/emitter_test.cpp + delete mode 100644 test/integration/encoding_test.cpp + delete mode 100644 test/integration/error_messages_test.cpp + delete mode 100644 test/integration/gen_emitter_test.cpp + delete mode 100644 test/integration/handler_spec_test.cpp + delete mode 100644 test/integration/handler_test.cpp + delete mode 100644 test/integration/load_node_test.cpp + delete mode 100644 test/integration/node_spec_test.cpp + delete mode 100644 test/main.cpp + delete mode 100644 test/mock_event_handler.h + delete mode 100644 test/node/node_test.cpp + delete mode 100644 test/ostream_wrapper_test.cpp + delete mode 100644 test/parser_test.cpp + delete mode 100644 test/regex_test.cpp + delete mode 100644 test/specexamples.h + delete mode 100644 util/CMakeLists.txt + delete mode 100644 util/api.cpp + delete mode 100644 util/parse.cpp + delete mode 100644 util/read.cpp + delete mode 100644 util/sandbox.cpp + delete mode 100644 yaml-cpp-config.cmake.in + delete mode 100644 yaml-cpp.pc.in -diff --git a/src/libs/3rdparty/yaml-cpp/.codedocs b/src/libs/3rdparty/yaml-cpp/.codedocs +diff --git a/.codedocs b/.codedocs deleted file mode 100644 -index 02e438213a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/.gitignore b/src/libs/3rdparty/yaml-cpp/.gitignore +index 02e4382..0000000 +diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 -index 567609b123..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/.travis.yml b/src/libs/3rdparty/yaml-cpp/.travis.yml +index a408a9d..0000000 +diff --git a/.gitignore b/.gitignore deleted file mode 100644 -index d0b6a04efe..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/CMakeLists.txt b/src/libs/3rdparty/yaml-cpp/CMakeLists.txt +index 2f9d10f..0000000 +diff --git a/BUILD.bazel b/BUILD.bazel deleted file mode 100644 -index d2d8810288..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/CONTRIBUTING.md b/src/libs/3rdparty/yaml-cpp/CONTRIBUTING.md +index 23e847e..0000000 +diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 -index cd09a1aca8..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/contrib/anchordict.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/contrib/anchordict.h +index 46dc180..0000000 +diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 -index 78db9ec928..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/contrib/graphbuilder.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/contrib/graphbuilder.h +index 5705fe2..0000000 +diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 -index f0a38f2887..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/install.txt b/src/libs/3rdparty/yaml-cpp/install.txt +index 06a1751..0000000 +diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 -index 939236249b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/src/contrib/graphbuilder.cpp b/src/libs/3rdparty/yaml-cpp/src/contrib/graphbuilder.cpp +index d5ecc0b..0000000 +diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in deleted file mode 100644 -index 416c1359db..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/src/contrib/graphbuilderadapter.cpp b/src/libs/3rdparty/yaml-cpp/src/contrib/graphbuilderadapter.cpp +index c2d34d4..0000000 +diff --git a/docs/Breaking-Changes.md b/docs/Breaking-Changes.md deleted file mode 100644 -index 02a3d972a5..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/src/contrib/graphbuilderadapter.h b/src/libs/3rdparty/yaml-cpp/src/contrib/graphbuilderadapter.h +index 959adea..0000000 +diff --git a/docs/How-To-Emit-YAML.md b/docs/How-To-Emit-YAML.md deleted file mode 100644 -index 0d1e579208..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/CMakeLists.txt b/src/libs/3rdparty/yaml-cpp/test/CMakeLists.txt +index 9340701..0000000 +diff --git a/docs/How-To-Parse-A-Document-(Old-API).md b/docs/How-To-Parse-A-Document-(Old-API).md deleted file mode 100644 -index 3633da578b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/create-emitter-tests.py b/src/libs/3rdparty/yaml-cpp/test/create-emitter-tests.py +index 82fac71..0000000 +diff --git a/docs/Strings.md b/docs/Strings.md deleted file mode 100644 -index 7a03c41e1b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/.gitignore b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/.gitignore +index f2328a1..0000000 +diff --git a/docs/Tutorial.md b/docs/Tutorial.md deleted file mode 100644 -index ce310bc357..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/.travis.yml b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/.travis.yml +index a7b0e21..0000000 +diff --git a/docs/_config.yml b/docs/_config.yml deleted file mode 100644 -index 3204dfac17..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/CMakeLists.txt b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/CMakeLists.txt +index c741881..0000000 +diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 -index 8d2b552ef7..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/README.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/README.md +index 17f1315..0000000 +diff --git a/include/yaml-cpp/contrib/anchordict.h b/include/yaml-cpp/contrib/anchordict.h deleted file mode 100644 -index 076484e4fa..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/appveyor.yml b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/appveyor.yml +index 1b7809b..0000000 +diff --git a/include/yaml-cpp/contrib/graphbuilder.h b/include/yaml-cpp/contrib/graphbuilder.h deleted file mode 100644 -index d613fd6027..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/CHANGES b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/CHANGES +index dbffd92..0000000 +diff --git a/install.txt b/install.txt deleted file mode 100644 -index d6f2f760e3..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/CMakeLists.txt b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/CMakeLists.txt +index 9392362..0000000 +diff --git a/src/contrib/graphbuilder.cpp b/src/contrib/graphbuilder.cpp deleted file mode 100644 -index beb259a2e9..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/CONTRIBUTORS b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/CONTRIBUTORS +index 0352054..0000000 +diff --git a/src/contrib/graphbuilderadapter.cpp b/src/contrib/graphbuilderadapter.cpp deleted file mode 100644 -index 6e9ae362b6..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/LICENSE b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/LICENSE +index c386a92..0000000 +diff --git a/src/contrib/graphbuilderadapter.h b/src/contrib/graphbuilderadapter.h deleted file mode 100644 -index 1941a11f8c..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/README.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/README.md +index c1cbcff..0000000 +diff --git a/src/contrib/yaml-cpp.natvis b/src/contrib/yaml-cpp.natvis deleted file mode 100644 -index 332beab388..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/build-aux/.keep b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/build-aux/.keep +index d5c222b..0000000 +diff --git a/src/contrib/yaml-cpp.natvis.md b/src/contrib/yaml-cpp.natvis.md deleted file mode 100644 -index e69de29bb2..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/configure.ac b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/configure.ac +index f1d68a8..0000000 +diff --git a/test/BUILD.bazel b/test/BUILD.bazel deleted file mode 100644 -index 3b740f205e..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/CheatSheet.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/CheatSheet.md +index d30fa73..0000000 +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt deleted file mode 100644 -index ef4451b878..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/CookBook.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/CookBook.md +index 351b03f..0000000 +diff --git a/test/binary_test.cpp b/test/binary_test.cpp deleted file mode 100644 -index c52f1009d1..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/DesignDoc.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/DesignDoc.md +index 7b17823..0000000 +diff --git a/test/create-emitter-tests.py b/test/create-emitter-tests.py deleted file mode 100644 -index 3f515c3b6d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/DevGuide.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/DevGuide.md +index 7295544..0000000 +diff --git a/test/gtest-1.11.0/.clang-format b/test/gtest-1.11.0/.clang-format deleted file mode 100644 -index f4bab75ca7..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/Documentation.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/Documentation.md +index 5b9bfe6..0000000 +diff --git a/test/gtest-1.11.0/.github/ISSUE_TEMPLATE/00-bug_report.md b/test/gtest-1.11.0/.github/ISSUE_TEMPLATE/00-bug_report.md deleted file mode 100644 -index 444151ee9e..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/ForDummies.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/ForDummies.md +index 0f7e8b5..0000000 +diff --git a/test/gtest-1.11.0/.github/ISSUE_TEMPLATE/10-feature_request.md b/test/gtest-1.11.0/.github/ISSUE_TEMPLATE/10-feature_request.md deleted file mode 100644 -index 0da4cbe27b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/FrequentlyAskedQuestions.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/FrequentlyAskedQuestions.md +index 70a3a20..0000000 +diff --git a/test/gtest-1.11.0/.github/ISSUE_TEMPLATE/config.yml b/test/gtest-1.11.0/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 -index 5eac83f4b9..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/KnownIssues.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/KnownIssues.md +index 3ba13e0..0000000 +diff --git a/test/gtest-1.11.0/.gitignore b/test/gtest-1.11.0/.gitignore deleted file mode 100644 -index adadf5144b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/CheatSheet.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/CheatSheet.md +index f08cb72..0000000 +diff --git a/test/gtest-1.11.0/BUILD.bazel b/test/gtest-1.11.0/BUILD.bazel deleted file mode 100644 -index 3c7bed4c6f..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/CookBook.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/CookBook.md +index 965c518..0000000 +diff --git a/test/gtest-1.11.0/CMakeLists.txt b/test/gtest-1.11.0/CMakeLists.txt deleted file mode 100644 -index 26e153c6ba..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/Documentation.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/Documentation.md +index ea81ab1..0000000 +diff --git a/test/gtest-1.11.0/CONTRIBUTING.md b/test/gtest-1.11.0/CONTRIBUTING.md deleted file mode 100644 -index 315b0a2989..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/ForDummies.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/ForDummies.md +index da45e44..0000000 +diff --git a/test/gtest-1.11.0/CONTRIBUTORS b/test/gtest-1.11.0/CONTRIBUTORS deleted file mode 100644 -index fcc3b56174..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/FrequentlyAskedQuestions.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_5/FrequentlyAskedQuestions.md +index 76db0b4..0000000 +diff --git a/test/gtest-1.11.0/LICENSE b/test/gtest-1.11.0/LICENSE deleted file mode 100644 -index 7593243c3a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/CheatSheet.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/CheatSheet.md +index 1941a11..0000000 +diff --git a/test/gtest-1.11.0/README.md b/test/gtest-1.11.0/README.md deleted file mode 100644 -index 91de1d210e..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/CookBook.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/CookBook.md +index 7d872a5..0000000 +diff --git a/test/gtest-1.11.0/WORKSPACE b/test/gtest-1.11.0/WORKSPACE deleted file mode 100644 -index f5975a0035..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/Documentation.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/Documentation.md +index 614f557..0000000 +diff --git a/test/gtest-1.11.0/ci/linux-presubmit.sh b/test/gtest-1.11.0/ci/linux-presubmit.sh deleted file mode 100644 -index dcc9156c2a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/ForDummies.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/ForDummies.md +index 6bea1cd..0000000 +diff --git a/test/gtest-1.11.0/ci/macos-presubmit.sh b/test/gtest-1.11.0/ci/macos-presubmit.sh deleted file mode 100644 -index 19ee63ab0c..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/FrequentlyAskedQuestions.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_6/FrequentlyAskedQuestions.md +index d6423fa..0000000 +diff --git a/test/gtest-1.11.0/docs/_config.yml b/test/gtest-1.11.0/docs/_config.yml deleted file mode 100644 -index f74715d2e3..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/CheatSheet.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/CheatSheet.md +index d12867e..0000000 +diff --git a/test/gtest-1.11.0/docs/_data/navigation.yml b/test/gtest-1.11.0/docs/_data/navigation.yml deleted file mode 100644 -index db421e51be..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/CookBook.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/CookBook.md +index 9f33327..0000000 +diff --git a/test/gtest-1.11.0/docs/_layouts/default.html b/test/gtest-1.11.0/docs/_layouts/default.html deleted file mode 100644 -index 419a001071..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/Documentation.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/Documentation.md +index dcb42d9..0000000 +diff --git a/test/gtest-1.11.0/docs/_sass/main.scss b/test/gtest-1.11.0/docs/_sass/main.scss deleted file mode 100644 -index d9181f28e1..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/ForDummies.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/ForDummies.md +index 92edc87..0000000 +diff --git a/test/gtest-1.11.0/docs/advanced.md b/test/gtest-1.11.0/docs/advanced.md deleted file mode 100644 -index ee03c5b989..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/FrequentlyAskedQuestions.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/docs/v1_7/FrequentlyAskedQuestions.md +index 8dff5ba..0000000 +diff --git a/test/gtest-1.11.0/docs/assets/css/style.scss b/test/gtest-1.11.0/docs/assets/css/style.scss deleted file mode 100644 -index fa21233aa2..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-actions.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-actions.h +index bb30f41..0000000 +diff --git a/test/gtest-1.11.0/docs/community_created_documentation.md b/test/gtest-1.11.0/docs/community_created_documentation.md deleted file mode 100644 -index b3f654af34..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-cardinalities.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-cardinalities.h +index 4569075..0000000 +diff --git a/test/gtest-1.11.0/docs/faq.md b/test/gtest-1.11.0/docs/faq.md deleted file mode 100644 -index fc315f92ab..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-actions.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-actions.h +index 9042da1..0000000 +diff --git a/test/gtest-1.11.0/docs/gmock_cheat_sheet.md b/test/gtest-1.11.0/docs/gmock_cheat_sheet.md deleted file mode 100644 -index b5a889c0c3..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-actions.h.pump b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-actions.h.pump +index 17ed7a5..0000000 +diff --git a/test/gtest-1.11.0/docs/gmock_cook_book.md b/test/gtest-1.11.0/docs/gmock_cook_book.md deleted file mode 100644 -index 66d9f9d551..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-function-mockers.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-function-mockers.h +index c08958e..0000000 +diff --git a/test/gtest-1.11.0/docs/gmock_faq.md b/test/gtest-1.11.0/docs/gmock_faq.md deleted file mode 100644 -index 4fa5ca9484..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-function-mockers.h.pump b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +index 2cd9b3f..0000000 +diff --git a/test/gtest-1.11.0/docs/gmock_for_dummies.md b/test/gtest-1.11.0/docs/gmock_for_dummies.md deleted file mode 100644 -index 811502d0ce..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-matchers.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-matchers.h +index 1f4cc24..0000000 +diff --git a/test/gtest-1.11.0/docs/index.md b/test/gtest-1.11.0/docs/index.md deleted file mode 100644 -index 57056fd91d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-matchers.h.pump b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-matchers.h.pump +index b162c74..0000000 +diff --git a/test/gtest-1.11.0/docs/pkgconfig.md b/test/gtest-1.11.0/docs/pkgconfig.md deleted file mode 100644 -index de30c2c92b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-nice-strict.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-nice-strict.h +index 768e9b4..0000000 +diff --git a/test/gtest-1.11.0/docs/platforms.md b/test/gtest-1.11.0/docs/platforms.md deleted file mode 100644 -index 4095f4d5bc..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-nice-strict.h.pump b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +index eba6ef8..0000000 +diff --git a/test/gtest-1.11.0/docs/primer.md b/test/gtest-1.11.0/docs/primer.md deleted file mode 100644 -index 3ee1ce7f30..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-matchers.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-matchers.h +index 6d8fdf4..0000000 +diff --git a/test/gtest-1.11.0/docs/quickstart-bazel.md b/test/gtest-1.11.0/docs/quickstart-bazel.md deleted file mode 100644 -index 33b37a7a5d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-more-actions.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-more-actions.h +index 362ee6d..0000000 +diff --git a/test/gtest-1.11.0/docs/quickstart-cmake.md b/test/gtest-1.11.0/docs/quickstart-cmake.md deleted file mode 100644 -index 3d387b6b7d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-more-matchers.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-more-matchers.h +index 420f1d3..0000000 +diff --git a/test/gtest-1.11.0/docs/reference/actions.md b/test/gtest-1.11.0/docs/reference/actions.md deleted file mode 100644 -index 3db899f429..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h +index 166d2a8..0000000 +diff --git a/test/gtest-1.11.0/docs/reference/assertions.md b/test/gtest-1.11.0/docs/reference/assertions.md deleted file mode 100644 -index fed7de66bc..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/gmock.h +index 7bf03a3..0000000 +diff --git a/test/gtest-1.11.0/docs/reference/matchers.md b/test/gtest-1.11.0/docs/reference/matchers.md deleted file mode 100644 -index 6735c71bf8..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/custom/gmock-generated-actions.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +index 9e40cab..0000000 +diff --git a/test/gtest-1.11.0/docs/reference/mocking.md b/test/gtest-1.11.0/docs/reference/mocking.md deleted file mode 100644 -index 7dc3b1ad54..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +index c29f716..0000000 +diff --git a/test/gtest-1.11.0/docs/reference/testing.md b/test/gtest-1.11.0/docs/reference/testing.md deleted file mode 100644 -index d26c8a08a4..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/custom/gmock-matchers.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/custom/gmock-matchers.h +index 554d6c9..0000000 +diff --git a/test/gtest-1.11.0/docs/samples.md b/test/gtest-1.11.0/docs/samples.md deleted file mode 100644 -index f2efef91db..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/custom/gmock-port.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/custom/gmock-port.h +index 2d97ca5..0000000 +diff --git a/test/gtest-1.11.0/googlemock/CMakeLists.txt b/test/gtest-1.11.0/googlemock/CMakeLists.txt deleted file mode 100644 -index 9ce8bfe06b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/gmock-generated-internal-utils.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +index e7df8ec..0000000 +diff --git a/test/gtest-1.11.0/googlemock/README.md b/test/gtest-1.11.0/googlemock/README.md deleted file mode 100644 -index 7811e43f87..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +index ead6883..0000000 +diff --git a/test/gtest-1.11.0/googlemock/cmake/gmock.pc.in b/test/gtest-1.11.0/googlemock/cmake/gmock.pc.in deleted file mode 100644 -index 800af17c1d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/gmock-internal-utils.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/gmock-internal-utils.h +index 23c67b5..0000000 +diff --git a/test/gtest-1.11.0/googlemock/cmake/gmock_main.pc.in b/test/gtest-1.11.0/googlemock/cmake/gmock_main.pc.in deleted file mode 100644 -index e2ddb05c91..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/gmock-port.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/include/gmock/internal/gmock-port.h +index 66ffea7..0000000 +diff --git a/test/gtest-1.11.0/googlemock/docs/README.md b/test/gtest-1.11.0/googlemock/docs/README.md deleted file mode 100644 -index 63f4a6802e..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/msvc/2005/gmock_config.vsprops b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/msvc/2005/gmock_config.vsprops +index 1bc57b7..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/gmock-actions.h b/test/gtest-1.11.0/googlemock/include/gmock/gmock-actions.h deleted file mode 100644 -index 9b5ff7f38a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/msvc/2010/gmock_config.props b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/msvc/2010/gmock_config.props +index f2393bd..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/gmock-cardinalities.h b/test/gtest-1.11.0/googlemock/include/gmock/gmock-cardinalities.h deleted file mode 100644 -index 77bc95b192..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/msvc/2015/gmock_config.props b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/msvc/2015/gmock_config.props +index fc7f803..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/gmock-function-mocker.h b/test/gtest-1.11.0/googlemock/include/gmock/gmock-function-mocker.h deleted file mode 100644 -index 77bc95b192..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/fuse_gmock_files.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/fuse_gmock_files.py +index 0fc6f6f..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/gmock-matchers.h b/test/gtest-1.11.0/googlemock/include/gmock/gmock-matchers.h +deleted file mode 100644 +index 86be9c1..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/gmock-more-actions.h b/test/gtest-1.11.0/googlemock/include/gmock/gmock-more-actions.h +deleted file mode 100644 +index fd29335..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/gmock-more-matchers.h b/test/gtest-1.11.0/googlemock/include/gmock/gmock-more-matchers.h +deleted file mode 100644 +index dfc77e3..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/gmock-nice-strict.h b/test/gtest-1.11.0/googlemock/include/gmock/gmock-nice-strict.h +deleted file mode 100644 +index b03b770..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/gmock-spec-builders.h b/test/gtest-1.11.0/googlemock/include/gmock/gmock-spec-builders.h +deleted file mode 100644 +index 41323c1..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/gmock.h b/test/gtest-1.11.0/googlemock/include/gmock/gmock.h +deleted file mode 100644 +index 12469bc..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/internal/custom/README.md b/test/gtest-1.11.0/googlemock/include/gmock/internal/custom/README.md +deleted file mode 100644 +index f6c93f6..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/internal/custom/gmock-generated-actions.h b/test/gtest-1.11.0/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +deleted file mode 100644 +index 63f8999..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/internal/custom/gmock-matchers.h b/test/gtest-1.11.0/googlemock/include/gmock/internal/custom/gmock-matchers.h +deleted file mode 100644 +index 6384294..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/internal/custom/gmock-port.h b/test/gtest-1.11.0/googlemock/include/gmock/internal/custom/gmock-port.h +deleted file mode 100644 +index 1437869..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/internal/gmock-internal-utils.h b/test/gtest-1.11.0/googlemock/include/gmock/internal/gmock-internal-utils.h +deleted file mode 100644 +index 317544a..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/internal/gmock-port.h b/test/gtest-1.11.0/googlemock/include/gmock/internal/gmock-port.h +deleted file mode 100644 +index 367a44d..0000000 +diff --git a/test/gtest-1.11.0/googlemock/include/gmock/internal/gmock-pp.h b/test/gtest-1.11.0/googlemock/include/gmock/internal/gmock-pp.h +deleted file mode 100644 +index 94d61c0..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/README.md b/test/gtest-1.11.0/googlemock/scripts/README.md +deleted file mode 100644 +index a3301e5..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/fuse_gmock_files.py b/test/gtest-1.11.0/googlemock/scripts/fuse_gmock_files.py deleted file mode 100755 -index cb7fdf2f78..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/LICENSE b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/LICENSE +index 7fa9b3a..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/generator/LICENSE b/test/gtest-1.11.0/googlemock/scripts/generator/LICENSE deleted file mode 100644 -index 87ea063651..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/README b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/README +index 87ea063..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/generator/README b/test/gtest-1.11.0/googlemock/scripts/generator/README deleted file mode 100644 -index d6f95974b6..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/README.cppclean b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/README.cppclean +index 01fd463..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/generator/README.cppclean b/test/gtest-1.11.0/googlemock/scripts/generator/README.cppclean deleted file mode 100644 -index 65431b6175..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/__init__.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/__init__.py +index 65431b6..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/generator/cpp/__init__.py b/test/gtest-1.11.0/googlemock/scripts/generator/cpp/__init__.py deleted file mode 100755 -index e69de29bb2..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/ast.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/ast.py +index e69de29..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/generator/cpp/ast.py b/test/gtest-1.11.0/googlemock/scripts/generator/cpp/ast.py deleted file mode 100755 -index 11cbe9126a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/gmock_class.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/gmock_class.py +index 0e77016..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/generator/cpp/gmock_class.py b/test/gtest-1.11.0/googlemock/scripts/generator/cpp/gmock_class.py deleted file mode 100755 -index f9966cbb4b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/gmock_class_test.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/gmock_class_test.py +index 3e21022..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/generator/cpp/gmock_class_test.py b/test/gtest-1.11.0/googlemock/scripts/generator/cpp/gmock_class_test.py deleted file mode 100755 -index 018f90a650..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/keywords.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/keywords.py +index eff475f..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/generator/cpp/keywords.py b/test/gtest-1.11.0/googlemock/scripts/generator/cpp/keywords.py deleted file mode 100755 -index f694450e37..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/tokenize.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/tokenize.py +index e428271..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/generator/cpp/tokenize.py b/test/gtest-1.11.0/googlemock/scripts/generator/cpp/tokenize.py deleted file mode 100755 -index 359d5562d7..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/utils.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/cpp/utils.py +index a75edcb..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/generator/cpp/utils.py b/test/gtest-1.11.0/googlemock/scripts/generator/cpp/utils.py deleted file mode 100755 -index eab36eec33..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/gmock_gen.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/generator/gmock_gen.py +index 6f5fc09..0000000 +diff --git a/test/gtest-1.11.0/googlemock/scripts/generator/gmock_gen.py b/test/gtest-1.11.0/googlemock/scripts/generator/gmock_gen.py deleted file mode 100755 -index 8cc0d135d6..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/gmock-config.in b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/gmock-config.in +index 9d528a5..0000000 +diff --git a/test/gtest-1.11.0/googlemock/src/gmock-all.cc b/test/gtest-1.11.0/googlemock/src/gmock-all.cc +deleted file mode 100644 +index e43c9b7..0000000 +diff --git a/test/gtest-1.11.0/googlemock/src/gmock-cardinalities.cc b/test/gtest-1.11.0/googlemock/src/gmock-cardinalities.cc +deleted file mode 100644 +index 7463f43..0000000 +diff --git a/test/gtest-1.11.0/googlemock/src/gmock-internal-utils.cc b/test/gtest-1.11.0/googlemock/src/gmock-internal-utils.cc +deleted file mode 100644 +index e5b5479..0000000 +diff --git a/test/gtest-1.11.0/googlemock/src/gmock-matchers.cc b/test/gtest-1.11.0/googlemock/src/gmock-matchers.cc +deleted file mode 100644 +index dded437..0000000 +diff --git a/test/gtest-1.11.0/googlemock/src/gmock-spec-builders.cc b/test/gtest-1.11.0/googlemock/src/gmock-spec-builders.cc +deleted file mode 100644 +index c7266a3..0000000 +diff --git a/test/gtest-1.11.0/googlemock/src/gmock.cc b/test/gtest-1.11.0/googlemock/src/gmock.cc +deleted file mode 100644 +index 7bcdb0b..0000000 +diff --git a/test/gtest-1.11.0/googlemock/src/gmock_main.cc b/test/gtest-1.11.0/googlemock/src/gmock_main.cc +deleted file mode 100644 +index 18c500f..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/BUILD.bazel b/test/gtest-1.11.0/googlemock/test/BUILD.bazel +deleted file mode 100644 +index efb7306..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock-actions_test.cc b/test/gtest-1.11.0/googlemock/test/gmock-actions_test.cc +deleted file mode 100644 +index e1ca7fe..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock-cardinalities_test.cc b/test/gtest-1.11.0/googlemock/test/gmock-cardinalities_test.cc +deleted file mode 100644 +index ca97cae..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock-function-mocker_test.cc b/test/gtest-1.11.0/googlemock/test/gmock-function-mocker_test.cc +deleted file mode 100644 +index cf76fa9..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock-internal-utils_test.cc b/test/gtest-1.11.0/googlemock/test/gmock-internal-utils_test.cc +deleted file mode 100644 +index 0d15e8f..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock-matchers_test.cc b/test/gtest-1.11.0/googlemock/test/gmock-matchers_test.cc +deleted file mode 100644 +index 1f48a76..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock-more-actions_test.cc b/test/gtest-1.11.0/googlemock/test/gmock-more-actions_test.cc +deleted file mode 100644 +index 53bb029..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock-nice-strict_test.cc b/test/gtest-1.11.0/googlemock/test/gmock-nice-strict_test.cc +deleted file mode 100644 +index 25558eb..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock-port_test.cc b/test/gtest-1.11.0/googlemock/test/gmock-port_test.cc +deleted file mode 100644 +index a2c2be2..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock-pp-string_test.cc b/test/gtest-1.11.0/googlemock/test/gmock-pp-string_test.cc +deleted file mode 100644 +index 6f66cf1..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock-pp_test.cc b/test/gtest-1.11.0/googlemock/test/gmock-pp_test.cc +deleted file mode 100644 +index 5d1566e..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock-spec-builders_test.cc b/test/gtest-1.11.0/googlemock/test/gmock-spec-builders_test.cc +deleted file mode 100644 +index fa97411..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_all_test.cc b/test/gtest-1.11.0/googlemock/test/gmock_all_test.cc +deleted file mode 100644 +index fffbb8b..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_ex_test.cc b/test/gtest-1.11.0/googlemock/test/gmock_ex_test.cc +deleted file mode 100644 +index 72eb43f..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_leak_test.py b/test/gtest-1.11.0/googlemock/test/gmock_leak_test.py deleted file mode 100755 -index 2baefe94d6..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/gmock_doctor.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/gmock_doctor.py +index 7e4b1ee..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_leak_test_.cc b/test/gtest-1.11.0/googlemock/test/gmock_leak_test_.cc +deleted file mode 100644 +index 2e095ab..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_link2_test.cc b/test/gtest-1.11.0/googlemock/test/gmock_link2_test.cc +deleted file mode 100644 +index d27ce17..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_link_test.cc b/test/gtest-1.11.0/googlemock/test/gmock_link_test.cc +deleted file mode 100644 +index e7c54cc..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_link_test.h b/test/gtest-1.11.0/googlemock/test/gmock_link_test.h +deleted file mode 100644 +index 5734b2e..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_output_test.py b/test/gtest-1.11.0/googlemock/test/gmock_output_test.py deleted file mode 100755 -index 74992bc744..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/upload.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/upload.py +index 25f99f2..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_output_test_.cc b/test/gtest-1.11.0/googlemock/test/gmock_output_test_.cc +deleted file mode 100644 +index 3955c73..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_output_test_golden.txt b/test/gtest-1.11.0/googlemock/test/gmock_output_test_golden.txt +deleted file mode 100644 +index 4846c12..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_stress_test.cc b/test/gtest-1.11.0/googlemock/test/gmock_stress_test.cc +deleted file mode 100644 +index 20725d6..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_test.cc b/test/gtest-1.11.0/googlemock/test/gmock_test.cc +deleted file mode 100644 +index e9840a3..0000000 +diff --git a/test/gtest-1.11.0/googlemock/test/gmock_test_utils.py b/test/gtest-1.11.0/googlemock/test/gmock_test_utils.py deleted file mode 100755 -index 6e6f9a1471..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/upload_gmock.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/scripts/upload_gmock.py +index 7dc4e11..0000000 +diff --git a/test/gtest-1.11.0/googletest/CMakeLists.txt b/test/gtest-1.11.0/googletest/CMakeLists.txt +deleted file mode 100644 +index abdd98b..0000000 +diff --git a/test/gtest-1.11.0/googletest/README.md b/test/gtest-1.11.0/googletest/README.md +deleted file mode 100644 +index 1f8b349..0000000 +diff --git a/test/gtest-1.11.0/googletest/cmake/Config.cmake.in b/test/gtest-1.11.0/googletest/cmake/Config.cmake.in +deleted file mode 100644 +index 12be449..0000000 +diff --git a/test/gtest-1.11.0/googletest/cmake/gtest.pc.in b/test/gtest-1.11.0/googletest/cmake/gtest.pc.in +deleted file mode 100644 +index b4148fa..0000000 +diff --git a/test/gtest-1.11.0/googletest/cmake/gtest_main.pc.in b/test/gtest-1.11.0/googletest/cmake/gtest_main.pc.in +deleted file mode 100644 +index 38c88c5..0000000 +diff --git a/test/gtest-1.11.0/googletest/cmake/internal_utils.cmake b/test/gtest-1.11.0/googletest/cmake/internal_utils.cmake +deleted file mode 100644 +index 8d8d60a..0000000 +diff --git a/test/gtest-1.11.0/googletest/cmake/libgtest.la.in b/test/gtest-1.11.0/googletest/cmake/libgtest.la.in +deleted file mode 100644 +index 840c838..0000000 +diff --git a/test/gtest-1.11.0/googletest/docs/README.md b/test/gtest-1.11.0/googletest/docs/README.md +deleted file mode 100644 +index 1bc57b7..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/gtest-death-test.h b/test/gtest-1.11.0/googletest/include/gtest/gtest-death-test.h +deleted file mode 100644 +index 9b4d4d1..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/gtest-matchers.h b/test/gtest-1.11.0/googletest/include/gtest/gtest-matchers.h +deleted file mode 100644 +index 9fa34a0..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/gtest-message.h b/test/gtest-1.11.0/googletest/include/gtest/gtest-message.h +deleted file mode 100644 +index becfd49..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/gtest-param-test.h b/test/gtest-1.11.0/googletest/include/gtest/gtest-param-test.h +deleted file mode 100644 +index 804e702..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/gtest-printers.h b/test/gtest-1.11.0/googletest/include/gtest/gtest-printers.h +deleted file mode 100644 +index 076c9de..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/gtest-spi.h b/test/gtest-1.11.0/googletest/include/gtest/gtest-spi.h +deleted file mode 100644 +index eacef44..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/gtest-test-part.h b/test/gtest-1.11.0/googletest/include/gtest/gtest-test-part.h +deleted file mode 100644 +index 203fdf9..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/gtest-typed-test.h b/test/gtest-1.11.0/googletest/include/gtest/gtest-typed-test.h +deleted file mode 100644 +index 9fdc6be..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/gtest.h b/test/gtest-1.11.0/googletest/include/gtest/gtest.h +deleted file mode 100644 +index 7a5d057..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/gtest_pred_impl.h b/test/gtest-1.11.0/googletest/include/gtest/gtest_pred_impl.h +deleted file mode 100644 +index 5029a9b..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/gtest_prod.h b/test/gtest-1.11.0/googletest/include/gtest/gtest_prod.h +deleted file mode 100644 +index 38b9d85..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/internal/custom/README.md b/test/gtest-1.11.0/googletest/include/gtest/internal/custom/README.md +deleted file mode 100644 +index ff391fb..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/internal/custom/gtest-port.h b/test/gtest-1.11.0/googletest/include/gtest/internal/custom/gtest-port.h +deleted file mode 100644 +index db02881..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/internal/custom/gtest-printers.h b/test/gtest-1.11.0/googletest/include/gtest/internal/custom/gtest-printers.h +deleted file mode 100644 +index b9495d8..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/internal/custom/gtest.h b/test/gtest-1.11.0/googletest/include/gtest/internal/custom/gtest.h +deleted file mode 100644 +index afaaf17..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-death-test-internal.h b/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-death-test-internal.h +deleted file mode 100644 +index 490296d..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-filepath.h b/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-filepath.h +deleted file mode 100644 +index 0c033ab..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-internal.h b/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-internal.h +deleted file mode 100644 +index f8cbdbd..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-param-util.h b/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-param-util.h +deleted file mode 100644 +index c2ef6e3..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-port-arch.h b/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-port-arch.h +deleted file mode 100644 +index dd84591..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-port.h b/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-port.h +deleted file mode 100644 +index 0953a78..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-string.h b/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-string.h +deleted file mode 100644 +index 10f774f..0000000 +diff --git a/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-type-util.h b/test/gtest-1.11.0/googletest/include/gtest/internal/gtest-type-util.h +deleted file mode 100644 +index b87a2e2..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/prime_tables.h b/test/gtest-1.11.0/googletest/samples/prime_tables.h +deleted file mode 100644 +index 3a10352..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample1.cc b/test/gtest-1.11.0/googletest/samples/sample1.cc +deleted file mode 100644 +index 1d42759..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample1.h b/test/gtest-1.11.0/googletest/samples/sample1.h +deleted file mode 100644 +index ba392cf..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample10_unittest.cc b/test/gtest-1.11.0/googletest/samples/sample10_unittest.cc +deleted file mode 100644 +index 36cdac2..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample1_unittest.cc b/test/gtest-1.11.0/googletest/samples/sample1_unittest.cc +deleted file mode 100644 +index cb08b61..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample2.cc b/test/gtest-1.11.0/googletest/samples/sample2.cc +deleted file mode 100644 +index d8e8723..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample2.h b/test/gtest-1.11.0/googletest/samples/sample2.h +deleted file mode 100644 +index 0f98689..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample2_unittest.cc b/test/gtest-1.11.0/googletest/samples/sample2_unittest.cc +deleted file mode 100644 +index 41e31c1..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample3-inl.h b/test/gtest-1.11.0/googletest/samples/sample3-inl.h +deleted file mode 100644 +index 659e0f0..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample3_unittest.cc b/test/gtest-1.11.0/googletest/samples/sample3_unittest.cc +deleted file mode 100644 +index b19416d..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample4.cc b/test/gtest-1.11.0/googletest/samples/sample4.cc +deleted file mode 100644 +index b0ee609..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample4.h b/test/gtest-1.11.0/googletest/samples/sample4.h +deleted file mode 100644 +index 0c4ed92..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample4_unittest.cc b/test/gtest-1.11.0/googletest/samples/sample4_unittest.cc +deleted file mode 100644 +index d5144c0..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample5_unittest.cc b/test/gtest-1.11.0/googletest/samples/sample5_unittest.cc +deleted file mode 100644 +index 0a21dd2..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample6_unittest.cc b/test/gtest-1.11.0/googletest/samples/sample6_unittest.cc +deleted file mode 100644 +index da317ee..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample7_unittest.cc b/test/gtest-1.11.0/googletest/samples/sample7_unittest.cc +deleted file mode 100644 +index e0efc29..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample8_unittest.cc b/test/gtest-1.11.0/googletest/samples/sample8_unittest.cc +deleted file mode 100644 +index 10488b0..0000000 +diff --git a/test/gtest-1.11.0/googletest/samples/sample9_unittest.cc b/test/gtest-1.11.0/googletest/samples/sample9_unittest.cc +deleted file mode 100644 +index e502d08..0000000 +diff --git a/test/gtest-1.11.0/googletest/scripts/README.md b/test/gtest-1.11.0/googletest/scripts/README.md +deleted file mode 100644 +index fa359fe..0000000 +diff --git a/test/gtest-1.11.0/googletest/scripts/common.py b/test/gtest-1.11.0/googletest/scripts/common.py +deleted file mode 100644 +index 3c0347a..0000000 +diff --git a/test/gtest-1.11.0/googletest/scripts/fuse_gtest_files.py b/test/gtest-1.11.0/googletest/scripts/fuse_gtest_files.py deleted file mode 100755 -index 5dc484b391..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-all.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-all.cc -deleted file mode 100644 -index 7aebce7afe..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-cardinalities.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-cardinalities.cc -deleted file mode 100644 -index 50ec7286ee..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-internal-utils.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-internal-utils.cc -deleted file mode 100644 -index fb5308018a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-matchers.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-matchers.cc -deleted file mode 100644 -index e7424510fc..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-spec-builders.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock-spec-builders.cc -deleted file mode 100644 -index 9551342070..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock.cc -deleted file mode 100644 -index eac3d842ba..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock_main.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/src/gmock_main.cc -deleted file mode 100644 -index bd5be03be2..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-actions_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-actions_test.cc -deleted file mode 100644 -index f470de4c55..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-cardinalities_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-cardinalities_test.cc -deleted file mode 100644 -index 64815e57a3..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-generated-actions_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-generated-actions_test.cc -deleted file mode 100644 -index 5ca5bc7892..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-generated-function-mockers_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-generated-function-mockers_test.cc -deleted file mode 100644 -index a86a613578..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-generated-internal-utils_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-generated-internal-utils_test.cc -deleted file mode 100644 -index e0a535a346..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-generated-matchers_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-generated-matchers_test.cc -deleted file mode 100644 -index 0e9f77f5eb..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-internal-utils_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-internal-utils_test.cc -deleted file mode 100644 -index 9d5ec60927..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-matchers_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-matchers_test.cc -deleted file mode 100644 -index 9f62c3d826..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-more-actions_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-more-actions_test.cc -deleted file mode 100644 -index 77e15bd586..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-nice-strict_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-nice-strict_test.cc -deleted file mode 100644 -index d0adcbbed8..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-port_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-port_test.cc -deleted file mode 100644 -index d6a8d44466..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-spec-builders_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock-spec-builders_test.cc -deleted file mode 100644 -index 59ea87c894..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_all_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_all_test.cc -deleted file mode 100644 -index 56d6c49ccc..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_ex_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_ex_test.cc -deleted file mode 100644 -index 3afed86ab9..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_leak_test.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_leak_test.py +index d0dd464..0000000 +diff --git a/test/gtest-1.11.0/googletest/scripts/gen_gtest_pred_impl.py b/test/gtest-1.11.0/googletest/scripts/gen_gtest_pred_impl.py deleted file mode 100755 -index 997680ce1a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_leak_test_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_leak_test_.cc -deleted file mode 100644 -index 1d27d22f62..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_link2_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_link2_test.cc -deleted file mode 100644 -index 4c310c3d83..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_link_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_link_test.cc -deleted file mode 100644 -index 61e97d10ca..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_link_test.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_link_test.h -deleted file mode 100644 -index 1f55f5bd7f..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_output_test.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_output_test.py +index e09a6e0..0000000 +diff --git a/test/gtest-1.11.0/googletest/scripts/gtest-config.in b/test/gtest-1.11.0/googletest/scripts/gtest-config.in deleted file mode 100755 -index eced8a81f2..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_output_test_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_output_test_.cc -deleted file mode 100644 -index 44cba342ad..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_output_test_golden.txt b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_output_test_golden.txt -deleted file mode 100644 -index 689d5eeb03..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_stress_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_stress_test.cc -deleted file mode 100644 -index 0e97aeed0b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_test.cc -deleted file mode 100644 -index d8d0c57b16..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_test_utils.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googlemock/test/gmock_test_utils.py +index 780f843..0000000 +diff --git a/test/gtest-1.11.0/googletest/scripts/release_docs.py b/test/gtest-1.11.0/googletest/scripts/release_docs.py deleted file mode 100755 -index 20e3d3d446..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/.gitignore b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/.gitignore -deleted file mode 100644 -index 4b7be4b91b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/CHANGES b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/CHANGES -deleted file mode 100644 -index 0552132421..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/CMakeLists.txt b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/CMakeLists.txt -deleted file mode 100644 -index 621d0f0421..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/CONTRIBUTORS b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/CONTRIBUTORS -deleted file mode 100644 -index feae2fc044..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/LICENSE b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/LICENSE -deleted file mode 100644 -index 1941a11f8c..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/README.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/README.md -deleted file mode 100644 -index edd4408054..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/build-aux/.keep b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/build-aux/.keep -deleted file mode 100644 -index e69de29bb2..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/cmake/internal_utils.cmake b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/cmake/internal_utils.cmake -deleted file mode 100644 -index 777b91ed4b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest.cbproj b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest.cbproj -deleted file mode 100644 -index 285bb2a87b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest.groupproj b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest.groupproj -deleted file mode 100644 -index 849f4c4b81..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest_all.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest_all.cc -deleted file mode 100644 -index ba7ad68ad1..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest_link.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest_link.cc -deleted file mode 100644 -index b955ebf2f9..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest_main.cbproj b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest_main.cbproj -deleted file mode 100644 -index fae32cb29b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest_unittest.cbproj b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/codegear/gtest_unittest.cbproj -deleted file mode 100644 -index 33f7056346..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/configure.ac b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/configure.ac -deleted file mode 100644 -index cc592e1583..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/AdvancedGuide.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/AdvancedGuide.md -deleted file mode 100644 -index 93a65200da..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/DevGuide.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/DevGuide.md -deleted file mode 100644 -index 06467a3277..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/Documentation.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/Documentation.md -deleted file mode 100644 -index 8ca1aac759..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/FAQ.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/FAQ.md -deleted file mode 100644 -index 5fd6cb7238..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/Primer.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/Primer.md -deleted file mode 100644 -index 474c1d2ab6..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/PumpManual.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/PumpManual.md -deleted file mode 100644 -index 8184f153ca..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/Samples.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/Samples.md -deleted file mode 100644 -index f21d200567..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_AdvancedGuide.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_AdvancedGuide.md -deleted file mode 100644 -index 34e19c26fd..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_Documentation.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_Documentation.md -deleted file mode 100644 -index 46bba2ec86..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_FAQ.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_FAQ.md -deleted file mode 100644 -index e870aff000..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_Primer.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_Primer.md -deleted file mode 100644 -index 6960d2ce4c..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_PumpManual.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_PumpManual.md -deleted file mode 100644 -index 15710789dd..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_XcodeGuide.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_5_XcodeGuide.md -deleted file mode 100644 -index bf24bf51bf..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_AdvancedGuide.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_AdvancedGuide.md -deleted file mode 100644 -index 78864b1667..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_Documentation.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_Documentation.md -deleted file mode 100644 -index ca924660a3..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_FAQ.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_FAQ.md -deleted file mode 100644 -index 2b7f784077..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_Primer.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_Primer.md -deleted file mode 100644 -index 8d840ef45b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_PumpManual.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_PumpManual.md -deleted file mode 100644 -index 8184f153ca..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_Samples.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_Samples.md -deleted file mode 100644 -index f21d200567..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_XcodeGuide.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_6_XcodeGuide.md -deleted file mode 100644 -index bf24bf51bf..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_AdvancedGuide.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_AdvancedGuide.md -deleted file mode 100644 -index dd4af8f366..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_Documentation.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_Documentation.md -deleted file mode 100644 -index 282697a50b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_FAQ.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_FAQ.md -deleted file mode 100644 -index 3dd914dcf1..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_Primer.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_Primer.md -deleted file mode 100644 -index b1827c7355..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_PumpManual.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_PumpManual.md -deleted file mode 100644 -index 8184f153ca..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_Samples.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_Samples.md -deleted file mode 100644 -index f21d200567..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_XcodeGuide.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/V1_7_XcodeGuide.md -deleted file mode 100644 -index bf24bf51bf..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/XcodeGuide.md b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/docs/XcodeGuide.md -deleted file mode 100644 -index bf24bf51bf..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-death-test.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-death-test.h -deleted file mode 100644 -index 957a69c6a9..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-message.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-message.h -deleted file mode 100644 -index fe879bca79..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-param-test.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-param-test.h -deleted file mode 100644 -index 038f9ba79e..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-param-test.h.pump b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-param-test.h.pump -deleted file mode 100644 -index 3078d6d2a1..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-printers.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-printers.h -deleted file mode 100644 -index 8a33164cb3..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-spi.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-spi.h -deleted file mode 100644 -index f63fa9a1b2..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-test-part.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-test-part.h -deleted file mode 100644 -index 77eb844839..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-typed-test.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest-typed-test.h -deleted file mode 100644 -index 5f69d5678e..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest.h -deleted file mode 100644 -index f846c5bd66..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest_pred_impl.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest_pred_impl.h -deleted file mode 100644 -index 30ae712f50..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest_prod.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/gtest_prod.h -deleted file mode 100644 -index da80ddc6c7..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/custom/gtest-port.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/custom/gtest-port.h -deleted file mode 100644 -index 7e744bd3bb..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/custom/gtest-printers.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/custom/gtest-printers.h -deleted file mode 100644 -index 60c1ea050b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/custom/gtest.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/custom/gtest.h -deleted file mode 100644 -index c27412a898..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-death-test-internal.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-death-test-internal.h -deleted file mode 100644 -index 2b3a78f5bf..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-filepath.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-filepath.h -deleted file mode 100644 -index 7a13b4b0de..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-internal.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-internal.h -deleted file mode 100644 -index ebd1cf615d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-linked_ptr.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-linked_ptr.h -deleted file mode 100644 -index 3602942217..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-param-util-generated.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-param-util-generated.h -deleted file mode 100644 -index 4d1d81d20f..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-param-util-generated.h.pump b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-param-util-generated.h.pump -deleted file mode 100644 -index 5c7c47af0b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-param-util.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-param-util.h -deleted file mode 100644 -index 82cab9b020..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-port-arch.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-port-arch.h -deleted file mode 100644 -index 74ab949057..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-port.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-port.h -deleted file mode 100644 -index 0094ed5077..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-string.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-string.h -deleted file mode 100644 -index 97f1a7fdd2..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-tuple.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-tuple.h -deleted file mode 100644 -index e9b405340a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-tuple.h.pump b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-tuple.h.pump -deleted file mode 100644 -index 429ddfeeca..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-type-util.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-type-util.h -deleted file mode 100644 -index e46f7cfcb4..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-type-util.h.pump b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/include/gtest/internal/gtest-type-util.h.pump -deleted file mode 100644 -index 251fdf025b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/m4/acx_pthread.m4 b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/m4/acx_pthread.m4 -deleted file mode 100644 -index 2cf20de144..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/m4/gtest.m4 b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/m4/gtest.m4 -deleted file mode 100644 -index 6598ba75a4..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/prime_tables.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/prime_tables.h -deleted file mode 100644 -index 92ce16a014..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample1.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample1.cc -deleted file mode 100644 -index f171e2609d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample1.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample1.h -deleted file mode 100644 -index 3dfeb98c45..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample10_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample10_unittest.cc -deleted file mode 100644 -index 0051cd5dcd..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample1_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample1_unittest.cc -deleted file mode 100644 -index aefc4f1d86..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample2.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample2.cc -deleted file mode 100644 -index 5f763b9bdf..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample2.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample2.h -deleted file mode 100644 -index cb485c70fb..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample2_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample2_unittest.cc -deleted file mode 100644 -index 4fa19b71c7..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample3-inl.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample3-inl.h -deleted file mode 100644 -index 7e3084d638..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample3_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample3_unittest.cc -deleted file mode 100644 -index bf3877d013..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample4.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample4.cc -deleted file mode 100644 -index ae44bda6f1..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample4.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample4.h -deleted file mode 100644 -index cd60f0dd2d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample4_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample4_unittest.cc -deleted file mode 100644 -index fa5afc7d5a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample5_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample5_unittest.cc -deleted file mode 100644 -index 43d8e57775..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample6_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample6_unittest.cc -deleted file mode 100644 -index 8f2036a516..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample7_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample7_unittest.cc -deleted file mode 100644 -index 1b651a21d6..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample8_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample8_unittest.cc -deleted file mode 100644 -index 7274334067..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample9_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/samples/sample9_unittest.cc -deleted file mode 100644 -index b2e2079bf3..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/common.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/common.py -deleted file mode 100644 -index 3c0347a75b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/fuse_gtest_files.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/fuse_gtest_files.py +index 8d24f28..0000000 +diff --git a/test/gtest-1.11.0/googletest/scripts/run_with_path.py b/test/gtest-1.11.0/googletest/scripts/run_with_path.py deleted file mode 100755 -index 3f3e9f36d6..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/gen_gtest_pred_impl.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/gen_gtest_pred_impl.py +index d46ab4d..0000000 +diff --git a/test/gtest-1.11.0/googletest/scripts/upload.py b/test/gtest-1.11.0/googletest/scripts/upload.py deleted file mode 100755 -index 3e7ab042ea..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/gtest-config.in b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/gtest-config.in +index eba5711..0000000 +diff --git a/test/gtest-1.11.0/googletest/scripts/upload_gtest.py b/test/gtest-1.11.0/googletest/scripts/upload_gtest.py deleted file mode 100755 -index 780f8432ef..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/pump.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/pump.py +index be19ae8..0000000 +diff --git a/test/gtest-1.11.0/googletest/src/gtest-all.cc b/test/gtest-1.11.0/googletest/src/gtest-all.cc +deleted file mode 100644 +index ad29290..0000000 +diff --git a/test/gtest-1.11.0/googletest/src/gtest-death-test.cc b/test/gtest-1.11.0/googletest/src/gtest-death-test.cc +deleted file mode 100644 +index bf4f633..0000000 +diff --git a/test/gtest-1.11.0/googletest/src/gtest-filepath.cc b/test/gtest-1.11.0/googletest/src/gtest-filepath.cc +deleted file mode 100644 +index 0b56294..0000000 +diff --git a/test/gtest-1.11.0/googletest/src/gtest-internal-inl.h b/test/gtest-1.11.0/googletest/src/gtest-internal-inl.h +deleted file mode 100644 +index 6d8cecb..0000000 +diff --git a/test/gtest-1.11.0/googletest/src/gtest-matchers.cc b/test/gtest-1.11.0/googletest/src/gtest-matchers.cc +deleted file mode 100644 +index 65104eb..0000000 +diff --git a/test/gtest-1.11.0/googletest/src/gtest-port.cc b/test/gtest-1.11.0/googletest/src/gtest-port.cc +deleted file mode 100644 +index 53a4d37..0000000 +diff --git a/test/gtest-1.11.0/googletest/src/gtest-printers.cc b/test/gtest-1.11.0/googletest/src/gtest-printers.cc +deleted file mode 100644 +index 1b68fcb..0000000 +diff --git a/test/gtest-1.11.0/googletest/src/gtest-test-part.cc b/test/gtest-1.11.0/googletest/src/gtest-test-part.cc +deleted file mode 100644 +index a938683..0000000 +diff --git a/test/gtest-1.11.0/googletest/src/gtest-typed-test.cc b/test/gtest-1.11.0/googletest/src/gtest-typed-test.cc +deleted file mode 100644 +index c02c3df..0000000 +diff --git a/test/gtest-1.11.0/googletest/src/gtest.cc b/test/gtest-1.11.0/googletest/src/gtest.cc +deleted file mode 100644 +index 21c611a..0000000 +diff --git a/test/gtest-1.11.0/googletest/src/gtest_main.cc b/test/gtest-1.11.0/googletest/src/gtest_main.cc +deleted file mode 100644 +index 46b27c3..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/BUILD.bazel b/test/gtest-1.11.0/googletest/test/BUILD.bazel +deleted file mode 100644 +index b06a00a..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-break-on-failure-unittest.py b/test/gtest-1.11.0/googletest/test/googletest-break-on-failure-unittest.py deleted file mode 100755 -index 5efb653c20..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/release_docs.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/release_docs.py +index a5dfbc6..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-break-on-failure-unittest_.cc b/test/gtest-1.11.0/googletest/test/googletest-break-on-failure-unittest_.cc +deleted file mode 100644 +index f84957a..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-catch-exceptions-test.py b/test/gtest-1.11.0/googletest/test/googletest-catch-exceptions-test.py deleted file mode 100755 -index 1291347f67..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/upload.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/upload.py +index 94a5b33..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-catch-exceptions-test_.cc b/test/gtest-1.11.0/googletest/test/googletest-catch-exceptions-test_.cc +deleted file mode 100644 +index 8c127d4..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-color-test.py b/test/gtest-1.11.0/googletest/test/googletest-color-test.py deleted file mode 100755 -index 6e6f9a1471..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/upload_gtest.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/scripts/upload_gtest.py +index f3b7c99..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-color-test_.cc b/test/gtest-1.11.0/googletest/test/googletest-color-test_.cc +deleted file mode 100644 +index 220a3a0..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-death-test-test.cc b/test/gtest-1.11.0/googletest/test/googletest-death-test-test.cc +deleted file mode 100644 +index c0b3d1f..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-death-test_ex_test.cc b/test/gtest-1.11.0/googletest/test/googletest-death-test_ex_test.cc +deleted file mode 100644 +index 7219680..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-env-var-test.py b/test/gtest-1.11.0/googletest/test/googletest-env-var-test.py deleted file mode 100755 -index be19ae8091..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-all.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-all.cc +index 02c3655..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-env-var-test_.cc b/test/gtest-1.11.0/googletest/test/googletest-env-var-test_.cc deleted file mode 100644 -index 0a9cee5223..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-death-test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-death-test.cc -deleted file mode 100644 -index a01a369830..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-filepath.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-filepath.cc -deleted file mode 100644 -index 0292dc1195..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-internal-inl.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-internal-inl.h -deleted file mode 100644 -index ed8a682a96..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-port.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-port.cc -deleted file mode 100644 -index e5bf3dd2be..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-printers.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-printers.cc -deleted file mode 100644 -index a2df412f8a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-test-part.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-test-part.cc -deleted file mode 100644 -index fb0e35425e..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-typed-test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest-typed-test.cc -deleted file mode 100644 -index df1eef4754..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest.cc -deleted file mode 100644 -index d882ab2e36..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest_main.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/src/gtest_main.cc -deleted file mode 100644 -index f302822552..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-death-test_ex_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-death-test_ex_test.cc -deleted file mode 100644 -index b50a13d5e2..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-death-test_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-death-test_test.cc -deleted file mode 100644 -index bb4a3d1b38..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-filepath_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-filepath_test.cc -deleted file mode 100644 -index da72986926..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-linked_ptr_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-linked_ptr_test.cc -deleted file mode 100644 -index 6fcf5124a8..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-listener_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-listener_test.cc -deleted file mode 100644 -index 90747685f0..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-message_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-message_test.cc -deleted file mode 100644 -index 175238ef4e..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-options_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-options_test.cc -deleted file mode 100644 -index 5586dc3b1b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-param-test2_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-param-test2_test.cc -deleted file mode 100644 -index 4a782fe708..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-param-test_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-param-test_test.cc -deleted file mode 100644 -index 8b278bb94b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-param-test_test.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-param-test_test.h -deleted file mode 100644 -index 26ea122b10..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-port_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-port_test.cc -deleted file mode 100644 -index 6ea607bc70..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-printers_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-printers_test.cc -deleted file mode 100644 -index 3e97cc24ab..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-test-part_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-test-part_test.cc -deleted file mode 100644 -index ca8ba933ae..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-tuple_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-tuple_test.cc -deleted file mode 100644 -index bfaa3e0ac4..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-typed-test2_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-typed-test2_test.cc -deleted file mode 100644 -index c284700b02..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-typed-test_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-typed-test_test.cc -deleted file mode 100644 -index 93628ba080..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-typed-test_test.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-typed-test_test.h -deleted file mode 100644 -index 41d75704cf..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-unittest-api_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest-unittest-api_test.cc -deleted file mode 100644 -index b1f51688af..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_all_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_all_test.cc -deleted file mode 100644 -index 955aa62828..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_break_on_failure_unittest.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_break_on_failure_unittest.py +index 52f9586..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-failfast-unittest.py b/test/gtest-1.11.0/googletest/test/googletest-failfast-unittest.py deleted file mode 100755 -index 78f3e0f53b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_break_on_failure_unittest_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_break_on_failure_unittest_.cc +index 3aeb2df..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-failfast-unittest_.cc b/test/gtest-1.11.0/googletest/test/googletest-failfast-unittest_.cc deleted file mode 100644 -index dd07478c07..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_catch_exceptions_test.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_catch_exceptions_test.py +index 0b2c951..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-filepath-test.cc b/test/gtest-1.11.0/googletest/test/googletest-filepath-test.cc +deleted file mode 100644 +index aafad36..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-filter-unittest.py b/test/gtest-1.11.0/googletest/test/googletest-filter-unittest.py deleted file mode 100755 -index e6fc22fd1f..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_catch_exceptions_test_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_catch_exceptions_test_.cc +index 6b32f2d..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-filter-unittest_.cc b/test/gtest-1.11.0/googletest/test/googletest-filter-unittest_.cc deleted file mode 100644 -index d0fc82c998..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_color_test.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_color_test.py +index d30ec9c..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-global-environment-unittest.py b/test/gtest-1.11.0/googletest/test/googletest-global-environment-unittest.py +deleted file mode 100644 +index 32ba628..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-global-environment-unittest_.cc b/test/gtest-1.11.0/googletest/test/googletest-global-environment-unittest_.cc +deleted file mode 100644 +index f401b2f..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-json-outfiles-test.py b/test/gtest-1.11.0/googletest/test/googletest-json-outfiles-test.py +deleted file mode 100644 +index 8ef47b8..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-json-output-unittest.py b/test/gtest-1.11.0/googletest/test/googletest-json-output-unittest.py +deleted file mode 100644 +index 41c8565..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-list-tests-unittest.py b/test/gtest-1.11.0/googletest/test/googletest-list-tests-unittest.py deleted file mode 100755 -index d02a53ed85..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_color_test_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_color_test_.cc +index 81423a3..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-list-tests-unittest_.cc b/test/gtest-1.11.0/googletest/test/googletest-list-tests-unittest_.cc deleted file mode 100644 -index f61ebb89b8..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_env_var_test.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_env_var_test.py +index 493c6f0..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-listener-test.cc b/test/gtest-1.11.0/googletest/test/googletest-listener-test.cc +deleted file mode 100644 +index 10457af..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-message-test.cc b/test/gtest-1.11.0/googletest/test/googletest-message-test.cc +deleted file mode 100644 +index 962d519..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-options-test.cc b/test/gtest-1.11.0/googletest/test/googletest-options-test.cc +deleted file mode 100644 +index 11fb1f2..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-output-test-golden-lin.txt b/test/gtest-1.11.0/googletest/test/googletest-output-test-golden-lin.txt +deleted file mode 100644 +index 3fab3b9..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-output-test.py b/test/gtest-1.11.0/googletest/test/googletest-output-test.py deleted file mode 100755 -index 424075cfa3..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_env_var_test_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_env_var_test_.cc +index 09028f6..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-output-test_.cc b/test/gtest-1.11.0/googletest/test/googletest-output-test_.cc deleted file mode 100644 -index 539afc9683..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_environment_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_environment_test.cc +index 074f64e..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name1-test.py b/test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name1-test.py deleted file mode 100644 -index 3cff19e70e..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_filter_unittest.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_filter_unittest.py +index 2a08477..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name1-test_.cc b/test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name1-test_.cc +deleted file mode 100644 +index 955d699..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name2-test.py b/test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name2-test.py +deleted file mode 100644 +index ab838f4..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name2-test_.cc b/test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name2-test_.cc +deleted file mode 100644 +index 76371df..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-param-test-test.cc b/test/gtest-1.11.0/googletest/test/googletest-param-test-test.cc +deleted file mode 100644 +index 023aa46..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-param-test-test.h b/test/gtest-1.11.0/googletest/test/googletest-param-test-test.h +deleted file mode 100644 +index 8919375..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-param-test2-test.cc b/test/gtest-1.11.0/googletest/test/googletest-param-test2-test.cc +deleted file mode 100644 +index 2a29fb1..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-port-test.cc b/test/gtest-1.11.0/googletest/test/googletest-port-test.cc +deleted file mode 100644 +index 1e0c861..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-printers-test.cc b/test/gtest-1.11.0/googletest/test/googletest-printers-test.cc +deleted file mode 100644 +index e1e8e1c..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-setuptestsuite-test.py b/test/gtest-1.11.0/googletest/test/googletest-setuptestsuite-test.py deleted file mode 100755 -index ec0b151b11..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_filter_unittest_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_filter_unittest_.cc +index c82162f..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-setuptestsuite-test_.cc b/test/gtest-1.11.0/googletest/test/googletest-setuptestsuite-test_.cc deleted file mode 100644 -index 77deffc38f..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_help_test.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_help_test.py +index a4bc4ef..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-shuffle-test.py b/test/gtest-1.11.0/googletest/test/googletest-shuffle-test.py deleted file mode 100755 -index 093c838d9e..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_help_test_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_help_test_.cc +index 573cc5e..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-shuffle-test_.cc b/test/gtest-1.11.0/googletest/test/googletest-shuffle-test_.cc deleted file mode 100644 -index 31f78c2441..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_list_tests_unittest.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_list_tests_unittest.py +index 4505663..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-test-part-test.cc b/test/gtest-1.11.0/googletest/test/googletest-test-part-test.cc +deleted file mode 100644 +index 44cf7ca..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-throw-on-failure-test.py b/test/gtest-1.11.0/googletest/test/googletest-throw-on-failure-test.py deleted file mode 100755 -index f2d2fd1b1c..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_list_tests_unittest_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_list_tests_unittest_.cc +index ea627c4..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-throw-on-failure-test_.cc b/test/gtest-1.11.0/googletest/test/googletest-throw-on-failure-test_.cc deleted file mode 100644 -index 907c176ba9..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_main_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_main_unittest.cc -deleted file mode 100644 -index ecd9bb876f..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_no_test_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_no_test_unittest.cc -deleted file mode 100644 -index 292599af8d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_output_test.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_output_test.py +index 83bb914..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-uninitialized-test.py b/test/gtest-1.11.0/googletest/test/googletest-uninitialized-test.py deleted file mode 100755 -index 06dbee0980..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_output_test_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_output_test_.cc +index 69595a0..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/googletest-uninitialized-test_.cc b/test/gtest-1.11.0/googletest/test/googletest-uninitialized-test_.cc deleted file mode 100644 -index 1070a9f26f..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_output_test_golden_lin.txt b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_output_test_golden_lin.txt +index b4434d5..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest-typed-test2_test.cc b/test/gtest-1.11.0/googletest/test/gtest-typed-test2_test.cc deleted file mode 100644 -index 2223d560e2..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_pred_impl_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_pred_impl_unittest.cc +index e83ca2e..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest-typed-test_test.cc b/test/gtest-1.11.0/googletest/test/gtest-typed-test_test.cc deleted file mode 100644 -index a84eff860a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_premature_exit_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_premature_exit_test.cc +index 5fc678c..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest-typed-test_test.h b/test/gtest-1.11.0/googletest/test/gtest-typed-test_test.h deleted file mode 100644 -index 3b4dc7d43f..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_prod_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_prod_test.cc +index 8ce559c..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest-unittest-api_test.cc b/test/gtest-1.11.0/googletest/test/gtest-unittest-api_test.cc deleted file mode 100644 -index 060abce187..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_repeat_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_repeat_test.cc +index 8ef5058..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_all_test.cc b/test/gtest-1.11.0/googletest/test/gtest_all_test.cc deleted file mode 100644 -index 481012adc2..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_shuffle_test.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_shuffle_test.py +index 615b29b..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_assert_by_exception_test.cc b/test/gtest-1.11.0/googletest/test/gtest_assert_by_exception_test.cc +deleted file mode 100644 +index ada4cb3..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_environment_test.cc b/test/gtest-1.11.0/googletest/test/gtest_environment_test.cc +deleted file mode 100644 +index 064bfc5..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_help_test.py b/test/gtest-1.11.0/googletest/test/gtest_help_test.py deleted file mode 100755 -index 30d0303d19..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_shuffle_test_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_shuffle_test_.cc +index 8d953bb..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_help_test_.cc b/test/gtest-1.11.0/googletest/test/gtest_help_test_.cc deleted file mode 100644 -index 6fb441bd4d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_sole_header_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_sole_header_test.cc +index 750ae6c..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_json_test_utils.py b/test/gtest-1.11.0/googletest/test/gtest_json_test_utils.py deleted file mode 100644 -index ccd091a281..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_stress_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_stress_test.cc +index 62bbfc2..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_list_output_unittest.py b/test/gtest-1.11.0/googletest/test/gtest_list_output_unittest.py deleted file mode 100644 -index e7daa430df..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_test_utils.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_test_utils.py +index a442fc1..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_list_output_unittest_.cc b/test/gtest-1.11.0/googletest/test/gtest_list_output_unittest_.cc +deleted file mode 100644 +index 92b9d4f..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_main_unittest.cc b/test/gtest-1.11.0/googletest/test/gtest_main_unittest.cc +deleted file mode 100644 +index eddedea..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_no_test_unittest.cc b/test/gtest-1.11.0/googletest/test/gtest_no_test_unittest.cc +deleted file mode 100644 +index d4f88db..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_pred_impl_unittest.cc b/test/gtest-1.11.0/googletest/test/gtest_pred_impl_unittest.cc +deleted file mode 100644 +index bbef994..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_premature_exit_test.cc b/test/gtest-1.11.0/googletest/test/gtest_premature_exit_test.cc +deleted file mode 100644 +index 1d1187e..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_prod_test.cc b/test/gtest-1.11.0/googletest/test/gtest_prod_test.cc +deleted file mode 100644 +index ede81a0..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_repeat_test.cc b/test/gtest-1.11.0/googletest/test/gtest_repeat_test.cc +deleted file mode 100644 +index 7da4a15..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_skip_check_output_test.py b/test/gtest-1.11.0/googletest/test/gtest_skip_check_output_test.py deleted file mode 100755 -index 4acd36c975..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_throw_on_failure_ex_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_throw_on_failure_ex_test.cc -deleted file mode 100644 -index 8d46c76f16..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_throw_on_failure_test.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_throw_on_failure_test.py +index 14e63ab..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_skip_environment_check_output_test.py b/test/gtest-1.11.0/googletest/test/gtest_skip_environment_check_output_test.py deleted file mode 100755 -index 3e7740cabb..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_throw_on_failure_test_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_throw_on_failure_test_.cc +index 6e79155..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_skip_in_environment_setup_test.cc b/test/gtest-1.11.0/googletest/test/gtest_skip_in_environment_setup_test.cc deleted file mode 100644 -index 2b88fe3d9b..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_uninitialized_test.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_uninitialized_test.py +index 9372310..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_skip_test.cc b/test/gtest-1.11.0/googletest/test/gtest_skip_test.cc +deleted file mode 100644 +index 4a23004..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_sole_header_test.cc b/test/gtest-1.11.0/googletest/test/gtest_sole_header_test.cc +deleted file mode 100644 +index 1d94ac6..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_stress_test.cc b/test/gtest-1.11.0/googletest/test/gtest_stress_test.cc +deleted file mode 100644 +index 8434819..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_test_macro_stack_footprint_test.cc b/test/gtest-1.11.0/googletest/test/gtest_test_macro_stack_footprint_test.cc +deleted file mode 100644 +index a48db05..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_test_utils.py b/test/gtest-1.11.0/googletest/test/gtest_test_utils.py deleted file mode 100755 -index 4358370097..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_uninitialized_test_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_uninitialized_test_.cc -deleted file mode 100644 -index 44316987fb..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_unittest.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_unittest.cc -deleted file mode 100644 -index 88e94134b9..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_outfile1_test_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_outfile1_test_.cc -deleted file mode 100644 -index 531ced49d4..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_outfile2_test_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_outfile2_test_.cc -deleted file mode 100644 -index 7b400b2760..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_outfiles_test.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_outfiles_test.py +index d0c2446..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_testbridge_test.py b/test/gtest-1.11.0/googletest/test/gtest_testbridge_test.py deleted file mode 100755 -index 524e437e6c..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_output_unittest.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_output_unittest.py +index 87ffad7..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_testbridge_test_.cc b/test/gtest-1.11.0/googletest/test/gtest_testbridge_test_.cc +deleted file mode 100644 +index 24617b2..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_throw_on_failure_ex_test.cc b/test/gtest-1.11.0/googletest/test/gtest_throw_on_failure_ex_test.cc +deleted file mode 100644 +index 1d95adb..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_unittest.cc b/test/gtest-1.11.0/googletest/test/gtest_unittest.cc +deleted file mode 100644 +index 1730e8b..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_xml_outfile1_test_.cc b/test/gtest-1.11.0/googletest/test/gtest_xml_outfile1_test_.cc +deleted file mode 100644 +index 19aa252..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_xml_outfile2_test_.cc b/test/gtest-1.11.0/googletest/test/gtest_xml_outfile2_test_.cc +deleted file mode 100644 +index f9a2a6e..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_xml_outfiles_test.py b/test/gtest-1.11.0/googletest/test/gtest_xml_outfiles_test.py deleted file mode 100755 -index bcd5975991..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_output_unittest_.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_output_unittest_.cc -deleted file mode 100644 -index 48b8771b52..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_test_utils.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/gtest_xml_test_utils.py +index ac66feb..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_xml_output_unittest.py b/test/gtest-1.11.0/googletest/test/gtest_xml_output_unittest.py deleted file mode 100755 -index 341956b54d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/production.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/production.cc +index eade7aa..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_xml_output_unittest_.cc b/test/gtest-1.11.0/googletest/test/gtest_xml_output_unittest_.cc deleted file mode 100644 -index 8b8a40b44e..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/production.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/test/production.h -deleted file mode 100644 -index 98fd5e476c..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/DebugProject.xcconfig b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/DebugProject.xcconfig -deleted file mode 100644 -index 3d68157d5d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/FrameworkTarget.xcconfig b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/FrameworkTarget.xcconfig -deleted file mode 100644 -index 357b1c8fbf..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/General.xcconfig b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/General.xcconfig -deleted file mode 100644 -index f23e322272..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/ReleaseProject.xcconfig b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/ReleaseProject.xcconfig -deleted file mode 100644 -index 5349f0a04a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/StaticLibraryTarget.xcconfig b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/StaticLibraryTarget.xcconfig -deleted file mode 100644 -index 3922fa51d5..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/TestTarget.xcconfig b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Config/TestTarget.xcconfig -deleted file mode 100644 -index e6652ba859..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Resources/Info.plist b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Resources/Info.plist -deleted file mode 100644 -index 9dd28ea148..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/Info.plist b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/Info.plist -deleted file mode 100644 -index f3852edea2..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj -deleted file mode 100644 -index 497617eb68..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/runtests.sh b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/runtests.sh -deleted file mode 100644 -index 4a0d413e52..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/widget.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/widget.cc -deleted file mode 100644 -index bfc4e7fcfd..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/widget.h b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/widget.h -deleted file mode 100644 -index 0c55cdc8cf..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/widget_test.cc b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Samples/FrameworkSample/widget_test.cc -deleted file mode 100644 -index 8725994218..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Scripts/runtests.sh b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Scripts/runtests.sh -deleted file mode 100644 -index 3fc229f1d4..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Scripts/versiongenerate.py b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/Scripts/versiongenerate.py +index c0036aa..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/gtest_xml_test_utils.py b/test/gtest-1.11.0/googletest/test/gtest_xml_test_utils.py deleted file mode 100755 -index 81de8c96ac..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/gtest.xcodeproj/project.pbxproj b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/googletest/xcode/gtest.xcodeproj/project.pbxproj +index ec42c62..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/production.cc b/test/gtest-1.11.0/googletest/test/production.cc deleted file mode 100644 -index aefaa88b05..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/travis.sh b/src/libs/3rdparty/yaml-cpp/test/gtest-1.8.0/travis.sh -deleted file mode 100755 -index bdecbd964d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/handler_test.h b/src/libs/3rdparty/yaml-cpp/test/handler_test.h +index 0f69f6d..0000000 +diff --git a/test/gtest-1.11.0/googletest/test/production.h b/test/gtest-1.11.0/googletest/test/production.h deleted file mode 100644 -index 668a58d01e..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/integration/emitter_test.cpp b/src/libs/3rdparty/yaml-cpp/test/integration/emitter_test.cpp +index 41a5472..0000000 +diff --git a/test/gtest-1.11.0/library.json b/test/gtest-1.11.0/library.json deleted file mode 100644 -index 27808380d5..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/integration/encoding_test.cpp b/src/libs/3rdparty/yaml-cpp/test/integration/encoding_test.cpp +index f61bf00..0000000 +diff --git a/test/handler_test.h b/test/handler_test.h deleted file mode 100644 -index 9bd6586378..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/integration/gen_emitter_test.cpp b/src/libs/3rdparty/yaml-cpp/test/integration/gen_emitter_test.cpp +index 668a58d..0000000 +diff --git a/test/integration/emitter_test.cpp b/test/integration/emitter_test.cpp deleted file mode 100644 -index e44eee6da7..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/integration/handler_spec_test.cpp b/src/libs/3rdparty/yaml-cpp/test/integration/handler_spec_test.cpp +index b277d57..0000000 +diff --git a/test/integration/encoding_test.cpp b/test/integration/encoding_test.cpp deleted file mode 100644 -index d142a0d302..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/integration/handler_test.cpp b/src/libs/3rdparty/yaml-cpp/test/integration/handler_test.cpp +index 9bd6586..0000000 +diff --git a/test/integration/error_messages_test.cpp b/test/integration/error_messages_test.cpp deleted file mode 100644 -index 6011460713..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/integration/load_node_test.cpp b/src/libs/3rdparty/yaml-cpp/test/integration/load_node_test.cpp +index 64ab6b9..0000000 +diff --git a/test/integration/gen_emitter_test.cpp b/test/integration/gen_emitter_test.cpp deleted file mode 100644 -index 02bb8fe58d..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/integration/node_spec_test.cpp b/src/libs/3rdparty/yaml-cpp/test/integration/node_spec_test.cpp +index 3536144..0000000 +diff --git a/test/integration/handler_spec_test.cpp b/test/integration/handler_spec_test.cpp deleted file mode 100644 -index aedf38b2bf..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/main.cpp b/src/libs/3rdparty/yaml-cpp/test/main.cpp +index 8cba902..0000000 +diff --git a/test/integration/handler_test.cpp b/test/integration/handler_test.cpp deleted file mode 100644 -index 443e2dbb3f..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/mock_event_handler.h b/src/libs/3rdparty/yaml-cpp/test/mock_event_handler.h +index 6011460..0000000 +diff --git a/test/integration/load_node_test.cpp b/test/integration/load_node_test.cpp deleted file mode 100644 -index 49d1f0c334..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/node/node_test.cpp b/src/libs/3rdparty/yaml-cpp/test/node/node_test.cpp +index 9d0c790..0000000 +diff --git a/test/integration/node_spec_test.cpp b/test/integration/node_spec_test.cpp deleted file mode 100644 -index 485ad09e1a..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/ostream_wrapper_test.cpp b/src/libs/3rdparty/yaml-cpp/test/ostream_wrapper_test.cpp +index bfc8578..0000000 +diff --git a/test/main.cpp b/test/main.cpp deleted file mode 100644 -index cdc1f05083..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/regex_test.cpp b/src/libs/3rdparty/yaml-cpp/test/regex_test.cpp +index 443e2db..0000000 +diff --git a/test/mock_event_handler.h b/test/mock_event_handler.h deleted file mode 100644 -index 7589d2e4bf..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/test/specexamples.h b/src/libs/3rdparty/yaml-cpp/test/specexamples.h +index 0b7e7da..0000000 +diff --git a/test/node/node_test.cpp b/test/node/node_test.cpp deleted file mode 100644 -index 3c81c77791..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/util/CMakeLists.txt b/src/libs/3rdparty/yaml-cpp/util/CMakeLists.txt +index 5f41ef2..0000000 +diff --git a/test/ostream_wrapper_test.cpp b/test/ostream_wrapper_test.cpp deleted file mode 100644 -index 22866273c7..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/util/api.cpp b/src/libs/3rdparty/yaml-cpp/util/api.cpp +index ff4f635..0000000 +diff --git a/test/parser_test.cpp b/test/parser_test.cpp deleted file mode 100644 -index 8ae5ff2978..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/util/parse.cpp b/src/libs/3rdparty/yaml-cpp/util/parse.cpp +index e5002a4..0000000 +diff --git a/test/regex_test.cpp b/test/regex_test.cpp deleted file mode 100644 -index f3f0279ce5..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/util/read.cpp b/src/libs/3rdparty/yaml-cpp/util/read.cpp +index 658db9e..0000000 +diff --git a/test/specexamples.h b/test/specexamples.h deleted file mode 100644 -index fc88f1f9b9..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/util/sandbox.cpp b/src/libs/3rdparty/yaml-cpp/util/sandbox.cpp +index 46e2c4c..0000000 +diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt deleted file mode 100644 -index 1df25bb242..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/yaml-cpp-config-version.cmake.in b/src/libs/3rdparty/yaml-cpp/yaml-cpp-config-version.cmake.in +index 87ea4f9..0000000 +diff --git a/util/api.cpp b/util/api.cpp deleted file mode 100644 -index 80b9c79add..0000000000 -diff --git a/src/libs/3rdparty/yaml-cpp/yaml-cpp-config.cmake.in b/src/libs/3rdparty/yaml-cpp/yaml-cpp-config.cmake.in +index 8ae5ff2..0000000 +diff --git a/util/parse.cpp b/util/parse.cpp deleted file mode 100644 -index 7b41e3f30c..0000000000 +index ea4295a..0000000 +diff --git a/util/read.cpp b/util/read.cpp +deleted file mode 100644 +index 3455ea3..0000000 +diff --git a/util/sandbox.cpp b/util/sandbox.cpp +deleted file mode 100644 +index f21490e..0000000 +diff --git a/yaml-cpp-config.cmake.in b/yaml-cpp-config.cmake.in +deleted file mode 100644 +index 799b9b4..0000000 +diff --git a/yaml-cpp.pc.in b/yaml-cpp.pc.in +deleted file mode 100644 +index d02dc9e..0000000 -- -2.17.1 +2.42.0 diff --git a/src/libs/3rdparty/yaml-cpp/patches/0002-yaml-cpp-Make-dll.h-compatible-with-fvisibility-hidd.patch b/src/libs/3rdparty/yaml-cpp/patches/0002-yaml-cpp-Make-dll.h-compatible-with-fvisibility-hidd.patch deleted file mode 100644 index 90d684b9c1d..00000000000 --- a/src/libs/3rdparty/yaml-cpp/patches/0002-yaml-cpp-Make-dll.h-compatible-with-fvisibility-hidd.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 72546402c08fc548efb248761870a83e78eb5ea3 Mon Sep 17 00:00:00 2001 -From: Nikolai Kosjar <nikolai.kosjar@qt.io> -Date: Wed, 31 Jul 2019 09:08:55 +0200 -Subject: [PATCH] yaml-cpp: Make dll.h compatible with -fvisibility=hidden - -Change-Id: Ic09ace43e37102294d290768b3a7994c7a6b42c6 ---- - src/libs/3rdparty/yaml-cpp/include/yaml-cpp/dll.h | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/dll.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/dll.h -index a32c06b2e3..897f1533df 100644 ---- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/dll.h -+++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/dll.h -@@ -18,13 +18,22 @@ - - #ifdef YAML_CPP_DLL // Using or Building YAML-CPP DLL (definition defined - // manually) -+ -+#if defined(_WIN32) || defined(WIN32) -+# define YAML_CPP_API_IMPORT __declspec(dllimport) -+# define YAML_CPP_API_EXPORT __declspec(dllexport) -+#else -+# define YAML_CPP_API_IMPORT __attribute__((visibility("default"))) -+# define YAML_CPP_API_EXPORT __attribute__((visibility("default"))) -+#endif -+ - #ifdef yaml_cpp_EXPORTS // Building YAML-CPP DLL (definition created by CMake - // or defined manually) - // #pragma message( "Defining YAML_CPP_API for DLL export" ) --#define YAML_CPP_API __declspec(dllexport) -+#define YAML_CPP_API YAML_CPP_API_EXPORT - #else // yaml_cpp_EXPORTS - // #pragma message( "Defining YAML_CPP_API for DLL import" ) --#define YAML_CPP_API __declspec(dllimport) -+#define YAML_CPP_API YAML_CPP_API_IMPORT - #endif // yaml_cpp_EXPORTS - #else // YAML_CPP_DLL - #define YAML_CPP_API --- -2.17.1 - diff --git a/src/libs/3rdparty/yaml-cpp/patches/0003-yaml-cpp-MSVC-Fix-unknown-override-specifier-for-_NO.patch b/src/libs/3rdparty/yaml-cpp/patches/0003-yaml-cpp-MSVC-Fix-unknown-override-specifier-for-_NO.patch deleted file mode 100644 index ab7929f964e..00000000000 --- a/src/libs/3rdparty/yaml-cpp/patches/0003-yaml-cpp-MSVC-Fix-unknown-override-specifier-for-_NO.patch +++ /dev/null @@ -1,52 +0,0 @@ -From b6f98df7d1ebdd788e7b5029c3884dcf38a6f17d Mon Sep 17 00:00:00 2001 -From: Nikolai Kosjar <nikolai.kosjar@qt.io> -Date: Tue, 27 Aug 2019 12:01:03 +0200 -Subject: [PATCH] yaml-cpp: MSVC: Fix "unknown override specifier" for - _NOEXCEPT - -Change-Id: If07000f7b3e8c4c1b87b683ff9cd29e57d43ab60 ---- - src/libs/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h | 8 +------- - src/libs/3rdparty/yaml-cpp/src/exceptions.cpp | 8 +------- - 2 files changed, 2 insertions(+), 14 deletions(-) - -diff --git a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h -index 9c96859b2c..eae31968b7 100644 ---- a/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h -+++ b/src/libs/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h -@@ -13,13 +13,7 @@ - #include <stdexcept> - #include <string> - --// This is here for compatibility with older versions of Visual Studio --// which don't support noexcept --#ifdef _MSC_VER -- #define YAML_CPP_NOEXCEPT _NOEXCEPT --#else -- #define YAML_CPP_NOEXCEPT noexcept --#endif -+#define YAML_CPP_NOEXCEPT noexcept - - namespace YAML { - // error messages -diff --git a/src/libs/3rdparty/yaml-cpp/src/exceptions.cpp b/src/libs/3rdparty/yaml-cpp/src/exceptions.cpp -index 9b6d8912c1..d5e10b23c1 100644 ---- a/src/libs/3rdparty/yaml-cpp/src/exceptions.cpp -+++ b/src/libs/3rdparty/yaml-cpp/src/exceptions.cpp -@@ -1,12 +1,6 @@ - #include "yaml-cpp/exceptions.h" - --// This is here for compatibility with older versions of Visual Studio --// which don't support noexcept --#ifdef _MSC_VER -- #define YAML_CPP_NOEXCEPT _NOEXCEPT --#else -- #define YAML_CPP_NOEXCEPT noexcept --#endif -+#define YAML_CPP_NOEXCEPT noexcept - - namespace YAML { - --- -2.17.1 - diff --git a/src/libs/3rdparty/yaml-cpp/src/binary.cpp b/src/libs/3rdparty/yaml-cpp/src/binary.cpp index a7e51301b82..d27762a2436 100644 --- a/src/libs/3rdparty/yaml-cpp/src/binary.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/binary.cpp @@ -1,5 +1,7 @@ #include "yaml-cpp/binary.h" +#include <cctype> + namespace YAML { static const char encoding[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -64,7 +66,7 @@ static const unsigned char decoding[] = { }; std::vector<unsigned char> DecodeBase64(const std::string &input) { - typedef std::vector<unsigned char> ret_type; + using ret_type = std::vector<unsigned char>; if (input.empty()) return ret_type(); @@ -72,22 +74,27 @@ std::vector<unsigned char> DecodeBase64(const std::string &input) { unsigned char *out = &ret[0]; unsigned value = 0; - for (std::size_t i = 0; i < input.size(); i++) { - unsigned char d = decoding[static_cast<unsigned>(input[i])]; + for (std::size_t i = 0, cnt = 0; i < input.size(); i++) { + if (std::isspace(static_cast<unsigned char>(input[i]))) { + // skip newlines + continue; + } + unsigned char d = decoding[static_cast<unsigned char>(input[i])]; if (d == 255) return ret_type(); value = (value << 6) | d; - if (i % 4 == 3) { + if (cnt % 4 == 3) { *out++ = value >> 16; if (i > 0 && input[i - 1] != '=') *out++ = value >> 8; if (input[i] != '=') *out++ = value; } + ++cnt; } ret.resize(out - &ret[0]); return ret; } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/collectionstack.h b/src/libs/3rdparty/yaml-cpp/src/collectionstack.h index 2302786e037..9feba967951 100644 --- a/src/libs/3rdparty/yaml-cpp/src/collectionstack.h +++ b/src/libs/3rdparty/yaml-cpp/src/collectionstack.h @@ -7,8 +7,8 @@ #pragma once #endif -#include <stack> #include <cassert> +#include <stack> namespace YAML { struct CollectionType { @@ -17,6 +17,7 @@ struct CollectionType { class CollectionStack { public: + CollectionStack() : collectionStack{} {} CollectionType::value GetCurCollectionType() const { if (collectionStack.empty()) return CollectionType::NoCollection; @@ -28,12 +29,13 @@ class CollectionStack { } void PopCollectionType(CollectionType::value type) { assert(type == GetCurCollectionType()); + (void)type; collectionStack.pop(); } private: std::stack<CollectionType::value> collectionStack; }; -} +} // namespace YAML #endif // COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/src/convert.cpp b/src/libs/3rdparty/yaml-cpp/src/convert.cpp index ec05b77826b..9658b360355 100644 --- a/src/libs/3rdparty/yaml-cpp/src/convert.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/convert.cpp @@ -16,11 +16,7 @@ std::string tolower(const std::string& str) { template <typename T> bool IsEntirely(const std::string& str, T func) { - for (std::size_t i = 0; i < str.size(); i++) - if (!func(str[i])) - return false; - - return true; + return std::all_of(str.begin(), str.end(), [=](char ch) { return func(ch); }); } // IsFlexibleCase @@ -39,7 +35,7 @@ bool IsFlexibleCase(const std::string& str) { std::string rest = str.substr(1); return firstcaps && (IsEntirely(rest, IsLower) || IsEntirely(rest, IsUpper)); } -} +} // namespace namespace YAML { bool convert<bool>::decode(const Node& node, bool& rhs) { @@ -52,19 +48,22 @@ bool convert<bool>::decode(const Node& node, bool& rhs) { static const struct { std::string truename, falsename; } names[] = { - {"y", "n"}, {"yes", "no"}, {"true", "false"}, {"on", "off"}, + {"y", "n"}, + {"yes", "no"}, + {"true", "false"}, + {"on", "off"}, }; if (!IsFlexibleCase(node.Scalar())) return false; - for (unsigned i = 0; i < sizeof(names) / sizeof(names[0]); i++) { - if (names[i].truename == tolower(node.Scalar())) { + for (const auto& name : names) { + if (name.truename == tolower(node.Scalar())) { rhs = true; return true; } - if (names[i].falsename == tolower(node.Scalar())) { + if (name.falsename == tolower(node.Scalar())) { rhs = false; return true; } @@ -72,4 +71,4 @@ bool convert<bool>::decode(const Node& node, bool& rhs) { return false; } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/depthguard.cpp b/src/libs/3rdparty/yaml-cpp/src/depthguard.cpp new file mode 100644 index 00000000000..5bf6cdf03bf --- /dev/null +++ b/src/libs/3rdparty/yaml-cpp/src/depthguard.cpp @@ -0,0 +1,9 @@ +#include "yaml-cpp/depthguard.h" + +namespace YAML { + +DeepRecursion::DeepRecursion(int depth, const Mark& mark_, + const std::string& msg_) + : ParserException(mark_, msg_), m_depth(depth) {} + +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/directives.cpp b/src/libs/3rdparty/yaml-cpp/src/directives.cpp index 963bd2cd379..4c1dc201d7f 100644 --- a/src/libs/3rdparty/yaml-cpp/src/directives.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/directives.cpp @@ -1,16 +1,11 @@ #include "directives.h" namespace YAML { -Directives::Directives() { - // version - version.isDefault = true; - version.major = 1; - version.minor = 2; -} +Directives::Directives() : version{true, 1, 2}, tags{} {} -const std::string Directives::TranslateTagHandle( +std::string Directives::TranslateTagHandle( const std::string& handle) const { - std::map<std::string, std::string>::const_iterator it = tags.find(handle); + auto it = tags.find(handle); if (it == tags.end()) { if (handle == "!!") return "tag:yaml.org,2002:"; @@ -19,4 +14,4 @@ const std::string Directives::TranslateTagHandle( return it->second; } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/directives.h b/src/libs/3rdparty/yaml-cpp/src/directives.h index 333af26e374..18d14c9c0b7 100644 --- a/src/libs/3rdparty/yaml-cpp/src/directives.h +++ b/src/libs/3rdparty/yaml-cpp/src/directives.h @@ -19,7 +19,7 @@ struct Version { struct Directives { Directives(); - const std::string TranslateTagHandle(const std::string& handle) const; + std::string TranslateTagHandle(const std::string& handle) const; Version version; std::map<std::string, std::string> tags; diff --git a/src/libs/3rdparty/yaml-cpp/src/emit.cpp b/src/libs/3rdparty/yaml-cpp/src/emit.cpp index 51bc791533d..b0efb8401cc 100644 --- a/src/libs/3rdparty/yaml-cpp/src/emit.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/emit.cpp @@ -1,7 +1,7 @@ #include "yaml-cpp/node/emit.h" +#include "nodeevents.h" #include "yaml-cpp/emitfromevents.h" #include "yaml-cpp/emitter.h" -#include "nodeevents.h" namespace YAML { Emitter& operator<<(Emitter& out, const Node& node) { diff --git a/src/libs/3rdparty/yaml-cpp/src/emitfromevents.cpp b/src/libs/3rdparty/yaml-cpp/src/emitfromevents.cpp index 4832649f3c7..2e97187b900 100644 --- a/src/libs/3rdparty/yaml-cpp/src/emitfromevents.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/emitfromevents.cpp @@ -16,10 +16,11 @@ std::string ToString(YAML::anchor_t anchor) { stream << anchor; return stream.str(); } -} +} // namespace namespace YAML { -EmitFromEvents::EmitFromEvents(Emitter& emitter) : m_emitter(emitter) {} +EmitFromEvents::EmitFromEvents(Emitter& emitter) + : m_emitter(emitter), m_stateStack{} {} void EmitFromEvents::OnDocumentStart(const Mark&) {} @@ -58,6 +59,8 @@ void EmitFromEvents::OnSequenceStart(const Mark&, const std::string& tag, default: break; } + // Restore the global settings to eliminate the override from node style + m_emitter.RestoreGlobalModifiedSettings(); m_emitter << BeginSeq; m_stateStack.push(State::WaitingForSequenceEntry); } @@ -82,6 +85,8 @@ void EmitFromEvents::OnMapStart(const Mark&, const std::string& tag, default: break; } + // Restore the global settings to eliminate the override from node style + m_emitter.RestoreGlobalModifiedSettings(); m_emitter << BeginMap; m_stateStack.push(State::WaitingForKey); } @@ -116,4 +121,4 @@ void EmitFromEvents::EmitProps(const std::string& tag, anchor_t anchor) { if (anchor) m_emitter << Anchor(ToString(anchor)); } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/emitter.cpp b/src/libs/3rdparty/yaml-cpp/src/emitter.cpp index ebeb059554e..4d483075bde 100644 --- a/src/libs/3rdparty/yaml-cpp/src/emitter.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/emitter.cpp @@ -11,12 +11,12 @@ namespace YAML { class Binary; struct _Null; -Emitter::Emitter() : m_pState(new EmitterState) {} +Emitter::Emitter() : m_pState(new EmitterState), m_stream{} {} Emitter::Emitter(std::ostream& stream) : m_pState(new EmitterState), m_stream(stream) {} -Emitter::~Emitter() {} +Emitter::~Emitter() = default; const char* Emitter::c_str() const { return m_stream.str(); } @@ -49,6 +49,10 @@ bool Emitter::SetBoolFormat(EMITTER_MANIP value) { return ok; } +bool Emitter::SetNullFormat(EMITTER_MANIP value) { + return m_pState->SetNullFormat(value, FmtScope::Global); +} + bool Emitter::SetIntBase(EMITTER_MANIP value) { return m_pState->SetIntFormat(value, FmtScope::Global); } @@ -86,6 +90,10 @@ bool Emitter::SetDoublePrecision(std::size_t n) { return m_pState->SetDoublePrecision(n, FmtScope::Global); } +void Emitter::RestoreGlobalModifiedSettings() { + m_pState->RestoreGlobalModifiedSettings(); +} + // SetLocalValue // . Either start/end a group, or set a modifier locally Emitter& Emitter::SetLocalValue(EMITTER_MANIP value) { @@ -197,6 +205,7 @@ void Emitter::EmitBeginSeq() { void Emitter::EmitEndSeq() { if (!good()) return; + FlowType::value originalType = m_pState->CurGroupFlowType(); if (m_pState->CurGroupChildCount() == 0) m_pState->ForceFlow(); @@ -205,8 +214,12 @@ void Emitter::EmitEndSeq() { if (m_stream.comment()) m_stream << "\n"; m_stream << IndentTo(m_pState->CurIndent()); - if (m_pState->CurGroupChildCount() == 0) + if (originalType == FlowType::Block) { m_stream << "["; + } else { + if (m_pState->CurGroupChildCount() == 0 && !m_pState->HasBegunNode()) + m_stream << "["; + } m_stream << "]"; } @@ -227,6 +240,7 @@ void Emitter::EmitBeginMap() { void Emitter::EmitEndMap() { if (!good()) return; + FlowType::value originalType = m_pState->CurGroupFlowType(); if (m_pState->CurGroupChildCount() == 0) m_pState->ForceFlow(); @@ -235,8 +249,12 @@ void Emitter::EmitEndMap() { if (m_stream.comment()) m_stream << "\n"; m_stream << IndentTo(m_pState->CurIndent()); - if (m_pState->CurGroupChildCount() == 0) + if (originalType == FlowType::Block) { m_stream << "{"; + } else { + if (m_pState->CurGroupChildCount() == 0 && !m_pState->HasBegunNode()) + m_stream << "{"; + } m_stream << "}"; } @@ -285,10 +303,8 @@ void Emitter::PrepareTopNode(EmitterNodeType::value child) { if (child == EmitterNodeType::NoType) return; - if (m_pState->CurGroupChildCount() > 0 && m_stream.col() > 0) { - if (child != EmitterNodeType::NoType) - EmitBeginDoc(); - } + if (m_pState->CurGroupChildCount() > 0 && m_stream.col() > 0) + EmitBeginDoc(); switch (child) { case EmitterNodeType::NoType: @@ -488,6 +504,9 @@ void Emitter::FlowMapPrepareSimpleKeyValue(EmitterNodeType::value child) { if (m_stream.comment()) m_stream << "\n"; m_stream << IndentTo(lastIndent); + if (m_pState->HasAlias()) { + m_stream << " "; + } m_stream << ":"; } @@ -514,7 +533,8 @@ void Emitter::BlockMapPrepareNode(EmitterNodeType::value child) { if (m_pState->GetMapKeyFormat() == LongKey) m_pState->SetLongKey(); if (child == EmitterNodeType::BlockSeq || - child == EmitterNodeType::BlockMap) + child == EmitterNodeType::BlockMap || + child == EmitterNodeType::Property) m_pState->SetLongKey(); if (m_pState->CurGroupLongKey()) @@ -558,6 +578,8 @@ void Emitter::BlockMapPrepareLongKey(EmitterNodeType::value child) { break; case EmitterNodeType::BlockSeq: case EmitterNodeType::BlockMap: + if (m_pState->HasBegunContent()) + m_stream << "\n"; break; } } @@ -581,8 +603,12 @@ void Emitter::BlockMapPrepareLongKeyValue(EmitterNodeType::value child) { case EmitterNodeType::Scalar: case EmitterNodeType::FlowSeq: case EmitterNodeType::FlowMap: + SpaceOrIndentTo(true, curIndent + 1); + break; case EmitterNodeType::BlockSeq: case EmitterNodeType::BlockMap: + if (m_pState->HasBegunContent()) + m_stream << "\n"; SpaceOrIndentTo(true, curIndent + 1); break; } @@ -621,6 +647,9 @@ void Emitter::BlockMapPrepareSimpleKeyValue(EmitterNodeType::value child) { const std::size_t nextIndent = curIndent + m_pState->CurGroupIndent(); if (!m_pState->HasBegunNode()) { + if (m_pState->HasAlias()) { + m_stream << " "; + } m_stream << ":"; } @@ -674,16 +703,29 @@ void Emitter::StartedScalar() { m_pState->StartedScalar(); } // ******************************************************************************************* // overloads of Write +StringEscaping::value GetStringEscapingStyle(const EMITTER_MANIP emitterManip) { + switch (emitterManip) { + case EscapeNonAscii: + return StringEscaping::NonAscii; + case EscapeAsJson: + return StringEscaping::JSON; + default: + return StringEscaping::None; + break; + } +} + Emitter& Emitter::Write(const std::string& str) { if (!good()) return *this; - const bool escapeNonAscii = m_pState->GetOutputCharset() == EscapeNonAscii; + StringEscaping::value stringEscaping = GetStringEscapingStyle(m_pState->GetOutputCharset()); + const StringFormat::value strFormat = Utils::ComputeStringFormat(str, m_pState->GetStringFormat(), - m_pState->CurGroupFlowType(), escapeNonAscii); + m_pState->CurGroupFlowType(), stringEscaping == StringEscaping::NonAscii); - if (strFormat == StringFormat::Literal) + if (strFormat == StringFormat::Literal || str.size() > 1024) m_pState->SetMapKeyFormat(YAML::LongKey, FmtScope::Local); PrepareNode(EmitterNodeType::Scalar); @@ -696,7 +738,7 @@ Emitter& Emitter::Write(const std::string& str) { Utils::WriteSingleQuotedString(m_stream, str); break; case StringFormat::DoubleQuoted: - Utils::WriteDoubleQuotedString(m_stream, str, escapeNonAscii); + Utils::WriteDoubleQuotedString(m_stream, str, stringEscaping); break; case StringFormat::Literal: Utils::WriteLiteralString(m_stream, str, @@ -766,6 +808,21 @@ const char* Emitter::ComputeFullBoolName(bool b) const { // these answers } +const char* Emitter::ComputeNullName() const { + switch (m_pState->GetNullFormat()) { + case LowerNull: + return "null"; + case UpperNull: + return "NULL"; + case CamelNull: + return "Null"; + case TildeNull: + // fallthrough + default: + return "~"; + } +} + Emitter& Emitter::Write(bool b) { if (!good()) return *this; @@ -787,8 +844,10 @@ Emitter& Emitter::Write(char ch) { if (!good()) return *this; + + PrepareNode(EmitterNodeType::Scalar); - Utils::WriteChar(m_stream, ch); + Utils::WriteChar(m_stream, ch, GetStringEscapingStyle(m_pState->GetOutputCharset())); StartedScalar(); return *this; @@ -812,6 +871,8 @@ Emitter& Emitter::Write(const _Alias& alias) { StartedScalar(); + m_pState->SetAlias(); + return *this; } @@ -889,7 +950,7 @@ Emitter& Emitter::Write(const _Null& /*null*/) { PrepareNode(EmitterNodeType::Scalar); - m_stream << "~"; + m_stream << ComputeNullName(); StartedScalar(); @@ -908,4 +969,4 @@ Emitter& Emitter::Write(const Binary& binary) { return *this; } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/emitterstate.cpp b/src/libs/3rdparty/yaml-cpp/src/emitterstate.cpp index 3542aaf5071..3dbe4011084 100644 --- a/src/libs/3rdparty/yaml-cpp/src/emitterstate.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/emitterstate.cpp @@ -6,29 +6,35 @@ namespace YAML { EmitterState::EmitterState() : m_isGood(true), + m_lastError{}, + // default global manipulators + m_charset(EmitNonAscii), + m_strFmt(Auto), + m_boolFmt(TrueFalseBool), + m_boolLengthFmt(LongBool), + m_boolCaseFmt(LowerCase), + m_nullFmt(TildeNull), + m_intFmt(Dec), + m_indent(2), + m_preCommentIndent(2), + m_postCommentIndent(1), + m_seqFmt(Block), + m_mapFmt(Block), + m_mapKeyFmt(Auto), + m_floatPrecision(std::numeric_limits<float>::max_digits10), + m_doublePrecision(std::numeric_limits<double>::max_digits10), + // + m_modifiedSettings{}, + m_globalModifiedSettings{}, + m_groups{}, m_curIndent(0), m_hasAnchor(false), + m_hasAlias(false), m_hasTag(false), m_hasNonContent(false), - m_docCount(0) { - // set default global manipulators - m_charset.set(EmitNonAscii); - m_strFmt.set(Auto); - m_boolFmt.set(TrueFalseBool); - m_boolLengthFmt.set(LongBool); - m_boolCaseFmt.set(LowerCase); - m_intFmt.set(Dec); - m_indent.set(2); - m_preCommentIndent.set(2); - m_postCommentIndent.set(1); - m_seqFmt.set(Block); - m_mapFmt.set(Block); - m_mapKeyFmt.set(Auto); - m_floatPrecision.set(std::numeric_limits<float>::digits10 + 1); - m_doublePrecision.set(std::numeric_limits<double>::digits10 + 1); -} + m_docCount(0) {} -EmitterState::~EmitterState() {} +EmitterState::~EmitterState() = default; // SetLocalValue // . We blindly tries to set all possible formatters to this value @@ -39,6 +45,7 @@ void EmitterState::SetLocalValue(EMITTER_MANIP value) { SetBoolFormat(value, FmtScope::Local); SetBoolCaseFormat(value, FmtScope::Local); SetBoolLengthFormat(value, FmtScope::Local); + SetNullFormat(value, FmtScope::Local); SetIntFormat(value, FmtScope::Local); SetFlowType(GroupType::Seq, value, FmtScope::Local); SetFlowType(GroupType::Map, value, FmtScope::Local); @@ -47,6 +54,8 @@ void EmitterState::SetLocalValue(EMITTER_MANIP value) { void EmitterState::SetAnchor() { m_hasAnchor = true; } +void EmitterState::SetAlias() { m_hasAlias = true; } + void EmitterState::SetTag() { m_hasTag = true; } void EmitterState::SetNonContent() { m_hasNonContent = true; } @@ -81,6 +90,7 @@ void EmitterState::StartedNode() { } m_hasAnchor = false; + m_hasAlias = false; m_hasTag = false; m_hasNonContent = false; } @@ -90,15 +100,13 @@ EmitterNodeType::value EmitterState::NextGroupType( if (type == GroupType::Seq) { if (GetFlowType(type) == Block) return EmitterNodeType::BlockSeq; - else - return EmitterNodeType::FlowSeq; - } else { - if (GetFlowType(type) == Block) - return EmitterNodeType::BlockMap; - else - return EmitterNodeType::FlowMap; + return EmitterNodeType::FlowSeq; } + if (GetFlowType(type) == Block) + return EmitterNodeType::BlockMap; + return EmitterNodeType::FlowMap; + // can't happen assert(false); return EmitterNodeType::NoType; @@ -152,9 +160,15 @@ void EmitterState::EndedGroup(GroupType::value type) { if (m_groups.empty()) { if (type == GroupType::Seq) { return SetError(ErrorMsg::UNEXPECTED_END_SEQ); - } else { - return SetError(ErrorMsg::UNEXPECTED_END_MAP); } + return SetError(ErrorMsg::UNEXPECTED_END_MAP); + } + + if (m_hasTag) { + SetError(ErrorMsg::INVALID_TAG); + } + if (m_hasAnchor) { + SetError(ErrorMsg::INVALID_ANCHOR); } // get rid of the current group @@ -176,6 +190,9 @@ void EmitterState::EndedGroup(GroupType::value type) { m_globalModifiedSettings.restore(); ClearModifiedSettings(); + m_hasAnchor = false; + m_hasTag = false; + m_hasNonContent = false; } EmitterNodeType::value EmitterState::CurGroupNodeType() const { @@ -216,11 +233,16 @@ std::size_t EmitterState::LastIndent() const { void EmitterState::ClearModifiedSettings() { m_modifiedSettings.clear(); } +void EmitterState::RestoreGlobalModifiedSettings() { + m_globalModifiedSettings.restore(); +} + bool EmitterState::SetOutputCharset(EMITTER_MANIP value, FmtScope::value scope) { switch (value) { case EmitNonAscii: case EscapeNonAscii: + case EscapeAsJson: _Set(m_charset, value, scope); return true; default: @@ -278,6 +300,19 @@ bool EmitterState::SetBoolCaseFormat(EMITTER_MANIP value, } } +bool EmitterState::SetNullFormat(EMITTER_MANIP value, FmtScope::value scope) { + switch (value) { + case LowerNull: + case UpperNull: + case CamelNull: + case TildeNull: + _Set(m_nullFmt, value, scope); + return true; + default: + return false; + } +} + bool EmitterState::SetIntFormat(EMITTER_MANIP value, FmtScope::value scope) { switch (value) { case Dec: @@ -349,7 +384,7 @@ bool EmitterState::SetMapKeyFormat(EMITTER_MANIP value, FmtScope::value scope) { } bool EmitterState::SetFloatPrecision(std::size_t value, FmtScope::value scope) { - if (value > std::numeric_limits<float>::digits10 + 1) + if (value > std::numeric_limits<float>::max_digits10) return false; _Set(m_floatPrecision, value, scope); return true; @@ -357,9 +392,9 @@ bool EmitterState::SetFloatPrecision(std::size_t value, FmtScope::value scope) { bool EmitterState::SetDoublePrecision(std::size_t value, FmtScope::value scope) { - if (value > std::numeric_limits<double>::digits10 + 1) + if (value > std::numeric_limits<double>::max_digits10) return false; _Set(m_doublePrecision, value, scope); return true; } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/emitterstate.h b/src/libs/3rdparty/yaml-cpp/src/emitterstate.h index 0937f000d9f..8f379ca9524 100644 --- a/src/libs/3rdparty/yaml-cpp/src/emitterstate.h +++ b/src/libs/3rdparty/yaml-cpp/src/emitterstate.h @@ -43,6 +43,7 @@ class EmitterState { // node handling void SetAnchor(); + void SetAlias(); void SetTag(); void SetNonContent(); void SetLongKey(); @@ -65,6 +66,7 @@ class EmitterState { std::size_t LastIndent() const; std::size_t CurIndent() const { return m_curIndent; } bool HasAnchor() const { return m_hasAnchor; } + bool HasAlias() const { return m_hasAlias; } bool HasTag() const { return m_hasTag; } bool HasBegunNode() const { return m_hasAnchor || m_hasTag || m_hasNonContent; @@ -72,6 +74,7 @@ class EmitterState { bool HasBegunContent() const { return m_hasAnchor || m_hasTag; } void ClearModifiedSettings(); + void RestoreGlobalModifiedSettings(); // formatters void SetLocalValue(EMITTER_MANIP value); @@ -91,6 +94,9 @@ class EmitterState { bool SetBoolCaseFormat(EMITTER_MANIP value, FmtScope::value scope); EMITTER_MANIP GetBoolCaseFormat() const { return m_boolCaseFmt.get(); } + bool SetNullFormat(EMITTER_MANIP value, FmtScope::value scope); + EMITTER_MANIP GetNullFormat() const { return m_nullFmt.get(); } + bool SetIntFormat(EMITTER_MANIP value, FmtScope::value scope); EMITTER_MANIP GetIntFormat() const { return m_intFmt.get(); } @@ -131,6 +137,7 @@ class EmitterState { Setting<EMITTER_MANIP> m_boolFmt; Setting<EMITTER_MANIP> m_boolLengthFmt; Setting<EMITTER_MANIP> m_boolCaseFmt; + Setting<EMITTER_MANIP> m_nullFmt; Setting<EMITTER_MANIP> m_intFmt; Setting<std::size_t> m_indent; Setting<std::size_t> m_preCommentIndent, m_postCommentIndent; @@ -145,7 +152,12 @@ class EmitterState { struct Group { explicit Group(GroupType::value type_) - : type(type_), indent(0), childCount(0), longKey(false) {} + : type(type_), + flowType{}, + indent(0), + childCount(0), + longKey(false), + modifiedSettings{} {} GroupType::value type; FlowType::value flowType; @@ -177,6 +189,7 @@ class EmitterState { std::vector<std::unique_ptr<Group>> m_groups; std::size_t m_curIndent; bool m_hasAnchor; + bool m_hasAlias; bool m_hasTag; bool m_hasNonContent; std::size_t m_docCount; @@ -198,6 +211,6 @@ void EmitterState::_Set(Setting<T>& fmt, T value, FmtScope::value scope) { assert(false); } } -} +} // namespace YAML #endif // EMITTERSTATE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/src/emitterutils.cpp b/src/libs/3rdparty/yaml-cpp/src/emitterutils.cpp index 147738ad8a1..6cdf6de7e29 100644 --- a/src/libs/3rdparty/yaml-cpp/src/emitterutils.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/emitterutils.cpp @@ -1,3 +1,4 @@ +#include <algorithm> #include <iomanip> #include <sstream> @@ -8,8 +9,8 @@ #include "regeximpl.h" #include "stringsource.h" #include "yaml-cpp/binary.h" // IWYU pragma: keep -#include "yaml-cpp/ostream_wrapper.h" #include "yaml-cpp/null.h" +#include "yaml-cpp/ostream_wrapper.h" namespace YAML { namespace Utils { @@ -134,12 +135,12 @@ void WriteCodePoint(ostream_wrapper& out, int codePoint) { if (codePoint < 0 || codePoint > 0x10FFFF) { codePoint = REPLACEMENT_CHARACTER; } - if (codePoint < 0x7F) { + if (codePoint <= 0x7F) { out << static_cast<char>(codePoint); - } else if (codePoint < 0x7FF) { + } else if (codePoint <= 0x7FF) { out << static_cast<char>(0xC0 | (codePoint >> 6)) << static_cast<char>(0x80 | (codePoint & 0x3F)); - } else if (codePoint < 0xFFFF) { + } else if (codePoint <= 0xFFFF) { out << static_cast<char>(0xE0 | (codePoint >> 12)) << static_cast<char>(0x80 | ((codePoint >> 6) & 0x3F)) << static_cast<char>(0x80 | (codePoint & 0x3F)); @@ -173,13 +174,13 @@ bool IsValidPlainScalar(const std::string& str, FlowType::value flowType, // then check until something is disallowed static const RegEx& disallowed_flow = - Exp::EndScalarInFlow() || (Exp::BlankOrBreak() + Exp::Comment()) || - Exp::NotPrintable() || Exp::Utf8_ByteOrderMark() || Exp::Break() || - Exp::Tab(); + Exp::EndScalarInFlow() | (Exp::BlankOrBreak() + Exp::Comment()) | + Exp::NotPrintable() | Exp::Utf8_ByteOrderMark() | Exp::Break() | + Exp::Tab() | Exp::Ampersand(); static const RegEx& disallowed_block = - Exp::EndScalar() || (Exp::BlankOrBreak() + Exp::Comment()) || - Exp::NotPrintable() || Exp::Utf8_ByteOrderMark() || Exp::Break() || - Exp::Tab(); + Exp::EndScalar() | (Exp::BlankOrBreak() + Exp::Comment()) | + Exp::NotPrintable() | Exp::Utf8_ByteOrderMark() | Exp::Break() | + Exp::Tab() | Exp::Ampersand(); const RegEx& disallowed = flowType == FlowType::Flow ? disallowed_flow : disallowed_block; @@ -199,15 +200,10 @@ bool IsValidPlainScalar(const std::string& str, FlowType::value flowType, bool IsValidSingleQuotedScalar(const std::string& str, bool escapeNonAscii) { // TODO: check for non-printable characters? - for (std::size_t i = 0; i < str.size(); i++) { - if (escapeNonAscii && (0x80 <= static_cast<unsigned char>(str[i]))) { - return false; - } - if (str[i] == '\n') { - return false; - } - } - return true; + return std::none_of(str.begin(), str.end(), [=](char ch) { + return (escapeNonAscii && (0x80 <= static_cast<unsigned char>(ch))) || + (ch == '\n'); + }); } bool IsValidLiteralScalar(const std::string& str, FlowType::value flowType, @@ -217,28 +213,39 @@ bool IsValidLiteralScalar(const std::string& str, FlowType::value flowType, } // TODO: check for non-printable characters? - for (std::size_t i = 0; i < str.size(); i++) { - if (escapeNonAscii && (0x80 <= static_cast<unsigned char>(str[i]))) { - return false; - } - } - return true; + return std::none_of(str.begin(), str.end(), [=](char ch) { + return (escapeNonAscii && (0x80 <= static_cast<unsigned char>(ch))); + }); } -void WriteDoubleQuoteEscapeSequence(ostream_wrapper& out, int codePoint) { +std::pair<uint16_t, uint16_t> EncodeUTF16SurrogatePair(int codePoint) { + const uint32_t leadOffset = 0xD800 - (0x10000 >> 10); + + return { + leadOffset | (codePoint >> 10), + 0xDC00 | (codePoint & 0x3FF), + }; +} + +void WriteDoubleQuoteEscapeSequence(ostream_wrapper& out, int codePoint, StringEscaping::value stringEscapingStyle) { static const char hexDigits[] = "0123456789abcdef"; out << "\\"; int digits = 8; - if (codePoint < 0xFF) { + if (codePoint < 0xFF && stringEscapingStyle != StringEscaping::JSON) { out << "x"; digits = 2; } else if (codePoint < 0xFFFF) { out << "u"; digits = 4; - } else { + } else if (stringEscapingStyle != StringEscaping::JSON) { out << "U"; digits = 8; + } else { + auto surrogatePair = EncodeUTF16SurrogatePair(codePoint); + WriteDoubleQuoteEscapeSequence(out, surrogatePair.first, stringEscapingStyle); + WriteDoubleQuoteEscapeSequence(out, surrogatePair.second, stringEscapingStyle); + return; } // Write digits into the escape sequence @@ -258,7 +265,7 @@ bool WriteAliasName(ostream_wrapper& out, const std::string& str) { } return true; } -} +} // namespace StringFormat::value ComputeStringFormat(const std::string& str, EMITTER_MANIP strFormat, @@ -310,7 +317,7 @@ bool WriteSingleQuotedString(ostream_wrapper& out, const std::string& str) { } bool WriteDoubleQuotedString(ostream_wrapper& out, const std::string& str, - bool escapeNonAscii) { + StringEscaping::value stringEscaping) { out << "\""; int codePoint; for (std::string::const_iterator i = str.begin(); @@ -334,16 +341,19 @@ bool WriteDoubleQuotedString(ostream_wrapper& out, const std::string& str, case '\b': out << "\\b"; break; + case '\f': + out << "\\f"; + break; default: if (codePoint < 0x20 || (codePoint >= 0x80 && codePoint <= 0xA0)) { // Control characters and non-breaking space - WriteDoubleQuoteEscapeSequence(out, codePoint); + WriteDoubleQuoteEscapeSequence(out, codePoint, stringEscaping); } else if (codePoint == 0xFEFF) { // Byte order marks (ZWNS) should be // escaped (YAML 1.2, sec. 5.2) - WriteDoubleQuoteEscapeSequence(out, codePoint); - } else if (escapeNonAscii && codePoint > 0x7E) { - WriteDoubleQuoteEscapeSequence(out, codePoint); + WriteDoubleQuoteEscapeSequence(out, codePoint, stringEscaping); + } else if (stringEscaping == StringEscaping::NonAscii && codePoint > 0x7E) { + WriteDoubleQuoteEscapeSequence(out, codePoint, stringEscaping); } else { WriteCodePoint(out, codePoint); } @@ -356,37 +366,41 @@ bool WriteDoubleQuotedString(ostream_wrapper& out, const std::string& str, bool WriteLiteralString(ostream_wrapper& out, const std::string& str, std::size_t indent) { out << "|\n"; - out << IndentTo(indent); int codePoint; for (std::string::const_iterator i = str.begin(); GetNextCodePointAndAdvance(codePoint, i, str.end());) { if (codePoint == '\n') { - out << "\n" << IndentTo(indent); + out << "\n"; } else { + out<< IndentTo(indent); WriteCodePoint(out, codePoint); } } return true; } -bool WriteChar(ostream_wrapper& out, char ch) { +bool WriteChar(ostream_wrapper& out, char ch, StringEscaping::value stringEscapingStyle) { if (('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')) { out << ch; } else if (ch == '\"') { - out << "\"\\\"\""; + out << R"("\"")"; } else if (ch == '\t') { - out << "\"\\t\""; + out << R"("\t")"; } else if (ch == '\n') { - out << "\"\\n\""; + out << R"("\n")"; } else if (ch == '\b') { - out << "\"\\b\""; + out << R"("\b")"; + } else if (ch == '\r') { + out << R"("\r")"; + } else if (ch == '\f') { + out << R"("\f")"; } else if (ch == '\\') { - out << "\"\\\\\""; - } else if ((0x20 <= ch && ch <= 0x7e) || ch == ' ') { + out << R"("\\")"; + } else if (0x20 <= ch && ch <= 0x7e) { out << "\"" << ch << "\""; } else { out << "\""; - WriteDoubleQuoteEscapeSequence(out, ch); + WriteDoubleQuoteEscapeSequence(out, ch, stringEscapingStyle); out << "\""; } return true; @@ -401,8 +415,8 @@ bool WriteComment(ostream_wrapper& out, const std::string& str, for (std::string::const_iterator i = str.begin(); GetNextCodePointAndAdvance(codePoint, i, str.end());) { if (codePoint == '\n') { - out << "\n" << IndentTo(curIndent) << "#" - << Indentation(postCommentIndent); + out << "\n" + << IndentTo(curIndent) << "#" << Indentation(postCommentIndent); out.set_comment(); } else { WriteCodePoint(out, codePoint); @@ -476,8 +490,8 @@ bool WriteTagWithPrefix(ostream_wrapper& out, const std::string& prefix, bool WriteBinary(ostream_wrapper& out, const Binary& binary) { WriteDoubleQuotedString(out, EncodeBase64(binary.data(), binary.size()), - false); + StringEscaping::None); return true; } -} -} +} // namespace Utils +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/emitterutils.h b/src/libs/3rdparty/yaml-cpp/src/emitterutils.h index 6cc73191476..3a7d5982521 100644 --- a/src/libs/3rdparty/yaml-cpp/src/emitterutils.h +++ b/src/libs/3rdparty/yaml-cpp/src/emitterutils.h @@ -24,6 +24,10 @@ struct StringFormat { enum value { Plain, SingleQuoted, DoubleQuoted, Literal }; }; +struct StringEscaping { + enum value { None, NonAscii, JSON }; +}; + namespace Utils { StringFormat::value ComputeStringFormat(const std::string& str, EMITTER_MANIP strFormat, @@ -32,10 +36,11 @@ StringFormat::value ComputeStringFormat(const std::string& str, bool WriteSingleQuotedString(ostream_wrapper& out, const std::string& str); bool WriteDoubleQuotedString(ostream_wrapper& out, const std::string& str, - bool escapeNonAscii); + StringEscaping::value stringEscaping); bool WriteLiteralString(ostream_wrapper& out, const std::string& str, std::size_t indent); -bool WriteChar(ostream_wrapper& out, char ch); +bool WriteChar(ostream_wrapper& out, char ch, + StringEscaping::value stringEscapingStyle); bool WriteComment(ostream_wrapper& out, const std::string& str, std::size_t postCommentIndent); bool WriteAlias(ostream_wrapper& out, const std::string& str); diff --git a/src/libs/3rdparty/yaml-cpp/src/exceptions.cpp b/src/libs/3rdparty/yaml-cpp/src/exceptions.cpp index d5e10b23c1c..43a7976e907 100644 --- a/src/libs/3rdparty/yaml-cpp/src/exceptions.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/exceptions.cpp @@ -1,25 +1,20 @@ #include "yaml-cpp/exceptions.h" - -#define YAML_CPP_NOEXCEPT noexcept +#include "yaml-cpp/noexcept.h" namespace YAML { // These destructors are defined out-of-line so the vtable is only emitted once. -Exception::~Exception() YAML_CPP_NOEXCEPT {} -ParserException::~ParserException() YAML_CPP_NOEXCEPT {} -RepresentationException::~RepresentationException() YAML_CPP_NOEXCEPT {} -InvalidScalar::~InvalidScalar() YAML_CPP_NOEXCEPT {} -KeyNotFound::~KeyNotFound() YAML_CPP_NOEXCEPT {} -InvalidNode::~InvalidNode() YAML_CPP_NOEXCEPT {} -BadConversion::~BadConversion() YAML_CPP_NOEXCEPT {} -BadDereference::~BadDereference() YAML_CPP_NOEXCEPT {} -BadSubscript::~BadSubscript() YAML_CPP_NOEXCEPT {} -BadPushback::~BadPushback() YAML_CPP_NOEXCEPT {} -BadInsert::~BadInsert() YAML_CPP_NOEXCEPT {} -EmitterException::~EmitterException() YAML_CPP_NOEXCEPT {} -BadFile::~BadFile() YAML_CPP_NOEXCEPT {} -} - -#undef YAML_CPP_NOEXCEPT - - +Exception::~Exception() YAML_CPP_NOEXCEPT = default; +ParserException::~ParserException() YAML_CPP_NOEXCEPT = default; +RepresentationException::~RepresentationException() YAML_CPP_NOEXCEPT = default; +InvalidScalar::~InvalidScalar() YAML_CPP_NOEXCEPT = default; +KeyNotFound::~KeyNotFound() YAML_CPP_NOEXCEPT = default; +InvalidNode::~InvalidNode() YAML_CPP_NOEXCEPT = default; +BadConversion::~BadConversion() YAML_CPP_NOEXCEPT = default; +BadDereference::~BadDereference() YAML_CPP_NOEXCEPT = default; +BadSubscript::~BadSubscript() YAML_CPP_NOEXCEPT = default; +BadPushback::~BadPushback() YAML_CPP_NOEXCEPT = default; +BadInsert::~BadInsert() YAML_CPP_NOEXCEPT = default; +EmitterException::~EmitterException() YAML_CPP_NOEXCEPT = default; +BadFile::~BadFile() YAML_CPP_NOEXCEPT = default; +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/exp.cpp b/src/libs/3rdparty/yaml-cpp/src/exp.cpp index 695440aec0e..992620ff94b 100644 --- a/src/libs/3rdparty/yaml-cpp/src/exp.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/exp.cpp @@ -12,8 +12,7 @@ namespace YAML { namespace Exp { unsigned ParseHex(const std::string& str, const Mark& mark) { unsigned value = 0; - for (std::size_t i = 0; i < str.size(); i++) { - char ch = str[i]; + for (char ch : str) { int digit = 0; if ('a' <= ch && ch <= 'f') digit = ch - 'a' + 10; @@ -55,14 +54,16 @@ std::string Escape(Stream& in, int codeLength) { // now break it up into chars if (value <= 0x7F) return Str(value); - else if (value <= 0x7FF) + + if (value <= 0x7FF) return Str(0xC0 + (value >> 6)) + Str(0x80 + (value & 0x3F)); - else if (value <= 0xFFFF) + + if (value <= 0xFFFF) return Str(0xE0 + (value >> 12)) + Str(0x80 + ((value >> 6) & 0x3F)) + Str(0x80 + (value & 0x3F)); - else - return Str(0xF0 + (value >> 18)) + Str(0x80 + ((value >> 12) & 0x3F)) + - Str(0x80 + ((value >> 6) & 0x3F)) + Str(0x80 + (value & 0x3F)); + + return Str(0xF0 + (value >> 18)) + Str(0x80 + ((value >> 12) & 0x3F)) + + Str(0x80 + ((value >> 6) & 0x3F)) + Str(0x80 + (value & 0x3F)); } // Escape @@ -104,7 +105,7 @@ std::string Escape(Stream& in) { case 'e': return "\x1B"; case ' ': - return "\x20"; + return R"( )"; case '\"': return "\""; case '\'': @@ -132,5 +133,5 @@ std::string Escape(Stream& in) { std::stringstream msg; throw ParserException(in.mark(), std::string(ErrorMsg::INVALID_ESCAPE) + ch); } -} -} +} // namespace Exp +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/exp.h b/src/libs/3rdparty/yaml-cpp/src/exp.h index 7c02cf6e451..c8837f0f825 100644 --- a/src/libs/3rdparty/yaml-cpp/src/exp.h +++ b/src/libs/3rdparty/yaml-cpp/src/exp.h @@ -33,15 +33,15 @@ inline const RegEx& Tab() { return e; } inline const RegEx& Blank() { - static const RegEx e = Space() || Tab(); + static const RegEx e = Space() | Tab(); return e; } inline const RegEx& Break() { - static const RegEx e = RegEx('\n') || RegEx("\r\n"); + static const RegEx e = RegEx('\n') | RegEx("\r\n") | RegEx('\r'); return e; } inline const RegEx& BlankOrBreak() { - static const RegEx e = Blank() || Break(); + static const RegEx e = Blank() | Break(); return e; } inline const RegEx& Digit() { @@ -49,29 +49,29 @@ inline const RegEx& Digit() { return e; } inline const RegEx& Alpha() { - static const RegEx e = RegEx('a', 'z') || RegEx('A', 'Z'); + static const RegEx e = RegEx('a', 'z') | RegEx('A', 'Z'); return e; } inline const RegEx& AlphaNumeric() { - static const RegEx e = Alpha() || Digit(); + static const RegEx e = Alpha() | Digit(); return e; } inline const RegEx& Word() { - static const RegEx e = AlphaNumeric() || RegEx('-'); + static const RegEx e = AlphaNumeric() | RegEx('-'); return e; } inline const RegEx& Hex() { - static const RegEx e = Digit() || RegEx('A', 'F') || RegEx('a', 'f'); + static const RegEx e = Digit() | RegEx('A', 'F') | RegEx('a', 'f'); return e; } // Valid Unicode code points that are not part of c-printable (YAML 1.2, sec. // 5.1) inline const RegEx& NotPrintable() { static const RegEx e = - RegEx(0) || - RegEx("\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x7F", REGEX_OR) || - RegEx(0x0E, 0x1F) || - (RegEx('\xC2') + (RegEx('\x80', '\x84') || RegEx('\x86', '\x9F'))); + RegEx(0) | + RegEx("\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x7F", REGEX_OR) | + RegEx(0x0E, 0x1F) | + (RegEx('\xC2') + (RegEx('\x80', '\x84') | RegEx('\x86', '\x9F'))); return e; } inline const RegEx& Utf8_ByteOrderMark() { @@ -82,19 +82,19 @@ inline const RegEx& Utf8_ByteOrderMark() { // actual tags inline const RegEx& DocStart() { - static const RegEx e = RegEx("---") + (BlankOrBreak() || RegEx()); + static const RegEx e = RegEx("---") + (BlankOrBreak() | RegEx()); return e; } inline const RegEx& DocEnd() { - static const RegEx e = RegEx("...") + (BlankOrBreak() || RegEx()); + static const RegEx e = RegEx("...") + (BlankOrBreak() | RegEx()); return e; } inline const RegEx& DocIndicator() { - static const RegEx e = DocStart() || DocEnd(); + static const RegEx e = DocStart() | DocEnd(); return e; } inline const RegEx& BlockEntry() { - static const RegEx e = RegEx('-') + (BlankOrBreak() || RegEx()); + static const RegEx e = RegEx('-') + (BlankOrBreak() | RegEx()); return e; } inline const RegEx& Key() { @@ -106,36 +106,40 @@ inline const RegEx& KeyInFlow() { return e; } inline const RegEx& Value() { - static const RegEx e = RegEx(':') + (BlankOrBreak() || RegEx()); + static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx()); return e; } inline const RegEx& ValueInFlow() { - static const RegEx e = RegEx(':') + (BlankOrBreak() || RegEx(",}", REGEX_OR)); + static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx(",]}", REGEX_OR)); return e; } inline const RegEx& ValueInJSONFlow() { static const RegEx e = RegEx(':'); return e; } +inline const RegEx& Ampersand() { + static const RegEx e = RegEx('&'); + return e; +} inline const RegEx Comment() { static const RegEx e = RegEx('#'); return e; } inline const RegEx& Anchor() { - static const RegEx e = !(RegEx("[]{},", REGEX_OR) || BlankOrBreak()); + static const RegEx e = !(RegEx("[]{},", REGEX_OR) | BlankOrBreak()); return e; } inline const RegEx& AnchorEnd() { - static const RegEx e = RegEx("?:,]}%@`", REGEX_OR) || BlankOrBreak(); + static const RegEx e = RegEx("?:,]}%@`", REGEX_OR) | BlankOrBreak(); return e; } inline const RegEx& URI() { - static const RegEx e = Word() || RegEx("#;/?:@&=+$,_.!~*'()[]", REGEX_OR) || + static const RegEx e = Word() | RegEx("#;/?:@&=+$,_.!~*'()[]", REGEX_OR) | (RegEx('%') + Hex() + Hex()); return e; } inline const RegEx& Tag() { - static const RegEx e = Word() || RegEx("#;/?:@&=+$_.~*'()", REGEX_OR) || + static const RegEx e = Word() | RegEx("#;/?:@&=+$_.~*'()", REGEX_OR) | (RegEx('%') + Hex() + Hex()); return e; } @@ -148,34 +152,34 @@ inline const RegEx& Tag() { // space. inline const RegEx& PlainScalar() { static const RegEx e = - !(BlankOrBreak() || RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) || - (RegEx("-?:", REGEX_OR) + (BlankOrBreak() || RegEx()))); + !(BlankOrBreak() | RegEx(",[]{}#&*!|>\'\"%@`", REGEX_OR) | + (RegEx("-?:", REGEX_OR) + (BlankOrBreak() | RegEx()))); return e; } inline const RegEx& PlainScalarInFlow() { static const RegEx e = - !(BlankOrBreak() || RegEx("?,[]{}#&*!|>\'\"%@`", REGEX_OR) || - (RegEx("-:", REGEX_OR) + Blank())); + !(BlankOrBreak() | RegEx("?,[]{}#&*!|>\'\"%@`", REGEX_OR) | + (RegEx("-:", REGEX_OR) + (Blank() | RegEx()))); return e; } inline const RegEx& EndScalar() { - static const RegEx e = RegEx(':') + (BlankOrBreak() || RegEx()); + static const RegEx e = RegEx(':') + (BlankOrBreak() | RegEx()); return e; } inline const RegEx& EndScalarInFlow() { static const RegEx e = - (RegEx(':') + (BlankOrBreak() || RegEx() || RegEx(",]}", REGEX_OR))) || + (RegEx(':') + (BlankOrBreak() | RegEx() | RegEx(",]}", REGEX_OR))) | RegEx(",?[]{}", REGEX_OR); return e; } inline const RegEx& ScanScalarEndInFlow() { - static const RegEx e = (EndScalarInFlow() || (BlankOrBreak() + Comment())); + static const RegEx e = (EndScalarInFlow() | (BlankOrBreak() + Comment())); return e; } inline const RegEx& ScanScalarEnd() { - static const RegEx e = EndScalar() || (BlankOrBreak() + Comment()); + static const RegEx e = EndScalar() | (BlankOrBreak() + Comment()); return e; } inline const RegEx& EscSingleQuote() { @@ -192,8 +196,8 @@ inline const RegEx& ChompIndicator() { return e; } inline const RegEx& Chomp() { - static const RegEx e = (ChompIndicator() + Digit()) || - (Digit() + ChompIndicator()) || ChompIndicator() || + static const RegEx e = (ChompIndicator() + Digit()) | + (Digit() + ChompIndicator()) | ChompIndicator() | Digit(); return e; } diff --git a/src/libs/3rdparty/yaml-cpp/src/memory.cpp b/src/libs/3rdparty/yaml-cpp/src/memory.cpp index e5f8a9d3f8c..676e4c7f152 100644 --- a/src/libs/3rdparty/yaml-cpp/src/memory.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/memory.cpp @@ -22,5 +22,5 @@ node& memory::create_node() { void memory::merge(const memory& rhs) { m_nodes.insert(rhs.m_nodes.begin(), rhs.m_nodes.end()); } -} -} +} // namespace detail +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/node.cpp b/src/libs/3rdparty/yaml-cpp/src/node.cpp index 2088e13c9ae..badc3110ecc 100644 --- a/src/libs/3rdparty/yaml-cpp/src/node.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/node.cpp @@ -9,4 +9,4 @@ Node Clone(const Node& node) { events.Emit(builder); return builder.Root(); } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/node_data.cpp b/src/libs/3rdparty/yaml-cpp/src/node_data.cpp index 77cd4657806..8f5422ae6e1 100644 --- a/src/libs/3rdparty/yaml-cpp/src/node_data.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/node_data.cpp @@ -1,4 +1,5 @@ -#include <assert.h> +#include <algorithm> +#include <cassert> #include <iterator> #include <sstream> @@ -12,15 +13,24 @@ namespace YAML { namespace detail { +YAML_CPP_API std::atomic<size_t> node::m_amount{0}; -std::string node_data::empty_scalar; +const std::string& node_data::empty_scalar() { + static const std::string svalue; + return svalue; +} node_data::node_data() : m_isDefined(false), m_mark(Mark::null_mark()), m_type(NodeType::Null), + m_tag{}, m_style(EmitterStyle::Default), - m_seqSize(0) {} + m_scalar{}, + m_sequence{}, + m_seqSize(0), + m_map{}, + m_undefinedPairs{} {} void node_data::mark_defined() { if (m_type == NodeType::Undefined) @@ -100,9 +110,9 @@ void node_data::compute_seq_size() const { } void node_data::compute_map_size() const { - kv_pairs::iterator it = m_undefinedPairs.begin(); + auto it = m_undefinedPairs.begin(); while (it != m_undefinedPairs.end()) { - kv_pairs::iterator jt = std::next(it); + auto jt = std::next(it); if (it->first->is_defined() && it->second->is_defined()) m_undefinedPairs.erase(it); it = jt; @@ -111,7 +121,7 @@ void node_data::compute_map_size() const { const_node_iterator node_data::begin() const { if (!m_isDefined) - return const_node_iterator(); + return {}; switch (m_type) { case NodeType::Sequence: @@ -119,13 +129,13 @@ const_node_iterator node_data::begin() const { case NodeType::Map: return const_node_iterator(m_map.begin(), m_map.end()); default: - return const_node_iterator(); + return {}; } } node_iterator node_data::begin() { if (!m_isDefined) - return node_iterator(); + return {}; switch (m_type) { case NodeType::Sequence: @@ -133,13 +143,13 @@ node_iterator node_data::begin() { case NodeType::Map: return node_iterator(m_map.begin(), m_map.end()); default: - return node_iterator(); + return {}; } } const_node_iterator node_data::end() const { if (!m_isDefined) - return const_node_iterator(); + return {}; switch (m_type) { case NodeType::Sequence: @@ -147,13 +157,13 @@ const_node_iterator node_data::end() const { case NodeType::Map: return const_node_iterator(m_map.end(), m_map.end()); default: - return const_node_iterator(); + return {}; } } node_iterator node_data::end() { if (!m_isDefined) - return node_iterator(); + return {}; switch (m_type) { case NodeType::Sequence: @@ -161,12 +171,13 @@ node_iterator node_data::end() { case NodeType::Map: return node_iterator(m_map.end(), m_map.end()); default: - return node_iterator(); + return {}; } } // sequence -void node_data::push_back(node& node, shared_memory_holder /* pMemory */) { +void node_data::push_back(node& node, + const shared_memory_holder& /* pMemory */) { if (m_type == NodeType::Undefined || m_type == NodeType::Null) { m_type = NodeType::Sequence; reset_sequence(); @@ -178,7 +189,8 @@ void node_data::push_back(node& node, shared_memory_holder /* pMemory */) { m_sequence.push_back(&node); } -void node_data::insert(node& key, node& value, shared_memory_holder pMemory) { +void node_data::insert(node& key, node& value, + const shared_memory_holder& pMemory) { switch (m_type) { case NodeType::Map: break; @@ -188,27 +200,28 @@ void node_data::insert(node& key, node& value, shared_memory_holder pMemory) { convert_to_map(pMemory); break; case NodeType::Scalar: - throw BadSubscript(); + throw BadSubscript(m_mark, key); } insert_map_pair(key, value); } // indexing -node* node_data::get(node& key, shared_memory_holder /* pMemory */) const { +node* node_data::get(node& key, + const shared_memory_holder& /* pMemory */) const { if (m_type != NodeType::Map) { - return NULL; + return nullptr; } - for (node_map::const_iterator it = m_map.begin(); it != m_map.end(); ++it) { - if (it->first->is(key)) - return it->second; + for (const auto& it : m_map) { + if (it.first->is(key)) + return it.second; } - return NULL; + return nullptr; } -node& node_data::get(node& key, shared_memory_holder pMemory) { +node& node_data::get(node& key, const shared_memory_holder& pMemory) { switch (m_type) { case NodeType::Map: break; @@ -218,12 +231,12 @@ node& node_data::get(node& key, shared_memory_holder pMemory) { convert_to_map(pMemory); break; case NodeType::Scalar: - throw BadSubscript(); + throw BadSubscript(m_mark, key); } - for (node_map::const_iterator it = m_map.begin(); it != m_map.end(); ++it) { - if (it->first->is(key)) - return *it->second; + for (const auto& it : m_map) { + if (it.first->is(key)) + return *it.second; } node& value = pMemory->create_node(); @@ -231,15 +244,26 @@ node& node_data::get(node& key, shared_memory_holder pMemory) { return value; } -bool node_data::remove(node& key, shared_memory_holder /* pMemory */) { +bool node_data::remove(node& key, const shared_memory_holder& /* pMemory */) { if (m_type != NodeType::Map) return false; - for (node_map::iterator it = m_map.begin(); it != m_map.end(); ++it) { - if (it->first->is(key)) { - m_map.erase(it); - return true; - } + for (auto it = m_undefinedPairs.begin(); it != m_undefinedPairs.end();) { + auto jt = std::next(it); + if (it->first->is(key)) + m_undefinedPairs.erase(it); + it = jt; + } + + auto it = + std::find_if(m_map.begin(), m_map.end(), + [&](std::pair<YAML::detail::node*, YAML::detail::node*> j) { + return (j.first->is(key)); + }); + + if (it != m_map.end()) { + m_map.erase(it); + return true; } return false; @@ -262,7 +286,7 @@ void node_data::insert_map_pair(node& key, node& value) { m_undefinedPairs.emplace_back(&key, &value); } -void node_data::convert_to_map(shared_memory_holder pMemory) { +void node_data::convert_to_map(const shared_memory_holder& pMemory) { switch (m_type) { case NodeType::Undefined: case NodeType::Null: @@ -280,7 +304,7 @@ void node_data::convert_to_map(shared_memory_holder pMemory) { } } -void node_data::convert_sequence_to_map(shared_memory_holder pMemory) { +void node_data::convert_sequence_to_map(const shared_memory_holder& pMemory) { assert(m_type == NodeType::Sequence); reset_map(); @@ -296,5 +320,5 @@ void node_data::convert_sequence_to_map(shared_memory_holder pMemory) { reset_sequence(); m_type = NodeType::Map; } -} -} +} // namespace detail +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/nodebuilder.cpp b/src/libs/3rdparty/yaml-cpp/src/nodebuilder.cpp index 093d2efeb77..bbaefac8a60 100644 --- a/src/libs/3rdparty/yaml-cpp/src/nodebuilder.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/nodebuilder.cpp @@ -1,4 +1,3 @@ -#include <assert.h> #include <cassert> #include "nodebuilder.h" @@ -11,11 +10,16 @@ namespace YAML { struct Mark; NodeBuilder::NodeBuilder() - : m_pMemory(new detail::memory_holder), m_pRoot(0), m_mapDepth(0) { - m_anchors.push_back(0); // since the anchors start at 1 + : m_pMemory(new detail::memory_holder), + m_pRoot(nullptr), + m_stack{}, + m_anchors{}, + m_keys{}, + m_mapDepth(0) { + m_anchors.push_back(nullptr); // since the anchors start at 1 } -NodeBuilder::~NodeBuilder() {} +NodeBuilder::~NodeBuilder() = default; Node NodeBuilder::Root() { if (!m_pRoot) @@ -88,7 +92,7 @@ void NodeBuilder::Push(detail::node& node) { m_stack.push_back(&node); if (needsKey) - m_keys.push_back(PushedKey(&node, false)); + m_keys.emplace_back(&node, false); } void NodeBuilder::Pop() { @@ -127,4 +131,4 @@ void NodeBuilder::RegisterAnchor(anchor_t anchor, detail::node& node) { m_anchors.push_back(&node); } } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/nodebuilder.h b/src/libs/3rdparty/yaml-cpp/src/nodebuilder.h index a6a47f007bb..c580d40e29b 100644 --- a/src/libs/3rdparty/yaml-cpp/src/nodebuilder.h +++ b/src/libs/3rdparty/yaml-cpp/src/nodebuilder.h @@ -27,25 +27,29 @@ class Node; class NodeBuilder : public EventHandler { public: NodeBuilder(); - virtual ~NodeBuilder(); + NodeBuilder(const NodeBuilder&) = delete; + NodeBuilder(NodeBuilder&&) = delete; + NodeBuilder& operator=(const NodeBuilder&) = delete; + NodeBuilder& operator=(NodeBuilder&&) = delete; + ~NodeBuilder() override; Node Root(); - virtual void OnDocumentStart(const Mark& mark); - virtual void OnDocumentEnd(); + void OnDocumentStart(const Mark& mark) override; + void OnDocumentEnd() override; - virtual void OnNull(const Mark& mark, anchor_t anchor); - virtual void OnAlias(const Mark& mark, anchor_t anchor); - virtual void OnScalar(const Mark& mark, const std::string& tag, - anchor_t anchor, const std::string& value); + void OnNull(const Mark& mark, anchor_t anchor) override; + void OnAlias(const Mark& mark, anchor_t anchor) override; + void OnScalar(const Mark& mark, const std::string& tag, + anchor_t anchor, const std::string& value) override; - virtual void OnSequenceStart(const Mark& mark, const std::string& tag, - anchor_t anchor, EmitterStyle::value style); - virtual void OnSequenceEnd(); + void OnSequenceStart(const Mark& mark, const std::string& tag, + anchor_t anchor, EmitterStyle::value style) override; + void OnSequenceEnd() override; - virtual void OnMapStart(const Mark& mark, const std::string& tag, - anchor_t anchor, EmitterStyle::value style); - virtual void OnMapEnd(); + void OnMapStart(const Mark& mark, const std::string& tag, + anchor_t anchor, EmitterStyle::value style) override; + void OnMapEnd() override; private: detail::node& Push(const Mark& mark, anchor_t anchor); @@ -57,14 +61,14 @@ class NodeBuilder : public EventHandler { detail::shared_memory_holder m_pMemory; detail::node* m_pRoot; - typedef std::vector<detail::node*> Nodes; + using Nodes = std::vector<detail::node *>; Nodes m_stack; Nodes m_anchors; - typedef std::pair<detail::node*, bool> PushedKey; + using PushedKey = std::pair<detail::node*, bool>; std::vector<PushedKey> m_keys; std::size_t m_mapDepth; }; -} +} // namespace YAML #endif // NODE_NODEBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/src/nodeevents.cpp b/src/libs/3rdparty/yaml-cpp/src/nodeevents.cpp index 82261feb058..b1774fef3e4 100644 --- a/src/libs/3rdparty/yaml-cpp/src/nodeevents.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/nodeevents.cpp @@ -13,14 +13,14 @@ void NodeEvents::AliasManager::RegisterReference(const detail::node& node) { anchor_t NodeEvents::AliasManager::LookupAnchor( const detail::node& node) const { - AnchorByIdentity::const_iterator it = m_anchorByIdentity.find(node.ref()); + auto it = m_anchorByIdentity.find(node.ref()); if (it == m_anchorByIdentity.end()) return 0; return it->second; } NodeEvents::NodeEvents(const Node& node) - : m_pMemory(node.m_pMemory), m_root(node.m_pNode) { + : m_pMemory(node.m_pMemory), m_root(node.m_pNode), m_refCount{} { if (m_root) Setup(*m_root); } @@ -32,13 +32,12 @@ void NodeEvents::Setup(const detail::node& node) { return; if (node.type() == NodeType::Sequence) { - for (detail::const_node_iterator it = node.begin(); it != node.end(); ++it) - Setup(**it); + for (auto element : node) + Setup(*element); } else if (node.type() == NodeType::Map) { - for (detail::const_node_iterator it = node.begin(); it != node.end(); - ++it) { - Setup(*it->first); - Setup(*it->second); + for (auto element : node) { + Setup(*element.first); + Setup(*element.second); } } } @@ -77,17 +76,15 @@ void NodeEvents::Emit(const detail::node& node, EventHandler& handler, break; case NodeType::Sequence: handler.OnSequenceStart(Mark(), node.tag(), anchor, node.style()); - for (detail::const_node_iterator it = node.begin(); it != node.end(); - ++it) - Emit(**it, handler, am); + for (auto element : node) + Emit(*element, handler, am); handler.OnSequenceEnd(); break; case NodeType::Map: handler.OnMapStart(Mark(), node.tag(), anchor, node.style()); - for (detail::const_node_iterator it = node.begin(); it != node.end(); - ++it) { - Emit(*it->first, handler, am); - Emit(*it->second, handler, am); + for (auto element : node) { + Emit(*element.first, handler, am); + Emit(*element.second, handler, am); } handler.OnMapEnd(); break; @@ -95,7 +92,7 @@ void NodeEvents::Emit(const detail::node& node, EventHandler& handler, } bool NodeEvents::IsAliased(const detail::node& node) const { - RefCount::const_iterator it = m_refCount.find(node.ref()); + auto it = m_refCount.find(node.ref()); return it != m_refCount.end() && it->second > 1; } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/nodeevents.h b/src/libs/3rdparty/yaml-cpp/src/nodeevents.h index 49c18eb854a..efca9149ed3 100644 --- a/src/libs/3rdparty/yaml-cpp/src/nodeevents.h +++ b/src/libs/3rdparty/yaml-cpp/src/nodeevents.h @@ -26,13 +26,17 @@ class Node; class NodeEvents { public: explicit NodeEvents(const Node& node); + NodeEvents(const NodeEvents&) = delete; + NodeEvents(NodeEvents&&) = delete; + NodeEvents& operator=(const NodeEvents&) = delete; + NodeEvents& operator=(NodeEvents&&) = delete; void Emit(EventHandler& handler); private: class AliasManager { public: - AliasManager() : m_curAnchor(0) {} + AliasManager() : m_anchorByIdentity{}, m_curAnchor(0) {} void RegisterReference(const detail::node& node); anchor_t LookupAnchor(const detail::node& node) const; @@ -41,7 +45,7 @@ class NodeEvents { anchor_t _CreateNewAnchor() { return ++m_curAnchor; } private: - typedef std::map<const detail::node_ref*, anchor_t> AnchorByIdentity; + using AnchorByIdentity = std::map<const detail::node_ref*, anchor_t>; AnchorByIdentity m_anchorByIdentity; anchor_t m_curAnchor; @@ -56,9 +60,9 @@ class NodeEvents { detail::shared_memory_holder m_pMemory; detail::node* m_root; - typedef std::map<const detail::node_ref*, int> RefCount; + using RefCount = std::map<const detail::node_ref*, int>; RefCount m_refCount; }; -} +} // namespace YAML #endif // NODE_NODEEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/src/null.cpp b/src/libs/3rdparty/yaml-cpp/src/null.cpp index d12dd08ce4b..db7daebf1d2 100644 --- a/src/libs/3rdparty/yaml-cpp/src/null.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/null.cpp @@ -7,4 +7,4 @@ bool IsNullString(const std::string& str) { return str.empty() || str == "~" || str == "null" || str == "Null" || str == "NULL"; } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/ostream_wrapper.cpp b/src/libs/3rdparty/yaml-cpp/src/ostream_wrapper.cpp index 357fc0094c4..047a9f7c8ea 100644 --- a/src/libs/3rdparty/yaml-cpp/src/ostream_wrapper.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/ostream_wrapper.cpp @@ -7,16 +7,21 @@ namespace YAML { ostream_wrapper::ostream_wrapper() : m_buffer(1, '\0'), - m_pStream(0), + m_pStream(nullptr), m_pos(0), m_row(0), m_col(0), m_comment(false) {} ostream_wrapper::ostream_wrapper(std::ostream& stream) - : m_pStream(&stream), m_pos(0), m_row(0), m_col(0), m_comment(false) {} + : m_buffer{}, + m_pStream(&stream), + m_pos(0), + m_row(0), + m_col(0), + m_comment(false) {} -ostream_wrapper::~ostream_wrapper() {} +ostream_wrapper::~ostream_wrapper() = default; void ostream_wrapper::write(const std::string& str) { if (m_pStream) { @@ -26,8 +31,8 @@ void ostream_wrapper::write(const std::string& str) { std::copy(str.begin(), str.end(), m_buffer.begin() + m_pos); } - for (std::size_t i = 0; i < str.size(); i++) { - update_pos(str[i]); + for (char ch : str) { + update_pos(ch); } } @@ -54,4 +59,4 @@ void ostream_wrapper::update_pos(char ch) { m_comment = false; } } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/parse.cpp b/src/libs/3rdparty/yaml-cpp/src/parse.cpp index 0b2ae4a4f6e..262536b85a4 100644 --- a/src/libs/3rdparty/yaml-cpp/src/parse.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/parse.cpp @@ -3,10 +3,10 @@ #include <fstream> #include <sstream> -#include "yaml-cpp/node/node.h" -#include "yaml-cpp/node/impl.h" -#include "yaml-cpp/parser.h" #include "nodebuilder.h" +#include "yaml-cpp/node/impl.h" +#include "yaml-cpp/node/node.h" +#include "yaml-cpp/parser.h" namespace YAML { Node Load(const std::string& input) { @@ -30,9 +30,9 @@ Node Load(std::istream& input) { } Node LoadFile(const std::string& filename) { - std::ifstream fin(filename.c_str()); + std::ifstream fin(filename); if (!fin) { - throw BadFile(); + throw BadFile(filename); } return Load(fin); } @@ -51,7 +51,7 @@ std::vector<Node> LoadAll(std::istream& input) { std::vector<Node> docs; Parser parser(input); - while (1) { + while (true) { NodeBuilder builder; if (!parser.HandleNextDocument(builder)) { break; @@ -63,9 +63,9 @@ std::vector<Node> LoadAll(std::istream& input) { } std::vector<Node> LoadAllFromFile(const std::string& filename) { - std::ifstream fin(filename.c_str()); + std::ifstream fin(filename); if (!fin) { - throw BadFile(); + throw BadFile(filename); } return LoadAll(fin); } diff --git a/src/libs/3rdparty/yaml-cpp/src/parser.cpp b/src/libs/3rdparty/yaml-cpp/src/parser.cpp index cd69f39fcec..b8b78ebabc5 100644 --- a/src/libs/3rdparty/yaml-cpp/src/parser.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/parser.cpp @@ -11,15 +11,13 @@ namespace YAML { class EventHandler; -Parser::Parser() {} +Parser::Parser() : m_pScanner{}, m_pDirectives{} {} -Parser::Parser(std::istream& in) { Load(in); } +Parser::Parser(std::istream& in) : Parser() { Load(in); } -Parser::~Parser() {} +Parser::~Parser() = default; -Parser::operator bool() const { - return m_pScanner.get() && !m_pScanner->empty(); -} +Parser::operator bool() const { return m_pScanner && !m_pScanner->empty(); } void Parser::Load(std::istream& in) { m_pScanner.reset(new Scanner(in)); @@ -27,7 +25,7 @@ void Parser::Load(std::istream& in) { } bool Parser::HandleNextDocument(EventHandler& eventHandler) { - if (!m_pScanner.get()) + if (!m_pScanner) return false; ParseDirectives(); @@ -43,11 +41,7 @@ bool Parser::HandleNextDocument(EventHandler& eventHandler) { void Parser::ParseDirectives() { bool readDirective = false; - while (1) { - if (m_pScanner->empty()) { - break; - } - + while (!m_pScanner->empty()) { Token& token = m_pScanner->peek(); if (token.type != Token::DIRECTIVE) { break; @@ -113,17 +107,13 @@ void Parser::HandleTagDirective(const Token& token) { } void Parser::PrintTokens(std::ostream& out) { - if (!m_pScanner.get()) { + if (!m_pScanner) { return; } - while (1) { - if (m_pScanner->empty()) { - break; - } - + while (!m_pScanner->empty()) { out << m_pScanner->peek() << "\n"; m_pScanner->pop(); } } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/ptr_vector.h b/src/libs/3rdparty/yaml-cpp/src/ptr_vector.h index 955aebd8d56..d58de04cb62 100644 --- a/src/libs/3rdparty/yaml-cpp/src/ptr_vector.h +++ b/src/libs/3rdparty/yaml-cpp/src/ptr_vector.h @@ -12,15 +12,17 @@ #include <memory> #include <vector> -#include "yaml-cpp/noncopyable.h" - namespace YAML { // TODO: This class is no longer needed template <typename T> -class ptr_vector : private YAML::noncopyable { +class ptr_vector { public: - ptr_vector() {} + ptr_vector() : m_data{} {} + ptr_vector(const ptr_vector&) = delete; + ptr_vector(ptr_vector&&) = default; + ptr_vector& operator=(const ptr_vector&) = delete; + ptr_vector& operator=(ptr_vector&&) = default; void clear() { m_data.clear(); } @@ -38,6 +40,6 @@ class ptr_vector : private YAML::noncopyable { private: std::vector<std::unique_ptr<T>> m_data; }; -} +} // namespace YAML #endif // PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/src/regex_yaml.cpp b/src/libs/3rdparty/yaml-cpp/src/regex_yaml.cpp index 20b772051d2..bf1784b41d5 100644 --- a/src/libs/3rdparty/yaml-cpp/src/regex_yaml.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/regex_yaml.cpp @@ -2,18 +2,16 @@ namespace YAML { // constructors -RegEx::RegEx() : m_op(REGEX_EMPTY) {} -RegEx::RegEx(REGEX_OP op) : m_op(op) {} +RegEx::RegEx(REGEX_OP op) : m_op(op), m_a(0), m_z(0), m_params{} {} +RegEx::RegEx() : RegEx(REGEX_EMPTY) {} -RegEx::RegEx(char ch) : m_op(REGEX_MATCH), m_a(ch) {} +RegEx::RegEx(char ch) : m_op(REGEX_MATCH), m_a(ch), m_z(0), m_params{} {} -RegEx::RegEx(char a, char z) : m_op(REGEX_RANGE), m_a(a), m_z(z) {} +RegEx::RegEx(char a, char z) : m_op(REGEX_RANGE), m_a(a), m_z(z), m_params{} {} -RegEx::RegEx(const std::string& str, REGEX_OP op) : m_op(op) { - for (std::size_t i = 0; i < str.size(); i++) - m_params.push_back(RegEx(str[i])); -} +RegEx::RegEx(const std::string& str, REGEX_OP op) + : m_op(op), m_a(0), m_z(0), m_params(str.begin(), str.end()) {} // combination constructors RegEx operator!(const RegEx& ex) { @@ -22,14 +20,14 @@ RegEx operator!(const RegEx& ex) { return ret; } -RegEx operator||(const RegEx& ex1, const RegEx& ex2) { +RegEx operator|(const RegEx& ex1, const RegEx& ex2) { RegEx ret(REGEX_OR); ret.m_params.push_back(ex1); ret.m_params.push_back(ex2); return ret; } -RegEx operator&&(const RegEx& ex1, const RegEx& ex2) { +RegEx operator&(const RegEx& ex1, const RegEx& ex2) { RegEx ret(REGEX_AND); ret.m_params.push_back(ex1); ret.m_params.push_back(ex2); @@ -42,4 +40,4 @@ RegEx operator+(const RegEx& ex1, const RegEx& ex2) { ret.m_params.push_back(ex2); return ret; } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/regex_yaml.h b/src/libs/3rdparty/yaml-cpp/src/regex_yaml.h index 8f28b852a29..c70ab60dcc1 100644 --- a/src/libs/3rdparty/yaml-cpp/src/regex_yaml.h +++ b/src/libs/3rdparty/yaml-cpp/src/regex_yaml.h @@ -31,14 +31,14 @@ enum REGEX_OP { class YAML_CPP_API RegEx { public: RegEx(); - RegEx(char ch); + explicit RegEx(char ch); RegEx(char a, char z); RegEx(const std::string& str, REGEX_OP op = REGEX_SEQ); - ~RegEx() {} + ~RegEx() = default; friend YAML_CPP_API RegEx operator!(const RegEx& ex); - friend YAML_CPP_API RegEx operator||(const RegEx& ex1, const RegEx& ex2); - friend YAML_CPP_API RegEx operator&&(const RegEx& ex1, const RegEx& ex2); + friend YAML_CPP_API RegEx operator|(const RegEx& ex1, const RegEx& ex2); + friend YAML_CPP_API RegEx operator&(const RegEx& ex1, const RegEx& ex2); friend YAML_CPP_API RegEx operator+(const RegEx& ex1, const RegEx& ex2); bool Matches(char ch) const; @@ -53,7 +53,7 @@ class YAML_CPP_API RegEx { int Match(const Source& source) const; private: - RegEx(REGEX_OP op); + explicit RegEx(REGEX_OP op); template <typename Source> bool IsValidSource(const Source& source) const; @@ -77,10 +77,11 @@ class YAML_CPP_API RegEx { private: REGEX_OP m_op; - char m_a, m_z; + char m_a{}; + char m_z{}; std::vector<RegEx> m_params; }; -} +} // namespace YAML #include "regeximpl.h" diff --git a/src/libs/3rdparty/yaml-cpp/src/regeximpl.h b/src/libs/3rdparty/yaml-cpp/src/regeximpl.h index 709124f0088..a742cdc3050 100644 --- a/src/libs/3rdparty/yaml-cpp/src/regeximpl.h +++ b/src/libs/3rdparty/yaml-cpp/src/regeximpl.h @@ -8,8 +8,8 @@ #endif #include "stream.h" -#include "stringsource.h" #include "streamcharsource.h" +#include "stringsource.h" namespace YAML { // query matches @@ -106,9 +106,8 @@ inline int RegEx::MatchOpEmpty(const Source& source) const { template <> inline int RegEx::MatchOpEmpty<StringCharSource>( const StringCharSource& source) const { - return !source - ? 0 - : -1; // the empty regex only is successful on the empty string + return !source ? 0 : -1; // the empty regex only is successful on the empty + // string } // MatchOperator @@ -130,8 +129,8 @@ inline int RegEx::MatchOpRange(const Source& source) const { // OrOperator template <typename Source> inline int RegEx::MatchOpOr(const Source& source) const { - for (std::size_t i = 0; i < m_params.size(); i++) { - int n = m_params[i].MatchUnchecked(source); + for (const RegEx& param : m_params) { + int n = param.MatchUnchecked(source); if (n >= 0) return n; } @@ -169,11 +168,11 @@ inline int RegEx::MatchOpNot(const Source& source) const { template <typename Source> inline int RegEx::MatchOpSeq(const Source& source) const { int offset = 0; - for (std::size_t i = 0; i < m_params.size(); i++) { - int n = m_params[i].Match(source + offset); // note Match, not - // MatchUnchecked because we - // need to check validity after - // the offset + for (const RegEx& param : m_params) { + int n = param.Match(source + offset); // note Match, not + // MatchUnchecked because we + // need to check validity after + // the offset if (n == -1) return -1; offset += n; @@ -181,6 +180,6 @@ inline int RegEx::MatchOpSeq(const Source& source) const { return offset; } -} +} // namespace YAML #endif // REGEXIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/src/scanner.cpp b/src/libs/3rdparty/yaml-cpp/src/scanner.cpp index b5cfcc12b22..ea5511a114c 100644 --- a/src/libs/3rdparty/yaml-cpp/src/scanner.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/scanner.cpp @@ -9,12 +9,17 @@ namespace YAML { Scanner::Scanner(std::istream& in) : INPUT(in), + m_tokens{}, m_startedStream(false), m_endedStream(false), m_simpleKeyAllowed(false), - m_canBeJSONFlow(false) {} + m_canBeJSONFlow(false), + m_simpleKeys{}, + m_indents{}, + m_indentRefs{}, + m_flows{} {} -Scanner::~Scanner() {} +Scanner::~Scanner() = default; bool Scanner::empty() { EnsureTokensInQueue(); @@ -46,7 +51,7 @@ Token& Scanner::peek() { Mark Scanner::mark() const { return INPUT.mark(); } void Scanner::EnsureTokensInQueue() { - while (1) { + while (true) { if (!m_tokens.empty()) { Token& token = m_tokens.front(); @@ -83,7 +88,7 @@ void Scanner::ScanNextToken() { return StartStream(); } - // get rid of whitespace, etc. (in between tokens it should be irrelevent) + // get rid of whitespace, etc. (in between tokens it should be irrelevant) ScanToNextToken(); // maybe need to end some blocks @@ -169,7 +174,7 @@ void Scanner::ScanNextToken() { } void Scanner::ScanToNextToken() { - while (1) { + while (true) { // first eat whitespace while (INPUT && IsWhitespaceToBeEaten(INPUT.peek())) { if (InBlockContext() && Exp::Tab().Matches(INPUT)) { @@ -282,7 +287,7 @@ Scanner::IndentMarker* Scanner::PushIndentTo(int column, IndentMarker::INDENT_TYPE type) { // are we in flow? if (InFlowContext()) { - return 0; + return nullptr; } std::unique_ptr<IndentMarker> pIndent(new IndentMarker(column, type)); @@ -291,12 +296,12 @@ Scanner::IndentMarker* Scanner::PushIndentTo(int column, // is this actually an indentation? if (indent.column < lastIndent.column) { - return 0; + return nullptr; } if (indent.column == lastIndent.column && !(indent.type == IndentMarker::SEQ && lastIndent.type == IndentMarker::MAP)) { - return 0; + return nullptr; } // push a start token diff --git a/src/libs/3rdparty/yaml-cpp/src/scanner.h b/src/libs/3rdparty/yaml-cpp/src/scanner.h index 7bb2ccc71a5..4af938e69c3 100644 --- a/src/libs/3rdparty/yaml-cpp/src/scanner.h +++ b/src/libs/3rdparty/yaml-cpp/src/scanner.h @@ -9,9 +9,7 @@ #include <cstddef> #include <ios> -#include <map> #include <queue> -#include <set> #include <stack> #include <string> @@ -49,7 +47,7 @@ class Scanner { enum INDENT_TYPE { MAP, SEQ, NONE }; enum STATUS { VALID, INVALID, UNKNOWN }; IndentMarker(int column_, INDENT_TYPE type_) - : column(column_), type(type_), status(VALID), pStartToken(0) {} + : column(column_), type(type_), status(VALID), pStartToken(nullptr) {} int column; INDENT_TYPE type; diff --git a/src/libs/3rdparty/yaml-cpp/src/scanscalar.cpp b/src/libs/3rdparty/yaml-cpp/src/scanscalar.cpp index 10e359d4466..be57b1cd5d5 100644 --- a/src/libs/3rdparty/yaml-cpp/src/scanscalar.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/scanscalar.cpp @@ -47,7 +47,8 @@ std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) { if (INPUT.column() == 0 && Exp::DocIndicator().Matches(INPUT)) { if (params.onDocIndicator == BREAK) { break; - } else if (params.onDocIndicator == THROW) { + } + if (params.onDocIndicator == THROW) { throw ParserException(INPUT.mark(), ErrorMsg::DOC_IN_SCALAR); } } @@ -183,7 +184,7 @@ std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) { case FOLD_FLOW: if (nextEmptyLine) { scalar += "\n"; - } else if (!emptyLine && !nextEmptyLine && !escapedNewline) { + } else if (!emptyLine && !escapedNewline) { scalar += " "; } break; @@ -203,7 +204,7 @@ std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) { // post-processing if (params.trimTrailingSpaces) { - std::size_t pos = scalar.find_last_not_of(' '); + std::size_t pos = scalar.find_last_not_of(" \t"); if (lastEscapedChar != std::string::npos) { if (pos < lastEscapedChar || pos == std::string::npos) { pos = lastEscapedChar; @@ -247,4 +248,4 @@ std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) { return scalar; } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/scanscalar.h b/src/libs/3rdparty/yaml-cpp/src/scanscalar.h index c3a574ad9b6..296b885a515 100644 --- a/src/libs/3rdparty/yaml-cpp/src/scanscalar.h +++ b/src/libs/3rdparty/yaml-cpp/src/scanscalar.h @@ -57,7 +57,7 @@ struct ScanScalarParams { bool leadingSpaces; }; -std::string ScanScalar(Stream& INPUT, ScanScalarParams& info); +std::string ScanScalar(Stream& INPUT, ScanScalarParams& params); } #endif // SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/src/scantag.cpp b/src/libs/3rdparty/yaml-cpp/src/scantag.cpp index c5b39652ad0..176cc5c711c 100644 --- a/src/libs/3rdparty/yaml-cpp/src/scantag.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/scantag.cpp @@ -78,4 +78,4 @@ const std::string ScanTagSuffix(Stream& INPUT) { return tag; } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/scantoken.cpp b/src/libs/3rdparty/yaml-cpp/src/scantoken.cpp index fd8758d7815..1a94ab1d7d0 100644 --- a/src/libs/3rdparty/yaml-cpp/src/scantoken.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/scantoken.cpp @@ -37,7 +37,7 @@ void Scanner::ScanDirective() { token.value += INPUT.get(); // read parameters - while (1) { + while (true) { // first get rid of whitespace while (Exp::Blank().Matches(INPUT)) INPUT.eat(1); @@ -171,7 +171,7 @@ void Scanner::ScanBlockEntry() { // Key void Scanner::ScanKey() { - // handle keys diffently in the block context (and manage indents) + // handle keys differently in the block context (and manage indents) if (InBlockContext()) { if (!m_simpleKeyAllowed) throw ParserException(INPUT.mark(), ErrorMsg::MAP_KEY); @@ -199,7 +199,7 @@ void Scanner::ScanValue() { // seems fine) m_simpleKeyAllowed = false; } else { - // handle values diffently in the block context (and manage indents) + // handle values differently in the block context (and manage indents) if (InBlockContext()) { if (!m_simpleKeyAllowed) throw ParserException(INPUT.mark(), ErrorMsg::MAP_VALUE); @@ -338,7 +338,7 @@ void Scanner::ScanQuotedScalar() { // setup the scanning parameters ScanScalarParams params; - RegEx end = (single ? RegEx(quote) && !Exp::EscSingleQuote() : RegEx(quote)); + RegEx end = (single ? RegEx(quote) & !Exp::EscSingleQuote() : RegEx(quote)); params.end = &end; params.eatEnd = true; params.escape = (single ? '\'' : '\\'); @@ -434,4 +434,4 @@ void Scanner::ScanBlockScalar() { token.value = scalar; m_tokens.push(token); } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/setting.h b/src/libs/3rdparty/yaml-cpp/src/setting.h index b78d40e2e85..4960bbf75c4 100644 --- a/src/libs/3rdparty/yaml-cpp/src/setting.h +++ b/src/libs/3rdparty/yaml-cpp/src/setting.h @@ -7,17 +7,24 @@ #pragma once #endif +#include "yaml-cpp/noexcept.h" #include <memory> +#include <utility> #include <vector> -#include "yaml-cpp/noncopyable.h" namespace YAML { -class SettingChangeBase; + +class SettingChangeBase { + public: + virtual ~SettingChangeBase() = default; + virtual void pop() = 0; +}; template <typename T> class Setting { public: Setting() : m_value() {} + Setting(const T& value) : m_value() { set(value); } const T get() const { return m_value; } std::unique_ptr<SettingChangeBase> set(const T& value); @@ -27,21 +34,19 @@ class Setting { T m_value; }; -class SettingChangeBase { - public: - virtual ~SettingChangeBase() {} - virtual void pop() = 0; -}; - template <typename T> class SettingChange : public SettingChangeBase { public: - SettingChange(Setting<T>* pSetting) : m_pCurSetting(pSetting) { - // copy old setting to save its state - m_oldSetting = *pSetting; - } + SettingChange(Setting<T>* pSetting) + : m_pCurSetting(pSetting), + m_oldSetting(*pSetting) // copy old setting to save its state + {} + SettingChange(const SettingChange&) = delete; + SettingChange(SettingChange&&) = delete; + SettingChange& operator=(const SettingChange&) = delete; + SettingChange& operator=(SettingChange&&) = delete; - virtual void pop() { m_pCurSetting->restore(m_oldSetting); } + void pop() override { m_pCurSetting->restore(m_oldSetting); } private: Setting<T>* m_pCurSetting; @@ -55,28 +60,13 @@ inline std::unique_ptr<SettingChangeBase> Setting<T>::set(const T& value) { return pChange; } -class SettingChanges : private noncopyable { +class SettingChanges { public: - SettingChanges() {} - ~SettingChanges() { clear(); } - - void clear() { - restore(); - m_settingChanges.clear(); - } - - void restore() { - for (setting_changes::const_iterator it = m_settingChanges.begin(); - it != m_settingChanges.end(); ++it) - (*it)->pop(); - } - - void push(std::unique_ptr<SettingChangeBase> pSettingChange) { - m_settingChanges.push_back(std::move(pSettingChange)); - } - - // like std::unique_ptr - assignment is transfer of ownership - SettingChanges& operator=(SettingChanges&& rhs) { + SettingChanges() : m_settingChanges{} {} + SettingChanges(const SettingChanges&) = delete; + SettingChanges(SettingChanges&&) YAML_CPP_NOEXCEPT = default; + SettingChanges& operator=(const SettingChanges&) = delete; + SettingChanges& operator=(SettingChanges&& rhs) YAML_CPP_NOEXCEPT { if (this == &rhs) return *this; @@ -85,11 +75,26 @@ class SettingChanges : private noncopyable { return *this; } + ~SettingChanges() { clear(); } + + void clear() YAML_CPP_NOEXCEPT { + restore(); + m_settingChanges.clear(); + } + + void restore() YAML_CPP_NOEXCEPT { + for (const auto& setting : m_settingChanges) + setting->pop(); + } + + void push(std::unique_ptr<SettingChangeBase> pSettingChange) { + m_settingChanges.push_back(std::move(pSettingChange)); + } private: - typedef std::vector<std::unique_ptr<SettingChangeBase>> setting_changes; + using setting_changes = std::vector<std::unique_ptr<SettingChangeBase>>; setting_changes m_settingChanges; }; -} +} // namespace YAML #endif // SETTING_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/src/simplekey.cpp b/src/libs/3rdparty/yaml-cpp/src/simplekey.cpp index 70f56b6ae42..67c2d712efe 100644 --- a/src/libs/3rdparty/yaml-cpp/src/simplekey.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/simplekey.cpp @@ -5,7 +5,11 @@ namespace YAML { struct Mark; Scanner::SimpleKey::SimpleKey(const Mark& mark_, std::size_t flowLevel_) - : mark(mark_), flowLevel(flowLevel_), pIndent(0), pMapStart(0), pKey(0) {} + : mark(mark_), + flowLevel(flowLevel_), + pIndent(nullptr), + pMapStart(nullptr), + pKey(nullptr) {} void Scanner::SimpleKey::Validate() { // Note: pIndent will *not* be garbage here; @@ -125,4 +129,4 @@ void Scanner::PopAllSimpleKeys() { while (!m_simpleKeys.empty()) m_simpleKeys.pop(); } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/singledocparser.cpp b/src/libs/3rdparty/yaml-cpp/src/singledocparser.cpp index a27c1c3b04d..22913d198c2 100644 --- a/src/libs/3rdparty/yaml-cpp/src/singledocparser.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/singledocparser.cpp @@ -7,6 +7,7 @@ #include "singledocparser.h" #include "tag.h" #include "token.h" +#include "yaml-cpp/depthguard.h" #include "yaml-cpp/emitterstyle.h" #include "yaml-cpp/eventhandler.h" #include "yaml-cpp/exceptions.h" // IWYU pragma: keep @@ -18,9 +19,10 @@ SingleDocParser::SingleDocParser(Scanner& scanner, const Directives& directives) : m_scanner(scanner), m_directives(directives), m_pCollectionStack(new CollectionStack), + m_anchors{}, m_curAnchor(0) {} -SingleDocParser::~SingleDocParser() {} +SingleDocParser::~SingleDocParser() = default; // HandleDocument // . Handles the next document @@ -46,6 +48,8 @@ void SingleDocParser::HandleDocument(EventHandler& eventHandler) { } void SingleDocParser::HandleNode(EventHandler& eventHandler) { + DepthGuard<500> depthguard(depth, m_scanner.mark(), ErrorMsg::BAD_FILE); + // an empty node *is* a possibility if (m_scanner.empty()) { eventHandler.OnNull(m_scanner.mark(), NullAnchor); @@ -71,20 +75,31 @@ void SingleDocParser::HandleNode(EventHandler& eventHandler) { } std::string tag; + std::string anchor_name; anchor_t anchor; - ParseProperties(tag, anchor); + ParseProperties(tag, anchor, anchor_name); - const Token& token = m_scanner.peek(); + if (!anchor_name.empty()) + eventHandler.OnAnchor(mark, anchor_name); - if (token.type == Token::PLAIN_SCALAR && IsNullString(token.value)) { + // after parsing properties, an empty node is again a possibility + if (m_scanner.empty()) { eventHandler.OnNull(mark, anchor); - m_scanner.pop(); return; } + const Token& token = m_scanner.peek(); + // add non-specific tags if (tag.empty()) tag = (token.type == Token::NON_PLAIN_SCALAR ? "!" : "?"); + + if (token.type == Token::PLAIN_SCALAR + && tag.compare("?") == 0 && IsNullString(token.value)) { + eventHandler.OnNull(mark, anchor); + m_scanner.pop(); + return; + } // now split based on what kind of node we should be switch (token.type) { @@ -152,7 +167,7 @@ void SingleDocParser::HandleBlockSequence(EventHandler& eventHandler) { m_scanner.pop(); m_pCollectionStack->PushCollectionType(CollectionType::BlockSeq); - while (1) { + while (true) { if (m_scanner.empty()) throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ); @@ -166,10 +181,10 @@ void SingleDocParser::HandleBlockSequence(EventHandler& eventHandler) { // check for null if (!m_scanner.empty()) { - const Token& token = m_scanner.peek(); - if (token.type == Token::BLOCK_ENTRY || - token.type == Token::BLOCK_SEQ_END) { - eventHandler.OnNull(token.mark, NullAnchor); + const Token& nextToken = m_scanner.peek(); + if (nextToken.type == Token::BLOCK_ENTRY || + nextToken.type == Token::BLOCK_SEQ_END) { + eventHandler.OnNull(nextToken.mark, NullAnchor); continue; } } @@ -185,7 +200,7 @@ void SingleDocParser::HandleFlowSequence(EventHandler& eventHandler) { m_scanner.pop(); m_pCollectionStack->PushCollectionType(CollectionType::FlowSeq); - while (1) { + while (true) { if (m_scanner.empty()) throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ_FLOW); @@ -238,7 +253,7 @@ void SingleDocParser::HandleBlockMap(EventHandler& eventHandler) { m_scanner.pop(); m_pCollectionStack->PushCollectionType(CollectionType::BlockMap); - while (1) { + while (true) { if (m_scanner.empty()) throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP); @@ -277,7 +292,7 @@ void SingleDocParser::HandleFlowMap(EventHandler& eventHandler) { m_scanner.pop(); m_pCollectionStack->PushCollectionType(CollectionType::FlowMap); - while (1) { + while (true) { if (m_scanner.empty()) throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP_FLOW); @@ -356,11 +371,13 @@ void SingleDocParser::HandleCompactMapWithNoKey(EventHandler& eventHandler) { // ParseProperties // . Grabs any tag or anchor tokens and deals with them. -void SingleDocParser::ParseProperties(std::string& tag, anchor_t& anchor) { +void SingleDocParser::ParseProperties(std::string& tag, anchor_t& anchor, + std::string& anchor_name) { tag.clear(); + anchor_name.clear(); anchor = NullAnchor; - while (1) { + while (true) { if (m_scanner.empty()) return; @@ -369,7 +386,7 @@ void SingleDocParser::ParseProperties(std::string& tag, anchor_t& anchor) { ParseTag(tag); break; case Token::ANCHOR: - ParseAnchor(anchor); + ParseAnchor(anchor, anchor_name); break; default: return; @@ -387,11 +404,12 @@ void SingleDocParser::ParseTag(std::string& tag) { m_scanner.pop(); } -void SingleDocParser::ParseAnchor(anchor_t& anchor) { +void SingleDocParser::ParseAnchor(anchor_t& anchor, std::string& anchor_name) { Token& token = m_scanner.peek(); if (anchor) throw ParserException(token.mark, ErrorMsg::MULTIPLE_ANCHORS); + anchor_name = token.value; anchor = RegisterAnchor(token.value); m_scanner.pop(); } @@ -405,10 +423,13 @@ anchor_t SingleDocParser::RegisterAnchor(const std::string& name) { anchor_t SingleDocParser::LookupAnchor(const Mark& mark, const std::string& name) const { - Anchors::const_iterator it = m_anchors.find(name); - if (it == m_anchors.end()) - throw ParserException(mark, ErrorMsg::UNKNOWN_ANCHOR); + auto it = m_anchors.find(name); + if (it == m_anchors.end()) { + std::stringstream ss; + ss << ErrorMsg::UNKNOWN_ANCHOR << name; + throw ParserException(mark, ss.str()); + } return it->second; } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/singledocparser.h b/src/libs/3rdparty/yaml-cpp/src/singledocparser.h index 2b92067cddb..f484eb1f957 100644 --- a/src/libs/3rdparty/yaml-cpp/src/singledocparser.h +++ b/src/libs/3rdparty/yaml-cpp/src/singledocparser.h @@ -12,10 +12,10 @@ #include <string> #include "yaml-cpp/anchor.h" -#include "yaml-cpp/noncopyable.h" namespace YAML { class CollectionStack; +template <int> class DepthGuard; // depthguard.h class EventHandler; class Node; class Scanner; @@ -23,9 +23,13 @@ struct Directives; struct Mark; struct Token; -class SingleDocParser : private noncopyable { +class SingleDocParser { public: SingleDocParser(Scanner& scanner, const Directives& directives); + SingleDocParser(const SingleDocParser&) = delete; + SingleDocParser(SingleDocParser&&) = delete; + SingleDocParser& operator=(const SingleDocParser&) = delete; + SingleDocParser& operator=(SingleDocParser&&) = delete; ~SingleDocParser(); void HandleDocument(EventHandler& eventHandler); @@ -43,23 +47,25 @@ class SingleDocParser : private noncopyable { void HandleCompactMap(EventHandler& eventHandler); void HandleCompactMapWithNoKey(EventHandler& eventHandler); - void ParseProperties(std::string& tag, anchor_t& anchor); + void ParseProperties(std::string& tag, anchor_t& anchor, + std::string& anchor_name); void ParseTag(std::string& tag); - void ParseAnchor(anchor_t& anchor); + void ParseAnchor(anchor_t& anchor, std::string& anchor_name); anchor_t RegisterAnchor(const std::string& name); anchor_t LookupAnchor(const Mark& mark, const std::string& name) const; private: + int depth = 0; Scanner& m_scanner; const Directives& m_directives; std::unique_ptr<CollectionStack> m_pCollectionStack; - typedef std::map<std::string, anchor_t> Anchors; + using Anchors = std::map<std::string, anchor_t>; Anchors m_anchors; anchor_t m_curAnchor; }; -} +} // namespace YAML #endif // SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/src/stream.cpp b/src/libs/3rdparty/yaml-cpp/src/stream.cpp index 3b013cfa7d3..b1aa092f693 100644 --- a/src/libs/3rdparty/yaml-cpp/src/stream.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/stream.cpp @@ -111,24 +111,15 @@ static UtfIntroState s_introTransitions[][uictMax] = { static char s_introUngetCount[][uictMax] = { // uict00, uictBB, uictBF, uictEF, uictFE, uictFF, uictAscii, uictOther - {0, 1, 1, 0, 0, 0, 0, 1}, - {0, 2, 2, 2, 2, 2, 2, 2}, - {3, 3, 3, 3, 0, 3, 3, 3}, - {4, 4, 4, 4, 4, 0, 4, 4}, - {1, 1, 1, 1, 1, 1, 1, 1}, - {1, 1, 1, 1, 1, 1, 1, 1}, - {2, 2, 2, 2, 2, 0, 2, 2}, - {2, 2, 2, 2, 0, 2, 2, 2}, - {0, 1, 1, 1, 1, 1, 1, 1}, - {0, 2, 2, 2, 2, 2, 2, 2}, - {1, 1, 1, 1, 1, 1, 1, 1}, - {1, 1, 1, 1, 1, 1, 1, 1}, - {0, 2, 2, 2, 2, 2, 2, 2}, - {0, 3, 3, 3, 3, 3, 3, 3}, - {4, 4, 4, 4, 4, 4, 4, 4}, - {2, 0, 2, 2, 2, 2, 2, 2}, - {3, 3, 0, 3, 3, 3, 3, 3}, - {1, 1, 1, 1, 1, 1, 1, 1}, + {0, 1, 1, 0, 0, 0, 0, 1}, {0, 2, 2, 2, 2, 2, 2, 2}, + {3, 3, 3, 3, 0, 3, 3, 3}, {4, 4, 4, 4, 4, 0, 4, 4}, + {1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1, 1}, + {2, 2, 2, 2, 2, 0, 2, 2}, {2, 2, 2, 2, 0, 2, 2, 2}, + {0, 1, 1, 1, 1, 1, 1, 1}, {0, 2, 2, 2, 2, 2, 2, 2}, + {1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1, 1}, + {0, 2, 2, 2, 2, 2, 2, 2}, {0, 3, 3, 3, 3, 3, 3, 3}, + {4, 4, 4, 4, 4, 4, 4, 4}, {2, 0, 2, 2, 2, 2, 2, 2}, + {3, 3, 0, 3, 3, 3, 3, 3}, {1, 1, 1, 1, 1, 1, 1, 1}, }; inline UtfIntroCharType IntroCharTypeOf(std::istream::int_type ch) { @@ -160,7 +151,8 @@ inline UtfIntroCharType IntroCharTypeOf(std::istream::int_type ch) { inline char Utf8Adjust(unsigned long ch, unsigned char lead_bits, unsigned char rshift) { - const unsigned char header = ((1 << lead_bits) - 1) << (8 - lead_bits); + const unsigned char header = + static_cast<unsigned char>(((1 << lead_bits) - 1) << (8 - lead_bits)); const unsigned char mask = (0xFF >> (lead_bits + 1)); return static_cast<char>( static_cast<unsigned char>(header | ((ch >> rshift) & mask))); @@ -192,17 +184,20 @@ inline void QueueUnicodeCodepoint(std::deque<char>& q, unsigned long ch) { Stream::Stream(std::istream& input) : m_input(input), + m_mark{}, + m_charSet{}, + m_readahead{}, m_pPrefetched(new unsigned char[YAML_PREFETCH_SIZE]), m_nPrefetchedAvailable(0), m_nPrefetchedUsed(0) { - typedef std::istream::traits_type char_traits; + using char_traits = std::istream::traits_type; if (!input) return; // Determine (or guess) the character-set by reading the BOM, if any. See // the YAML specification for the determination algorithm. - char_traits::int_type intro[4]; + char_traits::int_type intro[4]{}; int nIntroUsed = 0; UtfIntroState state = uis_start; for (; !s_introFinalState[state];) { @@ -279,9 +274,11 @@ char Stream::get() { // . Extracts 'n' characters from the stream and updates our position std::string Stream::get(int n) { std::string ret; - ret.reserve(n); - for (int i = 0; i < n; i++) - ret += get(); + if (n > 0) { + ret.reserve(static_cast<std::string::size_type>(n)); + for (int i = 0; i < n; i++) + ret += get(); + } return ret; } @@ -332,7 +329,7 @@ bool Stream::_ReadAheadTo(size_t i) const { void Stream::StreamInUtf8() const { unsigned char b = GetNextByte(); if (m_input.good()) { - m_readahead.push_back(b); + m_readahead.push_back(static_cast<char>(b)); } } @@ -353,7 +350,9 @@ void Stream::StreamInUtf16() const { // Trailing (low) surrogate...ugh, wrong order QueueUnicodeCodepoint(m_readahead, CP_REPLACEMENT_CHARACTER); return; - } else if (ch >= 0xD800 && ch < 0xDC00) { + } + + if (ch >= 0xD800 && ch < 0xDC00) { // ch is a leading (high) surrogate // Four byte UTF-8 code point @@ -378,11 +377,10 @@ void Stream::StreamInUtf16() const { // Easiest case: queue the codepoint and return QueueUnicodeCodepoint(m_readahead, ch); return; - } else { - // Start the loop over with the new high surrogate - ch = chLow; - continue; } + // Start the loop over with the new high surrogate + ch = chLow; + continue; } // Select the payload bits from the high surrogate @@ -445,4 +443,4 @@ void Stream::StreamInUtf32() const { QueueUnicodeCodepoint(m_readahead, ch); } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/stream.h b/src/libs/3rdparty/yaml-cpp/src/stream.h index 42d542d5b16..2bc7a152165 100644 --- a/src/libs/3rdparty/yaml-cpp/src/stream.h +++ b/src/libs/3rdparty/yaml-cpp/src/stream.h @@ -7,7 +7,6 @@ #pragma once #endif -#include "yaml-cpp/noncopyable.h" #include "yaml-cpp/mark.h" #include <cstddef> #include <deque> @@ -17,11 +16,18 @@ #include <string> namespace YAML { -class Stream : private noncopyable { + +class StreamCharSource; + +class Stream { public: friend class StreamCharSource; Stream(std::istream& input); + Stream(const Stream&) = delete; + Stream(Stream&&) = delete; + Stream& operator=(const Stream&) = delete; + Stream& operator=(Stream&&) = delete; ~Stream(); operator bool() const; @@ -71,6 +77,6 @@ inline bool Stream::ReadAheadTo(size_t i) const { return true; return _ReadAheadTo(i); } -} +} // namespace YAML #endif // STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/src/streamcharsource.h b/src/libs/3rdparty/yaml-cpp/src/streamcharsource.h index 624599e65da..826ba5347ee 100644 --- a/src/libs/3rdparty/yaml-cpp/src/streamcharsource.h +++ b/src/libs/3rdparty/yaml-cpp/src/streamcharsource.h @@ -7,16 +7,20 @@ #pragma once #endif -#include "yaml-cpp/noncopyable.h" +#include "yaml-cpp/noexcept.h" +#include "stream.h" #include <cstddef> namespace YAML { + class StreamCharSource { public: StreamCharSource(const Stream& stream) : m_offset(0), m_stream(stream) {} - StreamCharSource(const StreamCharSource& source) - : m_offset(source.m_offset), m_stream(source.m_stream) {} - ~StreamCharSource() {} + StreamCharSource(const StreamCharSource& source) = default; + StreamCharSource(StreamCharSource&&) YAML_CPP_NOEXCEPT = default; + StreamCharSource& operator=(const StreamCharSource&) = delete; + StreamCharSource& operator=(StreamCharSource&&) = delete; + ~StreamCharSource() = default; operator bool() const; char operator[](std::size_t i) const { return m_stream.CharAt(m_offset + i); } @@ -27,8 +31,6 @@ class StreamCharSource { private: std::size_t m_offset; const Stream& m_stream; - - StreamCharSource& operator=(const StreamCharSource&); // non-assignable }; inline StreamCharSource::operator bool() const { @@ -38,11 +40,11 @@ inline StreamCharSource::operator bool() const { inline const StreamCharSource StreamCharSource::operator+(int i) const { StreamCharSource source(*this); if (static_cast<int>(source.m_offset) + i >= 0) - source.m_offset += i; + source.m_offset += static_cast<std::size_t>(i); else source.m_offset = 0; return source; } -} +} // namespace YAML #endif // STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/src/tag.cpp b/src/libs/3rdparty/yaml-cpp/src/tag.cpp index 51435520e46..35a1b465604 100644 --- a/src/libs/3rdparty/yaml-cpp/src/tag.cpp +++ b/src/libs/3rdparty/yaml-cpp/src/tag.cpp @@ -6,7 +6,8 @@ #include "token.h" namespace YAML { -Tag::Tag(const Token& token) : type(static_cast<TYPE>(token.data)) { +Tag::Tag(const Token& token) + : type(static_cast<TYPE>(token.data)), handle{}, value{} { switch (type) { case VERBATIM: value = token.value; @@ -28,7 +29,7 @@ Tag::Tag(const Token& token) : type(static_cast<TYPE>(token.data)) { } } -const std::string Tag::Translate(const Directives& directives) { +std::string Tag::Translate(const Directives& directives) { switch (type) { case VERBATIM: return value; @@ -46,4 +47,4 @@ const std::string Tag::Translate(const Directives& directives) { } throw std::runtime_error("yaml-cpp: internal error, bad tag type"); } -} +} // namespace YAML diff --git a/src/libs/3rdparty/yaml-cpp/src/tag.h b/src/libs/3rdparty/yaml-cpp/src/tag.h index ac30673b9e8..c811f395597 100644 --- a/src/libs/3rdparty/yaml-cpp/src/tag.h +++ b/src/libs/3rdparty/yaml-cpp/src/tag.h @@ -23,7 +23,7 @@ struct Tag { }; Tag(const Token& token); - const std::string Translate(const Directives& directives); + std::string Translate(const Directives& directives); TYPE type; std::string handle, value; diff --git a/src/libs/3rdparty/yaml-cpp/src/token.h b/src/libs/3rdparty/yaml-cpp/src/token.h index ad0b7d0a005..9c9a5b77982 100644 --- a/src/libs/3rdparty/yaml-cpp/src/token.h +++ b/src/libs/3rdparty/yaml-cpp/src/token.h @@ -14,10 +14,11 @@ namespace YAML { const std::string TokenNames[] = { - "DIRECTIVE", "DOC_START", "DOC_END", "BLOCK_SEQ_START", "BLOCK_MAP_START", - "BLOCK_SEQ_END", "BLOCK_MAP_END", "BLOCK_ENTRY", "FLOW_SEQ_START", - "FLOW_MAP_START", "FLOW_SEQ_END", "FLOW_MAP_END", "FLOW_MAP_COMPACT", - "FLOW_ENTRY", "KEY", "VALUE", "ANCHOR", "ALIAS", "TAG", "SCALAR"}; + "DIRECTIVE", "DOC_START", "DOC_END", "BLOCK_SEQ_START", + "BLOCK_MAP_START", "BLOCK_SEQ_END", "BLOCK_MAP_END", "BLOCK_ENTRY", + "FLOW_SEQ_START", "FLOW_MAP_START", "FLOW_SEQ_END", "FLOW_MAP_END", + "FLOW_MAP_COMPACT", "FLOW_ENTRY", "KEY", "VALUE", + "ANCHOR", "ALIAS", "TAG", "SCALAR"}; struct Token { // enums @@ -48,12 +49,12 @@ struct Token { // data Token(TYPE type_, const Mark& mark_) - : status(VALID), type(type_), mark(mark_), data(0) {} + : status(VALID), type(type_), mark(mark_), value{}, params{}, data(0) {} friend std::ostream& operator<<(std::ostream& out, const Token& token) { out << TokenNames[token.type] << std::string(": ") << token.value; - for (std::size_t i = 0; i < token.params.size(); i++) - out << std::string(" ") << token.params[i]; + for (const std::string& param : token.params) + out << std::string(" ") << param; return out; } @@ -64,6 +65,6 @@ struct Token { std::vector<std::string> params; int data; }; -} +} // namespace YAML #endif // TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/libs/3rdparty/yaml-cpp/yaml-cpp.pc.cmake b/src/libs/3rdparty/yaml-cpp/yaml-cpp.pc.cmake deleted file mode 100644 index 3db7962eaf5..00000000000 --- a/src/libs/3rdparty/yaml-cpp/yaml-cpp.pc.cmake +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -includedir=${prefix}/@INCLUDE_INSTALL_ROOT_DIR@ -libdir=${exec_prefix}/@LIB_INSTALL_DIR@ - -Name: Yaml-cpp -Description: A YAML parser and emitter for C++ -Version: @YAML_CPP_VERSION@ -Requires: -Libs: -L${libdir} -lyaml-cpp -Cflags: -I${includedir} diff --git a/src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs b/src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs index ca39a4864f9..8685f6842d5 100644 --- a/src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs +++ b/src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs @@ -10,6 +10,7 @@ Project { files: [ "include/yaml-cpp/anchor.h", "include/yaml-cpp/binary.h", + "include/yaml-cpp/depthguard.h", "include/yaml-cpp/dll.h", "include/yaml-cpp/emitfromevents.h", "include/yaml-cpp/emitter.h", @@ -19,10 +20,10 @@ Project { "include/yaml-cpp/eventhandler.h", "include/yaml-cpp/exceptions.h", "include/yaml-cpp/mark.h", + "include/yaml-cpp/noexcept.h", "include/yaml-cpp/node", "include/yaml-cpp/node/convert.h", "include/yaml-cpp/node/detail", - "include/yaml-cpp/node/detail/bool_type.h", "include/yaml-cpp/node/detail/impl.h", "include/yaml-cpp/node/detail/iterator.h", "include/yaml-cpp/node/detail/iterator_fwd.h", @@ -38,7 +39,6 @@ Project { "include/yaml-cpp/node/parse.h", "include/yaml-cpp/node/ptr.h", "include/yaml-cpp/node/type.h", - "include/yaml-cpp/noncopyable.h", "include/yaml-cpp/null.h", "include/yaml-cpp/ostream_wrapper.h", "include/yaml-cpp/parser.h", @@ -48,6 +48,7 @@ Project { "src/binary.cpp", "src/collectionstack.h", "src/convert.cpp", + "src/depthguard.cpp", "src/directives.cpp", "src/directives.h", "src/emit.cpp", From 9664f47cd6cc40a9df863fa8ffd6cf9d605f1efc Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 25 Aug 2023 14:39:19 +0200 Subject: [PATCH 0876/1777] Utils: Add storeFromMap / mapFromStore Facilitate conversion from QVariantMap to Store to allow easy serialization via QJsonDocument::fromVariant / QJsonDocument::toVariant. Change-Id: Icb5c764ccdfdbaf402045224f5b02e4818d7ee2f Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/CMakeLists.txt | 1 + src/libs/utils/storefrommap.h | 91 +++++++++++++++++++++++++++++++++++ src/libs/utils/utils.qbs | 1 + 3 files changed, 93 insertions(+) create mode 100644 src/libs/utils/storefrommap.h diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 72c18e3346f..0d231e47ad8 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -163,6 +163,7 @@ add_qtc_library(Utils statuslabel.cpp statuslabel.h store.cpp store.h storekey.h + storefrommap.h stringtable.cpp stringtable.h stringutils.cpp stringutils.h styleanimator.cpp styleanimator.h diff --git a/src/libs/utils/storefrommap.h b/src/libs/utils/storefrommap.h new file mode 100644 index 00000000000..6d2d760f86f --- /dev/null +++ b/src/libs/utils/storefrommap.h @@ -0,0 +1,91 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "store.h" + +namespace Utils { + +#ifdef QTC_USE_STORE + +inline Store storeFromMap(const QVariantMap &map); +inline QVariantMap mapFromStore(const Store &store); + +inline QVariantList storeListFromMapList(const QVariantList &mapList) +{ + QVariantList storeList; + + for (const auto &mapEntry : mapList) { + if (mapEntry.type() == QVariant::Map) + storeList.append(QVariant::fromValue(storeFromMap(mapEntry.toMap()))); + else if (mapEntry.type() == QVariant::List) + storeList.append(QVariant::fromValue(storeListFromMapList(mapEntry.toList()))); + else + storeList.append(mapEntry); + } + + return storeList; +} + +inline QVariantList mapListFromStoreList(const QVariantList &storeList) +{ + QVariantList mapList; + + for (const auto &storeEntry : storeList) { + if (storeEntry.metaType() == QMetaType::fromType<Store>()) + mapList.append(QVariant::fromValue(mapFromStore(storeEntry.value<Store>()))); + else if (storeEntry.type() == QVariant::List) + mapList.append(QVariant::fromValue(mapListFromStoreList(storeEntry.toList()))); + else + mapList.append(storeEntry); + } + + return mapList; +} + +inline Store storeFromMap(const QVariantMap &map) +{ + Store store; + for (auto it = map.begin(); it != map.end(); ++it) { + if (it.value().type() == QVariant::Map) { + store.insert(keyFromString(it.key()), QVariant::fromValue(storeFromMap(it->toMap()))); + } else if (it.value().type() == QVariant::List) { + store.insert(keyFromString(it.key()), + QVariant::fromValue(storeListFromMapList(it->toList()))); + } else { + store.insert(keyFromString(it.key()), it.value()); + } + } + return store; +} + +inline QVariantMap mapFromStore(const Store &store) +{ + QVariantMap map; + for (auto it = store.begin(); it != store.end(); ++it) { + if (it.value().metaType() == QMetaType::fromType<Store>()) + map.insert(stringFromKey(it.key()), mapFromStore(it->value<Store>())); + else if (it.value().type() == QVariant::List) + map.insert(stringFromKey(it.key()), mapListFromStoreList(it->toList())); + else + map.insert(stringFromKey(it.key()), it.value()); + } + return map; +} + +#else + +inline Store storeFromMap(const QVariantMap &map) +{ + return map; +} + +inline QVariantMap mapFromStore(const Store &store) +{ + return store; +} + +#endif + +} // namespace Utils diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 021c1d37f26..b6d0839167a 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -296,6 +296,7 @@ Project { "store.cpp", "store.h", "storekey.h", + "storefrommap.h", "stringtable.cpp", "stringtable.h", "stringutils.cpp", From a331f0a8c8728cb9940b0fd49799484a4532321e Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 17 Aug 2023 08:50:33 +0200 Subject: [PATCH 0877/1777] CompilerExplorer: Implement saving documents Change-Id: Iccfd300a9f0fc25bafae9892c14f172874a99ce1 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/compilerexplorer/api/compile.h | 6 +- .../compilerexploreraspects.h | 137 ++++++ .../compilerexplorereditor.cpp | 443 ++++++++++++++---- .../compilerexplorer/compilerexplorereditor.h | 78 ++- .../compilerexplorerplugin.cpp | 12 +- .../compilerexplorersettings.cpp | 210 ++++++--- .../compilerexplorersettings.h | 105 +++-- 7 files changed, 782 insertions(+), 209 deletions(-) diff --git a/src/plugins/compilerexplorer/api/compile.h b/src/plugins/compilerexplorer/api/compile.h index d5b93eaa469..618af39a246 100644 --- a/src/plugins/compilerexplorer/api/compile.h +++ b/src/plugins/compilerexplorer/api/compile.h @@ -133,11 +133,11 @@ struct CompileParameters return *this; } - Options &libraries(const CompilerExplorer::LibrarySelectionAspect &aspect) + Options &libraries(const QMap<QString, QString> &libraries) { Libraries result; - for (const auto &key : aspect.value().keys()) { - result.add(key, aspect.value()[key]); + for (const auto &key : libraries.keys()) { + result.add(key, libraries[key]); } obj["libraries"] = result.array; return *this; diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.h b/src/plugins/compilerexplorer/compilerexploreraspects.h index dfd0a46b73e..b713a64e655 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.h +++ b/src/plugins/compilerexplorer/compilerexploreraspects.h @@ -7,6 +7,9 @@ #include <QComboBox> #include <QItemSelectionModel> +#include <QJsonArray> +#include <QJsonDocument> +#include <QJsonObject> #include <QStandardItemModel> namespace CompilerExplorer { @@ -67,4 +70,138 @@ private: QStandardItemModel *m_model{nullptr}; }; +template<class T> +class AspectListAspect : public Utils::BaseAspect +{ +public: + using ToBaseAspectPtr = std::function<Utils::BaseAspect *(const T &)>; + using CreateItem = std::function<T()>; + using ItemCallback = std::function<void(const T &)>; + using IsDirty = std::function<bool(const T &)>; + using Apply = std::function<void(const T &)>; + + AspectListAspect(Utils::AspectContainer *container = nullptr) + : Utils::BaseAspect(container) + {} + + void fromMap(const QVariantMap &map) override + { + QTC_ASSERT(!settingsKey().isEmpty(), return); + + QVariantList list = map[settingsKey()].toList(); + for (const auto &entry : list) { + T item = m_createItem(); + m_toBaseAspect(item)->fromMap(entry.toMap()); + m_volatileItems.append(item); + } + m_items = m_volatileItems; + } + + QVariantList toList(bool v) const + { + QVariantList list; + const auto &items = v ? m_volatileItems : m_items; + + for (const auto &item : items) { + QVariantMap childMap; + if (v) + m_toBaseAspect(item)->volatileToMap(childMap); + else + m_toBaseAspect(item)->toMap(childMap); + + list.append(childMap); + } + + return list; + } + + void toMap(Utils::Store &map) const override + { + QTC_ASSERT(!settingsKey().isEmpty(), return); + const QString key = settingsKey(); + map[key] = toList(false); + } + + void volatileToMap(Utils::Store &map) const override + { + QTC_ASSERT(!settingsKey().isEmpty(), return); + const QString key = settingsKey(); + map[key] = toList(true); + } + + T addItem(T item) + { + m_volatileItems.append(item); + if (m_itemAdded) + m_itemAdded(item); + emit volatileValueChanged(); + if (isAutoApply()) + apply(); + return item; + } + + void removeItem(T item) + { + m_volatileItems.removeOne(item); + if (m_itemRemoved) + m_itemRemoved(item); + emit volatileValueChanged(); + if (isAutoApply()) + apply(); + } + + void apply() override + { + m_items = m_volatileItems; + if (m_apply) + forEachItem(m_apply); + emit changed(); + } + + void setToBaseAspectFunction(ToBaseAspectPtr toBaseAspect) { m_toBaseAspect = toBaseAspect; } + void setCreateItemFunction(CreateItem createItem) { m_createItem = createItem; } + void setIsDirtyFunction(IsDirty isDirty) { m_isDirty = isDirty; } + void setApplyFunction(Apply apply) { m_apply = apply; } + + void forEachItem(std::function<void(const T &)> callback) + { + for (const auto &item : m_volatileItems) + callback(item); + } + + void forEachItem(std::function<void(const T &, int)> callback) + { + int idx = 0; + for (const auto &item : m_volatileItems) + callback(item, idx++); + } + + void setItemAddedCallback(const ItemCallback &callback) { m_itemAdded = callback; } + void setItemRemovedCallback(const ItemCallback &callback) { m_itemRemoved = callback; } + + qsizetype size() { return m_volatileItems.size(); } + bool isDirty() override + { + if (m_isDirty) { + for (const auto &item : m_volatileItems) { + if (m_isDirty(item)) + return true; + } + } + return false; + } + + QVariant volatileVariantValue() const override { return {}; }; + +private: + QList<T> m_items; + QList<T> m_volatileItems; + ToBaseAspectPtr m_toBaseAspect; + CreateItem m_createItem; + IsDirty m_isDirty; + Apply m_apply; + ItemCallback m_itemAdded; + ItemCallback m_itemRemoved; +}; + } // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 122a32c21e4..c43d3a3a34d 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -20,10 +20,11 @@ #include <projectexplorer/projectexplorerconstants.h> +#include <utils/algorithm.h> #include <utils/hostosinfo.h> #include <utils/layoutbuilder.h> -#include <utils/mimeutils.h> #include <utils/mimetypes2/mimetype.h> +#include <utils/mimeutils.h> #include <utils/utilsicons.h> #include <QCompleter> @@ -49,7 +50,7 @@ namespace CompilerExplorer { class CodeEditorWidget : public TextEditorWidget { public: - CodeEditorWidget(Settings *settings) + CodeEditorWidget(const std::shared_ptr<SourceSettings> &settings) : m_settings(settings){}; void updateHighlighter() @@ -62,26 +63,195 @@ public: configureGenericHighlighter(mimeType); } -private: - Settings *m_settings; + std::shared_ptr<SourceSettings> m_settings; }; -CompilerWidget::CompilerWidget() - : m_compilerSettings(&settings()) +class SourceTextDocument : public TextDocument +{ +public: + SourceTextDocument(const std::shared_ptr<SourceSettings> &settings) + { + setPlainText(settings->source()); + + connect(this, &TextDocument::contentsChanged, this, [settings, this] { + settings->source.setVolatileValue(plainText()); + }); + + connect(&settings->source, &Utils::StringAspect::changed, this, [settings, this] { + if (settings->source.volatileValue() != plainText()) + setPlainText(settings->source.volatileValue()); + }); + } +}; + +JsonSettingsDocument::JsonSettingsDocument(CompilerExplorerSettings *ceSettings) + : m_ceSettings(ceSettings) +{ + setId(Constants::CE_EDITOR_ID); + + connect(m_ceSettings, &CompilerExplorerSettings::changed, this, [this] { emit changed(); }); +} + +Core::IDocument::OpenResult JsonSettingsDocument::open(QString *errorString, + const Utils::FilePath &filePath, + const Utils::FilePath &realFilePath) +{ + if (!filePath.isReadableFile()) + return OpenResult::ReadError; + + auto contents = realFilePath.fileContents(); + if (!contents) { + if (errorString) + *errorString = contents.error(); + return OpenResult::ReadError; + } + + QJsonParseError error; + QJsonDocument doc = QJsonDocument::fromJson(*contents, &error); + if (error.error != QJsonParseError::NoError) { + if (errorString) + *errorString = error.errorString(); + return OpenResult::CannotHandle; + } + + if (!doc.isObject()) { + if (errorString) + *errorString = Tr::tr("Not a valid JSON object."); + return OpenResult::CannotHandle; + } + + m_ceSettings->fromMap(doc.toVariant().toMap()); + emit settingsChanged(); + return OpenResult::Success; +} + +bool JsonSettingsDocument::saveImpl(QString *errorString, + const Utils::FilePath &newFilePath, + bool autoSave) +{ + QVariantMap map; + + if (autoSave) { + if (m_windowStateCallback) + m_ceSettings->windowState.setVolatileValue(m_windowStateCallback()); + + m_ceSettings->volatileToMap(map); + } else { + if (m_windowStateCallback) + m_ceSettings->windowState.setValue(m_windowStateCallback()); + + m_ceSettings->apply(); + m_ceSettings->toMap(map); + } + + QJsonDocument doc = QJsonDocument::fromVariant(map); + + Utils::FilePath path = newFilePath.isEmpty() ? filePath() : newFilePath; + + if (!newFilePath.isEmpty() && !autoSave) + setFilePath(newFilePath); + + auto result = path.writeFileContents(doc.toJson(QJsonDocument::Indented)); + if (!result && errorString) { + *errorString = result.error(); + return false; + } + + return true; +} + +bool JsonSettingsDocument::isModified() const +{ + bool isDirty = m_ceSettings->isDirty(); + return isDirty; +} + +bool JsonSettingsDocument::setContents(const QByteArray &contents) +{ + QJsonParseError error; + QJsonDocument doc = QJsonDocument::fromJson(contents, &error); + QTC_ASSERT(error.error == QJsonParseError::NoError, return false); + + QTC_ASSERT(doc.isObject(), return false); + + m_ceSettings->fromMap(doc.toVariant().toMap()); + + emit settingsChanged(); + return true; +} + +SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &settings) + : m_sourceSettings(settings) +{ + m_codeEditor = new CodeEditorWidget(m_sourceSettings); + + TextDocumentPtr document = TextDocumentPtr(new SourceTextDocument(m_sourceSettings)); + + connect(document.get(), + &SourceTextDocument::changed, + this, + &SourceEditorWidget::sourceCodeChanged); + + m_codeEditor->setTextDocument(document); + m_codeEditor->updateHighlighter(); + + auto addCompilerButton = new QPushButton; + addCompilerButton->setText(Tr::tr("Add compiler")); + connect(addCompilerButton, &QPushButton::clicked, this, [this] { + auto newCompiler = std::make_shared<CompilerSettings>(m_sourceSettings->apiConfigFunction()); + newCompiler->setLanguageId(m_sourceSettings->languageId()); + m_sourceSettings->compilers.addItem(newCompiler); + }); + + // clang-format off + using namespace Layouting; + + Column { + Row { + settings->languageId, + addCompilerButton, + }, + m_codeEditor, + }.attachTo(this); + // clang-format on + + setWindowTitle("Source code"); + setObjectName("source_code"); + + Aggregate *agg = Aggregate::parentAggregate(m_codeEditor); + if (!agg) { + agg = new Aggregate; + agg->add(m_codeEditor); + } + agg->add(this); + + setFocusProxy(m_codeEditor); +} + +QString SourceEditorWidget::sourceCode() +{ + if (m_codeEditor && m_codeEditor->textDocument()) + return QString::fromUtf8(m_codeEditor->textDocument()->contents()); + return {}; +} + +CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSettings, + const std::shared_ptr<CompilerSettings> &compilerSettings) + : m_sourceSettings(sourceSettings) + , m_compilerSettings(compilerSettings) { using namespace Layouting; QVariantMap map; - m_compilerSettings.setAutoApply(true); - m_delayTimer = new QTimer(this); m_delayTimer->setSingleShot(true); m_delayTimer->setInterval(500ms); connect(m_delayTimer, &QTimer::timeout, this, &CompilerWidget::doCompile); - for (const auto &aspect : m_compilerSettings.aspects()) - QTC_CHECK( - connect(aspect, &Utils::BaseAspect::changed, m_delayTimer, qOverload<>(&QTimer::start))); + connect(m_compilerSettings.get(), + &CompilerSettings::changed, + m_delayTimer, + qOverload<>(&QTimer::start)); m_asmEditor = new TextEditorWidget; m_asmDocument = QSharedPointer<TextDocument>(new TextDocument); @@ -96,7 +266,7 @@ CompilerWidget::CompilerWidget() advDlg->setIcon(Utils::Icons::SETTINGS_TOOLBAR.icon()); advDlg->setIconText(Tr::tr("Advanced Options")); connect(advDlg, &QAction::triggered, this, [advButton, this] { - CompilerExplorerOptions *dlg = new CompilerExplorerOptions(m_compilerSettings, advButton); + CompilerExplorerOptions *dlg = new CompilerExplorerOptions(*m_compilerSettings, advButton); dlg->setAttribute(Qt::WA_DeleteOnClose); dlg->setWindowFlag(Qt::WindowType::Popup); dlg->show(); @@ -108,10 +278,16 @@ CompilerWidget::CompilerWidget() connect(advButton, &QPushButton::clicked, advDlg, &QAction::trigger); advButton->setIcon(advDlg->icon()); + compile(m_sourceSettings->source()); + + connect(&m_sourceSettings->source, &Utils::StringAspect::volatileValueChanged, this, [this] { + compile(m_sourceSettings->source.volatileValue()); + }); + // clang-format off Column { Row { - m_compilerSettings.compiler, + m_compilerSettings->compiler, advButton, }, Splitter { @@ -125,6 +301,11 @@ CompilerWidget::CompilerWidget() m_spinner = new SpinnerSolution::Spinner(SpinnerSolution::SpinnerSize::Large, this); } +CompilerWidget::~CompilerWidget() +{ + qDebug() << "Good bye!"; +} + Core::SearchableTerminal *CompilerWidget::createTerminal() { m_resultTerminal = new Core::SearchableTerminal(); @@ -166,33 +347,34 @@ void CompilerWidget::doCompile() { using namespace Api; - QString compilerId = m_compilerSettings.compiler(); + QString compilerId = m_compilerSettings->compiler(); if (compilerId.isEmpty()) compilerId = "clang_trunk"; m_spinner->setVisible(true); m_asmEditor->setEnabled(false); - CompileParameters params = CompileParameters(compilerId) - .source(m_source) - .language(settings().languageId()) - .options(CompileParameters::Options() - .userArguments(m_compilerSettings.compilerOptions()) - .compilerOptions({false, false}) - .filters({false, - m_compilerSettings.compileToBinaryObject(), - true, - m_compilerSettings.demangleIdentifiers(), - true, - m_compilerSettings.executeCode(), - m_compilerSettings.intelAsmSyntax(), - true, - false, - false, - false}) - .libraries(m_compilerSettings.libraries)); + CompileParameters params + = CompileParameters(compilerId) + .source(m_source) + .language(m_sourceSettings->languageId.volatileValue()) + .options(CompileParameters::Options() + .userArguments(m_compilerSettings->compilerOptions.volatileValue()) + .compilerOptions({false, false}) + .filters({false, + m_compilerSettings->compileToBinaryObject.volatileValue(), + true, + m_compilerSettings->demangleIdentifiers.volatileValue(), + true, + m_compilerSettings->executeCode.volatileValue(), + m_compilerSettings->intelAsmSyntax.volatileValue(), + true, + false, + false, + false}) + .libraries(m_compilerSettings->libraries.volatileValue())); - auto f = Api::compile(settings().apiConfig(), params); + auto f = Api::compile(m_sourceSettings->apiConfigFunction()(), params); m_compileWatcher.reset(new QFutureWatcher<CompileResult>); @@ -273,105 +455,170 @@ void CompilerWidget::doCompile() m_compileWatcher->setFuture(f); } -EditorWidget::EditorWidget(TextDocumentPtr document, QWidget *parent) +EditorWidget::EditorWidget(QSharedPointer<JsonSettingsDocument> document, QWidget *parent) : Utils::FancyMainWindow(parent) + , m_document(document) { setAutoHideTitleBars(false); setDockNestingEnabled(true); setDocumentMode(true); setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::TabPosition::South); - using namespace Layouting; + document->setWindowStateCallback([this] { + auto settings = saveSettings(); + QVariantMap result; - m_codeEditor = new CodeEditorWidget(&settings()); - m_codeEditor->setTextDocument(document); - m_codeEditor->updateHighlighter(); + for (const auto &key : settings.keys()) { + // QTBUG-116339 + if (key != "State") { + result.insert(key, settings.value(key)); + } else { + QVariantMap m; + m["type"] = "Base64"; + m["value"] = settings.value(key).toByteArray().toBase64(); + result.insert(key, m); + } + } - auto addCompilerButton = new QPushButton; - addCompilerButton->setText(Tr::tr("Add compiler")); - connect(addCompilerButton, &QPushButton::clicked, this, &EditorWidget::addCompiler); + return result; + }); - // clang-format off - auto source = - Column { - Row { - settings().languageId, - settings().compilerExplorerUrl, - addCompilerButton, - }, - m_codeEditor, - }.emerge(); - // clang-format on + auto addCompiler = [this](const std::shared_ptr<SourceSettings> &sourceSettings, + const std::shared_ptr<CompilerSettings> &compilerSettings, + int idx) { + auto compiler = new CompilerWidget(sourceSettings, compilerSettings); + compiler->setWindowTitle("Compiler #" + QString::number(idx)); + compiler->setObjectName("compiler_" + QString::number(idx)); + QDockWidget *dockWidget = addDockForWidget(compiler); + addDockWidget(Qt::RightDockWidgetArea, dockWidget); + m_compilerWidgets.append(dockWidget); + }; - source->setWindowTitle("Source code"); - source->setObjectName("source_code"); - addDockWidget(Qt::LeftDockWidgetArea, addDockForWidget(source)); + auto addSourceEditor = [this, document, addCompiler]( + const std::shared_ptr<SourceSettings> &sourceSettings) { + auto sourceEditor = new SourceEditorWidget(sourceSettings); + sourceEditor->setWindowTitle("Source Code #" + QString::number(m_sourceWidgets.size() + 1)); + sourceEditor->setObjectName("source_code_editor_" + + QString::number(m_sourceWidgets.size() + 1)); - addCompiler(); + QDockWidget *dockWidget = addDockForWidget(sourceEditor); + connect(dockWidget, + &QDockWidget::visibilityChanged, + this, + [document, sourceSettings = sourceSettings.get(), dockWidget] { + if (!dockWidget->isVisible()) + document->settings()->m_sources.removeItem( + sourceSettings->shared_from_this()); + }); - Aggregate *agg = Aggregate::parentAggregate(m_codeEditor); - if (!agg) { - agg = new Aggregate; - agg->add(m_codeEditor); - } - agg->add(this); + addDockWidget(Qt::LeftDockWidgetArea, dockWidget); + + sourceSettings->compilers.forEachItem( + [addCompiler, sourceSettings](const std::shared_ptr<CompilerSettings> &compilerSettings, + int idx) { + addCompiler(sourceSettings, compilerSettings, idx + 1); + }); + + sourceSettings->compilers.setItemAddedCallback( + [addCompiler, sourceSettings = sourceSettings.get()]( + const std::shared_ptr<CompilerSettings> &compilerSettings) { + addCompiler(sourceSettings->shared_from_this(), + compilerSettings, + sourceSettings->compilers.size()); + }); + + sourceSettings->compilers.setItemRemovedCallback( + [this](const std::shared_ptr<CompilerSettings> &compilerSettings) { + m_compilerWidgets.removeIf([compilerSettings](const QDockWidget *c) { + return static_cast<CompilerWidget *>(c->widget())->m_compilerSettings + == compilerSettings; + }); + }); + + Aggregate *agg = Aggregate::parentAggregate(sourceEditor); + if (!agg) { + agg = new Aggregate; + agg->add(sourceEditor); + } + agg->add(this); + + setFocusProxy(sourceEditor); + + m_sourceWidgets.append(dockWidget); + }; + + auto removeSourceEditor = [this](const std::shared_ptr<SourceSettings> &sourceSettings) { + m_sourceWidgets.removeIf([sourceSettings = sourceSettings.get()](const QDockWidget *c) { + return static_cast<SourceEditorWidget *>(c->widget())->m_sourceSettings + == sourceSettings->shared_from_this(); + }); + }; + + auto recreateEditors = [this, addSourceEditor]() { + qDeleteAll(m_sourceWidgets); + qDeleteAll(m_compilerWidgets); + + m_sourceWidgets.clear(); + m_compilerWidgets.clear(); + + m_document->settings()->m_sources.forEachItem(addSourceEditor); + QVariantMap windowState = m_document->settings()->windowState.value(); + + if (!windowState.isEmpty()) { + QHash<QString, QVariant> hashMap; + for (const auto &key : windowState.keys()) { + if (key != "State") + hashMap.insert(key, windowState.value(key)); + else { + QVariant v = windowState.value(key); + if (v.userType() == QMetaType::QByteArray) { + hashMap.insert(key, v); + } else if (v.userType() == QMetaType::QVariantMap) { + QVariantMap m = v.toMap(); + if (m.value("type") == "Base64") { + hashMap.insert(key, + QByteArray::fromBase64(m.value("value").toByteArray())); + } + } + } + } + + restoreSettings(hashMap); + } + }; + + document->settings()->m_sources.setItemAddedCallback(addSourceEditor); + document->settings()->m_sources.setItemRemovedCallback(removeSourceEditor); + connect(document.get(), &JsonSettingsDocument::settingsChanged, this, recreateEditors); m_context = new Core::IContext(this); m_context->setWidget(this); m_context->setContext(Core::Context(Constants::CE_EDITOR_CONTEXT_ID)); Core::ICore::addContextObject(m_context); - - connect(m_codeEditor, &QPlainTextEdit::textChanged, this, &EditorWidget::sourceCodeChanged); - - connect(&settings(), - &Settings::languagesChanged, - m_codeEditor, - &CodeEditorWidget::updateHighlighter); - - connect(&settings().languageId, - &StringSelectionAspect::changed, - this, - &EditorWidget::onLanguageChanged); - - setFocusProxy(m_codeEditor); } -void EditorWidget::onLanguageChanged() +EditorWidget::~EditorWidget() { - m_codeEditor->updateHighlighter(); -} - -void EditorWidget::addCompiler() -{ - m_compilerCount++; - - auto compiler = new CompilerWidget; - compiler->setWindowTitle("Compiler #" + QString::number(m_compilerCount)); - compiler->setObjectName("compiler_" + QString::number(m_compilerCount)); - - addDockWidget(Qt::RightDockWidgetArea, addDockForWidget(compiler)); - - if (m_codeEditor && m_codeEditor->textDocument()) - compiler->compile(QString::fromUtf8(m_codeEditor->textDocument()->contents())); - - connect(this, &EditorWidget::sourceCodeChanged, compiler, [this, compiler] { - compiler->compile(QString::fromUtf8(m_codeEditor->textDocument()->contents())); - }); + m_compilerWidgets.clear(); + m_sourceWidgets.clear(); } class Editor : public Core::IEditor { public: Editor() - : m_document(new TextDocument(Constants::CE_EDITOR_ID)) + : m_document(new JsonSettingsDocument(&m_settings)) { setWidget(new EditorWidget(m_document)); } + ~Editor() { delete widget(); } + Core::IDocument *document() const override { return m_document.data(); } QWidget *toolBar() override { return nullptr; } - TextDocumentPtr m_document; + CompilerExplorerSettings m_settings; + QSharedPointer<JsonSettingsDocument> m_document; }; EditorFactory::EditorFactory() diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.h b/src/plugins/compilerexplorer/compilerexplorereditor.h index 1eec159c0c6..cb13bda6278 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.h +++ b/src/plugins/compilerexplorer/compilerexplorereditor.h @@ -27,18 +27,76 @@ class CppEditorWidget; namespace CompilerExplorer { +class JsonSettingsDocument; +class SourceEditorWidget; class CodeEditorWidget; +class JsonSettingsDocument : public Core::IDocument +{ + Q_OBJECT +public: + JsonSettingsDocument(CompilerExplorerSettings *ceSettings); + OpenResult open(QString *errorString, + const Utils::FilePath &filePath, + const Utils::FilePath &realFilePath) override; + + bool saveImpl(QString *errorString, + const Utils::FilePath &filePath = Utils::FilePath(), + bool autoSave = false) override; + + bool setContents(const QByteArray &contents) override; + + bool shouldAutoSave() const override { return !filePath().isEmpty(); } + bool isModified() const override; + bool isSaveAsAllowed() const override { return true; } + + CompilerExplorerSettings *settings() { return m_ceSettings; } + + void setWindowStateCallback(std::function<QVariantMap()> callback) + { + m_windowStateCallback = callback; + } + +signals: + void settingsChanged(); + +private: + CompilerExplorerSettings *m_ceSettings; + std::function<QVariantMap()> m_windowStateCallback; +}; + +class SourceEditorWidget : public QWidget +{ + Q_OBJECT +public: + SourceEditorWidget(const std::shared_ptr<SourceSettings> &settings); + + QString sourceCode(); + + std::shared_ptr<SourceSettings> m_sourceSettings; +signals: + void sourceCodeChanged(); + +private: + CodeEditorWidget *m_codeEditor{nullptr}; +}; + class CompilerWidget : public QWidget { Q_OBJECT public: - CompilerWidget(); + CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSettings, + const std::shared_ptr<CompilerSettings> &compilerSettings); + + ~CompilerWidget(); Core::SearchableTerminal *createTerminal(); void compile(const QString &source); + std::shared_ptr<SourceSettings> m_sourceSettings; + std::shared_ptr<CompilerSettings> m_compilerSettings; + private: void doCompile(); @@ -51,8 +109,6 @@ private: std::unique_ptr<QFutureWatcher<Api::CompileResult>> m_compileWatcher; - CompilerExplorer::CompilerSettings m_compilerSettings; - QString m_source; QTimer *m_delayTimer{nullptr}; QList<TextEditor::TextMark *> m_marks; @@ -62,25 +118,21 @@ class EditorWidget : public Utils::FancyMainWindow { Q_OBJECT public: - EditorWidget(QSharedPointer<TextEditor::TextDocument> document = nullptr, QWidget *parent = nullptr); - - void addCompiler(); - -protected: - Core::SearchableTerminal *createTerminal(); - - void onLanguageChanged(); + EditorWidget(QSharedPointer<JsonSettingsDocument> document = nullptr, QWidget *parent = nullptr); + ~EditorWidget() override; signals: void sourceCodeChanged(); private: - CodeEditorWidget *m_codeEditor; - CompilerExplorer::Settings m_currentSettings; QSplitter *m_mainSplitter; int m_compilerCount{0}; + QSharedPointer<JsonSettingsDocument> m_document; Core::IContext *m_context; + + QList<QDockWidget *> m_compilerWidgets; + QList<QDockWidget *> m_sourceWidgets; }; class EditorFactory : public Core::IEditorFactory diff --git a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp index 542cc037b0a..5845aa7dea2 100644 --- a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp +++ b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp @@ -34,11 +34,10 @@ public: auto action = new QAction(Tr::tr("Open Compiler Explorer"), this); connect(action, &QAction::triggered, this, [] { - CompilerExplorer::Settings settings; - - const QString src = settings.source(); QString name("Compiler Explorer"); - EditorManager::openEditorWithContents(Constants::CE_EDITOR_ID, &name, src.toUtf8()); + Core::EditorManager::openEditorWithContents(Constants::CE_EDITOR_ID, + &name, + settings().defaultDocument().toUtf8()); }); ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS); @@ -47,11 +46,12 @@ public: menu->setTitle(Tr::tr("Compiler Explorer")); mtools->addMenu(mCompilerExplorer); - Command *cmd = ActionManager::registerAction(action, "CompilerExplorer.CompilerExplorerAction"); + Command *cmd = ActionManager::registerAction(action, + "CompilerExplorer.CompilerExplorerAction"); mCompilerExplorer->addAction(cmd); } }; -} // CompilerExplorer::Internl +} // namespace CompilerExplorer::Internal #include "compilerexplorerplugin.moc" diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp index 1dbd34f888d..0837afb6e11 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.cpp +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -14,12 +14,29 @@ namespace CompilerExplorer { -Settings &settings() +PluginSettings &settings() { - static Settings instance; + static PluginSettings instance; return instance; } +PluginSettings::PluginSettings() +{ + defaultDocument.setSettingsKey("DefaultDocument"); + defaultDocument.setDefaultValue(R"( +{ + "Sources": [{ + "LanguageId": "c++", + "Source": "int main() {\n return 0;\n}", + "Compilers": [{ + "Id": "clang_trunk", + "Options": "-O3" + }] + }] +} + )"); +} + static Api::Languages &cachedLanguages() { static Api::Languages instance; @@ -43,41 +60,58 @@ static QMap<QString, QMap<QString, QString>> &cachedCompilers() return instance; } -Settings::Settings() +SourceSettings::SourceSettings(const ApiConfigFunction &apiConfigFunction) + : m_apiConfigFunction(apiConfigFunction) { - static QNetworkAccessManager networkManager; - m_networkAccessManager = &networkManager; + setAutoApply(false); - setSettingsGroup("CompilerExplorer"); - - source.setDefaultValue(R"( -int main() -{ - return 0; -} - -)"); - - compilerExplorerUrl.setLabelText(Tr::tr("Compiler Explorer URL:")); - compilerExplorerUrl.setToolTip(Tr::tr("URL of the Compiler Explorer instance to use")); - compilerExplorerUrl.setDefaultValue("https://godbolt.org/"); - compilerExplorerUrl.setDisplayStyle(Utils::StringAspect::DisplayStyle::LineEditDisplay); - compilerExplorerUrl.setHistoryCompleter("CompilerExplorer.Url.History"); + source.setSettingsKey("Source"); + languageId.setSettingsKey("LanguageId"); languageId.setDefaultValue("c++"); languageId.setLabelText(Tr::tr("Language:")); languageId.setFillCallback([this](auto cb) { fillLanguageIdModel(cb); }); - connect(&compilerExplorerUrl, &Utils::StringAspect::changed, this, [this] { - languageId.setValue(languageId.defaultValue()); - cachedLanguages().clear(); - languageId.refill(); + compilers.setSettingsKey("Compilers"); + compilers.setCreateItemFunction([this, apiConfigFunction] { + auto result = std::make_shared<CompilerSettings>(apiConfigFunction); + connect(this, &SourceSettings::languagesChanged, result.get(), &CompilerSettings::refresh); + connect(&languageId, + &StringSelectionAspect::changed, + result.get(), + [this, result = result.get()] { result->setLanguageId(languageId()); }); + + connect(result.get(), &Utils::AspectContainer::changed, this, &SourceSettings::changed); + + result->setLanguageId(languageId()); + return result; }); - readSettings(); + compilers.setToBaseAspectFunction([](const std::shared_ptr<CompilerSettings> &item) { + return static_cast<Utils::BaseAspect *>(item.get()); + }); + compilers.setIsDirtyFunction( + [](const std::shared_ptr<CompilerSettings> &settings) { return settings->isDirty(); }); + compilers.setApplyFunction( + [](const std::shared_ptr<CompilerSettings> &settings) { settings->apply(); }); + + for (const auto &aspect : this->aspects()) + connect(aspect, + &Utils::BaseAspect::volatileValueChanged, + this, + &CompilerExplorerSettings::changed); } -QString Settings::languageExtension() const +void SourceSettings::refresh() +{ + languageId.setValue(languageId.defaultValue()); + cachedLanguages().clear(); + languageId.refill(); + + compilers.forEachItem(&CompilerSettings::refresh); +} + +QString SourceSettings::languageExtension() const { auto it = std::find_if(std::begin(cachedLanguages()), std::end(cachedLanguages()), @@ -89,50 +123,70 @@ QString Settings::languageExtension() const return ".cpp"; } -CompilerSettings::CompilerSettings(Settings *settings) - : m_parent(settings) +CompilerSettings::CompilerSettings(const ApiConfigFunction &apiConfigFunction) + : m_apiConfigFunction(apiConfigFunction) { - setAutoApply(true); - compilerOptions.setDefaultValue("-O3"); + setAutoApply(false); + compiler.setSettingsKey("Id"); + compiler.setLabelText(Tr::tr("Compiler:")); + compiler.setFillCallback([this](auto cb) { fillCompilerModel(cb); }); + + compilerOptions.setSettingsKey("Options"); compilerOptions.setLabelText(Tr::tr("Compiler options:")); compilerOptions.setToolTip(Tr::tr("Arguments passed to the compiler")); compilerOptions.setDisplayStyle(Utils::StringAspect::DisplayStyle::LineEditDisplay); - compiler.setDefaultValue("clang_trunk"); - compiler.setLabelText(Tr::tr("Compiler:")); - compiler.setFillCallback([this](auto cb) { fillCompilerModel(cb); }); - + libraries.setSettingsKey("Libraries"); libraries.setLabelText(Tr::tr("Libraries:")); libraries.setFillCallback([this](auto cb) { fillLibraries(cb); }); + executeCode.setSettingsKey("ExecuteCode"); executeCode.setLabelText(Tr::tr("Execute the code")); + + compileToBinaryObject.setSettingsKey("CompileToBinaryObject"); compileToBinaryObject.setLabelText(Tr::tr("Compile to binary object")); + + intelAsmSyntax.setSettingsKey("IntelAsmSyntax"); intelAsmSyntax.setLabelText(Tr::tr("Intel asm syntax")); intelAsmSyntax.setDefaultValue(true); + + demangleIdentifiers.setSettingsKey("DemangleIdentifiers"); demangleIdentifiers.setLabelText(Tr::tr("Demangle identifiers")); demangleIdentifiers.setDefaultValue(true); - connect(&settings->compilerExplorerUrl, &Utils::StringAspect::changed, this, [this] { - cachedCompilers().clear(); - cachedLibraries().clear(); + for (const auto &aspect : this->aspects()) + connect(aspect, + &Utils::BaseAspect::volatileValueChanged, + this, + &CompilerExplorerSettings::changed); +} - compiler.refill(); - libraries.refill(); - }); +void CompilerSettings::refresh() +{ + cachedCompilers().clear(); + cachedLibraries().clear(); - connect(&settings->languageId, &StringSelectionAspect::changed, this, [this] { - compiler.refill(); - libraries.refill(); - if (m_parent->languageId() == "c++") - compilerOptions.setValue("-O3"); - else - compilerOptions.setValue(""); - }); + compiler.refill(); + libraries.refill(); +} + +void CompilerSettings::setLanguageId(const QString &languageId) +{ + m_languageId = languageId; + + compiler.refill(); + libraries.refill(); + + // TODO: Set real defaults ... + if (m_languageId == "c++") + compilerOptions.setValue("-O3"); + else + compilerOptions.setValue(""); } void CompilerSettings::fillLibraries(LibrarySelectionAspect::ResultCallback cb) { - const QString lang = m_parent->languageId(); + const QString lang = m_languageId; auto fillFromCache = [cb, lang] { QList<QStandardItem *> items; for (const Api::Library &lib : cachedLibraries(lang)) { @@ -148,7 +202,7 @@ void CompilerSettings::fillLibraries(LibrarySelectionAspect::ResultCallback cb) return; } - auto future = Api::libraries(m_parent->apiConfig(), lang); + auto future = Api::libraries(m_apiConfigFunction(), lang); auto watcher = new QFutureWatcher<Api::Libraries>(this); watcher->setFuture(future); @@ -166,7 +220,7 @@ void CompilerSettings::fillLibraries(LibrarySelectionAspect::ResultCallback cb) }); } -void Settings::fillLanguageIdModel(StringSelectionAspect::ResultCallback cb) +void SourceSettings::fillLanguageIdModel(StringSelectionAspect::ResultCallback cb) { auto fillFromCache = [cb, this] { QList<QStandardItem *> items; @@ -190,7 +244,7 @@ void Settings::fillLanguageIdModel(StringSelectionAspect::ResultCallback cb) return; } - auto future = Api::languages(apiConfig()); + auto future = Api::languages(m_apiConfigFunction()); auto watcher = new QFutureWatcher<Api::Languages>(this); watcher->setFuture(future); @@ -220,13 +274,13 @@ void CompilerSettings::fillCompilerModel(StringSelectionAspect::ResultCallback c cb(items); }; - auto it = cachedCompilers().find(m_parent->languageId()); + auto it = cachedCompilers().find(m_languageId); if (it != cachedCompilers().end()) { fillFromCache(it); return; } - auto future = Api::compilers(m_parent->apiConfig(), m_parent->languageId()); + auto future = Api::compilers(m_apiConfigFunction(), m_languageId); auto watcher = new QFutureWatcher<Api::Compilers>(this); watcher->setFuture(future); @@ -236,7 +290,7 @@ void CompilerSettings::fillCompilerModel(StringSelectionAspect::ResultCallback c [watcher, this, fillFromCache]() { try { auto result = watcher->result(); - auto itCache = cachedCompilers().insert(m_parent->languageId(), {}); + auto itCache = cachedCompilers().insert(m_languageId, {}); for (const Api::Compiler &compiler : result) itCache->insert(compiler.name, compiler.id); @@ -249,4 +303,50 @@ void CompilerSettings::fillCompilerModel(StringSelectionAspect::ResultCallback c }); } +CompilerExplorerSettings::CompilerExplorerSettings() +{ + setAutoApply(false); + setSettingsKey("CompilerExplorer"); + static QNetworkAccessManager networkManager; + m_networkAccessManager = &networkManager; + + compilerExplorerUrl.setSettingsKey("CompilerExplorerUrl"); + compilerExplorerUrl.setLabelText(Tr::tr("Compiler Explorer URL:")); + compilerExplorerUrl.setToolTip(Tr::tr("URL of the Compiler Explorer instance to use")); + compilerExplorerUrl.setDefaultValue("https://godbolt.org/"); + compilerExplorerUrl.setDisplayStyle(Utils::StringAspect::DisplayStyle::LineEditDisplay); + compilerExplorerUrl.setHistoryCompleter("CompilerExplorer.Url.History"); + + windowState.setSettingsKey("WindowState"); + + m_sources.setSettingsKey("Sources"); + m_sources.setCreateItemFunction([this] { + auto newSourceSettings = std::make_shared<SourceSettings>([this] { return apiConfig(); }); + connect(newSourceSettings.get(), + &Utils::AspectContainer::changed, + this, + &CompilerExplorerSettings::changed); + return newSourceSettings; + }); + m_sources.setIsDirtyFunction( + [](const std::shared_ptr<SourceSettings> &settings) { return settings->isDirty(); }); + m_sources.setApplyFunction( + [](const std::shared_ptr<SourceSettings> &settings) { settings->apply(); }); + m_sources.setToBaseAspectFunction([](const std::shared_ptr<SourceSettings> &item) { + return static_cast<Utils::BaseAspect *>(item.get()); + }); + + connect(&compilerExplorerUrl, &Utils::StringAspect::volatileValueChanged, this, [this] { + m_sources.forEachItem(&SourceSettings::refresh); + }); + + for (const auto &aspect : this->aspects()) + connect(aspect, + &Utils::BaseAspect::volatileValueChanged, + this, + &CompilerExplorerSettings::changed); +} + +CompilerExplorerSettings::~CompilerExplorerSettings() = default; + } // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.h b/src/plugins/compilerexplorer/compilerexplorersettings.h index 4d93f86c254..34850009af2 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.h +++ b/src/plugins/compilerexplorer/compilerexplorersettings.h @@ -11,12 +11,76 @@ #include <QNetworkAccessManager> namespace CompilerExplorer { -class Settings; +class SourceSettings; +class CompilerSettings; + +using ApiConfigFunction = std::function<Api::Config()>; + +class PluginSettings : public Utils::AspectContainer +{ +public: + PluginSettings(); + Utils::StringAspect defaultDocument{this}; +}; + +PluginSettings &settings(); + +class CompilerExplorerSettings : public Utils::AspectContainer +{ +public: + CompilerExplorerSettings(); + ~CompilerExplorerSettings(); + + Utils::StringAspect compilerExplorerUrl{this}; + Utils::TypedAspect<QVariantMap> windowState{this}; + + AspectListAspect<std::shared_ptr<SourceSettings>> m_sources{this}; + + Api::Config apiConfig() const + { + return Api::Config(m_networkAccessManager, compilerExplorerUrl()); + } + + QNetworkAccessManager *networkAccessManager() const { return m_networkAccessManager; } + +private: + QNetworkAccessManager *m_networkAccessManager{nullptr}; +}; + +class SourceSettings : public Utils::AspectContainer, + public std::enable_shared_from_this<SourceSettings> +{ + Q_OBJECT +public: + SourceSettings(const ApiConfigFunction &apiConfigFunction); + + void refresh(); + + ApiConfigFunction apiConfigFunction() const { return m_apiConfigFunction; } + +public: + StringSelectionAspect languageId{this}; + Utils::StringAspect source{this}; + AspectListAspect<std::shared_ptr<CompilerSettings>> compilers{this}; + +public: + QString languageExtension() const; + +signals: + void languagesChanged(); + +private: + void fillLanguageIdModel(StringSelectionAspect::ResultCallback cb); + +private: + CompilerExplorerSettings *m_parent; + ApiConfigFunction m_apiConfigFunction; +}; class CompilerSettings : public Utils::AspectContainer { public: - CompilerSettings(Settings *settings); + CompilerSettings(const ApiConfigFunction &apiConfigFunction); StringSelectionAspect compiler{this}; @@ -29,42 +93,15 @@ public: Utils::BoolAspect intelAsmSyntax{this}; Utils::BoolAspect demangleIdentifiers{this}; + void refresh(); + void setLanguageId(const QString &languageId); + private: void fillCompilerModel(StringSelectionAspect::ResultCallback cb); void fillLibraries(LibrarySelectionAspect::ResultCallback cb); - Settings *m_parent; + QString m_languageId; + ApiConfigFunction m_apiConfigFunction; }; -class Settings : public Utils::AspectContainer -{ - Q_OBJECT -public: - Settings(); - - StringSelectionAspect languageId{this}; - Utils::StringAspect compilerExplorerUrl{this}; - - Utils::StringAspect source{this}; - - QNetworkAccessManager *networkAccessManager() const { return m_networkAccessManager; } - - Api::Config apiConfig() const - { - return Api::Config(m_networkAccessManager, compilerExplorerUrl()); - } - - QString languageExtension() const; - -signals: - void languagesChanged(); - -private: - void fillLanguageIdModel(StringSelectionAspect::ResultCallback cb); - - QNetworkAccessManager *m_networkAccessManager{nullptr}; -}; - -Settings &settings(); - } // namespace CompilerExplorer From 28742774fecf696181c4b38e3dd5e52eb1311ce2 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 9 Aug 2023 15:17:28 +0200 Subject: [PATCH 0878/1777] TextEditor: add rename symbol option to editor context menu ... if the action handler supports the rename option. Change-Id: Ic1bad19a490aaccc8e96afd1f74741596bf6efc3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/texteditor/texteditor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 82948a8c16d..6cf2221da7b 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -8365,6 +8365,11 @@ void TextEditorWidget::appendStandardContextMenuActions(QMenu *menu) if (!menu->actions().contains(findUsage)) menu->addAction(findUsage); } + if (optionalActions() & TextEditorActionHandler::RenameSymbol) { + const auto renameSymbol = ActionManager::command(Constants::RENAME_SYMBOL)->action(); + if (!menu->actions().contains(renameSymbol)) + menu->addAction(renameSymbol); + } if (optionalActions() & TextEditorActionHandler::CallHierarchy) { const auto callHierarchy = ActionManager::command(Constants::OPEN_CALL_HIERARCHY)->action(); if (!menu->actions().contains(callHierarchy)) From ddb4aa01516972c9fd614b77a57a9218c7bf49ec Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 23 Aug 2023 15:38:01 +0200 Subject: [PATCH 0879/1777] TextEditor: add json indenter Use an EditorFactory that sets up a custom indenter for json files. Change-Id: Id5ade9f9f551835131a62e381a972f0b6032e7c0 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/texteditor/CMakeLists.txt | 1 + src/plugins/texteditor/jsoneditor.cpp | 95 +++++++++++++++++++++ src/plugins/texteditor/jsoneditor.h | 16 ++++ src/plugins/texteditor/texteditor.qbs | 2 + src/plugins/texteditor/texteditorplugin.cpp | 2 + 5 files changed, 116 insertions(+) create mode 100644 src/plugins/texteditor/jsoneditor.cpp create mode 100644 src/plugins/texteditor/jsoneditor.h diff --git a/src/plugins/texteditor/CMakeLists.txt b/src/plugins/texteditor/CMakeLists.txt index 2a99947b933..81d562778d5 100644 --- a/src/plugins/texteditor/CMakeLists.txt +++ b/src/plugins/texteditor/CMakeLists.txt @@ -68,6 +68,7 @@ add_qtc_plugin(TextEditor icodestylepreferencesfactory.cpp icodestylepreferencesfactory.h indenter.h ioutlinewidget.h + jsoneditor.cpp jsoneditor.h linenumberfilter.cpp linenumberfilter.h marginsettings.cpp marginsettings.h markdowneditor.cpp markdowneditor.h diff --git a/src/plugins/texteditor/jsoneditor.cpp b/src/plugins/texteditor/jsoneditor.cpp new file mode 100644 index 00000000000..6bdc698ea20 --- /dev/null +++ b/src/plugins/texteditor/jsoneditor.cpp @@ -0,0 +1,95 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "jsoneditor.h" + +#include "autocompleter.h" +#include "textdocument.h" +#include "texteditoractionhandler.h" +#include "texteditortr.h" +#include "textindenter.h" + +namespace TextEditor::Internal { + +const char JSON_EDITOR_ID[] = "Editors.Json"; +const char JSON_MIME_TYPE[] = "application/json"; + +static int startsWith(const QString &line, const QString &closingChars) +{ + int count = 0; + for (const QChar &lineChar : line) { + if (closingChars.contains(lineChar)) + ++count; + else if (!lineChar.isSpace()) + break; + } + return count; +} + +class JsonAutoCompleter : public AutoCompleter +{ + bool contextAllowsElectricCharacters(const QTextCursor &cursor) const override { return true; } +}; + +class JsonIndenter : public TextIndenter +{ +public: + JsonIndenter(QTextDocument *doc) : TextIndenter(doc) {} + + bool isElectricCharacter(const QChar &c) const override + { + static QString echars("{}[]"); + return echars.contains(c); + } + + int indentFor(const QTextBlock &block, + const TabSettings &tabSettings, + int /*cursorPositionInEditor*/) override + { + QTextBlock previous = block.previous(); + if (!previous.isValid()) + return 0; + + QString previousText = previous.text(); + while (previousText.trimmed().isEmpty()) { + previous = previous.previous(); + if (!previous.isValid()) + return 0; + previousText = previous.text(); + } + + int indent = tabSettings.indentationColumn(previousText); + + int adjust = previousText.count('{') + previousText.count('['); + adjust -= previousText.count('}') + previousText.count(']'); + adjust += startsWith(previousText, "}]") - startsWith(block.text(), "}]"); + adjust *= tabSettings.m_indentSize; + + return qMax(0, indent + adjust); + } + + void indentBlock(const QTextBlock &block, + const QChar &typedChar, + const TabSettings &tabSettings, + int cursorPositionInEditor) override + { + tabSettings.indentLine(block, indentFor(block, tabSettings, cursorPositionInEditor)); + } +}; + +JsonEditorFactory::JsonEditorFactory() +{ + setId(JSON_EDITOR_ID); + setDisplayName(Tr::tr("Json Editor")); + addMimeType(JSON_MIME_TYPE); + + setEditorCreator([] { return new BaseTextEditor; }); + setEditorWidgetCreator([] { return new TextEditorWidget; }); + setDocumentCreator([] { return new TextDocument(JSON_EDITOR_ID); }); + setAutoCompleterCreator([] { return new JsonAutoCompleter; }); + setIndenterCreator([](QTextDocument *doc) { return new JsonIndenter(doc); }); + setEditorActionHandlers(TextEditorActionHandler::Format); + setUseGenericHighlighter(true); +} + +} // namespace TextEditor::Internal diff --git a/src/plugins/texteditor/jsoneditor.h b/src/plugins/texteditor/jsoneditor.h new file mode 100644 index 00000000000..d1f783fed70 --- /dev/null +++ b/src/plugins/texteditor/jsoneditor.h @@ -0,0 +1,16 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "texteditor.h" + +namespace TextEditor::Internal { + +class JsonEditorFactory final : public TextEditorFactory +{ +public: + JsonEditorFactory(); +}; + +} // TextEditor::Internal diff --git a/src/plugins/texteditor/texteditor.qbs b/src/plugins/texteditor/texteditor.qbs index fa8441f29ef..0a424aeaa58 100644 --- a/src/plugins/texteditor/texteditor.qbs +++ b/src/plugins/texteditor/texteditor.qbs @@ -90,6 +90,8 @@ Project { "icodestylepreferencesfactory.h", "indenter.h", "ioutlinewidget.h", + "jsoneditor.cpp", + "jsoneditor.h", "linenumberfilter.cpp", "linenumberfilter.h", "marginsettings.cpp", diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 70a50856145..67c621bcc36 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -10,6 +10,7 @@ #include "fontsettings.h" #include "highlighter.h" #include "icodestylepreferences.h" +#include "jsoneditor.h" #include "linenumberfilter.h" #include "markdowneditor.h" #include "outlinefactory.h" @@ -76,6 +77,7 @@ public: PlainTextEditorFactory plainTextEditorFactory; MarkdownEditorFactory markdownEditorFactory; + JsonEditorFactory jsonEditorFactory; }; static TextEditorPlugin *m_instance = nullptr; From 71765041b82121f5e23a784d90dd8b2f74bbc27c Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 4 Aug 2023 15:17:17 +0200 Subject: [PATCH 0880/1777] Help: Add option for disabling antialising of fonts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For the backends that we can do it for (litehtml, QTextBrowser). Fixes: QTCREATORBUG-12177 Change-Id: If64a279f74f878b6797bf43d8129058c6183919b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Kai Köhne <kai.koehne@qt.io> --- src/libs/qlitehtml | 2 +- src/plugins/help/generalsettingspage.cpp | 51 ++++++++-------------- src/plugins/help/helpplugin.cpp | 7 +++ src/plugins/help/helpviewer.cpp | 2 + src/plugins/help/helpviewer.h | 1 + src/plugins/help/litehtmlhelpviewer.cpp | 5 +++ src/plugins/help/litehtmlhelpviewer.h | 2 +- src/plugins/help/localhelpmanager.cpp | 43 ++++++++++++------ src/plugins/help/localhelpmanager.h | 4 ++ src/plugins/help/textbrowserhelpviewer.cpp | 14 ++++-- src/plugins/help/textbrowserhelpviewer.h | 4 +- 11 files changed, 81 insertions(+), 54 deletions(-) diff --git a/src/libs/qlitehtml b/src/libs/qlitehtml index 8e541a22b51..b8f6617f22a 160000 --- a/src/libs/qlitehtml +++ b/src/libs/qlitehtml @@ -1 +1 @@ -Subproject commit 8e541a22b513432ed566fca824af207395ee0c90 +Subproject commit b8f6617f22a7bd0bf3da2e75d1613e1346b974f0 diff --git a/src/plugins/help/generalsettingspage.cpp b/src/plugins/help/generalsettingspage.cpp index d5f5756ed69..6337bafd11e 100644 --- a/src/plugins/help/generalsettingspage.cpp +++ b/src/plugins/help/generalsettingspage.cpp @@ -18,6 +18,7 @@ #include <utils/algorithm.h> #include <utils/fileutils.h> +#include <utils/layoutbuilder.h> #include <QCheckBox> #include <QComboBox> @@ -76,6 +77,7 @@ private: QFontComboBox *familyComboBox; QComboBox *styleComboBox; QComboBox *sizeComboBox; + QCheckBox *antialiasCheckBox; QLineEdit *homePageLineEdit; QComboBox *helpStartComboBox; QComboBox *contextHelpComboBox; @@ -92,49 +94,31 @@ private: GeneralSettingsPageWidget::GeneralSettingsPageWidget() { + using namespace Layouting; + // font group box - auto fontGroupBox = new QGroupBox(Tr::tr("Font")); - auto familyLabel = new QLabel(Tr::tr("Family:")); - familyComboBox = new QFontComboBox; - auto styleLabel = new QLabel(Tr::tr("Style:")); styleComboBox = new QComboBox; - auto sizeLabel = new QLabel(Tr::tr("Size:")); sizeComboBox = new QComboBox; - - auto fontLayout = new QHBoxLayout(); - fontLayout->addWidget(familyComboBox); - fontLayout->addSpacing(20); - fontLayout->addWidget(styleLabel); - fontLayout->addWidget(styleComboBox); - fontLayout->addSpacing(20); - fontLayout->addWidget(sizeLabel); - fontLayout->addWidget(sizeComboBox); - fontLayout->addStretch(); - - auto noteLabel = new QLabel(Tr::tr( - "Note: The above setting takes effect only if the HTML file does not use a style sheet.")); - noteLabel->setWordWrap(true); - auto zoomLabel = new QLabel(Tr::tr("Zoom:")); - zoomSpinBox = new QSpinBox; zoomSpinBox->setMinimum(10); zoomSpinBox->setMaximum(3000); zoomSpinBox->setSingleStep(10); zoomSpinBox->setValue(100); zoomSpinBox->setSuffix(Tr::tr("%")); + antialiasCheckBox = new QCheckBox(Tr::tr("Antialias")); - auto zoomLayout = new QHBoxLayout(); - zoomLayout->addWidget(zoomSpinBox); - zoomLayout->addStretch(); - - auto fontGroupBoxLayout = new QGridLayout; - fontGroupBox->setLayout(fontGroupBoxLayout); - fontGroupBoxLayout->addWidget(familyLabel, 0, 0); - fontGroupBoxLayout->addLayout(fontLayout, 0, 1); - fontGroupBoxLayout->addWidget(noteLabel, 1, 0, 1, 2); - fontGroupBoxLayout->addWidget(zoomLabel, 2, 0); - fontGroupBoxLayout->addLayout(zoomLayout, 2, 1); + auto fontGroupBox = new QGroupBox(Tr::tr("Font")); + // clang-format off + Column { + Row { Tr::tr("Family:"), familyComboBox, + Tr::tr("Style:"), styleComboBox, + Tr::tr("Size:"), sizeComboBox, st }, + Row { Tr::tr("Note: The above setting takes effect only if the " + "HTML file does not use a style sheet.") }, + Row { Tr::tr("Zoom:"), zoomSpinBox, antialiasCheckBox, st } + }.attachTo(fontGroupBox); + // clang-format on // startup group box auto startupGroupBox = new QGroupBox(Tr::tr("Startup")); @@ -231,6 +215,7 @@ GeneralSettingsPageWidget::GeneralSettingsPageWidget() m_font = LocalHelpManager::fallbackFont(); m_fontZoom = LocalHelpManager::fontZoom(); zoomSpinBox->setValue(m_fontZoom); + antialiasCheckBox->setChecked(LocalHelpManager::antialias()); updateFontSizeSelector(); updateFontStyleSelector(); @@ -309,6 +294,8 @@ void GeneralSettingsPageWidget::apply() if (m_fontZoom != LocalHelpManager::fontZoom()) LocalHelpManager::setFontZoom(m_fontZoom); + LocalHelpManager::setAntialias(antialiasCheckBox->isChecked()); + QString homePage = QUrl::fromUserInput(homePageLineEdit->text()).toString(); if (homePage.isEmpty()) homePage = Help::Constants::AboutBlank; diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index a3c31c5c6be..0b3ad2f011c 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -374,6 +374,13 @@ HelpViewer *HelpPlugin::createHelpViewer() connect(LocalHelpManager::instance(), &LocalHelpManager::fontZoomChanged, viewer, &HelpViewer::setFontZoom); + // initialize antialias + viewer->setAntialias(LocalHelpManager::antialias()); + connect(LocalHelpManager::instance(), + &LocalHelpManager::antialiasChanged, + viewer, + &HelpViewer::setAntialias); + viewer->setScrollWheelZoomingEnabled(LocalHelpManager::isScrollWheelZoomingEnabled()); connect(LocalHelpManager::instance(), &LocalHelpManager::scrollWheelZoomingEnabledChanged, viewer, &HelpViewer::setScrollWheelZoomingEnabled); diff --git a/src/plugins/help/helpviewer.cpp b/src/plugins/help/helpviewer.cpp index e10c65a019b..323d9d3f854 100644 --- a/src/plugins/help/helpviewer.cpp +++ b/src/plugins/help/helpviewer.cpp @@ -71,6 +71,8 @@ HelpViewer::~HelpViewer() restoreOverrideCursor(); } +void HelpViewer::setAntialias(bool) {} + void HelpViewer::setFontZoom(int percentage) { setScale(percentage / 100.0); diff --git a/src/plugins/help/helpviewer.h b/src/plugins/help/helpviewer.h index c05685794d6..503e06db35a 100644 --- a/src/plugins/help/helpviewer.h +++ b/src/plugins/help/helpviewer.h @@ -32,6 +32,7 @@ public: ~HelpViewer() override; virtual void setViewerFont(const QFont &font) = 0; + virtual void setAntialias(bool on); virtual void setScale(qreal scale) = 0; diff --git a/src/plugins/help/litehtmlhelpviewer.cpp b/src/plugins/help/litehtmlhelpviewer.cpp index 59df62ba666..af4b84c5fcb 100644 --- a/src/plugins/help/litehtmlhelpviewer.cpp +++ b/src/plugins/help/litehtmlhelpviewer.cpp @@ -134,6 +134,11 @@ void LiteHtmlHelpViewer::setScale(qreal scale) m_viewer->setZoomFactor(scale == 0 ? qreal(1) : scale); } +void LiteHtmlHelpViewer::setAntialias(bool on) +{ + m_viewer->setAntialias(on); +} + QString LiteHtmlHelpViewer::title() const { return m_viewer->title(); diff --git a/src/plugins/help/litehtmlhelpviewer.h b/src/plugins/help/litehtmlhelpviewer.h index 82f5d89e483..0978bca9b20 100644 --- a/src/plugins/help/litehtmlhelpviewer.h +++ b/src/plugins/help/litehtmlhelpviewer.h @@ -24,8 +24,8 @@ public: ~LiteHtmlHelpViewer() override; void setViewerFont(const QFont &font) override; - void setScale(qreal scale) override; + void setAntialias(bool on) final; QString title() const override; diff --git a/src/plugins/help/localhelpmanager.cpp b/src/plugins/help/localhelpmanager.cpp index e8be2bfbe32..d17a3e83949 100644 --- a/src/plugins/help/localhelpmanager.cpp +++ b/src/plugins/help/localhelpmanager.cpp @@ -52,21 +52,23 @@ QHelpEngine* LocalHelpManager::m_guiEngine = nullptr; QMutex LocalHelpManager::m_bkmarkMutex; BookmarkManager* LocalHelpManager::m_bookmarkManager = nullptr; -static const char kHelpHomePageKey[] = "Help/HomePage"; -static const char kFontFamilyKey[] = "Help/FallbackFontFamily"; -static const char kFontStyleNameKey[] = "Help/FallbackFontStyleName"; -static const char kFontSizeKey[] = "Help/FallbackFontSize"; -static const char kFontZoomKey[] = "Help/FontZoom"; -static const char kStartOptionKey[] = "Help/StartOption"; -static const char kContextHelpOptionKey[] = "Help/ContextHelpOption"; -static const char kReturnOnCloseKey[] = "Help/ReturnOnClose"; -static const char kUseScrollWheelZooming[] = "Help/UseScrollWheelZooming"; -static const char kLastShownPagesKey[] = "Help/LastShownPages"; -static const char kLastSelectedTabKey[] = "Help/LastSelectedTab"; -static const char kViewerBackend[] = "Help/ViewerBackend"; +const char kHelpHomePageKey[] = "Help/HomePage"; +const char kFontFamilyKey[] = "Help/FallbackFontFamily"; +const char kFontStyleNameKey[] = "Help/FallbackFontStyleName"; +const char kFontSizeKey[] = "Help/FallbackFontSize"; +const char kFontZoomKey[] = "Help/FontZoom"; +const char kAntialiasKey[] = "Help/FontAntialias"; +const char kStartOptionKey[] = "Help/StartOption"; +const char kContextHelpOptionKey[] = "Help/ContextHelpOption"; +const char kReturnOnCloseKey[] = "Help/ReturnOnClose"; +const char kUseScrollWheelZooming[] = "Help/UseScrollWheelZooming"; +const char kLastShownPagesKey[] = "Help/LastShownPages"; +const char kLastSelectedTabKey[] = "Help/LastSelectedTab"; +const char kViewerBackend[] = "Help/ViewerBackend"; -static const int kDefaultFallbackFontSize = 14; -static const int kDefaultFontZoom = 100; +const int kDefaultFallbackFontSize = 14; +const int kDefaultFontZoom = 100; +const bool kDefaultAntialias = true; const int kDefaultStartOption = LocalHelpManager::ShowLastPages; const int kDefaultContextHelpOption = Core::HelpManager::SideBySideIfPossible; const bool kDefaultReturnOnClose = false; @@ -175,6 +177,19 @@ int LocalHelpManager::setFontZoom(int percentage) return newZoom; } +bool LocalHelpManager::antialias() +{ + return Core::ICore::settings()->value(kAntialiasKey, kDefaultAntialias).toBool(); +} + +void LocalHelpManager::setAntialias(bool on) +{ + if (on != antialias()) { + Core::ICore::settings()->setValueWithDefault(kAntialiasKey, on, kDefaultAntialias); + emit m_instance->antialiasChanged(on); + } +} + LocalHelpManager::StartOption LocalHelpManager::startOption() { const QVariant value = Core::ICore::settings()->value(kStartOptionKey, kDefaultStartOption); diff --git a/src/plugins/help/localhelpmanager.h b/src/plugins/help/localhelpmanager.h index 433d1ce7663..5195e7f1b70 100644 --- a/src/plugins/help/localhelpmanager.h +++ b/src/plugins/help/localhelpmanager.h @@ -61,6 +61,9 @@ public: static int fontZoom(); static int setFontZoom(int percentage); + static bool antialias(); + static void setAntialias(bool on); + static StartOption startOption(); static void setStartOption(StartOption option); @@ -104,6 +107,7 @@ public: signals: void fallbackFontChanged(const QFont &font); void fontZoomChanged(int percentage); + void antialiasChanged(bool on); void returnOnCloseChanged(); void scrollWheelZoomingEnabledChanged(bool enabled); void contextHelpOptionChanged(Core::HelpManager::HelpViewerLocation option); diff --git a/src/plugins/help/textbrowserhelpviewer.cpp b/src/plugins/help/textbrowserhelpviewer.cpp index d2b37dd87d2..419dfb93595 100644 --- a/src/plugins/help/textbrowserhelpviewer.cpp +++ b/src/plugins/help/textbrowserhelpviewer.cpp @@ -55,22 +55,28 @@ TextBrowserHelpViewer::~TextBrowserHelpViewer() = default; void TextBrowserHelpViewer::setViewerFont(const QFont &newFont) { - setFontAndScale(newFont, LocalHelpManager::fontZoom() / 100.0); + setFontAndScale(newFont, LocalHelpManager::fontZoom() / 100.0, LocalHelpManager::antialias()); } -void TextBrowserHelpViewer::setFontAndScale(const QFont &font, qreal scale) +void TextBrowserHelpViewer::setFontAndScale(const QFont &font, qreal scale, bool antialias) { - m_textBrowser->withFixedTopPosition([this, &font, scale] { + m_textBrowser->withFixedTopPosition([this, &font, scale, antialias] { QFont newFont = font; const float newSize = font.pointSizeF() * scale; newFont.setPointSizeF(newSize); + newFont.setStyleStrategy(antialias ? QFont::PreferAntialias : QFont::NoAntialias); m_textBrowser->setFont(newFont); }); } void TextBrowserHelpViewer::setScale(qreal scale) { - setFontAndScale(LocalHelpManager::fallbackFont(), scale); + setFontAndScale(LocalHelpManager::fallbackFont(), scale, LocalHelpManager::antialias()); +} + +void TextBrowserHelpViewer::setAntialias(bool on) +{ + setFontAndScale(LocalHelpManager::fallbackFont(), LocalHelpManager::fontZoom() / 100.0, on); } QString TextBrowserHelpViewer::title() const diff --git a/src/plugins/help/textbrowserhelpviewer.h b/src/plugins/help/textbrowserhelpviewer.h index 59994539274..2177cf55c0c 100644 --- a/src/plugins/help/textbrowserhelpviewer.h +++ b/src/plugins/help/textbrowserhelpviewer.h @@ -22,8 +22,8 @@ public: ~TextBrowserHelpViewer() override; void setViewerFont(const QFont &font) override; - void setScale(qreal scale) override; + void setAntialias(bool on) final; QString title() const override; @@ -48,7 +48,7 @@ public: void print(QPrinter *printer) override; private: - void setFontAndScale(const QFont &font, qreal scale); + void setFontAndScale(const QFont &font, qreal scale, bool antialias); TextBrowserHelpWidget *m_textBrowser; }; From 1bcc5b137dfe14d6f12f6821e0de2a0fd7756dd2 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 24 Aug 2023 13:24:05 +0200 Subject: [PATCH 0881/1777] CompilerExplorer: Add Mimetype Change-Id: Id267d6d164a4ce8b1527ccb9dc6d1e4b6b289833 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../compilerexplorer/CompilerExplorer.json.in | 12 ++++++- .../compilerexplorereditor.cpp | 34 +++++++++---------- .../compilerexplorer/compilerexplorereditor.h | 10 +++--- 3 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/plugins/compilerexplorer/CompilerExplorer.json.in b/src/plugins/compilerexplorer/CompilerExplorer.json.in index f8363936bd0..db289e41a8a 100644 --- a/src/plugins/compilerexplorer/CompilerExplorer.json.in +++ b/src/plugins/compilerexplorer/CompilerExplorer.json.in @@ -15,5 +15,15 @@ ], "Description" : "Integrates https://godbolt.org into Qt Creator.", "Url" : "http://www.qt.io", - ${IDE_PLUGIN_DEPENDENCIES} + ${IDE_PLUGIN_DEPENDENCIES}, + "Mimetypes" : [ + "<?xml version='1.0'?>", + "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>", + " <mime-type type='application/compiler-explorer'>", + " <sub-class-of type='application/json'/>", + " <comment>Compiler Explorer file</comment>", + " <glob pattern='*.qtce'/>", + " </mime-type>", + "</mime-info>" + ] } diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index c43d3a3a34d..45d19e358cc 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -84,14 +84,15 @@ public: } }; -JsonSettingsDocument::JsonSettingsDocument(CompilerExplorerSettings *ceSettings) - : m_ceSettings(ceSettings) +JsonSettingsDocument::JsonSettingsDocument() { setId(Constants::CE_EDITOR_ID); - - connect(m_ceSettings, &CompilerExplorerSettings::changed, this, [this] { emit changed(); }); + setMimeType("application/compiler-explorer"); + connect(&m_ceSettings, &CompilerExplorerSettings::changed, this, [this] { emit changed(); }); } +JsonSettingsDocument::~JsonSettingsDocument() {} + Core::IDocument::OpenResult JsonSettingsDocument::open(QString *errorString, const Utils::FilePath &filePath, const Utils::FilePath &realFilePath) @@ -120,7 +121,7 @@ Core::IDocument::OpenResult JsonSettingsDocument::open(QString *errorString, return OpenResult::CannotHandle; } - m_ceSettings->fromMap(doc.toVariant().toMap()); + m_ceSettings.fromMap(doc.toVariant().toMap()); emit settingsChanged(); return OpenResult::Success; } @@ -133,15 +134,15 @@ bool JsonSettingsDocument::saveImpl(QString *errorString, if (autoSave) { if (m_windowStateCallback) - m_ceSettings->windowState.setVolatileValue(m_windowStateCallback()); + m_ceSettings.windowState.setVolatileValue(m_windowStateCallback()); - m_ceSettings->volatileToMap(map); + m_ceSettings.volatileToMap(map); } else { if (m_windowStateCallback) - m_ceSettings->windowState.setValue(m_windowStateCallback()); + m_ceSettings.windowState.setValue(m_windowStateCallback()); - m_ceSettings->apply(); - m_ceSettings->toMap(map); + m_ceSettings.apply(); + m_ceSettings.toMap(map); } QJsonDocument doc = QJsonDocument::fromVariant(map); @@ -162,8 +163,7 @@ bool JsonSettingsDocument::saveImpl(QString *errorString, bool JsonSettingsDocument::isModified() const { - bool isDirty = m_ceSettings->isDirty(); - return isDirty; + return m_ceSettings.isDirty(); } bool JsonSettingsDocument::setContents(const QByteArray &contents) @@ -174,7 +174,7 @@ bool JsonSettingsDocument::setContents(const QByteArray &contents) QTC_ASSERT(doc.isObject(), return false); - m_ceSettings->fromMap(doc.toVariant().toMap()); + m_ceSettings.fromMap(doc.toVariant().toMap()); emit settingsChanged(); return true; @@ -455,7 +455,7 @@ void CompilerWidget::doCompile() m_compileWatcher->setFuture(f); } -EditorWidget::EditorWidget(QSharedPointer<JsonSettingsDocument> document, QWidget *parent) +EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, QWidget *parent) : Utils::FancyMainWindow(parent) , m_document(document) { @@ -494,7 +494,7 @@ EditorWidget::EditorWidget(QSharedPointer<JsonSettingsDocument> document, QWidge m_compilerWidgets.append(dockWidget); }; - auto addSourceEditor = [this, document, addCompiler]( + auto addSourceEditor = [this, document = document.get(), addCompiler]( const std::shared_ptr<SourceSettings> &sourceSettings) { auto sourceEditor = new SourceEditorWidget(sourceSettings); sourceEditor->setWindowTitle("Source Code #" + QString::number(m_sourceWidgets.size() + 1)); @@ -607,7 +607,7 @@ class Editor : public Core::IEditor { public: Editor() - : m_document(new JsonSettingsDocument(&m_settings)) + : m_document(new JsonSettingsDocument()) { setWidget(new EditorWidget(m_document)); } @@ -617,7 +617,6 @@ public: Core::IDocument *document() const override { return m_document.data(); } QWidget *toolBar() override { return nullptr; } - CompilerExplorerSettings m_settings; QSharedPointer<JsonSettingsDocument> m_document; }; @@ -631,6 +630,7 @@ EditorFactory::EditorFactory() { setId(Constants::CE_EDITOR_ID); setDisplayName(Tr::tr("Compiler Explorer Editor")); + setMimeTypes({"application/compiler-explorer"}); setEditorCreator([]() { return new Editor(); }); } diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.h b/src/plugins/compilerexplorer/compilerexplorereditor.h index cb13bda6278..f63da2ccc45 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.h +++ b/src/plugins/compilerexplorer/compilerexplorereditor.h @@ -35,7 +35,9 @@ class JsonSettingsDocument : public Core::IDocument { Q_OBJECT public: - JsonSettingsDocument(CompilerExplorerSettings *ceSettings); + JsonSettingsDocument(); + ~JsonSettingsDocument() override; + OpenResult open(QString *errorString, const Utils::FilePath &filePath, const Utils::FilePath &realFilePath) override; @@ -50,7 +52,7 @@ public: bool isModified() const override; bool isSaveAsAllowed() const override { return true; } - CompilerExplorerSettings *settings() { return m_ceSettings; } + CompilerExplorerSettings *settings() { return &m_ceSettings; } void setWindowStateCallback(std::function<QVariantMap()> callback) { @@ -61,7 +63,7 @@ signals: void settingsChanged(); private: - CompilerExplorerSettings *m_ceSettings; + mutable CompilerExplorerSettings m_ceSettings; std::function<QVariantMap()> m_windowStateCallback; }; @@ -118,7 +120,7 @@ class EditorWidget : public Utils::FancyMainWindow { Q_OBJECT public: - EditorWidget(QSharedPointer<JsonSettingsDocument> document = nullptr, QWidget *parent = nullptr); + EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, QWidget *parent = nullptr); ~EditorWidget() override; signals: From 4c4719f4d0cba742b0a1754535abb9a496db6b0f Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Mon, 31 Jul 2023 16:26:12 +0200 Subject: [PATCH 0882/1777] Doc: Turn Qt for Python wizard docs into tutorials Remove the Python instructions from Creating Projects and turn them into Qt Quick and Qt Widgets tutorials. Turn the Developing Qt for Python Applications topic into a How-to. Change-Id: Ia3b547fbefd5f8e6b67d673b9724cd6e3f0b4424 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> --- ...on-app-qt-quick-empty-project-details.webp | Bin 0 -> 7176 bytes ...n-app-qt-quick-empty-project-location.webp | Bin 0 -> 6178 bytes ...thon-app-qt-quick-empty-project-ready.webp | Bin 0 -> 2652 bytes ...t-for-python-app-widgets-define-class.webp | Bin 0 -> 5968 bytes ...or-python-app-widgets-project-details.webp | Bin 0 -> 7464 bytes ...r-python-app-widgets-project-location.webp | Bin 0 -> 6080 bytes ...r-new-qt-for-python-app-widgets-ready.webp | Bin 0 -> 1350 bytes ...r-new-qt-for-python-app-window-ui-uic.webp | Bin 0 -> 5510 bytes .../images/qtcreator-python-interpreters.png | Bin 4987 -> 0 bytes .../images/qtcreator-python-interpreters.webp | Bin 0 -> 4098 bytes ...thon-wizard-define-python-interpreter.webp | Bin 7128 -> 7172 bytes .../images/qtcreator-terminal-python.webp | Bin 4516 -> 4714 bytes .../creator-only/creator-debugger-setup.qdoc | 2 +- .../creator-only/creator-debugger.qdoc | 2 +- doc/qtcreator/src/editors/creator-coding.qdoc | 7 - .../editors/creator-only/creator-copilot.qdoc | 2 +- .../creator-only/creator-mime-types.qdoc | 2 +- .../howto/creator-only/creator-how-tos.qdoc | 1 + .../creator-projects-creating.qdoc | 2 - .../python/creator-python-development.qdoc | 87 +++++--- .../src/python/creator-python-project.qdocinc | 175 ---------------- ...utorial-python-application-qt-widgets.qdoc | 173 ++++++++++++++++ ...r-tutorial-python-application-qtquick.qdoc | 187 ++++++++++++++++++ doc/qtcreator/src/qtcreator-toc.qdoc | 2 +- .../creator-only/qtquick-creating.qdoc | 2 +- 25 files changed, 425 insertions(+), 219 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-new-qt-for-python-app-qt-quick-empty-project-details.webp create mode 100644 doc/qtcreator/images/qtcreator-new-qt-for-python-app-qt-quick-empty-project-location.webp create mode 100644 doc/qtcreator/images/qtcreator-new-qt-for-python-app-qt-quick-empty-project-ready.webp create mode 100644 doc/qtcreator/images/qtcreator-new-qt-for-python-app-widgets-define-class.webp create mode 100644 doc/qtcreator/images/qtcreator-new-qt-for-python-app-widgets-project-details.webp create mode 100644 doc/qtcreator/images/qtcreator-new-qt-for-python-app-widgets-project-location.webp create mode 100644 doc/qtcreator/images/qtcreator-new-qt-for-python-app-widgets-ready.webp create mode 100644 doc/qtcreator/images/qtcreator-new-qt-for-python-app-window-ui-uic.webp delete mode 100644 doc/qtcreator/images/qtcreator-python-interpreters.png create mode 100644 doc/qtcreator/images/qtcreator-python-interpreters.webp delete mode 100644 doc/qtcreator/src/python/creator-python-project.qdocinc create mode 100644 doc/qtcreator/src/python/creator-tutorial-python-application-qt-widgets.qdoc create mode 100644 doc/qtcreator/src/python/creator-tutorial-python-application-qtquick.qdoc diff --git a/doc/qtcreator/images/qtcreator-new-qt-for-python-app-qt-quick-empty-project-details.webp b/doc/qtcreator/images/qtcreator-new-qt-for-python-app-qt-quick-empty-project-details.webp new file mode 100644 index 0000000000000000000000000000000000000000..1dd0962f4f37b0a1aa37863656e47834eb2b2b88 GIT binary patch literal 7176 zcmWIYbaP{nVPFV%bqWXzu<-dJ&A_0qc({e(D%b68y(*rU>#rOCo@2g8MM;ez{z;2N zyxQuv55^2X!(OUO#O3DHxZQ7T5tLuU|DIt-eNfY!Kb@<Wvu@H(=w<9$a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;WwGW$yo9vd+>-?LEAwC<*B)PWk=6s_N7A;s=)B-o2~k zOWkwZ{`;oybDqb>7N_{cbgY|t-62v@{JVwOo&V1-E62|dedScLVPSS(m7-tSwfdYJ I1{3%g0XACU`2YX_ literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-new-qt-for-python-app-qt-quick-empty-project-location.webp b/doc/qtcreator/images/qtcreator-new-qt-for-python-app-qt-quick-empty-project-location.webp new file mode 100644 index 0000000000000000000000000000000000000000..006338957fb895d4adfb686512efab9b2fe78d8d GIT binary patch literal 6178 zcmWIYbaRuEU|<M$bqWXzu<+rPU|`T!Jlw+YmFuzDB$3jm^4|_Ucy~}+NzFlN=LFx6 z%@dcjEm3`=a7lONhx%hV2i12SnI!o!`g?c1%k?F9v*vJ3((%9j-Yd`P+{5@2k|mwz zEYqWH*FO2E<{PB3dFh(M|J>WA?@cmY6mfaA+F_%)qL$C+6hE7H|9$znw>zbFp4a_p z;nS$IBrQjE!D;1-OAebBom;uyC41HJRoh-jEjAGAYY39h$Z~n58B&ycJ5Tz#RXNw` z5az9E46)4hkNU5zRufoKETWcBwB^H!quM98ecP71@4fofJJKr{Q`Be9bf`M$x9OD5 z)9Vopm!vHjXDWTaS0CA<5;<{l?J*{O3-;XEwPuGs{!LWL{eR1BmovX$z|6$+vBzE? z;;d?}y2)%{Y;0`2F5~LvickL=|7nE>UR->#%hc|GJ`ekY>Jm3?P2<Ron~g+d+_&XM zS<frKT&aGl`1$!C+j4K$KYQ%4E%)+H!>XK{KeoO7pS&k!g8k)6N&o+fJ93phgXC{y zeGz+dXvur=JsccPkE$IW2;Qo{^QVUUhs_7ehK^76O`P{wYj_@ftYbLh-cZimHSafL zK8wPBm+9-7Y)&cc<Iy>C<ZO^jQjf?kIsGf=1D<gECJAZqDpgA)h5XX#5nC+r;hLF; zG>cNvjEm6@^%X(~)Di_ZHw(!Y#94e_D12VkHuIC+gWV1vqYtPzRQ}g!`eC{6xU>T& zn}+EMn^%dERZ>f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D=T1b41nS8=}WI zd9f#7UOmT;K{<kJT72$X&0LkXZ6W8&9KK#$WaD-;eB++$%Rvdn!n1NqS4f0R{rQrZ z8?P@H{tl_H=uT)5cC++48XoxO>&p|<wCuk9HJxQ~s&KK)%14VMs-BAN@5@<vE4hF3 zLC4z<TlUJ>fBLcahnm=RzB_#1E#!Zcrg)3Si!QSDWB>h6>eouHiyv$rU!JJT>!fuv N^Z&&};f5n~831(#+B*OM literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-new-qt-for-python-app-qt-quick-empty-project-ready.webp b/doc/qtcreator/images/qtcreator-new-qt-for-python-app-qt-quick-empty-project-ready.webp new file mode 100644 index 0000000000000000000000000000000000000000..15f4235686776c8aec948bdaaf4ecc78ab600012 GIT binary patch literal 2652 zcmWIYbaM;gVqge&bqWXzu<-HVVqnm3JXFtcmFw}gUYU!3x9_d|{zzL%t>KK?1lBI8 z<##KhpZmXDQmJ}2*NOM`w#U6D`*W<{Mr7aKmV0}f<+j|}TaS1A-TQdvt#`#=f;ZGn zKe^`Z*^g;&A4Sd<SeI*k+a^9}`{vx++up{nJhv@(>D=7>*vmEXOLA|QnO&N^r|{Ue z+}ra`mfeki$)5{iuSrv@_<jCBuCnXA+qP-T_#N`L*=9Ydi|PNpQ0~=2`OSaqPfb-Z zUVn&peuRIAP+jJ?TE`39a+{tn{k-7K%P$o?OLBwlH-BDr=k1@WU+0hID!bo#wW;g0 z{|*)hW@d&f`YUee%#_d&{$%K^R>Wv>uEI-qnue#&05!}8jumiJFu5y8+ad?KLD z=Y%_h>uQEA&CSyuE?GH;U!ZvJ%NYW0QWE#STkiZHeCWXO8;aj29?o|*Nl4~YW0}{h zXz<bSStVz~N|)%okBhclmXzPV*mpx^Xy8uX(5%j>Tjx&WE12}NA*iRov+c=@gqbEr z8|O~A_EKZv@4A%xa}PMqej~(T=%RjLe$~ABb>eSy_?sgqmMXrUk-Gh_W%H8w!lE8| zXE!xI6Zfw-cwg^%biZ`oE6cTe1k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ZK}SHqm&Mh|Jtu@ji&#DuXz18N&mc_Z?c2&Mve6k zs~Df2ddk4G)b~|IYWl99_UjgU@k#kVV*P#QTIa&uJ=2A_dj4KNU|*>Jwlw)(__Y4L zkB?l{@c8~T_Uivn&f<?aYObgIhh8n{eYiIH<d<llB_SLizApXb_}caf^OGN}{8zu6 z<C)Q)&bBpNo9qA1KWEkLUV6>m$fd;ic&aa#v{i`5g1F#I@fX8n%*35PY{@_S>udAc z;KS^%ZcjfK&tLnq?a)8wGSyFPQ%><N{Zu#m5_?geZkgO3&58a3%N!qyU%Yj+^mvM? zU?b-%mg#ztJV~{epX$n0olxCVQ+V?Q>*crR&#j|tUEXs4NDBX2`}(=w>X}PIOr0mq zEe%+IhiAgVm~Z<Ry4V#sYb71>thb)N`Ehvk&TywH?JN3scYdAglGos{drQfa>(bnF zs%1lY#lI>x<R9-?cujv&kfCP(b{%WGjNOj)r#DS!jwzf`<TRzX_wCxWc$tk7CrzxT zzdHZlKK#hPyUQxCFV{6MmT%!zUR<4>sU^Oq&4ByA*pa4{R~x2Tym>#PENa@~SGPK} zv~m}}p0?pTry$ey)SZ`~n)n0@hKDa{^HKRA{m1F~S+z+0=jY5P>rZgcIlo-w?DWSi z&y?0JOMNH1c44^xA<hj!kGY>EKD77Oh_L+X-X|F5cUkZYbFx&gInR`Phc<kTYO?S$ znCx`*#EZ&f*Z%*oG1d-YUMlhXoJQcA%S)s3IbLkfd~o}Ky71!0dXI|-_PfmghE{E% Or}g(I=W8U?@B;vqQB14= literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-new-qt-for-python-app-widgets-define-class.webp b/doc/qtcreator/images/qtcreator-new-qt-for-python-app-widgets-define-class.webp new file mode 100644 index 0000000000000000000000000000000000000000..681df512fbe766bfd55a996a3363c2dbe7dada26 GIT binary patch literal 5968 zcmWIYbaV3%XJ80-bqWXzu<)@KXJF7*Jlw)?wd?V=i87u+|036a-(5bxV+O;#rPm(_ zrrp+KyxRGY@6n8N_s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$6oq zHPd6ncG@hS!MXW9%YDX~DUpYi?N|ho^iH-Ou5I|$`*y~}%maG@xq0U}<hfljSv$39 z%B)w?2WwTz4}4wu(z#SYcy@&Sl8NU9b7p6q(%PAMCwIrC<0^{L2i_#?+#UNtbi#}^ z(+wtiaq`aabo+8L;!vyew)VLj?v)-qp<;35sG7_N`NTUxS#F(C6C|@27BJmAkQMN9 zf+4r^$LA9r=a!slzgA!KV%A-Uqpu$yZ*KjS{Qae0c0sI@(sM(Z>(P^V{N{=I)%U#l zm-K%3Hx1n@-{#gF=P<l3Z+(+_?eqB&_S?&~?YWB2K9AkJ{miWwD#<B6r<<#vB}{!g zXI0RIlqs(TrILPo%sZeM$Dn$opk;cCQ8*~GbTIoTq$Zr%A<}M8cqn+1gv|0PU(w=y z+)pR4B(A;xP3eH!HX&v?hE#L4V_zo(SfyTYyTp<z#FF@c&taN>zSA0h-wD#sc6lrG zHfOKsU2^j8$6bbwDpo3O2O=zfTAbkMxas}0U@h}}H|vZ3iFZ=Y{j;w<c9mu8M3X|r qAWn_R*$T6ZrCM(;-eh;hBVMsfTewtys?(e|Q~s~m5XrughXDX|vw>Rx literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-new-qt-for-python-app-widgets-project-details.webp b/doc/qtcreator/images/qtcreator-new-qt-for-python-app-widgets-project-details.webp new file mode 100644 index 0000000000000000000000000000000000000000..3890e8e75bad09b22ea44c443c7fa9aca68dc92f GIT binary patch literal 7464 zcmWIYbaPXXWnc(*bqWXzu<#L)Wnj=(Jlw({+Wlx-u1xm-jgw>EfA8$zoRAT-!qz8E z*uic675$4!ZO6hUgk65sTvs^DSF7KsFuPaq_U7F4cXn*NT>Y1IZ_eWC_jjGt+p|JW ziJ6`J8_YEEk-o=7v#Wb2&7Q|`^Vc$U`P;uW_kO=uef{&D?|<#ypE>;SgRH{)Z?Q^w z&AF3o_%x=!J?qOOa_rWj*4=+|B+Zwp@9x%Nc6{gKl&lsYwb1l{AWPny!lw)+Po=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hVITStlNA{4;qSTE2bl zDX!h7rzB4|M%ll*w!!H5yOUj;)wKi)Lgu99Ij?a$$9dBzV(BFrpR&>d-j!b-aCv4w znX_TyyM%D5EOz~se47JH19%lP*G#X7-hTYbTZO5wWCZs7U4NJT#^lSVu5~ZHbZrLj zG>HgjEmv)owG)#MoqD+I#YUmb!1rD!RQFrU?mMzVmF>y|k8<08JdxQ?X4KgIyQ5vd z-!4bt(u*bg->+zmdGht+Q$6*=?~?x>{rcWn>h1nNo2F0h-eWm!t6QHZ*G15{gVNeH ip&sIur8Ott`)R2J{Z5I@7UA*SRQ&fi?`(yRI2Hiq$eu6& literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-new-qt-for-python-app-widgets-project-location.webp b/doc/qtcreator/images/qtcreator-new-qt-for-python-app-widgets-project-location.webp new file mode 100644 index 0000000000000000000000000000000000000000..7e0a84b938282662053f109ecbf050a9fd70182e GIT binary patch literal 6080 zcmWIYbaUGw&cG1v>J$(bVBxbyoPj}K@o)>n)vjCHdS$ZzZ+yS%&%(|QPKTCoCe@{# z|Anh8F5k%DENoW&y7vG4$J@59?alre`A%?d@i{X`4M{ss1=rT&#~*LZxYM-MIflVB zkHKA{vWI&Gw}j>MIiFYj`u{(aciYOwyhznR#-<F37Wb{nzFTJLuE-2}wwQ4fPuDxg zo!fG^_ZH8!ZcSaq7;W5O`$7F*#@;L@Ml1J3CiV1(f!^Vpw!Y1juDvh+F5u)jC%Ic! zFB$wXx1IheJy-K^N`4Cek~4povw9ZYbz8Obv0Q=DU5AV_(@hxElj=22|6lHwmy%Y; z%r;Z<-J98KH$UY3!!~cRe8bF{GiQEuNlZ)g3;F#2fAr#;1^yXZR<4`sv{!rcS_AdB zmwZyQGN-i4+}@U%eXKa&D&M^_?*6vi{rRhp?@hSAZSAVa=XMJ3PEOzb;N81->|J}d ze9p7|TmEEQugb}l_jW(9O3`YaC*IQ@(&6J#>GAu#`p-(?dClnuoldeJWGO$ixZ#%= z!<*j+t~1P+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qG@Y_zRb+?z|;@592+UT{+5+dKEgqwIBWznDzC8Dz@L zsZ(2?aa3{I)qoqXw8GsRc&0V|+P=1SU$;w^_th(UKWas$_OGru6*vD|Mw<6uyLq8@ z%NC`G-Dcmq?b#Oh&);7De|WBmao)TqfujDA<+m2k)cyK%$K&rgzg7JGK6P}pulajz zRk(5VtM`SUZ$7zqw&b?oyjef4_}L^If17vq%d^j&Aj!|Jio1T66dixRa{3~HSc_Df QSvN01%1v1_#*VcN08~uB2mk;8 literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-new-qt-for-python-app-widgets-ready.webp b/doc/qtcreator/images/qtcreator-new-qt-for-python-app-widgets-ready.webp new file mode 100644 index 0000000000000000000000000000000000000000..38fdac8750230f4e079c5e9ed04900adb0de925a GIT binary patch literal 1350 zcmWIYbaS&~Wnc(*bqWXzu<$WtWnj>MdBBJvpKbfL+^eUop4Wcw-(BtKQsVO_j$vl; z(>G=cmXnrvd^#g_?6!{a<@je`Py2*FTXm{I#dDI9`mU;(N6xG{|6=;Cm&`wy=l(o$ zX3foe>*oAt@Dh5cv?+?Ee3FL3948e)rbP`biXLYg4?3JwVqtM%U{*}H)BI(+$0YA2 zhEM;6XS(kE*V&}y{&JE^Yw`PEKQ$7RTtuA&R3^@0Xkv-<Z+X1`7|-AE%lT?|!xrB4 zcvmcNZE4aXuh40q<}aOo;Ox{WA;H!&^S`e&3U$=rU|oCuh~53C9Yu|2o*1b5{C++4 zx>I+{e)+Vdj+r~UXB!KfKiBI`f46RG)v2Px$8Wd0pPbD4zP~o>pZLxLtanz=3Sn-~ zV=z?|+UBsiCrwgDF+JsYuB555%$$RcOsf}g&a#MX*?zGkp#HjP_(j$emdRblAND`k z<$PJ%Mf-4NbK%W|7_<HJ&E&#+kC{IH9k^l9XG=xf?S+k*>-l%j;QLk3GdsEFZ{3eS zzdx{89A9uV{lXjL_&er#_bqO-1|Qh<atCW)jFi!Sqy6_PLw<^j$n9j~R4L%wl=u10 zyIb}VS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H@Aq!v0JzxA{ zj&K#1=J{SGrB`nPA1oA`m$<6uTvL0}>BIA!ru=JPyy`XU8IDEV2M%b|{e1BD(Y()Q zU#BwdGS7BCmN1)bf$}f?F98gfO+vNodb3=n8hZV2oua<-MzPEjBWAw9^m4Hbh8x+! Zi7%sH%&(64wY+cX|C#@@Ih<9Q832bfm`?xz literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-new-qt-for-python-app-window-ui-uic.webp b/doc/qtcreator/images/qtcreator-new-qt-for-python-app-window-ui-uic.webp new file mode 100644 index 0000000000000000000000000000000000000000..2e6368d91418498100e3ab7aff1a170d3b321854 GIT binary patch literal 5510 zcmWIYbaSf{Wnc(*bqWXzu<$7qWnj?nKBUd?we8WiT$#-O8z;a1Dk&)JuzQPjHTwpR zWhns*st?*t5%$a}TFeul==7-Vj>+#eH#8=DMY3u8dByMklU9CuPEp0~a}S=}+4RaN z>H1%L_dc1{Dt4ylPkrr~555SRX}t4}hO)x?&638Ib34UmOjr29RWzCF!ET;yumAu4 z|35Uh&A8~{!PzI%b}qURIQ`Af-3Lzu=~kD;hAcRD_SEW)`<_avOv$}HP5rys8r?_V zoa*<tO}4wUHL~=F^Sh|G$7Gl7sLMaL(28H?_O@xJ--WhY$uFHMn8S5{_8tG(QpXsc zx=UZ5&Nuzk-M#-eW!&C&DQ)6~B;K3P4?b-=KKa@7Ltp-9-+tyg#W0o2*m))rhzrg+ z`D=OD<jriFe_o%~c|U{8a&3<vd)&IoMp`?1EHgu%9h*MeghMRFb<z`$uvu%{J{V-U zro54O^S`;eKy6Oq?QMxJi~sMxbiU2jV9kF470;q8Df9O;vu(dL^8w@fzu$Ysrn^4W zDEzrBv&*PrqucZyU8+4ArGdi2Y;SY;d^%JYun3l1v1<qvE-qnQ+TC+Vjw}C-!*Ny7 z+_)(mhN8|^+@e3@T6UaJTM;P9dCqEw)eDE|AzL&ZG;~E;PrB>$Wu+BOW0_jNT3Nws zqHjcY<&><Njh8lwr9bkoIV#<&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{*sC3oad4ib zP44Mb_BE4UKb~q;aWT`e=*5F3yVm;(ip)OGWMb1-wCF|a_$>B}<=(Prsf6#EDx;9s z4|nBcCfq6#Rc*epyvJrvguK4%>TNHb&7_4?!fw1gd$euIg{7&BoY^JLXwGQli7hy+ zZg>CJ4->E5If@H{vpn6R^B3lvh`+${YT-sng}*7jD^E{jsbEP728GT2DV*Ov25re| zzL$6Ds_6~Q%PnCObZuu|Ty1(`Zt5gwcF9-OF7MtItxiqf)GZ-nVp+4;fU%v=XcCu) z*zS&<&6(EIW~)5Bz-x13+G)j|x5{$9l`JT)lC{2)t6Y5aZvDG|zps^7t!s{K)B170 zGUv(hr%Vsa<xao+m*%XJ-WvMuo4K@|U=<6`q<?9L6`Ggszj@*Kf|vPhJem8ye_?o) z?-qXe=KE&5hF`OJv!xHp*L*mX`?J<qGQUvv@B3qa_RV}#wz=`@{TvVF^}lBeHcfi@ S$~44~A^U3Ew(AGY85sZ}P=zo6 literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-python-interpreters.png b/doc/qtcreator/images/qtcreator-python-interpreters.png deleted file mode 100644 index 546adb1b2d363d45314b1cfb5be49ae42fb03489..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4987 zcmeAS@N?(olHy`uVBq!ia0y~yU<_wqU|7e&1QOYKQ;UH?*vZqyF{I+w+qu!jw|7Xk zeP3U){Oy}38$5;0+xOl`nVoXm_K4>i6}uB*Io{VI%W~4KgY%`+%NPAlx%P5t>GK=a z7o*eFPSs!Vf5k4xD4?J@bCSoSt9u?VbYM_PspDsq`%qW*?@+7$xw*d&Kc7EaIqUsS zZt;D4N+g>UE~Oh^UpIB$+G|-~qxL4YWR+&UKNG)xu6@1S|2mE&kp&YXqV>h)><!(o z#ASUIU*lZx@y<`~`ahTFD{8ouOqjF3!tlJvg5t%292;EME?anT>dcwy{?9p^1w@pr zJl4g{wXA=bRHqq`Kf|N3s#(L~|J|cYAAPs~!{Mm7sJVqt^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uEM8;!#v}aqiMPdDEX?jXNC1cD{Ve-kq`9 zC+8jQ+#!AbrP-<I*<PKG!Ztk(<8oZN(Ba`lujJe2d}Wt4FFs@H_ECH?ExRUd?&A*} z?~a}772><IDaYQCk;96cwdL@<&mwhOHr!e#{<OqvOHIq|uUWVK1jDyppWkN5*Z(AM z&5aj#4nN&Bd*{1nU%ENI9gqB^)3zWpfB}@#Qmj}jwg=7qU0{{l@i2_b@nkSWSc&xk zsKj-Ha;+fTWe_e4mjfs(q7e;DAVCnBq5)Bkrn_P`2gphmt^=DTL>hXQGk`L{i5v*m z2g2nLk!WPnmX2Qcb;Dy#n<>Q~1FjuDd4-3|A;9PSBMGfA^GfrFNn1Brttl?7iGO?~ zt1aCS6f1op8~6MS{u`+zcKBmWukb3#c}E3AF0VE5IujYONs;fy1U8=Tt9^%`s=fDG zQ*I(^>*4M9v@uAqDO!_7)txadQO2p!qV4FM<CQBVpXTXJ+qC_hgK&un8>>Qw3RlOx zqk&1!4)uy2)jIdaA|pcPbYaBv>@{UdWoM^6=7L%jG{<+vr8binb~4usXWVZ&bv@$5 z%G<naAB1r^dIlc&X!K3FVBel?N<Ue<-yN=+oy^NR<L}1cBXMOm7kAD&eCDDfBZt&9 zriJZ$qxS6IkQ;O+n&<Sp!-{6dFKtra-Vwil^5&@5H(p+Sx=>w^kyRl;;q|<ur=`zZ zpPzSVvqaORWd{QCmIi+{(hJ*m>-@X}Yekxtc{Q%&5@}fQ5gN%RkobT`UkWrfLD7X4 nhYkxEKwUmMkqwL@KkO}8SifERF(s0Lfq}u()z4*}Q$iB}x$+Yu diff --git a/doc/qtcreator/images/qtcreator-python-interpreters.webp b/doc/qtcreator/images/qtcreator-python-interpreters.webp new file mode 100644 index 0000000000000000000000000000000000000000..901b3427bfe1609dfec376089642f3a2f2748988 GIT binary patch literal 4098 zcmWIYbaVT~&%hAw>J$(bVBzzQpMgRD;6Xixt3RfFJ70J^=k~X!rzFGAS;jw^>e6uW zl+a|CxIG-3PX!*;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M7OXiIp!&VqY3GXRkAsfr&g&2m^$7b|wOnn7 z#Zi&D@8!4qi+``a)Tlp`f9mF-@Ut^l)(idLyFKyxoz!Jto_Q;=Ni?_^|H$Lg^1SoJ z!1^oyBd2W5>vvT1zC80@)IIkS;|Zf0uf20+y$&s&cP8ZC632L>bz4fN&kWk7KU3I5 h<8A6Pljq(}d*#%OzfSvKb-I4<)BX28#XnmV3ji}t<VOGi literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-python-wizard-define-python-interpreter.webp b/doc/qtcreator/images/qtcreator-python-wizard-define-python-interpreter.webp index 8621040267a0a7771015fb5bac3a5f47ba26abbb..1a2559c4bc383d7a95021301514e8f1f67fcb183 100644 GIT binary patch literal 7172 zcmWIYbaVS7&A<@u>J$(bVBzyYnt?%I@o)=+X!mWiNir)}eL7$Dbne$fogJJH9%no~ zT-n;b$C$}O;dozwbif+rxObba?M}4Ry31{?*!%eQzpk~HxU}OLS&SaqF2A*JTYRa? z)Ay2RAK0ziT5zoS@Q;|YqH+J3!q<fEIKAU3*Ywj9?>v6@?pF4<e}C($=RXNqbt5zF zae#8`VUGfdmB&)INa$F6xg~D-_?_{NZ6cwT0o<IoGUtd$-O;W1#W($s<~29J#FuGn zzhp?g=H4+WWp$p~q)p3>Zhucbq`%|)|KPc2&Ll1SJuh%i!Mfb&*>}!|e-~@7N;&lQ z@BiP&&xqa8&D`JV^LM)I?Xat1-Ny<yzPdYM-Y<@K0iV>b-uhn}^p3T>{QH)7@65`k zSuePB=kDFRcT1%@yAz-P|NlP!+|M`vJ&s>De>m4<?y}1Tmtq*-eTdEsQR;m5?sCSv zfN-^SZgY+`KJl2Ow6f0lLw#o2%$YN1O6JWp)oND0y)85QeC13#*FW2GZ~yz-|31^@ z|5JxaOFV*p82(%SE99G!>d*h8JI@NHmVWQ?Gk9Xzlx7mXz<5V=`i0Ai|I(}8|Bt$> zbogANUtDLIW-rfb1K+7-i7_X4eA1ia(;B!ga`_n%H%Im}KG_GePO1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+GZ~Ih!%koHx`SHDJ{UN1>O}F3p2bdV?>Eyk>cvH5- zeRtY~)wkXp?TF=OC`)}|^ps1(K|J=<>*Gr}j(N-zU|{4iGAIj(NMK>P)?^~<;?%i2 zWct+IYysEujQUnRP*TadmU3mA;~^G4;WIpnH`<D)e%ZoW9Um}dTH&Sltnu9fy;U0i za@`_-4fI$Z74LODU{E__=^{a?GL1K<E~H9nE?`(_aMse@z^#aVk6o^4;p*Mrm8Z|2 zSje1Q*t_P`ysS;42Ew}}onA=$g>pT=U+=wNtmf+1%Wo|-<%F&tSjn*~R`ALSZpRn- zTRgd*-}k&AU}#qOjrpgRR$h9TTd;*gy6!}$AFSdk-QBtB2fkjYnG*9Qxgo~YcX7|r zLz(Nv+^mmP#mG5N3QzpgzVi&v!%c7NJp7H;eazkWZ;|~M>k0L<zlz_AS-ecFUG93q z+4sU?Pk&8*Hp6VUA=lN0**%r<$JpiF(oV{V&9T&QaJU#4(-zV5gtN|sbw`rjv3wuH z$6f!-rXTZ|x1rofg?odJzu@!4XVR0;@-Rkat$b#2rqVbj^xR~HCBO3Wo4xu{*P4p| zd(b6z=FVZYnT1CkW_u^A_*PVuTg5!-Q2oy5eDD9iRn|Gb5{1uNB)zjN-)ZW0>B-L@ zAItw*xtoX=9tICRaGi+$`tjua<?jzalR5L#AkX6CyW?^0{nZ^s**!}-xi6kRbl6$O k&?o0j{@?mN|Nov07GD(99-Taer*Kp7zr}~tID@np09aX~!vFvP diff --git a/doc/qtcreator/images/qtcreator-terminal-python.webp b/doc/qtcreator/images/qtcreator-terminal-python.webp index 30fd14cd818aedd4294f1bbac80afd607aaf8135..dad8b3b1e9db237a5a0894d4a963c77a021fcf36 100644 GIT binary patch literal 4714 zcmWIYbaP7*Vqge&bqWXzu<!{JVqnnkKBUcXmF=<FB$3dk^4|^|dV5h{N$r4a=5A%< z<1C>D>aht)(o6jg9BG_+_1gp4$@7nIHnF^58L7KlJ8-$@71h48Z)6Q7tkx^8%3tPP z_I=S*_h-w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1<<UpxHuwdWUL&KCiOZ<+6<uzIF;CDX(w! z?b~8ztsEVzl60LT)Jpr8aGPIswEym@(@i>G{k&+qmNOt<Buwsc>x`BfH9><}9Fw!$ zPA&SRbiKK9v9t-J!j)fcrq(Oj&K*#%?3R13*)caQUz}%_tJccu2Mgll+|K-H-6>+b zA+VwHtJKU=IUb|UJpw!#txB0<iLJ)}mh8$<_1#l-Oiv<Y7Q@$yKc}qDznq%prGB1S z!uQBSd8-G95BpvX@V&#)Qfj>U@r@;+jv8M(_i8)xDtSgYeZ6C_sB00|t>&ti5BqlW z9#MGB)2zAbKu6%h^01a0ZWlMrlK85W5RljuI^R5PtGHmAmpZ@2td0YvEkYNjSe1wb zHT*1ZxWwEhxb;b)d231H9K*fddmp%l-&*iXWI_9}lU#jjQYSQzm99UYF)5+H;1Pqu ztH<&U0ajd^M)nV?1)e=wqq~vga0kcodtbUgIWh?}Kk#AVTG(2=tf}%qYg*%>mKFPA zCMhK{K3(Y$w8_)?Fz^0{5%YyEupCZ(vqi>!srt3sG75=7ye*RsDV|A*@#I^|;B!qi zsq@<ciyjT%+mfPPevKMa8gc^sd6S+od~I@NlC*d*M^n&bVb#g4EF4n}w!ZSWIH=_4 z^C=`@<K9U(GL&v6UfQ`=m8Vx#HKhDX-iuR9!fWo@zc@d~Q`dq^By_eq!{tv_V%PVc zWmu5n5V^JT(-Q41Yofj??!T*O?jU^h-`O(Fpc5$!|Gn0I_TG8jcu9EC9R99UeU~cL z<v&e+@&`|g^NhN?<LdIcuhv^$`@P#b_2g%p^UMDkf1SVbzt7+FSN6gGXZ|{WrG6P) z=$D+e_y3BHe$TwG=Z$`HJq+7#^5?R3SmD}w*7WVaz8}3e^Vf9gewSxjS{v0W4>6o8 VRXeycPrRaRb@cPU?%`j>82}>YuFwDg diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc index d457abc4f97..03cfc5b1bae 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc @@ -214,7 +214,7 @@ \l{https://docs.python.org/3/library/pdb.html}{PDB} is a source code debugger for Python applications. You can use it to debug projects that have a - \l {Creating Widget-Based Qt for Python Applications}{.pyproject} + \l {Creating a Qt for Python Application with Qt Widgets}{.pyproject} configuration file. You must install Python and set the interpreter to use in \uicontrol Projects diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index 5b3e0797f71..1c93720d9f6 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -156,7 +156,7 @@ a long time. Typically, in the range of several seconds to minutes if you use complex features. - For \l {Creating Widget-Based Qt for Python Applications}{Python} projects, + For \l {Creating a Qt for Python Application with Qt Widgets}{Python} projects, start debugging the \c main.py file. If you encounter problems, check the active build target in the \l{Building for Multiple Platforms}{kit selector}. diff --git a/doc/qtcreator/src/editors/creator-coding.qdoc b/doc/qtcreator/src/editors/creator-coding.qdoc index ce095492875..b8c989f0150 100644 --- a/doc/qtcreator/src/editors/creator-coding.qdoc +++ b/doc/qtcreator/src/editors/creator-coding.qdoc @@ -90,13 +90,6 @@ \l{https://github.com/features/copilot}{GitHub Copilot} into \QC. You can view suggestions from Copilot in the code editor. - \li \l{Developing Qt for Python Applications} - - To support developing Qt for Python applications, \QC lets you - set up Qt for Python, use project wizards to create Qt for - Python applications, write Python code, and run and debug the - applications. - \li \l{Editing MIME Types} \QC uses the MIME type of a file to determine which mode and editor diff --git a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc index 4c3d1d220dc..76dc97baabb 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc @@ -4,7 +4,7 @@ /*! \previouspage creator-language-servers.html \page creator-copilot.html - \nextpage creator-python-development.html + \nextpage creator-mime-types.html \title Using GitHub Copilot diff --git a/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc b/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc index 17fb6d32768..662b3c0fa20 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc @@ -8,7 +8,7 @@ // ********************************************************************** /*! - \previouspage creator-python-development.html + \previouspage creator-copilot.html \page creator-mime-types.html \nextpage creator-modeling.html diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 9e2dc2afc40..88fe789e98b 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -61,6 +61,7 @@ \list \li \l {Add a license header template for C++ code} + \li \l {Develop Qt for Python applications} \endlist \section1 Use \QC diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index 77164799119..638e4927283 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -133,8 +133,6 @@ For more information about creating Qt Quick projects, see \l {Creating Qt Quick Projects}. - \include creator-python-project.qdocinc python project wizards - \section1 Specifying Project Contents A project can have files that should be: diff --git a/doc/qtcreator/src/python/creator-python-development.qdoc b/doc/qtcreator/src/python/creator-python-development.qdoc index 75865bd6798..a41cb1f777d 100644 --- a/doc/qtcreator/src/python/creator-python-development.qdoc +++ b/doc/qtcreator/src/python/creator-python-development.qdoc @@ -3,27 +3,27 @@ /*! \page creator-python-development.html - \previouspage creator-copilot.html - \nextpage creator-mime-types.html + \previouspage creator-how-tos.html - \title Developing Qt for Python Applications + \ingroup creator-how-to-projects - \l {https://doc.qt.io/qtforpython/index.html}{Qt for Python} enables you - to use Qt 6 API in Python applications. You can use the PySide6 modules - to gain access to individual Qt modules, such as \l {Qt Core}, \l {Qt GUI}, - and \l {Qt Widgets}. + \title Develop Qt for Python applications + + With \l {https://doc.qt.io/qtforpython/index.html}{Qt for Python}, you can + use Qt 6 API in Python applications. Use the PySide6 modules to gain access + to individual Qt modules, such as \l {Qt Core}, \l {Qt GUI}, and + \l {Qt Widgets}. The following sections describe using \QC for developing with Qt for Python: \list - \li \l{Creating Widget-Based Qt for Python Applications} - {Creating Qt for Python Applications} - \li \l{Setting Up PySide6} - \li \l{Selecting the Python Interpreter} - \li \l{Creating a Virtual Environment} - \li \l{Using Python Interactive Shell} + \li \l{Set up PySide6} + \li \l{Create Qt for Python applications} + \li \l{Select the Python interpreter} + \li \l{Create a virtual environment} + \li \l{Use Python interactive shell} \li \l{Python Language Server} - \li \l{Running Python Projects} + \li \l{Running Python projects} \li \l{Specifying Run Settings for Python Projects} \li \l{PDB} \li \l{Launching the Debugger} @@ -33,7 +33,7 @@ limitations, see \l {https://doc.qt.io/qtforpython/index.html} {Qt for Python}. - \section1 Setting Up PySide6 + \section1 Set up PySide6 If you have not installed the required version of PySide6, \QC prompts you to do so when you open a .py file. @@ -45,12 +45,38 @@ and annotations. Select \uicontrol Install to install PySide6 and the language server. - \section1 Selecting the Python Interpreter + \section1 Create Qt for Python applications + + You can use wizards to create Qt for Python application projects. The wizards + generate a project file, \c {.pyproject}, that lists the files in the Python + project. They also generate a \c {.py} file that has some boilerplate code. + In addition, the widget-based UI wizard creates a \c {.ui} file that has a + \QD form, and the Qt Quick Application wizard creates a \c {.qml} file that + imports Qt Quick controls. + + \note Before importing UI classes and after editing them, create the Python + code from your UI form. In PySide6, run \c{pyside6-uic form.ui -o ui_form.py} + in the \l Terminal view. + + \image qtcreator-new-qt-for-python-app-window-ui-uic.webp {Creating Python code in Terminal} + + The \uicontrol Window wizard adds code to the source file, without the UI + file. + + The \uicontrol Empty wizard adds code to the source file, but it + does not add any classes, so you need to add and instantiate them yourself. + + The \c{.pyproject} files are JSON-based configuration files that replace + the previously used \c {.pyqtc} configuration files. You can still open and + use \c {.pyqtc} files, but we recommend that you choose \c{.pyproject} files + for new projects. + + \section1 Select the Python interpreter You select the initial Python interpreter when you use the Qt for Python Application wizard templates to create Python projects. - \image qtcreator-python-wizard-define-python-interpreter.webp {Define Python Interpreter wizard page} + \image qtcreator-new-qt-for-python-app-widgets-project-details.webp {Define Project Details dialog} You can see the current Python interpreter on the \uicontrol Edit mode toolbar. @@ -67,30 +93,33 @@ Or, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Python > \uicontrol Interpreters. - \image qtcreator-python-interpreters.png {Python Interpreters in Preferences} + \image qtcreator-python-interpreters.webp {Python Interpreters in Preferences} You can add and remove interpreters and clean up references to interpreters that you uninstalled, but that still appear in the list. In addition, you can set the interpreter to use by default. - \section1 Creating a Virtual Environment + \section1 Create a virtual environment - To create a virtual environment (\c venv) when you use the Qt for - Python Application wizard templates to create Python projects, select - the \uicontrol {Create new virtual environment} check box on the - \uicontrol {Define Python Interpreter} wizard page. Specify the - directory where to create the environment in + To use a clean \l{https://docs.python.org/3/library/venv.html}{Python} + virtual environment (\c venv) that is independent of your global Python + installation for a Qt for Python project, select the + \uicontrol {Create new virtual environment} check box in the project wizard. + Set the directory where to create the environment in \uicontrol {Path to virtual environment}. - \section1 Using Python Interactive Shell + \section1 Use Python interactive shell - You can write Python code in the Edit mode. Select \uicontrol REPL on the - toolbar to start the \l{https://pythonprogramminglanguage.com/repl/} - {Python interactive shell} in the \l Terminal pane. + You can write Python code in the \uicontrol Edit mode. Select \uicontrol REPL + on the toolbar to start the \l{https://pythonprogramminglanguage.com/repl/} + {Python interactive shell} in the \l Terminal view. - \image qtcreator-terminal-python.webp {Python shell on the taskbar} + \image qtcreator-terminal-python.webp {Python shell in the Terminal view} To start the shell and import the current file as a module, select \uicontrol {REPL Import File}. To also import all functions from the file, select \uicontrol {REPL Import *}. + + \sa {Creating a Qt for Python Application with Qt Widgets}, + {Creating a Qt for Python Application with Qt Quick} */ diff --git a/doc/qtcreator/src/python/creator-python-project.qdocinc b/doc/qtcreator/src/python/creator-python-project.qdocinc deleted file mode 100644 index 80887fc9788..00000000000 --- a/doc/qtcreator/src/python/creator-python-project.qdocinc +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! -//! [python project wizards] - - \section2 Creating Widget-Based Qt for Python Applications - - The Qt for Python Application wizards generate a \c {.pyproject} file that - lists the files in the \l{Developing Qt for Python Applications}{Python} - project and a \c {.py} file that has some boilerplate code. In addition, the - widget-based UI wizard creates a \c {.ui} file that has a \QD form, and the - Qt Quick Application wizard creates a \c {.qml} file that imports Qt Quick - controls. - - The \c{.pyproject} files are JSON-based configuration files that replace - the previously used \c {.pyqtc} configuration files. You can still open and - use \c {.pyqtc} files, but we recommend that you choose \c{.pyproject} files - for new projects. - - The \uicontrol {Window UI} wizard enables you to - create a Python project that has the source file for a class. Specify - the PySide version, class name, base class, and source file for the - class. - - \image qtcreator-python-wizard-app-window.png {Define Class wizard page} - - The wizard adds the imports to the source file for - access to the QApplication, the base class you selected in the Qt - Widgets module, and Qt UI tools: - - \badcode - import sys - - from PySide6.QtWidgets import QApplication, QWidget - \endcode - - \note It is important that you first create the Python code - from your UI form. In PySide6, you can do this by executing - \c{pyside6-uic form.ui -o ui_form.py} on a terminal. This - enables you to import the class that represents your UI - from that Python file. - - Once you generate the Python code from the UI file, - you can import the class: - - \badcode - from ui_form import Ui_Widget - \endcode - - The wizard also adds a main class with the specified name that - inherits from the specified base class: - - \badcode - class Widget(QWidget): - def __init__(self, parent=None): - super().__init__(parent) - \endcode - - The following lines in the main class instantiate the generated Python class from - your UI file, and set up the interface for the current class. - - \badcode - self.ui = Ui_Widget() - self.ui.setupUi(self) - \endcode - - \note You can access the UI elements of the new class as member variables. - For example, if you have a button called \e{button1}, you - can interact with it using \c{self.ui.button1}. - - Next, the wizard adds a main function, where it creates a - QApplication instance. As Qt can receive arguments from the command line, - you can pass any arguments to the QApplication object. Usually, you do not - need to pass any arguments, and you can use the following approach: - - \badcode - if __name__ == "__main__": - app = QApplication(sys.argv) - \endcode - - Next, the wizard instantiates the \c MainWindow class and shows it: - - \badcode - widget = Widget() - widget.show() - ... - \endcode - - Finally, the wizard calls the \c app.exec() method to enter the Qt - main loop and start executing the Qt code: - - \badcode - sys.exit(app.exec()) - \endcode - - You can now modify the boilerplate code in the Edit mode to develop your - Python application. Always regenerate the Python code after modifying a - UI file. - - Open the .ui file in the \uicontrol Design mode to create a widget-based UI - in \QD. - - The \uicontrol Window wizard adds similar code to the source file, without - the UI bits. - - The \uicontrol Empty wizard adds similar code to the source file, but it - does not add any classes, so you need to add and instantiate them yourself. - - For more information about the - \uicontrol {Qt for Python - Qt Quick Application - Empty} wizard, see - \l {Qt Quick Based Python Applications}. - - For examples of creating Qt for Python applications, see - \l {https://doc.qt.io/qtforpython/tutorials/index.html} - {Qt for Python Examples and Tutorials}. - -//! [python project wizards] - - -//! [python qml project wizards] - - \section1 Qt Quick Based Python Applications - - The \uicontrol {Qt for Python - Qt Quick Application - Empty} wizard enables - you to create a Python project that has a main QML file. Specify the - minimum PySide version to run the application. - - \image qtcreator-python-wizard-qml.png {Qt for Python wizard for creating an empty Qt Quick application} - - The wizard adds the following imports to the source file for access - to QGuiApplication and QQmlApplicationEngine: - - \badcode - import sys - from pathlib import Path - - from PySide6.QtGui import QGuiApplication - from PySide6.QtQml import QQmlApplicationEngine - \endcode - - The wizard also adds a main function, where it creates a QGuiApplication - instance and passes system arguments to the QGuiApplication object: - - \badcode - if __name__ == "__main__": - app = QGuiApplication(sys.argv) - ... - \endcode - - The following lines in the main class create a QQmlApplicationEngine - instance and load the generated QML file to the engine object: - - \badcode - engine = QQmlApplicationEngine() - qml_file = Path(__file__).resolve().parent / "main.qml" - engine.load(qml_file) - \endcode - - Finally, the wizard adds code that checks whether the file was successfully - loaded. If loading the file fails, the application exits with an error code. - If loading succeeds, the wizard calls the \c app.exec() method to enter the - Qt main loop and start executing the Qt code: - - \badcode - if not engine.rootObjects(): - sys.exit(-1) - sys.exit(app.exec()) - \endcode - - Open the .qml file in the \uicontrol Edit mode to design a Qt Quick UI, or - use \l{Qt Design Studio Manual}{\QDS}. - -//! [python qml project wizards] -*/ diff --git a/doc/qtcreator/src/python/creator-tutorial-python-application-qt-widgets.qdoc b/doc/qtcreator/src/python/creator-tutorial-python-application-qt-widgets.qdoc new file mode 100644 index 00000000000..98e26bf8b83 --- /dev/null +++ b/doc/qtcreator/src/python/creator-tutorial-python-application-qt-widgets.qdoc @@ -0,0 +1,173 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page tutorial-python-application-qt-widgets.html + \previouspage creator-tutorials.html + \nextpage creator-project-managing.html + + \ingroup creator-tutorials + + \title Creating a Qt for Python Application with Qt Widgets + + \brief How to develop a Qt widget-based application with Python. + + First, create a Qt for Python application project. Then, edit the boilerplate + code to develop a small application that uses Qt widgets to display the text + \e {Hello World} in several languages. + + \image qtcreator-new-qt-for-python-app-widgets-ready.webp {A small Qt Widgets application} + + For more examples of creating Qt for Python applications, see + \l {https://doc.qt.io/qtforpython/tutorials/index.html} + {Qt for Python Examples and Tutorials}. + + \section1 Creating an Empty Window Project + + To create a Qt for Python application that has the source file for a main + class: + + \list 1 + \li Select \uicontrol File > \uicontrol {New Project} > + \uicontrol {Application (Qt for Python)} > \uicontrol {Empty Window} + > \uicontrol Choose. + + The \uicontrol {Project Location} dialog opens. + \image qtcreator-new-qt-for-python-app-widgets-project-location.webp {Project Location dialog} + \li In \uicontrol {Name}, enter the project name. For example, + \e {hello_world}. + \li In \uicontrol {Create in}, enter the path for the project files. + For example, \c {C:\Qt\examples}. + \li Select \uicontrol{Next} (on Windows and Linux) or \uicontrol Continue + (on \macos) to open the \uicontrol {Define Class} dialog. + \image qtcreator-new-qt-for-python-app-widgets-define-class.webp {Define Class dialog} + \li In \uicontrol {Class name}, type \b {MyWidget} as the class + name. + \li In \uicontrol {Base class}, select \b {QWidget} as the base class. + \note The \uicontrol {Source file} field is automatically updated to + match the name of the class. + \li In \uicontrol {Project file}, enter a name for the project file. + \li Select \uicontrol{Next} or \uicontrol Continue to open the + \uicontrol {Define Project Details} dialog. + \image qtcreator-new-qt-for-python-app-widgets-project-details.webp {Define Project Details dialog} + \li In \uicontrol {PySide version}, select the PySide version of the + generated code. + \li In \uicontrol {Interpreter}, select the Python interpreter to use for + the project. + \li Select the \uicontrol {Create new virtual environment} check box to + use a clean \l{https://docs.python.org/3/library/venv.html}{Python} + environment that is independent of your global Python installation. + \li In \uicontrol {Path to virtual environment}, specify the directory + where to create the environment. + \li Select \uicontrol{Next} or \uicontrol Continue. + \li Review the project settings, and select \uicontrol {Finish} (on + Windows and Linux) or \uicontrol Done (on \macos) to create the + project. + \endlist + + The wizard generates the following files: + + \list + \li \c {hellow_world.pyproject}, which lists the files in the Python + project. + \li \c {mywidget.py}, which has some boilerplate code for a class. + \endlist + + \section1 Adding Qt Widgets Imports + + The wizard adds the imports to the \c mywidget.py source file for access to + the QApplication and the base class you selected in the Qt Widgets module, + QWidget. In addition, you need to import \c random and QtCore for randomly + selecting the language of the displayed text and QtWidgets for adding UI + elements: + + \badcode + import sys + import random + from PySide6.QtWidgets import QApplication, QWidget + from PySide6 import QtCore, QtWidgets + \endcode + + \section1 Adding a Widgets-Based UI + + The wizard adds a main class with the specified name that inherits from the + specified base class: + + \badcode + class MyWidget(QWidget): + def __init__(self, parent=None): + super().__init__(parent) + ... + \endcode + + Add button, label, and layout widgets to create UI elements: + + \badcode + ... + self.hello = ["Hallo Welt", "Hei maailma", "Hola Mundo", "Привет мир"] + + self.button = QtWidgets.QPushButton("Click me!") + self.text = QtWidgets.QLabel("Hello World", + alignment=QtCore.Qt.AlignCenter) + + self.layout = QtWidgets.QVBoxLayout(self) + self.layout.addWidget(self.text) + self.layout.addWidget(self.button) + ... + \endcode + + \section1 Adding Signals and Slots + + Then, add a signal and a slot to implement the random function: + + \badcode + ... + self.button.clicked.connect(self.magic) + + @QtCore.Slot() + def magic(self): + self.text.setText(random.choice(self.hello)) + \endcode + + \section1 Adding a Main Function + + The wizard adds a main function, where it creates a QApplication instance. As + Qt can receive arguments from the command line, you can pass any arguments to + the QApplication object. Usually, you do not need to pass any arguments, and + you can use the following approach: + + \badcode + if __name__ == "__main__": + app = QApplication(sys.argv) + ... + \endcode + + \section1 Instantiating the MainWindow Class + + The wizard instantiates the \c MainWindow class and shows it: + + \badcode + ... + widget = MyWidget() + widget.show() + ... + \endcode + + \section1 Executing the Qt Code + + Finally, the wizard calls the \c app.exec() method to enter the Qt + main loop and start executing the Qt code: + + \badcode + ... + sys.exit(app.exec()) + \endcode + + \section1 Running the Application + + Select the \inlineimage icons/run_small.png + button to run the application. + + \sa {Creating a Qt for Python Application with Qt Quick}, + {Develop Qt for Python Applications} +*/ diff --git a/doc/qtcreator/src/python/creator-tutorial-python-application-qtquick.qdoc b/doc/qtcreator/src/python/creator-tutorial-python-application-qtquick.qdoc new file mode 100644 index 00000000000..ab9cf0df510 --- /dev/null +++ b/doc/qtcreator/src/python/creator-tutorial-python-application-qtquick.qdoc @@ -0,0 +1,187 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-tutorial-python-application-qt-quick.html + \previouspage creator-tutorials.html + \nextpage creator-project-managing.html + + \ingroup creator-tutorials + + \title Creating a Qt for Python Application with Qt Quick + + \brief How to develop a Qt Quick application with Python. + + First, create a Qt for Python application project. Then, edit the boilerplate + code to develop a small application that uses Qt Quick to display the text + \e {Hello World} in several languages. + + \image qtcreator-new-qt-for-python-app-qt-quick-empty-project-ready.webp {A small Qt Quick application} + + \section1 Creating an Empty Project + + To create a Qt for Python application that has a main QML file: + + \list 1 + \li Select \uicontrol File > \uicontrol {New Project} > + \uicontrol {Application (Qt for Python)} > + \uicontrol {Qt Quick Application - Empty} > \uicontrol Choose. + + The \uicontrol {Project Location} dialog opens. + \image qtcreator-new-qt-for-python-app-qt-quick-empty-project-location.webp {Project Location dialog} + \li In \uicontrol {Name}, enter the project name. For example, + \e {hello_world_quick}. + \li In \uicontrol {Create in}, enter the path for the project files. + For example, \c {C:\Qt\examples}. + \li Select \uicontrol{Next} (on Windows and Linux) or \uicontrol Continue + (on \macos) to open the \uicontrol {Define Project Details} dialog. + \image qtcreator-new-qt-for-python-app-qt-quick-empty-project-details.webp {Define Project Details dialog} + \li In \uicontrol {PySide version}, select the PySide version of + the generated code. + \li In \uicontrol {Interpreter}, select the Python interpreter to use for + the project. + \li Select the \uicontrol {Create new virtual environment} check box to + use a clean \l{https://docs.python.org/3/library/venv.html}{Python} + environment that is independent of your global Python installation. + \li In \uicontrol {Path to virtual environment}, specify the directory + where to create the environment. + \li Select \uicontrol{Next} or \uicontrol Continue. + \li Review the project settings, and select \uicontrol {Finish} (on + Windows and Linux) or \uicontrol Done (on \macos) to create the + project. + \endlist + + The wizard generates the following files: + + \list + \li \c {hello_world_quick.pyproject}, which lists the files in the Python + project. + \li \c {main.py}, which has some boilerplate code. + \li \c {main.qml}, which imports Qt Quick controls. + \endlist + + \section1 Adding Qt Quick Imports + + The wizard adds the following imports to the \c {main.py} source file for + access to QGuiApplication and QQmlApplicationEngine: + + \badcode + import sys + from pathlib import Path + + from PySide6.QtGui import QGuiApplication + from PySide6.QtQml import QQmlApplicationEngine + \endcode + + \section1 Adding a Main Function + + The wizard also adds a main function, where it creates a QGuiApplication + instance and passes system arguments to the QGuiApplication object: + + \badcode + if __name__ == "__main__": + app = QGuiApplication(sys.argv) + ... + \endcode + + \section1 Loading the QML File + + The following lines in the main class create a QQmlApplicationEngine + instance and load the generated QML file to the engine object: + + \badcode + ... + engine = QQmlApplicationEngine() + qml_file = Path(__file__).resolve().parent / "main.qml" + engine.load(qml_file) + ... + \endcode + + Finally, the wizard adds code that checks whether the file was successfully + loaded. If loading the file fails, the application exits with an error code. + If loading succeeds, the wizard calls the \c app.exec() method to enter the + Qt main loop and start executing the Qt code: + + \badcode + ... + if not engine.rootObjects(): + sys.exit(-1) + sys.exit(app.exec()) + ... + \endcode + + \section1 Designing the UI + + Open the \c {main.qml} file in the \uicontrol Edit mode to design a + Qt Quick UI. + + \section2 Adding Imports + + Add imports for Qt Quick Controls and Layouts: + + \badcode + import QtQuick + import QtQuick.Window + import QtQuick.Controls + import QtQuick.Layouts + \endcode + + \section2 Adding Properties and Functions + + The wizard adds a main window: + + \badcode + Window { + width: 640 + height: 480 + visible: true + title: qsTr("Hello World") + } + \endcode + + Add a property and function to randomly select the language of the displayed + text: + + \badcode + ... + readonly property list<string> texts: ["Hallo Welt", "Hei maailma", + "Hola Mundo", "Привет мир"] + + function setText() { + var i = Math.round(Math.random() * 3) + text.text = texts[i] + } + \endcode + + \section2 Adding Qt Quick Controls + + Add \l {Text} and \l {Button} QML types within a \l {ColumnLayout} type to + design the UI: + + \badcode + ColumnLayout { + anchors.fill: parent + + Text { + id: text + text: "Hello World" + Layout.alignment: Qt.AlignHCenter + } + Button { + text: "Click me" + Layout.alignment: Qt.AlignHCenter + onClicked: setText() + } + } + \endcode + + You can also use \l{Qt Design Studio Manual}{\QDS} to design Qt Quick UIs. + + \section1 Running the Application + + Select the \inlineimage icons/run_small.png + button to run the application. + + \sa {Creating a Qt for Python Application with Qt Widgets}, + {Develop Qt for Python Applications} +*/ diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index f39905835fc..294a1b86650 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -117,7 +117,6 @@ \li \l{Editing Markdown Files} \li \l{Using Language Servers} \li \l{Using GitHub Copilot} - \li \l{Developing Qt for Python Applications} \li \l{Editing MIME Types} \li \l{Modeling} \li \l{Editing State Charts} @@ -278,6 +277,7 @@ \li Manage Projects \list \li \l {Add a license header template for C++ code} + \li \l {Develop Qt for Python applications} \endlist \li Use \QC \list diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc b/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc index 55458349642..4a3746f4c29 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc @@ -110,7 +110,7 @@ \QC creates a QML file, \e Main.qml, that you can modify in the \uicontrol Edit mode. - \include creator-python-project.qdocinc python qml project wizards + \sa {Creating a Qt for Python Application with Qt Quick} \section1 Qt Quick UI Projects From 22476fc26fb819961d732296061e18062977533b Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 1 Aug 2023 17:07:28 +0200 Subject: [PATCH 0883/1777] Doc: Divide "Creating Projects" into an explanation and how-to topics Task-number: QTCREATORBUG-29361 Change-Id: I623d824e423da950df9643c42d85b485daccfe4b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../src/editors/creator-locator.qdoc | 2 +- .../creator-only/creator-beautifier.qdoc | 2 +- doc/qtcreator/src/editors/creator-search.qdoc | 2 +- .../howto/creator-only/creator-how-tos.qdoc | 4 + .../creator-deployment-embedded-linux.qdoc | 2 +- .../creator-how-to-select-build-systems.qdoc | 60 +++++++ .../creator-projects-build-systems.qdocinc | 61 ------- .../creator-projects-creating.qdoc | 158 ++++++++++++------ .../creator-projects-overview.qdoc | 16 +- ...reator-projects-settings-dependencies.qdoc | 4 +- .../src/python/creator-python-run.qdocinc | 2 +- doc/qtcreator/src/qtcreator-toc.qdoc | 4 + .../user-interface/creator-projects-view.qdoc | 2 +- .../vcs/creator-only/creator-vcs-gitlab.qdoc | 2 +- 14 files changed, 186 insertions(+), 135 deletions(-) create mode 100644 doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc delete mode 100644 doc/qtcreator/src/projects/creator-only/creator-projects-build-systems.qdocinc diff --git a/doc/qtcreator/src/editors/creator-locator.qdoc b/doc/qtcreator/src/editors/creator-locator.qdoc index c7add7c980f..bcc12f9ba14 100644 --- a/doc/qtcreator/src/editors/creator-locator.qdoc +++ b/doc/qtcreator/src/editors/creator-locator.qdoc @@ -104,7 +104,7 @@ or use the handle next to the locator window to increase the window width. \if defined(qtcreator) - If the locator does not find some files, see \l{Specifying Project Contents} + If the locator does not find some files, see \l{Specify project contents} for how to make them known to the locator. \endif diff --git a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc index 8d310917373..d994a175e35 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc @@ -105,7 +105,7 @@ \li Select \uicontrol {Use file *.astylerc defined in project files} or \uicontrol {Use file uncrustify.cfg defined in project files}, - to use the configuration file \l{Specifying Project Contents} + to use the configuration file \l{Specify project contents} {defined in the project file} as the configuration file for the selected tool. diff --git a/doc/qtcreator/src/editors/creator-search.qdoc b/doc/qtcreator/src/editors/creator-search.qdoc index 502a87367aa..904452fbe39 100644 --- a/doc/qtcreator/src/editors/creator-search.qdoc +++ b/doc/qtcreator/src/editors/creator-search.qdoc @@ -122,7 +122,7 @@ \if defined(qtcreator) If you cannot find some files, see - \l{Specifying Project Contents} for how + \l{Specify project contents} for how to declare them as a part of the project. \endif diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 88fe789e98b..3d8d84882d9 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -61,7 +61,11 @@ \list \li \l {Add a license header template for C++ code} + \li \l {Add subprojects to projects} \li \l {Develop Qt for Python applications} + \li \l {Specify project contents} + \li \l {Select the build system} + \li \l {Use project wizards} \endlist \section1 Use \QC diff --git a/doc/qtcreator/src/linux-mobile/creator-deployment-embedded-linux.qdoc b/doc/qtcreator/src/linux-mobile/creator-deployment-embedded-linux.qdoc index 0944c02a953..38c6823fa30 100644 --- a/doc/qtcreator/src/linux-mobile/creator-deployment-embedded-linux.qdoc +++ b/doc/qtcreator/src/linux-mobile/creator-deployment-embedded-linux.qdoc @@ -35,7 +35,7 @@ \section1 Adding Missing Files The process to add files to deploy depends on the build system you use. - For more information, see \l{Specifying Project Contents}. + For more information, see \l{Specify project contents}. \section2 CMake Builds diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc new file mode 100644 index 00000000000..0dfe9178a86 --- /dev/null +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc @@ -0,0 +1,60 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \previouspage creator-project-creating.html + \page creator-how-to-select-build-system.html + \nextpage creator-file-creating.html + + \ingroup creator-how-to-projects + + \title Select the build system + + You can use several build systems to build your projects: + + \list + \li \l {Build with CMake}{CMake} is a cross-platform system for build + automation that helps simplify the build process for development + projects across different platforms. It automates the generation of + build configurations. For more information, see \l {Setting Up CMake}. + \li \l{qmake Manual}{qmake} is an alternative to CMake for automating the + generation of build configurations. Qt installers install and + configure qmake. To use one of the other supported build systems, + you need to set it up. + \li \l {https://mesonbuild.com/}{Meson} is a fast and user-friendly + open-source build system that aims to minimize the time developers spend + writing or debugging build definitions and waiting for the build system + to start compiling code. For more information, see \l {Setting Up Meson}. + \li \l{Qbs Manual}{Qbs} is an all-in-one build tool that generates a build graph + from a high-level project description (like qmake or CMake do) and executes + the commands in the low-level build graph (like make does). For more + information, see \l{Setting Up Qbs}. + \endlist + + Typically, you select the build system when you create a project. + + \section1 Migrate to another build system + + To export a project to some other build system, such as Microsoft Visual + Studio, select \uicontrol Build > \uicontrol {Run Generator}, and select + a generator in the list. \QC generates the build files, such as .vcxproj, + in the project's build directory. + + The tool that you use to build the project (qmake or CMake) provides the + generators. Their availability depends on the version of the build tool, + host platform, and properties of the host system. + Also, a JSON compilation database generator is available if the + \l{Parsing C++ Files with the Clang Code Model}{Clang Code Model plugin} + is enabled (default). + + \section1 Set preferences for building and running + + To change the location of the project directory, and to specify settings + for building and running projects, select \uicontrol Edit > + \uicontrol Preferences > \uicontrol {Build & Run} > \uicontrol General. + + Specify build and run settings for different target platforms, in the + \uicontrol Projects mode. + + \sa {Specifying Build Settings}, {Build Systems}, {Use project wizards} +*/ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-build-systems.qdocinc b/doc/qtcreator/src/projects/creator-only/creator-projects-build-systems.qdocinc deleted file mode 100644 index 05a340d0df2..00000000000 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-build-systems.qdocinc +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -// ********************************************************************** -// NOTE: the sections are not ordered by their logical order to avoid -// reshuffling the file each time the index order changes (i.e., often). -// Run the fixnavi.pl script to adjust the links to the index order. -// ********************************************************************** - -/*! -//! [build systems] - - \section1 Selecting the Build System - - You can use several build systems to build your projects: - - \list - - \li \l{qmake Manual}{qmake} is a cross-platform system for build automation - that helps simplify the build process for development projects across - different platforms. qmake automates the generation of build configurations - so that you need only a few lines of information to create each - configuration. Qt installers install and configure qmake. - To use one of the other supported build systems, you need to set it up. - - \li \l {Build with CMake}{CMake} is an alternative to qmake for automating the - generation of build configurations. For more information, see - \l {Setting Up CMake}. - - \li \l {https://mesonbuild.com/}{Meson} is a fast and user-friendly - open-source build system that aims to minimize the time developers spend - writing or debugging build definitions and waiting for the build system - to start compiling code. For more information, see \l {Setting Up Meson}. - - \li \l{Qbs Manual}{Qbs} is an all-in-one build tool that generates a build graph - from a high-level project description (like qmake or CMake do) and executes - the commands in the low-level build graph (like make does). For more - information, see \l{Setting Up Qbs}. - - \endlist - - To export a project to some other build system, such as Microsoft Visual - Studio, select \uicontrol Build > \uicontrol {Run Generator}, and select - a generator in the list. \QC generates the build files, such as .vcxproj, - in the project's build directory. The tool that you use to build the project - (qmake or CMake) provides the generators. Their availability depends on the - version of the build tool, host platform, and properties of the host system. - Also, a JSON compilation database generator is available if the - \l{Parsing C++ Files with the Clang Code Model}{Clang Code Model plugin} - is enabled (default). - - To change the location of the project directory, and to specify settings - for building and running projects, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Build & Run} > \uicontrol General. - - Specify build and run settings for different target platforms, in the - \uicontrol Projects mode. For more information on the options you have, - see \l{Specifying Build Settings}. - -//! [build systems] -*/ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index 638e4927283..c48a2ead78f 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -12,9 +12,11 @@ \page creator-project-creating.html \nextpage creator-file-creating.html + \ingroup creator-explanation-projects + \title Creating Projects - Creating a project enables you to: + Create projects to: \list @@ -28,32 +30,57 @@ \endlist + To set up a project, you first have to decide what kind of an application + you want to develop: do you want a user interface based on Qt Quick or + Qt widgets. Second, you have to choose the language to implement the + application logic: C++, JavaScript, or Python. + When you set up a new project in \QC, a wizard guides you step-by-step through the process. The wizard templates prompt you to enter the settings - that you need for that particular type of project and create - the necessary files for you. You can add your own custom wizards to - standardize the way of adding subprojects and classes to a project. + that you need for that particular type of project and create the necessary + files for you. - Most \QC project wizards enable you to choose the build system to use for + \image qtcreator-project-qt-quick.webp {New Project dialog} + + You can add your own custom wizards to standardize the way of adding + subprojects and classes to a project. In the \uicontrol {New Project} and + \uicontrol {New File} dialogs you can see an icon (1), a display name (2), + and a description (3) of the wizard. + + \image qtcreator-custom-wizard.png {Wizard details in the New Project dialog} + + In most project wizards, you can choose the build system to use for building the project: qmake, CMake, or Qbs. If you do not get to choose, the project uses qmake as the build system. + \image qtcreator-new-project-build-system-qt-gui.png {Define Build System dialog} + You can use wizards also to create plain C or C++ projects that use qmake, Qbs, or CMake, but do not use the Qt library. In addition, you can import projects as \e {generic projects} that do not - use qmake, Qbs, or CMake. This enables you to use \QC as a code editor and - to fully control the steps and commands used to build the project. + use qmake, Qbs, or CMake. Use \QC as a code editor and fully control the + steps and commands used to build the project. - You can install tools for \l{glossary-device}{devices} as part of Qt distributions. + To test applications on \l{glossary-device}{devices}, you can install + toolchains for mobile and embedded development as part of Qt distributions. The installers create \l{glossary-buildandrun-kit}{kits} and specify build and run settings for the installed device types. However, you might need to install and configure some additional software on the devices to be able to \l{Connecting Devices}{connect} to them from the development PC. - \include creator-projects-build-systems.qdocinc build systems + \sa {Manage Projects}{How-to: Manage Projects}, {Creating Files}, + {Adding Libraries to Projects}, {Opening Projects}, + {Adding New Custom Wizards} +*/ - \section1 Using Project Wizards +/*! + \page creator-how-to-use-project-wizards.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects + + \title Use project wizards To create a new project, select \uicontrol File > \uicontrol{New Project} and select the type of your project. The contents of the wizard dialogs depend @@ -75,7 +102,7 @@ For example, if you choose to create a Qt Quick application, \QC generates a QML file that you can modify in the \uicontrol Edit mode. - \section1 Selecting Project Type + \section1 Select project type The following table lists the types of wizard templates that you can use for creating projects. The \uicontrol {New Project} dialog shows detailed @@ -101,7 +128,7 @@ widgets or widget collections, \l{Qt Quick UI Projects}{Qt Quick UI projects}, \l {Creating Tests}{auto-test projects}, - \l{Adding Subprojects to Projects}{subprojects}, + \l{Add subprojects to projects}{subprojects}, empty qmake projects, or qmake projects for testing code snippets. \row @@ -133,7 +160,28 @@ For more information about creating Qt Quick projects, see \l {Creating Qt Quick Projects}. - \section1 Specifying Project Contents + \section1 Bind keyboard shortcuts to wizards + + If you use a wizard regularly, you can bind a custom keyboard shortcut to + it. Triggering this keyboard shortcut directly opens the wizard, so you do + not need to navigate to \uicontrol File > \uicontrol {New File} or + \uicontrol {New Project}. + + Set keyboard shortcuts for wizards in \uicontrol Edit > + \uicontrol Preferences > \uicontrol Environment > \uicontrol Keyboard > + \uicontrol Wizard. All wizard actions start with \uicontrol Impl there. + + \sa {Assign keyboard shortcuts}, {Activating Kits for a Project}, + {Creating Files}, {Creating Projects} +*/ + +/*! + \page creator-how-to-specify-project-contents.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects + + \title Specify project contents A project can have files that should be: @@ -146,8 +194,8 @@ to \QC \endlist - \QC displays all files that you declare to be part of the project by the - project files in the \l Projects view. It sorts the files into categories + The \l Projects view shows all files that you declare to be part of the + project in the project files. It sorts the files into categories by file type (.cpp, .h, .qrc, and so on). To display additional files, edit the project file. Alternatively, you can see all the files in a project directory in the \l {File System} view. @@ -156,7 +204,7 @@ \l{Searching with the Locator}{locator} and \l{Advanced Search} {project-wide search}. - \section2 CMake Projects + \section1 CMake Projects When using CMake, you can specify additional files for a project by either adding them as sources or installing them. @@ -177,7 +225,7 @@ Alternatively, to install the files, use the \l {CMake: install command} {install} command with the \c FILES or \c DIRECTORY property. - \section2 qmake Projects + \section1 qmake Projects Use the following variables in the .pro file: @@ -197,24 +245,33 @@ \endcode - \section1 Adding Subprojects to Projects + \sa {Creating Projects}, {Use project wizards}, {Projects} - In addition to Qt libraries, you can link your application to other - libraries, such as system libraries or your own libraries. Further, your - own libraries might link to other libraries. To be able to compile your - project, you must add the libraries to your project. This also enables - code completion and syntax highlighting for the libraries. - The procedure of adding a library to a project depends on the build +*/ + +/*! + \page creator-how-to-add-subprojects-to-projects.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects + + \title Add subprojects to projects + + You can link your application to Qt libraries and other libraries, such as + system libraries or your own libraries. Further, your own libraries might + link to other libraries. To compile your project and benefit from services + such as code completion and syntax highlighting, add the libraries to your + project. The process of adding a library to a project depends on the build system that you use. - \section2 CMake Projects + \section1 CMake projects - You can add CMakeLists.txt files to any project by using the + To add CMakeLists.txt files to any project, use the \l{https://cmake.org/cmake/help/latest/command/add_subdirectory.html} {add_subdirectory} command. The files can define complete projects that you include into the top-level project or any other CMake commands. - \section2 qmake Projects + \section1 qmake projects When you create a new project and select qmake as the build system, you can add it to another project as a subproject in the @@ -222,19 +279,26 @@ must specify that qmake uses the \c subdirs \l{TEMPLATE}{template} to build the project. - To create a root project, select \uicontrol File > - \uicontrol {New Project} > \uicontrol {Other Project} > - \uicontrol {Subdirs Project} > \uicontrol Choose. + To create a root project: - On the \uicontrol Summary page, select \uicontrol {Finish & Add Subproject} to create - the root project and to add another project, such as a C++ library. + \list 1 + \li Select \uicontrol File > \uicontrol {New Project} > + \uicontrol {Other Project} > \uicontrol {Subdirs Project} > + \uicontrol Choose. + + \li On the \uicontrol Summary page, select + \uicontrol {Finish & Add Subproject} to create + the root project and to add another project, such as a C++ library. + \endlist The wizard creates a project file (.pro) that defines a \c subdirs template and the subproject that you add as a value of the \l{Variables#subdirs} {SUBDIRS variable}. It also adds all the necessary files for the subproject. + \section2 Add subprojects to the root project + To create more subprojects, right-click the project name in the - \uicontrol Projects view to open the context menu, and select + \l Projects view to open the context menu, and select \uicontrol {New Subproject}. Follow the steps in the \uicontrol {New Subproject} wizard to create a subproject. @@ -244,31 +308,15 @@ \uicontrol {Add Existing Projects} in the context menu. In the file browser dialog, locate your subproject. + \section2 Remove subprojects + To remove subprojects, right-click the project name in the \uicontrol Projects view, and select \uicontrol {Remove Subproject} in the context menu. - To specify dependencies, use the \uicontrol{Add Library} wizard. For more - information, see \l{Adding Libraries to Projects}. + \section2 Specify dependencies - \section1 Binding Keyboard Shortcuts to Wizards - - If you use a wizard regularly, you can bind a custom keyboard shortcut to - it. Triggering this keyboard shortcut directly opens the wizard, so you do - not need to navigate to \uicontrol File > \uicontrol {New File} or - \uicontrol {New Project}. - - Set keyboard shortcuts for wizards in \uicontrol Edit > - \uicontrol Preferences > \uicontrol Environment > \uicontrol Keyboard > - \uicontrol Wizard. All wizard actions start with \uicontrol Impl there. - - \section1 Related Topics - - \list - \li \l{Creating Files} - \li \l{Opening Projects} - \li \l{Adding Libraries to Projects} - \li \l{Adding New Custom Wizards} - \li \l{Build Systems} - \endlist + To specify dependencies, use the \uicontrol{Add Library} wizard. + \sa {Creating Projects}, {Use project wizards}, + {Adding Libraries to Projects} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-overview.qdoc index 7be0b1ba4d9..fb09cb1da62 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-overview.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -16,9 +16,9 @@ \image front-projects.png - One of the major advantages of \QC is that it allows a team of designers and - developers to share a project across different development platforms with a - common tool for design, development, and debugging. + You can share projects with other designers and developers across different + development platforms with a common tool for design, development, and + debugging. \list @@ -40,7 +40,7 @@ Installation programs and project wizards create default configurations for \QC and your projects. You can modify - the settings in the Projects mode. + the settings in the \uicontrol Projects mode. \li \l{Managing Sessions} @@ -50,10 +50,6 @@ \endlist - \section1 Related Topics - - \list - \li \l{Build Systems} - \endlist + \sa {Build Systems} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc index bda2c5b5e71..61763c87579 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc @@ -45,7 +45,7 @@ specify for the projects loaded in the session. \note You cannot use this view to specify subprojects for projects. - For more information on how to add subprojects, see \l{Adding Subprojects - to Projects}. + + \sa {Add subprojects to projects} */ diff --git a/doc/qtcreator/src/python/creator-python-run.qdocinc b/doc/qtcreator/src/python/creator-python-run.qdocinc index 2356607a837..760587e08bb 100644 --- a/doc/qtcreator/src/python/creator-python-run.qdocinc +++ b/doc/qtcreator/src/python/creator-python-run.qdocinc @@ -6,7 +6,7 @@ \section1 Running Python Projects You can execute Qt for Python applications directly from \QC. If you - used the \l{Using Project Wizards}{new project wizard} + used the \l{Use project wizards}{new project wizard} to create the application project, the \c main.py file is automatically executed when you select the \uicontrol Run button. diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 294a1b86650..2fa2298a6b6 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -277,7 +277,11 @@ \li Manage Projects \list \li \l {Add a license header template for C++ code} + \li \l {Add subprojects to projects} \li \l {Develop Qt for Python applications} + \li \l {Select the build system} + \li \l {Specify project contents} + \li \l {Use project wizards} \endlist \li Use \QC \list diff --git a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc index 529abfed348..9d632a127e6 100644 --- a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc @@ -146,7 +146,7 @@ enables you to specify exactly where to place a new file in the build system. If you cannot see some files, you might have to declare them as part of the - project. For more information, see \l{Specifying Project Contents}. + project. For more information, see \l{Specify project contents}. If the project is under version control, you might see information from the version control system in brackets after the project name. diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc index c458d5d0079..8ac5052826f 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc @@ -92,7 +92,7 @@ open, select \uicontrol File > \uicontrol {New Project} > \uicontrol {Import Project} > \uicontrol {Import Existing Project} to import the project as a generic project. For more information, see - \l {Using Project Wizards}. + \l {Use project wizards}. \section1 Linking Projects with GitLab From fe185253267b2e53b05cdb0f1d463c38c78dd622 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 26 Jul 2023 09:07:15 +0200 Subject: [PATCH 0884/1777] Build/deploy: Move copying qtdiag to deploy.py Moving things away from deployqtHelper_mac.sh Change-Id: Ic71ad9a8ed522dc8c4eaa745ec519d9d705d1073 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- cmake/Utils.cmake | 1 + scripts/deploy.py | 52 +++++++++++++++++++++++------------ scripts/deployqtHelper_mac.sh | 8 ------ 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake index b08aaee4a84..b1be1ccf105 100644 --- a/cmake/Utils.cmake +++ b/cmake/Utils.cmake @@ -41,6 +41,7 @@ function(setup_dependencies_component) endif() execute_process(COMMAND \"${Python3_EXECUTABLE}\" + \"-u\" \"${CMAKE_CURRENT_LIST_DIR}/scripts/deploy.py\" ${_llvm_arg} ${_elfutils_arg} diff --git a/scripts/deploy.py b/scripts/deploy.py index 70a8399c8cc..8415bd2389a 100755 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -49,6 +49,9 @@ def get_args(): return args +def with_exe_ext(filepath): + return filepath + '.exe' if common.is_windows_platform() else filepath + def which(program): def is_exe(fpath): return os.path.exists(fpath) and os.access(fpath, os.X_OK) @@ -158,12 +161,21 @@ def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, print('{0} -> {1}'.format(qt_qml_dir, target)) common.copytree(qt_qml_dir, target, ignore=ignored_qt_lib_files, symlinks=True) + +def deploy_qtdiag(qtc_binary_path, qt_install): print("Copying qtdiag") - bin_dest = target_qt_prefix_path if common.is_windows_platform() else os.path.join(target_qt_prefix_path, 'bin') - qtdiag_src = os.path.join(qt_bin_dir, 'qtdiag.exe' if common.is_windows_platform() else 'qtdiag') - if not os.path.exists(bin_dest): - os.makedirs(bin_dest) - shutil.copy(qtdiag_src, bin_dest) + qtdiag_src = os.path.join(qt_install.bin, with_exe_ext('qtdiag')) + destdir = (qtc_binary_path if common.is_windows_platform() + else os.path.join(qtc_binary_path, 'Contents', 'MacOS') if common.is_mac_platform() + else os.path.join(qtc_binary_path, '..', 'lib', 'Qt', 'bin')) + if not os.path.exists(destdir): + os.makedirs(destdir) + shutil.copy(qtdiag_src, destdir) + if common.is_mac_platform(): + # fix RPATHs + qtdiag_dest = os.path.join(destdir, 'qtdiag') + subprocess.check_call(['xcrun', 'install_name_tool', '-add_rpath', '@loader_path/../Frameworks', qtdiag_dest]) + subprocess.check_call(['xcrun', 'install_name_tool', '-delete_rpath', '@loader_path/../lib', qtdiag_dest]) def add_qt_conf(target_path, qt_prefix_path): @@ -336,19 +348,6 @@ def get_qt_install_info(qmake_binary): def main(): args = get_args() - if common.is_mac_platform(): - deploy_mac(args) - return - - (qt_install_info, qt_install) = get_qt_install_info(args.qmake_binary) - - qtcreator_binary_path = os.path.dirname(args.qtcreator_binary) - install_dir = os.path.abspath(os.path.join(qtcreator_binary_path, '..')) - if common.is_linux_platform(): - qt_deploy_prefix = os.path.join(install_dir, 'lib', 'Qt') - else: - qt_deploy_prefix = os.path.join(install_dir, 'bin') - chrpath_bin = None if common.is_linux_platform(): chrpath_bin = which('chrpath') @@ -356,6 +355,23 @@ def main(): print("Cannot find required binary 'chrpath'.") sys.exit(2) + (qt_install_info, qt_install) = get_qt_install_info(args.qmake_binary) + # <qtc>/bin for Win/Lin, <path>/<appname>.app for macOS + qtcreator_binary_path = (args.qtcreator_binary if common.is_mac_platform() + else os.path.dirname(args.qtcreator_binary)) + + deploy_qtdiag(qtcreator_binary_path, qt_install) + + if common.is_mac_platform(): + deploy_mac(args) + return + + install_dir = os.path.abspath(os.path.join(qtcreator_binary_path, '..')) + if common.is_linux_platform(): + qt_deploy_prefix = os.path.join(install_dir, 'lib', 'Qt') + else: + qt_deploy_prefix = os.path.join(install_dir, 'bin') + plugins = ['assetimporters', 'accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes', 'platforminputcontexts', 'platforms', 'printsupport', 'qmltooling', 'sqldrivers', 'styles', 'xcbglintegrations', diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index 6ef3fcdb8d1..ece10ef24d2 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -16,14 +16,6 @@ quick2_src="$5" echo "Deploying Qt" -# copy qtdiag -echo "- Copying qtdiag" -cp "$bin_src/qtdiag" "$app_path/Contents/MacOS/" || exit 1 -# fix rpath if qtdiag was from binary Qt package -( xcrun install_name_tool -delete_rpath "@loader_path/../lib" "$app_path/Contents/MacOS/qtdiag" && - xcrun install_name_tool -add_rpath "@loader_path/../Frameworks" "$app_path/Contents/MacOS/qtdiag" ) || true - - # collect designer plugins designerDestDir="$app_path/Contents/PlugIns/designer" if [ ! -d "$designerDestDir" ]; then From fc29c72b652c55ad495d9f39c749f6ca56340ffe Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 26 Jul 2023 14:19:37 +0200 Subject: [PATCH 0885/1777] Build/deploy: Move copying plugins to deploy.py Moving things away from deployqtHelper_mac.sh Change-Id: I0470432a0ffa33437e3249d3fb3766d511073caf Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- scripts/deploy.py | 62 ++++++++++++++++++++--------------- scripts/deployqtHelper_mac.sh | 22 ------------- 2 files changed, 35 insertions(+), 49 deletions(-) diff --git a/scripts/deploy.py b/scripts/deploy.py index 8415bd2389a..9ba4afacd5d 100755 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -108,12 +108,15 @@ def is_ignored_windows_file(use_debug, basepath, filename): def ignored_qt_lib_files(path, filenames): # Qt ships some unneeded object files in the qml plugins # On Windows we also do not want to ship the wrong debug/release .dlls or .lib files etc - if not common.is_windows_platform(): + # And get rid of debug info directories (.dSYM) on macOS + if common.is_linux_platform(): return [fn for fn in filenames if fn.endswith('.cpp.o')] + if common.is_mac_platform(): + return [fn for fn in filenames if fn.endswith('.dylib.dSYM')] return [fn for fn in filenames if fn.endswith('.cpp.obj') or is_ignored_windows_file(debug_build, path, fn)] -def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, qt_qml_dir, plugins): +def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_qml_dir): print("copying Qt libraries...") if common.is_windows_platform(): @@ -143,16 +146,6 @@ def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, else: shutil.copy(library, lib_dest) - print("Copying plugins:", plugins) - for plugin in plugins: - target = os.path.join(target_qt_prefix_path, 'plugins', plugin) - if (os.path.exists(target)): - shutil.rmtree(target) - pluginPath = os.path.join(qt_plugin_dir, plugin) - if (os.path.exists(pluginPath)): - print('{0} -> {1}'.format(pluginPath, target)) - common.copytree(pluginPath, target, ignore=ignored_qt_lib_files, symlinks=True) - if (os.path.exists(qt_qml_dir)): print("Copying qt quick 2 imports") target = os.path.join(target_qt_prefix_path, 'qml') @@ -178,6 +171,29 @@ def deploy_qtdiag(qtc_binary_path, qt_install): subprocess.check_call(['xcrun', 'install_name_tool', '-delete_rpath', '@loader_path/../lib', qtdiag_dest]) +def deploy_plugins(qtc_binary_path, qt_install): + plugins = ['assetimporters', 'accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes', + 'platforminputcontexts', 'platforms', 'printsupport', 'qmltooling', 'sqldrivers', 'styles', + 'xcbglintegrations', + 'wayland-decoration-client', + 'wayland-graphics-integration-client', + 'wayland-shell-integration', + 'tls' + ] + print("Copying plugins:", plugins) + destdir = (os.path.join(qtc_binary_path, 'plugins') if common.is_windows_platform() + else os.path.join(qtc_binary_path, 'Contents', 'PlugIns') if common.is_mac_platform() + else os.path.join(qtc_binary_path, '..', 'lib', 'Qt', 'plugins')) + for plugin in plugins: + target = os.path.join(destdir, plugin) + if (os.path.exists(target)): + shutil.rmtree(target) + pluginPath = os.path.join(qt_install.plugins, plugin) + if (os.path.exists(pluginPath)): + print('{0} -> {1}'.format(pluginPath, target)) + common.copytree(pluginPath, target, ignore=ignored_qt_lib_files, symlinks=True) + + def add_qt_conf(target_path, qt_prefix_path): qtconf_filepath = os.path.join(target_path, 'qt.conf') prefix_path = os.path.relpath(qt_prefix_path, target_path).replace('\\', '/') @@ -355,12 +371,17 @@ def main(): print("Cannot find required binary 'chrpath'.") sys.exit(2) + if common.is_windows_platform(): + global debug_build + debug_build = is_debug(args.qtcreator_binary) + (qt_install_info, qt_install) = get_qt_install_info(args.qmake_binary) # <qtc>/bin for Win/Lin, <path>/<appname>.app for macOS qtcreator_binary_path = (args.qtcreator_binary if common.is_mac_platform() else os.path.dirname(args.qtcreator_binary)) deploy_qtdiag(qtcreator_binary_path, qt_install) + deploy_plugins(qtcreator_binary_path, qt_install) if common.is_mac_platform(): deploy_mac(args) @@ -372,23 +393,10 @@ def main(): else: qt_deploy_prefix = os.path.join(install_dir, 'bin') - plugins = ['assetimporters', 'accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes', - 'platforminputcontexts', 'platforms', 'printsupport', 'qmltooling', 'sqldrivers', 'styles', - 'xcbglintegrations', - 'wayland-decoration-client', - 'wayland-graphics-integration-client', - 'wayland-shell-integration', - 'tls' - ] - if common.is_windows_platform(): - global debug_build - debug_build = is_debug(args.qtcreator_binary) - - if common.is_windows_platform(): - copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.bin, qt_install.plugins, qt_install.qml, plugins) + copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.bin, qt_install.qml) else: - copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib, qt_install.plugins, qt_install.qml, plugins) + copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib, qt_install.qml) copy_translations(install_dir, qt_install.translations) if args.llvm_path: deploy_clang(install_dir, args.llvm_path, chrpath_bin) diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index ece10ef24d2..317ae5abd27 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -11,32 +11,10 @@ resource_path="$app_path/Contents/Resources" libexec_path="$app_path/Contents/Resources/libexec" bin_src="$2" translation_src="$3" -plugin_src="$4" quick2_src="$5" echo "Deploying Qt" -# collect designer plugins -designerDestDir="$app_path/Contents/PlugIns/designer" -if [ ! -d "$designerDestDir" ]; then - echo "- Copying designer plugins" - mkdir -p "$designerDestDir" - for plugin in "$plugin_src"/designer/*.dylib; do - cp "$plugin" "$designerDestDir"/ || exit 1 - done -fi - -# collect 3d assetimporter plugins -assetimporterDestDir="$app_path/Contents/PlugIns/assetimporters" -assetimporterSrcDir="$plugin_src/assetimporters" -if [ -d "$assetimporterSrcDir" ]; then - if [ ! -d "$assetimporterDestDir" ]; then - echo "- Copying 3d assetimporter plugins" - mkdir -p "$assetimporterDestDir" - find "$assetimporterSrcDir" -iname "*.dylib" -maxdepth 1 -exec cp {} "$assetimporterDestDir"/ \; - fi -fi - # copy Qt Quick 2 imports imports2Dir="$app_path/Contents/Imports/qtquick2" if [ -d "$quick2_src" ]; then From fbc95f77bdbe7727c0b5f9bb7eb9405483392d6c Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 26 Jul 2023 14:38:08 +0200 Subject: [PATCH 0886/1777] Build/deploy: Move copying imports to deploy.py Moving things away from deployqtHelper_mac.sh Change-Id: Ib12b3105cb632833b713b04596c8bffd80f15131 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> --- scripts/deploy.py | 26 +++++++++++++++----------- scripts/deployqtHelper_mac.sh | 12 ------------ 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/scripts/deploy.py b/scripts/deploy.py index 9ba4afacd5d..847dc853104 100755 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -116,7 +116,7 @@ def ignored_qt_lib_files(path, filenames): return [fn for fn in filenames if fn.endswith('.cpp.obj') or is_ignored_windows_file(debug_build, path, fn)] -def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_qml_dir): +def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir): print("copying Qt libraries...") if common.is_windows_platform(): @@ -146,14 +146,6 @@ def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_qml_dir): else: shutil.copy(library, lib_dest) - if (os.path.exists(qt_qml_dir)): - print("Copying qt quick 2 imports") - target = os.path.join(target_qt_prefix_path, 'qml') - if (os.path.exists(target)): - shutil.rmtree(target) - print('{0} -> {1}'.format(qt_qml_dir, target)) - common.copytree(qt_qml_dir, target, ignore=ignored_qt_lib_files, symlinks=True) - def deploy_qtdiag(qtc_binary_path, qt_install): print("Copying qtdiag") @@ -194,6 +186,17 @@ def deploy_plugins(qtc_binary_path, qt_install): common.copytree(pluginPath, target, ignore=ignored_qt_lib_files, symlinks=True) +def deploy_imports(qtc_binary_path, qt_install): + print("Copying qt quick 2 imports") + destdir = (os.path.join(qtc_binary_path, 'qml') if common.is_windows_platform() + else os.path.join(qtc_binary_path, 'Contents', 'Imports', 'qtquick2') if common.is_mac_platform() + else os.path.join(qtc_binary_path, '..', 'lib', 'Qt', 'qml')) + if (os.path.exists(destdir)): + shutil.rmtree(destdir) + print('{0} -> {1}'.format(qt_install.qml, destdir)) + common.copytree(qt_install.qml, destdir, ignore=ignored_qt_lib_files, symlinks=True) + + def add_qt_conf(target_path, qt_prefix_path): qtconf_filepath = os.path.join(target_path, 'qt.conf') prefix_path = os.path.relpath(qt_prefix_path, target_path).replace('\\', '/') @@ -382,6 +385,7 @@ def main(): deploy_qtdiag(qtcreator_binary_path, qt_install) deploy_plugins(qtcreator_binary_path, qt_install) + deploy_imports(qtcreator_binary_path, qt_install) if common.is_mac_platform(): deploy_mac(args) @@ -394,9 +398,9 @@ def main(): qt_deploy_prefix = os.path.join(install_dir, 'bin') if common.is_windows_platform(): - copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.bin, qt_install.qml) + copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.bin) else: - copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib, qt_install.qml) + copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib) copy_translations(install_dir, qt_install.translations) if args.llvm_path: deploy_clang(install_dir, args.llvm_path, chrpath_bin) diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index 317ae5abd27..52e683d990d 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -11,21 +11,9 @@ resource_path="$app_path/Contents/Resources" libexec_path="$app_path/Contents/Resources/libexec" bin_src="$2" translation_src="$3" -quick2_src="$5" echo "Deploying Qt" -# copy Qt Quick 2 imports -imports2Dir="$app_path/Contents/Imports/qtquick2" -if [ -d "$quick2_src" ]; then - if [ ! -d "$imports2Dir" ]; then - echo "- Copying Qt Quick 2 imports" - mkdir -p "$imports2Dir" - cp -R "$quick2_src"/ "$imports2Dir"/ - find "$imports2Dir" -path "*.dylib.dSYM*" -delete - fi -fi - # copy qt creator qt.conf if [ ! -f "$resource_path/qt.conf" ]; then echo "- Copying qt.conf" From db4d424b43378717f517929cab02e4b598971ac9 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 26 Jul 2023 14:56:08 +0200 Subject: [PATCH 0887/1777] Build/deploy: Move copying translations to deploy.py Moving things away from deployqtHelper_mac.sh Change-Id: I0c37d111cdfb88c1ef2452d03ca2bcc542600521 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> --- scripts/deploy.py | 17 +++++++++-------- scripts/deployqtHelper_mac.sh | 8 -------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/scripts/deploy.py b/scripts/deploy.py index 847dc853104..17460930bf8 100755 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -210,14 +210,14 @@ def add_qt_conf(target_path, qt_prefix_path): f.write('Qml2Imports=qml\n') f.close() -def copy_translations(install_dir, qt_tr_dir): - translations = glob(os.path.join(qt_tr_dir, '*.qm')) - tr_dir = os.path.join(install_dir, 'share', 'qtcreator', 'translations') - - print("copying translations...") +def deploy_translations(qtc_binary_path, qt_install): + print("Copying translations...") + translations = glob(os.path.join(qt_install.translations, '*.qm')) + destdir = (os.path.join(qtc_binary_path, 'Contents', 'Resources', 'translations') if common.is_mac_platform() + else os.path.join(qtc_binary_path, '..', 'share', 'qtcreator', 'translations')) for translation in translations: - print(translation, '->', tr_dir) - shutil.copy(translation, tr_dir) + print(translation, '->', destdir) + shutil.copy(translation, destdir) def copyPreservingLinks(source, destination): if os.path.islink(source): @@ -386,6 +386,7 @@ def main(): deploy_qtdiag(qtcreator_binary_path, qt_install) deploy_plugins(qtcreator_binary_path, qt_install) deploy_imports(qtcreator_binary_path, qt_install) + deploy_translations(qtcreator_binary_path, qt_install) if common.is_mac_platform(): deploy_mac(args) @@ -401,7 +402,7 @@ def main(): copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.bin) else: copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib) - copy_translations(install_dir, qt_install.translations) + if args.llvm_path: deploy_clang(install_dir, args.llvm_path, chrpath_bin) diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index 52e683d990d..b58d213138e 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -10,7 +10,6 @@ app_path="$1" resource_path="$app_path/Contents/Resources" libexec_path="$app_path/Contents/Resources/libexec" bin_src="$2" -translation_src="$3" echo "Deploying Qt" @@ -32,13 +31,6 @@ if [ ! -f "$libexec_path/ios/qt.conf" ]; then cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$libexec_path/ios/qt.conf" || exit 1 fi -# copy Qt translations -# check for known existing translation to avoid copying multiple times -if [ ! -f "$resource_path/translations/qt_de.qm" ]; then - echo "- Copying Qt translations" - cp "$translation_src"/*.qm "$resource_path/translations/" || exit 1 -fi - # copy clang if needed if [ $LLVM_INSTALL_DIR ]; then if [ "$LLVM_INSTALL_DIR"/bin/clangd -nt "$libexec_path"/clang/bin/clangd ]; then From 1555ab3094a4a4f778e6fcd95511f5bf325fa6f3 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 26 Jul 2023 16:06:41 +0200 Subject: [PATCH 0888/1777] Build/deploy: Move qt.conf creation to deploy.py Moving things away from deployqtHelper_mac.sh Change-Id: I41810ac060bde63f3b11af852bb2e2f37d822bf4 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> --- dist/installer/mac/ios_qt.conf | 2 -- dist/installer/mac/libexec_qt.conf | 5 --- dist/installer/mac/qt.conf | 4 --- scripts/deploy.py | 56 +++++++++++++++++++++++++----- scripts/deployqtHelper_mac.sh | 18 ---------- 5 files changed, 47 insertions(+), 38 deletions(-) delete mode 100644 dist/installer/mac/ios_qt.conf delete mode 100644 dist/installer/mac/libexec_qt.conf delete mode 100644 dist/installer/mac/qt.conf diff --git a/dist/installer/mac/ios_qt.conf b/dist/installer/mac/ios_qt.conf deleted file mode 100644 index 249df1d74cc..00000000000 --- a/dist/installer/mac/ios_qt.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Paths] -Plugins = ../../../PlugIns diff --git a/dist/installer/mac/libexec_qt.conf b/dist/installer/mac/libexec_qt.conf deleted file mode 100644 index 7004d4bec38..00000000000 --- a/dist/installer/mac/libexec_qt.conf +++ /dev/null @@ -1,5 +0,0 @@ -[Paths] -Prefix = ../.. -Imports = Imports/qtquick1 -Qml2Imports = Imports/qtquick2 -Plugins = PlugIns diff --git a/dist/installer/mac/qt.conf b/dist/installer/mac/qt.conf deleted file mode 100644 index 6111f0628ef..00000000000 --- a/dist/installer/mac/qt.conf +++ /dev/null @@ -1,4 +0,0 @@ -[Paths] -Binaries = MacOS -Qml2Imports = Imports/qtquick2 -Plugins = PlugIns diff --git a/scripts/deploy.py b/scripts/deploy.py index 17460930bf8..92f068ddfb0 100755 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -197,19 +197,59 @@ def deploy_imports(qtc_binary_path, qt_install): common.copytree(qt_install.qml, destdir, ignore=ignored_qt_lib_files, symlinks=True) +def qt_conf_contents(): + if common.is_linux_platform(): + return '''[Paths] +Prefix={0} +Binaries=bin +Libraries=lib +Plugins=plugins +Qml2Imports=qml +''' + if common.is_windows_platform(): + return '''[Paths] +Prefix={0} +Binaries=. +Libraries=. +Plugins=plugins +Qml2Imports=qml +''' + return '''[Paths] +Prefix={0} +Binaries=MacOS +Libraries=Frameworks +Plugins=PlugIns +Qml2Imports=Imports/qtquick2 +''' + + def add_qt_conf(target_path, qt_prefix_path): qtconf_filepath = os.path.join(target_path, 'qt.conf') prefix_path = os.path.relpath(qt_prefix_path, target_path).replace('\\', '/') print('Creating qt.conf in "{0}":'.format(qtconf_filepath)) f = open(qtconf_filepath, 'w') - f.write('[Paths]\n') - f.write('Prefix={0}\n'.format(prefix_path)) - f.write('Binaries={0}\n'.format('bin' if common.is_linux_platform() else '.')) - f.write('Libraries={0}\n'.format('lib' if common.is_linux_platform() else '.')) - f.write('Plugins=plugins\n') - f.write('Qml2Imports=qml\n') + f.write(qt_conf_contents().format(prefix_path)) f.close() + +def deploy_qt_conf_files(qtc_binary_path): + if common.is_linux_platform(): + qt_prefix_path = os.path.join(qtc_binary_path, '..', 'lib', 'Qt') + add_qt_conf(os.path.join(qtc_binary_path, '..', 'libexec', 'qtcreator'), qt_prefix_path) + add_qt_conf(os.path.join(qtc_binary_path, '..', 'lib', 'Qt', 'bin'), qt_prefix_path) # qtdiag + add_qt_conf(qtc_binary_path, qt_prefix_path) # QtC itself + if common.is_windows_platform(): + add_qt_conf(qtc_binary_path, qtc_binary_path) # QtC itself, libexec, and qtdiag etc + if common.is_mac_platform(): + qt_prefix_path = os.path.join(qtc_binary_path, 'Contents') + qtc_resources_path = os.path.join(qtc_binary_path, 'Contents', 'Resources') + add_qt_conf(os.path.join(qtc_resources_path, 'libexec'), qt_prefix_path) + add_qt_conf(os.path.join(qtc_resources_path, 'libexec', 'ios'), qt_prefix_path) + # The Prefix path for a qt.conf in Contents/Resources/ is handled specially/funny by Qt, + # relative paths are resolved relative to Contents/, so we must enforces Prefix=. + add_qt_conf(qtc_resources_path, qtc_resources_path) # QtC itself + + def deploy_translations(qtc_binary_path, qt_install): print("Copying translations...") translations = glob(os.path.join(qt_install.translations, '*.qm')) @@ -387,6 +427,7 @@ def main(): deploy_plugins(qtcreator_binary_path, qt_install) deploy_imports(qtcreator_binary_path, qt_install) deploy_translations(qtcreator_binary_path, qt_install) + deploy_qt_conf_files(qtcreator_binary_path) if common.is_mac_platform(): deploy_mac(args) @@ -411,9 +452,6 @@ def main(): if not common.is_windows_platform(): print("fixing rpaths...") common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin) - add_qt_conf(os.path.join(install_dir, 'libexec', 'qtcreator'), qt_deploy_prefix) # e.g. for qml2puppet - add_qt_conf(os.path.join(qt_deploy_prefix, 'bin'), qt_deploy_prefix) # e.g. qtdiag - add_qt_conf(os.path.join(install_dir, 'bin'), qt_deploy_prefix) if __name__ == "__main__": main() diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index b58d213138e..c712b920509 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -13,24 +13,6 @@ bin_src="$2" echo "Deploying Qt" -# copy qt creator qt.conf -if [ ! -f "$resource_path/qt.conf" ]; then - echo "- Copying qt.conf" - cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qt.conf" "$resource_path/qt.conf" || exit 1 -fi - -# copy libexec tools' qt.conf -if [ ! -f "$libexec_path/qt.conf" ]; then - echo "- Copying libexec/qt.conf" - cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/libexec_qt.conf" "$libexec_path/qt.conf" || exit 1 -fi - -# copy ios tools' qt.conf -if [ ! -f "$libexec_path/ios/qt.conf" ]; then - echo "- Copying libexec/ios/qt.conf" - cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$libexec_path/ios/qt.conf" || exit 1 -fi - # copy clang if needed if [ $LLVM_INSTALL_DIR ]; then if [ "$LLVM_INSTALL_DIR"/bin/clangd -nt "$libexec_path"/clang/bin/clangd ]; then From 1db2fea90bc2f22b204263020ca0b570d27619f4 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 27 Jul 2023 09:59:40 +0200 Subject: [PATCH 0889/1777] Build/deploy: Move llvm deployment to deploy.py Moving things away from deployqtHelper_mac.sh Change-Id: Ifadbf763fdbf12b5e22fc037986eb1b018b96aef Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> --- scripts/deploy.py | 79 +++++++++++++++++++---------------- scripts/deployqtHelper_mac.sh | 24 ----------- 2 files changed, 44 insertions(+), 59 deletions(-) diff --git a/scripts/deploy.py b/scripts/deploy.py index 92f068ddfb0..a0b40990a2b 100755 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -269,47 +269,52 @@ def copyPreservingLinks(source, destination): else: shutil.copy(source, destination) -def deploy_clang(install_dir, llvm_install_dir, chrpath_bin): +def deploy_clang(qtc_binary_path, llvm_install_dir, chrpath_bin): + print("Copying clang...") + # contains pairs of (source, target directory) deployinfo = [] resourcesource = os.path.join(llvm_install_dir, 'lib', 'clang') if common.is_windows_platform(): - clangbindirtarget = os.path.join(install_dir, 'bin', 'clang', 'bin') - if not os.path.exists(clangbindirtarget): - os.makedirs(clangbindirtarget) - clanglibdirtarget = os.path.join(install_dir, 'bin', 'clang', 'lib') - if not os.path.exists(clanglibdirtarget): - os.makedirs(clanglibdirtarget) - for binary in ['clangd', 'clang-tidy', 'clazy-standalone', 'clang-format']: - binary_filepath = os.path.join(llvm_install_dir, 'bin', binary + '.exe') - if os.path.exists(binary_filepath): - deployinfo.append((binary_filepath, clangbindirtarget)) - resourcetarget = os.path.join(clanglibdirtarget, 'clang') - else: - # clang binaries -> clang libexec - clangbinary_targetdir = os.path.join(install_dir, 'libexec', 'qtcreator', 'clang', 'bin') - if not os.path.exists(clangbinary_targetdir): - os.makedirs(clangbinary_targetdir) - for binary in ['clangd', 'clang-tidy', 'clazy-standalone', 'clang-format']: - binary_filepath = os.path.join(llvm_install_dir, 'bin', binary) - if os.path.exists(binary_filepath): - deployinfo.append((binary_filepath, clangbinary_targetdir)) - # add link target if binary is actually a symlink (to a binary in the same directory) - if os.path.islink(binary_filepath): - linktarget = os.readlink(binary_filepath) - deployinfo.append((os.path.join(os.path.dirname(binary_filepath), linktarget), - os.path.join(clangbinary_targetdir, linktarget))) - clanglibs_targetdir = os.path.join(install_dir, 'libexec', 'qtcreator', 'clang', 'lib') - # support libraries (for clazy) -> clang libexec + clang_targetdir = os.path.join(qtc_binary_path, 'clang') + clangbinary_targetdir = os.path.join(clang_targetdir, 'bin') + resourcetarget = os.path.join(clang_targetdir, 'lib', 'clang') + elif common.is_linux_platform(): + clang_targetdir = os.path.join(qtc_binary_path, '..', 'libexec', 'qtcreator', 'clang') + clangbinary_targetdir = os.path.join(clang_targetdir, 'bin') + resourcetarget = os.path.join(clang_targetdir, 'lib', 'clang') + # ClazyPlugin. On RHEL ClazyPlugin is in lib64, so check both + clanglibs_targetdir = os.path.join(clang_targetdir, 'lib') if not os.path.exists(clanglibs_targetdir): os.makedirs(clanglibs_targetdir) - # on RHEL ClazyPlugin is in lib64 for lib_pattern in ['lib64/ClazyPlugin.so', 'lib/ClazyPlugin.so']: for lib in glob(os.path.join(llvm_install_dir, lib_pattern)): deployinfo.append((lib, clanglibs_targetdir)) - resourcetarget = os.path.join(install_dir, 'libexec', 'qtcreator', 'clang', 'lib', 'clang') + else: + clang_targetdir = os.path.join(qtc_binary_path, 'Contents', 'Resources', 'libexec', 'clang') + clanglibs_targetdir = os.path.join(clang_targetdir, 'lib') + clangbinary_targetdir = os.path.join(clang_targetdir, 'bin') + resourcetarget = os.path.join(clang_targetdir, 'lib', 'clang') + # ClazyPlugin + clanglibs_targetdir = os.path.join(clang_targetdir, 'lib') + if not os.path.exists(clanglibs_targetdir): + os.makedirs(clanglibs_targetdir) + clazy_plugin = os.path.join(llvm_install_dir, 'lib', 'ClazyPlugin.dylib') + deployinfo.append((clazy_plugin, clanglibs_targetdir)) + + # collect binaries + if not os.path.exists(clangbinary_targetdir): + os.makedirs(clangbinary_targetdir) + for binary in ['clangd', 'clang-tidy', 'clazy-standalone', 'clang-format']: + binary_filepath = os.path.join(llvm_install_dir, 'bin', with_exe_ext(binary)) + if os.path.exists(binary_filepath): + deployinfo.append((binary_filepath, clangbinary_targetdir)) + # add link target if binary is actually a symlink (to a binary in the same directory) + if not common.is_windows_platform() and os.path.islink(binary_filepath): + linktarget = os.readlink(binary_filepath) + deployinfo.append((os.path.join(os.path.dirname(binary_filepath), linktarget), + os.path.join(clangbinary_targetdir, linktarget))) - print("copying clang...") for source, target in deployinfo: print(source, '->', target) copyPreservingLinks(source, target) @@ -318,7 +323,6 @@ def deploy_clang(install_dir, llvm_install_dir, chrpath_bin): # libclang was statically compiled, so there is no need for the RPATHs # and they are confusing when fixing RPATHs later in the process. # Also fix clazy-standalone RPATH. - print("fixing Clang RPATHs...") for source, target in deployinfo: filename = os.path.basename(source) targetfilepath = target if not os.path.isdir(target) else os.path.join(target, filename) @@ -328,6 +332,12 @@ def deploy_clang(install_dir, llvm_install_dir, chrpath_bin): targetfilepath = target if not os.path.isdir(target) else os.path.join(target, os.path.basename(source)) subprocess.check_call([chrpath_bin, '-d', targetfilepath]) + if common.is_mac_platform(): + # fix RPATH of clazy-standalone + clazy_dest = os.path.join(clangbinary_targetdir, 'clazy-standalone') + subprocess.call(['xcrun', 'install_name_tool', '-add_rpath', '@loader_path/../lib', clazy_dest], stderr=subprocess.DEVNULL) + subprocess.call(['xcrun', 'install_name_tool', '-delete_rpath', '/Users/qt/work/build/libclang/lib', clazy_dest], stderr=subprocess.DEVNULL) + print(resourcesource, '->', resourcetarget) if (os.path.exists(resourcetarget)): shutil.rmtree(resourcetarget) @@ -428,6 +438,8 @@ def main(): deploy_imports(qtcreator_binary_path, qt_install) deploy_translations(qtcreator_binary_path, qt_install) deploy_qt_conf_files(qtcreator_binary_path) + if args.llvm_path: + deploy_clang(qtcreator_binary_path, args.llvm_path, chrpath_bin) if common.is_mac_platform(): deploy_mac(args) @@ -444,9 +456,6 @@ def main(): else: copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib) - if args.llvm_path: - deploy_clang(install_dir, args.llvm_path, chrpath_bin) - if args.elfutils_path: deploy_elfutils(install_dir, chrpath_bin, args) if not common.is_windows_platform(): diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index c712b920509..e0af5cac199 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -7,35 +7,11 @@ [ $(uname -s) != "Darwin" ] && echo "Run this script on Mac OS X" && exit 2; app_path="$1" -resource_path="$app_path/Contents/Resources" libexec_path="$app_path/Contents/Resources/libexec" bin_src="$2" echo "Deploying Qt" -# copy clang if needed -if [ $LLVM_INSTALL_DIR ]; then - if [ "$LLVM_INSTALL_DIR"/bin/clangd -nt "$libexec_path"/clang/bin/clangd ]; then - echo "- Copying clang" - mkdir -p "$app_path/Contents/Frameworks" || exit 1 - # use recursive copy to make it copy symlinks as symlinks - mkdir -p "$libexec_path/clang/bin" - mkdir -p "$libexec_path/clang/lib" - cp -Rf "$LLVM_INSTALL_DIR"/lib/clang "$libexec_path/clang/lib/" || exit 1 - cp -Rf "$LLVM_INSTALL_DIR"/lib/ClazyPlugin.dylib "$libexec_path/clang/lib/" || exit 1 - clangdsource="$LLVM_INSTALL_DIR"/bin/clangd - cp -Rf "$clangdsource" "$libexec_path/clang/bin/" || exit 1 - clangtidysource="$LLVM_INSTALL_DIR"/bin/clang-tidy - cp -Rf "$clangtidysource" "$libexec_path/clang/bin/" || exit 1 - clangformatsource="$LLVM_INSTALL_DIR"/bin/clang-format - cp -Rf "$clangformatsource" "$libexec_path/clang/bin/" || exit 1 - clazysource="$LLVM_INSTALL_DIR"/bin/clazy-standalone - cp -Rf "$clazysource" "$libexec_path/clang/bin/" || exit 1 - install_name_tool -add_rpath "@executable_path/../lib" "$libexec_path/clang/bin/clazy-standalone" 2> /dev/null - install_name_tool -delete_rpath "/Users/qt/work/build/libclang/lib" "$libexec_path/clang/bin/clazy-standalone" 2> /dev/null - fi -fi - #### macdeployqt if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then From 1766002a976d764a5b9ee1f59d83d840afbba700 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 27 Jul 2023 11:17:05 +0200 Subject: [PATCH 0890/1777] Build/deploy: Move call to macdeployqt to deploy.py And get rid of deployqtHelper_mac.sh Change-Id: Iab8ba3e36f43c94b21f86a842eb1781a5ca462f2 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- scripts/deploy.py | 90 ++++++++++++++++++++++++----------- scripts/deployqtHelper_mac.sh | 71 --------------------------- 2 files changed, 63 insertions(+), 98 deletions(-) delete mode 100755 scripts/deployqtHelper_mac.sh diff --git a/scripts/deploy.py b/scripts/deploy.py index a0b40990a2b..5dd6198eca6 100755 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -112,7 +112,7 @@ def ignored_qt_lib_files(path, filenames): if common.is_linux_platform(): return [fn for fn in filenames if fn.endswith('.cpp.o')] if common.is_mac_platform(): - return [fn for fn in filenames if fn.endswith('.dylib.dSYM')] + return [fn for fn in filenames if fn.endswith('.dylib.dSYM') or fn.startswith('objects-')] return [fn for fn in filenames if fn.endswith('.cpp.obj') or is_ignored_windows_file(debug_build, path, fn)] @@ -391,18 +391,54 @@ def deploy_elfutils(qtc_install_dir, chrpath_bin, args): print(file, '->', backends_install_path) shutil.copy(file, backends_install_path) -def deploy_mac(args): - (_, qt_install) = get_qt_install_info(args.qmake_binary) +def deploy_qt_mac(qtc_binary_path, qt_install): + # This runs macdeployqt + # Collect things to pass via -executable + libexec_path = os.path.join(qtc_binary_path, 'Contents', 'Resources', 'libexec') + bin_path = os.path.join(qtc_binary_path, 'Contents', 'MacOS') + plugins_path = os.path.join(qtc_binary_path, 'Contents', 'PlugIns') + frameworks_path = os.path.join(qtc_binary_path, 'Contents', 'Frameworks') + additional_paths = [] + # Qbs + apps = ['qbs', 'qbs-config', 'qbs-config-ui', 'qbs-setup-android', 'qbs-setup-qt', + 'qbs-setup-toolchains', 'qbs-create-project'] + for app in apps: + additional_paths.append(os.path.join(bin_path, app)) + additional_paths.append(os.path.join(libexec_path, 'qbs_processlauncher')) + # qml2puppet + puppets = glob(os.path.join(libexec_path, 'qml2puppet*')) + for puppet in puppets: + additional_paths.append(puppet) + # qtdiag + additional_paths.append(os.path.join(bin_path, 'qtdiag')) + # other libexec + additional_paths.append(os.path.join(libexec_path, 'sdktool')) + additional_paths.append(os.path.join(libexec_path, 'qtpromaker')) + additional_paths.append(os.path.join(libexec_path, 'buildoutputparser')) + additional_paths.append(os.path.join(libexec_path, 'cpaster')) + additional_paths.append(os.path.join(libexec_path, 'ios', 'iostool')) - env = dict(os.environ) - if args.llvm_path: - env['LLVM_INSTALL_DIR'] = args.llvm_path + existing_additional_paths = [p for p in additional_paths if os.path.exists(p)] + macdeployqt = os.path.join(qt_install.bin, 'macdeployqt') + print('Running macdeployqt (' + macdeployqt + ')') + print('- with additional paths:', existing_additional_paths) + executable_args = ['-executable='+path for path in existing_additional_paths] + subprocess.check_call([macdeployqt, qtc_binary_path] + executable_args) + + # clean up some things that might have been deployed, but we don't want + to_remove = [ + os.path.join(plugins_path, 'tls', 'libqopensslbackend.dylib'), + os.path.join(plugins_path, 'sqldrivers', 'libqsqlpsql.dylib'), + os.path.join(plugins_path, 'sqldrivers', 'libqsqlodbc.dylib'), + ] + to_remove.extend(glob(os.path.join(frameworks_path, 'libpq.*dylib'))) + to_remove.extend(glob(os.path.join(frameworks_path, 'libssl.*dylib'))) + to_remove.extend(glob(os.path.join(frameworks_path, 'libcrypto.*dylib'))) + for path in to_remove: + if os.path.isfile(path): + print('- Removing ' + path) + os.remove(path) - script_path = os.path.dirname(os.path.realpath(__file__)) - deployqtHelper_mac = os.path.join(script_path, 'deployqtHelper_mac.sh') - common.check_print_call([deployqtHelper_mac, args.qtcreator_binary, qt_install.bin, - qt_install.translations, qt_install.plugins, qt_install.qml], - env=env) def get_qt_install_info(qmake_binary): qt_install_info = common.get_qt_install_info(qmake_binary) @@ -442,25 +478,25 @@ def main(): deploy_clang(qtcreator_binary_path, args.llvm_path, chrpath_bin) if common.is_mac_platform(): - deploy_mac(args) - return - - install_dir = os.path.abspath(os.path.join(qtcreator_binary_path, '..')) - if common.is_linux_platform(): - qt_deploy_prefix = os.path.join(install_dir, 'lib', 'Qt') + deploy_qt_mac(qtcreator_binary_path, qt_install) else: - qt_deploy_prefix = os.path.join(install_dir, 'bin') + install_dir = os.path.abspath(os.path.join(qtcreator_binary_path, '..')) + if common.is_linux_platform(): + qt_deploy_prefix = os.path.join(install_dir, 'lib', 'Qt') + else: + qt_deploy_prefix = os.path.join(install_dir, 'bin') - if common.is_windows_platform(): - copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.bin) - else: - copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib) + if common.is_windows_platform(): + copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.bin) + else: + copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib) + + if args.elfutils_path: + deploy_elfutils(install_dir, chrpath_bin, args) + if not common.is_windows_platform(): + print("fixing rpaths...") + common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin) - if args.elfutils_path: - deploy_elfutils(install_dir, chrpath_bin, args) - if not common.is_windows_platform(): - print("fixing rpaths...") - common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin) if __name__ == "__main__": main() diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh deleted file mode 100755 index e0af5cac199..00000000000 --- a/scripts/deployqtHelper_mac.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2016 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -[ $# -lt 5 ] && echo "Usage: $(basename $0) <app folder> <qt bin folder> <qt translations folder> <qt plugin folder> <qt quick 2 imports folder>" && exit 2 -[ $(uname -s) != "Darwin" ] && echo "Run this script on Mac OS X" && exit 2; - -app_path="$1" -libexec_path="$app_path/Contents/Resources/libexec" -bin_src="$2" - -echo "Deploying Qt" - -#### macdeployqt - -if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then - - echo "- Running macdeployqt ($bin_src/macdeployqt)" - - qbsapp="$app_path/Contents/MacOS/qbs" - if [ -f "$qbsapp" ]; then - qbsArguments=("-executable=$qbsapp" \ - "-executable=$qbsapp-config" \ - "-executable=$qbsapp-config-ui" \ - "-executable=$qbsapp-setup-android" \ - "-executable=$qbsapp-setup-qt" \ - "-executable=$qbsapp-setup-toolchains" \ - "-executable=$qbsapp-create-project" \ - "-executable=$libexec_path/qbs_processlauncher") - fi - - qml2puppetapp="$libexec_path/qml2puppet" - if [ -f "$qml2puppetapp" ]; then - qml2puppetArgument="-executable=$qml2puppetapp" - fi - sdktoolapp="$libexec_path/sdktool" - if [ -f "$sdktoolapp" ]; then - sdktoolArgument="-executable=$sdktoolapp" - fi - - "$bin_src/macdeployqt" "$app_path" \ - "-executable=$app_path/Contents/MacOS/qtdiag" \ - "-executable=$libexec_path/qtpromaker" \ - "$sdktoolArgument" \ - "-executable=$libexec_path/ios/iostool" \ - "-executable=$libexec_path/buildoutputparser" \ - "-executable=$libexec_path/cpaster" \ - "${qbsArguments[@]}" \ - "$qml2puppetArgument" || exit 1 - -fi - -# clean up unneeded object files that are part of Qt for some static libraries -find "$app_path" -ipath "*/objects-*" -delete - -# clean up after macdeployqt -# it deploys some plugins (and libs for these) that interfere with what we want -echo "Cleaning up after macdeployqt..." -toRemove=(\ - "Contents/PlugIns/tls/libqopensslbackend.dylib" \ - "Contents/PlugIns/sqldrivers/libqsqlpsql.dylib" \ - "Contents/PlugIns/sqldrivers/libqsqlodbc.dylib" \ - "Contents/Frameworks/libpq.*dylib" \ - "Contents/Frameworks/libssl.*dylib" \ - "Contents/Frameworks/libcrypto.*dylib" \ -) -for f in "${toRemove[@]}"; do - echo "- removing \"$app_path/$f\"" - rm "$app_path"/$f 2> /dev/null; done -exit 0 From 8277e2f7d9312784d8f0c1154215f471071eeb8c Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 25 Aug 2023 16:29:04 +0200 Subject: [PATCH 0891/1777] QbsProjectManager: Prevent premature profile setup E.g. on Windows, the kitUpdated() signal can be emitted during start-up. In this case, do not set up the profile right away, in accordance with our on-demand policy. Task-number: QTCREATORBUG-29546 Change-Id: I191dba51763a84abf32b8c3e3f6b1bb5dad6fa36 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/qbsprojectmanager/qbsprofilemanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp index 03988e529be..2be00a1d9e2 100644 --- a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp +++ b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp @@ -174,8 +174,8 @@ void QbsProfileManager::addProfileFromKit(const ProjectExplorer::Kit *k) void QbsProfileManager::handleKitUpdate(ProjectExplorer::Kit *kit) { - m_kitsToBeSetupForQbs.removeOne(kit); - addProfileFromKit(kit); + if (!m_kitsToBeSetupForQbs.contains(kit)) + addProfileFromKit(kit); } void QbsProfileManager::handleKitRemoval(ProjectExplorer::Kit *kit) From bb59dfd636cea3986b0f6a764871d0c2732d4739 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 18 Aug 2023 07:48:34 +0200 Subject: [PATCH 0892/1777] TaskTree: Adapt docs to the recent changes The registration macros got removed recently. Change-Id: I69fe5a898d6d975b66a79e64e5e9425960745772 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- src/libs/solutions/tasking/tasktree.cpp | 62 +++++++++++-------------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/src/libs/solutions/tasking/tasktree.cpp b/src/libs/solutions/tasking/tasktree.cpp index 4e6b40ccc1e..503110497dd 100644 --- a/src/libs/solutions/tasking/tasktree.cpp +++ b/src/libs/solutions/tasking/tasktree.cpp @@ -105,6 +105,19 @@ private: implement the start() method, and emit the done() signal when the task is finished. Use task() to access the associated \c Task instance. + To use your task adapter inside the task tree, create an alias to the + Tasking::CustomTask template passing your task adapter as a template parameter: + \code + // Defines actual worker + class Worker {...}; + + // Adapts Worker's interface to work with task tree + class WorkerTaskAdapter : public TaskAdapter<Worker> {...}; + + // Defines WorkerTask as a new task tree element + using WorkerTask = CustomTask<WorkerTaskAdapter>; + \endcode + For more information on implementing the custom task adapters, refer to \l {Task Adapters}. \sa start(), done(), task() @@ -333,8 +346,8 @@ private: The CustomTask class template is used inside TaskTree for describing custom task items. - Custom task names are aliased with unique names inside the \l Tasking namespace - via the TASKING_DECLARE_TASK or TASKING_DECLARE_TEMPLATE_TASK macros. + Custom task names are aliased with unique names using the CustomTask template + with a given TaskAdapter subclass as a template parameter. For example, \c ConcurrentCallTask<T> is an alias to the CustomTask that is defined to work with \c ConcurrentCall<T> as an associated task class. The following table contains all the built-in tasks and their associated task classes: @@ -501,26 +514,6 @@ private: \sa onSetup() */ -/*! - \macro TASKING_DECLARE_TASK(CustomTaskName, TaskAdapterClass) - \relates Tasking - - Registers the new custom task type under a \a CustomTaskName name inside the - Tasking namespace for the passed \a TaskAdapterClass adapter class. - - For more information on implementing the custom task adapters, refer to \l {Task Adapters}. -*/ - -/*! - \macro TASKING_DECLARE_TEMPLATE_TASK(CustomTaskName, TaskAdapterClass) - \relates Tasking - - Registers the new custom task template type under a \a CustomTaskName name inside the - Tasking namespace for the passed \a TaskAdapterClass adapter class template. - - For more information on implementing the custom task adapters, refer to \l {Task Adapters}. -*/ - /*! \enum Tasking::WorkflowPolicy @@ -2156,10 +2149,10 @@ void TaskNode::invokeEndHandler(bool success) asynchronous task: \code - class TimeoutTaskAdapter : public Tasking::TaskAdapter<QTimer> + class TimerTaskAdapter : public TaskAdapter<QTimer> { public: - TimeoutTaskAdapter() { + TimerTaskAdapter() { task()->setSingleShot(true); task()->setInterval(1000); connect(task(), &QTimer::timeout, this, [this] { emit done(true); }); @@ -2168,7 +2161,7 @@ void TaskNode::invokeEndHandler(bool success) void start() final { task()->start(); } }; - TASKING_DECLARE_TASK(TimeoutTask, TimeoutTaskAdapter); + using TimerTask = CustomTask<TimerTaskAdapter>; \endcode You must derive the custom adapter from the TaskAdapter class template @@ -2177,28 +2170,27 @@ void TaskNode::invokeEndHandler(bool success) later as an argument to the task's handlers. The instance of this class parameter automatically becomes a member of the TaskAdapter template, and is accessible through the TaskAdapter::task() method. The constructor - of TimeoutTaskAdapter initially configures the QTimer object and connects - to the QTimer::timeout signal. When the signal is triggered, TimeoutTaskAdapter + of TimerTaskAdapter initially configures the QTimer object and connects + to the QTimer::timeout signal. When the signal is triggered, TimerTaskAdapter emits the \c done(true) signal to inform the task tree that the task finished successfully. If it emits \c done(false), the task finished with an error. The TaskAdapter::start() method starts the timer. - To make QTimer accessible inside TaskTree under the \e TimeoutTask name, - register it with TASKING_DECLARE_TASK(TimeoutTask, TimeoutTaskAdapter). - TimeoutTask becomes a new task type inside Tasking namespace, using TimeoutTaskAdapter. + To make QTimer accessible inside TaskTree under the \e TimerTask name, + define TimerTask to be an alias to the Tasking::CustomTask<TimerTaskAdapter>. + TimerTask becomes a new task type, using TimerTaskAdapter. The new task type is now registered, and you can use it in TaskTree: \code - const auto onTimeoutSetup = [](QTimer &task) { + const auto onTimerSetup = [](QTimer &task) { task.setInterval(2000); }; - const auto onTimeoutDone = [](const QTimer &task) { - qDebug() << "timeout triggered"; + const auto onTimerDone = [](const QTimer &task) { + qDebug() << "timer triggered"; }; - const Group root { - TimeoutTask(onTimeoutSetup, onTimeoutDone) + TimerTask(onTimerSetup, onTimerDone) }; \endcode From 23149b27ab36d30a5f7b6e0f23f29a9318582020 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 28 Aug 2023 10:55:31 +0200 Subject: [PATCH 0893/1777] Utils: Introduce variantFromStore and storeFromVariant These are functional replacements for QVariant::fromValue(QVariantMap) (or QVariant::fromValue(Store)) and QVariant::toMap() (or QVariant::toValue<Store>()) We will have a few code paths in the end that need to explicitly operarate on both QVariantMap and Store (e.g. actual reading/writing to keep format compatibility etc), so these can't in the end be simple to/fromValue(OneType) but need an internal 'if' or such. Change-Id: I954f3cb24fa8fe123162b72bbd25d891dd19b768 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/persistentsettings.cpp | 4 +- src/libs/utils/settingsaccessor.cpp | 10 +-- src/libs/utils/store.cpp | 10 +++ src/libs/utils/store.h | 3 + .../baremetal/debugserverprovidermanager.cpp | 2 +- .../uvsc/jlinkuvscserverprovider.cpp | 4 +- .../uvsc/stlinkuvscserverprovider.cpp | 2 +- .../debugservers/uvsc/uvscserverprovider.cpp | 8 +-- .../uvsc/uvtargetdeviceselection.cpp | 4 +- .../clangtools/clangtoolsprojectsettings.cpp | 8 +-- .../cmakebuildconfiguration.cpp | 6 +- .../cmaketoolsettingsaccessor.cpp | 4 +- src/plugins/copilot/copilotsettings.cpp | 4 +- .../cppeditor/cppcodemodelsettings.cpp | 4 +- src/plugins/debugger/debuggeritemmanager.cpp | 4 +- src/plugins/ios/iosdevice.cpp | 4 +- src/plugins/ios/iosrunconfiguration.cpp | 2 +- .../languageclient/languageclientsettings.cpp | 4 +- .../toolssettingsaccessor.cpp | 8 +-- .../projectexplorer/buildconfiguration.cpp | 6 +- src/plugins/projectexplorer/buildsteplist.cpp | 4 +- src/plugins/projectexplorer/customparser.cpp | 8 +-- .../projectexplorer/deployconfiguration.cpp | 8 +-- .../devicesupport/devicemanager.cpp | 14 ++-- .../projectexplorer/devicesupport/idevice.cpp | 4 +- .../projectexplorer/editorconfiguration.cpp | 6 +- src/plugins/projectexplorer/extraabi.cpp | 2 +- src/plugins/projectexplorer/kit.cpp | 4 +- src/plugins/projectexplorer/kitmanager.cpp | 4 +- src/plugins/projectexplorer/project.cpp | 12 ++-- .../projectcommentssettings.cpp | 4 +- .../projectexplorer/projectexplorer.cpp | 6 +- src/plugins/projectexplorer/target.cpp | 16 ++--- src/plugins/projectexplorer/toolchain.cpp | 4 +- .../toolchainsettingsaccessor.cpp | 4 +- .../projectexplorer/userfileaccessor.cpp | 72 +++++++++---------- src/plugins/qnx/qnxsettingspage.cpp | 4 +- src/plugins/qtsupport/qtversionmanager.cpp | 4 +- src/plugins/texteditor/codestylepool.cpp | 4 +- 39 files changed, 149 insertions(+), 136 deletions(-) diff --git a/src/libs/utils/persistentsettings.cpp b/src/libs/utils/persistentsettings.cpp index c95ef555b84..500204966c5 100644 --- a/src/libs/utils/persistentsettings.cpp +++ b/src/libs/utils/persistentsettings.cpp @@ -135,7 +135,7 @@ QVariant ParseValueStackEntry::value() const case QVariant::Invalid: return QVariant(); case QVariant::Map: - return QVariant::fromValue(mapValue); + return variantFromStore(mapValue); case QVariant::List: return QVariant(listValue); default: @@ -378,7 +378,7 @@ static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx, w.writeAttribute(ctx.typeAttribute, QLatin1String(QVariant::typeToName(QVariant::Map))); if (!key.isEmpty()) w.writeAttribute(ctx.keyAttribute, key); - const Store varMap = variant.value<Store>(); + const Store varMap = storeFromVariant(variant); const Store::const_iterator cend = varMap.constEnd(); for (Store::const_iterator i = varMap.constBegin(); i != cend; ++i) writeVariantValue(w, ctx, i.value(), i.key()); diff --git a/src/libs/utils/settingsaccessor.cpp b/src/libs/utils/settingsaccessor.cpp index 06dd1354c3d..3bd6f227e37 100644 --- a/src/libs/utils/settingsaccessor.cpp +++ b/src/libs/utils/settingsaccessor.cpp @@ -388,7 +388,7 @@ Store VersionUpgrader::renameKeys(const QList<Change> &changes, Store map) const while (i != map.end()) { QVariant v = i.value(); if (v.type() == QVariant::Map) - i.value() = QVariant::fromValue(renameKeys(changes, v.value<Store>())); + i.value() = variantFromStore(renameKeys(changes, storeFromVariant(v))); ++i; } @@ -639,7 +639,7 @@ MergingSettingsAccessor::mergeSettings(const SettingsAccessor::RestoreData &main = [this](const SettingsMergeData &global, const SettingsMergeData &local) { return merge(global, local); }; - const Store result = mergeQVariantMaps(main.data, secondary.data, mergeFunction).value<Store>(); + const Store result = storeFromVariant(mergeQVariantMaps(main.data, secondary.data, mergeFunction)); // Update from the base version to Creator's version. return RestoreData(main.path, postprocessMerge(main.data, secondary.data, result)); @@ -720,15 +720,15 @@ static QVariant mergeQVariantMapsRecursion(const Store &mainTree, const Store &s if (kv.second.type() == QVariant::Map) { const Key newKeyPrefix = keyPrefix + kv.first + '/'; kv.second = mergeQVariantMapsRecursion(mainTree, secondaryTree, newKeyPrefix, - kv.second.value<Store>(), - secondarySubtree.value(kv.first).value<Store>(), + storeFromVariant(kv.second), + storeFromVariant(secondarySubtree.value(kv.first)), merge); } if (!kv.second.isNull()) result.insert(kv.first, kv.second); } - return QVariant::fromValue(result); + return variantFromStore(result); } QVariant mergeQVariantMaps(const Store &mainTree, const Store &secondaryTree, diff --git a/src/libs/utils/store.cpp b/src/libs/utils/store.cpp index 0fa2857742f..9b31a16c541 100644 --- a/src/libs/utils/store.cpp +++ b/src/libs/utils/store.cpp @@ -17,4 +17,14 @@ QStringList stringsFromKeys(const KeyList &list) return transform(list, &stringFromKey); } +QVariant variantFromStore(const Store &store) +{ + return QVariant::fromValue(store); +} + +Store storeFromVariant(const QVariant &value) +{ + return value.value<Store>(); +} + } // Utils diff --git a/src/libs/utils/store.h b/src/libs/utils/store.h index fdb4b36b301..09609e308a8 100644 --- a/src/libs/utils/store.h +++ b/src/libs/utils/store.h @@ -21,4 +21,7 @@ using Store = QVariantMap; QTCREATOR_UTILS_EXPORT KeyList keysFromStrings(const QStringList &list); QTCREATOR_UTILS_EXPORT QStringList stringsFromKeys(const KeyList &list); +QTCREATOR_UTILS_EXPORT QVariant variantFromStore(const Store &store); +QTCREATOR_UTILS_EXPORT Store storeFromVariant(const QVariant &value); + } // Utils diff --git a/src/plugins/baremetal/debugserverprovidermanager.cpp b/src/plugins/baremetal/debugserverprovidermanager.cpp index 849c7c1079c..5ef3147e47c 100644 --- a/src/plugins/baremetal/debugserverprovidermanager.cpp +++ b/src/plugins/baremetal/debugserverprovidermanager.cpp @@ -94,7 +94,7 @@ void DebugServerProviderManager::restoreProviders() if (!data.contains(key)) break; - Store map = data.value(key).value<Store>(); + Store map = storeFromVariant(data.value(key)); const KeyList keys = map.keys(); for (const Key &key : keys) { const int lastDot = key.lastIndexOf('.'); diff --git a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp index c9a22f7273c..2c24485c3d3 100644 --- a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp @@ -243,13 +243,13 @@ JLinkUvscServerProvider::JLinkUvscServerProvider() void JLinkUvscServerProvider::toMap(Store &data) const { UvscServerProvider::toMap(data); - data.insert(adapterOptionsKeyC, QVariant::fromValue(m_adapterOpts.toMap())); + data.insert(adapterOptionsKeyC, variantFromStore(m_adapterOpts.toMap())); } void JLinkUvscServerProvider::fromMap(const Store &data) { UvscServerProvider::fromMap(data); - m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).value<Store>()); + m_adapterOpts.fromMap(storeFromVariant(data.value(adapterOptionsKeyC))); } bool JLinkUvscServerProvider::operator==(const IDebugServerProvider &other) const diff --git a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp index 3725b2fc6ec..a91e236b9dd 100644 --- a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp @@ -209,7 +209,7 @@ void StLinkUvscServerProvider::toMap(Store &data) const void StLinkUvscServerProvider::fromMap(const Store &data) { UvscServerProvider::fromMap(data); - m_adapterOpts.fromMap(data.value(adapterOptionsKeyC).value<Store>()); + m_adapterOpts.fromMap(storeFromVariant(data.value(adapterOptionsKeyC))); } bool StLinkUvscServerProvider::operator==(const IDebugServerProvider &other) const diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index 31ebb34fb99..49eccb1187c 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -151,8 +151,8 @@ void UvscServerProvider::toMap(Store &data) const { IDebugServerProvider::toMap(data); data.insert(toolsIniKeyC, m_toolsIniFile.toSettings()); - data.insert(deviceSelectionKeyC, QVariant::fromValue(m_deviceSelection.toMap())); - data.insert(driverSelectionKeyC, QVariant::fromValue(m_driverSelection.toMap())); + data.insert(deviceSelectionKeyC, variantFromStore(m_deviceSelection.toMap())); + data.insert(driverSelectionKeyC, variantFromStore(m_driverSelection.toMap())); } bool UvscServerProvider::isValid() const @@ -223,8 +223,8 @@ void UvscServerProvider::fromMap(const Store &data) { IDebugServerProvider::fromMap(data); m_toolsIniFile = FilePath::fromSettings(data.value(toolsIniKeyC)); - m_deviceSelection.fromMap(data.value(deviceSelectionKeyC).value<Store>()); - m_driverSelection.fromMap(data.value(driverSelectionKeyC).value<Store>()); + m_deviceSelection.fromMap(storeFromVariant(data.value(deviceSelectionKeyC))); + m_driverSelection.fromMap(storeFromVariant(data.value(driverSelectionKeyC))); } FilePath UvscServerProvider::projectFilePath(DebuggerRunTool *runTool, QString &errorMessage) const diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp index 33d6f3c4569..934bbb098d0 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp @@ -83,7 +83,7 @@ Store DeviceSelection::toMap() const m.insert(deviceMemoryIdKeyC, memory.id); m.insert(deviceMemoryStartKeyC, memory.start); m.insert(deviceMemorySizeKeyC, memory.size); - memoryList.push_back(QVariant::fromValue(m)); + memoryList.push_back(variantFromStore(m)); } map.insert(deviceMemoryKeyC, memoryList); // Device ALGORITHM. @@ -95,7 +95,7 @@ Store DeviceSelection::toMap() const m.insert(deviceAlgorithmFlashSizeKeyC, algorithm.flashSize); m.insert(deviceAlgorithmRamStartKeyC, algorithm.ramStart); m.insert(deviceAlgorithmRamSizeKeyC, algorithm.ramSize); - algorithmList.push_back(QVariant::fromValue(m)); + algorithmList.push_back(variantFromStore(m)); } map.insert(deviceAlgorithmKeyC, algorithmList); map.insert(deviceAlgorithmIndexKeyC, algorithmIndex); diff --git a/src/plugins/clangtools/clangtoolsprojectsettings.cpp b/src/plugins/clangtools/clangtoolsprojectsettings.cpp index e135cd15de0..0d791caed9a 100644 --- a/src/plugins/clangtools/clangtoolsprojectsettings.cpp +++ b/src/plugins/clangtools/clangtoolsprojectsettings.cpp @@ -124,7 +124,7 @@ static Store convertToMapFromVersionBefore410(ProjectExplorer::Project *p) void ClangToolsProjectSettings::load() { // Load map - Store map = m_project->namedSettings(SETTINGS_KEY_MAIN).value<Store>(); + Store map = storeFromVariant(m_project->namedSettings(SETTINGS_KEY_MAIN)); bool write = false; if (map.isEmpty()) { @@ -148,7 +148,7 @@ void ClangToolsProjectSettings::load() const QVariantList list = map.value(SETTINGS_KEY_SUPPRESSED_DIAGS).toList(); for (const QVariant &v : list) { - const Store diag = v.value<Store>(); + const Store diag = storeFromVariant(v); const QString fp = diag.value(SETTINGS_KEY_SUPPRESSED_DIAGS_FILEPATH).toString(); if (fp.isEmpty()) continue; @@ -190,13 +190,13 @@ void ClangToolsProjectSettings::store() diagMap.insert(SETTINGS_KEY_SUPPRESSED_DIAGS_FILEPATH, diag.filePath.toString()); diagMap.insert(SETTINGS_KEY_SUPPRESSED_DIAGS_MESSAGE, diag.description); diagMap.insert(SETTINGS_KEY_SUPPRESSED_DIAGS_UNIQIFIER, diag.uniquifier); - list << QVariant::fromValue(diagMap); + list << variantFromStore(diagMap); } map.insert(SETTINGS_KEY_SUPPRESSED_DIAGS, list); m_runSettings.toMap(map, SETTINGS_PREFIX); - m_project->setNamedSettings(SETTINGS_KEY_MAIN, QVariant::fromValue(map)); + m_project->setNamedSettings(SETTINGS_KEY_MAIN, variantFromStore(map)); } ClangToolsProjectSettings::ClangToolsProjectSettingsPtr diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index bec14ece1b6..e47ff834fd1 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1433,7 +1433,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) setInitializer([this, target](const BuildInfo &info) { const Kit *k = target->kit(); const QtSupport::QtVersion *qt = QtSupport::QtKitAspect::qtVersion(k); - const Store extraInfoMap = info.extraInfo.value<Store>(); + const Store extraInfoMap = storeFromVariant(info.extraInfo); const QString buildType = extraInfoMap.contains(CMAKE_BUILD_TYPE) ? extraInfoMap.value(CMAKE_BUILD_TYPE).toString() : info.typeName; @@ -1942,7 +1942,7 @@ BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(BuildType buildType) Store extraInfo; // enable QML debugging by default extraInfo.insert(Constants::QML_DEBUG_SETTING, TriState::Enabled.toVariant()); - info.extraInfo = QVariant::fromValue(extraInfo); + info.extraInfo = variantFromStore(extraInfo); break; } case BuildTypeRelease: @@ -1969,7 +1969,7 @@ BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(BuildType buildType) extraInfo.insert(CMAKE_BUILD_TYPE, "RelWithDebInfo"); // enable QML debugging by default extraInfo.insert(Constants::QML_DEBUG_SETTING, TriState::Enabled.toVariant()); - info.extraInfo = QVariant::fromValue(extraInfo); + info.extraInfo = variantFromStore(extraInfo); break; } default: diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp index 6780163de79..dc0068e97c9 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp @@ -186,7 +186,7 @@ void CMakeToolSettingsAccessor::saveCMakeTools(const QList<CMakeTool *> &cmakeTo Store tmp = item->toMap(); if (tmp.isEmpty()) continue; - data.insert(CMAKE_TOOL_DATA_KEY + Key::number(count), QVariant::fromValue(tmp)); + data.insert(CMAKE_TOOL_DATA_KEY + Key::number(count), variantFromStore(tmp)); ++count; } } @@ -206,7 +206,7 @@ CMakeToolSettingsAccessor::cmakeTools(const Store &data, bool fromSdk) const if (!data.contains(key)) continue; - const Store dbMap = data.value(key).value<Store>(); + const Store dbMap = storeFromVariant(data.value(key)); auto item = std::make_unique<CMakeTool>(dbMap, fromSdk); const FilePath cmakeExecutable = item->cmakeExecutable(); if (item->isAutoDetected() && !cmakeExecutable.needsDevice() && !cmakeExecutable.isExecutableFile()) { diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index ec98469267e..38683d9acdf 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -233,7 +233,7 @@ CopilotProjectSettings::CopilotProjectSettings(ProjectExplorer::Project *project initEnableAspect(enableCopilot); - Store map = project->namedSettings(Constants::COPILOT_PROJECT_SETTINGS_ID).value<Store>(); + Store map = storeFromVariant(project->namedSettings(Constants::COPILOT_PROJECT_SETTINGS_ID)); fromMap(map); connect(&enableCopilot, &BaseAspect::changed, this, [this, project] { save(project); }); @@ -256,7 +256,7 @@ void CopilotProjectSettings::save(ProjectExplorer::Project *project) { Store map; toMap(map); - project->setNamedSettings(Constants::COPILOT_PROJECT_SETTINGS_ID, QVariant::fromValue(map)); + project->setNamedSettings(Constants::COPILOT_PROJECT_SETTINGS_ID, variantFromStore(map)); // This triggers a restart of the Copilot language server. settings().apply(); diff --git a/src/plugins/cppeditor/cppcodemodelsettings.cpp b/src/plugins/cppeditor/cppcodemodelsettings.cpp index 6265c57b5b9..7aa072f8e63 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettings.cpp @@ -498,7 +498,7 @@ void ClangdProjectSettings::loadSettings() { if (!m_project) return; - const Store data = m_project->namedSettings(clangdSettingsKey()).value<Store>(); + const Store data = storeFromVariant(m_project->namedSettings(clangdSettingsKey())); m_useGlobalSettings = data.value(clangdUseGlobalSettingsKey(), true).toBool(); m_blockIndexing = data.value(clangdblockIndexingSettingsKey(), false).toBool(); if (!m_useGlobalSettings) @@ -514,7 +514,7 @@ void ClangdProjectSettings::saveSettings() data = m_customSettings.toMap(); data.insert(clangdUseGlobalSettingsKey(), m_useGlobalSettings); data.insert(clangdblockIndexingSettingsKey(), m_blockIndexing); - m_project->setNamedSettings(clangdSettingsKey(), QVariant::fromValue(data)); + m_project->setNamedSettings(clangdSettingsKey(), variantFromStore(data)); } Store ClangdSettings::Data::toMap() const diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index 64ec70193c0..ebf70c4fdd0 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -767,7 +767,7 @@ void DebuggerItemModel::readDebuggers(const FilePath &fileName, bool isSystem) const Key key = DEBUGGER_DATA_KEY + Key::number(i); if (!data.contains(key)) continue; - const Store dbMap = data.value(key).value<Store>(); + const Store dbMap = storeFromVariant(data.value(key)); DebuggerItem item(dbMap); if (isSystem) { item.setAutoDetected(true); @@ -821,7 +821,7 @@ void DebuggerItemModel::saveDebuggers() if (item.isValid() && item.engineType() != NoEngineType) { Store tmp = item.toMap(); if (!tmp.isEmpty()) { - data.insert(DEBUGGER_DATA_KEY + Key::number(count), QVariant::fromValue(tmp)); + data.insert(DEBUGGER_DATA_KEY + Key::number(count), variantFromStore(tmp)); ++count; } } diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index 4499be94175..6315f6d5817 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -131,7 +131,7 @@ void IosDevice::fromMap(const Store &map) IDevice::fromMap(map); m_extraInfo.clear(); - const Store vMap = map.value(Constants::EXTRA_INFO_KEY).value<Store>(); + const Store vMap = storeFromVariant(map.value(Constants::EXTRA_INFO_KEY)); for (auto i = vMap.cbegin(), end = vMap.cend(); i != end; ++i) m_extraInfo.insert(stringFromKey(i.key()), i.value().toString()); } @@ -142,7 +142,7 @@ Store IosDevice::toMap() const Store vMap; for (auto i = m_extraInfo.cbegin(), end = m_extraInfo.cend(); i != end; ++i) vMap.insert(keyFromString(i.key()), i.value()); - res.insert(Constants::EXTRA_INFO_KEY, QVariant::fromValue(vMap)); + res.insert(Constants::EXTRA_INFO_KEY, variantFromStore(vMap)); return res; } diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index 772c6ab9223..961a7c1c501 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -210,7 +210,7 @@ void IosDeviceTypeAspect::fromMap(const Store &map) { bool deviceTypeIsInt; map.value(deviceTypeKey).toInt(&deviceTypeIsInt); - if (deviceTypeIsInt || !m_deviceType.fromMap(map.value(deviceTypeKey).value<Store>())) + if (deviceTypeIsInt || !m_deviceType.fromMap(storeFromVariant(map.value(deviceTypeKey)))) updateDeviceType(); m_runConfiguration->update(); diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index 1b1ff9e29ca..a623fd1a9b7 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -612,7 +612,7 @@ QList<BaseSettings *> LanguageClientSettings::fromSettings(QSettings *settingsIn for (auto varList : {settingsIn->value(clientsKey).toList(), settingsIn->value(typedClientsKey).toList()}) { for (const QVariant &var : varList) { - const Store map = var.value<Store>(); + const Store map = storeFromVariant(var); Id typeId = Id::fromSetting(map.value(typeIdKey)); if (!typeId.isValid()) typeId = Constants::LANGUAGECLIENT_STDIO_SETTINGS_ID; @@ -659,7 +659,7 @@ void LanguageClientSettings::toSettings(QSettings *settings, settings->beginGroup(settingsGroupKey); auto transform = [](const QList<BaseSettings *> &settings) { return Utils::transform(settings, [](const BaseSettings *setting) { - return QVariant::fromValue(setting->toMap()); + return variantFromStore(setting->toMap()); }); }; auto isStdioSetting = Utils::equal(&BaseSettings::m_settingsTypeId, diff --git a/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp b/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp index 92dc4f41d02..835df7500a1 100644 --- a/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp +++ b/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp @@ -42,11 +42,11 @@ void ToolsSettingsAccessor::saveMesonTools(const std::vector<MesonTools::Tool_t> for (const MesonTools::Tool_t &tool : tools) { auto asMeson = std::dynamic_pointer_cast<MesonWrapper>(tool); if (asMeson) - data.insert(entryName(entry_count), QVariant::fromValue(toVariantMap<MesonWrapper>(*asMeson))); + data.insert(entryName(entry_count), variantFromStore(toVariantMap<MesonWrapper>(*asMeson))); else { auto asNinja = std::dynamic_pointer_cast<NinjaWrapper>(tool); if (asNinja) - data.insert(entryName(entry_count), QVariant::fromValue(toVariantMap<NinjaWrapper>(*asNinja))); + data.insert(entryName(entry_count), variantFromStore(toVariantMap<NinjaWrapper>(*asNinja))); } entry_count++; } @@ -66,9 +66,9 @@ std::vector<MesonTools::Tool_t> ToolsSettingsAccessor::loadMesonTools(QWidget *p const auto map = data[name].toMap(); auto type = map.value(ToolsSettings::TOOL_TYPE_KEY, ToolsSettings::TOOL_TYPE_MESON); if (type == ToolsSettings::TOOL_TYPE_NINJA) - result.emplace_back(fromVariantMap<NinjaWrapper *>(data[name].value<Store>())); + result.emplace_back(fromVariantMap<NinjaWrapper *>(storeFromVariant(data[name]))); else - result.emplace_back(fromVariantMap<MesonWrapper *>(data[name].value<Store>())); + result.emplace_back(fromVariantMap<MesonWrapper *>(storeFromVariant(data[name]))); } } return result; diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 35c2314359f..97c0ce8bfa8 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -381,8 +381,8 @@ void BuildConfiguration::toMap(Store &map) const EnvironmentItem::toStringList(d->m_userEnvironmentChanges)); map.insert(BUILD_STEP_LIST_COUNT, 2); - map.insert(BUILD_STEP_LIST_PREFIX + Key::number(0), QVariant::fromValue(d->m_buildSteps.toMap())); - map.insert(BUILD_STEP_LIST_PREFIX + Key::number(1), QVariant::fromValue(d->m_cleanSteps.toMap())); + map.insert(BUILD_STEP_LIST_PREFIX + Key::number(0), variantFromStore(d->m_buildSteps.toMap())); + map.insert(BUILD_STEP_LIST_PREFIX + Key::number(1), variantFromStore(d->m_cleanSteps.toMap())); map.insert(PARSE_STD_OUT_KEY, d->m_parseStdOut); map.insert(CUSTOM_PARSERS_KEY, transform(d->m_customParsers, &Id::toSetting)); @@ -401,7 +401,7 @@ void BuildConfiguration::fromMap(const Store &map) int maxI = map.value(BUILD_STEP_LIST_COUNT, 0).toInt(); for (int i = 0; i < maxI; ++i) { - Store data = map.value(BUILD_STEP_LIST_PREFIX + Key::number(i)).value<Store>(); + Store data = storeFromVariant(map.value(BUILD_STEP_LIST_PREFIX + Key::number(i))); if (data.isEmpty()) { qWarning() << "No data for build step list" << i << "found!"; continue; diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index d624fd5ad9f..5befbd09b46 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -62,7 +62,7 @@ Store BuildStepList::toMap() const for (int i = 0; i < m_steps.count(); ++i) { Store data; m_steps.at(i)->toMap(data); - map.insert(STEPS_PREFIX + Key::number(i), QVariant::fromValue(data)); + map.insert(STEPS_PREFIX + Key::number(i), variantFromStore(data)); } return map; @@ -111,7 +111,7 @@ bool BuildStepList::fromMap(const Store &map) int maxSteps = map.value(STEPS_COUNT_KEY, 0).toInt(); for (int i = 0; i < maxSteps; ++i) { - Store bsData(map.value(STEPS_PREFIX + Key::number(i)).value<Store>()); + Store bsData = storeFromVariant(map.value(STEPS_PREFIX + Key::number(i))); if (bsData.isEmpty()) { qWarning() << "No step data found for" << i << "(continuing)."; continue; diff --git a/src/plugins/projectexplorer/customparser.cpp b/src/plugins/projectexplorer/customparser.cpp index fae8af7841f..e1dc3c7577a 100644 --- a/src/plugins/projectexplorer/customparser.cpp +++ b/src/plugins/projectexplorer/customparser.cpp @@ -144,8 +144,8 @@ Store CustomParserSettings::toMap() const Store map; map.insert(idKey, id.toSetting()); map.insert(nameKey, displayName); - map.insert(errorKey, QVariant::fromValue(error.toMap())); - map.insert(warningKey, QVariant::fromValue(warning.toMap())); + map.insert(errorKey, variantFromStore(error.toMap())); + map.insert(warningKey, variantFromStore(warning.toMap())); return map; } @@ -153,8 +153,8 @@ void CustomParserSettings::fromMap(const Store &map) { id = Id::fromSetting(map.value(idKey)); displayName = map.value(nameKey).toString(); - error.fromMap(map.value(errorKey).value<Store>()); - warning.fromMap(map.value(warningKey).value<Store>()); + error.fromMap(storeFromVariant(map.value(errorKey))); + warning.fromMap(storeFromVariant(map.value(warningKey))); } CustomParsersAspect::CustomParsersAspect(Target *target) diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp index 39a0c08bcea..418873ca024 100644 --- a/src/plugins/projectexplorer/deployconfiguration.cpp +++ b/src/plugins/projectexplorer/deployconfiguration.cpp @@ -54,14 +54,14 @@ void DeployConfiguration::toMap(Store &map) const { ProjectConfiguration::toMap(map); map.insert(BUILD_STEP_LIST_COUNT, 1); - map.insert(Key(BUILD_STEP_LIST_PREFIX) + '0', QVariant::fromValue(m_stepList.toMap())); + map.insert(Key(BUILD_STEP_LIST_PREFIX) + '0', variantFromStore(m_stepList.toMap())); map.insert(USES_DEPLOYMENT_DATA, usesCustomDeploymentData()); Store deployData; for (int i = 0; i < m_customDeploymentData.fileCount(); ++i) { const DeployableFile &f = m_customDeploymentData.fileAt(i); deployData.insert(keyFromString(f.localFilePath().toString()), f.remoteDirectory()); } - map.insert(DEPLOYMENT_DATA, QVariant::fromValue(deployData)); + map.insert(DEPLOYMENT_DATA, variantFromStore(deployData)); } void DeployConfiguration::fromMap(const Store &map) @@ -75,7 +75,7 @@ void DeployConfiguration::fromMap(const Store &map) reportError(); return; } - Store data = map.value(Key(BUILD_STEP_LIST_PREFIX) + '0').value<Store>(); + Store data = storeFromVariant(map.value(Key(BUILD_STEP_LIST_PREFIX) + '0')); if (!data.isEmpty()) { m_stepList.clear(); if (!m_stepList.fromMap(data)) { @@ -91,7 +91,7 @@ void DeployConfiguration::fromMap(const Store &map) } m_usesCustomDeploymentData = map.value(USES_DEPLOYMENT_DATA, false).toBool(); - const Store deployData = map.value(DEPLOYMENT_DATA).value<Store>(); + const Store deployData = storeFromVariant(map.value(DEPLOYMENT_DATA)); for (auto it = deployData.begin(); it != deployData.end(); ++it) m_customDeploymentData.addFile(FilePath::fromString(stringFromKey(it.key())), it.value().toString()); } diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 7bf43d55d8e..b288a74477f 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -131,7 +131,7 @@ void DeviceManager::save() if (d->clonedInstance == this || !d->writer) return; Store data; - data.insert(DeviceManagerKey, QVariant::fromValue(toMap())); + data.insert(DeviceManagerKey, variantFromStore(toMap())); d->writer->save(data, Core::ICore::dialogParent()); } @@ -157,11 +157,11 @@ void DeviceManager::load() QHash<Id, Id> defaultDevices; QList<IDevice::Ptr> sdkDevices; if (reader.load(systemSettingsFilePath("devices.xml"))) - sdkDevices = fromMap(reader.restoreValues().value(DeviceManagerKey).value<Store>(), &defaultDevices); + sdkDevices = fromMap(storeFromVariant(reader.restoreValues().value(DeviceManagerKey)), &defaultDevices); // read devices file from user settings path QList<IDevice::Ptr> userDevices; if (reader.load(settingsFilePath("devices.xml"))) - userDevices = fromMap(reader.restoreValues().value(DeviceManagerKey).value<Store>(), &defaultDevices); + userDevices = fromMap(storeFromVariant(reader.restoreValues().value(DeviceManagerKey)), &defaultDevices); // Insert devices into the model. Prefer the higher device version when there are multiple // devices with the same id. for (IDevice::ConstPtr device : std::as_const(userDevices)) { @@ -209,13 +209,13 @@ QList<IDevice::Ptr> DeviceManager::fromMap(const Store &map, QHash<Id, Id> *defa QList<IDevice::Ptr> devices; if (defaultDevices) { - const Store defaultDevsMap = map.value(DefaultDevicesKey).value<Store>(); + const Store defaultDevsMap = storeFromVariant(map.value(DefaultDevicesKey)); for (auto it = defaultDevsMap.constBegin(); it != defaultDevsMap.constEnd(); ++it) defaultDevices->insert(Id::fromString(stringFromKey(it.key())), Id::fromSetting(it.value())); } const QVariantList deviceList = map.value(DeviceListKey).toList(); for (const QVariant &v : deviceList) { - const Store map = v.value<Store>(); + const Store map = storeFromVariant(v); const IDeviceFactory * const factory = restoreFactory(map); if (!factory) continue; @@ -234,10 +234,10 @@ Store DeviceManager::toMap() const for (auto it = d->defaultDevices.constBegin(); it != d->defaultDevices.constEnd(); ++it) defaultDeviceMap.insert(keyFromString(it.key().toString()), it.value().toSetting()); - map.insert(DefaultDevicesKey, QVariant::fromValue(defaultDeviceMap)); + map.insert(DefaultDevicesKey, variantFromStore(defaultDeviceMap)); QVariantList deviceList; for (const IDevice::Ptr &device : std::as_const(d->devices)) - deviceList << QVariant::fromValue(device->toMap()); + deviceList << variantFromStore(device->toMap()); map.insert(DeviceListKey, deviceList); return map; } diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 5996ee57db0..f27c93c7f30 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -475,7 +475,7 @@ void IDevice::fromMap(const Store &map) d->debugServerPath = FilePath::fromSettings(map.value(DebugServerKey)); const FilePath qmlRunCmd = FilePath::fromSettings(map.value(QmlRuntimeKey)); d->qmlRunCommand = qmlRunCmd; - d->extraData = map.value(ExtraDataKey).value<Store>(); + d->extraData = storeFromVariant(map.value(ExtraDataKey)); } /*! @@ -509,7 +509,7 @@ Store IDevice::toMap() const map.insert(DebugServerKey, d->debugServerPath.toSettings()); map.insert(QmlRuntimeKey, d->qmlRunCommand.toSettings()); - map.insert(ExtraDataKey, QVariant::fromValue(d->extraData)); + map.insert(ExtraDataKey, variantFromStore(d->extraData)); return map; } diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index c174767fcd2..e19e33fcf6b 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -181,7 +181,7 @@ Store EditorConfiguration::toMap() const {"language", QVariant::fromValue(itCodeStyle.key().toSetting())}, {"value", QVariant::fromValue(itCodeStyle.value()->toMap())} }; - map.insert(kCodeStylePrefix + Key::number(i), QVariant::fromValue(settingsIdMap)); + map.insert(kCodeStylePrefix + Key::number(i), variantFromStore(settingsIdMap)); i++; } @@ -204,13 +204,13 @@ void EditorConfiguration::fromMap(const Store &map) const int codeStyleCount = map.value(kCodeStyleCount, 0).toInt(); for (int i = 0; i < codeStyleCount; ++i) { - Store settingsIdMap = map.value(kCodeStylePrefix + Key::number(i)).value<Store>(); + Store settingsIdMap = storeFromVariant(map.value(kCodeStylePrefix + Key::number(i))); if (settingsIdMap.isEmpty()) { qWarning() << "No data for code style settings list" << i << "found!"; continue; } Id languageId = Id::fromSetting(settingsIdMap.value("language")); - Store value = settingsIdMap.value("value").value<Store>(); + Store value = storeFromVariant(settingsIdMap.value("value")); ICodeStylePreferences *preferences = d->m_languageCodeStylePreferences.value(languageId); if (preferences) preferences->fromMap(value); diff --git a/src/plugins/projectexplorer/extraabi.cpp b/src/plugins/projectexplorer/extraabi.cpp index baf7bd49b8b..80992381562 100644 --- a/src/plugins/projectexplorer/extraabi.cpp +++ b/src/plugins/projectexplorer/extraabi.cpp @@ -52,7 +52,7 @@ public: void ExtraAbi::load() { AbiFlavorAccessor accessor; - const Store data = accessor.restoreSettings(Core::ICore::dialogParent()).value("Flavors").value<Store>(); + const Store data = storeFromVariant(accessor.restoreSettings(Core::ICore::dialogParent()).value("Flavors")); for (auto it = data.constBegin(); it != data.constEnd(); ++it) { const Key flavor = it.key(); if (flavor.isEmpty()) diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index 931540e9b79..a43ca8f3816 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -146,7 +146,7 @@ Kit::Kit(const Store &data) if (it != data.constEnd()) d->m_irrelevantAspects = transform<QSet<Id>>(it.value().toList(), &Id::fromSetting); - Store extra = data.value(DATA_KEY).value<Store>(); + Store extra = storeFromVariant(data.value(DATA_KEY)); d->m_data.clear(); // remove default values const Store::ConstIterator cend = extra.constEnd(); for (Store::ConstIterator it = extra.constBegin(); it != cend; ++it) @@ -518,7 +518,7 @@ Store Kit::toMap() const const IdVariantConstIt cend = d->m_data.constEnd(); for (IdVariantConstIt it = d->m_data.constBegin(); it != cend; ++it) extra.insert(keyFromString(QString::fromLatin1(it.key().name().constData())), it.value()); - data.insert(DATA_KEY, QVariant::fromValue(extra)); + data.insert(DATA_KEY, variantFromStore(extra)); return data; } diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 6731089f6da..4661b93ba6e 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -448,7 +448,7 @@ void KitManager::saveKits() Store tmp = k->toMap(); if (tmp.isEmpty()) continue; - data.insert(KIT_DATA_KEY + Key::number(count), QVariant::fromValue(tmp)); + data.insert(KIT_DATA_KEY + Key::number(count), variantFromStore(tmp)); ++count; } data.insert(KIT_COUNT_KEY, count); @@ -518,7 +518,7 @@ static KitList restoreKitsHelper(const FilePath &fileName) if (!data.contains(key)) break; - const Store stMap = data.value(key).value<Store>(); + const Store stMap = storeFromVariant(data.value(key)); auto k = std::make_unique<Kit>(stMap); if (k->id().isValid()) { diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 170419d2450..6448b391c39 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -698,11 +698,11 @@ void Project::toMap(Store &map) const map.insert(ACTIVE_TARGET_KEY, ts.indexOf(d->m_activeTarget)); map.insert(TARGET_COUNT_KEY, ts.size()); for (int i = 0; i < ts.size(); ++i) - map.insert(TARGET_KEY_PREFIX + Key::number(i), QVariant::fromValue(ts.at(i)->toMap())); + map.insert(TARGET_KEY_PREFIX + Key::number(i), variantFromStore(ts.at(i)->toMap())); - map.insert(EDITOR_SETTINGS_KEY, QVariant::fromValue(d->m_editorConfiguration.toMap())); + map.insert(EDITOR_SETTINGS_KEY, variantFromStore(d->m_editorConfiguration.toMap())); if (!d->m_pluginSettings.isEmpty()) - map.insert(PLUGIN_SETTINGS_KEY, QVariant::fromValue(d->m_pluginSettings)); + map.insert(PLUGIN_SETTINGS_KEY, variantFromStore(d->m_pluginSettings)); } /*! @@ -768,12 +768,12 @@ Project::RestoreResult Project::fromMap(const Store &map, QString *errorMessage) { Q_UNUSED(errorMessage) if (map.contains(EDITOR_SETTINGS_KEY)) { - Store values(map.value(EDITOR_SETTINGS_KEY).value<Store>()); + Store values = storeFromVariant(map.value(EDITOR_SETTINGS_KEY)); d->m_editorConfiguration.fromMap(values); } if (map.contains(PLUGIN_SETTINGS_KEY)) - d->m_pluginSettings = map.value(PLUGIN_SETTINGS_KEY).value<Store>(); + d->m_pluginSettings = storeFromVariant(map.value(PLUGIN_SETTINGS_KEY)); bool ok; int maxI(map.value(TARGET_COUNT_KEY, 0).toInt(&ok)); @@ -805,7 +805,7 @@ void Project::createTargetFromMap(const Store &map, int index) if (!map.contains(key)) return; - const Store targetMap = map.value(key).value<Store>(); + const Store targetMap = storeFromVariant(map.value(key)); Id id = idFromMap(targetMap); if (target(id)) { diff --git a/src/plugins/projectexplorer/projectcommentssettings.cpp b/src/plugins/projectexplorer/projectcommentssettings.cpp index 57ced03d38f..b07cea9b290 100644 --- a/src/plugins/projectexplorer/projectcommentssettings.cpp +++ b/src/plugins/projectexplorer/projectcommentssettings.cpp @@ -57,7 +57,7 @@ void ProjectCommentsSettings::loadSettings() if (!entry.isValid()) return; - const Store data = entry.value<Store>(); + const Store data = storeFromVariant(entry); m_useGlobalSettings = data.value(kUseGlobalKey, true).toBool(); m_customSettings.enableDoxygen = data.value(CommentsSettings::enableDoxygenSettingsKey(), m_customSettings.enableDoxygen).toBool(); @@ -87,7 +87,7 @@ void ProjectCommentsSettings::saveSettings() data.insert(CommentsSettings::generateBriefSettingsKey(), m_customSettings.generateBrief); data.insert(CommentsSettings::leadingAsterisksSettingsKey(), m_customSettings.leadingAsterisks); data.insert(CommentsSettings::commandPrefixKey(), int(m_customSettings.commandPrefix)); - m_project->setNamedSettings(CommentsSettings::mainSettingsKey(), QVariant::fromValue(data)); + m_project->setNamedSettings(CommentsSettings::mainSettingsKey(), variantFromStore(data)); } class ProjectCommentsSettingsWidget::Private diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 799f55ac17c..8a8c835e21d 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1702,8 +1702,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er const int customParserCount = s->value(Constants::CUSTOM_PARSER_COUNT_KEY).toInt(); for (int i = 0; i < customParserCount; ++i) { CustomParserSettings settings; - settings.fromMap(s->value(Constants::CUSTOM_PARSER_PREFIX_KEY - + Key::number(i)).value<Store>()); + settings.fromMap(storeFromVariant( + s->value(Constants::CUSTOM_PARSER_PREFIX_KEY + Key::number(i)))); dd->m_customParsers << settings; } @@ -2279,7 +2279,7 @@ void ProjectExplorerPluginPrivate::savePersistentSettings() s->setValueWithDefault(Constants::CUSTOM_PARSER_COUNT_KEY, int(dd->m_customParsers.count()), 0); for (int i = 0; i < dd->m_customParsers.count(); ++i) { s->setValue(Constants::CUSTOM_PARSER_PREFIX_KEY + Key::number(i), - QVariant::fromValue(dd->m_customParsers.at(i).toMap())); + variantFromStore(dd->m_customParsers.at(i).toMap())); } } diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index b050e11eeb9..3660e5f1ad1 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -605,7 +605,7 @@ Store Target::toMap() const for (int i = 0; i < bcs.size(); ++i) { Store data; bcs.at(i)->toMap(data); - map.insert(BC_KEY_PREFIX + Key::number(i), QVariant::fromValue(data)); + map.insert(BC_KEY_PREFIX + Key::number(i), variantFromStore(data)); } const QList<DeployConfiguration *> dcs = deployConfigurations(); @@ -614,7 +614,7 @@ Store Target::toMap() const for (int i = 0; i < dcs.size(); ++i) { Store data; dcs.at(i)->toMap(data); - map.insert(DC_KEY_PREFIX + Key::number(i), QVariant::fromValue(data)); + map.insert(DC_KEY_PREFIX + Key::number(i), variantFromStore(data)); } const QList<RunConfiguration *> rcs = runConfigurations(); @@ -623,11 +623,11 @@ Store Target::toMap() const for (int i = 0; i < rcs.size(); ++i) { Store data; rcs.at(i)->toMap(data); - map.insert(RC_KEY_PREFIX + Key::number(i), QVariant::fromValue(data)); + map.insert(RC_KEY_PREFIX + Key::number(i), variantFromStore(data)); } if (!d->m_pluginSettings.isEmpty()) - map.insert(PLUGIN_SETTINGS_KEY, QVariant::fromValue(d->m_pluginSettings)); + map.insert(PLUGIN_SETTINGS_KEY, variantFromStore(d->m_pluginSettings)); return map; } @@ -903,7 +903,7 @@ bool Target::fromMap(const Store &map) const Key key = BC_KEY_PREFIX + Key::number(i); if (!map.contains(key)) return false; - const Store valueMap = map.value(key).value<Store>(); + const Store valueMap = storeFromVariant(map.value(key)); BuildConfiguration *bc = BuildConfigurationFactory::restore(this, valueMap); if (!bc) { qWarning("No factory found to restore build configuration!"); @@ -930,7 +930,7 @@ bool Target::fromMap(const Store &map) const Key key = DC_KEY_PREFIX + Key::number(i); if (!map.contains(key)) return false; - Store valueMap = map.value(key).value<Store>(); + Store valueMap = storeFromVariant(map.value(key)); DeployConfiguration *dc = DeployConfigurationFactory::restore(this, valueMap); if (!dc) { Utils::Id id = idFromMap(valueMap); @@ -959,7 +959,7 @@ bool Target::fromMap(const Store &map) return false; // Ignore missing RCs: We will just populate them using the default ones. - Store valueMap = map.value(key).value<Store>(); + Store valueMap = storeFromVariant(map.value(key)); RunConfiguration *rc = RunConfigurationFactory::restore(this, valueMap); if (!rc) continue; @@ -973,7 +973,7 @@ bool Target::fromMap(const Store &map) } if (map.contains(PLUGIN_SETTINGS_KEY)) - d->m_pluginSettings = map.value(PLUGIN_SETTINGS_KEY).value<Store>(); + d->m_pluginSettings = storeFromVariant(map.value(PLUGIN_SETTINGS_KEY)); return true; } diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 0c70b0cccb1..6bb6e1acf85 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -738,14 +738,14 @@ bool BadToolchains::isBadToolchain(const FilePath &toolchain) const QVariant BadToolchains::toVariant() const { return Utils::transform<QVariantList>(toolchains, [](const BadToolchain &bdc) { - return QVariant::fromValue(bdc.toMap()); + return variantFromStore(bdc.toMap()); }); } BadToolchains BadToolchains::fromVariant(const QVariant &v) { return Utils::transform<QList<BadToolchain>>(v.toList(), - [](const QVariant &e) { return BadToolchain::fromMap(e.value<Store>()); }); + [](const QVariant &e) { return BadToolchain::fromMap(storeFromVariant(e)); }); } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index be152de187f..3d957f7f0f0 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -224,7 +224,7 @@ void ToolChainSettingsAccessor::saveToolChains(const Toolchains &toolchains, QWi tc->toMap(tmp); if (tmp.isEmpty()) continue; - data.insert(TOOLCHAIN_DATA_KEY + Key::number(count), QVariant::fromValue(tmp)); + data.insert(TOOLCHAIN_DATA_KEY + Key::number(count), variantFromStore(tmp)); ++count; } data.insert(TOOLCHAIN_COUNT_KEY, count); @@ -245,7 +245,7 @@ Toolchains ToolChainSettingsAccessor::toolChains(const Store &data) const if (!data.contains(key)) break; - const Store tcMap = data.value(key).value<Store>(); + const Store tcMap = storeFromVariant(data.value(key)); bool restored = false; const Utils::Id tcType = ToolChainFactory::typeIdFromMap(tcMap); diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index a627e28d091..fb2ccb36f5d 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -405,7 +405,7 @@ Store UserFileAccessor::postprocessMerge(const Store &main, const Store &secondary, const Store &result) const { - project()->setProperty(SHARED_SETTINGS, QVariant::fromValue(secondary)); + project()->setProperty(SHARED_SETTINGS, variantFromStore(secondary)); return MergingSettingsAccessor::postprocessMerge(main, secondary, result); } @@ -429,12 +429,12 @@ Store UserFileAccessor::preprocessReadSettings(const Store &data) const Store UserFileAccessor::prepareToWriteSettings(const Store &data) const { const Store tmp = MergingSettingsAccessor::prepareToWriteSettings(data); - const Store shared = retrieveSharedSettings().value<Store>(); + const Store shared = storeFromVariant(retrieveSharedSettings()); Store result; if (!shared.isEmpty()) { KeyList stickyKeys; SettingsMergeFunction merge = userStickyTrackerFunction(stickyKeys); - result = mergeQVariantMaps(tmp, shared, merge).value<Store>(); + result = storeFromVariant(mergeQVariantMaps(tmp, shared, merge)); result.insert(USER_STICKY_KEYS_KEY, stringsFromKeys(stickyKeys)); } else { result = tmp; @@ -454,7 +454,7 @@ Store UserFileVersion14Upgrader::upgrade(const Store &map) Store result; for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) { if (it.value().typeId() == QVariant::Map) - result.insert(it.key(), QVariant::fromValue(upgrade(it.value().value<Store>()))); + result.insert(it.key(), variantFromStore(upgrade(storeFromVariant(it.value())))); else if (it.key() == "AutotoolsProjectManager.AutotoolsBuildConfiguration.BuildDirectory" || it.key() == "CMakeProjectManager.CMakeBuildConfiguration.BuildDirectory" || it.key() == "GenericProjectManager.GenericBuildConfiguration.BuildDirectory" @@ -490,11 +490,11 @@ UserFileVersion16Upgrader::OldStepMaps UserFileVersion16Upgrader::extractStepMap result.defaultDisplayName = deployMap.value("ProjectExplorer.ProjectConfiguration.DefaultDisplayName").toString(); result.displayName = deployMap.value("ProjectExplorer.ProjectConfiguration.DisplayName").toString(); const Key stepListKey = "ProjectExplorer.BuildConfiguration.BuildStepList.0"; - Store stepListMap = deployMap.value(stepListKey).value<Store>(); + Store stepListMap = storeFromVariant(deployMap.value(stepListKey)); int stepCount = stepListMap.value("ProjectExplorer.BuildStepList.StepsCount", 0).toInt(); Key stepKey = "ProjectExplorer.BuildStepList.Step."; for (int i = 0; i < stepCount; ++i) { - Store stepMap = stepListMap.value(stepKey + Key::number(i)).value<Store>(); + Store stepMap = storeFromVariant(stepListMap.value(stepKey + Key::number(i))); const QString id = stepMap.value("ProjectExplorer.ProjectConfiguration.Id").toString(); if (id == "Qt4ProjectManager.AndroidDeployQtStep") result.androidDeployQt = stepMap; @@ -510,16 +510,16 @@ UserFileVersion16Upgrader::OldStepMaps UserFileVersion16Upgrader::extractStepMap Store UserFileVersion16Upgrader::removeAndroidPackageStep(Store deployMap) { const Key stepListKey = "ProjectExplorer.BuildConfiguration.BuildStepList.0"; - Store stepListMap = deployMap.value(stepListKey).value<Store>(); + Store stepListMap = storeFromVariant(deployMap.value(stepListKey)); const Key stepCountKey = "ProjectExplorer.BuildStepList.StepsCount"; int stepCount = stepListMap.value(stepCountKey, 0).toInt(); Key stepKey = "ProjectExplorer.BuildStepList.Step."; int targetPosition = 0; for (int sourcePosition = 0; sourcePosition < stepCount; ++sourcePosition) { - Store stepMap = stepListMap.value(stepKey + Key::number(sourcePosition)).value<Store>(); + Store stepMap = storeFromVariant(stepListMap.value(stepKey + Key::number(sourcePosition))); if (stepMap.value("ProjectExplorer.ProjectConfiguration.Id").toString() != "Qt4ProjectManager.AndroidPackageInstallationStep") { - stepListMap.insert(stepKey + Key::number(targetPosition), QVariant::fromValue(stepMap)); + stepListMap.insert(stepKey + Key::number(targetPosition), variantFromStore(stepMap)); ++targetPosition; } } @@ -529,7 +529,7 @@ Store UserFileVersion16Upgrader::removeAndroidPackageStep(Store deployMap) for (int i = targetPosition; i < stepCount; ++i) stepListMap.remove(stepKey + Key::number(i)); - deployMap.insert(stepListKey, QVariant::fromValue(stepListMap)); + deployMap.insert(stepListKey, variantFromStore(stepListMap)); return deployMap; } @@ -598,10 +598,10 @@ Store UserFileVersion16Upgrader::insertSteps(Store buildConfigurationMap, androidBuildApkStep.insert(VerboseOutputKey, verbose); const Key buildStepKey = "ProjectExplorer.BuildStepList.Step."; - buildStepListMap.insert(buildStepKey + Key::number(stepCount), QVariant::fromValue(androidPackageInstallStep)); - buildStepListMap.insert(buildStepKey + Key::number(stepCount + 1), QVariant::fromValue(androidBuildApkStep)); + buildStepListMap.insert(buildStepKey + Key::number(stepCount), variantFromStore(androidPackageInstallStep)); + buildStepListMap.insert(buildStepKey + Key::number(stepCount + 1), variantFromStore(androidBuildApkStep)); - buildConfigurationMap.insert(bslKey + Key::number(bslNumber), QVariant::fromValue(buildStepListMap)); + buildConfigurationMap.insert(bslKey + Key::number(bslNumber), variantFromStore(buildStepListMap)); } if (policy == RenameBuildConfiguration) { @@ -638,7 +638,7 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) for (int i = 0; i < targetCount; ++i) { Key targetKey = "ProjectExplorer.Project.Target." + Key::number(i); - Store targetMap = data.value(targetKey).value<Store>(); + Store targetMap = storeFromVariant(data.value(targetKey)); const Key dcCountKey = "ProjectExplorer.Target.DeployConfigurationCount"; int deployconfigurationCount = targetMap.value(dcCountKey).toInt(); @@ -651,7 +651,7 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) Key deployKey = "ProjectExplorer.Target.DeployConfiguration."; for (int j = 0; j < deployconfigurationCount; ++j) { Store deployConfigurationMap - = targetMap.value(deployKey + Key::number(j)).value<Store>(); + = storeFromVariant(targetMap.value(deployKey + Key::number(j))); OldStepMaps oldStep = extractStepMaps(deployConfigurationMap); if (!oldStep.isEmpty()) { oldSteps.append(oldStep); @@ -672,7 +672,7 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) Key bcKey = "ProjectExplorer.Target.BuildConfiguration."; for (int j = 0; j < buildConfigurationCount; ++j) { - Store oldBuildConfigurationMap = targetMap.value(bcKey + Key::number(j)).value<Store>(); + Store oldBuildConfigurationMap = storeFromVariant(targetMap.value(bcKey + Key::number(j))); oldBuildConfigurations.append(oldBuildConfigurationMap); } @@ -691,8 +691,8 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) targetMap.insert(bcCountKey, newBuildConfigurations.size()); for (int j = 0; j < newBuildConfigurations.size(); ++j) - targetMap.insert(bcKey + Key::number(j), QVariant::fromValue(newBuildConfigurations.at(j))); - result.insert(targetKey, QVariant::fromValue(targetMap)); + targetMap.insert(bcKey + Key::number(j), variantFromStore(newBuildConfigurations.at(j))); + result.insert(targetKey, variantFromStore(targetMap)); } return result; @@ -703,7 +703,7 @@ Store UserFileVersion17Upgrader::upgrade(const Store &map) m_sticky = map.value(USER_STICKY_KEYS_KEY).toList(); if (m_sticky.isEmpty()) return map; - return process(QVariant::fromValue(map)).value<Store>(); + return storeFromVariant(process(variantFromStore(map))); } QVariant UserFileVersion17Upgrader::process(const QVariant &entry) @@ -716,13 +716,13 @@ QVariant UserFileVersion17Upgrader::process(const QVariant &entry) return result; } case QVariant::Map: { - Store result = entry.value<Store>(); + Store result = storeFromVariant(entry); for (Store::iterator i = result.begin(), end = result.end(); i != end; ++i) { QVariant &v = i.value(); v = process(v); } result.insert(USER_STICKY_KEYS_KEY, m_sticky); - return QVariant::fromValue(result); + return variantFromStore(result); } default: return entry; @@ -731,7 +731,7 @@ QVariant UserFileVersion17Upgrader::process(const QVariant &entry) Store UserFileVersion18Upgrader::upgrade(const Store &map) { - return process(QVariant::fromValue(map)).value<Store>(); + return storeFromVariant(process(variantFromStore(map))); } QVariant UserFileVersion18Upgrader::process(const QVariant &entry) @@ -740,7 +740,7 @@ QVariant UserFileVersion18Upgrader::process(const QVariant &entry) case QVariant::List: return Utils::transform(entry.toList(), &UserFileVersion18Upgrader::process); case QVariant::Map: { - Store map = entry.value<Store>(); + Store map = storeFromVariant(entry); Store result; for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) { Key key = it.key() == "AutotoolsProjectManager.MakeStep.AdditionalArguments" @@ -748,7 +748,7 @@ QVariant UserFileVersion18Upgrader::process(const QVariant &entry) : it.key(); result.insert(key, UserFileVersion18Upgrader::process(it.value())); } - return QVariant::fromValue(result); + return variantFromStore(result); } default: return entry; @@ -757,7 +757,7 @@ QVariant UserFileVersion18Upgrader::process(const QVariant &entry) Store UserFileVersion19Upgrader::upgrade(const Store &map) { - return process(QVariant::fromValue(map), KeyList()).value<Store>(); + return storeFromVariant(process(variantFromStore(map), KeyList())); } QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const KeyList &path) @@ -797,7 +797,7 @@ QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const KeyList return Utils::transform(entry.toList(), std::bind(&UserFileVersion19Upgrader::process, std::placeholders::_1, path)); case QVariant::Map: { - Store map = entry.value<Store>(); + Store map = storeFromVariant(entry); Store result; for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) { Key key = it.key(); @@ -820,7 +820,7 @@ QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const KeyList } result.insert(key, value); }; - return QVariant::fromValue(result); + return variantFromStore(result); } default: return entry; @@ -829,7 +829,7 @@ QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const KeyList Store UserFileVersion20Upgrader::upgrade(const Store &map) { - return process(QVariant::fromValue(map)).value<Store>(); + return storeFromVariant(process(variantFromStore(map))); } QVariant UserFileVersion20Upgrader::process(const QVariant &entry) @@ -838,7 +838,7 @@ QVariant UserFileVersion20Upgrader::process(const QVariant &entry) case QVariant::List: return Utils::transform(entry.toList(), &UserFileVersion20Upgrader::process); case QVariant::Map: { - Store map = entry.value<Store>(); + Store map = storeFromVariant(entry); Store result; for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) { Key key = it.key(); @@ -849,7 +849,7 @@ QVariant UserFileVersion20Upgrader::process(const QVariant &entry) value = UserFileVersion20Upgrader::process(value); result.insert(key, value); } - return QVariant::fromValue(result); + return variantFromStore(result); } default: return entry; @@ -858,7 +858,7 @@ QVariant UserFileVersion20Upgrader::process(const QVariant &entry) Store UserFileVersion21Upgrader::upgrade(const Store &map) { - return process(QVariant::fromValue(map)).value<Store>(); + return storeFromVariant(process(variantFromStore(map))); } QVariant UserFileVersion21Upgrader::process(const QVariant &entry) @@ -867,17 +867,17 @@ QVariant UserFileVersion21Upgrader::process(const QVariant &entry) case QVariant::List: return Utils::transform(entry.toList(), &UserFileVersion21Upgrader::process); case QVariant::Map: { - Store entryMap = entry.value<Store>(); + Store entryMap = storeFromVariant(entry); if (entryMap.value("ProjectExplorer.ProjectConfiguration.Id").toString() == "DeployToGenericLinux") { entryMap.insert("_checkMakeInstall", true); - return QVariant::fromValue(entryMap); + return variantFromStore(entryMap); } - Store map = entry.value<Store>(); + Store map = storeFromVariant(entry); Store result; for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) result.insert(it.key(), UserFileVersion21Upgrader::process(it.value())); - return QVariant::fromValue(result); + return variantFromStore(result); } default: return entry; @@ -898,7 +898,7 @@ public: TestUserFileAccessor(Project *project) : UserFileAccessor(project) { } void storeSharedSettings(const Store &data) const { m_storedSettings = data; } - QVariant retrieveSharedSettings() const override { return QVariant::fromValue(m_storedSettings); } + QVariant retrieveSharedSettings() const override { return variantFromStore(m_storedSettings); } using UserFileAccessor::preprocessReadSettings; using UserFileAccessor::prepareToWriteSettings; diff --git a/src/plugins/qnx/qnxsettingspage.cpp b/src/plugins/qnx/qnxsettingspage.cpp index 301bdec83b8..a4b2cb8c3dd 100644 --- a/src/plugins/qnx/qnxsettingspage.cpp +++ b/src/plugins/qnx/qnxsettingspage.cpp @@ -442,7 +442,7 @@ public: if (tmp.isEmpty()) continue; - data.insert(QNXConfigDataKey + Key::number(count), QVariant::fromValue(tmp)); + data.insert(QNXConfigDataKey + Key::number(count), variantFromStore(tmp)); ++count; } @@ -464,7 +464,7 @@ public: continue; QnxConfiguration config; - config.fromMap(data.value(key).value<Store>()); + config.fromMap(storeFromVariant(data.value(key))); m_configurations[config.m_envFile] = config; } } diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index d8cb2407fc1..8302045e674 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -187,7 +187,7 @@ static bool restoreQtVersions() if (!ok || count < 0) continue; - const Store qtversionMap = it.value().value<Store>(); + const Store qtversionMap = storeFromVariant(it.value()); const QString type = qtversionMap.value(QTVERSION_TYPE_KEY).toString(); bool restored = false; @@ -261,7 +261,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) if (!ok || count < 0) continue; - Store qtversionMap = it.value().value<Store>(); + Store qtversionMap = storeFromVariant(it.value()); const QString type = qtversionMap.value(QTVERSION_TYPE_KEY).toString(); const QString autoDetectionSource = qtversionMap.value("autodetectionSource").toString(); sdkVersions << autoDetectionSource; diff --git a/src/plugins/texteditor/codestylepool.cpp b/src/plugins/texteditor/codestylepool.cpp index 23b8aaccf8f..949b38ab336 100644 --- a/src/plugins/texteditor/codestylepool.cpp +++ b/src/plugins/texteditor/codestylepool.cpp @@ -208,7 +208,7 @@ ICodeStylePreferences *CodeStylePool::loadCodeStyle(const FilePath &fileName) if (m.contains(codeStyleDataKey)) { const QByteArray id = fileName.completeBaseName().toUtf8(); const QString displayName = reader.restoreValue(displayNameKey).toString(); - const Store map = reader.restoreValue(codeStyleDataKey).value<Store>(); + const Store map = storeFromVariant(reader.restoreValue(codeStyleDataKey)); if (d->m_factory) { codeStyle = d->m_factory->createCodeStyle(); codeStyle->setId(id); @@ -245,7 +245,7 @@ void CodeStylePool::exportCodeStyle(const FilePath &fileName, ICodeStylePreferen const Store map = codeStyle->toMap(); const Store tmp = { {displayNameKey, codeStyle->displayName()}, - {codeStyleDataKey, QVariant::fromValue(map)} + {codeStyleDataKey, variantFromStore(map)} }; PersistentSettingsWriter writer(fileName, QLatin1String(codeStyleDocKey)); writer.save(tmp, Core::ICore::dialogParent()); From 213b2e56987bf272267d7df61ef3fe86e39d4403 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 18 Aug 2023 08:08:46 +0200 Subject: [PATCH 0894/1777] TaskTree: Pretend TaskInterface::start() is protected for qdoc Otherwise, the docs are not shown. Task-number: QTBUG-114877 Change-Id: I0cc3e3890c57cd3c5970c0bc9f0350e9934748c5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: hjk <hjk@qt.io> --- src/libs/solutions/tasking/tasktree.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h index 29409a448b4..df26596d027 100644 --- a/src/libs/solutions/tasking/tasktree.h +++ b/src/libs/solutions/tasking/tasktree.h @@ -33,6 +33,9 @@ private: template <typename Task> friend class TaskAdapter; friend class TaskNode; TaskInterface() = default; +#ifdef Q_QDOC +protected: +#endif virtual void start() = 0; }; From 541719d443a9bb6f9dfc6a1d3f8dc8f753952a86 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 28 Aug 2023 12:08:29 +0200 Subject: [PATCH 0895/1777] TaskTree demo: Simplify task creation Change-Id: Ia47c6599e872a7400b521ca77b109ff369bdd836 Reviewed-by: hjk <hjk@qt.io> --- tests/manual/tasking/demo/main.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/manual/tasking/demo/main.cpp b/tests/manual/tasking/demo/main.cpp index 807def8e454..6ca092d21c3 100644 --- a/tests/manual/tasking/demo/main.cpp +++ b/tests/manual/tasking/demo/main.cpp @@ -170,13 +170,8 @@ int main(int argc, char *argv[]) widget->setState(State::Running); }; }; - if (widget->isSuccess()) { - return TimeoutTask(setupTask(widget), - [widget](const milliseconds &) { widget->setState(State::Done); }, - [widget](const milliseconds &) { widget->setState(State::Error); }); - } const Group root { - finishAllAndError, + widget->isSuccess() ? finishAllAndDone : finishAllAndError, TimeoutTask(setupTask(widget)), onGroupDone([widget] { widget->setState(State::Done); }), onGroupError([widget] { widget->setState(State::Error); }) From 4526e1908c0951f01e502392f5c3efc176b7f562 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 24 Aug 2023 12:48:37 +0200 Subject: [PATCH 0896/1777] Editor: remove duplicated path is empty checks when saving Change-Id: I1fdaacd44918a63e55bce9f15f3f80782ddcbe55 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/bineditor/bineditorplugin.cpp | 5 ++--- src/plugins/coreplugin/documentmanager.cpp | 2 +- .../coreplugin/editormanager/editormanager.cpp | 4 +--- src/plugins/coreplugin/idocument.cpp | 9 ++++++--- src/plugins/designer/formwindowfile.cpp | 13 ++++--------- src/plugins/modeleditor/modeldocument.cpp | 3 +-- src/plugins/resourceeditor/resourceeditorw.cpp | 7 +++---- src/plugins/scxmleditor/scxmleditordocument.cpp | 12 +++++------- src/plugins/squish/objectsmapdocument.cpp | 11 +++++------ src/plugins/texteditor/textdocument.cpp | 6 ++---- src/plugins/vcsbase/submiteditorfile.cpp | 5 ++--- 11 files changed, 32 insertions(+), 45 deletions(-) diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index bce951d6204..54b91401ad5 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -313,9 +313,8 @@ protected: bool saveImpl(QString *errorString, const Utils::FilePath &filePath, bool autoSave) override { QTC_ASSERT(!autoSave, return true); // bineditor does not support autosave - it would be a bit expensive - const FilePath &fileNameToUse = filePath.isEmpty() ? this->filePath() : filePath; - if (m_widget->save(errorString, this->filePath(), fileNameToUse)) { - setFilePath(fileNameToUse); + if (m_widget->save(errorString, this->filePath(), filePath)) { + setFilePath(filePath); return true; } return false; diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index 97667be0a67..6bd4554935e 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -721,7 +721,7 @@ bool DocumentManager::saveDocument(IDocument *document, bool addWatcher = removeDocument(document); // So that our own IDocument gets no notification at all QString errorString; - if (!document->save(&errorString, filePath, false)) { + if (!document->save(&errorString, savePath, false)) { if (isReadOnly) { QFile ofi(savePath.toString()); // Check whether the existing file is writable diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 245fc89ff6f..d9db4daaab6 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -2326,9 +2326,7 @@ bool EditorManagerPrivate::saveDocument(IDocument *document) document->checkPermissions(); - const QString fileName = document->filePath().toString(); - - if (fileName.isEmpty()) + if (document->filePath().isEmpty()) return saveDocumentAs(document); bool success = false; diff --git a/src/plugins/coreplugin/idocument.cpp b/src/plugins/coreplugin/idocument.cpp index 06218411b15..d16f284b4a4 100644 --- a/src/plugins/coreplugin/idocument.cpp +++ b/src/plugins/coreplugin/idocument.cpp @@ -326,6 +326,7 @@ IDocument::OpenResult IDocument::open(QString *errorString, const Utils::FilePat /*! Saves the contents of the document to the \a filePath on disk. + If \a filePath is empty filePath() is used. If \a autoSave is \c true, the saving is done for an auto-save, so the document should avoid cleanups or other operations that it does for @@ -340,13 +341,15 @@ IDocument::OpenResult IDocument::open(QString *errorString, const Utils::FilePat \sa shouldAutoSave() \sa aboutToSave() \sa saved() + \sa filePath() */ bool IDocument::save(QString *errorString, const Utils::FilePath &filePath, bool autoSave) { - emit aboutToSave(filePath.isEmpty() ? this->filePath() : filePath, autoSave); - const bool success = saveImpl(errorString, filePath, autoSave); + const Utils::FilePath savePath = filePath.isEmpty() ? this->filePath() : filePath; + emit aboutToSave(savePath, autoSave); + const bool success = saveImpl(errorString, savePath, autoSave); if (success) - emit saved(filePath.isEmpty() ? this->filePath() : filePath, autoSave); + emit saved(savePath, autoSave); return success; } diff --git a/src/plugins/designer/formwindowfile.cpp b/src/plugins/designer/formwindowfile.cpp index 7ab08540933..6923981e923 100644 --- a/src/plugins/designer/formwindowfile.cpp +++ b/src/plugins/designer/formwindowfile.cpp @@ -84,20 +84,15 @@ Core::IDocument::OpenResult FormWindowFile::open(QString *errorString, bool FormWindowFile::saveImpl(QString *errorString, const FilePath &filePath, bool autoSave) { - const FilePath &actualName = filePath.isEmpty() ? this->filePath() : filePath; - - if (Designer::Constants::Internal::debug) - qDebug() << Q_FUNC_INFO << filePath << "->" << actualName; - QTC_ASSERT(m_formWindow, return false); - if (actualName.isEmpty()) + if (filePath.isEmpty()) return false; const QString oldFormName = m_formWindow->fileName(); if (!autoSave) - m_formWindow->setFileName(actualName.toString()); - const bool writeOK = writeFile(actualName, errorString); + m_formWindow->setFileName(filePath.toString()); + const bool writeOK = writeFile(filePath, errorString); m_shouldAutoSave = false; if (autoSave) return writeOK; @@ -108,7 +103,7 @@ bool FormWindowFile::saveImpl(QString *errorString, const FilePath &filePath, bo } m_formWindow->setDirty(false); - setFilePath(actualName); + setFilePath(filePath); updateIsModified(); return true; diff --git a/src/plugins/modeleditor/modeldocument.cpp b/src/plugins/modeleditor/modeldocument.cpp index dc34acacf70..a1c271539c6 100644 --- a/src/plugins/modeleditor/modeldocument.cpp +++ b/src/plugins/modeleditor/modeldocument.cpp @@ -62,8 +62,7 @@ bool ModelDocument::saveImpl(QString *errorString, const Utils::FilePath &filePa return false; } - const Utils::FilePath actualName = filePath.isEmpty() ? this->filePath() : filePath; - d->documentController->projectController()->setFileName(actualName.toString()); + d->documentController->projectController()->setFileName(filePath.toString()); try { d->documentController->projectController()->save(); } catch (const qmt::Exception &ex) { diff --git a/src/plugins/resourceeditor/resourceeditorw.cpp b/src/plugins/resourceeditor/resourceeditorw.cpp index 3b49b92ae42..ddea065cadc 100644 --- a/src/plugins/resourceeditor/resourceeditorw.cpp +++ b/src/plugins/resourceeditor/resourceeditorw.cpp @@ -125,12 +125,11 @@ bool ResourceEditorDocument::saveImpl(QString *errorString, const FilePath &file if (debugResourceEditorW) qDebug() << ">ResourceEditorW::saveImpl: " << filePath; - const FilePath &actualName = filePath.isEmpty() ? this->filePath() : filePath; - if (actualName.isEmpty()) + if (filePath.isEmpty()) return false; m_blockDirtyChanged = true; - m_model->setFilePath(actualName); + m_model->setFilePath(filePath); if (!m_model->save()) { *errorString = m_model->errorMessage(); m_model->setFilePath(this->filePath()); @@ -146,7 +145,7 @@ bool ResourceEditorDocument::saveImpl(QString *errorString, const FilePath &file return true; } - setFilePath(actualName); + setFilePath(filePath); m_blockDirtyChanged = false; emit changed(); diff --git a/src/plugins/scxmleditor/scxmleditordocument.cpp b/src/plugins/scxmleditor/scxmleditordocument.cpp index 1459848800d..64907f8489a 100644 --- a/src/plugins/scxmleditor/scxmleditordocument.cpp +++ b/src/plugins/scxmleditor/scxmleditordocument.cpp @@ -60,26 +60,24 @@ Core::IDocument::OpenResult ScxmlEditorDocument::open(QString *errorString, bool ScxmlEditorDocument::saveImpl(QString *errorString, const FilePath &filePath, bool autoSave) { - const FilePath oldFileName = this->filePath(); - const FilePath actualName = filePath.isEmpty() ? oldFileName : filePath; - if (actualName.isEmpty()) + if (filePath.isEmpty()) return false; bool dirty = m_designWidget->isDirty(); - m_designWidget->setFileName(actualName.toString()); + m_designWidget->setFileName(filePath.toString()); if (!m_designWidget->save()) { *errorString = m_designWidget->errorMessage(); - m_designWidget->setFileName(oldFileName.toString()); + m_designWidget->setFileName(this->filePath().toString()); return false; } if (autoSave) { - m_designWidget->setFileName(oldFileName.toString()); + m_designWidget->setFileName(this->filePath().toString()); m_designWidget->save(); return true; } - setFilePath(actualName); + setFilePath(filePath); if (dirty != m_designWidget->isDirty()) emit changed(); diff --git a/src/plugins/squish/objectsmapdocument.cpp b/src/plugins/squish/objectsmapdocument.cpp index 7f2a050b290..20c77d9ccee 100644 --- a/src/plugins/squish/objectsmapdocument.cpp +++ b/src/plugins/squish/objectsmapdocument.cpp @@ -41,23 +41,22 @@ Core::IDocument::OpenResult ObjectsMapDocument::open(QString *errorString, } bool ObjectsMapDocument::saveImpl(QString *errorString, - const Utils::FilePath &fileName, + const Utils::FilePath &filePath, bool autoSave) { - const Utils::FilePath actual = fileName.isEmpty() ? filePath() : fileName; - if (actual.isEmpty()) + if (filePath.isEmpty()) return false; - const bool writeOk = writeFile(actual); + const bool writeOk = writeFile(filePath); if (!writeOk) { if (errorString) - *errorString = Tr::tr("Failed to write \"%1\"").arg(actual.toUserOutput()); + *errorString = Tr::tr("Failed to write \"%1\"").arg(filePath.toUserOutput()); return false; } if (!autoSave) { setModified(false); - setFilePath(actual); + setFilePath(filePath); } return true; } diff --git a/src/plugins/texteditor/textdocument.cpp b/src/plugins/texteditor/textdocument.cpp index 98a2ee663dc..ddc25d2a276 100644 --- a/src/plugins/texteditor/textdocument.cpp +++ b/src/plugins/texteditor/textdocument.cpp @@ -662,8 +662,6 @@ bool TextDocument::saveImpl(QString *errorString, const FilePath &filePath, bool cursor.endEditBlock(); } - const Utils::FilePath &savePath = filePath.isEmpty() ? this->filePath() : filePath; - // check if UTF8-BOM has to be added or removed Utils::TextFileFormat saveFormat = format(); if (saveFormat.codec->name() == "UTF-8" && supportsUtf8Bom()) { @@ -679,7 +677,7 @@ bool TextDocument::saveImpl(QString *errorString, const FilePath &filePath, bool } } - const bool ok = write(savePath, saveFormat, plainText(), errorString); + const bool ok = write(filePath, saveFormat, plainText(), errorString); // restore text cursor and scroll bar positions if (autoSave && undos < d->m_document.availableUndoSteps()) { @@ -702,7 +700,7 @@ bool TextDocument::saveImpl(QString *errorString, const FilePath &filePath, bool // inform about the new filename d->m_document.setModified(false); // also triggers update of the block revisions - setFilePath(savePath.absoluteFilePath()); + setFilePath(filePath.absoluteFilePath()); emit changed(); return true; } diff --git a/src/plugins/vcsbase/submiteditorfile.cpp b/src/plugins/vcsbase/submiteditorfile.cpp index 7d52d359a4c..8f2e6f0c953 100644 --- a/src/plugins/vcsbase/submiteditorfile.cpp +++ b/src/plugins/vcsbase/submiteditorfile.cpp @@ -69,14 +69,13 @@ void SubmitEditorFile::setModified(bool modified) bool SubmitEditorFile::saveImpl(QString *errorString, const FilePath &filePath, bool autoSave) { - const FilePath &fName = filePath.isEmpty() ? this->filePath() : filePath; - FileSaver saver(fName, QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text); + FileSaver saver(filePath, QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text); saver.write(m_editor->fileContents()); if (!saver.finalize(errorString)) return false; if (autoSave) return true; - setFilePath(fName.absoluteFilePath()); + setFilePath(filePath.absoluteFilePath()); setModified(false); if (!errorString->isEmpty()) return false; From 2e3b6fcf61996391a8066e91425593b8a9293844 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 28 Aug 2023 15:25:41 +0200 Subject: [PATCH 0897/1777] BareMetal: More Key/Store Change-Id: Id2b1744103f702ba4f743662b9ec25f8a437d276 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp index 2c24485c3d3..f7a28b573e7 100644 --- a/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/jlinkuvscserverprovider.cpp @@ -45,7 +45,7 @@ public: Port port = Port::SWD; Speed speed = Speed::Speed_1MHz; - QVariantMap toMap() const; + Store toMap() const; bool fromMap(const Store &data); bool operator==(const JLinkUvscAdapterOptions &other) const; }; @@ -122,9 +122,9 @@ static QString buildDllRegistryName(const DeviceSelection &device, // JLinkUvscAdapterOptions -QVariantMap JLinkUvscAdapterOptions::toMap() const +Store JLinkUvscAdapterOptions::toMap() const { - QVariantMap map; + Store map; map.insert(adapterPortKeyC, port); map.insert(adapterSpeedKeyC, speed); return map; From e6a1d6685efd611db03e4e7020fe131575852e01 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 28 Aug 2023 15:11:10 +0200 Subject: [PATCH 0898/1777] CompilerExplorer: More Key and Store Change-Id: I49a79e672915503359380e776b994e53b210eda9 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../compilerexploreraspects.h | 16 +++++++-------- .../compilerexplorereditor.cpp | 20 ++++++++++--------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.h b/src/plugins/compilerexplorer/compilerexploreraspects.h index b713a64e655..6796d088190 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.h +++ b/src/plugins/compilerexplorer/compilerexploreraspects.h @@ -84,14 +84,14 @@ public: : Utils::BaseAspect(container) {} - void fromMap(const QVariantMap &map) override + void fromMap(const Utils::Store &map) override { QTC_ASSERT(!settingsKey().isEmpty(), return); QVariantList list = map[settingsKey()].toList(); - for (const auto &entry : list) { + for (const QVariant &entry : list) { T item = m_createItem(); - m_toBaseAspect(item)->fromMap(entry.toMap()); + m_toBaseAspect(item)->fromMap(Utils::storeFromVariant(entry)); m_volatileItems.append(item); } m_items = m_volatileItems; @@ -103,13 +103,13 @@ public: const auto &items = v ? m_volatileItems : m_items; for (const auto &item : items) { - QVariantMap childMap; + Utils::Store childMap; if (v) m_toBaseAspect(item)->volatileToMap(childMap); else m_toBaseAspect(item)->toMap(childMap); - list.append(childMap); + list.append(Utils::variantFromStore(childMap)); } return list; @@ -118,14 +118,14 @@ public: void toMap(Utils::Store &map) const override { QTC_ASSERT(!settingsKey().isEmpty(), return); - const QString key = settingsKey(); + const Utils::Key key = settingsKey(); map[key] = toList(false); } void volatileToMap(Utils::Store &map) const override { QTC_ASSERT(!settingsKey().isEmpty(), return); - const QString key = settingsKey(); + const Utils::Key key = settingsKey(); map[key] = toList(true); } @@ -191,7 +191,7 @@ public: return false; } - QVariant volatileVariantValue() const override { return {}; }; + QVariant volatileVariantValue() const override { return {}; } private: QList<T> m_items; diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 45d19e358cc..992ce65f9be 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -44,6 +44,7 @@ using namespace std::chrono_literals; using namespace Aggregation; using namespace TextEditor; +using namespace Utils; namespace CompilerExplorer { @@ -51,7 +52,8 @@ class CodeEditorWidget : public TextEditorWidget { public: CodeEditorWidget(const std::shared_ptr<SourceSettings> &settings) - : m_settings(settings){}; + : m_settings(settings) + {} void updateHighlighter() { @@ -94,8 +96,8 @@ JsonSettingsDocument::JsonSettingsDocument() JsonSettingsDocument::~JsonSettingsDocument() {} Core::IDocument::OpenResult JsonSettingsDocument::open(QString *errorString, - const Utils::FilePath &filePath, - const Utils::FilePath &realFilePath) + const FilePath &filePath, + const FilePath &realFilePath) { if (!filePath.isReadableFile()) return OpenResult::ReadError; @@ -121,16 +123,16 @@ Core::IDocument::OpenResult JsonSettingsDocument::open(QString *errorString, return OpenResult::CannotHandle; } - m_ceSettings.fromMap(doc.toVariant().toMap()); + m_ceSettings.fromMap(storeFromVariant(doc.toVariant().toMap())); emit settingsChanged(); return OpenResult::Success; } bool JsonSettingsDocument::saveImpl(QString *errorString, - const Utils::FilePath &newFilePath, + const FilePath &newFilePath, bool autoSave) { - QVariantMap map; + Store map; if (autoSave) { if (m_windowStateCallback) @@ -145,7 +147,7 @@ bool JsonSettingsDocument::saveImpl(QString *errorString, m_ceSettings.toMap(map); } - QJsonDocument doc = QJsonDocument::fromVariant(map); + QJsonDocument doc = QJsonDocument::fromVariant(variantFromStore(map)); Utils::FilePath path = newFilePath.isEmpty() ? filePath() : newFilePath; @@ -174,7 +176,7 @@ bool JsonSettingsDocument::setContents(const QByteArray &contents) QTC_ASSERT(doc.isObject(), return false); - m_ceSettings.fromMap(doc.toVariant().toMap()); + m_ceSettings.fromMap(storeFromVariant(doc.toVariant())); emit settingsChanged(); return true; @@ -241,7 +243,7 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett , m_compilerSettings(compilerSettings) { using namespace Layouting; - QVariantMap map; + Store map; m_delayTimer = new QTimer(this); m_delayTimer->setSingleShot(true); From edee2afe11b18a3a8be3a944044e20c1db09669f Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 25 Aug 2023 15:54:24 +0200 Subject: [PATCH 0899/1777] QtSupport: Load examples / tutorials only when visible This speeds up QtCreator startup a bit by not loading the examples all the time, but only when the user clicks on the "Examples" button. Change-Id: I8fb3656e871cf3f2f884c5eb12270eba427cd999 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/qtsupport/exampleslistmodel.cpp | 20 +++++++++++++++++++ src/plugins/qtsupport/exampleslistmodel.h | 4 ++++ .../qtsupport/gettingstartedwelcomepage.cpp | 15 +++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 5ebf5ed02c8..dc71d42cbb8 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -342,6 +342,12 @@ Q_GLOBAL_STATIC_WITH_ARGS(QStringList, void ExamplesViewController::updateExamples() { + if (!isVisible()) { + m_needsUpdateExamples = true; + return; + } + m_needsUpdateExamples = false; + QString examplesInstallPath; QString demosInstallPath; QVersionNumber qtVersion; @@ -395,6 +401,20 @@ void ExamplesViewController::updateExamples() } } +void ExamplesViewController::setVisible(bool visible) +{ + if (m_isVisible == visible) + return; + m_isVisible = visible; + if (m_isVisible && m_needsUpdateExamples) + updateExamples(); +} + +bool ExamplesViewController::isVisible() const +{ + return m_isVisible; +} + void ExampleSetModel::updateQtVersionList() { QtVersions versions = QtVersionManager::sortVersions(QtVersionManager::versions( diff --git a/src/plugins/qtsupport/exampleslistmodel.h b/src/plugins/qtsupport/exampleslistmodel.h index 00b87068a84..dfd92739abe 100644 --- a/src/plugins/qtsupport/exampleslistmodel.h +++ b/src/plugins/qtsupport/exampleslistmodel.h @@ -92,11 +92,15 @@ public: QObject *parent); void updateExamples(); + void setVisible(bool isVisible); + bool isVisible() const; private: ExampleSetModel *m_exampleSetModel; Core::SectionedGridView *m_view; bool m_isExamples; + bool m_isVisible = false; + bool m_needsUpdateExamples = false; }; } // namespace Internal diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index 5e0292c7575..b6f42fb8d1f 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp @@ -304,7 +304,7 @@ public: grid->addWidget(WelcomePageHelpers::panelBar(this), 0, 2); auto gridView = new SectionedGridView(this); - new ExamplesViewController(s_exampleSetModel, gridView, isExamples, this); + m_viewController = new ExamplesViewController(s_exampleSetModel, gridView, isExamples, this); gridView->setItemDelegate(&m_exampleDelegate); grid->addWidget(gridView, 1, 1, 1, 2); @@ -321,9 +321,22 @@ public: + QString("tag:\"%1\" ").arg(tag)); } + void showEvent(QShowEvent *event) override + { + m_viewController->setVisible(true); + QWidget::showEvent(event); + } + + void hideEvent(QHideEvent *event) override + { + m_viewController->setVisible(false); + QWidget::hideEvent(event); + } + const bool m_isExamples; ExampleDelegate m_exampleDelegate; QLineEdit *m_searcher; + ExamplesViewController *m_viewController = nullptr; }; QWidget *ExamplesWelcomePage::createWidget() const From db49f3af71876992104ff4022a1b82efd3560542 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 28 Aug 2023 12:30:03 +0200 Subject: [PATCH 0900/1777] QtSupport: Avoid an unneeded update of examples When starting Qt Creator with the examples page visible. Avoid emitting the selectedExampleSetChanged signal twice in a row, but guarantee it once. Change-Id: I6a2c4032a53d531a8e7d2ac612e88d4b4bdbb6b5 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/qtsupport/exampleslistmodel.cpp | 8 +++++--- src/plugins/qtsupport/exampleslistmodel.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index dc71d42cbb8..0def03b90b6 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -450,8 +450,8 @@ void ExampleSetModel::updateQtVersionList() // Make sure to select something even if the above failed if (currentIndex < 0 && rowCount() > 0) currentIndex = 0; // simply select first - selectExampleSet(currentIndex); - emit selectedExampleSetChanged(currentIndex); + if (!selectExampleSet(currentIndex)) + emit selectedExampleSetChanged(currentIndex); // ensure running updateExamples in any case } QtVersion *ExampleSetModel::findHighestQtVersion(const QtVersions &versions) const @@ -534,7 +534,7 @@ QStringList ExampleSetModel::exampleSources(QString *examplesInstallPath, return sources; } -void ExampleSetModel::selectExampleSet(int index) +bool ExampleSetModel::selectExampleSet(int index) { if (index != m_selectedExampleSetIndex) { m_selectedExampleSetIndex = index; @@ -546,7 +546,9 @@ void ExampleSetModel::selectExampleSet(int index) m_selectedQtTypes.clear(); } emit selectedExampleSetChanged(m_selectedExampleSetIndex); + return true; } + return false; } void ExampleSetModel::qtVersionManagerLoaded() diff --git a/src/plugins/qtsupport/exampleslistmodel.h b/src/plugins/qtsupport/exampleslistmodel.h index dfd92739abe..9aa1ddba529 100644 --- a/src/plugins/qtsupport/exampleslistmodel.h +++ b/src/plugins/qtsupport/exampleslistmodel.h @@ -38,7 +38,7 @@ public: ExampleSetModel(); int selectedExampleSet() const { return m_selectedExampleSetIndex; } - void selectExampleSet(int index); + bool selectExampleSet(int index); QStringList exampleSources(QString *examplesInstallPath, QString *demosInstallPath, QVersionNumber *qtVersion); From b80cef815efccc3a9e949686afe71bc7a1ca0d48 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 17 Aug 2023 16:34:36 +0200 Subject: [PATCH 0901/1777] DAP: Fix rootWatchItem deletion Change-Id: I2fcdf7547a361dcb136cd1a03325e7f5186b273a Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/dapengine.cpp | 25 +++++++++---------------- src/plugins/debugger/dap/dapengine.h | 6 +++--- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 6b2bb5d6e7d..6be4aec835f 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -64,17 +64,6 @@ static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg) namespace Debugger::Internal { -DapEngine::DapEngine() -{ - m_rootWatchItem = new WatchItem(); - m_currentWatchItem = m_rootWatchItem; -} - -DapEngine::~DapEngine() -{ - delete m_rootWatchItem; -} - void DapEngine::executeDebuggerCommand(const QString &/*command*/) { QTC_ASSERT(state() == InferiorStopOk, qCDebug(dapEngineLog) << state()); @@ -558,8 +547,6 @@ void DapEngine::handleScopesResponse(const QJsonObject &response) const int variablesReference = scope.toObject().value("variablesReference").toInt(); qCDebug(dapEngineLog) << "scoped success" << name << variablesReference; if (name == "Locals") { // Fix for several scopes - m_rootWatchItem = new WatchItem(); - m_currentWatchItem = m_rootWatchItem; watchHandler()->removeAllData(); watchHandler()->notifyUpdateStarted(); m_dapClient->variables(variablesReference); @@ -701,6 +688,7 @@ void DapEngine::handleBreakpointEvent(const QJsonObject &event) void DapEngine::refreshLocals(const QJsonArray &variables) { + bool isFirstLayer = m_watchItems.isEmpty(); for (auto variable : variables) { WatchItem *item = new WatchItem; const QString name = variable.toObject().value("name").toString(); @@ -712,7 +700,10 @@ void DapEngine::refreshLocals(const QJsonArray &variables) item->type = variable.toObject().value("type").toString(); qCDebug(dapEngineLog) << "variable" << name << item->hexAddress(); - m_currentWatchItem->appendChild(item); + if (isFirstLayer) + m_watchItems.append(item); + else + m_currentWatchItem->appendChild(item); const int variablesReference = variable.toObject().value("variablesReference").toInt(); if (variablesReference > 0) @@ -720,8 +711,10 @@ void DapEngine::refreshLocals(const QJsonArray &variables) } if (m_variablesReferenceQueue.empty()) { - for (auto item = m_rootWatchItem->begin(); item != m_rootWatchItem->end(); ++item) - watchHandler()->insertItem(*item); + for (auto item : m_watchItems) + watchHandler()->insertItem(item); + m_watchItems.clear(); + watchHandler()->notifyUpdateFinished(); return; } diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index adcfa807fe3..b8ad63aab0a 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -26,8 +26,8 @@ enum class DapEventType; class DapEngine : public DebuggerEngine { public: - DapEngine(); - ~DapEngine() override; + DapEngine() = default; + ~DapEngine() override = default; protected: void executeStepIn(bool) override; @@ -115,7 +115,7 @@ protected: std::queue<std::pair<int, WatchItem *>> m_variablesReferenceQueue; WatchItem *m_currentWatchItem = nullptr; - WatchItem *m_rootWatchItem = nullptr; + QList<WatchItem *> m_watchItems; }; } // Debugger::Internal From d304e82e63447ba9393332cd6e2b919c9c602bfa Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Fri, 18 Aug 2023 15:17:11 +0200 Subject: [PATCH 0902/1777] DAP: Add engine chooser The Engine Chooser empowers users to select the desired debugging engine when initiating DAP debugging sessions. Change-Id: I070ff2620b318494ee715c5ac369765d4a9dc616 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/debugger/dap/cmakedapengine.cpp | 3 +- src/plugins/debugger/dap/gdbdapengine.cpp | 16 +- src/plugins/debugger/debuggerconstants.h | 1 - src/plugins/debugger/debuggerengine.cpp | 14 +- src/plugins/debugger/debuggerengine.h | 3 + .../debugger/debuggerinternalconstants.h | 2 +- src/plugins/debugger/debuggeritem.cpp | 5 - src/plugins/debugger/debuggeritemmanager.cpp | 8 - src/plugins/debugger/debuggerkitaspect.cpp | 7 + src/plugins/debugger/debuggerkitaspect.h | 1 + src/plugins/debugger/debuggerplugin.cpp | 106 +++++---- src/plugins/debugger/debuggerruncontrol.cpp | 7 +- src/plugins/debugger/enginemanager.cpp | 212 +++++++++++++++--- src/plugins/debugger/enginemanager.h | 9 + .../projectexplorerconstants.h | 1 + 15 files changed, 300 insertions(+), 95 deletions(-) diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp index 696fff10040..4a4e0fe59ef 100644 --- a/src/plugins/debugger/dap/cmakedapengine.cpp +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -93,7 +93,8 @@ CMakeDapEngine::CMakeDapEngine() : DapEngine() { setObjectName("CmakeDapEngine"); - setDebuggerName("CmakeDAP"); + setDebuggerName("Cmake"); + setDebuggerType("DAP"); } void CMakeDapEngine::setupEngine() diff --git a/src/plugins/debugger/dap/gdbdapengine.cpp b/src/plugins/debugger/dap/gdbdapengine.cpp index 10eabd22c56..213d38f0d82 100644 --- a/src/plugins/debugger/dap/gdbdapengine.cpp +++ b/src/plugins/debugger/dap/gdbdapengine.cpp @@ -5,6 +5,8 @@ #include "dapclient.h" +#include <coreplugin/messagemanager.h> + #include <debugger/debuggermainwindow.h> #include <utils/temporarydirectory.h> @@ -16,6 +18,7 @@ #include <QDebug> #include <QLocalSocket> #include <QLoggingCategory> +#include <QVersionNumber> using namespace Core; using namespace Utils; @@ -82,7 +85,8 @@ GdbDapEngine::GdbDapEngine() : DapEngine() { setObjectName("GdbDapEngine"); - setDebuggerName("GdbDAP"); + setDebuggerName("Gdb"); + setDebuggerType("DAP"); } void GdbDapEngine::setupEngine() @@ -92,6 +96,16 @@ void GdbDapEngine::setupEngine() const DebuggerRunParameters &rp = runParameters(); const CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}}; + QVersionNumber oldestVersion(14, 0, 50); + QVersionNumber version = QVersionNumber::fromString(rp.version); + if (version < oldestVersion) { + notifyEngineSetupFailed(); + MessageManager::writeDisrupting("Debugger version " + rp.version + + " is too old. Please upgrade to at least " + + oldestVersion.toString()); + return; + } + IDataProvider *dataProvider = new ProcessDataProvider(rp, cmd, this); m_dapClient = new DapClient(dataProvider, this); diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index 06ccb94f1b9..b071713a844 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -99,7 +99,6 @@ enum DebuggerEngineType CdbEngineType = 0x004, PdbEngineType = 0x008, LldbEngineType = 0x100, - DapEngineType = 0x200, UvscEngineType = 0x1000 }; diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 48d4a938cea..ea8ed9b214a 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -440,6 +440,7 @@ public: DebuggerEngine *m_engine = nullptr; // Not owned. QString m_runId; QString m_debuggerName; + QString m_debuggerType; QPointer<Perspective> m_perspective; DebuggerRunParameters m_runParameters; IDevice::ConstPtr m_device; @@ -728,6 +729,8 @@ void DebuggerEnginePrivate::setupViews() if (!currentPerspective || currentPerspective->id() == Constants::PRESET_PERSPECTIVE_ID) m_perspective->useSubPerspectiveSwitcher(EngineManager::engineChooser()); + else + m_perspective->useSubPerspectiveSwitcher(EngineManager::dapEngineChooser()); m_perspective->addToolBarAction(&m_continueAction); m_perspective->addToolBarAction(&m_interruptAction); @@ -872,6 +875,16 @@ QString DebuggerEngine::debuggerName() const return d->m_debuggerName; } +void DebuggerEngine::setDebuggerType(const QString &type) +{ + d->m_debuggerType = type; +} + +QString DebuggerEngine::debuggerType() const +{ + return d->m_debuggerType; +} + QString DebuggerEngine::stateName(int s) { # define SN(x) case x: return QLatin1String(#x); @@ -2590,7 +2603,6 @@ bool DebuggerRunParameters::isCppDebugging() const return cppEngineType == GdbEngineType || cppEngineType == LldbEngineType || cppEngineType == CdbEngineType - || cppEngineType == DapEngineType || cppEngineType == UvscEngineType; } diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index a1eb1091d71..c1b6cfc630f 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -146,6 +146,7 @@ public: QString additionalStartupCommands; DebuggerEngineType cppEngineType = NoEngineType; + QString version; bool isQmlDebugging = false; bool breakOnMain = false; @@ -451,6 +452,7 @@ public: void updateLocalsWindow(bool showReturn); void raiseWatchersWindow(); QString debuggerName() const; + QString debuggerType() const; bool isRegistersWindowVisible() const; bool isPeripheralRegistersWindowVisible() const; @@ -493,6 +495,7 @@ public: protected: void setDebuggerName(const QString &name); + void setDebuggerType(const QString &type); void notifyDebuggerProcessFinished(const Utils::ProcessResultData &resultData, const QString &backendName); diff --git a/src/plugins/debugger/debuggerinternalconstants.h b/src/plugins/debugger/debuggerinternalconstants.h index 035371498a3..dcb696d3d05 100644 --- a/src/plugins/debugger/debuggerinternalconstants.h +++ b/src/plugins/debugger/debuggerinternalconstants.h @@ -41,7 +41,7 @@ const char C_QMLDEBUGGER[] = "Qml/JavaScript Debugger"; const char C_DEBUGGER_NOTRUNNING[] = "Debugger.NotRunning"; const char PRESET_PERSPECTIVE_ID[] = "Debugger.Perspective.Preset"; -const char CMAKE_PERSPECTIVE_ID[] = "CMakeDebugger"; +const char DAP_PERSPECTIVE_ID[] = "DAPDebugger"; const char TASK_CATEGORY_DEBUGGER_RUNTIME[] = "DebugRuntime"; diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index c80ce3deb17..0a92525beb3 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -177,9 +177,6 @@ void DebuggerItem::reinitializeFromFile(QString *error, Utils::Environment *cust if (output.contains("gdb")) { m_engineType = GdbEngineType; - // FIXME: HACK while introducing DAP support - if (m_command.fileName().endsWith("-dap")) - m_engineType = DapEngineType; // Version bool isMacGdb, isQnxGdb; @@ -283,8 +280,6 @@ QString DebuggerItem::engineTypeName() const return QLatin1String("CDB"); case LldbEngineType: return QLatin1String("LLDB"); - case DapEngineType: - return QLatin1String("DAP"); case UvscEngineType: return QLatin1String("UVSC"); default: diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index ebf70c4fdd0..4948ef4a559 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -665,14 +665,6 @@ void DebuggerItemModel::autoDetectGdbOrLldbDebuggers(const FilePaths &searchPath item.setUnexpandedDisplayName(name.arg(item.engineTypeName()).arg(command.toUserOutput())); addDebuggerItem(item); logMessages.append(Tr::tr("Found: \"%1\"").arg(command.toUserOutput())); - - if (item.engineType() == GdbEngineType) { - if (item.version().startsWith("GNU gdb (GDB) 14.0.50.2023")) { - // FIXME: Use something more robust - item.setEngineType(DapEngineType); - addDebuggerItem(item); - } - } } if (logMessage) *logMessage = logMessages.join('\n'); diff --git a/src/plugins/debugger/debuggerkitaspect.cpp b/src/plugins/debugger/debuggerkitaspect.cpp index 54548ced074..36fac323035 100644 --- a/src/plugins/debugger/debuggerkitaspect.cpp +++ b/src/plugins/debugger/debuggerkitaspect.cpp @@ -248,6 +248,13 @@ QString DebuggerKitAspect::displayString(const Kit *k) return binary.isEmpty() ? Tr::tr("%1 <None>").arg(name) : Tr::tr("%1 using \"%2\"").arg(name, binary); } +QString DebuggerKitAspect::version(const Kit *k) +{ + const DebuggerItem *item = debugger(k); + QTC_ASSERT(item, return {}); + return item->version(); +} + void DebuggerKitAspect::setDebugger(Kit *k, const QVariant &id) { // Only register reasonably complete debuggers. diff --git a/src/plugins/debugger/debuggerkitaspect.h b/src/plugins/debugger/debuggerkitaspect.h index 9a8e12f95b1..fdfcdf2bd8e 100644 --- a/src/plugins/debugger/debuggerkitaspect.h +++ b/src/plugins/debugger/debuggerkitaspect.h @@ -33,6 +33,7 @@ public: static void setDebugger(ProjectExplorer::Kit *k, const QVariant &id); static DebuggerEngineType engineType(const ProjectExplorer::Kit *k); static QString displayString(const ProjectExplorer::Kit *k); + static QString version(const ProjectExplorer::Kit *k); static Utils::Id id(); }; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index bd5f72f6cec..eb09b70d002 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -105,20 +105,21 @@ #include <QFileDialog> #include <QHeaderView> #include <QInputDialog> +#include <QJsonDocument> +#include <QJsonObject> #include <QMenu> #include <QMessageBox> #include <QPointer> #include <QPushButton> #include <QScopeGuard> #include <QSettings> +#include <QSortFilterProxyModel> #include <QStackedWidget> #include <QTextBlock> #include <QToolButton> #include <QTreeWidget> #include <QVBoxLayout> #include <QVariant> -#include <QJsonDocument> -#include <QJsonObject> #ifdef WITH_TESTS @@ -509,6 +510,7 @@ public: splitter->setObjectName("DebugModeWidget"); mainWindow->addSubPerspectiveSwitcher(EngineManager::engineChooser()); + mainWindow->addSubPerspectiveSwitcher(EngineManager::dapEngineChooser()); setWidget(splitter); @@ -616,12 +618,14 @@ public: const QString &title, const QString &objectName); - BaseTreeView *createEngineManagerView(const QString &title, const QByteArray &settingsKey); + BaseTreeView *createEngineManagerView(QAbstractItemModel *model, + const QString &title, + const QByteArray &settingsKey); QWidget *createEngineManagerWindow(BaseTreeView *engineManagerView, const QString &title, const QString &objectName); - void createCMakeDebuggerPerspective(QWidget *globalLogWindow); + void createDapDebuggerPerspective(QWidget *globalLogWindow); void editorOpened(IEditor *editor); void updateBreakMenuItem(IEditor *editor); @@ -668,7 +672,7 @@ public: ProxyAction m_hiddenStopAction; QAction m_undisturbableAction; OptionalAction m_startAction; - OptionalAction m_startCmakeAction; + OptionalAction m_startDapAction; QAction m_debugWithoutDeployAction{Tr::tr("Start Debugging Without Deployment")}; QAction m_startAndDebugApplicationAction{Tr::tr("Start and Debug External Application...")}; QAction m_attachToRunningApplication{Tr::tr("Attach to Running Application...")}; @@ -699,7 +703,7 @@ public: IContext m_debugModeContext; Perspective m_perspective{Constants::PRESET_PERSPECTIVE_ID, Tr::tr("Debugger")}; - std::unique_ptr<Perspective> m_perspectiveCmake; + Perspective m_perspectiveDap{Constants::DAP_PERSPECTIVE_ID, Tr::tr("DAP")}; DebuggerRunWorkerFactory debuggerWorkerFactory; @@ -761,13 +765,15 @@ QWidget *DebuggerPluginPrivate::createBreakpointManagerWindow(BaseTreeView *brea return breakpointManagerWindow; } -BaseTreeView *DebuggerPluginPrivate::createEngineManagerView(const QString &title, const QByteArray &settingsKey) +BaseTreeView *DebuggerPluginPrivate::createEngineManagerView(QAbstractItemModel *model, + const QString &title, + const QByteArray &settingsKey) { auto engineManagerView = new BaseTreeView; engineManagerView->setWindowTitle(title); engineManagerView->setSettings(ICore::settings(), settingsKey); engineManagerView->setIconSize(QSize(10, 10)); - engineManagerView->setModel(EngineManager::model()); + engineManagerView->setModel(model); engineManagerView->setSelectionMode(QAbstractItemView::SingleSelection); engineManagerView->enableColumnHiding(); return engineManagerView; @@ -858,7 +864,8 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) "Debugger.Docks.BreakpointManager"); // Snapshot - auto engineManagerView = createEngineManagerView(Tr::tr("Running Debuggers"), + auto engineManagerView = createEngineManagerView(EngineManager::model(), + Tr::tr("Running Debuggers"), "Debugger.SnapshotView"); auto engineManagerWindow = createEngineManagerWindow(engineManagerView, Tr::tr("Debugger Perspectives"), @@ -877,11 +884,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE, false); }); - connect(&m_startCmakeAction, &QAction::triggered, this, [] { - ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE, - true); - }); - connect(&m_debugWithoutDeployAction, &QAction::triggered, this, [] { ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE, true); }); @@ -1214,6 +1216,10 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) connect(settings().settingsDialog.action(), &QAction::triggered, this, [] { ICore::showOptionsDialog(DEBUGGER_COMMON_SETTINGS_ID); }, Qt::QueuedConnection); + EngineManager::registerDefaultPerspective(Tr::tr("Debugger Preset"), + {}, + Constants::PRESET_PERSPECTIVE_ID); + m_perspective.useSubPerspectiveSwitcher(EngineManager::engineChooser()); m_perspective.addToolBarAction(&m_startAction); @@ -1221,7 +1227,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) m_perspective.addWindow(breakpointManagerWindow, Perspective::SplitHorizontal, engineManagerWindow); m_perspective.addWindow(globalLogWindow, Perspective::AddToTab, nullptr, false, Qt::TopDockWidgetArea); - createCMakeDebuggerPerspective(globalLogWindow); + createDapDebuggerPerspective(globalLogWindow); setInitialState(); connect(ProjectManager::instance(), &ProjectManager::startupProjectChanged, @@ -1232,42 +1238,62 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) this, &DebuggerPluginPrivate::updatePresetState); } -void DebuggerPluginPrivate::createCMakeDebuggerPerspective(QWidget *globalLogWindow) +void DebuggerPluginPrivate::createDapDebuggerPerspective(QWidget *globalLogWindow) { - auto breakpointManagerView = createBreakpointManagerView("CMake.BreakWindow"); + EngineManager::registerDefaultPerspective(Tr::tr("CMake Preset"), + "DAP", + ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE); + + EngineManager::registerDefaultPerspective(Tr::tr("GDB Preset"), + "DAP", + ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE); + + auto breakpointManagerView = createBreakpointManagerView("DAPDebugger.BreakWindow"); auto breakpointManagerWindow = createBreakpointManagerWindow(breakpointManagerView, - Tr::tr("CMake Breakpoint Preset"), - "CMake.Docks.BreakpointManager"); + Tr::tr("DAP Breakpoint Preset"), + "DAPDebugger.Docks.BreakpointManager"); // Snapshot - auto engineManagerView = createEngineManagerView(Tr::tr("Running Debuggers"), - "CMake.SnapshotView"); + auto engineManagerView = createEngineManagerView(EngineManager::dapModel(), + Tr::tr("Running Debuggers"), + "DAPDebugger.SnapshotView"); auto engineManagerWindow = createEngineManagerWindow(engineManagerView, - Tr::tr("CMake Debugger Perspectives"), - "CMake.Docks.Snapshots"); + Tr::tr("DAP Debugger Perspectives"), + "DAPDebugger.Docks.Snapshots"); - m_perspectiveCmake = std::make_unique<Perspective>(Constants::CMAKE_PERSPECTIVE_ID, - Tr::tr("CMake")); - m_startCmakeAction.setText(Tr::tr("Start CMake Debugging")); - m_startCmakeAction.setEnabled(true); - m_startCmakeAction.setIcon(startIcon(true)); - m_startCmakeAction.setVisible(true); + connect(&m_startDapAction, &QAction::triggered, this, [] { + QComboBox *combo = qobject_cast<QComboBox *>(EngineManager::dapEngineChooser()); + if (combo->currentText() == "CMake Preset") { + ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE, + true); + } else { + ProjectExplorerPlugin::runStartupProject( + ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE, true); + } + }); - m_perspectiveCmake->addToolBarAction(&m_startCmakeAction); + m_startDapAction.setToolTip(Tr::tr("Start DAP Debugging")); + m_startDapAction.setText(Tr::tr("Start DAP Debugging")); + m_startDapAction.setEnabled(true); + m_startDapAction.setIcon(startIcon(true)); + m_startDapAction.setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + m_startDapAction.setVisible(true); - m_perspectiveCmake->addWindow(engineManagerWindow, Perspective::SplitVertical, nullptr); - m_perspectiveCmake->addWindow(breakpointManagerWindow, - Perspective::SplitHorizontal, - engineManagerWindow); - m_perspectiveCmake->addWindow(globalLogWindow, - Perspective::AddToTab, - nullptr, - false, - Qt::TopDockWidgetArea); + m_perspectiveDap.useSubPerspectiveSwitcher(EngineManager::dapEngineChooser()); + m_perspectiveDap.addToolBarAction(&m_startDapAction); + + m_perspectiveDap.addWindow(engineManagerWindow, Perspective::SplitVertical, nullptr); + m_perspectiveDap.addWindow(breakpointManagerWindow, + Perspective::SplitHorizontal, + engineManagerWindow); + m_perspectiveDap.addWindow(globalLogWindow, + Perspective::AddToTab, + nullptr, + false, + Qt::TopDockWidgetArea); } - DebuggerPluginPrivate::~DebuggerPluginPrivate() { qDeleteAll(m_optionPages); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index d9c15776a47..9110ae1fdba 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -484,6 +484,8 @@ void DebuggerRunTool::start() if (!m_engine) { if (runControl()->runMode() == ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE) m_engine = createDapEngine(runControl()->runMode()); + else if (runControl()->runMode() == ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE) + m_engine = createDapEngine(); else if (m_runParameters.isCppDebugging()) { switch (m_runParameters.cppEngineType) { case GdbEngineType: @@ -506,9 +508,6 @@ void DebuggerRunTool::start() case UvscEngineType: m_engine = createUvscEngine(); break; - case DapEngineType: - m_engine = createDapEngine(); - break; default: if (!m_runParameters.isQmlDebugging) { reportFailure(noEngineMessage() + '\n' + @@ -856,6 +855,7 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm m_runParameters.macroExpander = runControl->macroExpander(); m_runParameters.debugger = DebuggerKitAspect::runnable(kit); m_runParameters.cppEngineType = DebuggerKitAspect::engineType(kit); + m_runParameters.version = DebuggerKitAspect::version(kit); if (QtSupport::QtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion(kit)) { m_runParameters.qtPackageSourceLocation = qtVersion->qtPackageSourcePath().toString(); @@ -1121,6 +1121,7 @@ DebuggerRunWorkerFactory::DebuggerRunWorkerFactory() setProduct<DebuggerRunTool>(); addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE); addSupportedRunMode(ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE); + addSupportedRunMode(ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE); addSupportedDeviceType(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE); addSupportedDeviceType("DockerDeviceType"); } diff --git a/src/plugins/debugger/enginemanager.cpp b/src/plugins/debugger/enginemanager.cpp index dd86517c23f..5b6fb74ac49 100644 --- a/src/plugins/debugger/enginemanager.cpp +++ b/src/plugins/debugger/enginemanager.cpp @@ -17,9 +17,11 @@ #include <utils/treemodel.h> #include <utils/qtcassert.h> +#include <QAbstractProxyModel> #include <QComboBox> #include <QDebug> #include <QMenu> +#include <QSortFilterProxyModel> #include <QTimer> using namespace Core; @@ -93,6 +95,108 @@ QDebug operator<<(QDebug d, const SnapshotData &f) } #endif +class EngineTypeFilterProxyModel : public QSortFilterProxyModel +{ +public: + explicit EngineTypeFilterProxyModel(const QString &type, QObject *parent = nullptr) + : QSortFilterProxyModel(parent) + , m_type(type) + { + } + +protected: + bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override + { + QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); + if (index.isValid()) { + QVariant data = sourceModel()->data(index, Qt::UserRole); + if (data.isValid() && data.toString() == m_type) { + return true; // Display only DapEngines + } + } + return false; + } +private: + QString m_type; +}; + +class ModelChooser : public QObject +{ + Q_OBJECT +public: + ModelChooser(QAbstractItemModel *sourceModel, + const QString &enginType, + QObject *parent = nullptr) + : QObject(parent) + , m_engineChooser(new QComboBox()) + , m_proxyModel(new EngineTypeFilterProxyModel(enginType)) + , m_sourceModel(sourceModel) + , m_enginType(enginType) + { + m_proxyModel->setSourceModel(sourceModel); + + m_engineChooser->setModel(m_proxyModel); + m_engineChooser->setIconSize(QSize(0, 0)); + if (hideSwitcherUnlessNeeded) + m_engineChooser->hide(); + + connect(m_engineChooser, &QComboBox::activated, this, [this](int index) { + QModelIndex sourceIndex = m_proxyModel->mapToSource(m_proxyModel->index(index, 0)); + emit activated(sourceIndex.row()); + }); + } + + ~ModelChooser() + { + delete m_engineChooser; + delete m_proxyModel; + } + + QComboBox *comboBox() const { return m_engineChooser; } + QAbstractItemModel *model() const { return m_proxyModel; } + const QString &engineType() const { return m_enginType; } + + void setCurrentIndex(int index) + { + const QModelIndex sourceIndex = m_proxyModel->mapFromSource(m_sourceModel->index(index, 0)); + if (sourceIndex.isValid()) + m_engineChooser->setCurrentIndex(sourceIndex.row()); + else + m_engineChooser->setCurrentIndex(0); + } + + void adjustUiForEngine(int row) + { + setCurrentIndex(row); + + const int contentWidth = m_engineChooser->fontMetrics().horizontalAdvance( + m_engineChooser->currentText() + "xx"); + QStyleOptionComboBox option; + option.initFrom(m_engineChooser); + const QSize sz(contentWidth, 1); + const int width = m_engineChooser->style() + ->sizeFromContents(QStyle::CT_ComboBox, &option, sz) + .width(); + m_engineChooser->setFixedWidth(width); + } + +signals: + void activated(int index); + +private: + QPointer<QComboBox> m_engineChooser; + QPointer<EngineTypeFilterProxyModel> m_proxyModel; + QAbstractItemModel *m_sourceModel; + QString m_enginType; +}; + +struct PerspectiveItem +{ + QString name; + QString type; + QString id; +}; + class EngineItem : public QObject, public TreeItem { public: @@ -101,6 +205,8 @@ public: const bool m_isPreset = false; QPointer<DebuggerEngine> m_engine; + + PerspectiveItem m_perspective; }; class EngineManagerPrivate : public QObject @@ -110,25 +216,19 @@ public: { m_engineModel.setHeader({Tr::tr("Perspective"), Tr::tr("Debugged Application")}); - // The preset case: - auto preset = new EngineItem; - m_engineModel.rootItem()->appendChild(preset); - m_currentItem = preset; + m_engineChooser = new ModelChooser(&m_engineModel, "", this); + m_engineDAPChooser = new ModelChooser(&m_engineModel, "DAP", this); - m_engineChooser = new QComboBox; - m_engineChooser->setModel(&m_engineModel); - m_engineChooser->setIconSize(QSize(0, 0)); - if (hideSwitcherUnlessNeeded) - m_engineChooser->hide(); + connect(m_engineChooser, &ModelChooser::activated, this, [this](int index) { + activateEngineByIndex(index); + }); - connect(m_engineChooser, &QComboBox::activated, - this, &EngineManagerPrivate::activateEngineByIndex); + connect(m_engineDAPChooser, &ModelChooser::activated, this, [this](int index) { + activateEngineByIndex(index); + }); } - ~EngineManagerPrivate() - { - delete m_engineChooser; - } + ~EngineManagerPrivate() = default; EngineItem *findEngineItem(DebuggerEngine *engine); void activateEngineItem(EngineItem *engineItem); @@ -140,7 +240,11 @@ public: TreeModel<TypedTreeItem<EngineItem>, EngineItem> m_engineModel; QPointer<EngineItem> m_currentItem; // The primary information is DebuggerMainWindow::d->m_currentPerspective Utils::Id m_previousMode; - QPointer<QComboBox> m_engineChooser; + + QPointer<ModelChooser> m_engineChooser; + QPointer<ModelChooser> m_engineDAPChooser; + + QList<PerspectiveItem> m_perspectives; bool m_shuttingDown = false; // This contains the contexts that need to be removed when switching @@ -173,7 +277,12 @@ EngineManager::EngineManager() QWidget *EngineManager::engineChooser() { - return d->m_engineChooser; + return d->m_engineChooser->comboBox(); +} + +QWidget *EngineManager::dapEngineChooser() +{ + return d->m_engineDAPChooser->comboBox(); } void EngineManager::updatePerspectives() @@ -194,7 +303,12 @@ EngineManager *EngineManager::instance() QAbstractItemModel *EngineManager::model() { - return &d->m_engineModel; + return d->m_engineChooser->model(); +} + +QAbstractItemModel *EngineManager::dapModel() +{ + return d->m_engineDAPChooser->model(); } QVariant EngineItem::data(int column, int role) const @@ -232,7 +346,9 @@ QVariant EngineItem::data(int column, int role) const // Return icon that indicates whether this is the active engine if (column == 0) return d->m_currentItem == this ? Icons::LOCATION.icon() : Icons::EMPTY.icon(); - + break; + case Qt::UserRole: + return QVariant::fromValue(m_engine->debuggerType()); default: break; } @@ -240,8 +356,10 @@ QVariant EngineItem::data(int column, int role) const switch (role) { case Qt::DisplayRole: if (column == 0) - return Tr::tr("Debugger Preset"); + return m_perspective.name; return QString("-"); + case Qt::UserRole: + return m_perspective.type; default: break; } @@ -302,10 +420,11 @@ void EngineManagerPrivate::activateEngineByIndex(int index) { // The actual activation is triggered indirectly via the perspective change. Perspective *perspective = nullptr; - if (index == 0) { - perspective = Perspective::findPerspective(Debugger::Constants::PRESET_PERSPECTIVE_ID); + EngineItem *engineItem = m_engineModel.rootItem()->childAt(index); + + if (engineItem && !engineItem->m_engine) { + perspective = Perspective::findPerspective(engineItem->m_perspective.id); } else { - EngineItem *engineItem = m_engineModel.rootItem()->childAt(index); QTC_ASSERT(engineItem, return); QTC_ASSERT(engineItem->m_engine, return); perspective = engineItem->m_engine->perspective(); @@ -338,7 +457,14 @@ void EngineManagerPrivate::activateEngineItem(EngineItem *engineItem) // In case this was triggered externally by some Perspective::select() call. const int idx = engineItem->indexInParent(); - m_engineChooser->setCurrentIndex(idx); + + if ((engineItem->m_engine + && engineItem->m_engine->debuggerType() == m_engineDAPChooser->engineType()) + || (engineItem->m_engine + && engineItem->m_perspective.type == m_engineDAPChooser->engineType())) + m_engineDAPChooser->setCurrentIndex(idx); + else + m_engineChooser->setCurrentIndex(idx); selectUiForCurrentEngine(); } @@ -352,15 +478,13 @@ void EngineManagerPrivate::selectUiForCurrentEngine() if (m_currentItem) row = m_engineModel.rootItem()->indexOf(m_currentItem); - m_engineChooser->setCurrentIndex(row); - const int contentWidth = - m_engineChooser->fontMetrics().horizontalAdvance(m_engineChooser->currentText() + "xx"); - QStyleOptionComboBox option; - option.initFrom(m_engineChooser); - const QSize sz(contentWidth, 1); - const int width = m_engineChooser->style()->sizeFromContents( - QStyle::CT_ComboBox, &option, sz).width(); - m_engineChooser->setFixedWidth(width); + if ((m_currentItem->m_engine + && m_currentItem->m_engine->debuggerType() == m_engineDAPChooser->engineType()) + || (m_currentItem->m_engine + && m_currentItem->m_perspective.type == m_engineDAPChooser->engineType())) + m_engineDAPChooser->adjustUiForEngine(row); + else + m_engineChooser->adjustUiForEngine(row); m_engineModel.rootItem()->forFirstLevelChildren([this](EngineItem *engineItem) { if (engineItem && engineItem->m_engine) @@ -382,7 +506,8 @@ void EngineManagerPrivate::updateEngineChooserVisibility() // Show it if there's more than one option (i.e. not the preset engine only) if (hideSwitcherUnlessNeeded) { const int count = m_engineModel.rootItem()->childCount(); - m_engineChooser->setVisible(count >= 2); + m_engineChooser->comboBox()->setVisible(count >= 2); + m_engineDAPChooser->comboBox()->setVisible(count >= 2); } } @@ -430,6 +555,18 @@ void EngineManager::unregisterEngine(DebuggerEngine *engine) d->updateEngineChooserVisibility(); } +QString EngineManager::registerDefaultPerspective(const QString &name, + const QString &type, + const QString &id) +{ + auto engineItem = new EngineItem; + engineItem->m_perspective.name = name; + engineItem->m_perspective.type = type; + engineItem->m_perspective.id = id; + d->m_engineModel.rootItem()->appendChild(engineItem); + return QString::number(d->m_engineModel.rootItem()->childCount()); +} + void EngineManager::activateDebugMode() { if (ModeManager::currentModeId() != Constants::MODE_DEBUG) { @@ -438,6 +575,11 @@ void EngineManager::activateDebugMode() } } +void EngineManager::activateByIndex(int index) +{ + d->activateEngineByIndex(index); +} + void EngineManager::deactivateDebugMode() { if (ModeManager::currentModeId() == Constants::MODE_DEBUG && d->m_previousMode.isValid()) { @@ -479,3 +621,5 @@ bool EngineManager::shutDown() } } // Debugger::Internal + +#include "enginemanager.moc" diff --git a/src/plugins/debugger/enginemanager.h b/src/plugins/debugger/enginemanager.h index a8222835ad4..f9e757e033d 100644 --- a/src/plugins/debugger/enginemanager.h +++ b/src/plugins/debugger/enginemanager.h @@ -10,6 +10,7 @@ namespace Debugger::Internal { class DebuggerEngine; +struct PerspectiveItem; class EngineManager final : public QObject { @@ -21,17 +22,25 @@ public: static EngineManager *instance(); static QAbstractItemModel *model(); + static QAbstractItemModel *dapModel(); static QString registerEngine(DebuggerEngine *engine); static void unregisterEngine(DebuggerEngine *engine); + static QString registerDefaultPerspective(const QString &name, + const QString &type, + const QString &id); + static void activateDebugMode(); static void deactivateDebugMode(); + static void activateByIndex(int index); static QList<QPointer<DebuggerEngine> > engines(); static QPointer<DebuggerEngine> currentEngine(); static QWidget *engineChooser(); + static QWidget *dapEngineChooser(); + static void updatePerspectives(); static bool shutDown(); // Return true if some engine is being forced to shut down. diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index 27bd5936cc2..1537d32e7e2 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -179,6 +179,7 @@ const char NO_RUN_MODE[]="RunConfiguration.NoRunMode"; const char NORMAL_RUN_MODE[]="RunConfiguration.NormalRunMode"; const char DEBUG_RUN_MODE[]="RunConfiguration.DebugRunMode"; const char CMAKE_DEBUG_RUN_MODE[]="RunConfiguration.CmakeDebugRunMode"; +const char DAP_GDB_DEBUG_RUN_MODE[]="RunConfiguration.DapGdbDebugRunMode"; const char QML_PROFILER_RUN_MODE[]="RunConfiguration.QmlProfilerRunMode"; const char QML_PROFILER_RUNNER[]="RunConfiguration.QmlProfilerRunner"; const char QML_PREVIEW_RUN_MODE[]="RunConfiguration.QmlPreviewRunMode"; From aa7c817f7a711b260dae3d0a5b02fc19b1b25179 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 28 Aug 2023 18:19:24 +0200 Subject: [PATCH 0903/1777] Utils: Temporarily introdce Key Id::toKey() To avoid complications on the user code side during the Key/Store transition. Change-Id: I49ae9d496c9c1ee07f17245616fdefefe9abfc2e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/id.cpp | 10 +++++++++ src/libs/utils/id.h | 3 +++ src/plugins/autotest/testprojectsettings.cpp | 6 +++--- src/plugins/ios/iosdsymbuildstep.cpp | 21 +++++++------------ src/plugins/projectexplorer/makestep.cpp | 12 +++++------ .../projectexplorer/runconfiguration.cpp | 4 ++-- 6 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/libs/utils/id.cpp b/src/libs/utils/id.cpp index bc40c154611..60417d1b7ca 100644 --- a/src/libs/utils/id.cpp +++ b/src/libs/utils/id.cpp @@ -158,6 +158,16 @@ QString Id::toString() const return QString::fromUtf8(stringFromId.value(m_id).str); } +/*! \internal */ +Key Id::toKey() const +{ +#ifdef QTC_USE_STORE + return name(); +#else + return toString(); +#endif +} + /*! Creates an id from a string representation. diff --git a/src/libs/utils/id.h b/src/libs/utils/id.h index 60351dad902..d1ac2355dd7 100644 --- a/src/libs/utils/id.h +++ b/src/libs/utils/id.h @@ -5,6 +5,8 @@ #include "utils_global.h" +#include "storekey.h" + #include <QList> #include <QMetaType> #include <QString> @@ -30,6 +32,7 @@ public: QByteArray name() const; QString toString() const; // Avoid. + Key toKey() const; // FIXME: Replace uses with .name() after Store/key transition. QVariant toSetting() const; // Good to use. QString suffixAfter(Id baseId) const; bool isValid() const { return m_id; } diff --git a/src/plugins/autotest/testprojectsettings.cpp b/src/plugins/autotest/testprojectsettings.cpp index dd0c05079cc..b9c2312029e 100644 --- a/src/plugins/autotest/testprojectsettings.cpp +++ b/src/plugins/autotest/testprojectsettings.cpp @@ -78,15 +78,15 @@ void TestProjectSettings::load() m_activeTestFrameworks.clear(); m_activeTestTools.clear(); if (activeFrameworks.isValid()) { - const QMap<QString, QVariant> frameworksMap = activeFrameworks.toMap(); + const Store frameworksMap = storeFromVariant(activeFrameworks); for (ITestFramework *framework : registeredFrameworks) { const Id id = framework->id(); - bool active = frameworksMap.value(id.toString(), framework->active()).toBool(); + bool active = frameworksMap.value(id.toKey(), framework->active()).toBool(); m_activeTestFrameworks.insert(framework, active); } for (ITestTool *testTool : registeredTestTools) { const Id id = testTool->id(); - bool active = frameworksMap.value(id.toString(), testTool->active()).toBool(); + bool active = frameworksMap.value(id.toKey(), testTool->active()).toBool(); m_activeTestTools.insert(testTool, active); } } else { diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index 44a01a75224..0c07ff4182d 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -87,24 +87,19 @@ void IosDsymBuildStep::toMap(Store &map) const { AbstractProcessStep::toMap(map); - // FIXME: Clean up after QVariantMap -> Utils::Store transition - // This is map.insert(id().name() + ARGUMENTS_PARTIAL_KEY), arguments()) - map.insert(keyFromString(id().withSuffix(ARGUMENTS_PARTIAL_KEY).toString()), - arguments()); - map.insert(keyFromString(id().withSuffix(USE_DEFAULT_ARGS_PARTIAL_KEY).toString()), - isDefault()); - map.insert(keyFromString(id().withSuffix(CLEAN_PARTIAL_KEY).toString()), m_clean); - map.insert(keyFromString(id().withSuffix(COMMAND_PARTIAL_KEY).toString()), command().toSettings()); + map.insert(id().toKey() + ARGUMENTS_PARTIAL_KEY, arguments()); + map.insert(id().toKey() + USE_DEFAULT_ARGS_PARTIAL_KEY, isDefault()); + map.insert(id().toKey() + CLEAN_PARTIAL_KEY, m_clean); + map.insert(id().toKey() + COMMAND_PARTIAL_KEY, command().toSettings()); } void IosDsymBuildStep::fromMap(const Store &map) { - QVariant bArgs = map.value(keyFromString(id().withSuffix(ARGUMENTS_PARTIAL_KEY).toString())); + QVariant bArgs = map.value(id().toKey() + ARGUMENTS_PARTIAL_KEY); m_arguments = bArgs.toStringList(); - bool useDefaultArguments = map.value( - keyFromString(id().withSuffix(USE_DEFAULT_ARGS_PARTIAL_KEY).toString())).toBool(); - m_clean = map.value(keyFromString(id().withSuffix(CLEAN_PARTIAL_KEY).toString()), m_clean).toBool(); - m_command = FilePath::fromSettings(map.value(keyFromString(id().withSuffix(COMMAND_PARTIAL_KEY).toString()))); + bool useDefaultArguments = map.value(id().toKey() + USE_DEFAULT_ARGS_PARTIAL_KEY).toBool(); + m_clean = map.value(id().toKey() + CLEAN_PARTIAL_KEY, m_clean).toBool(); + m_command = FilePath::fromSettings(map.value(id().toKey() + COMMAND_PARTIAL_KEY)); if (useDefaultArguments) { m_command = defaultCommand(); m_arguments = defaultArguments(); diff --git a/src/plugins/projectexplorer/makestep.cpp b/src/plugins/projectexplorer/makestep.cpp index 78b038681e9..bcf3bab8f02 100644 --- a/src/plugins/projectexplorer/makestep.cpp +++ b/src/plugins/projectexplorer/makestep.cpp @@ -48,23 +48,23 @@ MakeStep::MakeStep(BuildStepList *parent, Id id) setCommandLineProvider([this] { return effectiveMakeCommand(Execution); }); // FIXME: Replace with id.name() + MAKE_COMMAND_SUFFIX after the Key/Store transition - m_makeCommandAspect.setSettingsKey(keyFromString(id.withSuffix(MAKE_COMMAND_SUFFIX).toString())); + m_makeCommandAspect.setSettingsKey(id.toKey() + MAKE_COMMAND_SUFFIX); m_makeCommandAspect.setExpectedKind(PathChooser::ExistingCommand); m_makeCommandAspect.setBaseFileName(PathChooser::homePath()); m_makeCommandAspect.setHistoryCompleter("PE.MakeCommand.History"); - m_userArgumentsAspect.setSettingsKey(keyFromString(id.withSuffix(MAKE_ARGUMENTS_SUFFIX).toString())); + m_userArgumentsAspect.setSettingsKey(id.toKey() + MAKE_ARGUMENTS_SUFFIX); m_userArgumentsAspect.setLabelText(Tr::tr("Make arguments:")); m_userArgumentsAspect.setDisplayStyle(StringAspect::LineEditDisplay); - m_jobCountAspect.setSettingsKey(keyFromString(id.withSuffix(JOBCOUNT_SUFFIX).toString())); + m_jobCountAspect.setSettingsKey(id.toKey() + JOBCOUNT_SUFFIX); m_jobCountAspect.setLabel(Tr::tr("Parallel jobs:")); m_jobCountAspect.setRange(1, 999); m_jobCountAspect.setValue(defaultJobCount()); m_jobCountAspect.setDefaultValue(defaultJobCount()); const QString text = Tr::tr("Override MAKEFLAGS"); - m_overrideMakeflagsAspect.setSettingsKey(keyFromString(id.withSuffix(OVERRIDE_MAKEFLAGS_SUFFIX).toString())); + m_overrideMakeflagsAspect.setSettingsKey(id.toKey() + OVERRIDE_MAKEFLAGS_SUFFIX); m_overrideMakeflagsAspect.setLabel(text, BoolAspect::LabelPlacement::AtCheckBox); m_nonOverrideWarning.setText("<html><body><p>" + @@ -72,11 +72,11 @@ MakeStep::MakeStep(BuildStepList *parent, Id id) .arg(text) + "</p></body></html>"); m_nonOverrideWarning.setIconType(InfoLabel::Warning); - m_disabledForSubdirsAspect.setSettingsKey(keyFromString(id.withSuffix(".disabledForSubdirs").toString())); + m_disabledForSubdirsAspect.setSettingsKey(id.toKey() + ".disabledForSubdirs"); m_disabledForSubdirsAspect.setLabel(Tr::tr("Disable in subdirectories:")); m_disabledForSubdirsAspect.setToolTip(Tr::tr("Runs this step only for a top-level build.")); - m_buildTargetsAspect.setSettingsKey(keyFromString(id.withSuffix(BUILD_TARGETS_SUFFIX).toString())); + m_buildTargetsAspect.setSettingsKey(id.toKey() + BUILD_TARGETS_SUFFIX); m_buildTargetsAspect.setLabelText(Tr::tr("Targets:")); const auto updateMakeLabel = [this] { diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index fcf57694c76..cd01a9f26b8 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -89,14 +89,14 @@ void GlobalOrProjectAspect::fromMap(const Store &map) { if (m_projectSettings) m_projectSettings->fromMap(map); - m_useGlobalSettings = map.value(keyFromString(id().toString() + ".UseGlobalSettings"), true).toBool(); + m_useGlobalSettings = map.value(id().toKey() + ".UseGlobalSettings", true).toBool(); } void GlobalOrProjectAspect::toMap(Store &map) const { if (m_projectSettings) m_projectSettings->toMap(map); - map.insert(keyFromString(id().toString() + ".UseGlobalSettings"), m_useGlobalSettings); + map.insert(id().toKey() + ".UseGlobalSettings", m_useGlobalSettings); } void GlobalOrProjectAspect::toActiveMap(Store &data) const From 6c5027ba0e7aedae79bcba55c8d9a2dcabb15c45 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 29 Aug 2023 08:01:05 +0200 Subject: [PATCH 0904/1777] Utils: Move storefrommap.h to store.cpp Will be used more widely. Change-Id: I77bb7760e7b3bd1147ea1e1d6be196ef75f691a2 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/CMakeLists.txt | 1 - src/libs/utils/store.cpp | 72 +++++++++++++++++++++++++++ src/libs/utils/store.h | 3 ++ src/libs/utils/storefrommap.h | 91 ----------------------------------- src/libs/utils/utils.qbs | 1 - 5 files changed, 75 insertions(+), 93 deletions(-) delete mode 100644 src/libs/utils/storefrommap.h diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 0d231e47ad8..72c18e3346f 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -163,7 +163,6 @@ add_qtc_library(Utils statuslabel.cpp statuslabel.h store.cpp store.h storekey.h - storefrommap.h stringtable.cpp stringtable.h stringutils.cpp stringutils.h styleanimator.cpp styleanimator.h diff --git a/src/libs/utils/store.cpp b/src/libs/utils/store.cpp index 9b31a16c541..1c7cac8c59f 100644 --- a/src/libs/utils/store.cpp +++ b/src/libs/utils/store.cpp @@ -27,4 +27,76 @@ Store storeFromVariant(const QVariant &value) return value.value<Store>(); } +#ifdef QTC_USE_STORE +static QVariantList storeListFromMapList(const QVariantList &mapList) +{ + QVariantList storeList; + + for (const auto &mapEntry : mapList) { + if (mapEntry.type() == QVariant::Map) + storeList.append(QVariant::fromValue(storeFromMap(mapEntry.toMap()))); + else if (mapEntry.type() == QVariant::List) + storeList.append(QVariant::fromValue(storeListFromMapList(mapEntry.toList()))); + else + storeList.append(mapEntry); + } + + return storeList; +} + +static QVariantList mapListFromStoreList(const QVariantList &storeList) +{ + QVariantList mapList; + + for (const auto &storeEntry : storeList) { + if (storeEntry.metaType() == QMetaType::fromType<Store>()) + mapList.append(QVariant::fromValue(mapFromStore(storeEntry.value<Store>()))); + else if (storeEntry.type() == QVariant::List) + mapList.append(QVariant::fromValue(mapListFromStoreList(storeEntry.toList()))); + else + mapList.append(storeEntry); + } + + return mapList; +} +#endif + +Store storeFromMap(const QVariantMap &map) +{ +#ifdef QTC_USE_STORE + Store store; + for (auto it = map.begin(); it != map.end(); ++it) { + if (it.value().type() == QVariant::Map) { + store.insert(keyFromString(it.key()), QVariant::fromValue(storeFromMap(it->toMap()))); + } else if (it.value().type() == QVariant::List) { + store.insert(keyFromString(it.key()), + QVariant::fromValue(storeListFromMapList(it->toList()))); + } else { + store.insert(keyFromString(it.key()), it.value()); + } + } + return store; +#else + return map; +#endif +} + +QVariantMap mapFromStore(const Store &store) +{ +#ifdef QTC_USE_STORE + QVariantMap map; + for (auto it = store.begin(); it != store.end(); ++it) { + if (it.value().metaType() == QMetaType::fromType<Store>()) + map.insert(stringFromKey(it.key()), mapFromStore(it->value<Store>())); + else if (it.value().type() == QVariant::List) + map.insert(stringFromKey(it.key()), mapListFromStoreList(it->toList())); + else + map.insert(stringFromKey(it.key()), it.value()); + } + return map; +#else + return store; +#endif +} + } // Utils diff --git a/src/libs/utils/store.h b/src/libs/utils/store.h index 09609e308a8..8cdf5682d23 100644 --- a/src/libs/utils/store.h +++ b/src/libs/utils/store.h @@ -24,4 +24,7 @@ QTCREATOR_UTILS_EXPORT QStringList stringsFromKeys(const KeyList &list); QTCREATOR_UTILS_EXPORT QVariant variantFromStore(const Store &store); QTCREATOR_UTILS_EXPORT Store storeFromVariant(const QVariant &value); +QTCREATOR_UTILS_EXPORT Store storeFromMap(const QVariantMap &map); +QTCREATOR_UTILS_EXPORT QVariantMap mapFromStore(const Store &store); + } // Utils diff --git a/src/libs/utils/storefrommap.h b/src/libs/utils/storefrommap.h deleted file mode 100644 index 6d2d760f86f..00000000000 --- a/src/libs/utils/storefrommap.h +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "store.h" - -namespace Utils { - -#ifdef QTC_USE_STORE - -inline Store storeFromMap(const QVariantMap &map); -inline QVariantMap mapFromStore(const Store &store); - -inline QVariantList storeListFromMapList(const QVariantList &mapList) -{ - QVariantList storeList; - - for (const auto &mapEntry : mapList) { - if (mapEntry.type() == QVariant::Map) - storeList.append(QVariant::fromValue(storeFromMap(mapEntry.toMap()))); - else if (mapEntry.type() == QVariant::List) - storeList.append(QVariant::fromValue(storeListFromMapList(mapEntry.toList()))); - else - storeList.append(mapEntry); - } - - return storeList; -} - -inline QVariantList mapListFromStoreList(const QVariantList &storeList) -{ - QVariantList mapList; - - for (const auto &storeEntry : storeList) { - if (storeEntry.metaType() == QMetaType::fromType<Store>()) - mapList.append(QVariant::fromValue(mapFromStore(storeEntry.value<Store>()))); - else if (storeEntry.type() == QVariant::List) - mapList.append(QVariant::fromValue(mapListFromStoreList(storeEntry.toList()))); - else - mapList.append(storeEntry); - } - - return mapList; -} - -inline Store storeFromMap(const QVariantMap &map) -{ - Store store; - for (auto it = map.begin(); it != map.end(); ++it) { - if (it.value().type() == QVariant::Map) { - store.insert(keyFromString(it.key()), QVariant::fromValue(storeFromMap(it->toMap()))); - } else if (it.value().type() == QVariant::List) { - store.insert(keyFromString(it.key()), - QVariant::fromValue(storeListFromMapList(it->toList()))); - } else { - store.insert(keyFromString(it.key()), it.value()); - } - } - return store; -} - -inline QVariantMap mapFromStore(const Store &store) -{ - QVariantMap map; - for (auto it = store.begin(); it != store.end(); ++it) { - if (it.value().metaType() == QMetaType::fromType<Store>()) - map.insert(stringFromKey(it.key()), mapFromStore(it->value<Store>())); - else if (it.value().type() == QVariant::List) - map.insert(stringFromKey(it.key()), mapListFromStoreList(it->toList())); - else - map.insert(stringFromKey(it.key()), it.value()); - } - return map; -} - -#else - -inline Store storeFromMap(const QVariantMap &map) -{ - return map; -} - -inline QVariantMap mapFromStore(const Store &store) -{ - return store; -} - -#endif - -} // namespace Utils diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index b6d0839167a..021c1d37f26 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -296,7 +296,6 @@ Project { "store.cpp", "store.h", "storekey.h", - "storefrommap.h", "stringtable.cpp", "stringtable.h", "stringutils.cpp", From e4ab99990e8800004ed27df9357d05866286bf95 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 29 Aug 2023 09:36:24 +0200 Subject: [PATCH 0905/1777] DebuggerPlugin: Fix assert on Creator startup Add toolbar action to the perspective before calling setToolButtonStyle(), otherwise the m_toolButton isn't created yet and the assert is triggered. Amends d304e82e63447ba9393332cd6e2b919c9c602bfa Change-Id: Idac207464d8844565c96718ac65a7b820f05d4b7 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/debuggerplugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index eb09b70d002..42c5244cd57 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1273,6 +1273,7 @@ void DebuggerPluginPrivate::createDapDebuggerPerspective(QWidget *globalLogWindo } }); + m_perspectiveDap.addToolBarAction(&m_startDapAction); m_startDapAction.setToolTip(Tr::tr("Start DAP Debugging")); m_startDapAction.setText(Tr::tr("Start DAP Debugging")); m_startDapAction.setEnabled(true); @@ -1281,7 +1282,6 @@ void DebuggerPluginPrivate::createDapDebuggerPerspective(QWidget *globalLogWindo m_startDapAction.setVisible(true); m_perspectiveDap.useSubPerspectiveSwitcher(EngineManager::dapEngineChooser()); - m_perspectiveDap.addToolBarAction(&m_startDapAction); m_perspectiveDap.addWindow(engineManagerWindow, Perspective::SplitVertical, nullptr); m_perspectiveDap.addWindow(breakpointManagerWindow, From b0d78aefffd30b35a9cdf4f505e99c6708012aaf Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 29 Aug 2023 09:30:38 +0200 Subject: [PATCH 0906/1777] ProjectExplorer: More Store/Key in KitAspect Change-Id: I6b6e497fac7a3d0f041af727601428bb5c3c441d Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/projectexplorer/kitaspects.cpp | 47 +++++++++++----------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/src/plugins/projectexplorer/kitaspects.cpp b/src/plugins/projectexplorer/kitaspects.cpp index c3230348088..c8dcaf6d07e 100644 --- a/src/plugins/projectexplorer/kitaspects.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -378,14 +378,13 @@ static QMap<Id, QByteArray> defaultToolChainIds() return toolChains; } -static QVariant defaultToolChainValue() +static Store defaultToolChainValue() { const QMap<Id, QByteArray> toolChains = defaultToolChainIds(); - QVariantMap result; + Store result; auto end = toolChains.end(); - for (auto it = toolChains.begin(); it != end; ++it) { - result.insert(it.key().toString(), it.value()); - } + for (auto it = toolChains.begin(); it != end; ++it) + result.insert(it.key().toKey(), it.value()); return result; } @@ -502,13 +501,13 @@ void ToolChainKitAspectFactory::setup(Kit *k) QTC_ASSERT(ToolChainManager::isLoaded(), return); QTC_ASSERT(k, return); - QVariantMap value = k->value(id()).toMap(); + Store value = storeFromVariant(k->value(id())); bool lockToolchains = k->isSdkProvided() && !value.isEmpty(); if (value.empty()) - value = defaultToolChainValue().toMap(); + value = defaultToolChainValue(); for (auto i = value.constBegin(); i != value.constEnd(); ++i) { - Id l = findLanguage(i.key()); + Id l = findLanguage(stringFromKey(i.key())); if (!l.isValid()) { lockToolchains = false; @@ -622,8 +621,8 @@ QByteArray ToolChainKitAspect::toolChainId(const Kit *k, Id language) QTC_ASSERT(ToolChainManager::isLoaded(), return nullptr); if (!k) return {}; - QVariantMap value = k->value(ToolChainKitAspect::id()).toMap(); - return value.value(language.toString(), QByteArray()).toByteArray(); + Store value = storeFromVariant(k->value(ToolChainKitAspect::id())); + return value.value(language.toKey(), QByteArray()).toByteArray(); } ToolChain *ToolChainKitAspect::toolChain(const Kit *k, Id language) @@ -646,10 +645,10 @@ QList<ToolChain *> ToolChainKitAspect::toolChains(const Kit *k) { QTC_ASSERT(k, return {}); - const QVariantMap value = k->value(ToolChainKitAspect::id()).toMap(); + const Store value = storeFromVariant(k->value(ToolChainKitAspect::id())); const QList<ToolChain *> tcList = transform<QList>(ToolChainManager::allLanguages(), [&value](Id l) { - return ToolChainManager::findToolChain(value.value(l.toString()).toByteArray()); + return ToolChainManager::findToolChain(value.value(l.toKey()).toByteArray()); }); return filtered(tcList, [](ToolChain *tc) { return tc; }); } @@ -658,10 +657,10 @@ void ToolChainKitAspect::setToolChain(Kit *k, ToolChain *tc) { QTC_ASSERT(tc, return); QTC_ASSERT(k, return); - QVariantMap result = k->value(ToolChainKitAspect::id()).toMap(); - result.insert(tc->language().toString(), tc->id()); + Store result = storeFromVariant(k->value(ToolChainKitAspect::id())); + result.insert(tc->language().toKey(), tc->id()); - k->setValue(id(), result); + k->setValue(id(), variantFromStore(result)); } /** @@ -682,8 +681,8 @@ void ToolChainKitAspect::setAllToolChainsToMatch(Kit *k, ToolChain *tc) const Toolchains allTcList = ToolChainManager::toolchains(); QTC_ASSERT(allTcList.contains(tc), return); - QVariantMap result = k->value(ToolChainKitAspect::id()).toMap(); - result.insert(tc->language().toString(), tc->id()); + Store result = storeFromVariant(k->value(ToolChainKitAspect::id())); + result.insert(tc->language().toKey(), tc->id()); for (const Id l : ToolChainManager::allLanguages()) { if (l == tc->language()) @@ -703,14 +702,14 @@ void ToolChainKitAspect::setAllToolChainsToMatch(Kit *k, ToolChain *tc) } } if (bestMatch) - result.insert(l.toString(), bestMatch->id()); + result.insert(l.toKey(), bestMatch->id()); else if (match) - result.insert(l.toString(), match->id()); + result.insert(l.toKey(), match->id()); else - result.insert(l.toString(), QByteArray()); + result.insert(l.toKey(), QByteArray()); } - k->setValue(id(), result); + k->setValue(id(), variantFromStore(result)); } void ToolChainKitAspect::clearToolChain(Kit *k, Id language) @@ -718,9 +717,9 @@ void ToolChainKitAspect::clearToolChain(Kit *k, Id language) QTC_ASSERT(language.isValid(), return); QTC_ASSERT(k, return); - QVariantMap result = k->value(ToolChainKitAspect::id()).toMap(); - result.insert(language.toString(), QByteArray()); - k->setValue(id(), result); + Store result = storeFromVariant(k->value(ToolChainKitAspect::id())); + result.insert(language.toKey(), QByteArray()); + k->setValue(id(), variantFromStore(result)); } Abi ToolChainKitAspect::targetAbi(const Kit *k) From 36316e2d17668ed98890c4c698b6040e0cba6380 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 29 Aug 2023 09:17:43 +0200 Subject: [PATCH 0907/1777] JsonEditor: Fix warning about unused argument Amends ddb4aa01516972c9fd614b77a57a9218c7bf49ec Change-Id: I722b5615bec11796a9a003b288ced8d0da7b1d4b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/texteditor/jsoneditor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/texteditor/jsoneditor.cpp b/src/plugins/texteditor/jsoneditor.cpp index 6bdc698ea20..7d6ffca702c 100644 --- a/src/plugins/texteditor/jsoneditor.cpp +++ b/src/plugins/texteditor/jsoneditor.cpp @@ -73,6 +73,7 @@ public: const TabSettings &tabSettings, int cursorPositionInEditor) override { + Q_UNUSED(typedChar) tabSettings.indentLine(block, indentFor(block, tabSettings, cursorPositionInEditor)); } }; From 201f5291eb7c52ab0890b15a1c4304a5b0e2fc96 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 24 Aug 2023 10:47:29 +0200 Subject: [PATCH 0908/1777] TextEditor: add json auto completer Change-Id: If502ccb3b75d3c5a5d7ae555acfeb51644ffcd71 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/texteditor/jsoneditor.cpp | 72 ++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/jsoneditor.cpp b/src/plugins/texteditor/jsoneditor.cpp index 7d6ffca702c..d49f5efacea 100644 --- a/src/plugins/texteditor/jsoneditor.cpp +++ b/src/plugins/texteditor/jsoneditor.cpp @@ -28,7 +28,77 @@ static int startsWith(const QString &line, const QString &closingChars) class JsonAutoCompleter : public AutoCompleter { - bool contextAllowsElectricCharacters(const QTextCursor &cursor) const override { return true; } + bool contextAllowsElectricCharacters(const QTextCursor &cursor) const override + { + return !isInString(cursor); + } + + bool contextAllowsAutoBrackets(const QTextCursor &cursor, const QString &) const override + { + return !isInString(cursor); + } + QString insertMatchingBrace(const QTextCursor &cursor, + const QString &text, + QChar lookAhead, + bool skipChars, + int *skippedChars) const override + { + Q_UNUSED(cursor) + if (text.isEmpty()) + return QString(); + const QChar current = text.at(0); + switch (current.unicode()) { + case '{': + return QStringLiteral("}"); + case '[': + return QStringLiteral("]"); + case ']': + case '}': + if (current == lookAhead && skipChars) + ++*skippedChars; + break; + default: + break; + } + + return QString(); + } + + bool contextAllowsAutoQuotes(const QTextCursor &cursor, const QString &) const override + { + return !isInString(cursor); + } + QString insertMatchingQuote(const QTextCursor &cursor, + const QString &text, + QChar lookAhead, + bool skipChars, + int *skippedChars) const override + { + Q_UNUSED(cursor) + static const QChar quote('"'); + if (text.isEmpty() || text != quote) + return QString(); + if (lookAhead == quote && skipChars) { + ++*skippedChars; + return QString(); + } + return quote; + } + + bool isInString(const QTextCursor &cursor) const override + { + bool result = false; + const QString text = cursor.block().text(); + const int position = qMin(cursor.positionInBlock(), text.size()); + + for (int i = 0; i < position; ++i) { + if (text.at(i) == '"') { + if (!result || text[i - 1] != '\\') + result = !result; + } + } + return result; + } }; class JsonIndenter : public TextIndenter From 4451da70376aa4321b94f6db2362ca79e8168ac0 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 24 Aug 2023 09:29:16 +0200 Subject: [PATCH 0909/1777] LanguageClient: use json editor in language client settings Change-Id: Ib2b8dae730a701d71ae39a4eaf401f5feab7f921 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../languageclient/languageclientsettings.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index a623fd1a9b7..f322709eba8 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -1030,9 +1030,16 @@ TextEditor::BaseTextEditor *jsonEditor() { using namespace TextEditor; using namespace Utils::Text; - BaseTextEditor *editor = PlainTextEditorFactory::createPlainTextEditor(); - TextDocument *document = editor->textDocument(); - TextEditorWidget *widget = editor->editorWidget(); + BaseTextEditor *textEditor = nullptr; + for (Core::IEditorFactory *factory : Core::IEditorFactory::preferredEditorFactories("foo.json")) { + Core::IEditor *editor = factory->createEditor(); + if (textEditor = qobject_cast<BaseTextEditor *>(editor); textEditor) + break; + delete editor; + } + QTC_ASSERT(textEditor, textEditor = PlainTextEditorFactory::createPlainTextEditor()); + TextDocument *document = textEditor->textDocument(); + TextEditorWidget *widget = textEditor->editorWidget(); widget->configureGenericHighlighter(Utils::mimeTypeForName("application/json")); widget->setLineNumbersVisible(false); widget->setMarksVisible(false); @@ -1063,7 +1070,7 @@ TextEditor::BaseTextEditor *jsonEditor() mark->setIcon(Utils::Icons::CODEMODEL_ERROR.icon()); document->addMark(mark); }); - return editor; + return textEditor; } } // namespace LanguageClient From 12fb4e93bdd864819c4863b8e0ac6306690f176a Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 24 Aug 2023 17:14:01 +0200 Subject: [PATCH 0910/1777] Python: Fix debugger start Change-Id: I9a26c591d174f5f079c4a673a6bf1aedd5cd709c Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/python/pythonlanguageclient.cpp | 7 +++++-- src/plugins/python/pythonrunconfiguration.h | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/python/pythonlanguageclient.cpp b/src/plugins/python/pythonlanguageclient.cpp index 1006eea3e82..750ab333826 100644 --- a/src/plugins/python/pythonlanguageclient.cpp +++ b/src/plugins/python/pythonlanguageclient.cpp @@ -208,8 +208,11 @@ void PyLSClient::openDocument(TextEditor::TextDocument *document) if (PythonProject *project = pythonProjectForFile(documentPath)) { if (Target *target = project->activeTarget()) { if (RunConfiguration *rc = target->activeRunConfiguration()) - if (auto aspect = rc->aspect<PythonInterpreterAspect>()) - updateExtraCompilers(project, aspect->extraCompilers()); + if (auto aspect = rc->aspect<InterpreterAspect>()) { + updateExtraCompilers(project, + static_cast<PythonInterpreterAspect *>(aspect) + ->extraCompilers()); + } } } else if (isSupportedDocument(document)) { const FilePath workspacePath = documentPath.parentDir(); diff --git a/src/plugins/python/pythonrunconfiguration.h b/src/plugins/python/pythonrunconfiguration.h index 4c4517abf75..b4eb54b12f8 100644 --- a/src/plugins/python/pythonrunconfiguration.h +++ b/src/plugins/python/pythonrunconfiguration.h @@ -14,8 +14,6 @@ class PythonRunConfiguration; class PythonInterpreterAspect final : public ProjectExplorer::InterpreterAspect { - Q_OBJECT - public: PythonInterpreterAspect(Utils::AspectContainer *container, ProjectExplorer::RunConfiguration *rc); ~PythonInterpreterAspect() final; From 4c81af8c0a6173311c4a5f3ca25b354115220c65 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 25 Aug 2023 18:12:43 +0200 Subject: [PATCH 0911/1777] QbsProjectManager: Create QbsProfileManager on request Task-number: QTCREATORBUG-29546 Change-Id: Ib50ce8cacb4ef26346d0b43401f97093c1c75155 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../qbsprojectmanager/qbsprofilemanager.cpp | 35 ++++++++++--------- .../qbsprojectmanager/qbsprofilemanager.h | 2 -- .../qbsprojectmanagerplugin.cpp | 1 - 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp index 2be00a1d9e2..ecab48bc4f9 100644 --- a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp +++ b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp @@ -89,21 +89,27 @@ QString toJSLiteral(const QVariant &val) return QString::fromLatin1("Unconvertible type %1").arg(QLatin1String(val.typeName())); } - -static QbsProfileManager *m_instance = nullptr; +static PropertyProvider &defaultPropertyProvider() +{ + static DefaultPropertyProvider theDefaultPropertyProvider; + return theDefaultPropertyProvider; +} static QString kitNameKeyInQbsSettings(const ProjectExplorer::Kit *kit) { return "preferences.qtcreator.kit." + kit->id().toString(); } -QbsProfileManager::QbsProfileManager() : m_defaultPropertyProvider(new DefaultPropertyProvider) +QbsProfileManager::QbsProfileManager() { - m_instance = this; - setObjectName(QLatin1String("QbsProjectManager")); - connect(ProjectExplorer::KitManager::instance(), &ProjectExplorer::KitManager::kitsLoaded, this, - [this] { m_kitsToBeSetupForQbs = ProjectExplorer::KitManager::kits(); } ); + + if (ProjectExplorer::KitManager::instance()->isLoaded()) { + m_kitsToBeSetupForQbs = ProjectExplorer::KitManager::kits(); + } else { + connect(ProjectExplorer::KitManager::instance(), &ProjectExplorer::KitManager::kitsLoaded, + this, [this] { m_kitsToBeSetupForQbs = ProjectExplorer::KitManager::kits(); } ); + } connect(ProjectExplorer::KitManager::instance(), &ProjectExplorer::KitManager::kitAdded, this, &QbsProfileManager::addProfileFromKit); connect(ProjectExplorer::KitManager::instance(), &ProjectExplorer::KitManager::kitUpdated, this, @@ -114,15 +120,12 @@ QbsProfileManager::QbsProfileManager() : m_defaultPropertyProvider(new DefaultPr this, &QbsProfileManager::updateAllProfiles); } -QbsProfileManager::~QbsProfileManager() -{ - delete m_defaultPropertyProvider; - m_instance = nullptr; -} +QbsProfileManager::~QbsProfileManager() = default; QbsProfileManager *QbsProfileManager::instance() { - return m_instance; + static QbsProfileManager theQbsProfileManager; + return &theQbsProfileManager; } QString QbsProfileManager::ensureProfileForKit(const ProjectExplorer::Kit *k) @@ -137,8 +140,8 @@ void QbsProfileManager::updateProfileIfNecessary(const ProjectExplorer::Kit *kit { // kit in list <=> profile update is necessary // Note that the const_cast is safe, as we do not call any non-const methods on the object. - if (m_instance->m_kitsToBeSetupForQbs.removeOne(const_cast<ProjectExplorer::Kit *>(kit))) - m_instance->addProfileFromKit(kit); + if (instance()->m_kitsToBeSetupForQbs.removeOne(const_cast<ProjectExplorer::Kit *>(kit))) + instance()->addProfileFromKit(kit); } void QbsProfileManager::updateAllProfiles() @@ -154,7 +157,7 @@ void QbsProfileManager::addProfileFromKit(const ProjectExplorer::Kit *k) runQbsConfig(QbsConfigOp::Set, kitNameKeyInQbsSettings(k), name); // set up properties: - QVariantMap data = m_defaultPropertyProvider->properties(k, QVariantMap()); + QVariantMap data = defaultPropertyProvider().properties(k, QVariantMap()); for (PropertyProvider *provider : std::as_const(g_propertyProviders)) { if (provider->canHandle(k)) data = provider->properties(k, data); diff --git a/src/plugins/qbsprojectmanager/qbsprofilemanager.h b/src/plugins/qbsprojectmanager/qbsprofilemanager.h index 3b6d98f697c..5e9dacea819 100644 --- a/src/plugins/qbsprojectmanager/qbsprofilemanager.h +++ b/src/plugins/qbsprojectmanager/qbsprofilemanager.h @@ -12,7 +12,6 @@ namespace ProjectExplorer { class Kit; } namespace QbsProjectManager { namespace Internal { -class DefaultPropertyProvider; QString toJSLiteral(const QVariant &val); QVariant fromJSLiteral(const QString &str); @@ -43,7 +42,6 @@ private: void handleKitUpdate(ProjectExplorer::Kit *kit); void handleKitRemoval(ProjectExplorer::Kit *kit); - DefaultPropertyProvider *m_defaultPropertyProvider; QList<ProjectExplorer::Kit *> m_kitsToBeSetupForQbs; }; diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp index 4299f22e293..fc0eb4abebb 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp @@ -66,7 +66,6 @@ static QbsProject *currentEditorProject() class QbsProjectManagerPluginPrivate { public: - QbsProfileManager manager; QbsBuildConfigurationFactory buildConfigFactory; QbsBuildStepFactory buildStepFactory; QbsCleanStepFactory cleanStepFactory; From e5afe02556849ccc314f275f8dff2edd3ba65cf5 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 29 Aug 2023 09:36:06 +0200 Subject: [PATCH 0912/1777] Utils: Register Key/Store related metatypes Change-Id: If7b0a83febfeb2cb3cfc9ee42b8423453cf3b1c4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/store.h | 4 ++++ src/plugins/coreplugin/coreplugin.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/libs/utils/store.h b/src/libs/utils/store.h index 8cdf5682d23..ec7eb3bd318 100644 --- a/src/libs/utils/store.h +++ b/src/libs/utils/store.h @@ -28,3 +28,7 @@ QTCREATOR_UTILS_EXPORT Store storeFromMap(const QVariantMap &map); QTCREATOR_UTILS_EXPORT QVariantMap mapFromStore(const Store &store); } // Utils + +#ifdef QTC_USE_STORE +Q_DECLARE_METATYPE(Utils::Store) +#endif diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 2e07d1c4cd1..1ac3332288e 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -26,6 +26,7 @@ #include <extensionsystem/pluginerroroverview.h> #include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginspec.h> + #include <utils/algorithm.h> #include <utils/checkablemessagebox.h> #include <utils/commandline.h> @@ -34,6 +35,7 @@ #include <utils/mimeutils.h> #include <utils/pathchooser.h> #include <utils/savefile.h> +#include <utils/store.h> #include <utils/stringutils.h> #include <utils/textutils.h> #include <utils/theme/theme.h> @@ -76,6 +78,9 @@ CorePlugin::CorePlugin() qRegisterMetaType<Utils::CommandLine>(); qRegisterMetaType<Utils::FilePath>(); qRegisterMetaType<Utils::Environment>(); + qRegisterMetaType<Utils::Store>(); + qRegisterMetaType<Utils::Key>(); + qRegisterMetaType<Utils::KeyList>(); m_instance = this; setupSystemEnvironment(); } From 52d1cd47cb3f6689e39283dcf08ea6c4d28b9eba Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 25 Aug 2023 15:38:03 +0200 Subject: [PATCH 0913/1777] Utils: Write Key/Store to settings We claim that we still store QVariantMap to keep the format unchanged. Change-Id: Ie7b0a83febfeb2cb3cfc9ee42b8423453cf3b1c4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/persistentsettings.cpp | 27 ++++++++++++--------------- src/libs/utils/settingsaccessor.cpp | 4 ++-- src/libs/utils/store.cpp | 16 +++++++++++++++- src/libs/utils/store.h | 2 ++ 4 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/libs/utils/persistentsettings.cpp b/src/libs/utils/persistentsettings.cpp index 500204966c5..c193e754085 100644 --- a/src/libs/utils/persistentsettings.cpp +++ b/src/libs/utils/persistentsettings.cpp @@ -360,22 +360,21 @@ FilePath PersistentSettingsReader::filePath() static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx, const QVariant &variant, const Key &key = {}) { - switch (static_cast<int>(variant.type())) { - case static_cast<int>(QVariant::StringList): - case static_cast<int>(QVariant::List): { + static const int storeId = qMetaTypeId<Store>(); + + const int variantType = variant.typeId(); + if (variantType == QMetaType::QStringList || variantType == QMetaType::QVariantList) { w.writeStartElement(ctx.valueListElement); - w.writeAttribute(ctx.typeAttribute, QLatin1String(QVariant::typeToName(QVariant::List))); + w.writeAttribute(ctx.typeAttribute, "QVariantList"); if (!key.isEmpty()) w.writeAttribute(ctx.keyAttribute, key); const QList<QVariant> list = variant.toList(); for (const QVariant &var : list) writeVariantValue(w, ctx, var); w.writeEndElement(); - break; - } - case static_cast<int>(QVariant::Map): { + } else if (variantType == storeId || variantType == QMetaType::QVariantMap) { w.writeStartElement(ctx.valueMapElement); - w.writeAttribute(ctx.typeAttribute, QLatin1String(QVariant::typeToName(QVariant::Map))); + w.writeAttribute(ctx.typeAttribute, "QVariantMap"); if (!key.isEmpty()) w.writeAttribute(ctx.keyAttribute, key); const Store varMap = storeFromVariant(variant); @@ -383,12 +382,11 @@ static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx, for (Store::const_iterator i = varMap.constBegin(); i != cend; ++i) writeVariantValue(w, ctx, i.value(), i.key()); w.writeEndElement(); - } - break; - case static_cast<int>(QMetaType::QObjectStar): // ignore QObjects! - case static_cast<int>(QMetaType::VoidStar): // ignore void pointers! - break; - default: + } else if (variantType == QMetaType::QObjectStar) { + // ignore QObjects + } else if (variantType == QMetaType::VoidStar) { + // ignore void pointers + } else { w.writeStartElement(ctx.valueElement); w.writeAttribute(ctx.typeAttribute, QLatin1String(variant.typeName())); if (!key.isEmpty()) @@ -402,7 +400,6 @@ static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx, break; } w.writeEndElement(); - break; } } diff --git a/src/libs/utils/settingsaccessor.cpp b/src/libs/utils/settingsaccessor.cpp index 3bd6f227e37..1c9f30ecba5 100644 --- a/src/libs/utils/settingsaccessor.cpp +++ b/src/libs/utils/settingsaccessor.cpp @@ -387,7 +387,7 @@ Store VersionUpgrader::renameKeys(const QList<Change> &changes, Store map) const Store::iterator i = map.begin(); while (i != map.end()) { QVariant v = i.value(); - if (v.type() == QVariant::Map) + if (Utils::isStore(v)) i.value() = variantFromStore(renameKeys(changes, storeFromVariant(v))); ++i; @@ -717,7 +717,7 @@ static QVariant mergeQVariantMapsRecursion(const Store &mainTree, const Store &s QPair<Key, QVariant> kv = mergeResult.value(); - if (kv.second.type() == QVariant::Map) { + if (Utils::isStore(kv.second)) { const Key newKeyPrefix = keyPrefix + kv.first + '/'; kv.second = mergeQVariantMapsRecursion(mainTree, secondaryTree, newKeyPrefix, storeFromVariant(kv.second), diff --git a/src/libs/utils/store.cpp b/src/libs/utils/store.cpp index 1c7cac8c59f..acf77f899db 100644 --- a/src/libs/utils/store.cpp +++ b/src/libs/utils/store.cpp @@ -4,6 +4,7 @@ #include "store.h" #include "algorithm.h" +#include "qtcassert.h" namespace Utils { @@ -24,7 +25,14 @@ QVariant variantFromStore(const Store &store) Store storeFromVariant(const QVariant &value) { - return value.value<Store>(); + if (value.typeId() == qMetaTypeId<Store>()) + return value.value<Store>(); + + if (value.typeId() == QMetaType::QVariantMap) + return storeFromMap(value.toMap()); + + QTC_CHECK(false); + return Store(); } #ifdef QTC_USE_STORE @@ -99,4 +107,10 @@ QVariantMap mapFromStore(const Store &store) #endif } +bool isStore(const QVariant &value) +{ + const int typeId = value.typeId(); + return typeId == QMetaType::QVariantMap || typeId == qMetaTypeId<Store>(); +} + } // Utils diff --git a/src/libs/utils/store.h b/src/libs/utils/store.h index ec7eb3bd318..cfebee71cc6 100644 --- a/src/libs/utils/store.h +++ b/src/libs/utils/store.h @@ -27,6 +27,8 @@ QTCREATOR_UTILS_EXPORT Store storeFromVariant(const QVariant &value); QTCREATOR_UTILS_EXPORT Store storeFromMap(const QVariantMap &map); QTCREATOR_UTILS_EXPORT QVariantMap mapFromStore(const Store &store); +QTCREATOR_UTILS_EXPORT bool isStore(const QVariant &value); + } // Utils #ifdef QTC_USE_STORE From d9a8eba35d4552082186c32aa7f0d58ffc9abbe8 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 2 Aug 2023 18:57:36 +0200 Subject: [PATCH 0914/1777] CMakePM: Enable cmake format action only if the tool is present If the tool is not present the menu action is disabled. Also add a link to the Qt Creator cmake-format documentation. Fixes: QTCREATORBUG-29415 Change-Id: I4afb33f0d5ce08975b0964d6bee80dfb41cfcde5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../cmakeprojectmanager/cmakeformatter.cpp | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeformatter.cpp b/src/plugins/cmakeprojectmanager/cmakeformatter.cpp index 9b6f88bfb46..9128adccad1 100644 --- a/src/plugins/cmakeprojectmanager/cmakeformatter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeformatter.cpp @@ -65,8 +65,15 @@ public: setLayouter([this] { using namespace Layouting; + + auto cmakeFormatter = new QLabel( + Tr::tr("<a href=\"%1\">CMakeFormat</a> command:") + .arg("qthelp://org.qt-project.qtcreator/doc/" + "creator-project-cmake.html#formatting-cmake-files")); + cmakeFormatter->setOpenExternalLinks(true); + return Column { - Row { Tr::tr("CMakeFormat command:"), command }, + Row { cmakeFormatter, command }, Space(10), Group { title(Tr::tr("Automatic Formatting on File Save")), @@ -97,7 +104,9 @@ public: auto updateActions = [this] { auto editor = EditorManager::currentEditor(); - formatFile.setEnabled(editor && isApplicable(editor->document())); + + formatFile.setEnabled(haveValidFormatCommand && editor + && isApplicable(editor->document())); }; connect(&autoFormatMime, &Utils::StringAspect::changed, @@ -108,6 +117,15 @@ public: this, &CMakeFormatterSettings::applyIfNecessary); readSettings(); + + const FilePath commandPath = command().searchInPath(); + haveValidFormatCommand = commandPath.exists() && commandPath.isExecutableFile(); + + formatFile.setEnabled(haveValidFormatCommand); + connect(&command, &FilePathAspect::validChanged, this, [this](bool validState) { + haveValidFormatCommand = validState; + formatFile.setEnabled(haveValidFormatCommand); + }); } bool isApplicable(const IDocument *document) const; @@ -125,6 +143,7 @@ public: } FilePathAspect command{this}; + bool haveValidFormatCommand{false}; BoolAspect autoFormatOnSave{this}; BoolAspect autoFormatOnlyCurrentProject{this}; StringAspect autoFormatMime{this}; From 5839a09e72b1f2e975ef9220a20225645549438a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 25 Aug 2023 15:11:45 +0200 Subject: [PATCH 0915/1777] Utils: Key/Store fix for Qt < 6.5 Change-Id: Ibf11f01a9502ab7da052db7630b5df2fdeda09ab Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/persistentsettings.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/persistentsettings.cpp b/src/libs/utils/persistentsettings.cpp index c193e754085..ac84a1731af 100644 --- a/src/libs/utils/persistentsettings.cpp +++ b/src/libs/utils/persistentsettings.cpp @@ -357,6 +357,12 @@ FilePath PersistentSettingsReader::filePath() \sa Utils::PersistentSettingsReader */ +#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0) +static QString xmlAttrFromKey(const Key &key) { return stringFromKey(key); } +#else +static Key xmlAttrFromKey(const Key &key) { return key; } +#endif + static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx, const QVariant &variant, const Key &key = {}) { @@ -367,7 +373,7 @@ static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx, w.writeStartElement(ctx.valueListElement); w.writeAttribute(ctx.typeAttribute, "QVariantList"); if (!key.isEmpty()) - w.writeAttribute(ctx.keyAttribute, key); + w.writeAttribute(ctx.keyAttribute, xmlAttrFromKey(key)); const QList<QVariant> list = variant.toList(); for (const QVariant &var : list) writeVariantValue(w, ctx, var); @@ -376,7 +382,7 @@ static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx, w.writeStartElement(ctx.valueMapElement); w.writeAttribute(ctx.typeAttribute, "QVariantMap"); if (!key.isEmpty()) - w.writeAttribute(ctx.keyAttribute, key); + w.writeAttribute(ctx.keyAttribute, xmlAttrFromKey(key)); const Store varMap = storeFromVariant(variant); const Store::const_iterator cend = varMap.constEnd(); for (Store::const_iterator i = varMap.constBegin(); i != cend; ++i) @@ -390,7 +396,7 @@ static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx, w.writeStartElement(ctx.valueElement); w.writeAttribute(ctx.typeAttribute, QLatin1String(variant.typeName())); if (!key.isEmpty()) - w.writeAttribute(ctx.keyAttribute, key); + w.writeAttribute(ctx.keyAttribute, xmlAttrFromKey(key)); switch (variant.type()) { case QVariant::Rect: w.writeCharacters(rectangleToString(variant.toRect())); From bd89cc1fd5b2ec5f7f980feb5bc579251d3b12a6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 29 Aug 2023 12:25:23 +0200 Subject: [PATCH 0916/1777] ProjectExplorer: Avoid a QTC_ASSERT for a legitimated situation Change-Id: I07ce3a286e366c039497379f8bfd2a7be9523c75 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/projectexplorer/devicesupport/devicemanager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index b288a74477f..9fac88602b5 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -427,8 +427,9 @@ DeviceManager::DeviceManager(bool isInstance) : d(std::make_unique<DeviceManager deviceHooks.deviceDisplayName = [](const FilePath &filePath) { auto device = DeviceManager::deviceForPath(filePath); - QTC_ASSERT(device, return filePath.toUserOutput()); - return device->displayName(); + if (device) + return device->displayName(); + return filePath.host().toString(); }; deviceHooks.ensureReachable = [](const FilePath &filePath, const FilePath &other) { From 735e9fc58e851db72f50012df02c412625e6b982 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 28 Aug 2023 17:32:11 +0200 Subject: [PATCH 0917/1777] ProjectExplorer: Remove ToolChain updating code from 4.3 The current format is apparently stable since May 2017. Change-Id: I8be705c87578f0e93dbb9494206ccf3e5d8b9e64 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/kitaspects.cpp | 73 +--------------------- 1 file changed, 3 insertions(+), 70 deletions(-) diff --git a/src/plugins/projectexplorer/kitaspects.cpp b/src/plugins/projectexplorer/kitaspects.cpp index c8dcaf6d07e..9e35593b337 100644 --- a/src/plugins/projectexplorer/kitaspects.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -37,10 +37,6 @@ using namespace Utils; namespace ProjectExplorer { -const char KITINFORMATION_ID_V1[] = "PE.Profile.ToolChain"; -const char KITINFORMATION_ID_V2[] = "PE.Profile.ToolChains"; -const char KITINFORMATION_ID_V3[] = "PE.Profile.ToolChainsV3"; - // -------------------------------------------------------------------------- // SysRootKitAspect: // -------------------------------------------------------------------------- @@ -331,7 +327,6 @@ public: private: Tasks validate(const Kit *k) const override; - void upgrade(Kit *k) override; void fix(Kit *k) override; void setup(Kit *k) override; @@ -410,70 +405,6 @@ Tasks ToolChainKitAspectFactory::validate(const Kit *k) const return result; } -void ToolChainKitAspectFactory::upgrade(Kit *k) -{ - QTC_ASSERT(k, return); - - const Id oldIdV1 = KITINFORMATION_ID_V1; - const Id oldIdV2 = KITINFORMATION_ID_V2; - - // upgrade <=4.1 to 4.2 (keep old settings around for now) - { - const QVariant oldValue = k->value(oldIdV1); - const QVariant value = k->value(oldIdV2); - if (value.isNull() && !oldValue.isNull()) { - QVariantMap newValue; - if (oldValue.typeId() == QVariant::Map) { - // Used between 4.1 and 4.2: - newValue = oldValue.toMap(); - } else { - // Used up to 4.1: - newValue.insert(Deprecated::Toolchain::languageId(Deprecated::Toolchain::Cxx), oldValue.toString()); - - const Id typeId = DeviceTypeKitAspect::deviceTypeId(k); - if (typeId == Constants::DESKTOP_DEVICE_TYPE) { - // insert default C compiler which did not exist before - newValue.insert(Deprecated::Toolchain::languageId(Deprecated::Toolchain::C), - defaultToolChainIds().value(Id(Constants::C_LANGUAGE_ID))); - } - } - k->setValue(oldIdV2, newValue); - k->setSticky(oldIdV2, k->isSticky(oldIdV1)); - } - } - - // upgrade 4.2 to 4.3 (keep old settings around for now) - { - const QVariant oldValue = k->value(oldIdV2); - const QVariant value = k->value(ToolChainKitAspect::id()); - if (value.isNull() && !oldValue.isNull()) { - QVariantMap newValue = oldValue.toMap(); - QVariantMap::iterator it = newValue.find(Deprecated::Toolchain::languageId(Deprecated::Toolchain::C)); - if (it != newValue.end()) - newValue.insert(Id(Constants::C_LANGUAGE_ID).toString(), it.value()); - it = newValue.find(Deprecated::Toolchain::languageId(Deprecated::Toolchain::Cxx)); - if (it != newValue.end()) - newValue.insert(Id(Constants::CXX_LANGUAGE_ID).toString(), it.value()); - k->setValue(ToolChainKitAspect::id(), newValue); - k->setSticky(ToolChainKitAspect::id(), k->isSticky(oldIdV2)); - } - } - - // upgrade 4.3-temporary-master-state to 4.3: - { - const QVariantMap valueMap = k->value(ToolChainKitAspect::id()).toMap(); - QVariantMap result; - for (const QString &key : valueMap.keys()) { - const int pos = key.lastIndexOf('.'); - if (pos >= 0) - result.insert(key.mid(pos + 1), valueMap.value(key)); - else - result.insert(key, valueMap.value(key)); - } - k->setValue(ToolChainKitAspect::id(), result); - } -} - void ToolChainKitAspectFactory::fix(Kit *k) { QTC_ASSERT(ToolChainManager::isLoaded(), return); @@ -613,7 +544,9 @@ QSet<Id> ToolChainKitAspectFactory::availableFeatures(const Kit *k) const Id ToolChainKitAspect::id() { - return KITINFORMATION_ID_V3; + // "PE.Profile.ToolChain" until 4.2 + // "PE.Profile.ToolChains" temporarily before 4.3 (May 2017) + return "PE.Profile.ToolChainsV3"; } QByteArray ToolChainKitAspect::toolChainId(const Kit *k, Id language) From 79bf9acd1bbca7a4bd1c062a53bfbc2ff020f0e9 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 29 Aug 2023 16:08:36 +0200 Subject: [PATCH 0918/1777] Utils: Allow storeFromVariant(QVariant()) This appears in reality. Change-Id: Ib09a737a3378e26d88397dceb32a38c3857ec9b2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/utils/store.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/utils/store.cpp b/src/libs/utils/store.cpp index acf77f899db..a2cc60c5d2f 100644 --- a/src/libs/utils/store.cpp +++ b/src/libs/utils/store.cpp @@ -31,6 +31,9 @@ Store storeFromVariant(const QVariant &value) if (value.typeId() == QMetaType::QVariantMap) return storeFromMap(value.toMap()); + if (!value.isValid()) + return {}; + QTC_CHECK(false); return Store(); } From e788deb1fc8077b65a09cd2bb1702582050c82cb Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 29 Aug 2023 14:10:21 +0200 Subject: [PATCH 0919/1777] TextEditor: add force update current Editor in action handler This can be used to update the editor widget connected in the action handler if the editor widget inside one editor changes. Change-Id: Idc9ea119aa2eaab34bd249c59ab9dfb255556fa1 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/texteditor/texteditoractionhandler.cpp | 5 +++++ src/plugins/texteditor/texteditoractionhandler.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 4224b504433..d22f8c96570 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -565,4 +565,9 @@ TextEditorActionHandler::~TextEditorActionHandler() delete d; } +void TextEditorActionHandler::updateCurrentEditor() +{ + d->updateCurrentEditor(Core::EditorManager::currentEditor()); +} + } // namespace TextEditor diff --git a/src/plugins/texteditor/texteditoractionhandler.h b/src/plugins/texteditor/texteditoractionhandler.h index 2bdb8efff3e..ce19e8535f9 100644 --- a/src/plugins/texteditor/texteditoractionhandler.h +++ b/src/plugins/texteditor/texteditoractionhandler.h @@ -49,6 +49,8 @@ public: uint optionalActions() const; ~TextEditorActionHandler(); + void updateCurrentEditor(); + private: Internal::TextEditorActionHandlerPrivate *d; }; From 7fccf02be7ef5345a9e9f25f4f913dde37686a14 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 30 Aug 2023 08:00:49 +0200 Subject: [PATCH 0920/1777] Core: Use QtcSettings in NavigationWidgetFactory::restoreSettings() Symmetric to saveSettings() now, and allows for central Key conversions later. Change-Id: I3fbf81c51197c9882b1f64ef591398b83aa0d633 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../classviewnavigationwidgetfactory.cpp | 2 +- .../classviewnavigationwidgetfactory.h | 2 +- .../coreplugin/foldernavigationwidget.cpp | 2 +- .../coreplugin/foldernavigationwidget.h | 2 +- .../coreplugin/inavigationwidgetfactory.cpp | 20 +++++++++++-------- .../coreplugin/inavigationwidgetfactory.h | 2 +- .../coreplugin/navigationsubwidget.cpp | 2 +- src/plugins/cppeditor/cppincludehierarchy.cpp | 2 +- src/plugins/cppeditor/cppincludehierarchy.h | 2 +- .../projectexplorer/projecttreewidget.cpp | 2 +- .../projectexplorer/projecttreewidget.h | 2 +- src/plugins/texteditor/outlinefactory.cpp | 2 +- src/plugins/texteditor/outlinefactory.h | 2 +- 13 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/plugins/classview/classviewnavigationwidgetfactory.cpp b/src/plugins/classview/classviewnavigationwidgetfactory.cpp index 4647ece36dd..7347bcd806e 100644 --- a/src/plugins/classview/classviewnavigationwidgetfactory.cpp +++ b/src/plugins/classview/classviewnavigationwidgetfactory.cpp @@ -61,7 +61,7 @@ void NavigationWidgetFactory::saveSettings(Utils::QtcSettings *settings, settings->setValue(settingsGroup, pw->flatMode()); } -void NavigationWidgetFactory::restoreSettings(QSettings *settings, int position, QWidget *widget) +void NavigationWidgetFactory::restoreSettings(Utils::QtcSettings *settings, int position, QWidget *widget) { auto pw = qobject_cast<NavigationWidget *>(widget); QTC_ASSERT(pw, return); diff --git a/src/plugins/classview/classviewnavigationwidgetfactory.h b/src/plugins/classview/classviewnavigationwidgetfactory.h index a1690c23bba..2eed11b4fe0 100644 --- a/src/plugins/classview/classviewnavigationwidgetfactory.h +++ b/src/plugins/classview/classviewnavigationwidgetfactory.h @@ -22,7 +22,7 @@ public: void saveSettings(Utils::QtcSettings *settings, int position, QWidget *widget) override; //! \implements Core::INavigationWidgetFactory::restoreSettings - void restoreSettings(QSettings *settings, int position, QWidget *widget) override; + void restoreSettings(Utils::QtcSettings *settings, int position, QWidget *widget) override; }; } // namespace Internal diff --git a/src/plugins/coreplugin/foldernavigationwidget.cpp b/src/plugins/coreplugin/foldernavigationwidget.cpp index 3bf45137557..562c2a8155b 100644 --- a/src/plugins/coreplugin/foldernavigationwidget.cpp +++ b/src/plugins/coreplugin/foldernavigationwidget.cpp @@ -857,7 +857,7 @@ void FolderNavigationWidgetFactory::saveSettings(Utils::QtcSettings *settings, kShowFoldersOnTopDefault); } -void FolderNavigationWidgetFactory::restoreSettings(QSettings *settings, int position, QWidget *widget) +void FolderNavigationWidgetFactory::restoreSettings(QtcSettings *settings, int position, QWidget *widget) { auto fnw = qobject_cast<FolderNavigationWidget *>(widget); QTC_ASSERT(fnw, return); diff --git a/src/plugins/coreplugin/foldernavigationwidget.h b/src/plugins/coreplugin/foldernavigationwidget.h index d725d4474e5..589582b00e4 100644 --- a/src/plugins/coreplugin/foldernavigationwidget.h +++ b/src/plugins/coreplugin/foldernavigationwidget.h @@ -56,7 +56,7 @@ public: Core::NavigationView createWidget() override; void saveSettings(Utils::QtcSettings *settings, int position, QWidget *widget) override; - void restoreSettings(QSettings *settings, int position, QWidget *widget) override; + void restoreSettings(Utils::QtcSettings *settings, int position, QWidget *widget) override; void addRootPath(Utils::Id id, const QString &displayName, const QIcon &icon, const Utils::FilePath &path) override; void removeRootPath(Utils::Id path) override; diff --git a/src/plugins/coreplugin/inavigationwidgetfactory.cpp b/src/plugins/coreplugin/inavigationwidgetfactory.cpp index 663fbb9829b..8517676e9e6 100644 --- a/src/plugins/coreplugin/inavigationwidgetfactory.cpp +++ b/src/plugins/coreplugin/inavigationwidgetfactory.cpp @@ -59,7 +59,9 @@ to the caller. */ -using namespace Core; +using namespace Utils; + +namespace Core { static QList<INavigationWidgetFactory *> g_navigationWidgetFactories; @@ -106,7 +108,7 @@ void INavigationWidgetFactory::setPriority(int priority) \sa id() */ -void INavigationWidgetFactory::setId(Utils::Id id) +void INavigationWidgetFactory::setId(Id id) { m_id = id; } @@ -135,7 +137,7 @@ QKeySequence INavigationWidgetFactory::activationSequence() const \sa INavigationWidgetFactory::restoreSettings() */ -void INavigationWidgetFactory::saveSettings(Utils::QtcSettings * /* settings */, +void INavigationWidgetFactory::saveSettings(QtcSettings * /* settings */, int /* position */, QWidget * /* widget */) { @@ -147,18 +149,20 @@ void INavigationWidgetFactory::saveSettings(Utils::QtcSettings * /* settings */, \sa INavigationWidgetFactory::saveSettings() */ -void INavigationWidgetFactory::restoreSettings(QSettings * /* settings */, int /* position */, QWidget * /* widget */) +void INavigationWidgetFactory::restoreSettings(QtcSettings * /* settings */, int /* position */, + QWidget * /* widget */) { } // Registers a new root path in the factory -void INavigationWidgetFactory::addRootPath(Utils::Id /*id*/, const QString & /*displayName*/, const QIcon & /*icon*/, const Utils::FilePath & /*path*/) +void INavigationWidgetFactory::addRootPath(Id /*id*/, const QString & /*displayName*/, + const QIcon & /*icon*/, const FilePath & /*path*/) { - } // Removes a root path from the factory -void INavigationWidgetFactory::removeRootPath(Utils::Id /*path*/) +void INavigationWidgetFactory::removeRootPath(Id /*path*/) { - } + +} // Core diff --git a/src/plugins/coreplugin/inavigationwidgetfactory.h b/src/plugins/coreplugin/inavigationwidgetfactory.h index 2f383afecd4..84b8b180171 100644 --- a/src/plugins/coreplugin/inavigationwidgetfactory.h +++ b/src/plugins/coreplugin/inavigationwidgetfactory.h @@ -57,7 +57,7 @@ public: virtual NavigationView createWidget() = 0; virtual void saveSettings(Utils::QtcSettings *settings, int position, QWidget *widget); - virtual void restoreSettings(QSettings *settings, int position, QWidget *widget); + virtual void restoreSettings(Utils::QtcSettings *settings, int position, QWidget *widget); virtual void addRootPath(Utils::Id id, const QString &displayName, const QIcon &icon, const Utils::FilePath &path); virtual void removeRootPath(Utils::Id id); diff --git a/src/plugins/coreplugin/navigationsubwidget.cpp b/src/plugins/coreplugin/navigationsubwidget.cpp index 838635c7b2f..fd9d0e5daed 100644 --- a/src/plugins/coreplugin/navigationsubwidget.cpp +++ b/src/plugins/coreplugin/navigationsubwidget.cpp @@ -165,7 +165,7 @@ void NavigationSubWidget::restoreSettings() if (!m_navigationWidget || !factory()) return; - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(m_parentWidget->settingsGroup()); factory()->restoreSettings(settings, position(), m_navigationWidget); settings->endGroup(); diff --git a/src/plugins/cppeditor/cppincludehierarchy.cpp b/src/plugins/cppeditor/cppincludehierarchy.cpp index 51c03797fd4..6a0ec5d4944 100644 --- a/src/plugins/cppeditor/cppincludehierarchy.cpp +++ b/src/plugins/cppeditor/cppincludehierarchy.cpp @@ -532,7 +532,7 @@ void CppIncludeHierarchyFactory::saveSettings(QtcSettings *settings, int positio hierarchyWidget(widget)->saveSettings(settings, position); } -void CppIncludeHierarchyFactory::restoreSettings(QSettings *settings, int position, QWidget *widget) +void CppIncludeHierarchyFactory::restoreSettings(QtcSettings *settings, int position, QWidget *widget) { hierarchyWidget(widget)->restoreSettings(settings, position); } diff --git a/src/plugins/cppeditor/cppincludehierarchy.h b/src/plugins/cppeditor/cppincludehierarchy.h index 0718af3b49f..e1e5e7d84d3 100644 --- a/src/plugins/cppeditor/cppincludehierarchy.h +++ b/src/plugins/cppeditor/cppincludehierarchy.h @@ -51,7 +51,7 @@ public: Core::NavigationView createWidget() override; void saveSettings(Utils::QtcSettings *settings, int position, QWidget *widget) override; - void restoreSettings(QSettings *settings, int position, QWidget *widget) override; + void restoreSettings(Utils::QtcSettings *settings, int position, QWidget *widget) override; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index c0113118a81..c59761cd169 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -657,7 +657,7 @@ void ProjectTreeWidgetFactory::saveSettings(QtcSettings *settings, int position, settings->setValueWithDefault(baseKey + kSyncKey, ptw->autoSynchronization(), kSyncDefault); } -void ProjectTreeWidgetFactory::restoreSettings(QSettings *settings, int position, QWidget *widget) +void ProjectTreeWidgetFactory::restoreSettings(QtcSettings *settings, int position, QWidget *widget) { auto ptw = qobject_cast<ProjectTreeWidget *>(widget); Q_ASSERT(ptw); diff --git a/src/plugins/projectexplorer/projecttreewidget.h b/src/plugins/projectexplorer/projecttreewidget.h index d4124287ea9..c6c2cad2d1a 100644 --- a/src/plugins/projectexplorer/projecttreewidget.h +++ b/src/plugins/projectexplorer/projecttreewidget.h @@ -92,7 +92,7 @@ public: ProjectTreeWidgetFactory(); Core::NavigationView createWidget() override; - void restoreSettings(QSettings *settings, int position, QWidget *widget) override; + void restoreSettings(Utils::QtcSettings *settings, int position, QWidget *widget) override; void saveSettings(Utils::QtcSettings *settings, int position, QWidget *widget) override; }; diff --git a/src/plugins/texteditor/outlinefactory.cpp b/src/plugins/texteditor/outlinefactory.cpp index bc9aa03c8ba..abec3a3ca66 100644 --- a/src/plugins/texteditor/outlinefactory.cpp +++ b/src/plugins/texteditor/outlinefactory.cpp @@ -224,7 +224,7 @@ void OutlineFactory::saveSettings(Utils::QtcSettings *settings, int position, QW widgetStack->saveSettings(settings, position); } -void OutlineFactory::restoreSettings(QSettings *settings, int position, QWidget *widget) +void OutlineFactory::restoreSettings(Utils::QtcSettings *settings, int position, QWidget *widget) { auto widgetStack = qobject_cast<OutlineWidgetStack *>(widget); Q_ASSERT(widgetStack); diff --git a/src/plugins/texteditor/outlinefactory.h b/src/plugins/texteditor/outlinefactory.h index 238c51c364c..99a0334a500 100644 --- a/src/plugins/texteditor/outlinefactory.h +++ b/src/plugins/texteditor/outlinefactory.h @@ -54,7 +54,7 @@ public: // from INavigationWidgetFactory Core::NavigationView createWidget() override; void saveSettings(Utils::QtcSettings *settings, int position, QWidget *widget) override; - void restoreSettings(QSettings *settings, int position, QWidget *widget) override; + void restoreSettings(Utils::QtcSettings *settings, int position, QWidget *widget) override; signals: void updateOutline(); From 271405e08ebc7bb9d4d2cfcbf0b6c0cb656d2e60 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 29 Aug 2023 09:00:26 +0200 Subject: [PATCH 0921/1777] QtSupport: Don't save QtVersions directly after creation Change-Id: I379262734bf11776d77576b8fca698ce691654b8 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/qtsupport/qtversionmanager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 8302045e674..bf797fe0612 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -119,7 +119,6 @@ void QtVersionManager::triggerQtVersionRestore() emit m_instance->qtVersionsLoaded(); emit m_instance->qtVersionsChanged(m_versions.keys(), QList<int>(), QList<int>()); - saveQtVersions(); const FilePath configFileName = globalSettingsFileName(); if (configFileName.exists()) { From 922da1fbb3d0480e78080c53a87550a694b9664e Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 10 Aug 2023 11:10:57 +0200 Subject: [PATCH 0922/1777] Process test: Prevent empty loop from being optimized out This should fix the macOS "Run tests" on GitHub Build Bot. Change-Id: Iae185d47fa33c97c63480b10d5a25a1d4c13f532 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- .../utils/process/processtestapp/processtestapp.cpp | 10 ++++++++-- tests/auto/utils/process/tst_process.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/auto/utils/process/processtestapp/processtestapp.cpp b/tests/auto/utils/process/processtestapp/processtestapp.cpp index 6cf7510eb78..77f36a362ec 100644 --- a/tests/auto/utils/process/processtestapp/processtestapp.cpp +++ b/tests/auto/utils/process/processtestapp/processtestapp.cpp @@ -161,10 +161,16 @@ int ProcessTestApp::BlockingProcess::main() { std::cout << "Blocking process successfully executed." << std::endl; const BlockType blockType = BlockType(qEnvironmentVariableIntValue(envVar())); + bool dummy = true; switch (blockType) { case BlockType::EndlessLoop: - while (true) - ; + while (true) { + if (dummy) { + // Note: Keep these lines, otherwise the compiler may optimize out the empty loop. + std::cout << "EndlessLoop started" << std::endl; + dummy = false; + } + } break; case BlockType::InfiniteSleep: QThread::sleep(INT_MAX); diff --git a/tests/auto/utils/process/tst_process.cpp b/tests/auto/utils/process/tst_process.cpp index 589adbb6fa8..52e4658778f 100644 --- a/tests/auto/utils/process/tst_process.cpp +++ b/tests/auto/utils/process/tst_process.cpp @@ -1216,7 +1216,6 @@ void tst_Process::mergedChannels_data() << false << false << false << true; QTest::newRow("ForwardedErrorChannel") << QProcess::ForwardedErrorChannel << true << false << false << false; - } void tst_Process::mergedChannels() @@ -1265,6 +1264,7 @@ void tst_Process::destroyBlockingProcess() subConfig.setupSubProcess(&process); process.start(); QVERIFY(process.waitForStarted()); + QVERIFY(process.isRunning()); QVERIFY(!process.waitForFinished(1000)); } From c7710acadd781e082f66ba389facaef3f5dce41b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 30 Aug 2023 07:39:54 +0200 Subject: [PATCH 0923/1777] Utils: Use Key more widely in QtcSettings And adapt user code. Change-Id: I6efe4ebe6823de4cc862f304a57e041b02c40eac Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/app/main.cpp | 2 +- src/libs/extensionsystem/pluginmanager.cpp | 8 +-- src/libs/utils/historycompleter.cpp | 4 +- src/libs/utils/historycompleter.h | 2 +- src/libs/utils/qtcsettings.h | 69 +++++++++---------- src/libs/utils/store.cpp | 5 ++ src/libs/utils/store.h | 2 + .../clangformat/clangformatsettings.cpp | 41 +++++------ .../classviewnavigationwidgetfactory.cpp | 16 ++--- .../actionmanager/actionmanager.cpp | 4 +- .../coreplugin/dialogs/newdialogwidget.cpp | 4 +- .../coreplugin/foldernavigationwidget.cpp | 2 +- src/plugins/coreplugin/generalsettings.cpp | 2 +- src/plugins/debugger/debuggerplugin.cpp | 6 +- src/plugins/designer/settingsmanager.cpp | 22 +++--- src/plugins/designer/settingsmanager.h | 3 - src/plugins/help/helpmanager.cpp | 14 ++-- src/plugins/help/helpplugin.cpp | 2 +- .../devicesupport/devicesettingspage.cpp | 3 +- .../jsonwizard/jsonfieldpage.cpp | 10 +-- .../jsonwizard/jsonfieldpage.h | 1 - .../projectexplorer/projectexplorer.cpp | 2 +- .../projectexplorer/projecttreewidget.cpp | 2 +- .../projectexplorer/toolchainmanager.cpp | 2 +- .../qmakeprojectmanager/wizards/qtwizard.cpp | 7 +- .../studio/studiosettingspage.cpp | 8 +-- .../qmldesignerbase/utils/designerpaths.cpp | 6 +- .../qmldesignerbase/utils/designerpaths.h | 4 +- src/plugins/qtsupport/exampleslistmodel.cpp | 6 +- .../scxmleditor/common/colorpicker.cpp | 12 ++-- src/plugins/scxmleditor/common/colorpicker.h | 7 +- src/plugins/studiowelcome/examplecheckout.cpp | 2 +- .../studiowelcome/studiowelcomeplugin.cpp | 2 +- src/plugins/texteditor/findinfiles.cpp | 4 +- src/shared/help/bookmarkmanager.cpp | 2 +- 35 files changed, 141 insertions(+), 147 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index b4ac0dfee9f..cccb492d242 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -661,7 +661,7 @@ int main(int argc, char **argv) QTranslator translator; QTranslator qtTranslator; QStringList uiLanguages = QLocale::system().uiLanguages(); - QString overrideLanguage = settings->value(QLatin1String("General/OverrideLanguage")).toString(); + QString overrideLanguage = settings->value("General/OverrideLanguage").toString(); if (!overrideLanguage.isEmpty()) uiLanguages.prepend(overrideLanguage); if (!options.uiLanguage.isEmpty()) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index c0395115441..503eecadeeb 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -1018,12 +1018,12 @@ void PluginManagerPrivate::writeSettings() void PluginManagerPrivate::readSettings() { if (globalSettings) { - defaultDisabledPlugins = globalSettings->value(QLatin1String(C_IGNORED_PLUGINS)).toStringList(); - defaultEnabledPlugins = globalSettings->value(QLatin1String(C_FORCEENABLED_PLUGINS)).toStringList(); + defaultDisabledPlugins = globalSettings->value(C_IGNORED_PLUGINS).toStringList(); + defaultEnabledPlugins = globalSettings->value(C_FORCEENABLED_PLUGINS).toStringList(); } if (settings) { - disabledPlugins = settings->value(QLatin1String(C_IGNORED_PLUGINS)).toStringList(); - forceEnabledPlugins = settings->value(QLatin1String(C_FORCEENABLED_PLUGINS)).toStringList(); + disabledPlugins = settings->value(C_IGNORED_PLUGINS).toStringList(); + forceEnabledPlugins = settings->value(C_FORCEENABLED_PLUGINS).toStringList(); } } diff --git a/src/libs/utils/historycompleter.cpp b/src/libs/utils/historycompleter.cpp index 7f299af1372..8eff3fdad82 100644 --- a/src/libs/utils/historycompleter.cpp +++ b/src/libs/utils/historycompleter.cpp @@ -207,10 +207,10 @@ QString HistoryCompleter::historyItem() const return d->list.at(0); } -bool HistoryCompleter::historyExistsFor(const QString &historyKey) +bool HistoryCompleter::historyExistsFor(const Key &historyKey) { QTC_ASSERT(theSettings, return false); - const QString fullKey = QLatin1String("CompleterHistory/") + historyKey; + const Key fullKey = "CompleterHistory/" + historyKey; return theSettings->value(fullKey).isValid(); } diff --git a/src/libs/utils/historycompleter.h b/src/libs/utils/historycompleter.h index b0842549fef..4afb3f420ca 100644 --- a/src/libs/utils/historycompleter.h +++ b/src/libs/utils/historycompleter.h @@ -23,7 +23,7 @@ public: bool removeHistoryItem(int index); QString historyItem() const; bool hasHistory() const { return historySize() > 0; } - static bool historyExistsFor(const QString &historyKey); + static bool historyExistsFor(const Key &historyKey); void clearHistory(); void addEntry(const QString &str); diff --git a/src/libs/utils/qtcsettings.h b/src/libs/utils/qtcsettings.h index 05d44ef2ffd..ba0550c31af 100644 --- a/src/libs/utils/qtcsettings.h +++ b/src/libs/utils/qtcsettings.h @@ -16,50 +16,45 @@ class QTCREATOR_UTILS_EXPORT QtcSettings : public QSettings public: using QSettings::QSettings; + QVariant value(const Key &key) const { return QSettings::value(stringFromKey(key)); } + QVariant value(const Key &key, const QVariant &def) const { return QSettings::value(stringFromKey(key), def); } + void setValue(const Key &key, const QVariant &value) { QSettings::setValue(stringFromKey(key), value); } + void remove(const Key &key) { QSettings::remove(stringFromKey(key)); } + bool contains(const Key &key) const { return QSettings::contains(stringFromKey(key)); } + template<typename T> - void setValueWithDefault(const Key &key, const T &val, const T &defaultValue); - template<typename T> - void setValueWithDefault(const Key &key, const T &val); + void setValueWithDefault(const Key &key, const T &val, const T &defaultValue) + { + setValueWithDefault(this, key, val, defaultValue); + } template<typename T> static void setValueWithDefault(QSettings *settings, const Key &key, const T &val, - const T &defaultValue); + const T &defaultValue) + { + if (val == defaultValue) + settings->remove(stringFromKey(key)); + else + settings->setValue(stringFromKey(key), QVariant::fromValue(val)); + } + + template<typename T> - static void setValueWithDefault(QSettings *settings, const Key &key, const T &val); + void setValueWithDefault(const Key &key, const T &val) + { + setValueWithDefault(this, key, val); + } + + template<typename T> + static void setValueWithDefault(QSettings *settings, const Key &key, const T &val) + { + if (val == T()) + settings->remove(stringFromKey(key)); + else + settings->setValue(stringFromKey(key), QVariant::fromValue(val)); + } }; -template<typename T> -void QtcSettings::setValueWithDefault(const Key &key, const T &val, const T &defaultValue) -{ - setValueWithDefault(this, key, val, defaultValue); -} - -template<typename T> -void QtcSettings::setValueWithDefault(const Key &key, const T &val) -{ - setValueWithDefault(this, key, val); -} - -template<typename T> -void QtcSettings::setValueWithDefault(QSettings *settings, - const Key &key, - const T &val, - const T &defaultValue) -{ - if (val == defaultValue) - settings->remove(key); - else - settings->setValue(key, QVariant::fromValue(val)); -} - -template<typename T> -void QtcSettings::setValueWithDefault(QSettings *settings, const Key &key, const T &val) -{ - if (val == T()) - settings->remove(key); - else - settings->setValue(key, QVariant::fromValue(val)); -} } // namespace Utils diff --git a/src/libs/utils/store.cpp b/src/libs/utils/store.cpp index a2cc60c5d2f..96425d8f467 100644 --- a/src/libs/utils/store.cpp +++ b/src/libs/utils/store.cpp @@ -116,4 +116,9 @@ bool isStore(const QVariant &value) return typeId == QMetaType::QVariantMap || typeId == qMetaTypeId<Store>(); } +Key numberedKey(const Key &key, int number) +{ + return key + Key::number(number); +} + } // Utils diff --git a/src/libs/utils/store.h b/src/libs/utils/store.h index cfebee71cc6..85f677151fa 100644 --- a/src/libs/utils/store.h +++ b/src/libs/utils/store.h @@ -29,6 +29,8 @@ QTCREATOR_UTILS_EXPORT QVariantMap mapFromStore(const Store &store); QTCREATOR_UTILS_EXPORT bool isStore(const QVariant &value); +QTCREATOR_UTILS_EXPORT Key numberedKey(const Key &key, int number); + } // Utils #ifdef QTC_USE_STORE diff --git a/src/plugins/clangformat/clangformatsettings.cpp b/src/plugins/clangformat/clangformatsettings.cpp index 1c76d14df6b..f6be8e922ab 100644 --- a/src/plugins/clangformat/clangformatsettings.cpp +++ b/src/plugins/clangformat/clangformatsettings.cpp @@ -6,8 +6,11 @@ #include <coreplugin/icore.h> +using namespace Utils; + namespace ClangFormat { -static const char FORMAT_CODE_INSTEAD_OF_INDENT_ID[] = "ClangFormat.FormatCodeInsteadOfIndent"; + +const char FORMAT_CODE_INSTEAD_OF_INDENT_ID[] = "ClangFormat.FormatCodeInsteadOfIndent"; ClangFormatSettings &ClangFormatSettings::instance() { @@ -17,43 +20,37 @@ ClangFormatSettings &ClangFormatSettings::instance() ClangFormatSettings::ClangFormatSettings() { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(QLatin1String(Constants::SETTINGS_ID)); - m_overrideDefaultFile = settings->value(QLatin1String(Constants::OVERRIDE_FILE_ID), false) - .toBool(); - m_formatWhileTyping = settings->value(QLatin1String(Constants::FORMAT_WHILE_TYPING_ID), false) - .toBool(); - m_formatOnSave = settings->value(QLatin1String(Constants::FORMAT_CODE_ON_SAVE_ID), false) - .toBool(); - m_fileSizeThreshold - = settings->value(QLatin1String(Constants::FILE_SIZE_THREDSHOLD), 1024).toInt(); + m_overrideDefaultFile = settings->value(Constants::OVERRIDE_FILE_ID, false).toBool(); + m_formatWhileTyping = settings->value(Constants::FORMAT_WHILE_TYPING_ID, false).toBool(); + m_formatOnSave = settings->value(Constants::FORMAT_CODE_ON_SAVE_ID, false).toBool(); + m_fileSizeThreshold = settings->value(Constants::FILE_SIZE_THREDSHOLD, 1024).toInt(); // Convert old settings to new ones. New settings were added to QtC 8.0 - bool isOldFormattingOn - = settings->value(QLatin1String(FORMAT_CODE_INSTEAD_OF_INDENT_ID), false).toBool(); - Core::ICore::settings()->remove(QLatin1String(FORMAT_CODE_INSTEAD_OF_INDENT_ID)); + bool isOldFormattingOn = settings->value(FORMAT_CODE_INSTEAD_OF_INDENT_ID, false).toBool(); + Core::ICore::settings()->remove(FORMAT_CODE_INSTEAD_OF_INDENT_ID); if (isOldFormattingOn) { - settings->setValue(QLatin1String(Constants::MODE_ID), + settings->setValue(Constants::MODE_ID, static_cast<int>(ClangFormatSettings::Mode::Formatting)); m_mode = ClangFormatSettings::Mode::Formatting; } else m_mode = static_cast<ClangFormatSettings::Mode>( - settings->value(QLatin1String(Constants::MODE_ID), ClangFormatSettings::Mode::Indenting) - .toInt()); + settings->value(Constants::MODE_ID, ClangFormatSettings::Mode::Indenting).toInt()); settings->endGroup(); } void ClangFormatSettings::write() const { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(QLatin1String(Constants::SETTINGS_ID)); - settings->setValue(QLatin1String(Constants::OVERRIDE_FILE_ID), m_overrideDefaultFile); - settings->setValue(QLatin1String(Constants::FORMAT_WHILE_TYPING_ID), m_formatWhileTyping); - settings->setValue(QLatin1String(Constants::FORMAT_CODE_ON_SAVE_ID), m_formatOnSave); - settings->setValue(QLatin1String(Constants::MODE_ID), static_cast<int>(m_mode)); - settings->setValue(QLatin1String(Constants::FILE_SIZE_THREDSHOLD), m_fileSizeThreshold); + settings->setValue(Constants::OVERRIDE_FILE_ID, m_overrideDefaultFile); + settings->setValue(Constants::FORMAT_WHILE_TYPING_ID, m_formatWhileTyping); + settings->setValue(Constants::FORMAT_CODE_ON_SAVE_ID, m_formatOnSave); + settings->setValue(Constants::MODE_ID, static_cast<int>(m_mode)); + settings->setValue(Constants::FILE_SIZE_THREDSHOLD, m_fileSizeThreshold); settings->endGroup(); } diff --git a/src/plugins/classview/classviewnavigationwidgetfactory.cpp b/src/plugins/classview/classviewnavigationwidgetfactory.cpp index 7347bcd806e..91612317be5 100644 --- a/src/plugins/classview/classviewnavigationwidgetfactory.cpp +++ b/src/plugins/classview/classviewnavigationwidgetfactory.cpp @@ -9,7 +9,7 @@ #include <utils/qtcassert.h> #include <utils/qtcsettings.h> -#include <QSettings> +using namespace Utils; namespace ClassView { namespace Internal { @@ -42,32 +42,30 @@ Core::NavigationView NavigationWidgetFactory::createWidget() /*! Returns a settings prefix for \a position. */ -static QString settingsPrefix(int position) +static Key settingsPrefix(int position) { - return QString::fromLatin1("ClassView.Treewidget.%1.FlatMode").arg(position); + return numberedKey("ClassView.Treewidget.", position) + ".FlatMode"; } //! Flat mode settings -void NavigationWidgetFactory::saveSettings(Utils::QtcSettings *settings, - int position, - QWidget *widget) +void NavigationWidgetFactory::saveSettings(QtcSettings *settings, int position, QWidget *widget) { auto pw = qobject_cast<NavigationWidget *>(widget); QTC_ASSERT(pw, return); // .beginGroup is not used - to prevent simultaneous access - QString settingsGroup = settingsPrefix(position); + Key settingsGroup = settingsPrefix(position); settings->setValue(settingsGroup, pw->flatMode()); } -void NavigationWidgetFactory::restoreSettings(Utils::QtcSettings *settings, int position, QWidget *widget) +void NavigationWidgetFactory::restoreSettings(QtcSettings *settings, int position, QWidget *widget) { auto pw = qobject_cast<NavigationWidget *>(widget); QTC_ASSERT(pw, return); // .beginGroup is not used - to prevent simultaneous access - QString settingsGroup = settingsPrefix(position); + Key settingsGroup = settingsPrefix(position); pw->setFlatMode(settings->value(settingsGroup, false).toBool()); } diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index 54e58dc217a..f17cc76d9ae 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -490,8 +490,8 @@ void ActionManagerPrivate::readUserSettings(Id id, Command *cmd) void ActionManagerPrivate::saveSettings(Command *cmd) { - const QString id = cmd->id().toString(); - const QString settingsKey = QLatin1String(kKeyboardSettingsKeyV2) + '/' + id; + const Key id = cmd->id().toKey(); + const Key settingsKey = kKeyboardSettingsKeyV2 + '/' + id; const QList<QKeySequence> keys = cmd->keySequences(); const QList<QKeySequence> defaultKeys = cmd->defaultKeySequences(); if (keys != defaultKeys) { diff --git a/src/plugins/coreplugin/dialogs/newdialogwidget.cpp b/src/plugins/coreplugin/dialogs/newdialogwidget.cpp index 545ca9c4169..ca616c8b65c 100644 --- a/src/plugins/coreplugin/dialogs/newdialogwidget.cpp +++ b/src/plugins/coreplugin/dialogs/newdialogwidget.cpp @@ -327,8 +327,8 @@ void NewDialogWidget::showDialog() { QModelIndex idx; - QString lastPlatform = ICore::settings()->value(QLatin1String(LAST_PLATFORM_KEY)).toString(); - QString lastCategory = ICore::settings()->value(QLatin1String(LAST_CATEGORY_KEY)).toString(); + QString lastPlatform = ICore::settings()->value(LAST_PLATFORM_KEY).toString(); + QString lastCategory = ICore::settings()->value(LAST_CATEGORY_KEY).toString(); if (!lastPlatform.isEmpty()) { int index = m_comboBox->findData(lastPlatform); diff --git a/src/plugins/coreplugin/foldernavigationwidget.cpp b/src/plugins/coreplugin/foldernavigationwidget.cpp index 562c2a8155b..6cee44c5917 100644 --- a/src/plugins/coreplugin/foldernavigationwidget.cpp +++ b/src/plugins/coreplugin/foldernavigationwidget.cpp @@ -861,7 +861,7 @@ void FolderNavigationWidgetFactory::restoreSettings(QtcSettings *settings, int p { auto fnw = qobject_cast<FolderNavigationWidget *>(widget); QTC_ASSERT(fnw, return); - const QString base = kSettingsBase + QString::number(position); + const Key base = kSettingsBase + Key::number(position); fnw->setHiddenFilesFilter(settings->value(base + kHiddenFilesKey, kHiddenFilesDefault).toBool()); fnw->setAutoSynchronization(settings->value(base + kSyncKey, kAutoSyncDefault).toBool()); fnw->setShowBreadCrumbs( diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 13f853e7592..4cc865de8ea 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -263,7 +263,7 @@ QString GeneralSettingsWidget::language() void GeneralSettingsWidget::setLanguage(const QString &locale) { QtcSettings *settings = ICore::settings(); - if (settings->value(QLatin1String("General/OverrideLanguage")).toString() != locale) { + if (settings->value("General/OverrideLanguage").toString() != locale) { RestartDialog dialog(ICore::dialogParent(), Tr::tr("The language change will take effect after restart.")); dialog.exec(); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 42c5244cd57..f155365bd7e 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1477,12 +1477,12 @@ void DebuggerPluginPrivate::parseCommandLineArguments() QTimer::singleShot(0, this, &DebuggerPluginPrivate::runScheduled); } -static void setConfigValue(const QString &name, const QVariant &value) +static void setConfigValue(const Key &name, const QVariant &value) { ICore::settings()->setValue("DebugMode/" + name, value); } -static QVariant configValue(const QString &name) +static QVariant configValue(const Key &name) { return ICore::settings()->value("DebugMode/" + name); } @@ -1658,7 +1658,7 @@ void DebuggerPluginPrivate::reloadDebuggingHelpers() void DebuggerPluginPrivate::startRemoteCdbSession() { - const QString connectionKey = "CdbRemoteConnection"; + const Key connectionKey = "CdbRemoteConnection"; Kit *kit = findUniversalCdbKit(); QTC_ASSERT(kit, return); diff --git a/src/plugins/designer/settingsmanager.cpp b/src/plugins/designer/settingsmanager.cpp index f533d401072..1cef5f4b074 100644 --- a/src/plugins/designer/settingsmanager.cpp +++ b/src/plugins/designer/settingsmanager.cpp @@ -4,12 +4,20 @@ #include "settingsmanager.h" #include <coreplugin/icore.h> + #include <utils/qtcassert.h> -#include <QSettings> -#include <QDebug> +using namespace Utils; -using namespace Designer::Internal; +namespace Designer::Internal { + +static Key addPrefix(const QString &name) +{ + Key result = keyFromString(name); + if (Core::ICore::settings()->group().isEmpty()) + result.prepend("Designer"); + return result; +} void SettingsManager::beginGroup(const QString &prefix) { @@ -41,10 +49,4 @@ void SettingsManager::remove(const QString &key) Core::ICore::settings()->remove(addPrefix(key)); } -QString SettingsManager::addPrefix(const QString &name) const -{ - QString result = name; - if (Core::ICore::settings()->group().isEmpty()) - result.prepend("Designer"); - return result; -} +} // Designer::Internal diff --git a/src/plugins/designer/settingsmanager.h b/src/plugins/designer/settingsmanager.h index 633e58d117d..06ce37a98cb 100644 --- a/src/plugins/designer/settingsmanager.h +++ b/src/plugins/designer/settingsmanager.h @@ -21,9 +21,6 @@ public: void setValue(const QString &key, const QVariant &value) override; QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const override; void remove(const QString &key) override; - -private: - QString addPrefix(const QString &name) const; }; } // namespace Internal diff --git a/src/plugins/help/helpmanager.cpp b/src/plugins/help/helpmanager.cpp index 3c053662d54..f971f825689 100644 --- a/src/plugins/help/helpmanager.cpp +++ b/src/plugins/help/helpmanager.cpp @@ -29,13 +29,14 @@ #include <QtHelp/QHelpLink> using namespace Core; - -static const char kUserDocumentationKey[] = "Help/UserDocumentation"; -static const char kUpdateDocumentationTask[] = "UpdateDocumentationTask"; +using namespace Utils; namespace Help { namespace Internal { +const char kUserDocumentationKey[] = "Help/UserDocumentation"; +const char kUpdateDocumentationTask[] = "UpdateDocumentationTask"; + struct HelpManagerPrivate { HelpManagerPrivate() = default; @@ -357,8 +358,8 @@ HelpManagerPrivate::~HelpManagerPrivate() const QStringList HelpManagerPrivate::documentationFromInstaller() { - QSettings *installSettings = ICore::settings(); - const QStringList documentationPaths = installSettings->value(QLatin1String("Help/InstalledDocumentation")) + QtcSettings *installSettings = ICore::settings(); + const QStringList documentationPaths = installSettings->value("Help/InstalledDocumentation") .toStringList(); QStringList documentationFiles; for (const QString &path : documentationPaths) { @@ -377,8 +378,7 @@ const QStringList HelpManagerPrivate::documentationFromInstaller() void HelpManagerPrivate::readSettings() { - m_userRegisteredFiles = Utils::toSet(ICore::settings()->value(QLatin1String(kUserDocumentationKey)) - .toStringList()); + m_userRegisteredFiles = Utils::toSet(ICore::settings()->value(kUserDocumentationKey).toStringList()); } void HelpManagerPrivate::writeSettings() diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 0b3ad2f011c..346b2858d22 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -249,7 +249,7 @@ HelpPluginPrivate::HelpPluginPrivate() Core::HelpManager::HelpModeAlways); }); - const QString qdsStandaloneEntry = "QML/Designer/StandAloneMode"; //entry from designer settings + const Key qdsStandaloneEntry = "QML/Designer/StandAloneMode"; //entry from designer settings const bool isDesigner = Core::ICore::settings()->value(qdsStandaloneEntry, false).toBool(); action = new QAction(Tr::tr("Report Bug..."), this); diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp b/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp index 4e40255b468..9398294912b 100644 --- a/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp @@ -221,8 +221,7 @@ DeviceSettingsWidget::DeviceSettingsWidget() addButton->setEnabled(hasDeviceFactories); - int lastIndex = ICore::settings() - ->value(QLatin1String(LastDeviceIndexKey), 0).toInt(); + int lastIndex = ICore::settings()->value(LastDeviceIndexKey, 0).toInt(); if (lastIndex == -1) lastIndex = 0; if (lastIndex < m_configurationComboBox->count()) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp index e3a522a3e40..52f3b2bc59a 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp @@ -76,6 +76,11 @@ static void warnAboutUnsupportedKeys(const QVariantMap &map, const QString &name } } +static Key fullSettingsKey(const QString &fieldKey) +{ + return "Wizards/" + keyFromString(fieldKey); +} + // -------------------------------------------------------------------- // Helper: @@ -1413,9 +1418,4 @@ JsonFieldPage::Field *JsonFieldPage::createFieldData(const QString &type) return nullptr; } -QString JsonFieldPage::fullSettingsKey(const QString &fieldKey) -{ - return "Wizards/" + fieldKey; -} - } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h index 69ba2a50fe5..578d16c711e 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h @@ -126,7 +126,6 @@ private: static QHash<QString, FieldFactory> m_factories; static Field *createFieldData(const QString &type); - static QString fullSettingsKey(const QString &fieldKey); QFormLayout *m_formLayout; QLabel *m_errorLabel; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 8a8c835e21d..06df7b90d4b 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2216,7 +2216,7 @@ void ProjectExplorerPluginPrivate::savePersistentSettings() } QtcSettings *s = ICore::settings(); - s->remove(QLatin1String("ProjectExplorer/RecentProjects/Files")); + s->remove("ProjectExplorer/RecentProjects/Files"); QStringList fileNames; QStringList displayNames; diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index c59761cd169..c3b86ce4206 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -661,7 +661,7 @@ void ProjectTreeWidgetFactory::restoreSettings(QtcSettings *settings, int positi { auto ptw = qobject_cast<ProjectTreeWidget *>(widget); Q_ASSERT(ptw); - const QString baseKey = kBaseKey + QString::number(position); + const Key baseKey = kBaseKey + Key::number(position); ptw->setProjectFilter( settings->value(baseKey + kProjectFilterKey, kProjectFilterDefault).toBool()); ptw->setGeneratedFilesFilter( diff --git a/src/plugins/projectexplorer/toolchainmanager.cpp b/src/plugins/projectexplorer/toolchainmanager.cpp index d7f20d6f0f5..a0ae2d1cbe9 100644 --- a/src/plugins/projectexplorer/toolchainmanager.cpp +++ b/src/plugins/projectexplorer/toolchainmanager.cpp @@ -62,7 +62,7 @@ using namespace Internal; const char DETECT_X64_AS_X32_KEY[] = "ProjectExplorer/Toolchains/DetectX64AsX32"; -static QString badToolchainsKey() { return {"BadToolChains"}; } +static Key badToolchainsKey() { return "BadToolChains"; } // -------------------------------------------------------------------------- // ToolChainManager diff --git a/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp b/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp index 2e1a6baf9bc..fbfa7cee520 100644 --- a/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp +++ b/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp @@ -29,6 +29,7 @@ using namespace ProjectExplorer; using namespace QtSupport; +using namespace Utils; namespace QmakeProjectManager { namespace Internal { @@ -88,9 +89,9 @@ QString QtWizard::templateDir() bool QtWizard::lowerCaseFiles() { - QString lowerCaseSettingsKey = QLatin1String(CppEditor::Constants::CPPEDITOR_SETTINGSGROUP); - lowerCaseSettingsKey += QLatin1Char('/'); - lowerCaseSettingsKey += QLatin1String(CppEditor::Constants::LOWERCASE_CPPFILES_KEY); + Key lowerCaseSettingsKey = CppEditor::Constants::CPPEDITOR_SETTINGSGROUP; + lowerCaseSettingsKey += '/'; + lowerCaseSettingsKey += CppEditor::Constants::LOWERCASE_CPPFILES_KEY; const bool lowerCaseDefault = CppEditor::Constants::LOWERCASE_CPPFILES_DEFAULT; return Core::ICore::settings()->value(lowerCaseSettingsKey, QVariant(lowerCaseDefault)).toBool(); } diff --git a/src/plugins/qmldesignerbase/studio/studiosettingspage.cpp b/src/plugins/qmldesignerbase/studio/studiosettingspage.cpp index d94efbd666b..d88c4cf409b 100644 --- a/src/plugins/qmldesignerbase/studio/studiosettingspage.cpp +++ b/src/plugins/qmldesignerbase/studio/studiosettingspage.cpp @@ -178,15 +178,15 @@ void StudioSettingsPage::apply() QSettings *s = Core::ICore::settings(); const QString value = m_pathChooserExamples->filePath().toString(); - if (s->value(Paths::exampleDownloadPath.toString(), false).toString() != value) { - s->setValue(Paths::exampleDownloadPath.toString(), value); + if (s->value(Paths::exampleDownloadPath, false).toString() != value) { + s->setValue(Paths::exampleDownloadPath, value); emit examplesDownloadPathChanged(value); } const QString bundlesPath = m_pathChooserBundles->filePath().toString(); - if (s->value(Paths::bundlesDownloadPath.toString()).toString() != bundlesPath) { - s->setValue(Paths::bundlesDownloadPath.toString(), bundlesPath); + if (s->value(Paths::bundlesDownloadPath).toString() != bundlesPath) { + s->setValue(Paths::bundlesDownloadPath, bundlesPath); emit bundlesDownloadPathChanged(bundlesPath); const QString restartText = tr("Changing bundle path will take effect after restart."); diff --git a/src/plugins/qmldesignerbase/utils/designerpaths.cpp b/src/plugins/qmldesignerbase/utils/designerpaths.cpp index 53b4b7ea37e..da4ce8ce082 100644 --- a/src/plugins/qmldesignerbase/utils/designerpaths.cpp +++ b/src/plugins/qmldesignerbase/utils/designerpaths.cpp @@ -30,15 +30,13 @@ Utils::FilePath defaultBundlesPath() QString examplesPathSetting() { - return Core::ICore::settings() - ->value(exampleDownloadPath.toString(), defaultExamplesPath().toString()) + return Core::ICore::settings()->value(exampleDownloadPath, defaultExamplesPath().toString()) .toString(); } QString bundlesPathSetting() { - return Core::ICore::settings() - ->value(bundlesDownloadPath.toString(), defaultBundlesPath().toString()) + return Core::ICore::settings()->value(bundlesDownloadPath, defaultBundlesPath().toString()) .toString(); } diff --git a/src/plugins/qmldesignerbase/utils/designerpaths.h b/src/plugins/qmldesignerbase/utils/designerpaths.h index df53997457f..b038343b25e 100644 --- a/src/plugins/qmldesignerbase/utils/designerpaths.h +++ b/src/plugins/qmldesignerbase/utils/designerpaths.h @@ -9,8 +9,8 @@ namespace QmlDesigner::Paths { -inline constexpr QStringView exampleDownloadPath = u"StudioConfig/ExamplesDownloadPath"; -inline constexpr QStringView bundlesDownloadPath = u"StudioConfig/BundlesDownloadPath"; +constexpr char exampleDownloadPath[] = "StudioConfig/ExamplesDownloadPath"; +constexpr char bundlesDownloadPath[] = "StudioConfig/BundlesDownloadPath"; QMLDESIGNERBASE_EXPORT Utils::FilePath defaultExamplesPath(); QMLDESIGNERBASE_EXPORT Utils::FilePath defaultBundlesPath(); diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 0def03b90b6..bb2f9e0fa00 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -49,13 +49,13 @@ Q_GLOBAL_STATIC_WITH_ARGS(QVersionNumber, minQtVersionForCategories, (6, 5, 1)); void ExampleSetModel::writeCurrentIdToSettings(int currentIndex) const { - QSettings *settings = Core::ICore::settings(); - settings->setValue(QLatin1String(kSelectedExampleSetKey), getId(currentIndex)); + QtcSettings *settings = Core::ICore::settings(); + settings->setValue(kSelectedExampleSetKey, getId(currentIndex)); } int ExampleSetModel::readCurrentIndexFromSettings() const { - QVariant id = Core::ICore::settings()->value(QLatin1String(kSelectedExampleSetKey)); + QVariant id = Core::ICore::settings()->value(kSelectedExampleSetKey); for (int i=0; i < rowCount(); i++) { if (id == getId(i)) return i; diff --git a/src/plugins/scxmleditor/common/colorpicker.cpp b/src/plugins/scxmleditor/common/colorpicker.cpp index 88f4d6d22a7..a367ebbd7d0 100644 --- a/src/plugins/scxmleditor/common/colorpicker.cpp +++ b/src/plugins/scxmleditor/common/colorpicker.cpp @@ -12,7 +12,9 @@ #include <QHBoxLayout> #include <QToolButton> -using namespace ScxmlEditor::Common; +using namespace Utils; + +namespace ScxmlEditor::Common { const char C_SETTINGS_COLORPICKER_LASTUSEDCOLORS[] = "ScxmlEditor/ColorPickerLastUsedColors_%1"; constexpr int C_BUTTON_COLUMNS_COUNT = 5; @@ -55,15 +57,15 @@ ColorPicker::ColorPicker(const QString &key, QWidget *parent) }.attachTo(this); const QStringList lastColors = Core::ICore::settings()->value( - QString::fromLatin1(C_SETTINGS_COLORPICKER_LASTUSEDCOLORS).arg(m_key), QStringList()).toStringList(); + C_SETTINGS_COLORPICKER_LASTUSEDCOLORS + keyFromString(m_key), QStringList()).toStringList(); for (int i = lastColors.count(); i--;) setLastUsedColor(lastColors[i]); } ColorPicker::~ColorPicker() { - Core::ICore::settings()->setValue(QString::fromLatin1(C_SETTINGS_COLORPICKER_LASTUSEDCOLORS).arg(m_key), - m_lastUsedColorNames); + Core::ICore::settings()->setValue( + C_SETTINGS_COLORPICKER_LASTUSEDCOLORS + keyFromString(m_key), m_lastUsedColorNames); } void ColorPicker::setLastUsedColor(const QString &colorName) @@ -99,3 +101,5 @@ QToolButton *ColorPicker::createButton(const QColor &color) return button; } + +} // ScxmlEditor::Common diff --git a/src/plugins/scxmleditor/common/colorpicker.h b/src/plugins/scxmleditor/common/colorpicker.h index 1576e8a9116..73399068904 100644 --- a/src/plugins/scxmleditor/common/colorpicker.h +++ b/src/plugins/scxmleditor/common/colorpicker.h @@ -10,9 +10,7 @@ class QHBoxLayout; class QToolButton; QT_END_NAMESPACE -namespace ScxmlEditor { - -namespace Common { +namespace ScxmlEditor::Common { class ColorPicker : public QFrame { @@ -37,5 +35,4 @@ private: QHBoxLayout *m_lastUsedColorContainer; }; -} // namespace Common -} // namespace ScxmlEditor +} // namespace ScxmlEditor::Common diff --git a/src/plugins/studiowelcome/examplecheckout.cpp b/src/plugins/studiowelcome/examplecheckout.cpp index 52ad72ce8a8..7b13c59fa88 100644 --- a/src/plugins/studiowelcome/examplecheckout.cpp +++ b/src/plugins/studiowelcome/examplecheckout.cpp @@ -57,7 +57,7 @@ void DataModelDownloader::usageStatisticsDownloadExample(const QString &name) bool DataModelDownloader::downloadEnabled() const { - const QString lastQDSVersionEntry = "QML/Designer/EnableWelcomePageDownload"; + const Key lastQDSVersionEntry = "QML/Designer/EnableWelcomePageDownload"; return Core::ICore::settings()->value(lastQDSVersionEntry, false).toBool(); } diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index a794a2c3fc3..927ad2f3c35 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -516,7 +516,7 @@ void StudioWelcomePlugin::initialize() static bool forceDownLoad() { - const QString lastQDSVersionEntry = "QML/Designer/ForceWelcomePageDownload"; + const Key lastQDSVersionEntry = "QML/Designer/ForceWelcomePageDownload"; return Core::ICore::settings()->value(lastQDSVersionEntry, false).toBool(); } diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index 8156c10b18c..d780d1b1fbd 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -143,10 +143,10 @@ QWidget *FindInFiles::createConfigWidget() [this] { setSearchDir(m_directory->filePath()); }); connect(this, &BaseFileFind::searchDirChanged, m_directory, &PathChooser::setFilePath); m_directory->setHistoryCompleter(HistoryKey, /*restoreLastItemFromHistory=*/ true); - if (!HistoryCompleter::historyExistsFor(QLatin1String(HistoryKey))) { + if (!HistoryCompleter::historyExistsFor(HistoryKey)) { auto completer = static_cast<HistoryCompleter *>(m_directory->lineEdit()->completer()); const QStringList legacyHistory = ICore::settings()->value( - QLatin1String("Find/FindInFiles/directories")).toStringList(); + "Find/FindInFiles/directories").toStringList(); for (const QString &dir: legacyHistory) completer->addEntry(dir); } diff --git a/src/shared/help/bookmarkmanager.cpp b/src/shared/help/bookmarkmanager.cpp index 72bd5db3214..2f287f2d310 100644 --- a/src/shared/help/bookmarkmanager.cpp +++ b/src/shared/help/bookmarkmanager.cpp @@ -600,7 +600,7 @@ void BookmarkManager::saveBookmarks() QDataStream stream(&bookmarks, QIODevice::WriteOnly); readBookmarksRecursive(treeModel->invisibleRootItem(), stream, 0); - Core::ICore::settings()->setValue(QLatin1String(kBookmarksKey), bookmarks); + Core::ICore::settings()->setValue(kBookmarksKey, bookmarks); } QStringList BookmarkManager::bookmarkFolders() const From 9dc9a43f40ad41a6b6f819aac3104f43a0665c8d Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 28 Jul 2023 14:49:05 +0200 Subject: [PATCH 0924/1777] Adapt find tool bar input fields to searched widget's font Adapt the font of the search and replace input fields to the font of the widget that is searched. This makes it use the text editor font when searching in the text editor but keeps the "application font" when searching in other widgets. Change-Id: I8bd3b5dd3d14ab0e774f7272be236c35abd12de0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/coreplugin/find/currentdocumentfind.cpp | 5 +++++ src/plugins/coreplugin/find/currentdocumentfind.h | 2 ++ src/plugins/coreplugin/find/findtoolbar.cpp | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/src/plugins/coreplugin/find/currentdocumentfind.cpp b/src/plugins/coreplugin/find/currentdocumentfind.cpp index 232c8904c0e..ed5803b24e2 100644 --- a/src/plugins/coreplugin/find/currentdocumentfind.cpp +++ b/src/plugins/coreplugin/find/currentdocumentfind.cpp @@ -240,6 +240,11 @@ bool CurrentDocumentFind::eventFilter(QObject *obj, QEvent *event) return QObject::eventFilter(obj, event); } +QWidget *CurrentDocumentFind::currentWidget() const +{ + return m_currentWidget.get(); +} + void CurrentDocumentFind::aggregationChanged() { if (m_currentWidget) { diff --git a/src/plugins/coreplugin/find/currentdocumentfind.h b/src/plugins/coreplugin/find/currentdocumentfind.h index 31fbefa2baa..241d9d54e62 100644 --- a/src/plugins/coreplugin/find/currentdocumentfind.h +++ b/src/plugins/coreplugin/find/currentdocumentfind.h @@ -45,6 +45,8 @@ public: bool eventFilter(QObject *obj, QEvent *event) override; + QWidget *currentWidget() const; + signals: void changed(); void candidateChanged(); diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index 96a99f6eba7..7a4157e5975 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -490,6 +490,12 @@ void FindToolBar::adaptToCandidate() updateActions(); if (findToolBarPlaceHolder() == FindToolBarPlaceHolder::getCurrent()) { m_currentDocumentFind->acceptCandidate(); + if (QWidget *widget = m_currentDocumentFind->currentWidget()) { + QFont f = font(); + f.setFamily(widget->font().family()); + m_findEdit->setFont(f); + m_replaceEdit->setFont(f); + } if (isVisible() && m_currentDocumentFind->isEnabled()) m_currentDocumentFind->highlightAll(getFindText(), effectiveFindFlags()); } From 41184bc9fc7361a30e5f6a73542eaa84ec54870e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 30 Aug 2023 09:18:19 +0200 Subject: [PATCH 0925/1777] Utils: Use numberedKey(Key, int) more wildly Will ease transition to a key class that doen's have ::number() Change-Id: Ib2f2957c916f41b0731a2033422bfbf7e429bcc8 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../baremetal/debugserverprovidermanager.cpp | 6 ++-- .../cmaketoolsettingsaccessor.cpp | 4 +-- .../coreplugin/foldernavigationwidget.cpp | 6 ++-- src/plugins/debugger/debuggeritemmanager.cpp | 4 +-- .../toolssettingsaccessor.cpp | 2 +- .../projectexplorer/buildconfiguration.cpp | 6 ++-- src/plugins/projectexplorer/buildsteplist.cpp | 4 +-- .../projectexplorer/editorconfiguration.cpp | 4 +-- src/plugins/projectexplorer/kitmanager.cpp | 4 +-- src/plugins/projectexplorer/project.cpp | 4 +-- .../projectexplorer/projectexplorer.cpp | 4 +-- .../projectexplorer/projecttreewidget.cpp | 4 +-- src/plugins/projectexplorer/target.cpp | 12 ++++---- .../toolchainsettingsaccessor.cpp | 4 +-- .../projectexplorer/userfileaccessor.cpp | 30 +++++++++---------- src/plugins/qnx/qnxsettingspage.cpp | 4 +-- src/plugins/qtsupport/qtversionmanager.cpp | 2 +- tests/auto/utils/settings/tst_settings.cpp | 2 +- 18 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/plugins/baremetal/debugserverprovidermanager.cpp b/src/plugins/baremetal/debugserverprovidermanager.cpp index 5ef3147e47c..536b279700c 100644 --- a/src/plugins/baremetal/debugserverprovidermanager.cpp +++ b/src/plugins/baremetal/debugserverprovidermanager.cpp @@ -90,7 +90,7 @@ void DebugServerProviderManager::restoreProviders() const int count = data.value(countKeyC, 0).toInt(); for (int i = 0; i < count; ++i) { - const Key key = dataKeyC + Key::number(i); + const Key key = numberedKey(dataKeyC, i); if (!data.contains(key)) break; @@ -132,8 +132,8 @@ void DebugServerProviderManager::saveProviders() p->toMap(tmp); if (tmp.isEmpty()) continue; - const Key key = dataKeyC + Key::number(count); - data.insert(key, QVariant::fromValue(tmp)); + const Key key = numberedKey(dataKeyC, count); + data.insert(key, variantFromStore(tmp)); ++count; } } diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp index dc0068e97c9..b877998a079 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp @@ -186,7 +186,7 @@ void CMakeToolSettingsAccessor::saveCMakeTools(const QList<CMakeTool *> &cmakeTo Store tmp = item->toMap(); if (tmp.isEmpty()) continue; - data.insert(CMAKE_TOOL_DATA_KEY + Key::number(count), variantFromStore(tmp)); + data.insert(numberedKey(CMAKE_TOOL_DATA_KEY, count), variantFromStore(tmp)); ++count; } } @@ -202,7 +202,7 @@ CMakeToolSettingsAccessor::cmakeTools(const Store &data, bool fromSdk) const int count = data.value(CMAKE_TOOL_COUNT_KEY, 0).toInt(); for (int i = 0; i < count; ++i) { - const Key key = CMAKE_TOOL_DATA_KEY + Key::number(i); + const Key key = numberedKey(CMAKE_TOOL_DATA_KEY, i); if (!data.contains(key)) continue; diff --git a/src/plugins/coreplugin/foldernavigationwidget.cpp b/src/plugins/coreplugin/foldernavigationwidget.cpp index 6cee44c5917..5df76f44a4d 100644 --- a/src/plugins/coreplugin/foldernavigationwidget.cpp +++ b/src/plugins/coreplugin/foldernavigationwidget.cpp @@ -835,13 +835,13 @@ const bool kShowBreadCrumbsDefault = true; const bool kRootAutoSyncDefault = true; const bool kShowFoldersOnTopDefault = true; -void FolderNavigationWidgetFactory::saveSettings(Utils::QtcSettings *settings, +void FolderNavigationWidgetFactory::saveSettings(QtcSettings *settings, int position, QWidget *widget) { auto fnw = qobject_cast<FolderNavigationWidget *>(widget); QTC_ASSERT(fnw, return); - const Key base = kSettingsBase + Key::number(position); + const Key base = numberedKey(kSettingsBase, position); settings->setValueWithDefault(base + kHiddenFilesKey, fnw->hiddenFilesFilter(), kHiddenFilesDefault); @@ -861,7 +861,7 @@ void FolderNavigationWidgetFactory::restoreSettings(QtcSettings *settings, int p { auto fnw = qobject_cast<FolderNavigationWidget *>(widget); QTC_ASSERT(fnw, return); - const Key base = kSettingsBase + Key::number(position); + const Key base = numberedKey(kSettingsBase, position); fnw->setHiddenFilesFilter(settings->value(base + kHiddenFilesKey, kHiddenFilesDefault).toBool()); fnw->setAutoSynchronization(settings->value(base + kSyncKey, kAutoSyncDefault).toBool()); fnw->setShowBreadCrumbs( diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index 4948ef4a559..f45cffb187a 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -756,7 +756,7 @@ void DebuggerItemModel::readDebuggers(const FilePath &fileName, bool isSystem) int count = data.value(DEBUGGER_COUNT_KEY, 0).toInt(); for (int i = 0; i < count; ++i) { - const Key key = DEBUGGER_DATA_KEY + Key::number(i); + const Key key = numberedKey(DEBUGGER_DATA_KEY, i); if (!data.contains(key)) continue; const Store dbMap = storeFromVariant(data.value(key)); @@ -813,7 +813,7 @@ void DebuggerItemModel::saveDebuggers() if (item.isValid() && item.engineType() != NoEngineType) { Store tmp = item.toMap(); if (!tmp.isEmpty()) { - data.insert(DEBUGGER_DATA_KEY + Key::number(count), variantFromStore(tmp)); + data.insert(numberedKey(DEBUGGER_DATA_KEY, count), variantFromStore(tmp)); ++count; } } diff --git a/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp b/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp index 835df7500a1..3f5cdfa45a7 100644 --- a/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp +++ b/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp @@ -23,7 +23,7 @@ namespace Internal { static Key entryName(int index) { - return Constants::ToolsSettings::ENTRY_KEY + Key::number(index); + return numberedKey(Constants::ToolsSettings::ENTRY_KEY, index); } ToolsSettingsAccessor::ToolsSettingsAccessor() diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 97c0ce8bfa8..f189cf0a9b9 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -381,8 +381,8 @@ void BuildConfiguration::toMap(Store &map) const EnvironmentItem::toStringList(d->m_userEnvironmentChanges)); map.insert(BUILD_STEP_LIST_COUNT, 2); - map.insert(BUILD_STEP_LIST_PREFIX + Key::number(0), variantFromStore(d->m_buildSteps.toMap())); - map.insert(BUILD_STEP_LIST_PREFIX + Key::number(1), variantFromStore(d->m_cleanSteps.toMap())); + map.insert(numberedKey(BUILD_STEP_LIST_PREFIX, 0), variantFromStore(d->m_buildSteps.toMap())); + map.insert(numberedKey(BUILD_STEP_LIST_PREFIX, 1), variantFromStore(d->m_cleanSteps.toMap())); map.insert(PARSE_STD_OUT_KEY, d->m_parseStdOut); map.insert(CUSTOM_PARSERS_KEY, transform(d->m_customParsers, &Id::toSetting)); @@ -401,7 +401,7 @@ void BuildConfiguration::fromMap(const Store &map) int maxI = map.value(BUILD_STEP_LIST_COUNT, 0).toInt(); for (int i = 0; i < maxI; ++i) { - Store data = storeFromVariant(map.value(BUILD_STEP_LIST_PREFIX + Key::number(i))); + Store data = storeFromVariant(map.value(numberedKey(BUILD_STEP_LIST_PREFIX, i))); if (data.isEmpty()) { qWarning() << "No data for build step list" << i << "found!"; continue; diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index 5befbd09b46..d0badc4b5c4 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -62,7 +62,7 @@ Store BuildStepList::toMap() const for (int i = 0; i < m_steps.count(); ++i) { Store data; m_steps.at(i)->toMap(data); - map.insert(STEPS_PREFIX + Key::number(i), variantFromStore(data)); + map.insert(numberedKey(STEPS_PREFIX, i), variantFromStore(data)); } return map; @@ -111,7 +111,7 @@ bool BuildStepList::fromMap(const Store &map) int maxSteps = map.value(STEPS_COUNT_KEY, 0).toInt(); for (int i = 0; i < maxSteps; ++i) { - Store bsData = storeFromVariant(map.value(STEPS_PREFIX + Key::number(i))); + Store bsData = storeFromVariant(map.value(numberedKey(STEPS_PREFIX, i))); if (bsData.isEmpty()) { qWarning() << "No step data found for" << i << "(continuing)."; continue; diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index e19e33fcf6b..33e2b4d9c89 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -181,7 +181,7 @@ Store EditorConfiguration::toMap() const {"language", QVariant::fromValue(itCodeStyle.key().toSetting())}, {"value", QVariant::fromValue(itCodeStyle.value()->toMap())} }; - map.insert(kCodeStylePrefix + Key::number(i), variantFromStore(settingsIdMap)); + map.insert(numberedKey(kCodeStylePrefix, i), variantFromStore(settingsIdMap)); i++; } @@ -204,7 +204,7 @@ void EditorConfiguration::fromMap(const Store &map) const int codeStyleCount = map.value(kCodeStyleCount, 0).toInt(); for (int i = 0; i < codeStyleCount; ++i) { - Store settingsIdMap = storeFromVariant(map.value(kCodeStylePrefix + Key::number(i))); + Store settingsIdMap = storeFromVariant(map.value(numberedKey(kCodeStylePrefix, i))); if (settingsIdMap.isEmpty()) { qWarning() << "No data for code style settings list" << i << "found!"; continue; diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 4661b93ba6e..f2e52f7c3b3 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -448,7 +448,7 @@ void KitManager::saveKits() Store tmp = k->toMap(); if (tmp.isEmpty()) continue; - data.insert(KIT_DATA_KEY + Key::number(count), variantFromStore(tmp)); + data.insert(numberedKey(KIT_DATA_KEY, count), variantFromStore(tmp)); ++count; } data.insert(KIT_COUNT_KEY, count); @@ -514,7 +514,7 @@ static KitList restoreKitsHelper(const FilePath &fileName) const int count = data.value(KIT_COUNT_KEY, 0).toInt(); for (int i = 0; i < count; ++i) { - const Key key = KIT_DATA_KEY + Key::number(i); + const Key key = numberedKey(KIT_DATA_KEY, i); if (!data.contains(key)) break; diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 6448b391c39..52a4b8e0a61 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -698,7 +698,7 @@ void Project::toMap(Store &map) const map.insert(ACTIVE_TARGET_KEY, ts.indexOf(d->m_activeTarget)); map.insert(TARGET_COUNT_KEY, ts.size()); for (int i = 0; i < ts.size(); ++i) - map.insert(TARGET_KEY_PREFIX + Key::number(i), variantFromStore(ts.at(i)->toMap())); + map.insert(numberedKey(TARGET_KEY_PREFIX, i), variantFromStore(ts.at(i)->toMap())); map.insert(EDITOR_SETTINGS_KEY, variantFromStore(d->m_editorConfiguration.toMap())); if (!d->m_pluginSettings.isEmpty()) @@ -801,7 +801,7 @@ Project::RestoreResult Project::fromMap(const Store &map, QString *errorMessage) void Project::createTargetFromMap(const Store &map, int index) { - const Key key = TARGET_KEY_PREFIX + Key::number(index); + const Key key = numberedKey(TARGET_KEY_PREFIX, index); if (!map.contains(key)) return; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 06df7b90d4b..d4c622af291 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1703,7 +1703,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er for (int i = 0; i < customParserCount; ++i) { CustomParserSettings settings; settings.fromMap(storeFromVariant( - s->value(Constants::CUSTOM_PARSER_PREFIX_KEY + Key::number(i)))); + s->value(numberedKey(Constants::CUSTOM_PARSER_PREFIX_KEY, i)))); dd->m_customParsers << settings; } @@ -2278,7 +2278,7 @@ void ProjectExplorerPluginPrivate::savePersistentSettings() s->setValueWithDefault(Constants::CUSTOM_PARSER_COUNT_KEY, int(dd->m_customParsers.count()), 0); for (int i = 0; i < dd->m_customParsers.count(); ++i) { - s->setValue(Constants::CUSTOM_PARSER_PREFIX_KEY + Key::number(i), + s->setValue(numberedKey(Constants::CUSTOM_PARSER_PREFIX_KEY, i), variantFromStore(dd->m_customParsers.at(i).toMap())); } } diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index c3b86ce4206..6a26300265a 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -638,7 +638,7 @@ void ProjectTreeWidgetFactory::saveSettings(QtcSettings *settings, int position, { auto ptw = qobject_cast<ProjectTreeWidget *>(widget); Q_ASSERT(ptw); - const Key baseKey = kBaseKey + Key::number(position); + const Key baseKey = numberedKey(kBaseKey, position); settings->setValueWithDefault(baseKey + kProjectFilterKey, ptw->projectFilter(), kProjectFilterDefault); @@ -661,7 +661,7 @@ void ProjectTreeWidgetFactory::restoreSettings(QtcSettings *settings, int positi { auto ptw = qobject_cast<ProjectTreeWidget *>(widget); Q_ASSERT(ptw); - const Key baseKey = kBaseKey + Key::number(position); + const Key baseKey = numberedKey(kBaseKey, position); ptw->setProjectFilter( settings->value(baseKey + kProjectFilterKey, kProjectFilterDefault).toBool()); ptw->setGeneratedFilesFilter( diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index 3660e5f1ad1..3c5e87effe6 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -605,7 +605,7 @@ Store Target::toMap() const for (int i = 0; i < bcs.size(); ++i) { Store data; bcs.at(i)->toMap(data); - map.insert(BC_KEY_PREFIX + Key::number(i), variantFromStore(data)); + map.insert(numberedKey(BC_KEY_PREFIX, i), variantFromStore(data)); } const QList<DeployConfiguration *> dcs = deployConfigurations(); @@ -614,7 +614,7 @@ Store Target::toMap() const for (int i = 0; i < dcs.size(); ++i) { Store data; dcs.at(i)->toMap(data); - map.insert(DC_KEY_PREFIX + Key::number(i), variantFromStore(data)); + map.insert(numberedKey(DC_KEY_PREFIX, i), variantFromStore(data)); } const QList<RunConfiguration *> rcs = runConfigurations(); @@ -623,7 +623,7 @@ Store Target::toMap() const for (int i = 0; i < rcs.size(); ++i) { Store data; rcs.at(i)->toMap(data); - map.insert(RC_KEY_PREFIX + Key::number(i), variantFromStore(data)); + map.insert(numberedKey(RC_KEY_PREFIX, i), variantFromStore(data)); } if (!d->m_pluginSettings.isEmpty()) @@ -900,7 +900,7 @@ bool Target::fromMap(const Store &map) activeConfiguration = 0; for (int i = 0; i < bcCount; ++i) { - const Key key = BC_KEY_PREFIX + Key::number(i); + const Key key = numberedKey(BC_KEY_PREFIX, i); if (!map.contains(key)) return false; const Store valueMap = storeFromVariant(map.value(key)); @@ -927,7 +927,7 @@ bool Target::fromMap(const Store &map) activeConfiguration = 0; for (int i = 0; i < dcCount; ++i) { - const Key key = DC_KEY_PREFIX + Key::number(i); + const Key key = numberedKey(DC_KEY_PREFIX, i); if (!map.contains(key)) return false; Store valueMap = storeFromVariant(map.value(key)); @@ -954,7 +954,7 @@ bool Target::fromMap(const Store &map) activeConfiguration = 0; for (int i = 0; i < rcCount; ++i) { - const Key key = RC_KEY_PREFIX + Key::number(i); + const Key key = numberedKey(RC_KEY_PREFIX, i); if (!map.contains(key)) return false; diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index 3d957f7f0f0..9a6903e2632 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -224,7 +224,7 @@ void ToolChainSettingsAccessor::saveToolChains(const Toolchains &toolchains, QWi tc->toMap(tmp); if (tmp.isEmpty()) continue; - data.insert(TOOLCHAIN_DATA_KEY + Key::number(count), variantFromStore(tmp)); + data.insert(numberedKey(TOOLCHAIN_DATA_KEY, count), variantFromStore(tmp)); ++count; } data.insert(TOOLCHAIN_COUNT_KEY, count); @@ -241,7 +241,7 @@ Toolchains ToolChainSettingsAccessor::toolChains(const Store &data) const const int count = data.value(TOOLCHAIN_COUNT_KEY, 0).toInt(); for (int i = 0; i < count; ++i) { - const Key key = TOOLCHAIN_DATA_KEY + Key::number(i); + const Key key = numberedKey(TOOLCHAIN_DATA_KEY, i); if (!data.contains(key)) break; diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index fb2ccb36f5d..d4b413ae124 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -494,7 +494,7 @@ UserFileVersion16Upgrader::OldStepMaps UserFileVersion16Upgrader::extractStepMap int stepCount = stepListMap.value("ProjectExplorer.BuildStepList.StepsCount", 0).toInt(); Key stepKey = "ProjectExplorer.BuildStepList.Step."; for (int i = 0; i < stepCount; ++i) { - Store stepMap = storeFromVariant(stepListMap.value(stepKey + Key::number(i))); + Store stepMap = storeFromVariant(stepListMap.value(numberedKey(stepKey, i))); const QString id = stepMap.value("ProjectExplorer.ProjectConfiguration.Id").toString(); if (id == "Qt4ProjectManager.AndroidDeployQtStep") result.androidDeployQt = stepMap; @@ -516,10 +516,10 @@ Store UserFileVersion16Upgrader::removeAndroidPackageStep(Store deployMap) Key stepKey = "ProjectExplorer.BuildStepList.Step."; int targetPosition = 0; for (int sourcePosition = 0; sourcePosition < stepCount; ++sourcePosition) { - Store stepMap = storeFromVariant(stepListMap.value(stepKey + Key::number(sourcePosition))); + Store stepMap = storeFromVariant(stepListMap.value(numberedKey(stepKey, sourcePosition))); if (stepMap.value("ProjectExplorer.ProjectConfiguration.Id").toString() != "Qt4ProjectManager.AndroidPackageInstallationStep") { - stepListMap.insert(stepKey + Key::number(targetPosition), variantFromStore(stepMap)); + stepListMap.insert(numberedKey(stepKey, targetPosition), variantFromStore(stepMap)); ++targetPosition; } } @@ -527,7 +527,7 @@ Store UserFileVersion16Upgrader::removeAndroidPackageStep(Store deployMap) stepListMap.insert(stepCountKey, targetPosition); for (int i = targetPosition; i < stepCount; ++i) - stepListMap.remove(stepKey + Key::number(i)); + stepListMap.remove(numberedKey(stepKey, i)); deployMap.insert(stepListKey, variantFromStore(stepListMap)); return deployMap; @@ -543,7 +543,7 @@ Store UserFileVersion16Upgrader::insertSteps(Store buildConfigurationMap, const Key bslKey = "ProjectExplorer.BuildConfiguration.BuildStepList."; const Key bslTypeKey = "ProjectExplorer.ProjectConfiguration.Id"; for (int bslNumber = 0; bslNumber < stepListCount; ++bslNumber) { - Store buildStepListMap = buildConfigurationMap.value(bslKey + Key::number(bslNumber)).value<Store>(); + Store buildStepListMap = buildConfigurationMap.value(numberedKey(bslKey, bslNumber)).value<Store>(); if (buildStepListMap.value(bslTypeKey) != "ProjectExplorer.BuildSteps.Build") continue; @@ -565,7 +565,7 @@ Store UserFileVersion16Upgrader::insertSteps(Store buildConfigurationMap, QString defaultDisplayName = oldStepMap.androidPackageInstall.value(defaultDisplayNameKey).toString(); bool enabled = oldStepMap.androidPackageInstall.value(enabledKey).toBool(); - androidPackageInstallStep.insert(idKey, Utils::Id("Qt4ProjectManager.AndroidPackageInstallationStep").toSetting()); + androidPackageInstallStep.insert(idKey, Id("Qt4ProjectManager.AndroidPackageInstallationStep").toSetting()); androidPackageInstallStep.insert(displayNameKey, displayName); androidPackageInstallStep.insert(defaultDisplayNameKey, defaultDisplayName); androidPackageInstallStep.insert(enabledKey, enabled); @@ -574,7 +574,7 @@ Store UserFileVersion16Upgrader::insertSteps(Store buildConfigurationMap, defaultDisplayName = oldStepMap.androidDeployQt.value(defaultDisplayNameKey).toString(); enabled = oldStepMap.androidDeployQt.value(enabledKey).toBool(); - androidBuildApkStep.insert(idKey, Utils::Id("QmakeProjectManager.AndroidBuildApkStep").toSetting()); + androidBuildApkStep.insert(idKey, Id("QmakeProjectManager.AndroidBuildApkStep").toSetting()); androidBuildApkStep.insert(displayNameKey, displayName); androidBuildApkStep.insert(defaultDisplayNameKey, defaultDisplayName); androidBuildApkStep.insert(enabledKey, enabled); @@ -598,10 +598,10 @@ Store UserFileVersion16Upgrader::insertSteps(Store buildConfigurationMap, androidBuildApkStep.insert(VerboseOutputKey, verbose); const Key buildStepKey = "ProjectExplorer.BuildStepList.Step."; - buildStepListMap.insert(buildStepKey + Key::number(stepCount), variantFromStore(androidPackageInstallStep)); - buildStepListMap.insert(buildStepKey + Key::number(stepCount + 1), variantFromStore(androidBuildApkStep)); + buildStepListMap.insert(numberedKey(buildStepKey, stepCount), variantFromStore(androidPackageInstallStep)); + buildStepListMap.insert(numberedKey(buildStepKey, stepCount + 1), variantFromStore(androidBuildApkStep)); - buildConfigurationMap.insert(bslKey + Key::number(bslNumber), variantFromStore(buildStepListMap)); + buildConfigurationMap.insert(numberedKey(bslKey, bslNumber), variantFromStore(buildStepListMap)); } if (policy == RenameBuildConfiguration) { @@ -637,7 +637,7 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) Store result = data; for (int i = 0; i < targetCount; ++i) { - Key targetKey = "ProjectExplorer.Project.Target." + Key::number(i); + Key targetKey = numberedKey("ProjectExplorer.Project.Target.", i); Store targetMap = storeFromVariant(data.value(targetKey)); const Key dcCountKey = "ProjectExplorer.Target.DeployConfigurationCount"; @@ -651,12 +651,12 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) Key deployKey = "ProjectExplorer.Target.DeployConfiguration."; for (int j = 0; j < deployconfigurationCount; ++j) { Store deployConfigurationMap - = storeFromVariant(targetMap.value(deployKey + Key::number(j))); + = storeFromVariant(targetMap.value(numberedKey(deployKey, j))); OldStepMaps oldStep = extractStepMaps(deployConfigurationMap); if (!oldStep.isEmpty()) { oldSteps.append(oldStep); deployConfigurationMap = removeAndroidPackageStep(deployConfigurationMap); - targetMap.insert(deployKey + Key::number(j), QVariant::fromValue(deployConfigurationMap)); + targetMap.insert(numberedKey(deployKey, j), QVariant::fromValue(deployConfigurationMap)); } } @@ -672,7 +672,7 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) Key bcKey = "ProjectExplorer.Target.BuildConfiguration."; for (int j = 0; j < buildConfigurationCount; ++j) { - Store oldBuildConfigurationMap = storeFromVariant(targetMap.value(bcKey + Key::number(j))); + Store oldBuildConfigurationMap = storeFromVariant(targetMap.value(numberedKey(bcKey, j))); oldBuildConfigurations.append(oldBuildConfigurationMap); } @@ -691,7 +691,7 @@ Store UserFileVersion16Upgrader::upgrade(const Store &data) targetMap.insert(bcCountKey, newBuildConfigurations.size()); for (int j = 0; j < newBuildConfigurations.size(); ++j) - targetMap.insert(bcKey + Key::number(j), variantFromStore(newBuildConfigurations.at(j))); + targetMap.insert(numberedKey(bcKey, j), variantFromStore(newBuildConfigurations.at(j))); result.insert(targetKey, variantFromStore(targetMap)); } diff --git a/src/plugins/qnx/qnxsettingspage.cpp b/src/plugins/qnx/qnxsettingspage.cpp index a4b2cb8c3dd..37ca5aafc2b 100644 --- a/src/plugins/qnx/qnxsettingspage.cpp +++ b/src/plugins/qnx/qnxsettingspage.cpp @@ -442,7 +442,7 @@ public: if (tmp.isEmpty()) continue; - data.insert(QNXConfigDataKey + Key::number(count), variantFromStore(tmp)); + data.insert(numberedKey(QNXConfigDataKey, count), variantFromStore(tmp)); ++count; } @@ -459,7 +459,7 @@ public: Store data = reader.restoreValues(); int count = data.value(QNXConfigCountKey, 0).toInt(); for (int i = 0; i < count; ++i) { - const Key key = QNXConfigDataKey + Key::number(i); + const Key key = numberedKey(QNXConfigDataKey, i); if (!data.contains(key)) continue; diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index bf797fe0612..9062e9b7fd7 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -358,7 +358,7 @@ static void saveQtVersions() if (tmp.isEmpty()) continue; tmp.insert(QTVERSION_TYPE_KEY, qtv->type()); - data.insert(QTVERSION_DATA_KEY + Key::number(count), QVariant::fromValue(tmp)); + data.insert(numberedKey(QTVERSION_DATA_KEY, count), variantFromStore(tmp)); ++count; } m_writer->save(data, Core::ICore::dialogParent()); diff --git a/tests/auto/utils/settings/tst_settings.cpp b/tests/auto/utils/settings/tst_settings.cpp index 70637a6437b..7ce338025b0 100644 --- a/tests/auto/utils/settings/tst_settings.cpp +++ b/tests/auto/utils/settings/tst_settings.cpp @@ -35,7 +35,7 @@ public: Store upgrade(const Store &data) final { Store result = data; - result.insert("VERSION_" + Key::number(version()), version()); + result.insert(numberedKey("VERSION_", version()), version()); return result; } }; From 37a17cd6bac45426398a2b890cd8e1532f12b3f6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 30 Aug 2023 12:30:32 +0200 Subject: [PATCH 0926/1777] Utils: One more stringFromKey to keep Qt 6.4 happy Change-Id: I67f47be369fa60e2f11f20e0ded389962e059ba6 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/persistentsettings.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/persistentsettings.cpp b/src/libs/utils/persistentsettings.cpp index ac84a1731af..a151465317d 100644 --- a/src/libs/utils/persistentsettings.cpp +++ b/src/libs/utils/persistentsettings.cpp @@ -459,7 +459,8 @@ bool PersistentSettingsWriter::write(const Store &data, QString *errorString) co const Store::const_iterator cend = data.constEnd(); for (Store::const_iterator it = data.constBegin(); it != cend; ++it) { w.writeStartElement(ctx.dataElement); - w.writeTextElement(ctx.variableElement, it.key()); + // FIXME: stringFromKey() not needed from Qt 6.5 onward. + w.writeTextElement(ctx.variableElement, stringFromKey(it.key())); writeVariantValue(w, ctx, it.value()); w.writeEndElement(); } From 4da8430cab471afb6f43cd540d20e88be6545a10 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 28 Aug 2023 15:31:40 +0200 Subject: [PATCH 0927/1777] ExtensionSystem: Always generate profiling data The overhead is minimal and can be shown at a later point even when not printing profiling data to the terminal. Move the data to the plugin spec for later retrieval. Task-number: QTCREATORBUG-29540 Change-Id: I392ff85a8a8b5c01ecba07fefd06e5029f692bf6 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/app/main.cpp | 1 + src/libs/extensionsystem/optionsparser.cpp | 2 +- src/libs/extensionsystem/pluginmanager.cpp | 103 ++++++++++----------- src/libs/extensionsystem/pluginmanager.h | 3 +- src/libs/extensionsystem/pluginmanager_p.h | 7 +- src/libs/extensionsystem/pluginspec.cpp | 5 + src/libs/extensionsystem/pluginspec.h | 11 +++ src/libs/extensionsystem/pluginspec_p.h | 2 + 8 files changed, 75 insertions(+), 59 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index cccb492d242..b403799e933 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -644,6 +644,7 @@ int main(int argc, char **argv) PluginManager::setPluginIID(QLatin1String("org.qt-project.Qt.QtCreatorPlugin")); PluginManager::setInstallSettings(installSettings); PluginManager::setSettings(settings); + PluginManager::startProfiling(); Utils::BaseAspect::setQtcSettings(settings); diff --git a/src/libs/extensionsystem/optionsparser.cpp b/src/libs/extensionsystem/optionsparser.cpp index 8e3a5d900e7..116a1f4fe21 100644 --- a/src/libs/extensionsystem/optionsparser.cpp +++ b/src/libs/extensionsystem/optionsparser.cpp @@ -239,7 +239,7 @@ bool OptionsParser::checkForProfilingOption() { if (m_currentArg != QLatin1String(PROFILE_OPTION)) return false; - m_pmPrivate->initProfiling(); + m_pmPrivate->increaseProfilingVerbosity(); return true; } diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 503eecadeeb..7f28a94bbac 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -880,16 +880,6 @@ PluginManager::ProcessData PluginManager::creatorProcessData() return d->m_creatorProcessData; } -/*! - \internal -*/ - -void PluginManager::profilingReport(const char *what, const PluginSpec *spec) -{ - d->profilingReport(what, spec); -} - - /*! Returns a list of plugins in load order. */ @@ -947,7 +937,7 @@ void PluginManagerPrivate::nextDelayedInitialize() delayedInitializeQueue.pop(); profilingReport(">delayedInitialize", spec); bool delay = spec->d->delayedInitialize(); - profilingReport("<delayedInitialize", spec); + profilingReport("<delayedInitialize", spec, &spec->d->performanceData.delayedInitialize); if (delay) break; // do next delayedInitialize after a delay } @@ -1303,7 +1293,7 @@ void PluginManagerPrivate::addObject(QObject *obj) if (debugLeaks) qDebug() << "PluginManagerPrivate::addObject" << obj << obj->objectName(); - if (m_profilingVerbosity && !m_profileTimer.isNull()) { + if (m_profilingVerbosity > 1 && m_profileTimer) { // Report a timestamp when adding an object. Useful for profiling // its initialization time. const int absoluteElapsedMS = int(m_profileTimer->elapsed()); @@ -1343,6 +1333,9 @@ void PluginManagerPrivate::removeObject(QObject *obj) */ void PluginManagerPrivate::loadPlugins() { + if (m_profilingVerbosity > 0) + qDebug("Profiling started"); + const QVector<PluginSpec *> queue = loadQueue(); Utils::setMimeStartupPhase(MimeStartupPhase::PluginsLoading); for (PluginSpec *spec : queue) @@ -1591,7 +1584,9 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt case PluginSpec::Running: profilingReport(">initializeExtensions", spec); spec->d->initializeExtensions(); - profilingReport("<initializeExtensions", spec); + profilingReport("<initializeExtensions", + spec, + &spec->d->performanceData.extensionsInitialized); return; case PluginSpec::Deleted: profilingReport(">delete", spec); @@ -1619,12 +1614,12 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt case PluginSpec::Loaded: profilingReport(">loadLibrary", spec); spec->d->loadLibrary(); - profilingReport("<loadLibrary", spec); + profilingReport("<loadLibrary", spec, &spec->d->performanceData.load); break; case PluginSpec::Initialized: profilingReport(">initializePlugin", spec); spec->d->initializePlugin(); - profilingReport("<initializePlugin", spec); + profilingReport("<initializePlugin", spec, &spec->d->performanceData.initialize); break; case PluginSpec::Stopped: profilingReport(">stop", spec); @@ -1760,34 +1755,30 @@ PluginSpec *PluginManagerPrivate::pluginByName(const QString &name) const return Utils::findOrDefault(pluginSpecs, [name](PluginSpec *spec) { return spec->name() == name; }); } -void PluginManagerPrivate::initProfiling() +void PluginManagerPrivate::increaseProfilingVerbosity() { - if (m_profileTimer.isNull()) { - m_profileTimer.reset(new QElapsedTimer); - m_profileTimer->start(); - m_profileElapsedMS = 0; - qDebug("Profiling started"); - } else { - m_profilingVerbosity++; - } + m_profilingVerbosity++; + if (!m_profileTimer) + PluginManager::startProfiling(); } -void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *spec /* = 0 */) +void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *spec, qint64 *target) { - if (!m_profileTimer.isNull()) { - const int absoluteElapsedMS = int(m_profileTimer->elapsed()); - const int elapsedMS = absoluteElapsedMS - m_profileElapsedMS; + if (m_profileTimer) { + const qint64 absoluteElapsedMS = m_profileTimer->elapsed(); + const qint64 elapsedMS = absoluteElapsedMS - m_profileElapsedMS; m_profileElapsedMS = absoluteElapsedMS; - if (spec) - qDebug("%-22s %-22s %8dms (%8dms)", what, qPrintable(spec->name()), absoluteElapsedMS, elapsedMS); - else - qDebug("%-45s %8dms (%8dms)", what, absoluteElapsedMS, elapsedMS); - if (what && *what == '<') { + if (m_profilingVerbosity > 0) { + qDebug("%-22s %-22s %8lldms (%8lldms)", + what, + qPrintable(spec->name()), + absoluteElapsedMS, + elapsedMS); + } + if (target) { QString tc; - if (spec) { - m_profileTotal[spec] += elapsedMS; - tc = spec->name() + '_'; - } + *target = elapsedMS; + tc = spec->name() + '_'; tc += QString::fromUtf8(QByteArray(what + 1)); Utils::Benchmarker::report("loadPlugins", tc, elapsedMS); } @@ -1796,22 +1787,23 @@ void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *s void PluginManagerPrivate::profilingSummary() const { - if (!m_profileTimer.isNull()) { - QMultiMap<int, const PluginSpec *> sorter; - int total = 0; - - auto totalEnd = m_profileTotal.constEnd(); - for (auto it = m_profileTotal.constBegin(); it != totalEnd; ++it) { - sorter.insert(it.value(), it.key()); - total += it.value(); + if (m_profilingVerbosity > 0) { + const QVector<PluginSpec *> specs + = Utils::sorted(pluginSpecs, [](PluginSpec *s1, PluginSpec *s2) { + return s1->performanceData().total() < s2->performanceData().total(); + }); + const qint64 total + = std::accumulate(specs.constBegin(), specs.constEnd(), 0, [](qint64 t, PluginSpec *s) { + return t + s->performanceData().total(); + }); + for (PluginSpec *s : specs) { + if (!s->isEffectivelyEnabled()) + continue; + const qint64 t = s->performanceData().total(); + qDebug("%-22s %8lldms ( %5.2f%% )", qPrintable(s->name()), t, 100.0 * t / total); } - - auto sorterEnd = sorter.constEnd(); - for (auto it = sorter.constBegin(); it != sorterEnd; ++it) - qDebug("%-22s %8dms ( %5.2f%% )", qPrintable(it.value()->name()), - it.key(), 100.0 * it.key() / total); - qDebug("Total: %8dms", total); - Utils::Benchmarker::report("loadPlugins", "Total", total); + qDebug("Total: %8lldms", total); + Utils::Benchmarker::report("loadPlugins", "Total", total); } } @@ -1855,4 +1847,11 @@ QObject *PluginManager::getObjectByName(const QString &name) }); } +void PluginManager::startProfiling() +{ + d->m_profileTimer.reset(new QElapsedTimer); + d->m_profileTimer->start(); + d->m_profileElapsedMS = 0; +} + } // ExtensionSystem diff --git a/src/libs/extensionsystem/pluginmanager.h b/src/libs/extensionsystem/pluginmanager.h index 84e3bbc55be..e7c6a315259 100644 --- a/src/libs/extensionsystem/pluginmanager.h +++ b/src/libs/extensionsystem/pluginmanager.h @@ -64,6 +64,7 @@ public: static QObject *getObjectByName(const QString &name); + static void startProfiling(); // Plugin operations static QVector<PluginSpec *> loadQueue(); static void loadPlugins(); @@ -124,8 +125,6 @@ public: static void setCreatorProcessData(const ProcessData &data); static ProcessData creatorProcessData(); - static void profilingReport(const char *what, const PluginSpec *spec = nullptr); - static QString platformName(); static bool isInitializationDone(); diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index c7a4291a6b7..75197013a8b 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -58,9 +58,9 @@ public: void loadPlugin(PluginSpec *spec, PluginSpec::State destState); void resolveDependencies(); void enableDependenciesIndirectly(); - void initProfiling(); + void increaseProfilingVerbosity(); void profilingSummary() const; - void profilingReport(const char *what, const PluginSpec *spec = nullptr); + void profilingReport(const char *what, const PluginSpec *spec, qint64 *target = nullptr); void setSettings(Utils::QtcSettings *settings); void setGlobalSettings(Utils::QtcSettings *settings); void readSettings(); @@ -106,8 +106,7 @@ public: QStringList arguments; QStringList argumentsForRestart; QScopedPointer<QElapsedTimer> m_profileTimer; - QHash<const PluginSpec *, int> m_profileTotal; - int m_profileElapsedMS = 0; + qint64 m_profileElapsedMS = 0; unsigned m_profilingVerbosity = 0; Utils::QtcSettings *settings = nullptr; Utils::QtcSettings *globalSettings = nullptr; diff --git a/src/libs/extensionsystem/pluginspec.cpp b/src/libs/extensionsystem/pluginspec.cpp index 62b3c0096f6..c633eaad610 100644 --- a/src/libs/extensionsystem/pluginspec.cpp +++ b/src/libs/extensionsystem/pluginspec.cpp @@ -402,6 +402,11 @@ QJsonObject PluginSpec::metaData() const return d->metaData; } +const PerformanceData &PluginSpec::performanceData() const +{ + return d->performanceData; +} + /*! Returns a list of descriptions of command line arguments the plugin processes. */ diff --git a/src/libs/extensionsystem/pluginspec.h b/src/libs/extensionsystem/pluginspec.h index 9abb4bf4475..43e39efeb1b 100644 --- a/src/libs/extensionsystem/pluginspec.h +++ b/src/libs/extensionsystem/pluginspec.h @@ -53,6 +53,16 @@ struct EXTENSIONSYSTEM_EXPORT PluginArgumentDescription QString description; }; +struct EXTENSIONSYSTEM_EXPORT PerformanceData +{ + qint64 load = 0; + qint64 initialize = 0; + qint64 extensionsInitialized = 0; + qint64 delayedInitialize = 0; + + qint64 total() const { return load + initialize + extensionsInitialized + delayedInitialize; } +}; + class EXTENSIONSYSTEM_EXPORT PluginSpec { public: @@ -84,6 +94,7 @@ public: bool isForceDisabled() const; QVector<PluginDependency> dependencies() const; QJsonObject metaData() const; + const PerformanceData &performanceData() const; using PluginArgumentDescriptions = QVector<PluginArgumentDescription>; PluginArgumentDescriptions argumentDescriptions() const; diff --git a/src/libs/extensionsystem/pluginspec_p.h b/src/libs/extensionsystem/pluginspec_p.h index 568ab943a31..c87111f02ae 100644 --- a/src/libs/extensionsystem/pluginspec_p.h +++ b/src/libs/extensionsystem/pluginspec_p.h @@ -84,6 +84,8 @@ public: bool hasError = false; QString errorString; + PerformanceData performanceData; + static bool isValidVersion(const QString &version); static int versionCompare(const QString &version1, const QString &version2); From 026848eaddf377b70d42ddf13ec15fe1f73d3b0a Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 28 Aug 2023 16:21:39 +0200 Subject: [PATCH 0928/1777] ExtensionSystem: Add total real time to profiling report The original total only contained the time spent inside of plugin methods, but a lot of things get delayed arbitrarily to the event loop currently. That is included in the new "total startup". Task-number: QTCREATORBUG-29540 Change-Id: I832bb972d85bc4cf82f098e4cbf5d3ff3800d14a Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/libs/extensionsystem/pluginmanager.cpp | 5 ++++- src/libs/extensionsystem/pluginmanager_p.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 7f28a94bbac..a0a4d3d8c7b 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -945,6 +945,8 @@ void PluginManagerPrivate::nextDelayedInitialize() m_isInitializationDone = true; delete delayedInitializeTimer; delayedInitializeTimer = nullptr; + if (m_profileTimer) + m_totalStartupMS = m_profileTimer->elapsed(); profilingSummary(); emit q->initializationDone(); #ifdef WITH_TESTS @@ -1802,7 +1804,8 @@ void PluginManagerPrivate::profilingSummary() const const qint64 t = s->performanceData().total(); qDebug("%-22s %8lldms ( %5.2f%% )", qPrintable(s->name()), t, 100.0 * t / total); } - qDebug("Total: %8lldms", total); + qDebug("Total plugins: %8lldms", total); + qDebug("Total startup: %8lldms", m_totalStartupMS); Utils::Benchmarker::report("loadPlugins", "Total", total); } } diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index 75197013a8b..4b5f45cccbc 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -107,6 +107,8 @@ public: QStringList argumentsForRestart; QScopedPointer<QElapsedTimer> m_profileTimer; qint64 m_profileElapsedMS = 0; + qint64 m_totalUntilDelayedInitialize = 0; + qint64 m_totalStartupMS = 0; unsigned m_profilingVerbosity = 0; Utils::QtcSettings *settings = nullptr; Utils::QtcSettings *globalSettings = nullptr; From c22e43bf4188903cbd34090136eedb98ee1c95c8 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 29 Aug 2023 11:36:56 +0200 Subject: [PATCH 0929/1777] ExtensionSystem: Factor out startup performance summary Makes it possible to potentially show it after the fact. Change-Id: I7c93a2a290bf1a3e096286a3d20fd4553757ad5c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/libs/extensionsystem/pluginmanager.cpp | 51 ++++++++++++++-------- src/libs/extensionsystem/pluginmanager_p.h | 3 +- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index a0a4d3d8c7b..959cfb7d284 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -947,7 +947,7 @@ void PluginManagerPrivate::nextDelayedInitialize() delayedInitializeTimer = nullptr; if (m_profileTimer) m_totalStartupMS = m_profileTimer->elapsed(); - profilingSummary(); + printProfilingSummary(); emit q->initializationDone(); #ifdef WITH_TESTS if (PluginManager::testRunRequested()) @@ -1787,25 +1787,40 @@ void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *s } } -void PluginManagerPrivate::profilingSummary() const +QString PluginManagerPrivate::profilingSummary(qint64 *totalOut) const +{ + QString summary; + const QVector<PluginSpec *> specs = Utils::sorted(pluginSpecs, + [](PluginSpec *s1, PluginSpec *s2) { + return s1->performanceData().total() + < s2->performanceData().total(); + }); + const qint64 total + = std::accumulate(specs.constBegin(), specs.constEnd(), 0, [](qint64 t, PluginSpec *s) { + return t + s->performanceData().total(); + }); + for (PluginSpec *s : specs) { + if (!s->isEffectivelyEnabled()) + continue; + const qint64 t = s->performanceData().total(); + summary += QString("%1 %2ms ( %3% )\n") + .arg(s->name(), -22) + .arg(t, 8) + .arg(100.0 * t / total, 5, 'f', 2); + } + summary += QString("Total plugins: %1ms\n").arg(total, 8); + summary += QString("Total startup: %1ms\n").arg(m_totalStartupMS, 8); + if (totalOut) + *totalOut = total; + return summary; +} + +void PluginManagerPrivate::printProfilingSummary() const { if (m_profilingVerbosity > 0) { - const QVector<PluginSpec *> specs - = Utils::sorted(pluginSpecs, [](PluginSpec *s1, PluginSpec *s2) { - return s1->performanceData().total() < s2->performanceData().total(); - }); - const qint64 total - = std::accumulate(specs.constBegin(), specs.constEnd(), 0, [](qint64 t, PluginSpec *s) { - return t + s->performanceData().total(); - }); - for (PluginSpec *s : specs) { - if (!s->isEffectivelyEnabled()) - continue; - const qint64 t = s->performanceData().total(); - qDebug("%-22s %8lldms ( %5.2f%% )", qPrintable(s->name()), t, 100.0 * t / total); - } - qDebug("Total plugins: %8lldms", total); - qDebug("Total startup: %8lldms", m_totalStartupMS); + qint64 total; + const QString summary = profilingSummary(&total); + qDebug() << qPrintable(summary); Utils::Benchmarker::report("loadPlugins", "Total", total); } } diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index 4b5f45cccbc..63d017ac556 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -59,7 +59,8 @@ public: void resolveDependencies(); void enableDependenciesIndirectly(); void increaseProfilingVerbosity(); - void profilingSummary() const; + QString profilingSummary(qint64 *totalOut = nullptr) const; + void printProfilingSummary() const; void profilingReport(const char *what, const PluginSpec *spec, qint64 *target = nullptr); void setSettings(Utils::QtcSettings *settings); void setGlobalSettings(Utils::QtcSettings *settings); From d9ed0cc75af35f29829f13f93fe6a6b6f85d0e23 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 29 Aug 2023 11:46:13 +0200 Subject: [PATCH 0930/1777] ExtensionSystem: Include phase breakdown in profiling summary Makes it easier to find where bottlenecks are, as a hint where to actually start profiling. Change-Id: I00b881583c2c25b13f6e287b39b6b83299ac6674 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/libs/extensionsystem/pluginmanager.cpp | 5 +++-- src/libs/extensionsystem/pluginspec.h | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 959cfb7d284..b4b8b9f245e 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -1803,10 +1803,11 @@ QString PluginManagerPrivate::profilingSummary(qint64 *totalOut) const if (!s->isEffectivelyEnabled()) continue; const qint64 t = s->performanceData().total(); - summary += QString("%1 %2ms ( %3% )\n") + summary += QString("%1 %2ms ( %3% ) (%4)\n") .arg(s->name(), -22) .arg(t, 8) - .arg(100.0 * t / total, 5, 'f', 2); + .arg(100.0 * t / total, 5, 'f', 2) + .arg(s->performanceData().summary()); } summary += QString("Total plugins: %1ms\n").arg(total, 8); summary += QString("Total startup: %1ms\n").arg(m_totalStartupMS, 8); diff --git a/src/libs/extensionsystem/pluginspec.h b/src/libs/extensionsystem/pluginspec.h index 43e39efeb1b..6030bc568e4 100644 --- a/src/libs/extensionsystem/pluginspec.h +++ b/src/libs/extensionsystem/pluginspec.h @@ -61,6 +61,14 @@ struct EXTENSIONSYSTEM_EXPORT PerformanceData qint64 delayedInitialize = 0; qint64 total() const { return load + initialize + extensionsInitialized + delayedInitialize; } + QString summary() const + { + return QString("l: %1ms, i: %2ms, x: %3ms, d: %4ms") + .arg(load, 3) + .arg(initialize, 3) + .arg(extensionsInitialized, 3) + .arg(delayedInitialize, 3); + } }; class EXTENSIONSYSTEM_EXPORT PluginSpec From 39dfc12a9e8d2ff209d1bae9eaa212cd6bb6ec27 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Thu, 3 Aug 2023 11:29:48 +0200 Subject: [PATCH 0931/1777] Doc: Divide "Creating Files" into How-to topics Task-number: QTCREATORBUG-29361 Change-Id: Ib5e31777ef1649f86525b41bcfbcac52b9dd231e Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../images/qtcreator-remove-file.webp | Bin 0 -> 3892 bytes .../src/cmake/creator-projects-cmake.qdoc | 2 +- .../howto/creator-only/creator-how-tos.qdoc | 4 + .../creator-only/creator-files-creating.qdoc | 208 +++++++++++++----- .../creator-projects-creating.qdoc | 4 +- doc/qtcreator/src/qtcreator-toc.qdoc | 5 +- .../creator-only/qtquick-creating.qdoc | 2 +- .../creator-file-system-view.qdoc | 2 +- .../user-interface/creator-projects-view.qdoc | 2 +- 9 files changed, 161 insertions(+), 68 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-remove-file.webp diff --git a/doc/qtcreator/images/qtcreator-remove-file.webp b/doc/qtcreator/images/qtcreator-remove-file.webp new file mode 100644 index 0000000000000000000000000000000000000000..a96ffacad7ccacdef6114dcf7f177e24d03ee65c GIT binary patch literal 3892 zcmWIYbaT_;XJ80-bqWXzu<()RXJF80ZqjGC%Jz6$ugt~2+xNcAdu*(v=8&f9nm8%! z%r~jGR{9rexJ~YB&dOik<=OEv<#LFL$K`ErD;As9d2C|MUwBZe>mXas`91e<)MVY> zw)XpsUGLX#4Bg!uyt}sRJHO2BZCB08xsEB;cy4Py-V-`w<0-GHlPp)BIn!jo&Hlkx zepYU@_w3)bl1$%HSrl*RyngrY-LLa^V;iRL+WujN^MBbLxsN>_ecM<4o$K}g|H~&n zezX7La-QN^S!3gNOU?4~$*q@^pPgH5mpaEtX7lMYFD~uBTzmA_UzN&NF{Z*%Ts_8* zd(!Ks&pi-ieDbc<_Sd`--zpR*DSHN`XdkKQ4!5!Wqi|eW^Lh8d<ZH!MXJY1yyqJ|P zy-C?KD0lfPeW?#D)h+kW=ooJale_82e@^i5`@@1iFVsg)NI9Nsti6%v)rp2W#uweK z@0AV&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waVHyIp0$sVgFvCwzVz@O7#3=0(Ty&hVy(J$bs$gIVI>{O&UQLmj0tyI$Yl*l8^G zcGF`1%2R6H&*m{ZoHj@+yXVi}k!Q%JwmtvJ@#og_qw3Pvo9c5+o%c=gwDGpb*GmL1 z_SZ{D2_0j+{^{j~3!U?96)aNN=NH;9lbyagWy>mdHGxiJu{%x)T^&|J>cYZN`AQoe z*q>|o%Pah){aSqE#q#O)GulG>R_nigxv6Jy5yxe{(^mp#2E^Z+rgzptOZCj{l9g6k z?%Vo5PE+(Y>N{oeOm~-y?9@6t{-&;?&wtbIPVjYpciuvSoqvAw9=A)rRr{?p60O$n ziuqn$di-?N+v<BZKc0QJP-Fk{R{!<ue`_whH;mhrI(LucJ*B>royOB0+@^fbzq79U z>e=tv>VN%yo9q(aD;BSu%y;U~!t|s2i|@?*{!5+zaBkEO<G&m>ysx)@NRR)i{=rY@ z&&7}O4~i@7#eVt7<;?hC{6j_LN6eb`dahsZKZI9s*)e%9o$&lg`$ta;t3Uidr2k0P z@!W4If1tI;kGq)dy#HPSo{ah*`2{5p%s<pt@a$v0-;{sgI^&b<1E<3s%`7LJo$hEB z-&FIQd&2V?xp_-J{kM5y;jmRf+FbtQr8yIQ_vdISxPSe=;0v>b-G}fQpBNbc%G-e` literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc index d9809f09a38..546b089898e 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc @@ -183,7 +183,7 @@ \section1 Managing Files - When you use project wizard templates to \l{Creating Files}{add files} to + When you use project wizard templates to \l{Create files}{add files} to a project, \QC automatically adds them to the \c {qt_add_executable()}, \c {add_executable()}, or \c {qt_add_library()} function in the CMakeLists.txt file. diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 3d8d84882d9..9e81194b821 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -62,6 +62,10 @@ \list \li \l {Add a license header template for C++ code} \li \l {Add subprojects to projects} + \li \l {Create C++ classes} + \li \l {Create files} + \li \l {Create OpenGL fragment and vertex shaders} + \li \l {Create resource files} \li \l {Develop Qt for Python applications} \li \l {Specify project contents} \li \l {Select the build system} diff --git a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc index 11319133271..2b730ee67e3 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc @@ -2,121 +2,207 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-project-creating.html \page creator-file-creating.html - \nextpage creator-project-opening.html + \previouspage creator-how-tos.html - \title Creating Files + \ingroup creator-how-to-projects + + \title Create files + + Use wizard templates to add individual files to your \l{Creating Projects} + {projects}. + + To add files to projects, select \uicontrol File > \uicontrol {New File}, and + then select the type of the file. \image qtcreator-new-file.webp {New File wizard} - Use wizard templates to add individual files to your \l{Creating Projects} - {projects}. Select \uicontrol File > \uicontrol {New File} and - select the type of the file: + \section1 Select file type - \list - \li \uicontrol {C/C++}: header and source files for new classes. - \li \uicontrol {Modeling}: State Chart XML (SCXML) files, - Universal Modeling Language (UML) style \l {Modeling}{models}, - and scratch models that use a temporary file. - \li \uicontrol {Qt}: source and header files for item, table, + The following table lists the types of wizard templates that you can use + for creating files. The \uicontrol {New File} dialog shows detailed information about each file + wizard template. + + \table + \header + \li Category + \li Purpose + \row + \li \uicontrol {C/C++} + \li Header and source files for new classes. + \row + \li \uicontrol {Modeling} + \li State Chart XML (SCXML) files, Universal Modeling Language (UML) + style \l {Modeling}{models}, and scratch models that use a temporary + file. + \row + \li \uicontrol {Qt} + \li Source and header files for item, table, or list models, \QD forms and a matching classes for Qt Widgets projects, Qt resource files, as well as QML and JavaScript files for Qt Quick projects. - \li \uicontrol {GLSL}: fragment and vertex shaders. - \li \uicontrol {General}: markdown files, empty files that you can save - with any filename extension, and scratch buffers that use temporary - files. - \li \uicontrol {Java}: class files. - \li \uicontrol {Python}: class and script files for Python projects. - \li \uicontrol {vcpkg} (experimental): \l {Managing Packages with vcpkg} - {vcpkg package manager} manifest files (vcpkg.json). - \li \uicontrol {Nim} (experimental): empty Nim source and script files. + \row + \li \uicontrol {GLSL} + \li OpenGL fragment and vertex shaders. + \row + \li \uicontrol {General} + \li Markdown files, empty files that you can save with any filename + extension, and scratch buffers that use temporary files. + \row + \li \uicontrol {Java} + \li Class files. + \row + \li \uicontrol {Python} + \li Class and script files for Python projects. + \row + \li \uicontrol {vcpkg} (experimental) + \li \l {Managing Packages with vcpkg}{vcpkg package manager} manifest + files (vcpkg.json). + \row + \li \uicontrol {Nim} (experimental) + \li Empty Nim source and script files. + \endtable + + \sa {Create C++ classes}, {Create OpenGL fragment and vertex shaders}, + {Create resource files}, {Use project wizards} +*/ + +/*! + \page creator-how-to-create-cpp-classes.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects + + \title Create C++ classes + + To create a C++ header and source file for a new class that you can add to a + C++ project: + + \list 1 + \li Select \uicontrol File > \uicontrol {New File} > + \uicontrol {C++ Class Wizard} > \uicontrol Choose. + \li Specify the class name, base class, and header and source files for + the class. + \image qtcreator-cpp-class-wizard.png {Enter Class Name dialog} \endlist - The \uicontrol {New File} dialog shows detailed information about each file - wizard template. - - \section1 C++ Classes - - The \uicontrol {C++ Class Wizard} allows you to create a C++ header and source - file for a new class that you can add to a C++ project. Specify the class - name, base class, and header and source files for the class. - The wizard supports namespaces. To use a namespace, enter a qualified class name in the \uicontrol {Class name} field. For example: \c MyNamespace::MySubNamespace::MyClass. The wizard suggests existing namespaces and class names as you type. - \image qtcreator-cpp-class-wizard.png "Enter Class Name dialog" + You can also create your own project and class wizards. + + \section1 Set file naming preferences The names of the header and source file are based on the class name. To - change the default suffix of a file, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {C++} > \uicontrol {File Naming}. + change the default suffix of a file, select \uicontrol Edit > + \uicontrol Preferences > \uicontrol {C++} > \uicontrol {File Naming}. \image qtcreator-options-cpp-files.png "C++ File Naming preferences" - In the \uicontrol {License template} field, you can use + In the \uicontrol {License template} field, enter \l{Using Variables in Wizards}{predefined wizard variables} to specify the path and filename of the license to use in the source and header files. - You can create your own project and class wizards. For more information, - see \l{Adding New Custom Wizards}. + \sa {Create files}, {Use project wizards}, {Adding New Custom Wizards} +*/ - \section1 Resource Files +/*! + \page creator-how-to-create-resource-files.html + \previouspage creator-how-tos.html - \QC supports the \l{The Qt Resource System}{Qt Resource System}, which is a - platform-independent mechanism for storing files in the application's - executable. + \ingroup creator-how-to-projects - \image qtcreator-add-resource-wizard.png "New File dialog" + \title Create resource files - The wizard creates a resource collection file (.qrc) that you can manage in - the resource editor. + The \l{The Qt Resource System}{Qt Resource System} is a platform-independent + mechanism for storing files in the application's executable. - \image qtcreator-add-resource.png "Editing resource files" + To create a resource file: - Select \uicontrol {Add Files} to locate and add individual - files. + \list 1 + \li Select \uicontrol File > \uicontrol {New File} > \uicontrol {Qt} > + \uicontrol {Qt Resource File} > \uicontrol Choose. + \image qtcreator-add-resource-wizard.png {New File dialog} + \li Follow the instructions of the wizard to create a resource + collection file (.qrc). + \li Open the resource file in the resource editor. + \image qtcreator-add-resource.png "Editing resource files" + \li Select \uicontrol {Add Files} to locate and add individual files. + \endlist + + \section1 Sort resource files To list the folders and files in ascending alphabetic order in the source tree, select \uicontrol {Sort Alphabetically} in the context menu. - By default, resources are accessible in the application under the same file + \section1 Set a path prefix + + By default, resources in the application are accessible under the same file name as they have in the source tree, with a \c{:/} prefix, or by a URL with a \c qrc scheme. To specify a path prefix for all files in the \c .qrc file, select \uicontrol {Add Prefix} and enter the prefix in the \uicontrol Prefix field. + \section1 Set a locale + Some resources need to change based on the user's locale, such as translation files or icons. You can specify a locale in the \uicontrol Language field. + Use a lowercase, two-letter \l {https://www.iso.org/iso-639-language-codes.html} + {ISO 639 language code}, such as \e de, \e en, or \e fr. + + \section1 Remove resource files + Select \uicontrol Remove to remove the selected file from the resource - collection. In the \uicontrol {Remove File} dialog, select the + collection. + + In the \uicontrol {Remove File} dialog, select the \uicontrol {Delete file permanently} check box to remove the file from - the file system. To remove files that cannot be found in the file system, + the file system. + + \image qtcreator-remove-file.webp {Remove File dialog} + + To remove files that cannot be found in the file system, select \uicontrol {Remove Missing Files}. The above functions are also available in the context menu in the - \uicontrol Projects view. + \l Projects view. - \section1 OpenGL Fragment and Vertex Shaders + \sa {Create files}, {Use project wizards}, {QLocale} +*/ - Qt supports integration with OpenGL implementations on all - platforms, which allows you to display hardware accelerated 3D graphics - alongside a more conventional user interface. For more information, see - \l{Qt GUI}. +/*! + \page creator-how-to-create-opengl-shaders.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects + + \title Create OpenGL fragment and vertex shaders + + Qt supports integration with OpenGL implementations on all platforms, so you + can display hardware accelerated 3D graphics alongside a more conventional + user interface. For more information, see \l{Qt GUI}. You can use the QOpenGLShader class to compile OpenGL shaders written in the OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language (GLSL/ES). QOpenGLShader and QOpenGLShaderProgram shelter you from the - details of - compiling and linking vertex and fragment shaders. + details of compiling and linking vertex and fragment shaders. - You can use \QC code editor to write fragment and vertex shaders - in GLSL or GLSL/ES. The code editor offers syntax highlighting and code - completion for the files. + To create OpenGL shaders: - \image qtcreator-new-opengl-file.png "New OpenGL file wizard" + \list 1 + \li Select \uicontrol File > \uicontrol {New File} > \uicontrol {GLSL}. + \image qtcreator-new-opengl-file.png {New OpenGL file wizard} + \li Select the type of the shader to create, and then select + \uicontrol Choose. + \li Follow the instructions of the wizard to create the shader file. + \li Open the shader file in the code editor, and write the shader code + in GLSL or GLSL/ES. The code editor offers syntax highlighting and + code completion for the files. + \endlist + + \sa {Create files}, {Use project wizards} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index c48a2ead78f..39c78dd197b 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -69,7 +69,7 @@ install and configure some additional software on the devices to be able to \l{Connecting Devices}{connect} to them from the development PC. - \sa {Manage Projects}{How-to: Manage Projects}, {Creating Files}, + \sa {Manage Projects}{How-to: Manage Projects}, {Adding Libraries to Projects}, {Opening Projects}, {Adding New Custom Wizards} */ @@ -172,7 +172,7 @@ \uicontrol Wizard. All wizard actions start with \uicontrol Impl there. \sa {Assign keyboard shortcuts}, {Activating Kits for a Project}, - {Creating Files}, {Creating Projects} + {Create files}, {Creating Projects} */ /*! diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 2fa2298a6b6..08e8ee82128 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -25,7 +25,6 @@ \list \li \l{Creating Projects} \list - \li \l{Creating Files} \li \l{Opening Projects} \li \l{Adding Libraries to Projects} \li \l{Adding New Custom Wizards} @@ -278,6 +277,10 @@ \list \li \l {Add a license header template for C++ code} \li \l {Add subprojects to projects} + \li \l {Create C++ classes} + \li \l {Create files} + \li \l {Create OpenGL fragment and vertex shaders} + \li \l {Create resource files} \li \l {Develop Qt for Python applications} \li \l {Select the build system} \li \l {Specify project contents} diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc b/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc index 4a3746f4c29..3188f73d200 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc @@ -33,7 +33,7 @@ \QC creates the necessary boilerplate files. Some of the files are specific to a particular target platform. You can use wizard templates - also to \l{Creating Files}{add files} to the projects. + also to \l{Create files}{add files} to the projects. \section1 Qt Quick Applications diff --git a/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc b/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc index b2a9f0dfe1d..e8d4eeb97e5 100644 --- a/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc @@ -77,7 +77,7 @@ \if defined(qtdesignstudio) \l{Adding Files to Projects}. \else - \l{Creating Files}. + \l{Create files}. \endif \li Rename existing files. To move the file to another directory, enter the relative or absolute path to its new location in addition to the diff --git a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc index 9d632a127e6..905c4ebe779 100644 --- a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc @@ -73,7 +73,7 @@ \if defined(qtdesignstudio) \l{Adding Files to Projects}. \else - \l{Creating Files}. + \l{Create files}. \endif \li Rename existing files. If you change the base name of a file, \QC displays a list of other files with the same base name From 1919580e08c09b269bce1af54187b292e0a76366 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 25 Aug 2023 09:57:48 +0200 Subject: [PATCH 0932/1777] Utils: Use QTC_USE_STORE Change-Id: I4a2e69a8e092d762f8dd70a2e421c26522a5939e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/storekey.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/storekey.h b/src/libs/utils/storekey.h index 7a187082426..4f7e4516fc6 100644 --- a/src/libs/utils/storekey.h +++ b/src/libs/utils/storekey.h @@ -10,7 +10,7 @@ namespace Utils { // Opt-in to new classes during the transition phase. -// #define QTC_USE_STORE +#define QTC_USE_STORE #ifdef QTC_USE_STORE From 6b312ad54ce0f029a68b349dacb4720a2c76f60f Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 28 Aug 2023 16:23:16 +0200 Subject: [PATCH 0933/1777] Debugger: Speed up startup on Windows The Qt SDK would not write the "Version" tag in the xml file, but the supported ABI and engine type are set. Only retrigger the debugger detection only if the version, and the ABI and engine type are not set. Change-Id: Ib73b1809f9dc6a16fa1988ee0e40e4d8131c667e Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/debuggeritem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index 0a92525beb3..b95a40527ba 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -104,7 +104,10 @@ DebuggerItem::DebuggerItem(const Store &data) && m_abis[0].osFlavor() == Abi::UnknownFlavor && m_abis[0].binaryFormat() == Abi::UnknownFormat; - if (m_version.isEmpty() || mightBeAPreQnxSeparateOSQnxDebugger) + bool needsReinitialization = m_version.isEmpty() && m_abis.isEmpty() + && m_engineType == NoEngineType; + + if (needsReinitialization || mightBeAPreQnxSeparateOSQnxDebugger) reinitializeFromFile(); } From e26fee092b175c242537839c5e7e6b1bf930cd21 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 25 Aug 2023 14:10:10 +0200 Subject: [PATCH 0934/1777] AutoTest: Allow temporarily disabling of functionality Especially when touching headers included centrally while refactoring bigger projects the retriggered parsing of large (depending) parts of the project can become rather annoying. Adds an action for immediate disabling parsing and respectively other test related functions. Change-Id: I553615cce90bc88d636a4519718887306ee5215b Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/autotest/autotestconstants.h | 1 + src/plugins/autotest/autotestplugin.cpp | 43 ++++++++++++++++--- src/plugins/autotest/testcodeparser.cpp | 25 ++++++++--- src/plugins/autotest/testcodeparser.h | 5 ++- src/plugins/autotest/testnavigationwidget.cpp | 4 +- 5 files changed, 65 insertions(+), 13 deletions(-) diff --git a/src/plugins/autotest/autotestconstants.h b/src/plugins/autotest/autotestconstants.h index 007e81b00ee..0610216bbda 100644 --- a/src/plugins/autotest/autotestconstants.h +++ b/src/plugins/autotest/autotestconstants.h @@ -8,6 +8,7 @@ namespace Autotest { namespace Constants { +const char ACTION_DISABLE_TMP[] = "AutoTest.DisableTemp"; const char ACTION_SCAN_ID[] = "AutoTest.ScanAction"; const char ACTION_RUN_ALL_ID[] = "AutoTest.RunAll"; const char ACTION_RUN_ALL_NODEPLOY_ID[] = "AutoTest.RunAllNoDeploy"; diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index b3fccb48d20..edfac7559a4 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -30,6 +30,7 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/icontext.h> #include <coreplugin/messagemanager.h> +#include <coreplugin/progressmanager/progressmanager.h> #include <cplusplus/CppDocument.h> #include <cplusplus/LookupContext.h> @@ -93,6 +94,7 @@ public: void onRunFailedTriggered(); void onRunFileTriggered(); void onRunUnderCursorTriggered(TestRunMode mode); + void onDisableTemporarily(bool disable); TestSettingsPage m_testSettingPage; @@ -254,12 +256,25 @@ void AutotestPluginPrivate::initializeMenuEntries() action->setEnabled(false); menu->addAction(command); + action = new QAction(Tr::tr("Disable Temporarily"), this); + action->setToolTip(Tr::tr("Disable scanning and other actions until explicitly rescanning, " + "re-enabling, or restarting Qt Creator.")); + action->setCheckable(true); + command = ActionManager::registerAction(action, Constants::ACTION_DISABLE_TMP); + connect(action, &QAction::triggered, this, &AutotestPluginPrivate::onDisableTemporarily); + menu->addAction(command); + action = new QAction(Tr::tr("Re&scan Tests"), this); command = ActionManager::registerAction(action, Constants::ACTION_SCAN_ID); command->setDefaultKeySequence( QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Meta+T, Ctrl+Meta+S") : Tr::tr("Alt+Shift+T,Alt+S"))); - connect(action, &QAction::triggered, this, [] { dd->m_testCodeParser.updateTestTree(); }); + connect(action, &QAction::triggered, this, [] { + if (dd->m_testCodeParser.state() == TestCodeParser::DisabledTemporarily) + dd->onDisableTemporarily(false); // Rescan Test should explicitly re-enable + else + dd->m_testCodeParser.updateTestTree(); + }); menu->addAction(command); ActionContainer *toolsMenu = ActionManager::actionContainer(Core::Constants::M_TOOLS); @@ -333,7 +348,7 @@ void AutotestPlugin::extensionsInitialized() ExtensionSystem::IPlugin::ShutdownFlag AutotestPlugin::aboutToShutdown() { - dd->m_testCodeParser.aboutToShutdown(); + dd->m_testCodeParser.aboutToShutdown(true); dd->m_testTreeModel.disconnect(); return SynchronousShutdown; } @@ -467,6 +482,23 @@ void AutotestPluginPrivate::onRunUnderCursorTriggered(TestRunMode mode) m_testRunner.runTests(mode, testsToRun); } +void AutotestPluginPrivate::onDisableTemporarily(bool disable) +{ + if (disable) { + // cancel running parse + m_testCodeParser.aboutToShutdown(false); + // clear model + m_testTreeModel.removeAllTestItems(); + m_testTreeModel.removeAllTestToolItems(); + AutotestPlugin::updateMenuItemsEnabledState(); + } else { + // re-enable + m_testCodeParser.setState(TestCodeParser::Idle); + // trigger scan + m_testCodeParser.updateTestTree(); + } +} + TestFrameworks AutotestPlugin::activeTestFrameworks() { ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject(); @@ -489,11 +521,12 @@ void AutotestPlugin::updateMenuItemsEnabledState() { const ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject(); const ProjectExplorer::Target *target = project ? project->activeTarget() : nullptr; - const bool canScan = !dd->m_testRunner.isTestRunning() - && dd->m_testCodeParser.state() == TestCodeParser::Idle; + const bool disabled = dd->m_testCodeParser.state() == TestCodeParser::DisabledTemporarily; + const bool canScan = disabled || (!dd->m_testRunner.isTestRunning() + && dd->m_testCodeParser.state() == TestCodeParser::Idle); const bool hasTests = dd->m_testTreeModel.hasTests(); // avoid expensive call to PE::canRunStartupProject() - limit to minimum necessary checks - const bool canRun = hasTests && canScan + const bool canRun = !disabled && hasTests && canScan && project && !project->needsConfiguration() && target && target->activeRunConfiguration() && !ProjectExplorer::BuildManager::isBuilding(); diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index 840ae613dc7..cfcd740f04f 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -64,6 +64,12 @@ void TestCodeParser::setState(State state) if (m_parserState == Shutdown) return; qCDebug(LOG) << "setState(" << state << "), currentState:" << m_parserState; + if (m_parserState == DisabledTemporarily && state == Idle) { + m_parserState = Idle; + qCDebug(LOG) << "Just re-enabling parser."; + return; + } + // avoid triggering parse before code model parsing has finished, but mark as dirty if (isProjectParsing() || m_codeModelParsing) { m_dirty = true; @@ -202,12 +208,15 @@ void TestCodeParser::onProjectPartsUpdated(Project *project) emitUpdateTestTree(); } -void TestCodeParser::aboutToShutdown() +void TestCodeParser::aboutToShutdown(bool isFinal) { - qCDebug(LOG) << "Disabling (immediately) - shutting down"; - m_parserState = Shutdown; + qCDebug(LOG) << "Disabling (immediately) -" + << (isFinal ? "shutting down" : "disabled temporarily"); + m_parserState = isFinal ? Shutdown : DisabledTemporarily; m_taskTree.reset(); m_futureSynchronizer.waitForFinished(); + if (!isFinal) + onFinished(false); } bool TestCodeParser::postponed(const QSet<FilePath> &filePaths) @@ -258,6 +267,7 @@ bool TestCodeParser::postponed(const QSet<FilePath> &filePaths) } return true; case Shutdown: + case DisabledTemporarily: break; } QTC_ASSERT(false, return false); // should not happen at all @@ -277,7 +287,7 @@ static void parseFileForTests(QPromise<TestParseResultPtr> &promise, void TestCodeParser::scanForTests(const QSet<FilePath> &filePaths, const QList<ITestParser *> &parsers) { - if (m_parserState == Shutdown || m_testCodeParsers.isEmpty()) + if (m_parserState == Shutdown || m_parserState == DisabledTemporarily || m_testCodeParsers.isEmpty()) return; if (postponed(filePaths)) @@ -419,7 +429,8 @@ void TestCodeParser::onAllTasksFinished(Id type) m_codeModelParsing = false; // avoid illegal parser state if respective widgets became hidden while parsing - setState(Idle); + if (m_parserState != DisabledTemporarily) + setState(Idle); } void TestCodeParser::onFinished(bool success) @@ -451,6 +462,10 @@ void TestCodeParser::onFinished(bool success) case Shutdown: qCDebug(LOG) << "Shutdown complete - not emitting parsingFinished (onFinished)"; break; + case DisabledTemporarily: + qCDebug(LOG) << "Disabling complete - emitting parsingFinished"; + emit parsingFinished(); // ensure hidden progress indicator + break; default: qWarning("I should not be here... State: %d", m_parserState); break; diff --git a/src/plugins/autotest/testcodeparser.h b/src/plugins/autotest/testcodeparser.h index 2dd81d93d60..49e123ba496 100644 --- a/src/plugins/autotest/testcodeparser.h +++ b/src/plugins/autotest/testcodeparser.h @@ -31,7 +31,8 @@ public: Idle, PartialParse, FullParse, - Shutdown + Shutdown, + DisabledTemporarily }; TestCodeParser(); @@ -63,7 +64,7 @@ public: void onQmlDocumentUpdated(const QmlJS::Document::Ptr &document); void onStartupProjectChanged(ProjectExplorer::Project *project); void onProjectPartsUpdated(ProjectExplorer::Project *project); - void aboutToShutdown(); + void aboutToShutdown(bool isFinal); private: bool postponed(const QSet<Utils::FilePath> &fileList); diff --git a/src/plugins/autotest/testnavigationwidget.cpp b/src/plugins/autotest/testnavigationwidget.cpp index d7f26e655fa..1908af8203b 100644 --- a/src/plugins/autotest/testnavigationwidget.cpp +++ b/src/plugins/autotest/testnavigationwidget.cpp @@ -190,8 +190,8 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event) QAction *runSelectedNoDeploy = ActionManager::command(Constants::ACTION_RUN_SELECTED_NODEPLOY_ID)->action(); QAction *selectAll = new QAction(Tr::tr("Select All"), &menu); QAction *deselectAll = new QAction(Tr::tr("Deselect All"), &menu); - // TODO remove? QAction *rescan = ActionManager::command(Constants::ACTION_SCAN_ID)->action(); + QAction *disable = ActionManager::command(Constants::ACTION_DISABLE_TMP)->action(); connect(selectAll, &QAction::triggered, m_view, &TestTreeView::selectAll); connect(deselectAll, &QAction::triggered, m_view, &TestTreeView::deselectAll); @@ -216,6 +216,8 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event) menu.addAction(deselectAll); menu.addSeparator(); menu.addAction(rescan); + menu.addSeparator(); + menu.addAction(disable); menu.exec(mapToGlobal(event->pos())); } From 34a4313f742c6907c0b0c26029601e507da96145 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 17 Aug 2023 14:50:36 +0200 Subject: [PATCH 0935/1777] DAP: Fix set invalid thread as a current warning Change-Id: I39fad868ca8996f51b2b5d8681210d92ec9de76b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/dapengine.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 6be4aec835f..180b3bdf1a7 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -569,8 +569,11 @@ void DapEngine::handleThreadsResponse(const QJsonObject &response) handler->updateThread(threadData); } - if (m_currentThreadId) - handler->setCurrentThread(threadsHandler()->threadForId(QString::number(m_currentThreadId))); + if (m_currentThreadId) { + Thread thread = threadsHandler()->threadForId(QString::number(m_currentThreadId)); + if (thread && thread != threadsHandler()->currentThread()) + handler->setCurrentThread(thread); + } } void DapEngine::handleEvent(DapEventType type, const QJsonObject &event) From 253eb4779b6a25eb7cd299639e156b37d4faa37a Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Wed, 30 Aug 2023 13:33:26 +0200 Subject: [PATCH 0936/1777] Doc: Mention the locator f file option for creating files ... in How-to: Create files. Change-Id: I9cc0ba39009c722a89ee127d6ffcebcd01cce649 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../src/projects/creator-only/creator-files-creating.qdoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc index 2b730ee67e3..8676fe625cd 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc @@ -17,6 +17,11 @@ \image qtcreator-new-file.webp {New File wizard} + \note You can also use the \c f locator filter to create a new + file and open it in the editor. For more information, see + \l {Creating Files and Directories from Locator}. However, you must + manually add the created file to a project. + \section1 Select file type The following table lists the types of wizard templates that you can use From 70f5d18fe9d5d15b95053d6cf54d3359377655c2 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Thu, 3 Aug 2023 16:59:43 +0200 Subject: [PATCH 0937/1777] Doc: Turn Opening Projects into a How-to topic Describe the ways to open projects before the case where one needs to re-configure the project. Task-number: QTCREATORBUG-29361 Change-Id: I32b8676112e412fe8b4f114c54371169f478d361 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../qtcreator-welcome-open-projects.webp | Bin 0 -> 17760 bytes .../cmake/creator-projects-cmake-presets.qdoc | 2 +- .../src/cmake/creator-projects-cmake.qdoc | 4 +- .../creator-only/creator-clang-codemodel.qdoc | 2 +- .../howto/creator-only/creator-how-tos.qdoc | 1 + .../src/meson/creator-projects-meson.qdoc | 2 +- .../creator-projects-creating.qdoc | 5 +- .../creator-projects-libraries.qdoc | 2 +- .../creator-projects-opening.qdoc | 128 ++++++++++-------- .../creator-only/creator-projects-qbs.qdoc | 2 +- .../creator-projects-settings-overview.qdoc | 2 +- doc/qtcreator/src/qtcreator-toc.qdoc | 2 +- 12 files changed, 82 insertions(+), 70 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-welcome-open-projects.webp diff --git a/doc/qtcreator/images/qtcreator-welcome-open-projects.webp b/doc/qtcreator/images/qtcreator-welcome-open-projects.webp new file mode 100644 index 0000000000000000000000000000000000000000..5281669b40716639989f69d26b7931e0c3f3f26e GIT binary patch literal 17760 zcmWIYbaRVvWnc(*bqWXzu<-G5Wnj=haX615wEOY4UX_zU|02Kp$lC7y-!Y?sMd7_( z@N}Cc9<>YRY<M|WJLc8g;tA>dW==kTZf9Tq&qF6)-c0I`wY2{nvv}pQHKwkSeib3> ze3#C9c4&3f$D)Gi|7YH2{F-a<Mt$b)yLI}h8_uklo0mJOJ9OFPH!YFtWq-X5Ghv9) z-+6N8114Lp#oWfmXMASNe10&fY=&f+9Pjx@A08P5@B8_`ZvX$;KPTN3{NJ?p?e=wF zPCZ!U6@FlXPT#syYtD#vDTb%rSfl%x@!Ir*Mth31XL_=pR;YYD@AdIBTP3U<0$W38 zo_x0YJmV=9$z^&9rx&hFPMdTlqwpn@>eU-N9_@Dcz@+n&fp@L<%qJpss^O-3*{7Gh zE{NTKN;ULm{<anOc)cb$KJsyV^y&bk1^a_N%u{y8Mqgzsjn&AyJ#X9D5<Ba;Z+-sM zZhCwp(Qjvw<m4%94W`a43^*1r^W%SSp|!cemovU8eearf#$I?Sr{C0o!>?7Y>~($p zHt6WxrCz`FxwqZjkt?^!CVAe(5`8(2vY$tO|NH;TvMB5)`;3_{ABexO5caEiy<qB1 zVbScPmsrA&mlvP>ICtq(r@X$Jp5VB=wK8vi%&<-DyIpc7<?i#(b^Gn-zkmLF?#%b^ zzwf@wsebn_WA<8AZ|(BsmKx#j!is9Q*q^)@x-ySxHRl`&^@^J7tYOa$jGxc2;##-o zvwlz7ZG-gwnAVw_HyzICJv2YtIk;t`zsb?6MN`<P9-b+q6|&rFolIZ(QUmq5OP6Y$ zNtH?S`^V58e%o#GmNQQ{%g%&Yo;f2Eeore!bB@eSzS1)r?k_kTDH}RZX~)AOt$Q0^ zGD}BJJ9IK<<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&(Y4kzOLo%*@)RmQ5r?BUpRf5|I)9dX2o`+ z>^n2$%_c8?vH9U5{kF)cwuU83jy$weIyn1hNzkM-EbC5jt1W1{xOe`6={?qL^_<rk zL>^A>X+Qb)B`>R9#@!g!3jrQsU)a`Ju1sU9IQ;N<(q~5A{C^AYUCiE7Jl&;r@{war z+(AOK3we8ISBBcJF}!CjZSDKk_vucncN!<X&+L$Y<@&Fc4YZNG)a9M-yY5f(HU4*g LntxR4!E;6cMoiXN literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake-presets.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake-presets.qdoc index 587790fa0dc..12b5d61ba7b 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake-presets.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake-presets.qdoc @@ -20,7 +20,7 @@ enforce version checking. It reads and uses all the fields from version 3 if present. It does not support test presets. - You can import the presets the first time you \l {Opening Projects} + You can import the presets the first time you \l {Open projects} {open a project}, when no \c CMakeLists.txt.user file exists or you have disabled all kits in the project. diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc index 546b089898e..ef840274306 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc @@ -69,7 +69,7 @@ and open that in \QC, as described in \l{Using Compilation Databases}. \li Create an ad-hoc project file for a qmake build using - \c{qmake -project} and \l{Opening Projects}{open} that in \QC. + \c{qmake -project} and \l{Open projects}{open} that in \QC. Be aware that this is typically not compilable without further manual changes. @@ -215,7 +215,7 @@ \section1 Related Topics \list - \li \l {Opening Projects} + \li \l {Open projects} \li \l {CMake Build Configuration} \li \l {Specifying Run Settings} \li \l {Deploying to Remote Linux} diff --git a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc index f9ce09b9551..6e1adfcc3e8 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc @@ -136,7 +136,7 @@ The clangd \e index provides exact and complete results for services such as finding references, following symbols under cursor, and using the - locator, even for complex constructs. When you \l{Opening Projects} + locator, even for complex constructs. When you \l{Open projects} {open a project}, clangd scans the source files to generate the index. For large projects, this can take a while, but the index is persistent and re-scanning is incremental, so nothing is lost by closing and re-starting diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 9e81194b821..46ccaf46014 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -67,6 +67,7 @@ \li \l {Create OpenGL fragment and vertex shaders} \li \l {Create resource files} \li \l {Develop Qt for Python applications} + \li \l {Open projects} \li \l {Specify project contents} \li \l {Select the build system} \li \l {Use project wizards} diff --git a/doc/qtcreator/src/meson/creator-projects-meson.qdoc b/doc/qtcreator/src/meson/creator-projects-meson.qdoc index ffc9a0d4c7b..f0f75018211 100644 --- a/doc/qtcreator/src/meson/creator-projects-meson.qdoc +++ b/doc/qtcreator/src/meson/creator-projects-meson.qdoc @@ -87,7 +87,7 @@ \section1 Related Topics \list - \li \l {Opening Projects} + \li \l {Open projects} \li \l {Meson Build Configuration} \li \l {Specifying Run Settings} \endlist diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index 39c78dd197b..e887f220067 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -10,7 +10,7 @@ /*! \previouspage creator-project-managing.html \page creator-project-creating.html - \nextpage creator-file-creating.html + \nextpage creator-project-qmake-libraries.html \ingroup creator-explanation-projects @@ -70,8 +70,7 @@ \l{Connecting Devices}{connect} to them from the development PC. \sa {Manage Projects}{How-to: Manage Projects}, - {Adding Libraries to Projects}, {Opening Projects}, - {Adding New Custom Wizards} + {Adding Libraries to Projects}, {Adding New Custom Wizards} */ /*! diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc index c63cf151d1d..2bcc095b11c 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc @@ -8,7 +8,7 @@ // ********************************************************************** /*! - \previouspage creator-project-opening.html + \previouspage creator-project-creating.html \page creator-project-qmake-libraries.html \nextpage creator-project-wizards.html diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc index 85d04903921..72714207d13 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc @@ -1,5 +1,5 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -9,26 +9,70 @@ // ********************************************************************** /*! - \previouspage creator-file-creating.html \page creator-project-opening.html - \nextpage creator-project-qmake-libraries.html + \previouspage creator-how-tos.html - \title Opening Projects + \ingroup creator-how-to-projects + + \title Open projects + + To open a project, open the project file for the project: + \e {CMakeLists.txt} (CMake), \e {.pro} (qmake), \e {.qbs} (Qbs), + \e {meson.build} (Meson), \e {pyproject} (Python), or \e {Makefile.am} + (Autotools, experimental). + + You can open a project in the following ways: + + \list + \li Select \uicontrol File > \uicontrol {Open File or Project}. + \li In the \uicontrol Welcome mode, \uicontrol Projects tab, select + \uicontrol {Open Project} (1). + \image qtcreator-welcome-open-projects.webp {Ways to open projects in the Welcome mode Projects tab} + \li In the \uicontrol Projects tab, select a project in the list of + recently opened projects (2). + \li In the \l Projects view, right-click to open a context + menu and select \uicontrol {Load Project} to open the + \uicontrol {Load Project} dialog, where you can select + a project file. + \li Use the following keyboard shortcuts, depending on the mode you are + currently in: + \list + \li In all modes, press \key Ctrl+O (\key Cmd+O on \macos) to open the + \uicontrol {Open File} dialog, where you can select a project file. + \li On Windows and Linux, in all modes except the \uicontrol Help mode, + press \key Ctrl+Shift+O to open the \uicontrol {Load Project} dialog. + \li In the \uicontrol Welcome mode, \uicontrol Projects tab, press + \key Ctrl+Shift+number (\key Cmd+Shift+number on \macos), where + the number is the number of a project in the list of recently opened + projects (3). + \endlist + \endlist + + \section1 Re-configure projects \QC stores information that it needs to build projects in a .user file. If \QC cannot find the file when you open an existing project, it prompts you - to enter the information. If you used another \QC instance to create the - project, \QC asks whether you want to use the old settings. The settings - are specific to the development environment, and you should not copy them from - one environment to another. Therefore, we recommend that you select \uicontrol No - and enter the information again in the \uicontrol {Configure Project} tab. + to enter the information. - The \uicontrol {Configure Project} tab displays a list of \l{glossary-buildandrun-kit}{kits} - for building and running projects, that you install on the development PC and - configure in \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. - Select the kits that you want to build and run the project with. + If you used another \QC instance to create the project, \QC asks whether you + want to use the old settings. The settings are specific to the development + environment, and you should not copy them from one environment to another. + Therefore, we recommend that you select \uicontrol No and enter the + information again in the \uicontrol {Configure Project} tab. - \image qtcreator-open-project-kits.png "Configure Project tab" + To re-configure projects: + + \list 1 + \li In the \uicontrol {Configure Project} tab, select + \l{glossary-buildandrun-kit}{kits} for building + and running your project. + \image qtcreator-open-project-kits.png {Configure Project tab} + \li Select \uicontrol {Configure Project}. + \endlist + + The \uicontrol {Configure Project} tab displays a list of kits that you + install on the development PC and configure in \uicontrol Edit > + \uicontrol Preferences > \uicontrol Kits. Even if you do not intend to build the project, the C++ and QML code models need a Qt version and compiler to offer code completion. To specify them, @@ -39,61 +83,27 @@ {language server client} for code completion, highlighting, and other useful features. - If \QC cannot find an existing build for a particular \l{glossary-buildandrun-kit}{kit}, - it starts out - from a clean slate, and creates new debug and release build configurations - in the specified directory. \QC suggests a name - and location for the directory that you can change. + If \QC cannot find an existing build for a particular kit, it starts out + from a clean slate and creates new debug and release build configurations + in the specified directory. \QC suggests a name and location for the + directory that you can change. + + \section1 Import builds If you have built the project before, \QC can use the existing build configuration to make the exact same build available to you. To import a - build, specify a directory in the - \uicontrol {Import Build From} section and select \uicontrol {Import}. + build, specify a directory in the \uicontrol {Import Build From} section + of the \uicontrol {Configure Project} tab and select \uicontrol {Import}. You can edit the build configuration later. For more information, see \l{Editing Build Configurations}. - To open a project: - - \list 1 - - \li Select \uicontrol File > \uicontrol {Open File or Project} - (\key Ctrl+O or \key Cmd+O on \macos) and select the project file - for the project to open: \e {.pro} (qmake), \e {CMakeLists.txt} - (CMake), \e {.qbs} (Qbs), \e {meson.build} (Meson), \e {pyproject} (Python), or - \e {Makefile.am} (Autotools, experimental). - - \li In the \uicontrol {Configure Project} tab, select kits for building - and running your project. - - \li Select \uicontrol {Configure Project}. - - \endlist - - You can use the following keyboard shortcuts to open projects, depending on - the mode you are currently in: - - \list - - \li In all modes, press \key Ctrl+O (\key Cmd+O on \macos) to open the - \uicontrol {Open File} dialog, where you can select a project file - to open a project. - - \li In all modes, except the \uicontrol Help mode, press - \key Ctrl+Shift+O (\key Cmd+Shift+O on \macos) to open the - \uicontrol {Load Project} dialog, where you can select a project - file to open a project. - - \li In the \uicontrol Welcome mode, \uicontrol Projects tab, press - \key Ctrl+Shift+number (\key Cmd+Shift+number on \macos), where - the number is the number of a project in the list of recently opened - projects. - - \endlist + \section1 Show progress information \QC parses all the source files in the project and performs a semantic analysis to build up the information that it needs for functions such as navigation and finding usages. A progress bar is displayed during parsing. + To show or hide detailed progress information, select \uicontrol {Toggle Progress Details} (1). @@ -102,4 +112,6 @@ You can drag the progress bar to another position. The position is saved for later. Select the \inlineimage icons/pin.png (\uicontrol Pin) button to pin the progress bar back to the toggle button. + + \sa {Adding Kits} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc index 9d7504b85af..22bafa78bb7 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc @@ -66,7 +66,7 @@ \section1 Related Topics \list - \li \l {Opening Projects} + \li \l {Open projects} \li \l {Qbs Build Configuration} \li \l {Specifying Run Settings} \endlist diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc index fff52cf5707..926e1596e3b 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc @@ -20,7 +20,7 @@ targets. Select the kits to use in the \uicontrol {Configure Projects} view when you open a project for the first time. At least one kit must be active. For more information about selecting the initial kit, see - \l{Opening Projects}. + \l{Open projects}. To maintain the list of active kits for a currently open project, switch to the \uicontrol Projects mode by pressing \key Ctrl+5. diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 08e8ee82128..7d71c101e51 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -25,7 +25,6 @@ \list \li \l{Creating Projects} \list - \li \l{Opening Projects} \li \l{Adding Libraries to Projects} \li \l{Adding New Custom Wizards} \endlist @@ -282,6 +281,7 @@ \li \l {Create OpenGL fragment and vertex shaders} \li \l {Create resource files} \li \l {Develop Qt for Python applications} + \li \l {Open projects} \li \l {Select the build system} \li \l {Specify project contents} \li \l {Use project wizards} From 270a9839e2d7ca9bfe39dd72e2f7e541ba0d625e Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 31 Aug 2023 08:15:34 +0200 Subject: [PATCH 0938/1777] Copilot: start the client in the delayed initialize phase Change-Id: I4470491f5f0a2b1d88ed5b2e23444bf3a28d8256 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/copilot/copilotplugin.cpp | 13 +++++++++---- src/plugins/copilot/copilotplugin.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/copilot/copilotplugin.cpp b/src/plugins/copilot/copilotplugin.cpp index cfc5ab8c83c..8af42ae0c07 100644 --- a/src/plugins/copilot/copilotplugin.cpp +++ b/src/plugins/copilot/copilotplugin.cpp @@ -57,10 +57,6 @@ void cycleSuggestion(TextEditor::TextEditorWidget *editor, Direction direction) void CopilotPlugin::initialize() { - restartClient(); - - connect(&settings(), &AspectContainer::applied, this, &CopilotPlugin::restartClient); - QAction *requestAction = new QAction(this); requestAction->setText(Tr::tr("Request Copilot Suggestion")); requestAction->setToolTip( @@ -151,6 +147,15 @@ void CopilotPlugin::initialize() ProjectPanelFactory::registerFactory(panelFactory); } +bool CopilotPlugin::delayedInitialize() +{ + restartClient(); + + connect(&settings(), &AspectContainer::applied, this, &CopilotPlugin::restartClient); + + return true; +} + void CopilotPlugin::restartClient() { LanguageClient::LanguageClientManager::shutdownClient(m_client); diff --git a/src/plugins/copilot/copilotplugin.h b/src/plugins/copilot/copilotplugin.h index 3533a17e831..9f709b2a101 100644 --- a/src/plugins/copilot/copilotplugin.h +++ b/src/plugins/copilot/copilotplugin.h @@ -19,6 +19,7 @@ class CopilotPlugin : public ExtensionSystem::IPlugin public: void initialize() override; + bool delayedInitialize() override; void restartClient(); ShutdownFlag aboutToShutdown() override; From cecf577dc497ff75d9b6681b25cb72cdaa821d71 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Fri, 25 Aug 2023 15:40:18 +0200 Subject: [PATCH 0939/1777] DAP: Add Python debugging Added Python support to the DAP engine in Qt Creator. Note: Locals aren't displayed for python. It will be fixed in the following commit. Change-Id: I6d3b41fecc98b92951ed0522e9201401293034d7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/CMakeLists.txt | 1 + src/plugins/debugger/dap/cmakedapengine.cpp | 2 - src/plugins/debugger/dap/dapclient.cpp | 13 +- src/plugins/debugger/dap/dapclient.h | 3 + src/plugins/debugger/dap/dapengine.cpp | 19 +- src/plugins/debugger/dap/dapengine.h | 2 +- src/plugins/debugger/dap/gdbdapengine.cpp | 2 - src/plugins/debugger/dap/pydapengine.cpp | 182 ++++++++++++++++++ src/plugins/debugger/dap/pydapengine.h | 21 ++ src/plugins/debugger/debuggerengine.cpp | 6 +- src/plugins/debugger/debuggerplugin.cpp | 17 +- src/plugins/debugger/debuggerruncontrol.cpp | 12 +- .../projectexplorer/projectexplorer.cpp | 2 +- .../projectexplorerconstants.h | 3 +- 14 files changed, 259 insertions(+), 26 deletions(-) create mode 100644 src/plugins/debugger/dap/pydapengine.cpp create mode 100644 src/plugins/debugger/dap/pydapengine.h diff --git a/src/plugins/debugger/CMakeLists.txt b/src/plugins/debugger/CMakeLists.txt index cc632969e03..21920f8fef9 100644 --- a/src/plugins/debugger/CMakeLists.txt +++ b/src/plugins/debugger/CMakeLists.txt @@ -31,6 +31,7 @@ add_qtc_plugin(Debugger dap/dapclient.cpp dap/dapclient.h dap/dapengine.cpp dap/dapengine.h dap/gdbdapengine.cpp dap/gdbdapengine.h + dap/pydapengine.cpp dap/pydapengine.h debugger.qrc debugger_global.h debuggeractions.cpp debuggeractions.h diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp index 4a4e0fe59ef..fb9a459dc75 100644 --- a/src/plugins/debugger/dap/cmakedapengine.cpp +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -130,8 +130,6 @@ void CMakeDapEngine::setupEngine() return; } }); - - notifyEngineSetupOk(); } bool CMakeDapEngine::hasCapability(unsigned cap) const diff --git a/src/plugins/debugger/dap/dapclient.cpp b/src/plugins/debugger/dap/dapclient.cpp index 4ad74b45586..1a70283e9e0 100644 --- a/src/plugins/debugger/dap/dapclient.cpp +++ b/src/plugins/debugger/dap/dapclient.cpp @@ -67,6 +67,12 @@ void DapClient::sendLaunch(const Utils::FilePath &executable) QJsonObject{{"noDebug", false}, {"program", executable.path()}, {"__restart", ""}}); } +void DapClient::sendAttach() +{ + postRequest("attach", + QJsonObject{{"__restart", ""}}); +} + void DapClient::sendConfigurationDone() { postRequest("configurationDone"); @@ -93,7 +99,6 @@ void DapClient::sendPause() postRequest("pause"); } - void DapClient::sendStepIn(int threadId) { QTC_ASSERT(threadId != -1, return); @@ -190,7 +195,9 @@ void DapClient::emitSignals(const QJsonDocument &doc) if (type == "response") { DapResponseType type = DapResponseType::Unknown; const QString command = ob.value("command").toString(); - if (command == "configurationDone") { + if (command == "initialize") { + type = DapResponseType::Initialize; + } else if (command == "configurationDone") { type = DapResponseType::ConfigurationDone; } else if (command == "continue") { type = DapResponseType::Continue; @@ -208,6 +215,8 @@ void DapClient::emitSignals(const QJsonDocument &doc) type = DapResponseType::StepOver; } else if (command == "threads") { type = DapResponseType::DapThreads; + } else if (command == "pause") { + type = DapResponseType::Pause; } emit responseReady(type, ob); return; diff --git a/src/plugins/debugger/dap/dapclient.h b/src/plugins/debugger/dap/dapclient.h index 3570bd65ca0..92528fc59df 100644 --- a/src/plugins/debugger/dap/dapclient.h +++ b/src/plugins/debugger/dap/dapclient.h @@ -38,6 +38,7 @@ signals: enum class DapResponseType { + Initialize, ConfigurationDone, Continue, StackTrace, @@ -47,6 +48,7 @@ enum class DapResponseType StepIn, StepOut, StepOver, + Pause, Unknown }; @@ -76,6 +78,7 @@ public: virtual void sendInitialize(); void sendLaunch(const Utils::FilePath &executable); + void sendAttach(); void sendConfigurationDone(); void sendDisconnect(); diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 180b3bdf1a7..7209aecf60c 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -6,6 +6,7 @@ #include "cmakedapengine.h" #include "dapclient.h" #include "gdbdapengine.h" +#include "pydapengine.h" #include <debugger/breakhandler.h> #include <debugger/debuggeractions.h> @@ -111,6 +112,7 @@ void DapEngine::shutdownEngine() void DapEngine::handleDapStarted() { + notifyEngineSetupOk(); QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); m_dapClient->sendInitialize(); @@ -128,7 +130,7 @@ void DapEngine::handleDapConfigurationDone() } -void DapEngine::handleDapLaunch() +void DapEngine::handleDapInitialize() { QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); @@ -479,6 +481,10 @@ void DapEngine::handleResponse(DapResponseType type, const QJsonObject &response const QString command = response.value("command").toString(); switch (type) { + case DapResponseType::Initialize: + qCDebug(dapEngineLog) << "initialize success"; + handleDapInitialize(); + break; case DapResponseType::ConfigurationDone: showMessage("configurationDone", LogDebug); qCDebug(dapEngineLog) << "configurationDone success"; @@ -513,7 +519,6 @@ void DapEngine::handleResponse(DapResponseType type, const QJsonObject &response case DapResponseType::DapThreads: handleThreadsResponse(response); break; - default: showMessage("UNKNOWN RESPONSE:" + command); }; @@ -585,7 +590,7 @@ void DapEngine::handleEvent(DapEventType type, const QJsonObject &event) switch (type) { case DapEventType::Initialized: qCDebug(dapEngineLog) << "initialize success"; - handleDapLaunch(); + claimInitialBreakpoints(); handleDapConfigurationDone(); break; case DapEventType::Stopped: @@ -801,10 +806,14 @@ void DapEngine::connectDataGeneratorSignals() DebuggerEngine *createDapEngine(Utils::Id runMode) { - if (runMode == ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE) + if (runMode == ProjectExplorer::Constants::DAP_CMAKE_DEBUG_RUN_MODE) return new CMakeDapEngine; + if (runMode == ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE) + return new GdbDapEngine; + if (runMode == ProjectExplorer::Constants::DAP_PY_DEBUG_RUN_MODE) + return new PyDapEngine; - return new GdbDapEngine; + return nullptr; } } // Debugger::Internal diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index b8ad63aab0a..8463f508f6b 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -84,7 +84,7 @@ protected: void claimInitialBreakpoints(); void handleDapStarted(); - void handleDapLaunch(); + virtual void handleDapInitialize(); void handleDapConfigurationDone(); void dapRemoveBreakpoint(const Breakpoint &bp); diff --git a/src/plugins/debugger/dap/gdbdapengine.cpp b/src/plugins/debugger/dap/gdbdapengine.cpp index 213d38f0d82..fa4ae14bd13 100644 --- a/src/plugins/debugger/dap/gdbdapengine.cpp +++ b/src/plugins/debugger/dap/gdbdapengine.cpp @@ -111,8 +111,6 @@ void GdbDapEngine::setupEngine() connectDataGeneratorSignals(); m_dapClient->dataProvider()->start(); - - notifyEngineSetupOk(); } } // namespace Debugger::Internal diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp new file mode 100644 index 00000000000..bf5791ab5ae --- /dev/null +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -0,0 +1,182 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 + +#include "pydapengine.h" + +#include "dapclient.h" + +#include <coreplugin/messagemanager.h> + +#include <debugger/debuggermainwindow.h> + +#include <utils/temporarydirectory.h> + +#include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/buildsystem.h> +#include <projectexplorer/projecttree.h> + +#include <QDebug> +#include <QLoggingCategory> +#include <QTcpSocket> +#include <QTimer> +#include <QVersionNumber> + +using namespace Core; +using namespace Utils; + +static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg) + +namespace Debugger::Internal { + +class TcpSocketDataProvider : public IDataProvider +{ +public: + TcpSocketDataProvider(const DebuggerRunParameters &rp, + const CommandLine &cmd, + const QString &hostName, + const quint16 port, + QObject *parent = nullptr) + : IDataProvider(parent) + , m_runParameters(rp) + , m_cmd(cmd) + , m_hostName(hostName) + , m_port(port) + { + connect(&m_socket, &QTcpSocket::connected, this, &IDataProvider::started); + connect(&m_socket, &QTcpSocket::disconnected, this, &IDataProvider::done); + connect(&m_socket, &QTcpSocket::readyRead, this, &IDataProvider::readyReadStandardOutput); + connect(&m_socket, + &QTcpSocket::errorOccurred, + this, + &IDataProvider::readyReadStandardError); + } + + ~TcpSocketDataProvider() { m_socket.disconnect(); } + + void start() override + { + m_proc.setEnvironment(m_runParameters.debugger.environment); + m_proc.setCommand(m_cmd); + m_proc.start(); + + m_timer = new QTimer(this); + m_timer->setInterval(100); + + connect(m_timer, &QTimer::timeout, this, [this]() { + m_socket.connectToHost(m_hostName, m_port); + m_socket.waitForConnected(); + if (m_socket.state() == QTcpSocket::ConnectedState) + m_timer->stop(); + + if (m_attempts >= m_maxAttempts) + kill(); + + m_attempts++; + }); + + m_timer->start(); + } + + bool isRunning() const override { return m_socket.isOpen(); } + void writeRaw(const QByteArray &data) override { m_socket.write(data); } + void kill() override + { + m_timer->stop(); + + if (m_proc.state() == QProcess::Running) + m_proc.kill(); + + if (m_socket.isOpen()) + m_socket.disconnect(); + + m_socket.abort(); + emit done(); + } + QByteArray readAllStandardOutput() override { return m_socket.readAll(); } + QString readAllStandardError() override { return QString(); } + int exitCode() const override { return 0; } + QString executable() const override { return m_hostName + ":" + QString::number(m_port); } + + QProcess::ExitStatus exitStatus() const override { return QProcess::NormalExit; } + QProcess::ProcessError error() const override { return QProcess::UnknownError; } + Utils::ProcessResult result() const override { return ProcessResult::FinishedWithSuccess; } + QString exitMessage() const override { return QString(); }; + +private: + Utils::Process m_proc; + const DebuggerRunParameters m_runParameters; + const CommandLine m_cmd; + + QTcpSocket m_socket; + const QString m_hostName; + const quint16 m_port; + + QTimer *m_timer; + const int m_maxAttempts = 10; + int m_attempts = 0; +}; + +class PythonDapClient : public DapClient +{ +public: + PythonDapClient(IDataProvider *provider, QObject *parent = nullptr) + : DapClient(provider, parent) + {} + + void sendInitialize() + { + postRequest("initialize", + QJsonObject{{"clientID", "QtCreator"}, + {"clientName", "QtCreator"}, + {"adapterID", "python"}, + {"pathFormat", "path"}}); + } +}; + +PyDapEngine::PyDapEngine() + : DapEngine() +{ + setObjectName("PythonDapEngine"); + setDebuggerName("PythonDAP"); + setDebuggerType("DAP"); +} + +void PyDapEngine::handleDapInitialize() +{ + QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); + + m_dapClient->sendAttach(); + + qCDebug(dapEngineLog) << "handleDapAttach"; +} + +void PyDapEngine::setupEngine() +{ + QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); + + Utils::FilePath interpreter = runParameters().interpreter; + + const FilePath scriptFile = runParameters().mainScript; + if (!scriptFile.isReadableFile()) { + MessageManager::writeDisrupting( + "Python Error" + QString("Cannot open script file %1").arg(scriptFile.toUserOutput())); + notifyEngineSetupFailed(); + } + + CommandLine cmd{interpreter, + {"-Xfrozen_modules=off", + "-m", "debugpy", + "--listen", "127.0.0.1:5679", + "--wait-for-client", + scriptFile.path(), + runParameters().inferior.workingDirectory.path()}}; + + IDataProvider *dataProvider + = new TcpSocketDataProvider(runParameters(), cmd, "127.0.0.1", 5679, this); + m_dapClient = new PythonDapClient(dataProvider, this); + + connectDataGeneratorSignals(); + m_dapClient->dataProvider()->start(); +} + +} // namespace Debugger::Internal diff --git a/src/plugins/debugger/dap/pydapengine.h b/src/plugins/debugger/dap/pydapengine.h new file mode 100644 index 00000000000..d81bd4e8359 --- /dev/null +++ b/src/plugins/debugger/dap/pydapengine.h @@ -0,0 +1,21 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "dapengine.h" + +namespace Debugger::Internal { + +class PyDapEngine : public DapEngine +{ +public: + PyDapEngine(); + +private: + void handleDapInitialize() override; + void setupEngine() override; + Utils::Process m_proc; +}; + +} // Debugger::Internal diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index ea8ed9b214a..a4751628ec1 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -727,10 +727,10 @@ void DebuggerEnginePrivate::setupViews() m_breakWindow->setObjectName("Debugger.Dock.Break." + engineId); m_breakWindow->setWindowTitle(Tr::tr("&Breakpoints")); - if (!currentPerspective || currentPerspective->id() == Constants::PRESET_PERSPECTIVE_ID) - m_perspective->useSubPerspectiveSwitcher(EngineManager::engineChooser()); - else + if (currentPerspective && currentPerspective->id() != Constants::PRESET_PERSPECTIVE_ID) m_perspective->useSubPerspectiveSwitcher(EngineManager::dapEngineChooser()); + else + m_perspective->useSubPerspectiveSwitcher(EngineManager::engineChooser()); m_perspective->addToolBarAction(&m_continueAction); m_perspective->addToolBarAction(&m_interruptAction); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index f155365bd7e..04c78ca205c 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1242,11 +1242,15 @@ void DebuggerPluginPrivate::createDapDebuggerPerspective(QWidget *globalLogWindo { EngineManager::registerDefaultPerspective(Tr::tr("CMake Preset"), "DAP", - ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE); + Constants::DAP_PERSPECTIVE_ID); EngineManager::registerDefaultPerspective(Tr::tr("GDB Preset"), "DAP", - ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE); + Constants::DAP_PERSPECTIVE_ID); + + EngineManager::registerDefaultPerspective(Tr::tr("Python Preset"), + "DAP", + Constants::DAP_PERSPECTIVE_ID); auto breakpointManagerView = createBreakpointManagerView("DAPDebugger.BreakWindow"); auto breakpointManagerWindow @@ -1265,11 +1269,14 @@ void DebuggerPluginPrivate::createDapDebuggerPerspective(QWidget *globalLogWindo connect(&m_startDapAction, &QAction::triggered, this, [] { QComboBox *combo = qobject_cast<QComboBox *>(EngineManager::dapEngineChooser()); if (combo->currentText() == "CMake Preset") { - ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE, - true); + ProjectExplorerPlugin::runStartupProject( + ProjectExplorer::Constants::DAP_CMAKE_DEBUG_RUN_MODE, false); + } else if (combo->currentText() == "GDB Preset") { + ProjectExplorerPlugin::runStartupProject( + ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE, false); } else { ProjectExplorerPlugin::runStartupProject( - ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE, true); + ProjectExplorer::Constants::DAP_PY_DEBUG_RUN_MODE, false); } }); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 9110ae1fdba..788eacb4bfa 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -482,10 +482,12 @@ void DebuggerRunTool::start() runControl()->setDisplayName(m_runParameters.displayName); if (!m_engine) { - if (runControl()->runMode() == ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE) + if (runControl()->runMode() == ProjectExplorer::Constants::DAP_CMAKE_DEBUG_RUN_MODE) m_engine = createDapEngine(runControl()->runMode()); else if (runControl()->runMode() == ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE) - m_engine = createDapEngine(); + m_engine = createDapEngine(runControl()->runMode()); + else if (runControl()->runMode() == ProjectExplorer::Constants::DAP_PY_DEBUG_RUN_MODE) + m_engine = createDapEngine(runControl()->runMode()); else if (m_runParameters.isCppDebugging()) { switch (m_runParameters.cppEngineType) { case GdbEngineType: @@ -918,7 +920,8 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm m_runParameters.interpreter = interpreter; if (auto args = runControl->aspect<ArgumentsAspect>()) m_runParameters.inferior.command.addArgs(args->arguments, CommandLine::Raw); - m_engine = createPdbEngine(); + if (runControl->runMode() == ProjectExplorer::Constants::DEBUG_RUN_MODE) + m_engine = createPdbEngine(); } } } @@ -1120,8 +1123,9 @@ DebuggerRunWorkerFactory::DebuggerRunWorkerFactory() { setProduct<DebuggerRunTool>(); addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE); - addSupportedRunMode(ProjectExplorer::Constants::CMAKE_DEBUG_RUN_MODE); + addSupportedRunMode(ProjectExplorer::Constants::DAP_CMAKE_DEBUG_RUN_MODE); addSupportedRunMode(ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE); + addSupportedRunMode(ProjectExplorer::Constants::DAP_PY_DEBUG_RUN_MODE); addSupportedDeviceType(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE); addSupportedDeviceType("DockerDeviceType"); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index d4c622af291..bda6b4b8f65 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2954,7 +2954,7 @@ void ProjectExplorerPlugin::runRunConfiguration(RunConfiguration *rc, ? BuildForRunConfigStatus::Building : BuildForRunConfigStatus::NotBuilding : BuildManager::potentiallyBuildForRunConfig(rc); - if (dd->m_runMode == Constants::CMAKE_DEBUG_RUN_MODE) + if (dd->m_runMode == Constants::DAP_CMAKE_DEBUG_RUN_MODE) buildStatus = BuildForRunConfigStatus::NotBuilding; switch (buildStatus) { diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index 1537d32e7e2..6677081f4ca 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -178,8 +178,9 @@ const char GENERATOR_ID_PREFIX[] = "PE.Wizard.Generator."; const char NO_RUN_MODE[]="RunConfiguration.NoRunMode"; const char NORMAL_RUN_MODE[]="RunConfiguration.NormalRunMode"; const char DEBUG_RUN_MODE[]="RunConfiguration.DebugRunMode"; -const char CMAKE_DEBUG_RUN_MODE[]="RunConfiguration.CmakeDebugRunMode"; +const char DAP_CMAKE_DEBUG_RUN_MODE[]="RunConfiguration.CmakeDebugRunMode"; const char DAP_GDB_DEBUG_RUN_MODE[]="RunConfiguration.DapGdbDebugRunMode"; +const char DAP_PY_DEBUG_RUN_MODE[]="RunConfiguration.DapPyDebugRunMode"; const char QML_PROFILER_RUN_MODE[]="RunConfiguration.QmlProfilerRunMode"; const char QML_PROFILER_RUNNER[]="RunConfiguration.QmlProfilerRunner"; const char QML_PREVIEW_RUN_MODE[]="RunConfiguration.QmlPreviewRunMode"; From 4132ffd6624add23935a9a87c236182aefbc995f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 31 Aug 2023 11:24:13 +0200 Subject: [PATCH 0940/1777] Core: Fix action key construction Amends c7710acadd7. Change-Id: I87c85cae3fa5624ba0c9d8a2c1aec4d3225c7315 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/actionmanager/actionmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index f17cc76d9ae..3cb3d66c2c8 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -491,7 +491,7 @@ void ActionManagerPrivate::readUserSettings(Id id, Command *cmd) void ActionManagerPrivate::saveSettings(Command *cmd) { const Key id = cmd->id().toKey(); - const Key settingsKey = kKeyboardSettingsKeyV2 + '/' + id; + const Key settingsKey = Key(kKeyboardSettingsKeyV2) + '/' + id; const QList<QKeySequence> keys = cmd->keySequences(); const QList<QKeySequence> defaultKeys = cmd->defaultKeySequences(); if (keys != defaultKeys) { From 95a3087a7b3daa4074b8a14f2e10f52dcdbb7238 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 30 Aug 2023 17:09:09 +0200 Subject: [PATCH 0941/1777] ExtensionSystem: Stop reworking initialization order system This reverts b91f234c7da and some changes on top. With the static-in-function approach the dependency seem to be more easier to solve than with the the central mechanism here. Change-Id: I65be3ced847b31c25637280376f2fe30003f0527 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/libs/extensionsystem/iplugin.cpp | 53 ------------------- src/libs/extensionsystem/iplugin.h | 25 --------- src/libs/extensionsystem/pluginspec.cpp | 3 -- .../autotoolsprojectplugin.cpp | 20 ++++--- src/plugins/conan/conanplugin.cpp | 13 +++-- .../incredibuild/incredibuildplugin.cpp | 14 +++-- src/plugins/vcpkg/vcpkgplugin.cpp | 10 +++- 7 files changed, 43 insertions(+), 95 deletions(-) diff --git a/src/libs/extensionsystem/iplugin.cpp b/src/libs/extensionsystem/iplugin.cpp index 2af49255735..42ddd05bf68 100644 --- a/src/libs/extensionsystem/iplugin.cpp +++ b/src/libs/extensionsystem/iplugin.cpp @@ -161,47 +161,12 @@ namespace ExtensionSystem { namespace Internal { -class ObjectInitializer -{ -public: - ObjectCreator creator; - ObjectDestructor destructor; - ObjectCreationPolicy policy; -}; - class IPluginPrivate { public: - void tryCreateObjects(); - QList<TestCreator> testCreators; - - QList<ObjectInitializer> objectInitializers; - QList<std::function<void()>> objectDestructors; - - // For debugging purposes: - QList<void *> createdObjects; // Not owned. }; -void IPluginPrivate::tryCreateObjects() -{ - QList<ObjectInitializer> unhandledObjectInitializers; - - for (const ObjectInitializer &initializer : std::as_const(objectInitializers)) { - if (!initializer.policy.dependsOn.isEmpty()) { - qWarning("Initialization dependencies are not supported yet"); - unhandledObjectInitializers.append(initializer); - continue; - } - - void *object = initializer.creator(); - createdObjects.append(object); - objectDestructors.append([initializer, object] { initializer.destructor(object); }); - } - - objectInitializers = unhandledObjectInitializers; -} - } // Internal /*! @@ -217,20 +182,10 @@ IPlugin::IPlugin() */ IPlugin::~IPlugin() { - for (const std::function<void()> &dtor : std::as_const(d->objectDestructors)) - dtor(); - delete d; d = nullptr; } -void IPlugin::addManagedHelper(const ObjectCreator &creator, - const ObjectDestructor &destructor, - const ObjectCreationPolicy &policy) -{ - d->objectInitializers.append({creator, destructor, policy}); -} - bool IPlugin::initialize(const QStringList &arguments, QString *errorString) { Q_UNUSED(arguments) @@ -239,14 +194,6 @@ bool IPlugin::initialize(const QStringList &arguments, QString *errorString) return true; } -/*! - \internal -*/ -void IPlugin::tryCreateObjects() -{ - d->tryCreateObjects(); -} - /*! Registers a function object that creates a test object with the owner \a creator. diff --git a/src/libs/extensionsystem/iplugin.h b/src/libs/extensionsystem/iplugin.h index 3e477e42e81..5a8fceb3d6e 100644 --- a/src/libs/extensionsystem/iplugin.h +++ b/src/libs/extensionsystem/iplugin.h @@ -5,8 +5,6 @@ #include "extensionsystem_global.h" -#include <utils/id.h> - #include <QObject> #include <functional> @@ -17,17 +15,6 @@ namespace Internal { class IPluginPrivate; } using TestCreator = std::function<QObject *()>; -using ObjectCreator = std::function<void *()>; -using ObjectDestructor = std::function<void(void *)>; - -struct EXTENSIONSYSTEM_EXPORT ObjectCreationPolicy -{ - // Can be empty if nothing depends on it. - Utils::Id id; - // Objects with empty dependencies are created as soon as possible. - QList<Utils::Id> dependsOn; -}; - class EXTENSIONSYSTEM_EXPORT IPlugin : public QObject { Q_OBJECT @@ -52,7 +39,6 @@ public: // Deprecated in 10.0, use addTest() virtual QVector<QObject *> createTestObjects() const; - virtual void tryCreateObjects(); protected: virtual void initialize() {} @@ -61,17 +47,6 @@ protected: void addTest(Args && ...args) { addTestCreator([args...] { return new Test(args...); }); } void addTestCreator(const TestCreator &creator); - template <typename Type> - void addManaged(const ObjectCreationPolicy &policy = {}) { - addManagedHelper([]() -> void * { return new Type(); }, - [](void *p) { delete static_cast<Type *>(p); }, - policy); - } - - void addManagedHelper(const ObjectCreator &creator, - const ObjectDestructor &destructor, - const ObjectCreationPolicy &policy); - signals: void asynchronousShutdownFinished(); diff --git a/src/libs/extensionsystem/pluginspec.cpp b/src/libs/extensionsystem/pluginspec.cpp index c633eaad610..bbc4e3541c0 100644 --- a/src/libs/extensionsystem/pluginspec.cpp +++ b/src/libs/extensionsystem/pluginspec.cpp @@ -1124,7 +1124,6 @@ bool PluginSpecPrivate::initializePlugin() hasError = true; return false; } - plugin->tryCreateObjects(); state = PluginSpec::Initialized; return true; } @@ -1151,7 +1150,6 @@ bool PluginSpecPrivate::initializeExtensions() return false; } plugin->extensionsInitialized(); - plugin->tryCreateObjects(); state = PluginSpec::Running; return true; } @@ -1172,7 +1170,6 @@ bool PluginSpecPrivate::delayedInitialize() return false; } const bool res = plugin->delayedInitialize(); - plugin->tryCreateObjects(); return res; } diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp index 8649236e152..7dd53126506 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp @@ -74,6 +74,16 @@ public: * be executed in the build process) */ +class AutotoolsProjectPluginPrivate +{ +public: + AutotoolsBuildConfigurationFactory buildConfigFactory; + MakeStepFactory makeStepFactory; + AutogenStepFactory autogenStepFactory; + ConfigureStepFactory configureStepFactory; + AutoreconfStepFactory autoreconfStepFactory; +}; + class AutotoolsProjectPlugin final : public ExtensionSystem::IPlugin { Q_OBJECT @@ -81,14 +91,10 @@ class AutotoolsProjectPlugin final : public ExtensionSystem::IPlugin void initialize() final { - ProjectManager::registerProjectType<AutotoolsProject>(Constants::MAKEFILE_MIMETYPE); - - addManaged<AutotoolsBuildConfigurationFactory>(); - addManaged<MakeStepFactory>(); - addManaged<AutogenStepFactory>(); - addManaged<ConfigureStepFactory>(); - addManaged<AutoreconfStepFactory>(); + d = std::make_unique<AutotoolsProjectPluginPrivate>(); } + + std::unique_ptr<AutotoolsProjectPluginPrivate> d; }; } // AutotoolsProjectManager::Internal diff --git a/src/plugins/conan/conanplugin.cpp b/src/plugins/conan/conanplugin.cpp index 71c3b0c90e2..0a0d3e20244 100644 --- a/src/plugins/conan/conanplugin.cpp +++ b/src/plugins/conan/conanplugin.cpp @@ -7,16 +7,23 @@ namespace Conan::Internal { +class ConanPluginPrivate +{ +public: + ConanInstallStepFactory conanInstallStepFactory; +}; + class ConanPlugin final : public ExtensionSystem::IPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Conan.json") -public: - ConanPlugin() + void initialize() { - addManaged<ConanInstallStepFactory>(); + d = std::make_unique<ConanPluginPrivate>(); } + + std::unique_ptr<ConanPluginPrivate> d; }; } // Conan::Internal diff --git a/src/plugins/incredibuild/incredibuildplugin.cpp b/src/plugins/incredibuild/incredibuildplugin.cpp index 4e8f572812f..8bff118b66e 100644 --- a/src/plugins/incredibuild/incredibuildplugin.cpp +++ b/src/plugins/incredibuild/incredibuildplugin.cpp @@ -8,17 +8,25 @@ namespace IncrediBuild::Internal { +class IncrediBuildPluginPrivate +{ +public: + BuildConsoleStepFactory buildConsoleStepFactory; + IBConsoleStepFactory ibConsolStepFactory; +}; + class IncrediBuildPlugin final : public ExtensionSystem::IPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "IncrediBuild.json") public: - IncrediBuildPlugin() + void initialize() { - addManaged<BuildConsoleStepFactory>(); - addManaged<IBConsoleStepFactory>(); + d = std::make_unique<IncrediBuildPluginPrivate>(); } + + std::unique_ptr<IncrediBuildPluginPrivate> d; }; } // IncrediBuild::Internal diff --git a/src/plugins/vcpkg/vcpkgplugin.cpp b/src/plugins/vcpkg/vcpkgplugin.cpp index 0da92e723c1..2a0153d49ad 100644 --- a/src/plugins/vcpkg/vcpkgplugin.cpp +++ b/src/plugins/vcpkg/vcpkgplugin.cpp @@ -12,6 +12,12 @@ namespace Vcpkg::Internal { +class VcpkgPluginPrivate +{ +public: + VcpkgManifestEditorFactory vcpkgManifestEditorFactory; +}; + class VcpkgPlugin final : public ExtensionSystem::IPlugin { Q_OBJECT @@ -22,12 +28,14 @@ public: { ProjectExplorer::JsonWizardFactory::addWizardPath(":/vcpkg/wizards/"); - addManaged<VcpkgManifestEditorFactory>(); + d = std::make_unique<VcpkgPluginPrivate>(); #ifdef WITH_TESTS addTest<VcpkgSearchTest>(); #endif } + + std::unique_ptr<VcpkgPluginPrivate> d; }; } // namespace Vcpkg::Internal From 616a0c0f774e7225420d4fbe9737f4abf4e861c5 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 31 Aug 2023 10:50:08 +0200 Subject: [PATCH 0942/1777] Terminal: Support Ctrl+C/V on Windows When a selection is present, let Ctrl+C work as copy on Windows. Remove sending ESC key in clearSelection as it interfered with a Paste after copy. Change-Id: I92db7f263e1eb433bca8aa5500fcecb637a23f90 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/libs/solutions/terminal/terminalview.cpp | 4 +++- src/plugins/terminal/shortcutmap.cpp | 23 ++++++++++---------- src/plugins/terminal/shortcutmap.h | 2 +- src/plugins/terminal/terminalwidget.cpp | 20 ++++++++++++----- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/libs/solutions/terminal/terminalview.cpp b/src/libs/solutions/terminal/terminalview.cpp index aeaede23d57..2025b4e7546 100644 --- a/src/libs/solutions/terminal/terminalview.cpp +++ b/src/libs/solutions/terminal/terminalview.cpp @@ -283,6 +283,8 @@ void TerminalView::copyToClipboard() qCDebug(selectionLog) << "Copied to clipboard: " << text; setClipboard(text); + + clearSelection(); } void TerminalView::pasteFromClipboard() @@ -310,7 +312,7 @@ std::optional<TerminalView::Selection> TerminalView::selection() const void TerminalView::clearSelection() { setSelection(std::nullopt); - d->m_surface->sendKey(Qt::Key_Escape); + //d->m_surface->sendKey(Qt::Key_Escape); } void TerminalView::zoomIn() diff --git a/src/plugins/terminal/shortcutmap.cpp b/src/plugins/terminal/shortcutmap.cpp index 72023e808a0..436757fd256 100644 --- a/src/plugins/terminal/shortcutmap.cpp +++ b/src/plugins/terminal/shortcutmap.cpp @@ -9,6 +9,7 @@ #include <algorithm> +#include <QAction> #include <QGuiApplication> #include <QKeyEvent> #include <QLoggingCategory> @@ -216,8 +217,6 @@ QKeySequence::SequenceMatch ShortcutMap::state() */ bool ShortcutMap::tryShortcut(QKeyEvent *e) { - Q_D(ShortcutMap); - if (e->key() == Qt::Key_unknown) return false; @@ -234,14 +233,8 @@ bool ShortcutMap::tryShortcut(QKeyEvent *e) // but we need to say we did, so that we get the follow-up key-presses. return true; case QKeySequence::ExactMatch: { - // Save number of identical matches before dispatching - // to keep ShortcutMap and tryShortcut reentrant. - const int identicalMatches = d->identicals.size(); resetState(); - dispatchEvent(e); - // If there are no identicals we've only found disabled shortcuts, and - // shouldn't say that we handled the event. - return identicalMatches > 0; + return dispatchEvent(e); } } #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) @@ -510,11 +503,11 @@ QList<const ShortcutEntry *> ShortcutMap::matches() const /*! \internal Dispatches QShortcutEvents to widgets who grabbed the matched key sequence. */ -void ShortcutMap::dispatchEvent(QKeyEvent *e) +bool ShortcutMap::dispatchEvent(QKeyEvent *e) { Q_D(ShortcutMap); if (!d->identicals.size()) - return; + return false; const QKeySequence &curKey = d->identicals.at(0)->keyseq; if (d->prevSequence != curKey) { @@ -541,7 +534,7 @@ void ShortcutMap::dispatchEvent(QKeyEvent *e) // Don't trigger shortcut if we're autorepeating and the shortcut is // grabbed with not accepting autorepeats. if (!next || (e->isAutoRepeat() && !next->autorepeat)) - return; + return false; // Dispatch next enabled if (lcShortcutMap().isDebugEnabled()) { if (ambiguousShortcuts.size() > 1) { @@ -559,6 +552,12 @@ void ShortcutMap::dispatchEvent(QKeyEvent *e) } QShortcutEvent se(next->keyseq, next->id, enabledShortcuts > 1); QCoreApplication::sendEvent(const_cast<QObject *>(next->owner), &se); + + QAction *action = qobject_cast<QAction *>(next->owner); + if (action) + return action->isEnabled(); + + return true; } } // namespace Terminal::Internal diff --git a/src/plugins/terminal/shortcutmap.h b/src/plugins/terminal/shortcutmap.h index 956c3b5c9e7..3433a4d172d 100644 --- a/src/plugins/terminal/shortcutmap.h +++ b/src/plugins/terminal/shortcutmap.h @@ -40,7 +40,7 @@ public: private: void resetState(); QKeySequence::SequenceMatch nextState(QKeyEvent *e); - void dispatchEvent(QKeyEvent *e); + bool dispatchEvent(QKeyEvent *e); QKeySequence::SequenceMatch find(QKeyEvent *e, int ignoredModifiers = 0); QKeySequence::SequenceMatch matches(const QKeySequence &seq1, const QKeySequence &seq2) const; diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index c648406e39c..7e4987e3794 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -605,13 +605,21 @@ void TerminalWidget::initActions() moveCursorWordRight.setText(Tr::tr("Move Cursor Word Right")); close.setText(Tr::tr("Close Terminal")); - ActionManager::registerAction(©, Constants::COPY, context) - ->setDefaultKeySequences({QKeySequence( - HostOsInfo::isMacHost() ? QLatin1String("Ctrl+C") : QLatin1String("Ctrl+Shift+C"))}); + auto copyCmd = ActionManager::registerAction(©, Constants::COPY, context); + auto pasteCmd = ActionManager::registerAction(&paste, Constants::PASTE, context); - ActionManager::registerAction(&paste, Constants::PASTE, context) - ->setDefaultKeySequences({QKeySequence( - HostOsInfo::isMacHost() ? QLatin1String("Ctrl+V") : QLatin1String("Ctrl+Shift+V"))}); + if (HostOsInfo::isMacHost()) { + copyCmd->setDefaultKeySequence(QKeySequence(QLatin1String("Ctrl+C"))); + pasteCmd->setDefaultKeySequence(QKeySequence(QLatin1String("Ctrl+V"))); + } else if (HostOsInfo::isLinuxHost()) { + copyCmd->setDefaultKeySequence(QKeySequence(QLatin1String("Ctrl+Shift+C"))); + pasteCmd->setDefaultKeySequence(QKeySequence(QLatin1String("Ctrl+Shift+V"))); + } else if (HostOsInfo::isWindowsHost()) { + copyCmd->setDefaultKeySequences( + {QKeySequence(QLatin1String("Ctrl+C")), QKeySequence(QLatin1String("Ctrl+Shift+C"))}); + pasteCmd->setDefaultKeySequences( + {QKeySequence(QLatin1String("Ctrl+V")), QKeySequence(QLatin1String("Ctrl+Shift+V"))}); + } ActionManager::registerAction(&clearSelection, Constants::CLEARSELECTION, context); From b418c81414b5d1d0d41c08793f15de56f5bbbb26 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 31 Aug 2023 12:11:16 +0200 Subject: [PATCH 0943/1777] Utils: collect host root dir once This improves the startup performance ~30% on certain machines Change-Id: Ic7b74d42b0e13ec1dd695d4f322de021b996c051 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/filepath.cpp | 6 +++--- src/libs/utils/filesystemmodel.cpp | 6 ++---- .../utils/fsengine/fileiteratordevicesappender.h | 3 ++- src/libs/utils/fsengine/fsenginehandler.cpp | 2 +- src/libs/utils/hostosinfo.cpp | 13 ++++++++++++- src/libs/utils/hostosinfo.h | 4 ++++ .../projectexplorer/devicesupport/desktopdevice.cpp | 2 +- 7 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index abafc7748e8..4ab0f502f74 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -225,7 +225,7 @@ bool FilePath::isRootPath() const return true; } - return *this == FilePath::fromString(QDir::rootPath()); + return *this == HostOsInfo::root(); } QString FilePath::encodedHost() const @@ -986,7 +986,7 @@ const QString &FilePath::specialRootName() const QString &FilePath::specialRootPath() { - static const QString rootPath = QDir::rootPath() + u"__qtc_devices__"; + static const QString rootPath = HostOsInfo::root().path() + u"__qtc_devices__"; return rootPath; } @@ -998,7 +998,7 @@ const QString &FilePath::specialDeviceRootName() const QString &FilePath::specialDeviceRootPath() { - static const QString deviceRootPath = QDir::rootPath() + u"__qtc_devices__/device"; + static const QString deviceRootPath = HostOsInfo::root().path() + u"__qtc_devices__/device"; return deviceRootPath; } diff --git a/src/libs/utils/filesystemmodel.cpp b/src/libs/utils/filesystemmodel.cpp index a6bce17cabc..fb0441185d1 100644 --- a/src/libs/utils/filesystemmodel.cpp +++ b/src/libs/utils/filesystemmodel.cpp @@ -1053,10 +1053,8 @@ FileSystemNode *FileSystemModelPrivate::node(const QString &path, bool fetch) co elementPath = host; elementPath.append(separator); } else { - if (!pathElements.at(0).contains(QLatin1Char(':'))) { - QString rootPath = QDir(longPath).rootPath(); - pathElements.prepend(rootPath); - } + if (!pathElements.at(0).contains(QLatin1Char(':'))) + pathElements.prepend(HostOsInfo::root().path()); if (pathElements.at(0).endsWith(QLatin1Char('/'))) pathElements[0].chop(1); } diff --git a/src/libs/utils/fsengine/fileiteratordevicesappender.h b/src/libs/utils/fsengine/fileiteratordevicesappender.h index 9aec917d6b7..a28f1190806 100644 --- a/src/libs/utils/fsengine/fileiteratordevicesappender.h +++ b/src/libs/utils/fsengine/fileiteratordevicesappender.h @@ -4,6 +4,7 @@ #pragma once #include "../filepath.h" +#include "../hostosinfo.h" #include <QtCore/private/qabstractfileengine_p.h> @@ -97,7 +98,7 @@ private: // We only need QDir::cleanPath here, as the path is always // a fs engine path and will not contain scheme:// etc. const QString p = QDir::cleanPath(path()); - if (p.compare(QDir::rootPath(), Qt::CaseInsensitive) == 0) + if (p.compare(HostOsInfo::root().path(), Qt::CaseInsensitive) == 0) m_status = State::IteratingRoot; ((*m_baseIterator).*get(QAFEITag()))(p); diff --git a/src/libs/utils/fsengine/fsenginehandler.cpp b/src/libs/utils/fsengine/fsenginehandler.cpp index e020eebddac..55174bc75cd 100644 --- a/src/libs/utils/fsengine/fsenginehandler.cpp +++ b/src/libs/utils/fsengine/fsenginehandler.cpp @@ -71,7 +71,7 @@ QAbstractFileEngine *FSEngineHandler::create(const QString &fileName) const return new FSEngineImpl(removeDoubleSlash(fileName)); } - if (fixedFileName.compare(QDir::rootPath(), Qt::CaseInsensitive) == 0) + if (fixedFileName.compare(HostOsInfo::root().path(), Qt::CaseInsensitive) == 0) return new RootInjectFSEngine(fileName); return nullptr; diff --git a/src/libs/utils/hostosinfo.cpp b/src/libs/utils/hostosinfo.cpp index bf038ea82d2..d8361266f08 100644 --- a/src/libs/utils/hostosinfo.cpp +++ b/src/libs/utils/hostosinfo.cpp @@ -3,8 +3,11 @@ #include "hostosinfo.h" +#include "filepath.h" #include "utilstr.h" +#include <QDir> + #if !defined(QT_NO_OPENGL) && defined(QT_GUI_LIB) #include <QOpenGLContext> #endif @@ -21,7 +24,7 @@ #include <sys/sysctl.h> #endif -using namespace Utils; +namespace Utils { Qt::CaseSensitivity HostOsInfo::m_overrideFileNameCaseSensitivity = Qt::CaseSensitive; bool HostOsInfo::m_useOverrideFileNameCaseSensitivity = false; @@ -116,3 +119,11 @@ std::optional<quint64> HostOsInfo::totalMemoryInstalledInBytes() #endif return {}; } + +const FilePath &HostOsInfo::root() +{ + static const FilePath rootDir = FilePath::fromUserInput(QDir::rootPath()); + return rootDir; +} + +} // namespace Utils diff --git a/src/libs/utils/hostosinfo.h b/src/libs/utils/hostosinfo.h index 090bf9e6d4a..44880f7885c 100644 --- a/src/libs/utils/hostosinfo.h +++ b/src/libs/utils/hostosinfo.h @@ -21,6 +21,8 @@ QT_END_NAMESPACE namespace Utils { +class FilePath; + class QTCREATOR_UTILS_EXPORT HostOsInfo { public: @@ -86,6 +88,8 @@ public: static std::optional<quint64> totalMemoryInstalledInBytes(); + static const FilePath &root(); + private: static Qt::CaseSensitivity m_overrideFileNameCaseSensitivity; static bool m_useOverrideFileNameCaseSensitivity; diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 9f6c2a408f3..a5cee8b3a6a 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -125,7 +125,7 @@ Environment DesktopDevice::systemEnvironment() const FilePath DesktopDevice::rootPath() const { if (id() == DESKTOP_DEVICE_ID) - return FilePath::fromParts({}, {}, QDir::rootPath()); + return HostOsInfo::root(); return IDevice::rootPath(); } From 93e188ab944fe10fdead208e1829465ac2819858 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 29 Aug 2023 14:29:16 +0200 Subject: [PATCH 0944/1777] QtSupport: Move QtVersionManager closer to "new" singleton pattern Not 100%, as there are a few more local variables involved. Change-Id: I15458d614c381862aa6f9e1c54d56c045bac8941 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/qtsupport/qtsupportplugin.cpp | 2 - src/plugins/qtsupport/qtversionmanager.cpp | 157 ++++++++++++--------- src/plugins/qtsupport/qtversionmanager.h | 12 +- 3 files changed, 94 insertions(+), 77 deletions(-) diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index 93a62f0deb4..235fccf7a1a 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -46,8 +46,6 @@ namespace Internal { class QtSupportPluginPrivate { public: - QtVersionManager qtVersionManager; - DesktopQtVersionFactory desktopQtVersionFactory; EmbeddedLinuxQtVersionFactory embeddedLinuxQtVersionFactory; diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 9062e9b7fd7..aff50f086fa 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -33,6 +33,7 @@ #include <QTextStream> #include <QTimer> +using namespace ProjectExplorer; using namespace Utils; namespace QtSupport { @@ -49,13 +50,8 @@ static VersionMap m_versions; const char DOCUMENTATION_SETTING_KEY[] = "QtSupport/DocumentationSetting"; -static int m_idcount = 0; -// managed by QtProjectManagerPlugin -static QtVersionManager *m_instance = nullptr; -static FileSystemWatcher *m_configFileWatcher = nullptr; -static QTimer *m_fileWatcherTimer = nullptr; -static PersistentSettingsWriter *m_writer = nullptr; -static QVector<ExampleSetModel::ExtraExampleSet> m_pluginRegisteredExampleSets; +QVector<ExampleSetModel::ExtraExampleSet> m_pluginRegisteredExampleSets; + static Q_LOGGING_CATEGORY(log, "qtc.qt.versions", QtWarningMsg); @@ -69,47 +65,77 @@ static FilePath settingsFileName(const QString &path) return Core::ICore::userResourcePath(path); } - // prefer newer qts otherwise compare on id bool qtVersionNumberCompare(QtVersion *a, QtVersion *b) { return a->qtVersion() > b->qtVersion() || (a->qtVersion() == b->qtVersion() && a->uniqueId() < b->uniqueId()); } -static bool restoreQtVersions(); -static void findSystemQt(); -static void saveQtVersions(); - QVector<ExampleSetModel::ExtraExampleSet> ExampleSetModel::pluginRegisteredExampleSets() { return m_pluginRegisteredExampleSets; } -// -------------------------------------------------------------------------- // QtVersionManager -// -------------------------------------------------------------------------- -QtVersionManager::QtVersionManager() +class QtVersionManagerImpl : public QtVersionManager { - m_instance = this; - m_configFileWatcher = nullptr; - m_fileWatcherTimer = new QTimer(this); - m_writer = nullptr; - m_idcount = 1; +public: + QtVersionManagerImpl() + { + qRegisterMetaType<FilePath>(); - qRegisterMetaType<FilePath>(); + // Give the file a bit of time to settle before reading it... + m_fileWatcherTimer.setInterval(2000); + connect(&m_fileWatcherTimer, &QTimer::timeout, this, [this] { updateFromInstaller(); }); - // Give the file a bit of time to settle before reading it... - m_fileWatcherTimer->setInterval(2000); - connect(m_fileWatcherTimer, &QTimer::timeout, this, [this] { updateFromInstaller(); }); + connect(ToolChainManager::instance(), &ToolChainManager::toolChainsLoaded, + this, &QtVersionManagerImpl::triggerQtVersionRestore); + } + + ~QtVersionManagerImpl() + { + delete m_writer; + qDeleteAll(m_versions); + m_versions.clear(); + } + + void updateFromInstaller(bool emitSignal = true); + void triggerQtVersionRestore(); + + bool restoreQtVersions(); + void findSystemQt(); + void saveQtVersions(); + + void updateDocumentation(const QtVersions &added, + const QtVersions &removed, + const QtVersions &allNew); + + void setNewQtVersions(const QtVersions &newVersions); + QString qmakePath(const QString &qtchooser, const QString &version); + + QList<QByteArray> runQtChooser(const QString &qtchooser, const QStringList &arguments); + FilePaths gatherQmakePathsFromQtChooser(); + + int m_idcount = 1; + // managed by QtProjectManagerPlugin + FileSystemWatcher *m_configFileWatcher = nullptr; + QTimer m_fileWatcherTimer; + PersistentSettingsWriter *m_writer = nullptr; +}; + +QtVersionManagerImpl &qtVersionManagerImpl() +{ + static QtVersionManagerImpl theQtVersionManager; + return theQtVersionManager; } -void QtVersionManager::triggerQtVersionRestore() +void QtVersionManagerImpl::triggerQtVersionRestore() { - disconnect(ProjectExplorer::ToolChainManager::instance(), &ProjectExplorer::ToolChainManager::toolChainsLoaded, - this, &QtVersionManager::triggerQtVersionRestore); + disconnect(ToolChainManager::instance(), &ToolChainManager::toolChainsLoaded, + this, &QtVersionManagerImpl::triggerQtVersionRestore); bool success = restoreQtVersions(); - m_instance->updateFromInstaller(false); + updateFromInstaller(false); if (!success) { // We did neither restore our settings or upgraded // in that case figure out if there's a qt in path @@ -117,45 +143,38 @@ void QtVersionManager::triggerQtVersionRestore() findSystemQt(); } - emit m_instance->qtVersionsLoaded(); - emit m_instance->qtVersionsChanged(m_versions.keys(), QList<int>(), QList<int>()); + emit qtVersionsLoaded(); + emit qtVersionsChanged(m_versions.keys(), QList<int>(), QList<int>()); const FilePath configFileName = globalSettingsFileName(); if (configFileName.exists()) { - m_configFileWatcher = new FileSystemWatcher(m_instance); + m_configFileWatcher = new FileSystemWatcher(this); connect(m_configFileWatcher, &FileSystemWatcher::fileChanged, - m_fileWatcherTimer, QOverload<>::of(&QTimer::start)); + &m_fileWatcherTimer, QOverload<>::of(&QTimer::start)); m_configFileWatcher->addFile(configFileName, FileSystemWatcher::WatchModifiedDate); } // exists const QtVersions vs = versions(); - updateDocumentation(vs, {}, vs); + qtVersionManagerImpl().updateDocumentation(vs, {}, vs); } bool QtVersionManager::isLoaded() { - return m_writer; -} - -QtVersionManager::~QtVersionManager() -{ - delete m_writer; - qDeleteAll(m_versions); - m_versions.clear(); -} - -void QtVersionManager::initialized() -{ - connect(ProjectExplorer::ToolChainManager::instance(), &ProjectExplorer::ToolChainManager::toolChainsLoaded, - QtVersionManager::instance(), &QtVersionManager::triggerQtVersionRestore); + return qtVersionManagerImpl().m_writer; } QtVersionManager *QtVersionManager::instance() { - return m_instance; + return &qtVersionManagerImpl(); } -static bool restoreQtVersions() +void QtVersionManager::initialized() +{ + // Force creation. FIXME: Remove. + qtVersionManagerImpl(); +} + +bool QtVersionManagerImpl::restoreQtVersions() { QTC_ASSERT(!m_writer, return false); m_writer = new PersistentSettingsWriter(settingsFileName(QTVERSION_FILENAME), @@ -216,9 +235,9 @@ static bool restoreQtVersions() return true; } -void QtVersionManager::updateFromInstaller(bool emitSignal) +void QtVersionManagerImpl::updateFromInstaller(bool emitSignal) { - m_fileWatcherTimer->stop(); + m_fileWatcherTimer.stop(); const FilePath path = globalSettingsFileName(); // Handle overwritting of data: @@ -344,7 +363,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) emit qtVersionsChanged(added, removed, changed); } -static void saveQtVersions() +void QtVersionManagerImpl::saveQtVersions() { if (!m_writer) return; @@ -365,7 +384,7 @@ static void saveQtVersions() } // Executes qtchooser with arguments in a process and returns its output -static QList<QByteArray> runQtChooser(const QString &qtchooser, const QStringList &arguments) +QList<QByteArray> QtVersionManagerImpl::runQtChooser(const QString &qtchooser, const QStringList &arguments) { Process p; p.setCommand({FilePath::fromString(qtchooser), arguments}); @@ -376,7 +395,7 @@ static QList<QByteArray> runQtChooser(const QString &qtchooser, const QStringLis } // Asks qtchooser for the qmake path of a given version -static QString qmakePath(const QString &qtchooser, const QString &version) +QString QtVersionManagerImpl::qmakePath(const QString &qtchooser, const QString &version) { const QList<QByteArray> outputs = runQtChooser(qtchooser, {QStringLiteral("-qt=%1").arg(version), @@ -392,7 +411,7 @@ static QString qmakePath(const QString &qtchooser, const QString &version) return QString(); } -static FilePaths gatherQmakePathsFromQtChooser() +FilePaths QtVersionManagerImpl::gatherQmakePathsFromQtChooser() { const QString qtchooser = QStandardPaths::findExecutable(QStringLiteral("qtchooser")); if (qtchooser.isEmpty()) @@ -409,7 +428,7 @@ static FilePaths gatherQmakePathsFromQtChooser() return Utils::toList(foundQMakes); } -static void findSystemQt() +void QtVersionManagerImpl::findSystemQt() { FilePaths systemQMakes = BuildableHelperLibrary::findQtsInEnvironment(Environment::systemEnvironment()); @@ -432,7 +451,6 @@ static void findSystemQt() void QtVersionManager::addVersion(QtVersion *version) { - QTC_ASSERT(m_writer, return); QTC_ASSERT(version, return); if (m_versions.contains(version->uniqueId())) return; @@ -440,16 +458,16 @@ void QtVersionManager::addVersion(QtVersion *version) int uniqueId = version->uniqueId(); m_versions.insert(uniqueId, version); - emit m_instance->qtVersionsChanged(QList<int>() << uniqueId, QList<int>(), QList<int>()); - saveQtVersions(); + emit qtVersionManagerImpl().qtVersionsChanged(QList<int>() << uniqueId, QList<int>(), QList<int>()); + qtVersionManagerImpl().saveQtVersions(); } void QtVersionManager::removeVersion(QtVersion *version) { QTC_ASSERT(version, return); m_versions.remove(version->uniqueId()); - emit m_instance->qtVersionsChanged(QList<int>(), QList<int>() << version->uniqueId(), QList<int>()); - saveQtVersions(); + emit qtVersionManagerImpl().qtVersionsChanged(QList<int>(), QList<int>() << version->uniqueId(), QList<int>()); + qtVersionManagerImpl().saveQtVersions(); delete version; } @@ -495,9 +513,9 @@ static QStringList documentationFiles(const QtVersions &vs, bool highestOnly = f return filePaths.values(); } -void QtVersionManager::updateDocumentation(const QtVersions &added, - const QtVersions &removed, - const QtVersions &allNew) +void QtVersionManagerImpl::updateDocumentation(const QtVersions &added, + const QtVersions &removed, + const QtVersions &allNew) { const DocumentationSetting setting = documentationSetting(); const QStringList docsOfAll = setting == DocumentationSetting::None @@ -519,7 +537,7 @@ void QtVersionManager::updateDocumentation(const QtVersions &added, int QtVersionManager::getUniqueId() { - return m_idcount++; + return qtVersionManagerImpl().m_idcount++; } QtVersions QtVersionManager::versions(const QtVersion::Predicate &predicate) @@ -557,6 +575,11 @@ static bool equals(QtVersion *a, QtVersion *b) } void QtVersionManager::setNewQtVersions(const QtVersions &newVersions) +{ + qtVersionManagerImpl().setNewQtVersions(newVersions); +} + +void QtVersionManagerImpl::setNewQtVersions(const QtVersions &newVersions) { // We want to preserve the same order as in the settings dialog // so we sort a copy @@ -627,7 +650,7 @@ void QtVersionManager::setNewQtVersions(const QtVersions &newVersions) saveQtVersions(); if (!changedVersions.isEmpty() || !addedVersions.isEmpty() || !removedVersions.isEmpty()) - emit m_instance->qtVersionsChanged(addedIds, removedIds, changedIds); + emit qtVersionManagerImpl().qtVersionsChanged(addedIds, removedIds, changedIds); } void QtVersionManager::setDocumentationSetting(const QtVersionManager::DocumentationSetting &setting) @@ -638,7 +661,7 @@ void QtVersionManager::setDocumentationSetting(const QtVersionManager::Documenta // force re-evaluating which documentation should be registered // by claiming that all are removed and re-added const QtVersions vs = versions(); - updateDocumentation(vs, vs, vs); + qtVersionManagerImpl().updateDocumentation(vs, vs, vs); } QtVersionManager::DocumentationSetting QtVersionManager::documentationSetting() diff --git a/src/plugins/qtsupport/qtversionmanager.h b/src/plugins/qtsupport/qtversionmanager.h index 49c0351bb0c..97f8e6d537f 100644 --- a/src/plugins/qtsupport/qtversionmanager.h +++ b/src/plugins/qtsupport/qtversionmanager.h @@ -14,12 +14,11 @@ class QTSUPPORT_EXPORT QtVersionManager : public QObject // for getUniqueId(); friend class QtVersion; friend class QtVersionFactory; + friend class QtVersionManagerImpl; friend class Internal::QtOptionsPageWidget; public: static QtVersionManager *instance(); - QtVersionManager(); - ~QtVersionManager() override; static void initialized(); static bool isLoaded(); @@ -51,15 +50,12 @@ signals: void qtVersionsChanged(const QList<int> &addedIds, const QList<int> &removedIds, const QList<int> &changedIds); void qtVersionsLoaded(); +protected: + QtVersionManager() = default; + private: enum class DocumentationSetting { HighestOnly, All, None }; - static void updateDocumentation(const QtVersions &added, - const QtVersions &removed, - const QtVersions &allNew); - void updateFromInstaller(bool emitSignal = true); - void triggerQtVersionRestore(); - // Used by QtOptionsPage static void setNewQtVersions(const QtVersions &newVersions); static void setDocumentationSetting(const DocumentationSetting &setting); From e1de2dfc0791459b8f37dc698c8f7d1812130a0a Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 31 Aug 2023 13:49:02 +0200 Subject: [PATCH 0945/1777] Debugger: Fix qbs build Change-Id: Ic34026548587187d0fa092454980d94250c6353d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/debugger/debugger.qbs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 9a0d75a7e70..7e42fecd57f 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -129,6 +129,7 @@ Project { "dapclient.cpp", "dapclient.h", "dapengine.cpp", "dapengine.h", "gdbdapengine.cpp", "gdbdapengine.h", + "pydapengine.cpp", "pydapengine.h", ] } From 925b7a356655ce8a9a57ca34a15f3785c617541b Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 24 Aug 2023 18:11:01 +0200 Subject: [PATCH 0946/1777] CMakePM: Replace QDir with Utils::FilePath in editor This way we could handle remote files. Change-Id: I7062445cb743a2838f3c9f1bcff89611127011ca Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../cmakeprojectmanager/cmakeeditor.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 4425281a9ee..65b69bce2dd 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -19,7 +19,6 @@ #include <texteditor/texteditoractionhandler.h> #include <utils/textutils.h> -#include <QDir> #include <QTextDocument> #include <functional> @@ -186,7 +185,7 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, if (buffer.isEmpty()) return processLinkCallback(link); - QDir dir(textDocument()->filePath().toFileInfo().absolutePath()); + const Utils::FilePath dir = textDocument()->filePath().absolutePath(); buffer.replace("${CMAKE_CURRENT_SOURCE_DIR}", dir.path()); buffer.replace("${CMAKE_CURRENT_LIST_DIR}", dir.path()); @@ -211,18 +210,18 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, } // TODO: Resolve more variables - QString fileName = dir.filePath(unescape(buffer)); - QFileInfo fi(fileName); - if (fi.exists()) { - if (fi.isDir()) { - QDir subDir(fi.absoluteFilePath()); - QString subProject = subDir.filePath(QLatin1String("CMakeLists.txt")); - if (QFileInfo::exists(subProject)) + Utils::FilePath fileName = dir.withNewPath(unescape(buffer)); + if (fileName.isRelativePath()) + fileName = dir.pathAppended(fileName.path()); + if (fileName.exists()) { + if (fileName.isDir()) { + Utils::FilePath subProject = fileName.pathAppended("CMakeLists.txt"); + if (subProject.exists()) fileName = subProject; else return processLinkCallback(link); } - link.targetFilePath = Utils::FilePath::fromString(fileName); + link.targetFilePath = fileName; link.linkTextStart = cursor.position() - column + beginPos + 1; link.linkTextEnd = cursor.position() - column + endPos; } From fb4177a540e398049fb9d72cf693b5962f506a21 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 31 Aug 2023 13:37:04 +0200 Subject: [PATCH 0947/1777] cmake build: Set the WITH_TESTS macro also in the tests themselves Otherwise plugin and test code might parse header files differently. Change-Id: I0243a7780b7095a4c518da26cc3cf23fd9f76cf5 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- cmake/QtCreatorAPI.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index ce43bf6b8f5..7c50189be83 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -850,7 +850,7 @@ function(add_qtc_test name) endif() endforeach() - set(TEST_DEFINES SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}") + set(TEST_DEFINES WITH_TESTS SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}") # relax cast requirements for tests get_default_defines(default_defines_copy YES) From 246f33c20d1f9589a891223c820d009212d8bb00 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 24 Aug 2023 19:18:44 +0200 Subject: [PATCH 0948/1777] CMakePM: Replace QDir with FilePath in fileapiextractor This allows remote support. Change-Id: I5ac46b1c2ed0e7e1fcc559522f1fcd902f83b8c0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../fileapidataextractor.cpp | 30 ++++++++----------- .../cmakeprojectmanager/fileapiparser.h | 1 - 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 7539ffc2945..ebb03d950fc 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -19,7 +19,6 @@ #include <projectexplorer/projecttree.h> -#include <QDir> #include <QLoggingCategory> using namespace ProjectExplorer; @@ -148,7 +147,7 @@ PreprocessedData preprocess(FileApiData &data, } QVector<FolderNode::LocationInfo> extractBacktraceInformation(const BacktraceInfo &backtraces, - const QDir &sourceDir, + const FilePath &sourceDir, int backtraceIndex, unsigned int locationInfoPriority) { @@ -162,8 +161,7 @@ QVector<FolderNode::LocationInfo> extractBacktraceInformation(const BacktraceInf const size_t fileIndex = static_cast<size_t>(btNode.file); QTC_ASSERT(fileIndex < backtraces.files.size(), break); - const FilePath path = FilePath::fromString( - sourceDir.absoluteFilePath(backtraces.files[fileIndex])); + const FilePath path = sourceDir.pathAppended(backtraces.files[fileIndex]).absoluteFilePath(); if (btNode.command < 0) { // No command, skip: The file itself is already covered:-) @@ -193,10 +191,8 @@ QList<CMakeBuildTarget> generateBuildTargets(const PreprocessedData &input, const FilePath &buildDirectory, bool haveLibrariesRelativeToBuildDirectory) { - QDir sourceDir(sourceDirectory.toString()); - const QList<CMakeBuildTarget> result = transform<QList>(input.targetDetails, - [&sourceDir, &sourceDirectory, &buildDirectory, + [&sourceDirectory, &buildDirectory, &haveLibrariesRelativeToBuildDirectory](const TargetDetails &t) { const FilePath currentBuildDir = buildDirectory.resolvePath(t.buildDir); @@ -221,29 +217,29 @@ QList<CMakeBuildTarget> generateBuildTargets(const PreprocessedData &input, : ct.executable.parentDir(); ct.sourceDirectory = sourceDirectory.resolvePath(t.sourceDir); - ct.backtrace = extractBacktraceInformation(t.backtraceGraph, sourceDir, t.backtrace, 0); + ct.backtrace = extractBacktraceInformation(t.backtraceGraph, sourceDirectory, t.backtrace, 0); for (const DependencyInfo &d : t.dependencies) { ct.dependencyDefinitions.append( - extractBacktraceInformation(t.backtraceGraph, sourceDir, d.backtrace, 100)); + extractBacktraceInformation(t.backtraceGraph, sourceDirectory, d.backtrace, 100)); } for (const SourceInfo &si : t.sources) { ct.sourceDefinitions.append( - extractBacktraceInformation(t.backtraceGraph, sourceDir, si.backtrace, 200)); + extractBacktraceInformation(t.backtraceGraph, sourceDirectory, si.backtrace, 200)); } for (const CompileInfo &ci : t.compileGroups) { for (const IncludeInfo &ii : ci.includes) { ct.includeDefinitions.append( - extractBacktraceInformation(t.backtraceGraph, sourceDir, ii.backtrace, 300)); + extractBacktraceInformation(t.backtraceGraph, sourceDirectory, ii.backtrace, 300)); } for (const DefineInfo &di : ci.defines) { ct.defineDefinitions.append( - extractBacktraceInformation(t.backtraceGraph, sourceDir, di.backtrace, 400)); + extractBacktraceInformation(t.backtraceGraph, sourceDirectory, di.backtrace, 400)); } } for (const InstallDestination &id : t.installDestination) { ct.installDefinitions.append( - extractBacktraceInformation(t.backtraceGraph, sourceDir, id.backtrace, 500)); + extractBacktraceInformation(t.backtraceGraph, sourceDirectory, id.backtrace, 500)); } if (ct.targetType == ExecutableType) { @@ -343,7 +339,6 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input, RawProjectParts rpps; for (const TargetDetails &t : input.targetDetails) { - QDir sourceDir(sourceDirectory.toString()); bool needPostfix = t.compileGroups.size() > 1; int count = 1; for (const CompileInfo &ci : t.compileGroups) { @@ -390,7 +385,7 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input, SourceInfo si = t.sources.at(idx); if (si.isGenerated) continue; - sources.push_back(sourceDir.absoluteFilePath(si.path)); + sources.push_back(sourceDirectory.pathAppended(si.path).absoluteFilePath().path()); } // If we are not in a pch compiler group, add all the headers that are not generated @@ -410,7 +405,8 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input, const auto mimeTypes = Utils::mimeTypesForFileName(si.path); for (const auto &mime : mimeTypes) if (mime.inherits(headerMimeType)) - sources.push_back(sourceDir.absoluteFilePath(si.path)); + sources.push_back( + sourceDirectory.pathAppended(si.path).absoluteFilePath().path()); } } @@ -431,7 +427,7 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input, }).path); if (!precompiled_header.isEmpty()) { if (precompiled_header.toFileInfo().isRelative()) { - const FilePath parentDir = FilePath::fromString(sourceDir.absolutePath()); + const FilePath parentDir = sourceDirectory.parentDir(); precompiled_header = parentDir.pathAppended(precompiled_header.toString()); } diff --git a/src/plugins/cmakeprojectmanager/fileapiparser.h b/src/plugins/cmakeprojectmanager/fileapiparser.h index f6b54968660..900f630cf7e 100644 --- a/src/plugins/cmakeprojectmanager/fileapiparser.h +++ b/src/plugins/cmakeprojectmanager/fileapiparser.h @@ -13,7 +13,6 @@ #include <utils/filesystemwatcher.h> #include <utils/fileutils.h> -#include <QDir> #include <QString> #include <QVector> #include <QVersionNumber> From 09f15a31dfd4e9ff4c860fb7c38c1003a85638db Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 29 Aug 2023 15:45:38 +0200 Subject: [PATCH 0949/1777] Utils: Remove the non-QTC_USE_STORE case Change-Id: I857a38c80470d1b474ca0f291a93ed58fbcc0bf4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/id.cpp | 4 ---- src/libs/utils/store.cpp | 10 ---------- src/libs/utils/store.h | 6 ------ src/libs/utils/storekey.h | 14 -------------- src/plugins/fakevim/fakevimactions.h | 4 ---- 5 files changed, 38 deletions(-) diff --git a/src/libs/utils/id.cpp b/src/libs/utils/id.cpp index 60417d1b7ca..383d992da0d 100644 --- a/src/libs/utils/id.cpp +++ b/src/libs/utils/id.cpp @@ -161,11 +161,7 @@ QString Id::toString() const /*! \internal */ Key Id::toKey() const { -#ifdef QTC_USE_STORE return name(); -#else - return toString(); -#endif } /*! diff --git a/src/libs/utils/store.cpp b/src/libs/utils/store.cpp index 96425d8f467..d48adc2cde4 100644 --- a/src/libs/utils/store.cpp +++ b/src/libs/utils/store.cpp @@ -38,7 +38,6 @@ Store storeFromVariant(const QVariant &value) return Store(); } -#ifdef QTC_USE_STORE static QVariantList storeListFromMapList(const QVariantList &mapList) { QVariantList storeList; @@ -70,11 +69,9 @@ static QVariantList mapListFromStoreList(const QVariantList &storeList) return mapList; } -#endif Store storeFromMap(const QVariantMap &map) { -#ifdef QTC_USE_STORE Store store; for (auto it = map.begin(); it != map.end(); ++it) { if (it.value().type() == QVariant::Map) { @@ -87,14 +84,10 @@ Store storeFromMap(const QVariantMap &map) } } return store; -#else - return map; -#endif } QVariantMap mapFromStore(const Store &store) { -#ifdef QTC_USE_STORE QVariantMap map; for (auto it = store.begin(); it != store.end(); ++it) { if (it.value().metaType() == QMetaType::fromType<Store>()) @@ -105,9 +98,6 @@ QVariantMap mapFromStore(const Store &store) map.insert(stringFromKey(it.key()), it.value()); } return map; -#else - return store; -#endif } bool isStore(const QVariant &value) diff --git a/src/libs/utils/store.h b/src/libs/utils/store.h index 85f677151fa..3050251bc1c 100644 --- a/src/libs/utils/store.h +++ b/src/libs/utils/store.h @@ -12,11 +12,7 @@ namespace Utils { using KeyList = QList<Key>; -#ifdef QTC_USE_STORE using Store = QMap<Key, QVariant>; -#else -using Store = QVariantMap; -#endif QTCREATOR_UTILS_EXPORT KeyList keysFromStrings(const QStringList &list); QTCREATOR_UTILS_EXPORT QStringList stringsFromKeys(const KeyList &list); @@ -33,6 +29,4 @@ QTCREATOR_UTILS_EXPORT Key numberedKey(const Key &key, int number); } // Utils -#ifdef QTC_USE_STORE Q_DECLARE_METATYPE(Utils::Store) -#endif diff --git a/src/libs/utils/storekey.h b/src/libs/utils/storekey.h index 4f7e4516fc6..7e02353e17a 100644 --- a/src/libs/utils/storekey.h +++ b/src/libs/utils/storekey.h @@ -9,23 +9,9 @@ namespace Utils { -// Opt-in to new classes during the transition phase. -#define QTC_USE_STORE - -#ifdef QTC_USE_STORE - using Key = QByteArray; inline Key keyFromString(const QString &str) { return str.toUtf8(); } inline QString stringFromKey(const Key &key) { return QString::fromUtf8(key); } -#else - -using Key = QString; - -inline Key keyFromString(const QString &str) { return str; } -inline QString stringFromKey(const Key &key) { return key; } - -#endif - } // Utils diff --git a/src/plugins/fakevim/fakevimactions.h b/src/plugins/fakevim/fakevimactions.h index 29d4bbd7052..ac4256eca02 100644 --- a/src/plugins/fakevim/fakevimactions.h +++ b/src/plugins/fakevim/fakevimactions.h @@ -25,11 +25,7 @@ namespace FakeVim::Internal { #ifdef FAKEVIM_STANDALONE -#ifdef QTC_USE_STORE using Key = QByteArray; -#else -using Key = QString; -#endif class FvBaseAspect { From 07ad848ea18d3246f22d019bb87f57ece7be2e16 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 24 Aug 2023 18:45:31 +0200 Subject: [PATCH 0950/1777] CMakePM: Replace QDir in CMakeBuildConfiguration This allows remote support. Change-Id: I12c991d584baa3762102b8a19179e732a31f192b Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index e47ff834fd1..8c004a95bc6 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -65,7 +65,6 @@ #include <QCheckBox> #include <QDialog> #include <QDialogButtonBox> -#include <QDir> #include <QGridLayout> #include <QHeaderView> #include <QLoggingCategory> @@ -1352,7 +1351,10 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) if (oldDir.isEmpty()) return newDir; - if (QDir(oldDir).exists("CMakeCache.txt") && !QDir(newDir).exists("CMakeCache.txt")) { + const FilePath oldDirCMakeCache = FilePath::fromUserInput(oldDir).pathAppended("CMakeCache.txt"); + const FilePath newDirCMakeCache = FilePath::fromUserInput(newDir).pathAppended("CMakeCache.txt"); + + if (oldDirCMakeCache.exists() && !newDirCMakeCache.exists()) { if (QMessageBox::information( Core::ICore::dialogParent(), Tr::tr("Changing Build Directory"), From d2231365affd32de999dcfcd17fe0fa89cd441a6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 31 Aug 2023 15:55:51 +0200 Subject: [PATCH 0951/1777] QtSuppport: Remove some indirection Amends 93e188a. Change-Id: I49c503a31b033295b01c456533a740ad30f7b653 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/qtsupport/qtversionmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index aff50f086fa..b13e63703f8 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -155,7 +155,7 @@ void QtVersionManagerImpl::triggerQtVersionRestore() } // exists const QtVersions vs = versions(); - qtVersionManagerImpl().updateDocumentation(vs, {}, vs); + updateDocumentation(vs, {}, vs); } bool QtVersionManager::isLoaded() @@ -650,7 +650,7 @@ void QtVersionManagerImpl::setNewQtVersions(const QtVersions &newVersions) saveQtVersions(); if (!changedVersions.isEmpty() || !addedVersions.isEmpty() || !removedVersions.isEmpty()) - emit qtVersionManagerImpl().qtVersionsChanged(addedIds, removedIds, changedIds); + emit qtVersionsChanged(addedIds, removedIds, changedIds); } void QtVersionManager::setDocumentationSetting(const QtVersionManager::DocumentationSetting &setting) From 7730a329a3411474d635884887850993e87cf6a5 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 30 Aug 2023 22:56:53 +0200 Subject: [PATCH 0952/1777] TaskTree demo: Simplify task creation Fix workflow policy. Fix const correctness. Rename treeRoot into recipe. Change-Id: Ib0457691001dbb88135027f8c7a34ba671b0b082 Reviewed-by: hjk <hjk@qt.io> --- tests/manual/tasking/demo/main.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/tests/manual/tasking/demo/main.cpp b/tests/manual/tasking/demo/main.cpp index 6ca092d21c3..c48b894580f 100644 --- a/tests/manual/tasking/demo/main.cpp +++ b/tests/manual/tasking/demo/main.cpp @@ -163,24 +163,22 @@ int main(int argc, char *argv[]) std::unique_ptr<TaskTree> taskTree; - const auto createTask = [](TaskWidget *widget) -> GroupItem { - const auto setupTask = [](TaskWidget *widget) { - return [widget](milliseconds &taskObject) { - taskObject = milliseconds{widget->busyTime() * 1000}; - widget->setState(State::Running); - }; + const auto createTask = [](TaskWidget *widget) { + const milliseconds timeout{widget->busyTime() * 1000}; + const auto setupTask = [widget, timeout](milliseconds &taskObject) { + taskObject = timeout; + widget->setState(State::Running); }; const Group root { - widget->isSuccess() ? finishAllAndDone : finishAllAndError, - TimeoutTask(setupTask(widget)), + widget->isSuccess() ? stopOnError : finishAllAndError, + TimeoutTask(setupTask), onGroupDone([widget] { widget->setState(State::Done); }), onGroupError([widget] { widget->setState(State::Error); }) }; return root; }; - auto treeRoot = [&] { - + const auto recipe = [&] { const Group root { rootGroup->executeMode(), rootGroup->workflowPolicy(), @@ -232,21 +230,21 @@ int main(int argc, char *argv[]) // Non-task GUI handling - auto createTaskTree = [&] { - TaskTree *taskTree = new TaskTree(treeRoot()); + const auto createTaskTree = [&] { + TaskTree *taskTree = new TaskTree(recipe()); progressBar->setMaximum(taskTree->progressMaximum()); QObject::connect(taskTree, &TaskTree::progressValueChanged, progressBar, &QProgressBar::setValue); return taskTree; }; - auto stopTaskTree = [&] { + const auto stopTaskTree = [&] { if (taskTree) taskTree->stop(); // TODO: unlock GUI controls? }; - auto resetTaskTree = [&] { + const auto resetTaskTree = [&] { if (!taskTree) return; From 197a45b9b964c695983ad711c61f60f166742902 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 31 Aug 2023 18:31:34 +0200 Subject: [PATCH 0953/1777] TaskTree: Change the signature of storage handlers The handlers for TaskTree::onStorage{Setup,Done}(...) took a pointer to the storage struct. Take a reference instead. This is in line with tasks setup/done/error handlers. Change-Id: I8ff18c250f0fbbcd8210ec304e34232e842831fc Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/solutions/tasking/tasktree.h | 2 +- tests/auto/solutions/tasking/tst_tasking.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h index df26596d027..32252bcc83b 100644 --- a/src/libs/solutions/tasking/tasktree.h +++ b/src/libs/solutions/tasking/tasktree.h @@ -437,7 +437,7 @@ private: StorageVoidHandler wrapHandler(StorageHandler &&handler) { return [=](void *voidStruct) { StorageStruct *storageStruct = static_cast<StorageStruct *>(voidStruct); - std::invoke(handler, storageStruct); + std::invoke(handler, *storageStruct); }; } diff --git a/tests/auto/solutions/tasking/tst_tasking.cpp b/tests/auto/solutions/tasking/tst_tasking.cpp index e73589499f8..63302c6dc31 100644 --- a/tests/auto/solutions/tasking/tst_tasking.cpp +++ b/tests/auto/solutions/tasking/tst_tasking.cpp @@ -550,8 +550,8 @@ void tst_Tasking::testTree_data() }; taskTree.setRecipe(nestedRoot); CustomStorage *activeStorage = storage.activeStorage(); - auto collectSubLog = [activeStorage](CustomStorage *subTreeStorage){ - activeStorage->m_log += subTreeStorage->m_log; + const auto collectSubLog = [activeStorage](CustomStorage &subTreeStorage){ + activeStorage->m_log += subTreeStorage.m_log; }; taskTree.onStorageDone(storage, collectSubLog); }; @@ -2244,7 +2244,7 @@ void tst_Tasking::testTree() TaskTree taskTree({testData.root.withTimeout(1000ms)}); QCOMPARE(taskTree.taskCount() - 1, testData.taskCount); // -1 for the timeout task above Log actualLog; - const auto collectLog = [&actualLog](CustomStorage *storage) { actualLog = storage->m_log; }; + const auto collectLog = [&actualLog](CustomStorage &storage) { actualLog = storage.m_log; }; taskTree.onStorageDone(testData.storage, collectLog); const OnDone result = taskTree.runBlocking() ? OnDone::Success : OnDone::Failure; QCOMPARE(taskTree.isRunning(), false); @@ -2274,11 +2274,11 @@ void tst_Tasking::storageOperators() void tst_Tasking::storageDestructor() { bool setupCalled = false; - const auto setupHandler = [&setupCalled](CustomStorage *) { + const auto setupHandler = [&setupCalled](CustomStorage &) { setupCalled = true; }; bool doneCalled = false; - const auto doneHandler = [&doneCalled](CustomStorage *) { + const auto doneHandler = [&doneCalled](CustomStorage &) { doneCalled = true; }; QCOMPARE(CustomStorage::instanceCount(), 0); From be6b83ec4a4315246db44f89fcc38e04ef853c53 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 29 Aug 2023 08:54:04 +0200 Subject: [PATCH 0954/1777] Doc: Split up the "Adding Libraries to Projects" topic - Turn the topic into a how-to topic - Turn the example into a tutorial - Mark the information as qmake-specific - Add links to CMake information Task-number: QTCREATORBUG-29361 Change-Id: I42befbf15ad8a0eba7e26a0a69e6d1963d2ce5be Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../qtcreator-add-library-external.webp | Bin 0 -> 8458 bytes ...-add-library-internal-project-details.webp | Bin 0 -> 7204 bytes ...add-library-internal-project-location.webp | Bin 0 -> 6384 bytes .../qtcreator-add-library-internal.webp | Bin 0 -> 7108 bytes .../howto/creator-only/creator-how-tos.qdoc | 1 + .../creator-projects-creating.qdoc | 5 +- .../creator-projects-libraries.qdoc | 136 +++++++++++++----- doc/qtcreator/src/qtcreator-toc.qdoc | 2 +- .../user-interface/creator-projects-view.qdoc | 2 +- 9 files changed, 107 insertions(+), 39 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-add-library-external.webp create mode 100644 doc/qtcreator/images/qtcreator-add-library-internal-project-details.webp create mode 100644 doc/qtcreator/images/qtcreator-add-library-internal-project-location.webp create mode 100644 doc/qtcreator/images/qtcreator-add-library-internal.webp diff --git a/doc/qtcreator/images/qtcreator-add-library-external.webp b/doc/qtcreator/images/qtcreator-add-library-external.webp new file mode 100644 index 0000000000000000000000000000000000000000..faec05617900487e6276be10a254699a3511c836 GIT binary patch literal 8458 zcmWIYbaP`;WMBw)bqWXzu<-e&z`&p{?bO8Zwd>KgT$$+K`L(7`-^mIJD_GhbHqZKh zNptZ{xh<uUiatt(ac7<X1#`-+W|^;lRP~DM?F44C2df(vpL>{fyKbN5oGWGJ<!9n# z9M3Jt=0C74_x85j*|Yzx`1+qcc)ia~qieIQ($`$~+iz;T{nonZ+uMAf*KUyw-L|?X zL=&X6d|v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dY(y0vD!uJabQJOxmDYZ+YEkzTDAG+ma57D(v4Pw{2&D;-e{Yi<&;9 zRwnLL5(}BCzecq9=IZEB{aPQ@W6ka!6DB{qad2rB`|mJm(L<Z(E?s<3(4mzh-g)wy z(4I6C$B13i^rAmJd@Nu(v-kC`jbC^(FJ#CZ4(@F~%NwKMxGUxDr6&toU#>ow;l{k% zq2=s{S$tPpnx@5Q9jQA!qw8d!$`QG{i)LvysC4SHyD>B}r0a^=Onz}$d)wXqZL?G^ z>PR0C%}`UC^7Yu7w{k}_+=LsJ`mN9E7GL0h<)32r|8=X)r|q(5<bL<@!o;OZs!rTH z(0aK-S@nJCd6UyKQtt}wdQ_NTyk}Xp=|Y8t%WkbX*|((4V*U)b+OmmTzQvoZ+d226 z)T)%nMJp3No?HIz>e<)z%lxiBHY@JE@{%*+n$<z3cb!qO-}g8jjb7pue&hK1^?MzR zosKl6>4{d}?ERlN>rYL(z<D?J_dh@*c0bP5CR~(W=e_m!)3@e-ZMV48$t;%am7liC z)%1VgW1FzZt|ZG>r5<-DFfHx)=`XYUcutv}f6cvr`YwIWnn`);`DKq+WlFkkZ|~l* zp6$k&rMGII2l;AnNXRBhsjYW&dNa-URmd-aV_P%AWObD}H+q||%5*yMMZ&Q8Vo%!k z5T(n>XL-_|nJvH6lTq-yG|sg5+0Njy7vXcfwkO1Nr(L~hBqWfoclqrv&Gt*l{qq}Z zY<GyA?OC0wvY>30e{YQ1`bODDKEIxb&u3C*iqt+YwtZ2hm<@A`t}<gKc*u`$sqvB1 be|Y9ZmTH{+GktYx$lVV<SN}XeHn9Q#OlNAz literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-add-library-internal-project-details.webp b/doc/qtcreator/images/qtcreator-add-library-internal-project-details.webp new file mode 100644 index 0000000000000000000000000000000000000000..a53e07fc6cd1f7d0fa955be0f57a2b59ff6c752e GIT binary patch literal 7204 zcmWIYbaRuDVPFV%bqWXzu<+rRVPMc#Jlw+YmFuzDB$2J3`Ky0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tQRJ_?sgt?UqH_oWc_h4i^Js+UE3r;VfLkxul3u?VZWaB}Q98IYwP3uO&!v{cfKs z1L?VL(*?f#T6f3q;1`+1)mIifYJ9){&2PpfmbIJZ^t_)MocXnkZF<PL?2RjXw{X_~ z*(78){lu2v&m7+U-Jz2kbu;AsB#-O+-)~yoyXEBb$J6J$J!G}<>kN~1J4ypRI8Mm^ z{BmLb=AWxedrS9EIyV1(++)QZf3gp(GrOb~*CEDT@8gxi_c3Mv<Nq)3^>6n1&mH*F WV)v~RoF7x3|LT`E<MUX>zyJU}E61$> literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-add-library-internal-project-location.webp b/doc/qtcreator/images/qtcreator-add-library-internal-project-location.webp new file mode 100644 index 0000000000000000000000000000000000000000..1df0227675d347d78a63232f88193980ba9025d7 GIT binary patch literal 6384 zcmWIYbaQ(l!N3si>J$(bVBvE|f`LI_@o)=6T;LtENt<5of3r0CkINC36NfH2_g^^3 zeokeZ+|eJ8cFg-*{=|*%{kP3J7S?+&TDG4RQdqUKGyI&GDc|;)GR%KiPFMd5x+4B! z_O#EbtGHvWp3f;3+V=0^oUCtJb1tng6B4*#+r;75uwvSU8Ta(ou34+MUcpClirCr* z7kI6{i4@vAyP>6?W#hb2#P2#=<dn_->u<TeI+(qq^L>}!)x&puZ`!E-Uogitc;~B! zQd+NAS>}WuZ%e)=@Ksjk55HSlnw$5wZMMDA`o+4T5A=(rpFOdcjOH?SUn;x(n#J+e zMXx`G-A#R>eZgs8^P%_%BV*%T|F1+u^WQd`t{b>&Qc>oY*-uXVIwEjG-eS{MUH@;7 z-o1PGuCRRO2IeTS2O##Xpp7$B4*WO#+!7V7r7Ib>(A0VM(g$$|co`ZJKD*{f3-fQt zy}d2hS~AkNc42XTlN3WkQ-=7Y>ZT_k-NF-O*b*2Q=^bEj(fauI&%5gX6L;h;j$C^D z9dqOTiU$*<gTA@8z7DkcA9(lAz3ut?|NQ!zU;FEedi}p0(ti&2%kTg6?5zI2n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C2<j%Y!?!D>h{y9M=Q~#Kxt2cjDKK}Nk?%ZmV z+N4V!X<6Q(szLthq4N|r$%d3~Ir#ke0hz7arCYnMD$Xdn^mF-_8RsW*>)mz~lTKN9 zGw$i<Nl({n?00GPy0~Q8BBN>MQPD3hm`uNQ+Of?qcja0oaA0-ro~zU?Ea|0ry4+go z;GqC7y}qAWFHg#@Jo0MBLN5lnWX;9L|1j*larB$z?<Y+qJ0tEcysgeT<Mt)vvc}Bc zHUE<<gzWoUD}uZ~mQC+(on#!n>eqxFw=^$VOkB8Rlg;+Ua$9a&PxAc##x%Fm<mSW$ ziIr(9*8Iy`A=A(u+cs%aMEUhwe5ZKZ=SZHG<bJtJwk28jf0^Lqg_`wejru<QTb&W) zt$#OoMn~-0l+2zJ+fp(r-(|nvxA(5~@jEw#`|ER!HqPGtA!noC`!{QB{>6)L>;1X= z)ROYVA3Gj@+Nd9Qb+7ZyAfpT>Z~dIvI=QFy;;*`{5o2yo+aRL5f63SF?5b&5-cNJ( zXVo}<RV*``tP-g4Ka5p3detuhOR3IB9D=^5JA<Y_U$x+_-BtPBkNFffTo-mp)VRKC zL8`Z?{6P(K-`S~>-5(DLOsKE?CX;nDXluLtIU&c7=~>1#(Npu+AM7}!|MvaQIq%f2 mY+Bl-&plE8nov*CT!xjg<_l82?@sV3oA<vW@p03X{R{xpABAuL literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-add-library-internal.webp b/doc/qtcreator/images/qtcreator-add-library-internal.webp new file mode 100644 index 0000000000000000000000000000000000000000..65950290350d877bdba713cb7a70eaf49c93f34a GIT binary patch literal 7108 zcmWIYbaUGy&A<@u>J$(bVBxb~nt?%I+9{9WYS*J}xiXQz^XI;PDlaI^aPwZVyWjT) zZ^`!t^ORHLx2<@3QAhr#T`BA3#5~=}+4s&o*u@+<!$o-O)(~I!!;>m4m>2}|<|Rw- zwocQJn;>8EmO1D4w%ps>cD@YIUX^>hW9P=w?AzO3?&;sQ_*B`{iCRl@Z*O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25kLk(W z1+&d3@0vD|F?M-XY}#rYHs?jXzWXb6zi_8ay`xiASuDJUCHC}*h9voQ2U<0Ia~@W@ cZ4*+TZnEj*)CJj+t<r|U>VKa9@Q`2t054@{#{d8T literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 46ccaf46014..25ace3d413f 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -61,6 +61,7 @@ \list \li \l {Add a license header template for C++ code} + \li \l {Add libraries to projects} \li \l {Add subprojects to projects} \li \l {Create C++ classes} \li \l {Create files} diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index e887f220067..372eb9b45c1 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -69,8 +69,7 @@ install and configure some additional software on the devices to be able to \l{Connecting Devices}{connect} to them from the development PC. - \sa {Manage Projects}{How-to: Manage Projects}, - {Adding Libraries to Projects}, {Adding New Custom Wizards} + \sa {Manage Projects}{How-to: Manage Projects}, {Adding New Custom Wizards} */ /*! @@ -317,5 +316,5 @@ To specify dependencies, use the \uicontrol{Add Library} wizard. \sa {Creating Projects}, {Use project wizards}, - {Adding Libraries to Projects} + {Add libraries to projects} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc index 2bcc095b11c..840326fbdf3 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,19 +8,45 @@ // ********************************************************************** /*! - \previouspage creator-project-creating.html \page creator-project-qmake-libraries.html - \nextpage creator-project-wizards.html + \previouspage creator-how-tos.html - \title Adding Libraries to Projects + \ingroup creator-how-to-projects + + \title Add libraries to projects In addition to Qt libraries, you can add other libraries to your projects. - The process depends on the type and location of the - library. You can add a system library, your own library, or a 3rd party - library. The library can be located either in the build tree of the - current project or in another build tree. + The process depends on the type and location of the library: - \image qtcreator-add-library-wizard.png "Add Library wizard" + \list + \li A system library + \li Your own library + \li A 3rd party library + \endlist + + The library can be located either in the build tree of the current project or + in another build tree. + + \section1 CMake projects + + If you use CMake to build the project, use the \l qt_add_library command to + create a library and link against it in the CMakeLists.txt file, as + instructed in \l{Structuring projects}. + + \section1 qmake projects + + To add libraries to projects that you build with qmake: + + \list 1 + \li In the \l Projects view, right-click the project name to open the + context menu and select \uicontrol {Add Library}. + \image qtcreator-add-library-wizard.png {Add Library wizard} + \li Specify settings for the library. + \image qtcreator-add-library-external.webp {Adding an external library} + The settings depend on the library type. + \endlist + + \section1 Library settings Because system libraries do not typically change and are often found by default, you do not need to specify the path to the library or to its @@ -62,49 +88,88 @@ \QC supports code completion and syntax highlighting for the added libraries once your project successfully builds and links to them. - \section1 To Add Libraries - - \list 1 - - \li In the \uicontrol Projects view, right-click the project name to open the - context menu and select - \uicontrol {Add Library}. - - \li Follow the instructions of the wizard. - - \endlist - For more information about the project file settings, see \l{Declaring Other Libraries}. - \section1 Example of Adding Internal Libraries + \sa {Adding an Internal Library to a qmake Project}, + {Add subprojects to projects}, {Use project wizards}, {Creating Projects} +*/ - To add an internal library to your project: +/*! + \page creator-tutorial-adding-internal-libraries-to-projects.html + \previouspage creator-tutorials.html + \nextpage creator-project-managing.html + + \ingroup creator-tutorials + + \title Adding an Internal Library to a qmake Project + + \brief How to create your own library and link your application against it + when using qmake as the build system. + + You can add a library into a \e subdirs project. Use wizards to create the + project and the library and to link the library against the project. + + \note This tutorial only applies when you select qmake as the the build + system for the subdirs project. + + \section1 Creating a shared library + + To create a shared library: \list 1 \li Select \uicontrol File > \uicontrol {New Project} > - \uicontrol Library > \uicontrol {C++ Library}. + \uicontrol Library > \uicontrol {C++ Library}. If your top level + project is a subdirs project or contains one, you may add the library + to the project. However, this does not link other libraries from + your project against it. \li Select \uicontrol Choose to open the \uicontrol {Project Location} dialog. - \image qtcreator-add-library-wizard-ex-1.png "Project Location dialog" + \image qtcreator-add-library-internal-project-location.webp {Project Location dialog} \li In the \uicontrol Name field, give a name for the library. For example, - \b mylib. + \e MyLibrary. - \li Follow the instructions of the wizard until you get to the + \li Select \uicontrol Next (on Windows and Linux) or \uicontrol Continue + (on \macos) to open the \uicontrol {Define Build System} dialog. + + \li Select \uicontrol Next or \uicontrol Continue to use CMake as the + build system. + + The \uicontrol {Define Project Details} dialog opens. + + \image qtcreator-add-library-internal-project-details.webp {Define Project Details dialog} + + \li Select the library type and enter information about the classes for + which you want to generate source code files: class name, Qt module, + and source and header file names. + + \li Select \uicontrol Next or \uicontrol Continue until you get to the \uicontrol {Project Management} dialog. In the \uicontrol {Add as a subproject to project} - list, select a project. For example, \b myapp. + list, select a subdirs project. For example, \e MyApplication. + \endlist - \li In the \uicontrol Projects view, right-click the project name to open the - context menu and select - \uicontrol {Add Library} > \uicontrol {Internal Library} > - \uicontrol Next. + \section1 Linking an application to the library - \li In the \uicontrol Library field, select \b mylib, and then select + To link a project to the shared library: + + \list 1 + + \li In the \l Projects view, right-click the project name to open + the context menu and select \uicontrol {Add Library} > + \uicontrol {Internal Library} > \uicontrol Next. + + The wizard instructs the build system to link an existing application + project or a library project against the selected library. Here, you + add the library that you created above. + + \image qtcreator-add-library-internal.webp {Adding an internal library} + + \li In the \uicontrol Library field, select \e mylibrary, and then select \uicontrol Next. \li Select \uicontrol Finish to add the library declaration to the @@ -116,7 +181,7 @@ CMakeLists.txt file: \badcode - target_link_libraries(myapp PRIVATE mylib) + target_link_libraries(myapplication PRIVATE mylibrary) \endcode When using qmake, the following library declaration is added to the .pro @@ -132,4 +197,7 @@ else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/debug/mylib.lib else:unix: PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/libmylib.a \endcode + + \sa {Add libraries to projects}, {Add subprojects to projects}, + {Select the build system}, {Use project wizards}, {Creating Projects} */ diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 7d71c101e51..c470627884d 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -25,7 +25,6 @@ \list \li \l{Creating Projects} \list - \li \l{Adding Libraries to Projects} \li \l{Adding New Custom Wizards} \endlist \li \l{Using Version Control Systems} @@ -275,6 +274,7 @@ \li Manage Projects \list \li \l {Add a license header template for C++ code} + \li \l {Add libraries to projects} \li \l {Add subprojects to projects} \li \l {Create C++ classes} \li \l {Create files} diff --git a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc index 905c4ebe779..9c811bd2799 100644 --- a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc @@ -85,7 +85,7 @@ {generic projects}. \li Add existing files and directories. \li Add libraries. For more information, see - \l{Adding Libraries to Projects}. + \l{Add libraries to projects}. \li Add and remove subprojects. \li Find unused functions. \endif From 53718bcf1d700c89b553b521a9ed63d8a14ab56a Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Wed, 30 Aug 2023 14:41:33 +0200 Subject: [PATCH 0955/1777] DAP: Add locals lazy loading Change-Id: I49c6d9fce8c6f45f1ec4cb3b6c1733d93202bc0f Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/debugger/dap/cmakedapengine.cpp | 6 +++- src/plugins/debugger/dap/dapengine.cpp | 32 ++++++++++----------- src/plugins/debugger/dap/dapengine.h | 1 - src/plugins/debugger/dap/gdbdapengine.cpp | 6 +++- src/plugins/debugger/dap/pydapengine.cpp | 8 ++++-- src/plugins/debugger/watchdata.h | 1 + 6 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp index fb9a459dc75..1a243bfa771 100644 --- a/src/plugins/debugger/dap/cmakedapengine.cpp +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -47,7 +47,11 @@ public: void start() override { m_socket.connectToServer(m_socketName, QIODevice::ReadWrite); } bool isRunning() const override { return m_socket.isOpen(); } - void writeRaw(const QByteArray &data) override { m_socket.write(data); } + void writeRaw(const QByteArray &data) override + { + if (m_socket.isOpen()) + m_socket.write(data); + } void kill() override { if (m_socket.isOpen()) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 7209aecf60c..b80c58765be 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -413,8 +413,9 @@ void DapEngine::assignValueInDebugger(WatchItem *, const QString &/*expression*/ void DapEngine::updateItem(const QString &iname) { - Q_UNUSED(iname) - updateAll(); + WatchItem *item = watchHandler()->findItem(iname); + m_currentWatchItem = item; + m_dapClient->variables(item->variablesReference); } QString DapEngine::errorMessage(QProcess::ProcessError error) const @@ -554,6 +555,9 @@ void DapEngine::handleScopesResponse(const QJsonObject &response) if (name == "Locals") { // Fix for several scopes watchHandler()->removeAllData(); watchHandler()->notifyUpdateStarted(); + + m_watchItems.clear(); + watchHandler()->cleanup(); m_dapClient->variables(variablesReference); } } @@ -707,31 +711,25 @@ void DapEngine::refreshLocals(const QJsonArray &variables) item->address = variable.toObject().value("address").toInt(); item->type = variable.toObject().value("type").toString(); + const int variablesReference = variable.toObject().value("variablesReference").toInt(); + item->variablesReference = variablesReference; + if (variablesReference > 0) + item->wantsChildren = true; + qCDebug(dapEngineLog) << "variable" << name << item->hexAddress(); if (isFirstLayer) m_watchItems.append(item); else m_currentWatchItem->appendChild(item); - - const int variablesReference = variable.toObject().value("variablesReference").toInt(); - if (variablesReference > 0) - m_variablesReferenceQueue.push({variablesReference, item}); } - if (m_variablesReferenceQueue.empty()) { + if (isFirstLayer) { for (auto item : m_watchItems) watchHandler()->insertItem(item); - m_watchItems.clear(); + } else + watchHandler()->updateWatchExpression(m_currentWatchItem, ""); - watchHandler()->notifyUpdateFinished(); - return; - } - - const auto front = m_variablesReferenceQueue.front(); - m_variablesReferenceQueue.pop(); - - m_dapClient->variables(front.first); - m_currentWatchItem = front.second; + watchHandler()->notifyUpdateFinished(); } void DapEngine::refreshStack(const QJsonArray &stackFrames) diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 8463f508f6b..1f5525bc947 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -113,7 +113,6 @@ protected: int m_nextBreakpointId = 1; int m_currentThreadId = -1; - std::queue<std::pair<int, WatchItem *>> m_variablesReferenceQueue; WatchItem *m_currentWatchItem = nullptr; QList<WatchItem *> m_watchItems; }; diff --git a/src/plugins/debugger/dap/gdbdapengine.cpp b/src/plugins/debugger/dap/gdbdapengine.cpp index fa4ae14bd13..e4334c9e39a 100644 --- a/src/plugins/debugger/dap/gdbdapengine.cpp +++ b/src/plugins/debugger/dap/gdbdapengine.cpp @@ -63,7 +63,11 @@ public: } bool isRunning() const override { return m_proc.isRunning(); } - void writeRaw(const QByteArray &data) override { m_proc.writeRaw(data); } + void writeRaw(const QByteArray &data) override + { + if (m_proc.state() == QProcess::Running) + m_proc.writeRaw(data); + } void kill() override { m_proc.kill(); } QByteArray readAllStandardOutput() override { return m_proc.readAllStandardOutput().toUtf8(); } QString readAllStandardError() override { return m_proc.readAllStandardError(); } diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index bf5791ab5ae..2a263644c24 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -78,7 +78,11 @@ public: } bool isRunning() const override { return m_socket.isOpen(); } - void writeRaw(const QByteArray &data) override { m_socket.write(data); } + void writeRaw(const QByteArray &data) override + { + if (m_socket.isOpen()) + m_socket.write(data); + } void kill() override { m_timer->stop(); @@ -100,7 +104,7 @@ public: QProcess::ExitStatus exitStatus() const override { return QProcess::NormalExit; } QProcess::ProcessError error() const override { return QProcess::UnknownError; } Utils::ProcessResult result() const override { return ProcessResult::FinishedWithSuccess; } - QString exitMessage() const override { return QString(); }; + QString exitMessage() const override { return QString(); } private: Utils::Process m_proc; diff --git a/src/plugins/debugger/watchdata.h b/src/plugins/debugger/watchdata.h index 42d046f2a13..bb2e458bcd3 100644 --- a/src/plugins/debugger/watchdata.h +++ b/src/plugins/debugger/watchdata.h @@ -71,6 +71,7 @@ public: uint bitpos = 0; // Position within bit fields uint bitsize = 0; // Size in case of bit fields uint autoDerefCount = 0; // number of levels of automatic dereferencing that has taken place (for pointer types) + uint variablesReference = 0;// reference to the variable in the variables request DAP related int elided = 0; // Full size if value was cut off, -1 if cut on unknown size, 0 otherwise int arrayIndex = -1; // -1 if not an array member uchar sortGroup = 0; // 0 - ordinary member, 1 - vptr, 2 - base class From 3d028125df796ccb4b172933f6e9f930990a2659 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 07:55:01 +0200 Subject: [PATCH 0956/1777] QtSupport: Don't rely on QObject parents on late destruction Change-Id: Ibdb91c80d4932a5f0dced9843dfd01641577a88d Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/qtsupport/qtsupportplugin.cpp | 6 ++++++ src/plugins/qtsupport/qtsupportplugin.h | 1 + src/plugins/qtsupport/qtversionmanager.cpp | 10 +++++++++- src/plugins/qtsupport/qtversionmanager.h | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index 235fccf7a1a..090b71c7512 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -135,6 +135,12 @@ void QtSupportPlugin::initialize() QtVersionManager::initialized(); } +ExtensionSystem::IPlugin::ShutdownFlag QtSupportPlugin::aboutToShutdown() +{ + QtVersionManager::shutdown(); + return SynchronousShutdown; +} + const char kLinkWithQtInstallationSetting[] = "LinkWithQtInstallation"; static void askAboutQtInstallation() diff --git a/src/plugins/qtsupport/qtsupportplugin.h b/src/plugins/qtsupport/qtsupportplugin.h index 7e4c98a9aa0..abd4c7fed37 100644 --- a/src/plugins/qtsupport/qtsupportplugin.h +++ b/src/plugins/qtsupport/qtsupportplugin.h @@ -19,6 +19,7 @@ public: private: void initialize() final; void extensionsInitialized() final; + ShutdownFlag aboutToShutdown() final; class QtSupportPluginPrivate *d = nullptr; diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index b13e63703f8..7fca7df3655 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -92,9 +92,12 @@ public: this, &QtVersionManagerImpl::triggerQtVersionRestore); } - ~QtVersionManagerImpl() + void shutdown() { delete m_writer; + m_writer = nullptr; + delete m_configFileWatcher; + m_configFileWatcher = nullptr; qDeleteAll(m_versions); m_versions.clear(); } @@ -174,6 +177,11 @@ void QtVersionManager::initialized() qtVersionManagerImpl(); } +void QtVersionManager::shutdown() +{ + qtVersionManagerImpl().shutdown(); +} + bool QtVersionManagerImpl::restoreQtVersions() { QTC_ASSERT(!m_writer, return false); diff --git a/src/plugins/qtsupport/qtversionmanager.h b/src/plugins/qtsupport/qtversionmanager.h index 97f8e6d537f..23d73a44155 100644 --- a/src/plugins/qtsupport/qtversionmanager.h +++ b/src/plugins/qtsupport/qtversionmanager.h @@ -45,6 +45,8 @@ public: const QString &manifestPath, const QString &examplesPath); + static void shutdown(); + signals: // content of QtVersion objects with qmake path might have changed void qtVersionsChanged(const QList<int> &addedIds, const QList<int> &removedIds, const QList<int> &changedIds); From 9679412a2309dff3848f107737b0b445d0cee620 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 11:23:56 +0200 Subject: [PATCH 0957/1777] Replace QFile::exists by QFileInfo::exists QFile::exists only calls QFileInfo::exists, so this saves one function call per invocation. Change-Id: I41cb407345654eeead14455a4955b8b9b015aedc Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/extensionsystem/pluginmanager.cpp | 2 +- src/libs/qmleditorwidgets/contextpanewidgetimage.cpp | 2 +- src/libs/utils/mimetypes2/mimeprovider.cpp | 2 +- src/libs/utils/savefile.cpp | 4 ++-- src/libs/utils/stylehelper.cpp | 4 ++-- src/plugins/android/androidsdkdownloader.cpp | 4 ++-- src/plugins/clearcase/clearcaseplugin.cpp | 2 +- .../compilationdatabaseproject.cpp | 2 +- src/plugins/compilerexplorer/compilerexplorersettings.cpp | 2 +- src/plugins/coreplugin/editormanager/editorview.cpp | 2 +- src/plugins/coreplugin/generalsettings.cpp | 2 +- src/plugins/coreplugin/mimetypesettings.cpp | 2 +- src/plugins/coreplugin/plugininstallwizard.cpp | 2 +- src/plugins/cppeditor/compileroptionsbuilder.cpp | 2 +- src/plugins/debugger/procinterrupt.cpp | 2 +- src/plugins/designer/formeditor.cpp | 2 +- src/plugins/git/gitclient.cpp | 2 +- src/plugins/macros/macromanager.cpp | 2 +- src/plugins/mesonprojectmanager/mesonwrapper.h | 2 +- .../devicesupport/desktopprocesssignaloperation.cpp | 2 +- src/plugins/projectexplorer/msvctoolchain.cpp | 4 ++-- src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp | 2 +- .../components/assetslibrary/assetslibrarymodel.cpp | 2 +- .../componentcore/modelnodecontextmenu_helper.cpp | 2 +- .../contentlibrary/contentlibrarymaterialsmodel.cpp | 2 +- .../qmlprofiler/tests/localqmlprofilerrunner_test.cpp | 2 +- src/plugins/qtsupport/qtoptionspage.cpp | 6 +++--- src/plugins/resourceeditor/qrceditor/qrceditor.cpp | 2 +- src/plugins/resourceeditor/qrceditor/resourcefile.cpp | 6 +++--- src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp | 2 +- src/plugins/valgrind/memchecktool.cpp | 4 ++-- src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp | 2 +- src/plugins/vcsbase/vcsbaseeditor.cpp | 2 +- src/shared/proparser/qmakeglobals.cpp | 2 +- src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp | 2 +- src/tools/cplusplus-shared/utils.cpp | 4 ++-- .../cplusplus-update-frontend/cplusplus-update-frontend.cpp | 4 ++-- src/tools/qml2puppet/qml2puppet/qmlpuppet.cpp | 4 ++-- src/tools/sdktool/sdkpersistentsettings.cpp | 4 ++-- tests/auto/debugger/tst_dumpers.cpp | 2 +- 40 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index b4b8b9f245e..6d56fdb2dc3 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -1475,7 +1475,7 @@ public: static std::optional<QString> lockedPluginName(PluginManagerPrivate *pm) { const QString lockFilePath = LockFile::filePath(pm); - if (QFile::exists(lockFilePath)) { + if (QFileInfo::exists(lockFilePath)) { QFile f(lockFilePath); if (f.open(QIODevice::ReadOnly)) { const auto pluginName = QString::fromUtf8(f.readLine()).trimmed(); diff --git a/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp b/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp index 38805264f93..f188d6aa40a 100644 --- a/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp +++ b/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp @@ -259,7 +259,7 @@ void ContextPaneWidgetImage::setProperties(QmlJS::PropertyReader *propertyReader if (propertyReader->hasProperty(QLatin1String("source"))) { QString source = propertyReader->readProperty(QLatin1String("source")).toString(); m_fileWidget->setFileName(source); - if (QFile::exists(m_path + QLatin1Char('/') + source)) + if (QFileInfo::exists(m_path + QLatin1Char('/') + source)) setPixmap(m_path + QLatin1Char('/') + source); else setPixmap(source); diff --git a/src/libs/utils/mimetypes2/mimeprovider.cpp b/src/libs/utils/mimetypes2/mimeprovider.cpp index c20e367517f..682cbb7e8a5 100644 --- a/src/libs/utils/mimetypes2/mimeprovider.cpp +++ b/src/libs/utils/mimetypes2/mimeprovider.cpp @@ -505,7 +505,7 @@ bool MimeBinaryProvider::loadMimeTypePrivate(MimeTypePrivate &data) // shared-mime-info since 1.3 lowercases the xml files QString mimeFile = m_directory + QLatin1Char('/') + data.name.toLower() + QLatin1String(".xml"); - if (!QFile::exists(mimeFile)) + if (!QFileInfo::exists(mimeFile)) mimeFile = m_directory + QLatin1Char('/') + data.name + QLatin1String(".xml"); // pre-1.3 QFile qfile(mimeFile); diff --git a/src/libs/utils/savefile.cpp b/src/libs/utils/savefile.cpp index 4cf579ac0b9..a9d0cca3a40 100644 --- a/src/libs/utils/savefile.cpp +++ b/src/libs/utils/savefile.cpp @@ -111,7 +111,7 @@ bool SaveFile::commit() if (!result) { DWORD replaceErrorCode = GetLastError(); QString errorStr; - if (!QFile::exists(finalFileName)) { + if (!QFileInfo::exists(finalFileName)) { // Replace failed because finalFileName does not exist, try rename. if (!(result = rename(finalFileName))) errorStr = errorString(); @@ -148,7 +148,7 @@ bool SaveFile::commit() // Back up current file. // If it's opened by another application, the lock follows the move. - if (QFile::exists(finalFileName)) { + if (QFileInfo::exists(finalFileName)) { // Kill old backup. Might be useful if creator crashed before removing backup. QFile::remove(backupName); QFile finalFile(finalFileName); diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp index cc860e715a9..2f205da9359 100644 --- a/src/libs/utils/stylehelper.cpp +++ b/src/libs/utils/stylehelper.cpp @@ -847,7 +847,7 @@ QString StyleHelper::dpiSpecificImageFile(const QString &fileName) if (qApp->devicePixelRatio() > 1.0) { const QString atDprfileName = imageFileWithResolution(fileName, qRound(qApp->devicePixelRatio())); - if (QFile::exists(atDprfileName)) + if (QFileInfo::exists(atDprfileName)) return atDprfileName; } return fileName; @@ -867,7 +867,7 @@ QList<int> StyleHelper::availableImageResolutions(const QString &fileName) QList<int> result; const int maxResolutions = qApp->devicePixelRatio(); for (int i = 1; i <= maxResolutions; ++i) - if (QFile::exists(imageFileWithResolution(fileName, i))) + if (QFileInfo::exists(imageFileWithResolution(fileName, i))) result.append(i); return result; } diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp index ececc547481..13348492e73 100644 --- a/src/plugins/android/androidsdkdownloader.cpp +++ b/src/plugins/android/androidsdkdownloader.cpp @@ -48,10 +48,10 @@ static FilePath sdkFromUrl(const QUrl &url) if (basename.isEmpty()) basename = "sdk-tools.zip"; - if (QFile::exists(basename)) { + if (QFileInfo::exists(basename)) { int i = 0; basename += '.'; - while (QFile::exists(basename + QString::number(i))) + while (QFileInfo::exists(basename + QString::number(i))) ++i; basename += QString::number(i); } diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp index 943ffa194a4..cfbc5a1f4c0 100644 --- a/src/plugins/clearcase/clearcaseplugin.cpp +++ b/src/plugins/clearcase/clearcaseplugin.cpp @@ -828,7 +828,7 @@ QStringList ClearCasePluginPrivate::ccGetActiveVobs() const // Snapshot views does not necessarily have all active VOBs loaded, so we'll have to // check if the dirs exists as well. Else the command will work, but the output will // complain about the element not being loaded. - if (QFile::exists(prefix + relativeDir)) + if (QFileInfo::exists(prefix + relativeDir)) res.append(relativeDir); } return res; diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp index 37c0d29d8d6..2ca95d6ecb7 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp @@ -391,7 +391,7 @@ void CompilationDatabaseBuildSystem::buildTreeAndProjectParts() root->addNode(std::make_unique<FileNode>(projectFilePath(), FileType::Project)); - if (QFile::exists(dbContents.extraFileName)) + if (QFileInfo::exists(dbContents.extraFileName)) root->addNode(std::make_unique<FileNode>(Utils::FilePath::fromString(dbContents.extraFileName), FileType::Project)); diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp index 0837afb6e11..175d2c29825 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.cpp +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -228,7 +228,7 @@ void SourceSettings::fillLanguageIdModel(StringSelectionAspect::ResultCallback c auto *newItem = new QStandardItem(language.name); newItem->setData(language.id); - if (QFile::exists(":/compilerexplorer/logos/" + language.logoUrl)) { + if (QFileInfo::exists(":/compilerexplorer/logos/" + language.logoUrl)) { QIcon icon(":/compilerexplorer/logos/" + language.logoUrl); newItem->setIcon(icon); } diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 84297254919..c922dae9515 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -957,7 +957,7 @@ void SplitterOrView::restoreState(const QByteArray &state) stream >> historyData; view()->m_editorHistory = loadHistory(historyData); - if (!QFile::exists(fileName)) + if (!QFileInfo::exists(fileName)) return; IEditor *e = EditorManagerPrivate::openEditor(view(), FilePath::fromString(fileName), Id::fromString(id), EditorManager::IgnoreNavigationHistory diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 4cc865de8ea..f0d2046a32f 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -174,7 +174,7 @@ static bool hasQmFilesForLocale(const QString &locale, const QString &creatorTrP static const QString qtTrPath = QLibraryInfo::path(QLibraryInfo::TranslationsPath); const QString trFile = QLatin1String("/qt_") + locale + QLatin1String(".qm"); - return QFile::exists(qtTrPath + trFile) || QFile::exists(creatorTrPath + trFile); + return QFileInfo::exists(qtTrPath + trFile) || QFileInfo::exists(creatorTrPath + trFile); } void GeneralSettingsWidget::fillLanguageBox() const diff --git a/src/plugins/coreplugin/mimetypesettings.cpp b/src/plugins/coreplugin/mimetypesettings.cpp index 347ece7fcec..814dd7be20f 100644 --- a/src/plugins/coreplugin/mimetypesettings.cpp +++ b/src/plugins/coreplugin/mimetypesettings.cpp @@ -633,7 +633,7 @@ void MimeTypeSettingsPrivate::writeUserModifiedMimeTypes() { static Utils::FilePath modifiedMimeTypesFile = ICore::userResourcePath(kModifiedMimeTypesFile); - if (QFile::exists(modifiedMimeTypesFile.toString()) + if (QFileInfo::exists(modifiedMimeTypesFile.toString()) || QDir().mkpath(modifiedMimeTypesFile.parentDir().toString())) { QFile file(modifiedMimeTypesFile.toString()); if (file.open(QFile::WriteOnly | QFile::Truncate)) { diff --git a/src/plugins/coreplugin/plugininstallwizard.cpp b/src/plugins/coreplugin/plugininstallwizard.cpp index d58e02e7518..85f2f3effef 100644 --- a/src/plugins/coreplugin/plugininstallwizard.cpp +++ b/src/plugins/coreplugin/plugininstallwizard.cpp @@ -109,7 +109,7 @@ public: bool isComplete() const final { const FilePath path = m_data->sourcePath; - if (!QFile::exists(path.toString())) { + if (!QFileInfo::exists(path.toString())) { m_info->setText(Tr::tr("File does not exist.")); return false; } diff --git a/src/plugins/cppeditor/compileroptionsbuilder.cpp b/src/plugins/cppeditor/compileroptionsbuilder.cpp index 317cf7b25dd..8376f7d1acc 100644 --- a/src/plugins/cppeditor/compileroptionsbuilder.cpp +++ b/src/plugins/cppeditor/compileroptionsbuilder.cpp @@ -376,7 +376,7 @@ void CompilerOptionsBuilder::addHeaderPathOptions() void CompilerOptionsBuilder::addIncludeFile(const QString &file) { - if (QFile::exists(file)) { + if (QFileInfo::exists(file)) { add({isClStyle() ? QLatin1String(includeFileOptionCl) : QLatin1String(includeFileOptionGcc), QDir::toNativeSeparators(file)}); diff --git a/src/plugins/debugger/procinterrupt.cpp b/src/plugins/debugger/procinterrupt.cpp index 65d49055cb5..113fbeefc4f 100644 --- a/src/plugins/debugger/procinterrupt.cpp +++ b/src/plugins/debugger/procinterrupt.cpp @@ -120,7 +120,7 @@ GDB 32bit | Api | Api | NA | Win32 const QString executable = breakApi == UseWin32Interrupt ? QCoreApplication::applicationDirPath() + "/win32interrupt.exe" : QCoreApplication::applicationDirPath() + "/win64interrupt.exe"; - if (!QFile::exists(executable)) { + if (!QFileInfo::exists(executable)) { *errorMessage = QString::fromLatin1( "%1 does not exist. If you have built %2 " "on your own, checkout " diff --git a/src/plugins/designer/formeditor.cpp b/src/plugins/designer/formeditor.cpp index 436a8ca765f..090f01cf6ef 100644 --- a/src/plugins/designer/formeditor.cpp +++ b/src/plugins/designer/formeditor.cpp @@ -916,7 +916,7 @@ void setQtPluginPath(const QString &qtPluginPath) *sQtPluginPath = Utils::trimBack(*sQtPluginPath, '/'); if (sQtPluginPath->endsWith(postfix)) sQtPluginPath->chop(postfix.size()); - if (!QFile::exists(*sQtPluginPath + postfix)) { + if (!QFileInfo::exists(*sQtPluginPath + postfix)) { qWarning() << qPrintable( QLatin1String( "Warning: The path \"%1\" passed to -designer-qt-pluginpath does not exist. " diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index be00253d826..ad6c667428f 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -2529,7 +2529,7 @@ FilePath GitClient::gitBinDirectory() const // Git for Windows uses Git/usr/bin. Prefer that if it exists. QString usrBinPath = path; usrBinPath.replace(usrBinPath.size() - 3, 3, "usr/bin"); - if (QFile::exists(usrBinPath)) + if (QFileInfo::exists(usrBinPath)) path = usrBinPath; } } diff --git a/src/plugins/macros/macromanager.cpp b/src/plugins/macros/macromanager.cpp index 507ed92179d..a5e01155893 100644 --- a/src/plugins/macros/macromanager.cpp +++ b/src/plugins/macros/macromanager.cpp @@ -372,7 +372,7 @@ void MacroManager::saveLastMacro() QString MacroManager::macrosDirectory() { const QString path = Core::ICore::userResourcePath("macros").toString(); - if (QFile::exists(path) || QDir().mkpath(path)) + if (QFileInfo::exists(path) || QDir().mkpath(path)) return path; return QString(); } diff --git a/src/plugins/mesonprojectmanager/mesonwrapper.h b/src/plugins/mesonprojectmanager/mesonwrapper.h index 4312a63c34e..7cf194a2736 100644 --- a/src/plugins/mesonprojectmanager/mesonwrapper.h +++ b/src/plugins/mesonprojectmanager/mesonwrapper.h @@ -24,7 +24,7 @@ namespace Internal { template<typename File_t> bool containsFiles(const QString &path, const File_t &file) { - return QFile::exists(QString("%1/%2").arg(path).arg(file)); + return QFileInfo::exists(QString("%1/%2").arg(path).arg(file)); } template<typename File_t, typename... T> diff --git a/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp b/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp index 023dddb3375..70412124462 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp @@ -163,7 +163,7 @@ GDB 32bit | Api | Api | N/A | Win32 executable += si == Win32Interrupt ? QLatin1String("/win32interrupt.exe") : QLatin1String("/win64interrupt.exe"); - if (!QFile::exists(executable)) { + if (!QFileInfo::exists(executable)) { appendMsgCannotInterrupt(pid, Tr::tr("%1 does not exist. If you built %2 " "yourself, check out https://code.qt.io/cgit/" diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index d90f7d3d985..c6f435a9f4f 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -1210,8 +1210,8 @@ void MsvcToolChain::rescanForCompiler() env.searchInPath(QLatin1String("cl.exe"), {}, [](const Utils::FilePath &name) { QDir dir(QDir::cleanPath(name.toFileInfo().absolutePath() + QStringLiteral("/.."))); do { - if (QFile::exists(dir.absoluteFilePath(QStringLiteral("vcvarsall.bat"))) - || QFile::exists(dir.absolutePath() + "/Auxiliary/Build/vcvarsall.bat")) + if (QFileInfo::exists(dir.absoluteFilePath(QStringLiteral("vcvarsall.bat"))) + || QFileInfo::exists(dir.absolutePath() + "/Auxiliary/Build/vcvarsall.bat")) return true; } while (dir.cdUp() && !dir.isRoot()); return false; diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp index f3e234b02d8..8a18d238017 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp @@ -1917,7 +1917,7 @@ FilePaths QmakeProFile::subDirsPaths(QtSupport::ProFileReader *reader, else realFile = realDir; - if (QFile::exists(realFile)) { + if (QFileInfo::exists(realFile)) { realFile = QDir::cleanPath(realFile); subProjectPaths << FilePath::fromString(realFile); if (subProjectsNotToDeploy && !subProjectsNotToDeploy->contains(realFile) diff --git a/src/plugins/qmldesigner/components/assetslibrary/assetslibrarymodel.cpp b/src/plugins/qmldesigner/components/assetslibrary/assetslibrarymodel.cpp index 71cde5f0ba8..1d6fc0dd77d 100644 --- a/src/plugins/qmldesigner/components/assetslibrary/assetslibrarymodel.cpp +++ b/src/plugins/qmldesigner/components/assetslibrary/assetslibrarymodel.cpp @@ -115,7 +115,7 @@ void AssetsLibraryModel::deleteFiles(const QStringList &filePaths, bool dontAskA QmlDesignerPlugin::settings().insert(DesignerSettingsKey::ASK_BEFORE_DELETING_ASSET, false); for (const QString &filePath : filePaths) { - if (QFile::exists(filePath) && !QFile::remove(filePath)) { + if (QFileInfo::exists(filePath) && !QFile::remove(filePath)) { QMessageBox::warning(Core::ICore::dialogParent(), tr("Failed to Delete File"), tr("Could not delete \"%1\".").arg(filePath)); diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp index 75976fd7210..4a119d88a53 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp @@ -86,7 +86,7 @@ bool fileComponentExists(const ModelNode &modelNode) if (fileName.contains("qml/QtQuick")) return false; - return QFile::exists(fileName); + return QFileInfo::exists(fileName); } bool selectionIsComponent(const SelectionContext &selectionState) diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp index e5ee371002e..f8e284d7bea 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp @@ -291,7 +291,7 @@ void ContentLibraryMaterialsModel::loadMaterialBundle(const QDir &matBundleDir) for (const QString &s : std::as_const(sharedFiles)) { const QString fullSharedFilePath = matBundleDir.filePath(s); - if (!QFile::exists(fullSharedFilePath)) + if (!QFileInfo::exists(fullSharedFilePath)) missingSharedFiles.push_back(s); } diff --git a/src/plugins/qmlprofiler/tests/localqmlprofilerrunner_test.cpp b/src/plugins/qmlprofiler/tests/localqmlprofilerrunner_test.cpp index 33c0eb7388d..7799c960289 100644 --- a/src/plugins/qmlprofiler/tests/localqmlprofilerrunner_test.cpp +++ b/src/plugins/qmlprofiler/tests/localqmlprofilerrunner_test.cpp @@ -165,7 +165,7 @@ void LocalQmlProfilerRunnerTest::testFindFreeSocket() QUrl serverUrl = Utils::urlFromLocalSocket(); QString socket = serverUrl.path(); QVERIFY(!socket.isEmpty()); - QVERIFY(!QFile::exists(socket)); + QVERIFY(!QFileInfo::exists(socket)); QFile file(socket); QVERIFY(file.open(QIODevice::WriteOnly)); file.close(); diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index bd41cfd068d..a139d853fed 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -822,7 +822,7 @@ static QString qtVersionsFile(const QString &baseDir) static std::optional<FilePath> currentlyLinkedQtDir(bool *hasInstallSettings) { const QString installSettingsFilePath = settingsFile(Core::ICore::resourcePath().toString()); - const bool installSettingsExist = QFile::exists(installSettingsFilePath); + const bool installSettingsExist = QFileInfo::exists(installSettingsFilePath); if (hasInstallSettings) *hasInstallSettings = installSettingsExist; if (installSettingsExist) { @@ -934,8 +934,8 @@ static std::optional<FilePath> settingsDirForQtDir(const FilePath &baseDirectory return qtDir / dir; }); const FilePath validDir = Utils::findOrDefault(dirsToCheck, [baseDirectory](const FilePath &dir) { - return QFile::exists(settingsFile(baseDirectory.resolvePath(dir).toString())) - || QFile::exists(qtVersionsFile(baseDirectory.resolvePath(dir).toString())); + return QFileInfo::exists(settingsFile(baseDirectory.resolvePath(dir).toString())) + || QFileInfo::exists(qtVersionsFile(baseDirectory.resolvePath(dir).toString())); }); if (!validDir.isEmpty()) return validDir; diff --git a/src/plugins/resourceeditor/qrceditor/qrceditor.cpp b/src/plugins/resourceeditor/qrceditor/qrceditor.cpp index e08f52340fd..4340fc6123d 100644 --- a/src/plugins/resourceeditor/qrceditor/qrceditor.cpp +++ b/src/plugins/resourceeditor/qrceditor/qrceditor.cpp @@ -229,7 +229,7 @@ QString ResolveLocationContext::execCopyFileDialog(QWidget *parent, const QDir & // Helper to copy a file with message boxes static inline bool copyFile(const QString &file, const QString ©Name, QWidget *parent) { - if (QFile::exists(copyName)) { + if (QFileInfo::exists(copyName)) { if (!QFile::remove(copyName)) { QMessageBox::critical(parent, Tr::tr("Overwriting Failed"), Tr::tr("Could not overwrite file %1.") diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index 8d8d6dc9f2b..ef1c077ca9b 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -50,7 +50,7 @@ void File::checkExistence() bool File::exists() { if (!m_checked) { - m_exists = QFile::exists(name); + m_exists = QFileInfo::exists(name); m_checked = true; } @@ -363,7 +363,7 @@ bool ResourceFile::renameFile(const QString &fileName, const QString &newFileNam } if (success) { - const bool exists = QFile::exists(newFileName); + const bool exists = QFileInfo::exists(newFileName); for (File *file : std::as_const(entries)) { file->name = newFileName; file->setExists(exists); @@ -1230,7 +1230,7 @@ EntryBackup * RelativeResourceModel::removeEntry(const QModelIndex &index) } else { const QString fileNameBackup = file(index); const QString aliasBackup = alias(index); - if (!QFile::exists(fileNameBackup)) { + if (!QFileInfo::exists(fileNameBackup)) { deleteItem(index); return new FileEntryBackup(*this, prefixIndex.row(), index.row(), fileNameBackup, aliasBackup); } diff --git a/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp b/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp index 4ee7ebc6197..a2beac1167b 100644 --- a/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp +++ b/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp @@ -349,7 +349,7 @@ bool ScxmlDocument::pasteData(const QByteArray &data, const QPointF &minPos, con void ScxmlDocument::load(const QString &fileName) { - if (QFile::exists(fileName)) { + if (QFileInfo::exists(fileName)) { QFile file(fileName); if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { if (load(&file)) { diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index bb26655dfb6..6482f9ac5f5 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -778,7 +778,7 @@ void MemcheckToolPrivate::heobAction() // heob executable const QString heob = QString("heob%1.exe").arg(abi.wordWidth()); const QString heobPath = dialog.path() + '/' + heob; - if (!QFile::exists(heobPath)) { + if (!QFileInfo::exists(heobPath)) { QMessageBox::critical( Core::ICore::dialogParent(), Tr::tr("Heob"), @@ -791,7 +791,7 @@ void MemcheckToolPrivate::heobAction() if (abi.osFlavor() == Abi::WindowsMSysFlavor) { const QString dwarfstack = QString("dwarfstack%1.dll").arg(abi.wordWidth()); const QString dwarfstackPath = dialog.path() + '/' + dwarfstack; - if (!QFile::exists(dwarfstackPath) + if (!QFileInfo::exists(dwarfstackPath) && CheckableMessageBox::information( Core::ICore::dialogParent(), Tr::tr("Heob"), diff --git a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp index 9832c16da3b..96bf9023eec 100644 --- a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp +++ b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp @@ -91,7 +91,7 @@ static QString makeFrameName(const Frame &frame, bool withLocation) else path = frame.object(); - if (QFile::exists(path)) + if (QFileInfo::exists(path)) path = QFileInfo(path).canonicalFilePath(); if (frame.line() != -1) diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 0df7b928ee7..1ad32d4684f 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -1156,7 +1156,7 @@ void VcsBaseEditorWidget::jumpToChangeFromDiff(QTextCursor cursor) return; const QString fileName = findDiffFile(fileNameFromDiffSpecification(block)); - const bool exists = fileName.isEmpty() ? false : QFile::exists(fileName); + const bool exists = fileName.isEmpty() ? false : QFileInfo::exists(fileName); if (!exists) return; diff --git a/src/shared/proparser/qmakeglobals.cpp b/src/shared/proparser/qmakeglobals.cpp index 03e0fd60559..7fa8915920f 100644 --- a/src/shared/proparser/qmakeglobals.cpp +++ b/src/shared/proparser/qmakeglobals.cpp @@ -79,7 +79,7 @@ QString QMakeGlobals::cleanSpec(QMakeCmdLineParserState &state, const QString &s QString ret = QDir::cleanPath(spec); if (ret.contains(QLatin1Char('/'))) { QString absRet = IoUtils::resolvePath(device_root, state.pwd, ret); - if (QFile::exists(absRet)) + if (QFileInfo::exists(absRet)) ret = absRet; } return ret; diff --git a/src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp b/src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp index 5fe89323a90..e38889f5ea5 100644 --- a/src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp +++ b/src/tools/cplusplus-ast2png/cplusplus-ast2png.cpp @@ -554,7 +554,7 @@ int main(int argc, char *argv[]) // Process files const QStringList files = args; for (const QString &fileName : files) { - if (! QFile::exists(fileName)) { + if (! QFileInfo::exists(fileName)) { std::cerr << "Error: File \"" << qPrintable(fileName) << "\" does not exist." << std::endl; exit(EXIT_FAILURE); diff --git a/src/tools/cplusplus-shared/utils.cpp b/src/tools/cplusplus-shared/utils.cpp index 562cd96d65b..b7feb7023c8 100644 --- a/src/tools/cplusplus-shared/utils.cpp +++ b/src/tools/cplusplus-shared/utils.cpp @@ -76,7 +76,7 @@ SystemPreprocessor::SystemPreprocessor(bool verbose) void SystemPreprocessor::check() const { QTextStream out(stderr); - if (!QFile::exists(QLatin1String(PATH_PREPROCESSOR_CONFIG))) { + if (!QFileInfo::exists(QLatin1String(PATH_PREPROCESSOR_CONFIG))) { out << QString::fromLatin1("Error: File \"%1\" does not exist.") .arg(QLatin1String(PATH_PREPROCESSOR_CONFIG)) << Qt::endl; @@ -94,7 +94,7 @@ void SystemPreprocessor::check() const void SystemPreprocessor::preprocessFile(const QString &inputFile, const QString &outputFile) const { check(); - if (!QFile::exists(inputFile)) { + if (!QFileInfo::exists(inputFile)) { QTextStream out(stderr); out << QString::fromLatin1("Error: File \"%1\" does not exist.").arg(inputFile) << Qt::endl; exit(EXIT_FAILURE); diff --git a/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp b/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp index 71b4221872a..f202b8b8946 100644 --- a/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp +++ b/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp @@ -1606,7 +1606,7 @@ int main(int argc, char *argv[]) } QDir cplusplusDir(pathCppFrontend); - if (!QFile::exists(pathCppFrontend)) { + if (!QFileInfo::exists(pathCppFrontend)) { std::cerr << "Error: Directory \"" << qPrintable(cplusplusDir.absolutePath()) << "\" does not exist." << std::endl; return EXIT_FAILURE; @@ -1616,7 +1616,7 @@ int main(int argc, char *argv[]) << "\"." << std::endl; return EXIT_FAILURE; } - if (!QFile::exists(pathDumpersFile)) { + if (!QFileInfo::exists(pathDumpersFile)) { std::cerr << "Error: File \"" << qPrintable(pathDumpersFile) << "\" does not exist." << std::endl; return EXIT_FAILURE; diff --git a/src/tools/qml2puppet/qml2puppet/qmlpuppet.cpp b/src/tools/qml2puppet/qml2puppet/qmlpuppet.cpp index 6d3fa2ce36a..610685499c2 100644 --- a/src/tools/qml2puppet/qml2puppet/qmlpuppet.cpp +++ b/src/tools/qml2puppet/qml2puppet/qmlpuppet.cpp @@ -108,14 +108,14 @@ void QmlPuppet::initQmlRunner() if (m_argParser.isSet("readcapturedstream") && m_coreApp->arguments().count() > 2) { QString fileName = m_argParser.value("readcapturedstream"); - if (!QFile::exists(fileName)) { + if (!QFileInfo::exists(fileName)) { qDebug() << "Input stream does not exist:" << fileName; exit(-1); } if (m_coreApp->arguments().count() > 3) { fileName = m_coreApp->arguments().at(3); - if (!QFile::exists(fileName)) { + if (!QFileInfo::exists(fileName)) { qDebug() << "Output stream does not exist:" << fileName; exit(-1); } diff --git a/src/tools/sdktool/sdkpersistentsettings.cpp b/src/tools/sdktool/sdkpersistentsettings.cpp index b72fffa4c57..43b92d7d470 100644 --- a/src/tools/sdktool/sdkpersistentsettings.cpp +++ b/src/tools/sdktool/sdkpersistentsettings.cpp @@ -173,7 +173,7 @@ bool SdkSaveFile::commit() if (!result) { DWORD replaceErrorCode = GetLastError(); QString errorStr; - if (!QFile::exists(finalFileName)) { + if (!QFileInfo::exists(finalFileName)) { // Replace failed because finalFileName does not exist, try rename. if (!(result = rename(finalFileName))) errorStr = errorString(); @@ -210,7 +210,7 @@ bool SdkSaveFile::commit() // Back up current file. // If it's opened by another application, the lock follows the move. - if (QFile::exists(finalFileName)) { + if (QFileInfo::exists(finalFileName)) { // Kill old backup. Might be useful if creator crashed before removing backup. QFile::remove(backupName); QFile finalFile(finalFileName); diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index d3c9640d49c..f58f8f73731 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1252,7 +1252,7 @@ void tst_Dumpers::initTestCase() QString cdbextPath = qEnvironmentVariable("QTC_CDBEXT_PATH"); if (cdbextPath.isEmpty()) cdbextPath = QString(CDBEXT_PATH "\\qtcreatorcdbext64"); - QVERIFY(QFile::exists(cdbextPath + "\\qtcreatorcdbext.dll")); + QVERIFY(QFileInfo::exists(cdbextPath + "\\qtcreatorcdbext.dll")); env.set("_NT_DEBUGGER_EXTENSION_PATH", cdbextPath); env.prependOrSetPath(Utils::FilePath::fromString(m_qmakeBinary).parentDir()); m_makeBinary = env.searchInPath("nmake.exe").toString(); From 4cd48c84ae13d3380e5e81cca03bd9e9905e5369 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 1 Sep 2023 09:19:31 +0200 Subject: [PATCH 0958/1777] CppEditor: improve quickfix after local renaming Always update the local usages of the symbol under cursor even if we are currently renaming a local symbol. Otherwise the semantic info is classified as not up to date, which in turns limits the quick fix operation to the ones coming from clangd. As a next step we could make sure the semantic info is valid and up to date before creating the code assist interface by calling a synchronous CppUseSelectionsUpdater::update. But as this will potentially block the ui, it will require some extra handling. Change-Id: Icb9f523a5a21e65a2853e3b98a17c2f45c637825 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cppeditor/cppeditorwidget.cpp | 13 +++++-------- src/plugins/cppeditor/cppuseselectionsupdater.cpp | 7 ++----- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index 821217873e9..0cb1aadb05c 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -478,8 +478,7 @@ void CppEditorWidget::finalizeInitialization() // set up the use highlighitng connect(this, &CppEditorWidget::cursorPositionChanged, this, [this] { - if (!d->m_localRenaming.isActive()) - d->m_useSelectionsUpdater.scheduleUpdate(); + d->m_useSelectionsUpdater.scheduleUpdate(); // Notify selection expander about the changed cursor. d->m_cppSelectionChanger.onCursorPositionChanged(textCursor()); @@ -1223,12 +1222,10 @@ void CppEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo, d->m_lastSemanticInfo = semanticInfo; - if (!d->m_localRenaming.isActive()) { - const CppUseSelectionsUpdater::CallType type = updateUseSelectionSynchronously - ? CppUseSelectionsUpdater::CallType::Synchronous - : CppUseSelectionsUpdater::CallType::Asynchronous; - d->m_useSelectionsUpdater.update(type); - } + const CppUseSelectionsUpdater::CallType type + = updateUseSelectionSynchronously ? CppUseSelectionsUpdater::CallType::Synchronous + : CppUseSelectionsUpdater::CallType::Asynchronous; + d->m_useSelectionsUpdater.update(type); // schedule a check for a decl/def link updateFunctionDeclDefLink(); diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.cpp b/src/plugins/cppeditor/cppuseselectionsupdater.cpp index 7d7bfe98006..e03475ea80d 100644 --- a/src/plugins/cppeditor/cppuseselectionsupdater.cpp +++ b/src/plugins/cppeditor/cppuseselectionsupdater.cpp @@ -52,7 +52,8 @@ CppUseSelectionsUpdater::RunnerInfo CppUseSelectionsUpdater::update(CallType cal auto *cppEditorDocument = qobject_cast<CppEditorDocument *>(cppEditorWidget->textDocument()); QTC_ASSERT(cppEditorDocument, return RunnerInfo::FailedToStart); - m_updateSelections = !CppModelManager::usesClangd(cppEditorDocument); + m_updateSelections = !CppModelManager::usesClangd(cppEditorDocument) + && !m_editorWidget->isRenaming(); CursorInfoParams params; params.semanticInfo = cppEditorWidget->semanticInfo(); @@ -138,10 +139,6 @@ void CppUseSelectionsUpdater::onFindUsesFinished() emit finished(SemanticInfo::LocalUseMap(), false); return; } - if (m_editorWidget->isRenaming()) { - emit finished({}, false); - return; - } processResults(m_runnerWatcher->result()); From 5f02cadeabb2710303cf9f0a00e5ff43372840d4 Mon Sep 17 00:00:00 2001 From: Andreas Loth <andreas.loth@qt.io> Date: Tue, 29 Aug 2023 15:42:08 +0200 Subject: [PATCH 0959/1777] Axivion: Begin to use QNetworkAccessManager instead of curl for HTTP Change-Id: I2fd7ba2a72e749bdc5407d222057cb66ff341b04 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/axivion/CMakeLists.txt | 1 + src/plugins/axivion/axivion.qbs | 2 + src/plugins/axivion/axivionplugin.cpp | 33 ++++--- src/plugins/axivion/axivionresultparser.cpp | 15 ---- .../axivion/dashboard/dashboardclient.cpp | 88 +++++++++++++++++++ .../axivion/dashboard/dashboardclient.h | 33 +++++++ 6 files changed, 143 insertions(+), 29 deletions(-) create mode 100644 src/plugins/axivion/dashboard/dashboardclient.cpp create mode 100644 src/plugins/axivion/dashboard/dashboardclient.h diff --git a/src/plugins/axivion/CMakeLists.txt b/src/plugins/axivion/CMakeLists.txt index 8768544764c..c71df674750 100644 --- a/src/plugins/axivion/CMakeLists.txt +++ b/src/plugins/axivion/CMakeLists.txt @@ -13,4 +13,5 @@ add_qtc_plugin(Axivion axiviontr.h dashboard/dto.cpp dashboard/dto.h dashboard/concat.cpp dashboard/concat.h + dashboard/dashboardclient.cpp dashboard/dashboardclient.h ) diff --git a/src/plugins/axivion/axivion.qbs b/src/plugins/axivion/axivion.qbs index 73db674adc4..bdd20a89349 100644 --- a/src/plugins/axivion/axivion.qbs +++ b/src/plugins/axivion/axivion.qbs @@ -26,6 +26,8 @@ QtcPlugin { "axivionsettings.cpp", "axivionsettings.h", "axiviontr.h", + "dashboard/dashboardclient.cpp", + "dashboard/dashboardclient.h", ] cpp.includePaths: base.concat(["."]) // needed for the generated stuff below diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index 3d89c8ba957..bd595a57b0b 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -8,6 +8,7 @@ #include "axivionquery.h" #include "axivionresultparser.h" #include "axiviontr.h" +#include "dashboard/dashboardclient.h" #include "dashboard/dto.h" #include <coreplugin/editormanager/documentmodel.h> @@ -26,10 +27,12 @@ #include <texteditor/textmark.h> #include <utils/expected.h> +#include <utils/networkaccessmanager.h> #include <utils/qtcassert.h> #include <utils/utilsicons.h> #include <QAction> +#include <QFutureWatcher> #include <QTimer> #include <exception> @@ -44,7 +47,7 @@ class AxivionPluginPrivate : public QObject public: void onStartupProjectChanged(); void fetchProjectInfo(const QString &projectName); - void handleProjectInfo(const QByteArray &result); + void handleProjectInfo(Utils::expected_str<Dto::ProjectInfoDto> rawInfo); void handleOpenedDocs(ProjectExplorer::Project *project); void onDocumentOpened(Core::IDocument *doc); void onDocumentClosed(Core::IDocument * doc); @@ -52,6 +55,7 @@ public: void handleIssuesForFile(const IssuesList &issues); void fetchRuleInfo(const QString &id); + Utils::NetworkAccessManager *m_networkAccessManager = Utils::NetworkAccessManager::instance(); AxivionOutputPane m_axivionOutputPane; std::shared_ptr<const Dto::ProjectInfoDto> m_currentProjectInfo; bool m_runningQuery = false; @@ -151,14 +155,16 @@ void AxivionPluginPrivate::fetchProjectInfo(const QString &projectName) return; } m_runningQuery = true; - - AxivionQuery query(AxivionQuery::ProjectInfo, {projectName}); - AxivionQueryRunner *runner = new AxivionQueryRunner(query, this); - connect(runner, &AxivionQueryRunner::resultRetrieved, this, [this](const QByteArray &result){ - handleProjectInfo(result); - }); - connect(runner, &AxivionQueryRunner::finished, [runner]{ runner->deleteLater(); }); - runner->start(); + DashboardClient client { *this->m_networkAccessManager }; + QFuture<DashboardClient::RawProjectInfo> response = client.fetchProjectInfo(projectName); + auto responseWatcher = std::make_shared<QFutureWatcher<DashboardClient::RawProjectInfo>>(); + connect(responseWatcher.get(), + &QFutureWatcher<DashboardClient::RawProjectInfo>::finished, + this, + [this, responseWatcher]() { + handleProjectInfo(responseWatcher->result()); + }); + responseWatcher->setFuture(response); } void AxivionPluginPrivate::fetchRuleInfo(const QString &id) @@ -201,15 +207,14 @@ void AxivionPluginPrivate::clearAllMarks() onDocumentClosed(doc); } -void AxivionPluginPrivate::handleProjectInfo(const QByteArray &result) +void AxivionPluginPrivate::handleProjectInfo(Utils::expected_str<Dto::ProjectInfoDto> rawInfo) { - Utils::expected_str<Dto::ProjectInfoDto> raw_info = ResultParser::parseProjectInfo(result); m_runningQuery = false; - if (!raw_info) { - Core::MessageManager::writeFlashing(QStringLiteral(u"Axivion: ") + raw_info.error()); + if (!rawInfo) { + Core::MessageManager::writeFlashing(QStringLiteral(u"Axivion: ") + rawInfo.error()); return; } - m_currentProjectInfo = std::make_shared<const Dto::ProjectInfoDto>(std::move(raw_info.value())); + m_currentProjectInfo = std::make_shared<const Dto::ProjectInfoDto>(std::move(rawInfo.value())); m_axivionOutputPane.updateDashboard(); // handle already opened documents if (auto buildSystem = ProjectExplorer::ProjectManager::startupBuildSystem(); diff --git a/src/plugins/axivion/axivionresultparser.cpp b/src/plugins/axivion/axivionresultparser.cpp index 81ae9787170..cd4ec0b11c6 100644 --- a/src/plugins/axivion/axivionresultparser.cpp +++ b/src/plugins/axivion/axivionresultparser.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "axivionresultparser.h" -#include "dashboard/dto.h" #include <utils/qtcassert.h> @@ -120,20 +119,6 @@ DashboardInfo parseDashboardInfo(const QByteArray &input) return result; } -Utils::expected_str<Dto::ProjectInfoDto> parseProjectInfo(const QByteArray &input) -{ - auto [header, body] = splitHeaderAndBody(input); - auto [error, doc] = prehandleHeaderAndBody(header, body); - if (!error.error.isEmpty()) - return tl::make_unexpected(std::move(error.error)); - try - { - return { Dto::ProjectInfoDto::deserialize(body) }; - } catch (const Dto::invalid_dto_exception &e) { - return tl::make_unexpected(QString::fromUtf8(e.what())); - } -} - static QRegularExpression issueCsvLineRegex(const QByteArray &firstCsvLine) { QString pattern = "^"; diff --git a/src/plugins/axivion/dashboard/dashboardclient.cpp b/src/plugins/axivion/dashboard/dashboardclient.cpp new file mode 100644 index 00000000000..4956f106360 --- /dev/null +++ b/src/plugins/axivion/dashboard/dashboardclient.cpp @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2022-current by Axivion GmbH + * https://www.axivion.com/ + * + * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + */ + +#include "dashboardclient.h" + +#include "axivionsettings.h" + +#include <QByteArray> +#include <QCoreApplication> +#include <QLatin1String> +#include <QNetworkReply> +#include <QNetworkRequest> + +#include <memory> + +namespace Axivion::Internal +{ + +DashboardClient::DashboardClient(Utils::NetworkAccessManager &networkAccessManager) + : m_networkAccessManager(networkAccessManager) +{ +} + +static void deleteLater(QObject *obj) +{ + obj->deleteLater(); +} + +using RawBody = Utils::expected_str<QByteArray>; + +class RawBodyReader final +{ +public: + RawBodyReader(std::shared_ptr<QNetworkReply> reply) + : m_reply(std::move(reply)) + { } + + ~RawBodyReader() { } + + RawBody operator()() + { + QNetworkReply::NetworkError error = m_reply->error(); + if (error != QNetworkReply::NetworkError::NoError) + return tl::make_unexpected(QString::number(error) + + QLatin1String(": ") + + m_reply->errorString()); + return m_reply->readAll(); + } + +private: + std::shared_ptr<QNetworkReply> m_reply; +}; + +template<typename T> +static Utils::expected_str<T> RawBodyParser(RawBody rawBody) +{ + if (!rawBody) + return tl::make_unexpected(std::move(rawBody.error())); + try { + return { T::deserialize(rawBody.value()) }; + } catch (const Dto::invalid_dto_exception &e) { + return tl::make_unexpected(QString::fromUtf8(e.what())); + } +} + +QFuture<DashboardClient::RawProjectInfo> DashboardClient::fetchProjectInfo(const QString &projectName) +{ + const AxivionServer &server = settings().server; + QUrl url { server.dashboard + QStringLiteral(u"/api/projects/") + QUrl::toPercentEncoding(projectName) }; + QNetworkRequest request{ url }; + request.setRawHeader(QByteArrayLiteral(u8"Authorization"), + QByteArrayLiteral(u8"AxToken ") + server.token.toUtf8()); + QByteArray ua = QByteArrayLiteral(u8"Axivion") + + QCoreApplication::applicationName().toUtf8() + + QByteArrayLiteral(u8"Plugin/") + + QCoreApplication::applicationVersion().toUtf8(); + request.setRawHeader(QByteArrayLiteral(u8"X-Axivion-User-Agent"), ua); + std::shared_ptr<QNetworkReply> reply{ this->m_networkAccessManager.get(request), deleteLater }; + return QtFuture::connect(reply.get(), &QNetworkReply::finished) + .then(RawBodyReader(reply)) + .then(QtFuture::Launch::Async, &RawBodyParser<Dto::ProjectInfoDto>); +} + +} diff --git a/src/plugins/axivion/dashboard/dashboardclient.h b/src/plugins/axivion/dashboard/dashboardclient.h new file mode 100644 index 00000000000..544f1430b17 --- /dev/null +++ b/src/plugins/axivion/dashboard/dashboardclient.h @@ -0,0 +1,33 @@ +#pragma once + +/* + * Copyright (C) 2022-current by Axivion GmbH + * https://www.axivion.com/ + * + * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + */ + +#include "dashboard/dto.h" + +#include <utils/expected.h> +#include <utils/networkaccessmanager.h> + +#include <QFuture> + +namespace Axivion::Internal +{ + +class DashboardClient +{ +public: + using RawProjectInfo = Utils::expected_str<Dto::ProjectInfoDto>; + + DashboardClient(Utils::NetworkAccessManager &networkAccessManager); + + QFuture<RawProjectInfo> fetchProjectInfo(const QString &projectName); + +private: + Utils::NetworkAccessManager &m_networkAccessManager; +}; + +} // namespace Axivion::Internal From 495c826c5564f002ed2fcf83679f9b1302c2d607 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 29 Aug 2023 11:50:04 +0200 Subject: [PATCH 0960/1777] Doc: Rename "Adding Custom Wizards" and move it to "Reference" - Create an "Add wizards" how-to topic Task-number: QTCREATORBUG-29361 Change-Id: I37b1f39ba78fd1c39f4b111051f5eef1acee4caf Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../src/howto/creator-only/creator-cli.qdoc | 2 +- .../howto/creator-only/creator-how-tos.qdoc | 1 + .../creator-only/creator-reference.qdoc | 2 +- .../creator-only/creator-files-creating.qdoc | 2 +- .../creator-how-to-add-wizards.qdoc | 49 +++++++++++++++++++ .../creator-projects-creating.qdoc | 2 +- ...eator-projects-custom-wizards-json.qdocinc | 2 +- .../creator-projects-custom-wizards.qdoc | 15 +++--- doc/qtcreator/src/qtcreator-toc.qdoc | 5 +- 9 files changed, 66 insertions(+), 14 deletions(-) create mode 100644 doc/qtcreator/src/projects/creator-only/creator-how-to-add-wizards.qdoc diff --git a/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc b/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc index 96c63abfd1d..7fd9687c0ce 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc @@ -223,7 +223,7 @@ \li -customwizard-verbose \li ProjectExplorer plugin: display additional information when loading custom wizards. For more information about custom - wizards, see \l{Adding New Custom Wizards} + wizards, see \l{Custom Wizards} \row \li -ensure-kit-for-binary <path to binary> diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 25ace3d413f..94d7618e6e3 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -63,6 +63,7 @@ \li \l {Add a license header template for C++ code} \li \l {Add libraries to projects} \li \l {Add subprojects to projects} + \li \l {Add wizards} \li \l {Create C++ classes} \li \l {Create files} \li \l {Create OpenGL fragment and vertex shaders} diff --git a/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc b/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc index 22dfff65739..75c04dfab51 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc @@ -8,7 +8,7 @@ \title Reference - The following topics describe the different parts of the UI in detail. + \annotatedlist creator-reference \section1 Sidebar Views diff --git a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc index 8676fe625cd..494c7069b12 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc @@ -110,7 +110,7 @@ \l{Using Variables in Wizards}{predefined wizard variables} to specify the path and filename of the license to use in the source and header files. - \sa {Create files}, {Use project wizards}, {Adding New Custom Wizards} + \sa {Create files}, {Use project wizards}, {Custom Wizards} */ /*! diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-add-wizards.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-add-wizards.qdoc new file mode 100644 index 00000000000..eaa7ce6b95a --- /dev/null +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-add-wizards.qdoc @@ -0,0 +1,49 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-how-to-add-wizards.html + \previouspage creator-project-qmake-libraries.html + \nextpage creator-version-control.html + + \ingroup creator-how-to-projects + + \title Add wizards + + \QC has wizards for adding classes, files, and projects that you can copy + and edit to create your own wizards. Create the wizard directory in the + \c {templates/wizards/} directory in your \l{Locating Wizards} + {user settings directory}. + + \image qtcreator-cpp-class-wizard.png + + To create a new wizard: + + \list 1 + + \li Start \QC with the \c {-customwizard-verbose} argument to receive + feedback during wizard development. For more information, see + \l {Verbose Output}. + + \li Set keyboard shortcuts for the \uicontrol Inspect and + \uicontrol {Factory.Reset} actions, as described in + \l {Tips for Wizard Development}. + + \li Copy a directory that contains a wizard and rename it. For example, + copy \c {share/qtcreator/templates/wizards/classes/cpp} as + \c {$HOME/.config/QtProject/qtcreator/templates/wizards/classes/mycpp}. + + \li Use the \uicontrol {Factory.Reset} action to make the wizard appear + in \uicontrol File > \uicontrol {New File} without + restarting \QC. + + \li Open the wizard configuration file, \c {wizard.json} for editing, as + described in \l {Custom Wizards}. + + \li Change the \c id to something unique. Wizards are sorted by the ID in + alphabetic order within a \c category. You can use a leading letter + to specify the position of the wizard. For example, \c B.MyClass. + \endlist + +\sa {Custom Wizards}, {Find settings files} +*/ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index 372eb9b45c1..aaf659a9c46 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -69,7 +69,7 @@ install and configure some additional software on the devices to be able to \l{Connecting Devices}{connect} to them from the development PC. - \sa {Manage Projects}{How-to: Manage Projects}, {Adding New Custom Wizards} + \sa {Manage Projects}{How-to: Manage Projects}, {Custom Wizards} */ /*! diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc index d4c0009db17..8ffcff60f28 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc @@ -89,7 +89,7 @@ \li Make a copy of \c {share/qtcreator/templates/wizards/classes/cpp} and rename it. For example, - \c {share/qtcreator/templates/wizards/classes/mycpp} + \c {$HOME/.config/QtProject/qtcreator/templates/wizards/classes/mycpp}. \li Use the \uicontrol {Factory.Reset} action to make the wizard appear in \uicontrol File > \uicontrol {New File} without diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc index f2dae9f9ceb..67c0c3d91a1 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,11 +8,14 @@ // ********************************************************************** /*! - \previouspage creator-project-qmake-libraries.html \page creator-project-wizards.html - \nextpage creator-version-control.html + \previouspage creator-reference.html - \title Adding New Custom Wizards + \ingroup creator-reference + + \title Custom Wizards + + \brief Wizard types and JSON wizard format. If you have a team working on a large application or several applications, you might want to standardize the way the team members create projects and @@ -57,14 +60,14 @@ \list - \li Shared directory: + \li Predefined wizards in the shared directory: \list \li On Windows: \c {share\qtcreator\templates\wizards} \li On Linux: \c {share/qtcreator/templates/wizards} \li On \macos: \c{Qt Creator.app/Contents/Resources/templates/wizards} \endlist - \li Local user's settings directory: + \li Your custom wizards in the local user's settings directory: \list \li On Windows: \c {%APPDATA%\QtProject\qtcreator\templates\wizards} diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index c470627884d..9edf08634a4 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -24,9 +24,6 @@ \li \l{Managing Projects} \list \li \l{Creating Projects} - \list - \li \l{Adding New Custom Wizards} - \endlist \li \l{Using Version Control Systems} \list \li \l{Using Bazaar} @@ -276,6 +273,7 @@ \li \l {Add a license header template for C++ code} \li \l {Add libraries to projects} \li \l {Add subprojects to projects} + \li \l {Add wizards} \li \l {Create C++ classes} \li \l {Create files} \li \l {Create OpenGL fragment and vertex shaders} @@ -296,6 +294,7 @@ \endlist \li \l{Reference} \list + \li \l {Custom Wizards} \li Sidebar Views \list \li \l {Call Hierarchy} From 164cb389dc3dbb154b0a85d035bc20fd90e1ad07 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Wed, 30 Aug 2023 11:33:47 +0200 Subject: [PATCH 0961/1777] Utils: Add a convenience function to TextFileFormat All these output parameters make for awful code on the calling site. Change-Id: Ie13294959cc011bc8220bab084e1685f85d8e06b Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/textfileformat.cpp | 13 +++++++++++++ src/libs/utils/textfileformat.h | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/src/libs/utils/textfileformat.cpp b/src/libs/utils/textfileformat.cpp index 264c6c4351f..0fea53720f3 100644 --- a/src/libs/utils/textfileformat.cpp +++ b/src/libs/utils/textfileformat.cpp @@ -288,6 +288,19 @@ TextFileFormat::ReadResult TextFileFormat::readFileUTF8(const FilePath &filePath return TextFileFormat::ReadSuccess; } +tl::expected<QString, std::pair<TextFileFormat::ReadResult, QString>> +TextFileFormat::readFile(const FilePath &filePath, const QTextCodec *defaultCodec) +{ + QString plainText; + TextFileFormat format; + QString errorString; + const TextFileFormat::ReadResult result = + readTextFile(filePath, defaultCodec, &plainText, &format, &errorString, nullptr); + if (result != TextFileFormat::ReadSuccess) + return tl::unexpected(std::make_pair(result, errorString)); + return plainText; +} + /*! Writes out a text file to \a filePath into a string, \a plainText. diff --git a/src/libs/utils/textfileformat.h b/src/libs/utils/textfileformat.h index f500fed50e6..4cd67abec8e 100644 --- a/src/libs/utils/textfileformat.h +++ b/src/libs/utils/textfileformat.h @@ -3,9 +3,11 @@ #pragma once +#include "expected.h" #include "utils_global.h" #include <QStringList> +#include <utility> QT_BEGIN_NAMESPACE class QTextCodec; @@ -53,6 +55,8 @@ public: QByteArray *decodingErrorSample = nullptr); static ReadResult readFileUTF8(const FilePath &filePath, const QTextCodec *defaultCodec, QByteArray *plainText, QString *errorString); + static tl::expected<QString, std::pair<ReadResult, QString>> + readFile(const FilePath &filePath, const QTextCodec *defaultCodec); bool writeFile(const FilePath &filePath, QString plainText, QString *errorString) const; From 0a058bb65717cddb3e01a44f3241c029253a1eea Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Wed, 23 Aug 2023 17:26:02 +0200 Subject: [PATCH 0962/1777] CppEditor: Consider symbol occurrences in comments ... when renaming. For local renaming, we consider only function parameters. Task-number: QTCREATORBUG-12051 Change-Id: I7948d69f11b97663c9bd747ae6241a82dd9bdd82 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/libs/cplusplus/declarationcomments.cpp | 110 ++++++---- src/libs/cplusplus/declarationcomments.h | 20 +- src/libs/utils/searchresultitem.h | 5 + src/plugins/clangcodemodel/clangdclient.cpp | 18 +- src/plugins/clangcodemodel/clangdclient.h | 5 +- .../clangcodemodel/clangdfindreferences.cpp | 38 +++- .../clangcodemodel/clangdfindreferences.h | 6 +- .../clangmodelmanagersupport.cpp | 2 +- .../clangcodemodel/test/clangdtests.cpp | 10 +- .../test/data/local-references/references.cpp | 11 + .../coreplugin/find/searchresulttreeitems.cpp | 21 +- .../coreplugin/find/searchresulttreeitems.h | 3 +- .../coreplugin/find/searchresulttreemodel.cpp | 4 +- .../coreplugin/find/searchresultwidget.cpp | 6 +- .../coreplugin/find/searchresultwidget.h | 2 +- .../coreplugin/find/searchresultwindow.cpp | 5 + .../coreplugin/find/searchresultwindow.h | 4 +- src/plugins/cppeditor/cppfindreferences.cpp | 4 + src/plugins/cppeditor/cpplocalsymbols.cpp | 45 +++- src/plugins/cppeditor/cpprenaming_test.cpp | 10 +- src/plugins/cppeditor/cpptoolsreuse.cpp | 205 +++++++++++++++++- src/plugins/cppeditor/cpptoolsreuse.h | 13 +- src/plugins/cppeditor/symbolsfindfilter.cpp | 2 +- src/plugins/languageclient/client.cpp | 26 ++- src/plugins/languageclient/client.h | 4 + .../languageclientsymbolsupport.cpp | 26 ++- .../languageclientsymbolsupport.h | 4 + .../tst_declarationcomments.cpp | 2 +- 28 files changed, 525 insertions(+), 86 deletions(-) diff --git a/src/libs/cplusplus/declarationcomments.cpp b/src/libs/cplusplus/declarationcomments.cpp index 2283fa847ff..f67ac1be9d5 100644 --- a/src/libs/cplusplus/declarationcomments.cpp +++ b/src/libs/cplusplus/declarationcomments.cpp @@ -8,58 +8,35 @@ #include <cplusplus/Overview.h> #include <utils/algorithm.h> +#include <utils/textutils.h> #include <QRegularExpression> +#include <QStringList> #include <QTextBlock> #include <QTextDocument> namespace CPlusPlus { -QList<Token> commentsForDeclaration(const Symbol *symbol, const Snapshot &snapshot, - const QTextDocument &textDoc) +static QString nameFromSymbol(const Symbol *symbol) { - // Set up cpp document. - const Document::Ptr cppDoc = snapshot.preprocessedDocument(textDoc.toPlainText().toUtf8(), - symbol->filePath()); - cppDoc->parse(); - TranslationUnit * const tu = cppDoc->translationUnit(); - if (!tu || !tu->isParsed()) + const QStringList symbolParts = Overview().prettyName(symbol->name()) + .split("::", Qt::SkipEmptyParts); + if (symbolParts.isEmpty()) return {}; + return symbolParts.last(); +} - // Find the symbol declaration's AST node. - // We stop at the last declaration node that precedes the symbol, except: - // - For parameter declarations, we just continue, because we are interested in the function. - // - If the declaration node is preceded directly by another one, we choose that one instead, - // because with nested declarations we want the outer one (e.g. templates). - int line, column; - tu->getTokenPosition(symbol->sourceLocation(), &line, &column); - const QList<AST *> astPath = ASTPath(cppDoc)(line, column); - if (astPath.isEmpty()) - return {}; - if (astPath.last()->firstToken() != symbol->sourceLocation()) - return {}; - const AST *declAst = nullptr; - bool needsSymbolReference = false; - bool isParameter = false; - for (auto it = std::next(std::rbegin(astPath)); it != std::rend(astPath); ++it) { - AST * const node = *it; - if (node->asParameterDeclaration()) { - needsSymbolReference = true; - isParameter = true; - continue; - } - if (node->asDeclaration()) { - declAst = node; - continue; - } - if (declAst) - break; - } - if (!declAst) +static QList<Token> commentsForDeclaration( + const AST *decl, const QString &symbolName, const QTextDocument &textDoc, + const Document::Ptr &cppDoc, bool isParameter) +{ + if (symbolName.isEmpty()) return {}; // Get the list of all tokens (including comments) and find the declaration start token there. - const Token &declToken = tu->tokenAt(declAst->firstToken()); + TranslationUnit * const tu = cppDoc->translationUnit(); + QTC_ASSERT(tu && tu->isParsed(), return {}); + const Token &declToken = tu->tokenAt(decl->firstToken()); std::vector<Token> allTokens = tu->allTokens(); QTC_ASSERT(!allTokens.empty(), return {}); int tokenPos = -1; @@ -86,6 +63,7 @@ QList<Token> commentsForDeclaration(const Symbol *symbol, const Snapshot &snapsh const auto blockForTokenEnd = [&](const Token &tok) { return textDoc.findBlock(tu->getTokenEndPositionInDocument(tok, &textDoc)); }; + bool needsSymbolReference = isParameter; for (int i = tokenPos - 1; i >= 0; --i) { const Token &tok = allTokens.at(i); if (!tok.isComment()) @@ -127,7 +105,6 @@ QList<Token> commentsForDeclaration(const Symbol *symbol, const Snapshot &snapsh return tokenList(); // b) - const QString symbolName = Overview().prettyName(symbol->name()); const Kind tokenKind = comments.first().token.kind(); const bool isDoxygenComment = tokenKind == T_DOXY_COMMENT || tokenKind == T_CPP_DOXY_COMMENT; const QRegularExpression symbolRegExp(QString("%1\\b%2\\b").arg( @@ -142,4 +119,57 @@ QList<Token> commentsForDeclaration(const Symbol *symbol, const Snapshot &snapsh return {}; } + +QList<Token> commentsForDeclaration(const Symbol *symbol, const QTextDocument &textDoc, + const Document::Ptr &cppDoc) +{ + QTC_ASSERT(cppDoc->translationUnit() && cppDoc->translationUnit()->isParsed(), return {}); + Utils::Text::Position pos; + cppDoc->translationUnit()->getTokenPosition(symbol->sourceLocation(), &pos.line, &pos.column); + --pos.column; + return commentsForDeclaration(nameFromSymbol(symbol), pos, textDoc, cppDoc); +} + +QList<Token> commentsForDeclaration(const QString &symbolName, const Utils::Text::Position &pos, + const QTextDocument &textDoc, const Document::Ptr &cppDoc) +{ + if (symbolName.isEmpty()) + return {}; + + // Find the symbol declaration's AST node. + // We stop at the last declaration node that precedes the symbol, except: + // - For parameter declarations, we just continue, because we are interested in the function. + // - If the declaration node is preceded directly by another one, we choose that one instead, + // because with nested declarations we want the outer one (e.g. templates). + const QList<AST *> astPath = ASTPath(cppDoc)(pos.line, pos.column + 1); + if (astPath.isEmpty()) + return {}; + const AST *declAst = nullptr; + bool isParameter = false; + for (auto it = std::next(std::rbegin(astPath)); it != std::rend(astPath); ++it) { + AST * const node = *it; + if (node->asParameterDeclaration()) { + isParameter = true; + continue; + } + if (node->asDeclaration()) { + declAst = node; + continue; + } + if (declAst) + break; + } + if (!declAst) + return {}; + + return commentsForDeclaration(declAst, symbolName, textDoc, cppDoc, isParameter); +} + +QList<Token> commentsForDeclaration(const Symbol *symbol, const AST *decl, + const QTextDocument &textDoc, const Document::Ptr &cppDoc) +{ + return commentsForDeclaration(decl, nameFromSymbol(symbol), textDoc, cppDoc, + symbol->asArgument()); +} + } // namespace CPlusPlus diff --git a/src/libs/cplusplus/declarationcomments.h b/src/libs/cplusplus/declarationcomments.h index 490290450ce..7b775ad7549 100644 --- a/src/libs/cplusplus/declarationcomments.h +++ b/src/libs/cplusplus/declarationcomments.h @@ -3,6 +3,7 @@ #pragma once +#include <cplusplus/CppDocument.h> #include <cplusplus/Token.h> #include <QList> @@ -11,11 +12,24 @@ QT_BEGIN_NAMESPACE class QTextDocument; QT_END_NAMESPACE +namespace Utils { namespace Text { class Position; } } + namespace CPlusPlus { -class Snapshot; +class AST; +class Symbol; QList<Token> CPLUSPLUS_EXPORT commentsForDeclaration(const Symbol *symbol, - const Snapshot &snapshot, - const QTextDocument &textDoc); + const QTextDocument &textDoc, + const Document::Ptr &cppDoc); + +QList<Token> CPLUSPLUS_EXPORT commentsForDeclaration(const Symbol *symbol, + const AST *decl, + const QTextDocument &textDoc, + const Document::Ptr &cppDoc); + +QList<Token> CPLUSPLUS_EXPORT commentsForDeclaration(const QString &symbolName, + const Utils::Text::Position &pos, + const QTextDocument &textDoc, + const Document::Ptr &cppDoc); } // namespace CPlusPlus diff --git a/src/libs/utils/searchresultitem.h b/src/libs/utils/searchresultitem.h index ea9d0332d5a..bbaaa1caf5e 100644 --- a/src/libs/utils/searchresultitem.h +++ b/src/libs/utils/searchresultitem.h @@ -96,6 +96,11 @@ private: using SearchResultItems = QList<SearchResultItem>; +inline size_t qHash(const SearchResultItem &item) +{ + return item.mainRange().begin.line << 16 | item.mainRange().begin.column; +} + } // namespace Utils Q_DECLARE_METATYPE(Utils::SearchResultItem) diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 43db68c24b7..bb9ec7fc1be 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -402,6 +402,9 @@ ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir, c setCompletionAssistProvider(new ClangdCompletionAssistProvider(this)); setQuickFixAssistProvider(new ClangdQuickFixProvider(this)); symbolSupport().setLimitRenamingToProjects(true); + symbolSupport().setRenameResultsEnhancer([](const SearchResultItems &symbolOccurrencesInCode) { + return CppEditor::symbolOccurrencesInDeclarationComments(symbolOccurrencesInCode); + }); if (!project) { QJsonObject initOptions; const Utils::FilePath includeDir @@ -752,6 +755,13 @@ bool ClangdClient::fileBelongsToProject(const Utils::FilePath &filePath) const return Client::fileBelongsToProject(filePath); } +QList<Text::Range> ClangdClient::additionalDocumentHighlights( + TextEditorWidget *editorWidget, const QTextCursor &cursor) +{ + return CppEditor::symbolOccurrencesInDeclarationComments( + qobject_cast<CppEditor::CppEditorWidget *>(editorWidget), cursor); +} + RefactoringChangesData *ClangdClient::createRefactoringChangesBackend() const { return new CppEditor::CppRefactoringChangesData( @@ -1056,9 +1066,11 @@ void ClangdClient::switchHeaderSource(const Utils::FilePath &filePath, bool inNe sendMessage(req); } -void ClangdClient::findLocalUsages(TextDocument *document, const QTextCursor &cursor, - CppEditor::RenameCallback &&callback) +void ClangdClient::findLocalUsages(CppEditor::CppEditorWidget *editorWidget, + const QTextCursor &cursor, CppEditor::RenameCallback &&callback) { + QTC_ASSERT(editorWidget, return); + TextDocument * const document = editorWidget->textDocument(); QTC_ASSERT(documentOpen(document), openDocument(document)); qCDebug(clangdLog) << "local references requested" << document->filePath() @@ -1076,7 +1088,7 @@ void ClangdClient::findLocalUsages(TextDocument *document, const QTextCursor &cu return; } - d->findLocalRefs = new ClangdFindLocalReferences(this, document, cursor, callback); + d->findLocalRefs = new ClangdFindLocalReferences(this, editorWidget, cursor, callback); connect(d->findLocalRefs, &ClangdFindLocalReferences::done, this, [this] { d->findLocalRefs->deleteLater(); d->findLocalRefs = nullptr; diff --git a/src/plugins/clangcodemodel/clangdclient.h b/src/plugins/clangcodemodel/clangdclient.h index 2b354eaa2cc..4ac861127cc 100644 --- a/src/plugins/clangcodemodel/clangdclient.h +++ b/src/plugins/clangcodemodel/clangdclient.h @@ -74,7 +74,7 @@ public: const Utils::LinkHandler &callback); void switchHeaderSource(const Utils::FilePath &filePath, bool inNextSplit); - void findLocalUsages(TextEditor::TextDocument *document, const QTextCursor &cursor, + void findLocalUsages(CppEditor::CppEditorWidget *editorWidget, const QTextCursor &cursor, CppEditor::RenameCallback &&callback); void gatherHelpItemForTooltip( @@ -148,6 +148,9 @@ private: bool referencesShadowFile(const TextEditor::TextDocument *doc, const Utils::FilePath &candidate) override; bool fileBelongsToProject(const Utils::FilePath &filePath) const override; + QList<Utils::Text::Range> additionalDocumentHighlights( + TextEditor::TextEditorWidget *editorWidget, const QTextCursor &cursor) override; + class Private; class VirtualFunctionAssistProcessor; diff --git a/src/plugins/clangcodemodel/clangdfindreferences.cpp b/src/plugins/clangcodemodel/clangdfindreferences.cpp index d6a91aa334b..24175a82504 100644 --- a/src/plugins/clangcodemodel/clangdfindreferences.cpp +++ b/src/plugins/clangcodemodel/clangdfindreferences.cpp @@ -14,6 +14,7 @@ #include <cplusplus/FindUsages.h> #include <cppeditor/cppcodemodelsettings.h> +#include <cppeditor/cppeditorwidget.h> #include <cppeditor/cppfindreferences.h> #include <cppeditor/cpptoolsreuse.h> @@ -670,10 +671,10 @@ ClangdFindReferences::CheckUnusedData::~CheckUnusedData() class ClangdFindLocalReferences::Private { public: - Private(ClangdFindLocalReferences *q, TextDocument *document, const QTextCursor &cursor, + Private(ClangdFindLocalReferences *q, CppEditorWidget *editorWidget, const QTextCursor &cursor, const RenameCallback &callback) - : q(q), document(document), cursor(cursor), callback(callback), - uri(client()->hostPathToServerUri(document->filePath())), + : q(q), editorWidget(editorWidget), document(editorWidget->textDocument()), cursor(cursor), + callback(callback), uri(client()->hostPathToServerUri(document->filePath())), revision(document->document()->revision()) {} @@ -685,6 +686,7 @@ public: void finish(); ClangdFindLocalReferences * const q; + const QPointer<CppEditorWidget> editorWidget; const QPointer<TextDocument> document; const QTextCursor cursor; RenameCallback callback; @@ -694,9 +696,9 @@ public: }; ClangdFindLocalReferences::ClangdFindLocalReferences( - ClangdClient *client, TextDocument *document, const QTextCursor &cursor, - const RenameCallback &callback) - : QObject(client), d(new Private(this, document, cursor, callback)) + ClangdClient *client, CppEditorWidget *editorWidget, const QTextCursor &cursor, + const RenameCallback &callback) + : QObject(client), d(new Private(this, editorWidget, cursor, callback)) { d->findDefinition(); } @@ -780,7 +782,7 @@ void ClangdFindLocalReferences::Private::handleReferences(const QList<Location> return loc.toLink(mapper); }; - const Utils::Links links = Utils::transform(references, transformLocation); + Utils::Links links = Utils::transform(references, transformLocation); // The callback only uses the symbol length, so we just create a dummy. // Note that the calculation will be wrong for identifiers with @@ -788,7 +790,27 @@ void ClangdFindLocalReferences::Private::handleReferences(const QList<Location> QString symbol; if (!references.isEmpty()) { const Range r = references.first().range(); - symbol = QString(r.end().character() - r.start().character(), 'x'); + const Position pos = r.start(); + symbol = QString(r.end().character() - pos.character(), 'x'); + if (editorWidget && document) { + QTextCursor cursor(document->document()); + cursor.setPosition(Text::positionInText(document->document(), pos.line() + 1, + pos.character() + 1)); + const QList<Text::Range> occurrencesInComments + = symbolOccurrencesInDeclarationComments(editorWidget, cursor); + for (const Text::Range &range : occurrencesInComments) { + static const auto cmp = [](const Link &l, const Text::Range &r) { + if (l.targetLine < r.begin.line) + return true; + if (l.targetLine > r.begin.line) + return false; + return l.targetColumn < r.begin.column; + }; + const auto it = std::lower_bound(links.begin(), links.end(), range, cmp); + links.emplace(it, links.first().targetFilePath, range.begin.line, + range.begin.column); + } + } } callback(symbol, links, revision); callback = {}; diff --git a/src/plugins/clangcodemodel/clangdfindreferences.h b/src/plugins/clangcodemodel/clangdfindreferences.h index e110b355434..c61afe17a1f 100644 --- a/src/plugins/clangcodemodel/clangdfindreferences.h +++ b/src/plugins/clangcodemodel/clangdfindreferences.h @@ -48,9 +48,9 @@ class ClangdFindLocalReferences : public QObject { Q_OBJECT public: - explicit ClangdFindLocalReferences(ClangdClient *client, TextEditor::TextDocument *document, - const QTextCursor &cursor, - const CppEditor::RenameCallback &callback); + explicit ClangdFindLocalReferences( + ClangdClient *client, CppEditor::CppEditorWidget *editorWidget, const QTextCursor &cursor, + const CppEditor::RenameCallback &callback); ~ClangdFindLocalReferences(); signals: diff --git a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp index e9f37abb4e5..e1bd9114717 100644 --- a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp +++ b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp @@ -309,7 +309,7 @@ void ClangModelManagerSupport::startLocalRenaming(const CursorInEditor &data, { if (ClangdClient * const client = clientForFile(data.filePath()); client && client->reachable()) { - client->findLocalUsages(data.textDocument(), data.cursor(), + client->findLocalUsages(data.editorWidget(), data.cursor(), std::move(renameSymbolsCallback)); return; } diff --git a/src/plugins/clangcodemodel/test/clangdtests.cpp b/src/plugins/clangcodemodel/test/clangdtests.cpp index 54c9bfa7c1d..bfc6d1d4f8d 100644 --- a/src/plugins/clangcodemodel/test/clangdtests.cpp +++ b/src/plugins/clangcodemodel/test/clangdtests.cpp @@ -10,6 +10,7 @@ #include <coreplugin/editormanager/editormanager.h> #include <cplusplus/FindUsages.h> #include <cppeditor/cppcodemodelsettings.h> +#include <cppeditor/cppeditorwidget.h> #include <cppeditor/cpptoolsreuse.h> #include <cppeditor/cpptoolstestcase.h> #include <cppeditor/semantichighlighter.h> @@ -536,6 +537,8 @@ void ClangdTestLocalReferences::test_data() QTest::newRow("overloaded operators arguments from outside") << 171 << 7 << QList<Range>{{171, 6, 1}, {172, 6, 1}, {172, 11, 1}, {173, 6, 1}, {173, 9, 1}}; + QTest::newRow("documented function parameter") << 181 << 32 + << QList<Range>{{177, 10, 6}, {179, 9, 6}, {181, 31, 6}, {183, 6, 6}, {184, 17, 6}}; } void ClangdTestLocalReferences::test() @@ -546,6 +549,11 @@ void ClangdTestLocalReferences::test() TextEditor::TextDocument * const doc = document("references.cpp"); QVERIFY(doc); + const QList<BaseTextEditor *> editors = BaseTextEditor::textEditorsForDocument(doc); + QCOMPARE(editors.size(), 1); + const auto editorWidget = qobject_cast<CppEditor::CppEditorWidget *>( + editors.first()->editorWidget()); + QVERIFY(editorWidget); QTimer timer; timer.setSingleShot(true); @@ -561,7 +569,7 @@ void ClangdTestLocalReferences::test() QTextCursor cursor(doc->document()); const int pos = Text::positionInText(doc->document(), sourceLine, sourceColumn); cursor.setPosition(pos); - client()->findLocalUsages(doc, cursor, std::move(handler)); + client()->findLocalUsages(editorWidget, cursor, std::move(handler)); timer.start(10000); loop.exec(); QVERIFY(timer.isActive()); diff --git a/src/plugins/clangcodemodel/test/data/local-references/references.cpp b/src/plugins/clangcodemodel/test/data/local-references/references.cpp index 32ff1b90753..1c8556581d9 100644 --- a/src/plugins/clangcodemodel/test/data/local-references/references.cpp +++ b/src/plugins/clangcodemodel/test/data/local-references/references.cpp @@ -172,3 +172,14 @@ int testOperator() { vec[n] = n * 100; vec(n, n) = 100; } + +/* + * @param param1 + * @param param2 + * @note param1 and param2 should be the same. + */ +void funcWithParamComments(int param1, int param2) +{ + if (param1 != param2) + param2 = param1; +} diff --git a/src/plugins/coreplugin/find/searchresulttreeitems.cpp b/src/plugins/coreplugin/find/searchresulttreeitems.cpp index 9aa8a765db9..6eafd49615d 100644 --- a/src/plugins/coreplugin/find/searchresulttreeitems.cpp +++ b/src/plugins/coreplugin/find/searchresulttreeitems.cpp @@ -82,9 +82,26 @@ int SearchResultTreeItem::insertionIndex(const QString &text, SearchResultTreeIt } int SearchResultTreeItem::insertionIndex(const Utils::SearchResultItem &item, - SearchResultTreeItem **existingItem) const + SearchResultTreeItem **existingItem, + SearchResult::AddMode mode) const { - return insertionIndex(item.lineText(), existingItem); + switch (mode) { + case SearchResult::AddSortedByContent: + return insertionIndex(item.lineText(), existingItem); + case SearchResult::AddSortedByPosition: + break; + case Core::SearchResult::AddOrdered: + QTC_ASSERT(false, return 0); + } + + static const auto cmp = [](const SearchResultTreeItem *a, const Utils::Text::Position b) { + return a->item.mainRange().begin < b; + }; + const auto insertionPosition = + std::lower_bound(m_children.begin(), m_children.end(), item.mainRange().begin, cmp); + if (existingItem) + *existingItem = nullptr; + return insertionPosition - m_children.begin(); } void SearchResultTreeItem::insertChild(int index, SearchResultTreeItem *child) diff --git a/src/plugins/coreplugin/find/searchresulttreeitems.h b/src/plugins/coreplugin/find/searchresulttreeitems.h index dbbc27d8861..e3ec8aa1eae 100644 --- a/src/plugins/coreplugin/find/searchresulttreeitems.h +++ b/src/plugins/coreplugin/find/searchresulttreeitems.h @@ -21,7 +21,8 @@ public: SearchResultTreeItem *parent() const; SearchResultTreeItem *childAt(int index) const; int insertionIndex(const QString &text, SearchResultTreeItem **existingItem) const; - int insertionIndex(const Utils::SearchResultItem &item, SearchResultTreeItem **existingItem) const; + int insertionIndex(const Utils::SearchResultItem &item, SearchResultTreeItem **existingItem, + SearchResult::AddMode mode) const; void insertChild(int index, SearchResultTreeItem *child); void insertChild(int index, const Utils::SearchResultItem &item); void appendChild(const Utils::SearchResultItem &item); diff --git a/src/plugins/coreplugin/find/searchresulttreemodel.cpp b/src/plugins/coreplugin/find/searchresulttreemodel.cpp index b6d620b80b5..09f16f0453b 100644 --- a/src/plugins/coreplugin/find/searchresulttreemodel.cpp +++ b/src/plugins/coreplugin/find/searchresulttreemodel.cpp @@ -402,10 +402,10 @@ void SearchResultTreeModel::addResultsToCurrentParent(const SearchResultItems &i m_currentParent->appendChild(item); } endInsertRows(); - } else if (mode == SearchResult::AddSorted) { + } else { for (const SearchResultItem &item : items) { SearchResultTreeItem *existingItem; - const int insertionIndex = m_currentParent->insertionIndex(item, &existingItem); + const int insertionIndex = m_currentParent->insertionIndex(item, &existingItem, mode); if (existingItem) { existingItem->setGenerated(false); existingItem->item = item; diff --git a/src/plugins/coreplugin/find/searchresultwidget.cpp b/src/plugins/coreplugin/find/searchresultwidget.cpp index ec2ab2c0f64..06c59d95ecc 100644 --- a/src/plugins/coreplugin/find/searchresultwidget.cpp +++ b/src/plugins/coreplugin/find/searchresultwidget.cpp @@ -478,7 +478,7 @@ void SearchResultWidget::doReplace() { m_infoBar.clear(); setShowReplaceUI(false); - emit replaceButtonClicked(m_replaceTextEdit->text(), checkedItems(), + emit replaceButtonClicked(m_replaceTextEdit->text(), items(true), m_preserveCaseSupported && m_preserveCaseCheck->isChecked()); } @@ -496,7 +496,7 @@ void SearchResultWidget::searchAgain() emit searchAgainRequested(); } -SearchResultItems SearchResultWidget::checkedItems() const +SearchResultItems SearchResultWidget::items(bool checkedOnly) const { SearchResultItems result; SearchResultFilterModel *model = m_searchResultTreeView->model(); @@ -508,7 +508,7 @@ SearchResultItems SearchResultWidget::checkedItems() const const QModelIndex textIndex = model->index(rowIndex, 0, fileIndex); const SearchResultTreeItem * const rowItem = model->itemForIndex(textIndex); QTC_ASSERT(rowItem != nullptr, continue); - if (rowItem->checkState()) + if (!checkedOnly || rowItem->checkState()) result << rowItem->item; } } diff --git a/src/plugins/coreplugin/find/searchresultwidget.h b/src/plugins/coreplugin/find/searchresultwidget.h index 6722af579eb..a9f87c467f1 100644 --- a/src/plugins/coreplugin/find/searchresultwidget.h +++ b/src/plugins/coreplugin/find/searchresultwidget.h @@ -71,6 +71,7 @@ public: bool hasFilter() const; void showFilterWidget(QWidget *parent); void setReplaceEnabled(bool enabled); + Utils::SearchResultItems items(bool checkedOnly) const; public slots: void finishSearch(bool canceled, const QString &reason); @@ -103,7 +104,6 @@ private: void continueAfterSizeWarning(); void cancelAfterSizeWarning(); - Utils::SearchResultItems checkedItems() const; void updateMatchesFoundLabel(); SearchResultTreeView *m_searchResultTreeView = nullptr; diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp index b591d9aa131..2f048f93f34 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.cpp +++ b/src/plugins/coreplugin/find/searchresultwindow.cpp @@ -900,6 +900,11 @@ void Core::SearchResult::makeNonInteractive(const std::function<void ()> &callba m_finishedHandler = callback; } +Utils::SearchResultItems SearchResult::allItems() const +{ + return m_widget->items(false); +} + } // namespace Core #include "searchresultwindow.moc" diff --git a/src/plugins/coreplugin/find/searchresultwindow.h b/src/plugins/coreplugin/find/searchresultwindow.h index eb621ac43f9..0b99269c964 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.h +++ b/src/plugins/coreplugin/find/searchresultwindow.h @@ -43,7 +43,8 @@ class CORE_EXPORT SearchResult : public QObject public: enum AddMode { - AddSorted, + AddSortedByContent, + AddSortedByPosition, AddOrdered }; @@ -57,6 +58,7 @@ public: void setAdditionalReplaceWidget(QWidget *widget); void makeNonInteractive(const std::function<void()> &callback); bool isInteractive() const { return !m_finishedHandler; } + Utils::SearchResultItems allItems() const; public slots: void addResult(const Utils::SearchResultItem &item); diff --git a/src/plugins/cppeditor/cppfindreferences.cpp b/src/plugins/cppeditor/cppfindreferences.cpp index b933a0cde84..a894c3ffe06 100644 --- a/src/plugins/cppeditor/cppfindreferences.cpp +++ b/src/plugins/cppeditor/cppfindreferences.cpp @@ -600,6 +600,10 @@ static void displayResults(SearchResult *search, static void searchFinished(SearchResult *search, QFutureWatcher<CPlusPlus::Usage> *watcher) { + if (!watcher->isCanceled() && search->supportsReplace()) { + search->addResults(symbolOccurrencesInDeclarationComments(search->allItems()), + SearchResult::AddSortedByPosition); + } search->finishSearch(watcher->isCanceled()); CppFindReferencesParameters parameters = search->userData().value<CppFindReferencesParameters>(); diff --git a/src/plugins/cppeditor/cpplocalsymbols.cpp b/src/plugins/cppeditor/cpplocalsymbols.cpp index 66200b3f3dc..3dc93245184 100644 --- a/src/plugins/cppeditor/cpplocalsymbols.cpp +++ b/src/plugins/cppeditor/cpplocalsymbols.cpp @@ -4,8 +4,14 @@ #include "cpplocalsymbols.h" #include "cppsemanticinfo.h" +#include "cpptoolsreuse.h" #include "semantichighlighter.h" +#include <cplusplus/declarationcomments.h> +#include <cplusplus/Overview.h> +#include <texteditor/textdocument.h> +#include <utils/textutils.h> + using namespace CPlusPlus; namespace CppEditor::Internal { @@ -16,7 +22,7 @@ class FindLocalSymbols: protected ASTVisitor { public: explicit FindLocalSymbols(Document::Ptr doc) - : ASTVisitor(doc->translationUnit()) + : ASTVisitor(doc->translationUnit()), _doc(doc) { } // local and external uses. @@ -38,6 +44,42 @@ public: accept(ast); } } + + if (localUses.isEmpty()) + return; + + // Look for parameter occurrences in function comments. + const TextEditor::TextDocument * const editorDoc + = TextEditor::TextDocument::textDocumentForFilePath(_doc->filePath()); + if (!editorDoc) + return; + QTextDocument * const textDoc = editorDoc->document(); + if (!textDoc) + return; + const QString &content = textDoc->toPlainText(); + const QStringView docView(content); + for (auto it = localUses.begin(); it != localUses.end(); ++it) { + Symbol * const symbol = it.key(); + if (!symbol->asArgument()) + continue; + const QList<Token> commentTokens = commentsForDeclaration(symbol, ast, *textDoc, _doc); + if (commentTokens.isEmpty()) + continue; + const QString symbolName = Overview().prettyName(symbol->name()); + for (const Token &tok : commentTokens) { + const int commentPos = translationUnit()->getTokenPositionInDocument(tok, textDoc); + const int commentEndPos = translationUnit()->getTokenEndPositionInDocument( + tok, textDoc); + const QStringView commentView = docView.mid(commentPos, commentEndPos - commentPos); + const QList<Utils::Text::Range> ranges = symbolOccurrencesInText( + *textDoc, commentView, commentPos, symbolName); + for (const Utils::Text::Range &range : ranges) { + it.value().append(HighlightingResult(range.begin.line, range.begin.column + 1, + symbolName.size(), + SemanticHighlighter::LocalUse)); + } + } + } } protected: @@ -275,6 +317,7 @@ protected: private: QList<Scope *> _scopeStack; + Document::Ptr _doc; }; } // end of anonymous namespace diff --git a/src/plugins/cppeditor/cpprenaming_test.cpp b/src/plugins/cppeditor/cpprenaming_test.cpp index d1b9a9891df..2827434be55 100644 --- a/src/plugins/cppeditor/cpprenaming_test.cpp +++ b/src/plugins/cppeditor/cpprenaming_test.cpp @@ -82,19 +82,19 @@ void MyClass::run() {} origHeaderClassName.insert(classOffset + 6, '@'); const QByteArray newHeaderClassName = R"cpp( /** - * \brief MyClass + * \brief MyNewClass */ class MyNewClass { - /** \brief MyClass::MyClass */ + /** \brief MyNewClass::MyNewClass */ MyNewClass() {} ~MyNewClass(); - /** \brief MyClass::run */ + /** \brief MyNewClass::run */ void run(); }; )cpp"; const QByteArray newSourceClassName = R"cpp( #include "file.h" -/** \brief MyClass::~MyClass */ +/** \brief MyNewClass::~MyNewClass */ MyNewClass::~MyNewClass() {} void MyNewClass::run() {} @@ -115,7 +115,7 @@ class MyClass { /** \brief MyClass::MyClass */ MyClass() {} ~MyClass(); - /** \brief MyClass::run */ + /** \brief MyClass::runAgain */ void runAgain(); }; )cpp"; diff --git a/src/plugins/cppeditor/cpptoolsreuse.cpp b/src/plugins/cppeditor/cpptoolsreuse.cpp index 325aa8bb249..c098aca99c8 100644 --- a/src/plugins/cppeditor/cpptoolsreuse.cpp +++ b/src/plugins/cppeditor/cpptoolsreuse.cpp @@ -5,10 +5,12 @@ #include "clangdiagnosticconfigsmodel.h" #include "cppautocompleter.h" +#include "cppcanonicalsymbol.h" #include "cppcodemodelsettings.h" #include "cppcompletionassist.h" #include "cppeditorconstants.h" #include "cppeditorplugin.h" +#include "cppeditorwidget.h" #include "cppeditortr.h" #include "cppfilesettingspage.h" #include "cpphighlighter.h" @@ -28,20 +30,27 @@ #include <texteditor/textdocument.h> #include <cplusplus/BackwardsScanner.h> +#include <cplusplus/declarationcomments.h> #include <cplusplus/LookupContext.h> #include <cplusplus/Overview.h> #include <cplusplus/SimpleLexer.h> #include <utils/algorithm.h> -#include <utils/textutils.h> #include <utils/qtcassert.h> +#include <utils/textfileformat.h> +#include <utils/textutils.h> #include <QDebug> +#include <QElapsedTimer> +#include <QHash> #include <QRegularExpression> #include <QSet> +#include <QStringView> #include <QTextCursor> #include <QTextDocument> +#include <vector> + using namespace CPlusPlus; using namespace Utils; @@ -626,6 +635,200 @@ QString preferredCxxSourceSuffix(ProjectExplorer::Project *project) return Internal::CppEditorPlugin::fileSettings(project).sourceSuffix; } +SearchResultItems symbolOccurrencesInDeclarationComments( + const Utils::SearchResultItems &symbolOccurrencesInCode) +{ + if (symbolOccurrencesInCode.isEmpty()) + return {}; + + // When using clangd, this function gets called every time the replacement string changes, + // so cache the results. + static QHash<SearchResultItems, SearchResultItems> resultCache; + if (const auto it = resultCache.constFind(symbolOccurrencesInCode); + it != resultCache.constEnd()) { + return it.value(); + } + if (resultCache.size() > 5) + resultCache.clear(); + + QElapsedTimer timer; + timer.start(); + Snapshot snapshot = CppModelManager::snapshot(); + std::vector<std::unique_ptr<QTextDocument>> docPool; + using FileData = std::tuple<QTextDocument *, QString, Document::Ptr, QList<Token>>; + QHash<FilePath, FileData> dataPerFile; + QString symbolName; + const auto fileData = [&](const FilePath &filePath) -> FileData & { + auto &data = dataPerFile[filePath]; + auto &[doc, content, cppDoc, allCommentTokens] = data; + if (!doc) { + if (TextEditor::TextDocument * const textDoc + = TextEditor::TextDocument::textDocumentForFilePath(filePath)) { + doc = textDoc->document(); + } else { + std::unique_ptr<QTextDocument> newDoc = std::make_unique<QTextDocument>(); + if (const auto content = TextFileFormat::readFile( + filePath, Core::EditorManager::defaultTextCodec())) { + newDoc->setPlainText(content.value()); + } + doc = newDoc.get(); + docPool.push_back(std::move(newDoc)); + } + content = doc->toPlainText(); + cppDoc = snapshot.preprocessedDocument(content.toUtf8(), filePath); + cppDoc->check(); + } + return data; + }; + static const auto addToken = [](QList<Token> &tokens, const Token &tok) { + if (!Utils::contains(tokens, [&tok](const Token &t) { + return t.byteOffset == tok.byteOffset; })) { + tokens << tok; + } + }; + + // Collect comment blocks associated with replace locations. + Symbol *canonicalSymbol = nullptr; + for (const SearchResultItem &item : symbolOccurrencesInCode) { + const FilePath filePath = FilePath::fromUserInput(item.path().last()); + auto &[doc, content, cppDoc, allCommentTokens] = fileData(filePath); + const Text::Range &range = item.mainRange(); + if (symbolName.isEmpty()) { + const int symbolStartPos = Utils::Text::positionInText(doc, range.begin.line, + range.begin.column + 1); + const int symbolEndPos = Utils::Text::positionInText(doc, range.end.line, + range.end.column + 1); + symbolName = content.mid(symbolStartPos, symbolEndPos - symbolStartPos); + } + const QList<Token> commentTokens = commentsForDeclaration(symbolName, range.begin, + *doc, cppDoc); + for (const Token &tok : commentTokens) + addToken(allCommentTokens, tok); + + if (!canonicalSymbol) { + QTextCursor cursor(doc); + cursor.setPosition(Text::positionInText(doc, range.begin.line, range.begin.column + 1)); + canonicalSymbol = Internal::CanonicalSymbol(cppDoc, snapshot)(cursor); + } + + // We hook in between the end of the "regular" search and (possibly non-interactive) + // actions on it, so we must run synchronously in the UI thread and therefore be fast. + // If we notice we are lagging, just abort, as renaming the comments is not + // required for code correctness. + if (timer.elapsed() > 1000) { + resultCache.insert(symbolOccurrencesInCode, {}); + return {}; + } + } + + // If the symbol is a class, collect all comment blocks in the class body. + if (Class * const klass = canonicalSymbol ? canonicalSymbol->asClass() : nullptr) { + auto &[_1, _2, symbolCppDoc, commentTokens] = fileData(canonicalSymbol->filePath()); + TranslationUnit * const tu = symbolCppDoc->translationUnit(); + for (int i = 0; i < tu->commentCount(); ++i) { + const Token &tok = tu->commentAt(i); + if (tok.bytesBegin() < klass->startOffset()) + continue; + if (tok.bytesBegin() >= klass->endOffset()) + break; + addToken(commentTokens, tok); + } + } + + // Create new replace items for occurrences of the symbol name in collected comment blocks. + SearchResultItems commentItems; + for (auto it = dataPerFile.cbegin(); it != dataPerFile.cend(); ++it) { + const auto &[doc, content, cppDoc, commentTokens] = it.value(); + const QStringView docView(content); + for (const Token &tok : commentTokens) { + const int tokenStartPos = cppDoc->translationUnit()->getTokenPositionInDocument( + tok, doc); + const int tokenEndPos = cppDoc->translationUnit()->getTokenEndPositionInDocument( + tok, doc); + const QStringView tokenView = docView.mid(tokenStartPos, tokenEndPos - tokenStartPos); + const QList<Text::Range> ranges = symbolOccurrencesInText( + *doc, tokenView, tokenStartPos, symbolName); + for (const Text::Range &range : ranges) { + SearchResultItem item; + item.setUseTextEditorFont(true); + item.setFilePath(it.key()); + item.setMainRange(range); + item.setLineText(doc->findBlockByNumber(range.begin.line - 1).text()); + commentItems << item; + } + } + } + + resultCache.insert(symbolOccurrencesInCode, commentItems); + return commentItems; +} + +QList<Text::Range> symbolOccurrencesInText(const QTextDocument &doc, QStringView text, int offset, + const QString &symbolName) +{ + QList<Text::Range> ranges; + int index = 0; + while (true) { + index = text.indexOf(symbolName, index); + if (index == -1) + break; + + // Prevent substring matching. + const auto checkAdjacent = [&](int i) { + if (i == -1 || i == text.size()) + return true; + const QChar c = text.at(i); + if (c.isLetterOrNumber() || c == '_') { + index += symbolName.length(); + return false; + } + return true; + }; + if (!checkAdjacent(index - 1)) + continue; + if (!checkAdjacent(index + symbolName.length())) + continue; + + const Text::Position startPos = Text::Position::fromPositionInDocument(&doc, offset + index); + index += symbolName.length(); + const Text::Position endPos = Text::Position::fromPositionInDocument(&doc, offset + index); + ranges << Text::Range{startPos, endPos}; + } + return ranges; +} + +QList<Text::Range> symbolOccurrencesInDeclarationComments(CppEditorWidget *editorWidget, + const QTextCursor &cursor) +{ + if (!editorWidget) + return {}; + const SemanticInfo &semanticInfo = editorWidget->semanticInfo(); + const Document::Ptr &cppDoc = semanticInfo.doc; + if (!cppDoc) + return {}; + const Symbol * const symbol = Internal::CanonicalSymbol(cppDoc, semanticInfo.snapshot)(cursor); + if (!symbol || !symbol->asArgument()) + return {}; + const QTextDocument * const textDoc = editorWidget->textDocument()->document(); + QTC_ASSERT(textDoc, return {}); + const QList<Token> comments = commentsForDeclaration(symbol, *textDoc, cppDoc); + if (comments.isEmpty()) + return {}; + QList<Text::Range> ranges; + const QString &content = textDoc->toPlainText(); + const QStringView docView = QStringView(content); + const QString symbolName = Overview().prettyName(symbol->name()); + for (const Token &tok : comments) { + const int tokenStartPos = cppDoc->translationUnit()->getTokenPositionInDocument( + tok, textDoc); + const int tokenEndPos = cppDoc->translationUnit()->getTokenEndPositionInDocument( + tok, textDoc); + const QStringView tokenView = docView.mid(tokenStartPos, tokenEndPos - tokenStartPos); + ranges << symbolOccurrencesInText(*textDoc, tokenView, tokenStartPos, symbolName); + } + return ranges; +} + namespace Internal { void decorateCppEditor(TextEditor::TextEditorWidget *editor) diff --git a/src/plugins/cppeditor/cpptoolsreuse.h b/src/plugins/cppeditor/cpptoolsreuse.h index 78d158b5764..fc90b900a24 100644 --- a/src/plugins/cppeditor/cpptoolsreuse.h +++ b/src/plugins/cppeditor/cpptoolsreuse.h @@ -12,6 +12,8 @@ #include <texteditor/quickfix.h> #include <texteditor/texteditor.h> +#include <utils/searchresultitem.h> + #include <cplusplus/ASTVisitor.h> #include <cplusplus/CppDocument.h> #include <cplusplus/Token.h> @@ -23,9 +25,10 @@ class LookupContext; } // namespace CPlusPlus namespace TextEditor { class AssistInterface; } +namespace Utils { namespace Text { class Range; } } namespace CppEditor { - +class CppEditorWidget; class CppRefactoringFile; class ProjectInfo; class CppCompletionAssistProcessor; @@ -71,6 +74,14 @@ QString CPPEDITOR_EXPORT preferredCxxHeaderSuffix(ProjectExplorer::Project *proj QString CPPEDITOR_EXPORT preferredCxxSourceSuffix(ProjectExplorer::Project *project); bool CPPEDITOR_EXPORT preferLowerCaseFileNames(ProjectExplorer::Project *project); + +QList<Utils::Text::Range> CPPEDITOR_EXPORT symbolOccurrencesInText( + const QTextDocument &doc, QStringView text, int offset, const QString &symbolName); +Utils::SearchResultItems CPPEDITOR_EXPORT +symbolOccurrencesInDeclarationComments(const Utils::SearchResultItems &symbolOccurrencesInCode); +QList<Utils::Text::Range> CPPEDITOR_EXPORT symbolOccurrencesInDeclarationComments( + CppEditorWidget *editorWidget, const QTextCursor &cursor); + UsePrecompiledHeaders CPPEDITOR_EXPORT getPchUsage(); int indexerFileSizeLimitInMb(); diff --git a/src/plugins/cppeditor/symbolsfindfilter.cpp b/src/plugins/cppeditor/symbolsfindfilter.cpp index bf1158c414f..ef067876825 100644 --- a/src/plugins/cppeditor/symbolsfindfilter.cpp +++ b/src/plugins/cppeditor/symbolsfindfilter.cpp @@ -138,7 +138,7 @@ void SymbolsFindFilter::addResults(QFutureWatcher<SearchResultItem> *watcher, in SearchResultItems items; for (int i = begin; i < end; ++i) items << watcher->resultAt(i); - search->addResults(items, SearchResult::AddSorted); + search->addResults(items, SearchResult::AddSortedByContent); } void SymbolsFindFilter::finish(QFutureWatcher<SearchResultItem> *watcher) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 444d0d7589b..13f51d2cde9 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -848,7 +848,7 @@ void ClientPrivate::requestDocumentHighlightsNow(TextEditor::TextEditorWidget *w q->cancelRequest(m_highlightRequests.take(widget)); }); request.setResponseCallback( - [widget, this, uri, connection] + [widget, this, uri, connection, adjustedCursor] (const DocumentHighlightsRequest::Response &response) { m_highlightRequests.remove(widget); @@ -874,6 +874,30 @@ void ClientPrivate::requestDocumentHighlightsNow(TextEditor::TextEditorWidget *w selection.cursor.setPosition(end, QTextCursor::KeepAnchor); selections << selection; } + if (!selections.isEmpty()) { + const QList<Text::Range> extraRanges = q->additionalDocumentHighlights( + widget, adjustedCursor); + for (const Text::Range &range : extraRanges) { + QTextEdit::ExtraSelection selection{widget->textCursor(), format}; + const Text::Position &startPos = range.begin; + const Text::Position &endPos = range.end; + const int start = Text::positionInText(document, startPos.line, + startPos.column + 1); + const int end = Text::positionInText(document, endPos.line, + endPos.column + 1); + if (start < 0 || end < 0 || start >= end) + continue; + selection.cursor.setPosition(start); + selection.cursor.setPosition(end, QTextCursor::KeepAnchor); + static const auto cmp = [](const QTextEdit::ExtraSelection &s1, + const QTextEdit::ExtraSelection &s2) { + return s1.cursor.position() < s2.cursor.position(); + }; + const auto it = std::lower_bound(selections.begin(), selections.end(), + selection, cmp); + selections.insert(it, selection); + } + } widget->setExtraSelections(id, selections); }); m_highlightRequests[widget] = request.id(); diff --git a/src/plugins/languageclient/client.h b/src/plugins/languageclient/client.h index f0c071c2a1f..8aede4b249d 100644 --- a/src/plugins/languageclient/client.h +++ b/src/plugins/languageclient/client.h @@ -16,6 +16,8 @@ class TextDocument; class TextEditorWidget; } +namespace Utils { namespace Text { class Range; } } + QT_BEGIN_NAMESPACE class QWidget; QT_END_NAMESPACE @@ -226,6 +228,8 @@ private: TextEditor::TextDocument *doc); virtual bool referencesShadowFile(const TextEditor::TextDocument *doc, const Utils::FilePath &candidate); + virtual QList<Utils::Text::Range> additionalDocumentHighlights( + TextEditor::TextEditorWidget *, const QTextCursor &) { return {}; } }; } // namespace LanguageClient diff --git a/src/plugins/languageclient/languageclientsymbolsupport.cpp b/src/plugins/languageclient/languageclientsymbolsupport.cpp index 4ef534d7f3e..b6ac1bdb307 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.cpp +++ b/src/plugins/languageclient/languageclientsymbolsupport.cpp @@ -563,11 +563,22 @@ void SymbolSupport::handleRenameResponse(Core::SearchResult *search, const std::optional<WorkspaceEdit> &edits = response.result(); if (edits.has_value()) { - search->addResults(generateReplaceItems(*edits, - search, - m_limitRenamingToProjects, - m_client->hostPathMapper()), - Core::SearchResult::AddOrdered); + const Utils::SearchResultItems items = generateReplaceItems( + *edits, search, m_limitRenamingToProjects, m_client->hostPathMapper()); + search->addResults(items, Core::SearchResult::AddOrdered); + if (m_renameResultsEnhancer) { + Utils::SearchResultItems additionalItems = m_renameResultsEnhancer(items); + for (Utils::SearchResultItem &item : additionalItems) { + TextEdit edit; + const Utils::Text::Position startPos = item.mainRange().begin; + const Utils::Text::Position endPos = item.mainRange().end; + edit.setRange({{startPos.line - 1, startPos.column}, + {endPos.line - 1, endPos.column}}); + edit.setNewText(search->textToReplace()); + item.setUserData(QVariant(edit)); + } + search->addResults(additionalItems, Core::SearchResult::AddSortedByPosition); + } qobject_cast<ReplaceWidget *>(search->additionalReplaceWidget())->showLabel(false); search->setReplaceEnabled(true); search->finishSearch(false); @@ -634,6 +645,11 @@ void SymbolSupport::setDefaultRenamingSymbolMapper(const SymbolMapper &mapper) m_defaultSymbolMapper = mapper; } +void SymbolSupport::setRenameResultsEnhancer(const RenameResultsEnhancer &enhancer) +{ + m_renameResultsEnhancer = enhancer; +} + } // namespace LanguageClient #include <languageclientsymbolsupport.moc> diff --git a/src/plugins/languageclient/languageclientsymbolsupport.h b/src/plugins/languageclient/languageclientsymbolsupport.h index a26c36e7ede..54666e7b1f9 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.h +++ b/src/plugins/languageclient/languageclientsymbolsupport.h @@ -51,6 +51,9 @@ public: void setLimitRenamingToProjects(bool limit) { m_limitRenamingToProjects = limit; } + using RenameResultsEnhancer = std::function<Utils::SearchResultItems(const Utils::SearchResultItems &)>; + void setRenameResultsEnhancer(const RenameResultsEnhancer &enhancer); + private: void handleFindReferencesResponse( const LanguageServerProtocol::FindReferencesRequest::Response &response, @@ -78,6 +81,7 @@ private: Client *m_client = nullptr; SymbolMapper m_defaultSymbolMapper; + RenameResultsEnhancer m_renameResultsEnhancer; QHash<Core::SearchResult *, LanguageServerProtocol::MessageId> m_renameRequestIds; bool m_limitRenamingToProjects = false; }; diff --git a/tests/auto/cplusplus/declarationcomments/tst_declarationcomments.cpp b/tests/auto/cplusplus/declarationcomments/tst_declarationcomments.cpp index 0a92cfbbd61..27caff6c451 100644 --- a/tests/auto/cplusplus/declarationcomments/tst_declarationcomments.cpp +++ b/tests/auto/cplusplus/declarationcomments/tst_declarationcomments.cpp @@ -155,7 +155,7 @@ void TestDeclarationComments::commentsForDecl() const Symbol * const symbol = finder.find(); QVERIFY(symbol); - const QList<Token> commentTokens = commentsForDeclaration(symbol, m_snapshot, m_textDoc); + const QList<Token> commentTokens = commentsForDeclaration(symbol, m_textDoc, m_cppDoc); if (expectedCommentPrefix.isEmpty()) { QVERIFY(commentTokens.isEmpty()); return; From 3beaa29e29219ecf4e3a76c3ccc50bd56d66c0e0 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 1 Sep 2023 13:40:11 +0200 Subject: [PATCH 0963/1777] Doc: Mark "Integrating Wizards into Builds" as developer info - Users should place their custom wizards in the local user's settings directory, whereas developers should add them to the sources to include them in builds. - Remove information about qmake because building Qt Creator with qmake is no longer supported. Change-Id: I5e65ce8128dea0d35a21eee08a1548a3060c5e9c Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- ...eator-projects-custom-wizards-json.qdocinc | 21 ++++++++++--------- .../creator-projects-custom-wizards.qdoc | 7 ++++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc index 8ffcff60f28..852bfeb2461 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc @@ -5,21 +5,22 @@ //! [json wizards] \section1 Integrating Wizards into Builds - To integrate the wizard into \QC and to deliver it as part of the \QC build, - place the wizard files in the \QC sources. Then select \uicontrol Build > - \uicontrol {Run CMake} or \uicontrol {Run qmake}, depending on the build - system you use. This ensures that the new files you added for your wizard are - actually copied from the \QC source directory into the \QC build directory + If you are a \QC developer or build your own \QC version for delivery to + others, you can integrate the wizard into \QC. To deliver the wizard as + part of the \QC build, place the wizard files in the shared directory in + the \QC sources. Then select \uicontrol Build > \uicontrol {Run CMake}. + This ensures that the new files you added for your wizard are actually + copied from the \QC source directory into the \QC build directory as part of the next \QC build. - If you do not run CMake or qmake, your new wizard will not show up because + If you do not run CMake, your new wizard will not show up because it does not exist in the build directory you run your newly built \QC from. - It never got copied there because CMake or qmake did not inform the - build tool, such as make or ninja, about the new files in the source tree. + It never got copied there because CMake did not inform the + build tool, such as make or Ninja, about the new files in the source tree. - Basically, CMake and qmake generate a fixed list of files to copy from the + Basically, CMake generates a fixed list of files to copy from the source directory to the subdirectory of the build directory that is checked - for wizards at runtime. Therefore, you need to run CMake or qmake or execute + for wizards at runtime. Therefore, you need to run CMake or execute the \uicontrol {Factory.Reset} function each time the names or locations of the files change. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc index 67c0c3d91a1..6e1b2c6861d 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc @@ -27,9 +27,10 @@ has sections that specify information about the wizard, variables that you can use, wizard pages, and generators for creating files. - To create a customized wizard, copy a template directory to the shared - directory or the local user's settings directory under a new name. Then - change the wizard id in the \c {wizard.json} file. + To create a customized wizard, copy a template directory to the + \c {templates/wizards/} directory in the local user's settings + directory under a new name. Then change the wizard id in the + \c {wizard.json} file. You can create a subdirectory for the templates in the settings directory. \QC organizes the standard wizards into subdirectories by type, but you can From 05fac26dc9952403f4c40d8e9ce5704c5ebcdece Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 31 Aug 2023 15:37:26 +0200 Subject: [PATCH 0964/1777] DAP: Set last chosen preset Set last activated item in ModelChooser when the debugging is ended. It sets the last chosen preset in debuger menu. It is needed for DAP debugger because it has several presets. Note: Logic should be improved or DAP debugger presets should be combined in one. Change-Id: I043d2fe17ec847db287ee246e1fb4455b3b6d727 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/enginemanager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/debugger/enginemanager.cpp b/src/plugins/debugger/enginemanager.cpp index 5b6fb74ac49..4656f15cb30 100644 --- a/src/plugins/debugger/enginemanager.cpp +++ b/src/plugins/debugger/enginemanager.cpp @@ -143,6 +143,11 @@ public: connect(m_engineChooser, &QComboBox::activated, this, [this](int index) { QModelIndex sourceIndex = m_proxyModel->mapToSource(m_proxyModel->index(index, 0)); emit activated(sourceIndex.row()); + m_lastActivatedIndex = sourceIndex.row(); + }); + + connect(m_proxyModel, &QAbstractItemModel::rowsRemoved, this, [this] { + setCurrentIndex(m_lastActivatedIndex); }); } @@ -188,6 +193,7 @@ private: QPointer<EngineTypeFilterProxyModel> m_proxyModel; QAbstractItemModel *m_sourceModel; QString m_enginType; + int m_lastActivatedIndex = -1; }; struct PerspectiveItem From aac9990180c3cb712bd84c3ccea77d6fbf63e705 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 31 Aug 2023 14:48:44 +0200 Subject: [PATCH 0965/1777] DAP: Add info bar install debugpy Change-Id: Ib1e8ffc445a4bda18d011101b3c84447a2e4f89e Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/debugger/dap/pydapengine.cpp | 61 ++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index 2a263644c24..d4eae2ea47a 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -6,9 +6,13 @@ #include "dapclient.h" #include <coreplugin/messagemanager.h> +#include <coreplugin/icore.h> #include <debugger/debuggermainwindow.h> +#include <debugger/debuggertr.h> +#include <utils/async.h> +#include <utils/infobar.h> #include <utils/temporarydirectory.h> #include <projectexplorer/buildconfiguration.h> @@ -28,6 +32,25 @@ static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg) namespace Debugger::Internal { + +const char installDebugPyInfoBarId[] = "Python::InstallDebugPy"; + +static bool missingPySideInstallation(const FilePath &pythonPath, const QString &packageName) +{ + QTC_ASSERT(!packageName.isEmpty(), return false); + static QMap<FilePath, QSet<QString>> pythonWithPyside; + if (pythonWithPyside[pythonPath].contains(packageName)) + return false; + + Process pythonProcess; + pythonProcess.setCommand({pythonPath, {"-c", "import " + packageName}}); + pythonProcess.runBlocking(); + const bool missing = pythonProcess.result() != ProcessResult::FinishedWithSuccess; + if (!missing) + pythonWithPyside[pythonPath].insert(packageName); + return missing; +} + class TcpSocketDataProvider : public IDataProvider { public: @@ -154,6 +177,24 @@ void PyDapEngine::handleDapInitialize() qCDebug(dapEngineLog) << "handleDapAttach"; } +void installDebugpyPackage(const FilePath &pythonPath) +{ + CommandLine cmd{pythonPath, {"-m", "pip", "install", "debugpy"}}; + Process process; + process.setCommand(cmd); + + QObject::connect(&process, &Process::textOnStandardError, [](const QString &text) { + MessageManager::writeSilently("Python debugger: debugpy package installation failed" + text); + }); + + QObject::connect(&process, &Process::done, []() { + MessageManager::writeSilently("Python debugger: debugpy package installed."); + }); + + process.start(); + process.waitForFinished(); +} + void PyDapEngine::setupEngine() { QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); @@ -165,6 +206,26 @@ void PyDapEngine::setupEngine() MessageManager::writeDisrupting( "Python Error" + QString("Cannot open script file %1").arg(scriptFile.toUserOutput())); notifyEngineSetupFailed(); + return; + } + + if (missingPySideInstallation(interpreter, "debugpy")) { + Utils::InfoBarEntry + info(installDebugPyInfoBarId, + Tr::tr( + "Python Debugging Support is not available. Please install debugpy package."), + Utils::InfoBarEntry::GlobalSuppression::Enabled); + info.addCustomButton(Tr::tr("Install debugpy"), [this] { + Core::ICore::infoBar()->removeInfo(installDebugPyInfoBarId); + Core::ICore::infoBar()->globallySuppressInfo(installDebugPyInfoBarId); + QTimer::singleShot(0, this, [interpreter = runParameters().interpreter] { + Utils::asyncRun(&installDebugpyPackage, interpreter); + }); + }); + Core::ICore::infoBar()->addInfo(info); + + notifyEngineSetupFailed(); + return; } CommandLine cmd{interpreter, From 10430d36ffef34142a44c92314d3a1ee160f6e67 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 31 Aug 2023 19:25:59 +0200 Subject: [PATCH 0966/1777] TaskTree: Add static asserts to onStorage{Setup,Done} handlers Require const reference for onStorageDone() handler. Change-Id: Iad333c04a78962a3361635900027bd4d41abc319 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/libs/solutions/tasking/tasktree.h | 10 ++++++++++ tests/auto/solutions/tasking/tst_tasking.cpp | 8 +++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h index 32252bcc83b..5e1226eb2c4 100644 --- a/src/libs/solutions/tasking/tasktree.h +++ b/src/libs/solutions/tasking/tasktree.h @@ -413,11 +413,21 @@ public: template <typename StorageStruct, typename StorageHandler> void onStorageSetup(const TreeStorage<StorageStruct> &storage, StorageHandler &&handler) { + constexpr bool isInvokable = std::is_invocable_v<std::decay_t<StorageHandler>, + StorageStruct &>; + static_assert(isInvokable, + "Storage setup handler needs to take (Storage &) as an argument. " + "The passed handler doesn't fulfill these requirements."); setupStorageHandler(storage, wrapHandler<StorageStruct>(std::forward<StorageHandler>(handler)), {}); } template <typename StorageStruct, typename StorageHandler> void onStorageDone(const TreeStorage<StorageStruct> &storage, StorageHandler &&handler) { + constexpr bool isInvokable = std::is_invocable_v<std::decay_t<StorageHandler>, + const StorageStruct &>; + static_assert(isInvokable, + "Storage done handler needs to take (const Storage &) as an argument. " + "The passed handler doesn't fulfill these requirements."); setupStorageHandler(storage, {}, wrapHandler<StorageStruct>(std::forward<StorageHandler>(handler))); } diff --git a/tests/auto/solutions/tasking/tst_tasking.cpp b/tests/auto/solutions/tasking/tst_tasking.cpp index 63302c6dc31..57d95a5f4de 100644 --- a/tests/auto/solutions/tasking/tst_tasking.cpp +++ b/tests/auto/solutions/tasking/tst_tasking.cpp @@ -550,7 +550,7 @@ void tst_Tasking::testTree_data() }; taskTree.setRecipe(nestedRoot); CustomStorage *activeStorage = storage.activeStorage(); - const auto collectSubLog = [activeStorage](CustomStorage &subTreeStorage){ + const auto collectSubLog = [activeStorage](const CustomStorage &subTreeStorage){ activeStorage->m_log += subTreeStorage.m_log; }; taskTree.onStorageDone(storage, collectSubLog); @@ -2244,7 +2244,9 @@ void tst_Tasking::testTree() TaskTree taskTree({testData.root.withTimeout(1000ms)}); QCOMPARE(taskTree.taskCount() - 1, testData.taskCount); // -1 for the timeout task above Log actualLog; - const auto collectLog = [&actualLog](CustomStorage &storage) { actualLog = storage.m_log; }; + const auto collectLog = [&actualLog](const CustomStorage &storage) { + actualLog = storage.m_log; + }; taskTree.onStorageDone(testData.storage, collectLog); const OnDone result = taskTree.runBlocking() ? OnDone::Success : OnDone::Failure; QCOMPARE(taskTree.isRunning(), false); @@ -2278,7 +2280,7 @@ void tst_Tasking::storageDestructor() setupCalled = true; }; bool doneCalled = false; - const auto doneHandler = [&doneCalled](CustomStorage &) { + const auto doneHandler = [&doneCalled](const CustomStorage &) { doneCalled = true; }; QCOMPARE(CustomStorage::instanceCount(), 0); From 8eed7c126af2b5e1e4809bbfd592843af4feba5c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 31 Aug 2023 18:41:16 +0200 Subject: [PATCH 0967/1777] TaskTree: Adapt docs for onStorage{Setup,Done} handlers Change-Id: I3dcd6dce573b23914952c30b935e6ddaa59d9c19 Reviewed-by: hjk <hjk@qt.io> --- src/libs/solutions/tasking/tasktree.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/libs/solutions/tasking/tasktree.cpp b/src/libs/solutions/tasking/tasktree.cpp index 503110497dd..029d90b27d4 100644 --- a/src/libs/solutions/tasking/tasktree.cpp +++ b/src/libs/solutions/tasking/tasktree.cpp @@ -2110,8 +2110,8 @@ void TaskNode::invokeEndHandler(bool success) TreeStorage<CopyStorage> storage; const Group root = ...; // storage placed inside root's group and inside handlers TaskTree taskTree(root); - auto initStorage = [](CopyStorage *storage){ - storage->content = "initial content"; + auto initStorage = [](CopyStorage &storage){ + storage.content = "initial content"; }; taskTree.onStorageSetup(storage, initStorage); taskTree.start(); @@ -2130,8 +2130,8 @@ void TaskNode::invokeEndHandler(bool success) TreeStorage<CopyStorage> storage; const Group root = ...; // storage placed inside root's group and inside handlers TaskTree taskTree(root); - auto collectStorage = [](CopyStorage *storage){ - qDebug() << "final content" << storage->content; + auto collectStorage = [](const CopyStorage &storage){ + qDebug() << "final content" << storage.content; }; taskTree.onStorageDone(storage, collectStorage); taskTree.start(); @@ -2529,7 +2529,7 @@ int TaskTree::progressValue() const Installs a storage setup \a handler for the \a storage to pass the initial data dynamically to the running task tree. - The \c StorageHandler takes the pointer to the \c StorageStruct instance: + The \c StorageHandler takes a reference to the \c StorageStruct instance: \code static void save(const QString &fileName, const QByteArray &array) { ... } @@ -2546,8 +2546,8 @@ int TaskTree::progressValue() const }; TaskTree taskTree(root); - auto initStorage = [](QByteArray *storage){ - *storage = "initial content"; + auto initStorage = [](QByteArray &storage){ + storage = "initial content"; }; taskTree.onStorageSetup(storage, initStorage); taskTree.start(); @@ -2567,10 +2567,10 @@ int TaskTree::progressValue() const /*! \fn template <typename StorageStruct, typename StorageHandler> void TaskTree::onStorageDone(const TreeStorage<StorageStruct> &storage, StorageHandler &&handler) - Installs a storage done \a handler for the \a storage to retrie the final data + Installs a storage done \a handler for the \a storage to retrieve the final data dynamically from the running task tree. - The \c StorageHandler takes the pointer to the \c StorageStruct instance: + The \c StorageHandler takes a const reference to the \c StorageStruct instance: \code static QByteArray load(const QString &fileName) { ... } @@ -2590,8 +2590,8 @@ int TaskTree::progressValue() const }; TaskTree taskTree(root); - auto collectStorage = [](QByteArray *storage){ - qDebug() << "final content" << *storage; + auto collectStorage = [](const QByteArray &storage){ + qDebug() << "final content" << storage; }; taskTree.onStorageDone(storage, collectStorage); taskTree.start(); From b8bd57adb78efebf2da0a31b4b0988278d0fca04 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 31 Aug 2023 19:32:03 +0200 Subject: [PATCH 0968/1777] TaskTree test: Remove unused static variable Change-Id: Idaf2e4bc07d439f2de5a353929f7df8bd08da67f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- tests/auto/solutions/tasking/tst_tasking.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/solutions/tasking/tst_tasking.cpp b/tests/auto/solutions/tasking/tst_tasking.cpp index 57d95a5f4de..707e1f1b42d 100644 --- a/tests/auto/solutions/tasking/tst_tasking.cpp +++ b/tests/auto/solutions/tasking/tst_tasking.cpp @@ -50,7 +50,6 @@ private: }; int CustomStorage::s_count = 0; -static const char s_taskIdProperty[] = "__taskId"; struct TestData { TreeStorage<CustomStorage> storage; From 6f50addc1cf7e61604d1adb500288700ab59df86 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 31 Aug 2023 20:10:31 +0200 Subject: [PATCH 0969/1777] TaskTree: Add a test for Storage input/output StorageIO struct serves for an input/output interface to the recipe. This makes the recipe even more universal and reusable. Change-Id: Ifbd27452d2838e890eadb5e72e7e7c934c4ba840 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- tests/auto/solutions/tasking/tst_tasking.cpp | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/auto/solutions/tasking/tst_tasking.cpp b/tests/auto/solutions/tasking/tst_tasking.cpp index 707e1f1b42d..cd476670c8f 100644 --- a/tests/auto/solutions/tasking/tst_tasking.cpp +++ b/tests/auto/solutions/tasking/tst_tasking.cpp @@ -67,6 +67,8 @@ private slots: void validConstructs(); // compile test void testTree_data(); void testTree(); + void storageIO_data(); + void storageIO(); void storageOperators(); void storageDestructor(); }; @@ -2257,6 +2259,52 @@ void tst_Tasking::testTree() QCOMPARE(result, testData.onDone); } +struct StorageIO +{ + int value = 0; +}; + +static Group inputOutputRecipe(const TreeStorage<StorageIO> &storage) +{ + return Group { + Storage(storage), + onGroupSetup([storage] { ++storage->value; }), + onGroupDone([storage] { storage->value *= 2; }) + }; +} + +void tst_Tasking::storageIO_data() +{ + QTest::addColumn<int>("input"); + QTest::addColumn<int>("output"); + + QTest::newRow("-1 -> 0") << -1 << 0; + QTest::newRow("0 -> 2") << 0 << 2; + QTest::newRow("1 -> 4") << 1 << 4; + QTest::newRow("2 -> 6") << 2 << 6; +} + +void tst_Tasking::storageIO() +{ + QFETCH(int, input); + QFETCH(int, output); + + int actualOutput = 0; + + const TreeStorage<StorageIO> storage; + TaskTree taskTree(inputOutputRecipe(storage)); + + const auto setInput = [input](StorageIO &storage) { storage.value = input; }; + const auto getOutput = [&actualOutput](const StorageIO &storage) { actualOutput = storage.value; }; + + taskTree.onStorageSetup(storage, setInput); + taskTree.onStorageDone(storage, getOutput); + taskTree.runBlocking(); + + QCOMPARE(taskTree.isRunning(), false); + QCOMPARE(actualOutput, output); +} + void tst_Tasking::storageOperators() { TreeStorageBase storage1 = TreeStorage<CustomStorage>(); From f2a93943f515340ddcfe97f902241ab1bb5ab1f8 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 31 Aug 2023 13:50:56 +0200 Subject: [PATCH 0970/1777] ProjectExplorer: filepathify gcc toolchain detection Change-Id: I4114229033e2e9ba93d628d2014e224e3b1d5c1e Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 76 ++++++++------------ 1 file changed, 29 insertions(+), 47 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 5302d8f0fe1..30ac040e2dc 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1104,60 +1104,42 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, }); FilePaths compilerPaths; - + FilePaths searchPaths = detector.searchPaths; if (device && device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { - // FIXME: Merge with block below - FilePaths searchPaths = detector.searchPaths; if (searchPaths.isEmpty()) searchPaths = device->systemEnvironment().path(); - for (const FilePath &deviceDir : std::as_const(searchPaths)) { - static const QRegularExpression regexp(binaryRegexp); - const auto callBack = [&compilerPaths, compilerName](const FilePath &candidate) { - if (candidate.fileName() == compilerName) - compilerPaths << candidate; - else if (regexp.match(candidate.path()).hasMatch()) - compilerPaths << candidate; - return IterationPolicy::Continue; - }; - const FilePath globalDir = device->filePath(deviceDir.path()); - globalDir.iterateDirectory(callBack, {nameFilters, QDir::Files | QDir::Executable}); + searchPaths = Utils::transform(searchPaths, [&](const FilePath &onDevice) { + return device->filePath(onDevice.path()); + }); + } else if (searchPaths.isEmpty()) { + searchPaths = Environment::systemEnvironment().path(); + searchPaths << gnuSearchPathsFromRegistry(); + searchPaths << atmelSearchPathsFromRegistry(); + searchPaths << renesasRl78SearchPathsFromRegistry(); + if (HostOsInfo::isMacHost()) { + searchPaths << "/opt/homebrew/opt/ccache/libexec" // homebrew arm + << "/usr/local/opt/ccache/libexec" // homebrew intel + << "/opt/local/libexec/ccache"; // macports, no links are created automatically though } - } else { - // The normal, local host case. - FilePaths searchPaths = detector.searchPaths; - if (searchPaths.isEmpty()) { - searchPaths = Environment::systemEnvironment().path(); - searchPaths << gnuSearchPathsFromRegistry(); - searchPaths << atmelSearchPathsFromRegistry(); - searchPaths << renesasRl78SearchPathsFromRegistry(); - if (HostOsInfo::isMacHost()) { - searchPaths << "/opt/homebrew/opt/ccache/libexec" // homebrew arm - << "/usr/local/opt/ccache/libexec" // homebrew intel - << "/opt/local/libexec/ccache"; // macports, no links are created automatically though - } - if (HostOsInfo::isAnyUnixHost()) { - FilePath ccachePath = "/usr/lib/ccache/bin"; - if (!ccachePath.exists()) - ccachePath = "/usr/lib/ccache"; - if (ccachePath.exists() && !searchPaths.contains(ccachePath)) - searchPaths << ccachePath; - } - } - for (const FilePath &dir : std::as_const(searchPaths)) { - static const QRegularExpression regexp(binaryRegexp); - QDir binDir(dir.toString()); - const QStringList fileNames = binDir.entryList(nameFilters, - QDir::Files | QDir::Executable); - for (const QString &fileName : fileNames) { - if (fileName != compilerName && - !regexp.match(QFileInfo(fileName).completeBaseName()).hasMatch()) { - continue; - } - compilerPaths << FilePath::fromString(binDir.filePath(fileName)); - } + if (HostOsInfo::isAnyUnixHost()) { + FilePath ccachePath = "/usr/lib/ccache/bin"; + if (!ccachePath.exists()) + ccachePath = "/usr/lib/ccache"; + if (ccachePath.exists() && !searchPaths.contains(ccachePath)) + searchPaths << ccachePath; } } + for (const FilePath &searchPath : std::as_const(searchPaths)) { + static const QRegularExpression regexp(binaryRegexp); + const auto callBack = [&compilerPaths, compilerName](const FilePath &candidate) { + if (candidate.fileName() == compilerName || regexp.match(candidate.path()).hasMatch()) + compilerPaths << candidate; + return IterationPolicy::Continue; + }; + searchPath.iterateDirectory(callBack, {nameFilters, QDir::Files | QDir::Executable}); + } + return compilerPaths; } From c2a69683cf3728f1fd9468dd8e036670b8713162 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 13:21:57 +0200 Subject: [PATCH 0971/1777] QmlProfiler: Merge qmlprofileractions into qmlprofilertool Change-Id: I9e43964de230ccb9549c976953d734eb355f667a Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/qmlprofiler/CMakeLists.txt | 3 +- src/plugins/qmlprofiler/qmlprofiler.qbs | 1 - .../qmlprofiler/qmlprofileractions.cpp | 92 ------------------- src/plugins/qmlprofiler/qmlprofileractions.h | 35 ------- src/plugins/qmlprofiler/qmlprofilerplugin.cpp | 4 - src/plugins/qmlprofiler/qmlprofilertool.cpp | 68 +++++++++++++- 6 files changed, 68 insertions(+), 135 deletions(-) delete mode 100644 src/plugins/qmlprofiler/qmlprofileractions.cpp delete mode 100644 src/plugins/qmlprofiler/qmlprofileractions.h diff --git a/src/plugins/qmlprofiler/CMakeLists.txt b/src/plugins/qmlprofiler/CMakeLists.txt index ddf4ae63b05..a94dfce931a 100644 --- a/src/plugins/qmlprofiler/CMakeLists.txt +++ b/src/plugins/qmlprofiler/CMakeLists.txt @@ -38,8 +38,7 @@ set(QMLPROFILER_CPP_SOURCES qmleventtype.cpp qmleventtype.h qmlnote.cpp qmlnote.h qmlprofiler_global.h - qmlprofilertr.h - qmlprofileractions.cpp qmlprofileractions.h + qmlprofilertr.h qmlprofileranimationsmodel.cpp qmlprofileranimationsmodel.h qmlprofilerattachdialog.cpp qmlprofilerattachdialog.h qmlprofilerbindingloopsrenderpass.cpp qmlprofilerbindingloopsrenderpass.h diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index 359a9eb1cf2..4ed25d1bca0 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.qbs +++ b/src/plugins/qmlprofiler/qmlprofiler.qbs @@ -30,7 +30,6 @@ QtcPlugin { "qmleventtype.cpp", "qmleventtype.h", "qmlnote.cpp", "qmlnote.h", "qmlprofiler_global.h", "qmlprofilertr.h", - "qmlprofileractions.h", "qmlprofileractions.cpp", "qmlprofileranimationsmodel.h", "qmlprofileranimationsmodel.cpp", "qmlprofilerattachdialog.cpp", "qmlprofilerattachdialog.h", "qmlprofilerbindingloopsrenderpass.cpp","qmlprofilerbindingloopsrenderpass.h", diff --git a/src/plugins/qmlprofiler/qmlprofileractions.cpp b/src/plugins/qmlprofiler/qmlprofileractions.cpp deleted file mode 100644 index 55f5a4edeca..00000000000 --- a/src/plugins/qmlprofiler/qmlprofileractions.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "qmlprofileractions.h" -#include "qmlprofilerconstants.h" -#include "qmlprofilermodelmanager.h" -#include "qmlprofilerstatemanager.h" -#include "qmlprofilertool.h" -#include "qmlprofilertr.h" - -#include <debugger/analyzer/analyzerconstants.h> - -#include <coreplugin/actionmanager/actionmanager.h> -#include <coreplugin/actionmanager/command.h> - -#include <QMenu> - -namespace QmlProfiler { -namespace Internal { - -using namespace Core; -using namespace Debugger::Constants; - -QmlProfilerActions::QmlProfilerActions(QObject *parent) : QObject(parent) -{} - -void QmlProfilerActions::attachToTool(QmlProfilerTool *tool) -{ - const QString description = Tr::tr("The QML Profiler can be used to find performance " - "bottlenecks in applications using QML."); - - m_runAction = std::make_unique<QAction>(Tr::tr("QML Profiler")); - m_runAction->setToolTip(description); - QObject::connect(m_runAction.get(), &QAction::triggered, - tool, &QmlProfilerTool::profileStartupProject); - - QAction *toolStartAction = tool->startAction(); - QObject::connect(toolStartAction, &QAction::changed, this, [this, toolStartAction] { - m_runAction->setEnabled(toolStartAction->isEnabled()); - }); - - m_attachAction = std::make_unique<QAction>(Tr::tr("QML Profiler (Attach to Waiting Application)")); - m_attachAction->setToolTip(description); - QObject::connect(m_attachAction.get(), &QAction::triggered, - tool, &QmlProfilerTool::attachToWaitingApplication); - - m_loadQmlTrace = std::make_unique<QAction>(Tr::tr("Load QML Trace")); - connect(m_loadQmlTrace.get(), &QAction::triggered, - tool, &QmlProfilerTool::showLoadDialog, Qt::QueuedConnection); - - m_saveQmlTrace = std::make_unique<QAction>(Tr::tr("Save QML Trace")); - connect(m_saveQmlTrace.get(), &QAction::triggered, - tool, &QmlProfilerTool::showSaveDialog, Qt::QueuedConnection); - - QmlProfilerStateManager *stateManager = tool->stateManager(); - connect(stateManager, &QmlProfilerStateManager::serverRecordingChanged, - this, [this](bool recording) { - m_loadQmlTrace->setEnabled(!recording); - }); - m_loadQmlTrace->setEnabled(!stateManager->serverRecording()); - - QmlProfilerModelManager *modelManager = tool->modelManager(); - connect(modelManager, &QmlProfilerModelManager::traceChanged, - this, [this, modelManager] { - m_saveQmlTrace->setEnabled(!modelManager->isEmpty()); - }); - m_saveQmlTrace->setEnabled(!modelManager->isEmpty()); -} - -void QmlProfilerActions::registerActions() -{ - m_options.reset(ActionManager::createMenu("Analyzer.Menu.QMLOptions")); - m_options->menu()->setTitle(Tr::tr("QML Profiler Options")); - m_options->menu()->setEnabled(true); - ActionContainer *menu = ActionManager::actionContainer(M_DEBUG_ANALYZER); - - menu->addAction(ActionManager::registerAction(m_runAction.get(), - "QmlProfiler.Internal"), - Debugger::Constants::G_ANALYZER_TOOLS); - menu->addAction(ActionManager::registerAction(m_attachAction.get(), - "QmlProfiler.AttachToWaitingApplication"), - Debugger::Constants::G_ANALYZER_REMOTE_TOOLS); - - menu->addMenu(m_options.get(), G_ANALYZER_OPTIONS); - m_options->addAction(ActionManager::registerAction(m_loadQmlTrace.get(), - Constants::QmlProfilerLoadActionId)); - m_options->addAction(ActionManager::registerAction(m_saveQmlTrace.get(), - Constants::QmlProfilerSaveActionId)); -} - -} // namespace Internal -} // namespace QmlProfiler diff --git a/src/plugins/qmlprofiler/qmlprofileractions.h b/src/plugins/qmlprofiler/qmlprofileractions.h deleted file mode 100644 index 95a884513f1..00000000000 --- a/src/plugins/qmlprofiler/qmlprofileractions.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <coreplugin/actionmanager/actioncontainer.h> - -#include <QObject> -#include <QAction> - -#include <memory> - -namespace QmlProfiler { -namespace Internal { - -class QmlProfilerTool; -class QmlProfilerActions : public QObject -{ - Q_OBJECT -public: - explicit QmlProfilerActions(QObject *parent = nullptr); - - void attachToTool(QmlProfilerTool *tool); - void registerActions(); - -private: - std::unique_ptr<Core::ActionContainer> m_options; - std::unique_ptr<QAction> m_loadQmlTrace; - std::unique_ptr<QAction> m_saveQmlTrace; - std::unique_ptr<QAction> m_runAction; - std::unique_ptr<QAction> m_attachAction; -}; - -} // namespace Internal -} // namespace QmlProfiler diff --git a/src/plugins/qmlprofiler/qmlprofilerplugin.cpp b/src/plugins/qmlprofiler/qmlprofilerplugin.cpp index d1f6ef58996..c60d8f15e6f 100644 --- a/src/plugins/qmlprofiler/qmlprofilerplugin.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerplugin.cpp @@ -6,7 +6,6 @@ #include "qmlprofilerruncontrol.h" #include "qmlprofilersettings.h" #include "qmlprofilertool.h" -#include "qmlprofileractions.h" #ifdef WITH_TESTS @@ -57,7 +56,6 @@ class QmlProfilerPluginPrivate { public: QmlProfilerTool m_profilerTool; - QmlProfilerActions m_actions; // The full local profiler. LocalQmlProfilerRunWorkerFactory localQmlProfilerRunWorkerFactory; @@ -99,8 +97,6 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS void QmlProfilerPlugin::extensionsInitialized() { d = new QmlProfilerPluginPrivate; - d->m_actions.attachToTool(&d->m_profilerTool); - d->m_actions.registerActions(); RunConfiguration::registerAspect<QmlProfilerRunConfigurationAspect>(); } diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index f6de08d2de2..ecb064c851f 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -1,6 +1,8 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#include "qmlprofilertool.h" + #include "qmlprofilerattachdialog.h" #include "qmlprofilerclientmanager.h" #include "qmlprofilerconstants.h" @@ -11,11 +13,11 @@ #include "qmlprofilersettings.h" #include "qmlprofilerstatemanager.h" #include "qmlprofilertextmark.h" -#include "qmlprofilertool.h" #include "qmlprofilertr.h" #include "qmlprofilerviewmanager.h" #include <coreplugin/actionmanager/command.h> +#include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> @@ -27,6 +29,7 @@ #include <coreplugin/modemanager.h> #include <coreplugin/progressmanager/progressmanager.h> +#include <debugger/analyzer/analyzerconstants.h> #include <debugger/analyzer/analyzermanager.h> #include <debugger/debuggericons.h> #include <debugger/debuggermainwindow.h> @@ -105,6 +108,12 @@ public: QElapsedTimer m_recordingElapsedTime; bool m_toolBusy = false; + + std::unique_ptr<Core::ActionContainer> m_options; + std::unique_ptr<QAction> m_loadQmlTrace; + std::unique_ptr<QAction> m_saveQmlTrace; + std::unique_ptr<QAction> m_runAction; + std::unique_ptr<QAction> m_attachAction; }; QmlProfilerTool::QmlProfilerTool() @@ -255,6 +264,63 @@ QmlProfilerTool::QmlProfilerTool() connect(d->m_profilerState, &QmlProfilerStateManager::clientRecordingChanged, d->m_recordButton, updateRecordButton); updateRecordButton(); + + + const QString description = Tr::tr("The QML Profiler can be used to find performance " + "bottlenecks in applications using QML."); + + d->m_runAction = std::make_unique<QAction>(Tr::tr("QML Profiler")); + d->m_runAction->setToolTip(description); + QObject::connect(d->m_runAction.get(), &QAction::triggered, + this, &QmlProfilerTool::profileStartupProject); + + QAction *toolStartAction = startAction(); + QObject::connect(toolStartAction, &QAction::changed, this, [this, toolStartAction] { + d->m_runAction->setEnabled(toolStartAction->isEnabled()); + }); + + d->m_attachAction = std::make_unique<QAction>(Tr::tr("QML Profiler (Attach to Waiting Application)")); + d->m_attachAction->setToolTip(description); + QObject::connect(d->m_attachAction.get(), &QAction::triggered, + this, &QmlProfilerTool::attachToWaitingApplication); + + d->m_loadQmlTrace = std::make_unique<QAction>(Tr::tr("Load QML Trace")); + connect(d->m_loadQmlTrace.get(), &QAction::triggered, + this, &QmlProfilerTool::showLoadDialog, Qt::QueuedConnection); + + d->m_saveQmlTrace = std::make_unique<QAction>(Tr::tr("Save QML Trace")); + connect(d->m_saveQmlTrace.get(), &QAction::triggered, + this, &QmlProfilerTool::showSaveDialog, Qt::QueuedConnection); + + connect(d->m_profilerState, &QmlProfilerStateManager::serverRecordingChanged, + this, [this](bool recording) { + d->m_loadQmlTrace->setEnabled(!recording); + }); + d->m_loadQmlTrace->setEnabled(!d->m_profilerState->serverRecording()); + + connect(d->m_profilerModelManager, &QmlProfilerModelManager::traceChanged, + this, [this] { + d->m_saveQmlTrace->setEnabled(!d->m_profilerModelManager->isEmpty()); + }); + d->m_saveQmlTrace->setEnabled(!d->m_profilerModelManager->isEmpty()); + + d->m_options.reset(ActionManager::createMenu("Analyzer.Menu.QMLOptions")); + d->m_options->menu()->setTitle(Tr::tr("QML Profiler Options")); + d->m_options->menu()->setEnabled(true); + ActionContainer *menu = ActionManager::actionContainer(M_DEBUG_ANALYZER); + + menu->addAction(ActionManager::registerAction(d->m_runAction.get(), + "QmlProfiler.Internal"), + Debugger::Constants::G_ANALYZER_TOOLS); + menu->addAction(ActionManager::registerAction(d->m_attachAction.get(), + "QmlProfiler.AttachToWaitingApplication"), + Debugger::Constants::G_ANALYZER_REMOTE_TOOLS); + + menu->addMenu(d->m_options.get(), G_ANALYZER_OPTIONS); + d->m_options->addAction(ActionManager::registerAction(d->m_loadQmlTrace.get(), + Constants::QmlProfilerLoadActionId)); + d->m_options->addAction(ActionManager::registerAction(d->m_saveQmlTrace.get(), + Constants::QmlProfilerSaveActionId)); } QmlProfilerTool::~QmlProfilerTool() From 67212a31ee4cc5c026b677329ace9f1fdaa3320c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 12:28:51 +0200 Subject: [PATCH 0972/1777] Utils: Cache theme icon access These trigger over 120k file exist check on my machine on startup, just for a handful icons. Change-Id: Ic73f0783142ed329c2f8c8b852f622e69fc306da Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/libs/utils/fancylineedit.cpp | 10 ++-- src/libs/utils/icon.cpp | 48 +++++++++++++++++++ src/libs/utils/icon.h | 2 + src/libs/utils/utilsicons.cpp | 1 + src/libs/utils/utilsicons.h | 1 + src/libs/utils/wizard.cpp | 3 +- ...droidmanifesteditoriconcontainerwidget.cpp | 6 +-- .../android/splashscreencontainerwidget.cpp | 6 +-- src/plugins/clangcodemodel/clangtextmark.cpp | 2 +- src/plugins/clangtools/diagnosticmark.cpp | 2 +- .../fileapidataextractor.cpp | 5 +- .../editormanager/editormanager.cpp | 2 +- src/plugins/coreplugin/find/findtoolbar.cpp | 2 +- src/plugins/coreplugin/mainwindow.cpp | 37 +++++++------- src/plugins/cppcheck/cppchecktextmark.cpp | 2 +- .../languageclient/diagnosticmanager.cpp | 2 +- .../texteditor/circularclipboardassist.cpp | 6 ++- 17 files changed, 92 insertions(+), 45 deletions(-) diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index e5de16e3e84..09fe9380197 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -431,13 +431,9 @@ void FancyLineEdit::setFiltering(bool on) // KDE has custom icons for this. Notice that icon namings are counter intuitive. // If these icons are not available we use the freedesktop standard name before // falling back to a bundled resource. - QIcon icon = QIcon::fromTheme(layoutDirection() == Qt::LeftToRight ? - QLatin1String("edit-clear-locationbar-rtl") : - QLatin1String("edit-clear-locationbar-ltr"), - QIcon::fromTheme(QLatin1String("edit-clear"), - Icons::EDIT_CLEAR.icon())); - - setButtonIcon(Right, icon); + static const QIcon rtl = Icon::fromTheme("edit-clear-locationbar-rtl"); + static const QIcon ltr = Icon::fromTheme("edit-clear-locationbar-ltr"); + setButtonIcon(Right, layoutDirection() == Qt::LeftToRight ? ltr : rtl); setButtonVisible(Right, true); setPlaceholderText(Tr::tr("Filter")); setButtonToolTip(Right, Tr::tr("Clear text")); diff --git a/src/libs/utils/icon.cpp b/src/libs/utils/icon.cpp index 9c7625e32b2..e4945efa9bd 100644 --- a/src/libs/utils/icon.cpp +++ b/src/libs/utils/icon.cpp @@ -6,6 +6,7 @@ #include "qtcassert.h" #include "theme/theme.h" #include "stylehelper.h" +#include "utilsicons.h" #include <QApplication> #include <QDebug> @@ -234,4 +235,51 @@ QIcon Icon::combinedIcon(const QList<Icon> &icons) return combinedIcon(qIcons); } +QIcon Icon::fromTheme(const QString &name) +{ + static QHash<QString, QIcon> cache; + + auto found = cache.find(name); + if (found != cache.end()) + return *found; + + QIcon icon = QIcon::fromTheme(name); + if (name == "go-next") { + cache.insert(name, !icon.isNull() ? icon : QIcon(":/utils/images/arrow.png")); + } else if (name == "document-open") { + cache.insert(name, !icon.isNull() ? icon : Icons::OPENFILE.icon()); + } else if (name == "edit-copy") { + cache.insert(name, !icon.isNull() ? icon : Icons::COPY.icon()); + } else if (name == "document-new") { + cache.insert(name, !icon.isNull() ? icon : Icons::NEWFILE.icon()); + } else if (name == "document-save") { + cache.insert(name, !icon.isNull() ? icon : Icons::SAVEFILE.icon()); + } else if (name == "edit-undo") { + cache.insert(name, !icon.isNull() ? icon : Icons::UNDO.icon()); + } else if (name == "edit-redo") { + cache.insert(name, !icon.isNull() ? icon : Icons::REDO.icon()); + } else if (name == "edit-cut") { + cache.insert(name, !icon.isNull() ? icon : Icons::CUT.icon()); + } else if (name == "edit-paste") { + cache.insert(name, !icon.isNull() ? icon : Icons::PASTE.icon()); + } else if (name == "zoom-in") { + cache.insert(name, !icon.isNull() ? icon : Icons::ZOOMIN_TOOLBAR.icon()); + } else if (name == "zoom-out") { + cache.insert(name, !icon.isNull() ? icon : Icons::ZOOMOUT_TOOLBAR.icon()); + } else if (name == "zoom-original") { + cache.insert(name, !icon.isNull() ? icon : Icons::EYE_OPEN_TOOLBAR.icon()); + } else if (name == "edit-clear-locationbar-rtl") { + // KDE has custom icons for this. Notice that icon namings are counter intuitive. + // If these icons are not available we use the freedesktop standard name before + // falling back to a bundled resource. + cache.insert(name, !icon.isNull() ? icon : Icons::EDIT_CLEAR.icon()); + } else if (name == "edit-clear-locationbar-ltr") { + cache.insert(name, !icon.isNull() ? icon : Icons::EDIT_CLEAR.icon()); + } else { + cache.insert(name, icon); + } + + return cache[name]; +} + } // namespace Utils diff --git a/src/libs/utils/icon.h b/src/libs/utils/icon.h index b1482410a3d..d26668082bf 100644 --- a/src/libs/utils/icon.h +++ b/src/libs/utils/icon.h @@ -61,6 +61,8 @@ public: static QIcon combinedIcon(const QList<QIcon> &icons); static QIcon combinedIcon(const QList<Icon> &icons); + static QIcon fromTheme(const QString &name); + private: QList<IconMaskAndColor> m_iconSourceList; IconStyleOptions m_style = None; diff --git a/src/libs/utils/utilsicons.cpp b/src/libs/utils/utilsicons.cpp index 01b1f0c1dbc..60928ae7945 100644 --- a/src/libs/utils/utilsicons.cpp +++ b/src/libs/utils/utilsicons.cpp @@ -288,6 +288,7 @@ const Icon MACOS_TOUCHBAR_BOOKMARK( ":/utils/images/macos_touchbar_bookmark.png"); const Icon MACOS_TOUCHBAR_CLEAR( ":/utils/images/macos_touchbar_clear.png"); + } // namespace Icons QIcon CodeModelIcon::iconForType(CodeModelIcon::Type type) diff --git a/src/libs/utils/utilsicons.h b/src/libs/utils/utilsicons.h index 5a75267a363..33588dc0d58 100644 --- a/src/libs/utils/utilsicons.h +++ b/src/libs/utils/utilsicons.h @@ -148,6 +148,7 @@ QTCREATOR_UTILS_EXPORT extern const Icon CODEMODEL_FIXIT; QTCREATOR_UTILS_EXPORT extern const Icon MACOS_TOUCHBAR_BOOKMARK; QTCREATOR_UTILS_EXPORT extern const Icon MACOS_TOUCHBAR_CLEAR; + } // namespace Icons namespace CodeModelIcon { diff --git a/src/libs/utils/wizard.cpp b/src/libs/utils/wizard.cpp index d80ef32c524..bbf22730a4f 100644 --- a/src/libs/utils/wizard.cpp +++ b/src/libs/utils/wizard.cpp @@ -5,6 +5,7 @@ #include "algorithm.h" #include "hostosinfo.h" +#include "icon.h" #include "qtcassert.h" #include "theme/theme.h" #include "utilstr.h" @@ -110,7 +111,7 @@ LinearProgressWidget::LinearProgressWidget(WizardProgress *progress, QWidget *pa m_dotsItemWidget(nullptr), m_disableUpdatesCount(0) { - m_indicatorPixmap = QIcon::fromTheme(QLatin1String("go-next"), QIcon(QLatin1String(":/utils/images/arrow.png"))).pixmap(16); + m_indicatorPixmap = Icon::fromTheme("go-next").pixmap(16); m_wizardProgress = progress; m_mainLayout = new QVBoxLayout(this); m_itemWidgetLayout = new QVBoxLayout(); diff --git a/src/plugins/android/androidmanifesteditoriconcontainerwidget.cpp b/src/plugins/android/androidmanifesteditoriconcontainerwidget.cpp index 10788598935..b6ccc7aeef0 100644 --- a/src/plugins/android/androidmanifesteditoriconcontainerwidget.cpp +++ b/src/plugins/android/androidmanifesteditoriconcontainerwidget.cpp @@ -10,10 +10,11 @@ #include <QFrame> #include <QHBoxLayout> +using namespace Utils; + namespace Android { namespace Internal { -namespace { const char extraExtraExtraHighDpiIconPath[] = "/res/drawable-xxxhdpi/"; const char extraExtraHighDpiIconPath[] = "/res/drawable-xxhdpi/"; const char extraHighDpiIconPath[] = "/res/drawable-xhdpi/"; @@ -27,7 +28,6 @@ const QSize highDpiIconSize{72, 72}; const QSize extraHighDpiIconSize{96, 96}; const QSize extraExtraHighDpiIconSize{144, 144}; const QSize extraExtraExtraHighDpiIconSize{192, 192}; -} AndroidManifestEditorIconContainerWidget::AndroidManifestEditorIconContainerWidget( QWidget *parent, @@ -40,7 +40,7 @@ AndroidManifestEditorIconContainerWidget::AndroidManifestEditorIconContainerWidg lowDpiIconSize, Tr::tr("Master icon"), Tr::tr("Select master icon.")); - masterIconButton->setIcon(QIcon::fromTheme(QLatin1String("document-open"), Utils::Icons::OPENFILE.icon())); + masterIconButton->setIcon(Icon::fromTheme("document-open")); iconLayout->addWidget(masterIconButton); iconLayout->addStretch(1); diff --git a/src/plugins/android/splashscreencontainerwidget.cpp b/src/plugins/android/splashscreencontainerwidget.cpp index a30af15f24c..e0e203121df 100644 --- a/src/plugins/android/splashscreencontainerwidget.cpp +++ b/src/plugins/android/splashscreencontainerwidget.cpp @@ -185,17 +185,17 @@ SplashScreenContainerWidget::SplashScreenContainerWidget( m_masterImage = new QToolButton(this); m_masterImage->setToolTip(Tr::tr("Select master image to use.")); - m_masterImage->setIcon(QIcon::fromTheme(QLatin1String("document-open"), Utils::Icons::OPENFILE.icon())); + m_masterImage->setIcon(Icon::fromTheme("document-open")); formLayout->addRow(Tr::tr("Master image:"), m_masterImage); m_portraitMasterImage = new QToolButton(this); m_portraitMasterImage->setToolTip(Tr::tr("Select portrait master image to use.")); - m_portraitMasterImage->setIcon(QIcon::fromTheme(QLatin1String("document-open"), Utils::Icons::OPENFILE.icon())); + m_portraitMasterImage->setIcon(Icon::fromTheme("document-open")); formLayout->addRow(Tr::tr("Portrait master image:"), m_portraitMasterImage); m_landscapeMasterImage = new QToolButton(this); m_landscapeMasterImage->setToolTip(Tr::tr("Select landscape master image to use.")); - m_landscapeMasterImage->setIcon(QIcon::fromTheme(QLatin1String("document-open"), Utils::Icons::OPENFILE.icon())); + m_landscapeMasterImage->setIcon(Icon::fromTheme("document-open")); formLayout->addRow(Tr::tr("Landscape master image:"), m_landscapeMasterImage); auto clearAllButton = new QToolButton(this); diff --git a/src/plugins/clangcodemodel/clangtextmark.cpp b/src/plugins/clangcodemodel/clangtextmark.cpp index e62dfad66ec..4f5be51a7c1 100644 --- a/src/plugins/clangcodemodel/clangtextmark.cpp +++ b/src/plugins/clangcodemodel/clangtextmark.cpp @@ -265,7 +265,7 @@ ClangdTextMark::ClangdTextMark(TextEditor::TextDocument *doc, // Copy to clipboard action QList<QAction *> actions; QAction *action = new QAction(); - action->setIcon(QIcon::fromTheme("edit-copy", Icons::COPY.icon())); + action->setIcon(Icon::fromTheme("edit-copy")); action->setToolTip(Tr::tr("Copy to Clipboard", "Clang Code Model Marks")); QObject::connect(action, &QAction::triggered, [diag] { const QString text = ClangDiagnosticWidget::createText({diag}, diff --git a/src/plugins/clangtools/diagnosticmark.cpp b/src/plugins/clangtools/diagnosticmark.cpp index 3802ee325cf..90b4e19812d 100644 --- a/src/plugins/clangtools/diagnosticmark.cpp +++ b/src/plugins/clangtools/diagnosticmark.cpp @@ -39,7 +39,7 @@ DiagnosticMark::DiagnosticMark(const Diagnostic &diagnostic, TextDocument *docum // Copy to clipboard action QList<QAction *> actions; QAction *action = new QAction(); - action->setIcon(QIcon::fromTheme("edit-copy", Icons::COPY.icon())); + action->setIcon(Icon::fromTheme("edit-copy")); action->setToolTip(Tr::tr("Copy to Clipboard")); QObject::connect(action, &QAction::triggered, [diagnostic] { const QString text = createFullLocationString(diagnostic.location) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index ebb03d950fc..05574b9a007 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -15,7 +15,7 @@ #include <utils/mimeutils.h> #include <utils/process.h> #include <utils/qtcassert.h> -#include <utils/utilsicons.h> +#include <utils/icon.h> #include <projectexplorer/projecttree.h> @@ -516,8 +516,7 @@ FolderNode *createSourceGroupNode(const QString &sourceGroupName, if (!existingNode) { auto node = createCMakeVFolder(sourceDirectory, Node::DefaultFolderPriority + 5, p); node->setListInProject(false); - node->setIcon( - [] { return QIcon::fromTheme("edit-copy", ::Utils::Icons::COPY.icon()); }); + node->setIcon([] { return Icon::fromTheme("edit-copy"); }); existingNode = node.get(); diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index d9db4daaab6..6bfb2ffea15 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -431,7 +431,7 @@ void EditorManagerPrivate::init() ActionContainer *mfile = ActionManager::actionContainer(Constants::M_FILE); // Revert to saved - m_revertToSavedAction->setIcon(QIcon::fromTheme("document-revert")); + m_revertToSavedAction->setIcon(Icon::fromTheme("document-revert")); Command *cmd = ActionManager::registerAction(m_revertToSavedAction, Constants::REVERTTOSAVED, editManagerContext); cmd->setAttribute(Command::CA_UpdateText); diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index 7a4157e5975..187243ab4f9 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -256,7 +256,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind) connect(m_goToCurrentFindAction, &QAction::triggered, this, &FindToolBar::setFocusToCurrentFindSupport); - QIcon icon = QIcon::fromTheme(QLatin1String("edit-find-replace")); + QIcon icon = Icon::fromTheme("edit-find-replace"); m_findInDocumentAction = new QAction(icon, Tr::tr("Find/Replace"), this); cmd = ActionManager::registerAction(m_findInDocumentAction, Constants::FIND_IN_DOCUMENT); cmd->setDefaultKeySequence(QKeySequence::Find); diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index ce961c5e26c..c95637181fb 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -548,7 +548,7 @@ void MainWindow::registerDefaultActions() connect(m_focusToEditor, &QAction::triggered, this, &MainWindow::setFocusToEditor); // New File Action - QIcon icon = QIcon::fromTheme(QLatin1String("document-new"), Utils::Icons::NEWFILE.icon()); + QIcon icon = Icon::fromTheme("document-new"); m_newAction = new QAction(icon, Tr::tr("&New Project..."), this); cmd = ActionManager::registerAction(m_newAction, Constants::NEW); @@ -584,7 +584,7 @@ void MainWindow::registerDefaultActions() }); // Open Action - icon = QIcon::fromTheme(QLatin1String("document-open"), Utils::Icons::OPENFILE.icon()); + icon = Icon::fromTheme("document-open"); m_openAction = new QAction(icon, Tr::tr("&Open File or Project..."), this); cmd = ActionManager::registerAction(m_openAction, Constants::OPEN); cmd->setDefaultKeySequence(QKeySequence::Open); @@ -612,7 +612,7 @@ void MainWindow::registerDefaultActions() ac->setOnAllDisabledBehavior(ActionContainer::Show); // Save Action - icon = QIcon::fromTheme(QLatin1String("document-save"), Utils::Icons::SAVEFILE.icon()); + icon = Icon::fromTheme("document-save"); QAction *tmpaction = new QAction(icon, Tr::tr("&Save"), this); tmpaction->setEnabled(false); cmd = ActionManager::registerAction(tmpaction, Constants::SAVE); @@ -622,7 +622,7 @@ void MainWindow::registerDefaultActions() mfile->addAction(cmd, Constants::G_FILE_SAVE); // Save As Action - icon = QIcon::fromTheme(QLatin1String("document-save-as")); + icon = Icon::fromTheme("document-save-as"); tmpaction = new QAction(icon, Tr::tr("Save &As..."), this); tmpaction->setEnabled(false); cmd = ActionManager::registerAction(tmpaction, Constants::SAVEAS); @@ -635,7 +635,7 @@ void MainWindow::registerDefaultActions() DocumentManager::registerSaveAllAction(); // Print Action - icon = QIcon::fromTheme(QLatin1String("document-print")); + icon = Icon::fromTheme("document-print"); tmpaction = new QAction(icon, Tr::tr("&Print..."), this); tmpaction->setEnabled(false); cmd = ActionManager::registerAction(tmpaction, Constants::PRINT); @@ -643,7 +643,7 @@ void MainWindow::registerDefaultActions() mfile->addAction(cmd, Constants::G_FILE_PRINT); // Exit Action - icon = QIcon::fromTheme(QLatin1String("application-exit")); + icon = Icon::fromTheme("application-exit"); m_exitAction = new QAction(icon, Tr::tr("E&xit"), this); m_exitAction->setMenuRole(QAction::QuitRole); cmd = ActionManager::registerAction(m_exitAction, Constants::EXIT); @@ -652,7 +652,7 @@ void MainWindow::registerDefaultActions() connect(m_exitAction, &QAction::triggered, this, &MainWindow::exit); // Undo Action - icon = QIcon::fromTheme(QLatin1String("edit-undo"), Utils::Icons::UNDO.icon()); + icon = Icon::fromTheme("edit-undo"); tmpaction = new QAction(icon, Tr::tr("&Undo"), this); cmd = ActionManager::registerAction(tmpaction, Constants::UNDO); cmd->setDefaultKeySequence(QKeySequence::Undo); @@ -662,7 +662,7 @@ void MainWindow::registerDefaultActions() tmpaction->setEnabled(false); // Redo Action - icon = QIcon::fromTheme(QLatin1String("edit-redo"), Utils::Icons::REDO.icon()); + icon = Icon::fromTheme("edit-redo"); tmpaction = new QAction(icon, Tr::tr("&Redo"), this); cmd = ActionManager::registerAction(tmpaction, Constants::REDO); cmd->setDefaultKeySequence(QKeySequence::Redo); @@ -672,7 +672,7 @@ void MainWindow::registerDefaultActions() tmpaction->setEnabled(false); // Cut Action - icon = QIcon::fromTheme(QLatin1String("edit-cut"), Utils::Icons::CUT.icon()); + icon = Icon::fromTheme("edit-cut"); tmpaction = new QAction(icon, Tr::tr("Cu&t"), this); cmd = ActionManager::registerAction(tmpaction, Constants::CUT); cmd->setDefaultKeySequence(QKeySequence::Cut); @@ -680,7 +680,7 @@ void MainWindow::registerDefaultActions() tmpaction->setEnabled(false); // Copy Action - icon = QIcon::fromTheme(QLatin1String("edit-copy"), Utils::Icons::COPY.icon()); + icon = Icon::fromTheme("edit-copy"); tmpaction = new QAction(icon, Tr::tr("&Copy"), this); cmd = ActionManager::registerAction(tmpaction, Constants::COPY); cmd->setDefaultKeySequence(QKeySequence::Copy); @@ -688,7 +688,7 @@ void MainWindow::registerDefaultActions() tmpaction->setEnabled(false); // Paste Action - icon = QIcon::fromTheme(QLatin1String("edit-paste"), Utils::Icons::PASTE.icon()); + icon = Icon::fromTheme("edit-paste"); tmpaction = new QAction(icon, Tr::tr("&Paste"), this); cmd = ActionManager::registerAction(tmpaction, Constants::PASTE); cmd->setDefaultKeySequence(QKeySequence::Paste); @@ -696,7 +696,7 @@ void MainWindow::registerDefaultActions() tmpaction->setEnabled(false); // Select All - icon = QIcon::fromTheme(QLatin1String("edit-select-all")); + icon = Icon::fromTheme("edit-select-all"); tmpaction = new QAction(icon, Tr::tr("Select &All"), this); cmd = ActionManager::registerAction(tmpaction, Constants::SELECTALL); cmd->setDefaultKeySequence(QKeySequence::SelectAll); @@ -704,7 +704,7 @@ void MainWindow::registerDefaultActions() tmpaction->setEnabled(false); // Goto Action - icon = QIcon::fromTheme(QLatin1String("go-jump")); + icon = Icon::fromTheme("go-jump"); tmpaction = new QAction(icon, Tr::tr("&Go to Line..."), this); cmd = ActionManager::registerAction(tmpaction, Constants::GOTO); cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+L"))); @@ -712,16 +712,14 @@ void MainWindow::registerDefaultActions() tmpaction->setEnabled(false); // Zoom In Action - icon = QIcon::hasThemeIcon("zoom-in") ? QIcon::fromTheme("zoom-in") - : Utils::Icons::ZOOMIN_TOOLBAR.icon(); + icon = Icon::fromTheme("zoom-in"); tmpaction = new QAction(icon, Tr::tr("Zoom In"), this); cmd = ActionManager::registerAction(tmpaction, Constants::ZOOM_IN); cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl++"))); tmpaction->setEnabled(false); // Zoom Out Action - icon = QIcon::hasThemeIcon("zoom-out") ? QIcon::fromTheme("zoom-out") - : Utils::Icons::ZOOMOUT_TOOLBAR.icon(); + icon = Icon::fromTheme("zoom-out"); tmpaction = new QAction(icon, Tr::tr("Zoom Out"), this); cmd = ActionManager::registerAction(tmpaction, Constants::ZOOM_OUT); if (useMacShortcuts) @@ -731,8 +729,7 @@ void MainWindow::registerDefaultActions() tmpaction->setEnabled(false); // Zoom Reset Action - icon = QIcon::hasThemeIcon("zoom-original") ? QIcon::fromTheme("zoom-original") - : Utils::Icons::EYE_OPEN_TOOLBAR.icon(); + icon = Icon::fromTheme("zoom-original"); tmpaction = new QAction(icon, Tr::tr("Original Size"), this); cmd = ActionManager::registerAction(tmpaction, Constants::ZOOM_RESET); cmd->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+0") : Tr::tr("Ctrl+0"))); @@ -844,7 +841,7 @@ void MainWindow::registerDefaultActions() mhelp->addSeparator(Constants::G_HELP_ABOUT); // About IDE Action - icon = QIcon::fromTheme(QLatin1String("help-about")); + icon = Icon::fromTheme("help-about"); if (HostOsInfo::isMacHost()) tmpaction = new QAction(icon, Tr::tr("About &%1").arg(QGuiApplication::applicationDisplayName()), diff --git a/src/plugins/cppcheck/cppchecktextmark.cpp b/src/plugins/cppcheck/cppchecktextmark.cpp index 774d09bde76..f4e7802cee2 100644 --- a/src/plugins/cppcheck/cppchecktextmark.cpp +++ b/src/plugins/cppcheck/cppchecktextmark.cpp @@ -65,7 +65,7 @@ CppcheckTextMark::CppcheckTextMark(const Diagnostic &diagnostic) setActionsProvider([diagnostic] { // Copy to clipboard action QAction *action = new QAction; - action->setIcon(QIcon::fromTheme("edit-copy", Icons::COPY.icon())); + action->setIcon(Icon::fromTheme("edit-copy")); action->setToolTip(TextEditor::Tr::tr("Copy to Clipboard")); QObject::connect(action, &QAction::triggered, [diagnostic]() { const QString text = QString("%1:%2: %3") diff --git a/src/plugins/languageclient/diagnosticmanager.cpp b/src/plugins/languageclient/diagnosticmanager.cpp index 2e8e2d87396..dd58407f9e0 100644 --- a/src/plugins/languageclient/diagnosticmanager.cpp +++ b/src/plugins/languageclient/diagnosticmanager.cpp @@ -120,7 +120,7 @@ TextEditor::TextMark *DiagnosticManager::createTextMark(TextDocument *doc, const Diagnostic &diagnostic, bool /*isProjectFile*/) const { - static const auto icon = QIcon::fromTheme("edit-copy", Utils::Icons::COPY.icon()); + static const QIcon icon = Icon::fromTheme("edit-copy"); static const QString tooltip = Tr::tr("Copy to Clipboard"); auto mark = new TextMark(doc, diagnostic, m_client); mark->setActionsProvider([text = diagnostic.message()] { diff --git a/src/plugins/texteditor/circularclipboardassist.cpp b/src/plugins/texteditor/circularclipboardassist.cpp index 4c0956b6c3f..fe569f54e66 100644 --- a/src/plugins/texteditor/circularclipboardassist.cpp +++ b/src/plugins/texteditor/circularclipboardassist.cpp @@ -13,11 +13,13 @@ #include <coreplugin/coreconstants.h> -#include <utils/utilsicons.h> +#include <utils/icon.h> #include <QApplication> #include <QClipboard> +using namespace Utils; + namespace TextEditor { namespace Internal { @@ -65,7 +67,7 @@ class ClipboardAssistProcessor: public IAssistProcessor public: IAssistProposal *perform() override { - QIcon icon = QIcon::fromTheme(QLatin1String("edit-paste"), Utils::Icons::PASTE.icon()).pixmap(16); + QIcon icon = Icon::fromTheme("edit-paste"); CircularClipboard * clipboard = CircularClipboard::instance(); QList<AssistProposalItemInterface *> items; items.reserve(clipboard->size()); From ff274be0b2bd4307489aab9bf7738936edf22a1f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 31 Aug 2023 11:25:04 +0200 Subject: [PATCH 0973/1777] Utils: improve path correction Change-Id: I1479bd7e7d2d2cf12eb6858bf92269bd454115a1 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/fsengine/fsenginehandler.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/fsengine/fsenginehandler.cpp b/src/libs/utils/fsengine/fsenginehandler.cpp index 55174bc75cd..2f828537d19 100644 --- a/src/libs/utils/fsengine/fsenginehandler.cpp +++ b/src/libs/utils/fsengine/fsenginehandler.cpp @@ -10,6 +10,7 @@ #include "fsengine.h" #include "../algorithm.h" +#include "../hostosinfo.h" namespace Utils::Internal { @@ -33,6 +34,18 @@ static FilePath removeDoubleSlash(const QString &fileName) return FilePath::fromString(result); } +static bool isRootPath(const QString &fileName) +{ + if (HostOsInfo::isWindowsHost()) { + static const QChar lowerDriveLetter = HostOsInfo::root().path().front().toUpper(); + static const QChar upperDriveLetter = HostOsInfo::root().path().front().toLower(); + return fileName.size() == 3 && fileName[1] == ':' && fileName[2] == '/' + && (fileName[0] == lowerDriveLetter || fileName[0] == upperDriveLetter); + } + + return fileName.size() == 1 && fileName[0] == '/'; +} + QAbstractFileEngine *FSEngineHandler::create(const QString &fileName) const { if (fileName.startsWith(':')) @@ -71,7 +84,7 @@ QAbstractFileEngine *FSEngineHandler::create(const QString &fileName) const return new FSEngineImpl(removeDoubleSlash(fileName)); } - if (fixedFileName.compare(HostOsInfo::root().path(), Qt::CaseInsensitive) == 0) + if (isRootPath(fixedFileName)) return new RootInjectFSEngine(fileName); return nullptr; From 16c12f71fff44081d537fa90e4f9ea1cb212f5dd Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 31 Aug 2023 18:47:40 +0200 Subject: [PATCH 0974/1777] Android: Speed up startup by using existing Qt6 Information This will use the available information from modules/Core.json and determine the abi version from the "compiler_target" used to build Qt. This is only available with Qt6. Qt 6.4 and 6.5 have this information. Otherwise the "android-clang" qmake mkspec will be parsed and evalauted to get the Qt ABIs. Change-Id: Ia0c73f5c87983f44a156b54335dc8b36698c15b2 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/android/androidconfigurations.cpp | 13 ++----- src/plugins/android/androidconstants.h | 7 ++++ src/plugins/android/androidqtversion.cpp | 38 ++++++++++++++++++- src/plugins/android/androidqtversion.h | 1 + 4 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index cef297ac31d..d117c86527e 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -110,11 +110,6 @@ const QLatin1String X86ToolsPrefix("i686-linux-android"); const QLatin1String AArch64ToolsPrefix("aarch64-linux-android"); const QLatin1String X86_64ToolsPrefix("x86_64-linux-android"); -const QLatin1String ArmToolsDisplayName("arm"); -const QLatin1String X86ToolsDisplayName("i686"); -const QLatin1String AArch64ToolsDisplayName("aarch64"); -const QLatin1String X86_64ToolsDisplayName("x86_64"); - const QLatin1String Unknown("unknown"); const QLatin1String keytoolName("keytool"); const QLatin1String changeTimeStamp("ChangeTimeStamp"); @@ -174,12 +169,12 @@ QLatin1String AndroidConfig::displayName(const Abi &abi) switch (abi.architecture()) { case Abi::ArmArchitecture: if (abi.wordWidth() == 64) - return AArch64ToolsDisplayName; - return ArmToolsDisplayName; + return QLatin1String(Constants::AArch64ToolsDisplayName); + return QLatin1String(Constants::ArmToolsDisplayName); case Abi::X86Architecture: if (abi.wordWidth() == 64) - return X86_64ToolsDisplayName; - return X86ToolsDisplayName; + return QLatin1String(Constants::X86_64ToolsDisplayName); + return QLatin1String(Constants::X86ToolsDisplayName); default: return Unknown; } diff --git a/src/plugins/android/androidconstants.h b/src/plugins/android/androidconstants.h index 70c8c3a23f7..1bc1712e24f 100644 --- a/src/plugins/android/androidconstants.h +++ b/src/plugins/android/androidconstants.h @@ -76,4 +76,11 @@ const Utils::Id AndroidAvdPath = "AndroidAvdPath"; const char cmdlineToolsName[] = "cmdline-tools"; const char ndkPackageName[] = "ndk"; +// For AndroidQtVersion +const char ArmToolsDisplayName[] = "arm"; +const char ArmV7ToolsDisplayName[] = "armv7"; +const char X86ToolsDisplayName[] = "i686"; +const char AArch64ToolsDisplayName[] = "aarch64"; +const char X86_64ToolsDisplayName[] = "x86_64"; + } // Android::Constants diff --git a/src/plugins/android/androidqtversion.cpp b/src/plugins/android/androidqtversion.cpp index 68a1b94ca9e..b5d4d54c431 100644 --- a/src/plugins/android/androidqtversion.cpp +++ b/src/plugins/android/androidqtversion.cpp @@ -112,13 +112,24 @@ QString AndroidQtVersion::description() const const QStringList &AndroidQtVersion::androidAbis() const { - ensureMkSpecParsed(); + if (m_androidAbis.isEmpty()) { + bool sanityCheckNotUsed; + const BuiltWith bw = builtWith(&sanityCheckNotUsed); + if (!bw.androidAbi.isEmpty()) { + m_androidAbis << bw.androidAbi; + m_minNdk = bw.apiVersion; + } else { + ensureMkSpecParsed(); + } + } + return m_androidAbis; } int AndroidQtVersion::minimumNDK() const { - ensureMkSpecParsed(); + if (m_minNdk == -1) + ensureMkSpecParsed(); return m_minNdk; } @@ -170,6 +181,25 @@ static int versionFromPlatformString(const QString &string, bool *ok = nullptr) return match.hasMatch() ? match.captured(1).toInt(ok) : -1; } +static QString abiFromCompilerTarget(const QString &string) +{ + const QStringList components = string.split("-"); + if (components.isEmpty()) + return {}; + + QString qtAbi; + const QString compilerAbi = components.first(); + if (compilerAbi == Constants::AArch64ToolsDisplayName) + qtAbi = ProjectExplorer::Constants::ANDROID_ABI_ARM64_V8A; + else if (compilerAbi == Constants::ArmV7ToolsDisplayName) + qtAbi = ProjectExplorer::Constants::ANDROID_ABI_ARMEABI_V7A; + else if (compilerAbi == Constants::X86_64ToolsDisplayName) + qtAbi = ProjectExplorer::Constants::ANDROID_ABI_X86_64; + else if (compilerAbi == Constants::X86ToolsDisplayName) + qtAbi = ProjectExplorer::Constants::ANDROID_ABI_X86; + return qtAbi; +} + AndroidQtVersion::BuiltWith AndroidQtVersion::parseBuiltWith(const QByteArray &modulesCoreJsonData, bool *ok) { @@ -189,6 +219,10 @@ AndroidQtVersion::BuiltWith AndroidQtVersion::parseBuiltWith(const QByteArray &m result.ndkVersion = QVersionNumber::fromString(version.toString()); } } + if (const QJsonValue compilerTarget = builtWith["compiler_target"]; + !compilerTarget.isUndefined()) { + result.androidAbi = abiFromCompilerTarget(compilerTarget.toString()); + } } if (ok) diff --git a/src/plugins/android/androidqtversion.h b/src/plugins/android/androidqtversion.h index 1549c870dae..f80cf92b5ad 100644 --- a/src/plugins/android/androidqtversion.h +++ b/src/plugins/android/androidqtversion.h @@ -37,6 +37,7 @@ public: struct BuiltWith { int apiVersion = -1; QVersionNumber ndkVersion; + QString androidAbi; }; static BuiltWith parseBuiltWith(const QByteArray &modulesCoreJsonData, bool *ok = nullptr); BuiltWith builtWith(bool *ok = nullptr) const; From 2480189c5bd111eae4f91d264a0386f80ddbe109 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 16:59:29 +0200 Subject: [PATCH 0975/1777] Squish: De-Q_OBJECT-ify SquishNavigationWidgetFactory Change-Id: I9c86ce75855a45f32f3752016acb1c8cc8c2d8ee Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/squish/squishnavigationwidget.cpp | 31 ++++++++++++-- src/plugins/squish/squishnavigationwidget.h | 42 +------------------ 2 files changed, 29 insertions(+), 44 deletions(-) diff --git a/src/plugins/squish/squishnavigationwidget.cpp b/src/plugins/squish/squishnavigationwidget.cpp index c8545a0ce9a..34077ad2555 100644 --- a/src/plugins/squish/squishnavigationwidget.cpp +++ b/src/plugins/squish/squishnavigationwidget.cpp @@ -24,11 +24,35 @@ #include <QMenu> #include <QVBoxLayout> -namespace Squish { -namespace Internal { +namespace Squish::Internal { const int defaultSectionSize = 17; +class SquishNavigationWidget : public QWidget +{ +public: + explicit SquishNavigationWidget(QWidget *parent = nullptr); + ~SquishNavigationWidget() override; + void contextMenuEvent(QContextMenuEvent *event) override; + static QList<QToolButton *> createToolButtons(); + +private: + void onItemActivated(const QModelIndex &idx); + void onExpanded(const QModelIndex &idx); + void onCollapsed(const QModelIndex &idx); + void onRowsInserted(const QModelIndex &parent, int, int); + void onRowsRemoved(const QModelIndex &parent, int, int); + void onRemoveSharedFolderTriggered(int row, const QModelIndex &parent); + void onRemoveAllSharedFolderTriggered(); + void onRecordTestCase(const QString &suiteName, const QString &testCase); + void onNewTestCaseTriggered(const QModelIndex &index); + + SquishTestTreeView *m_view; + SquishTestTreeModel *m_model; // not owned + SquishTestTreeSortModel *m_sortModel; +}; + + SquishNavigationWidget::SquishNavigationWidget(QWidget *parent) : QWidget(parent) { @@ -346,5 +370,4 @@ Core::NavigationView SquishNavigationWidgetFactory::createWidget() return view; } -} // namespace Internal -} // namespace Squish +} // Squish::Internal diff --git a/src/plugins/squish/squishnavigationwidget.h b/src/plugins/squish/squishnavigationwidget.h index d01a48cdd58..c0d9f0af203 100644 --- a/src/plugins/squish/squishnavigationwidget.h +++ b/src/plugins/squish/squishnavigationwidget.h @@ -5,47 +5,10 @@ #include <coreplugin/inavigationwidgetfactory.h> -#include <utils/navigationtreeview.h> - -QT_BEGIN_NAMESPACE -class QToolButton; -QT_END_NAMESPACE - -namespace Squish { -namespace Internal { - -class SquishTestTreeModel; -class SquishTestTreeSortModel; -class SquishTestTreeView; - -class SquishNavigationWidget : public QWidget -{ - Q_OBJECT -public: - explicit SquishNavigationWidget(QWidget *parent = nullptr); - ~SquishNavigationWidget() override; - void contextMenuEvent(QContextMenuEvent *event) override; - static QList<QToolButton *> createToolButtons(); - -private: - void onItemActivated(const QModelIndex &idx); - void onExpanded(const QModelIndex &idx); - void onCollapsed(const QModelIndex &idx); - void onRowsInserted(const QModelIndex &parent, int, int); - void onRowsRemoved(const QModelIndex &parent, int, int); - void onRemoveSharedFolderTriggered(int row, const QModelIndex &parent); - void onRemoveAllSharedFolderTriggered(); - void onRecordTestCase(const QString &suiteName, const QString &testCase); - void onNewTestCaseTriggered(const QModelIndex &index); - - SquishTestTreeView *m_view; - SquishTestTreeModel *m_model; // not owned - SquishTestTreeSortModel *m_sortModel; -}; +namespace Squish::Internal { class SquishNavigationWidgetFactory : public Core::INavigationWidgetFactory { - Q_OBJECT public: SquishNavigationWidgetFactory(); @@ -53,5 +16,4 @@ private: Core::NavigationView createWidget() override; }; -} // namespace Internal -} // namespace Squish +} // Squish::Internal From 50b14b5046101efd5c87fa329205773b028d7f22 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Thu, 31 Aug 2023 14:13:57 +0200 Subject: [PATCH 0976/1777] Doc: Replace "Advanced Use" with "Reference" Will move some topics to how-to topics in a follow-up change. Task-number: QTCREATORBUG-29361 Change-Id: I7a7475844faafa9dfae9f2f4e3f6940959022c54 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../src/cmake/creator-projects-cmake.qdoc | 18 ++-- .../src/conan/creator-projects-conan.qdoc | 7 +- .../creator-only/creator-debugger.qdoc | 2 +- .../src/howto/creator-keyboard-shortcuts.qdoc | 5 +- .../src/howto/creator-only/creator-cli.qdoc | 55 ++---------- .../src/howto/creator-only/creator-vcpkg.qdoc | 11 ++- doc/qtcreator/src/howto/creator-sessions.qdoc | 2 +- .../creator-projects-incredibuild.qdoc | 9 +- .../creator-embedded-platforms.qdoc | 9 +- .../src/meson/creator-projects-meson.qdoc | 22 ++--- .../creator-only/creator-advanced.qdoc | 88 ------------------- .../creator-desktop-platforms.qdoc | 10 ++- .../creator-mobile-platforms.qdoc | 8 +- .../creator-only/creator-reference.qdoc | 9 ++ .../creator-supported-platforms.qdoc | 18 ++-- .../creator-projects-autotools.qdoc | 10 ++- .../creator-projects-custom-wizards.qdoc | 2 +- .../creator-projects-generic.qdoc | 10 ++- .../creator-only/creator-projects-nimble.qdoc | 8 +- .../creator-only/creator-projects-other.qdoc | 78 ---------------- .../creator-only/creator-projects-qbs.qdoc | 11 ++- doc/qtcreator/src/qtcreator-toc.qdoc | 66 +++++++------- doc/qtcreator/src/qtcreator.qdoc | 20 ++--- 23 files changed, 158 insertions(+), 320 deletions(-) delete mode 100644 doc/qtcreator/src/overview/creator-only/creator-advanced.qdoc delete mode 100644 doc/qtcreator/src/projects/creator-only/creator-projects-other.qdoc diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc index ef840274306..8d686f9f3fe 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc @@ -8,12 +8,16 @@ // ********************************************************************** /*! - \previouspage creator-project-other.html \page creator-project-cmake.html - \nextpage creator-project-qbs.html + \previouspage creator-reference.html + + \ingroup creator-reference-build-systems \title Setting Up CMake + \brief CMake is an alternative to qmake for automating the generation of + build systems. + CMake automates the configuration of build systems. It controls the software compilation process by using simple configuration files, called \c {CMakeLists.txt} files. CMake generates @@ -212,12 +216,6 @@ Syntax completion and highlighting work once your project successfully builds and links against the external library. - \section1 Related Topics - - \list - \li \l {Open projects} - \li \l {CMake Build Configuration} - \li \l {Specifying Run Settings} - \li \l {Deploying to Remote Linux} - \endlist + \sa {Open projects}, {CMake Build Configuration}, {Specifying Run Settings}, + {Deploying to Remote Linux} */ diff --git a/doc/qtcreator/src/conan/creator-projects-conan.qdoc b/doc/qtcreator/src/conan/creator-projects-conan.qdoc index 905e486c9ea..f081c850d22 100644 --- a/doc/qtcreator/src/conan/creator-projects-conan.qdoc +++ b/doc/qtcreator/src/conan/creator-projects-conan.qdoc @@ -3,11 +3,14 @@ /*! \page creator-project-conan.html - \previouspage creator-project-incredibuild.html - \nextpage creator-vcpkg.html + \previouspage creator-reference.html + + \ingroup creator-reference-build-systems \title Setting Up Conan + \brief The experimental Conan plugin integrates the Conan package manager. + \l {https://conan.io}{Conan} is a C/C++ package manager that speeds up the integration of C or C++ libraries into your own project. It's available on all the \l{Supported Platforms}{supported development platforms}. diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index 1c93720d9f6..caed3452f65 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -390,7 +390,7 @@ \endlist - For more information, see \l{Using Command Line Options}. + For more information, see \l{Command Line Options}. */ /*! diff --git a/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc b/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc index 878a0f6cca6..910e89dd97a 100644 --- a/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc +++ b/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc @@ -13,14 +13,15 @@ \previouspage creator-project-managing-sessions.html \nextpage studio-projects.html \else - \previouspage creator-cli.html - \nextpage creator-editor-external.html + \previouspage creator-reference.html \endif \ingroup creator-reference \title Keyboard Shortcuts + \brief Default keyboard shortcuts. + \QC has various keyboard shortcuts that speed up your development process. To view all \QC functions in and their keyboard shortcuts, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Environment > diff --git a/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc b/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc index 7fd9687c0ce..3c21196793f 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,58 +8,20 @@ // ********************************************************************** /*! - \previouspage creator-vcpkg.html \page creator-cli.html - \nextpage creator-keyboard-shortcuts.html + \previouspage creator-reference.html - \title Using Command Line Options + \ingroup creator-reference - You can start \QC and specify some options from the command line. For - example, you can open a file to any line and column. + \title Command Line Options + + \brief Options for starting \QC from the command line. To specify command line options, enter the following command in the \QC installation or build directory: - \c {qtcreator [option] [filename[:line_number[:column_number]]]} - - \note You can use either a colon (:) or a plus sign (+) as a separator - between the filename and line number and the line number and the column - number. You can also use a space between the separator and the line number. - - For example, on Windows: - - \list - - \li \c {C:\qtcreator\bin>qtcreator -help} - - \li \c {C:\qtcreator\bin>qtcreator C:\TextFinder\textfinder.cpp:100:2} - - \li \c {C:\qtcreator\bin>qtcreator C:\TextFinder\textfinder.cpp +100+2} - - \endlist - - On \macos: - - \list - - \li \c {Qt\ Creator.app/Contents/MacOS/Qt\ Creator -help} - - \endlist - - To open a project that is located in a particular folder, you can pass on - the folder name as a command line argument. \QC looks for a session that - matches the folder name and loads it. Or it looks for a project file in the - folder and opens it. For example: - - \c {qtcreator .} - - \note To run a self-built \QC from the command line on Windows, make sure - that the Qt installation directory is included in the PATH environment - variable. You can enter the following command on the command line to add Qt - to the path: - - \code - set PATH=<Qt_installation_directory>\mingw\bin;c:<Qt_installation_directory>\bin;%PATH% + \badcode + qtcreator [option] [filename[:line_number[:column_number]]] \endcode The following table summarizes the available options: @@ -262,4 +224,5 @@ You can also switch to a dark theme to customize the appearance of widgets, colors, and icons without using stylesheets. + \sa {Run Qt Creator from the command line} */ diff --git a/doc/qtcreator/src/howto/creator-only/creator-vcpkg.qdoc b/doc/qtcreator/src/howto/creator-only/creator-vcpkg.qdoc index 84b3580bd69..456e793aa01 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-vcpkg.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-vcpkg.qdoc @@ -3,13 +3,16 @@ /*! \page creator-vcpkg.html - \previouspage creator-project-conan.html - \nextpage creator-cli.html + \previouspage creator-reference.html + + \ingroup creator-reference-build-systems \title Managing Packages with vcpkg - The experimental vcpkg plugin integrates the \l {https://vcpkg.io/en/}{vcpkg} - C/C++ package manager into \QC. It's available on all the + \brief The experimental vcpkg plugin integrates the vcpkg C/C++ package + manager into \QC. + + \l {https://vcpkg.io/en/}{vcpkg} is available on all the \l{Supported Platforms}{supported development platforms}. You can use \QC to create and edit vcpkg.json files to specify packages to diff --git a/doc/qtcreator/src/howto/creator-sessions.qdoc b/doc/qtcreator/src/howto/creator-sessions.qdoc index 203df259f28..2e2f95cc105 100644 --- a/doc/qtcreator/src/howto/creator-sessions.qdoc +++ b/doc/qtcreator/src/howto/creator-sessions.qdoc @@ -96,7 +96,7 @@ When you start \QC from the command line, you can give the name of a session as an argument and \QC will start with this session. - For more information, see \l{Using Command Line Options}. + For more information, see \l{Command Line Options}. \endif */ diff --git a/doc/qtcreator/src/incredibuild/creator-projects-incredibuild.qdoc b/doc/qtcreator/src/incredibuild/creator-projects-incredibuild.qdoc index 02281f3c3b6..4cd352fb289 100644 --- a/doc/qtcreator/src/incredibuild/creator-projects-incredibuild.qdoc +++ b/doc/qtcreator/src/incredibuild/creator-projects-incredibuild.qdoc @@ -1,13 +1,16 @@ -// 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 /*! - \previouspage creator-project-meson.html \page creator-project-incredibuild.html - \nextpage creator-project-conan.html + \previouspage creator-reference.html + + \ingroup creator-reference-build-systems \title Setting Up IncrediBuild + \brief IncrediBuild decreases the time it takes to build C++ code. + \l{https://www.incredibuild.com/}{IncrediBuild} accelerates process execution and thus shortens the time you spend on building C++ code. In addition, you can view the build progress in the graphical Build diff --git a/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc b/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc index 8f7a7378392..d22c7dec114 100644 --- a/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc +++ b/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc @@ -3,11 +3,14 @@ /*! \page creator-embedded-platforms.html - \previouspage creator-desktop-platforms.html - \nextpage creator-mobile-platforms.html + \previouspage creator-reference.html + + \ingroup creator-reference \title Embedded Platforms + \brief Embedded platforms that you can develop applications for. + You can develop applications for the following embedded platforms: \list @@ -110,4 +113,6 @@ \li \l{Running on QNX Devices} \li \l{Qt for QNX} \endlist + + \sa {Supported Platforms} */ diff --git a/doc/qtcreator/src/meson/creator-projects-meson.qdoc b/doc/qtcreator/src/meson/creator-projects-meson.qdoc index f0f75018211..2ba20f55a93 100644 --- a/doc/qtcreator/src/meson/creator-projects-meson.qdoc +++ b/doc/qtcreator/src/meson/creator-projects-meson.qdoc @@ -1,21 +1,23 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-project-nimble.html \page creator-project-meson.html - \nextpage creator-project-incredibuild.html + \previouspage creator-reference.html + + \ingroup creator-reference-build-systems \title Setting Up Meson + \brief Use Meson to build native desktop applications. + \l{https://mesonbuild.com/}{Meson} is an open source and multi-platform build system generator using Ninja as main backend. Build definitions are located in \c {meson.build} files while build options are located in \c {meson_options.txt}. - Meson build support in \QC is not mature yet, you can only use it to build - native desktop applications. Many features available with Meson build or - usually available from \QC are missing. + \note Many features available with Meson build or usually available from \QC + are missing. \QC automatically detects the Meson and Ninja executables specified in the \c PATH. You can add paths to other Meson or Ninja executables and use them @@ -84,11 +86,5 @@ \li Adding files to Meson projects from \QC. \endlist - \section1 Related Topics - - \list - \li \l {Open projects} - \li \l {Meson Build Configuration} - \li \l {Specifying Run Settings} - \endlist + \sa {Open projects}, {Meson Build Configuration}, {Specifying Run Settings} */ diff --git a/doc/qtcreator/src/overview/creator-only/creator-advanced.qdoc b/doc/qtcreator/src/overview/creator-only/creator-advanced.qdoc deleted file mode 100644 index 661c72f9f06..00000000000 --- a/doc/qtcreator/src/overview/creator-only/creator-advanced.qdoc +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -// ********************************************************************** -// NOTE: the sections are not ordered by their logical order to avoid -// reshuffling the file each time the index order changes (i.e., often). -// Run the fixnavi.pl script to adjust the links to the index order. -// ********************************************************************** - -/*! - \previouspage creator-squish.html - \page creator-advanced.html - \nextpage creator-os-supported-platforms.html - - \title Advanced Use - - \image front-advanced.png - - \QC attempts to meet your development needs, whether you are an - experienced Qt developer or a newcomer to Qt. When you install \QC - as a part of \QSDK, the default configuration allows you to start coding, - building, running and debugging applications with very little effort. - - However, you can easily change or extend the default configuration, by - choosing a different build system or integrating external tools. - - You can also use special options to start \QC from the command line and use - it mainly from the keyboard. - - \list - - \li \l{Supported Platforms} - - You can install and run \QC on several operating systems to create - applications for multiple desktop and \l{glossary-device}{device} - platforms. - - \li \l{Build Systems} - - \QC is integrated with cross-platform systems for build automation: - qmake, Qbs, CMake, and Autotools. In addition, you can import - generic projects that do not use those systems, and specify that \QC - ignores your build system. - - \li \l{Using Command Line Options} - - You can start \QC and specify some options for running it from the - command line. - - \li \l{Keyboard Shortcuts} - - \QC has keyboard shortcuts that speed up your development - process. You can change the keyboard shortcuts, as well as import - and export keyboard shortcut mapping schemes. - - \li \l{Using External Tools} - - You can use external tools directly from \QC. Qt Linguist, - QML utilities, the default text editor for your system, and the - \c sort tool are preconfigured for use. You can change their default - configurations and configure new tools. - - \endlist - - \section1 Related Topics - - \list - - \li \l{Showing Task List Files in Issues} - - You can load report files created by code scanning and analysis - tools to \l Issues. You can navigate to the corresponding source - code by clicking the error message or by using keyboard shortcuts. - - \li \l{Inspecting Internal Logs} - - You can inspect internal log messages of \QC. They may be - helpful when developing \QC or investigating problems. - - \li \l{Managing Data Collection} - - If you agreed to pseudonymous data collection during \QC - installation, you can turn it on and determine what type - of data is collected and transmitted to the backend storage. - - \endlist - -*/ diff --git a/doc/qtcreator/src/overview/creator-only/creator-desktop-platforms.qdoc b/doc/qtcreator/src/overview/creator-only/creator-desktop-platforms.qdoc index 91696e03c1c..8e1722f59d0 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-desktop-platforms.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-desktop-platforms.qdoc @@ -3,11 +3,15 @@ /*! \page creator-desktop-platforms.html - \previouspage creator-os-supported-platforms.html - \nextpage creator-embedded-platforms.html + \previouspage creator-reference.html + + \ingroup creator-reference \title Desktop Platforms + \brief Requirements for operating systems that you can install and run \QC + on. + \QC is available in binary packages for the following operating systems: \list @@ -66,4 +70,6 @@ To build \QC from the source, see the requirements and instructions in the readme file that is located in the source repository. + + \sa {Supported Platforms} */ diff --git a/doc/qtcreator/src/overview/creator-only/creator-mobile-platforms.qdoc b/doc/qtcreator/src/overview/creator-only/creator-mobile-platforms.qdoc index c6d689547b6..fa9ef13bf9c 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-mobile-platforms.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-mobile-platforms.qdoc @@ -3,11 +3,14 @@ /*! \page creator-mobile-platforms.html - \previouspage creator-embedded-platforms.html - \nextpage creator-project-other.html + \previouspage creator-reference.html + + \ingroup creator-reference \title Mobile Platforms + \brief Mobile platforms that you can develop applications for. + You can develop applications for the following mobile platforms: \list @@ -60,4 +63,5 @@ \li \l{Qt for iOS} \endlist + \sa {Supported Platforms} */ diff --git a/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc b/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc index 75c04dfab51..c52d8005e13 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc @@ -10,6 +10,15 @@ \annotatedlist creator-reference + \section1 Build Systems + + Most \QC project wizards enable you to choose the build system to use for + building the project: qmake, CMake, Meson, or Qbs. qmake is installed and + configured when you install Qt. To use one of the other supported build + systems, you need to set it up. + + \annotatedlist creator-reference-build-systems + \section1 Sidebar Views \annotatedlist creator-reference-sidebar-views diff --git a/doc/qtcreator/src/overview/creator-only/creator-supported-platforms.qdoc b/doc/qtcreator/src/overview/creator-only/creator-supported-platforms.qdoc index e7da4b12c7e..7dc67a57bbf 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-supported-platforms.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-supported-platforms.qdoc @@ -1,13 +1,17 @@ -// 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 /*! - \previouspage creator-advanced.html + \page creator-os-supported-platforms.html - \nextpage creator-desktop-platforms.html + \previouspage creator-reference.html + + \ingroup creator-reference \title Supported Platforms + \brief Summary of development and target platforms. + You can install and run \QC on several operating systems to create applications for multiple desktop, embedded, and mobile device platforms, as well as web browsers (experimental). @@ -72,11 +76,5 @@ specified in \uicontrol Edit > \uicontrol Preferences \uicontrol Environment > \uicontrol Update. - For more information on the requirements for each platform, see: - - \list - \li \l {Desktop Platforms} - \li \l {Embedded Platforms} - \li \l {Mobile Platforms} - \endlist + \sa {Desktop Platforms}, {Embedded Platforms}, {Mobile Platforms} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-autotools.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-autotools.qdoc index 31cc7ba2987..a33de36884e 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-autotools.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-autotools.qdoc @@ -1,13 +1,17 @@ -// Copyright (C) 2018 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-project-qbs.html \page creator-projects-autotools.html - \nextpage creator-project-generic.html + \previouspage creator-reference.html + + \ingroup creator-reference-build-systems \title Setting Up an Autotools Project + \brief \QC can open projects that use the Autotools build system. You can + build and run the projects directly from \QC. + The AutotoolsProjectManager is a plugin for autotools support. It is disabled by default. To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol {Build Systems} > diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc index 6e1b2c6861d..57ad34d3b3b 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc @@ -146,7 +146,7 @@ /global/genericfilewizard.png" not found. \endcode - See \l{Using Command Line Options} for more information about command line + See \l{Command Line Options} for more information about command line arguments. \include creator-projects-custom-wizards-json.qdocinc json wizards diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-generic.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-generic.qdoc index c4ebbdb3e62..cd37ea22330 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-generic.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-generic.qdoc @@ -8,12 +8,18 @@ // ********************************************************************** /*! - \previouspage creator-projects-autotools.html \page creator-project-generic.html - \nextpage creator-project-nimble.html + \previouspage creator-reference.html + + \ingroup creator-reference-build-systems \title Setting Up a Generic Project + \brief \QC supports generic projects, so you can import existing projects + that do not use qmake or CMake. This enables you to use \QC as a + code editor and to fully control the steps and commands used to + build the project. + Generic project support allows you to use \QC as a code editor. You can change the way your project is built by modifying the \c make command in the \uicontrol{Projects} mode under \uicontrol{Build Settings}. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc index b183eec8917..1b89d7a3e22 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc @@ -2,12 +2,16 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-project-generic.html \page creator-project-nimble.html - \nextpage creator-project-meson.html + \previouspage creator-reference.html + + \ingroup creator-reference-build-systems \title Setting Up Nimble + \brief The Nimble package manager generates Nim application + executables that are supported on Windows, Linux, and \macos. + \l {https://github.com/nim-lang/nimble#readme}{Nimble} is a package manager for the Nim programming language. It is delivered with \l{https://nim-lang.org/}{Nim} and uses the Nim compiler to generate diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-other.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-other.qdoc deleted file mode 100644 index 232bb7d4fa1..00000000000 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-other.qdoc +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -// ********************************************************************** -// NOTE: the sections are not ordered by their logical order to avoid -// reshuffling the file each time the index order changes (i.e., often). -// Run the fixnavi.pl script to adjust the links to the index order. -// ********************************************************************** - -/*! - \previouspage creator-os-supported-platforms.html - \page creator-project-other.html - \nextpage creator-project-cmake.html - - \title Build Systems - - Most \QC project wizards enable you to choose the build system to use for - building the project: qmake, CMake, Meson, or Qbs. qmake is installed and - configured when you install Qt. To use one of the other supported build - systems, you need to set it up, as described in the following sections: - - \list - - \li \l{Setting Up CMake} - - CMake is an alternative to qmake for automating the generation of - build configurations. - - \li \l{Setting Up Qbs} - - \l{Qbs Manual}{Qbs} is an all-in-one build - tool that generates a build graph from a high-level project - description (like qmake or CMake do) and executes the commands in - the low-level build graph (like make does). - - \li \l{Setting Up an Autotools Project} - - \QC can open projects that use the Autotools build system. You can - build and run the projects directly from \QC. - - \li \l{Setting Up a Generic Project} - - \QC supports generic projects, so you can import existing projects - that do not use qmake or CMake. This enables you to use \QC as a - code editor and to fully control the steps and commands used to - build the project. - - \li \l{Setting Up Nimble} - - The experimental \l{https://nim-lang.org/}{Nim} plugin integrates - the Nimble package manager for generating Nim application - executables that are supported on Windows, Linux, and \macos. - - \li \l{Setting Up Meson} - - Meson is an open source build system meant to be both extremely fast, - and, even more importantly, as user friendly as possible. - - \li \l{Setting Up IncrediBuild} - - IncrediBuild decreases the time it takes to build C++ code. - - \li \l{Setting Up Conan} - - The experimental Conan plugin integrates the Conan package manager - that speeds up the integration of C or C++ libraries into your - project. You can use Conan with most build systems integrated into - \QC. - - \li \l{Managing Packages with vcpkg} - - The experimental vcpkg plugin integrates the - \l {https://vcpkg.io/en/}{vcpkg} C/C++ package manager into \QC. - Create and edit vcpkg.json files to specify packages to build as - part of your project when using CMake as the build system. - \endlist - -*/ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc index 22bafa78bb7..fa663ba7609 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc @@ -1,13 +1,18 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-project-cmake.html \page creator-project-qbs.html - \nextpage creator-projects-autotools.html + \previouspage creator-reference.html + + \ingroup creator-reference-build-systems \title Setting Up Qbs + \brief \l{Qbs Manual}{Qbs} is an all-in-one build tool that generates a build + graph from a high-level project description (like qmake or CMake do) and + executes the commands in the low-level build graph (like make does). + To use Qbs to build a project, you must create a .qbs file for the project. You can use \QC to create a C or C++ project that is built with Qbs. For more information about Qbs, see diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 9edf08634a4..a254c2fabc2 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -197,36 +197,6 @@ \li \l{Running Autotests} \li \l{Using Squish} \endlist - \li \l{Advanced Use} - \list - \li \l{Supported Platforms} - \list - \li \l {Desktop Platforms} - \li \l {Embedded Platforms} - \li \l {Mobile Platforms} - \endlist - \li \l{Build Systems} - \list - \li \l{Setting Up CMake} - \li \l{Setting Up Qbs} - \li \l{Setting Up an Autotools Project} - \li \l{Setting Up a Generic Project} - \li \l{Setting Up Nimble} - \li \l{Setting Up Meson} - \li \l{Setting Up IncrediBuild} - \li \l{Setting Up Conan} - \li \l{Managing Packages with vcpkg} - \endlist - \li \l{Using Command Line Options} - \li \l{Keyboard Shortcuts} - \li \l{Using External Tools} - \li \l{Showing Task List Files in Issues} - \li \l{Inspecting Internal Logs} - \li \l{Managing Data Collection} - \list - \li \l {Collecting Usage Statistics} - \endlist - \endlist \li \l{Getting Help} \list \li \l{Using the Help Mode} @@ -286,15 +256,46 @@ \endlist \li Use \QC \list + \li \l {Collect usage statistics} \li \l {Enable and disable plugins} \li \l {Find settings files} + \li \l {Inspect internal logs} \li \l {Install plugins} + \li \l {Manage data collection} \li \l {Run \QC from the command line} + \li \l {Use external text editors} + \li \l {Use external tools} + \li \l {Use Qt Linguist} \endlist \endlist + \li \l{Known Issues} + \li \l{Glossary} + \li \l{Technical Support} + \li \l{Acknowledgements} + \endlist \li \l{Reference} \list + \li \l {Build Systems} + \list + \li \l{Managing Packages with vcpkg} + \li \l{Setting Up CMake} + \li \l{Setting Up Conan} + \li \l{Setting Up IncrediBuild} + \li \l{Setting Up Nimble} + \li \l{Setting Up Meson} + \li \l{Setting Up Qbs} + \li \l{Setting Up a Generic Project} + \li \l{Setting Up an Autotools Project} + \endlist + \li \l {Command Line Options} \li \l {Custom Wizards} + \li \l {Keyboard Shortcuts} + \li \l {Supported Platforms} + \list + \li \l {Desktop Platforms} + \li \l {Embedded Platforms} + \li \l {Mobile Platforms} + \endlist \li Sidebar Views \list \li \l {Call Hierarchy} @@ -315,10 +316,5 @@ \li \l {To-Do Entries} \endlist \endlist - \li \l{Known Issues} - \li \l{Glossary} - \li \l{Technical Support} - \li \l{Acknowledgements} - \endlist \endlist */ diff --git a/doc/qtcreator/src/qtcreator.qdoc b/doc/qtcreator/src/qtcreator.qdoc index d1aba95665d..472cec65b59 100644 --- a/doc/qtcreator/src/qtcreator.qdoc +++ b/doc/qtcreator/src/qtcreator.qdoc @@ -73,8 +73,8 @@ \row \li \inlineimage front-preview.png \li \inlineimage front-testing.png - \li \inlineimage front-advanced.png \li \inlineimage front-help.png + \li \inlineimage front-advanced.png \row \li \b {\l{Building and Running}} \list @@ -91,23 +91,23 @@ \li \l{Running Autotests} \li \l{Using Squish} \endlist - \li \b {\l{Advanced Use}} - \list - \li \l{Supported Platforms} - \li \l{Build Systems} - \li \l{Using Command Line Options} - \li \l{Keyboard Shortcuts} - \li \l{Using External Tools} - \endlist \li \b {\l{Getting Help}} \list \li \l{Using the Help Mode} \li \l{FAQ} \li \l{How-to} - \li \l{Reference} \li \l{Known Issues} \li \l{Glossary} \endlist + \li \b {\l{Reference}} + \list + \li \l {Build Systems} + \li \l {Command Line Options} + \li \l {Custom Wizards} + \li \l {Keyboard Shortcuts} + \li \l {Supported Platforms} + \li \l {Reference}{See More...} + \endlist \row \li {4,1} \b {Contact Us} \list From 68cdbd9cd0fa8156ff97a59437e0ff221cbdbc32 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 17:20:10 +0200 Subject: [PATCH 0977/1777] Core: Hide part of OpenEditors implementation Change-Id: I4c7a2a62e9395450b44b96a5333135fbed773992 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../editormanager/openeditorsview.cpp | 50 +++++++++++++++- .../editormanager/openeditorsview.h | 57 +------------------ 2 files changed, 50 insertions(+), 57 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.cpp b/src/plugins/coreplugin/editormanager/openeditorsview.cpp index 3cbc9b4aec8..ebf2d751ec9 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorsview.cpp @@ -8,18 +8,64 @@ #include "ieditor.h" #include "../actionmanager/command.h" #include "../coreplugintr.h" +#include "../opendocumentstreeview.h" #include <utils/fsengine/fileiconprovider.h> #include <utils/qtcassert.h> +#include <QAbstractProxyModel> #include <QApplication> #include <QMenu> namespace Core::Internal { -//// +class ProxyModel : public QAbstractProxyModel +{ +public: + explicit ProxyModel(QObject *parent = nullptr); + + QModelIndex mapFromSource(const QModelIndex & sourceIndex) const override; + QModelIndex mapToSource(const QModelIndex & proxyIndex) const override; + + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex &child) const override; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + + void setSourceModel(QAbstractItemModel *sourceModel) override; + + QVariant data(const QModelIndex &index, int role) const override; + + // QAbstractProxyModel::sibling is broken in Qt 5 + QModelIndex sibling(int row, int column, const QModelIndex &idx) const override; + // QAbstractProxyModel::supportedDragActions delegation is missing in Qt 5 + Qt::DropActions supportedDragActions() const override; + +private: + void sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); + void sourceRowsRemoved(const QModelIndex &parent, int start, int end); + void sourceRowsInserted(const QModelIndex &parent, int start, int end); + void sourceRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); + void sourceRowsAboutToBeInserted(const QModelIndex &parent, int start, int end); +}; + // OpenEditorsWidget -//// + +class OpenEditorsWidget : public OpenDocumentsTreeView +{ +public: + OpenEditorsWidget(); + ~OpenEditorsWidget() override; + +private: + void handleActivated(const QModelIndex &); + void updateCurrentItem(IEditor*); + void contextMenuRequested(QPoint pos); + void activateEditor(const QModelIndex &index); + void closeDocument(const QModelIndex &index); + + ProxyModel *m_model; +}; OpenEditorsWidget::OpenEditorsWidget() { diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.h b/src/plugins/coreplugin/editormanager/openeditorsview.h index 0634e45f7d2..0ba5a41961c 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.h +++ b/src/plugins/coreplugin/editormanager/openeditorsview.h @@ -4,60 +4,8 @@ #pragma once #include <coreplugin/inavigationwidgetfactory.h> -#include <coreplugin/opendocumentstreeview.h> -#include <QAbstractProxyModel> -#include <QCoreApplication> - -namespace Core { -class IEditor; - -namespace Internal { - -class ProxyModel : public QAbstractProxyModel -{ -public: - explicit ProxyModel(QObject *parent = nullptr); - QModelIndex mapFromSource(const QModelIndex & sourceIndex) const override; - QModelIndex mapToSource(const QModelIndex & proxyIndex) const override; - - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; - QModelIndex parent(const QModelIndex &child) const override; - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - int columnCount(const QModelIndex &parent = QModelIndex()) const override; - - void setSourceModel(QAbstractItemModel *sourceModel) override; - - QVariant data(const QModelIndex &index, int role) const override; - - // QAbstractProxyModel::sibling is broken in Qt 5 - QModelIndex sibling(int row, int column, const QModelIndex &idx) const override; - // QAbstractProxyModel::supportedDragActions delegation is missing in Qt 5 - Qt::DropActions supportedDragActions() const override; - -private: - void sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); - void sourceRowsRemoved(const QModelIndex &parent, int start, int end); - void sourceRowsInserted(const QModelIndex &parent, int start, int end); - void sourceRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); - void sourceRowsAboutToBeInserted(const QModelIndex &parent, int start, int end); -}; - -class OpenEditorsWidget : public OpenDocumentsTreeView -{ -public: - OpenEditorsWidget(); - ~OpenEditorsWidget() override; - -private: - void handleActivated(const QModelIndex &); - void updateCurrentItem(IEditor*); - void contextMenuRequested(QPoint pos); - void activateEditor(const QModelIndex &index); - void closeDocument(const QModelIndex &index); - - ProxyModel *m_model; -}; +namespace Core::Internal { class OpenEditorsViewFactory : public INavigationWidgetFactory { @@ -67,5 +15,4 @@ public: NavigationView createWidget() override; }; -} // namespace Internal -} // namespace Core +} // Core::Internal From fbd243e82e6f743a969556baa2fb8f77bd5dbf9e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 17:29:09 +0200 Subject: [PATCH 0978/1777] CppEditor: Hide part of CppTypeHierarchy implementation Change-Id: I5635f320e7d746702e6e86bd5f4e8cc749c804f5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/cppeditor/cpptypehierarchy.cpp | 177 +++++++++++++-------- src/plugins/cppeditor/cpptypehierarchy.h | 89 +---------- 2 files changed, 110 insertions(+), 156 deletions(-) diff --git a/src/plugins/cppeditor/cpptypehierarchy.cpp b/src/plugins/cppeditor/cpptypehierarchy.cpp index 837375b6f37..228e494a70d 100644 --- a/src/plugins/cppeditor/cpptypehierarchy.cpp +++ b/src/plugins/cppeditor/cpptypehierarchy.cpp @@ -12,26 +12,83 @@ #include <coreplugin/find/itemviewfind.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/progressmanager/progressmanager.h> + #include <texteditor/texteditor.h> + #include <utils/algorithm.h> #include <utils/delegates.h> #include <utils/dropsupport.h> +#include <utils/futuresynchronizer.h> #include <utils/navigationtreeview.h> #include <utils/progressindicator.h> -#include <QApplication> +#include <QFuture> +#include <QFutureWatcher> #include <QLabel> #include <QLatin1String> #include <QMenu> #include <QModelIndex> +#include <QSharedPointer> #include <QStackedLayout> +#include <QStackedWidget> +#include <QStandardItemModel> #include <QVBoxLayout> -using namespace CppEditor; -using namespace CppEditor::Internal; using namespace Utils; -namespace { +namespace CppEditor::Internal { + +class CppClass; +class CppElement; + +class CppTypeHierarchyModel : public QStandardItemModel +{ +public: + CppTypeHierarchyModel(QObject *parent) + : QStandardItemModel(parent) + {} + + Qt::DropActions supportedDragActions() const override; + QStringList mimeTypes() const override; + QMimeData *mimeData(const QModelIndexList &indexes) const override; +}; + +class CppTypeHierarchyWidget : public QWidget +{ +public: + CppTypeHierarchyWidget(); + + void perform(); + +private: + void displayHierarchy(); + typedef QList<CppClass> CppClass::*HierarchyMember; + void performFromExpression(const QString &expression, const FilePath &filePath); + QStandardItem *buildHierarchy(const CppClass &cppClass, QStandardItem *parent, + bool isRoot, HierarchyMember member); + void showNoTypeHierarchyLabel(); + void showTypeHierarchy(); + void showProgress(); + void hideProgress(); + void clearTypeHierarchy(); + void onItemActivated(const QModelIndex &index); + void onItemDoubleClicked(const QModelIndex &index); + + CppEditorWidget *m_cppEditor = nullptr; + NavigationTreeView *m_treeView = nullptr; + QWidget *m_hierarchyWidget = nullptr; + QStackedLayout *m_stackLayout = nullptr; + QStandardItemModel *m_model = nullptr; + AnnotatedItemDelegate *m_delegate = nullptr; + TextEditor::TextEditorLinkLabel *m_inspectedClass = nullptr; + QLabel *m_infoLabel = nullptr; + QFuture<QSharedPointer<CppElement>> m_future; + QFutureWatcher<void> m_futureWatcher; + FutureSynchronizer m_synchronizer; + ProgressIndicator *m_progressIndicator = nullptr; + QString m_oldClass; + bool m_showOldClass = false; +}; enum ItemRole { AnnotationRole = Qt::UserRole + 1, @@ -61,55 +118,44 @@ QList<CppClass> sortClasses(const QList<CppClass> &cppClasses) }); } -} // Anonymous - class CppTypeHierarchyTreeView : public NavigationTreeView { - Q_OBJECT public: - CppTypeHierarchyTreeView(QWidget *parent); + CppTypeHierarchyTreeView(QWidget *parent) + : NavigationTreeView(parent) + {} - void contextMenuEvent(QContextMenuEvent *event) override; + void contextMenuEvent(QContextMenuEvent *event) override + { + if (!event) + return; + + QMenu contextMenu; + + QAction *action = contextMenu.addAction(Tr::tr("Open in Editor")); + connect(action, &QAction::triggered, this, [this] () { + emit activated(currentIndex()); + }); + action = contextMenu.addAction(Tr::tr("Open Type Hierarchy")); + connect(action, &QAction::triggered, this, [this] () { + emit doubleClicked(currentIndex()); + }); + + contextMenu.addSeparator(); + + action = contextMenu.addAction(Tr::tr("Expand All")); + connect(action, &QAction::triggered, this, &QTreeView::expandAll); + action = contextMenu.addAction(Tr::tr("Collapse All")); + connect(action, &QAction::triggered, this, &QTreeView::collapseAll); + + contextMenu.exec(event->globalPos()); + + event->accept(); + } }; - -CppTypeHierarchyTreeView::CppTypeHierarchyTreeView(QWidget *parent) : - NavigationTreeView(parent) -{ -} - -void CppTypeHierarchyTreeView::contextMenuEvent(QContextMenuEvent *event) -{ - if (!event) - return; - - QMenu contextMenu; - - QAction *action = contextMenu.addAction(Tr::tr("Open in Editor")); - connect(action, &QAction::triggered, this, [this] () { - emit activated(currentIndex()); - }); - action = contextMenu.addAction(Tr::tr("Open Type Hierarchy")); - connect(action, &QAction::triggered, this, [this] () { - emit doubleClicked(currentIndex()); - }); - - contextMenu.addSeparator(); - - action = contextMenu.addAction(Tr::tr("Expand All")); - connect(action, &QAction::triggered, this, &QTreeView::expandAll); - action = contextMenu.addAction(Tr::tr("Collapse All")); - connect(action, &QAction::triggered, this, &QTreeView::collapseAll); - - contextMenu.exec(event->globalPos()); - - event->accept(); -} - -namespace CppEditor { -namespace Internal { - // CppTypeHierarchyWidget + CppTypeHierarchyWidget::CppTypeHierarchyWidget() { m_inspectedClass = new TextEditor::TextEditorLinkLabel(this); @@ -323,26 +369,6 @@ void CppTypeHierarchyWidget::onItemDoubleClicked(const QModelIndex &index) performFromExpression(getExpression(index), link.targetFilePath); } -// CppTypeHierarchyFactory -CppTypeHierarchyFactory::CppTypeHierarchyFactory() -{ - setDisplayName(Tr::tr("Type Hierarchy")); - setPriority(700); - setId(Constants::TYPE_HIERARCHY_ID); -} - -Core::NavigationView CppTypeHierarchyFactory::createWidget() -{ - auto w = new CppTypeHierarchyWidget; - w->perform(); - return {w, {}}; -} - -CppTypeHierarchyModel::CppTypeHierarchyModel(QObject *parent) - : QStandardItemModel(parent) -{ -} - Qt::DropActions CppTypeHierarchyModel::supportedDragActions() const { // copy & move actions to avoid idiotic behavior of drag and drop: @@ -369,7 +395,20 @@ QMimeData *CppTypeHierarchyModel::mimeData(const QModelIndexList &indexes) const return data; } -} // namespace Internal -} // namespace CppEditor +// CppTypeHierarchyFactory -#include "cpptypehierarchy.moc" +CppTypeHierarchyFactory::CppTypeHierarchyFactory() +{ + setDisplayName(Tr::tr("Type Hierarchy")); + setPriority(700); + setId(Constants::TYPE_HIERARCHY_ID); +} + +Core::NavigationView CppTypeHierarchyFactory::createWidget() +{ + auto w = new CppTypeHierarchyWidget; + w->perform(); + return {w, {}}; +} + +} // CppEditor::Internal diff --git a/src/plugins/cppeditor/cpptypehierarchy.h b/src/plugins/cppeditor/cpptypehierarchy.h index 4e782242224..37eaec2a78e 100644 --- a/src/plugins/cppeditor/cpptypehierarchy.h +++ b/src/plugins/cppeditor/cpptypehierarchy.h @@ -4,100 +4,15 @@ #pragma once #include <coreplugin/inavigationwidgetfactory.h> -#include <utils/futuresynchronizer.h> -#include <QFuture> -#include <QFutureWatcher> -#include <QList> -#include <QSharedPointer> -#include <QStackedWidget> -#include <QStandardItemModel> -#include <QString> -#include <QWidget> - -QT_BEGIN_NAMESPACE -class QLabel; -class QModelIndex; -class QStackedLayout; -class QStandardItem; -QT_END_NAMESPACE - -namespace TextEditor { class TextEditorLinkLabel; } - -namespace Utils { -class AnnotatedItemDelegate; -class NavigationTreeView; -class ProgressIndicator; -} - -namespace CppEditor { -class CppEditorWidget; - -namespace Internal { -class CppClass; -class CppElement; - -class CppTypeHierarchyModel : public QStandardItemModel -{ - Q_OBJECT - -public: - CppTypeHierarchyModel(QObject *parent); - - Qt::DropActions supportedDragActions() const override; - QStringList mimeTypes() const override; - QMimeData *mimeData(const QModelIndexList &indexes) const override; -}; - -class CppTypeHierarchyWidget : public QWidget -{ - Q_OBJECT -public: - CppTypeHierarchyWidget(); - - void perform(); - -private slots: - void displayHierarchy(); - -private: - typedef QList<CppClass> CppClass::*HierarchyMember; - void performFromExpression(const QString &expression, const Utils::FilePath &filePath); - QStandardItem *buildHierarchy(const CppClass &cppClass, QStandardItem *parent, - bool isRoot, HierarchyMember member); - void showNoTypeHierarchyLabel(); - void showTypeHierarchy(); - void showProgress(); - void hideProgress(); - void clearTypeHierarchy(); - void onItemActivated(const QModelIndex &index); - void onItemDoubleClicked(const QModelIndex &index); - - CppEditorWidget *m_cppEditor = nullptr; - Utils::NavigationTreeView *m_treeView = nullptr; - QWidget *m_hierarchyWidget = nullptr; - QStackedLayout *m_stackLayout = nullptr; - QStandardItemModel *m_model = nullptr; - Utils::AnnotatedItemDelegate *m_delegate = nullptr; - TextEditor::TextEditorLinkLabel *m_inspectedClass = nullptr; - QLabel *m_infoLabel = nullptr; - QFuture<QSharedPointer<CppElement>> m_future; - QFutureWatcher<void> m_futureWatcher; - Utils::FutureSynchronizer m_synchronizer; - Utils::ProgressIndicator *m_progressIndicator = nullptr; - QString m_oldClass; - bool m_showOldClass = false; -}; +namespace CppEditor::Internal { class CppTypeHierarchyFactory : public Core::INavigationWidgetFactory { - Q_OBJECT - public: CppTypeHierarchyFactory(); Core::NavigationView createWidget() override; }; -} // namespace Internal -} // namespace CppEditor +} // CppEditor::Internal From 79cc12ab8cb3cbdfb02a485f7bb2a46eaf717d61 Mon Sep 17 00:00:00 2001 From: Sami Shalayel <sami.shalayel@qt.io> Date: Thu, 31 Aug 2023 13:57:09 +0200 Subject: [PATCH 0979/1777] qmljseditordocument: fix quickfix shortkey QtC shows qmlls's warnings, but does not apply quick fixes to it when using the quickfix shortkey. In quickFixAssistProvider, use the base class implementation to detect running language clients and apply their quickfixes, and fallback to the builtin qml code model quickfix if no language client is running. Fixes: QTCREATORBUG-29557 Change-Id: I75262d13ab229f8d3b4069fc0003574d41cabab0 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/qmljseditor/qmljseditordocument.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 3b865570aca..065e39e0c37 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -856,6 +856,8 @@ Internal::QmlOutlineModel *QmlJSEditorDocument::outlineModel() const TextEditor::IAssistProvider *QmlJSEditorDocument::quickFixAssistProvider() const { + if (const auto baseProvider = TextDocument::quickFixAssistProvider()) + return baseProvider; return Internal::QmlJSEditorPlugin::quickFixAssistProvider(); } From 37022ff0dfa3031f559658bb2f3afb92e82b59d7 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 4 Sep 2023 12:37:01 +0200 Subject: [PATCH 0980/1777] CppEditor: Remove an unused member Change-Id: I6bf26bbd2f1c8542ae2d645f7db9e2eba3f7a33f Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cppeditor/cppeditorplugin.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 72d9eab85fd..51bd004d1a7 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -183,8 +183,6 @@ public: QPointer<CppCodeModelInspectorDialog> m_cppCodeModelInspectorDialog; - QPointer<TextEditor::BaseTextEditor> m_currentEditor; - CppOutlineWidgetFactory m_cppOutlineWidgetFactory; CppTypeHierarchyFactory m_cppTypeHierarchyFactory; CppIncludeHierarchyFactory m_cppIncludeHierarchyFactory; From 705232c7372eccc37d92b54706737829c8308945 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 31 Aug 2023 08:50:11 +0200 Subject: [PATCH 0981/1777] TextEditor: Allow overwriting undo handling In preparation for CompilerExplorer undo / redo handling. Change-Id: Iefad5cc497c8e439f626e375fe8862526b52a36e Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/texteditor/texteditor.h | 4 +- .../texteditor/texteditoractionhandler.cpp | 38 +++++++++++++++++-- .../texteditor/texteditoractionhandler.h | 6 +++ 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index 0540c86be57..4f0ea99c8d4 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -434,8 +434,8 @@ public: void indent(); void unindent(); - void undo(); - void redo(); + virtual void undo(); + virtual void redo(); void openLinkUnderCursor(); void openLinkUnderCursorInNextSplit(); diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index d22f8c96570..d8405d33469 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -100,6 +100,9 @@ public: void updateCurrentEditor(Core::IEditor *editor); + void setCanUndoCallback(const TextEditorActionHandler::Predicate &callback); + void setCanRedoCallback(const TextEditorActionHandler::Predicate &callback); + public: TextEditorActionHandler::TextEditorWidgetResolver m_findTextWidget; QAction *m_undoAction = nullptr; @@ -124,8 +127,12 @@ public: uint m_optionalActions = TextEditorActionHandler::None; QPointer<TextEditorWidget> m_currentEditorWidget; + QPointer<Core::IEditor> m_currentEditor; Utils::Id m_editorId; Utils::Id m_contextId; + + TextEditorActionHandler::Predicate m_canUndoCallback; + TextEditorActionHandler::Predicate m_canRedoCallback; }; TextEditorActionHandlerPrivate::TextEditorActionHandlerPrivate @@ -463,9 +470,17 @@ void TextEditorActionHandlerPrivate::updateActions() m_textWrappingAction->setChecked(m_currentEditorWidget->displaySettings().m_textWrapping); } - updateRedoAction(m_currentEditorWidget && m_currentEditorWidget->document()->isRedoAvailable()); - updateUndoAction(m_currentEditorWidget && m_currentEditorWidget->document()->isUndoAvailable()); - updateCopyAction(m_currentEditorWidget && m_currentEditorWidget->textCursor().hasSelection()); + if (m_currentEditorWidget) { + updateRedoAction(m_canRedoCallback ? m_canRedoCallback(m_currentEditor) + : m_currentEditorWidget->document()->isRedoAvailable()); + updateUndoAction(m_canUndoCallback ? m_canUndoCallback(m_currentEditor) + : m_currentEditorWidget->document()->isUndoAvailable()); + updateCopyAction(m_currentEditorWidget->textCursor().hasSelection()); + } else { + updateRedoAction(false); + updateUndoAction(false); + updateCopyAction(false); + } updateOptionalActions(); } @@ -523,6 +538,8 @@ void TextEditorActionHandlerPrivate::updateCurrentEditor(Core::IEditor *editor) m_currentEditorWidget->disconnect(this); m_currentEditorWidget = nullptr; + m_currentEditor = editor; + if (editor && editor->document()->id() == m_editorId) { TextEditorWidget *editorWidget = m_findTextWidget(editor); QTC_ASSERT(editorWidget, return); // editor has our id, so shouldn't happen @@ -570,4 +587,19 @@ void TextEditorActionHandler::updateCurrentEditor() d->updateCurrentEditor(Core::EditorManager::currentEditor()); } +void TextEditorActionHandler::updateActions() +{ + d->updateActions(); +} + +void TextEditorActionHandler::setCanUndoCallback(const Predicate &callback) +{ + d->m_canUndoCallback = callback; +} + +void TextEditorActionHandler::setCanRedoCallback(const Predicate &callback) +{ + d->m_canRedoCallback = callback; +} + } // namespace TextEditor diff --git a/src/plugins/texteditor/texteditoractionhandler.h b/src/plugins/texteditor/texteditoractionhandler.h index ce19e8535f9..0886b6a909b 100644 --- a/src/plugins/texteditor/texteditoractionhandler.h +++ b/src/plugins/texteditor/texteditoractionhandler.h @@ -50,6 +50,12 @@ public: ~TextEditorActionHandler(); void updateCurrentEditor(); + void updateActions(); + + using Predicate = std::function<bool(Core::IEditor *editor)>; + + void setCanUndoCallback(const Predicate &callback); + void setCanRedoCallback(const Predicate &callback); private: Internal::TextEditorActionHandlerPrivate *d; From 817d72df7ffbf24b9101d3a86609ead27cbfc7c6 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 4 Sep 2023 13:14:34 +0200 Subject: [PATCH 0982/1777] ClangTools: Always print stderr output E.g. clang-tidy prints error messages for invalid config files, but then continues to run and finishes with exit code zero. Fixes: QTCREATORBUG-29298 Change-Id: Idbfb7998994ac8197cd863f4bbb2c64ac1bd5525 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/clangtools/clangtool.cpp | 3 +++ src/plugins/clangtools/clangtoolrunner.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index 6fc8d3f06fb..652b24b90fa 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -774,6 +774,9 @@ Group ClangTool::runRecipe(const RunSettings &runSettings, // TODO: postMessage() instead m_runControl->postMessage(message, StdErrFormat); m_runControl->postMessage(output.errorDetails, StdErrFormat); + } else if (!output.errorMessage.isEmpty()) { + m_runControl->postMessage(output.errorMessage, ErrorMessageFormat); + m_runControl->postMessage(output.errorDetails, StdErrFormat); } else { qCDebug(LOG) << "Clang tool task finished with success:" << output.outputFilePath; diff --git a/src/plugins/clangtools/clangtoolrunner.cpp b/src/plugins/clangtools/clangtoolrunner.cpp index 20331566410..e83037aa536 100644 --- a/src/plugins/clangtools/clangtoolrunner.cpp +++ b/src/plugins/clangtools/clangtoolrunner.cpp @@ -165,6 +165,18 @@ GroupItem clangToolTask(const AnalyzeInputData &input, }; const auto onProcessDone = [=](const Process &process) { qCDebug(LOG).noquote() << "Output:\n" << process.cleanedStdOut(); + + // Here we handle only the case of process success with stderr output. + if (!outputHandler) + return; + if (process.result() != ProcessResult::FinishedWithSuccess) + return; + const QString stdErr = process.cleanedStdErr(); + if (stdErr.isEmpty()) + return; + outputHandler( + {true, input.unit.file, {}, {}, input.tool, Tr::tr("%1 produced stderr output:") + .arg(storage->name), stdErr}); }; const auto onProcessError = [=](const Process &process) { if (!outputHandler) From 2e5805d4b03dc01291fa9128ee539288c6ae856c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 17:19:37 +0200 Subject: [PATCH 0983/1777] TextEditor: Hide part of OutlineFactory implementation Change-Id: Ifb1c743ba53e2e55605b78336b57c993c12ead3e Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/texteditor/outlinefactory.cpp | 35 ++++++++++++++++ src/plugins/texteditor/outlinefactory.h | 44 ++------------------- src/plugins/texteditor/texteditorplugin.cpp | 2 + 3 files changed, 40 insertions(+), 41 deletions(-) diff --git a/src/plugins/texteditor/outlinefactory.cpp b/src/plugins/texteditor/outlinefactory.cpp index abec3a3ca66..2b2cc5e73af 100644 --- a/src/plugins/texteditor/outlinefactory.cpp +++ b/src/plugins/texteditor/outlinefactory.cpp @@ -4,6 +4,7 @@ #include "outlinefactory.h" #include "texteditortr.h" +#include "ioutlinewidget.h" #include <coreplugin/coreconstants.h> #include <coreplugin/icore.h> @@ -16,6 +17,7 @@ #include <QDebug> #include <QLabel> +#include <QMenu> #include <QStackedWidget> #include <QToolButton> @@ -42,6 +44,37 @@ void IOutlineWidgetFactory::updateOutline() namespace Internal { +class OutlineWidgetStack : public QStackedWidget +{ + Q_OBJECT + +public: + OutlineWidgetStack(OutlineFactory *factory); + ~OutlineWidgetStack() override; + + QList<QToolButton *> toolButtons(); + + void saveSettings(QSettings *settings, int position); + void restoreSettings(QSettings *settings, int position); + +private: + bool isCursorSynchronized() const; + QWidget *dummyWidget() const; + void updateFilterMenu(); + void toggleCursorSynchronization(); + void toggleSort(); + void updateEditor(Core::IEditor *editor); + void updateCurrentEditor(); + + QToolButton *m_toggleSync; + QToolButton *m_filterButton; + QToolButton *m_toggleSort; + QMenu *m_filterMenu; + QVariantMap m_widgetSettings; + bool m_syncWithEditor; + bool m_sorted; +}; + OutlineWidgetStack::OutlineWidgetStack(OutlineFactory *factory) : m_syncWithEditor(true), m_sorted(false) @@ -233,3 +266,5 @@ void OutlineFactory::restoreSettings(Utils::QtcSettings *settings, int position, } // namespace Internal } // namespace TextEditor + +#include "outlinefactory.moc" diff --git a/src/plugins/texteditor/outlinefactory.h b/src/plugins/texteditor/outlinefactory.h index 99a0334a500..eae3efb7fcc 100644 --- a/src/plugins/texteditor/outlinefactory.h +++ b/src/plugins/texteditor/outlinefactory.h @@ -3,51 +3,14 @@ #pragma once -#include <texteditor/ioutlinewidget.h> #include <coreplugin/inavigationwidgetfactory.h> -#include <QStackedWidget> -#include <QMenu> -namespace Core { class IEditor; } - -namespace TextEditor { -namespace Internal { - -class OutlineFactory; - -class OutlineWidgetStack : public QStackedWidget -{ - Q_OBJECT -public: - OutlineWidgetStack(OutlineFactory *factory); - ~OutlineWidgetStack() override; - - QList<QToolButton *> toolButtons(); - - void saveSettings(QSettings *settings, int position); - void restoreSettings(QSettings *settings, int position); - -private: - bool isCursorSynchronized() const; - QWidget *dummyWidget() const; - void updateFilterMenu(); - void toggleCursorSynchronization(); - void toggleSort(); - void updateEditor(Core::IEditor *editor); - void updateCurrentEditor(); - - QToolButton *m_toggleSync; - QToolButton *m_filterButton; - QToolButton *m_toggleSort; - QMenu *m_filterMenu; - QVariantMap m_widgetSettings; - bool m_syncWithEditor; - bool m_sorted; -}; +namespace TextEditor::Internal { class OutlineFactory : public Core::INavigationWidgetFactory { Q_OBJECT + public: OutlineFactory(); @@ -60,5 +23,4 @@ signals: void updateOutline(); }; -} // namespace Internal -} // namespace TextEditor +} // TextEditor::Internal diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 67c621bcc36..d0df98fb8af 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -43,6 +43,8 @@ #include <utils/qtcassert.h> #include <utils/macroexpander.h> +#include <QMenu> + using namespace Core; using namespace Utils; From 4ee863060a35bad25251c8d24b1b8cfc4c3dc053 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Mon, 4 Sep 2023 11:36:09 +0200 Subject: [PATCH 0984/1777] Qmlls: only update latest qmlls if the setting is enabled Change-Id: I0adb24db3a944c6a400cfd84e10974f9bdc0d560 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/qmljseditor/qmllssettings.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmljseditor/qmllssettings.cpp b/src/plugins/qmljseditor/qmllssettings.cpp index eb98c041fa5..d92f09059cc 100644 --- a/src/plugins/qmljseditor/qmllssettings.cpp +++ b/src/plugins/qmljseditor/qmllssettings.cpp @@ -89,8 +89,9 @@ void QmllsSettingsManager::setupAutoupdate() void QmllsSettingsManager::checkForChanges() { - FilePath newLatest = evaluateLatestQmlls(); QmllsSettings newSettings = QmlJsEditingSettings::get().qmllsSettings(); + FilePath newLatest = newSettings.useLatestQmlls && newSettings.useQmlls ? evaluateLatestQmlls() + : m_latestQmlls; if (m_lastSettings == newSettings && newLatest == m_latestQmlls) return; qCDebug(qmllsLog) << "qmlls settings changed:" << newSettings.useQmlls From 429da62c1a54607fc2e784cae058cdbc3196bbe4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 31 Aug 2023 15:27:55 +0200 Subject: [PATCH 0985/1777] CppEditor: Consider parameter comments in "apply changes to decl/def" That is, when a function parameter name is changed in the declaration, apply the renaming also to the function comments at the definition and vice versa. Task-number: QTCREATORBUG-12051 Task-number: QTCREATORBUG-15425 Change-Id: I9104512ef8cdca8c37e4f8ac87117476f850117a Reviewed-by: David Schulz <david.schulz@qt.io> --- .../cppeditor/cppfunctiondecldeflink.cpp | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp index aa17721ea37..7055b00d038 100644 --- a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp +++ b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp @@ -9,6 +9,7 @@ #include "cppeditorwidget.h" #include "cpplocalsymbols.h" #include "cppquickfixassistant.h" +#include "cpptoolsreuse.h" #include "symbolfinder.h" #include <coreplugin/actionmanager/actionmanager.h> @@ -18,12 +19,14 @@ #include <cplusplus/ASTPath.h> #include <cplusplus/CppRewriter.h> +#include <cplusplus/declarationcomments.h> #include <cplusplus/Overview.h> #include <cplusplus/TypeOfExpression.h> #include <utils/async.h> #include <utils/proxyaction.h> #include <utils/qtcassert.h> +#include <utils/textutils.h> #include <utils/tooltip/tooltip.h> #include <QRegularExpression> @@ -847,6 +850,41 @@ ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targetOffse newTargetParameters); } + // Change parameter names in function documentation. + [&] { + if (renamedTargetParameters.isEmpty()) + return; + const QList<Token> functionComments = commentsForDeclaration( + targetFunction, targetDeclaration, *targetFile->document(), + targetFile->cppDocument()); + if (functionComments.isEmpty()) + return; + const QString &content = targetFile->document()->toPlainText(); + const QStringView docView = QStringView(content); + for (auto it = renamedTargetParameters.cbegin(); + it != renamedTargetParameters.cend(); ++it) { + const QString paramName = Overview().prettyName(it.key()->name()); + for (const Token &tok : functionComments) { + const TranslationUnit * const tu = targetFile->cppDocument()->translationUnit(); + const int tokenStartPos = tu->getTokenPositionInDocument( + tok, targetFile->document()); + const int tokenEndPos = tu->getTokenEndPositionInDocument( + tok, targetFile->document()); + const QStringView tokenView = docView.mid(tokenStartPos, + tokenEndPos - tokenStartPos); + const QList<Text::Range> ranges = symbolOccurrencesInText( + *targetFile->document(), tokenView, tokenStartPos, paramName); + for (const Text::Range &r : ranges) { + const int startPos = Text::positionInText( + targetFile->document(), r.begin.line, r.begin.column + 1); + const int endPos = Text::positionInText( + targetFile->document(), r.end.line, r.end.column + 1); + changes.replace(startPos, endPos, it.value()); + } + } + } + }(); + // for function definitions, rename the local usages FunctionDefinitionAST *targetDefinition = targetDeclaration->asFunctionDefinition(); if (targetDefinition && !renamedTargetParameters.isEmpty()) { From 6847d69008952837831b14302e13c3dd0a60146b Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 31 Aug 2023 16:14:40 +0200 Subject: [PATCH 0986/1777] CppEditor: Consider comments when extracting a new function That is, do not place the newly created function in between the function and its comment. Fixes: QTCREATORBUG-6934 Change-Id: I79f564a90c7e3c45188f5d694cbde47029651324 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/cppeditor/cppquickfix_test.cpp | 4 +++- src/plugins/cppeditor/cppquickfixes.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 72f4f1b0833..5558e56336c 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -7843,7 +7843,8 @@ void QuickfixTest::testExtractFunction_data() QTest::addColumn<QByteArray>("expected"); QTest::newRow("basic") - << _("void f()\n" + << _("// Documentation for f\n" + "void f()\n" "{\n" " @{start}g();@{end}\n" "}\n") @@ -7852,6 +7853,7 @@ void QuickfixTest::testExtractFunction_data() " g();\n" "}\n" "\n" + "// Documentation for f\n" "void f()\n" "{\n" " extracted();\n" diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 727f0c84970..5bf8269af46 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -27,6 +27,7 @@ #include <cplusplus/ASTPath.h> #include <cplusplus/CPlusPlusForwardDeclarations.h> #include <cplusplus/CppRewriter.h> +#include <cplusplus/declarationcomments.h> #include <cplusplus/NamePrettyPrinter.h> #include <cplusplus/TypeOfExpression.h> #include <cplusplus/TypePrettyPrinter.h> @@ -5150,6 +5151,16 @@ public: // formatting) it's simpler to have two different change sets. ChangeSet change; int position = currentFile->startOf(m_refFuncDef); + + // Do not insert right between the function and an associated comment. + const QList<Token> functionDoc = commentsForDeclaration( + m_refFuncDef->symbol, m_refFuncDef, *currentFile->document(), + currentFile->cppDocument()); + if (!functionDoc.isEmpty()) { + position = currentFile->cppDocument()->translationUnit()->getTokenPositionInDocument( + functionDoc.first(), currentFile->document()); + } + change.insert(position, funcDef); change.replace(m_extractionStart, m_extractionEnd, funcCall); currentFile->setChangeSet(change); From c655c1733b72fffe78a277d5df582ccf91096e3e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 17:20:47 +0200 Subject: [PATCH 0987/1777] Clean up some navigation factory implementation Change-Id: Ibbff643daf88200d50fb0343dd40b03803074081 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../classview/classviewnavigationwidgetfactory.h | 13 ++----------- src/plugins/coreplugin/inavigationwidgetfactory.h | 1 - src/plugins/languageclient/callhierarchy.h | 6 ++---- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/plugins/classview/classviewnavigationwidgetfactory.h b/src/plugins/classview/classviewnavigationwidgetfactory.h index 2eed11b4fe0..0ec38a4eeeb 100644 --- a/src/plugins/classview/classviewnavigationwidgetfactory.h +++ b/src/plugins/classview/classviewnavigationwidgetfactory.h @@ -5,25 +5,16 @@ #include <coreplugin/inavigationwidgetfactory.h> -namespace ClassView { -namespace Internal { +namespace ClassView::Internal { class NavigationWidgetFactory : public Core::INavigationWidgetFactory { - Q_OBJECT - public: NavigationWidgetFactory(); - //! \implements Core::INavigationWidgetFactory::createWidget Core::NavigationView createWidget() override; - - //! \implements Core::INavigationWidgetFactory::saveSettings void saveSettings(Utils::QtcSettings *settings, int position, QWidget *widget) override; - - //! \implements Core::INavigationWidgetFactory::restoreSettings void restoreSettings(Utils::QtcSettings *settings, int position, QWidget *widget) override; }; -} // namespace Internal -} // namespace ClassView +} // ClassView::Internal diff --git a/src/plugins/coreplugin/inavigationwidgetfactory.h b/src/plugins/coreplugin/inavigationwidgetfactory.h index 84b8b180171..6be77939fbd 100644 --- a/src/plugins/coreplugin/inavigationwidgetfactory.h +++ b/src/plugins/coreplugin/inavigationwidgetfactory.h @@ -13,7 +13,6 @@ #include <QKeySequence> QT_BEGIN_NAMESPACE -class QSettings; class QToolButton; class QWidget; QT_END_NAMESPACE diff --git a/src/plugins/languageclient/callhierarchy.h b/src/plugins/languageclient/callhierarchy.h index bbc15b09712..79c92fd3600 100644 --- a/src/plugins/languageclient/callhierarchy.h +++ b/src/plugins/languageclient/callhierarchy.h @@ -1,10 +1,10 @@ // Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0 -#include <coreplugin/inavigationwidgetfactory.h> - #pragma once +#include <coreplugin/inavigationwidgetfactory.h> + namespace Core { class IDocument; } namespace LanguageClient { @@ -13,8 +13,6 @@ class Client; class CallHierarchyFactory : public Core::INavigationWidgetFactory { - Q_OBJECT - public: CallHierarchyFactory(); From 4d89183268bcfa5a9fe59ecc2b02824342ef3fc5 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 17:04:34 +0200 Subject: [PATCH 0988/1777] BookMarks: Hide some BookMarkManager implementation details Change-Id: Icfc2ca62fb66ff6be6f1f07bbe3e99b35b4c146b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/bookmarks/bookmarkmanager.cpp | 45 ++++++++++++++++++++--- src/plugins/bookmarks/bookmarkmanager.h | 37 ------------------- src/plugins/bookmarks/bookmarksplugin.cpp | 1 - 3 files changed, 40 insertions(+), 43 deletions(-) diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index 2fecba07fc3..18a4206afd3 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -15,20 +15,19 @@ #include <coreplugin/session.h> #include <texteditor/texteditor.h> + #include <utils/algorithm.h> #include <utils/icon.h> #include <utils/qtcassert.h> #include <utils/checkablemessagebox.h> #include <utils/theme/theme.h> #include <utils/dropsupport.h> -#include <utils/utilsicons.h> #include <QAction> #include <QContextMenuEvent> #include <QDebug> #include <QDialog> #include <QDialogButtonBox> -#include <QDir> #include <QFormLayout> #include <QLineEdit> #include <QMenu> @@ -43,10 +42,21 @@ using namespace Utils; namespace Bookmarks::Internal { -BookmarkDelegate::BookmarkDelegate(QObject *parent) - : QStyledItemDelegate(parent) +class BookmarkDelegate : public QStyledItemDelegate { -} +public: + BookmarkDelegate(QObject *parent) + : QStyledItemDelegate(parent) + {} + +private: + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const final; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const final; + void generateGradientPixmap(int width, int height, const QColor &color, bool selected) const; + + mutable QPixmap m_normalPixmap; + mutable QPixmap m_selectedPixmap; +}; QSize BookmarkDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { @@ -159,6 +169,31 @@ void BookmarkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti painter->restore(); } +// BookmarkView + +class BookmarkView final : public Utils::ListView +{ +public: + explicit BookmarkView(BookmarkManager *manager); + + QList<QToolButton *> createToolBarWidgets(); + + void gotoBookmark(const QModelIndex &index); + + void removeFromContextMenu(); + void removeAll(); + +protected: + void contextMenuEvent(QContextMenuEvent *event) final; + void removeBookmark(const QModelIndex &index); + void keyPressEvent(QKeyEvent *event) final; + +private: + Core::IContext *m_bookmarkContext; + QModelIndex m_contextMenuIndex; + BookmarkManager *m_manager; +}; + BookmarkView::BookmarkView(BookmarkManager *manager) : m_bookmarkContext(new IContext(this)), m_manager(manager) diff --git a/src/plugins/bookmarks/bookmarkmanager.h b/src/plugins/bookmarks/bookmarkmanager.h index a4fcf01b58c..0455d316375 100644 --- a/src/plugins/bookmarks/bookmarkmanager.h +++ b/src/plugins/bookmarks/bookmarkmanager.h @@ -99,29 +99,6 @@ private: QItemSelectionModel *m_selectionModel; }; -class BookmarkView final : public Utils::ListView -{ -public: - explicit BookmarkView(BookmarkManager *manager); - - QList<QToolButton *> createToolBarWidgets(); - - void gotoBookmark(const QModelIndex &index); - - void removeFromContextMenu(); - void removeAll(); - -protected: - void contextMenuEvent(QContextMenuEvent *event) final; - void removeBookmark(const QModelIndex &index); - void keyPressEvent(QKeyEvent *event) final; - -private: - Core::IContext *m_bookmarkContext; - QModelIndex m_contextMenuIndex; - BookmarkManager *m_manager; -}; - class BookmarkViewFactory : public Core::INavigationWidgetFactory { public: @@ -133,18 +110,4 @@ private: BookmarkManager *m_manager; }; -class BookmarkDelegate : public QStyledItemDelegate -{ -public: - BookmarkDelegate(QObject *parent = nullptr); - -private: - void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const final; - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const final; - void generateGradientPixmap(int width, int height, const QColor &color, bool selected) const; - - mutable QPixmap m_normalPixmap; - mutable QPixmap m_selectedPixmap; -}; - } // Bookmarks::Internal diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp index 7473876ec63..fc8f1ba7503 100644 --- a/src/plugins/bookmarks/bookmarksplugin.cpp +++ b/src/plugins/bookmarks/bookmarksplugin.cpp @@ -20,7 +20,6 @@ #include <texteditor/textdocument.h> #include <texteditor/texteditorconstants.h> -#include <utils/fileutils.h> #include <utils/utilsicons.h> #include <QMenu> From 3170973723ce8297684f4707d11271c67700050e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 23 Aug 2023 12:16:39 +0200 Subject: [PATCH 0989/1777] Android: Lump apk build step creation together Just moved code for now, will be better for LayoutBuilder. Change-Id: I722f08b8efa13c3df8ffced3d87f8ad2870345d4 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/android/androidbuildapkstep.cpp | 217 +++++++++----------- 1 file changed, 101 insertions(+), 116 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 0337af54287..7e4b4d15642 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -114,11 +114,6 @@ private: FilePath appProjectFilePath() const; QString openSslIncludeFileContent(const FilePath &projectPath); - QWidget *createApplicationGroup(); - QWidget *createSignPackageGroup(); - QWidget *createAdvancedGroup(); - QWidget *createAdditionalLibrariesGroup(); - private: AndroidBuildApkStep *m_step = nullptr; QCheckBox *m_signPackageCheckBox = nullptr; @@ -131,34 +126,88 @@ private: AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) : m_step(step) { + QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + + + // Application Signature Group + + auto signPackageGroup = new QGroupBox(Tr::tr("Application Signature"), this); + + auto keystoreLocationLabel = new QLabel(Tr::tr("Keystore:"), signPackageGroup); + keystoreLocationLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); + + auto keystoreLocationChooser = new PathChooser(signPackageGroup); + keystoreLocationChooser->setExpectedKind(PathChooser::File); + keystoreLocationChooser->lineEdit()->setReadOnly(true); + keystoreLocationChooser->setFilePath(m_step->keystorePath()); + keystoreLocationChooser->setInitialBrowsePathBackup(FileUtils::homePath()); + keystoreLocationChooser->setPromptDialogFilter(Tr::tr("Keystore files (*.keystore *.jks)")); + keystoreLocationChooser->setPromptDialogTitle(Tr::tr("Select Keystore File")); + connect(keystoreLocationChooser, &PathChooser::textChanged, this, [this, keystoreLocationChooser] { + const FilePath file = keystoreLocationChooser->rawFilePath(); + m_step->setKeystorePath(file); + m_signPackageCheckBox->setChecked(!file.isEmpty()); + if (!file.isEmpty()) + setCertificates(); + }); + + auto keystoreCreateButton = new QPushButton(Tr::tr("Create..."), signPackageGroup); + connect(keystoreCreateButton, &QAbstractButton::clicked, this, [this, keystoreLocationChooser] { + AndroidCreateKeystoreCertificate d; + if (d.exec() != QDialog::Accepted) + return; + keystoreLocationChooser->setFilePath(d.keystoreFilePath()); + m_step->setKeystorePath(d.keystoreFilePath()); + m_step->setKeystorePassword(d.keystorePassword()); + m_step->setCertificateAlias(d.certificateAlias()); + m_step->setCertificatePassword(d.certificatePassword()); + setCertificates(); + }); + + m_signPackageCheckBox = new QCheckBox(Tr::tr("Sign package"), signPackageGroup); + m_signPackageCheckBox->setChecked(m_step->signPackage()); + + m_signingDebugWarningLabel = new Utils::InfoLabel(Tr::tr("Signing a debug package"), + Utils::InfoLabel::Warning, signPackageGroup); + m_signingDebugWarningLabel->hide(); + + auto certificateAliasLabel = new QLabel(Tr::tr("Certificate alias:"), signPackageGroup); + certificateAliasLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter); + + m_certificatesAliasComboBox = new QComboBox(signPackageGroup); + m_certificatesAliasComboBox->setEnabled(false); + m_certificatesAliasComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); + using namespace Layouting; Column { - createSignPackageGroup(), - createApplicationGroup(), - createAdvancedGroup(), - createAdditionalLibrariesGroup(), - noMargin - }.attachTo(this); + Row { keystoreLocationLabel, keystoreLocationChooser, keystoreCreateButton }, + m_signPackageCheckBox, + Row { m_signingDebugWarningLabel, certificateAliasLabel, m_certificatesAliasComboBox } + }.attachTo(signPackageGroup); - connect(m_step->buildConfiguration(), &BuildConfiguration::buildTypeChanged, - this, &AndroidBuildApkWidget::updateSigningWarning); + connect(m_signPackageCheckBox, &QAbstractButton::toggled, + this, &AndroidBuildApkWidget::signPackageCheckBoxToggled); - connect(m_signPackageCheckBox, &QAbstractButton::clicked, - m_addDebuggerCheckBox, &QWidget::setEnabled); + auto updateAlias = [this](int idx) { + QString alias = m_certificatesAliasComboBox->itemText(idx); + if (!alias.isEmpty()) + m_step->setCertificateAlias(alias); + }; - signPackageCheckBoxToggled(m_step->signPackage()); - updateSigningWarning(); -} + connect(m_certificatesAliasComboBox, &QComboBox::activated, this, updateAlias); + connect(m_certificatesAliasComboBox, &QComboBox::currentIndexChanged, this, updateAlias); + + // Application group -QWidget *AndroidBuildApkWidget::createApplicationGroup() -{ QtSupport::QtVersion *qt = QtSupport::QtKitAspect::qtVersion(m_step->target()->kit()); const int minApiSupported = AndroidManager::defaultMinimumSDK(qt); QStringList targets = AndroidConfig::apiLevelNamesFor(AndroidConfigurations::sdkManager()-> filteredSdkPlatforms(minApiSupported)); targets.removeDuplicates(); - auto group = new QGroupBox(Tr::tr("Application"), this); + auto applicationGroup = new QGroupBox(Tr::tr("Application"), this); auto targetSDKComboBox = new QComboBox(); targetSDKComboBox->addItems(targets); @@ -189,7 +238,7 @@ QWidget *AndroidBuildApkWidget::createApplicationGroup() : buildToolsVersions.indexOf(m_step->buildToolsVersion()); buildToolsSdkComboBox->setCurrentIndex(initIdx); - auto formLayout = new QFormLayout(group); + auto formLayout = new QFormLayout(applicationGroup); formLayout->addRow(Tr::tr("Android build-tools version:"), buildToolsSdkComboBox); formLayout->addRow(Tr::tr("Android build platform SDK:"), targetSDKComboBox); @@ -203,89 +252,11 @@ QWidget *AndroidBuildApkWidget::createApplicationGroup() formLayout->addRow(Tr::tr("Android customization:"), createAndroidTemplatesButton); - return group; -} + // Advanced Actions group -QWidget *AndroidBuildApkWidget::createSignPackageGroup() -{ - QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); + auto advancedGroup = new QGroupBox(Tr::tr("Advanced Actions"), this); - auto group = new QGroupBox(Tr::tr("Application Signature"), this); - - auto keystoreLocationLabel = new QLabel(Tr::tr("Keystore:"), group); - keystoreLocationLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - auto keystoreLocationChooser = new PathChooser(group); - keystoreLocationChooser->setExpectedKind(PathChooser::File); - keystoreLocationChooser->lineEdit()->setReadOnly(true); - keystoreLocationChooser->setFilePath(m_step->keystorePath()); - keystoreLocationChooser->setInitialBrowsePathBackup(FileUtils::homePath()); - keystoreLocationChooser->setPromptDialogFilter(Tr::tr("Keystore files (*.keystore *.jks)")); - keystoreLocationChooser->setPromptDialogTitle(Tr::tr("Select Keystore File")); - connect(keystoreLocationChooser, &PathChooser::textChanged, this, [this, keystoreLocationChooser] { - const FilePath file = keystoreLocationChooser->rawFilePath(); - m_step->setKeystorePath(file); - m_signPackageCheckBox->setChecked(!file.isEmpty()); - if (!file.isEmpty()) - setCertificates(); - }); - - auto keystoreCreateButton = new QPushButton(Tr::tr("Create..."), group); - connect(keystoreCreateButton, &QAbstractButton::clicked, this, [this, keystoreLocationChooser] { - AndroidCreateKeystoreCertificate d; - if (d.exec() != QDialog::Accepted) - return; - keystoreLocationChooser->setFilePath(d.keystoreFilePath()); - m_step->setKeystorePath(d.keystoreFilePath()); - m_step->setKeystorePassword(d.keystorePassword()); - m_step->setCertificateAlias(d.certificateAlias()); - m_step->setCertificatePassword(d.certificatePassword()); - setCertificates(); - }); - - m_signPackageCheckBox = new QCheckBox(Tr::tr("Sign package"), group); - m_signPackageCheckBox->setChecked(m_step->signPackage()); - - m_signingDebugWarningLabel = new Utils::InfoLabel(Tr::tr("Signing a debug package"), - Utils::InfoLabel::Warning, group); - m_signingDebugWarningLabel->hide(); - - auto certificateAliasLabel = new QLabel(Tr::tr("Certificate alias:"), group); - certificateAliasLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - m_certificatesAliasComboBox = new QComboBox(group); - m_certificatesAliasComboBox->setEnabled(false); - m_certificatesAliasComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); - - using namespace Layouting; - Column { - Row { keystoreLocationLabel, keystoreLocationChooser, keystoreCreateButton }, - m_signPackageCheckBox, - Row { m_signingDebugWarningLabel, certificateAliasLabel, m_certificatesAliasComboBox } - }.attachTo(group); - - connect(m_signPackageCheckBox, &QAbstractButton::toggled, - this, &AndroidBuildApkWidget::signPackageCheckBoxToggled); - - auto updateAlias = [this](int idx) { - QString alias = m_certificatesAliasComboBox->itemText(idx); - if (!alias.isEmpty()) - m_step->setCertificateAlias(alias); - }; - - connect(m_certificatesAliasComboBox, &QComboBox::activated, this, updateAlias); - connect(m_certificatesAliasComboBox, &QComboBox::currentIndexChanged, this, updateAlias); - - return group; -} - -QWidget *AndroidBuildApkWidget::createAdvancedGroup() -{ - auto group = new QGroupBox(Tr::tr("Advanced Actions"), this); - - m_addDebuggerCheckBox = new QCheckBox(Tr::tr("Add debug server"), group); + m_addDebuggerCheckBox = new QCheckBox(Tr::tr("Add debug server"), advancedGroup); m_addDebuggerCheckBox->setEnabled(false); m_addDebuggerCheckBox->setToolTip(Tr::tr("Packages debug server with " "the APK to enable debugging. For the signed APK this option is unchecked by default.")); @@ -298,20 +269,18 @@ QWidget *AndroidBuildApkWidget::createAdvancedGroup() m_step->openPackageLocation, m_step->verboseOutput, m_addDebuggerCheckBox - }.attachTo(group); + }.attachTo(advancedGroup); - return group; -} -QWidget *AndroidBuildApkWidget::createAdditionalLibrariesGroup() -{ - auto group = new QGroupBox(Tr::tr("Additional Libraries")); - group->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); + // Additional Libraries group + + auto additionalLibrariesGroup = new QGroupBox(Tr::tr("Additional Libraries")); + additionalLibrariesGroup->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); auto libsModel = new AndroidExtraLibraryListModel(m_step->buildSystem(), this); connect(libsModel, &AndroidExtraLibraryListModel::enabledChanged, this, - [this, group](const bool enabled) { - group->setEnabled(enabled); + [this, additionalLibrariesGroup](const bool enabled) { + additionalLibrariesGroup->setEnabled(enabled); m_openSslCheckBox->setChecked(isOpenSslLibsIncluded()); }); @@ -347,11 +316,10 @@ QWidget *AndroidBuildApkWidget::createAdditionalLibrariesGroup() connect(m_openSslCheckBox, &QAbstractButton::clicked, this, &AndroidBuildApkWidget::onOpenSslCheckBoxChanged); - using namespace Layouting; Grid { m_openSslCheckBox, br, libsView, Column { addLibButton, removeLibButton, st } - }.attachTo(group); + }.attachTo(additionalLibrariesGroup); QItemSelectionModel *libSelection = libsView->selectionModel(); connect(libSelection, &QItemSelectionModel::selectionChanged, this, [libSelection, removeLibButton] { @@ -361,9 +329,26 @@ QWidget *AndroidBuildApkWidget::createAdditionalLibrariesGroup() Target *target = m_step->target(); const QString buildKey = target->activeBuildKey(); const ProjectNode *node = target->project()->findNodeForBuildKey(buildKey); - group->setEnabled(node && !node->parseInProgress()); + additionalLibrariesGroup->setEnabled(node && !node->parseInProgress()); - return group; + // main layout + + Column { + signPackageGroup, + applicationGroup, + advancedGroup, + additionalLibrariesGroup, + noMargin + }.attachTo(this); + + connect(m_step->buildConfiguration(), &BuildConfiguration::buildTypeChanged, + this, &AndroidBuildApkWidget::updateSigningWarning); + + connect(m_signPackageCheckBox, &QAbstractButton::clicked, + m_addDebuggerCheckBox, &QWidget::setEnabled); + + signPackageCheckBoxToggled(m_step->signPackage()); + updateSigningWarning(); } void AndroidBuildApkWidget::signPackageCheckBoxToggled(bool checked) From c4f2c14aa21c1cdd770e6c5385f30e3dec33bfd9 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 15:10:50 +0200 Subject: [PATCH 0990/1777] QmlJsEditor: Delay construction of QuickToolBar It's now apparently created when the first .qml file opens. Change-Id: I4bcd84d29da268565ee6e771f8c56c8b07ecdaf3 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/qmljseditor/qmljseditor.cpp | 2 +- src/plugins/qmljseditor/qmljseditorplugin.cpp | 7 ----- src/plugins/qmljseditor/qmljseditorplugin.h | 1 - src/plugins/qmljseditor/quicktoolbar.cpp | 6 ++++ src/plugins/qmljseditor/quicktoolbar.h | 31 ++++++++++--------- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 1bd8ef89ff8..765d8d4ad28 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -116,7 +116,7 @@ void QmlJSEditorWidget::finalizeInitialization() this, &QmlJSEditorWidget::updateOutlineIndexNow); m_modelManager = ModelManagerInterface::instance(); - m_contextPane = Internal::QmlJSEditorPlugin::quickToolBar(); + m_contextPane = QuickToolBar::instance(); m_modelManager->activateScan(); diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp index e4b2538dcb9..47fd2126d5c 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.cpp +++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp @@ -85,7 +85,6 @@ public: ICore::resourcePath("json/").toString()}}; QmlJSEditorFactory m_qmlJSEditorFactory; QmlJSOutlineWidgetFactory m_qmlJSOutlineWidgetFactory; - QuickToolBar m_quickToolBar; QmlJsEditingSettingsPage m_qmJSEditingSettingsPage; }; @@ -223,12 +222,6 @@ QmlJS::JsonSchemaManager *QmlJSEditorPlugin::jsonManager() return &m_instance->d->m_jsonManager; } -QuickToolBar *QmlJSEditorPlugin::quickToolBar() -{ - QTC_ASSERT(m_instance && m_instance->d, return new QuickToolBar()); - return &m_instance->d->m_quickToolBar; -} - void QmlJSEditorPluginPrivate::renameUsages() { if (auto editor = qobject_cast<QmlJSEditorWidget*>(EditorManager::currentEditor()->widget())) diff --git a/src/plugins/qmljseditor/qmljseditorplugin.h b/src/plugins/qmljseditor/qmljseditorplugin.h index 69d1c477086..2931c8f0bec 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.h +++ b/src/plugins/qmljseditor/qmljseditorplugin.h @@ -24,7 +24,6 @@ public: static QmlJSQuickFixAssistProvider *quickFixAssistProvider(); static QmlJS::JsonSchemaManager *jsonManager(); - static QuickToolBar *quickToolBar(); private: void initialize() final; diff --git a/src/plugins/qmljseditor/quicktoolbar.cpp b/src/plugins/qmljseditor/quicktoolbar.cpp index 4d95818d838..1487d44844e 100644 --- a/src/plugins/qmljseditor/quicktoolbar.cpp +++ b/src/plugins/qmljseditor/quicktoolbar.cpp @@ -86,6 +86,12 @@ QuickToolBar::~QuickToolBar() m_widget = nullptr; } +QuickToolBar *QuickToolBar::instance() +{ + static QuickToolBar theQuickToolBar; + return &theQuickToolBar; +} + void QuickToolBar::apply(TextEditor::TextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, Node *node, bool update, bool force) { if (!QmlJsEditingSettings::get().enableContextPane() && !force && !update) { diff --git a/src/plugins/qmljseditor/quicktoolbar.h b/src/plugins/qmljseditor/quicktoolbar.h index aea42eaccf4..df6a2ca2665 100644 --- a/src/plugins/qmljseditor/quicktoolbar.h +++ b/src/plugins/qmljseditor/quicktoolbar.h @@ -15,24 +15,27 @@ class QuickToolBar : public QmlJS::IContextPane { Q_OBJECT + QuickToolBar(); public: - QuickToolBar(); - ~QuickToolBar() override; - void apply(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, const QmlJS::ScopeChain *scopeChain, QmlJS::AST::Node *node, bool update, bool force = false) override; - bool isAvailable(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, QmlJS::AST::Node *node) override; - void setProperty(const QString &propertyName, const QVariant &value); - void removeProperty(const QString &propertyName); - void setEnabled(bool) override; - QWidget* widget() override; + ~QuickToolBar() override; - void onPropertyChanged(const QString &, const QVariant &); - void onPropertyRemoved(const QString &); - void onPropertyRemovedAndChange(const QString &, const QString &, const QVariant &, bool removeFirst = true); - void onPinnedChanged(bool); - void onEnabledChanged(bool); + static QuickToolBar *instance(); + + void apply(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, const QmlJS::ScopeChain *scopeChain, QmlJS::AST::Node *node, bool update, bool force = false) override; + bool isAvailable(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, QmlJS::AST::Node *node) override; + void setProperty(const QString &propertyName, const QVariant &value); + void removeProperty(const QString &propertyName); + void setEnabled(bool) override; + QWidget* widget() override; + + void onPropertyChanged(const QString &, const QVariant &); + void onPropertyRemoved(const QString &); + void onPropertyRemovedAndChange(const QString &, const QString &, const QVariant &, bool removeFirst = true); + void onPinnedChanged(bool); + void onEnabledChanged(bool); private: - void indentLines(int startLine, int endLine); + void indentLines(int startLine, int endLine); QmlEditorWidgets::ContextPaneWidget* contextWidget(); QPointer<QmlEditorWidgets::ContextPaneWidget> m_widget; From 6888d933851cc78b125338dab55580e2139ed79b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 16:48:02 +0200 Subject: [PATCH 0991/1777] Core: Rename unusual SessionManager pimpl Left-over from the PE/Core split. Change-Id: Iea6bffa5487a43eccb04ec677fc558651a8fa997 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/CMakeLists.txt | 1 - src/plugins/coreplugin/coreplugin.qbs | 1 - src/plugins/coreplugin/session.cpp | 220 +++++++++++++++----------- src/plugins/coreplugin/session_p.h | 58 ------- 4 files changed, 130 insertions(+), 150 deletions(-) delete mode 100644 src/plugins/coreplugin/session_p.h diff --git a/src/plugins/coreplugin/CMakeLists.txt b/src/plugins/coreplugin/CMakeLists.txt index da833620f31..6ed9dbe2234 100644 --- a/src/plugins/coreplugin/CMakeLists.txt +++ b/src/plugins/coreplugin/CMakeLists.txt @@ -266,7 +266,6 @@ add_qtc_plugin(Core rightpane.h session.cpp session.h - session_p.h sessiondialog.cpp sessiondialog.h sessionmodel.cpp diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index 000fbc22883..a95d22287db 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -149,7 +149,6 @@ Project { "rightpane.h", "session.cpp", "session.h", - "session_p.h", "sessiondialog.cpp", "sessiondialog.h", "sessionmodel.cpp", diff --git a/src/plugins/coreplugin/session.cpp b/src/plugins/coreplugin/session.cpp index 2ad04e71fb3..07f7e5f175d 100644 --- a/src/plugins/coreplugin/session.cpp +++ b/src/plugins/coreplugin/session.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "session.h" -#include "session_p.h" #include "sessiondialog.h" @@ -23,12 +22,15 @@ #include <utils/algorithm.h> #include <utils/filepath.h> #include <utils/macroexpander.h> +#include <utils/persistentsettings.h> #include <utils/qtcassert.h> +#include <utils/store.h> #include <utils/stringutils.h> #include <utils/stylehelper.h> #include <QAction> #include <QActionGroup> +#include <QFutureInterface> #include <QDebug> #include <QMenu> #include <QMessageBox> @@ -67,15 +69,53 @@ const char M_SESSION[] = "ProjectExplorer.Menu.Session"; This could be improved. */ +class SessionManagerPrivate +{ +public: + void restoreStartupSession(); + + void restoreValues(const PersistentSettingsReader &reader); + void restoreSessionValues(const PersistentSettingsReader &reader); + void restoreEditors(); + + void saveSettings(); + void restoreSettings(); + bool isAutoRestoreLastSession(); + void setAutoRestoreLastSession(bool restore); + + void updateSessionMenu(); + + static QString windowTitleAddition(const FilePath &filePath); + static QString sessionTitle(const FilePath &filePath); + + QString m_sessionName = "default"; + bool m_isStartupSessionRestored = false; + bool m_isAutoRestoreLastSession = false; + bool m_virginSession = true; + bool m_loadingSession = false; + + mutable QStringList m_sessions; + mutable QHash<QString, QDateTime> m_sessionDateTimes; + QHash<QString, QDateTime> m_lastActiveTimes; + + QMap<Utils::Key, QVariant> m_values; + QMap<Utils::Key, QVariant> m_sessionValues; + QFutureInterface<void> m_future; + PersistentSettingsWriter *m_writer = nullptr; + + QMenu *m_sessionMenu; + QAction *m_sessionManagerAction; +}; + static SessionManager *m_instance = nullptr; -SessionManagerPrivate *sb_d = nullptr; +static SessionManagerPrivate *d = nullptr; SessionManager::SessionManager() { m_instance = this; - sb_d = new SessionManagerPrivate; + d = new SessionManagerPrivate; - connect(ICore::instance(), &ICore::coreOpened, this, [] { sb_d->restoreStartupSession(); }); + connect(ICore::instance(), &ICore::coreOpened, this, [] { d->restoreStartupSession(); }); connect(ModeManager::instance(), &ModeManager::currentModeChanged, this, &SessionManager::saveActiveMode); @@ -83,7 +123,7 @@ SessionManager::SessionManager() connect(ICore::instance(), &ICore::saveSettingsRequested, this, [] { if (!SessionManager::isLoadingSession()) SessionManager::saveSession(); - sb_d->saveSettings(); + d->saveSettings(); }); connect(EditorManager::instance(), &EditorManager::editorOpened, @@ -101,17 +141,17 @@ SessionManager::SessionManager() msession->menu()->setTitle(PE::Tr::tr("S&essions")); msession->setOnAllDisabledBehavior(ActionContainer::Show); mfile->addMenu(msession, Core::Constants::G_FILE_SESSION); - sb_d->m_sessionMenu = msession->menu(); - connect(mfile->menu(), &QMenu::aboutToShow, this, [] { sb_d->updateSessionMenu(); }); + d->m_sessionMenu = msession->menu(); + connect(mfile->menu(), &QMenu::aboutToShow, this, [] { d->updateSessionMenu(); }); // session manager action - sb_d->m_sessionManagerAction = new QAction(PE::Tr::tr("&Manage..."), this); - sb_d->m_sessionMenu->addAction(sb_d->m_sessionManagerAction); - sb_d->m_sessionMenu->addSeparator(); - Command *cmd = ActionManager::registerAction(sb_d->m_sessionManagerAction, + d->m_sessionManagerAction = new QAction(PE::Tr::tr("&Manage..."), this); + d->m_sessionMenu->addAction(d->m_sessionManagerAction); + d->m_sessionMenu->addSeparator(); + Command *cmd = ActionManager::registerAction(d->m_sessionManagerAction, "ProjectExplorer.ManageSessions"); cmd->setDefaultKeySequence(QKeySequence()); - connect(sb_d->m_sessionManagerAction, + connect(d->m_sessionManagerAction, &QAction::triggered, SessionManager::instance(), &SessionManager::showSessionManager); @@ -127,15 +167,15 @@ SessionManager::SessionManager() return SessionManager::activeSession(); }); - sb_d->restoreSettings(); + d->restoreSettings(); } SessionManager::~SessionManager() { - emit m_instance->aboutToUnloadSession(sb_d->m_sessionName); - delete sb_d->m_writer; - delete sb_d; - sb_d = nullptr; + emit m_instance->aboutToUnloadSession(d->m_sessionName); + delete d->m_writer; + delete d; + d = nullptr; } SessionManager *SessionManager::instance() @@ -145,7 +185,7 @@ SessionManager *SessionManager::instance() bool SessionManager::isDefaultVirgin() { - return isDefaultSession(sb_d->m_sessionName) && sb_d->m_virginSession; + return isDefaultSession(d->m_sessionName) && d->m_virginSession; } bool SessionManager::isDefaultSession(const QString &session) @@ -161,7 +201,7 @@ void SessionManager::saveActiveMode(Id mode) bool SessionManager::isLoadingSession() { - return sb_d->m_loadingSession; + return d->m_loadingSession; } /*! @@ -171,63 +211,63 @@ bool SessionManager::isLoadingSession() void SessionManager::setValue(const Key &name, const QVariant &value) { - if (sb_d->m_values.value(name) == value) + if (d->m_values.value(name) == value) return; - sb_d->m_values.insert(name, value); + d->m_values.insert(name, value); } QVariant SessionManager::value(const Key &name) { - auto it = sb_d->m_values.constFind(name); - return (it == sb_d->m_values.constEnd()) ? QVariant() : *it; + auto it = d->m_values.constFind(name); + return (it == d->m_values.constEnd()) ? QVariant() : *it; } void SessionManager::setSessionValue(const Key &name, const QVariant &value) { - sb_d->m_sessionValues.insert(name, value); + d->m_sessionValues.insert(name, value); } QVariant SessionManager::sessionValue(const Key &name, const QVariant &defaultValue) { - auto it = sb_d->m_sessionValues.constFind(name); - return (it == sb_d->m_sessionValues.constEnd()) ? defaultValue : *it; + auto it = d->m_sessionValues.constFind(name); + return (it == d->m_sessionValues.constEnd()) ? defaultValue : *it; } QString SessionManager::activeSession() { - return sb_d->m_sessionName; + return d->m_sessionName; } QStringList SessionManager::sessions() { - if (sb_d->m_sessions.isEmpty()) { + if (d->m_sessions.isEmpty()) { // We are not initialized yet, so do that now const FilePaths sessionFiles = ICore::userResourcePath().dirEntries({{"*qws"}}, QDir::Time | QDir::Reversed); const QVariantMap lastActiveTimes = ICore::settings()->value(LAST_ACTIVE_TIMES_KEY).toMap(); for (const FilePath &file : sessionFiles) { const QString &name = file.completeBaseName(); - sb_d->m_sessionDateTimes.insert(name, file.lastModified()); + d->m_sessionDateTimes.insert(name, file.lastModified()); const auto lastActiveTime = lastActiveTimes.find(name); - sb_d->m_lastActiveTimes.insert(name, lastActiveTime != lastActiveTimes.end() + d->m_lastActiveTimes.insert(name, lastActiveTime != lastActiveTimes.end() ? lastActiveTime->toDateTime() : file.lastModified()); if (name != QLatin1String(DEFAULT_SESSION)) - sb_d->m_sessions << name; + d->m_sessions << name; } - sb_d->m_sessions.prepend(QLatin1String(DEFAULT_SESSION)); + d->m_sessions.prepend(QLatin1String(DEFAULT_SESSION)); } - return sb_d->m_sessions; + return d->m_sessions; } QDateTime SessionManager::sessionDateTime(const QString &session) { - return sb_d->m_sessionDateTimes.value(session); + return d->m_sessionDateTimes.value(session); } QDateTime SessionManager::lastActiveTime(const QString &session) { - return sb_d->m_lastActiveTimes.value(session); + return d->m_lastActiveTimes.value(session); } FilePath SessionManager::sessionNameToFileName(const QString &session) @@ -246,9 +286,9 @@ bool SessionManager::createSession(const QString &session) { if (sessions().contains(session)) return false; - Q_ASSERT(sb_d->m_sessions.size() > 0); - sb_d->m_sessions.insert(1, session); - sb_d->m_lastActiveTimes.insert(session, QDateTime::currentDateTime()); + Q_ASSERT(d->m_sessions.size() > 0); + d->m_sessions.insert(1, session); + d->m_lastActiveTimes.insert(session, QDateTime::currentDateTime()); emit instance()->sessionCreated(session); return true; } @@ -267,9 +307,9 @@ void SessionManager::showSessionManager() { saveSession(); Internal::SessionDialog sessionDialog(ICore::dialogParent()); - sessionDialog.setAutoLoadSession(sb_d->isAutoRestoreLastSession()); + sessionDialog.setAutoLoadSession(d->isAutoRestoreLastSession()); sessionDialog.exec(); - sb_d->setAutoRestoreLastSession(sessionDialog.autoLoadSession()); + d->setAutoRestoreLastSession(sessionDialog.autoLoadSession()); } /*! @@ -299,10 +339,10 @@ bool SessionManager::confirmSessionDelete(const QStringList &sessions) */ bool SessionManager::deleteSession(const QString &session) { - if (!sb_d->m_sessions.contains(session)) + if (!d->m_sessions.contains(session)) return false; - sb_d->m_sessions.removeOne(session); - sb_d->m_lastActiveTimes.remove(session); + d->m_sessions.removeOne(session); + d->m_lastActiveTimes.remove(session); emit instance()->sessionRemoved(session); FilePath sessionFile = sessionNameToFileName(session); if (sessionFile.exists()) @@ -318,14 +358,14 @@ void SessionManager::deleteSessions(const QStringList &sessions) bool SessionManager::cloneSession(const QString &original, const QString &clone) { - if (!sb_d->m_sessions.contains(original)) + if (!d->m_sessions.contains(original)) return false; FilePath sessionFile = sessionNameToFileName(original); // If the file does not exist, we can still clone if (!sessionFile.exists() || sessionFile.copyFile(sessionNameToFileName(clone))) { - sb_d->m_sessions.insert(1, clone); - sb_d->m_sessionDateTimes.insert(clone, sessionNameToFileName(clone).lastModified()); + d->m_sessions.insert(1, clone); + d->m_sessionDateTimes.insert(clone, sessionNameToFileName(clone).lastModified()); emit instance()->sessionCreated(clone); return true; @@ -353,7 +393,7 @@ static QString determineSessionToRestoreAtStartup() } } // Handle settings only after command line arguments: - if (sb_d->m_isAutoRestoreLastSession) + if (d->m_isAutoRestoreLastSession) return SessionManager::startupSession(); return {}; } @@ -419,7 +459,7 @@ void SessionManagerPrivate::saveSettings() { QtcSettings *s = ICore::settings(); QVariantMap times; - for (auto it = sb_d->m_lastActiveTimes.cbegin(); it != sb_d->m_lastActiveTimes.cend(); ++it) + for (auto it = d->m_lastActiveTimes.cbegin(); it != d->m_lastActiveTimes.cend(); ++it) times.insert(it.key(), it.value()); s->setValue(LAST_ACTIVE_TIMES_KEY, times); if (SessionManager::isDefaultVirgin()) { @@ -429,13 +469,13 @@ void SessionManagerPrivate::saveSettings() s->setValue(LASTSESSION_KEY, SessionManager::activeSession()); } s->setValueWithDefault(AUTO_RESTORE_SESSION_SETTINGS_KEY, - sb_d->m_isAutoRestoreLastSession, + d->m_isAutoRestoreLastSession, kIsAutoRestoreLastSessionDefault); } void SessionManagerPrivate::restoreSettings() { - sb_d->m_isAutoRestoreLastSession = ICore::settings() + d->m_isAutoRestoreLastSession = ICore::settings() ->value(AUTO_RESTORE_SESSION_SETTINGS_KEY, kIsAutoRestoreLastSessionDefault) .toBool(); @@ -443,12 +483,12 @@ void SessionManagerPrivate::restoreSettings() bool SessionManagerPrivate::isAutoRestoreLastSession() { - return sb_d->m_isAutoRestoreLastSession; + return d->m_isAutoRestoreLastSession; } void SessionManagerPrivate::setAutoRestoreLastSession(bool restore) { - sb_d->m_isAutoRestoreLastSession = restore; + d->m_isAutoRestoreLastSession = restore; } void SessionManagerPrivate::updateSessionMenu() @@ -534,18 +574,18 @@ QString SessionManager::startupSession() void SessionManager::markSessionFileDirty() { - sb_d->m_virginSession = false; + d->m_virginSession = false; } void SessionManager::sessionLoadingProgress() { - sb_d->m_future.setProgressValue(sb_d->m_future.progressValue() + 1); + d->m_future.setProgressValue(d->m_future.progressValue() + 1); QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); } void SessionManager::addSessionLoadingSteps(int steps) { - sb_d->m_future.setProgressRange(0, sb_d->m_future.progressMaximum() + steps); + d->m_future.setProgressRange(0, d->m_future.progressMaximum() + steps); } /* @@ -577,13 +617,13 @@ bool SessionManager::loadSession(const QString &session, bool initial) { const bool loadImplicitDefault = session.isEmpty(); const bool switchFromImplicitToExplicitDefault = session == DEFAULT_SESSION - && sb_d->m_sessionName == DEFAULT_SESSION + && d->m_sessionName == DEFAULT_SESSION && !initial; // Do nothing if we have that session already loaded, // exception if the session is the default virgin session // we still want to be able to load the default session - if (session == sb_d->m_sessionName && !SessionManager::isDefaultVirgin()) + if (session == d->m_sessionName && !SessionManager::isDefaultVirgin()) return true; if (!loadImplicitDefault && !SessionManager::sessions().contains(session)) @@ -604,7 +644,7 @@ bool SessionManager::loadSession(const QString &session, bool initial) } if (loadImplicitDefault) { - sb_d->restoreValues(reader); + d->restoreValues(reader); emit SessionManager::instance()->sessionLoaded(DEFAULT_SESSION); return true; } @@ -613,44 +653,44 @@ bool SessionManager::loadSession(const QString &session, bool initial) return true; } - sb_d->m_loadingSession = true; + d->m_loadingSession = true; // Allow everyone to set something in the session and before saving - emit SessionManager::instance()->aboutToUnloadSession(sb_d->m_sessionName); + emit SessionManager::instance()->aboutToUnloadSession(d->m_sessionName); if (!saveSession()) { - sb_d->m_loadingSession = false; + d->m_loadingSession = false; return false; } // Clean up if (!EditorManager::closeAllEditors()) { - sb_d->m_loadingSession = false; + d->m_loadingSession = false; return false; } if (!switchFromImplicitToExplicitDefault) - sb_d->m_values.clear(); - sb_d->m_sessionValues.clear(); + d->m_values.clear(); + d->m_sessionValues.clear(); - sb_d->m_sessionName = session; - delete sb_d->m_writer; - sb_d->m_writer = nullptr; + d->m_sessionName = session; + delete d->m_writer; + d->m_writer = nullptr; EditorManager::updateWindowTitles(); - sb_d->m_virginSession = false; + d->m_virginSession = false; - ProgressManager::addTask(sb_d->m_future.future(), + ProgressManager::addTask(d->m_future.future(), PE::Tr::tr("Loading Session"), "ProjectExplorer.SessionFile.Load"); - sb_d->m_future.setProgressRange(0, 1 /*initialization*/ + 1 /*editors*/); - sb_d->m_future.setProgressValue(0); + d->m_future.setProgressRange(0, 1 /*initialization*/ + 1 /*editors*/); + d->m_future.setProgressValue(0); if (fileName.exists()) { if (!switchFromImplicitToExplicitDefault) - sb_d->restoreValues(reader); - sb_d->restoreSessionValues(reader); + d->restoreValues(reader); + d->restoreSessionValues(reader); } QColor c = QColor(SessionManager::sessionValue("Color").toString()); @@ -659,19 +699,19 @@ bool SessionManager::loadSession(const QString &session, bool initial) SessionManager::sessionLoadingProgress(); - sb_d->restoreEditors(); + d->restoreEditors(); // let other code restore the session emit SessionManager::instance()->aboutToLoadSession(session); - sb_d->m_future.reportFinished(); - sb_d->m_future = QFutureInterface<void>(); + d->m_future.reportFinished(); + d->m_future = QFutureInterface<void>(); - sb_d->m_lastActiveTimes.insert(session, QDateTime::currentDateTime()); + d->m_lastActiveTimes.insert(session, QDateTime::currentDateTime()); emit SessionManager::instance()->sessionLoaded(session); - sb_d->m_loadingSession = false; + d->m_loadingSession = false; return true; } @@ -679,7 +719,7 @@ bool SessionManager::saveSession() { emit SessionManager::instance()->aboutToSaveSession(); - const FilePath filePath = SessionManager::sessionNameToFileName(sb_d->m_sessionName); + const FilePath filePath = SessionManager::sessionNameToFileName(d->m_sessionName); Store data; // See the explanation at loadSession() for how we handle the implicit default session. @@ -706,33 +746,33 @@ bool SessionManager::saveSession() } setSessionValue("EditorSettings", EditorManager::saveState().toBase64()); - const auto end = sb_d->m_sessionValues.constEnd(); - for (auto it = sb_d->m_sessionValues.constBegin(); it != end; ++it) + const auto end = d->m_sessionValues.constEnd(); + for (auto it = d->m_sessionValues.constBegin(); it != end; ++it) data.insert(it.key(), it.value()); } - const auto end = sb_d->m_values.constEnd(); + const auto end = d->m_values.constEnd(); KeyList keys; - for (auto it = sb_d->m_values.constBegin(); it != end; ++it) { + for (auto it = d->m_values.constBegin(); it != end; ++it) { data.insert("value-" + it.key(), it.value()); keys << it.key(); } data.insert("valueKeys", QVariant::fromValue(keys)); - if (!sb_d->m_writer || sb_d->m_writer->fileName() != filePath) { - delete sb_d->m_writer; - sb_d->m_writer = new PersistentSettingsWriter(filePath, "QtCreatorSession"); + if (!d->m_writer || d->m_writer->fileName() != filePath) { + delete d->m_writer; + d->m_writer = new PersistentSettingsWriter(filePath, "QtCreatorSession"); } - const bool result = sb_d->m_writer->save(data, ICore::dialogParent()); + const bool result = d->m_writer->save(data, ICore::dialogParent()); if (result) { if (!SessionManager::isDefaultVirgin()) - sb_d->m_sessionDateTimes.insert(SessionManager::activeSession(), + d->m_sessionDateTimes.insert(SessionManager::activeSession(), QDateTime::currentDateTime()); } else { QMessageBox::warning(ICore::dialogParent(), PE::Tr::tr("Error while saving session"), PE::Tr::tr("Could not save session to file \"%1\"") - .arg(sb_d->m_writer->fileName().toUserOutput())); + .arg(d->m_writer->fileName().toUserOutput())); } return result; @@ -740,7 +780,7 @@ bool SessionManager::saveSession() bool SessionManager::isStartupSessionRestored() { - return sb_d->m_isStartupSessionRestored; + return d->m_isStartupSessionRestored; } } // namespace Core diff --git a/src/plugins/coreplugin/session_p.h b/src/plugins/coreplugin/session_p.h deleted file mode 100644 index 880e51d4db4..00000000000 --- a/src/plugins/coreplugin/session_p.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include <utils/persistentsettings.h> -#include <utils/store.h> - -#include <QFutureInterface> - -QT_BEGIN_NAMESPACE -class QAction; -class QMenu; -QT_END_NAMESPACE - -using namespace Utils; - -namespace Core { - -class SessionManagerPrivate -{ -public: - void restoreStartupSession(); - - void restoreValues(const PersistentSettingsReader &reader); - void restoreSessionValues(const PersistentSettingsReader &reader); - void restoreEditors(); - - void saveSettings(); - void restoreSettings(); - bool isAutoRestoreLastSession(); - void setAutoRestoreLastSession(bool restore); - - void updateSessionMenu(); - - static QString windowTitleAddition(const FilePath &filePath); - static QString sessionTitle(const FilePath &filePath); - - QString m_sessionName = "default"; - bool m_isStartupSessionRestored = false; - bool m_isAutoRestoreLastSession = false; - bool m_virginSession = true; - bool m_loadingSession = false; - - mutable QStringList m_sessions; - mutable QHash<QString, QDateTime> m_sessionDateTimes; - QHash<QString, QDateTime> m_lastActiveTimes; - - QMap<Utils::Key, QVariant> m_values; - QMap<Utils::Key, QVariant> m_sessionValues; - QFutureInterface<void> m_future; - PersistentSettingsWriter *m_writer = nullptr; - - QMenu *m_sessionMenu; - QAction *m_sessionManagerAction; -}; - -extern SessionManagerPrivate *sb_d; - -} // namespace Core From c8ecacb335ad3a244e07d061d27eb28e810faf06 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 4 Sep 2023 15:40:05 +0200 Subject: [PATCH 0992/1777] StringUtils: Use natural sorting in caseFriendlyCompare() Seems to be the right choice in the contexts we use it in. Supersedes db1d12f69abd77219a17ffe93e4ddc6ab4d65874. Task-number: QTCREATORBUG-29509 Change-Id: I3816ec57d8484404420c7bee1c2b12e8df224cb8 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/utils/stringutils.cpp | 13 +++++++++++-- .../projectexplorer/miniprojecttargetselector.cpp | 15 ++------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/libs/utils/stringutils.cpp b/src/libs/utils/stringutils.cpp index f91a8dc4ce9..c3b6c596905 100644 --- a/src/libs/utils/stringutils.cpp +++ b/src/libs/utils/stringutils.cpp @@ -14,6 +14,7 @@ #include <QClipboard> #endif +#include <QCollator> #include <QDir> #include <QFontMetrics> #include <QJsonArray> @@ -325,10 +326,18 @@ QTCREATOR_UTILS_EXPORT int parseUsedPortFromNetstatOutput(const QByteArray &line int caseFriendlyCompare(const QString &a, const QString &b) { - int result = a.compare(b, Qt::CaseInsensitive); + static const auto makeCollator = [](Qt::CaseSensitivity caseSensitivity) { + QCollator collator; + collator.setNumericMode(true); + collator.setCaseSensitivity(caseSensitivity); + return collator; + }; + static const QCollator insensitiveCollator = makeCollator(Qt::CaseInsensitive); + const int result = insensitiveCollator.compare(a, b); if (result != 0) return result; - return a.compare(b, Qt::CaseSensitive); + static const QCollator sensitiveCollator = makeCollator(Qt::CaseSensitive); + return sensitiveCollator.compare(a, b); } QString quoteAmpersands(const QString &text) diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index b4eac6575c1..09854835c72 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -32,7 +32,6 @@ #include <coreplugin/modemanager.h> #include <QAction> -#include <QCollator> #include <QGuiApplication> #include <QItemDelegate> #include <QKeyEvent> @@ -141,18 +140,8 @@ private: static bool compareItems(const TreeItem *ti1, const TreeItem *ti2) { - static const QCollator collator = [] { - QCollator collator; - collator.setNumericMode(true); - collator.setCaseSensitivity(Qt::CaseInsensitive); - return collator; - }(); - - const int result = collator.compare(static_cast<const GenericItem *>(ti1)->rawDisplayName(), - static_cast<const GenericItem *>(ti2)->rawDisplayName()); - if (result != 0) - return result < 0; - return ti1 < ti2; + return caseFriendlyCompare(static_cast<const GenericItem *>(ti1)->rawDisplayName(), + static_cast<const GenericItem *>(ti2)->rawDisplayName()) < 0; } class GenericModel : public TreeModel<GenericItem, GenericItem> From eef56c79b9d10a4372f4ecdb63f6561f06220f5f Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 4 Sep 2023 15:46:09 +0200 Subject: [PATCH 0993/1777] ProjectExplorer: Use natural sorting for kits As used in settings page, target list, target setup page. Task-number: QTCREATORBUG-29509 Change-Id: If7f7c5fabb8fc7f26e0c864a221c9cc0c594279b Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/projectexplorer/kitmanager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index f2e52f7c3b3..c36f71dee6f 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -483,9 +483,10 @@ const QList<Kit *> KitManager::sortedKits() }); Utils::sort(sortList, [](const QPair<QString, Kit *> &a, const QPair<QString, Kit *> &b) -> bool { - if (a.first == b.first) - return a.second < b.second; - return a.first < b.first; + const int nameResult = Utils::caseFriendlyCompare(a.first, b.first); + if (nameResult != 0) + return nameResult < 0; + return a.second < b.second; }); return Utils::transform<QList>(sortList, &QPair<QString, Kit *>::second); } From 837fadafbdbb0fecb7fe6b59d8a2177c0e720faa Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 23 Aug 2023 12:32:06 +0200 Subject: [PATCH 0994/1777] Android: Use a bit more LayoutBuilder in AndroidApkBuildStep Change-Id: Ic783a528c56849d02f828013683ed58d9fd575be Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/android/androidbuildapkstep.cpp | 70 +++++++++++---------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 7e4b4d15642..6cdf21c6126 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -133,12 +133,7 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) // Application Signature Group - auto signPackageGroup = new QGroupBox(Tr::tr("Application Signature"), this); - - auto keystoreLocationLabel = new QLabel(Tr::tr("Keystore:"), signPackageGroup); - keystoreLocationLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); - - auto keystoreLocationChooser = new PathChooser(signPackageGroup); + auto keystoreLocationChooser = new PathChooser; keystoreLocationChooser->setExpectedKind(PathChooser::File); keystoreLocationChooser->lineEdit()->setReadOnly(true); keystoreLocationChooser->setFilePath(m_step->keystorePath()); @@ -153,7 +148,7 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) setCertificates(); }); - auto keystoreCreateButton = new QPushButton(Tr::tr("Create..."), signPackageGroup); + auto keystoreCreateButton = new QPushButton(Tr::tr("Create...")); connect(keystoreCreateButton, &QAbstractButton::clicked, this, [this, keystoreLocationChooser] { AndroidCreateKeystoreCertificate d; if (d.exec() != QDialog::Accepted) @@ -166,26 +161,29 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) setCertificates(); }); - m_signPackageCheckBox = new QCheckBox(Tr::tr("Sign package"), signPackageGroup); + m_signPackageCheckBox = new QCheckBox(Tr::tr("Sign package")); m_signPackageCheckBox->setChecked(m_step->signPackage()); - m_signingDebugWarningLabel = new Utils::InfoLabel(Tr::tr("Signing a debug package"), - Utils::InfoLabel::Warning, signPackageGroup); + m_signingDebugWarningLabel = new InfoLabel(Tr::tr("Signing a debug package"), + InfoLabel::Warning); m_signingDebugWarningLabel->hide(); + m_signingDebugWarningLabel->setSizePolicy(QSizePolicy::MinimumExpanding, + QSizePolicy::Preferred); - auto certificateAliasLabel = new QLabel(Tr::tr("Certificate alias:"), signPackageGroup); - certificateAliasLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - m_certificatesAliasComboBox = new QComboBox(signPackageGroup); + m_certificatesAliasComboBox = new QComboBox; m_certificatesAliasComboBox->setEnabled(false); m_certificatesAliasComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); using namespace Layouting; - Column { - Row { keystoreLocationLabel, keystoreLocationChooser, keystoreCreateButton }, - m_signPackageCheckBox, - Row { m_signingDebugWarningLabel, certificateAliasLabel, m_certificatesAliasComboBox } - }.attachTo(signPackageGroup); + Group signPackageGroup { + title(Tr::tr("Application Signature")), + Form { + Tr::tr("Keystore:"), keystoreLocationChooser, keystoreCreateButton, br, + m_signPackageCheckBox, br, + Tr::tr("Certificate alias:"), m_certificatesAliasComboBox, + m_signingDebugWarningLabel, st, br, + } + }; connect(m_signPackageCheckBox, &QAbstractButton::toggled, this, &AndroidBuildApkWidget::signPackageCheckBoxToggled); @@ -207,8 +205,6 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) filteredSdkPlatforms(minApiSupported)); targets.removeDuplicates(); - auto applicationGroup = new QGroupBox(Tr::tr("Application"), this); - auto targetSDKComboBox = new QComboBox(); targetSDKComboBox->addItems(targets); targetSDKComboBox->setCurrentIndex(targets.indexOf(m_step->buildTargetSdk())); @@ -238,9 +234,6 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) : buildToolsVersions.indexOf(m_step->buildToolsVersion()); buildToolsSdkComboBox->setCurrentIndex(initIdx); - auto formLayout = new QFormLayout(applicationGroup); - formLayout->addRow(Tr::tr("Android build-tools version:"), buildToolsSdkComboBox); - formLayout->addRow(Tr::tr("Android build platform SDK:"), targetSDKComboBox); auto createAndroidTemplatesButton = new QPushButton(Tr::tr("Create Templates")); createAndroidTemplatesButton->setToolTip( @@ -250,13 +243,19 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) wizard.exec(); }); - formLayout->addRow(Tr::tr("Android customization:"), createAndroidTemplatesButton); + Group applicationGroup { + title(Tr::tr("Application")), + Form { + Tr::tr("Android build-tools version:"), buildToolsSdkComboBox, br, + Tr::tr("Android build platform SDK:"), targetSDKComboBox, br, + Tr::tr("Android customization:"), createAndroidTemplatesButton, + } + }; + // Advanced Actions group - auto advancedGroup = new QGroupBox(Tr::tr("Advanced Actions"), this); - - m_addDebuggerCheckBox = new QCheckBox(Tr::tr("Add debug server"), advancedGroup); + m_addDebuggerCheckBox = new QCheckBox(Tr::tr("Add debug server")); m_addDebuggerCheckBox->setEnabled(false); m_addDebuggerCheckBox->setToolTip(Tr::tr("Packages debug server with " "the APK to enable debugging. For the signed APK this option is unchecked by default.")); @@ -264,12 +263,15 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) connect(m_addDebuggerCheckBox, &QAbstractButton::toggled, m_step, &AndroidBuildApkStep::setAddDebugger); - Layouting::Column { - m_step->buildAAB, - m_step->openPackageLocation, - m_step->verboseOutput, - m_addDebuggerCheckBox - }.attachTo(advancedGroup); + Group advancedGroup { + title(Tr::tr("Advanced Actions")), + Column { + m_step->buildAAB, + m_step->openPackageLocation, + m_step->verboseOutput, + m_addDebuggerCheckBox + } + }; // Additional Libraries group From 5fd559a3b7066c3557ec325999481fd467e0418f Mon Sep 17 00:00:00 2001 From: Johnny Jazeix <jazeix@gmail.com> Date: Mon, 28 Aug 2023 12:04:40 +0200 Subject: [PATCH 0995/1777] remove double space in translatable script Change-Id: I79751f2220318de03a01654d99fabeb1340212eb Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../QtQuick3D/SpatialAudio/SpatialSoundSection.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick3D/SpatialAudio/SpatialSoundSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick3D/SpatialAudio/SpatialSoundSection.qml index 9d753700df1..b9729ba14e7 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick3D/SpatialAudio/SpatialSoundSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick3D/SpatialAudio/SpatialSoundSection.qml @@ -138,7 +138,7 @@ Section { PropertyLabel { text: qsTr("Manual Attenuation") - tooltip: qsTr("Set the manual attenuation factor if distanceModel is set to ManualAttenuation.") + tooltip: qsTr("Set the manual attenuation factor if distanceModel is set to ManualAttenuation.") } SecondColumnLayout { From 2d383da290b807d87d3f0adf725ef38b12e1c506 Mon Sep 17 00:00:00 2001 From: Johnny Jazeix <jazeix@gmail.com> Date: Wed, 23 Aug 2023 20:14:03 +0200 Subject: [PATCH 0996/1777] fix typo paddding -> padding Change-Id: I49bca9ef8589e2b842dd1d32b445db95fa94e340 Reviewed-by: Pranta Ghosh Dastider <pranta.dastider@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> --- .../imports/HelperWidgets/PaddingSection.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PaddingSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PaddingSection.qml index e1def65263a..135c0f5cfa1 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PaddingSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PaddingSection.qml @@ -67,7 +67,7 @@ Section { PropertyLabel { text: qsTr("Horizontal") - tooltip: qsTr("Sets the paddding on the left and right sides of the item.") + tooltip: qsTr("Sets the padding on the left and right sides of the item.") blockedByTemplate: !backendValues.leftPadding.isAvailable && !backendValues.rightPadding.isAvailable } From 76a95ff0eea0754b2ed3edf96c7097bd81a1cf52 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 5 Sep 2023 08:47:35 +0200 Subject: [PATCH 0997/1777] Utils: Switch to QtcSettings Changes a few remaining QSettings members that popped up when trying to build with "apt-get" Qt 6.2.4. Change-Id: I3caa8545cf02d6453b802559c2f65279e1fb63fd Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/utils/aspects.cpp | 6 +++--- src/libs/utils/aspects.h | 5 +++-- src/libs/utils/infobar.cpp | 8 ++++---- src/libs/utils/infobar.h | 7 ++++--- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 486563f6209..f49cdf57048 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -36,14 +36,14 @@ using namespace Layouting; namespace Utils { -static QSettings *theSettings = nullptr; +static QtcSettings *theSettings = nullptr; -void BaseAspect::setQtcSettings(QSettings *settings) +void BaseAspect::setQtcSettings(QtcSettings *settings) { theSettings = settings; } -QSettings *BaseAspect::qtcSettings() +QtcSettings *BaseAspect::qtcSettings() { return theSettings; } diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 24d8b7a92f0..909b19a5be5 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -9,6 +9,7 @@ #include "macroexpander.h" #include "pathchooser.h" #include "store.h" +#include "qtcsettings.h" #include <functional> #include <memory> @@ -180,8 +181,8 @@ public: Data::Ptr extractData() const; - static void setQtcSettings(QSettings *settings); - static QSettings *qtcSettings(); + static void setQtcSettings(QtcSettings *settings); + static QtcSettings *qtcSettings(); // This is expensive. Do not use without good reason void writeToSettingsImmediatly() const; diff --git a/src/libs/utils/infobar.cpp b/src/libs/utils/infobar.cpp index 430a294adcd..9571d6164f1 100644 --- a/src/libs/utils/infobar.cpp +++ b/src/libs/utils/infobar.cpp @@ -22,7 +22,7 @@ static const char C_SUPPRESSED_WARNINGS[] = "SuppressedWarnings"; namespace Utils { QSet<Id> InfoBar::globallySuppressed; -QSettings *InfoBar::m_settings = nullptr; +QtcSettings *InfoBar::m_settings = nullptr; class InfoBarWidget : public QWidget { @@ -184,17 +184,17 @@ void InfoBar::globallyUnsuppressInfo(Id id) writeGloballySuppressedToSettings(); } -void InfoBar::initialize(QSettings *settings) +void InfoBar::initialize(QtcSettings *settings) { m_settings = settings; if (QTC_GUARD(m_settings)) { - const QStringList list = m_settings->value(QLatin1String(C_SUPPRESSED_WARNINGS)).toStringList(); + const QStringList list = m_settings->value(C_SUPPRESSED_WARNINGS).toStringList(); globallySuppressed = transform<QSet>(list, Id::fromString); } } -QSettings *InfoBar::settings() +QtcSettings *InfoBar::settings() { return m_settings; } diff --git a/src/libs/utils/infobar.h b/src/libs/utils/infobar.h index 8548b9ecdde..c59e6164ab4 100644 --- a/src/libs/utils/infobar.h +++ b/src/libs/utils/infobar.h @@ -6,6 +6,7 @@ #include "utils_global.h" #include "id.h" +#include "qtcsettings.h" #include <QObject> #include <QSet> @@ -102,8 +103,8 @@ public: static void clearGloballySuppressed(); static bool anyGloballySuppressed(); - static void initialize(QSettings *settings); - static QSettings *settings(); + static void initialize(QtcSettings *settings); + static QtcSettings *settings(); signals: void changed(); @@ -116,7 +117,7 @@ private: QSet<Id> m_suppressed; static QSet<Id> globallySuppressed; - static QSettings *m_settings; + static QtcSettings *m_settings; friend class InfoBarDisplay; }; From b9188fb7478ae08e2248304c2da68fcca9ee38ed Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 15:18:36 +0200 Subject: [PATCH 0998/1777] QmlJSEditor: Remove unneeded indirection via qmljsicontextpane.h Change-Id: I39989fdb697dc7078a01f9582b790ee91021e3ab Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/libs/qmljs/CMakeLists.txt | 1 - src/libs/qmljs/qmljs.qbs | 1 - src/libs/qmljs/qmljsicontextpane.h | 34 ------------------------ src/plugins/qmljseditor/qmljseditor.cpp | 2 +- src/plugins/qmljseditor/quicktoolbar.cpp | 9 +++---- src/plugins/qmljseditor/quicktoolbar.h | 24 +++++++++++------ 6 files changed, 21 insertions(+), 50 deletions(-) delete mode 100644 src/libs/qmljs/qmljsicontextpane.h diff --git a/src/libs/qmljs/CMakeLists.txt b/src/libs/qmljs/CMakeLists.txt index d166e666e74..4ca15cf7cc2 100644 --- a/src/libs/qmljs/CMakeLists.txt +++ b/src/libs/qmljs/CMakeLists.txt @@ -32,7 +32,6 @@ add_qtc_library(QmlJS qmljsevaluate.cpp qmljsevaluate.h qmljsfindexportedcpptypes.cpp qmljsfindexportedcpptypes.h qmljsicons.cpp qmljsicons.h - qmljsicontextpane.h qmljsimportdependencies.cpp qmljsimportdependencies.h qmljsindenter.cpp qmljsindenter.h qmljsinterpreter.cpp qmljsinterpreter.h diff --git a/src/libs/qmljs/qmljs.qbs b/src/libs/qmljs/qmljs.qbs index 59eecc55f4c..aa886a8ba2f 100644 --- a/src/libs/qmljs/qmljs.qbs +++ b/src/libs/qmljs/qmljs.qbs @@ -30,7 +30,6 @@ Project { "qmljsevaluate.cpp", "qmljsevaluate.h", "qmljsfindexportedcpptypes.cpp", "qmljsfindexportedcpptypes.h", "qmljsicons.cpp", "qmljsicons.h", - "qmljsicontextpane.h", "qmljsimportdependencies.cpp", "qmljsimportdependencies.h", "qmljsindenter.cpp", "qmljsindenter.h", "qmljsinterpreter.cpp", "qmljsinterpreter.h", diff --git a/src/libs/qmljs/qmljsicontextpane.h b/src/libs/qmljs/qmljsicontextpane.h deleted file mode 100644 index 4bbc33a7d73..00000000000 --- a/src/libs/qmljs/qmljsicontextpane.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <QObject> - -#include "qmljs_global.h" - -#include <qmljs/qmljsdocument.h> -#include <qmljs/parser/qmljsastfwd_p.h> - -namespace TextEditor { class TextEditorWidget; } - -namespace QmlJS { - -class ScopeChain; - -class QMLJS_EXPORT IContextPane : public QObject -{ - Q_OBJECT - -public: - IContextPane(QObject *parent = nullptr) : QObject(parent) {} - virtual ~IContextPane() {} - virtual void apply(TextEditor::TextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, AST::Node *node, bool update, bool force = false) = 0; - virtual void setEnabled(bool) = 0; - virtual bool isAvailable(TextEditor::TextEditorWidget *editorWidget, Document::Ptr document, AST::Node *node) = 0; - virtual QWidget* widget() = 0; -signals: - void closed(); -}; - -} // namespace QmlJS diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 765d8d4ad28..04c94d628a4 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -126,7 +126,7 @@ void QmlJSEditorWidget::finalizeInitialization() if (m_contextPane) { connect(this, &QmlJSEditorWidget::cursorPositionChanged, &m_contextPaneTimer, QOverload<>::of(&QTimer::start)); - connect(m_contextPane, &IContextPane::closed, this, &QmlJSEditorWidget::showTextMarker); + connect(m_contextPane, &QuickToolBar::closed, this, &QmlJSEditorWidget::showTextMarker); } connect(this->document(), &QTextDocument::modificationChanged, diff --git a/src/plugins/qmljseditor/quicktoolbar.cpp b/src/plugins/qmljseditor/quicktoolbar.cpp index 1487d44844e..911c4228603 100644 --- a/src/plugins/qmljseditor/quicktoolbar.cpp +++ b/src/plugins/qmljseditor/quicktoolbar.cpp @@ -337,13 +337,11 @@ void QuickToolBar::setEnabled(bool b) widget()->hide(); } - -QWidget* QuickToolBar::widget() +QWidget *QuickToolBar::widget() { return contextWidget(); } - void QuickToolBar::onPropertyChanged(const QString &name, const QVariant &value) { if (m_blockWriting) @@ -411,7 +409,7 @@ void QuickToolBar::indentLines(int startLine, int endLine) } } -ContextPaneWidget* QuickToolBar::contextWidget() +ContextPaneWidget *QuickToolBar::contextWidget() { if (m_widget.isNull()) { //lazily recreate widget m_widget = new ContextPaneWidget; @@ -425,7 +423,8 @@ ContextPaneWidget* QuickToolBar::contextWidget() this, &QuickToolBar::onEnabledChanged); connect(m_widget.data(), &ContextPaneWidget::pinnedChanged, this, &QuickToolBar::onPinnedChanged); - connect(m_widget.data(), &ContextPaneWidget::closed, this, &IContextPane::closed); + connect(m_widget.data(), &ContextPaneWidget::closed, + this, &QuickToolBar::closed); } return m_widget.data(); } diff --git a/src/plugins/qmljseditor/quicktoolbar.h b/src/plugins/qmljseditor/quicktoolbar.h index df6a2ca2665..09147809c4d 100644 --- a/src/plugins/qmljseditor/quicktoolbar.h +++ b/src/plugins/qmljseditor/quicktoolbar.h @@ -3,30 +3,35 @@ #pragma once -#include <qmljs/qmljsicontextpane.h> +#include <qmljs/qmljsdocument.h> +#include <qmljs/parser/qmljsastfwd_p.h> #include <QPointer> +namespace TextEditor { class TextEditorWidget; } + +namespace QmlJS { class ScopeChain; } + namespace QmlEditorWidgets { class ContextPaneWidget; } namespace QmlJSEditor { -class QuickToolBar : public QmlJS::IContextPane +class QuickToolBar : public QObject { Q_OBJECT QuickToolBar(); public: - ~QuickToolBar() override; + ~QuickToolBar(); static QuickToolBar *instance(); - void apply(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, const QmlJS::ScopeChain *scopeChain, QmlJS::AST::Node *node, bool update, bool force = false) override; - bool isAvailable(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, QmlJS::AST::Node *node) override; + void apply(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, const QmlJS::ScopeChain *scopeChain, QmlJS::AST::Node *node, bool update, bool force = false); + bool isAvailable(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, QmlJS::AST::Node *node); void setProperty(const QString &propertyName, const QVariant &value); void removeProperty(const QString &propertyName); - void setEnabled(bool) override; - QWidget* widget() override; + void setEnabled(bool); + QWidget *widget(); void onPropertyChanged(const QString &, const QVariant &); void onPropertyRemoved(const QString &); @@ -34,6 +39,9 @@ public: void onPinnedChanged(bool); void onEnabledChanged(bool); +signals: + void closed(); + private: void indentLines(int startLine, int endLine); @@ -48,4 +56,4 @@ private: QString m_oldType; }; -} //QmlDesigner +} // QmlJSEditor From a475632c66bc9fadad3792df4e71dd015624fe38 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 22 Aug 2023 09:22:46 +0200 Subject: [PATCH 0999/1777] Utils: Make TreeViews use setUniformRowHeights by default When applicable, the flag makes a significant difference in performacnce. However is easily forgotten in cases where it is applicable, and cases where it is accidentally used are easily spotted visually. So arguably, opt-out is a better default than opt-in. Change-Id: I88aeb05b42533ba4e23c39573a3ddd016343cd55 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../advanceddockingsystem/workspaceview.cpp | 1 + src/libs/extensionsystem/pluginview.cpp | 1 - src/libs/utils/basetreeview.cpp | 1 - src/libs/utils/itemviews.cpp | 28 +++++++++++++++++++ src/libs/utils/itemviews.h | 16 +++-------- src/libs/utils/navigationtreeview.cpp | 1 - src/plugins/autotest/testresultspane.cpp | 1 + .../uvsc/uvtargetdeviceselection.cpp | 1 + .../cmakebuildconfiguration.cpp | 1 - .../coreplugin/find/searchresulttreeview.cpp | 1 - .../locator/locatorsettingspage.cpp | 1 + .../coreplugin/locator/locatorwidget.cpp | 1 - .../coreplugin/opendocumentstreeview.cpp | 1 - src/plugins/coreplugin/sessionview.cpp | 1 + .../ctfvisualizer/ctfstatisticsview.cpp | 1 - src/plugins/debugger/console/consoleview.cpp | 1 + src/plugins/git/gerrit/gerritdialog.cpp | 1 - src/plugins/git/logchangedialog.cpp | 1 - src/plugins/git/stashdialog.cpp | 1 - .../mesonbuildconfiguration.cpp | 1 - .../projectexplorer/addrunconfigdialog.cpp | 5 +--- .../devicesupport/deviceprocessesdialog.cpp | 1 - .../projectexplorer/environmentwidget.cpp | 1 - .../filterkitaspectsdialog.cpp | 5 +--- .../miniprojecttargetselector.cpp | 1 - .../itemlibrary/assetimportupdatetreeview.cpp | 1 - src/plugins/qmlprofiler/quick3dframeview.cpp | 1 + 27 files changed, 41 insertions(+), 36 deletions(-) diff --git a/src/libs/advanceddockingsystem/workspaceview.cpp b/src/libs/advanceddockingsystem/workspaceview.cpp index 1b4cfc7e270..26983c2bcd7 100644 --- a/src/libs/advanceddockingsystem/workspaceview.cpp +++ b/src/libs/advanceddockingsystem/workspaceview.cpp @@ -46,6 +46,7 @@ WorkspaceView::WorkspaceView(DockManager *manager, QWidget *parent) , m_manager(manager) , m_workspaceModel(manager) { + setUniformRowHeights(false); setItemDelegate(new RemoveItemFocusDelegate(this)); setSelectionBehavior(QAbstractItemView::SelectRows); setSelectionMode(QAbstractItemView::SingleSelection); diff --git a/src/libs/extensionsystem/pluginview.cpp b/src/libs/extensionsystem/pluginview.cpp index 693dd3c471e..f4afedc01ea 100644 --- a/src/libs/extensionsystem/pluginview.cpp +++ b/src/libs/extensionsystem/pluginview.cpp @@ -275,7 +275,6 @@ PluginView::PluginView(QWidget *parent) m_categoryView = new TreeView(this); m_categoryView->setAlternatingRowColors(true); m_categoryView->setIndentation(20); - m_categoryView->setUniformRowHeights(true); m_categoryView->setSortingEnabled(true); m_categoryView->setColumnWidth(LoadedColumn, 40); m_categoryView->header()->setDefaultSectionSize(120); diff --git a/src/libs/utils/basetreeview.cpp b/src/libs/utils/basetreeview.cpp index 14d17257841..60c239d5355 100644 --- a/src/libs/utils/basetreeview.cpp +++ b/src/libs/utils/basetreeview.cpp @@ -345,7 +345,6 @@ BaseTreeView::BaseTreeView(QWidget *parent) setRootIsDecorated(false); setIconSize(QSize(16, 16)); setSelectionMode(QAbstractItemView::ExtendedSelection); - setUniformRowHeights(true); setItemDelegate(new BaseTreeViewDelegate(this)); setAlternatingRowColors(false); diff --git a/src/libs/utils/itemviews.cpp b/src/libs/utils/itemviews.cpp index 27f7cbb4281..c043b07ff52 100644 --- a/src/libs/utils/itemviews.cpp +++ b/src/libs/utils/itemviews.cpp @@ -3,6 +3,8 @@ #include "itemviews.h" +namespace Utils { + /*! \class Utils::TreeView \inmodule QtCreator @@ -12,6 +14,8 @@ platforms where the default is different. Use with care. Also adds sane keyboard navigation for mac. + + Note: This uses setUniformRowHeights(true) by default. */ /*! @@ -23,6 +27,8 @@ platforms where the default is different. Use with care. Also adds sane keyboard navigation for mac. + + Note: This uses setUniformRowHeights(true) by default. */ /*! @@ -46,3 +52,25 @@ Also adds sane keyboard navigation for mac. */ + +TreeView::TreeView(QWidget *parent) + : View<QTreeView>(parent) +{ + setUniformRowHeights(true); +} + +TreeWidget::TreeWidget(QWidget *parent) + : View<QTreeWidget>(parent) +{ + setUniformRowHeights(true); +} + +ListView::ListView(QWidget *parent) + : View<QListView>(parent) +{} + +ListWidget::ListWidget(QWidget *parent) + : View<QListWidget>(parent) +{} + +} // Utils diff --git a/src/libs/utils/itemviews.h b/src/libs/utils/itemviews.h index cad6d12746a..50e8a4af01e 100644 --- a/src/libs/utils/itemviews.h +++ b/src/libs/utils/itemviews.h @@ -64,33 +64,25 @@ public: class QTCREATOR_UTILS_EXPORT TreeView : public View<QTreeView> { public: - TreeView(QWidget *parent = nullptr) - : View<QTreeView>(parent) - {} + TreeView(QWidget *parent = nullptr); }; class QTCREATOR_UTILS_EXPORT TreeWidget : public View<QTreeWidget> { public: - TreeWidget(QWidget *parent = nullptr) - : View<QTreeWidget>(parent) - {} + TreeWidget(QWidget *parent = nullptr); }; class QTCREATOR_UTILS_EXPORT ListView : public View<QListView> { public: - ListView(QWidget *parent = nullptr) - : View<QListView>(parent) - {} + ListView(QWidget *parent = nullptr); }; class QTCREATOR_UTILS_EXPORT ListWidget : public View<QListWidget> { public: - ListWidget(QWidget *parent = nullptr) - : View<QListWidget>(parent) - {} + ListWidget(QWidget *parent = nullptr); }; } // Utils diff --git a/src/libs/utils/navigationtreeview.cpp b/src/libs/utils/navigationtreeview.cpp index b19935f1689..61ef04d8167 100644 --- a/src/libs/utils/navigationtreeview.cpp +++ b/src/libs/utils/navigationtreeview.cpp @@ -25,7 +25,6 @@ NavigationTreeView::NavigationTreeView(QWidget *parent) { setFrameStyle(QFrame::NoFrame); setIndentation(indentation() * 7/10); - setUniformRowHeights(true); setTextElideMode(Qt::ElideNone); setAttribute(Qt::WA_MacShowFocusRect, false); diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index 7fdbcd6dac3..2b4cd99b3c8 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -56,6 +56,7 @@ namespace Internal { ResultsTreeView::ResultsTreeView(QWidget *parent) : TreeView(parent) { + setUniformRowHeights(false); setAttribute(Qt::WA_MacShowFocusRect, false); setFrameStyle(NoFrame); } diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp index 934bbb098d0..2c87aa5db15 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdeviceselection.cpp @@ -264,6 +264,7 @@ void DeviceSelectionMemoryModel::refresh() DeviceSelectionMemoryView::DeviceSelectionMemoryView(DeviceSelection &selection, QWidget *parent) : TreeView(parent) { + setUniformRowHeights(false); setRootIsDecorated(true); setSelectionMode(QAbstractItemView::SingleSelection); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 8c004a95bc6..6a1ea952524 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -246,7 +246,6 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) m_configView->setModel(m_configTextFilterModel); m_configView->setMinimumHeight(300); - m_configView->setUniformRowHeights(true); m_configView->setSortingEnabled(true); m_configView->sortByColumn(0, Qt::AscendingOrder); m_configView->header()->setSectionResizeMode(QHeaderView::Stretch); diff --git a/src/plugins/coreplugin/find/searchresulttreeview.cpp b/src/plugins/coreplugin/find/searchresulttreeview.cpp index d8026ccd847..c246d21fca5 100644 --- a/src/plugins/coreplugin/find/searchresulttreeview.cpp +++ b/src/plugins/coreplugin/find/searchresulttreeview.cpp @@ -44,7 +44,6 @@ SearchResultTreeView::SearchResultTreeView(QWidget *parent) setItemDelegate(new SearchResultTreeItemDelegate(8, this)); setIndentation(14); - setUniformRowHeights(true); setExpandsOnDoubleClick(true); header()->setSectionResizeMode(QHeaderView::ResizeToContents); header()->setStretchLastSection(false); diff --git a/src/plugins/coreplugin/locator/locatorsettingspage.cpp b/src/plugins/coreplugin/locator/locatorsettingspage.cpp index 74c3b45692e..e06d26a783c 100644 --- a/src/plugins/coreplugin/locator/locatorsettingspage.cpp +++ b/src/plugins/coreplugin/locator/locatorsettingspage.cpp @@ -277,6 +277,7 @@ public: filterEdit->setFiltering(true); m_filterList = new TreeView; + m_filterList->setUniformRowHeights(false); m_filterList->setSelectionMode(QAbstractItemView::SingleSelection); m_filterList->setSelectionBehavior(QAbstractItemView::SelectRows); m_filterList->setSortingEnabled(true); diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index 67a2eba5bb2..5876c20827c 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -250,7 +250,6 @@ CompletionList::CompletionList(QWidget *parent) setItemDelegate(new CompletionDelegate(this)); setRootIsDecorated(false); - setUniformRowHeights(true); header()->hide(); header()->setStretchLastSection(true); // This is too slow when done on all results diff --git a/src/plugins/coreplugin/opendocumentstreeview.cpp b/src/plugins/coreplugin/opendocumentstreeview.cpp index 4c1ad171ee2..3b19d659a54 100644 --- a/src/plugins/coreplugin/opendocumentstreeview.cpp +++ b/src/plugins/coreplugin/opendocumentstreeview.cpp @@ -81,7 +81,6 @@ OpenDocumentsTreeView::OpenDocumentsTreeView(QWidget *parent) : m_delegate = new Internal::OpenDocumentsDelegate(this); setItemDelegate(m_delegate); setRootIsDecorated(false); - setUniformRowHeights(true); setTextElideMode(Qt::ElideMiddle); setFrameStyle(QFrame::NoFrame); setAttribute(Qt::WA_MacShowFocusRect, false); diff --git a/src/plugins/coreplugin/sessionview.cpp b/src/plugins/coreplugin/sessionview.cpp index 4b03c929900..589d725156b 100644 --- a/src/plugins/coreplugin/sessionview.cpp +++ b/src/plugins/coreplugin/sessionview.cpp @@ -36,6 +36,7 @@ void RemoveItemFocusDelegate::paint(QPainter* painter, const QStyleOptionViewIte SessionView::SessionView(QWidget *parent) : Utils::TreeView(parent) { + setUniformRowHeights(false); setItemDelegate(new RemoveItemFocusDelegate(this)); setSelectionBehavior(QAbstractItemView::SelectRows); setSelectionMode(QAbstractItemView::ExtendedSelection); diff --git a/src/plugins/ctfvisualizer/ctfstatisticsview.cpp b/src/plugins/ctfvisualizer/ctfstatisticsview.cpp index 3e8ff8a40b8..583d1929a42 100644 --- a/src/plugins/ctfvisualizer/ctfstatisticsview.cpp +++ b/src/plugins/ctfvisualizer/ctfstatisticsview.cpp @@ -28,7 +28,6 @@ CtfStatisticsView::CtfStatisticsView(CtfStatisticsModel *model, QWidget *parent) header()->setStretchLastSection(false); header()->setSectionResizeMode(CtfStatisticsModel::Column::Title, QHeaderView::Stretch); setRootIsDecorated(false); - setUniformRowHeights(true); setSortingEnabled(true); connect(selectionModel(), &QItemSelectionModel::currentChanged, this, diff --git a/src/plugins/debugger/console/consoleview.cpp b/src/plugins/debugger/console/consoleview.cpp index 2ee80a03d5c..d42f4ae9185 100644 --- a/src/plugins/debugger/console/consoleview.cpp +++ b/src/plugins/debugger/console/consoleview.cpp @@ -32,6 +32,7 @@ namespace Internal { ConsoleView::ConsoleView(ConsoleItemModel *model, QWidget *parent) : Utils::TreeView(parent), m_model(model) { + setUniformRowHeights(false); setFrameStyle(QFrame::NoFrame); setHeaderHidden(true); setRootIsDecorated(false); diff --git a/src/plugins/git/gerrit/gerritdialog.cpp b/src/plugins/git/gerrit/gerritdialog.cpp index 990c792e41a..9a78739d192 100644 --- a/src/plugins/git/gerrit/gerritdialog.cpp +++ b/src/plugins/git/gerrit/gerritdialog.cpp @@ -82,7 +82,6 @@ GerritDialog::GerritDialog(const QSharedPointer<GerritParameters> &p, m_treeView = new TreeView(changesGroup); m_treeView->setMinimumSize(QSize(600, 0)); m_treeView->setRootIsDecorated(false); - m_treeView->setUniformRowHeights(true); m_treeView->setSortingEnabled(true); auto detailsGroup = new QGroupBox(Git::Tr::tr("Details")); diff --git a/src/plugins/git/logchangedialog.cpp b/src/plugins/git/logchangedialog.cpp index 9462fc8bce9..a1091683311 100644 --- a/src/plugins/git/logchangedialog.cpp +++ b/src/plugins/git/logchangedialog.cpp @@ -71,7 +71,6 @@ LogChangeWidget::LogChangeWidget(QWidget *parent) m_model->setHorizontalHeaderLabels(headers); setModel(m_model); setMinimumWidth(300); - setUniformRowHeights(true); setRootIsDecorated(false); setSelectionBehavior(QAbstractItemView::SelectRows); setActivationMode(Utils::DoubleClickActivation); diff --git a/src/plugins/git/stashdialog.cpp b/src/plugins/git/stashdialog.cpp index d2807d1d8ec..cfd0b92e777 100644 --- a/src/plugins/git/stashdialog.cpp +++ b/src/plugins/git/stashdialog.cpp @@ -132,7 +132,6 @@ StashDialog::StashDialog(QWidget *parent) : QDialog(parent), m_stashView->setModel(m_proxyModel); m_stashView->setSelectionMode(QAbstractItemView::ExtendedSelection); m_stashView->setAllColumnsShowFocus(true); - m_stashView->setUniformRowHeights(true); m_stashView->setFocus(); using namespace Layouting; diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp index b6c58a1f716..45543a5f261 100644 --- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp +++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp @@ -185,7 +185,6 @@ public: optionsTreeView->setMinimumHeight(300); optionsTreeView->setFrameShape(QFrame::NoFrame); optionsTreeView->setSelectionBehavior(QAbstractItemView::SelectItems); - optionsTreeView->setUniformRowHeights(true); optionsTreeView->setSortingEnabled(true); using namespace Layouting; diff --git a/src/plugins/projectexplorer/addrunconfigdialog.cpp b/src/plugins/projectexplorer/addrunconfigdialog.cpp index fa5b0bbb913..4457bf07003 100644 --- a/src/plugins/projectexplorer/addrunconfigdialog.cpp +++ b/src/plugins/projectexplorer/addrunconfigdialog.cpp @@ -95,10 +95,7 @@ private: class CandidatesTreeView : public TreeView { public: - CandidatesTreeView(QWidget *parent) : TreeView(parent) - { - setUniformRowHeights(true); - } + CandidatesTreeView(QWidget *parent) : TreeView(parent) {} private: QSize sizeHint() const override diff --git a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp index 7aad3a4e1cf..0a7d7942400 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp @@ -121,7 +121,6 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(KitChooser *chooser, procView->setModel(&proxyModel); procView->setSelectionBehavior(QAbstractItemView::SelectRows); procView->setSelectionMode(QAbstractItemView::SingleSelection); - procView->setUniformRowHeights(true); procView->setRootIsDecorated(false); procView->setAlternatingRowColors(true); procView->setSortingEnabled(true); diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp index 5fa21953113..64e406ace22 100644 --- a/src/plugins/projectexplorer/environmentwidget.cpp +++ b/src/plugins/projectexplorer/environmentwidget.cpp @@ -212,7 +212,6 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, Type type, QWidget *additi d->m_environmentView->setItemDelegate(new EnvironmentDelegate(d->m_model, d->m_environmentView)); d->m_environmentView->setMinimumHeight(400); d->m_environmentView->setRootIsDecorated(false); - d->m_environmentView->setUniformRowHeights(true); const auto stretcher = new HeaderViewStretcher(d->m_environmentView->header(), 1); connect(d->m_model, &QAbstractItemModel::dataChanged, stretcher, &HeaderViewStretcher::softStretch); diff --git a/src/plugins/projectexplorer/filterkitaspectsdialog.cpp b/src/plugins/projectexplorer/filterkitaspectsdialog.cpp index a6ff108dc5d..ce9ab5e2849 100644 --- a/src/plugins/projectexplorer/filterkitaspectsdialog.cpp +++ b/src/plugins/projectexplorer/filterkitaspectsdialog.cpp @@ -113,10 +113,7 @@ public: class FilterTreeView : public TreeView { public: - FilterTreeView(QWidget *parent) : TreeView(parent) - { - setUniformRowHeights(true); - } + FilterTreeView(QWidget *parent) : TreeView(parent) {} private: QSize sizeHint() const override diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 09854835c72..86075f51f90 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -488,7 +488,6 @@ SelectorView::SelectorView(QWidget *parent) : TreeView(parent) setFocusPolicy(Qt::NoFocus); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setAlternatingRowColors(false); - setUniformRowHeights(true); setIndentation(0); setFocusPolicy(Qt::WheelFocus); setItemDelegate(new TargetSelectorDelegate(this)); diff --git a/src/plugins/qmldesigner/components/itemlibrary/assetimportupdatetreeview.cpp b/src/plugins/qmldesigner/components/itemlibrary/assetimportupdatetreeview.cpp index 89f36c7437b..a683ab2b8b3 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/assetimportupdatetreeview.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/assetimportupdatetreeview.cpp @@ -16,7 +16,6 @@ AssetImportUpdateTreeView::AssetImportUpdateTreeView(QWidget *parent) { setModel(m_model); setItemDelegate(new AssetImportUpdateTreeItemDelegate(this)); - setUniformRowHeights(true); setExpandsOnDoubleClick(true); header()->hide(); } diff --git a/src/plugins/qmlprofiler/quick3dframeview.cpp b/src/plugins/qmlprofiler/quick3dframeview.cpp index 9853dbe9912..3d0141d0ed9 100644 --- a/src/plugins/qmlprofiler/quick3dframeview.cpp +++ b/src/plugins/qmlprofiler/quick3dframeview.cpp @@ -118,6 +118,7 @@ void Quick3DFrameView::onVisibleFeaturesChanged(quint64) Quick3DMainView::Quick3DMainView(Quick3DFrameModel *model, bool compareView, QWidget *parent) : Utils::TreeView(parent), m_model(model), m_compareView(compareView) { + setUniformRowHeights(false); setObjectName("Quick3DMainView"); setFrameStyle(QFrame::NoFrame); QHeaderView *h = header(); From 7ad4589f5deefab54c7169b461f4c68622d53b41 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 5 Sep 2023 09:03:55 +0200 Subject: [PATCH 1000/1777] LSP: Fix compilation with Qt 6.2.4 Change-Id: I1f81d35529317107c63727a92d940a3991ddc59d Reviewed-by: hjk <hjk@qt.io> --- src/libs/languageserverprotocol/jsonobject.cpp | 4 ++-- src/libs/languageserverprotocol/jsonobject.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libs/languageserverprotocol/jsonobject.cpp b/src/libs/languageserverprotocol/jsonobject.cpp index aed754a10f7..d591e06cb67 100644 --- a/src/libs/languageserverprotocol/jsonobject.cpp +++ b/src/libs/languageserverprotocol/jsonobject.cpp @@ -17,12 +17,12 @@ JsonObject &JsonObject::operator=(JsonObject &&other) QJsonObject::iterator JsonObject::insert(const std::string_view key, const JsonObject &object) { - return m_jsonObject.insert(QLatin1String(key), object.m_jsonObject); + return m_jsonObject.insert(QLatin1String(key.data()), object.m_jsonObject); } QJsonObject::iterator JsonObject::insert(const std::string_view key, const QJsonValue &value) { - return m_jsonObject.insert(QLatin1String(key), value); + return m_jsonObject.insert(QLatin1String(key.data()), value); } } // namespace LanguageServerProtocol diff --git a/src/libs/languageserverprotocol/jsonobject.h b/src/libs/languageserverprotocol/jsonobject.h index fd87d6c4663..11c764c82c7 100644 --- a/src/libs/languageserverprotocol/jsonobject.h +++ b/src/libs/languageserverprotocol/jsonobject.h @@ -52,11 +52,11 @@ protected: iterator insertVariant(const std::string_view key, const V &variant); // QJSonObject redirections - QJsonValue value(const std::string_view key) const { return m_jsonObject.value(QLatin1String(key)); } - bool contains(const std::string_view key) const { return m_jsonObject.contains(QLatin1String(key)); } - iterator find(const std::string_view key) { return m_jsonObject.find(QLatin1String(key)); } - const_iterator find(const std::string_view key) const { return m_jsonObject.find(QLatin1String(key)); } - void remove(const std::string_view key) { m_jsonObject.remove(QLatin1String(key)); } + QJsonValue value(const std::string_view key) const { return m_jsonObject.value(QLatin1String(key.data())); } + bool contains(const std::string_view key) const { return m_jsonObject.contains(QLatin1String(key.data())); } + iterator find(const std::string_view key) { return m_jsonObject.find(QLatin1String(key.data())); } + const_iterator find(const std::string_view key) const { return m_jsonObject.find(QLatin1String(key.data())); } + void remove(const std::string_view key) { m_jsonObject.remove(QLatin1String(key.data())); } QStringList keys() const { return m_jsonObject.keys(); } // convenience value access @@ -129,7 +129,7 @@ QList<T> JsonObject::array(const std::string_view key) const if (const std::optional<QList<T>> &array = optionalArray<T>(key)) return *array; qCDebug(conversionLog) << QString("Expected array under %1 in:") - .arg(QLatin1String(key)) << *this; + .arg(QLatin1String(key.data())) << *this; return {}; } From c14c021e45080f0859cd5fc552afc3e06021c82b Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 5 Sep 2023 09:20:31 +0200 Subject: [PATCH 1001/1777] Utils: Use QtcSettings Fixes compile errors with Qt 6.2.4. Change-Id: Ia97d5fcbeb80ee1242fd4c2425bc7f325dad8953 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/qtcsettings.h | 4 ++++ src/libs/utils/settingsutils.h | 5 +++-- src/plugins/clangtools/clangtoolssettings.cpp | 4 ++-- src/plugins/coreplugin/mainwindow.cpp | 4 ++-- src/plugins/coreplugin/navigationwidget.cpp | 4 ++-- src/plugins/coreplugin/navigationwidget.h | 2 +- src/plugins/cppeditor/cppcodemodelsettings.cpp | 4 ++-- src/plugins/cppeditor/cppcodemodelsettings.h | 9 +++------ src/plugins/cppeditor/cppincludehierarchy.cpp | 8 ++++---- src/plugins/cppeditor/cppinsertvirtualmethods.cpp | 4 ++-- src/plugins/mcusupport/settingshandler.cpp | 6 +++--- src/plugins/projectexplorer/projectexplorer.cpp | 2 +- src/plugins/projectexplorer/toolchainmanager.cpp | 2 +- src/plugins/texteditor/tabsettings.cpp | 4 ++-- src/plugins/texteditor/tabsettings.h | 9 +++------ 15 files changed, 35 insertions(+), 36 deletions(-) diff --git a/src/libs/utils/qtcsettings.h b/src/libs/utils/qtcsettings.h index ba0550c31af..e4fd76d8396 100644 --- a/src/libs/utils/qtcsettings.h +++ b/src/libs/utils/qtcsettings.h @@ -16,6 +16,10 @@ class QTCREATOR_UTILS_EXPORT QtcSettings : public QSettings public: using QSettings::QSettings; + void beginGroup(const Key &prefix) { QSettings::beginGroup(stringFromKey(prefix)); } + void beginGroup(const QString &prefix) { QSettings::beginGroup(prefix); } + void beginGroup(const char *prefix) { QSettings::beginGroup(stringFromKey(prefix)); } + QVariant value(const Key &key) const { return QSettings::value(stringFromKey(key)); } QVariant value(const Key &key, const QVariant &def) const { return QSettings::value(stringFromKey(key), def); } void setValue(const Key &key, const QVariant &value) { QSettings::setValue(stringFromKey(key), value); } diff --git a/src/libs/utils/settingsutils.h b/src/libs/utils/settingsutils.h index 694d17503dd..5806ca44868 100644 --- a/src/libs/utils/settingsutils.h +++ b/src/libs/utils/settingsutils.h @@ -4,6 +4,7 @@ #pragma once #include "store.h" +#include "qtcsettings.h" #include <QSettings> #include <QStringList> @@ -14,7 +15,7 @@ namespace Utils { template <class SettingsClassT> void fromSettings(const Key &postFix, const Key &category, - QSettings *s, + QtcSettings *s, SettingsClassT *obj) { Store map; @@ -29,7 +30,7 @@ void fromSettings(const Key &postFix, template <class SettingsClassT> void toSettings(const Key &postFix, const Key &category, - QSettings *s, + QtcSettings *s, const SettingsClassT *obj) { Key group = postFix; diff --git a/src/plugins/clangtools/clangtoolssettings.cpp b/src/plugins/clangtools/clangtoolssettings.cpp index 4c000abd34e..8d8f176389e 100644 --- a/src/plugins/clangtools/clangtoolssettings.cpp +++ b/src/plugins/clangtools/clangtoolssettings.cpp @@ -147,7 +147,7 @@ void ClangToolsSettings::readSettings() AspectContainer::readSettings(); - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); s->beginGroup(Constants::SETTINGS_ID); m_diagnosticConfigs.append(diagnosticConfigsFromSettings(s)); @@ -180,7 +180,7 @@ void ClangToolsSettings::writeSettings() const { AspectContainer::writeSettings(); - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); s->beginGroup(Constants::SETTINGS_ID); diagnosticConfigsToSettings(s, m_diagnosticConfigs); diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index c95637181fb..9f1043146c2 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -1152,7 +1152,7 @@ void MainWindow::aboutToShutdown() void MainWindow::readSettings() { - QSettings *settings = PluginManager::settings(); + QtcSettings *settings = PluginManager::settings(); settings->beginGroup(QLatin1String(settingsGroup)); if (m_overrideColor.isValid()) { @@ -1160,7 +1160,7 @@ void MainWindow::readSettings() // Get adapted base color. m_overrideColor = StyleHelper::baseColor(); } else { - StyleHelper::setBaseColor(settings->value(QLatin1String(colorKey), + StyleHelper::setBaseColor(settings->value(colorKey, QColor(StyleHelper::DEFAULT_BASE_COLOR)).value<QColor>()); } diff --git a/src/plugins/coreplugin/navigationwidget.cpp b/src/plugins/coreplugin/navigationwidget.cpp index 90b667b0500..e271a492a11 100644 --- a/src/plugins/coreplugin/navigationwidget.cpp +++ b/src/plugins/coreplugin/navigationwidget.cpp @@ -407,7 +407,7 @@ void NavigationWidget::saveSettings(QtcSettings *settings) } } -void NavigationWidget::restoreSettings(QSettings *settings) +void NavigationWidget::restoreSettings(QtcSettings *settings) { if (!d->m_factoryModel->rowCount()) { // We have no widgets to show! @@ -475,7 +475,7 @@ void NavigationWidget::restoreSettings(QSettings *settings) if (!key.startsWith(activationKey)) continue; - int position = settings->value(key).toInt(); + int position = settings->value(keyFromString(key)).toInt(); Id factoryId = Id::fromString(key.mid(activationKey.length())); NavigationWidgetPrivate::updateActivationsMap(factoryId, {d->m_side, position}); } diff --git a/src/plugins/coreplugin/navigationwidget.h b/src/plugins/coreplugin/navigationwidget.h index bf5fceff880..dd36fe90811 100644 --- a/src/plugins/coreplugin/navigationwidget.h +++ b/src/plugins/coreplugin/navigationwidget.h @@ -72,7 +72,7 @@ public: Utils::Key settingsGroup() const; void saveSettings(Utils::QtcSettings *settings); - void restoreSettings(QSettings *settings); + void restoreSettings(Utils::QtcSettings *settings); QWidget *activateSubWidget(Utils::Id factoryId, int preferredPosition); void closeSubWidgets(); diff --git a/src/plugins/cppeditor/cppcodemodelsettings.cpp b/src/plugins/cppeditor/cppcodemodelsettings.cpp index 7aa072f8e63..d08551b13da 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettings.cpp @@ -68,7 +68,7 @@ static FilePath fallbackClangdFilePath() return Environment::systemEnvironment().searchInPath("clangd"); } -void CppCodeModelSettings::fromSettings(QSettings *s) +void CppCodeModelSettings::fromSettings(QtcSettings *s) { s->beginGroup(QLatin1String(Constants::CPPEDITOR_SETTINGSGROUP)); @@ -100,7 +100,7 @@ void CppCodeModelSettings::fromSettings(QSettings *s) emit changed(); } -void CppCodeModelSettings::toSettings(QSettings *s) +void CppCodeModelSettings::toSettings(QtcSettings *s) { s->beginGroup(QLatin1String(Constants::CPPEDITOR_SETTINGSGROUP)); diff --git a/src/plugins/cppeditor/cppcodemodelsettings.h b/src/plugins/cppeditor/cppcodemodelsettings.h index f4303146b71..a2095f55e3e 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.h +++ b/src/plugins/cppeditor/cppcodemodelsettings.h @@ -10,15 +10,12 @@ #include <utils/filepath.h> #include <utils/id.h> #include <utils/store.h> +#include <utils/qtcsettings.h> #include <QObject> #include <QStringList> #include <QVersionNumber> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - namespace ProjectExplorer { class Project; } namespace CppEditor { @@ -34,8 +31,8 @@ public: }; public: - void fromSettings(QSettings *s); - void toSettings(QSettings *s); + void fromSettings(Utils::QtcSettings *s); + void toSettings(Utils::QtcSettings *s); public: bool enableLowerClazyLevels() const; diff --git a/src/plugins/cppeditor/cppincludehierarchy.cpp b/src/plugins/cppeditor/cppincludehierarchy.cpp index 6a0ec5d4944..130cf35472f 100644 --- a/src/plugins/cppeditor/cppincludehierarchy.cpp +++ b/src/plugins/cppeditor/cppincludehierarchy.cpp @@ -333,8 +333,8 @@ public: void perform(); - void saveSettings(QSettings *settings, int position); - void restoreSettings(QSettings *settings, int position); + void saveSettings(QtcSettings *settings, int position); + void restoreSettings(QtcSettings *settings, int position); private: void onItemActivated(const QModelIndex &index); @@ -430,13 +430,13 @@ void CppIncludeHierarchyWidget::perform() const bool kSyncDefault = false; -void CppIncludeHierarchyWidget::saveSettings(QSettings *settings, int position) +void CppIncludeHierarchyWidget::saveSettings(QtcSettings *settings, int position) { const Key key = keyFromString(QString("IncludeHierarchy.%1.SyncWithEditor").arg(position)); QtcSettings::setValueWithDefault(settings, key, m_toggleSync->isChecked(), kSyncDefault); } -void CppIncludeHierarchyWidget::restoreSettings(QSettings *settings, int position) +void CppIncludeHierarchyWidget::restoreSettings(QtcSettings *settings, int position) { const Key key = keyFromString(QString("IncludeHierarchy.%1.SyncWithEditor").arg(position)); m_toggleSync->setChecked(settings->value(key, kSyncDefault).toBool()); diff --git a/src/plugins/cppeditor/cppinsertvirtualmethods.cpp b/src/plugins/cppeditor/cppinsertvirtualmethods.cpp index 6b8f77a0363..24e7d6b0166 100644 --- a/src/plugins/cppeditor/cppinsertvirtualmethods.cpp +++ b/src/plugins/cppeditor/cppinsertvirtualmethods.cpp @@ -286,7 +286,7 @@ class VirtualMethodsSettings public: void read() { - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); s->beginGroup(group()); insertVirtualKeyword = s->value(insertVirtualKeywordKey(), kInsertVirtualKeywordDefault) .toBool(); @@ -304,7 +304,7 @@ public: void write() const { - Utils::QtcSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); s->beginGroup(group()); s->setValueWithDefault(insertVirtualKeywordKey(), insertVirtualKeyword, diff --git a/src/plugins/mcusupport/settingshandler.cpp b/src/plugins/mcusupport/settingshandler.cpp index 32bc9132d27..26fcbfb0ae8 100644 --- a/src/plugins/mcusupport/settingshandler.cpp +++ b/src/plugins/mcusupport/settingshandler.cpp @@ -18,7 +18,7 @@ const Key automaticKitCreationSettingsKey = Key(Constants::SETTINGS_GROUP) + '/' + Constants::SETTINGS_KEY_AUTOMATIC_KIT_CREATION; static FilePath packagePathFromSettings(const Key &settingsKey, - QSettings &settings, + QtcSettings &settings, const FilePath &defaultPath) { const Key key = Key(Constants::SETTINGS_GROUP) + '/' @@ -55,14 +55,14 @@ bool SettingsHandler::write(const Key &settingsKey, bool SettingsHandler::isAutomaticKitCreationEnabled() const { - QSettings *settings = Core::ICore::settings(QSettings::UserScope); + QtcSettings *settings = Core::ICore::settings(QSettings::UserScope); const bool automaticKitCreation = settings->value(automaticKitCreationSettingsKey, true).toBool(); return automaticKitCreation; } void SettingsHandler::setAutomaticKitCreation(bool isEnabled) { - QSettings *settings = Core::ICore::settings(QSettings::UserScope); + QtcSettings *settings = Core::ICore::settings(QSettings::UserScope); settings->setValue(automaticKitCreationSettingsKey, isEnabled); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index bda6b4b8f65..d2f78d5b8b5 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1628,7 +1628,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er dd->updateWelcomePage(); }); - QSettings *s = ICore::settings(); + QtcSettings *s = ICore::settings(); const QStringList fileNames = s->value(Constants::RECENTPROJECTS_FILE_NAMES_KEY).toStringList(); const QStringList displayNames = s->value(Constants::RECENTPROJECTS_DISPLAY_NAMES_KEY) .toStringList(); diff --git a/src/plugins/projectexplorer/toolchainmanager.cpp b/src/plugins/projectexplorer/toolchainmanager.cpp index a0ae2d1cbe9..a97085a1387 100644 --- a/src/plugins/projectexplorer/toolchainmanager.cpp +++ b/src/plugins/projectexplorer/toolchainmanager.cpp @@ -82,7 +82,7 @@ ToolChainManager::ToolChainManager(QObject *parent) : connect(this, &ToolChainManager::toolChainRemoved, this, &ToolChainManager::toolChainsChanged); connect(this, &ToolChainManager::toolChainUpdated, this, &ToolChainManager::toolChainsChanged); - QSettings * const s = Core::ICore::settings(); + QtcSettings * const s = Core::ICore::settings(); d->m_detectionSettings.detectX64AsX32 = s->value(DETECT_X64_AS_X32_KEY, ToolchainDetectionSettings().detectX64AsX32).toBool(); d->m_badToolchains = BadToolchains::fromVariant(s->value(badToolchainsKey())); diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index 2668d4f88f6..ff5e9b729e5 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -33,12 +33,12 @@ TabSettings::TabSettings(TabSettings::TabPolicy tabPolicy, } -void TabSettings::toSettings(const Key &category, QSettings *s) const +void TabSettings::toSettings(const Key &category, QtcSettings *s) const { Utils::toSettings(groupPostfix, category, s, this); } -void TabSettings::fromSettings(const Key &category, QSettings *s) +void TabSettings::fromSettings(const Key &category, QtcSettings *s) { *this = TabSettings(); // Assign defaults Utils::fromSettings(groupPostfix, category, s, this); diff --git a/src/plugins/texteditor/tabsettings.h b/src/plugins/texteditor/tabsettings.h index a4a6f1c3f27..73e895112ca 100644 --- a/src/plugins/texteditor/tabsettings.h +++ b/src/plugins/texteditor/tabsettings.h @@ -6,13 +6,10 @@ #include "texteditor_global.h" #include <utils/store.h> +#include <utils/qtcsettings.h> #include <QTextBlock> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - namespace TextEditor { // Tab settings: Data type the GeneralSettingsPage acts on @@ -38,8 +35,8 @@ public: TabSettings(TabPolicy tabPolicy, int tabSize, int indentSize, ContinuationAlignBehavior continuationAlignBehavior); - void toSettings(const Utils::Key &category, QSettings *s) const; - void fromSettings(const Utils::Key &category, QSettings *s); + void toSettings(const Utils::Key &category, Utils::QtcSettings *s) const; + void fromSettings(const Utils::Key &category, Utils::QtcSettings *s); Utils::Store toMap() const; void fromMap(const Utils::Store &map); From 0c7e7c545aae81dc19d28f65b43bd62db16ff33c Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 5 Sep 2023 09:20:52 +0200 Subject: [PATCH 1002/1777] ClangFormat: Fix compilation with Qt 6.2.4 Change-Id: I71f28a258ad9f3b2e745c409edb6d2fe1a5bfea3 Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/clangformat/clangformatbaseindenter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/clangformat/clangformatbaseindenter.h b/src/plugins/clangformat/clangformatbaseindenter.h index e20470321d8..70d59661710 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.h +++ b/src/plugins/clangformat/clangformatbaseindenter.h @@ -79,7 +79,7 @@ private: void setCache(clang::format::FormatStyle newStyle, std::chrono::milliseconds timeout) { style = newStyle; - expirationTime = QDateTime::currentDateTime() + timeout; + expirationTime = QDateTime::currentDateTime().addMSecs(timeout.count()); } }; From 7adeaafd9338259f6cd1e8e34af42a15c1002d78 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 4 Sep 2023 17:18:44 +0200 Subject: [PATCH 1003/1777] QtSupport: Use natural sorting for Qt versions in settings widget Change-Id: I4ef14a575c536e9f789fedf24937bd0f9e118f91 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/utils/treemodel.cpp | 9 +++++++++ src/libs/utils/treemodel.h | 16 +++++++++++++++- src/plugins/qtsupport/qtoptionspage.cpp | 6 ++---- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/libs/utils/treemodel.cpp b/src/libs/utils/treemodel.cpp index 2691525441a..1c82ac0244a 100644 --- a/src/libs/utils/treemodel.cpp +++ b/src/libs/utils/treemodel.cpp @@ -4,6 +4,7 @@ #include "treemodel.h" #include "qtcassert.h" +#include "stringutils.h" #include <QStack> #include <QSize> @@ -1199,4 +1200,12 @@ Qt::ItemFlags StaticTreeItem::flags(int column) const return Qt::ItemIsEnabled; } +bool SortModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const +{ + if (m_lessThan) + return lessThan(source_left, source_right); + return caseFriendlyCompare(sourceModel()->data(source_left).toString(), + sourceModel()->data(source_right).toString()) < 0; +} + } // namespace Utils diff --git a/src/libs/utils/treemodel.h b/src/libs/utils/treemodel.h index 46832ff9d94..8fe66d61d45 100644 --- a/src/libs/utils/treemodel.h +++ b/src/libs/utils/treemodel.h @@ -7,7 +7,7 @@ #include "indexedcontainerproxyconstiterator.h" -#include <QAbstractItemModel> +#include <QSortFilterProxyModel> #include <functional> @@ -344,6 +344,20 @@ public: } }; +// By default, does natural sorting by display name. Call setLessThan() to customize. +class QTCREATOR_UTILS_EXPORT SortModel : public QSortFilterProxyModel +{ +public: + using QSortFilterProxyModel::QSortFilterProxyModel; + using LessThan = std::function<bool(const QModelIndex &, const QModelIndex &)>; + void setLessThan(const LessThan &lessThan) { m_lessThan = lessThan; } + +private: + bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; + + LessThan m_lessThan; +}; + } // namespace Utils Q_DECLARE_METATYPE(Utils::TreeItem *) diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index a139d853fed..8d3a27464e7 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -41,7 +41,6 @@ #include <QLabel> #include <QMessageBox> #include <QPushButton> -#include <QSortFilterProxyModel> #include <QTextBrowser> #include <QTreeView> @@ -197,7 +196,7 @@ private: void updateVersionItem(QtVersionItem *item); TreeModel<TreeItem, TreeItem, QtVersionItem> *m_model; - QSortFilterProxyModel *m_filterModel; + SortModel *m_filterModel; TreeItem *m_autoItem; TreeItem *m_manualItem; @@ -314,9 +313,8 @@ QtOptionsPageWidget::QtOptionsPageWidget() m_model->rootItem()->appendChild(m_autoItem); m_model->rootItem()->appendChild(m_manualItem); - m_filterModel = new QSortFilterProxyModel(this); + m_filterModel = new SortModel(this); m_filterModel->setSourceModel(m_model); - m_filterModel->setSortCaseSensitivity(Qt::CaseInsensitive); m_qtdirList->setModel(m_filterModel); m_qtdirList->setSortingEnabled(true); From 1c5aa2225730a6b325c3c80259c39c20354fc4af Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 5 Sep 2023 10:12:33 +0200 Subject: [PATCH 1004/1777] Utils: Add PersistentCacheStore Change-Id: I952e0271afcc0fd4b03ef75fa5acb219be153290 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/CMakeLists.txt | 1 + src/libs/utils/filepath.cpp | 5 ++ src/libs/utils/filepath.h | 1 + src/libs/utils/persistentcachestore.cpp | 115 ++++++++++++++++++++++++ src/libs/utils/persistentcachestore.h | 22 +++++ src/libs/utils/store.cpp | 22 +++++ src/libs/utils/store.h | 4 + src/libs/utils/utils.qbs | 2 + 8 files changed, 172 insertions(+) create mode 100644 src/libs/utils/persistentcachestore.cpp create mode 100644 src/libs/utils/persistentcachestore.h diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 72c18e3346f..9f1569b73b2 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -117,6 +117,7 @@ add_qtc_library(Utils passworddialog.cpp passworddialog.h pathchooser.cpp pathchooser.h pathlisteditor.cpp pathlisteditor.h + persistentcachestore.cpp persistentcachestore.h persistentsettings.cpp persistentsettings.h pointeralgorithm.h port.cpp port.h diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 4ab0f502f74..a5a51b43bbe 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -749,6 +749,11 @@ FilePath FilePath::withExecutableSuffix() const return withNewPath(OsSpecificAspects::withExecutableSuffix(osType(), path())); } +FilePath FilePath::withSuffix(const QString &suffix) const +{ + return withNewPath(path() + suffix); +} + static bool startsWithWindowsDriveLetterAndSlash(QStringView path) { return path.size() > 2 && path[1] == ':' && path[2] == '/' && isWindowsDriveLetter(path[0]); diff --git a/src/libs/utils/filepath.h b/src/libs/utils/filepath.h index a5605769866..9d7b3ce5862 100644 --- a/src/libs/utils/filepath.h +++ b/src/libs/utils/filepath.h @@ -160,6 +160,7 @@ public: [[nodiscard]] FilePath symLinkTarget() const; [[nodiscard]] FilePath resolveSymlinks() const; [[nodiscard]] FilePath withExecutableSuffix() const; + [[nodiscard]] FilePath withSuffix(const QString &suffix) const; [[nodiscard]] FilePath relativeChildPath(const FilePath &parent) const; [[nodiscard]] FilePath relativePathFrom(const FilePath &anchor) const; [[nodiscard]] Environment deviceEnvironment() const; diff --git a/src/libs/utils/persistentcachestore.cpp b/src/libs/utils/persistentcachestore.cpp new file mode 100644 index 00000000000..0cac5f83cde --- /dev/null +++ b/src/libs/utils/persistentcachestore.cpp @@ -0,0 +1,115 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "persistentcachestore.h" + +#include "filepath.h" +#include "fileutils.h" + +#include <QMap> +#include <QMutex> +#include <QStandardPaths> + +namespace Utils { + +class PrivateGlobal +{ +public: + QMutex mutex; + QMap<Key, Store> caches; +}; + +static expected_str<FilePath> cacheFolder() +{ + static const FilePath folder = FilePath::fromUserInput(QStandardPaths::writableLocation( + QStandardPaths::CacheLocation)) + / "CachedStores"; + static expected_str<void> created = folder.ensureWritableDir(); + static expected_str<FilePath> result = created ? folder + : expected_str<FilePath>( + make_unexpected(created.error())); + + QTC_ASSERT_EXPECTED(result, return result); + return result; +} + +static PrivateGlobal &globals() +{ + static PrivateGlobal global; + return global; +} + +static expected_str<FilePath> filePathFromKey(const Key &cacheKey) +{ + static const expected_str<FilePath> folder = cacheFolder(); + if (!folder) + return folder; + + return (*folder / FileUtils::fileSystemFriendlyName(stringFromKey(cacheKey))).withSuffix(".json"); +} + +expected_str<Store> PersistentCacheStore::byKey(const Key &cacheKey) +{ + const expected_str<FilePath> path = filePathFromKey(cacheKey); + if (!path) + return make_unexpected(path.error()); + + QMutexLocker locker(&globals().mutex); + + auto it = globals().caches.find(cacheKey); + if (it != globals().caches.end()) + return it.value(); + + const expected_str<QByteArray> contents = path->fileContents(); + if (!contents) + return make_unexpected(contents.error()); + + auto result = storeFromJson(*contents); + if (!result) + return result; + + if (result->value("__cache_key__").toString() != stringFromKey(cacheKey)) { + return make_unexpected(QString("Cache key mismatch: \"%1\" to \"%2\" in \"%3\".") + .arg(stringFromKey(cacheKey)) + .arg(result->value("__cache_key__").toString()) + .arg(path->toUserOutput())); + } + + return result; +} + +expected_str<void> PersistentCacheStore::write(const Key &cacheKey, const Store &store) +{ + const expected_str<FilePath> path = filePathFromKey(cacheKey); + if (!path) + return make_unexpected(path.error()); + + QMutexLocker locker(&globals().mutex); + globals().caches.insert(cacheKey, store); + + // TODO: The writing of the store data could be done in a separate thread in the future. + Store storeCopy = store; + storeCopy.insert("__cache_key__", stringFromKey(cacheKey)); + storeCopy.insert("__last_modified__", QDateTime::currentDateTime().toString(Qt::ISODate)); + QByteArray json = jsonFromStore(storeCopy); + const expected_str<qint64> result = path->writeFileContents(json); + if (!result) + return make_unexpected(result.error()); + return {}; +} + +expected_str<void> PersistentCacheStore::clear(const Key &cacheKey) +{ + const expected_str<FilePath> path = filePathFromKey(cacheKey); + if (!path) + return make_unexpected(path.error()); + + QMutexLocker locker(&globals().mutex); + globals().caches.remove(cacheKey); + + if (!path->removeFile()) + return make_unexpected(QString("Failed to remove cache file.")); + return {}; +} + +} // namespace Utils diff --git a/src/libs/utils/persistentcachestore.h b/src/libs/utils/persistentcachestore.h new file mode 100644 index 00000000000..0c40061d619 --- /dev/null +++ b/src/libs/utils/persistentcachestore.h @@ -0,0 +1,22 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "utils_global.h" + +#include "expected.h" +#include "store.h" +#include "storekey.h" + +namespace Utils { + +class QTCREATOR_UTILS_EXPORT PersistentCacheStore +{ +public: + static expected_str<Store> byKey(const Key &cacheKey); + static expected_str<void> write(const Key &cacheKey, const Store &store); + static expected_str<void> clear(const Key &cacheKey); +}; + +} // namespace Utils diff --git a/src/libs/utils/store.cpp b/src/libs/utils/store.cpp index d48adc2cde4..42a14d6f1a9 100644 --- a/src/libs/utils/store.cpp +++ b/src/libs/utils/store.cpp @@ -6,6 +6,9 @@ #include "algorithm.h" #include "qtcassert.h" +#include <QJsonDocument> +#include <QJsonParseError> + namespace Utils { KeyList keysFromStrings(const QStringList &list) @@ -111,4 +114,23 @@ Key numberedKey(const Key &key, int number) return key + Key::number(number); } +expected_str<Store> storeFromJson(const QByteArray &json) +{ + QJsonParseError error; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + if (error.error != QJsonParseError::NoError) + return make_unexpected(error.errorString()); + + if (!doc.isObject()) + return make_unexpected(QString("Not a valid JSON object.")); + + return storeFromMap(doc.toVariant().toMap()); +} + +QByteArray jsonFromStore(const Store &store) +{ + QJsonDocument doc = QJsonDocument::fromVariant(mapFromStore(store)); + return doc.toJson(); +} + } // Utils diff --git a/src/libs/utils/store.h b/src/libs/utils/store.h index 3050251bc1c..f09b98f3306 100644 --- a/src/libs/utils/store.h +++ b/src/libs/utils/store.h @@ -3,6 +3,7 @@ #pragma once +#include "expected.h" #include "storekey.h" #include <QMap> @@ -27,6 +28,9 @@ QTCREATOR_UTILS_EXPORT bool isStore(const QVariant &value); QTCREATOR_UTILS_EXPORT Key numberedKey(const Key &key, int number); +QTCREATOR_UTILS_EXPORT expected_str<Store> storeFromJson(const QByteArray &json); +QTCREATOR_UTILS_EXPORT QByteArray jsonFromStore(const Store &store); + } // Utils Q_DECLARE_METATYPE(Utils::Store) diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 021c1d37f26..1110ad11c73 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -226,6 +226,8 @@ Project { "pathchooser.h", "pathlisteditor.cpp", "pathlisteditor.h", + "persistentcachestore.cpp", + "persistentcachestore.h", "persistentsettings.cpp", "persistentsettings.h", "pointeralgorithm.h", From 19aeb45abd415a52821bc0521bfd3980b0770d0c Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Tue, 5 Sep 2023 10:29:22 +0200 Subject: [PATCH 1005/1777] DAP: Remove redundant source field in breakpoint structure Change-Id: I30c952971353ab316791cd68cf91f192bd398b84 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/dapengine.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index b80c58765be..0f0b31772d4 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -232,21 +232,16 @@ bool DapEngine::acceptsBreakpoint(const BreakpointParameters &) const return true; // FIXME: Too bold. } -static QJsonObject createBreakpoint(const Breakpoint &breakpoint) +static QJsonObject createBreakpoint(const BreakpointParameters ¶ms) { - const BreakpointParameters ¶ms = breakpoint->requestedParameters(); - if (params.fileName.isEmpty()) return QJsonObject(); QJsonObject bp; bp["line"] = params.textPosition.line; - bp["source"] = QJsonObject{{"name", params.fileName.fileName()}, - {"path", params.fileName.path()}}; return bp; } - void DapEngine::insertBreakpoint(const Breakpoint &bp) { QTC_ASSERT(bp, return); @@ -263,9 +258,9 @@ void DapEngine::dapInsertBreakpoint(const Breakpoint &bp) QJsonArray breakpoints; for (const auto &breakpoint : breakHandler()->breakpoints()) { - QJsonObject jsonBp = createBreakpoint(breakpoint); - if (!jsonBp.isEmpty() - && params.fileName.path() == jsonBp["source"].toObject()["path"].toString()) { + const BreakpointParameters &bpParams = breakpoint->requestedParameters(); + QJsonObject jsonBp = createBreakpoint(bpParams); + if (!jsonBp.isEmpty() && params.fileName.path() == bpParams.fileName.path()) { breakpoints.append(jsonBp); } } @@ -304,9 +299,9 @@ void DapEngine::dapRemoveBreakpoint(const Breakpoint &bp) QJsonArray breakpoints; for (const auto &breakpoint : breakHandler()->breakpoints()) { - if (breakpoint->responseId() != bp->responseId() - && params.fileName == breakpoint->requestedParameters().fileName) { - QJsonObject jsonBp = createBreakpoint(breakpoint); + const BreakpointParameters &bpParams = breakpoint->requestedParameters(); + if (breakpoint->responseId() != bp->responseId() && params.fileName == bpParams.fileName) { + QJsonObject jsonBp = createBreakpoint(bpParams); breakpoints.append(jsonBp); } } From 640a4f0c9cc3a7d31fed16b324a2a1faec0b5a7f Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 4 Sep 2023 12:58:19 +0200 Subject: [PATCH 1006/1777] QtSupport: Cache Qt Version information Change-Id: Iabdd4f880e492fe5ab7ee6d633c8f1f70b4c2cb8 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/qnx/qnxqtversion.cpp | 4 +- src/plugins/qnx/qnxqtversion.h | 4 +- src/plugins/qtsupport/baseqtversion.cpp | 159 ++++++++++++++++++++---- src/plugins/qtsupport/baseqtversion.h | 6 +- src/plugins/qtsupport/qtoptionspage.cpp | 2 +- 5 files changed, 145 insertions(+), 30 deletions(-) diff --git a/src/plugins/qnx/qnxqtversion.cpp b/src/plugins/qnx/qnxqtversion.cpp index d8e7ab5dcf5..b5360c272df 100644 --- a/src/plugins/qnx/qnxqtversion.cpp +++ b/src/plugins/qnx/qnxqtversion.cpp @@ -116,9 +116,9 @@ Store QnxQtVersion::toMap() const return result; } -void QnxQtVersion::fromMap(const Store &map, const FilePath &) +void QnxQtVersion::fromMap(const Store &map, const FilePath &, bool forceRefreshCache) { - QtVersion::fromMap(map); + QtVersion::fromMap(map, {}, forceRefreshCache); setSdpPath(FilePath::fromSettings(map.value(SDP_PATH_KEY))); } diff --git a/src/plugins/qnx/qnxqtversion.h b/src/plugins/qnx/qnxqtversion.h index 3752fcb0e85..7c3e81dac9f 100644 --- a/src/plugins/qnx/qnxqtversion.h +++ b/src/plugins/qnx/qnxqtversion.h @@ -28,7 +28,9 @@ public: QString cpuDir() const; Utils::Store toMap() const override; - void fromMap(const Utils::Store &map, const Utils::FilePath &filePath) override; + void fromMap(const Utils::Store &map, + const Utils::FilePath &filePath, + bool forceRefreshCache) override; ProjectExplorer::Abis detectQtAbis() const override; diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 046154af645..4cfe178e6df 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -33,6 +33,7 @@ #include <utils/fileinprojectfinder.h> #include <utils/hostosinfo.h> #include <utils/macroexpander.h> +#include <utils/persistentcachestore.h> #include <utils/process.h> #include <utils/qtcassert.h> #include <utils/stringutils.h> @@ -76,6 +77,9 @@ const char MKSPEC_VALUE_NAMESPACE[] = "QT_NAMESPACE"; class QtVersionData { public: + // Update version if you add data members! + static const int version = 1; + bool installed = true; bool hasExamples = false; bool hasDemos = false; @@ -111,6 +115,102 @@ public: Utils::FilePath hostPrefixPath; Abis qtAbis; + + QHash<ProKey, ProString> versionInfo; + bool versionInfoUpToDate = false; + + static QHash<ProKey, ProString> fromVariantMap(const QVariantMap &map) + { + QHash<ProKey, ProString> result; + for (auto it = map.constBegin(); it != map.constEnd(); ++it) + result.insert(ProKey(it.key()), ProString(it.value().toString())); + return result; + } + + static QVariantMap toVariantMap(const QHash<ProKey, ProString> &map) + { + QVariantMap result; + for (auto it = map.constBegin(); it != map.constEnd(); ++it) + result.insert(it.key().toQString(), it.value().toQString()); + return result; + } + + Store toMap() + { + Store result; + result.insert("CacheDataVersion", version); + result.insert("Installed", installed); + result.insert("HasExamples", hasExamples); + result.insert("HasDemos", hasDemos); + result.insert("HasDocumentation", hasDocumentation); + result.insert("HasQtAbis", hasQtAbis); + result.insert("VersionInfoUpToDate", versionInfoUpToDate); + + unexpandedDisplayName.toMap(result, "UnexpandedDisplayName"); + + result.insert("QtVersionString", qtVersionString); + result.insert("SourcePath", sourcePath.toSettings()); + result.insert("QtSources", qtSources.toSettings()); + result.insert("Prefix", prefix.toSettings()); + result.insert("BinPath", binPath.toSettings()); + result.insert("LibExecPath", libExecPath.toSettings()); + result.insert("ConfigurationPath", configurationPath.toSettings()); + result.insert("DataPath", dataPath.toSettings()); + result.insert("DemosPath", demosPath.toSettings()); + result.insert("DocsPath", docsPath.toSettings()); + result.insert("ExamplesPath", examplesPath.toSettings()); + result.insert("HeaderPath", headerPath.toSettings()); + result.insert("ImportsPath", importsPath.toSettings()); + result.insert("LibraryPath", libraryPath.toSettings()); + result.insert("PluginPath", pluginPath.toSettings()); + result.insert("QmlPath", qmlPath.toSettings()); + result.insert("TranslationsPath", translationsPath.toSettings()); + result.insert("HostBinPath", hostBinPath.toSettings()); + result.insert("HostLibexecPath", hostLibexecPath.toSettings()); + result.insert("HostDataPath", hostDataPath.toSettings()); + result.insert("HostPrefixPath", hostPrefixPath.toSettings()); + result.insert("QtAbis", Utils::transform(qtAbis, &Abi::toString)); + result.insert("VersionInfo", toVariantMap(versionInfo)); + + return result; + } + + void fromMap(Store map) + { + if (map.value("CacheDataVersion").toInt() < version) + return; + + installed = map.value("Installed").toBool(); + hasExamples = map.value("HasExamples").toBool(); + hasDemos = map.value("HasDemos").toBool(); + hasDocumentation = map.value("HasDocumentation").toBool(); + hasQtAbis = map.value("HasQtAbis").toBool(); + versionInfoUpToDate = map.value("VersionInfoUpToDate", false).toBool(); + unexpandedDisplayName.fromMap(map, "UnexpandedDisplayName"); + qtVersionString = map.value("QtVersionString").toString(); + sourcePath = FilePath::fromSettings(map.value("SourcePath")); + qtSources = FilePath::fromSettings(map.value("QtSources")); + prefix = FilePath::fromSettings(map.value("Prefix")); + binPath = FilePath::fromSettings(map.value("BinPath")); + libExecPath = FilePath::fromSettings(map.value("LibExecPath")); + configurationPath = FilePath::fromSettings(map.value("ConfigurationPath")); + dataPath = FilePath::fromSettings(map.value("DataPath")); + demosPath = FilePath::fromSettings(map.value("DemosPath")); + docsPath = FilePath::fromSettings(map.value("DocsPath")); + examplesPath = FilePath::fromSettings(map.value("ExamplesPath")); + headerPath = FilePath::fromSettings(map.value("HeaderPath")); + importsPath = FilePath::fromSettings(map.value("ImportsPath")); + libraryPath = FilePath::fromSettings(map.value("LibraryPath")); + pluginPath = FilePath::fromSettings(map.value("PluginPath")); + qmlPath = FilePath::fromSettings(map.value("QmlPath")); + translationsPath = FilePath::fromSettings(map.value("TranslationsPath")); + hostBinPath = FilePath::fromSettings(map.value("HostBinPath")); + hostLibexecPath = FilePath::fromSettings(map.value("HostLibexecPath")); + hostDataPath = FilePath::fromSettings(map.value("HostDataPath")); + hostPrefixPath = FilePath::fromSettings(map.value("HostPrefixPath")); + qtAbis = Utils::transform(map.value("QtAbis").toStringList(), &Abi::fromString); + versionInfo = fromVariantMap(map.value("VersionInfo").toMap()); + } }; // -------------------------------------------------------------------- @@ -211,7 +311,6 @@ public: bool m_defaultConfigIsDebug = true; bool m_defaultConfigIsDebugAndRelease = true; bool m_frameworkBuild = false; - bool m_versionInfoUpToDate = false; bool m_qmakeIsExecutable = true; QString m_detectionSource; @@ -222,8 +321,6 @@ public: QHash<QString, QString> m_mkspecValues; - QHash<ProKey, ProString> m_versionInfo; - FilePath m_qmakeCommand; FilePath m_rccPath; @@ -585,8 +682,8 @@ FilePath QtVersion::mkspecsPath() const { const FilePath result = hostDataPath(); if (result.isEmpty()) - return FilePath::fromUserInput(QtVersionPrivate::qmakeProperty( - d->m_versionInfo, "QMAKE_MKSPECS")); + return FilePath::fromUserInput( + QtVersionPrivate::qmakeProperty(d->m_data.versionInfo, "QMAKE_MKSPECS")); return result.pathAppended("mkspecs"); } @@ -640,7 +737,7 @@ bool QtVersion::hasReleaseBuild() const return !d->m_defaultConfigIsDebug || d->m_defaultConfigIsDebugAndRelease; } -void QtVersion::fromMap(const Store &map, const FilePath &filePath) +void QtVersion::fromMap(const Store &map, const FilePath &filePath, bool forceRefreshCache) { d->m_id = map.value(Constants::QTVERSIONID).toInt(); if (d->m_id == -1) // this happens on adding from installer, see updateFromInstaller => get a new unique id @@ -667,15 +764,21 @@ void QtVersion::fromMap(const Store &map, const FilePath &filePath) } d->m_qmakeCommand = filePath.resolvePath(d->m_qmakeCommand); - d->m_data.qtSources = FilePath::fromSettings(map.value(QTVERSIONSOURCEPATH)); + const expected_str<Utils::Store> persistentStore = PersistentCacheStore::byKey( + "QtVersionData" + d->m_qmakeCommand.toString().toUtf8()); - // Handle ABIs provided by the SDKTool: - // Note: Creator does not write these settings itself, so it has to come from the SDKTool! - d->m_data.qtAbis = Utils::transform<Abis>(map.value(QTVERSION_ABIS).toStringList(), - &Abi::fromString); - d->m_data.qtAbis = Utils::filtered(d->m_data.qtAbis, &Abi::isValid); - d->m_data.hasQtAbis = !d->m_data.qtAbis.isEmpty(); + if (persistentStore && !forceRefreshCache) { + d->m_data.fromMap(*persistentStore); + } else { + d->m_data.qtSources = FilePath::fromSettings(map.value(QTVERSIONSOURCEPATH)); + // Handle ABIs provided by the SDKTool: + // Note: Creator does not write these settings itself, so it has to come from the SDKTool! + d->m_data.qtAbis = Utils::transform<Abis>(map.value(QTVERSION_ABIS).toStringList(), + &Abi::fromString); + d->m_data.qtAbis = Utils::filtered(d->m_data.qtAbis, &Abi::isValid); + d->m_data.hasQtAbis = !d->m_data.qtAbis.isEmpty(); + } updateDefaultDisplayName(); // Clear the cached qmlscene command, it might not match the restored path anymore. @@ -694,6 +797,11 @@ Store QtVersion::toMap() const result.insert(QTVERSION_OVERRIDE_FEATURES, Utils::Id::toStringList(d->m_overrideFeatures)); result.insert(QTVERSIONQMAKEPATH, qmakeFilePath().toSettings()); + + if (d->m_data.versionInfoUpToDate) + PersistentCacheStore::write("QtVersionData" + d->m_qmakeCommand.toString().toUtf8(), + d->m_data.toMap()); + return result; } @@ -738,8 +846,8 @@ QStringList QtVersion::warningReason() const QStringList ret; if (qtAbis().isEmpty()) ret << Tr::tr("ABI detection failed: Make sure to use a matching compiler when building."); - if (d->m_versionInfo.value(ProKey("QT_INSTALL_PREFIX/get")) - != d->m_versionInfo.value(ProKey("QT_INSTALL_PREFIX"))) { + if (d->m_data.versionInfo.value(ProKey("QT_INSTALL_PREFIX/get")) + != d->m_data.versionInfo.value(ProKey("QT_INSTALL_PREFIX"))) { ret << Tr::tr("Non-installed -prefix build - for internal development only."); } return ret; @@ -919,7 +1027,7 @@ FilePath QtVersion::sourcePath() const { if (d->m_data.sourcePath.isEmpty()) { d->updateVersionInfo(); - d->m_data.sourcePath = QtVersionPrivate::sourcePath(d->m_versionInfo); + d->m_data.sourcePath = QtVersionPrivate::sourcePath(d->m_data.versionInfo); } return d->m_data.sourcePath; } @@ -1232,19 +1340,19 @@ QVersionNumber QtVersion::qtVersion() const void QtVersionPrivate::updateVersionInfo() { - if (m_versionInfoUpToDate || !m_qmakeIsExecutable || m_isUpdating) + if (m_data.versionInfoUpToDate || !m_qmakeIsExecutable || m_isUpdating) return; m_isUpdating = true; // extract data from qmake executable - m_versionInfo.clear(); + m_data.versionInfo.clear(); m_data.installed = true; m_data.hasExamples = false; m_data.hasDocumentation = false; QString error; - if (!queryQMakeVariables(m_qmakeCommand, q->qmakeRunEnvironment(), &m_versionInfo, &error)) { + if (!queryQMakeVariables(m_qmakeCommand, q->qmakeRunEnvironment(), &m_data.versionInfo, &error)) { m_qmakeIsExecutable = false; qWarning("Cannot update Qt version information from %s: %s.", qPrintable(m_qmakeCommand.displayName()), qPrintable(error)); @@ -1297,13 +1405,16 @@ void QtVersionPrivate::updateVersionInfo() m_data.qtVersionString = qmakeProperty("QT_VERSION"); m_isUpdating = false; - m_versionInfoUpToDate = true; + m_data.versionInfoUpToDate = true; + + PersistentCacheStore::write("QtVersionData" + m_qmakeCommand.toString().toUtf8(), + m_data.toMap()); } QHash<ProKey,ProString> QtVersionPrivate::versionInfo() { updateVersionInfo(); - return m_versionInfo; + return m_data.versionInfo; } QString QtVersionPrivate::qmakeProperty(const QHash<ProKey, ProString> &versionInfo, @@ -1765,7 +1876,7 @@ QString QtVersionPrivate::qmakeProperty(const QByteArray &name, QtVersionPrivate::PropertyVariant variant) { updateVersionInfo(); - return qmakeProperty(m_versionInfo, name, variant); + return qmakeProperty(m_data.versionInfo, name, variant); } FilePath QtVersionPrivate::mkspecDirectoryFromVersionInfo(const QHash<ProKey, ProString> &versionInfo, @@ -2340,13 +2451,13 @@ QtVersion *QtVersionFactory::create() const return version; } -QtVersion *QtVersion::clone() const +QtVersion *QtVersion::clone(bool forceRefreshCache) const { for (QtVersionFactory *factory : std::as_const(g_qtVersionFactories)) { if (factory->m_supportedType == d->m_type) { QtVersion *version = factory->create(); QTC_ASSERT(version, return nullptr); - version->fromMap(toMap()); + version->fromMap(toMap(), {}, forceRefreshCache); return version; } } diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index f46d6c3e4b5..f75ef202b18 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -49,7 +49,9 @@ public: virtual ~QtVersion(); - virtual void fromMap(const Utils::Store &map, const Utils::FilePath &filePath = {}); + virtual void fromMap(const Utils::Store &map, + const Utils::FilePath &filePath = {}, + bool forceRefreshCache = false); virtual bool equals(QtVersion *other); bool isAutodetected() const; @@ -221,7 +223,7 @@ private: friend class Internal::QtOptionsPageWidget; void setId(int id); - QtVersion *clone() const; + QtVersion *clone(bool forceRefreshCache = false) const; Internal::QtVersionPrivate *d = nullptr; }; diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 8d3a27464e7..1efedb700ec 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -599,7 +599,7 @@ void QtOptionsPageWidget::updateQtVersions(const QList<int> &additions, const QL // Add changed/added items: for (int a : std::as_const(toAdd)) { - QtVersion *version = QtVersionManager::version(a)->clone(); + QtVersion *version = QtVersionManager::version(a)->clone(true); auto *item = new QtVersionItem(version); // Insert in the right place: From fedf99b03721290e4137d05f84608c1a1f572c47 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 4 Jul 2023 13:42:30 +0200 Subject: [PATCH 1007/1777] Introduce the Screen Recorder Plugin The screen recorder plugin allows a user to record the contents of a screen (or part thereof), and in a second step to export the result as various lossless or lossy animated picture or video formats. Before exporting, the recorded video can be trimmend in length and be cropped in size. All functionality relies on the ffmpeg/ffprobe tools, which need to be present on the user's system. This initial version of the plugin introduces a settings page, and a recording/exporting dialog with sub dialogs for recording and export options. Some autottests for ffmpeg/ffprobe output parsing are included. Task-number: QTCREATORBUG-29366 Change-Id: Iaf16d369fd9088d69b1bd130185ca920d07b34c6 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/CMakeLists.txt | 1 + src/plugins/plugins.qbs | 1 + src/plugins/screenrecorder/CMakeLists.txt | 19 + .../screenrecorder/ScreenRecorder.json.in | 19 + src/plugins/screenrecorder/cropandtrim.cpp | 746 ++++++++++++++++++ src/plugins/screenrecorder/cropandtrim.h | 94 +++ src/plugins/screenrecorder/export.cpp | 291 +++++++ src/plugins/screenrecorder/export.h | 69 ++ src/plugins/screenrecorder/ffmpegutils.cpp | 471 +++++++++++ src/plugins/screenrecorder/ffmpegutils.h | 94 +++ src/plugins/screenrecorder/record.cpp | 361 +++++++++ src/plugins/screenrecorder/record.h | 43 + src/plugins/screenrecorder/screenrecorder.qbs | 33 + src/plugins/screenrecorder/screenrecorder.qrc | 4 + .../screenrecorder/screenrecorder_test.cpp | 16 + .../screenrecorder/screenrecorder_test.h | 29 + .../screenrecorder/screenrecorderconstants.h | 15 + .../screenrecorder/screenrecorderplugin.cpp | 124 +++ .../screenrecorder/screenrecordersettings.cpp | 215 +++++ .../screenrecorder/screenrecordersettings.h | 50 ++ src/plugins/screenrecorder/screenrecordertr.h | 15 + 21 files changed, 2710 insertions(+) create mode 100644 src/plugins/screenrecorder/CMakeLists.txt create mode 100644 src/plugins/screenrecorder/ScreenRecorder.json.in create mode 100644 src/plugins/screenrecorder/cropandtrim.cpp create mode 100644 src/plugins/screenrecorder/cropandtrim.h create mode 100644 src/plugins/screenrecorder/export.cpp create mode 100644 src/plugins/screenrecorder/export.h create mode 100644 src/plugins/screenrecorder/ffmpegutils.cpp create mode 100644 src/plugins/screenrecorder/ffmpegutils.h create mode 100644 src/plugins/screenrecorder/record.cpp create mode 100644 src/plugins/screenrecorder/record.h create mode 100644 src/plugins/screenrecorder/screenrecorder.qbs create mode 100644 src/plugins/screenrecorder/screenrecorder.qrc create mode 100644 src/plugins/screenrecorder/screenrecorder_test.cpp create mode 100644 src/plugins/screenrecorder/screenrecorder_test.h create mode 100644 src/plugins/screenrecorder/screenrecorderconstants.h create mode 100644 src/plugins/screenrecorder/screenrecorderplugin.cpp create mode 100644 src/plugins/screenrecorder/screenrecordersettings.cpp create mode 100644 src/plugins/screenrecorder/screenrecordersettings.h create mode 100644 src/plugins/screenrecorder/screenrecordertr.h diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 0be2b224cb6..8fd10b68374 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -7,6 +7,7 @@ add_subdirectory(serialterminal) add_subdirectory(helloworld) add_subdirectory(imageviewer) add_subdirectory(marketplace) +add_subdirectory(screenrecorder) add_subdirectory(updateinfo) add_subdirectory(welcome) diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs index 6a1535db02a..0ea388ec705 100644 --- a/src/plugins/plugins.qbs +++ b/src/plugins/plugins.qbs @@ -76,6 +76,7 @@ Project { "remotelinux/remotelinux.qbs", "resourceeditor/resourceeditor.qbs", "saferenderer/saferenderer.qbs", + "screenrecorder/screenrecorder.qbs", "scxmleditor/scxmleditor.qbs", "serialterminal/serialterminal.qbs", "silversearcher/silversearcher.qbs", diff --git a/src/plugins/screenrecorder/CMakeLists.txt b/src/plugins/screenrecorder/CMakeLists.txt new file mode 100644 index 00000000000..b10f68aadec --- /dev/null +++ b/src/plugins/screenrecorder/CMakeLists.txt @@ -0,0 +1,19 @@ +add_qtc_plugin(ScreenRecorder + PLUGIN_DEPENDS Core + SOURCES + cropandtrim.cpp cropandtrim.h + export.cpp export.h + ffmpegutils.cpp ffmpegutils.h + record.cpp record.h + screenrecorder.qrc + screenrecorderconstants.h + screenrecorderplugin.cpp + screenrecordersettings.cpp screenrecordersettings.h +) + +extend_qtc_plugin(ScreenRecorder + CONDITION WITH_TESTS + SOURCES + screenrecorder_test.cpp screenrecorder_test.h + EXPLICIT_MOC screenrecorder_test.h +) diff --git a/src/plugins/screenrecorder/ScreenRecorder.json.in b/src/plugins/screenrecorder/ScreenRecorder.json.in new file mode 100644 index 00000000000..2805bf7604b --- /dev/null +++ b/src/plugins/screenrecorder/ScreenRecorder.json.in @@ -0,0 +1,19 @@ +{ + "Name" : "ScreenRecorder", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", + "", + "GNU General Public License Usage", + "", + "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." + ], + "Experimental" : true, + "Description" : "Screen recording.", + "Url" : "http://www.qt.io", + ${IDE_PLUGIN_DEPENDENCIES} +} diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp new file mode 100644 index 00000000000..992221b106e --- /dev/null +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -0,0 +1,746 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "cropandtrim.h" + +#include "ffmpegutils.h" +#include "screenrecordersettings.h" +#include "screenrecordertr.h" + +#include <utils/layoutbuilder.h> +#include <utils/process.h> +#include <utils/qtcsettings.h> +#include <utils/styledbar.h> +#include <utils/stylehelper.h> +#include <utils/utilsicons.h> + +#include <coreplugin/icore.h> + +#include <QDialog> +#include <QDialogButtonBox> +#include <QLabel> +#include <QMouseEvent> +#include <QPainter> +#include <QPushButton> +#include <QScrollArea> +#include <QSlider> +#include <QSpinBox> +#include <QStyleOptionSlider> +#include <QToolButton> + +using namespace Utils; + +namespace ScreenRecorder { + +CropScene::CropScene(QWidget *parent) + : QWidget(parent) +{ + setMouseTracking(true); + setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); +} + +void CropScene::paintEvent(QPaintEvent *event) +{ + Q_UNUSED(event) + QPainter p(this); + p.drawImage(QPointF(), m_buffer); +} + +void CropScene::initMouseInteraction(const QPoint &imagePos) +{ + static const auto inGripRange = [](int grip, int pos, int &clickOffset) -> bool { + const bool inRange = pos - m_gripWidth <= grip && pos + m_gripWidth >= grip; + if (inRange) + clickOffset = grip - pos; + return inRange; + }; + + if (inGripRange(imagePos.x(), m_cropRect.left(), m_mouse.clickOffset)) { + m_mouse.margin = EdgeLeft; + m_mouse.cursorShape = Qt::SizeHorCursor; + } else if (inGripRange(imagePos.x(), m_cropRect.right(), + m_mouse.clickOffset)) { + m_mouse.margin = EdgeRight; + m_mouse.cursorShape = Qt::SizeHorCursor; + } else if (inGripRange(imagePos.y(), m_cropRect.top(), m_mouse.clickOffset)) { + m_mouse.margin = EdgeTop; + m_mouse.cursorShape = Qt::SizeVerCursor; + } else if (inGripRange(imagePos.y(), m_cropRect.bottom(), + m_mouse.clickOffset)) { + m_mouse.margin = EdgeBottom; + m_mouse.cursorShape = Qt::SizeVerCursor; + } else { + m_mouse.margin = Free; + m_mouse.cursorShape = Qt::ArrowCursor; + m_mouse.clickOffset = 0; + } +} + +void CropScene::updateBuffer() +{ + if (m_buffer.isNull()) + return; + + m_buffer.fill(palette().window().color()); + const qreal dpr = m_image->devicePixelRatioF(); + QPainter p(&m_buffer); + p.drawImage(lineWidth, lineWidth, *m_image); + + const qreal lineOffset = lineWidth / 2.0; + const QRectF r = { + m_cropRect.x() / dpr + lineOffset, + m_cropRect.y() / dpr + lineOffset, + m_cropRect.width() / dpr + lineWidth, + m_cropRect.height() / dpr + lineWidth + }; + + p.save(); + p.setClipRegion(QRegion(m_buffer.rect()).subtracted(QRegion(r.toRect()))); + p.setOpacity(0.85); + p.fillRect(m_buffer.rect(), qRgb(0x30, 0x30, 0x30)); + p.restore(); + + const auto paintLine = [&p](const QLineF &line) + { + const QPen blackPen(Qt::black, lineWidth); + p.setPen(blackPen); + p.drawLine(line); + const QPen whiteDotPen(Qt::white, lineWidth, Qt::DotLine); + p.setPen(whiteDotPen); + p.drawLine(line); + }; + paintLine(QLineF(r.left(), 0, r.left(), m_buffer.height())); + paintLine(QLineF(0, r.top(), m_buffer.width(), r.top())); + paintLine(QLineF(r.right(), 0, r.right(), m_buffer.height())); + paintLine(QLineF(0, r.bottom(), m_buffer.width(), r.bottom())); + + update(); +} + +QPoint CropScene::toImagePos(const QPoint &widgetPos) +{ + const int dpr = int(m_image->devicePixelRatio()); + return {(widgetPos.x() - lineWidth) * dpr, (widgetPos.y() - lineWidth) * dpr}; +} + +QRect CropScene::cropRect() const +{ + return m_cropRect; +} + +void CropScene::setCropRect(const QRect &rect) +{ + m_cropRect = rect; + updateBuffer(); + emit cropRectChanged(m_cropRect); +} + +bool CropScene::fullySelected() const +{ + return m_image && m_image->rect() == m_cropRect; +} + +void CropScene::setFullySelected() +{ + if (!m_image) + return; + setCropRect(m_image->rect()); +} + +QRect CropScene::fullRect() const +{ + return m_image ? m_image->rect() : QRect(); +} + +void CropScene::setImage(const QImage &image) +{ + m_image = ℑ + const QSize sceneSize = m_image->deviceIndependentSize().toSize() + .grownBy({lineWidth, lineWidth, lineWidth, lineWidth}); + const QSize sceneSizeDpr = sceneSize * m_image->devicePixelRatio(); + m_buffer = QImage(sceneSizeDpr, QImage::Format_RGB32); + m_buffer.setDevicePixelRatio(m_image->devicePixelRatio()); + updateBuffer(); + resize(sceneSize); +} + +void CropScene::mouseMoveEvent(QMouseEvent *event) +{ + const QPoint imagePos = toImagePos(event->pos()); + + if (m_mouse.dragging) { + switch (m_mouse.margin) { + case EdgeLeft: + m_cropRect.setLeft(qBound(0, imagePos.x() - m_mouse.clickOffset, + m_cropRect.right())); + break; + case EdgeTop: + m_cropRect.setTop(qBound(0, imagePos.y() - m_mouse.clickOffset, + m_cropRect.bottom())); + break; + case EdgeRight: + m_cropRect.setRight(qBound(m_cropRect.left(), imagePos.x() - m_mouse.clickOffset, + m_image->width() - 1)); + break; + case EdgeBottom: + m_cropRect.setBottom(qBound(m_cropRect.top(), imagePos.y() - m_mouse.clickOffset, + m_image->height() - 1)); + break; + case Free: { + m_cropRect = QRect(m_mouse.startImagePos, imagePos).normalized() + .intersected(m_image->rect()); + break; + } + } + emit cropRectChanged(m_cropRect); + updateBuffer(); + } else { + initMouseInteraction(imagePos); + setCursor(m_mouse.cursorShape); + } + + QWidget::mouseMoveEvent(event); +} + +void CropScene::mousePressEvent(QMouseEvent *event) +{ + const QPoint imagePos = toImagePos(event->pos()); + + m_mouse.dragging = true; + m_mouse.startImagePos = imagePos; + + QWidget::mousePressEvent(event); +} + +void CropScene::mouseReleaseEvent(QMouseEvent *event) +{ + m_mouse.dragging = false; + setCursor(Qt::ArrowCursor); + + QWidget::mouseReleaseEvent(event); +} + +class CropWidget : public QWidget +{ +public: + explicit CropWidget(QWidget *parent = nullptr); + + QRect cropRect() const; + void setCropRect(const QRect &rect); + + void setImage(const QImage &image); + +private: + void updateWidgets(); + void onSpinBoxChanged(); + void onCropRectChanged(); + + CropScene *m_cropScene; + + QSpinBox *m_xSpinBox; + QSpinBox *m_ySpinBox; + QSpinBox *m_widthSpinBox; + QSpinBox *m_heightSpinBox; + + CropSizeWarningIcon *m_warningIcon; + QToolButton *m_resetButton; +}; + +CropWidget::CropWidget(QWidget *parent) + : QWidget(parent) +{ + m_cropScene = new CropScene; + + auto scrollArea = new QScrollArea; + scrollArea->setWidget(m_cropScene); + + for (auto s : {&m_xSpinBox, &m_ySpinBox, &m_widthSpinBox, &m_heightSpinBox}) { + *s = new QSpinBox; + (*s)->setMaximum(99999); // Will be adjusted in CropWidget::setImage + (*s)->setSuffix(" px"); + } + m_widthSpinBox->setMinimum(1); + m_heightSpinBox->setMinimum(1); + + m_resetButton = new QToolButton; + m_resetButton->setIcon(Icons::RESET.icon()); + + m_warningIcon = new CropSizeWarningIcon(CropSizeWarningIcon::StandardVariant); + + using namespace Layouting; + Column { + scrollArea, + Row { + Tr::tr("X:"), m_xSpinBox, + Space(4), Tr::tr("Y:"), m_ySpinBox, + Space(16), Tr::tr("Width:"), m_widthSpinBox, + Space(4), Tr::tr("Height:"), m_heightSpinBox, + m_resetButton, + m_warningIcon, + st, + }, + noMargin(), + }.attachTo(this); + + connect(m_xSpinBox, &QSpinBox::valueChanged, this, &CropWidget::onSpinBoxChanged); + connect(m_ySpinBox, &QSpinBox::valueChanged, this, &CropWidget::onSpinBoxChanged); + connect(m_widthSpinBox, &QSpinBox::valueChanged, this, &CropWidget::onSpinBoxChanged); + connect(m_heightSpinBox, &QSpinBox::valueChanged, this, &CropWidget::onSpinBoxChanged); + connect(m_cropScene, &CropScene::cropRectChanged, this, &CropWidget::onCropRectChanged); + connect(m_resetButton, &QToolButton::pressed, this, [this] { + m_cropScene->setFullySelected(); + }); + + updateWidgets(); +} + +QRect CropWidget::cropRect() const +{ + return m_cropScene->cropRect(); +} + +void CropWidget::setCropRect(const QRect &rect) +{ + m_cropScene->setCropRect(rect); +} + +void CropWidget::setImage(const QImage &image) +{ + const QRect rBefore = m_cropScene->fullRect(); + m_cropScene->setImage(image); + const QRect rAfter = m_cropScene->fullRect(); + if (rBefore != rAfter) { + m_xSpinBox->setMaximum(rAfter.width() - 1); + m_ySpinBox->setMaximum(rAfter.height() - 1); + m_widthSpinBox->setMaximum(rAfter.width()); + m_heightSpinBox->setMaximum(rAfter.height()); + } + updateWidgets(); +} + +void CropWidget::updateWidgets() +{ + m_resetButton->setEnabled(!m_cropScene->fullySelected()); + const QRect r = m_cropScene->cropRect(); + m_warningIcon->setCropSize(r.size()); +} + +void CropWidget::onSpinBoxChanged() +{ + const QRect spinBoxRect = { + m_xSpinBox->value(), + m_ySpinBox->value(), + m_widthSpinBox->value(), + m_heightSpinBox->value() + }; + m_cropScene->setCropRect(spinBoxRect.intersected(m_cropScene->fullRect())); +} + +void CropWidget::onCropRectChanged() +{ + const QRect rect = m_cropScene->cropRect(); + const struct { QSpinBox *spinBox; int value; } updates[] = { + {m_xSpinBox, rect.x()}, + {m_ySpinBox, rect.y()}, + {m_widthSpinBox, rect.width()}, + {m_heightSpinBox, rect.height()}, + }; + for (const auto &update : updates) { + update.spinBox->blockSignals(true); + update.spinBox->setValue(update.value); + update.spinBox->blockSignals(false); + } + updateWidgets(); +} + +class SelectionSlider : public QSlider +{ +public: + explicit SelectionSlider(QWidget *parent = nullptr); + + void setSelectionRange(FrameRange range); + +protected: + void paintEvent(QPaintEvent *) override; + +private: + FrameRange m_range; +}; + +SelectionSlider::SelectionSlider(QWidget *parent) + : QSlider(Qt::Horizontal, parent) + , m_range({-1, -1}) +{ + setPageStep(50); +} + +void SelectionSlider::setSelectionRange(FrameRange range) +{ + m_range = range; + update(); +} + +void SelectionSlider::paintEvent(QPaintEvent *) +{ + QStyleOptionSlider opt; + initStyleOption(&opt); + opt.subControls = QStyle::SC_SliderHandle; // Draw only the handle. We draw the rest, here. + + const int tickOffset = style()->pixelMetric(QStyle::PM_SliderTickmarkOffset, &opt, this); + QRect grooveRect = style()->subControlRect(QStyle::CC_Slider, &opt, + QStyle::SC_SliderGroove, this) + .adjusted(tickOffset, 0, -tickOffset, 0); + grooveRect.setTop(rect().top()); + grooveRect.setBottom(rect().bottom()); + const QColor bgColor = palette().window().color(); + const QColor fgColor = palette().text().color(); + const QColor grooveColor = StyleHelper::mergedColors(bgColor, fgColor, 80); + const QColor selectionColor = StyleHelper::mergedColors(bgColor, fgColor, 45); + QPainter p(this); + p.fillRect(grooveRect, grooveColor); + const qreal pixelsPerFrame = grooveRect.width() / qreal(maximum()); + const int startPixels = int(m_range.first * pixelsPerFrame); + const int endPixels = int((maximum() - m_range.second) * pixelsPerFrame); + p.fillRect(grooveRect.adjusted(startPixels, 0, -endPixels, 0), selectionColor); + style()->drawComplexControl(QStyle::CC_Slider, &opt, &p, this); +} + +class TrimWidget : public QWidget +{ + Q_OBJECT + +public: + explicit TrimWidget(const ClipInfo &clip, QWidget *parent = nullptr); + + void setCurrentFrame(int frame); + int currentFrame() const; + void setTrimRange(FrameRange range); + FrameRange trimRange() const; + +signals: + void positionChanged(); + void trimRangeChanged(FrameRange range); + +private: + void resetTrimRange(); + void updateTrimWidgets(); + void emitTrimRangeChange(); + + ClipInfo m_clipInfo; + SelectionSlider *m_frameSlider; + TimeLabel *m_currentTime; + TimeLabel *m_clipDuration; + + struct { + QPushButton *button; + TimeLabel *timeLabel; + } m_trimStart, m_trimEnd; + TimeLabel *m_trimRange; + QToolButton *m_trimResetButton; +}; + +TrimWidget::TrimWidget(const ClipInfo &clip, QWidget *parent) + : QWidget(parent) + , m_clipInfo(clip) +{ + m_frameSlider = new SelectionSlider; + + m_currentTime = new TimeLabel(m_clipInfo); + + m_clipDuration = new TimeLabel(m_clipInfo); + + m_trimStart.button = new QPushButton(Tr::tr("Start:")); + m_trimStart.timeLabel = new TimeLabel(m_clipInfo); + + m_trimEnd.button = new QPushButton(Tr::tr("End:")); + m_trimEnd.timeLabel = new TimeLabel(m_clipInfo); + + m_trimRange = new TimeLabel(m_clipInfo); + + m_trimResetButton = new QToolButton; + m_trimResetButton->setIcon(Icons::RESET.icon()); + + using namespace Layouting; + Column { + Row { m_frameSlider, m_currentTime, "/", m_clipDuration }, + Group { + title(Tr::tr("Trimming")), + Row { + m_trimStart.button, m_trimStart.timeLabel, + Space(20), + m_trimEnd.button, m_trimEnd.timeLabel, + Stretch(), Space(20), + Tr::tr("Range:"), m_trimRange, + m_trimResetButton, + }, + }, + noMargin(), + }.attachTo(this); + + connect(m_frameSlider, &QSlider::valueChanged, this, [this]() { + m_currentTime->setFrame(currentFrame()); + updateTrimWidgets(); + emit positionChanged(); + }); + connect(m_trimStart.button, &QPushButton::clicked, this, [this] (){ + m_trimStart.timeLabel->setFrame(currentFrame()); + updateTrimWidgets(); + emitTrimRangeChange(); + }); + connect(m_trimEnd.button, &QPushButton::clicked, this, [this] (){ + m_trimEnd.timeLabel->setFrame(currentFrame()); + updateTrimWidgets(); + emitTrimRangeChange(); + }); + connect(m_trimResetButton, &QToolButton::clicked, this, &TrimWidget::resetTrimRange); + + m_frameSlider->setMaximum(m_clipInfo.framesCount()); + m_currentTime->setFrame(currentFrame()); + m_clipDuration->setFrame(m_clipInfo.framesCount()); + resetTrimRange(); +} + +void TrimWidget::setCurrentFrame(int frame) +{ + m_frameSlider->setValue(frame); +} + +int TrimWidget::currentFrame() const +{ + return m_frameSlider->value(); +} + +void TrimWidget::setTrimRange(FrameRange range) +{ + m_trimStart.timeLabel->setFrame(range.first); + m_trimEnd.timeLabel->setFrame(range.second); + m_frameSlider->setSelectionRange(trimRange()); +} + +FrameRange TrimWidget::trimRange() const +{ + return { m_trimStart.timeLabel->frame(), m_trimEnd.timeLabel->frame() }; +} + +void TrimWidget::resetTrimRange() +{ + setTrimRange({0, m_clipInfo.framesCount()}); + emitTrimRangeChange(); + updateTrimWidgets(); +} + +void TrimWidget::updateTrimWidgets() +{ + const int current = currentFrame(); + const int trimStart = m_trimStart.timeLabel->frame(); + const int trimEnd = m_trimEnd.timeLabel->frame(); + m_trimStart.button->setEnabled(current < m_clipInfo.framesCount() && current < trimEnd); + m_trimEnd.button->setEnabled(current > 0 && current > trimStart); + m_trimRange->setFrame(trimEnd - trimStart); + m_frameSlider->setSelectionRange(trimRange()); + m_trimResetButton->setEnabled(!m_clipInfo.isCompleteRange(trimRange())); +} + +void TrimWidget::emitTrimRangeChange() +{ + emit trimRangeChanged(trimRange()); +} + +class CropAndTrimDialog : public QDialog +{ +public: + explicit CropAndTrimDialog(const ClipInfo &clip, QWidget *parent = nullptr); + + void setCropRect(const QRect &rect); + QRect cropRect() const; + void setTrimRange(FrameRange range); + FrameRange trimRange() const; + + int currentFrame() const; + void setCurrentFrame(int frame); + +private: + void onSeekPositionChanged(); + void startFrameFetch(); + + ClipInfo m_clipInfo; + CropWidget *m_cropWidget; + TrimWidget *m_trimWidget; + QImage m_previewImage; + + Process *m_process; + int m_nextFetchFrame = -1; +}; + +CropAndTrimDialog::CropAndTrimDialog(const ClipInfo &clip, QWidget *parent) + : QDialog(parent, Qt::Window) + , m_clipInfo(clip) +{ + setWindowTitle(Tr::tr("Crop and Trim")); + + m_cropWidget = new CropWidget; + + m_trimWidget = new TrimWidget(m_clipInfo); + + auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + + using namespace Layouting; + Column { + Group { + title("Cropping"), + Column { m_cropWidget }, + }, + Space(16), + m_trimWidget, + buttonBox, + }.attachTo(this); + + m_process = new Process(this); + connect(m_process, &Process::done, this, [this] { + if (m_process->exitCode() != 0) { + FFmpegUtils::reportError(m_process->commandLine(), + m_process->readAllRawStandardError()); + return; + } + const QByteArray &imageData = m_process->rawStdOut(); + startFrameFetch(); + if (imageData.isEmpty()) + return; + m_previewImage = QImage(reinterpret_cast<const uchar*>(imageData.constData()), + m_clipInfo.dimensions.width(), m_clipInfo.dimensions.height(), + QImage::Format_RGB32); + m_previewImage.detach(); + m_cropWidget->setImage(m_previewImage); + }); + connect(m_trimWidget, &TrimWidget::positionChanged, + this, &CropAndTrimDialog::onSeekPositionChanged); + connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); + + onSeekPositionChanged(); + resize(1000, 800); +} + +void CropAndTrimDialog::onSeekPositionChanged() +{ + // -1, because frame numbers are 0-based + m_nextFetchFrame = qMin(m_trimWidget->currentFrame(), m_clipInfo.framesCount() - 1); + if (!m_process->isRunning()) + startFrameFetch(); +} + +void CropAndTrimDialog::startFrameFetch() +{ + if (m_nextFetchFrame == -1) + return; + + const CommandLine cl = { + Internal::settings().ffmpegTool(), + { + "-v", "error", + "-ss", m_clipInfo.timeStamp(m_nextFetchFrame), + "-i", m_clipInfo.file.toUserOutput(), + "-threads", "1", + "-frames:v", "1", + "-f", "rawvideo", + "-pix_fmt", "bgra", + "-" + } + }; + m_process->close(); + m_nextFetchFrame = -1; + m_process->setCommand(cl); + m_process->setWorkingDirectory(Internal::settings().ffmpegTool().parentDir()); + m_process->start(); +} + +void CropAndTrimDialog::setCropRect(const QRect &rect) +{ + m_cropWidget->setCropRect(rect); +} + +QRect CropAndTrimDialog::cropRect() const +{ + return m_cropWidget->cropRect(); +} + +void CropAndTrimDialog::setTrimRange(FrameRange range) +{ + m_trimWidget->setTrimRange(range); +} + +FrameRange CropAndTrimDialog::trimRange() const +{ + return m_trimWidget->trimRange(); +} + +int CropAndTrimDialog::currentFrame() const +{ + return m_trimWidget->currentFrame(); +} + +void CropAndTrimDialog::setCurrentFrame(int frame) +{ + m_trimWidget->setCurrentFrame(frame); +} + +CropAndTrimWidget::CropAndTrimWidget(QWidget *parent) + : StyledBar(parent) +{ + m_button = new QToolButton; + + m_cropSizeWarningIcon = new CropSizeWarningIcon(CropSizeWarningIcon::ToolBarVariant); + + using namespace Layouting; + Row { + m_button, + m_cropSizeWarningIcon, + noMargin(), spacing(0), + }.attachTo(this); + + connect(m_button, &QPushButton::clicked, this, [this] { + CropAndTrimDialog dlg(m_clipInfo, Core::ICore::dialogParent()); + dlg.setCropRect(m_cropRect); + dlg.setTrimRange(m_trimRange); + dlg.setCurrentFrame(m_currentFrame); + if (dlg.exec() == QDialog::Accepted) { + m_cropRect = dlg.cropRect(); + m_trimRange = dlg.trimRange(); + m_currentFrame = dlg.currentFrame(); + emit cropRectChanged(m_cropRect); + emit trimRangeChanged(m_trimRange); + updateWidgets(); + } + }); + + updateWidgets(); +} + +void CropAndTrimWidget::setClip(const ClipInfo &clip) +{ + m_clipInfo = clip; + m_cropRect = {QPoint(), clip.dimensions}; + m_currentFrame = 0; + m_trimRange = {m_currentFrame, m_clipInfo.framesCount()}; + updateWidgets(); +} + +void CropAndTrimWidget::updateWidgets() +{ + const QString cropText = + !m_clipInfo.isCompleteArea(m_cropRect) + ? Tr::tr("Crop to %1x%2px.").arg(m_cropRect.width()).arg(m_cropRect.height()) + : Tr::tr("Complete area."); + + const QString trimText = + !m_clipInfo.isCompleteRange(m_trimRange) + ? Tr::tr("Frames %1 to %2.").arg(m_trimRange.first).arg(m_trimRange.second) + : Tr::tr("Complete clip."); + + m_button->setText(cropText + " " + trimText + ".."); + m_cropSizeWarningIcon->setCropSize(m_cropRect.size()); +} + +} // namespace ScreenRecorder + +#include "cropandtrim.moc" diff --git a/src/plugins/screenrecorder/cropandtrim.h b/src/plugins/screenrecorder/cropandtrim.h new file mode 100644 index 00000000000..164f0dbbd20 --- /dev/null +++ b/src/plugins/screenrecorder/cropandtrim.h @@ -0,0 +1,94 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "ffmpegutils.h" + +#include <utils/styledbar.h> + +QT_BEGIN_NAMESPACE +class QToolButton; +QT_END_NAMESPACE + +namespace ScreenRecorder { + +class CropScene : public QWidget +{ + Q_OBJECT + +public: + CropScene(QWidget *parent = nullptr); + + QRect cropRect() const; + void setCropRect(const QRect &rect); + bool fullySelected() const; + void setFullySelected(); + QRect fullRect() const; + void setImage(const QImage &image); + + const static int lineWidth = 1; + +signals: + void cropRectChanged(const QRect &cropRect); + +protected: + void mouseMoveEvent(QMouseEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void paintEvent(QPaintEvent *event) override; + +private: + enum MarginEditing { + EdgeLeft, + EdgeTop, + EdgeRight, + EdgeBottom, + Free + }; + + void initMouseInteraction(const QPoint &pos); + void updateBuffer(); + QPoint toImagePos(const QPoint &widgetCoordinate); + + const static int m_gripWidth = 8; + QRect m_cropRect; + const QImage *m_image = nullptr; + QImage m_buffer; + + struct MouseInteraction { + bool dragging = false; + MarginEditing margin; + QPoint startImagePos; + int clickOffset = 0; // Due to m_gripWidth, the mouse pointer is not precicely on the drag + // line. Maintain the offset while dragging, to avoid an initial jump. + Qt::CursorShape cursorShape = Qt::ArrowCursor; + } m_mouse; +}; + +class CropAndTrimWidget : public Utils::StyledBar +{ + Q_OBJECT + +public: + CropAndTrimWidget(QWidget *parent = nullptr); + + void setClip(const ClipInfo &clip); + +signals: + void cropRectChanged(const QRect &rect); + void trimRangeChanged(FrameRange range); + +private: + void updateWidgets(); + + QToolButton *m_button; + + ClipInfo m_clipInfo; + QRect m_cropRect; + int m_currentFrame = 0; + FrameRange m_trimRange; + CropSizeWarningIcon *m_cropSizeWarningIcon; +}; + +} // namespace ScreenRecorder diff --git a/src/plugins/screenrecorder/export.cpp b/src/plugins/screenrecorder/export.cpp new file mode 100644 index 00000000000..aae3d020475 --- /dev/null +++ b/src/plugins/screenrecorder/export.cpp @@ -0,0 +1,291 @@ + // Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "export.h" + +#include "ffmpegutils.h" +#include "screenrecordersettings.h" +#include "screenrecordertr.h" + +#include <utils/algorithm.h> +#include <utils/fileutils.h> +#include <utils/layoutbuilder.h> +#include <utils/process.h> +#include <utils/styledbar.h> +#include <utils/utilsicons.h> + +#include <coreplugin/progressmanager/futureprogress.h> +#include <coreplugin/progressmanager/progressmanager.h> + +#include <QFutureWatcher> +#include <QToolButton> + +using namespace Utils; + +namespace ScreenRecorder { + +const char screenRecordingExportId[] = "ScreenRecorder::screenRecordingExportTask"; + +static const QVector<ExportWidget::Format> &formats() +{ + static const QVector<ExportWidget::Format> result = { + { + ExportWidget::Format::AnimatedImage, + ExportWidget::Format::Lossy, + "GIF", + ".gif", + { + }, + }, + { + ExportWidget::Format::AnimatedImage, + ExportWidget::Format::Lossless, + "WebP", + ".webp", + { + "-lossless", "1", + "-compression_level", "6", + "-qscale", "100", + }, + }, + { + ExportWidget::Format::AnimatedImage, + ExportWidget::Format::Lossy, + "WebP", + ".webp", + { + "-pix_fmt", "yuv420p", + "-compression_level", "6", + }, + }, + { + ExportWidget::Format::Video, + ExportWidget::Format::Lossy, + "MP4/H.264", + ".mp4", + { + "-pix_fmt", "yuv420p", // 4:2:0 chroma subsampling for Firefox compatibility + "-codec", "libx264", + "-preset", "veryslow", + "-level", "5.2", + "-tune", "animation", + "-movflags", "+faststart", + }, + }, + { + ExportWidget::Format::Video, + ExportWidget::Format::Lossy, + "WebM/VP9", + ".webm", + { + "-pix_fmt", "yuv420p", + "-codec", "libvpx-vp9", + "-crf", "36", // Creates slightly smaller files than the "MP4/H.264" preset + "-deadline", "best", + "-row-mt", "1", + }, + }, + { + ExportWidget::Format::AnimatedImage, + ExportWidget::Format::Lossless, + "avif", + ".avif", + { + "-lossless", "1", + }, + }, + { + ExportWidget::Format::Video, + ExportWidget::Format::Lossy, + "WebM/AV1", + ".webm", + { + "-pix_fmt", "yuv422p", + "-codec", "libaom-av1", + }, + }, + { + ExportWidget::Format::Video, + ExportWidget::Format::Lossless, + "Mov/qtrle", + ".mov", + { + "-codec", "qtrle", + }, + }, + }; + return result; +} + +static QString fileDialogFilters() +{ + return transform(formats(), [] (const ExportWidget::Format &fp) { + return fp.fileDialogFilter(); + }).join(";;"); +} + +QString ExportWidget::Format::fileDialogFilter() const +{ + return displayName + + " - " + (kind == Video ? Tr::tr("Video") : Tr::tr("Animated image")) + + " - " + (compression == Lossy ? Tr::tr("Lossy") : Tr::tr("Lossless")) + + " (*" + fileExtension + ")"; +} + +ExportWidget::ExportWidget(QWidget *parent) + : StyledBar(parent) + , m_trimRange({-1, -1}) +{ + m_process = new Process(this); + m_process->setUseCtrlCStub(true); + m_process->setProcessMode(ProcessMode::Writer); + + auto exportButton = new QToolButton; + exportButton->setText(Tr::tr("Export...")); + + using namespace Layouting; + Row { st, new StyledSeparator, exportButton, noMargin(), spacing(0) }.attachTo(this); + + connect(exportButton, &QToolButton::clicked, this, [this] { + FilePathAspect &lastDir = Internal::settings().exportLastDirectory; + QString selectedFilter; + FilePath file = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save as"), lastDir(), + fileDialogFilters(), &selectedFilter); + if (!file.isEmpty()) { + m_currentFormat = findOr(formats(), formats().first(), + [&selectedFilter] (const Format &fp) { + return fp.fileDialogFilter() == selectedFilter; + }); + if (!file.endsWith(m_currentFormat.fileExtension)) + file = file.stringAppended(m_currentFormat.fileExtension); + m_outputClipInfo.file = file; + lastDir.setValue(file.parentDir()); + lastDir.writeToSettingsImmediatly(); + startExport(); + } + }); + connect(m_process, &Process::started, this, [exportButton] { + exportButton->setEnabled(false); + }); + connect(m_process, &Process::done, this, [this, exportButton] { + exportButton->setEnabled(true); + m_futureInterface->reportFinished(); + if (m_process->exitCode() == 0) + emit clipReady(m_outputClipInfo); + else + FFmpegUtils::reportError(m_process->commandLine(), m_lastOutputChunk); + }); + connect(m_process, &Process::readyReadStandardError, this, [this] { + m_lastOutputChunk = m_process->readAllRawStandardError(); + const int frameProgress = FFmpegUtils::parseFrameProgressFromOutput(m_lastOutputChunk); + if (frameProgress >= 0) + m_futureInterface->setProgressValue(frameProgress); + }); +} + +ExportWidget::~ExportWidget() +{ + interruptExport(); +} + +void ExportWidget::startExport() +{ + m_futureInterface.reset(new QFutureInterface<void>); + m_futureInterface->setProgressRange(0, m_trimRange.second - m_trimRange.first); + Core::ProgressManager::addTask(m_futureInterface->future(), + Tr::tr("Exporting Screen Recording"), screenRecordingExportId); + m_futureInterface->setProgressValue(0); + m_futureInterface->reportStarted(); + const auto watcher = new QFutureWatcher<void>(this); + connect(watcher, &QFutureWatcher<void>::canceled, this, &ExportWidget::interruptExport); + connect(watcher, &QFutureWatcher<void>::finished, this, [watcher] { + watcher->disconnect(); + watcher->deleteLater(); + }); + watcher->setFuture(m_futureInterface->future()); + + m_process->close(); + const CommandLine cl(Internal::settings().ffmpegTool(), ffmpegExportParameters()); + m_process->setCommand(cl); + m_process->setWorkingDirectory(Internal::settings().ffmpegTool().parentDir()); + FFmpegUtils::logFfmpegCall(cl); + m_process->start(); +} + +void ExportWidget::interruptExport() +{ + FFmpegUtils::killFfmpegProcess(m_process); +} + +QStringList ExportWidget::ffmpegExportParameters() const +{ + const bool isGif = m_currentFormat.fileExtension == ".gif"; + const QString trimFilter = + !m_inputClipInfo.isCompleteRange(m_trimRange) + ? QString("[v:0]trim=start=%1:end=%2[trimmed]" + ";[trimmed]setpts=PTS-STARTPTS[setpts]") + .arg(m_inputClipInfo.secondForFrame(m_trimRange.first)) + .arg(m_inputClipInfo.secondForFrame(m_trimRange.second)) + : QString("[v:0]null[setpts]"); + + const QString cropFilter = + !m_inputClipInfo.isCompleteArea(m_cropRect) + ? QString(";[setpts]crop=w=%3:h=%4:x=%5:y=%6[cropped]") + .arg(m_cropRect.width()).arg(m_cropRect.height()) + .arg(m_cropRect.left()).arg(m_cropRect.top()) + : QString(";[setpts]null[cropped]"); + + const QString extraFilter = + isGif + ? QString(";[cropped]split[cropped1][cropped2]" + ";[cropped1]palettegen=" + "reserve_transparent=false" + ":max_colors=256[pal]" + ";[cropped2][pal]paletteuse=" + "diff_mode=rectangle[out]") + : QString(";[cropped]null[out]"); + + QStringList loop; + if (m_currentFormat.kind == Format::AnimatedImage) { + const bool doLoop = Internal::settings().animatedImagesAsEndlessLoop(); + // GIF muxer take different values for "don't loop" than WebP and avif muxer + const QLatin1String dontLoopParam(isGif ? "-1" : "1"); + loop.append({"-loop", doLoop ? QLatin1String("0") : dontLoopParam}); + } + + const QStringList args = + QStringList { + "-y", + "-v", "error", + "-stats", + "-stats_period", "0.25", + "-i", m_inputClipInfo.file.toString(), + } + << "-filter_complex" << trimFilter + cropFilter + extraFilter << "-map" << "[out]" + << m_currentFormat.encodingParameters + << loop + << m_outputClipInfo.file.toString(); + + return args; +} + +void ExportWidget::setClip(const ClipInfo &clip) +{ + if (!qFuzzyCompare(clip.duration, m_inputClipInfo.duration)) + m_trimRange = {0, clip.framesCount()}; + if (clip.dimensions != m_inputClipInfo.dimensions) + m_cropRect = {QPoint(), clip.dimensions}; + m_inputClipInfo = clip; +} + +void ExportWidget::setCropRect(const QRect &rect) +{ + m_cropRect = rect; +} + +void ExportWidget::setTrimRange(FrameRange range) +{ + m_trimRange = range; +} + +} // namespace ScreenRecorder diff --git a/src/plugins/screenrecorder/export.h b/src/plugins/screenrecorder/export.h new file mode 100644 index 00000000000..8a6c476ad5f --- /dev/null +++ b/src/plugins/screenrecorder/export.h @@ -0,0 +1,69 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "ffmpegutils.h" + +#include <utils/styledbar.h> + +#include <QFutureInterface> + +namespace Utils { +class Process; +} + +namespace ScreenRecorder { + +class CropSizeWarningIcon; + +class ExportWidget : public Utils::StyledBar +{ + Q_OBJECT + +public: + struct Format { + enum Kind { + AnimatedImage, + Video, + } kind; + + enum Compression { + Lossy, + Lossless, + } compression; + + QString displayName; + QString fileExtension; + QStringList encodingParameters; + + QString fileDialogFilter() const; + }; + + explicit ExportWidget(QWidget *parent = nullptr); + ~ExportWidget(); + + void setClip(const ClipInfo &clip); + void setCropRect(const QRect &rect); + void setTrimRange(FrameRange range); + +signals: + void clipReady(const ClipInfo &clip); + +private: + void startExport(); + void interruptExport(); + QStringList ffmpegExportParameters() const; + + ClipInfo m_inputClipInfo; + ClipInfo m_outputClipInfo; + Format m_currentFormat; + Utils::Process *m_process; + QByteArray m_lastOutputChunk; + std::unique_ptr<QFutureInterface<void>> m_futureInterface; + + QRect m_cropRect; + FrameRange m_trimRange; +}; + +} // namespace ScreenRecorder diff --git a/src/plugins/screenrecorder/ffmpegutils.cpp b/src/plugins/screenrecorder/ffmpegutils.cpp new file mode 100644 index 00000000000..08a018e0a6e --- /dev/null +++ b/src/plugins/screenrecorder/ffmpegutils.cpp @@ -0,0 +1,471 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "ffmpegutils.h" + +#include "screenrecordersettings.h" +#include "screenrecordertr.h" + +#ifdef WITH_TESTS +#include "screenrecorder_test.h" +#include <QTest> +#endif // WITH_TESTS + +#include <utils/layoutbuilder.h> +#include <utils/process.h> +#include <utils/utilsicons.h> + +#include <coreplugin/messagemanager.h> + +#include <QBuffer> +#include <QJsonArray> +#include <QJsonDocument> +#include <QJsonObject> +#include <QPainter> +#include <QTimer> +#include <QVersionNumber> + +using namespace Utils; + +namespace ScreenRecorder { + +int ClipInfo::framesCount() const +{ + return int(duration * rFrameRate); +} + +qreal ClipInfo::secondForFrame(int frame) const +{ + return frame / rFrameRate; +} + +QString ClipInfo::timeStamp(int frame) const +{ + const qreal seconds = secondForFrame(frame); + const QString format = QLatin1String(seconds >= 60 * 60 ? "HH:mm:ss.zzz" : "mm:ss.zzz"); + return QTime::fromMSecsSinceStartOfDay(int(seconds * 1000)).toString(format); +} + +bool ClipInfo::isNull() const +{ + return qFuzzyCompare(duration, -1); +} + +bool ClipInfo::isCompleteArea(const QRect &rect) const +{ + return rect == QRect(QPoint(), dimensions); +} + +bool ClipInfo::isCompleteRange(FrameRange range) const +{ + return (range.first == 0 && (range.second == 0 || range.second == framesCount())); +} + +bool ClipInfo::isLossless() const +{ + return codec == "qtrle" && pixFmt == "rgb24"; + // TODO: Find out how to properly determine "lossless" via ffprobe +} + +TimeLabel::TimeLabel(const ClipInfo &clipInfo, QWidget *parent) + : QLabel(parent) + , m_clipInfo(clipInfo) +{ + setFrame(0); +} + +void TimeLabel::setFrame(int frame) +{ + m_frame = frame; + const QString timeStamp = m_clipInfo.timeStamp(m_frame); + const int maxFrameDigits = qCeil(log10(double(m_clipInfo.framesCount() + 1))); + const QString label = QString("<b>%1</b> (%2)") + .arg(m_frame, maxFrameDigits, 10, QLatin1Char('0')) + .arg(timeStamp); + setText(label); +} + +int TimeLabel::frame() const +{ + return m_frame; +} + +constexpr QSize warningIconSize(16, 16); + +CropSizeWarningIcon::CropSizeWarningIcon(IconVariant backgroundType, QWidget *parent) + : QWidget(parent) + , m_iconVariant(backgroundType) +{ + setMinimumSize(warningIconSize); + setToolTip(Tr::tr("Width and height are not both divisible by 2. " + "The Video export for some of the lossy formats will not work.")); + m_updateTimer = new QTimer(this); + m_updateTimer->setInterval(350); + m_updateTimer->setSingleShot(true); + m_updateTimer->callOnTimeout(this, &CropSizeWarningIcon::updateVisibility); +} + +void CropSizeWarningIcon::setCropSize(const QSize &size) +{ + m_cropSize = size; + m_updateTimer->stop(); + if (needsWarning()) + m_updateTimer->start(); + else + setVisible(false); +} + +void CropSizeWarningIcon::paintEvent(QPaintEvent*) +{ + static const QIcon standardIcon = Icons::WARNING.icon(); + static const QIcon toolBarIcon = Icons::WARNING_TOOLBAR.icon(); + QRect iconRect(QPoint(), warningIconSize); + iconRect.moveCenter(rect().center()); + QPainter p(this); + (m_iconVariant == StandardVariant ? standardIcon : toolBarIcon).paint(&p, iconRect); +} + +void CropSizeWarningIcon::updateVisibility() +{ + setVisible(needsWarning()); +} + +bool CropSizeWarningIcon::needsWarning() const +{ + return (m_cropSize.width() % 2 == 1) || (m_cropSize.height() % 2 == 1); +} + +namespace FFmpegUtils { + +static QVersionNumber parseVersionNumber(const QByteArray &toolOutput) +{ + QVersionNumber result; + const QJsonObject jsonObject = QJsonDocument::fromJson(toolOutput).object(); + if (const QJsonObject program_version = jsonObject.value("program_version").toObject(); + !program_version.isEmpty()) { + if (const QJsonValue version = program_version.value("version"); !version.isUndefined()) + result = QVersionNumber::fromString(version.toString()); + } + return result; +} + +QVersionNumber toolVersion() +{ + Process proc; + const CommandLine cl = { + Internal::settings().ffprobeTool(), + { + "-v", "quiet", + "-print_format", "json", + "-show_versions", + } + }; + proc.setCommand(cl); + proc.runBlocking(); + const QByteArray output = proc.allRawOutput(); + return parseVersionNumber(output); +} + +static ClipInfo parseClipInfo(const QByteArray &toolOutput) +{ + ClipInfo result; + const QJsonObject jsonObject = QJsonDocument::fromJson(toolOutput).object(); + if (const QJsonArray streams = jsonObject.value("streams").toArray(); !streams.isEmpty()) { + // With more than 1 video stream, the first one is often just a 1-frame thumbnail + const int streamIndex = int(qMin(streams.count() - 1, 1)); + const QJsonObject stream = streams.at(streamIndex).toObject(); + if (const QJsonValue index = stream.value("index"); !index.isUndefined()) + result.streamIdex = index.toInt(); + if (const QJsonValue width = stream.value("width"); !width.isUndefined()) + result.dimensions.setWidth(width.toInt()); + if (const QJsonValue height = stream.value("height"); !height.isUndefined()) + result.dimensions.setHeight(height.toInt()); + if (const QJsonValue rFrameRate = stream.value("r_frame_rate"); !rFrameRate.isUndefined()) { + const QStringList frNumbers = rFrameRate.toString().split('/'); + result.rFrameRate = frNumbers.count() == 2 ? frNumbers.first().toDouble() + / qMax(1, frNumbers.last().toInt()) + : frNumbers.first().toInt(); + } + if (const QJsonValue codecName = stream.value("codec_name"); !codecName.isUndefined()) + result.codec = codecName.toString(); + if (const QJsonValue pixFmt = stream.value("pix_fmt"); !pixFmt.isUndefined()) + result.pixFmt = pixFmt.toString(); + } + if (const QJsonObject format = jsonObject.value("format").toObject(); !format.isEmpty()) { + if (const QJsonValue duration = format.value("duration"); !duration.isUndefined()) + result.duration = duration.toString().toDouble(); + } + return result; +} + +ClipInfo clipInfo(const FilePath &path) +{ + Process proc; + const CommandLine cl = { + Internal::settings().ffprobeTool(), + { + "-v", "quiet", + "-print_format", "json", + "-show_format", + "-show_streams", + "-select_streams", "V", + path.toUserOutput() + } + }; + proc.setCommand(cl); + proc.runBlocking(); + const QByteArray output = proc.rawStdOut(); + ClipInfo result = parseClipInfo(output); + result.file = path; + return result; +} + +int parseFrameProgressFromOutput(const QByteArray &output) +{ + static const QRegularExpression re(R"(^frame=\s*(?<frame>\d+))"); + const QRegularExpressionMatch match = re.match(QString::fromUtf8(output)); + if (match.hasMatch()) + if (const QString frame = match.captured("frame"); !frame.isEmpty()) + return frame.toInt(); + return -1; +} + +void sendQuitCommand(Process *proc) +{ + if (proc && proc->processMode() == ProcessMode::Writer && proc->isRunning()) + proc->writeRaw("q"); +} + +void killFfmpegProcess(Process *proc) +{ + sendQuitCommand(proc); + if (proc->isRunning()) + proc->kill(); +} + +void reportError(const CommandLine &cmdLn, const QByteArray &error) +{ + if (!Internal::settings().logFfmpegCommandline()) + Core::MessageManager::writeSilently(cmdLn.toUserOutput()); + Core::MessageManager::writeDisrupting("\n" + QString::fromUtf8(error)); +} + +void logFfmpegCall(const CommandLine &cmdLn) +{ + if (Internal::settings().logFfmpegCommandline()) + Core::MessageManager::writeSilently(cmdLn.toUserOutput()); +} + +} // namespace FFmpegUtils +} // namespace ScreenRecorder + +#ifdef WITH_TESTS + +using namespace ScreenRecorder::FFmpegUtils; + +namespace ScreenRecorder::Internal { + +void FFmpegOutputParserTest::testVersionParser_data() +{ + QTest::addColumn<QByteArray>("ffprobeVersionOutput"); + QTest::addColumn<QVersionNumber>("versionNumber"); + + QTest::newRow("4.2.3") + << QByteArray( +R"_({ + "program_version": { + "version": "4.4.2-0ubuntu0.22.04.1", + "copyright": "Copyright (c) 2007-2021 the FFmpeg developers", + "compiler_ident": "gcc 11 (Ubuntu 11.2.0-19ubuntu1)", + "configuration": "--prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared" + } +})_") + << QVersionNumber(4, 4, 2); +} + +void FFmpegOutputParserTest::testVersionParser() +{ + QFETCH(QByteArray, ffprobeVersionOutput); + QFETCH(QVersionNumber, versionNumber); + + const QVersionNumber v = parseVersionNumber(ffprobeVersionOutput); + + QCOMPARE(v, versionNumber); +} + +void FFmpegOutputParserTest::testClipInfoParser_data() +{ + QTest::addColumn<QByteArray>("ffmpegVersionOutput"); + QTest::addColumn<ClipInfo>("clipInfo"); + + // ffprobe -v quiet -print_format json -show_format -show_streams -select_streams V <video file> + QTest::newRow("10.623s, 28.33 fps, 640x480, h264, yuv444p") + << QByteArray( +R"({ + "streams": [ + { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High 4:4:4 Predictive", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 640, + "height": 480, + "coded_width": 640, + "coded_height": 480, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv444p", + "level": 30, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "r_frame_rate": "85/3", + "avg_frame_rate": "85/3", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bits_per_raw_sample": "8", + "extradata_size": 41, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "ENCODER": "Lavc58.54.100 libx264", + "DURATION": "00:00:10.623000000" + } + } + ], + "format": { + "filename": "out.mkv", + "nb_streams": 1, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "0.000000", + "duration": "10.623000", + "size": "392136", + "bit_rate": "295310", + "probe_score": 100, + "tags": { + "ENCODER": "Lavf58.29.100" + } + } +})") + << ClipInfo{ {}, {640, 480}, "h264", 10.623, 28.33333333333, "yuv444p", 0}; +} + +void FFmpegOutputParserTest::testClipInfoParser() +{ + QFETCH(QByteArray, ffmpegVersionOutput); + QFETCH(ClipInfo, clipInfo); + + const ClipInfo ci = parseClipInfo(ffmpegVersionOutput); + + QCOMPARE(ci.duration, clipInfo.duration); + QCOMPARE(ci.rFrameRate, clipInfo.rFrameRate); + QCOMPARE(ci.dimensions, clipInfo.dimensions); + QCOMPARE(ci.codec, clipInfo.codec); + QCOMPARE(ci.pixFmt, clipInfo.pixFmt); +} + +void FFmpegOutputParserTest::testFfmpegOutputParser_data() +{ + QTest::addColumn<QByteArray>("ffmpegRecordingLogLine"); + QTest::addColumn<int>("frameProgress"); + + typedef QByteArray _; + + // ffmpeg -y -video_size vga -f x11grab -i :0.0+100,200 -vcodec qtrle /tmp/QtCreator-VMQjhs/AeOjep.mov + QTest::newRow("skip 01") + << _("ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers\n built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)\n configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared\n") + << -1; + QTest::newRow("skip 02") + << _(" libavutil 56. 70.100 / 56. 70.100\n libavcodec 58.134.100 / 58.134.100\n libavformat 58. 76.100 / 58. 76.100\n libavdevice 58. 13.100 / 58. 13.100\n libavfilter 7.110.100 / 7.110.100\n") + << -1; + QTest::newRow("skip 03") + << _(" libswscale 5. 9.100 / 5. 9.100\n libswresample 3. 9.100 / 3. 9.100\n libpostproc 55. 9.100 / 55. 9.100\n") + << -1; + QTest::newRow("skip 04") + << _("Input #0, x11grab, from ':0.0+100,200':\n Duration: N/A, start: 1691512344.764131, bitrate: 294617 kb/s\n") + << -1; + QTest::newRow("skip 05") + << _(" Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 640x480, 294617 kb/s, ") + << -1; + QTest::newRow("skip 06") + << _("29.97 fps, 30 tbr, 1000k tbn, 1000k tbc\n") + << -1; + QTest::newRow("skip 07") + << _("Stream mapping:\n Stream #0:0 -> #0:0 (rawvideo (native) -> qtrle (native))\n") + << -1; + QTest::newRow("skip 08") + << _("Press [q] to stop, [?] for help\n") + << -1; + QTest::newRow("skip 09") + << _("Output #0, mov, to '/tmp/QtCreator-VMQjhs/AeOjep.mov':\n Metadata:\n encoder : Lavf58.76.100\n") + << -1; + QTest::newRow("skip 10") + << _(" Stream #0:0: Video: qtrle (rle / 0x20656C72), rgb24(pc, gbr/unknown/unknown, progressive), 640x480, q=2-31, 200 kb/s") + << -1; + QTest::newRow("skip 11") + << _(", 30 fps, ") + << -1; + QTest::newRow("skip 12") + << _("15360 tbn\n Metadata:\n encoder : Lavc58.134.100 qtrle") + << -1; + QTest::newRow("skip 13") + << _("\n") + << -1; + QTest::newRow("frame 1") + << _("frame= 1 fps=0.0 q=-0.0 size= 0kB time=00:00:00.00 bitrate=4430.8kbits/s speed=N/A \r") + << 1; + QTest::newRow("frame 21") + << _("frame= 21 fps=0.0 q=-0.0 size= 256kB time=00:00:00.66 bitrate=3145.9kbits/s speed=1.33x \r") + << 21; + QTest::newRow("frame 36") + << _("frame= 36 fps= 36 q=-0.0 size= 256kB time=00:00:01.16 bitrate=1797.7kbits/s speed=1.17x \r") + << 36; + QTest::newRow("frame 51") + << _("frame= 51 fps= 34 q=-0.0 size= 512kB time=00:00:01.66 bitrate=2516.7kbits/s speed=1.11x \r") + << 51; + QTest::newRow("skip 14") + << _("\r\n\r\n[q] command received. Exiting.\r\n\r\n") + << -1; + QTest::newRow("frame 65 - final log line") + << _("frame= 65 fps= 32 q=-0.0 Lsize= 801kB time=00:00:02.13 bitrate=3074.4kbits/s speed=1.07x \nvideo:800kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.125299%\n") + << 65; +} + +void FFmpegOutputParserTest::testFfmpegOutputParser() +{ + QFETCH(QByteArray, ffmpegRecordingLogLine); + QFETCH(int, frameProgress); + + const int parsedFrameProgress = parseFrameProgressFromOutput(ffmpegRecordingLogLine); + + QCOMPARE(parsedFrameProgress, frameProgress); +} + +} // namescace ScreenRecorder::Internal +#endif // WITH_TESTS diff --git a/src/plugins/screenrecorder/ffmpegutils.h b/src/plugins/screenrecorder/ffmpegutils.h new file mode 100644 index 00000000000..cb4cbea92c9 --- /dev/null +++ b/src/plugins/screenrecorder/ffmpegutils.h @@ -0,0 +1,94 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <utils/filepath.h> + +#include <QLabel> +#include <QSize> +#include <QVersionNumber> + +QT_BEGIN_NAMESPACE +class QTimer; +QT_END_NAMESPACE + +namespace Utils { +class CommandLine; +class FilePath; +class Process; +} + +namespace ScreenRecorder { + +using FrameRange = std::pair<int, int>; + +struct ClipInfo { + Utils::FilePath file; + + // ffmpeg terminology + QSize dimensions; + QString codec; + qreal duration = -1; // seconds + qreal rFrameRate = -1; // frames per second + QString pixFmt; + int streamIdex = -1; + + int framesCount() const; + qreal secondForFrame(int frame) const; + QString timeStamp(int frame) const; + bool isNull() const; + bool isCompleteArea(const QRect &rect) const; + bool isCompleteRange(FrameRange range) const; + bool isLossless() const; +}; + +class TimeLabel : public QLabel +{ +public: + explicit TimeLabel(const ClipInfo &clipInfo, QWidget *parent = nullptr); + + void setFrame(int frame); + int frame() const; + +private: + const ClipInfo &m_clipInfo; + int m_frame = -1; +}; + +class CropSizeWarningIcon : public QWidget +{ +public: + enum IconVariant { + StandardVariant, + ToolBarVariant, + }; + + explicit CropSizeWarningIcon(IconVariant backgroundType, QWidget *parent = nullptr); + + void setCropSize(const QSize &size); + +protected: + void paintEvent(QPaintEvent*) override; + +private: + void updateVisibility(); + bool needsWarning() const; + + QSize m_cropSize; + const IconVariant m_iconVariant; + QTimer *m_updateTimer; +}; + +namespace FFmpegUtils { + +QVersionNumber toolVersion(); +ClipInfo clipInfo(const Utils::FilePath &path); +int parseFrameProgressFromOutput(const QByteArray &output); +void sendQuitCommand(Utils::Process *proc); +void killFfmpegProcess(Utils::Process *proc); +void logFfmpegCall(const Utils::CommandLine &cmdLn); +void reportError(const Utils::CommandLine &cmdLn, const QByteArray &error); + +} // namespace FFmpegUtils +} // namespace ScreenRecorder diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp new file mode 100644 index 00000000000..fe6c6911813 --- /dev/null +++ b/src/plugins/screenrecorder/record.cpp @@ -0,0 +1,361 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "record.h" + +#include "cropandtrim.h" +#include "ffmpegutils.h" +#include "screenrecordersettings.h" +#include "screenrecordertr.h" + +#include <utils/fileutils.h> +#include <utils/layoutbuilder.h> +#include <utils/process.h> +#include <utils/qtcsettings.h> +#include <utils/styledbar.h> +#include <utils/utilsicons.h> + +#include <coreplugin/icore.h> + +#include <QAction> +#include <QDialogButtonBox> +#include <QGuiApplication> +#include <QLoggingCategory> +#include <QMessageBox> +#include <QScreen> +#include <QTimer> +#include <QToolButton> + +using namespace Utils; + +namespace ScreenRecorder { + +using namespace Internal; + +struct RecordPreset { + const QString fileExtension; + const QStringList encodingParameters; +}; + +static const RecordPreset &recordPreset() +{ + static const RecordPreset preset = { + ".mkv", + { + "-vcodec", "libx264rgb", + "-crf", "0", + "-preset", "ultrafast", + "-tune", "zerolatency", + "-reserve_index_space", "1M", + } + }; + // Valid alternatives: + // ".mov", { "-vcodec", "qtrle" } // Slower encoding, faster seeking + return preset; +} + +class RecordOptionsDialog : public QDialog +{ +public: + explicit RecordOptionsDialog(QWidget *parent = nullptr); + +private: + QRect screenCropRect() const; + void updateCropScene(); + void updateWidgets(); + + static const int m_factor = 4; + CropScene *m_cropScene; + QImage m_thumbnail; + IntegerAspect m_screenId; + IntegerAspect m_recordFrameRate; + QLabel *m_cropRectLabel; + QToolButton *m_resetButton; +}; + +RecordOptionsDialog::RecordOptionsDialog(QWidget *parent) + : QDialog(parent) +{ + setWindowTitle(Tr::tr("Screen Recording Options")); + + m_screenId.setRange(0, QGuiApplication::screens().count() - 1); + + m_cropScene = new CropScene; + + m_resetButton = new QToolButton; + m_resetButton->setIcon(Icons::RESET.icon()); + + m_cropRectLabel = new QLabel; + + auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + + using namespace Layouting; + Column { + Row { m_screenId, st }, + Group { + title(Tr::tr("Recorded screen area")), + Column { + m_cropScene, + Row { st, m_cropRectLabel, m_resetButton }, + } + }, + Row { m_recordFrameRate, st }, + st, + buttonBox, + }.attachTo(this); + + connect(buttonBox, &QDialogButtonBox::accepted, this, [this] { + const QRect cropRect = m_cropScene->fullySelected() ? QRect() : screenCropRect(); + settings().applyRecordSettings({int(m_screenId()), cropRect, int(m_recordFrameRate())}); + QDialog::accept(); + }); + connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); + connect(&m_screenId, &IntegerAspect::changed, this, [this] { + updateCropScene(); + m_cropScene->setFullySelected(); + }); + connect(m_resetButton, &QToolButton::pressed, this, [this](){ + m_cropScene->setFullySelected(); + }); + connect(m_cropScene, &CropScene::cropRectChanged, this, &RecordOptionsDialog::updateWidgets); + + updateCropScene(); + + const ScreenRecorderSettings::RecordSettings rs = settings().recordSettings(); + m_screenId.setValue(rs.screenId); + if (!rs.cropRect.isNull()) { + m_cropScene->setCropRect({rs.cropRect.x() / m_factor, + rs.cropRect.y() / m_factor, + rs.cropRect.width() / m_factor, + rs.cropRect.height() / m_factor}); + } else { + m_cropScene->setFullySelected(); + } + m_recordFrameRate.setValue(rs.frameRate); +} + +QRect RecordOptionsDialog::screenCropRect() const +{ + const QRect r = m_cropScene->cropRect(); + return {r.x() * m_factor, r.y() * m_factor, r.width() * m_factor, r.height() * m_factor}; +} + +void RecordOptionsDialog::updateCropScene() +{ + const ScreenRecorderSettings::RecordSettings rs = ScreenRecorderSettings + ::sanitizedRecordSettings({int(m_screenId()), screenCropRect(), int(m_recordFrameRate())}); + const QList<QScreen*> screens = QGuiApplication::screens(); + m_thumbnail = QGuiApplication::screens().at(rs.screenId)->grabWindow().toImage(); + const qreal dpr = m_thumbnail.devicePixelRatio(); + m_thumbnail = m_thumbnail.scaled((m_thumbnail.deviceIndependentSize() / m_factor * dpr) + .toSize(), + Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + m_thumbnail.setDevicePixelRatio(dpr); + m_cropScene->setImage(m_thumbnail); + const static int lw = CropScene::lineWidth; + m_cropScene->setFixedSize(m_thumbnail.deviceIndependentSize().toSize() + .grownBy({lw, lw, lw, lw})); + QTimer::singleShot(250, this, [this] { + updateCropScene(); + }); + updateWidgets(); +} + +void RecordOptionsDialog::updateWidgets() +{ + const QRect r = screenCropRect(); + m_cropRectLabel->setText(QString("x:%1 y:%2 w:%3 h:%4") + .arg(r.x()).arg(r.y()).arg(r.width()).arg(r.height())); + m_resetButton->setEnabled(!m_cropScene->fullySelected()); +} + +RecordWidget::RecordWidget(const FilePath &recordFile, QWidget *parent) + : StyledBar(parent) + , m_recordFile(recordFile) +{ + m_process = new Process(this); + m_process->setUseCtrlCStub(true); + m_process->setProcessMode(ProcessMode::Writer); + + auto settingsButton = new QToolButton; + settingsButton->setIcon(Icons::SETTINGS_TOOLBAR.icon()); + + auto recordButton = new QToolButton; + recordButton->setIcon(Icon({{":/utils/images/filledcircle.png", + Theme::IconsStopToolBarColor}}).icon()); + + auto stopButton = new QToolButton; + stopButton->setIcon(Icon({{":/utils/images/stop_small.png", + Theme::IconsBaseColor}}).icon()); + stopButton->setEnabled(false); + + auto progressLabel = new TimeLabel(m_clipInfo); + progressLabel->setEnabled(false); + progressLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight); + + m_openClipAction = new QAction(Tr::tr("Open Mov/qtrle rgb24 file"), this); + addAction(m_openClipAction); + setContextMenuPolicy(Qt::ActionsContextMenu); + + using namespace Layouting; + Row { + settingsButton, + recordButton, + stopButton, + st, + progressLabel, + Space(6), + noMargin(), spacing(0), + }.attachTo(this); + + connect(settingsButton, &QToolButton::clicked, this, [this] { + m_optionsDialog = new RecordOptionsDialog(this); + m_optionsDialog->setWindowModality(Qt::WindowModal); + m_optionsDialog->setAttribute(Qt::WA_DeleteOnClose); + m_optionsDialog->show(); + }); + connect(recordButton, &QToolButton::clicked, this, [this, progressLabel] { + m_clipInfo.duration = 0; + progressLabel->setFrame(0); + m_clipInfo = {}; + m_clipInfo.file = m_recordFile; + m_clipInfo.rFrameRate = qreal(Internal::settings().recordFrameRate()); + const CommandLine cl(Internal::settings().ffmpegTool(), ffmpegParameters(m_clipInfo)); + m_process->setCommand(cl); + m_process->setWorkingDirectory(Internal::settings().ffmpegTool().parentDir()); + FFmpegUtils::logFfmpegCall(cl); + m_process->start(); + }); + connect(stopButton, &QToolButton::clicked, this, [this] { + FFmpegUtils::sendQuitCommand(m_process); + }); + connect(m_process, &Process::started, this, [=] { + progressLabel->setEnabled(true); + recordButton->setEnabled(false); + stopButton->setEnabled(true); + settingsButton->setEnabled(false); + m_openClipAction->setEnabled(false); + emit started(); + }); + connect(m_process, &Process::done, this, [=] { + recordButton->setEnabled(true); + stopButton->setEnabled(false); + settingsButton->setEnabled(true); + m_openClipAction->setEnabled(true); + if (m_process->exitCode() == 0) + emit finished(FFmpegUtils::clipInfo(m_clipInfo.file)); + else + FFmpegUtils::reportError(m_process->commandLine(), m_lastOutputChunk); + }); + connect(m_process, &Process::readyReadStandardError, this, [this, progressLabel] { + m_lastOutputChunk = m_process->readAllRawStandardError(); + const int frameProgress = FFmpegUtils::parseFrameProgressFromOutput(m_lastOutputChunk); + if (frameProgress > 0) { + m_clipInfo.duration = m_clipInfo.secondForFrame(frameProgress); + progressLabel->setFrame(m_clipInfo.framesCount()); + } + }); + connect(m_openClipAction, &QAction::triggered, this, [this, progressLabel] { + const FilePath lastDir = Internal::settings().lastOpenDirectory(); + const FilePath file = FileUtils::getOpenFilePath(Core::ICore::dialogParent(), + m_openClipAction->text(), lastDir, + "Mov/qtrle rgb24 (*.mov)"); + if (!file.isEmpty()) { + Internal::settings().lastOpenDirectory.setValue(file.parentDir()); + const ClipInfo clip = FFmpegUtils::clipInfo(file); + if (clip.isNull()) { + QMessageBox::critical(Core::ICore::dialogParent(), + Tr::tr("Cannot Open Clip"), + Tr::tr("FFmpeg cannot open %1.").arg(file.toUserOutput())); + } else if (!clip.isLossless()) { + QMessageBox::critical(Core::ICore::dialogParent(), + Tr::tr("Clip Not Supported"), + Tr::tr("Please chose a clip with the \"qtrle\" codec and " + "pixel format \"rgb24\".")); + } else { + m_clipInfo.duration = 0; + progressLabel->setFrame(0); + progressLabel->setEnabled(false); + emit finished(clip); + } + } + }); +} + +RecordWidget::~RecordWidget() +{ + FFmpegUtils::killFfmpegProcess(m_process); +} + +QString RecordWidget::recordFileExtension() +{ + return recordPreset().fileExtension; +} + +QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const +{ + const Internal::ScreenRecorderSettings::RecordSettings rS = + Internal::settings().recordSettings(); + const QString frameRateStr = QString::number(rS.frameRate); + const QString screenIdStr = QString::number(rS.screenId); + const QString videoSizeStr = QString("%1x%2").arg(rS.cropRect.width()) + .arg(rS.cropRect.height()); + QStringList videoGrabParams; + // see http://trac.ffmpeg.org/wiki/Capture/Desktop + switch (HostOsInfo::hostOs()) { + case OsTypeLinux: + videoGrabParams.append({"-f", "x11grab"}); + videoGrabParams.append({"-framerate", frameRateStr}); + if (!rS.cropRect.isNull()) { + videoGrabParams.append({"-video_size", videoSizeStr}); + videoGrabParams.append({"-i", QString(":%1.0+%2,%3").arg(screenIdStr) + .arg(rS.cropRect.x()).arg(rS.cropRect.y())}); + } else { + videoGrabParams.append({"-i", QString(":%1.0").arg(screenIdStr)}); + } + break; + case OsTypeWindows: { + QString filter = "ddagrab=output_idx=" + screenIdStr; + if (!rS.cropRect.isNull()) { + filter.append(":video_size=" + videoSizeStr); + filter.append(QString(":offset_x=%1:offset_y=%2").arg(rS.cropRect.x()) + .arg(rS.cropRect.y())); + } + filter.append(":framerate=" + frameRateStr); + filter.append(",hwdownload"); + filter.append(",format=bgra"); + videoGrabParams = { + "-ss", "00:00.25", // Skip few first frames which are black + "-filter_complex", filter, + }; + break; + } + case OsTypeMac: + videoGrabParams = { + "-f", "avfoundation", + "-framerate", frameRateStr, + "-video_size", videoSizeStr, + "-i", QString("%1:none").arg(screenIdStr), + }; + break; + default: + break; + } + + QStringList args = { + "-y", + "-v", "error", + "-stats", + }; + args.append(videoGrabParams); + if (Internal::settings().enableFileSizeLimit()) + args.append({"-fs", QString::number(Internal::settings().fileSizeLimit()) + "M"}); + if (Internal::settings().enableRtBuffer()) + args.append({"-rtbufsize", QString::number(Internal::settings().rtBufferSize()) + "M"}); + args.append(recordPreset().encodingParameters); + args.append(clipInfo.file.toString()); + + return args; +} + +} // namespace ScreenRecorder diff --git a/src/plugins/screenrecorder/record.h b/src/plugins/screenrecorder/record.h new file mode 100644 index 00000000000..4c6ac960311 --- /dev/null +++ b/src/plugins/screenrecorder/record.h @@ -0,0 +1,43 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "ffmpegutils.h" + +#include <utils/styledbar.h> + +namespace Utils { +class Process; +} + +namespace ScreenRecorder { + +class RecordOptionsDialog; + +class RecordWidget : public Utils::StyledBar +{ + Q_OBJECT + +public: + explicit RecordWidget(const Utils::FilePath &recordFile, QWidget *parent = nullptr); + ~RecordWidget(); + + static QString recordFileExtension(); + +signals: + void started(); + void finished(const ClipInfo &clip); + +private: + QStringList ffmpegParameters(const ClipInfo &clipInfo) const; + + const Utils::FilePath m_recordFile; + ClipInfo m_clipInfo; + Utils::Process *m_process; + QByteArray m_lastOutputChunk; + RecordOptionsDialog *m_optionsDialog; + QAction *m_openClipAction; +}; + +} // namespace ScreenRecorder diff --git a/src/plugins/screenrecorder/screenrecorder.qbs b/src/plugins/screenrecorder/screenrecorder.qbs new file mode 100644 index 00000000000..61639d11fc7 --- /dev/null +++ b/src/plugins/screenrecorder/screenrecorder.qbs @@ -0,0 +1,33 @@ +import qbs 1.0 + +QtcPlugin { + name: "ScreenRecorder" + + Depends { name: "Qt.widgets" } + Depends { name: "Utils" } + + Depends { name: "Core" } + + files: [ + "cropandtrim.cpp", + "cropandtrim.h", + "export.cpp", + "export.h", + "ffmpegutils.cpp", + "ffmpegutils.h", + "record.cpp", + "record.h", + "screenrecorder.qrc", + "screenrecorderconstants.h", + "screenrecorderplugin.cpp", + "screenrecordersettings.cpp", + "screenrecordersettings.h", + ] + + QtcTestFiles { + files: [ + "screenrecorder_test.h", + "screenrecorder_test.cpp", + ] + } +} diff --git a/src/plugins/screenrecorder/screenrecorder.qrc b/src/plugins/screenrecorder/screenrecorder.qrc new file mode 100644 index 00000000000..8536e94067a --- /dev/null +++ b/src/plugins/screenrecorder/screenrecorder.qrc @@ -0,0 +1,4 @@ +<RCC> + <qresource prefix="/screenrecorder"> + </qresource> +</RCC> diff --git a/src/plugins/screenrecorder/screenrecorder_test.cpp b/src/plugins/screenrecorder/screenrecorder_test.cpp new file mode 100644 index 00000000000..9911822c3a5 --- /dev/null +++ b/src/plugins/screenrecorder/screenrecorder_test.cpp @@ -0,0 +1,16 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "screenrecorder_test.h" + +#include <QTest> + +namespace ScreenRecorder::Internal { + +FFmpegOutputParserTest::FFmpegOutputParserTest(QObject *parent) + : QObject(parent) +{ } + +FFmpegOutputParserTest::~FFmpegOutputParserTest() = default; + +} // namespace ScreenRecorder::Internal diff --git a/src/plugins/screenrecorder/screenrecorder_test.h b/src/plugins/screenrecorder/screenrecorder_test.h new file mode 100644 index 00000000000..baf10f0c512 --- /dev/null +++ b/src/plugins/screenrecorder/screenrecorder_test.h @@ -0,0 +1,29 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <coreplugin/dialogs/ioptionspage.h> + +#include <utils/aspects.h> + +namespace ScreenRecorder::Internal { + +class FFmpegOutputParserTest : public QObject +{ + Q_OBJECT + +public: + FFmpegOutputParserTest(QObject *parent = nullptr); + ~FFmpegOutputParserTest(); + +private slots: + void testVersionParser_data(); + void testVersionParser(); + void testClipInfoParser_data(); + void testClipInfoParser(); + void testFfmpegOutputParser_data(); + void testFfmpegOutputParser(); +}; + +} // namespace ScreenRecorder::Internal diff --git a/src/plugins/screenrecorder/screenrecorderconstants.h b/src/plugins/screenrecorder/screenrecorderconstants.h new file mode 100644 index 00000000000..7b076f1cfdf --- /dev/null +++ b/src/plugins/screenrecorder/screenrecorderconstants.h @@ -0,0 +1,15 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +namespace ScreenRecorder::Constants { + +const char TOOLSSETTINGSPAGE_ID[] = "Z.ScreenRecorder"; +const char LOGGING_CATEGORY[] = "qtc.screenrecorder"; +const char ACTION_ID[] = "ScreenRecorder.Action"; +const char FFMPEG_COMMAND[] = "ffmpeg"; +const char FFPROBE_COMMAND[] = "ffprobe"; +const char FFMPEG_DOWNLOAD_URL[] = "https://ffmpeg.org/download.html"; + +} // namespace ScreenRecorder::Constants diff --git a/src/plugins/screenrecorder/screenrecorderplugin.cpp b/src/plugins/screenrecorder/screenrecorderplugin.cpp new file mode 100644 index 00000000000..ff72193840c --- /dev/null +++ b/src/plugins/screenrecorder/screenrecorderplugin.cpp @@ -0,0 +1,124 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "screenrecorderconstants.h" + +#include "cropandtrim.h" +#include "export.h" +#include "record.h" +#include "screenrecorderconstants.h" +#include "screenrecordersettings.h" +#include "screenrecordertr.h" + +#ifdef WITH_TESTS +#include "screenrecorder_test.h" +#endif // WITH_TESTS + +#include <extensionsystem/iplugin.h> + +#include <utils/layoutbuilder.h> +#include <utils/styledbar.h> +#include <utils/stylehelper.h> +#include <utils/temporaryfile.h> + +#include <coreplugin/actionmanager/actioncontainer.h> +#include <coreplugin/actionmanager/actionmanager.h> +#include <coreplugin/actionmanager/command.h> +#include <coreplugin/icore.h> + +#include <QDialog> +#include <QPushButton> + +using namespace Utils; +using namespace Core; + +namespace ScreenRecorder::Internal { + +class ScreenRecorderDialog : public QDialog +{ +public: + ScreenRecorderDialog(QWidget *parent = nullptr) + : QDialog(parent) + , m_recordFile("XXXXXX" + RecordWidget::recordFileExtension()) + { + setWindowTitle(Tr::tr("Record Screen")); + setMinimumWidth(320); + StyleHelper::setPanelWidget(this); + + m_recordFile.open(); + m_recordWidget = new RecordWidget(FilePath::fromString(m_recordFile.fileName())); + + m_cropAndTrimStatusWidget = new CropAndTrimWidget; + + m_exportWidget = new ExportWidget; + + using namespace Layouting; + Column { + m_recordWidget, + Row { m_cropAndTrimStatusWidget, m_exportWidget }, + noMargin(), spacing(0), + }.attachTo(this); + + auto setLowerRowEndabled = [this] (bool enabled) { + m_cropAndTrimStatusWidget->setEnabled(enabled); + m_exportWidget->setEnabled(enabled); + }; + setLowerRowEndabled(false); + connect(m_recordWidget, &RecordWidget::started, + this, [setLowerRowEndabled] { setLowerRowEndabled(false); }); + connect(m_recordWidget, &RecordWidget::finished, + this, [this, setLowerRowEndabled] (const ClipInfo &clip) { + m_cropAndTrimStatusWidget->setClip(clip); + m_exportWidget->setClip(clip); + setLowerRowEndabled(true); + }); + connect(m_cropAndTrimStatusWidget, &CropAndTrimWidget::cropRectChanged, + m_exportWidget, &ExportWidget::setCropRect); + connect(m_cropAndTrimStatusWidget, &CropAndTrimWidget::trimRangeChanged, + m_exportWidget, &ExportWidget::setTrimRange); + } + +private: + RecordWidget *m_recordWidget; + TemporaryFile m_recordFile; + CropAndTrimWidget *m_cropAndTrimStatusWidget; + ExportWidget *m_exportWidget; +}; + +class ScreenRecorderPlugin final : public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ScreenRecorder.json") + +public: + void initialize() final + { + auto action = new QAction(Tr::tr("Record Screen..."), this); + Command *cmd = ActionManager::registerAction(action, Constants::ACTION_ID, + Context(Core::Constants::C_GLOBAL)); + connect(action, &QAction::triggered, this, &ScreenRecorderPlugin::showDialogOrSettings); + ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS); + mtools->addAction(cmd); + +#ifdef WITH_TESTS + addTest<FFmpegOutputParserTest>(); +#endif + } + +private: + void showDialogOrSettings() + { + if (!Internal::settings().toolsRegistered() && + !Core::ICore::showOptionsDialog(Constants::TOOLSSETTINGSPAGE_ID)) { + return; + } + + auto dialog = new ScreenRecorderDialog(Core::ICore::dialogParent()); + dialog->setAttribute(Qt::WA_DeleteOnClose); + dialog->show(); + } +}; + +} // namespace ScreenRecorder::Internal + +#include "screenrecorderplugin.moc" diff --git a/src/plugins/screenrecorder/screenrecordersettings.cpp b/src/plugins/screenrecorder/screenrecordersettings.cpp new file mode 100644 index 00000000000..98dfefdcf63 --- /dev/null +++ b/src/plugins/screenrecorder/screenrecordersettings.cpp @@ -0,0 +1,215 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "screenrecordersettings.h" + +#include "screenrecorderconstants.h" +#include "screenrecordertr.h" + +#include <coreplugin/dialogs/ioptionspage.h> +#include <coreplugin/icore.h> + +#include <help/helpconstants.h> + +#include <utils/fileutils.h> +#include <utils/environment.h> +#include <utils/layoutbuilder.h> +#include <utils/utilsicons.h> + +#include <QDesktopServices> +#include <QGuiApplication> +#include <QLabel> +#include <QScreen> + +using namespace Utils; + +namespace ScreenRecorder::Internal { + +ScreenRecorderSettings &settings() +{ + static ScreenRecorderSettings theSettings; + return theSettings; +} + +static QRect stringListToRect(const QStringList &stringList) +{ + return stringList.count() == 4 ? QRect(stringList[0].toInt(), stringList[1].toInt(), + stringList[2].toInt(), stringList[3].toInt()) + : QRect(); +} + +static QStringList rectToStringList(const QRect &rect) +{ + return {QString::number(rect.x()), QString::number(rect.y()), + QString::number(rect.width()), QString::number(rect.height())}; +} + +ScreenRecorderSettings::ScreenRecorderSettings() +{ + setSettingsGroup("ScreenRecorder"); + setAutoApply(false); + + const QStringList versionArgs{"-version"}; + + ffmpegTool.setSettingsKey("FFmpegTool"); + ffmpegTool.setExpectedKind(PathChooser::ExistingCommand); + ffmpegTool.setCommandVersionArguments(versionArgs); + const FilePath ffmpegDefault = + Environment::systemEnvironment().searchInPath(Constants::FFMPEG_COMMAND); + ffmpegTool.setDefaultValue(ffmpegDefault.toUserOutput()); + ffmpegTool.setLabelText(Tr::tr("ffmpeg tool:")); + + ffprobeTool.setSettingsKey("FFprobeTool"); + ffprobeTool.setExpectedKind(PathChooser::ExistingCommand); + ffprobeTool.setCommandVersionArguments(versionArgs); + const FilePath ffprobeDefault = + Environment::systemEnvironment().searchInPath(Constants::FFPROBE_COMMAND); + ffprobeTool.setDefaultValue(ffprobeDefault.toUserOutput()); + ffprobeTool.setLabelText(Tr::tr("ffprobe tool:")); + + enableFileSizeLimit.setSettingsKey("EnableFileSizeLimit"); + enableFileSizeLimit.setDefaultValue(true); + enableFileSizeLimit.setLabel(Tr::tr("Size limit for intermediate output file")); + enableFileSizeLimit.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); + + fileSizeLimit.setSettingsKey("FileSizeLimit"); + fileSizeLimit.setDefaultValue(1024); + fileSizeLimit.setRange(100, 1024 * 1024 * 2); // Up to 2GB + fileSizeLimit.setSuffix("MB"); + fileSizeLimit.setEnabler(&enableFileSizeLimit); + + enableRtBuffer.setSettingsKey("EnableRealTimeBuffer"); + enableRtBuffer.setDefaultValue(true); + enableRtBuffer.setLabel(Tr::tr("RAM buffer for real-time frames")); + enableRtBuffer.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); + + rtBufferSize.setSettingsKey("RealTimeBufferSize"); + rtBufferSize.setDefaultValue(1024); + rtBufferSize.setRange(100, 1024 * 1024 * 2); // Up to 2GB + rtBufferSize.setSuffix("MB"); + rtBufferSize.setEnabler(&enableRtBuffer); + + logFfmpegCommandline.setSettingsKey("LogFFMpegCommandLine"); + logFfmpegCommandline.setDefaultValue(false); + logFfmpegCommandline.setLabel(Tr::tr("Write command line of FFmpeg calls to General Messages")); + logFfmpegCommandline.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); + + animatedImagesAsEndlessLoop.setSettingsKey("AnimatedImagesAsEndlessLoop"); + animatedImagesAsEndlessLoop.setDefaultValue(true); + animatedImagesAsEndlessLoop.setLabel(Tr::tr("Export animated images as infinite loop")); + animatedImagesAsEndlessLoop.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); + + lastOpenDirectory.setSettingsKey("LastOpenDir"); + lastOpenDirectory.setExpectedKind(PathChooser::ExistingDirectory); + lastOpenDirectory.setDefaultValue(FileUtils::homePath().toString()); + + exportLastDirectory.setSettingsKey("ExportLastDir"); + exportLastDirectory.setExpectedKind(PathChooser::ExistingDirectory); + exportLastDirectory.setDefaultValue(FileUtils::homePath().toString()); + + recordFrameRate.setSettingsKey("RecordFrameRate"); + recordFrameRate.setDefaultValue(24); + recordFrameRate.setLabelText(Tr::tr("Recording frame rate:")); + recordFrameRate.setRange(1, 60); + recordFrameRate.setSuffix(" fps"); + + recordScreenId.setSettingsKey("RecordScreenID"); + recordScreenId.setDefaultValue(0); + recordScreenId.setLabelText(Tr::tr("Screen ID:")); + + recordScreenCropRect.setSettingsKey("RecordScreenCropRect"); + recordScreenCropRect.setDefaultValue(rectToStringList({})); + + setLayouter([this] { + using namespace Layouting; + auto websiteLabel = new QLabel; + websiteLabel->setText(QString("<a href=\"%1\">%1</a>").arg(Constants::FFMPEG_DOWNLOAD_URL)); + websiteLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); + websiteLabel->setOpenExternalLinks(true); + + // clang-format off + using namespace Layouting; + return Column { + Group { + title(Tr::tr("FFmpeg installation")), + Form { + ffmpegTool, br, + ffprobeTool, br, + websiteLabel, br, + }, + }, + Group { + title(Tr::tr("Record settings")), + Column { + Row { enableFileSizeLimit, fileSizeLimit, st }, + Row { enableRtBuffer, rtBufferSize, st }, + }, + }, + Group { + title(Tr::tr("Export settings")), + Column { + animatedImagesAsEndlessLoop, + }, + }, + logFfmpegCommandline, + st, + }; + // clang-format on + }); + + readSettings(); +} + +bool ScreenRecorderSettings::toolsRegistered() const +{ + return ffmpegTool().isExecutableFile() && ffprobeTool().isExecutableFile(); +} + +ScreenRecorderSettings::RecordSettings ScreenRecorderSettings::sanitizedRecordSettings(const RecordSettings &settings) +{ + const int screenIdFromSettings = settings.screenId; + const QList<QScreen*> screens = QGuiApplication::screens(); + const int effectiveScreenId = qMin(screenIdFromSettings, screens.size() - 1); + const QScreen *screen = screens.at(effectiveScreenId); + const QSize screenSize = screen->size() * screen->devicePixelRatio(); + const QRect screenRect(QPoint(), screenSize); + const QRect cropRectFromSettings = settings.cropRect; + const QRect effectiveCropRect = screenIdFromSettings == effectiveScreenId + ? screenRect.intersected(cropRectFromSettings) : QRect(); + return {effectiveScreenId, effectiveCropRect, settings.frameRate}; +} + +ScreenRecorderSettings::RecordSettings ScreenRecorderSettings::recordSettings() const +{ + return sanitizedRecordSettings({int(recordScreenId()), stringListToRect(recordScreenCropRect()), + int(recordFrameRate())}); +} + +void ScreenRecorderSettings::applyRecordSettings(const RecordSettings &settings) +{ + recordScreenId.setValue(settings.screenId); + recordScreenId.apply(); + recordScreenId.writeToSettingsImmediatly(); + recordScreenCropRect.setValue(rectToStringList(settings.cropRect)); + recordScreenCropRect.apply(); + recordScreenCropRect.writeToSettingsImmediatly(); + recordFrameRate.setValue(settings.frameRate); + recordFrameRate.apply(); + recordFrameRate.writeToSettingsImmediatly(); +} + +class ScreenRecorderSettingsPage : public Core::IOptionsPage +{ +public: + ScreenRecorderSettingsPage() + { + setId(Constants::TOOLSSETTINGSPAGE_ID); + setDisplayName(Tr::tr("Screen Recording")); + setCategory(Help::Constants::HELP_CATEGORY); + setSettingsProvider([] { return &settings(); }); + } +}; + +static const ScreenRecorderSettingsPage settingsPage; + +} // ImageViewer::Internal diff --git a/src/plugins/screenrecorder/screenrecordersettings.h b/src/plugins/screenrecorder/screenrecordersettings.h new file mode 100644 index 00000000000..ac05169bc40 --- /dev/null +++ b/src/plugins/screenrecorder/screenrecordersettings.h @@ -0,0 +1,50 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <utils/aspects.h> + +QT_BEGIN_NAMESPACE +class QScreen; +QT_END_NAMESPACE + +namespace ScreenRecorder::Internal { + +class ScreenRecorderSettings : public Utils::AspectContainer +{ +public: + ScreenRecorderSettings(); + + bool toolsRegistered() const; + + struct RecordSettings { + const int screenId; + const QRect cropRect; + const int frameRate; + }; + static RecordSettings sanitizedRecordSettings(const RecordSettings &settings); + RecordSettings recordSettings() const; + void applyRecordSettings(const RecordSettings &settings); + + // Visible in Settings page + Utils::FilePathAspect ffmpegTool{this}; + Utils::FilePathAspect ffprobeTool{this}; + Utils::BoolAspect enableFileSizeLimit{this}; + Utils::IntegerAspect fileSizeLimit{this}; // in MB + Utils::BoolAspect enableRtBuffer{this}; + Utils::IntegerAspect rtBufferSize{this}; // in MB + Utils::BoolAspect logFfmpegCommandline{this}; + Utils::BoolAspect animatedImagesAsEndlessLoop{this}; + + // Used in other places + Utils::FilePathAspect lastOpenDirectory{this}; + Utils::FilePathAspect exportLastDirectory{this}; + Utils::IntegerAspect recordFrameRate{this}; + Utils::IntegerAspect recordScreenId{this}; + Utils::StringListAspect recordScreenCropRect{this}; +}; + +ScreenRecorderSettings &settings(); + +} // ScreenRecorder::Internal diff --git a/src/plugins/screenrecorder/screenrecordertr.h b/src/plugins/screenrecorder/screenrecordertr.h new file mode 100644 index 00000000000..b1e660ba2d3 --- /dev/null +++ b/src/plugins/screenrecorder/screenrecordertr.h @@ -0,0 +1,15 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 + +#pragma once + +#include <QCoreApplication> + +namespace ScreenRecorder { + +struct Tr +{ + Q_DECLARE_TR_FUNCTIONS(QtC::ScreenRecorder) +}; + +} // namespace ScreenRecorder From c32b7067fe0ab664612d7d2200cba47f15e069e4 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 5 Sep 2023 14:33:48 +0200 Subject: [PATCH 1008/1777] Android: Don't unnecessarily test toolchains Change-Id: I19046800c4fce6e7d2cd8d66381ac74ae41aa620 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/android/androidconfigurations.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index d117c86527e..c6be6b0aab3 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -1343,9 +1343,8 @@ void AndroidConfigurations::updateAutomaticKitList() // register new kits const Toolchains toolchains = ToolChainManager::toolchains([](const ToolChain *tc) { - return tc->isAutoDetected() - && tc->isValid() - && tc->typeId() == Constants::ANDROID_TOOLCHAIN_TYPEID; + return tc->isAutoDetected() && tc->typeId() == Constants::ANDROID_TOOLCHAIN_TYPEID + && tc->isValid(); }); QList<Kit *> unhandledKits = existingKits; for (ToolChain *tc : toolchains) { From e17866e28300e859cd162c3e57fd24ae8eecd646 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 15 Jun 2023 14:16:53 +0200 Subject: [PATCH 1009/1777] Terminal: Show key when input is hidden Change-Id: I5fca6a8c4f43ea2b95bad4df247b5df0abad521c Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/3rdparty/libptyqt/iptyprocess.h | 7 +++ src/libs/3rdparty/libptyqt/unixptyprocess.cpp | 6 +++ src/libs/solutions/terminal/CMakeLists.txt | 1 + .../terminal/images/passwordlock.png | Bin 0 -> 840 bytes src/libs/solutions/terminal/terminal.qrc | 5 ++ src/libs/solutions/terminal/terminalview.cpp | 45 +++++++++++++++--- src/libs/solutions/terminal/terminalview.h | 2 + src/libs/utils/process.cpp | 8 ++++ src/libs/utils/processinterface.h | 16 +++++++ src/plugins/terminal/terminalwidget.cpp | 7 ++- src/tools/icons/qtcreatoricons.svg | 25 ++++++++++ 11 files changed, 115 insertions(+), 7 deletions(-) create mode 100644 src/libs/solutions/terminal/images/passwordlock.png create mode 100644 src/libs/solutions/terminal/terminal.qrc diff --git a/src/libs/3rdparty/libptyqt/iptyprocess.h b/src/libs/3rdparty/libptyqt/iptyprocess.h index 7c255b9a5e8..6005b0efde1 100644 --- a/src/libs/3rdparty/libptyqt/iptyprocess.h +++ b/src/libs/3rdparty/libptyqt/iptyprocess.h @@ -11,6 +11,8 @@ class IPtyProcess { public: enum PtyType { UnixPty = 0, WinPty = 1, ConPty = 2, AutoPty = 3 }; + enum PtyInputFlag { None = 0x0, InputModeHidden = 0x1, }; + Q_DECLARE_FLAGS(PtyInputFlags, PtyInputFlag) IPtyProcess() = default; IPtyProcess(const IPtyProcess &) = delete; @@ -43,6 +45,8 @@ public: return m_trace; } + PtyInputFlags inputFlags() { return m_inputFlags; } + protected: QString m_shellPath; QString m_lastError; @@ -50,6 +54,9 @@ protected: int m_exitCode{0}; QPair<qint16, qint16> m_size; //cols / rows bool m_trace{false}; + PtyInputFlags m_inputFlags; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(IPtyProcess::PtyInputFlags) + #endif // IPTYPROCESS_H diff --git a/src/libs/3rdparty/libptyqt/unixptyprocess.cpp b/src/libs/3rdparty/libptyqt/unixptyprocess.cpp index 91dbf36d7ec..e9ec1d590f6 100644 --- a/src/libs/3rdparty/libptyqt/unixptyprocess.cpp +++ b/src/libs/3rdparty/libptyqt/unixptyprocess.cpp @@ -172,6 +172,12 @@ bool UnixPtyProcess::startProcess(const QString &shellPath, static std::array<char, maxRead> buffer; int len = ::read(m_shellProcess.m_handleMaster, buffer.data(), buffer.size()); + + struct termios termAttributes; + tcgetattr(m_shellProcess.m_handleMaster, &termAttributes); + const bool isPasswordEntry = !(termAttributes.c_lflag & ECHO) && (termAttributes.c_lflag & ICANON); + m_inputFlags.setFlag(PtyInputFlag::InputModeHidden, isPasswordEntry); + if (len > 0) { m_shellReadBuffer.append(buffer.data(), len); m_shellProcess.emitReadyRead(); diff --git a/src/libs/solutions/terminal/CMakeLists.txt b/src/libs/solutions/terminal/CMakeLists.txt index 58c3e8780d4..0cf48fefbc7 100644 --- a/src/libs/solutions/terminal/CMakeLists.txt +++ b/src/libs/solutions/terminal/CMakeLists.txt @@ -7,6 +7,7 @@ add_qtc_library(TerminalLib scrollback.cpp scrollback.h surfaceintegration.h terminal_global.h + terminal.qrc terminalsurface.cpp terminalsurface.h terminalview.cpp terminalview.h ) diff --git a/src/libs/solutions/terminal/images/passwordlock.png b/src/libs/solutions/terminal/images/passwordlock.png new file mode 100644 index 0000000000000000000000000000000000000000..c548e28cab246dfb1c485e6cfac57c172e84571a GIT binary patch literal 840 zcmeAS@N?(olHy`uVBq!ia0y~yV9;P-U~u4IW?*25Z$FyBz`$r4;1lBde=vbRfByXc z|Nr;z-|ybNd;k9Z$B!RhzI^%i?b~P1p1pYS;?}KOw{PFRbLY;zd-twgyLSBe@slS{ zo;r1E?b@~L)~%a6ckY4(3l=V1ICJLA*|TR)n>KCAlqn4j4ULVBO-)VB&CS)-)pd1s z_4W0kp`k%RLBYYnZf<VY*4CDmme$tRii(O#N=mY_vT|~AVq#+A;^M->!W<kNoSd9o zTwE+HER2kdOiWD7%%A`i`8zY3fq@~dB*-tAftiJqUqDz)MpjirTUXz~*FPdUJ+q{= zvZlVRbJpxRbLTHuxoZ8!O`ErD-LY%;zWw_T96EI9@ZlpzjvYI8?D(lur!HK$eEIT~ zD_5`Gf_U)hvuCf~ynXxS%h#_ze*FCN=g;4N|Nb>==r3eoV2tr}aSZYBetZ77A5$WO zYvP(4)$jKvSSPrKyx|qytt6K6W#5109S+BTx}T9qZsI=o>Dld=`R7l>-@j*WWNLZm za#;AQ-}`2*%Y3uUdiDN9RoNX``sbc$wcp`m)84o16$8V=!>^xQ4*p~%#+I<>)Z0_; zj7sV2tIqF=VU^G|j&(FYQ0CP)ubiQZoA(AsLDtC=R;(EXR{vQx<a!1v$<3YJeN1># z%3B8EI`$kkB~8zlk7u5_pP-}rvXV99SBY!#ft^dfsFg`)dWs*2n8=&m_@R4AvW%=( zRU}(h?hURZDymI>5__hWuxz<ez_4SY$nh60mqah*A7&^}&%E1`J!z7|fi?zB&&_H) zo?eU+0h0>8ZhR`W>v)cU!u0^Trw{cX9FEi2GWAOvzc+*T_jv{U3}v>78qDH04{O-; zst*0-vH8&QU9h3!yQD3XjZ|>iiZ`eKH^rYmJpbVQDc&>Q`&ThvE%gYtUvhLR0|Ntt Mr>mdKI;Vst06@LgeE<Le literal 0 HcmV?d00001 diff --git a/src/libs/solutions/terminal/terminal.qrc b/src/libs/solutions/terminal/terminal.qrc new file mode 100644 index 00000000000..0877ca08b9d --- /dev/null +++ b/src/libs/solutions/terminal/terminal.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/terminal"> + <file>images/passwordlock.png</file> + </qresource> +</RCC> diff --git a/src/libs/solutions/terminal/terminalview.cpp b/src/libs/solutions/terminal/terminalview.cpp index 2025b4e7546..2244ea62d73 100644 --- a/src/libs/solutions/terminal/terminalview.cpp +++ b/src/libs/solutions/terminal/terminalview.cpp @@ -85,6 +85,7 @@ public: bool m_cursorBlinkState{true}; bool m_allowBlinkingCursor{true}; bool m_allowMouseTracking{true}; + bool m_passwordModeActive{false}; SurfaceIntegration *m_surfaceIntegration{nullptr}; }; @@ -258,6 +259,14 @@ void TerminalView::setColors(const std::array<QColor, 20> &newColors) update(); } +void TerminalView::setPasswordMode(bool passwordMode) +{ + if (passwordMode != d->m_passwordModeActive) { + d->m_passwordModeActive = passwordMode; + updateViewport(); + } +} + void TerminalView::setFont(const QFont &font) { QAbstractScrollArea::setFont(font); @@ -731,16 +740,37 @@ void TerminalView::paintCursor(QPainter &p) const { auto cursor = d->m_surface->cursor(); - if (!d->m_preEditString.isEmpty()) - cursor.shape = Cursor::Shape::Underline; + const int cursorCellWidth = d->m_surface->cellWidthAt(cursor.position.x(), cursor.position.y()); + if (!d->m_preEditString.isEmpty()) { + cursor.shape = Cursor::Shape::Underline; + } else if (d->m_passwordModeActive) { + QRectF cursorRect = QRectF(gridToGlobal(cursor.position), + gridToGlobal({cursor.position.x() + cursorCellWidth, + cursor.position.y()}, + true)) + .toAlignedRect(); + + const qreal dpr = p.device()->devicePixelRatioF(); + const QString key = QString("terminalpasswordlock-") + % QString::number(cursorRect.size().height()) + % "@" % QString::number(dpr); + QPixmap px; + if (!QPixmapCache::find(key, &px)) { + const QPixmap lock(":/terminal/images/passwordlock.png"); + px = lock.scaledToHeight(cursorRect.size().height() * dpr, Qt::SmoothTransformation); + px.setDevicePixelRatio(dpr); + QPixmapCache::insert(key, px); + } + + p.drawPixmap(cursorRect.topLeft(), px); + + return; + } const bool blinkState = !cursor.blink || d->m_cursorBlinkState || !d->m_allowBlinkingCursor || !d->m_cursorBlinkTimer.isActive(); if (cursor.visible && blinkState) { - const int cursorCellWidth = d->m_surface->cellWidthAt(cursor.position.x(), - cursor.position.y()); - QRectF cursorRect = QRectF(gridToGlobal(cursor.position), gridToGlobal({cursor.position.x() + cursorCellWidth, cursor.position.y()}, @@ -984,7 +1014,10 @@ void TerminalView::updateViewport() void TerminalView::updateViewportRect(const QRect &rect) { - viewport()->update(rect); + if (d->m_passwordModeActive) + viewport()->update(); + else + viewport()->update(rect); } void TerminalView::focusInEvent(QFocusEvent *) diff --git a/src/libs/solutions/terminal/terminalview.h b/src/libs/solutions/terminal/terminalview.h index 59b75c0e7ef..4745c63ee15 100644 --- a/src/libs/solutions/terminal/terminalview.h +++ b/src/libs/solutions/terminal/terminalview.h @@ -87,6 +87,8 @@ public: void setSurfaceIntegration(SurfaceIntegration *surfaceIntegration); void setColors(const std::array<QColor, 20> &colors); + void setPasswordMode(bool passwordMode); + struct Link { QString text; diff --git a/src/libs/utils/process.cpp b/src/libs/utils/process.cpp index 01e3b7747af..70a1d12b449 100644 --- a/src/libs/utils/process.cpp +++ b/src/libs/utils/process.cpp @@ -410,6 +410,13 @@ public: } connect(m_ptyProcess->notifier(), &QIODevice::readyRead, this, [this] { + if (m_setup.m_ptyData->ptyInputFlagsChangedHandler() + && m_inputFlags != m_ptyProcess->inputFlags()) { + m_inputFlags = m_ptyProcess->inputFlags(); + m_setup.m_ptyData->ptyInputFlagsChangedHandler()( + static_cast<Pty::PtyInputFlag>(m_inputFlags.toInt())); + } + emit readyRead(m_ptyProcess->readAll(), {}); }); @@ -430,6 +437,7 @@ public: private: std::unique_ptr<IPtyProcess> m_ptyProcess; + IPtyProcess::PtyInputFlags m_inputFlags; }; class QProcessImpl final : public DefaultImpl diff --git a/src/libs/utils/processinterface.h b/src/libs/utils/processinterface.h index 8dedd0183ef..796972d3093 100644 --- a/src/libs/utils/processinterface.h +++ b/src/libs/utils/processinterface.h @@ -18,12 +18,19 @@ namespace Internal { class ProcessPrivate; } namespace Pty { +enum PtyInputFlag { + None = 0x0, + InputModeHidden = 0x1, +}; + using ResizeHandler = std::function<void(const QSize &)>; +using PtyInputFlagsChangeHandler = std::function<void(PtyInputFlag)>; class QTCREATOR_UTILS_EXPORT SharedData { public: ResizeHandler m_handler; + PtyInputFlagsChangeHandler m_inputFlagsChangedHandler; }; class QTCREATOR_UTILS_EXPORT Data @@ -32,6 +39,15 @@ public: Data() : m_data(new SharedData) {} void setResizeHandler(const ResizeHandler &handler) { m_data->m_handler = handler; } + void setPtyInputFlagsChangedHandler(const PtyInputFlagsChangeHandler &handler) + { + m_data->m_inputFlagsChangedHandler = handler; + } + + PtyInputFlagsChangeHandler ptyInputFlagsChangedHandler() const + { + return m_data->m_inputFlagsChangedHandler; + } QSize size() const { return m_size; } void resize(const QSize &size); diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 7e4987e3794..3cf390f51cc 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -126,7 +126,12 @@ void TerminalWidget::setupPty() env.unset("CLINK_NOAUTORUN"); m_process->setProcessMode(ProcessMode::Writer); - m_process->setPtyData(Utils::Pty::Data()); + Utils::Pty::Data data; + data.setPtyInputFlagsChangedHandler([this](Pty::PtyInputFlag flags) { + const bool password = (flags & Pty::InputModeHidden); + setPasswordMode(password); + }); + m_process->setPtyData(data); m_process->setCommand(shellCommand); if (m_openParameters.workingDirectory.has_value()) m_process->setWorkingDirectory(*m_openParameters.workingDirectory); diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg index 155b5ee2729..0d5cfa9e23b 100644 --- a/src/tools/icons/qtcreatoricons.svg +++ b/src/tools/icons/qtcreatoricons.svg @@ -3716,6 +3716,31 @@ id="use6090" transform="rotate(180,2008,576)" /> </g> + <g + id="src/libs/solutions/terminal/images/passwordlock" + transform="translate(-5,4)"> + <use + x="0" + y="0" + xlink:href="#transparentBackgroundRect" + id="use1" + transform="matrix(2.5,0,0,4,586,-1405)" /> + <path + style="opacity:0.75;fill:#ffffff" + d="m 582,423 v -5 c 0,-4 -4,-15 -16,-15 -12,-0.0312 -16,11 -16,15 0,4 0,5 0,5 h -4 v 36 h 40 v -36 z" + id="path167" + sodipodi:nodetypes="czzzcccccc" /> + <path + style="display:inline;fill:#000000;fill-opacity:1;stroke-width:4" + inkscape:connector-curvature="0" + d="m 566,407 c -6.624,0 -12,5.372 -12,12 v 12 h 4 v -12 c 0,-4.412 3.584,-8 8,-8 4.412,0 8,3.588 8,8 v 12 h 4 v -12 c 0,-6.628 -5.372,-12 -12,-12 z" + id="lockbow-1" /> + <path + style="display:inline;fill:#000000;fill-opacity:1" + inkscape:connector-curvature="0" + d="m 550,427 v 28 h 32 v -28 z m 18,15.388 V 447 h -4 v -4.612 c -1.172,-0.7 -2,-1.92 -2,-3.388 0,-2.212 1.792,-4 4,-4 2.208,0 4,1.788 4,4 0,1.464 -0.828,2.688 -2,3.388 z" + id="lockbody-1" /> + </g> </g> <g inkscape:groupmode="layer" From a59a8d123f6467a1b580f36af8aee5647306b98e Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 5 Sep 2023 15:36:35 +0200 Subject: [PATCH 1010/1777] Terminal: Add qrc to qbs build as well Amends e17866e28300e859cd162c3e57fd24ae8eecd646. Change-Id: I24d1933da364dc13933da94e1af09146367b4a3f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/solutions/terminal/terminal.qbs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/solutions/terminal/terminal.qbs b/src/libs/solutions/terminal/terminal.qbs index 56d317148b1..cb312890fb6 100644 --- a/src/libs/solutions/terminal/terminal.qbs +++ b/src/libs/solutions/terminal/terminal.qbs @@ -20,6 +20,7 @@ QtcLibrary { "scrollback.cpp", "scrollback.h", "surfaceintegration.h", + "terminal.qrc", "terminal_global.h", "terminalsurface.cpp", "terminalsurface.h", From 63927a8d6a29eba9f0e8cfd8e274982d12b9afac Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 1 Sep 2023 14:30:35 +0200 Subject: [PATCH 1011/1777] ActionManager: Centralize ActionContainer update Each ActionContainer used to schedule an invokeMethod on the event loop when it changes, which creates an unnecessary amount of individual events, especially during startup. Instead schedule that update through the ActionManager, which then can schedule a single event that handles all updates up to that time. Change-Id: Ia193606adc4cfda88df8e45f2027662ca16f2ad3 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- .../actionmanager/actioncontainer.cpp | 46 +++++++++---------- .../actionmanager/actioncontainer_p.h | 21 +++++---- .../actionmanager/actionmanager.cpp | 24 ++++++++-- .../actionmanager/actionmanager_p.h | 3 ++ 4 files changed, 58 insertions(+), 36 deletions(-) diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp index c49b2e623fb..f1e40c8f6b3 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp +++ b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp @@ -172,8 +172,11 @@ namespace Internal { \internal */ -ActionContainerPrivate::ActionContainerPrivate(Id id) - : m_onAllDisabledBehavior(Disable), m_id(id), m_updateRequested(false) +ActionContainerPrivate::ActionContainerPrivate(Id id, ActionManagerPrivate *actionManagerPrivate) + : m_onAllDisabledBehavior(Disable) + , m_id(id) + , m_actionManagerPrivate(actionManagerPrivate) + , m_updateRequested(false) { appendGroup(Constants::G_DEFAULT_ONE); appendGroup(Constants::G_DEFAULT_TWO); @@ -382,16 +385,7 @@ bool ActionContainerPrivate::canAddAction(Command *action) void ActionContainerPrivate::scheduleUpdate() { - if (m_updateRequested) - return; - m_updateRequested = true; - QMetaObject::invokeMethod(this, &ActionContainerPrivate::update, Qt::QueuedConnection); -} - -void ActionContainerPrivate::update() -{ - updateInternal(); - m_updateRequested = false; + m_actionManagerPrivate->scheduleContainerUpdate(this); } // ---------- MenuActionContainer ------------ @@ -401,9 +395,9 @@ void ActionContainerPrivate::update() \internal */ -MenuActionContainer::MenuActionContainer(Id id) - : ActionContainerPrivate(id), - m_menu(new QMenu) +MenuActionContainer::MenuActionContainer(Id id, ActionManagerPrivate *actionManagerPrivate) + : ActionContainerPrivate(id, actionManagerPrivate) + , m_menu(new QMenu) { m_menu->setObjectName(id.toString()); m_menu->menuAction()->setMenuRole(QAction::NoRole); @@ -450,7 +444,7 @@ void MenuActionContainer::removeMenu(ActionContainer *container) m_menu->removeAction(menu->menuAction()); } -bool MenuActionContainer::updateInternal() +bool MenuActionContainer::update() { if (onAllDisabledBehavior() == Show) return true; @@ -470,7 +464,7 @@ bool MenuActionContainer::updateInternal() qWarning("%s", warning.constData()); continue; } - if (container->updateInternal()) { + if (container->update()) { hasitems = true; break; } @@ -520,8 +514,9 @@ bool MenuActionContainer::canBeAddedToContainer(ActionContainerPrivate *containe \internal */ -MenuBarActionContainer::MenuBarActionContainer(Id id) - : ActionContainerPrivate(id), m_menuBar(nullptr) +MenuBarActionContainer::MenuBarActionContainer(Id id, ActionManagerPrivate *actionManagerPrivate) + : ActionContainerPrivate(id, actionManagerPrivate) + , m_menuBar(nullptr) { setOnAllDisabledBehavior(Show); } @@ -566,7 +561,7 @@ void MenuBarActionContainer::removeMenu(ActionContainer *container) m_menuBar->removeAction(menu->menuAction()); } -bool MenuBarActionContainer::updateInternal() +bool MenuBarActionContainer::update() { if (onAllDisabledBehavior() == Show) return true; @@ -597,9 +592,12 @@ bool MenuBarActionContainer::canBeAddedToContainer(ActionContainerPrivate *) con const char ID_PREFIX[] = "io.qt.qtcreator."; -TouchBarActionContainer::TouchBarActionContainer(Id id, const QIcon &icon, const QString &text) - : ActionContainerPrivate(id), - m_touchBar(std::make_unique<TouchBar>(id.withPrefix(ID_PREFIX).name(), icon, text)) +TouchBarActionContainer::TouchBarActionContainer(Id id, + ActionManagerPrivate *actionManagerPrivate, + const QIcon &icon, + const QString &text) + : ActionContainerPrivate(id, actionManagerPrivate) + , m_touchBar(std::make_unique<TouchBar>(id.withPrefix(ID_PREFIX).name(), icon, text)) { } @@ -653,7 +651,7 @@ bool TouchBarActionContainer::canBeAddedToContainer(ActionContainerPrivate *cont return qobject_cast<TouchBarActionContainer *>(container); } -bool TouchBarActionContainer::updateInternal() +bool TouchBarActionContainer::update() { return false; } diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h index aa6eb7aa34a..509a45ebfcf 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h +++ b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h @@ -25,7 +25,7 @@ class ActionContainerPrivate : public ActionContainer Q_OBJECT public: - ActionContainerPrivate(Utils::Id id); + ActionContainerPrivate(Utils::Id id, ActionManagerPrivate *actionManagerPrivate); ~ActionContainerPrivate() override = default; void setOnAllDisabledBehavior(OnAllDisabledBehavior behavior) final; @@ -55,7 +55,7 @@ public: virtual void removeAction(Command *command) = 0; virtual void removeMenu(ActionContainer *container) = 0; - virtual bool updateInternal() = 0; + virtual bool update() = 0; protected: static bool canAddAction(Command *action); @@ -67,7 +67,6 @@ protected: private: void scheduleUpdate(); - void update(); void itemDestroyed(QObject *sender); QList<Group>::const_iterator findGroup(Utils::Id groupId) const; @@ -75,6 +74,7 @@ private: OnAllDisabledBehavior m_onAllDisabledBehavior; Utils::Id m_id; + ActionManagerPrivate *m_actionManagerPrivate = nullptr; bool m_updateRequested; }; @@ -83,7 +83,7 @@ class MenuActionContainer : public ActionContainerPrivate Q_OBJECT public: - explicit MenuActionContainer(Utils::Id id); + explicit MenuActionContainer(Utils::Id id, ActionManagerPrivate *actionManagerPrivate); ~MenuActionContainer() override; QMenu *menu() const override; @@ -98,7 +98,7 @@ public: protected: bool canBeAddedToContainer(ActionContainerPrivate *container) const override; - bool updateInternal() override; + bool update() override; private: QPointer<QMenu> m_menu; @@ -109,7 +109,7 @@ class MenuBarActionContainer : public ActionContainerPrivate Q_OBJECT public: - explicit MenuBarActionContainer(Utils::Id id); + explicit MenuBarActionContainer(Utils::Id id, ActionManagerPrivate *actionManagerPrivate); void setMenuBar(QMenuBar *menuBar); QMenuBar *menuBar() const override; @@ -124,7 +124,7 @@ public: protected: bool canBeAddedToContainer(ActionContainerPrivate *container) const override; - bool updateInternal() override; + bool update() override; private: QMenuBar *m_menuBar; @@ -135,7 +135,10 @@ class TouchBarActionContainer : public ActionContainerPrivate Q_OBJECT public: - TouchBarActionContainer(Utils::Id id, const QIcon &icon, const QString &text); + TouchBarActionContainer(Utils::Id id, + ActionManagerPrivate *actionManagerPrivate, + const QIcon &icon, + const QString &text); ~TouchBarActionContainer() override; Utils::TouchBar *touchBar() const override; @@ -150,7 +153,7 @@ public: void removeMenu(ActionContainer *container) override; bool canBeAddedToContainer(ActionContainerPrivate *container) const override; - bool updateInternal() override; + bool update() override; private: std::unique_ptr<Utils::TouchBar> m_touchBar; diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index 3cb3d66c2c8..58b4c61a1e9 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -188,7 +188,7 @@ ActionContainer *ActionManager::createMenu(Id id) if (it != d->m_idContainerMap.constEnd()) return it.value(); - auto mc = new MenuActionContainer(id); + auto mc = new MenuActionContainer(id, d); d->m_idContainerMap.insert(id, mc); connect(mc, &QObject::destroyed, d, &ActionManagerPrivate::containerDestroyed); @@ -213,7 +213,7 @@ ActionContainer *ActionManager::createMenuBar(Id id) auto mb = new QMenuBar; // No parent (System menu bar on macOS) mb->setObjectName(id.toString()); - auto mbc = new MenuBarActionContainer(id); + auto mbc = new MenuBarActionContainer(id, d); mbc->setMenuBar(mb); d->m_idContainerMap.insert(id, mbc); @@ -241,7 +241,7 @@ ActionContainer *ActionManager::createTouchBar(Id id, const QIcon &icon, const Q ActionContainer * const c = d->m_idContainerMap.value(id); if (c) return c; - auto ac = new TouchBarActionContainer(id, icon, text); + auto ac = new TouchBarActionContainer(id, d, icon, text); d->m_idContainerMap.insert(id, ac); connect(ac, &QObject::destroyed, d, &ActionManagerPrivate::containerDestroyed); return ac; @@ -449,6 +449,7 @@ void ActionManagerPrivate::containerDestroyed(QObject *sender) { auto container = static_cast<ActionContainerPrivate *>(sender); m_idContainerMap.remove(m_idContainerMap.key(container)); + m_scheduledContainerUpdates.remove(container); } Command *ActionManagerPrivate::overridableAction(Id id) @@ -488,6 +489,23 @@ void ActionManagerPrivate::readUserSettings(Id id, Command *cmd) settings->endGroup(); } +void ActionManagerPrivate::scheduleContainerUpdate(ActionContainerPrivate *actionContainer) +{ + const bool needsSchedule = m_scheduledContainerUpdates.isEmpty(); + m_scheduledContainerUpdates.insert(actionContainer); + if (needsSchedule) + QMetaObject::invokeMethod(this, + &ActionManagerPrivate::updateContainer, + Qt::QueuedConnection); +} + +void ActionManagerPrivate::updateContainer() +{ + for (ActionContainerPrivate *c : std::as_const(m_scheduledContainerUpdates)) + c->update(); + m_scheduledContainerUpdates.clear(); +} + void ActionManagerPrivate::saveSettings(Command *cmd) { const Key id = cmd->id().toKey(); diff --git a/src/plugins/coreplugin/actionmanager/actionmanager_p.h b/src/plugins/coreplugin/actionmanager/actionmanager_p.h index 47ad23f9106..b305369ab58 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager_p.h +++ b/src/plugins/coreplugin/actionmanager/actionmanager_p.h @@ -43,11 +43,14 @@ public: static void readUserSettings(Utils::Id id, Command *cmd); + void scheduleContainerUpdate(ActionContainerPrivate *actionContainer); + void updateContainer(); void containerDestroyed(QObject *sender); IdCmdMap m_idCmdMap; IdContainerMap m_idContainerMap; + QSet<ActionContainerPrivate *> m_scheduledContainerUpdates; Context m_context; From cf9846ba77170643d82186ae427f7c1e93d19990 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 5 Sep 2023 15:52:36 +0200 Subject: [PATCH 1012/1777] ProjectExplorer: Sort toolchains in settings widget Change-Id: Id7acb146e23863b38920bcc9e4508113859568af Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../projectexplorer/toolchainoptionspage.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index c18a877ec26..775611bd1da 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -181,7 +181,10 @@ public: m_toolChainView->setUniformRowHeights(true); m_toolChainView->setSelectionMode(QAbstractItemView::SingleSelection); m_toolChainView->setSelectionBehavior(QAbstractItemView::SelectRows); - m_toolChainView->setModel(&m_model); + m_sortModel.setSourceModel(&m_model); + m_toolChainView->setModel(&m_sortModel); + m_toolChainView->setSortingEnabled(true); + m_toolChainView->sortByColumn(0, Qt::AscendingOrder); m_toolChainView->header()->setStretchLastSection(false); m_toolChainView->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); m_toolChainView->header()->setSectionResizeMode(1, QHeaderView::Stretch); @@ -314,6 +317,7 @@ public: private: TreeModel<TreeItem, ToolChainTreeItem> m_model; + SortModel m_sortModel; QList<ToolChainFactory *> m_factories; QTreeView *m_toolChainView; DetailsWidget *m_container; @@ -518,7 +522,7 @@ void ToolChainOptionsWidget::createToolChain(ToolChainFactory *factory, const Ut auto item = insertToolChain(tc, true); m_toAddList.append(item); - m_toolChainView->setCurrentIndex(m_model.indexForItem(item)); + m_toolChainView->setCurrentIndex(m_sortModel.mapFromSource(m_model.indexForItem(item))); } void ToolChainOptionsWidget::cloneToolChain() @@ -537,7 +541,7 @@ void ToolChainOptionsWidget::cloneToolChain() auto item = insertToolChain(tc, true); m_toAddList.append(item); - m_toolChainView->setCurrentIndex(m_model.indexForItem(item)); + m_toolChainView->setCurrentIndex(m_sortModel.mapFromSource(m_model.indexForItem(item))); } void ToolChainOptionsWidget::updateState() @@ -556,8 +560,7 @@ void ToolChainOptionsWidget::updateState() ToolChainTreeItem *ToolChainOptionsWidget::currentTreeItem() { - QModelIndex index = m_toolChainView->currentIndex(); - TreeItem *item = m_model.itemForIndex(index); + TreeItem *item = m_model.itemForIndex(m_sortModel.mapToSource(m_toolChainView->currentIndex())); return (item && item->level() == 3) ? static_cast<ToolChainTreeItem *>(item) : nullptr; } From e0ebce5379a7f98758c214cbd62df9a3f9c7ecf3 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 08:52:56 +0200 Subject: [PATCH 1013/1777] QtSupport: Split QtVersionManager in a early and late constructed part Change-Id: Iccf3f0e6c927fba1d5a9065978cc545d96185060 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/qmljseditor/qmllssettings.cpp | 6 ++-- src/plugins/qtsupport/qtversionmanager.cpp | 37 ++++++++++++---------- src/plugins/qtsupport/qtversionmanager.h | 25 ++++++++------- 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/src/plugins/qmljseditor/qmllssettings.cpp b/src/plugins/qmljseditor/qmllssettings.cpp index d92f09059cc..01c89dfd3e9 100644 --- a/src/plugins/qmljseditor/qmllssettings.cpp +++ b/src/plugins/qmljseditor/qmllssettings.cpp @@ -24,9 +24,9 @@ Q_LOGGING_CATEGORY(qmllsLog, "qtc.qmlls.settings", QtWarningMsg); static FilePath evaluateLatestQmlls() { // find latest qmlls, i.e. vals - if (!QtVersionManager::instance()->isLoaded()) + if (!QtVersionManager::isLoaded()) return {}; - const QtVersions versions = QtVersionManager::instance()->versions(); + const QtVersions versions = QtVersionManager::versions(); FilePath latestQmlls; QVersionNumber latestVersion; FilePath latestQmakeFilePath; @@ -78,7 +78,7 @@ void QmllsSettingsManager::setupAutoupdate() &QtVersionManager::qtVersionsChanged, this, &QmllsSettingsManager::checkForChanges); - if (QtVersionManager::instance()->isLoaded()) + if (QtVersionManager::isLoaded()) checkForChanges(); else QObject::connect(QtVersionManager::instance(), diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 7fca7df3655..da1c8a7a311 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -55,6 +55,12 @@ QVector<ExampleSetModel::ExtraExampleSet> m_pluginRegisteredExampleSets; static Q_LOGGING_CATEGORY(log, "qtc.qt.versions", QtWarningMsg); +QtVersionManager *QtVersionManager::instance() +{ + static QtVersionManager theSignals; + return &theSignals; +} + static FilePath globalSettingsFileName() { return Core::ICore::installerResourcePath(QTVERSION_FILENAME); @@ -77,7 +83,9 @@ QVector<ExampleSetModel::ExtraExampleSet> ExampleSetModel::pluginRegisteredExamp // QtVersionManager -class QtVersionManagerImpl : public QtVersionManager +static PersistentSettingsWriter *m_writer = nullptr; + +class QtVersionManagerImpl : public QObject { public: QtVersionManagerImpl() @@ -123,7 +131,6 @@ public: // managed by QtProjectManagerPlugin FileSystemWatcher *m_configFileWatcher = nullptr; QTimer m_fileWatcherTimer; - PersistentSettingsWriter *m_writer = nullptr; }; QtVersionManagerImpl &qtVersionManagerImpl() @@ -146,8 +153,10 @@ void QtVersionManagerImpl::triggerQtVersionRestore() findSystemQt(); } - emit qtVersionsLoaded(); - emit qtVersionsChanged(m_versions.keys(), QList<int>(), QList<int>()); + emit QtVersionManager::instance()->qtVersionsLoaded(); + + emit QtVersionManager::instance()->qtVersionsChanged( + m_versions.keys(), QList<int>(), QList<int>()); const FilePath configFileName = globalSettingsFileName(); if (configFileName.exists()) { @@ -157,18 +166,13 @@ void QtVersionManagerImpl::triggerQtVersionRestore() m_configFileWatcher->addFile(configFileName, FileSystemWatcher::WatchModifiedDate); } // exists - const QtVersions vs = versions(); + const QtVersions vs = QtVersionManager::versions(); updateDocumentation(vs, {}, vs); } bool QtVersionManager::isLoaded() { - return qtVersionManagerImpl().m_writer; -} - -QtVersionManager *QtVersionManager::instance() -{ - return &qtVersionManagerImpl(); + return m_writer != nullptr; } void QtVersionManager::initialized() @@ -368,7 +372,7 @@ void QtVersionManagerImpl::updateFromInstaller(bool emitSignal) } } if (emitSignal) - emit qtVersionsChanged(added, removed, changed); + emit QtVersionManager::instance()->qtVersionsChanged(added, removed, changed); } void QtVersionManagerImpl::saveQtVersions() @@ -466,7 +470,7 @@ void QtVersionManager::addVersion(QtVersion *version) int uniqueId = version->uniqueId(); m_versions.insert(uniqueId, version); - emit qtVersionManagerImpl().qtVersionsChanged(QList<int>() << uniqueId, QList<int>(), QList<int>()); + emit QtVersionManager::instance()->qtVersionsChanged(QList<int>() << uniqueId, QList<int>(), QList<int>()); qtVersionManagerImpl().saveQtVersions(); } @@ -474,7 +478,7 @@ void QtVersionManager::removeVersion(QtVersion *version) { QTC_ASSERT(version, return); m_versions.remove(version->uniqueId()); - emit qtVersionManagerImpl().qtVersionsChanged(QList<int>(), QList<int>() << version->uniqueId(), QList<int>()); + emit QtVersionManager::instance()->qtVersionsChanged(QList<int>(), QList<int>() << version->uniqueId(), QList<int>()); qtVersionManagerImpl().saveQtVersions(); delete version; } @@ -525,7 +529,8 @@ void QtVersionManagerImpl::updateDocumentation(const QtVersions &added, const QtVersions &removed, const QtVersions &allNew) { - const DocumentationSetting setting = documentationSetting(); + using DocumentationSetting = QtVersionManager::DocumentationSetting; + const DocumentationSetting setting = QtVersionManager::documentationSetting(); const QStringList docsOfAll = setting == DocumentationSetting::None ? QStringList() : documentationFiles(allNew, @@ -658,7 +663,7 @@ void QtVersionManagerImpl::setNewQtVersions(const QtVersions &newVersions) saveQtVersions(); if (!changedVersions.isEmpty() || !addedVersions.isEmpty() || !removedVersions.isEmpty()) - emit qtVersionsChanged(addedIds, removedIds, changedIds); + emit QtVersionManager::instance()->qtVersionsChanged(addedIds, removedIds, changedIds); } void QtVersionManager::setDocumentationSetting(const QtVersionManager::DocumentationSetting &setting) diff --git a/src/plugins/qtsupport/qtversionmanager.h b/src/plugins/qtsupport/qtversionmanager.h index 23d73a44155..7eb07310f87 100644 --- a/src/plugins/qtsupport/qtversionmanager.h +++ b/src/plugins/qtsupport/qtversionmanager.h @@ -8,18 +8,14 @@ namespace QtSupport { -class QTSUPPORT_EXPORT QtVersionManager : public QObject +namespace Internal { class QtSupportPlugin; } + +class QTSUPPORT_EXPORT QtVersionManager final : public QObject { Q_OBJECT - // for getUniqueId(); - friend class QtVersion; - friend class QtVersionFactory; - friend class QtVersionManagerImpl; - friend class Internal::QtOptionsPageWidget; public: static QtVersionManager *instance(); - static void initialized(); static bool isLoaded(); @@ -45,17 +41,24 @@ public: const QString &manifestPath, const QString &examplesPath); - static void shutdown(); - signals: // content of QtVersion objects with qmake path might have changed void qtVersionsChanged(const QList<int> &addedIds, const QList<int> &removedIds, const QList<int> &changedIds); void qtVersionsLoaded(); -protected: +private: QtVersionManager() = default; -private: + // for getUniqueId(); + friend class QtVersion; + friend class QtVersionFactory; + friend class QtVersionManagerImpl; + friend class Internal::QtOptionsPageWidget; + friend class Internal::QtSupportPlugin; + + static void initialized(); + static void shutdown(); + enum class DocumentationSetting { HighestOnly, All, None }; // Used by QtOptionsPage From 1b67da65582425d8cb825c075aa701b59a1b4c6c Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Fri, 1 Sep 2023 14:08:26 +0200 Subject: [PATCH 1014/1777] DAP: Show variables for different scopes Fixed displaying several the same variables. Change-Id: I848113de3a5e142394fbdb4efd40230f43c2417f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/dapengine.cpp | 50 ++++++++++++++++---------- src/plugins/debugger/dap/dapengine.h | 2 ++ 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 0f0b31772d4..1cb129d445b 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -409,8 +409,12 @@ void DapEngine::assignValueInDebugger(WatchItem *, const QString &/*expression*/ void DapEngine::updateItem(const QString &iname) { WatchItem *item = watchHandler()->findItem(iname); - m_currentWatchItem = item; - m_dapClient->variables(item->variablesReference); + + if (m_currentWatchItem != item) { + m_currentWatchItem = item; + m_isFirstLayer = false; + m_dapClient->variables(item->variablesReference); + } } QString DapEngine::errorMessage(QProcess::ProcessError error) const @@ -542,20 +546,23 @@ void DapEngine::handleScopesResponse(const QJsonObject &response) if (!response.value("success").toBool()) return; + watchHandler()->cleanup(); + watchHandler()->removeAllData(); + watchHandler()->notifyUpdateStarted(); + + m_watchItems.clear(); + QJsonArray scopes = response.value("body").toObject().value("scopes").toArray(); for (const QJsonValueRef &scope : scopes) { const QString name = scope.toObject().value("name").toString(); - const int variablesReference = scope.toObject().value("variablesReference").toInt(); - qCDebug(dapEngineLog) << "scoped success" << name << variablesReference; - if (name == "Locals") { // Fix for several scopes - watchHandler()->removeAllData(); - watchHandler()->notifyUpdateStarted(); - - m_watchItems.clear(); - watchHandler()->cleanup(); - m_dapClient->variables(variablesReference); - } + if (name == "Registers") + continue; + m_variablesReferenceQueue.push(scope.toObject().value("variablesReference").toInt()); } + + m_isFirstLayer = true; + m_dapClient->variables(m_variablesReferenceQueue.front()); + m_variablesReferenceQueue.pop(); } void DapEngine::handleThreadsResponse(const QJsonObject &response) @@ -695,7 +702,6 @@ void DapEngine::handleBreakpointEvent(const QJsonObject &event) void DapEngine::refreshLocals(const QJsonArray &variables) { - bool isFirstLayer = m_watchItems.isEmpty(); for (auto variable : variables) { WatchItem *item = new WatchItem; const QString name = variable.toObject().value("name").toString(); @@ -711,18 +717,24 @@ void DapEngine::refreshLocals(const QJsonArray &variables) if (variablesReference > 0) item->wantsChildren = true; - qCDebug(dapEngineLog) << "variable" << name << item->hexAddress(); - if (isFirstLayer) + qCDebug(dapEngineLog) << "variable" << name << variablesReference; + if (m_isFirstLayer) m_watchItems.append(item); else m_currentWatchItem->appendChild(item); } - if (isFirstLayer) { - for (auto item : m_watchItems) - watchHandler()->insertItem(item); - } else + if (m_isFirstLayer) { + if (m_variablesReferenceQueue.empty()) { + for (auto item : m_watchItems) + watchHandler()->insertItem(item); + } else { + m_dapClient->variables(m_variablesReferenceQueue.front()); + m_variablesReferenceQueue.pop(); + } + } else { watchHandler()->updateWatchExpression(m_currentWatchItem, ""); + } watchHandler()->notifyUpdateFinished(); } diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 1f5525bc947..6f650c05419 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -113,6 +113,8 @@ protected: int m_nextBreakpointId = 1; int m_currentThreadId = -1; + bool m_isFirstLayer = true; + std::queue<int> m_variablesReferenceQueue; WatchItem *m_currentWatchItem = nullptr; QList<WatchItem *> m_watchItems; }; From 68d12f0724e153230ad49490bc79e0b4dec1d7e4 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Wed, 6 Sep 2023 11:23:59 +0200 Subject: [PATCH 1015/1777] DAP: Fix python debug stoping Change-Id: I49ac6d9d7164a7f74fe683840734d903643b3561 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/pydapengine.cpp | 16 ++++++++++++++++ src/plugins/debugger/dap/pydapengine.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index d4eae2ea47a..89e87023245 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -177,6 +177,22 @@ void PyDapEngine::handleDapInitialize() qCDebug(dapEngineLog) << "handleDapAttach"; } +void PyDapEngine::quitDebugger() +{ + showMessage(QString("QUIT DEBUGGER REQUESTED IN STATE %1").arg(state())); + startDying(); + + // Temporary workaround for Python debugging instability, particularly + // in conjunction with PySide6, due to unreliable pause functionality. + if (state() == InferiorRunOk) { + setState(InferiorStopRequested); + notifyInferiorStopOk(); + return; + } + + DebuggerEngine::quitDebugger(); +} + void installDebugpyPackage(const FilePath &pythonPath) { CommandLine cmd{pythonPath, {"-m", "pip", "install", "debugpy"}}; diff --git a/src/plugins/debugger/dap/pydapengine.h b/src/plugins/debugger/dap/pydapengine.h index d81bd4e8359..06cdaba8716 100644 --- a/src/plugins/debugger/dap/pydapengine.h +++ b/src/plugins/debugger/dap/pydapengine.h @@ -14,6 +14,8 @@ public: private: void handleDapInitialize() override; + void quitDebugger() override; + void setupEngine() override; Utils::Process m_proc; }; From 7082d2a89bf94733df7c4913813086a386425117 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 6 Sep 2023 10:28:36 +0200 Subject: [PATCH 1016/1777] QmlJS: Delay loading of default QML type descriptions We definitely do not need to do this during startup of Qt Creator, delay to first use. Change-Id: I5942b5346aedc3d6b677918ad28a6c2924d09493 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> --- src/libs/qmljs/qmljsinterpreter.cpp | 28 +++++++++++++++++-- src/libs/qmljs/qmljsinterpreter.h | 6 ++-- src/libs/qmljs/qmljslink.cpp | 4 +-- src/libs/qmljs/qmljsmodelmanagerinterface.cpp | 7 +++-- src/plugins/qmljstools/qmljsmodelmanager.cpp | 2 +- tests/auto/qml/codemodel/check/tst_check.cpp | 3 +- .../qmldesigner/coretests/tst_testcore.cpp | 3 +- 7 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp index 7a2cd6fa717..63e009607b9 100644 --- a/src/libs/qmljs/qmljsinterpreter.cpp +++ b/src/libs/qmljs/qmljsinterpreter.cpp @@ -1321,10 +1321,32 @@ const Function *Function::asFunction() const // typing environment //////////////////////////////////////////////////////////////////////////////// -CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::defaultLibraryObjects; -CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::defaultQtObjects; +CppQmlTypesLoader::BuiltinObjects sDefaultLibraryObjects; +CppQmlTypesLoader::BuiltinObjects sDefaultQtObjects; +std::function<void()> CppQmlTypesLoader::defaultObjectsInitializer; -CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::loadQmlTypes(const QFileInfoList &qmlTypeFiles, QStringList *errors, QStringList *warnings) +CppQmlTypesLoader::BuiltinObjects &CppQmlTypesLoader::defaultQtObjects() +{ + if (defaultObjectsInitializer) { + const std::function<void()> init = defaultObjectsInitializer; + defaultObjectsInitializer = {}; + init(); + } + return sDefaultLibraryObjects; +} +CppQmlTypesLoader::BuiltinObjects &CppQmlTypesLoader::defaultLibraryObjects() +{ + if (defaultObjectsInitializer) { + const std::function<void()> init = defaultObjectsInitializer; + defaultObjectsInitializer = {}; + init(); + } + return sDefaultQtObjects; +} + +CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::loadQmlTypes(const QFileInfoList &qmlTypeFiles, + QStringList *errors, + QStringList *warnings) { QHash<QString, FakeMetaObject::ConstPtr> newObjects; QStringList newDependencies; diff --git a/src/libs/qmljs/qmljsinterpreter.h b/src/libs/qmljs/qmljsinterpreter.h index c0a953d7bd8..8574e37febe 100644 --- a/src/libs/qmljs/qmljsinterpreter.h +++ b/src/libs/qmljs/qmljsinterpreter.h @@ -689,8 +689,8 @@ public: static BuiltinObjects loadQmlTypes(const QFileInfoList &qmltypesFiles, QStringList *errors, QStringList *warnings); - static BuiltinObjects defaultQtObjects; - static BuiltinObjects defaultLibraryObjects; + static BuiltinObjects &defaultQtObjects(); + static BuiltinObjects &defaultLibraryObjects(); // parses the contents of a qmltypes file and fills the newObjects map static void parseQmlTypeDescriptions(const QByteArray &contents, @@ -700,6 +700,8 @@ public: QString *errorMessage, QString *warningMessage, const QString &fileName); + + static std::function<void()> defaultObjectsInitializer; }; class QMLJS_EXPORT FakeMetaObjectWithOrigin diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp index 7b99eb65de8..7a34fbaa10d 100644 --- a/src/libs/qmljs/qmljslink.cpp +++ b/src/libs/qmljs/qmljslink.cpp @@ -196,12 +196,12 @@ Context::ImportsPerDocument LinkPrivate::linkImports() m_valueOwner->cppQmlTypes().load(QLatin1String("<builtins>"), m_builtins.metaObjects()); } else { m_valueOwner->cppQmlTypes().load(QLatin1String("<defaults>"), - CppQmlTypesLoader::defaultQtObjects); + CppQmlTypesLoader::defaultQtObjects()); } // load library objects shipped with Creator m_valueOwner->cppQmlTypes().load(QLatin1String("<defaultQt4>"), - CppQmlTypesLoader::defaultLibraryObjects); + CppQmlTypesLoader::defaultLibraryObjects()); if (document) { // do it on document first, to make sure import errors are shown diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index 8cdcb1e886a..fb0c806fe60 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -279,8 +279,9 @@ void ModelManagerInterface::loadQmlTypeDescriptionsInternal(const QString &resou if (qmlTypesFiles.at(i).baseName() == QLatin1String("builtins")) { QFileInfoList list; list.append(qmlTypesFiles.at(i)); - CppQmlTypesLoader::defaultQtObjects = - CppQmlTypesLoader::loadQmlTypes(list, &errors, &warnings); + CppQmlTypesLoader::defaultQtObjects() = CppQmlTypesLoader::loadQmlTypes(list, + &errors, + &warnings); qmlTypesFiles.removeAt(i); break; } @@ -290,7 +291,7 @@ void ModelManagerInterface::loadQmlTypeDescriptionsInternal(const QString &resou const CppQmlTypesLoader::BuiltinObjects objs = CppQmlTypesLoader::loadQmlTypes(qmlTypesFiles, &errors, &warnings); for (auto it = objs.cbegin(); it != objs.cend(); ++it) - CppQmlTypesLoader::defaultLibraryObjects.insert(it.key(), it.value()); + CppQmlTypesLoader::defaultLibraryObjects().insert(it.key(), it.value()); for (const QString &error : std::as_const(errors)) writeMessageInternal(error); diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index 7ee672c99d8..c472fdcf795 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -261,7 +261,7 @@ QHash<QString,Dialect> ModelManager::languageForSuffix() const ModelManager::ModelManager() { qRegisterMetaType<QmlJSTools::SemanticInfo>("QmlJSTools::SemanticInfo"); - loadDefaultQmlTypeDescriptions(); + CppQmlTypesLoader::defaultObjectsInitializer = [this] { loadDefaultQmlTypeDescriptions(); }; } ModelManager::~ModelManager() = default; diff --git a/tests/auto/qml/codemodel/check/tst_check.cpp b/tests/auto/qml/codemodel/check/tst_check.cpp index befb363ae4c..611f2cefd94 100644 --- a/tests/auto/qml/codemodel/check/tst_check.cpp +++ b/tests/auto/qml/codemodel/check/tst_check.cpp @@ -64,7 +64,8 @@ void tst_Check::initTestCase() // the resource path is wrong, have to load things manually QFileInfo builtins(resourcePath() + "/qml-type-descriptions/builtins.qmltypes"); QStringList errors, warnings; - CppQmlTypesLoader::defaultQtObjects = CppQmlTypesLoader::loadQmlTypes(QFileInfoList() << builtins, &errors, &warnings); + CppQmlTypesLoader::defaultQtObjects() + = CppQmlTypesLoader::loadQmlTypes(QFileInfoList() << builtins, &errors, &warnings); if (!ModelManagerInterface::instance()) new ModelManagerInterface; diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp index f8fb4860243..95fd241eefc 100644 --- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp @@ -263,7 +263,8 @@ void tst_TestCore::initTestCase() QFileInfo builtins(IDE_DATA_PATH "/qml-type-descriptions/builtins.qmltypes"); QStringList errors, warnings; - QmlJS::CppQmlTypesLoader::defaultQtObjects = QmlJS::CppQmlTypesLoader::loadQmlTypes(QFileInfoList{builtins}, &errors, &warnings); + QmlJS::CppQmlTypesLoader::defaultQtObjects() + = QmlJS::CppQmlTypesLoader::loadQmlTypes(QFileInfoList{builtins}, &errors, &warnings); } void tst_TestCore::cleanupTestCase() From 25e1266c26843a9f822910717fe19429d863095b Mon Sep 17 00:00:00 2001 From: Sami Shalayel <sami.shalayel@qt.io> Date: Fri, 1 Sep 2023 11:40:37 +0200 Subject: [PATCH 1017/1777] qmljs: add option to disable builtin codemodel Add an option in the QML Language Server settings to disable the code model, for now it allows to use qmlls for renaming and find usages operations. Some of the checkboxes in the qmlls settings were not making a lot of sense, rephrased them to be easier to understand for the user. TODOs for later commits: * use qmlls for 'go to definition' aka 'follow symbol under cursor' * add extra action to the context menu for 'go to type definition' and implement it using the language client * also, remove builtin codemode stuff from the context menu when the builtin model is disabled Task-number: QTCREATORBUG-29567 Change-Id: I6283d99bd2b5dc8aef7df49994eb313bfbb854c6 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> --- .../qmljseditor/qmljseditingsettingspage.cpp | 20 ++++++++--- src/plugins/qmljseditor/qmljseditor.cpp | 33 +++++++++++++++++-- src/plugins/qmljseditor/qmllssettings.h | 4 ++- 3 files changed, 50 insertions(+), 7 deletions(-) diff --git a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp index 3b53185bcfe..f28fa5d8c17 100644 --- a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp +++ b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp @@ -33,6 +33,7 @@ const char QML_CONTEXTPANEPIN_KEY[] = "QmlJSEditor.ContextPanePinned"; const char FOLD_AUX_DATA[] = "QmlJSEditor.FoldAuxData"; const char USE_QMLLS[] = "QmlJSEditor.UseQmlls"; const char USE_LATEST_QMLLS[] = "QmlJSEditor.UseLatestQmlls"; +const char DISABLE_BUILTIN_CODEMODEL[] = "QmlJSEditor.DisableBuiltinCodemodel"; const char UIQML_OPEN_MODE[] = "QmlJSEditor.openUiQmlMode"; const char FORMAT_COMMAND[] = "QmlJSEditor.formatCommand"; const char FORMAT_COMMAND_OPTIONS[] = "QmlJSEditor.formatCommandOptions"; @@ -101,6 +102,8 @@ void QmlJsEditingSettings::fromSettings(QSettings *settings) m_uiQmlOpenMode = settings->value(UIQML_OPEN_MODE, "").toString(); m_qmllsSettings.useQmlls = settings->value(USE_QMLLS, QVariant(false)).toBool(); m_qmllsSettings.useLatestQmlls = settings->value(USE_LATEST_QMLLS, QVariant(false)).toBool(); + m_qmllsSettings.disableBuiltinCodemodel + = settings->value(DISABLE_BUILTIN_CODEMODEL, QVariant(false)).toBool(); m_formatCommand = settings->value(FORMAT_COMMAND, {}).toString(); m_formatCommandOptions = settings->value(FORMAT_COMMAND_OPTIONS, {}).toString(); m_useCustomFormatCommand = settings->value(CUSTOM_COMMAND, QVariant(false)).toBool(); @@ -128,6 +131,7 @@ void QmlJsEditingSettings::toSettings(QSettings *settings) const settings->setValue(UIQML_OPEN_MODE, m_uiQmlOpenMode); settings->setValue(USE_QMLLS, m_qmllsSettings.useQmlls); settings->setValue(USE_LATEST_QMLLS, m_qmllsSettings.useLatestQmlls); + settings->setValue(DISABLE_BUILTIN_CODEMODEL, m_qmllsSettings.disableBuiltinCodemodel); Utils::QtcSettings::setValueWithDefault(settings, FORMAT_COMMAND, m_formatCommand, {}); Utils::QtcSettings::setValueWithDefault(settings, FORMAT_COMMAND_OPTIONS, @@ -396,13 +400,19 @@ public: uiQmlOpenComboBox->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); uiQmlOpenComboBox->setSizeAdjustPolicy(QComboBox::QComboBox::AdjustToContents); - useQmlls = new QCheckBox(Tr::tr("Use qmlls (EXPERIMENTAL!)")); + useQmlls = new QCheckBox(Tr::tr("Enable QML Language Server (EXPERIMENTAL!)")); useQmlls->setChecked(s.qmllsSettings().useQmlls); - useLatestQmlls = new QCheckBox(Tr::tr("Always use latest qmlls")); + disableBuiltInCodemodel = new QCheckBox( + Tr::tr("Use QML Language Server advanced features (renaming, find usages and co.) " + "(EXPERIMENTAL!)")); + disableBuiltInCodemodel->setChecked(s.qmllsSettings().disableBuiltinCodemodel); + disableBuiltInCodemodel->setEnabled(s.qmllsSettings().useQmlls); + useLatestQmlls = new QCheckBox(Tr::tr("Use QML Language Server from latest Qt version")); useLatestQmlls->setChecked(s.qmllsSettings().useLatestQmlls); useLatestQmlls->setEnabled(s.qmllsSettings().useQmlls); QObject::connect(useQmlls, &QCheckBox::stateChanged, this, [this](int checked) { useLatestQmlls->setEnabled(checked != Qt::Unchecked); + disableBuiltInCodemodel->setEnabled(checked != Qt::Unchecked); }); useCustomAnalyzer = new QCheckBox(Tr::tr("Use customized static analyzer")); @@ -454,8 +464,8 @@ public: }, }, Group{ - title(Tr::tr("Language Server")), - Column{useQmlls, useLatestQmlls}, + title(Tr::tr("QML Language Server")), + Column{useQmlls, disableBuiltInCodemodel , useLatestQmlls}, }, Group { title(Tr::tr("Static Analyzer")), @@ -499,6 +509,7 @@ public: s.setFoldAuxData(foldAuxData->isChecked()); s.setUiQmlOpenMode(uiQmlOpenComboBox->currentData().toString()); s.qmllsSettings().useQmlls = useQmlls->isChecked(); + s.qmllsSettings().disableBuiltinCodemodel = disableBuiltInCodemodel->isChecked(); s.qmllsSettings().useLatestQmlls = useLatestQmlls->isChecked(); s.setUseCustomAnalyzer(useCustomAnalyzer->isChecked()); QSet<int> disabled; @@ -557,6 +568,7 @@ private: QCheckBox *foldAuxData; QCheckBox *useQmlls; QCheckBox *useLatestQmlls; + QCheckBox *disableBuiltInCodemodel; QComboBox *uiQmlOpenComboBox; QCheckBox *useCustomAnalyzer; QTreeView *analyzerMessagesView; diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 04c94d628a4..1e0cc5d29ae 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -60,6 +60,10 @@ #include <utils/qtcassert.h> #include <utils/uncommentselection.h> +#include <languageclient/languageclientmanager.h> +#include <languageclient/locatorfilter.h> +#include <languageclient/languageclientsymbolsupport.h> + #include <QComboBox> #include <QCoreApplication> #include <QFileInfo> @@ -855,14 +859,39 @@ void QmlJSEditorWidget::findLinkAt(const QTextCursor &cursor, processLinkCallback(Utils::Link()); } +static LanguageClient::Client *getQmllsClient(const Utils::FilePath &fileName) +{ + // the value in disableBuiltinCodemodel is only valid when useQmlls is enabled + if (QmlJsEditingSettings::get().qmllsSettings().useQmlls + && !QmlJsEditingSettings::get().qmllsSettings().disableBuiltinCodemodel) + return nullptr; + + auto client = LanguageClient::LanguageClientManager::clientForFilePath(fileName); + return client; +} + void QmlJSEditorWidget::findUsages() { - m_findReferences->findUsages(textDocument()->filePath(), textCursor().position()); + const Utils::FilePath fileName = textDocument()->filePath(); + + if (auto client = getQmllsClient(fileName)) { + client->symbolSupport().findUsages(textDocument(), textCursor()); + } else { + const int offset = textCursor().position(); + m_findReferences->findUsages(fileName, offset); + } } void QmlJSEditorWidget::renameSymbolUnderCursor() { - m_findReferences->renameUsages(textDocument()->filePath(), textCursor().position()); + const Utils::FilePath fileName = textDocument()->filePath(); + + if (auto client = getQmllsClient(fileName)) { + client->symbolSupport().renameSymbol(textDocument(), textCursor(), QString()); + } else { + const int offset = textCursor().position(); + m_findReferences->renameUsages(fileName, offset); + } } void QmlJSEditorWidget::showContextPane() diff --git a/src/plugins/qmljseditor/qmllssettings.h b/src/plugins/qmljseditor/qmllssettings.h index 040f64d4334..32890d3762a 100644 --- a/src/plugins/qmljseditor/qmllssettings.h +++ b/src/plugins/qmljseditor/qmllssettings.h @@ -15,10 +15,12 @@ struct QmllsSettings { bool useQmlls = true; bool useLatestQmlls = false; + bool disableBuiltinCodemodel = false; friend bool operator==(const QmllsSettings &s1, const QmllsSettings &s2) { - return s1.useQmlls == s2.useQmlls && s1.useLatestQmlls == s2.useLatestQmlls; + return s1.useQmlls == s2.useQmlls && s1.useLatestQmlls == s2.useLatestQmlls + && s1.disableBuiltinCodemodel == s2.disableBuiltinCodemodel; } friend bool operator!=(const QmllsSettings &s1, const QmllsSettings &s2) { return !(s1 == s2); } }; From 792c74b47ac3ec44b6bde00fa52181f61574bfd8 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 31 Aug 2023 09:59:49 +0200 Subject: [PATCH 1018/1777] AutoTest: Add report helper function Adds a report() function which generates a simple string holding the number of items per framework root node and uses it inside the logging after a full parse. Change-Id: Ib4be89de778aeab7e9c80b5c0522ee7f3f1bb587 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/autotest/testcodeparser.cpp | 13 ++++++ src/plugins/autotest/testtreemodel.cpp | 54 +++++++++++++++++++++++++ src/plugins/autotest/testtreemodel.h | 2 + 3 files changed, 69 insertions(+) diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index cfcd740f04f..9b68815bea6 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -456,6 +456,13 @@ void TestCodeParser::onFinished(bool success) emit parsingFinished(); qCDebug(LOG) << QDateTime::currentDateTime().toString("hh:mm:ss.zzz") << "ParsingFin"; qCDebug(LOG) << "Parsing took:" << m_parsingTimer.elapsed() << "ms"; + if (LOG().isInfoEnabled()) { + qCInfo(LOG).noquote().nospace() + << "Current test tree:" << TestTreeModel::instance()->report(true); + } else { + qCDebug(LOG).noquote().nospace() + << "Current test tree:" << TestTreeModel::instance()->report(false); + } } m_dirty = false; break; @@ -497,6 +504,12 @@ void TestCodeParser::onPartialParsingFinished() m_updateParsers.clear(); emit parsingFinished(); qCDebug(LOG) << QDateTime::currentDateTime().toString("hh:mm:ss.zzz") << "ParsingFin"; + if (LOG().isDebugEnabled()) { + QMetaObject::invokeMethod(this, [] { // sweep() needs to be processed before logging + qCDebug(LOG).noquote().nospace() + << "Current test tree:" << TestTreeModel::instance()->report(false); + }, Qt::QueuedConnection); + } } else { qCDebug(LOG) << "not emitting parsingFinished" << "(on PartialParsingFinished, singleshot scheduled)"; diff --git a/src/plugins/autotest/testtreemodel.cpp b/src/plugins/autotest/testtreemodel.cpp index 7d0dd3954d0..fb06b40a07b 100644 --- a/src/plugins/autotest/testtreemodel.cpp +++ b/src/plugins/autotest/testtreemodel.cpp @@ -500,6 +500,40 @@ void TestTreeModel::sweep() #endif } +QString TestTreeModel::report(bool full) const +{ + QString result; + int items = 0; + QString tree; + for (TestTreeItem *rootNode : frameworkRootNodes()) { + int itemsPerRoot = 0; + result.append("\n"); + result += rootNode->name(); + result.append(" > "); + + if (full) { + TestTreeSortFilterModel sortFilterModel(const_cast<TestTreeModel *>(this)); + sortFilterModel.setDynamicSortFilter(true); + sortFilterModel.sort(0); + tree = "\n" + sortFilterModel.report(); + rootNode->forAllChildren([&itemsPerRoot](TreeItem *) { + ++itemsPerRoot; + }); + + } else { + rootNode->forAllChildren([&itemsPerRoot](TreeItem *) { + ++itemsPerRoot; + }); + } + result.append(QString::number(itemsPerRoot)); + items += itemsPerRoot; + } + result.append("\nItems: " + QString::number(items)); + if (full) + return tree + '\n' + result; + return result; +} + /** * @note after calling this function emit testTreeModelChanged() if it returns true */ @@ -891,6 +925,26 @@ TestTreeSortFilterModel::FilterMode TestTreeSortFilterModel::toFilterMode(int f) } } +static QString dumpIndex(const QModelIndex &idx, int level = 0) +{ + QString result; + result.append(QString(level, ' ')); + result.append(idx.data().toString() + '\n'); + for (int row = 0, end = idx.model()->rowCount(idx); row < end; ++row) + result.append(dumpIndex(idx.model()->index(row, 0, idx), level + 1)); + return result; +} + +QString TestTreeSortFilterModel::report() const +{ + QString result; + for (int row = 0, end = rowCount(); row < end; ++row) { + auto idx = index(row, 0); + result.append(dumpIndex(idx)); + } + return result; +} + bool TestTreeSortFilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) const { // root items keep the intended order diff --git a/src/plugins/autotest/testtreemodel.h b/src/plugins/autotest/testtreemodel.h index c48c957d999..291c6d4017d 100644 --- a/src/plugins/autotest/testtreemodel.h +++ b/src/plugins/autotest/testtreemodel.h @@ -68,6 +68,7 @@ public: void markAllFrameworkItemsForRemoval(); void markForRemoval(const QSet<Utils::FilePath> &filePaths); void sweep(); + QString report(bool full) const; signals: void testTreeModelChanged(); @@ -117,6 +118,7 @@ public: void toggleFilter(FilterMode filterMode); static FilterMode toFilterMode(int f); + QString report() const; protected: bool lessThan(const QModelIndex &left, const QModelIndex &right) const final; bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const final; From 6b6d9dc21e78d10a4b637e234828e57604ab7fa0 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 1 Sep 2023 12:49:32 +0200 Subject: [PATCH 1019/1777] AutoTest: Speed up Qt Test parser The look up of function definitions is quite costly. Limit it to the test data functions as we need them when looking for data tags. This limitation reduces the time of a full scan here by more than 40% compared to without limitation. Task-number: QTCREATORBUG-29301 Change-Id: Ia692aab8cfcc1c98ca9a2d53c935d7755314f736 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/autotest/qtest/qttesttreeitem.cpp | 39 ++++++++++++++++--- src/plugins/autotest/qtest/qttesttreeitem.h | 7 ++-- src/plugins/autotest/qtest/qttestvisitors.cpp | 17 ++++---- src/plugins/autotest/qtest/qttestvisitors.h | 6 +-- 4 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/plugins/autotest/qtest/qttesttreeitem.cpp b/src/plugins/autotest/qtest/qttesttreeitem.cpp index b44c79eed37..0c535fa9f81 100644 --- a/src/plugins/autotest/qtest/qttesttreeitem.cpp +++ b/src/plugins/autotest/qtest/qttesttreeitem.cpp @@ -8,7 +8,9 @@ #include "../autotesttr.h" #include "../itestframework.h" +#include <cplusplus/Symbol.h> #include <cppeditor/cppmodelmanager.h> +#include <cppeditor/symbolfinder.h> #include <projectexplorer/projectmanager.h> @@ -16,8 +18,7 @@ using namespace Utils; -namespace Autotest { -namespace Internal { +namespace Autotest::Internal { QtTestTreeItem::QtTestTreeItem(ITestFramework *testFramework, const QString &name, const FilePath &filePath, TestTreeItem::Type type) @@ -49,9 +50,11 @@ QVariant QtTestTreeItem::data(int column, int role) const toolTip.append(Tr::tr("<p>Multiple testcases inside a single executable are not officially " "supported. Depending on the implementation they might get executed " "or not, but never will be explicitly selectable.</p>")); + } else if (type() == TestFunction) { + // avoid confusion (displaying header file, but ending up inside source) + toolTip = parentItem()->name() + "::" + name(); } return toolTip; - break; } case Qt::CheckStateRole: switch (type()) { @@ -69,6 +72,13 @@ QVariant QtTestTreeItem::data(int column, int role) const default: return m_multiTest; } + case LinkRole: + if (type() == GroupNode) + return QVariant(); + if (type() == TestDataFunction || type() == TestDataTag) + return TestTreeItem::data(column, role); + // other functions would end up inside declaration - so, find its definition + return linkForTreeItem(); } return TestTreeItem::data(column, role); } @@ -403,6 +413,26 @@ bool QtTestTreeItem::isGroupable() const return type() == TestCase; } +QVariant QtTestTreeItem::linkForTreeItem() const +{ + QVariant itemLink; + using namespace CPlusPlus; + const Snapshot snapshot = CppEditor::CppModelManager::instance()->snapshot(); + const Document::Ptr doc = snapshot.document(filePath()); + Symbol *symbol = doc->lastVisibleSymbolAt(line(), this->column() + 1); + if (auto decl = symbol->asDeclaration()) { + static CppEditor::SymbolFinder symbolFinder; + if (Symbol *definition = symbolFinder.findMatchingDefinition(decl, snapshot, true); + definition && definition->fileId()) { + itemLink.setValue(Link(FilePath::fromUtf8(definition->fileName()), + definition->line(), definition->column() - 1)); + } + } + if (!itemLink.isValid()) // fallback in case we failed to find the definition + itemLink.setValue(Link(filePath(), line(), this->column())); + return itemLink; +} + TestTreeItem *QtTestTreeItem::findChildByFileNameAndType(const FilePath &file, const QString &name, Type type) const { @@ -438,5 +468,4 @@ QString QtTestTreeItem::nameSuffix() const return suffix.isEmpty() ? suffix : QString{" [" + suffix + "]"}; } -} // namespace Internal -} // namespace Autotest +} // namespace Autotest::Internal diff --git a/src/plugins/autotest/qtest/qttesttreeitem.h b/src/plugins/autotest/qtest/qttesttreeitem.h index ebcc8b89dfe..51ad5b97657 100644 --- a/src/plugins/autotest/qtest/qttesttreeitem.h +++ b/src/plugins/autotest/qtest/qttesttreeitem.h @@ -5,8 +5,7 @@ #include "../testtreeitem.h" -namespace Autotest { -namespace Internal { +namespace Autotest::Internal { class QtTestTreeItem : public TestTreeItem { @@ -36,6 +35,7 @@ public: TestTreeItem *createParentGroupNode() const override; bool isGroupable() const override; private: + QVariant linkForTreeItem() const; TestTreeItem *findChildByFileNameAndType(const Utils::FilePath &file, const QString &name, Type type) const; TestTreeItem *findChildByNameAndInheritanceAndMultiTest(const QString &name, bool inherited, @@ -53,5 +53,4 @@ public: typedef QVector<QtTestCodeLocationAndType> QtTestCodeLocationList; -} // namespace Internal -} // namespace Autotest +} // namespace Autotest::Internal diff --git a/src/plugins/autotest/qtest/qttestvisitors.cpp b/src/plugins/autotest/qtest/qttestvisitors.cpp index 51f62febb00..f19b855d559 100644 --- a/src/plugins/autotest/qtest/qttestvisitors.cpp +++ b/src/plugins/autotest/qtest/qttestvisitors.cpp @@ -14,8 +14,7 @@ using namespace CPlusPlus; using namespace Utils; -namespace Autotest { -namespace Internal { +namespace Autotest::Internal { static QStringList specialFunctions({"initTestCase", "cleanupTestCase", "init", "cleanup"}); @@ -49,10 +48,13 @@ bool TestVisitor::visit(Class *symbol) const QString name = o.prettyName(func->name()); QtTestCodeLocationAndType locationAndType; - Function *functionDefinition = m_symbolFinder.findMatchingDefinition( - func, m_snapshot, true); - if (functionDefinition && functionDefinition->fileId()) - member = functionDefinition; + if (name.endsWith("_data")) { + // costly.. but we need at least the correct entry for finding data tags + Function *functionDefinition = m_symbolFinder.findMatchingDefinition( + func, m_snapshot, true); + if (functionDefinition && functionDefinition->fileId()) + member = functionDefinition; + } locationAndType.m_filePath = FilePath::fromUtf8(member->fileName()); locationAndType.m_line = member->line(); locationAndType.m_column = member->column() - 1; @@ -281,5 +283,4 @@ bool TestDataFunctionVisitor::newRowCallFound(CallAST *ast, unsigned *firstToken return found; } -} // namespace Internal -} // namespace Autotest +} // namespace Autotest::Internal diff --git a/src/plugins/autotest/qtest/qttestvisitors.h b/src/plugins/autotest/qtest/qttestvisitors.h index dc18914b544..cf1f14642ec 100644 --- a/src/plugins/autotest/qtest/qttestvisitors.h +++ b/src/plugins/autotest/qtest/qttestvisitors.h @@ -16,8 +16,7 @@ #include <QMap> #include <QSet> -namespace Autotest { -namespace Internal { +namespace Autotest::Internal { class TestVisitor : public CPlusPlus::SymbolVisitor { @@ -84,5 +83,4 @@ private: bool m_insideUsingQTest = false; }; -} // namespace Internal -} // namespace Autotest +} // namespace Autotest::Internal From 400806e16f185d1230d0bad8a21f3a3885f72f66 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Wed, 6 Sep 2023 11:08:07 +0200 Subject: [PATCH 1020/1777] CppEditor: Fix crash in tst_checkSymbols Amends 0a058bb65717cddb3e01a44f3241c029253a1eea. Change-Id: I2ccbfbe30d78d536a7657b29da25a216ac504fe5 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/cppeditor/cpplocalsymbols.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/cppeditor/cpplocalsymbols.cpp b/src/plugins/cppeditor/cpplocalsymbols.cpp index 3dc93245184..9983f9fba11 100644 --- a/src/plugins/cppeditor/cpplocalsymbols.cpp +++ b/src/plugins/cppeditor/cpplocalsymbols.cpp @@ -7,6 +7,7 @@ #include "cpptoolsreuse.h" #include "semantichighlighter.h" +#include <coreplugin/documentmanager.h> #include <cplusplus/declarationcomments.h> #include <cplusplus/Overview.h> #include <texteditor/textdocument.h> @@ -48,6 +49,10 @@ public: if (localUses.isEmpty()) return; + // For tst_checkSymbols + if (!Core::DocumentManager::instance()) + return; + // Look for parameter occurrences in function comments. const TextEditor::TextDocument * const editorDoc = TextEditor::TextDocument::textDocumentForFilePath(_doc->filePath()); From 4df90c9d8c10cb774dfb16cdada63230cc5ec1d9 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Thu, 7 Sep 2023 10:35:58 +0200 Subject: [PATCH 1021/1777] Doc: Add qtpositioning as a dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To fix a link to Qt Positioning. Change-Id: I7c943c99dd1653bc033a5df9937ae8b68878997a Reviewed-by: Topi Reiniö <topi.reinio@qt.io> --- doc/qtcreator/config/qtcreator-project.qdocconf | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/qtcreator/config/qtcreator-project.qdocconf b/doc/qtcreator/config/qtcreator-project.qdocconf index ec98529c141..d36bba7595c 100644 --- a/doc/qtcreator/config/qtcreator-project.qdocconf +++ b/doc/qtcreator/config/qtcreator-project.qdocconf @@ -34,6 +34,7 @@ depends += qtwidgets \ qthelp \ qtquicktimeline \ qtlinguist \ + qtpositioning \ qtscxml \ qtsensors \ qttestlib \ From f1365d99fa517b2c948e2126de8caba64a83722b Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Wed, 30 Aug 2023 15:44:23 +0200 Subject: [PATCH 1022/1777] CppEditor: Add quickfix for moving function documentation ... between declaration and definition. Fixes: QTCREATORBUG-13877 Change-Id: If2a8977587ef2ac888e9c9dde5f63d222d96d964 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/link.h | 15 +- src/plugins/cppeditor/cppquickfix_test.cpp | 151 +++++++++++++++++++ src/plugins/cppeditor/cppquickfix_test.h | 3 + src/plugins/cppeditor/cppquickfixes.cpp | 161 +++++++++++++++++++++ src/plugins/cppeditor/cppquickfixes.h | 8 + 5 files changed, 333 insertions(+), 5 deletions(-) diff --git a/src/libs/utils/link.h b/src/libs/utils/link.h index 00194654c97..57fb4c896fd 100644 --- a/src/libs/utils/link.h +++ b/src/libs/utils/link.h @@ -38,14 +38,19 @@ public: bool operator==(const Link &other) const { - return targetFilePath == other.targetFilePath - && targetLine == other.targetLine - && targetColumn == other.targetColumn - && linkTextStart == other.linkTextStart - && linkTextEnd == other.linkTextEnd; + return hasSameLocation(other) + && linkTextStart == other.linkTextStart + && linkTextEnd == other.linkTextEnd; } bool operator!=(const Link &other) const { return !(*this == other); } + bool hasSameLocation(const Link &other) const + { + return targetFilePath == other.targetFilePath + && targetLine == other.targetLine + && targetColumn == other.targetColumn; + } + friend size_t qHash(const Link &l, uint seed = 0) { return qHashMulti(seed, l.targetFilePath, l.targetLine, l.targetColumn); } diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 5558e56336c..0c4a07a2c27 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -9181,4 +9181,155 @@ void QuickfixTest::testChangeCommentType() &factory); } +void QuickfixTest::testMoveComments_data() +{ + QTest::addColumn<QByteArrayList>("headers"); + QTest::addColumn<QByteArrayList>("sources"); + + const QByteArrayList headersFuncDecl2Def{R"( +// Function comment +void @aFunction(); +)", R"( +void aFunction(); +)"}; + const QByteArrayList sourcesFuncDecl2Def{R"( +#include "file.h" + +void aFunction() {} +)", R"( +#include "file.h" + +// Function comment +void aFunction() {} +)"}; + QTest::newRow("function: from decl to def") << headersFuncDecl2Def << sourcesFuncDecl2Def; + + const QByteArrayList headersFuncDef2Decl{R"( +void aFunction(); +)", R"( +/* function */ +/* comment */ +void aFunction(); +)"}; + const QByteArrayList sourcesFuncDef2Decl{R"( +#include "file.h" + +/* function */ +/* comment */ +void a@Function() {} +)", R"( +#include "file.h" + +void aFunction() {} +)"}; + QTest::newRow("function: from def to decl") << headersFuncDef2Decl << sourcesFuncDef2Decl; + + const QByteArrayList headersFuncNoDef{R"( +// Function comment +void @aFunction(); +)", R"( +// Function comment +void aFunction(); +)"}; + QTest::newRow("function: no def") << headersFuncNoDef << QByteArrayList(); + + const QByteArrayList headersFuncNoDecl{R"( +// Function comment +inline void @aFunction() {} +)", R"( +// Function comment +inline void aFunction() {} +)"}; + QTest::newRow("function: no decl") << headersFuncNoDecl << QByteArrayList(); + + const QByteArrayList headersFuncTemplateDecl2Def{R"( +// Function comment +template<typename T> T @aFunction(); + +template<typename T> inline T aFunction() { return T(); } +)", R"( +template<typename T> T aFunction(); + +// Function comment +template<typename T> inline T aFunction() { return T(); } +)"}; + QTest::newRow("function template: from decl to def") << headersFuncTemplateDecl2Def + << QByteArrayList(); + + const QByteArrayList headersFuncTemplateDef2Decl{R"( +template<typename T> T aFunction(); + +// Function comment +template<typename T> inline T @aFunction() { return T(); } +)", R"( +// Function comment +template<typename T> T aFunction(); + +template<typename T> inline T aFunction() { return T(); } +)"}; + QTest::newRow("function template: from def to decl") << headersFuncTemplateDef2Decl + << QByteArrayList(); + + const QByteArrayList headersMemberDecl2Def{R"( +class C { + // Member function comment + void @aMember(); +)", R"( +class C { + void aMember(); +)"}; + const QByteArrayList sourcesMemberDecl2Def{R"( +#include "file.h" + +void C::aMember() {} +)", R"( +#include "file.h" + +// Member function comment +void C::aMember() {} +)"}; + QTest::newRow("member function: from decl to def") << headersMemberDecl2Def + << sourcesMemberDecl2Def; + + const QByteArrayList headersMemberDef2Decl{R"( +class C { + void aMember(); +)", R"( +class C { + // Member function comment + void aMember(); +)"}; + const QByteArrayList sourcesMemberDef2Decl{R"( +#include "file.h" + +// Member function comment +void C::aMember() {@} +)", R"( +#include "file.h" + +void C::aMember() {} +)"}; + QTest::newRow("member function: from def to decl") << headersMemberDef2Decl + << sourcesMemberDef2Decl; +} + +void QuickfixTest::testMoveComments() +{ + QFETCH(QByteArrayList, headers); + QFETCH(QByteArrayList, sources); + + QList<TestDocumentPtr> documents; + QCOMPARE(headers.size(), 2); + documents << CppTestDocument::create("file.h", headers.at(0), headers.at(1)); + if (!sources.isEmpty()) { + QCOMPARE(sources.size(), 2); + documents << CppTestDocument::create("file.cpp", sources.at(0), sources.at(1)); + } + MoveFunctionComments factory; + QByteArray failMessage; + if (QByteArray(QTest::currentDataTag()) == "function template: from def to decl") + failMessage = "decl/def switch doesn't work for templates"; + QuickFixOperationTest(documents, &factory, {}, {}, failMessage); +} + } // namespace CppEditor::Internal::Tests diff --git a/src/plugins/cppeditor/cppquickfix_test.h b/src/plugins/cppeditor/cppquickfix_test.h index 50dc29a213b..89f05b0f160 100644 --- a/src/plugins/cppeditor/cppquickfix_test.h +++ b/src/plugins/cppeditor/cppquickfix_test.h @@ -224,6 +224,9 @@ private slots: void testChangeCommentType_data(); void testChangeCommentType(); + + void testMoveComments_data(); + void testMoveComments(); }; } // namespace Tests diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 5bf8269af46..a65c9b61a47 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -9542,6 +9542,166 @@ void ConvertCommentStyle::match(const CppQuickFixInterface &interface, result << new ConvertCommentStyleOp(interface, cursorTokens, kind); } +namespace { +class MoveFunctionCommentsOp : public CppQuickFixOperation +{ +public: + enum class Direction { ToDecl, ToDef }; + MoveFunctionCommentsOp(const CppQuickFixInterface &interface, const Symbol *symbol, + const QList<Token> &commentTokens, Direction direction) + : CppQuickFixOperation(interface), m_symbol(symbol), m_commentTokens(commentTokens) + { + setDescription(direction == Direction::ToDecl + ? Tr::tr("Move function documentation to declaration") + : Tr::tr("Move function documentation to definition")); + } + +private: + void perform() override + { + const auto textDoc = const_cast<QTextDocument *>(currentFile()->document()); + const int pos = currentFile()->cppDocument()->translationUnit()->getTokenPositionInDocument( + m_symbol->sourceLocation(), textDoc); + QTextCursor cursor(textDoc); + cursor.setPosition(pos); + const CursorInEditor cursorInEditor(cursor, currentFile()->filePath(), editor(), + editor()->textDocument()); + const auto callback = [symbolLoc = m_symbol->toLink(), comments = m_commentTokens] + (const Link &link) { + moveComments(link, symbolLoc, comments); + }; + CppModelManager::followSymbol(cursorInEditor, callback, true, false); + } + + static void moveComments(const Link &targetLoc, const Link &symbolLoc, + const QList<Token> &comments) + { + if (!targetLoc.hasValidTarget() || targetLoc.hasSameLocation(symbolLoc)) + return; + + CppRefactoringChanges changes(CppModelManager::snapshot()); + const CppRefactoringFilePtr sourceFile = changes.file(symbolLoc.targetFilePath); + const CppRefactoringFilePtr targetFile + = targetLoc.targetFilePath == symbolLoc.targetFilePath + ? sourceFile + : changes.file(targetLoc.targetFilePath); + const Document::Ptr &targetCppDoc = targetFile->cppDocument(); + const QList<AST *> targetAstPath = ASTPath(targetCppDoc)( + targetLoc.targetLine, targetLoc.targetColumn + 1); + if (targetAstPath.isEmpty()) + return; + const AST *targetDeclAst = nullptr; + for (auto it = std::next(std::rbegin(targetAstPath)); + it != std::rend(targetAstPath); ++it) { + AST * const node = *it; + if (node->asDeclaration()) { + targetDeclAst = node; + continue; + } + if (targetDeclAst) + break; + } + if (!targetDeclAst) + return; + const int insertionPos = targetCppDoc->translationUnit()->getTokenPositionInDocument( + targetDeclAst->firstToken(), targetFile->document()); + const TranslationUnit * const sourceTu = sourceFile->cppDocument()->translationUnit(); + const int sourceCommentStartPos = sourceTu->getTokenPositionInDocument( + comments.first(), sourceFile->document()); + const int sourceCommentEndPos = sourceTu->getTokenEndPositionInDocument( + comments.last(), sourceFile->document()); + const QString functionDoc = sourceFile->textOf(sourceCommentStartPos, sourceCommentEndPos); + + // Remove comment plus leading and trailing whitespace, including trailing newline. + const auto removeAtSource = [&](ChangeSet &changeSet) { + int removalPos = sourceCommentStartPos; + const QChar newline(QChar::ParagraphSeparator); + while (true) { + const int prev = removalPos - 1; + if (prev < 0) + break; + const QChar prevChar = sourceFile->charAt(prev); + if (!prevChar.isSpace() || prevChar == newline) + break; + removalPos = prev; + } + int removalEndPos = sourceCommentEndPos; + while (true) { + if (removalEndPos == sourceFile->document()->characterCount()) + break; + const QChar nextChar = sourceFile->charAt(removalEndPos); + if (!nextChar.isSpace()) + break; + ++removalEndPos; + if (nextChar == newline) + break; + } + changeSet.remove(removalPos, removalEndPos); + }; + + ChangeSet targetChangeSet; + targetChangeSet.insert(insertionPos, functionDoc); + targetChangeSet.insert(insertionPos, "\n"); + if (targetFile == sourceFile) + removeAtSource(targetChangeSet); + targetFile->setChangeSet(targetChangeSet); + targetFile->appendIndentRange({insertionPos, insertionPos + int(functionDoc.length())}); + const bool targetFileSuccess = targetFile->apply(); + if (targetFile == sourceFile || !targetFileSuccess) + return; + ChangeSet sourceChangeSet; + removeAtSource(sourceChangeSet); + sourceFile->setChangeSet(sourceChangeSet); + sourceFile->apply(); + } + + const Symbol * const m_symbol; + const QList<Token> m_commentTokens; +}; +} // namespace + +void MoveFunctionComments::match(const CppQuickFixInterface &interface, + TextEditor::QuickFixOperations &result) +{ + const QList<AST *> &astPath = interface.path(); + if (astPath.isEmpty()) + return; + const Symbol *symbol = nullptr; + MoveFunctionCommentsOp::Direction direction = MoveFunctionCommentsOp::Direction::ToDecl; + for (auto it = std::next(std::rbegin(astPath)); it != std::rend(astPath); ++it) { + if (const auto func = (*it)->asFunctionDefinition()) { + symbol = func->symbol; + direction = MoveFunctionCommentsOp::Direction::ToDecl; + break; + } + const auto decl = (*it)->asSimpleDeclaration(); + if (!decl || !decl->declarator_list) + continue; + for (auto it = decl->declarator_list->begin(); + !symbol && it != decl->declarator_list->end(); ++it) { + PostfixDeclaratorListAST * const funcDecls = (*it)->postfix_declarator_list; + if (!funcDecls) + continue; + for (auto it = funcDecls->begin(); it != funcDecls->end(); ++it) { + if (const auto func = (*it)->asFunctionDeclarator()) { + symbol = func->symbol; + direction = MoveFunctionCommentsOp::Direction::ToDef; + break; + } + } + } + + } + if (!symbol) + return; + + if (const QList<Token> commentTokens = commentsForDeclaration( + symbol, *interface.textDocument(), interface.currentFile()->cppDocument()); + !commentTokens.isEmpty()) { + result << new MoveFunctionCommentsOp(interface, symbol, commentTokens, direction); + } +} + void createCppQuickFixes() { new AddIncludeForUndefinedIdentifier; @@ -9599,6 +9759,7 @@ void createCppQuickFixes() new RemoveUsingNamespace; new GenerateConstructor; new ConvertCommentStyle; + new MoveFunctionComments; } void destroyCppQuickFixes() diff --git a/src/plugins/cppeditor/cppquickfixes.h b/src/plugins/cppeditor/cppquickfixes.h index 62e1b1f981c..8825e6df911 100644 --- a/src/plugins/cppeditor/cppquickfixes.h +++ b/src/plugins/cppeditor/cppquickfixes.h @@ -593,5 +593,13 @@ private: TextEditor::QuickFixOperations &result) override; }; +//! Moves function documentation between declaration and implementation. +class MoveFunctionComments : public CppQuickFixFactory +{ +private: + void match(const CppQuickFixInterface &interface, + TextEditor::QuickFixOperations &result) override; +}; + } // namespace Internal } // namespace CppEditor From 9f8998881f921e76c84723ed0e993254c3620e7f Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 1 Sep 2023 13:27:31 +0200 Subject: [PATCH 1023/1777] ProjectExplorer: Do not use the project name in ExpandData Using the node display name for disambiguation was introduced in 62d36ac9a98623aec0d8144ebfd0b73bc31a7c16 for virtual folders. As far as I can tell, those always have different priorities in case of an identical path, so we can use the priority instead of the volatile display name to distinguish nodes with the same file path. This also reverts the workaround from 4e1ff9ed8f2751a63ee7f4d677be6a0abe9d3071. Fixes: QTCREATORBUG-29201 Task-number: QTCREATORBUG-28681 Change-Id: I6cc056789bfb5a7f2666c9163c2687146ccb70f2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/projectexplorer/expanddata.cpp | 14 +++---- src/plugins/projectexplorer/expanddata.h | 4 +- src/plugins/projectexplorer/projectmodels.cpp | 41 +++---------------- 3 files changed, 14 insertions(+), 45 deletions(-) diff --git a/src/plugins/projectexplorer/expanddata.cpp b/src/plugins/projectexplorer/expanddata.cpp index fb84bd0a5f0..d0c776471e1 100644 --- a/src/plugins/projectexplorer/expanddata.cpp +++ b/src/plugins/projectexplorer/expanddata.cpp @@ -8,27 +8,25 @@ using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; -ExpandData::ExpandData(const QString &path_, const QString &displayName_) : - path(path_), displayName(displayName_) -{ } +ExpandData::ExpandData(const QString &path, int priority) : path(path), priority(priority) {} bool ExpandData::operator==(const ExpandData &other) const { - return path == other.path && displayName == other.displayName; + return path == other.path && priority == other.priority; } ExpandData ExpandData::fromSettings(const QVariant &v) { - QStringList list = v.toStringList(); - return list.size() == 2 ? ExpandData(list.at(0), list.at(1)) : ExpandData(); + const QVariantList list = v.toList(); + return list.size() == 2 ? ExpandData(list.at(0).toString(), list.at(1).toInt()) : ExpandData(); } QVariant ExpandData::toSettings() const { - return QVariant::fromValue(QStringList({path, displayName})); + return QVariantList{path, priority}; } size_t ProjectExplorer::Internal::qHash(const ExpandData &data) { - return qHash(data.path) ^ qHash(data.displayName); + return qHash(data.path) ^ data.priority; } diff --git a/src/plugins/projectexplorer/expanddata.h b/src/plugins/projectexplorer/expanddata.h index 3a8a35d9b8a..e8678d2d851 100644 --- a/src/plugins/projectexplorer/expanddata.h +++ b/src/plugins/projectexplorer/expanddata.h @@ -14,14 +14,14 @@ class ExpandData { public: ExpandData() = default; - ExpandData(const QString &path_, const QString &displayName_); + ExpandData(const QString &path, int priority); bool operator==(const ExpandData &other) const; static ExpandData fromSettings(const QVariant &v); QVariant toSettings() const; QString path; - QString displayName; + int priority = 0; }; size_t qHash(const ExpandData &data); diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 90da2076629..0af76f1bbef 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -372,20 +372,15 @@ void FlatModel::addOrRebuildProjectModel(Project *project) container->forAllChildren([this](WrapperNode *node) { if (node->m_node) { - const QString path = node->m_node->filePath().toString(); - const QString displayName = node->m_node->displayName(); - ExpandData ed(path, displayName); - if (m_toExpand.contains(ed)) + if (m_toExpand.contains(expandDataForNode(node->m_node))) emit requestExpansion(node->index()); } else { emit requestExpansion(node->index()); } }); - const QString path = container->m_node->filePath().toString(); - const QString displayName = container->m_node->displayName(); - ExpandData ed(path, displayName); - if (m_toExpand.contains(ed)) + + if (m_toExpand.contains(expandDataForNode(container->m_node))) emit requestExpansion(container->index()); } @@ -424,18 +419,14 @@ void FlatModel::onExpanded(const QModelIndex &idx) ExpandData FlatModel::expandDataForNode(const Node *node) const { - QTC_ASSERT(node, return ExpandData()); - const QString path = node->filePath().toString(); - const QString displayName = node->displayName(); - return ExpandData(path, displayName); + QTC_ASSERT(node, return {}); + return {node->filePath().toString(), node->priority()}; } void FlatModel::handleProjectAdded(Project *project) { QTC_ASSERT(project, return); - auto oldName = project->displayName(); - project->setProperty("_q_oldProjectName", oldName); connect(project, &Project::anyParsingStarted, this, [this, project]() { if (nodeForProject(project)) @@ -443,28 +434,8 @@ void FlatModel::handleProjectAdded(Project *project) }); connect(project, &Project::anyParsingFinished, this, [this, project]() { - auto wrapper = nodeForProject(project); - if (wrapper) { - // In case the project was renamed, change the name in expand data as well - // FIXME: Redesign node expansion so that it does not rely on display name of a node - auto oldName = project->property("_q_oldProjectName").toString(); - auto currentName = project->displayName(); - if (oldName != currentName) { - project->setProperty("_q_oldProjectName", currentName); - auto node = wrapper->m_node; - ExpandData oldData(node->filePath().toString(), oldName); - ExpandData newData(oldData.path, currentName); - auto it = m_toExpand.find(oldData); - if (it != m_toExpand.end()) { - m_toExpand.erase(it); - m_toExpand.insert(newData); - emit requestExpansion(wrapper->index()); - } else if (m_toExpand.contains(newData)) { - emit requestExpansion(wrapper->index()); - } - } + if (nodeForProject(project)) parsingStateChanged(project); - } emit ProjectTree::instance()->nodeActionsChanged(); }); addOrRebuildProjectModel(project); From 3331c8401678a866f96210b63593fa09d55726af Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 4 Sep 2023 14:15:18 +0200 Subject: [PATCH 1024/1777] ProjectExplorer: Do not access mime database during startup Initializing the database takes time, that we do not need to spend at that point. Change-Id: Ieb9105916b3b7cf3a373d6df58ac2ee5668ef40f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../projectexplorer/projectexplorer.cpp | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index d2f78d5b8b5..7068ff02a28 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -516,6 +516,8 @@ public: void extendFolderNavigationWidgetFactory(); + QString projectFilterString() const; + public: QMenu *m_openWithMenu; QMenu *m_openTerminalMenu; @@ -601,7 +603,6 @@ public: FilePath m_lastOpenDirectory; QPointer<RunConfiguration> m_defaultRunConfiguration; QPointer<RunConfiguration> m_delayedRunConfiguration; - QString m_projectFilterString; MiniProjectTargetSelector * m_targetSelector; ProjectExplorerSettings m_projectExplorerSettings; QList<CustomParserSettings> m_customParsers; @@ -1968,8 +1969,9 @@ void ProjectExplorerPluginPrivate::loadAction() } FilePath filePath = Utils::FileUtils::getOpenFilePath(ICore::dialogParent(), - Tr::tr("Load Project"), dir, - dd->m_projectFilterString); + Tr::tr("Load Project"), + dir, + dd->projectFilterString()); if (filePath.isEmpty()) return; @@ -2050,10 +2052,6 @@ void ProjectExplorerPlugin::extensionsInitialized() JsonWizardFactory::createWizardFactories(); // Register factories for all project managers - QStringList allGlobPatterns; - - const QString filterSeparator = QLatin1String(";;"); - QStringList filterStrings; dd->m_documentFactory.setOpener([](FilePath filePath) { if (filePath.isDir()) { @@ -2072,9 +2070,6 @@ void ProjectExplorerPlugin::extensionsInitialized() for (auto it = dd->m_projectCreators.cbegin(); it != dd->m_projectCreators.cend(); ++it) { const QString &mimeType = it.key(); dd->m_documentFactory.addMimeType(mimeType); - MimeType mime = Utils::mimeTypeForName(mimeType); - allGlobPatterns.append(mime.globPatterns()); - filterStrings.append(mime.filterString()); dd->m_profileMimeTypes += mimeType; } @@ -2083,12 +2078,6 @@ void ProjectExplorerPlugin::extensionsInitialized() return TaskFile::openTasks(filePath); }); - QString allProjectsFilter = Tr::tr("All Projects"); - allProjectsFilter += QLatin1String(" (") + allGlobPatterns.join(QLatin1Char(' ')) - + QLatin1Char(')'); - filterStrings.prepend(allProjectsFilter); - dd->m_projectFilterString = filterStrings.join(filterSeparator); - BuildManager::extensionsInitialized(); TaskHub::addCategory({Constants::TASK_CATEGORY_SANITIZER, Tr::tr("Sanitizer", "Category for sanitizer issues listed under 'Issues'"), @@ -2790,6 +2779,24 @@ void ProjectExplorerPluginPrivate::extendFolderNavigationWidgetFactory() }); } +QString ProjectExplorerPluginPrivate::projectFilterString() const +{ + const QString filterSeparator = QLatin1String(";;"); + QStringList filterStrings; + QStringList allGlobPatterns; + for (auto it = m_projectCreators.cbegin(); it != m_projectCreators.cend(); ++it) { + const QString &mimeType = it.key(); + MimeType mime = Utils::mimeTypeForName(mimeType); + allGlobPatterns.append(mime.globPatterns()); + filterStrings.append(mime.filterString()); + } + QString allProjectsFilter = Tr::tr("All Projects"); + allProjectsFilter += QLatin1String(" (") + allGlobPatterns.join(QLatin1Char(' ')) + + QLatin1Char(')'); + filterStrings.prepend(allProjectsFilter); + return filterStrings.join(filterSeparator); +} + void ProjectExplorerPluginPrivate::runProjectContextMenu(RunConfiguration *rc) { const Node *node = ProjectTree::currentNode(); @@ -3991,7 +3998,7 @@ void ProjectExplorerPlugin::openOpenProjectDialog() const FilePath path = DocumentManager::useProjectsDirectory() ? DocumentManager::projectsDirectory() : FilePath(); - const FilePaths files = DocumentManager::getOpenFileNames(dd->m_projectFilterString, path); + const FilePaths files = DocumentManager::getOpenFileNames(dd->projectFilterString(), path); if (!files.isEmpty()) ICore::openFiles(files, ICore::SwitchMode); } From efb4b9ad5fd9101f66155a8fc54397cce7509d88 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 5 Sep 2023 18:39:26 +0200 Subject: [PATCH 1025/1777] ScreenRecorder: Fix multiscreen handling when recording on Linux The original approach of using Qt's "screen ID" as screen identifier for ffmpeg does not work with the x11grab filter. x11grab requires the identifier as defined in the DISPLAY environment variable, which it receives now with this change. x11grab grabs all screen contents in one big image image, so we need to crop accordingly to get the content from the screen which the user chose. Qt's QScreen API helps us with determining the right geometries. Change-Id: I84a1686b151b7cb0aced09bc427114e0e9aa08bf Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> --- src/plugins/screenrecorder/record.cpp | 32 +++++++++++++++++---------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index fe6c6911813..62db3bad212 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -8,6 +8,7 @@ #include "screenrecordersettings.h" #include "screenrecordertr.h" +#include <utils/environment.h> #include <utils/fileutils.h> #include <utils/layoutbuilder.h> #include <utils/process.h> @@ -292,32 +293,39 @@ QString RecordWidget::recordFileExtension() return recordPreset().fileExtension; } +static QString sizeStr(const QSize &size) +{ + return QString("%1x%2").arg(size.width()).arg(size.height()); +} + QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const { const Internal::ScreenRecorderSettings::RecordSettings rS = Internal::settings().recordSettings(); const QString frameRateStr = QString::number(rS.frameRate); const QString screenIdStr = QString::number(rS.screenId); - const QString videoSizeStr = QString("%1x%2").arg(rS.cropRect.width()) - .arg(rS.cropRect.height()); QStringList videoGrabParams; // see http://trac.ffmpeg.org/wiki/Capture/Desktop switch (HostOsInfo::hostOs()) { - case OsTypeLinux: + case OsTypeLinux: { + const QScreen *screen = QGuiApplication::screens()[rS.screenId]; + const QPoint screenTopLeft = screen->geometry().topLeft(); + const QRect cropRect = rS.cropRect.translated(screenTopLeft); + const QString x11display = qtcEnvironmentVariable("DISPLAY", ":0.0"); + const QString videoSize = sizeStr(rS.cropRect.isNull() + ? screen->size() * screen->devicePixelRatio() + : rS.cropRect.size()); videoGrabParams.append({"-f", "x11grab"}); videoGrabParams.append({"-framerate", frameRateStr}); - if (!rS.cropRect.isNull()) { - videoGrabParams.append({"-video_size", videoSizeStr}); - videoGrabParams.append({"-i", QString(":%1.0+%2,%3").arg(screenIdStr) - .arg(rS.cropRect.x()).arg(rS.cropRect.y())}); - } else { - videoGrabParams.append({"-i", QString(":%1.0").arg(screenIdStr)}); - } + videoGrabParams.append({"-video_size", videoSize}); + videoGrabParams.append({"-i", QString("%1+%2,%3").arg(x11display) + .arg(cropRect.x()).arg(cropRect.y())}); break; + } case OsTypeWindows: { QString filter = "ddagrab=output_idx=" + screenIdStr; if (!rS.cropRect.isNull()) { - filter.append(":video_size=" + videoSizeStr); + filter.append(":video_size=" + sizeStr(rS.cropRect.size())); filter.append(QString(":offset_x=%1:offset_y=%2").arg(rS.cropRect.x()) .arg(rS.cropRect.y())); } @@ -334,7 +342,7 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const videoGrabParams = { "-f", "avfoundation", "-framerate", frameRateStr, - "-video_size", videoSizeStr, + "-video_size", sizeStr(rS.cropRect.size()), "-i", QString("%1:none").arg(screenIdStr), }; break; From 445501e29e99d8dce66aa54bf18e90d2d0db4413 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 5 Sep 2023 15:34:14 +0200 Subject: [PATCH 1026/1777] LanguageServerProtocol: allow RegistrationOptions in definitionProvider Change-Id: I9868a777fc7ef078ab87fea823d5e9557c87ca78 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../servercapabilities.cpp | 18 ++++++++++++++++++ .../servercapabilities.h | 12 +++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/libs/languageserverprotocol/servercapabilities.cpp b/src/libs/languageserverprotocol/servercapabilities.cpp index 1c0d322e6e7..885198d12e8 100644 --- a/src/libs/languageserverprotocol/servercapabilities.cpp +++ b/src/libs/languageserverprotocol/servercapabilities.cpp @@ -51,6 +51,24 @@ void ServerCapabilities::setHoverProvider( insertVariant<bool, WorkDoneProgressOptions>(hoverProviderKey, hoverProvider); } +std::optional<std::variant<bool, ServerCapabilities::RegistrationOptions>> +ServerCapabilities::definitionProvider() const +{ + using RetType = std::variant<bool, ServerCapabilities::RegistrationOptions>; + const QJsonValue &provider = value(definitionProviderKey); + if (provider.isUndefined() || !(provider.isBool() || provider.isObject())) + return std::nullopt; + return std::make_optional(provider.isBool() + ? RetType(provider.toBool()) + : RetType(RegistrationOptions(provider.toObject()))); +} + +void ServerCapabilities::setDefinitionProvider( + const std::variant<bool, RegistrationOptions> &definitionProvider) +{ + insertVariant<bool, RegistrationOptions>(definitionProviderKey, definitionProvider); +} + std::optional<std::variant<bool, ServerCapabilities::RegistrationOptions>> ServerCapabilities::typeDefinitionProvider() const { diff --git a/src/libs/languageserverprotocol/servercapabilities.h b/src/libs/languageserverprotocol/servercapabilities.h index bacddda19e6..c3b50dd5904 100644 --- a/src/libs/languageserverprotocol/servercapabilities.h +++ b/src/libs/languageserverprotocol/servercapabilities.h @@ -269,13 +269,6 @@ public: { insert(signatureHelpProviderKey, signatureHelpProvider); } void clearSignatureHelpProvider() { remove(signatureHelpProviderKey); } - // The server provides goto definition support. - std::optional<bool> definitionProvider() const - { return optionalValue<bool>(definitionProviderKey); } - void setDefinitionProvider(bool definitionProvider) - { insert(definitionProviderKey, definitionProvider); } - void clearDefinitionProvider() { remove(definitionProviderKey); } - class LANGUAGESERVERPROTOCOL_EXPORT RegistrationOptions : public JsonObject { public: @@ -298,6 +291,11 @@ public: bool isValid() const override { return contains(documentSelectorKey); } }; + // The server provides goto definition support. + std::optional<std::variant<bool, RegistrationOptions>> definitionProvider() const; + void setDefinitionProvider(const std::variant<bool, RegistrationOptions> &typeDefinitionProvider); + void clearDefinitionProvider() { remove(typeDefinitionProviderKey); } + // The server provides Goto Type Definition support. std::optional<std::variant<bool, RegistrationOptions>> typeDefinitionProvider() const; void setTypeDefinitionProvider(const std::variant<bool, RegistrationOptions> &typeDefinitionProvider); From 03e50d4d7aa62dc1a225bcf79689e1a4dfdf72fe Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 7 Sep 2023 13:38:03 +0200 Subject: [PATCH 1027/1777] Python: fix unguarded optional access Change-Id: I4131343aab2f193336e81f2e76cbb95ef3ff2805 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/python/pyside.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/python/pyside.cpp b/src/plugins/python/pyside.cpp index a2f1cac2fc1..896620ae32e 100644 --- a/src/plugins/python/pyside.cpp +++ b/src/plugins/python/pyside.cpp @@ -104,7 +104,7 @@ void PySideInstaller::installPyside(const FilePath &python, if (success) emit pySideInstalled(python, pySide); }); - if (qtInstallDir->isEmpty()) { + if (availablePySides.isEmpty()) { install->setPackages({PipPackage(pySide)}); } else { QDialog dialog; @@ -113,7 +113,7 @@ void PySideInstaller::installPyside(const FilePath &python, dialog.layout()->addWidget(new QLabel(Tr::tr("Select which PySide version to install:"))); QComboBox *pySideSelector = new QComboBox(); pySideSelector->addItem(Tr::tr("Latest PySide from the Python Package Index")); - for (const Utils::FilePath &version : availablePySides) { + for (const Utils::FilePath &version : std::as_const(availablePySides)) { const FilePath dir = version.parentDir(); const QString text = Tr::tr("PySide %1 wheel (%2)").arg(dir.fileName(), dir.toUserOutput()); From f4e50126b1062872aa01e4a5fd29e69ad0f82830 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 7 Sep 2023 14:06:37 +0200 Subject: [PATCH 1028/1777] Core: Add clearAboutInformation function Change-Id: Ib6dcc3b963917c096756cbff09541f4e13c8184b Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/icore.cpp | 8 ++++++++ src/plugins/coreplugin/icore.h | 1 + src/plugins/coreplugin/mainwindow.cpp | 5 +++++ src/plugins/coreplugin/mainwindow.h | 1 + 4 files changed, 15 insertions(+) diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 2e9cf7657cc..7128b79ee3f 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -938,6 +938,14 @@ QStringList ICore::additionalAboutInformation() return m_mainwindow->additionalAboutInformation(); } +/*! + \internal +*/ +void ICore::clearAboutInformation() +{ + m_mainwindow->clearAboutInformation(); +} + /*! \internal */ diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index f595fb4ba88..9192012b0b5 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -135,6 +135,7 @@ signals: public: /* internal use */ static QStringList additionalAboutInformation(); + static void clearAboutInformation(); static void appendAboutInformation(const QString &line); static QString systemInformation(); static void setupScreenShooter(const QString &name, QWidget *w, const QRect &rc = QRect()); diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 9f1043146c2..b4f55b54145 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -240,6 +240,11 @@ QStringList MainWindow::additionalAboutInformation() const return m_aboutInformation; } +void MainWindow::clearAboutInformation() +{ + m_aboutInformation.clear(); +} + void MainWindow::appendAboutInformation(const QString &line) { m_aboutInformation.append(line); diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index 0755fae3e45..fc15543d27a 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -83,6 +83,7 @@ public: void setOverrideColor(const QColor &color); QStringList additionalAboutInformation() const; + void clearAboutInformation(); void appendAboutInformation(const QString &line); void addPreCloseListener(const std::function<bool()> &listener); From 82daa08a7ea1f99bc89654c709ff1c6a4d1925ce Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 6 Sep 2023 23:04:59 +0200 Subject: [PATCH 1029/1777] ScreenRecorder: Support recording on macOS Change-Id: I1f5429939acf82235caf07af85ab3397aee5955d Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/screenrecorder/record.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index 62db3bad212..d60501e092a 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -338,14 +338,22 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const }; break; } - case OsTypeMac: + case OsTypeMac: { videoGrabParams = { "-f", "avfoundation", "-framerate", frameRateStr, - "-video_size", sizeStr(rS.cropRect.size()), - "-i", QString("%1:none").arg(screenIdStr), + "-pixel_format", "bgr0", + "-i", QString("Capture screen %1:none").arg(rS.screenId), }; + if (!rS.cropRect.isNull()) { + videoGrabParams.append({ + "-filter_complex", QString("crop=x=%1:y=%2:w=%3:h=%4") + .arg(rS.cropRect.x()).arg(rS.cropRect.y()) + .arg(rS.cropRect.width()).arg(rS.cropRect.height()) + }); + } break; + } default: break; } From 3c3a9f6786610e0c1975563e8a36276ccb61d116 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 7 Sep 2023 14:41:51 +0200 Subject: [PATCH 1030/1777] Improve sorting in Kit-related settings tabs - Use a proper sort model in the Kits settings widgets, so kits will not just initially be sorted. - Handle the top-level nodes in a special way, as not to rely on "Auto-detected" coming before "Manual" in all languages. Change-Id: I1eb8e1bee6836b47164d76b49435f8ff5120bb14 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/utils/treemodel.cpp | 2 +- src/libs/utils/treemodel.h | 3 +- .../projectexplorer/kitoptionspage.cpp | 39 ++++++++++++++----- src/plugins/projectexplorer/kitoptionspage.h | 20 +++++++++- .../projectexplorer/toolchainoptionspage.cpp | 3 +- src/plugins/qtsupport/qtoptionspage.cpp | 5 ++- 6 files changed, 55 insertions(+), 17 deletions(-) diff --git a/src/libs/utils/treemodel.cpp b/src/libs/utils/treemodel.cpp index 1c82ac0244a..fe96b9c83e4 100644 --- a/src/libs/utils/treemodel.cpp +++ b/src/libs/utils/treemodel.cpp @@ -1203,7 +1203,7 @@ Qt::ItemFlags StaticTreeItem::flags(int column) const bool SortModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const { if (m_lessThan) - return lessThan(source_left, source_right); + return m_lessThan(source_left, source_right); return caseFriendlyCompare(sourceModel()->data(source_left).toString(), sourceModel()->data(source_right).toString()) < 0; } diff --git a/src/libs/utils/treemodel.h b/src/libs/utils/treemodel.h index 8fe66d61d45..a8cc073fcff 100644 --- a/src/libs/utils/treemodel.h +++ b/src/libs/utils/treemodel.h @@ -352,9 +352,10 @@ public: using LessThan = std::function<bool(const QModelIndex &, const QModelIndex &)>; void setLessThan(const LessThan &lessThan) { m_lessThan = lessThan; } -private: +protected: bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; +private: LessThan m_lessThan; }; diff --git a/src/plugins/projectexplorer/kitoptionspage.cpp b/src/plugins/projectexplorer/kitoptionspage.cpp index 6f7b4655b9c..f48361ef27f 100644 --- a/src/plugins/projectexplorer/kitoptionspage.cpp +++ b/src/plugins/projectexplorer/kitoptionspage.cpp @@ -1,6 +1,8 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#include "kitoptionspage.h" + #include "filterkitaspectsdialog.h" #include "kit.h" #include "kitmanager.h" @@ -13,7 +15,6 @@ #include <utils/algorithm.h> #include <utils/id.h> #include <utils/qtcassert.h> -#include <utils/treemodel.h> #include <utils/utilsicons.h> #include <QApplication> @@ -27,7 +28,19 @@ using namespace Utils; -namespace ProjectExplorer::Internal { +namespace ProjectExplorer { + +bool KitSettingsSortModel::lessThan(const QModelIndex &source_left, + const QModelIndex &source_right) const +{ + if (!source_left.parent().isValid()) { + QTC_CHECK(!source_right.parent().isValid()); + return sourceModel()->data(source_left) == Constants::msgAutoDetected(); + } + return SortModel::lessThan(source_left, source_right); +} + +namespace Internal { // Page pre-selection @@ -473,6 +486,7 @@ public: QPushButton *m_defaultFilterButton = nullptr; KitModel *m_model = nullptr; + KitSettingsSortModel *m_sortModel = nullptr; QItemSelectionModel *m_selectionModel = nullptr; KitManagerConfigWidget *m_currentWidget = nullptr; }; @@ -517,10 +531,14 @@ KitOptionsPageWidget::KitOptionsPageWidget() this, &KitOptionsPageWidget::updateState); verticalLayout->setStretch(0, 1); verticalLayout->setStretch(1, 0); + m_sortModel = new KitSettingsSortModel(this); + m_sortModel->setSourceModel(m_model); - m_kitsView->setModel(m_model); + m_kitsView->setModel(m_sortModel); m_kitsView->header()->setSectionResizeMode(0, QHeaderView::Stretch); m_kitsView->expandAll(); + m_kitsView->setSortingEnabled(true); + m_kitsView->sortByColumn(0, Qt::AscendingOrder); m_selectionModel = m_kitsView->selectionModel(); connect(m_selectionModel, &QItemSelectionModel::selectionChanged, @@ -564,7 +582,7 @@ KitOptionsPageWidget::KitOptionsPageWidget() void KitOptionsPageWidget::scrollToSelectedKit() { - QModelIndex index = m_model->indexOf(selectedKitId); + QModelIndex index = m_sortModel->mapFromSource(m_model->indexOf(selectedKitId)); m_selectionModel->select(index, QItemSelectionModel::Clear | QItemSelectionModel::SelectCurrent @@ -575,7 +593,7 @@ void KitOptionsPageWidget::scrollToSelectedKit() void KitOptionsPageWidget::kitSelectionChanged() { QModelIndex current = currentIndex(); - KitManagerConfigWidget * const newWidget = m_model->widget(current); + KitManagerConfigWidget * const newWidget = m_model->widget(m_sortModel->mapToSource(current)); if (newWidget == m_currentWidget) return; @@ -596,7 +614,7 @@ void KitOptionsPageWidget::addNewKit() { Kit *k = m_model->markForAddition(nullptr); - QModelIndex newIdx = m_model->indexOf(k); + QModelIndex newIdx = m_sortModel->mapFromSource(m_model->indexOf(k)); m_selectionModel->select(newIdx, QItemSelectionModel::Clear | QItemSelectionModel::SelectCurrent @@ -605,7 +623,7 @@ void KitOptionsPageWidget::addNewKit() Kit *KitOptionsPageWidget::currentKit() const { - return m_model->kit(currentIndex()); + return m_model->kit(m_sortModel->mapToSource(currentIndex())); } void KitOptionsPageWidget::cloneKit() @@ -615,7 +633,7 @@ void KitOptionsPageWidget::cloneKit() return; Kit *k = m_model->markForAddition(current); - QModelIndex newIdx = m_model->indexOf(k); + QModelIndex newIdx = m_sortModel->mapFromSource(m_model->indexOf(k)); m_kitsView->scrollTo(newIdx); m_selectionModel->select(newIdx, QItemSelectionModel::Clear @@ -631,7 +649,7 @@ void KitOptionsPageWidget::removeKit() void KitOptionsPageWidget::makeDefaultKit() { - m_model->setDefaultKit(currentIndex()); + m_model->setDefaultKit(m_sortModel->mapToSource(currentIndex())); updateState(); } @@ -706,6 +724,7 @@ public: const KitsSettingsPage theKitsSettingsPage; -} // ProjectExplorer::Internal +} // Internal +} // ProjectExplorer #include "kitoptionspage.moc" diff --git a/src/plugins/projectexplorer/kitoptionspage.h b/src/plugins/projectexplorer/kitoptionspage.h index ae8d42e88dc..297d3e766b5 100644 --- a/src/plugins/projectexplorer/kitoptionspage.h +++ b/src/plugins/projectexplorer/kitoptionspage.h @@ -3,10 +3,26 @@ #pragma once +#include "projectexplorer_export.h" + +#include <utils/treemodel.h> + namespace Utils { class Id; } -namespace ProjectExplorer::Internal { +namespace ProjectExplorer { + +class PROJECTEXPLORER_EXPORT KitSettingsSortModel : public Utils::SortModel +{ +public: + using SortModel::SortModel; + +private: + bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; +}; + +namespace Internal { void setSelectectKitId(const Utils::Id &kitId); -} // ProjectExplorer::Internal +} // Internal +} // ProjectExplorer diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index 775611bd1da..237b9ff8921 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -5,6 +5,7 @@ #include "abi.h" #include "devicesupport/devicemanager.h" +#include "kitoptionspage.h" #include "projectexplorerconstants.h" #include "projectexplorertr.h" #include "toolchain.h" @@ -317,7 +318,7 @@ public: private: TreeModel<TreeItem, ToolChainTreeItem> m_model; - SortModel m_sortModel; + KitSettingsSortModel m_sortModel; QList<ToolChainFactory *> m_factories; QTreeView *m_toolChainView; DetailsWidget *m_container; diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 1efedb700ec..ef5960a7629 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -14,6 +14,7 @@ #include <coreplugin/icore.h> #include <coreplugin/progressmanager/progressmanager.h> +#include <projectexplorer/kitoptionspage.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorericons.h> #include <projectexplorer/toolchain.h> @@ -196,7 +197,7 @@ private: void updateVersionItem(QtVersionItem *item); TreeModel<TreeItem, TreeItem, QtVersionItem> *m_model; - SortModel *m_filterModel; + KitSettingsSortModel *m_filterModel; TreeItem *m_autoItem; TreeItem *m_manualItem; @@ -313,7 +314,7 @@ QtOptionsPageWidget::QtOptionsPageWidget() m_model->rootItem()->appendChild(m_autoItem); m_model->rootItem()->appendChild(m_manualItem); - m_filterModel = new SortModel(this); + m_filterModel = new KitSettingsSortModel(this); m_filterModel->setSourceModel(m_model); m_qtdirList->setModel(m_filterModel); From a6e779606db6c8536c715470ddb73f10c7431e8b Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 15 Aug 2023 18:06:29 +0200 Subject: [PATCH 1031/1777] Core: Add action to hide the menu bar This will only affect the platforms that do not have a native menu bar e.g. Windows and Linux excepting Unity. Fixes: QTCREATORBUG-29498 Change-Id: I17a654cfa50342f3e506bf0a2b14225c4d3a6bee Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/coreplugin/coreconstants.h | 1 + src/plugins/coreplugin/mainwindow.cpp | 34 ++++++++++++++++++++++++++ src/plugins/coreplugin/mainwindow.h | 1 + 3 files changed, 36 insertions(+) diff --git a/src/plugins/coreplugin/coreconstants.h b/src/plugins/coreplugin/coreconstants.h index 2606628d266..a259717ba89 100644 --- a/src/plugins/coreplugin/coreconstants.h +++ b/src/plugins/coreplugin/coreconstants.h @@ -86,6 +86,7 @@ const char OPTIONS[] = "QtCreator.Options"; const char LOGGER[] = "QtCreator.Logger"; const char TOGGLE_LEFT_SIDEBAR[] = "QtCreator.ToggleLeftSidebar"; const char TOGGLE_RIGHT_SIDEBAR[] = "QtCreator.ToggleRightSidebar"; +const char TOGGLE_MENUBAR[] = "QtCreator.ToggleMenubar"; const char CYCLE_MODE_SELECTOR_STYLE[] = "QtCreator.CycleModeSelectorStyle"; const char TOGGLE_FULLSCREEN[] = "QtCreator.ToggleFullScreen"; diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index b4f55b54145..de58123bdf8 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -60,6 +60,7 @@ #include <utils/stylehelper.h> #include <utils/theme/theme.h> #include <utils/touchbar/touchbar.h> +#include <utils/checkablemessagebox.h> #include <utils/terminalcommand.h> #include <utils/utilsicons.h> @@ -106,6 +107,7 @@ static const char colorKey[] = "Color"; static const char windowGeometryKey[] = "WindowGeometry"; static const char windowStateKey[] = "WindowState"; static const char modeSelectorLayoutKey[] = "ModeSelectorLayout"; +static const char menubarVisibleKey[] = "MenubarVisible"; static const bool askBeforeExitDefault = false; @@ -833,6 +835,27 @@ void MainWindow::registerDefaultActions() mview->addAction(cmd, Constants::G_VIEW_VIEWS); m_toggleRightSideBarButton->setEnabled(false); + // Show Menubar Action + if (menuBar() && !menuBar()->isNativeMenuBar()) { + m_toggleMenubarAction = new QAction(Tr::tr("Show Menubar"), this); + m_toggleMenubarAction->setCheckable(true); + cmd = ActionManager::registerAction(m_toggleMenubarAction, Constants::TOGGLE_MENUBAR); + cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Alt+M"))); + connect(m_toggleMenubarAction, &QAction::toggled, this, [this, cmd](bool visible) { + if (!visible) { + CheckableMessageBox::information( + Core::ICore::dialogParent(), + Tr::tr("Hide Menubar"), + Tr::tr( + "This will hide the menu bar completely. You can show it again by typing ") + + cmd->keySequence().toString(QKeySequence::NativeText), + QString("ToogleMenuBarHint")); + } + menuBar()->setVisible(visible); + }); + mview->addAction(cmd, Constants::G_VIEW_VIEWS); + } + registerModeSelectorStyleActions(); // Window->Views @@ -1184,6 +1207,14 @@ void MainWindow::readSettings() updateModeSelectorStyleMenu(); } + if (menuBar() && !menuBar()->isNativeMenuBar()) { + const bool isVisible = settings->value(menubarVisibleKey, true).toBool(); + + menuBar()->setVisible(isVisible); + if (m_toggleMenubarAction) + m_toggleMenubarAction->setChecked(isVisible); + } + settings->endGroup(); EditorManagerPrivate::readSettings(); @@ -1202,6 +1233,9 @@ void MainWindow::saveSettings() StyleHelper::requestedBaseColor(), QColor(StyleHelper::DEFAULT_BASE_COLOR)); + if (menuBar() && !menuBar()->isNativeMenuBar()) + settings->setValue(menubarVisibleKey, menuBar()->isVisible()); + settings->endGroup(); DocumentManager::saveSettings(); diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index fc15543d27a..325176a5825 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -174,6 +174,7 @@ private: QAction *m_loggerAction = nullptr; QAction *m_toggleLeftSideBarAction = nullptr; QAction *m_toggleRightSideBarAction = nullptr; + QAction *m_toggleMenubarAction = nullptr; QAction *m_cycleModeSelectorStyleAction = nullptr; QAction *m_setModeSelectorStyleIconsAndTextAction = nullptr; QAction *m_setModeSelectorStyleHiddenAction = nullptr; From 322336a488eac8e2a6435f3adb3225c77ee4d238 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 23 Aug 2023 15:59:38 +0200 Subject: [PATCH 1032/1777] AutoTest: Speed up scanning for tests Especially Qt and Quick tests scanning takes some time, so do some additional pre-filtering of files before parsing them to reduce the number of files to process. Depending on the structure of the project this can significantly reduce the scan time. Task-number: QTCREATORBUG-29301 Change-Id: I629beedcc02502d98d84e29282e1cd7b265cfcf0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/autotest/itestparser.cpp | 26 +++++++++++++++++++ src/plugins/autotest/itestparser.h | 5 ++++ src/plugins/autotest/qtest/qttestparser.cpp | 10 +++++++ src/plugins/autotest/qtest/qttestparser.h | 1 + .../autotest/quick/quicktestparser.cpp | 15 ++++++++--- src/plugins/autotest/quick/quicktestparser.h | 1 + 6 files changed, 54 insertions(+), 4 deletions(-) diff --git a/src/plugins/autotest/itestparser.cpp b/src/plugins/autotest/itestparser.cpp index 99b760f78bd..9438fe4caf1 100644 --- a/src/plugins/autotest/itestparser.cpp +++ b/src/plugins/autotest/itestparser.cpp @@ -5,6 +5,7 @@ #include <coreplugin/editormanager/editormanager.h> #include <cppeditor/cppmodelmanager.h> +#include <projectexplorer/projectmanager.h> #include <utils/textfileformat.h> #include <utils/algorithm.h> @@ -105,6 +106,31 @@ bool CppParser::precompiledHeaderContains(const CPlusPlus::Snapshot &snapshot, }); } +std::optional<QSet<FilePath>> CppParser::filesContainingMacro(const QByteArray ¯oName) +{ + // safety net to avoid adding some option + static const bool noPrefilter = qtcEnvironmentVariableIsSet("QTC_AUTOTEST_DISABLE_PREFILTER"); + if (noPrefilter) + return std::nullopt; + + QSet<FilePath> result; + CppEditor::ProjectInfo::ConstPtr infos = CppEditor::CppModelManager::projectInfo( + ProjectExplorer::ProjectManager::startupProject()); + if (!infos) + return std::nullopt; + + const auto projectParts = infos->projectParts(); + for (const auto &pp : projectParts) { + if (!pp->selectedForBuilding) + continue; + + const ProjectExplorer::Macros macros = pp->projectMacros; + if (Utils::anyOf(pp->projectMacros, Utils::equal(&ProjectExplorer::Macro::key, macroName))) + result.unite(Utils::transform<QSet>(pp->files, &CppEditor::ProjectFile::path)); + } + return std::make_optional(result); +} + void CppParser::release() { m_cppSnapshot = CPlusPlus::Snapshot(); diff --git a/src/plugins/autotest/itestparser.h b/src/plugins/autotest/itestparser.h index 93233bd7a97..6e3305dd6ea 100644 --- a/src/plugins/autotest/itestparser.h +++ b/src/plugins/autotest/itestparser.h @@ -9,6 +9,8 @@ #include <cppeditor/cppworkingcopy.h> #include <qmljs/qmljsdocument.h> +#include <optional> + QT_BEGIN_NAMESPACE template <class T> class QPromise; @@ -76,6 +78,9 @@ public: static bool precompiledHeaderContains(const CPlusPlus::Snapshot &snapshot, const Utils::FilePath &filePath, const QRegularExpression &headerFileRegex); + // returns all files of the startup project whose ProjectPart has the given \a macroName + // set as a project define + static std::optional<QSet<Utils::FilePath>> filesContainingMacro(const QByteArray ¯oName); protected: CPlusPlus::Snapshot m_cppSnapshot; diff --git a/src/plugins/autotest/qtest/qttestparser.cpp b/src/plugins/autotest/qtest/qttestparser.cpp index 824f4860a45..a74944b7b64 100644 --- a/src/plugins/autotest/qtest/qttestparser.cpp +++ b/src/plugins/autotest/qtest/qttestparser.cpp @@ -295,6 +295,9 @@ static bool isQObject(const CPlusPlus::Document::Ptr &declaringDoc) bool QtTestParser::processDocument(QPromise<TestParseResultPtr> &promise, const FilePath &fileName) { + if (!m_prefilteredFiles.contains(fileName)) + return false; + CPlusPlus::Document::Ptr doc = document(fileName); if (doc.isNull()) return false; @@ -418,6 +421,12 @@ void QtTestParser::init(const QSet<FilePath> &filesToParse, bool fullParse) m_testCases = QTestUtils::testCaseNamesForFiles(framework(), filesToParse); m_alternativeFiles = QTestUtils::alternativeFiles(framework(), filesToParse); } + + if (std::optional<QSet<Utils::FilePath>> prefiltered = filesContainingMacro("QT_TESTLIB_LIB")) + m_prefilteredFiles = prefiltered->intersect(filesToParse); + else + m_prefilteredFiles = filesToParse; + CppParser::init(filesToParse, fullParse); } @@ -425,6 +434,7 @@ void QtTestParser::release() { m_testCases.clear(); m_alternativeFiles.clear(); + m_prefilteredFiles.clear(); CppParser::release(); } diff --git a/src/plugins/autotest/qtest/qttestparser.h b/src/plugins/autotest/qtest/qttestparser.h index ece2bc639c5..9f8c44593f0 100644 --- a/src/plugins/autotest/qtest/qttestparser.h +++ b/src/plugins/autotest/qtest/qttestparser.h @@ -57,6 +57,7 @@ private: const QString &projectFile) const; QHash<Utils::FilePath, TestCases> m_testCases; QMultiHash<Utils::FilePath, Utils::FilePath> m_alternativeFiles; + QSet<Utils::FilePath> m_prefilteredFiles; }; } // namespace Internal diff --git a/src/plugins/autotest/quick/quicktestparser.cpp b/src/plugins/autotest/quick/quicktestparser.cpp index eaba2299588..ef0bba8cc89 100644 --- a/src/plugins/autotest/quick/quicktestparser.cpp +++ b/src/plugins/autotest/quick/quicktestparser.cpp @@ -28,8 +28,7 @@ using namespace QmlJS; using namespace Utils; -namespace Autotest { -namespace Internal { +namespace Autotest::Internal { TestTreeItem *QuickTestParseResult::createTestTreeItem() const { @@ -359,6 +358,11 @@ void QuickTestParser::init(const QSet<FilePath> &filesToParse, bool fullParse) m_checkForDerivedTests = theQtTestFramework().quickCheckForDerivedTests(); + if (std::optional<QSet<Utils::FilePath>> prefiltered = filesContainingMacro("QT_QMLTEST_LIB")) + m_prefilteredFiles = prefiltered->intersect(filesToParse); + else + m_prefilteredFiles = filesToParse; + CppParser::init(filesToParse, fullParse); } @@ -366,6 +370,7 @@ void QuickTestParser::release() { m_qmlSnapshot = Snapshot(); m_proFilesForQmlFiles.clear(); + m_prefilteredFiles.clear(); CppParser::release(); } @@ -384,6 +389,9 @@ bool QuickTestParser::processDocument(QPromise<TestParseResultPtr> &promise, m_checkForDerivedTests); } + if (!m_prefilteredFiles.contains(fileName)) + return false; + CPlusPlus::Document::Ptr cppdoc = document(fileName); if (cppdoc.isNull() || !includesQtQuickTest(cppdoc, m_cppSnapshot)) return false; @@ -396,5 +404,4 @@ FilePath QuickTestParser::projectFileForMainCppFile(const FilePath &fileName) co return m_mainCppFiles.contains(fileName) ? m_mainCppFiles.value(fileName) : FilePath(); } -} // namespace Internal -} // namespace Autotest +} // namespace Autotest::Internal diff --git a/src/plugins/autotest/quick/quicktestparser.h b/src/plugins/autotest/quick/quicktestparser.h index dfd71333ead..e93fa9605f4 100644 --- a/src/plugins/autotest/quick/quicktestparser.h +++ b/src/plugins/autotest/quick/quicktestparser.h @@ -44,6 +44,7 @@ private: QFileSystemWatcher m_directoryWatcher; QMap<QString, QMap<QString, QDateTime> > m_watchedFiles; QMap<Utils::FilePath, Utils::FilePath> m_mainCppFiles; + QSet<Utils::FilePath> m_prefilteredFiles; bool m_checkForDerivedTests = false; }; From 6998bf65911d848c190d7b00e6a73914f389718b Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 4 Sep 2023 13:56:32 +0200 Subject: [PATCH 1033/1777] FileIconProvider: Avoid access to mime database when registering icons We register icon overlays at startup, but we do not need to actually do anything at that point in time. Accessing the MIME database triggers its initialization, which takes unnecessary time. Change-Id: I9b9698b43569a93cf775d3b4fc8310d7cc2a0550 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/fsengine/fileiconprovider.cpp | 35 +++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/fsengine/fileiconprovider.cpp b/src/libs/utils/fsengine/fileiconprovider.cpp index 928789a4514..41c1f727c6a 100644 --- a/src/libs/utils/fsengine/fileiconprovider.cpp +++ b/src/libs/utils/fsengine/fileiconprovider.cpp @@ -85,7 +85,24 @@ public: m_suffixCache.insert(suffix, iconFilePath); } - void registerIconOverlayForMimeType(const QIcon &icon, const Utils::MimeType &mimeType) + void registerIconOverlayForMimeType(const QIcon &icon, const QString &mimeName) + { + // avoid accessing the MIME database right away + m_mimeUpdater.append([this, icon, mimeName] { + addIconOverlayForMimeType(icon, Utils::mimeTypeForName(mimeName)); + }); + } + + void registerIconOverlayForMimeType(const QString &iconFilePath, const QString &mimeName) + { + // avoid accessing the MIME database right away + m_mimeUpdater.append([this, iconFilePath, mimeName] { + addIconOverlayForMimeType(iconFilePath, Utils::mimeTypeForName(mimeName)); + }); + } + +private: + void addIconOverlayForMimeType(const QIcon &icon, const Utils::MimeType &mimeType) { const QStringList suffixes = mimeType.suffixes(); for (const QString &suffix : suffixes) { @@ -99,16 +116,24 @@ public: } } - void registerIconOverlayForMimeType(const QString &iconFilePath, const Utils::MimeType &mimeType) + void addIconOverlayForMimeType(const QString &iconFilePath, const Utils::MimeType &mimeType) { const QStringList suffixes = mimeType.suffixes(); for (const QString &suffix : suffixes) registerIconOverlayForSuffix(iconFilePath, suffix); } + void ensureMimeOverlays() const + { + for (const std::function<void()> &f : m_mimeUpdater) + f(); + m_mimeUpdater.clear(); + } + // Mapping of file suffix to icon. mutable QHash<QString, Item> m_suffixCache; mutable QHash<QString, Item> m_filenameCache; + mutable QList<std::function<void()>> m_mimeUpdater; // QAbstractFileIconProvider interface public: @@ -189,6 +214,8 @@ QIcon FileIconProviderImplementation::icon(const FilePath &filePath) const return *icon; } + ensureMimeOverlays(); + const QString suffix = !isDir ? filePath.suffix() : QString(); if (!suffix.isEmpty()) { const std::optional<QIcon> icon = getIcon(m_suffixCache, suffix); @@ -276,7 +303,7 @@ void registerIconOverlayForSuffix(const QString &path, const QString &suffix) */ void registerIconOverlayForMimeType(const QIcon &icon, const QString &mimeType) { - instance()->registerIconOverlayForMimeType(icon, Utils::mimeTypeForName(mimeType)); + instance()->registerIconOverlayForMimeType(icon, mimeType); } /*! @@ -285,7 +312,7 @@ void registerIconOverlayForMimeType(const QIcon &icon, const QString &mimeType) */ void registerIconOverlayForMimeType(const QString &path, const QString &mimeType) { - instance()->registerIconOverlayForMimeType(path, Utils::mimeTypeForName(mimeType)); + instance()->registerIconOverlayForMimeType(path, mimeType); } void registerIconOverlayForFilename(const QString &path, const QString &filename) From 2adebd0eb4ab3f2e0f662091cc7310b09907d2db Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 8 Sep 2023 14:36:32 +0200 Subject: [PATCH 1034/1777] Core: Never call QMainWindow::menuBar() It replaces the global menu bar on macOS (that is a QMenuBar(nullptr)) with a window specific menu bar, resulting in an empty menu bar for Qt Creator. Amends a6e779606db6c8536c715470ddb73f10c7431e8b Change-Id: Id6e2c0b9b2dfe4ade88af0f9a6d3b008fed790be Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/coreplugin/mainwindow.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index de58123bdf8..f4e3364109d 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -526,6 +526,11 @@ void MainWindow::registerDefaultContainers() ac->touchBar()->setApplicationTouchBar(); } +static QMenuBar *globalMenuBar() +{ + return ActionManager::actionContainer(Constants::MENU_BAR)->menuBar(); +} + void MainWindow::registerDefaultActions() { ActionContainer *mfile = ActionManager::actionContainer(Constants::M_FILE); @@ -836,12 +841,12 @@ void MainWindow::registerDefaultActions() m_toggleRightSideBarButton->setEnabled(false); // Show Menubar Action - if (menuBar() && !menuBar()->isNativeMenuBar()) { + if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) { m_toggleMenubarAction = new QAction(Tr::tr("Show Menubar"), this); m_toggleMenubarAction->setCheckable(true); cmd = ActionManager::registerAction(m_toggleMenubarAction, Constants::TOGGLE_MENUBAR); cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Alt+M"))); - connect(m_toggleMenubarAction, &QAction::toggled, this, [this, cmd](bool visible) { + connect(m_toggleMenubarAction, &QAction::toggled, this, [cmd](bool visible) { if (!visible) { CheckableMessageBox::information( Core::ICore::dialogParent(), @@ -851,7 +856,7 @@ void MainWindow::registerDefaultActions() + cmd->keySequence().toString(QKeySequence::NativeText), QString("ToogleMenuBarHint")); } - menuBar()->setVisible(visible); + globalMenuBar()->setVisible(visible); }); mview->addAction(cmd, Constants::G_VIEW_VIEWS); } @@ -1207,10 +1212,10 @@ void MainWindow::readSettings() updateModeSelectorStyleMenu(); } - if (menuBar() && !menuBar()->isNativeMenuBar()) { + if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) { const bool isVisible = settings->value(menubarVisibleKey, true).toBool(); - menuBar()->setVisible(isVisible); + globalMenuBar()->setVisible(isVisible); if (m_toggleMenubarAction) m_toggleMenubarAction->setChecked(isVisible); } @@ -1233,8 +1238,8 @@ void MainWindow::saveSettings() StyleHelper::requestedBaseColor(), QColor(StyleHelper::DEFAULT_BASE_COLOR)); - if (menuBar() && !menuBar()->isNativeMenuBar()) - settings->setValue(menubarVisibleKey, menuBar()->isVisible()); + if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) + settings->setValue(menubarVisibleKey, globalMenuBar()->isVisible()); settings->endGroup(); From 2b72ba66ceb3b9968ae2a4aad982f29ed30862ef Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 22 Aug 2023 15:28:19 +0200 Subject: [PATCH 1035/1777] LanguageClient: add workspace configuration project settings Change-Id: I9876773550f3dc566dec05b78f818ca49c930da1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../languageclient/languageclientmanager.cpp | 17 ++++++ .../languageclient/languageclientmanager.h | 3 + .../languageclient/languageclientplugin.cpp | 10 +++ .../languageclient/languageclientsettings.cpp | 61 ++++++++++++++++++- .../languageclient/languageclientsettings.h | 26 ++++++++ 5 files changed, 116 insertions(+), 1 deletion(-) diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index dd369cfd4dc..fcfc7c49fa7 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -116,6 +116,13 @@ void LanguageClient::LanguageClientManager::addClient(Client *client) for (QList<Client *> &clients : managerInstance->m_clientsForSetting) QTC_CHECK(clients.removeAll(client) == 0); }); + + ProjectExplorer::Project *project = client->project(); + if (!project) + project = ProjectExplorer::ProjectManager::startupProject(); + if (project) + client->updateConfiguration(ProjectSettings(project).workspaceConfiguration()); + emit managerInstance->clientAdded(client); } @@ -390,6 +397,16 @@ const BaseSettings *LanguageClientManager::settingForClient(Client *client) return nullptr; } +void LanguageClientManager::updateWorkspaceConfiguration(const ProjectExplorer::Project *project, + const QJsonValue &json) +{ + for (Client *client : managerInstance->m_clients) { + ProjectExplorer::Project *clientProject = client->project(); + if (!clientProject || clientProject == project) + client->updateConfiguration(json); + } +} + Client *LanguageClientManager::clientForDocument(TextEditor::TextDocument *document) { QTC_ASSERT(managerInstance, return nullptr); diff --git a/src/plugins/languageclient/languageclientmanager.h b/src/plugins/languageclient/languageclientmanager.h index 301cb4c5264..e47548b8741 100644 --- a/src/plugins/languageclient/languageclientmanager.h +++ b/src/plugins/languageclient/languageclientmanager.h @@ -60,6 +60,9 @@ public: static void enableClientSettings(const QString &settingsId, bool enable = true); static QList<Client *> clientsForSetting(const BaseSettings *setting); static const BaseSettings *settingForClient(Client *setting); + static void updateWorkspaceConfiguration(const ProjectExplorer::Project *project, + const QJsonValue &json); + static Client *clientForDocument(TextEditor::TextDocument *document); static Client *clientForFilePath(const Utils::FilePath &filePath); static const QList<Client *> clientsForProject(const ProjectExplorer::Project *project); diff --git a/src/plugins/languageclient/languageclientplugin.cpp b/src/plugins/languageclient/languageclientplugin.cpp index b6b411f8cb4..235ea9b5593 100644 --- a/src/plugins/languageclient/languageclientplugin.cpp +++ b/src/plugins/languageclient/languageclientplugin.cpp @@ -5,11 +5,14 @@ #include "client.h" #include "languageclientmanager.h" +#include "languageclientsettings.h" #include "languageclienttr.h" #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> +#include <projectexplorer/projectpanelfactory.h> + #include <QAction> #include <QMenu> @@ -37,6 +40,13 @@ void LanguageClientPlugin::initialize() { using namespace Core; + auto panelFactory = new ProjectExplorer::ProjectPanelFactory; + panelFactory->setPriority(35); + panelFactory->setDisplayName(Tr::tr("Language Server")); + panelFactory->setCreateWidgetFunction( + [](ProjectExplorer::Project *project) { return new ProjectSettingsWidget(project); }); + ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory); + LanguageClientManager::init(); LanguageClientSettings::registerClientType({Constants::LANGUAGECLIENT_STDIO_SETTINGS_ID, Tr::tr("Generic StdIO Language Server"), diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index f322709eba8..d14ca1d816a 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -36,6 +36,7 @@ #include <QDialogButtonBox> #include <QDir> #include <QFileInfo> +#include <QGroupBox> #include <QHeaderView> #include <QJsonDocument> #include <QLabel> @@ -1042,7 +1043,6 @@ TextEditor::BaseTextEditor *jsonEditor() TextEditorWidget *widget = textEditor->editorWidget(); widget->configureGenericHighlighter(Utils::mimeTypeForName("application/json")); widget->setLineNumbersVisible(false); - widget->setMarksVisible(false); widget->setRevisionsVisible(false); widget->setCodeFoldingSupported(false); QObject::connect(document, &TextDocument::contentsChanged, widget, [document](){ @@ -1073,4 +1073,63 @@ TextEditor::BaseTextEditor *jsonEditor() return textEditor; } +constexpr const char projectSettingsId[] = "LanguageClient.ProjectSettings"; + +ProjectSettings::ProjectSettings(ProjectExplorer::Project *project) + : m_project(project) +{ + m_json = m_project->namedSettings(projectSettingsId).toByteArray(); +} + +QJsonValue ProjectSettings::workspaceConfiguration() const +{ + const auto doc = QJsonDocument::fromJson(m_json); + if (doc.isObject()) + return doc.object(); + if (doc.isArray()) + return doc.array(); + return {}; +} + +QByteArray ProjectSettings::json() const +{ + return m_json; +} + +void ProjectSettings::setJson(const QByteArray &json) +{ + const QJsonValue oldConfig = workspaceConfiguration(); + m_json = json; + m_project->setNamedSettings(projectSettingsId, m_json); + const QJsonValue newConfig = workspaceConfiguration(); + if (oldConfig != newConfig) + LanguageClientManager::updateWorkspaceConfiguration(m_project, newConfig); +} + +ProjectSettingsWidget::ProjectSettingsWidget(ProjectExplorer::Project *project) + : m_settings(project) +{ + setUseGlobalSettingsCheckBoxVisible(false); + setGlobalSettingsId(Constants::LANGUAGECLIENT_SETTINGS_PAGE); + setExpanding(true); + + TextEditor::BaseTextEditor *editor = jsonEditor(); + editor->document()->setContents(m_settings.json()); + + auto layout = new QVBoxLayout; + setLayout(layout); + auto group = new QGroupBox(Tr::tr("Language Server Workspace Configuration")); + group->setLayout(new QVBoxLayout); + group->layout()->addWidget(new QLabel(Tr::tr( + "Additional json configuration sent to all running language servers for this project.\n" + "See the documentation of the specific language server for valid settings."))); + group->layout()->addWidget(editor->widget()); + layout->addWidget(group); + + connect(editor->editorWidget()->textDocument(), + &TextEditor::TextDocument::contentsChanged, + this, + [=]() { m_settings.setJson(editor->document()->contents()); }); +} + } // namespace LanguageClient diff --git a/src/plugins/languageclient/languageclientsettings.h b/src/plugins/languageclient/languageclientsettings.h index a19219d21d5..903edcba80f 100644 --- a/src/plugins/languageclient/languageclientsettings.h +++ b/src/plugins/languageclient/languageclientsettings.h @@ -7,6 +7,8 @@ #include <coreplugin/dialogs/ioptionspage.h> +#include <projectexplorer/projectsettingswidget.h> + #include <QAbstractItemModel> #include <QCoreApplication> #include <QJsonObject> @@ -191,6 +193,30 @@ private: QLineEdit *m_arguments = nullptr; }; +class ProjectSettings +{ +public: + explicit ProjectSettings(ProjectExplorer::Project *project); + + QJsonValue workspaceConfiguration() const; + + QByteArray json() const; + void setJson(const QByteArray &json); + +private: + ProjectExplorer::Project *m_project = nullptr; + QByteArray m_json; +}; + +class ProjectSettingsWidget : public ProjectExplorer::ProjectSettingsWidget +{ +public: + explicit ProjectSettingsWidget(ProjectExplorer::Project *project); + +private: + ProjectSettings m_settings; +}; + LANGUAGECLIENT_EXPORT TextEditor::BaseTextEditor *jsonEditor(); } // namespace LanguageClient From 0e26d0676f154fb0906691ea6e230ff9dd1610f3 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 7 Sep 2023 15:22:46 +0200 Subject: [PATCH 1036/1777] Spinner: Remove superfluous ; Change-Id: Ic1c16c1fad233bf32ec07ea3bfb9a65bf85cdd20 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/solutions/spinner/spinner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/solutions/spinner/spinner.h b/src/libs/solutions/spinner/spinner.h index 86dfbee6ebd..16ec6bb71db 100644 --- a/src/libs/solutions/spinner/spinner.h +++ b/src/libs/solutions/spinner/spinner.h @@ -13,7 +13,7 @@ namespace SpinnerSolution { Q_NAMESPACE_EXPORT(SPINNER_EXPORT) enum class SpinnerSize { Small, Medium, Large }; -Q_ENUM_NS(SpinnerSize); +Q_ENUM_NS(SpinnerSize) // TODO: SpinnerOverlay and SpinnerWidget? From 9b85b1087fc98b45f79a131bcac9bf0f2bead1ea Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 7 Sep 2023 12:44:04 +0200 Subject: [PATCH 1037/1777] ProjectExplorer: Add Aspect Settings to devices Change-Id: I4a69945dbb862a2741998a3bbbb0512e5fb829c9 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/docker/dockerdevice.cpp | 10 ++++- .../devicesupport/desktopdevice.cpp | 2 +- .../projectexplorer/devicesupport/idevice.cpp | 37 +++++++++++++++---- .../projectexplorer/devicesupport/idevice.h | 15 +++++++- .../devicesupport/idevicefactory.cpp | 3 +- src/plugins/remotelinux/linuxdevice.cpp | 9 ++++- 6 files changed, 60 insertions(+), 16 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index b8e0f1344fd..ce63015d813 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -128,6 +128,12 @@ public: DockerDevicePrivate *m_dev = nullptr; }; +class DockerDeviceSettings : public DeviceSettings +{ +public: + DockerDeviceSettings() { displayName.setDefaultValue(Tr::tr("Docker Image")); } +}; + class DockerDevicePrivate : public QObject { public: @@ -410,12 +416,12 @@ QString DockerDeviceFileAccess::mapToDevicePath(const QString &hostPath) const } DockerDevice::DockerDevice(const DockerDeviceData &data) - : d(new DockerDevicePrivate(this, data)) + : ProjectExplorer::IDevice(std::make_unique<DockerDeviceSettings>()) + , d(new DockerDevicePrivate(this, data)) { setFileAccess(&d->m_fileAccess); setDisplayType(Tr::tr("Docker")); setOsType(OsTypeLinux); - setDefaultDisplayName(Tr::tr("Docker Image")); setupId(IDevice::ManuallyAdded); setType(Constants::DOCKER_DEVICE_TYPE); setMachineType(IDevice::Hardware); diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index a5cee8b3a6a..cc9649cfca7 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -44,7 +44,7 @@ DesktopDevice::DesktopDevice() setupId(IDevice::AutoDetected, DESKTOP_DEVICE_ID); setType(DESKTOP_DEVICE_TYPE); - setDefaultDisplayName(Tr::tr("Local PC")); + settings()->displayName.setDefaultValue(Tr::tr("Local PC")); setDisplayType(Tr::tr("Desktop")); setDeviceState(IDevice::DeviceStateUnknown); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index f27c93c7f30..389e746f223 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -123,9 +123,13 @@ namespace Internal { class IDevicePrivate { public: - IDevicePrivate() = default; + IDevicePrivate(std::unique_ptr<DeviceSettings> s) + : settings(std::move(s)) + { + if (!settings) + settings = std::make_unique<DeviceSettings>(); + } - DisplayName displayName; QString displayType; Id type; IDevice::Origin origin = IDevice::AutoDetected; @@ -148,12 +152,22 @@ public: QList<IDevice::DeviceAction> deviceActions; Store extraData; IDevice::OpenTerminal openTerminal; + + std::unique_ptr<DeviceSettings> settings; }; } // namespace Internal +DeviceSettings::DeviceSettings() +{ + displayName.setSettingsKey(DisplayNameKey); + displayName.setDisplayStyle(StringAspect::DisplayStyle::LineEditDisplay); + displayName.setLabelText(Tr::tr("Name:")); +} + DeviceTester::DeviceTester(QObject *parent) : QObject(parent) { } -IDevice::IDevice() : d(new Internal::IDevicePrivate) +IDevice::IDevice(std::unique_ptr<DeviceSettings> settings) + : d(new Internal::IDevicePrivate(std::move(settings))) { } @@ -264,17 +278,17 @@ Environment IDevice::systemEnvironment() const QString IDevice::displayName() const { - return d->displayName.value(); + return d->settings->displayName(); } void IDevice::setDisplayName(const QString &name) { - d->displayName.setValue(name); + settings()->displayName.setValue(name); } void IDevice::setDefaultDisplayName(const QString &name) { - d->displayName.setDefaultValue(name); + settings()->displayName.setDefaultValue(name); } QString IDevice::displayType() const @@ -439,7 +453,8 @@ Id IDevice::idFromMap(const Store &map) void IDevice::fromMap(const Store &map) { d->type = typeFromMap(map); - d->displayName.fromMap(map, DisplayNameKey); + settings()->fromMap(map); + d->id = Id::fromSetting(map.value(IdKey)); d->osType = osTypeFromString(map.value(ClientOsTypeKey, osTypeToString(OsTypeLinux)).toString()); if (!d->id.isValid()) @@ -487,7 +502,8 @@ void IDevice::fromMap(const Store &map) Store IDevice::toMap() const { Store map; - d->displayName.toMap(map, DisplayNameKey); + d->settings->toMap(map); + map.insert(TypeKey, d->type.toString()); map.insert(ClientOsTypeKey, osTypeToString(d->osType)); map.insert(IdKey, d->id.toSetting()); @@ -528,6 +544,11 @@ IDevice::Ptr IDevice::clone() const return device; } +DeviceSettings *IDevice::settings() const +{ + return d->settings.get(); +} + QString IDevice::deviceStateToString() const { switch (d->deviceState) { diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 070eda339b7..12503f6b9a9 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -8,10 +8,11 @@ #include <solutions/tasking/tasktree.h> -#include <utils/id.h> +#include <utils/aspects.h> #include <utils/expected.h> #include <utils/filepath.h> #include <utils/hostosinfo.h> +#include <utils/id.h> #include <utils/store.h> #include <QAbstractSocket> @@ -83,6 +84,14 @@ public: std::function<QList<Utils::Port>(const QByteArray &commandOutput)> parsePorts; }; +class PROJECTEXPLORER_EXPORT DeviceSettings : public Utils::AspectContainer +{ +public: + DeviceSettings(); + + Utils::StringAspect displayName{this}; +}; + // See cpp file for documentation. class PROJECTEXPLORER_EXPORT IDevice : public QEnableSharedFromThis<IDevice> { @@ -99,6 +108,8 @@ public: Ptr clone() const; + DeviceSettings *settings() const; + QString displayName() const; void setDisplayName(const QString &name); void setDefaultDisplayName(const QString &name); @@ -216,7 +227,7 @@ public: virtual void checkOsType() {} protected: - IDevice(); + IDevice(std::unique_ptr<DeviceSettings> settings = nullptr); virtual void fromMap(const Utils::Store &map); virtual Utils::Store toMap() const; diff --git a/src/plugins/projectexplorer/devicesupport/idevicefactory.cpp b/src/plugins/projectexplorer/devicesupport/idevicefactory.cpp index 4a5b9b55308..9d229924749 100644 --- a/src/plugins/projectexplorer/devicesupport/idevicefactory.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevicefactory.cpp @@ -69,7 +69,6 @@ IDevice::Ptr IDeviceFactory::create() const IDevice::Ptr device = m_creator(); if (!device) // e.g. Cancel used on the dialog to create a device return {}; - device->setDefaultDisplayName(displayName()); return device; } @@ -80,7 +79,7 @@ IDevice::Ptr IDeviceFactory::construct() const IDevice::Ptr device = m_constructor(); QTC_ASSERT(device, return {}); - device->setDefaultDisplayName(displayName()); + device->settings()->displayName.setDefaultValue(displayName()); return device; } diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 4e4f5f73bb0..d32a4edda18 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -293,6 +293,12 @@ public: LinuxDevicePrivate *m_dev; }; +class LinuxDeviceSettings : public DeviceSettings +{ +public: + LinuxDeviceSettings() { displayName.setDefaultValue(Tr::tr("Remote Linux Device")); } +}; + class LinuxDevicePrivate { public: @@ -937,7 +943,8 @@ private: // LinuxDevice LinuxDevice::LinuxDevice() - : d(new LinuxDevicePrivate(this)) + : IDevice(std::make_unique<LinuxDeviceSettings>()) + , d(new LinuxDevicePrivate(this)) { setFileAccess(&d->m_fileAccess); setDisplayType(Tr::tr("Remote Linux")); From 00b58567545860859640569c447372d4955b5009 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 11 Sep 2023 09:27:12 +0200 Subject: [PATCH 1038/1777] Terminal: Fix sendKey Fixes: QTCREATORBUG-29593 Change-Id: I4db2dc88ce56ec3b5b0ad1acd02ed5c48da51a06 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../solutions/terminal/terminalsurface.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/libs/solutions/terminal/terminalsurface.cpp b/src/libs/solutions/terminal/terminalsurface.cpp index 12bfd381f3e..e51c09d8944 100644 --- a/src/libs/solutions/terminal/terminalsurface.cpp +++ b/src/libs/solutions/terminal/terminalsurface.cpp @@ -564,21 +564,9 @@ void TerminalSurface::sendKey(QKeyEvent *event) vterm_keyboard_key(d->m_vterm.get(), key, mod); } else if (event->text().length() == 1) { - // This maps to delete word and is way to easy to mistakenly type - // if (event->key() == Qt::Key_Space && mod == VTERM_MOD_SHIFT) - // mod = VTERM_MOD_NONE; - - // Per https://github.com/justinmk/neovim/commit/317d5ca7b0f92ef42de989b3556ca9503f0a3bf6 - // libvterm prefers we send the full keycode rather than sending the - // ctrl modifier. This helps with ncurses applications which otherwise - // do not recognize ctrl+<key> and in the shell for getting common control characters - // like ctrl+i for tab or ctrl+j for newline. - - // Workaround for "ALT+SHIFT+/" (\ on german mac keyboards) - if (mod == (VTERM_MOD_SHIFT | VTERM_MOD_ALT) && event->key() == Qt::Key_Slash) - mod = VTERM_MOD_NONE; - - vterm_keyboard_unichar(d->m_vterm.get(), event->text().toUcs4()[0], mod); + // event->text() already contains the correct unicode character based on the modifiers + // used, so we can simply convert it to Ucs4 and send it to the terminal. + vterm_keyboard_unichar(d->m_vterm.get(), event->text().toUcs4()[0], VTERM_MOD_NONE); } else if (mod == VTERM_MOD_CTRL && event->key() >= Qt::Key_A && event->key() < Qt::Key_Z) { vterm_keyboard_unichar(d->m_vterm.get(), 'a' + (event->key() - Qt::Key_A), mod); } From 50c9c9aa8604c763b25f244fc92e3e3e6947792c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 4 Sep 2023 18:05:17 +0200 Subject: [PATCH 1039/1777] ProjectExplorer: Start merging "unix" toolchains They are similar with quite a bit of overlap, with the odd "base" GccToolChain and discovery scanning mostly by scanning the same directories for each "sub type". This here aims at one class (currently still the mis-named GccToolChain, later to be re-named to UnixCToolChain or similar) Change-Id: Ia721932d4125d3673250ae727731acc7acd48def Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 378 +++++++++---------- src/plugins/projectexplorer/gcctoolchain.h | 69 ++-- 2 files changed, 195 insertions(+), 252 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 30ac040e2dc..8bc6f5f6a38 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -83,7 +83,7 @@ class ClangToolChainConfigWidget : public GccToolChainConfigWidget { Q_OBJECT public: - explicit ClangToolChainConfigWidget(ClangToolChain *tc); + explicit ClangToolChainConfigWidget(GccToolChain *tc); private: void applyImpl() override; @@ -303,12 +303,24 @@ static FilePath gccInstallDir(const FilePath &compiler, // GccToolChain // -------------------------------------------------------------------------- -GccToolChain::GccToolChain(Utils::Id typeId) : - ToolChain(typeId) +GccToolChain::GccToolChain(Utils::Id typeId, SubType subType) + : ToolChain(typeId), m_subType(subType) { setTypeDisplayName(Tr::tr("GCC")); setTargetAbiKey(targetAbiKeyC); setCompilerCommandKey("ProjectExplorer.GccToolChain.Path"); + if (m_subType == Clang) { + setTypeDisplayName(Tr::tr("Clang")); + syncAutodetectedWithParentToolchains(); + } +} + +GccToolChain::~GccToolChain() +{ + if (m_subType == Clang) { + QObject::disconnect(m_thisToolchainRemovedConnection); + QObject::disconnect(m_mingwToolchainAddedConnection); + } } void GccToolChain::setSupportedAbis(const Abis &abis) @@ -360,8 +372,33 @@ LanguageExtensions GccToolChain::defaultLanguageExtensions() const return LanguageExtension::Gnu; } +static const Toolchains mingwToolChains() +{ + return ToolChainManager::toolchains([](const ToolChain *tc) -> bool { + return tc->typeId() == Constants::MINGW_TOOLCHAIN_TYPEID; + }); +} + +static const MingwToolChain *mingwToolChainFromId(const QByteArray &id) +{ + if (id.isEmpty()) + return nullptr; + + for (const ToolChain *tc : mingwToolChains()) { + if (tc->id() == id) + return static_cast<const MingwToolChain *>(tc); + } + + return nullptr; +} + QString GccToolChain::originalTargetTriple() const { + if (m_subType == Clang) { + if (const MingwToolChain *parentTC = mingwToolChainFromId(m_parentToolChainId)) + return parentTC->originalTargetTriple(); + } + if (m_originalTargetTriple.isEmpty()) m_originalTargetTriple = detectSupportedAbis().originalTargetTriple; return m_originalTargetTriple; @@ -502,7 +539,7 @@ ToolChain::MacroInspectionRunner GccToolChain::createMacroInspectionRunner() con * @brief Parses gcc flags -std=*, -fopenmp, -fms-extensions. * @see http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html */ -Utils::LanguageExtensions GccToolChain::languageExtensions(const QStringList &cxxflags) const +LanguageExtensions GccToolChain::languageExtensions(const QStringList &cxxflags) const { LanguageExtensions extensions = defaultLanguageExtensions(); @@ -521,6 +558,10 @@ Utils::LanguageExtensions GccToolChain::languageExtensions(const QStringList &cx } } + // Clang knows -fborland-extensions". + if (m_subType == Clang && cxxflags.contains("-fborland-extensions")) + extensions |= LanguageExtension::Borland; + return extensions; } @@ -566,6 +607,17 @@ WarningFlags GccToolChain::warningFlags(const QStringList &cflags) const add("unused-value", WarningFlags::UnusedValue); add("uninitialized", WarningFlags::UninitializedVars); } + + if (m_subType == Clang) { + for (int end = cflags.size(), i = 0; i != end; ++i) { + const QString &flag = cflags[i]; + if (flag == "-Wdocumentation") + flags |= WarningFlags::Documentation; + if (flag == "-Wno-documentation") + flags &= ~WarningFlags::Documentation; + } + } + return flags; } @@ -648,6 +700,30 @@ ToolChain::BuiltInHeaderPathsRunner GccToolChain::createBuiltInHeaderPathsRunner Environment fullEnv = env; addToEnvironment(fullEnv); + if (m_subType == Clang) { + // This runner must be thread-safe! + return [fullEnv, + compilerCommand = compilerCommand(), + platformCodeGenFlags = m_platformCodeGenFlags, + reinterpretOptions = m_optionsReinterpreter, + headerCache = headerPathsCache(), + languageId = language(), + extraHeaderPathsFunction = m_extraHeaderPathsFunction](const QStringList &flags, + const FilePath &sysRoot, + const QString &target) { + return builtInHeaderPaths(fullEnv, + compilerCommand, + platformCodeGenFlags, + reinterpretOptions, + headerCache, + languageId, + extraHeaderPathsFunction, + flags, + sysRoot, + target); + }; + } + // This runner must be thread-safe! return [fullEnv, compilerCommand = compilerCommand(), @@ -682,10 +758,37 @@ void GccToolChain::addToEnvironment(Environment &env) const // cc1plus depends on libwinpthread-1.dll which is in bin, so bin must be in the PATH. if (compilerCommand().osType() == OsTypeWindows) addCommandPathToEnvironment(compilerCommand(), env); + + if (m_subType == Clang) { + const QString sysroot = sysRoot(); + if (!sysroot.isEmpty()) + env.prependOrSetPath(FilePath::fromString(sysroot) / "bin"); + + // Clang takes PWD as basis for debug info, if set. + // When running Qt Creator from a shell, PWD is initially set to an "arbitrary" value. + // Since the tools are not called through a shell, PWD is never changed to the actual cwd, + // so we better make sure PWD is empty to begin with + env.unset("PWD"); + } } QStringList GccToolChain::suggestedMkspecList() const { + if (m_subType == Clang) { + if (const ToolChain * const parentTc = ToolChainManager::findToolChain(m_parentToolChainId)) + return parentTc->suggestedMkspecList(); + const Abi abi = targetAbi(); + if (abi.os() == Abi::DarwinOS) + return {"macx-clang", "macx-clang-32", "unsupported/macx-clang", "macx-ios-clang"}; + if (abi.os() == Abi::LinuxOS) + return {"linux-clang", "unsupported/linux-clang"}; + if (abi.os() == Abi::WindowsOS) + return {"win32-clang-g++"}; + if (abi.architecture() == Abi::AsmJsArchitecture && abi.binaryFormat() == Abi::EmscriptenFormat) + return {"wasm-emscripten"}; + return {}; // Note: Not supported by Qt yet, so default to the mkspec the Qt was build with + } + const Abi abi = targetAbi(); const Abi host = Abi::hostAbi(); @@ -722,14 +825,34 @@ QStringList GccToolChain::suggestedMkspecList() const return {}; } +static FilePath mingwAwareMakeCommand(const Environment &environment) +{ + const QStringList makes + = HostOsInfo::isWindowsHost() ? QStringList({"mingw32-make.exe", "make.exe"}) : QStringList({"make"}); + + FilePath tmp; + for (const QString &make : makes) { + tmp = environment.searchInPath(make); + if (!tmp.isEmpty()) + return tmp; + } + return FilePath::fromString(makes.first()); +} + FilePath GccToolChain::makeCommand(const Environment &environment) const { + if (m_subType == Clang) + return mingwAwareMakeCommand(environment); + const FilePath tmp = environment.searchInPath("make"); return tmp.isEmpty() ? "make" : tmp; } QList<OutputLineParser *> GccToolChain::createOutputParsers() const { + if (m_subType == Clang) + return ClangParser::clangParserSuite(); + return GccParser::gccParserSuite(); } @@ -802,6 +925,11 @@ void GccToolChain::toMap(Store &data) const data.insert(compilerPlatformLinkerFlagsKeyC, m_platformLinkerFlags); data.insert(originalTargetTripleKeyC, m_originalTargetTriple); data.insert(supportedAbisKeyC, Utils::transform<QStringList>(m_supportedAbis, &Abi::toString)); + + if (m_subType == Clang) { + data.insert(parentToolChainIdKeyC, m_parentToolChainId); + data.insert(priorityKeyC, m_priority); + } } void GccToolChain::fromMap(const Store &data) @@ -821,6 +949,12 @@ void GccToolChain::fromMap(const Store &data) const QString targetAbiString = data.value(targetAbiKeyC).toString(); if (targetAbiString.isEmpty()) resetToolChain(compilerCommand()); + + if (m_subType == Clang) { + m_parentToolChainId = data.value(parentToolChainIdKeyC).toByteArray(); + m_priority = data.value(priorityKeyC, PriorityNormal).toInt(); + syncAutodetectedWithParentToolchains(); + } } bool GccToolChain::operator ==(const ToolChain &other) const @@ -836,6 +970,9 @@ bool GccToolChain::operator ==(const ToolChain &other) const std::unique_ptr<ToolChainConfigWidget> GccToolChain::createConfigurationWidget() { + if (m_subType == Clang) + return std::make_unique<ClangToolChainConfigWidget>(this); + return std::make_unique<GccToolChainConfigWidget>(this); } @@ -1459,27 +1596,7 @@ void GccToolChainConfigWidget::handlePlatformLinkerFlagsChange() // ClangToolChain // -------------------------------------------------------------------------- -static const Toolchains mingwToolChains() -{ - return ToolChainManager::toolchains([](const ToolChain *tc) -> bool { - return tc->typeId() == Constants::MINGW_TOOLCHAIN_TYPEID; - }); -} - -static const MingwToolChain *mingwToolChainFromId(const QByteArray &id) -{ - if (id.isEmpty()) - return nullptr; - - for (const ToolChain *tc : mingwToolChains()) { - if (tc->id() == id) - return static_cast<const MingwToolChain *>(tc); - } - - return nullptr; -} - -void ClangToolChain::syncAutodetectedWithParentToolchains() +void GccToolChain::syncAutodetectedWithParentToolchains() { if (!HostOsInfo::isWindowsHost() || typeId() != Constants::CLANG_TOOLCHAIN_TYPEID || !isAutoDetected()) { @@ -1494,7 +1611,7 @@ void ClangToolChain::syncAutodetectedWithParentToolchains() [id = id()] { if (ToolChain * const tc = ToolChainManager::findToolChain(id)) { if (tc->typeId() == Constants::CLANG_TOOLCHAIN_TYPEID) - static_cast<ClangToolChain *>(tc)->syncAutodetectedWithParentToolchains(); + static_cast<GccToolChain *>(tc)->syncAutodetectedWithParentToolchains(); } }); return; @@ -1528,197 +1645,44 @@ void ClangToolChain::syncAutodetectedWithParentToolchains() ClangToolChain::ClangToolChain() : ClangToolChain(Constants::CLANG_TOOLCHAIN_TYPEID) -{ -} +{} ClangToolChain::ClangToolChain(Utils::Id typeId) : - GccToolChain(typeId) + GccToolChain(typeId, GccToolChain::Clang) { - setTypeDisplayName(Tr::tr("Clang")); - syncAutodetectedWithParentToolchains(); } -ClangToolChain::~ClangToolChain() +bool GccToolChain::matchesCompilerCommand(const FilePath &command) const { - QObject::disconnect(m_thisToolchainRemovedConnection); - QObject::disconnect(m_mingwToolchainAddedConnection); + if (m_subType == Clang) { + if (!m_resolvedCompilerCommand) { + m_resolvedCompilerCommand = FilePath(); + if (HostOsInfo::isMacHost() + && compilerCommand().parentDir() == FilePath::fromString("/usr/bin")) { + Process xcrun; + xcrun.setCommand({"/usr/bin/xcrun", {"-f", compilerCommand().fileName()}}); + xcrun.runBlocking(); + const FilePath output = FilePath::fromString(xcrun.cleanedStdOut().trimmed()); + if (output.isExecutableFile() && output != compilerCommand()) + m_resolvedCompilerCommand = output; + } + } + if (!m_resolvedCompilerCommand->isEmpty() + && m_resolvedCompilerCommand->isSameExecutable(command)) + return true; + } + return ToolChain::matchesCompilerCommand(command); } -bool ClangToolChain::matchesCompilerCommand(const FilePath &command) const +QString GccToolChain::sysRoot() const { - if (!m_resolvedCompilerCommand) { - m_resolvedCompilerCommand = FilePath(); - if (HostOsInfo::isMacHost() - && compilerCommand().parentDir() == FilePath::fromString("/usr/bin")) { - Process xcrun; - xcrun.setCommand({"/usr/bin/xcrun", {"-f", compilerCommand().fileName()}}); - xcrun.runBlocking(); - const FilePath output = FilePath::fromString(xcrun.cleanedStdOut().trimmed()); - if (output.isExecutableFile() && output != compilerCommand()) - m_resolvedCompilerCommand = output; + if (m_subType == Clang) { + if (const MingwToolChain *parentTC = mingwToolChainFromId(m_parentToolChainId)) { + const FilePath mingwCompiler = parentTC->compilerCommand(); + return mingwCompiler.parentDir().parentDir().toString(); } } - if (!m_resolvedCompilerCommand->isEmpty() - && m_resolvedCompilerCommand->isSameExecutable(command)) - return true; - return GccToolChain::matchesCompilerCommand(command); -} - -static FilePath mingwAwareMakeCommand(const Environment &environment) -{ - const QStringList makes - = HostOsInfo::isWindowsHost() ? QStringList({"mingw32-make.exe", "make.exe"}) : QStringList({"make"}); - - FilePath tmp; - for (const QString &make : makes) { - tmp = environment.searchInPath(make); - if (!tmp.isEmpty()) - return tmp; - } - return FilePath::fromString(makes.first()); -} - -FilePath ClangToolChain::makeCommand(const Environment &environment) const -{ - return mingwAwareMakeCommand(environment); -} - -/** - * @brief Similar to \a GccToolchain::languageExtensions, but recognizes - * "-fborland-extensions". - */ -LanguageExtensions ClangToolChain::languageExtensions(const QStringList &cxxflags) const -{ - LanguageExtensions extensions = GccToolChain::languageExtensions(cxxflags); - if (cxxflags.contains("-fborland-extensions")) - extensions |= LanguageExtension::Borland; - return extensions; -} - -WarningFlags ClangToolChain::warningFlags(const QStringList &cflags) const -{ - WarningFlags flags = GccToolChain::warningFlags(cflags); - for (int end = cflags.size(), i = 0; i != end; ++i) { - const QString &flag = cflags[i]; - if (flag == "-Wdocumentation") - flags |= WarningFlags::Documentation; - if (flag == "-Wno-documentation") - flags &= ~WarningFlags::Documentation; - } - return flags; -} - -QStringList ClangToolChain::suggestedMkspecList() const -{ - if (const ToolChain * const parentTc = ToolChainManager::findToolChain(m_parentToolChainId)) - return parentTc->suggestedMkspecList(); - const Abi abi = targetAbi(); - if (abi.os() == Abi::DarwinOS) - return {"macx-clang", "macx-clang-32", "unsupported/macx-clang", "macx-ios-clang"}; - if (abi.os() == Abi::LinuxOS) - return {"linux-clang", "unsupported/linux-clang"}; - if (abi.os() == Abi::WindowsOS) - return {"win32-clang-g++"}; - if (abi.architecture() == Abi::AsmJsArchitecture && abi.binaryFormat() == Abi::EmscriptenFormat) - return {"wasm-emscripten"}; - return {}; // Note: Not supported by Qt yet, so default to the mkspec the Qt was build with -} - -void ClangToolChain::addToEnvironment(Environment &env) const -{ - GccToolChain::addToEnvironment(env); - - const QString sysroot = sysRoot(); - if (!sysroot.isEmpty()) - env.prependOrSetPath(FilePath::fromString(sysroot) / "bin"); - - // Clang takes PWD as basis for debug info, if set. - // When running Qt Creator from a shell, PWD is initially set to an "arbitrary" value. - // Since the tools are not called through a shell, PWD is never changed to the actual cwd, - // so we better make sure PWD is empty to begin with - env.unset("PWD"); -} - -QString ClangToolChain::originalTargetTriple() const -{ - const MingwToolChain *parentTC = mingwToolChainFromId(m_parentToolChainId); - if (parentTC) - return parentTC->originalTargetTriple(); - - return GccToolChain::originalTargetTriple(); -} - -QString ClangToolChain::sysRoot() const -{ - const MingwToolChain *parentTC = mingwToolChainFromId(m_parentToolChainId); - if (!parentTC) - return {}; - - const FilePath mingwCompiler = parentTC->compilerCommand(); - return mingwCompiler.parentDir().parentDir().toString(); -} - -ToolChain::BuiltInHeaderPathsRunner ClangToolChain::createBuiltInHeaderPathsRunner( - const Environment &env) const -{ - // Using a clean environment breaks ccache/distcc/etc. - Environment fullEnv = env; - addToEnvironment(fullEnv); - - // This runner must be thread-safe! - return [fullEnv, - compilerCommand = compilerCommand(), - platformCodeGenFlags = m_platformCodeGenFlags, - reinterpretOptions = m_optionsReinterpreter, - headerCache = headerPathsCache(), - languageId = language(), - extraHeaderPathsFunction = m_extraHeaderPathsFunction](const QStringList &flags, - const FilePath &sysRoot, - const QString &target) { - return builtInHeaderPaths(fullEnv, - compilerCommand, - platformCodeGenFlags, - reinterpretOptions, - headerCache, - languageId, - extraHeaderPathsFunction, - flags, - sysRoot, - target); - }; -} - -std::unique_ptr<ToolChainConfigWidget> ClangToolChain::createConfigurationWidget() -{ - return std::make_unique<ClangToolChainConfigWidget>(this); -} - -void ClangToolChain::toMap(Store &data) const -{ - GccToolChain::toMap(data); - data.insert(parentToolChainIdKeyC, m_parentToolChainId); - data.insert(priorityKeyC, m_priority); -} - -void ClangToolChain::fromMap(const Store &data) -{ - GccToolChain::fromMap(data); - if (hasError()) - return; - - m_parentToolChainId = data.value(parentToolChainIdKeyC).toByteArray(); - m_priority = data.value(priorityKeyC, PriorityNormal).toInt(); - syncAutodetectedWithParentToolchains(); -} - -LanguageExtensions ClangToolChain::defaultLanguageExtensions() const -{ - return LanguageExtension::Gnu; -} - -QList<OutputLineParser *> ClangToolChain::createOutputParsers() const -{ - return ClangParser::clangParserSuite(); + return {}; } // -------------------------------------------------------------------------- @@ -1774,7 +1738,7 @@ Toolchains ClangToolChainFactory::detectForImport(const ToolChainDescription &tc return {}; } -ClangToolChainConfigWidget::ClangToolChainConfigWidget(ClangToolChain *tc) : +ClangToolChainConfigWidget::ClangToolChainConfigWidget(GccToolChain *tc) : GccToolChainConfigWidget(tc) { if (!HostOsInfo::isWindowsHost() || tc->typeId() != Constants::CLANG_TOOLCHAIN_TYPEID) diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 04a395c8188..bdb1fb03fd0 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -46,7 +46,10 @@ inline const QStringList gccPredefinedMacrosOptions(Utils::Id languageId) class PROJECTEXPLORER_EXPORT GccToolChain : public ToolChain { public: - GccToolChain(Utils::Id typeId); + enum SubType { RealGcc, Clang }; + + GccToolChain(Utils::Id typeId, SubType subType = RealGcc); + ~GccToolChain() override; QString originalTargetTriple() const override; Utils::FilePath installDir() const override; @@ -95,6 +98,10 @@ public: }; GccToolChain *asGccToolChain() final { return this; } + bool matchesCompilerCommand(const Utils::FilePath &command) const; + + void setPriority(int priority) { m_priority = priority; } + protected: using CacheItem = QPair<QStringList, Macros>; using GccCache = QVector<CacheItem>; @@ -135,6 +142,8 @@ protected: const QStringList &args, const Utils::Environment &env); + int priority() const override { return m_priority; } + class WarningFlagAdder { public: @@ -149,7 +158,10 @@ protected: bool m_triggered = false; }; + QString sysRoot() const override; + private: + void syncAutodetectedWithParentToolchains(); void updateSupportedAbis() const; static QStringList gccPrepareArguments(const QStringList &flags, const Utils::FilePath &sysRoot, @@ -165,6 +177,7 @@ protected: mutable ExtraHeaderPathsFunction m_extraHeaderPathsFunction = [](HeaderPaths &) {}; private: + SubType m_subType = RealGcc; mutable Abis m_supportedAbis; mutable QString m_originalTargetTriple; mutable HeaderPaths m_headerPaths; @@ -174,6 +187,16 @@ private: friend class Internal::GccToolChainConfigWidget; friend class Internal::GccToolChainFactory; friend class ToolChainFactory; + friend class Internal::ClangToolChainFactory; + friend class Internal::ClangToolChainConfigWidget; + + // "resolved" on macOS from /usr/bin/clang(++) etc to <DeveloperDir>/usr/bin/clang(++) + // which is used for comparison with matchesCompilerCommand + mutable std::optional<Utils::FilePath> m_resolvedCompilerCommand; + QByteArray m_parentToolChainId; + int m_priority = PriorityNormal; + QMetaObject::Connection m_mingwToolchainAddedConnection; + QMetaObject::Connection m_thisToolchainRemovedConnection; }; // -------------------------------------------------------------------------- @@ -185,50 +208,6 @@ class PROJECTEXPLORER_EXPORT ClangToolChain : public GccToolChain public: ClangToolChain(); explicit ClangToolChain(Utils::Id typeId); - ~ClangToolChain() override; - - bool matchesCompilerCommand(const Utils::FilePath &command) const override; - - Utils::FilePath makeCommand(const Utils::Environment &environment) const override; - - Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const override; - Utils::WarningFlags warningFlags(const QStringList &cflags) const override; - - QList<Utils::OutputLineParser *> createOutputParsers() const override; - - QStringList suggestedMkspecList() const override; - void addToEnvironment(Utils::Environment &env) const override; - - QString originalTargetTriple() const override; - QString sysRoot() const override; - - BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner( - const Utils::Environment &env) const override; - - std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; - - void toMap(Utils::Store &data) const override; - void fromMap(const Utils::Store &data) override; - - void setPriority(int priority) { m_priority = priority; } - int priority() const override { return m_priority; } - -protected: - Utils::LanguageExtensions defaultLanguageExtensions() const override; - void syncAutodetectedWithParentToolchains(); - -private: - // "resolved" on macOS from /usr/bin/clang(++) etc to <DeveloperDir>/usr/bin/clang(++) - // which is used for comparison with matchesCompileCommand - mutable std::optional<Utils::FilePath> m_resolvedCompilerCommand; - QByteArray m_parentToolChainId; - int m_priority = PriorityNormal; - QMetaObject::Connection m_mingwToolchainAddedConnection; - QMetaObject::Connection m_thisToolchainRemovedConnection; - - friend class Internal::ClangToolChainFactory; - friend class Internal::ClangToolChainConfigWidget; - friend class ToolChainFactory; }; // -------------------------------------------------------------------------- From 7f15f720ac47eaf15d2420b68fdeb65c2769f845 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 7 Sep 2023 14:03:29 +0200 Subject: [PATCH 1040/1777] ProjectExplorer: Directly use DeviceSettings Change-Id: I2c7d0395bbc59238a23c30b1f233e7bf922e0be4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../devicesupport/devicemanager.cpp | 5 ++ .../devicesupport/devicemanager.h | 1 + .../devicesupport/devicesettingspage.cpp | 85 +++++-------------- .../projectexplorer/devicesupport/idevice.cpp | 38 ++++++++- 4 files changed, 64 insertions(+), 65 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 9fac88602b5..e895ee4f358 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -115,6 +115,11 @@ DeviceManager *DeviceManager::cloneInstance() return DeviceManagerPrivate::clonedInstance; } +DeviceManager *DeviceManager::clonedInstance() +{ + return DeviceManagerPrivate::clonedInstance; +} + void DeviceManager::copy(const DeviceManager *source, DeviceManager *target, bool deep) { if (deep) { diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.h b/src/plugins/projectexplorer/devicesupport/devicemanager.h index ab1b1b3af22..6d7eeae1ee0 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.h +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.h @@ -31,6 +31,7 @@ public: ~DeviceManager() override; static DeviceManager *instance(); + static DeviceManager *clonedInstance(); int deviceCount() const; IDevice::ConstPtr deviceAt(int index) const; diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp b/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp index 9398294912b..81e0eec15ab 100644 --- a/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp @@ -43,36 +43,6 @@ namespace ProjectExplorer::Internal { const char LastDeviceIndexKey[] = "LastDisplayedMaemoDeviceConfig"; -class NameValidator : public QValidator -{ -public: - NameValidator(const DeviceManager *deviceManager, QWidget *parent = nullptr) - : QValidator(parent), m_deviceManager(deviceManager) - { - } - - void setDisplayName(const QString &name) { m_oldName = name; } - - State validate(QString &input, int & /* pos */) const override - { - if (input.trimmed().isEmpty() - || (input != m_oldName && m_deviceManager->hasDevice(input))) - return Intermediate; - return Acceptable; - } - - void fixup(QString &input) const override - { - int dummy = 0; - if (validate(input, dummy) != Acceptable) - input = m_oldName; - } - -private: - QString m_oldName; - const DeviceManager * const m_deviceManager; -}; - class DeviceSettingsWidget final : public Core::IOptionsPageWidget { public: @@ -92,7 +62,6 @@ private: void currentDeviceChanged(int index); void addDevice(); void removeDevice(); - void deviceNameEditingFinished(); void setDefaultDevice(); void testDevice(); void handleProcessListRequested(); @@ -104,19 +73,16 @@ private: int currentIndex() const; void clearDetails(); QString parseTestOutput(); - void fillInValues(); void updateDeviceFromUi(); DeviceManager * const m_deviceManager; DeviceManagerModel * const m_deviceManagerModel; - NameValidator * const m_nameValidator; QList<QPushButton *> m_additionalActionButtons; IDeviceWidget *m_configWidget; QLabel *m_configurationLabel; QComboBox *m_configurationComboBox; QGroupBox *m_generalGroupBox; - QLineEdit *m_nameLineEdit; QLabel *m_osTypeValueLabel; QLabel *m_autoDetectionLabel; QLabel *m_deviceStateIconLabel; @@ -125,20 +91,19 @@ private: QPushButton *m_removeConfigButton; QPushButton *m_defaultDeviceButton; QVBoxLayout *m_buttonsLayout; + QWidget *m_deviceNameEditWidget; + QFormLayout *m_generalFormLayout; }; DeviceSettingsWidget::DeviceSettingsWidget() - : m_deviceManager(DeviceManager::cloneInstance()), - m_deviceManagerModel(new DeviceManagerModel(m_deviceManager, this)), - m_nameValidator(new NameValidator(m_deviceManager, this)), - m_configWidget(nullptr) + : m_deviceManager(DeviceManager::cloneInstance()) + , m_deviceManagerModel(new DeviceManagerModel(m_deviceManager, this)) + , m_configWidget(nullptr) { m_configurationLabel = new QLabel(Tr::tr("&Device:")); m_configurationComboBox = new QComboBox; m_configurationComboBox->setModel(m_deviceManagerModel); m_generalGroupBox = new QGroupBox(Tr::tr("General")); - m_nameLineEdit = new QLineEdit; - m_nameLineEdit->setValidator(m_nameValidator); m_osTypeValueLabel = new QLabel; m_autoDetectionLabel = new QLabel; m_deviceStateIconLabel = new QLabel; @@ -192,14 +157,18 @@ DeviceSettingsWidget::DeviceSettingsWidget() m_osSpecificGroupBox, }.attachTo(scrollAreaWidget); + // Just a placeholder for the device name edit widget. + m_deviceNameEditWidget = new QWidget(); + + // clang-format off Form { - Tr::tr("&Name:"), m_nameLineEdit, br, + bindTo(&m_generalFormLayout), + Tr::tr("&Name:"), m_deviceNameEditWidget, br, Tr::tr("Type:"), m_osTypeValueLabel, br, Tr::tr("Auto-detected:"), m_autoDetectionLabel, br, Tr::tr("Current state:"), Row { m_deviceStateIconLabel, m_deviceStateTextLabel, st, }, br, }.attachTo(m_generalGroupBox); - // clang-format off Row { Column { Form { m_configurationLabel, m_configurationComboBox, br, }, @@ -234,8 +203,6 @@ DeviceSettingsWidget::DeviceSettingsWidget() this, &DeviceSettingsWidget::setDefaultDevice); connect(m_removeConfigButton, &QAbstractButton::clicked, this, &DeviceSettingsWidget::removeDevice); - connect(m_nameLineEdit, &QLineEdit::editingFinished, - this, &DeviceSettingsWidget::deviceNameEditingFinished); connect(m_deviceManager, &DeviceManager::deviceUpdated, this, &DeviceSettingsWidget::handleDeviceUpdated); } @@ -281,7 +248,6 @@ void DeviceSettingsWidget::displayCurrent() m_osTypeValueLabel->setText(current->displayType()); m_autoDetectionLabel->setText(current->isAutoDetected() ? Tr::tr("Yes (id is \"%1\")").arg(current->id().toString()) : Tr::tr("No")); - m_nameValidator->setDisplayName(current->displayName()); m_deviceStateIconLabel->show(); switch (current->deviceState()) { case IDevice::DeviceReadyToUse: @@ -301,7 +267,6 @@ void DeviceSettingsWidget::displayCurrent() m_removeConfigButton->setEnabled(!current->isAutoDetected() || current->deviceState() == IDevice::DeviceDisconnected); - fillInValues(); } void DeviceSettingsWidget::setDeviceInfoWidgetsEnabled(bool enable) @@ -312,15 +277,9 @@ void DeviceSettingsWidget::setDeviceInfoWidgetsEnabled(bool enable) m_osSpecificGroupBox->setEnabled(enable); } -void DeviceSettingsWidget::fillInValues() -{ - const IDevice::ConstPtr ¤t = currentDevice(); - m_nameLineEdit->setText(current->displayName()); -} - void DeviceSettingsWidget::updateDeviceFromUi() { - deviceNameEditingFinished(); + currentDevice()->settings()->apply(); if (m_configWidget) m_configWidget->updateDeviceFromUi(); } @@ -343,16 +302,6 @@ IDevice::ConstPtr DeviceSettingsWidget::currentDevice() const return m_deviceManagerModel->device(currentIndex()); } -void DeviceSettingsWidget::deviceNameEditingFinished() -{ - if (m_configurationComboBox->count() == 0) - return; - - const QString &newName = m_nameLineEdit->text(); - m_deviceManager->mutableDevice(currentDevice()->id())->setDisplayName(newName); - m_nameValidator->setDisplayName(newName); - m_deviceManagerModel->updateDevice(currentDevice()->id()); -} void DeviceSettingsWidget::setDefaultDevice() { @@ -391,6 +340,15 @@ void DeviceSettingsWidget::currentDeviceChanged(int index) m_defaultDeviceButton->setEnabled(false); return; } + + Layouting::Column item{Layouting::noMargin()}; + device->settings()->displayName.addToLayout(item); + QWidget *newEdit = item.emerge(); + m_generalFormLayout->replaceWidget(m_deviceNameEditWidget, newEdit); + + delete m_deviceNameEditWidget; + m_deviceNameEditWidget = newEdit; + setDeviceInfoWidgetsEnabled(true); m_removeConfigButton->setEnabled(true); @@ -435,7 +393,6 @@ void DeviceSettingsWidget::currentDeviceChanged(int index) void DeviceSettingsWidget::clearDetails() { - m_nameLineEdit->clear(); m_osTypeValueLabel->clear(); m_autoDetectionLabel->clear(); } diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 389e746f223..ed794585e15 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -159,9 +159,45 @@ public: DeviceSettings::DeviceSettings() { + setAutoApply(false); + displayName.setSettingsKey(DisplayNameKey); displayName.setDisplayStyle(StringAspect::DisplayStyle::LineEditDisplay); - displayName.setLabelText(Tr::tr("Name:")); + + auto validateDisplayName = [](const QString &old, + const QString &newValue) -> expected_str<void> { + if (old == newValue) + return {}; + + if (newValue.trimmed().isEmpty()) + return make_unexpected(Tr::tr("The device name cannot be empty.")); + + if (DeviceManager::clonedInstance()->hasDevice(newValue)) + return make_unexpected(Tr::tr("A device with this name already exists.")); + + return {}; + }; + + displayName.setValidationFunction( + [this, validateDisplayName](FancyLineEdit *edit, QString *errorMsg) -> bool { + auto result = validateDisplayName(displayName.value(), edit->text()); + if (result) + return true; + + if (errorMsg) + *errorMsg = result.error(); + + return false; + }); + + displayName.setValueAcceptor( + [validateDisplayName](const QString &old, + const QString &newValue) -> std::optional<QString> { + if (validateDisplayName(old, newValue)) + return std::nullopt; + + return old; + }); } DeviceTester::DeviceTester(QObject *parent) : QObject(parent) { } From 96c21b0e366870b66de81c7a1786c0d032aa585a Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 7 Sep 2023 15:38:17 +0200 Subject: [PATCH 1041/1777] CppEditor: optimize CppModelManager projectPartForFile Calling FilePath::canonicalPath is expensive on Windows, so only call it if we cannot find the filePath in the cache and save the result to the cache again. This reduces the time to parse the auto test for the Qt Creator repository from 10s to 2s here. It also improves the performance of various quickfixes and follow symbol of the built-in code model by a similar factor. Change-Id: I7025828e1b91f492825b10753e3b97e1c917fbfd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/cppeditor/cppmodelmanager.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index a2f93635fea..231740899be 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -1465,8 +1465,11 @@ void CppModelManager::recalculateProjectPartMappings() for (const ProjectData &projectData : std::as_const(d->m_projectData)) { for (const ProjectPart::ConstPtr &projectPart : projectData.projectInfo->projectParts()) { d->m_projectPartIdToProjectProjectPart[projectPart->id()] = projectPart; - for (const ProjectFile &cxxFile : projectPart->files) - d->m_fileToProjectParts[cxxFile.path.canonicalPath()].append(projectPart); + for (const ProjectFile &cxxFile : projectPart->files) { + d->m_fileToProjectParts[cxxFile.path].append(projectPart); + if (FilePath canonical = cxxFile.path.canonicalPath(); canonical != cxxFile.path) + d->m_fileToProjectParts[canonical].append(projectPart); + } } } @@ -1639,8 +1642,16 @@ ProjectPart::ConstPtr CppModelManager::projectPartForId(const QString &projectPa QList<ProjectPart::ConstPtr> CppModelManager::projectPart(const FilePath &fileName) { - QReadLocker locker(&d->m_projectLock); - return d->m_fileToProjectParts.value(fileName.canonicalPath()); + { + QReadLocker locker(&d->m_projectLock); + auto it = d->m_fileToProjectParts.find(fileName); + if (it != d->m_fileToProjectParts.end()) + return it.value(); + } + const FilePath canonicalPath = fileName.canonicalPath(); + QWriteLocker locker(&d->m_projectLock); + auto it = d->m_fileToProjectParts.insert(fileName, d->m_fileToProjectParts.value(canonicalPath)); + return it.value(); } QList<ProjectPart::ConstPtr> CppModelManager::projectPartFromDependencies( @@ -1651,7 +1662,7 @@ QList<ProjectPart::ConstPtr> CppModelManager::projectPartFromDependencies( QReadLocker locker(&d->m_projectLock); for (const FilePath &dep : deps) - parts.unite(Utils::toSet(d->m_fileToProjectParts.value(dep.canonicalPath()))); + parts.unite(Utils::toSet(projectPart(dep))); return parts.values(); } From 116ad3ed4f06659b3c2573a0eb35a3296e19c516 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 7 Sep 2023 14:04:19 +0200 Subject: [PATCH 1042/1777] ProjectExplorer: Remove IDevice::setDisplayName also removes IDevice::setDefaultDisplayName Change-Id: Ie8ac3d95ba1991a20720342de3bf6e97c6414ffa Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/android/androiddevice.cpp | 6 +++--- src/plugins/android/avddialog.cpp | 2 +- .../baremetaldeviceconfigurationwizard.cpp | 2 +- .../boot2qt/device-detection/devicedetector.cpp | 2 +- src/plugins/boot2qt/qdbdevice.cpp | 2 +- src/plugins/docker/dockerdevice.cpp | 3 ++- src/plugins/ios/iosdevice.cpp | 6 +++--- src/plugins/ios/iossimulator.cpp | 2 +- src/plugins/mcusupport/mcusupportdevice.cpp | 2 +- .../devicesupport/devicemanager.cpp | 7 ++++--- .../projectexplorer/devicesupport/idevice.cpp | 14 -------------- .../projectexplorer/devicesupport/idevice.h | 2 -- src/plugins/projectexplorer/kitaspects.cpp | 2 +- src/plugins/qnx/qnxdevice.cpp | 2 +- src/plugins/remotelinux/sshdevicewizard.cpp | 2 +- src/plugins/webassembly/webassemblydevice.cpp | 2 +- 16 files changed, 22 insertions(+), 36 deletions(-) diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index 155d30b8eba..08dc2ca0d15 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -151,7 +151,7 @@ AndroidDevice::AndroidDevice() { setupId(IDevice::AutoDetected, Constants::ANDROID_DEVICE_ID); setType(Constants::ANDROID_DEVICE_TYPE); - setDefaultDisplayName(Tr::tr("Run on Android")); + settings()->displayName.setDefaultValue(Tr::tr("Run on Android")); setDisplayType(Tr::tr("Android")); setMachineType(IDevice::Hardware); setOsType(OsType::OsTypeOtherUnix); @@ -711,7 +711,7 @@ void AndroidDeviceManager::HandleAvdsListChange() AndroidDevice *newDev = new AndroidDevice(); newDev->setupId(IDevice::AutoDetected, deviceId); - newDev->setDisplayName(displayName); + newDev->settings()->displayName.setValue(displayName); newDev->setMachineType(item.type); newDev->setDeviceState(item.state); @@ -792,7 +792,7 @@ void AndroidDeviceManager::HandleDevicesListChange(const QString &serialNumber) } else { AndroidDevice *newDev = new AndroidDevice(); newDev->setupId(IDevice::AutoDetected, id); - newDev->setDisplayName(displayName); + newDev->settings()->displayName.setValue(displayName); newDev->setMachineType(IDevice::Hardware); newDev->setDeviceState(state); diff --git a/src/plugins/android/avddialog.cpp b/src/plugins/android/avddialog.cpp index a45423cc2c1..1a55c74fef2 100644 --- a/src/plugins/android/avddialog.cpp +++ b/src/plugins/android/avddialog.cpp @@ -167,7 +167,7 @@ ProjectExplorer::IDevice::Ptr AvdDialog::device() const using namespace ProjectExplorer; dev->setupId(IDevice::AutoDetected, deviceId); dev->setMachineType(IDevice::Emulator); - dev->setDisplayName(m_createdAvdInfo.name); + dev->settings()->displayName.setValue(m_createdAvdInfo.name); dev->setDeviceState(IDevice::DeviceConnected); dev->setExtraData(Constants::AndroidAvdName, m_createdAvdInfo.name); dev->setExtraData(Constants::AndroidCpuAbi, {m_createdAvdInfo.abi}); diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp b/src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp index 79df101ccf4..20b27d77e60 100644 --- a/src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp +++ b/src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp @@ -26,7 +26,7 @@ ProjectExplorer::IDevice::Ptr BareMetalDeviceConfigurationWizard::device() const { const auto dev = BareMetalDevice::create(); dev->setupId(ProjectExplorer::IDevice::ManuallyAdded, Utils::Id()); - dev->setDisplayName(m_setupPage->configurationName()); + dev->settings()->displayName.setDefaultValue(m_setupPage->configurationName()); dev->setType(Constants::BareMetalOsType); dev->setMachineType(ProjectExplorer::IDevice::Hardware); dev->setDebugServerProviderId(m_setupPage->debugServerProviderId()); diff --git a/src/plugins/boot2qt/device-detection/devicedetector.cpp b/src/plugins/boot2qt/device-detection/devicedetector.cpp index 78dfeb259de..10faa4fb3ca 100644 --- a/src/plugins/boot2qt/device-detection/devicedetector.cpp +++ b/src/plugins/boot2qt/device-detection/devicedetector.cpp @@ -82,7 +82,7 @@ void DeviceDetector::handleDeviceEvent(QdbDeviceTracker::DeviceEventType eventTy const QString name = Tr::tr("Qt Debug Bridge device %1").arg(serial); QdbDevice::Ptr device = QdbDevice::create(); device->setupId(IDevice::AutoDetected, deviceId); - device->setDisplayName(name); + device->settings()->displayName.setValue(name); device->setType(Qdb::Constants::QdbLinuxOsType); device->setMachineType(IDevice::Hardware); diff --git a/src/plugins/boot2qt/qdbdevice.cpp b/src/plugins/boot2qt/qdbdevice.cpp index 68546d046e2..717a945e9ba 100644 --- a/src/plugins/boot2qt/qdbdevice.cpp +++ b/src/plugins/boot2qt/qdbdevice.cpp @@ -226,7 +226,7 @@ public: { QdbDevice::Ptr device = QdbDevice::create(); - device->setDisplayName(settingsPage.deviceName()); + device->settings()->displayName.setValue(settingsPage.deviceName()); device->setupId(ProjectExplorer::IDevice::ManuallyAdded, Utils::Id()); device->setType(Constants::QdbLinuxOsType); device->setMachineType(ProjectExplorer::IDevice::Hardware); diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index ce63015d813..1344294c2cb 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -425,7 +425,8 @@ DockerDevice::DockerDevice(const DockerDeviceData &data) setupId(IDevice::ManuallyAdded); setType(Constants::DOCKER_DEVICE_TYPE); setMachineType(IDevice::Hardware); - setDisplayName(Tr::tr("Docker Image \"%1\" (%2)").arg(data.repoAndTag()).arg(data.imageId)); + settings()->displayName.setDefaultValue( + Tr::tr("Docker Image \"%1\" (%2)").arg(data.repoAndTag()).arg(data.imageId)); setAllowEmptyCommand(true); setOpenTerminal([this](const Environment &env, const FilePath &workingDir) { diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index 6315f6d5817..f76f41db976 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -86,7 +86,7 @@ IosDevice::IosDevice(CtorHelper) : m_lastPort(Constants::IOS_DEVICE_PORT_START) { setType(Constants::IOS_DEVICE_TYPE); - setDefaultDisplayName(IosDevice::name()); + settings()->displayName.setDefaultValue(IosDevice::name()); setDisplayType(Tr::tr("iOS")); setMachineType(IDevice::Hardware); setOsType(Utils::OsTypeMac); @@ -215,7 +215,7 @@ void IosDeviceManager::deviceConnected(const QString &uid, const QString &name) if (dev.isNull()) { auto newDev = new IosDevice(uid); if (!name.isNull()) - newDev->setDisplayName(name); + newDev->settings()->displayName.setValue(name); qCDebug(detectLog) << "adding ios device " << uid; devManager->addDevice(IDevice::ConstPtr(newDev)); } else if (dev->deviceState() != IDevice::DeviceConnected && @@ -285,7 +285,7 @@ void IosDeviceManager::deviceInfo(IosToolHandler *, const QString &uid, } if (!skipUpdate) { if (info.contains(kDeviceName)) - newDev->setDisplayName(info.value(kDeviceName)); + newDev->settings()->displayName.setValue(info.value(kDeviceName)); newDev->m_extraInfo = info; qCDebug(detectLog) << "updated info of ios device " << uid; dev = IDevice::ConstPtr(newDev); diff --git a/src/plugins/ios/iossimulator.cpp b/src/plugins/ios/iossimulator.cpp index 301d8d087e8..185db8f429d 100644 --- a/src/plugins/ios/iossimulator.cpp +++ b/src/plugins/ios/iossimulator.cpp @@ -28,7 +28,7 @@ IosSimulator::IosSimulator(Id id) setType(Constants::IOS_SIMULATOR_TYPE); setMachineType(IDevice::Emulator); setOsType(Utils::OsTypeMac); - setDefaultDisplayName(Tr::tr("iOS Simulator")); + settings()->displayName.setDefaultValue(Tr::tr("iOS Simulator")); setDisplayType(Tr::tr("iOS Simulator")); setDeviceState(DeviceReadyToUse); } diff --git a/src/plugins/mcusupport/mcusupportdevice.cpp b/src/plugins/mcusupport/mcusupportdevice.cpp index 9e3118cab6a..ad611f265fe 100644 --- a/src/plugins/mcusupport/mcusupportdevice.cpp +++ b/src/plugins/mcusupport/mcusupportdevice.cpp @@ -16,7 +16,7 @@ McuSupportDevice::McuSupportDevice() setupId(IDevice::AutoDetected, Constants::DEVICE_ID); setType(Constants::DEVICE_TYPE); const QString displayNameAndType = Tr::tr("MCU Device"); - setDefaultDisplayName(displayNameAndType); + settings()->displayName.setDefaultValue(displayNameAndType); setDisplayType(displayNameAndType); setDeviceState(IDevice::DeviceStateUnknown); setMachineType(IDevice::Hardware); diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index e895ee4f358..d7ffcf20981 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -258,7 +258,8 @@ void DeviceManager::addDevice(const IDevice::ConstPtr &_device) } // TODO: make it thread safe? - device->setDisplayName(Utils::makeUniquelyNumbered(device->displayName(), names)); + device->settings()->displayName.setValue( + Utils::makeUniquelyNumbered(device->displayName(), names)); const int pos = d->indexForId(device->id()); @@ -563,7 +564,7 @@ void ProjectExplorerPlugin::testDeviceManager() TestDeviceFactory factory; TestDevice::Ptr dev = IDevice::Ptr(new TestDevice); - dev->setDisplayName(QLatin1String("blubbdiblubbfurz!")); + dev->settings()->displayName.setValue(QLatin1String("blubbdiblubbfurz!")); QVERIFY(dev->isAutoDetected()); QCOMPARE(dev->deviceState(), IDevice::DeviceStateUnknown); QCOMPARE(dev->type(), TestDevice::testTypeId()); @@ -624,7 +625,7 @@ void ProjectExplorerPlugin::testDeviceManager() TestDevice::Ptr dev3 = IDevice::Ptr(new TestDevice); QVERIFY(dev->id() != dev3->id()); - dev3->setDisplayName(dev->displayName()); + dev3->settings()->displayName.setValue(dev->displayName()); mgr->addDevice(dev3); QCOMPARE(mgr->deviceAt(mgr->deviceCount() - 1)->displayName(), QString(dev3->displayName() + QLatin1Char('2'))); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index ed794585e15..85d32b7a0eb 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -308,25 +308,11 @@ Environment IDevice::systemEnvironment() const return access->deviceEnvironment(); } -/*! - Specifies a free-text name for the device to be displayed in GUI elements. -*/ - QString IDevice::displayName() const { return d->settings->displayName(); } -void IDevice::setDisplayName(const QString &name) -{ - settings()->displayName.setValue(name); -} - -void IDevice::setDefaultDisplayName(const QString &name) -{ - settings()->displayName.setDefaultValue(name); -} - QString IDevice::displayType() const { return d->displayType; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 12503f6b9a9..fb9366860e4 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -111,8 +111,6 @@ public: DeviceSettings *settings() const; QString displayName() const; - void setDisplayName(const QString &name); - void setDefaultDisplayName(const QString &name); // Provide some information on the device suitable for formated // output, e.g. in tool tips. Get a list of name value pairs. diff --git a/src/plugins/projectexplorer/kitaspects.cpp b/src/plugins/projectexplorer/kitaspects.cpp index 9e35593b337..57ef6b0fcd4 100644 --- a/src/plugins/projectexplorer/kitaspects.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -1319,7 +1319,7 @@ void BuildDeviceKitAspectFactory::addToMacroExpander(Kit *kit, MacroExpander *ex }); expander->registerVariable("BuildDevice:Name", Tr::tr("Build device name"), [kit] { const IDevice::ConstPtr device = BuildDeviceKitAspect::device(kit); - return device ? device->displayName() : QString(); + return device ? device->settings()->displayName() : QString(); }); expander ->registerFileVariables("BuildDevice::Root", Tr::tr("Build device root directory"), [kit] { diff --git a/src/plugins/qnx/qnxdevice.cpp b/src/plugins/qnx/qnxdevice.cpp index e355183c89d..5083fbb782a 100644 --- a/src/plugins/qnx/qnxdevice.cpp +++ b/src/plugins/qnx/qnxdevice.cpp @@ -62,7 +62,7 @@ public: QnxDevice() { setDisplayType(Tr::tr("QNX")); - setDefaultDisplayName(Tr::tr("QNX Device")); + settings()->displayName.setDefaultValue(Tr::tr("QNX Device")); setOsType(OsTypeOtherUnix); setupId(IDevice::ManuallyAdded); setType(Constants::QNX_QNX_OS_TYPE); diff --git a/src/plugins/remotelinux/sshdevicewizard.cpp b/src/plugins/remotelinux/sshdevicewizard.cpp index 9606ecf434a..d73e146957e 100644 --- a/src/plugins/remotelinux/sshdevicewizard.cpp +++ b/src/plugins/remotelinux/sshdevicewizard.cpp @@ -76,7 +76,7 @@ private: && !m_userNameLineEdit->text().trimmed().isEmpty(); } bool validatePage() final { - m_device->setDisplayName(m_nameLineEdit->text().trimmed()); + m_device->settings()->displayName.setValue(m_nameLineEdit->text().trimmed()); SshParameters sshParams = m_device->sshParameters(); sshParams.setHost(m_hostNameLineEdit->text().trimmed()); sshParams.setUserName(m_userNameLineEdit->text().trimmed()); diff --git a/src/plugins/webassembly/webassemblydevice.cpp b/src/plugins/webassembly/webassemblydevice.cpp index 643dea0edbf..c3f16926310 100644 --- a/src/plugins/webassembly/webassemblydevice.cpp +++ b/src/plugins/webassembly/webassemblydevice.cpp @@ -16,7 +16,7 @@ WebAssemblyDevice::WebAssemblyDevice() setupId(IDevice::AutoDetected, Constants::WEBASSEMBLY_DEVICE_DEVICE_ID); setType(Constants::WEBASSEMBLY_DEVICE_TYPE); const QString displayNameAndType = Tr::tr("Web Browser"); - setDefaultDisplayName(displayNameAndType); + settings()->displayName.setDefaultValue(displayNameAndType); setDisplayType(displayNameAndType); setDeviceState(IDevice::DeviceStateUnknown); setMachineType(IDevice::Hardware); From 61b6ab84687d9b9dece64b465567de6d04416510 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 8 Sep 2023 14:38:33 +0200 Subject: [PATCH 1043/1777] ProjectExplorer: Fix KitModel We must not call layoutChanged() without having called layoutAboutToBeChanged(). Change-Id: Ic64dc2a9b46fa1ec64f01fb416e78d3821df0e73 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/kitoptionspage.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/projectexplorer/kitoptionspage.cpp b/src/plugins/projectexplorer/kitoptionspage.cpp index f48361ef27f..21fcf862123 100644 --- a/src/plugins/projectexplorer/kitoptionspage.cpp +++ b/src/plugins/projectexplorer/kitoptionspage.cpp @@ -296,6 +296,8 @@ void KitModel::validateKitNames() void KitModel::apply() { + emit layoutAboutToBeChanged(); + // Add/update dirty nodes before removing kits. This ensures the right kit ends up as default. forItemsAtLevel<2>([](KitNode *n) { if (n->isDirty()) { From 6de236351bd08a2b378fd579f6a5fe7295d75a7b Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 8 Sep 2023 14:05:32 +0200 Subject: [PATCH 1044/1777] EditorManager: Do not instantiate MimeTypes during startup Which would trigger reading the MIME database, which is not needed at that point in time. We persist the map of MIME type to custom default factories via the MIME type names anyway, so just stay with that. Change-Id: I7570432573b16700e00811fe409d43a2db6c5347 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../editormanager/editormanager.cpp | 21 ++++++++----------- .../editormanager/ieditorfactory.cpp | 10 ++++----- .../editormanager/ieditorfactory_p.h | 6 ++---- src/plugins/coreplugin/mimetypesettings.cpp | 12 +++++------ 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 6bfb2ffea15..18073e1de1d 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1170,33 +1170,30 @@ Id EditorManagerPrivate::getOpenWithEditorId(const Utils::FilePath &fileName, bo return selectedId; } -static QMap<QString, QVariant> toMap(const QHash<Utils::MimeType, IEditorFactory *> &hash) +static QMap<QString, QVariant> toMap(const QHash<QString, IEditorFactory *> &hash) { QMap<QString, QVariant> map; auto it = hash.begin(); const auto end = hash.end(); while (it != end) { - map.insert(it.key().name(), it.value()->id().toSetting()); + map.insert(it.key(), it.value()->id().toSetting()); ++it; } return map; } -static QHash<Utils::MimeType, IEditorFactory *> fromMap(const QMap<QString, QVariant> &map) +static QHash<QString, IEditorFactory *> fromMap(const QMap<QString, QVariant> &map) { const EditorFactories factories = IEditorFactory::allEditorFactories(); - QHash<Utils::MimeType, IEditorFactory *> hash; + QHash<QString, IEditorFactory *> hash; auto it = map.begin(); const auto end = map.end(); while (it != end) { - const Utils::MimeType mimeType = Utils::mimeTypeForName(it.key()); - if (mimeType.isValid()) { - const Id factoryId = Id::fromSetting(it.value()); - IEditorFactory *factory = Utils::findOrDefault(factories, + const Id factoryId = Id::fromSetting(it.value()); + IEditorFactory *factory = Utils::findOrDefault(factories, Utils::equal(&IEditorFactory::id, factoryId)); - if (factory) - hash.insert(mimeType, factory); - } + if (factory) + hash.insert(it.key(), factory); ++it; } return hash; @@ -1223,7 +1220,7 @@ void EditorManagerPrivate::readSettings() else HostOsInfo::setOverrideFileNameCaseSensitivity(sensitivity); - const QHash<Utils::MimeType, IEditorFactory *> preferredEditorFactories = fromMap( + const QHash<QString, IEditorFactory *> preferredEditorFactories = fromMap( qs->value(preferredEditorFactoriesKey).toMap()); setUserPreferredEditorTypes(preferredEditorFactories); diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp index a87b427e62d..6b33314044e 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp +++ b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp @@ -131,7 +131,7 @@ static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType, */ static QList<IEditorFactory *> g_editorFactories; -static QHash<Utils::MimeType, IEditorFactory *> g_userPreferredEditorTypes; +static QHash<QString, IEditorFactory *> g_userPreferredEditorTypes; /*! Creates an IEditorFactory. @@ -190,7 +190,7 @@ const EditorFactories IEditorFactory::preferredEditorTypes(const FilePath &fileP MimeMatchMode::MatchDefaultAndRemote); EditorFactories factories = defaultEditorFactories(mimeType); // user preferred factory to front - IEditorFactory *userPreferred = Internal::userPreferredEditorTypes().value(mimeType); + IEditorFactory *userPreferred = Internal::userPreferredEditorTypes().value(mimeType.name()); if (userPreferred) { factories.removeAll(userPreferred); factories.prepend(userPreferred); @@ -238,7 +238,7 @@ const EditorFactories IEditorFactory::preferredEditorFactories(const FilePath &f factories.prepend(f); }; // user preferred factory to front - IEditorFactory *userPreferred = Internal::userPreferredEditorTypes().value(mimeType); + IEditorFactory *userPreferred = Internal::userPreferredEditorTypes().value(mimeType.name()); if (userPreferred && userPreferred->isInternalEditor()) factories_moveToFront(userPreferred); // open text files > 48 MB in binary editor @@ -328,7 +328,7 @@ void IEditorFactory::setEditorStarter(const std::function<bool(const FilePath &, /*! \internal */ -QHash<Utils::MimeType, IEditorFactory *> Internal::userPreferredEditorTypes() +QHash<QString, IEditorFactory *> Internal::userPreferredEditorTypes() { return g_userPreferredEditorTypes; } @@ -336,7 +336,7 @@ QHash<Utils::MimeType, IEditorFactory *> Internal::userPreferredEditorTypes() /*! \internal */ -void Internal::setUserPreferredEditorTypes(const QHash<Utils::MimeType, IEditorFactory *> &factories) +void Internal::setUserPreferredEditorTypes(const QHash<QString, IEditorFactory *> &factories) { g_userPreferredEditorTypes = factories; } diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory_p.h b/src/plugins/coreplugin/editormanager/ieditorfactory_p.h index 338f5ea24df..38d30524f68 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory_p.h +++ b/src/plugins/coreplugin/editormanager/ieditorfactory_p.h @@ -3,8 +3,6 @@ #pragma once -#include <utils/mimeutils.h> - #include <QHash> namespace Core { @@ -13,8 +11,8 @@ class IEditorFactory; namespace Internal { -QHash<Utils::MimeType, IEditorFactory *> userPreferredEditorTypes(); -void setUserPreferredEditorTypes(const QHash<Utils::MimeType, IEditorFactory *> &factories); +QHash<QString, IEditorFactory *> userPreferredEditorTypes(); +void setUserPreferredEditorTypes(const QHash<QString, IEditorFactory *> &factories); } // Internal } // Core diff --git a/src/plugins/coreplugin/mimetypesettings.cpp b/src/plugins/coreplugin/mimetypesettings.cpp index 814dd7be20f..0e39eaeb3e4 100644 --- a/src/plugins/coreplugin/mimetypesettings.cpp +++ b/src/plugins/coreplugin/mimetypesettings.cpp @@ -104,7 +104,7 @@ public: QList<Utils::MimeType> m_mimeTypes; mutable QHash<Utils::MimeType, QList<IEditorFactory *>> m_handlersByMimeType; - QHash<Utils::MimeType, IEditorFactory *> m_userDefault; + QHash<QString, IEditorFactory *> m_userDefault; }; int MimeTypeSettingsModel::rowCount(const QModelIndex &) const @@ -149,7 +149,7 @@ QVariant MimeTypeSettingsModel::data(const QModelIndex &modelIndex, int role) co } else if (role == Qt::FontRole) { if (column == 1) { const Utils::MimeType &type = m_mimeTypes.at(modelIndex.row()); - if (m_userDefault.contains(type)) { + if (m_userDefault.contains(type.name())) { QFont font = QGuiApplication::font(); font.setItalic(true); return font; @@ -174,9 +174,9 @@ bool MimeTypeSettingsModel::setData(const QModelIndex &index, const QVariant &va const QList<IEditorFactory *> handlers = handlersForMimeType(mimeType); QTC_ASSERT(handlers.contains(factory), return false); if (handlers.first() == factory) // selection is the default anyhow - m_userDefault.remove(mimeType); + m_userDefault.remove(mimeType.name()); else - m_userDefault.insert(mimeType, factory); + m_userDefault.insert(mimeType.name(), factory); emit dataChanged(index, index); return true; } @@ -209,8 +209,8 @@ QList<IEditorFactory *> MimeTypeSettingsModel::handlersForMimeType(const Utils:: IEditorFactory *MimeTypeSettingsModel::defaultHandlerForMimeType(const Utils::MimeType &mimeType) const { - if (m_userDefault.contains(mimeType)) - return m_userDefault.value(mimeType); + if (m_userDefault.contains(mimeType.name())) + return m_userDefault.value(mimeType.name()); const QList<IEditorFactory *> handlers = handlersForMimeType(mimeType); return handlers.isEmpty() ? nullptr : handlers.first(); } From 0701145c554fd718ffd176526f0940bb755358f4 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 7 Sep 2023 15:36:25 +0200 Subject: [PATCH 1045/1777] ScreenRecorder: Block dialog UI and show spinner while exporting ...instead of just disabling the "Export..." button. Change-Id: I3d2b414233492b400e02a39c89677dedce475100 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/screenrecorder/CMakeLists.txt | 1 + src/plugins/screenrecorder/export.cpp | 15 ++++++++------- src/plugins/screenrecorder/export.h | 3 ++- src/plugins/screenrecorder/screenrecorder.qbs | 4 +--- .../screenrecorder/screenrecorderplugin.cpp | 14 ++++++++++++++ 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/plugins/screenrecorder/CMakeLists.txt b/src/plugins/screenrecorder/CMakeLists.txt index b10f68aadec..a16e316b2c8 100644 --- a/src/plugins/screenrecorder/CMakeLists.txt +++ b/src/plugins/screenrecorder/CMakeLists.txt @@ -1,5 +1,6 @@ add_qtc_plugin(ScreenRecorder PLUGIN_DEPENDS Core + DEPENDS Spinner SOURCES cropandtrim.cpp cropandtrim.h export.cpp export.h diff --git a/src/plugins/screenrecorder/export.cpp b/src/plugins/screenrecorder/export.cpp index aae3d020475..24e8a935532 100644 --- a/src/plugins/screenrecorder/export.cpp +++ b/src/plugins/screenrecorder/export.cpp @@ -164,16 +164,17 @@ ExportWidget::ExportWidget(QWidget *parent) startExport(); } }); - connect(m_process, &Process::started, this, [exportButton] { - exportButton->setEnabled(false); + connect(m_process, &Process::started, this, [this] { + emit started(); }); - connect(m_process, &Process::done, this, [this, exportButton] { - exportButton->setEnabled(true); + connect(m_process, &Process::done, this, [this] { m_futureInterface->reportFinished(); - if (m_process->exitCode() == 0) - emit clipReady(m_outputClipInfo); - else + if (m_process->exitCode() == 0) { + emit finished(m_outputClipInfo.file); + } else { FFmpegUtils::reportError(m_process->commandLine(), m_lastOutputChunk); + emit finished({}); + } }); connect(m_process, &Process::readyReadStandardError, this, [this] { m_lastOutputChunk = m_process->readAllRawStandardError(); diff --git a/src/plugins/screenrecorder/export.h b/src/plugins/screenrecorder/export.h index 8a6c476ad5f..b6e23d9b854 100644 --- a/src/plugins/screenrecorder/export.h +++ b/src/plugins/screenrecorder/export.h @@ -48,7 +48,8 @@ public: void setTrimRange(FrameRange range); signals: - void clipReady(const ClipInfo &clip); + void started(); + void finished(const Utils::FilePath &clip); private: void startExport(); diff --git a/src/plugins/screenrecorder/screenrecorder.qbs b/src/plugins/screenrecorder/screenrecorder.qbs index 61639d11fc7..3d361c6b672 100644 --- a/src/plugins/screenrecorder/screenrecorder.qbs +++ b/src/plugins/screenrecorder/screenrecorder.qbs @@ -3,10 +3,8 @@ import qbs 1.0 QtcPlugin { name: "ScreenRecorder" - Depends { name: "Qt.widgets" } - Depends { name: "Utils" } - Depends { name: "Core" } + Depends { name: "Spinner" } files: [ "cropandtrim.cpp", diff --git a/src/plugins/screenrecorder/screenrecorderplugin.cpp b/src/plugins/screenrecorder/screenrecorderplugin.cpp index ff72193840c..d1e4c070951 100644 --- a/src/plugins/screenrecorder/screenrecorderplugin.cpp +++ b/src/plugins/screenrecorder/screenrecorderplugin.cpp @@ -21,6 +21,8 @@ #include <utils/stylehelper.h> #include <utils/temporaryfile.h> +#include <solutions/spinner/spinner.h> + #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/command.h> @@ -76,6 +78,17 @@ public: m_exportWidget, &ExportWidget::setCropRect); connect(m_cropAndTrimStatusWidget, &CropAndTrimWidget::trimRangeChanged, m_exportWidget, &ExportWidget::setTrimRange); + connect(m_exportWidget, &ExportWidget::started, this, [this] { + setEnabled(false); + m_spinner->show(); + }); + connect(m_exportWidget, &ExportWidget::finished, this, [this] { + setEnabled(true); + m_spinner->hide(); + }); + + m_spinner = new SpinnerSolution::Spinner(SpinnerSolution::SpinnerSize::Medium, this); + m_spinner->hide(); } private: @@ -83,6 +96,7 @@ private: TemporaryFile m_recordFile; CropAndTrimWidget *m_cropAndTrimStatusWidget; ExportWidget *m_exportWidget; + SpinnerSolution::Spinner *m_spinner; }; class ScreenRecorderPlugin final : public ExtensionSystem::IPlugin From 38690bc7d01dae661ada1aaf95b4982345ff0620 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 7 Sep 2023 22:35:13 +0200 Subject: [PATCH 1046/1777] ScreenRecorder: Make dialog less cluttered and non-resizable The "Trim and Crop..." button now jas a static text and shows crop and trim details via tooltip. The confusing resizability of the dialog is prevented. Change-Id: If967d8014a0751f7d2360bf7b239bf22f070024c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/screenrecorder/cropandtrim.cpp | 22 +++++++++++-------- src/plugins/screenrecorder/record.cpp | 2 ++ .../screenrecorder/screenrecorderplugin.cpp | 3 ++- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp index 992221b106e..16cdb3ec3c3 100644 --- a/src/plugins/screenrecorder/cropandtrim.cpp +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -688,6 +688,7 @@ CropAndTrimWidget::CropAndTrimWidget(QWidget *parent) : StyledBar(parent) { m_button = new QToolButton; + m_button->setText(Tr::tr("Crop and Trim...")); m_cropSizeWarningIcon = new CropSizeWarningIcon(CropSizeWarningIcon::ToolBarVariant); @@ -727,17 +728,20 @@ void CropAndTrimWidget::setClip(const ClipInfo &clip) void CropAndTrimWidget::updateWidgets() { - const QString cropText = - !m_clipInfo.isCompleteArea(m_cropRect) - ? Tr::tr("Crop to %1x%2px.").arg(m_cropRect.width()).arg(m_cropRect.height()) - : Tr::tr("Complete area."); + if (!m_clipInfo.isNull()) { + const QString cropText = + !m_clipInfo.isCompleteArea(m_cropRect) + ? Tr::tr("Crop to %1x%2px.").arg(m_cropRect.width()).arg(m_cropRect.height()) + : Tr::tr("Complete area."); - const QString trimText = - !m_clipInfo.isCompleteRange(m_trimRange) - ? Tr::tr("Frames %1 to %2.").arg(m_trimRange.first).arg(m_trimRange.second) - : Tr::tr("Complete clip."); + const QString trimText = + !m_clipInfo.isCompleteRange(m_trimRange) + ? Tr::tr("Frames %1 to %2.").arg(m_trimRange.first).arg(m_trimRange.second) + : Tr::tr("Complete clip."); + + m_button->setToolTip(cropText + " " + trimText); + } - m_button->setText(cropText + " " + trimText + ".."); m_cropSizeWarningIcon->setCropSize(m_cropRect.size()); } diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index d60501e092a..51c80d6d42b 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -174,6 +174,8 @@ RecordWidget::RecordWidget(const FilePath &recordFile, QWidget *parent) : StyledBar(parent) , m_recordFile(recordFile) { + setMinimumWidth(220); + m_process = new Process(this); m_process->setUseCtrlCStub(true); m_process->setProcessMode(ProcessMode::Writer); diff --git a/src/plugins/screenrecorder/screenrecorderplugin.cpp b/src/plugins/screenrecorder/screenrecorderplugin.cpp index d1e4c070951..f84e866e935 100644 --- a/src/plugins/screenrecorder/screenrecorderplugin.cpp +++ b/src/plugins/screenrecorder/screenrecorderplugin.cpp @@ -44,7 +44,6 @@ public: , m_recordFile("XXXXXX" + RecordWidget::recordFileExtension()) { setWindowTitle(Tr::tr("Record Screen")); - setMinimumWidth(320); StyleHelper::setPanelWidget(this); m_recordFile.open(); @@ -89,6 +88,8 @@ public: m_spinner = new SpinnerSolution::Spinner(SpinnerSolution::SpinnerSize::Medium, this); m_spinner->hide(); + + layout()->setSizeConstraint(QLayout::SetFixedSize); } private: From 7268f036de98f773052cb4a4135cf95ee1dc5456 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 12 Sep 2023 08:07:49 +0200 Subject: [PATCH 1047/1777] Valgrind: Add missing error type Fixes: QTCREATORBUG-29600 Change-Id: Ia6b6549865f9940f2e93fbe998788d201a3550fa Reviewed-by: hjk <hjk@qt.io> --- src/plugins/valgrind/xmlprotocol/error.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/valgrind/xmlprotocol/error.h b/src/plugins/valgrind/xmlprotocol/error.h index 749d3b72613..a9dd3278b8f 100644 --- a/src/plugins/valgrind/xmlprotocol/error.h +++ b/src/plugins/valgrind/xmlprotocol/error.h @@ -37,7 +37,8 @@ enum MemcheckError Leak_DefinitelyLost, Leak_PossiblyLost, Leak_StillReachable, - Leak_IndirectlyLost + Leak_IndirectlyLost, + ReallocSizeZero }; Q_ENUM_NS(MemcheckError); From d6dba7dc9f05d91697d103fc3520e4b8037d20d6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 11 Sep 2023 15:30:07 +0200 Subject: [PATCH 1048/1777] Utils: Merge settingsutils.h into Store setup Change-Id: I4f87400d3ff50869798a363f0d15aa77af0edf5c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/libs/utils/CMakeLists.txt | 1 - src/libs/utils/settingsutils.h | 47 ------------------- src/libs/utils/store.cpp | 20 ++++++++ src/libs/utils/store.h | 7 +++ src/libs/utils/utils.qbs | 1 - .../cppeditor/cppcodemodelsettings.cpp | 6 +-- .../cppeditor/cppcodestylesettings.cpp | 1 - src/plugins/cppeditor/cpptoolssettings.cpp | 7 ++- .../qmljstools/qmljscodestylesettings.cpp | 1 - src/plugins/qmljstools/qmljstoolssettings.cpp | 6 +-- src/plugins/texteditor/behaviorsettings.cpp | 6 +-- .../texteditor/extraencodingsettings.cpp | 7 +-- .../texteditor/icodestylepreferences.cpp | 6 +-- src/plugins/texteditor/storagesettings.cpp | 5 +- src/plugins/texteditor/tabsettings.cpp | 6 +-- src/plugins/texteditor/typingsettings.cpp | 6 +-- 16 files changed, 47 insertions(+), 86 deletions(-) delete mode 100644 src/libs/utils/settingsutils.h diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 9f1569b73b2..79f2bc323ae 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -147,7 +147,6 @@ add_qtc_library(Utils set_algorithm.h settingsaccessor.cpp settingsaccessor.h settingsselector.cpp settingsselector.h - settingsutils.h singleton.cpp singleton.h sizedarray.h smallstring.h diff --git a/src/libs/utils/settingsutils.h b/src/libs/utils/settingsutils.h deleted file mode 100644 index 5806ca44868..00000000000 --- a/src/libs/utils/settingsutils.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "store.h" -#include "qtcsettings.h" - -#include <QSettings> -#include <QStringList> -#include <QVariant> - -namespace Utils { - -template <class SettingsClassT> -void fromSettings(const Key &postFix, - const Key &category, - QtcSettings *s, - SettingsClassT *obj) -{ - Store map; - s->beginGroup(category + postFix); - const KeyList keys = keysFromStrings(s->allKeys()); - for (const Key &key : keys) - map.insert(key, s->value(key)); - s->endGroup(); - obj->fromMap(map); -} - -template <class SettingsClassT> -void toSettings(const Key &postFix, - const Key &category, - QtcSettings *s, - const SettingsClassT *obj) -{ - Key group = postFix; - if (!category.isEmpty()) - group.insert(0, category); - const Store map = obj->toMap(); - - s->beginGroup(group); - for (auto it = map.constBegin(), end = map.constEnd(); it != end; ++it) - s->setValue(it.key(), it.value()); - s->endGroup(); -} - -} // Utils diff --git a/src/libs/utils/store.cpp b/src/libs/utils/store.cpp index 42a14d6f1a9..4047aced9fe 100644 --- a/src/libs/utils/store.cpp +++ b/src/libs/utils/store.cpp @@ -5,6 +5,7 @@ #include "algorithm.h" #include "qtcassert.h" +#include "qtcsettings.h" #include <QJsonDocument> #include <QJsonParseError> @@ -133,4 +134,23 @@ QByteArray jsonFromStore(const Store &store) return doc.toJson(); } +Store storeFromSettings(const Key &groupKey, QtcSettings *s) +{ + Store store; + s->beginGroup(groupKey); + const KeyList keys = keysFromStrings(s->allKeys()); + for (const Key &key : keys) + store.insert(key, s->value(key)); + s->endGroup(); + return store; +} + +void storeToSettings(const Key &groupKey, QtcSettings *s, const Store &store) +{ + s->beginGroup(groupKey); + for (auto it = store.constBegin(), end = store.constEnd(); it != end; ++it) + s->setValue(it.key(), it.value()); + s->endGroup(); +} + } // Utils diff --git a/src/libs/utils/store.h b/src/libs/utils/store.h index f09b98f3306..196f9777e44 100644 --- a/src/libs/utils/store.h +++ b/src/libs/utils/store.h @@ -11,6 +11,8 @@ namespace Utils { +class QtcSettings; + using KeyList = QList<Key>; using Store = QMap<Key, QVariant>; @@ -31,6 +33,11 @@ QTCREATOR_UTILS_EXPORT Key numberedKey(const Key &key, int number); QTCREATOR_UTILS_EXPORT expected_str<Store> storeFromJson(const QByteArray &json); QTCREATOR_UTILS_EXPORT QByteArray jsonFromStore(const Store &store); + +// Don't use in new code. +QTCREATOR_UTILS_EXPORT Store storeFromSettings(const Key &groupKey, QtcSettings *s); +QTCREATOR_UTILS_EXPORT void storeToSettings(const Key &groupKey, QtcSettings *s, const Store &store); + } // Utils Q_DECLARE_METATYPE(Utils::Store) diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 1110ad11c73..ba5665ab8f4 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -279,7 +279,6 @@ Project { "settingsaccessor.h", "settingsselector.cpp", "settingsselector.h", - "settingsutils.h", "singleton.cpp", "singleton.h", "sizedarray.h", diff --git a/src/plugins/cppeditor/cppcodemodelsettings.cpp b/src/plugins/cppeditor/cppcodemodelsettings.cpp index d08551b13da..02b22e3a545 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettings.cpp @@ -17,7 +17,6 @@ #include <utils/hostosinfo.h> #include <utils/process.h> #include <utils/qtcassert.h> -#include <utils/settingsutils.h> #include <QDateTime> #include <QHash> @@ -400,7 +399,8 @@ FilePath ClangdSettings::clangdUserConfigFilePath() void ClangdSettings::loadSettings() { const auto settings = Core::ICore::settings(); - Utils::fromSettings(clangdSettingsKey(), {}, settings, &m_data); + + m_data.fromMap(Utils::storeFromSettings(clangdSettingsKey(), settings)); settings->beginGroup(QLatin1String(Constants::CPPEDITOR_SETTINGSGROUP)); m_data.customDiagnosticConfigs = diagnosticConfigsFromSettings(settings); @@ -419,7 +419,7 @@ void ClangdSettings::loadSettings() void ClangdSettings::saveSettings() { const auto settings = Core::ICore::settings(); - Utils::toSettings(clangdSettingsKey(), {}, settings, &m_data); + Utils::storeToSettings(clangdSettingsKey(), settings, m_data.toMap()); settings->beginGroup(QLatin1String(Constants::CPPEDITOR_SETTINGSGROUP)); diagnosticConfigsToSettings(settings, m_data.customDiagnosticConfigs); settings->endGroup(); diff --git a/src/plugins/cppeditor/cppcodestylesettings.cpp b/src/plugins/cppeditor/cppcodestylesettings.cpp index 557940f7660..733f066eaca 100644 --- a/src/plugins/cppeditor/cppcodestylesettings.cpp +++ b/src/plugins/cppeditor/cppcodestylesettings.cpp @@ -16,7 +16,6 @@ #include <cplusplus/Overview.h> #include <utils/qtcassert.h> -#include <utils/settingsutils.h> static const char indentBlockBracesKey[] = "IndentBlockBraces"; static const char indentBlockBodyKey[] = "IndentBlockBody"; diff --git a/src/plugins/cppeditor/cpptoolssettings.cpp b/src/plugins/cppeditor/cpptoolssettings.cpp index 49ceb0c963b..ad3dfd18388 100644 --- a/src/plugins/cppeditor/cpptoolssettings.cpp +++ b/src/plugins/cppeditor/cpptoolssettings.cpp @@ -9,16 +9,15 @@ #include "cppcodestylepreferencesfactory.h" #include <coreplugin/icore.h> + +#include <extensionsystem/pluginmanager.h> + #include <texteditor/completionsettingspage.h> #include <texteditor/codestylepool.h> #include <texteditor/tabsettings.h> #include <texteditor/texteditorsettings.h> -#include <extensionsystem/pluginmanager.h> #include <utils/qtcassert.h> -#include <utils/settingsutils.h> - -#include <QSettings> static const char idKey[] = "CppGlobal"; const bool kSortEditorDocumentOutlineDefault = true; diff --git a/src/plugins/qmljstools/qmljscodestylesettings.cpp b/src/plugins/qmljstools/qmljscodestylesettings.cpp index e08575af66a..c03501ac016 100644 --- a/src/plugins/qmljstools/qmljscodestylesettings.cpp +++ b/src/plugins/qmljstools/qmljscodestylesettings.cpp @@ -15,7 +15,6 @@ #include <cplusplus/Overview.h> #include <utils/qtcassert.h> -#include <utils/settingsutils.h> static const char lineLengthKey[] = "LineLength"; diff --git a/src/plugins/qmljstools/qmljstoolssettings.cpp b/src/plugins/qmljstools/qmljstoolssettings.cpp index bb4c813ce05..b5cdac7e200 100644 --- a/src/plugins/qmljstools/qmljstoolssettings.cpp +++ b/src/plugins/qmljstools/qmljstoolssettings.cpp @@ -7,15 +7,13 @@ #include "qmljstoolssettings.h" #include "qmljstoolstr.h" +#include <coreplugin/icore.h> + #include <texteditor/texteditorsettings.h> #include <texteditor/tabsettings.h> #include <texteditor/codestylepool.h> -#include <utils/settingsutils.h> #include <utils/qtcassert.h> -#include <coreplugin/icore.h> - -#include <QSettings> using namespace TextEditor; diff --git a/src/plugins/texteditor/behaviorsettings.cpp b/src/plugins/texteditor/behaviorsettings.cpp index 0a638867165..955b7d6709d 100644 --- a/src/plugins/texteditor/behaviorsettings.cpp +++ b/src/plugins/texteditor/behaviorsettings.cpp @@ -5,8 +5,6 @@ #include <coreplugin/icore.h> -#include <utils/settingsutils.h> - #include <QString> static const char mouseHidingKey[] = "MouseHiding"; @@ -35,13 +33,13 @@ BehaviorSettings::BehaviorSettings() : void BehaviorSettings::toSettings(const Key &category) const { - Utils::toSettings(groupPostfix, category, Core::ICore::settings(), this); + Utils::storeToSettings(category + groupPostfix, Core::ICore::settings(), toMap()); } void BehaviorSettings::fromSettings(const Key &category) { *this = BehaviorSettings(); - Utils::fromSettings(groupPostfix, category, Core::ICore::settings(), this); + fromMap(Utils::storeFromSettings(category + groupPostfix, Core::ICore::settings())); } Store BehaviorSettings::toMap() const diff --git a/src/plugins/texteditor/extraencodingsettings.cpp b/src/plugins/texteditor/extraencodingsettings.cpp index dd724488ad8..e95e37b7e2e 100644 --- a/src/plugins/texteditor/extraencodingsettings.cpp +++ b/src/plugins/texteditor/extraencodingsettings.cpp @@ -3,13 +3,10 @@ #include "extraencodingsettings.h" -#include "behaviorsettingswidget.h" #include "texteditortr.h" #include <coreplugin/icore.h> -#include <utils/settingsutils.h> - // Keep this for compatibility reasons. static const char kGroupPostfix[] = "EditorManager"; static const char kUtf8BomBehaviorKey[] = "Utf8BomBehavior"; @@ -27,7 +24,7 @@ void ExtraEncodingSettings::toSettings(const Key &category) const { Q_UNUSED(category) - Utils::toSettings(kGroupPostfix, Key(), Core::ICore::settings(), this); + Utils::storeToSettings(kGroupPostfix, Core::ICore::settings(), toMap()); } void ExtraEncodingSettings::fromSettings(const Key &category) @@ -35,7 +32,7 @@ void ExtraEncodingSettings::fromSettings(const Key &category) Q_UNUSED(category) *this = ExtraEncodingSettings(); - Utils::fromSettings(kGroupPostfix, Key(), Core::ICore::settings(), this); + fromMap(Utils::storeFromSettings(kGroupPostfix, Core::ICore::settings())); } Store ExtraEncodingSettings::toMap() const diff --git a/src/plugins/texteditor/icodestylepreferences.cpp b/src/plugins/texteditor/icodestylepreferences.cpp index 3fffa8401a3..864c3a777ea 100644 --- a/src/plugins/texteditor/icodestylepreferences.cpp +++ b/src/plugins/texteditor/icodestylepreferences.cpp @@ -7,8 +7,6 @@ #include <coreplugin/icore.h> -#include <utils/settingsutils.h> - using namespace Utils; static const char currentPreferencesKey[] = "CurrentPreferences"; @@ -214,12 +212,12 @@ void ICodeStylePreferences::setSettingsSuffix(const Key &suffix) void ICodeStylePreferences::toSettings(const Key &category) const { - Utils::toSettings(d->m_settingsSuffix, category, Core::ICore::settings(), this); + Utils::storeToSettings(category + d->m_settingsSuffix, Core::ICore::settings(), toMap()); } void ICodeStylePreferences::fromSettings(const Key &category) { - Utils::fromSettings(d->m_settingsSuffix, category, Core::ICore::settings(), this); + fromMap(Utils::storeFromSettings(category + d->m_settingsSuffix, Core::ICore::settings())); } Store ICodeStylePreferences::toMap() const diff --git a/src/plugins/texteditor/storagesettings.cpp b/src/plugins/texteditor/storagesettings.cpp index 6352bf3e566..c0ee52bae12 100644 --- a/src/plugins/texteditor/storagesettings.cpp +++ b/src/plugins/texteditor/storagesettings.cpp @@ -6,7 +6,6 @@ #include <coreplugin/icore.h> #include <utils/hostosinfo.h> -#include <utils/settingsutils.h> #include <QRegularExpression> @@ -35,13 +34,13 @@ StorageSettings::StorageSettings() void StorageSettings::toSettings(const Key &category) const { - Utils::toSettings(groupPostfix, category, Core::ICore::settings(), this); + Utils::storeToSettings(category + groupPostfix, Core::ICore::settings(), toMap()); } void StorageSettings::fromSettings(const Key &category) { *this = StorageSettings(); - Utils::fromSettings(groupPostfix, category, Core::ICore::settings(), this); + fromMap(Utils::storeFromSettings(category + groupPostfix, Core::ICore::settings())); } Store StorageSettings::toMap() const diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index ff5e9b729e5..a723c4ab4b1 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -3,8 +3,6 @@ #include "tabsettings.h" -#include <utils/settingsutils.h> - #include <QDebug> #include <QSettings> #include <QTextCursor> @@ -35,13 +33,13 @@ TabSettings::TabSettings(TabSettings::TabPolicy tabPolicy, void TabSettings::toSettings(const Key &category, QtcSettings *s) const { - Utils::toSettings(groupPostfix, category, s, this); + Utils::storeToSettings(category + groupPostfix, s, toMap()); } void TabSettings::fromSettings(const Key &category, QtcSettings *s) { *this = TabSettings(); // Assign defaults - Utils::fromSettings(groupPostfix, category, s, this); + fromMap(Utils::storeFromSettings(category + groupPostfix, s)); } Store TabSettings::toMap() const diff --git a/src/plugins/texteditor/typingsettings.cpp b/src/plugins/texteditor/typingsettings.cpp index 402d472848c..e80a1fc4d8b 100644 --- a/src/plugins/texteditor/typingsettings.cpp +++ b/src/plugins/texteditor/typingsettings.cpp @@ -5,8 +5,6 @@ #include <coreplugin/icore.h> -#include <utils/settingsutils.h> - #include <QTextCursor> #include <QTextDocument> @@ -30,13 +28,13 @@ TypingSettings::TypingSettings(): void TypingSettings::toSettings(const Key &category) const { - Utils::toSettings(groupPostfix, category, Core::ICore::settings(), this); + Utils::storeToSettings(category + groupPostfix, Core::ICore::settings(), toMap()); } void TypingSettings::fromSettings(const Key &category) { *this = TypingSettings(); // Assign defaults - Utils::fromSettings(groupPostfix, category, Core::ICore::settings(), this); + fromMap(Utils::storeFromSettings(category + groupPostfix, Core::ICore::settings())); } Store TypingSettings::toMap() const From 2494ba4bf835f8b0333293813d7683609849cfbc Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 11 Sep 2023 16:53:52 +0200 Subject: [PATCH 1049/1777] TextEditor: Access some settings more directly Change-Id: Idc65001efde36de011db3ca528af761d2b8344e8 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/texteditor/behaviorsettings.cpp | 14 --------- src/plugins/texteditor/behaviorsettings.h | 3 -- .../texteditor/behaviorsettingspage.cpp | 31 +++++++++++-------- .../texteditor/extraencodingsettings.cpp | 18 ----------- .../texteditor/extraencodingsettings.h | 3 -- src/plugins/texteditor/storagesettings.cpp | 12 ------- src/plugins/texteditor/storagesettings.h | 3 -- src/plugins/texteditor/tabsettings.cpp | 13 -------- src/plugins/texteditor/tabsettings.h | 3 -- src/plugins/texteditor/typingsettings.cpp | 12 ------- src/plugins/texteditor/typingsettings.h | 3 -- 11 files changed, 18 insertions(+), 97 deletions(-) diff --git a/src/plugins/texteditor/behaviorsettings.cpp b/src/plugins/texteditor/behaviorsettings.cpp index 955b7d6709d..391e3a60e84 100644 --- a/src/plugins/texteditor/behaviorsettings.cpp +++ b/src/plugins/texteditor/behaviorsettings.cpp @@ -5,15 +5,12 @@ #include <coreplugin/icore.h> -#include <QString> - static const char mouseHidingKey[] = "MouseHiding"; static const char mouseNavigationKey[] = "MouseNavigation"; static const char scrollWheelZoomingKey[] = "ScrollWheelZooming"; static const char constrainTooltips[] = "ConstrainTooltips"; static const char camelCaseNavigationKey[] = "CamelCaseNavigation"; static const char keyboardTooltips[] = "KeyboardTooltips"; -static const char groupPostfix[] = "BehaviorSettings"; static const char smartSelectionChanging[] = "SmartSelectionChanging"; using namespace Utils; @@ -31,17 +28,6 @@ BehaviorSettings::BehaviorSettings() : { } -void BehaviorSettings::toSettings(const Key &category) const -{ - Utils::storeToSettings(category + groupPostfix, Core::ICore::settings(), toMap()); -} - -void BehaviorSettings::fromSettings(const Key &category) -{ - *this = BehaviorSettings(); - fromMap(Utils::storeFromSettings(category + groupPostfix, Core::ICore::settings())); -} - Store BehaviorSettings::toMap() const { return { diff --git a/src/plugins/texteditor/behaviorsettings.h b/src/plugins/texteditor/behaviorsettings.h index e33fe5a2573..57f88f1b2c7 100644 --- a/src/plugins/texteditor/behaviorsettings.h +++ b/src/plugins/texteditor/behaviorsettings.h @@ -18,9 +18,6 @@ class TEXTEDITOR_EXPORT BehaviorSettings public: BehaviorSettings(); - void toSettings(const Utils::Key &category) const; - void fromSettings(const Utils::Key &category); - Utils::Store toMap() const; void fromMap(const Utils::Store &map); diff --git a/src/plugins/texteditor/behaviorsettingspage.cpp b/src/plugins/texteditor/behaviorsettingspage.cpp index 705f8ba8d20..4b1fad44bcb 100644 --- a/src/plugins/texteditor/behaviorsettingspage.cpp +++ b/src/plugins/texteditor/behaviorsettingspage.cpp @@ -28,15 +28,18 @@ #include <qmljseditor/qmljseditorconstants.h> #include <qmljstools/qmljstoolsconstants.h> -#include <QCoreApplication> #include <QGridLayout> -#include <QPointer> #include <QSpacerItem> using namespace Utils; namespace TextEditor { +const char behaviorGroup[] = "textBehaviorSettings"; +const char storageGroup[] = "textStorageSettings"; +const char typingGroup[] = "textTypingSettings"; +const char extraEncodingGroup[] = "textEditorManager"; + class BehaviorSettingsPagePrivate : public QObject { public: @@ -65,11 +68,12 @@ BehaviorSettingsPagePrivate::BehaviorSettingsPagePrivate() m_defaultCodeStylePool = new CodeStylePool(nullptr, this); // Any language m_defaultCodeStylePool->addCodeStyle(m_codeStyle); + QtcSettings *s = Core::ICore::settings(); m_codeStyle->fromSettings(m_settingsPrefix); - m_typingSettings.fromSettings(m_settingsPrefix); - m_storageSettings.fromSettings(m_settingsPrefix); - m_behaviorSettings.fromSettings(m_settingsPrefix); - m_extraEncodingSettings.fromSettings(m_settingsPrefix); + m_typingSettings.fromMap(storeFromSettings(typingGroup, s)); + m_storageSettings.fromMap(storeFromSettings(storageGroup, s)); + m_behaviorSettings.fromMap(storeFromSettings(behaviorGroup, s)); + m_extraEncodingSettings.fromMap(storeFromSettings(extraEncodingGroup, s)); } class BehaviorSettingsWidgetImpl : public Core::IOptionsPageWidget @@ -143,6 +147,8 @@ void BehaviorSettingsWidgetImpl::apply() if (!d->m_behaviorWidget) // page was never shown return; + QtcSettings *s = Core::ICore::settings(); + TypingSettings newTypingSettings; StorageSettings newStorageSettings; BehaviorSettings newBehaviorSettings; @@ -165,36 +171,35 @@ void BehaviorSettingsWidgetImpl::apply() if (newTypingSettings != d->m_typingSettings) { d->m_typingSettings = newTypingSettings; - d->m_typingSettings.toSettings(d->m_settingsPrefix); + storeToSettings(typingGroup, s, d->m_typingSettings.toMap()); emit TextEditorSettings::instance()->typingSettingsChanged(newTypingSettings); } if (newStorageSettings != d->m_storageSettings) { d->m_storageSettings = newStorageSettings; - d->m_storageSettings.toSettings(d->m_settingsPrefix); + storeToSettings(storageGroup, s, d->m_storageSettings.toMap()); emit TextEditorSettings::instance()->storageSettingsChanged(newStorageSettings); } if (newBehaviorSettings != d->m_behaviorSettings) { d->m_behaviorSettings = newBehaviorSettings; - d->m_behaviorSettings.toSettings(d->m_settingsPrefix); + storeToSettings(behaviorGroup, s, d->m_behaviorSettings.toMap()); emit TextEditorSettings::instance()->behaviorSettingsChanged(newBehaviorSettings); } if (newExtraEncodingSettings != d->m_extraEncodingSettings) { d->m_extraEncodingSettings = newExtraEncodingSettings; - d->m_extraEncodingSettings.toSettings(d->m_settingsPrefix); + storeToSettings(extraEncodingGroup, s, d->m_extraEncodingSettings.toMap()); emit TextEditorSettings::instance()->extraEncodingSettingsChanged(newExtraEncodingSettings); } - QSettings *s = Core::ICore::settings(); - s->setValue(QLatin1String(Core::Constants::SETTINGS_DEFAULTTEXTENCODING), + s->setValue(Core::Constants::SETTINGS_DEFAULTTEXTENCODING, d->m_behaviorWidget->assignedCodecName()); - s->setValue(QLatin1String(Core::Constants::SETTINGS_DEFAULT_LINE_TERMINATOR), + s->setValue(Core::Constants::SETTINGS_DEFAULT_LINE_TERMINATOR, d->m_behaviorWidget->assignedLineEnding()); } diff --git a/src/plugins/texteditor/extraencodingsettings.cpp b/src/plugins/texteditor/extraencodingsettings.cpp index e95e37b7e2e..dab2869423b 100644 --- a/src/plugins/texteditor/extraencodingsettings.cpp +++ b/src/plugins/texteditor/extraencodingsettings.cpp @@ -5,10 +5,7 @@ #include "texteditortr.h" -#include <coreplugin/icore.h> - // Keep this for compatibility reasons. -static const char kGroupPostfix[] = "EditorManager"; static const char kUtf8BomBehaviorKey[] = "Utf8BomBehavior"; using namespace Utils; @@ -20,21 +17,6 @@ ExtraEncodingSettings::ExtraEncodingSettings() : m_utf8BomSetting(OnlyKeep) ExtraEncodingSettings::~ExtraEncodingSettings() = default; -void ExtraEncodingSettings::toSettings(const Key &category) const -{ - Q_UNUSED(category) - - Utils::storeToSettings(kGroupPostfix, Core::ICore::settings(), toMap()); -} - -void ExtraEncodingSettings::fromSettings(const Key &category) -{ - Q_UNUSED(category) - - *this = ExtraEncodingSettings(); - fromMap(Utils::storeFromSettings(kGroupPostfix, Core::ICore::settings())); -} - Store ExtraEncodingSettings::toMap() const { return { diff --git a/src/plugins/texteditor/extraencodingsettings.h b/src/plugins/texteditor/extraencodingsettings.h index 6dcff332e4e..4d54dc2d7fc 100644 --- a/src/plugins/texteditor/extraencodingsettings.h +++ b/src/plugins/texteditor/extraencodingsettings.h @@ -15,9 +15,6 @@ public: ExtraEncodingSettings(); ~ExtraEncodingSettings(); - void toSettings(const Utils::Key &category) const; - void fromSettings(const Utils::Key &category); - Utils::Store toMap() const; void fromMap(const Utils::Store &map); diff --git a/src/plugins/texteditor/storagesettings.cpp b/src/plugins/texteditor/storagesettings.cpp index c0ee52bae12..b84011855c8 100644 --- a/src/plugins/texteditor/storagesettings.cpp +++ b/src/plugins/texteditor/storagesettings.cpp @@ -19,7 +19,6 @@ static const char addFinalNewLineKey[] = "addFinalNewLine"; static const char cleanIndentationKey[] = "cleanIndentation"; static const char skipTrailingWhitespaceKey[] = "skipTrailingWhitespace"; static const char ignoreFileTypesKey[] = "ignoreFileTypes"; -static const char groupPostfix[] = "StorageSettings"; static const char defaultTrailingWhitespaceBlacklist[] = "*.md, *.MD, Makefile"; StorageSettings::StorageSettings() @@ -32,17 +31,6 @@ StorageSettings::StorageSettings() { } -void StorageSettings::toSettings(const Key &category) const -{ - Utils::storeToSettings(category + groupPostfix, Core::ICore::settings(), toMap()); -} - -void StorageSettings::fromSettings(const Key &category) -{ - *this = StorageSettings(); - fromMap(Utils::storeFromSettings(category + groupPostfix, Core::ICore::settings())); -} - Store StorageSettings::toMap() const { return { diff --git a/src/plugins/texteditor/storagesettings.h b/src/plugins/texteditor/storagesettings.h index bf3ac1ba32a..757ad246a25 100644 --- a/src/plugins/texteditor/storagesettings.h +++ b/src/plugins/texteditor/storagesettings.h @@ -14,9 +14,6 @@ class TEXTEDITOR_EXPORT StorageSettings public: StorageSettings(); - void toSettings(const Utils::Key &category) const; - void fromSettings(const Utils::Key &category); - Utils::Store toMap() const; void fromMap(const Utils::Store &map); diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index a723c4ab4b1..c6c0558636f 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -12,7 +12,6 @@ static const char spacesForTabsKey[] = "SpacesForTabs"; static const char autoSpacesForTabsKey[] = "AutoSpacesForTabs"; static const char tabSizeKey[] = "TabSize"; static const char indentSizeKey[] = "IndentSize"; -static const char groupPostfix[] = "TabSettings"; static const char paddingModeKey[] = "PaddingMode"; using namespace Utils; @@ -28,18 +27,6 @@ TabSettings::TabSettings(TabSettings::TabPolicy tabPolicy, , m_indentSize(indentSize) , m_continuationAlignBehavior(continuationAlignBehavior) { - -} - -void TabSettings::toSettings(const Key &category, QtcSettings *s) const -{ - Utils::storeToSettings(category + groupPostfix, s, toMap()); -} - -void TabSettings::fromSettings(const Key &category, QtcSettings *s) -{ - *this = TabSettings(); // Assign defaults - fromMap(Utils::storeFromSettings(category + groupPostfix, s)); } Store TabSettings::toMap() const diff --git a/src/plugins/texteditor/tabsettings.h b/src/plugins/texteditor/tabsettings.h index 73e895112ca..9a446738d0c 100644 --- a/src/plugins/texteditor/tabsettings.h +++ b/src/plugins/texteditor/tabsettings.h @@ -35,9 +35,6 @@ public: TabSettings(TabPolicy tabPolicy, int tabSize, int indentSize, ContinuationAlignBehavior continuationAlignBehavior); - void toSettings(const Utils::Key &category, Utils::QtcSettings *s) const; - void fromSettings(const Utils::Key &category, Utils::QtcSettings *s); - Utils::Store toMap() const; void fromMap(const Utils::Store &map); diff --git a/src/plugins/texteditor/typingsettings.cpp b/src/plugins/texteditor/typingsettings.cpp index e80a1fc4d8b..731f922a9dd 100644 --- a/src/plugins/texteditor/typingsettings.cpp +++ b/src/plugins/texteditor/typingsettings.cpp @@ -12,7 +12,6 @@ static const char autoIndentKey[] = "AutoIndent"; static const char tabKeyBehaviorKey[] = "TabKeyBehavior"; static const char smartBackspaceBehaviorKey[] = "SmartBackspaceBehavior"; static const char preferSingleLineCommentsKey[] = "PreferSingleLineComments"; -static const char groupPostfix[] = "TypingSettings"; using namespace Utils; @@ -26,17 +25,6 @@ TypingSettings::TypingSettings(): { } -void TypingSettings::toSettings(const Key &category) const -{ - Utils::storeToSettings(category + groupPostfix, Core::ICore::settings(), toMap()); -} - -void TypingSettings::fromSettings(const Key &category) -{ - *this = TypingSettings(); // Assign defaults - fromMap(Utils::storeFromSettings(category + groupPostfix, Core::ICore::settings())); -} - Store TypingSettings::toMap() const { return { diff --git a/src/plugins/texteditor/typingsettings.h b/src/plugins/texteditor/typingsettings.h index 63b1e6bea18..03d48610f39 100644 --- a/src/plugins/texteditor/typingsettings.h +++ b/src/plugins/texteditor/typingsettings.h @@ -35,9 +35,6 @@ public: bool tabShouldIndent(const QTextDocument *document, const QTextCursor &cursor, int *suggestedPosition) const; - void toSettings(const Utils::Key &category) const; - void fromSettings(const Utils::Key &category); - Utils::Store toMap() const; void fromMap(const Utils::Store &map); From 8bcec807d9f83d0d14b4699d282e89aa342002b0 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 12 Sep 2023 08:57:05 +0200 Subject: [PATCH 1050/1777] Utils: Fix AspectContainer::setAutoApply Removes duplicate m_autoApply from AspectContainerPrivate. Fixes issue when calling BaseAspect::setAutoApply() on an AspectContainer. Change-Id: I5f56d8d3c6d52d32c9365faf3d0e22facb757f03 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 6 +++--- src/libs/utils/aspects.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index f49cdf57048..26eb97cf491 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -2479,7 +2479,6 @@ class Internal::AspectContainerPrivate public: QList<BaseAspect *> m_items; // Both owned and non-owned. QList<BaseAspect *> m_ownedItems; // Owned only. - bool m_autoApply = true; QStringList m_settingsGroup; std::function<Layouting::LayoutItem ()> m_layouter; }; @@ -2501,7 +2500,7 @@ AspectContainer::~AspectContainer() */ void AspectContainer::registerAspect(BaseAspect *aspect, bool takeOwnership) { - aspect->setAutoApply(d->m_autoApply); + aspect->setAutoApply(isAutoApply()); d->m_items.append(aspect); if (takeOwnership) d->m_ownedItems.append(aspect); @@ -2631,7 +2630,8 @@ void AspectContainer::reset() void AspectContainer::setAutoApply(bool on) { - d->m_autoApply = on; + BaseAspect::setAutoApply(on); + for (BaseAspect *aspect : std::as_const(d->m_items)) aspect->setAutoApply(on); } diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 909b19a5be5..793dcbb7bbd 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -79,7 +79,7 @@ public: void setVisible(bool visible); bool isAutoApply() const; - void setAutoApply(bool on); + virtual void setAutoApply(bool on); bool isEnabled() const; void setEnabled(bool enabled); @@ -860,7 +860,7 @@ public: void reset(); bool equals(const AspectContainer &other) const; void copyFrom(const AspectContainer &other); - void setAutoApply(bool on); + void setAutoApply(bool on) override; bool isDirty() override; template <typename T> T *aspect() const From 66c8eda94397f929cca2f8f6697aeeba396e1a5d Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 12 Sep 2023 07:34:53 +0200 Subject: [PATCH 1051/1777] Utils: Add Undo facilities for aspects Change-Id: I2a8acfa23b3a4303414be21af224b08c13561666 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 34 ++++++++++++++++++++ src/libs/utils/aspects.h | 65 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 26eb97cf491..f1559b77167 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -31,6 +31,7 @@ #include <QSettings> #include <QSpinBox> #include <QTextEdit> +#include <QUndoStack> using namespace Layouting; @@ -84,6 +85,8 @@ public: BaseAspect::DataCreator m_dataCreator; BaseAspect::DataCloner m_dataCloner; QList<BaseAspect::DataExtractor> m_dataExtractors; + + QUndoStack *m_undoStack = nullptr; }; /*! @@ -302,6 +305,29 @@ void BaseAspect::setToolTip(const QString &tooltip) } } +void BaseAspect::setUndoStack(QUndoStack *undoStack) +{ + d->m_undoStack = undoStack; +} + +QUndoStack *BaseAspect::undoStack() const +{ + return d->m_undoStack; +} + +void BaseAspect::pushUndo(QUndoCommand *cmd) +{ + if (!cmd) + return; + + if (d->m_undoStack) + d->m_undoStack->push(cmd); + else { + cmd->redo(); + delete cmd; + } +} + bool BaseAspect::isEnabled() const { return d->m_enabled; @@ -2645,6 +2671,14 @@ bool AspectContainer::isDirty() return false; } +void AspectContainer::setUndoStack(QUndoStack *undoStack) +{ + BaseAspect::setUndoStack(undoStack); + + for (BaseAspect *aspect : std::as_const(d->m_items)) + aspect->setUndoStack(undoStack); +} + bool AspectContainer::equals(const AspectContainer &other) const { // FIXME: Expensive, but should not really be needed in a fully aspectified world. diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 793dcbb7bbd..35773ce7d25 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -15,9 +15,12 @@ #include <memory> #include <optional> +#include <QUndoCommand> + QT_BEGIN_NAMESPACE class QAction; class QSettings; +class QUndoStack; QT_END_NAMESPACE namespace Layouting { class LayoutItem; } @@ -81,6 +84,10 @@ public: bool isAutoApply() const; virtual void setAutoApply(bool on); + virtual void setUndoStack(QUndoStack *undoStack); + QUndoStack *undoStack() const; + void pushUndo(QUndoCommand *cmd); + bool isEnabled() const; void setEnabled(bool enabled); void setEnabler(BoolAspect *checker); @@ -862,6 +869,7 @@ public: void copyFrom(const AspectContainer &other); void setAutoApply(bool on) override; bool isDirty() override; + void setUndoStack(QUndoStack *undoStack) override; template <typename T> T *aspect() const { @@ -900,4 +908,61 @@ private: std::unique_ptr<Internal::AspectContainerPrivate> d; }; +// Because QObject cannot be a template +class QTCREATOR_UTILS_EXPORT UndoSignaller : public QObject +{ + Q_OBJECT +public: + void emitChanged() { emit changed(); } +signals: + void changed(); +}; + +template<class T> +class QTCREATOR_UTILS_EXPORT UndoableValue +{ +public: + class UndoCmd : public QUndoCommand + { + public: + UndoCmd(UndoableValue<T> *value, const T &oldValue, const T &newValue) + : m_value(value) + , m_oldValue(oldValue) + , m_newValue(newValue) + {} + + void undo() override { m_value->setInternal(m_oldValue); } + void redo() override { m_value->setInternal(m_newValue); } + + private: + UndoableValue<T> *m_value; + T m_oldValue; + T m_newValue; + }; + + QUndoCommand *set(const T &value) + { + if (m_value == value) + return nullptr; + + return new UndoCmd(this, m_value, value); + } + + void setSilently(const T &value) { m_value = value; } + + T get() const { return m_value; } + + UndoSignaller m_signal; + +private: + void setInternal(const T &value) + { + m_value = value; + m_signal.emitChanged(); + } + +private: + T m_value; +}; + } // namespace Utils From dab19c4a8c60ed482d1082064d23609a1acf4e5e Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 30 Aug 2023 15:04:29 +0200 Subject: [PATCH 1052/1777] Use Nanotrace to generate startup performance report Add various trace points to the code, including the plugin initialization methods (centrally in plugin manager), code that is scheduled on the event loop with QTimer::singleShot or QMetaObject::invokeMethod during initialization, and code that is triggered from ICore::coreOpened Can be turned on by configuring with `BUILD_LIBRARY_NANOTRACE=ON` Run with `-trace <file>` to write trace file. If Nanotrace is not built, the added code expands to nothing. Changes in Nanotrace: - turned generated data to microseconds instead of nanoseconds, because that is what Chrome tracing expects - fixed serialization of duration (needs to be an item of the event, not in a "arg" subitem) - fixed shutdown() to reset the initEvent Change-Id: I994de82023b820d771e1be0a859ebd8da0b73d4d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/libs/CMakeLists.txt | 2 +- src/libs/extensionsystem/CMakeLists.txt | 5 + src/libs/extensionsystem/optionsparser.cpp | 13 +++ src/libs/extensionsystem/optionsparser.h | 2 + src/libs/extensionsystem/pluginmanager.cpp | 77 ++++++++++--- src/libs/extensionsystem/pluginmanager_p.h | 1 + src/libs/nanotrace/nanotrace.cpp | 109 +++++++++--------- src/libs/nanotrace/nanotrace.h | 2 +- src/libs/utils/CMakeLists.txt | 5 + src/libs/utils/mimetypes2/mimedatabase.cpp | 3 + src/plugins/android/androidplugin.cpp | 3 + .../cmakeprojectmanager/cmaketoolmanager.cpp | 3 + .../actionmanager/actionmanager.cpp | 2 + src/plugins/coreplugin/mainwindow.cpp | 3 + src/plugins/coreplugin/session.cpp | 3 + src/plugins/debugger/debuggeritemmanager.cpp | 3 + src/plugins/git/gitplugin.cpp | 3 + src/plugins/projectexplorer/kitmanager.cpp | 3 + .../projectexplorer/projectexplorer.cpp | 3 + .../projectexplorer/toolchainmanager.cpp | 3 + .../toolchainsettingsaccessor.cpp | 6 + src/plugins/qmljseditor/qmllssettings.cpp | 2 + src/plugins/qtsupport/qtversionmanager.cpp | 15 ++- .../studiowelcome/studiowelcomeplugin.cpp | 4 + 24 files changed, 198 insertions(+), 77 deletions(-) diff --git a/src/libs/CMakeLists.txt b/src/libs/CMakeLists.txt index 73a554bae8b..536e3734949 100644 --- a/src/libs/CMakeLists.txt +++ b/src/libs/CMakeLists.txt @@ -1,5 +1,6 @@ add_subdirectory(3rdparty) +add_subdirectory(nanotrace) add_subdirectory(advanceddockingsystem) add_subdirectory(aggregation) add_subdirectory(cplusplus) @@ -8,7 +9,6 @@ add_subdirectory(glsl) add_subdirectory(languageserverprotocol) add_subdirectory(languageutils) add_subdirectory(modelinglib) -add_subdirectory(nanotrace) add_subdirectory(qmldebug) add_subdirectory(qmleditorwidgets) add_subdirectory(qmljs) diff --git a/src/libs/extensionsystem/CMakeLists.txt b/src/libs/extensionsystem/CMakeLists.txt index 0e4e6607a55..edc1daa2455 100644 --- a/src/libs/extensionsystem/CMakeLists.txt +++ b/src/libs/extensionsystem/CMakeLists.txt @@ -26,3 +26,8 @@ extend_qtc_library(ExtensionSystem DEPENDS Qt::Test DEFINES WITH_TESTS ) + +extend_qtc_library(ExtensionSystem + CONDITION TARGET Nanotrace + PUBLIC_DEPENDS Nanotrace +) diff --git a/src/libs/extensionsystem/optionsparser.cpp b/src/libs/extensionsystem/optionsparser.cpp index 116a1f4fe21..205442488e6 100644 --- a/src/libs/extensionsystem/optionsparser.cpp +++ b/src/libs/extensionsystem/optionsparser.cpp @@ -22,6 +22,7 @@ const char *OptionsParser::TEST_OPTION = "-test"; const char *OptionsParser::NOTEST_OPTION = "-notest"; const char *OptionsParser::SCENARIO_OPTION = "-scenario"; const char *OptionsParser::PROFILE_OPTION = "-profile"; +const char *OptionsParser::TRACE_OPTION = "-trace"; const char *OptionsParser::NO_CRASHCHECK_OPTION = "-no-crashcheck"; OptionsParser::OptionsParser(const QStringList &args, @@ -60,6 +61,8 @@ bool OptionsParser::parse() continue; if (checkForProfilingOption()) continue; + if (checkForTraceOption()) + continue; if (checkForNoCrashcheckOption()) continue; #ifdef WITH_TESTS @@ -243,6 +246,16 @@ bool OptionsParser::checkForProfilingOption() return true; } +bool OptionsParser::checkForTraceOption() +{ + if (m_currentArg != QLatin1String(TRACE_OPTION)) + return false; + if (nextToken(RequiredToken)) { + m_pmPrivate->enableTracing(m_currentArg); + } + return true; +} + bool OptionsParser::checkForNoCrashcheckOption() { if (m_currentArg != QLatin1String(NO_CRASHCHECK_OPTION)) diff --git a/src/libs/extensionsystem/optionsparser.h b/src/libs/extensionsystem/optionsparser.h index ee11582c3b0..93f3812c8d3 100644 --- a/src/libs/extensionsystem/optionsparser.h +++ b/src/libs/extensionsystem/optionsparser.h @@ -28,6 +28,7 @@ public: static const char *NOTEST_OPTION; static const char *SCENARIO_OPTION; static const char *PROFILE_OPTION; + static const char *TRACE_OPTION; static const char *NO_CRASHCHECK_OPTION; private: @@ -41,6 +42,7 @@ private: bool checkForAppOption(); bool checkForPluginOption(); bool checkForProfilingOption(); + bool checkForTraceOption(); bool checkForNoCrashcheckOption(); bool checkForUnknownOption(); void forceDisableAllPluginsExceptTestedAndForceEnabled(); diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 6d56fdb2dc3..e24f92447df 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -10,6 +10,8 @@ #include "pluginspec.h" #include "pluginspec_p.h" +#include <nanotrace/nanotrace.h> + #include <utils/algorithm.h> #include <utils/benchmarker.h> #include <utils/fileutils.h> @@ -721,6 +723,12 @@ void PluginManager::formatOptions(QTextStream &str, int optionIndentation, int d formatOption(str, QLatin1String(OptionsParser::PROFILE_OPTION), QString(), QLatin1String("Profile plugin loading"), optionIndentation, descriptionIndentation); + formatOption(str, + QLatin1String(OptionsParser::TRACE_OPTION), + QLatin1String("file"), + QLatin1String("Write trace file (CTF) for plugin loading"), + optionIndentation, + descriptionIndentation); formatOption(str, QLatin1String(OptionsParser::NO_CRASHCHECK_OPTION), QString(), @@ -932,9 +940,16 @@ PluginSpecPrivate *PluginManagerPrivate::privateSpec(PluginSpec *spec) void PluginManagerPrivate::nextDelayedInitialize() { + static bool first = true; + if (first) { + first = false; + NANOTRACE_BEGIN("ExtensionSystem", "DelayedInitialize"); + } while (!delayedInitializeQueue.empty()) { PluginSpec *spec = delayedInitializeQueue.front(); + const std::string specName = spec->name().toStdString(); delayedInitializeQueue.pop(); + NANOTRACE_SCOPE(specName, specName + "::delayedInitialized"); profilingReport(">delayedInitialize", spec); bool delay = spec->d->delayedInitialize(); profilingReport("<delayedInitialize", spec, &spec->d->performanceData.delayedInitialize); @@ -948,6 +963,8 @@ void PluginManagerPrivate::nextDelayedInitialize() if (m_profileTimer) m_totalStartupMS = m_profileTimer->elapsed(); printProfilingSummary(); + NANOTRACE_END("ExtensionSystem", "DelayedInitialize"); + NANOTRACE_SHUTDOWN(); emit q->initializationDone(); #ifdef WITH_TESTS if (PluginManager::testRunRequested()) @@ -1340,23 +1357,32 @@ void PluginManagerPrivate::loadPlugins() const QVector<PluginSpec *> queue = loadQueue(); Utils::setMimeStartupPhase(MimeStartupPhase::PluginsLoading); - for (PluginSpec *spec : queue) - loadPlugin(spec, PluginSpec::Loaded); + { + NANOTRACE_SCOPE("ExtensionSystem", "Load"); + for (PluginSpec *spec : queue) + loadPlugin(spec, PluginSpec::Loaded); + } Utils::setMimeStartupPhase(MimeStartupPhase::PluginsInitializing); - for (PluginSpec *spec : queue) - loadPlugin(spec, PluginSpec::Initialized); + { + NANOTRACE_SCOPE("ExtensionSystem", "Initialize"); + for (PluginSpec *spec : queue) + loadPlugin(spec, PluginSpec::Initialized); + } Utils::setMimeStartupPhase(MimeStartupPhase::PluginsDelayedInitializing); - Utils::reverseForeach(queue, [this](PluginSpec *spec) { - loadPlugin(spec, PluginSpec::Running); - if (spec->state() == PluginSpec::Running) { - delayedInitializeQueue.push(spec); - } else { - // Plugin initialization failed, so cleanup after it - spec->d->kill(); - } - }); + { + NANOTRACE_SCOPE("ExtensionSystem", "ExtensionsInitialized"); + Utils::reverseForeach(queue, [this](PluginSpec *spec) { + loadPlugin(spec, PluginSpec::Running); + if (spec->state() == PluginSpec::Running) { + delayedInitializeQueue.push(spec); + } else { + // Plugin initialization failed, so cleanup after it + spec->d->kill(); + } + }); + } emit q->pluginsChanged(); Utils::setMimeStartupPhase(MimeStartupPhase::UpAndRunning); @@ -1582,14 +1608,18 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt if (enableCrashCheck && destState < PluginSpec::Stopped) lockFile.reset(new LockFile(this, spec)); + const std::string specName = spec->name().toStdString(); + switch (destState) { - case PluginSpec::Running: + case PluginSpec::Running: { + NANOTRACE_SCOPE(specName, specName + "::extensionsInitialized"); profilingReport(">initializeExtensions", spec); spec->d->initializeExtensions(); profilingReport("<initializeExtensions", spec, &spec->d->performanceData.extensionsInitialized); return; + } case PluginSpec::Deleted: profilingReport(">delete", spec); spec->d->kill(); @@ -1613,16 +1643,20 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt } } switch (destState) { - case PluginSpec::Loaded: + case PluginSpec::Loaded: { + NANOTRACE_SCOPE(specName, specName + "::load"); profilingReport(">loadLibrary", spec); spec->d->loadLibrary(); profilingReport("<loadLibrary", spec, &spec->d->performanceData.load); break; - case PluginSpec::Initialized: + } + case PluginSpec::Initialized: { + NANOTRACE_SCOPE(specName, specName + "::initialize"); profilingReport(">initializePlugin", spec); spec->d->initializePlugin(); profilingReport("<initializePlugin", spec, &spec->d->performanceData.initialize); break; + } case PluginSpec::Stopped: profilingReport(">stop", spec); if (spec->d->stop() == IPlugin::AsynchronousShutdown) { @@ -1764,6 +1798,17 @@ void PluginManagerPrivate::increaseProfilingVerbosity() PluginManager::startProfiling(); } +void PluginManagerPrivate::enableTracing(const QString &filePath) +{ + const QString jsonFilePath = filePath.endsWith(".json") ? filePath : filePath + ".json"; +#ifdef NANOTRACE_ENABLED + qDebug() << "Trace event file (CTF) will be saved at" << qPrintable(jsonFilePath); +#endif + NANOTRACE_INIT(QCoreApplication::applicationName().toStdString(), + "Main", + jsonFilePath.toStdString()); +} + void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *spec, qint64 *target) { if (m_profileTimer) { diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index 63d017ac556..a0ea60ed483 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -59,6 +59,7 @@ public: void resolveDependencies(); void enableDependenciesIndirectly(); void increaseProfilingVerbosity(); + void enableTracing(const QString &filePath); QString profilingSummary(qint64 *totalOut = nullptr) const; void printProfilingSummary() const; void profilingReport(const char *what, const PluginSpec *spec, qint64 *target = nullptr); diff --git a/src/libs/nanotrace/nanotrace.cpp b/src/libs/nanotrace/nanotrace.cpp index 6af2db58bcf..658d84a43f1 100644 --- a/src/libs/nanotrace/nanotrace.cpp +++ b/src/libs/nanotrace/nanotrace.cpp @@ -73,6 +73,7 @@ struct TraceEvent int64_t oh; int64_t ts; + int64_t dur = 0; std::vector< Nanotrace::Arg > args; @@ -100,7 +101,10 @@ std::ostream& operator<<(std::ostream &stream, const TraceEvent &event) << "{ \"cat\":\"" << event.cat << "\", \"pid\":" << event.pid << ", \"tid\":\"" << event.tid << "\"" - << ", \"ts\":" << event.ts + << ", \"ts\":" << event.ts; + if (event.dur > -1) + stream << ", \"dur\":" << event.dur; + stream << ", \"ph\":\"" << event.ph << "\", \"name\":\"" << event.name << "\", \"args\": { \"overhead\": " << event.oh; @@ -112,7 +116,6 @@ std::ostream& operator<<(std::ostream &stream, const TraceEvent &event) return stream; } - void init(const std::string &process, const std::string &thread, const std::string &path) { auto now = Clock::now(); @@ -125,43 +128,40 @@ void init(const std::string &process, const std::string &thread, const std::stri initEvent.ts = now; events.reserve(eventCount); - events.push_back(TraceEvent { - getProcessId(), - std::this_thread::get_id(), - "process_name", - "", - 'M', - 0, - 0, - {{"name", process}} - } ); + events.push_back(TraceEvent{getProcessId(), + std::this_thread::get_id(), + "process_name", + "", + 'M', + 0, + 0, + -1, + {{"name", process}}}); - events.push_back(TraceEvent { - getProcessId(), - std::this_thread::get_id(), - "thread_name", - "", - 'M', - 0, - 0, - {{"name", thread}} - } ); + events.push_back(TraceEvent{getProcessId(), + std::this_thread::get_id(), + "thread_name", + "", + 'M', + 0, + 0, + -1, + {{"name", thread}}}); if (std::ofstream stream(path, std::ios::trunc); stream.good()) stream << "{ \"traceEvents\": [\n"; else std::cout << "Nanotrace::init: stream not good" << std::endl; - events.push_back(TraceEvent { - getProcessId(), - std::this_thread::get_id(), - "Initialize", - "Initialize", - 'I', - 0, - std::chrono::duration_cast< Units >(Clock::now() - now).count(), - {} - } ); + events.push_back(TraceEvent{getProcessId(), + std::this_thread::get_id(), + "Initialize", + "Initialize", + 'I', + 0, + std::chrono::duration_cast<Units>(Clock::now() - now).count(), + -1, + {}}); initEvent.overhead = std::chrono::duration_cast< Units >(Clock::now() - now).count(); } @@ -174,6 +174,7 @@ void shutdown() stream << "\n] }"; else std::cout << "Nanotrace::shutdown: stream not good" << std::endl; + initEvent = {}; } void addTracePoint( @@ -188,16 +189,15 @@ void addTracePoint( auto now = Clock::now(); auto beg = std::chrono::duration_cast< Units >(now - initEvent.ts); - events.push_back( TraceEvent { - getProcessId(), - std::this_thread::get_id(), - name, - cat, - phase, - initEvent.overhead, - beg.count(), - {arguments} - } ); + events.push_back(TraceEvent{getProcessId(), + std::this_thread::get_id(), + name, + cat, + phase, + initEvent.overhead, + beg.count(), + -1, + {arguments}}); if (events.size() >= eventCount - 1) flush(); @@ -238,20 +238,19 @@ ScopeTracer::~ScopeTracer() return; auto now = Clock::now(); - auto beg = std::chrono::duration_cast< Units >(m_start - initEvent.ts); + auto beg = std::chrono::duration_cast<Units>(m_start - initEvent.ts); + const int64_t dur = std::chrono::duration_cast<Units>(now - m_start).count(); - m_args.push_back(Arg("dur", std::chrono::duration_cast< Units >(now - m_start).count())); - - events.push_back(TraceEvent { - getProcessId(), - std::this_thread::get_id(), - m_name, - m_cat, - 'X', - initEvent.overhead, - beg.count(), - { m_args } - } ); + m_args.push_back(Arg("dur", dur)); + events.push_back(TraceEvent{getProcessId(), + std::this_thread::get_id(), + m_name, + m_cat, + 'X', + initEvent.overhead, + beg.count(), + dur, + {m_args}}); if (events.size() >= eventCount - 1) flush(); diff --git a/src/libs/nanotrace/nanotrace.h b/src/libs/nanotrace/nanotrace.h index ab390519caf..65bc66d0cf2 100644 --- a/src/libs/nanotrace/nanotrace.h +++ b/src/libs/nanotrace/nanotrace.h @@ -50,7 +50,7 @@ namespace Nanotrace { -using Units = std::chrono::nanoseconds; +using Units = std::chrono::microseconds; using Clock = std::chrono::high_resolution_clock; using TimePoint = std::chrono::time_point< Clock >; diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 79f2bc323ae..b7f956f968f 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -276,6 +276,11 @@ extend_qtc_library(Utils fsengine/filepathinfocache.h ) +extend_qtc_library(Utils + CONDITION TARGET Nanotrace + DEPENDS Nanotrace +) + if (WIN32) add_qtc_executable(qtcreator_ctrlc_stub DEPENDS user32 shell32 diff --git a/src/libs/utils/mimetypes2/mimedatabase.cpp b/src/libs/utils/mimetypes2/mimedatabase.cpp index cba76f733ae..b4966a952dd 100644 --- a/src/libs/utils/mimetypes2/mimedatabase.cpp +++ b/src/libs/utils/mimetypes2/mimedatabase.cpp @@ -13,6 +13,8 @@ #include "algorithm.h" +#include <nanotrace/nanotrace.h> + #include <QFile> #include <QFileInfo> #include <QStandardPaths> @@ -90,6 +92,7 @@ static void updateOverriddenMimeTypes(std::vector<std::unique_ptr<MimeProviderBa void MimeDatabasePrivate::loadProviders() { + NANOTRACE_SCOPE("Utils", "MimeDatabasePrivate::loadProviders"); #if 0 // We use QStandardPaths every time to check if new files appeared const QStringList mimeDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime"), QStandardPaths::LocateDirectory); diff --git a/src/plugins/android/androidplugin.cpp b/src/plugins/android/androidplugin.cpp index 82a1bbfca0f..2ed71e194b4 100644 --- a/src/plugins/android/androidplugin.cpp +++ b/src/plugins/android/androidplugin.cpp @@ -49,6 +49,8 @@ #include <qtsupport/qtversionmanager.h> +#include <nanotrace/nanotrace.h> + #include <QTimer> using namespace ProjectExplorer; @@ -141,6 +143,7 @@ void AndroidPlugin::kitsRestored() void AndroidPlugin::askUserAboutAndroidSetup() { + NANOTRACE_SCOPE("Android", "AndroidPlugin::askUserAboutAndroidSetup"); if (!Core::ICore::infoBar()->canInfoBeAdded(kSetupAndroidSetting)) return; diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index b5dd3601b0c..d8978e3bc61 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -17,6 +17,8 @@ #include <utils/pointeralgorithm.h> #include <utils/qtcassert.h> +#include <nanotrace/nanotrace.h> + using namespace Core; using namespace Utils; @@ -134,6 +136,7 @@ CMakeTool *CMakeToolManager::findById(const Id &id) void CMakeToolManager::restoreCMakeTools() { + NANOTRACE_SCOPE("CMakeProjectManager", "CMakeToolManager::restoreCMakeTools"); Internal::CMakeToolSettingsAccessor::CMakeTools tools = d->m_accessor.restoreCMakeTools(ICore::dialogParent()); d->m_cmakeTools = std::move(tools.cmakeTools); diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index 58b4c61a1e9..d3ae55ab163 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -12,6 +12,8 @@ #include <utils/fadingindicator.h> #include <utils/qtcassert.h> +#include <nanotrace/nanotrace.h> + #include <QAction> #include <QApplication> #include <QDebug> diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index f4e3364109d..0f4f303a754 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -64,6 +64,8 @@ #include <utils/terminalcommand.h> #include <utils/utilsicons.h> +#include <nanotrace/nanotrace.h> + #include <QAbstractProxyModel> #include <QActionGroup> #include <QApplication> @@ -1549,6 +1551,7 @@ QPrinter *MainWindow::printer() const void MainWindow::restoreWindowState() { + NANOTRACE_SCOPE("Core", "MainWindow::restoreWindowState"); QSettings *settings = PluginManager::settings(); settings->beginGroup(QLatin1String(settingsGroup)); if (!restoreGeometry(settings->value(QLatin1String(windowGeometryKey)).toByteArray())) diff --git a/src/plugins/coreplugin/session.cpp b/src/plugins/coreplugin/session.cpp index 07f7e5f175d..84481287214 100644 --- a/src/plugins/coreplugin/session.cpp +++ b/src/plugins/coreplugin/session.cpp @@ -28,6 +28,8 @@ #include <utils/stringutils.h> #include <utils/stylehelper.h> +#include <nanotrace/nanotrace.h> + #include <QAction> #include <QActionGroup> #include <QFutureInterface> @@ -400,6 +402,7 @@ static QString determineSessionToRestoreAtStartup() void SessionManagerPrivate::restoreStartupSession() { + NANOTRACE_SCOPE("Core", "SessionManagerPrivate::restoreStartupSession"); m_isStartupSessionRestored = true; QString sessionToRestoreAtStartup = determineSessionToRestoreAtStartup(); if (!sessionToRestoreAtStartup.isEmpty()) diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index f45cffb187a..7b1c2a2ef9e 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -27,6 +27,8 @@ #include <utils/treemodel.h> #include <utils/winutils.h> +#include <nanotrace/nanotrace.h> + #include <QDebug> #include <QDir> #include <QFileInfo> @@ -832,6 +834,7 @@ void DebuggerItemModel::saveDebuggers() void DebuggerItemManager::restoreDebuggers() { + NANOTRACE_SCOPE("Debugger", "DebuggerItemManager::restoreDebuggers"); itemModel().restoreDebuggers(); } diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 536ae572d4a..4296fd73aa5 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -61,6 +61,8 @@ #include <vcsbase/vcscommand.h> #include <vcsbase/vcsoutputwindow.h> +#include <nanotrace/nanotrace.h> + #include <QAction> #include <QApplication> #include <QDebug> @@ -680,6 +682,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) auto cmdContext = new QObject(this); connect(ICore::instance(), &ICore::coreOpened, cmdContext, [this, cmdContext, arguments] { + NANOTRACE_SCOPE("Git", "GitPlugin::initialize::coreOpened"); remoteCommand(arguments, QDir::currentPath(), {}); cmdContext->deleteLater(); }); diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index c36f71dee6f..51529353e2e 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -26,6 +26,8 @@ #include <utils/qtcassert.h> #include <utils/stringutils.h> +#include <nanotrace/nanotrace.h> + #include <QAction> #include <QHash> #include <QLabel> @@ -153,6 +155,7 @@ void KitManager::destroy() void KitManager::restoreKits() { + NANOTRACE_SCOPE("ProjectExplorer", "KitManager::restoreKits"); QTC_ASSERT(!d->m_initialized, return ); connect(ICore::instance(), &ICore::saveSettingsRequested, &KitManager::saveKits); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 7068ff02a28..64229ce4ccc 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -134,6 +134,8 @@ #include <utils/tooltip/tooltip.h> #include <utils/utilsicons.h> +#include <nanotrace/nanotrace.h> + #include <QAction> #include <QActionGroup> #include <QApplication> @@ -2126,6 +2128,7 @@ void ProjectExplorerPlugin::extensionsInitialized() void ProjectExplorerPlugin::restoreKits() { + NANOTRACE_SCOPE("ProjectExplorer", "ProjectExplorerPlugin::restoreKits"); ExtraAbi::load(); // Load this before Toolchains! ToolChainManager::restoreToolChains(); KitManager::restoreKits(); diff --git a/src/plugins/projectexplorer/toolchainmanager.cpp b/src/plugins/projectexplorer/toolchainmanager.cpp index a97085a1387..dd14b827468 100644 --- a/src/plugins/projectexplorer/toolchainmanager.cpp +++ b/src/plugins/projectexplorer/toolchainmanager.cpp @@ -16,6 +16,8 @@ #include <utils/qtcassert.h> #include <utils/algorithm.h> +#include <nanotrace/nanotrace.h> + #include <QSettings> using namespace Utils; @@ -102,6 +104,7 @@ ToolChainManager *ToolChainManager::instance() void ToolChainManager::restoreToolChains() { + NANOTRACE_SCOPE("ProjectExplorer", "ToolChainManager::restoreToolChains"); QTC_ASSERT(!d->m_accessor, return); d->m_accessor = std::make_unique<Internal::ToolChainSettingsAccessor>(); diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index 9a6903e2632..1683e8b9c89 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -12,6 +12,8 @@ #include <utils/algorithm.h> +#include <nanotrace/nanotrace.h> + #include <QElapsedTimer> #include <QGuiApplication> #include <QLoggingCategory> @@ -56,6 +58,9 @@ static Toolchains autoDetectToolChains(const ToolchainDetector &detector) { Toolchains result; for (ToolChainFactory *f : ToolChainFactory::allToolChainFactories()) { + NANOTRACE_SCOPE_ARGS("ProjectExplorer", + "ToolChainSettingsAccessor::autoDetectToolChains", + {"factory", f->displayName().toStdString()}); QElapsedTimer et; et.start(); result.append(f->autoDetect(detector)); @@ -179,6 +184,7 @@ ToolChainSettingsAccessor::ToolChainSettingsAccessor() Toolchains ToolChainSettingsAccessor::restoreToolChains(QWidget *parent) const { + NANOTRACE_SCOPE("ProjectExplorer", "ToolChainSettingsAccessor::restoreToolChains"); // read all tool chains from SDK const Toolchains systemFileTcs = toolChains( restoreSettings(Core::ICore::installerResourcePath(TOOLCHAIN_FILENAME), parent)); diff --git a/src/plugins/qmljseditor/qmllssettings.cpp b/src/plugins/qmljseditor/qmllssettings.cpp index 01c89dfd3e9..76ce535fa79 100644 --- a/src/plugins/qmljseditor/qmllssettings.cpp +++ b/src/plugins/qmljseditor/qmllssettings.cpp @@ -10,6 +10,8 @@ #include <QLoggingCategory> #include <qtsupport/qtversionmanager.h> +#include <nanotrace/nanotrace.h> + #include <limits> using namespace QtSupport; diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index da1c8a7a311..c329d24db01 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -24,6 +24,8 @@ #include <utils/process.h> #include <utils/qtcassert.h> +#include <nanotrace/nanotrace.h> + #include <QDir> #include <QFile> #include <QLoggingCategory> @@ -141,8 +143,11 @@ QtVersionManagerImpl &qtVersionManagerImpl() void QtVersionManagerImpl::triggerQtVersionRestore() { - disconnect(ToolChainManager::instance(), &ToolChainManager::toolChainsLoaded, - this, &QtVersionManagerImpl::triggerQtVersionRestore); + NANOTRACE_SCOPE("QtSupport", "QtVersionManagerImpl::triggerQtVersionRestore"); + disconnect(ToolChainManager::instance(), + &ToolChainManager::toolChainsLoaded, + this, + &QtVersionManagerImpl::triggerQtVersionRestore); bool success = restoreQtVersions(); updateFromInstaller(false); @@ -153,8 +158,10 @@ void QtVersionManagerImpl::triggerQtVersionRestore() findSystemQt(); } - emit QtVersionManager::instance()->qtVersionsLoaded(); - + { + NANOTRACE_SCOPE("QtSupport", "QtVersionManagerImpl::qtVersionsLoaded"); + emit QtVersionManager::instance()->qtVersionsLoaded(); + } emit QtVersionManager::instance()->qtVersionsChanged( m_versions.keys(), QList<int>(), QList<int>()); diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index 927ad2f3c35..30902093c21 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -45,6 +45,8 @@ #include <utils/stringutils.h> #include <utils/theme/theme.h> +#include <nanotrace/nanotrace.h> + #include <QAbstractListModel> #include <QApplication> #include <QDesktopServices> @@ -559,6 +561,8 @@ void StudioWelcomePlugin::extensionsInitialized() if (showSplashScreen()) { connect(Core::ICore::instance(), &Core::ICore::coreOpened, this, [this] { + NANOTRACE_SCOPE("StudioWelcome", + "StudioWelcomePlugin::extensionsInitialized::coreOpened"); Core::ModeManager::setModeStyle(Core::ModeManager::Style::Hidden); if (Utils::HostOsInfo::isMacHost()) { s_viewWindow = new QQuickView(Core::ICore::mainWindow()->windowHandle()); From ed0935733efbd4ff25a2664e3e91b672f3a645c1 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 12 Sep 2023 09:42:18 +0200 Subject: [PATCH 1053/1777] Utils: Add FilePathListAspect Change-Id: Iec89581e5818139bcc48ed807935c10421b7b664 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 124 +++++++++++++++++++++++++++++++++++++ src/libs/utils/aspects.h | 29 +++++++++ 2 files changed, 153 insertions(+) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index f1559b77167..800b0fb2995 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -10,6 +10,7 @@ #include "layoutbuilder.h" #include "passworddialog.h" #include "pathchooser.h" +#include "pathlisteditor.h" #include "qtcassert.h" #include "qtcolorbutton.h" #include "qtcsettings.h" @@ -600,6 +601,12 @@ void BaseAspect::registerSubWidget(QWidget *widget) widget->setVisible(d->m_visible); } +void BaseAspect::forEachSubWidget(const std::function<void(QWidget *)> &func) +{ + for (auto w : d->m_subWidgets) + func(w); +} + void BaseAspect::saveToMap(Store &data, const QVariant &value, const QVariant &defaultValue, const Key &key) { @@ -885,6 +892,13 @@ class StringListAspectPrivate public: }; +class FilePathListAspectPrivate +{ +public: + UndoableValue<QStringList> undoable; + QString placeHolderText; +}; + class TextDisplayPrivate { public: @@ -2401,6 +2415,116 @@ void StringListAspect::removeValues(const QStringList &values) setValue(val); } +/*! + \class Utils::FilePathListAspect + \inmodule QtCreator + + \brief A filepath list aspect represents a property of some object + that is a list of filepathList. +*/ + +FilePathListAspect::FilePathListAspect(AspectContainer *container) + : TypedAspect(container) + , d(new Internal::FilePathListAspectPrivate) +{ + setDefaultValue(QStringList()); +} + +FilePathListAspect::~FilePathListAspect() = default; + +FilePaths FilePathListAspect::operator()() const +{ + return Utils::transform(m_internal, &FilePath::fromUserInput); +} + +bool FilePathListAspect::guiToBuffer() +{ + const QStringList newValue = d->undoable.get(); + if (newValue != m_buffer) { + m_buffer = newValue; + return true; + } + return false; +} + +void FilePathListAspect::bufferToGui() +{ + d->undoable.setWithoutUndo(m_buffer); +} + +void FilePathListAspect::addToLayout(LayoutItem &parent) +{ + d->undoable.setSilently(value()); + + PathListEditor *editor = new PathListEditor; + editor->setPathList(value()); + connect(editor, &PathListEditor::changed, this, [this, editor] { + pushUndo(d->undoable.set(editor->pathList())); + }); + connect(&d->undoable.m_signal, &UndoSignaller::changed, this, [this, editor] { + if (editor->pathList() != d->undoable.get()) + editor->setPathList(d->undoable.get()); + + handleGuiChanged(); + }); + + editor->setToolTip(toolTip()); + editor->setMaximumHeight(100); + editor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + editor->setPlaceholderText(d->placeHolderText); + + registerSubWidget(editor); + + parent.addItem(editor); +} + +void FilePathListAspect::setPlaceHolderText(const QString &placeHolderText) +{ + d->placeHolderText = placeHolderText; + + forEachSubWidget([placeHolderText](QWidget *widget) { + if (auto pathListEditor = qobject_cast<PathListEditor *>(widget)) { + pathListEditor->setPlaceholderText(placeHolderText); + } + }); +} + +void FilePathListAspect::appendValue(const FilePath &path, bool allowDuplicates) +{ + const QString asString = path.toUserOutput(); + QStringList val = value(); + if (allowDuplicates || !val.contains(asString)) + val.append(asString); + setValue(val); +} + +void FilePathListAspect::removeValue(const FilePath &s) +{ + QStringList val = value(); + val.removeAll(s.toUserOutput()); + setValue(val); +} + +void FilePathListAspect::appendValues(const FilePaths &paths, bool allowDuplicates) +{ + QStringList val = value(); + + for (const FilePath &path : paths) { + const QString asString = path.toUserOutput(); + if (allowDuplicates || !val.contains(asString)) + val.append(asString); + } + setValue(val); +} + +void FilePathListAspect::removeValues(const FilePaths &paths) +{ + QStringList val = value(); + for (const FilePath &path : paths) + val.removeAll(path.toUserOutput()); + setValue(val); +} + /*! \class Utils::IntegerListAspect \internal diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 35773ce7d25..0ffcaec7cb0 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -38,6 +38,7 @@ class BoolAspectPrivate; class ColorAspectPrivate; class DoubleAspectPrivate; class FilePathAspectPrivate; +class FilePathListAspectPrivate; class IntegerAspectPrivate; class MultiSelectionAspectPrivate; class SelectionAspectPrivate; @@ -243,6 +244,8 @@ protected: static void saveToMap(Store &data, const QVariant &value, const QVariant &defaultValue, const Key &key); + void forEachSubWidget(const std::function<void(QWidget *)> &func); + protected: template <class Value> static bool updateStorage(Value &target, const Value &val) @@ -774,6 +777,31 @@ private: std::unique_ptr<Internal::StringListAspectPrivate> d; }; +class QTCREATOR_UTILS_EXPORT FilePathListAspect : public TypedAspect<QStringList> +{ + Q_OBJECT + +public: + FilePathListAspect(AspectContainer *container = nullptr); + ~FilePathListAspect() override; + + FilePaths operator()() const; + + bool guiToBuffer() override; + void bufferToGui() override; + + void addToLayout(Layouting::LayoutItem &parent) override; + void setPlaceHolderText(const QString &placeHolderText); + + void appendValue(const FilePath &path, bool allowDuplicates = true); + void removeValue(const FilePath &path); + void appendValues(const FilePaths &values, bool allowDuplicates = true); + void removeValues(const FilePaths &values); + +private: + std::unique_ptr<Internal::FilePathListAspectPrivate> d; +}; + class QTCREATOR_UTILS_EXPORT IntegersAspect : public TypedAspect<QList<int>> { Q_OBJECT @@ -949,6 +977,7 @@ public: } void setSilently(const T &value) { m_value = value; } + void setWithoutUndo(const T &value) { setInternal(value); } T get() const { return m_value; } From f6205d6cc7a0f35eca25d645c68eea7f95612822 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 7 Sep 2023 15:25:07 +0200 Subject: [PATCH 1054/1777] Docker: Switch to aspect settings Change-Id: Id04c48caf2ddd33e176ee424273690b80c77232b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/docker/dockerdevice.cpp | 230 ++++++++++++---------- src/plugins/docker/dockerdevice.h | 57 ++---- src/plugins/docker/dockerdevicewidget.cpp | 141 ++++--------- src/plugins/docker/dockerdevicewidget.h | 15 +- 4 files changed, 184 insertions(+), 259 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 1344294c2cb..5976bd1a113 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -32,7 +32,9 @@ #include <qtsupport/qtversionmanager.h> #include <utils/algorithm.h> +#include <utils/async.h> #include <utils/basetreeview.h> +#include <utils/clangutils.h> #include <utils/devicefileaccess.h> #include <utils/deviceshell.h> #include <utils/environment.h> @@ -87,6 +89,15 @@ Q_LOGGING_CATEGORY(dockerDeviceLog, "qtc.docker.device", QtWarningMsg); namespace Docker::Internal { +const char DockerDeviceDataImageIdKey[] = "DockerDeviceDataImageId"; +const char DockerDeviceDataRepoKey[] = "DockerDeviceDataRepo"; +const char DockerDeviceDataTagKey[] = "DockerDeviceDataTag"; +const char DockerDeviceUseOutsideUser[] = "DockerDeviceUseUidGid"; +const char DockerDeviceMappedPaths[] = "DockerDeviceMappedPaths"; +const char DockerDeviceKeepEntryPoint[] = "DockerDeviceKeepEntryPoint"; +const char DockerDeviceEnableLldbFlags[] = "DockerDeviceEnableLldbFlags"; +const char DockerDeviceClangDExecutable[] = "DockerDeviceClangDExecutable"; + class ContainerShell : public Utils::DeviceShell { public: @@ -128,19 +139,87 @@ public: DockerDevicePrivate *m_dev = nullptr; }; -class DockerDeviceSettings : public DeviceSettings +DockerDeviceSettings::DockerDeviceSettings() { -public: - DockerDeviceSettings() { displayName.setDefaultValue(Tr::tr("Docker Image")); } -}; + displayName.setDefaultValue(Tr::tr("Docker Image")); + + imageId.setSettingsKey(DockerDeviceDataImageIdKey); + imageId.setLabelText(Tr::tr("Image ID:")); + imageId.setReadOnly(true); + + repo.setSettingsKey(DockerDeviceDataRepoKey); + repo.setLabelText(Tr::tr("Repository:")); + repo.setReadOnly(true); + + tag.setSettingsKey(DockerDeviceDataTagKey); + tag.setLabelText(Tr::tr("Tag:")); + tag.setReadOnly(true); + + useLocalUidGid.setSettingsKey(DockerDeviceUseOutsideUser); + useLocalUidGid.setLabelText(Tr::tr("Run as outside user:")); + useLocalUidGid.setDefaultValue(true); + useLocalUidGid.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); + + keepEntryPoint.setSettingsKey(DockerDeviceKeepEntryPoint); + keepEntryPoint.setLabelText(Tr::tr("Do not modify entry point:")); + keepEntryPoint.setDefaultValue(false); + keepEntryPoint.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); + + enableLldbFlags.setSettingsKey(DockerDeviceEnableLldbFlags); + enableLldbFlags.setLabelText(Tr::tr("Enable flags needed for LLDB:")); + enableLldbFlags.setDefaultValue(false); + enableLldbFlags.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); + + mounts.setSettingsKey(DockerDeviceMappedPaths); + mounts.setLabelText(Tr::tr("Paths to mount:")); + mounts.setDefaultValue({Core::DocumentManager::projectsDirectory().toString()}); + + clangdExecutable.setSettingsKey(DockerDeviceClangDExecutable); + clangdExecutable.setLabelText(Tr::tr("Clangd Executable:")); + clangdExecutable.setAllowPathFromDevice(true); + + clangdExecutable.setValidationFunction( + [](const QString &newValue) -> FancyLineEdit::AsyncValidationFuture { + return Utils::asyncRun([newValue]() -> expected_str<QString> { + QString error; + bool result = Utils::checkClangdVersion(FilePath::fromUserInput(newValue), &error); + if (!result) + return make_unexpected(error); + return newValue; + }); + }); +} + +// Used for "docker run" +QString DockerDeviceSettings::repoAndTag() const +{ + if (repo() == "<none>") + return imageId(); + + if (tag() == "<none>") + return repo(); + + return repo() + ':' + tag(); +} + +QString DockerDeviceSettings::repoAndTagEncoded() const +{ + return repoAndTag().replace(':', '.'); +} class DockerDevicePrivate : public QObject { public: - DockerDevicePrivate(DockerDevice *parent, DockerDeviceData data) + DockerDevicePrivate(DockerDevice *parent) : q(parent) - , m_data(std::move(data)) - {} + , deviceSettings(static_cast<DockerDeviceSettings *>(q->settings())) + { + QObject::connect(deviceSettings, &DockerDeviceSettings::applied, this, [this] { + if (!m_container.isEmpty()) { + stopCurrentContainer(); + } + }); + } ~DockerDevicePrivate() { stopCurrentContainer(); } @@ -153,12 +232,10 @@ public: expected_str<FilePath> localSource(const FilePath &other) const; QString containerId() { return m_container; } - DockerDeviceData data() { return m_data; } - void setData(const DockerDeviceData &data); - QString repoAndTag() const { return m_data.repoAndTag(); } - QString repoAndTagEncoded() const { return m_data.repoAndTagEncoded(); } - QString dockerImageId() const { return m_data.imageId; } + QString repoAndTag() const { return deviceSettings->repoAndTag(); } + QString repoAndTagEncoded() const { return deviceSettings->repoAndTagEncoded(); } + QString dockerImageId() const { return deviceSettings->imageId(); } Environment environment(); @@ -179,9 +256,9 @@ public: std::optional<FilePath> clangdExecutable() const { - if (m_data.clangdExecutable.isEmpty()) + if (deviceSettings->clangdExecutable().isEmpty()) return std::nullopt; - return m_data.clangdExecutable; + return deviceSettings->clangdExecutable(); } bool addTemporaryMount(const FilePath &path, const FilePath &containerPath); @@ -191,7 +268,7 @@ public: bool isImageAvailable() const; DockerDevice *const q; - DockerDeviceData m_data; + DockerDeviceSettings *deviceSettings; struct TemporaryMountInfo { @@ -383,7 +460,7 @@ Tasks DockerDevicePrivate::validateMounts() const { Tasks result; - for (const QString &mount : m_data.mounts) { + for (const QString &mount : deviceSettings->mounts()) { const FilePath path = FilePath::fromUserInput(mount); if (!path.isDir()) { const QString message = Tr::tr("Path \"%1\" is not a directory or does not exist.") @@ -415,9 +492,9 @@ QString DockerDeviceFileAccess::mapToDevicePath(const QString &hostPath) const return newPath; } -DockerDevice::DockerDevice(const DockerDeviceData &data) - : ProjectExplorer::IDevice(std::make_unique<DockerDeviceSettings>()) - , d(new DockerDevicePrivate(this, data)) +DockerDevice::DockerDevice(std::unique_ptr<DockerDeviceSettings> deviceSettings) + : ProjectExplorer::IDevice(std::move(deviceSettings)) + , d(new DockerDevicePrivate(this)) { setFileAccess(&d->m_fileAccess); setDisplayType(Tr::tr("Docker")); @@ -425,8 +502,9 @@ DockerDevice::DockerDevice(const DockerDeviceData &data) setupId(IDevice::ManuallyAdded); setType(Constants::DOCKER_DEVICE_TYPE); setMachineType(IDevice::Hardware); - settings()->displayName.setDefaultValue( - Tr::tr("Docker Image \"%1\" (%2)").arg(data.repoAndTag()).arg(data.imageId)); + d->deviceSettings->displayName.setDefaultValue(Tr::tr("Docker Image \"%1\" (%2)") + .arg(d->deviceSettings->repoAndTag()) + .arg(d->deviceSettings->imageId())); setAllowEmptyCommand(true); setOpenTerminal([this](const Environment &env, const FilePath &workingDir) { @@ -467,21 +545,6 @@ void DockerDevice::shutdown() d->shutdown(); } -const DockerDeviceData DockerDevice::data() const -{ - return d->data(); -} - -DockerDeviceData DockerDevice::data() -{ - return d->data(); -} - -void DockerDevice::setData(const DockerDeviceData &data) -{ - d->setData(data); -} - bool DockerDevice::updateContainerAccess() const { return d->updateContainerAccess(); @@ -642,7 +705,7 @@ QStringList DockerDevicePrivate::createMountArgs() const { QStringList cmds; QList<TemporaryMountInfo> mounts = m_temporaryMounts; - for (const QString &m : m_data.mounts) + for (const QString &m : deviceSettings->mounts()) mounts.append({FilePath::fromUserInput(m), FilePath::fromUserInput(m)}); for (const TemporaryMountInfo &mi : mounts) { @@ -658,12 +721,12 @@ bool DockerDevicePrivate::isImageAvailable() const Process proc; proc.setCommand( {settings().dockerBinaryPath(), - {"image", "list", m_data.repoAndTag(), "--format", "{{.Repository}}:{{.Tag}}"}}); + {"image", "list", deviceSettings->repoAndTag(), "--format", "{{.Repository}}:{{.Tag}}"}}); proc.runBlocking(); if (proc.result() != ProcessResult::FinishedWithSuccess) return false; - if (proc.stdOut().trimmed() == m_data.repoAndTag()) + if (proc.stdOut().trimmed() == deviceSettings->repoAndTag()) return true; return false; @@ -689,19 +752,19 @@ bool DockerDevicePrivate::createContainer() #ifdef Q_OS_UNIX // no getuid() and getgid() on Windows. - if (m_data.useLocalUidGid) + if (deviceSettings->useLocalUidGid()) dockerCreate.addArgs({"-u", QString("%1:%2").arg(getuid()).arg(getgid())}); #endif dockerCreate.addArgs(createMountArgs()); - if (!m_data.keepEntryPoint) + if (!deviceSettings->keepEntryPoint()) dockerCreate.addArgs({"--entrypoint", "/bin/sh"}); - if (m_data.enableLldbFlags) + if (deviceSettings->enableLldbFlags()) dockerCreate.addArgs({"--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"}); - dockerCreate.addArg(m_data.repoAndTag()); + dockerCreate.addArg(deviceSettings->repoAndTag()); qCDebug(dockerDeviceLog).noquote() << "RUNNING: " << dockerCreate.toUserOutput(); Process createProcess; @@ -775,47 +838,16 @@ void DockerDevice::setMounts(const QStringList &mounts) const d->changeMounts(mounts); } -const char DockerDeviceDataImageIdKey[] = "DockerDeviceDataImageId"; -const char DockerDeviceDataRepoKey[] = "DockerDeviceDataRepo"; -const char DockerDeviceDataTagKey[] = "DockerDeviceDataTag"; -const char DockerDeviceDataSizeKey[] = "DockerDeviceDataSize"; -const char DockerDeviceUseOutsideUser[] = "DockerDeviceUseUidGid"; -const char DockerDeviceMappedPaths[] = "DockerDeviceMappedPaths"; -const char DockerDeviceKeepEntryPoint[] = "DockerDeviceKeepEntryPoint"; -const char DockerDeviceEnableLldbFlags[] = "DockerDeviceEnableLldbFlags"; -const char DockerDeviceClangDExecutable[] = "DockerDeviceClangDExecutable"; - void DockerDevice::fromMap(const Store &map) { ProjectExplorer::IDevice::fromMap(map); - DockerDeviceData data; - - data.repo = map.value(DockerDeviceDataRepoKey).toString(); - data.tag = map.value(DockerDeviceDataTagKey).toString(); - data.imageId = map.value(DockerDeviceDataImageIdKey).toString(); - data.size = map.value(DockerDeviceDataSizeKey).toString(); - data.useLocalUidGid = map.value(DockerDeviceUseOutsideUser, HostOsInfo::isLinuxHost()).toBool(); - data.mounts = map.value(DockerDeviceMappedPaths).toStringList(); - data.keepEntryPoint = map.value(DockerDeviceKeepEntryPoint).toBool(); - data.enableLldbFlags = map.value(DockerDeviceEnableLldbFlags).toBool(); - data.clangdExecutable = FilePath::fromSettings(map.value(DockerDeviceClangDExecutable)); - d->setData(data); + d->deviceSettings->fromMap(map); } Store DockerDevice::toMap() const { Store map = ProjectExplorer::IDevice::toMap(); - DockerDeviceData data = d->data(); - - map.insert(DockerDeviceDataRepoKey, data.repo); - map.insert(DockerDeviceDataTagKey, data.tag); - map.insert(DockerDeviceDataImageIdKey, data.imageId); - map.insert(DockerDeviceDataSizeKey, data.size); - map.insert(DockerDeviceUseOutsideUser, data.useLocalUidGid); - map.insert(DockerDeviceMappedPaths, data.mounts); - map.insert(DockerDeviceKeepEntryPoint, data.keepEntryPoint); - map.insert(DockerDeviceEnableLldbFlags, data.enableLldbFlags); - map.insert(DockerDeviceClangDExecutable, data.clangdExecutable.toSettings()); + d->deviceSettings->toMap(map); return map; } @@ -839,14 +871,6 @@ FilePath DockerDevice::filePath(const QString &pathOnDevice) const return FilePath::fromParts(Constants::DOCKER_DEVICE_SCHEME, d->repoAndTagEncoded(), pathOnDevice); - -// The following would work, but gives no hint on repo and tag -// result.setScheme("docker"); -// result.setHost(d->m_data.imageId); - -// The following would work, but gives no hint on repo, tag and imageid -// result.setScheme("device"); -// result.setHost(id().toString()); } Utils::FilePath DockerDevice::rootPath() const @@ -940,7 +964,7 @@ RunResult DockerDevicePrivate::runInShell(const CommandLine &cmd, const QByteArr // Factory -class DockerImageItem final : public TreeItem, public DockerDeviceData +class DockerImageItem final : public TreeItem { public: DockerImageItem() {} @@ -968,6 +992,11 @@ public: return QVariant(); } + + QString repo; + QString tag; + QString imageId; + QString size; }; class DockerDeviceSetupWizard final : public QDialog @@ -1099,7 +1128,12 @@ public: m_proxyModel->mapToSource(selectedRows.front())); QTC_ASSERT(item, return {}); - auto device = DockerDevice::create(*item); + auto deviceSettings = std::make_unique<DockerDeviceSettings>(); + deviceSettings->repo.setValue(item->repo); + deviceSettings->tag.setValue(item->tag); + deviceSettings->imageId.setValue(item->imageId); + + auto device = DockerDevice::create(std::move(deviceSettings)); return device; } @@ -1129,7 +1163,7 @@ DockerDeviceFactory::DockerDeviceFactory() return wizard.device(); }); setConstructionFunction([this] { - auto device = DockerDevice::create({}); + auto device = DockerDevice::create(std::make_unique<DockerDeviceSettings>()); QMutexLocker lk(&m_deviceListMutex); m_existingDevices.push_back(device); return device; @@ -1155,7 +1189,7 @@ bool DockerDevicePrivate::addTemporaryMount(const FilePath &path, const FilePath if (alreadyAdded) return false; - const bool alreadyManuallyAdded = anyOf(m_data.mounts, [path](const QString &mount) { + const bool alreadyManuallyAdded = anyOf(deviceSettings->mounts(), [path](const QString &mount) { return mount == path.path(); }); @@ -1191,8 +1225,8 @@ void DockerDevicePrivate::shutdown() void DockerDevicePrivate::changeMounts(QStringList newMounts) { newMounts.removeDuplicates(); - if (m_data.mounts != newMounts) { - m_data.mounts = newMounts; + if (deviceSettings->mounts() != newMounts) { + deviceSettings->mounts() = newMounts; stopCurrentContainer(); // Force re-start with new mounts. } } @@ -1207,7 +1241,7 @@ expected_str<FilePath> DockerDevicePrivate::localSource(const FilePath &other) c } } - for (const QString &mount : m_data.mounts) { + for (const QString &mount : deviceSettings->mounts()) { const FilePath mountPoint = FilePath::fromString(mount); if (devicePath.isChildOf(mountPoint)) { const FilePath relativePath = devicePath.relativeChildPath(mountPoint); @@ -1223,7 +1257,7 @@ bool DockerDevicePrivate::ensureReachable(const FilePath &other) if (other.isSameDevice(q->rootPath())) return true; - for (const QString &mount : m_data.mounts) { + for (const QString &mount : deviceSettings->mounts()) { const FilePath fMount = FilePath::fromString(mount); if (other.isChildOf(fMount)) return true; @@ -1250,18 +1284,6 @@ bool DockerDevicePrivate::ensureReachable(const FilePath &other) return true; } -void DockerDevicePrivate::setData(const DockerDeviceData &data) -{ - if (m_data != data) { - m_data = data; - - // Force restart if the container is already running - if (!m_container.isEmpty()) { - stopCurrentContainer(); - } - } -} - bool DockerDevice::prepareForBuild(const Target *target) { return d->prepareForBuild(target); diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 59a11e436a4..821438edb8a 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -14,42 +14,22 @@ namespace Docker::Internal { -class DockerDeviceData +class DockerDeviceSettings : public ProjectExplorer::DeviceSettings { public: - bool operator==(const DockerDeviceData &other) const - { - return imageId == other.imageId && repo == other.repo && tag == other.tag - && useLocalUidGid == other.useLocalUidGid && mounts == other.mounts - && keepEntryPoint == other.keepEntryPoint && enableLldbFlags == other.enableLldbFlags - && clangdExecutable == other.clangdExecutable; - } + DockerDeviceSettings(); - bool operator!=(const DockerDeviceData &other) const { return !(*this == other); } + QString repoAndTag() const; + QString repoAndTagEncoded() const; - // Used for "docker run" - QString repoAndTag() const - { - if (repo == "<none>") - return imageId; - - if (tag == "<none>") - return repo; - - return repo + ':' + tag; - } - - QString repoAndTagEncoded() const { return repoAndTag().replace(':', '.'); } - - QString imageId; - QString repo; - QString tag; - QString size; - bool useLocalUidGid = true; - QStringList mounts = {Core::DocumentManager::projectsDirectory().toString()}; - bool keepEntryPoint = false; - bool enableLldbFlags = false; - Utils::FilePath clangdExecutable; + Utils::StringAspect imageId{this}; + Utils::StringAspect repo{this}; + Utils::StringAspect tag{this}; + Utils::BoolAspect useLocalUidGid{this}; + Utils::StringListAspect mounts{this}; + Utils::BoolAspect keepEntryPoint{this}; + Utils::BoolAspect enableLldbFlags{this}; + Utils::FilePathAspect clangdExecutable{this}; }; class DockerDevice : public ProjectExplorer::IDevice @@ -58,14 +38,14 @@ public: using Ptr = QSharedPointer<DockerDevice>; using ConstPtr = QSharedPointer<const DockerDevice>; - explicit DockerDevice(const DockerDeviceData &data); + explicit DockerDevice(std::unique_ptr<DockerDeviceSettings> settings); ~DockerDevice(); void shutdown(); - static Ptr create(const DockerDeviceData &data) + static Ptr create(std::unique_ptr<DockerDeviceSettings> settings) { - return Ptr(new DockerDevice(data)); + return Ptr(new DockerDevice(std::move(settings))); } ProjectExplorer::IDeviceWidget *createWidget() override; @@ -87,11 +67,6 @@ public: Utils::Environment systemEnvironment() const override; - const DockerDeviceData data() const; - DockerDeviceData data(); - - void setData(const DockerDeviceData &data); - bool updateContainerAccess() const; void setMounts(const QStringList &mounts) const; @@ -124,5 +99,3 @@ private: }; } // namespace Docker::Internal - -Q_DECLARE_METATYPE(Docker::Internal::DockerDeviceData) diff --git a/src/plugins/docker/dockerdevicewidget.cpp b/src/plugins/docker/dockerdevicewidget.cpp index 259325274c0..0ec608d4538 100644 --- a/src/plugins/docker/dockerdevicewidget.cpp +++ b/src/plugins/docker/dockerdevicewidget.cpp @@ -33,22 +33,9 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) auto dockerDevice = device.dynamicCast<DockerDevice>(); QTC_ASSERT(dockerDevice, return); - m_data = dockerDevice->data(); + DockerDeviceSettings *deviceSettings = static_cast<DockerDeviceSettings *>(device->settings()); - auto repoLabel = new QLabel(Tr::tr("Repository:")); - m_repoLineEdit = new QLineEdit; - m_repoLineEdit->setText(m_data.repo); - m_repoLineEdit->setEnabled(false); - - auto tagLabel = new QLabel(Tr::tr("Tag:")); - m_tagLineEdit = new QLineEdit; - m_tagLineEdit->setText(m_data.tag); - m_tagLineEdit->setEnabled(false); - - auto idLabel = new QLabel(Tr::tr("Image ID:")); - m_idLineEdit = new QLineEdit; - m_idLineEdit->setText(m_data.imageId); - m_idLineEdit->setEnabled(false); + using namespace Layouting; auto daemonStateLabel = new QLabel(Tr::tr("Daemon state:")); m_daemonReset = new QToolButton; @@ -67,58 +54,6 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) DockerApi::recheckDockerDaemon(); }); - m_keepEntryPoint = new QCheckBox(Tr::tr("Do not modify entry point")); - m_keepEntryPoint->setToolTip( - Tr::tr("Prevents modifying the entry point of the image. Enable only if " - "the image starts into a shell.")); - m_keepEntryPoint->setChecked(m_data.keepEntryPoint); - m_keepEntryPoint->setEnabled(true); - - connect(m_keepEntryPoint, &QCheckBox::toggled, this, [this, dockerDevice](bool on) { - m_data.keepEntryPoint = on; - dockerDevice->setData(m_data); - }); - - m_enableLldbFlags = new QCheckBox(Tr::tr("Enable flags needed for LLDB")); - m_enableLldbFlags->setToolTip(Tr::tr("Adds the following flags to the container " - "to allow LLDB to run: " - "--cap-add=SYS_PTRACE --security-opt seccomp=unconfined")); - m_enableLldbFlags->setChecked(m_data.enableLldbFlags); - m_enableLldbFlags->setEnabled(true); - - connect(m_enableLldbFlags, &QCheckBox::toggled, this, [this, dockerDevice](bool on) { - m_data.enableLldbFlags = on; - dockerDevice->setData(m_data); - }); - - m_runAsOutsideUser = new QCheckBox(Tr::tr("Run as outside user")); - m_runAsOutsideUser->setToolTip(Tr::tr("Uses user ID and group ID of the user running Qt Creator " - "in the docker container.")); - m_runAsOutsideUser->setChecked(m_data.useLocalUidGid); - m_runAsOutsideUser->setEnabled(HostOsInfo::isAnyUnixHost()); - - connect(m_runAsOutsideUser, &QCheckBox::toggled, this, [this, dockerDevice](bool on) { - m_data.useLocalUidGid = on; - dockerDevice->setData(m_data); - }); - - auto clangDLabel = new QLabel(Tr::tr("Clangd Executable:")); - - m_clangdExecutable = new PathChooser(); - m_clangdExecutable->setExpectedKind(PathChooser::ExistingCommand); - m_clangdExecutable->setHistoryCompleter("Docker.ClangdExecutable.History"); - m_clangdExecutable->setAllowPathFromDevice(true); - m_clangdExecutable->setFilePath(m_data.clangdExecutable); - m_clangdExecutable->setValidationFunction( - [chooser = m_clangdExecutable](FancyLineEdit *, QString *error) { - return Utils::checkClangdVersion(chooser->filePath(), error); - }); - - connect(m_clangdExecutable, &PathChooser::rawPathChanged, this, [this, dockerDevice] { - m_data.clangdExecutable = m_clangdExecutable->filePath(); - dockerDevice->setData(m_data); - }); - auto pathListLabel = new InfoLabel(Tr::tr("Paths to mount:")); pathListLabel->setAdditionalToolTip(Tr::tr("Source directory list should not be empty.")); @@ -126,7 +61,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) m_pathsListEdit->setPlaceholderText(Tr::tr("Host directories to mount into the container")); m_pathsListEdit->setToolTip(Tr::tr("Maps paths in this list one-to-one to the " "docker container.")); - m_pathsListEdit->setPathList(m_data.mounts); + m_pathsListEdit->setPathList(deviceSettings->mounts()); m_pathsListEdit->setMaximumHeight(100); m_pathsListEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); @@ -136,11 +71,14 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) }; markupMounts(); - connect(m_pathsListEdit, &PathListEditor::changed, this, [this, dockerDevice, markupMounts] { - m_data.mounts = m_pathsListEdit->pathList(); - dockerDevice->setData(m_data); - markupMounts(); - }); + connect(m_pathsListEdit, + &PathListEditor::changed, + this, + [this, dockerDevice, markupMounts, deviceSettings] { + deviceSettings->mounts.setVolatileValue(m_pathsListEdit->pathList()); + // dockerDevice->setData(m_data); + markupMounts(); + }); auto logView = new QTextBrowser; connect(&m_kitItemDetector, &KitDetector::logOutput, @@ -177,31 +115,32 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) return paths; }; - connect(autoDetectButton, &QPushButton::clicked, this, - [this, logView, dockerDevice, searchPaths] { - logView->clear(); - dockerDevice->updateContainerAccess(); + connect(autoDetectButton, + &QPushButton::clicked, + this, + [this, logView, dockerDevice, searchPaths, deviceSettings] { + logView->clear(); + dockerDevice->updateContainerAccess(); - const FilePath clangdPath = dockerDevice->filePath("clangd") - .searchInPath({}, - FilePath::AppendToPath, - [](const FilePath &clangd) { - return Utils::checkClangdVersion(clangd); - }); + const FilePath clangdPath + = dockerDevice->filePath("clangd") + .searchInPath({}, FilePath::AppendToPath, [](const FilePath &clangd) { + return Utils::checkClangdVersion(clangd); + }); - if (!clangdPath.isEmpty()) - m_clangdExecutable->setFilePath(clangdPath); + if (!clangdPath.isEmpty()) + deviceSettings->clangdExecutable.setValue(clangdPath); - m_kitItemDetector.autoDetect(dockerDevice->id().toString(), searchPaths()); + m_kitItemDetector.autoDetect(dockerDevice->id().toString(), searchPaths()); - if (DockerApi::instance()->dockerDaemonAvailable().value_or(false) == false) - logView->append(Tr::tr("Docker daemon appears to be stopped.")); - else - logView->append(Tr::tr("Docker daemon appears to be running.")); + if (DockerApi::instance()->dockerDaemonAvailable().value_or(false) == false) + logView->append(Tr::tr("Docker daemon appears to be stopped.")); + else + logView->append(Tr::tr("Docker daemon appears to be running.")); - logView->append(Tr::tr("Detection complete.")); - updateDaemonStateTexts(); - }); + logView->append(Tr::tr("Detection complete.")); + updateDaemonStateTexts(); + }); connect(undoAutoDetectButton, &QPushButton::clicked, this, [this, logView, device] { logView->clear(); @@ -234,19 +173,19 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) }; Form { - repoLabel, m_repoLineEdit, br, - tagLabel, m_tagLineEdit, br, - idLabel, m_idLineEdit, br, + deviceSettings->repo, br, + deviceSettings->tag, br, + deviceSettings->imageId, br, daemonStateLabel, m_daemonReset, m_daemonState, br, - m_runAsOutsideUser, br, - m_keepEntryPoint, br, - m_enableLldbFlags, br, - clangDLabel, m_clangdExecutable, br, + deviceSettings->useLocalUidGid, br, + deviceSettings->keepEntryPoint, br, + deviceSettings->enableLldbFlags, br, + deviceSettings->clangdExecutable, br, Column { pathListLabel, m_pathsListEdit, }, br, - (dockerDevice->isAutoDetected() ? Column {} : std::move(detectionControls)), + If { dockerDevice->isAutoDetected(), {}, {detectionControls} }, noMargin, }.attachTo(this); // clang-format on diff --git a/src/plugins/docker/dockerdevicewidget.h b/src/plugins/docker/dockerdevicewidget.h index d92ac5ed218..7a15239c513 100644 --- a/src/plugins/docker/dockerdevicewidget.h +++ b/src/plugins/docker/dockerdevicewidget.h @@ -31,20 +31,11 @@ public: void updateDaemonStateTexts(); private: - QLineEdit *m_repoLineEdit; - QLineEdit *m_tagLineEdit; - QLineEdit *m_idLineEdit; - QToolButton *m_daemonReset; - QLabel *m_daemonState; - QCheckBox *m_runAsOutsideUser; - QCheckBox *m_keepEntryPoint; - QCheckBox *m_enableLldbFlags; - Utils::PathChooser *m_clangdExecutable; - Utils::PathListEditor *m_pathsListEdit; - KitDetector m_kitItemDetector; + QLabel *m_daemonState; + QToolButton *m_daemonReset; - DockerDeviceData m_data; + KitDetector m_kitItemDetector; }; } // Docker::Internal From 0c157b4ba6afadb4a8d6eff362cc39a4c46ef095 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 12 Sep 2023 09:43:49 +0200 Subject: [PATCH 1055/1777] Docker: Use FileListAspect for mounts Change-Id: I6392c8bb8ebdfb0984f56ebda23567ef8b42bb6a Reviewed-by: hjk <hjk@qt.io> --- src/plugins/docker/dockerdevice.cpp | 32 +++++++++++------------ src/plugins/docker/dockerdevice.h | 2 +- src/plugins/docker/dockerdevicewidget.cpp | 23 +++------------- src/plugins/docker/dockerdevicewidget.h | 1 - 4 files changed, 21 insertions(+), 37 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 5976bd1a113..bcef8da84bc 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -173,6 +173,8 @@ DockerDeviceSettings::DockerDeviceSettings() mounts.setSettingsKey(DockerDeviceMappedPaths); mounts.setLabelText(Tr::tr("Paths to mount:")); mounts.setDefaultValue({Core::DocumentManager::projectsDirectory().toString()}); + mounts.setToolTip(Tr::tr("Maps paths in this list one-to-one to the docker container.")); + mounts.setPlaceHolderText(Tr::tr("Host directories to mount into the container")); clangdExecutable.setSettingsKey(DockerDeviceClangDExecutable); clangdExecutable.setLabelText(Tr::tr("Clangd Executable:")); @@ -460,11 +462,10 @@ Tasks DockerDevicePrivate::validateMounts() const { Tasks result; - for (const QString &mount : deviceSettings->mounts()) { - const FilePath path = FilePath::fromUserInput(mount); - if (!path.isDir()) { + for (const FilePath &mount : deviceSettings->mounts()) { + if (!mount.isDir()) { const QString message = Tr::tr("Path \"%1\" is not a directory or does not exist.") - .arg(mount); + .arg(mount.toUserOutput()); result.append(Task(Task::Error, message, {}, -1, {})); } @@ -705,8 +706,8 @@ QStringList DockerDevicePrivate::createMountArgs() const { QStringList cmds; QList<TemporaryMountInfo> mounts = m_temporaryMounts; - for (const QString &m : deviceSettings->mounts()) - mounts.append({FilePath::fromUserInput(m), FilePath::fromUserInput(m)}); + for (const FilePath &m : deviceSettings->mounts()) + mounts.append({m, m}); for (const TemporaryMountInfo &mi : mounts) { if (isValidMountInfo(mi)) @@ -1189,8 +1190,8 @@ bool DockerDevicePrivate::addTemporaryMount(const FilePath &path, const FilePath if (alreadyAdded) return false; - const bool alreadyManuallyAdded = anyOf(deviceSettings->mounts(), [path](const QString &mount) { - return mount == path.path(); + const bool alreadyManuallyAdded = anyOf(deviceSettings->mounts(), [path](const FilePath &mount) { + return mount == path; }); if (alreadyManuallyAdded) @@ -1225,8 +1226,8 @@ void DockerDevicePrivate::shutdown() void DockerDevicePrivate::changeMounts(QStringList newMounts) { newMounts.removeDuplicates(); - if (deviceSettings->mounts() != newMounts) { - deviceSettings->mounts() = newMounts; + if (deviceSettings->mounts.value() != newMounts) { + deviceSettings->mounts.value() = newMounts; stopCurrentContainer(); // Force re-start with new mounts. } } @@ -1241,8 +1242,8 @@ expected_str<FilePath> DockerDevicePrivate::localSource(const FilePath &other) c } } - for (const QString &mount : deviceSettings->mounts()) { - const FilePath mountPoint = FilePath::fromString(mount); + for (const FilePath &mount : deviceSettings->mounts()) { + const FilePath mountPoint = mount; if (devicePath.isChildOf(mountPoint)) { const FilePath relativePath = devicePath.relativeChildPath(mountPoint); return mountPoint.pathAppended(relativePath.path()); @@ -1257,12 +1258,11 @@ bool DockerDevicePrivate::ensureReachable(const FilePath &other) if (other.isSameDevice(q->rootPath())) return true; - for (const QString &mount : deviceSettings->mounts()) { - const FilePath fMount = FilePath::fromString(mount); - if (other.isChildOf(fMount)) + for (const FilePath &mount : deviceSettings->mounts()) { + if (other.isChildOf(mount)) return true; - if (fMount == other) + if (mount == other) return true; } diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 821438edb8a..d44a676bfd5 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -26,7 +26,7 @@ public: Utils::StringAspect repo{this}; Utils::StringAspect tag{this}; Utils::BoolAspect useLocalUidGid{this}; - Utils::StringListAspect mounts{this}; + Utils::FilePathListAspect mounts{this}; Utils::BoolAspect keepEntryPoint{this}; Utils::BoolAspect enableLldbFlags{this}; Utils::FilePathAspect clangdExecutable{this}; diff --git a/src/plugins/docker/dockerdevicewidget.cpp b/src/plugins/docker/dockerdevicewidget.cpp index 0ec608d4538..7450297c158 100644 --- a/src/plugins/docker/dockerdevicewidget.cpp +++ b/src/plugins/docker/dockerdevicewidget.cpp @@ -57,28 +57,13 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) auto pathListLabel = new InfoLabel(Tr::tr("Paths to mount:")); pathListLabel->setAdditionalToolTip(Tr::tr("Source directory list should not be empty.")); - m_pathsListEdit = new PathListEditor; - m_pathsListEdit->setPlaceholderText(Tr::tr("Host directories to mount into the container")); - m_pathsListEdit->setToolTip(Tr::tr("Maps paths in this list one-to-one to the " - "docker container.")); - m_pathsListEdit->setPathList(deviceSettings->mounts()); - m_pathsListEdit->setMaximumHeight(100); - m_pathsListEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - - auto markupMounts = [this, pathListLabel] { - const bool isEmpty = m_pathsListEdit->pathList().isEmpty(); + auto markupMounts = [deviceSettings, pathListLabel] { + const bool isEmpty = deviceSettings->mounts.volatileValue().isEmpty(); pathListLabel->setType(isEmpty ? InfoLabel::Warning : InfoLabel::None); }; markupMounts(); - connect(m_pathsListEdit, - &PathListEditor::changed, - this, - [this, dockerDevice, markupMounts, deviceSettings] { - deviceSettings->mounts.setVolatileValue(m_pathsListEdit->pathList()); - // dockerDevice->setData(m_data); - markupMounts(); - }); + connect(&deviceSettings->mounts, &FilePathListAspect::volatileValueChanged, this, markupMounts); auto logView = new QTextBrowser; connect(&m_kitItemDetector, &KitDetector::logOutput, @@ -183,7 +168,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) deviceSettings->clangdExecutable, br, Column { pathListLabel, - m_pathsListEdit, + deviceSettings->mounts, }, br, If { dockerDevice->isAutoDetected(), {}, {detectionControls} }, noMargin, diff --git a/src/plugins/docker/dockerdevicewidget.h b/src/plugins/docker/dockerdevicewidget.h index 7a15239c513..edc76062c40 100644 --- a/src/plugins/docker/dockerdevicewidget.h +++ b/src/plugins/docker/dockerdevicewidget.h @@ -31,7 +31,6 @@ public: void updateDaemonStateTexts(); private: - Utils::PathListEditor *m_pathsListEdit; QLabel *m_daemonState; QToolButton *m_daemonReset; From 77cc79b7b00faea848f8f21b0cae93b64adb573a Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 5 Sep 2023 14:11:33 +0200 Subject: [PATCH 1056/1777] CMake: Cache CMakeTool capabilities Change-Id: Ie81347a7864abeeb64aa2af6dee3f9def241fed8 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../cmakeprojectmanager/cmakesettingspage.cpp | 2 +- src/plugins/cmakeprojectmanager/cmaketool.cpp | 65 +++++++++++-------- src/plugins/cmakeprojectmanager/cmaketool.h | 8 +-- 3 files changed, 44 insertions(+), 31 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp index 1bfb6cee658..10f03133850 100644 --- a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp +++ b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp @@ -113,7 +113,7 @@ public: CMakeTool cmake(m_autodetected ? CMakeTool::AutoDetection : CMakeTool::ManualDetection, m_id); cmake.setFilePath(m_executable); - m_isSupported = cmake.hasFileApi(); + m_isSupported = cmake.hasFileApi(true); m_tooltip = Tr::tr("Version: %1").arg(cmake.versionDisplay()); m_tooltip += "<br>" + Tr::tr("Supports fileApi: %1").arg(m_isSupported ? Tr::tr("yes") : Tr::tr("no")); diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 580db212507..67067555653 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -10,6 +10,7 @@ #include <utils/algorithm.h> #include <utils/environment.h> +#include <utils/persistentcachestore.h> #include <utils/process.h> #include <utils/qtcassert.h> @@ -151,13 +152,13 @@ FilePath CMakeTool::filePath() const return m_executable; } -bool CMakeTool::isValid() const +bool CMakeTool::isValid(bool ignoreCache) const { if (!m_id.isValid() || !m_introspection) return false; if (!m_introspection->m_didAttemptToRun) - readInformation(); + readInformation(ignoreCache); return m_introspection->m_didRun && !m_introspection->m_fileApis.isEmpty(); } @@ -274,9 +275,9 @@ TextEditor::Keywords CMakeTool::keywords() m_introspection->m_functionArgs); } -bool CMakeTool::hasFileApi() const +bool CMakeTool::hasFileApi(bool ignoreCache) const { - return isValid() ? !m_introspection->m_fileApis.isEmpty() : false; + return isValid(ignoreCache) ? !m_introspection->m_fileApis.isEmpty() : false; } CMakeTool::Version CMakeTool::version() const @@ -388,7 +389,7 @@ void CMakeTool::openCMakeHelpUrl(const CMakeTool *tool, const QString &linkUrl) Core::HelpManager::showHelpUrl(linkUrl.arg(documentationUrl(version, online))); } -void CMakeTool::readInformation() const +void CMakeTool::readInformation(bool ignoreCache) const { QTC_ASSERT(m_introspection, return ); if (!m_introspection->m_didRun && m_introspection->m_didAttemptToRun) @@ -396,7 +397,7 @@ void CMakeTool::readInformation() const m_introspection->m_didAttemptToRun = true; - fetchFromCapabilities(); + fetchFromCapabilities(ignoreCache); } static QStringList parseDefinition(const QString &definition) @@ -490,8 +491,17 @@ QStringList CMakeTool::parseVariableOutput(const QString &output) return result; } -void CMakeTool::fetchFromCapabilities() const +void CMakeTool::fetchFromCapabilities(bool ignoreCache) const { + expected_str<Utils::Store> cache = PersistentCacheStore::byKey( + keyFromString("CMake_" + cmakeExecutable().toUserOutput())); + + if (cache && !ignoreCache) { + m_introspection->m_didRun = true; + parseFromCapabilities(cache->value("CleanedStdOut").toString()); + return; + } + Process cmake; runCMake(cmake, {"-E", "capabilities"}); @@ -502,6 +512,12 @@ void CMakeTool::fetchFromCapabilities() const qCCritical(cmakeToolLog) << "Fetching capabilities failed: " << cmake.allOutput() << cmake.error(); m_introspection->m_didRun = false; } + + Store newData{{"CleanedStdOut", cmake.cleanedStdOut()}}; + const auto result + = PersistentCacheStore::write(keyFromString("CMake_" + cmakeExecutable().toUserOutput()), + newData); + QTC_ASSERT_EXPECTED(result, return); } static int getVersion(const QVariantMap &obj, const QString value) @@ -529,26 +545,23 @@ void CMakeTool::parseFromCapabilities(const QString &input) const gen.value("toolsetSupport").toBool())); } - { - const QVariantMap fileApis = data.value("fileApi").toMap(); - const QVariantList requests = fileApis.value("requests").toList(); - for (const QVariant &r : requests) { - const QVariantMap object = r.toMap(); - const QString kind = object.value("kind").toString(); - const QVariantList versionList = object.value("version").toList(); - std::pair<int, int> highestVersion{-1, -1}; - for (const QVariant &v : versionList) { - const QVariantMap versionObject = v.toMap(); - const std::pair<int, int> version{getVersion(versionObject, "major"), - getVersion(versionObject, "minor")}; - if (version.first > highestVersion.first - || (version.first == highestVersion.first - && version.second > highestVersion.second)) - highestVersion = version; - } - if (!kind.isNull() && highestVersion.first != -1 && highestVersion.second != -1) - m_introspection->m_fileApis.append({kind, highestVersion}); + const QVariantMap fileApis = data.value("fileApi").toMap(); + const QVariantList requests = fileApis.value("requests").toList(); + for (const QVariant &r : requests) { + const QVariantMap object = r.toMap(); + const QString kind = object.value("kind").toString(); + const QVariantList versionList = object.value("version").toList(); + std::pair<int, int> highestVersion{-1, -1}; + for (const QVariant &v : versionList) { + const QVariantMap versionObject = v.toMap(); + const std::pair<int, int> version{getVersion(versionObject, "major"), + getVersion(versionObject, "minor")}; + if (version.first > highestVersion.first + || (version.first == highestVersion.first && version.second > highestVersion.second)) + highestVersion = version; } + if (!kind.isNull() && highestVersion.first != -1 && highestVersion.second != -1) + m_introspection->m_fileApis.append({kind, highestVersion}); } const QVariantMap versionInfo = data.value("version").toMap(); diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index 838e9cf07e8..4ae2ab1f998 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -57,7 +57,7 @@ public: static Utils::Id createId(); - bool isValid() const; + bool isValid(bool ignoreCache = false) const; Utils::Id id() const { return m_id; } Utils::Store toMap () const; @@ -74,7 +74,7 @@ public: bool autoCreateBuildDirectory() const; QList<Generator> supportedGenerators() const; TextEditor::Keywords keywords(); - bool hasFileApi() const; + bool hasFileApi(bool ignoreCache = false) const; Version version() const; QString versionDisplay() const; @@ -96,13 +96,13 @@ public: static void openCMakeHelpUrl(const CMakeTool *tool, const QString &linkUrl); private: - void readInformation() const; + void readInformation(bool ignoreCache = false) const; void runCMake(Utils::Process &proc, const QStringList &args, int timeoutS = 1) const; void parseFunctionDetailsOutput(const QString &output); QStringList parseVariableOutput(const QString &output); - void fetchFromCapabilities() const; + void fetchFromCapabilities(bool ignoreCache = false) const; void parseFromCapabilities(const QString &input) const; // Note: New items here need also be handled in CMakeToolItemModel::apply() From 2906c7bedf5f54b997726a75ddd2e8ed34154c71 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 11 Sep 2023 15:02:46 +0200 Subject: [PATCH 1057/1777] Debugger: Enable sorting in the settings page As for the other tabs in the Kits category. Change-Id: Ibaed64336ed2ef57c463fe43ed5ca3e78aa673b2 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/debuggeritemmanager.cpp | 21 ++++++++++++++----- .../projectexplorer/kitoptionspage.cpp | 19 ++++++++++++----- src/plugins/projectexplorer/kitoptionspage.h | 4 ++++ .../projectexplorer/toolchainoptionspage.cpp | 1 + src/plugins/qtsupport/qtoptionspage.cpp | 2 ++ 5 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index 7b1c2a2ef9e..4abca97388a 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -10,6 +10,7 @@ #include <coreplugin/icore.h> #include <projectexplorer/devicesupport/devicemanager.h> +#include <projectexplorer/kitoptionspage.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorericons.h> @@ -203,11 +204,13 @@ const DebuggerItem *findDebugger(const Predicate &pred) return titem ? &titem->m_item : nullptr; } +static QString genericCategoryDisplayName() { return Tr::tr("Generic"); } + DebuggerItemModel::DebuggerItemModel() { setHeader({Tr::tr("Name"), Tr::tr("Path"), Tr::tr("Type")}); - auto generic = new StaticTreeItem(Tr::tr("Generic")); + auto generic = new StaticTreeItem(genericCategoryDisplayName()); auto autoDetected = new StaticTreeItem({ProjectExplorer::Constants::msgAutoDetected()}, {ProjectExplorer::Constants::msgAutoDetectedToolTip()}); rootItem()->appendChild(generic); @@ -942,12 +945,19 @@ public: m_container->setState(DetailsWidget::NoSummary); m_container->setVisible(false); + m_sortModel = new KitSettingsSortModel(this); + m_sortModel->setSourceModel(&itemModel()); + m_sortModel->setSortedCategories({genericCategoryDisplayName(), + ProjectExplorer::Constants::msgAutoDetected(), + ProjectExplorer::Constants::msgManual()}); m_debuggerView = new QTreeView(this); - m_debuggerView->setModel(&itemModel()); + m_debuggerView->setModel(m_sortModel); m_debuggerView->setUniformRowHeights(true); m_debuggerView->setSelectionMode(QAbstractItemView::SingleSelection); m_debuggerView->setSelectionBehavior(QAbstractItemView::SelectRows); m_debuggerView->expandAll(); + m_debuggerView->setSortingEnabled(true); + m_debuggerView->sortByColumn(0, Qt::AscendingOrder); auto header = m_debuggerView->header(); header->setStretchLastSection(false); @@ -1003,6 +1013,7 @@ public: void currentDebuggerChanged(const QModelIndex &newCurrent); void updateButtons(); + KitSettingsSortModel *m_sortModel; QTreeView *m_debuggerView; QPushButton *m_addButton; QPushButton *m_cloneButton; @@ -1027,7 +1038,7 @@ void DebuggerSettingsPageWidget::cloneDebugger() newItem.setGeneric(item->isGeneric()); newItem.setEngineType(item->engineType()); auto addedItem = itemModel().addDebuggerItem(newItem, true); - m_debuggerView->setCurrentIndex(itemModel().indexForItem(addedItem)); + m_debuggerView->setCurrentIndex(m_sortModel->mapFromSource(itemModel().indexForItem(addedItem))); } void DebuggerSettingsPageWidget::addDebugger() @@ -1038,7 +1049,7 @@ void DebuggerSettingsPageWidget::addDebugger() item.setUnexpandedDisplayName(itemModel().uniqueDisplayName(Tr::tr("New Debugger"))); item.setAutoDetected(false); auto addedItem = itemModel().addDebuggerItem(item, true); - m_debuggerView->setCurrentIndex(itemModel().indexForItem(addedItem)); + m_debuggerView->setCurrentIndex(m_sortModel->mapFromSource(itemModel().indexForItem(addedItem))); } void DebuggerSettingsPageWidget::removeDebugger() @@ -1052,7 +1063,7 @@ void DebuggerSettingsPageWidget::removeDebugger() void DebuggerSettingsPageWidget::currentDebuggerChanged(const QModelIndex &newCurrent) { - itemModel().setCurrentIndex(newCurrent); + itemModel().setCurrentIndex(m_sortModel->mapToSource(newCurrent)); updateButtons(); } diff --git a/src/plugins/projectexplorer/kitoptionspage.cpp b/src/plugins/projectexplorer/kitoptionspage.cpp index 21fcf862123..14098e98320 100644 --- a/src/plugins/projectexplorer/kitoptionspage.cpp +++ b/src/plugins/projectexplorer/kitoptionspage.cpp @@ -33,11 +33,19 @@ namespace ProjectExplorer { bool KitSettingsSortModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const { - if (!source_left.parent().isValid()) { - QTC_CHECK(!source_right.parent().isValid()); - return sourceModel()->data(source_left) == Constants::msgAutoDetected(); - } - return SortModel::lessThan(source_left, source_right); + const auto defaultCmp = [&] { return SortModel::lessThan(source_left, source_right); }; + + if (m_sortedCategories.isEmpty() || source_left.parent().isValid()) + return defaultCmp(); + + QTC_ASSERT(!source_right.parent().isValid(), return defaultCmp()); + const int leftIndex = m_sortedCategories.indexOf(sourceModel()->data(source_left)); + QTC_ASSERT(leftIndex != -1, return defaultCmp()); + if (leftIndex == 0) + return true; + const int rightIndex = m_sortedCategories.indexOf(sourceModel()->data(source_right)); + QTC_ASSERT(rightIndex != -1, return defaultCmp()); + return leftIndex < rightIndex; } namespace Internal { @@ -534,6 +542,7 @@ KitOptionsPageWidget::KitOptionsPageWidget() verticalLayout->setStretch(0, 1); verticalLayout->setStretch(1, 0); m_sortModel = new KitSettingsSortModel(this); + m_sortModel->setSortedCategories({Constants::msgAutoDetected(), Constants::msgManual()}); m_sortModel->setSourceModel(m_model); m_kitsView->setModel(m_sortModel); diff --git a/src/plugins/projectexplorer/kitoptionspage.h b/src/plugins/projectexplorer/kitoptionspage.h index 297d3e766b5..8734024574f 100644 --- a/src/plugins/projectexplorer/kitoptionspage.h +++ b/src/plugins/projectexplorer/kitoptionspage.h @@ -16,8 +16,12 @@ class PROJECTEXPLORER_EXPORT KitSettingsSortModel : public Utils::SortModel public: using SortModel::SortModel; + void setSortedCategories(const QStringList &categories) { m_sortedCategories = categories; } + private: bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; + + QStringList m_sortedCategories; }; namespace Internal { diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index 237b9ff8921..3585050f6dc 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -183,6 +183,7 @@ public: m_toolChainView->setSelectionMode(QAbstractItemView::SingleSelection); m_toolChainView->setSelectionBehavior(QAbstractItemView::SelectRows); m_sortModel.setSourceModel(&m_model); + m_sortModel.setSortedCategories({Constants::msgAutoDetected(), Constants::msgManual()}); m_toolChainView->setModel(&m_sortModel); m_toolChainView->setSortingEnabled(true); m_toolChainView->sortByColumn(0, Qt::AscendingOrder); diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index ef5960a7629..741aeeb567c 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -315,6 +315,8 @@ QtOptionsPageWidget::QtOptionsPageWidget() m_model->rootItem()->appendChild(m_manualItem); m_filterModel = new KitSettingsSortModel(this); + m_filterModel->setSortedCategories({ProjectExplorer::Constants::msgAutoDetected(), + ProjectExplorer::Constants::msgManual()}); m_filterModel->setSourceModel(m_model); m_qtdirList->setModel(m_filterModel); From 3a3bf41eef26b58cfda1ff8031dfd9d21ad19636 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 3 Aug 2023 19:29:37 +0200 Subject: [PATCH 1058/1777] CMakePM: Add support for cmake-format config files Fixes: QTCREATORBUG-28969 Change-Id: I0bb31993e4d2ffd8affcc67dee5fd70654e2c1d3 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../cmakeprojectmanager/cmakeformatter.cpp | 50 ++++++++++++++++++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeformatter.cpp b/src/plugins/cmakeprojectmanager/cmakeformatter.cpp index 9128adccad1..38e9f0cb32c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeformatter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeformatter.cpp @@ -97,7 +97,11 @@ public: Core::Command *cmd = ActionManager::registerAction(&formatFile, Constants::CMAKEFORMATTER_ACTION_ID); connect(&formatFile, &QAction::triggered, this, [this] { - TextEditor::formatCurrentFile(formatCommand()); + auto command = formatCommand(); + if (auto editor = EditorManager::currentEditor()) + extendCommandWithConfigs(command, editor->document()->filePath()); + + TextEditor::formatCurrentFile(command); }); ActionManager::actionContainer(Constants::CMAKEFORMATTER_MENU_ID)->addAction(cmd); @@ -142,6 +146,46 @@ public: return cmd; } + static FilePaths formatConfigFiles(const FilePath &dir) + { + if (dir.isEmpty()) + return FilePaths(); + + return filtered(transform({".cmake-format", + ".cmake-format.py", + ".cmake-format.json", + ".cmake-format.yaml", + "cmake-format.py", + "cmake-format.json", + "cmake-format.yaml"}, + [dir](const QString &fileName) { + return dir.pathAppended(fileName); + }), + &FilePath::exists); + } + + static FilePaths findConfigs(const FilePath &fileName) + { + FilePath parentDirectory = fileName.parentDir(); + while (parentDirectory.exists()) { + FilePaths configFiles = formatConfigFiles(parentDirectory); + if (!configFiles.isEmpty()) + return configFiles; + + parentDirectory = parentDirectory.parentDir(); + } + return FilePaths(); + } + + static void extendCommandWithConfigs(TextEditor::Command &command, const FilePath &source) + { + const FilePaths configFiles = findConfigs(source); + if (!configFiles.isEmpty()) { + command.addOption("--config-files"); + command.addOptions(Utils::transform(configFiles, &FilePath::nativePath)); + } + } + FilePathAspect command{this}; bool haveValidFormatCommand{false}; BoolAspect autoFormatOnSave{this}; @@ -199,8 +243,10 @@ void CMakeFormatterSettings::applyIfNecessary(IDocument *document) const IEditor *currentEditor = EditorManager::currentEditor(); IEditor *editor = editors.contains(currentEditor) ? currentEditor : editors.first(); - if (auto widget = TextEditorWidget::fromEditor(editor)) + if (auto widget = TextEditorWidget::fromEditor(editor)) { + extendCommandWithConfigs(command, editor->document()->filePath()); TextEditor::formatEditor(widget, command); + } } CMakeFormatterSettings &formatterSettings() From 578e4c13fd57aca79793030dd3dea8fb8831d778 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Fri, 8 Sep 2023 16:05:22 +0200 Subject: [PATCH 1059/1777] DAP: Add attach function to gdb dap engine Change-Id: Id1c886cf3bbdbf85d4eed39f288107fc71317496 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/dapengine.cpp | 30 ++++++++++++++------- src/plugins/debugger/dap/dapengine.h | 3 ++- src/plugins/debugger/dap/gdbdapengine.cpp | 33 ++++++++++++++++++++++- src/plugins/debugger/dap/gdbdapengine.h | 5 ++++ src/plugins/debugger/dap/pydapengine.cpp | 2 ++ 5 files changed, 61 insertions(+), 12 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 1cb129d445b..954ade1c83b 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -120,7 +120,16 @@ void DapEngine::handleDapStarted() qCDebug(dapEngineLog) << "handleDapStarted"; } -void DapEngine::handleDapConfigurationDone() +void DapEngine::handleDapInitialize() +{ + QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); + + m_dapClient->sendLaunch(runParameters().inferior.command.executable()); + + qCDebug(dapEngineLog) << "handleDapLaunch"; +} + +void DapEngine::handleDapEventInitialized() { QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); @@ -129,14 +138,9 @@ void DapEngine::handleDapConfigurationDone() qCDebug(dapEngineLog) << "handleDapConfigurationDone"; } - -void DapEngine::handleDapInitialize() +void DapEngine::handleDapConfigurationDone() { - QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); - - m_dapClient->sendLaunch(runParameters().inferior.command.executable()); - - qCDebug(dapEngineLog) << "handleDapLaunch"; + notifyEngineRunAndInferiorRunOk(); } void DapEngine::interruptInferior() @@ -480,6 +484,12 @@ void DapEngine::handleResponse(DapResponseType type, const QJsonObject &response { const QString command = response.value("command").toString(); + if (response.contains("success") && !response.value("success").toBool()) { + showMessage(QString("DAP COMMAND FAILED: %1").arg(command)); + qCDebug(dapEngineLog) << "DAP COMMAND FAILED:" << command; + return; + } + switch (type) { case DapResponseType::Initialize: qCDebug(dapEngineLog) << "initialize success"; @@ -488,7 +498,7 @@ void DapEngine::handleResponse(DapResponseType type, const QJsonObject &response case DapResponseType::ConfigurationDone: showMessage("configurationDone", LogDebug); qCDebug(dapEngineLog) << "configurationDone success"; - notifyEngineRunAndInferiorRunOk(); + handleDapConfigurationDone(); break; case DapResponseType::Continue: showMessage("continue", LogDebug); @@ -597,7 +607,7 @@ void DapEngine::handleEvent(DapEventType type, const QJsonObject &event) case DapEventType::Initialized: qCDebug(dapEngineLog) << "initialize success"; claimInitialBreakpoints(); - handleDapConfigurationDone(); + handleDapEventInitialized(); break; case DapEventType::Stopped: handleStoppedEvent(event); diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 6f650c05419..fee31ba345e 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -85,7 +85,8 @@ protected: void handleDapStarted(); virtual void handleDapInitialize(); - void handleDapConfigurationDone(); + void handleDapEventInitialized(); + virtual void handleDapConfigurationDone(); void dapRemoveBreakpoint(const Breakpoint &bp); void dapInsertBreakpoint(const Breakpoint &bp); diff --git a/src/plugins/debugger/dap/gdbdapengine.cpp b/src/plugins/debugger/dap/gdbdapengine.cpp index e4334c9e39a..7414382bce2 100644 --- a/src/plugins/debugger/dap/gdbdapengine.cpp +++ b/src/plugins/debugger/dap/gdbdapengine.cpp @@ -93,12 +93,43 @@ GdbDapEngine::GdbDapEngine() setDebuggerType("DAP"); } +void GdbDapEngine::handleDapInitialize() +{ + if (!isLocalAttachEngine()) { + DapEngine::handleDapInitialize(); + return; + } + + QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); + m_dapClient->postRequest("attach", QJsonObject{{"__restart", ""}}); + qCDebug(dapEngineLog) << "handleDapAttach"; +} + + +bool GdbDapEngine::isLocalAttachEngine() const +{ + return runParameters().startMode == AttachToLocalProcess; +} + +void GdbDapEngine::handleDapConfigurationDone() +{ + if (!isLocalAttachEngine()) { + DapEngine::handleDapConfigurationDone(); + return; + } + + notifyEngineRunAndInferiorStopOk(); +} + void GdbDapEngine::setupEngine() { QTC_ASSERT(state() == EngineSetupRequested, qCDebug(dapEngineLog) << state()); const DebuggerRunParameters &rp = runParameters(); - const CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}}; + CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}}; + + if (isLocalAttachEngine()) + cmd.addArgs({"-p", QString::number(rp.attachPID.pid())}); QVersionNumber oldestVersion(14, 0, 50); QVersionNumber version = QVersionNumber::fromString(rp.version); diff --git a/src/plugins/debugger/dap/gdbdapengine.h b/src/plugins/debugger/dap/gdbdapengine.h index a968ab4a5ac..0633420f494 100644 --- a/src/plugins/debugger/dap/gdbdapengine.h +++ b/src/plugins/debugger/dap/gdbdapengine.h @@ -14,6 +14,11 @@ public: private: void setupEngine() override; + + void handleDapInitialize() override; + void handleDapConfigurationDone() override; + + bool isLocalAttachEngine() const; }; } // Debugger::Internal diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index 89e87023245..8eca92cf6a3 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -88,6 +88,8 @@ public: connect(m_timer, &QTimer::timeout, this, [this]() { m_socket.connectToHost(m_hostName, m_port); m_socket.waitForConnected(); + qCDebug(dapEngineLog) << "proc id" << m_proc.processId(); + if (m_socket.state() == QTcpSocket::ConnectedState) m_timer->stop(); From 7605f5c934fb00ae4d6ed037dd5bdcb77889b5cc Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Tue, 12 Sep 2023 10:44:57 +0200 Subject: [PATCH 1060/1777] DAP: Add different log category for different dap engines Change-Id: Ia21926b860f8fee7399c40ad382ff31f360f73ce Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/cmakedapengine.cpp | 16 ++++-- src/plugins/debugger/dap/cmakedapengine.h | 7 +++ src/plugins/debugger/dap/dapclient.cpp | 8 ++- src/plugins/debugger/dap/dapclient.h | 11 +++- src/plugins/debugger/dap/dapengine.cpp | 56 ++++++++++----------- src/plugins/debugger/dap/dapengine.h | 8 +++ src/plugins/debugger/dap/gdbdapengine.cpp | 27 +++++++--- src/plugins/debugger/dap/gdbdapengine.h | 7 +++ src/plugins/debugger/dap/pydapengine.cpp | 18 ++++--- src/plugins/debugger/dap/pydapengine.h | 7 +++ 10 files changed, 109 insertions(+), 56 deletions(-) diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp index 1a243bfa771..65a31f4c3a3 100644 --- a/src/plugins/debugger/dap/cmakedapengine.cpp +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -22,7 +22,6 @@ using namespace Core; using namespace Utils; -static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg) namespace Debugger::Internal { @@ -83,7 +82,7 @@ public: : DapClient(provider, parent) {} - void sendInitialize() + void sendInitialize() override { postRequest("initialize", QJsonObject{{"clientID", "QtCreator"}, @@ -91,6 +90,13 @@ public: {"adapterID", "cmake"}, {"pathFormat", "path"}}); } + +private: + const QLoggingCategory &logCategory() override { + static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.cmake", + QtWarningMsg); + return logCategory; + } }; CMakeDapEngine::CMakeDapEngine() @@ -103,10 +109,10 @@ CMakeDapEngine::CMakeDapEngine() void CMakeDapEngine::setupEngine() { - QTC_ASSERT(state() == EngineSetupRequested, qCDebug(dapEngineLog) << state()); + QTC_ASSERT(state() == EngineSetupRequested, qCDebug(logCategory()) << state()); - qCDebug(dapEngineLog) << "build system name" - << ProjectExplorer::ProjectTree::currentBuildSystem()->name(); + qCDebug(logCategory()) << "build system name" + << ProjectExplorer::ProjectTree::currentBuildSystem()->name(); IDataProvider *dataProvider; if (TemporaryDirectory::masterDirectoryFilePath().osType() == Utils::OsType::OsTypeWindows) { diff --git a/src/plugins/debugger/dap/cmakedapengine.h b/src/plugins/debugger/dap/cmakedapengine.h index c385590779f..8a0f8b73359 100644 --- a/src/plugins/debugger/dap/cmakedapengine.h +++ b/src/plugins/debugger/dap/cmakedapengine.h @@ -22,6 +22,13 @@ private: /* Needed for CMake support issue:25176 */ bool hasCapability(unsigned cap) const override; + + const QLoggingCategory &logCategory() override + { + static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.cmake", + QtWarningMsg); + return logCategory; + } }; } // Debugger::Internal diff --git a/src/plugins/debugger/dap/dapclient.cpp b/src/plugins/debugger/dap/dapclient.cpp index 1a70283e9e0..ae337a1c57c 100644 --- a/src/plugins/debugger/dap/dapclient.cpp +++ b/src/plugins/debugger/dap/dapclient.cpp @@ -13,8 +13,6 @@ using namespace Core; using namespace Utils; -static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg); - namespace Debugger::Internal { DapClient::DapClient(IDataProvider *dataProvider, QObject *parent) @@ -51,7 +49,7 @@ void DapClient::postRequest(const QString &command, const QJsonObject &arguments const QByteArray data = QJsonDocument(obseq).toJson(QJsonDocument::Compact); const QByteArray msg = "Content-Length: " + QByteArray::number(data.size()) + "\r\n\r\n" + data; - qCDebug(dapEngineLog) << msg; + qCDebug(logCategory()) << msg; m_dataProvider->writeRaw(msg); } @@ -150,7 +148,7 @@ void DapClient::readOutput() { m_inbuffer.append(m_dataProvider->readAllStandardOutput()); - qCDebug(dapEngineLog) << m_inbuffer; + qCDebug(logCategory()) << m_inbuffer; while (true) { // Something like @@ -190,7 +188,7 @@ void DapClient::emitSignals(const QJsonDocument &doc) const QJsonValue t = ob.value("type"); const QString type = t.toString(); - qCDebug(dapEngineLog) << "dap response" << ob; + qCDebug(logCategory()) << "dap response" << ob; if (type == "response") { DapResponseType type = DapResponseType::Unknown; diff --git a/src/plugins/debugger/dap/dapclient.h b/src/plugins/debugger/dap/dapclient.h index 92528fc59df..066abd3fd53 100644 --- a/src/plugins/debugger/dap/dapclient.h +++ b/src/plugins/debugger/dap/dapclient.h @@ -7,6 +7,8 @@ #include <utils/process.h> +#include <QLoggingCategory> + namespace Debugger::Internal { class IDataProvider : public QObject @@ -109,9 +111,14 @@ signals: private: void readOutput(); -private: - IDataProvider *m_dataProvider = nullptr; + virtual const QLoggingCategory &logCategory() + { + static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine", + QtWarningMsg); + return logCategory; + } + IDataProvider *m_dataProvider = nullptr; QByteArray m_inbuffer; }; diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 954ade1c83b..0660aa463fd 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -61,13 +61,11 @@ using namespace Core; using namespace Utils; -static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg) - namespace Debugger::Internal { void DapEngine::executeDebuggerCommand(const QString &/*command*/) { - QTC_ASSERT(state() == InferiorStopOk, qCDebug(dapEngineLog) << state()); + QTC_ASSERT(state() == InferiorStopOk, qCDebug(logCategory()) << state()); // if (state() == DebuggerNotReady) { // showMessage("DAP PROCESS NOT RUNNING, PLAIN CMD IGNORED: " + command); // return; @@ -92,50 +90,50 @@ void DapEngine::runCommand(const DebuggerCommand &cmd) void DapEngine::shutdownInferior() { - QTC_ASSERT(state() == InferiorShutdownRequested, qCDebug(dapEngineLog) << state()); + QTC_ASSERT(state() == InferiorShutdownRequested, qCDebug(logCategory()) << state()); m_dapClient->sendDisconnect(); - qCDebug(dapEngineLog) << "DapEngine::shutdownInferior()"; + qCDebug(logCategory()) << "DapEngine::shutdownInferior()"; notifyInferiorShutdownFinished(); } void DapEngine::shutdownEngine() { - QTC_ASSERT(state() == EngineShutdownRequested, qCDebug(dapEngineLog) << state()); + QTC_ASSERT(state() == EngineShutdownRequested, qCDebug(logCategory()) << state()); m_dapClient->sendTerminate(); - qCDebug(dapEngineLog) << "DapEngine::shutdownEngine()"; + qCDebug(logCategory()) << "DapEngine::shutdownEngine()"; m_dapClient->dataProvider()->kill(); } void DapEngine::handleDapStarted() { notifyEngineSetupOk(); - QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); + QTC_ASSERT(state() == EngineRunRequested, qCDebug(logCategory()) << state()); m_dapClient->sendInitialize(); - qCDebug(dapEngineLog) << "handleDapStarted"; + qCDebug(logCategory()) << "handleDapStarted"; } void DapEngine::handleDapInitialize() { - QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); + QTC_ASSERT(state() == EngineRunRequested, qCDebug(logCategory()) << state()); m_dapClient->sendLaunch(runParameters().inferior.command.executable()); - qCDebug(dapEngineLog) << "handleDapLaunch"; + qCDebug(logCategory()) << "handleDapLaunch"; } void DapEngine::handleDapEventInitialized() { - QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); + QTC_ASSERT(state() == EngineRunRequested, qCDebug(logCategory()) << state()); m_dapClient->sendConfigurationDone(); - qCDebug(dapEngineLog) << "handleDapConfigurationDone"; + qCDebug(logCategory()) << "handleDapConfigurationDone"; } void DapEngine::handleDapConfigurationDone() @@ -271,7 +269,7 @@ void DapEngine::dapInsertBreakpoint(const Breakpoint &bp) m_dapClient->setBreakpoints(breakpoints, params.fileName); - qCDebug(dapEngineLog) << "insertBreakpoint" << bp->modelId() << bp->responseId(); + qCDebug(logCategory()) << "insertBreakpoint" << bp->modelId() << bp->responseId(); } void DapEngine::updateBreakpoint(const Breakpoint &bp) @@ -312,7 +310,7 @@ void DapEngine::dapRemoveBreakpoint(const Breakpoint &bp) m_dapClient->setBreakpoints(breakpoints, params.fileName); - qCDebug(dapEngineLog) << "removeBreakpoint" << bp->modelId() << bp->responseId(); + qCDebug(logCategory()) << "removeBreakpoint" << bp->modelId() << bp->responseId(); } void DapEngine::loadSymbols(const Utils::FilePath &/*moduleName*/) @@ -474,7 +472,7 @@ void DapEngine::handleDapDone() void DapEngine::readDapStandardError() { QString err = m_dapClient->dataProvider()->readAllStandardError(); - qCDebug(dapEngineLog) << "DAP STDERR:" << err; + qCDebug(logCategory()) << "DAP STDERR:" << err; //qWarning() << "Unexpected DAP stderr:" << err; showMessage("Unexpected DAP stderr: " + err); //handleOutput(err); @@ -486,23 +484,23 @@ void DapEngine::handleResponse(DapResponseType type, const QJsonObject &response if (response.contains("success") && !response.value("success").toBool()) { showMessage(QString("DAP COMMAND FAILED: %1").arg(command)); - qCDebug(dapEngineLog) << "DAP COMMAND FAILED:" << command; + qCDebug(logCategory()) << "DAP COMMAND FAILED:" << command; return; } switch (type) { case DapResponseType::Initialize: - qCDebug(dapEngineLog) << "initialize success"; + qCDebug(logCategory()) << "initialize success"; handleDapInitialize(); break; case DapResponseType::ConfigurationDone: showMessage("configurationDone", LogDebug); - qCDebug(dapEngineLog) << "configurationDone success"; + qCDebug(logCategory()) << "configurationDone success"; handleDapConfigurationDone(); break; case DapResponseType::Continue: showMessage("continue", LogDebug); - qCDebug(dapEngineLog) << "continue success"; + qCDebug(logCategory()) << "continue success"; notifyInferiorRunOk(); break; case DapResponseType::StackTrace: @@ -544,7 +542,7 @@ void DapEngine::handleStackTraceResponse(const QJsonObject &response) const FilePath file = FilePath::fromString( stackFrame.value("source").toObject().value("path").toString()); const int line = stackFrame.value("line").toInt(); - qCDebug(dapEngineLog) << "stackTrace success" << file << line; + qCDebug(logCategory()) << "stackTrace success" << file << line; gotoLocation(Location(file, line)); refreshStack(stackFrames); @@ -605,7 +603,7 @@ void DapEngine::handleEvent(DapEventType type, const QJsonObject &event) switch (type) { case DapEventType::Initialized: - qCDebug(dapEngineLog) << "initialize success"; + qCDebug(logCategory()) << "initialize success"; claimInitialBreakpoints(); handleDapEventInitialized(); break; @@ -672,7 +670,7 @@ void DapEngine::handleBreakpointEvent(const QJsonObject &event) Breakpoint bp = breakHandler()->findBreakpointByResponseId( QString::number(breakpoint.value("id").toInt())); - qCDebug(dapEngineLog) << "breakpoint id :" << breakpoint.value("id").toInt(); + qCDebug(logCategory()) << "breakpoint id :" << breakpoint.value("id").toInt(); if (bp) { BreakpointParameters parameters = bp->requestedParameters(); @@ -690,10 +688,10 @@ void DapEngine::handleBreakpointEvent(const QJsonObject &event) const BreakpointParameters ¶ms = bp->requestedParameters(); if (params.oneShot) continueInferior(); - qCDebug(dapEngineLog) << "breakpoint inserted"; + qCDebug(logCategory()) << "breakpoint inserted"; } else { notifyBreakpointInsertFailed(bp); - qCDebug(dapEngineLog) << "breakpoint insertion failed"; + qCDebug(logCategory()) << "breakpoint insertion failed"; } return; } @@ -701,10 +699,10 @@ void DapEngine::handleBreakpointEvent(const QJsonObject &event) if (body.value("reason").toString() == "removed") { if (breakpoint.value("verified").toBool()) { notifyBreakpointRemoveOk(bp); - qCDebug(dapEngineLog) << "breakpoint removed"; + qCDebug(logCategory()) << "breakpoint removed"; } else { notifyBreakpointRemoveFailed(bp); - qCDebug(dapEngineLog) << "breakpoint remove failed"; + qCDebug(logCategory()) << "breakpoint remove failed"; } return; } @@ -727,7 +725,7 @@ void DapEngine::refreshLocals(const QJsonArray &variables) if (variablesReference > 0) item->wantsChildren = true; - qCDebug(dapEngineLog) << "variable" << name << variablesReference; + qCDebug(logCategory()) << "variable" << name << variablesReference; if (m_isFirstLayer) m_watchItems.append(item); else @@ -800,7 +798,7 @@ bool DapEngine::hasCapability(unsigned cap) const void DapEngine::claimInitialBreakpoints() { BreakpointManager::claimBreakpointsForEngine(this); - qCDebug(dapEngineLog) << "claimInitialBreakpoints"; + qCDebug(logCategory()) << "claimInitialBreakpoints"; } void DapEngine::connectDataGeneratorSignals() diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index fee31ba345e..45ed723fad4 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -7,6 +7,7 @@ #include <utils/process.h> +#include <QLoggingCategory> #include <QVariant> #include <queue> @@ -118,6 +119,13 @@ protected: std::queue<int> m_variablesReferenceQueue; WatchItem *m_currentWatchItem = nullptr; QList<WatchItem *> m_watchItems; + + virtual const QLoggingCategory &logCategory() + { + static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine", + QtWarningMsg); + return logCategory; + } }; } // Debugger::Internal diff --git a/src/plugins/debugger/dap/gdbdapengine.cpp b/src/plugins/debugger/dap/gdbdapengine.cpp index 7414382bce2..40c7eaa21b8 100644 --- a/src/plugins/debugger/dap/gdbdapengine.cpp +++ b/src/plugins/debugger/dap/gdbdapengine.cpp @@ -17,12 +17,10 @@ #include <QDebug> #include <QLocalSocket> -#include <QLoggingCategory> #include <QVersionNumber> using namespace Core; using namespace Utils; -static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg) namespace Debugger::Internal { @@ -85,6 +83,22 @@ private: const CommandLine m_cmd; }; +class GdbDapClient : public DapClient +{ +public: + GdbDapClient(IDataProvider *provider, QObject *parent = nullptr) + : DapClient(provider, parent) + {} + +private: + const QLoggingCategory &logCategory() override + { + static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.gdb", + QtWarningMsg); + return logCategory; + } +}; + GdbDapEngine::GdbDapEngine() : DapEngine() { @@ -100,12 +114,11 @@ void GdbDapEngine::handleDapInitialize() return; } - QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); + QTC_ASSERT(state() == EngineRunRequested, qCDebug(logCategory()) << state()); m_dapClient->postRequest("attach", QJsonObject{{"__restart", ""}}); - qCDebug(dapEngineLog) << "handleDapAttach"; + qCDebug(logCategory()) << "handleDapAttach"; } - bool GdbDapEngine::isLocalAttachEngine() const { return runParameters().startMode == AttachToLocalProcess; @@ -123,7 +136,7 @@ void GdbDapEngine::handleDapConfigurationDone() void GdbDapEngine::setupEngine() { - QTC_ASSERT(state() == EngineSetupRequested, qCDebug(dapEngineLog) << state()); + QTC_ASSERT(state() == EngineSetupRequested, qCDebug(logCategory()) << state()); const DebuggerRunParameters &rp = runParameters(); CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}}; @@ -142,7 +155,7 @@ void GdbDapEngine::setupEngine() } IDataProvider *dataProvider = new ProcessDataProvider(rp, cmd, this); - m_dapClient = new DapClient(dataProvider, this); + m_dapClient = new GdbDapClient(dataProvider, this); connectDataGeneratorSignals(); m_dapClient->dataProvider()->start(); diff --git a/src/plugins/debugger/dap/gdbdapengine.h b/src/plugins/debugger/dap/gdbdapengine.h index 0633420f494..b4205544b73 100644 --- a/src/plugins/debugger/dap/gdbdapengine.h +++ b/src/plugins/debugger/dap/gdbdapengine.h @@ -19,6 +19,13 @@ private: void handleDapConfigurationDone() override; bool isLocalAttachEngine() const; + + const QLoggingCategory &logCategory() override + { + static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.gdb", + QtWarningMsg); + return logCategory; + } }; } // Debugger::Internal diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index 8eca92cf6a3..b9c79017ef8 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -20,7 +20,6 @@ #include <projectexplorer/projecttree.h> #include <QDebug> -#include <QLoggingCategory> #include <QTcpSocket> #include <QTimer> #include <QVersionNumber> @@ -28,11 +27,8 @@ using namespace Core; using namespace Utils; -static Q_LOGGING_CATEGORY(dapEngineLog, "qtc.dbg.dapengine", QtWarningMsg) - namespace Debugger::Internal { - const char installDebugPyInfoBarId[] = "Python::InstallDebugPy"; static bool missingPySideInstallation(const FilePath &pythonPath, const QString &packageName) @@ -88,7 +84,6 @@ public: connect(m_timer, &QTimer::timeout, this, [this]() { m_socket.connectToHost(m_hostName, m_port); m_socket.waitForConnected(); - qCDebug(dapEngineLog) << "proc id" << m_proc.processId(); if (m_socket.state() == QTcpSocket::ConnectedState) m_timer->stop(); @@ -152,7 +147,7 @@ public: : DapClient(provider, parent) {} - void sendInitialize() + void sendInitialize() override { postRequest("initialize", QJsonObject{{"clientID", "QtCreator"}, @@ -160,6 +155,13 @@ public: {"adapterID", "python"}, {"pathFormat", "path"}}); } +private: + const QLoggingCategory &logCategory() override + { + static const QLoggingCategory dapEngineLog = QLoggingCategory("qtc.dbg.dapengine.python", + QtWarningMsg); + return dapEngineLog; + } }; PyDapEngine::PyDapEngine() @@ -172,11 +174,11 @@ PyDapEngine::PyDapEngine() void PyDapEngine::handleDapInitialize() { - QTC_ASSERT(state() == EngineRunRequested, qCDebug(dapEngineLog) << state()); + QTC_ASSERT(state() == EngineRunRequested, qCDebug(logCategory()) << state()); m_dapClient->sendAttach(); - qCDebug(dapEngineLog) << "handleDapAttach"; + qCDebug(logCategory()) << "handleDapAttach"; } void PyDapEngine::quitDebugger() diff --git a/src/plugins/debugger/dap/pydapengine.h b/src/plugins/debugger/dap/pydapengine.h index 06cdaba8716..406654919fd 100644 --- a/src/plugins/debugger/dap/pydapengine.h +++ b/src/plugins/debugger/dap/pydapengine.h @@ -18,6 +18,13 @@ private: void setupEngine() override; Utils::Process m_proc; + + const QLoggingCategory &logCategory() override + { + static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.python", + QtWarningMsg); + return logCategory; + } }; } // Debugger::Internal From 69163584978867a3d9eba5d6ae645b5147ea3c89 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 12 Sep 2023 11:56:17 +0200 Subject: [PATCH 1061/1777] ProjectExplorer: Add missing 'override' Amends 50c9c9aa860. Change-Id: I48dc3767f8ec750b463b8dfe5d9735eaaa481c8e Reviewed-by: Knud Dollereder <knud.dollereder@qt.io> --- src/plugins/projectexplorer/gcctoolchain.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index bdb1fb03fd0..beb736be4d0 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -98,7 +98,7 @@ public: }; GccToolChain *asGccToolChain() final { return this; } - bool matchesCompilerCommand(const Utils::FilePath &command) const; + bool matchesCompilerCommand(const Utils::FilePath &command) const override; void setPriority(int priority) { m_priority = priority; } From c5555035f1a52c58d9b91a68900d900c532a3c15 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 11 Sep 2023 19:22:04 +0200 Subject: [PATCH 1062/1777] ProcessHelper: Fix setChildProcessModifier() The original change that introduced the usage of QProcess::UnixProcessFlag introduced also a regression. Since ProcessHelper::setLowPriority() and setUnixTerminalDisabled() are part of public API, we can't use m_lowPriority and m_unixTerminalDisabled inside c'tor for early return before setting the setChildProcessModifier(), because these values may be changed later, before starting the process. Amends e8ca1877de7f5cc6fec940551b3a13745170bcb0 Fixes: QTCREATORBUG-29457 Change-Id: Ief360c123f6284c7df105ef530c4602555b5b069 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/utils/processutils.cpp | 43 +++++++++++++++++++++------------ src/libs/utils/processutils.h | 5 ++-- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/libs/utils/processutils.cpp b/src/libs/utils/processutils.cpp index c5fc3d1ade7..1c4f988fc51 100644 --- a/src/libs/utils/processutils.cpp +++ b/src/libs/utils/processutils.cpp @@ -105,19 +105,35 @@ BOOL CALLBACK sendInterruptMessageToAllWindowsOfProcess_enumWnd(HWND hwnd, LPARA ProcessHelper::ProcessHelper(QObject *parent) : QProcess(parent), m_processStartHandler(this) +{} + +void ProcessHelper::setLowPriority() +{ + m_lowPriority = true; + enableChildProcessModifier(); +} + +void ProcessHelper::setUnixTerminalDisabled() { #if defined(Q_OS_UNIX) - bool needSetsid = m_unixTerminalDisabled; -# if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) - if (needSetsid) { - setUnixProcessParameters(QProcess::UnixProcessFlag::CreateNewSession); - needSetsid = false; - } +# if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) + m_unixTerminalDisabled = true; + enableChildProcessModifier(); +# else + setUnixProcessParameters(QProcess::UnixProcessFlag::CreateNewSession); # endif +#endif +} - if (!m_lowPriority && !needSetsid) - return; - setChildProcessModifier([=, this] { +void ProcessHelper::setUseCtrlCStub(bool enabled) +{ + m_useCtrlCStub = enabled; +} + +void ProcessHelper::enableChildProcessModifier() +{ +#if defined(Q_OS_UNIX) + setChildProcessModifier([this] { // nice value range is -20 to +19 where -20 is highest, 0 default and +19 is lowest if (m_lowPriority) { errno = 0; @@ -125,18 +141,15 @@ ProcessHelper::ProcessHelper(QObject *parent) perror("Failed to set nice value"); } +# if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) // Disable terminal by becoming a session leader. - if (needSetsid) + if (m_unixTerminalDisabled) setsid(); +# endif }); #endif } -void ProcessHelper::setUseCtrlCStub(bool enabled) -{ - m_useCtrlCStub = enabled; -} - void ProcessHelper::terminateProcess() { #ifdef Q_OS_WIN diff --git a/src/libs/utils/processutils.h b/src/libs/utils/processutils.h index 89202c0daf2..c2a864db1fb 100644 --- a/src/libs/utils/processutils.h +++ b/src/libs/utils/processutils.h @@ -40,8 +40,8 @@ public: using QProcess::setErrorString; - void setLowPriority() { m_lowPriority = true; } - void setUnixTerminalDisabled() { m_unixTerminalDisabled = true; } + void setLowPriority(); + void setUnixTerminalDisabled(); void setUseCtrlCStub(bool enabled); // release only static void terminateProcess(QProcess *process); @@ -49,6 +49,7 @@ public: static void interruptPid(qint64 pid); private: + void enableChildProcessModifier(); void terminateProcess(); bool m_lowPriority = false; From 19672406b420b1f1f3a76f7d7b438468ea0ac427 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 7 Sep 2023 12:48:07 +0200 Subject: [PATCH 1063/1777] DAP: Add terminal output for installing debugpy Change-Id: I2136b966b37f2a652053d6c30b16f05defaed756 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/debugger/dap/pydapengine.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index b9c79017ef8..a160c074671 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -202,15 +202,7 @@ void installDebugpyPackage(const FilePath &pythonPath) CommandLine cmd{pythonPath, {"-m", "pip", "install", "debugpy"}}; Process process; process.setCommand(cmd); - - QObject::connect(&process, &Process::textOnStandardError, [](const QString &text) { - MessageManager::writeSilently("Python debugger: debugpy package installation failed" + text); - }); - - QObject::connect(&process, &Process::done, []() { - MessageManager::writeSilently("Python debugger: debugpy package installed."); - }); - + process.setTerminalMode(TerminalMode::Run); process.start(); process.waitForFinished(); } From ba20b249c9554e0f2ec4b9d76a4ebb1ad5bb899d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 12 Sep 2023 10:51:03 +0200 Subject: [PATCH 1064/1777] Utils: Some microoptimization in the persistentsettings writing In some cases the exact type of a tag is not needed. Change-Id: I0e46d12c5dde34734e7e711dd940b9aa570d23f7 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/persistentsettings.cpp | 121 ++++++++++---------------- 1 file changed, 46 insertions(+), 75 deletions(-) diff --git a/src/libs/utils/persistentsettings.cpp b/src/libs/utils/persistentsettings.cpp index a151465317d..97c0fb9e943 100644 --- a/src/libs/utils/persistentsettings.cpp +++ b/src/libs/utils/persistentsettings.cpp @@ -95,18 +95,14 @@ static QRect stringToRectangle(const QString &v) namespace Utils { -struct Context // Basic context containing element name string constants. -{ - Context() {} - const QString qtCreatorElement = QString("qtcreator"); - const QString dataElement = QString("data"); - const QString variableElement = QString("variable"); - const QString typeAttribute = QString("type"); - const QString valueElement = QString("value"); - const QString valueListElement = QString("valuelist"); - const QString valueMapElement = QString("valuemap"); - const QString keyAttribute = QString("key"); -}; +const QString qtCreatorElement("qtcreator"); +const QString dataElement("data"); +const QString variableElement("variable"); +const QString typeAttribute("type"); +const QString valueElement("value"); +const QString valueListElement("valuelist"); +const QString valueMapElement("valuemap"); +const QString keyAttribute("key"); struct ParseValueStackEntry { @@ -160,22 +156,16 @@ void ParseValueStackEntry::addChild(const Key &key, const QVariant &v) } } -class ParseContext : public Context +class ParseContext { public: Store parse(const FilePath &file); private: - enum Element { QtCreatorElement, DataElement, VariableElement, - SimpleValueElement, ListValueElement, MapValueElement, UnknownElement }; - - Element element(const QStringView &r) const; - static inline bool isValueElement(Element e) - { return e == SimpleValueElement || e == ListValueElement || e == MapValueElement; } QVariant readSimpleValue(QXmlStreamReader &r, const QXmlStreamAttributes &attributes) const; bool handleStartElement(QXmlStreamReader &r); - bool handleEndElement(const QStringView &name); + bool handleEndElement(const QStringView name); static QString formatWarning(const QXmlStreamReader &r, const QString &message); @@ -215,19 +205,14 @@ Store ParseContext::parse(const FilePath &file) bool ParseContext::handleStartElement(QXmlStreamReader &r) { const QStringView name = r.name(); - const Element e = element(name); - if (e == VariableElement) { + if (name == variableElement) { m_currentVariableName = keyFromString(r.readElementText()); return false; } - if (!ParseContext::isValueElement(e)) - return false; - - const QXmlStreamAttributes attributes = r.attributes(); - const Key key = attributes.hasAttribute(keyAttribute) ? - keyFromString(attributes.value(keyAttribute).toString()) : Key(); - switch (e) { - case SimpleValueElement: { + if (name == valueElement) { + const QXmlStreamAttributes attributes = r.attributes(); + const Key key = attributes.hasAttribute(keyAttribute) ? + keyFromString(attributes.value(keyAttribute).toString()) : Key(); // This reads away the end element, so, handle end element right here. const QVariant v = readSimpleValue(r, attributes); if (!v.isValid()) { @@ -237,22 +222,26 @@ bool ParseContext::handleStartElement(QXmlStreamReader &r) m_valueStack.push_back(ParseValueStackEntry(v, key)); return handleEndElement(name); } - case ListValueElement: + if (name == valueListElement) { + const QXmlStreamAttributes attributes = r.attributes(); + const Key key = attributes.hasAttribute(keyAttribute) ? + keyFromString(attributes.value(keyAttribute).toString()) : Key(); m_valueStack.push_back(ParseValueStackEntry(QVariant::List, key)); - break; - case MapValueElement: + return false; + } + if (name == valueMapElement) { + const QXmlStreamAttributes attributes = r.attributes(); + const Key key = attributes.hasAttribute(keyAttribute) ? + keyFromString(attributes.value(keyAttribute).toString()) : Key(); m_valueStack.push_back(ParseValueStackEntry(QVariant::Map, key)); - break; - default: - break; + return false; } return false; } -bool ParseContext::handleEndElement(const QStringView &name) +bool ParseContext::handleEndElement(const QStringView name) { - const Element e = element(name); - if (ParseContext::isValueElement(e)) { + if (name == valueElement || name == valueListElement || name == valueMapElement) { QTC_ASSERT(!m_valueStack.isEmpty(), return true); const ParseValueStackEntry top = m_valueStack.pop(); if (m_valueStack.isEmpty()) { // Last element? -> Done with that variable. @@ -262,8 +251,9 @@ bool ParseContext::handleEndElement(const QStringView &name) return false; } m_valueStack.top().addChild(top.key, top.value()); + return false; } - return e == QtCreatorElement; + return name == qtCreatorElement; } QString ParseContext::formatWarning(const QXmlStreamReader &r, const QString &message) @@ -278,23 +268,6 @@ QString ParseContext::formatWarning(const QXmlStreamReader &r, const QString &me return result; } -ParseContext::Element ParseContext::element(const QStringView &r) const -{ - if (r == valueElement) - return SimpleValueElement; - if (r == valueListElement) - return ListValueElement; - if (r == valueMapElement) - return MapValueElement; - if (r == qtCreatorElement) - return QtCreatorElement; - if (r == dataElement) - return DataElement; - if (r == variableElement) - return VariableElement; - return UnknownElement; -} - QVariant ParseContext::readSimpleValue(QXmlStreamReader &r, const QXmlStreamAttributes &attributes) const { // Simple value @@ -363,40 +336,39 @@ static QString xmlAttrFromKey(const Key &key) { return stringFromKey(key); } static Key xmlAttrFromKey(const Key &key) { return key; } #endif -static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx, - const QVariant &variant, const Key &key = {}) +static void writeVariantValue(QXmlStreamWriter &w, const QVariant &variant, const Key &key = {}) { static const int storeId = qMetaTypeId<Store>(); const int variantType = variant.typeId(); if (variantType == QMetaType::QStringList || variantType == QMetaType::QVariantList) { - w.writeStartElement(ctx.valueListElement); - w.writeAttribute(ctx.typeAttribute, "QVariantList"); + w.writeStartElement(valueListElement); + w.writeAttribute(typeAttribute, "QVariantList"); if (!key.isEmpty()) - w.writeAttribute(ctx.keyAttribute, xmlAttrFromKey(key)); + w.writeAttribute(keyAttribute, xmlAttrFromKey(key)); const QList<QVariant> list = variant.toList(); for (const QVariant &var : list) - writeVariantValue(w, ctx, var); + writeVariantValue(w, var); w.writeEndElement(); } else if (variantType == storeId || variantType == QMetaType::QVariantMap) { - w.writeStartElement(ctx.valueMapElement); - w.writeAttribute(ctx.typeAttribute, "QVariantMap"); + w.writeStartElement(valueMapElement); + w.writeAttribute(typeAttribute, "QVariantMap"); if (!key.isEmpty()) - w.writeAttribute(ctx.keyAttribute, xmlAttrFromKey(key)); + w.writeAttribute(keyAttribute, xmlAttrFromKey(key)); const Store varMap = storeFromVariant(variant); const Store::const_iterator cend = varMap.constEnd(); for (Store::const_iterator i = varMap.constBegin(); i != cend; ++i) - writeVariantValue(w, ctx, i.value(), i.key()); + writeVariantValue(w, i.value(), i.key()); w.writeEndElement(); } else if (variantType == QMetaType::QObjectStar) { // ignore QObjects } else if (variantType == QMetaType::VoidStar) { // ignore void pointers } else { - w.writeStartElement(ctx.valueElement); - w.writeAttribute(ctx.typeAttribute, QLatin1String(variant.typeName())); + w.writeStartElement(valueElement); + w.writeAttribute(typeAttribute, QLatin1String(variant.typeName())); if (!key.isEmpty()) - w.writeAttribute(ctx.keyAttribute, xmlAttrFromKey(key)); + w.writeAttribute(keyAttribute, xmlAttrFromKey(key)); switch (variant.type()) { case QVariant::Rect: w.writeCharacters(rectangleToString(variant.toRect())); @@ -445,7 +417,6 @@ bool PersistentSettingsWriter::write(const Store &data, QString *errorString) co m_fileName.parentDir().ensureWritableDir(); FileSaver saver(m_fileName, QIODevice::Text); if (!saver.hasError()) { - const Context ctx; QXmlStreamWriter w(saver.file()); w.setAutoFormatting(true); w.setAutoFormattingIndent(1); // Historical, used to be QDom. @@ -455,13 +426,13 @@ bool PersistentSettingsWriter::write(const Store &data, QString *errorString) co arg(QCoreApplication::applicationName(), QCoreApplication::applicationVersion(), QDateTime::currentDateTime().toString(Qt::ISODate))); - w.writeStartElement(ctx.qtCreatorElement); + w.writeStartElement(qtCreatorElement); const Store::const_iterator cend = data.constEnd(); for (Store::const_iterator it = data.constBegin(); it != cend; ++it) { - w.writeStartElement(ctx.dataElement); + w.writeStartElement(dataElement); // FIXME: stringFromKey() not needed from Qt 6.5 onward. - w.writeTextElement(ctx.variableElement, stringFromKey(it.key())); - writeVariantValue(w, ctx, it.value()); + w.writeTextElement(variableElement, stringFromKey(it.key())); + writeVariantValue(w, it.value()); w.writeEndElement(); } w.writeEndDocument(); From 797e6d55a67f7f5c9e49e8099fc6d25cce865a0e Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 12 Sep 2023 14:59:10 +0200 Subject: [PATCH 1065/1777] Minor fixes to compile for building with Qt6.2 Change-Id: I15ab9b92d19491bb0aca3d2389a589411e1fec8d Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/perfprofiler/perfsettings.cpp | 4 ++-- src/plugins/screenrecorder/screenrecorderplugin.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp index 9e9781a4fda..e8524e6395e 100644 --- a/src/plugins/perfprofiler/perfsettings.cpp +++ b/src/plugins/perfprofiler/perfsettings.cpp @@ -432,7 +432,7 @@ void PerfSettings::readGlobalSettings() settings->beginGroup(QLatin1String(Constants::AnalyzerSettingsGroupId)); Store map = defaults; for (Store::ConstIterator it = defaults.constBegin(); it != defaults.constEnd(); ++it) - map.insert(it.key(), settings->value(it.key(), it.value())); + map.insert(it.key(), settings->value(stringFromKey(it.key()), it.value())); settings->endGroup(); fromMap(map); @@ -445,7 +445,7 @@ void PerfSettings::writeGlobalSettings() const Store map; toMap(map); for (Store::ConstIterator it = map.constBegin(); it != map.constEnd(); ++it) - settings->setValue(it.key(), it.value()); + settings->setValue(stringFromKey(it.key()), it.value()); settings->endGroup(); } diff --git a/src/plugins/screenrecorder/screenrecorderplugin.cpp b/src/plugins/screenrecorder/screenrecorderplugin.cpp index f84e866e935..a0993593f04 100644 --- a/src/plugins/screenrecorder/screenrecorderplugin.cpp +++ b/src/plugins/screenrecorder/screenrecorderplugin.cpp @@ -28,6 +28,7 @@ #include <coreplugin/actionmanager/command.h> #include <coreplugin/icore.h> +#include <QAction> #include <QDialog> #include <QPushButton> From 67aab388731d1ab34253853d3988be7e71ea7962 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 12 Sep 2023 07:36:55 +0200 Subject: [PATCH 1066/1777] Utils: Add undo/redo to BoolAspect Change-Id: Ie80e81c2ceef232278e2815ffa56bcbaef903eb2 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 800b0fb2995..f951ec544e6 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -698,6 +698,8 @@ public: QPointer<QAbstractButton> m_button; // Owned by configuration widget QPointer<QGroupBox> m_groupBox; // For BoolAspects handling GroupBox check boxes bool m_buttonIsAdopted = false; + + UndoableValue<bool> m_undoable; }; class ColorAspectPrivate @@ -1708,6 +1710,8 @@ BoolAspect::BoolAspect(AspectContainer *container) { setDefaultValue(false); setSpan(2, 1); + + d->m_undoable.setSilently(false); } /*! @@ -1741,9 +1745,15 @@ void BoolAspect::addToLayout(Layouting::LayoutItem &parent) break; } + connect(d->m_button.data(), &QAbstractButton::clicked, this, [this] { + pushUndo(d->m_undoable.set(d->m_button->isChecked())); + }); + + connect(&d->m_undoable.m_signal, &UndoSignaller::changed, d->m_button, [this]() { + d->m_button->setChecked(d->m_undoable.get()); + handleGuiChanged(); + }); bufferToGui(); - connect(d->m_button.data(), &QAbstractButton::clicked, - this, &BoolAspect::handleGuiChanged); } void BoolAspect::adoptButton(QAbstractButton *button) @@ -1764,6 +1774,16 @@ std::function<void (QObject *)> BoolAspect::groupChecker() groupBox->setCheckable(true); groupBox->setChecked(value()); d->m_groupBox = groupBox; + + connect(d->m_groupBox.data(), &QGroupBox::clicked, this, [this] { + pushUndo(d->m_undoable.set(d->m_groupBox->isChecked())); + }); + + connect(&d->m_undoable.m_signal, &UndoSignaller::changed, d->m_groupBox, [this]() { + d->m_groupBox->setChecked(d->m_undoable.get()); + handleGuiChanged(); + }); + bufferToGui(); }; } @@ -1785,20 +1805,12 @@ QAction *BoolAspect::action() bool BoolAspect::guiToBuffer() { - const bool old = m_buffer; - if (d->m_button) - m_buffer = d->m_button->isChecked(); - else if (d->m_groupBox) - m_buffer = d->m_groupBox->isChecked(); - return m_buffer != old; + return updateStorage(m_buffer, d->m_undoable.get()); } void BoolAspect::bufferToGui() { - if (d->m_button) - d->m_button->setChecked(m_buffer); - else if (d->m_groupBox) - d->m_groupBox->setChecked(m_buffer); + d->m_undoable.setWithoutUndo(m_buffer); } void BoolAspect::setLabel(const QString &labelText, LabelPlacement labelPlacement) From c83047abb93ead2453ab0168659d4e8c7be903e2 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 8 Sep 2023 10:17:29 +0200 Subject: [PATCH 1067/1777] CtfVisualizer: Allow strings for process and thread id While the format document only uses numbers for these in its examples, the data type is not really specified there and chrome://tracing itself handles strings for them without complaint. On trace-generating side std::thread::id can't easily be serialized as a number, and strings can easily be supported in the viewer. Change-Id: I36c8497049d4933058b9f72a28f24e1d1cf0d5bb Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../ctfvisualizer/ctftimelinemodel.cpp | 22 +++++++------ src/plugins/ctfvisualizer/ctftimelinemodel.h | 10 +++--- src/plugins/ctfvisualizer/ctftracemanager.cpp | 31 +++++++++++++------ src/plugins/ctfvisualizer/ctftracemanager.h | 15 +++++---- .../ctfvisualizer/ctfvisualizertool.cpp | 2 +- 5 files changed, 48 insertions(+), 32 deletions(-) diff --git a/src/plugins/ctfvisualizer/ctftimelinemodel.cpp b/src/plugins/ctfvisualizer/ctftimelinemodel.cpp index 8360c2e6f58..2655a86c065 100644 --- a/src/plugins/ctfvisualizer/ctftimelinemodel.cpp +++ b/src/plugins/ctfvisualizer/ctftimelinemodel.cpp @@ -23,15 +23,17 @@ using json = nlohmann::json; using namespace Constants; CtfTimelineModel::CtfTimelineModel(Timeline::TimelineModelAggregator *parent, - CtfTraceManager *traceManager, int tid, int pid) - : Timeline::TimelineModel (parent) + CtfTraceManager *traceManager, + const QString &tid, + const QString &pid) + : Timeline::TimelineModel(parent) , m_traceManager(traceManager) , m_threadId(tid) , m_processId(pid) { updateName(); setCollapsedRowCount(1); - setCategoryColor(colorByHue(pid * 25)); + setCategoryColor(colorByHue(qHash(pid))); setHasMixedTypesInExpandedState(true); } @@ -199,7 +201,7 @@ void CtfTimelineModel::finalize(double traceBegin, double traceEnd, const QStrin emit contentChanged(); } -int CtfTimelineModel::tid() const +QString CtfTimelineModel::tid() const { return m_threadId; } @@ -218,13 +220,13 @@ void CtfTimelineModel::updateName() if (m_threadName.isEmpty()) { setDisplayName(Tr::tr("Thread %1").arg(m_threadId)); } else { - setDisplayName(QString("%1 (%2)").arg(m_threadName).arg(m_threadId)); + setDisplayName(QString("%1 (%2)").arg(m_threadName, m_threadId)); } - QString process = m_processName.isEmpty() ? QString::number(m_processId) : - QString("%1 (%2)").arg(m_processName).arg(m_processId); - QString thread = m_threadName.isEmpty() ? QString::number(m_threadId) : - QString("%1 (%2)").arg(m_threadName).arg(m_threadId); - setTooltip(QString("Process: %1\nThread: %2").arg(process).arg(thread)); + QString process = m_processName.isEmpty() ? m_processId + : QString("%1 (%2)").arg(m_processName, m_processId); + QString thread = m_threadName.isEmpty() ? m_threadId + : QString("%1 (%2)").arg(m_threadName, m_threadId); + setTooltip(QString("Process: %1\nThread: %2").arg(process, thread)); } qint64 CtfTimelineModel::newStackEvent(const json &event, qint64 normalizedTime, diff --git a/src/plugins/ctfvisualizer/ctftimelinemodel.h b/src/plugins/ctfvisualizer/ctftimelinemodel.h index 3df35f17894..186a0dcefeb 100644 --- a/src/plugins/ctfvisualizer/ctftimelinemodel.h +++ b/src/plugins/ctfvisualizer/ctftimelinemodel.h @@ -28,7 +28,9 @@ class CtfTimelineModel : public Timeline::TimelineModel public: explicit CtfTimelineModel(Timeline::TimelineModelAggregator *parent, - CtfTraceManager *traceManager, int tid, int pid); + CtfTraceManager *traceManager, + const QString &tid, + const QString &pid); QRgb color(int index) const override; QVariantList labels() const override; @@ -44,7 +46,7 @@ public: void finalize(double traceBegin, double traceEnd, const QString &processName, const QString &threadName); - int tid() const; + QString tid() const; QString eventTitle(int index) const; signals: @@ -65,9 +67,9 @@ private: protected: CtfTraceManager *const m_traceManager; - int m_threadId; + QString m_threadId; QString m_threadName; - int m_processId; + QString m_processId; QString m_processName; int m_maxStackSize = 0; diff --git a/src/plugins/ctfvisualizer/ctftracemanager.cpp b/src/plugins/ctfvisualizer/ctftracemanager.cpp index a2faa108031..82e5b54b762 100644 --- a/src/plugins/ctfvisualizer/ctftracemanager.cpp +++ b/src/plugins/ctfvisualizer/ctftracemanager.cpp @@ -105,8 +105,19 @@ void CtfTraceManager::addEvent(const json &event) m_timeOffset = timestamp; } - const int processId = event.value(CtfProcessIdKey, 0); - const int threadId = event.contains(CtfThreadIdKey) ? int(event[CtfThreadIdKey]) : processId; + static const auto getStringValue = [](const json &event, const char *key, const QString &def) { + if (!event.contains(key)) + return def; + const json val = event[key]; + if (val.is_string()) + return QString::fromStdString(val); + if (val.is_number()) { + return QString::number(int(val)); + } + return def; + }; + const QString processId = getStringValue(event, CtfProcessIdKey, "0"); + const QString threadId = getStringValue(event, CtfThreadIdKey, processId); if (!m_threadModels.contains(threadId)) { addModelForThread(threadId, processId); } @@ -202,14 +213,16 @@ int CtfTraceManager::getSelectionId(const std::string &name) QList<CtfTimelineModel *> CtfTraceManager::getSortedThreads() const { QList<CtfTimelineModel *> models = m_threadModels.values(); - std::sort(models.begin(), models.end(), [](const CtfTimelineModel *a, const CtfTimelineModel *b) -> bool { - return (a->m_processId != b->m_processId) ? (a->m_processId < b->m_processId) - : (std::abs(a->m_threadId) < std::abs(b->m_threadId)); - }); + std::sort(models.begin(), + models.end(), + [](const CtfTimelineModel *a, const CtfTimelineModel *b) -> bool { + return (a->m_processId != b->m_processId) ? (a->m_processId < b->m_processId) + : (a->m_threadId < b->m_threadId); + }); return models; } -void CtfTraceManager::setThreadRestriction(int tid, bool restrictToThisThread) +void CtfTraceManager::setThreadRestriction(const QString &tid, bool restrictToThisThread) { if (m_threadRestrictions.value(tid) == restrictToThisThread) return; @@ -218,12 +231,12 @@ void CtfTraceManager::setThreadRestriction(int tid, bool restrictToThisThread) addModelsToAggregator(); } -bool CtfTraceManager::isRestrictedTo(int tid) const +bool CtfTraceManager::isRestrictedTo(const QString &tid) const { return m_threadRestrictions.value(tid); } -void CtfTraceManager::addModelForThread(int threadId, int processId) +void CtfTraceManager::addModelForThread(const QString &threadId, const QString &processId) { CtfTimelineModel *model = new CtfTimelineModel(m_modelAggregator, this, threadId, processId); m_threadModels.insert(threadId, model); diff --git a/src/plugins/ctfvisualizer/ctftracemanager.h b/src/plugins/ctfvisualizer/ctftracemanager.h index 7c6c3cd6132..d376d010b5c 100644 --- a/src/plugins/ctfvisualizer/ctftracemanager.h +++ b/src/plugins/ctfvisualizer/ctftracemanager.h @@ -43,15 +43,14 @@ public: QList<CtfTimelineModel *> getSortedThreads() const; - void setThreadRestriction(int tid, bool restrictToThisThread); - bool isRestrictedTo(int tid) const; + void setThreadRestriction(const QString &tid, bool restrictToThisThread); + bool isRestrictedTo(const QString &tid) const; signals: void detailsRequested(const QString &title); protected: - - void addModelForThread(int threadId, int processId); + void addModelForThread(const QString &threadId, const QString &processId); void addModelsToAggregator(); void updateStatistics(); @@ -61,11 +60,11 @@ protected: Timeline::TimelineModelAggregator *const m_modelAggregator; CtfStatisticsModel *const m_statisticsModel; - QHash<qint64, CtfTimelineModel *> m_threadModels; - QHash<qint64, QString> m_processNames; - QHash<qint64, QString> m_threadNames; + QHash<QString, CtfTimelineModel *> m_threadModels; + QHash<QString, QString> m_processNames; + QHash<QString, QString> m_threadNames; QMap<std::string, int> m_name2selectionId; - QHash<qint64, bool> m_threadRestrictions; + QHash<QString, bool> m_threadRestrictions; double m_traceBegin = std::numeric_limits<double>::max(); double m_traceEnd = std::numeric_limits<double>::min(); diff --git a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp index 8ac7e819f1b..5b13573bb3f 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp +++ b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp @@ -123,7 +123,7 @@ void CtfVisualizerTool::setAvailableThreads(const QList<CtfTimelineModel *> &thr void CtfVisualizerTool::toggleThreadRestriction(QAction *action) { - const int tid = action->data().toInt(); + const QString tid = action->data().toString(); m_traceManager->setThreadRestriction(tid, action->isChecked()); } From 3b6ad4517f7543a10b9073c43eb0407ad3f6777d Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 8 Sep 2023 10:18:53 +0200 Subject: [PATCH 1068/1777] CtfVisualizer: Do not crash/assert Use QTC_ASSERT. Change-Id: I621c607915f71246be1bdb02f2588ed08e37a1cd Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/libs/tracing/timelinezoomcontrol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/tracing/timelinezoomcontrol.cpp b/src/libs/tracing/timelinezoomcontrol.cpp index f5783d09797..7d9ee28c7e8 100644 --- a/src/libs/tracing/timelinezoomcontrol.cpp +++ b/src/libs/tracing/timelinezoomcontrol.cpp @@ -44,7 +44,7 @@ void TimelineZoomControl::clear() void TimelineZoomControl::setTrace(qint64 start, qint64 end) { - Q_ASSERT(start <= end); + QTC_ASSERT(start <= end, { std::swap(start, end); }); if (start != m_traceStart || end != m_traceEnd) { m_traceStart = start; m_traceEnd = end; @@ -55,7 +55,7 @@ void TimelineZoomControl::setTrace(qint64 start, qint64 end) void TimelineZoomControl::setRange(qint64 start, qint64 end) { - Q_ASSERT(start <= end); + QTC_ASSERT(start <= end, { std::swap(start, end); }); if (m_rangeStart != start || m_rangeEnd != end) { if (m_timer.isActive()) { m_timer.stop(); From bd6348fc20d30e4d33e834834c892ec5b6494940 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 12 Sep 2023 14:49:25 +0200 Subject: [PATCH 1069/1777] ExtensionSystem: Reformat -profile messages We have ReallyLongPluginNames nowadays. Change-Id: I722095fea0e9214e1d4e0774399c5d16123e867d Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/extensionsystem/pluginmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index e24f92447df..c072ea67fb4 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -1816,7 +1816,7 @@ void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *s const qint64 elapsedMS = absoluteElapsedMS - m_profileElapsedMS; m_profileElapsedMS = absoluteElapsedMS; if (m_profilingVerbosity > 0) { - qDebug("%-22s %-22s %8lldms (%8lldms)", + qDebug("%-22s %-40s %8lldms (%8lldms)", what, qPrintable(spec->name()), absoluteElapsedMS, @@ -1849,7 +1849,7 @@ QString PluginManagerPrivate::profilingSummary(qint64 *totalOut) const continue; const qint64 t = s->performanceData().total(); summary += QString("%1 %2ms ( %3% ) (%4)\n") - .arg(s->name(), -22) + .arg(s->name(), -34) .arg(t, 8) .arg(100.0 * t / total, 5, 'f', 2) .arg(s->performanceData().summary()); From 305a1a6ed18a15ac22863e16d836acff1ab42618 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 11 Sep 2023 08:53:42 +0200 Subject: [PATCH 1070/1777] CtfVisualizer: Fix computation of nesting level The computed nesting level (which row an event to show in) was solely based on begin+end events and "complete" events were ignored. Compute the rows afterwards, similar to the "parent" computation that the timeline model already does. Find the first row that is free, and use that for the row of the item. Change-Id: I890138c10f5038508da9b286b35d7bcfdf0ab64d Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> --- src/libs/tracing/timelinemodel.cpp | 48 +++++++++++++++++++ src/libs/tracing/timelinemodel.h | 1 + .../ctfvisualizer/ctftimelinemodel.cpp | 18 ++----- src/plugins/ctfvisualizer/ctftimelinemodel.h | 2 +- .../timelinemodel/tst_timelinemodel.cpp | 13 +++++ 5 files changed, 68 insertions(+), 14 deletions(-) diff --git a/src/libs/tracing/timelinemodel.cpp b/src/libs/tracing/timelinemodel.cpp index d0c88f55280..46ab37f3f5a 100644 --- a/src/libs/tracing/timelinemodel.cpp +++ b/src/libs/tracing/timelinemodel.cpp @@ -83,6 +83,54 @@ void TimelineModel::computeNesting() } } +/*! + Compute all ranges' nesting level. Sort them into rows by finding the + first row that has "an open spot". +*/ +QList<int> TimelineModel::computeRows(int *maxlevel) const +{ + *maxlevel = 0; + std::list<int> rows; + QList<int> levels; + levels.reserve(d->ranges.count()); + for (int range = 0; range != count(); ++range) { + TimelineModelPrivate::Range ¤t = d->ranges[range]; + // find first row for inserting + int level = 0; + auto rowIt = rows.begin(); + forever { + if (rowIt == rows.end()) { + // didn't find a row, insert new one + rows.push_back(range); + break; + } + TimelineModelPrivate::Range &rowItem = d->ranges[*rowIt]; + if (rowItem.start + rowItem.duration < current.start) { + // We've completely passed the item + // Use this row for the range + *rowIt = range; + break; + } + ++rowIt; + ++level; + } + levels.append(level); + if (level > *maxlevel) + *maxlevel = level; + // remove other rows that we passed + while (rowIt != rows.end()) { + TimelineModelPrivate::Range &rowItem = d->ranges[*rowIt]; + if (rowItem.start + rowItem.duration < current.start) { + // We've completely passed the item, remove + rowIt = rows.erase(rowIt); + } else { + ++rowIt; + } + } + } + return levels; +} + int TimelineModel::collapsedRowCount() const { return d->collapsedRowCount; diff --git a/src/libs/tracing/timelinemodel.h b/src/libs/tracing/timelinemodel.h index dd89fb0c5f4..5720909d563 100644 --- a/src/libs/tracing/timelinemodel.h +++ b/src/libs/tracing/timelinemodel.h @@ -133,6 +133,7 @@ protected: int insertStart(qint64 startTime, int selectionId); void insertEnd(int index, qint64 duration); void computeNesting(); + QList<int> computeRows(int *maxlevel) const; void setCollapsedRowCount(int rows); void setExpandedRowCount(int rows); diff --git a/src/plugins/ctfvisualizer/ctftimelinemodel.cpp b/src/plugins/ctfvisualizer/ctftimelinemodel.cpp index 2655a86c065..f558e3599f9 100644 --- a/src/plugins/ctfvisualizer/ctftimelinemodel.cpp +++ b/src/plugins/ctfvisualizer/ctftimelinemodel.cpp @@ -105,7 +105,7 @@ int CtfTimelineModel::expandedRow(int index) const if (counterIdx > 0) { return m_counterIndexToRow[counterIdx - 1] + 1; } - return m_nestingLevels.value(index) + m_counterData.size() + 1; + return m_rows.value(index) + m_counterData.size() + 1; } int CtfTimelineModel::collapsedRow(int index) const @@ -187,6 +187,8 @@ void CtfTimelineModel::finalize(double traceBegin, double traceEnd, const QStrin m_details[index].insert(6, {reuse(Tr::tr("Unfinished")), reuse(Tr::tr("true"))}); } computeNesting(); + m_rows = computeRows(&m_maxStackSize); + ++m_maxStackSize; // index -> count QVector<std::string> sortedCounterNames = m_counterNames; std::sort(sortedCounterNames.begin(), sortedCounterNames.end()); @@ -233,8 +235,6 @@ qint64 CtfTimelineModel::newStackEvent(const json &event, qint64 normalizedTime, const std::string &eventPhase, const std::string &name, int selectionId) { - int nestingLevel = m_openEventIds.size(); - m_maxStackSize = std::max(qsizetype(m_maxStackSize), qsizetype(m_openEventIds.size() + 1)); int index = 0; qint64 duration = -1; if (eventPhase == CtfEventTypeBegin) { @@ -250,29 +250,21 @@ qint64 CtfTimelineModel::newStackEvent(const json &event, qint64 normalizedTime, duration = qint64(event[CtfDurationKey]) * 1000; index = insert(normalizedTime, duration, selectionId); for (int i = m_openEventIds.size() - 1; i >= 0; --i) { - if (m_openEventIds[i] >= index) { + if (m_openEventIds[i] >= index) ++m_openEventIds[i]; - // if the event is before an open event, the nesting level decreases: - --nestingLevel; - } } } else { index = insert(normalizedTime, 0, selectionId); for (int i = m_openEventIds.size() - 1; i >= 0; --i) { - if (m_openEventIds[i] >= index) { + if (m_openEventIds[i] >= index) ++m_openEventIds[i]; - --nestingLevel; - } } } if (index >= m_details.size()) { m_details.resize(index + 1); m_details[index] = QMap<int, QPair<QString, QString>>(); - m_nestingLevels.resize(index + 1); - m_nestingLevels[index] = nestingLevel; } else { m_details.insert(index, QMap<int, QPair<QString, QString>>()); - m_nestingLevels.insert(index, nestingLevel); } if (m_counterValues.size() > index) { // if the event was inserted before any counter, we need diff --git a/src/plugins/ctfvisualizer/ctftimelinemodel.h b/src/plugins/ctfvisualizer/ctftimelinemodel.h index 186a0dcefeb..fe7d8c4c0ad 100644 --- a/src/plugins/ctfvisualizer/ctftimelinemodel.h +++ b/src/plugins/ctfvisualizer/ctftimelinemodel.h @@ -73,7 +73,7 @@ protected: QString m_processName; int m_maxStackSize = 0; - QVector<int> m_nestingLevels; + QVector<int> m_rows; QVector<QMap<int, QPair<QString, QString>>> m_details; QSet<int> m_handledTypeIds; QStack<int> m_openEventIds; diff --git a/tests/auto/tracing/timelinemodel/tst_timelinemodel.cpp b/tests/auto/tracing/timelinemodel/tst_timelinemodel.cpp index 559b827de2e..72f16510bce 100644 --- a/tests/auto/tracing/timelinemodel/tst_timelinemodel.cpp +++ b/tests/auto/tracing/timelinemodel/tst_timelinemodel.cpp @@ -57,6 +57,7 @@ private slots: void rowCount(); void prevNext(); void parentingOfEqualStarts(); + void rows(); private: TimelineModelAggregator aggregator; @@ -463,6 +464,18 @@ void tst_TimelineModel::parentingOfEqualStarts() QCOMPARE(dummy.lastIndex(2), 1); } +void tst_TimelineModel::rows() +{ + DummyModel dummy(&aggregator); + dummy.loadData(); + int maxlevel; + const QList<int> levels = dummy.computeRows(&maxlevel); + QCOMPARE(levels.at(0), 0); + QCOMPARE(levels.at(7), 7); + QCOMPARE(levels.at(10), 2); + QCOMPARE(maxlevel, 15); +} + QTEST_GUILESS_MAIN(tst_TimelineModel) #include "tst_timelinemodel.moc" From 5d02b4df71a3014671704d641449363596bec148 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 11 Sep 2023 15:13:36 +0200 Subject: [PATCH 1071/1777] Tracing: Fix assert when wheel zooming The wheel handling code was triggering an assert in qBound when calculating the newStart, when using a touch pad. Rewrite the wheel handling to get rid of the assert and make it more similar to the text editor wheel handling. Change-Id: I0c1306d00be6b3054fb8dba9628b7758880675b0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/libs/tracing/timelinerenderer.cpp | 35 +++++++++++++++------------ 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/libs/tracing/timelinerenderer.cpp b/src/libs/tracing/timelinerenderer.cpp index 07abb071445..ace3efe3ffe 100644 --- a/src/libs/tracing/timelinerenderer.cpp +++ b/src/libs/tracing/timelinerenderer.cpp @@ -183,23 +183,28 @@ void TimelineRenderer::wheelEvent(QWheelEvent *event) // ctrl-wheel means zoom if (event->modifiers() & Qt::ControlModifier) { event->setAccepted(true); + if (event->angleDelta().y() == 0) + return; TimelineZoomControl *zoom = zoomer(); - int degrees = (event->angleDelta().x() + event->angleDelta().y()) / 8; - const qint64 circle = 360; - qint64 mouseTime = event->position().toPoint().x() * zoom->windowDuration() / width() + - zoom->windowStart(); - qint64 beforeMouse = (mouseTime - zoom->rangeStart()) * (circle - degrees) / circle; - qint64 afterMouse = (zoom->rangeEnd() - mouseTime) * (circle - degrees) / circle; - - qint64 newStart = qBound(zoom->traceStart(), zoom->traceEnd(), mouseTime - beforeMouse); - if (newStart + zoom->minimumRangeLength() > zoom->traceEnd()) - return; // too close to trace end - - qint64 newEnd = qBound(newStart + zoom->minimumRangeLength(), zoom->traceEnd(), - mouseTime + afterMouse); - - zoom->setRange(newStart, newEnd); + // Handle similar to text editor, but avoid floats. + // angleDelta of 120 is considered a 10% change in zoom. + const qint64 delta = event->angleDelta().y(); + const qint64 newDuration = qBound(zoom->minimumRangeLength(), + zoom->rangeDuration() * 1200 / (1200 + delta), + std::max(zoom->minimumRangeLength(), + zoom->traceDuration())); + const qint64 mouseTime = event->position().toPoint().x() * zoom->windowDuration() / width() + + zoom->windowStart(); + // Try to keep mouseTime where it was in relation to the shown range, + // but keep within traceStart/End + const qint64 newStart + = qBound(zoom->traceStart(), + mouseTime + - newDuration * /*rest is mouse time position [0,1] in range:*/ + (mouseTime - zoom->rangeStart()) / zoom->rangeDuration(), + std::max(zoom->traceStart(), zoom->traceEnd() - newDuration)); + zoom->setRange(newStart, newStart + newDuration); } else { TimelineAbstractRenderer::wheelEvent(event); } From fcfe73d8f1ff5ca5b3e6bcb7382c1593400c3b11 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 12 Sep 2023 16:19:20 +0200 Subject: [PATCH 1072/1777] Nanotrace: Shutdown should do nothing if not initialized Change-Id: I717296da4c9aea1e9dd28db3421a927f6bb8d332 Reviewed-by: Knud Dollereder <knud.dollereder@qt.io> --- src/libs/nanotrace/nanotrace.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/nanotrace/nanotrace.cpp b/src/libs/nanotrace/nanotrace.cpp index 658d84a43f1..c5adeb4d724 100644 --- a/src/libs/nanotrace/nanotrace.cpp +++ b/src/libs/nanotrace/nanotrace.cpp @@ -168,6 +168,9 @@ void init(const std::string &process, const std::string &thread, const std::stri void shutdown() { + if (!initEvent.initialized) + return; + flush(); if (std::ofstream stream(initEvent.filePath, std::ios::app); stream.good()) From b8564b48c053eaec3bd1bad9b461980166a76867 Mon Sep 17 00:00:00 2001 From: Andreas Loth <andreas.loth@qt.io> Date: Thu, 7 Sep 2023 11:35:25 +0200 Subject: [PATCH 1073/1777] Axivion: Propagate cancellation form future to network reply (abort it) Change-Id: Ibcad2410276dbf752f73fbc8c9091156892670ff Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/axivion/dashboard/dashboardclient.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/axivion/dashboard/dashboardclient.cpp b/src/plugins/axivion/dashboard/dashboardclient.cpp index 4956f106360..d6a091d7fc2 100644 --- a/src/plugins/axivion/dashboard/dashboardclient.cpp +++ b/src/plugins/axivion/dashboard/dashboardclient.cpp @@ -81,6 +81,7 @@ QFuture<DashboardClient::RawProjectInfo> DashboardClient::fetchProjectInfo(const request.setRawHeader(QByteArrayLiteral(u8"X-Axivion-User-Agent"), ua); std::shared_ptr<QNetworkReply> reply{ this->m_networkAccessManager.get(request), deleteLater }; return QtFuture::connect(reply.get(), &QNetworkReply::finished) + .onCanceled(reply.get(), [reply] { reply->abort(); }) .then(RawBodyReader(reply)) .then(QtFuture::Launch::Async, &RawBodyParser<Dto::ProjectInfoDto>); } From 9a81e1270a72c6e58214399b2d6d31cf2996a9c6 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 12 Sep 2023 16:10:38 +0200 Subject: [PATCH 1074/1777] ScreenRecorder: Make extra sure that "last opened directory" is written Change-Id: Iae45c91d6934e50cec48849a455cd79e493c28e4 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/screenrecorder/record.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index 51c80d6d42b..11c1e7a3176 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -265,6 +265,8 @@ RecordWidget::RecordWidget(const FilePath &recordFile, QWidget *parent) "Mov/qtrle rgb24 (*.mov)"); if (!file.isEmpty()) { Internal::settings().lastOpenDirectory.setValue(file.parentDir()); + Internal::settings().lastOpenDirectory.apply(); + Internal::settings().lastOpenDirectory.writeToSettingsImmediatly(); const ClipInfo clip = FFmpegUtils::clipInfo(file); if (clip.isNull()) { QMessageBox::critical(Core::ICore::dialogParent(), From 66fabd0c0d29b20a9fa346f0c790f9751cc03fec Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Thu, 31 Aug 2023 15:16:08 +0200 Subject: [PATCH 1075/1777] Doc: Turn some "Advanced Use" topics into how-to topics Task-number: QTCREATORBUG-29361 Change-Id: Ie675e4d72ad524e0a7a4ba4adca8a477ff579d55 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../src/howto/creator-external-tools.qdoc | 161 +++++++++++------ doc/qtcreator/src/howto/creator-help.qdoc | 20 +- .../src/howto/creator-only/creator-cli.qdoc | 5 +- .../howto/creator-only/creator-how-tos.qdoc | 61 ++++++- .../creator-only/creator-logging-viewer.qdoc | 11 +- .../creator-only/creator-task-lists.qdoc | 15 +- .../src/howto/creator-only/qtcreator-faq.qdoc | 8 +- .../src/howto/creator-telemetry.qdoc | 34 ++-- .../overview/creator-acknowledgements.qdoc | 8 + .../creator-only/creator-glossary.qdoc | 9 +- .../creator-only/creator-help-overview.qdoc | 67 ------- .../creator-only/creator-reference.qdoc | 2 - .../src/overview/creator-tech-support.qdoc | 13 +- doc/qtcreator/src/qtcreator-toc.qdoc | 171 +++++++++--------- .../creator-reference-to-do-entries-view.qdoc | 2 +- .../creator-reference-output-views.qdoc | 11 ++ .../src/widgets/qtdesigner-app-tutorial.qdoc | 2 +- doc/qtcreatordev/src/qtcreator-dev.qdoc | 6 +- .../src/qtdesignstudio-advanced.qdoc | 2 +- .../src/qtdesignstudio-developer-topics.qdoc | 2 +- .../src/qtdesignstudio-toc.qdoc | 6 +- doc/qtdesignstudio/src/qtdesignstudio.qdoc | 4 +- 22 files changed, 349 insertions(+), 271 deletions(-) delete mode 100644 doc/qtcreator/src/overview/creator-only/creator-help-overview.qdoc diff --git a/doc/qtcreator/src/howto/creator-external-tools.qdoc b/doc/qtcreator/src/howto/creator-external-tools.qdoc index 8e003556cf8..c117caee09f 100644 --- a/doc/qtcreator/src/howto/creator-external-tools.qdoc +++ b/doc/qtcreator/src/howto/creator-external-tools.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -13,11 +13,12 @@ \previouspage quick-converting-ui-projects.html \nextpage studio-on-mcus.html \else - \previouspage creator-keyboard-shortcuts.html - \nextpage creator-task-lists.html + \previouspage creator-how-tos.html \endif - \title Using External Tools + \ingroup creator-how-to-use + + \title Use external tools You can use external tools directly from \QC. Qt Linguist, QML preview tools, and the default text editor for your system are preconfigured @@ -27,59 +28,7 @@ To run the tools, select \uicontrol Tools > \uicontrol External, or use the \c x filter in the locator. - \section1 Using Qt Linguist - - When you \l{Creating Projects}{create a new project}, you can automatically - generate a translation source file (TS) for one language. You can add other - languages later by editing the project file. - - You can use the Qt Linguist release manager tools, lupdate and lrelease, - directly from \QC. The lupdate tool is used to synchronize source - code and translations. The lrelease tool is used to create run-time - translation files for use by the released application. - - \note Running the tools from \QC is supported only when using qmake as the - build system. For more information about using the tools with CMake, see - \l{https://doc.qt.io/qt-6/cmake-command-reference.html#qt6-linguisttools} - {Qt6::LinguistTools}. - - To synchronize TS files from a translator with the - application code, select \uicontrol Tools > \uicontrol External > - \uicontrol Linguist > \uicontrol {Update Translations (lupdate)}. - - To generate from the TS files Qt message (QM) files that can be used by an - application, select \uicontrol Tools > \uicontrol External > - \uicontrol Linguist > \uicontrol {Release Translations (lrelease)}. - - By default, the project .pro file is passed to the tools as an argument. To - specify other command line arguments for the tools, select \uicontrol Tools > - \uicontrol External > \uicontrol Configure. - - To open TS files in Qt Linguist, right-click a TS file in the - \uicontrol Projects or \uicontrol {File System} view and select - \uicontrol {Open With} > \uicontrol {Qt Linguist} in the context menu. - For more information about Qt Linguist, see \l{Qt Linguist Manual}. - - \section1 Running QML Files - - You can test the current QML document while you are developing an application. - - To run the currently active QML file, select \uicontrol Tools > - \uicontrol External > \uicontrol {Qt Quick} > \uicontrol {QML Runtime}. - - \section1 Using External Text Editors - - You can open files for editing in the default text editor for your system: - Notepad on Windows and vi on Linux and \macos. - To open the file you are currently viewing in an external editor, select - \uicontrol Tools > \uicontrol External > \uicontrol Text > - \uicontrol {Edit with Notepad} or \uicontrol {Edit with vi}, depending on - your system. - - \QC looks for the editor path in the PATH environment variable - of your operating system. - - \section1 Configuring External Tools + \section1 Configure external tools You can change the configuration of preconfigured tools and configure additional tools in \QC \uicontrol Preferences. @@ -171,4 +120,102 @@ in Windows. To share a configuration with other users, copy an XML configuration file to the folder. + \sa {Run QML files}, {Use external text editors}, {Use Qt Linguist} +*/ + +/*! + \page creator-how-to-use-qtlinguist.html + \if defined(qtdesignstudio) + \previouspage creator-editor-external.html + \else + \previouspage creator-how-tos.html + \endif + + \ingroup creator-how-to-use + + \title Use Qt Linguist + + When you \l{Creating Projects}{create a new project}, you can automatically + generate a translation source file (TS) for one language. You can add other + languages later by editing the project file. + + To open TS files in Qt Linguist, right-click a TS file in the + \uicontrol Projects or \uicontrol {File System} view and select + \uicontrol {Open With} > \uicontrol {Qt Linguist} in the context menu. + For more information about Qt Linguist, see \l{Qt Linguist Manual}. + + \section1 Use lupdate and lrelease + + You can use the Qt Linguist release manager tools, lupdate and lrelease, + directly from \QC. The lupdate tool synchronizes source + code and translations. The lrelease tool creates run-time + translation files for use by the released application. + + \note Running the tools from \QC is supported only when using qmake as the + build system. For more information about using the tools with CMake, see + \l{https://doc.qt.io/qt-6/cmake-command-reference.html#qt6-linguisttools} + {Qt6::LinguistTools}. + + By default, the project .pro file is passed to the tools as an argument. To + specify other command line arguments for the tools, select \uicontrol Tools > + \uicontrol External > \uicontrol Configure. + + \section2 Synchronize TS files + + To synchronize TS files from a translator with the + application code, select \uicontrol Tools > \uicontrol External > + \uicontrol Linguist > \uicontrol {Update Translations (lupdate)}. + + \section2 Generate QM files + + To generate from the TS files Qt message (QM) files that can be used by an + application, select \uicontrol Tools > \uicontrol External > + \uicontrol Linguist > \uicontrol {Release Translations (lrelease)}. + + \sa {Use external tools} +*/ + +/*! + \page creator-how-to-run-qml-files.html + \if defined(qtdesignstudio) + \previouspage creator-editor-external.html + \else + \previouspage creator-how-tos.html + \endif + + \ingroup creator-how-to-design + + \title Run QML files + + You can test the current QML document while you are developing an application. + + To run the currently active QML file, select \uicontrol Tools > + \uicontrol External > \uicontrol {Qt Quick} > \uicontrol {QML Runtime}. + + \sa {Use external tools} +*/ + +/*! + \page creator-how-to-use-external-text-editors.html + \if defined(qtdesignstudio) + \previouspage creator-editor-external.html + \else + \previouspage creator-how-tos.html + \endif + + \ingroup creator-how-to-use + + \title Use external text editors + + You can open files for editing in the default text editor for your system: + Notepad on Windows and vi on Linux and \macos. + To open the file you are currently viewing in an external editor, select + \uicontrol Tools > \uicontrol External > \uicontrol Text > + \uicontrol {Edit with Notepad} or \uicontrol {Edit with vi}, depending on + your system. + + \QC looks for the editor path in the PATH environment variable + of your operating system. + + \sa {Use external tools} */ diff --git a/doc/qtcreator/src/howto/creator-help.qdoc b/doc/qtcreator/src/howto/creator-help.qdoc index 7bdea9afacf..09899d2c45c 100644 --- a/doc/qtcreator/src/howto/creator-help.qdoc +++ b/doc/qtcreator/src/howto/creator-help.qdoc @@ -7,11 +7,12 @@ \previouspage studio-help.html \nextpage studio-faq.html \else - \previouspage creator-help-overview.html - \nextpage creator-faq.html + \previouspage creator-how-tos.html \endif - \title Using the Help Mode + \ingroup creator-how-to-use + + \title Get help \QC comes fully integrated with Qt documentation and examples using the Qt Help plugin. @@ -172,11 +173,18 @@ Punctuation is not included in indexed terms. To find terms that have punctuation, such as domain names, use the asterisk as a wild card. For example, to find \c {Pastebin.Com}, enter the search term \c {Pastebin*}. +*/ - \section1 Adding External Documentation +/*! + \page creator-how-to-add-external-documentation.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-use + + \title Adding External Documentation You can display external documentation in the \uicontrol Help mode. - To augment or replace the documentation that ships with \QC and Qt: + To add documentation or replace the documentation that ships with \QC and Qt: \list 1 @@ -190,6 +198,8 @@ \endlist + \sa + \section1 Detaching the Help Window By default, context-sensitive help is opened in a window next to the diff --git a/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc b/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc index 3c21196793f..beee519bc8a 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc @@ -17,8 +17,9 @@ \brief Options for starting \QC from the command line. - To specify command line options, enter the following command in the \QC - installation or build directory: + To specify command line options, enter the following command in the + directory that contains the \QC executable or specify the path to + \QC as a part of the command: \badcode qtcreator [option] [filename[:line_number[:column_number]]] diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 94d7618e6e3..a118873714a 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -27,6 +27,7 @@ \li \l {Set high DPI scaling} \li \l {Set the number of recent files shown} \li \l {Show and hide sidebars} + \li \l {Show task list files in Issues} \li \l {Switch between modes} \li \l {Switch UI themes} \li \l {View output} @@ -54,6 +55,7 @@ \list \li \l {Export SVG images} + \li \l {Run QML files} \li \l {View images} \endlist @@ -78,10 +80,16 @@ \section1 Use \QC \list + \li \l {Collect usage statistics} \li \l {Enable and disable plugins} \li \l {Find settings files} + \li \l {Inspect internal logs} \li \l {Install plugins} + \li \l {Manage data collection} \li \l {Run \QC from the command line} + \li \l {Use external text editors} + \li \l {Use external tools} + \li \l {Use Qt Linguist} \endlist */ @@ -149,14 +157,55 @@ \title Run \QC from the command line - You can launch \QC from the command line using the name of an - existing \l{Managing Sessions}{session} or project file by entering - the name as the command argument. + You can start \QC and specify some options from the command line. For + example, you can open a file to any line and column. - For example, running \c {qtcreator somesession}, launches \QC and - loads the session called \e somesession. + To use command line options, enter the following command in the + directory that contains the \QC executable or specify the path to + \QC as a part of the command: - For more information, see \l{Using Command Line Options}. + \badcode + qtcreator [option] [filename[:line_number[:column_number]]] + \endcode + + \note You can use either a colon (:) or a plus sign (+) as a separator + between the filename and line number and the line number and the column + number. You can also use a space between the separator and the line number. + + \section1 Examples of CLI commands + + On Windows: + + \list + + \li \c {C:\qtcreator\bin>qtcreator -help} + + \li \c {C:\qtcreator\bin>qtcreator C:\TextFinder\textfinder.cpp:100:2} + + \li \c {C:\qtcreator\bin>qtcreator C:\TextFinder\textfinder.cpp +100+2} + + \endlist + + On \macos: + + \list + + \li \c {Qt\ Creator.app/Contents/MacOS/Qt\ Creator -help} + + \endlist + + \section1 Open a project from a directory + + To open a project that is located in a particular directory, you can + pass on the directory name as a command line argument. \QC looks for + a \l{Managing Sessions}{session} that matches the directory name and + loads it. Or it looks for a project file in the directory and opens it. + + For example, on Windows: + + \c {C:\qtcreator\bin>qtcreator.exe C:\Examples\alarms} + + \sa {Command Line Options} */ /*! diff --git a/doc/qtcreator/src/howto/creator-only/creator-logging-viewer.qdoc b/doc/qtcreator/src/howto/creator-only/creator-logging-viewer.qdoc index 38e4b92d1ce..75ec01e5e56 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-logging-viewer.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-logging-viewer.qdoc @@ -1,12 +1,13 @@ -// Copyright (C) 2022 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 creator-logging-viewer.html - \previouspage creator-task-lists.html - \nextpage creator-telemetry.html + \previouspage creator-how-tos.html - \title Inspecting Internal Logs + \ingroup creator-how-to-use + + \title Inspect internal logs You can inspect internal log messages of \QC at runtime without having to restart it or configure the logging rules. Log messages are helpful when @@ -25,7 +26,7 @@ \note Messages are not cached, so the viewer displays only messages that are recorded after you enabled a category. - \section1 Viewing Logs + \section1 View logs To enable logging categories, select them in \uicontrol Category. \uicontrol Type specifies the minimum level of messages to display from diff --git a/doc/qtcreator/src/howto/creator-only/creator-task-lists.qdoc b/doc/qtcreator/src/howto/creator-only/creator-task-lists.qdoc index 4cc7ecda418..e540a62c3f1 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-task-lists.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-task-lists.qdoc @@ -1,4 +1,4 @@ -// 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 // ********************************************************************** @@ -8,11 +8,12 @@ // ********************************************************************** /*! - \previouspage creator-editor-external.html \page creator-task-lists.html - \nextpage creator-logging-viewer.html + \previouspage creator-how-tos.html - \title Showing Task List Files in Issues + \ingroup creator-how-to-ui + + \title Show task list files in issues You can use code scanning and analysis tools to examine source code. These tools report issues for you to fix. \QC enables you to load lists of @@ -25,7 +26,7 @@ lines of code and matches them against regular expressions to generate a task list, see \c{scripts\mytasks.pl} in the \QC repository. - \section1 Managing Task List Entries + \section1 Manage task list entries To open task list files in \uicontrol Issues, choose \uicontrol File > \uicontrol Open. Right-click a task list entry to open a context menu that @@ -36,7 +37,7 @@ To keep the current entries in a task list, but stop checking for changes, select \uicontrol {Stop Monitoring}. - \section1 Task List File Format + \section1 Task list file format The filename extension must be .tasks for \QC to recognize a file as a task list file. @@ -79,4 +80,6 @@ If the file path is given as a relative path, it is based on the parent directory of the task list file. + + \sa {Issues}, {View output} */ diff --git a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc index 28c431d397a..39719a26a04 100644 --- a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc +++ b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc @@ -2,13 +2,15 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-help.html \page creator-faq.html - \nextpage creator-how-tos.html + \previouspage creator-reference.html + + \ingroup creator-reference \title FAQ - This section has answers to some frequently asked questions about \QC. + \brief Answers to some frequently asked questions about \QC. + You might also find answers to your questions in the \l{Known Issues} and \l{How-to} sections, or the Troubleshooting sections for a special area, such as diff --git a/doc/qtcreator/src/howto/creator-telemetry.qdoc b/doc/qtcreator/src/howto/creator-telemetry.qdoc index 959887080c4..de7c887583e 100644 --- a/doc/qtcreator/src/howto/creator-telemetry.qdoc +++ b/doc/qtcreator/src/howto/creator-telemetry.qdoc @@ -1,16 +1,18 @@ -// Copyright (C) 2021 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 creator-telemetry.html \if defined(qtdesignstudio) \previouspage creator-quick-ui-forms.html - \else - \previouspage creator-logging-viewer.html - \endif \nextpage collecting-usage-statistics.html + \else + \previouspage creator-how-tos.html + \endif - \title Managing Data Collection + \ingroup creator-how-to-use + + \title Manage data collection \if defined (qtcreator) When you install \QC as a part of Qt installation, you are asked whether @@ -24,8 +26,8 @@ mode for data collection to begin. - See \l {Collecting Usage Statistics} for more information about the data - transmitted by the telemetry plugin and \l {Specifying Telemetry Settings} + See \l {Collect usage statistics} for more information about the data + transmitted by the telemetry plugin and \l {Specify telemetry settings} {specifying telemetry settings}. \else To enable the use of the telemetry plugin, you need to select \uicontrol @@ -40,13 +42,13 @@ See below for more information about the collected data: \list - \li \l {Collecting Usage Statistics} + \li \l {Collect usage statistics} \li \l {Collecting User Feedback} \li \l {Reporting Crashes} \endlist \endif - \section1 Principles of Data Collection + \section1 Principles of data collection No personal data, such as names, IP addresses, MAC addresses, or project and path names are collected. However, QUuid objects are used to identify @@ -56,18 +58,22 @@ For more information about Qt privacy policy, select \l{https://www.qt.io/terms-conditions/#privacy} {Legal Notice and Privacy Policy}. + + \sa {Collect usage statistics} */ /*! \page collecting-usage-statistics.html - \previouspage creator-telemetry.html \if defined(qtdesignstudio) + \previouspage creator-telemetry.html \nextpage studio-user-feedback.html \else - \nextpage creator-help-overview.html + \previouspage creator-how-tos.html \endif - \title Collecting Usage Statistics + \ingroup creator-how-to-use + + \title Collect usage statistics The telemetry plugin uses the \l{https://api.kde.org/frameworks/kuserfeedback/html/index.html} @@ -79,7 +85,7 @@ connection. The storage is located in the same Heroku backend as the Qt installer backend. Physically, data is stored in the Amazon cloud. - \section1 Specifying Telemetry Settings + \section1 Specify telemetry settings To determine what data is transmitted to the backend storage: @@ -93,4 +99,6 @@ exactly what data is collected. Deselect check boxes for data that you do not want to transmit to the backend storage. \endlist + + \sa {Manage data collection} */ diff --git a/doc/qtcreator/src/overview/creator-acknowledgements.qdoc b/doc/qtcreator/src/overview/creator-acknowledgements.qdoc index 7f607374759..a5e2feb5efb 100644 --- a/doc/qtcreator/src/overview/creator-acknowledgements.qdoc +++ b/doc/qtcreator/src/overview/creator-acknowledgements.qdoc @@ -9,10 +9,18 @@ /*! \page creator-acknowledgements.html + \if defined(qtdesignstudio) \previouspage technical-support.html + \else + \previouspage creator-reference.html + \endif + + \ingroup creator-reference \title Acknowledgements + \brief Third-party components in \QC. + \section1 Credits We would like to thank our contributors, who are listed in the \QC change diff --git a/doc/qtcreator/src/overview/creator-only/creator-glossary.qdoc b/doc/qtcreator/src/overview/creator-only/creator-glossary.qdoc index c6cc117b1b0..ebc66b84236 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-glossary.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-glossary.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,12 +8,15 @@ // ********************************************************************** /*! - \previouspage creator-known-issues.html \page creator-glossary.html - \nextpage technical-support.html + \previouspage creator-reference.html + + \ingroup creator-reference \title Glossary + \brief \QC terms and concepts. + \table \header \li Term diff --git a/doc/qtcreator/src/overview/creator-only/creator-help-overview.qdoc b/doc/qtcreator/src/overview/creator-only/creator-help-overview.qdoc deleted file mode 100644 index bf792f5564d..00000000000 --- a/doc/qtcreator/src/overview/creator-only/creator-help-overview.qdoc +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -// ********************************************************************** -// NOTE: the sections are not ordered by their logical order to avoid -// reshuffling the file each time the index order changes (i.e., often). -// Run the fixnavi.pl script to adjust the links to the index order. -// ********************************************************************** - -/*! - \page creator-help-overview.html - \previouspage collecting-usage-statistics.html - \nextpage creator-help.html - - \title Getting Help - - \image front-help.png - - \list - - \li \l{Using the Help Mode} - - \QC comes fully integrated with Qt documentation and examples using - the Qt Help plugin. You can add external documentation to the - \uicontrol Help mode and filter the documents displayed to find relevant - information faster. In addition, you can add bookmarks to help - pages. - - \li \l{FAQ} - - Has answers to some frequently asked questions about \QC. - - \li \l{How-to} - - Lists useful \QC features. - - \li \l{Reference} - - Lists the sidebar views and the output views. - - \li \l{Known Issues} - - Lists known issues in \QC version \qtcversion. The development team - is aware of them, and therefore, you do not need to report them as - bugs. - - \li \l{Glossary} - - Lists special terms used in \QC. - - \endlist - - \section1 Related Topics - - \list - - \li \l{Technical Support} - - Lists Qt support sites and other useful sites. - - \li \l{Acknowledgements} - - Lists the third-party components in \QC. - - \endlist - -*/ diff --git a/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc b/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc index c52d8005e13..d67cf95a819 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc @@ -26,6 +26,4 @@ \section1 Output Views \annotatedlist creator-reference-output-views - - \sa {User Interface}, {Show and hide sidebars}, {View output} */ diff --git a/doc/qtcreator/src/overview/creator-tech-support.qdoc b/doc/qtcreator/src/overview/creator-tech-support.qdoc index af87b414bcc..aacee5595f1 100644 --- a/doc/qtcreator/src/overview/creator-tech-support.qdoc +++ b/doc/qtcreator/src/overview/creator-tech-support.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -11,13 +11,18 @@ \page technical-support.html \if defined(qtdesignstudio) \previouspage studio-platforms.html - \else - \previouspage creator-glossary.html - \endif \nextpage creator-acknowledgements.html + \else + \previouspage creator-reference.html + + \endif + + \ingroup creator-reference \title Technical Support + \brief Qt support sites and other useful sites. + The following table lists Qt support sites and other useful links. diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index a254c2fabc2..92633b77f06 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -197,84 +197,86 @@ \li \l{Running Autotests} \li \l{Using Squish} \endlist - \li \l{Getting Help} + \li \l{How-to} \list - \li \l{Using the Help Mode} - \li \l{FAQ} - \li \l{How-to} + \li Use the UI \list - \li Use the UI - \list - \li \l {Assign keyboard shortcuts} - \li \l {Find a particular preference} - \li \l {Find keyboard shortcuts} - \li \l {Find menu items on \macos} - \li \l {Import and export keyboard shortcuts} - \li \l {Set high DPI scaling} - \li \l {Set the number of recent files shown} - \li \l {Show and hide sidebars} - \li \l {Switch between modes} - \li \l {Switch UI themes} - \li \l {View output} - \endlist - \li Edit Code - \list - \li \l {Add code snippets to the auto-complete menu} - \li \l {Enclose selected code in curly braces, parentheses, or double quotes} - \li \l {Jump to a function in QML code} - \li \l {Locate files using the keyboard} - \li \l {Move between open files} - \li \l {Move to symbols} - \li \l {Paste text from clipboard history} - \li \l {Perform calculations} - \li \l {Search and replace across files using a regular expression} - \li \l {Select the enclosing block in C++} - \li \l {Sort lines alphabetically} - \li \l {Switch to Edit mode} - \li \l {Write down notes} - \endlist - \li Design UIs - \list - \li \l {Export SVG images} - \li \l {View images} - \endlist - \li Manage Projects - \list - \li \l {Add a license header template for C++ code} - \li \l {Add libraries to projects} - \li \l {Add subprojects to projects} - \li \l {Add wizards} - \li \l {Create C++ classes} - \li \l {Create files} - \li \l {Create OpenGL fragment and vertex shaders} - \li \l {Create resource files} - \li \l {Develop Qt for Python applications} - \li \l {Open projects} - \li \l {Select the build system} - \li \l {Specify project contents} - \li \l {Use project wizards} - \endlist - \li Use \QC - \list - \li \l {Collect usage statistics} - \li \l {Enable and disable plugins} - \li \l {Find settings files} - \li \l {Inspect internal logs} - \li \l {Install plugins} - \li \l {Manage data collection} - \li \l {Run \QC from the command line} - \li \l {Use external text editors} - \li \l {Use external tools} - \li \l {Use Qt Linguist} - \endlist + \li \l {Assign keyboard shortcuts} + \li \l {Find a particular preference} + \li \l {Find keyboard shortcuts} + \li \l {Find menu items on \macos} + \li \l {Import and export keyboard shortcuts} + \li \l {Set high DPI scaling} + \li \l {Set the number of recent files shown} + \li \l {Show and hide sidebars} + \li \l {Show task list files in Issues} + \li \l {Switch between modes} + \li \l {Switch UI themes} + \li \l {View output} + \endlist + \li Edit Code + \list + \li \l {Add code snippets to the auto-complete menu} + \li \l {Enclose selected code in curly braces, parentheses, or double quotes} + \li \l {Get help} + \li \l {Jump to a function in QML code} + \li \l {Locate files using the keyboard} + \li \l {Move between open files} + \li \l {Move to symbols} + \li \l {Paste text from clipboard history} + \li \l {Perform calculations} + \li \l {Search and replace across files using a regular expression} + \li \l {Select the enclosing block in C++} + \li \l {Sort lines alphabetically} + \li \l {Switch to Edit mode} + \li \l {Write down notes} + \endlist + \li Design UIs + \list + \li \l {Export SVG images} + \li \l {Run QML files} + \li \l {View images} + \endlist + \li Manage Projects + \list + \li \l {Add a license header template for C++ code} + \li \l {Add libraries to projects} + \li \l {Add subprojects to projects} + \li \l {Add wizards} + \li \l {Create C++ classes} + \li \l {Create files} + \li \l {Create OpenGL fragment and vertex shaders} + \li \l {Create resource files} + \li \l {Develop Qt for Python applications} + \li \l {Open projects} + \li \l {Select the build system} + \li \l {Specify project contents} + \li \l {Use project wizards} + \endlist + \li Use \QC + \list + \li \l {Collect usage statistics} + \li \l {Enable and disable plugins} + \li \l {Find settings files} + \li \l {Inspect internal logs} + \li \l {Install plugins} + \li \l {Manage data collection} + \li \l {Run \QC from the command line} + \li \l {Use external text editors} + \li \l {Use external tools} + \li \l {Use Qt Linguist} \endlist - \li \l{Known Issues} - \li \l{Glossary} - \li \l{Technical Support} - \li \l{Acknowledgements} \endlist \li \l{Reference} \list + \li \l {Acknowledgements} + \li \l {Command Line Options} + \li \l {Custom Wizards} + \li \l {FAQ} + \li \l {Glossary} + \li \l {Keyboard Shortcuts} + \li \l {Known Issues} + \li \l {Technical Support} \li \l {Build Systems} \list \li \l{Managing Packages with vcpkg} @@ -287,15 +289,14 @@ \li \l{Setting Up a Generic Project} \li \l{Setting Up an Autotools Project} \endlist - \li \l {Command Line Options} - \li \l {Custom Wizards} - \li \l {Keyboard Shortcuts} - \li \l {Supported Platforms} + \li Output Views \list - \li \l {Desktop Platforms} - \li \l {Embedded Platforms} - \li \l {Mobile Platforms} - \endlist + \li \l {Application Output} + \li \l {Compile Output} + \li \l {Issues} + \li \l {Search Results} + \li \l {To-Do Entries} + \endlist \li Sidebar Views \list \li \l {Call Hierarchy} @@ -307,13 +308,11 @@ \li \l {Projects} \li \l {Type Hierarchy} \endlist - \li Output Views + \li \l {Supported Platforms} \list - \li \l {Application Output} - \li \l {Compile Output} - \li \l {Issues} - \li \l {Search Results} - \li \l {To-Do Entries} + \li \l {Desktop Platforms} + \li \l {Embedded Platforms} + \li \l {Mobile Platforms} \endlist \endlist \endlist diff --git a/doc/qtcreator/src/user-interface/creator-only/creator-reference-to-do-entries-view.qdoc b/doc/qtcreator/src/user-interface/creator-only/creator-reference-to-do-entries-view.qdoc index fb1b40f2633..da32faf7bf0 100644 --- a/doc/qtcreator/src/user-interface/creator-only/creator-reference-to-do-entries-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-only/creator-reference-to-do-entries-view.qdoc @@ -19,7 +19,7 @@ You can also open task list files generated by code scanning and analysis tools in \l Issues. For more information, see - \l{Showing Task List Files in Issues}. + \l{Show task list files in Issues}. \section1 Enabling the To-Do Plugin diff --git a/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc b/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc index dc7700eef87..c3da47296ce 100644 --- a/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc +++ b/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc @@ -60,6 +60,11 @@ the issues from the previous build rounds, deselect \uicontrol Edit > \uicontrol Preferences > \uicontrol {Build & Run} > \uicontrol General > \uicontrol {Clear issues list on new build}. + + \sa {View output} + \if defined(qtcreator) + \sa {Show task list files in Issues} + \endif */ /*! @@ -90,6 +95,8 @@ For more information about the different search options, see \l {Finding and Replacing}. + + \sa {View output} */ /*! @@ -137,6 +144,8 @@ You can select whether to open \uicontrol{Application Output} on output when running or debugging applications, to clear old output on a new run, to word-wrap output, and to limit output to the specified number of lines. + + \sa {View output} */ /*! @@ -215,4 +224,6 @@ the new output to the old output. \li Select \uicontrol OK to start parsing. \endlist + + \sa {View output} */ diff --git a/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc b/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc index d7cdd609455..5d2164693e9 100644 --- a/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc +++ b/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc @@ -67,7 +67,7 @@ \image qtcreator-new-qt-gui-application-translationfile.png {Translation File dialog} \li In the \uicontrol Language field, you can select a language that you - plan to \l {Using Qt Linguist}{translate} the application to. This + plan to \l {Use Qt Linguist}{translate} the application to. This sets up localization support for the application. You can add other languages later by editing the project file. diff --git a/doc/qtcreatordev/src/qtcreator-dev.qdoc b/doc/qtcreatordev/src/qtcreator-dev.qdoc index 554d5dbb19a..f6f4c68ceec 100644 --- a/doc/qtcreatordev/src/qtcreator-dev.qdoc +++ b/doc/qtcreatordev/src/qtcreator-dev.qdoc @@ -156,7 +156,7 @@ \list \li \l{https://doc.qt.io/qtcreator/creator-editor-external.html} - {Using External Tools} + {Use external tools} \li \l{External Tool Specification Files} \endlist @@ -180,7 +180,7 @@ configure the tool in \QC, you can add an options page for it. \list - \li \l{https://doc.qt.io/qtcreator/creator-editor-external.html}{Using External Tools} + \li \l{https://doc.qt.io/qtcreator/creator-editor-external.html}{Use external tools} \li \l{External Tool Specification Files} \li \l{Creating Plugins} \li \l{Qt Creator Coding Rules} @@ -206,7 +206,7 @@ \list \li \l{https://doc.qt.io/qtcreator/creator-task-lists.html} - {Showing Task List Files in Issues} + {Show task list files in Issues} \li \l{Creating Plugins} \li \l{Qt Creator Coding Rules} \omit diff --git a/doc/qtdesignstudio/src/qtdesignstudio-advanced.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-advanced.qdoc index fbc362f6c8c..7c11a4a7800 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-advanced.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-advanced.qdoc @@ -23,7 +23,7 @@ Some of the wizard templates create projects that contain UI files. You should always edit UI files in the \l {2D} and \l Properties view, to avoid breaking the code. - \li \l{Managing Data Collection} + \li \l{Manage Data Collection} You can enable \QDS to report crashes automatically. If you enable the telemetry plugin, you can turn on the pseudonymous user diff --git a/doc/qtdesignstudio/src/qtdesignstudio-developer-topics.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-developer-topics.qdoc index da1799439a4..7a96a9a41e4 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-developer-topics.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-developer-topics.qdoc @@ -29,7 +29,7 @@ application development in Qt Creator, you have to convert them to Qt Quick Application projects that contain .pro, .cpp, and .qrc files. - \li \l{Using External Tools} + \li \l{Use external tools} You can use external tools directly from \QDS. Qt Linguist, QML utilities, the default text editor for your system, and the diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index cee8f1fe7ad..15085023586 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -238,9 +238,9 @@ \li Extending Component Functionality \endomit \li \l{UI Files} - \li \l{Managing Data Collection} + \li \l{Manage Data Collection} \list - \li \l {Collecting Usage Statistics} + \li \l {Collect Usage Statistics} \li \l {Collecting User Feedback} \li \l {Reporting Crashes} \endlist @@ -251,7 +251,7 @@ \li \l{Using Git} \li \l{Converting Qt 5 Projects into Qt 6 Projects} \li \l{Converting UI Projects to Applications} - \li \l{Using External Tools} + \li \l{Use external tools} \li \l{\QDS on MCUs} \list \li \l {\QDS Version Compatibility with \QMCU SDKs} diff --git a/doc/qtdesignstudio/src/qtdesignstudio.qdoc b/doc/qtdesignstudio/src/qtdesignstudio.qdoc index 94ad24b6cc5..cb1309610cf 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio.qdoc @@ -72,7 +72,7 @@ \li \b {\l{Advanced Designer Topics}} \list \li \l{UI Files} - \li \l {Managing Data Collection} + \li \l {Manage Data Collection} \li \l{Packaging Applications} \endlist \li \b {\l{Developer Topics}} @@ -80,7 +80,7 @@ \li \l{Using Git} \li \l{Converting Qt 5 Projects into Qt 6 Projects} \li \l{Converting UI Projects to Applications} - \li \l{Using External Tools} + \li \l{Use external tools} \li \l{\QDS on MCUs} \endlist \li \b {\l Help} From 097cb17af4a527c907bcf3981dd91465b64cbe4e Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 5 Sep 2023 16:28:35 +0200 Subject: [PATCH 1076/1777] Doc: Replace "Getting Help" with "How To" Move the topics to either "How To: Read Qt documentation" or "Reference", depending on their type. Task-number: QTCREATORBUG-29361 Change-Id: Ifa46192f7a15a71e8d3454010f6b96764776f82b Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io> --- doc/qtcreator/config/style/qt5-sidebar.html | 36 ++-- ...reator-preferences-help-documentation.webp | Bin 0 -> 5020 bytes .../images/qtcreator-sidebar-help-mode.webp | Bin 0 -> 10770 bytes .../creator-only/creator-clang-codemodel.qdoc | 2 +- .../creator-only/creator-language-server.qdoc | 2 +- doc/qtcreator/src/howto/creator-help.qdoc | 194 ++++++++++++++---- .../creator-how-to-enable-plugins.qdoc | 2 +- .../creator-how-to-install-plugins.qdoc | 2 +- .../howto/creator-only/creator-how-tos.qdoc | 59 +++--- .../src/howto/creator-only/qtcreator-faq.qdoc | 4 +- .../src/meson/creator-projects-meson.qdoc | 2 +- .../creator-projects-creating.qdoc | 2 +- .../creator-projects-settings-editor.qdoc | 2 +- doc/qtcreator/src/qtcreator-toc.qdoc | 54 +++-- doc/qtcreator/src/qtcreator.qdoc | 13 +- .../creator-how-to-switch-between-modes.qdoc | 2 +- .../src/user-interface/creator-ui.qdoc | 2 +- .../src/qtcreator-documentation.qdoc | 2 +- .../src/qtdesignstudio-faq.qdoc | 4 +- .../src/qtdesignstudio-help-overview.qdoc | 4 +- .../src/qtdesignstudio-toc.qdoc | 12 +- doc/qtdesignstudio/src/qtdesignstudio.qdoc | 4 +- 22 files changed, 281 insertions(+), 123 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-preferences-help-documentation.webp create mode 100644 doc/qtcreator/images/qtcreator-sidebar-help-mode.webp diff --git a/doc/qtcreator/config/style/qt5-sidebar.html b/doc/qtcreator/config/style/qt5-sidebar.html index 9f272e3a7a8..2a260ed7340 100644 --- a/doc/qtcreator/config/style/qt5-sidebar.html +++ b/doc/qtcreator/config/style/qt5-sidebar.html @@ -81,31 +81,33 @@ </div> <div class="sectionlist normallist"> <div class="heading"> - <h2>Advanced Use</h2> + <h2>How To</h2> </div> <ul> - <li><a href="creator-os-supported-platforms.html">Supported Platforms</a></li> - <li><a href="creator-project-other.html">Build Systems</a></li> - <li><a href="creator-cli.html">Using Command Line Options</a></li> - <li><a href="creator-keyboard-shortcuts.html">Keyboard Shortcuts</a></li> - <li><a href="creator-editor-external.html">Using External Tools</a></li> - <li><a href="creator-task-lists.html">Showing Task List Files in Issues</a></li> - <li><a href="creator-logging-viewer.html">Inspecting Internal Logs</a></li> - <li><a href="creator-telemetry.html">Managing Data Collection</a></li> + <li><a href="creator-how-tos.html#design-uis">Design UIs</a></li> + <li><a href="creator-how-tos.html#edit-code">Edit Code</a></li> + <li><a href="creator-how-tos.html#manage-projects">Manage Projects</a></li> + <li><a href="creator-how-tos.html#read-qt-documentation">Read Qt Documentation</a></li> + <li><a href="creator-how-tos.html#use-qt-creator">Use Qt Creator</a></li> + <li><a href="creator-how-tos.html#use-the-ui">Use the UI</a></li> + <li><a href="creator-how-tos.html">See All</a></li> </ul> </div> <div class="sectionlist normallist"> <div class="heading"> - <h2>Getting Help</h2> + <h2>Reference</h2> </div> <ul> - <li><a href="creator-help.html">Using the Help Mode</a></li> - <li><a href="creator-faq.html">FAQ</a></li> - <li><a href="creator-how-tos.html">How-to</a></li> - <li><a href="creator-reference.html">Reference</a></li> - <li><a href="creator-known-issues.html">Known Issues</a></li> - <li><a href="creator-glossary.html">Glossary</a></li> - <li><a href="technical-support.html">Technical Support</a></li> <li><a href="creator-acknowledgements.html">Acknowledgements</a></li> + <li><a href="creator-project-other.html">Build Systems</a></li> + <li><a href="creator-cli.html">Command Line Options</a></li> + <li><a href="creator-project-wizards.html">Custom Wizards</a></li> + <li><a href="creator-faq.html">FAQ</a></li> + <li><a href="creator-glossary.html">Glossary</a></li> + <li><a href="creator-keyboard-shortcuts.html">Keyboard Shortcuts</a></li> + <li><a href="creator-known-issues.html">Known Issues</a></li> + <li><a href="creator-os-supported-platforms.html">Supported Platforms</a></li> + <li><a href="technical-support.html">Technical Support</a></li> + <li><a href="creator-reference.html">See All</a></li> </ul> </div> diff --git a/doc/qtcreator/images/qtcreator-preferences-help-documentation.webp b/doc/qtcreator/images/qtcreator-preferences-help-documentation.webp new file mode 100644 index 0000000000000000000000000000000000000000..8e33837f4ef88d580e67a3637b791478b11cf13a GIT binary patch literal 5020 zcmWIYbaR^`%)k)t>J$(bVBymt%)p@kv(cMDDf<2YwUch|nQr8N>P+~{Rm<)gsHX+w zS-x(1uUuJtHsLw%47K+U_bi?F{QrOZ^k+8d=RUV&&TXm{z2Td9>Q3INZO%{4Hax!I z_tRzOq@`<@UY)jg($YZ99zNp=+0e(``>$$$iISRXIH$sS@q+VN?vbsYO-tU^KYF6_ z&Or6+p?fQL?_U06jTi4}My*8Ynt5lsQs17J{ddP>)0W&U(YxK&e|GG47I&ZYAaCNa zNXxS;Pl>(VkZbdD^P#k5t1s<r`>DV3|0adoe7BzM(UcWwk8^NrDOcU_TU_x$nT_Mh zs<yS2E8lpnpLKcnvnr)?tEzUb{rS-=b;azDEY4pam#>!F8TTm7=7-DDUxl|tLr;rc zJMA>h{n6LZ-8(mR%Kh1J?t_W<<EDu(mlm(iJGOj&R&LD=uY-}*)oSNfm81&STK#5O z8kPLx%c9PoLh6Oac7I-;y1n=C+o|hv7V+2ra_miPXDd%;&wqGM?N;LRvokKOel>;7 z_xzE$vx9=9Ql`0ZPu$70V)qx`BJPs-ye#XxbIY&E%yfSk>)Cn4qx18XOOM{w3NcT+ z;`sK;vV|ueHMy+zaokgJ;L?Pd;q&uL%I`&f{^3z={6g`YTu#P~1)|fobnL!zZi~Y-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z_BI@bC* zD4+M#dheSLZ?uTqDvnqa)2m&P6;LO;#OnPQaqsCLt}OWT>j}3&7T4A083}w`A#L}> zvL7!0+I@!crQ`|0$iED0xIQpW@IT1TDt_^n>Pg??mI@;~kddDI7+k8uZ057gUC6&d zCq18ay{$vj$>k4}?{UPX@h6HYn)7a$QIQ=`XZwlO;>Pt&<~8osY%*Ghv{sl(ZNIIz zUsn9%61{ViXS3Nz&fm`V^tx2MgN}kH$1URrK7ySB?6-RE#}_^}P_qiGzmuo(;N*`z zrW*V0elk5d{=K2)3y(#xOY^LGQ#7K3I~ek%R8~oVZ1VlY>aoD+i^MJC2Ofe=G0FvD z7c5*it@?2Chh3Ks>x&Nyx2$xCu3?npT|bj+%Te(M7eCBc>0n&Tm?)8VaFM=(>bX|l zyW#;Nr+Dv*Z|I(ocxfNQ&jo+f-f~aiKa~&Ru)XD;F!{8^Zv6zWduwVLH#z>?{^qXu zgN%T>=5MSg*q@qb#y8Xi)H%Q3F5f1(86s2~?~rW7<9k<p!l~AUp1+x%G=G|1y1(}1 zf<Mv!9&-QqsCL-I@8ogg<cJi$54X2!ubO?>zvM@B*$u-Zw>PopUq83q-gxd@)%niL z?mv8z#8Y_n<T{zIXCH)Lr1QTD{=T>U)WkEH#sN-pd&E@oC$fbW|LFYu+3l-*Jj2XR zN28PS|C0omME;*C5mL8%!ad<d>&hPtQ_pfZaa>xE#b;mmNO~W`^M-v_HP0<%V{O!G zTV?s@$WKk7-;?zlPVHX&Yl6^QXEkY|1Jm5E%G5pj^JK=~lj03ilxIp#tWdI3m+iPT zf2JSP-z_U@kBd8Gf63yrZ>)2=WA}i&gZ2DA_1{N+3dw(9J<`<og!|9u$vL-mcsotv V6F&Xl&#v}=zvafI|95yB0|02Zro{jN literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-sidebar-help-mode.webp b/doc/qtcreator/images/qtcreator-sidebar-help-mode.webp new file mode 100644 index 0000000000000000000000000000000000000000..0dc99612e8ae6291e11ee13f465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qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc index 6e1adfcc3e8..a0b5a416980 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc @@ -33,7 +33,7 @@ \li Diagnostics - \li \l{Viewing Function Tooltips}{Tooltips} + \li \l{View function tooltips}{Tooltips} \li \l{Finding Symbols}{Finding and renaming symbols} diff --git a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc index 33a14ee3be2..b11860155d5 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc @@ -21,7 +21,7 @@ \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Behavior \li Highlighting the symbol under cursor - \li \l{Viewing Function Tooltips}{Viewing function tooltips} + \li \l{View function tooltips} \li \l{Semantic Highlighting}{Semantic highlighting}, as defined in \l{https://github.com/microsoft/vscode-languageserver-node/pull/367} {Proposal of the semantic highlighting protocol extension} diff --git a/doc/qtcreator/src/howto/creator-help.qdoc b/doc/qtcreator/src/howto/creator-help.qdoc index 09899d2c45c..0b7610f1c9d 100644 --- a/doc/qtcreator/src/howto/creator-help.qdoc +++ b/doc/qtcreator/src/howto/creator-help.qdoc @@ -1,8 +1,8 @@ -// Copyright (C) 2021 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 creator-help.html + \page creator-how-to-get-help.html \if defined(qtdesignstudio) \previouspage studio-help.html \nextpage studio-faq.html @@ -10,7 +10,7 @@ \previouspage creator-how-tos.html \endif - \ingroup creator-how-to-use + \ingroup creator-how-to-get-help \title Get help @@ -19,7 +19,7 @@ \list - \li To view documentation, switch to \uicontrol Help mode. + \li To view documentation, switch to the \uicontrol Help mode. \li To view context sensitive help on a Qt class or function as a tooltip, move the mouse cursor over the class or function. If help @@ -42,29 +42,35 @@ The following image displays the context sensitive help in the \uicontrol Edit mode. - \image qtcreator-context-sensitive-help.png "Context-sensitive help in Edit mode" + \image qtcreator-context-sensitive-help.png {Context-sensitive help in Edit mode} + + \section1 Change the font If the help HTML file does not use a style sheet, you can change the font family, style, and size in \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > \uicontrol General. - \image qtcreator-help-options.png "General tab in Help preferences" + \image qtcreator-help-options.png {General tab in Help preferences} You can set the default zoom level in the \uicontrol Zoom field. When viewing help pages, you can use the mouse scroll wheel to zoom them. To disable this feature, deselect the \uicontrol {Enable scroll wheel zooming} check box. + \section1 Return to the editor + To switch to the editor context when you close the last help page, select the \uicontrol {Return to editor on closing the last page} check box. + \section1 Select help viewer backend + The help viewer backend determines the style sheet that is used to display the help files. The default help viewer backend that is based on litehtml is recommended for viewing Qt documentation. You can choose another help viewer backend in the \uicontrol {Viewer backend} field. To take the new backend to use, reload the help page. - \section1 Viewing Function Tooltips + \section1 View function tooltips To hide function tooltips by default, select \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Behavior > @@ -75,7 +81,25 @@ To use a keyboard shortcut for viewing help tooltips, select \uicontrol {Show help tooltips using keyboard shortcut (Alt)}. - \section1 Finding Information in Qt Documentation + \sa {Find information in Qt documentation}, {Filter documentation}, + {Search from documentation} + + \sa {Add external documentation}, {Detach the help window}, + {Filter documentation}, {Find information in Qt documentation}, + {Select the help start page} +*/ + +/*! + \page creator-how-to-find-info-in-documentation.html + \if defined(qtdesignstudio) + \previouspage creator-how-to-get-help.html + \else + \previouspage creator-how-tos.html + \endif + + \ingroup creator-how-to-get-help + + \title Find information in Qt documentation \QC, \QSDK and other Qt deliverables have documentation as .qch files. All the documentation is accessible in the \uicontrol Help mode. @@ -86,7 +110,13 @@ \uicontrol Kits > \uicontrol {Qt Versions} > \uicontrol {Register documentation}. - To find information in the documentation, select: + \image qtcreator-qt-versions.png {Register documentation field in Qt Versions tab in Kit Preferences} + + \section1 Help mode sidebar views + + \image qtcreator-sidebar-help-mode.webp {Sidebar views in the Help mode} + + To find information in the documentation in the \uicontrol Help mode, select: \list @@ -106,14 +136,27 @@ \endlist - \section2 Adding Bookmarks to Help Pages + \sa {Add bookmarks to help pages}, {Search from documentation} +*/ + +/*! + \page creator-how-to-add-bookmarks-to-help-pages.html + \if defined(qtdesignstudio) + \previouspage creator-how-to-get-help.html + \else + \previouspage creator-how-tos.html + \endif + + \ingroup creator-how-to-get-help + + \title Add bookmarks to help pages You can add bookmarks to useful help pages to easily find them later in the \uicontrol Bookmarks view. You can either use the page title as the bookmark or change it to any text. You can organize the bookmarks in folders in the view. - \image qtcreator-help-add-bookmark-dlg.png "Add Bookmark dialog" + \image qtcreator-help-add-bookmark-dlg.png {Add Bookmark dialog} To add a bookmark to an open help page: @@ -127,13 +170,29 @@ \endlist + \section1 Import and export bookmarks + To import and export bookmarks, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > \uicontrol General > \uicontrol {Import Bookmarks} or \uicontrol {Export Bookmarks}. - \section2 Full-text Search + \sa {Find information in Qt documentation} +*/ - In the \uicontrol Search pane, you can use full-text search for finding a +/*! + \page creator-how-to-search-from-docs.html + \if defined(qtdesignstudio) + \previouspage creator-how-to-get-help.html + \else + \previouspage creator-how-tos.html + \endif + + \ingroup creator-how-to-get-help + + \title Search from documentation + + In the \uicontrol Help mode \uicontrol Search pane, you can use full-text + search for finding a particular word in all the installed documents. Enter the term you are looking for, and select the \uicontrol Search button. All documents that have the specified term are listed. The list is sorted by document @@ -141,7 +200,7 @@ the number of search hits that the documents have. Select a document in the list to open it. - \image qtcreator-help-search.png "Search pane" + \image qtcreator-help-search.png {Help mode Search pane} The following are examples of common search patterns: @@ -173,15 +232,21 @@ Punctuation is not included in indexed terms. To find terms that have punctuation, such as domain names, use the asterisk as a wild card. For example, to find \c {Pastebin.Com}, enter the search term \c {Pastebin*}. + + \sa {Find information in Qt documentation} */ /*! \page creator-how-to-add-external-documentation.html + \if defined(qtdesignstudio) + \previouspage creator-how-to-get-help.html + \else \previouspage creator-how-tos.html + \endif - \ingroup creator-how-to-use + \ingroup creator-how-to-get-help - \title Adding External Documentation + \title Add external documentation You can display external documentation in the \uicontrol Help mode. To add documentation or replace the documentation that ships with \QC and Qt: @@ -196,51 +261,102 @@ \li To add the .qch file to \QC, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > \uicontrol Documentation > \uicontrol Add. + \image qtcreator-preferences-help-documentation.webp {Documentation tab in Help Preferences} + \endlist - \sa + \sa {Get help} +*/ - \section1 Detaching the Help Window +/*! + \page creator-how-to-detach-help-window.html + \if defined(qtdesignstudio) + \previouspage creator-how-to-get-help.html + \else + \previouspage creator-how-tos.html + \endif + + \ingroup creator-how-to-get-help + + \title Detach the help window By default, context-sensitive help is opened in a window next to the code editor when you press \key F1. If there is not enough vertical space, the help opens in the full-screen help mode. - You can specify that the help always opens in full-screen mode or - is detached to an external window. Select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Help > \uicontrol General and specify - settings for displaying context-sensitive help + \image qtcreator-context-sensitive-help.png {Context-sensitive help in Edit mode} + + To specify that the help always opens in full-screen mode or + is detached to an external window, select \uicontrol Edit > + \uicontrol Preferences > \uicontrol Help > \uicontrol General. + + \image qtcreator-help-options.png {General tab in Help preferences} + + Set preferences for displaying context-sensitive help in the \uicontrol {On context help} field. To detach the help window, select \uicontrol {Always Show in External Window}. To change this setting in a help view, select the \inlineimage icons/linkicon.png toolbar button. - \section1 Selecting the Start Page + \sa {Get help} +*/ + +/*! + \page creator-how-to-set-help-start-page.html + \if defined(qtdesignstudio) + \previouspage creator-how-to-get-help.html + \else + \previouspage creator-how-tos.html + \endif + + \ingroup creator-how-to-get-help + + \title Select the help start page You can select the page to display when you open the \uicontrol Help mode in the \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > \uicontrol General > \uicontrol {On help start} field. - To display the page and help views that were open when you exited the mode, - select the \uicontrol {Show My Tabs from Last Session} option. However, Web pages - are not opened because loading them would slow down opening the \uicontrol Help - mode. - To display a particular page, select \uicontrol {Show My Home Page}, and specify - the page in the \uicontrol {Home Page} field. + \image qtcreator-help-options.png {General tab in Help preferences} - To display a blank page, select the \uicontrol {Show a Blank Page} option. You can - also select the \uicontrol {Use Blank Page} button to set a blank page as your - home page. + \list + \li To display the page and help views that were open when you exited the mode, + select the \uicontrol {Show My Tabs from Last Session} option. However, Web pages + are not opened because loading them would slow down opening the \uicontrol Help + mode. - \section1 Using Documentation Filters + \li To display a particular page, select \uicontrol {Show My Home Page}, and specify + the page in the \uicontrol {Home Page} field. + + \li To display a blank page, select the \uicontrol {Show a Blank Page} option. You can + also select the \uicontrol {Use Blank Page} button to set a blank page as your + home page. + \endlist + + \sa {Get help} +*/ + +/*! + \page creator-how-to-filter-documentation.html + \if defined(qtdesignstudio) + \previouspage creator-how-to-get-help.html + \else + \previouspage creator-how-tos.html + \endif + + \ingroup creator-how-to-get-help + + \title Filter documentation You can filter the documents displayed in the \uicontrol Help mode to find - relevant information faster. Select a filter from a list of filters (1). The + relevant information faster. Select a filter from a list of filters. The contents of the \uicontrol Index and \uicontrol Contents view in the sidebar change accordingly. - \image qtcreator-help-filters.png "Filters field on the Help mode toolbar" + \image qtcreator-help-filters.png {Filters field on the Help mode toolbar} + + \section1 Add filters You can define your own filters to display documentation for a set of Qt modules and versions. @@ -252,7 +368,7 @@ \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > \uicontrol Filters. - \image qtcreator-help-filter-attributes.png "Filters tab in Help preferences" + \image qtcreator-help-filter-attributes.png {Filters tab in Help preferences} \li Select \inlineimage icons/plus.png to add a new filter in the \uicontrol {Add Filter} dialog. @@ -274,11 +390,17 @@ \endlist + \section1 Change filters + To modify the selected filter, add and remove Qt modules and versions, and then select \uicontrol Apply. To rename the selected filter, select \uicontrol Rename. + \section1 Remove filters + To remove the selected filter select \inlineimage icons/minus.png . + + \sa {Get help} */ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-to-enable-plugins.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-to-enable-plugins.qdoc index 6cf11eff11f..e631c568311 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-to-enable-plugins.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-to-enable-plugins.qdoc @@ -34,5 +34,5 @@ take effect. \endlist - \sa {Install plugins}{How-to: Install plugins} + \sa {Install plugins}{How To: Install plugins} */ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-to-install-plugins.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-to-install-plugins.qdoc index 711e036c519..2f14eb42262 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-to-install-plugins.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-to-install-plugins.qdoc @@ -39,5 +39,5 @@ \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. \endlist - \sa {Enable and disable plugins}{How-to: Enable and disable plugins} + \sa {Enable and disable plugins}{How To: Enable and disable plugins} */ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index a118873714a..c41d32b07cc 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -12,25 +12,16 @@ \page creator-how-tos.html \nextpage creator-reference.html - \title How-to + \title How To The following topics describe how to use \QC to perform a particular task. - \section1 Use the UI + \section1 Design UIs - \list - \li \l {Assign keyboard shortcuts} - \li \l {Find a particular preference} - \li \l {Find keyboard shortcuts} - \li \l {Find menu items on \macos} - \li \l {Import and export keyboard shortcuts} - \li \l {Set high DPI scaling} - \li \l {Set the number of recent files shown} - \li \l {Show and hide sidebars} - \li \l {Show task list files in Issues} - \li \l {Switch between modes} - \li \l {Switch UI themes} - \li \l {View output} + \list + \li \l {Export SVG images} + \li \l {Run QML files} + \li \l {View images} \endlist \section1 Edit Code @@ -51,14 +42,6 @@ \li \l {Write down notes} \endlist - \section1 Design UIs - - \list - \li \l {Export SVG images} - \li \l {Run QML files} - \li \l {View images} - \endlist - \section1 Manage Projects \list @@ -77,6 +60,19 @@ \li \l {Use project wizards} \endlist + \section1 Read Qt Documentation + + \list + \li \l {Add bookmarks to help pages} + \li \l {Add external documentation} + \li \l {Detach the help window} + \li \l {Filter documentation} + \li \l {Find information in Qt documentation} + \li \l {Get help} + \li \l {Search from documentation} + \li \l {Select the help start page} + \endlist + \section1 Use \QC \list @@ -91,6 +87,23 @@ \li \l {Use external tools} \li \l {Use Qt Linguist} \endlist + + \section1 Use the UI + + \list + \li \l {Assign keyboard shortcuts} + \li \l {Find a particular preference} + \li \l {Find keyboard shortcuts} + \li \l {Find menu items on \macos} + \li \l {Import and export keyboard shortcuts} + \li \l {Set high DPI scaling} + \li \l {Set the number of recent files shown} + \li \l {Show and hide sidebars} + \li \l {Show task list files in Issues} + \li \l {Switch between modes} + \li \l {Switch UI themes} + \li \l {View output} + \endlist */ /*! diff --git a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc index 39719a26a04..67a5ba9bbbb 100644 --- a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc +++ b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc @@ -12,7 +12,7 @@ \brief Answers to some frequently asked questions about \QC. You might also find answers to your questions in the - \l{Known Issues} and \l{How-to} sections, or the Troubleshooting + \l{Known Issues} and \l{How To} sections, or the Troubleshooting sections for a special area, such as \l{Troubleshooting Debugger}{debugging}. @@ -155,7 +155,7 @@ To view the documentation that is available and to add documentation, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > \uicontrol Documentation. For more information, see - \l{Adding External Documentation}. + \l{Add external documentation}. \section1 Debugger Questions diff --git a/doc/qtcreator/src/meson/creator-projects-meson.qdoc b/doc/qtcreator/src/meson/creator-projects-meson.qdoc index 2ba20f55a93..3e46abc5ed4 100644 --- a/doc/qtcreator/src/meson/creator-projects-meson.qdoc +++ b/doc/qtcreator/src/meson/creator-projects-meson.qdoc @@ -24,7 +24,7 @@ in different build and run \l{glossary-buildandrun-kit}{kits}. \note Meson build plugin is disabled by default, see - \l{Enable and disable plugins}{How-to: Enable and disable plugins}. + \l{Enable and disable plugins}{How To: Enable and disable plugins}. \section1 Adding Meson Tools diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index aaf659a9c46..f28b573ce7a 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -69,7 +69,7 @@ install and configure some additional software on the devices to be able to \l{Connecting Devices}{connect} to them from the development PC. - \sa {Manage Projects}{How-to: Manage Projects}, {Custom Wizards} + \sa {Manage Projects}{How To: Manage Projects}, {Custom Wizards} */ /*! diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc index e97ceeb098d..3f146ca9c01 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc @@ -56,7 +56,7 @@ \li \l{Highlighting and Folding Blocks} - \li \l{Viewing Function Tooltips} + \li \l{View function tooltips} \endlist diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 92633b77f06..2691d207520 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -10,7 +10,7 @@ in the \QC Manual. Use your browser's page search to find a link to a particular topic in the list. For a more extensive search, use the \uicontrol Search function in the \l{https://doc.qt.io/qtcreator/} - {Qt documentation} portal or in the \l {Using the Help Mode}{Help} mode. + {Qt documentation} portal or in the \l {Get help}{Help} mode. \list \li \l{Getting Started} @@ -197,28 +197,18 @@ \li \l{Running Autotests} \li \l{Using Squish} \endlist - \li \l{How-to} + \li \l{How To} \list - \li Use the UI + \li Design UIs \list - \li \l {Assign keyboard shortcuts} - \li \l {Find a particular preference} - \li \l {Find keyboard shortcuts} - \li \l {Find menu items on \macos} - \li \l {Import and export keyboard shortcuts} - \li \l {Set high DPI scaling} - \li \l {Set the number of recent files shown} - \li \l {Show and hide sidebars} - \li \l {Show task list files in Issues} - \li \l {Switch between modes} - \li \l {Switch UI themes} - \li \l {View output} + \li \l {Export SVG images} + \li \l {Run QML files} + \li \l {View images} \endlist \li Edit Code \list \li \l {Add code snippets to the auto-complete menu} \li \l {Enclose selected code in curly braces, parentheses, or double quotes} - \li \l {Get help} \li \l {Jump to a function in QML code} \li \l {Locate files using the keyboard} \li \l {Move between open files} @@ -231,12 +221,6 @@ \li \l {Switch to Edit mode} \li \l {Write down notes} \endlist - \li Design UIs - \list - \li \l {Export SVG images} - \li \l {Run QML files} - \li \l {View images} - \endlist \li Manage Projects \list \li \l {Add a license header template for C++ code} @@ -253,6 +237,17 @@ \li \l {Specify project contents} \li \l {Use project wizards} \endlist + \li {Read Qt Documentation} + \list + \li \l {Add bookmarks to help pages} + \li \l {Add external documentation} + \li \l {Detach the help window} + \li \l {Filter documentation} + \li \l {Find information in Qt documentation} + \li \l {Get help} + \li \l {Search from documentation} + \li \l {Select the help start page} + \endlist \li Use \QC \list \li \l {Collect usage statistics} @@ -266,6 +261,21 @@ \li \l {Use external tools} \li \l {Use Qt Linguist} \endlist + \li Use the UI + \list + \li \l {Assign keyboard shortcuts} + \li \l {Find a particular preference} + \li \l {Find keyboard shortcuts} + \li \l {Find menu items on \macos} + \li \l {Import and export keyboard shortcuts} + \li \l {Set high DPI scaling} + \li \l {Set the number of recent files shown} + \li \l {Show and hide sidebars} + \li \l {Show task list files in Issues} + \li \l {Switch between modes} + \li \l {Switch UI themes} + \li \l {View output} + \endlist \endlist \li \l{Reference} \list diff --git a/doc/qtcreator/src/qtcreator.qdoc b/doc/qtcreator/src/qtcreator.qdoc index 472cec65b59..146ee348462 100644 --- a/doc/qtcreator/src/qtcreator.qdoc +++ b/doc/qtcreator/src/qtcreator.qdoc @@ -91,13 +91,14 @@ \li \l{Running Autotests} \li \l{Using Squish} \endlist - \li \b {\l{Getting Help}} + \li \b {\l{How To}} \list - \li \l{Using the Help Mode} - \li \l{FAQ} - \li \l{How-to} - \li \l{Known Issues} - \li \l{Glossary} + \li \l{Design UIs} + \li \l{Edit Code} + \li \l{Manage Projects} + \li \l{Read Qt Documentation} + \li \l{Use \QC} + \li \l{Use the UI} \endlist \li \b {\l{Reference}} \list diff --git a/doc/qtcreator/src/user-interface/creator-only/creator-how-to-switch-between-modes.qdoc b/doc/qtcreator/src/user-interface/creator-only/creator-how-to-switch-between-modes.qdoc index fb023f1f3c1..a2f5646ef71 100644 --- a/doc/qtcreator/src/user-interface/creator-only/creator-how-to-switch-between-modes.qdoc +++ b/doc/qtcreator/src/user-interface/creator-only/creator-how-to-switch-between-modes.qdoc @@ -60,7 +60,7 @@ \li \uicontrol Help \li \key Ctrl+6 \li Read documentation. - \li \l{Using the Help Mode} + \li \l{Get help} \endtable Some actions in \QC trigger a mode change. For example, diff --git a/doc/qtcreator/src/user-interface/creator-ui.qdoc b/doc/qtcreator/src/user-interface/creator-ui.qdoc index 220d9af132a..5a9e5b1629f 100644 --- a/doc/qtcreator/src/user-interface/creator-ui.qdoc +++ b/doc/qtcreator/src/user-interface/creator-ui.qdoc @@ -76,7 +76,7 @@ For information about new features and bug fixes in each \QC release, select \uicontrol Help > \uicontrol {Change Log}. - \sa {Use the UI}{How-to: Use the UI}, {Reference} + \sa {Use the UI}{How To: Use the UI}, {Reference} \else diff --git a/doc/qtcreatordev/src/qtcreator-documentation.qdoc b/doc/qtcreatordev/src/qtcreator-documentation.qdoc index 58ccbb3c88e..8b9e3bbacca 100644 --- a/doc/qtcreatordev/src/qtcreator-documentation.qdoc +++ b/doc/qtcreatordev/src/qtcreator-documentation.qdoc @@ -622,7 +622,7 @@ the \QC \uicontrol Help mode. For more information about adding the help files to \QC, see \l{http://doc.qt.io/qtcreator/creator-help.html#adding-external-documentation} - {Adding External Documentation}. + {Add external documentation}. \section2 Additional Build Commands diff --git a/doc/qtdesignstudio/src/qtdesignstudio-faq.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-faq.qdoc index c7815bd349a..f7dec4de039 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-faq.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-faq.qdoc @@ -2,7 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-help.html + \previouspage creator-how-to-get-help.html \page studio-faq.html \nextpage studio-platforms.html @@ -11,7 +11,7 @@ This section contains answers to some frequently asked questions about \QDS grouped by categories. You might also find answers to your questions in the product documentation by searching or browsing the index in the - \l{Using the Help Mode}{Help mode}. Many questions are also answered by the + \l{Get help}{Help mode}. Many questions are also answered by the \l{Examples}{examples} and \l{Tutorials}{video tutorials}. \list diff --git a/doc/qtdesignstudio/src/qtdesignstudio-help-overview.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-help-overview.qdoc index 578129024a9..74c84952b63 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-help-overview.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-help-overview.qdoc @@ -4,7 +4,7 @@ /*! \page studio-help.html \previouspage studio-features-on-mcu-projects.html - \nextpage creator-help.html + \nextpage creator-how-to-get-help.html \title Help @@ -17,7 +17,7 @@ \list - \li \l{Using the Help Mode} + \li \l{Get help} \QDS comes fully integrated with documentation. You can use search and index functions to find particular topics in the helps, or diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index 15085023586..6b691c459c5 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -260,7 +260,17 @@ \endlist \li \l Help \list - \li \l{Using the Help Mode} + \li \l{Get help} + \list + \li \l {Add bookmarks to help pages} + \li \l {Add external documentation} + \li \l {Detach the help window} + \li \l {Filter documentation} + \li \l {Find information in Qt documentation} + \li \l {Get help} + \li \l {Search from documentation} + \li \l {Select the help start page} + \endlist \li \l{Frequently Asked Questions} \li \l{Supported Platforms} \endlist diff --git a/doc/qtdesignstudio/src/qtdesignstudio.qdoc b/doc/qtdesignstudio/src/qtdesignstudio.qdoc index cb1309610cf..600bc9427a2 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio.qdoc @@ -80,12 +80,12 @@ \li \l{Using Git} \li \l{Converting Qt 5 Projects into Qt 6 Projects} \li \l{Converting UI Projects to Applications} - \li \l{Use external tools} + \li \l{Use external tools}{Using External Tools} \li \l{\QDS on MCUs} \endlist \li \b {\l Help} \list - \li \l{Using the Help Mode} + \li \l{Get help}{Getting Help} \li \l{Frequently Asked Questions} \li \l{Supported Platforms} \endlist From 2d9aa27b612c9027fd31e83d9b0906a7c635fcef Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Thu, 7 Sep 2023 16:56:25 +0200 Subject: [PATCH 1077/1777] Doc: Chop up the "Using Version Control Systems" topic Turn the topic into Reference and How-to topics. Task-number: QTCREATORBUG-29361 Change-Id: I2fd4050f712b61b3e4140a5bf93e968c02b36d36 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- .../howto/creator-only/creator-how-tos.qdoc | 3 + .../creator-only/creator-configuring.qdoc | 2 +- .../creator-only/creator-reference.qdoc | 8 +- .../creator-projects-creating.qdoc | 2 +- .../creator-projects-overview.qdoc | 2 +- doc/qtcreator/src/qtcreator-toc.qdoc | 27 ++--- doc/qtcreator/src/qtcreator.qdoc | 2 +- .../vcs/creator-only/creator-vcs-bazaar.qdoc | 14 ++- .../creator-only/creator-vcs-clearcase.qdoc | 14 ++- .../src/vcs/creator-only/creator-vcs-cvs.qdoc | 14 ++- .../vcs/creator-only/creator-vcs-fossil.qdoc | 14 ++- .../vcs/creator-only/creator-vcs-gitlab.qdoc | 16 ++- .../creator-only/creator-vcs-mercurial.qdoc | 15 ++- .../creator-only/creator-vcs-perforce.qdoc | 14 ++- ...s.qdocinc => creator-vcs-preferences.qdoc} | 10 +- .../creator-only/creator-vcs-subversion.qdoc | 14 ++- .../src/vcs/creator-only/creator-vcs.qdoc | 100 +++++++++++------- doc/qtcreator/src/vcs/creator-vcs-git.qdoc | 21 ++-- 18 files changed, 185 insertions(+), 107 deletions(-) rename doc/qtcreator/src/vcs/creator-only/{creator-vcs-options.qdocinc => creator-vcs-preferences.qdoc} (93%) diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index c41d32b07cc..62fb4bd94d4 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -53,6 +53,7 @@ \li \l {Create files} \li \l {Create OpenGL fragment and vertex shaders} \li \l {Create resource files} + \li \l {Create VCS repositories for new projects} \li \l {Develop Qt for Python applications} \li \l {Open projects} \li \l {Specify project contents} @@ -83,6 +84,8 @@ \li \l {Install plugins} \li \l {Manage data collection} \li \l {Run \QC from the command line} + \li \l {Set up version control systems} + \li \l {Use common VCS functions} \li \l {Use external text editors} \li \l {Use external tools} \li \l {Use Qt Linguist} diff --git a/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc b/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc index 95906339121..62140a8733a 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc @@ -137,7 +137,7 @@ \uicontrol General. For more information about the supported functions, see - \l{Using Version Control Systems}. + \l{Version Control Systems}. \section1 Managing Plugins diff --git a/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc b/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc index d67cf95a819..dddfcd9840c 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc @@ -19,11 +19,11 @@ \annotatedlist creator-reference-build-systems - \section1 Sidebar Views - - \annotatedlist creator-reference-sidebar-views - \section1 Output Views \annotatedlist creator-reference-output-views + + \section1 Sidebar Views + + \annotatedlist creator-reference-sidebar-views */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index f28b573ce7a..6832d044804 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -135,7 +135,7 @@ {Nim or Nimble} applications (experimental) \row \li Imported project - \li Import projects from a supported \l{Using Version Control Systems} + \li Import projects from a supported \l{Version Control Systems} {version control system}, such as Bazaar, CVS, Git, Mercurial, or Subversion. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-overview.qdoc index fb09cb1da62..ce94263b593 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-overview.qdoc @@ -30,7 +30,7 @@ language to implement the application logic: C++, JavaScript, or Python. - \li \l{Using Version Control Systems} + \li \l{Version Control Systems} The recommended way to set up a project is to use a version control system. Store and edit only project source files and configuration diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 2691d207520..e8334febf7b 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -24,18 +24,6 @@ \li \l{Managing Projects} \list \li \l{Creating Projects} - \li \l{Using Version Control Systems} - \list - \li \l{Using Bazaar} - \li \l{Using ClearCase} - \li \l{Using CVS} - \li \l{Using Fossil} - \li \l{Using Git} - \li \l{Using GitLab} - \li \l{Using Mercurial} - \li \l{Using Perforce} - \li \l{Using Subversion} - \endlist \li \l{Configuring Projects} \list \li \l{Adding Kits} @@ -231,6 +219,7 @@ \li \l {Create files} \li \l {Create OpenGL fragment and vertex shaders} \li \l {Create resource files} + \li \l {Create VCS repositories for new projects} \li \l {Develop Qt for Python applications} \li \l {Open projects} \li \l {Select the build system} @@ -257,6 +246,8 @@ \li \l {Install plugins} \li \l {Manage data collection} \li \l {Run \QC from the command line} + \li \l {Set up version control systems} + \li \l {Use common VCS functions} \li \l {Use external text editors} \li \l {Use external tools} \li \l {Use Qt Linguist} @@ -324,6 +315,18 @@ \li \l {Embedded Platforms} \li \l {Mobile Platforms} \endlist + \li \l{Version Control Systems} + \list + \li \l {Bazaar} + \li \l {ClearCase} + \li \l {CVS} + \li \l {Fossil} + \li \l {Git} + \li \l {GitLab} + \li \l {Mercurial} + \li \l {Perforce} + \li \l {Subversion} + \endlist \endlist \endlist */ diff --git a/doc/qtcreator/src/qtcreator.qdoc b/doc/qtcreator/src/qtcreator.qdoc index 146ee348462..482e310443b 100644 --- a/doc/qtcreator/src/qtcreator.qdoc +++ b/doc/qtcreator/src/qtcreator.qdoc @@ -51,7 +51,7 @@ \li \b {\l{Managing Projects}} \list \li \l{Creating Projects} - \li \l{Using Version Control Systems} + \li \l{Version Control Systems} \li \l{Configuring Projects} \li \l{Managing Sessions} \endlist diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-bazaar.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-bazaar.qdoc index bc2eda804ba..435585171a8 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-bazaar.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-bazaar.qdoc @@ -8,16 +8,19 @@ // ********************************************************************** /*! - \previouspage creator-version-control.html \page creator-vcs-bazaar.html - \nextpage creator-vcs-clearcase.html + \previouspage creator-reference.html - \title Using Bazaar + \ingroup creator-reference-vcs + + \title Bazaar + + \brief Additional Bazaar functions. Bazaar is a free version control system sponsored by Canonical. In addition to the standard version control system functions described in - \l {Using Common Functions}, you can select \uicontrol Tools > + \l {Use common VCS Functions}, you can select \uicontrol Tools > \uicontrol Bazaar > \uicontrol Pull to turn a branch into a mirror of another branch. To update the mirror of the branch, select \uicontrol Push. @@ -58,4 +61,7 @@ have. \li \uicontrol Timeout sets a timeout for version control operations. \endlist + + \sa {Set up version control systems}, {Use common VCS functions}, + {Version Control Systems} */ diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-clearcase.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-clearcase.qdoc index dfed2c5ba68..8ada90c1193 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-clearcase.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-clearcase.qdoc @@ -8,11 +8,14 @@ // ********************************************************************** /*! - \previouspage creator-vcs-bazaar.html \page creator-vcs-clearcase.html - \nextpage creator-vcs-cvs.html + \previouspage creator-reference.html - \title Using ClearCase + \ingroup creator-reference-vcs + + \title ClearCase + + \brief Additional ClearCase functions. IBM Rational ClearCase is a version control, workspace management, parallel development support, and build automation solution developed by IBM. Use the @@ -44,7 +47,7 @@ \section1 Checking out and Checking in In addition to the standard version control system functions described in - \l {Using Common Functions}, you can check out and check in files. + \l {Use common VCS Functions}, you can check out and check in files. To create a writable copy of a file, select \uicontrol Tools > \uicontrol ClearCase > \uicontrol {Check Out}. If you check out files in a @@ -92,4 +95,7 @@ Specify the number of event records to show in \uicontrol {History count}. Set a timeout for version control operations in \uicontrol Timeout. + + \sa {Set up version control systems}, {Use common VCS functions}, + {Version Control Systems} */ diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-cvs.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-cvs.qdoc index 440b8846933..7c33b1ddf9d 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-cvs.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-cvs.qdoc @@ -8,16 +8,19 @@ // ********************************************************************** /*! - \previouspage creator-vcs-clearcase.html \page creator-vcs-cvs.html - \nextpage creator-vcs-fossil.html + \previouspage creator-reference.html - \title Using CVS + \ingroup creator-reference-vcs + + \title CVS + + \brief Additional CVS functions. CVS is an open source version control system. In addition to the standard version control system functions described in - \l {Using Common Functions}, you can select \uicontrol Tools > + \l {Use common VCS Functions}, you can select \uicontrol Tools > \uicontrol CVS > \uicontrol Edit to set a file as writable, notify watchers that the file is being edited, and watch for actions performed on the file by other users. @@ -45,4 +48,7 @@ \li \uicontrol {Describe all files matching commit id} annotates all files that belong to the commit. \endlist + + \sa {Set up version control systems}, {Use common VCS functions}, + {Version Control Systems} */ diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-fossil.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-fossil.qdoc index f3ce2565461..0927a4cd077 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-fossil.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-fossil.qdoc @@ -3,10 +3,13 @@ /*! \page creator-vcs-fossil.html - \previouspage creator-vcs-cvs.html - \nextpage creator-vcs-git.html + \previouspage creator-reference.html - \title Using Fossil + \ingroup creator-reference-vcs + + \title Fossil + + \brief Additional Fossil functions. Fossil is an open source distributed version control system, designed and developed by the creator of SQLite. A stand-alone Fossil executable @@ -44,7 +47,7 @@ \section1 Additional Fossil Functions In addition to the standard version control system functions described in - \l {Using Version Control Systems}, the \uicontrol Fossil submenu has + \l {Version Control Systems}, the \uicontrol Fossil submenu has the following items: \table @@ -89,4 +92,7 @@ a commit or update and automatic push after a commit or tag or branch creation. \endlist + + \sa {Set up version control systems}, {Use common VCS functions}, + {Version Control Systems} */ diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc index 8ac5052826f..2efdb151dda 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc @@ -1,15 +1,18 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-vcs-git.html \page creator-vcs-gitlab.html - \nextpage creator-vcs-mercurial.html + \previouspage creator-reference.html - \title Using GitLab + \ingroup creator-reference-vcs + + \title GitLab + + \brief Additional GitLab functions. GitLab is a DevOps tool developed by GitLab. You can clone projects from - GitLab servers and use \l{Using Git}{Git} to manage your local and remote + GitLab servers and use \l{Git} to manage your local and remote repositories. To enable the experimental GitLab plugin, select \uicontrol Help > @@ -121,4 +124,7 @@ To stop the reception of event notifications, select \uicontrol {Unlink from GitLab}. + + \sa {Set up version control systems}, {Use common VCS functions}, + {Version Control Systems}, {Git} */ diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-mercurial.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-mercurial.qdoc index 1380761f79c..a0a89b8fd75 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-mercurial.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-mercurial.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2018 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,16 +8,19 @@ // ********************************************************************** /*! - \previouspage creator-vcs-gitlab.html \page creator-vcs-mercurial.html - \nextpage creator-vcs-perforce.html + \previouspage creator-reference.html - \title Using Mercurial + \ingroup creator-reference-vcs + + \title Mercurial + + \brief Additional Mercurial functions. Mercurial is a free, distributed source control management tool. In addition to the standard version control system functions described in - \l {Using Common Functions}, you can select the following functions in the + \l {Use common VCS Functions}, you can select the following functions in the \uicontrol Tools > \uicontrol Mercurial submenu: \table @@ -61,4 +64,6 @@ \li \uicontrol Timeout sets a timeout for version control operations. \endlist + \sa {Set up version control systems}, {Use common VCS functions}, + {Version Control Systems} */ diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc index 1ef25bc7f9a..0179b295b28 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc @@ -8,11 +8,14 @@ // ********************************************************************** /*! - \previouspage creator-vcs-mercurial.html \page creator-vcs-perforce.html - \nextpage creator-vcs-subversion.html + \previouspage creator-reference.html - \title Using Perforce + \ingroup creator-reference-vcs + + \title Perforce + + \brief Additional Perforce functions. Perforce is a fast software configuration management system developed by Perforce Software. @@ -49,7 +52,7 @@ \section1 Editing Files In addition to the standard version control system functions described in - \l {Using Common Functions}, you can select \uicontrol Tools > + \l {Use common VCS Functions}, you can select \uicontrol Tools > \uicontrol Perforce > \uicontrol {Edit File} to open a file for editing within the client workspace. By default, files are automatically opened for editing. To disable this feature, select \uicontrol Edit > @@ -65,4 +68,7 @@ To view information about change lists and the files in them, select \uicontrol Tools > \uicontrol Perforce > \uicontrol Describe. + + \sa {Set up version control systems}, {Use common VCS functions}, + {Version Control Systems} */ diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-options.qdocinc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-preferences.qdoc similarity index 93% rename from doc/qtcreator/src/vcs/creator-only/creator-vcs-options.qdocinc rename to doc/qtcreator/src/vcs/creator-only/creator-vcs-preferences.qdoc index 98276ab9bba..898a9bebaf7 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-options.qdocinc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-preferences.qdoc @@ -2,10 +2,12 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! + \page creator-how-to-set-up-vcs.html + \previouspage creator-how-tos.html -//! [vcs options] + \ingroup creator-how-to-use - \section1 Setting Up Version Control Systems + \title Set up version control systems \QC uses the version control system's command line clients to access your repositories. Make sure that the command line clients are in the \c{PATH} @@ -23,7 +25,7 @@ For more information on using Git for Windows, see \l {Using Git for Windows}. - \section1 Setting Up General Options + \section1 General VCS preferences Select \uicontrol Edit > \uicontrol Preferences > \uicontrol {Version Control} > \uicontrol General to specify settings for submit messages: @@ -72,5 +74,5 @@ from the command line, for example. \endlist -//! [vcs options] + \sa {Version Control Systems} */ diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-subversion.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-subversion.qdoc index 32ebbcff706..30aafae0d8b 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-subversion.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-subversion.qdoc @@ -8,16 +8,19 @@ // ********************************************************************** /*! - \previouspage creator-vcs-perforce.html \page creator-vcs-subversion.html - \nextpage creator-configuring-projects.html + \previouspage creator-reference.html - \title Using Subversion + \ingroup creator-reference-vcs + + \title Subversion + + \brief Additional Subversion functions. Subversion is an open source version control system. In addition to the standard version control system functions described in - \l {Using Common Functions}, you can select \uicontrol Tools > + \l {Use common VCS Functions}, you can select \uicontrol Tools > \uicontrol Subversion > \uicontrol Describe to display commit log messages for a revision. @@ -44,4 +47,7 @@ \li \uicontrol {Ignore whitespace changes in annotation} hides whitespace changes in annotation views. \endlist + + \sa {Set up version control systems}, {Use common VCS functions}, + {Version Control Systems} */ diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc index ce4dce91095..c9442420080 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,24 +8,32 @@ // ********************************************************************** /*! - \previouspage creator-project-wizards.html \page creator-version-control.html - \nextpage creator-vcs-bazaar.html + \previouspage creator-reference.html - \title Using Version Control Systems + \ingroup creator-reference - Version control systems supported by \QC are: + \title Version Control Systems + + \brief Version control systems that you can use from \QC. + + The recommended way to set up a project is to use a + \e {version control system}. Store and edit only project source files and + configuration files. Do not store generated files. To use version control + systems from \QC, you need to set them up. + + \QC integrates the following version control systems: \table \header \li Version Control System \li Address \li Notes \row - \li \l{Using Bazaar}{Bazaar} + \li \l{Bazaar} \li \l{http://bazaar.canonical.com/} \li \row - \li \l{Using ClearCase}{ClearCase} + \li \l{ClearCase} \li \l{http://www-01.ibm.com/software/awdtools/clearcase/} \li Disabled by default. To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} > @@ -33,31 +41,31 @@ Then select \uicontrol {Restart Now} to restart \QC and load the plugin. \row - \li \l{Using CVS}{CVS} + \li \l{CVS} \li \l{http://www.nongnu.org/cvs/} \li \row - \li \l{Using Fossil}{Fossil} + \li \l{Fossil} \li \l{https://fossil-scm.org/index.html/doc/trunk/www/index.wiki} \li Disabled by default. To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol {Version Control} > \uicontrol Fossil. \row - \li \l{Using Git}{Git} + \li \l{Git} \li \l{http://git-scm.com/} \li Git version 1.9.0, or later Gerrit version 2.6, or later \row - \li \l{Using GitLab}{GitLab} + \li \l{GitLab} \li \l{http://gitlab.com/} \li Experimental \row - \li \l{Using Mercurial}{Mercurial} + \li \l{Mercurial} \li \l{http://mercurial.selenic.com/} \li \row - \li \l{Using Perforce}{Perforce} + \li \l{Perforce} \li \l{http://www.perforce.com} \li Server version 2006.1 and later @@ -65,14 +73,22 @@ \uicontrol Help > \uicontrol {About Plugins} > \uicontrol {Version Control} > \uicontrol Perforce. \row - \li \l{Using Subversion}{Subversion} + \li \l{Subversion} \li \l{http://subversion.apache.org/} \li Subversion version 1.7.0 and later \endtable - \include creator-vcs-options.qdocinc vcs options + \sa {Create VCS repositories for new projects}, + {Set up version control systems}, {Use common VCS functions} +*/ - \section1 Creating VCS Repositories for New Projects +/*! + \page creator-how-to-create-vcs-repositories.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects + + \title Create VCS repositories for new projects \QC allows you to create repositories for version control systems that support local repository creation, such as Git, Mercurial, or Bazaar. @@ -87,33 +103,33 @@ and select the version control system that you use. Follow the instructions of the wizard to import the project. - \section1 Using Common Functions + \sa {Creating Projects}, {Use project wizards}, {Version Control Systems} +*/ + +/*! + \page creator-how-to-use-common-vcs-functions.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-use + + \title Use common VCS functions The \uicontrol{Tools} menu has a submenu for each supported version control system. This section describes using the functions that are - available for all the supported version control systems. For more - information about the additional functions and options available for a - particular version control system, see: + available for all the supported version control systems. The additional + functions and options available for a particular version control system + are described in separate topics. - \list - \li \l{Using Bazaar} - \li \l{Using ClearCase} - \li \l{Using CVS} - \li \l{Using Fossil} - \li \l{Using Git} - \li \l{Using GitLab} - \li \l{Using Mercurial} - \li \l{Using Perforce} - \li \l{Using Subversion} - \endlist + \sa {Bazaar}, {ClearCase}, {CVS}, {Fossil}, {Git}, {GitLab}, {Mercurial}, + {Perforce}, {Subversion} - \uicontrol{Version Control} displays the commands that are + The \uicontrol{Version Control} view displays the commands that are executed, a timestamp, and the relevant output. Select \uicontrol View > \uicontrol Output > \uicontrol {Version Control} to open the view. \image qtcreator-vcs-pane.png - \section2 Adding Files + \section1 Add files When you create a new file or a new project, the wizard displays a page asking whether the files should be added to a version control system. @@ -122,7 +138,7 @@ for example, Perforce and Subversion. Alternatively, you can add files later by using the version control tool menus. - \section2 Viewing Diff Output + \section1 View diff output All version control systems have menu options to \e{diff} the current file or project: to compare it with the latest version stored in the @@ -141,13 +157,13 @@ unstage chunks or selected lines, as well as send chunks to a code pasting service. - \section2 Viewing Versioning History and Change Details + \section1 View versioning history and change details Display the versioning history of a file by selecting \uicontrol{Log} or \uicontrol{Filelog}. Typically, the log output has the date, commit message, and a change or revision identifier. - \section2 Annotating Files + \section1 Annotate files To open annotation views, select \uicontrol {Annotate} or \uicontrol {Blame}. They show the lines of the file and the identifier of the change the lines @@ -163,14 +179,14 @@ The same context menu is available when right-clicking on a version identifier in the file log view of a single file. - \section2 Committing Changes + \section1 Commit changes Once you have finished making changes, submit them to the version control system by choosing \uicontrol{Commit} or \uicontrol{Submit}. \QC displays a commit page that has a text editor where you can enter your commit message and a checkable list of modified files to include. - \section2 Reverting Changes + \section1 Revert changes All supported version control systems support reverting your project to known states. This functionality is generally called \e reverting. @@ -180,18 +196,20 @@ A version control system can replace the \uicontrol Revert menu option with other options. - \section2 Viewing Status + \section1 View status You can select \uicontrol{Status} to view the status of the project or repository. - \section2 Updating the Working Tree + \section1 Update the working tree You can select \uicontrol Update to update your working tree with the latest changes from the branch. Some version control systems allow you to choose between updating the current project and updating all projects. - \section2 Deleting Files + \section1 Delete files You can select \uicontrol Delete to delete obsolete files from the repository. + + \sa {Set up version control systems}, {Version Control Systems} */ diff --git a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc index 8d65462a2bf..16550f0ee2e 100644 --- a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc +++ b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc @@ -12,12 +12,17 @@ \if defined(qtdesignstudio) \previouspage studio-developer-topics.html \nextpage studio-porting-projects.html - \else - \previouspage creator-vcs-fossil.html - \nextpage creator-vcs-gitlab.html - \endif \title Using Git + \else + \previouspage creator-reference.html + + \ingroup creator-reference-vcs + + \title Git + + \brief Additional Git functions. + \endif \l{http://git-scm.com/}{Git} is a fast decentralized version control system. Git is available for Windows, Linux, and \macos. @@ -25,10 +30,6 @@ You can use the \l{http://code.google.com/p/gerrit/}{Gerrit} code review tool for projects that use Git. - \if defined(qtdesignstudio) - \include creator-vcs-options.qdocinc vcs options - \endif - \section1 Using Git for Windows If you configure Git for use with \c {git bash}, only, and use SSH @@ -613,4 +614,8 @@ To resolve merge conflicts, select \uicontrol Tools > \uicontrol Git > \uicontrol {Git Tools} > \uicontrol {Merge Tool}. This menu item is visible only when you have merge conflicts to resolve. + + \if defined(qtcreator) + \sa {Set up version control systems}, {Version Control Systems} + \endif */ From b7800d9351a5b9032be958863ca423be560253c0 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 8 Sep 2023 16:17:54 +0200 Subject: [PATCH 1078/1777] Doc: Turn "Activating Kits for a Project" into a how-to topic Task-number: QTCREATORBUG-29361 Change-Id: I3545d29192176ba0a4377d77f51bc13155b46588 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../images/qtcreator-projects-kits.webp | Bin 0 -> 9292 bytes .../src/editors/creator-quick-fixes.qdoc | 3 +- .../howto/creator-only/creator-how-tos.qdoc | 43 +++++--- .../creator-projects-creating.qdoc | 2 +- .../creator-projects-settings-overview.qdoc | 100 +++++++++--------- doc/qtcreator/src/qtcreator-toc.qdoc | 1 + .../src/user-interface/creator-ui.qdoc | 2 +- 7 files changed, 84 insertions(+), 67 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-projects-kits.webp diff --git a/doc/qtcreator/images/qtcreator-projects-kits.webp b/doc/qtcreator/images/qtcreator-projects-kits.webp new file mode 100644 index 0000000000000000000000000000000000000000..6f863df9a5082f513152ed0741e268b2ad68bf3c GIT binary patch literal 9292 zcmWIYbaQi2VPFV%bqWXzu<)@^VPMdI@3@-bYuDp#6J<P?{@E-SzPtLHxS(*uf}n3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{~a$%Mdnub+B{r*om0}RYA)Z#FdON;>o%#nX4Hk;edwnOioURtR_oCFFRgmn0SenK AdjJ3c literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/editors/creator-quick-fixes.qdoc b/doc/qtcreator/src/editors/creator-quick-fixes.qdoc index 0f6e7fd58af..a55c8f5cd23 100644 --- a/doc/qtcreator/src/editors/creator-quick-fixes.qdoc +++ b/doc/qtcreator/src/editors/creator-quick-fixes.qdoc @@ -35,7 +35,8 @@ virtual functions of base classes, create getter and setter functions, and generate constructors. You can specify settings for generating the functions either globally for all projects or separately for each project - in the \l{Specifying Settings}{build and run} settings of the project. + in the \l{Overriding Global Preferences}{build and run} settings of the + project. \section2 Implementing Member Functions diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 62fb4bd94d4..055a601b2fb 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -44,22 +44,33 @@ \section1 Manage Projects - \list - \li \l {Add a license header template for C++ code} - \li \l {Add libraries to projects} - \li \l {Add subprojects to projects} - \li \l {Add wizards} - \li \l {Create C++ classes} - \li \l {Create files} - \li \l {Create OpenGL fragment and vertex shaders} - \li \l {Create resource files} - \li \l {Create VCS repositories for new projects} - \li \l {Develop Qt for Python applications} - \li \l {Open projects} - \li \l {Specify project contents} - \li \l {Select the build system} - \li \l {Use project wizards} - \endlist + \table + \header + \li Create Projects + \li Configure Projects + \row + \li + \list + \li \l {Add a license header template for C++ code} + \li \l {Add libraries to projects} + \li \l {Add subprojects to projects} + \li \l {Add wizards} + \li \l {Create C++ classes} + \li \l {Create files} + \li \l {Create OpenGL fragment and vertex shaders} + \li \l {Create resource files} + \li \l {Create VCS repositories for new projects} + \li \l {Select the build system} + \li \l {Use project wizards} + \endlist + \li + \list + \li \l {Activate kits for a project} + \li \l {Develop Qt for Python applications} + \li \l {Open projects} + \li \l {Specify project contents} + \endlist + \endtable \section1 Read Qt Documentation diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index 6832d044804..291450cf57e 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -169,7 +169,7 @@ \uicontrol Preferences > \uicontrol Environment > \uicontrol Keyboard > \uicontrol Wizard. All wizard actions start with \uicontrol Impl there. - \sa {Assign keyboard shortcuts}, {Activating Kits for a Project}, + \sa {Assign keyboard shortcuts}, {Activate kits for a project}, {Create files}, {Creating Projects} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc index 926e1596e3b..108b69477f2 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,27 +8,63 @@ // ********************************************************************** /*! - \previouspage creator-vcs-subversion.html + \previouspage creator-version-control.html \page creator-configuring-projects.html - \nextpage creator-targets.html + \nextpage creator-project-managing-sessions.html \title Configuring Projects When you install Qt for a target platform, such as Android or QNX, the \l{https://www.qt.io/download-qt-installer}{Qt Online Installer} creates \l{glossary-buildandrun-kit}{kits} for the development - targets. Select the kits to use in the \uicontrol {Configure Projects} + targets. + + Select the kits to use in the \uicontrol {Configure Projects} view when you open a project for the first time. At least one kit must be - active. For more information about selecting the initial kit, see - \l{Open projects}. + active. To maintain the list of active kits for a currently open project, switch to the \uicontrol Projects mode by pressing \key Ctrl+5. - \section1 Activating Kits for a Project + \image qtcreator-projects-kits.webp {Sidebar in the Projects mode} - The \uicontrol {Build & Run} section of the sidebar lists the kits that are - compatible with your project. To activate one or more kits, click them. + To specify build or run settings for a kit, select \uicontrol Build or + \uicontrol Run below the kit. + + \section1 Overriding Global Preferences + + You can override the following global preferences for each project: + + \list + \li \l{Specifying Editor Settings}{Editor} + \li \l{Specifying Code Style}{Code Style} + \li \l{Specifying Dependencies}{Dependencies} + \li \l{Specifying Environment Settings}{Environment} + \li \l{Using Custom Output Parsers}{Custom Output Parsers} + \li \l{Applying Refactoring Actions}{Quick Fixes} + \li \l{Using Clang Tools}{Clang Tools} + \li \l{To-Do Entries}{To-Do} (experimental) + \li \l{Parsing C++ Files with the Clang Code Model}{Clangd} + \endlist + + If you have multiple projects open in \QC, select the project to configure + in \uicontrol {Active Project}. + + \sa {Activate kits for a project}, {Open projects}, + {Specifying Build Settings}, {Specifying Run Settings} +*/ + +/*! + \page creator-how-to-activate-kits.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects + + \title Activate kits for a project + + The \uicontrol {Build & Run} section of the \uicontrol Projects mode sidebar + lists the kits that are compatible with your project. To activate one or more + kits, click them. \image qtcreator-project-kits.png @@ -45,13 +81,14 @@ configuration to use a currently installed Qt version and save the kit under a new name. - To modify kit configuration or to add kits to the list or to remove - them from it, select \uicontrol {Manage Kits}. For more information - about managing kits, see \l{Adding Kits}. + \section1 Manage kits + + To modify kit configuration or to \l{Adding Kits}{add kits} to the list or to + remove them from it, select \uicontrol {Manage Kits}. Each kit consists of a set of values that define one environment, such as a - \l{glossary-device}{device}, compiler, and Qt version. For more information, - see \l{Adding Qt Versions}, \l{Adding Compilers}, and \l{Adding Debuggers}. + \l{glossary-device}{device}, \l{Adding Compilers}{compiler}, + \l{Adding Debuggers}{debugger}, and \l{Adding Qt Versions}{Qt version}. To copy the build and run settings for a kit to another kit, select \uicontrol {Copy Steps from Other Kit} in the context menu. @@ -65,38 +102,5 @@ To import an existing build for the project, select \uicontrol {Import Existing Build}. - \section1 Specifying Settings - - To specify build or run settings for a kit, select \uicontrol Build or - \uicontrol Run below the kit. For more information, see - \l{Specifying Build Settings} and \l{Specifying Run Settings}. - - In addition, you can modify the following global settings for each project: - - \list - - \li \l{Specifying Editor Settings}{Editor} - - \li \l{Specifying Code Style}{Code Style} - - \li \l{Specifying Dependencies}{Dependencies} - - \li \l{Specifying Environment Settings}{Environment} - - \li \l{Using Custom Output Parsers}{Custom Output Parsers} - - \li \l{Applying Refactoring Actions}{Quick Fixes} - - \li \l{Using Clang Tools}{Clang Tools} - - \li \l{To-Do Entries}{To-Do} (experimental) - - \li \l{Parsing C++ Files with the Clang Code Model} - {Clangd} - - \endlist - - If you have multiple projects open in \QC, select the project to configure - in the list of projects. - + \sa {Adding Kits}, {Configuring Projects} */ diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index e8334febf7b..936f5fea32d 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -211,6 +211,7 @@ \endlist \li Manage Projects \list + \li \l {Activate kits for a project} \li \l {Add a license header template for C++ code} \li \l {Add libraries to projects} \li \l {Add subprojects to projects} diff --git a/doc/qtcreator/src/user-interface/creator-ui.qdoc b/doc/qtcreator/src/user-interface/creator-ui.qdoc index 5a9e5b1629f..d7cd495e515 100644 --- a/doc/qtcreator/src/user-interface/creator-ui.qdoc +++ b/doc/qtcreator/src/user-interface/creator-ui.qdoc @@ -35,7 +35,7 @@ \li Kit selector \li Select the appropriate \l{glossary-buildandrun-kit}{kit} for building the project and running it on particular hardware. - \li \l{Activating Kits for a Project} + \li \l{Activate kits for a project} \row \li \inlineimage numbers/03.png \li Run button From 7200644f75e864649b3a2bf8b980324f0266b567 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 12 Sep 2023 15:42:54 +0200 Subject: [PATCH 1079/1777] Utils: Syntax cleaning Change-Id: If296e0240840f66c371106508f3f0046bc7a9a71 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index f951ec544e6..b12833e59c7 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1749,7 +1749,7 @@ void BoolAspect::addToLayout(Layouting::LayoutItem &parent) pushUndo(d->m_undoable.set(d->m_button->isChecked())); }); - connect(&d->m_undoable.m_signal, &UndoSignaller::changed, d->m_button, [this]() { + connect(&d->m_undoable.m_signal, &UndoSignaller::changed, d->m_button, [this] { d->m_button->setChecked(d->m_undoable.get()); handleGuiChanged(); }); @@ -1779,7 +1779,7 @@ std::function<void (QObject *)> BoolAspect::groupChecker() pushUndo(d->m_undoable.set(d->m_groupBox->isChecked())); }); - connect(&d->m_undoable.m_signal, &UndoSignaller::changed, d->m_groupBox, [this]() { + connect(&d->m_undoable.m_signal, &UndoSignaller::changed, d->m_groupBox, [this] { d->m_groupBox->setChecked(d->m_undoable.get()); handleGuiChanged(); }); From 187050144369ecfda58a567dd29715bcae5c9f92 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 5 Sep 2023 10:10:44 +0200 Subject: [PATCH 1080/1777] Delay modifications to MIME database until first use Initialization of the MIME database takes time, and it is good to avoid this during startup. We nevertheless want to apply some modifications to the MIME database, so we need to delay these modifications until first use. Allow registration of additional initialization functions. Since the initialization functions access the MIME database, which does locking for thread- safety, we need to separate the initialization to outside these locking functions. Change-Id: I2b1706347768bcf081644e078ccfa45302d61641 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/libs/extensionsystem/pluginmanager.cpp | 4 +- src/libs/utils/mimetypes2/mimedatabase.cpp | 51 +++++++++++-------- src/libs/utils/mimetypes2/mimedatabase_p.h | 10 +++- src/libs/utils/mimetypes2/mimeutils.cpp | 24 ++++++--- src/libs/utils/mimeutils.h | 1 + src/plugins/coreplugin/mimetypesettings.cpp | 19 ++++--- src/plugins/cppeditor/cppeditorplugin.cpp | 4 +- src/plugins/cppeditor/cppfilesettingspage.cpp | 15 +++++- src/plugins/cppeditor/cppfilesettingspage.h | 1 + 9 files changed, 88 insertions(+), 41 deletions(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index c072ea67fb4..116243ede39 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -957,6 +957,7 @@ void PluginManagerPrivate::nextDelayedInitialize() break; // do next delayedInitialize after a delay } if (delayedInitializeQueue.empty()) { + Utils::setMimeStartupPhase(MimeStartupPhase::UpAndRunning); m_isInitializationDone = true; delete delayedInitializeTimer; delayedInitializeTimer = nullptr; @@ -1370,7 +1371,6 @@ void PluginManagerPrivate::loadPlugins() loadPlugin(spec, PluginSpec::Initialized); } - Utils::setMimeStartupPhase(MimeStartupPhase::PluginsDelayedInitializing); { NANOTRACE_SCOPE("ExtensionSystem", "ExtensionsInitialized"); Utils::reverseForeach(queue, [this](PluginSpec *spec) { @@ -1384,8 +1384,8 @@ void PluginManagerPrivate::loadPlugins() }); } emit q->pluginsChanged(); - Utils::setMimeStartupPhase(MimeStartupPhase::UpAndRunning); + Utils::setMimeStartupPhase(MimeStartupPhase::PluginsDelayedInitializing); delayedInitializeTimer = new QTimer; delayedInitializeTimer->setInterval(DELAYED_INITIALIZE_INTERVAL); delayedInitializeTimer->setSingleShot(true); diff --git a/src/libs/utils/mimetypes2/mimedatabase.cpp b/src/libs/utils/mimetypes2/mimedatabase.cpp index b4966a952dd..60f3fbf0db5 100644 --- a/src/libs/utils/mimetypes2/mimedatabase.cpp +++ b/src/libs/utils/mimetypes2/mimedatabase.cpp @@ -562,12 +562,9 @@ MimeDatabase::~MimeDatabase() */ MimeType MimeDatabase::mimeTypeForName(const QString &nameOrAlias) const { + d->checkInitPhase(nameOrAlias); QMutexLocker locker(&d->mutex); - if (d->m_startupPhase <= int(MimeStartupPhase::PluginsInitializing)) - qWarning("Accessing MimeDatabase for %s before plugins are initialized", - qPrintable(nameOrAlias)); - return d->mimeTypeForName(nameOrAlias); } @@ -601,12 +598,9 @@ MimeType MimeDatabase::mimeTypeForName(const QString &nameOrAlias) const */ MimeType MimeDatabase::mimeTypeForFile(const QFileInfo &fileInfo, MatchMode mode) const { + d->checkInitPhase(fileInfo.filePath()); QMutexLocker locker(&d->mutex); - if (d->m_startupPhase <= int(MimeStartupPhase::PluginsInitializing)) - qWarning("Accessing MimeDatabase for %s before plugins are initialized", - qPrintable(fileInfo.filePath())); - if (fileInfo.isDir()) return d->mimeTypeForName(QLatin1String("inode/directory")); @@ -659,12 +653,9 @@ MimeType MimeDatabase::mimeTypeForFile(const QFileInfo &fileInfo, MatchMode mode MimeType MimeDatabase::mimeTypeForFile(const QString &fileName, MatchMode mode) const { if (mode == MatchExtension) { + d->checkInitPhase(fileName); QMutexLocker locker(&d->mutex); - if (d->m_startupPhase <= int(MimeStartupPhase::PluginsInitializing)) - qWarning("Accessing MimeDatabase for %s before plugins are initialized", - qPrintable(fileName)); - const QStringList matches = d->mimeTypeForFileName(fileName); const int matchCount = matches.count(); if (matchCount == 0) { @@ -696,12 +687,9 @@ MimeType MimeDatabase::mimeTypeForFile(const QString &fileName, MatchMode mode) */ QList<MimeType> MimeDatabase::mimeTypesForFileName(const QString &fileName) const { + d->checkInitPhase(fileName); QMutexLocker locker(&d->mutex); - if (d->m_startupPhase <= int(MimeStartupPhase::PluginsInitializing)) - qWarning("Accessing MimeDatabase for %s before plugins are initialized", - qPrintable(fileName)); - const QStringList matches = d->mimeTypeForFileName(fileName); QList<MimeType> mimes; mimes.reserve(matches.count()); @@ -731,11 +719,9 @@ QString MimeDatabase::suffixForFileName(const QString &fileName) const */ MimeType MimeDatabase::mimeTypeForData(const QByteArray &data) const { + d->checkInitPhase("data"); QMutexLocker locker(&d->mutex); - if (d->m_startupPhase <= int(MimeStartupPhase::PluginsInitializing)) - qWarning("Accessing MimeDatabase for data before plugins are initialized"); - int accuracy = 0; return d->findByData(data, &accuracy); } @@ -863,11 +849,9 @@ MimeType MimeDatabase::mimeTypeForFileNameAndData(const QString &fileName, const */ QList<MimeType> MimeDatabase::allMimeTypes() const { + d->checkInitPhase("all mime types"); QMutexLocker locker(&d->mutex); - if (d->m_startupPhase <= int(MimeStartupPhase::PluginsInitializing)) - qWarning("Accessing MimeDatabase for all mime types before plugins are initialized"); - return d->allMimeTypes(); } @@ -924,4 +908,27 @@ void MimeDatabasePrivate::setGlobPatternsForMimeType(const MimeType &mimeType, } } +void MimeDatabasePrivate::checkInitPhase(const QString &info) +{ + QReadLocker locker(&m_initMutex); + if (m_startupPhase <= int(MimeStartupPhase::PluginsInitializing)) { + qWarning("Accessing MimeDatabase for %s before plugins are initialized", qPrintable(info)); + return; + } + // run initialization functions and ensure providers are loaded + // the initializers will call other MIME database functions which "checkInitPhase" again, + // so make sure not to recurse + if (!m_initialized.exchange(true)) { + for (const std::function<void()> &f : m_initializers) + f(); + QMutexLocker locker(&mutex); + providers(); + } +} + +void MimeDatabasePrivate::addInitializer(const std::function<void()> &init) +{ + m_initializers.append(init); +} + } // namespace Utils diff --git a/src/libs/utils/mimetypes2/mimedatabase_p.h b/src/libs/utils/mimetypes2/mimedatabase_p.h index 8709b2918eb..c816a5c0e5b 100644 --- a/src/libs/utils/mimetypes2/mimedatabase_p.h +++ b/src/libs/utils/mimetypes2/mimedatabase_p.h @@ -25,8 +25,11 @@ #include <QtCore/qlist.h> #include <QtCore/qmutex.h> -#include <vector> +#include <QReadWriteLock> + +#include <atomic> #include <memory> +#include <vector> QT_BEGIN_NAMESPACE class QIODevice; @@ -75,6 +78,8 @@ public: void setMagicRulesForMimeType(const MimeType &mimeType, const QMap<int, QList<MimeMagicRule>> &rules); void setGlobPatternsForMimeType(const MimeType &mimeType, const QStringList &patterns); + void checkInitPhase(const QString &info); + void addInitializer(const std::function<void()> &init); private: using Providers = std::vector<std::unique_ptr<MimeProviderBase>>; @@ -86,6 +91,7 @@ private: QElapsedTimer m_lastCheck; // added for Qt Creator + QList<std::function<void()>> m_initializers; QHash<QString, QByteArray> m_additionalData; // id -> data bool m_forceLoad = true; @@ -94,6 +100,8 @@ public: QMutex mutex; // added for Qt Creator + QReadWriteLock m_initMutex; + std::atomic_bool m_initialized = false; int m_startupPhase = 0; }; diff --git a/src/libs/utils/mimetypes2/mimeutils.cpp b/src/libs/utils/mimetypes2/mimeutils.cpp index 92aeed56f0c..711dc97187a 100644 --- a/src/libs/utils/mimetypes2/mimeutils.cpp +++ b/src/libs/utils/mimetypes2/mimeutils.cpp @@ -57,7 +57,7 @@ QList<MimeType> allMimeTypes() void setMimeStartupPhase(MimeStartupPhase phase) { auto d = MimeDatabasePrivate::instance(); - QMutexLocker locker(&d->mutex); + QWriteLocker locker(&d->m_initMutex); if (int(phase) != d->m_startupPhase + 1) { qWarning("Unexpected jump in MimedDatabase lifetime from %d to %d", d->m_startupPhase, @@ -69,12 +69,14 @@ void setMimeStartupPhase(MimeStartupPhase phase) void addMimeTypes(const QString &id, const QByteArray &data) { auto d = MimeDatabasePrivate::instance(); - QMutexLocker locker(&d->mutex); - - if (d->m_startupPhase >= int(MimeStartupPhase::PluginsDelayedInitializing)) { - qWarning("Adding items for ID \"%s\" to MimeDatabase after initialization time", - qPrintable(id)); + { + QReadLocker locker(&d->m_initMutex); + if (d->m_startupPhase >= int(MimeStartupPhase::PluginsDelayedInitializing)) { + qWarning("Adding items for ID \"%s\" to MimeDatabase after initialization time", + qPrintable(id)); + } } + QMutexLocker locker(&d->mutex); d->addMimeData(id, data); } @@ -130,4 +132,14 @@ void visitMimeParents(const MimeType &mimeType, } } +/*! + The \a init function will be executed once after the MIME database is first initialized. + It must be thread safe. +*/ +void addMimeInitializer(const std::function<void()> &init) +{ + auto d = MimeDatabasePrivate::instance(); + d->addInitializer(init); +} + } // namespace Utils diff --git a/src/libs/utils/mimeutils.h b/src/libs/utils/mimeutils.h index 3fa0fc4ebb9..c5f8b819456 100644 --- a/src/libs/utils/mimeutils.h +++ b/src/libs/utils/mimeutils.h @@ -43,6 +43,7 @@ enum class MimeStartupPhase { }; QTCREATOR_UTILS_EXPORT void setMimeStartupPhase(MimeStartupPhase); +QTCREATOR_UTILS_EXPORT void addMimeInitializer(const std::function<void()> &init); QTCREATOR_UTILS_EXPORT void addMimeTypes(const QString &id, const QByteArray &data); QTCREATOR_UTILS_EXPORT QMap<int, QList<MimeMagicRule>> magicRulesForMimeType( const MimeType &mimeType); // priority -> rules diff --git a/src/plugins/coreplugin/mimetypesettings.cpp b/src/plugins/coreplugin/mimetypesettings.cpp index 0e39eaeb3e4..c2bf8202ea4 100644 --- a/src/plugins/coreplugin/mimetypesettings.cpp +++ b/src/plugins/coreplugin/mimetypesettings.cpp @@ -746,19 +746,25 @@ MimeTypeSettingsPrivate::UserMimeTypeHash MimeTypeSettingsPrivate::readUserModif return userMimeTypes; } -void MimeTypeSettingsPrivate::applyUserModifiedMimeTypes(const UserMimeTypeHash &mimeTypes) +static void registerUserModifiedMimeTypes(const MimeTypeSettingsPrivate::UserMimeTypeHash &mimeTypes) { - // register in mime data base, and remember for later for (auto it = mimeTypes.constBegin(); it != mimeTypes.constEnd(); ++it) { Utils::MimeType mt = Utils::mimeTypeForName(it.key()); - if (!mt.isValid()) // loaded from settings + if (!mt.isValid()) continue; - m_userModifiedMimeTypes.insert(it.key(), it.value()); Utils::setGlobPatternsForMimeType(mt, it.value().globPatterns); Utils::setMagicRulesForMimeType(mt, it.value().rules); } } +void MimeTypeSettingsPrivate::applyUserModifiedMimeTypes(const UserMimeTypeHash &mimeTypes) +{ + // register in mime data base, and remember for later + for (auto it = mimeTypes.constBegin(); it != mimeTypes.constEnd(); ++it) + m_userModifiedMimeTypes.insert(it.key(), it.value()); + registerUserModifiedMimeTypes(mimeTypes); +} + // MimeTypeSettingsPage MimeTypeSettings::MimeTypeSettings() @@ -792,8 +798,9 @@ QStringList MimeTypeSettings::keywords() const void MimeTypeSettings::restoreSettings() { MimeTypeSettingsPrivate::UserMimeTypeHash mimetypes - = MimeTypeSettingsPrivate::readUserModifiedMimeTypes(); - MimeTypeSettingsPrivate::applyUserModifiedMimeTypes(mimetypes); + = MimeTypeSettingsPrivate::readUserModifiedMimeTypes(); + MimeTypeSettingsPrivate::m_userModifiedMimeTypes = mimetypes; + Utils::addMimeInitializer([mimetypes] { registerUserModifiedMimeTypes(mimetypes); }); } QWidget *MimeEditorDelegate::createEditor(QWidget *parent, diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 51bd004d1a7..58822a5f71b 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -516,9 +516,7 @@ void CppEditorPlugin::initialize() void CppEditorPlugin::extensionsInitialized() { d->m_fileSettings.fromSettings(ICore::settings()); - if (!d->m_fileSettings.applySuffixesToMimeDB()) - qWarning("Unable to apply cpp suffixes to mime database (cpp mime types not found).\n"); - + d->m_fileSettings.addMimeInitializer(); const auto fileNamesPanelFactory = new ProjectPanelFactory; fileNamesPanelFactory->setPriority(99); fileNamesPanelFactory->setDisplayName(Tr::tr("C++ File Naming")); diff --git a/src/plugins/cppeditor/cppfilesettingspage.cpp b/src/plugins/cppeditor/cppfilesettingspage.cpp index a506dff8b8a..3d3014f86b1 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.cpp +++ b/src/plugins/cppeditor/cppfilesettingspage.cpp @@ -93,7 +93,7 @@ void CppFileSettings::fromSettings(QSettings *s) s->endGroup(); } -bool CppFileSettings::applySuffixesToMimeDB() +static bool applySuffixes(const QString &sourceSuffix, const QString &headerSuffix) { Utils::MimeType mt; mt = Utils::mimeTypeForName(QLatin1String(Constants::CPP_SOURCE_MIMETYPE)); @@ -107,6 +107,19 @@ bool CppFileSettings::applySuffixesToMimeDB() return true; } +void CppFileSettings::addMimeInitializer() const +{ + Utils::addMimeInitializer([sourceSuffix = sourceSuffix, headerSuffix = headerSuffix] { + if (!applySuffixes(sourceSuffix, headerSuffix)) + qWarning("Unable to apply cpp suffixes to mime database (cpp mime types not found).\n"); + }); +} + +bool CppFileSettings::applySuffixesToMimeDB() +{ + return applySuffixes(sourceSuffix, headerSuffix); +} + bool CppFileSettings::equals(const CppFileSettings &rhs) const { return lowerCaseFiles == rhs.lowerCaseFiles diff --git a/src/plugins/cppeditor/cppfilesettingspage.h b/src/plugins/cppeditor/cppfilesettingspage.h index f4c65fbbc5c..3232ba4d4d5 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.h +++ b/src/plugins/cppeditor/cppfilesettingspage.h @@ -38,6 +38,7 @@ public: void toSettings(QSettings *) const; void fromSettings(QSettings *); + void addMimeInitializer() const; bool applySuffixesToMimeDB(); // Convenience to return a license template completely formatted. From f491d93d2a2c95aded5fa11a31fc4e97fcc43c83 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 13 Sep 2023 10:29:05 +0200 Subject: [PATCH 1081/1777] CppEditor: remove superfluous locker in model manager This locker potentially results in a freeze since the called projectPart might require to lock for writing, which is not possible if the read locker is still there. Additionally there is nothing we would need the lock for in projectPartFromDependencies. Change-Id: If957edfb4ebc45e18141cb14a63bf9567242cc48 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/cppeditor/cppmodelmanager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index 231740899be..cc08724373d 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -1660,7 +1660,6 @@ QList<ProjectPart::ConstPtr> CppModelManager::projectPartFromDependencies( QSet<ProjectPart::ConstPtr> parts; const FilePaths deps = snapshot().filesDependingOn(fileName); - QReadLocker locker(&d->m_projectLock); for (const FilePath &dep : deps) parts.unite(Utils::toSet(projectPart(dep))); From 9c036fe39393d8a5c5843ac673267dd2b398fe7f Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 12 Sep 2023 18:11:21 +0200 Subject: [PATCH 1082/1777] ScreenRecorder: Offer saving of the current cropped frame The "crop and trim" dialog gets two new buttons. The first offers to save the current, cropped frame as png image. The second one copies the image into the clipboard. Copyuing into clipboard is also triggered by the QKeySequence::Copy shortcut. The location where the last image was saved gets remembered in the settings. Change-Id: Id4ac93838d59f6a6fa801456fe8d9c17d1e74154 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/screenrecorder/cropandtrim.cpp | 44 +++++++++++++++++++ src/plugins/screenrecorder/cropandtrim.h | 1 + .../screenrecorder/screenrecordersettings.cpp | 4 ++ .../screenrecorder/screenrecordersettings.h | 1 + 4 files changed, 50 insertions(+) diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp index 16cdb3ec3c3..c6c35560ea1 100644 --- a/src/plugins/screenrecorder/cropandtrim.cpp +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -7,6 +7,7 @@ #include "screenrecordersettings.h" #include "screenrecordertr.h" +#include <utils/fileutils.h> #include <utils/layoutbuilder.h> #include <utils/process.h> #include <utils/qtcsettings.h> @@ -16,8 +17,10 @@ #include <coreplugin/icore.h> +#include <QClipboard> #include <QDialog> #include <QDialogButtonBox> +#include <QGuiApplication> #include <QLabel> #include <QMouseEvent> #include <QPainter> @@ -164,6 +167,14 @@ void CropScene::setImage(const QImage &image) resize(sceneSize); } +QImage CropScene::croppedImage() const +{ + if (!m_image) + return {}; + + return m_image->copy(m_cropRect); +} + void CropScene::mouseMoveEvent(QMouseEvent *event) { const QPoint imagePos = toImagePos(event->pos()); @@ -267,6 +278,18 @@ CropWidget::CropWidget(QWidget *parent) m_warningIcon = new CropSizeWarningIcon(CropSizeWarningIcon::StandardVariant); + auto saveImageButton = new QToolButton; + saveImageButton->setToolTip(Tr::tr("Save current, cropped frame as image file...")); + saveImageButton->setIcon(Icons::SAVEFILE.icon()); + + auto copyImageToClipboardAction = new QAction(Tr::tr("Copy current, cropped frame as image " + "into the Clipboard"), this); + copyImageToClipboardAction->setIcon(Icons::COPY.icon()); + copyImageToClipboardAction->setShortcut(QKeySequence::Copy); + + auto copyImageToClipboardButton = new QToolButton; + copyImageToClipboardButton->setDefaultAction(copyImageToClipboardAction); + using namespace Layouting; Column { scrollArea, @@ -278,6 +301,8 @@ CropWidget::CropWidget(QWidget *parent) m_resetButton, m_warningIcon, st, + saveImageButton, + copyImageToClipboardButton, }, noMargin(), }.attachTo(this); @@ -290,6 +315,25 @@ CropWidget::CropWidget(QWidget *parent) connect(m_resetButton, &QToolButton::pressed, this, [this] { m_cropScene->setFullySelected(); }); + connect(saveImageButton, &QToolButton::clicked, this, [this] { + FilePathAspect &lastDir = Internal::settings().lastSaveImageDirectory; + const QString ext(".png"); + FilePath file = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save Current Frame As"), + lastDir(), "*" + ext); + if (!file.isEmpty()) { + if (!file.endsWith(ext)) + file = file.stringAppended(ext); + lastDir.setValue(file.parentDir()); + lastDir.writeToSettingsImmediatly(); + const QImage image = m_cropScene->croppedImage(); + image.save(file.toString()); + } + }); + connect(copyImageToClipboardAction, &QAction::triggered, this, [this] { + const QImage image = m_cropScene->croppedImage(); + QClipboard *clipboard = QGuiApplication::clipboard(); + clipboard->setImage(image); + }); updateWidgets(); } diff --git a/src/plugins/screenrecorder/cropandtrim.h b/src/plugins/screenrecorder/cropandtrim.h index 164f0dbbd20..1ac2cbae453 100644 --- a/src/plugins/screenrecorder/cropandtrim.h +++ b/src/plugins/screenrecorder/cropandtrim.h @@ -26,6 +26,7 @@ public: void setFullySelected(); QRect fullRect() const; void setImage(const QImage &image); + QImage croppedImage() const; const static int lineWidth = 1; diff --git a/src/plugins/screenrecorder/screenrecordersettings.cpp b/src/plugins/screenrecorder/screenrecordersettings.cpp index 98dfefdcf63..ae01d321175 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.cpp +++ b/src/plugins/screenrecorder/screenrecordersettings.cpp @@ -107,6 +107,10 @@ ScreenRecorderSettings::ScreenRecorderSettings() exportLastDirectory.setExpectedKind(PathChooser::ExistingDirectory); exportLastDirectory.setDefaultValue(FileUtils::homePath().toString()); + lastSaveImageDirectory.setSettingsKey("LastSaveImageDir"); + lastSaveImageDirectory.setExpectedKind(PathChooser::ExistingDirectory); + lastSaveImageDirectory.setDefaultValue(FileUtils::homePath().toString()); + recordFrameRate.setSettingsKey("RecordFrameRate"); recordFrameRate.setDefaultValue(24); recordFrameRate.setLabelText(Tr::tr("Recording frame rate:")); diff --git a/src/plugins/screenrecorder/screenrecordersettings.h b/src/plugins/screenrecorder/screenrecordersettings.h index ac05169bc40..75527da6538 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.h +++ b/src/plugins/screenrecorder/screenrecordersettings.h @@ -40,6 +40,7 @@ public: // Used in other places Utils::FilePathAspect lastOpenDirectory{this}; Utils::FilePathAspect exportLastDirectory{this}; + Utils::FilePathAspect lastSaveImageDirectory{this}; Utils::IntegerAspect recordFrameRate{this}; Utils::IntegerAspect recordScreenId{this}; Utils::StringListAspect recordScreenCropRect{this}; From 6cf4b1a3cd0bb64140efd8d42103ee18cb802b39 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Wed, 13 Sep 2023 10:56:54 +0200 Subject: [PATCH 1083/1777] Doc: Use hyphenated form of "command-line" where appropriate That is where it precedes another noun, such as "options", "arguments", or "tools". Change-Id: Ic4c339084e7350fe737e499293a8f96c91c57fd7 Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io> --- doc/qtcreator/config/style/qt5-sidebar.html | 2 +- .../src/analyze/cpu-usage-analyzer.qdoc | 4 ++-- doc/qtcreator/src/android/androiddev.qdoc | 2 +- .../creator-only/creator-debugger-setup.qdoc | 2 +- .../creator-only/creator-debugger.qdoc | 6 ++--- .../editors/creator-only/creator-fakevim.qdoc | 2 +- .../creator-only/creator-language-server.qdoc | 2 +- .../src/howto/creator-external-tools.qdoc | 2 +- .../src/howto/creator-only/creator-cli.qdoc | 8 +++---- .../howto/creator-only/creator-how-tos.qdoc | 7 +++--- doc/qtcreator/src/howto/creator-sessions.qdoc | 2 +- ...reator-projects-incredibuild-building.qdoc | 2 +- .../creator-embedded-platforms.qdoc | 2 +- .../creator-custom-output-parser.qdoc | 2 +- .../creator-projects-custom-wizards.qdoc | 2 +- .../creator-projects-generic.qdoc | 2 +- .../creator-projects-qt-versions.qdoc | 2 +- .../creator-projects-settings-build.qdoc | 2 +- ...ator-projects-settings-run-desktop.qdocinc | 2 +- .../creator-projects-settings-run.qdoc | 2 +- .../src/python/creator-python-run.qdocinc | 2 +- .../src/qnx/creator-developing-qnx.qdoc | 2 +- .../qnx/creator-projects-running-qnx.qdocinc | 2 +- doc/qtcreator/src/qtcreator-toc.qdoc | 2 +- doc/qtcreator/src/qtcreator.qdoc | 2 +- .../creator-reference-output-views.qdoc | 2 +- .../vcs/creator-only/creator-vcs-bazaar.qdoc | 2 +- .../src/vcs/creator-only/creator-vcs-cvs.qdoc | 2 +- .../vcs/creator-only/creator-vcs-fossil.qdoc | 2 +- .../creator-only/creator-vcs-mercurial.qdoc | 2 +- .../creator-only/creator-vcs-perforce.qdoc | 2 +- .../creator-only/creator-vcs-preferences.qdoc | 6 ++--- doc/qtcreatordev/src/external-tool-spec.qdoc | 2 +- doc/qtcreatordev/src/plugin-metadata.qdoc | 22 +++++++++---------- doc/qtcreatordev/src/plugin-tests.qdoc | 2 +- doc/qtcreatordev/src/pluginmanager.qdoc | 2 +- 36 files changed, 57 insertions(+), 56 deletions(-) diff --git a/doc/qtcreator/config/style/qt5-sidebar.html b/doc/qtcreator/config/style/qt5-sidebar.html index 2a260ed7340..c1745aec9d1 100644 --- a/doc/qtcreator/config/style/qt5-sidebar.html +++ b/doc/qtcreator/config/style/qt5-sidebar.html @@ -100,7 +100,7 @@ <ul> <li><a href="creator-acknowledgements.html">Acknowledgements</a></li> <li><a href="creator-project-other.html">Build Systems</a></li> - <li><a href="creator-cli.html">Command Line Options</a></li> + <li><a href="creator-cli.html">Command-Line Options</a></li> <li><a href="creator-project-wizards.html">Custom Wizards</a></li> <li><a href="creator-faq.html">FAQ</a></li> <li><a href="creator-glossary.html">Glossary</a></li> diff --git a/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc b/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc index 25cc5e944d1..ddcdd551ca4 100644 --- a/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc +++ b/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc @@ -219,9 +219,9 @@ snapshots may fail to capture call chains of highly recursive applications or other intense stack usage. - \section2 Adding Command Line Options For Perf + \section2 Adding Command-Line Options for Perf - You can specify additional command line options to be passed to Perf when + You can specify additional command-line options to be passed to Perf when recording data in the \uicontrol {Additional arguments} field. You may want to specify \c{--no-delay} or \c{--no-buffering} to reduce the processing delay. However, those options are not supported by all versions of Perf and diff --git a/doc/qtcreator/src/android/androiddev.qdoc b/doc/qtcreator/src/android/androiddev.qdoc index a171476b13c..48c0cd8f273 100644 --- a/doc/qtcreator/src/android/androiddev.qdoc +++ b/doc/qtcreator/src/android/androiddev.qdoc @@ -21,7 +21,7 @@ highlighting, function tooltips, and navigating in code, add a \l{Java Language Server}{Java language server}. - \QC integrates the Android Debug Bridge (\c adb) command line tool for + \QC integrates the Android Debug Bridge (\c adb) command-line tool for deploying applications to Android devices, running them, and reading their logs. The \c adb tool includes a client and server that run on the development host and a daemon that runs on the emulator or device. diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc index 03cfc5b1bae..cbf6925ed60 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc @@ -178,7 +178,7 @@ 32-bit executable with a 64-bit debugger can result in a stack trace of the WOW64 emulator 32-bit emulation layer being displayed. - \QC extends the command line debugger by loading the + \QC extends the command-line debugger by loading the \c qtcreatorcdbext.dll extension library into it. The library must be available in the \c {libs\qtcreatorcdbext64} and \c {libs\qtcreatorcdbext32} folder. To install it there, diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index caed3452f65..b87444f83b8 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -390,7 +390,7 @@ \endlist - For more information, see \l{Command Line Options}. + For more information, see \l{Command-Line Options}. */ /*! @@ -497,14 +497,14 @@ \section1 Using CDB In remote mode, the local CDB process talks to a CDB process that runs on - the remote machine. The process is started with special command line options + the remote machine. The process is started with special command-line options that switch it into server mode. The remote CDB process must load the \QC CDB extension library that is shipped with \QC: \list 1 \li Install the \e{Debugging Tools for Windows} on the remote machine. - The installation folder has the CDB command line executable + The installation folder has the CDB command-line executable (\c cdb.exe). \li Copy the \QC CDB extension library and the dependencies from the Qt installation diff --git a/doc/qtcreator/src/editors/creator-only/creator-fakevim.qdoc b/doc/qtcreator/src/editors/creator-only/creator-fakevim.qdoc index dba4740fd69..c366cf82a4b 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-fakevim.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-fakevim.qdoc @@ -66,7 +66,7 @@ \li Wrap line movement, such as \c gj, \c gk, \c g0, \c g^, \c g$ \endlist - \section2 Command Line Mode + \section2 Command-Line Mode \list \li \c :map, \c :unmap, \c :inoremap, and so on diff --git a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc index b11860155d5..9ca34ea7b31 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc @@ -100,7 +100,7 @@ request. \li In the \uicontrol Executable field, enter the path to the language server executable. - \li In the \uicontrol Arguments field, enter any required command line + \li In the \uicontrol Arguments field, enter any required command-line arguments. Select \uicontrol Variables to use variables as arguments. \endlist diff --git a/doc/qtcreator/src/howto/creator-external-tools.qdoc b/doc/qtcreator/src/howto/creator-external-tools.qdoc index c117caee09f..79e0599c3c3 100644 --- a/doc/qtcreator/src/howto/creator-external-tools.qdoc +++ b/doc/qtcreator/src/howto/creator-external-tools.qdoc @@ -157,7 +157,7 @@ {Qt6::LinguistTools}. By default, the project .pro file is passed to the tools as an argument. To - specify other command line arguments for the tools, select \uicontrol Tools > + specify other command-line arguments for the tools, select \uicontrol Tools > \uicontrol External > \uicontrol Configure. \section2 Synchronize TS files diff --git a/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc b/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc index beee519bc8a..b11cab2a52e 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-cli.qdoc @@ -13,11 +13,11 @@ \ingroup creator-reference - \title Command Line Options + \title Command-Line Options \brief Options for starting \QC from the command line. - To specify command line options, enter the following command in the + To specify command-line options, enter the following command in the directory that contains the \QC executable or specify the path to \QC as a part of the command: @@ -34,7 +34,7 @@ \row \li -help - \li Display help on command line options. + \li Display help on command-line options. \row \li -version @@ -212,7 +212,7 @@ \section1 Using Custom Styles \QC is a \l{QApplication}{Qt application}, and therefore, it accepts the - command line options that all Qt applications accept. For example, you can + command-line options that all Qt applications accept. For example, you can use the \c {-style} and \c {-stylesheet} options to apply custom styles and \l{Qt Style Sheets}{stylesheets}. The styling is only applied during the current session. diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 055a601b2fb..2d00466ed24 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -68,6 +68,7 @@ \li \l {Activate kits for a project} \li \l {Develop Qt for Python applications} \li \l {Open projects} + \li \l {Specify editor settings} \li \l {Specify project contents} \endlist \endtable @@ -187,7 +188,7 @@ You can start \QC and specify some options from the command line. For example, you can open a file to any line and column. - To use command line options, enter the following command in the + To use command-line options, enter the following command in the directory that contains the \QC executable or specify the path to \QC as a part of the command: @@ -224,7 +225,7 @@ \section1 Open a project from a directory To open a project that is located in a particular directory, you can - pass on the directory name as a command line argument. \QC looks for + pass on the directory name as a command-line argument. \QC looks for a \l{Managing Sessions}{session} that matches the directory name and loads it. Or it looks for a project file in the directory and opens it. @@ -232,7 +233,7 @@ \c {C:\qtcreator\bin>qtcreator.exe C:\Examples\alarms} - \sa {Command Line Options} + \sa {Command-Line Options} */ /*! diff --git a/doc/qtcreator/src/howto/creator-sessions.qdoc b/doc/qtcreator/src/howto/creator-sessions.qdoc index 2e2f95cc105..1201810e09f 100644 --- a/doc/qtcreator/src/howto/creator-sessions.qdoc +++ b/doc/qtcreator/src/howto/creator-sessions.qdoc @@ -96,7 +96,7 @@ When you start \QC from the command line, you can give the name of a session as an argument and \QC will start with this session. - For more information, see \l{Command Line Options}. + For more information, see \l{Command-Line Options}. \endif */ diff --git a/doc/qtcreator/src/incredibuild/creator-projects-incredibuild-building.qdoc b/doc/qtcreator/src/incredibuild/creator-projects-incredibuild-building.qdoc index 2d892cb1086..92ff58fec36 100644 --- a/doc/qtcreator/src/incredibuild/creator-projects-incredibuild-building.qdoc +++ b/doc/qtcreator/src/incredibuild/creator-projects-incredibuild-building.qdoc @@ -32,7 +32,7 @@ The build errors and warnings are parsed and displayed in \l Issues. Select the \uicontrol {Keep original jobs number} check box to stop - IncrediBuild from overriding the \c {-j} command line switch, which + IncrediBuild from overriding the \c {-j} command-line switch, which controls the number of processes that the build tools executed by \QC run in parallel. The default value set by IncrediBuild is 200. diff --git a/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc b/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc index d22c7dec114..e60f48a5e70 100644 --- a/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc +++ b/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc @@ -98,7 +98,7 @@ \section1 QNX - The QNX Neutrino RTOS has more command line tools + The QNX Neutrino RTOS has more command-line tools and services, as described in \l {Qt for QNX}. \note In Qt 6, \QC support for QNX is considered experimental. diff --git a/doc/qtcreator/src/projects/creator-only/creator-custom-output-parser.qdoc b/doc/qtcreator/src/projects/creator-only/creator-custom-output-parser.qdoc index f973cc13b11..aa4af6386c8 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-custom-output-parser.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-custom-output-parser.qdoc @@ -8,7 +8,7 @@ \title Using Custom Output Parsers - Custom output parsers scan command line output for error + Custom output parsers scan command-line output for error and warning patterns that you specify and create entries for found patterns in \l Issues. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc index 57ad34d3b3b..8f685b728dd 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc @@ -146,7 +146,7 @@ /global/genericfilewizard.png" not found. \endcode - See \l{Command Line Options} for more information about command line + See \l{Command-Line Options} for more information about command-line arguments. \include creator-projects-custom-wizards-json.qdocinc json wizards diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-generic.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-generic.qdoc index cd37ea22330..094526334b5 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-generic.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-generic.qdoc @@ -127,7 +127,7 @@ \section1 Forwarding Flags to Clang Code Model - The \c {.cxxflags} and \c {.cflags} files have command line flags for the + The \c {.cxxflags} and \c {.cflags} files have command-line flags for the Clang code model on a single line. For example, specify the \c {-std=c++11} to set the language version diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-qt-versions.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-qt-versions.qdoc index 9d3af4d82c7..87295563945 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-qt-versions.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-qt-versions.qdoc @@ -121,7 +121,7 @@ setup with \QC. \list 1 - \li qmake is an executable that understands the \c -query command line + \li qmake is an executable that understands the \c -query command-line argument. \li The \c bin and \c include directories have to exist. \QC fetches these directories by running \c{qmake -query}. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc index 69315c8a4d0..73a2f34bbab 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc @@ -90,7 +90,7 @@ \QC executes external processes to accomplish tasks such as building and running applications. To execute the processes, \QC uses shell commands that are native to the system. It constructs the commands from - an executable name and optional command line arguments. + an executable name and optional command-line arguments. The executable name is specified in the executable fields: \uicontrol qmake, \uicontrol Make, \uicontrol Command, or \uicontrol Executable. It is either diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run-desktop.qdocinc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run-desktop.qdocinc index c3f3688e892..82217c4d7a1 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run-desktop.qdocinc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run-desktop.qdocinc @@ -6,7 +6,7 @@ \section1 Specifying Run Settings for Desktop Device Types - You can specify command line arguments to be passed to the executable + You can specify command-line arguments to be passed to the executable and the working directory to use. The working directory defaults to the directory of the build result. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc index 6f489f4b301..2a157391d08 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc @@ -127,7 +127,7 @@ run configuration for your project. For example, when working on a library, you can run a test application that links against the library. - Specify the executable to run, command line arguments, working directory, + Specify the executable to run, command-line arguments, working directory, and environment variables to use. \image qmldesigner-run-custom-exe.png {Run settings for custom executables} diff --git a/doc/qtcreator/src/python/creator-python-run.qdocinc b/doc/qtcreator/src/python/creator-python-run.qdocinc index 760587e08bb..445b32a577b 100644 --- a/doc/qtcreator/src/python/creator-python-run.qdocinc +++ b/doc/qtcreator/src/python/creator-python-run.qdocinc @@ -34,7 +34,7 @@ \li In the \uicontrol Script field, you can see the path to the main file of the project that will be run. \li In the \uicontrol {Command line arguments} field, specify - command line arguments to be passed to the executable. + command-line arguments to be passed to the executable. \endlist If you want to run some other Python file than \c main.py, create a custom diff --git a/doc/qtcreator/src/qnx/creator-developing-qnx.qdoc b/doc/qtcreator/src/qnx/creator-developing-qnx.qdoc index 6f5361c2c4d..cdf50eb5a08 100644 --- a/doc/qtcreator/src/qnx/creator-developing-qnx.qdoc +++ b/doc/qtcreator/src/qnx/creator-developing-qnx.qdoc @@ -11,7 +11,7 @@ You can connect QNX devices to the development PC to deploy, run and debug applications on them from within \QC. The QNX Neutrino RTOS has additional - command line tools and services, as described in \l {Qt for QNX}. + command-line tools and services, as described in \l {Qt for QNX}. \note In Qt 6, \QC support for QNX is considered experimental. diff --git a/doc/qtcreator/src/qnx/creator-projects-running-qnx.qdocinc b/doc/qtcreator/src/qnx/creator-projects-running-qnx.qdocinc index 4413be5d1dd..0d9bc2c43d5 100644 --- a/doc/qtcreator/src/qnx/creator-projects-running-qnx.qdocinc +++ b/doc/qtcreator/src/qnx/creator-projects-running-qnx.qdocinc @@ -28,7 +28,7 @@ \section2 Troubleshooting Errors To support running, debugging, and stopping applications from \QC, the QNX - Neutrino RTOS has additional command line tools and services, as described + Neutrino RTOS has additional command-line tools and services, as described in \l {Qt for QNX}. \section3 Debug Output Cannot Be Shown diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 936f5fea32d..9d25af66dad 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -272,7 +272,7 @@ \li \l{Reference} \list \li \l {Acknowledgements} - \li \l {Command Line Options} + \li \l {Command-Line Options} \li \l {Custom Wizards} \li \l {FAQ} \li \l {Glossary} diff --git a/doc/qtcreator/src/qtcreator.qdoc b/doc/qtcreator/src/qtcreator.qdoc index 482e310443b..12dd9430ebd 100644 --- a/doc/qtcreator/src/qtcreator.qdoc +++ b/doc/qtcreator/src/qtcreator.qdoc @@ -103,7 +103,7 @@ \li \b {\l{Reference}} \list \li \l {Build Systems} - \li \l {Command Line Options} + \li \l {Command-Line Options} \li \l {Custom Wizards} \li \l {Keyboard Shortcuts} \li \l {Supported Platforms} diff --git a/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc b/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc index c3da47296ce..7fdfc296f02 100644 --- a/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc +++ b/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc @@ -119,7 +119,7 @@ \image qtcreator-application-output.webp {Application Output} \if defined(qtcreator) - If you specify command line arguments in the run settings that are passed + If you specify command-line arguments in the run settings that are passed to the application when running it, they are displayed as a part of the application output. For more information, see \l{Specifying Run Settings for Desktop Device Types}. diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-bazaar.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-bazaar.qdoc index 435585171a8..de27eee29ff 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-bazaar.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-bazaar.qdoc @@ -52,7 +52,7 @@ \image qtcreator-preferences-vcs-bazaar.webp {Bazaar preferences} \list - \li \uicontrol Command specifies the path to the command line client + \li \uicontrol Command specifies the path to the command-line client executable. \li \uicontrol {Default username} and \uicontrol {Default email} specify the username and email address to use by default when diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-cvs.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-cvs.qdoc index 7c33b1ddf9d..f0650434bd1 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-cvs.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-cvs.qdoc @@ -40,7 +40,7 @@ \image qtcreator-preferences-vcs-cvs.webp {CVS preferences} \list - \li \uicontrol {CVS Command} specifies the path to the command line + \li \uicontrol {CVS Command} specifies the path to the command-line client executable. \li \uicontrol {CVS root} specifies the CVS root. \li \uicontrol Timeout sets a timeout for version control operations. diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-fossil.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-fossil.qdoc index 0927a4cd077..e52c1c37b94 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-fossil.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-fossil.qdoc @@ -75,7 +75,7 @@ \uicontrol {Version Control} > \uicontrol Fossil: \list - \li \uicontrol Command specifies the path to the command line client + \li \uicontrol Command specifies the path to the command-line client executable. \li \uicontrol {Default path} sets the path to the directory to store local repositories by default. diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-mercurial.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-mercurial.qdoc index a0a89b8fd75..f729c382eb9 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-mercurial.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-mercurial.qdoc @@ -54,7 +54,7 @@ \image qtcreator-preferences-vcs-mercurial.webp {Mercurial preferences} \list - \li \uicontrol Command specifies the path to the command line client + \li \uicontrol Command specifies the path to the command-line client executable. \li \uicontrol {Default username} and \uicontrol {Default email} specify the username and email address to use by default when diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc index 0179b295b28..595b81bd06e 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc @@ -37,7 +37,7 @@ \image qtcreator-preferences-vcs-perforce.webp {Perforce preferences} - In \uicontrol {P4 command}, set the path to the command line client + In \uicontrol {P4 command}, set the path to the command-line client executable. Set workspace details in \uicontrol {P4 user}, \uicontrol {P4 client}, and diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-preferences.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-preferences.qdoc index 898a9bebaf7..2cdfbc73803 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-preferences.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-preferences.qdoc @@ -9,9 +9,9 @@ \title Set up version control systems - \QC uses the version control system's command line clients to access your - repositories. Make sure that the command line clients are in the \c{PATH} - environment variable, or specify the path to the command line client + \QC uses the version control system's command-line clients to access your + repositories. Make sure that the command-line clients are in the \c{PATH} + environment variable, or specify the path to the command-line client executable in the version control system specific tab in \uicontrol Edit > \uicontrol Preferences > \uicontrol {Version Control}. diff --git a/doc/qtcreatordev/src/external-tool-spec.qdoc b/doc/qtcreatordev/src/external-tool-spec.qdoc index 084f39b6718..0186b742e14 100644 --- a/doc/qtcreatordev/src/external-tool-spec.qdoc +++ b/doc/qtcreatordev/src/external-tool-spec.qdoc @@ -139,7 +139,7 @@ finds. Required. \row \li arguments - \li Command line arguments for the executable. Specify the string in the + \li Command-line arguments for the executable. Specify the string in the same format (with respect to quoting and argument splitting, for example) as you would specify it on the command line of the platform the tool runs on. Optional. diff --git a/doc/qtcreatordev/src/plugin-metadata.qdoc b/doc/qtcreatordev/src/plugin-metadata.qdoc index fc38ac0f60a..4af331c0bae 100644 --- a/doc/qtcreatordev/src/plugin-metadata.qdoc +++ b/doc/qtcreatordev/src/plugin-metadata.qdoc @@ -215,7 +215,7 @@ \section3 Test Dependencies - When the user runs the application with the \c{-test} command line argument, only + When the user runs the application with the \c{-test} command-line argument, only the specified plugins and their dependencies are loaded. This is done in order to speed up the execution of tests by avoiding the loading of unneeded plugins. @@ -225,18 +225,18 @@ This type of dependency is not transitive. - \section2 Command Line Arguments + \section2 Command-Line Arguments - Plugins can register command line arguments that the user can give - when starting the application. These command line arguments are shown + Plugins can register command-line arguments that the user can give + when starting the application. These command-line arguments are shown with a one-line description when the user runs the application with - the \c{-help} command line argument, and the plugin manager does its command + the \c{-help} command-line argument, and the plugin manager does its command line parsing and sanity checks based on that information. - If the plugin manager finds matching command line arguments for a plugin, + If the plugin manager finds matching command-line arguments for a plugin, it passes them on to the plugin's \l{ExtensionSystem::IPlugin::initialize()}{initialize()} function. - Command line arguments are defined through the key \c Arguments, which contains an array + Command-line arguments are defined through the key \c Arguments, which contains an array of argument objects. Each individual argument object has the required key \c Name, and optional keys \c Parameter and \c Description. @@ -248,7 +248,7 @@ \row \li Arguments \li Array of argument objects - \li Describes the command line arguments that the plugin wants to handle. + \li Describes the command-line arguments that the plugin wants to handle. \endtable An argument object is a JSON object with the following keys: @@ -260,19 +260,19 @@ \row \li Name \li String - \li The command line argument itself, including the \c - prefix, e.g. + \li The command-line argument itself, including the \c - prefix, e.g. \c{-my-parameter}. \row \li Parameter \li String - \li Optional. If this is given, the command line argument expects an + \li Optional. If this is given, the command-line argument expects an additional parameter, e.g. \c{-my-parameter somevalue}. The value of this attribute is used as a very short description of the parameter for the user. \row \li Description \li String - \li Optional. A (one-line) description of the argument for the command line argument help. + \li Optional. A (one-line) description of the argument for the command-line argument help. \endtable \section2 Example \c Test.json diff --git a/doc/qtcreatordev/src/plugin-tests.qdoc b/doc/qtcreatordev/src/plugin-tests.qdoc index d3a4dd35a56..e59f6a497cd 100644 --- a/doc/qtcreatordev/src/plugin-tests.qdoc +++ b/doc/qtcreatordev/src/plugin-tests.qdoc @@ -31,7 +31,7 @@ test. Plugin tests are executed by starting \QC with the \c{-test <pluginname>} - command line argument. \QC then fully loads your plugin and all the plugins + command-line argument. \QC then fully loads your plugin and all the plugins that it depends on, going through the normal \l{Plugin Life Cycle}. After your plugin and all dependencies are fully initialized, your tests are executed. Afterwards, \QC automatically closes. Therefore, your plugin diff --git a/doc/qtcreatordev/src/pluginmanager.qdoc b/doc/qtcreatordev/src/pluginmanager.qdoc index ceaf84d8640..1d9047ffa04 100644 --- a/doc/qtcreatordev/src/pluginmanager.qdoc +++ b/doc/qtcreatordev/src/pluginmanager.qdoc @@ -16,7 +16,7 @@ The plugin manager handles all the details regarding finding plugins, reading their description files, resolving plugin dependencies, loading and initializing all plugins - in the right order, and passing on command line arguments. + in the right order, and passing on command-line arguments. In addition, the plugin manager manages an \e{object pool}, where objects can be registered and retrieved depending on different criteria. From 5cfe69ea1ea1b066ccbcba3d5c76e69ae91ff661 Mon Sep 17 00:00:00 2001 From: Xavier BESSON <developer@xavi-b.fr> Date: Tue, 12 Sep 2023 14:40:59 +0200 Subject: [PATCH 1084/1777] Add possibility to comment selection after the white spaces Fixes: QTCREATORBUG-29410 Change-Id: I736378e0b5fb542a6c1032a47adfb251b50ce2ef Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/uncommentselection.cpp | 34 ++++++++++++++++--- src/libs/utils/uncommentselection.h | 2 +- .../texteditor/behaviorsettingswidget.cpp | 7 +++- src/plugins/texteditor/texteditor.cpp | 4 ++- src/plugins/texteditor/typingsettings.cpp | 9 +++-- src/plugins/texteditor/typingsettings.h | 1 + 6 files changed, 47 insertions(+), 10 deletions(-) diff --git a/src/libs/utils/uncommentselection.cpp b/src/libs/utils/uncommentselection.cpp index 5bba136cdf1..8cce4c86a02 100644 --- a/src/libs/utils/uncommentselection.cpp +++ b/src/libs/utils/uncommentselection.cpp @@ -176,12 +176,34 @@ QTextCursor unCommentSelection(const QTextCursor &cursorIn, } const int singleLineLength = definition.singleLine.length(); + unsigned int minTab = -1; + if (definition.isAfterWhitespace && !doSingleLineStyleUncomment) { + for (QTextBlock block = startBlock; block != endBlock && minTab != 0; block = block.next()) { + QTextCursor c(block); + if (doc->characterAt(block.position()).isSpace()) { + c.movePosition(QTextCursor::NextWord); + if (c.block() != block) // ignore empty lines + continue; + } + const int pos = c.positionInBlock(); + if (pos < minTab) + minTab = pos; + } + } for (QTextBlock block = startBlock; block != endBlock; block = block.next()) { if (doSingleLineStyleUncomment) { QString text = block.text(); int i = 0; while (i <= text.size() - singleLineLength) { - if (isComment(text, i, definition.singleLine)) { + if (definition.isAfterWhitespace + && isComment(text, i, definition.singleLine + ' ')) { + cursor.setPosition(block.position() + i); + cursor.movePosition(QTextCursor::NextCharacter, + QTextCursor::KeepAnchor, + singleLineLength + 1); + cursor.removeSelectedText(); + break; + } else if (isComment(text, i, definition.singleLine)) { cursor.setPosition(block.position() + i); cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, @@ -197,11 +219,13 @@ QTextCursor unCommentSelection(const QTextCursor &cursorIn, const QString text = block.text(); for (QChar c : text) { if (!c.isSpace()) { - if (definition.isAfterWhiteSpaces) - cursor.setPosition(block.position() + text.indexOf(c)); - else + if (definition.isAfterWhitespace) { + cursor.setPosition(block.position() + minTab); + cursor.insertText(definition.singleLine + ' '); + } else { cursor.setPosition(block.position()); - cursor.insertText(definition.singleLine); + cursor.insertText(definition.singleLine); + } break; } } diff --git a/src/libs/utils/uncommentselection.h b/src/libs/utils/uncommentselection.h index a309b028aa4..b6836ec5101 100644 --- a/src/libs/utils/uncommentselection.h +++ b/src/libs/utils/uncommentselection.h @@ -31,7 +31,7 @@ public: bool hasMultiLineStyle() const; public: - bool isAfterWhiteSpaces = false; + bool isAfterWhitespace = false; QString singleLine; QString multiLineStart; QString multiLineEnd; diff --git a/src/plugins/texteditor/behaviorsettingswidget.cpp b/src/plugins/texteditor/behaviorsettingswidget.cpp index 144afa6eb23..2a457596cad 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.cpp +++ b/src/plugins/texteditor/behaviorsettingswidget.cpp @@ -38,6 +38,7 @@ struct BehaviorSettingsWidgetPrivate QComboBox *smartBackspaceBehavior; QCheckBox *autoIndent; QCheckBox *preferSingleLineComments; + QCheckBox *preferAfterWhitespaceComments; QGroupBox *groupBoxStorageSettings; QGroupBox *groupBoxTyping; QCheckBox *skipTrailingWhitespace; @@ -95,6 +96,7 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent) d->autoIndent = new QCheckBox(Tr::tr("Enable automatic &indentation")); d->preferSingleLineComments = new QCheckBox(Tr::tr("Prefer single line comments")); + d->preferAfterWhitespaceComments = new QCheckBox(Tr::tr("Prefer comments after whitespace")); d->skipTrailingWhitespace = new QCheckBox(Tr::tr("Skip clean whitespace for file types:")); d->skipTrailingWhitespace->setToolTip(Tr::tr("For the file patterns listed, do not trim trailing whitespace.")); @@ -173,7 +175,8 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent) indent(d->smartBackspaceBehavior), Tr::tr("Tab key performs auto-indent:"), indent(d->tabKeyBehavior), - d->preferSingleLineComments + d->preferSingleLineComments, + d->preferAfterWhitespaceComments }.attachTo(d->groupBoxTyping); Column { @@ -293,6 +296,7 @@ void BehaviorSettingsWidget::setAssignedTypingSettings(const TypingSettings &typ d->tabKeyBehavior->setCurrentIndex(typingSettings.m_tabKeyBehavior); d->preferSingleLineComments->setChecked(typingSettings.m_preferSingleLineComments); + d->preferAfterWhitespaceComments->setChecked(typingSettings.m_preferAfterWhitespaceComments); } void BehaviorSettingsWidget::assignedTypingSettings(TypingSettings *typingSettings) const @@ -304,6 +308,7 @@ void BehaviorSettingsWidget::assignedTypingSettings(TypingSettings *typingSettin (TypingSettings::TabKeyBehavior)(d->tabKeyBehavior->currentIndex()); typingSettings->m_preferSingleLineComments = d->preferSingleLineComments->isChecked(); + typingSettings->m_preferAfterWhitespaceComments = d->preferAfterWhitespaceComments->isChecked(); } void BehaviorSettingsWidget::setAssignedStorageSettings(const StorageSettings &storageSettings) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 6cf2221da7b..6bd50ef2bdb 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -7698,8 +7698,10 @@ void TextEditorWidget::rewrapParagraph() void TextEditorWidget::unCommentSelection() { const bool singleLine = d->m_document->typingSettings().m_preferSingleLineComments; + CommentDefinition commentDefinition = d->m_commentDefinition; + commentDefinition.isAfterWhitespace = d->m_document->typingSettings().m_preferAfterWhitespaceComments; const MultiTextCursor cursor = Utils::unCommentSelection(multiTextCursor(), - d->m_commentDefinition, + commentDefinition, singleLine); setMultiTextCursor(cursor); } diff --git a/src/plugins/texteditor/typingsettings.cpp b/src/plugins/texteditor/typingsettings.cpp index 731f922a9dd..11c444a6986 100644 --- a/src/plugins/texteditor/typingsettings.cpp +++ b/src/plugins/texteditor/typingsettings.cpp @@ -12,6 +12,7 @@ static const char autoIndentKey[] = "AutoIndent"; static const char tabKeyBehaviorKey[] = "TabKeyBehavior"; static const char smartBackspaceBehaviorKey[] = "SmartBackspaceBehavior"; static const char preferSingleLineCommentsKey[] = "PreferSingleLineComments"; +static const char preferAfterWhitespaceCommentsKey[] = "PreferAfterWhitespaceComments"; using namespace Utils; @@ -31,7 +32,8 @@ Store TypingSettings::toMap() const {autoIndentKey, m_autoIndent}, {tabKeyBehaviorKey, m_tabKeyBehavior}, {smartBackspaceBehaviorKey, m_smartBackspaceBehavior}, - {preferSingleLineCommentsKey, m_preferSingleLineComments} + {preferSingleLineCommentsKey, m_preferSingleLineComments}, + {preferAfterWhitespaceCommentsKey, m_preferAfterWhitespaceComments} }; } @@ -43,6 +45,8 @@ void TypingSettings::fromMap(const Store &map) smartBackspaceBehaviorKey, m_smartBackspaceBehavior).toInt(); m_preferSingleLineComments = map.value(preferSingleLineCommentsKey, m_preferSingleLineComments).toBool(); + m_preferAfterWhitespaceComments = + map.value(preferAfterWhitespaceCommentsKey, m_preferAfterWhitespaceComments).toBool(); } bool TypingSettings::equals(const TypingSettings &ts) const @@ -50,7 +54,8 @@ bool TypingSettings::equals(const TypingSettings &ts) const return m_autoIndent == ts.m_autoIndent && m_tabKeyBehavior == ts.m_tabKeyBehavior && m_smartBackspaceBehavior == ts.m_smartBackspaceBehavior - && m_preferSingleLineComments == ts.m_preferSingleLineComments; + && m_preferSingleLineComments == ts.m_preferSingleLineComments + && m_preferAfterWhitespaceComments == ts.m_preferAfterWhitespaceComments; } bool TypingSettings::tabShouldIndent(const QTextDocument *document, diff --git a/src/plugins/texteditor/typingsettings.h b/src/plugins/texteditor/typingsettings.h index 03d48610f39..f3282308675 100644 --- a/src/plugins/texteditor/typingsettings.h +++ b/src/plugins/texteditor/typingsettings.h @@ -48,6 +48,7 @@ public: SmartBackspaceBehavior m_smartBackspaceBehavior; bool m_preferSingleLineComments; + bool m_preferAfterWhitespaceComments = false; }; } // namespace TextEditor From 673bcb644c6041cb2893bf11d3da8f13479246cc Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Date: Sun, 10 Sep 2023 23:03:00 +0900 Subject: [PATCH 1085/1777] Markdown: Add some tool button to help writing markdown This allows users to add operator wrapping selected text easily. Change-Id: If3c21fa41e0dc338a3ec760076406fe046e5adbe Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/texteditor/markdowneditor.cpp | 95 +++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/src/plugins/texteditor/markdowneditor.cpp b/src/plugins/texteditor/markdowneditor.cpp index fdde77e9dbd..6a168294ae6 100644 --- a/src/plugins/texteditor/markdowneditor.cpp +++ b/src/plugins/texteditor/markdowneditor.cpp @@ -13,6 +13,7 @@ #include <coreplugin/icore.h> #include <coreplugin/minisplitter.h> #include <utils/stringutils.h> +#include <utils/utilsicons.h> #include <QHBoxLayout> #include <QScrollBar> @@ -99,6 +100,58 @@ public: m_toggleEditorVisible->setChecked(showEditor); m_textEditorWidget->setVisible(showEditor); + auto button = new QToolButton; + button->setText("i"); + button->setFont([button]{ auto f = button->font(); f.setItalic(true); return f; }()); + button->setToolTip(Tr::tr("Emphasis")); + connect(button, &QToolButton::clicked, this, [this] { + triggerFormatingAction([](QString *selectedText) { + *selectedText = QStringLiteral("*%1*").arg(*selectedText); + }); + }); + m_markDownButtons.append(button); + button = new QToolButton; + button->setText("b"); + button->setFont([button]{ auto f = button->font(); f.setBold(true); return f; }()); + button->setToolTip(Tr::tr("Strong")); + connect(button, &QToolButton::clicked, this, [this] { + triggerFormatingAction([](QString *selectedText) { + *selectedText = QStringLiteral("**%1**").arg(*selectedText); + }); + }); + m_markDownButtons.append(button); + button = new QToolButton; + button->setText("`"); + button->setToolTip(Tr::tr("Inline Code")); + connect(button, &QToolButton::clicked, this, [this] { + triggerFormatingAction([](QString *selectedText) { + *selectedText = QStringLiteral("`%1`").arg(*selectedText); + }); + }); + m_markDownButtons.append(button); + button = new QToolButton; + button->setIcon(Utils::Icons::LINK_TOOLBAR.icon()); + button->setToolTip(Tr::tr("Hyper Link")); + connect(button, &QToolButton::clicked, this, [this] { + triggerFormatingAction([](QString *selectedText, int *cursorOffset, int *selectionLength) { + *selectedText = QStringLiteral("[%1](https://)").arg(*selectedText); + *cursorOffset = -1; + *selectionLength = -8; + }); + }); + m_markDownButtons.append(button); + for (auto button : m_markDownButtons) { + button->setEnabled(!m_textEditorWidget->selectedText().isEmpty()); + // do not call setVisible(true) at this point, this destroys the hover effect on macOS + if (!showEditor) + button->setVisible(false); + } + connect(m_textEditorWidget, &QPlainTextEdit::copyAvailable, [this](bool yes) { + for (auto button : m_markDownButtons) { + button->setEnabled(yes); + } + }); + auto swapViews = new QToolButton; swapViews->setText(Tr::tr("Swap Views")); swapViews->setEnabled(showEditor && showPreview); @@ -106,6 +159,8 @@ public: m_toolbarLayout = new QHBoxLayout(&m_toolbar); m_toolbarLayout->setSpacing(0); m_toolbarLayout->setContentsMargins(0, 0, 0, 0); + for (auto button : m_markDownButtons) + m_toolbarLayout->addWidget(button); m_toolbarLayout->addStretch(); m_toolbarLayout->addWidget(m_togglePreviewVisible); m_toolbarLayout->addWidget(m_toggleEditorVisible); @@ -165,6 +220,8 @@ public: visible, m_previewWidget, m_togglePreviewVisible); + for (auto button : m_markDownButtons) + button->setVisible(visible); saveViewSettings(); }); connect(m_togglePreviewVisible, @@ -299,6 +356,43 @@ public: m_toggleEditorVisible->setChecked(textEditorShown || !previewShown); } +private: + void triggerFormatingAction(std::function<void(QString *selectedText)> action) + { + auto formattedText = m_textEditorWidget->selectedText(); + action(&formattedText); + format(formattedText); + } + void triggerFormatingAction(std::function<void(QString *selectedText, int *cursorOffset, int *selectionLength)> action) + { + auto formattedText = m_textEditorWidget->selectedText(); + int cursorOffset = 0; + int selectionLength = 0; + action(&formattedText, &cursorOffset, &selectionLength); + format(formattedText, cursorOffset, selectionLength); + } + void format(const QString &formattedText, int cursorOffset = 0, int selectionLength = 0) + { + auto cursor = m_textEditorWidget->textCursor(); + int start = cursor.selectionStart(); + int end = cursor.selectionEnd(); + cursor.setPosition(start, QTextCursor::MoveAnchor); + cursor.setPosition(end, QTextCursor::KeepAnchor); + + cursor.insertText(formattedText); + if (cursorOffset != 0) { + auto pos = cursor.position(); + cursor.setPosition(pos + cursorOffset); + m_textEditorWidget->setTextCursor(cursor); + } + + if (selectionLength != 0) { + cursor.setPosition(cursor.position(), QTextCursor::MoveAnchor); + cursor.setPosition(cursor.position() + selectionLength, QTextCursor::KeepAnchor); + m_textEditorWidget->setTextCursor(cursor); + } + } + private: QTimer m_previewTimer; bool m_performDelayedUpdate = false; @@ -308,6 +402,7 @@ private: TextDocumentPtr m_document; QWidget m_toolbar; QHBoxLayout *m_toolbarLayout; + QList<QToolButton *> m_markDownButtons; QToolButton *m_toggleEditorVisible; QToolButton *m_togglePreviewVisible; std::optional<QPoint> m_previewRestoreScrollPosition; From a7bbb986dd34ed7242ff60503e0559a9ef28fd0d Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 13 Sep 2023 12:16:38 +0200 Subject: [PATCH 1086/1777] ScreenRecorder: Explicitly include <QAction> ... assuming that otherwise a build with Qt 6.2 fails Amends: 9c036fe39393d8a5c5843ac673267dd2b398fe7f Change-Id: I6ed7a25ca8d50ef5283cdc16963aa79dfaef6749 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/screenrecorder/cropandtrim.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp index c6c35560ea1..6df5ce02807 100644 --- a/src/plugins/screenrecorder/cropandtrim.cpp +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -17,6 +17,7 @@ #include <coreplugin/icore.h> +#include <QAction> #include <QClipboard> #include <QDialog> #include <QDialogButtonBox> From c816a9b523515a7f0f719e669ab54d3cfdb5c414 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 14 Sep 2023 08:22:23 +0200 Subject: [PATCH 1087/1777] qbs build: Remove unneeded Project items Also update type descriptions. Change-Id: I2b7d8814913cfb72cb8280601338ab763d8fabe6 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../qml-type-descriptions/qbs-bundle.json | 1 + src/libs/3rdparty/libptyqt/ptyqt.qbs | 66 +- src/libs/3rdparty/libvterm/vterm.qbs | 56 +- src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs | 198 ++-- src/libs/aggregation/aggregation.qbs | 21 +- src/libs/cplusplus/cplusplus.qbs | 250 +++-- src/libs/extensionsystem/extensionsystem.qbs | 72 +- .../languageserverprotocol.qbs | 96 +- src/libs/languageutils/languageutils.qbs | 26 +- src/libs/qmldebug/qmldebug.qbs | 66 +- src/libs/qmljs/qmljs.qbs | 150 ++- src/libs/tracing/tracing.qbs | 88 +- src/libs/utils/utils.qbs | 910 +++++++++--------- src/plugins/android/android.qbs | 234 +++-- src/plugins/coreplugin/coreplugin.qbs | 742 +++++++------- src/plugins/debugger/debugger.qbs | 521 +++++----- src/plugins/help/help.qbs | 146 ++- .../projectexplorer/projectexplorer.qbs | 484 +++++----- .../qmakeprojectmanager.qbs | 154 ++- src/plugins/qtsupport/qtsupport.qbs | 218 ++--- src/plugins/remotelinux/remotelinux.qbs | 134 ++- src/plugins/resourceeditor/resourceeditor.qbs | 59 +- src/plugins/texteditor/texteditor.qbs | 439 +++++---- 23 files changed, 2519 insertions(+), 2612 deletions(-) diff --git a/share/qtcreator/qml-type-descriptions/qbs-bundle.json b/share/qtcreator/qml-type-descriptions/qbs-bundle.json index 7f0c6886911..9b2f233a4c3 100644 --- a/share/qtcreator/qml-type-descriptions/qbs-bundle.json +++ b/share/qtcreator/qml-type-descriptions/qbs-bundle.json @@ -17,6 +17,7 @@ "qbs.Environment", "qbs.File", "qbs.FileInfo", + "qbs.Host", "qbs.ModUtils", "qbs.PathTools", "qbs.PkgConfig", diff --git a/src/libs/3rdparty/libptyqt/ptyqt.qbs b/src/libs/3rdparty/libptyqt/ptyqt.qbs index 7ff4da9f560..40c920a59ce 100644 --- a/src/libs/3rdparty/libptyqt/ptyqt.qbs +++ b/src/libs/3rdparty/libptyqt/ptyqt.qbs @@ -1,45 +1,41 @@ -import qbs - -Project { +QtcLibrary { name: "ptyqt" - QtcLibrary { - Depends { name: "Qt.core" } - Depends { name: "Qt.network"; condition: qbs.targetOS.contains("windows") } - Depends { name: "winpty"; condition: qbs.targetOS.contains("windows") } + Depends { name: "Qt.core" } + Depends { name: "Qt.network"; condition: qbs.targetOS.contains("windows") } + Depends { name: "winpty"; condition: qbs.targetOS.contains("windows") } - type: "staticlibrary" + type: "staticlibrary" + files: [ + "iptyprocess.h", + "ptyqt.cpp", + "ptyqt.h", + ] + + Group { + name: "ptyqt UNIX files" + condition: qbs.targetOS.contains("unix") files: [ - "iptyprocess.h", - "ptyqt.cpp", - "ptyqt.h", + "unixptyprocess.cpp", + "unixptyprocess.h", ] + } - Group { - name: "ptyqt UNIX files" - condition: qbs.targetOS.contains("unix") - files: [ - "unixptyprocess.cpp", - "unixptyprocess.h", - ] - } + Group { + name: "ptyqt Windows files" + condition: qbs.targetOS.contains("windows") + files: [ + "conptyprocess.cpp", + "conptyprocess.h", + "winptyprocess.cpp", + "winptyprocess.h", + ] + } - Group { - name: "ptyqt Windows files" - condition: qbs.targetOS.contains("windows") - files: [ - "conptyprocess.cpp", - "conptyprocess.h", - "winptyprocess.cpp", - "winptyprocess.h", - ] - } - - Export { - Depends { name: "cpp" } - Depends { name: "winpty"; condition: qbs.targetOS.contains("windows") } - cpp.includePaths: base.concat(exportingProduct.sourceDirectory) - } + Export { + Depends { name: "cpp" } + Depends { name: "winpty"; condition: qbs.targetOS.contains("windows") } + cpp.includePaths: base.concat(exportingProduct.sourceDirectory) } } diff --git a/src/libs/3rdparty/libvterm/vterm.qbs b/src/libs/3rdparty/libvterm/vterm.qbs index 18ccb638aab..a1525879f53 100644 --- a/src/libs/3rdparty/libvterm/vterm.qbs +++ b/src/libs/3rdparty/libvterm/vterm.qbs @@ -1,34 +1,32 @@ -Project { - QtcLibrary { - name: "vterm" - type: "staticlibrary" +QtcLibrary { + name: "vterm" + type: "staticlibrary" + Depends { name: "cpp" } + cpp.includePaths: base.concat("include") + cpp.warningLevel: "none" + + Group { + prefix: "src/" + files: [ + "encoding.c", + "fullwidth.inc", + "keyboard.c", + "mouse.c", + "parser.c", + "pen.c", + "rect.h", + "screen.c", + "state.c", + "unicode.c", + "utf8.h", + "vterm.c", + "vterm_internal.h", + ] + } + + Export { Depends { name: "cpp" } cpp.includePaths: base.concat("include") - cpp.warningLevel: "none" - - Group { - prefix: "src/" - files: [ - "encoding.c", - "fullwidth.inc", - "keyboard.c", - "mouse.c", - "parser.c", - "pen.c", - "rect.h", - "screen.c", - "state.c", - "unicode.c", - "utf8.h", - "vterm.c", - "vterm_internal.h", - ] - } - - Export { - Depends { name: "cpp" } - cpp.includePaths: base.concat("include") - } } } diff --git a/src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs b/src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs index 8685f6842d5..acf111798f7 100644 --- a/src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs +++ b/src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs @@ -1,106 +1,102 @@ -import qbs 1.0 +QtcLibrary { + name: "yaml-cpp" -Project { - QtcLibrary { - name: "yaml-cpp" + cpp.defines: base.concat(["YAML_CPP_DLL", "yaml_cpp_EXPORTS"]) + cpp.includePaths: [product.sourceDirectory + "/include/"] - cpp.defines: base.concat(["YAML_CPP_DLL", "yaml_cpp_EXPORTS"]) - cpp.includePaths: [product.sourceDirectory + "/include/"] + files: [ + "include/yaml-cpp/anchor.h", + "include/yaml-cpp/binary.h", + "include/yaml-cpp/depthguard.h", + "include/yaml-cpp/dll.h", + "include/yaml-cpp/emitfromevents.h", + "include/yaml-cpp/emitter.h", + "include/yaml-cpp/emitterdef.h", + "include/yaml-cpp/emittermanip.h", + "include/yaml-cpp/emitterstyle.h", + "include/yaml-cpp/eventhandler.h", + "include/yaml-cpp/exceptions.h", + "include/yaml-cpp/mark.h", + "include/yaml-cpp/noexcept.h", + "include/yaml-cpp/node", + "include/yaml-cpp/node/convert.h", + "include/yaml-cpp/node/detail", + "include/yaml-cpp/node/detail/impl.h", + "include/yaml-cpp/node/detail/iterator.h", + "include/yaml-cpp/node/detail/iterator_fwd.h", + "include/yaml-cpp/node/detail/memory.h", + "include/yaml-cpp/node/detail/node.h", + "include/yaml-cpp/node/detail/node_data.h", + "include/yaml-cpp/node/detail/node_iterator.h", + "include/yaml-cpp/node/detail/node_ref.h", + "include/yaml-cpp/node/emit.h", + "include/yaml-cpp/node/impl.h", + "include/yaml-cpp/node/iterator.h", + "include/yaml-cpp/node/node.h", + "include/yaml-cpp/node/parse.h", + "include/yaml-cpp/node/ptr.h", + "include/yaml-cpp/node/type.h", + "include/yaml-cpp/null.h", + "include/yaml-cpp/ostream_wrapper.h", + "include/yaml-cpp/parser.h", + "include/yaml-cpp/stlemitter.h", + "include/yaml-cpp/traits.h", + "include/yaml-cpp/yaml.h", + "src/binary.cpp", + "src/collectionstack.h", + "src/convert.cpp", + "src/depthguard.cpp", + "src/directives.cpp", + "src/directives.h", + "src/emit.cpp", + "src/emitfromevents.cpp", + "src/emitter.cpp", + "src/emitterstate.cpp", + "src/emitterstate.h", + "src/emitterutils.cpp", + "src/emitterutils.h", + "src/exceptions.cpp", + "src/exp.cpp", + "src/exp.h", + "src/indentation.h", + "src/memory.cpp", + "src/node.cpp", + "src/node_data.cpp", + "src/nodebuilder.cpp", + "src/nodebuilder.h", + "src/nodeevents.cpp", + "src/nodeevents.h", + "src/null.cpp", + "src/ostream_wrapper.cpp", + "src/parse.cpp", + "src/parser.cpp", + "src/ptr_vector.h", + "src/regex_yaml.cpp", + "src/regex_yaml.h", + "src/regeximpl.h", + "src/scanner.cpp", + "src/scanner.h", + "src/scanscalar.cpp", + "src/scanscalar.h", + "src/scantag.cpp", + "src/scantag.h", + "src/scantoken.cpp", + "src/setting.h", + "src/simplekey.cpp", + "src/singledocparser.cpp", + "src/singledocparser.h", + "src/stream.cpp", + "src/stream.h", + "src/streamcharsource.h", + "src/stringsource.h", + "src/tag.cpp", + "src/tag.h", + "src/token.h", + ] - files: [ - "include/yaml-cpp/anchor.h", - "include/yaml-cpp/binary.h", - "include/yaml-cpp/depthguard.h", - "include/yaml-cpp/dll.h", - "include/yaml-cpp/emitfromevents.h", - "include/yaml-cpp/emitter.h", - "include/yaml-cpp/emitterdef.h", - "include/yaml-cpp/emittermanip.h", - "include/yaml-cpp/emitterstyle.h", - "include/yaml-cpp/eventhandler.h", - "include/yaml-cpp/exceptions.h", - "include/yaml-cpp/mark.h", - "include/yaml-cpp/noexcept.h", - "include/yaml-cpp/node", - "include/yaml-cpp/node/convert.h", - "include/yaml-cpp/node/detail", - "include/yaml-cpp/node/detail/impl.h", - "include/yaml-cpp/node/detail/iterator.h", - "include/yaml-cpp/node/detail/iterator_fwd.h", - "include/yaml-cpp/node/detail/memory.h", - "include/yaml-cpp/node/detail/node.h", - "include/yaml-cpp/node/detail/node_data.h", - "include/yaml-cpp/node/detail/node_iterator.h", - "include/yaml-cpp/node/detail/node_ref.h", - "include/yaml-cpp/node/emit.h", - "include/yaml-cpp/node/impl.h", - "include/yaml-cpp/node/iterator.h", - "include/yaml-cpp/node/node.h", - "include/yaml-cpp/node/parse.h", - "include/yaml-cpp/node/ptr.h", - "include/yaml-cpp/node/type.h", - "include/yaml-cpp/null.h", - "include/yaml-cpp/ostream_wrapper.h", - "include/yaml-cpp/parser.h", - "include/yaml-cpp/stlemitter.h", - "include/yaml-cpp/traits.h", - "include/yaml-cpp/yaml.h", - "src/binary.cpp", - "src/collectionstack.h", - "src/convert.cpp", - "src/depthguard.cpp", - "src/directives.cpp", - "src/directives.h", - "src/emit.cpp", - "src/emitfromevents.cpp", - "src/emitter.cpp", - "src/emitterstate.cpp", - "src/emitterstate.h", - "src/emitterutils.cpp", - "src/emitterutils.h", - "src/exceptions.cpp", - "src/exp.cpp", - "src/exp.h", - "src/indentation.h", - "src/memory.cpp", - "src/node.cpp", - "src/node_data.cpp", - "src/nodebuilder.cpp", - "src/nodebuilder.h", - "src/nodeevents.cpp", - "src/nodeevents.h", - "src/null.cpp", - "src/ostream_wrapper.cpp", - "src/parse.cpp", - "src/parser.cpp", - "src/ptr_vector.h", - "src/regex_yaml.cpp", - "src/regex_yaml.h", - "src/regeximpl.h", - "src/scanner.cpp", - "src/scanner.h", - "src/scanscalar.cpp", - "src/scanscalar.h", - "src/scantag.cpp", - "src/scantag.h", - "src/scantoken.cpp", - "src/setting.h", - "src/simplekey.cpp", - "src/singledocparser.cpp", - "src/singledocparser.h", - "src/stream.cpp", - "src/stream.h", - "src/streamcharsource.h", - "src/stringsource.h", - "src/tag.cpp", - "src/tag.h", - "src/token.h", - ] - - Export { - Depends { name: "cpp" } - cpp.includePaths: [exportingProduct.sourceDirectory + "/include/"] - cpp.defines: base.concat(["YAML_CPP_DLL"]) - } + Export { + Depends { name: "cpp" } + cpp.includePaths: [exportingProduct.sourceDirectory + "/include/"] + cpp.defines: base.concat(["YAML_CPP_DLL"]) } } diff --git a/src/libs/aggregation/aggregation.qbs b/src/libs/aggregation/aggregation.qbs index d8f1097f756..873294e92f5 100644 --- a/src/libs/aggregation/aggregation.qbs +++ b/src/libs/aggregation/aggregation.qbs @@ -1,17 +1,12 @@ -import qbs 1.0 - -Project { +QtcLibrary { name: "Aggregation" + Depends { name: "Qt.core" } + cpp.defines: base.concat("AGGREGATION_LIBRARY") - QtcLibrary { - Depends { name: "Qt.core" } - cpp.defines: base.concat("AGGREGATION_LIBRARY") - - files: [ - "aggregate.cpp", - "aggregate.h", - "aggregation_global.h", - ] - } + files: [ + "aggregate.cpp", + "aggregate.h", + "aggregation_global.h", + ] } diff --git a/src/libs/cplusplus/cplusplus.qbs b/src/libs/cplusplus/cplusplus.qbs index b774618f75c..7e230504530 100644 --- a/src/libs/cplusplus/cplusplus.qbs +++ b/src/libs/cplusplus/cplusplus.qbs @@ -1,135 +1,131 @@ -import qbs 1.0 - -Project { +QtcLibrary { name: "CPlusPlus" - QtcLibrary { - cpp.includePaths: base.concat("../3rdparty") - cpp.defines: base.concat([ - "NDEBUG", - "CPLUSPLUS_BUILD_LIB" - ]) - cpp.optimization: "fast" + cpp.includePaths: base.concat("../3rdparty") + cpp.defines: base.concat([ + "NDEBUG", + "CPLUSPLUS_BUILD_LIB" + ]) + cpp.optimization: "fast" - Depends { name: "Qt.widgets" } - Depends { name: "Utils" } + Depends { name: "Qt.widgets" } + Depends { name: "Utils" } - Group { - name: "ThirdPartyCPlusPlus" - prefix: "../3rdparty/cplusplus/" - files: [ - "AST.cpp", - "AST.h", - "ASTClone.cpp", - "ASTMatch0.cpp", - "ASTMatcher.cpp", - "ASTMatcher.h", - "ASTPatternBuilder.h", - "ASTVisit.cpp", - "ASTVisitor.cpp", - "ASTVisitor.h", - "ASTfwd.h", - "Bind.cpp", - "Bind.h", - "CPlusPlus.h", - "Control.cpp", - "Control.h", - "CoreTypes.cpp", - "CoreTypes.h", - "DiagnosticClient.cpp", - "DiagnosticClient.h", - "FullySpecifiedType.cpp", - "FullySpecifiedType.h", - "Keywords.cpp", - "Keywords.kwgen", - "Lexer.cpp", - "Lexer.h", - "LiteralTable.h", - "Literals.cpp", - "Literals.h", - "Matcher.cpp", - "Matcher.h", - "MemoryPool.cpp", - "MemoryPool.h", - "Name.cpp", - "Name.h", - "NameVisitor.cpp", - "NameVisitor.h", - "Names.cpp", - "Names.h", - "ObjectiveCAtKeywords.cpp", - "ObjectiveCTypeQualifiers.cpp", - "ObjectiveCTypeQualifiers.h", - "Parser.cpp", - "Parser.h", - "QtContextKeywords.cpp", - "QtContextKeywords.h", - "SafeMatcher.cpp", - "SafeMatcher.h", - "Scope.cpp", - "Scope.h", - "Symbol.cpp", - "Symbol.h", - "SymbolVisitor.h", - "Symbols.cpp", - "Symbols.h", - "Templates.cpp", - "Templates.h", - "Token.cpp", - "Token.h", - "TranslationUnit.cpp", - "TranslationUnit.h", - "Type.cpp", - "Type.h", - "TypeVisitor.cpp", - "TypeVisitor.h", - ] - } + Group { + name: "ThirdPartyCPlusPlus" + prefix: "../3rdparty/cplusplus/" + files: [ + "AST.cpp", + "AST.h", + "ASTClone.cpp", + "ASTMatch0.cpp", + "ASTMatcher.cpp", + "ASTMatcher.h", + "ASTPatternBuilder.h", + "ASTVisit.cpp", + "ASTVisitor.cpp", + "ASTVisitor.h", + "ASTfwd.h", + "Bind.cpp", + "Bind.h", + "CPlusPlus.h", + "Control.cpp", + "Control.h", + "CoreTypes.cpp", + "CoreTypes.h", + "DiagnosticClient.cpp", + "DiagnosticClient.h", + "FullySpecifiedType.cpp", + "FullySpecifiedType.h", + "Keywords.cpp", + "Keywords.kwgen", + "Lexer.cpp", + "Lexer.h", + "LiteralTable.h", + "Literals.cpp", + "Literals.h", + "Matcher.cpp", + "Matcher.h", + "MemoryPool.cpp", + "MemoryPool.h", + "Name.cpp", + "Name.h", + "NameVisitor.cpp", + "NameVisitor.h", + "Names.cpp", + "Names.h", + "ObjectiveCAtKeywords.cpp", + "ObjectiveCTypeQualifiers.cpp", + "ObjectiveCTypeQualifiers.h", + "Parser.cpp", + "Parser.h", + "QtContextKeywords.cpp", + "QtContextKeywords.h", + "SafeMatcher.cpp", + "SafeMatcher.h", + "Scope.cpp", + "Scope.h", + "Symbol.cpp", + "Symbol.h", + "SymbolVisitor.h", + "Symbols.cpp", + "Symbols.h", + "Templates.cpp", + "Templates.h", + "Token.cpp", + "Token.h", + "TranslationUnit.cpp", + "TranslationUnit.h", + "Type.cpp", + "Type.h", + "TypeVisitor.cpp", + "TypeVisitor.h", + ] + } - Group { - name: "General" - files: [ - "AlreadyConsideredClassContainer.h", - "ASTParent.cpp", "ASTParent.h", - "ASTPath.cpp", "ASTPath.h", - "BackwardsScanner.cpp", "BackwardsScanner.h", - "CppDocument.cpp", "CppDocument.h", - "CppRewriter.cpp", "CppRewriter.h", - "cppmodelmanagerbase.cpp", "cppmodelmanagerbase.h", - "declarationcomments.cpp", "declarationcomments.h", - "DependencyTable.cpp", "DependencyTable.h", - "DeprecatedGenTemplateInstance.cpp", "DeprecatedGenTemplateInstance.h", - "ExpressionUnderCursor.cpp", "ExpressionUnderCursor.h", - "FastPreprocessor.cpp", "FastPreprocessor.h", - "FindUsages.cpp", "FindUsages.h", - "Icons.cpp", "Icons.h", - "LookupContext.cpp", "LookupContext.h", - "LookupItem.cpp", "LookupItem.h", - "Macro.cpp", "Macro.h", - "MatchingText.cpp", "MatchingText.h", - "NamePrettyPrinter.cpp", "NamePrettyPrinter.h", - "Overview.cpp", "Overview.h", - "PPToken.cpp", "PPToken.h", - "PreprocessorClient.cpp", "PreprocessorClient.h", - "PreprocessorEnvironment.cpp", "PreprocessorEnvironment.h", - "ResolveExpression.cpp", "ResolveExpression.h", - "SimpleLexer.cpp", "SimpleLexer.h", - "SnapshotSymbolVisitor.cpp", "SnapshotSymbolVisitor.h", - "SymbolNameVisitor.cpp", "SymbolNameVisitor.h", - "TypeOfExpression.cpp", "TypeOfExpression.h", - "TypePrettyPrinter.cpp", "TypePrettyPrinter.h", - "findcdbbreakpoint.cpp", "findcdbbreakpoint.h", - "pp-cctype.h", - "pp-engine.cpp", "pp-engine.h", - "pp-scanner.cpp", "pp-scanner.h", - "pp.h", - ] - } + Group { + name: "General" + files: [ + "AlreadyConsideredClassContainer.h", + "ASTParent.cpp", "ASTParent.h", + "ASTPath.cpp", "ASTPath.h", + "BackwardsScanner.cpp", "BackwardsScanner.h", + "CppDocument.cpp", "CppDocument.h", + "CppRewriter.cpp", "CppRewriter.h", + "cppmodelmanagerbase.cpp", "cppmodelmanagerbase.h", + "declarationcomments.cpp", "declarationcomments.h", + "DependencyTable.cpp", "DependencyTable.h", + "DeprecatedGenTemplateInstance.cpp", "DeprecatedGenTemplateInstance.h", + "ExpressionUnderCursor.cpp", "ExpressionUnderCursor.h", + "FastPreprocessor.cpp", "FastPreprocessor.h", + "FindUsages.cpp", "FindUsages.h", + "Icons.cpp", "Icons.h", + "LookupContext.cpp", "LookupContext.h", + "LookupItem.cpp", "LookupItem.h", + "Macro.cpp", "Macro.h", + "MatchingText.cpp", "MatchingText.h", + "NamePrettyPrinter.cpp", "NamePrettyPrinter.h", + "Overview.cpp", "Overview.h", + "PPToken.cpp", "PPToken.h", + "PreprocessorClient.cpp", "PreprocessorClient.h", + "PreprocessorEnvironment.cpp", "PreprocessorEnvironment.h", + "ResolveExpression.cpp", "ResolveExpression.h", + "SimpleLexer.cpp", "SimpleLexer.h", + "SnapshotSymbolVisitor.cpp", "SnapshotSymbolVisitor.h", + "SymbolNameVisitor.cpp", "SymbolNameVisitor.h", + "TypeOfExpression.cpp", "TypeOfExpression.h", + "TypePrettyPrinter.cpp", "TypePrettyPrinter.h", + "findcdbbreakpoint.cpp", "findcdbbreakpoint.h", + "pp-cctype.h", + "pp-engine.cpp", "pp-engine.h", + "pp-scanner.cpp", "pp-scanner.h", + "pp.h", + ] + } - Export { - cpp.includePaths: [ - exportingProduct.sourceDirectory + "/../3rdparty" - ] - } + Export { + cpp.includePaths: [ + exportingProduct.sourceDirectory + "/../3rdparty" + ] } } diff --git a/src/libs/extensionsystem/extensionsystem.qbs b/src/libs/extensionsystem/extensionsystem.qbs index 39e8cbc57c6..414060fd3ba 100644 --- a/src/libs/extensionsystem/extensionsystem.qbs +++ b/src/libs/extensionsystem/extensionsystem.qbs @@ -1,45 +1,41 @@ -import qbs 1.0 - -Project { +QtcLibrary { name: "ExtensionSystem" - QtcLibrary { - cpp.defines: base.concat([ - "EXTENSIONSYSTEM_LIBRARY", - "IDE_TEST_DIR=\".\"" - ]) + cpp.defines: base.concat([ + "EXTENSIONSYSTEM_LIBRARY", + "IDE_TEST_DIR=\".\"" + ]) - Depends { name: "Qt"; submodules: ["core", "widgets"] } - Depends { name: "Aggregation" } - Depends { name: "Utils" } + Depends { name: "Qt"; submodules: ["core", "widgets"] } + Depends { name: "Aggregation" } + Depends { name: "Utils" } - files: [ - "extensionsystem_global.h", - "extensionsystemtr.h", - "invoker.cpp", - "invoker.h", - "iplugin.cpp", - "iplugin.h", - "optionsparser.cpp", - "optionsparser.h", - "plugindetailsview.cpp", - "plugindetailsview.h", - "pluginerroroverview.cpp", - "pluginerroroverview.h", - "pluginerrorview.cpp", - "pluginerrorview.h", - "pluginmanager.cpp", - "pluginmanager.h", - "pluginmanager_p.h", - "pluginspec.cpp", - "pluginspec.h", - "pluginspec_p.h", - "pluginview.cpp", - "pluginview.h", - ] + files: [ + "extensionsystem_global.h", + "extensionsystemtr.h", + "invoker.cpp", + "invoker.h", + "iplugin.cpp", + "iplugin.h", + "optionsparser.cpp", + "optionsparser.h", + "plugindetailsview.cpp", + "plugindetailsview.h", + "pluginerroroverview.cpp", + "pluginerroroverview.h", + "pluginerrorview.cpp", + "pluginerrorview.h", + "pluginmanager.cpp", + "pluginmanager.h", + "pluginmanager_p.h", + "pluginspec.cpp", + "pluginspec.h", + "pluginspec_p.h", + "pluginview.cpp", + "pluginview.h", + ] - Export { - Depends { name: "Qt.core" } - } + Export { + Depends { name: "Qt.core" } } } diff --git a/src/libs/languageserverprotocol/languageserverprotocol.qbs b/src/libs/languageserverprotocol/languageserverprotocol.qbs index 163b2d6d4ea..0368ceafee8 100644 --- a/src/libs/languageserverprotocol/languageserverprotocol.qbs +++ b/src/libs/languageserverprotocol/languageserverprotocol.qbs @@ -1,54 +1,50 @@ -import qbs 1.0 - -Project { +QtcLibrary { name: "LanguageServerProtocol" - QtcLibrary { - Depends { name: "Utils" } - cpp.defines: base.concat("LANGUAGESERVERPROTOCOL_LIBRARY") + Depends { name: "Utils" } + cpp.defines: base.concat("LANGUAGESERVERPROTOCOL_LIBRARY") - files: [ - "basemessage.cpp", - "basemessage.h", - "callhierarchy.cpp", - "callhierarchy.h", - "client.cpp", - "client.h", - "clientcapabilities.cpp", - "clientcapabilities.h", - "completion.cpp", - "completion.h", - "diagnostics.cpp", - "diagnostics.h", - "initializemessages.cpp", - "initializemessages.h", - "jsonkeys.h", - "jsonobject.cpp", - "jsonobject.h", - "jsonrpcmessages.cpp", - "jsonrpcmessages.h", - "languagefeatures.cpp", - "languagefeatures.h", - "languageserverprotocol_global.h", - "languageserverprotocoltr.h", - "lsptypes.cpp", - "lsptypes.h", - "lsputils.cpp", - "lsputils.h", - "messages.cpp", - "messages.h", - "progresssupport.cpp", - "progresssupport.h", - "semantictokens.cpp", - "semantictokens.h", - "servercapabilities.cpp", - "servercapabilities.h", - "shutdownmessages.cpp", - "shutdownmessages.h", - "textsynchronization.cpp", - "textsynchronization.h", - "workspace.cpp", - "workspace.h", - ] - } + files: [ + "basemessage.cpp", + "basemessage.h", + "callhierarchy.cpp", + "callhierarchy.h", + "client.cpp", + "client.h", + "clientcapabilities.cpp", + "clientcapabilities.h", + "completion.cpp", + "completion.h", + "diagnostics.cpp", + "diagnostics.h", + "initializemessages.cpp", + "initializemessages.h", + "jsonkeys.h", + "jsonobject.cpp", + "jsonobject.h", + "jsonrpcmessages.cpp", + "jsonrpcmessages.h", + "languagefeatures.cpp", + "languagefeatures.h", + "languageserverprotocol_global.h", + "languageserverprotocoltr.h", + "lsptypes.cpp", + "lsptypes.h", + "lsputils.cpp", + "lsputils.h", + "messages.cpp", + "messages.h", + "progresssupport.cpp", + "progresssupport.h", + "semantictokens.cpp", + "semantictokens.h", + "servercapabilities.cpp", + "servercapabilities.h", + "shutdownmessages.cpp", + "shutdownmessages.h", + "textsynchronization.cpp", + "textsynchronization.h", + "workspace.cpp", + "workspace.h", + ] } diff --git a/src/libs/languageutils/languageutils.qbs b/src/libs/languageutils/languageutils.qbs index 8b5d6a6e8ad..7a4cefd5ff3 100644 --- a/src/libs/languageutils/languageutils.qbs +++ b/src/libs/languageutils/languageutils.qbs @@ -1,20 +1,16 @@ -import qbs 1.0 - -Project { +QtcLibrary { name: "LanguageUtils" - QtcLibrary { - cpp.defines: base.concat(["LANGUAGEUTILS_LIBRARY"]) - cpp.optimization: "fast" + cpp.defines: base.concat(["LANGUAGEUTILS_LIBRARY"]) + cpp.optimization: "fast" - Depends { name: "Qt.core" } + Depends { name: "Qt.core" } - files: [ - "componentversion.cpp", - "componentversion.h", - "fakemetaobject.cpp", - "fakemetaobject.h", - "languageutils_global.h", - ] - } + files: [ + "componentversion.cpp", + "componentversion.h", + "fakemetaobject.cpp", + "fakemetaobject.h", + "languageutils_global.h", + ] } diff --git a/src/libs/qmldebug/qmldebug.qbs b/src/libs/qmldebug/qmldebug.qbs index bad5947682d..387f22b0aa0 100644 --- a/src/libs/qmldebug/qmldebug.qbs +++ b/src/libs/qmldebug/qmldebug.qbs @@ -1,40 +1,36 @@ -import qbs 1.0 - -Project { +QtcLibrary { name: "QmlDebug" - QtcLibrary { - cpp.defines: base.concat("QMLDEBUG_LIBRARY") + cpp.defines: base.concat("QMLDEBUG_LIBRARY") - Depends { name: "Qt"; submodules: ["gui", "network"] } - Depends { name: "Utils" } + Depends { name: "Qt"; submodules: ["gui", "network"] } + Depends { name: "Utils" } - files: [ - "baseenginedebugclient.cpp", - "baseenginedebugclient.h", - "basetoolsclient.cpp", - "basetoolsclient.h", - "qdebugmessageclient.cpp", - "qdebugmessageclient.h", - "qmldebug_global.h", - "qmldebugtr.h", - "qmldebugclient.cpp", - "qmldebugclient.h", - "qmldebugcommandlinearguments.h", - "qmldebugconnection.cpp", - "qmldebugconnection.h", - "qmldebugconnectionmanager.cpp", - "qmldebugconnectionmanager.h", - "qmldebugconstants.h", - "qmlenginecontrolclient.cpp", - "qmlenginecontrolclient.h", - "qmlenginedebugclient.h", - "qmloutputparser.cpp", - "qmloutputparser.h", - "qmltoolsclient.cpp", - "qmltoolsclient.h", - "qpacketprotocol.cpp", - "qpacketprotocol.h", - ] - } + files: [ + "baseenginedebugclient.cpp", + "baseenginedebugclient.h", + "basetoolsclient.cpp", + "basetoolsclient.h", + "qdebugmessageclient.cpp", + "qdebugmessageclient.h", + "qmldebug_global.h", + "qmldebugtr.h", + "qmldebugclient.cpp", + "qmldebugclient.h", + "qmldebugcommandlinearguments.h", + "qmldebugconnection.cpp", + "qmldebugconnection.h", + "qmldebugconnectionmanager.cpp", + "qmldebugconnectionmanager.h", + "qmldebugconstants.h", + "qmlenginecontrolclient.cpp", + "qmlenginecontrolclient.h", + "qmlenginedebugclient.h", + "qmloutputparser.cpp", + "qmloutputparser.h", + "qmltoolsclient.cpp", + "qmltoolsclient.h", + "qpacketprotocol.cpp", + "qpacketprotocol.h", + ] } diff --git a/src/libs/qmljs/qmljs.qbs b/src/libs/qmljs/qmljs.qbs index aa886a8ba2f..18434c83bad 100644 --- a/src/libs/qmljs/qmljs.qbs +++ b/src/libs/qmljs/qmljs.qbs @@ -1,83 +1,79 @@ -import qbs 1.0 - -Project { +QtcLibrary { name: "QmlJS" - QtcLibrary { - cpp.defines: base.concat(["QMLJS_LIBRARY"]) - cpp.optimization: "fast" + cpp.defines: base.concat(["QMLJS_LIBRARY"]) + cpp.optimization: "fast" - Depends { name: "ExtensionSystem" } - Depends { name: "Utils" } - Depends { name: "LanguageUtils" } + Depends { name: "ExtensionSystem" } + Depends { name: "Utils" } + Depends { name: "LanguageUtils" } + Depends { name: "CPlusPlus" } + Depends { name: "Qt"; submodules: ["widgets", "xml"] } + + Group { + name: "General" + files: [ + "jsoncheck.cpp", "jsoncheck.h", + "persistenttrie.cpp", "persistenttrie.h", + "qmljs_global.h", + "qmljsbind.cpp", "qmljsbind.h", + "qmljsbundle.cpp", "qmljsbundle.h", + "qmljscheck.cpp", "qmljscheck.h", + "qmljscodeformatter.cpp", "qmljscodeformatter.h", + "qmljscompletioncontextfinder.cpp", "qmljscompletioncontextfinder.h", + "qmljsconstants.h", + "qmljscontext.cpp", "qmljscontext.h", + "qmljsdocument.cpp", "qmljsdocument.h", + "qmljsevaluate.cpp", "qmljsevaluate.h", + "qmljsfindexportedcpptypes.cpp", "qmljsfindexportedcpptypes.h", + "qmljsicons.cpp", "qmljsicons.h", + "qmljsimportdependencies.cpp", "qmljsimportdependencies.h", + "qmljsindenter.cpp", "qmljsindenter.h", + "qmljsinterpreter.cpp", "qmljsinterpreter.h", + "qmljsdialect.cpp", "qmljsdialect.h", + "qmljslineinfo.cpp", "qmljslineinfo.h", + "qmljslink.cpp", "qmljslink.h", + "qmljsmodelmanagerinterface.cpp", "qmljsmodelmanagerinterface.h", + "qmljsplugindumper.cpp", "qmljsplugindumper.h", + "qmljspropertyreader.cpp", "qmljspropertyreader.h", + "qmljsreformatter.cpp", "qmljsreformatter.h", + "qmljsrewriter.cpp", "qmljsrewriter.h", + "qmljsscanner.cpp", "qmljsscanner.h", + "qmljsscopeastpath.cpp", "qmljsscopeastpath.h", + "qmljsscopebuilder.cpp", "qmljsscopebuilder.h", + "qmljsscopechain.cpp", "qmljsscopechain.h", + "qmljssimplereader.cpp", "qmljssimplereader.h", + "qmljsstaticanalysismessage.cpp", "qmljsstaticanalysismessage.h", + "qmljstr.h", + "qmljstypedescriptionreader.cpp", "qmljstypedescriptionreader.h", + "qmljsutils.cpp", "qmljsutils.h", + "qmljsvalueowner.cpp", "qmljsvalueowner.h", + "qmljsviewercontext.h" + ] + } + + Group { + name: "Parser" + prefix: "parser/" + files: [ + "qmldirparser.cpp", "qmldirparser_p.h", + "qmlimportresolver.cpp", "qmlimportresolver_p.h", + "qmljsast.cpp", "qmljsast_p.h", + "qmljsastfwd_p.h", + "qmljsastvisitor.cpp", "qmljsastvisitor_p.h", + "qmljsengine_p.h", + "qmljsglobal_p.h", + "qmljsgrammar.cpp", "qmljsgrammar_p.h", + "qmljskeywords_p.h", + "qmljslexer.cpp", "qmljslexer_p.h", + "qmljsmemorypool_p.h", + "qmljsparser.cpp", "qmljsparser_p.h", + "qmljssourcelocation_p.h", + ] + } + + Export { Depends { name: "CPlusPlus" } - Depends { name: "Qt"; submodules: ["widgets", "xml"] } - - Group { - name: "General" - files: [ - "jsoncheck.cpp", "jsoncheck.h", - "persistenttrie.cpp", "persistenttrie.h", - "qmljs_global.h", - "qmljsbind.cpp", "qmljsbind.h", - "qmljsbundle.cpp", "qmljsbundle.h", - "qmljscheck.cpp", "qmljscheck.h", - "qmljscodeformatter.cpp", "qmljscodeformatter.h", - "qmljscompletioncontextfinder.cpp", "qmljscompletioncontextfinder.h", - "qmljsconstants.h", - "qmljscontext.cpp", "qmljscontext.h", - "qmljsdocument.cpp", "qmljsdocument.h", - "qmljsevaluate.cpp", "qmljsevaluate.h", - "qmljsfindexportedcpptypes.cpp", "qmljsfindexportedcpptypes.h", - "qmljsicons.cpp", "qmljsicons.h", - "qmljsimportdependencies.cpp", "qmljsimportdependencies.h", - "qmljsindenter.cpp", "qmljsindenter.h", - "qmljsinterpreter.cpp", "qmljsinterpreter.h", - "qmljsdialect.cpp", "qmljsdialect.h", - "qmljslineinfo.cpp", "qmljslineinfo.h", - "qmljslink.cpp", "qmljslink.h", - "qmljsmodelmanagerinterface.cpp", "qmljsmodelmanagerinterface.h", - "qmljsplugindumper.cpp", "qmljsplugindumper.h", - "qmljspropertyreader.cpp", "qmljspropertyreader.h", - "qmljsreformatter.cpp", "qmljsreformatter.h", - "qmljsrewriter.cpp", "qmljsrewriter.h", - "qmljsscanner.cpp", "qmljsscanner.h", - "qmljsscopeastpath.cpp", "qmljsscopeastpath.h", - "qmljsscopebuilder.cpp", "qmljsscopebuilder.h", - "qmljsscopechain.cpp", "qmljsscopechain.h", - "qmljssimplereader.cpp", "qmljssimplereader.h", - "qmljsstaticanalysismessage.cpp", "qmljsstaticanalysismessage.h", - "qmljstr.h", - "qmljstypedescriptionreader.cpp", "qmljstypedescriptionreader.h", - "qmljsutils.cpp", "qmljsutils.h", - "qmljsvalueowner.cpp", "qmljsvalueowner.h", - "qmljsviewercontext.h" - ] - } - - Group { - name: "Parser" - prefix: "parser/" - files: [ - "qmldirparser.cpp", "qmldirparser_p.h", - "qmlimportresolver.cpp", "qmlimportresolver_p.h", - "qmljsast.cpp", "qmljsast_p.h", - "qmljsastfwd_p.h", - "qmljsastvisitor.cpp", "qmljsastvisitor_p.h", - "qmljsengine_p.h", - "qmljsglobal_p.h", - "qmljsgrammar.cpp", "qmljsgrammar_p.h", - "qmljskeywords_p.h", - "qmljslexer.cpp", "qmljslexer_p.h", - "qmljsmemorypool_p.h", - "qmljsparser.cpp", "qmljsparser_p.h", - "qmljssourcelocation_p.h", - ] - } - - Export { - Depends { name: "CPlusPlus" } - Depends { name: "LanguageUtils" } - } + Depends { name: "LanguageUtils" } } } diff --git a/src/libs/tracing/tracing.qbs b/src/libs/tracing/tracing.qbs index b71fe1f6057..d044800f846 100644 --- a/src/libs/tracing/tracing.qbs +++ b/src/libs/tracing/tracing.qbs @@ -1,52 +1,46 @@ -import qbs 1.0 - -import QtcLibrary - -Project { +QtcLibrary { name: "Tracing" - QtcLibrary { - Depends { name: "Qt"; submodules: ["qml", "quick", "gui"] } - Depends { name: "Qt.testlib"; condition: project.withAutotests } - Depends { name: "Utils" } + Depends { name: "Qt"; submodules: ["qml", "quick", "gui"] } + Depends { name: "Qt.testlib"; condition: project.withAutotests } + Depends { name: "Utils" } - Group { - name: "General" - files: [ - "README", - "flamegraph.cpp", "flamegraph.h", - "flamegraphattached.h", - "safecastable.h", - "timelineabstractrenderer.cpp", "timelineabstractrenderer.h", - "timelineabstractrenderer_p.h", - "timelineformattime.cpp", "timelineformattime.h", - "timelineitemsrenderpass.cpp", "timelineitemsrenderpass.h", - "timelinemodel.cpp", "timelinemodel.h", "timelinemodel_p.h", - "timelinemodelaggregator.cpp", "timelinemodelaggregator.h", - "timelinenotesmodel.cpp", "timelinenotesmodel.h", "timelinenotesmodel_p.h", - "timelinenotesrenderpass.cpp", "timelinenotesrenderpass.h", - "timelineoverviewrenderer.cpp", "timelineoverviewrenderer.h", - "timelineoverviewrenderer_p.h", - "timelinerenderer.cpp", "timelinerenderer.h", "timelinerenderer_p.h", - "timelinerenderpass.cpp", "timelinerenderpass.h", - "timelinerenderstate.cpp", "timelinerenderstate.h", "timelinerenderstate_p.h", - "timelineselectionrenderpass.cpp", "timelineselectionrenderpass.h", - "timelinetheme.cpp", "timelinetheme.h", - "timelinetracefile.cpp", "timelinetracefile.h", - "timelinetracemanager.cpp", "timelinetracemanager.h", - "timelinezoomcontrol.cpp", "timelinezoomcontrol.h", - "traceevent.h", "traceeventtype.h", "tracestashfile.h", - "tracingtr.h", - ] - } - - Group { - name: "Qml Files" - Qt.core.resourcePrefix: "qt/qml/QtCreator/Tracing/" - fileTags: "qt.core.resource_data" - files: "qml/**" - } - - cpp.defines: base.concat("TRACING_LIBRARY") + Group { + name: "General" + files: [ + "README", + "flamegraph.cpp", "flamegraph.h", + "flamegraphattached.h", + "safecastable.h", + "timelineabstractrenderer.cpp", "timelineabstractrenderer.h", + "timelineabstractrenderer_p.h", + "timelineformattime.cpp", "timelineformattime.h", + "timelineitemsrenderpass.cpp", "timelineitemsrenderpass.h", + "timelinemodel.cpp", "timelinemodel.h", "timelinemodel_p.h", + "timelinemodelaggregator.cpp", "timelinemodelaggregator.h", + "timelinenotesmodel.cpp", "timelinenotesmodel.h", "timelinenotesmodel_p.h", + "timelinenotesrenderpass.cpp", "timelinenotesrenderpass.h", + "timelineoverviewrenderer.cpp", "timelineoverviewrenderer.h", + "timelineoverviewrenderer_p.h", + "timelinerenderer.cpp", "timelinerenderer.h", "timelinerenderer_p.h", + "timelinerenderpass.cpp", "timelinerenderpass.h", + "timelinerenderstate.cpp", "timelinerenderstate.h", "timelinerenderstate_p.h", + "timelineselectionrenderpass.cpp", "timelineselectionrenderpass.h", + "timelinetheme.cpp", "timelinetheme.h", + "timelinetracefile.cpp", "timelinetracefile.h", + "timelinetracemanager.cpp", "timelinetracemanager.h", + "timelinezoomcontrol.cpp", "timelinezoomcontrol.h", + "traceevent.h", "traceeventtype.h", "tracestashfile.h", + "tracingtr.h", + ] } + + Group { + name: "Qml Files" + Qt.core.resourcePrefix: "qt/qml/QtCreator/Tracing/" + fileTags: "qt.core.resource_data" + files: "qml/**" + } + + cpp.defines: base.concat("TRACING_LIBRARY") } diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index ba5665ab8f4..40a75de69e1 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -1,481 +1,475 @@ -import qbs 1.0 import qbs.FileInfo -Project { +QtcLibrary { name: "Utils" - - QtcLibrary { - cpp.includePaths: base.concat("mimetypes2", ".") - cpp.defines: base.concat([ - "UTILS_LIBRARY" - ]) - cpp.dynamicLibraries: { - var libs = []; - if (qbs.targetOS.contains("windows")) { - libs.push("user32", "iphlpapi", "ws2_32", "shell32", "ole32"); - if (qbs.toolchainType === "mingw") - libs.push("uuid"); - else if (qbs.toolchainType === "msvc") - libs.push("dbghelp"); - } else if (qbs.targetOS.contains("unix")) { - if (!qbs.targetOS.contains("macos")) - libs.push("X11"); - if (!qbs.targetOS.contains("openbsd")) - libs.push("pthread"); - } - return libs; + cpp.includePaths: base.concat("mimetypes2", ".") + cpp.defines: base.concat(["UTILS_LIBRARY"]) + cpp.dynamicLibraries: { + var libs = []; + if (qbs.targetOS.contains("windows")) { + libs.push("user32", "iphlpapi", "ws2_32", "shell32", "ole32"); + if (qbs.toolchainType === "mingw") + libs.push("uuid"); + else if (qbs.toolchainType === "msvc") + libs.push("dbghelp"); + } else if (qbs.targetOS.contains("unix")) { + if (!qbs.targetOS.contains("macos")) + libs.push("X11"); + if (!qbs.targetOS.contains("openbsd")) + libs.push("pthread"); } + return libs; + } - cpp.enableExceptions: true + cpp.enableExceptions: true - Properties { - condition: qbs.targetOS.contains("macos") - cpp.frameworks: ["Foundation", "AppKit"] - } + Properties { + condition: qbs.targetOS.contains("macos") + cpp.frameworks: ["Foundation", "AppKit"] + } - Depends { name: "Qt"; submodules: ["concurrent", "core-private", "network", "qml", "widgets", "xml"] } - Depends { name: "Qt.macextras"; condition: Qt.core.versionMajor < 6 && qbs.targetOS.contains("macos") } - Depends { name: "Spinner" } - Depends { name: "Tasking" } - Depends { name: "ptyqt" } + Depends { name: "Qt"; submodules: ["concurrent", "core-private", "network", "qml", "widgets", "xml"] } + Depends { name: "Qt.macextras"; condition: Qt.core.versionMajor < 6 && qbs.targetOS.contains("macos") } + Depends { name: "Spinner" } + Depends { name: "Tasking" } + Depends { name: "ptyqt" } + files: [ + "algorithm.h", + "ansiescapecodehandler.cpp", + "ansiescapecodehandler.h", + "appinfo.cpp", + "appinfo.h", + "appmainwindow.cpp", + "appmainwindow.h", + "aspects.cpp", + "aspects.h", + "async.cpp", + "async.h", + "basetreeview.cpp", + "basetreeview.h", + "benchmarker.cpp", + "benchmarker.h", + "buildablehelperlibrary.cpp", + "buildablehelperlibrary.h", + "camelcasecursor.cpp", + "camelcasecursor.h", + "categorysortfiltermodel.cpp", + "categorysortfiltermodel.h", + "changeset.cpp", + "changeset.h", + "checkablemessagebox.cpp", + "checkablemessagebox.h", + "clangutils.cpp", + "clangutils.h", + "classnamevalidatinglineedit.cpp", + "classnamevalidatinglineedit.h", + "codegeneration.cpp", + "codegeneration.h", + "commandline.cpp", + "commandline.h", + "completinglineedit.cpp", + "completinglineedit.h", + "completingtextedit.cpp", + "completingtextedit.h", + "cpplanguage_details.h", + "crumblepath.cpp", + "crumblepath.h", + "delegates.cpp", + "delegates.h", + "detailsbutton.cpp", + "detailsbutton.h", + "detailswidget.cpp", + "detailswidget.h", + "devicefileaccess.cpp", + "devicefileaccess.h", + "deviceshell.cpp", + "deviceshell.h", + "differ.cpp", + "differ.h", + "displayname.cpp", + "displayname.h", + "dropsupport.cpp", + "dropsupport.h", + "elfreader.cpp", + "elfreader.h", + "elidinglabel.cpp", + "elidinglabel.h", + "environment.cpp", + "environment.h", + "environmentdialog.cpp", + "environmentdialog.h", + "environmentmodel.cpp", + "environmentmodel.h", + "execmenu.cpp", + "execmenu.h", + "externalterminalprocessimpl.cpp", + "externalterminalprocessimpl.h", + "fadingindicator.cpp", + "fadingindicator.h", + "faketooltip.cpp", + "faketooltip.h", + "fancylineedit.cpp", + "fancylineedit.h", + "fancymainwindow.cpp", + "fancymainwindow.h", + "filecrumblabel.cpp", + "filecrumblabel.h", + "fileinprojectfinder.cpp", + "fileinprojectfinder.h", + "filenamevalidatinglineedit.cpp", + "filenamevalidatinglineedit.h", + "filepath.cpp", + "filepath.h", + "filesearch.cpp", + "filesearch.h", + "filestreamer.cpp", + "filestreamer.h", + "filestreamermanager.cpp", + "filestreamermanager.h", + "filesystemmodel.cpp", + "filesystemmodel.h", + "filesystemwatcher.cpp", + "filesystemwatcher.h", + "fileutils.cpp", + "fileutils.h", + "filewizardpage.cpp", + "filewizardpage.h", + "fixedsizeclicklabel.cpp", + "fixedsizeclicklabel.h", + "flowlayout.cpp", + "flowlayout.h", + "futuresynchronizer.cpp", + "futuresynchronizer.h", + "fuzzymatcher.cpp", + "fuzzymatcher.h", + "globalfilechangeblocker.cpp", + "globalfilechangeblocker.h", + "guard.cpp", + "guard.h", + "highlightingitemdelegate.cpp", + "highlightingitemdelegate.h", + "historycompleter.cpp", + "historycompleter.h", + "hostosinfo.h", + "hostosinfo.cpp", + "htmldocextractor.cpp", + "htmldocextractor.h", + "icon.cpp", + "icon.h", + "id.cpp", + "id.h", + "indexedcontainerproxyconstiterator.h", + "infobar.cpp", + "infobar.h", + "infolabel.cpp", + "infolabel.h", + "itemviews.cpp", + "itemviews.h", + "jsontreeitem.cpp", + "jsontreeitem.h", + "launcherinterface.cpp", + "launcherinterface.h", + "launcherpackets.cpp", + "launcherpackets.h", + "launchersocket.cpp", + "launchersocket.h", + "layoutbuilder.cpp", + "layoutbuilder.h", + "link.cpp", + "link.h", + "listmodel.h", + "listutils.h", + "macroexpander.cpp", + "macroexpander.h", + "mathutils.cpp", + "mathutils.h", + "mimeutils.h", + "minimizableinfobars.cpp", + "minimizableinfobars.h", + "multitextcursor.cpp", + "multitextcursor.h", + "namevaluedictionary.cpp", + "namevaluedictionary.h", + "namevalueitem.cpp", + "namevalueitem.h", + "namevaluemodel.cpp", + "namevaluemodel.h", + "namevaluesdialog.cpp", + "namevaluesdialog.h", + "namevaluevalidator.cpp", + "namevaluevalidator.h", + "navigationtreeview.cpp", + "navigationtreeview.h", + "networkaccessmanager.cpp", + "networkaccessmanager.h", + "optionpushbutton.h", + "optionpushbutton.cpp", + "osspecificaspects.h", + "outputformat.h", + "outputformatter.cpp", + "outputformatter.h", + "overlaywidget.cpp", + "overlaywidget.h", + "overridecursor.cpp", + "overridecursor.h", + "parameteraction.cpp", + "parameteraction.h", + "passworddialog.cpp", + "passworddialog.h", + "pathchooser.cpp", + "pathchooser.h", + "pathlisteditor.cpp", + "pathlisteditor.h", + "persistentcachestore.cpp", + "persistentcachestore.h", + "persistentsettings.cpp", + "persistentsettings.h", + "pointeralgorithm.h", + "port.cpp", + "port.h", + "portlist.cpp", + "portlist.h", + "predicates.h", + "process.cpp", + "process.h", + "processenums.h", + "processhandle.cpp", + "processhandle.h", + "processinfo.cpp", + "processinfo.h", + "processinterface.cpp", + "processinterface.h", + "processreaper.cpp", + "processreaper.h", + "processutils.cpp", + "processutils.h", + "progressindicator.cpp", + "progressindicator.h", + "projectintropage.cpp", + "projectintropage.h", + "proxyaction.cpp", + "proxyaction.h", + "qrcparser.cpp", + "qrcparser.h", + "qtcassert.cpp", + "qtcassert.h", + "qtcolorbutton.cpp", + "qtcolorbutton.h", + "qtcsettings.cpp", + "qtcsettings.h", + "reloadpromptutils.cpp", + "reloadpromptutils.h", + "removefiledialog.cpp", + "removefiledialog.h", + "savefile.cpp", + "savefile.h", + "scopedswap.h", + "scopedtimer.cpp", + "scopedtimer.h", + "searchresultitem.cpp", + "searchresultitem.h", + "set_algorithm.h", + "settingsaccessor.cpp", + "settingsaccessor.h", + "settingsselector.cpp", + "settingsselector.h", + "singleton.cpp", + "singleton.h", + "sizedarray.h", + "smallstring.h", + "smallstringiterator.h", + "smallstringio.h", + "smallstringliteral.h", + "smallstringlayout.h", + "smallstringmemory.h", + "smallstringvector.h", + "sortfiltermodel.h", + "span.h", + "../3rdparty/span/span.hpp", + "statuslabel.cpp", + "statuslabel.h", + "store.cpp", + "store.h", + "storekey.h", + "stringtable.cpp", + "stringtable.h", + "stringutils.cpp", + "stringutils.h", + "styleanimator.cpp", + "styleanimator.h", + "styledbar.cpp", + "styledbar.h", + "stylehelper.cpp", + "stylehelper.h", + "templateengine.cpp", + "templateengine.h", + "temporarydirectory.cpp", + "temporarydirectory.h", + "temporaryfile.cpp", + "temporaryfile.h", + "terminalcommand.cpp", + "terminalcommand.h", + "terminalhooks.cpp", + "terminalhooks.h", + "terminalinterface.cpp", + "terminalinterface.h", + "textfieldcheckbox.cpp", + "textfieldcheckbox.h", + "textfieldcombobox.cpp", + "textfieldcombobox.h", + "textfileformat.cpp", + "textfileformat.h", + "textutils.cpp", + "textutils.h", + "threadutils.cpp", + "threadutils.h", + "treemodel.cpp", + "treemodel.h", + "treeviewcombobox.cpp", + "treeviewcombobox.h", + "headerviewstretcher.cpp", + "headerviewstretcher.h", + "unarchiver.cpp", + "unarchiver.h", + "uncommentselection.cpp", + "uncommentselection.h", + "uniqueobjectptr.h", + "unixutils.cpp", + "unixutils.h", + "url.cpp", + "url.h", + "utils.qrc", + "utils_global.h", + "utilsicons.h", + "utilsicons.cpp", + "utilstr.h", + "variablechooser.cpp", + "variablechooser.h", + "winutils.cpp", + "winutils.h", + "wizard.cpp", + "wizard.h", + "wizardpage.cpp", + "wizardpage.h", + "images/*.png", + ] + + Group { + name: "FSEngine" + prefix: "fsengine/" + cpp.defines: outer.concat("QTC_UTILS_WITH_FSENGINE") files: [ - "algorithm.h", - "ansiescapecodehandler.cpp", - "ansiescapecodehandler.h", - "appinfo.cpp", - "appinfo.h", - "appmainwindow.cpp", - "appmainwindow.h", - "aspects.cpp", - "aspects.h", - "async.cpp", - "async.h", - "basetreeview.cpp", - "basetreeview.h", - "benchmarker.cpp", - "benchmarker.h", - "buildablehelperlibrary.cpp", - "buildablehelperlibrary.h", - "camelcasecursor.cpp", - "camelcasecursor.h", - "categorysortfiltermodel.cpp", - "categorysortfiltermodel.h", - "changeset.cpp", - "changeset.h", - "checkablemessagebox.cpp", - "checkablemessagebox.h", - "clangutils.cpp", - "clangutils.h", - "classnamevalidatinglineedit.cpp", - "classnamevalidatinglineedit.h", - "codegeneration.cpp", - "codegeneration.h", - "commandline.cpp", - "commandline.h", - "completinglineedit.cpp", - "completinglineedit.h", - "completingtextedit.cpp", - "completingtextedit.h", - "cpplanguage_details.h", - "crumblepath.cpp", - "crumblepath.h", - "delegates.cpp", - "delegates.h", - "detailsbutton.cpp", - "detailsbutton.h", - "detailswidget.cpp", - "detailswidget.h", - "devicefileaccess.cpp", - "devicefileaccess.h", - "deviceshell.cpp", - "deviceshell.h", - "differ.cpp", - "differ.h", - "displayname.cpp", - "displayname.h", - "dropsupport.cpp", - "dropsupport.h", - "elfreader.cpp", - "elfreader.h", - "elidinglabel.cpp", - "elidinglabel.h", - "environment.cpp", - "environment.h", - "environmentdialog.cpp", - "environmentdialog.h", - "environmentmodel.cpp", - "environmentmodel.h", - "execmenu.cpp", - "execmenu.h", - "externalterminalprocessimpl.cpp", - "externalterminalprocessimpl.h", - "fadingindicator.cpp", - "fadingindicator.h", - "faketooltip.cpp", - "faketooltip.h", - "fancylineedit.cpp", - "fancylineedit.h", - "fancymainwindow.cpp", - "fancymainwindow.h", - "filecrumblabel.cpp", - "filecrumblabel.h", - "fileinprojectfinder.cpp", - "fileinprojectfinder.h", - "filenamevalidatinglineedit.cpp", - "filenamevalidatinglineedit.h", - "filepath.cpp", - "filepath.h", - "filesearch.cpp", - "filesearch.h", - "filestreamer.cpp", - "filestreamer.h", - "filestreamermanager.cpp", - "filestreamermanager.h", - "filesystemmodel.cpp", - "filesystemmodel.h", - "filesystemwatcher.cpp", - "filesystemwatcher.h", - "fileutils.cpp", - "fileutils.h", - "filewizardpage.cpp", - "filewizardpage.h", - "fixedsizeclicklabel.cpp", - "fixedsizeclicklabel.h", - "flowlayout.cpp", - "flowlayout.h", - "futuresynchronizer.cpp", - "futuresynchronizer.h", - "fuzzymatcher.cpp", - "fuzzymatcher.h", - "globalfilechangeblocker.cpp", - "globalfilechangeblocker.h", - "guard.cpp", - "guard.h", - "highlightingitemdelegate.cpp", - "highlightingitemdelegate.h", - "historycompleter.cpp", - "historycompleter.h", - "hostosinfo.h", - "hostosinfo.cpp", - "htmldocextractor.cpp", - "htmldocextractor.h", - "icon.cpp", - "icon.h", - "id.cpp", - "id.h", - "indexedcontainerproxyconstiterator.h", - "infobar.cpp", - "infobar.h", - "infolabel.cpp", - "infolabel.h", - "itemviews.cpp", - "itemviews.h", - "jsontreeitem.cpp", - "jsontreeitem.h", - "launcherinterface.cpp", - "launcherinterface.h", - "launcherpackets.cpp", - "launcherpackets.h", - "launchersocket.cpp", - "launchersocket.h", - "layoutbuilder.cpp", - "layoutbuilder.h", - "link.cpp", - "link.h", - "listmodel.h", - "listutils.h", - "macroexpander.cpp", - "macroexpander.h", - "mathutils.cpp", - "mathutils.h", - "mimeutils.h", - "minimizableinfobars.cpp", - "minimizableinfobars.h", - "multitextcursor.cpp", - "multitextcursor.h", - "namevaluedictionary.cpp", - "namevaluedictionary.h", - "namevalueitem.cpp", - "namevalueitem.h", - "namevaluemodel.cpp", - "namevaluemodel.h", - "namevaluesdialog.cpp", - "namevaluesdialog.h", - "namevaluevalidator.cpp", - "namevaluevalidator.h", - "navigationtreeview.cpp", - "navigationtreeview.h", - "networkaccessmanager.cpp", - "networkaccessmanager.h", - "optionpushbutton.h", - "optionpushbutton.cpp", - "osspecificaspects.h", - "outputformat.h", - "outputformatter.cpp", - "outputformatter.h", - "overlaywidget.cpp", - "overlaywidget.h", - "overridecursor.cpp", - "overridecursor.h", - "parameteraction.cpp", - "parameteraction.h", - "passworddialog.cpp", - "passworddialog.h", - "pathchooser.cpp", - "pathchooser.h", - "pathlisteditor.cpp", - "pathlisteditor.h", - "persistentcachestore.cpp", - "persistentcachestore.h", - "persistentsettings.cpp", - "persistentsettings.h", - "pointeralgorithm.h", - "port.cpp", - "port.h", - "portlist.cpp", - "portlist.h", - "predicates.h", - "process.cpp", - "process.h", - "processenums.h", - "processhandle.cpp", - "processhandle.h", - "processinfo.cpp", - "processinfo.h", - "processinterface.cpp", - "processinterface.h", - "processreaper.cpp", - "processreaper.h", - "processutils.cpp", - "processutils.h", - "progressindicator.cpp", - "progressindicator.h", - "projectintropage.cpp", - "projectintropage.h", - "proxyaction.cpp", - "proxyaction.h", - "qrcparser.cpp", - "qrcparser.h", - "qtcassert.cpp", - "qtcassert.h", - "qtcolorbutton.cpp", - "qtcolorbutton.h", - "qtcsettings.cpp", - "qtcsettings.h", - "reloadpromptutils.cpp", - "reloadpromptutils.h", - "removefiledialog.cpp", - "removefiledialog.h", - "savefile.cpp", - "savefile.h", - "scopedswap.h", - "scopedtimer.cpp", - "scopedtimer.h", - "searchresultitem.cpp", - "searchresultitem.h", - "set_algorithm.h", - "settingsaccessor.cpp", - "settingsaccessor.h", - "settingsselector.cpp", - "settingsselector.h", - "singleton.cpp", - "singleton.h", - "sizedarray.h", - "smallstring.h", - "smallstringiterator.h", - "smallstringio.h", - "smallstringliteral.h", - "smallstringlayout.h", - "smallstringmemory.h", - "smallstringvector.h", - "sortfiltermodel.h", - "span.h", - "../3rdparty/span/span.hpp", - "statuslabel.cpp", - "statuslabel.h", - "store.cpp", - "store.h", - "storekey.h", - "stringtable.cpp", - "stringtable.h", - "stringutils.cpp", - "stringutils.h", - "styleanimator.cpp", - "styleanimator.h", - "styledbar.cpp", - "styledbar.h", - "stylehelper.cpp", - "stylehelper.h", - "templateengine.cpp", - "templateengine.h", - "temporarydirectory.cpp", - "temporarydirectory.h", - "temporaryfile.cpp", - "temporaryfile.h", - "terminalcommand.cpp", - "terminalcommand.h", - "terminalhooks.cpp", - "terminalhooks.h", - "terminalinterface.cpp", - "terminalinterface.h", - "textfieldcheckbox.cpp", - "textfieldcheckbox.h", - "textfieldcombobox.cpp", - "textfieldcombobox.h", - "textfileformat.cpp", - "textfileformat.h", - "textutils.cpp", - "textutils.h", - "threadutils.cpp", - "threadutils.h", - "treemodel.cpp", - "treemodel.h", - "treeviewcombobox.cpp", - "treeviewcombobox.h", - "headerviewstretcher.cpp", - "headerviewstretcher.h", - "unarchiver.cpp", - "unarchiver.h", - "uncommentselection.cpp", - "uncommentselection.h", - "uniqueobjectptr.h", - "unixutils.cpp", - "unixutils.h", - "url.cpp", - "url.h", - "utils.qrc", - "utils_global.h", - "utilsicons.h", - "utilsicons.cpp", - "utilstr.h", - "variablechooser.cpp", - "variablechooser.h", - "winutils.cpp", - "winutils.h", - "wizard.cpp", - "wizard.h", - "wizardpage.cpp", - "wizardpage.h", - "images/*.png", + "diriterator.h", + "fileiconprovider.cpp", + "fileiconprovider.h", + "fileiteratordevicesappender.h", + "fixedlistfsengine.h", + "fsengine.cpp", + "fsengine.h", + "fsenginehandler.cpp", + "fsenginehandler.h", + "fsengine_impl.cpp", + "fsengine_impl.h", + "rootinjectfsengine.h", ] + } - Group { - name: "FSEngine" - prefix: "fsengine/" - cpp.defines: outer.concat("QTC_UTILS_WITH_FSENGINE") - files: [ - "diriterator.h", - "fileiconprovider.cpp", - "fileiconprovider.h", - "fileiteratordevicesappender.h", - "fixedlistfsengine.h", - "fsengine.cpp", - "fsengine.h", - "fsenginehandler.cpp", - "fsenginehandler.h", - "fsengine_impl.cpp", - "fsengine_impl.h", - "rootinjectfsengine.h", - ] - } + Group { + name: "Theme" + prefix: "theme/" + files: [ + "theme.cpp", + "theme.h", + "theme_p.h", + ] + } - Group { - name: "Theme" - prefix: "theme/" - files: [ - "theme.cpp", - "theme.h", - "theme_p.h", - ] - } + Group { + name: "Tooltip" + prefix: "tooltip/" + files: [ + "effects.h", + "tips.cpp", + "tips.h", + "tooltip.cpp", + "tooltip.h", + ] + } - Group { - name: "Tooltip" - prefix: "tooltip/" - files: [ - "effects.h", - "tips.cpp", - "tips.h", - "tooltip.cpp", - "tooltip.h", - ] - } + Group { + name: "FileUtils_macos" + condition: qbs.targetOS.contains("macos") + files: [ + "fileutils_mac.h", "fileutils_mac.mm", + ] + } + Group { + name: "Theme_macos" + condition: qbs.targetOS.contains("macos") + prefix: "theme/" + files: [ + "theme_mac.h", "theme_mac.mm", + ] + } + + Group { + name: "ProcessHandle_macos" + condition: qbs.targetOS.contains("macos") + files: [ + "processhandle_mac.mm", + ] + } + + Group { + name: "MimeTypes" + prefix: "mimetypes2/" + files: [ + "mimedatabase.cpp", + "mimedatabase.h", + "mimedatabase_p.h", + "mimeglobpattern.cpp", + "mimeglobpattern_p.h", + "mimemagicrule.cpp", + "mimemagicrule_p.h", + "mimemagicrulematcher.cpp", + "mimemagicrulematcher_p.h", + "mimeprovider.cpp", + "mimeprovider_p.h", + "mimetype.cpp", + "mimetype.h", + "mimetype_p.h", + "mimetypeparser.cpp", + "mimetypeparser_p.h", + "mimeutils.cpp" + ] + } + + Group { + name: "TouchBar support" + prefix: "touchbar/" + files: "touchbar.h" Group { - name: "FileUtils_macos" + name: "TouchBar implementation" condition: qbs.targetOS.contains("macos") files: [ - "fileutils_mac.h", "fileutils_mac.mm", + "touchbar_appdelegate_mac_p.h", + "touchbar_mac_p.h", + "touchbar_mac.mm", + "touchbar_appdelegate_mac.mm", ] } - Group { - name: "Theme_macos" - condition: qbs.targetOS.contains("macos") - prefix: "theme/" - files: [ - "theme_mac.h", "theme_mac.mm", - ] - } - - Group { - name: "ProcessHandle_macos" - condition: qbs.targetOS.contains("macos") - files: [ - "processhandle_mac.mm", - ] - } - - Group { - name: "MimeTypes" - prefix: "mimetypes2/" - files: [ - "mimedatabase.cpp", - "mimedatabase.h", - "mimedatabase_p.h", - "mimeglobpattern.cpp", - "mimeglobpattern_p.h", - "mimemagicrule.cpp", - "mimemagicrule_p.h", - "mimemagicrulematcher.cpp", - "mimemagicrulematcher_p.h", - "mimeprovider.cpp", - "mimeprovider_p.h", - "mimetype.cpp", - "mimetype.h", - "mimetype_p.h", - "mimetypeparser.cpp", - "mimetypeparser_p.h", - "mimeutils.cpp" - ] - } - - Group { - name: "TouchBar support" - prefix: "touchbar/" - files: "touchbar.h" - Group { - name: "TouchBar implementation" - condition: qbs.targetOS.contains("macos") - files: [ - "touchbar_appdelegate_mac_p.h", - "touchbar_mac_p.h", - "touchbar_mac.mm", - "touchbar_appdelegate_mac.mm", - ] - } - Group { - name: "TouchBar stub" - condition: !qbs.targetOS.contains("macos") - files: "touchbar.cpp" - } - } - - Export { - Depends { name: "Qt"; submodules: ["concurrent", "widgets" ] } - Depends { name: "Tasking" } - cpp.includePaths: base.concat("mimetypes2") + name: "TouchBar stub" + condition: !qbs.targetOS.contains("macos") + files: "touchbar.cpp" } } + + Export { + Depends { name: "Qt"; submodules: ["concurrent", "widgets" ] } + Depends { name: "Tasking" } + cpp.includePaths: base.concat("mimetypes2") + } } diff --git a/src/plugins/android/android.qbs b/src/plugins/android/android.qbs index a8fbd7c818a..81fd94bca76 100644 --- a/src/plugins/android/android.qbs +++ b/src/plugins/android/android.qbs @@ -1,126 +1,122 @@ -import qbs 1.0 - -Project { +QtcPlugin { name: "Android" - QtcPlugin { - Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] } - Depends { name: "Core" } - Depends { name: "Debugger" } - Depends { name: "LanguageClient" } - Depends { name: "LanguageServerProtocol" } - Depends { name: "ProParser" } - Depends { name: "ProjectExplorer" } - Depends { name: "QmlDebug" } - Depends { name: "QtSupport" } - Depends { name: "TextEditor" } - Depends { name: "Utils" } + Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] } + Depends { name: "Core" } + Depends { name: "Debugger" } + Depends { name: "LanguageClient" } + Depends { name: "LanguageServerProtocol" } + Depends { name: "ProParser" } + Depends { name: "ProjectExplorer" } + Depends { name: "QmlDebug" } + Depends { name: "QtSupport" } + Depends { name: "TextEditor" } + Depends { name: "Utils" } + files: [ + "androidtr.h", + "android.qrc", + "androidavdmanager.cpp", + "androidavdmanager.h", + "androidconfigurations.cpp", + "androidconfigurations.h", + "androidconstants.h", + "androidcreatekeystorecertificate.cpp", + "androidcreatekeystorecertificate.h", + "androidbuildapkstep.cpp", + "androidbuildapkstep.h", + "androiddeployqtstep.cpp", + "androiddeployqtstep.h", + "androiddebugsupport.cpp", + "androiddebugsupport.h", + "androiddevice.cpp", + "androiddevice.h", + "androiddeviceinfo.cpp", + "androiddeviceinfo.h", + "androidextralibrarylistmodel.cpp", + "androidextralibrarylistmodel.h", + "androidglobal.h", + "androidmanager.cpp", + "androidmanager.h", + "androidmanifestdocument.cpp", + "androidmanifestdocument.h", + "androidmanifesteditor.cpp", + "androidmanifesteditor.h", + "androidmanifesteditoriconwidget.cpp", + "androidmanifesteditoriconwidget.h", + "androidmanifesteditoriconcontainerwidget.cpp", + "androidmanifesteditoriconcontainerwidget.h", + "androidmanifesteditorfactory.cpp", + "androidmanifesteditorfactory.h", + "androidmanifesteditorwidget.cpp", + "androidmanifesteditorwidget.h", + "androidpackageinstallationstep.cpp", + "androidpackageinstallationstep.h", + "androidplugin.cpp", + "androidplugin.h", + "androidpotentialkit.cpp", + "androidpotentialkit.h", + "androidqmlpreviewworker.h", + "androidqmlpreviewworker.cpp", + "androidqmltoolingsupport.cpp", + "androidqmltoolingsupport.h", + "androidqtversion.cpp", + "androidqtversion.h", + "androidrunconfiguration.cpp", + "androidrunconfiguration.h", + "androidruncontrol.cpp", + "androidruncontrol.h", + "androidrunner.cpp", + "androidrunner.h", + "androidrunnerworker.cpp", + "androidrunnerworker.h", + "androidsdkdownloader.cpp", + "androidsdkdownloader.h", + "androidsdkmanager.cpp", + "androidsdkmanager.h", + "androidsdkmanagerwidget.cpp", + "androidsdkmanagerwidget.h", + "androidsdkmodel.cpp", + "androidsdkmodel.h", + "androidsdkpackage.cpp", + "androidsdkpackage.h", + "androidsettingswidget.cpp", + "androidsettingswidget.h", + "androidsignaloperation.cpp", + "androidsignaloperation.h", + "androidtoolchain.cpp", + "androidtoolchain.h", + "avddialog.cpp", + "avddialog.h", + "avdmanageroutputparser.cpp", + "avdmanageroutputparser.h", + "certificatesmodel.cpp", + "certificatesmodel.h", + "createandroidmanifestwizard.h", + "createandroidmanifestwizard.cpp", + "javaeditor.cpp", + "javaeditor.h", + "javaindenter.cpp", + "javaindenter.h", + "javalanguageserver.cpp", + "javalanguageserver.h", + "javaparser.cpp", + "javaparser.h", + "splashscreencontainerwidget.cpp", + "splashscreencontainerwidget.h", + "splashscreenwidget.cpp", + "splashscreenwidget.h", + "sdkmanageroutputparser.cpp", + "sdkmanageroutputparser.h" + ] + + QtcTestFiles { files: [ - "androidtr.h", - "android.qrc", - "androidavdmanager.cpp", - "androidavdmanager.h", - "androidconfigurations.cpp", - "androidconfigurations.h", - "androidconstants.h", - "androidcreatekeystorecertificate.cpp", - "androidcreatekeystorecertificate.h", - "androidbuildapkstep.cpp", - "androidbuildapkstep.h", - "androiddeployqtstep.cpp", - "androiddeployqtstep.h", - "androiddebugsupport.cpp", - "androiddebugsupport.h", - "androiddevice.cpp", - "androiddevice.h", - "androiddeviceinfo.cpp", - "androiddeviceinfo.h", - "androidextralibrarylistmodel.cpp", - "androidextralibrarylistmodel.h", - "androidglobal.h", - "androidmanager.cpp", - "androidmanager.h", - "androidmanifestdocument.cpp", - "androidmanifestdocument.h", - "androidmanifesteditor.cpp", - "androidmanifesteditor.h", - "androidmanifesteditoriconwidget.cpp", - "androidmanifesteditoriconwidget.h", - "androidmanifesteditoriconcontainerwidget.cpp", - "androidmanifesteditoriconcontainerwidget.h", - "androidmanifesteditorfactory.cpp", - "androidmanifesteditorfactory.h", - "androidmanifesteditorwidget.cpp", - "androidmanifesteditorwidget.h", - "androidpackageinstallationstep.cpp", - "androidpackageinstallationstep.h", - "androidplugin.cpp", - "androidplugin.h", - "androidpotentialkit.cpp", - "androidpotentialkit.h", - "androidqmlpreviewworker.h", - "androidqmlpreviewworker.cpp", - "androidqmltoolingsupport.cpp", - "androidqmltoolingsupport.h", - "androidqtversion.cpp", - "androidqtversion.h", - "androidrunconfiguration.cpp", - "androidrunconfiguration.h", - "androidruncontrol.cpp", - "androidruncontrol.h", - "androidrunner.cpp", - "androidrunner.h", - "androidrunnerworker.cpp", - "androidrunnerworker.h", - "androidsdkdownloader.cpp", - "androidsdkdownloader.h", - "androidsdkmanager.cpp", - "androidsdkmanager.h", - "androidsdkmanagerwidget.cpp", - "androidsdkmanagerwidget.h", - "androidsdkmodel.cpp", - "androidsdkmodel.h", - "androidsdkpackage.cpp", - "androidsdkpackage.h", - "androidsettingswidget.cpp", - "androidsettingswidget.h", - "androidsignaloperation.cpp", - "androidsignaloperation.h", - "androidtoolchain.cpp", - "androidtoolchain.h", - "avddialog.cpp", - "avddialog.h", - "avdmanageroutputparser.cpp", - "avdmanageroutputparser.h", - "certificatesmodel.cpp", - "certificatesmodel.h", - "createandroidmanifestwizard.h", - "createandroidmanifestwizard.cpp", - "javaeditor.cpp", - "javaeditor.h", - "javaindenter.cpp", - "javaindenter.h", - "javalanguageserver.cpp", - "javalanguageserver.h", - "javaparser.cpp", - "javaparser.h", - "splashscreencontainerwidget.cpp", - "splashscreencontainerwidget.h", - "splashscreenwidget.cpp", - "splashscreenwidget.h", - "sdkmanageroutputparser.cpp", - "sdkmanageroutputparser.h" + "android_tst.qrc", + "androidsdkmanager_test.cpp", + "androidsdkmanager_test.h", + "sdkmanageroutputparser_test.cpp", + "sdkmanageroutputparser_test.h", ] - - QtcTestFiles { - files: [ - "android_tst.qrc", - "androidsdkmanager_test.cpp", - "androidsdkmanager_test.h", - "sdkmanageroutputparser_test.cpp", - "sdkmanageroutputparser_test.h", - ] - } } } diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index a95d22287db..bc4a27ff035 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -1,383 +1,379 @@ -import qbs 1.0 import qbs.FileInfo import qbs.Utilities -Project { +QtcPlugin { name: "Core" + Depends { + name: "Qt" + submodules: ["widgets", "xml", "network", "qml", "sql", "printsupport"] + } - QtcPlugin { - Depends { - name: "Qt" - submodules: ["widgets", "xml", "network", "qml", "sql", "printsupport"] - } + Depends { + name: "Qt.gui-private" + condition: qbs.targetOS.contains("windows") + } - Depends { - name: "Qt.gui-private" - condition: qbs.targetOS.contains("windows") - } + Depends { name: "Utils" } + Depends { name: "Aggregation" } + Depends { name: "TerminalLib" } - Depends { name: "Utils" } + cpp.dynamicLibraries: { + if (qbs.targetOS.contains("windows")) + return ["ole32", "user32"] + } + + cpp.frameworks: qbs.targetOS.contains("macos") ? ["AppKit"] : undefined + + Group { + name: "General" + files: [ + "actionsfilter.cpp", + "actionsfilter.h", + "basefilewizard.cpp", + "basefilewizard.h", + "basefilewizardfactory.cpp", + "basefilewizardfactory.h", + "core.qrc", + "core_global.h", + "coreconstants.h", + "coreicons.cpp", + "coreicons.h", + "corejsextensions.cpp", + "corejsextensions.h", + "coreplugin.cpp", + "coreplugin.h", + "coreplugintr.h", + "designmode.cpp", + "designmode.h", + "diffservice.cpp", + "diffservice.h", + "documentmanager.cpp", + "documentmanager.h", + "editmode.cpp", + "editmode.h", + "editortoolbar.cpp", + "editortoolbar.h", + "externaltool.cpp", + "externaltool.h", + "externaltoolmanager.cpp", + "externaltoolmanager.h", + "fancyactionbar.cpp", + "fancyactionbar.h", + "fancyactionbar.qrc", + "fancytabwidget.cpp", + "fancytabwidget.h", + "featureprovider.cpp", + "featureprovider.h", + "fileutils.cpp", + "fileutils.h", + "findplaceholder.cpp", + "findplaceholder.h", + "foldernavigationwidget.cpp", + "foldernavigationwidget.h", + "generalsettings.cpp", + "generalsettings.h", + "generatedfile.cpp", + "generatedfile.h", + "helpitem.cpp", + "helpitem.h", + "helpmanager.cpp", + "helpmanager.h", + "helpmanager_implementation.h", + "icontext.cpp", + "icontext.h", + "icore.cpp", + "icore.h", + "idocument.cpp", + "idocument.h", + "idocumentfactory.cpp", + "idocumentfactory.h", + "ifilewizardextension.h", + "imode.cpp", + "imode.h", + "inavigationwidgetfactory.cpp", + "inavigationwidgetfactory.h", + "ioutputpane.cpp", + "ioutputpane.h", + "iversioncontrol.cpp", + "iversioncontrol.h", + "iwelcomepage.cpp", + "iwelcomepage.h", + "iwizardfactory.cpp", + "iwizardfactory.h", + "jsexpander.cpp", + "jsexpander.h", + "loggingmanager.cpp", + "loggingmanager.h", + "loggingviewer.cpp", + "loggingviewer.h", + "mainwindow.cpp", + "mainwindow.h", + "manhattanstyle.cpp", + "manhattanstyle.h", + "messagebox.cpp", + "messagebox.h", + "messagemanager.cpp", + "messagemanager.h", + "messageoutputwindow.cpp", + "messageoutputwindow.h", + "mimetypemagicdialog.cpp", + "mimetypemagicdialog.h", + "mimetypesettings.cpp", + "mimetypesettings.h", + "minisplitter.cpp", + "minisplitter.h", + "modemanager.cpp", + "modemanager.h", + "navigationsubwidget.cpp", + "navigationsubwidget.h", + "navigationwidget.cpp", + "navigationwidget.h", + "opendocumentstreeview.cpp", + "opendocumentstreeview.h", + "outputpane.cpp", + "outputpane.h", + "outputpanemanager.cpp", + "outputpanemanager.h", + "outputwindow.cpp", + "outputwindow.h", + "patchtool.cpp", + "patchtool.h", + "plugindialog.cpp", + "plugindialog.h", + "plugininstallwizard.cpp", + "plugininstallwizard.h", + "rightpane.cpp", + "rightpane.h", + "session.cpp", + "session.h", + "sessiondialog.cpp", + "sessiondialog.h", + "sessionmodel.cpp", + "sessionmodel.h", + "sessionview.cpp", + "sessionview.h", + "settingsdatabase.cpp", + "settingsdatabase.h", + "sidebar.cpp", + "sidebar.h", + "sidebarwidget.cpp", + "sidebarwidget.h", + "statusbarmanager.cpp", + "statusbarmanager.h", + "systemsettings.cpp", + "systemsettings.h", + "textdocument.cpp", + "textdocument.h", + "themechooser.cpp", + "themechooser.h", + "vcsmanager.cpp", + "vcsmanager.h", + "versiondialog.cpp", + "versiondialog.h", + "welcomepagehelper.cpp", + "welcomepagehelper.h", + "windowsupport.cpp", + "windowsupport.h", + ] + } + + Group { + name: "studiofonts" + prefix: "../../share/3rdparty/studiofonts/" + files: "studiofonts.qrc" + } + + Group { + name: "Action Manager" + prefix: "actionmanager/" + files: [ + "actioncontainer.cpp", "actioncontainer.h", "actioncontainer_p.h", + "actionmanager.cpp", "actionmanager.h", "actionmanager_p.h", + "command.cpp", "command.h", "command_p.h", + "commandbutton.cpp", "commandbutton.h", + "commandmappings.cpp", "commandmappings.h", + "commandsfile.cpp", "commandsfile.h", + ] + } + + Group { + name: "Dialogs" + prefix: "dialogs/" + files: [ + "addtovcsdialog.cpp", "addtovcsdialog.h", + "codecselector.cpp", "codecselector.h", + "externaltoolconfig.cpp", "externaltoolconfig.h", + "filepropertiesdialog.cpp", "filepropertiesdialog.h", + "ioptionspage.cpp", "ioptionspage.h", + "newdialog.cpp", "newdialog.h", + "newdialogwidget.cpp", "newdialogwidget.h", + "openwithdialog.cpp", "openwithdialog.h", + "promptoverwritedialog.cpp", "promptoverwritedialog.h", + "readonlyfilesdialog.cpp", "readonlyfilesdialog.h", + "restartdialog.cpp", "restartdialog.h", + "saveitemsdialog.cpp", "saveitemsdialog.h", + "settingsdialog.cpp", "settingsdialog.h", + "shortcutsettings.cpp", "shortcutsettings.h", + ] + } + + Group { + name: "Editor Manager" + prefix: "editormanager/" + files: [ + "documentmodel.cpp", "documentmodel.h", "documentmodel_p.h", + "editorarea.cpp", "editorarea.h", + "editormanager.cpp", "editormanager.h", "editormanager_p.h", + "editorview.cpp", "editorview.h", + "editorwindow.cpp", "editorwindow.h", + "ieditor.cpp", "ieditor.h", + "ieditorfactory.cpp", "ieditorfactory.h", "ieditorfactory_p.h", + "openeditorsview.cpp", "openeditorsview.h", + "openeditorswindow.cpp", "openeditorswindow.h", + "systemeditor.cpp", "systemeditor.h", + ] + } + + Group { + name: "Progress Manager" + prefix: "progressmanager/" + files: [ + "futureprogress.cpp", "futureprogress.h", + "processprogress.cpp", "processprogress.h", + "progressbar.cpp", "progressbar.h", + "progressmanager.cpp", "progressmanager.h", "progressmanager_p.h", + "progressview.cpp", "progressview.h", + "taskprogress.cpp", "taskprogress.h", + ] + } + + Group { + name: "ProgressManager_win" + condition: qbs.targetOS.contains("windows") + files: [ + "progressmanager/progressmanager_win.cpp", + ] + } + + Group { + name: "ProgressManager_mac" + condition: qbs.targetOS.contains("macos") + files: [ + "progressmanager/progressmanager_mac.mm", + ] + } + + Group { + name: "ProgressManager_x11" + condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos") + files: [ + "progressmanager/progressmanager_x11.cpp", + ] + } + + QtcTestFiles { + files: [ + "testdatadir.cpp", + "testdatadir.h", + "locator/locatorfiltertest.cpp", + "locator/locatorfiltertest.h", + "locator/locator_test.cpp" + ] + + cpp.defines: outer.concat(['SRCDIR="' + path + '"']) + } + + Group { + name: "Find" + prefix: "find/" + files: [ + "basetextfind.cpp", + "basetextfind.h", + "currentdocumentfind.cpp", + "currentdocumentfind.h", + "find.qrc", + "findplugin.cpp", + "findplugin.h", + "findtoolbar.cpp", + "findtoolbar.h", + "findtoolwindow.cpp", + "findtoolwindow.h", + "highlightscrollbarcontroller.cpp", + "highlightscrollbarcontroller.h", + "ifindfilter.cpp", + "ifindfilter.h", + "ifindsupport.cpp", + "ifindsupport.h", + "itemviewfind.cpp", + "itemviewfind.h", + "optionspopup.cpp", + "optionspopup.h", + "searchresulttreeitemdelegate.cpp", + "searchresulttreeitemdelegate.h", + "searchresulttreeitemroles.h", + "searchresulttreeitems.cpp", + "searchresulttreeitems.h", + "searchresulttreemodel.cpp", + "searchresulttreemodel.h", + "searchresulttreeview.cpp", + "searchresulttreeview.h", + "searchresultwidget.cpp", + "searchresultwidget.h", + "searchresultwindow.cpp", + "searchresultwindow.h", + "textfindconstants.h", + ] + } + + Group { + name: "Locator" + prefix: "locator/" + files: [ + "commandlocator.cpp", + "commandlocator.h", + "directoryfilter.cpp", + "directoryfilter.h", + "executefilter.cpp", + "executefilter.h", + "externaltoolsfilter.cpp", + "externaltoolsfilter.h", + "filesystemfilter.cpp", + "filesystemfilter.h", + "ilocatorfilter.cpp", + "ilocatorfilter.h", + "javascriptfilter.cpp", + "javascriptfilter.h", + "locatorconstants.h", + "locatorfiltersfilter.cpp", + "locatorfiltersfilter.h", + "locatormanager.cpp", + "locatormanager.h", + "locator.cpp", + "locator.h", + "locatorsettingspage.cpp", + "locatorsettingspage.h", + "locatorwidget.cpp", + "locatorwidget.h", + "opendocumentsfilter.cpp", + "opendocumentsfilter.h", + "spotlightlocatorfilter.h", + "spotlightlocatorfilter.cpp", + "urllocatorfilter.cpp", + "urllocatorfilter.h" + ] + } + + Group { + name: "Terminal" + prefix: "terminal/" + files: [ + "searchableterminal.cpp", + "searchableterminal.h", + ] + } + + Export { Depends { name: "Aggregation" } - Depends { name: "TerminalLib" } - - cpp.dynamicLibraries: { - if (qbs.targetOS.contains("windows")) - return ["ole32", "user32"] - } - - cpp.frameworks: qbs.targetOS.contains("macos") ? ["AppKit"] : undefined - - Group { - name: "General" - files: [ - "actionsfilter.cpp", - "actionsfilter.h", - "basefilewizard.cpp", - "basefilewizard.h", - "basefilewizardfactory.cpp", - "basefilewizardfactory.h", - "core.qrc", - "core_global.h", - "coreconstants.h", - "coreicons.cpp", - "coreicons.h", - "corejsextensions.cpp", - "corejsextensions.h", - "coreplugin.cpp", - "coreplugin.h", - "coreplugintr.h", - "designmode.cpp", - "designmode.h", - "diffservice.cpp", - "diffservice.h", - "documentmanager.cpp", - "documentmanager.h", - "editmode.cpp", - "editmode.h", - "editortoolbar.cpp", - "editortoolbar.h", - "externaltool.cpp", - "externaltool.h", - "externaltoolmanager.cpp", - "externaltoolmanager.h", - "fancyactionbar.cpp", - "fancyactionbar.h", - "fancyactionbar.qrc", - "fancytabwidget.cpp", - "fancytabwidget.h", - "featureprovider.cpp", - "featureprovider.h", - "fileutils.cpp", - "fileutils.h", - "findplaceholder.cpp", - "findplaceholder.h", - "foldernavigationwidget.cpp", - "foldernavigationwidget.h", - "generalsettings.cpp", - "generalsettings.h", - "generatedfile.cpp", - "generatedfile.h", - "helpitem.cpp", - "helpitem.h", - "helpmanager.cpp", - "helpmanager.h", - "helpmanager_implementation.h", - "icontext.cpp", - "icontext.h", - "icore.cpp", - "icore.h", - "idocument.cpp", - "idocument.h", - "idocumentfactory.cpp", - "idocumentfactory.h", - "ifilewizardextension.h", - "imode.cpp", - "imode.h", - "inavigationwidgetfactory.cpp", - "inavigationwidgetfactory.h", - "ioutputpane.cpp", - "ioutputpane.h", - "iversioncontrol.cpp", - "iversioncontrol.h", - "iwelcomepage.cpp", - "iwelcomepage.h", - "iwizardfactory.cpp", - "iwizardfactory.h", - "jsexpander.cpp", - "jsexpander.h", - "loggingmanager.cpp", - "loggingmanager.h", - "loggingviewer.cpp", - "loggingviewer.h", - "mainwindow.cpp", - "mainwindow.h", - "manhattanstyle.cpp", - "manhattanstyle.h", - "messagebox.cpp", - "messagebox.h", - "messagemanager.cpp", - "messagemanager.h", - "messageoutputwindow.cpp", - "messageoutputwindow.h", - "mimetypemagicdialog.cpp", - "mimetypemagicdialog.h", - "mimetypesettings.cpp", - "mimetypesettings.h", - "minisplitter.cpp", - "minisplitter.h", - "modemanager.cpp", - "modemanager.h", - "navigationsubwidget.cpp", - "navigationsubwidget.h", - "navigationwidget.cpp", - "navigationwidget.h", - "opendocumentstreeview.cpp", - "opendocumentstreeview.h", - "outputpane.cpp", - "outputpane.h", - "outputpanemanager.cpp", - "outputpanemanager.h", - "outputwindow.cpp", - "outputwindow.h", - "patchtool.cpp", - "patchtool.h", - "plugindialog.cpp", - "plugindialog.h", - "plugininstallwizard.cpp", - "plugininstallwizard.h", - "rightpane.cpp", - "rightpane.h", - "session.cpp", - "session.h", - "sessiondialog.cpp", - "sessiondialog.h", - "sessionmodel.cpp", - "sessionmodel.h", - "sessionview.cpp", - "sessionview.h", - "settingsdatabase.cpp", - "settingsdatabase.h", - "sidebar.cpp", - "sidebar.h", - "sidebarwidget.cpp", - "sidebarwidget.h", - "statusbarmanager.cpp", - "statusbarmanager.h", - "systemsettings.cpp", - "systemsettings.h", - "textdocument.cpp", - "textdocument.h", - "themechooser.cpp", - "themechooser.h", - "vcsmanager.cpp", - "vcsmanager.h", - "versiondialog.cpp", - "versiondialog.h", - "welcomepagehelper.cpp", - "welcomepagehelper.h", - "windowsupport.cpp", - "windowsupport.h", - ] - } - - Group { - name: "studiofonts" - prefix: "../../share/3rdparty/studiofonts/" - files: "studiofonts.qrc" - } - - Group { - name: "Action Manager" - prefix: "actionmanager/" - files: [ - "actioncontainer.cpp", "actioncontainer.h", "actioncontainer_p.h", - "actionmanager.cpp", "actionmanager.h", "actionmanager_p.h", - "command.cpp", "command.h", "command_p.h", - "commandbutton.cpp", "commandbutton.h", - "commandmappings.cpp", "commandmappings.h", - "commandsfile.cpp", "commandsfile.h", - ] - } - - Group { - name: "Dialogs" - prefix: "dialogs/" - files: [ - "addtovcsdialog.cpp", "addtovcsdialog.h", - "codecselector.cpp", "codecselector.h", - "externaltoolconfig.cpp", "externaltoolconfig.h", - "filepropertiesdialog.cpp", "filepropertiesdialog.h", - "ioptionspage.cpp", "ioptionspage.h", - "newdialog.cpp", "newdialog.h", - "newdialogwidget.cpp", "newdialogwidget.h", - "openwithdialog.cpp", "openwithdialog.h", - "promptoverwritedialog.cpp", "promptoverwritedialog.h", - "readonlyfilesdialog.cpp", "readonlyfilesdialog.h", - "restartdialog.cpp", "restartdialog.h", - "saveitemsdialog.cpp", "saveitemsdialog.h", - "settingsdialog.cpp", "settingsdialog.h", - "shortcutsettings.cpp", "shortcutsettings.h", - ] - } - - Group { - name: "Editor Manager" - prefix: "editormanager/" - files: [ - "documentmodel.cpp", "documentmodel.h", "documentmodel_p.h", - "editorarea.cpp", "editorarea.h", - "editormanager.cpp", "editormanager.h", "editormanager_p.h", - "editorview.cpp", "editorview.h", - "editorwindow.cpp", "editorwindow.h", - "ieditor.cpp", "ieditor.h", - "ieditorfactory.cpp", "ieditorfactory.h", "ieditorfactory_p.h", - "openeditorsview.cpp", "openeditorsview.h", - "openeditorswindow.cpp", "openeditorswindow.h", - "systemeditor.cpp", "systemeditor.h", - ] - } - - Group { - name: "Progress Manager" - prefix: "progressmanager/" - files: [ - "futureprogress.cpp", "futureprogress.h", - "processprogress.cpp", "processprogress.h", - "progressbar.cpp", "progressbar.h", - "progressmanager.cpp", "progressmanager.h", "progressmanager_p.h", - "progressview.cpp", "progressview.h", - "taskprogress.cpp", "taskprogress.h", - ] - } - - Group { - name: "ProgressManager_win" - condition: qbs.targetOS.contains("windows") - files: [ - "progressmanager/progressmanager_win.cpp", - ] - } - - Group { - name: "ProgressManager_mac" - condition: qbs.targetOS.contains("macos") - files: [ - "progressmanager/progressmanager_mac.mm", - ] - } - - Group { - name: "ProgressManager_x11" - condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos") - files: [ - "progressmanager/progressmanager_x11.cpp", - ] - } - - QtcTestFiles { - files: [ - "testdatadir.cpp", - "testdatadir.h", - "locator/locatorfiltertest.cpp", - "locator/locatorfiltertest.h", - "locator/locator_test.cpp" - ] - - cpp.defines: outer.concat(['SRCDIR="' + path + '"']) - } - - Group { - name: "Find" - prefix: "find/" - files: [ - "basetextfind.cpp", - "basetextfind.h", - "currentdocumentfind.cpp", - "currentdocumentfind.h", - "find.qrc", - "findplugin.cpp", - "findplugin.h", - "findtoolbar.cpp", - "findtoolbar.h", - "findtoolwindow.cpp", - "findtoolwindow.h", - "highlightscrollbarcontroller.cpp", - "highlightscrollbarcontroller.h", - "ifindfilter.cpp", - "ifindfilter.h", - "ifindsupport.cpp", - "ifindsupport.h", - "itemviewfind.cpp", - "itemviewfind.h", - "optionspopup.cpp", - "optionspopup.h", - "searchresulttreeitemdelegate.cpp", - "searchresulttreeitemdelegate.h", - "searchresulttreeitemroles.h", - "searchresulttreeitems.cpp", - "searchresulttreeitems.h", - "searchresulttreemodel.cpp", - "searchresulttreemodel.h", - "searchresulttreeview.cpp", - "searchresulttreeview.h", - "searchresultwidget.cpp", - "searchresultwidget.h", - "searchresultwindow.cpp", - "searchresultwindow.h", - "textfindconstants.h", - ] - } - - Group { - name: "Locator" - prefix: "locator/" - files: [ - "commandlocator.cpp", - "commandlocator.h", - "directoryfilter.cpp", - "directoryfilter.h", - "executefilter.cpp", - "executefilter.h", - "externaltoolsfilter.cpp", - "externaltoolsfilter.h", - "filesystemfilter.cpp", - "filesystemfilter.h", - "ilocatorfilter.cpp", - "ilocatorfilter.h", - "javascriptfilter.cpp", - "javascriptfilter.h", - "locatorconstants.h", - "locatorfiltersfilter.cpp", - "locatorfiltersfilter.h", - "locatormanager.cpp", - "locatormanager.h", - "locator.cpp", - "locator.h", - "locatorsettingspage.cpp", - "locatorsettingspage.h", - "locatorwidget.cpp", - "locatorwidget.h", - "opendocumentsfilter.cpp", - "opendocumentsfilter.h", - "spotlightlocatorfilter.h", - "spotlightlocatorfilter.cpp", - "urllocatorfilter.cpp", - "urllocatorfilter.h" - ] - } - - Group { - name: "Terminal" - prefix: "terminal/" - files: [ - "searchableterminal.cpp", - "searchableterminal.h", - ] - } - - Export { - Depends { name: "Aggregation" } - Depends { name: "Utils" } - } + Depends { name: "Utils" } } } diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 7e42fecd57f..7ff685a63c5 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -1,270 +1,261 @@ -import qbs 1.0 - -Project { +QtcPlugin { name: "Debugger" - QtcPlugin { - Depends { name: "Qt"; submodules: ["widgets", "network"] } - Depends { name: "Aggregation" } + Depends { name: "Qt"; submodules: ["network", "widgets"] } + + Depends { name: "Aggregation" } + Depends { name: "CPlusPlus" } + Depends { name: "LanguageUtils" } + Depends { name: "QmlDebug" } + Depends { name: "QmlJS" } + Depends { name: "Utils" } + + Depends { name: "Core" } + Depends { name: "CppEditor" } + Depends { name: "ProjectExplorer" } + Depends { name: "QtSupport" } + Depends { name: "TextEditor" } + + pluginRecommends: ["BinEditor"] + pluginTestDepends: ["QmakeProjectManager"] + + cpp.includePaths: base.concat([project.sharedSourcesDir + "/registryaccess"]) + cpp.enableExceptions: true + + Group { + name: "General" + files: [ + "breakhandler.cpp", "breakhandler.h", + "breakpoint.cpp", "breakpoint.h", + "commonoptionspage.cpp", "commonoptionspage.h", + "debugger.qrc", + "debugger_global.h", "debuggertr.h", + "debuggeractions.cpp", "debuggeractions.h", + "debuggerconstants.h", + "debuggericons.h", "debuggericons.cpp", + "debuggercore.h", + "debuggerdialogs.cpp", "debuggerdialogs.h", + "debuggerengine.cpp", "debuggerengine.h", + "debuggerinternalconstants.h", + "debuggeritem.cpp", "debuggeritem.h", + "debuggeritemmanager.cpp", "debuggeritemmanager.h", + "debuggerkitaspect.cpp", "debuggerkitaspect.h", + "debuggermainwindow.cpp", "debuggermainwindow.h", + "debuggerplugin.cpp", "debuggerplugin.h", + "debuggerprotocol.cpp", "debuggerprotocol.h", + "debuggerrunconfigurationaspect.cpp", "debuggerrunconfigurationaspect.h", + "debuggerruncontrol.cpp", "debuggerruncontrol.h", + "debuggersourcepathmappingwidget.cpp", "debuggersourcepathmappingwidget.h", + "debuggertooltipmanager.cpp", "debuggertooltipmanager.h", + "disassembleragent.cpp", "disassembleragent.h", + "disassemblerlines.cpp", "disassemblerlines.h", + "enginemanager.cpp", "enginemanager.h", + "imageviewer.cpp", "imageviewer.h", + "loadcoredialog.cpp", "loadcoredialog.h", + "localsandexpressionswindow.cpp", "localsandexpressionswindow.h", + "logwindow.cpp", "logwindow.h", + "memoryagent.cpp", "memoryagent.h", + "moduleshandler.cpp", "moduleshandler.h", + "outputcollector.cpp", "outputcollector.h", + "peripheralregisterhandler.cpp", "peripheralregisterhandler.h", + "procinterrupt.cpp", "procinterrupt.h", + "registerhandler.cpp", "registerhandler.h", + "sourceagent.cpp", "sourceagent.h", + "sourcefileshandler.cpp", "sourcefileshandler.h", + "sourceutils.cpp", "sourceutils.h", + "stackframe.cpp", "stackframe.h", + "stackhandler.cpp", "stackhandler.h", + "stackwindow.cpp", "stackwindow.h", + "terminal.cpp", "terminal.h", + "threaddata.h", + "threadshandler.cpp", "threadshandler.h", + "watchdata.cpp", "watchdata.h", + "watchdelegatewidgets.cpp", "watchdelegatewidgets.h", + "watchhandler.cpp", "watchhandler.h", + "watchutils.cpp", "watchutils.h", + "watchwindow.cpp", "watchwindow.h", + "simplifytype.cpp", "simplifytype.h", + "unstartedappwatcherdialog.cpp", "unstartedappwatcherdialog.h" + ] + } + + Group { + name: "cdb" + prefix: "cdb/" + files: [ + "cdbengine.cpp", "cdbengine.h", + "cdboptionspage.cpp", "cdboptionspage.h", + "cdbparsehelpers.cpp", "cdbparsehelpers.h", + "stringinputstream.cpp", "stringinputstream.h", + ] + } + + Group { + name: "gdb" + prefix: "gdb/" + files: [ + "gdbengine.cpp", "gdbengine.h", + "gdbsettings.cpp", "gdbsettings.h", + ] + } + + Group { + name: "lldb" + prefix: "lldb/" + files: [ + "lldbengine.cpp", "lldbengine.h" + ] + } + + Group { + name: "pdb" + prefix: "pdb/" + files: ["pdbengine.cpp", "pdbengine.h"] + } + + Group { + name: "dap" + prefix: "dap/" + files: [ + "cmakedapengine.cpp", "cmakedapengine.h", + "dapclient.cpp", "dapclient.h", + "dapengine.cpp", "dapengine.h", + "gdbdapengine.cpp", "gdbdapengine.h", + "pydapengine.cpp", "pydapengine.h", + ] + } + + Group { + name: "uvsc" + prefix: "uvsc/" + files: [ + "uvscclient.cpp", "uvscclient.h", + "uvscdatatypes.h", + "uvscengine.cpp", "uvscengine.h", + "uvscfunctions.h", + "uvscutils.cpp", "uvscutils.h", + ] + } + + Group { + name: "QML Debugger" + prefix: "qml/" + files: [ + "interactiveinterpreter.cpp", "interactiveinterpreter.h", + "qmlengine.cpp", "qmlengine.h", + "qmlengineutils.cpp", "qmlengineutils.h", + "qmlinspectoragent.cpp", "qmlinspectoragent.h", + "qmlv8debuggerclientconstants.h" + ] + } + + Group { + name: "Debugger Console" + prefix: "console/" + files: [ + "consoleitem.cpp", "consoleitem.h", + "consoleedit.cpp", "consoleedit.h", + "consoleitemdelegate.cpp", "consoleitemdelegate.h", + "consoleitemmodel.cpp", "consoleitemmodel.h", + "console.cpp", "console.h", + "consoleproxymodel.cpp", "consoleproxymodel.h", + "consoleview.cpp", "consoleview.h" + ] + } + + Group { + name: "shared" + prefix: "shared/" + files: [ + "cdbsymbolpathlisteditor.cpp", + "cdbsymbolpathlisteditor.h", + "hostutils.cpp", "hostutils.h", + "peutils.cpp", "peutils.h", + "symbolpathsdialog.cpp", "symbolpathsdialog.h" + ] + } + + Group { + name: "Images" + prefix: "images/" + files: ["*.png"] + } + + Group { + name: "Images/qml" + prefix: "images/qml/" + files: ["*.png"] + } + + Group { + name: "Images/analyzer" + prefix: "analyzer/images/" + files: ["*.png"] + } + + Group { + name: "RegistryAccess" + condition: qbs.targetOS.contains("windows") + prefix: project.sharedSourcesDir + "/registryaccess/" + files: [ + "registryaccess.cpp", + "registryaccess.h", + ] + } + + Group { + name: "RegisterPostMortem" + condition: qbs.targetOS.contains("windows") + files: [ + "registerpostmortemaction.cpp", + "registerpostmortemaction.h", + ] + } + + Properties { + condition: qbs.targetOS.contains("windows") + cpp.dynamicLibraries: [ + "advapi32", + "ole32", + "shell32" + ] + } + + Group { + name: "Analyzer" + prefix: "analyzer/" + files: [ + "analyzerbase.qrc", + "analyzerconstants.h", + "analyzericons.h", + "analyzermanager.h", + "analyzerrunconfigwidget.cpp", + "analyzerrunconfigwidget.h", + "analyzerutils.cpp", + "analyzerutils.h", + "detailederrorview.cpp", + "detailederrorview.h", + "diagnosticlocation.cpp", + "diagnosticlocation.h", + "startremotedialog.cpp", + "startremotedialog.h", + ] + } + + QtcTestFiles { + files: [ + "debuggerunittests.qrc", + ] + } + + Group { + name: "Unit test resources" + prefix: "unit-tests/" + fileTags: [] + files: ["**/*"] + } + + Export { Depends { name: "CPlusPlus" } - Depends { name: "QmlDebug" } - Depends { name: "LanguageUtils" } - Depends { name: "QmlJS" } - Depends { name: "Utils" } - - Depends { name: "Core" } - Depends { name: "CppEditor" } - Depends { name: "ProjectExplorer" } - Depends { name: "QtSupport" } - Depends { name: "TextEditor" } - - pluginTestDepends: [ - "QmakeProjectManager" - ] - - cpp.includePaths: base.concat([project.sharedSourcesDir + "/registryaccess"]) - cpp.enableExceptions: true - - pluginRecommends: [ - "CppEditor", - "BinEditor" - ] - - Group { - name: "General" - files: [ - "breakhandler.cpp", "breakhandler.h", - "breakpoint.cpp", "breakpoint.h", - "commonoptionspage.cpp", "commonoptionspage.h", - "debugger.qrc", - "debugger_global.h", "debuggertr.h", - "debuggeractions.cpp", "debuggeractions.h", - "debuggerconstants.h", - "debuggericons.h", "debuggericons.cpp", - "debuggercore.h", - "debuggerdialogs.cpp", "debuggerdialogs.h", - "debuggerengine.cpp", "debuggerengine.h", - "debuggerinternalconstants.h", - "debuggeritem.cpp", "debuggeritem.h", - "debuggeritemmanager.cpp", "debuggeritemmanager.h", - "debuggerkitaspect.cpp", "debuggerkitaspect.h", - "debuggermainwindow.cpp", "debuggermainwindow.h", - "debuggerplugin.cpp", "debuggerplugin.h", - "debuggerprotocol.cpp", "debuggerprotocol.h", - "debuggerrunconfigurationaspect.cpp", "debuggerrunconfigurationaspect.h", - "debuggerruncontrol.cpp", "debuggerruncontrol.h", - "debuggersourcepathmappingwidget.cpp", "debuggersourcepathmappingwidget.h", - "debuggertooltipmanager.cpp", "debuggertooltipmanager.h", - "disassembleragent.cpp", "disassembleragent.h", - "disassemblerlines.cpp", "disassemblerlines.h", - "enginemanager.cpp", "enginemanager.h", - "imageviewer.cpp", "imageviewer.h", - "loadcoredialog.cpp", "loadcoredialog.h", - "localsandexpressionswindow.cpp", "localsandexpressionswindow.h", - "logwindow.cpp", "logwindow.h", - "memoryagent.cpp", "memoryagent.h", - "moduleshandler.cpp", "moduleshandler.h", - "outputcollector.cpp", "outputcollector.h", - "peripheralregisterhandler.cpp", "peripheralregisterhandler.h", - "procinterrupt.cpp", "procinterrupt.h", - "registerhandler.cpp", "registerhandler.h", - "sourceagent.cpp", "sourceagent.h", - "sourcefileshandler.cpp", "sourcefileshandler.h", - "sourceutils.cpp", "sourceutils.h", - "stackframe.cpp", "stackframe.h", - "stackhandler.cpp", "stackhandler.h", - "stackwindow.cpp", "stackwindow.h", - "terminal.cpp", "terminal.h", - "threaddata.h", - "threadshandler.cpp", "threadshandler.h", - "watchdata.cpp", "watchdata.h", - "watchdelegatewidgets.cpp", "watchdelegatewidgets.h", - "watchhandler.cpp", "watchhandler.h", - "watchutils.cpp", "watchutils.h", - "watchwindow.cpp", "watchwindow.h", - "simplifytype.cpp", "simplifytype.h", - "unstartedappwatcherdialog.cpp", "unstartedappwatcherdialog.h" - ] - } - - Group { - name: "cdb" - prefix: "cdb/" - files: [ - "cdbengine.cpp", "cdbengine.h", - "cdboptionspage.cpp", "cdboptionspage.h", - "cdbparsehelpers.cpp", "cdbparsehelpers.h", - "stringinputstream.cpp", "stringinputstream.h", - ] - } - - Group { - name: "gdb" - prefix: "gdb/" - files: [ - "gdbengine.cpp", "gdbengine.h", - "gdbsettings.cpp", "gdbsettings.h", - ] - } - - Group { - name: "lldb" - prefix: "lldb/" - files: [ - "lldbengine.cpp", "lldbengine.h" - ] - } - - Group { - name: "pdb" - prefix: "pdb/" - files: ["pdbengine.cpp", "pdbengine.h"] - } - - Group { - name: "dap" - prefix: "dap/" - files: [ - "cmakedapengine.cpp", "cmakedapengine.h", - "dapclient.cpp", "dapclient.h", - "dapengine.cpp", "dapengine.h", - "gdbdapengine.cpp", "gdbdapengine.h", - "pydapengine.cpp", "pydapengine.h", - ] - } - - Group { - name: "uvsc" - prefix: "uvsc/" - files: [ - "uvscclient.cpp", "uvscclient.h", - "uvscdatatypes.h", - "uvscengine.cpp", "uvscengine.h", - "uvscfunctions.h", - "uvscutils.cpp", "uvscutils.h", - ] - } - - Group { - name: "QML Debugger" - prefix: "qml/" - files: [ - "interactiveinterpreter.cpp", "interactiveinterpreter.h", - "qmlengine.cpp", "qmlengine.h", - "qmlengineutils.cpp", "qmlengineutils.h", - "qmlinspectoragent.cpp", "qmlinspectoragent.h", - "qmlv8debuggerclientconstants.h" - ] - } - - Group { - name: "Debugger Console" - prefix: "console/" - files: [ - "consoleitem.cpp", "consoleitem.h", - "consoleedit.cpp", "consoleedit.h", - "consoleitemdelegate.cpp", "consoleitemdelegate.h", - "consoleitemmodel.cpp", "consoleitemmodel.h", - "console.cpp", "console.h", - "consoleproxymodel.cpp", "consoleproxymodel.h", - "consoleview.cpp", "consoleview.h" - ] - } - - Group { - name: "shared" - prefix: "shared/" - files: [ - "cdbsymbolpathlisteditor.cpp", - "cdbsymbolpathlisteditor.h", - "hostutils.cpp", "hostutils.h", - "peutils.cpp", "peutils.h", - "symbolpathsdialog.cpp", "symbolpathsdialog.h" - ] - } - - Group { - name: "Images" - prefix: "images/" - files: ["*.png"] - } - - Group { - name: "Images/qml" - prefix: "images/qml/" - files: ["*.png"] - } - - Group { - name: "Images/analyzer" - prefix: "analyzer/images/" - files: ["*.png"] - } - - Group { - name: "RegistryAccess" - condition: qbs.targetOS.contains("windows") - prefix: project.sharedSourcesDir + "/registryaccess/" - files: [ - "registryaccess.cpp", - "registryaccess.h", - ] - } - - Group { - name: "RegisterPostMortem" - condition: qbs.targetOS.contains("windows") - files: [ - "registerpostmortemaction.cpp", - "registerpostmortemaction.h", - ] - } - - Properties { - condition: qbs.targetOS.contains("windows") - cpp.dynamicLibraries: [ - "advapi32", - "ole32", - "shell32" - ] - } - - Group { - name: "Analyzer" - prefix: "analyzer/" - files: [ - "analyzerbase.qrc", - "analyzerconstants.h", - "analyzericons.h", - "analyzermanager.h", - "analyzerrunconfigwidget.cpp", - "analyzerrunconfigwidget.h", - "analyzerutils.cpp", - "analyzerutils.h", - "detailederrorview.cpp", - "detailederrorview.h", - "diagnosticlocation.cpp", - "diagnosticlocation.h", - "startremotedialog.cpp", - "startremotedialog.h", - ] - } - - QtcTestFiles { - files: [ - "debuggerunittests.qrc", - ] - } - - Group { - name: "Unit test resources" - prefix: "unit-tests/" - fileTags: [] - files: ["**/*"] - } - - Export { - Depends { name: "CPlusPlus" } - } } } diff --git a/src/plugins/help/help.qbs b/src/plugins/help/help.qbs index a5eefb620dd..df960310e5b 100644 --- a/src/plugins/help/help.qbs +++ b/src/plugins/help/help.qbs @@ -1,90 +1,86 @@ import qbs.Utilities -Project { +QtcPlugin { name: "Help" - QtcPlugin { - name: "Help" + Depends { name: "Qt"; submodules: ["help", "network", "sql"] } + Depends { name: "Qt.printsupport" } + Depends { name: "Qt.webenginewidgets"; required: false } - Depends { name: "Qt"; submodules: ["help", "network", "sql"]; } - Depends { name: "Qt.printsupport" } - Depends { name: "Qt.webenginewidgets"; required: false } + Depends { name: "Aggregation" } + Depends { name: "Utils" } - Depends { name: "Aggregation" } - Depends { name: "Utils" } + Depends { name: "Core" } + Depends { name: "ProjectExplorer" } - Depends { name: "Core" } - Depends { name: "ProjectExplorer" } + Depends { name: "qlitehtml"; required: false } - Depends { name: "qlitehtml"; required: false } + cpp.defines: { + var defines = base.concat(["QT_CLUCENE_SUPPORT"]); + if (Qt.webenginewidgets.present) + defines.push("QTC_WEBENGINE_HELPVIEWER"); + if (qlitehtml.present) + defines.push("QTC_LITEHTML_HELPVIEWER") + return defines; + } - cpp.defines: { - var defines = base.concat(["QT_CLUCENE_SUPPORT"]); - if (Qt.webenginewidgets.present) - defines.push("QTC_WEBENGINE_HELPVIEWER"); - if (qlitehtml.present) - defines.push("QTC_LITEHTML_HELPVIEWER") - return defines; - } + // We include headers from src/shared/help, and their sources include headers from here... + cpp.includePaths: base.concat([sharedSources.prefix, path]) - // We include headers from src/shared/help, and their sources include headers from here... - cpp.includePaths: base.concat([sharedSources.prefix, path]) + Group { + name: "Sources" + files: [ + "docsettingspage.cpp", "docsettingspage.h", + "filtersettingspage.cpp", "filtersettingspage.h", + "generalsettingspage.cpp", "generalsettingspage.h", + "help.qrc", + "helpconstants.h", + "helpfindsupport.cpp", "helpfindsupport.h", + "helpindexfilter.cpp", "helpindexfilter.h", + "helpmanager.cpp", "helpmanager.h", + "helpplugin.cpp", "helpplugin.h", + "helpviewer.cpp", "helpviewer.h", + "helpwidget.cpp", "helpwidget.h", + "helptr.h", + "localhelpmanager.cpp", "localhelpmanager.h", + "openpagesmanager.cpp", "openpagesmanager.h", + "openpagesswitcher.cpp", "openpagesswitcher.h", + "openpageswidget.cpp", "openpageswidget.h", + "searchtaskhandler.cpp", "searchtaskhandler.h", + "searchwidget.cpp", "searchwidget.h", + "textbrowserhelpviewer.cpp", "textbrowserhelpviewer.h", + "xbelsupport.cpp", "xbelsupport.h", + ] + } - Group { - name: "Sources" - files: [ - "docsettingspage.cpp", "docsettingspage.h", - "filtersettingspage.cpp", "filtersettingspage.h", - "generalsettingspage.cpp", "generalsettingspage.h", - "help.qrc", - "helpconstants.h", - "helpfindsupport.cpp", "helpfindsupport.h", - "helpindexfilter.cpp", "helpindexfilter.h", - "helpmanager.cpp", "helpmanager.h", - "helpplugin.cpp", "helpplugin.h", - "helpviewer.cpp", "helpviewer.h", - "helpwidget.cpp", "helpwidget.h", - "helptr.h", - "localhelpmanager.cpp", "localhelpmanager.h", - "openpagesmanager.cpp", "openpagesmanager.h", - "openpagesswitcher.cpp", "openpagesswitcher.h", - "openpageswidget.cpp", "openpageswidget.h", - "searchtaskhandler.cpp", "searchtaskhandler.h", - "searchwidget.cpp", "searchwidget.h", - "textbrowserhelpviewer.cpp", "textbrowserhelpviewer.h", - "xbelsupport.cpp", "xbelsupport.h", - ] - } + Group { + name: "WebEngine Sources" + condition: Qt.webenginewidgets.present + files: [ + "webenginehelpviewer.cpp", "webenginehelpviewer.h" + ] + } - Group { - name: "WebEngine Sources" - condition: Qt.webenginewidgets.present - files: [ - "webenginehelpviewer.cpp", "webenginehelpviewer.h" - ] - } + Group { + name: "litehtml-specific sources" + condition: qlitehtml.present + cpp.warningLevel: "none" + files: [ + "litehtmlhelpviewer.cpp", + "litehtmlhelpviewer.h", + ] + } - Group { - name: "litehtml-specific sources" - condition: qlitehtml.present - cpp.warningLevel: "none" - files: [ - "litehtmlhelpviewer.cpp", - "litehtmlhelpviewer.h", - ] - } - - Group { - id: sharedSources - name: "Shared Sources" - prefix: project.sharedSourcesDir + "/help/" - files: [ - "bookmarkmanager.cpp", "bookmarkmanager.h", - "contentwindow.cpp", "contentwindow.h", - "helpicons.h", - "indexwindow.cpp", "indexwindow.h", - "topicchooser.cpp", "topicchooser.h", - ] - } + Group { + id: sharedSources + name: "Shared Sources" + prefix: project.sharedSourcesDir + "/help/" + files: [ + "bookmarkmanager.cpp", "bookmarkmanager.h", + "contentwindow.cpp", "contentwindow.h", + "helpicons.h", + "indexwindow.cpp", "indexwindow.h", + "topicchooser.cpp", "topicchooser.h", + ] } } diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 611083439d0..5f24d9f12da 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -1,261 +1,257 @@ -import qbs 1.0 - -Project { +QtcPlugin { name: "ProjectExplorer" - QtcPlugin { - Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "qml"] } - Depends { name: "Aggregation" } - Depends { name: "Utils" } + Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "qml"] } + Depends { name: "Aggregation" } + Depends { name: "Utils" } - Depends { name: "Core" } - Depends { name: "TextEditor" } + Depends { name: "Core" } + Depends { name: "TextEditor" } - Depends { name: "libclang"; required: false } - Depends { name: "clang_defines" } + Depends { name: "libclang"; required: false } + Depends { name: "clang_defines" } - pluginTestDepends: ["GenericProjectManager"] + pluginTestDepends: ["GenericProjectManager"] - Group { - name: "General" - files: [ - "abi.cpp", "abi.h", - "abiwidget.cpp", "abiwidget.h", - "abstractprocessstep.cpp", "abstractprocessstep.h", - "addrunconfigdialog.cpp", "addrunconfigdialog.h", - "allprojectsfilter.cpp", "allprojectsfilter.h", - "allprojectsfind.cpp", "allprojectsfind.h", - "appoutputpane.cpp", "appoutputpane.h", - "baseprojectwizarddialog.cpp", "baseprojectwizarddialog.h", - "buildaspects.cpp", "buildaspects.h", - "buildconfiguration.cpp", "buildconfiguration.h", - "buildinfo.cpp", "buildinfo.h", - "buildmanager.cpp", "buildmanager.h", - "buildprogress.cpp", "buildprogress.h", - "buildpropertiessettings.cpp", "buildpropertiessettings.h", - "buildsettingspropertiespage.cpp", "buildsettingspropertiespage.h", - "buildstep.cpp", "buildstep.h", - "buildsteplist.cpp", "buildsteplist.h", - "buildstepspage.cpp", "buildstepspage.h", - "buildsystem.cpp", "buildsystem.h", - "buildtargetinfo.h", - "buildtargettype.h", - "clangparser.cpp", "clangparser.h", - "codestylesettingspropertiespage.cpp", "codestylesettingspropertiespage.h", - "compileoutputwindow.cpp", "compileoutputwindow.h", - "configtaskhandler.cpp", "configtaskhandler.h", - "copystep.cpp", "copystep.h", - "copytaskhandler.cpp", "copytaskhandler.h", - "currentprojectfilter.cpp", "currentprojectfilter.h", - "currentprojectfind.cpp", "currentprojectfind.h", - "customexecutablerunconfiguration.cpp", "customexecutablerunconfiguration.h", - "customparser.cpp", "customparser.h", - "customparserconfigdialog.cpp", "customparserconfigdialog.h", - "customparserssettingspage.cpp", "customparserssettingspage.h", - "customtoolchain.cpp", "customtoolchain.h", - "dependenciespanel.cpp", "dependenciespanel.h", - "deployablefile.cpp", "deployablefile.h", - "deployconfiguration.cpp", "deployconfiguration.h", - "deploymentdata.cpp", - "deploymentdata.h", - "deploymentdataview.cpp", - "deploymentdataview.h", - "desktoprunconfiguration.cpp", "desktoprunconfiguration.h", - "editorconfiguration.cpp", "editorconfiguration.h", - "editorsettingspropertiespage.cpp", "editorsettingspropertiespage.h", - "environmentaspect.cpp", "environmentaspect.h", - "environmentaspectwidget.cpp", "environmentaspectwidget.h", - "environmentwidget.cpp", "environmentwidget.h", - "expanddata.cpp", "expanddata.h", - "extraabi.cpp", "extraabi.h", - "extracompiler.cpp", "extracompiler.h", - "fileinsessionfinder.cpp", "fileinsessionfinder.h", - "filesinallprojectsfind.cpp", "filesinallprojectsfind.h", - "filterkitaspectsdialog.cpp", "filterkitaspectsdialog.h", - "gccparser.cpp", "gccparser.h", - "gcctoolchain.cpp", "gcctoolchain.h", - "gnumakeparser.cpp", "gnumakeparser.h", - "headerpath.h", - "importwidget.cpp", "importwidget.h", - "ioutputparser.cpp", "ioutputparser.h", - "ipotentialkit.h", - "itaskhandler.h", - "kit.cpp", "kit.h", - "kitaspects.cpp", "kitaspects.h", - "kitchooser.cpp", "kitchooser.h", - "kitfeatureprovider.h", - "kitmanager.cpp", "kitmanager.h", - "kitmanagerconfigwidget.cpp", "kitmanagerconfigwidget.h", - "kitoptionspage.cpp", "kitoptionspage.h", - "ldparser.cpp", "ldparser.h", - "lldparser.cpp", "lldparser.h", - "linuxiccparser.cpp", "linuxiccparser.h", - "makestep.cpp", "makestep.h", - "miniprojecttargetselector.cpp", "miniprojecttargetselector.h", - "msvcparser.cpp", "msvcparser.h", - "namedwidget.cpp", "namedwidget.h", - "osparser.cpp", "osparser.h", - "panelswidget.cpp", "panelswidget.h", - "parseissuesdialog.cpp", "parseissuesdialog.h", - "processparameters.cpp", "processparameters.h", - "processstep.cpp", "processstep.h", - "project.cpp", "project.h", - "projectcommentssettings.cpp", "projectcommentssettings.h", - "projectconfiguration.cpp", "projectconfiguration.h", - "projectconfigurationmodel.cpp", "projectconfigurationmodel.h", - "projectexplorer.cpp", "projectexplorer.h", - "projectexplorer.qrc", - "projectexplorer_export.h", - "projectexplorerconstants.cpp", - "projectexplorerconstants.h", - "projectexplorericons.h", "projectexplorericons.cpp", - "projectexplorersettings.h", "projectexplorersettings.cpp", - "projectexplorertr.h", - "projectfilewizardextension.cpp", "projectfilewizardextension.h", - "projectimporter.cpp", "projectimporter.h", - "projectmacro.cpp", "projectmacro.h", - "projectmanager.cpp", "projectmanager.h", - "projectmodels.cpp", "projectmodels.h", - "projectnodes.cpp", "projectnodes.h", - "projectpanelfactory.cpp", "projectpanelfactory.h", - "projectsettingswidget.cpp", "projectsettingswidget.h", - "projecttree.cpp", - "projecttree.h", - "projecttreewidget.cpp", "projecttreewidget.h", - "projectwindow.cpp", "projectwindow.h", - "projectwizardpage.cpp", "projectwizardpage.h", - "rawprojectpart.cpp", "rawprojectpart.h", - "removetaskhandler.cpp", "removetaskhandler.h", - "runconfiguration.cpp", "runconfiguration.h", - "runcontrol.cpp", "runcontrol.h", - "runconfigurationaspects.cpp", "runconfigurationaspects.h", - "runsettingspropertiespage.cpp", "runsettingspropertiespage.h", - "sanitizerparser.cpp", "sanitizerparser.h", - "selectablefilesmodel.cpp", "selectablefilesmodel.h", - "showineditortaskhandler.cpp", "showineditortaskhandler.h", - "showoutputtaskhandler.cpp", "showoutputtaskhandler.h", - "simpleprojectwizard.cpp", "simpleprojectwizard.h", - "target.cpp", "target.h", - "targetsettingspanel.cpp", "targetsettingspanel.h", - "targetsetuppage.cpp", "targetsetuppage.h", - "targetsetupwidget.cpp", "targetsetupwidget.h", - "task.cpp", "task.h", - "taskfile.cpp", "taskfile.h", - "taskhub.cpp", "taskhub.h", - "taskmodel.cpp", "taskmodel.h", - "taskwindow.cpp", "taskwindow.h", - "toolchain.cpp", "toolchain.h", - "toolchaincache.h", - "toolchainconfigwidget.cpp", "toolchainconfigwidget.h", - "toolchainmanager.cpp", "toolchainmanager.h", - "toolchainoptionspage.cpp", "toolchainoptionspage.h", - "toolchainsettingsaccessor.cpp", "toolchainsettingsaccessor.h", - "treescanner.cpp", "treescanner.h", - "userfileaccessor.cpp", "userfileaccessor.h", - "vcsannotatetaskhandler.cpp", "vcsannotatetaskhandler.h", - "waitforstopdialog.cpp", "waitforstopdialog.h", - "windebuginterface.cpp", "windebuginterface.h", - "xcodebuildparser.cpp", "xcodebuildparser.h" - ] - } + Group { + name: "General" + files: [ + "abi.cpp", "abi.h", + "abiwidget.cpp", "abiwidget.h", + "abstractprocessstep.cpp", "abstractprocessstep.h", + "addrunconfigdialog.cpp", "addrunconfigdialog.h", + "allprojectsfilter.cpp", "allprojectsfilter.h", + "allprojectsfind.cpp", "allprojectsfind.h", + "appoutputpane.cpp", "appoutputpane.h", + "baseprojectwizarddialog.cpp", "baseprojectwizarddialog.h", + "buildaspects.cpp", "buildaspects.h", + "buildconfiguration.cpp", "buildconfiguration.h", + "buildinfo.cpp", "buildinfo.h", + "buildmanager.cpp", "buildmanager.h", + "buildprogress.cpp", "buildprogress.h", + "buildpropertiessettings.cpp", "buildpropertiessettings.h", + "buildsettingspropertiespage.cpp", "buildsettingspropertiespage.h", + "buildstep.cpp", "buildstep.h", + "buildsteplist.cpp", "buildsteplist.h", + "buildstepspage.cpp", "buildstepspage.h", + "buildsystem.cpp", "buildsystem.h", + "buildtargetinfo.h", + "buildtargettype.h", + "clangparser.cpp", "clangparser.h", + "codestylesettingspropertiespage.cpp", "codestylesettingspropertiespage.h", + "compileoutputwindow.cpp", "compileoutputwindow.h", + "configtaskhandler.cpp", "configtaskhandler.h", + "copystep.cpp", "copystep.h", + "copytaskhandler.cpp", "copytaskhandler.h", + "currentprojectfilter.cpp", "currentprojectfilter.h", + "currentprojectfind.cpp", "currentprojectfind.h", + "customexecutablerunconfiguration.cpp", "customexecutablerunconfiguration.h", + "customparser.cpp", "customparser.h", + "customparserconfigdialog.cpp", "customparserconfigdialog.h", + "customparserssettingspage.cpp", "customparserssettingspage.h", + "customtoolchain.cpp", "customtoolchain.h", + "dependenciespanel.cpp", "dependenciespanel.h", + "deployablefile.cpp", "deployablefile.h", + "deployconfiguration.cpp", "deployconfiguration.h", + "deploymentdata.cpp", + "deploymentdata.h", + "deploymentdataview.cpp", + "deploymentdataview.h", + "desktoprunconfiguration.cpp", "desktoprunconfiguration.h", + "editorconfiguration.cpp", "editorconfiguration.h", + "editorsettingspropertiespage.cpp", "editorsettingspropertiespage.h", + "environmentaspect.cpp", "environmentaspect.h", + "environmentaspectwidget.cpp", "environmentaspectwidget.h", + "environmentwidget.cpp", "environmentwidget.h", + "expanddata.cpp", "expanddata.h", + "extraabi.cpp", "extraabi.h", + "extracompiler.cpp", "extracompiler.h", + "fileinsessionfinder.cpp", "fileinsessionfinder.h", + "filesinallprojectsfind.cpp", "filesinallprojectsfind.h", + "filterkitaspectsdialog.cpp", "filterkitaspectsdialog.h", + "gccparser.cpp", "gccparser.h", + "gcctoolchain.cpp", "gcctoolchain.h", + "gnumakeparser.cpp", "gnumakeparser.h", + "headerpath.h", + "importwidget.cpp", "importwidget.h", + "ioutputparser.cpp", "ioutputparser.h", + "ipotentialkit.h", + "itaskhandler.h", + "kit.cpp", "kit.h", + "kitaspects.cpp", "kitaspects.h", + "kitchooser.cpp", "kitchooser.h", + "kitfeatureprovider.h", + "kitmanager.cpp", "kitmanager.h", + "kitmanagerconfigwidget.cpp", "kitmanagerconfigwidget.h", + "kitoptionspage.cpp", "kitoptionspage.h", + "ldparser.cpp", "ldparser.h", + "lldparser.cpp", "lldparser.h", + "linuxiccparser.cpp", "linuxiccparser.h", + "makestep.cpp", "makestep.h", + "miniprojecttargetselector.cpp", "miniprojecttargetselector.h", + "msvcparser.cpp", "msvcparser.h", + "namedwidget.cpp", "namedwidget.h", + "osparser.cpp", "osparser.h", + "panelswidget.cpp", "panelswidget.h", + "parseissuesdialog.cpp", "parseissuesdialog.h", + "processparameters.cpp", "processparameters.h", + "processstep.cpp", "processstep.h", + "project.cpp", "project.h", + "projectcommentssettings.cpp", "projectcommentssettings.h", + "projectconfiguration.cpp", "projectconfiguration.h", + "projectconfigurationmodel.cpp", "projectconfigurationmodel.h", + "projectexplorer.cpp", "projectexplorer.h", + "projectexplorer.qrc", + "projectexplorer_export.h", + "projectexplorerconstants.cpp", + "projectexplorerconstants.h", + "projectexplorericons.h", "projectexplorericons.cpp", + "projectexplorersettings.h", "projectexplorersettings.cpp", + "projectexplorertr.h", + "projectfilewizardextension.cpp", "projectfilewizardextension.h", + "projectimporter.cpp", "projectimporter.h", + "projectmacro.cpp", "projectmacro.h", + "projectmanager.cpp", "projectmanager.h", + "projectmodels.cpp", "projectmodels.h", + "projectnodes.cpp", "projectnodes.h", + "projectpanelfactory.cpp", "projectpanelfactory.h", + "projectsettingswidget.cpp", "projectsettingswidget.h", + "projecttree.cpp", + "projecttree.h", + "projecttreewidget.cpp", "projecttreewidget.h", + "projectwindow.cpp", "projectwindow.h", + "projectwizardpage.cpp", "projectwizardpage.h", + "rawprojectpart.cpp", "rawprojectpart.h", + "removetaskhandler.cpp", "removetaskhandler.h", + "runconfiguration.cpp", "runconfiguration.h", + "runcontrol.cpp", "runcontrol.h", + "runconfigurationaspects.cpp", "runconfigurationaspects.h", + "runsettingspropertiespage.cpp", "runsettingspropertiespage.h", + "sanitizerparser.cpp", "sanitizerparser.h", + "selectablefilesmodel.cpp", "selectablefilesmodel.h", + "showineditortaskhandler.cpp", "showineditortaskhandler.h", + "showoutputtaskhandler.cpp", "showoutputtaskhandler.h", + "simpleprojectwizard.cpp", "simpleprojectwizard.h", + "target.cpp", "target.h", + "targetsettingspanel.cpp", "targetsettingspanel.h", + "targetsetuppage.cpp", "targetsetuppage.h", + "targetsetupwidget.cpp", "targetsetupwidget.h", + "task.cpp", "task.h", + "taskfile.cpp", "taskfile.h", + "taskhub.cpp", "taskhub.h", + "taskmodel.cpp", "taskmodel.h", + "taskwindow.cpp", "taskwindow.h", + "toolchain.cpp", "toolchain.h", + "toolchaincache.h", + "toolchainconfigwidget.cpp", "toolchainconfigwidget.h", + "toolchainmanager.cpp", "toolchainmanager.h", + "toolchainoptionspage.cpp", "toolchainoptionspage.h", + "toolchainsettingsaccessor.cpp", "toolchainsettingsaccessor.h", + "treescanner.cpp", "treescanner.h", + "userfileaccessor.cpp", "userfileaccessor.h", + "vcsannotatetaskhandler.cpp", "vcsannotatetaskhandler.h", + "waitforstopdialog.cpp", "waitforstopdialog.h", + "windebuginterface.cpp", "windebuginterface.h", + "xcodebuildparser.cpp", "xcodebuildparser.h" + ] + } - Group { - name: "Project Welcome Page" - files: [ - "projectwelcomepage.cpp", - "projectwelcomepage.h" - ] - } + Group { + name: "Project Welcome Page" + files: [ + "projectwelcomepage.cpp", + "projectwelcomepage.h" + ] + } - Group { - name: "JsonWizard" - prefix: "jsonwizard/" - files: [ - "jsonfieldpage.cpp", "jsonfieldpage_p.h", "jsonfieldpage.h", - "jsonfilepage.cpp", "jsonfilepage.h", - "jsonkitspage.cpp", "jsonkitspage.h", - "jsonprojectpage.cpp", "jsonprojectpage.h", - "jsonsummarypage.cpp", "jsonsummarypage.h", - "jsonwizard.cpp", "jsonwizard.h", - "jsonwizardfactory.cpp", "jsonwizardfactory.h", - "jsonwizardfilegenerator.cpp", "jsonwizardfilegenerator.h", - "jsonwizardgeneratorfactory.cpp", "jsonwizardgeneratorfactory.h", - "jsonwizardpagefactory.cpp", "jsonwizardpagefactory.h", - "jsonwizardpagefactory_p.cpp", "jsonwizardpagefactory_p.h", - "jsonwizardscannergenerator.cpp", "jsonwizardscannergenerator.h", - "wizarddebug.h" - ] - } + Group { + name: "JsonWizard" + prefix: "jsonwizard/" + files: [ + "jsonfieldpage.cpp", "jsonfieldpage_p.h", "jsonfieldpage.h", + "jsonfilepage.cpp", "jsonfilepage.h", + "jsonkitspage.cpp", "jsonkitspage.h", + "jsonprojectpage.cpp", "jsonprojectpage.h", + "jsonsummarypage.cpp", "jsonsummarypage.h", + "jsonwizard.cpp", "jsonwizard.h", + "jsonwizardfactory.cpp", "jsonwizardfactory.h", + "jsonwizardfilegenerator.cpp", "jsonwizardfilegenerator.h", + "jsonwizardgeneratorfactory.cpp", "jsonwizardgeneratorfactory.h", + "jsonwizardpagefactory.cpp", "jsonwizardpagefactory.h", + "jsonwizardpagefactory_p.cpp", "jsonwizardpagefactory_p.h", + "jsonwizardscannergenerator.cpp", "jsonwizardscannergenerator.h", + "wizarddebug.h" + ] + } - Group { - name: "CustomWizard" - prefix: "customwizard/" - files: [ - "customwizard.cpp", "customwizard.h", - "customwizardpage.cpp", "customwizardpage.h", - "customwizardparameters.cpp", "customwizardparameters.h", - "customwizardscriptgenerator.cpp", "customwizardscriptgenerator.h" - ] - } + Group { + name: "CustomWizard" + prefix: "customwizard/" + files: [ + "customwizard.cpp", "customwizard.h", + "customwizardpage.cpp", "customwizardpage.h", + "customwizardparameters.cpp", "customwizardparameters.h", + "customwizardscriptgenerator.cpp", "customwizardscriptgenerator.h" + ] + } - Group { - name: "Device Support" - prefix: "devicesupport/" - files: [ - "desktopdevice.cpp", "desktopdevice.h", - "desktopdevicefactory.cpp", "desktopdevicefactory.h", - "devicecheckbuildstep.cpp", "devicecheckbuildstep.h", - "devicefactoryselectiondialog.cpp", "devicefactoryselectiondialog.h", - "devicemanager.cpp", "devicemanager.h", - "devicemanagermodel.cpp", "devicemanagermodel.h", - "deviceprocessesdialog.cpp", "deviceprocessesdialog.h", - "devicesettingspage.cpp", "devicesettingspage.h", - "devicetestdialog.cpp", "devicetestdialog.h", - "deviceusedportsgatherer.cpp", "deviceusedportsgatherer.h", - "filetransfer.cpp", "filetransfer.h", - "filetransferinterface.h", - "idevice.cpp", "idevice.h", - "idevicefactory.cpp", "idevicefactory.h", - "idevicefwd.h", - "idevicewidget.h", - "processlist.cpp", "processlist.h", - "sshparameters.cpp", "sshparameters.h", - "sshsettings.cpp", "sshsettings.h", - "sshsettingspage.cpp", "sshsettingspage.h", - "desktopprocesssignaloperation.cpp", "desktopprocesssignaloperation.h" - ] - } + Group { + name: "Device Support" + prefix: "devicesupport/" + files: [ + "desktopdevice.cpp", "desktopdevice.h", + "desktopdevicefactory.cpp", "desktopdevicefactory.h", + "devicecheckbuildstep.cpp", "devicecheckbuildstep.h", + "devicefactoryselectiondialog.cpp", "devicefactoryselectiondialog.h", + "devicemanager.cpp", "devicemanager.h", + "devicemanagermodel.cpp", "devicemanagermodel.h", + "deviceprocessesdialog.cpp", "deviceprocessesdialog.h", + "devicesettingspage.cpp", "devicesettingspage.h", + "devicetestdialog.cpp", "devicetestdialog.h", + "deviceusedportsgatherer.cpp", "deviceusedportsgatherer.h", + "filetransfer.cpp", "filetransfer.h", + "filetransferinterface.h", + "idevice.cpp", "idevice.h", + "idevicefactory.cpp", "idevicefactory.h", + "idevicefwd.h", + "idevicewidget.h", + "processlist.cpp", "processlist.h", + "sshparameters.cpp", "sshparameters.h", + "sshsettings.cpp", "sshsettings.h", + "sshsettingspage.cpp", "sshsettingspage.h", + "desktopprocesssignaloperation.cpp", "desktopprocesssignaloperation.h" + ] + } - Group { - name: "Images" - prefix: "images/" - files: ["*.png"] - } + Group { + name: "Images" + prefix: "images/" + files: ["*.png"] + } - Group { - name: "WindowsToolChains" - condition: qbs.targetOS.contains("windows") || qtc.testsEnabled - files: [ - "msvctoolchain.cpp", - "msvctoolchain.h", - ] - } + Group { + name: "WindowsToolChains" + condition: qbs.targetOS.contains("windows") || qtc.testsEnabled + files: [ + "msvctoolchain.cpp", + "msvctoolchain.h", + ] + } - QtcTestFiles { - files: ["outputparser_test.h", "outputparser_test.cpp"] - } + QtcTestFiles { + files: ["outputparser_test.h", "outputparser_test.cpp"] + } - Group { - name: "Test resources" - condition: qtc.testsEnabled - files: ["testdata/**"] - fileTags: ["qt.core.resource_data"] - Qt.core.resourcePrefix: "/projectexplorer" - Qt.core.resourceSourceBase: path - } + Group { + name: "Test resources" + condition: qtc.testsEnabled + files: ["testdata/**"] + fileTags: ["qt.core.resource_data"] + Qt.core.resourcePrefix: "/projectexplorer" + Qt.core.resourceSourceBase: path + } - Export { - Depends { name: "Qt.network" } - } + Export { + Depends { name: "Qt.network" } } } diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs index a7fe09d05b0..9252ad10503 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs @@ -1,85 +1,81 @@ -import qbs 1.0 - -Project { +QtcPlugin { name: "QmakeProjectManager" - QtcPlugin { - Depends { name: "Qt"; submodules: ["widgets", "network"] } - Depends { name: "QmlJS" } - Depends { name: "Utils" } + Depends { name: "Qt"; submodules: ["widgets", "network"] } + Depends { name: "QmlJS" } + Depends { name: "Utils" } - Depends { name: "Core" } - Depends { name: "ProjectExplorer" } + Depends { name: "Core" } + Depends { name: "ProjectExplorer" } + Depends { name: "QtSupport" } + Depends { name: "CppEditor" } + Depends { name: "TextEditor" } + Depends { name: "ResourceEditor" } + + Group { + name: "General" + files: [ + "addlibrarywizard.cpp", "addlibrarywizard.h", + "librarydetailscontroller.cpp", "librarydetailscontroller.h", + "makefileparse.cpp", "makefileparse.h", + "profilecompletionassist.cpp", "profilecompletionassist.h", + "profileeditor.cpp", "profileeditor.h", + "profilehighlighter.cpp", "profilehighlighter.h", + "profilehoverhandler.cpp", "profilehoverhandler.h", + "qmakebuildinfo.h", + "qmakekitaspect.cpp", "qmakekitaspect.h", + "qmakemakestep.cpp", "qmakemakestep.h", + "qmakeparser.cpp", "qmakeparser.h", + "qmakeparsernodes.cpp", "qmakeparsernodes.h", + "qmakeprojectimporter.cpp", "qmakeprojectimporter.h", + "qmakesettings.cpp", "qmakesettings.h", + "qmakestep.cpp", "qmakestep.h", + "qmakebuildconfiguration.cpp", "qmakebuildconfiguration.h", + "qmakenodes.cpp", "qmakenodes.h", + "qmakenodetreebuilder.cpp", "qmakenodetreebuilder.h", + "qmakeproject.cpp", "qmakeproject.h", + "qmakeprojectmanager.qrc", + "qmakeprojectmanager_global.h", "qmakeprojectmanagertr.h", + "qmakeprojectmanagerconstants.h", + "qmakeprojectmanagerplugin.cpp", "qmakeprojectmanagerplugin.h", + ] + } + + Group { + name: "Custom Widget Wizard" + prefix: "customwidgetwizard/" + files: [ + "classdefinition.cpp", "classdefinition.h", + "classlist.cpp", "classlist.h", + "customwidgetpluginwizardpage.cpp", "customwidgetpluginwizardpage.h", + "customwidgetwidgetswizardpage.cpp", "customwidgetwidgetswizardpage.h", + "customwidgetwizard.cpp", "customwidgetwizard.h", + "customwidgetwizarddialog.cpp", "customwidgetwizarddialog.h", + "filenamingparameters.h", + "plugingenerator.cpp", "plugingenerator.h", + "pluginoptions.h" + ] + } + + Group { + name: "Wizards" + prefix: "wizards/" + files: [ + "qtprojectparameters.cpp", "qtprojectparameters.h", + "qtwizard.cpp", "qtwizard.h", + "subdirsprojectwizard.cpp", "subdirsprojectwizard.h", + "subdirsprojectwizarddialog.cpp", "subdirsprojectwizarddialog.h", + "wizards.qrc" + ] + } + + Group { + name: "Wizard Images" + prefix: "wizards/images/" + files: ["*.png"] + } + + Export { Depends { name: "QtSupport" } - Depends { name: "CppEditor" } - Depends { name: "TextEditor" } - Depends { name: "ResourceEditor" } - - Group { - name: "General" - files: [ - "addlibrarywizard.cpp", "addlibrarywizard.h", - "librarydetailscontroller.cpp", "librarydetailscontroller.h", - "makefileparse.cpp", "makefileparse.h", - "profilecompletionassist.cpp", "profilecompletionassist.h", - "profileeditor.cpp", "profileeditor.h", - "profilehighlighter.cpp", "profilehighlighter.h", - "profilehoverhandler.cpp", "profilehoverhandler.h", - "qmakebuildinfo.h", - "qmakekitaspect.cpp", "qmakekitaspect.h", - "qmakemakestep.cpp", "qmakemakestep.h", - "qmakeparser.cpp", "qmakeparser.h", - "qmakeparsernodes.cpp", "qmakeparsernodes.h", - "qmakeprojectimporter.cpp", "qmakeprojectimporter.h", - "qmakesettings.cpp", "qmakesettings.h", - "qmakestep.cpp", "qmakestep.h", - "qmakebuildconfiguration.cpp", "qmakebuildconfiguration.h", - "qmakenodes.cpp", "qmakenodes.h", - "qmakenodetreebuilder.cpp", "qmakenodetreebuilder.h", - "qmakeproject.cpp", "qmakeproject.h", - "qmakeprojectmanager.qrc", - "qmakeprojectmanager_global.h", "qmakeprojectmanagertr.h", - "qmakeprojectmanagerconstants.h", - "qmakeprojectmanagerplugin.cpp", "qmakeprojectmanagerplugin.h", - ] - } - - Group { - name: "Custom Widget Wizard" - prefix: "customwidgetwizard/" - files: [ - "classdefinition.cpp", "classdefinition.h", - "classlist.cpp", "classlist.h", - "customwidgetpluginwizardpage.cpp", "customwidgetpluginwizardpage.h", - "customwidgetwidgetswizardpage.cpp", "customwidgetwidgetswizardpage.h", - "customwidgetwizard.cpp", "customwidgetwizard.h", - "customwidgetwizarddialog.cpp", "customwidgetwizarddialog.h", - "filenamingparameters.h", - "plugingenerator.cpp", "plugingenerator.h", - "pluginoptions.h" - ] - } - - Group { - name: "Wizards" - prefix: "wizards/" - files: [ - "qtprojectparameters.cpp", "qtprojectparameters.h", - "qtwizard.cpp", "qtwizard.h", - "subdirsprojectwizard.cpp", "subdirsprojectwizard.h", - "subdirsprojectwizarddialog.cpp", "subdirsprojectwizarddialog.h", - "wizards.qrc" - ] - } - - Group { - name: "Wizard Images" - prefix: "wizards/images/" - files: ["*.png"] - } - - Export { - Depends { name: "QtSupport" } - } } } diff --git a/src/plugins/qtsupport/qtsupport.qbs b/src/plugins/qtsupport/qtsupport.qbs index cbfc055644e..7befd3ab95a 100644 --- a/src/plugins/qtsupport/qtsupport.qbs +++ b/src/plugins/qtsupport/qtsupport.qbs @@ -1,122 +1,118 @@ -import qbs 1.0 - -Project { +QtcPlugin { name: "QtSupport" - QtcPlugin { - Depends { name: "Qt"; submodules: ["widgets", "xml"]; } - Depends { name: "Utils" } + Depends { name: "Qt"; submodules: ["widgets", "xml"]; } + Depends { name: "Utils" } - Depends { name: "Core" } + Depends { name: "Core" } + Depends { name: "ProParser" } + Depends { name: "ProjectExplorer" } + Depends { name: "ResourceEditor" } + + cpp.defines: base.concat([ + "QMAKE_LIBRARY", + "QMAKE_BUILTIN_PRFS", + ]) + Properties { + condition: qbs.targetOS.contains("windows") + cpp.dynamicLibraries: "advapi32" + } + + Export { Depends { name: "ProParser" } - Depends { name: "ProjectExplorer" } - Depends { name: "ResourceEditor" } - - cpp.defines: base.concat([ - "QMAKE_LIBRARY", - "QMAKE_BUILTIN_PRFS", - ]) - Properties { - condition: qbs.targetOS.contains("windows") - cpp.dynamicLibraries: "advapi32" - } - - Export { - Depends { name: "ProParser" } - } - - Group { - name: "Pro Parser" - prefix: project.sharedSourcesDir + "/proparser/" - files: [ - "ioutils.cpp", - "ioutils.h", - "profileevaluator.cpp", - "profileevaluator.h", - "proitems.cpp", - "proitems.h", - "proparser.qrc", - "prowriter.cpp", - "prowriter.h", - "qmake_global.h", - "qmakebuiltins.cpp", - "qmakeevaluator.cpp", - "qmakeevaluator.h", - "qmakeevaluator_p.h", - "qmakeglobals.cpp", - "qmakeglobals.h", - "qmakeparser.cpp", - "qmakeparser.h", - "qmakevfs.cpp", - "qmakevfs.h", - "registry.cpp", - "registry_p.h", - ] - } + } + Group { + name: "Pro Parser" + prefix: project.sharedSourcesDir + "/proparser/" files: [ - "baseqtversion.cpp", - "baseqtversion.h", - "codegenerator.cpp", - "codegenerator.h", - "codegensettings.cpp", - "codegensettings.h", - "externaleditors.cpp", - "externaleditors.h", - "qtbuildaspects.cpp", - "qtbuildaspects.h", - "qtconfigwidget.cpp", - "qtconfigwidget.h", - "qtcppkitinfo.cpp", - "qtcppkitinfo.h", - "qtprojectimporter.cpp", - "qtprojectimporter.h", - "qtsupport.qrc", - "exampleslistmodel.cpp", - "exampleslistmodel.h", - "examplesparser.cpp", - "examplesparser.h", - "profilereader.cpp", - "profilereader.h", - "qscxmlcgenerator.cpp", - "qscxmlcgenerator.h", - "qtkitaspect.cpp", - "qtkitaspect.h", - "qtoptionspage.cpp", - "qtoptionspage.h", - "qtoutputformatter.cpp", - "qtoutputformatter.h", - "qtparser.cpp", - "qtparser.h", - "qtsupport_global.h", "qtsupporttr.h", - "qtsupportconstants.h", - "qtsupportplugin.cpp", - "qtsupportplugin.h", - "qttestparser.cpp", - "qttestparser.h", - "qtversionfactory.h", - "qtversionmanager.cpp", - "qtversionmanager.h", - "translationwizardpage.cpp", - "translationwizardpage.h", - "uicgenerator.cpp", - "uicgenerator.h", + "ioutils.cpp", + "ioutils.h", + "profileevaluator.cpp", + "profileevaluator.h", + "proitems.cpp", + "proitems.h", + "proparser.qrc", + "prowriter.cpp", + "prowriter.h", + "qmake_global.h", + "qmakebuiltins.cpp", + "qmakeevaluator.cpp", + "qmakeevaluator.h", + "qmakeevaluator_p.h", + "qmakeglobals.cpp", + "qmakeglobals.h", + "qmakeparser.cpp", + "qmakeparser.h", + "qmakevfs.cpp", + "qmakevfs.h", + "registry.cpp", + "registry_p.h", ] + } - Group { - name: "QtVersion" - files: [ - "qtversions.cpp", - "qtversions.h", - ] - } + files: [ + "baseqtversion.cpp", + "baseqtversion.h", + "codegenerator.cpp", + "codegenerator.h", + "codegensettings.cpp", + "codegensettings.h", + "externaleditors.cpp", + "externaleditors.h", + "qtbuildaspects.cpp", + "qtbuildaspects.h", + "qtconfigwidget.cpp", + "qtconfigwidget.h", + "qtcppkitinfo.cpp", + "qtcppkitinfo.h", + "qtprojectimporter.cpp", + "qtprojectimporter.h", + "qtsupport.qrc", + "exampleslistmodel.cpp", + "exampleslistmodel.h", + "examplesparser.cpp", + "examplesparser.h", + "profilereader.cpp", + "profilereader.h", + "qscxmlcgenerator.cpp", + "qscxmlcgenerator.h", + "qtkitaspect.cpp", + "qtkitaspect.h", + "qtoptionspage.cpp", + "qtoptionspage.h", + "qtoutputformatter.cpp", + "qtoutputformatter.h", + "qtparser.cpp", + "qtparser.h", + "qtsupport_global.h", "qtsupporttr.h", + "qtsupportconstants.h", + "qtsupportplugin.cpp", + "qtsupportplugin.h", + "qttestparser.cpp", + "qttestparser.h", + "qtversionfactory.h", + "qtversionmanager.cpp", + "qtversionmanager.h", + "translationwizardpage.cpp", + "translationwizardpage.h", + "uicgenerator.cpp", + "uicgenerator.h", + ] - Group { - name: "Getting Started Welcome Page" - files: [ - "gettingstartedwelcomepage.cpp", - "gettingstartedwelcomepage.h" - ] - } + Group { + name: "QtVersion" + files: [ + "qtversions.cpp", + "qtversions.h", + ] + } + + Group { + name: "Getting Started Welcome Page" + files: [ + "gettingstartedwelcomepage.cpp", + "gettingstartedwelcomepage.h" + ] } } diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs index 519020b3f79..5a834fdef92 100644 --- a/src/plugins/remotelinux/remotelinux.qbs +++ b/src/plugins/remotelinux/remotelinux.qbs @@ -1,78 +1,74 @@ -import qbs 1.0 - -Project { +QtcPlugin { name: "RemoteLinux" - QtcPlugin { - Depends { name: "Qt.widgets" } - Depends { name: "QmlDebug" } - Depends { name: "Utils" } + Depends { name: "Qt.widgets" } + Depends { name: "QmlDebug" } + Depends { name: "Utils" } - Depends { name: "Core" } - Depends { name: "Debugger" } - Depends { name: "ProjectExplorer" } + Depends { name: "Core" } + Depends { name: "Debugger" } + Depends { name: "ProjectExplorer" } + files: [ + "abstractremotelinuxdeploystep.cpp", + "abstractremotelinuxdeploystep.h", + "deploymenttimeinfo.cpp", + "deploymenttimeinfo.h", + "customcommanddeploystep.cpp", + "customcommanddeploystep.h", + "genericdirectuploadstep.cpp", + "genericdirectuploadstep.h", + "genericlinuxdeviceconfigurationwidget.cpp", + "genericlinuxdeviceconfigurationwidget.h", + "killappstep.cpp", + "killappstep.h", + "linuxdevice.cpp", + "linuxdevice.h", + "linuxdevicetester.cpp", + "linuxdevicetester.h", + "linuxprocessinterface.h", + "makeinstallstep.cpp", + "makeinstallstep.h", + "publickeydeploymentdialog.cpp", + "publickeydeploymentdialog.h", + "remotelinux.qrc", + "remotelinux_constants.h", + "remotelinux_export.h", + "remotelinuxcustomrunconfiguration.cpp", + "remotelinuxcustomrunconfiguration.h", + "remotelinuxdebugsupport.cpp", + "remotelinuxdebugsupport.h", + "remotelinuxenvironmentaspect.cpp", + "remotelinuxenvironmentaspect.h", + "remotelinuxplugin.cpp", + "remotelinuxplugin.h", + "remotelinuxrunconfiguration.cpp", + "remotelinuxrunconfiguration.h", + "remotelinuxsignaloperation.cpp", + "remotelinuxsignaloperation.h", + "remotelinuxtr.h", + "rsyncdeploystep.cpp", + "rsyncdeploystep.h", + "sshdevicewizard.cpp", + "sshdevicewizard.h", + "sshkeycreationdialog.cpp", + "sshkeycreationdialog.h", + "tarpackagecreationstep.cpp", + "tarpackagecreationstep.h", + "tarpackagedeploystep.cpp", + "tarpackagedeploystep.h", + "images/embeddedtarget.png", + ] + + QtcTestFiles { files: [ - "abstractremotelinuxdeploystep.cpp", - "abstractremotelinuxdeploystep.h", - "deploymenttimeinfo.cpp", - "deploymenttimeinfo.h", - "customcommanddeploystep.cpp", - "customcommanddeploystep.h", - "genericdirectuploadstep.cpp", - "genericdirectuploadstep.h", - "genericlinuxdeviceconfigurationwidget.cpp", - "genericlinuxdeviceconfigurationwidget.h", - "killappstep.cpp", - "killappstep.h", - "linuxdevice.cpp", - "linuxdevice.h", - "linuxdevicetester.cpp", - "linuxdevicetester.h", - "linuxprocessinterface.h", - "makeinstallstep.cpp", - "makeinstallstep.h", - "publickeydeploymentdialog.cpp", - "publickeydeploymentdialog.h", - "remotelinux.qrc", - "remotelinux_constants.h", - "remotelinux_export.h", - "remotelinuxcustomrunconfiguration.cpp", - "remotelinuxcustomrunconfiguration.h", - "remotelinuxdebugsupport.cpp", - "remotelinuxdebugsupport.h", - "remotelinuxenvironmentaspect.cpp", - "remotelinuxenvironmentaspect.h", - "remotelinuxplugin.cpp", - "remotelinuxplugin.h", - "remotelinuxrunconfiguration.cpp", - "remotelinuxrunconfiguration.h", - "remotelinuxsignaloperation.cpp", - "remotelinuxsignaloperation.h", - "remotelinuxtr.h", - "rsyncdeploystep.cpp", - "rsyncdeploystep.h", - "sshdevicewizard.cpp", - "sshdevicewizard.h", - "sshkeycreationdialog.cpp", - "sshkeycreationdialog.h", - "tarpackagecreationstep.cpp", - "tarpackagecreationstep.h", - "tarpackagedeploystep.cpp", - "tarpackagedeploystep.h", - "images/embeddedtarget.png", + "filesystemaccess_test.cpp", + "filesystemaccess_test.h", ] + } - QtcTestFiles { - files: [ - "filesystemaccess_test.cpp", - "filesystemaccess_test.h", - ] - } - - Export { - Depends { name: "Debugger" } - Depends { name: "Core" } - } + Export { + Depends { name: "Debugger" } + Depends { name: "Core" } } } diff --git a/src/plugins/resourceeditor/resourceeditor.qbs b/src/plugins/resourceeditor/resourceeditor.qbs index eb09034c0ca..eaa1c8a456b 100644 --- a/src/plugins/resourceeditor/resourceeditor.qbs +++ b/src/plugins/resourceeditor/resourceeditor.qbs @@ -1,39 +1,36 @@ -import qbs 1.0 - -Project { +QtcPlugin { name: "ResourceEditor" - QtcPlugin { - Depends { name: "Qt"; submodules: ["widgets", "xml"] } - Depends { name: "Aggregation" } - Depends { name: "ProjectExplorer" } - Depends { name: "Utils" } + Depends { name: "Qt"; submodules: ["widgets", "xml"] } - Depends { name: "Core" } + Depends { name: "Aggregation" } + Depends { name: "Utils" } - cpp.defines: base.concat(["RESOURCEEDITOR_LIBRARY"]) + Depends { name: "Core" } + Depends { name: "ProjectExplorer" } - Group { - name: "General" - files: [ - "resourceeditorconstants.h", - "resourceeditorfactory.cpp", "resourceeditorfactory.h", - "resourceeditorplugin.cpp", "resourceeditorplugin.h", - "resourceeditortr.h", - "resourceeditorw.cpp", "resourceeditorw.h", - "resource_global.h", "resourcenode.cpp", "resourcenode.h" - ] - } + cpp.defines: base.concat(["RESOURCEEDITOR_LIBRARY"]) - Group { - name: "QRC Editor" - prefix: "qrceditor/" - files: [ - "qrceditor.cpp", "qrceditor.h", - "resourcefile.cpp", "resourcefile_p.h", - "resourceview.cpp", "resourceview.h", - "undocommands.cpp", "undocommands_p.h", - ] - } + Group { + name: "General" + files: [ + "resourceeditorconstants.h", + "resourceeditorfactory.cpp", "resourceeditorfactory.h", + "resourceeditorplugin.cpp", "resourceeditorplugin.h", + "resourceeditortr.h", + "resourceeditorw.cpp", "resourceeditorw.h", + "resource_global.h", "resourcenode.cpp", "resourcenode.h" + ] + } + + Group { + name: "QRC Editor" + prefix: "qrceditor/" + files: [ + "qrceditor.cpp", "qrceditor.h", + "resourcefile.cpp", "resourcefile_p.h", + "resourceview.cpp", "resourceview.h", + "undocommands.cpp", "undocommands_p.h", + ] } } diff --git a/src/plugins/texteditor/texteditor.qbs b/src/plugins/texteditor/texteditor.qbs index 0a424aeaa58..76644a13570 100644 --- a/src/plugins/texteditor/texteditor.qbs +++ b/src/plugins/texteditor/texteditor.qbs @@ -1,237 +1,234 @@ -import qbs 1.0 import qbs.FileInfo import qbs.Environment -Project { +QtcPlugin { name: "TextEditor" - QtcPlugin { - Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "printsupport"] } - Depends { name: "Aggregation" } - Depends { name: "Utils" } + Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "printsupport"] } + Depends { name: "Aggregation" } + Depends { name: "Utils" } + Depends { name: "KSyntaxHighlighting" } + + Export { Depends { name: "KSyntaxHighlighting" } + } - Export { - Depends { name: "KSyntaxHighlighting" } - } + Depends { name: "Core" } - Depends { name: "Core" } + cpp.enableExceptions: true - cpp.enableExceptions: true + files: [ + "autocompleter.cpp", + "autocompleter.h", + "basefilefind.cpp", + "basefilefind.h", + "basehoverhandler.cpp", + "basehoverhandler.h", + "behaviorsettings.cpp", + "behaviorsettings.h", + "behaviorsettingspage.cpp", + "behaviorsettingspage.h", + "behaviorsettingswidget.cpp", + "behaviorsettingswidget.h", + "blockrange.h", + "circularclipboard.cpp", + "circularclipboard.h", + "circularclipboardassist.cpp", + "circularclipboardassist.h", + "codecchooser.cpp", + "codecchooser.h", + "codestyleeditor.cpp", + "codestyleeditor.h", + "codestylepool.cpp", + "codestylepool.h", + "codestyleselectorwidget.cpp", + "codestyleselectorwidget.h", + "colorpreviewhoverhandler.cpp", + "colorpreviewhoverhandler.h", + "colorscheme.cpp", + "colorscheme.h", + "colorschemeedit.cpp", + "colorschemeedit.h", + "command.cpp", + "command.h", + "commentssettings.cpp", + "commentssettings.h", + "completionsettings.cpp", + "completionsettings.h", + "completionsettingspage.cpp", + "completionsettingspage.h", + "displaysettings.cpp", + "displaysettings.h", + "displaysettingspage.cpp", + "displaysettingspage.h", + "extraencodingsettings.cpp", + "extraencodingsettings.h", + "findincurrentfile.cpp", + "findincurrentfile.h", + "findinfiles.cpp", + "findinfiles.h", + "findinopenfiles.cpp", + "findinopenfiles.h", + "fontsettings.cpp", + "fontsettings.h", + "fontsettingspage.cpp", + "fontsettingspage.h", + "formatter.h", + "formattexteditor.cpp", + "formattexteditor.h", + "highlighter.cpp", + "highlighter.h", + "highlightersettings.cpp", + "highlightersettings.h", + "highlightersettingspage.cpp", + "highlightersettingspage.h", + "icodestylepreferences.cpp", + "icodestylepreferences.h", + "icodestylepreferencesfactory.cpp", + "icodestylepreferencesfactory.h", + "indenter.h", + "ioutlinewidget.h", + "jsoneditor.cpp", + "jsoneditor.h", + "linenumberfilter.cpp", + "linenumberfilter.h", + "marginsettings.cpp", + "marginsettings.h", + "markdowneditor.cpp", + "markdowneditor.h", + "outlinefactory.cpp", + "outlinefactory.h", + "plaintexteditorfactory.cpp", + "plaintexteditorfactory.h", + "quickfix.cpp", + "quickfix.h", + "refactoringchanges.cpp", + "refactoringchanges.h", + "refactoroverlay.cpp", + "refactoroverlay.h", + "semantichighlighter.cpp", + "semantichighlighter.h", + "simplecodestylepreferences.cpp", + "simplecodestylepreferences.h", + "simplecodestylepreferenceswidget.cpp", + "simplecodestylepreferenceswidget.h", + "storagesettings.cpp", + "storagesettings.h", + "syntaxhighlighter.cpp", + "syntaxhighlighter.h", + "tabsettings.cpp", + "tabsettings.h", + "tabsettingswidget.cpp", + "tabsettingswidget.h", + "textdocument.cpp", + "textdocument.h", + "textdocumentlayout.cpp", + "textdocumentlayout.h", + "texteditor.cpp", + "texteditor.h", + "texteditor.qrc", + "texteditor_global.h", "texteditortr.h", + "texteditor_p.h", + "texteditoractionhandler.cpp", + "texteditoractionhandler.h", + "texteditorconstants.cpp", + "texteditorconstants.h", + "texteditoroverlay.cpp", + "texteditoroverlay.h", + "texteditorplugin.cpp", + "texteditorplugin.h", + "texteditorsettings.cpp", + "texteditorsettings.h", + "textindenter.cpp", + "textindenter.h", + "textmark.cpp", + "textmark.h", + "textstyles.h", + "typingsettings.cpp", + "typingsettings.h", + ] + Group { + name: "CodeAssist" + prefix: "codeassist/" files: [ - "autocompleter.cpp", - "autocompleter.h", - "basefilefind.cpp", - "basefilefind.h", - "basehoverhandler.cpp", - "basehoverhandler.h", - "behaviorsettings.cpp", - "behaviorsettings.h", - "behaviorsettingspage.cpp", - "behaviorsettingspage.h", - "behaviorsettingswidget.cpp", - "behaviorsettingswidget.h", - "blockrange.h", - "circularclipboard.cpp", - "circularclipboard.h", - "circularclipboardassist.cpp", - "circularclipboardassist.h", - "codecchooser.cpp", - "codecchooser.h", - "codestyleeditor.cpp", - "codestyleeditor.h", - "codestylepool.cpp", - "codestylepool.h", - "codestyleselectorwidget.cpp", - "codestyleselectorwidget.h", - "colorpreviewhoverhandler.cpp", - "colorpreviewhoverhandler.h", - "colorscheme.cpp", - "colorscheme.h", - "colorschemeedit.cpp", - "colorschemeedit.h", - "command.cpp", - "command.h", - "commentssettings.cpp", - "commentssettings.h", - "completionsettings.cpp", - "completionsettings.h", - "completionsettingspage.cpp", - "completionsettingspage.h", - "displaysettings.cpp", - "displaysettings.h", - "displaysettingspage.cpp", - "displaysettingspage.h", - "extraencodingsettings.cpp", - "extraencodingsettings.h", - "findincurrentfile.cpp", - "findincurrentfile.h", - "findinfiles.cpp", - "findinfiles.h", - "findinopenfiles.cpp", - "findinopenfiles.h", - "fontsettings.cpp", - "fontsettings.h", - "fontsettingspage.cpp", - "fontsettingspage.h", - "formatter.h", - "formattexteditor.cpp", - "formattexteditor.h", - "highlighter.cpp", - "highlighter.h", - "highlightersettings.cpp", - "highlightersettings.h", - "highlightersettingspage.cpp", - "highlightersettingspage.h", - "icodestylepreferences.cpp", - "icodestylepreferences.h", - "icodestylepreferencesfactory.cpp", - "icodestylepreferencesfactory.h", - "indenter.h", - "ioutlinewidget.h", - "jsoneditor.cpp", - "jsoneditor.h", - "linenumberfilter.cpp", - "linenumberfilter.h", - "marginsettings.cpp", - "marginsettings.h", - "markdowneditor.cpp", - "markdowneditor.h", - "outlinefactory.cpp", - "outlinefactory.h", - "plaintexteditorfactory.cpp", - "plaintexteditorfactory.h", - "quickfix.cpp", - "quickfix.h", - "refactoringchanges.cpp", - "refactoringchanges.h", - "refactoroverlay.cpp", - "refactoroverlay.h", - "semantichighlighter.cpp", - "semantichighlighter.h", - "simplecodestylepreferences.cpp", - "simplecodestylepreferences.h", - "simplecodestylepreferenceswidget.cpp", - "simplecodestylepreferenceswidget.h", - "storagesettings.cpp", - "storagesettings.h", - "syntaxhighlighter.cpp", - "syntaxhighlighter.h", - "tabsettings.cpp", - "tabsettings.h", - "tabsettingswidget.cpp", - "tabsettingswidget.h", - "textdocument.cpp", - "textdocument.h", - "textdocumentlayout.cpp", - "textdocumentlayout.h", - "texteditor.cpp", - "texteditor.h", - "texteditor.qrc", - "texteditor_global.h", "texteditortr.h", - "texteditor_p.h", - "texteditoractionhandler.cpp", - "texteditoractionhandler.h", - "texteditorconstants.cpp", - "texteditorconstants.h", - "texteditoroverlay.cpp", - "texteditoroverlay.h", - "texteditorplugin.cpp", - "texteditorplugin.h", - "texteditorsettings.cpp", - "texteditorsettings.h", - "textindenter.cpp", - "textindenter.h", - "textmark.cpp", - "textmark.h", - "textstyles.h", - "typingsettings.cpp", - "typingsettings.h", + "assistenums.h", + "assistinterface.cpp", + "assistinterface.h", + "assistproposalitem.cpp", + "assistproposalitem.h", + "assistproposaliteminterface.h", + "asyncprocessor.cpp", + "asyncprocessor.h", + "codeassistant.cpp", + "codeassistant.h", + "completionassistprovider.cpp", + "completionassistprovider.h", + "documentcontentcompletion.cpp", + "documentcontentcompletion.h", + "functionhintproposal.cpp", + "functionhintproposal.h", + "functionhintproposalwidget.cpp", + "functionhintproposalwidget.h", + "genericproposal.cpp", + "genericproposal.h", + "genericproposalmodel.cpp", + "genericproposalmodel.h", + "genericproposalwidget.cpp", + "genericproposalwidget.h", + "iassistprocessor.cpp", + "iassistprocessor.h", + "iassistproposal.cpp", + "iassistproposal.h", + "iassistproposalmodel.cpp", + "iassistproposalmodel.h", + "iassistproposalwidget.cpp", + "iassistproposalwidget.h", + "iassistprovider.cpp", + "iassistprovider.h", + "ifunctionhintproposalmodel.cpp", + "ifunctionhintproposalmodel.h", + "keywordscompletionassist.cpp", + "keywordscompletionassist.h", + "textdocumentmanipulator.cpp", + "textdocumentmanipulator.h", + "textdocumentmanipulatorinterface.h", ] + } - Group { - name: "CodeAssist" - prefix: "codeassist/" - files: [ - "assistenums.h", - "assistinterface.cpp", - "assistinterface.h", - "assistproposalitem.cpp", - "assistproposalitem.h", - "assistproposaliteminterface.h", - "asyncprocessor.cpp", - "asyncprocessor.h", - "codeassistant.cpp", - "codeassistant.h", - "completionassistprovider.cpp", - "completionassistprovider.h", - "documentcontentcompletion.cpp", - "documentcontentcompletion.h", - "functionhintproposal.cpp", - "functionhintproposal.h", - "functionhintproposalwidget.cpp", - "functionhintproposalwidget.h", - "genericproposal.cpp", - "genericproposal.h", - "genericproposalmodel.cpp", - "genericproposalmodel.h", - "genericproposalwidget.cpp", - "genericproposalwidget.h", - "iassistprocessor.cpp", - "iassistprocessor.h", - "iassistproposal.cpp", - "iassistproposal.h", - "iassistproposalmodel.cpp", - "iassistproposalmodel.h", - "iassistproposalwidget.cpp", - "iassistproposalwidget.h", - "iassistprovider.cpp", - "iassistprovider.h", - "ifunctionhintproposalmodel.cpp", - "ifunctionhintproposalmodel.h", - "keywordscompletionassist.cpp", - "keywordscompletionassist.h", - "textdocumentmanipulator.cpp", - "textdocumentmanipulator.h", - "textdocumentmanipulatorinterface.h", - ] - } + Group { + name: "Snippets" + prefix: "snippets/" + files: [ + "reuse.h", + "snippet.cpp", + "snippet.h", + "snippetassistcollector.cpp", + "snippetassistcollector.h", + "snippeteditor.cpp", + "snippeteditor.h", + "snippetoverlay.cpp", + "snippetoverlay.h", + "snippetparser.cpp", + "snippetparser.h", + "snippetprovider.cpp", + "snippetprovider.h", + "snippetscollection.cpp", + "snippetscollection.h", + "snippetssettings.cpp", + "snippetssettings.h", + "snippetssettingspage.cpp", + "snippetssettingspage.h", + ] + } - Group { - name: "Snippets" - prefix: "snippets/" - files: [ - "reuse.h", - "snippet.cpp", - "snippet.h", - "snippetassistcollector.cpp", - "snippetassistcollector.h", - "snippeteditor.cpp", - "snippeteditor.h", - "snippetoverlay.cpp", - "snippetoverlay.h", - "snippetparser.cpp", - "snippetparser.h", - "snippetprovider.cpp", - "snippetprovider.h", - "snippetscollection.cpp", - "snippetscollection.h", - "snippetssettings.cpp", - "snippetssettings.h", - "snippetssettingspage.cpp", - "snippetssettingspage.h", - ] - } - - QtcTestFiles { - files: [ - "codeassist/codeassist_test.cpp", - "codeassist/codeassist_test.h", - "highlighter_test.cpp", - "highlighter_test.h", - "texteditor_test.cpp", - ] - } + QtcTestFiles { + files: [ + "codeassist/codeassist_test.cpp", + "codeassist/codeassist_test.h", + "highlighter_test.cpp", + "highlighter_test.h", + "texteditor_test.cpp", + ] } } From 1f49833ea69f2fe1842833ba296a4a20cf8ede92 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 1 Sep 2023 17:29:09 +0200 Subject: [PATCH 1088/1777] CppEditor: Remove unused class member Change-Id: I6635f320e7d746702e6e86bd5f4e8cc749c804f5 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/cppeditor/cpptypehierarchy.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/cppeditor/cpptypehierarchy.cpp b/src/plugins/cppeditor/cpptypehierarchy.cpp index 228e494a70d..9b907c6e439 100644 --- a/src/plugins/cppeditor/cpptypehierarchy.cpp +++ b/src/plugins/cppeditor/cpptypehierarchy.cpp @@ -74,7 +74,6 @@ private: void onItemActivated(const QModelIndex &index); void onItemDoubleClicked(const QModelIndex &index); - CppEditorWidget *m_cppEditor = nullptr; NavigationTreeView *m_treeView = nullptr; QWidget *m_hierarchyWidget = nullptr; QStackedLayout *m_stackLayout = nullptr; From 4f26d802ca863d90d213813d7117cdc179ab4336 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 12 Sep 2023 16:10:52 +0200 Subject: [PATCH 1089/1777] CMakePM: Remove support for extra generators They are marked as obsolete in CMake 3.27 and will be removed in a future version of CMake. Fixes: QTCREATORBUG-29603 Change-Id: I6e5d36441d05b87ee4467d13781f53d4269636ad Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../cmakebuildconfiguration.cpp | 17 +------- .../cmakeprojectmanager/cmakebuildsystem.cpp | 5 --- .../cmakeprojectmanager/cmakekitaspect.cpp | 43 ++----------------- .../cmakeprojectmanager/cmakekitaspect.h | 4 +- .../cmakeprojectimporter.cpp | 4 -- 5 files changed, 6 insertions(+), 67 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 6a1ea952524..07d182b5ced 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -2101,21 +2101,8 @@ void InitialCMakeArgumentsAspect::setAllValues(const QString &values, QStringLis QStringList arguments = values.split('\n', Qt::SkipEmptyParts); QString cmakeGenerator; for (QString &arg: arguments) { - if (arg.startsWith("-G")) { - const QString strDash(" - "); - const int idxDash = arg.indexOf(strDash); - if (idxDash > 0) { - // -GCodeBlocks - Ninja - cmakeGenerator = "-DCMAKE_GENERATOR:STRING=" + arg.mid(idxDash + strDash.length()); - - arg = arg.left(idxDash); - arg.replace("-G", "-DCMAKE_EXTRA_GENERATOR:STRING="); - - } else { - // -GNinja - arg.replace("-G", "-DCMAKE_GENERATOR:STRING="); - } - } + if (arg.startsWith("-G")) + arg.replace("-G", "-DCMAKE_GENERATOR:STRING="); if (arg.startsWith("-A")) arg.replace("-A", "-DCMAKE_GENERATOR_PLATFORM:STRING="); if (arg.startsWith("-T")) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index c4e35e27135..4ca9764efa8 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1732,11 +1732,6 @@ QList<QPair<Id, QString>> CMakeBuildSystem::generators() const for (const CMakeTool::Generator &generator : generators) { result << qMakePair(Id::fromSetting(generator.name), Tr::tr("%1 (via cmake)").arg(generator.name)); - for (const QString &extraGenerator : generator.extraGenerators) { - const QString displayName = extraGenerator + " - " + generator.name; - result << qMakePair(Id::fromSetting(displayName), - Tr::tr("%1 (via cmake)").arg(displayName)); - } } return result; } diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp index 2c2b440b8ab..19f7c463610 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp @@ -388,14 +388,10 @@ private: m_changeButton->setEnabled(m_currentTool); const QString generator = CMakeGeneratorKitAspect::generator(kit()); - const QString extraGenerator = CMakeGeneratorKitAspect::extraGenerator(kit()); const QString platform = CMakeGeneratorKitAspect::platform(kit()); const QString toolset = CMakeGeneratorKitAspect::toolset(kit()); QStringList messageLabel; - if (!extraGenerator.isEmpty()) - messageLabel << extraGenerator << " - "; - messageLabel << generator; if (!platform.isEmpty()) @@ -424,7 +420,6 @@ private: cmakeLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); auto generatorCombo = new QComboBox; - auto extraGeneratorCombo = new QComboBox; auto platformEdit = new QLineEdit; auto toolsetEdit = new QLineEdit; @@ -436,10 +431,6 @@ private: layout->addWidget(new QLabel(Tr::tr("Generator:")), row, 0); layout->addWidget(generatorCombo, row, 1); - ++row; - layout->addWidget(new QLabel(Tr::tr("Extra generator:")), row, 0); - layout->addWidget(extraGeneratorCombo, row, 1); - ++row; layout->addWidget(new QLabel(Tr::tr("Platform:")), row, 0); layout->addWidget(platformEdit, row, 1); @@ -463,19 +454,13 @@ private: for (auto it = generatorList.constBegin(); it != generatorList.constEnd(); ++it) generatorCombo->addItem(it->name); - auto updateDialog = [&generatorList, generatorCombo, extraGeneratorCombo, + auto updateDialog = [&generatorList, generatorCombo, platformEdit, toolsetEdit](const QString &name) { const auto it = std::find_if(generatorList.constBegin(), generatorList.constEnd(), [name](const CMakeTool::Generator &g) { return g.name == name; }); QTC_ASSERT(it != generatorList.constEnd(), return); generatorCombo->setCurrentText(name); - extraGeneratorCombo->clear(); - extraGeneratorCombo->addItem(Tr::tr("<none>"), QString()); - for (const QString &eg : std::as_const(it->extraGenerators)) - extraGeneratorCombo->addItem(eg, eg); - extraGeneratorCombo->setEnabled(extraGeneratorCombo->count() > 1); - platformEdit->setEnabled(it->supportsPlatform); toolsetEdit->setEnabled(it->supportsToolset); }; @@ -483,7 +468,6 @@ private: updateDialog(CMakeGeneratorKitAspect::generator(kit())); generatorCombo->setCurrentText(CMakeGeneratorKitAspect::generator(kit())); - extraGeneratorCombo->setCurrentText(CMakeGeneratorKitAspect::extraGenerator(kit())); platformEdit->setText(platformEdit->isEnabled() ? CMakeGeneratorKitAspect::platform(kit()) : QString()); toolsetEdit->setText(toolsetEdit->isEnabled() ? CMakeGeneratorKitAspect::toolset(kit()) : QString()); @@ -494,7 +478,6 @@ private: return; CMakeGeneratorKitAspect::set(kit(), generatorCombo->currentText(), - extraGeneratorCombo->currentData().toString(), platformEdit->isEnabled() ? platformEdit->text() : QString(), toolsetEdit->isEnabled() ? toolsetEdit->text() : QString()); @@ -579,11 +562,6 @@ QString CMakeGeneratorKitAspect::generator(const Kit *k) return generatorInfo(k).generator; } -QString CMakeGeneratorKitAspect::extraGenerator(const Kit *k) -{ - return generatorInfo(k).extraGenerator; -} - QString CMakeGeneratorKitAspect::platform(const Kit *k) { return generatorInfo(k).platform; @@ -601,13 +579,6 @@ void CMakeGeneratorKitAspect::setGenerator(Kit *k, const QString &generator) setGeneratorInfo(k, info); } -void CMakeGeneratorKitAspect::setExtraGenerator(Kit *k, const QString &extraGenerator) -{ - GeneratorInfo info = generatorInfo(k); - info.extraGenerator = extraGenerator; - setGeneratorInfo(k, info); -} - void CMakeGeneratorKitAspect::setPlatform(Kit *k, const QString &platform) { GeneratorInfo info = generatorInfo(k); @@ -624,11 +595,10 @@ void CMakeGeneratorKitAspect::setToolset(Kit *k, const QString &toolset) void CMakeGeneratorKitAspect::set(Kit *k, const QString &generator, - const QString &extraGenerator, const QString &platform, const QString &toolset) { - GeneratorInfo info(generator, extraGenerator, platform, toolset); + GeneratorInfo info(generator, platform, toolset); setGeneratorInfo(k, info); } @@ -639,11 +609,7 @@ QStringList CMakeGeneratorKitAspect::generatorArguments(const Kit *k) if (info.generator.isEmpty()) return result; - if (info.extraGenerator.isEmpty()) { - result.append("-G" + info.generator); - } else { - result.append("-G" + info.extraGenerator + " - " + info.generator); - } + result.append("-G" + info.generator); if (!info.platform.isEmpty()) result.append("-A" + info.platform); @@ -664,9 +630,6 @@ CMakeConfig CMakeGeneratorKitAspect::generatorCMakeConfig(const Kit *k) config << CMakeConfigItem("CMAKE_GENERATOR", info.generator.toUtf8()); - if (!info.extraGenerator.isEmpty()) - config << CMakeConfigItem("CMAKE_EXTRA_GENERATOR", info.extraGenerator.toUtf8()); - if (!info.platform.isEmpty()) config << CMakeConfigItem("CMAKE_GENERATOR_PLATFORM", info.platform.toUtf8()); diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.h b/src/plugins/cmakeprojectmanager/cmakekitaspect.h index 9b7f93e23b2..b85bb7bad31 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.h +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.h @@ -34,15 +34,13 @@ class CMAKE_EXPORT CMakeGeneratorKitAspect { public: static QString generator(const ProjectExplorer::Kit *k); - static QString extraGenerator(const ProjectExplorer::Kit *k); static QString platform(const ProjectExplorer::Kit *k); static QString toolset(const ProjectExplorer::Kit *k); static void setGenerator(ProjectExplorer::Kit *k, const QString &generator); - static void setExtraGenerator(ProjectExplorer::Kit *k, const QString &extraGenerator); static void setPlatform(ProjectExplorer::Kit *k, const QString &platform); static void setToolset(ProjectExplorer::Kit *k, const QString &toolset); static void set(ProjectExplorer::Kit *k, const QString &generator, - const QString &extraGenerator, const QString &platform, const QString &toolset); + const QString &platform, const QString &toolset); static QStringList generatorArguments(const ProjectExplorer::Kit *k); static CMakeConfig generatorCMakeConfig(const ProjectExplorer::Kit *k); static bool isMultiConfigGenerator(const ProjectExplorer::Kit *k); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index a0480f65acd..bacde7ea39c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -52,7 +52,6 @@ struct DirectoryData // Kit Stuff FilePath cmakeBinary; QString generator; - QString extraGenerator; QString platform; QString toolset; FilePath sysroot; @@ -835,7 +834,6 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath, data->cmakeBinary = config.filePathValueOf("CMAKE_COMMAND"); data->generator = config.stringValueOf("CMAKE_GENERATOR"); - data->extraGenerator = config.stringValueOf("CMAKE_EXTRA_GENERATOR"); data->platform = config.stringValueOf("CMAKE_GENERATOR_PLATFORM"); if (data->platform.isEmpty()) data->platform = extractVisualStudioPlatformFromConfig(config); @@ -880,7 +878,6 @@ bool CMakeProjectImporter::matchKit(void *directoryData, const Kit *k) const return false; if (CMakeGeneratorKitAspect::generator(k) != data->generator - || CMakeGeneratorKitAspect::extraGenerator(k) != data->extraGenerator || CMakeGeneratorKitAspect::platform(k) != data->platform || CMakeGeneratorKitAspect::toolset(k) != data->toolset) return false; @@ -950,7 +947,6 @@ Kit *CMakeProjectImporter::createKit(void *directoryData) const CMakeKitAspect::setCMakeTool(k, cmtd.cmakeTool->id()); CMakeGeneratorKitAspect::setGenerator(k, data->generator); - CMakeGeneratorKitAspect::setExtraGenerator(k, data->extraGenerator); CMakeGeneratorKitAspect::setPlatform(k, data->platform); CMakeGeneratorKitAspect::setToolset(k, data->toolset); From 7fc69e1063c310d98d691394526fce0015a11f95 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 13 Sep 2023 22:40:09 +0200 Subject: [PATCH 1090/1777] Utils: Move CONTINUE_SMALL Icon from ProjectExplorer to Utils We want a variant of the icon (without the debugger beetle) in Utils, in order to use it in the ImageViewer plugin to resume paused animations. Change-Id: I55ff301db60cae626d8e95d2fadf3c76a36cee39 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../utils}/images/continue_1_small.png | Bin .../utils}/images/continue_1_small@2x.png | Bin .../utils}/images/continue_2_small.png | Bin .../utils}/images/continue_2_small@2x.png | Bin .../utils}/images/debugger_overlay_small.png | Bin .../images/debugger_overlay_small@2x.png | Bin src/libs/utils/utils.qrc | 6 ++++++ src/libs/utils/utilsicons.cpp | 6 ++++++ src/libs/utils/utilsicons.h | 3 +++ src/plugins/debugger/debuggericons.cpp | 20 +++++++++--------- .../projectexplorer/projectexplorer.qrc | 6 ------ .../projectexplorer/projectexplorericons.cpp | 4 ++-- src/tools/icons/qtcreatoricons.svg | 6 +++--- 13 files changed, 30 insertions(+), 21 deletions(-) rename src/{plugins/projectexplorer => libs/utils}/images/continue_1_small.png (100%) rename src/{plugins/projectexplorer => libs/utils}/images/continue_1_small@2x.png (100%) rename src/{plugins/projectexplorer => libs/utils}/images/continue_2_small.png (100%) rename src/{plugins/projectexplorer => libs/utils}/images/continue_2_small@2x.png (100%) rename src/{plugins/projectexplorer => libs/utils}/images/debugger_overlay_small.png (100%) rename src/{plugins/projectexplorer => libs/utils}/images/debugger_overlay_small@2x.png (100%) diff --git a/src/plugins/projectexplorer/images/continue_1_small.png b/src/libs/utils/images/continue_1_small.png similarity index 100% rename from src/plugins/projectexplorer/images/continue_1_small.png rename to src/libs/utils/images/continue_1_small.png diff --git a/src/plugins/projectexplorer/images/continue_1_small@2x.png b/src/libs/utils/images/continue_1_small@2x.png similarity index 100% rename from src/plugins/projectexplorer/images/continue_1_small@2x.png rename to src/libs/utils/images/continue_1_small@2x.png diff --git a/src/plugins/projectexplorer/images/continue_2_small.png b/src/libs/utils/images/continue_2_small.png similarity index 100% rename from src/plugins/projectexplorer/images/continue_2_small.png rename to src/libs/utils/images/continue_2_small.png diff --git a/src/plugins/projectexplorer/images/continue_2_small@2x.png b/src/libs/utils/images/continue_2_small@2x.png similarity index 100% rename from src/plugins/projectexplorer/images/continue_2_small@2x.png rename to src/libs/utils/images/continue_2_small@2x.png diff --git a/src/plugins/projectexplorer/images/debugger_overlay_small.png b/src/libs/utils/images/debugger_overlay_small.png similarity index 100% rename from src/plugins/projectexplorer/images/debugger_overlay_small.png rename to src/libs/utils/images/debugger_overlay_small.png diff --git a/src/plugins/projectexplorer/images/debugger_overlay_small@2x.png b/src/libs/utils/images/debugger_overlay_small@2x.png similarity index 100% rename from src/plugins/projectexplorer/images/debugger_overlay_small@2x.png rename to src/libs/utils/images/debugger_overlay_small@2x.png diff --git a/src/libs/utils/utils.qrc b/src/libs/utils/utils.qrc index c0f2d2559a1..91070dc708b 100644 --- a/src/libs/utils/utils.qrc +++ b/src/libs/utils/utils.qrc @@ -48,6 +48,12 @@ <file>images/clean_pane_small@2x.png</file> <file>images/compile_error_taskbar.png</file> <file>images/compile_error_taskbar@2x.png</file> + <file>images/continue_1_small.png</file> + <file>images/continue_1_small@2x.png</file> + <file>images/continue_2_small.png</file> + <file>images/continue_2_small@2x.png</file> + <file>images/debugger_overlay_small.png</file> + <file>images/debugger_overlay_small@2x.png</file> <file>images/editcopy.png</file> <file>images/editcopy@2x.png</file> <file>images/editcut.png</file> diff --git a/src/libs/utils/utilsicons.cpp b/src/libs/utils/utilsicons.cpp index 60928ae7945..3fa62969d90 100644 --- a/src/libs/utils/utilsicons.cpp +++ b/src/libs/utils/utilsicons.cpp @@ -225,6 +225,12 @@ const Icon INTERRUPT_SMALL({ {":/utils/images/interrupt_small.png", Theme::IconsInterruptColor}}, Icon::MenuTintedStyle); const Icon INTERRUPT_SMALL_TOOLBAR({ {":/utils/images/interrupt_small.png", Theme::IconsInterruptToolBarColor}}); +const Icon CONTINUE_SMALL({ + {":/utils/images/continue_1_small.png", Theme::IconsInterruptColor}, + {":/utils/images/continue_2_small.png", Theme::IconsRunColor}}, Icon::MenuTintedStyle); +const Icon CONTINUE_SMALL_TOOLBAR({ + {":/utils/images/continue_1_small.png", Theme::IconsInterruptToolBarColor}, + {":/utils/images/continue_2_small.png", Theme::IconsRunToolBarColor}}); const Icon BOUNDING_RECT({ {":/utils/images/boundingrect.png", Theme::IconsBaseColor}}); const Icon EYE_OPEN({ diff --git a/src/libs/utils/utilsicons.h b/src/libs/utils/utilsicons.h index 33588dc0d58..5848882764f 100644 --- a/src/libs/utils/utilsicons.h +++ b/src/libs/utils/utilsicons.h @@ -120,6 +120,9 @@ QTCREATOR_UTILS_EXPORT extern const Icon STOP_SMALL; QTCREATOR_UTILS_EXPORT extern const Icon STOP_SMALL_TOOLBAR; QTCREATOR_UTILS_EXPORT extern const Icon INTERRUPT_SMALL; QTCREATOR_UTILS_EXPORT extern const Icon INTERRUPT_SMALL_TOOLBAR; +QTCREATOR_UTILS_EXPORT extern const Icon CONTINUE_SMALL; +QTCREATOR_UTILS_EXPORT extern const Icon CONTINUE_SMALL_TOOLBAR; + QTCREATOR_UTILS_EXPORT extern const Icon BOUNDING_RECT; QTCREATOR_UTILS_EXPORT extern const Icon EYE_OPEN; QTCREATOR_UTILS_EXPORT extern const Icon EYE_OPEN_TOOLBAR; diff --git a/src/plugins/debugger/debuggericons.cpp b/src/plugins/debugger/debuggericons.cpp index b59b9254364..2965934f291 100644 --- a/src/plugins/debugger/debuggericons.cpp +++ b/src/plugins/debugger/debuggericons.cpp @@ -34,13 +34,13 @@ const Icon CONTINUE_FLAT({ {":/debugger/images/debugger_continue_2_mask.png", Theme::IconsRunToolBarColor}, {":/projectexplorer/images/debugger_beetle_mask.png", Theme::IconsDebugColor}}); const Icon DEBUG_CONTINUE_SMALL({ - {":/projectexplorer/images/continue_1_small.png", Theme::IconsInterruptColor}, - {":/projectexplorer/images/continue_2_small.png", Theme::IconsRunColor}, - {":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); + {":/utils/images/continue_1_small.png", Theme::IconsInterruptColor}, + {":/utils/images/continue_2_small.png", Theme::IconsRunColor}, + {":/utils/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); const Icon DEBUG_CONTINUE_SMALL_TOOLBAR({ - {":/projectexplorer/images/continue_1_small.png", Theme::IconsInterruptToolBarColor}, - {":/projectexplorer/images/continue_2_small.png", Theme::IconsRunToolBarColor}, - {":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); + {":/utils/images/continue_1_small.png", Theme::IconsInterruptToolBarColor}, + {":/utils/images/continue_2_small.png", Theme::IconsRunToolBarColor}, + {":/utils/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); const Icon INTERRUPT( ":/debugger/images/debugger_interrupt.png"); const Icon INTERRUPT_FLAT({ @@ -53,16 +53,16 @@ const Icon STOP_FLAT({ {":/projectexplorer/images/debugger_beetle_mask.png", Theme::IconsDebugColor}}); const Icon DEBUG_INTERRUPT_SMALL({ {":/utils/images/interrupt_small.png", Theme::IconsInterruptColor}, - {":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); + {":/utils/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); const Icon DEBUG_INTERRUPT_SMALL_TOOLBAR({ {":/utils/images/interrupt_small.png", Theme::IconsInterruptToolBarColor}, - {":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); + {":/utils/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); const Icon DEBUG_EXIT_SMALL({ {":/utils/images/stop_small.png", Theme::IconsStopColor}, - {":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); + {":/utils/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); const Icon DEBUG_EXIT_SMALL_TOOLBAR({ {":/utils/images/stop_small.png", Theme::IconsStopToolBarColor}, - {":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); + {":/utils/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); const Icon LOCATION({ {":/debugger/images/location_background.png", Theme::IconsCodeModelOverlayForegroundColor}, {":/debugger/images/location.png", Theme::IconsWarningToolBarColor}}, Icon::Tint); diff --git a/src/plugins/projectexplorer/projectexplorer.qrc b/src/plugins/projectexplorer/projectexplorer.qrc index 0cc88e3331a..f40c1b8d5bf 100644 --- a/src/plugins/projectexplorer/projectexplorer.qrc +++ b/src/plugins/projectexplorer/projectexplorer.qrc @@ -20,8 +20,6 @@ <file>images/run@2x.png</file> <file>images/run_mask.png</file> <file>images/run_mask@2x.png</file> - <file>images/debugger_overlay_small.png</file> - <file>images/debugger_overlay_small@2x.png</file> <file>images/analyzer_overlay_small.png</file> <file>images/analyzer_overlay_small@2x.png</file> <file>images/devicestatusindicator.png</file> @@ -34,10 +32,6 @@ <file>images/build_hammerhead_mask@2x.png</file> <file>images/targetpanel_bottom.png</file> <file>images/window.png</file> - <file>images/continue_1_small.png</file> - <file>images/continue_1_small@2x.png</file> - <file>images/continue_2_small.png</file> - <file>images/continue_2_small@2x.png</file> <file>images/buildstepdisable.png</file> <file>images/buildstepdisable@2x.png</file> <file>images/buildstepmovedown.png</file> diff --git a/src/plugins/projectexplorer/projectexplorericons.cpp b/src/plugins/projectexplorer/projectexplorericons.cpp index 59b72adbda0..9d1dd991a49 100644 --- a/src/plugins/projectexplorer/projectexplorericons.cpp +++ b/src/plugins/projectexplorer/projectexplorericons.cpp @@ -50,10 +50,10 @@ const Icon DEBUG_START_FLAT({ {":/projectexplorer/images/debugger_beetle_mask.png", Theme::IconsDebugColor}}); const Icon DEBUG_START_SMALL({ {":/utils/images/run_small.png", Theme::IconsRunColor}, - {":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); + {":/utils/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); const Icon DEBUG_START_SMALL_TOOLBAR({ {":/utils/images/run_small.png", Theme::IconsRunToolBarColor}, - {":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); + {":/utils/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); const Icon ANALYZER_START_SMALL({ {":/utils/images/run_small.png", Theme::IconsRunColor}, {":/projectexplorer/images/analyzer_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg index 0d5cfa9e23b..e1154577f7b 100644 --- a/src/tools/icons/qtcreatoricons.svg +++ b/src/tools/icons/qtcreatoricons.svg @@ -4626,7 +4626,7 @@ sodipodi:nodetypes="cc" /> </g> <g - id="src/plugins/projectexplorer/images/debugger_overlay_small" + id="src/libs/utils/images/debugger_overlay_small" transform="translate(16)"> <rect style="fill:#ffffff;fill-opacity:1;stroke:none" @@ -5363,7 +5363,7 @@ <g style="display:inline" transform="translate(144)" - id="src/plugins/projectexplorer/images/continue_1_small"> + id="src/libs/utils/images/continue_1_small"> <rect style="fill:#ffffff;fill-opacity:1;stroke:none" x="265" @@ -5383,7 +5383,7 @@ <g style="display:inline" transform="translate(160)" - id="src/plugins/projectexplorer/images/continue_2_small"> + id="src/libs/utils/images/continue_2_small"> <rect style="fill:#ffffff;fill-opacity:1;stroke:none" x="265" From 726f2730e7468073c49b2f775986372735b22e4e Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 13 Sep 2023 21:55:47 +0200 Subject: [PATCH 1091/1777] ImageViewer: Fix animation playback replay and loop This fixes the issue that looped animated images do not automatically loop and that animations can generally not be replayed from start. It introduces the "resume" state to the tool bar icon in order to distinguish between "playing an animation from start" and "resuming the playback of a paused animation". The setting cache mode QMovie::CacheAll was removed because it prevents a looped animation from looping, and also its memory consumption (which depends on animation dimension and frames) does not seem to be positively outweighed by anything else. Fixes: QTCREATORBUG-29606 Change-Id: Iaca8d93766201f5f953784be7ee6d56610e63695 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/imageviewer/imageviewer.cpp | 43 ++++++++++++++++----- src/plugins/imageviewer/imageviewerfile.cpp | 43 +++++---------------- src/plugins/imageviewer/imageviewerfile.h | 9 ++--- 3 files changed, 47 insertions(+), 48 deletions(-) diff --git a/src/plugins/imageviewer/imageviewer.cpp b/src/plugins/imageviewer/imageviewer.cpp index 5d4a068e717..d1893b703ae 100644 --- a/src/plugins/imageviewer/imageviewer.cpp +++ b/src/plugins/imageviewer/imageviewer.cpp @@ -234,7 +234,7 @@ void ImageViewer::ctor() d->imageView, &ImageView::reset); connect(d->file.data(), &ImageViewerFile::reloadFinished, d->imageView, &ImageView::createScene); - connect(d->file.data(), &ImageViewerFile::isPausedChanged, + connect(d->file.data(), &ImageViewerFile::movieStateChanged, this, &ImageViewer::updatePauseAction); connect(d->imageView, &ImageView::scaleFactorChanged, this, &ImageViewer::scaleFactorUpdate); @@ -349,19 +349,42 @@ void ImageViewer::togglePlay() void ImageViewer::playToggled() { - d->file->setPaused(!d->file->isPaused()); + QMovie *m = d->file->movie(); + if (!m) + return; + const QMovie::MovieState state = d->file->movie()->state(); + switch (state) { + case QMovie::NotRunning: + m->start(); + break; + case QMovie::Paused: + m->setPaused(false); + break; + case QMovie::Running: + m->setPaused(true); + break; + } } void ImageViewer::updatePauseAction() { - bool isMovie = d->file->type() == ImageViewerFile::TypeMovie; - if (isMovie && !d->file->isPaused()) { - d->actionPlayPause->setToolTipBase(Tr::tr("Pause Animation")); - d->actionPlayPause->setIcon(Icons::INTERRUPT_SMALL_TOOLBAR.icon()); - } else { - d->actionPlayPause->setToolTipBase(Tr::tr("Play Animation")); - d->actionPlayPause->setIcon(Icons::RUN_SMALL_TOOLBAR.icon()); - d->actionPlayPause->setEnabled(isMovie); + const bool isMovie = d->file->type() == ImageViewerFile::TypeMovie; + const QMovie::MovieState state = isMovie ? d->file->movie()->state() : QMovie::NotRunning; + CommandAction *a = d->actionPlayPause; + switch (state) { + case QMovie::NotRunning: + a->setToolTipBase(Tr::tr("Play Animation")); + a->setIcon(Icons::RUN_SMALL_TOOLBAR.icon()); + a->setEnabled(isMovie); + break; + case QMovie::Paused: + a->setToolTipBase(Tr::tr("Resume Paused Animation")); + a->setIcon(Icons::CONTINUE_SMALL_TOOLBAR.icon()); + break; + case QMovie::Running: + a->setToolTipBase(Tr::tr("Pause Animation")); + a->setIcon(Icons::INTERRUPT_SMALL_TOOLBAR.icon()); + break; } } diff --git a/src/plugins/imageviewer/imageviewerfile.cpp b/src/plugins/imageviewer/imageviewerfile.cpp index afa5c5cfc3d..15a3d8d77b3 100644 --- a/src/plugins/imageviewer/imageviewerfile.cpp +++ b/src/plugins/imageviewer/imageviewerfile.cpp @@ -6,6 +6,7 @@ #include "imageviewerconstants.h" #include "imageviewertr.h" +#include "utils/algorithm.h" #include <coreplugin/editormanager/documentmodel.h> #include <coreplugin/editormanager/ieditor.h> @@ -115,20 +116,8 @@ Core::IDocument::OpenResult ImageViewerFile::openImpl(QString *errorString, return OpenResult::CannotHandle; } m_type = TypeMovie; - m_movie->setCacheMode(QMovie::CacheAll); - connect( - m_movie, - &QMovie::finished, - m_movie, - [this] { - if (m_movie->isValid()) - m_movie->start(); - }, - Qt::QueuedConnection); connect(m_movie, &QMovie::resized, this, &ImageViewerFile::imageSizeChanged); - m_movie->start(); - m_isPaused = false; // force update - setPaused(true); + connect(m_movie, &QMovie::stateChanged, this, &ImageViewerFile::movieStateChanged); } else { m_pixmap = new QPixmap(fileName); if (m_pixmap->isNull()) { @@ -169,18 +158,9 @@ bool ImageViewerFile::reload(QString *errorString, return success; } -bool ImageViewerFile::isPaused() const +QMovie *ImageViewerFile::movie() const { - return m_isPaused; -} - -void ImageViewerFile::setPaused(bool paused) -{ - if (!m_movie || m_isPaused == paused) - return; - m_isPaused = paused; - m_movie->setPaused(paused); - emit isPausedChanged(m_isPaused); + return m_movie; } QGraphicsItem *ImageViewerFile::createGraphicsItem() const @@ -221,16 +201,13 @@ ImageViewerFile::ImageType ImageViewerFile::type() const void ImageViewerFile::updateVisibility() { - if (!m_movie || m_isPaused) + if (!m_movie || m_movie->state() != QMovie::Running) return; - bool visible = false; - for (Core::IEditor *editor : Core::DocumentModel::editorsForDocument(this)) { - if (editor->widget()->isVisible()) { - visible = true; - break; - } - } - m_movie->setPaused(!visible); + const bool anyVisible = Utils::anyOf(Core::DocumentModel::editorsForDocument(this), + [] (Core::IEditor *editor) + { return editor->widget()->isVisible(); }); + if (!anyVisible) + m_movie->setPaused(true); } void ImageViewerFile::cleanUp() diff --git a/src/plugins/imageviewer/imageviewerfile.h b/src/plugins/imageviewer/imageviewerfile.h index fc1c73f8de8..26ed01a94fe 100644 --- a/src/plugins/imageviewer/imageviewerfile.h +++ b/src/plugins/imageviewer/imageviewerfile.h @@ -6,9 +6,10 @@ #include <coreplugin/idocument.h> +#include <QMovie> + QT_BEGIN_NAMESPACE class QGraphicsItem; -class QMovie; class QPixmap; #ifndef QT_NO_SVG @@ -40,8 +41,7 @@ public: ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override; bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override; - bool isPaused() const; - void setPaused(bool paused); + QMovie *movie() const; QGraphicsItem *createGraphicsItem() const; ImageType type() const; @@ -51,7 +51,7 @@ public: signals: void openFinished(bool success); void imageSizeChanged(const QSize &size); - void isPausedChanged(bool paused); + void movieStateChanged(); private: void cleanUp(); @@ -63,7 +63,6 @@ private: #endif QMovie *m_movie = nullptr; QPixmap *m_pixmap = nullptr; - bool m_isPaused = false; }; } // ImageViewer::Internal From efb93d13664dd3af66bf2a6df2d37f5c3e9d7c2a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 14 Sep 2023 13:23:37 +0200 Subject: [PATCH 1092/1777] CMakeProjectManager: Remote-ify CMakeFileCompletionAssist implementation Change-Id: I18aa3d23244dd6475657f43bc18ce83298e278bf Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 004dc7e092c..18bc57a4905 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -13,8 +13,6 @@ #include <texteditor/codeassist/assistinterface.h> -#include <QFileInfo> - using namespace TextEditor; using namespace ProjectExplorer; @@ -39,7 +37,7 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() { Keywords kw; const Utils::FilePath &filePath = interface()->filePath(); - if (!filePath.isEmpty() && filePath.toFileInfo().isFile()) { + if (!filePath.isEmpty() && filePath.isFile()) { Project *p = ProjectManager::projectForFile(filePath); if (p && p->activeTarget()) { CMakeTool *cmake = CMakeKitAspect::cmakeTool(p->activeTarget()->kit()); From 8627dab89d894a096c93608fcf2bee08ee784b29 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 14 Sep 2023 12:25:03 +0200 Subject: [PATCH 1093/1777] Cplusplus: Remove an unneded #include Change-Id: Id9dbc15a60397daf651f80f48811fcc05de096d2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/cplusplus/CppDocument.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/cplusplus/CppDocument.h b/src/libs/cplusplus/CppDocument.h index 00bebf277d9..8834c7538a7 100644 --- a/src/libs/cplusplus/CppDocument.h +++ b/src/libs/cplusplus/CppDocument.h @@ -14,7 +14,6 @@ #include <QSharedPointer> #include <QDateTime> #include <QHash> -#include <QFileInfo> #include <QFuture> #include <QAtomicInt> From d44afce0f0bb84233bf19422b9d101aa639dc198 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 13 Sep 2023 14:47:49 +0200 Subject: [PATCH 1094/1777] Utils: Add AspectList aspect Change-Id: Id164828f4ba46c973edbcd123c855bb7b70ad8f7 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/aspects.cpp | 187 ++++++++++++++++++ src/libs/utils/aspects.h | 75 ++++++- .../compilerexploreraspects.h | 134 ------------- .../compilerexplorereditor.cpp | 12 +- .../compilerexplorersettings.cpp | 19 +- .../compilerexplorersettings.h | 4 +- 6 files changed, 271 insertions(+), 160 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index b12833e59c7..27f8df50b3e 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -2969,4 +2969,191 @@ SettingsGroupNester::~SettingsGroupNester() theSettings->endGroup(); } +class AddItemCommand : public QUndoCommand +{ +public: + AddItemCommand(AspectList *aspect, const std::shared_ptr<BaseAspect> &item) + : m_aspect(aspect) + , m_item(item) + {} + + void undo() override { m_aspect->actualRemoveItem(m_item); } + void redo() override { m_aspect->actualAddItem(m_item); } + +private: + AspectList *m_aspect; + std::shared_ptr<BaseAspect> m_item; +}; + +class RemoveItemCommand : public QUndoCommand +{ +public: + RemoveItemCommand(AspectList *aspect, const std::shared_ptr<BaseAspect> &item) + : m_aspect(aspect) + , m_item(item) + {} + + void undo() override { m_aspect->actualAddItem(m_item); } + void redo() override { m_aspect->actualRemoveItem(m_item); } + +private: + AspectList *m_aspect; + std::shared_ptr<BaseAspect> m_item; +}; + +class Internal::AspectListPrivate +{ +public: + QList<std::shared_ptr<BaseAspect>> items; + QList<std::shared_ptr<BaseAspect>> volatileItems; + AspectList::CreateItem createItem; + AspectList::ItemCallback itemAdded; + AspectList::ItemCallback itemRemoved; +}; + +AspectList::AspectList(Utils::AspectContainer *container) + : Utils::BaseAspect(container) + , d(std::make_unique<Internal::AspectListPrivate>()) +{} + +AspectList::~AspectList() = default; + +void AspectList::fromMap(const Utils::Store &map) +{ + QTC_ASSERT(!settingsKey().isEmpty(), return); + + QVariantList list = map[settingsKey()].toList(); + d->volatileItems.clear(); + for (const QVariant &entry : list) { + auto item = d->createItem(); + item->setAutoApply(isAutoApply()); + item->setUndoStack(undoStack()); + item->fromMap(Utils::storeFromVariant(entry)); + d->volatileItems.append(item); + } + d->items = d->volatileItems; +} + +QVariantList AspectList::toList(bool v) const +{ + QVariantList list; + const auto &items = v ? d->volatileItems : d->items; + + for (const auto &item : items) { + Utils::Store childStore; + if (v) + item->volatileToMap(childStore); + else + item->toMap(childStore); + + list.append(Utils::variantFromStore(childStore)); + } + + return list; +} + +void AspectList::toMap(Utils::Store &map) const +{ + QTC_ASSERT(!settingsKey().isEmpty(), return); + const Utils::Key key = settingsKey(); + map[key] = toList(false); +} + +void AspectList::volatileToMap(Utils::Store &map) const +{ + QTC_ASSERT(!settingsKey().isEmpty(), return); + const Utils::Key key = settingsKey(); + map[key] = toList(true); +} + +std::shared_ptr<BaseAspect> AspectList::actualAddItem(const std::shared_ptr<BaseAspect> &item) +{ + item->setAutoApply(isAutoApply()); + item->setUndoStack(undoStack()); + + d->volatileItems.append(item); + if (d->itemAdded) + d->itemAdded(item); + emit volatileValueChanged(); + if (isAutoApply()) + d->items = d->volatileItems; + return item; +} + +QList<std::shared_ptr<BaseAspect>> AspectList::items() const +{ + return d->items; +} +QList<std::shared_ptr<BaseAspect>> AspectList::volatileItems() const +{ + return d->volatileItems; +} + +std::shared_ptr<BaseAspect> AspectList::addItem(std::shared_ptr<BaseAspect> item) +{ + if (undoStack()) + pushUndo(new AddItemCommand(this, item)); + else + return actualAddItem(item); + + return item; +} + +void AspectList::actualRemoveItem(std::shared_ptr<BaseAspect> item) +{ + d->volatileItems.removeOne(item); + if (d->itemRemoved) + d->itemRemoved(item); + emit volatileValueChanged(); + if (isAutoApply()) + d->items = d->volatileItems; +} + +void AspectList::removeItem(std::shared_ptr<BaseAspect> item) +{ + if (undoStack()) + pushUndo(new RemoveItemCommand(this, item)); + else + actualRemoveItem(item); +} + +void AspectList::apply() +{ + d->items = d->volatileItems; + forEachItem<BaseAspect>([](const std::shared_ptr<BaseAspect> &aspect) { aspect->apply(); }); + emit changed(); +} + +void AspectList::setCreateItemFunction(CreateItem createItem) +{ + d->createItem = createItem; +} + +void AspectList::setItemAddedCallback(const ItemCallback &callback) +{ + d->itemAdded = callback; +} +void AspectList::setItemRemovedCallback(const ItemCallback &callback) +{ + d->itemRemoved = callback; +} + +qsizetype AspectList::size() const +{ + return d->volatileItems.size(); +} + +bool AspectList::isDirty() +{ + if (d->items != d->volatileItems) + return true; + + for (const auto &item : d->volatileItems) { + if (item->isDirty()) + return true; + } + return false; +} + + } // namespace Utils diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 0ffcaec7cb0..79f7b460847 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -8,8 +8,8 @@ #include "infolabel.h" #include "macroexpander.h" #include "pathchooser.h" -#include "store.h" #include "qtcsettings.h" +#include "store.h" #include <functional> #include <memory> @@ -46,6 +46,7 @@ class StringAspectPrivate; class StringListAspectPrivate; class TextDisplayPrivate; class CheckableAspectImplementation; +class AspectListPrivate; } // Internal class QTCREATOR_UTILS_EXPORT BaseAspect : public QObject @@ -994,4 +995,76 @@ private: T m_value; }; +class QTCREATOR_UTILS_EXPORT AspectList : public Utils::BaseAspect +{ +public: + using CreateItem = std::function<std::shared_ptr<BaseAspect>()>; + using ItemCallback = std::function<void(std::shared_ptr<BaseAspect>)>; + + AspectList(Utils::AspectContainer *container = nullptr); + ~AspectList() override; + + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; + + void volatileToMap(Utils::Store &map) const override; + QVariantList toList(bool v) const; + + QList<std::shared_ptr<BaseAspect>> items() const; + QList<std::shared_ptr<BaseAspect>> volatileItems() const; + + std::shared_ptr<BaseAspect> addItem(std::shared_ptr<BaseAspect> item); + std::shared_ptr<BaseAspect> actualAddItem(const std::shared_ptr<BaseAspect> &item); + + void removeItem(std::shared_ptr<BaseAspect> item); + void actualRemoveItem(std::shared_ptr<BaseAspect> item); + + void apply() override; + + void setCreateItemFunction(CreateItem createItem); + + template<class T> + void forEachItem(std::function<void(const std::shared_ptr<T> &)> callback) + { + for (const auto &item : volatileItems()) + callback(std::static_pointer_cast<T>(item)); + } + + template<class T> + void forEachItem(std::function<void(const std::shared_ptr<T> &, int)> callback) + { + int idx = 0; + for (const auto &item : volatileItems()) + callback(std::static_pointer_cast<T>(item), idx++); + } + + void setItemAddedCallback(const ItemCallback &callback); + void setItemRemovedCallback(const ItemCallback &callback); + + template<class T> + void setItemAddedCallback(const std::function<void(const std::shared_ptr<T>)> &callback) + { + setItemAddedCallback([callback](const std::shared_ptr<BaseAspect> &item) { + callback(std::static_pointer_cast<T>(item)); + }); + } + + template<class T> + void setItemRemovedCallback(const std::function<void(const std::shared_ptr<T>)> &callback) + { + setItemRemovedCallback([callback](const std::shared_ptr<BaseAspect> &item) { + callback(std::static_pointer_cast<T>(item)); + }); + } + + qsizetype size() const; + bool isDirty() override; + + QVariant volatileVariantValue() const override { return {}; } + + +private: + std::unique_ptr<Internal::AspectListPrivate> d; +}; + } // namespace Utils diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.h b/src/plugins/compilerexplorer/compilerexploreraspects.h index 6796d088190..bb1e415f62f 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.h +++ b/src/plugins/compilerexplorer/compilerexploreraspects.h @@ -70,138 +70,4 @@ private: QStandardItemModel *m_model{nullptr}; }; -template<class T> -class AspectListAspect : public Utils::BaseAspect -{ -public: - using ToBaseAspectPtr = std::function<Utils::BaseAspect *(const T &)>; - using CreateItem = std::function<T()>; - using ItemCallback = std::function<void(const T &)>; - using IsDirty = std::function<bool(const T &)>; - using Apply = std::function<void(const T &)>; - - AspectListAspect(Utils::AspectContainer *container = nullptr) - : Utils::BaseAspect(container) - {} - - void fromMap(const Utils::Store &map) override - { - QTC_ASSERT(!settingsKey().isEmpty(), return); - - QVariantList list = map[settingsKey()].toList(); - for (const QVariant &entry : list) { - T item = m_createItem(); - m_toBaseAspect(item)->fromMap(Utils::storeFromVariant(entry)); - m_volatileItems.append(item); - } - m_items = m_volatileItems; - } - - QVariantList toList(bool v) const - { - QVariantList list; - const auto &items = v ? m_volatileItems : m_items; - - for (const auto &item : items) { - Utils::Store childMap; - if (v) - m_toBaseAspect(item)->volatileToMap(childMap); - else - m_toBaseAspect(item)->toMap(childMap); - - list.append(Utils::variantFromStore(childMap)); - } - - return list; - } - - void toMap(Utils::Store &map) const override - { - QTC_ASSERT(!settingsKey().isEmpty(), return); - const Utils::Key key = settingsKey(); - map[key] = toList(false); - } - - void volatileToMap(Utils::Store &map) const override - { - QTC_ASSERT(!settingsKey().isEmpty(), return); - const Utils::Key key = settingsKey(); - map[key] = toList(true); - } - - T addItem(T item) - { - m_volatileItems.append(item); - if (m_itemAdded) - m_itemAdded(item); - emit volatileValueChanged(); - if (isAutoApply()) - apply(); - return item; - } - - void removeItem(T item) - { - m_volatileItems.removeOne(item); - if (m_itemRemoved) - m_itemRemoved(item); - emit volatileValueChanged(); - if (isAutoApply()) - apply(); - } - - void apply() override - { - m_items = m_volatileItems; - if (m_apply) - forEachItem(m_apply); - emit changed(); - } - - void setToBaseAspectFunction(ToBaseAspectPtr toBaseAspect) { m_toBaseAspect = toBaseAspect; } - void setCreateItemFunction(CreateItem createItem) { m_createItem = createItem; } - void setIsDirtyFunction(IsDirty isDirty) { m_isDirty = isDirty; } - void setApplyFunction(Apply apply) { m_apply = apply; } - - void forEachItem(std::function<void(const T &)> callback) - { - for (const auto &item : m_volatileItems) - callback(item); - } - - void forEachItem(std::function<void(const T &, int)> callback) - { - int idx = 0; - for (const auto &item : m_volatileItems) - callback(item, idx++); - } - - void setItemAddedCallback(const ItemCallback &callback) { m_itemAdded = callback; } - void setItemRemovedCallback(const ItemCallback &callback) { m_itemRemoved = callback; } - - qsizetype size() { return m_volatileItems.size(); } - bool isDirty() override - { - if (m_isDirty) { - for (const auto &item : m_volatileItems) { - if (m_isDirty(item)) - return true; - } - } - return false; - } - - QVariant volatileVariantValue() const override { return {}; } - -private: - QList<T> m_items; - QList<T> m_volatileItems; - ToBaseAspectPtr m_toBaseAspect; - CreateItem m_createItem; - IsDirty m_isDirty; - Apply m_apply; - ItemCallback m_itemAdded; - ItemCallback m_itemRemoved; -}; - } // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 992ce65f9be..a037278876e 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -515,13 +515,13 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, addDockWidget(Qt::LeftDockWidgetArea, dockWidget); - sourceSettings->compilers.forEachItem( + sourceSettings->compilers.forEachItem<CompilerSettings>( [addCompiler, sourceSettings](const std::shared_ptr<CompilerSettings> &compilerSettings, int idx) { addCompiler(sourceSettings, compilerSettings, idx + 1); }); - sourceSettings->compilers.setItemAddedCallback( + sourceSettings->compilers.setItemAddedCallback<CompilerSettings>( [addCompiler, sourceSettings = sourceSettings.get()]( const std::shared_ptr<CompilerSettings> &compilerSettings) { addCompiler(sourceSettings->shared_from_this(), @@ -529,7 +529,7 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, sourceSettings->compilers.size()); }); - sourceSettings->compilers.setItemRemovedCallback( + sourceSettings->compilers.setItemRemovedCallback<CompilerSettings>( [this](const std::shared_ptr<CompilerSettings> &compilerSettings) { m_compilerWidgets.removeIf([compilerSettings](const QDockWidget *c) { return static_cast<CompilerWidget *>(c->widget())->m_compilerSettings @@ -563,7 +563,7 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, m_sourceWidgets.clear(); m_compilerWidgets.clear(); - m_document->settings()->m_sources.forEachItem(addSourceEditor); + m_document->settings()->m_sources.forEachItem<SourceSettings>(addSourceEditor); QVariantMap windowState = m_document->settings()->windowState.value(); if (!windowState.isEmpty()) { @@ -589,8 +589,8 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, } }; - document->settings()->m_sources.setItemAddedCallback(addSourceEditor); - document->settings()->m_sources.setItemRemovedCallback(removeSourceEditor); + document->settings()->m_sources.setItemAddedCallback<SourceSettings>(addSourceEditor); + document->settings()->m_sources.setItemRemovedCallback<SourceSettings>(removeSourceEditor); connect(document.get(), &JsonSettingsDocument::settingsChanged, this, recreateEditors); m_context = new Core::IContext(this); diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp index 175d2c29825..d80d77aa5ed 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.cpp +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -87,14 +87,6 @@ SourceSettings::SourceSettings(const ApiConfigFunction &apiConfigFunction) return result; }); - compilers.setToBaseAspectFunction([](const std::shared_ptr<CompilerSettings> &item) { - return static_cast<Utils::BaseAspect *>(item.get()); - }); - compilers.setIsDirtyFunction( - [](const std::shared_ptr<CompilerSettings> &settings) { return settings->isDirty(); }); - compilers.setApplyFunction( - [](const std::shared_ptr<CompilerSettings> &settings) { settings->apply(); }); - for (const auto &aspect : this->aspects()) connect(aspect, &Utils::BaseAspect::volatileValueChanged, @@ -108,7 +100,7 @@ void SourceSettings::refresh() cachedLanguages().clear(); languageId.refill(); - compilers.forEachItem(&CompilerSettings::refresh); + compilers.forEachItem<CompilerSettings>(&CompilerSettings::refresh); } QString SourceSettings::languageExtension() const @@ -328,16 +320,9 @@ CompilerExplorerSettings::CompilerExplorerSettings() &CompilerExplorerSettings::changed); return newSourceSettings; }); - m_sources.setIsDirtyFunction( - [](const std::shared_ptr<SourceSettings> &settings) { return settings->isDirty(); }); - m_sources.setApplyFunction( - [](const std::shared_ptr<SourceSettings> &settings) { settings->apply(); }); - m_sources.setToBaseAspectFunction([](const std::shared_ptr<SourceSettings> &item) { - return static_cast<Utils::BaseAspect *>(item.get()); - }); connect(&compilerExplorerUrl, &Utils::StringAspect::volatileValueChanged, this, [this] { - m_sources.forEachItem(&SourceSettings::refresh); + m_sources.forEachItem<SourceSettings>(&SourceSettings::refresh); }); for (const auto &aspect : this->aspects()) diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.h b/src/plugins/compilerexplorer/compilerexplorersettings.h index 34850009af2..f4f3e2e5b60 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.h +++ b/src/plugins/compilerexplorer/compilerexplorersettings.h @@ -34,7 +34,7 @@ public: Utils::StringAspect compilerExplorerUrl{this}; Utils::TypedAspect<QVariantMap> windowState{this}; - AspectListAspect<std::shared_ptr<SourceSettings>> m_sources{this}; + Utils::AspectList m_sources{this}; Api::Config apiConfig() const { @@ -61,7 +61,7 @@ public: public: StringSelectionAspect languageId{this}; Utils::StringAspect source{this}; - AspectListAspect<std::shared_ptr<CompilerSettings>> compilers{this}; + Utils::AspectList compilers{this}; public: QString languageExtension() const; From 0b08a9752ab0ef396d9ac5b16638dff6569c72c5 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 14 Sep 2023 13:25:47 +0200 Subject: [PATCH 1095/1777] CompilationDBPM: Remove some unneeded #includes Change-Id: Iaccd053b12c440b07b7f07cdba70cf05ace1b03c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../compilationdatabaseprojectmanager/compilationdbparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp index ccbead4c4ca..aa5feae21dc 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp @@ -7,13 +7,13 @@ #include "compilationdatabaseprojectmanagertr.h" #include <coreplugin/progressmanager/progressmanager.h> + #include <projectexplorer/treescanner.h> + #include <utils/async.h> #include <utils/mimeutils.h> #include <QCryptographicHash> -#include <QDir> -#include <QFileInfo> #include <QJsonArray> #include <QJsonDocument> #include <QJsonObject> From 7295bc96ccf9548d0f07051979f8395fd57a3fd4 Mon Sep 17 00:00:00 2001 From: Yasser Grimes <yasser.grimes@qt.io> Date: Wed, 12 Jul 2023 17:23:44 +0300 Subject: [PATCH 1096/1777] McuSupport: Make QmlProject c++ interfaces accecible to the CodeModel QtMCUs relies on the QmlProject file to list c++ interfaces that are available as components in Qml, roughly similar to qmlRegisterType. Prior to this commit there was no possible methode for QtCreator to know about thos c++ interfaces so whenever there are used "Uknown Components" error is shown. After building the project qmlprojectexporter through qmlinterfacegenerator generate Qml files for each .h interface in the "CMakeFiles/<target>.dir/*.qml" or ".../<target.dir>/<module>/*.qml" To make those documents available we make use of CustomImportProvider imports: for all importable qmlproject modules loadBuiltins (new): for documents that should be available implicitly for both the signatures is changed as all created documents require the snapshot object (insert functioin) to bound their lifetime to the snapshot as they are created as shared_ptrs. duo to passing snapshot as copies between threads, storing those documents locally will cause QtC to crash Task-number: UL-6167 Change-Id: I09781f6d4b62b203944bf30ab322502d25263b56 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/libs/qmljs/qmljsinterpreter.h | 13 +- src/libs/qmljs/qmljslink.cpp | 9 +- src/plugins/mcusupport/CMakeLists.txt | 1 + src/plugins/mcusupport/mcusupport.qbs | 2 + .../mcusupport/mcusupportimportprovider.cpp | 185 ++++++++++++++++++ .../mcusupport/mcusupportimportprovider.h | 48 +++++ src/plugins/mcusupport/mcusupportplugin.cpp | 2 + 7 files changed, 257 insertions(+), 3 deletions(-) create mode 100644 src/plugins/mcusupport/mcusupportimportprovider.cpp create mode 100644 src/plugins/mcusupport/mcusupportimportprovider.h diff --git a/src/libs/qmljs/qmljsinterpreter.h b/src/libs/qmljs/qmljsinterpreter.h index 8574e37febe..8ca9f4ec26c 100644 --- a/src/libs/qmljs/qmljsinterpreter.h +++ b/src/libs/qmljs/qmljsinterpreter.h @@ -3,10 +3,11 @@ #pragma once +#include "qmljsdocument.h" +#include <qmljs/parser/qmljsastfwd_p.h> #include <qmljs/qmljs_global.h> #include <qmljs/qmljsconstants.h> #include <qmljs/qmljsimportdependencies.h> -#include <qmljs/parser/qmljsastfwd_p.h> #include <languageutils/fakemetaobject.h> @@ -1110,12 +1111,20 @@ class QMLJS_EXPORT CustomImportsProvider : public QObject { Q_OBJECT public: + typedef QHash<const Document *, QSharedPointer<const Imports>> ImportsPerDocument; explicit CustomImportsProvider(QObject *parent = nullptr); virtual ~CustomImportsProvider(); static const QList<CustomImportsProvider *> allProviders(); - virtual QList<Import> imports(ValueOwner *valueOwner, const Document *context) const = 0; + virtual QList<Import> imports(ValueOwner *valueOwner, + const Document *context, + Snapshot *snapshot = nullptr) const = 0; + virtual void loadBuiltins([[maybe_unused]] ImportsPerDocument *importsPerDocument, + [[maybe_unused]] Imports *imports, + [[maybe_unused]] const Document *context, + [[maybe_unused]] ValueOwner *valueOwner, + [[maybe_unused]] Snapshot *snapshot) {} }; } // namespace QmlJS diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp index 7a34fbaa10d..b837037b7c8 100644 --- a/src/libs/qmljs/qmljslink.cpp +++ b/src/libs/qmljs/qmljslink.cpp @@ -209,9 +209,16 @@ Context::ImportsPerDocument LinkPrivate::linkImports() // Add custom imports for the opened document for (const auto &provider : CustomImportsProvider::allProviders()) { - const auto providerImports = provider->imports(m_valueOwner, document.data()); + const auto providerImports = provider->imports(m_valueOwner, + document.data(), + &m_snapshot); for (const auto &import : providerImports) importCache.insert(ImportCacheKey(import.info), import); + provider->loadBuiltins(&importsPerDocument, + imports, + document.data(), + m_valueOwner, + &m_snapshot); } populateImportedTypes(imports, document); diff --git a/src/plugins/mcusupport/CMakeLists.txt b/src/plugins/mcusupport/CMakeLists.txt index c5ce1bfa64c..f52c31b82ab 100644 --- a/src/plugins/mcusupport/CMakeLists.txt +++ b/src/plugins/mcusupport/CMakeLists.txt @@ -25,6 +25,7 @@ add_qtc_plugin(McuSupport mcuqmlprojectnode.cpp mcuqmlprojectnode.h mcubuildstep.cpp mcubuildstep.h dialogs/mcukitcreationdialog.cpp dialogs/mcukitcreationdialog.h + mcusupportimportprovider.cpp mcusupportimportprovider.h ) add_subdirectory(test) diff --git a/src/plugins/mcusupport/mcusupport.qbs b/src/plugins/mcusupport/mcusupport.qbs index 752b6a3e6ff..96fea109d75 100644 --- a/src/plugins/mcusupport/mcusupport.qbs +++ b/src/plugins/mcusupport/mcusupport.qbs @@ -60,6 +60,8 @@ QtcPlugin { "settingshandler.cpp", "dialogs/mcukitcreationdialog.h", "dialogs/mcukitcreationdialog.cpp", + "mcusupportimportprovider.h", + "mcusupportimportprovider.cpp", ] QtcTestFiles { diff --git a/src/plugins/mcusupport/mcusupportimportprovider.cpp b/src/plugins/mcusupport/mcusupportimportprovider.cpp new file mode 100644 index 00000000000..b78baf8bd94 --- /dev/null +++ b/src/plugins/mcusupport/mcusupportimportprovider.cpp @@ -0,0 +1,185 @@ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "mcusupportimportprovider.h" + +#include <cmakeprojectmanager/cmakeprojectconstants.h> +#include <languageutils/componentversion.h> +#include <projectexplorer/project.h> +#include <projectexplorer/projectmanager.h> +#include <projectexplorer/projectnodes.h> +#include <qmljs/qmljsbind.h> +#include <qmljs/qmljsdocument.h> +#include <qmljs/qmljsinterpreter.h> +#include <qmljs/qmljsvalueowner.h> + +#include <QJsonArray> +#include <QJsonDocument> +#include <QJsonObject> +#include <QJsonValue> +#include <QRegularExpression> + +#include <optional> + +static const char uriPattern[]{R"(uri\s*:\s*[\'\"](\w+)[\'\"])"}; + +namespace McuSupport::Internal { +using namespace ProjectExplorer; + +// Get the MCU target build folder for a file +static std::optional<FilePath> getTargetBuildFolder(const FilePath &path) +{ + const Project *project = ProjectExplorer::ProjectManager::projectForFile(path); + if (!project) + return std::nullopt; + auto node = project->nodeForFilePath(path); + if (!node) + return std::nullopt; + + // Get the cmake target node (CMakeTargetNode is internal) + // Go up in hierarchy until the first CMake target node + const ProjectNode *targetNode = nullptr; + FilePath projectBuildFolder; + while (node) { + targetNode = node->asProjectNode(); + if (!targetNode) { + node = node->parentProjectNode(); + continue; + } + projectBuildFolder = FilePath::fromVariant( + targetNode->data(CMakeProjectManager::Constants::BUILD_FOLDER_ROLE)); + if (!projectBuildFolder.isDir()) { + node = node->parentProjectNode(); + targetNode = nullptr; + continue; + } + break; + } + + if (!targetNode) + return std::nullopt; + + return projectBuildFolder / "CMakeFiles" / (project->displayName() + ".dir"); +}; + +QList<Import> McuSupportImportProvider::imports(ValueOwner *valueOwner, + const Document *context, + Snapshot *snapshot) const +{ + QList<Import> ret; + + const FilePath path = context->fileName(); + const std::optional<FilePath> cmakeFilesPathOpt = getTargetBuildFolder(path); + if (!cmakeFilesPathOpt) + return {}; + + const FilePath inputFilePath = *cmakeFilesPathOpt / "config/input.json"; + + const QJsonDocument doc = QJsonDocument::fromJson(inputFilePath.fileContents().value_or("")); + if (!doc.isObject()) + return {}; + const QJsonObject mainProjectObj = doc.object(); + for (const QJsonValue &moduleValue : mainProjectObj["modulesDependencies"].toArray()) { + if (!moduleValue.isObject()) + continue; + const FilePath modulePath = FilePath::fromUserInput( + moduleValue.toObject()["qmlProjectFile"].toString()); + const QString fileContent = QString::fromLatin1(modulePath.fileContents().value_or("")); + QRegularExpressionMatch uriMatch = QRegularExpression(uriPattern).match(fileContent); + if (!uriMatch.hasMatch()) + continue; + QString moduleUri = uriMatch.captured(1); + const FilePath moduleFolder = *cmakeFilesPathOpt / moduleUri; + + Import import; + import.valid = true; + import.object = new ObjectValue(valueOwner, moduleUri); + import.info = ImportInfo::moduleImport(moduleUri, {1, 0}, QString()); + for (const auto &qmlFilePath : moduleFolder.dirEntries(FileFilter({"*.qml"}, QDir::Files))) { + Document::MutablePtr doc = Document::create(qmlFilePath, Dialect::Qml); + doc->setSource(QString::fromLatin1(qmlFilePath.fileContents().value_or(""))); + doc->parseQml(); + snapshot->insert(doc, true); + import.object->setMember(doc->componentName(), doc->bind()->rootObjectValue()); + } + ret << import; + } + return ret; +}; + +void McuSupportImportProvider::loadBuiltins(ImportsPerDocument *importsPerDocument, + Imports *imports, + const Document *context, + ValueOwner *valueOwner, + Snapshot *snapshot) +{ + Import import; + import.valid = true; + import.object = new ObjectValue(valueOwner, "<qul>"); + import.info = ImportInfo::moduleImport("qul", {1, 0}, QString()); + getInterfacesImport(context->fileName(), importsPerDocument, import, valueOwner, snapshot); + imports->append(import); +}; + +void McuSupportImportProvider::getInterfacesImport(const FilePath &path, + ImportsPerDocument *importsPerDocument, + Import &import, + ValueOwner *valueOwner, + Snapshot *snapshot) const +{ + const std::optional<FilePath> cmakeFilesPathOpt = getTargetBuildFolder(path); + if (!cmakeFilesPathOpt) + return; + + const FilePath inputFilePath = *cmakeFilesPathOpt / "config/input.json"; + + std::optional<FilePath> fileModule = getFileModule(path, inputFilePath); + FilePath lookupDir = *cmakeFilesPathOpt + / (fileModule && !fileModule->isEmpty() + ? QRegularExpression(uriPattern) + .match(QString::fromLatin1( + fileModule->fileContents().value_or(""))) + .captured(1) + : ""); + + for (const auto &qmlFilePath : lookupDir.dirEntries(FileFilter({"*.qml"}, QDir::Files))) { + Document::MutablePtr doc = Document::create(qmlFilePath, Dialect::Qml); + doc->setSource(QString::fromLatin1(qmlFilePath.fileContents().value_or(""))); + doc->parseQml(); + snapshot->insert(doc, true); + import.object->setMember(doc->componentName(), doc->bind()->rootObjectValue()); + importsPerDocument->insert(doc.data(), QSharedPointer<Imports>(new Imports(valueOwner))); + } +} + +std::optional<FilePath> McuSupportImportProvider::getFileModule(const FilePath &file, + const FilePath &inputFile) const +{ + const auto doc = QJsonDocument::fromJson(inputFile.fileContents().value_or("")); + if (!doc.isObject()) + return {}; + + const QJsonObject mainProjectObject = doc.object(); + + // Mapping module objects starting with mainProject + const QJsonArray mainProjectQmlFiles = mainProjectObject["QmlFiles"].toArray(); + if (std::any_of(mainProjectQmlFiles.constBegin(), + mainProjectQmlFiles.constEnd(), + [&file](const QJsonValue &value) { + return FilePath::fromUserInput(value.toString()) == file; + })) + return std::nullopt; + + for (const QJsonValue &module : mainProjectObject["modulesDependencies"].toArray()) { + const QJsonObject moduleObject = module.toObject(); + const QJsonArray moduleQmlFiles = moduleObject["QmlFiles"].toArray(); + if (std::any_of(moduleQmlFiles.constBegin(), + moduleQmlFiles.constEnd(), + [&file](const QJsonValue &value) { + return FilePath::fromUserInput(value.toString()) == file; + })) + return FilePath::fromUserInput(moduleObject["qmlProjectFile"].toString()); + } + return std::nullopt; +} +}; // namespace McuSupport::Internal diff --git a/src/plugins/mcusupport/mcusupportimportprovider.h b/src/plugins/mcusupport/mcusupportimportprovider.h new file mode 100644 index 00000000000..829fa711505 --- /dev/null +++ b/src/plugins/mcusupport/mcusupportimportprovider.h @@ -0,0 +1,48 @@ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "mcusupport_global.h" +#include "mcusupportplugin.h" + +#include <utils/filepath.h> +#include <qmljs/qmljsdocument.h> +#include <qmljs/qmljsinterpreter.h> + +namespace McuSupport::Internal { +using namespace QmlJS; +using namespace Utils; +class McuSupportImportProvider : public CustomImportsProvider +{ +public: + McuSupportImportProvider() {} + ~McuSupportImportProvider() {} + + // Overridden functions + virtual QList<Import> imports(ValueOwner *valueOwner, + const Document *context, + Snapshot *snapshot) const override; + virtual void loadBuiltins(ImportsPerDocument *importsPerDocument, + Imports *imports, + const Document *context, + ValueOwner *valueOwner, + Snapshot *snapshot) override; + + // Add to the interfaces needed for a document + // path: opened qml document + // importsPerDocument: imports available in the document (considered imported) + // import: qul import containing builtin types (interfaces) + // valueOwner: imports members owner + // snapshot: where qul documenents live + void getInterfacesImport(const FilePath &path, + ImportsPerDocument *importsPerDocument, + Import &import, + ValueOwner *valueOwner, + Snapshot *snapshot) const; + + // Get the qmlproject module which a qmlfile is part of + // nullopt means the file is part of the main project + std::optional<FilePath> getFileModule(const FilePath &file, const FilePath &inputFile) const; +}; +}; // namespace McuSupport::Internal diff --git a/src/plugins/mcusupport/mcusupportplugin.cpp b/src/plugins/mcusupport/mcusupportplugin.cpp index f531b93a2aa..a9f8ff0d499 100644 --- a/src/plugins/mcusupport/mcusupportplugin.cpp +++ b/src/plugins/mcusupport/mcusupportplugin.cpp @@ -8,6 +8,7 @@ #include "mcuqmlprojectnode.h" #include "mcusupportconstants.h" #include "mcusupportdevice.h" +#include "mcusupportimportprovider.h" #include "mcusupportoptions.h" #include "mcusupportoptionspage.h" #include "mcusupportrunconfiguration.h" @@ -102,6 +103,7 @@ public: McuSupportOptions m_options{m_settingsHandler}; McuSupportOptionsPage optionsPage{m_options, m_settingsHandler}; MCUBuildStepFactory mcuBuildStepFactory; + McuSupportImportProvider mcuImportProvider; }; // class McuSupportPluginPrivate static McuSupportPluginPrivate *dd{nullptr}; From b5b61480bda066577285e11825c5cca208876d6e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 14 Sep 2023 13:38:52 +0200 Subject: [PATCH 1097/1777] Core: Code cosmetics in saveitemsdialog.cpp Including removing one use of QDir::toNativeSeparators() Change-Id: I5c1fe7733942d6161bd9dda94195a44c0cfded72 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../coreplugin/dialogs/saveitemsdialog.cpp | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp b/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp index 3b9034ddd71..2d693ad7420 100644 --- a/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp @@ -12,19 +12,16 @@ #include <utils/hostosinfo.h> #include <utils/layoutbuilder.h> -#include <extensionsystem/pluginmanager.h> - #include <QCheckBox> -#include <QDebug> #include <QDialogButtonBox> -#include <QDir> -#include <QFileInfo> #include <QLabel> #include <QPushButton> #include <QTreeWidget> Q_DECLARE_METATYPE(Core::IDocument*) +using namespace Utils; + namespace Core::Internal { SaveItemsDialog::SaveItemsDialog(QWidget *parent, const QList<IDocument *> &items) @@ -46,7 +43,7 @@ SaveItemsDialog::SaveItemsDialog(QWidget *parent, const QList<IDocument *> &item m_treeWidget->setColumnCount(2); // QDialogButtonBox's behavior for "destructive" is wrong, the "do not save" should be left-aligned - const QDialogButtonBox::ButtonRole discardButtonRole = Utils::HostOsInfo::isMacHost() + const QDialogButtonBox::ButtonRole discardButtonRole = HostOsInfo::isMacHost() ? QDialogButtonBox::ResetRole : QDialogButtonBox::DestructiveRole; if (DiffService::instance()) { @@ -71,26 +68,24 @@ SaveItemsDialog::SaveItemsDialog(QWidget *parent, const QList<IDocument *> &item for (IDocument *document : items) { QString visibleName; - QString directory; - Utils::FilePath filePath = document->filePath(); + FilePath directory; + FilePath filePath = document->filePath(); if (filePath.isEmpty()) { visibleName = document->fallbackSaveAsFileName(); } else { - directory = filePath.absolutePath().toUserOutput(); + directory = filePath.absolutePath(); visibleName = filePath.fileName(); } QTreeWidgetItem *item = new QTreeWidgetItem(m_treeWidget, - QStringList() - << visibleName - << QDir::toNativeSeparators(directory)); + QStringList{visibleName, directory.toUserOutput()}); if (!filePath.isEmpty()) - item->setIcon(0, Utils::FileIconProvider::icon(filePath)); + item->setIcon(0, FileIconProvider::icon(filePath)); item->setData(0, Qt::UserRole, QVariant::fromValue(document)); } m_treeWidget->resizeColumnToContents(0); m_treeWidget->selectAll(); - if (Utils::HostOsInfo::isMacHost()) + if (HostOsInfo::isMacHost()) m_treeWidget->setAlternatingRowColors(true); adjustButtonWidths(); updateButtons(); @@ -151,7 +146,7 @@ void SaveItemsDialog::adjustButtonWidths() if (hint > maxTextWidth) maxTextWidth = hint; } - if (Utils::HostOsInfo::isMacHost()) { + if (HostOsInfo::isMacHost()) { QPushButton *cancelButton = m_buttonBox->button(QDialogButtonBox::Cancel); int cancelButtonWidth = cancelButton->sizeHint().width(); if (cancelButtonWidth > maxTextWidth) From 93273af6dc2ee18c5748bd267628ce3d6cff2d5f Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 14 Sep 2023 10:44:58 +0200 Subject: [PATCH 1098/1777] qbs build: Move pluginjson replacements property to the module ... where it clearly belongs. Change-Id: I22d098b701e4921cde53ab34d11ab0078326ab94 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- qbs/imports/QtcPlugin.qbs | 1 - qbs/modules/pluginjson/pluginjson.qbs | 4 +++- src/plugins/clearcase/clearcase.qbs | 2 +- src/plugins/designer/designer.qbs | 2 +- src/plugins/updateinfo/updateinfo.qbs | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/qbs/imports/QtcPlugin.qbs b/qbs/imports/QtcPlugin.qbs index 9e5a743e12a..221789ef605 100644 --- a/qbs/imports/QtcPlugin.qbs +++ b/qbs/imports/QtcPlugin.qbs @@ -8,7 +8,6 @@ QtcProduct { installTags: ["dynamiclibrary", "debuginfo_dll"] useGuiPchFile: true - property var pluginJsonReplacements property var pluginRecommends: [] property var pluginTestDepends: [] diff --git a/qbs/modules/pluginjson/pluginjson.qbs b/qbs/modules/pluginjson/pluginjson.qbs index f52158c9652..9a200cf83f7 100644 --- a/qbs/modules/pluginjson/pluginjson.qbs +++ b/qbs/modules/pluginjson/pluginjson.qbs @@ -8,6 +8,8 @@ Module { Depends { id: qtcore; name: "Qt.core" } Depends { name: "qtc" } + property var replacements + // TODO: Wrap the VCS specific stuff in a dedicated module property bool hasVcs: Utilities.versionCompare(qbs.version, "1.10") >= 0 property bool useVcsData: hasVcs @@ -52,7 +54,7 @@ Module { var cmd = new JavaScriptCommand(); cmd.description = "prepare " + FileInfo.fileName(output.filePath); cmd.highlight = "codegen"; - cmd.pluginJsonReplacements = product.pluginJsonReplacements; + cmd.pluginJsonReplacements = product.pluginjson.replacements; cmd.plugin_depends = []; var deps = product.dependencies; for (var d in deps) { diff --git a/src/plugins/clearcase/clearcase.qbs b/src/plugins/clearcase/clearcase.qbs index 2b65135f8de..a69303bded4 100644 --- a/src/plugins/clearcase/clearcase.qbs +++ b/src/plugins/clearcase/clearcase.qbs @@ -3,7 +3,7 @@ import qbs 1.0 QtcPlugin { name: "ClearCase" - pluginJsonReplacements: ({"CLEARCASE_DISABLED_STR": (qbs.targetOS.contains("macos") ? "true": "false")}) + pluginjson.replacements: ({"CLEARCASE_DISABLED_STR": (qbs.targetOS.contains("macos") ? "true": "false")}) Depends { name: "Qt.widgets" } Depends { name: "Utils" } diff --git a/src/plugins/designer/designer.qbs b/src/plugins/designer/designer.qbs index 88bfb1df6be..bde63fa3eea 100644 --- a/src/plugins/designer/designer.qbs +++ b/src/plugins/designer/designer.qbs @@ -27,7 +27,7 @@ QtcPlugin { sharedSources.prefix ]) - pluginJsonReplacements: ({"DESIGNER_PLUGIN_ARGUMENTS": + pluginjson.replacements: ({"DESIGNER_PLUGIN_ARGUMENTS": "\"Arguments\" : [\n\ {\n\ \"Name\" : \"-designer-qt-pluginpath\",\n\ diff --git a/src/plugins/updateinfo/updateinfo.qbs b/src/plugins/updateinfo/updateinfo.qbs index fc294e2a132..cdef4fc5105 100644 --- a/src/plugins/updateinfo/updateinfo.qbs +++ b/src/plugins/updateinfo/updateinfo.qbs @@ -9,7 +9,7 @@ QtcPlugin { Depends { name: "Core" } property bool enable: false - pluginJsonReplacements: ({"UPDATEINFO_EXPERIMENTAL_STR": (enable ? "false": "true")}) + pluginjson.replacements: ({"UPDATEINFO_EXPERIMENTAL_STR": (enable ? "false": "true")}) files: [ "settingspage.cpp", From 1701172c303a3aceeca3204d9a244b41988a764f Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 14 Sep 2023 15:19:59 +0200 Subject: [PATCH 1099/1777] SquishTests: Fix opening cascaded menus Change-Id: Ieae5d24f60b9e67c602dbf43737ee3a712a7908c Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- tests/system/shared/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 8639c6e2651..77b493b32a0 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -190,8 +190,7 @@ def invokeMenuItem(menu, item, *subItems): "Function arguments: '%s', '%s', %s" % (menu, item, str(subItems))) break # we failed to trigger - no need to process subItems further else: - noAmpersandItem = item.replace('&', '') - waitForObject("{type='QMenu' title='%s'}" % noAmpersandItem, 2000) + waitForObject("{type='QMenu' title='%s'}" % str(itemObject.text), 2000) itemObject = waitForObjectItem(itemObject, subItem) waitFor("itemObject.enabled", 2000) activateItem(itemObject) From e76ec76c0f66134a42761208ec69db42499c4584 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 13 Sep 2023 11:49:06 +0200 Subject: [PATCH 1100/1777] Remove unused variable Amends 7f908d737b0e017e65e917c65b19499f3093fa4c Change-Id: I5e28f850c6a4d836ba7c48bd117a91aab64f478c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/coreplugin/mainwindow.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 0f4f303a754..a483bf470c5 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -111,8 +111,6 @@ static const char windowStateKey[] = "WindowState"; static const char modeSelectorLayoutKey[] = "ModeSelectorLayout"; static const char menubarVisibleKey[] = "MenubarVisible"; -static const bool askBeforeExitDefault = false; - static bool hideToolsMenu() { return Core::ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_TOOLS, false).toBool(); From b5684ee49003e2c71acc12a8f4120295ecb6bcf6 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 14 Sep 2023 12:33:18 +0200 Subject: [PATCH 1101/1777] Utils: Fix warning regarding incompatible signedness Change-Id: I0b035ec53d65d636ace121d0d155249eebad2f8d Reviewed-by: Xavier BESSON <developer@xavi-b.fr> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/libs/utils/uncommentselection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/uncommentselection.cpp b/src/libs/utils/uncommentselection.cpp index 8cce4c86a02..5f9217a08cc 100644 --- a/src/libs/utils/uncommentselection.cpp +++ b/src/libs/utils/uncommentselection.cpp @@ -10,6 +10,8 @@ #include <QTextCursor> #include <QTextDocument> +#include <limits> + namespace Utils { CommentDefinition CommentDefinition::CppStyle = CommentDefinition("//", "/*", "*/"); @@ -176,7 +178,7 @@ QTextCursor unCommentSelection(const QTextCursor &cursorIn, } const int singleLineLength = definition.singleLine.length(); - unsigned int minTab = -1; + int minTab = INT_MAX; if (definition.isAfterWhitespace && !doSingleLineStyleUncomment) { for (QTextBlock block = startBlock; block != endBlock && minTab != 0; block = block.next()) { QTextCursor c(block); From 4d358ae337de27d04173bbe8d5d6f87a1ee055df Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 14 Sep 2023 16:22:25 +0200 Subject: [PATCH 1102/1777] CMakePM: Jump to function/macro/option definitions in CMake editor Fixes: QTCREATORBUG-25523 Change-Id: If9ab6651a858e5fa08e8a1c321cb1f757831e14a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 24 +++++++++++++++++++ .../cmakeprojectmanager/cmakebuildsystem.h | 10 +++++++- .../cmakeprojectmanager/cmakeeditor.cpp | 12 +++++++--- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index f1a5d3cfbeb..866fbf89d59 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1141,6 +1141,7 @@ void CMakeBuildSystem::handleParsingSucceeded(bool restoredFromBackup) }); m_buildTargets += m_reader.takeBuildTargets(errorMessage); m_cmakeFiles = m_reader.takeCMakeFileInfos(errorMessage); + setupCMakeSymbolsHash(); checkAndReportError(errorMessage); } @@ -1245,6 +1246,29 @@ void CMakeBuildSystem::wireUpConnections() } } +void CMakeBuildSystem::setupCMakeSymbolsHash() +{ + m_cmakeSymbolsHash.clear(); + + for (const auto &cmakeFile : std::as_const(m_cmakeFiles)) { + for (const auto &func : cmakeFile.cmakeListFile.Functions) { + if (func.LowerCaseName() != "function" && func.LowerCaseName() != "macro" + && func.LowerCaseName() != "option") + continue; + + if (func.Arguments().size() == 0) + continue; + auto arg = func.Arguments()[0]; + + Utils::Link link; + link.targetFilePath = cmakeFile.path; + link.targetLine = arg.Line; + link.targetColumn = arg.Column - 1; + m_cmakeSymbolsHash.insert(QString::fromUtf8(arg.Value), link); + } + } +} + void CMakeBuildSystem::ensureBuildDirectory(const BuildDirParameters ¶meters) { const FilePath bdir = parameters.buildDirectory; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h index 068fbc986e1..ca67d5549e2 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h @@ -18,7 +18,10 @@ namespace ProjectExplorer { class ExtraCompiler; class FolderNode; } -namespace Utils { class Process; } +namespace Utils { + class Process; + class Link; +} namespace CMakeProjectManager { @@ -115,6 +118,8 @@ public: QString error() const; QString warning() const; + const QHash<QString, Utils::Link> &cmakeSymbolsHash() const { return m_cmakeSymbolsHash; } + signals: void configurationCleared(); void configurationChanged(const CMakeConfig &config); @@ -190,6 +195,8 @@ private: void runCTest(); + void setupCMakeSymbolsHash(); + struct ProjectFileArgumentPosition { cmListFileArgument argumentPosition; @@ -215,6 +222,7 @@ private: QList<ProjectExplorer::ExtraCompiler *> m_extraCompilers; QList<CMakeBuildTarget> m_buildTargets; QSet<CMakeFileInfo> m_cmakeFiles; + QHash<QString, Utils::Link> m_cmakeSymbolsHash; QHash<QString, ProjectFileArgumentPosition> m_filesToBeRenamed; diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 65b69bce2dd..7fd96fc8439 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -4,6 +4,7 @@ #include "cmakeeditor.h" #include "cmakeautocompleter.h" +#include "cmakebuildsystem.h" #include "cmakefilecompletionassist.h" #include "cmakeindenter.h" #include "cmakeprojectconstants.h" @@ -206,6 +207,11 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, ->buildDirectory() .pathAppended(relativePathSuffix) .path()); + + // Check if the symbols is a user defined function or macro + const CMakeBuildSystem *cbs = static_cast<const CMakeBuildSystem *>(bs); + if (cbs->cmakeSymbolsHash().contains(buffer)) + return processLinkCallback(cbs->cmakeSymbolsHash().value(buffer)); } } // TODO: Resolve more variables @@ -259,11 +265,11 @@ CMakeEditorFactory::CMakeEditorFactory() setAutoCompleterCreator([] { return new CMakeAutoCompleter; }); setEditorActionHandlers(TextEditorActionHandler::UnCommentSelection - | TextEditorActionHandler::JumpToFileUnderCursor - | TextEditorActionHandler::Format); + | TextEditorActionHandler::FollowSymbolUnderCursor + | TextEditorActionHandler::Format); ActionContainer *contextMenu = ActionManager::createMenu(Constants::M_CONTEXT); - contextMenu->addAction(ActionManager::command(TextEditor::Constants::JUMP_TO_FILE_UNDER_CURSOR)); + contextMenu->addAction(ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR)); contextMenu->addSeparator(Context(Constants::CMAKE_EDITOR_ID)); contextMenu->addAction(ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION)); } From 78f89fc777769d6c7c8d629bd5012777e66bfeb3 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 7 Sep 2023 19:06:39 +0200 Subject: [PATCH 1103/1777] CMakePM: Proper support for Unity builds A Unity build can be enabled by specifying CMAKE_UNITY_BUILD set to ON globally or per target bases via the UNITY_BUILD property. CMake would then add unity_NN_[cxx|c].[cxx|c] sources files that would include the existing project files. The existing project files would then be added as "headers" to the project and exported via the CMake file-api. This patch makes sure that these new "headers" are added to the Qt Creator's code model and have proper syntax highlighting, be available to plugins (e.g. Todo) and so on. Fixes: QTCREATORBUG-23635 Fixes: QTCREATORBUG-26822 Fixes: QTCREATORBUG-29080 Change-Id: Ie8dd542504f632c01f91691f8736e51be8b19a01 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../fileapidataextractor.cpp | 59 +++++++++++++++---- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 05574b9a007..980ba47cbe3 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -332,6 +332,12 @@ bool isPchFile(const FilePath &buildDirectory, const FilePath &path) return path.isChildOf(buildDirectory) && path.fileName().startsWith("cmake_pch"); } +bool isUnityFile(const FilePath &buildDirectory, const FilePath &path) +{ + return path.isChildOf(buildDirectory) && path.parentDir().fileName() == "Unity" + && path.fileName().startsWith("unity_"); +} + RawProjectParts generateRawProjectParts(const PreprocessedData &input, const FilePath &sourceDirectory, const FilePath &buildDirectory) @@ -381,11 +387,20 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input, // Get all sources from the compiler group, except generated sources QStringList sources; + auto addToSources = [sourceDirectory, &sources](const QString &source) { + const FilePath sourcePath = FilePath::fromString(source); + if (sourcePath.isAbsolutePath()) + sources.push_back(source); + else + sources.push_back( + sourceDirectory.pathAppended(source).absoluteFilePath().path()); + }; + for (auto idx: ci.sources) { SourceInfo si = t.sources.at(idx); if (si.isGenerated) continue; - sources.push_back(sourceDirectory.pathAppended(si.path).absoluteFilePath().path()); + addToSources(si.path); } // If we are not in a pch compiler group, add all the headers that are not generated @@ -393,27 +408,45 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input, return isPchFile(buildDirectory, FilePath::fromString(path)); }); + const bool hasUnitySources = allOf(sources, [buildDirectory](const QString &path) { + return isUnityFile(buildDirectory, FilePath::fromString(path)); + }); + QString headerMimeType; - if (ci.language == "C") + QString sourceMimeType; + if (ci.language == "C") { headerMimeType = CppEditor::Constants::C_HEADER_MIMETYPE; - else if (ci.language == "CXX") + sourceMimeType = CppEditor::Constants::C_SOURCE_MIMETYPE; + } else if (ci.language == "CXX") { headerMimeType = CppEditor::Constants::CPP_HEADER_MIMETYPE; + sourceMimeType = CppEditor::Constants::CPP_SOURCE_MIMETYPE; + } if (!hasPchSource) { for (const SourceInfo &si : t.sources) { if (si.isGenerated) continue; const auto mimeTypes = Utils::mimeTypesForFileName(si.path); - for (const auto &mime : mimeTypes) - if (mime.inherits(headerMimeType)) - sources.push_back( - sourceDirectory.pathAppended(si.path).absoluteFilePath().path()); + for (const auto &mime : mimeTypes) { + const bool headerType = mime.inherits(headerMimeType); + const bool sourceUnityType = hasUnitySources ? mime.inherits(sourceMimeType) + : false; + if (headerType || sourceUnityType) + addToSources(si.path); + } } } + sources.removeDuplicates(); - // Set project files except pch files - rpp.setFiles(Utils::filtered(sources, [buildDirectory](const QString &path) { - return !isPchFile(buildDirectory, FilePath::fromString(path)); - }), {}, [headerMimeType](const QString &path) { + // Set project files except pch / unity files + rpp.setFiles(Utils::filtered(sources, + [buildDirectory](const QString &path) { + return !isPchFile(buildDirectory, + FilePath::fromString(path)) + && !isUnityFile(buildDirectory, + FilePath::fromString(path)); + }), + {}, + [headerMimeType](const QString &path) { // Similar to ProjectFile::classify but classify headers with language // of compile group instead of ambiguous header if (path.endsWith(".h")) @@ -561,9 +594,9 @@ void addCompileGroups(ProjectNode *targetRoot, auto node = std::make_unique<FileNode>(sourcePath, Node::fileTypeForFileName(sourcePath)); node->setIsGenerated(si.isGenerated); - // CMake pch files are generated at configured time, but not marked as generated + // CMake pch / unity files are generated at configured time, but not marked as generated // so that a "clean" step won't remove them and at a subsequent build they won't exist. - if (isPchFile(buildDirectory, sourcePath)) + if (isPchFile(buildDirectory, sourcePath) || isUnityFile(buildDirectory, sourcePath)) node->setIsGenerated(true); // Where does the file node need to go? From 26b436f46f5d485c371ec5fd7876bcf2fab3c552 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 14 Sep 2023 14:04:05 +0200 Subject: [PATCH 1104/1777] Utils: Fix constness in AspectList functions Change-Id: I960e02e1a193856de3ed0e090fdf694884a28ac5 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/aspects.cpp | 6 +++--- src/libs/utils/aspects.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 27f8df50b3e..b5669908486 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -3089,7 +3089,7 @@ QList<std::shared_ptr<BaseAspect>> AspectList::volatileItems() const return d->volatileItems; } -std::shared_ptr<BaseAspect> AspectList::addItem(std::shared_ptr<BaseAspect> item) +std::shared_ptr<BaseAspect> AspectList::addItem(const std::shared_ptr<BaseAspect> &item) { if (undoStack()) pushUndo(new AddItemCommand(this, item)); @@ -3099,7 +3099,7 @@ std::shared_ptr<BaseAspect> AspectList::addItem(std::shared_ptr<BaseAspect> item return item; } -void AspectList::actualRemoveItem(std::shared_ptr<BaseAspect> item) +void AspectList::actualRemoveItem(const std::shared_ptr<BaseAspect> &item) { d->volatileItems.removeOne(item); if (d->itemRemoved) @@ -3109,7 +3109,7 @@ void AspectList::actualRemoveItem(std::shared_ptr<BaseAspect> item) d->items = d->volatileItems; } -void AspectList::removeItem(std::shared_ptr<BaseAspect> item) +void AspectList::removeItem(const std::shared_ptr<BaseAspect> &item) { if (undoStack()) pushUndo(new RemoveItemCommand(this, item)); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 79f7b460847..d07be7bcb77 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -1013,11 +1013,11 @@ public: QList<std::shared_ptr<BaseAspect>> items() const; QList<std::shared_ptr<BaseAspect>> volatileItems() const; - std::shared_ptr<BaseAspect> addItem(std::shared_ptr<BaseAspect> item); + std::shared_ptr<BaseAspect> addItem(const std::shared_ptr<BaseAspect> &item); std::shared_ptr<BaseAspect> actualAddItem(const std::shared_ptr<BaseAspect> &item); - void removeItem(std::shared_ptr<BaseAspect> item); - void actualRemoveItem(std::shared_ptr<BaseAspect> item); + void removeItem(const std::shared_ptr<BaseAspect> &item); + void actualRemoveItem(const std::shared_ptr<BaseAspect> &item); void apply() override; From 85f00b243f238b4e24379f9d04b586743c8019d4 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 14 Sep 2023 14:05:09 +0200 Subject: [PATCH 1105/1777] Utils: Fix DeviceShell error handling Change-Id: I5e519ffa9672841d84e565ea5fd222d21ca354bd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/deviceshell.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/deviceshell.cpp b/src/libs/utils/deviceshell.cpp index 99ddecdeec9..724a7ce33b0 100644 --- a/src/libs/utils/deviceshell.cpp +++ b/src/libs/utils/deviceshell.cpp @@ -214,7 +214,8 @@ bool DeviceShell::start() m_shellProcess->kill(); m_shellProcess.reset(); return false; - } + } else + return false; connect(m_shellProcess.get(), &Process::done, m_shellProcess.get(), [this] { if (m_shellProcess->resultData().m_exitCode != EXIT_SUCCESS From 16f7652717c6587fb9013ca1bb0aef9c74f1fa27 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 14 Sep 2023 10:55:56 +0200 Subject: [PATCH 1106/1777] Utils: Add AspectList::addToLayout Added a new, clean IconButton that mimiks the ToolButton with the compact/relaxed background. Change-Id: I582c6aac404724af5459bab2ca9023aa63171f93 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/CMakeLists.txt | 1 + src/libs/utils/aspects.cpp | 81 ++++++++++++++++++++++++++++++ src/libs/utils/aspects.h | 1 + src/libs/utils/fancylineedit.cpp | 19 +++---- src/libs/utils/fancylineedit.h | 4 +- src/libs/utils/iconbutton.cpp | 62 +++++++++++++++++++++++ src/libs/utils/iconbutton.h | 27 ++++++++++ src/libs/utils/utils.qbs | 2 + src/libs/utils/variablechooser.cpp | 4 +- 9 files changed, 188 insertions(+), 13 deletions(-) create mode 100644 src/libs/utils/iconbutton.cpp create mode 100644 src/libs/utils/iconbutton.h diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index b7f956f968f..2467f6dfbc5 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -75,6 +75,7 @@ add_qtc_library(Utils hostosinfo.cpp hostosinfo.h htmldocextractor.cpp htmldocextractor.h icon.cpp icon.h + iconbutton.cpp iconbutton.h id.cpp id.h indexedcontainerproxyconstiterator.h infobar.cpp infobar.h diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index b5669908486..42bd40badf3 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -7,6 +7,7 @@ #include "checkablemessagebox.h" #include "environment.h" #include "fancylineedit.h" +#include "iconbutton.h" #include "layoutbuilder.h" #include "passworddialog.h" #include "pathchooser.h" @@ -14,6 +15,7 @@ #include "qtcassert.h" #include "qtcolorbutton.h" #include "qtcsettings.h" +#include "utilsicons.h" #include "utilstr.h" #include "variablechooser.h" @@ -26,9 +28,12 @@ #include <QLabel> #include <QLineEdit> #include <QListWidget> +#include <QPaintEvent> +#include <QPainter> #include <QPointer> #include <QPushButton> #include <QRadioButton> +#include <QScrollArea> #include <QSettings> #include <QSpinBox> #include <QTextEdit> @@ -3155,5 +3160,81 @@ bool AspectList::isDirty() return false; } +class ColoredRow : public QWidget +{ +public: + ColoredRow(int idx, QWidget *parent = nullptr) + : QWidget(parent) + , m_index(idx) + {} + void paintEvent(QPaintEvent *event) + { + QPainter p(this); + QPalette pal = palette(); + if (m_index % 2 == 0) + p.fillRect(event->rect(), pal.base()); + else + p.fillRect(event->rect(), pal.alternateBase()); + } + +private: + int m_index; +}; + +void AspectList::addToLayout(Layouting::LayoutItem &parent) +{ + using namespace Layouting; + + QScrollArea *scrollArea = new QScrollArea; + scrollArea->setWidgetResizable(true); + scrollArea->setMaximumHeight(100); + scrollArea->setMinimumHeight(100); + scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + + auto fill = [this, scrollArea]() mutable { + if (scrollArea->widget()) + delete scrollArea->takeWidget(); + + auto add = new QPushButton(Tr::tr("Add")); + QObject::connect(add, &QPushButton::clicked, scrollArea, [this] { + addItem(d->createItem()); + }); + + Column column{noMargin()}; + + forEachItem<BaseAspect>([&column, this](const std::shared_ptr<BaseAspect> &item, int idx) { + auto removeBtn = new IconButton; + removeBtn->setIcon(Utils::Icons::EDIT_CLEAR.icon()); + removeBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + QObject::connect(removeBtn, &QPushButton::clicked, removeBtn, [this, item] { + removeItem(item); + }); + ColoredRow *rowWdgt = new ColoredRow(idx); + // clang-format off + auto row = Row { + *item, + removeBtn, + spacing(5), + }; + // clang-format on + row.attachTo(rowWdgt); + column.addItem(rowWdgt); + }); + + ColoredRow *rowWdgt = new ColoredRow(size()); + Row{st, add}.attachTo(rowWdgt); + column.addItem(rowWdgt); + + QWidget *contentWidget = column.emerge(); + contentWidget->layout()->setSpacing(1); + + scrollArea->setWidget(contentWidget); + }; + + fill(); + QObject::connect(this, &AspectList::volatileValueChanged, scrollArea, fill); + + parent.addItem(scrollArea); +} } // namespace Utils diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index d07be7bcb77..fb1945b156e 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -1062,6 +1062,7 @@ public: QVariant volatileVariantValue() const override { return {}; } + void addToLayout(Layouting::LayoutItem &parent) override; private: std::unique_ptr<Internal::AspectListPrivate> d; diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index 09fe9380197..f30fa4bd841 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -102,7 +102,7 @@ public: bool eventFilter(QObject *obj, QEvent *event) override; FancyLineEdit *m_lineEdit; - IconButton *m_iconbutton[2]; + FancyIconButton *m_iconbutton[2]; HistoryCompleter *m_historyCompleter = nullptr; QShortcut m_completionShortcut; FancyLineEdit::ValidationFunction m_validationFunction = &FancyLineEdit::validateWithValidator; @@ -151,7 +151,7 @@ FancyLineEditPrivate::FancyLineEditPrivate(FancyLineEdit *parent) &m_completionShortcut, &QShortcut::setKey); for (int i = 0; i < 2; ++i) { - m_iconbutton[i] = new IconButton(parent); + m_iconbutton[i] = new FancyIconButton(parent); m_iconbutton[i]->installEventFilter(this); m_iconbutton[i]->hide(); m_iconbutton[i]->setAutoHide(false); @@ -619,14 +619,15 @@ QString FancyLineEdit::fixInputString(const QString &string) // IconButton - helper class to represent a clickable icon // -IconButton::IconButton(QWidget *parent) - : QAbstractButton(parent), m_autoHide(false) +FancyIconButton::FancyIconButton(QWidget *parent) + : QAbstractButton(parent) + , m_autoHide(false) { setCursor(Qt::ArrowCursor); setFocusPolicy(Qt::NoFocus); } -void IconButton::paintEvent(QPaintEvent *) +void FancyIconButton::paintEvent(QPaintEvent *) { const qreal pixelRatio = window()->windowHandle()->devicePixelRatio(); const QPixmap iconPixmap = icon().pixmap(sizeHint(), pixelRatio, @@ -653,7 +654,7 @@ void IconButton::paintEvent(QPaintEvent *) } } -void IconButton::animateShow(bool visible) +void FancyIconButton::animateShow(bool visible) { QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity"); animation->setDuration(FADE_TIME); @@ -661,13 +662,13 @@ void IconButton::animateShow(bool visible) animation->start(QAbstractAnimation::DeleteWhenStopped); } -QSize IconButton::sizeHint() const +QSize FancyIconButton::sizeHint() const { QWindow *window = this->window()->windowHandle(); return icon().actualSize(window, QSize(32, 16)); // Find flags icon can be wider than 16px } -void IconButton::keyPressEvent(QKeyEvent *ke) +void FancyIconButton::keyPressEvent(QKeyEvent *ke) { QAbstractButton::keyPressEvent(ke); if (!ke->modifiers() && (ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return)) @@ -676,7 +677,7 @@ void IconButton::keyPressEvent(QKeyEvent *ke) ke->accept(); } -void IconButton::keyReleaseEvent(QKeyEvent *ke) +void FancyIconButton::keyReleaseEvent(QKeyEvent *ke) { QAbstractButton::keyReleaseEvent(ke); // do not forward to line edit diff --git a/src/libs/utils/fancylineedit.h b/src/libs/utils/fancylineedit.h index c5212aa6392..1b9cf4d5e52 100644 --- a/src/libs/utils/fancylineedit.h +++ b/src/libs/utils/fancylineedit.h @@ -23,13 +23,13 @@ namespace Utils { class FancyLineEditPrivate; -class QTCREATOR_UTILS_EXPORT IconButton: public QAbstractButton +class QTCREATOR_UTILS_EXPORT FancyIconButton : public QAbstractButton { Q_OBJECT Q_PROPERTY(float iconOpacity READ iconOpacity WRITE setIconOpacity) Q_PROPERTY(bool autoHide READ hasAutoHide WRITE setAutoHide) public: - explicit IconButton(QWidget *parent = nullptr); + explicit FancyIconButton(QWidget *parent = nullptr); void paintEvent(QPaintEvent *event) override; float iconOpacity() { return m_iconOpacity; } void setIconOpacity(float value) { m_iconOpacity = value; update(); } diff --git a/src/libs/utils/iconbutton.cpp b/src/libs/utils/iconbutton.cpp new file mode 100644 index 00000000000..746cf0ecb1c --- /dev/null +++ b/src/libs/utils/iconbutton.cpp @@ -0,0 +1,62 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "iconbutton.h" + +#include "stylehelper.h" +#include "theme/theme.h" + +#include <QEnterEvent> +#include <QEvent> +#include <QPainter> + +namespace Utils { + +IconButton::IconButton(QWidget *parent) + : QAbstractButton(parent) +{ + setAttribute(Qt::WA_Hover); +} + +void IconButton::paintEvent(QPaintEvent *e) +{ + Q_UNUSED(e); + + QPainter p(this); + QRect r(QPoint(), size()); + + if (m_containsMouse && isEnabled()) { + QColor c = creatorTheme()->color(Theme::TextColorDisabled); + c.setAlphaF(c.alphaF() * .5); + StyleHelper::drawPanelBgRect(&p, r, c); + } + + icon().paint(&p, r, Qt::AlignCenter); +} + +void IconButton::enterEvent(QEnterEvent *e) +{ + m_containsMouse = true; + e->accept(); + update(); +} + +void IconButton::leaveEvent(QEvent *e) +{ + m_containsMouse = false; + e->accept(); + update(); +} + +QSize IconButton::sizeHint() const +{ + QWindow *window = this->window()->windowHandle(); + QSize s = icon().actualSize(window, QSize(32, 16)) + QSize(8, 8); + + if (StyleHelper::toolbarStyle() == StyleHelper::ToolbarStyleRelaxed) + s += QSize(5, 5); + + return s; +} + +} // namespace Utils diff --git a/src/libs/utils/iconbutton.h b/src/libs/utils/iconbutton.h new file mode 100644 index 00000000000..db615eefb11 --- /dev/null +++ b/src/libs/utils/iconbutton.h @@ -0,0 +1,27 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "utils_global.h" + +#include <QAbstractButton> + +namespace Utils { + +class QTCREATOR_UTILS_EXPORT IconButton : public QAbstractButton +{ +public: + IconButton(QWidget *parent = nullptr); + + void paintEvent(QPaintEvent *e) override; + void enterEvent(QEnterEvent *e) override; + void leaveEvent(QEvent *e) override; + + QSize sizeHint() const override; + +private: + bool m_containsMouse{false}; +}; + +} // namespace Utils diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 40a75de69e1..0c74fedc443 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -157,6 +157,8 @@ QtcLibrary { "htmldocextractor.h", "icon.cpp", "icon.h", + "iconbutton.cpp", + "iconbutton.h", "id.cpp", "id.h", "indexedcontainerproxyconstiterator.h", diff --git a/src/libs/utils/variablechooser.cpp b/src/libs/utils/variablechooser.cpp index 07348b64894..22513d4bb45 100644 --- a/src/libs/utils/variablechooser.cpp +++ b/src/libs/utils/variablechooser.cpp @@ -81,7 +81,7 @@ public: void createIconButton() { - m_iconButton = new IconButton; + m_iconButton = new FancyIconButton; m_iconButton->setIcon(Icons::REPLACE.icon()); m_iconButton->setToolTip(Tr::tr("Insert Variable")); m_iconButton->hide(); @@ -108,7 +108,7 @@ public: QPointer<QLineEdit> m_lineEdit; QPointer<QTextEdit> m_textEdit; QPointer<QPlainTextEdit> m_plainTextEdit; - QPointer<IconButton> m_iconButton; + QPointer<FancyIconButton> m_iconButton; FancyLineEdit *m_variableFilter; VariableTreeView *m_variableTree; From 7b3dbfc21f7fdf2d647f48abfb25567b229b6972 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 14 Sep 2023 14:05:32 +0200 Subject: [PATCH 1107/1777] CompilerExplorer: Fix load/save Change-Id: I2bc1bdbab73b37a5af9bc1fcd040c8ec0c7f363a Reviewed-by: hjk <hjk@qt.io> --- .../compilerexplorereditor.cpp | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index a037278876e..cc387002e01 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -109,21 +109,14 @@ Core::IDocument::OpenResult JsonSettingsDocument::open(QString *errorString, return OpenResult::ReadError; } - QJsonParseError error; - QJsonDocument doc = QJsonDocument::fromJson(*contents, &error); - if (error.error != QJsonParseError::NoError) { + auto result = storeFromJson(*contents); + if (!result) { if (errorString) - *errorString = error.errorString(); - return OpenResult::CannotHandle; + *errorString = result.error(); + return OpenResult::ReadError; } - if (!doc.isObject()) { - if (errorString) - *errorString = Tr::tr("Not a valid JSON object."); - return OpenResult::CannotHandle; - } - - m_ceSettings.fromMap(storeFromVariant(doc.toVariant().toMap())); + m_ceSettings.fromMap(*result); emit settingsChanged(); return OpenResult::Success; } @@ -147,14 +140,12 @@ bool JsonSettingsDocument::saveImpl(QString *errorString, m_ceSettings.toMap(map); } - QJsonDocument doc = QJsonDocument::fromVariant(variantFromStore(map)); - Utils::FilePath path = newFilePath.isEmpty() ? filePath() : newFilePath; if (!newFilePath.isEmpty() && !autoSave) setFilePath(newFilePath); - auto result = path.writeFileContents(doc.toJson(QJsonDocument::Indented)); + auto result = path.writeFileContents(jsonFromStore(map)); if (!result && errorString) { *errorString = result.error(); return false; @@ -170,13 +161,10 @@ bool JsonSettingsDocument::isModified() const bool JsonSettingsDocument::setContents(const QByteArray &contents) { - QJsonParseError error; - QJsonDocument doc = QJsonDocument::fromJson(contents, &error); - QTC_ASSERT(error.error == QJsonParseError::NoError, return false); + auto result = storeFromJson(contents); + QTC_ASSERT_EXPECTED(result, return false); - QTC_ASSERT(doc.isObject(), return false); - - m_ceSettings.fromMap(storeFromVariant(doc.toVariant())); + m_ceSettings.fromMap(*result); emit settingsChanged(); return true; From 7de9667a7fd50bd4e2b94f4fae1dd72be5507104 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 15 Sep 2023 08:26:27 +0200 Subject: [PATCH 1108/1777] Themes: Update DS* roles for all non-QDS themes Update non-QDS "dark" themes with DS* values from "design". Update non-QDS "light" themes with DS* values from "design-light". Change-Id: I7561d5f9e5ad22cd791b5d9772a3ad2f7c2bb399 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- share/qtcreator/themes/dark.creatortheme | 111 +++++++---- share/qtcreator/themes/default.creatortheme | 43 ++++- share/qtcreator/themes/flat-dark.creatortheme | 110 +++++++---- .../qtcreator/themes/flat-light.creatortheme | 42 ++++- share/qtcreator/themes/flat.creatortheme | 173 ++++++++++-------- 5 files changed, 309 insertions(+), 170 deletions(-) diff --git a/share/qtcreator/themes/dark.creatortheme b/share/qtcreator/themes/dark.creatortheme index a214688bf90..30e4aa36b5b 100644 --- a/share/qtcreator/themes/dark.creatortheme +++ b/share/qtcreator/themes/dark.creatortheme @@ -27,6 +27,7 @@ fullWhite=ffffffff lightWhite=ffdfdfdf offWhite=ffdcdada slateGrey=ff8d8d8d +concreteGrey=ffbbbbbb smokeGrey=ff8b8b8b shadowGrey=ff636363 duskGrey=ff606060 @@ -54,8 +55,10 @@ highlightHover=ff74CBFC ;DS Theme Palette END [Colors] -;DS controls theme START -;NEW FOR QtDS 4.0 +;DS controls theme + +;NEW FOR QtDS 4 +;4.0 DScontrolBackground_toolbarIdle=midnightGrey DScontrolBackground_toolbarHover=midnightGrey DScontrolBackground_topToolbarHover=ashGrey @@ -75,37 +78,89 @@ DSstateBackgroundColor_hover=ashGrey DSstateControlBackgroundColor_globalHover=ashGrey DSstateControlBackgroundColor_hover=raincloudGrey DSpanelBackground=dawnGrey -;END NEW FOR QtDS 4.0 -DSpanelBackground=dawnGrey +;4.3 +DSpopoutBackground=offBlack +DSpopoutControlBackground_idle=offBlack +DSpopoutControlBackground_hover=dawnGrey +DSpopoutControlBackground_globalHover=dawnGrey +DSpopoutControlBackground_interaction=highlightBlue +DSpopoutControlBackground_disabled=offBlack +DSpopoutPopupBackground=nearBlack +DSpopoutControlBorder_idle=nearBlack +DSpopoutControlBorder_hover=midnightGrey +DSpopoutControlBorder_interaction=highlightBlue +DSpopoutControlBorder_disabled=offBlack + +DSpopoutButtonBackground_idle=offBlack +DSpopoutButtonBackground_hover=dawnGrey +DSpopoutButtonBackground_interaction=highlightBlue +DSpopoutButtonBackground_disabled=offBlack + +DSpopoutButtonBorder_idle=slateGrey +DSpopoutButtonBorder_hover=lightWhite +DSpopoutButtonBorder_interaction=highlightBlue +DSpopoutButtonBorder_disabled=offBlack + +;END NEW FOR QtDS 4 + +;REMAPPED +DSinteraction=highlightBlue +DScontrolBackground=dawnGrey +DScontrolOutlineInteraction=highlightBlue +DScontrolOutline=nearBlack +DSiconColorInteraction=nearBlack +DSiconColorSelected=nearBlack +DSsectionHeadBackground=midnightGrey +DSstateSeparatorColor=graniteGrey +DSnavigatorItemBackground=dawnGrey +DSnavigatorItemBackgroundHover=graniteGrey +DSnavigatorItemBackgroundSelected=midnightGrey +DStabActiveBackground=raincloudGrey +DStabActiveText=offWhite +DStabActiveIcon=offWhite +DStabFocusButtonHover=highlightBlue +DStabFocusButtonPress=highlightBlue +DStabFocusBackground=highlightBlue +DSnavigatorText=lightWhite +DSpopupBackground=offBlack +DSinteractionHover=highlightHover +DSnavigatorTextSelected=highlightBlue + +;contentious remap +;background color for main form view, library, navigator, properties, connections +QmlDesigner_BackgroundColorDarkAlternate=dawnGrey + +;TODO +DSscrollBarTrack=smokeGrey +DSscrollBarHandle=concreteGrey +DSscrollBarHandle_idle=slateGrey + +DSdockWidgetTitleBar=dawnGrey +DSdockWidgetSplitter=fullBlack + +;LEGACY DSwelcomeScreenBackground=ff242424 DSsubPanelBackground=ff1c1c1c DSthumbnailBackground=ff232323 DSthumbnailLabelBackground=ff2b2a2a - DSgreenLight=ff5cdc68 DSamberLight=ffffbf00 DSredLight=ffff0401 -DSinteraction=highlightBlue DSerrorColor=ffdf3a3a DSwarningColor=warning DSdisabledColor=ff707070 -DSinteractionHover=ff74cbfc -DScontrolBackground=dawnGrey DScontrolBackgroundInteraction=ff3d3d3d DScontrolBackgroundDisabled=ff2e2f30 DScontrolBackgroundGlobalHover=ff333333 DScontrolBackgroundHover=ff333333 -DScontrolOutline=nearBlack -DScontrolOutlineInteraction=highlightBlue DScontrolOutlineDisabled=ff707070 -DStextColor=ffffffff DStextColorDisabled=ff707070 DStextSelectionColor=ff2aafd3 DStextSelectedTextColor=ff000000 @@ -113,18 +168,16 @@ DStextSelectedTextColor=ff000000 DSplaceholderTextColor=ffffffff DSplaceholderTextColorInteraction=ffababab -DSiconColor=ffffffff +DSiconColor=fullWhite DSiconColorHover=ffffffff -DSiconColorInteraction=nearBlack DSiconColorDisabled=ffC7C7C7 -DSiconColorSelected=nearBlack - +DSiconColorSelected=ff2aafd3 DSlinkIndicatorColor=ff808080 DSlinkIndicatorColorHover=ffffffff DSlinkIndicatorColorInteraction=ff2aafd3 DSlinkIndicatorColorDisabled=ff707070 -DSpopupBackground=offBlack + DSpopupOverlayColor=99191919 DSsliderActiveTrack=ff7c7b7b @@ -138,14 +191,8 @@ DSsliderHandleHover=ff606060 DSsliderHandleFocus=ff0492c9 DSsliderHandleInteraction=ff2aafd3 -DSscrollBarTrack=dawnGrey -DSscrollBarHandle=offBlack - -DSsectionHeadBackground=midnightGrey - DSstateDefaultHighlight=ffffe400 -DSstateSeparatorColor=graniteGrey -DSstateBackgroundColor=ff383838 +DSstateBackgroundColor=fffff000 DSstatePreviewOutline=ffaaaaaa DSstatePanelBackground=ff252525 @@ -168,11 +215,7 @@ DStableHeaderText=ff00ff00 DSdockContainerBackground=ff242424 DSdockContainerSplitter=ff323232 DSdockAreaBackground=ff262728 - DSdockWidgetBackground=ff00ff00 -DSdockWidgetSplitter=fullBlack -DSdockWidgetTitleBar=dawnGrey - DStitleBarText=ffdadada DStitleBarIcon=ffffffff DStitleBarButtonHover=40ffffff @@ -187,26 +230,16 @@ DStabInactiveIcon=ffffffff DStabInactiveButtonHover=ff1f1f1f DStabInactiveButtonPress=ff1f1f1f -DStabActiveBackground=raincloudGrey -DStabActiveText=offWhite -DStabActiveIcon=offWhite DStabActiveButtonHover=ffdadada DStabActiveButtonPress=ffdadada -DStabFocusBackground=highlightBlue DStabFocusText=ff111111 DStabFocusIcon=ff000000 -DStabFocusButtonHover=highlightBlue -DStabFocusButtonPress=highlightBlue DSnavigatorBranch=ff7c7b7b DSnavigatorBranchIndicator=ff7c7b7b -DSnavigatorItemBackground=dawnGrey -DSnavigatorItemBackgroundHover=graniteGrey -DSnavigatorItemBackgroundSelected=midnightGrey -DSnavigatorText=lightWhite DSnavigatorTextHover=ffffffff -DSnavigatorTextSelected=ff2aafd3 + DSnavigatorIcon=ffffffff DSnavigatorIconHover=ffa1a1a1 DSnavigatorIconSelected=ffffffff @@ -226,8 +259,6 @@ DSUnimportedModuleColor=ffe33c2e DSBackgroundColorAlternate=alternateBackground DSBackgroundColorNormal=normalBackground -DStoolbarBackground=midnightGrey - ;DS controls theme END BackgroundColorAlternate=alternateBackground diff --git a/share/qtcreator/themes/default.creatortheme b/share/qtcreator/themes/default.creatortheme index a7095266a8b..24a0f09fc82 100644 --- a/share/qtcreator/themes/default.creatortheme +++ b/share/qtcreator/themes/default.creatortheme @@ -48,7 +48,8 @@ highlightHover=ff74CBFC [Colors] ;DS controls theme START -;NEW FOR QtDS 4.0 +;NEW FOR QtDS 4 +;4.0 DScontrolBackground_toolbarIdle=offWhite DScontrolBackground_toolbarHover=offWhite DScontrolBackground_topToolbarHover=concreteGrey @@ -68,7 +69,32 @@ DSstateBackgroundColor_hover=concreteGrey DSstateControlBackgroundColor_globalHover=concreteGrey DSstateControlBackgroundColor_hover=smokeGrey DSpanelBackground=dawnGrey -;END NEW FOR QtDS 4.0 + +;4.3 +DSpopoutBackground=offWhite +DSpopoutControlBackground_idle=offWhite +DSpopoutControlBackground_hover=lightWhite +DSpopoutControlBackground_globalHover=lightWhite +DSpopoutControlBackground_interaction=highlightBlue +DSpopoutControlBackground_disabled=offWhite +DSpopoutPopupBackground=lightWhite + +DSpopoutControlBorder_idle=slateGrey +DSpopoutControlBorder_hover=concreteGrey +DSpopoutControlBorder_interaction=highlightBlue +DSpopoutControlBorder_disabled=offWhite + +DSpopoutButtonBackground_idle=offWhite +DSpopoutButtonBackground_hover=lightWhite +DSpopoutButtonBackground_interaction=highlightBlue +DSpopoutButtonBackground_disabled=offWhite + +DSpopoutButtonBorder_idle=smokeGrey +DSpopoutButtonBorder_hover=shadowGrey +DSpopoutButtonBorder_interaction=highlightBlue +DSpopoutButtonBorder_disabled=offWhite + +;END NEW FOR QtDS 4 DSpanelBackground=ffeaeaea @@ -81,12 +107,12 @@ DSgreenLight=ff5cdc68 DSamberLight=ffffbf00 DSredLight=ffff0401 -DSinteraction=ff2aafd3 +DSinteraction=highlightBlue DSerrorColor=ffdf3a3a DSwarningColor=warning DSdisabledColor=ff8e8e8e -DSinteractionHover=ff74cbfc +DSinteractionHover=highlightHover DScontrolBackground=ffeaeaea DScontrolBackgroundInteraction=ffc9c9c9 @@ -98,7 +124,6 @@ DScontrolOutline=ffcecccc DScontrolOutlineInteraction=ff2aafd3 DScontrolOutlineDisabled=ff707070 -DStextColor=ff262626 DStextColorDisabled=ff707070 DStextSelectionColor=ff2aafd3 DStextSelectedTextColor=ff000000 @@ -131,8 +156,9 @@ DSsliderHandleHover=ff606060 DSsliderHandleFocus=ff0492c9 DSsliderHandleInteraction=ff2aafd3 -DSscrollBarTrack=ffb5b4b4 -DSscrollBarHandle=ff9b9b9b +DSscrollBarTrack=smokeGrey +DSscrollBarHandle=shadowGrey +DSscrollBarHandle_idle=slateGrey DSsectionHeadBackground=ffd8d8d8 @@ -142,7 +168,7 @@ DSstateBackgroundColor=ffe0e0e0 DSstatePreviewOutline=ff363636 DSstatePanelBackground=ffdadada -DSstateHighlight=offWhite +DSstateHighlight=ff8d8d8d DSchangedStateText=ff99ccff @@ -219,7 +245,6 @@ DSUnimportedModuleColor=ffe33c2e DSBackgroundColorAlternate=ffeaeaea DSBackgroundColorNormal=ffd8d8d8 - ;DS controls theme END BackgroundColorAlternate=ff3d3d3d diff --git a/share/qtcreator/themes/flat-dark.creatortheme b/share/qtcreator/themes/flat-dark.creatortheme index bb6b905288c..09a2d528c01 100644 --- a/share/qtcreator/themes/flat-dark.creatortheme +++ b/share/qtcreator/themes/flat-dark.creatortheme @@ -31,6 +31,7 @@ fullWhite=ffffffff lightWhite=ffdfdfdf offWhite=ffdcdada slateGrey=ff8d8d8d +concreteGrey=ffbbbbbb smokeGrey=ff8b8b8b shadowGrey=ff636363 duskGrey=ff606060 @@ -58,9 +59,10 @@ highlightHover=ff74CBFC ;DS Theme Palette END [Colors] -;DS controls theme START +;DS controls theme -;NEW FOR QtDS 4.0 +;NEW FOR QtDS 4 +;4.0 DScontrolBackground_toolbarIdle=midnightGrey DScontrolBackground_toolbarHover=midnightGrey DScontrolBackground_topToolbarHover=ashGrey @@ -80,35 +82,89 @@ DSstateBackgroundColor_hover=ashGrey DSstateControlBackgroundColor_globalHover=ashGrey DSstateControlBackgroundColor_hover=raincloudGrey DSpanelBackground=dawnGrey -;END NEW FOR QtDS 4.0 +;4.3 +DSpopoutBackground=offBlack +DSpopoutControlBackground_idle=offBlack +DSpopoutControlBackground_hover=dawnGrey +DSpopoutControlBackground_globalHover=dawnGrey +DSpopoutControlBackground_interaction=highlightBlue +DSpopoutControlBackground_disabled=offBlack +DSpopoutPopupBackground=nearBlack + +DSpopoutControlBorder_idle=nearBlack +DSpopoutControlBorder_hover=midnightGrey +DSpopoutControlBorder_interaction=highlightBlue +DSpopoutControlBorder_disabled=offBlack + +DSpopoutButtonBackground_idle=offBlack +DSpopoutButtonBackground_hover=dawnGrey +DSpopoutButtonBackground_interaction=highlightBlue +DSpopoutButtonBackground_disabled=offBlack + +DSpopoutButtonBorder_idle=slateGrey +DSpopoutButtonBorder_hover=lightWhite +DSpopoutButtonBorder_interaction=highlightBlue +DSpopoutButtonBorder_disabled=offBlack + +;END NEW FOR QtDS 4 + +;REMAPPED +DSinteraction=highlightBlue +DScontrolBackground=dawnGrey +DScontrolOutlineInteraction=highlightBlue +DScontrolOutline=nearBlack +DSiconColorInteraction=nearBlack +DSiconColorSelected=nearBlack +DSsectionHeadBackground=midnightGrey +DSstateSeparatorColor=graniteGrey +DSnavigatorItemBackground=dawnGrey +DSnavigatorItemBackgroundHover=graniteGrey +DSnavigatorItemBackgroundSelected=midnightGrey +DStabActiveBackground=raincloudGrey +DStabActiveText=offWhite +DStabActiveIcon=offWhite +DStabFocusButtonHover=highlightBlue +DStabFocusButtonPress=highlightBlue +DStabFocusBackground=highlightBlue +DSnavigatorText=lightWhite +DSpopupBackground=offBlack +DSinteractionHover=highlightHover +DSnavigatorTextSelected=highlightBlue + +;contentious remap +;background color for main form view, library, navigator, properties, connections +QmlDesigner_BackgroundColorDarkAlternate=dawnGrey + +;TODO +DSscrollBarTrack=smokeGrey +DSscrollBarHandle=concreteGrey +DSscrollBarHandle_idle=slateGrey + +DSdockWidgetTitleBar=dawnGrey +DSdockWidgetSplitter=fullBlack + +;LEGACY DSwelcomeScreenBackground=ff242424 DSsubPanelBackground=ff1c1c1c DSthumbnailBackground=ff232323 DSthumbnailLabelBackground=ff2b2a2a - DSgreenLight=ff5cdc68 DSamberLight=ffffbf00 DSredLight=ffff0401 -DSinteraction=highlightBlue DSerrorColor=ffdf3a3a DSwarningColor=warning DSdisabledColor=ff707070 -DSinteractionHover=ff74cbfc -DScontrolBackground=dawnGrey DScontrolBackgroundInteraction=ff3d3d3d DScontrolBackgroundDisabled=ff2e2f30 DScontrolBackgroundGlobalHover=ff333333 DScontrolBackgroundHover=ff333333 -DScontrolOutline=nearBlack -DScontrolOutlineInteraction=highlightBlue DScontrolOutlineDisabled=ff707070 -DStextColor=ffffffff DStextColorDisabled=ff707070 DStextSelectionColor=ff2aafd3 DStextSelectedTextColor=ff000000 @@ -116,18 +172,16 @@ DStextSelectedTextColor=ff000000 DSplaceholderTextColor=ffffffff DSplaceholderTextColorInteraction=ffababab -DSiconColor=ffffffff +DSiconColor=fullWhite DSiconColorHover=ffffffff -DSiconColorInteraction=nearBlack DSiconColorDisabled=ffC7C7C7 -DSiconColorSelected=nearBlack - +DSiconColorSelected=ff2aafd3 DSlinkIndicatorColor=ff808080 DSlinkIndicatorColorHover=ffffffff DSlinkIndicatorColorInteraction=ff2aafd3 DSlinkIndicatorColorDisabled=ff707070 -DSpopupBackground=offBlack + DSpopupOverlayColor=99191919 DSsliderActiveTrack=ff7c7b7b @@ -141,14 +195,8 @@ DSsliderHandleHover=ff606060 DSsliderHandleFocus=ff0492c9 DSsliderHandleInteraction=ff2aafd3 -DSscrollBarTrack=dawnGrey -DSscrollBarHandle=offBlack - -DSsectionHeadBackground=midnightGrey - DSstateDefaultHighlight=ffffe400 -DSstateSeparatorColor=graniteGrey -DSstateBackgroundColor=ff383838 +DSstateBackgroundColor=fffff000 DSstatePreviewOutline=ffaaaaaa DSstatePanelBackground=ff252525 @@ -171,11 +219,7 @@ DStableHeaderText=ff00ff00 DSdockContainerBackground=ff242424 DSdockContainerSplitter=ff323232 DSdockAreaBackground=ff262728 - DSdockWidgetBackground=ff00ff00 -DSdockWidgetSplitter=fullBlack -DSdockWidgetTitleBar=dawnGrey - DStitleBarText=ffdadada DStitleBarIcon=ffffffff DStitleBarButtonHover=40ffffff @@ -190,26 +234,16 @@ DStabInactiveIcon=ffffffff DStabInactiveButtonHover=ff1f1f1f DStabInactiveButtonPress=ff1f1f1f -DStabActiveBackground=raincloudGrey -DStabActiveText=offWhite -DStabActiveIcon=offWhite DStabActiveButtonHover=ffdadada DStabActiveButtonPress=ffdadada -DStabFocusBackground=highlightBlue DStabFocusText=ff111111 DStabFocusIcon=ff000000 -DStabFocusButtonHover=highlightBlue -DStabFocusButtonPress=highlightBlue DSnavigatorBranch=ff7c7b7b DSnavigatorBranchIndicator=ff7c7b7b -DSnavigatorItemBackground=dawnGrey -DSnavigatorItemBackgroundHover=graniteGrey -DSnavigatorItemBackgroundSelected=midnightGrey -DSnavigatorText=lightWhite DSnavigatorTextHover=ffffffff -DSnavigatorTextSelected=ff2aafd3 + DSnavigatorIcon=ffffffff DSnavigatorIconHover=ffa1a1a1 DSnavigatorIconSelected=ffffffff @@ -229,8 +263,6 @@ DSUnimportedModuleColor=ffe33c2e DSBackgroundColorAlternate=alternateBackground DSBackgroundColorNormal=normalBackground -DStoolbarBackground=midnightGrey - ;DS controls theme END BackgroundColorAlternate=alternateBackground diff --git a/share/qtcreator/themes/flat-light.creatortheme b/share/qtcreator/themes/flat-light.creatortheme index cbf4b09ce17..64cb37a1a37 100644 --- a/share/qtcreator/themes/flat-light.creatortheme +++ b/share/qtcreator/themes/flat-light.creatortheme @@ -57,7 +57,8 @@ highlightHover=ff74CBFC [Colors] ;DS controls theme START -;NEW FOR QtDS 4.0 +;NEW FOR QtDS 4 +;4.0 DScontrolBackground_toolbarIdle=offWhite DScontrolBackground_toolbarHover=offWhite DScontrolBackground_topToolbarHover=concreteGrey @@ -77,7 +78,32 @@ DSstateBackgroundColor_hover=concreteGrey DSstateControlBackgroundColor_globalHover=concreteGrey DSstateControlBackgroundColor_hover=smokeGrey DSpanelBackground=dawnGrey -;END NEW FOR QtDS 4.0 + +;4.3 +DSpopoutBackground=offWhite +DSpopoutControlBackground_idle=offWhite +DSpopoutControlBackground_hover=lightWhite +DSpopoutControlBackground_globalHover=lightWhite +DSpopoutControlBackground_interaction=highlightBlue +DSpopoutControlBackground_disabled=offWhite +DSpopoutPopupBackground=lightWhite + +DSpopoutControlBorder_idle=slateGrey +DSpopoutControlBorder_hover=concreteGrey +DSpopoutControlBorder_interaction=highlightBlue +DSpopoutControlBorder_disabled=offWhite + +DSpopoutButtonBackground_idle=offWhite +DSpopoutButtonBackground_hover=lightWhite +DSpopoutButtonBackground_interaction=highlightBlue +DSpopoutButtonBackground_disabled=offWhite + +DSpopoutButtonBorder_idle=smokeGrey +DSpopoutButtonBorder_hover=shadowGrey +DSpopoutButtonBorder_interaction=highlightBlue +DSpopoutButtonBorder_disabled=offWhite + +;END NEW FOR QtDS 4 DSpanelBackground=ffeaeaea @@ -90,12 +116,12 @@ DSgreenLight=ff5cdc68 DSamberLight=ffffbf00 DSredLight=ffff0401 -DSinteraction=ff2aafd3 +DSinteraction=highlightBlue DSerrorColor=ffdf3a3a DSwarningColor=warning DSdisabledColor=ff8e8e8e -DSinteractionHover=ff74cbfc +DSinteractionHover=highlightHover DScontrolBackground=ffeaeaea DScontrolBackgroundInteraction=ffc9c9c9 @@ -107,7 +133,6 @@ DScontrolOutline=ffcecccc DScontrolOutlineInteraction=ff2aafd3 DScontrolOutlineDisabled=ff707070 -DStextColor=ff262626 DStextColorDisabled=ff707070 DStextSelectionColor=ff2aafd3 DStextSelectedTextColor=ff000000 @@ -140,8 +165,9 @@ DSsliderHandleHover=ff606060 DSsliderHandleFocus=ff0492c9 DSsliderHandleInteraction=ff2aafd3 -DSscrollBarTrack=ffb5b4b4 -DSscrollBarHandle=ff9b9b9b +DSscrollBarTrack=smokeGrey +DSscrollBarHandle=shadowGrey +DSscrollBarHandle_idle=slateGrey DSsectionHeadBackground=ffd8d8d8 @@ -228,8 +254,6 @@ DSUnimportedModuleColor=ffe33c2e DSBackgroundColorAlternate=ffeaeaea DSBackgroundColorNormal=ffd8d8d8 -DStoolbarBackground=offWhite - ;DS controls theme END BackgroundColorAlternate=alternateBackground diff --git a/share/qtcreator/themes/flat.creatortheme b/share/qtcreator/themes/flat.creatortheme index a252562a56f..4ca0d2d1f45 100644 --- a/share/qtcreator/themes/flat.creatortheme +++ b/share/qtcreator/themes/flat.creatortheme @@ -25,6 +25,7 @@ fullWhite=ffffffff lightWhite=ffdfdfdf offWhite=ffdcdada slateGrey=ff8d8d8d +concreteGrey=ffbbbbbb smokeGrey=ff8b8b8b shadowGrey=ff636363 duskGrey=ff606060 @@ -54,32 +55,60 @@ highlightHover=ff74CBFC [Colors] ;DS controls theme START -;NEW FOR QtDS 4.0 -DScontrolBackground_toolbarIdle=midnightGrey -DScontrolBackground_toolbarHover=midnightGrey -DScontrolBackground_topToolbarHover=ashGrey -DScontrolBackground_statusbarIdle=offBlack -DSControlBackground_statusbarHover=dawnGrey -DScontrolOutline_topToolbarIdle=dawnGrey -DScontrolOutline_topToolbarHover=raincloudGrey +;NEW FOR QtDS 4 +;4.0 +DScontrolBackground_toolbarIdle=offWhite +DScontrolBackground_toolbarHover=offWhite +DScontrolBackground_topToolbarHover=concreteGrey +DScontrolBackground_statusbarIdle=concreteGrey +DSControlBackground_statusbarHover=lightWhite +DScontrolOutline_topToolbarIdle=concreteGrey +DScontrolOutline_topToolbarHover=lightWhite DSidleGreen=idleGreen DSrunningGreen=runningGreen -DStoolbarBackground=midnightGrey +DStoolbarBackground=offWhite DStoolbarIcon_blocked=shadowGrey -DSthumbnailBackground_baseState=nearBlack -DStextColor=lightWhite -DSstatusbarBackground=offBlack +DSthumbnailBackground_baseState=smokeGrey +DStextColor=raincloudGrey +DSstatusbarBackground=concreteGrey DSprimaryButton_hoverHighlight=highlightHover -DSstateBackgroundColor_hover=ashGrey -DSstateControlBackgroundColor_globalHover=ashGrey -DSstateControlBackgroundColor_hover=raincloudGrey +DSstateBackgroundColor_hover=concreteGrey +DSstateControlBackgroundColor_globalHover=concreteGrey +DSstateControlBackgroundColor_hover=smokeGrey DSpanelBackground=dawnGrey -;END NEW FOR QtDS 4.0 -DSwelcomeScreenBackground=ff242424 -DSsubPanelBackground=ff1c1c1c -DSthumbnailBackground=ff232323 -DSthumbnailLabelBackground=ff2b2a2a +;4.3 +DSpopoutBackground=offWhite +DSpopoutControlBackground_idle=offWhite +DSpopoutControlBackground_hover=lightWhite +DSpopoutControlBackground_globalHover=lightWhite +DSpopoutControlBackground_interaction=highlightBlue +DSpopoutControlBackground_disabled=offWhite +DSpopoutPopupBackground=lightWhite + +DSpopoutControlBorder_idle=slateGrey +DSpopoutControlBorder_hover=concreteGrey +DSpopoutControlBorder_interaction=highlightBlue +DSpopoutControlBorder_disabled=offWhite + +DSpopoutButtonBackground_idle=offWhite +DSpopoutButtonBackground_hover=lightWhite +DSpopoutButtonBackground_interaction=highlightBlue +DSpopoutButtonBackground_disabled=offWhite + +DSpopoutButtonBorder_idle=smokeGrey +DSpopoutButtonBorder_hover=shadowGrey +DSpopoutButtonBorder_interaction=highlightBlue +DSpopoutButtonBorder_disabled=offWhite + +;END NEW FOR QtDS 4 + +DSpanelBackground=ffeaeaea + +DSwelcomeScreenBackground=ffEAEAEA +DSsubPanelBackground=ffEFEFEF +DSthumbnailBackground=ffE8E8E8 +DSthumbnailLabelBackground=ffDDDDDD DSgreenLight=ff5cdc68 DSamberLight=ffffbf00 @@ -88,46 +117,45 @@ DSredLight=ffff0401 DSinteraction=highlightBlue DSerrorColor=ffdf3a3a DSwarningColor=warning -DSdisabledColor=ff707070 +DSdisabledColor=ff8e8e8e -DSinteractionHover=ff74cbfc +DSinteractionHover=highlightHover -DScontrolBackground=dawnGrey -DScontrolBackgroundInteraction=ff3d3d3d -DScontrolBackgroundDisabled=ff2e2f30 -DScontrolBackgroundGlobalHover=ff333333 -DScontrolBackgroundHover=ff333333 +DScontrolBackground=ffeaeaea +DScontrolBackgroundInteraction=ffc9c9c9 +DScontrolBackgroundDisabled=ffeaeaea +DScontrolBackgroundGlobalHover=ffdedddd +DScontrolBackgroundHover=ffdedddd -DScontrolOutline=nearBlack -DScontrolOutlineInteraction=highlightBlue +DScontrolOutline=ffcecccc +DScontrolOutlineInteraction=ff2aafd3 DScontrolOutlineDisabled=ff707070 -DStextColor=ffffffff DStextColorDisabled=ff707070 DStextSelectionColor=ff2aafd3 DStextSelectedTextColor=ff000000 -DSplaceholderTextColor=ffffffff +DSplaceholderTextColor=ff262626 DSplaceholderTextColorInteraction=ffababab -DSiconColor=ffffffff -DSiconColorHover=ffffffff -DSiconColorInteraction=nearBlack -DSiconColorDisabled=ffC7C7C7 -DSiconColorSelected=nearBlack +DSiconColor=ff262626 +DSiconColorHover=ff191919 +DSiconColorInteraction=ffffffff +DSiconColorDisabled=ff707070 +DSiconColorSelected=ff2aafd3 DSlinkIndicatorColor=ff808080 -DSlinkIndicatorColorHover=ffffffff +DSlinkIndicatorColorHover=ff1f1f1f DSlinkIndicatorColorInteraction=ff2aafd3 DSlinkIndicatorColorDisabled=ff707070 -DSpopupBackground=offBlack +DSpopupBackground=ffd3d3d3 DSpopupOverlayColor=99191919 DSsliderActiveTrack=ff7c7b7b DSsliderActiveTrackHover=ff000000 DSsliderActiveTrackFocus=ffaaaaaa -DSsliderInactiveTrack=ff595959 +DSsliderInactiveTrack=ffaaaaaa DSsliderInactiveTrackHover=ff505050 DSsliderInactiveTrackFocus=ff606060 DSsliderHandle=ff1f1f1f @@ -135,18 +163,19 @@ DSsliderHandleHover=ff606060 DSsliderHandleFocus=ff0492c9 DSsliderHandleInteraction=ff2aafd3 -DSscrollBarTrack=dawnGrey -DSscrollBarHandle=offBlack +DSscrollBarTrack=smokeGrey +DSscrollBarHandle=shadowGrey +DSscrollBarHandle_idle=slateGrey -DSsectionHeadBackground=midnightGrey +DSsectionHeadBackground=ffd8d8d8 DSstateDefaultHighlight=ffffe400 -DSstateSeparatorColor=graniteGrey -DSstateBackgroundColor=ff383838 -DSstatePreviewOutline=ffaaaaaa +DSstateSeparatorColor=ffadadad +DSstateBackgroundColor=ffe0e0e0 +DSstatePreviewOutline=ff363636 -DSstatePanelBackground=ff252525 -DSstateHighlight=ff727272 +DSstatePanelBackground=ffdadada +DSstateHighlight=ff8d8d8d DSchangedStateText=ff99ccff @@ -162,56 +191,56 @@ DSactionJIT=ff2db543 DStableHeaderBackground=ffff0000 DStableHeaderText=ff00ff00 -DSdockContainerBackground=ff242424 +DSdockContainerBackground=ff323232 DSdockContainerSplitter=ff323232 DSdockAreaBackground=ff262728 DSdockWidgetBackground=ff00ff00 -DSdockWidgetSplitter=fullBlack -DSdockWidgetTitleBar=dawnGrey +DSdockWidgetSplitter=ff595959 +DSdockWidgetTitleBar=ffeaeaea DStitleBarText=ffdadada -DStitleBarIcon=ffffffff +DStitleBarIcon=ff4f5052 DStitleBarButtonHover=40ffffff DStitleBarButtonPress=60ffffff -DStabContainerBackground=ff1f1f1f +DStabContainerBackground=ffdadada DStabSplitter=ff595959 -DStabInactiveBackground=ff1f1f1f -DStabInactiveText=ffdadada +DStabInactiveBackground=ff999999 +DStabInactiveText=ff262626 DStabInactiveIcon=ffffffff DStabInactiveButtonHover=ff1f1f1f DStabInactiveButtonPress=ff1f1f1f -DStabActiveBackground=raincloudGrey -DStabActiveText=offWhite -DStabActiveIcon=offWhite +DStabActiveBackground=ffdadada +DStabActiveText=ff111111 +DStabActiveIcon=ff000000 DStabActiveButtonHover=ffdadada DStabActiveButtonPress=ffdadada -DStabFocusBackground=highlightBlue +DStabFocusBackground=ff2aafd3 DStabFocusText=ff111111 DStabFocusIcon=ff000000 -DStabFocusButtonHover=highlightBlue -DStabFocusButtonPress=highlightBlue +DStabFocusButtonHover=ff2aafd3 +DStabFocusButtonPress=ff2aafd3 DSnavigatorBranch=ff7c7b7b DSnavigatorBranchIndicator=ff7c7b7b -DSnavigatorItemBackground=dawnGrey -DSnavigatorItemBackgroundHover=graniteGrey -DSnavigatorItemBackgroundSelected=midnightGrey -DSnavigatorText=lightWhite -DSnavigatorTextHover=ffffffff +DSnavigatorItemBackground=ffeaeaea +DSnavigatorItemBackgroundHover=ffdedddd +DSnavigatorItemBackgroundSelected=ffffffff +DSnavigatorText=ff262626 +DSnavigatorTextHover=ff1f1f1f DSnavigatorTextSelected=ff2aafd3 -DSnavigatorIcon=ffffffff -DSnavigatorIconHover=ffa1a1a1 -DSnavigatorIconSelected=ffffffff +DSnavigatorIcon=ff1f1f1f +DSnavigatorIconHover=ff7c7b7b +DSnavigatorIconSelected=ff1f1f1f DSnavigatorAliasIconChecked=ffff0000 DSnavigatorDropIndicatorBackground=ff2aafd3 DSnavigatorDropIndicatorOutline=ff2aafd3 -DSheaderViewBackground=ff1f1f1f +DSheaderViewBackground=ffd8d8d8 DStableViewAlternateBackground=ff00ff00 DStoolTipBackground=ff111111 @@ -220,10 +249,8 @@ DStoolTipText=ffdadada DSUnimportedModuleColor=ffe33c2e -DSBackgroundColorAlternate=alternateBackground -DSBackgroundColorNormal=normalBackground - -DStoolbarBackground=midnightGrey +DSBackgroundColorAlternate=ffeaeaea +DSBackgroundColorNormal=ffd8d8d8 ;DS controls theme END From 601ab522a2ea7de359017c3871c145fdc64f6e74 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 14 Sep 2023 18:53:53 +0200 Subject: [PATCH 1109/1777] ScreenRecorder: Show a ComboBox with display names instead of a SpinBox This turns the IntegerAspect into a SelectionAspect. Easy. Change-Id: I421765e6c6c81759f31e3c8e3781170c1fd1fbc5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> --- src/plugins/screenrecorder/record.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index 11c1e7a3176..d17dfb83058 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -68,18 +68,31 @@ private: static const int m_factor = 4; CropScene *m_cropScene; QImage m_thumbnail; - IntegerAspect m_screenId; + SelectionAspect m_screenId; IntegerAspect m_recordFrameRate; QLabel *m_cropRectLabel; QToolButton *m_resetButton; }; +static QString optionNameForScreen(const QScreen *screen) +{ + const QSize pixelSize = screen->size() * screen->devicePixelRatio(); + QStringList nameElements = { screen->name(), screen->manufacturer(), screen->model() }; + nameElements.removeDuplicates(); // Model and name might be the same on some system + const QString displayName = QLatin1String("%1 - %2x%3").arg(nameElements.join(" ")) + .arg(pixelSize.width()).arg(pixelSize.height()); + return displayName; +} + RecordOptionsDialog::RecordOptionsDialog(QWidget *parent) : QDialog(parent) { setWindowTitle(Tr::tr("Screen Recording Options")); - m_screenId.setRange(0, QGuiApplication::screens().count() - 1); + m_screenId.setLabelText(Tr::tr("Display:")); + m_screenId.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + for (const QScreen *screen : QGuiApplication::screens()) + m_screenId.addOption(optionNameForScreen(screen)); m_cropScene = new CropScene; From d46cd711d3c90cc71498c1ad33861151aed77554 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 14 Sep 2023 16:34:20 +0200 Subject: [PATCH 1110/1777] Update perfparser submodule Change-Id: I68a4f5475eb150431203aca1ce74ef21bf510b08 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/tools/perfparser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/perfparser b/src/tools/perfparser index 9cd74c87df4..be86a8ea6b7 160000 --- a/src/tools/perfparser +++ b/src/tools/perfparser @@ -1 +1 @@ -Subproject commit 9cd74c87df440e34ac4593b1a16ec6f7b7843d86 +Subproject commit be86a8ea6b7671c7a60abc6e51db27ace7baedb9 From 6233c8ce80a6d03cb7c88adecc34cdad938863b1 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 15 Sep 2023 07:39:08 +0200 Subject: [PATCH 1111/1777] Qbs: Fix build after DS merge Change-Id: I5188d1654584ba88789472fe1f0c81b2b1a33a55 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/advanceddockingsystem/advanceddockingsystem.qbs | 2 +- src/plugins/qmldesignerbase/qmldesignerbase.qbs | 6 ++++-- src/plugins/qmlpreview/qmlpreview.qbs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libs/advanceddockingsystem/advanceddockingsystem.qbs b/src/libs/advanceddockingsystem/advanceddockingsystem.qbs index e603a039827..c04b8e0fe33 100644 --- a/src/libs/advanceddockingsystem/advanceddockingsystem.qbs +++ b/src/libs/advanceddockingsystem/advanceddockingsystem.qbs @@ -7,7 +7,7 @@ QtcLibrary { cpp.defines: base.concat("ADVANCEDDOCKINGSYSTEM_LIBRARY") cpp.includePaths: base.concat([".", linux.prefix]) - Depends { name: "Qt"; submodules: ["widgets", "xml"] } + Depends { name: "Qt"; submodules: ["quickwidgets", "widgets", "xml"] } Depends { name: "Utils" } Group { diff --git a/src/plugins/qmldesignerbase/qmldesignerbase.qbs b/src/plugins/qmldesignerbase/qmldesignerbase.qbs index 334bebe1964..5b029f66dc1 100644 --- a/src/plugins/qmldesignerbase/qmldesignerbase.qbs +++ b/src/plugins/qmldesignerbase/qmldesignerbase.qbs @@ -17,12 +17,14 @@ QtcPlugin { Group { prefix: "studio/" files: [ + "studioquickwidget.cpp", + "studioquickwidget.h", "studiosettingspage.cpp", "studiosettingspage.h", "studiostyle.cpp", "studiostyle.h", - "studioquickwidget.cpp", - "studioquickwidget.h", + "studiostyle_p.cpp", + "studiostyle_p.h", ] } Group { diff --git a/src/plugins/qmlpreview/qmlpreview.qbs b/src/plugins/qmlpreview/qmlpreview.qbs index e44f432c41a..b3dcc830f5a 100644 --- a/src/plugins/qmlpreview/qmlpreview.qbs +++ b/src/plugins/qmlpreview/qmlpreview.qbs @@ -16,7 +16,7 @@ QtcPlugin { Depends { name: "Qt" - submodules: ["core"] + submodules: ["core", "qml-private"] } Group { From da63a144818a0dce96eb84f9937a5eea0fc0d2f7 Mon Sep 17 00:00:00 2001 From: Tim Jenssen <tim.jenssen@qt.io> Date: Tue, 15 Aug 2023 15:53:52 +0000 Subject: [PATCH 1112/1777] Revert "Tests: Fix cmake build" This reverts commit a263d3de89f54382a1ef9f30d678e7c15a052f85. Reason for revert: QmlDesigner dependency was wrong Change-Id: I2b67861ab81720649394045b68e2476bb51dd333 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- tests/unit/tests/matchers/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/unit/tests/matchers/CMakeLists.txt b/tests/unit/tests/matchers/CMakeLists.txt index fc10cdc4f04..f050cb83c85 100644 --- a/tests/unit/tests/matchers/CMakeLists.txt +++ b/tests/unit/tests/matchers/CMakeLists.txt @@ -2,7 +2,6 @@ add_qtc_library(TestMatchers OBJECT EXCLUDE_FROM_INSTALL PROPERTIES SKIP_AUTOGEN ON PUBLIC_INCLUDES ${CMAKE_CURRENT_LIST_DIR} - CONDITION QmlDesigner DEPENDS Googletest Utils TestDesignerCore SOURCES From cddc4b3d32c7c966be98e88a70ea60dae8259ac5 Mon Sep 17 00:00:00 2001 From: Andreas Loth <andreas.loth@qt.io> Date: Fri, 8 Sep 2023 14:10:52 +0200 Subject: [PATCH 1113/1777] Axivion: Use QUrl.resolved to build path instead of string concatenation Change-Id: I1e80cc83bd7fcf2ede34bff6764ff3af4d89aac6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/axivion/dashboard/dashboardclient.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/axivion/dashboard/dashboardclient.cpp b/src/plugins/axivion/dashboard/dashboardclient.cpp index d6a091d7fc2..5c7b60adb3a 100644 --- a/src/plugins/axivion/dashboard/dashboardclient.cpp +++ b/src/plugins/axivion/dashboard/dashboardclient.cpp @@ -70,7 +70,12 @@ static Utils::expected_str<T> RawBodyParser(RawBody rawBody) QFuture<DashboardClient::RawProjectInfo> DashboardClient::fetchProjectInfo(const QString &projectName) { const AxivionServer &server = settings().server; - QUrl url { server.dashboard + QStringLiteral(u"/api/projects/") + QUrl::toPercentEncoding(projectName) }; + QString dashboard = server.dashboard; + if (!dashboard.endsWith(QLatin1Char('/'))) + dashboard += QLatin1Char('/'); + QUrl url = QUrl(dashboard) + .resolved(QUrl(QStringLiteral(u"api/projects/"))) + .resolved(QUrl(projectName)); QNetworkRequest request{ url }; request.setRawHeader(QByteArrayLiteral(u8"Authorization"), QByteArrayLiteral(u8"AxToken ") + server.token.toUtf8()); From c9eeca39d00dd7db7e6cb5a4c9e66e7b9ebb3cc6 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 15 Sep 2023 11:39:53 +0200 Subject: [PATCH 1114/1777] AdvanceDockingSystem: Skip, if QuickWidgets is not installed If Qt is built without QuickWidgets, skip building the ADS library. Change-Id: I0b31de0ba7f1f7c6dcb19e5c75f2345acca48416 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/libs/advanceddockingsystem/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/advanceddockingsystem/CMakeLists.txt b/src/libs/advanceddockingsystem/CMakeLists.txt index 66608852137..f993a9f1431 100644 --- a/src/libs/advanceddockingsystem/CMakeLists.txt +++ b/src/libs/advanceddockingsystem/CMakeLists.txt @@ -1,4 +1,5 @@ add_qtc_library(AdvancedDockingSystem + CONDITION TARGET Qt::QuickWidgets DEPENDS Qt::Widgets Qt::Core Qt::Gui Qt::Xml Qt::QuickWidgets Utils SOURCES ads_globals.cpp ads_globals.h From 680d77bc35dd82735492397d187fd4ae8c20008f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 14 Sep 2023 14:21:41 +0200 Subject: [PATCH 1115/1777] Core: Remove some unneeded #include Change-Id: I642b578964ee18677d344201e47ba45312938807 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/coreplugin/iversioncontrol.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/plugins/coreplugin/iversioncontrol.cpp b/src/plugins/coreplugin/iversioncontrol.cpp index 35db42ab4cf..483dd211e83 100644 --- a/src/plugins/coreplugin/iversioncontrol.cpp +++ b/src/plugins/coreplugin/iversioncontrol.cpp @@ -11,7 +11,6 @@ #include <utils/qtcassert.h> #include <QDir> -#include <QFileInfo> #include <QRegularExpression> #include <QStringList> @@ -182,8 +181,6 @@ bool IVersionControl::handleLink(const FilePath &workingDirectory, const QString #if defined(WITH_TESTS) -#include <QFileInfo> - namespace Core { TestVersionControl::~TestVersionControl() From 4ecf769293e146e5d32eb5c9f7676c5d42ba636d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 14 Sep 2023 14:50:02 +0200 Subject: [PATCH 1116/1777] Core: Remove SettingsDatabase QObject base Was not really needed except for the ownership. Change-Id: I88e32123cbb85a8217ade9450b5b578845736311 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/coreplugin/mainwindow.cpp | 6 ++++-- src/plugins/coreplugin/settingsdatabase.cpp | 7 ++----- src/plugins/coreplugin/settingsdatabase.h | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index a483bf470c5..c7cd22f040d 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -124,8 +124,7 @@ MainWindow::MainWindow() , m_lowPrioAdditionalContexts(Constants::C_GLOBAL) , m_settingsDatabase( new SettingsDatabase(QFileInfo(PluginManager::settings()->fileName()).path(), - QCoreApplication::applicationName(), - this)) + QCoreApplication::applicationName())) , m_progressManager(new ProgressManagerPrivate) , m_jsExpander(JsExpander::createGlobalJsExpander()) , m_vcsManager(new VcsManager) @@ -307,6 +306,9 @@ MainWindow::~MainWindow() delete m_jsExpander; m_jsExpander = nullptr; + + delete m_settingsDatabase; + m_settingsDatabase = nullptr; } void MainWindow::init() diff --git a/src/plugins/coreplugin/settingsdatabase.cpp b/src/plugins/coreplugin/settingsdatabase.cpp index 281940d689b..db17606c494 100644 --- a/src/plugins/coreplugin/settingsdatabase.cpp +++ b/src/plugins/coreplugin/settingsdatabase.cpp @@ -68,11 +68,8 @@ public: } // namespace Internal } // namespace Core -SettingsDatabase::SettingsDatabase(const QString &path, - const QString &application, - QObject *parent) - : QObject(parent) - , d(new SettingsDatabasePrivate) +SettingsDatabase::SettingsDatabase(const QString &path, const QString &application) + : d(new SettingsDatabasePrivate) { const QLatin1Char slash('/'); diff --git a/src/plugins/coreplugin/settingsdatabase.h b/src/plugins/coreplugin/settingsdatabase.h index 6cde9e0080c..745c0d659af 100644 --- a/src/plugins/coreplugin/settingsdatabase.h +++ b/src/plugins/coreplugin/settingsdatabase.h @@ -14,11 +14,11 @@ namespace Core { namespace Internal { class SettingsDatabasePrivate; } -class CORE_EXPORT SettingsDatabase : public QObject +class CORE_EXPORT SettingsDatabase final { public: - SettingsDatabase(const QString &path, const QString &application, QObject *parent = nullptr); - ~SettingsDatabase() override; + SettingsDatabase(const QString &path, const QString &application); + ~SettingsDatabase(); void setValue(const QString &key, const QVariant &value); QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const; From de42485b8f1656355e449cae24abef0dd54f418b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 14 Sep 2023 14:28:21 +0200 Subject: [PATCH 1117/1777] Core: Cosmetics and unused #includes Change-Id: I5838b7340b9f5fca6d43a49026c8fc82f0d0a494 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/coreplugin/mainwindow.cpp | 38 ++++++++++----------------- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index c7cd22f040d..f31fcbf99be 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -66,33 +66,23 @@ #include <nanotrace/nanotrace.h> -#include <QAbstractProxyModel> #include <QActionGroup> #include <QApplication> -#include <QBrush> #include <QCloseEvent> #include <QColorDialog> #include <QComboBox> #include <QDebug> #include <QDialogButtonBox> -#include <QDir> #include <QFileInfo> -#include <QFileSystemModel> #include <QMenu> #include <QMenuBar> #include <QMessageBox> #include <QPrinter> -#include <QSettings> -#include <QSortFilterProxyModel> #include <QStatusBar> #include <QStyleFactory> -#include <QSyntaxHighlighter> #include <QTextBrowser> -#include <QTextList> #include <QToolButton> -#include <QUrl> #include <QVersionNumber> -#include <QWindow> #ifdef Q_OS_LINUX #include <malloc.h> @@ -104,12 +94,12 @@ using namespace Utils; namespace Core { namespace Internal { -static const char settingsGroup[] = "MainWindow"; -static const char colorKey[] = "Color"; -static const char windowGeometryKey[] = "WindowGeometry"; -static const char windowStateKey[] = "WindowState"; -static const char modeSelectorLayoutKey[] = "ModeSelectorLayout"; -static const char menubarVisibleKey[] = "MenubarVisible"; +const char settingsGroup[] = "MainWindow"; +const char colorKey[] = "Color"; +const char windowGeometryKey[] = "WindowGeometry"; +const char windowStateKey[] = "WindowState"; +const char modeSelectorLayoutKey[] = "ModeSelectorLayout"; +const char menubarVisibleKey[] = "MenubarVisible"; static bool hideToolsMenu() { @@ -1262,8 +1252,8 @@ void MainWindow::saveSettings() void MainWindow::saveWindowSettings() { - QSettings *settings = PluginManager::settings(); - settings->beginGroup(QLatin1String(settingsGroup)); + QtcSettings *settings = PluginManager::settings(); + settings->beginGroup(settingsGroup); // On OS X applications usually do not restore their full screen state. // To be able to restore the correct non-full screen geometry, we have to put @@ -1271,8 +1261,8 @@ void MainWindow::saveWindowSettings() // Works around QTBUG-45241 if (Utils::HostOsInfo::isMacHost() && isFullScreen()) setWindowState(windowState() & ~Qt::WindowFullScreen); - settings->setValue(QLatin1String(windowGeometryKey), saveGeometry()); - settings->setValue(QLatin1String(windowStateKey), saveState()); + settings->setValue(windowGeometryKey, saveGeometry()); + settings->setValue(windowStateKey, saveState()); settings->setValue(modeSelectorLayoutKey, int(ModeManager::modeStyle())); settings->endGroup(); @@ -1552,11 +1542,11 @@ QPrinter *MainWindow::printer() const void MainWindow::restoreWindowState() { NANOTRACE_SCOPE("Core", "MainWindow::restoreWindowState"); - QSettings *settings = PluginManager::settings(); - settings->beginGroup(QLatin1String(settingsGroup)); - if (!restoreGeometry(settings->value(QLatin1String(windowGeometryKey)).toByteArray())) + QtcSettings *settings = PluginManager::settings(); + settings->beginGroup(settingsGroup); + if (!restoreGeometry(settings->value(windowGeometryKey).toByteArray())) resize(1260, 700); // size without window decoration - restoreState(settings->value(QLatin1String(windowStateKey)).toByteArray()); + restoreState(settings->value(windowStateKey).toByteArray()); settings->endGroup(); show(); StatusBarManager::restoreSettings(); From b9191e9d150ed0b7f20f281a64d213eb66a1de9b Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 15 Sep 2023 10:52:21 +0200 Subject: [PATCH 1118/1777] Update qbs submodule to HEAD of 2.1 branch Change-Id: I3435d412498021ab432aeb9f295d25846d39a0ee Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 40d30480847..d361630f727 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 40d304808479ea72c1d02dacf007ab8b05851e2e +Subproject commit d361630f727459ea6dccc1ca6cd5ad51162bfb62 From aab39532f30331451db292b9bab787705c081180 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 13 Sep 2023 14:44:07 +0200 Subject: [PATCH 1119/1777] TextEditor: Collect the comment position setting from highlighter Change-Id: I802b9e263a3515fe340459329a8c8d8f309cfa0e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../texteditor/behaviorsettingswidget.cpp | 53 +++++++++++++++++-- src/plugins/texteditor/texteditor.cpp | 15 ++++-- src/plugins/texteditor/typingsettings.cpp | 16 +++--- src/plugins/texteditor/typingsettings.h | 8 ++- 4 files changed, 76 insertions(+), 16 deletions(-) diff --git a/src/plugins/texteditor/behaviorsettingswidget.cpp b/src/plugins/texteditor/behaviorsettingswidget.cpp index 2a457596cad..4e7c70fb22c 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.cpp +++ b/src/plugins/texteditor/behaviorsettingswidget.cpp @@ -38,7 +38,7 @@ struct BehaviorSettingsWidgetPrivate QComboBox *smartBackspaceBehavior; QCheckBox *autoIndent; QCheckBox *preferSingleLineComments; - QCheckBox *preferAfterWhitespaceComments; + QComboBox *commentPosition; QGroupBox *groupBoxStorageSettings; QGroupBox *groupBoxTyping; QCheckBox *skipTrailingWhitespace; @@ -96,7 +96,48 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent) d->autoIndent = new QCheckBox(Tr::tr("Enable automatic &indentation")); d->preferSingleLineComments = new QCheckBox(Tr::tr("Prefer single line comments")); - d->preferAfterWhitespaceComments = new QCheckBox(Tr::tr("Prefer comments after whitespace")); + d->commentPosition = new QComboBox; + const QString automaticText = Tr::tr("Automatic"); + d->commentPosition->addItem(automaticText); + const QString lineStartText = Tr::tr("At Line Start"); + d->commentPosition->addItem(lineStartText); + const QString afterWhitespaceText = Tr::tr("After Whitespace"); + d->commentPosition->addItem(afterWhitespaceText); + + const QString generalCommentPosition = Tr::tr( + "Specifies where single line comments should be positioned."); + const QString automaticCommentPosition + = Tr::tr( + "%1: The highlight definition for the file determines the position. If no highlight " + "definition is available, the comment is placed after leading whitespaces.") + .arg(automaticText); + const QString lineStartCommentPosition + = Tr::tr("%1: The comment is placed at the start of the line.").arg(lineStartText); + const QString afterWhitespaceCommentPosition + = Tr::tr("%1: The comment is placed after leading whitespaces.").arg(afterWhitespaceText); + + const QString commentPositionToolTip = QString("<html><head/><body>\n" + "%1\n" + "\n" + "<ul>\n" + "<li>%2\n" + "</li>\n" + "\n" + "<li>%3\n" + "</li>\n" + "\n" + "<li>%4\n" + "</li>\n" + "</ul></body></html>\n" + "") + .arg(generalCommentPosition) + .arg(automaticCommentPosition) + .arg(lineStartCommentPosition) + .arg(afterWhitespaceCommentPosition); + d->commentPosition->setToolTip(commentPositionToolTip); + + auto commentPositionLabel = new QLabel(Tr::tr("Preferred comment position")); + commentPositionLabel->setToolTip(commentPositionToolTip); d->skipTrailingWhitespace = new QCheckBox(Tr::tr("Skip clean whitespace for file types:")); d->skipTrailingWhitespace->setToolTip(Tr::tr("For the file patterns listed, do not trim trailing whitespace.")); @@ -176,7 +217,8 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent) Tr::tr("Tab key performs auto-indent:"), indent(d->tabKeyBehavior), d->preferSingleLineComments, - d->preferAfterWhitespaceComments + commentPositionLabel, + indent(d->commentPosition) }.attachTo(d->groupBoxTyping); Column { @@ -296,7 +338,7 @@ void BehaviorSettingsWidget::setAssignedTypingSettings(const TypingSettings &typ d->tabKeyBehavior->setCurrentIndex(typingSettings.m_tabKeyBehavior); d->preferSingleLineComments->setChecked(typingSettings.m_preferSingleLineComments); - d->preferAfterWhitespaceComments->setChecked(typingSettings.m_preferAfterWhitespaceComments); + d->commentPosition->setCurrentIndex(typingSettings.m_commentPosition); } void BehaviorSettingsWidget::assignedTypingSettings(TypingSettings *typingSettings) const @@ -308,7 +350,8 @@ void BehaviorSettingsWidget::assignedTypingSettings(TypingSettings *typingSettin (TypingSettings::TabKeyBehavior)(d->tabKeyBehavior->currentIndex()); typingSettings->m_preferSingleLineComments = d->preferSingleLineComments->isChecked(); - typingSettings->m_preferAfterWhitespaceComments = d->preferAfterWhitespaceComments->isChecked(); + typingSettings->m_commentPosition = TypingSettings::CommentPosition( + d->commentPosition->currentIndex()); } void BehaviorSettingsWidget::setAssignedStorageSettings(const StorageSettings &storageSettings) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 6bd50ef2bdb..7add698645d 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -3585,11 +3585,19 @@ void TextEditorWidgetPrivate::configureGenericHighlighter( void TextEditorWidgetPrivate::setupFromDefinition(const KSyntaxHighlighting::Definition &definition) { + const TypingSettings::CommentPosition commentPosition + = m_document->typingSettings().m_commentPosition; + m_commentDefinition.isAfterWhitespace = commentPosition != TypingSettings::StartOfLine; if (!definition.isValid()) return; m_commentDefinition.singleLine = definition.singleLineCommentMarker(); m_commentDefinition.multiLineStart = definition.multiLineCommentMarker().first; m_commentDefinition.multiLineEnd = definition.multiLineCommentMarker().second; + if (commentPosition == TypingSettings::Automatic) { + m_commentDefinition.isAfterWhitespace + = definition.singleLineCommentPosition() + == KSyntaxHighlighting::CommentPosition::AfterWhitespace; + } q->setCodeFoldingSupported(true); } @@ -7698,10 +7706,8 @@ void TextEditorWidget::rewrapParagraph() void TextEditorWidget::unCommentSelection() { const bool singleLine = d->m_document->typingSettings().m_preferSingleLineComments; - CommentDefinition commentDefinition = d->m_commentDefinition; - commentDefinition.isAfterWhitespace = d->m_document->typingSettings().m_preferAfterWhitespaceComments; const MultiTextCursor cursor = Utils::unCommentSelection(multiTextCursor(), - commentDefinition, + d->m_commentDefinition, singleLine); setMultiTextCursor(cursor); } @@ -7862,6 +7868,7 @@ void TextEditorWidget::setBehaviorSettings(const BehaviorSettings &bs) void TextEditorWidget::setTypingSettings(const TypingSettings &typingSettings) { d->m_document->setTypingSettings(typingSettings); + d->setupFromDefinition(d->currentDefinition()); } void TextEditorWidget::setStorageSettings(const StorageSettings &storageSettings) @@ -9263,6 +9270,8 @@ BaseTextEditor *TextEditorFactoryPrivate::createEditorHelper(const TextDocumentP textEditorWidget->d->m_hoverHandlers = m_hoverHandlers; textEditorWidget->d->m_commentDefinition = m_commentDefinition; + textEditorWidget->d->m_commentDefinition.isAfterWhitespace + = document->typingSettings().m_commentPosition != TypingSettings::StartOfLine; QObject::connect(textEditorWidget, &TextEditorWidget::activateEditor, diff --git a/src/plugins/texteditor/typingsettings.cpp b/src/plugins/texteditor/typingsettings.cpp index 11c444a6986..3f9a42f9f7f 100644 --- a/src/plugins/texteditor/typingsettings.cpp +++ b/src/plugins/texteditor/typingsettings.cpp @@ -33,7 +33,7 @@ Store TypingSettings::toMap() const {tabKeyBehaviorKey, m_tabKeyBehavior}, {smartBackspaceBehaviorKey, m_smartBackspaceBehavior}, {preferSingleLineCommentsKey, m_preferSingleLineComments}, - {preferAfterWhitespaceCommentsKey, m_preferAfterWhitespaceComments} + {preferAfterWhitespaceCommentsKey, m_commentPosition} }; } @@ -45,17 +45,19 @@ void TypingSettings::fromMap(const Store &map) smartBackspaceBehaviorKey, m_smartBackspaceBehavior).toInt(); m_preferSingleLineComments = map.value(preferSingleLineCommentsKey, m_preferSingleLineComments).toBool(); - m_preferAfterWhitespaceComments = - map.value(preferAfterWhitespaceCommentsKey, m_preferAfterWhitespaceComments).toBool(); + m_commentPosition = CommentPosition( + std::clamp(map.value(preferAfterWhitespaceCommentsKey, m_commentPosition).toInt(), + int(Automatic), + int(AfterWhitespace))); } bool TypingSettings::equals(const TypingSettings &ts) const { return m_autoIndent == ts.m_autoIndent - && m_tabKeyBehavior == ts.m_tabKeyBehavior - && m_smartBackspaceBehavior == ts.m_smartBackspaceBehavior - && m_preferSingleLineComments == ts.m_preferSingleLineComments - && m_preferAfterWhitespaceComments == ts.m_preferAfterWhitespaceComments; + && m_tabKeyBehavior == ts.m_tabKeyBehavior + && m_smartBackspaceBehavior == ts.m_smartBackspaceBehavior + && m_preferSingleLineComments == ts.m_preferSingleLineComments + && m_commentPosition == ts.m_commentPosition; } bool TypingSettings::tabShouldIndent(const QTextDocument *document, diff --git a/src/plugins/texteditor/typingsettings.h b/src/plugins/texteditor/typingsettings.h index f3282308675..283a665f52c 100644 --- a/src/plugins/texteditor/typingsettings.h +++ b/src/plugins/texteditor/typingsettings.h @@ -31,6 +31,12 @@ public: BackspaceUnindents = 2 }; + enum CommentPosition { + Automatic = 0, + StartOfLine = 1, + AfterWhitespace = 2, + }; + TypingSettings(); bool tabShouldIndent(const QTextDocument *document, const QTextCursor &cursor, int *suggestedPosition) const; @@ -48,7 +54,7 @@ public: SmartBackspaceBehavior m_smartBackspaceBehavior; bool m_preferSingleLineComments; - bool m_preferAfterWhitespaceComments = false; + CommentPosition m_commentPosition = Automatic; }; } // namespace TextEditor From b81026488ca2da8d13ae7816107c1beee0825eb1 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 14 Sep 2023 15:13:43 +0200 Subject: [PATCH 1120/1777] Docker: Improve error reporting Change-Id: I1a1ad824b4084ce7203357acf9ec19ccfe91b5cd Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 5 ++ src/libs/utils/deviceshell.cpp | 89 ++++++++++------------- src/libs/utils/deviceshell.h | 11 ++- src/plugins/docker/dockerdevice.cpp | 48 +++++++----- src/plugins/docker/dockerdevice.h | 2 + src/plugins/docker/dockerdevicewidget.cpp | 1 + src/plugins/remotelinux/linuxdevice.cpp | 7 +- 7 files changed, 86 insertions(+), 77 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 42bd40badf3..129c454f988 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -2611,6 +2611,10 @@ void TextDisplay::addToLayout(LayoutItem &parent) // have a QWidget parent yet when used in a LayoutBuilder. if (!isVisible()) d->m_label->setVisible(false); + + connect(this, &TextDisplay::changed, d->m_label, [this] { + d->m_label->setText(d->m_message); + }); } parent.addItem(d->m_label.data()); } @@ -2629,6 +2633,7 @@ void TextDisplay::setIconType(InfoLabel::InfoType t) void TextDisplay::setText(const QString &message) { d->m_message = message; + emit changed(); } /*! diff --git a/src/libs/utils/deviceshell.cpp b/src/libs/utils/deviceshell.cpp index 724a7ce33b0..33461f128f3 100644 --- a/src/libs/utils/deviceshell.cpp +++ b/src/libs/utils/deviceshell.cpp @@ -6,6 +6,7 @@ #include "process.h" #include "processinterface.h" #include "qtcassert.h" +#include "utilstr.h" #include <QLoggingCategory> @@ -153,23 +154,13 @@ CommandLine DeviceShell::createFallbackCommand(const CommandLine &cmd) return cmd; } -/*! - * \brief DeviceShell::startupFailed - * - * Override to display custom error messages - */ -void DeviceShell::startupFailed(const CommandLine &cmdLine) -{ - qCWarning(deviceShellLog) << "Failed to start shell via:" << cmdLine.toUserOutput(); -} - /*! * \brief DeviceShell::start * \return Returns true if starting the Shell process succeeded * * \note You have to call this function when deriving from DeviceShell. Current implementations call the function from their constructor. */ -bool DeviceShell::start() +expected_str<void> DeviceShell::start() { m_shellProcess = std::make_unique<Process>(); connect(m_shellProcess.get(), &Process::done, m_shellProcess.get(), @@ -185,19 +176,21 @@ bool DeviceShell::start() // Moving the process into its own thread ... m_shellProcess->moveToThread(&m_thread); - bool result = false; + expected_str<void> result; QMetaObject::invokeMethod( m_shellProcess.get(), - [this] { - qCDebug(deviceShellLog) << "Starting shell process:" << m_shellProcess->commandLine().toUserOutput(); + [this]() -> expected_str<void> { + qCDebug(deviceShellLog) + << "Starting shell process:" << m_shellProcess->commandLine().toUserOutput(); m_shellProcess->start(); if (!m_shellProcess->waitForStarted()) { closeShellProcess(); - return false; + return make_unexpected(Tr::tr("The process failed to start.")); } - if (installShellScript()) { + auto installResult = installShellScript(); + if (installResult) { connect(m_shellProcess.get(), &Process::readyReadStandardOutput, m_shellProcess.get(), @@ -210,67 +203,64 @@ bool DeviceShell::start() qCWarning(deviceShellLog) << "Received unexpected output on stderr:" << stdErr; }); + + connect(m_shellProcess.get(), &Process::done, m_shellProcess.get(), [this] { + if (m_shellProcess->resultData().m_exitCode != EXIT_SUCCESS + || m_shellProcess->resultData().m_exitStatus != QProcess::NormalExit) { + qCWarning(deviceShellLog) << "Shell exited with error code:" + << m_shellProcess->resultData().m_exitCode << "(" + << m_shellProcess->exitMessage() << ")"; + } + }); + + return {}; } else if (m_shellProcess->isRunning()) { m_shellProcess->kill(); m_shellProcess.reset(); - return false; - } else - return false; - - connect(m_shellProcess.get(), &Process::done, m_shellProcess.get(), [this] { - if (m_shellProcess->resultData().m_exitCode != EXIT_SUCCESS - || m_shellProcess->resultData().m_exitStatus != QProcess::NormalExit) { - qCWarning(deviceShellLog) << "Shell exited with error code:" - << m_shellProcess->resultData().m_exitCode << "(" - << m_shellProcess->exitMessage() << ")"; - } - }); - - return true; + } + return make_unexpected(Tr::tr("Failed to install shell script: %1\n%2") + .arg(installResult.error()) + .arg(m_shellProcess->readAllStandardError())); }, Qt::BlockingQueuedConnection, &result); - if (!result) { - startupFailed(cmdLine); - } - return result; } -bool DeviceShell::checkCommand(const QByteArray &command) +expected_str<QByteArray> DeviceShell::checkCommand(const QByteArray &command) { const QByteArray checkCmd = "(which " + command + " || echo '<missing>')\n"; m_shellProcess->writeRaw(checkCmd); if (!m_shellProcess->waitForReadyRead()) { - qCWarning(deviceShellLog) << "Timeout while trying to check for" << command; - return false; + return make_unexpected( + Tr::tr("Timeout while trying to check for %1.").arg(QString::fromUtf8(command))); } QByteArray out = m_shellProcess->readAllRawStandardOutput(); if (out.contains("<missing>")) { m_shellScriptState = State::Failed; - qCWarning(deviceShellLog) << "Command" << command << "was not found"; m_missingFeatures.append(QString::fromUtf8(command)); - return false; + return make_unexpected(Tr::tr("Command %1 was not found.").arg(QString::fromUtf8(command))); } - return true; + return out; } -bool DeviceShell::installShellScript() +expected_str<void> DeviceShell::installShellScript() { if (m_forceFailScriptInstallation) { m_shellScriptState = State::Failed; - return false; + return make_unexpected(Tr::tr("Script installation was forced to fail.")); } static const QList<QByteArray> requiredCommands = {"base64", "cat", "echo", "kill", "mkfifo", "mktemp", "rm"}; for (const QByteArray &command : requiredCommands) { - if (!checkCommand(command)) - return false; + auto checkResult = checkCommand(command); + if (!checkResult) + return make_unexpected(checkResult.error()); } const static QByteArray shellScriptBase64 = FilePath(":/utils/scripts/deviceshell.sh") @@ -287,19 +277,18 @@ bool DeviceShell::installShellScript() while (m_shellScriptState == State::Unknown) { if (!m_shellProcess->waitForReadyRead(5000)) { - qCWarning(deviceShellLog) << "Timeout while waiting for shell script installation"; - return false; + return make_unexpected(Tr::tr("Timeout while waiting for shell script installation.")); } QByteArray out = m_shellProcess->readAllRawStandardError(); if (out.contains("SCRIPT_INSTALLED") && !out.contains("ERROR_INSTALL_SCRIPT")) { m_shellScriptState = State::Succeeded; - return true; + return {}; } if (out.contains("ERROR_INSTALL_SCRIPT")) { m_shellScriptState = State::Failed; - qCWarning(deviceShellLog) << "Failed installing device shell script"; - return false; + return make_unexpected( + Tr::tr("Failed to install shell script: %1").arg(QString::fromUtf8(out))); } if (!out.isEmpty()) { qCWarning(deviceShellLog) @@ -307,7 +296,7 @@ bool DeviceShell::installShellScript() } } - return true; + return {}; } void DeviceShell::closeShellProcess() diff --git a/src/libs/utils/deviceshell.h b/src/libs/utils/deviceshell.h index e5bc4ad7afe..73d9805e104 100644 --- a/src/libs/utils/deviceshell.h +++ b/src/libs/utils/deviceshell.h @@ -3,9 +3,9 @@ #pragma once -#include "utils_global.h" - +#include "expected.h" #include "fileutils.h" +#include "utils_global.h" #include <QHash> #include <QMutex> @@ -39,7 +39,7 @@ public: DeviceShell(bool forceFailScriptInstallation = false); virtual ~DeviceShell(); - bool start(); + expected_str<void> start(); RunResult runInShell(const CommandLine &cmd, const QByteArray &stdInData = {}); @@ -51,7 +51,6 @@ signals: void done(const ProcessResultData &resultData); protected: - virtual void startupFailed(const CommandLine &cmdLine); RunResult run(const CommandLine &cmd, const QByteArray &stdInData = {}); void close(); @@ -60,12 +59,12 @@ private: virtual void setupShellProcess(Process *shellProcess); virtual CommandLine createFallbackCommand(const CommandLine &cmdLine); - bool installShellScript(); + expected_str<void> installShellScript(); void closeShellProcess(); void onReadyRead(); - bool checkCommand(const QByteArray &command); + expected_str<QByteArray> checkCommand(const QByteArray &command); private: struct CommandRun : public RunResult diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index bcef8da84bc..ea6f27e3529 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -190,6 +190,8 @@ DockerDeviceSettings::DockerDeviceSettings() return newValue; }); }); + + containerStatus.setText(Tr::tr("stopped")); } // Used for "docker run" @@ -251,8 +253,8 @@ public: bool prepareForBuild(const Target *target); Tasks validateMounts() const; - bool createContainer(); - bool startContainer(); + expected_str<QString> createContainer(); + expected_str<void> startContainer(); void stopCurrentContainer(); void fetchSystemEnviroment(); @@ -733,10 +735,10 @@ bool DockerDevicePrivate::isImageAvailable() const return false; } -bool DockerDevicePrivate::createContainer() +expected_str<QString> DockerDevicePrivate::createContainer() { if (!isImageAvailable()) - return false; + return make_unexpected(Tr::tr("Image \"%1\" is not available.").arg(repoAndTag())); const QString display = HostOsInfo::isLinuxHost() ? QString(":0") : QString("host.docker.internal:0"); @@ -773,24 +775,25 @@ bool DockerDevicePrivate::createContainer() createProcess.runBlocking(); if (createProcess.result() != ProcessResult::FinishedWithSuccess) { - qCWarning(dockerDeviceLog) << "Failed creating docker container:"; - qCWarning(dockerDeviceLog) << "Exit Code:" << createProcess.exitCode(); - qCWarning(dockerDeviceLog) << createProcess.allOutput(); - return false; + return make_unexpected(Tr::tr("Failed creating Docker container. Exit code: %1, output: %2") + .arg(createProcess.exitCode()) + .arg(createProcess.allOutput())); } m_container = createProcess.cleanedStdOut().trimmed(); if (m_container.isEmpty()) - return false; + return make_unexpected( + Tr::tr("Failed creating Docker container. No container ID received.")); qCDebug(dockerDeviceLog) << "ContainerId:" << m_container; - return true; + return m_container; } -bool DockerDevicePrivate::startContainer() +expected_str<void> DockerDevicePrivate::startContainer() { - if (!createContainer()) - return false; + auto createResult = createContainer(); + if (!createResult) + return make_unexpected(createResult.error()); m_shell = std::make_unique<ContainerShell>(m_container, q->rootPath()); @@ -811,13 +814,10 @@ bool DockerDevicePrivate::startContainer() "or restart Qt Creator.")); }); - QTC_ASSERT(m_shell, return false); + QTC_ASSERT(m_shell, + return make_unexpected(Tr::tr("Failed to create container shell (Out of memory)."))); - if (m_shell->start()) - return true; - - qCWarning(dockerDeviceLog) << "Container shell failed to start"; - return false; + return m_shell->start(); } bool DockerDevicePrivate::updateContainerAccess() @@ -831,7 +831,15 @@ bool DockerDevicePrivate::updateContainerAccess() if (m_shell) return true; - return startContainer(); + auto result = startContainer(); + if (result) { + deviceSettings->containerStatus.setText(Tr::tr("Running")); + return true; + } + + qCWarning(dockerDeviceLog) << "Failed to start container:" << result.error(); + deviceSettings->containerStatus.setText(result.error()); + return false; } void DockerDevice::setMounts(const QStringList &mounts) const diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index d44a676bfd5..e910031c619 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -30,6 +30,8 @@ public: Utils::BoolAspect keepEntryPoint{this}; Utils::BoolAspect enableLldbFlags{this}; Utils::FilePathAspect clangdExecutable{this}; + + Utils::TextDisplay containerStatus{this}; }; class DockerDevice : public ProjectExplorer::IDevice diff --git a/src/plugins/docker/dockerdevicewidget.cpp b/src/plugins/docker/dockerdevicewidget.cpp index 7450297c158..018cabb07f6 100644 --- a/src/plugins/docker/dockerdevicewidget.cpp +++ b/src/plugins/docker/dockerdevicewidget.cpp @@ -162,6 +162,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) deviceSettings->tag, br, deviceSettings->imageId, br, daemonStateLabel, m_daemonReset, m_daemonState, br, + Tr::tr("Container State:"), deviceSettings->containerStatus, br, deviceSettings->useLocalUidGid, br, deviceSettings->keepEntryPoint, br, deviceSettings->enableLldbFlags, br, diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index d32a4edda18..3707f660052 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -847,7 +847,12 @@ public: connect(m_shell.get(), &DeviceShell::done, this, [this] { m_shell.release()->deleteLater(); }); - return m_shell->start(); + auto result = m_shell->start(); + if (!result) { + qCWarning(linuxDeviceLog) << "Failed to start shell for:" << parameters.userAtHost() + << ", " << result.error(); + } + return result.has_value(); } // Call me with shell mutex locked From 67bd5fc3596bd4c40ca6c9d5f8b8610b001fc626 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 15 Sep 2023 11:56:03 +0200 Subject: [PATCH 1121/1777] Utils: Add StringSelectionAspect Change-Id: I73b5c964be1222f56fcc01f30d17506f92d1f6b2 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 124 ++++++++++++++++++ src/libs/utils/aspects.h | 37 +++++- .../compilerexploreraspects.cpp | 97 -------------- .../compilerexploreraspects.h | 26 ---- .../compilerexplorersettings.cpp | 8 +- .../compilerexplorersettings.h | 10 +- 6 files changed, 169 insertions(+), 133 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 129c454f988..a8d8f554403 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -23,6 +23,7 @@ #include <QButtonGroup> #include <QCheckBox> #include <QComboBox> +#include <QCompleter> #include <QDebug> #include <QGroupBox> #include <QLabel> @@ -36,6 +37,7 @@ #include <QScrollArea> #include <QSettings> #include <QSpinBox> +#include <QStandardItemModel> #include <QTextEdit> #include <QUndoStack> @@ -3242,4 +3244,126 @@ void AspectList::addToLayout(Layouting::LayoutItem &parent) parent.addItem(scrollArea); } +StringSelectionAspect::StringSelectionAspect(AspectContainer *container) + : TypedAspect<QString>(container) +{} + +QStandardItem *StringSelectionAspect::itemById(const QString &id) +{ + for (int i = 0; i < m_model->rowCount(); ++i) { + auto cur = m_model->item(i); + if (cur->data() == id) + return cur; + } + + return nullptr; +} + +void StringSelectionAspect::bufferToGui() +{ + if (!m_model) + return; + + auto selected = itemById(m_buffer); + if (selected) { + m_undoable.setSilently(selected->data().toString()); + m_selectionModel->setCurrentIndex(selected->index(), + QItemSelectionModel::SelectionFlag::ClearAndSelect); + return; + } + + if (m_model->rowCount() > 0) { + m_undoable.setSilently(m_model->item(0)->data().toString()); + m_selectionModel->setCurrentIndex(m_model->item(0)->index(), + QItemSelectionModel::SelectionFlag::ClearAndSelect); + } else { + m_selectionModel->setCurrentIndex(QModelIndex(), QItemSelectionModel::SelectionFlag::Clear); + } + handleGuiChanged(); +} + +bool StringSelectionAspect::guiToBuffer() +{ + if (!m_model) + return false; + + auto oldBuffer = m_buffer; + + m_buffer = m_undoable.get(); + + return oldBuffer != m_buffer; +} + +void StringSelectionAspect::addToLayout(Layouting::LayoutItem &parent) +{ + QTC_ASSERT(m_fillCallback, return); + + auto cb = [this](const QList<QStandardItem *> &items) { + m_model->clear(); + for (QStandardItem *item : items) + m_model->appendRow(item); + + bufferToGui(); + }; + + if (!m_model) { + m_model = new QStandardItemModel(this); + m_selectionModel = new QItemSelectionModel(m_model); + + connect(this, &StringSelectionAspect::refillRequested, this, [this, cb] { + m_fillCallback(cb); + }); + + m_fillCallback(cb); + } + + QComboBox *comboBox = new QComboBox(); + comboBox->setInsertPolicy(QComboBox::InsertPolicy::NoInsert); + comboBox->setEditable(true); + comboBox->completer()->setCompletionMode(QCompleter::PopupCompletion); + comboBox->completer()->setFilterMode(Qt::MatchContains); + + comboBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon); + comboBox->setCurrentText(value()); + comboBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); + + comboBox->setModel(m_model); + + connect(m_selectionModel, + &QItemSelectionModel::currentChanged, + comboBox, + [comboBox](QModelIndex currentIdx) { + if (currentIdx.isValid() && comboBox->currentIndex() != currentIdx.row()) + comboBox->setCurrentIndex(currentIdx.row()); + }); + + connect(comboBox, &QComboBox::activated, this, [this](int idx) { + QModelIndex modelIdx = m_model->index(idx, 0); + if (!modelIdx.isValid()) + return; + + QString newValue = m_model->index(idx, 0).data(Qt::UserRole + 1).toString(); + if (newValue.isEmpty()) + return; + + pushUndo(m_undoable.set(newValue)); + bufferToGui(); + }); + + connect(&m_undoable.m_signal, &UndoSignaller::changed, comboBox, [this, comboBox]() { + auto item = itemById(m_undoable.get()); + if (item) + m_selectionModel->setCurrentIndex(item->index(), QItemSelectionModel::ClearAndSelect); + else + comboBox->setCurrentText(m_undoable.get()); + + handleGuiChanged(); + }); + + if (m_selectionModel->currentIndex().isValid()) + comboBox->setCurrentIndex(m_selectionModel->currentIndex().row()); + + return addLabeledItem(parent, comboBox); +} + } // namespace Utils diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index fb1945b156e..46bea69bad1 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -21,9 +21,14 @@ QT_BEGIN_NAMESPACE class QAction; class QSettings; class QUndoStack; +class QStandardItem; +class QStandardItemModel; +class QItemSelectionModel; QT_END_NAMESPACE -namespace Layouting { class LayoutItem; } +namespace Layouting { +class LayoutItem; +} namespace Utils { @@ -1068,4 +1073,34 @@ private: std::unique_ptr<Internal::AspectListPrivate> d; }; +class QTCREATOR_UTILS_EXPORT StringSelectionAspect : public Utils::TypedAspect<QString> +{ + Q_OBJECT +public: + StringSelectionAspect(Utils::AspectContainer *container = nullptr); + + void addToLayout(Layouting::LayoutItem &parent) override; + + using ResultCallback = std::function<void(QList<QStandardItem *> items)>; + using FillCallback = std::function<void(ResultCallback)>; + void setFillCallback(FillCallback callback) { m_fillCallback = callback; } + + void refill() { emit refillRequested(); } + + void bufferToGui() override; + bool guiToBuffer() override; + +signals: + void refillRequested(); + +private: + QStandardItem *itemById(const QString &id); + + FillCallback m_fillCallback; + QStandardItemModel *m_model{nullptr}; + QItemSelectionModel *m_selectionModel{nullptr}; + + Utils::UndoableValue<QString> m_undoable; +}; + } // namespace Utils diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.cpp b/src/plugins/compilerexplorer/compilerexploreraspects.cpp index 71b4d45cb43..c9a965f2a92 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.cpp +++ b/src/plugins/compilerexplorer/compilerexploreraspects.cpp @@ -18,103 +18,6 @@ using namespace Utils; namespace CompilerExplorer { -StringSelectionAspect::StringSelectionAspect(AspectContainer *container) - : TypedAspect<QString>(container) -{} - -void StringSelectionAspect::bufferToGui() -{ - if (!m_model) - return; - - for (int i = 0; i < m_model->rowCount(); ++i) { - auto cur = m_model->item(i); - if (cur->data() == m_buffer) { - m_selectionModel->setCurrentIndex(cur->index(), - QItemSelectionModel::SelectionFlag::ClearAndSelect); - return; - } - } - if (m_model->rowCount() > 0) - m_selectionModel->setCurrentIndex(m_model->item(0)->index(), - QItemSelectionModel::SelectionFlag::ClearAndSelect); - else - m_selectionModel->setCurrentIndex(QModelIndex(), QItemSelectionModel::SelectionFlag::Clear); - - handleGuiChanged(); -} - -bool StringSelectionAspect::guiToBuffer() -{ - if (!m_model) - return false; - - auto oldBuffer = m_buffer; - - QModelIndex index = m_selectionModel->currentIndex(); - if (index.isValid()) - m_buffer = index.data(Qt::UserRole + 1).toString(); - else - m_buffer.clear(); - - return oldBuffer != m_buffer; -} - -void StringSelectionAspect::addToLayout(Layouting::LayoutItem &parent) -{ - QTC_ASSERT(m_fillCallback, return); - - auto cb = [this](const QList<QStandardItem *> &items) { - m_model->clear(); - for (QStandardItem *item : items) - m_model->appendRow(item); - - bufferToGui(); - }; - - if (!m_model) { - m_model = new QStandardItemModel(this); - m_selectionModel = new QItemSelectionModel(m_model); - - connect(this, &StringSelectionAspect::refillRequested, this, [this, cb] { - m_fillCallback(cb); - }); - - m_fillCallback(cb); - } - - QComboBox *comboBox = new QComboBox(); - comboBox->setInsertPolicy(QComboBox::InsertPolicy::NoInsert); - comboBox->setEditable(true); - comboBox->completer()->setCompletionMode(QCompleter::PopupCompletion); - comboBox->completer()->setFilterMode(Qt::MatchContains); - - comboBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon); - comboBox->setCurrentText(value()); - comboBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - - comboBox->setModel(m_model); - - connect(m_selectionModel, - &QItemSelectionModel::currentChanged, - comboBox, - [comboBox](QModelIndex currentIdx) { - if (currentIdx.isValid() && comboBox->currentIndex() != currentIdx.row()) - comboBox->setCurrentIndex(currentIdx.row()); - }); - - connect(comboBox, &QComboBox::activated, this, [this, comboBox] { - m_selectionModel->setCurrentIndex(m_model->index(comboBox->currentIndex(), 0), - QItemSelectionModel::SelectionFlag::ClearAndSelect); - handleGuiChanged(); - }); - - if (m_selectionModel->currentIndex().isValid()) - comboBox->setCurrentIndex(m_selectionModel->currentIndex().row()); - - return addLabeledItem(parent, comboBox); -} - LibrarySelectionAspect::LibrarySelectionAspect(AspectContainer *container) : TypedAspect<QMap<QString, QString>>(container) {} diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.h b/src/plugins/compilerexplorer/compilerexploreraspects.h index bb1e415f62f..64f91c1a418 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.h +++ b/src/plugins/compilerexplorer/compilerexploreraspects.h @@ -14,32 +14,6 @@ namespace CompilerExplorer { -class StringSelectionAspect : public Utils::TypedAspect<QString> -{ - Q_OBJECT -public: - StringSelectionAspect(Utils::AspectContainer *container = nullptr); - - void addToLayout(Layouting::LayoutItem &parent) override; - - using ResultCallback = std::function<void(QList<QStandardItem *> items)>; - using FillCallback = std::function<void(ResultCallback)>; - void setFillCallback(FillCallback callback) { m_fillCallback = callback; } - - void refill() { emit refillRequested(); } - - void bufferToGui() override; - bool guiToBuffer() override; - -signals: - void refillRequested(); - -private: - FillCallback m_fillCallback; - QStandardItemModel *m_model{nullptr}; - QItemSelectionModel *m_selectionModel{nullptr}; -}; - // QMap<Library.Id, Library.Version.Id> class LibrarySelectionAspect : public Utils::TypedAspect<QMap<QString, QString>> { diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp index d80d77aa5ed..adef327f80a 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.cpp +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -77,7 +77,7 @@ SourceSettings::SourceSettings(const ApiConfigFunction &apiConfigFunction) auto result = std::make_shared<CompilerSettings>(apiConfigFunction); connect(this, &SourceSettings::languagesChanged, result.get(), &CompilerSettings::refresh); connect(&languageId, - &StringSelectionAspect::changed, + &Utils::StringSelectionAspect::changed, result.get(), [this, result = result.get()] { result->setLanguageId(languageId()); }); @@ -176,7 +176,7 @@ void CompilerSettings::setLanguageId(const QString &languageId) compilerOptions.setValue(""); } -void CompilerSettings::fillLibraries(LibrarySelectionAspect::ResultCallback cb) +void CompilerSettings::fillLibraries(const LibrarySelectionAspect::ResultCallback &cb) { const QString lang = m_languageId; auto fillFromCache = [cb, lang] { @@ -212,7 +212,7 @@ void CompilerSettings::fillLibraries(LibrarySelectionAspect::ResultCallback cb) }); } -void SourceSettings::fillLanguageIdModel(StringSelectionAspect::ResultCallback cb) +void SourceSettings::fillLanguageIdModel(const Utils::StringSelectionAspect::ResultCallback &cb) { auto fillFromCache = [cb, this] { QList<QStandardItem *> items; @@ -254,7 +254,7 @@ void SourceSettings::fillLanguageIdModel(StringSelectionAspect::ResultCallback c }); } -void CompilerSettings::fillCompilerModel(StringSelectionAspect::ResultCallback cb) +void CompilerSettings::fillCompilerModel(const Utils::StringSelectionAspect::ResultCallback &cb) { auto fillFromCache = [cb](auto it) { QList<QStandardItem *> items; diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.h b/src/plugins/compilerexplorer/compilerexplorersettings.h index f4f3e2e5b60..05c2474cb43 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.h +++ b/src/plugins/compilerexplorer/compilerexplorersettings.h @@ -59,7 +59,7 @@ public: ApiConfigFunction apiConfigFunction() const { return m_apiConfigFunction; } public: - StringSelectionAspect languageId{this}; + Utils::StringSelectionAspect languageId{this}; Utils::StringAspect source{this}; Utils::AspectList compilers{this}; @@ -70,7 +70,7 @@ signals: void languagesChanged(); private: - void fillLanguageIdModel(StringSelectionAspect::ResultCallback cb); + void fillLanguageIdModel(const Utils::StringSelectionAspect::ResultCallback &cb); private: CompilerExplorerSettings *m_parent; @@ -82,7 +82,7 @@ class CompilerSettings : public Utils::AspectContainer public: CompilerSettings(const ApiConfigFunction &apiConfigFunction); - StringSelectionAspect compiler{this}; + Utils::StringSelectionAspect compiler{this}; Utils::StringAspect compilerOptions{this}; LibrarySelectionAspect libraries{this}; @@ -97,8 +97,8 @@ public: void setLanguageId(const QString &languageId); private: - void fillCompilerModel(StringSelectionAspect::ResultCallback cb); - void fillLibraries(LibrarySelectionAspect::ResultCallback cb); + void fillCompilerModel(const Utils::StringSelectionAspect::ResultCallback &cb); + void fillLibraries(const LibrarySelectionAspect::ResultCallback &cb); QString m_languageId; ApiConfigFunction m_apiConfigFunction; From f1fa1ad3d9f1dccdd57843e71e6c6c61d2b51c28 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 15 Sep 2023 13:20:52 +0200 Subject: [PATCH 1122/1777] CppEditor: Speed up findFilesInProject() This function had a number of serious performance problems. As it is executed by several quickfix factories, it could cause freezes on right- clicking a symbol. Measures taken: - Check file type before file path. - Do not collect all files in the project first, but filter earlier. - Check all candidate file names at once. In an example project, I observed a speed-up of factor ~100. Some FilePath-ification was done as well. Task-number: QTCREATORBUG-29611 Change-Id: Ic5dc48ffd86f22263d1caea4b6bfea5f49e589a4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/cppeditor/cppeditorplugin.cpp | 65 +++++++++++------------ 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 58822a5f71b..441e869e146 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -668,25 +668,20 @@ void CppEditorPlugin::setGlobalFileSettings(const CppFileSettings &settings) } #endif -static QStringList findFilesInProject(const QString &name, const Project *project) +static FilePaths findFilesInProject(const QStringList &names, const Project *project, + FileType fileType) { if (debug) - qDebug() << Q_FUNC_INFO << name << project; + qDebug() << Q_FUNC_INFO << names << project; if (!project) return {}; - QString pattern = QString(1, QLatin1Char('/')); - pattern += name; - const QStringList projectFiles - = transform(project->files(Project::AllFiles), &FilePath::toString); - const QStringList::const_iterator pcend = projectFiles.constEnd(); - QStringList candidateList; - for (QStringList::const_iterator it = projectFiles.constBegin(); it != pcend; ++it) { - if (it->endsWith(pattern, HostOsInfo::fileNameCaseSensitivity())) - candidateList.append(*it); - } - return candidateList; + const auto filter = [&](const Node *n) { + const auto fn = n->asFileNode(); + return fn && fn->fileType() == fileType && names.contains(fn->filePath().fileName()); + }; + return project->files(filter); } // Return the suffixes that should be checked when trying to find a @@ -778,30 +773,31 @@ static int commonFilePathLength(const QString &s1, const QString &s2) static FilePath correspondingHeaderOrSourceInProject(const QFileInfo &fileInfo, const QStringList &candidateFileNames, const Project *project, + FileType fileType, CacheUsage cacheUsage) { - QString bestFileName; - int compareValue = 0; const QString filePath = fileInfo.filePath(); - for (const QString &candidateFileName : candidateFileNames) { - const QStringList projectFiles = findFilesInProject(candidateFileName, project); - // Find the file having the most common path with fileName - for (const QString &projectFile : projectFiles) { - int value = commonFilePathLength(filePath, projectFile); - if (value > compareValue) { - compareValue = value; - bestFileName = projectFile; - } + const FilePaths projectFiles = findFilesInProject(candidateFileNames, project, fileType); + + // Find the file having the most common path with fileName + FilePath bestFilePath; + int compareValue = 0; + for (const FilePath &projectFile : projectFiles) { + int value = commonFilePathLength(filePath, projectFile.toString()); + if (value > compareValue) { + compareValue = value; + bestFilePath = projectFile; } } - if (!bestFileName.isEmpty()) { - const QFileInfo candidateFi(bestFileName); - QTC_ASSERT(candidateFi.isFile(), return {}); + if (!bestFilePath.isEmpty()) { + QTC_ASSERT(bestFilePath.isFile(), return {}); if (cacheUsage == CacheUsage::ReadWrite) { - m_headerSourceMapping[fileInfo.absoluteFilePath()] = candidateFi.absoluteFilePath(); - m_headerSourceMapping[candidateFi.absoluteFilePath()] = fileInfo.absoluteFilePath(); + m_headerSourceMapping[fileInfo.absoluteFilePath()] + = bestFilePath.absoluteFilePath().toString(); + m_headerSourceMapping[bestFilePath.absoluteFilePath().toString()] + = fileInfo.absoluteFilePath(); } - return FilePath::fromString(candidateFi.absoluteFilePath()); + return bestFilePath; } return {}; @@ -878,9 +874,10 @@ FilePath correspondingHeaderOrSource(const FilePath &filePath, bool *wasHeader, Project *currentProject = projectForFile; if (!projectForFile) currentProject = ProjectTree::currentProject(); + const FileType requestedFileType = isHeader ? FileType::Source : FileType::Header; if (currentProject) { - const FilePath path = correspondingHeaderOrSourceInProject(fi, candidateFileNames, - currentProject, cacheUsage); + const FilePath path = correspondingHeaderOrSourceInProject( + fi, candidateFileNames, currentProject, requestedFileType, cacheUsage); if (!path.isEmpty()) return path; @@ -892,8 +889,8 @@ FilePath correspondingHeaderOrSource(const FilePath &filePath, bool *wasHeader, if (project == currentProject) continue; // We have already checked the current project. - const FilePath path = correspondingHeaderOrSourceInProject(fi, candidateFileNames, - project, cacheUsage); + const FilePath path = correspondingHeaderOrSourceInProject( + fi, candidateFileNames, project, requestedFileType, cacheUsage); if (!path.isEmpty()) return path; } From 0b85fc5aa0a9dd9ab9d2bd702c11ee5816b87aa3 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Mon, 11 Sep 2023 08:58:51 +0200 Subject: [PATCH 1123/1777] ProjectExplorer: reduce the perceived startup time ... by moving restoreKits to the delayed initialize phase. Change-Id: If72e41b64ee71f2917b3f7a317d9887afc6e29e8 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../cmakeprojectmanager/cmakekitaspect.cpp | 12 ++++-- .../coreplugin/dialogs/settingsdialog.cpp | 10 +++++ src/plugins/debugger/debuggerplugin.cpp | 11 +++-- .../debugger/unstartedappwatcherdialog.cpp | 2 +- src/plugins/help/helpplugin.cpp | 9 ++++- src/plugins/projectexplorer/kitmanager.cpp | 40 ++++++++++++++++++- src/plugins/projectexplorer/kitmanager.h | 2 + .../projectexplorer/kitoptionspage.cpp | 10 +++-- src/plugins/projectexplorer/project.cpp | 10 ++++- .../projectexplorer/projectexplorer.cpp | 12 ++---- src/plugins/projectexplorer/projectexplorer.h | 2 +- .../projectexplorer/toolchainmanager.cpp | 5 +++ src/plugins/qtsupport/externaleditors.cpp | 4 ++ 13 files changed, 103 insertions(+), 26 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp index 19f7c463610..720d2e5f156 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp @@ -224,13 +224,19 @@ CMakeKitAspectFactory::CMakeKitAspectFactory() "This setting is ignored when using other build systems.")); setPriority(20000); + auto updateKits = [this] { + if (KitManager::isLoaded()) { + for (Kit *k : KitManager::kits()) + fix(k); + } + }; + //make sure the default value is set if a selected CMake is removed - connect(CMakeToolManager::instance(), &CMakeToolManager::cmakeRemoved, - this, [this] { for (Kit *k : KitManager::kits()) fix(k); }); + connect(CMakeToolManager::instance(), &CMakeToolManager::cmakeRemoved, this, updateKits); //make sure the default value is set if a new default CMake is set connect(CMakeToolManager::instance(), &CMakeToolManager::defaultCMakeChanged, - this, [this] { for (Kit *k : KitManager::kits()) fix(k); }); + this, updateKits); } Id CMakeKitAspect::id() diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 79cd816e368..9d610ddd135 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -37,6 +37,8 @@ #include <QStyle> #include <QStyledItemDelegate> +#include <extensionsystem/pluginmanager.h> + const int kInitialWidth = 750; const int kInitialHeight = 450; const int kMaxMinimumWidth = 250; @@ -800,6 +802,14 @@ bool SettingsDialog::execDialog() bool executeSettingsDialog(QWidget *parent, Id initialPage) { + if (!ExtensionSystem::PluginManager::isInitializationDone()) { + QObject::connect(ExtensionSystem::PluginManager::instance(), + &ExtensionSystem::PluginManager::initializationDone, + parent, + [parent, initialPage]() { executeSettingsDialog(parent, initialPage); }); + return false; + } + // Make sure all wizards are there when the user might access the keyboard shortcuts: (void) IWizardFactory::allWizardFactories(); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 04c78ca205c..f2c8c59de2f 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1316,6 +1316,9 @@ static Kit *guessKitFromAbis(const Abis &abis) { Kit *kit = nullptr; + if (!KitManager::waitForLoaded()) + return kit; + // Try to find a kit via ABI. if (!abis.isEmpty()) { // Try exact abis. @@ -1376,9 +1379,11 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, return false; } } else if (key == "kit") { - kit = KitManager::kit(Id::fromString(val)); - if (!kit) - kit = KitManager::kit(Utils::equal(&Kit::displayName, val)); + if (KitManager::waitForLoaded()) { + kit = KitManager::kit(Id::fromString(val)); + if (!kit) + kit = KitManager::kit(Utils::equal(&Kit::displayName, val)); + } } else if (key == "server") { startMode = AttachToRemoteServer; remoteChannel = val; diff --git a/src/plugins/debugger/unstartedappwatcherdialog.cpp b/src/plugins/debugger/unstartedappwatcherdialog.cpp index 95926afcbcf..e120571839e 100644 --- a/src/plugins/debugger/unstartedappwatcherdialog.cpp +++ b/src/plugins/debugger/unstartedappwatcherdialog.cpp @@ -84,7 +84,7 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent) if (kit) m_kitChooser->setCurrentKitId(kit->id()); - else if (KitManager::defaultKit()) + else if (KitManager::waitForLoaded() && KitManager::defaultKit()) m_kitChooser->setCurrentKitId(KitManager::defaultKit()->id()); auto pathLayout = new QHBoxLayout; diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 346b2858d22..2879d57dd5e 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -38,6 +38,8 @@ #include <extensionsystem/pluginmanager.h> +#include <projectexplorer/kitmanager.h> + #include <texteditor/texteditorconstants.h> #include <utils/algorithm.h> @@ -283,7 +285,12 @@ void HelpPlugin::extensionsInitialized() bool HelpPlugin::delayedInitialize() { - HelpManager::setupHelpManager(); + if (ProjectExplorer::KitManager::isLoaded()) { + HelpManager::setupHelpManager(); + } else { + connect(ProjectExplorer::KitManager::instance(), &ProjectExplorer::KitManager::kitsLoaded, + this, &HelpManager::setupHelpManager); + } return true; } diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 51529353e2e..d206234cbd1 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -13,6 +13,7 @@ #include "toolchainmanager.h" #include <coreplugin/icore.h> +#include <coreplugin/progressmanager/progressmanager.h> #include <android/androidconstants.h> #include <baremetal/baremetalconstants.h> @@ -421,10 +422,10 @@ void KitManager::restoreKits() if (!k) k = Utils::findOrDefault(resultList, &Kit::isValid); std::swap(resultList, d->m_kitList); + d->m_initialized = true; setDefaultKit(k); d->m_writer = std::make_unique<PersistentSettingsWriter>(settingsFileName(), "QtCreatorProfiles"); - d->m_initialized = true; kitAspectFactoriesStorage().onKitsLoaded(); @@ -467,6 +468,33 @@ bool KitManager::isLoaded() return d->m_initialized; } +bool KitManager::waitForLoaded(const int timeout) +{ + if (isLoaded()) + return true; + showLoadingProgress(); + QElapsedTimer timer; + timer.start(); + while (!isLoaded() && !timer.hasExpired(timeout)) + QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); + return KitManager::isLoaded(); +} + +void KitManager::showLoadingProgress() +{ + if (isLoaded()) + return; + static QFutureInterface<void> futureInterface; + if (futureInterface.isRunning()) + return; + futureInterface.reportStarted(); + Core::ProgressManager::addTimedTask(futureInterface.future(), + Tr::tr("Loading Kits"), + "LoadingKitsProgress", + 5); + connect(instance(), &KitManager::kitsLoaded, []() { futureInterface.reportFinished(); }); +} + void KitManager::setBinaryForKit(const FilePath &binary) { QTC_ASSERT(d, return); @@ -475,6 +503,7 @@ void KitManager::setBinaryForKit(const FilePath &binary) const QList<Kit *> KitManager::sortedKits() { + QTC_ASSERT(KitManager::isLoaded(), return {}); // This method was added to delay the sorting of kits as long as possible. // Since the displayName can contain variables it can be costly (e.g. involve // calling executables to find version information, etc.) to call that @@ -548,6 +577,7 @@ static KitList restoreKitsHelper(const FilePath &fileName) const QList<Kit *> KitManager::kits() { + QTC_ASSERT(KitManager::isLoaded(), return {}); return Utils::toRawPointer<QList>(d->m_kitList); } @@ -556,6 +586,7 @@ Kit *KitManager::kit(Id id) if (!id.isValid()) return nullptr; + QTC_ASSERT(KitManager::isLoaded(), return {}); return Utils::findOrDefault(d->m_kitList, Utils::equal(&Kit::id, id)); } @@ -566,6 +597,7 @@ Kit *KitManager::kit(const Kit::Predicate &predicate) Kit *KitManager::defaultKit() { + QTC_ASSERT(KitManager::isLoaded(), return {}); return d->m_defaultKit; } @@ -597,7 +629,7 @@ void KitManager::notifyAboutUpdate(Kit *k) Kit *KitManager::registerKit(const std::function<void (Kit *)> &init, Utils::Id id) { - QTC_ASSERT(isLoaded(), return nullptr); + QTC_ASSERT(isLoaded(), return {}); auto k = std::make_unique<Kit>(id); QTC_ASSERT(k->id().isValid(), return nullptr); @@ -620,6 +652,8 @@ Kit *KitManager::registerKit(const std::function<void (Kit *)> &init, Utils::Id void KitManager::deregisterKit(Kit *k) { + QTC_ASSERT(KitManager::isLoaded(), return); + if (!k || !Utils::contains(d->m_kitList, k)) return; auto taken = Utils::take(d->m_kitList, k); @@ -632,6 +666,8 @@ void KitManager::deregisterKit(Kit *k) void KitManager::setDefaultKit(Kit *k) { + QTC_ASSERT(KitManager::isLoaded(), return); + if (defaultKit() == k) return; if (k && !Utils::contains(d->m_kitList, k)) diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index a71538cef9c..377f96498ce 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -155,6 +155,8 @@ public: static void saveKits(); static bool isLoaded(); + static bool waitForLoaded(const int timeout = 60 * 1000); // timeout in ms + static void showLoadingProgress(); signals: void kitAdded(ProjectExplorer::Kit *); diff --git a/src/plugins/projectexplorer/kitoptionspage.cpp b/src/plugins/projectexplorer/kitoptionspage.cpp index 14098e98320..62c119a46a2 100644 --- a/src/plugins/projectexplorer/kitoptionspage.cpp +++ b/src/plugins/projectexplorer/kitoptionspage.cpp @@ -197,6 +197,7 @@ signals: void kitStateChanged(); private: + void initializeFromKitManager(); void addKit(Kit *k); void updateKit(Kit *k); void removeKit(Kit *k); @@ -227,10 +228,11 @@ KitModel::KitModel(QBoxLayout *parentLayout, QObject *parent) rootItem()->appendChild(m_autoRoot); rootItem()->appendChild(m_manualRoot); - for (Kit *k : KitManager::sortedKits()) - addKit(k); - - changeDefaultKit(); + if (KitManager::isLoaded()) { + for (Kit *k : KitManager::sortedKits()) + addKit(k); + changeDefaultKit(); + } connect(KitManager::instance(), &KitManager::kitAdded, this, &KitModel::addKit); diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 52a4b8e0a61..4333680bb76 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -24,13 +24,13 @@ #include "toolchainmanager.h" #include "userfileaccessor.h" -#include <coreplugin/idocument.h> #include <coreplugin/documentmanager.h> +#include <coreplugin/editormanager/documentmodel.h> #include <coreplugin/icontext.h> #include <coreplugin/icore.h> +#include <coreplugin/idocument.h> #include <coreplugin/iversioncontrol.h> #include <coreplugin/vcsmanager.h> -#include <coreplugin/editormanager/documentmodel.h> #include <projectexplorer/buildmanager.h> #include <projectexplorer/kitmanager.h> @@ -643,6 +643,12 @@ void Project::saveSettings() Project::RestoreResult Project::restoreSettings(QString *errorMessage) { + if (!KitManager::waitForLoaded()) { + if (errorMessage) + *errorMessage = Tr::tr("Could not load kits in a reasonable amount of time."); + return RestoreResult::Error; + } + if (!d->m_accessor) d->m_accessor = std::make_unique<Internal::UserFileAccessor>(this); Store map(d->m_accessor->restoreSettings(ICore::dialogParent())); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 64229ce4ccc..c1f90598218 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2121,20 +2121,15 @@ void ProjectExplorerPlugin::extensionsInitialized() // Load devices immediately, as other plugins might want to use them DeviceManager::instance()->load(); - - // delay restoring kits until UI is shown for improved perceived startup performance - QTimer::singleShot(0, this, &ProjectExplorerPlugin::restoreKits); } -void ProjectExplorerPlugin::restoreKits() +bool ProjectExplorerPlugin::delayedInitialize() { NANOTRACE_SCOPE("ProjectExplorer", "ProjectExplorerPlugin::restoreKits"); ExtraAbi::load(); // Load this before Toolchains! ToolChainManager::restoreToolChains(); KitManager::restoreKits(); - // restoring startup session is supposed to be done as a result of ICore::coreOpened, - // and that is supposed to happen after restoring kits: - QTC_CHECK(!SessionManager::isStartupSessionRestored()); + return true; } void ProjectExplorerPluginPrivate::updateRunWithoutDeployMenu() @@ -2379,8 +2374,7 @@ ProjectExplorerPlugin::OpenProjectResult ProjectExplorerPlugin::openProjects(con dd->updateActions(); const bool switchToProjectsMode = Utils::anyOf(openedPro, &Project::needsConfiguration); - const bool switchToEditMode = Utils::allOf(openedPro, - [](Project *p) { return p->isEditModePreferred(); }); + const bool switchToEditMode = Utils::allOf(openedPro, &Project::isEditModePreferred); if (!openedPro.isEmpty()) { if (switchToProjectsMode) ModeManager::activateMode(Constants::MODE_SESSION); diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index 33dcbe2ad17..eec4fae8601 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -106,7 +106,7 @@ public: //PluginInterface bool initialize(const QStringList &arguments, QString *errorMessage) override; void extensionsInitialized() override; - void restoreKits(); + bool delayedInitialize() override; ShutdownFlag aboutToShutdown() override; static void setProjectExplorerSettings(const ProjectExplorerSettings &pes); diff --git a/src/plugins/projectexplorer/toolchainmanager.cpp b/src/plugins/projectexplorer/toolchainmanager.cpp index dd14b827468..3c90d590a39 100644 --- a/src/plugins/projectexplorer/toolchainmanager.cpp +++ b/src/plugins/projectexplorer/toolchainmanager.cpp @@ -129,6 +129,7 @@ void ToolChainManager::saveToolChains() const Toolchains &ToolChainManager::toolchains() { + QTC_CHECK(d->m_loaded); return d->m_toolChains; } @@ -140,11 +141,13 @@ Toolchains ToolChainManager::toolchains(const ToolChain::Predicate &predicate) ToolChain *ToolChainManager::toolChain(const ToolChain::Predicate &predicate) { + QTC_CHECK(d->m_loaded); return Utils::findOrDefault(d->m_toolChains, predicate); } Toolchains ToolChainManager::findToolChains(const Abi &abi) { + QTC_CHECK(d->m_loaded); Toolchains result; for (ToolChain *tc : std::as_const(d->m_toolChains)) { bool isCompatible = Utils::anyOf(tc->supportedAbis(), [abi](const Abi &supportedAbi) { @@ -159,6 +162,7 @@ Toolchains ToolChainManager::findToolChains(const Abi &abi) ToolChain *ToolChainManager::findToolChain(const QByteArray &id) { + QTC_CHECK(d->m_loaded); if (id.isEmpty()) return nullptr; @@ -214,6 +218,7 @@ bool ToolChainManager::registerToolChain(ToolChain *tc) void ToolChainManager::deregisterToolChain(ToolChain *tc) { + QTC_CHECK(d->m_loaded); if (!tc || !d->m_toolChains.contains(tc)) return; d->m_toolChains.removeOne(tc); diff --git a/src/plugins/qtsupport/externaleditors.cpp b/src/plugins/qtsupport/externaleditors.cpp index 257347fa6bd..36abc53dbdf 100644 --- a/src/plugins/qtsupport/externaleditors.cpp +++ b/src/plugins/qtsupport/externaleditors.cpp @@ -179,6 +179,10 @@ static bool getEditorLaunchData(const CommandForQtVersion &commandForQtVersion, // - default kit // - any other kit // As fallback check PATH + if (!KitManager::waitForLoaded()) { + *errorMessage = Tr::tr("Could not load kits in a reasonable amount of time."); + return false; + } data->workingDirectory.clear(); QVector<QtSupport::QtVersion *> qtVersionsToCheck; // deduplicated after being filled if (const Project *project = ProjectManager::projectForFile(filePath)) { From 85cba79cd265788f75a0af000bb9a39a4c2f8597 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 15 Sep 2023 14:10:08 +0200 Subject: [PATCH 1124/1777] ClangCodeModel: fix setting refactoring markers for clangd LanguageClient::updateCodeActionRefactoringMarker overwrites previously set refactoring markers. Fixes: QTCREATORBUG-29493 Change-Id: I156b4e2ff65aed5928251bfea184e093df686818 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/clangcodemodel/clangdclient.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 7c40086f09c..6827471eb2e 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -628,13 +628,14 @@ void ClangdClient::handleDiagnostics(const PublishDiagnosticsParams ¶ms) const int docVersion = documentVersion(uri); if (params.version().value_or(docVersion) != docVersion) return; + QList<CodeAction> allCodeActions; for (const Diagnostic &diagnostic : params.diagnostics()) { const ClangdDiagnostic clangdDiagnostic(diagnostic); auto codeActions = clangdDiagnostic.codeActions(); if (codeActions && !codeActions->isEmpty()) { for (CodeAction &action : *codeActions) action.setDiagnostics({diagnostic}); - LanguageClient::updateCodeActionRefactoringMarker(this, *codeActions, uri); + allCodeActions << *codeActions; } else { // We know that there's only one kind of diagnostic for which clangd has // a quickfix tweak, so let's not be wasteful. @@ -644,6 +645,8 @@ void ClangdClient::handleDiagnostics(const PublishDiagnosticsParams ¶ms) requestCodeActions(uri, diagnostic); } } + if (!allCodeActions.isEmpty()) + LanguageClient::updateCodeActionRefactoringMarker(this, allCodeActions, uri); } void ClangdClient::handleDocumentOpened(TextDocument *doc) From 5109b0ce0e80974308fb3d030cdd4f4bdd12c2bf Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 15 Sep 2023 09:17:04 +0200 Subject: [PATCH 1125/1777] Docker: Fix default device name Change-Id: I1d7e8dd62a11cf897ebb22389f21370c8a3811cf Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/docker/dockerdevice.cpp | 18 +++++++++++++----- src/plugins/docker/dockerdevice.h | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index ea6f27e3529..ef90a78b582 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -139,10 +139,21 @@ public: DockerDevicePrivate *m_dev = nullptr; }; +void DockerDeviceSettings::fromMap(const Store &map) +{ + DeviceSettings::fromMap(map); + + // This is the only place where we can correctly set the default name. + // Only here do we know the image id and the repo reliably, no matter + // where or how we were created. + if (displayName.value() == displayName.defaultValue()) { + displayName.setDefaultValue( + Tr::tr("Docker Image \"%1\" (%2)").arg(repoAndTag()).arg(imageId.value())); + } +} + DockerDeviceSettings::DockerDeviceSettings() { - displayName.setDefaultValue(Tr::tr("Docker Image")); - imageId.setSettingsKey(DockerDeviceDataImageIdKey); imageId.setLabelText(Tr::tr("Image ID:")); imageId.setReadOnly(true); @@ -505,9 +516,6 @@ DockerDevice::DockerDevice(std::unique_ptr<DockerDeviceSettings> deviceSettings) setupId(IDevice::ManuallyAdded); setType(Constants::DOCKER_DEVICE_TYPE); setMachineType(IDevice::Hardware); - d->deviceSettings->displayName.setDefaultValue(Tr::tr("Docker Image \"%1\" (%2)") - .arg(d->deviceSettings->repoAndTag()) - .arg(d->deviceSettings->imageId())); setAllowEmptyCommand(true); setOpenTerminal([this](const Environment &env, const FilePath &workingDir) { diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index e910031c619..c38a7746dbd 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -19,6 +19,8 @@ class DockerDeviceSettings : public ProjectExplorer::DeviceSettings public: DockerDeviceSettings(); + void fromMap(const Utils::Store &map) override; + QString repoAndTag() const; QString repoAndTagEncoded() const; From 6cc11b21c5140ccf00b890e261718092c758a88b Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 2 Aug 2023 14:44:33 +0200 Subject: [PATCH 1126/1777] German translation: Squish Change-Id: If4a4be5a308d842a7441e054ed6028011f4aeb84 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- share/qtcreator/translations/qtcreator_de.ts | 385 ++++++++++--------- 1 file changed, 203 insertions(+), 182 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 396fa4ac6f6..2e42854e4fc 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -48677,655 +48677,664 @@ Zeile: %4, Spalte: %5 <name>QtC::Squish</name> <message> <source>Details</source> - <translation type="unfinished">Details</translation> + <translation>Details</translation> </message> <message> <source>Adjust references to the removed symbolic name to point to:</source> - <translation type="unfinished"></translation> + <translation>Referenzen zum entfernten symbolischen Namen ändern auf:</translation> </message> <message> <source>Remove the symbolic name (invalidates names referencing it)</source> - <translation type="unfinished"></translation> + <translation>Symbolischen Namen entfernen (macht darauf referenzierende Namen ungültig)</translation> </message> <message> <source>Remove the symbolic name and all names referencing it</source> - <translation type="unfinished"></translation> + <translation>Symbolischen Namen und alle darauf referenzierende Namen entfernen</translation> </message> <message> <source>The Symbolic Name <span style='white-space: nowrap'>"%1"</span> you want to remove is used in Multi Property Names. Select the action to apply to references in these Multi Property Names.</source> - <translation type="unfinished"></translation> + <translation>Der symbolische Name <span style='white-space: nowrap'>"%1"</span>, den Sie entfernen wollen, wird in Multi-Property-Namen benutzt. Wählen Sie die Aktion, die Sie auf Referenzen in diesen Multi-Property-Namen anwenden wollen.</translation> </message> <message> <source>Failed to write "%1"</source> - <translation type="unfinished"></translation> + <translation>"%1" konnte nicht geschrieben werden</translation> </message> <message> <source>Incomplete Squish settings. Missing Squish installation path.</source> - <translation type="unfinished"></translation> + <translation>Unvollständige Squish-Einstellungen. Das Installationsverzeichnis von Squish fehlt.</translation> </message> <message> <source>objectmaptool not found.</source> - <translation type="unfinished"></translation> + <translation>"objectmaptool" wurde nicht gefunden.</translation> </message> <message> <source>Failure while parsing objects.map content.</source> - <translation type="unfinished"></translation> + <translation>Fehler beim Auswerten von objects.map.</translation> </message> <message> <source>Squish Object Map Editor</source> - <translation type="unfinished"></translation> + <translation>Squish Object-Map-Editor</translation> </message> <message> <source>New</source> - <translation type="unfinished">Neu</translation> + <translation>Neu</translation> </message> <message> <source>Remove</source> - <translation type="unfinished"></translation> + <translation>Entfernen</translation> </message> <message> <source>Jump to Symbolic Name</source> - <translation type="unfinished"></translation> + <translation>Gehe zu symbolischem Namen</translation> </message> <message> <source>Symbolic Names</source> - <translation type="unfinished"></translation> + <translation>Symbolische Namen</translation> </message> <message> <source>Cut</source> - <translation type="unfinished">Ausschneiden</translation> + <translation>Ausschneiden</translation> </message> <message> <source>Copy</source> - <translation type="unfinished">Kopieren</translation> + <translation>Kopieren</translation> </message> <message> <source>Paste</source> - <translation type="unfinished">Einfügen</translation> + <translation>Einfügen</translation> </message> <message> <source>Delete</source> - <translation type="unfinished"></translation> + <translation>Löschen</translation> </message> <message> <source>Copy Real Name</source> - <translation type="unfinished"></translation> + <translation>Tatsächlichen Namen kopieren</translation> </message> <message> <source>Properties:</source> - <translation type="unfinished">Eigenschaften:</translation> + <translation>Eigenschaften:</translation> </message> <message> <source>The properties of the Multi Property Name associated with the selected Symbolic Name. (use \\ for a literal \ in the value)</source> - <translation type="unfinished"></translation> + <translation>Die Eigenschaften des Multi-Property-Namens, der mit dem ausgewählten symbolischen Namen assoziiert ist. (Benutzen Sie \\ für ein \-Literal im Wert)</translation> </message> <message> <source>The Hierarchical Name associated with the selected Symbolic Name.</source> - <translation type="unfinished"></translation> + <translation>Der hierarchische Name, der mit dem ausgewählten symbolischen Namen assoziiert ist.</translation> </message> <message> <source>Remove Symbolic Name</source> - <translation type="unfinished"></translation> + <translation>Symbolischen Namen entfernen</translation> </message> <message> <source>Do you really want to remove "%1"?</source> - <translation type="unfinished"></translation> + <translation>Möchten Sie "%1" wirklich entfernen?</translation> </message> <message> <source>Ambiguous Property Name</source> - <translation type="unfinished"></translation> + <translation>Mehrdeutiger Eigenschaftsname</translation> </message> <message> <source>Ambiguous Symbolic Name</source> - <translation type="unfinished"></translation> + <translation>Mehrdeutiger symbolischer Name</translation> </message> <message> <source>%1 "%2" already exists. Specify a unique name.</source> - <translation type="unfinished"></translation> + <translation>%1 "%2" existiert bereits. Geben Sie einen eindeutigen Namen an.</translation> </message> <message> <source>Property</source> - <translation type="unfinished">Eigenschaft</translation> + <translation>Eigenschaft</translation> </message> <message> <source>Symbolic Name</source> - <translation type="unfinished"></translation> + <translation>Symbolischer Name</translation> </message> <message> <source>CopyOf</source> - <translation type="unfinished"></translation> + <translatorcomment>Prefix for copies of a name</translatorcomment> + <translation>KopieVon</translation> </message> <message> <source>Open Squish Test Suites</source> - <translation type="unfinished"></translation> + <translation>Squish Test-Suites öffnen</translation> </message> <message> <source>Select All</source> - <translation type="unfinished"></translation> + <translation>Alle auswählen</translation> </message> <message> <source>Deselect All</source> - <translation type="unfinished">Alles abwählen</translation> + <translation>Alle abwählen</translation> </message> <message> <source>Base directory:</source> - <translation type="unfinished"></translation> + <translation>Basisverzeichnis:</translation> </message> <message> <source>Test suites:</source> - <translation type="unfinished"></translation> + <translation>Test-Suites:</translation> </message> <message> <source>Name</source> - <translation type="unfinished">Name</translation> + <translation>Name</translation> </message> <message> <source>Operator</source> - <translation type="unfinished">Operator</translation> + <translation>Operator</translation> </message> <message> <source>Value</source> - <translation type="unfinished">Wert</translation> + <translation>Wert</translation> </message> <message> <source>Application:</source> - <translation type="unfinished"></translation> + <translation>Anwendung:</translation> </message> <message> <source><No Application></source> - <translation type="unfinished"></translation> + <translation><Keine Anwendung></translation> </message> <message> <source>Arguments:</source> - <translation type="unfinished">Argumente:</translation> + <translation>Argumente:</translation> </message> <message> <source>Recording Settings</source> - <translation type="unfinished"></translation> + <translation>Aufnahme-Einstellungen</translation> </message> <message> <source>Suite Already Open</source> - <translation type="unfinished"></translation> + <translation>Suite bereits geöffnet</translation> </message> <message> <source>A test suite with the name "%1" is already open. Close the opened test suite and replace it with the new one?</source> - <translation type="unfinished"></translation> + <translation>Eine Test-Suite mit dem Namen "%1" ist bereits geöffnet. +Möchten Sie die Test-Suite schließen und mit der neuen ersetzen?</translation> </message> <message> <source>Confirm Delete</source> - <translation type="unfinished">Löschen Bestätigen</translation> + <translation>Löschen Bestätigen</translation> </message> <message> <source>Are you sure you want to delete Test Case "%1" from the file system?</source> - <translation type="unfinished"></translation> + <translation>Möchten Sie den Testfall "%1" vom Dateisystem löschen?</translation> </message> <message> <source>Deletion of Test Case failed.</source> - <translation type="unfinished"></translation> + <translation>Löschen des Testfalls fehlgeschlagen.</translation> </message> <message> <source>Test Suite Path Not Accessible</source> - <translation type="unfinished"></translation> + <translation>Pfad der Test-Suite nicht lesbar</translation> </message> <message> <source>The path "%1" does not exist or is not accessible. Refusing to run test case "%2".</source> - <translation type="unfinished"></translation> + <translation>Der Pfad "%1" existiert nicht oder ist nicht lesbar. +Testfall "%2" wird nicht ausgeführt.</translation> </message> <message> <source>The path "%1" does not exist or is not accessible. Refusing to run test cases.</source> - <translation type="unfinished"></translation> + <translation>Der Pfad "%1" existiert nicht oder ist nicht lesbar. +Testfälle werden nicht ausgeführt.</translation> </message> <message> <source>No Test Cases Defined</source> - <translation type="unfinished"></translation> + <translation>Kein Testfall definiert</translation> </message> <message> <source>Test suite "%1" does not contain any test cases.</source> - <translation type="unfinished"></translation> + <translation>Test-Suite "%1" enthält keine Testfälle.</translation> </message> <message> <source>The path "%1" does not exist or is not accessible. Refusing to record test case "%2".</source> - <translation type="unfinished"></translation> + <translation>Der Pfad "%1" existiert nicht oder ist nicht lesbar. +Testfall "%2" wird nicht aufgezeichnet.</translation> </message> <message> <source>Select Global Script Folder</source> - <translation type="unfinished"></translation> + <translation>Globales Script-Verzeichnis auswählen</translation> </message> <message> <source>Error</source> - <translation type="unfinished">Fehler</translation> + <translation>Fehler</translation> </message> <message> <source>Squish Tools in unexpected state (%1).</source> - <translation type="unfinished"></translation> + <translation>Squish-Werkzeuge sind in unerwartetem Zustand (%1).</translation> </message> <message> <source>Failed to open objects.map file at "%1".</source> - <translation type="unfinished"></translation> + <translation>Die "objects.map"-Datei "%1" konnte nicht geöffnet werden.</translation> </message> <message> <source>Squish</source> - <translation type="unfinished"></translation> + <translation>Squish</translation> </message> <message> <source>Run This Test Case</source> - <translation type="unfinished"></translation> + <translation>Diesen Testfall ausführen</translation> </message> <message> <source>Delete Test Case</source> - <translation type="unfinished"></translation> + <translation>Testfall löschen</translation> </message> <message> <source>Run This Test Suite</source> - <translation type="unfinished"></translation> + <translation>Diese Test-Suite ausführen</translation> </message> <message> <source>Add New Test Case...</source> - <translation type="unfinished"></translation> + <translation>Neuen Testfall hinzufügen...</translation> </message> <message> <source>Close Test Suite</source> - <translation type="unfinished"></translation> + <translation>Test-Suite schließen</translation> </message> <message> <source>Delete Shared File</source> - <translation type="unfinished"></translation> + <translation>Gemeinsame Datei löschen</translation> </message> <message> <source>Add Shared File</source> - <translation type="unfinished"></translation> + <translation>Gemeinsame Datei hinzufügen</translation> </message> <message> <source>Remove Shared Folder</source> - <translation type="unfinished"></translation> + <translation>Gemeinsames Verzeichnis löschen</translation> </message> <message> <source>Open Squish Suites...</source> - <translation type="unfinished"></translation> + <translation>Squish-Suites öffnen...</translation> </message> <message> <source>Create New Test Suite...</source> - <translation type="unfinished"></translation> + <translation>Neue Test-Suite erstellen...</translation> </message> <message> <source>Close All Test Suites</source> - <translation type="unfinished"></translation> + <translation>Alle Test-Suites schließen</translation> </message> <message> <source>Close all test suites?</source> - <translation type="unfinished"></translation> + <translation>Alle Test-Suites schließen?</translation> </message> <message> <source>Add Shared Folder...</source> - <translation type="unfinished"></translation> + <translation>Gemeinsames Verzeichnis hinzufügen...</translation> </message> <message> <source>Remove All Shared Folders</source> - <translation type="unfinished"></translation> + <translation>Alle gemeinsamen Verzeichnisse entfernen</translation> </message> <message> <source>Test Suites</source> - <translation type="unfinished"></translation> + <translation>Test-Suites</translation> </message> <message> <source>Remove "%1" from the list of shared folders?</source> - <translation type="unfinished"></translation> + <translation>"%1" aus der Liste der gemeinsamen Verzeichnisse entfernen?</translation> </message> <message> <source>Remove all shared folders?</source> - <translation type="unfinished"></translation> + <translation>Alle gemeinsamen Verzeichnisse entfernen?</translation> </message> <message> <source>Record Test Case</source> - <translation type="unfinished"></translation> + <translation>Testfall aufnehmen</translation> </message> <message> <source>Do you want to record over the test case "%1"? The existing content will be overwritten by the recorded script.</source> - <translation type="unfinished"></translation> + <translation>Möchten Sie den Testfall "%1" neu aufnehmen? Der existierende Inhalt wird durch die Aufnahme überschrieben.</translation> </message> <message> <source>Set up a valid Squish path to be able to create a new test case. (Edit > Preferences > Squish)</source> - <translation type="unfinished"></translation> + <translation>Setzen Sie einen gültigen Pfad zu Squish, um einen neuen Testfall zu erstellen. +(Bearbeiten > Einstellungen > Squish)</translation> </message> <message> <source>Test Results</source> - <translation type="unfinished">Testergebnisse</translation> + <translation>Testergebnisse</translation> </message> <message> <source>Runner/Server Log</source> - <translation type="unfinished"></translation> + <translation>Runner/Server Log</translation> </message> <message> <source><b>Test summary:</b>&nbsp;&nbsp; %1 passes, %2 fails, %3 fatals, %4 errors, %5 warnings.</source> - <translation type="unfinished"></translation> + <translation><b>Zusammenfassung des Tests:</b>&nbsp;&nbsp; %1 bestanden, %2 durchgefallen, %3 fatal, %4 Fehler, %5 Warnungen.</translation> </message> <message> <source>Expand All</source> - <translation type="unfinished">Alle aufklappen</translation> + <translation>Alle aufklappen</translation> </message> <message> <source>Collapse All</source> - <translation type="unfinished">Alle einklappen</translation> + <translation>Alle einklappen</translation> </message> <message> <source>Filter Test Results</source> - <translation type="unfinished">Testergebnisse filtern</translation> + <translation>Testergebnisse filtern</translation> </message> <message> <source>Pass</source> - <translation type="unfinished">Bestanden</translation> + <translation>Bestanden</translation> </message> <message> <source>Fail</source> - <translation type="unfinished">Durchgefallen</translation> + <translation>Durchgefallen</translation> </message> <message> <source>Expected Fail</source> - <translation type="unfinished">Erwartetes Scheitern</translation> + <translation>Erwartet durchgefallen</translation> </message> <message> <source>Unexpected Pass</source> - <translation type="unfinished">Unerwartet bestanden</translation> + <translation>Unerwartet bestanden</translation> </message> <message> <source>Warning Messages</source> - <translation type="unfinished">Warnungsnachrichten</translation> + <translation>Warnungsnachrichten</translation> </message> <message> <source>Log Messages</source> - <translation type="unfinished"></translation> + <translation>Protokollnachrichten</translation> </message> <message> <source>Check All Filters</source> - <translation type="unfinished">Alle Filter auswählen</translation> + <translation>Alle Filter auswählen</translation> </message> <message> <source>Control Bar</source> - <translation type="unfinished"></translation> + <translation>Kontrollleiste</translation> </message> <message> <source>Stop Recording</source> - <translation type="unfinished">Aufnahme beenden</translation> + <translation>Aufnahme beenden</translation> </message> <message> <source>Ends the recording session, saving all commands to the script file.</source> - <translation type="unfinished"></translation> + <translation>Beendet die Aufnahmesitzung und speichert alle Kommandos in der Script-Datei.</translation> </message> <message> <source>Interrupt</source> - <translation type="unfinished">Anhalten</translation> + <translation>Anhalten</translation> </message> <message> <source>Step Into</source> - <translation type="unfinished">Einzelschritt herein</translation> + <translation>Einzelschritt herein</translation> </message> <message> <source>Step Over</source> - <translation type="unfinished">Einzelschritt über</translation> + <translation>Einzelschritt über</translation> </message> <message> <source>Step Out</source> - <translation type="unfinished">Einzelschritt heraus</translation> + <translation>Einzelschritt heraus</translation> </message> <message> <source>Inspect</source> - <translation type="unfinished"></translation> + <translation>Untersuchen</translation> </message> <message> <source>Type</source> - <translation type="unfinished">Typ</translation> + <translation>Typ</translation> </message> <message> <source>Squish Locals</source> - <translation type="unfinished"></translation> + <translation>Lokale Squish-Variablen</translation> </message> <message> <source>Object</source> - <translation type="unfinished"></translation> + <translation>Objekt</translation> </message> <message> <source>Squish Objects</source> - <translation type="unfinished"></translation> + <translation>Squish-Objekte</translation> </message> <message> <source>Squish Object Properties</source> - <translation type="unfinished"></translation> + <translation>Squish Objekteigenschaften</translation> </message> <message> <source>Continue</source> - <translation type="unfinished">Fortsetzen</translation> + <translation>Fortsetzen</translation> </message> <message> <source>&Squish</source> - <translation type="unfinished"></translation> + <translation>&Squish</translation> </message> <message> <source>&Server Settings...</source> - <translation type="unfinished"></translation> + <translation>&Servereinstellungen...</translation> </message> <message> <source>Result</source> - <translation type="unfinished">Ergebnis</translation> + <translation>Ergebnis</translation> </message> <message> <source>Message</source> - <translation type="unfinished"></translation> + <translation>Nachricht</translation> </message> <message> <source>Time</source> - <translation type="unfinished">Zeit</translation> + <translation>Zeit</translation> </message> <message> <source>Squish path:</source> - <translation type="unfinished"></translation> + <translation>Squish-Pfad:</translation> </message> <message> <source>Path to Squish installation</source> - <translation type="unfinished"></translation> + <translation>Pfad zur Squish-Installation</translation> </message> <message> <source>Path does not contain server executable at its default location.</source> - <translation type="unfinished"></translation> + <translation>Pfad enthält am Standardort keine ausführbare Serverdatei.</translation> </message> <message> <source>License path:</source> - <translation type="unfinished"></translation> + <translation>Lizenzpfad:</translation> </message> <message> <source>Local Server</source> - <translation type="unfinished"></translation> + <translation>Lokaler Server</translation> </message> <message> <source>Server host:</source> - <translation type="unfinished"></translation> + <translation>Server-Host:</translation> </message> <message> <source>Server Port</source> - <translation type="unfinished"></translation> + <translation>Server-Port</translation> </message> <message> <source>Verbose log</source> - <translation type="unfinished"></translation> + <translation>Ausführliches Protokoll</translation> </message> <message> <source>Minimize IDE</source> - <translation type="unfinished"></translation> + <translation>IDE minimieren</translation> </message> <message> <source>Minimize IDE automatically while running or recording test cases.</source> - <translation type="unfinished"></translation> + <translation>Minimiert die IDE automatisch, während Testfälle ausgeführt oder aufgenommen werden.</translation> </message> <message> <source>General</source> - <translation type="unfinished">Allgemein</translation> + <translation>Allgemein</translation> </message> <message> <source>Maximum startup time:</source> - <translation type="unfinished"></translation> + <translation>Maximale Anlaufzeit:</translation> </message> <message> <source>Specifies how many seconds Squish should wait for a reply from the AUT directly after starting it.</source> - <translation type="unfinished"></translation> + <translation>Legt fest, wie viele Sekunden Squish auf eine Antwort von der AUT direkt nach dessen Start wartet.</translation> </message> <message> <source>Maximum response time:</source> - <translation type="unfinished"></translation> + <translation>Maximale Antwortzeit:</translation> </message> <message> <source>Specifies how many seconds Squish should wait for a reply from the hooked up AUT before raising a timeout error.</source> - <translation type="unfinished"></translation> + <translation>Legt fest, wie viele Sekunden Squish auf eine Antwort von der angeschlossenen AUT wartet, bevor ein Zeitüberschreitungsfehler ausgelöst wird.</translation> </message> <message> <source>Maximum post-mortem wait time:</source> - <translation type="unfinished"></translation> + <translation>Maximale Post-Mortem-Wartezeit:</translation> </message> <message> <source>Specifies how many seconds Squish should wait after the the first AUT process has exited.</source> - <translation type="unfinished"></translation> + <translation>Legt fest, wie viele Sekunden Squish wartet, nachdem der erste AUT-Prozess beendet ist.</translation> </message> <message> <source>Animate mouse cursor:</source> - <translation type="unfinished"></translation> + <translation>Mauszeiger animieren:</translation> </message> <message> <source>Name:</source> - <translation type="unfinished">Name:</translation> + <translation>Name:</translation> </message> <message> <source>Host:</source> - <translation type="unfinished">Host:</translation> + <translation>Host:</translation> </message> <message> <source>Port:</source> - <translation type="unfinished">Port:</translation> + <translation>Port:</translation> </message> <message> <source>Add Attachable AUT</source> - <translation type="unfinished"></translation> + <translation>Anhängbare AUT hinzufügen</translation> </message> <message> <source>Add</source> - <translation type="unfinished">Hinzufügen</translation> + <translation>Hinzufügen</translation> </message> <message> <source>Edit</source> - <translation type="unfinished"></translation> + <translation>Bearbeiten</translation> </message> <message> <source>Mapped AUTs</source> - <translation type="unfinished"></translation> + <translation>Zugeordnete AUTs</translation> </message> <message> <source>AUT Paths</source> - <translation type="unfinished"></translation> + <translation>AUT-Pfade</translation> </message> <message> <source>Attachable AUTs</source> - <translation type="unfinished"></translation> + <translation>Anhängbare AUTs</translation> </message> <message> <source>Select Application to test</source> - <translation type="unfinished"></translation> + <translation>Wählen Sie die zu testende Anwendung</translation> </message> <message> <source>Select Application Path</source> - <translation type="unfinished"></translation> + <translation>Wählen Sie den Pfad zur Anwendung</translation> </message> <message> <source>Squish Server Settings</source> - <translation type="unfinished"></translation> + <translation>Squish-Servereinstellungen</translation> </message> <message> <source>Failed to write configuration changes. Squish server finished with process error %1.</source> - <translation type="unfinished"></translation> + <translation>Das Schreiben der Konfigurationsänderungen ist fehlgeschlagen. +Der Squish-Server wurde mit dem Fehler %1 beendet.</translation> </message> <message> <source>Run Test Suite</source> - <translation type="unfinished"></translation> + <translation>Test-Suite ausführen</translation> </message> <message> <source>Object Map</source> - <translation type="unfinished"></translation> + <translation>Object Map</translation> </message> <message> <source>Run Test Case</source> - <translation type="unfinished"></translation> + <translation>Testfall ausführen</translation> </message> <message> <source>Shared Folders</source> - <translation type="unfinished"></translation> + <translation>Gemeinsame Verzeichnisse</translation> </message> <message> <source>%1 (none)</source> - <translation type="unfinished">%1 (keine)</translation> + <translation>%1 (keine)</translation> </message> <message> <source>Could not create test results folder. Canceling test run.</source> - <translation type="unfinished"></translation> + <translation>Das Verzeichnis für die Testergebnisse konnte nicht erstellt werden. Testausführung wird abgebrochen.</translation> </message> <message> <source>Squish Server Error</source> - <translation type="unfinished"></translation> + <translation>Squish-Serverfehler</translation> </message> <message> <source>"%1" could not be found or is not executable. Check the settings.</source> - <translation type="unfinished"></translation> + <translation>"%1" konnte nicht gefunden werden oder ist nicht ausführbar. +Überprüfen Sie die Einstellungen.</translation> </message> <message> <source>Recording test case</source> - <translation type="unfinished"></translation> + <translation>Nehme Testfall auf</translation> </message> <message> <source>Could not get Squish license from server.</source> - <translation type="unfinished"></translation> + <translation>Die Lizenz konnte nicht vom Server abgerufen werden.</translation> </message> <message> <source>Test run finished.</source> - <translation type="unfinished"></translation> + <translation>Testausführung beendet.</translation> </message> <message> <source>Test record finished.</source> - <translation type="unfinished"></translation> + <translation>Testaufnahme beendet.</translation> </message> <message> <source>Squish could not find the AUT "%1" to start. Make sure it has been added as a Mapped AUT in the squishserver settings. (Tools > Squish > Server Settings...)</source> - <translation type="unfinished"></translation> + <translation>Squish konnte die zu startende AUT "%1" nicht finden. Stellen Sie sicher, dass sie in den Einstellungen des Squish-Servers als zugeordnete AUT hinzugefügt wurde. +(Extras > Squish > Servereinstellungen...)</translation> </message> <message> <source>Refusing to run a test case.</source> - <translation type="unfinished"></translation> + <translation>Ausführung des Testfalls verweigert.</translation> </message> <message> <source>Refusing to execute server query.</source> - <translation type="unfinished"></translation> + <translation>Ausführung einer Serveranfrage verweigert.</translation> </message> <message> <source>Refusing to record a test case.</source> - <translation type="unfinished"></translation> + <translation>Aufnahme eines Testfalls verweigert.</translation> </message> <message> <source>Refusing to write configuration changes.</source> - <translation type="unfinished"></translation> + <translation>Schreiben von Konfigurationsänderungen verweigert.</translation> </message> <message> <source>Running test case</source> - <translation type="unfinished"></translation> + <translation>Führe Testfall aus</translation> </message> <message> <source>User stop initiated.</source> - <translation type="unfinished"></translation> + <translation>Anhalten durch Benutzer angefordert.</translation> </message> <message> <source>Squish Server Already Running</source> - <translation type="unfinished"></translation> + <translation>Squish-Server läuft bereits</translation> </message> <message> <source>There is still an old Squish server instance running. @@ -49333,95 +49342,107 @@ This will cause problems later on. If you continue, the old instance will be terminated. Do you want to continue?</source> - <translation type="unfinished"></translation> + <translation>Es wird bereits eine alte Instanz des Squish-Servers ausgeführt. +Dies wird später zu Problemen führen. + +Wenn Sie den Vorgang fortsetzen, wird die alte Instanz beendet. +Wollen Sie fortfahren?</translation> </message> <message> <source>Unexpected state or request while starting Squish server. (state: %1, request: %2)</source> - <translation type="unfinished"></translation> + <translation>Unerwarteter Zustand oder Anfrage beim Starten des Squish-Servers. (Status: %1, Anfrage: %2)</translation> </message> <message> <source>No Squish Server</source> - <translation type="unfinished"></translation> + <translation>Kein Squish-Server</translation> </message> <message> <source>Squish server does not seem to be running. (state: %1, request: %2) Try again.</source> - <translation type="unfinished"></translation> + <translation>Der Squish-Server scheint nicht zu laufen. +(Status: %1, Anfrage: %2) +Versuchen Sie es erneut.</translation> </message> <message> <source>No Squish Server Port</source> - <translation type="unfinished"></translation> + <translation>Kein Squish-Serverport</translation> </message> <message> <source>Failed to get the server port. (state: %1, request: %2) Try again.</source> - <translation type="unfinished"></translation> + <translation>Der Serverport konnte nicht erhalten werden. +(Status: %1, Anfrage: %2) +Versuchen Sie es erneut.</translation> </message> <message> <source>Squish Runner Running</source> - <translation type="unfinished"></translation> + <translation>Squish-Runner läuft</translation> </message> <message> <source>Squish runner seems to be running already. (state: %1, request: %2) Wait until it has finished and try again.</source> - <translation type="unfinished"></translation> + <translation>Der Squish-Runner scheint bereits zu laufen. +(Status: %1, Anfrage: %2) +Warten Sie, bis er beendet ist, und versuchen Sie es dann erneut.</translation> </message> <message> <source>Squish Runner Error</source> - <translation type="unfinished"></translation> + <translation>Squish-Runner-Fehler</translation> </message> <message> <source>Squish runner failed to start within given timeframe.</source> - <translation type="unfinished"></translation> + <translation>Squish-Runner konnte im angegebenen Zeitrahmen nicht gestartet werden.</translation> </message> <message> <source>Create New Squish Test Suite</source> - <translation type="unfinished"></translation> + <translation>Neue Squish Test-Suite erstellen</translation> </message> <message> <source>Available GUI toolkits:</source> - <translation type="unfinished"></translation> + <translation>Verfügbare GUI-Toolkits:</translation> </message> <message> <source>Invalid Squish settings. Configure Squish installation path inside Preferences... > Squish > General to use this wizard.</source> - <translation type="unfinished"></translation> + <translation>Ungültige Squish-Einstellungen. Stellen Sie in Einstellungen... > Squish > Allgemein den Squish-Installationspfad ein, um diesen Assistenten zu benutzen.</translation> </message> <message> <source>Available languages:</source> - <translation type="unfinished"></translation> + <translation>Verfügbare Sprachen:</translation> </message> <message> <source><None></source> - <translation type="unfinished"><Kein></translation> + <translation><Kein></translation> </message> <message> <source>Key is not an object.</source> - <translation type="unfinished">Schlüssel ist kein Objekt.</translation> + <translation>Schlüssel ist kein Objekt.</translation> </message> <message> <source>Key 'mode' is not set.</source> - <translation type="unfinished"></translation> + <translation>Schlüssel 'mode' ist nicht gesetzt.</translation> </message> <message> <source>Unsupported mode:</source> - <translation type="unfinished"></translation> + <translation>Modus nicht unterstützt:</translation> </message> <message> <source>Could not merge results into single results.xml. Destination file "%1" already exists.</source> - <translation type="unfinished"></translation> + <translation>Die Ergebnisse konnten nicht in einer einzelnen 'results.xml'-Datei zusammengeführt werden. +Zieldatei "%1" existiert bereits.</translation> </message> <message> <source>Could not merge results into single results.xml. Failed to open file "%1"</source> - <translation type="unfinished"></translation> + <translation>Die Ergebnisse konnten nicht in einer einzelnen 'results.xml'-Datei zusammengeführt werden. +Die Datei "%1" konnte nicht geöffnet werden</translation> </message> <message> <source>Error while parsing first test result.</source> - <translation type="unfinished"></translation> + <translation>Fehler beim Auswerten des ersten Testergebnisses.</translation> </message> </context> <context> From e37bbb8e0357bde2b4708f2ed53e86799b8a88ad Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 15 Sep 2023 20:56:29 +0200 Subject: [PATCH 1127/1777] CMakePM: Show link for Ctrl + mouse for functions/macros in editor Amends 4d358ae337de27d04173bbe8d5d6f87a1ee055df Change-Id: I7f89a1c2e4a32ec8944995074d0198e960a9d798 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 7fd96fc8439..98e58da8815 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -210,8 +210,12 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, // Check if the symbols is a user defined function or macro const CMakeBuildSystem *cbs = static_cast<const CMakeBuildSystem *>(bs); - if (cbs->cmakeSymbolsHash().contains(buffer)) - return processLinkCallback(cbs->cmakeSymbolsHash().value(buffer)); + if (cbs->cmakeSymbolsHash().contains(buffer)) { + link = cbs->cmakeSymbolsHash().value(buffer); + link.linkTextStart = cursor.position() - column + beginPos + 1; + link.linkTextEnd = cursor.position() - column + endPos; + return processLinkCallback(link); + } } } // TODO: Resolve more variables From bd84337d33ae823885dadb208c78b2fdc1872bb2 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 18 Sep 2023 10:52:11 +0200 Subject: [PATCH 1128/1777] BuildManager: Remove unused variable Amends a140a930675dd3b7af5fbbc423dc2aa444512881 Change-Id: I9014e42727c498866d1bd170f4cf7594f11dcfbb Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/projectexplorer/buildmanager.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index f1a06df1f88..09b5bac90f2 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -770,7 +770,6 @@ bool BuildManager::buildQueueAppend(const QList<BuildItem> &items, const QString } QList<BuildStep *> connectedSteps; - int enabledCount = 0; for (const BuildItem &item : items) { BuildStep *buildStep = item.buildStep; connect(buildStep, &BuildStep::addTask, m_instance, &BuildManager::addToTaskWindow); @@ -778,7 +777,6 @@ bool BuildManager::buildQueueAppend(const QList<BuildItem> &items, const QString connectedSteps.append(buildStep); if (!item.enabled) continue; - ++enabledCount; if (!isBuilding(buildStep) && buildStep->init()) continue; From 9371afde4a0d7e189025aa8bd3565ca35c84ad8a Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 15 Sep 2023 14:09:06 +0200 Subject: [PATCH 1129/1777] CppEditor: More FilePath-ification in correspondingHeaderOrSource() Also, fix a double look-up in a map. Change-Id: I5ddddb509b0dadb52a227053ac968e049ab72826 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/cppeditor/cppeditorplugin.cpp | 46 +++++++++++------------ 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 441e869e146..3de7c9c083a 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -200,7 +200,7 @@ public: }; static CppEditorPlugin *m_instance = nullptr; -static QHash<QString, QString> m_headerSourceMapping; +static QHash<FilePath, FilePath> m_headerSourceMapping; CppEditorPlugin::CppEditorPlugin() { @@ -770,20 +770,19 @@ static int commonFilePathLength(const QString &s1, const QString &s2) return length; } -static FilePath correspondingHeaderOrSourceInProject(const QFileInfo &fileInfo, +static FilePath correspondingHeaderOrSourceInProject(const FilePath &filePath, const QStringList &candidateFileNames, const Project *project, FileType fileType, CacheUsage cacheUsage) { - const QString filePath = fileInfo.filePath(); const FilePaths projectFiles = findFilesInProject(candidateFileNames, project, fileType); // Find the file having the most common path with fileName FilePath bestFilePath; int compareValue = 0; for (const FilePath &projectFile : projectFiles) { - int value = commonFilePathLength(filePath, projectFile.toString()); + int value = commonFilePathLength(filePath.toString(), projectFile.toString()); if (value > compareValue) { compareValue = value; bestFilePath = projectFile; @@ -792,10 +791,8 @@ static FilePath correspondingHeaderOrSourceInProject(const QFileInfo &fileInfo, if (!bestFilePath.isEmpty()) { QTC_ASSERT(bestFilePath.isFile(), return {}); if (cacheUsage == CacheUsage::ReadWrite) { - m_headerSourceMapping[fileInfo.absoluteFilePath()] - = bestFilePath.absoluteFilePath().toString(); - m_headerSourceMapping[bestFilePath.absoluteFilePath().toString()] - = fileInfo.absoluteFilePath(); + m_headerSourceMapping[filePath] = bestFilePath; + m_headerSourceMapping[bestFilePath] = filePath; } return bestFilePath; } @@ -809,25 +806,25 @@ using namespace Internal; FilePath correspondingHeaderOrSource(const FilePath &filePath, bool *wasHeader, CacheUsage cacheUsage) { - const QString fileName = filePath.toString(); - const QFileInfo fi(fileName); - ProjectFile::Kind kind = ProjectFile::classify(fileName); + ProjectFile::Kind kind = ProjectFile::classify(filePath.fileName()); const bool isHeader = ProjectFile::isHeader(kind); if (wasHeader) *wasHeader = isHeader; - if (m_headerSourceMapping.contains(fi.absoluteFilePath())) - return FilePath::fromString(m_headerSourceMapping.value(fi.absoluteFilePath())); + if (const auto it = m_headerSourceMapping.constFind(filePath); + it != m_headerSourceMapping.constEnd()) { + return it.value(); + } Project * const projectForFile = ProjectManager::projectForFile(filePath); const CppFileSettings settings = CppEditorPlugin::fileSettings(projectForFile); if (debug) - qDebug() << Q_FUNC_INFO << fileName << kind; + qDebug() << Q_FUNC_INFO << filePath.fileName() << kind; if (kind == ProjectFile::Unsupported) return {}; - const QString baseName = fi.completeBaseName(); + const QString baseName = filePath.completeBaseName(); const QString privateHeaderSuffix = QLatin1String("_p"); const QStringList suffixes = matchingCandidateSuffixes(kind); @@ -844,7 +841,7 @@ FilePath correspondingHeaderOrSource(const FilePath &filePath, bool *wasHeader, candidateFileNames += baseNameWithAllSuffixes(privateHeaderBaseName, suffixes); } - const QDir absoluteDir = fi.absoluteDir(); + const QDir absoluteDir = filePath.toFileInfo().absoluteDir(); QStringList candidateDirs(absoluteDir.absolutePath()); // If directory is not root, try matching against its siblings const QStringList searchPaths = isHeader ? settings.sourceSearchPaths @@ -856,16 +853,15 @@ FilePath correspondingHeaderOrSource(const FilePath &filePath, bool *wasHeader, // Try to find a file in the same or sibling directories first for (const QString &candidateDir : std::as_const(candidateDirs)) { for (const QString &candidateFileName : std::as_const(candidateFileNames)) { - const QString candidateFilePath = candidateDir + QLatin1Char('/') + candidateFileName; - const QString normalized = FileUtils::normalizedPathName(candidateFilePath); - const QFileInfo candidateFi(normalized); - if (candidateFi.isFile()) { + const FilePath candidateFilePath + = FilePath::fromString(candidateDir + '/' + candidateFileName).normalizedPathName(); + if (candidateFilePath.isFile()) { if (cacheUsage == CacheUsage::ReadWrite) { - m_headerSourceMapping[fi.absoluteFilePath()] = candidateFi.absoluteFilePath(); + m_headerSourceMapping[filePath] = candidateFilePath; if (!isHeader || !baseName.endsWith(privateHeaderSuffix)) - m_headerSourceMapping[candidateFi.absoluteFilePath()] = fi.absoluteFilePath(); + m_headerSourceMapping[candidateFilePath] = filePath; } - return FilePath::fromString(candidateFi.absoluteFilePath()); + return candidateFilePath; } } } @@ -877,7 +873,7 @@ FilePath correspondingHeaderOrSource(const FilePath &filePath, bool *wasHeader, const FileType requestedFileType = isHeader ? FileType::Source : FileType::Header; if (currentProject) { const FilePath path = correspondingHeaderOrSourceInProject( - fi, candidateFileNames, currentProject, requestedFileType, cacheUsage); + filePath, candidateFileNames, currentProject, requestedFileType, cacheUsage); if (!path.isEmpty()) return path; @@ -890,7 +886,7 @@ FilePath correspondingHeaderOrSource(const FilePath &filePath, bool *wasHeader, continue; // We have already checked the current project. const FilePath path = correspondingHeaderOrSourceInProject( - fi, candidateFileNames, project, requestedFileType, cacheUsage); + filePath, candidateFileNames, project, requestedFileType, cacheUsage); if (!path.isEmpty()) return path; } From 116a51343e3249d1cf957a488986895bd38aa20f Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 15 Sep 2023 13:12:19 +0200 Subject: [PATCH 1130/1777] PluginManager: Do not allow user interaction during delayedInit The purpose of delayedInitialize is to have some UI that can show the main window and potentially progress information, but user interaction is not really supported during that phase, so prevent it. Instead of using a timer between different plugins during delayedInitialize, just give the event loop a chance to run. Change-Id: I1d67da228d6358103cf8073deed5275a7ace9f3a Reviewed-by: David Schulz <david.schulz@qt.io> --- src/libs/extensionsystem/pluginmanager.cpp | 55 ++++++++++------------ src/libs/extensionsystem/pluginmanager_p.h | 4 +- 2 files changed, 26 insertions(+), 33 deletions(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 116243ede39..9a04f1edbd2 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -938,35 +938,30 @@ PluginSpecPrivate *PluginManagerPrivate::privateSpec(PluginSpec *spec) return spec->d; } -void PluginManagerPrivate::nextDelayedInitialize() +void PluginManagerPrivate::startDelayedInitialize() { - static bool first = true; - if (first) { - first = false; - NANOTRACE_BEGIN("ExtensionSystem", "DelayedInitialize"); - } - while (!delayedInitializeQueue.empty()) { - PluginSpec *spec = delayedInitializeQueue.front(); - const std::string specName = spec->name().toStdString(); - delayedInitializeQueue.pop(); - NANOTRACE_SCOPE(specName, specName + "::delayedInitialized"); - profilingReport(">delayedInitialize", spec); - bool delay = spec->d->delayedInitialize(); - profilingReport("<delayedInitialize", spec, &spec->d->performanceData.delayedInitialize); - if (delay) - break; // do next delayedInitialize after a delay - } - if (delayedInitializeQueue.empty()) { + delayedInitializeTimer.reset(); + { + NANOTRACE_SCOPE("ExtensionSystem", "DelayedInitialize"); + while (!delayedInitializeQueue.empty()) { + PluginSpec *spec = delayedInitializeQueue.front(); + const std::string specName = spec->name().toStdString(); + delayedInitializeQueue.pop(); + NANOTRACE_SCOPE(specName, specName + "::delayedInitialized"); + profilingReport(">delayedInitialize", spec); + bool delay = spec->d->delayedInitialize(); + profilingReport("<delayedInitialize", spec, &spec->d->performanceData.delayedInitialize); + if (delay) // give UI a bit of breathing space, but prevent user interaction + QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); + } Utils::setMimeStartupPhase(MimeStartupPhase::UpAndRunning); m_isInitializationDone = true; - delete delayedInitializeTimer; - delayedInitializeTimer = nullptr; if (m_profileTimer) m_totalStartupMS = m_profileTimer->elapsed(); printProfilingSummary(); - NANOTRACE_END("ExtensionSystem", "DelayedInitialize"); - NANOTRACE_SHUTDOWN(); - emit q->initializationDone(); + } + NANOTRACE_SHUTDOWN(); + emit q->initializationDone(); #ifdef WITH_TESTS if (PluginManager::testRunRequested()) startTests(); @@ -979,9 +974,6 @@ void PluginManagerPrivate::nextDelayedInitialize() } } #endif - } else { - delayedInitializeTimer->start(); - } } /*! @@ -1045,8 +1037,7 @@ void PluginManagerPrivate::stopAll() m_isShuttingDown = true; if (delayedInitializeTimer && delayedInitializeTimer->isActive()) { delayedInitializeTimer->stop(); - delete delayedInitializeTimer; - delayedInitializeTimer = nullptr; + delayedInitializeTimer.reset(); } const QVector<PluginSpec *> queue = loadQueue(); @@ -1386,11 +1377,13 @@ void PluginManagerPrivate::loadPlugins() emit q->pluginsChanged(); Utils::setMimeStartupPhase(MimeStartupPhase::PluginsDelayedInitializing); - delayedInitializeTimer = new QTimer; + delayedInitializeTimer.reset(new QTimer); delayedInitializeTimer->setInterval(DELAYED_INITIALIZE_INTERVAL); delayedInitializeTimer->setSingleShot(true); - connect(delayedInitializeTimer, &QTimer::timeout, - this, &PluginManagerPrivate::nextDelayedInitialize); + connect(delayedInitializeTimer.get(), + &QTimer::timeout, + this, + &PluginManagerPrivate::startDelayedInitialize); delayedInitializeTimer->start(); } diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index a0ea60ed483..4b9a34b246d 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -99,7 +99,7 @@ public: QStringList disabledPlugins; QStringList forceEnabledPlugins; // delayed initialization - QTimer *delayedInitializeTimer = nullptr; + std::unique_ptr<QTimer> delayedInitializeTimer; std::queue<PluginSpec *> delayedInitializeQueue; // ansynchronous shutdown QSet<PluginSpec *> asynchronousPlugins; // plugins that have requested async shutdown @@ -143,7 +143,7 @@ public: private: PluginManager *q; - void nextDelayedInitialize(); + void startDelayedInitialize(); void readPluginPaths(); bool loadQueue(PluginSpec *spec, From 431583872acd5ed741e3f6f9e91ba857715e9588 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 15 Sep 2023 15:38:18 +0200 Subject: [PATCH 1131/1777] Session: Restore session/open files after initialization Only restore a session or file from the command line (or the setting) after initialization is completely done. Kit restoration moved to delayedInitialize, and before that we cannot sensibly open a session anyway. Change-Id: I73b984a8744729ea63af16b1f0161b49a2cd5d55 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/coreplugin/session.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/plugins/coreplugin/session.cpp b/src/plugins/coreplugin/session.cpp index 84481287214..f94afa97f9e 100644 --- a/src/plugins/coreplugin/session.cpp +++ b/src/plugins/coreplugin/session.cpp @@ -117,7 +117,9 @@ SessionManager::SessionManager() m_instance = this; d = new SessionManagerPrivate; - connect(ICore::instance(), &ICore::coreOpened, this, [] { d->restoreStartupSession(); }); + connect(PluginManager::instance(), &PluginManager::initializationDone, this, [] { + d->restoreStartupSession(); + }); connect(ModeManager::instance(), &ModeManager::currentModeChanged, this, &SessionManager::saveActiveMode); @@ -449,13 +451,10 @@ void SessionManagerPrivate::restoreStartupSession() : QString(), true); - // delay opening projects from the command line even more - QTimer::singleShot(0, m_instance, [arguments] { - ICore::openFiles(Utils::transform(arguments, &FilePath::fromUserInput), - ICore::OpenFilesFlags(ICore::CanContainLineAndColumnNumbers - | ICore::SwitchMode)); - emit m_instance->startupSessionRestored(); - }); + ICore::openFiles(Utils::transform(arguments, &FilePath::fromUserInput), + ICore::OpenFilesFlags(ICore::CanContainLineAndColumnNumbers + | ICore::SwitchMode)); + emit m_instance->startupSessionRestored(); } void SessionManagerPrivate::saveSettings() From e371cd23699546e05a4d677b0d1d5acff2627b39 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 15 Sep 2023 15:51:55 +0200 Subject: [PATCH 1132/1777] Make warning about using MIME database early stricter The MIME database should really only be used after the UI is shown, since initializing it takes time. Now that restoring sessions/files from the command line/settings is done after delayedInitialization, also warn if anyone uses the MIME database before the delayedInitialization really begins, which is after the UI is shown. Change-Id: I94b0e4bd9bd790a61befd3009851ea0530a25ab9 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/extensionsystem/pluginmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 9a04f1edbd2..5dda665d7f7 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -941,6 +941,7 @@ PluginSpecPrivate *PluginManagerPrivate::privateSpec(PluginSpec *spec) void PluginManagerPrivate::startDelayedInitialize() { delayedInitializeTimer.reset(); + Utils::setMimeStartupPhase(MimeStartupPhase::PluginsDelayedInitializing); { NANOTRACE_SCOPE("ExtensionSystem", "DelayedInitialize"); while (!delayedInitializeQueue.empty()) { @@ -1376,7 +1377,6 @@ void PluginManagerPrivate::loadPlugins() } emit q->pluginsChanged(); - Utils::setMimeStartupPhase(MimeStartupPhase::PluginsDelayedInitializing); delayedInitializeTimer.reset(new QTimer); delayedInitializeTimer->setInterval(DELAYED_INITIALIZE_INTERVAL); delayedInitializeTimer->setSingleShot(true); From 18372ca5535c0d625e96106bad6e319f6699ab80 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 14 Sep 2023 13:59:01 +0200 Subject: [PATCH 1133/1777] TextEditor: Do not make one-letter doxygen commands end a rewrap region In 8e118e9d5ec92cdfdb2fb70d2d7ef3690cf89232, we stopped re-wrapping in comments when a doxygen/qdoc command appeared at the start of the line. However, there are also "inline" commands such as \l and \c that can by chance appear on the start of a line and should not stop rewrapping. Since we are still quite reluctant to enumerate and categorize the countless doxygen/qdoc commands, let's just ignore all one-letter commands for rewrapping purposes. (Yes, this is another hacky heuristic.) Fixes: QTCREATORBUG-28761 Change-Id: I40d77706851ec24504d6fd8795906dd55249661d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/texteditor/texteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 7add698645d..de397c01b4c 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -7638,7 +7638,7 @@ void TextEditorWidget::rewrapParagraph() } // Find end of paragraph. - const QRegularExpression immovableDoxygenCommand(doxygenPrefix + "[@\\\\].*"); + const QRegularExpression immovableDoxygenCommand(doxygenPrefix + "[@\\\\][a-zA-Z]{2,}"); QTC_CHECK(immovableDoxygenCommand.isValid()); while (cursor.movePosition(QTextCursor::NextBlock, QTextCursor::KeepAnchor)) { QString text = cursor.block().text(); From 11c7cd0c9d9dffcca233e6f2c3f2217f6676f625 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 18 Sep 2023 08:54:48 +0200 Subject: [PATCH 1134/1777] Utils: Fix access after delete Change-Id: I8bd120e39de202618044c0812f423653b914f4bc Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/deviceshell.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/deviceshell.cpp b/src/libs/utils/deviceshell.cpp index 33461f128f3..4fd693b22a0 100644 --- a/src/libs/utils/deviceshell.cpp +++ b/src/libs/utils/deviceshell.cpp @@ -216,11 +216,13 @@ expected_str<void> DeviceShell::start() return {}; } else if (m_shellProcess->isRunning()) { m_shellProcess->kill(); - m_shellProcess.reset(); } + const QString stdErr = m_shellProcess->readAllStandardError(); + m_shellProcess.reset(); + return make_unexpected(Tr::tr("Failed to install shell script: %1\n%2") .arg(installResult.error()) - .arg(m_shellProcess->readAllStandardError())); + .arg(stdErr)); }, Qt::BlockingQueuedConnection, &result); From 409a4c972a01caa487a10cfd0997ab5d7ac0fbc5 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 13 Sep 2023 11:46:00 +0200 Subject: [PATCH 1135/1777] OutputPane: Use setter for display name Change-Id: I2e89fbd052330c9e7124272c2f2fa81a0db94de9 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/autotest/testresultspane.cpp | 6 +----- src/plugins/autotest/testresultspane.h | 1 - src/plugins/axivion/axivionoutputpane.cpp | 7 ++----- src/plugins/axivion/axivionoutputpane.h | 1 - .../coreplugin/find/searchresultwindow.cpp | 9 +-------- src/plugins/coreplugin/find/searchresultwindow.h | 1 - src/plugins/coreplugin/ioutputpane.cpp | 6 ------ src/plugins/coreplugin/ioutputpane.h | 5 ++++- src/plugins/coreplugin/messageoutputwindow.cpp | 6 +----- src/plugins/coreplugin/messageoutputwindow.h | 1 - src/plugins/coreplugin/outputpanemanager.cpp | 16 ++++++++++++++++ src/plugins/debugger/console/console.cpp | 6 +----- src/plugins/debugger/console/console.h | 1 - src/plugins/projectexplorer/appoutputpane.cpp | 6 +----- src/plugins/projectexplorer/appoutputpane.h | 1 - .../projectexplorer/compileoutputwindow.cpp | 1 + .../projectexplorer/compileoutputwindow.h | 2 -- src/plugins/projectexplorer/taskwindow.cpp | 6 +----- src/plugins/projectexplorer/taskwindow.h | 1 - src/plugins/serialterminal/serialoutputpane.cpp | 6 +----- src/plugins/serialterminal/serialoutputpane.h | 1 - src/plugins/squish/squishoutputpane.cpp | 6 +----- src/plugins/squish/squishoutputpane.h | 1 - src/plugins/terminal/terminalpane.cpp | 6 +----- src/plugins/terminal/terminalpane.h | 1 - src/plugins/todo/todooutputpane.cpp | 6 +----- src/plugins/todo/todooutputpane.h | 1 - src/plugins/vcsbase/vcsoutputwindow.cpp | 6 +----- src/plugins/vcsbase/vcsoutputwindow.h | 1 - 29 files changed, 34 insertions(+), 84 deletions(-) diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index 2b4cd99b3c8..90f675bc927 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -74,6 +74,7 @@ TestResultsPane::TestResultsPane(QObject *parent) : IOutputPane(parent), m_context(new IContext(this)) { + setDisplayName(Tr::tr("Test Results")); m_outputWidget = new QStackedWidget; QWidget *visualOutputWidget = new QWidget; m_outputWidget->addWidget(visualOutputWidget); @@ -274,11 +275,6 @@ QList<QWidget *> TestResultsPane::toolBarWidgets() const return result; } -QString TestResultsPane::displayName() const -{ - return Tr::tr("Test Results"); -} - int TestResultsPane::priorityInStatusBar() const { return -666; diff --git a/src/plugins/autotest/testresultspane.h b/src/plugins/autotest/testresultspane.h index 530b17c644c..7db699fc411 100644 --- a/src/plugins/autotest/testresultspane.h +++ b/src/plugins/autotest/testresultspane.h @@ -60,7 +60,6 @@ public: // IOutputPane interface QWidget *outputWidget(QWidget *parent) override; QList<QWidget *> toolBarWidgets() const override; - QString displayName() const override; int priorityInStatusBar() const override; void clearContents() override; void setFocus() override; diff --git a/src/plugins/axivion/axivionoutputpane.cpp b/src/plugins/axivion/axivionoutputpane.cpp index 8d33abba7b2..11937b2060d 100644 --- a/src/plugins/axivion/axivionoutputpane.cpp +++ b/src/plugins/axivion/axivionoutputpane.cpp @@ -170,6 +170,8 @@ void DashboardWidget::updateUi() AxivionOutputPane::AxivionOutputPane(QObject *parent) : Core::IOutputPane(parent) { + setDisplayName(Tr::tr("Axivion")); + m_outputWidget = new QStackedWidget; DashboardWidget *dashboardWidget = new DashboardWidget(m_outputWidget); m_outputWidget->addWidget(dashboardWidget); @@ -206,11 +208,6 @@ QList<QWidget *> AxivionOutputPane::toolBarWidgets() const return buttons; } -QString AxivionOutputPane::displayName() const -{ - return Tr::tr("Axivion"); -} - int AxivionOutputPane::priorityInStatusBar() const { return -1; diff --git a/src/plugins/axivion/axivionoutputpane.h b/src/plugins/axivion/axivionoutputpane.h index d11accc1401..f156ce3b54c 100644 --- a/src/plugins/axivion/axivionoutputpane.h +++ b/src/plugins/axivion/axivionoutputpane.h @@ -21,7 +21,6 @@ public: // IOutputPane interface QWidget *outputWidget(QWidget *parent) override; QList<QWidget *> toolBarWidgets() const override; - QString displayName() const override; int priorityInStatusBar() const override; void clearContents() override; void setFocus() override; diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp index 2f048f93f34..48ed8b875e9 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.cpp +++ b/src/plugins/coreplugin/find/searchresultwindow.cpp @@ -363,6 +363,7 @@ SearchResultWindow *SearchResultWindow::m_instance = nullptr; SearchResultWindow::SearchResultWindow(QWidget *newSearchPanel) : d(new SearchResultWindowPrivate(this, newSearchPanel)) { + setDisplayName(Tr::tr("Search Results")); m_instance = this; readSettings(); } @@ -709,14 +710,6 @@ bool SearchResultWindow::canNavigate() const return true; } -/*! - \internal -*/ -QString SearchResultWindow::displayName() const -{ - return Tr::tr("Search Results"); -} - /*! \internal */ diff --git a/src/plugins/coreplugin/find/searchresultwindow.h b/src/plugins/coreplugin/find/searchresultwindow.h index 0b99269c964..be1d43b1225 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.h +++ b/src/plugins/coreplugin/find/searchresultwindow.h @@ -114,7 +114,6 @@ public: QWidget *outputWidget(QWidget *) override; QList<QWidget*> toolBarWidgets() const override; - QString displayName() const override; int priorityInStatusBar() const override; void visibilityChanged(bool visible) override; bool hasFocus() const override; diff --git a/src/plugins/coreplugin/ioutputpane.cpp b/src/plugins/coreplugin/ioutputpane.cpp index 1505a2b923e..be385af5866 100644 --- a/src/plugins/coreplugin/ioutputpane.cpp +++ b/src/plugins/coreplugin/ioutputpane.cpp @@ -49,12 +49,6 @@ namespace Core { Returns the toolbar widgets for the output pane. */ -/*! - \fn QString IOutputPane::displayName() const - - Returns the translated display name of the output pane. -*/ - /*! \fn int IOutputPane::priorityInStatusBar() const diff --git a/src/plugins/coreplugin/ioutputpane.h b/src/plugins/coreplugin/ioutputpane.h index 1b65bad61e9..4521456b3d6 100644 --- a/src/plugins/coreplugin/ioutputpane.h +++ b/src/plugins/coreplugin/ioutputpane.h @@ -33,7 +33,7 @@ public: virtual QWidget *outputWidget(QWidget *parent) = 0; virtual QList<QWidget *> toolBarWidgets() const; - virtual QString displayName() const = 0; + QString displayName() const; virtual const QList<OutputWindow *> outputWindows() const { return {}; } virtual void ensureWindowVisible(OutputWindow *) { } @@ -81,6 +81,8 @@ signals: void fontChanged(const QFont &font); protected: + void setDisplayName(const QString &name); + void setupFilterUi(const Utils::Key &historyKey); QString filterText() const; bool filterUsesRegexp() const { return m_filterRegexp; } @@ -104,6 +106,7 @@ private: Utils::Id filterCaseSensitivityActionId() const; Utils::Id filterInvertedActionId() const; + QString m_displayName; Core::CommandButton * const m_zoomInButton; Core::CommandButton * const m_zoomOutButton; QAction *m_filterActionRegexp = nullptr; diff --git a/src/plugins/coreplugin/messageoutputwindow.cpp b/src/plugins/coreplugin/messageoutputwindow.cpp index 2d98164e763..c33fdfe1e46 100644 --- a/src/plugins/coreplugin/messageoutputwindow.cpp +++ b/src/plugins/coreplugin/messageoutputwindow.cpp @@ -20,6 +20,7 @@ const char zoomSettingsKey[] = "Core/MessageOutput/Zoom"; MessageOutputWindow::MessageOutputWindow() { + setDisplayName(Tr::tr("General Messages")); m_widget = new OutputWindow(Context(Constants::C_GENERAL_OUTPUT_PANE), zoomSettingsKey); m_widget->setReadOnly(true); @@ -65,11 +66,6 @@ QWidget *MessageOutputWindow::outputWidget(QWidget *parent) return m_widget; } -QString MessageOutputWindow::displayName() const -{ - return Tr::tr("General Messages"); -} - void MessageOutputWindow::append(const QString &text) { m_widget->appendMessage(text, Utils::GeneralMessageFormat); diff --git a/src/plugins/coreplugin/messageoutputwindow.h b/src/plugins/coreplugin/messageoutputwindow.h index 515c8cee51b..14f9491eff4 100644 --- a/src/plugins/coreplugin/messageoutputwindow.h +++ b/src/plugins/coreplugin/messageoutputwindow.h @@ -20,7 +20,6 @@ public: QWidget *outputWidget(QWidget *parent) override; - QString displayName() const override; int priorityInStatusBar() const override; void clearContents() override; diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index 04c61e35b61..3d6cf74ceeb 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -103,6 +103,22 @@ QList<QWidget *> IOutputPane::toolBarWidgets() const return widgets << m_zoomInButton << m_zoomOutButton; } +/*! + Returns the translated display name of the output pane. +*/ +QString IOutputPane::displayName() const +{ + return m_displayName; +} + +/*! + Sets the translated display name of the output pane to \a name. +*/ +void IOutputPane::setDisplayName(const QString &name) +{ + m_displayName = name; +} + void IOutputPane::visibilityChanged(bool /*visible*/) { } diff --git a/src/plugins/debugger/console/console.cpp b/src/plugins/debugger/console/console.cpp index 3535e9d01f2..6ba7bd3d911 100644 --- a/src/plugins/debugger/console/console.cpp +++ b/src/plugins/debugger/console/console.cpp @@ -37,6 +37,7 @@ namespace Debugger::Internal { Console::Console() { + setDisplayName(Tr::tr("QML Debugger Console")); m_consoleItemModel = new ConsoleItemModel(this); m_consoleWidget = new QWidget; @@ -142,11 +143,6 @@ QList<QWidget *> Console::toolBarWidgets() const m_spacer, m_statusLabel}; } -QString Console::displayName() const -{ - return Tr::tr("QML Debugger Console"); -} - int Console::priorityInStatusBar() const { return 20; diff --git a/src/plugins/debugger/console/console.h b/src/plugins/debugger/console/console.h index 8e6791ee8ce..be9fb66e116 100644 --- a/src/plugins/debugger/console/console.h +++ b/src/plugins/debugger/console/console.h @@ -34,7 +34,6 @@ public: QWidget *outputWidget(QWidget *) override; QList<QWidget *> toolBarWidgets() const override; - QString displayName() const override; int priorityInStatusBar() const override; void clearContents() override; bool canFocus() const override; diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 849c34e35cd..5c1143f40c0 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -152,6 +152,7 @@ AppOutputPane::AppOutputPane() : Tr::tr("Show the output that generated this issue in Application Output."), Tr::tr("A"))) { + setDisplayName(Tr::tr("Application Output")); ExtensionSystem::PluginManager::addObject(m_handler); setObjectName("AppOutputPane"); // Used in valgrind engine @@ -305,11 +306,6 @@ QList<QWidget *> AppOutputPane::toolBarWidgets() const m_formatterWidget} + IOutputPane::toolBarWidgets(); } -QString AppOutputPane::displayName() const -{ - return Tr::tr("Application Output"); -} - int AppOutputPane::priorityInStatusBar() const { return 60; diff --git a/src/plugins/projectexplorer/appoutputpane.h b/src/plugins/projectexplorer/appoutputpane.h index 059d78bff19..d62c7ef404b 100644 --- a/src/plugins/projectexplorer/appoutputpane.h +++ b/src/plugins/projectexplorer/appoutputpane.h @@ -46,7 +46,6 @@ public: QWidget *outputWidget(QWidget *) override; QList<QWidget *> toolBarWidgets() const override; - QString displayName() const override; int priorityInStatusBar() const override; void clearContents() override; bool canFocus() const override; diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index f14f80a0587..159cb8f166e 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -50,6 +50,7 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) : m_cancelBuildButton(new QToolButton), m_settingsButton(new QToolButton) { + setDisplayName(QCoreApplication::translate("QtC::ProjectExplorer", "Compile Output")); Core::Context context(C_COMPILE_OUTPUT); m_outputWindow = new Core::OutputWindow(context, SETTINGS_KEY); m_outputWindow->setWindowTitle(displayName()); diff --git a/src/plugins/projectexplorer/compileoutputwindow.h b/src/plugins/projectexplorer/compileoutputwindow.h index be3e237efa5..3cb79835122 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.h +++ b/src/plugins/projectexplorer/compileoutputwindow.h @@ -48,8 +48,6 @@ public: QWidget *outputWidget(QWidget *) override; QList<QWidget *> toolBarWidgets() const override; - QString displayName() const override { - return QCoreApplication::translate("QtC::ProjectExplorer","Compile Output"); } int priorityInStatusBar() const override; void clearContents() override; bool canFocus() const override; diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index a7e419034d8..cd028e0c8bd 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -168,6 +168,7 @@ static QToolButton *createFilterButton(const QIcon &icon, const QString &toolTip TaskWindow::TaskWindow() : d(std::make_unique<TaskWindowPrivate>()) { + setDisplayName(Tr::tr("Issues")); d->m_model = new Internal::TaskModel(this); d->m_filter = new Internal::TaskFilterModel(d->m_model); d->m_filter->setAutoAcceptChildRows(true); @@ -306,11 +307,6 @@ QList<QWidget*> TaskWindow::toolBarWidgets() const return {d->m_filterWarningsButton, d->m_categoriesButton, filterWidget()}; } -QString TaskWindow::displayName() const -{ - return Tr::tr("Issues"); -} - QWidget *TaskWindow::outputWidget(QWidget *) { return &d->m_treeView; diff --git a/src/plugins/projectexplorer/taskwindow.h b/src/plugins/projectexplorer/taskwindow.h index 3f0c6586677..06ce354c36e 100644 --- a/src/plugins/projectexplorer/taskwindow.h +++ b/src/plugins/projectexplorer/taskwindow.h @@ -40,7 +40,6 @@ public: QWidget *outputWidget(QWidget *) override; QList<QWidget *> toolBarWidgets() const override; - QString displayName() const override; int priorityInStatusBar() const override; void clearContents() override; void visibilityChanged(bool visible) override; diff --git a/src/plugins/serialterminal/serialoutputpane.cpp b/src/plugins/serialterminal/serialoutputpane.cpp index 0f11ceb9a96..63a34d1ce12 100644 --- a/src/plugins/serialterminal/serialoutputpane.cpp +++ b/src/plugins/serialterminal/serialoutputpane.cpp @@ -120,6 +120,7 @@ SerialOutputPane::SerialOutputPane(Settings &settings) : m_closeAllTabsAction(new QAction(Tr::tr("Close All Tabs"), this)), m_closeOtherTabsAction(new QAction(Tr::tr("Close Other Tabs"), this)) { + setDisplayName(Tr::tr(Constants::OUTPUT_PANE_TITLE)); createToolButtons(); auto layout = new QVBoxLayout; @@ -174,11 +175,6 @@ QList<QWidget *> SerialOutputPane::toolBarWidgets() const m_resetButton }; } -QString SerialOutputPane::displayName() const -{ - return Tr::tr(Constants::OUTPUT_PANE_TITLE); -} - int SerialOutputPane::priorityInStatusBar() const { return 30; diff --git a/src/plugins/serialterminal/serialoutputpane.h b/src/plugins/serialterminal/serialoutputpane.h index af0772a1f3d..f2a2d5414ca 100644 --- a/src/plugins/serialterminal/serialoutputpane.h +++ b/src/plugins/serialterminal/serialoutputpane.h @@ -50,7 +50,6 @@ public: // IOutputPane QWidget *outputWidget(QWidget *parent) final; QList<QWidget *> toolBarWidgets() const final; - QString displayName() const final; int priorityInStatusBar() const final; void clearContents() final; diff --git a/src/plugins/squish/squishoutputpane.cpp b/src/plugins/squish/squishoutputpane.cpp index 33b86794e7a..54704fc0621 100644 --- a/src/plugins/squish/squishoutputpane.cpp +++ b/src/plugins/squish/squishoutputpane.cpp @@ -28,6 +28,7 @@ static SquishOutputPane *m_instance = nullptr; SquishOutputPane::SquishOutputPane() { + setDisplayName(Tr::tr("Squish")); m_instance = this; m_outputPane = new QTabWidget; @@ -114,11 +115,6 @@ QList<QWidget *> SquishOutputPane::toolBarWidgets() const return {m_filterButton, m_expandAll, m_collapseAll}; } -QString SquishOutputPane::displayName() const -{ - return Tr::tr("Squish"); -} - int SquishOutputPane::priorityInStatusBar() const { return -777; diff --git a/src/plugins/squish/squishoutputpane.h b/src/plugins/squish/squishoutputpane.h index eac2ab1b614..5b354c8a8c8 100644 --- a/src/plugins/squish/squishoutputpane.h +++ b/src/plugins/squish/squishoutputpane.h @@ -35,7 +35,6 @@ public: // IOutputPane interface QWidget *outputWidget(QWidget *parent) override; QList<QWidget *> toolBarWidgets() const override; - QString displayName() const override; int priorityInStatusBar() const override; void clearContents() override; void visibilityChanged(bool visible) override; diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index 13a1abac2f5..0a8af297518 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -40,6 +40,7 @@ TerminalPane::TerminalPane(QObject *parent) : IOutputPane(parent) , m_selfContext("Terminal.Pane") { + setDisplayName(Tr::tr("Terminal")); setupContext(m_selfContext, &m_tabWidget); setZoomButtonsEnabled(true); @@ -348,11 +349,6 @@ QList<QWidget *> TerminalPane::toolBarWidgets() const return widgets << m_openSettingsButton << m_lockKeyboardButton << m_escSettingButton; } -QString TerminalPane::displayName() const -{ - return Tr::tr("Terminal"); -} - int TerminalPane::priorityInStatusBar() const { return 50; diff --git a/src/plugins/terminal/terminalpane.h b/src/plugins/terminal/terminalpane.h index bc25ade2b14..4b201ad585d 100644 --- a/src/plugins/terminal/terminalpane.h +++ b/src/plugins/terminal/terminalpane.h @@ -27,7 +27,6 @@ public: QWidget *outputWidget(QWidget *parent) override; QList<QWidget *> toolBarWidgets() const override; - QString displayName() const override; int priorityInStatusBar() const override; void clearContents() override; void visibilityChanged(bool visible) override; diff --git a/src/plugins/todo/todooutputpane.cpp b/src/plugins/todo/todooutputpane.cpp index b8197d6b611..ff481033833 100644 --- a/src/plugins/todo/todooutputpane.cpp +++ b/src/plugins/todo/todooutputpane.cpp @@ -26,6 +26,7 @@ TodoOutputPane::TodoOutputPane(TodoItemsModel *todoItemsModel, const Settings *s m_todoItemsModel(todoItemsModel), m_settings(settings) { + setDisplayName(Tr::tr("To-Do Entries")); createTreeView(); createScopeButtons(); setScanningScope(ScanningScopeCurrentFile); // default @@ -59,11 +60,6 @@ QList<QWidget*> TodoOutputPane::toolBarWidgets() const return widgets; } -QString TodoOutputPane::displayName() const -{ - return Tr::tr("To-Do Entries"); -} - int TodoOutputPane::priorityInStatusBar() const { return 1; diff --git a/src/plugins/todo/todooutputpane.h b/src/plugins/todo/todooutputpane.h index fa4dda3ddbe..595a9118eac 100644 --- a/src/plugins/todo/todooutputpane.h +++ b/src/plugins/todo/todooutputpane.h @@ -35,7 +35,6 @@ public: QWidget *outputWidget(QWidget *parent) override; QList<QWidget*> toolBarWidgets() const override; - QString displayName() const override; int priorityInStatusBar() const override; void clearContents() override; void setFocus() override; diff --git a/src/plugins/vcsbase/vcsoutputwindow.cpp b/src/plugins/vcsbase/vcsoutputwindow.cpp index d02ad28abc7..43396cd1fe6 100644 --- a/src/plugins/vcsbase/vcsoutputwindow.cpp +++ b/src/plugins/vcsbase/vcsoutputwindow.cpp @@ -283,6 +283,7 @@ static VcsOutputWindowPrivate *d = nullptr; VcsOutputWindow::VcsOutputWindow() { + setDisplayName(Tr::tr("Version Control")); d = new VcsOutputWindowPrivate; Q_ASSERT(d->passwordRegExp.isValid()); m_instance = this; @@ -327,11 +328,6 @@ QWidget *VcsOutputWindow::outputWidget(QWidget *parent) return &d->widget; } -QString VcsOutputWindow::displayName() const -{ - return Tr::tr("Version Control"); -} - int VcsOutputWindow::priorityInStatusBar() const { return -1; diff --git a/src/plugins/vcsbase/vcsoutputwindow.h b/src/plugins/vcsbase/vcsoutputwindow.h index f6023560865..a0242dbfd5c 100644 --- a/src/plugins/vcsbase/vcsoutputwindow.h +++ b/src/plugins/vcsbase/vcsoutputwindow.h @@ -22,7 +22,6 @@ class VCSBASE_EXPORT VcsOutputWindow : public Core::IOutputPane public: QWidget *outputWidget(QWidget *parent) override; - QString displayName() const override; int priorityInStatusBar() const override; From 053c6253b84db1df5380bfecf6f7e632b0abd5ed Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 13 Sep 2023 15:36:07 +0200 Subject: [PATCH 1136/1777] OutputPane: Add an id() for the settings It was using the displayName for the key in the settings (visibility and shortcut), which is annoying when changing the language. Change-Id: Iffa784347c59389599c90f468dcba15834599c39 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/autotest/testresultspane.cpp | 1 + src/plugins/axivion/axivionoutputpane.cpp | 1 + .../coreplugin/find/searchresultwindow.cpp | 1 + src/plugins/coreplugin/ioutputpane.h | 3 +++ .../coreplugin/messageoutputwindow.cpp | 1 + src/plugins/coreplugin/outputpanemanager.cpp | 21 ++++++++++++++++--- src/plugins/debugger/console/console.cpp | 1 + src/plugins/projectexplorer/appoutputpane.cpp | 1 + .../projectexplorer/compileoutputwindow.cpp | 1 + src/plugins/projectexplorer/taskwindow.cpp | 1 + .../serialterminal/serialoutputpane.cpp | 1 + src/plugins/squish/squishoutputpane.cpp | 1 + src/plugins/terminal/terminalpane.cpp | 1 + src/plugins/todo/todooutputpane.cpp | 1 + src/plugins/vcsbase/vcsoutputwindow.cpp | 1 + 15 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index 90f675bc927..43dce00ed9a 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -74,6 +74,7 @@ TestResultsPane::TestResultsPane(QObject *parent) : IOutputPane(parent), m_context(new IContext(this)) { + setId("TestResults"); setDisplayName(Tr::tr("Test Results")); m_outputWidget = new QStackedWidget; QWidget *visualOutputWidget = new QWidget; diff --git a/src/plugins/axivion/axivionoutputpane.cpp b/src/plugins/axivion/axivionoutputpane.cpp index 11937b2060d..c961501fa27 100644 --- a/src/plugins/axivion/axivionoutputpane.cpp +++ b/src/plugins/axivion/axivionoutputpane.cpp @@ -170,6 +170,7 @@ void DashboardWidget::updateUi() AxivionOutputPane::AxivionOutputPane(QObject *parent) : Core::IOutputPane(parent) { + setId("Axivion"); setDisplayName(Tr::tr("Axivion")); m_outputWidget = new QStackedWidget; diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp index 48ed8b875e9..c7ff84b3eef 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.cpp +++ b/src/plugins/coreplugin/find/searchresultwindow.cpp @@ -363,6 +363,7 @@ SearchResultWindow *SearchResultWindow::m_instance = nullptr; SearchResultWindow::SearchResultWindow(QWidget *newSearchPanel) : d(new SearchResultWindowPrivate(this, newSearchPanel)) { + setId("SearchResults"); setDisplayName(Tr::tr("Search Results")); m_instance = this; readSettings(); diff --git a/src/plugins/coreplugin/ioutputpane.h b/src/plugins/coreplugin/ioutputpane.h index 4521456b3d6..ff033866504 100644 --- a/src/plugins/coreplugin/ioutputpane.h +++ b/src/plugins/coreplugin/ioutputpane.h @@ -33,6 +33,7 @@ public: virtual QWidget *outputWidget(QWidget *parent) = 0; virtual QList<QWidget *> toolBarWidgets() const; + Utils::Id id() const; QString displayName() const; virtual const QList<OutputWindow *> outputWindows() const { return {}; } virtual void ensureWindowVisible(OutputWindow *) { } @@ -81,6 +82,7 @@ signals: void fontChanged(const QFont &font); protected: + void setId(const Utils::Id &id); void setDisplayName(const QString &name); void setupFilterUi(const Utils::Key &historyKey); @@ -106,6 +108,7 @@ private: Utils::Id filterCaseSensitivityActionId() const; Utils::Id filterInvertedActionId() const; + Utils::Id m_id; QString m_displayName; Core::CommandButton * const m_zoomInButton; Core::CommandButton * const m_zoomOutButton; diff --git a/src/plugins/coreplugin/messageoutputwindow.cpp b/src/plugins/coreplugin/messageoutputwindow.cpp index c33fdfe1e46..7ee6e6b1a56 100644 --- a/src/plugins/coreplugin/messageoutputwindow.cpp +++ b/src/plugins/coreplugin/messageoutputwindow.cpp @@ -20,6 +20,7 @@ const char zoomSettingsKey[] = "Core/MessageOutput/Zoom"; MessageOutputWindow::MessageOutputWindow() { + setId("GeneralMessages"); setDisplayName(Tr::tr("General Messages")); m_widget = new OutputWindow(Context(Constants::C_GENERAL_OUTPUT_PANE), zoomSettingsKey); m_widget->setReadOnly(true); diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index 3d6cf74ceeb..7bb9964ff3e 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -103,6 +103,23 @@ QList<QWidget *> IOutputPane::toolBarWidgets() const return widgets << m_zoomInButton << m_zoomOutButton; } +/*! + Returns the ID of the output pane. +*/ +Id IOutputPane::id() const +{ + return m_id; +} + +/*! + Sets the ID of the output pane to \a id. + This is used for persisting the visibility state. +*/ +void IOutputPane::setId(const Utils::Id &id) +{ + m_id = id; +} + /*! Returns the translated display name of the output pane. */ @@ -481,9 +498,7 @@ void OutputPaneManager::initialize() minTitleWidth = qMax(minTitleWidth, titleFm.horizontalAdvance(outPane->displayName())); - QString suffix = outPane->displayName().simplified(); - suffix.remove(QLatin1Char(' ')); - data.id = baseId.withSuffix(suffix); + data.id = baseId.withSuffix(outPane->id().toString()); data.action = new QAction(outPane->displayName(), m_instance); Command *cmd = ActionManager::registerAction(data.action, data.id); diff --git a/src/plugins/debugger/console/console.cpp b/src/plugins/debugger/console/console.cpp index 6ba7bd3d911..0eeac32155f 100644 --- a/src/plugins/debugger/console/console.cpp +++ b/src/plugins/debugger/console/console.cpp @@ -37,6 +37,7 @@ namespace Debugger::Internal { Console::Console() { + setId("QMLDebuggerConsole"); setDisplayName(Tr::tr("QML Debugger Console")); m_consoleItemModel = new ConsoleItemModel(this); diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 5c1143f40c0..ad4eb326ed3 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -152,6 +152,7 @@ AppOutputPane::AppOutputPane() : Tr::tr("Show the output that generated this issue in Application Output."), Tr::tr("A"))) { + setId("ApplicationOutput"); setDisplayName(Tr::tr("Application Output")); ExtensionSystem::PluginManager::addObject(m_handler); diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index 159cb8f166e..1cd8d9a2333 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -50,6 +50,7 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) : m_cancelBuildButton(new QToolButton), m_settingsButton(new QToolButton) { + setId("CompileOutput"); setDisplayName(QCoreApplication::translate("QtC::ProjectExplorer", "Compile Output")); Core::Context context(C_COMPILE_OUTPUT); m_outputWindow = new Core::OutputWindow(context, SETTINGS_KEY); diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index cd028e0c8bd..dc259975000 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -168,6 +168,7 @@ static QToolButton *createFilterButton(const QIcon &icon, const QString &toolTip TaskWindow::TaskWindow() : d(std::make_unique<TaskWindowPrivate>()) { + setId("Issues"); setDisplayName(Tr::tr("Issues")); d->m_model = new Internal::TaskModel(this); d->m_filter = new Internal::TaskFilterModel(d->m_model); diff --git a/src/plugins/serialterminal/serialoutputpane.cpp b/src/plugins/serialterminal/serialoutputpane.cpp index 63a34d1ce12..fd2dfb39ffe 100644 --- a/src/plugins/serialterminal/serialoutputpane.cpp +++ b/src/plugins/serialterminal/serialoutputpane.cpp @@ -120,6 +120,7 @@ SerialOutputPane::SerialOutputPane(Settings &settings) : m_closeAllTabsAction(new QAction(Tr::tr("Close All Tabs"), this)), m_closeOtherTabsAction(new QAction(Tr::tr("Close Other Tabs"), this)) { + setId("Serial Terminal"); setDisplayName(Tr::tr(Constants::OUTPUT_PANE_TITLE)); createToolButtons(); diff --git a/src/plugins/squish/squishoutputpane.cpp b/src/plugins/squish/squishoutputpane.cpp index 54704fc0621..55612f588ce 100644 --- a/src/plugins/squish/squishoutputpane.cpp +++ b/src/plugins/squish/squishoutputpane.cpp @@ -28,6 +28,7 @@ static SquishOutputPane *m_instance = nullptr; SquishOutputPane::SquishOutputPane() { + setId("Squish"); setDisplayName(Tr::tr("Squish")); m_instance = this; diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index 0a8af297518..5f1ab157231 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -40,6 +40,7 @@ TerminalPane::TerminalPane(QObject *parent) : IOutputPane(parent) , m_selfContext("Terminal.Pane") { + setId("Terminal"); setDisplayName(Tr::tr("Terminal")); setupContext(m_selfContext, &m_tabWidget); setZoomButtonsEnabled(true); diff --git a/src/plugins/todo/todooutputpane.cpp b/src/plugins/todo/todooutputpane.cpp index ff481033833..5a656a541db 100644 --- a/src/plugins/todo/todooutputpane.cpp +++ b/src/plugins/todo/todooutputpane.cpp @@ -26,6 +26,7 @@ TodoOutputPane::TodoOutputPane(TodoItemsModel *todoItemsModel, const Settings *s m_todoItemsModel(todoItemsModel), m_settings(settings) { + setId("To-DoEntries"); setDisplayName(Tr::tr("To-Do Entries")); createTreeView(); createScopeButtons(); diff --git a/src/plugins/vcsbase/vcsoutputwindow.cpp b/src/plugins/vcsbase/vcsoutputwindow.cpp index 43396cd1fe6..ea07ccf9d61 100644 --- a/src/plugins/vcsbase/vcsoutputwindow.cpp +++ b/src/plugins/vcsbase/vcsoutputwindow.cpp @@ -283,6 +283,7 @@ static VcsOutputWindowPrivate *d = nullptr; VcsOutputWindow::VcsOutputWindow() { + setId("VersionControl"); setDisplayName(Tr::tr("Version Control")); d = new VcsOutputWindowPrivate; Q_ASSERT(d->passwordRegExp.isValid()); From b0043ed1acb5af88b570ef67d5ecb39bd2050e84 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 14 Sep 2023 09:40:56 +0200 Subject: [PATCH 1137/1777] OutputPane: Use setter for priority and fix default visibility Do not show the buttons of output views with priority < 0 (instead of only == -1). Reduce the number of buttons that are shown by default to the essential ones. Change-Id: I5b44f18537b3033ce9d616f044a8b54b76988783 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/autotest/testresultspane.cpp | 6 +---- src/plugins/autotest/testresultspane.h | 1 - src/plugins/axivion/axivionoutputpane.cpp | 6 +---- src/plugins/axivion/axivionoutputpane.h | 1 - .../coreplugin/find/searchresultwindow.cpp | 9 +------ .../coreplugin/find/searchresultwindow.h | 1 - src/plugins/coreplugin/ioutputpane.cpp | 10 ------- src/plugins/coreplugin/ioutputpane.h | 4 ++- .../coreplugin/messageoutputwindow.cpp | 7 ++--- src/plugins/coreplugin/messageoutputwindow.h | 1 - src/plugins/coreplugin/outputpanemanager.cpp | 26 ++++++++++++++++++- src/plugins/debugger/console/console.cpp | 7 ++--- src/plugins/debugger/console/console.h | 1 - src/plugins/projectexplorer/appoutputpane.cpp | 7 ++--- src/plugins/projectexplorer/appoutputpane.h | 1 - .../projectexplorer/compileoutputwindow.cpp | 7 ++--- .../projectexplorer/compileoutputwindow.h | 1 - src/plugins/projectexplorer/taskwindow.cpp | 7 ++--- src/plugins/projectexplorer/taskwindow.h | 1 - .../serialterminal/serialoutputpane.cpp | 7 ++--- src/plugins/serialterminal/serialoutputpane.h | 1 - src/plugins/squish/squishoutputpane.cpp | 7 ++--- src/plugins/squish/squishoutputpane.h | 1 - src/plugins/terminal/terminalpane.cpp | 7 ++--- src/plugins/terminal/terminalpane.h | 1 - src/plugins/todo/todooutputpane.cpp | 7 ++--- src/plugins/todo/todooutputpane.h | 1 - src/plugins/vcsbase/vcsoutputwindow.cpp | 7 ++--- src/plugins/vcsbase/vcsoutputwindow.h | 2 -- 29 files changed, 51 insertions(+), 94 deletions(-) diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index 43dce00ed9a..d22ad892e45 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -76,6 +76,7 @@ TestResultsPane::TestResultsPane(QObject *parent) : { setId("TestResults"); setDisplayName(Tr::tr("Test Results")); + setPriorityInStatusBar(-30); m_outputWidget = new QStackedWidget; QWidget *visualOutputWidget = new QWidget; m_outputWidget->addWidget(visualOutputWidget); @@ -276,11 +277,6 @@ QList<QWidget *> TestResultsPane::toolBarWidgets() const return result; } -int TestResultsPane::priorityInStatusBar() const -{ - return -666; -} - void TestResultsPane::clearContents() { m_filterModel->clearTestResults(); diff --git a/src/plugins/autotest/testresultspane.h b/src/plugins/autotest/testresultspane.h index 7db699fc411..d762890c97c 100644 --- a/src/plugins/autotest/testresultspane.h +++ b/src/plugins/autotest/testresultspane.h @@ -60,7 +60,6 @@ public: // IOutputPane interface QWidget *outputWidget(QWidget *parent) override; QList<QWidget *> toolBarWidgets() const override; - int priorityInStatusBar() const override; void clearContents() override; void setFocus() override; bool hasFocus() const override; diff --git a/src/plugins/axivion/axivionoutputpane.cpp b/src/plugins/axivion/axivionoutputpane.cpp index c961501fa27..4124a6c2473 100644 --- a/src/plugins/axivion/axivionoutputpane.cpp +++ b/src/plugins/axivion/axivionoutputpane.cpp @@ -172,6 +172,7 @@ AxivionOutputPane::AxivionOutputPane(QObject *parent) { setId("Axivion"); setDisplayName(Tr::tr("Axivion")); + setPriorityInStatusBar(-50); m_outputWidget = new QStackedWidget; DashboardWidget *dashboardWidget = new DashboardWidget(m_outputWidget); @@ -209,11 +210,6 @@ QList<QWidget *> AxivionOutputPane::toolBarWidgets() const return buttons; } -int AxivionOutputPane::priorityInStatusBar() const -{ - return -1; -} - void AxivionOutputPane::clearContents() { } diff --git a/src/plugins/axivion/axivionoutputpane.h b/src/plugins/axivion/axivionoutputpane.h index f156ce3b54c..140d50b7235 100644 --- a/src/plugins/axivion/axivionoutputpane.h +++ b/src/plugins/axivion/axivionoutputpane.h @@ -21,7 +21,6 @@ public: // IOutputPane interface QWidget *outputWidget(QWidget *parent) override; QList<QWidget *> toolBarWidgets() const override; - int priorityInStatusBar() const override; void clearContents() override; void setFocus() override; bool hasFocus() const override; diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp index c7ff84b3eef..ba121114876 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.cpp +++ b/src/plugins/coreplugin/find/searchresultwindow.cpp @@ -365,6 +365,7 @@ SearchResultWindow::SearchResultWindow(QWidget *newSearchPanel) { setId("SearchResults"); setDisplayName(Tr::tr("Search Results")); + setPriorityInStatusBar(80); m_instance = this; readSettings(); } @@ -657,14 +658,6 @@ void SearchResultWindow::writeSettings() s->endGroup(); } -/*! - \internal -*/ -int SearchResultWindow::priorityInStatusBar() const -{ - return 80; -} - /*! \internal */ diff --git a/src/plugins/coreplugin/find/searchresultwindow.h b/src/plugins/coreplugin/find/searchresultwindow.h index be1d43b1225..1aac86070c4 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.h +++ b/src/plugins/coreplugin/find/searchresultwindow.h @@ -114,7 +114,6 @@ public: QWidget *outputWidget(QWidget *) override; QList<QWidget*> toolBarWidgets() const override; - int priorityInStatusBar() const override; void visibilityChanged(bool visible) override; bool hasFocus() const override; bool canFocus() const override; diff --git a/src/plugins/coreplugin/ioutputpane.cpp b/src/plugins/coreplugin/ioutputpane.cpp index be385af5866..d10c55eaad0 100644 --- a/src/plugins/coreplugin/ioutputpane.cpp +++ b/src/plugins/coreplugin/ioutputpane.cpp @@ -49,16 +49,6 @@ namespace Core { Returns the toolbar widgets for the output pane. */ -/*! - \fn int IOutputPane::priorityInStatusBar() const - - Determines the position of the output pane on the status bar. - \list - \li 100 to 0 from front to end - \li -1 do not show in status bar - \endlist -*/ - /*! \fn void IOutputPane::clearContents() diff --git a/src/plugins/coreplugin/ioutputpane.h b/src/plugins/coreplugin/ioutputpane.h index ff033866504..07f32ded5b6 100644 --- a/src/plugins/coreplugin/ioutputpane.h +++ b/src/plugins/coreplugin/ioutputpane.h @@ -38,7 +38,7 @@ public: virtual const QList<OutputWindow *> outputWindows() const { return {}; } virtual void ensureWindowVisible(OutputWindow *) { } - virtual int priorityInStatusBar() const = 0; + int priorityInStatusBar() const; virtual void clearContents() = 0; virtual void visibilityChanged(bool visible); @@ -84,6 +84,7 @@ signals: protected: void setId(const Utils::Id &id); void setDisplayName(const QString &name); + void setPriorityInStatusBar(int priority); void setupFilterUi(const Utils::Key &historyKey); QString filterText() const; @@ -110,6 +111,7 @@ private: Utils::Id m_id; QString m_displayName; + int m_priority = -1; Core::CommandButton * const m_zoomInButton; Core::CommandButton * const m_zoomOutButton; QAction *m_filterActionRegexp = nullptr; diff --git a/src/plugins/coreplugin/messageoutputwindow.cpp b/src/plugins/coreplugin/messageoutputwindow.cpp index 7ee6e6b1a56..1cfe384ac00 100644 --- a/src/plugins/coreplugin/messageoutputwindow.cpp +++ b/src/plugins/coreplugin/messageoutputwindow.cpp @@ -22,6 +22,8 @@ MessageOutputWindow::MessageOutputWindow() { setId("GeneralMessages"); setDisplayName(Tr::tr("General Messages")); + setPriorityInStatusBar(-100); + m_widget = new OutputWindow(Context(Constants::C_GENERAL_OUTPUT_PANE), zoomSettingsKey); m_widget->setReadOnly(true); @@ -72,11 +74,6 @@ void MessageOutputWindow::append(const QString &text) m_widget->appendMessage(text, Utils::GeneralMessageFormat); } -int MessageOutputWindow::priorityInStatusBar() const -{ - return -1; -} - bool MessageOutputWindow::canNext() const { return false; diff --git a/src/plugins/coreplugin/messageoutputwindow.h b/src/plugins/coreplugin/messageoutputwindow.h index 14f9491eff4..ef0d93a97cf 100644 --- a/src/plugins/coreplugin/messageoutputwindow.h +++ b/src/plugins/coreplugin/messageoutputwindow.h @@ -20,7 +20,6 @@ public: QWidget *outputWidget(QWidget *parent) override; - int priorityInStatusBar() const override; void clearContents() override; void append(const QString &text); diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index 7bb9964ff3e..1c3ad99310c 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -128,6 +128,30 @@ QString IOutputPane::displayName() const return m_displayName; } +/*! + Determines the position of the output pane on the status bar and the + default visibility. + \sa setPriorityInStatusBar() +*/ +int IOutputPane::priorityInStatusBar() const +{ + return m_priority; +} + +/*! + Sets the position of the output pane on the status bar and the default + visibility to \a priority. + \list + \li higher numbers are further to the front + \li >= 0 are shown in status bar by default + \li < 0 are not shown in status bar by default + \endlist +*/ +void IOutputPane::setPriorityInStatusBar(int priority) +{ + m_priority = priority; +} + /*! Sets the translated display name of the output pane to \a name. */ @@ -522,7 +546,7 @@ void OutputPaneManager::initialize() m_instance->buttonTriggered(i); }); - bool visible = outPane->priorityInStatusBar() != -1; + const bool visible = outPane->priorityInStatusBar() >= 0; data.button->setVisible(visible); connect(data.action, &QAction::triggered, m_instance, [i] { diff --git a/src/plugins/debugger/console/console.cpp b/src/plugins/debugger/console/console.cpp index 0eeac32155f..b1ee0dac83e 100644 --- a/src/plugins/debugger/console/console.cpp +++ b/src/plugins/debugger/console/console.cpp @@ -39,6 +39,8 @@ Console::Console() { setId("QMLDebuggerConsole"); setDisplayName(Tr::tr("QML Debugger Console")); + setPriorityInStatusBar(-40); + m_consoleItemModel = new ConsoleItemModel(this); m_consoleWidget = new QWidget; @@ -144,11 +146,6 @@ QList<QWidget *> Console::toolBarWidgets() const m_spacer, m_statusLabel}; } -int Console::priorityInStatusBar() const -{ - return 20; -} - void Console::clearContents() { m_consoleItemModel->clear(); diff --git a/src/plugins/debugger/console/console.h b/src/plugins/debugger/console/console.h index be9fb66e116..abf3c267c00 100644 --- a/src/plugins/debugger/console/console.h +++ b/src/plugins/debugger/console/console.h @@ -34,7 +34,6 @@ public: QWidget *outputWidget(QWidget *) override; QList<QWidget *> toolBarWidgets() const override; - int priorityInStatusBar() const override; void clearContents() override; bool canFocus() const override; bool hasFocus() const override; diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index ad4eb326ed3..13f3d2e5d3c 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -154,6 +154,8 @@ AppOutputPane::AppOutputPane() : { setId("ApplicationOutput"); setDisplayName(Tr::tr("Application Output")); + setPriorityInStatusBar(60); + ExtensionSystem::PluginManager::addObject(m_handler); setObjectName("AppOutputPane"); // Used in valgrind engine @@ -307,11 +309,6 @@ QList<QWidget *> AppOutputPane::toolBarWidgets() const m_formatterWidget} + IOutputPane::toolBarWidgets(); } -int AppOutputPane::priorityInStatusBar() const -{ - return 60; -} - void AppOutputPane::clearContents() { auto *currentWindow = qobject_cast<Core::OutputWindow *>(m_tabWidget->currentWidget()); diff --git a/src/plugins/projectexplorer/appoutputpane.h b/src/plugins/projectexplorer/appoutputpane.h index d62c7ef404b..f7cbb653ff3 100644 --- a/src/plugins/projectexplorer/appoutputpane.h +++ b/src/plugins/projectexplorer/appoutputpane.h @@ -46,7 +46,6 @@ public: QWidget *outputWidget(QWidget *) override; QList<QWidget *> toolBarWidgets() const override; - int priorityInStatusBar() const override; void clearContents() override; bool canFocus() const override; bool hasFocus() const override; diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index 1cd8d9a2333..a8692b8c5e0 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -52,6 +52,8 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) : { setId("CompileOutput"); setDisplayName(QCoreApplication::translate("QtC::ProjectExplorer", "Compile Output")); + setPriorityInStatusBar(40); + Core::Context context(C_COMPILE_OUTPUT); m_outputWindow = new Core::OutputWindow(context, SETTINGS_KEY); m_outputWindow->setWindowTitle(displayName()); @@ -178,11 +180,6 @@ void CompileOutputWindow::clearContents() m_outputWindow->clear(); } -int CompileOutputWindow::priorityInStatusBar() const -{ - return 50; -} - bool CompileOutputWindow::canNext() const { return false; diff --git a/src/plugins/projectexplorer/compileoutputwindow.h b/src/plugins/projectexplorer/compileoutputwindow.h index 3cb79835122..21cebcb2dba 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.h +++ b/src/plugins/projectexplorer/compileoutputwindow.h @@ -48,7 +48,6 @@ public: QWidget *outputWidget(QWidget *) override; QList<QWidget *> toolBarWidgets() const override; - int priorityInStatusBar() const override; void clearContents() override; bool canFocus() const override; bool hasFocus() const override; diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index dc259975000..db25d4e9de5 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -170,6 +170,8 @@ TaskWindow::TaskWindow() : d(std::make_unique<TaskWindowPrivate>()) { setId("Issues"); setDisplayName(Tr::tr("Issues")); + setPriorityInStatusBar(100); + d->m_model = new Internal::TaskModel(this); d->m_filter = new Internal::TaskFilterModel(d->m_model); d->m_filter->setAutoAcceptChildRows(true); @@ -500,11 +502,6 @@ int TaskWindow::warningTaskCount(Id category) const return d->m_model->warningTaskCount(category); } -int TaskWindow::priorityInStatusBar() const -{ - return 90; -} - void TaskWindow::clearContents() { // clear all tasks in all displays diff --git a/src/plugins/projectexplorer/taskwindow.h b/src/plugins/projectexplorer/taskwindow.h index 06ce354c36e..2d53928d97d 100644 --- a/src/plugins/projectexplorer/taskwindow.h +++ b/src/plugins/projectexplorer/taskwindow.h @@ -40,7 +40,6 @@ public: QWidget *outputWidget(QWidget *) override; QList<QWidget *> toolBarWidgets() const override; - int priorityInStatusBar() const override; void clearContents() override; void visibilityChanged(bool visible) override; diff --git a/src/plugins/serialterminal/serialoutputpane.cpp b/src/plugins/serialterminal/serialoutputpane.cpp index fd2dfb39ffe..2f30bf75fcd 100644 --- a/src/plugins/serialterminal/serialoutputpane.cpp +++ b/src/plugins/serialterminal/serialoutputpane.cpp @@ -122,6 +122,8 @@ SerialOutputPane::SerialOutputPane(Settings &settings) : { setId("Serial Terminal"); setDisplayName(Tr::tr(Constants::OUTPUT_PANE_TITLE)); + setPriorityInStatusBar(-70); + createToolButtons(); auto layout = new QVBoxLayout; @@ -176,11 +178,6 @@ QList<QWidget *> SerialOutputPane::toolBarWidgets() const m_resetButton }; } -int SerialOutputPane::priorityInStatusBar() const -{ - return 30; -} - void SerialOutputPane::clearContents() { auto currentWindow = qobject_cast<Core::OutputWindow *>(m_tabWidget->currentWidget()); diff --git a/src/plugins/serialterminal/serialoutputpane.h b/src/plugins/serialterminal/serialoutputpane.h index f2a2d5414ca..1f970e2f18e 100644 --- a/src/plugins/serialterminal/serialoutputpane.h +++ b/src/plugins/serialterminal/serialoutputpane.h @@ -51,7 +51,6 @@ public: QWidget *outputWidget(QWidget *parent) final; QList<QWidget *> toolBarWidgets() const final; - int priorityInStatusBar() const final; void clearContents() final; bool canFocus() const final; bool hasFocus() const final; diff --git a/src/plugins/squish/squishoutputpane.cpp b/src/plugins/squish/squishoutputpane.cpp index 55612f588ce..1395af9e463 100644 --- a/src/plugins/squish/squishoutputpane.cpp +++ b/src/plugins/squish/squishoutputpane.cpp @@ -30,6 +30,8 @@ SquishOutputPane::SquishOutputPane() { setId("Squish"); setDisplayName(Tr::tr("Squish")); + setPriorityInStatusBar(-60); + m_instance = this; m_outputPane = new QTabWidget; @@ -116,11 +118,6 @@ QList<QWidget *> SquishOutputPane::toolBarWidgets() const return {m_filterButton, m_expandAll, m_collapseAll}; } -int SquishOutputPane::priorityInStatusBar() const -{ - return -777; -} - void SquishOutputPane::clearContents() { if (m_outputPane->currentIndex() == 0) diff --git a/src/plugins/squish/squishoutputpane.h b/src/plugins/squish/squishoutputpane.h index 5b354c8a8c8..914e931f794 100644 --- a/src/plugins/squish/squishoutputpane.h +++ b/src/plugins/squish/squishoutputpane.h @@ -35,7 +35,6 @@ public: // IOutputPane interface QWidget *outputWidget(QWidget *parent) override; QList<QWidget *> toolBarWidgets() const override; - int priorityInStatusBar() const override; void clearContents() override; void visibilityChanged(bool visible) override; void setFocus() override; diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index 5f1ab157231..df059d03b3b 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -42,6 +42,8 @@ TerminalPane::TerminalPane(QObject *parent) { setId("Terminal"); setDisplayName(Tr::tr("Terminal")); + setPriorityInStatusBar(20); + setupContext(m_selfContext, &m_tabWidget); setZoomButtonsEnabled(true); @@ -350,11 +352,6 @@ QList<QWidget *> TerminalPane::toolBarWidgets() const return widgets << m_openSettingsButton << m_lockKeyboardButton << m_escSettingButton; } -int TerminalPane::priorityInStatusBar() const -{ - return 50; -} - void TerminalPane::clearContents() { if (const auto t = currentTerminal()) diff --git a/src/plugins/terminal/terminalpane.h b/src/plugins/terminal/terminalpane.h index 4b201ad585d..c21d1525120 100644 --- a/src/plugins/terminal/terminalpane.h +++ b/src/plugins/terminal/terminalpane.h @@ -27,7 +27,6 @@ public: QWidget *outputWidget(QWidget *parent) override; QList<QWidget *> toolBarWidgets() const override; - int priorityInStatusBar() const override; void clearContents() override; void visibilityChanged(bool visible) override; void setFocus() override; diff --git a/src/plugins/todo/todooutputpane.cpp b/src/plugins/todo/todooutputpane.cpp index 5a656a541db..3f314e86a99 100644 --- a/src/plugins/todo/todooutputpane.cpp +++ b/src/plugins/todo/todooutputpane.cpp @@ -28,6 +28,8 @@ TodoOutputPane::TodoOutputPane(TodoItemsModel *todoItemsModel, const Settings *s { setId("To-DoEntries"); setDisplayName(Tr::tr("To-Do Entries")); + setPriorityInStatusBar(10); + createTreeView(); createScopeButtons(); setScanningScope(ScanningScopeCurrentFile); // default @@ -61,11 +63,6 @@ QList<QWidget*> TodoOutputPane::toolBarWidgets() const return widgets; } -int TodoOutputPane::priorityInStatusBar() const -{ - return 1; -} - void TodoOutputPane::clearContents() { clearKeywordFilter(); diff --git a/src/plugins/todo/todooutputpane.h b/src/plugins/todo/todooutputpane.h index 595a9118eac..f408a399362 100644 --- a/src/plugins/todo/todooutputpane.h +++ b/src/plugins/todo/todooutputpane.h @@ -35,7 +35,6 @@ public: QWidget *outputWidget(QWidget *parent) override; QList<QWidget*> toolBarWidgets() const override; - int priorityInStatusBar() const override; void clearContents() override; void setFocus() override; bool hasFocus() const override; diff --git a/src/plugins/vcsbase/vcsoutputwindow.cpp b/src/plugins/vcsbase/vcsoutputwindow.cpp index ea07ccf9d61..10b0ace71ac 100644 --- a/src/plugins/vcsbase/vcsoutputwindow.cpp +++ b/src/plugins/vcsbase/vcsoutputwindow.cpp @@ -285,6 +285,8 @@ VcsOutputWindow::VcsOutputWindow() { setId("VersionControl"); setDisplayName(Tr::tr("Version Control")); + setPriorityInStatusBar(-20); + d = new VcsOutputWindowPrivate; Q_ASSERT(d->passwordRegExp.isValid()); m_instance = this; @@ -329,11 +331,6 @@ QWidget *VcsOutputWindow::outputWidget(QWidget *parent) return &d->widget; } -int VcsOutputWindow::priorityInStatusBar() const -{ - return -1; -} - void VcsOutputWindow::clearContents() { d->widget.clear(); diff --git a/src/plugins/vcsbase/vcsoutputwindow.h b/src/plugins/vcsbase/vcsoutputwindow.h index a0242dbfd5c..ec2235d7285 100644 --- a/src/plugins/vcsbase/vcsoutputwindow.h +++ b/src/plugins/vcsbase/vcsoutputwindow.h @@ -23,8 +23,6 @@ class VCSBASE_EXPORT VcsOutputWindow : public Core::IOutputPane public: QWidget *outputWidget(QWidget *parent) override; - int priorityInStatusBar() const override; - void clearContents() override; void setFocus() override; From 39fdfc9e0c25ffa624f79124a9287fc2bbcf1d71 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 15 Sep 2023 10:38:53 +0200 Subject: [PATCH 1138/1777] OutputPane: Modernize menu Use lambdas instead of user data. Change-Id: I66585df8de2f1f3ea42f66c6f3b0df7d4d3f3f01 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/coreplugin/outputpanemanager.cpp | 25 +++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index 1c3ad99310c..d51b790ec32 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -771,22 +771,19 @@ void OutputPaneManager::popupMenu() QAction *act = menu.addAction(data.pane->displayName()); act->setCheckable(true); act->setChecked(data.button->isPaneVisible()); - act->setData(idx); + connect(act, &QAction::triggered, this, [this, data, idx] { + if (data.button->isPaneVisible()) { + data.pane->visibilityChanged(false); + data.button->setChecked(false); + data.button->hide(); + } else { + showPage(idx, IOutputPane::ModeSwitch); + } + }); ++idx; } - QAction *result = menu.exec(QCursor::pos()); - if (!result) - return; - idx = result->data().toInt(); - QTC_ASSERT(idx >= 0 && idx < g_outputPanes.size(), return); - OutputPaneData &data = g_outputPanes[idx]; - if (data.button->isPaneVisible()) { - data.pane->visibilityChanged(false); - data.button->setChecked(false); - data.button->hide(); - } else { - showPage(idx, IOutputPane::ModeSwitch); - } + + menu.exec(QCursor::pos()); } void OutputPaneManager::saveSettings() const From 9d3fca4edc390e04cffd8252226635a21c13ece6 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 18 Sep 2023 10:28:06 +0200 Subject: [PATCH 1139/1777] BuildManager: Disconnect instead of connect Amends a140a930675dd3b7af5fbbc423dc2aa444512881 Change-Id: I88a3d62adf80f213b9772fd190c21052596829a0 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/buildmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 09b5bac90f2..ed38b621c1e 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -788,7 +788,7 @@ bool BuildManager::buildQueueAppend(const QList<BuildItem> &items, const QString addToOutputWindow(Tr::tr("When executing step \"%1\"") .arg(buildStep->displayName()), BuildStep::OutputFormat::Stderr); for (BuildStep *buildStep : std::as_const(connectedSteps)) - connect(buildStep, nullptr, m_instance, nullptr); + disconnect(buildStep, nullptr, m_instance, nullptr); d->m_outputWindow->popup(IOutputPane::NoModeSwitch); return false; } From b72f9dc8ef96d2a39a141d5814fc1ecefcd2a231 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 15 Sep 2023 11:00:50 +0200 Subject: [PATCH 1140/1777] OutputPane: Add `Reset to Default` to menu Resetting the visibility of the buttons to the default. Change-Id: I0f8bf1cd9c33ac0a318e992526657c564f51f170 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/coreplugin/outputpanemanager.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index d51b790ec32..4d8021acfb1 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -783,6 +783,23 @@ void OutputPaneManager::popupMenu() ++idx; } + menu.addSeparator(); + QAction *reset = menu.addAction(Tr::tr("Reset to Default")); + connect(reset, &QAction::triggered, this, [this] { + for (int i = 0; i < g_outputPanes.size(); ++i) { + OutputPaneData &data = g_outputPanes[i]; + const bool buttonVisible = data.pane->priorityInStatusBar() >= 0; + const bool paneVisible = currentIndex() == i; + if (buttonVisible) { + data.button->setChecked(paneVisible); + data.button->setVisible(true); + } else { + data.button->setChecked(false); + data.button->hide(); + } + } + }); + menu.exec(QCursor::pos()); } From 23fffcb429935da536228a8661b3362e4f602634 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 13 Sep 2023 12:20:47 +0200 Subject: [PATCH 1141/1777] AutoTest: Fix creating cmake and qbs based test projects Fixes creation of test projects for GTest, Boost Test and Catch2 when not using qmake as build system. Change-Id: I2fee3bcacf310e6dc4dbdd50bf8bd445dfb74328 Reviewed-by: David Schulz <david.schulz@qt.io> --- share/qtcreator/templates/wizards/autotest/wizard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/templates/wizards/autotest/wizard.json b/share/qtcreator/templates/wizards/autotest/wizard.json index 6f19d679eac..b7258a1b63f 100644 --- a/share/qtcreator/templates/wizards/autotest/wizard.json +++ b/share/qtcreator/templates/wizards/autotest/wizard.json @@ -251,7 +251,7 @@ "enabled": "%{IsTopLevelProject}", "data": { "projectFilePath": "%{ProjectFilePath}", - "requiredFeatures": [ "%{JS: (value('TestFrameWork') === 'QtQuickTest' ? 'QtSupport.Wizards.FeatureQtQuick.2' : ((value('BuildSystem') === 'qmake' || value('TestFrameWork') === 'QtTest') ? 'QtSupport.Wizards.FeatureQt' : 'DeviceType.Desktop' )) }" ] + "requiredFeatures": [ "%{JS: (value('TestFrameWork') === 'QtQuickTest' ? 'QtSupport.Wizards.FeatureQtQuick.2' : ((value('BuildSystem') === 'qmake' || value('TestFrameWork') === 'QtTest') ? 'QtSupport.Wizards.FeatureQt' : 'QtSupport.Wizards.FeatureDesktop' )) }" ] } }, { From 2842eeeeccd61f6b1a68c869b3c7db9a51bf1143 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 15 Sep 2023 13:23:14 +0200 Subject: [PATCH 1142/1777] AutoTest: Start renewal of wizard Remove option for enabling C++11 for gtest. C++14 is minimum nowadays when using a recent gtest version. Change-Id: Iaa1c07be37fba0ee80d3bc46cef7238e91a541cd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io> --- .../wizards/autotest/files/gtest_dependency.pri | 5 ----- share/qtcreator/templates/wizards/autotest/files/tst.pro | 6 +----- share/qtcreator/templates/wizards/autotest/files/tst.qbs | 5 +---- share/qtcreator/templates/wizards/autotest/files/tst.txt | 5 +---- share/qtcreator/templates/wizards/autotest/wizard.json | 9 --------- 5 files changed, 3 insertions(+), 27 deletions(-) diff --git a/share/qtcreator/templates/wizards/autotest/files/gtest_dependency.pri b/share/qtcreator/templates/wizards/autotest/files/gtest_dependency.pri index c064ef6242a..f6c7245419e 100644 --- a/share/qtcreator/templates/wizards/autotest/files/gtest_dependency.pri +++ b/share/qtcreator/templates/wizards/autotest/files/gtest_dependency.pri @@ -19,11 +19,6 @@ isEmpty(GOOGLETEST_DIR) { requires(exists($$GTEST_SRCDIR):exists($$GMOCK_SRCDIR)) -@if "%{GTestCXX11}" == "true" -DEFINES += \\ - GTEST_LANG_CXX11 -@endif - !isEmpty(GTEST_SRCDIR) { INCLUDEPATH *= \\ $$GTEST_SRCDIR \\ diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.pro b/share/qtcreator/templates/wizards/autotest/files/tst.pro index 1a4b00a5e8e..bc5ac3992f6 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.pro +++ b/share/qtcreator/templates/wizards/autotest/files/tst.pro @@ -37,11 +37,7 @@ SOURCES += \\ include(gtest_dependency.pri) TEMPLATE = app -@if "%{GTestCXX11}" == "true" -CONFIG += console c++11 -@else -CONFIG += console -@endif +CONFIG += console c++14 CONFIG -= app_bundle CONFIG += thread CONFIG -= qt diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.qbs b/share/qtcreator/templates/wizards/autotest/files/tst.qbs index dda4df02cc9..45590e1251a 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.qbs +++ b/share/qtcreator/templates/wizards/autotest/files/tst.qbs @@ -47,10 +47,7 @@ CppApplication { } } -@if "%{GTestCXX11}" == "true" - cpp.cxxLanguageVersion: "c++11" - cpp.defines: [ "GTEST_LANG_CXX11" ] -@endif + cpp.cxxLanguageVersion: "c++14" cpp.dynamicLibraries: { if (qbs.hostOS.contains("windows")) { return []; diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.txt b/share/qtcreator/templates/wizards/autotest/files/tst.txt index 739ec2c26a8..5e486318ce5 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.txt +++ b/share/qtcreator/templates/wizards/autotest/files/tst.txt @@ -71,11 +71,8 @@ target_link_libraries(%{TestCaseName} PRIVATE Qt${QT_VERSION_MAJOR}::QuickTest) @endif @if "%{TestFrameWork}" == "GTest" -@if "%{GTestCXX11}" == "true" -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) -add_definitions(-DGTEST_LANGUAGE_CXX11) -@endif find_package(Threads REQUIRED) diff --git a/share/qtcreator/templates/wizards/autotest/wizard.json b/share/qtcreator/templates/wizards/autotest/wizard.json index b7258a1b63f..71dd8de4b7a 100644 --- a/share/qtcreator/templates/wizards/autotest/wizard.json +++ b/share/qtcreator/templates/wizards/autotest/wizard.json @@ -156,15 +156,6 @@ "checked": false } }, - { - "name": "GTestCXX11", - "trDisplayName": "Enable C++11", - "visible": "%{JS: value('TestFrameWork') === 'GTest'}", - "type": "CheckBox", - "data": { - "checked": false - } - }, { "name": "GTestRepository", "trDisplayName": "Googletest source directory (optional):", From bdded29b33bb22b8996dfb5f04f85c02404f1c2c Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 14 Sep 2023 12:15:19 +0200 Subject: [PATCH 1143/1777] qbs build: Improve some base items Clean-up, simplification and modernization. Also fix the bugs uncovered by this. Change-Id: Ia3a77557f10faf9a901540a55fd6c07a2e986bf5 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- qbs/imports/QtcAutotest.qbs | 29 +++++------ qbs/imports/QtcCommercialPlugin.qbs | 2 - qbs/imports/QtcDocumentation.qbs | 38 +++++++------- qbs/imports/QtcLibrary.qbs | 23 +++------ qbs/imports/QtcManualtest.qbs | 21 ++++---- qbs/imports/QtcPlugin.qbs | 49 ++++++++----------- qbs/imports/QtcProduct.qbs | 34 ++++--------- qbs/imports/QtcTestApp.qbs | 1 - qbs/imports/QtcTestFiles.qbs | 2 - qbs/imports/QtcTool.qbs | 6 +-- qtcreator.qbs | 1 - src/libs/3rdparty/libptyqt/ptyqt.qbs | 5 +- src/libs/3rdparty/libvterm/vterm.qbs | 5 +- src/libs/3rdparty/winpty/winpty.qbs | 5 +- src/libs/extensionsystem/extensionsystem.qbs | 7 ++- src/libs/solutions/spinner/spinner.qbs | 9 +++- src/libs/solutions/tasking/tasking.qbs | 9 +++- src/libs/solutions/terminal/terminal.qbs | 8 +-- src/libs/sqlite/sqlite.qbs | 1 + src/libs/utils/mimetypes2/mimemagicrule_p.h | 2 +- src/libs/utils/mimetypes2/mimetype.h | 2 +- src/libs/utils/searchresultitem.h | 6 +-- src/libs/utils/stringtable.h | 2 +- src/libs/utils/utils.qbs | 2 +- .../clangtools/clangselectablefilesdialog.cpp | 1 + .../actionmanager/actioncontainer.cpp | 4 +- .../actionmanager/actioncontainer_p.h | 4 +- .../actionmanager/actionmanager.cpp | 3 +- .../actionmanager/actionmanager_p.h | 2 +- .../coreplugin/actionmanager/command.cpp | 4 +- .../coreplugin/actionmanager/command.h | 2 +- .../coreplugin/actionmanager/command_p.h | 2 +- .../coreplugin/actionmanager/commandbutton.h | 2 +- .../actionmanager/commandmappings.cpp | 4 +- .../actionmanager/commandmappings.h | 2 +- .../coreplugin/actionmanager/commandsfile.cpp | 4 +- src/plugins/coreplugin/actionsfilter.h | 2 +- .../coreplugin/basefilewizardfactory.h | 3 +- src/plugins/coreplugin/coreplugin.cpp | 15 +++--- src/plugins/coreplugin/designmode.h | 2 +- src/plugins/coreplugin/dialogs/ioptionspage.h | 2 +- .../coreplugin/dialogs/readonlyfilesdialog.h | 2 +- .../coreplugin/dialogs/restartdialog.h | 2 +- .../coreplugin/dialogs/shortcutsettings.h | 4 +- src/plugins/coreplugin/documentmanager.cpp | 27 +++++----- src/plugins/coreplugin/documentmanager.h | 2 +- src/plugins/coreplugin/editmode.h | 2 +- .../coreplugin/editormanager/editorarea.cpp | 9 ++-- .../editormanager/editormanager_p.h | 2 +- .../coreplugin/editormanager/editorview.cpp | 13 +++-- .../coreplugin/editormanager/editorwindow.cpp | 10 ++-- .../coreplugin/editormanager/ieditor.h | 4 +- .../coreplugin/editormanager/ieditorfactory.h | 2 +- .../editormanager/openeditorsview.h | 2 +- src/plugins/coreplugin/externaltool.h | 2 +- src/plugins/coreplugin/find/findplugin.cpp | 1 + src/plugins/coreplugin/find/findplugin.h | 2 +- src/plugins/coreplugin/find/findtoolbar.cpp | 2 +- .../find/highlightscrollbarcontroller.h | 10 ++-- src/plugins/coreplugin/find/ifindfilter.h | 2 +- src/plugins/coreplugin/find/ifindsupport.h | 2 +- src/plugins/coreplugin/find/itemviewfind.cpp | 3 +- src/plugins/coreplugin/find/optionspopup.cpp | 2 +- src/plugins/coreplugin/find/optionspopup.h | 2 +- .../coreplugin/find/searchresultwindow.h | 2 +- .../coreplugin/find/textfindconstants.h | 2 - .../coreplugin/foldernavigationwidget.cpp | 3 -- src/plugins/coreplugin/generalsettings.cpp | 5 +- src/plugins/coreplugin/iwizardfactory.h | 4 +- .../coreplugin/locator/commandlocator.cpp | 2 +- .../coreplugin/locator/directoryfilter.h | 3 +- .../coreplugin/locator/ilocatorfilter.h | 2 +- .../coreplugin/locator/javascriptfilter.h | 2 +- src/plugins/coreplugin/locator/locator.h | 4 +- .../coreplugin/locator/locator_test.cpp | 3 +- .../coreplugin/locator/locatormanager.cpp | 2 +- .../coreplugin/locator/locatormanager.h | 2 +- .../coreplugin/locator/locatorsettingspage.h | 2 +- .../locator/opendocumentsfilter.cpp | 3 +- .../coreplugin/locator/urllocatorfilter.h | 2 +- src/plugins/coreplugin/mimetypesettings.h | 2 +- src/plugins/coreplugin/modemanager.h | 2 +- src/plugins/coreplugin/navigationwidget.h | 2 +- .../progressmanager/futureprogress.h | 2 +- .../progressmanager/progressmanager.h | 2 +- .../progressmanager/progressmanager_win.cpp | 11 +++-- src/plugins/coreplugin/rightpane.cpp | 3 +- src/plugins/coreplugin/session.cpp | 2 - src/plugins/coreplugin/sessionmodel.cpp | 3 +- src/plugins/coreplugin/textdocument.cpp | 3 +- src/plugins/coreplugin/themechooser.h | 4 +- src/plugins/coreplugin/vcsmanager.cpp | 2 - src/plugins/cppeditor/cppeditorwidget.h | 1 + src/plugins/cppeditor/symbolsfindfilter.cpp | 5 +- src/plugins/terminal/terminalwidget.cpp | 1 + src/plugins/texteditor/basefilefind.cpp | 1 + src/plugins/texteditor/texteditor.h | 1 - 97 files changed, 240 insertions(+), 286 deletions(-) diff --git a/qbs/imports/QtcAutotest.qbs b/qbs/imports/QtcAutotest.qbs index 91427f75115..523f1cdbfd7 100644 --- a/qbs/imports/QtcAutotest.qbs +++ b/qbs/imports/QtcAutotest.qbs @@ -2,21 +2,19 @@ import qbs import qbs.FileInfo QtcProduct { - type: ["application", "autotest"] - - Depends { name: "autotest" } - Depends { name: "Qt.testlib" } - Depends { name: "copyable_resource" } - targetName: "tst_" + name.split(' ').join("") - // This needs to be absolute, because it is passed to one of the source files. destinationDirectory: project.buildDirectory + '/' + FileInfo.relativePath(project.ide_source_tree, sourceDirectory) - cpp.rpaths: [ - project.buildDirectory + '/' + qtc.ide_library_path, - project.buildDirectory + '/' + qtc.ide_plugin_path - ] + targetName: "tst_" + name.split(' ').join("") + type: ["application", "autotest"] + + installTags: [] + + Depends { name: "autotest" } + Depends { name: "Qt.testlib" } + Depends { name: "copyable_resource" } + cpp.defines: { var defines = base.filter(function(d) { return d !== "QT_RESTRICTED_CAST_FROM_ASCII"; }); var absLibExecPath = FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix, @@ -25,11 +23,10 @@ QtcProduct { defines.push('TEST_RELATIVE_LIBEXEC_PATH="' + relLibExecPath + '"'); return defines; } - - Group { - fileTagsFilter: product.type - qbs.install: false - } + cpp.rpaths: [ + project.buildDirectory + '/' + qtc.ide_library_path, + project.buildDirectory + '/' + qtc.ide_plugin_path + ] // The following would be conceptually right, but does not work currently as some autotests // (e.g. extensionsystem) do not work when installed, because they want hardcoded diff --git a/qbs/imports/QtcCommercialPlugin.qbs b/qbs/imports/QtcCommercialPlugin.qbs index 712ad9f1574..f26af46f2b5 100644 --- a/qbs/imports/QtcCommercialPlugin.qbs +++ b/qbs/imports/QtcCommercialPlugin.qbs @@ -1,5 +1,3 @@ -import qbs - QtcPlugin { Depends { name: "LicenseChecker"; required: false } cpp.defines: base.concat(LicenseChecker.present ? ["LICENSECHECKER"] : []) diff --git a/qbs/imports/QtcDocumentation.qbs b/qbs/imports/QtcDocumentation.qbs index c1b10310d26..3017114c8c4 100644 --- a/qbs/imports/QtcDocumentation.qbs +++ b/qbs/imports/QtcDocumentation.qbs @@ -1,38 +1,38 @@ -import qbs import qbs.FileInfo Product { builtByDefault: false type: [isOnlineDoc ? "qdoc-output" : "qch"] + Depends { name: "Qt.core" } Depends { name: "qtc" } - property path mainDocConfFile property bool isOnlineDoc + property path mainDocConfFile + property string versionTag: qtc.qtcreator_version.replace(/\.|-/g, "") + + Qt.core.qdocEnvironment: [ + "IDE_DISPLAY_NAME=" + qtc.ide_display_name, + "IDE_CASED_ID=" + qtc.ide_cased_id, + "IDE_ID=" + qtc.ide_id, + "QTCREATOR_COPYRIGHT_YEAR=" + qtc.qtcreator_copyright_year, + "QTC_VERSION=" + qtc.qtcreator_version, + "QTC_VERSION_TAG=" + qtc.qtcreator_version, + "QT_INSTALL_DOCS=" + Qt.core.docPath, + "QDOC_INDEX_DIR=" + Qt.core.docPath, + "SRCDIR=" + sourceDirectory, + "VERSION_TAG=" + versionTag, + ] Group { name: "main qdocconf file" prefix: product.sourceDirectory + '/' - files: [mainDocConfFile] - fileTags: ["qdocconf-main"] + files: mainDocConfFile + fileTags: "qdocconf-main" } - property string versionTag: qtc.qtcreator_version.replace(/\.|-/g, "") - Qt.core.qdocEnvironment: [ - "IDE_DISPLAY_NAME=" + qtc.ide_display_name, - "IDE_ID=" + qtc.ide_id, - "IDE_CASED_ID=" + qtc.ide_cased_id, - "QTCREATOR_COPYRIGHT_YEAR=" + qtc.qtcreator_copyright_year, - "QTC_VERSION=" + qtc.qtcreator_version, - "QTC_VERSION_TAG=" + qtc.qtcreator_version, - "SRCDIR=" + sourceDirectory, - "QT_INSTALL_DOCS=" + Qt.core.docPath, - "QDOC_INDEX_DIR=" + Qt.core.docPath, - "VERSION_TAG=" + versionTag - ] - Group { - fileTagsFilter: ["qch"] + fileTagsFilter: "qch" qbs.install: !qbs.targetOS.contains("macos") qbs.installDir: qtc.ide_doc_path } diff --git a/qbs/imports/QtcLibrary.qbs b/qbs/imports/QtcLibrary.qbs index 887a79dbb5d..a0b8b7c8176 100644 --- a/qbs/imports/QtcLibrary.qbs +++ b/qbs/imports/QtcLibrary.qbs @@ -1,19 +1,14 @@ -import qbs 1.0 import qbs.FileInfo import QtcFunctions QtcProduct { type: ["dynamiclibrary", "dynamiclibrary_symlink"] - installDir: qtc.ide_library_path - installTags: ["dynamiclibrary", "dynamiclibrary_symlink", "debuginfo_dll"] - useNonGuiPchFile: true - Depends { - condition: qtc.testsEnabled - name: "Qt.testlib" - } - - targetName: QtcFunctions.qtLibraryName(qbs, name) destinationDirectory: FileInfo.joinPaths(project.buildDirectory, qtc.ide_library_path) + targetName: QtcFunctions.qtLibraryName(qbs, name) + + installDir: qtc.ide_library_path + installTags: type.concat("debuginfo_dll") + useNonGuiPchFile: true cpp.linkerFlags: { var flags = base; @@ -23,17 +18,13 @@ QtcProduct { flags.push("-compatibility_version", qtc.qtcreator_compat_version); return flags; } - cpp.sonamePrefix: qbs.targetOS.contains("macos") - ? "@rpath" - : undefined + cpp.sonamePrefix: qbs.targetOS.contains("macos") ? "@rpath" : undefined cpp.rpaths: qbs.targetOS.contains("macos") ? ["@loader_path/../Frameworks"] : ["$ORIGIN", "$ORIGIN/.."] - property string libIncludeBase: ".." // #include <lib/header.h> - cpp.includePaths: [libIncludeBase] Export { Depends { name: "cpp" } - cpp.includePaths: [exportingProduct.libIncludeBase] + cpp.includePaths: project.ide_source_tree + "/src/libs" } } diff --git a/qbs/imports/QtcManualtest.qbs b/qbs/imports/QtcManualtest.qbs index cfa1abc1d8f..0c47bf1c8fa 100644 --- a/qbs/imports/QtcManualtest.qbs +++ b/qbs/imports/QtcManualtest.qbs @@ -1,23 +1,22 @@ -import qbs import qbs.FileInfo QtcProduct { - type: ["application"] + destinationDirectory: project.buildDirectory + '/' + + FileInfo.relativePath(project.ide_source_tree, sourceDirectory) + targetName: "tst_" + name.split(' ').join("") + type: "application" + + install: false Depends { name: "Qt.testlib" } Depends { name: "copyable_resource" } - targetName: "tst_" + name.split(' ').join("") - cpp.rpaths: [ - project.buildDirectory + '/' + qtc.ide_library_path, - project.buildDirectory + '/' + qtc.ide_plugin_path - ] cpp.defines: { var defines = base.filter(function(d) { return d !== "QT_RESTRICTED_CAST_FROM_ASCII"; }); return defines; } - - destinationDirectory: project.buildDirectory + '/' - + FileInfo.relativePath(project.ide_source_tree, sourceDirectory) - install: false + cpp.rpaths: [ + project.buildDirectory + '/' + qtc.ide_library_path, + project.buildDirectory + '/' + qtc.ide_plugin_path + ] } diff --git a/qbs/imports/QtcPlugin.qbs b/qbs/imports/QtcPlugin.qbs index 221789ef605..8c26050328f 100644 --- a/qbs/imports/QtcPlugin.qbs +++ b/qbs/imports/QtcPlugin.qbs @@ -1,38 +1,25 @@ -import qbs 1.0 import qbs.FileInfo import QtcFunctions QtcProduct { + destinationDirectory: FileInfo.joinPaths(project.buildDirectory, qtc.ide_plugin_path) + name: project.name + targetName: QtcFunctions.qtLibraryName(qbs, name) type: ["dynamiclibrary", "pluginSpec"] + installDir: qtc.ide_plugin_path installTags: ["dynamiclibrary", "debuginfo_dll"] useGuiPchFile: true - property var pluginRecommends: [] - property var pluginTestDepends: [] - - targetName: QtcFunctions.qtLibraryName(qbs, name) - destinationDirectory: FileInfo.joinPaths(project.buildDirectory, qtc.ide_plugin_path) + property stringList pluginRecommends: [] + property stringList pluginTestDepends: [] + Depends { name: "Qt.testlib"; condition: qtc.testsEnabled } Depends { name: "ExtensionSystem" } Depends { name: "pluginjson" } - pluginjson.useVcsData: false - Depends { - condition: qtc.testsEnabled - name: "Qt.testlib" - } - Properties { - condition: qbs.targetOS.contains("unix") - cpp.internalVersion: "" - } cpp.defines: base.concat([name.toUpperCase() + "_LIBRARY"]) - cpp.sonamePrefix: qbs.targetOS.contains("macos") - ? "@rpath" - : undefined - cpp.rpaths: qbs.targetOS.contains("macos") - ? ["@loader_path/../Frameworks", "@loader_path/../PlugIns"] - : ["$ORIGIN", "$ORIGIN/.."] + Properties { cpp.internalVersion: ""; condition: qbs.targetOS.contains("unix") } cpp.linkerFlags: { var flags = base; if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc")) @@ -41,20 +28,24 @@ QtcProduct { flags.push("-compatibility_version", qtc.qtcreator_compat_version); return flags; } - - property string pluginIncludeBase: ".." // #include <plugin/header.h> - cpp.includePaths: [pluginIncludeBase] + cpp.rpaths: qbs.targetOS.contains("macos") + ? ["@loader_path/../Frameworks", "@loader_path/../PlugIns"] + : ["$ORIGIN", "$ORIGIN/.."] + cpp.sonamePrefix: qbs.targetOS.contains("macos") + ? "@rpath" + : undefined + pluginjson.useVcsData: false Group { name: "PluginMetaData" - prefix: product.sourceDirectory + '/' - files: [ product.name + ".json.in" ] - fileTags: ["pluginJsonIn"] + prefix: sourceDirectory + '/' + files: product.name + ".json.in" + fileTags: "pluginJsonIn" } Export { - Depends { name: "ExtensionSystem" } Depends { name: "cpp" } - cpp.includePaths: [exportingProduct.pluginIncludeBase] + Depends { name: "ExtensionSystem" } + cpp.includePaths: ".." } } diff --git a/qbs/imports/QtcProduct.qbs b/qbs/imports/QtcProduct.qbs index e5f341704df..4841709e6d1 100644 --- a/qbs/imports/QtcProduct.qbs +++ b/qbs/imports/QtcProduct.qbs @@ -1,16 +1,13 @@ -import qbs 1.0 import qbs.FileInfo import qbs.Utilities -import QtcFunctions Product { - name: project.name version: qtc.qtcreator_version + property bool install: true property string installDir property string installSourceBase: destinationDirectory property stringList installTags: type - property string fileName: FileInfo.fileName(sourceDirectory) + ".qbs" property bool useNonGuiPchFile: false property bool useGuiPchFile: false property bool useQt: true @@ -20,15 +17,6 @@ Product { property bool sanitizable: true Depends { name: "cpp" } - Depends { name: "qtc" } - Depends { - name: product.name + " dev headers"; - required: false - Properties { - condition: Utilities.versionCompare(qbs.version, "1.13") >= 0 - enableFallback: false - } - } Depends { name: "Qt" condition: useQt @@ -36,10 +24,7 @@ Product { versionAtLeast: "6.2.0" } - // TODO: Should fall back to what came from Qt.core for Qt < 5.7, but we cannot express that - // atm. Conditionally pulling in a module that sets the property is also not possible, - // because conflicting scalar values would be reported (QBS-1225 would fix that). - cpp.minimumMacosVersion: project.minimumMacosVersion + Depends { name: "qtc" } cpp.cxxFlags: { var flags = []; @@ -62,7 +47,8 @@ Product { } return flags; } - + cpp.cxxLanguageVersion: "c++17" + cpp.defines: qtc.generalDefines Properties { condition: sanitizable && qbs.toolchain.contains("gcc") cpp.driverFlags: { @@ -76,9 +62,7 @@ Product { return flags; } } - - cpp.cxxLanguageVersion: "c++17" - cpp.defines: qtc.generalDefines + cpp.minimumMacosVersion: "10.15" cpp.minimumWindowsVersion: "6.1" cpp.useCxxPrecompiledHeader: useQt && (useNonGuiPchFile || useGuiPchFile) cpp.visibility: "minimal" @@ -94,15 +78,15 @@ Product { name: "standard pch file (non-gui)" condition: useNonGuiPchFile prefix: pathToSharedSources + '/' - files: ["qtcreator_pch.h"] - fileTags: ["cpp_pch_src"] + files: "qtcreator_pch.h" + fileTags: "cpp_pch_src" } Group { name: "standard pch file (gui)" condition: useGuiPchFile prefix: pathToSharedSources + '/' - files: ["qtcreator_gui_pch.h"] - fileTags: ["cpp_pch_src"] + files: "qtcreator_gui_pch.h" + fileTags: "cpp_pch_src" } } diff --git a/qbs/imports/QtcTestApp.qbs b/qbs/imports/QtcTestApp.qbs index 8411ea9b9e4..bca15924c7b 100644 --- a/qbs/imports/QtcTestApp.qbs +++ b/qbs/imports/QtcTestApp.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo CppApplication { diff --git a/qbs/imports/QtcTestFiles.qbs b/qbs/imports/QtcTestFiles.qbs index ab27a8df8a1..e1be695dac0 100644 --- a/qbs/imports/QtcTestFiles.qbs +++ b/qbs/imports/QtcTestFiles.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Group { name: "Unit tests" condition: qtc.testsEnabled diff --git a/qbs/imports/QtcTool.qbs b/qbs/imports/QtcTool.qbs index 1b389686502..e93829cc630 100644 --- a/qbs/imports/QtcTool.qbs +++ b/qbs/imports/QtcTool.qbs @@ -1,11 +1,11 @@ -import qbs import qbs.FileInfo QtcProduct { - type: ["application"] consoleApplication: true + type: "application" + installDir: qtc.ide_libexec_path - installTags: base.concat(["debuginfo_app"]) + installTags: type.concat("debuginfo_app") useNonGuiPchFile: true cpp.rpaths: { diff --git a/qtcreator.qbs b/qtcreator.qbs index c0779f4af10..c3aca8caca5 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -5,7 +5,6 @@ import qbs.FileInfo Project { name: "Qt Creator" minimumQbsVersion: "1.19.0" - property string minimumMacosVersion: "10.15" property bool withAutotests: qbs.buildVariant === "debug" property path ide_source_tree: path property pathList additionalPlugins: [] diff --git a/src/libs/3rdparty/libptyqt/ptyqt.qbs b/src/libs/3rdparty/libptyqt/ptyqt.qbs index 40c920a59ce..3b56dd8e465 100644 --- a/src/libs/3rdparty/libptyqt/ptyqt.qbs +++ b/src/libs/3rdparty/libptyqt/ptyqt.qbs @@ -1,12 +1,11 @@ QtcLibrary { name: "ptyqt" + type: "staticlibrary" Depends { name: "Qt.core" } Depends { name: "Qt.network"; condition: qbs.targetOS.contains("windows") } Depends { name: "winpty"; condition: qbs.targetOS.contains("windows") } - type: "staticlibrary" - files: [ "iptyprocess.h", "ptyqt.cpp", @@ -36,6 +35,6 @@ QtcLibrary { Export { Depends { name: "cpp" } Depends { name: "winpty"; condition: qbs.targetOS.contains("windows") } - cpp.includePaths: base.concat(exportingProduct.sourceDirectory) + cpp.includePaths: exportingProduct.sourceDirectory } } diff --git a/src/libs/3rdparty/libvterm/vterm.qbs b/src/libs/3rdparty/libvterm/vterm.qbs index a1525879f53..e35658908da 100644 --- a/src/libs/3rdparty/libvterm/vterm.qbs +++ b/src/libs/3rdparty/libvterm/vterm.qbs @@ -2,7 +2,10 @@ QtcLibrary { name: "vterm" type: "staticlibrary" + useQt: false + Depends { name: "cpp" } + cpp.includePaths: base.concat("include") cpp.warningLevel: "none" @@ -27,6 +30,6 @@ QtcLibrary { Export { Depends { name: "cpp" } - cpp.includePaths: base.concat("include") + cpp.includePaths: "include" } } diff --git a/src/libs/3rdparty/winpty/winpty.qbs b/src/libs/3rdparty/winpty/winpty.qbs index f6160fe9e62..35d56f92655 100644 --- a/src/libs/3rdparty/winpty/winpty.qbs +++ b/src/libs/3rdparty/winpty/winpty.qbs @@ -5,7 +5,6 @@ Project { name: "Winpty" condition: qbs.targetOS.contains("windows") - Product { name: "winpty_genversion_header" type: "hpp" @@ -199,8 +198,8 @@ Project { Export { Depends { name: "cpp" } - cpp.defines: base.concat("COMPILING_WINPTY_DLL") - cpp.includePaths: base.concat(exportingProduct.sourceDirectory + "/src/include") + cpp.defines: "COMPILING_WINPTY_DLL" + cpp.includePaths: exportingProduct.sourceDirectory + "/src/include" } } } diff --git a/src/libs/extensionsystem/extensionsystem.qbs b/src/libs/extensionsystem/extensionsystem.qbs index 414060fd3ba..07fc87fd286 100644 --- a/src/libs/extensionsystem/extensionsystem.qbs +++ b/src/libs/extensionsystem/extensionsystem.qbs @@ -1,12 +1,11 @@ QtcLibrary { name: "ExtensionSystem" - cpp.defines: base.concat([ - "EXTENSIONSYSTEM_LIBRARY", - "IDE_TEST_DIR=\".\"" - ]) + cpp.defines: base.concat(["EXTENSIONSYSTEM_LIBRARY", "IDE_TEST_DIR=\".\""]) Depends { name: "Qt"; submodules: ["core", "widgets"] } + Depends { name: "Qt.testlib"; condition: qtc.testsEnabled } + Depends { name: "Aggregation" } Depends { name: "Utils" } diff --git a/src/libs/solutions/spinner/spinner.qbs b/src/libs/solutions/spinner/spinner.qbs index cd830d107ec..d02858d0484 100644 --- a/src/libs/solutions/spinner/spinner.qbs +++ b/src/libs/solutions/spinner/spinner.qbs @@ -1,6 +1,8 @@ QtcLibrary { name: "Spinner" - Depends { name: "Qt"; submodules: ["core", "widgets"] } + + Depends { name: "Qt.widgets" } + cpp.defines: base.concat("SPINNER_LIBRARY") files: [ @@ -9,5 +11,10 @@ QtcLibrary { "spinner.qrc", "spinner_global.h", ] + + Export { + Depends { name: "cpp" } + cpp.includePaths: ".." + } } diff --git a/src/libs/solutions/tasking/tasking.qbs b/src/libs/solutions/tasking/tasking.qbs index fa0a5ebacc9..fba42b10b1d 100644 --- a/src/libs/solutions/tasking/tasking.qbs +++ b/src/libs/solutions/tasking/tasking.qbs @@ -1,6 +1,8 @@ QtcLibrary { name: "Tasking" - Depends { name: "Qt"; submodules: ["concurrent", "core", "network"] } + + Depends { name: "Qt"; submodules: ["concurrent", "network"] } + cpp.defines: base.concat("TASKING_LIBRARY") files: [ @@ -13,5 +15,10 @@ QtcLibrary { "tasktree.cpp", "tasktree.h", ] + + Export { + Depends { name: "cpp" } + cpp.includePaths: ["..", "../.."] + } } diff --git a/src/libs/solutions/terminal/terminal.qbs b/src/libs/solutions/terminal/terminal.qbs index cb312890fb6..aa1293e3994 100644 --- a/src/libs/solutions/terminal/terminal.qbs +++ b/src/libs/solutions/terminal/terminal.qbs @@ -1,14 +1,10 @@ -import qbs 1.0 - QtcLibrary { name: "TerminalLib" Depends { name: "vterm" } - Depends { name: "Qt"; submodules: "widgets" } + Depends { name: "Qt.widgets" } - cpp.defines: base.concat([ - "TERMINALLIB_LIBRARY" - ]) + cpp.defines: base.concat("TERMINALLIB_LIBRARY") files: [ "celliterator.cpp", diff --git a/src/libs/sqlite/sqlite.qbs b/src/libs/sqlite/sqlite.qbs index f0c58790006..3f1b1050c9d 100644 --- a/src/libs/sqlite/sqlite.qbs +++ b/src/libs/sqlite/sqlite.qbs @@ -3,6 +3,7 @@ import qbs 1.0 QtcLibrary { name: "Sqlite" + Depends { name: "Utils" } Depends { name: "sqlite_sources" } property string exportedIncludeDir: sqlite_sources.includeDir diff --git a/src/libs/utils/mimetypes2/mimemagicrule_p.h b/src/libs/utils/mimetypes2/mimemagicrule_p.h index fe2e0ff3e42..293f61ca914 100644 --- a/src/libs/utils/mimetypes2/mimemagicrule_p.h +++ b/src/libs/utils/mimetypes2/mimemagicrule_p.h @@ -14,7 +14,7 @@ // We mean it. // -#include <utils/utils_global.h> +#include "../utils_global.h" #include <QtCore/qbytearray.h> #include <QtCore/qlist.h> diff --git a/src/libs/utils/mimetypes2/mimetype.h b/src/libs/utils/mimetypes2/mimetype.h index ec28140d6ae..b512aaae723 100644 --- a/src/libs/utils/mimetypes2/mimetype.h +++ b/src/libs/utils/mimetypes2/mimetype.h @@ -4,7 +4,7 @@ #pragma once -#include <utils/utils_global.h> +#include "../utils_global.h" #include <QtCore/qobjectdefs.h> #include <QtCore/qshareddata.h> diff --git a/src/libs/utils/searchresultitem.h b/src/libs/utils/searchresultitem.h index bbaaa1caf5e..766da19ffdc 100644 --- a/src/libs/utils/searchresultitem.h +++ b/src/libs/utils/searchresultitem.h @@ -5,9 +5,9 @@ #include "utils_global.h" -#include <utils/filepath.h> -#include <utils/hostosinfo.h> -#include <utils/textutils.h> +#include "filepath.h" +#include "hostosinfo.h" +#include "textutils.h" #include <QColor> #include <QHash> diff --git a/src/libs/utils/stringtable.h b/src/libs/utils/stringtable.h index 1394b1c853d..eedfe513552 100644 --- a/src/libs/utils/stringtable.h +++ b/src/libs/utils/stringtable.h @@ -3,7 +3,7 @@ #pragma once -#include <utils/utils_global.h> +#include "utils_global.h" namespace Utils::StringTable { diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 0c74fedc443..768a7c83acf 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -472,6 +472,6 @@ QtcLibrary { Export { Depends { name: "Qt"; submodules: ["concurrent", "widgets" ] } Depends { name: "Tasking" } - cpp.includePaths: base.concat("mimetypes2") + cpp.includePaths: "mimetypes2" } } diff --git a/src/plugins/clangtools/clangselectablefilesdialog.cpp b/src/plugins/clangtools/clangselectablefilesdialog.cpp index 410f4847692..414c320b8bc 100644 --- a/src/plugins/clangtools/clangselectablefilesdialog.cpp +++ b/src/plugins/clangtools/clangselectablefilesdialog.cpp @@ -7,6 +7,7 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/find/itemviewfind.h> +#include <coreplugin/find/textfindconstants.h> #include <cppeditor/projectinfo.h> #include <projectexplorer/selectablefilesmodel.h> #include <texteditor/textdocument.h> diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp index f1e40c8f6b3..914a750e09a 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp +++ b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp @@ -4,8 +4,8 @@ #include "actioncontainer_p.h" #include "actionmanager.h" -#include <coreplugin/coreconstants.h> -#include <coreplugin/icontext.h> +#include "../coreconstants.h" +#include "../icontext.h" #include <utils/qtcassert.h> diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h index 509a45ebfcf..cb94852aa0c 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h +++ b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h @@ -5,8 +5,8 @@ #include "actionmanager_p.h" -#include <coreplugin/actionmanager/actioncontainer.h> -#include <coreplugin/actionmanager/command.h> +#include "actioncontainer.h" +#include "command.h" #include <utils/touchbar/touchbar.h> diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index d3ae55ab163..57d1f19e15f 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -5,8 +5,7 @@ #include "actionmanager_p.h" #include "actioncontainer_p.h" #include "command_p.h" - -#include <coreplugin/icore.h> +#include "../icore.h" #include <utils/algorithm.h> #include <utils/fadingindicator.h> diff --git a/src/plugins/coreplugin/actionmanager/actionmanager_p.h b/src/plugins/coreplugin/actionmanager/actionmanager_p.h index b305369ab58..c10f109a6ea 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager_p.h +++ b/src/plugins/coreplugin/actionmanager/actionmanager_p.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/icontext.h> +#include "../icontext.h" #include <QMap> #include <QHash> diff --git a/src/plugins/coreplugin/actionmanager/command.cpp b/src/plugins/coreplugin/actionmanager/command.cpp index 23b398791f2..fdb1bdc4016 100644 --- a/src/plugins/coreplugin/actionmanager/command.cpp +++ b/src/plugins/coreplugin/actionmanager/command.cpp @@ -4,8 +4,8 @@ #include "command.h" #include "command_p.h" -#include <coreplugin/coreconstants.h> -#include <coreplugin/icontext.h> +#include "../coreconstants.h" +#include "../icontext.h" #include <utils/hostosinfo.h> #include <utils/stringutils.h> diff --git a/src/plugins/coreplugin/actionmanager/command.h b/src/plugins/coreplugin/actionmanager/command.h index 73dd92a5eb8..206acafaefc 100644 --- a/src/plugins/coreplugin/actionmanager/command.h +++ b/src/plugins/coreplugin/actionmanager/command.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <utils/hostosinfo.h> #include <utils/id.h> diff --git a/src/plugins/coreplugin/actionmanager/command_p.h b/src/plugins/coreplugin/actionmanager/command_p.h index 04cbc44f13e..d90b807c553 100644 --- a/src/plugins/coreplugin/actionmanager/command_p.h +++ b/src/plugins/coreplugin/actionmanager/command_p.h @@ -5,7 +5,7 @@ #include "command.h" -#include <coreplugin/icontext.h> +#include "../icontext.h" #include <utils/id.h> #include <utils/proxyaction.h> diff --git a/src/plugins/coreplugin/actionmanager/commandbutton.h b/src/plugins/coreplugin/actionmanager/commandbutton.h index c5b6d71852c..db46225b08f 100644 --- a/src/plugins/coreplugin/actionmanager/commandbutton.h +++ b/src/plugins/coreplugin/actionmanager/commandbutton.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <utils/id.h> diff --git a/src/plugins/coreplugin/actionmanager/commandmappings.cpp b/src/plugins/coreplugin/actionmanager/commandmappings.cpp index 15765698cbd..276004bdb78 100644 --- a/src/plugins/coreplugin/actionmanager/commandmappings.cpp +++ b/src/plugins/coreplugin/actionmanager/commandmappings.cpp @@ -3,8 +3,8 @@ #include "commandmappings.h" -#include <coreplugin/coreplugintr.h> -#include <coreplugin/dialogs/shortcutsettings.h> +#include "../coreplugintr.h" +#include "../dialogs/shortcutsettings.h" #include <utils/fancylineedit.h> #include <utils/headerviewstretcher.h> diff --git a/src/plugins/coreplugin/actionmanager/commandmappings.h b/src/plugins/coreplugin/actionmanager/commandmappings.h index a6725265500..d72adf00f32 100644 --- a/src/plugins/coreplugin/actionmanager/commandmappings.h +++ b/src/plugins/coreplugin/actionmanager/commandmappings.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <QWidget> diff --git a/src/plugins/coreplugin/actionmanager/commandsfile.cpp b/src/plugins/coreplugin/actionmanager/commandsfile.cpp index ccd551751e7..18866662ba2 100644 --- a/src/plugins/coreplugin/actionmanager/commandsfile.cpp +++ b/src/plugins/coreplugin/actionmanager/commandsfile.cpp @@ -3,8 +3,8 @@ #include "commandsfile.h" #include "command.h" -#include <coreplugin/dialogs/shortcutsettings.h> -#include <coreplugin/icore.h> +#include "../dialogs/shortcutsettings.h" +#include "../icore.h" #include <utils/qtcassert.h> #include <utils/fileutils.h> diff --git a/src/plugins/coreplugin/actionsfilter.h b/src/plugins/coreplugin/actionsfilter.h index 692dea95d26..25e788abaa5 100644 --- a/src/plugins/coreplugin/actionsfilter.h +++ b/src/plugins/coreplugin/actionsfilter.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/locator/ilocatorfilter.h> +#include "locator/ilocatorfilter.h" #include <QAction> #include <QPointer> diff --git a/src/plugins/coreplugin/basefilewizardfactory.h b/src/plugins/coreplugin/basefilewizardfactory.h index e6b1ed172a6..0d9033d6d59 100644 --- a/src/plugins/coreplugin/basefilewizardfactory.h +++ b/src/plugins/coreplugin/basefilewizardfactory.h @@ -5,8 +5,7 @@ #include "core_global.h" #include "generatedfile.h" - -#include <coreplugin/iwizardfactory.h> +#include "iwizardfactory.h" #include <utils/filepath.h> diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 1ac3332288e..c9eabf0a3b4 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -14,14 +14,13 @@ #include "session.h" #include "themechooser.h" -#include <coreplugin/actionmanager/actionmanager.h> -#include <coreplugin/documentmanager.h> -#include <coreplugin/editormanager/editormanager.h> -#include <coreplugin/find/findplugin.h> -#include <coreplugin/find/searchresultwindow.h> -#include <coreplugin/locator/locator.h> -#include <coreplugin/coreconstants.h> -#include <coreplugin/fileutils.h> +#include "actionmanager/actionmanager.h" +#include "documentmanager.h" +#include "editormanager/editormanager.h" +#include "find/findplugin.h" +#include "locator/locator.h" +#include "coreconstants.h" +#include "fileutils.h" #include <extensionsystem/pluginerroroverview.h> #include <extensionsystem/pluginmanager.h> diff --git a/src/plugins/coreplugin/designmode.h b/src/plugins/coreplugin/designmode.h index 844bcaf259f..da9a6f70ab6 100644 --- a/src/plugins/coreplugin/designmode.h +++ b/src/plugins/coreplugin/designmode.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/imode.h> +#include "imode.h" namespace Core { class IEditor; diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index cccab844374..e230cab904c 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <utils/aspects.h> #include <utils/id.h> diff --git a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.h b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.h index 89f22372408..09e717cd270 100644 --- a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.h +++ b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <utils/filepath.h> diff --git a/src/plugins/coreplugin/dialogs/restartdialog.h b/src/plugins/coreplugin/dialogs/restartdialog.h index 65646f3389a..c7f8fd43c51 100644 --- a/src/plugins/coreplugin/dialogs/restartdialog.h +++ b/src/plugins/coreplugin/dialogs/restartdialog.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <QCoreApplication> #include <QMessageBox> diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.h b/src/plugins/coreplugin/dialogs/shortcutsettings.h index 49297b3d501..36e175ff673 100644 --- a/src/plugins/coreplugin/dialogs/shortcutsettings.h +++ b/src/plugins/coreplugin/dialogs/shortcutsettings.h @@ -3,8 +3,8 @@ #pragma once -#include <coreplugin/actionmanager/commandmappings.h> -#include <coreplugin/dialogs/ioptionspage.h> +#include "../actionmanager/commandmappings.h" +#include "ioptionspage.h" #include <QGridLayout> #include <QKeySequence> diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index 6bd4554935e..859119dc1c2 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -3,25 +3,24 @@ #include "documentmanager.h" +#include "actionmanager/actioncontainer.h" +#include "actionmanager/actionmanager.h" +#include "actionmanager/command.h" #include "coreconstants.h" #include "coreplugintr.h" +#include "diffservice.h" +#include "dialogs/filepropertiesdialog.h" +#include "dialogs/readonlyfilesdialog.h" +#include "dialogs/saveitemsdialog.h" +#include "editormanager/editormanager.h" +#include "editormanager/editormanager_p.h" +#include "editormanager/editorview.h" +#include "editormanager/ieditor.h" +#include "editormanager/ieditorfactory.h" #include "icore.h" #include "idocument.h" #include "idocumentfactory.h" - -#include <coreplugin/actionmanager/actioncontainer.h> -#include <coreplugin/actionmanager/actionmanager.h> -#include <coreplugin/actionmanager/command.h> -#include <coreplugin/diffservice.h> -#include <coreplugin/dialogs/filepropertiesdialog.h> -#include <coreplugin/dialogs/readonlyfilesdialog.h> -#include <coreplugin/dialogs/saveitemsdialog.h> -#include <coreplugin/editormanager/editormanager.h> -#include <coreplugin/editormanager/editormanager_p.h> -#include <coreplugin/editormanager/editorview.h> -#include <coreplugin/editormanager/ieditor.h> -#include <coreplugin/editormanager/ieditorfactory.h> -#include <coreplugin/systemsettings.h> +#include "systemsettings.h" #include <extensionsystem/pluginmanager.h> diff --git a/src/plugins/coreplugin/documentmanager.h b/src/plugins/coreplugin/documentmanager.h index ea40dd43b49..7f6e0eff55b 100644 --- a/src/plugins/coreplugin/documentmanager.h +++ b/src/plugins/coreplugin/documentmanager.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "core_global.h" #include <utils/filepath.h> #include <utils/id.h> diff --git a/src/plugins/coreplugin/editmode.h b/src/plugins/coreplugin/editmode.h index 06bfdc3bdb9..1e7d36d5e8e 100644 --- a/src/plugins/coreplugin/editmode.h +++ b/src/plugins/coreplugin/editmode.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/imode.h> +#include "imode.h" QT_BEGIN_NAMESPACE class QSplitter; diff --git a/src/plugins/coreplugin/editormanager/editorarea.cpp b/src/plugins/coreplugin/editormanager/editorarea.cpp index e807fb55dd4..2b47988c3b3 100644 --- a/src/plugins/coreplugin/editormanager/editorarea.cpp +++ b/src/plugins/coreplugin/editormanager/editorarea.cpp @@ -6,10 +6,11 @@ #include "editormanager.h" #include "ieditor.h" -#include <coreplugin/coreconstants.h> -#include <coreplugin/icontext.h> -#include <coreplugin/idocument.h> -#include <coreplugin/icore.h> +#include "../coreconstants.h" +#include "../icontext.h" +#include "../icore.h" +#include "../idocument.h" + #include <utils/qtcassert.h> #include <QApplication> diff --git a/src/plugins/coreplugin/editormanager/editormanager_p.h b/src/plugins/coreplugin/editormanager/editormanager_p.h index 1d8aba0b92e..7e3863e5cf6 100644 --- a/src/plugins/coreplugin/editormanager/editormanager_p.h +++ b/src/plugins/coreplugin/editormanager/editormanager_p.h @@ -10,7 +10,7 @@ #include "ieditor.h" #include "ieditorfactory.h" -#include <coreplugin/idocument.h> +#include "../idocument.h" #include <QList> #include <QObject> diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index c922dae9515..0229116ff85 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -7,14 +7,13 @@ #include "editormanager_p.h" #include "documentmodel.h" #include "documentmodel_p.h" +#include "../actionmanager/actionmanager.h" +#include "../editormanager/ieditor.h" +#include "../editortoolbar.h" +#include "../findplaceholder.h" +#include "../icore.h" +#include "../minisplitter.h" -#include <coreplugin/actionmanager/actionmanager.h> -#include <coreplugin/editormanager/ieditor.h> -#include <coreplugin/editortoolbar.h> -#include <coreplugin/findplaceholder.h> -#include <coreplugin/icore.h> -#include <coreplugin/locator/locatorconstants.h> -#include <coreplugin/minisplitter.h> #include <utils/algorithm.h> #include <utils/infobar.h> #include <utils/qtcassert.h> diff --git a/src/plugins/coreplugin/editormanager/editorwindow.cpp b/src/plugins/coreplugin/editormanager/editorwindow.cpp index 0044804e236..3e23a7285ed 100644 --- a/src/plugins/coreplugin/editormanager/editorwindow.cpp +++ b/src/plugins/coreplugin/editormanager/editorwindow.cpp @@ -5,13 +5,13 @@ #include "editorarea.h" #include "editormanager_p.h" +#include "../coreconstants.h" +#include "../icontext.h" +#include "../icore.h" +#include "../locator/locatormanager.h" +#include "../minisplitter.h" #include <aggregation/aggregate.h> -#include <coreplugin/coreconstants.h> -#include <coreplugin/icontext.h> -#include <coreplugin/icore.h> -#include <coreplugin/locator/locatormanager.h> -#include <coreplugin/minisplitter.h> #include <utils/qtcassert.h> #include <QStatusBar> diff --git a/src/plugins/coreplugin/editormanager/ieditor.h b/src/plugins/coreplugin/editormanager/ieditor.h index 01415844231..2d8bd4b6db4 100644 --- a/src/plugins/coreplugin/editormanager/ieditor.h +++ b/src/plugins/coreplugin/editormanager/ieditor.h @@ -3,8 +3,8 @@ #pragma once -#include <coreplugin/core_global.h> -#include <coreplugin/icontext.h> +#include "../core_global.h" +#include "../icontext.h" #include <QMetaType> diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.h b/src/plugins/coreplugin/editormanager/ieditorfactory.h index 29b07f384ff..ddc27eebc33 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory.h +++ b/src/plugins/coreplugin/editormanager/ieditorfactory.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <utils/id.h> diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.h b/src/plugins/coreplugin/editormanager/openeditorsview.h index 0ba5a41961c..013ff538d69 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.h +++ b/src/plugins/coreplugin/editormanager/openeditorsview.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/inavigationwidgetfactory.h> +#include "../inavigationwidgetfactory.h" namespace Core::Internal { diff --git a/src/plugins/coreplugin/externaltool.h b/src/plugins/coreplugin/externaltool.h index d92d6099bc9..15b420f1808 100644 --- a/src/plugins/coreplugin/externaltool.h +++ b/src/plugins/coreplugin/externaltool.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "core_global.h" #include <utils/environment.h> #include <utils/filepath.h> diff --git a/src/plugins/coreplugin/find/findplugin.cpp b/src/plugins/coreplugin/find/findplugin.cpp index 69679798b79..5cf8eedd2e7 100644 --- a/src/plugins/coreplugin/find/findplugin.cpp +++ b/src/plugins/coreplugin/find/findplugin.cpp @@ -8,6 +8,7 @@ #include "findtoolwindow.h" #include "ifindfilter.h" #include "searchresultwindow.h" +#include "textfindconstants.h" #include "../actionmanager/actioncontainer.h" #include "../actionmanager/actionmanager.h" #include "../actionmanager/command.h" diff --git a/src/plugins/coreplugin/find/findplugin.h b/src/plugins/coreplugin/find/findplugin.h index 54a3c7234e3..2ddb9b797a4 100644 --- a/src/plugins/coreplugin/find/findplugin.h +++ b/src/plugins/coreplugin/find/findplugin.h @@ -3,7 +3,7 @@ #pragma once -#include "textfindconstants.h" +#include "../core_global.h" #include <utils/filesearch.h> diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index 187243ab4f9..caece8a0737 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -6,11 +6,11 @@ #include "ifindfilter.h" #include "findplugin.h" #include "optionspopup.h" +#include "textfindconstants.h" #include "../actionmanager/actioncontainer.h" #include "../actionmanager/actionmanager.h" #include "../actionmanager/command.h" #include "../coreicons.h" -#include "../coreplugin.h" #include "../coreplugintr.h" #include "../findplaceholder.h" #include "../icontext.h" diff --git a/src/plugins/coreplugin/find/highlightscrollbarcontroller.h b/src/plugins/coreplugin/find/highlightscrollbarcontroller.h index 60177ae20a5..3b14c9269a4 100644 --- a/src/plugins/coreplugin/find/highlightscrollbarcontroller.h +++ b/src/plugins/coreplugin/find/highlightscrollbarcontroller.h @@ -3,15 +3,15 @@ #pragma once -#include <QHash> -#include <QPointer> -#include <QVector> - -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <utils/id.h> #include <utils/theme/theme.h> +#include <QHash> +#include <QPointer> +#include <QVector> + QT_BEGIN_NAMESPACE class QAbstractScrollArea; class QScrollBar; diff --git a/src/plugins/coreplugin/find/ifindfilter.h b/src/plugins/coreplugin/find/ifindfilter.h index b8df36e536e..107439fdfd8 100644 --- a/src/plugins/coreplugin/find/ifindfilter.h +++ b/src/plugins/coreplugin/find/ifindfilter.h @@ -3,7 +3,7 @@ #pragma once -#include "textfindconstants.h" +#include "../core_global.h" #include <utils/filesearch.h> diff --git a/src/plugins/coreplugin/find/ifindsupport.h b/src/plugins/coreplugin/find/ifindsupport.h index c9509b79f3a..39ed5b5af6d 100644 --- a/src/plugins/coreplugin/find/ifindsupport.h +++ b/src/plugins/coreplugin/find/ifindsupport.h @@ -3,7 +3,7 @@ #pragma once -#include "textfindconstants.h" +#include "../core_global.h" #include <utils/filesearch.h> diff --git a/src/plugins/coreplugin/find/itemviewfind.cpp b/src/plugins/coreplugin/find/itemviewfind.cpp index 9cb9125b1ef..2fe4ae31003 100644 --- a/src/plugins/coreplugin/find/itemviewfind.cpp +++ b/src/plugins/coreplugin/find/itemviewfind.cpp @@ -3,8 +3,9 @@ #include "itemviewfind.h" +#include "../findplaceholder.h" + #include <aggregation/aggregate.h> -#include <coreplugin/findplaceholder.h> #include <QModelIndex> #include <QTextCursor> diff --git a/src/plugins/coreplugin/find/optionspopup.cpp b/src/plugins/coreplugin/find/optionspopup.cpp index 9f5f11ad2d0..2f61ebdbb2c 100644 --- a/src/plugins/coreplugin/find/optionspopup.cpp +++ b/src/plugins/coreplugin/find/optionspopup.cpp @@ -3,7 +3,7 @@ #include "optionspopup.h" -#include <coreplugin/actionmanager/actionmanager.h> +#include "../actionmanager/actionmanager.h" #include <utils/qtcassert.h> diff --git a/src/plugins/coreplugin/find/optionspopup.h b/src/plugins/coreplugin/find/optionspopup.h index 3356dc50556..329e97db9d0 100644 --- a/src/plugins/coreplugin/find/optionspopup.h +++ b/src/plugins/coreplugin/find/optionspopup.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <utils/id.h> diff --git a/src/plugins/coreplugin/find/searchresultwindow.h b/src/plugins/coreplugin/find/searchresultwindow.h index 1aac86070c4..c2b7a13b273 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.h +++ b/src/plugins/coreplugin/find/searchresultwindow.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/ioutputpane.h> +#include "../ioutputpane.h" #include <utils/searchresultitem.h> diff --git a/src/plugins/coreplugin/find/textfindconstants.h b/src/plugins/coreplugin/find/textfindconstants.h index 83e9888dfca..e058ae4df2e 100644 --- a/src/plugins/coreplugin/find/textfindconstants.h +++ b/src/plugins/coreplugin/find/textfindconstants.h @@ -3,8 +3,6 @@ #pragma once -#include <coreplugin/core_global.h> - #include <QMetaType> #include <QFlags> #include <QTextDocument> diff --git a/src/plugins/coreplugin/foldernavigationwidget.cpp b/src/plugins/coreplugin/foldernavigationwidget.cpp index 5df76f44a4d..82101df8131 100644 --- a/src/plugins/coreplugin/foldernavigationwidget.cpp +++ b/src/plugins/coreplugin/foldernavigationwidget.cpp @@ -7,7 +7,6 @@ #include "actionmanager/command.h" #include "coreicons.h" #include "coreplugintr.h" -#include "diffservice.h" #include "documentmanager.h" #include "editormanager/editormanager.h" #include "editormanager/ieditor.h" @@ -19,8 +18,6 @@ #include <extensionsystem/pluginmanager.h> -#include <texteditor/textdocument.h> - #include <utils/algorithm.h> #include <utils/filecrumblabel.h> #include <utils/filepath.h> diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index f0d2046a32f..07b539da91e 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -1,15 +1,14 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#include "dialogs/restartdialog.h" +#include "dialogs/ioptionspage.h" #include "generalsettings.h" #include "coreconstants.h" #include "coreplugintr.h" #include "icore.h" #include "themechooser.h" -#include <coreplugin/dialogs/restartdialog.h> -#include <coreplugin/dialogs/ioptionspage.h> - #include <extensionsystem/pluginmanager.h> #include <utils/algorithm.h> diff --git a/src/plugins/coreplugin/iwizardfactory.h b/src/plugins/coreplugin/iwizardfactory.h index 26dfe8bbd85..e9771f7aa1d 100644 --- a/src/plugins/coreplugin/iwizardfactory.h +++ b/src/plugins/coreplugin/iwizardfactory.h @@ -3,8 +3,8 @@ #pragma once -#include <coreplugin/core_global.h> -#include <coreplugin/featureprovider.h> +#include "core_global.h" +#include "featureprovider.h" #include <QIcon> #include <QObject> diff --git a/src/plugins/coreplugin/locator/commandlocator.cpp b/src/plugins/coreplugin/locator/commandlocator.cpp index e960b4df85d..b740bdeeacd 100644 --- a/src/plugins/coreplugin/locator/commandlocator.cpp +++ b/src/plugins/coreplugin/locator/commandlocator.cpp @@ -3,7 +3,7 @@ #include "commandlocator.h" -#include <coreplugin/actionmanager/command.h> +#include "../actionmanager/command.h" #include <utils/stringutils.h> diff --git a/src/plugins/coreplugin/locator/directoryfilter.h b/src/plugins/coreplugin/locator/directoryfilter.h index 485377d2a15..452a1b20e75 100644 --- a/src/plugins/coreplugin/locator/directoryfilter.h +++ b/src/plugins/coreplugin/locator/directoryfilter.h @@ -3,10 +3,9 @@ #pragma once +#include "../core_global.h" #include "ilocatorfilter.h" -#include <coreplugin/core_global.h> - namespace Core { class CORE_EXPORT DirectoryFilter : public ILocatorFilter diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.h b/src/plugins/coreplugin/locator/ilocatorfilter.h index fbc68bc647c..57da6a2d85f 100644 --- a/src/plugins/coreplugin/locator/ilocatorfilter.h +++ b/src/plugins/coreplugin/locator/ilocatorfilter.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <solutions/tasking/tasktree.h> diff --git a/src/plugins/coreplugin/locator/javascriptfilter.h b/src/plugins/coreplugin/locator/javascriptfilter.h index 8b7112fd27d..f5013285cc1 100644 --- a/src/plugins/coreplugin/locator/javascriptfilter.h +++ b/src/plugins/coreplugin/locator/javascriptfilter.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/locator/ilocatorfilter.h> +#include "ilocatorfilter.h" class JavaScriptEngine; diff --git a/src/plugins/coreplugin/locator/locator.h b/src/plugins/coreplugin/locator/locator.h index 45d4b650508..e2069e99e99 100644 --- a/src/plugins/coreplugin/locator/locator.h +++ b/src/plugins/coreplugin/locator/locator.h @@ -4,15 +4,13 @@ #pragma once #include "ilocatorfilter.h" +#include "../actionmanager/command.h" -#include <coreplugin/actionmanager/command.h> #include <extensionsystem/iplugin.h> #include <QObject> #include <QTimer> -#include <functional> - namespace Tasking { class TaskTree; } namespace Core { diff --git a/src/plugins/coreplugin/locator/locator_test.cpp b/src/plugins/coreplugin/locator/locator_test.cpp index c83a2d8779c..26a6b142b02 100644 --- a/src/plugins/coreplugin/locator/locator_test.cpp +++ b/src/plugins/coreplugin/locator/locator_test.cpp @@ -2,10 +2,9 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "../coreplugin.h" - +#include "../testdatadir.h" #include "locatorfiltertest.h" -#include <coreplugin/testdatadir.h> #include <utils/algorithm.h> #include <utils/fileutils.h> diff --git a/src/plugins/coreplugin/locator/locatormanager.cpp b/src/plugins/coreplugin/locator/locatormanager.cpp index d8ea9b36f9e..e4fc9edfc36 100644 --- a/src/plugins/coreplugin/locator/locatormanager.cpp +++ b/src/plugins/coreplugin/locator/locatormanager.cpp @@ -6,9 +6,9 @@ #include "ilocatorfilter.h" #include "locator.h" #include "locatorwidget.h" +#include "../icore.h" #include <aggregation/aggregate.h> -#include <coreplugin/icore.h> #include <extensionsystem/pluginmanager.h> #include <utils/qtcassert.h> diff --git a/src/plugins/coreplugin/locator/locatormanager.h b/src/plugins/coreplugin/locator/locatormanager.h index 256e4327643..0b17de23a10 100644 --- a/src/plugins/coreplugin/locator/locatormanager.h +++ b/src/plugins/coreplugin/locator/locatormanager.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <QObject> diff --git a/src/plugins/coreplugin/locator/locatorsettingspage.h b/src/plugins/coreplugin/locator/locatorsettingspage.h index 408fe7b91f8..b4f9e4a4a33 100644 --- a/src/plugins/coreplugin/locator/locatorsettingspage.h +++ b/src/plugins/coreplugin/locator/locatorsettingspage.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include "../dialogs/ioptionspage.h" namespace Core::Internal { diff --git a/src/plugins/coreplugin/locator/opendocumentsfilter.cpp b/src/plugins/coreplugin/locator/opendocumentsfilter.cpp index 95e076ec2bd..a13f51484bf 100644 --- a/src/plugins/coreplugin/locator/opendocumentsfilter.cpp +++ b/src/plugins/coreplugin/locator/opendocumentsfilter.cpp @@ -4,8 +4,7 @@ #include "opendocumentsfilter.h" #include "../coreplugintr.h" - -#include <coreplugin/editormanager/documentmodel.h> +#include "../editormanager/documentmodel.h" #include <extensionsystem/pluginmanager.h> diff --git a/src/plugins/coreplugin/locator/urllocatorfilter.h b/src/plugins/coreplugin/locator/urllocatorfilter.h index 57f652aeca1..18535569c5b 100644 --- a/src/plugins/coreplugin/locator/urllocatorfilter.h +++ b/src/plugins/coreplugin/locator/urllocatorfilter.h @@ -5,7 +5,7 @@ #include "ilocatorfilter.h" -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <QDialog> diff --git a/src/plugins/coreplugin/mimetypesettings.h b/src/plugins/coreplugin/mimetypesettings.h index fd4a69685e3..1080b0746b9 100644 --- a/src/plugins/coreplugin/mimetypesettings.h +++ b/src/plugins/coreplugin/mimetypesettings.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/dialogs/ioptionspage.h> +#include "dialogs/ioptionspage.h" namespace Core::Internal { diff --git a/src/plugins/coreplugin/modemanager.h b/src/plugins/coreplugin/modemanager.h index 5f013ffa507..5e90edb16bc 100644 --- a/src/plugins/coreplugin/modemanager.h +++ b/src/plugins/coreplugin/modemanager.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "core_global.h" #include <utils/id.h> diff --git a/src/plugins/coreplugin/navigationwidget.h b/src/plugins/coreplugin/navigationwidget.h index dd36fe90811..d89105e75d9 100644 --- a/src/plugins/coreplugin/navigationwidget.h +++ b/src/plugins/coreplugin/navigationwidget.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/minisplitter.h> +#include "minisplitter.h" #include <utils/id.h> #include <utils/store.h> diff --git a/src/plugins/coreplugin/progressmanager/futureprogress.h b/src/plugins/coreplugin/progressmanager/futureprogress.h index 5687fa95a15..d2b9e7facb0 100644 --- a/src/plugins/coreplugin/progressmanager/futureprogress.h +++ b/src/plugins/coreplugin/progressmanager/futureprogress.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <utils/id.h> diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.h b/src/plugins/coreplugin/progressmanager/progressmanager.h index 8c51bf4ccd4..99580436ca2 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.h +++ b/src/plugins/coreplugin/progressmanager/progressmanager.h @@ -3,7 +3,7 @@ #pragma once -#include <coreplugin/core_global.h> +#include "../core_global.h" #include <utils/id.h> diff --git a/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp b/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp index 58e350506ce..64e9fdfc5a8 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp +++ b/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp @@ -1,6 +1,12 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#include "progressmanager_p.h" + +#include "../icore.h" + +#include <utils/utilsicons.h> + #include <QGuiApplication> #include <QVariant> #include <QMainWindow> @@ -12,11 +18,6 @@ #include <QLabel> #include <qpa/qplatformnativeinterface.h> -#include <coreplugin/icore.h> -#include <utils/utilsicons.h> - -#include "progressmanager_p.h" - // for windows progress bar #ifndef __GNUC__ # define CALLBACK WINAPI diff --git a/src/plugins/coreplugin/rightpane.cpp b/src/plugins/coreplugin/rightpane.cpp index 24322b6b00b..d4f8f7aa250 100644 --- a/src/plugins/coreplugin/rightpane.cpp +++ b/src/plugins/coreplugin/rightpane.cpp @@ -3,8 +3,7 @@ #include "rightpane.h" -#include <coreplugin/imode.h> -#include <coreplugin/modemanager.h> +#include "modemanager.h" #include <utils/qtcsettings.h> diff --git a/src/plugins/coreplugin/session.cpp b/src/plugins/coreplugin/session.cpp index f94afa97f9e..541ff527402 100644 --- a/src/plugins/coreplugin/session.cpp +++ b/src/plugins/coreplugin/session.cpp @@ -17,8 +17,6 @@ #include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginspec.h> -#include <texteditor/texteditor.h> - #include <utils/algorithm.h> #include <utils/filepath.h> #include <utils/macroexpander.h> diff --git a/src/plugins/coreplugin/sessionmodel.cpp b/src/plugins/coreplugin/sessionmodel.cpp index fa0d8ee087e..1d97762eb0f 100644 --- a/src/plugins/coreplugin/sessionmodel.cpp +++ b/src/plugins/coreplugin/sessionmodel.cpp @@ -3,11 +3,10 @@ #include "sessionmodel.h" +#include "actionmanager/actionmanager.h" #include "session.h" #include "sessiondialog.h" -#include <coreplugin/actionmanager/actionmanager.h> - #include <utils/algorithm.h> #include <utils/fileutils.h> #include <utils/stringutils.h> diff --git a/src/plugins/coreplugin/textdocument.cpp b/src/plugins/coreplugin/textdocument.cpp index ddbf05fb18b..cf4dd82939e 100644 --- a/src/plugins/coreplugin/textdocument.cpp +++ b/src/plugins/coreplugin/textdocument.cpp @@ -2,7 +2,8 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "textdocument.h" -#include <coreplugin/editormanager/editormanager.h> + +#include "editormanager/editormanager.h" #include <QDebug> #include <QTextCodec> diff --git a/src/plugins/coreplugin/themechooser.h b/src/plugins/coreplugin/themechooser.h index 1188fcb7e0d..360be3100c0 100644 --- a/src/plugins/coreplugin/themechooser.h +++ b/src/plugins/coreplugin/themechooser.h @@ -3,9 +3,9 @@ #pragma once -#include <utils/id.h> +#include "dialogs/ioptionspage.h" -#include <coreplugin/dialogs/ioptionspage.h> +#include <utils/id.h> #include <QWidget> diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index 4b5e60b2fcc..ce4138721fc 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -18,8 +18,6 @@ #include <utils/infobar.h> #include <utils/qtcassert.h> -#include <vcsbase/vcsbaseconstants.h> - #include <QList> #include <QMap> #include <QMessageBox> diff --git a/src/plugins/cppeditor/cppeditorwidget.h b/src/plugins/cppeditor/cppeditorwidget.h index e9c0d11275c..a379c5f55b4 100644 --- a/src/plugins/cppeditor/cppeditorwidget.h +++ b/src/plugins/cppeditor/cppeditorwidget.h @@ -5,6 +5,7 @@ #include "cppeditor_global.h" +#include <texteditor/blockrange.h> #include <texteditor/codeassist/assistenums.h> #include <texteditor/texteditor.h> diff --git a/src/plugins/cppeditor/symbolsfindfilter.cpp b/src/plugins/cppeditor/symbolsfindfilter.cpp index ef067876825..54a0e6a6463 100644 --- a/src/plugins/cppeditor/symbolsfindfilter.cpp +++ b/src/plugins/cppeditor/symbolsfindfilter.cpp @@ -7,11 +7,12 @@ #include "cppeditortr.h" #include "cppmodelmanager.h" +#include <coreplugin/editormanager/editormanager.h> +#include <coreplugin/find/searchresultwindow.h> +#include <coreplugin/find/textfindconstants.h> #include <coreplugin/icore.h> #include <coreplugin/progressmanager/futureprogress.h> #include <coreplugin/progressmanager/progressmanager.h> -#include <coreplugin/editormanager/editormanager.h> -#include <coreplugin/find/searchresultwindow.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 3cf390f51cc..681ad9c538f 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -12,6 +12,7 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/fileutils.h> +#include <coreplugin/find/textfindconstants.h> #include <coreplugin/icore.h> #include <coreplugin/messagemanager.h> diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 24b802857bf..91c0b8e259a 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -13,6 +13,7 @@ #include <coreplugin/documentmanager.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/find/ifindsupport.h> +#include <coreplugin/find/textfindconstants.h> #include <coreplugin/icore.h> #include <coreplugin/progressmanager/futureprogress.h> #include <coreplugin/progressmanager/progressmanager.h> diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index 4f0ea99c8d4..6be08ae3cb7 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -5,7 +5,6 @@ #include "texteditor_global.h" -#include "blockrange.h" #include "codeassist/assistenums.h" #include "indenter.h" #include "refactoroverlay.h" From 09b347d0d3f5c063cd20c30be74741711830b74c Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Mon, 18 Sep 2023 12:46:26 +0200 Subject: [PATCH 1144/1777] ProjectExplorer: fix gcc toolchain detection on windows Change-Id: Ibf23eeca79389562bc38a01ca9ec7799e22787fe Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 8bc6f5f6a38..2628b506d21 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1235,8 +1235,8 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, << ("*-*-*-*-" + compilerName + "-[1-9]*"); // "x86_64-pc-linux-gnu-gcc-7.4.1" } - nameFilters = transform(nameFilters, - [os = device ? device->osType() : HostOsInfo::hostOs()](const QString &baseName) { + const Utils::OsType os = device ? device->osType() : HostOsInfo::hostOs(); + nameFilters = transform(nameFilters, [os](const QString &baseName) { return OsSpecificAspects::withExecutableSuffix(os, baseName); }); @@ -1269,9 +1269,11 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, for (const FilePath &searchPath : std::as_const(searchPaths)) { static const QRegularExpression regexp(binaryRegexp); - const auto callBack = [&compilerPaths, compilerName](const FilePath &candidate) { - if (candidate.fileName() == compilerName || regexp.match(candidate.path()).hasMatch()) + const auto callBack = [os, &compilerPaths, compilerName](const FilePath &candidate) { + if (candidate.fileName() == OsSpecificAspects::withExecutableSuffix(os, compilerName) + || regexp.match(candidate.path()).hasMatch()) { compilerPaths << candidate; + } return IterationPolicy::Continue; }; searchPath.iterateDirectory(callBack, {nameFilters, QDir::Files | QDir::Executable}); From eec022ac85e23da0e42c5b3e74131cae20229b50 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 15 Sep 2023 20:09:23 +0200 Subject: [PATCH 1145/1777] WebAssembly: Cache emsdk_env and toolchain --dumpversion results Stores the results of emsdk_env and --dumpversion in the settings database. Also stores the modification time of the ".emscripten" file in the sdk root folder in order to validate the cached entries. Change-Id: Iacb907ee6d8cd9f4c14d33a6ad425ec684c66238 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/webassembly/webassemblyemsdk.cpp | 115 ++++++++++++------- 1 file changed, 71 insertions(+), 44 deletions(-) diff --git a/src/plugins/webassembly/webassemblyemsdk.cpp b/src/plugins/webassembly/webassemblyemsdk.cpp index ad12f12e62d..8ad69804648 100644 --- a/src/plugins/webassembly/webassemblyemsdk.cpp +++ b/src/plugins/webassembly/webassemblyemsdk.cpp @@ -3,9 +3,9 @@ #include "webassemblyemsdk.h" -#include "webassemblyconstants.h" - #include <coreplugin/icore.h> +#include <coreplugin/settingsdatabase.h> + #include <utils/environment.h> #include <utils/process.h> #include <utils/hostosinfo.h> @@ -16,38 +16,50 @@ using namespace Utils; namespace WebAssembly::Internal::WebAssemblyEmSdk { -using EmSdkEnvCache = QCache<FilePath, QString>; -static EmSdkEnvCache *emSdkEnvCache() -{ - static EmSdkEnvCache cache(10); - return &cache; -} +const char emSdkEnvTSFileKey[] = "WebAssembly/emSdkEnvTimeStampFile"; +const char emSdkEnvTSKey[] = "WebAssembly/emSdkEnvTimeStamp"; +const char emSdkEnvOutputKey[] = "WebAssembly/emSdkEnvOutput1"; -using EmSdkVersionCache = QCache<FilePath, QVersionNumber>; -static EmSdkVersionCache *emSdkVersionCache() +const char emSdkVersionTSFileKey[] = "WebAssembly/emSdkVersionTimeStampFile"; +const char emSdkVersionTSKey[] = "WebAssembly/emSdkVersionTimeStamp"; +const char emSdkVersionKey[] = "WebAssembly/emSdkVersion1"; + +const FilePath timeStampFile(const FilePath &sdkRoot) { - static EmSdkVersionCache cache(10); - return &cache; + return sdkRoot / ".emscripten"; } static QString emSdkEnvOutput(const FilePath &sdkRoot) { - const bool isWindows = sdkRoot.osType() == OsTypeWindows; - if (!emSdkEnvCache()->contains(sdkRoot)) { - const FilePath scriptFile = sdkRoot.pathAppended(QLatin1String("emsdk_env") + - (isWindows ? ".bat" : ".sh")); - Process emSdkEnv; - if (isWindows) { - emSdkEnv.setCommand(CommandLine(scriptFile)); - } else { - // File needs to be source'd, not executed. - emSdkEnv.setCommand({sdkRoot.withNewPath("bash"), {"-c", ". " + scriptFile.path()}}); - } - emSdkEnv.runBlocking(); - const QString output = emSdkEnv.allOutput(); - emSdkEnvCache()->insert(sdkRoot, new QString(output)); + const FilePath tsFile = timeStampFile(sdkRoot); // ts == Timestamp + if (!tsFile.exists()) + return {}; + const QDateTime ts = tsFile.lastModified(); + + Core::SettingsDatabase *db = Core::ICore::settingsDatabase(); + if (db->value(emSdkEnvTSKey).toDateTime() == ts + && FilePath::fromVariant(db->value(emSdkEnvTSFileKey)) == tsFile + && db->contains(emSdkEnvOutputKey)) { + return db->value(emSdkEnvOutputKey).toString(); } - return *emSdkEnvCache()->object(sdkRoot); + + const bool isWindows = sdkRoot.osType() == OsTypeWindows; + const FilePath scriptFile = sdkRoot.pathAppended(QLatin1String("emsdk_env") + + (isWindows ? ".bat" : ".sh")); + Process emSdkEnv; + if (isWindows) { + emSdkEnv.setCommand(CommandLine(scriptFile)); + } else { + // File needs to be source'd, not executed. + emSdkEnv.setCommand({sdkRoot.withNewPath("bash"), {"-c", ". " + scriptFile.path()}}); + } + emSdkEnv.runBlocking(); + const QString result = emSdkEnv.allOutput(); + db->setValue(emSdkEnvTSFileKey, tsFile.toVariant()); + db->setValue(emSdkEnvTSKey, ts); + db->setValue(emSdkEnvOutputKey, result); + + return result; } void parseEmSdkEnvOutputAndAddToEnv(const QString &output, Environment &env) @@ -86,29 +98,44 @@ void addToEnvironment(const FilePath &sdkRoot, Environment &env) QVersionNumber version(const FilePath &sdkRoot) { - if (!sdkRoot.exists()) + const FilePath tsFile = timeStampFile(sdkRoot); // ts == Timestamp + if (!tsFile.exists()) return {}; - if (!emSdkVersionCache()->contains(sdkRoot)) { - Environment env = sdkRoot.deviceEnvironment(); - addToEnvironment(sdkRoot, env); - QLatin1String scriptFile{sdkRoot.osType() == OsType::OsTypeWindows ? "emcc.bat" : "emcc"}; - FilePath script = sdkRoot.withNewPath(scriptFile).searchInDirectories(env.path()); - const CommandLine command(script, {"-dumpversion"}); - Process emcc; - emcc.setCommand(command); - emcc.setEnvironment(env); - emcc.runBlocking(); - const QString version = emcc.cleanedStdOut(); - emSdkVersionCache()->insert(sdkRoot, - new QVersionNumber(QVersionNumber::fromString(version))); + const QDateTime ts = tsFile.lastModified(); + + Core::SettingsDatabase *db = Core::ICore::settingsDatabase(); + if (db->value(emSdkVersionTSKey).toDateTime() == ts + && FilePath::fromVariant(db->value(emSdkVersionTSFileKey)) == tsFile + && db->contains(emSdkVersionKey)) { + return QVersionNumber::fromString(db->value(emSdkVersionKey).toString()); } - return *emSdkVersionCache()->object(sdkRoot); + + Environment env = sdkRoot.deviceEnvironment(); + addToEnvironment(sdkRoot, env); + QLatin1String scriptFile{sdkRoot.osType() == OsType::OsTypeWindows ? "emcc.bat" : "emcc"}; + FilePath script = sdkRoot.withNewPath(scriptFile).searchInDirectories(env.path()); + const CommandLine command(script, {"-dumpversion"}); + Process emcc; + emcc.setCommand(command); + emcc.setEnvironment(env); + emcc.runBlocking(); + const QString versionStr = emcc.cleanedStdOut(); + const QVersionNumber result = QVersionNumber::fromString(versionStr); + db->setValue(emSdkVersionTSFileKey, tsFile.toVariant()); + db->setValue(emSdkVersionTSKey, ts); + db->setValue(emSdkVersionKey, result.toString()); + return result; } void clearCaches() { - emSdkEnvCache()->clear(); - emSdkVersionCache()->clear(); + Core::SettingsDatabase *db = Core::ICore::settingsDatabase(); + db->remove(emSdkEnvTSFileKey); + db->remove(emSdkEnvTSKey); + db->remove(emSdkEnvOutputKey); + db->remove(emSdkVersionTSFileKey); + db->remove(emSdkVersionTSKey); + db->remove(emSdkVersionKey); } } // namespace WebAssembly::Internal::WebAssemblyEmSdk From 88ddecd281bb0a059d5d707e991514f9af1f5e08 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 18 Sep 2023 13:59:19 +0200 Subject: [PATCH 1146/1777] qbs build: Fix wrong uses of qbs.toolchainType qbs.toolchainType is a convenience property to *set* the toolchain in a profile or on the command line. It must not be used to check for the toolchain. Change-Id: I97e3a2baceca4233db97f33b9fa8f2bc61abbcf3 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/utils.qbs | 4 ++-- src/tools/processlauncher/processlauncher.qbs | 4 +--- src/tools/sdktool/sdktoollib.qbs | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 768a7c83acf..6def6a15c51 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -8,9 +8,9 @@ QtcLibrary { var libs = []; if (qbs.targetOS.contains("windows")) { libs.push("user32", "iphlpapi", "ws2_32", "shell32", "ole32"); - if (qbs.toolchainType === "mingw") + if (qbs.toolchain.contains("mingw")) libs.push("uuid"); - else if (qbs.toolchainType === "msvc") + else if (qbs.toolchain.contains("msvc")) libs.push("dbghelp"); } else if (qbs.targetOS.contains("unix")) { if (!qbs.targetOS.contains("macos")) diff --git a/src/tools/processlauncher/processlauncher.qbs b/src/tools/processlauncher/processlauncher.qbs index 2f03f7fba57..750276396c2 100644 --- a/src/tools/processlauncher/processlauncher.qbs +++ b/src/tools/processlauncher/processlauncher.qbs @@ -11,9 +11,7 @@ QtcTool { Properties { condition: qbs.targetOS.contains("windows") - cpp.dynamicLibraries: { - return qbs.toolchainType === "msvc" ? ["user32", "dbghelp"] : ["user32"]; - } + cpp.dynamicLibraries: qbs.toolchain.contains("msvc") ? ["user32", "dbghelp"] : ["user32"] } files: [ diff --git a/src/tools/sdktool/sdktoollib.qbs b/src/tools/sdktool/sdktoollib.qbs index ca40590d8d1..17028776e40 100644 --- a/src/tools/sdktool/sdktoollib.qbs +++ b/src/tools/sdktool/sdktoollib.qbs @@ -27,7 +27,7 @@ QtcLibrary { var libs = []; if (qbs.targetOS.contains("windows")) libs.push("user32", "shell32"); - if (qbs.toolchainType === "msvc") + if (qbs.toolchain.contains("msvc")) libs.push("dbghelp"); return libs; } From bc1c24eb84c3c44e98bad13830f3ec21f8e1fc2e Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Sun, 17 Sep 2023 20:19:04 +0200 Subject: [PATCH 1147/1777] CMakePM: Revamp the CMake code completion By using KSyntaxHighlighting's metadata from the cmake.xml file. With this information the code completion has localized arguments for functions. Added support for Generator Expressions $< and function ${ completions. The project functions/macros and options are also taken into consideration. The file completion is using FilePaths and should work remotely. Change-Id: I79d1360c1249c65c9db65349f326be5d41f0f734 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 12 + .../cmakeprojectmanager/cmakebuildsystem.h | 2 + .../cmakefilecompletionassist.cpp | 306 +++++++++++++++++- .../cmakefilecompletionassist.h | 4 +- src/plugins/cmakeprojectmanager/cmaketool.cpp | 137 +++++++- src/plugins/cmakeprojectmanager/cmaketool.h | 18 +- 6 files changed, 449 insertions(+), 30 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 866fbf89d59..fac54a782e4 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1250,6 +1250,9 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() { m_cmakeSymbolsHash.clear(); + m_projectKeywords.functions.clear(); + m_projectKeywords.variables.clear(); + for (const auto &cmakeFile : std::as_const(m_cmakeFiles)) { for (const auto &func : cmakeFile.cmakeListFile.Functions) { if (func.LowerCaseName() != "function" && func.LowerCaseName() != "macro" @@ -1265,8 +1268,17 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() link.targetLine = arg.Line; link.targetColumn = arg.Column - 1; m_cmakeSymbolsHash.insert(QString::fromUtf8(arg.Value), link); + + if (func.LowerCaseName() == "option") + m_projectKeywords.variables << QString::fromUtf8(arg.Value); + else + m_projectKeywords.functions << QString::fromUtf8(arg.Value); } } + + // Code completion setup + if (CMakeTool *tool = CMakeKitAspect::cmakeTool(target()->kit())) + tool->keywords(); } void CMakeBuildSystem::ensureBuildDirectory(const BuildDirParameters ¶meters) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h index ca67d5549e2..d802797ebd6 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h @@ -119,6 +119,7 @@ public: QString warning() const; const QHash<QString, Utils::Link> &cmakeSymbolsHash() const { return m_cmakeSymbolsHash; } + CMakeKeywords projectKeywords() const { return m_projectKeywords; } signals: void configurationCleared(); @@ -223,6 +224,7 @@ private: QList<CMakeBuildTarget> m_buildTargets; QSet<CMakeFileInfo> m_cmakeFiles; QHash<QString, Utils::Link> m_cmakeSymbolsHash; + CMakeKeywords m_projectKeywords; QHash<QString, ProjectFileArgumentPosition> m_filesToBeRenamed; diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 18bc57a4905..cdad2183487 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -3,51 +3,318 @@ #include "cmakefilecompletionassist.h" +#include "cmakebuildsystem.h" +#include "cmakebuildtarget.h" #include "cmakekitaspect.h" +#include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "cmaketool.h" #include <projectexplorer/project.h> +#include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/projectexplorericons.h> #include <projectexplorer/projectmanager.h> +#include <projectexplorer/projectnodes.h> #include <projectexplorer/target.h> #include <texteditor/codeassist/assistinterface.h> +#include <texteditor/codeassist/genericproposal.h> +#include <texteditor/texteditorsettings.h> + +#include <utils/fsengine/fileiconprovider.h> +#include <utils/utilsicons.h> using namespace TextEditor; using namespace ProjectExplorer; +using namespace Utils; namespace CMakeProjectManager::Internal { -class CMakeFileCompletionAssist : public KeywordsCompletionAssistProcessor +class CMakeFileCompletionAssist : public AsyncProcessor { public: CMakeFileCompletionAssist(); IAssistProposal *performAsync() final; + + const QIcon m_variableIcon; + const QIcon m_projectVariableIcon; + const QIcon m_functionIcon; + const QIcon m_projectFunctionIcon; + const QIcon m_propertyIcon; + const QIcon m_argsIcon; + const QIcon m_genexIcon; + const QIcon m_moduleIcon; + const QIcon m_targetsIcon; + + TextEditor::SnippetAssistCollector m_snippetCollector; }; -CMakeFileCompletionAssist::CMakeFileCompletionAssist() : - KeywordsCompletionAssistProcessor(Keywords()) +CMakeFileCompletionAssist::CMakeFileCompletionAssist() + : m_variableIcon(CodeModelIcon::iconForType(CodeModelIcon::VarPublic)) + , m_projectVariableIcon(CodeModelIcon::iconForType(CodeModelIcon::VarPublicStatic)) + , m_functionIcon(CodeModelIcon::iconForType(CodeModelIcon::FuncPublic)) + , m_projectFunctionIcon(CodeModelIcon::iconForType(CodeModelIcon::FuncPublicStatic)) + , m_propertyIcon(CodeModelIcon::iconForType(CodeModelIcon::Property)) + , m_argsIcon(CodeModelIcon::iconForType(CodeModelIcon::Enum)) + , m_genexIcon(CodeModelIcon::iconForType(CodeModelIcon::Class)) + , m_moduleIcon( + ProjectExplorer::DirectoryIcon(ProjectExplorer::Constants::FILEOVERLAY_MODULES).icon()) + , m_targetsIcon(ProjectExplorer::Icons::BUILD.icon()) + , m_snippetCollector(Constants::CMAKE_SNIPPETS_GROUP_ID, + CodeModelIcon::iconForType(CodeModelIcon::Keyword)) + +{} + +static bool isInComment(const AssistInterface *interface) { - setSnippetGroup(Constants::CMAKE_SNIPPETS_GROUP_ID); - setDynamicCompletionFunction(&TextEditor::pathComplete); + QTextCursor tc(interface->textDocument()); + tc.setPosition(interface->position()); + tc.movePosition(QTextCursor::StartOfLine, QTextCursor::KeepAnchor); + return tc.selectedText().contains('#'); +} + +static bool isValidIdentifierChar(const QChar &chr) +{ + return chr.isLetterOrNumber() || chr == '_' || chr == '-'; +} + +static int findWordStart(const AssistInterface *interface, int pos) +{ + // Find start position + QChar chr; + do { + chr = interface->characterAt(--pos); + } while (pos > 0 && isValidIdentifierChar(chr)); + + return ++pos; +} + +static int findFunctionStart(const AssistInterface *interface) +{ + int pos = interface->position(); + + QChar chr; + do { + chr = interface->characterAt(--pos); + } while (pos > 0 && chr != '('); + + if (pos > 0 && chr == '(') { + // allow space between function name and ( + do { + chr = interface->characterAt(--pos); + } while (pos > 0 && chr.isSpace()); + ++pos; + } + + return pos; +} + +static int findFunctionEnd(const AssistInterface *interface) +{ + int pos = interface->position(); + + QChar chr; + do { + chr = interface->characterAt(--pos); + } while (pos > 0 && chr != ')'); + + return pos; +} + +static int findPathStart(const AssistInterface *interface) +{ + // For pragmatic reasons, we don't support spaces in file names here. + static const auto canOccurInFilePath = [](const QChar &c) { + return c.isLetterOrNumber() || c == '.' || c == '/' || c == '_' || c == '-'; + }; + + int pos = interface->position(); + QChar chr; + // Skip to the start of a name + do { + chr = interface->characterAt(--pos); + } while (canOccurInFilePath(chr)); + + return ++pos; +} + +QList<AssistProposalItemInterface *> generateList(const QStringList &words, const QIcon &icon) +{ + return transform(words, [&icon](const QString &word) -> AssistProposalItemInterface * { + AssistProposalItem *item = new AssistProposalItem(); + item->setText(word); + item->setIcon(icon); + return item; + }); +} + +static int addFilePathItems(const AssistInterface *interface, + QList<AssistProposalItemInterface *> &items, + int symbolStartPos) +{ + if (interface->filePath().isEmpty()) + return symbolStartPos; + + const int startPos = findPathStart(interface); + + if (interface->reason() == IdleEditor + && interface->position() - startPos + < TextEditorSettings::completionSettings().m_characterThreshold) + return symbolStartPos; + + const QString word = interface->textAt(startPos, interface->position() - startPos); + FilePath baseDir = interface->filePath().absoluteFilePath().parentDir(); + const int lastSlashPos = word.lastIndexOf(QLatin1Char('/')); + + QString prefix = word; + if (lastSlashPos != -1) { + prefix = word.mid(lastSlashPos + 1); + baseDir = baseDir.pathAppended(word.left(lastSlashPos)); + } + + const FilePaths filesPaths = baseDir.dirEntries( + FileFilter({QString("%1*").arg(prefix)}, QDir::AllEntries | QDir::NoDotAndDotDot)); + for (const auto &file : filesPaths) { + AssistProposalItem *item = new AssistProposalItem; + QString fileName = file.fileName(); + if (file.isDir()) + fileName.append("/"); + item->setText(fileName); + item->setIcon(FileIconProvider::icon(file)); + + items << item; + } + + return startPos; } IAssistProposal *CMakeFileCompletionAssist::performAsync() { - Keywords kw; - const Utils::FilePath &filePath = interface()->filePath(); + CMakeKeywords keywords; + CMakeKeywords projectKeywords; + Project *project = nullptr; + const FilePath &filePath = interface()->filePath(); if (!filePath.isEmpty() && filePath.isFile()) { - Project *p = ProjectManager::projectForFile(filePath); - if (p && p->activeTarget()) { - CMakeTool *cmake = CMakeKitAspect::cmakeTool(p->activeTarget()->kit()); + project = static_cast<CMakeProject *>(ProjectManager::projectForFile(filePath)); + if (project && project->activeTarget()) { + CMakeTool *cmake = CMakeKitAspect::cmakeTool(project->activeTarget()->kit()); if (cmake && cmake->isValid()) - kw = cmake->keywords(); + keywords = cmake->keywords(); } } - setKeywords(kw); - return KeywordsCompletionAssistProcessor::performAsync(); + QStringList buildTargets; + if (project && project->activeTarget()) { + const auto bs = qobject_cast<CMakeBuildSystem *>(project->activeTarget()->buildSystem()); + if (bs) { + for (const auto &target : std::as_const(bs->buildTargets())) + if (target.targetType != TargetType::UtilityType) + buildTargets << target.title; + projectKeywords = bs->projectKeywords(); + } + } + + if (isInComment(interface())) + return nullptr; + + const int startPos = findWordStart(interface(), interface()->position()); + + const int functionStart = findFunctionStart(interface()); + const int prevFunctionEnd = findFunctionEnd(interface()); + + QString functionName; + if (functionStart > prevFunctionEnd) { + int functionStartPos = findWordStart(interface(), functionStart); + functionName + = interface()->textAt(functionStartPos, functionStart - functionStartPos); + } + + if (interface()->reason() == IdleEditor) { + const QChar chr = interface()->characterAt(interface()->position()); + const int wordSize = interface()->position() - startPos; + if (isValidIdentifierChar(chr) + || wordSize < TextEditorSettings::completionSettings().m_characterThreshold) { + return nullptr; + } + } + + QList<AssistProposalItemInterface *> items; + + const QString varGenexToken = interface()->textAt(startPos - 2, 2); + if (varGenexToken == "${" || varGenexToken == "$<") { + if (varGenexToken == "${") { + items.append(generateList(keywords.variables, m_variableIcon)); + items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); + } + if (varGenexToken == "$<") + items.append(generateList(keywords.generatorExpressions, m_genexIcon)); + + return new GenericProposal(startPos, items); + } + + int fileStartPos = startPos; + const auto onlyFileItems = [&] { return fileStartPos != startPos; }; + + if (functionName == "if" || functionName == "elseif" || functionName == "while" + || functionName == "set" || functionName == "list") { + items.append(generateList(keywords.variables, m_variableIcon)); + items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); + } + + if (functionName.contains("path") || functionName.contains("file") + || functionName.contains("add_executable") || functionName.contains("add_library") + || functionName == "include" || functionName == "add_subdirectory" + || functionName == "install" || functionName == "target_sources" || functionName == "set" + || functionName == "list") { + fileStartPos = addFilePathItems(interface(), items, startPos); + } + + if (functionName == "set_property") + items.append(generateList(keywords.properties, m_propertyIcon)); + + if (functionName == "set_directory_properties") + items.append(generateList(keywords.directoryProperties, m_propertyIcon)); + if (functionName == "set_source_files_properties") + items.append(generateList(keywords.sourceProperties, m_propertyIcon)); + if (functionName == "set_target_properties") + items.append(generateList(keywords.targetProperties, m_propertyIcon)); + if (functionName == "set_tests_properties") + items.append(generateList(keywords.testProperties, m_propertyIcon)); + + if (functionName == "include" && !onlyFileItems()) + items.append(generateList(keywords.includeStandardModules, m_moduleIcon)); + if (functionName == "find_package") + items.append(generateList(keywords.findModules, m_moduleIcon)); + + if ((functionName.contains("target") || functionName == "install" + || functionName == "add_dependencies" || functionName == "set_property" + || functionName == "export") + && !onlyFileItems()) + items.append(generateList(buildTargets, m_targetsIcon)); + + if (keywords.functionArgs.contains(functionName) && !onlyFileItems()) { + QStringList functionSymbols = keywords.functionArgs.value(functionName); + items.append(generateList(functionSymbols, m_argsIcon)); + } else if (functionName.isEmpty()) { + // On a new line we just want functions + items.append(generateList(keywords.functions, m_functionIcon)); + items.append(generateList(projectKeywords.functions, m_projectFunctionIcon)); + } else { + // Inside an unknown function we could have variables or properties + fileStartPos = addFilePathItems(interface(), items, startPos); + if (!onlyFileItems()) { + items.append(generateList(keywords.variables, m_variableIcon)); + items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); + items.append(generateList(keywords.properties, m_propertyIcon)); + items.append(generateList(buildTargets, m_targetsIcon)); + } + } + + if (!onlyFileItems()) + items.append(m_snippetCollector.collect()); + + return new GenericProposal(startPos, items); } IAssistProcessor *CMakeFileCompletionAssistProvider::createProcessor(const AssistInterface *) const @@ -55,4 +322,15 @@ IAssistProcessor *CMakeFileCompletionAssistProvider::createProcessor(const Assis return new CMakeFileCompletionAssist; } -} // CMakeProjectManager::Internal +int CMakeFileCompletionAssistProvider::activationCharSequenceLength() const +{ + return 2; +} + +bool CMakeFileCompletionAssistProvider::isActivationCharSequence(const QString &sequence) const +{ + return sequence.endsWith("${") || sequence.endsWith("$<") || sequence.endsWith("/") + || sequence.endsWith("("); +} + +} // namespace CMakeProjectManager::Internal diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.h b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.h index 1b60a2e72f6..9b692c895c4 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.h +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.h @@ -3,7 +3,7 @@ #pragma once -#include <texteditor/codeassist/keywordscompletionassist.h> +#include <texteditor/codeassist/completionassistprovider.h> namespace CMakeProjectManager::Internal { @@ -11,6 +11,8 @@ class CMakeFileCompletionAssistProvider : public TextEditor::CompletionAssistPro { public: TextEditor::IAssistProcessor *createProcessor(const TextEditor::AssistInterface *) const final; + int activationCharSequenceLength() const final; + bool isActivationCharSequence(const QString &sequence) const final; }; } // CMakeProjectManager::Internal diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 67067555653..46d88dc932e 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -6,6 +6,7 @@ #include "cmakeprojectmanagertr.h" #include "cmaketoolmanager.h" +#include <coreplugin/icore.h> #include <coreplugin/helpmanager.h> #include <utils/algorithm.h> @@ -20,6 +21,7 @@ #include <QLoggingCategory> #include <QRegularExpression> #include <QSet> +#include <QXmlStreamReader> #include <QUuid> #include <memory> @@ -90,6 +92,14 @@ public: QVector<FileApi> m_fileApis; QStringList m_variables; QStringList m_functions; + QStringList m_properties; + QStringList m_generatorExpressions; + QStringList m_directoryProperties; + QStringList m_sourceProperties; + QStringList m_targetProperties; + QStringList m_testProperties; + QStringList m_includeStandardModules; + QStringList m_findModules; CMakeTool::Version m_version; }; @@ -243,7 +253,7 @@ QList<CMakeTool::Generator> CMakeTool::supportedGenerators() const return isValid() ? m_introspection->m_generators : QList<CMakeTool::Generator>(); } -TextEditor::Keywords CMakeTool::keywords() +CMakeKeywords CMakeTool::keywords() { if (!isValid()) return {}; @@ -252,27 +262,37 @@ TextEditor::Keywords CMakeTool::keywords() Process proc; runCMake(proc, {"--help-command-list"}, 5); if (proc.result() == ProcessResult::FinishedWithSuccess) - m_introspection->m_functions = proc.cleanedStdOut().split('\n'); - - runCMake(proc, {"--help-commands"}, 5); - if (proc.result() == ProcessResult::FinishedWithSuccess) - parseFunctionDetailsOutput(proc.cleanedStdOut()); + m_introspection->m_functions = Utils::filtered(proc.cleanedStdOut().split('\n'), + std::not_fn(&QString::isEmpty)); runCMake(proc, {"--help-property-list"}, 5); if (proc.result() == ProcessResult::FinishedWithSuccess) - m_introspection->m_variables = parseVariableOutput(proc.cleanedStdOut()); + m_introspection->m_properties = parseVariableOutput(proc.cleanedStdOut()); runCMake(proc, {"--help-variable-list"}, 5); if (proc.result() == ProcessResult::FinishedWithSuccess) { - m_introspection->m_variables.append(parseVariableOutput(proc.cleanedStdOut())); - m_introspection->m_variables = Utils::filteredUnique(m_introspection->m_variables); + m_introspection->m_variables = Utils::filteredUnique( + parseVariableOutput(proc.cleanedStdOut())); Utils::sort(m_introspection->m_variables); } + + parseSyntaxHighlightingXml(); } - return TextEditor::Keywords(m_introspection->m_variables, - m_introspection->m_functions, - m_introspection->m_functionArgs); + CMakeKeywords keywords; + keywords.functions = m_introspection->m_functions; + keywords.variables = m_introspection->m_variables; + keywords.functionArgs = m_introspection->m_functionArgs; + keywords.properties = m_introspection->m_properties; + keywords.generatorExpressions = m_introspection->m_generatorExpressions; + keywords.directoryProperties = m_introspection->m_directoryProperties; + keywords.sourceProperties = m_introspection->m_sourceProperties; + keywords.targetProperties = m_introspection->m_targetProperties; + keywords.testProperties = m_introspection->m_testProperties; + keywords.includeStandardModules = m_introspection->m_includeStandardModules; + keywords.findModules = m_introspection->m_findModules; + + return keywords; } bool CMakeTool::hasFileApi(bool ignoreCache) const @@ -400,6 +420,7 @@ void CMakeTool::readInformation(bool ignoreCache) const fetchFromCapabilities(ignoreCache); } + static QStringList parseDefinition(const QString &definition) { QStringList result; @@ -455,7 +476,7 @@ void CMakeTool::parseFunctionDetailsOutput(const QString &output) const QString command = words.takeFirst(); if (functionSet.contains(command)) { const QStringList tmp = Utils::sorted( - words + m_introspection->m_functionArgs[command]); + words + m_introspection->m_functionArgs[command]); m_introspection->m_functionArgs[command] = Utils::filteredUnique(tmp); } } @@ -471,12 +492,19 @@ void CMakeTool::parseFunctionDetailsOutput(const QString &output) QStringList CMakeTool::parseVariableOutput(const QString &output) { - const QStringList variableList = output.split('\n'); + const QStringList variableList = Utils::filtered(output.split('\n'), + std::not_fn(&QString::isEmpty)); QStringList result; for (const QString &v : variableList) { if (v.startsWith("CMAKE_COMPILER_IS_GNU<LANG>")) { // This key takes a compiler name :-/ result << "CMAKE_COMPILER_IS_GNUCC" << "CMAKE_COMPILER_IS_GNUCXX"; + } else if (v.contains("<CONFIG>") && v.contains("<LANG>")) { + const QString tmp = QString(v).replace("<CONFIG>", "%1").replace("<LANG>", "%2"); + result << tmp.arg("DEBUG").arg("C") << tmp.arg("DEBUG").arg("CXX") + << tmp.arg("RELEASE").arg("C") << tmp.arg("RELEASE").arg("CXX") + << tmp.arg("MINSIZEREL").arg("C") << tmp.arg("MINSIZEREL").arg("CXX") + << tmp.arg("RELWITHDEBINFO").arg("C") << tmp.arg("RELWITHDEBINFO").arg("CXX"); } else if (v.contains("<CONFIG>")) { const QString tmp = QString(v).replace("<CONFIG>", "%1"); result << tmp.arg("DEBUG") << tmp.arg("RELEASE") << tmp.arg("MINSIZEREL") @@ -491,6 +519,87 @@ QStringList CMakeTool::parseVariableOutput(const QString &output) return result; } +void CMakeTool::parseSyntaxHighlightingXml() +{ + QSet<QString> functionSet = Utils::toSet(m_introspection->m_functions); + + const FilePath cmakeXml = Core::ICore::resourcePath("generic-highlighter/syntax/cmake.xml"); + QXmlStreamReader reader(cmakeXml.fileContents().value_or(QByteArray())); + + auto readItemList = [](QXmlStreamReader &reader) -> QStringList { + QStringList arguments; + while (!reader.atEnd() && reader.readNextStartElement()) { + if (reader.name() == u"item") + arguments.append(reader.readElementText()); + else + reader.skipCurrentElement(); + } + return arguments; + }; + + while (!reader.atEnd() && reader.readNextStartElement()) { + if (reader.name() != u"highlighting") + continue; + while (!reader.atEnd() && reader.readNextStartElement()) { + if (reader.name() == u"list") { + const auto name = reader.attributes().value("name").toString(); + if (name.endsWith(u"_sargs") || name.endsWith(u"_nargs")) { + const auto functionName = name.left(name.length() - 6); + QStringList arguments = readItemList(reader); + + if (m_introspection->m_functionArgs.contains(functionName)) + arguments.append(m_introspection->m_functionArgs.value(functionName)); + + m_introspection->m_functionArgs[functionName] = arguments; + + // Functions that are part of CMake modules like ExternalProject_Add + // which are not reported by cmake --help-list-commands + if (!functionSet.contains(functionName)) { + functionSet.insert(functionName); + m_introspection->m_functions.append(functionName); + } + } else if (name == u"generator-expressions") { + m_introspection->m_generatorExpressions = readItemList(reader); + } else if (name == u"directory-properties") { + m_introspection->m_directoryProperties = readItemList(reader); + } else if (name == u"source-properties") { + m_introspection->m_sourceProperties = readItemList(reader); + } else if (name == u"target-properties") { + m_introspection->m_targetProperties = readItemList(reader); + } else if (name == u"test-properties") { + m_introspection->m_testProperties = readItemList(reader); + } else if (name == u"standard-modules") { + m_introspection->m_includeStandardModules = readItemList(reader); + } else if (name == u"standard-finder-modules") { + m_introspection->m_findModules = readItemList(reader); + } else { + reader.skipCurrentElement(); + } + } else { + reader.skipCurrentElement(); + } + } + } + + // Some commands have the same arguments as other commands and the `cmake.xml` + // but their relationship is weirdly defined in the `cmake.xml` file. + using ListStringPair = QList<QPair<QString, QString>>; + const ListStringPair functionPairs = {{"if", "elseif"}, + {"while", "elseif"}, + {"find_path", "find_file"}, + {"find_program", "find_library"}, + {"target_link_libraries", "target_compile_definitions"}, + {"target_link_options", "target_compile_definitions"}, + {"target_link_directories", "target_compile_options"}, + {"set_target_properties", "set_directory_properties"}, + {"set_tests_properties", "set_directory_properties"}}; + for (const auto &pair : std::as_const(functionPairs)) { + if (!m_introspection->m_functionArgs.contains(pair.first)) + m_introspection->m_functionArgs[pair.first] = m_introspection->m_functionArgs.value( + pair.second); + } +} + void CMakeTool::fetchFromCapabilities(bool ignoreCache) const { expected_str<Utils::Store> cache = PersistentCacheStore::byKey( diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index 4ae2ab1f998..d090b6fd97f 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -19,6 +19,21 @@ namespace CMakeProjectManager { namespace Internal { class IntrospectionData; } +struct CMAKE_EXPORT CMakeKeywords +{ + QStringList variables; + QStringList functions; + QStringList properties; + QStringList generatorExpressions; + QStringList directoryProperties; + QStringList sourceProperties; + QStringList targetProperties; + QStringList testProperties; + QStringList includeStandardModules; + QStringList findModules; + QMap<QString, QStringList> functionArgs; +}; + class CMAKE_EXPORT CMakeTool { public: @@ -73,7 +88,7 @@ public: bool isAutoRun() const; bool autoCreateBuildDirectory() const; QList<Generator> supportedGenerators() const; - TextEditor::Keywords keywords(); + CMakeKeywords keywords(); bool hasFileApi(bool ignoreCache = false) const; Version version() const; QString versionDisplay() const; @@ -101,6 +116,7 @@ private: void runCMake(Utils::Process &proc, const QStringList &args, int timeoutS = 1) const; void parseFunctionDetailsOutput(const QString &output); QStringList parseVariableOutput(const QString &output); + void parseSyntaxHighlightingXml(); void fetchFromCapabilities(bool ignoreCache = false) const; void parseFromCapabilities(const QString &input) const; From f1907836facb2955eba2e1acea309d9e5e725fdc Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 19 Sep 2023 08:17:31 +0200 Subject: [PATCH 1148/1777] Expected: Fix operator==(void, void) Change-Id: I883f05155f0710fc3a9f92a2e33d4f8722159016 Reviewed-by: David Schulz <david.schulz@qt.io> --- .../tl_expected/include/tl/expected.hpp | 15 +++++++++++++++ tests/auto/utils/expected/tst_expected.cpp | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/libs/3rdparty/tl_expected/include/tl/expected.hpp b/src/libs/3rdparty/tl_expected/include/tl/expected.hpp index d8ed472bdd1..56101d36331 100644 --- a/src/libs/3rdparty/tl_expected/include/tl/expected.hpp +++ b/src/libs/3rdparty/tl_expected/include/tl/expected.hpp @@ -2278,6 +2278,14 @@ detail::decay_t<Exp> or_else_impl(Exp &&exp, F &&f) { #endif } // namespace detail +template <class E, class F> +constexpr bool operator==(const expected<void, E> &lhs, + const expected<void, F> &rhs) { + return (lhs.has_value() != rhs.has_value()) + ? false + : (!lhs.has_value() ? lhs.error() == rhs.error() : true); +} + template <class T, class E, class U, class F> constexpr bool operator==(const expected<T, E> &lhs, const expected<U, F> &rhs) { @@ -2292,6 +2300,13 @@ constexpr bool operator!=(const expected<T, E> &lhs, ? true : (!lhs.has_value() ? lhs.error() != rhs.error() : *lhs != *rhs); } +template<class E, class F> +constexpr bool operator!=(const expected<void, E> &lhs, const expected<void, F> &rhs) +{ + return (lhs.has_value() != rhs.has_value()) + ? true + : (!lhs.has_value() ? lhs.error() != rhs.error() : false); +} template <class T, class E, class U> constexpr bool operator==(const expected<T, E> &x, const U &v) { diff --git a/tests/auto/utils/expected/tst_expected.cpp b/tests/auto/utils/expected/tst_expected.cpp index 43e58fb4f90..25240b861a7 100644 --- a/tests/auto/utils/expected/tst_expected.cpp +++ b/tests/auto/utils/expected/tst_expected.cpp @@ -32,6 +32,25 @@ private slots: QVERIFY(!result); } + + void tryCompareVoid() + { + tl::expected<void, QString> e1; + QVERIFY(e1 == e1); + + tl::expected<void, QString> e2 = make_unexpected("error"); + QVERIFY(e1 != e2); + + e1 = make_unexpected(QString("error")); + QVERIFY(e1 == e2); + + e2 = {}; + QVERIFY(e1 != e2); + + e1 = {}; + QVERIFY(e1 == e2); + QVERIFY(!(e1 != e2)); + } }; QTEST_GUILESS_MAIN(tst_expected) From 9a0f61b7e26bdfe8fa404e59bbad78cb8f860264 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 19 Sep 2023 09:53:30 +0200 Subject: [PATCH 1149/1777] TextEditor: reduce size of line ending chooser Change-Id: I3be0890ee78e2e3159e1494f8b5e972e04f11f67 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/texteditor/texteditor.cpp | 35 ++++++++++++++++++--------- src/plugins/texteditor/texteditor.h | 2 +- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index de397c01b4c..ce6421d80c9 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -107,6 +107,7 @@ #include <QTimeLine> #include <QTimer> #include <QToolBar> +#include <QToolButton> /*! \namespace TextEditor @@ -718,7 +719,7 @@ public: QAction *m_fileEncodingLabelAction = nullptr; BaseTextFind *m_find = nullptr; - QComboBox *m_fileLineEnding = nullptr; + QToolButton *m_fileLineEnding = nullptr; QAction *m_fileLineEndingAction = nullptr; uint m_optionalActionMask = TextEditorActionHandler::None; @@ -1027,8 +1028,7 @@ TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent) m_cursorPositionLabel->setContentsMargins(spacing, 0, spacing, 0); m_toolBarWidget->layout()->addWidget(m_cursorPositionLabel); - m_fileLineEnding = new QComboBox(); - m_fileLineEnding->addItems(ExtraEncodingSettings::lineTerminationModeNames()); + m_fileLineEnding = new QToolButton(q); m_fileLineEnding->setContentsMargins(spacing, 0, spacing, 0); m_fileLineEndingAction = m_toolBar->addWidget(m_fileLineEnding); updateFileLineEndingVisible(); @@ -1081,8 +1081,16 @@ TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent) connect(m_fileEncodingLabel, &FixedSizeClickLabel::clicked, q, &TextEditorWidget::selectEncoding); - connect(m_fileLineEnding, &QComboBox::currentIndexChanged, - q, &TextEditorWidget::selectLineEnding); + connect(m_fileLineEnding, &QToolButton::clicked, ActionManager::instance(), [this] { + QMenu *menu = new QMenu; + menu->addAction(tr("Unix Line Endings (LF)"), [this] { + q->selectLineEnding(TextFileFormat::LFLineTerminator); + }); + menu->addAction(tr("Windows Line Endings (CRLF)"), [this] { + q->selectLineEnding(TextFileFormat::CRLFLineTerminator); + }); + menu->popup(QCursor::pos()); + }); TextEditorSettings *settings = TextEditorSettings::instance(); @@ -1790,19 +1798,24 @@ void TextEditorWidget::selectEncoding() } } -void TextEditorWidget::selectLineEnding(int index) +void TextEditorWidget::selectLineEnding(TextFileFormat::LineTerminationMode lineEnding) { - QTC_CHECK(index >= 0); - const auto newMode = Utils::TextFileFormat::LineTerminationMode(index); - if (d->m_document->lineTerminationMode() != newMode) { - d->m_document->setLineTerminationMode(newMode); + if (d->m_document->lineTerminationMode() != lineEnding) { + d->m_document->setLineTerminationMode(lineEnding); d->q->document()->setModified(true); + updateTextLineEndingLabel(); } } void TextEditorWidget::updateTextLineEndingLabel() { - d->m_fileLineEnding->setCurrentIndex(d->m_document->lineTerminationMode()); + const TextFileFormat::LineTerminationMode lineEnding = d->m_document->lineTerminationMode(); + if (lineEnding == TextFileFormat::LFLineTerminator) + d->m_fileLineEnding->setText(Tr::tr("LF")); + else if (lineEnding == TextFileFormat::CRLFLineTerminator) + d->m_fileLineEnding->setText(Tr::tr("CRLF")); + else + QTC_ASSERT_STRING("Unsupported line ending mode."); } void TextEditorWidget::updateTextCodecLabel() diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index 6be08ae3cb7..0afa17f83a0 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -368,7 +368,7 @@ public: void unfoldCurrentBlock(); void selectEncoding(); void updateTextCodecLabel(); - void selectLineEnding(int index); + void selectLineEnding(Utils::TextFileFormat::LineTerminationMode lineEnding); void updateTextLineEndingLabel(); void addSelectionNextFindMatch(); void addCursorsToLineEnds(); From 383cfb77cc16cfb679f08930ba26cd95c0a84c42 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 19 Sep 2023 10:26:28 +0200 Subject: [PATCH 1150/1777] SquishTests: Fix writing test files on Windows Writing the text test files without encoding can end up in ANSI encoding of the files and in turn a fail when opening as the file is treated read only until correct encoding is used. Change-Id: I9e21e240b3b02011a2266dfda1f1b453c3dad457 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- tests/system/suite_editors/tst_clean_whitespaces/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/suite_editors/tst_clean_whitespaces/test.py b/tests/system/suite_editors/tst_clean_whitespaces/test.py index 5c9e7aa6a65..7803027f869 100644 --- a/tests/system/suite_editors/tst_clean_whitespaces/test.py +++ b/tests/system/suite_editors/tst_clean_whitespaces/test.py @@ -89,7 +89,7 @@ def prepareFileExternal(fileName, content): test.log("Added trailing whitespace.") modifiedContent += currentLine - with open(fileName, "w") as f: + with open(fileName, "w", encoding="utf-8") as f: # used only with text files, so okay f.write(modifiedContent) if not emptyLine or not trailingWS: From 0a7eebc9c4cf9313a8fa4b79ee6ba19421979c3c Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Mon, 18 Sep 2023 13:44:18 +0200 Subject: [PATCH 1151/1777] Python: add build target infos for .pyw files Change-Id: I7f36fb14f79edf69f043b0ac566c9493e043c6f1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/python/pythonconstants.h | 1 + src/plugins/python/pythonproject.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/python/pythonconstants.h b/src/plugins/python/pythonconstants.h index d5c5e3c6cd8..315aca8da66 100644 --- a/src/plugins/python/pythonconstants.h +++ b/src/plugins/python/pythonconstants.h @@ -27,6 +27,7 @@ const char PYLS_SETTINGS_ID[] = "Python.PyLSSettingsID"; * MIME type ******************************************************************************/ const char C_PY_MIMETYPE[] = "text/x-python"; +const char C_PY_GUI_MIMETYPE[] = "text/x-python-gui"; const char C_PY3_MIMETYPE[] = "text/x-python3"; const char C_PY_MIME_ICON[] = "text-x-python"; diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp index c9bb0f0b6ce..23cd8bd793b 100644 --- a/src/plugins/python/pythonproject.cpp +++ b/src/plugins/python/pythonproject.cpp @@ -232,7 +232,8 @@ void PythonBuildSystem::triggerParsing() newRoot->addNestedNode(std::make_unique<PythonFileNode>(entry.filePath, displayName, fileType)); const MimeType mt = mimeTypeForFile(entry.filePath, MimeMatchMode::MatchExtension); - if (mt.matchesName(Constants::C_PY_MIMETYPE) || mt.matchesName(Constants::C_PY3_MIMETYPE)) { + if (mt.matchesName(Constants::C_PY_MIMETYPE) || mt.matchesName(Constants::C_PY3_MIMETYPE) + || mt.matchesName(Constants::C_PY_GUI_MIMETYPE)) { BuildTargetInfo bti; bti.displayName = displayName; bti.buildKey = entry.filePath.toString(); From 4def80e1bfa9c844e6b8b25db25759359cba0f9d Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 18 Sep 2023 15:30:22 +0200 Subject: [PATCH 1152/1777] qbs build: Fix wrong usages of base.concat() Change-Id: I806c6beb35eb5765b5da97e356a13c3dcb1ddda3 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs | 2 +- src/shared/proparser/proparser.qbs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs b/src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs index acf111798f7..d6558880f8e 100644 --- a/src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs +++ b/src/libs/3rdparty/yaml-cpp/yaml-cpp.qbs @@ -97,6 +97,6 @@ QtcLibrary { Export { Depends { name: "cpp" } cpp.includePaths: [exportingProduct.sourceDirectory + "/include/"] - cpp.defines: base.concat(["YAML_CPP_DLL"]) + cpp.defines: "YAML_CPP_DLL" } } diff --git a/src/shared/proparser/proparser.qbs b/src/shared/proparser/proparser.qbs index dd9ce7cc64b..290ffdff5d8 100644 --- a/src/shared/proparser/proparser.qbs +++ b/src/shared/proparser/proparser.qbs @@ -6,13 +6,13 @@ Product { Export { Depends { name: "cpp" } - cpp.defines: base.concat([ + cpp.defines: [ "QMAKE_AS_LIBRARY", "PROPARSER_THREAD_SAFE", "PROEVALUATOR_THREAD_SAFE", "PROEVALUATOR_CUMULATIVE", "PROEVALUATOR_SETENV", - ]) - cpp.includePaths: base.concat([exportingProduct.sourceDirectory + "/.."]) + ] + cpp.includePaths: exportingProduct.sourceDirectory + "/.." } } From 24f0732d3a52a1e542dce176b77320a83ebcb090 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 18 Sep 2023 15:24:44 +0200 Subject: [PATCH 1153/1777] qbs build: Do not set minimum OS versions These requirements come from Qt these days; anything we specify here is redundant at best. Change-Id: Ib52d4e80d77cc05ea6d9baa4aa0c88cac2c1a132 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- qbs/imports/QtcProduct.qbs | 2 -- 1 file changed, 2 deletions(-) diff --git a/qbs/imports/QtcProduct.qbs b/qbs/imports/QtcProduct.qbs index 4841709e6d1..adf7314d0b2 100644 --- a/qbs/imports/QtcProduct.qbs +++ b/qbs/imports/QtcProduct.qbs @@ -62,8 +62,6 @@ Product { return flags; } } - cpp.minimumMacosVersion: "10.15" - cpp.minimumWindowsVersion: "6.1" cpp.useCxxPrecompiledHeader: useQt && (useNonGuiPchFile || useGuiPchFile) cpp.visibility: "minimal" From 621902d48597435eadca2de76a2a579bf21cc4da Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 18 Sep 2023 15:41:51 +0200 Subject: [PATCH 1154/1777] qbs build: Remove left-over "dev package" functionality This is no longer relevant. Change-Id: Ib9d851d69c5fc33d4808d883f6bec24fb3d1c4a7 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- qbs/modules/qtc/qtc.qbs | 5 ----- qtcreator.qbs | 12 ------------ src/shared/pch_files.qbs | 16 ---------------- src/src.qbs | 1 - 4 files changed, 34 deletions(-) delete mode 100644 src/shared/pch_files.qbs diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index a7fff4132ef..7a6a2a9de87 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -74,11 +74,6 @@ Module { property bool preferSystemSyntaxHighlighting: true - property bool make_dev_package: false - - // Will be replaced when creating modules from products - property string export_data_base: project.ide_source_tree + "/share/qtcreator" - property bool testsEnabled: Environment.getEnv("TEST") || qbs.buildVariant === "debug" property stringList generalDefines: [ "QT_CREATOR", diff --git a/qtcreator.qbs b/qtcreator.qbs index c3aca8caca5..9b1593016f7 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -22,18 +22,6 @@ Project { "tests/tests.qbs" ] - Product { - name: "qbs_imports_modules" - Depends { name: "qtc" } - Group { - prefix: "qbs/" - files: ["**/*"] - qbs.install: qtc.make_dev_package - qbs.installDir: qtc.ide_qbs_resources_path - qbs.installSourceBase: "qbs" - } - } - Product { name: "qmake project files" files: { diff --git a/src/shared/pch_files.qbs b/src/shared/pch_files.qbs deleted file mode 100644 index 237f8456db8..00000000000 --- a/src/shared/pch_files.qbs +++ /dev/null @@ -1,16 +0,0 @@ -import qbs -import qbs.FileInfo - -Product { - name: "precompiled headers" - condition: qtc.make_dev_package - Depends { name: "qtc" } - Group { - files: [ - "qtcreator_pch.h", - "qtcreator_gui_pch.h", - ] - qbs.install: true - qbs.installDir: qtc.ide_shared_sources_path - } -} diff --git a/src/src.qbs b/src/src.qbs index 3d39fb7fcd6..fb7532b03c9 100644 --- a/src/src.qbs +++ b/src/src.qbs @@ -14,7 +14,6 @@ Project { "tools/tools.qbs", project.sharedSourcesDir + "/json", project.sharedSourcesDir + "/proparser", - project.sharedSourcesDir + "/pch_files.qbs", ] property bool qbsSubModuleExists: File.exists(qbsProject.qbsBaseDir + "/qbs.qbs") From d00d056b320608a4e3425e9f2b5da7e749497934 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 18 Sep 2023 15:46:08 +0200 Subject: [PATCH 1155/1777] qbs build: Remove compatibility code for outdated qbs versions Change-Id: I2667e0e76dbcf692a25a5d4d5f020ac90f0be478 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- qbs/modules/pluginjson/pluginjson.qbs | 3 +-- qbs/modules/qtc/qtc.qbs | 12 ------------ qtcreator.qbs | 2 +- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/qbs/modules/pluginjson/pluginjson.qbs b/qbs/modules/pluginjson/pluginjson.qbs index 9a200cf83f7..43d5e7f0012 100644 --- a/qbs/modules/pluginjson/pluginjson.qbs +++ b/qbs/modules/pluginjson/pluginjson.qbs @@ -11,8 +11,7 @@ Module { property var replacements // TODO: Wrap the VCS specific stuff in a dedicated module - property bool hasVcs: Utilities.versionCompare(qbs.version, "1.10") >= 0 - property bool useVcsData: hasVcs + property bool useVcsData: true Depends { name: "vcs"; condition: useVcsData } Properties { condition: useVcsData diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 7a6a2a9de87..73b26adf9e5 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -4,8 +4,6 @@ import qbs.FileInfo import qbs.Utilities Module { - Depends { name: "cpp"; required: false } - property string qtcreator_display_version: '12.0.0-beta1' property string ide_version_major: '11' property string ide_version_minor: '0' @@ -92,14 +90,4 @@ Module { "QT_USE_QSTRINGBUILDER", ].concat(testsEnabled ? ["WITH_TESTS"] : []) .concat(qbs.toolchain.contains("msvc") ? ["_CRT_SECURE_NO_WARNINGS"] : []) - .concat((qbs.toolchain.contains("msvc") && Utilities.versionCompare(qbs.version, "1.23.2") < 0) - ? ["_ENABLE_EXTENDED_ALIGNED_STORAGE"] : []) - - Properties { - condition: cpp.present && qbs.toolchain.contains("msvc") && product.Qt - && Utilities.versionCompare(product.Qt.core.version, "6.3") >= 0 - && Utilities.versionCompare(cpp.compilerVersion, "19.10") >= 0 - && Utilities.versionCompare(qbs.version, "1.23") < 0 - cpp.cxxFlags: "/permissive-" - } } diff --git a/qtcreator.qbs b/qtcreator.qbs index 9b1593016f7..be6a190e3af 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -4,7 +4,7 @@ import qbs.FileInfo Project { name: "Qt Creator" - minimumQbsVersion: "1.19.0" + minimumQbsVersion: "2.0.0" property bool withAutotests: qbs.buildVariant === "debug" property path ide_source_tree: path property pathList additionalPlugins: [] From 5da1f149034590626171308b5d74c9df15739b2d Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 19 Sep 2023 12:52:53 +0200 Subject: [PATCH 1156/1777] Core: Revert unintended change Amends: e34762c84436c9b8b3d35f119a893dcd6cb4f4db Change-Id: I024b6ae5b65dffe45bacc1f44bba5e8ce41fe49d Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/libs/utils/dropsupport.cpp | 7 +++---- src/plugins/coreplugin/editormanager/editorview.cpp | 4 ++-- src/plugins/coreplugin/mainwindow.cpp | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/libs/utils/dropsupport.cpp b/src/libs/utils/dropsupport.cpp index 95d3678719f..7416edf9c37 100644 --- a/src/libs/utils/dropsupport.cpp +++ b/src/libs/utils/dropsupport.cpp @@ -86,11 +86,10 @@ bool DropSupport::eventFilter(QObject *obj, QEvent *event) auto dee = static_cast<QDragEnterEvent *>(event); if ((isFileDrop(dee) || isValueDrop(dee)) && (!m_filterFunction || m_filterFunction(dee, this))) { event->accept(); - return true; + } else { + event->ignore(); } - // event->ignore(); - return false; - + return true; } else if (event->type() == QEvent::DragMove) { event->accept(); return true; diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 0229116ff85..9edef863c9a 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -113,7 +113,7 @@ EditorView::EditorView(SplitterOrView *parentSplitterOrView, QWidget *parent) : m_container->addWidget(empty); m_widgetEditorMap.insert(empty, nullptr); - /*const auto dropSupport = new DropSupport(this, [this](QDropEvent *event, DropSupport *) { + const auto dropSupport = new DropSupport(this, [this](QDropEvent *event, DropSupport *) { // do not accept move events except from other editor views (i.e. their tool bars) // otherwise e.g. item views that support moving items within themselves would // also "move" the item into the editor view, i.e. the item would be removed from the @@ -126,7 +126,7 @@ EditorView::EditorView(SplitterOrView *parentSplitterOrView, QWidget *parent) : }); connect(dropSupport, &DropSupport::filesDropped, this, &EditorView::openDroppedFiles); -*/ + updateNavigatorActions(); } diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index f31fcbf99be..47d66c32b46 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -194,12 +194,12 @@ MainWindow::MainWindow() statusBar()->setProperty("p_styled", true); - /*auto dropSupport = new DropSupport(this, [](QDropEvent *event, DropSupport *) { + auto dropSupport = new DropSupport(this, [](QDropEvent *event, DropSupport *) { return event->source() == nullptr; // only accept drops from the "outside" (e.g. file manager) }); connect(dropSupport, &DropSupport::filesDropped, this, &MainWindow::openDroppedFiles); -*/ + if (HostOsInfo::isLinuxHost()) { m_trimTimer.setSingleShot(true); m_trimTimer.setInterval(60000); From 263b1e70ef7886fa4b687728ee73c295e1ad8384 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Sat, 16 Sep 2023 14:01:03 +0200 Subject: [PATCH 1157/1777] Clang/LLVM: Update to version 17.0.0-rc4 Change-Id: Ica6c5db764db8c3b8105c168f9001d7de3c6c5c1 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .github/workflows/build_cmake.yml | 4 ++-- coin/instructions/build.yaml | 2 +- coin/instructions/common_environment.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 68fe9052e6e..52c2a0e4d29 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -9,7 +9,7 @@ on: env: QT_VERSION: 6.5.2 MACOS_DEPLOYMENT_TARGET: 10.15 - CLANG_VERSION: 16.0.2 + CLANG_VERSION: 17.0.0-rc4 ELFUTILS_VERSION: 0.175 CMAKE_VERSION: 3.21.1 NINJA_VERSION: 1.10.2 @@ -374,7 +374,7 @@ jobs: set(libclang "libclang-release_${clang_version}-based-windows-vs2019_32.7z") endif() elseif ("${{ runner.os }}" STREQUAL "Linux") - set(libclang "libclang-release_${clang_version}-based-linux-Ubuntu20.04-gcc9.3-x86_64.7z") + set(libclang "libclang-release_${clang_version}-based-linux-Ubuntu22.04-gcc11.4-x86_64.7z") elseif ("${{ runner.os }}" STREQUAL "macOS") set(libclang "libclang-release_${clang_version}-based-macos-universal.7z") endif() diff --git a/coin/instructions/build.yaml b/coin/instructions/build.yaml index fd96cb5bf6d..1972965b512 100644 --- a/coin/instructions/build.yaml +++ b/coin/instructions/build.yaml @@ -16,7 +16,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract elfutils package, check logs." - type: ExecuteCommand - command: "curl --fail -L --retry 5 --retry-delay 5 -o {{.AgentWorkingDir}}/build/qt_temp/libclang.7z {{.Env.LLVM_BASE_URL}}-linux-Rhel8.2-gcc9.2-x86_64.7z" + command: "curl --fail -L --retry 5 --retry-delay 5 -o {{.AgentWorkingDir}}/build/qt_temp/libclang.7z {{.Env.LLVM_BASE_URL}}-linux-Rhel8.4-gcc10.3-x86_64.7z" maxTimeInSeconds: 3600 maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to download LLVM package, check logs." diff --git a/coin/instructions/common_environment.yaml b/coin/instructions/common_environment.yaml index 20d6247ea9c..2a56fe600e9 100644 --- a/coin/instructions/common_environment.yaml +++ b/coin/instructions/common_environment.yaml @@ -7,7 +7,7 @@ instructions: variableValue: "RelWithDebInfo" - type: EnvironmentVariable variableName: LLVM_BASE_URL - variableValue: https://ci-files02-hki.ci.qt.io/packages/jenkins/qtcreator_libclang/libclang-release_16.0.2-based + variableValue: https://ci-files02-hki.ci.qt.io/packages/jenkins/qtcreator_libclang/libclang-release_17.0.0-rc4-based - type: EnvironmentVariable variableName: QTC_QT_BASE_URL variableValue: "https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.2-released/Qt" From 2f80ef7f23e25acd109eb696e0caffe29c448584 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 19 Sep 2023 11:16:56 +0200 Subject: [PATCH 1158/1777] qtc-askpass: Quit after retrieving the password Task-number: QTCREATORBUG-29619 Change-Id: Ib279ec43b7f67b8eac593d9e2f9800a65db024b7 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/tools/qtc-askpass/qtc-askpass-main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/qtc-askpass/qtc-askpass-main.cpp b/src/tools/qtc-askpass/qtc-askpass-main.cpp index 5a527e18db1..610d4d622eb 100644 --- a/src/tools/qtc-askpass/qtc-askpass-main.cpp +++ b/src/tools/qtc-askpass/qtc-askpass-main.cpp @@ -18,8 +18,10 @@ int main(int argc, char *argv[]) labelText.append('\n').append(appArgs.at(1)); dlg.setLabelText(labelText); dlg.setTextEchoMode(QLineEdit::Password); - if (dlg.exec() == QDialog::Accepted) + const bool accepted = dlg.exec() == QDialog::Accepted; + if (accepted) std::cout << qPrintable(dlg.textValue()) << std::endl; + qApp->exit(accepted ? 0 : 1); }); return app.exec(); } From 7e43895e8179dc7c1bb1e7984d36ac52688f7b3c Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 18 Sep 2023 16:29:06 +0200 Subject: [PATCH 1159/1777] qbs build: Remove the group enumerating the qmake project files The qmake build is gone. Change-Id: If2c9948ab08201efb1696dc9ea6eea0e59e31412 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- qtcreator.qbs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/qtcreator.qbs b/qtcreator.qbs index be6a190e3af..f542f5c5fb5 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -22,19 +22,6 @@ Project { "tests/tests.qbs" ] - Product { - name: "qmake project files" - files: { - var list = ["**/*.pr[io]"]; - var props = [additionalPlugins, additionalLibs, additionalTools, additionalAutotests]; - for (var i = 0; i < props.length; ++i) { - for (var j = 0; j < props[i].length; ++j) - list.push(props[i][j] + "/**/*.pr[io]"); - } - return list; - } - } - Product { name: "cmake project files" files: { From 768f12e0334efeb350aedb94fb893a737bb1309f Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 19 Sep 2023 11:29:40 +0200 Subject: [PATCH 1160/1777] Expected: Add upstream changes Change-Id: I4fcf728200f50775c631c8a1399cd17643e3d519 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../tl_expected/include/tl/expected.hpp | 757 ++++++++++-------- tests/auto/utils/expected/tst_expected.cpp | 2 +- 2 files changed, 423 insertions(+), 336 deletions(-) diff --git a/src/libs/3rdparty/tl_expected/include/tl/expected.hpp b/src/libs/3rdparty/tl_expected/include/tl/expected.hpp index 56101d36331..afee404d43e 100644 --- a/src/libs/3rdparty/tl_expected/include/tl/expected.hpp +++ b/src/libs/3rdparty/tl_expected/include/tl/expected.hpp @@ -1,6 +1,6 @@ /// // expected - An implementation of std::expected with extensions -// Written in 2017 by Simon Brand (simonrbrand@gmail.com, @TartanLlama) +// Written in 2017 by Sy Brand (tartanllama@gmail.com, @TartanLlama) // // Documentation available at http://tl.tartanllama.xyz/ // @@ -17,8 +17,8 @@ #define TL_EXPECTED_HPP #define TL_EXPECTED_VERSION_MAJOR 1 -#define TL_EXPECTED_VERSION_MINOR 0 -#define TL_EXPECTED_VERSION_PATCH 1 +#define TL_EXPECTED_VERSION_MINOR 1 +#define TL_EXPECTED_VERSION_PATCH 0 #include <exception> #include <functional> @@ -51,6 +51,16 @@ #define TL_EXPECTED_GCC55 #endif +#if !defined(TL_ASSERT) +//can't have assert in constexpr in C++11 and GCC 4.9 has a compiler bug +#if (__cplusplus > 201103L) && !defined(TL_EXPECTED_GCC49) +#include <cassert> +#define TL_ASSERT(x) assert(x) +#else +#define TL_ASSERT(x) +#endif +#endif + #if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \ !defined(__clang__)) // GCC < 5 doesn't support overloading on const&& for member functions @@ -66,30 +76,30 @@ #define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \ std::is_trivially_destructible<T> -// GCC 5 < v < 8 has a bug in is_trivially_copy_constructible which breaks std::vector -// for non-copyable types -#elif (defined(__GNUC__) && __GNUC__ < 8 && \ - !defined(__clang__)) +// GCC 5 < v < 8 has a bug in is_trivially_copy_constructible which breaks +// std::vector for non-copyable types +#elif (defined(__GNUC__) && __GNUC__ < 8 && !defined(__clang__)) #ifndef TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX #define TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX namespace tl { - namespace detail { - template<class T> - struct is_trivially_copy_constructible : std::is_trivially_copy_constructible<T>{}; +namespace detail { +template <class T> +struct is_trivially_copy_constructible + : std::is_trivially_copy_constructible<T> {}; #ifdef _GLIBCXX_VECTOR - template<class T, class A> - struct is_trivially_copy_constructible<std::vector<T,A>> - : std::false_type{}; +template <class T, class A> +struct is_trivially_copy_constructible<std::vector<T, A>> : std::false_type {}; #endif - } -} +} // namespace detail +} // namespace tl #endif -#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ +#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ tl::detail::is_trivially_copy_constructible<T> -#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \ +#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \ std::is_trivially_copy_assignable<T> -#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) std::is_trivially_destructible<T> +#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \ + std::is_trivially_destructible<T> #else #define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ std::is_trivially_copy_constructible<T> @@ -138,6 +148,17 @@ public: constexpr explicit unexpected(E &&e) : m_val(std::move(e)) {} + template <class... Args, typename std::enable_if<std::is_constructible< + E, Args &&...>::value>::type * = nullptr> + constexpr explicit unexpected(Args &&...args) + : m_val(std::forward<Args>(args)...) {} + template < + class U, class... Args, + typename std::enable_if<std::is_constructible< + E, std::initializer_list<U> &, Args &&...>::value>::type * = nullptr> + constexpr explicit unexpected(std::initializer_list<U> l, Args &&...args) + : m_val(l, std::forward<Args>(args)...) {} + constexpr const E &value() const & { return m_val; } TL_EXPECTED_11_CONSTEXPR E &value() & { return m_val; } TL_EXPECTED_11_CONSTEXPR E &&value() && { return std::move(m_val); } @@ -147,6 +168,10 @@ private: E m_val; }; +#ifdef __cpp_deduction_guides +template <class E> unexpected(E) -> unexpected<E>; +#endif + template <class E> constexpr bool operator==(const unexpected<E> &lhs, const unexpected<E> &rhs) { return lhs.value() == rhs.value(); @@ -183,16 +208,17 @@ struct unexpect_t { static constexpr unexpect_t unexpect{}; namespace detail { -template<typename E> +template <typename E> [[noreturn]] TL_EXPECTED_11_CONSTEXPR void throw_exception(E &&e) { #ifdef TL_EXPECTED_EXCEPTIONS_ENABLED - throw std::forward<E>(e); + throw std::forward<E>(e); #else - #ifdef _MSC_VER - __assume(0); - #else - __builtin_unreachable(); - #endif + (void)e; +#ifdef _MSC_VER + __assume(0); +#else + __builtin_unreachable(); +#endif #endif } @@ -213,7 +239,7 @@ template <class...> struct conjunction : std::true_type {}; template <class B> struct conjunction<B> : B {}; template <class B, class... Bs> struct conjunction<B, Bs...> - : std::conditional<bool(B::value), conjunction<Bs...>, B>::type {}; + : std::conditional<bool(B::value), conjunction<Bs...>, B>::type {}; #if defined(_LIBCPP_VERSION) && __cplusplus == 201103L #define TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND @@ -223,45 +249,52 @@ struct conjunction<B, Bs...> // which results in a hard-error when using it in a noexcept expression // in some cases. This is a check to workaround the common failing case. #ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND -template <class T> struct is_pointer_to_non_const_member_func : std::false_type {}; +template <class T> +struct is_pointer_to_non_const_member_func : std::false_type {}; template <class T, class Ret, class... Args> -struct is_pointer_to_non_const_member_func<Ret(T::*) (Args...)> : std::true_type {}; +struct is_pointer_to_non_const_member_func<Ret (T::*)(Args...)> + : std::true_type {}; template <class T, class Ret, class... Args> -struct is_pointer_to_non_const_member_func<Ret(T::*) (Args...)&> : std::true_type {}; +struct is_pointer_to_non_const_member_func<Ret (T::*)(Args...) &> + : std::true_type {}; template <class T, class Ret, class... Args> -struct is_pointer_to_non_const_member_func<Ret(T::*) (Args...) &&> : std::true_type {}; +struct is_pointer_to_non_const_member_func<Ret (T::*)(Args...) &&> + : std::true_type {}; template <class T, class Ret, class... Args> -struct is_pointer_to_non_const_member_func<Ret(T::*) (Args...) volatile> : std::true_type {}; +struct is_pointer_to_non_const_member_func<Ret (T::*)(Args...) volatile> + : std::true_type {}; template <class T, class Ret, class... Args> -struct is_pointer_to_non_const_member_func<Ret(T::*) (Args...) volatile &> : std::true_type {}; +struct is_pointer_to_non_const_member_func<Ret (T::*)(Args...) volatile &> + : std::true_type {}; template <class T, class Ret, class... Args> -struct is_pointer_to_non_const_member_func<Ret(T::*) (Args...) volatile &&> : std::true_type {}; +struct is_pointer_to_non_const_member_func<Ret (T::*)(Args...) volatile &&> + : std::true_type {}; template <class T> struct is_const_or_const_ref : std::false_type {}; -template <class T> struct is_const_or_const_ref<T const&> : std::true_type {}; +template <class T> struct is_const_or_const_ref<T const &> : std::true_type {}; template <class T> struct is_const_or_const_ref<T const> : std::true_type {}; #endif // std::invoke from C++17 // https://stackoverflow.com/questions/38288042/c11-14-invoke-workaround -template <typename Fn, typename... Args, +template < + typename Fn, typename... Args, #ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND - typename = enable_if_t<!(is_pointer_to_non_const_member_func<Fn>::value - && is_const_or_const_ref<Args...>::value)>, + typename = enable_if_t<!(is_pointer_to_non_const_member_func<Fn>::value && + is_const_or_const_ref<Args...>::value)>, #endif - typename = enable_if_t<std::is_member_pointer<decay_t<Fn>>::value>, - int = 0> - constexpr auto invoke(Fn && f, Args && ... args) noexcept( + typename = enable_if_t<std::is_member_pointer<decay_t<Fn>>::value>, int = 0> +constexpr auto invoke(Fn &&f, Args &&...args) noexcept( noexcept(std::mem_fn(f)(std::forward<Args>(args)...))) - -> decltype(std::mem_fn(f)(std::forward<Args>(args)...)) { + -> decltype(std::mem_fn(f)(std::forward<Args>(args)...)) { return std::mem_fn(f)(std::forward<Args>(args)...); } template <typename Fn, typename... Args, - typename = enable_if_t<!std::is_member_pointer<decay_t<Fn>>::value>> - constexpr auto invoke(Fn && f, Args && ... args) noexcept( + typename = enable_if_t<!std::is_member_pointer<decay_t<Fn>>::value>> +constexpr auto invoke(Fn &&f, Args &&...args) noexcept( noexcept(std::forward<Fn>(f)(std::forward<Args>(args)...))) - -> decltype(std::forward<Fn>(f)(std::forward<Args>(args)...)) { + -> decltype(std::forward<Fn>(f)(std::forward<Args>(args)...)) { return std::forward<Fn>(f)(std::forward<Args>(args)...); } @@ -270,9 +303,11 @@ template <class F, class, class... Us> struct invoke_result_impl; template <class F, class... Us> struct invoke_result_impl< - F, decltype(detail::invoke(std::declval<F>(), std::declval<Us>()...), void()), - Us...> { - using type = decltype(detail::invoke(std::declval<F>(), std::declval<Us>()...)); + F, + decltype(detail::invoke(std::declval<F>(), std::declval<Us>()...), void()), + Us...> { + using type = + decltype(detail::invoke(std::declval<F>(), std::declval<Us>()...)); }; template <class F, class... Us> @@ -289,69 +324,67 @@ template <class T, class U = T> struct is_nothrow_swappable : std::true_type {}; #else // https://stackoverflow.com/questions/26744589/what-is-a-proper-way-to-implement-is-swappable-to-test-for-the-swappable-concept namespace swap_adl_tests { - // if swap ADL finds this then it would call std::swap otherwise (same - // signature) - struct tag {}; +// if swap ADL finds this then it would call std::swap otherwise (same +// signature) +struct tag {}; - template <class T> tag swap(T&, T&); - template <class T, std::size_t N> tag swap(T(&a)[N], T(&b)[N]); +template <class T> tag swap(T &, T &); +template <class T, std::size_t N> tag swap(T (&a)[N], T (&b)[N]); - // helper functions to test if an unqualified swap is possible, and if it - // becomes std::swap - template <class, class> std::false_type can_swap(...) noexcept(false); - template <class T, class U, - class = decltype(swap(std::declval<T&>(), std::declval<U&>()))> - std::true_type can_swap(int) noexcept(noexcept(swap(std::declval<T&>(), - std::declval<U&>()))); +// helper functions to test if an unqualified swap is possible, and if it +// becomes std::swap +template <class, class> std::false_type can_swap(...) noexcept(false); +template <class T, class U, + class = decltype(swap(std::declval<T &>(), std::declval<U &>()))> +std::true_type can_swap(int) noexcept(noexcept(swap(std::declval<T &>(), + std::declval<U &>()))); - template <class, class> std::false_type uses_std(...); - template <class T, class U> - std::is_same<decltype(swap(std::declval<T&>(), std::declval<U&>())), tag> - uses_std(int); +template <class, class> std::false_type uses_std(...); +template <class T, class U> +std::is_same<decltype(swap(std::declval<T &>(), std::declval<U &>())), tag> +uses_std(int); - template <class T> - struct is_std_swap_noexcept +template <class T> +struct is_std_swap_noexcept : std::integral_constant<bool, - std::is_nothrow_move_constructible<T>::value&& - std::is_nothrow_move_assignable<T>::value> {}; + std::is_nothrow_move_constructible<T>::value && + std::is_nothrow_move_assignable<T>::value> {}; - template <class T, std::size_t N> - struct is_std_swap_noexcept<T[N]> : is_std_swap_noexcept<T> {}; +template <class T, std::size_t N> +struct is_std_swap_noexcept<T[N]> : is_std_swap_noexcept<T> {}; - template <class T, class U> - struct is_adl_swap_noexcept +template <class T, class U> +struct is_adl_swap_noexcept : std::integral_constant<bool, noexcept(can_swap<T, U>(0))> {}; } // namespace swap_adl_tests template <class T, class U = T> struct is_swappable - : std::integral_constant< - bool, - decltype(detail::swap_adl_tests::can_swap<T, U>(0))::value && - (!decltype(detail::swap_adl_tests::uses_std<T, U>(0))::value || - (std::is_move_assignable<T>::value && - std::is_move_constructible<T>::value))> {}; + : std::integral_constant< + bool, + decltype(detail::swap_adl_tests::can_swap<T, U>(0))::value && + (!decltype(detail::swap_adl_tests::uses_std<T, U>(0))::value || + (std::is_move_assignable<T>::value && + std::is_move_constructible<T>::value))> {}; template <class T, std::size_t N> struct is_swappable<T[N], T[N]> - : std::integral_constant< - bool, - decltype(detail::swap_adl_tests::can_swap<T[N], T[N]>(0))::value && - (!decltype( - detail::swap_adl_tests::uses_std<T[N], T[N]>(0))::value || - is_swappable<T, T>::value)> {}; + : std::integral_constant< + bool, + decltype(detail::swap_adl_tests::can_swap<T[N], T[N]>(0))::value && + (!decltype(detail::swap_adl_tests::uses_std<T[N], T[N]>( + 0))::value || + is_swappable<T, T>::value)> {}; template <class T, class U = T> struct is_nothrow_swappable - : std::integral_constant< - bool, - is_swappable<T, U>::value && - ((decltype(detail::swap_adl_tests::uses_std<T, U>(0))::value - && detail::swap_adl_tests::is_std_swap_noexcept<T>::value) || - (!decltype(detail::swap_adl_tests::uses_std<T, U>(0))::value && - detail::swap_adl_tests::is_adl_swap_noexcept<T, - U>::value))> { -}; + : std::integral_constant< + bool, + is_swappable<T, U>::value && + ((decltype(detail::swap_adl_tests::uses_std<T, U>(0))::value && + detail::swap_adl_tests::is_std_swap_noexcept<T>::value) || + (!decltype(detail::swap_adl_tests::uses_std<T, U>(0))::value && + detail::swap_adl_tests::is_adl_swap_noexcept<T, U>::value))> {}; #endif #endif @@ -393,14 +426,10 @@ using is_move_constructible_or_void = is_void_or<T, std::is_move_constructible<T>>; template <class T> -using is_copy_assignable_or_void = - is_void_or<T, std::is_copy_assignable<T>>; - +using is_copy_assignable_or_void = is_void_or<T, std::is_copy_assignable<T>>; template <class T> -using is_move_assignable_or_void = - is_void_or<T, std::is_move_assignable<T>>; - +using is_move_assignable_or_void = is_void_or<T, std::is_move_assignable<T>>; } // namespace detail @@ -423,19 +452,19 @@ struct expected_storage_base { template <class... Args, detail::enable_if_t<std::is_constructible<T, Args &&...>::value> * = nullptr> - constexpr expected_storage_base(in_place_t, Args &&... args) + constexpr expected_storage_base(in_place_t, Args &&...args) : m_val(std::forward<Args>(args)...), m_has_val(true) {} template <class U, class... Args, detail::enable_if_t<std::is_constructible< T, std::initializer_list<U> &, Args &&...>::value> * = nullptr> constexpr expected_storage_base(in_place_t, std::initializer_list<U> il, - Args &&... args) + Args &&...args) : m_val(il, std::forward<Args>(args)...), m_has_val(true) {} template <class... Args, detail::enable_if_t<std::is_constructible<E, Args &&...>::value> * = nullptr> - constexpr explicit expected_storage_base(unexpect_t, Args &&... args) + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) : m_unexpect(std::forward<Args>(args)...), m_has_val(false) {} template <class U, class... Args, @@ -443,7 +472,7 @@ struct expected_storage_base { E, std::initializer_list<U> &, Args &&...>::value> * = nullptr> constexpr explicit expected_storage_base(unexpect_t, std::initializer_list<U> il, - Args &&... args) + Args &&...args) : m_unexpect(il, std::forward<Args>(args)...), m_has_val(false) {} ~expected_storage_base() { @@ -470,19 +499,19 @@ template <class T, class E> struct expected_storage_base<T, E, true, true> { template <class... Args, detail::enable_if_t<std::is_constructible<T, Args &&...>::value> * = nullptr> - constexpr expected_storage_base(in_place_t, Args &&... args) + constexpr expected_storage_base(in_place_t, Args &&...args) : m_val(std::forward<Args>(args)...), m_has_val(true) {} template <class U, class... Args, detail::enable_if_t<std::is_constructible< T, std::initializer_list<U> &, Args &&...>::value> * = nullptr> constexpr expected_storage_base(in_place_t, std::initializer_list<U> il, - Args &&... args) + Args &&...args) : m_val(il, std::forward<Args>(args)...), m_has_val(true) {} template <class... Args, detail::enable_if_t<std::is_constructible<E, Args &&...>::value> * = nullptr> - constexpr explicit expected_storage_base(unexpect_t, Args &&... args) + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) : m_unexpect(std::forward<Args>(args)...), m_has_val(false) {} template <class U, class... Args, @@ -490,7 +519,7 @@ template <class T, class E> struct expected_storage_base<T, E, true, true> { E, std::initializer_list<U> &, Args &&...>::value> * = nullptr> constexpr explicit expected_storage_base(unexpect_t, std::initializer_list<U> il, - Args &&... args) + Args &&...args) : m_unexpect(il, std::forward<Args>(args)...), m_has_val(false) {} ~expected_storage_base() = default; @@ -511,19 +540,19 @@ template <class T, class E> struct expected_storage_base<T, E, true, false> { template <class... Args, detail::enable_if_t<std::is_constructible<T, Args &&...>::value> * = nullptr> - constexpr expected_storage_base(in_place_t, Args &&... args) + constexpr expected_storage_base(in_place_t, Args &&...args) : m_val(std::forward<Args>(args)...), m_has_val(true) {} template <class U, class... Args, detail::enable_if_t<std::is_constructible< T, std::initializer_list<U> &, Args &&...>::value> * = nullptr> constexpr expected_storage_base(in_place_t, std::initializer_list<U> il, - Args &&... args) + Args &&...args) : m_val(il, std::forward<Args>(args)...), m_has_val(true) {} template <class... Args, detail::enable_if_t<std::is_constructible<E, Args &&...>::value> * = nullptr> - constexpr explicit expected_storage_base(unexpect_t, Args &&... args) + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) : m_unexpect(std::forward<Args>(args)...), m_has_val(false) {} template <class U, class... Args, @@ -531,7 +560,7 @@ template <class T, class E> struct expected_storage_base<T, E, true, false> { E, std::initializer_list<U> &, Args &&...>::value> * = nullptr> constexpr explicit expected_storage_base(unexpect_t, std::initializer_list<U> il, - Args &&... args) + Args &&...args) : m_unexpect(il, std::forward<Args>(args)...), m_has_val(false) {} ~expected_storage_base() { @@ -556,19 +585,19 @@ template <class T, class E> struct expected_storage_base<T, E, false, true> { template <class... Args, detail::enable_if_t<std::is_constructible<T, Args &&...>::value> * = nullptr> - constexpr expected_storage_base(in_place_t, Args &&... args) + constexpr expected_storage_base(in_place_t, Args &&...args) : m_val(std::forward<Args>(args)...), m_has_val(true) {} template <class U, class... Args, detail::enable_if_t<std::is_constructible< T, std::initializer_list<U> &, Args &&...>::value> * = nullptr> constexpr expected_storage_base(in_place_t, std::initializer_list<U> il, - Args &&... args) + Args &&...args) : m_val(il, std::forward<Args>(args)...), m_has_val(true) {} template <class... Args, detail::enable_if_t<std::is_constructible<E, Args &&...>::value> * = nullptr> - constexpr explicit expected_storage_base(unexpect_t, Args &&... args) + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) : m_unexpect(std::forward<Args>(args)...), m_has_val(false) {} template <class U, class... Args, @@ -576,7 +605,7 @@ template <class T, class E> struct expected_storage_base<T, E, false, true> { E, std::initializer_list<U> &, Args &&...>::value> * = nullptr> constexpr explicit expected_storage_base(unexpect_t, std::initializer_list<U> il, - Args &&... args) + Args &&...args) : m_unexpect(il, std::forward<Args>(args)...), m_has_val(false) {} ~expected_storage_base() { @@ -594,7 +623,13 @@ template <class T, class E> struct expected_storage_base<T, E, false, true> { // `T` is `void`, `E` is trivially-destructible template <class E> struct expected_storage_base<void, E, false, true> { - TL_EXPECTED_MSVC2015_CONSTEXPR expected_storage_base() : m_has_val(true) {} + #if __GNUC__ <= 5 + //no constexpr for GCC 4/5 bug + #else + TL_EXPECTED_MSVC2015_CONSTEXPR + #endif + expected_storage_base() : m_has_val(true) {} + constexpr expected_storage_base(no_init_t) : m_val(), m_has_val(false) {} constexpr expected_storage_base(in_place_t) : m_has_val(true) {} @@ -602,7 +637,7 @@ template <class E> struct expected_storage_base<void, E, false, true> { template <class... Args, detail::enable_if_t<std::is_constructible<E, Args &&...>::value> * = nullptr> - constexpr explicit expected_storage_base(unexpect_t, Args &&... args) + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) : m_unexpect(std::forward<Args>(args)...), m_has_val(false) {} template <class U, class... Args, @@ -610,7 +645,7 @@ template <class E> struct expected_storage_base<void, E, false, true> { E, std::initializer_list<U> &, Args &&...>::value> * = nullptr> constexpr explicit expected_storage_base(unexpect_t, std::initializer_list<U> il, - Args &&... args) + Args &&...args) : m_unexpect(il, std::forward<Args>(args)...), m_has_val(false) {} ~expected_storage_base() = default; @@ -632,7 +667,7 @@ template <class E> struct expected_storage_base<void, E, false, false> { template <class... Args, detail::enable_if_t<std::is_constructible<E, Args &&...>::value> * = nullptr> - constexpr explicit expected_storage_base(unexpect_t, Args &&... args) + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) : m_unexpect(std::forward<Args>(args)...), m_has_val(false) {} template <class U, class... Args, @@ -640,7 +675,7 @@ template <class E> struct expected_storage_base<void, E, false, false> { E, std::initializer_list<U> &, Args &&...>::value> * = nullptr> constexpr explicit expected_storage_base(unexpect_t, std::initializer_list<U> il, - Args &&... args) + Args &&...args) : m_unexpect(il, std::forward<Args>(args)...), m_has_val(false) {} ~expected_storage_base() { @@ -662,7 +697,7 @@ template <class T, class E> struct expected_operations_base : expected_storage_base<T, E> { using expected_storage_base<T, E>::expected_storage_base; - template <class... Args> void construct(Args &&... args) noexcept { + template <class... Args> void construct(Args &&...args) noexcept { new (std::addressof(this->m_val)) T(std::forward<Args>(args)...); this->m_has_val = true; } @@ -672,13 +707,13 @@ struct expected_operations_base : expected_storage_base<T, E> { this->m_has_val = true; } - template <class... Args> void construct_error(Args &&... args) noexcept { + template <class... Args> void construct_error(Args &&...args) noexcept { new (std::addressof(this->m_unexpect)) unexpected<E>(std::forward<Args>(args)...); this->m_has_val = false; } - #ifdef TL_EXPECTED_EXCEPTIONS_ENABLED +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED // These assign overloads ensure that the most efficient assignment // implementation is used while maintaining the strong exception guarantee. @@ -778,7 +813,7 @@ struct expected_operations_base : expected_storage_base<T, E> { } } - #else +#else // If exceptions are disabled then we can just copy-construct void assign(const expected_operations_base &rhs) noexcept { @@ -795,11 +830,11 @@ struct expected_operations_base : expected_storage_base<T, E> { geterr().~unexpected<E>(); construct(std::move(rhs).get()); } else { - assign_common(rhs); + assign_common(std::move(rhs)); } } - #endif +#endif // The common part of move/copy assigning template <class Rhs> void assign_common(Rhs &&rhs) { @@ -807,7 +842,7 @@ struct expected_operations_base : expected_storage_base<T, E> { if (rhs.m_has_val) { get() = std::forward<Rhs>(rhs).get(); } else { - destroy_val(); + destroy_val(); construct_error(std::forward<Rhs>(rhs).geterr()); } } else { @@ -839,9 +874,7 @@ struct expected_operations_base : expected_storage_base<T, E> { } #endif - TL_EXPECTED_11_CONSTEXPR void destroy_val() { - get().~T(); - } + TL_EXPECTED_11_CONSTEXPR void destroy_val() { get().~T(); } }; // This base class provides some handy member functions which can be used in @@ -858,7 +891,7 @@ struct expected_operations_base<void, E> : expected_storage_base<void, E> { this->m_has_val = true; } - template <class... Args> void construct_error(Args &&... args) noexcept { + template <class... Args> void construct_error(Args &&...args) noexcept { new (std::addressof(this->m_unexpect)) unexpected<E>(std::forward<Args>(args)...); this->m_has_val = false; @@ -895,7 +928,7 @@ struct expected_operations_base<void, E> : expected_storage_base<void, E> { #endif TL_EXPECTED_11_CONSTEXPR void destroy_val() { - //no-op + // no-op } }; @@ -1220,14 +1253,17 @@ class expected : private detail::expected_move_assign_base<T, E>, "T must not be in_place_t"); static_assert(!std::is_same<T, std::remove_cv<unexpect_t>::type>::value, "T must not be unexpect_t"); - static_assert(!std::is_same<T, typename std::remove_cv<unexpected<E>>::type>::value, - "T must not be unexpected<E>"); + static_assert( + !std::is_same<T, typename std::remove_cv<unexpected<E>>::type>::value, + "T must not be unexpected<E>"); static_assert(!std::is_reference<E>::value, "E must not be a reference"); T *valptr() { return std::addressof(this->m_val); } - const T *valptr() const { return std::addressof(this->m_val); } + const T *valptr() const { return std::addressof(this->m_val); } unexpected<E> *errptr() { return std::addressof(this->m_unexpect); } - const unexpected<E> *errptr() const { return std::addressof(this->m_unexpect); } + const unexpected<E> *errptr() const { + return std::addressof(this->m_unexpect); + } template <class U = T, detail::enable_if_t<!std::is_void<U>::value> * = nullptr> @@ -1272,24 +1308,26 @@ public: #else template <class F> TL_EXPECTED_11_CONSTEXPR auto - and_then(F &&f) & -> decltype(and_then_impl(std::declval<expected&>(), std::forward<F>(f))) { + and_then(F &&f) & -> decltype(and_then_impl(std::declval<expected &>(), + std::forward<F>(f))) { return and_then_impl(*this, std::forward<F>(f)); } template <class F> - TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) && -> decltype( - and_then_impl(std::declval<expected&&>(), std::forward<F>(f))) { + TL_EXPECTED_11_CONSTEXPR auto + and_then(F &&f) && -> decltype(and_then_impl(std::declval<expected &&>(), + std::forward<F>(f))) { return and_then_impl(std::move(*this), std::forward<F>(f)); } template <class F> - constexpr auto and_then(F &&f) const & -> decltype( - and_then_impl(std::declval<expected const&>(), std::forward<F>(f))) { + constexpr auto and_then(F &&f) const & -> decltype(and_then_impl( + std::declval<expected const &>(), std::forward<F>(f))) { return and_then_impl(*this, std::forward<F>(f)); } #ifndef TL_EXPECTED_NO_CONSTRR template <class F> - constexpr auto and_then(F &&f) const && -> decltype( - and_then_impl(std::declval<expected const&&>(), std::forward<F>(f))) { + constexpr auto and_then(F &&f) const && -> decltype(and_then_impl( + std::declval<expected const &&>(), std::forward<F>(f))) { return and_then_impl(std::move(*this), std::forward<F>(f)); } #endif @@ -1297,7 +1335,7 @@ public: #if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) - template <class F> TL_EXPECTED_11_CONSTEXPR auto map(F &&f) & { + template <class F> TL_EXPECTED_11_CONSTEXPR auto map(F &&f) & { return expected_map_impl(*this, std::forward<F>(f)); } template <class F> TL_EXPECTED_11_CONSTEXPR auto map(F &&f) && { @@ -1311,14 +1349,14 @@ public: } #else template <class F> - TL_EXPECTED_11_CONSTEXPR decltype( - expected_map_impl(std::declval<expected &>(), std::declval<F &&>())) + TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl( + std::declval<expected &>(), std::declval<F &&>())) map(F &&f) & { return expected_map_impl(*this, std::forward<F>(f)); } template <class F> - TL_EXPECTED_11_CONSTEXPR decltype( - expected_map_impl(std::declval<expected>(), std::declval<F &&>())) + TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval<expected>(), + std::declval<F &&>())) map(F &&f) && { return expected_map_impl(std::move(*this), std::forward<F>(f)); } @@ -1341,7 +1379,7 @@ public: #if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) - template <class F> TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) & { + template <class F> TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) & { return expected_map_impl(*this, std::forward<F>(f)); } template <class F> TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) && { @@ -1354,15 +1392,15 @@ public: return expected_map_impl(std::move(*this), std::forward<F>(f)); } #else - template <class F> - TL_EXPECTED_11_CONSTEXPR decltype( - expected_map_impl(std::declval<expected &>(), std::declval<F &&>())) + template <class F> + TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl( + std::declval<expected &>(), std::declval<F &&>())) transform(F &&f) & { return expected_map_impl(*this, std::forward<F>(f)); } template <class F> - TL_EXPECTED_11_CONSTEXPR decltype( - expected_map_impl(std::declval<expected>(), std::declval<F &&>())) + TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval<expected>(), + std::declval<F &&>())) transform(F &&f) && { return expected_map_impl(std::move(*this), std::forward<F>(f)); } @@ -1385,54 +1423,87 @@ public: #if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) - template<class F> - TL_EXPECTED_11_CONSTEXPR auto transform_or(F &&f) & - { - return transform_or_impl(*this, std::forward<F>(f)); + template <class F> TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) & { + return map_error_impl(*this, std::forward<F>(f)); } - template<class F> - TL_EXPECTED_11_CONSTEXPR auto transform_or(F &&f) && - { - return transform_or_impl(std::move(*this), std::forward<F>(f)); + template <class F> TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) && { + return map_error_impl(std::move(*this), std::forward<F>(f)); } - template<class F> - constexpr auto transform_or(F &&f) const & - { - return transform_or_impl(*this, std::forward<F>(f)); + template <class F> constexpr auto map_error(F &&f) const & { + return map_error_impl(*this, std::forward<F>(f)); } - template<class F> - constexpr auto transform_or(F &&f) const && - { - return transform_or_impl(std::move(*this), std::forward<F>(f)); + template <class F> constexpr auto map_error(F &&f) const && { + return map_error_impl(std::move(*this), std::forward<F>(f)); } #else - template<class F> - TL_EXPECTED_11_CONSTEXPR decltype(transform_or_impl(std::declval<expected &>(), - std::declval<F &&>())) - transform_or(F &&f) & - { - return transform_or_impl(*this, std::forward<F>(f)); + template <class F> + TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &>(), + std::declval<F &&>())) + map_error(F &&f) & { + return map_error_impl(*this, std::forward<F>(f)); } - template<class F> - TL_EXPECTED_11_CONSTEXPR decltype(transform_or_impl(std::declval<expected &&>(), - std::declval<F &&>())) - transform_or(F &&f) && - { - return transform_or_impl(std::move(*this), std::forward<F>(f)); + template <class F> + TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &&>(), + std::declval<F &&>())) + map_error(F &&f) && { + return map_error_impl(std::move(*this), std::forward<F>(f)); } - template<class F> - constexpr decltype(transform_or_impl(std::declval<const expected &>(), std::declval<F &&>())) - transform_or(F &&f) const & - { - return transform_or_impl(*this, std::forward<F>(f)); + template <class F> + constexpr decltype(map_error_impl(std::declval<const expected &>(), + std::declval<F &&>())) + map_error(F &&f) const & { + return map_error_impl(*this, std::forward<F>(f)); } #ifndef TL_EXPECTED_NO_CONSTRR - template<class F> - constexpr decltype(transform_or_impl(std::declval<const expected &&>(), std::declval<F &&>())) - transform_or(F &&f) const && - { - return transform_or_impl(std::move(*this), std::forward<F>(f)); + template <class F> + constexpr decltype(map_error_impl(std::declval<const expected &&>(), + std::declval<F &&>())) + map_error(F &&f) const && { + return map_error_impl(std::move(*this), std::forward<F>(f)); + } +#endif +#endif +#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ + !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) + template <class F> TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) & { + return map_error_impl(*this, std::forward<F>(f)); + } + template <class F> TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) && { + return map_error_impl(std::move(*this), std::forward<F>(f)); + } + template <class F> constexpr auto transform_error(F &&f) const & { + return map_error_impl(*this, std::forward<F>(f)); + } + template <class F> constexpr auto transform_error(F &&f) const && { + return map_error_impl(std::move(*this), std::forward<F>(f)); + } +#else + template <class F> + TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &>(), + std::declval<F &&>())) + transform_error(F &&f) & { + return map_error_impl(*this, std::forward<F>(f)); + } + template <class F> + TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &&>(), + std::declval<F &&>())) + transform_error(F &&f) && { + return map_error_impl(std::move(*this), std::forward<F>(f)); + } + template <class F> + constexpr decltype(map_error_impl(std::declval<const expected &>(), + std::declval<F &&>())) + transform_error(F &&f) const & { + return map_error_impl(*this, std::forward<F>(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template <class F> + constexpr decltype(map_error_impl(std::declval<const expected &&>(), + std::declval<F &&>())) + transform_error(F &&f) const && { + return map_error_impl(std::move(*this), std::forward<F>(f)); } #endif #endif @@ -1462,14 +1533,14 @@ public: template <class... Args, detail::enable_if_t<std::is_constructible<T, Args &&...>::value> * = nullptr> - constexpr expected(in_place_t, Args &&... args) + constexpr expected(in_place_t, Args &&...args) : impl_base(in_place, std::forward<Args>(args)...), ctor_base(detail::default_constructor_tag{}) {} template <class U, class... Args, detail::enable_if_t<std::is_constructible< T, std::initializer_list<U> &, Args &&...>::value> * = nullptr> - constexpr expected(in_place_t, std::initializer_list<U> il, Args &&... args) + constexpr expected(in_place_t, std::initializer_list<U> il, Args &&...args) : impl_base(in_place, il, std::forward<Args>(args)...), ctor_base(detail::default_constructor_tag{}) {} @@ -1482,7 +1553,7 @@ public: : impl_base(unexpect, e.value()), ctor_base(detail::default_constructor_tag{}) {} - template < + template < class G = E, detail::enable_if_t<std::is_constructible<E, const G &>::value> * = nullptr, @@ -1500,7 +1571,7 @@ public: : impl_base(unexpect, std::move(e.value())), ctor_base(detail::default_constructor_tag{}) {} - template < + template < class G = E, detail::enable_if_t<std::is_constructible<E, G &&>::value> * = nullptr, detail::enable_if_t<std::is_convertible<G &&, E>::value> * = nullptr> @@ -1512,15 +1583,15 @@ public: template <class... Args, detail::enable_if_t<std::is_constructible<E, Args &&...>::value> * = nullptr> - constexpr explicit expected(unexpect_t, Args &&... args) + constexpr explicit expected(unexpect_t, Args &&...args) : impl_base(unexpect, std::forward<Args>(args)...), ctor_base(detail::default_constructor_tag{}) {} - template <class U, class... Args, + template <class U, class... Args, detail::enable_if_t<std::is_constructible< E, std::initializer_list<U> &, Args &&...>::value> * = nullptr> constexpr explicit expected(unexpect_t, std::initializer_list<U> il, - Args &&... args) + Args &&...args) : impl_base(unexpect, il, std::forward<Args>(args)...), ctor_base(detail::default_constructor_tag{}) {} @@ -1535,11 +1606,11 @@ public: if (rhs.has_value()) { this->construct(*rhs); } else { - this->construct_error(rhs.error()); + this->construct_error(rhs.error()); } } - template <class U, class G, + template <class U, class G, detail::enable_if_t<(std::is_convertible<U const &, T>::value && std::is_convertible<G const &, E>::value)> * = nullptr, @@ -1550,8 +1621,8 @@ public: if (rhs.has_value()) { this->construct(*rhs); } else { - this->construct_error(rhs.error()); - } + this->construct_error(rhs.error()); + } } template < @@ -1564,11 +1635,11 @@ public: if (rhs.has_value()) { this->construct(std::move(*rhs)); } else { - this->construct_error(std::move(rhs.error())); - } + this->construct_error(std::move(rhs.error())); + } } - template < + template < class U, class G, detail::enable_if_t<(std::is_convertible<U &&, T>::value && std::is_convertible<G &&, E>::value)> * = nullptr, @@ -1578,8 +1649,8 @@ public: if (rhs.has_value()) { this->construct(std::move(*rhs)); } else { - this->construct_error(std::move(rhs.error())); - } + this->construct_error(std::move(rhs.error())); + } } template < @@ -1589,7 +1660,7 @@ public: explicit TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v) : expected(in_place, std::forward<U>(v)) {} - template < + template < class U = T, detail::enable_if_t<std::is_convertible<U &&, T>::value> * = nullptr, detail::expected_enable_forward_value<T, E, U> * = nullptr> @@ -1620,7 +1691,7 @@ public: return *this; } - template < + template < class U = T, class G = T, detail::enable_if_t<!std::is_nothrow_constructible<T, U &&>::value> * = nullptr, @@ -1639,7 +1710,7 @@ public: auto tmp = std::move(err()); err().~unexpected<E>(); - #ifdef TL_EXPECTED_EXCEPTIONS_ENABLED +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED try { ::new (valptr()) T(std::forward<U>(v)); this->m_has_val = true; @@ -1647,10 +1718,10 @@ public: err() = std::move(tmp); throw; } - #else - ::new (valptr()) T(std::forward<U>(v)); - this->m_has_val = true; - #endif +#else + ::new (valptr()) T(std::forward<U>(v)); + this->m_has_val = true; +#endif } return *this; @@ -1688,26 +1759,27 @@ public: template <class... Args, detail::enable_if_t<std::is_nothrow_constructible< T, Args &&...>::value> * = nullptr> - void emplace(Args &&... args) { + void emplace(Args &&...args) { if (has_value()) { - val() = T(std::forward<Args>(args)...); + val().~T(); } else { err().~unexpected<E>(); - ::new (valptr()) T(std::forward<Args>(args)...); this->m_has_val = true; } + ::new (valptr()) T(std::forward<Args>(args)...); } - template <class... Args, detail::enable_if_t<!std::is_nothrow_constructible< + template <class... Args, detail::enable_if_t<!std::is_nothrow_constructible< T, Args &&...>::value> * = nullptr> - void emplace(Args &&... args) { + void emplace(Args &&...args) { if (has_value()) { - val() = T(std::forward<Args>(args)...); + val().~T(); + ::new (valptr()) T(std::forward<Args>(args)...); } else { auto tmp = std::move(err()); err().~unexpected<E>(); - #ifdef TL_EXPECTED_EXCEPTIONS_ENABLED +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED try { ::new (valptr()) T(std::forward<Args>(args)...); this->m_has_val = true; @@ -1715,17 +1787,17 @@ public: err() = std::move(tmp); throw; } - #else +#else ::new (valptr()) T(std::forward<Args>(args)...); this->m_has_val = true; - #endif +#endif } } template <class U, class... Args, detail::enable_if_t<std::is_nothrow_constructible< T, std::initializer_list<U> &, Args &&...>::value> * = nullptr> - void emplace(std::initializer_list<U> il, Args &&... args) { + void emplace(std::initializer_list<U> il, Args &&...args) { if (has_value()) { T t(il, std::forward<Args>(args)...); val() = std::move(t); @@ -1736,10 +1808,10 @@ public: } } - template <class U, class... Args, + template <class U, class... Args, detail::enable_if_t<!std::is_nothrow_constructible< T, std::initializer_list<U> &, Args &&...>::value> * = nullptr> - void emplace(std::initializer_list<U> il, Args &&... args) { + void emplace(std::initializer_list<U> il, Args &&...args) { if (has_value()) { T t(il, std::forward<Args>(args)...); val() = std::move(t); @@ -1747,7 +1819,7 @@ public: auto tmp = std::move(err()); err().~unexpected<E>(); - #ifdef TL_EXPECTED_EXCEPTIONS_ENABLED +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED try { ::new (valptr()) T(il, std::forward<Args>(args)...); this->m_has_val = true; @@ -1755,10 +1827,10 @@ public: err() = std::move(tmp); throw; } - #else +#else ::new (valptr()) T(il, std::forward<Args>(args)...); this->m_has_val = true; - #endif +#endif } } @@ -1770,7 +1842,7 @@ private: using e_is_nothrow_move_constructible = std::true_type; using move_constructing_e_can_throw = std::false_type; - void swap_where_both_have_value(expected &/*rhs*/ , t_is_void) noexcept { + void swap_where_both_have_value(expected & /*rhs*/, t_is_void) noexcept { // swapping void is a no-op } @@ -1828,12 +1900,12 @@ private: void swap_where_only_one_has_value_and_t_is_not_void( expected &rhs, move_constructing_t_can_throw, - t_is_nothrow_move_constructible) { + e_is_nothrow_move_constructible) { auto temp = std::move(rhs.err()); rhs.err().~unexpected_type(); #ifdef TL_EXPECTED_EXCEPTIONS_ENABLED try { - ::new (rhs.valptr()) T(val()); + ::new (rhs.valptr()) T(std::move(val())); val().~T(); ::new (errptr()) unexpected_type(std::move(temp)); std::swap(this->m_has_val, rhs.m_has_val); @@ -1842,7 +1914,7 @@ private: throw; } #else - ::new (rhs.valptr()) T(val()); + ::new (rhs.valptr()) T(std::move(val())); val().~T(); ::new (errptr()) unexpected_type(std::move(temp)); std::swap(this->m_has_val, rhs.m_has_val); @@ -1872,27 +1944,37 @@ public: } } - constexpr const T *operator->() const { return valptr(); } - TL_EXPECTED_11_CONSTEXPR T *operator->() { return valptr(); } + constexpr const T *operator->() const { + TL_ASSERT(has_value()); + return valptr(); + } + TL_EXPECTED_11_CONSTEXPR T *operator->() { + TL_ASSERT(has_value()); + return valptr(); + } template <class U = T, detail::enable_if_t<!std::is_void<U>::value> * = nullptr> constexpr const U &operator*() const & { + TL_ASSERT(has_value()); return val(); } template <class U = T, detail::enable_if_t<!std::is_void<U>::value> * = nullptr> TL_EXPECTED_11_CONSTEXPR U &operator*() & { + TL_ASSERT(has_value()); return val(); } template <class U = T, detail::enable_if_t<!std::is_void<U>::value> * = nullptr> constexpr const U &&operator*() const && { + TL_ASSERT(has_value()); return std::move(val()); } template <class U = T, detail::enable_if_t<!std::is_void<U>::value> * = nullptr> TL_EXPECTED_11_CONSTEXPR U &&operator*() && { + TL_ASSERT(has_value()); return std::move(val()); } @@ -1928,10 +2010,22 @@ public: return std::move(val()); } - constexpr const E &error() const & { return err().value(); } - TL_EXPECTED_11_CONSTEXPR E &error() & { return err().value(); } - constexpr const E &&error() const && { return std::move(err().value()); } - TL_EXPECTED_11_CONSTEXPR E &&error() && { return std::move(err().value()); } + constexpr const E &error() const & { + TL_ASSERT(!has_value()); + return err().value(); + } + TL_EXPECTED_11_CONSTEXPR E &error() & { + TL_ASSERT(!has_value()); + return err().value(); + } + constexpr const E &&error() const && { + TL_ASSERT(!has_value()); + return std::move(err().value()); + } + TL_EXPECTED_11_CONSTEXPR E &&error() && { + TL_ASSERT(!has_value()); + return std::move(err().value()); + } template <class U> constexpr T value_or(U &&v) const & { static_assert(std::is_copy_constructible<T>::value && @@ -2001,7 +2095,7 @@ constexpr auto and_then_impl(Exp &&exp, F &&f) -> Ret { #ifdef TL_EXPECTED_CXX14 template <class Exp, class F, - detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, + detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, class Ret = decltype(detail::invoke(std::declval<F>(), *std::declval<Exp>())), detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> @@ -2013,7 +2107,7 @@ constexpr auto expected_map_impl(Exp &&exp, F &&f) { } template <class Exp, class F, - detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, + detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, class Ret = decltype(detail::invoke(std::declval<F>(), *std::declval<Exp>())), detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> @@ -2038,7 +2132,7 @@ constexpr auto expected_map_impl(Exp &&exp, F &&f) { } template <class Exp, class F, - detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, + detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, class Ret = decltype(detail::invoke(std::declval<F>())), detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> auto expected_map_impl(Exp &&exp, F &&f) { @@ -2049,10 +2143,10 @@ auto expected_map_impl(Exp &&exp, F &&f) { } return result(unexpect, std::forward<Exp>(exp).error()); -} +} #else template <class Exp, class F, - detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, + detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, class Ret = decltype(detail::invoke(std::declval<F>(), *std::declval<Exp>())), detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> @@ -2067,7 +2161,7 @@ constexpr auto expected_map_impl(Exp &&exp, F &&f) } template <class Exp, class F, - detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, + detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, class Ret = decltype(detail::invoke(std::declval<F>(), *std::declval<Exp>())), detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> @@ -2082,7 +2176,7 @@ auto expected_map_impl(Exp &&exp, F &&f) -> expected<void, err_t<Exp>> { } template <class Exp, class F, - detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, + detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, class Ret = decltype(detail::invoke(std::declval<F>())), detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> @@ -2095,7 +2189,7 @@ constexpr auto expected_map_impl(Exp &&exp, F &&f) } template <class Exp, class F, - detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, + detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, class Ret = decltype(detail::invoke(std::declval<F>())), detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> @@ -2106,31 +2200,29 @@ auto expected_map_impl(Exp &&exp, F &&f) -> expected<void, err_t<Exp>> { } return unexpected<err_t<Exp>>(std::forward<Exp>(exp).error()); -} +} #endif #if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) -template<class Exp, - class F, - detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), - detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> -constexpr auto transform_or_impl(Exp &&exp, F &&f) -{ +template <class Exp, class F, + detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval<F>(), + std::declval<Exp>().error())), + detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> +constexpr auto map_error_impl(Exp &&exp, F &&f) { using result = expected<exp_t<Exp>, detail::decay_t<Ret>>; return exp.has_value() ? result(*std::forward<Exp>(exp)) : result(unexpect, detail::invoke(std::forward<F>(f), std::forward<Exp>(exp).error())); } -template<class Exp, - class F, - detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), - detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> -auto transform_or_impl(Exp &&exp, F &&f) -{ +template <class Exp, class F, + detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval<F>(), + std::declval<Exp>().error())), + detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> +auto map_error_impl(Exp &&exp, F &&f) { using result = expected<exp_t<Exp>, monostate>; if (exp.has_value()) { return result(*std::forward<Exp>(exp)); @@ -2139,26 +2231,24 @@ auto transform_or_impl(Exp &&exp, F &&f) detail::invoke(std::forward<F>(f), std::forward<Exp>(exp).error()); return result(unexpect, monostate{}); } -template<class Exp, - class F, - detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), - detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> -constexpr auto transform_or_impl(Exp &&exp, F &&f) -{ +template <class Exp, class F, + detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval<F>(), + std::declval<Exp>().error())), + detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> +constexpr auto map_error_impl(Exp &&exp, F &&f) { using result = expected<exp_t<Exp>, detail::decay_t<Ret>>; return exp.has_value() ? result() : result(unexpect, detail::invoke(std::forward<F>(f), std::forward<Exp>(exp).error())); } -template<class Exp, - class F, - detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), - detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> -auto transform_or_impl(Exp &&exp, F &&f) -{ +template <class Exp, class F, + detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval<F>(), + std::declval<Exp>().error())), + detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> +auto map_error_impl(Exp &&exp, F &&f) { using result = expected<exp_t<Exp>, monostate>; if (exp.has_value()) { return result(); @@ -2168,13 +2258,13 @@ auto transform_or_impl(Exp &&exp, F &&f) return result(unexpect, monostate{}); } #else -template<class Exp, - class F, - detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), - detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> -constexpr auto transform_or_impl(Exp &&exp, F &&f) -> expected<exp_t<Exp>, detail::decay_t<Ret>> -{ +template <class Exp, class F, + detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval<F>(), + std::declval<Exp>().error())), + detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> +constexpr auto map_error_impl(Exp &&exp, F &&f) + -> expected<exp_t<Exp>, detail::decay_t<Ret>> { using result = expected<exp_t<Exp>, detail::decay_t<Ret>>; return exp.has_value() @@ -2183,13 +2273,12 @@ constexpr auto transform_or_impl(Exp &&exp, F &&f) -> expected<exp_t<Exp>, detai std::forward<Exp>(exp).error())); } -template<class Exp, - class F, - detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), - detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> -auto transform_or_impl(Exp &&exp, F &&f) -> expected<exp_t<Exp>, monostate> -{ +template <class Exp, class F, + detail::enable_if_t<!std::is_void<exp_t<Exp>>::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval<F>(), + std::declval<Exp>().error())), + detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> +auto map_error_impl(Exp &&exp, F &&f) -> expected<exp_t<Exp>, monostate> { using result = expected<exp_t<Exp>, monostate>; if (exp.has_value()) { return result(*std::forward<Exp>(exp)); @@ -2199,13 +2288,13 @@ auto transform_or_impl(Exp &&exp, F &&f) -> expected<exp_t<Exp>, monostate> return result(unexpect, monostate{}); } -template<class Exp, - class F, - detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), - detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> -constexpr auto transform_or_impl(Exp &&exp, F &&f) -> expected<exp_t<Exp>, detail::decay_t<Ret>> -{ +template <class Exp, class F, + detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval<F>(), + std::declval<Exp>().error())), + detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> +constexpr auto map_error_impl(Exp &&exp, F &&f) + -> expected<exp_t<Exp>, detail::decay_t<Ret>> { using result = expected<exp_t<Exp>, detail::decay_t<Ret>>; return exp.has_value() @@ -2214,13 +2303,12 @@ constexpr auto transform_or_impl(Exp &&exp, F &&f) -> expected<exp_t<Exp>, detai std::forward<Exp>(exp).error())); } -template<class Exp, - class F, - detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), - detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> -auto transform_or_impl(Exp &&exp, F &&f) -> expected<exp_t<Exp>, monostate> -{ +template <class Exp, class F, + detail::enable_if_t<std::is_void<exp_t<Exp>>::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval<F>(), + std::declval<Exp>().error())), + detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> +auto map_error_impl(Exp &&exp, F &&f) -> expected<exp_t<Exp>, monostate> { using result = expected<exp_t<Exp>, monostate>; if (exp.has_value()) { return result(); @@ -2228,7 +2316,7 @@ auto transform_or_impl(Exp &&exp, F &&f) -> expected<exp_t<Exp>, monostate> detail::invoke(std::forward<F>(f), std::forward<Exp>(exp).error()); return result(unexpect, monostate{}); -} +} #endif #ifdef TL_EXPECTED_CXX14 @@ -2238,9 +2326,9 @@ template <class Exp, class F, detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> constexpr auto or_else_impl(Exp &&exp, F &&f) { static_assert(detail::is_expected<Ret>::value, "F must return an expected"); - return exp.has_value() - ? std::forward<Exp>(exp) - : detail::invoke(std::forward<F>(f), std::forward<Exp>(exp).error()); + return exp.has_value() ? std::forward<Exp>(exp) + : detail::invoke(std::forward<F>(f), + std::forward<Exp>(exp).error()); } template <class Exp, class F, @@ -2248,44 +2336,36 @@ template <class Exp, class F, std::declval<Exp>().error())), detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> detail::decay_t<Exp> or_else_impl(Exp &&exp, F &&f) { - return exp.has_value() - ? std::forward<Exp>(exp) - : (detail::invoke(std::forward<F>(f), std::forward<Exp>(exp).error()), - std::forward<Exp>(exp)); + return exp.has_value() ? std::forward<Exp>(exp) + : (detail::invoke(std::forward<F>(f), + std::forward<Exp>(exp).error()), + std::forward<Exp>(exp)); } #else template <class Exp, class F, class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), - detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> + detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr> auto or_else_impl(Exp &&exp, F &&f) -> Ret { static_assert(detail::is_expected<Ret>::value, "F must return an expected"); - return exp.has_value() - ? std::forward<Exp>(exp) - : detail::invoke(std::forward<F>(f), std::forward<Exp>(exp).error()); + return exp.has_value() ? std::forward<Exp>(exp) + : detail::invoke(std::forward<F>(f), + std::forward<Exp>(exp).error()); } template <class Exp, class F, class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), - detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> + detail::enable_if_t<std::is_void<Ret>::value> * = nullptr> detail::decay_t<Exp> or_else_impl(Exp &&exp, F &&f) { - return exp.has_value() - ? std::forward<Exp>(exp) - : (detail::invoke(std::forward<F>(f), std::forward<Exp>(exp).error()), - std::forward<Exp>(exp)); + return exp.has_value() ? std::forward<Exp>(exp) + : (detail::invoke(std::forward<F>(f), + std::forward<Exp>(exp).error()), + std::forward<Exp>(exp)); } #endif } // namespace detail -template <class E, class F> -constexpr bool operator==(const expected<void, E> &lhs, - const expected<void, F> &rhs) { - return (lhs.has_value() != rhs.has_value()) - ? false - : (!lhs.has_value() ? lhs.error() == rhs.error() : true); -} - template <class T, class E, class U, class F> constexpr bool operator==(const expected<T, E> &lhs, const expected<U, F> &rhs) { @@ -2300,12 +2380,19 @@ constexpr bool operator!=(const expected<T, E> &lhs, ? true : (!lhs.has_value() ? lhs.error() != rhs.error() : *lhs != *rhs); } -template<class E, class F> -constexpr bool operator!=(const expected<void, E> &lhs, const expected<void, F> &rhs) -{ - return (lhs.has_value() != rhs.has_value()) - ? true - : (!lhs.has_value() ? lhs.error() != rhs.error() : false); +template <class E, class F> +constexpr bool operator==(const expected<void, E> &lhs, + const expected<void, F> &rhs) { + return (lhs.has_value() != rhs.has_value()) + ? false + : (!lhs.has_value() ? lhs.error() == rhs.error() : true); +} +template <class E, class F> +constexpr bool operator!=(const expected<void, E> &lhs, + const expected<void, F> &rhs) { + return (lhs.has_value() != rhs.has_value()) + ? true + : (!lhs.has_value() ? lhs.error() == rhs.error() : false); } template <class T, class E, class U> diff --git a/tests/auto/utils/expected/tst_expected.cpp b/tests/auto/utils/expected/tst_expected.cpp index 25240b861a7..ae084036bdc 100644 --- a/tests/auto/utils/expected/tst_expected.cpp +++ b/tests/auto/utils/expected/tst_expected.cpp @@ -26,7 +26,7 @@ private slots: return expected_str<QByteArray>( make_unexpected(QString("Error: " + error))); }) - .transform_or([](auto error) -> QString { + .transform_error([](auto error) -> QString { return QString(QString("More Info: ") + error); }); From 8a72318c971cf4abc8ef187b7b200414d6bb1759 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 18 Sep 2023 13:36:39 +0200 Subject: [PATCH 1161/1777] OutputPane: Fix wrongly checked button with "Reset to Default" We only want to set the button "checked" if the Output panes are visible. Amends b72f9dc8ef96d2a39a141d5814fc1ecefcd2a231 Change-Id: Ia6fd461338086e141dac09ebf47de09c0635b28b Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/coreplugin/outputpanemanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index 4d8021acfb1..9ccbea0a0cc 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -789,7 +789,8 @@ void OutputPaneManager::popupMenu() for (int i = 0; i < g_outputPanes.size(); ++i) { OutputPaneData &data = g_outputPanes[i]; const bool buttonVisible = data.pane->priorityInStatusBar() >= 0; - const bool paneVisible = currentIndex() == i; + const bool paneVisible = currentIndex() == i + && OutputPanePlaceHolder::isCurrentVisible(); if (buttonVisible) { data.button->setChecked(paneVisible); data.button->setVisible(true); From ea47e6cbd7f799fbeb966ee3fd7af8408e325a7a Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 18 Sep 2023 12:13:50 +0200 Subject: [PATCH 1162/1777] OutputPane: Show "manage" menu as context menu for the buttons too Simply makes sense. Change-Id: I2f68b0bfdea66185c0c70d8e888fe0965276a7ab Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/coreplugin/outputpanemanager.cpp | 15 ++++++++++++++- src/plugins/coreplugin/outputpanemanager.h | 12 +++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index 9ccbea0a0cc..cac44faf6fd 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -533,6 +533,9 @@ void OutputPaneManager::initialize() outPane->displayName(), cmd->action()); data.button = button; + connect(button, &OutputPaneToggleButton::contextMenuRequested, m_instance, [] { + m_instance->popupMenu(); + }); connect(outPane, &IOutputPane::flashButton, button, [button] { button->flash(); }); connect(outPane, @@ -562,7 +565,7 @@ void OutputPaneManager::initialize() m_instance->m_titleLabel->setText(g_outputPanes[currentIdx].pane->displayName()); m_instance->m_buttonsWidget->layout()->addWidget(m_instance->m_manageButton); connect(m_instance->m_manageButton, - &QAbstractButton::clicked, + &OutputPaneManageButton::menuRequested, m_instance, &OutputPaneManager::popupMenu); @@ -1004,6 +1007,10 @@ bool OutputPaneToggleButton::isPaneVisible() const return isVisibleTo(parentWidget()); } +void OutputPaneToggleButton::contextMenuEvent(QContextMenuEvent *) +{ + emit contextMenuRequested(); +} /////////////////////////////////////////////////////////////////////// // @@ -1016,6 +1023,7 @@ OutputPaneManageButton::OutputPaneManageButton() setFocusPolicy(Qt::NoFocus); setCheckable(true); setFixedWidth(StyleHelper::toolbarStyle() == Utils::StyleHelper::ToolbarStyleCompact ? 17 : 21); + connect(this, &QToolButton::clicked, this, &OutputPaneManageButton::menuRequested); } void OutputPaneManageButton::paintEvent(QPaintEvent*) @@ -1037,6 +1045,11 @@ void OutputPaneManageButton::paintEvent(QPaintEvent*) s->drawPrimitive(QStyle::PE_IndicatorArrowDown, &arrowOpt, &p, this); } +void OutputPaneManageButton::contextMenuEvent(QContextMenuEvent *) +{ + emit menuRequested(); +} + BadgeLabel::BadgeLabel() { m_font = QApplication::font(); diff --git a/src/plugins/coreplugin/outputpanemanager.h b/src/plugins/coreplugin/outputpanemanager.h index f3e62d026f0..49b161f35fc 100644 --- a/src/plugins/coreplugin/outputpanemanager.h +++ b/src/plugins/coreplugin/outputpanemanager.h @@ -108,6 +108,11 @@ public: void setIconBadgeNumber(int number); bool isPaneVisible() const; + void contextMenuEvent(QContextMenuEvent *e) override; + +signals: + void contextMenuRequested(); + private: void updateToolTip(); void checkStateSet() override; @@ -124,7 +129,12 @@ class OutputPaneManageButton : public QToolButton Q_OBJECT public: OutputPaneManageButton(); - void paintEvent(QPaintEvent*) override; + void paintEvent(QPaintEvent *) override; + + void contextMenuEvent(QContextMenuEvent *e) override; + +signals: + void menuRequested(); }; } // namespace Internal From ef00a7e28b329b62452055b610fb7df978fa6345 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 19 Sep 2023 14:28:18 +0200 Subject: [PATCH 1163/1777] ProjectExplorer: Allow more entries in the MiniProjectTargetSelector Make the maximum height dependent on the total window height, rather than the height of the action bar. Fixes: QTCREATORBUG-29580 Change-Id: Id2bd568febbb3e16cea05d9d54834a9c0b309ea1 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/projectexplorer/miniprojecttargetselector.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 86075f51f90..3fa03df9583 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -920,13 +920,12 @@ void MiniProjectTargetSelector::doLayout(bool keepSize) if (keepSize) { heightWithoutKitArea = height() - oldSummaryLabelY + 1; } else { - // Clamp the size of the listwidgets to be - // at least as high as the sidebar button - // and at most twice as high + // Clamp the size of the listwidgets to be at least as high as the sidebar button + // and at most half the height of the entire Qt Creator window. heightWithoutKitArea = summaryLabelHeight + qBound(alignedWithActionHeight, maxItemCount * 30 + bottomMargin + titleWidgetsHeight, - alignedWithActionHeight * 2); + Core::ICore::mainWindow()->height() / 2); } int titleY = summaryLabelY + summaryLabelHeight; From a217fa0c223946fbf44592e0e57ce8d68faa8378 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 18 Sep 2023 16:25:12 +0200 Subject: [PATCH 1164/1777] qbs build: Clean up testing infrastructure - Rename ambiguously named "testsEnabled" property to "withPluginTests" and fix the wrong uses. - Move AutotestRunner out of main project file and into tests.qbs. - Move "withAutotests" property into qtc module. We cannot remove it from the main project file just yet, because some manual tests do not make use of QtcManualTest at the moment. - Do not remove the autotests from the project tree if autotests are disabled. Instead, just disable the products. Change-Id: I74a4cc717d9adbe53d37536b2565111e1617115b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- qbs/imports/QtcAutotest.qbs | 2 ++ qbs/imports/QtcManualtest.qbs | 1 + qbs/imports/QtcPlugin.qbs | 2 +- qbs/imports/QtcTestFiles.qbs | 2 +- qbs/modules/qtc/qtc.qbs | 7 ++-- qtcreator.qbs | 34 +------------------ src/libs/extensionsystem/extensionsystem.qbs | 2 +- src/libs/tracing/tracing.qbs | 2 +- src/plugins/autotest/autotest.qbs | 14 ++------ src/plugins/clangcodemodel/clangcodemodel.qbs | 2 +- src/plugins/clangtools/clangtools.qbs | 2 +- src/plugins/cppeditor/cppeditor.qbs | 4 +-- src/plugins/languageclient/languageclient.qbs | 5 +-- src/plugins/mcusupport/mcusupport.qbs | 8 ++--- .../mesonprojectmanager.qbs | 4 --- .../projectexplorer/projectexplorer.qbs | 4 +-- src/plugins/vcsbase/vcsbase.qbs | 2 +- src/tools/sdktool/sdktool.qbs | 3 -- src/tools/sdktool/sdktoollib.qbs | 6 ++-- tests/auto/auto.qbs | 1 - tests/manual/debugger/simple/simple.qbs | 5 --- .../debugger/simple/simple_test_app.qbs | 1 + .../debugger/simple/simple_test_plugin.qbs | 1 + tests/manual/manual.qbs | 4 +-- tests/manual/widgets/widgets.qbs | 4 --- tests/tests.qbs | 30 +++++++++++++++- 26 files changed, 61 insertions(+), 91 deletions(-) diff --git a/qbs/imports/QtcAutotest.qbs b/qbs/imports/QtcAutotest.qbs index 523f1cdbfd7..3d1f3a50ec6 100644 --- a/qbs/imports/QtcAutotest.qbs +++ b/qbs/imports/QtcAutotest.qbs @@ -2,6 +2,8 @@ import qbs import qbs.FileInfo QtcProduct { + condition: qtc.withAutotests + // This needs to be absolute, because it is passed to one of the source files. destinationDirectory: project.buildDirectory + '/' + FileInfo.relativePath(project.ide_source_tree, sourceDirectory) diff --git a/qbs/imports/QtcManualtest.qbs b/qbs/imports/QtcManualtest.qbs index 0c47bf1c8fa..7a388b81366 100644 --- a/qbs/imports/QtcManualtest.qbs +++ b/qbs/imports/QtcManualtest.qbs @@ -1,6 +1,7 @@ import qbs.FileInfo QtcProduct { + condition: qtc.withAutotests destinationDirectory: project.buildDirectory + '/' + FileInfo.relativePath(project.ide_source_tree, sourceDirectory) targetName: "tst_" + name.split(' ').join("") diff --git a/qbs/imports/QtcPlugin.qbs b/qbs/imports/QtcPlugin.qbs index 8c26050328f..d06f99385e4 100644 --- a/qbs/imports/QtcPlugin.qbs +++ b/qbs/imports/QtcPlugin.qbs @@ -14,7 +14,7 @@ QtcProduct { property stringList pluginRecommends: [] property stringList pluginTestDepends: [] - Depends { name: "Qt.testlib"; condition: qtc.testsEnabled } + Depends { name: "Qt.testlib"; condition: qtc.withPluginTests } Depends { name: "ExtensionSystem" } Depends { name: "pluginjson" } diff --git a/qbs/imports/QtcTestFiles.qbs b/qbs/imports/QtcTestFiles.qbs index e1be695dac0..0dbf377e1f9 100644 --- a/qbs/imports/QtcTestFiles.qbs +++ b/qbs/imports/QtcTestFiles.qbs @@ -1,4 +1,4 @@ Group { name: "Unit tests" - condition: qtc.testsEnabled + condition: qtc.withPluginTests } diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 73b26adf9e5..eca67fc9d55 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -72,7 +72,10 @@ Module { property bool preferSystemSyntaxHighlighting: true - property bool testsEnabled: Environment.getEnv("TEST") || qbs.buildVariant === "debug" + property bool withPluginTests: Environment.getEnv("TEST") || qbs.buildVariant === "debug" + property bool testsEnabled: withPluginTests // TODO: compat, remove + property bool withAutotests: project.withAutotests // FIXME: withPluginTests + property stringList generalDefines: [ "QT_CREATOR", 'IDE_LIBRARY_BASENAME="' + libDirName + '"', @@ -88,6 +91,6 @@ Module { "QT_NO_FOREACH", "QT_DISABLE_DEPRECATED_BEFORE=0x050900", "QT_USE_QSTRINGBUILDER", - ].concat(testsEnabled ? ["WITH_TESTS"] : []) + ].concat(withPluginTests ? ["WITH_TESTS"] : []) .concat(qbs.toolchain.contains("msvc") ? ["_CRT_SECURE_NO_WARNINGS"] : []) } diff --git a/qtcreator.qbs b/qtcreator.qbs index f542f5c5fb5..daa8427b0ef 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -1,11 +1,7 @@ -import qbs 1.0 -import qbs.Environment -import qbs.FileInfo - Project { name: "Qt Creator" minimumQbsVersion: "2.0.0" - property bool withAutotests: qbs.buildVariant === "debug" + property bool withAutotests: qbs.buildVariant === "debug" // FIXME: Remove property path ide_source_tree: path property pathList additionalPlugins: [] property pathList additionalLibs: [] @@ -37,32 +33,4 @@ Project { return list; } } - - AutotestRunner { - Depends { name: "Qt.core" } - Depends { name: "qtc" } - environment: { - var env = base; - if (!qbs.hostOS.contains("windows") || !qbs.targetOS.contains("windows")) - return env; - var path = ""; - for (var i = 0; i < env.length; ++i) { - if (env[i].startsWith("PATH=")) { - path = env[i].substring(5); - break; - } - } - var fullQtcInstallDir = FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix); - var fullLibInstallDir = FileInfo.joinPaths(fullQtcInstallDir, qtc.ide_library_path); - var fullPluginInstallDir = FileInfo.joinPaths(fullQtcInstallDir, qtc.ide_plugin_path); - path = Qt.core.binPath + ";" + fullLibInstallDir + ";" + fullPluginInstallDir - + ";" + path; - var arrayElem = "PATH=" + path; - if (i < env.length) - env[i] = arrayElem; - else - env.push(arrayElem); - return env; - } - } } diff --git a/src/libs/extensionsystem/extensionsystem.qbs b/src/libs/extensionsystem/extensionsystem.qbs index 07fc87fd286..8748c27ba69 100644 --- a/src/libs/extensionsystem/extensionsystem.qbs +++ b/src/libs/extensionsystem/extensionsystem.qbs @@ -4,7 +4,7 @@ QtcLibrary { cpp.defines: base.concat(["EXTENSIONSYSTEM_LIBRARY", "IDE_TEST_DIR=\".\""]) Depends { name: "Qt"; submodules: ["core", "widgets"] } - Depends { name: "Qt.testlib"; condition: qtc.testsEnabled } + Depends { name: "Qt.testlib"; condition: qtc.withPluginTests } Depends { name: "Aggregation" } Depends { name: "Utils" } diff --git a/src/libs/tracing/tracing.qbs b/src/libs/tracing/tracing.qbs index d044800f846..6876dccd256 100644 --- a/src/libs/tracing/tracing.qbs +++ b/src/libs/tracing/tracing.qbs @@ -2,7 +2,7 @@ QtcLibrary { name: "Tracing" Depends { name: "Qt"; submodules: ["qml", "quick", "gui"] } - Depends { name: "Qt.testlib"; condition: project.withAutotests } + Depends { name: "Qt.testlib"; condition: qtc.withAutotests } Depends { name: "Utils" } Group { diff --git a/src/plugins/autotest/autotest.qbs b/src/plugins/autotest/autotest.qbs index 90f1728c4ae..9e9625006b6 100644 --- a/src/plugins/autotest/autotest.qbs +++ b/src/plugins/autotest/autotest.qbs @@ -1,5 +1,3 @@ -import qbs - QtcPlugin { name: "AutoTest" @@ -18,16 +16,8 @@ QtcPlugin { "QmakeProjectManager" ] - Depends { - name: "QtSupport" - condition: qtc.testsEnabled - } - - Depends { - name: "Qt.testlib" - condition: qtc.testsEnabled - } - + Depends { name: "QtSupport"; condition: qtc.withPluginTests } + Depends { name: "Qt.testlib"; condition: qtc.withPluginTests } Depends { name: "Qt.widgets" } files: [ diff --git a/src/plugins/clangcodemodel/clangcodemodel.qbs b/src/plugins/clangcodemodel/clangcodemodel.qbs index 903a81147a9..16e4d00035e 100644 --- a/src/plugins/clangcodemodel/clangcodemodel.qbs +++ b/src/plugins/clangcodemodel/clangcodemodel.qbs @@ -10,7 +10,7 @@ QtcPlugin { Depends { name: "CppEditor" } Depends { name: "LanguageClient" } Depends { name: "ProjectExplorer" } - Depends { name: "QtSupport"; condition: qtc.testsEnabled } + Depends { name: "QtSupport"; condition: qtc.withPluginTests } Depends { name: "TextEditor" } Depends { name: "Utils" } diff --git a/src/plugins/clangtools/clangtools.qbs b/src/plugins/clangtools/clangtools.qbs index 5aba1655197..6afa5d026b1 100644 --- a/src/plugins/clangtools/clangtools.qbs +++ b/src/plugins/clangtools/clangtools.qbs @@ -8,7 +8,7 @@ QtcPlugin { Depends { name: "CppEditor" } Depends { name: "Debugger" } Depends { name: "ProjectExplorer" } - Depends { name: "QtSupport"; condition: qtc.testsEnabled } + Depends { name: "QtSupport"; condition: qtc.withPluginTests } Depends { name: "TextEditor" } Depends { name: "Utils" } diff --git a/src/plugins/cppeditor/cppeditor.qbs b/src/plugins/cppeditor/cppeditor.qbs index 2c0ff18dc30..160fd70aee2 100644 --- a/src/plugins/cppeditor/cppeditor.qbs +++ b/src/plugins/cppeditor/cppeditor.qbs @@ -4,7 +4,7 @@ QtcPlugin { name: "CppEditor" Depends { name: "Qt.widgets" } - Depends { condition: project.withAutotests; name: "Qt.testlib" } + Depends { condition: project.withPluginTests; name: "Qt.testlib" } Depends { name: "CPlusPlus" } Depends { name: "Utils" } @@ -233,7 +233,7 @@ QtcPlugin { Group { name: "TestCase" - condition: qtc.testsEnabled || project.withAutotests + condition: qtc.withPluginTests || qtc.withAutotests files: [ "cpptoolstestcase.cpp", "cpptoolstestcase.h", diff --git a/src/plugins/languageclient/languageclient.qbs b/src/plugins/languageclient/languageclient.qbs index bfb29ded282..7f1899927fe 100644 --- a/src/plugins/languageclient/languageclient.qbs +++ b/src/plugins/languageclient/languageclient.qbs @@ -5,10 +5,7 @@ QtcPlugin { name: "LanguageClient" Depends { name: "Qt.core" } - Depends { - name: "Qt.testlib" - condition: qtc.testsEnabled - } + Depends { name: "Qt.testlib"; condition: qtc.withPluginTests } Depends { name: "Utils" } Depends { name: "ProjectExplorer" } diff --git a/src/plugins/mcusupport/mcusupport.qbs b/src/plugins/mcusupport/mcusupport.qbs index 96fea109d75..b14c6a90a23 100644 --- a/src/plugins/mcusupport/mcusupport.qbs +++ b/src/plugins/mcusupport/mcusupport.qbs @@ -5,7 +5,7 @@ QtcPlugin { Depends { name: "Qt.core" } Depends { name: "Qt.widgets" } - Depends { name: "Qt.testlib"; condition: qtc.testsEnabled } + Depends { name: "Qt.testlib"; condition: qtc.withPluginTests } Depends { name: "Utils" } Depends { name: "Core" } @@ -16,7 +16,7 @@ QtcPlugin { Depends { name: "QmlJS" } Depends { name: "QtSupport" } - Depends { name: "qtc_gtest_gmock"; condition: qtc.testsEnabled; required: false } + Depends { name: "qtc_gtest_gmock"; condition: qtc.withPluginTests; required: false } files: [ "mcuabstractpackage.h", @@ -65,7 +65,7 @@ QtcPlugin { ] QtcTestFiles { - condition: qtc.testsEnabled && (qtc_gtest_gmock.hasRepo || qtc_gtest_gmock.externalLibsPresent) + condition: qtc.withPluginTests && (qtc_gtest_gmock.hasRepo || qtc_gtest_gmock.externalLibsPresent) prefix: "test/" files: [ "packagemock.h", @@ -75,7 +75,7 @@ QtcPlugin { } Properties { - condition: qtc.testsEnabled && (qtc_gtest_gmock.hasRepo || qtc_gtest_gmock.externalLibsPresent) + condition: qtc.withPluginTests && (qtc_gtest_gmock.hasRepo || qtc_gtest_gmock.externalLibsPresent) cpp.defines: base.concat(["GOOGLE_TEST_IS_FOUND"]) cpp.includePaths: base.concat([ "." ]) } diff --git a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs index c977f8b8283..9167f025b20 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs +++ b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs @@ -95,7 +95,6 @@ Project { QtcAutotest { name: "mesonwrapper" - condition: project.withAutotests Depends { name: "Core" } Depends { name: "Utils" } @@ -116,7 +115,6 @@ Project { QtcAutotest { name: "mesoninfoparser" - condition: project.withAutotests Depends { name: "Core" } Depends { name: "Utils" } @@ -138,7 +136,6 @@ Project { QtcAutotest { name: "ninjaparser" - condition: project.withAutotests Depends { name: "Core" } Depends { name: "ProjectExplorer" } @@ -156,7 +153,6 @@ Project { QtcAutotest { name: "mesonparser" - condition: project.withAutotests Depends { name: "Core" } Depends { name: "ProjectExplorer" } diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 5f24d9f12da..8f5e7e75f57 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -231,7 +231,7 @@ QtcPlugin { Group { name: "WindowsToolChains" - condition: qbs.targetOS.contains("windows") || qtc.testsEnabled + condition: qbs.targetOS.contains("windows") || qtc.withPluginTests files: [ "msvctoolchain.cpp", "msvctoolchain.h", @@ -244,7 +244,7 @@ QtcPlugin { Group { name: "Test resources" - condition: qtc.testsEnabled + condition: qtc.withPluginTests files: ["testdata/**"] fileTags: ["qt.core.resource_data"] Qt.core.resourcePrefix: "/projectexplorer" diff --git a/src/plugins/vcsbase/vcsbase.qbs b/src/plugins/vcsbase/vcsbase.qbs index 0c2f08abd58..7cf0a8fe487 100644 --- a/src/plugins/vcsbase/vcsbase.qbs +++ b/src/plugins/vcsbase/vcsbase.qbs @@ -75,5 +75,5 @@ QtcPlugin { "wizard/vcsjsextension.h", ] - cpp.defines: base.concat(qtc.testsEnabled ? ['SRC_DIR="' + project.ide_source_tree + '"'] : []) + cpp.defines: base.concat(qtc.withPluginTests ? ['SRC_DIR="' + project.ide_source_tree + '"'] : []) } diff --git a/src/tools/sdktool/sdktool.qbs b/src/tools/sdktool/sdktool.qbs index a1da4f5df3e..268b6db40c2 100644 --- a/src/tools/sdktool/sdktool.qbs +++ b/src/tools/sdktool/sdktool.qbs @@ -1,11 +1,8 @@ -import qbs 1.0 - QtcTool { name: "sdktool" Depends { name: "Qt.core" } Depends { name: "app_version_header" } - Depends { name: "Qt.testlib"; condition: project.withAutotests } Depends { name: "sdktoolLib" } cpp.defines: base.concat([ diff --git a/src/tools/sdktool/sdktoollib.qbs b/src/tools/sdktool/sdktoollib.qbs index 17028776e40..d179a2eaa87 100644 --- a/src/tools/sdktool/sdktoollib.qbs +++ b/src/tools/sdktool/sdktoollib.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - QtcLibrary { name: "sdktoolLib" @@ -7,7 +5,7 @@ QtcLibrary { Depends { name: "Qt.core" } Depends { name: "app_version_header" } - Depends { name: "Qt.testlib"; condition: project.withAutotests } + Depends { name: "Qt.testlib"; condition: qtc.withPluginTests } property string libsDir: path + "/../../libs" @@ -19,7 +17,7 @@ QtcLibrary { ? 'DATA_PATH="."' : qbs.targetOS.contains("windows") ? 'DATA_PATH="../share/qtcreator"' : 'DATA_PATH="../../share/qtcreator"'); - if (project.withAutotests) + if (qtc.withPluginTests) defines.push("WITH_TESTS"); return defines; } diff --git a/tests/auto/auto.qbs b/tests/auto/auto.qbs index a21b61fc0cd..4df8e3118f3 100644 --- a/tests/auto/auto.qbs +++ b/tests/auto/auto.qbs @@ -2,7 +2,6 @@ import qbs Project { name: "QtcAutotests" - condition: project.withAutotests references: [ "aggregation/aggregation.qbs", "algorithm/algorithm.qbs", diff --git a/tests/manual/debugger/simple/simple.qbs b/tests/manual/debugger/simple/simple.qbs index c05ef68ac8a..9f2b2c03e8b 100644 --- a/tests/manual/debugger/simple/simple.qbs +++ b/tests/manual/debugger/simple/simple.qbs @@ -1,11 +1,6 @@ -import qbs -import qbs.FileInfo - Project { name: "Manual debugger simple tests" - condition: project.withAutotests - references: [ "simple_test_app.qbs", "simple_test_plugin.qbs" diff --git a/tests/manual/debugger/simple/simple_test_app.qbs b/tests/manual/debugger/simple/simple_test_app.qbs index ca2c56229e4..e6b19d8bcf8 100644 --- a/tests/manual/debugger/simple/simple_test_app.qbs +++ b/tests/manual/debugger/simple/simple_test_app.qbs @@ -2,6 +2,7 @@ import qbs.File import qbs.FileInfo CppApplication { + condition: qtc.withAutotests name: "Manual Test Simple Application" targetName: "simple_test_app" diff --git a/tests/manual/debugger/simple/simple_test_plugin.qbs b/tests/manual/debugger/simple/simple_test_plugin.qbs index eca6791c02c..c06bc83112b 100644 --- a/tests/manual/debugger/simple/simple_test_plugin.qbs +++ b/tests/manual/debugger/simple/simple_test_plugin.qbs @@ -1,6 +1,7 @@ import qbs.FileInfo DynamicLibrary { + condition: qtc.withAutotests name: "Manual Test Simple Plugin" targetName: "simple_test_plugin" diff --git a/tests/manual/manual.qbs b/tests/manual/manual.qbs index ecf0a6d2f87..b8a37c9356e 100644 --- a/tests/manual/manual.qbs +++ b/tests/manual/manual.qbs @@ -1,9 +1,7 @@ -import qbs - Project { name: "QtcManualtests" - condition: project.withAutotests + condition: project.withAutotests // FIXME: Why are these not QtcManualTests? references: [ "debugger/gui/gui.qbs", diff --git a/tests/manual/widgets/widgets.qbs b/tests/manual/widgets/widgets.qbs index 518ea823b1b..d6b6cd633b1 100644 --- a/tests/manual/widgets/widgets.qbs +++ b/tests/manual/widgets/widgets.qbs @@ -1,10 +1,6 @@ -import qbs - Project { name: "Widgets manualtests" - condition: project.withAutotests - references: [ "crumblepath/crumblepath.qbs", "infolabel/infolabel.qbs", diff --git a/tests/tests.qbs b/tests/tests.qbs index fc634c93d08..7605c427366 100644 --- a/tests/tests.qbs +++ b/tests/tests.qbs @@ -1,4 +1,4 @@ -import qbs +import qbs.FileInfo Project { name: "Tests" @@ -8,4 +8,32 @@ Project { "tools/qml-ast2dot/qml-ast2dot.qbs", "unit/unit.qbs", ] + + AutotestRunner { + Depends { name: "Qt.core" } + Depends { name: "qtc" } + environment: { + var env = base; + if (!qbs.hostOS.contains("windows") || !qbs.targetOS.contains("windows")) + return env; + var path = ""; + for (var i = 0; i < env.length; ++i) { + if (env[i].startsWith("PATH=")) { + path = env[i].substring(5); + break; + } + } + var fullQtcInstallDir = FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix); + var fullLibInstallDir = FileInfo.joinPaths(fullQtcInstallDir, qtc.ide_library_path); + var fullPluginInstallDir = FileInfo.joinPaths(fullQtcInstallDir, qtc.ide_plugin_path); + path = Qt.core.binPath + ";" + fullLibInstallDir + ";" + fullPluginInstallDir + + ";" + path; + var arrayElem = "PATH=" + path; + if (i < env.length) + env[i] = arrayElem; + else + env.push(arrayElem); + return env; + } + } } From 9ab6c7186d4486f6b8594c01d1aba38efd0bab50 Mon Sep 17 00:00:00 2001 From: Tim Jenssen <tim.jenssen@qt.io> Date: Tue, 19 Sep 2023 12:50:04 +0200 Subject: [PATCH 1165/1777] fix transientscroll.cpp compile against older Qt (tested 6.2.9) Change-Id: I417aa1e0ef7c00181e85d8250e04b12ff6a24512 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/transientscroll.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/transientscroll.cpp b/src/libs/utils/transientscroll.cpp index 3a0a9153769..65d082ffca8 100644 --- a/src/libs/utils/transientscroll.cpp +++ b/src/libs/utils/transientscroll.cpp @@ -517,7 +517,7 @@ void GlobalTransientSupport::support(QWidget *widget) if (area) TransientScrollAreaSupport::support(area); - for (QWidget *childWidget : widget->findChildren<QWidget *>(Qt::FindChildOption::FindDirectChildrenOnly)) + for (QWidget *childWidget : widget->findChildren<QWidget *>(QString(), Qt::FindChildOption::FindDirectChildrenOnly)) support(childWidget); } From 52e3ab52726d4d264f1a5e0a745b094da79c3d56 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 19 Sep 2023 17:22:19 +0200 Subject: [PATCH 1166/1777] CMakePM: code completion changes for cmake_print_variables|properties They are CMake module functions and need only certain parameters. Change-Id: I6e49359470cd228fec985fca2297a50d44c76ded Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakefilecompletionassist.cpp | 15 ++++++++------- src/plugins/cmakeprojectmanager/cmaketool.cpp | 6 ++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index cdad2183487..b50d3128363 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -62,7 +62,7 @@ CMakeFileCompletionAssist::CMakeFileCompletionAssist() ProjectExplorer::DirectoryIcon(ProjectExplorer::Constants::FILEOVERLAY_MODULES).icon()) , m_targetsIcon(ProjectExplorer::Icons::BUILD.icon()) , m_snippetCollector(Constants::CMAKE_SNIPPETS_GROUP_ID, - CodeModelIcon::iconForType(CodeModelIcon::Keyword)) + FileIconProvider::icon(FilePath::fromString("CMakeLists.txt"))) {} @@ -257,7 +257,8 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() const auto onlyFileItems = [&] { return fileStartPos != startPos; }; if (functionName == "if" || functionName == "elseif" || functionName == "while" - || functionName == "set" || functionName == "list") { + || functionName == "set" || functionName == "list" + || functionName == "cmake_print_variables") { items.append(generateList(keywords.variables, m_variableIcon)); items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); } @@ -270,7 +271,7 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() fileStartPos = addFilePathItems(interface(), items, startPos); } - if (functionName == "set_property") + if (functionName == "set_property" || functionName == "cmake_print_properties") items.append(generateList(keywords.properties, m_propertyIcon)); if (functionName == "set_directory_properties") @@ -289,7 +290,7 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() if ((functionName.contains("target") || functionName == "install" || functionName == "add_dependencies" || functionName == "set_property" - || functionName == "export") + || functionName == "export" || functionName == "cmake_print_properties") && !onlyFileItems()) items.append(generateList(buildTargets, m_targetsIcon)); @@ -300,6 +301,9 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() // On a new line we just want functions items.append(generateList(keywords.functions, m_functionIcon)); items.append(generateList(projectKeywords.functions, m_projectFunctionIcon)); + + // Snippets would make more sense only for the top level suggestions + items.append(m_snippetCollector.collect()); } else { // Inside an unknown function we could have variables or properties fileStartPos = addFilePathItems(interface(), items, startPos); @@ -311,9 +315,6 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() } } - if (!onlyFileItems()) - items.append(m_snippetCollector.collect()); - return new GenericProposal(startPos, items); } diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 46d88dc932e..65068e74ee2 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -598,6 +598,12 @@ void CMakeTool::parseSyntaxHighlightingXml() m_introspection->m_functionArgs[pair.first] = m_introspection->m_functionArgs.value( pair.second); } + + // Special case for cmake_print_variables, which will print the names and values for variables + // and needs to be as a known function + const QString cmakePrintVariables("cmake_print_variables"); + m_introspection->m_functionArgs[cmakePrintVariables] = {}; + m_introspection->m_functions.append(cmakePrintVariables); } void CMakeTool::fetchFromCapabilities(bool ignoreCache) const From 3f4ed3e890476db2df5e2f55f75fdd1432aab737 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 19 Sep 2023 14:06:24 +0200 Subject: [PATCH 1167/1777] ScreenRecorder: Make crop selection movable Change-Id: I95a6227c268bfeb7e0ea57a02c6cfd86fe99361b Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/screenrecorder/cropandtrim.cpp | 45 +++++++++++++++------- src/plugins/screenrecorder/cropandtrim.h | 8 ++-- src/plugins/screenrecorder/record.cpp | 1 + 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp index 6df5ce02807..a0bccbd23b0 100644 --- a/src/plugins/screenrecorder/cropandtrim.cpp +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -59,24 +59,26 @@ void CropScene::initMouseInteraction(const QPoint &imagePos) return inRange; }; - if (inGripRange(imagePos.x(), m_cropRect.left(), m_mouse.clickOffset)) { + m_mouse.clickOffset = {}; + if (inGripRange(imagePos.x(), m_cropRect.left(), m_mouse.clickOffset.rx())) { m_mouse.margin = EdgeLeft; m_mouse.cursorShape = Qt::SizeHorCursor; - } else if (inGripRange(imagePos.x(), m_cropRect.right(), - m_mouse.clickOffset)) { + } else if (inGripRange(imagePos.x(), m_cropRect.right(), m_mouse.clickOffset.rx())) { m_mouse.margin = EdgeRight; m_mouse.cursorShape = Qt::SizeHorCursor; - } else if (inGripRange(imagePos.y(), m_cropRect.top(), m_mouse.clickOffset)) { + } else if (inGripRange(imagePos.y(), m_cropRect.top(), m_mouse.clickOffset.ry())) { m_mouse.margin = EdgeTop; m_mouse.cursorShape = Qt::SizeVerCursor; - } else if (inGripRange(imagePos.y(), m_cropRect.bottom(), - m_mouse.clickOffset)) { + } else if (inGripRange(imagePos.y(), m_cropRect.bottom(), m_mouse.clickOffset.ry())) { m_mouse.margin = EdgeBottom; m_mouse.cursorShape = Qt::SizeVerCursor; + } else if (const QRect hoverArea = moveHoverArea(); hoverArea.contains(imagePos)) { + m_mouse.margin = Move; + m_mouse.cursorShape = Qt::SizeAllCursor; + m_mouse.clickOffset = imagePos - m_cropRect.topLeft(); } else { m_mouse.margin = Free; m_mouse.cursorShape = Qt::ArrowCursor; - m_mouse.clickOffset = 0; } } @@ -121,12 +123,22 @@ void CropScene::updateBuffer() update(); } -QPoint CropScene::toImagePos(const QPoint &widgetPos) +QPoint CropScene::toImagePos(const QPoint &widgetPos) const { const int dpr = int(m_image->devicePixelRatio()); return {(widgetPos.x() - lineWidth) * dpr, (widgetPos.y() - lineWidth) * dpr}; } +QRect CropScene::moveHoverArea() const +{ + const qreal minRatio = 0.3; // 30% width / height of selection + const int minAbsoluteSize = 40; + QRect result(0, 0, qMax(int(m_cropRect.width() * minRatio), minAbsoluteSize), + qMax(int(m_cropRect.height() * minRatio), minAbsoluteSize)); + result.moveCenter(m_cropRect.center()); + return result; +} + QRect CropScene::cropRect() const { return m_cropRect; @@ -183,25 +195,32 @@ void CropScene::mouseMoveEvent(QMouseEvent *event) if (m_mouse.dragging) { switch (m_mouse.margin) { case EdgeLeft: - m_cropRect.setLeft(qBound(0, imagePos.x() - m_mouse.clickOffset, + m_cropRect.setLeft(qBound(0, imagePos.x() - m_mouse.clickOffset.x(), m_cropRect.right())); break; case EdgeTop: - m_cropRect.setTop(qBound(0, imagePos.y() - m_mouse.clickOffset, + m_cropRect.setTop(qBound(0, imagePos.y() - m_mouse.clickOffset.y(), m_cropRect.bottom())); break; case EdgeRight: - m_cropRect.setRight(qBound(m_cropRect.left(), imagePos.x() - m_mouse.clickOffset, + m_cropRect.setRight(qBound(m_cropRect.left(), imagePos.x() - m_mouse.clickOffset.x(), m_image->width() - 1)); break; case EdgeBottom: - m_cropRect.setBottom(qBound(m_cropRect.top(), imagePos.y() - m_mouse.clickOffset, + m_cropRect.setBottom(qBound(m_cropRect.top(), imagePos.y() - m_mouse.clickOffset.y(), m_image->height() - 1)); break; - case Free: { + case Free: m_cropRect = QRect(m_mouse.startImagePos, imagePos).normalized() .intersected(m_image->rect()); break; + case Move: { + const QPoint topLeft(qBound(0, imagePos.x() - m_mouse.clickOffset.x(), + m_image->width() - m_cropRect.width()), + qBound(0, imagePos.y() - m_mouse.clickOffset.y(), + m_image->height() - m_cropRect.height())); + m_cropRect = QRect(topLeft, m_cropRect.size()); + break; } } emit cropRectChanged(m_cropRect); diff --git a/src/plugins/screenrecorder/cropandtrim.h b/src/plugins/screenrecorder/cropandtrim.h index 1ac2cbae453..eaab1d8b3a1 100644 --- a/src/plugins/screenrecorder/cropandtrim.h +++ b/src/plugins/screenrecorder/cropandtrim.h @@ -45,12 +45,14 @@ private: EdgeTop, EdgeRight, EdgeBottom, - Free + Free, + Move, }; void initMouseInteraction(const QPoint &pos); void updateBuffer(); - QPoint toImagePos(const QPoint &widgetCoordinate); + QPoint toImagePos(const QPoint &widgetCoordinate) const; + QRect moveHoverArea() const; const static int m_gripWidth = 8; QRect m_cropRect; @@ -61,7 +63,7 @@ private: bool dragging = false; MarginEditing margin; QPoint startImagePos; - int clickOffset = 0; // Due to m_gripWidth, the mouse pointer is not precicely on the drag + QPoint clickOffset; // Due to m_gripWidth, the mouse pointer is not precicely on the drag // line. Maintain the offset while dragging, to avoid an initial jump. Qt::CursorShape cursorShape = Qt::ArrowCursor; } m_mouse; diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index d17dfb83058..422087abbd4 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -100,6 +100,7 @@ RecordOptionsDialog::RecordOptionsDialog(QWidget *parent) m_resetButton->setIcon(Icons::RESET.icon()); m_cropRectLabel = new QLabel; + m_cropRectLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); From 7de97c7a7f2343ca108528ddc773725fa906f6af Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 19 Sep 2023 16:48:42 +0200 Subject: [PATCH 1168/1777] CMakePM: Add CMake snippets Added four CMake snippets. Change-Id: I5f6f16ff8fd1a7ddd9647431f2f72529b882d603 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- share/qtcreator/snippets/cmake.xml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 share/qtcreator/snippets/cmake.xml diff --git a/share/qtcreator/snippets/cmake.xml b/share/qtcreator/snippets/cmake.xml new file mode 100644 index 00000000000..bed6ba042a7 --- /dev/null +++ b/share/qtcreator/snippets/cmake.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<snippets> + <snippet group="CMake" trigger="print_properties" id="cmake_print_properties" complement="">include(CMakePrintHelpers) +cmake_print_properties(TARGETS $targets$ PROPERTIES $properties$)</snippet> + <snippet group="CMake" trigger="print_variables" id="cmake_print_variables" complement="">include(CMakePrintHelpers) +cmake_print_variables($variables$)</snippet> + <snippet group="CMake" trigger="qt6_console_app" id="cmake_qt6_console_app" complement=""># https://doc.qt.io/qt-6/cmake-get-started.html +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(Qt6 REQUIRED COMPONENTS Core) +qt_standard_project_setup() + +qt_add_executable($executable$ + main.cpp +) + +target_link_libraries($executable$ PRIVATE Qt6::Core)</snippet> + <snippet group="CMake" trigger="qt6_gui_app" id="cmake_qt6_gui_app" complement=""># https://doc.qt.io/qt-6/cmake-get-started.html +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(Qt6 REQUIRED COMPONENTS Widgets) +qt_standard_project_setup() + +qt_add_executable($executable$ + mainwindow.ui + mainwindow.cpp + main.cpp +) + +target_link_libraries($executable$ PRIVATE Qt6::Widgets) + +set_target_properties($executable$ PROPERTIES + WIN32_EXECUTABLE ON + MACOSX_BUNDLE ON +)</snippet> +</snippets> From 957fa893151765f04edab0173dc33ab7d16d7665 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 19 Sep 2023 18:57:09 +0200 Subject: [PATCH 1169/1777] Core: Set the SH_Slider_AbsoluteSetButtons style for QSlider This way when the user clicks on the slider with the mouse the slider jumps under the mouse and not left and right according to the slider page. Change-Id: If36f9d8ea82f5b200e2322758f4fc25aef5e1a04 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/coreplugin/manhattanstyle.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index e3205dae6d8..aeac11dc575 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -442,6 +442,10 @@ int ManhattanStyle::styleHint(StyleHint hint, const QStyleOption *option, const ret = QGuiApplication::keyboardModifiers() == (HostOsInfo::isMacHost() ? Qt::MetaModifier : Qt::ControlModifier); break; + case QStyle::SH_Slider_AbsoluteSetButtons: + // Make QSlider jump on left mouse click + ret = Qt::LeftButton | Qt::MiddleButton | Qt::RightButton; + break; default: break; } From a2c44e55126349868a93c9d85f3179d63127c9f3 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 19 Sep 2023 19:21:03 +0200 Subject: [PATCH 1170/1777] Utils: Introduce non-toolbar "Snapshot" icon Change-Id: I07b66f128c5eea91768aeef54bbc03ec89b8014a Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/libs/utils/utilsicons.cpp | 2 ++ src/libs/utils/utilsicons.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/libs/utils/utilsicons.cpp b/src/libs/utils/utilsicons.cpp index 3fa62969d90..3e379ef5b96 100644 --- a/src/libs/utils/utilsicons.cpp +++ b/src/libs/utils/utilsicons.cpp @@ -63,6 +63,8 @@ const Icon BOOKMARK_TOOLBAR({ {":/utils/images/bookmark.png", Theme::IconsBaseColor}}); const Icon BOOKMARK_TEXTEDITOR({ {":/utils/images/bookmark.png", Theme::Bookmarks_TextMarkColor}}, Icon::Tint); +const Icon SNAPSHOT({ + {":/utils/images/snapshot.png", Theme::PanelTextColorMid}}, Icon::Tint); const Icon SNAPSHOT_TOOLBAR({ {":/utils/images/snapshot.png", Theme::IconsBaseColor}}); const Icon NEWSEARCH_TOOLBAR({ diff --git a/src/libs/utils/utilsicons.h b/src/libs/utils/utilsicons.h index 5848882764f..bef0ef517f2 100644 --- a/src/libs/utils/utilsicons.h +++ b/src/libs/utils/utilsicons.h @@ -36,6 +36,7 @@ QTCREATOR_UTILS_EXPORT extern const Icon BROKEN; QTCREATOR_UTILS_EXPORT extern const Icon BOOKMARK; QTCREATOR_UTILS_EXPORT extern const Icon BOOKMARK_TOOLBAR; QTCREATOR_UTILS_EXPORT extern const Icon BOOKMARK_TEXTEDITOR; +QTCREATOR_UTILS_EXPORT extern const Icon SNAPSHOT; QTCREATOR_UTILS_EXPORT extern const Icon SNAPSHOT_TOOLBAR; QTCREATOR_UTILS_EXPORT extern const Icon NEWSEARCH_TOOLBAR; QTCREATOR_UTILS_EXPORT extern const Icon SETTINGS; From e4d2046145b397ba5d91fd521bab6fd0b90d6bd8 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 19 Sep 2023 19:24:22 +0200 Subject: [PATCH 1171/1777] ScreenRecorder: Use better icon for "copy image" The same icon is used in other places to copy an image tnto the clipboard. Change-Id: I094bd885f1efac3d35c57bbd4c5905e26b8f0c40 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/screenrecorder/cropandtrim.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp index a0bccbd23b0..fb044500d8c 100644 --- a/src/plugins/screenrecorder/cropandtrim.cpp +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -304,7 +304,7 @@ CropWidget::CropWidget(QWidget *parent) auto copyImageToClipboardAction = new QAction(Tr::tr("Copy current, cropped frame as image " "into the Clipboard"), this); - copyImageToClipboardAction->setIcon(Icons::COPY.icon()); + copyImageToClipboardAction->setIcon(Icons::SNAPSHOT.icon()); copyImageToClipboardAction->setShortcut(QKeySequence::Copy); auto copyImageToClipboardButton = new QToolButton; From 83c7c0d31bacfcb666d9bf4a6bcfdcdf129c6bde Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <thomas.hartmann@qt.io> Date: Mon, 18 Sep 2023 15:52:12 +0200 Subject: [PATCH 1172/1777] QmlDesigner: Add missing qualification This was leading to random errors. Change-Id: I51ec0c71ac1bd3ea7bd966eeb4d3a2b9cfeb0159 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> (cherry picked from commit 5ff6fe0eba9934febfb84fae324503b8840e1bbb) Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../qtcreator/qmldesigner/connectionseditor/SuggestionPopup.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/connectionseditor/SuggestionPopup.qml b/share/qtcreator/qmldesigner/connectionseditor/SuggestionPopup.qml index fb9643ca14b..5bd01b37bbd 100644 --- a/share/qtcreator/qmldesigner/connectionseditor/SuggestionPopup.qml +++ b/share/qtcreator/qmldesigner/connectionseditor/SuggestionPopup.qml @@ -133,7 +133,7 @@ Controls.Popup { boundsMovement: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds - ScrollBar.vertical: HelperWidgets.ScrollBar { + Controls.ScrollBar.vertical: HelperWidgets.ScrollBar { id: listScrollBar parent: listView x: listView.width - listScrollBar.width From d3dcb894e8031e6dbe139d1d05d81c9f26bf33cc Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 19 Sep 2023 19:35:39 +0200 Subject: [PATCH 1173/1777] Git: Use a hyperlink for the git sha1 This way it's clear how you should get to the commit. Change-Id: I6131ffab1855d686828137fb608d3edc57846cf5 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/git/gitplugin.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 4296fd73aa5..693b12cc028 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -195,11 +195,13 @@ public: class BlameMark : public TextEditor::TextMark { + const CommitInfo m_info; public: BlameMark(const FilePath &fileName, int lineNumber, const CommitInfo &info) : TextEditor::TextMark(fileName, lineNumber, {Tr::tr("Git Blame"), Constants::TEXT_MARK_CATEGORY_BLAME}) + , m_info(info) { const QString text = info.shortAuthor + " " + info.authorTime.toString("yyyy-MM-dd"); @@ -214,21 +216,27 @@ public: QObject::connect(copyToClipboardAction, &QAction::triggered, [info] { Utils::setClipboardAndSelection(info.sha1); }); - QAction *showAction = new QAction; - showAction->setIcon(Utils::Icons::ZOOM.icon()); - showAction->setToolTip(TextEditor::Tr::tr("Show Commit %1").arg(info.sha1.left(8))); - QObject::connect(showAction, &QAction::triggered, [info] { - gitClient().show(info.filePath, info.sha1); - }); - return QList<QAction *>{copyToClipboardAction, showAction}; + return QList<QAction *>{copyToClipboardAction}; }); } + bool addToolTipContent(QLayout *target) const final + { + auto textLabel = new QLabel; + textLabel->setText(toolTip()); + target->addWidget(textLabel); + QObject::connect(textLabel, &QLabel::linkActivated, textLabel, [this] { + gitClient().show(m_info.filePath, m_info.sha1); + }); + + return true; + } + QString toolTipText(const CommitInfo &info) const { QString result = QString( "<table>" - " <tr><td>commit</td><td>%1</td></tr>" + " <tr><td>commit</td><td><a href>%1</a></td></tr>" " <tr><td>Author:</td><td>%2 <%3></td></tr>" " <tr><td>Date:</td><td>%4</td></tr>" " <tr></tr>" From afc424cd2334c108e45593ac67c84d9b52d3bef3 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 19 Sep 2023 20:40:02 +0200 Subject: [PATCH 1174/1777] ScreenRecorder: Make Selection not movable if fully selected Change-Id: I0f2737fdaef44a649a3e1576554f0abcd304c272 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/screenrecorder/cropandtrim.cpp | 21 ++++++++++----------- src/plugins/screenrecorder/cropandtrim.h | 1 - 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp index fb044500d8c..218029c9356 100644 --- a/src/plugins/screenrecorder/cropandtrim.cpp +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -59,6 +59,15 @@ void CropScene::initMouseInteraction(const QPoint &imagePos) return inRange; }; + static const auto inMoveArea = [this, &imagePos] { + const qreal minRatio = 0.25; // 25% width / height of selection + const int minAbsoluteSize = 40; + QRect result(0, 0, qMax(int(m_cropRect.width() * minRatio), minAbsoluteSize), + qMax(int(m_cropRect.height() * minRatio), minAbsoluteSize)); + result.moveCenter(m_cropRect.center()); + return result.contains(imagePos); + }; + m_mouse.clickOffset = {}; if (inGripRange(imagePos.x(), m_cropRect.left(), m_mouse.clickOffset.rx())) { m_mouse.margin = EdgeLeft; @@ -72,7 +81,7 @@ void CropScene::initMouseInteraction(const QPoint &imagePos) } else if (inGripRange(imagePos.y(), m_cropRect.bottom(), m_mouse.clickOffset.ry())) { m_mouse.margin = EdgeBottom; m_mouse.cursorShape = Qt::SizeVerCursor; - } else if (const QRect hoverArea = moveHoverArea(); hoverArea.contains(imagePos)) { + } else if (!fullySelected() && inMoveArea()) { m_mouse.margin = Move; m_mouse.cursorShape = Qt::SizeAllCursor; m_mouse.clickOffset = imagePos - m_cropRect.topLeft(); @@ -129,16 +138,6 @@ QPoint CropScene::toImagePos(const QPoint &widgetPos) const return {(widgetPos.x() - lineWidth) * dpr, (widgetPos.y() - lineWidth) * dpr}; } -QRect CropScene::moveHoverArea() const -{ - const qreal minRatio = 0.3; // 30% width / height of selection - const int minAbsoluteSize = 40; - QRect result(0, 0, qMax(int(m_cropRect.width() * minRatio), minAbsoluteSize), - qMax(int(m_cropRect.height() * minRatio), minAbsoluteSize)); - result.moveCenter(m_cropRect.center()); - return result; -} - QRect CropScene::cropRect() const { return m_cropRect; diff --git a/src/plugins/screenrecorder/cropandtrim.h b/src/plugins/screenrecorder/cropandtrim.h index eaab1d8b3a1..c4e4ab465f8 100644 --- a/src/plugins/screenrecorder/cropandtrim.h +++ b/src/plugins/screenrecorder/cropandtrim.h @@ -52,7 +52,6 @@ private: void initMouseInteraction(const QPoint &pos); void updateBuffer(); QPoint toImagePos(const QPoint &widgetCoordinate) const; - QRect moveHoverArea() const; const static int m_gripWidth = 8; QRect m_cropRect; From d83c74078491c02fcf8491deb1880ced2817762c Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 19 Sep 2023 15:05:21 +0200 Subject: [PATCH 1175/1777] Utils: Add files to qbs build Change-Id: Ica376eb4361ea8de480f3b38aec640a2e73f067f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/utils/utils.qbs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 6def6a15c51..b3b3207a927 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -326,6 +326,8 @@ QtcLibrary { "textutils.h", "threadutils.cpp", "threadutils.h", + "transientscroll.cpp", + "transientscroll.h", "treemodel.cpp", "treemodel.h", "treeviewcombobox.cpp", From 881c48fbe78ce6cfd10fd359df29c752add521a7 Mon Sep 17 00:00:00 2001 From: Jussi Witick <jussi.witick@qt.io> Date: Mon, 4 Sep 2023 10:01:06 +0300 Subject: [PATCH 1176/1777] Add Qt Saferenderer 2.1 application wizard Qt Saferenderer 2.1 application requires some changes compared to the previous wizard template application. Mark the old wizard for 2.0 only and create a new wizard template for QSR 2.1 (and newer). Additionally CMake support is added for the new wizard, as QSR 2.0 did not support CMake yet. Task-number: QSR-1990 Change-Id: Iddac903374cf3e044d8a8804b9a935077de1e88a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/saferenderer/saferenderer.qrc | 7 ++ .../saferenderer/wizards/qsrapp/wizard.json | 4 +- .../wizards/qsrapp2_1/CMakeLists.txt | 67 ++++++++++ .../saferenderer/wizards/qsrapp2_1/file.pro | 46 +++++++ .../wizards/qsrapp2_1/main.cpp.tpl | 62 ++++++++++ .../wizards/qsrapp2_1/main.qml.tpl | 26 ++++ .../wizards/qsrapp2_1/qml.qrc.tpl | 5 + .../wizards/qsrapp2_1/safeasset.qrc.tpl | 2 + .../wizards/qsrapp2_1/wizard.json | 116 ++++++++++++++++++ 9 files changed, 333 insertions(+), 2 deletions(-) create mode 100644 src/plugins/saferenderer/wizards/qsrapp2_1/CMakeLists.txt create mode 100644 src/plugins/saferenderer/wizards/qsrapp2_1/file.pro create mode 100644 src/plugins/saferenderer/wizards/qsrapp2_1/main.cpp.tpl create mode 100644 src/plugins/saferenderer/wizards/qsrapp2_1/main.qml.tpl create mode 100644 src/plugins/saferenderer/wizards/qsrapp2_1/qml.qrc.tpl create mode 100644 src/plugins/saferenderer/wizards/qsrapp2_1/safeasset.qrc.tpl create mode 100644 src/plugins/saferenderer/wizards/qsrapp2_1/wizard.json diff --git a/src/plugins/saferenderer/saferenderer.qrc b/src/plugins/saferenderer/saferenderer.qrc index 28baa346473..84999a48aac 100644 --- a/src/plugins/saferenderer/saferenderer.qrc +++ b/src/plugins/saferenderer/saferenderer.qrc @@ -8,5 +8,12 @@ <file>wizards/qsrapp/qml.qrc.tpl</file> <file>wizards/qsrapp/safeasset.qrc.tpl</file> <file>wizards/qsrapp/wizard.json</file> + <file>wizards/qsrapp2_1/file.pro</file> + <file>wizards/qsrapp2_1/CMakeLists.txt</file> + <file>wizards/qsrapp2_1/main.cpp.tpl</file> + <file>wizards/qsrapp2_1/main.qml.tpl</file> + <file>wizards/qsrapp2_1/qml.qrc.tpl</file> + <file>wizards/qsrapp2_1/safeasset.qrc.tpl</file> + <file>wizards/qsrapp2_1/wizard.json</file> </qresource> </RCC> diff --git a/src/plugins/saferenderer/wizards/qsrapp/wizard.json b/src/plugins/saferenderer/wizards/qsrapp/wizard.json index e05e5f7971a..6a05c4e1d0b 100644 --- a/src/plugins/saferenderer/wizards/qsrapp/wizard.json +++ b/src/plugins/saferenderer/wizards/qsrapp/wizard.json @@ -3,8 +3,8 @@ "supportedProjectTypes": [ "Qt4ProjectManager.Qt4Project" ], "id": "E.QSRApp", "category": "D.QtSafeRendererApplication", - "trDescription": "Creates a Qt Safe Renderer project with simple UI and project setup.", - "trDisplayName": "Qt Safe Renderer Application", + "trDescription": "Creates a Qt Safe Renderer 2.0 project with a simple UI and project setup.\n\nThis project template does not work with QSR 2.1 or newer, and does not support CMake.", + "trDisplayName": "Qt Safe Renderer 2.0 Application", "trDisplayCategory": "Application (Qt Safe Renderer)", "icon": "../icon.png", "iconKind": "Themed", diff --git a/src/plugins/saferenderer/wizards/qsrapp2_1/CMakeLists.txt b/src/plugins/saferenderer/wizards/qsrapp2_1/CMakeLists.txt new file mode 100644 index 00000000000..e17daccd9c1 --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp2_1/CMakeLists.txt @@ -0,0 +1,67 @@ +cmake_minimum_required(VERSION 3.16) +project(%{CMakeProjectName} LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) + +# Define the condition for HOST_BUILD +set(HOST_BUILD OFF) # Default to OFF + +if (NOT CMAKE_CROSSCOMPILING AND (NOT UNIX OR NOT (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm|aarch64") OR APPLE)) + set(HOST_BUILD ON) +endif() + +find_package(Qt6 REQUIRED COMPONENTS Core Qml Quick SafeRenderer SafeRendererTools SafePlatformAdaptation) + +set(sources main.cpp +) + +set (safeqmls +"main.qml" +) + +# Resource files are passed to qtsafelayouttool +set(resource_files + "qml.qrc" +) + +#resource.bin is loaded by qtsafelayouttool to find the resource data asset. +qt6_add_binary_resources(resources_%{CMakeProjectName} ${resource_files} DESTINATION resource.bin) +qsr_add_safelayout(generatelayout_%{CMakeProjectName} SAFE_QMLS ${safeqmls} + OUTPUT_PATH ${CMAKE_CURRENT_LIST_DIR}/layoutData + SAFE_RESOURCE "${CMAKE_CURRENT_LIST_DIR}/safeasset.qrc" + INPUT_RESOURCES resource.bin) +qsr_add_resource(buildresource_%{CMakeProjectName} sources "${CMAKE_CURRENT_LIST_DIR}/safeasset.qrc") + +if (HOST_BUILD) + qt6_add_resources(sources ${resource_files}) +endif() + +add_executable(%{CMakeProjectName} WIN32 MACOSX_BUNDLE + ${sources} +) + +#Enable when using monitor feature: +#target_compile_definitions(%{CMakeProjectName} PRIVATE USE_OUTPUTVERIFIER) + +add_dependencies(%{CMakeProjectName} generatelayout_%{CMakeProjectName}) + +if (HOST_BUILD) + target_compile_definitions(%{CMakeProjectName} PUBLIC + HOST_BUILD + ) + + target_link_libraries(%{CMakeProjectName} PUBLIC + Qt::Quick + Qt::Widgets + Qt::Qml + ) +else() + message(STATUS "Project is not linked with Qt when building for embedded systems.") +endif() + +target_link_libraries(%{CMakeProjectName} PUBLIC + Qt::SafeRenderer + Qt::SafePlatformAdaptation +) diff --git a/src/plugins/saferenderer/wizards/qsrapp2_1/file.pro b/src/plugins/saferenderer/wizards/qsrapp2_1/file.pro new file mode 100644 index 00000000000..6233d49b9cc --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp2_1/file.pro @@ -0,0 +1,46 @@ +QT = qtsaferenderer qsrplatformadaptation + +CONFIG += c++17 + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \\ + %{CppFileName} + + +# List of language codes that your application supports. For example, SAFE_LANGUAGES = en fi. +#SAFE_LANGUAGES = en + +# List of translation file names excluding the language code. For example, SAFE_TRANSLATION = $$PWD/safeui. +#SAFE_TRANSLATION = $$PWD/safeui + +# List of translation file names including the language code. There must be one file +# for each language listed in SAFE_LANGUAGES. For example, TRANSLATIONS += safeui_en.ts safeui_fi.ts. +#TRANSLATIONS += safeui_en.ts + +# You can use an lupdate_only{...} conditional statement to specify the QML files that contain texts. +#lupdate_only { +# SOURCES += main.qml +#} + + +RESOURCES += qml.qrc + +# Additional import path used to resolve QML modules in Qt Creator's code model +QML_IMPORT_PATH = $$PWD/imports + +# Additional import path used to resolve QML modules just for Qt Quick Designer +QML_DESIGNER_IMPORT_PATH = + + +CONFIG += qtsaferenderer exceptions +SAFE_QML = $$PWD/main.qml +SAFE_LAYOUT_PATH = $$PWD/layoutData +SAFE_RESOURCES += safeasset.qrc + +!cross_compile: DEFINES += HOST_BUILD +!cross_compile: QT += widgets quick svg + +DISTFILES += main.qml diff --git a/src/plugins/saferenderer/wizards/qsrapp2_1/main.cpp.tpl b/src/plugins/saferenderer/wizards/qsrapp2_1/main.cpp.tpl new file mode 100644 index 00000000000..80b45e04bb9 --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp2_1/main.cpp.tpl @@ -0,0 +1,62 @@ +%{Cpp:LicenseTemplate}\ +%{JS: QtSupport.qtIncludes([ 'QtCore/QCoreApplication' ], + [ 'QtCore/QCoreApplication' ]) }\ + +#include <QtSafeRenderer/qsafelayout.h> +#include <QtSafeRenderer/qsafelayoutresourcereader.h> +#include <QtSafeRenderer/statemanager.h> + +#if defined(HOST_BUILD) +#include <QGuiApplication> +#include <QQmlApplicationEngine> +#include <QQmlContext> +#endif + +#if defined(USE_OUTPUTVERIFIER) +#include <outputverifier.h> +#include "testverifier.h" +#endif + +#include "safewindow.h" +#include "eventhandler.h" + +int main(int argc, char *argv[]) +{ + Q_UNUSED(argc); + Q_UNUSED(argv); + + static SafeRenderer::QSafeLayoutResourceReader layout("/layoutData/main/main.srl"); + +#if defined(USE_OUTPUTVERIFIER) + static SafeRenderer::OutputVerifier outputVerifier; + SafeRenderer::SafeWindow telltaleWindow(layout.size(), SafeRenderer::QSafePoint(0U, 0U), outputVerifier); +#else + SafeRenderer::SafeWindow telltaleWindow(layout.size(), SafeRenderer::QSafePoint(0U, 0U)); +#endif + + static SafeRenderer::StateManager stateManager(telltaleWindow, layout); + telltaleWindow.requestUpdate(); //Request is required because eventHandler is not running yet. + +#if defined(USE_OUTPUTVERIFIER) + SafeRenderer::EventHandler msgHandler(stateManager, telltaleWindow, outputVerifier); +#else + SafeRenderer::EventHandler msgHandler(stateManager, telltaleWindow); +#endif + +#if defined(HOST_BUILD) + //Mixing the Qt and Qt Safe Renderer renderers is done here only for demonstration purposes on host, not for production purposes of any kind. + QQmlApplicationEngine engine; + const QUrl url(QStringLiteral("qrc:/main.qml")); + QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, qApp, + [url](QObject *obj, const QUrl &objUrl) { + if (!obj && url == objUrl) + qDebug() << "Failed to start the main.qml"; + }, Qt::QueuedConnection); + engine.addImportPath(":/imports"); + engine.load(url); +#endif + + msgHandler.handleEvents(); + + return 0; +} diff --git a/src/plugins/saferenderer/wizards/qsrapp2_1/main.qml.tpl b/src/plugins/saferenderer/wizards/qsrapp2_1/main.qml.tpl new file mode 100644 index 00000000000..94fccebcb2a --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp2_1/main.qml.tpl @@ -0,0 +1,26 @@ +import Qt.SafeRenderer 2.0 +import QtQuick.Window 2.15 + +Window { + id: window + width: 640 + height: 480 + visible: true + title: qsTr("Hello QSR") + + SafeText { + id: safeText + objectName: "safetextitem" + x: 206 + y: 208 + width: 340 + height: 34 + color: "#8ae234" + fillColor: "black" + text: "Hello Qt Safe Renderer!" + font.family: "Lato" + horizontalAlignment: Text.AlignLeft + font.pixelSize: 32 + runtimeEditable: true + } +} diff --git a/src/plugins/saferenderer/wizards/qsrapp2_1/qml.qrc.tpl b/src/plugins/saferenderer/wizards/qsrapp2_1/qml.qrc.tpl new file mode 100644 index 00000000000..5f6483ac33f --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp2_1/qml.qrc.tpl @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + </qresource> +</RCC> diff --git a/src/plugins/saferenderer/wizards/qsrapp2_1/safeasset.qrc.tpl b/src/plugins/saferenderer/wizards/qsrapp2_1/safeasset.qrc.tpl new file mode 100644 index 00000000000..601b61fc4c2 --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp2_1/safeasset.qrc.tpl @@ -0,0 +1,2 @@ +<!DOCTYPE RCC> +<RCC/> diff --git a/src/plugins/saferenderer/wizards/qsrapp2_1/wizard.json b/src/plugins/saferenderer/wizards/qsrapp2_1/wizard.json new file mode 100644 index 00000000000..9f493b9a212 --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp2_1/wizard.json @@ -0,0 +1,116 @@ +{ + "version": 1, + "supportedProjectTypes": [ "Qt4ProjectManager.Qt4Project" ], + "id": "E.QSRApp2_1", + "category": "D.QtSafeRendererApplication", + "trDescription": "Creates a Qt Safe Renderer 2.1 (and newer) project with a simple UI and project setup.\n\nSupports both qmake and CMake.", + "trDisplayName": "Qt Safe Renderer Application 2.1", + "trDisplayCategory": "Application (Qt Safe Renderer)", + "icon": "../icon.png", + "iconKind": "Themed", + "featuresRequired": [ "QtSupport.Wizards.FeatureQt" ], + "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0}", + + "options": + [ + { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') == 'qmake' ? value('ProFile') : value('CMakeFile')}" }, + { "key": "CMakeProjectName", "value": "%{JS: value('ProjectName').replace(/-/g, '_')}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, + { "key": "CMakeFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/CMakeLists.txt')}" }, + { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" }, + { "key": "CppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" } + ], + + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project", + "data": { "trDescription": "This wizard creates a simple Qt Safe Renderer application." } + }, + { + "trDisplayName": "Define Build System", + "trShortTitle": "Build System", + "typeId": "Fields", + "enabled": "%{JS: !value('IsSubproject')}", + "data": + [ + { + "name": "BuildSystem", + "trDisplayName": "Build system:", + "type": "ComboBox", + "persistenceKey": "BuildSystemType", + "data": + { + "index": 1, + "items": + [ + { + "trKey": "qmake", + "value": "qmake", + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" + }, + { + "trKey": "cmake", + "value": "cmake", + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" + } + ] + } + } + ] + }, + { + "trDisplayName": "Kit Selection", + "trShortTitle": "Kits", + "typeId": "Kits", + "enabled": "%{JS: !value('IsSubproject')}", + "data": { "projectFilePath": "%{ProjectFile}" } + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": + [ + { + "typeId": "File", + "data": + [ + { + "source": "file.pro", + "target": "%{ProFile}", + "openAsProject": true, + "condition": "%{JS: value('BuildSystem') === 'qmake'}" + }, + { + "source": "CMakeLists.txt", + "target": "%{CMakeFile}", + "openAsProject": true, + "condition": "%{JS: value('BuildSystem') === 'cmake'}" + }, + { + "source": "main.cpp.tpl", + "target": "%{CppFileName}", + "openInEditor": false + }, + { + "source": "safeasset.qrc.tpl", + "target": "safeasset.qrc" + }, + { + "source": "qml.qrc.tpl", + "target": "qml.qrc" + }, + { + "source": "main.qml.tpl", + "target": "main.qml", + "openInEditor": true + } + ] + } + ] +} From 189cf8054f4a75637bab70afc90be7fe65b410ed Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 15 Sep 2023 14:17:11 +0200 Subject: [PATCH 1177/1777] Docker: Add network option to settings Change-Id: Idb18435aa668f9219ae0eb2db6bd55d040ba5243 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/docker/dockerapi.cpp | 72 +++++++++++++++++++++++ src/plugins/docker/dockerapi.h | 16 +++++ src/plugins/docker/dockerdevice.cpp | 56 ++++++++++++++---- src/plugins/docker/dockerdevice.h | 1 + src/plugins/docker/dockerdevicewidget.cpp | 1 + 5 files changed, 136 insertions(+), 10 deletions(-) diff --git a/src/plugins/docker/dockerapi.cpp b/src/plugins/docker/dockerapi.cpp index fe89d590591..900e5bb18b2 100644 --- a/src/plugins/docker/dockerapi.cpp +++ b/src/plugins/docker/dockerapi.cpp @@ -105,4 +105,76 @@ FilePath DockerApi::dockerClient() return settings().dockerBinaryPath(); } +QFuture<Utils::expected_str<QList<Network>>> DockerApi::networks() +{ + return Utils::asyncRun([this]() -> Utils::expected_str<QList<Network>> { + QList<Network> result; + + Process process; + FilePath dockerExe = dockerClient(); + if (dockerExe.isEmpty() || !dockerExe.isExecutableFile()) + return make_unexpected(Tr::tr("Docker executable not found")); + + process.setCommand( + CommandLine(dockerExe, QStringList{"network", "ls", "--format", "{{json .}}"})); + process.runBlocking(); + + if (process.result() != ProcessResult::FinishedWithSuccess) { + return make_unexpected( + Tr::tr("Failed to retrieve docker networks. Exit code: %1. Error: %2") + .arg(process.exitCode()) + .arg(process.allOutput())); + } + + for (const auto &line : process.readAllStandardOutput().split('\n')) { + if (line.isEmpty()) + continue; + + QJsonParseError error; + QJsonDocument doc = QJsonDocument::fromJson(line.toUtf8(), &error); + + if (error.error != QJsonParseError::NoError) { + qCWarning(dockerApiLog) + << "Failed to parse docker network info:" << error.errorString(); + continue; + } + + Network network; + network.id = doc["ID"].toString(); + network.name = doc["Name"].toString(); + network.driver = doc["Driver"].toString(); + network.scope = doc["Scope"].toString(); + network.internal = doc["Internal"].toString() == "true"; + network.ipv6 = doc["IPv6"].toString() == "true"; + network.createdAt = QDateTime::fromString(doc["CreatedAt"].toString(), Qt::ISODate); + network.labels = doc["Labels"].toString(); + + result.append(network); + } + + return result; + }); +} + +QString Network::toString() const +{ + return QString(R"(ID: "%1" +Name: "%2" +Driver: "%3" +Scope: "%4" +Internal: "%5" +IPv6: "%6" +CreatedAt: "%7" +Labels: "%8" + )") + .arg(id) + .arg(name) + .arg(driver) + .arg(scope) + .arg(internal) + .arg(ipv6) + .arg(createdAt.toString(Qt::ISODate)) + .arg(labels); +} + } // Docker::Internal diff --git a/src/plugins/docker/dockerapi.h b/src/plugins/docker/dockerapi.h index 4866e84c66a..3e697654a3a 100644 --- a/src/plugins/docker/dockerapi.h +++ b/src/plugins/docker/dockerapi.h @@ -5,6 +5,7 @@ #include "dockersettings.h" +#include <utils/expected.h> #include <utils/filepath.h> #include <utils/guard.h> @@ -15,6 +16,20 @@ namespace Docker::Internal { +struct Network +{ + QString id; + QString name; + QString driver; + QString scope; + bool internal; + bool ipv6; + QDateTime createdAt; + QString labels; + + QString toString() const; +}; + class DockerApi : public QObject { Q_OBJECT @@ -27,6 +42,7 @@ public: bool canConnect(); void checkCanConnect(bool async = true); static void recheckDockerDaemon(); + QFuture<Utils::expected_str<QList<Network>>> networks(); signals: void dockerDaemonAvailableChanged(); diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index ef90a78b582..e2646dcaf30 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -69,6 +69,7 @@ #include <QPushButton> #include <QRandomGenerator> #include <QRegularExpression> +#include <QStandardItem> #include <QTextBrowser> #include <QThread> #include <QToolButton> @@ -109,8 +110,8 @@ public: private: void setupShellProcess(Process *shellProcess) final { - shellProcess->setCommand({settings().dockerBinaryPath(), - {"container", "start", "-i", "-a", m_containerId}}); + shellProcess->setCommand( + {settings().dockerBinaryPath(), {"container", "start", "-i", "-a", m_containerId}}); } CommandLine createFallbackCommand(const CommandLine &cmdLine) @@ -132,8 +133,7 @@ public: : m_dev(dev) {} - RunResult runInShell(const CommandLine &cmdLine, - const QByteArray &stdInData) const override; + RunResult runInShell(const CommandLine &cmdLine, const QByteArray &stdInData) const override; QString mapToDevicePath(const QString &hostPath) const override; DockerDevicePrivate *m_dev = nullptr; @@ -191,6 +191,40 @@ DockerDeviceSettings::DockerDeviceSettings() clangdExecutable.setLabelText(Tr::tr("Clangd Executable:")); clangdExecutable.setAllowPathFromDevice(true); + network.setSettingsKey("Network"); + network.setLabelText(Tr::tr("Network:")); + network.setDefaultValue("bridge"); + network.setFillCallback([this](const StringSelectionAspect::ResultCallback &cb) { + auto future = DockerApi::instance()->networks(); + + auto watcher = new QFutureWatcher<expected_str<QList<Network>>>(this); + watcher->setFuture(future); + QObject::connect(watcher, + &QFutureWatcher<expected_str<QList<Network>>>::finished, + this, + [watcher, cb]() { + expected_str<QList<Network>> result = watcher->result(); + if (result) { + auto items = Utils::transform(*result, [](const Network &network) { + QStandardItem *item = new QStandardItem(network.name); + item->setData(network.name); + item->setToolTip(network.toString()); + return item; + }); + cb(items); + } else { + QStandardItem *errorItem = new QStandardItem(Tr::tr("Error!")); + errorItem->setToolTip(result.error()); + cb({errorItem}); + } + }); + }); + + connect(DockerApi::instance(), + &DockerApi::dockerDaemonAvailableChanged, + &network, + &StringSelectionAspect::refill); + clangdExecutable.setValidationFunction( [](const QString &newValue) -> FancyLineEdit::AsyncValidationFuture { return Utils::asyncRun([newValue]() -> expected_str<QString> { @@ -757,9 +791,7 @@ expected_str<QString> DockerDevicePrivate::createContainer() "-e", QString("DISPLAY=%1").arg(display), "-e", - "XAUTHORITY=/.Xauthority", - "--net", - "host"}}; + "XAUTHORITY=/.Xauthority"}}; #ifdef Q_OS_UNIX // no getuid() and getgid() on Windows. @@ -767,6 +799,11 @@ expected_str<QString> DockerDevicePrivate::createContainer() dockerCreate.addArgs({"-u", QString("%1:%2").arg(getuid()).arg(getgid())}); #endif + if (!deviceSettings->network().isEmpty()) { + dockerCreate.addArg("--network"); + dockerCreate.addArg(deviceSettings->network()); + } + dockerCreate.addArgs(createMountArgs()); if (!deviceSettings->keepEntryPoint()) @@ -1206,9 +1243,8 @@ bool DockerDevicePrivate::addTemporaryMount(const FilePath &path, const FilePath if (alreadyAdded) return false; - const bool alreadyManuallyAdded = anyOf(deviceSettings->mounts(), [path](const FilePath &mount) { - return mount == path; - }); + const bool alreadyManuallyAdded = anyOf(deviceSettings->mounts(), + [path](const FilePath &mount) { return mount == path; }); if (alreadyManuallyAdded) return false; diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index c38a7746dbd..51fc05be28a 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -32,6 +32,7 @@ public: Utils::BoolAspect keepEntryPoint{this}; Utils::BoolAspect enableLldbFlags{this}; Utils::FilePathAspect clangdExecutable{this}; + Utils::StringSelectionAspect network{this}; Utils::TextDisplay containerStatus{this}; }; diff --git a/src/plugins/docker/dockerdevicewidget.cpp b/src/plugins/docker/dockerdevicewidget.cpp index 018cabb07f6..eb910b41956 100644 --- a/src/plugins/docker/dockerdevicewidget.cpp +++ b/src/plugins/docker/dockerdevicewidget.cpp @@ -167,6 +167,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) deviceSettings->keepEntryPoint, br, deviceSettings->enableLldbFlags, br, deviceSettings->clangdExecutable, br, + deviceSettings->network, br, Column { pathListLabel, deviceSettings->mounts, From 871162bd1c722920e0321492bf40faae09e2a926 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 20 Sep 2023 07:20:35 +0200 Subject: [PATCH 1178/1777] ProjectExplorer: remove unused functions Change-Id: I4a860d5e2e24a4e5de84e2186a3b4ac6dca3bfd4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/toolchain.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index ddbfff1be7d..a2251d866c0 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -237,9 +237,6 @@ public: const IDeviceConstPtr &device, const Utils::FilePaths &searchPaths); - bool isBadToolchain(const Utils::FilePath &toolchain) const; - void addBadToolchain(const Utils::FilePath &toolchain) const; - const Toolchains alreadyKnown; const IDeviceConstPtr device; const Utils::FilePaths searchPaths; // If empty use device path and/or magic. From 9f7f175124dc40e1e5c8e0aab925fbd79bcbf639 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 19 Sep 2023 14:58:56 +0200 Subject: [PATCH 1179/1777] Sqlite: Disable before Qt6.4.3 Does not build before Qt6.4 and cmake build only builds it from Qt6.4.3 onwards. Change-Id: Ie3ffa37eb1c164b4fd151e2cf73918cfd4740175 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/sqlite/sqlite.qbs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/sqlite/sqlite.qbs b/src/libs/sqlite/sqlite.qbs index 3f1b1050c9d..c25bd5f3fc0 100644 --- a/src/libs/sqlite/sqlite.qbs +++ b/src/libs/sqlite/sqlite.qbs @@ -1,10 +1,13 @@ -import qbs 1.0 +import qbs.Utilities QtcLibrary { name: "Sqlite" Depends { name: "Utils" } Depends { name: "sqlite_sources" } + Depends { name: "Qt.core"; required:false } + condition: Qt.core.present && Utilities.versionCompare(Qt.core.version, "6.4.3") >= 0 + property string exportedIncludeDir: sqlite_sources.includeDir Export { From fca94a8366af6dfbf597a832408e0a7d1e5e0fd9 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 19 Sep 2023 18:22:48 +0200 Subject: [PATCH 1180/1777] qbs build: Fix manual tests - Remove dependency on project.withAutotests by adding local {Qt,Cpp}Application overrides that alias QtcManualTest. This way, the respective products are a QtcManualTest when inside Qt Creator, while also working outside the source tree. - Rename QtcManualtest to QtcManualTest. (The reason QtcAutotest is not camel-cased is because "autotest" is a single word.) - Plus some minor clean-ups. Change-Id: Idd77191f0b433d6d7443c639eebda383ab110082 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../{QtcManualtest.qbs => QtcManualTest.qbs} | 0 qtcreator.qbs | 2 +- tests/manual/debugger/gui/gui.qbs | 2 +- .../debugger/simple/simple_test_app.qbs | 2 -- .../debugger/simple/simple_test_plugin.qbs | 4 +-- tests/manual/deviceshell/deviceshell.qbs | 29 +++++++++---------- tests/manual/fakevim/fakevim.qbs | 6 ++-- tests/manual/manual.qbs | 4 +-- .../pluginview/plugins/plugin1/plugin1.qbs | 2 +- .../pluginview/plugins/plugin2/plugin2.qbs | 2 +- .../pluginview/plugins/plugin3/plugin3.qbs | 2 +- tests/manual/pluginview/pluginview.qbs | 2 +- tests/manual/proparser/testreader.qbs | 6 ++-- tests/manual/qbs/imports/CppApplication.qbs | 1 + tests/manual/qbs/imports/QtApplication.qbs | 1 + tests/manual/shootout/shootout.qbs | 6 ++-- tests/manual/spinner/spinner.qbs | 6 ++-- .../subdirfilecontainer.qbs | 6 ++-- tests/manual/tasking/demo/demo.qbs | 2 +- .../tasking/imagescaling/imagescaling.qbs | 4 +-- .../widgets/crumblepath/crumblepath.qbs | 5 +--- tests/manual/widgets/infolabel/infolabel.qbs | 5 +--- .../widgets/layoutbuilder/layoutbuilder.qbs | 6 +--- .../widgets/manhattanstyle/manhattanstyle.qbs | 5 +--- tests/manual/widgets/tracing/tracing.qbs | 5 +--- 25 files changed, 42 insertions(+), 73 deletions(-) rename qbs/imports/{QtcManualtest.qbs => QtcManualTest.qbs} (100%) create mode 100644 tests/manual/qbs/imports/CppApplication.qbs create mode 100644 tests/manual/qbs/imports/QtApplication.qbs diff --git a/qbs/imports/QtcManualtest.qbs b/qbs/imports/QtcManualTest.qbs similarity index 100% rename from qbs/imports/QtcManualtest.qbs rename to qbs/imports/QtcManualTest.qbs diff --git a/qtcreator.qbs b/qtcreator.qbs index daa8427b0ef..21f610de563 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -1,7 +1,7 @@ Project { name: "Qt Creator" minimumQbsVersion: "2.0.0" - property bool withAutotests: qbs.buildVariant === "debug" // FIXME: Remove + property bool withAutotests: qbs.buildVariant === "debug" // TODO: compat, remove property path ide_source_tree: path property pathList additionalPlugins: [] property pathList additionalLibs: [] diff --git a/tests/manual/debugger/gui/gui.qbs b/tests/manual/debugger/gui/gui.qbs index 88e9bd53071..caa73bc211e 100644 --- a/tests/manual/debugger/gui/gui.qbs +++ b/tests/manual/debugger/gui/gui.qbs @@ -1,6 +1,6 @@ QtApplication { name: "Manual debugger gui test" - Depends { name: "qtc" } + Depends { name: "Qt.widgets" } files: [ diff --git a/tests/manual/debugger/simple/simple_test_app.qbs b/tests/manual/debugger/simple/simple_test_app.qbs index e6b19d8bcf8..59cf3fe3074 100644 --- a/tests/manual/debugger/simple/simple_test_app.qbs +++ b/tests/manual/debugger/simple/simple_test_app.qbs @@ -2,11 +2,9 @@ import qbs.File import qbs.FileInfo CppApplication { - condition: qtc.withAutotests name: "Manual Test Simple Application" targetName: "simple_test_app" - Depends { name: "qtc" } Depends { name: "Qt.core" } Depends { name: "Qt.core-private"; required: false; condition: Qt.core.versionMajor > 4 } Depends { name: "Qt.core5compat"; condition: Qt.core.versionMajor > 5 } diff --git a/tests/manual/debugger/simple/simple_test_plugin.qbs b/tests/manual/debugger/simple/simple_test_plugin.qbs index c06bc83112b..20ff3609fcf 100644 --- a/tests/manual/debugger/simple/simple_test_plugin.qbs +++ b/tests/manual/debugger/simple/simple_test_plugin.qbs @@ -1,11 +1,11 @@ import qbs.FileInfo DynamicLibrary { - condition: qtc.withAutotests + condition: !qtc.present || qtc.withAutotests name: "Manual Test Simple Plugin" targetName: "simple_test_plugin" - Depends { name: "qtc" } + Depends { name: "qtc"; required: false } Depends { name: "Qt.core" } files: [ "simple_test_plugin.cpp" ] diff --git a/tests/manual/deviceshell/deviceshell.qbs b/tests/manual/deviceshell/deviceshell.qbs index 9a4409793fe..205c83a11f6 100644 --- a/tests/manual/deviceshell/deviceshell.qbs +++ b/tests/manual/deviceshell/deviceshell.qbs @@ -1,22 +1,19 @@ import qbs.FileInfo -Project { - QtcManualtest { - name: "DeviceShell manualtest" +QtcManualTest { + name: "DeviceShell manualtest" - Depends { name: "Utils" } - Depends { name: "app_version_header" } + Depends { name: "Utils" } + Depends { name: "app_version_header" } - files: [ - "tst_deviceshell.cpp", - ] - cpp.defines: { - var defines = base; - var absLibExecPath = FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix, - qtc.ide_libexec_path); - var relLibExecPath = FileInfo.relativePath(destinationDirectory, absLibExecPath); - defines.push('TEST_RELATIVE_LIBEXEC_PATH="' + relLibExecPath + '"'); - return defines; - } + cpp.defines: { + var defines = base; + var absLibExecPath = FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix, + qtc.ide_libexec_path); + var relLibExecPath = FileInfo.relativePath(destinationDirectory, absLibExecPath); + defines.push('TEST_RELATIVE_LIBEXEC_PATH="' + relLibExecPath + '"'); + return defines; } + + files: "tst_deviceshell.cpp" } diff --git a/tests/manual/fakevim/fakevim.qbs b/tests/manual/fakevim/fakevim.qbs index 77e7253830a..051f1a04fc6 100644 --- a/tests/manual/fakevim/fakevim.qbs +++ b/tests/manual/fakevim/fakevim.qbs @@ -1,6 +1,6 @@ import qbs.FileInfo -QtcManualtest { +QtcManualTest { name: "Manual FakeVim test" type: ["application"] @@ -11,9 +11,7 @@ QtcManualtest { cpp.defines: base.concat(["FAKEVIM_STANDALONE"]) cpp.includePaths: fakeVimDir - files: [ - "main.cpp" - ] + files: "main.cpp" Group { name: "FakeVim files" diff --git a/tests/manual/manual.qbs b/tests/manual/manual.qbs index b8a37c9356e..ba774823c12 100644 --- a/tests/manual/manual.qbs +++ b/tests/manual/manual.qbs @@ -1,7 +1,7 @@ Project { - name: "QtcManualtests" + name: "QtcManualTests" - condition: project.withAutotests // FIXME: Why are these not QtcManualTests? + qbsSearchPaths: "qbs" references: [ "debugger/gui/gui.qbs", diff --git a/tests/manual/pluginview/plugins/plugin1/plugin1.qbs b/tests/manual/pluginview/plugins/plugin1/plugin1.qbs index e709f0208ae..1698504808d 100644 --- a/tests/manual/pluginview/plugins/plugin1/plugin1.qbs +++ b/tests/manual/pluginview/plugins/plugin1/plugin1.qbs @@ -1,6 +1,6 @@ import qbs.FileInfo -QtcManualtest { +QtcManualTest { name: "Manual test plugin1" targetName: "plugin1" type: [ "dynamiclibrary" ] diff --git a/tests/manual/pluginview/plugins/plugin2/plugin2.qbs b/tests/manual/pluginview/plugins/plugin2/plugin2.qbs index 4c97412990c..c1dad909b0a 100644 --- a/tests/manual/pluginview/plugins/plugin2/plugin2.qbs +++ b/tests/manual/pluginview/plugins/plugin2/plugin2.qbs @@ -1,6 +1,6 @@ import qbs.FileInfo -QtcManualtest { +QtcManualTest { name: "Manual test plugin2" targetName: "plugin2" type: [ "dynamiclibrary" ] diff --git a/tests/manual/pluginview/plugins/plugin3/plugin3.qbs b/tests/manual/pluginview/plugins/plugin3/plugin3.qbs index 659fcda5063..69f309bfcda 100644 --- a/tests/manual/pluginview/plugins/plugin3/plugin3.qbs +++ b/tests/manual/pluginview/plugins/plugin3/plugin3.qbs @@ -1,6 +1,6 @@ import qbs.FileInfo -QtcManualtest { +QtcManualTest { name: "Manual test plugin3" targetName: "plugin3" type: [ "dynamiclibrary" ] diff --git a/tests/manual/pluginview/pluginview.qbs b/tests/manual/pluginview/pluginview.qbs index e7ea64bf5be..ba6baa53f86 100644 --- a/tests/manual/pluginview/pluginview.qbs +++ b/tests/manual/pluginview/pluginview.qbs @@ -1,7 +1,7 @@ Project { name: "Manual plugin test" - QtcManualtest { + QtcManualTest { name: "Manual plugin view test" Depends { name: "ExtensionSystem" } diff --git a/tests/manual/proparser/testreader.qbs b/tests/manual/proparser/testreader.qbs index 4d71ff0f21a..daf1ae94930 100644 --- a/tests/manual/proparser/testreader.qbs +++ b/tests/manual/proparser/testreader.qbs @@ -1,4 +1,4 @@ -QtcManualtest { +QtcManualTest { name: "Manual ProParser test" Depends { name: "Qt.core" } @@ -18,9 +18,7 @@ QtcManualtest { cpp.dynamicLibraries: "advapi32" } - files: [ - "main.cpp", - ] + files: "main.cpp" Group { name: "ProParser files" diff --git a/tests/manual/qbs/imports/CppApplication.qbs b/tests/manual/qbs/imports/CppApplication.qbs new file mode 100644 index 00000000000..e72e8fb2d06 --- /dev/null +++ b/tests/manual/qbs/imports/CppApplication.qbs @@ -0,0 +1 @@ +QtcManualTest {} diff --git a/tests/manual/qbs/imports/QtApplication.qbs b/tests/manual/qbs/imports/QtApplication.qbs new file mode 100644 index 00000000000..e72e8fb2d06 --- /dev/null +++ b/tests/manual/qbs/imports/QtApplication.qbs @@ -0,0 +1 @@ +QtcManualTest {} diff --git a/tests/manual/shootout/shootout.qbs b/tests/manual/shootout/shootout.qbs index 85626c5b0d8..6a89a374899 100644 --- a/tests/manual/shootout/shootout.qbs +++ b/tests/manual/shootout/shootout.qbs @@ -1,7 +1,5 @@ -QtcManualtest { +QtcManualTest { name: "Manual debugger shootout test" - files: [ - "tst_codesize.cpp", - ] + files: "tst_codesize.cpp" } diff --git a/tests/manual/spinner/spinner.qbs b/tests/manual/spinner/spinner.qbs index 39b644da067..4cb1b386146 100644 --- a/tests/manual/spinner/spinner.qbs +++ b/tests/manual/spinner/spinner.qbs @@ -1,13 +1,11 @@ import qbs.FileInfo -QtcManualtest { +QtcManualTest { name: "Spinner example" type: ["application"] Depends { name: "Qt"; submodules: ["widgets"] } Depends { name: "Spinner" } - files: [ - "main.cpp", - ] + files: "main.cpp" } diff --git a/tests/manual/subdirfilecontainer/subdirfilecontainer.qbs b/tests/manual/subdirfilecontainer/subdirfilecontainer.qbs index 8fde030160a..2fade953d35 100644 --- a/tests/manual/subdirfilecontainer/subdirfilecontainer.qbs +++ b/tests/manual/subdirfilecontainer/subdirfilecontainer.qbs @@ -1,15 +1,13 @@ import qbs.FileInfo -QtcManualtest { +QtcManualTest { name: "Manual SubDirFileContainer test" type: ["application"] Depends { name: "Utils" } Depends { name: "app_version_header" } - files: [ - "tst_subdirfilecontainer.cpp", - ] + files: "tst_subdirfilecontainer.cpp" cpp.defines: { var defines = base; diff --git a/tests/manual/tasking/demo/demo.qbs b/tests/manual/tasking/demo/demo.qbs index 9cf856bca21..3da7c13b056 100644 --- a/tests/manual/tasking/demo/demo.qbs +++ b/tests/manual/tasking/demo/demo.qbs @@ -1,6 +1,6 @@ import qbs.FileInfo -QtcManualtest { +QtcManualTest { name: "Tasking demo" type: ["application"] diff --git a/tests/manual/tasking/imagescaling/imagescaling.qbs b/tests/manual/tasking/imagescaling/imagescaling.qbs index ea0698c7292..b2287ffad8f 100644 --- a/tests/manual/tasking/imagescaling/imagescaling.qbs +++ b/tests/manual/tasking/imagescaling/imagescaling.qbs @@ -1,6 +1,4 @@ -import qbs.FileInfo - -QtcManualtest { +QtcManualTest { name: "Tasking imagescaling" type: ["application"] diff --git a/tests/manual/widgets/crumblepath/crumblepath.qbs b/tests/manual/widgets/crumblepath/crumblepath.qbs index c9b32a0810f..1f6b68e8b60 100644 --- a/tests/manual/widgets/crumblepath/crumblepath.qbs +++ b/tests/manual/widgets/crumblepath/crumblepath.qbs @@ -3,13 +3,10 @@ import "../common/common.qbs" as Common CppApplication { name: "Manual Test Utils CrumblePath" - Depends { name: "qtc" } Depends { name: "Core" } Depends { name: "Utils" } - files: [ - "tst_manual_widgets_crumblepath.cpp", - ] + files: "tst_manual_widgets_crumblepath.cpp" Common {} } diff --git a/tests/manual/widgets/infolabel/infolabel.qbs b/tests/manual/widgets/infolabel/infolabel.qbs index dfba3bd9ef7..df4aaf1a329 100644 --- a/tests/manual/widgets/infolabel/infolabel.qbs +++ b/tests/manual/widgets/infolabel/infolabel.qbs @@ -3,13 +3,10 @@ import "../common/common.qbs" as Common CppApplication { name: "Manual Test Utils InfoLabel" - Depends { name: "qtc" } Depends { name: "Core" } Depends { name: "Utils" } - files: [ - "tst_manual_widgets_infolabel.cpp", - ] + files: "tst_manual_widgets_infolabel.cpp" Common {} } diff --git a/tests/manual/widgets/layoutbuilder/layoutbuilder.qbs b/tests/manual/widgets/layoutbuilder/layoutbuilder.qbs index f51ad6883d8..6ebe176fb9b 100644 --- a/tests/manual/widgets/layoutbuilder/layoutbuilder.qbs +++ b/tests/manual/widgets/layoutbuilder/layoutbuilder.qbs @@ -1,12 +1,8 @@ - CppApplication { name: "Manual Test Utils LayoutBuilder" - Depends { name: "qtc" } Depends { name: "Core" } Depends { name: "Utils" } - files: [ - "tst_manual_widgets_layoutbuilder.cpp", - ] + files: "tst_manual_widgets_layoutbuilder.cpp" } diff --git a/tests/manual/widgets/manhattanstyle/manhattanstyle.qbs b/tests/manual/widgets/manhattanstyle/manhattanstyle.qbs index c04bd03e89f..ffa13e98a06 100644 --- a/tests/manual/widgets/manhattanstyle/manhattanstyle.qbs +++ b/tests/manual/widgets/manhattanstyle/manhattanstyle.qbs @@ -3,13 +3,10 @@ import "../common/common.qbs" as Common CppApplication { name: "Manual Test Utils ManhattanStyle" - Depends { name: "qtc" } Depends { name: "Core" } Depends { name: "Utils" } - files: [ - "tst_manual_widgets_manhattanstyle.cpp", - ] + files: "tst_manual_widgets_manhattanstyle.cpp" Common {} } diff --git a/tests/manual/widgets/tracing/tracing.qbs b/tests/manual/widgets/tracing/tracing.qbs index 95e661910ce..3dcde3acdcd 100644 --- a/tests/manual/widgets/tracing/tracing.qbs +++ b/tests/manual/widgets/tracing/tracing.qbs @@ -3,15 +3,12 @@ import "../common/common.qbs" as Common CppApplication { name: "Manual Test Tracing" - Depends { name: "qtc" } Depends { name: "Qt.quick" } Depends { name: "Tracing" } Depends { name: "Utils" } Depends { name: "Core" } - files: [ - "tst_manual_widgets_tracing.cpp", - ] + files: "tst_manual_widgets_tracing.cpp" Common {} } From 8af902b5b72ef5dda5eb80fe35aea224d64d1b2c Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 20 Sep 2023 12:39:25 +0200 Subject: [PATCH 1181/1777] ScreenRecorder: Turn lambda into member function m_rect has otherwise invalid data at some point. Change-Id: I325522123ca4b0240235cf95cd6fb026f4ab9c98 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/screenrecorder/cropandtrim.cpp | 21 +++++++++++---------- src/plugins/screenrecorder/cropandtrim.h | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp index 218029c9356..e7b113cc194 100644 --- a/src/plugins/screenrecorder/cropandtrim.cpp +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -59,15 +59,6 @@ void CropScene::initMouseInteraction(const QPoint &imagePos) return inRange; }; - static const auto inMoveArea = [this, &imagePos] { - const qreal minRatio = 0.25; // 25% width / height of selection - const int minAbsoluteSize = 40; - QRect result(0, 0, qMax(int(m_cropRect.width() * minRatio), minAbsoluteSize), - qMax(int(m_cropRect.height() * minRatio), minAbsoluteSize)); - result.moveCenter(m_cropRect.center()); - return result.contains(imagePos); - }; - m_mouse.clickOffset = {}; if (inGripRange(imagePos.x(), m_cropRect.left(), m_mouse.clickOffset.rx())) { m_mouse.margin = EdgeLeft; @@ -81,7 +72,7 @@ void CropScene::initMouseInteraction(const QPoint &imagePos) } else if (inGripRange(imagePos.y(), m_cropRect.bottom(), m_mouse.clickOffset.ry())) { m_mouse.margin = EdgeBottom; m_mouse.cursorShape = Qt::SizeVerCursor; - } else if (!fullySelected() && inMoveArea()) { + } else if (!fullySelected() && activeMoveArea().contains(imagePos)) { m_mouse.margin = Move; m_mouse.cursorShape = Qt::SizeAllCursor; m_mouse.clickOffset = imagePos - m_cropRect.topLeft(); @@ -138,6 +129,16 @@ QPoint CropScene::toImagePos(const QPoint &widgetPos) const return {(widgetPos.x() - lineWidth) * dpr, (widgetPos.y() - lineWidth) * dpr}; } +QRect CropScene::activeMoveArea() const +{ + const qreal minRatio = 0.22; // At least 22% width and height of current selection + const int minAbsoluteSize = 40; + QRect result(0, 0, qMax(int(m_cropRect.width() * minRatio), minAbsoluteSize), + qMax(int(m_cropRect.height() * minRatio), minAbsoluteSize)); + result.moveCenter(m_cropRect.center()); + return result; +} + QRect CropScene::cropRect() const { return m_cropRect; diff --git a/src/plugins/screenrecorder/cropandtrim.h b/src/plugins/screenrecorder/cropandtrim.h index c4e4ab465f8..b017a6bba94 100644 --- a/src/plugins/screenrecorder/cropandtrim.h +++ b/src/plugins/screenrecorder/cropandtrim.h @@ -52,6 +52,7 @@ private: void initMouseInteraction(const QPoint &pos); void updateBuffer(); QPoint toImagePos(const QPoint &widgetCoordinate) const; + QRect activeMoveArea() const; const static int m_gripWidth = 8; QRect m_cropRect; From 4b29b43a2a948ae01bb6f13039c0202cfc0ad86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= <tor.arne.vestbo@qt.io> Date: Tue, 19 Sep 2023 23:55:12 +0200 Subject: [PATCH 1182/1777] lldb: Add summary providers using consistent module name When the lldbbridge is imported from the debug_script.py in qtbase, it's imported using the module name 'qt', to distinguish it from when Qt Creator imports the bridge. So when we add the synthetic child provider, we need to use the 'qt' module name. This fixes the warning: The provided class does not exist - please define it before attempting to use this synthetic provider If for some reason the lldbbridge.py is imported into a LLDB session directly, we mirror the 'lldbbrdige' module name to 'qt' as well, so that the class reference still holds. Change-Id: I531b10fd5e10eb0c2acd6014169a02ba3157c704 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- share/qtcreator/debugger/lldbbridge.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 4c5cec7a0ed..df1f57dc1c4 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -2437,6 +2437,12 @@ class SyntheticChildrenProvider(SummaryProvider): def __lldb_init_module(debugger, internal_dict): # Module is being imported in an LLDB session + + if not __name__ == 'qt': + # Make available under global 'qt' name for consistency, + # and so we can refer to SyntheticChildrenProvider below. + internal_dict['qt'] = internal_dict[__name__] + dumper = SummaryDumper.initialize() type_category = 'Qt' @@ -2462,14 +2468,10 @@ def __lldb_init_module(debugger, internal_dict): # Synthetic children debugger.HandleCommand("type synthetic add -x '^Q.*$' -l %s -w %s" - % ("lldbbridge.SyntheticChildrenProvider", type_category)) + % ("qt.SyntheticChildrenProvider", type_category)) debugger.HandleCommand('type category enable %s' % type_category) - if not __name__ == 'qt': - # Make available under global 'qt' name for consistency - internal_dict['qt'] = internal_dict[__name__] - if __name__ == "lldbbridge": try: From 1a64a179aa2bf6cc26d58456a67075b1496e21dd Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Wed, 20 Sep 2023 13:23:41 +0200 Subject: [PATCH 1183/1777] ProjectExplorer tests: Do not use QVERIFY2() for std::expected values QVERIFY2 evaluates its second argument even if the first one is false. Uncovered by 768f12e0334efeb350aedb94fb893a737bb1309f. Change-Id: I57a175791c21fe416efaabd69920cdcb5e6da38c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/projectexplorer/project.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 4333680bb76..320df648064 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -1500,8 +1500,10 @@ void ProjectExplorerPlugin::testProject_multipleBuildConfigs() QVERIFY(tempDir->isValid()); const FilePath projectDir = FilePath::fromString(tempDir->path() + "/generic-project"); const auto copyResult = FilePath(":/projectexplorer/testdata/generic-project").copyRecursively(projectDir); + if (!copyResult) + qDebug() << copyResult.error(); + QVERIFY(copyResult); - QVERIFY2(copyResult, qPrintable(copyResult.error())); const QFileInfoList files = QDir(projectDir.toString()).entryInfoList(QDir::Files | QDir::Dirs); for (const QFileInfo &f : files) QFile(f.absoluteFilePath()).setPermissions(f.permissions() | QFile::WriteUser); @@ -1562,7 +1564,9 @@ void ProjectExplorerPlugin::testSourceToBinaryMapping() if (!projectDir.exists()) { const auto result = FilePath(":/projectexplorer/testdata/multi-target-project") .copyRecursively(projectDir); - QVERIFY2(result, qPrintable(result.error())); + if (!result) + qDebug() << result.error(); + QVERIFY(result); const QFileInfoList files = QDir(projectDir.toString()).entryInfoList(QDir::Files); for (const QFileInfo &f : files) QFile(f.absoluteFilePath()).setPermissions(f.permissions() | QFile::WriteUser); From 726cc7f5cd52c298bf517e9e201215fe1bf61d6b Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 15 Sep 2023 11:54:47 +0200 Subject: [PATCH 1184/1777] PE: Make GccToolChainFactory::autoDetectToolchains static In preparation of running it in another thread. Change-Id: I2cbac1bd45885416f8ee0dfdc95a4998e87d2f8e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 109 +++++++++++++------ src/plugins/projectexplorer/gcctoolchain.h | 17 +-- src/plugins/projectexplorer/toolchain.cpp | 7 +- src/plugins/projectexplorer/toolchain.h | 8 +- 4 files changed, 95 insertions(+), 46 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 2628b506d21..6794234e820 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1184,10 +1184,20 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co && tc->compilerCommand().fileName() != "c89-gcc" && tc->compilerCommand().fileName() != "c99-gcc"; }; - tcs.append(autoDetectToolchains("g++", DetectVariants::Yes, Constants::CXX_LANGUAGE_ID, - Constants::GCC_TOOLCHAIN_TYPEID, detector, tcChecker)); - tcs.append(autoDetectToolchains("gcc", DetectVariants::Yes, Constants::C_LANGUAGE_ID, - Constants::GCC_TOOLCHAIN_TYPEID, detector, tcChecker)); + tcs.append(autoDetectToolchains("g++", + DetectVariants::Yes, + Constants::CXX_LANGUAGE_ID, + Constants::GCC_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor(), + tcChecker)); + tcs.append(autoDetectToolchains("gcc", + DetectVariants::Yes, + Constants::C_LANGUAGE_ID, + Constants::GCC_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor(), + tcChecker)); return tcs; } @@ -1207,7 +1217,7 @@ Toolchains GccToolChainFactory::detectForImport(const ToolChainDescription &tcd) || (fileName == "c++" && !resolvedSymlinksFileName.contains("clang"))); if (isCCompiler || isCxxCompiler) { - return autoDetectToolChain(tcd, [](const ToolChain *tc) { + return autoDetectToolChain(tcd, toolchainConstructor(), [](const ToolChain *tc) { return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor; }); } @@ -1282,13 +1292,13 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, return compilerPaths; } -Toolchains GccToolChainFactory::autoDetectToolchains( - const QString &compilerName, - DetectVariants detectVariants, - const Id language, - const Id requiredTypeId, - const ToolchainDetector &detector, - const ToolchainChecker &checker) const +Toolchains GccToolChainFactory::autoDetectToolchains(const QString &compilerName, + DetectVariants detectVariants, + const Id language, + const Id requiredTypeId, + const ToolchainDetector &detector, + const ToolChainConstructor &constructor, + const ToolchainChecker &checker) { const FilePaths compilerPaths = findCompilerCandidates(detector, compilerName, detectVariants == DetectVariants::Yes); @@ -1331,7 +1341,7 @@ Toolchains GccToolChainFactory::autoDetectToolchains( } if (!alreadyExists) { const QList<ToolChain *> newToolchains - = autoDetectToolChain({compilerPath, language}, checker); + = autoDetectToolChain({compilerPath, language}, constructor, checker); result << newToolchains; existingCandidates << newToolchains; } @@ -1341,7 +1351,8 @@ Toolchains GccToolChainFactory::autoDetectToolchains( } Toolchains GccToolChainFactory::autoDetectToolChain(const ToolChainDescription &tcd, - const ToolchainChecker &checker) const + const ToolChainConstructor &constructor, + const ToolchainChecker &checker) { Toolchains result; @@ -1361,7 +1372,7 @@ Toolchains GccToolChainFactory::autoDetectToolChain(const ToolChainDescription & systemEnvironment, macros); for (const Abi &abi : detectedAbis.supportedAbis) { - std::unique_ptr<GccToolChain> tc(dynamic_cast<GccToolChain *>(create())); + std::unique_ptr<GccToolChain> tc(dynamic_cast<GccToolChain *>(constructor())); if (!tc) return result; @@ -1704,18 +1715,30 @@ Toolchains ClangToolChainFactory::autoDetect(const ToolchainDetector &detector) Toolchains tcs; Toolchains known = detector.alreadyKnown; - tcs.append(autoDetectToolchains("clang++", DetectVariants::Yes, Constants::CXX_LANGUAGE_ID, - Constants::CLANG_TOOLCHAIN_TYPEID, detector)); - tcs.append(autoDetectToolchains("clang", DetectVariants::Yes, Constants::C_LANGUAGE_ID, - Constants::CLANG_TOOLCHAIN_TYPEID, detector)); + tcs.append(autoDetectToolchains("clang++", + DetectVariants::Yes, + Constants::CXX_LANGUAGE_ID, + Constants::CLANG_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor())); + tcs.append(autoDetectToolchains("clang", + DetectVariants::Yes, + Constants::C_LANGUAGE_ID, + Constants::CLANG_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor())); known.append(tcs); const FilePath compilerPath = Core::ICore::clangExecutable(CLANG_BINDIR); if (!compilerPath.isEmpty()) { const FilePath clang = compilerPath.parentDir().pathAppended("clang").withExecutableSuffix(); - tcs.append(autoDetectToolchains(clang.toString(), DetectVariants::No, - Constants::C_LANGUAGE_ID, Constants::CLANG_TOOLCHAIN_TYPEID, - ToolchainDetector(known, detector.device, detector.searchPaths))); + tcs.append( + autoDetectToolchains(clang.toString(), + DetectVariants::No, + Constants::C_LANGUAGE_ID, + Constants::CLANG_TOOLCHAIN_TYPEID, + ToolchainDetector(known, detector.device, detector.searchPaths), + toolchainConstructor())); } return tcs; @@ -1735,7 +1758,7 @@ Toolchains ClangToolChainFactory::detectForImport(const ToolChainDescription &tc || (fileName == "c++" && resolvedSymlinksFileName.contains("clang"))); if (isCCompiler || isCxxCompiler) { - return autoDetectToolChain(tcd); + return autoDetectToolChain(tcd, toolchainConstructor()); } return {}; } @@ -1901,11 +1924,20 @@ Toolchains MingwToolChainFactory::autoDetect(const ToolchainDetector &detector) static const auto tcChecker = [](const ToolChain *tc) { return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; }; - Toolchains result = autoDetectToolchains( - "g++", DetectVariants::Yes, Constants::CXX_LANGUAGE_ID, - Constants::MINGW_TOOLCHAIN_TYPEID, detector, tcChecker); - result += autoDetectToolchains("gcc", DetectVariants::Yes, Constants::C_LANGUAGE_ID, - Constants::MINGW_TOOLCHAIN_TYPEID, detector, tcChecker); + Toolchains result = autoDetectToolchains("g++", + DetectVariants::Yes, + Constants::CXX_LANGUAGE_ID, + Constants::MINGW_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor(), + tcChecker); + result += autoDetectToolchains("gcc", + DetectVariants::Yes, + Constants::C_LANGUAGE_ID, + Constants::MINGW_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor(), + tcChecker); return result; } @@ -1922,7 +1954,7 @@ Toolchains MingwToolChainFactory::detectForImport(const ToolChainDescription &tc || (fileName.startsWith("c++") || fileName.endsWith("c++"))); if (cCompiler || cxxCompiler) { - return autoDetectToolChain(tcd, [](const ToolChain *tc) { + return autoDetectToolChain(tcd, toolchainConstructor(), [](const ToolChain *tc) { return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; }); } @@ -1986,11 +2018,18 @@ LinuxIccToolChainFactory::LinuxIccToolChainFactory() Toolchains LinuxIccToolChainFactory::autoDetect(const ToolchainDetector &detector) const { - Toolchains result - = autoDetectToolchains("icpc", DetectVariants::No, Constants::CXX_LANGUAGE_ID, - Constants::LINUXICC_TOOLCHAIN_TYPEID, detector); - result += autoDetectToolchains("icc", DetectVariants::Yes, Constants::C_LANGUAGE_ID, - Constants::LINUXICC_TOOLCHAIN_TYPEID, detector); + Toolchains result = autoDetectToolchains("icpc", + DetectVariants::No, + Constants::CXX_LANGUAGE_ID, + Constants::LINUXICC_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor()); + result += autoDetectToolchains("icc", + DetectVariants::Yes, + Constants::C_LANGUAGE_ID, + Constants::LINUXICC_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor()); return result; } @@ -1999,7 +2038,7 @@ Toolchains LinuxIccToolChainFactory::detectForImport(const ToolChainDescription const QString fileName = tcd.compilerPath.completeBaseName(); if ((tcd.language == Constants::CXX_LANGUAGE_ID && fileName.startsWith("icpc")) || (tcd.language == Constants::C_LANGUAGE_ID && fileName.startsWith("icc"))) { - return autoDetectToolChain(tcd); + return autoDetectToolChain(tcd, toolchainConstructor()); } return {}; } diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index beb736be4d0..554ccc78fd5 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -263,13 +263,16 @@ public: protected: enum class DetectVariants { Yes, No }; using ToolchainChecker = std::function<bool(const ToolChain *)>; - Toolchains autoDetectToolchains( - const QString &compilerName, DetectVariants detectVariants, const Utils::Id language, - const Utils::Id requiredTypeId, const ToolchainDetector &detector, - const ToolchainChecker &checker = {}) const; - Toolchains autoDetectToolChain( - const ToolChainDescription &tcd, - const ToolchainChecker &checker = {}) const; + static Toolchains autoDetectToolchains(const QString &compilerName, + DetectVariants detectVariants, + const Utils::Id language, + const Utils::Id requiredTypeId, + const ToolchainDetector &detector, + const ToolChainConstructor &constructor, + const ToolchainChecker &checker = {}); + static Toolchains autoDetectToolChain(const ToolChainDescription &tcd, + const ToolChainConstructor &constructor, + const ToolchainChecker &checker = {}); }; class ClangToolChainFactory : public GccToolChainFactory diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 6bb6e1acf85..f4ceb06720d 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -672,11 +672,16 @@ void ToolChainFactory::setSupportsAllLanguages(bool supportsAllLanguages) } void ToolChainFactory::setToolchainConstructor - (const std::function<ToolChain *()> &toolchainContructor) + (const ToolChainConstructor &toolchainContructor) { m_toolchainConstructor = toolchainContructor; } +ToolChainFactory::ToolChainConstructor ToolChainFactory::toolchainConstructor() const +{ + return m_toolchainConstructor; +} + void ToolChainFactory::setUserCreatable(bool userCreatable) { m_userCreatable = userCreatable; diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index a2251d866c0..d63f3476dfc 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -260,7 +260,7 @@ public: virtual Toolchains detectForImport(const ToolChainDescription &tcd) const; virtual bool canCreate() const; - virtual ToolChain *create() const; + ToolChain *create() const; ToolChain *restore(const Utils::Store &data); @@ -279,7 +279,9 @@ protected: void setSupportedToolChainType(const Utils::Id &supportedToolChainType); void setSupportedLanguages(const QList<Utils::Id> &supportedLanguages); void setSupportsAllLanguages(bool supportsAllLanguages); - void setToolchainConstructor(const std::function<ToolChain *()> &constructor); + using ToolChainConstructor = std::function<ToolChain *()>; + void setToolchainConstructor(const ToolChainConstructor &constructor); + ToolChainConstructor toolchainConstructor() const; class Candidate { public: @@ -300,7 +302,7 @@ private: QList<Utils::Id> m_supportedLanguages; bool m_supportsAllLanguages = false; bool m_userCreatable = false; - std::function<ToolChain *()> m_toolchainConstructor; + ToolChainConstructor m_toolchainConstructor; }; } // namespace ProjectExplorer From 77b368045c5a6a332c2dae25fef567f8b373bfa3 Mon Sep 17 00:00:00 2001 From: Sami Shalayel <sami.shalayel@qt.io> Date: Mon, 4 Sep 2023 13:46:04 +0200 Subject: [PATCH 1185/1777] qmljs: use qmlls for 'go to definition' Use the language client in qmljseditorWidget to do 'go to definition' aka 'findLinkAt', when the language client is enabled. Also move static helper method getQmllsClient up in the file. Task-number: QTCREATORBUG-29567 Change-Id: I4f9132ba5f6bffc5090f3b1f7f6ccfd0c7b40e2a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Semih Yavuz <semih.yavuz@qt.io> --- src/plugins/qmljseditor/qmljseditor.cpp | 30 +++++++++++++++---------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 1e0cc5d29ae..e6ceb513072 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -94,6 +94,18 @@ using namespace Utils; namespace QmlJSEditor { +static LanguageClient::Client *getQmllsClient(const Utils::FilePath &fileName) +{ + // the value in disableBuiltinCodemodel is only valid when useQmlls is enabled + if (QmlJsEditingSettings::get().qmllsSettings().useQmlls + && !QmlJsEditingSettings::get().qmllsSettings().disableBuiltinCodemodel) + return nullptr; + + auto client = LanguageClient::LanguageClientManager::clientForFilePath(fileName); + return client; +} + + // // QmlJSEditorWidget // @@ -741,9 +753,14 @@ void QmlJSEditorWidget::inspectElementUnderCursor() const void QmlJSEditorWidget::findLinkAt(const QTextCursor &cursor, const Utils::LinkHandler &processLinkCallback, - bool /*resolveTarget*/, + bool resolveTarget, bool /*inNextSplit*/) { + if (auto client = getQmllsClient(textDocument()->filePath())) { + client->findLinkAt(textDocument(), cursor, processLinkCallback, resolveTarget); + return; + } + const SemanticInfo semanticInfo = m_qmlJsEditorDocument->semanticInfo(); if (! semanticInfo.isValid()) return processLinkCallback(Utils::Link()); @@ -859,17 +876,6 @@ void QmlJSEditorWidget::findLinkAt(const QTextCursor &cursor, processLinkCallback(Utils::Link()); } -static LanguageClient::Client *getQmllsClient(const Utils::FilePath &fileName) -{ - // the value in disableBuiltinCodemodel is only valid when useQmlls is enabled - if (QmlJsEditingSettings::get().qmllsSettings().useQmlls - && !QmlJsEditingSettings::get().qmllsSettings().disableBuiltinCodemodel) - return nullptr; - - auto client = LanguageClient::LanguageClientManager::clientForFilePath(fileName); - return client; -} - void QmlJSEditorWidget::findUsages() { const Utils::FilePath fileName = textDocument()->filePath(); From a998269d7eeac2ded09dafdacd18de614e0a5a0d Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 20 Sep 2023 14:17:18 +0200 Subject: [PATCH 1186/1777] CMakePM: Expand help for variables, properties and modules Not only CMake functions. Change-Id: Icd21eb39a55533261f2b5c170a9dbd38a640e3e9 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakeeditor.cpp | 74 ++++++++++--------- .../cmakefilecompletionassist.cpp | 5 +- src/plugins/cmakeprojectmanager/cmaketool.cpp | 20 ++--- src/plugins/cmakeprojectmanager/cmaketool.h | 20 ++--- 4 files changed, 63 insertions(+), 56 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 98e58da8815..1d6fbf0e2a2 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -2,11 +2,13 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "cmakeeditor.h" +#include "cmaketoolmanager.h" #include "cmakeautocompleter.h" #include "cmakebuildsystem.h" #include "cmakefilecompletionassist.h" #include "cmakeindenter.h" +#include "cmakekitaspect.h" #include "cmakeprojectconstants.h" #include <coreplugin/actionmanager/actioncontainer.h> @@ -16,6 +18,7 @@ #include <projectexplorer/buildsystem.h> #include <projectexplorer/project.h> #include <projectexplorer/projecttree.h> +#include <projectexplorer/target.h> #include <texteditor/textdocument.h> #include <texteditor/texteditoractionhandler.h> #include <utils/textutils.h> @@ -36,52 +39,55 @@ namespace CMakeProjectManager::Internal { class CMakeEditor : public TextEditor::BaseTextEditor { + CMakeKeywords m_keywords; public: + CMakeEditor(); void contextHelp(const HelpCallback &callback) const final; }; +CMakeEditor::CMakeEditor() +{ + CMakeTool *tool = nullptr; + if (auto project = ProjectTree::currentProject()) + if (auto bs = ProjectTree::currentBuildSystem()) + tool = CMakeKitAspect::cmakeTool(bs->target()->kit()); + if (!tool) + tool = CMakeToolManager::defaultCMakeTool(); + + if (tool) + m_keywords = tool->keywords(); +} + void CMakeEditor::contextHelp(const HelpCallback &callback) const { - int pos = position(); + const QString word = Utils::Text::wordUnderCursor(editorWidget()->textCursor()); + auto helpPrefix = [this](const QString &word) { + if (m_keywords.includeStandardModules.contains(word)) + return "module/"; + if (m_keywords.functions.contains(word)) + return "command/"; + if (m_keywords.variables.contains(word)) + return "variable/"; + if (m_keywords.directoryProperties.contains(word)) + return "prop_dir/"; + if (m_keywords.targetProperties.contains(word)) + return "prop_tgt/"; + if (m_keywords.sourceProperties.contains(word)) + return "prop_sf/"; + if (m_keywords.testProperties.contains(word)) + return "prop_test/"; + if (m_keywords.properties.contains(word)) + return "prop_gbl/"; - QChar chr; - do { - --pos; - if (pos < 0) - break; - chr = characterAt(pos); - if (chr == QLatin1Char('(')) { - BaseTextEditor::contextHelp(callback); - return; - } - } while (chr.unicode() != QChar::ParagraphSeparator); + return "unknown/"; + }; - ++pos; - chr = characterAt(pos); - while (chr.isSpace()) { - ++pos; - chr = characterAt(pos); - } - int begin = pos; - - do { - ++pos; - chr = characterAt(pos); - } while (chr.isLetterOrNumber() || chr == QLatin1Char('_')); - int end = pos; - - while (chr.isSpace()) { - ++pos; - chr = characterAt(pos); - } - - // Not a command - if (chr != QLatin1Char('(')) { + const QString id = helpPrefix(word) + word; + if (id.startsWith("unknown/")) { BaseTextEditor::contextHelp(callback); return; } - const QString id = "command/" + textAt(begin, end - begin).toLower(); callback({{id, Utils::Text::wordUnderCursor(editorWidget()->textCursor())}, {}, {}, diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index b50d3128363..92abd32f510 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -139,9 +139,10 @@ static int findPathStart(const AssistInterface *interface) return ++pos; } -QList<AssistProposalItemInterface *> generateList(const QStringList &words, const QIcon &icon) +template<typename T> +QList<AssistProposalItemInterface *> generateList(const T &words, const QIcon &icon) { - return transform(words, [&icon](const QString &word) -> AssistProposalItemInterface * { + return transform<QList>(words, [&icon](const QString &word) -> AssistProposalItemInterface * { AssistProposalItem *item = new AssistProposalItem(); item->setText(word); item->setIcon(icon); diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 65068e74ee2..f992a82bfbb 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -280,17 +280,17 @@ CMakeKeywords CMakeTool::keywords() } CMakeKeywords keywords; - keywords.functions = m_introspection->m_functions; - keywords.variables = m_introspection->m_variables; + keywords.functions = Utils::toSet(m_introspection->m_functions); + keywords.variables = Utils::toSet(m_introspection->m_variables); keywords.functionArgs = m_introspection->m_functionArgs; - keywords.properties = m_introspection->m_properties; - keywords.generatorExpressions = m_introspection->m_generatorExpressions; - keywords.directoryProperties = m_introspection->m_directoryProperties; - keywords.sourceProperties = m_introspection->m_sourceProperties; - keywords.targetProperties = m_introspection->m_targetProperties; - keywords.testProperties = m_introspection->m_testProperties; - keywords.includeStandardModules = m_introspection->m_includeStandardModules; - keywords.findModules = m_introspection->m_findModules; + keywords.properties = Utils::toSet(m_introspection->m_properties); + keywords.generatorExpressions = Utils::toSet(m_introspection->m_generatorExpressions); + keywords.directoryProperties = Utils::toSet(m_introspection->m_directoryProperties); + keywords.sourceProperties = Utils::toSet(m_introspection->m_sourceProperties); + keywords.targetProperties = Utils::toSet(m_introspection->m_targetProperties); + keywords.testProperties = Utils::toSet(m_introspection->m_testProperties); + keywords.includeStandardModules = Utils::toSet(m_introspection->m_includeStandardModules); + keywords.findModules = Utils::toSet(m_introspection->m_findModules); return keywords; } diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index d090b6fd97f..7a1b8fbc828 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -21,16 +21,16 @@ namespace Internal { class IntrospectionData; } struct CMAKE_EXPORT CMakeKeywords { - QStringList variables; - QStringList functions; - QStringList properties; - QStringList generatorExpressions; - QStringList directoryProperties; - QStringList sourceProperties; - QStringList targetProperties; - QStringList testProperties; - QStringList includeStandardModules; - QStringList findModules; + QSet<QString> variables; + QSet<QString> functions; + QSet<QString> properties; + QSet<QString> generatorExpressions; + QSet<QString> directoryProperties; + QSet<QString> sourceProperties; + QSet<QString> targetProperties; + QSet<QString> testProperties; + QSet<QString> includeStandardModules; + QSet<QString> findModules; QMap<QString, QStringList> functionArgs; }; From a51380c2fdff6a7f80b25d13de0a643c36eef5b1 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 20 Sep 2023 22:39:50 +0200 Subject: [PATCH 1187/1777] CMakePM: Add policy support for help and code completion Change-Id: I82d291639fe890602bba61eded9d1dfd7d38ca41 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 2 ++ .../cmakeprojectmanager/cmakefilecompletionassist.cpp | 3 +++ src/plugins/cmakeprojectmanager/cmaketool.cpp | 7 +++++++ src/plugins/cmakeprojectmanager/cmaketool.h | 1 + 4 files changed, 13 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 1d6fbf0e2a2..57aaf49f2a1 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -78,6 +78,8 @@ void CMakeEditor::contextHelp(const HelpCallback &callback) const return "prop_test/"; if (m_keywords.properties.contains(word)) return "prop_gbl/"; + if (m_keywords.policies.contains(word)) + return "policy/"; return "unknown/"; }; diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 92abd32f510..b32ae13d9ab 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -264,6 +264,9 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); } + if (functionName == "if" || functionName == "elseif" || functionName == "cmake_policy") + items.append(generateList(keywords.policies, m_variableIcon)); + if (functionName.contains("path") || functionName.contains("file") || functionName.contains("add_executable") || functionName.contains("add_library") || functionName == "include" || functionName == "add_subdirectory" diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index f992a82bfbb..22e980cd9c0 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -100,6 +100,7 @@ public: QStringList m_testProperties; QStringList m_includeStandardModules; QStringList m_findModules; + QStringList m_policies; CMakeTool::Version m_version; }; @@ -276,6 +277,11 @@ CMakeKeywords CMakeTool::keywords() Utils::sort(m_introspection->m_variables); } + runCMake(proc, {"--help-policy-list"}, 5); + if (proc.result() == ProcessResult::FinishedWithSuccess) + m_introspection->m_policies = Utils::filtered(proc.cleanedStdOut().split('\n'), + std::not_fn(&QString::isEmpty)); + parseSyntaxHighlightingXml(); } @@ -291,6 +297,7 @@ CMakeKeywords CMakeTool::keywords() keywords.testProperties = Utils::toSet(m_introspection->m_testProperties); keywords.includeStandardModules = Utils::toSet(m_introspection->m_includeStandardModules); keywords.findModules = Utils::toSet(m_introspection->m_findModules); + keywords.policies = Utils::toSet(m_introspection->m_policies); return keywords; } diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index 7a1b8fbc828..0ad9780971b 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -31,6 +31,7 @@ struct CMAKE_EXPORT CMakeKeywords QSet<QString> testProperties; QSet<QString> includeStandardModules; QSet<QString> findModules; + QSet<QString> policies; QMap<QString, QStringList> functionArgs; }; From c3308ab8b8361565bede356ac6f787599fa8804a Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Wed, 13 Sep 2023 13:26:22 +0200 Subject: [PATCH 1188/1777] Doc: Turn "Specifying Editor Settings" into a how-to topic Task-number: QTCREATORBUG-29361 Change-Id: I6d252735f745b1b9d43ef0f872c08ed9b58cf921 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../src/editors/creator-editors-options.qdoc | 2 +- .../creator-coding-edit-mode.qdoc | 2 +- .../creator-projects-settings-editor.qdoc | 38 +++++-------------- .../creator-projects-settings-overview.qdoc | 19 +++++----- doc/qtcreator/src/qtcreator-toc.qdoc | 2 +- 5 files changed, 22 insertions(+), 41 deletions(-) diff --git a/doc/qtcreator/src/editors/creator-editors-options.qdoc b/doc/qtcreator/src/editors/creator-editors-options.qdoc index e74f3d1d31a..027b41bdef6 100644 --- a/doc/qtcreator/src/editors/creator-editors-options.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-options.qdoc @@ -31,7 +31,7 @@ \image qtcreator-editor-settings.png "Editor settings" \if defined(qtcreator) - For more information, see \l{Specifying Editor Settings}. + For more information, see \l{Specify editor settings}. \endif You can also specify indentation settings separately for C++ and QML files diff --git a/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc b/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc index c17613f38f5..6602548e7b1 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc @@ -103,7 +103,7 @@ To set the line endings to use for a project, select \uicontrol Projects > \uicontrol {Project Settings} > \uicontrol Editor. - For more information, see \l {Specifying Editor Settings}. + For more information, see \l {Specify editor settings}. \section2 Managing Language Servers diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc index 3f146ca9c01..fc35f3391e8 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,21 +8,17 @@ // ********************************************************************** /*! - \previouspage creator-run-settings.html \page creator-editor-settings.html - \nextpage creator-code-style-settings.html + \previouspage creator-how-tos.html - \title Specifying Editor Settings + \ingroup creator-how-to-projects + + \title Specify editor settings \QC uses the \l{Editing MIME Types}{MIME type} of the file to determine which mode and editor to use for opening the file. For example, \QC opens .txt files in \uicontrol Edit mode in the text editor. - You can configure the text editor according to your needs. You can specify - editor behavior either globally for all projects or separately for each - project. To specify global editor behavior, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Behavior. - To configure the text editor behavior for the current project: \list 1 @@ -40,24 +36,8 @@ Click \uicontrol {Restore Global} to revert to the global settings. - For more information about the settings, see: - - \list - - \li \l{Indenting Text or Code} - - \li \l{File Encoding} - - \li \l{Selecting Line Ending Style} - - \li \l{Moving to Symbol Definition or Declaration} - - \li \l{Configuring Fonts} - - \li \l{Highlighting and Folding Blocks} - - \li \l{View function tooltips} - - \endlist - + \sa {Configuring Fonts}, {File Encoding}, + {Moving to Symbol Definition or Declaration}, {Indenting Text or Code}, + {Highlighting and Folding Blocks}, {Selecting Line Ending Style}, + {View function tooltips} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc index 82bad206b69..37e7cd0ab25 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc @@ -33,18 +33,19 @@ \section1 Overriding Global Preferences - You can override the following global preferences for each project: + In \uicontrol {Project Settings}, you can override global preferences for + the project: \list - \li \l{Specifying Editor Settings}{Editor} - \li \l{Specifying Code Style}{Code Style} - \li \l{Specifying Dependencies}{Dependencies} - \li \l{Specifying Environment Settings}{Environment} - \li \l{Using Custom Output Parsers}{Custom Output Parsers} - \li \l{Applying Refactoring Actions}{Quick Fixes} - \li \l{Using Clang Tools}{Clang Tools} - \li \l{To-Do Entries}{To-Do} (experimental) \li \l{Parsing C++ Files with the Clang Code Model}{Clangd} + \li \l{Using Clang Tools}{Clang Tools} + \li \l{Specifying Code Style}{Code Style} + \li \l{Using Custom Output Parsers}{Custom Output Parsers} + \li \l{Specifying Dependencies}{Dependencies} + \li \l{Specify editor settings}{Editor} + \li \l{Specifying Environment Settings}{Environment} + \li \l{Applying Refactoring Actions}{Quick Fixes} + \li \l{To-Do Entries}{To-Do} (experimental) \endlist If you have multiple projects open in \QC, select the project to configure diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 9d25af66dad..c5a20c5cd4e 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -43,7 +43,6 @@ \li \l{Conan Build Configuration} \endlist \li \l{Specifying Run Settings} - \li \l{Specifying Editor Settings} \li \l{Specifying Code Style} \li \l{Specifying Dependencies} \li \l{Specifying Environment Settings} @@ -224,6 +223,7 @@ \li \l {Develop Qt for Python applications} \li \l {Open projects} \li \l {Select the build system} + \li \l {Specify editor settings} \li \l {Specify project contents} \li \l {Use project wizards} \endlist From 49f987f79c869ba32b9a151f2a63845f0fdb8ca5 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 20 Sep 2023 10:19:45 +0200 Subject: [PATCH 1189/1777] Utils: Update gui when setting default value Allows the undoable to receive the right value Change-Id: I77f1bc0d76ca2c5fc2268cacfa7e42ce5787bd92 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 46bea69bad1..c817ec34b48 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -296,7 +296,8 @@ public: { m_default = value; m_internal = value; - internalToBuffer(); // Might be more than a plain copy. + if (internalToBuffer()) // Might be more than a plain copy. + bufferToGui(); } bool isDefaultValue() const override From cd8bc98e5238dff4a75a19790c60ed279320d482 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 19 Sep 2023 11:24:19 +0200 Subject: [PATCH 1190/1777] Utils: Add StringListAspect editor Change-Id: I0d6713f75967fb56132f89772aa48fa1de2368af Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 110 +++++++++++++++++++++++++++++++++++-- src/libs/utils/aspects.h | 3 + 2 files changed, 108 insertions(+), 5 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index a8d8f554403..081021ce05c 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -20,6 +20,7 @@ #include "variablechooser.h" #include <QAction> +#include <QApplication> #include <QButtonGroup> #include <QCheckBox> #include <QComboBox> @@ -38,6 +39,8 @@ #include <QSettings> #include <QSpinBox> #include <QStandardItemModel> +#include <QStringListModel> +#include <QStyledItemDelegate> #include <QTextEdit> #include <QUndoStack> @@ -899,6 +902,7 @@ public: class StringListAspectPrivate { public: + UndoableValue<QStringList> undoable; }; class FilePathListAspectPrivate @@ -2392,13 +2396,94 @@ StringListAspect::StringListAspect(AspectContainer *container) */ StringListAspect::~StringListAspect() = default; -/*! - \reimp -*/ +class StringListDelegate : public QStyledItemDelegate +{ +public: + void paint(QPainter *painter, + const QStyleOptionViewItem &option, + const QModelIndex &index) const override + { + QStyleOptionViewItem opt = option; + initStyleOption(&opt, index); + if (opt.text.isEmpty()) { + opt.state &= ~QStyle::State_Enabled; + opt.state &= ~QStyle::State_Selected; + opt.text = Tr::tr("Double click to add new entry ..."); + } + + const QWidget *widget = opt.widget; + QStyle *style = widget ? widget->style() : QApplication::style(); + style->drawControl(QStyle::CE_ItemViewItem, &opt, painter, widget); + + if (opt.state & QStyle::State_Selected) { + Utils::Icons::EDIT_CLEAR.icon().paint(painter, + opt.rect.adjusted(0, 2, -2, -2), + Qt::AlignRight | Qt::AlignVCenter); + } + } + + bool eventFilter(QObject *object, QEvent *event) override + { + return QStyledItemDelegate::eventFilter(object, event); + } + + bool editorEvent(QEvent *event, + QAbstractItemModel *model, + const QStyleOptionViewItem &option, + const QModelIndex &index) override + { + if (event->type() == QEvent::MouseButtonRelease) { + auto mouseEvent = static_cast<QMouseEvent *>(event); + QRect r = option.rect; + r.setLeft(option.rect.width() - option.rect.height()); + r.setRight(option.rect.width()); + if (r.contains(mouseEvent->pos())) { + removeCallback(index.row()); + return true; + } + } + return QStyledItemDelegate::editorEvent(event, model, option, index); + } + + std::function<void(int index)> removeCallback; +}; + void StringListAspect::addToLayout(LayoutItem &parent) { - Q_UNUSED(parent) - // TODO - when needed. + QListView *listView = new QListView(); + listView->setMaximumHeight(100); + listView->setMinimumHeight(100); + listView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + auto delegate = new StringListDelegate; + listView->setItemDelegate(delegate); + + registerSubWidget(listView); + + QStringListModel *model = new QStringListModel(listView); + model->setStringList(value() << ""); + + connect(&d->undoable.m_signal, &UndoSignaller::changed, model, [model, this] { + model->setStringList(d->undoable.get() << ""); + }); + + connect(model, &QStringListModel::dataChanged, [this, model] { + QStringList newList = model->stringList(); + newList.removeIf([](const QString &s) { return s.isEmpty(); }); + pushUndo(d->undoable.set(newList)); + handleGuiChanged(); + }); + + delegate->removeCallback = [this, model](int index) { + QStringList newList = model->stringList(); + newList.removeAt(index); + newList.removeIf([](const QString &s) { return s.isEmpty(); }); + pushUndo(d->undoable.set(newList)); + handleGuiChanged(); + }; + + listView->setModel(model); + + parent.addItem(listView); } void StringListAspect::appendValue(const QString &s, bool allowDuplicates) @@ -2434,6 +2519,21 @@ void StringListAspect::removeValues(const QStringList &values) setValue(val); } +bool StringListAspect::guiToBuffer() +{ + const QStringList newValue = d->undoable.get(); + if (newValue != m_buffer) { + m_buffer = newValue; + return true; + } + return false; +} + +void StringListAspect::bufferToGui() +{ + d->undoable.setWithoutUndo(m_buffer); +} + /*! \class Utils::FilePathListAspect \inmodule QtCreator diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index c817ec34b48..303b9519892 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -780,6 +780,9 @@ public: void appendValues(const QStringList &values, bool allowDuplicates = true); void removeValues(const QStringList &values); + bool guiToBuffer() override; + void bufferToGui() override; + private: std::unique_ptr<Internal::StringListAspectPrivate> d; }; From f4f75224b7fbafca1decb1befacb05d20467a0b5 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 21 Sep 2023 07:35:21 +0000 Subject: [PATCH 1191/1777] Revert "Utils: Add StringListAspect editor" This reverts commit cd8bc98e5238dff4a75a19790c60ed279320d482. Reason for revert: Breaks compilation Change-Id: I27ef9b718adf8cd4b8ac72e77161515ff637bd6e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 110 ++----------------------------------- src/libs/utils/aspects.h | 3 - 2 files changed, 5 insertions(+), 108 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 081021ce05c..a8d8f554403 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -20,7 +20,6 @@ #include "variablechooser.h" #include <QAction> -#include <QApplication> #include <QButtonGroup> #include <QCheckBox> #include <QComboBox> @@ -39,8 +38,6 @@ #include <QSettings> #include <QSpinBox> #include <QStandardItemModel> -#include <QStringListModel> -#include <QStyledItemDelegate> #include <QTextEdit> #include <QUndoStack> @@ -902,7 +899,6 @@ public: class StringListAspectPrivate { public: - UndoableValue<QStringList> undoable; }; class FilePathListAspectPrivate @@ -2396,94 +2392,13 @@ StringListAspect::StringListAspect(AspectContainer *container) */ StringListAspect::~StringListAspect() = default; -class StringListDelegate : public QStyledItemDelegate -{ -public: - void paint(QPainter *painter, - const QStyleOptionViewItem &option, - const QModelIndex &index) const override - { - QStyleOptionViewItem opt = option; - initStyleOption(&opt, index); - if (opt.text.isEmpty()) { - opt.state &= ~QStyle::State_Enabled; - opt.state &= ~QStyle::State_Selected; - opt.text = Tr::tr("Double click to add new entry ..."); - } - - const QWidget *widget = opt.widget; - QStyle *style = widget ? widget->style() : QApplication::style(); - style->drawControl(QStyle::CE_ItemViewItem, &opt, painter, widget); - - if (opt.state & QStyle::State_Selected) { - Utils::Icons::EDIT_CLEAR.icon().paint(painter, - opt.rect.adjusted(0, 2, -2, -2), - Qt::AlignRight | Qt::AlignVCenter); - } - } - - bool eventFilter(QObject *object, QEvent *event) override - { - return QStyledItemDelegate::eventFilter(object, event); - } - - bool editorEvent(QEvent *event, - QAbstractItemModel *model, - const QStyleOptionViewItem &option, - const QModelIndex &index) override - { - if (event->type() == QEvent::MouseButtonRelease) { - auto mouseEvent = static_cast<QMouseEvent *>(event); - QRect r = option.rect; - r.setLeft(option.rect.width() - option.rect.height()); - r.setRight(option.rect.width()); - if (r.contains(mouseEvent->pos())) { - removeCallback(index.row()); - return true; - } - } - return QStyledItemDelegate::editorEvent(event, model, option, index); - } - - std::function<void(int index)> removeCallback; -}; - +/*! + \reimp +*/ void StringListAspect::addToLayout(LayoutItem &parent) { - QListView *listView = new QListView(); - listView->setMaximumHeight(100); - listView->setMinimumHeight(100); - listView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - auto delegate = new StringListDelegate; - listView->setItemDelegate(delegate); - - registerSubWidget(listView); - - QStringListModel *model = new QStringListModel(listView); - model->setStringList(value() << ""); - - connect(&d->undoable.m_signal, &UndoSignaller::changed, model, [model, this] { - model->setStringList(d->undoable.get() << ""); - }); - - connect(model, &QStringListModel::dataChanged, [this, model] { - QStringList newList = model->stringList(); - newList.removeIf([](const QString &s) { return s.isEmpty(); }); - pushUndo(d->undoable.set(newList)); - handleGuiChanged(); - }); - - delegate->removeCallback = [this, model](int index) { - QStringList newList = model->stringList(); - newList.removeAt(index); - newList.removeIf([](const QString &s) { return s.isEmpty(); }); - pushUndo(d->undoable.set(newList)); - handleGuiChanged(); - }; - - listView->setModel(model); - - parent.addItem(listView); + Q_UNUSED(parent) + // TODO - when needed. } void StringListAspect::appendValue(const QString &s, bool allowDuplicates) @@ -2519,21 +2434,6 @@ void StringListAspect::removeValues(const QStringList &values) setValue(val); } -bool StringListAspect::guiToBuffer() -{ - const QStringList newValue = d->undoable.get(); - if (newValue != m_buffer) { - m_buffer = newValue; - return true; - } - return false; -} - -void StringListAspect::bufferToGui() -{ - d->undoable.setWithoutUndo(m_buffer); -} - /*! \class Utils::FilePathListAspect \inmodule QtCreator diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 303b9519892..c817ec34b48 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -780,9 +780,6 @@ public: void appendValues(const QStringList &values, bool allowDuplicates = true); void removeValues(const QStringList &values); - bool guiToBuffer() override; - void bufferToGui() override; - private: std::unique_ptr<Internal::StringListAspectPrivate> d; }; From ada5aacedbb71bad18962e22f637a59973ccc5d6 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 19 Sep 2023 11:24:58 +0200 Subject: [PATCH 1192/1777] Docker: Add extra arguments setting Change-Id: I3cd30001defb99ce6f23b31935dc3a21ce60a256 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/docker/dockerdevice.cpp | 8 ++++++++ src/plugins/docker/dockerdevice.h | 1 + src/plugins/docker/dockerdevicewidget.cpp | 1 + 3 files changed, 10 insertions(+) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index e2646dcaf30..af00987c7d5 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -98,6 +98,7 @@ const char DockerDeviceMappedPaths[] = "DockerDeviceMappedPaths"; const char DockerDeviceKeepEntryPoint[] = "DockerDeviceKeepEntryPoint"; const char DockerDeviceEnableLldbFlags[] = "DockerDeviceEnableLldbFlags"; const char DockerDeviceClangDExecutable[] = "DockerDeviceClangDExecutable"; +const char DockerDeviceExtraArgs[] = "DockerDeviceExtraCreateArguments"; class ContainerShell : public Utils::DeviceShell { @@ -187,6 +188,11 @@ DockerDeviceSettings::DockerDeviceSettings() mounts.setToolTip(Tr::tr("Maps paths in this list one-to-one to the docker container.")); mounts.setPlaceHolderText(Tr::tr("Host directories to mount into the container")); + extraArgs.setSettingsKey(DockerDeviceExtraArgs); + extraArgs.setLabelText(Tr::tr("Extra arguments:")); + extraArgs.setDefaultValue({}); + extraArgs.setToolTip(Tr::tr("Extra arguments to pass to docker create.")); + clangdExecutable.setSettingsKey(DockerDeviceClangDExecutable); clangdExecutable.setLabelText(Tr::tr("Clangd Executable:")); clangdExecutable.setAllowPathFromDevice(true); @@ -812,6 +818,8 @@ expected_str<QString> DockerDevicePrivate::createContainer() if (deviceSettings->enableLldbFlags()) dockerCreate.addArgs({"--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"}); + dockerCreate.addArgs(deviceSettings->extraArgs(), CommandLine::Raw); + dockerCreate.addArg(deviceSettings->repoAndTag()); qCDebug(dockerDeviceLog).noquote() << "RUNNING: " << dockerCreate.toUserOutput(); diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 51fc05be28a..4996a5e95b2 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -33,6 +33,7 @@ public: Utils::BoolAspect enableLldbFlags{this}; Utils::FilePathAspect clangdExecutable{this}; Utils::StringSelectionAspect network{this}; + Utils::StringAspect extraArgs{this}; Utils::TextDisplay containerStatus{this}; }; diff --git a/src/plugins/docker/dockerdevicewidget.cpp b/src/plugins/docker/dockerdevicewidget.cpp index eb910b41956..e4b7ecdcb3f 100644 --- a/src/plugins/docker/dockerdevicewidget.cpp +++ b/src/plugins/docker/dockerdevicewidget.cpp @@ -168,6 +168,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) deviceSettings->enableLldbFlags, br, deviceSettings->clangdExecutable, br, deviceSettings->network, br, + deviceSettings->extraArgs, br, Column { pathListLabel, deviceSettings->mounts, From 399c2f92d6125be356c8ec480ddbabf9eb81e4dc Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 19 Sep 2023 14:50:55 +0200 Subject: [PATCH 1193/1777] Utils: Don't store pointer to aspect label widget Change-Id: Ieb8a04357fbdbc909fed79e33ef6a1d0cef2d721 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 41 +++++++++---------- src/libs/utils/aspects.h | 5 ++- .../projectexplorer/environmentaspect.h | 3 +- .../environmentaspectwidget.cpp | 3 +- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index a8d8f554403..427e9fc0cbc 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -77,7 +77,6 @@ public: QString m_labelText; QPixmap m_labelPixmap; QIcon m_icon; - QPointer<QLabel> m_label; // Owned by configuration widget QPointer<QAction> m_action; // Owned by us. AspectContainer *m_container = nullptr; // Not owned by us. @@ -225,26 +224,33 @@ void BaseAspect::setVisible(bool visible) } } -void BaseAspect::setupLabel() +QLabel *BaseAspect::createLabel() { - QTC_ASSERT(!d->m_label, delete d->m_label); if (d->m_labelText.isEmpty() && d->m_labelPixmap.isNull()) - return; - d->m_label = new QLabel(d->m_labelText); - d->m_label->setTextInteractionFlags(d->m_label->textInteractionFlags() - | Qt::TextSelectableByMouse); - connect(d->m_label, &QLabel::linkActivated, this, [this](const QString &link) { + return nullptr; + + auto label = new QLabel(d->m_labelText); + label->setTextInteractionFlags(label->textInteractionFlags() | Qt::TextSelectableByMouse); + connect(label, &QLabel::linkActivated, this, [this](const QString &link) { emit labelLinkActivated(link); }); if (!d->m_labelPixmap.isNull()) - d->m_label->setPixmap(d->m_labelPixmap); - registerSubWidget(d->m_label); + label->setPixmap(d->m_labelPixmap); + registerSubWidget(label); + + connect(this, &BaseAspect::labelTextChanged, label, [label, this] { + label->setText(d->m_labelText); + }); + connect(this, &BaseAspect::labelPixmapChanged, label, [label, this] { + label->setPixmap(d->m_labelPixmap); + }); + + return label; } void BaseAspect::addLabeledItem(LayoutItem &parent, QWidget *widget) { - setupLabel(); - if (QLabel *l = label()) { + if (QLabel *l = createLabel()) { l->setBuddy(widget); parent.addItem(l); parent.addItem(Span(std::max(d->m_spanX - 1, 1), LayoutItem(widget))); @@ -260,8 +266,7 @@ void BaseAspect::addLabeledItem(LayoutItem &parent, QWidget *widget) void BaseAspect::setLabelText(const QString &labelText) { d->m_labelText = labelText; - if (d->m_label) - d->m_label->setText(labelText); + emit labelTextChanged(); } /*! @@ -271,8 +276,7 @@ void BaseAspect::setLabelText(const QString &labelText) void BaseAspect::setLabelPixmap(const QPixmap &labelPixmap) { d->m_labelPixmap = labelPixmap; - if (d->m_label) - d->m_label->setPixmap(labelPixmap); + emit labelPixmapChanged(); } void BaseAspect::setIcon(const QIcon &icon) @@ -291,11 +295,6 @@ QString BaseAspect::labelText() const return d->m_labelText; } -QLabel *BaseAspect::label() const -{ - return d->m_label.data(); -} - QString BaseAspect::toolTip() const { return d->m_tooltip; diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index c817ec34b48..9dd7e357c7c 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -207,6 +207,8 @@ signals: void labelLinkActivated(const QString &link); void checkedChanged(); void enabledChanged(); + void labelTextChanged(); + void labelPixmapChanged(); protected: virtual bool internalToBuffer(); @@ -216,8 +218,7 @@ protected: virtual void handleGuiChanged(); - QLabel *label() const; - void setupLabel(); + QLabel *createLabel(); void addLabeledItem(Layouting::LayoutItem &parent, QWidget *widget); void setDataCreatorHelper(const DataCreator &creator) const; diff --git a/src/plugins/projectexplorer/environmentaspect.h b/src/plugins/projectexplorer/environmentaspect.h index 6e36d7db63b..26dd43f6a41 100644 --- a/src/plugins/projectexplorer/environmentaspect.h +++ b/src/plugins/projectexplorer/environmentaspect.h @@ -62,8 +62,7 @@ public: Utils::Environment environment; }; - using Utils::BaseAspect::setupLabel; - using Utils::BaseAspect::label; + using Utils::BaseAspect::createLabel; signals: void baseEnvironmentChanged(); diff --git a/src/plugins/projectexplorer/environmentaspectwidget.cpp b/src/plugins/projectexplorer/environmentaspectwidget.cpp index c167cd4e52f..d47b4e82cc3 100644 --- a/src/plugins/projectexplorer/environmentaspectwidget.cpp +++ b/src/plugins/projectexplorer/environmentaspectwidget.cpp @@ -37,8 +37,7 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect) auto label = [aspect]() { if (aspect->labelText().isEmpty()) aspect->setLabelText(Tr::tr("Base environment for this run configuration:")); - aspect->setupLabel(); - return aspect->label(); + return aspect->createLabel(); }; m_baseLayout->addWidget(label()); From 979e446e846946cec8ce68575a7b2254d12caedc Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Wed, 20 Sep 2023 14:08:26 +0200 Subject: [PATCH 1194/1777] CppEditor: Do not add "rename" action to refactor menu It's available directly in the context menu these days. Amends 28742774fecf696181c4b38e3dd5e52eb1311ce2. Change-Id: If727d2baa87b3d55df31a7d1fbe64bc3e93dc24b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cppeditor/cppeditorwidget.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index 0cb1aadb05c..acc0c478034 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -1089,7 +1089,6 @@ protected: QMenu *CppEditorWidget::createRefactorMenu(QWidget *parent) const { auto *menu = new QMenu(Tr::tr("&Refactor"), parent); - menu->addAction(ActionManager::command(TextEditor::Constants::RENAME_SYMBOL)->action()); // ### enable // updateSemanticInfo(m_semanticHighlighter->semanticInfo(currentSource())); From 493d1873d222725df56a026dcb7f958db7078d97 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Wed, 20 Sep 2023 14:31:46 +0200 Subject: [PATCH 1195/1777] CppEditor: Populate the refactor menu on demand That is, collect the quickfixes only when the refactor menu is expanded, not when opening the context menu. Task-number: QTCREATORBUG-29611 Change-Id: Ib827940ecbe8878e0b695e4f453926f759b05572 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cppeditor/cppeditorwidget.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index acc0c478034..a06977ae5c1 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -1089,11 +1089,15 @@ protected: QMenu *CppEditorWidget::createRefactorMenu(QWidget *parent) const { auto *menu = new QMenu(Tr::tr("&Refactor"), parent); + connect(menu, &QMenu::aboutToShow, this, [this, menu] { + menu->disconnect(this); - // ### enable - // updateSemanticInfo(m_semanticHighlighter->semanticInfo(currentSource())); + // ### enable + // updateSemanticInfo(m_semanticHighlighter->semanticInfo(currentSource())); + + if (!isSemanticInfoValidExceptLocalUses()) + return; - if (isSemanticInfoValidExceptLocalUses()) { d->m_useSelectionsUpdater.abortSchedule(); const CppUseSelectionsUpdater::RunnerInfo runnerInfo = d->m_useSelectionsUpdater.update(); @@ -1118,7 +1122,7 @@ QMenu *CppEditorWidget::createRefactorMenu(QWidget *parent) const case CppUseSelectionsUpdater::RunnerInfo::Invalid: QTC_CHECK(false && "Unexpected CppUseSelectionsUpdater runner result"); } - } + }); return menu; } From d3f060a75418fa4d50ff217d92ae15f58af0024a Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 19 Sep 2023 13:21:35 +0200 Subject: [PATCH 1196/1777] Docker: Show create command line to user Change-Id: I740d2647e2033c841fe6926b273b06ce45ecb0e7 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/docker/dockerdevice.cpp | 26 ++++++++++--- src/plugins/docker/dockerdevice.h | 2 + src/plugins/docker/dockerdevicewidget.cpp | 47 ++++++++++++++--------- 3 files changed, 51 insertions(+), 24 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index af00987c7d5..8083c5350c7 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -278,6 +278,8 @@ public: ~DockerDevicePrivate() { stopCurrentContainer(); } + CommandLine createCommandLine(); + RunResult runInShell(const CommandLine &cmd, const QByteArray &stdInData = {}); bool updateContainerAccess(); @@ -501,6 +503,11 @@ void DockerProcessImpl::sendControlSignal(ControlSignal controlSignal) } } +CommandLine DockerDevice::createCommandLine() const +{ + return d->createCommandLine(); +} + IDeviceWidget *DockerDevice::createWidget() { return new DockerDeviceWidget(sharedFromThis()); @@ -783,11 +790,8 @@ bool DockerDevicePrivate::isImageAvailable() const return false; } -expected_str<QString> DockerDevicePrivate::createContainer() +CommandLine DockerDevicePrivate::createCommandLine() { - if (!isImageAvailable()) - return make_unexpected(Tr::tr("Image \"%1\" is not available.").arg(repoAndTag())); - const QString display = HostOsInfo::isLinuxHost() ? QString(":0") : QString("host.docker.internal:0"); CommandLine dockerCreate{settings().dockerBinaryPath(), @@ -822,9 +826,19 @@ expected_str<QString> DockerDevicePrivate::createContainer() dockerCreate.addArg(deviceSettings->repoAndTag()); - qCDebug(dockerDeviceLog).noquote() << "RUNNING: " << dockerCreate.toUserOutput(); + return dockerCreate; +} + +expected_str<QString> DockerDevicePrivate::createContainer() +{ + if (!isImageAvailable()) + return make_unexpected(Tr::tr("Image \"%1\" is not available.").arg(repoAndTag())); + + const CommandLine cmdLine = createCommandLine(); + + qCDebug(dockerDeviceLog).noquote() << "RUNNING: " << cmdLine.toUserOutput(); Process createProcess; - createProcess.setCommand(dockerCreate); + createProcess.setCommand(cmdLine); createProcess.runBlocking(); if (createProcess.result() != ProcessResult::FinishedWithSuccess) { diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 4996a5e95b2..7c170182160 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -54,6 +54,8 @@ public: return Ptr(new DockerDevice(std::move(settings))); } + Utils::CommandLine createCommandLine() const; + ProjectExplorer::IDeviceWidget *createWidget() override; QList<ProjectExplorer::Task> validate() const override; diff --git a/src/plugins/docker/dockerdevicewidget.cpp b/src/plugins/docker/dockerdevicewidget.cpp index e4b7ecdcb3f..fbb80bf640e 100644 --- a/src/plugins/docker/dockerdevicewidget.cpp +++ b/src/plugins/docker/dockerdevicewidget.cpp @@ -9,6 +9,7 @@ #include <utils/algorithm.h> #include <utils/clangutils.h> +#include <utils/commandline.h> #include <utils/environment.h> #include <utils/hostosinfo.h> #include <utils/layoutbuilder.h> @@ -137,6 +138,9 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) m_kitItemDetector.listAutoDetected(device->id().toString()); }); + auto createLineLabel = new QLabel(dockerDevice->createCommandLine().toUserOutput()); + createLineLabel->setWordWrap(true); + using namespace Layouting; // clang-format off @@ -156,25 +160,28 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) Tr::tr("Detection log:"), logView }; - - Form { - deviceSettings->repo, br, - deviceSettings->tag, br, - deviceSettings->imageId, br, - daemonStateLabel, m_daemonReset, m_daemonState, br, - Tr::tr("Container State:"), deviceSettings->containerStatus, br, - deviceSettings->useLocalUidGid, br, - deviceSettings->keepEntryPoint, br, - deviceSettings->enableLldbFlags, br, - deviceSettings->clangdExecutable, br, - deviceSettings->network, br, - deviceSettings->extraArgs, br, - Column { - pathListLabel, - deviceSettings->mounts, - }, br, - If { dockerDevice->isAutoDetected(), {}, {detectionControls} }, + Column { noMargin, + Form { + deviceSettings->repo, br, + deviceSettings->tag, br, + deviceSettings->imageId, br, + daemonStateLabel, m_daemonReset, m_daemonState, br, + Tr::tr("Container State:"), deviceSettings->containerStatus, br, + deviceSettings->useLocalUidGid, br, + deviceSettings->keepEntryPoint, br, + deviceSettings->enableLldbFlags, br, + deviceSettings->clangdExecutable, br, + deviceSettings->network, br, + deviceSettings->extraArgs, br, + Column { + pathListLabel, + deviceSettings->mounts, + }, br, + If { dockerDevice->isAutoDetected(), {}, {detectionControls} }, + noMargin, + },br, + Tr::tr("Command Line:"), createLineLabel, br, }.attachTo(this); // clang-format on @@ -185,6 +192,10 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) searchDirsLineEdit->setFocus(); }; QObject::connect(searchDirsComboBox, &QComboBox::activated, this, updateDirectoriesLineEdit); + + connect(deviceSettings, &AspectContainer::applied, this, [createLineLabel, dockerDevice] { + createLineLabel->setText(dockerDevice->createCommandLine().toUserOutput()); + }); } void DockerDeviceWidget::updateDaemonStateTexts() From 811792df58fc20e6a27c3e258834101f52d185b4 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 19 Sep 2023 15:31:08 +0200 Subject: [PATCH 1197/1777] Utils: Don't store widgets in BoolAspect Change-Id: I185dbb32ccae6bff4e222f7a9d9cd6ccd6bdbc69 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 88 +++++++++---------- src/libs/utils/aspects.h | 4 +- .../beautifier/clangformat/clangformat.cpp | 7 +- 3 files changed, 49 insertions(+), 50 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 427e9fc0cbc..ba6c7b69cd9 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -701,10 +701,6 @@ class BoolAspectPrivate { public: BoolAspect::LabelPlacement m_labelPlacement = BoolAspect::LabelPlacement::AtCheckBox; - QPointer<QAbstractButton> m_button; // Owned by configuration widget - QPointer<QGroupBox> m_groupBox; // For BoolAspects handling GroupBox check boxes - bool m_buttonIsAdopted = false; - UndoableValue<bool> m_undoable; }; @@ -1725,6 +1721,43 @@ BoolAspect::BoolAspect(AspectContainer *container) */ BoolAspect::~BoolAspect() = default; +void BoolAspect::addToLayoutHelper(Layouting::LayoutItem &parent, QAbstractButton *button) +{ + switch (d->m_labelPlacement) { + case LabelPlacement::Compact: + button->setText(labelText()); + parent.addItem(button); + break; + case LabelPlacement::AtCheckBox: + button->setText(labelText()); + parent.addItem(empty()); + parent.addItem(button); + break; + case LabelPlacement::InExtraLabel: + addLabeledItem(parent, button); + break; + } + + connect(button, &QAbstractButton::clicked, this, [button, this] { + pushUndo(d->m_undoable.set(button->isChecked())); + }); + + connect(&d->m_undoable.m_signal, &UndoSignaller::changed, button, [button, this] { + button->setChecked(d->m_undoable.get()); + handleGuiChanged(); + }); +} + +LayoutItem BoolAspect::adoptButton(QAbstractButton *button) +{ + LayoutItem parent; + + addToLayoutHelper(parent, button); + + bufferToGui(); + return parent; +} + /*! \reimp */ @@ -1732,45 +1765,11 @@ void BoolAspect::addToLayout(Layouting::LayoutItem &parent) { QTC_ASSERT(m_buffer == m_internal, m_buffer = m_internal); - if (!d->m_buttonIsAdopted) { - QTC_CHECK(!d->m_button); - d->m_button = createSubWidget<QCheckBox>(); - } - switch (d->m_labelPlacement) { - case LabelPlacement::Compact: - d->m_button->setText(labelText()); - parent.addItem(d->m_button.data()); - break; - case LabelPlacement::AtCheckBox: - d->m_button->setText(labelText()); - parent.addItem(empty()); - parent.addItem(d->m_button.data()); - break; - case LabelPlacement::InExtraLabel: - addLabeledItem(parent, d->m_button); - break; - } - - connect(d->m_button.data(), &QAbstractButton::clicked, this, [this] { - pushUndo(d->m_undoable.set(d->m_button->isChecked())); - }); - - connect(&d->m_undoable.m_signal, &UndoSignaller::changed, d->m_button, [this] { - d->m_button->setChecked(d->m_undoable.get()); - handleGuiChanged(); - }); + QCheckBox *checkBox = createSubWidget<QCheckBox>(); + addToLayoutHelper(parent, checkBox); bufferToGui(); } -void BoolAspect::adoptButton(QAbstractButton *button) -{ - QTC_ASSERT(button, return); - QTC_CHECK(!d->m_button); - d->m_button = button; - d->m_buttonIsAdopted = true; - registerSubWidget(button); -} - std::function<void (QObject *)> BoolAspect::groupChecker() { return [this](QObject *target) { @@ -1779,14 +1778,13 @@ std::function<void (QObject *)> BoolAspect::groupChecker() registerSubWidget(groupBox); groupBox->setCheckable(true); groupBox->setChecked(value()); - d->m_groupBox = groupBox; - connect(d->m_groupBox.data(), &QGroupBox::clicked, this, [this] { - pushUndo(d->m_undoable.set(d->m_groupBox->isChecked())); + connect(groupBox, &QGroupBox::clicked, this, [groupBox, this] { + pushUndo(d->m_undoable.set(groupBox->isChecked())); }); - connect(&d->m_undoable.m_signal, &UndoSignaller::changed, d->m_groupBox, [this] { - d->m_groupBox->setChecked(d->m_undoable.get()); + connect(&d->m_undoable.m_signal, &UndoSignaller::changed, groupBox, [groupBox, this] { + groupBox->setChecked(d->m_undoable.get()); handleGuiChanged(); }); bufferToGui(); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 9dd7e357c7c..c83dbe23405 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -438,9 +438,11 @@ public: LabelPlacement labelPlacement = LabelPlacement::InExtraLabel); void setLabelPlacement(LabelPlacement labelPlacement); - void adoptButton(QAbstractButton *button); + Layouting::LayoutItem adoptButton(QAbstractButton *button); private: + void addToLayoutHelper(Layouting::LayoutItem &parent, QAbstractButton *button); + void bufferToGui() override; bool guiToBuffer() override; diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index 6662a6423c5..2a2cad2f41d 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -244,8 +244,6 @@ public: QGroupBox *options = nullptr; auto predefinedStyleButton = new QRadioButton; - s.usePredefinedStyle.adoptButton(predefinedStyleButton); - auto customizedStyleButton = new QRadioButton(Tr::tr("Use customized style:")); auto styleButtonGroup = new QButtonGroup; @@ -261,7 +259,7 @@ public: auto fallbackBlob = Row { noMargin, Tr::tr("Fallback style:"), s.fallbackStyle }.emerge(); auto predefinedBlob = Column { noMargin, s.predefinedStyle, fallbackBlob }.emerge(); - + // clang-format off Column { Group { title(Tr::tr("Configuration")), @@ -274,12 +272,13 @@ public: title(Tr::tr("Options")), bindTo(&options), Form { - s.usePredefinedStyle, predefinedBlob, br, + s.usePredefinedStyle.adoptButton(predefinedStyleButton), predefinedBlob, br, customizedStyleButton, configurations, }, }, st }.attachTo(this); + // clang-format on if (s.usePredefinedStyle.value()) predefinedStyleButton->click(); From f3c84c6d4f77606b6340db197cb5d9b9fd5aa98c Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 21 Sep 2023 11:23:03 +0200 Subject: [PATCH 1198/1777] CMakeProjectManager: Fix warning about shadowing Amends a998269d7eeac2ded09dafdacd18de614e0a5a0d Change-Id: I5a36c3fc15e2913656a1d7bf7113ebd39cd6008c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 57aaf49f2a1..b0179b1714f 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -60,7 +60,6 @@ CMakeEditor::CMakeEditor() void CMakeEditor::contextHelp(const HelpCallback &callback) const { - const QString word = Utils::Text::wordUnderCursor(editorWidget()->textCursor()); auto helpPrefix = [this](const QString &word) { if (m_keywords.includeStandardModules.contains(word)) return "module/"; @@ -84,6 +83,7 @@ void CMakeEditor::contextHelp(const HelpCallback &callback) const return "unknown/"; }; + const QString word = Utils::Text::wordUnderCursor(editorWidget()->textCursor()); const QString id = helpPrefix(word) + word; if (id.startsWith("unknown/")) { BaseTextEditor::contextHelp(callback); From 813342b957d9463b72c1aeb476f5a0f3d8546540 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 21 Sep 2023 11:29:23 +0200 Subject: [PATCH 1199/1777] CMakeProjectManager: Fix implicit conversion warnings Amends a998269d7eeac2ded09dafdacd18de614e0a5a0d Change-Id: If6d0bda51030a39cb26ec1e270be2086a2bb54a1 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index b0179b1714f..dc174ac3a6f 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -133,7 +133,7 @@ static QString unescape(const QString &s) { QString result; int i = 0; - const int size = s.size(); + const qsizetype size = s.size(); while (i < size) { const QChar c = s.at(i); if (c == '\\' && i < size - 1) { @@ -164,7 +164,7 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, const QString block = cursor.block().text(); // check if the current position is commented out - const int hashPos = block.indexOf(QLatin1Char('#')); + const qsizetype hashPos = block.indexOf(QLatin1Char('#')); if (hashPos >= 0 && hashPos < column) return processLinkCallback(link); From c0d50cd00a21ca5a364c48051573dde5965ceb2d Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 21 Sep 2023 13:26:54 +0200 Subject: [PATCH 1200/1777] CMakePM: Remove subsequent call to wordUnderCursor Just use the value above it. Change-Id: I16e1e3217de6e03d7bf9f16e6966c9854bd68930 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index dc174ac3a6f..9664c9eda53 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -90,10 +90,7 @@ void CMakeEditor::contextHelp(const HelpCallback &callback) const return; } - callback({{id, Utils::Text::wordUnderCursor(editorWidget()->textCursor())}, - {}, - {}, - HelpItem::Unknown}); + callback({{id, word}, {}, {}, HelpItem::Unknown}); } // From 18a3a55d957fa9cd86d7570d88d2c0ae9a345a19 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <thomas.hartmann@qt.io> Date: Tue, 19 Sep 2023 14:13:56 +0200 Subject: [PATCH 1201/1777] QmlDesigner: One more missing qualification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I394e58b2cccdfbfcacd13ff2c5cefba8d4719ef4 Reviewed-by: Henning Gründl <henning.gruendl@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> (cherry picked from commit e156854fc38b61fcfa1b7aec533d92b5055663dd) Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../qtcreator/qmldesigner/connectionseditor/SuggestionPopup.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/connectionseditor/SuggestionPopup.qml b/share/qtcreator/qmldesigner/connectionseditor/SuggestionPopup.qml index 5bd01b37bbd..197b2c015aa 100644 --- a/share/qtcreator/qmldesigner/connectionseditor/SuggestionPopup.qml +++ b/share/qtcreator/qmldesigner/connectionseditor/SuggestionPopup.qml @@ -193,7 +193,7 @@ Controls.Popup { boundsMovement: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds - ScrollBar.vertical: HelperWidgets.ScrollBar { + Controls.ScrollBar.vertical: HelperWidgets.ScrollBar { id: treeScrollBar parent: treeView x: treeView.width - treeScrollBar.width From 87a3d9e063230dfb678ee3f427baba7ab63c7d1e Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen <miikka.heikkinen@qt.io> Date: Thu, 7 Sep 2023 12:04:59 +0300 Subject: [PATCH 1202/1777] QmlDesigner: Adapt to quick3d private API change Some quick3d utility functions were moved under QSSGUtils namespace. We only used one one-liner function from there, so just copied the implementation into puppet to avoid this dependency. Change-Id: I0b08157732161c750b3e53873fd10e1b20137b04 (cherry picked from commit 291e3096cd5d0763370238252143c3bb4fe93839) Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/tools/qml2puppet/qml2puppet/editor3d/generalhelper.cpp | 6 ++---- src/tools/qml2puppet/qml2puppet/editor3d/mousearea3d.cpp | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/tools/qml2puppet/qml2puppet/editor3d/generalhelper.cpp b/src/tools/qml2puppet/qml2puppet/editor3d/generalhelper.cpp index 52a3f6d74aa..21720ae6dea 100644 --- a/src/tools/qml2puppet/qml2puppet/editor3d/generalhelper.cpp +++ b/src/tools/qml2puppet/qml2puppet/editor3d/generalhelper.cpp @@ -19,7 +19,6 @@ #include <QtQuick3DRuntimeRender/private/qssgrenderbuffermanager_p.h> #include <QtQuick3DRuntimeRender/private/qssgrendermodel_p.h> #include <QtQuick3DUtils/private/qssgbounds3_p.h> -#include <QtQuick3DUtils/private/qssgutils_p.h> #include <QtQml/qqml.h> #include <QtQuick/qquickwindow.h> #include <QtQuick/qquickitem.h> @@ -800,9 +799,8 @@ QVector3D GeneralHelper::pivotScenePosition(QQuick3DNode *node) const QMatrix4x4 localTransform; localTransform.translate(node->position()); - const QMatrix4x4 sceneTransform = parent->sceneTransform() * localTransform; - - return mat44::getPosition(sceneTransform); + const QMatrix4x4 m = parent->sceneTransform() * localTransform; + return QVector3D(m(0, 3), m(1, 3), m(2, 3)); } // Calculate bounds for given node, including all child nodes. diff --git a/src/tools/qml2puppet/qml2puppet/editor3d/mousearea3d.cpp b/src/tools/qml2puppet/qml2puppet/editor3d/mousearea3d.cpp index 2e78d84ac82..fed5656e241 100644 --- a/src/tools/qml2puppet/qml2puppet/editor3d/mousearea3d.cpp +++ b/src/tools/qml2puppet/qml2puppet/editor3d/mousearea3d.cpp @@ -10,7 +10,6 @@ #include <QtQuick3D/private/qquick3dcamera_p.h> #include <QtQuick3D/private/qquick3dorthographiccamera_p.h> #include <QtQuick3DRuntimeRender/private/qssgrendercamera_p.h> -#include <QtQuick3DUtils/private/qssgutils_p.h> #include <QtCore/qmath.h> namespace QmlDesigner { @@ -735,9 +734,8 @@ QVector3D MouseArea3D::pivotScenePosition(QQuick3DNode *node) const QMatrix4x4 localTransform; localTransform.translate(node->position()); - const QMatrix4x4 sceneTransform = parent->sceneTransform() * localTransform; - - return mat44::getPosition(sceneTransform); + const QMatrix4x4 m = parent->sceneTransform() * localTransform; + return QVector3D(m(0, 3), m(1, 3), m(2, 3)); } double MouseArea3D::getRelativeScale(QQuick3DNode *node) const From d88c270aaf4f6a00b1d40d5cee28f84709e6539f Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 21 Sep 2023 13:36:17 +0200 Subject: [PATCH 1203/1777] CMakePM: Allow code completion for CMake files without a project By taking the default CMake tool in Qt Creator. Similar to the editor. Change-Id: Id1effa3c4f71dc59dcf940f0fc246aa87c9ba0f7 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../cmakefilecompletionassist.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index b32ae13d9ab..1a1f9d57367 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -9,6 +9,7 @@ #include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "cmaketool.h" +#include "cmaketoolmanager.h" #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> @@ -197,12 +198,16 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() Project *project = nullptr; const FilePath &filePath = interface()->filePath(); if (!filePath.isEmpty() && filePath.isFile()) { + CMakeTool *cmake = nullptr; project = static_cast<CMakeProject *>(ProjectManager::projectForFile(filePath)); - if (project && project->activeTarget()) { - CMakeTool *cmake = CMakeKitAspect::cmakeTool(project->activeTarget()->kit()); - if (cmake && cmake->isValid()) - keywords = cmake->keywords(); - } + if (project && project->activeTarget()) + cmake = CMakeKitAspect::cmakeTool(project->activeTarget()->kit()); + + if (!cmake) + cmake = CMakeToolManager::defaultCMakeTool(); + + if (cmake && cmake->isValid()) + keywords = cmake->keywords(); } QStringList buildTargets; From 84ba3c58c20cbb3c197ff4e684c52f03dea977c8 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 20 Sep 2023 09:06:13 +0200 Subject: [PATCH 1204/1777] Utils: Replace BaseAspect::pushUndo Moving the logic into Undoable::set() reduces allocations. Change-Id: Ib4a10d1e41da8d42d66bfe9ef24a667c5bfd8c0c Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 25 ++++++------------------- src/libs/utils/aspects.h | 10 ++++++---- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index ba6c7b69cd9..c31d7b615e2 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -322,19 +322,6 @@ QUndoStack *BaseAspect::undoStack() const return d->m_undoStack; } -void BaseAspect::pushUndo(QUndoCommand *cmd) -{ - if (!cmd) - return; - - if (d->m_undoStack) - d->m_undoStack->push(cmd); - else { - cmd->redo(); - delete cmd; - } -} - bool BaseAspect::isEnabled() const { return d->m_enabled; @@ -1739,7 +1726,7 @@ void BoolAspect::addToLayoutHelper(Layouting::LayoutItem &parent, QAbstractButto } connect(button, &QAbstractButton::clicked, this, [button, this] { - pushUndo(d->m_undoable.set(button->isChecked())); + d->m_undoable.set(undoStack(), button->isChecked()); }); connect(&d->m_undoable.m_signal, &UndoSignaller::changed, button, [button, this] { @@ -1780,7 +1767,7 @@ std::function<void (QObject *)> BoolAspect::groupChecker() groupBox->setChecked(value()); connect(groupBox, &QGroupBox::clicked, this, [groupBox, this] { - pushUndo(d->m_undoable.set(groupBox->isChecked())); + d->m_undoable.set(undoStack(), groupBox->isChecked()); }); connect(&d->m_undoable.m_signal, &UndoSignaller::changed, groupBox, [groupBox, this] { @@ -2475,7 +2462,7 @@ void FilePathListAspect::addToLayout(LayoutItem &parent) PathListEditor *editor = new PathListEditor; editor->setPathList(value()); connect(editor, &PathListEditor::changed, this, [this, editor] { - pushUndo(d->undoable.set(editor->pathList())); + d->undoable.set(undoStack(), editor->pathList()); }); connect(&d->undoable.m_signal, &UndoSignaller::changed, this, [this, editor] { if (editor->pathList() != d->undoable.get()) @@ -3101,7 +3088,7 @@ QList<std::shared_ptr<BaseAspect>> AspectList::volatileItems() const std::shared_ptr<BaseAspect> AspectList::addItem(const std::shared_ptr<BaseAspect> &item) { if (undoStack()) - pushUndo(new AddItemCommand(this, item)); + undoStack()->push(new AddItemCommand(this, item)); else return actualAddItem(item); @@ -3121,7 +3108,7 @@ void AspectList::actualRemoveItem(const std::shared_ptr<BaseAspect> &item) void AspectList::removeItem(const std::shared_ptr<BaseAspect> &item) { if (undoStack()) - pushUndo(new RemoveItemCommand(this, item)); + undoStack()->push(new RemoveItemCommand(this, item)); else actualRemoveItem(item); } @@ -3343,7 +3330,7 @@ void StringSelectionAspect::addToLayout(Layouting::LayoutItem &parent) if (newValue.isEmpty()) return; - pushUndo(m_undoable.set(newValue)); + m_undoable.set(undoStack(), newValue); bufferToGui(); }); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index c83dbe23405..cd589aa75fe 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -93,7 +93,6 @@ public: virtual void setUndoStack(QUndoStack *undoStack); QUndoStack *undoStack() const; - void pushUndo(QUndoCommand *cmd); bool isEnabled() const; void setEnabled(bool enabled); @@ -978,12 +977,15 @@ public: T m_newValue; }; - QUndoCommand *set(const T &value) + void set(QUndoStack *stack, const T &value) { if (m_value == value) - return nullptr; + return; - return new UndoCmd(this, m_value, value); + if (stack) + stack->push(new UndoCmd(this, m_value, value)); + else + setInternal(value); } void setSilently(const T &value) { m_value = value; } From e753c4585c2dfeea62357c986abdd4160de2a159 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 21 Sep 2023 10:23:42 +0200 Subject: [PATCH 1205/1777] CMakeEditor: Fix unused variable Drop a call to currentProject(), as currentBuildSystem() already implies currentProject() isn't nullptr. Amends a998269d7eeac2ded09dafdacd18de614e0a5a0d Change-Id: Ibf902dc78af5c59c6475366f52d0b3489e989789 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 9664c9eda53..d4e89a26a92 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -48,9 +48,8 @@ public: CMakeEditor::CMakeEditor() { CMakeTool *tool = nullptr; - if (auto project = ProjectTree::currentProject()) - if (auto bs = ProjectTree::currentBuildSystem()) - tool = CMakeKitAspect::cmakeTool(bs->target()->kit()); + if (auto bs = ProjectTree::currentBuildSystem()) + tool = CMakeKitAspect::cmakeTool(bs->target()->kit()); if (!tool) tool = CMakeToolManager::defaultCMakeTool(); From b32643e9965c5016d7cddab67c24b8c10abf7ca9 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 20 Sep 2023 08:21:40 +0200 Subject: [PATCH 1206/1777] Utils: Don't store widgets in StringAspect Change-Id: Ibeabd5c933210fefede7748cdfba416ed33b27bf Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/aspects.cpp | 240 ++++++++++-------- src/libs/utils/aspects.h | 8 +- .../qbsprojectmanager/qbsbuildstep.cpp | 1 - src/plugins/qmakeprojectmanager/qmakestep.cpp | 1 - 4 files changed, 142 insertions(+), 108 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index c31d7b615e2..4b6062bfeb7 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -834,10 +834,6 @@ public: Qt::TextElideMode m_elideMode = Qt::ElideNone; QString m_placeHolderText; Key m_historyCompleterKey; - QPointer<ElidingLabel> m_labelDisplay; - QPointer<FancyLineEdit> m_lineEditDisplay; - QPointer<ShowPasswordButton> m_showPasswordButton; - QPointer<QTextEdit> m_textEditDisplay; MacroExpanderProvider m_expanderProvider; StringAspect::ValueAcceptor m_valueAcceptor; std::optional<FancyLineEdit::ValidationFunction> m_validator; @@ -850,6 +846,8 @@ public: bool m_useResetButton = false; bool m_autoApplyOnEditingFinished = false; bool m_validatePlaceHolder = false; + + UndoableValue<QString> undoable; }; class IntegerAspectPrivate @@ -1031,11 +1029,11 @@ void StringAspect::setDisplayStyle(DisplayStyle displayStyle) */ void StringAspect::setPlaceHolderText(const QString &placeHolderText) { + if (d->m_placeHolderText == placeHolderText) + return; + d->m_placeHolderText = placeHolderText; - if (d->m_lineEditDisplay) - d->m_lineEditDisplay->setPlaceholderText(placeHolderText); - if (d->m_textEditDisplay) - d->m_textEditDisplay->setPlaceholderText(placeHolderText); + emit placeholderTextChanged(placeHolderText); } /*! @@ -1043,9 +1041,10 @@ void StringAspect::setPlaceHolderText(const QString &placeHolderText) */ void StringAspect::setElideMode(Qt::TextElideMode elideMode) { + if (d->m_elideMode == elideMode) + return; d->m_elideMode = elideMode; - if (d->m_labelDisplay) - d->m_labelDisplay->setElideMode(elideMode); + emit elideModeChanged(elideMode); } /*! @@ -1057,22 +1056,13 @@ void StringAspect::setElideMode(Qt::TextElideMode elideMode) void StringAspect::setHistoryCompleter(const Key &historyCompleterKey) { d->m_historyCompleterKey = historyCompleterKey; - if (d->m_lineEditDisplay) - d->m_lineEditDisplay->setHistoryCompleter(historyCompleterKey); -} - -void StringAspect::setUndoRedoEnabled(bool undoRedoEnabled) -{ - d->m_undoRedoEnabled = undoRedoEnabled; - if (d->m_textEditDisplay) - d->m_textEditDisplay->setUndoRedoEnabled(undoRedoEnabled); + emit historyCompleterKeyChanged(historyCompleterKey); } void StringAspect::setAcceptRichText(bool acceptRichText) { d->m_acceptRichText = acceptRichText; - if (d->m_textEditDisplay) - d->m_textEditDisplay->setAcceptRichText(acceptRichText); + emit acceptRichTextChanged(acceptRichText); } void StringAspect::setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider) @@ -1093,8 +1083,7 @@ void StringAspect::setUseResetButton() void StringAspect::setValidationFunction(const FancyLineEdit::ValidationFunction &validator) { d->m_validator = validator; - if (d->m_lineEditDisplay) - d->m_lineEditDisplay->setValidationFunction(*d->m_validator); + emit validationFunctionChanged(validator); } void StringAspect::setAutoApplyOnEditingFinished(bool applyOnEditingFinished) @@ -1102,12 +1091,6 @@ void StringAspect::setAutoApplyOnEditingFinished(bool applyOnEditingFinished) d->m_autoApplyOnEditingFinished = applyOnEditingFinished; } -void StringAspect::validateInput() -{ - if (d->m_lineEditDisplay) - d->m_lineEditDisplay->validate(); -} - void StringAspect::addToLayout(LayoutItem &parent) { d->m_checkerImpl.addToLayoutFirst(parent); @@ -1124,78 +1107,150 @@ void StringAspect::addToLayout(LayoutItem &parent) switch (d->m_displayStyle) { case PasswordLineEditDisplay: - case LineEditDisplay: - d->m_lineEditDisplay = createSubWidget<FancyLineEdit>(); - d->m_lineEditDisplay->setPlaceholderText(d->m_placeHolderText); + case LineEditDisplay: { + auto lineEditDisplay = createSubWidget<FancyLineEdit>(); + lineEditDisplay->setPlaceholderText(d->m_placeHolderText); if (!d->m_historyCompleterKey.isEmpty()) - d->m_lineEditDisplay->setHistoryCompleter(d->m_historyCompleterKey); + lineEditDisplay->setHistoryCompleter(d->m_historyCompleterKey); + + connect(this, + &StringAspect::historyCompleterKeyChanged, + lineEditDisplay, + [lineEditDisplay](const Key &historyCompleterKey) { + lineEditDisplay->setHistoryCompleter(historyCompleterKey); + }); + connect(this, + &StringAspect::placeholderTextChanged, + lineEditDisplay, + &FancyLineEdit::setPlaceholderText); if (d->m_validator) - d->m_lineEditDisplay->setValidationFunction(*d->m_validator); - d->m_lineEditDisplay->setTextKeepingActiveCursor(displayedString); - d->m_lineEditDisplay->setReadOnly(isReadOnly()); - d->m_lineEditDisplay->setValidatePlaceHolder(d->m_validatePlaceHolder); - d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_lineEditDisplay.data()); - addLabeledItem(parent, d->m_lineEditDisplay); - useMacroExpander(d->m_lineEditDisplay); + lineEditDisplay->setValidationFunction(*d->m_validator); + lineEditDisplay->setTextKeepingActiveCursor(displayedString); + lineEditDisplay->setReadOnly(isReadOnly()); + lineEditDisplay->setValidatePlaceHolder(d->m_validatePlaceHolder); + + d->m_checkerImpl.updateWidgetFromCheckStatus(this, lineEditDisplay); + connect(d->m_checkerImpl.m_checked.get(), + &BoolAspect::volatileValueChanged, + lineEditDisplay, + [this, lineEditDisplay]() { + d->m_checkerImpl.updateWidgetFromCheckStatus(this, lineEditDisplay); + }); + + addLabeledItem(parent, lineEditDisplay); + useMacroExpander(lineEditDisplay); if (d->m_useResetButton) { auto resetButton = createSubWidget<QPushButton>(Tr::tr("Reset")); - resetButton->setEnabled(d->m_lineEditDisplay->text() != defaultValue()); - connect(resetButton, &QPushButton::clicked, this, [this] { - d->m_lineEditDisplay->setText(defaultValue()); - }); - connect(d->m_lineEditDisplay, &QLineEdit::textChanged, this, [this, resetButton] { - resetButton->setEnabled(d->m_lineEditDisplay->text() != defaultValue()); + resetButton->setEnabled(lineEditDisplay->text() != defaultValue()); + connect(resetButton, &QPushButton::clicked, lineEditDisplay, [this, lineEditDisplay] { + lineEditDisplay->setText(defaultValue()); }); + connect(lineEditDisplay, + &QLineEdit::textChanged, + resetButton, + [this, lineEditDisplay, resetButton] { + resetButton->setEnabled(lineEditDisplay->text() != defaultValue()); + }); parent.addItem(resetButton); } - connect(d->m_lineEditDisplay, &FancyLineEdit::validChanged, this, &StringAspect::validChanged); + connect(lineEditDisplay, &FancyLineEdit::validChanged, this, &StringAspect::validChanged); bufferToGui(); if (isAutoApply() && d->m_autoApplyOnEditingFinished) { - connect(d->m_lineEditDisplay, &FancyLineEdit::editingFinished, - this, &StringAspect::handleGuiChanged); + connect(lineEditDisplay, + &FancyLineEdit::editingFinished, + this, + [this, lineEditDisplay]() { + d->undoable.set(undoStack(), lineEditDisplay->text()); + handleGuiChanged(); + }); } else { - connect(d->m_lineEditDisplay, &QLineEdit::textEdited, - this, &StringAspect::handleGuiChanged); + connect(lineEditDisplay, &QLineEdit::textEdited, this, [this, lineEditDisplay]() { + d->undoable.set(undoStack(), lineEditDisplay->text()); + handleGuiChanged(); + }); } if (d->m_displayStyle == PasswordLineEditDisplay) { - d->m_showPasswordButton = createSubWidget<ShowPasswordButton>(); - d->m_lineEditDisplay->setEchoMode(QLineEdit::PasswordEchoOnEdit); - parent.addItem(d->m_showPasswordButton); - connect(d->m_showPasswordButton, + auto showPasswordButton = createSubWidget<ShowPasswordButton>(); + lineEditDisplay->setEchoMode(QLineEdit::PasswordEchoOnEdit); + parent.addItem(showPasswordButton); + connect(showPasswordButton, &ShowPasswordButton::toggled, - d->m_lineEditDisplay, - [this] { - d->m_lineEditDisplay->setEchoMode(d->m_showPasswordButton->isChecked() - ? QLineEdit::Normal - : QLineEdit::PasswordEchoOnEdit); + lineEditDisplay, + [showPasswordButton, lineEditDisplay] { + lineEditDisplay->setEchoMode(showPasswordButton->isChecked() + ? QLineEdit::Normal + : QLineEdit::PasswordEchoOnEdit); }); } + + connect(&d->undoable.m_signal, + &UndoSignaller::changed, + lineEditDisplay, + [this, lineEditDisplay] { + lineEditDisplay->setTextKeepingActiveCursor(d->undoable.get()); + lineEditDisplay->validate(); + }); + break; - case TextEditDisplay: - d->m_textEditDisplay = createSubWidget<QTextEdit>(); - d->m_textEditDisplay->setPlaceholderText(d->m_placeHolderText); - d->m_textEditDisplay->setUndoRedoEnabled(d->m_undoRedoEnabled); - d->m_textEditDisplay->setAcceptRichText(d->m_acceptRichText); - d->m_textEditDisplay->setTextInteractionFlags(Qt::TextEditorInteraction); - d->m_textEditDisplay->setText(displayedString); - d->m_textEditDisplay->setReadOnly(isReadOnly()); - d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_textEditDisplay.data()); - addLabeledItem(parent, d->m_textEditDisplay); - useMacroExpander(d->m_textEditDisplay); + } + case TextEditDisplay: { + auto textEditDisplay = createSubWidget<QTextEdit>(); + textEditDisplay->setPlaceholderText(d->m_placeHolderText); + textEditDisplay->setUndoRedoEnabled(false); + textEditDisplay->setAcceptRichText(d->m_acceptRichText); + textEditDisplay->setTextInteractionFlags(Qt::TextEditorInteraction); + textEditDisplay->setText(displayedString); + textEditDisplay->setReadOnly(isReadOnly()); + d->m_checkerImpl.updateWidgetFromCheckStatus(this, textEditDisplay); + + connect(d->m_checkerImpl.m_checked.get(), + &BoolAspect::volatileValueChanged, + textEditDisplay, + [this, textEditDisplay]() { + d->m_checkerImpl.updateWidgetFromCheckStatus(this, textEditDisplay); + }); + + addLabeledItem(parent, textEditDisplay); + useMacroExpander(textEditDisplay); bufferToGui(); - connect(d->m_textEditDisplay, &QTextEdit::textChanged, - this, &StringAspect::handleGuiChanged); + connect(this, + &StringAspect::acceptRichTextChanged, + textEditDisplay, + &QTextEdit::setAcceptRichText); + connect(this, + &StringAspect::placeholderTextChanged, + textEditDisplay, + &QTextEdit::setPlaceholderText); + + connect(textEditDisplay, &QTextEdit::textChanged, this, [this, textEditDisplay]() { + d->undoable.set(undoStack(), textEditDisplay->toPlainText()); + handleGuiChanged(); + }); + + connect(&d->undoable.m_signal, + &UndoSignaller::changed, + textEditDisplay, + [this, textEditDisplay] { textEditDisplay->setText(d->undoable.get()); }); break; - case LabelDisplay: - d->m_labelDisplay = createSubWidget<ElidingLabel>(); - d->m_labelDisplay->setElideMode(d->m_elideMode); - d->m_labelDisplay->setTextInteractionFlags(Qt::TextSelectableByMouse); - d->m_labelDisplay->setText(displayedString); - d->m_labelDisplay->setToolTip(d->m_showToolTipOnLabel ? displayedString : toolTip()); - addLabeledItem(parent, d->m_labelDisplay); + } + case LabelDisplay: { + auto labelDisplay = createSubWidget<ElidingLabel>(); + labelDisplay->setElideMode(d->m_elideMode); + labelDisplay->setTextInteractionFlags(Qt::TextSelectableByMouse); + labelDisplay->setText(displayedString); + labelDisplay->setToolTip(d->m_showToolTipOnLabel ? displayedString : toolTip()); + connect(this, &StringAspect::setElideMode, labelDisplay, &ElidingLabel::setElideMode); + addLabeledItem(parent, labelDisplay); + + connect(&d->undoable.m_signal, &UndoSignaller::changed, labelDisplay, [this, labelDisplay] { + labelDisplay->setText(d->undoable.get()); + labelDisplay->setToolTip(d->m_showToolTipOnLabel ? d->undoable.get() : toolTip()); + }); + break; } + } d->m_checkerImpl.addToLayoutLast(parent); } @@ -1208,11 +1263,7 @@ QString StringAspect::expandedValue() const bool StringAspect::guiToBuffer() { - if (d->m_lineEditDisplay) - return updateStorage(m_buffer, d->m_lineEditDisplay->text()); - if (d->m_textEditDisplay) - return updateStorage(m_buffer, d->m_textEditDisplay->document()->toPlainText()); - return false; + return updateStorage(m_buffer, d->undoable.get()); } bool StringAspect::bufferToInternal() @@ -1232,24 +1283,7 @@ bool StringAspect::internalToBuffer() void StringAspect::bufferToGui() { - if (d->m_lineEditDisplay) { - d->m_lineEditDisplay->setTextKeepingActiveCursor(m_buffer); - d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_lineEditDisplay.data()); - } - - if (d->m_textEditDisplay) { - const QString old = d->m_textEditDisplay->document()->toPlainText(); - if (m_buffer != old) - d->m_textEditDisplay->setText(m_buffer); - d->m_checkerImpl.updateWidgetFromCheckStatus(this, d->m_textEditDisplay.data()); - } - - if (d->m_labelDisplay) { - d->m_labelDisplay->setText(m_buffer); - d->m_labelDisplay->setToolTip(d->m_showToolTipOnLabel ? m_buffer : toolTip()); - } - - validateInput(); + d->undoable.setWithoutUndo(m_buffer); } /*! diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index cd589aa75fe..ccdaadcc631 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -562,7 +562,6 @@ public: void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter); void setPlaceHolderText(const QString &placeHolderText); void setHistoryCompleter(const Key &historyCompleterKey); - void setUndoRedoEnabled(bool readOnly); void setAcceptRichText(bool acceptRichText); void setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider); void setUseGlobalMacroExpander(); @@ -575,8 +574,6 @@ public: bool isChecked() const; void setChecked(bool checked); - void validateInput(); - enum DisplayStyle { LabelDisplay, LineEditDisplay, @@ -591,6 +588,11 @@ public: signals: void validChanged(bool validState); + void elideModeChanged(Qt::TextElideMode elideMode); + void historyCompleterKeyChanged(const Key &historyCompleterKey); + void acceptRichTextChanged(bool acceptRichText); + void validationFunctionChanged(const FancyLineEdit::ValidationFunction &validator); + void placeholderTextChanged(const QString &placeholderText); protected: void bufferToGui() override; diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index de5ddba1bb7..7968a555bf9 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -220,7 +220,6 @@ QbsBuildStep::QbsBuildStep(BuildStepList *bsl, Id id) : commandLine.setDisplayStyle(StringAspect::TextEditDisplay); commandLine.setLabelText(QbsProjectManager::Tr::tr("Equivalent command line:")); - commandLine.setUndoRedoEnabled(false); commandLine.setReadOnly(true); connect(&maxJobCount, &BaseAspect::changed, this, &QbsBuildStep::updateState); diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index f0a10dac178..afeba2bc446 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -75,7 +75,6 @@ QMakeStep::QMakeStep(BuildStepList *bsl, Id id) effectiveCall.setDisplayStyle(StringAspect::TextEditDisplay); effectiveCall.setLabelText(Tr::tr("Effective qmake call:")); effectiveCall.setReadOnly(true); - effectiveCall.setUndoRedoEnabled(false); effectiveCall.setEnabled(true); auto updateSummary = [this] { From f5a517e87a2a095fdb342cb2c7a84f3525d0a9a1 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 21 Sep 2023 13:39:53 +0200 Subject: [PATCH 1207/1777] Work around issue in OptionPushButton with Qt 6.7 We want to suppress the push button's behavior to open the menu on the `pressed` signal. In Qt 6.7 this internal connection was changed to a C++11 style connection to the push button's private, so we have no direct way to remove this connection only. Remove all connections to `pressed` (which we do not use atm) and document the behavior correspondingly. See qtbase/9ef16d94719b186051174d1df1d75b758f9a98c9 Change-Id: I0d50af23e80d98063da3a47713e5f59de4458819 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/optionpushbutton.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/optionpushbutton.cpp b/src/libs/utils/optionpushbutton.cpp index c3993fef4b0..c20b2e74706 100644 --- a/src/libs/utils/optionpushbutton.cpp +++ b/src/libs/utils/optionpushbutton.cpp @@ -45,13 +45,16 @@ OptionPushButton::OptionPushButton(const QString &text, QWidget *parent) This menu is shown if the user clicks on the menu indicator that is shown. If the user clicks anywhere else on the button, QAbstractButton::clicked() is sent instead. + \note Calling this method removes all connections to the QAbstractButton::pressed() signal. + Ownership of the menu is not transferred to the push button. */ void OptionPushButton::setOptionalMenu(QMenu *menu) { setMenu(menu); - // hack away that QPushButton opens the menu on "pressed" - disconnect(this, SIGNAL(pressed()), this, SLOT(_q_popupPressed())); + // Hack away that QPushButton opens the menu on "pressed". + // Also removes all other connections to "pressed". + disconnect(this, &QPushButton::pressed, 0, 0); } /*! From 3c5de27af46d831d5671e66a2acd8ac3a7c9b218 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 21 Sep 2023 10:27:52 +0200 Subject: [PATCH 1208/1777] Docker: Cleanup Change-Id: I38a0b3177bea4276b3758a6a2ecfd24118be15e3 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/docker/dockerdevice.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 8083c5350c7..a5dba04e4de 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -100,7 +100,7 @@ const char DockerDeviceEnableLldbFlags[] = "DockerDeviceEnableLldbFlags"; const char DockerDeviceClangDExecutable[] = "DockerDeviceClangDExecutable"; const char DockerDeviceExtraArgs[] = "DockerDeviceExtraCreateArguments"; -class ContainerShell : public Utils::DeviceShell +class ContainerShell : public DeviceShell { public: ContainerShell(const QString &containerId, const FilePath &devicePath) @@ -211,7 +211,7 @@ DockerDeviceSettings::DockerDeviceSettings() [watcher, cb]() { expected_str<QList<Network>> result = watcher->result(); if (result) { - auto items = Utils::transform(*result, [](const Network &network) { + auto items = transform(*result, [](const Network &network) { QStandardItem *item = new QStandardItem(network.name); item->setData(network.name); item->setToolTip(network.toString()); @@ -233,9 +233,9 @@ DockerDeviceSettings::DockerDeviceSettings() clangdExecutable.setValidationFunction( [](const QString &newValue) -> FancyLineEdit::AsyncValidationFuture { - return Utils::asyncRun([newValue]() -> expected_str<QString> { + return asyncRun([newValue]() -> expected_str<QString> { QString error; - bool result = Utils::checkClangdVersion(FilePath::fromUserInput(newValue), &error); + bool result = checkClangdVersion(FilePath::fromUserInput(newValue), &error); if (!result) return make_unexpected(error); return newValue; @@ -344,7 +344,7 @@ public: DockerDeviceFileAccess m_fileAccess{this}; }; -class DockerProcessImpl : public Utils::ProcessInterface +class DockerProcessImpl : public ProcessInterface { public: DockerProcessImpl(IDevice::ConstPtr device, DockerDevicePrivate *devicePrivate); @@ -417,7 +417,7 @@ DockerProcessImpl::DockerProcessImpl(IDevice::ConstPtr device, DockerDevicePriva qCDebug(dockerDeviceLog) << "Process exited:" << m_process.commandLine() << "with code:" << m_process.resultData().m_exitCode; - Utils::ProcessResultData resultData = m_process.resultData(); + ProcessResultData resultData = m_process.resultData(); if (m_remotePID == 0 && !m_hasReceivedFirstOutput) { resultData.m_error = QProcess::FailedToStart; @@ -949,7 +949,7 @@ FilePath DockerDevice::filePath(const QString &pathOnDevice) const pathOnDevice); } -Utils::FilePath DockerDevice::rootPath() const +FilePath DockerDevice::rootPath() const { return FilePath::fromParts(Constants::DOCKER_DEVICE_SCHEME, d->repoAndTagEncoded(), u"/"); } @@ -989,7 +989,7 @@ bool DockerDevice::ensureReachable(const FilePath &other) const return d->ensureReachable(other.parentDir()); } -expected_str<FilePath> DockerDevice::localSource(const Utils::FilePath &other) const +expected_str<FilePath> DockerDevice::localSource(const FilePath &other) const { return d->localSource(other); } @@ -1126,7 +1126,7 @@ public: const QString fail = QString{"Docker: "} + ::ProjectExplorer::Tr::tr("The process failed to start."); - auto errorLabel = new Utils::InfoLabel(fail, Utils::InfoLabel::Error, this); + auto errorLabel = new InfoLabel(fail, InfoLabel::Error, this); errorLabel->setVisible(false); m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); @@ -1174,7 +1174,7 @@ public: m_log->append(Tr::tr("Done.")); }); - connect(m_process, &Utils::Process::readyReadStandardError, this, [this] { + connect(m_process, &Process::readyReadStandardError, this, [this] { const QString out = Tr::tr("Error: %1").arg(m_process->cleanedStdErr()); m_log->append(Tr::tr("Error: %1").arg(out)); }); From 4bdc023e32e38302f0abd02031f99f543899a39f Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 21 Sep 2023 09:32:07 +0200 Subject: [PATCH 1209/1777] CompilerExplorer: Enable undo/redo Change-Id: I06bba06181784de07f89f01a3bfe586513d63c66 Reviewed-by: hjk <hjk@qt.io> --- .../compilerexploreraspects.cpp | 67 ++- .../compilerexploreraspects.h | 48 +++ .../compilerexplorereditor.cpp | 382 +++++++++++------- .../compilerexplorer/compilerexplorereditor.h | 80 +++- .../compilerexplorersettings.cpp | 13 +- .../compilerexplorersettings.h | 3 +- 6 files changed, 443 insertions(+), 150 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.cpp b/src/plugins/compilerexplorer/compilerexploreraspects.cpp index c9a965f2a92..021914310de 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.cpp +++ b/src/plugins/compilerexplorer/compilerexploreraspects.cpp @@ -6,6 +6,7 @@ #include "api/library.h" +#include <utils/algorithm.h> #include <utils/layoutbuilder.h> #include <QComboBox> @@ -58,6 +59,35 @@ bool LibrarySelectionAspect::guiToBuffer() return oldBuffer != m_buffer; } +QVariantMap toVariantMap(const QMap<QString, QString> &map) +{ + QVariantMap variant; + for (const auto &key : map.keys()) + variant.insert(key, map[key]); + + return variant; +} + +QVariant LibrarySelectionAspect::variantValue() const +{ + return toVariantMap(m_internal); +} + +QVariant LibrarySelectionAspect::volatileVariantValue() const +{ + return toVariantMap(m_buffer); +} + +void LibrarySelectionAspect::setVariantValue(const QVariant &value, Announcement howToAnnounce) +{ + QMap<QString, QString> map; + QVariantMap variant = value.toMap(); + for (const auto &key : variant.keys()) + map[key] = variant[key].toString(); + + setValue(map, howToAnnounce); +} + void LibrarySelectionAspect::addToLayout(Layouting::LayoutItem &parent) { using namespace Layouting; @@ -110,6 +140,18 @@ void LibrarySelectionAspect::addToLayout(Layouting::LayoutItem &parent) connect(nameCombo, &QComboBox::currentIndexChanged, this, refreshVersionCombo); connect(versionCombo, &QComboBox::activated, this, [this, nameCombo, versionCombo] { + if (undoStack()) { + QVariant old = m_model->data(m_model->index(nameCombo->currentIndex(), 0), + SelectedVersion); + undoStack()->push(new SelectLibraryVersionCommand(this, + nameCombo->currentIndex(), + versionCombo->currentData(), + old)); + + handleGuiChanged(); + return; + } + m_model->setData(m_model->index(nameCombo->currentIndex(), 0), versionCombo->currentData(), SelectedVersion); @@ -118,6 +160,23 @@ void LibrarySelectionAspect::addToLayout(Layouting::LayoutItem &parent) QPushButton *clearBtn = new QPushButton("Clear All"); connect(clearBtn, &QPushButton::clicked, clearBtn, [this, refreshVersionCombo] { + if (undoStack()) { + undoStack()->beginMacro(Tr::tr("Reset used libraries")); + for (int i = 0; i < m_model->rowCount(); i++) { + QModelIndex idx = m_model->index(i, 0); + if (idx.data(SelectedVersion).isValid()) + undoStack()->push(new SelectLibraryVersionCommand(this, + i, + QVariant(), + idx.data(SelectedVersion))); + } + undoStack()->endMacro(); + + handleGuiChanged(); + refreshVersionCombo(); + return; + } + for (int i = 0; i < m_model->rowCount(); i++) m_model->setData(m_model->index(i, 0), QVariant(), SelectedVersion); handleGuiChanged(); @@ -130,10 +189,11 @@ void LibrarySelectionAspect::addToLayout(Layouting::LayoutItem &parent) QStringList libs; for (int i = 0; i < m_model->rowCount(); i++) { QModelIndex idx = m_model->index(i, 0); - if (idx.data(SelectedVersion).isValid()) + if (idx.data(SelectedVersion).isValid()) { libs.append(QString("%1 %2") .arg(idx.data().toString()) .arg(idx.data(SelectedVersion).toString())); + } } if (libs.empty()) displayLabel->setText(Tr::tr("No libraries selected")); @@ -157,7 +217,10 @@ void LibrarySelectionAspect::addToLayout(Layouting::LayoutItem &parent) Row { noMargin, nameCombo, versionCombo, clearBtn }.emerge() }.emerge(); // clang-format on - connect(editBtn, &QPushButton::clicked, this, [stack] { stack->setCurrentIndex(1); }); + connect(editBtn, &QPushButton::clicked, stack, [stack] { stack->setCurrentIndex(1); }); + connect(this, &LibrarySelectionAspect::returnToDisplay, stack, [stack] { + stack->setCurrentIndex(0); + }); addLabeledItem(parent, s); } diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.h b/src/plugins/compilerexplorer/compilerexploreraspects.h index 64f91c1a418..10a0d9cb818 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.h +++ b/src/plugins/compilerexplorer/compilerexploreraspects.h @@ -24,6 +24,48 @@ public: SelectedVersion, }; + class SelectLibraryVersionCommand : public QUndoCommand + { + public: + SelectLibraryVersionCommand(LibrarySelectionAspect *aspect, + int libraryIndex, + const QVariant &versionId, + const QVariant &oldVersionId = QVariant()) + : m_aspect(aspect) + , m_libraryIndex(libraryIndex) + , m_versionId(versionId) + , m_oldVersionId(oldVersionId) + {} + + void undo() override + { + m_aspect->m_model->setData(m_aspect->m_model->index(m_libraryIndex, 0), + m_oldVersionId, + LibrarySelectionAspect::SelectedVersion); + m_aspect->handleGuiChanged(); + emit m_aspect->returnToDisplay(); + } + + void redo() override + { + m_aspect->m_model->setData(m_aspect->m_model->index(m_libraryIndex, 0), + m_versionId, + LibrarySelectionAspect::SelectedVersion); + if (!m_firstTime) { + emit m_aspect->returnToDisplay(); + m_aspect->handleGuiChanged(); + } + m_firstTime = false; + } + + private: + LibrarySelectionAspect *m_aspect; + int m_libraryIndex; + QVariant m_versionId; + QVariant m_oldVersionId; + bool m_firstTime{true}; + }; + LibrarySelectionAspect(Utils::AspectContainer *container = nullptr); void addToLayout(Layouting::LayoutItem &parent) override; @@ -36,8 +78,14 @@ public: void bufferToGui() override; bool guiToBuffer() override; + QVariant variantValue() const override; + QVariant volatileVariantValue() const override; + + void setVariantValue(const QVariant &value, Announcement howToAnnounce = DoEmit) override; + signals: void refillRequested(); + void returnToDisplay(); private: FillCallback m_fillCallback; diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index cc387002e01..719b61299fc 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -9,6 +9,7 @@ #include <aggregation/aggregate.h> +#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/coreconstants.h> #include <coreplugin/icontext.h> #include <coreplugin/icore.h> @@ -25,6 +26,7 @@ #include <utils/layoutbuilder.h> #include <utils/mimetypes2/mimetype.h> #include <utils/mimeutils.h> +#include <utils/store.h> #include <utils/utilsicons.h> #include <QCompleter> @@ -37,6 +39,7 @@ #include <QTemporaryFile> #include <QTimer> #include <QToolButton> +#include <QUndoStack> #include <chrono> #include <iostream> @@ -48,30 +51,36 @@ using namespace Utils; namespace CompilerExplorer { -class CodeEditorWidget : public TextEditorWidget +CodeEditorWidget::CodeEditorWidget(const std::shared_ptr<SourceSettings> &settings, + QUndoStack *undoStack) + : m_settings(settings) + , m_undoStack(undoStack){}; + +void CodeEditorWidget::updateHighlighter() { -public: - CodeEditorWidget(const std::shared_ptr<SourceSettings> &settings) - : m_settings(settings) - {} + const QString ext = m_settings->languageExtension(); + if (ext.isEmpty()) + return; - void updateHighlighter() - { - const QString ext = m_settings->languageExtension(); - if (ext.isEmpty()) - return; - - Utils::MimeType mimeType = Utils::mimeTypeForFile("foo" + ext); - configureGenericHighlighter(mimeType); - } - - std::shared_ptr<SourceSettings> m_settings; -}; + Utils::MimeType mimeType = Utils::mimeTypeForFile("foo" + ext); + configureGenericHighlighter(mimeType); +} class SourceTextDocument : public TextDocument { public: - SourceTextDocument(const std::shared_ptr<SourceSettings> &settings) + class OpaqueUndoCommand : public QUndoCommand + { + public: + OpaqueUndoCommand(SourceTextDocument *doc) + : m_doc(doc) + {} + void undo() override { m_doc->undo(); } + void redo() override { m_doc->redo(); } + SourceTextDocument *m_doc; + }; + + SourceTextDocument(const std::shared_ptr<SourceSettings> &settings, QUndoStack *undoStack) { setPlainText(settings->source()); @@ -83,18 +92,26 @@ public: if (settings->source.volatileValue() != plainText()) setPlainText(settings->source.volatileValue()); }); + + connect(this->document(), &QTextDocument::undoCommandAdded, this, [this, undoStack] { + undoStack->push(new OpaqueUndoCommand(this)); + }); } + + void undo() { document()->undo(); } + void redo() { document()->redo(); } }; -JsonSettingsDocument::JsonSettingsDocument() +JsonSettingsDocument::JsonSettingsDocument(QUndoStack *undoStack) + : m_undoStack(undoStack) { setId(Constants::CE_EDITOR_ID); setMimeType("application/compiler-explorer"); connect(&m_ceSettings, &CompilerExplorerSettings::changed, this, [this] { emit changed(); }); + m_ceSettings.setAutoApply(true); + m_ceSettings.setUndoStack(undoStack); } -JsonSettingsDocument::~JsonSettingsDocument() {} - Core::IDocument::OpenResult JsonSettingsDocument::open(QString *errorString, const FilePath &filePath, const FilePath &realFilePath) @@ -121,23 +138,21 @@ Core::IDocument::OpenResult JsonSettingsDocument::open(QString *errorString, return OpenResult::Success; } -bool JsonSettingsDocument::saveImpl(QString *errorString, - const FilePath &newFilePath, - bool autoSave) +bool JsonSettingsDocument::saveImpl(QString *errorString, const FilePath &newFilePath, bool autoSave) { - Store map; + Store store; if (autoSave) { if (m_windowStateCallback) m_ceSettings.windowState.setVolatileValue(m_windowStateCallback()); - m_ceSettings.volatileToMap(map); + m_ceSettings.volatileToMap(store); } else { if (m_windowStateCallback) m_ceSettings.windowState.setValue(m_windowStateCallback()); m_ceSettings.apply(); - m_ceSettings.toMap(map); + m_ceSettings.toMap(store); } Utils::FilePath path = newFilePath.isEmpty() ? filePath() : newFilePath; @@ -145,7 +160,7 @@ bool JsonSettingsDocument::saveImpl(QString *errorString, if (!newFilePath.isEmpty() && !autoSave) setFilePath(newFilePath); - auto result = path.writeFileContents(jsonFromStore(map)); + auto result = path.writeFileContents(jsonFromStore(store)); if (!result && errorString) { *errorString = result.error(); return false; @@ -170,12 +185,15 @@ bool JsonSettingsDocument::setContents(const QByteArray &contents) return true; } -SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &settings) +SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &settings, + QUndoStack *undoStack) : m_sourceSettings(settings) { - m_codeEditor = new CodeEditorWidget(m_sourceSettings); + m_codeEditor = new CodeEditorWidget(m_sourceSettings, undoStack); - TextDocumentPtr document = TextDocumentPtr(new SourceTextDocument(m_sourceSettings)); + connect(m_codeEditor, &CodeEditorWidget::gotFocus, this, &SourceEditorWidget::gotFocus); + + TextDocumentPtr document = TextDocumentPtr(new SourceTextDocument(m_sourceSettings, undoStack)); connect(document.get(), &SourceTextDocument::changed, @@ -187,11 +205,12 @@ SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &se auto addCompilerButton = new QPushButton; addCompilerButton->setText(Tr::tr("Add compiler")); - connect(addCompilerButton, &QPushButton::clicked, this, [this] { - auto newCompiler = std::make_shared<CompilerSettings>(m_sourceSettings->apiConfigFunction()); - newCompiler->setLanguageId(m_sourceSettings->languageId()); - m_sourceSettings->compilers.addItem(newCompiler); - }); + connect(addCompilerButton, &QPushButton::clicked, this, &SourceEditorWidget::addCompiler); + + auto removeSourceButton = new QPushButton; + removeSourceButton->setIcon(Utils::Icons::EDIT_CLEAR.icon()); + removeSourceButton->setToolTip(Tr::tr("Remove source")); + connect(removeSourceButton, &QPushButton::clicked, this, &SourceEditorWidget::remove); // clang-format off using namespace Layouting; @@ -200,6 +219,7 @@ SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &se Row { settings->languageId, addCompilerButton, + removeSourceButton, }, m_codeEditor, }.attachTo(this); @@ -208,13 +228,6 @@ SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &se setWindowTitle("Source code"); setObjectName("source_code"); - Aggregate *agg = Aggregate::parentAggregate(m_codeEditor); - if (!agg) { - agg = new Aggregate; - agg->add(m_codeEditor); - } - agg->add(this); - setFocusProxy(m_codeEditor); } @@ -243,11 +256,14 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett m_delayTimer, qOverload<>(&QTimer::start)); - m_asmEditor = new TextEditorWidget; + m_asmEditor = new AsmEditorWidget; m_asmDocument = QSharedPointer<TextDocument>(new TextDocument); m_asmDocument->setFilePath("asm.asm"); m_asmEditor->setTextDocument(m_asmDocument); m_asmEditor->configureGenericHighlighter(Utils::mimeTypeForName("text/x-asm")); + m_asmEditor->setReadOnly(true); + + connect(m_asmEditor, &AsmEditorWidget::gotFocus, this, &CompilerWidget::gotFocus); auto advButton = new QPushButton; QSplitter *splitter{nullptr}; @@ -268,6 +284,11 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett connect(advButton, &QPushButton::clicked, advDlg, &QAction::trigger); advButton->setIcon(advDlg->icon()); + auto removeCompilerBtn = new QPushButton; + removeCompilerBtn->setIcon(Utils::Icons::EDIT_CLEAR.icon()); + removeCompilerBtn->setToolTip(Tr::tr("Remove compiler")); + connect(removeCompilerBtn, &QPushButton::clicked, this, &CompilerWidget::remove); + compile(m_sourceSettings->source()); connect(&m_sourceSettings->source, &Utils::StringAspect::volatileValueChanged, this, [this] { @@ -279,6 +300,7 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett Row { m_compilerSettings->compiler, advButton, + removeCompilerBtn, }, Splitter { bindTo(&splitter), @@ -368,84 +390,81 @@ void CompilerWidget::doCompile() m_compileWatcher.reset(new QFutureWatcher<CompileResult>); - connect( - m_compileWatcher.get(), &QFutureWatcher<CompileResult>::finished, this, [this] { - m_spinner->setVisible(false); - m_asmEditor->setEnabled(true); + connect(m_compileWatcher.get(), &QFutureWatcher<CompileResult>::finished, this, [this] { + m_spinner->setVisible(false); + m_asmEditor->setEnabled(true); - try { - Api::CompileResult r = m_compileWatcher->result(); + try { + Api::CompileResult r = m_compileWatcher->result(); - m_resultTerminal->restart(); - m_resultTerminal->writeToTerminal("\x1b[?25l", false); + m_resultTerminal->restart(); + m_resultTerminal->writeToTerminal("\x1b[?25l", false); - for (const auto &err : r.stdErr) + for (const auto &err : r.stdErr) + m_resultTerminal->writeToTerminal((err.text + "\r\n").toUtf8(), false); + for (const auto &out : r.stdOut) + m_resultTerminal->writeToTerminal((out.text + "\r\n").toUtf8(), false); + + m_resultTerminal->writeToTerminal( + QString("ASM generation compiler returned: %1\r\n\r\n").arg(r.code).toUtf8(), true); + + if (r.execResult) { + for (const auto &err : r.execResult->buildResult.stdErr) m_resultTerminal->writeToTerminal((err.text + "\r\n").toUtf8(), false); - for (const auto &out : r.stdOut) + for (const auto &out : r.execResult->buildResult.stdOut) m_resultTerminal->writeToTerminal((out.text + "\r\n").toUtf8(), false); - m_resultTerminal->writeToTerminal( - QString("ASM generation compiler returned: %1\r\n\r\n").arg(r.code).toUtf8(), - true); + m_resultTerminal + ->writeToTerminal(QString("Execution build compiler returned: %1\r\n\r\n") + .arg(r.execResult->buildResult.code) + .toUtf8(), + true); - if (r.execResult) { - for (const auto &err : r.execResult->buildResult.stdErr) - m_resultTerminal->writeToTerminal((err.text + "\r\n").toUtf8(), false); - for (const auto &out : r.execResult->buildResult.stdOut) - m_resultTerminal->writeToTerminal((out.text + "\r\n").toUtf8(), false); + if (r.execResult->didExecute) { + m_resultTerminal->writeToTerminal(QString("Program returned: %1\r\n") + .arg(r.execResult->code) + .toUtf8(), + true); - m_resultTerminal - ->writeToTerminal(QString("Execution build compiler returned: %1\r\n\r\n") - .arg(r.execResult->buildResult.code) - .toUtf8(), - true); - - if (r.execResult->didExecute) { - m_resultTerminal->writeToTerminal(QString("Program returned: %1\r\n") - .arg(r.execResult->code) - .toUtf8(), - true); - - for (const auto &err : r.execResult->stdErrLines) - m_resultTerminal - ->writeToTerminal((" \033[0;31m" + err + "\033[0m\r\n").toUtf8(), - false); - for (const auto &out : r.execResult->stdOutLines) - m_resultTerminal->writeToTerminal((" " + out + "\r\n").toUtf8(), false); - } + for (const auto &err : r.execResult->stdErrLines) + m_resultTerminal + ->writeToTerminal((" \033[0;31m" + err + "\033[0m\r\n\r\n").toUtf8(), + false); + for (const auto &out : r.execResult->stdOutLines) + m_resultTerminal->writeToTerminal((out + "\r\n").toUtf8(), false); } - for (auto mark : m_marks) { - delete mark; - } - m_marks.clear(); - - QString asmText; - for (auto l : r.assemblyLines) - asmText += l.text + "\n"; - - m_asmDocument->setPlainText(asmText); - - int i = 0; - for (auto l : r.assemblyLines) { - i++; - if (l.opcodes.empty()) - continue; - - auto mark = new TextMark(m_asmDocument.get(), - i, - TextMarkCategory{"Bytes", "Bytes"}); - mark->setLineAnnotation(l.opcodes.join(' ')); - m_marks.append(mark); - } - } catch (const std::exception &e) { - qCritical() << "Exception: " << e.what(); } - }); + qDeleteAll(m_marks); + m_marks.clear(); + + QString asmText; + for (auto l : r.assemblyLines) + asmText += l.text + "\n"; + + m_asmDocument->setPlainText(asmText); + + int i = 0; + for (auto l : r.assemblyLines) { + i++; + if (l.opcodes.empty()) + continue; + + auto mark = new TextMark(m_asmDocument.get(), i, TextMarkCategory{"Bytes", "Bytes"}); + mark->setLineAnnotation(l.opcodes.join(' ')); + m_marks.append(mark); + } + } catch (const std::exception &e) { + qCritical() << "Exception: " << e.what(); + } + }); m_compileWatcher->setFuture(f); } -EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, QWidget *parent) +EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, + QUndoStack *undoStack, + TextEditorActionHandler &actionHandler, + QWidget *parent) : Utils::FancyMainWindow(parent) , m_document(document) { @@ -473,34 +492,55 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, return result; }); - auto addCompiler = [this](const std::shared_ptr<SourceSettings> &sourceSettings, - const std::shared_ptr<CompilerSettings> &compilerSettings, - int idx) { + auto addCompiler = [this, + &actionHandler](const std::shared_ptr<SourceSettings> &sourceSettings, + const std::shared_ptr<CompilerSettings> &compilerSettings, + int idx) { auto compiler = new CompilerWidget(sourceSettings, compilerSettings); compiler->setWindowTitle("Compiler #" + QString::number(idx)); compiler->setObjectName("compiler_" + QString::number(idx)); QDockWidget *dockWidget = addDockForWidget(compiler); addDockWidget(Qt::RightDockWidgetArea, dockWidget); m_compilerWidgets.append(dockWidget); + + connect(compiler, + &CompilerWidget::remove, + this, + [sourceSettings = sourceSettings.get(), compilerSettings = compilerSettings.get()] { + sourceSettings->compilers.removeItem(compilerSettings->shared_from_this()); + }); + + connect(compiler, &CompilerWidget::gotFocus, this, [&actionHandler] { + actionHandler.updateCurrentEditor(); + }); }; - auto addSourceEditor = [this, document = document.get(), addCompiler]( + auto addSourceEditor = [this, &actionHandler, document = document.get(), addCompiler, undoStack]( const std::shared_ptr<SourceSettings> &sourceSettings) { - auto sourceEditor = new SourceEditorWidget(sourceSettings); + auto sourceEditor = new SourceEditorWidget(sourceSettings, undoStack); sourceEditor->setWindowTitle("Source Code #" + QString::number(m_sourceWidgets.size() + 1)); sourceEditor->setObjectName("source_code_editor_" + QString::number(m_sourceWidgets.size() + 1)); QDockWidget *dockWidget = addDockForWidget(sourceEditor); - connect(dockWidget, - &QDockWidget::visibilityChanged, + connect(sourceEditor, + &SourceEditorWidget::remove, this, - [document, sourceSettings = sourceSettings.get(), dockWidget] { - if (!dockWidget->isVisible()) - document->settings()->m_sources.removeItem( - sourceSettings->shared_from_this()); + [document, sourceSettings = sourceSettings.get()] { + document->settings()->m_sources.removeItem(sourceSettings->shared_from_this()); }); + connect(sourceEditor, &SourceEditorWidget::addCompiler, this, [sourceSettings] { + auto newCompiler = std::make_shared<CompilerSettings>( + sourceSettings->apiConfigFunction()); + newCompiler->setLanguageId(sourceSettings->languageId()); + sourceSettings->compilers.addItem(newCompiler); + }); + + connect(sourceEditor, &SourceEditorWidget::gotFocus, this, [&actionHandler] { + actionHandler.updateCurrentEditor(); + }); + addDockWidget(Qt::LeftDockWidgetArea, dockWidget); sourceSettings->compilers.forEachItem<CompilerSettings>( @@ -519,13 +559,19 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, sourceSettings->compilers.setItemRemovedCallback<CompilerSettings>( [this](const std::shared_ptr<CompilerSettings> &compilerSettings) { - m_compilerWidgets.removeIf([compilerSettings](const QDockWidget *c) { - return static_cast<CompilerWidget *>(c->widget())->m_compilerSettings - == compilerSettings; - }); + auto it = std::find_if(m_compilerWidgets.begin(), + m_compilerWidgets.end(), + [compilerSettings](const QDockWidget *c) { + return static_cast<CompilerWidget *>(c->widget()) + ->m_compilerSettings + == compilerSettings; + }); + QTC_ASSERT(it != m_compilerWidgets.end(), return); + delete *it; + m_compilerWidgets.erase(it); }); - Aggregate *agg = Aggregate::parentAggregate(sourceEditor); + /*Aggregate *agg = Aggregate::parentAggregate(sourceEditor); if (!agg) { agg = new Aggregate; agg->add(sourceEditor); @@ -533,15 +579,21 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, agg->add(this); setFocusProxy(sourceEditor); - +*/ m_sourceWidgets.append(dockWidget); }; auto removeSourceEditor = [this](const std::shared_ptr<SourceSettings> &sourceSettings) { - m_sourceWidgets.removeIf([sourceSettings = sourceSettings.get()](const QDockWidget *c) { - return static_cast<SourceEditorWidget *>(c->widget())->m_sourceSettings - == sourceSettings->shared_from_this(); - }); + auto it = std::find_if(m_sourceWidgets.begin(), + m_sourceWidgets.end(), + [sourceSettings](const QDockWidget *c) { + return static_cast<SourceEditorWidget *>(c->widget()) + ->sourceSettings() + == sourceSettings.get(); + }); + QTC_ASSERT(it != m_sourceWidgets.end(), return); + delete *it; + m_sourceWidgets.erase(it); }; auto recreateEditors = [this, addSourceEditor]() { @@ -593,21 +645,63 @@ EditorWidget::~EditorWidget() m_sourceWidgets.clear(); } +TextEditor::TextEditorWidget *EditorWidget::focusedEditorWidget() const +{ + for (const QDockWidget *sourceWidget : m_sourceWidgets) { + TextEditorWidget *textEditor + = qobject_cast<SourceEditorWidget *>(sourceWidget->widget())->textEditor(); + if (textEditor->hasFocus()) + return textEditor; + } + + for (const QDockWidget *compilerWidget : m_compilerWidgets) { + TextEditorWidget *textEditor + = qobject_cast<CompilerWidget *>(compilerWidget->widget())->textEditor(); + if (textEditor->hasFocus()) + return textEditor; + } + + return nullptr; +} + class Editor : public Core::IEditor { public: - Editor() - : m_document(new JsonSettingsDocument()) + Editor(TextEditorActionHandler &actionHandler) + : m_document(new JsonSettingsDocument(&m_undoStack)) { - setWidget(new EditorWidget(m_document)); + setWidget(new EditorWidget(m_document, &m_undoStack, actionHandler)); + + connect(&m_undoStack, &QUndoStack::canUndoChanged, this, [&actionHandler] { + actionHandler.updateActions(); + }); + connect(&m_undoStack, &QUndoStack::canRedoChanged, this, [&actionHandler] { + actionHandler.updateActions(); + }); } - ~Editor() { delete widget(); } + ~Editor() + { + if (m_document->isModified()) { + auto settings = m_document->settings(); + if (settings->isDirty()) { + settings->apply(); + Utils::Store store; + settings->toMap(store); + QJsonDocument doc = QJsonDocument::fromVariant(Utils::mapFromStore(store)); + + CompilerExplorer::settings().defaultDocument.setValue( + QString::fromUtf8(doc.toJson())); + } + } + delete widget(); + } Core::IDocument *document() const override { return m_document.data(); } QWidget *toolBar() override { return nullptr; } QSharedPointer<JsonSettingsDocument> m_document; + QUndoStack m_undoStack; }; EditorFactory::EditorFactory() @@ -615,14 +709,32 @@ EditorFactory::EditorFactory() Constants::CE_EDITOR_CONTEXT_ID, TextEditor::TextEditorActionHandler::None, [](Core::IEditor *editor) -> TextEditorWidget * { - return Aggregation::query<TextEditorWidget>(editor->widget()); + return static_cast<EditorWidget *>(editor->widget())->focusedEditorWidget(); }) { setId(Constants::CE_EDITOR_ID); setDisplayName(Tr::tr("Compiler Explorer Editor")); setMimeTypes({"application/compiler-explorer"}); - setEditorCreator([]() { return new Editor(); }); + auto undoStackFromEditor = [](Core::IEditor *editor) -> QUndoStack * { + if (!editor) + return nullptr; + return &static_cast<Editor *>(editor)->m_undoStack; + }; + + m_actionHandler.setCanUndoCallback([undoStackFromEditor](Core::IEditor *editor) { + if (auto undoStack = undoStackFromEditor(editor)) + return undoStack->canUndo(); + return false; + }); + + m_actionHandler.setCanRedoCallback([undoStackFromEditor](Core::IEditor *editor) { + if (auto undoStack = undoStackFromEditor(editor)) + return undoStack->canRedo(); + return false; + }); + + setEditorCreator([this]() { return new Editor(m_actionHandler); }); } } // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.h b/src/plugins/compilerexplorer/compilerexplorereditor.h index f63da2ccc45..54befd824ef 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.h +++ b/src/plugins/compilerexplorer/compilerexplorereditor.h @@ -18,6 +18,7 @@ #include <QFutureWatcher> #include <QMainWindow> #include <QSplitter> +#include <QUndoStack> #include <memory> @@ -29,14 +30,54 @@ namespace CompilerExplorer { class JsonSettingsDocument; class SourceEditorWidget; -class CodeEditorWidget; + +class CodeEditorWidget : public TextEditor::TextEditorWidget +{ + Q_OBJECT +public: + CodeEditorWidget(const std::shared_ptr<SourceSettings> &settings, QUndoStack *undoStack); + + void updateHighlighter(); + + void undo() override { m_undoStack->undo(); } + void redo() override { m_undoStack->redo(); } + + void focusInEvent(QFocusEvent *event) override + { + TextEditorWidget::focusInEvent(event); + emit gotFocus(); + } + +signals: + void gotFocus(); + +private: + std::shared_ptr<SourceSettings> m_settings; + QUndoStack *m_undoStack; +}; + +class AsmEditorWidget : public TextEditor::TextEditorWidget +{ + Q_OBJECT + +public: + using TextEditor::TextEditorWidget::TextEditorWidget; + + void focusInEvent(QFocusEvent *event) override + { + TextEditorWidget::focusInEvent(event); + emit gotFocus(); + } + +signals: + void gotFocus(); +}; class JsonSettingsDocument : public Core::IDocument { Q_OBJECT public: - JsonSettingsDocument(); - ~JsonSettingsDocument() override; + JsonSettingsDocument(QUndoStack *undoStack); OpenResult open(QString *errorString, const Utils::FilePath &filePath, @@ -65,22 +106,31 @@ signals: private: mutable CompilerExplorerSettings m_ceSettings; std::function<QVariantMap()> m_windowStateCallback; + QUndoStack *m_undoStack; }; class SourceEditorWidget : public QWidget { Q_OBJECT public: - SourceEditorWidget(const std::shared_ptr<SourceSettings> &settings); + SourceEditorWidget(const std::shared_ptr<SourceSettings> &settings, QUndoStack *undoStack); QString sourceCode(); + SourceSettings *sourceSettings() { return m_sourceSettings.get(); } + + void focusInEvent(QFocusEvent *) override { emit gotFocus(); } + + TextEditor::TextEditorWidget *textEditor() { return m_codeEditor; } - std::shared_ptr<SourceSettings> m_sourceSettings; signals: void sourceCodeChanged(); + void addCompiler(); + void remove(); + void gotFocus(); private: CodeEditorWidget *m_codeEditor{nullptr}; + std::shared_ptr<SourceSettings> m_sourceSettings; }; class CompilerWidget : public QWidget @@ -99,11 +149,19 @@ public: std::shared_ptr<SourceSettings> m_sourceSettings; std::shared_ptr<CompilerSettings> m_compilerSettings; + void focusInEvent(QFocusEvent *) override { emit gotFocus(); } + + TextEditor::TextEditorWidget *textEditor() { return m_asmEditor; } + private: void doCompile(); +signals: + void remove(); + void gotFocus(); + private: - TextEditor::TextEditorWidget *m_asmEditor{nullptr}; + AsmEditorWidget *m_asmEditor{nullptr}; Core::SearchableTerminal *m_resultTerminal{nullptr}; SpinnerSolution::Spinner *m_spinner{nullptr}; @@ -120,9 +178,14 @@ class EditorWidget : public Utils::FancyMainWindow { Q_OBJECT public: - EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, QWidget *parent = nullptr); + EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, + QUndoStack *undoStack, + TextEditor::TextEditorActionHandler &actionHandler, + QWidget *parent = nullptr); ~EditorWidget() override; + TextEditor::TextEditorWidget *focusedEditorWidget() const; + signals: void sourceCodeChanged(); @@ -144,6 +207,9 @@ public: private: TextEditor::TextEditorActionHandler m_actionHandler; + + QAction m_undoAction; + QAction m_redoAction; }; } // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp index adef327f80a..078b60f73eb 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.cpp +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -87,11 +87,12 @@ SourceSettings::SourceSettings(const ApiConfigFunction &apiConfigFunction) return result; }); - for (const auto &aspect : this->aspects()) + for (const auto &aspect : this->aspects()) { connect(aspect, &Utils::BaseAspect::volatileValueChanged, this, - &CompilerExplorerSettings::changed); + &Utils::AspectContainer::changed); + } } void SourceSettings::refresh() @@ -146,11 +147,12 @@ CompilerSettings::CompilerSettings(const ApiConfigFunction &apiConfigFunction) demangleIdentifiers.setLabelText(Tr::tr("Demangle identifiers")); demangleIdentifiers.setDefaultValue(true); - for (const auto &aspect : this->aspects()) + for (const auto &aspect : this->aspects()) { connect(aspect, &Utils::BaseAspect::volatileValueChanged, this, - &CompilerExplorerSettings::changed); + &Utils::AspectContainer::changed); + } } void CompilerSettings::refresh() @@ -325,11 +327,12 @@ CompilerExplorerSettings::CompilerExplorerSettings() m_sources.forEachItem<SourceSettings>(&SourceSettings::refresh); }); - for (const auto &aspect : this->aspects()) + for (const auto &aspect : this->aspects()) { connect(aspect, &Utils::BaseAspect::volatileValueChanged, this, &CompilerExplorerSettings::changed); + } } CompilerExplorerSettings::~CompilerExplorerSettings() = default; diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.h b/src/plugins/compilerexplorer/compilerexplorersettings.h index 05c2474cb43..de0aa75e300 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.h +++ b/src/plugins/compilerexplorer/compilerexplorersettings.h @@ -77,7 +77,8 @@ private: ApiConfigFunction m_apiConfigFunction; }; -class CompilerSettings : public Utils::AspectContainer +class CompilerSettings : public Utils::AspectContainer, + public std::enable_shared_from_this<CompilerSettings> { public: CompilerSettings(const ApiConfigFunction &apiConfigFunction); From dedfc3dbe7f6657af90caa284e1237f0896fce44 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 21 Sep 2023 10:05:12 +0200 Subject: [PATCH 1210/1777] Utils: Fix StringAspect ui connection QLineEdit::textEdited is only called when the user types. It is not triggered if the text changes due to undo/redo. QLineEdit::textChanged is triggered for all changes. We also have to make sure that we don't call QLineEdit::setTextKeepingActiveCursor unnecessarily as that would clear the undo/redo stack of the QLineEdit. Change-Id: I19562d0804e6a34b11f19e86abd256a807e147d6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 4b6062bfeb7..1c4b1430b32 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1165,7 +1165,7 @@ void StringAspect::addToLayout(LayoutItem &parent) handleGuiChanged(); }); } else { - connect(lineEditDisplay, &QLineEdit::textEdited, this, [this, lineEditDisplay]() { + connect(lineEditDisplay, &QLineEdit::textChanged, this, [this, lineEditDisplay]() { d->undoable.set(undoStack(), lineEditDisplay->text()); handleGuiChanged(); }); @@ -1188,7 +1188,9 @@ void StringAspect::addToLayout(LayoutItem &parent) &UndoSignaller::changed, lineEditDisplay, [this, lineEditDisplay] { - lineEditDisplay->setTextKeepingActiveCursor(d->undoable.get()); + if (lineEditDisplay->text() != d->undoable.get()) + lineEditDisplay->setTextKeepingActiveCursor(d->undoable.get()); + lineEditDisplay->validate(); }); From 6c93ca2e66d2f4532f2e299db35d1d9283b03f43 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 21 Sep 2023 10:17:07 +0200 Subject: [PATCH 1211/1777] DAP: Add proper stack frame selection - Fixed locals view freezing when scope is empty Change-Id: I1e64217b061937ab66abf3508e2156e9a2c1460c Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/debugger/dap/dapengine.cpp | 18 +++++++++++++----- src/plugins/debugger/dap/dapengine.h | 1 + src/plugins/debugger/stackframe.h | 1 + 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 0660aa463fd..74a0623911d 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -218,7 +218,9 @@ void DapEngine::activateFrame(int frameIndex) QTC_ASSERT(frameIndex < handler->stackSize(), return); handler->setCurrentIndex(frameIndex); gotoLocation(handler->currentFrame()); - updateLocals(); + + m_currentStackFrameId = handler->currentFrame().debuggerId; + m_dapClient->scopes(m_currentStackFrameId); } void DapEngine::selectThread(const Thread &thread) @@ -546,7 +548,8 @@ void DapEngine::handleStackTraceResponse(const QJsonObject &response) gotoLocation(Location(file, line)); refreshStack(stackFrames); - m_dapClient->scopes(stackFrame.value("id").toInt()); + m_currentStackFrameId = stackFrame.value("id").toInt(); + m_dapClient->scopes(m_currentStackFrameId); } void DapEngine::handleScopesResponse(const QJsonObject &response) @@ -568,9 +571,13 @@ void DapEngine::handleScopesResponse(const QJsonObject &response) m_variablesReferenceQueue.push(scope.toObject().value("variablesReference").toInt()); } - m_isFirstLayer = true; - m_dapClient->variables(m_variablesReferenceQueue.front()); - m_variablesReferenceQueue.pop(); + if (!m_variablesReferenceQueue.empty()) { + m_isFirstLayer = true; + m_dapClient->variables(m_variablesReferenceQueue.front()); + m_variablesReferenceQueue.pop(); + } else { + watchHandler()->notifyUpdateFinished(); + } } void DapEngine::handleThreadsResponse(const QJsonObject &response) @@ -761,6 +768,7 @@ void DapEngine::refreshStack(const QJsonArray &stackFrames) frame.file = FilePath::fromString(source.value("path").toString()); frame.address = item.value("instructionPointerReference").toInt(); frame.usable = frame.file.isReadableFile(); + frame.debuggerId = item.value("id").toInt(); frames.append(frame); } handler->setFrames(frames, false); diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 45ed723fad4..d0033a0cb83 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -114,6 +114,7 @@ protected: int m_nextBreakpointId = 1; int m_currentThreadId = -1; + int m_currentStackFrameId = -1; bool m_isFirstLayer = true; std::queue<int> m_variablesReferenceQueue; diff --git a/src/plugins/debugger/stackframe.h b/src/plugins/debugger/stackframe.h index b377648614d..a6faca93f4a 100644 --- a/src/plugins/debugger/stackframe.h +++ b/src/plugins/debugger/stackframe.h @@ -37,6 +37,7 @@ public: quint64 address = 0; bool usable = false; QString context; // Opaque value produced and consumed by the native backends. + uint debuggerId = 0; }; using StackFrames = QList<StackFrame>; From 60a588215e0d9a42d38b238cb58e6b5e7f8a1a9b Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Tue, 19 Sep 2023 11:58:52 +0200 Subject: [PATCH 1212/1777] DAP: Add Python output to Terminal Task-number: QTCREATORBUG-28734 Change-Id: I6f8965af525286231f7ac51dcd140c1aab4b2f01 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/dapclient.cpp | 9 ++++----- src/plugins/debugger/dap/pydapengine.cpp | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/debugger/dap/dapclient.cpp b/src/plugins/debugger/dap/dapclient.cpp index ae337a1c57c..80fadd19ce3 100644 --- a/src/plugins/debugger/dap/dapclient.cpp +++ b/src/plugins/debugger/dap/dapclient.cpp @@ -37,17 +37,16 @@ DapClient::~DapClient() = default; void DapClient::postRequest(const QString &command, const QJsonObject &arguments) { + static int seq = 1; + QJsonObject ob = { {"command", command}, {"type", "request"}, + {"seq", seq++}, {"arguments", arguments} }; - static int seq = 1; - QJsonObject obseq = ob; - obseq.insert("seq", seq++); - - const QByteArray data = QJsonDocument(obseq).toJson(QJsonDocument::Compact); + const QByteArray data = QJsonDocument(ob).toJson(QJsonDocument::Compact); const QByteArray msg = "Content-Length: " + QByteArray::number(data.size()) + "\r\n\r\n" + data; qCDebug(logCategory()) << msg; diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index a160c074671..ef7177b3565 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -76,6 +76,8 @@ public: { m_proc.setEnvironment(m_runParameters.debugger.environment); m_proc.setCommand(m_cmd); + // Workaround to have output for Python + m_proc.setTerminalMode(TerminalMode::Run); m_proc.start(); m_timer = new QTimer(this); From 7a2b25ccf86f02a58e4e22ad198726f9346bfebc Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 21 Sep 2023 13:44:14 +0200 Subject: [PATCH 1213/1777] CppEditor: Move "rename" action closer to "find references" ... in the menus. Change-Id: I5387b7024525226b70c1af484bad97228f9370c7 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/cppeditor/cppeditorplugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 3de7c9c083a..5b603b5bd78 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -379,6 +379,10 @@ void CppEditorPlugin::initialize() contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); cppToolsMenu->addAction(cmd); + cmd = ActionManager::command(TextEditor::Constants::RENAME_SYMBOL); + contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); + cppToolsMenu->addAction(cmd); + QAction * const showPreprocessedAction = new QAction(Tr::tr("Show Preprocessed Source"), this); command = ActionManager::registerAction(showPreprocessedAction, Constants::SHOW_PREPROCESSED_FILE, context); @@ -452,7 +456,6 @@ void CppEditorPlugin::initialize() Command *sep = contextMenu->addSeparator(); sep->action()->setObjectName(QLatin1String(Constants::M_REFACTORING_MENU_INSERTION_POINT)); contextMenu->addSeparator(); - cppToolsMenu->addAction(ActionManager::command(TextEditor::Constants::RENAME_SYMBOL)); // Update context in global context cppToolsMenu->addSeparator(Core::Constants::G_DEFAULT_THREE); From a219db1c91500def60fbd133a39c4371d9c6661b Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 21 Sep 2023 14:51:24 +0200 Subject: [PATCH 1214/1777] CppEditor: Split up CppEditorPlugin::initialize() Change-Id: Ib2b1ac670138ca87edb908a32f44aba16410035a Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/cppeditor/cppeditorplugin.cpp | 350 ++++++++++++---------- src/plugins/cppeditor/cppeditorplugin.h | 5 + 2 files changed, 194 insertions(+), 161 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 5b603b5bd78..daf5f844794 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -168,7 +168,6 @@ public: delete m_clangdSettingsPage; } - void initialize() { m_codeModelSettings.fromSettings(ICore::settings()); } void onTaskStarted(Utils::Id type); void onAllTasksFinished(Utils::Id type); void inspectCppCodeModel(); @@ -228,12 +227,54 @@ CppQuickFixAssistProvider *CppEditorPlugin::quickFixProvider() const void CppEditorPlugin::initialize() { d = new CppEditorPluginPrivate; - d->initialize(); + d->m_codeModelSettings.fromSettings(ICore::settings()); CppModelManager::registerJsExtension(); ExtensionSystem::PluginManager::addObject(&d->m_cppProjectUpdaterFactory); - // Menus + setupMenus(); + registerVariables(); + createCppQuickFixes(); + registerTests(); + + SnippetProvider::registerGroup(Constants::CPP_SNIPPETS_GROUP_ID, Tr::tr("C++", "SnippetProvider"), + &decorateCppEditor); + + connect(ProgressManager::instance(), &ProgressManager::taskStarted, + d, &CppEditorPluginPrivate::onTaskStarted); + connect(ProgressManager::instance(), &ProgressManager::allTasksFinished, + d, &CppEditorPluginPrivate::onAllTasksFinished); +} + +void CppEditorPlugin::extensionsInitialized() +{ + setupProjectPanels(); + + d->m_fileSettings.fromSettings(ICore::settings()); + d->m_fileSettings.addMimeInitializer(); + + // Add the hover handler factories here instead of in initialize() + // so that the Clang Code Model has a chance to hook in. + d->m_cppEditorFactory.addHoverHandler(CppModelManager::createHoverHandler()); + d->m_cppEditorFactory.addHoverHandler(new ColorPreviewHoverHandler); + d->m_cppEditorFactory.addHoverHandler(new ResourcePreviewHoverHandler); + + FileIconProvider::registerIconOverlayForMimeType( + creatorTheme()->imageFile(Theme::IconOverlayCppSource, + ProjectExplorer::Constants::FILEOVERLAY_CPP), + Constants::CPP_SOURCE_MIMETYPE); + FileIconProvider::registerIconOverlayForMimeType( + creatorTheme()->imageFile(Theme::IconOverlayCSource, + ProjectExplorer::Constants::FILEOVERLAY_C), + Constants::C_SOURCE_MIMETYPE); + FileIconProvider::registerIconOverlayForMimeType( + creatorTheme()->imageFile(Theme::IconOverlayCppHeader, + ProjectExplorer::Constants::FILEOVERLAY_H), + Constants::CPP_HEADER_MIMETYPE); +} + +void CppEditorPlugin::setupMenus() +{ ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS); ActionContainer *mcpptools = ActionManager::createMenu(Constants::M_TOOLS_CPP); QMenu *menu = mcpptools->menu(); @@ -241,105 +282,77 @@ void CppEditorPlugin::initialize() menu->setEnabled(true); mtools->addMenu(mcpptools); - // Actions Context context(Constants::CPPEDITOR_ID); - - QAction *switchAction = new QAction(Tr::tr("Switch Header/Source"), this); - Command *command = ActionManager::registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context, true); - command->setDefaultKeySequence(QKeySequence(Qt::Key_F4)); - mcpptools->addAction(command); - connect(switchAction, &QAction::triggered, - this, [] { CppModelManager::switchHeaderSource(false); }); - - QAction *openInNextSplitAction = new QAction(Tr::tr("Open Corresponding Header/Source in Next Split"), this); - command = ActionManager::registerAction(openInNextSplitAction, Constants::OPEN_HEADER_SOURCE_IN_NEXT_SPLIT, context, true); - command->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() - ? Tr::tr("Meta+E, F4") - : Tr::tr("Ctrl+E, F4"))); - mcpptools->addAction(command); - connect(openInNextSplitAction, &QAction::triggered, - this, [] { CppModelManager::switchHeaderSource(true); }); - - MacroExpander *expander = globalMacroExpander(); - - // TODO: Per-project variants of these three? - expander->registerVariable("Cpp:LicenseTemplate", - Tr::tr("The license template."), - []() { return CppEditorPlugin::licenseTemplate(nullptr); }); - expander->registerFileVariables("Cpp:LicenseTemplatePath", - Tr::tr("The configured path to the license template"), - []() { return CppEditorPlugin::licenseTemplatePath(nullptr); }); - expander->registerVariable( - "Cpp:PragmaOnce", - Tr::tr("Insert \"#pragma once\" instead of \"#ifndef\" include guards into header file"), - [] { return usePragmaOnce(nullptr) ? QString("true") : QString(); }); - - const auto quickFixSettingsPanelFactory = new ProjectPanelFactory; - quickFixSettingsPanelFactory->setPriority(100); - quickFixSettingsPanelFactory->setId(Constants::QUICK_FIX_PROJECT_PANEL_ID); - quickFixSettingsPanelFactory->setDisplayName(Tr::tr(Constants::QUICK_FIX_SETTINGS_DISPLAY_NAME)); - quickFixSettingsPanelFactory->setCreateWidgetFunction([](Project *project) { - return new CppQuickFixProjectSettingsWidget(project); - }); - ProjectPanelFactory::registerFactory(quickFixSettingsPanelFactory); - - SnippetProvider::registerGroup(Constants::CPP_SNIPPETS_GROUP_ID, Tr::tr("C++", "SnippetProvider"), - &decorateCppEditor); - - createCppQuickFixes(); - ActionContainer *contextMenu = ActionManager::createMenu(Constants::M_CONTEXT); contextMenu->insertGroup(Core::Constants::G_DEFAULT_ONE, Constants::G_CONTEXT_FIRST); - - Command *cmd; - ActionContainer *cppToolsMenu = ActionManager::actionContainer(Constants::M_TOOLS_CPP); ActionContainer *touchBar = ActionManager::actionContainer(Core::Constants::TOUCH_BAR); - cmd = ActionManager::command(Constants::SWITCH_HEADER_SOURCE); + QAction *switchAction = new QAction(Tr::tr("Switch Header/Source"), this); + Command *cmd = ActionManager::registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, + context, true); cmd->setTouchBarText(Tr::tr("Header/Source", "text on macOS touch bar")); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); + cmd->setDefaultKeySequence(QKeySequence(Qt::Key_F4)); + mcpptools->addAction(cmd); + connect(switchAction, &QAction::triggered, + this, [] { CppModelManager::switchHeaderSource(false); }); + + QAction *openInNextSplitAction + = new QAction(Tr::tr("Open Corresponding Header/Source in Next Split"), this); + cmd = ActionManager::registerAction( + openInNextSplitAction, Constants::OPEN_HEADER_SOURCE_IN_NEXT_SPLIT, context, true); + cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() + ? Tr::tr("Meta+E, F4") + : Tr::tr("Ctrl+E, F4"))); + mcpptools->addAction(cmd); + connect(openInNextSplitAction, &QAction::triggered, + this, [] { CppModelManager::switchHeaderSource(true); }); cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR); cmd->setTouchBarText(Tr::tr("Follow", "text on macOS touch bar")); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - cppToolsMenu->addAction(cmd); + mcpptools->addAction(cmd); touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); - QAction *openPreprocessorDialog = new QAction(Tr::tr("Additional Preprocessor Directives..."), this); + QAction *openPreprocessorDialog = new QAction(Tr::tr("Additional Preprocessor Directives..."), + this); cmd = ActionManager::registerAction(openPreprocessorDialog, Constants::OPEN_PREPROCESSOR_DIALOG, context); cmd->setDefaultKeySequence(QKeySequence()); - connect(openPreprocessorDialog, &QAction::triggered, this, &CppEditorPlugin::showPreProcessorDialog); - cppToolsMenu->addAction(cmd); + connect(openPreprocessorDialog, &QAction::triggered, + this, &CppEditorPlugin::showPreProcessorDialog); + mcpptools->addAction(cmd); - QAction *switchDeclarationDefinition = new QAction(Tr::tr("Switch Between Function Declaration/Definition"), this); + QAction *switchDeclarationDefinition + = new QAction(Tr::tr("Switch Between Function Declaration/Definition"), this); cmd = ActionManager::registerAction(switchDeclarationDefinition, - Constants::SWITCH_DECLARATION_DEFINITION, context, true); + Constants::SWITCH_DECLARATION_DEFINITION, context, true); cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Shift+F2"))); cmd->setTouchBarText(Tr::tr("Decl/Def", "text on macOS touch bar")); connect(switchDeclarationDefinition, &QAction::triggered, this, &CppEditorPlugin::switchDeclarationDefinition); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - cppToolsMenu->addAction(cmd); + mcpptools->addAction(cmd); touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT); - cppToolsMenu->addAction(cmd); + mcpptools->addAction(cmd); QAction *openDeclarationDefinitionInNextSplit = - new QAction(Tr::tr("Open Function Declaration/Definition in Next Split"), this); + new QAction(Tr::tr("Open Function Declaration/Definition in Next Split"), this); cmd = ActionManager::registerAction(openDeclarationDefinitionInNextSplit, - Constants::OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT, context, true); + Constants::OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT, + context, true); cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() - ? Tr::tr("Meta+E, Shift+F2") - : Tr::tr("Ctrl+E, Shift+F2"))); + ? Tr::tr("Meta+E, Shift+F2") + : Tr::tr("Ctrl+E, Shift+F2"))); connect(openDeclarationDefinitionInNextSplit, &QAction::triggered, this, &CppEditorPlugin::openDeclarationDefinitionInNextSplit); - cppToolsMenu->addAction(cmd); + mcpptools->addAction(cmd); QAction * const followSymbolToType = new QAction(Tr::tr("Follow Symbol Under Cursor to Type"), - this); + this); cmd = ActionManager::registerAction(followSymbolToType, Constants::FOLLOW_SYMBOL_TO_TYPE, context, true); cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Shift+F2"))); @@ -348,23 +361,24 @@ void CppEditorPlugin::initialize() editorWidget->followSymbolToType(false); }); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - cppToolsMenu->addAction(cmd); + mcpptools->addAction(cmd); QAction * const followSymbolToTypeInNextSplit = - new QAction(Tr::tr("Follow Symbol to Type in Next Split"), this); + new QAction(Tr::tr("Follow Symbol to Type in Next Split"), this); cmd = ActionManager::registerAction(followSymbolToTypeInNextSplit, - Constants::FOLLOW_SYMBOL_TO_TYPE_IN_NEXT_SPLIT, context, true); + Constants::FOLLOW_SYMBOL_TO_TYPE_IN_NEXT_SPLIT, + context, true); cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() - ? Tr::tr("Meta+E, Ctrl+Shift+F2") - : Tr::tr("Ctrl+E, Ctrl+Shift+F2"))); + ? Tr::tr("Meta+E, Ctrl+Shift+F2") + : Tr::tr("Ctrl+E, Ctrl+Shift+F2"))); connect(followSymbolToTypeInNextSplit, &QAction::triggered, this, []{ if (CppEditorWidget *editorWidget = currentCppEditorWidget()) editorWidget->followSymbolToType(true); }); - cppToolsMenu->addAction(cmd); + mcpptools->addAction(cmd); cmd = ActionManager::command(TextEditor::Constants::FIND_USAGES); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - cppToolsMenu->addAction(cmd); + mcpptools->addAction(cmd); d->m_findRefsCategorizedAction = new QAction(Tr::tr("Find References With Access Type"), this); cmd = ActionManager::registerAction(d->m_findRefsCategorizedAction, @@ -377,57 +391,58 @@ void CppEditorPlugin::initialize() } }); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - cppToolsMenu->addAction(cmd); + mcpptools->addAction(cmd); cmd = ActionManager::command(TextEditor::Constants::RENAME_SYMBOL); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - cppToolsMenu->addAction(cmd); + mcpptools->addAction(cmd); QAction * const showPreprocessedAction = new QAction(Tr::tr("Show Preprocessed Source"), this); - command = ActionManager::registerAction(showPreprocessedAction, - Constants::SHOW_PREPROCESSED_FILE, context); - mcpptools->addAction(command); - contextMenu->addAction(command, Constants::G_CONTEXT_FIRST); + cmd = ActionManager::registerAction(showPreprocessedAction, + Constants::SHOW_PREPROCESSED_FILE, context); + mcpptools->addAction(cmd); + contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); connect(showPreprocessedAction, &QAction::triggered, this, [] { CppModelManager::showPreprocessedFile(false); }); QAction * const showPreprocessedInSplitAction = new QAction - (Tr::tr("Show Preprocessed Source in Next Split"), this); - command = ActionManager::registerAction(showPreprocessedInSplitAction, - Constants::SHOW_PREPROCESSED_FILE_SPLIT, context); - mcpptools->addAction(command); + (Tr::tr("Show Preprocessed Source in Next Split"), this); + cmd = ActionManager::registerAction(showPreprocessedInSplitAction, + Constants::SHOW_PREPROCESSED_FILE_SPLIT, context); + mcpptools->addAction(cmd); connect(showPreprocessedInSplitAction, &QAction::triggered, this, [] { CppModelManager::showPreprocessedFile(true); }); QAction * const foldCommentsAction = new QAction(Tr::tr("Fold All Comment Blocks"), this); - command = ActionManager::registerAction(foldCommentsAction, - "CppTools.FoldCommentBlocks", context); - mcpptools->addAction(command); - contextMenu->addAction(command, Constants::G_CONTEXT_FIRST); + cmd = ActionManager::registerAction(foldCommentsAction, + "CppTools.FoldCommentBlocks", context); + mcpptools->addAction(cmd); + contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); connect(foldCommentsAction, &QAction::triggered, this, [] { CppModelManager::foldComments(); }); QAction * const unfoldCommentsAction = new QAction(Tr::tr("Unfold All Comment Blocks"), this); - command = ActionManager::registerAction(unfoldCommentsAction, - "CppTools.UnfoldCommentBlocks", context); - mcpptools->addAction(command); - contextMenu->addAction(command, Constants::G_CONTEXT_FIRST); - connect(unfoldCommentsAction, &QAction::triggered, this, [] { CppModelManager::unfoldComments(); }); + cmd = ActionManager::registerAction(unfoldCommentsAction, + "CppTools.UnfoldCommentBlocks", context); + mcpptools->addAction(cmd); + contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); + connect(unfoldCommentsAction, &QAction::triggered, + this, [] { CppModelManager::unfoldComments(); }); QAction *const findUnusedFunctionsAction = new QAction(Tr::tr("Find Unused Functions"), this); - command = ActionManager::registerAction(findUnusedFunctionsAction, - "CppTools.FindUnusedFunctions"); - mcpptools->addAction(command); + cmd = ActionManager::registerAction(findUnusedFunctionsAction, + "CppTools.FindUnusedFunctions"); + mcpptools->addAction(cmd); connect(findUnusedFunctionsAction, &QAction::triggered, this, [] { CppModelManager::findUnusedFunctions({}); }); QAction *const findUnusedFunctionsInSubProjectAction = new QAction(Tr::tr("Find Unused C/C++ Functions"), this); - command = ActionManager::registerAction(findUnusedFunctionsInSubProjectAction, - "CppTools.FindUnusedFunctionsInSubProject"); + cmd = ActionManager::registerAction(findUnusedFunctionsInSubProjectAction, + "CppTools.FindUnusedFunctionsInSubProject"); for (ActionContainer *const projectContextMenu : {ActionManager::actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT), ActionManager::actionContainer(ProjectExplorer::Constants::M_PROJECTCONTEXT)}) { projectContextMenu->addSeparator(ProjectExplorer::Constants::G_PROJECT_TREE); - projectContextMenu->addAction(command, ProjectExplorer::Constants::G_PROJECT_TREE); + projectContextMenu->addAction(cmd, ProjectExplorer::Constants::G_PROJECT_TREE); } connect(findUnusedFunctionsInSubProjectAction, &QAction::triggered, this, [] { if (const Node *const node = ProjectTree::currentNode(); node && node->asFolderNode()) @@ -435,22 +450,28 @@ void CppEditorPlugin::initialize() }); d->m_openTypeHierarchyAction = new QAction(Tr::tr("Open Type Hierarchy"), this); - cmd = ActionManager::registerAction(d->m_openTypeHierarchyAction, Constants::OPEN_TYPE_HIERARCHY, context); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+T") : Tr::tr("Ctrl+Shift+T"))); - connect(d->m_openTypeHierarchyAction, &QAction::triggered, this, &CppEditorPlugin::openTypeHierarchy); + cmd = ActionManager::registerAction(d->m_openTypeHierarchyAction, + Constants::OPEN_TYPE_HIERARCHY, context); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts + ? Tr::tr("Meta+Shift+T") : Tr::tr("Ctrl+Shift+T"))); + connect(d->m_openTypeHierarchyAction, &QAction::triggered, + this, &CppEditorPlugin::openTypeHierarchy); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - cppToolsMenu->addAction(cmd); + mcpptools->addAction(cmd); d->m_openIncludeHierarchyAction = new QAction(Tr::tr("Open Include Hierarchy"), this); - cmd = ActionManager::registerAction(d->m_openIncludeHierarchyAction, Constants::OPEN_INCLUDE_HIERARCHY, context); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+I") : Tr::tr("Ctrl+Shift+I"))); - connect(d->m_openIncludeHierarchyAction, &QAction::triggered, this, &CppEditorPlugin::openIncludeHierarchy); + cmd = ActionManager::registerAction(d->m_openIncludeHierarchyAction, + Constants::OPEN_INCLUDE_HIERARCHY, context); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts + ? Tr::tr("Meta+Shift+I") : Tr::tr("Ctrl+Shift+I"))); + connect(d->m_openIncludeHierarchyAction, &QAction::triggered, + this, &CppEditorPlugin::openIncludeHierarchy); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - cppToolsMenu->addAction(cmd); + mcpptools->addAction(cmd); cmd = ActionManager::command(TextEditor::Constants::OPEN_CALL_HIERARCHY); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - cppToolsMenu->addAction(cmd); + mcpptools->addAction(cmd); // Refactoring sub-menu Command *sep = contextMenu->addSeparator(); @@ -458,18 +479,22 @@ void CppEditorPlugin::initialize() contextMenu->addSeparator(); // Update context in global context - cppToolsMenu->addSeparator(Core::Constants::G_DEFAULT_THREE); - d->m_reparseExternallyChangedFiles = new QAction(Tr::tr("Reparse Externally Changed Files"), this); - cmd = ActionManager::registerAction(d->m_reparseExternallyChangedFiles, Constants::UPDATE_CODEMODEL); + mcpptools->addSeparator(Core::Constants::G_DEFAULT_THREE); + d->m_reparseExternallyChangedFiles = new QAction(Tr::tr("Reparse Externally Changed Files"), + this); + cmd = ActionManager::registerAction(d->m_reparseExternallyChangedFiles, + Constants::UPDATE_CODEMODEL); connect(d->m_reparseExternallyChangedFiles, &QAction::triggered, CppModelManager::instance(), &CppModelManager::updateModifiedSourceFiles); - cppToolsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE); + mcpptools->addAction(cmd, Core::Constants::G_DEFAULT_THREE); ActionContainer *toolsDebug = ActionManager::actionContainer(Core::Constants::M_TOOLS_DEBUG); QAction *inspectCppCodeModel = new QAction(Tr::tr("Inspect C++ Code Model..."), this); cmd = ActionManager::registerAction(inspectCppCodeModel, Constants::INSPECT_CPP_CODEMODEL); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+F12") : Tr::tr("Ctrl+Shift+F12"))); - connect(inspectCppCodeModel, &QAction::triggered, d, &CppEditorPluginPrivate::inspectCppCodeModel); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts + ? Tr::tr("Meta+Shift+F12") : Tr::tr("Ctrl+Shift+F12"))); + connect(inspectCppCodeModel, &QAction::triggered, + d, &CppEditorPluginPrivate::inspectCppCodeModel); toolsDebug->addAction(cmd); contextMenu->addSeparator(context); @@ -479,12 +504,58 @@ void CppEditorPlugin::initialize() cmd = ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION); contextMenu->addAction(cmd); +} - connect(ProgressManager::instance(), &ProgressManager::taskStarted, - d, &CppEditorPluginPrivate::onTaskStarted); - connect(ProgressManager::instance(), &ProgressManager::allTasksFinished, - d, &CppEditorPluginPrivate::onAllTasksFinished); +void CppEditorPlugin::setupProjectPanels() +{ + const auto quickFixSettingsPanelFactory = new ProjectPanelFactory; + quickFixSettingsPanelFactory->setPriority(100); + quickFixSettingsPanelFactory->setId(Constants::QUICK_FIX_PROJECT_PANEL_ID); + quickFixSettingsPanelFactory->setDisplayName(Tr::tr(Constants::QUICK_FIX_SETTINGS_DISPLAY_NAME)); + quickFixSettingsPanelFactory->setCreateWidgetFunction([](Project *project) { + return new CppQuickFixProjectSettingsWidget(project); + }); + ProjectPanelFactory::registerFactory(quickFixSettingsPanelFactory); + const auto fileNamesPanelFactory = new ProjectPanelFactory; + fileNamesPanelFactory->setPriority(99); + fileNamesPanelFactory->setDisplayName(Tr::tr("C++ File Naming")); + fileNamesPanelFactory->setCreateWidgetFunction([](Project *project) { + return new CppFileSettingsForProjectWidget(project); + }); + ProjectPanelFactory::registerFactory(fileNamesPanelFactory); + + if (CppModelManager::isClangCodeModelActive()) { + d->m_clangdSettingsPage = new ClangdSettingsPage; + const auto clangdPanelFactory = new ProjectPanelFactory; + clangdPanelFactory->setPriority(100); + clangdPanelFactory->setDisplayName(Tr::tr("Clangd")); + clangdPanelFactory->setCreateWidgetFunction([](Project *project) { + return new ClangdProjectSettingsWidget(project); + }); + ProjectPanelFactory::registerFactory(clangdPanelFactory); + } +} + +void CppEditorPlugin::registerVariables() +{ + MacroExpander * const expander = globalMacroExpander(); + + // TODO: Per-project variants of these three? + expander->registerVariable("Cpp:LicenseTemplate", + Tr::tr("The license template."), + []() { return CppEditorPlugin::licenseTemplate(nullptr); }); + expander->registerFileVariables("Cpp:LicenseTemplatePath", + Tr::tr("The configured path to the license template"), + []() { return CppEditorPlugin::licenseTemplatePath(nullptr); }); + expander->registerVariable( + "Cpp:PragmaOnce", + Tr::tr("Insert \"#pragma once\" instead of \"#ifndef\" include guards into header file"), + [] { return usePragmaOnce(nullptr) ? QString("true") : QString(); }); +} + +void CppEditorPlugin::registerTests() +{ #ifdef WITH_TESTS addTest<CodegenTest>(); addTest<CompilerOptionsBuilderTest>(); @@ -516,49 +587,6 @@ void CppEditorPlugin::initialize() #endif } -void CppEditorPlugin::extensionsInitialized() -{ - d->m_fileSettings.fromSettings(ICore::settings()); - d->m_fileSettings.addMimeInitializer(); - const auto fileNamesPanelFactory = new ProjectPanelFactory; - fileNamesPanelFactory->setPriority(99); - fileNamesPanelFactory->setDisplayName(Tr::tr("C++ File Naming")); - fileNamesPanelFactory->setCreateWidgetFunction([](Project *project) { - return new CppFileSettingsForProjectWidget(project); - }); - ProjectPanelFactory::registerFactory(fileNamesPanelFactory); - - if (CppModelManager::isClangCodeModelActive()) { - d->m_clangdSettingsPage = new ClangdSettingsPage; - const auto clangdPanelFactory = new ProjectPanelFactory; - clangdPanelFactory->setPriority(100); - clangdPanelFactory->setDisplayName(Tr::tr("Clangd")); - clangdPanelFactory->setCreateWidgetFunction([](Project *project) { - return new ClangdProjectSettingsWidget(project); - }); - ProjectPanelFactory::registerFactory(clangdPanelFactory); - } - - // Add the hover handler factories here instead of in initialize() - // so that the Clang Code Model has a chance to hook in. - d->m_cppEditorFactory.addHoverHandler(CppModelManager::createHoverHandler()); - d->m_cppEditorFactory.addHoverHandler(new ColorPreviewHoverHandler); - d->m_cppEditorFactory.addHoverHandler(new ResourcePreviewHoverHandler); - - FileIconProvider::registerIconOverlayForMimeType( - creatorTheme()->imageFile(Theme::IconOverlayCppSource, - ProjectExplorer::Constants::FILEOVERLAY_CPP), - Constants::CPP_SOURCE_MIMETYPE); - FileIconProvider::registerIconOverlayForMimeType( - creatorTheme()->imageFile(Theme::IconOverlayCSource, - ProjectExplorer::Constants::FILEOVERLAY_C), - Constants::C_SOURCE_MIMETYPE); - FileIconProvider::registerIconOverlayForMimeType( - creatorTheme()->imageFile(Theme::IconOverlayCppHeader, - ProjectExplorer::Constants::FILEOVERLAY_H), - Constants::CPP_HEADER_MIMETYPE); -} - void CppEditorPlugin::switchDeclarationDefinition() { if (CppEditorWidget *editorWidget = currentCppEditorWidget()) diff --git a/src/plugins/cppeditor/cppeditorplugin.h b/src/plugins/cppeditor/cppeditorplugin.h index d5b5b75f722..c24bce687f2 100644 --- a/src/plugins/cppeditor/cppeditorplugin.h +++ b/src/plugins/cppeditor/cppeditorplugin.h @@ -56,6 +56,11 @@ private: void initialize() override; void extensionsInitialized() override; + void setupMenus(); + void setupProjectPanels(); + void registerVariables(); + void registerTests(); + CppEditorPluginPrivate *d = nullptr; }; From 5b7d671375401b68ea687475c94dee5738526ceb Mon Sep 17 00:00:00 2001 From: Andreas Loth <andreas.loth@qt.io> Date: Wed, 20 Sep 2023 12:50:45 +0200 Subject: [PATCH 1215/1777] Axivion: Update Dashboard API (DTOs) Change-Id: Ice8d1746cddad1cb6f0c9a7ab2778b8d9dc26ca9 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/axivion/dashboard/concat.cpp | 5 ++ src/plugins/axivion/dashboard/concat.h | 3 + src/plugins/axivion/dashboard/dto.cpp | 71 ++++++++++++++++++++---- src/plugins/axivion/dashboard/dto.h | 65 ++++++++++++++++------ 4 files changed, 115 insertions(+), 29 deletions(-) diff --git a/src/plugins/axivion/dashboard/concat.cpp b/src/plugins/axivion/dashboard/concat.cpp index 1da7f2b081f..7d0ad6f7285 100644 --- a/src/plugins/axivion/dashboard/concat.cpp +++ b/src/plugins/axivion/dashboard/concat.cpp @@ -16,6 +16,9 @@ #include <utility> +namespace Axivion::Internal::Dto +{ + template<typename Input, typename Output> static Output concat(const std::initializer_list<const Input> &args) { @@ -43,3 +46,5 @@ QByteArray concat_bytes(const std::initializer_list<const QByteArrayView> &args) { return concat<QByteArrayView, QByteArray>(args); } + +} // namespace Axivion::Internal::Dto diff --git a/src/plugins/axivion/dashboard/concat.h b/src/plugins/axivion/dashboard/concat.h index 591b4ffeca3..33429e3bf42 100644 --- a/src/plugins/axivion/dashboard/concat.h +++ b/src/plugins/axivion/dashboard/concat.h @@ -22,9 +22,12 @@ #include <string> #include <string_view> +namespace Axivion::Internal::Dto +{ std::string concat(const std::initializer_list<const std::string_view> &args); QString concat(const std::initializer_list<const QStringView> &args); QByteArray concat_bytes(const std::initializer_list<const QByteArrayView> &args); +} // namespace Axivion::Internal::Dto diff --git a/src/plugins/axivion/dashboard/dto.cpp b/src/plugins/axivion/dashboard/dto.cpp index 607c227816c..1720087f2c8 100644 --- a/src/plugins/axivion/dashboard/dto.cpp +++ b/src/plugins/axivion/dashboard/dto.cpp @@ -749,10 +749,10 @@ namespace Axivion::Internal::Dto { // version - constexpr std::array<qint32, 4> ApiVersion::number{7,6,2,12725}; - const QLatin1String ApiVersion::string{"7.6.2.12725"}; - const QLatin1String ApiVersion::name{"7.6.2"}; - const QLatin1String ApiVersion::timestamp{"2023-08-07 14:38:01 +00:00"}; + constexpr std::array<qint32, 4> ApiVersion::number{7,6,3,12797}; + const QLatin1String ApiVersion::string{"7.6.3.12797"}; + const QLatin1String ApiVersion::name{"7.6.3"}; + const QLatin1String ApiVersion::timestamp{"2023-08-30 15:49:00 +00:00"}; // AnalyzedFileDto @@ -1011,6 +1011,50 @@ namespace Axivion::Internal::Dto { return serialize_bytes(*this); } + // CsrfTokenDto + + static const QLatin1String csrfTokenKeyCsrfToken{"csrfToken"}; + + template<> + class de_serializer<CsrfTokenDto> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static CsrfTokenDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject<CsrfTokenDto>(json); + return { + deserialize_field<QString>(jo, csrfTokenKeyCsrfToken) + }; + } + + static QJsonValue serialize(const CsrfTokenDto &value) { + QJsonObject jo; + serialize_field(jo, csrfTokenKeyCsrfToken, value.csrfToken); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + CsrfTokenDto CsrfTokenDto::deserialize(const QByteArray &json) + { + return deserialize_bytes<CsrfTokenDto>(json); + } + + CsrfTokenDto::CsrfTokenDto( + QString csrfToken + ) : + csrfToken(std::move(csrfToken)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray CsrfTokenDto::serialize() const + { + return serialize_bytes(*this); + } + // EntityDto static const QLatin1String entityKeyId{"id"}; @@ -2186,7 +2230,7 @@ namespace Axivion::Internal::Dto { deserialize_field<QString>(jo, analysisVersionKeyDate), deserialize_field<std::optional<QString>>(jo, analysisVersionKeyLabel), deserialize_field<qint32>(jo, analysisVersionKeyIndex), - deserialize_field<std::optional<QString>>(jo, analysisVersionKeyName), + deserialize_field<QString>(jo, analysisVersionKeyName), deserialize_field<qint64>(jo, analysisVersionKeyMillis), deserialize_field<Any>(jo, analysisVersionKeyIssueCounts), deserialize_field<std::optional<ToolsVersionDto>>(jo, analysisVersionKeyToolsVersion), @@ -2223,7 +2267,7 @@ namespace Axivion::Internal::Dto { QString date, std::optional<QString> label, qint32 index, - std::optional<QString> name, + QString name, qint64 millis, Any issueCounts, std::optional<ToolsVersionDto> toolsVersion, @@ -2614,6 +2658,7 @@ namespace Axivion::Internal::Dto { static const QLatin1String dashboardInfoKeyUserNamedFiltersUrl{"userNamedFiltersUrl"}; static const QLatin1String dashboardInfoKeySupportAddress{"supportAddress"}; static const QLatin1String dashboardInfoKeyIssueFilterHelp{"issueFilterHelp"}; + static const QLatin1String dashboardInfoKeyCsrfTokenUrl{"csrfTokenUrl"}; template<> class de_serializer<DashboardInfoDto> final @@ -2628,7 +2673,7 @@ namespace Axivion::Internal::Dto { deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyDashboardVersionNumber), deserialize_field<QString>(jo, dashboardInfoKeyDashboardBuildDate), deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyUsername), - deserialize_field<QString>(jo, dashboardInfoKeyCsrfTokenHeader), + deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyCsrfTokenHeader), deserialize_field<QString>(jo, dashboardInfoKeyCsrfToken), deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyCheckCredentialsUrl), deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyNamedFiltersUrl), @@ -2636,7 +2681,8 @@ namespace Axivion::Internal::Dto { deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyUserApiTokenUrl), deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyUserNamedFiltersUrl), deserialize_field<std::optional<QString>>(jo, dashboardInfoKeySupportAddress), - deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyIssueFilterHelp) + deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyIssueFilterHelp), + deserialize_field<std::optional<QString>>(jo, dashboardInfoKeyCsrfTokenUrl) }; } @@ -2656,6 +2702,7 @@ namespace Axivion::Internal::Dto { serialize_field(jo, dashboardInfoKeyUserNamedFiltersUrl, value.userNamedFiltersUrl); serialize_field(jo, dashboardInfoKeySupportAddress, value.supportAddress); serialize_field(jo, dashboardInfoKeyIssueFilterHelp, value.issueFilterHelp); + serialize_field(jo, dashboardInfoKeyCsrfTokenUrl, value.csrfTokenUrl); return { jo }; } @@ -2675,7 +2722,7 @@ namespace Axivion::Internal::Dto { std::optional<QString> dashboardVersionNumber, QString dashboardBuildDate, std::optional<QString> username, - QString csrfTokenHeader, + std::optional<QString> csrfTokenHeader, QString csrfToken, std::optional<QString> checkCredentialsUrl, std::optional<QString> namedFiltersUrl, @@ -2683,7 +2730,8 @@ namespace Axivion::Internal::Dto { std::optional<QString> userApiTokenUrl, std::optional<QString> userNamedFiltersUrl, std::optional<QString> supportAddress, - std::optional<QString> issueFilterHelp + std::optional<QString> issueFilterHelp, + std::optional<QString> csrfTokenUrl ) : mainUrl(std::move(mainUrl)), dashboardVersion(std::move(dashboardVersion)), @@ -2698,7 +2746,8 @@ namespace Axivion::Internal::Dto { userApiTokenUrl(std::move(userApiTokenUrl)), userNamedFiltersUrl(std::move(userNamedFiltersUrl)), supportAddress(std::move(supportAddress)), - issueFilterHelp(std::move(issueFilterHelp)) + issueFilterHelp(std::move(issueFilterHelp)), + csrfTokenUrl(std::move(csrfTokenUrl)) { } // throws Axivion::Internal::Dto::invalid_dto_exception diff --git a/src/plugins/axivion/dashboard/dto.h b/src/plugins/axivion/dashboard/dto.h index bdede500c39..97ca5d602dc 100644 --- a/src/plugins/axivion/dashboard/dto.h +++ b/src/plugins/axivion/dashboard/dto.h @@ -317,6 +317,34 @@ namespace Axivion::Internal::Dto virtual QByteArray serialize() const override; }; + /** + * CSRF token + * + * @since 7.7.0 + */ + class CsrfTokenDto : public Serializable + { + public: + + /** + * <p>The value expected to be sent along the ``csrfTokenHeader`` for all HTTP requests that are not GET, HEAD, OPTIONS or TRACE. + * + * <p>Note, that this does not replace authentication of subsequent requests. Also the token is combined with the authentication + * data, so will not work when authenticating as another user. Its lifetime is limited, so when creating a very long-running + * application you should consider refreshing this token from time to time. + */ + QString csrfToken; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static CsrfTokenDto deserialize(const QByteArray &json); + + CsrfTokenDto( + QString csrfToken + ); + + virtual QByteArray serialize() const override; + }; + /** * A Project Entity such as a Class, a Method, a File or a Module * or the System Entity. @@ -1261,21 +1289,10 @@ namespace Axivion::Internal::Dto qint32 index; /** - * <p>The legacy display name of a version. - * - * <p>It is not recommended to use this anymore. It contains the - * date of the analysis version creation in an arbitrary time zone which is not - * indicated in the timestamp. In recent versions most probably UTC is used but - * this can change at any time - which would be regarded as a non-breaking - * change. - * - * <p>Instead, clients should craft their own display name from the other - * available properties (date, label) and maybe adjust displayed dates - * according to their system timezone. - * - * @deprecated + * <p>The display name of the analysis version consisting of the date formatted with the + * preferred time zone of the user making the request and the label in parentheses. */ - std::optional<QString> name; + QString name; /** * <p>Analysis version timestamp in milliseconds @@ -1333,7 +1350,7 @@ namespace Axivion::Internal::Dto QString date, std::optional<QString> label, qint32 index, - std::optional<QString> name, + QString name, qint64 millis, Any issueCounts, std::optional<ToolsVersionDto> toolsVersion, @@ -1708,8 +1725,12 @@ namespace Axivion::Internal::Dto /** * <p>The HTTP-Request Header expected present for all HTTP requests that are not GET, HEAD, OPTIONS or TRACE. + * + * <p>Deprecated since 7.7.0: the header name is always ``AX-CSRF-Token``. + * + * @deprecated */ - QString csrfTokenHeader; + std::optional<QString> csrfTokenHeader; /** * <p>The value expected to be sent along the ``csrfTokenHeader`` for all HTTP requests that are not GET, HEAD, OPTIONS or TRACE. @@ -1767,6 +1788,13 @@ namespace Axivion::Internal::Dto */ std::optional<QString> issueFilterHelp; + /** + * <p>Endoint for creating new CSRF tokens. + * + * @since 7.7.0 + */ + std::optional<QString> csrfTokenUrl; + // Throws Axivion::Internal::Dto::invalid_dto_exception static DashboardInfoDto deserialize(const QByteArray &json); @@ -1776,7 +1804,7 @@ namespace Axivion::Internal::Dto std::optional<QString> dashboardVersionNumber, QString dashboardBuildDate, std::optional<QString> username, - QString csrfTokenHeader, + std::optional<QString> csrfTokenHeader, QString csrfToken, std::optional<QString> checkCredentialsUrl, std::optional<QString> namedFiltersUrl, @@ -1784,7 +1812,8 @@ namespace Axivion::Internal::Dto std::optional<QString> userApiTokenUrl, std::optional<QString> userNamedFiltersUrl, std::optional<QString> supportAddress, - std::optional<QString> issueFilterHelp + std::optional<QString> issueFilterHelp, + std::optional<QString> csrfTokenUrl ); virtual QByteArray serialize() const override; From 1439d3170b0a3109936980b8a567c5574ec1ef34 Mon Sep 17 00:00:00 2001 From: Andreas Loth <andreas.loth@qt.io> Date: Fri, 15 Sep 2023 12:31:25 +0200 Subject: [PATCH 1216/1777] Axivion: Set accept header Without correct accept header the server tends to react in unexpected ways in non-good cases. Change-Id: I79e5084c2f0921679ece7e88ec9572f2c4f3beec Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/axivion/dashboard/dashboardclient.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/axivion/dashboard/dashboardclient.cpp b/src/plugins/axivion/dashboard/dashboardclient.cpp index 5c7b60adb3a..f13941e50b3 100644 --- a/src/plugins/axivion/dashboard/dashboardclient.cpp +++ b/src/plugins/axivion/dashboard/dashboardclient.cpp @@ -77,6 +77,8 @@ QFuture<DashboardClient::RawProjectInfo> DashboardClient::fetchProjectInfo(const .resolved(QUrl(QStringLiteral(u"api/projects/"))) .resolved(QUrl(projectName)); QNetworkRequest request{ url }; + request.setRawHeader(QByteArrayLiteral(u8"Accept"), + QByteArrayLiteral(u8"Application/Json")); request.setRawHeader(QByteArrayLiteral(u8"Authorization"), QByteArrayLiteral(u8"AxToken ") + server.token.toUtf8()); QByteArray ua = QByteArrayLiteral(u8"Axivion") From fc9059d180cddfac21f145dcbb24cd56d9c99304 Mon Sep 17 00:00:00 2001 From: Andreas Loth <andreas.loth@qt.io> Date: Fri, 15 Sep 2023 14:38:48 +0200 Subject: [PATCH 1217/1777] Axivion: Store origin URL besides payload gotten from Dashboard This prepares using (relative) URLs gotten from Dashboard instead of using hard-coded ones. Change-Id: Iea19c4010eac1e3f30a33d495a738d37738dc083 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/axivion/axivionoutputpane.cpp | 13 +++++++------ src/plugins/axivion/axivionplugin.cpp | 12 ++++++------ src/plugins/axivion/axivionplugin.h | 4 ++-- src/plugins/axivion/dashboard/dashboardclient.cpp | 10 ++++++---- src/plugins/axivion/dashboard/dashboardclient.h | 14 +++++++++++++- 5 files changed, 34 insertions(+), 19 deletions(-) diff --git a/src/plugins/axivion/axivionoutputpane.cpp b/src/plugins/axivion/axivionoutputpane.cpp index 4124a6c2473..6e7836af8e5 100644 --- a/src/plugins/axivion/axivionoutputpane.cpp +++ b/src/plugins/axivion/axivionoutputpane.cpp @@ -94,21 +94,22 @@ void DashboardWidget::updateUi() delete child->widget(); delete child; } - std::shared_ptr<const Dto::ProjectInfoDto> info = AxivionPlugin::projectInfo(); - if (!info) + std::shared_ptr<const DashboardClient::ProjectInfo> projectInfo = AxivionPlugin::projectInfo(); + if (!projectInfo) return; - m_project->setText(info->name); - if (info->versions.empty()) + const Dto::ProjectInfoDto &info = projectInfo->data; + m_project->setText(info.name); + if (info.versions.empty()) return; - const Dto::AnalysisVersionDto &last = info->versions.back(); + const Dto::AnalysisVersionDto &last = info.versions.back(); if (last.linesOfCode.has_value()) m_loc->setText(QString::number(last.linesOfCode.value())); const QDateTime timeStamp = QDateTime::fromString(last.date, Qt::ISODate); m_timestamp->setText(timeStamp.isValid() ? timeStamp.toString("yyyy-MM-dd HH:mm:ss t") : Tr::tr("unknown")); - const std::vector<Dto::IssueKindInfoDto> &issueKinds = info->issueKinds; + const std::vector<Dto::IssueKindInfoDto> &issueKinds = info.issueKinds; auto toolTip = [issueKinds](const QString &prefix){ for (const Dto::IssueKindInfoDto &kind : issueKinds) { if (kind.prefix == prefix) diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index bd595a57b0b..35404e81c06 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -47,7 +47,7 @@ class AxivionPluginPrivate : public QObject public: void onStartupProjectChanged(); void fetchProjectInfo(const QString &projectName); - void handleProjectInfo(Utils::expected_str<Dto::ProjectInfoDto> rawInfo); + void handleProjectInfo(DashboardClient::RawProjectInfo rawInfo); void handleOpenedDocs(ProjectExplorer::Project *project); void onDocumentOpened(Core::IDocument *doc); void onDocumentClosed(Core::IDocument * doc); @@ -57,7 +57,7 @@ public: Utils::NetworkAccessManager *m_networkAccessManager = Utils::NetworkAccessManager::instance(); AxivionOutputPane m_axivionOutputPane; - std::shared_ptr<const Dto::ProjectInfoDto> m_currentProjectInfo; + std::shared_ptr<const DashboardClient::ProjectInfo> m_currentProjectInfo; bool m_runningQuery = false; }; @@ -122,7 +122,7 @@ void AxivionPlugin::fetchProjectInfo(const QString &projectName) dd->fetchProjectInfo(projectName); } -std::shared_ptr<const Dto::ProjectInfoDto> AxivionPlugin::projectInfo() +std::shared_ptr<const DashboardClient::ProjectInfo> AxivionPlugin::projectInfo() { QTC_ASSERT(dd, return {}); return dd->m_currentProjectInfo; @@ -207,14 +207,14 @@ void AxivionPluginPrivate::clearAllMarks() onDocumentClosed(doc); } -void AxivionPluginPrivate::handleProjectInfo(Utils::expected_str<Dto::ProjectInfoDto> rawInfo) +void AxivionPluginPrivate::handleProjectInfo(DashboardClient::RawProjectInfo rawInfo) { m_runningQuery = false; if (!rawInfo) { Core::MessageManager::writeFlashing(QStringLiteral(u"Axivion: ") + rawInfo.error()); return; } - m_currentProjectInfo = std::make_shared<const Dto::ProjectInfoDto>(std::move(rawInfo.value())); + m_currentProjectInfo = std::make_shared<const DashboardClient::ProjectInfo>(std::move(rawInfo.value())); m_axivionOutputPane.updateDashboard(); // handle already opened documents if (auto buildSystem = ProjectExplorer::ProjectManager::startupBuildSystem(); @@ -238,7 +238,7 @@ void AxivionPluginPrivate::onDocumentOpened(Core::IDocument *doc) Utils::FilePath relative = doc->filePath().relativeChildPath(project->projectDirectory()); // for now only style violations - AxivionQuery query(AxivionQuery::IssuesForFileList, {m_currentProjectInfo->name, "SV", + AxivionQuery query(AxivionQuery::IssuesForFileList, {m_currentProjectInfo->data.name, "SV", relative.path() } ); AxivionQueryRunner *runner = new AxivionQueryRunner(query, this); connect(runner, &AxivionQueryRunner::resultRetrieved, this, [this](const QByteArray &result){ diff --git a/src/plugins/axivion/axivionplugin.h b/src/plugins/axivion/axivionplugin.h index ff235d393ce..0d072dab236 100644 --- a/src/plugins/axivion/axivionplugin.h +++ b/src/plugins/axivion/axivionplugin.h @@ -3,7 +3,7 @@ #pragma once -#include "dashboard/dto.h" +#include "dashboard/dashboardclient.h" #include <extensionsystem/iplugin.h> @@ -26,7 +26,7 @@ public: ~AxivionPlugin() final; static void fetchProjectInfo(const QString &projectName); - static std::shared_ptr<const Dto::ProjectInfoDto> projectInfo(); + static std::shared_ptr<const DashboardClient::ProjectInfo> projectInfo(); private: void initialize() final; diff --git a/src/plugins/axivion/dashboard/dashboardclient.cpp b/src/plugins/axivion/dashboard/dashboardclient.cpp index f13941e50b3..7e1a2761ec3 100644 --- a/src/plugins/axivion/dashboard/dashboardclient.cpp +++ b/src/plugins/axivion/dashboard/dashboardclient.cpp @@ -30,7 +30,7 @@ static void deleteLater(QObject *obj) obj->deleteLater(); } -using RawBody = Utils::expected_str<QByteArray>; +using RawBody = Utils::expected_str<DataWithOrigin<QByteArray>>; class RawBodyReader final { @@ -48,7 +48,7 @@ public: return tl::make_unexpected(QString::number(error) + QLatin1String(": ") + m_reply->errorString()); - return m_reply->readAll(); + return DataWithOrigin(m_reply->url(), m_reply->readAll()); } private: @@ -56,12 +56,14 @@ private: }; template<typename T> -static Utils::expected_str<T> RawBodyParser(RawBody rawBody) +static Utils::expected_str<DataWithOrigin<T>> RawBodyParser(RawBody rawBody) { if (!rawBody) return tl::make_unexpected(std::move(rawBody.error())); try { - return { T::deserialize(rawBody.value()) }; + T data = T::deserialize(rawBody.value().data); + return DataWithOrigin(std::move(rawBody.value().origin), + std::move(data)); } catch (const Dto::invalid_dto_exception &e) { return tl::make_unexpected(QString::fromUtf8(e.what())); } diff --git a/src/plugins/axivion/dashboard/dashboardclient.h b/src/plugins/axivion/dashboard/dashboardclient.h index 544f1430b17..eda623b878b 100644 --- a/src/plugins/axivion/dashboard/dashboardclient.h +++ b/src/plugins/axivion/dashboard/dashboardclient.h @@ -13,14 +13,26 @@ #include <utils/networkaccessmanager.h> #include <QFuture> +#include <QNetworkReply> namespace Axivion::Internal { +template<typename T> +class DataWithOrigin +{ +public: + QUrl origin; + T data; + + DataWithOrigin(QUrl origin, T data) : origin(std::move(origin)), data(std::move(data)) { } +}; + class DashboardClient { public: - using RawProjectInfo = Utils::expected_str<Dto::ProjectInfoDto>; + using ProjectInfo = DataWithOrigin<Dto::ProjectInfoDto>; + using RawProjectInfo = Utils::expected_str<ProjectInfo>; DashboardClient(Utils::NetworkAccessManager &networkAccessManager); From 16018b383405a2063784431303315e7ae1314e44 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Mon, 18 Sep 2023 14:51:55 +0200 Subject: [PATCH 1218/1777] DAP: Add attach option to Python engine Change-Id: I3f7254387904441fa28ffb797646b81d100bf9e9 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/pydapengine.cpp | 16 +++++++++++++--- src/plugins/debugger/dap/pydapengine.h | 3 ++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index ef7177b3565..68dea4f0551 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -209,6 +209,11 @@ void installDebugpyPackage(const FilePath &pythonPath) process.waitForFinished(); } +bool PyDapEngine::isLocalAttachEngine() const +{ + return runParameters().startMode == AttachToLocalProcess; +} + void PyDapEngine::setupEngine() { QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); @@ -245,10 +250,15 @@ void PyDapEngine::setupEngine() CommandLine cmd{interpreter, {"-Xfrozen_modules=off", "-m", "debugpy", - "--listen", "127.0.0.1:5679", - "--wait-for-client", + "--listen", "127.0.0.1:5679"}}; + + if (isLocalAttachEngine()) { + cmd.addArgs({"--pid", QString::number(runParameters().attachPID.pid())}); + } else { + cmd.addArgs({"--wait-for-client", scriptFile.path(), - runParameters().inferior.workingDirectory.path()}}; + runParameters().inferior.workingDirectory.path()}); + } IDataProvider *dataProvider = new TcpSocketDataProvider(runParameters(), cmd, "127.0.0.1", 5679, this); diff --git a/src/plugins/debugger/dap/pydapengine.h b/src/plugins/debugger/dap/pydapengine.h index 406654919fd..f3b14031fa4 100644 --- a/src/plugins/debugger/dap/pydapengine.h +++ b/src/plugins/debugger/dap/pydapengine.h @@ -17,8 +17,9 @@ private: void quitDebugger() override; void setupEngine() override; - Utils::Process m_proc; + bool isLocalAttachEngine() const; + Utils::Process m_proc; const QLoggingCategory &logCategory() override { static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.python", From 5ec327d66df843b75a58a01c5b7d379319dceab6 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Mon, 18 Sep 2023 15:39:55 +0200 Subject: [PATCH 1219/1777] DAP: Fix remove breakpoint in Python engine - Added acceptsBreakpoint function needed for mixing debugger Change-Id: I6d4bc707527ce3d5e334a5332d1a806a27201d39 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/pydapengine.cpp | 31 ++++++++++++++++++++++++ src/plugins/debugger/dap/pydapengine.h | 8 +++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index 68dea4f0551..6de21a29f46 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -209,6 +209,37 @@ void installDebugpyPackage(const FilePath &pythonPath) process.waitForFinished(); } +bool PyDapEngine::acceptsBreakpoint(const BreakpointParameters &bp) const +{ + return bp.fileName.endsWith(".py"); +} + +void PyDapEngine::insertBreakpoint(const Breakpoint &bp) +{ + DapEngine::insertBreakpoint(bp); + notifyBreakpointInsertOk(bp); // Needed for Python support issue:1386 +} + +void PyDapEngine::removeBreakpoint(const Breakpoint &bp) +{ + DapEngine::removeBreakpoint(bp); + notifyBreakpointRemoveOk(bp); // Needed for Python support issue:1386 +} + +void PyDapEngine::updateBreakpoint(const Breakpoint &bp) +{ + DapEngine::updateBreakpoint(bp); + + /* Needed for Python support issue:1386 */ + BreakpointParameters parameters = bp->requestedParameters(); + if (parameters.enabled != bp->isEnabled()) { + parameters.pending = false; + bp->setParameters(parameters); + } + notifyBreakpointChangeOk(bp); + /* Needed for Python support issue:1386 */ +} + bool PyDapEngine::isLocalAttachEngine() const { return runParameters().startMode == AttachToLocalProcess; diff --git a/src/plugins/debugger/dap/pydapengine.h b/src/plugins/debugger/dap/pydapengine.h index f3b14031fa4..af28b3afef7 100644 --- a/src/plugins/debugger/dap/pydapengine.h +++ b/src/plugins/debugger/dap/pydapengine.h @@ -19,7 +19,13 @@ private: void setupEngine() override; bool isLocalAttachEngine() const; - Utils::Process m_proc; + bool acceptsBreakpoint(const BreakpointParameters &bp) const override; + /* Needed for Python support issue:1386 */ + void insertBreakpoint(const Breakpoint &bp) override; + void updateBreakpoint(const Breakpoint &bp) override; + void removeBreakpoint(const Breakpoint &bp) override; + /* Needed for Python support issue:1386 */ + const QLoggingCategory &logCategory() override { static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.python", From 41856dd2546533cb1eb3136ec1bb973ed0eb7606 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 14 Sep 2023 17:00:11 +0200 Subject: [PATCH 1220/1777] Core: Disentangle SettingsDatabase access There's nothing inherently tied to the main window here. Change-Id: I48ae09777a4408fc4c955d23fdee3483d8a97dd0 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/coreplugin.cpp | 2 + .../editormanager/editormanager.cpp | 9 ++- src/plugins/coreplugin/icore.cpp | 15 ---- src/plugins/coreplugin/icore.h | 2 - src/plugins/coreplugin/locator/locator.cpp | 48 ++++++------- src/plugins/coreplugin/mainwindow.cpp | 8 --- src/plugins/coreplugin/mainwindow.h | 3 - src/plugins/coreplugin/settingsdatabase.cpp | 72 ++++++++++++------- src/plugins/coreplugin/settingsdatabase.h | 50 ++++--------- src/plugins/webassembly/webassemblyemsdk.cpp | 46 ++++++------ 10 files changed, 114 insertions(+), 141 deletions(-) diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index c9eabf0a3b4..d1265d18efc 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -12,6 +12,7 @@ #include "mainwindow.h" #include "modemanager.h" #include "session.h" +#include "settingsdatabase.h" #include "themechooser.h" #include "actionmanager/actionmanager.h" @@ -96,6 +97,7 @@ CorePlugin::~CorePlugin() DesignMode::destroyModeIfRequired(); delete m_mainWindow; + SettingsDatabase::destroy(); setCreatorTheme(nullptr); } diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 18073e1de1d..8ce244e4256 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1201,7 +1201,7 @@ static QHash<QString, IEditorFactory *> fromMap(const QMap<QString, QVariant> &m void EditorManagerPrivate::saveSettings() { - ICore::settingsDatabase()->setValue(documentStatesKey, d->m_editorStates); + SettingsDatabase::setValue(documentStatesKey, d->m_editorStates); QtcSettings *qsettings = ICore::settings(); qsettings->setValueWithDefault(preferredEditorFactoriesKey, @@ -1224,10 +1224,9 @@ void EditorManagerPrivate::readSettings() qs->value(preferredEditorFactoriesKey).toMap()); setUserPreferredEditorTypes(preferredEditorFactories); - SettingsDatabase *settings = ICore::settingsDatabase(); - if (settings->contains(documentStatesKey)) { - d->m_editorStates = settings->value(documentStatesKey) - .value<QMap<QString, QVariant> >(); + if (SettingsDatabase::contains(documentStatesKey)) { + d->m_editorStates = SettingsDatabase::value(documentStatesKey) + .value<QMap<QString, QVariant>>(); } updateAutoSave(); diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 7128b79ee3f..fba0d66f1a5 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -362,21 +362,6 @@ QtcSettings *ICore::settings(QSettings::Scope scope) return PluginManager::globalSettings(); } -/*! - Returns the application's settings database. - - The settings database is meant as an alternative to the regular settings - object. It is more suitable for storing large amounts of data. The settings - are application wide. - - \sa SettingsDatabase - \sa settings() -*/ -SettingsDatabase *ICore::settingsDatabase() -{ - return m_mainwindow->settingsDatabase(); -} - /*! Returns the application's printer object. diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index 9192012b0b5..8b41b016419 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -28,7 +28,6 @@ namespace Utils { class InfoBar; } namespace Core { class Context; class IWizardFactory; -class SettingsDatabase; namespace Internal { class MainWindow; } @@ -69,7 +68,6 @@ public: QWidget *parent = nullptr); static Utils::QtcSettings *settings(QSettings::Scope scope = QSettings::UserScope); - static SettingsDatabase *settingsDatabase(); static QPrinter *printer(); static QString userInterfaceLanguage(); diff --git a/src/plugins/coreplugin/locator/locator.cpp b/src/plugins/coreplugin/locator/locator.cpp index cefce35a5b1..f4ee927e13b 100644 --- a/src/plugins/coreplugin/locator/locator.cpp +++ b/src/plugins/coreplugin/locator/locator.cpp @@ -155,26 +155,26 @@ void Locator::aboutToShutdown() void Locator::loadSettings() { - SettingsDatabase *settings = ICore::settingsDatabase(); + namespace DB = SettingsDatabase; // check if we have to read old settings // TOOD remove a few versions after 4.15 - const QString settingsGroup = settings->contains("Locator") ? QString("Locator") + const QString settingsGroup = DB::contains("Locator") ? QString("Locator") : QString("QuickOpen"); const Settings def; - settings->beginGroup(settingsGroup); - m_refreshTimer.setInterval(settings->value("RefreshInterval", 60).toInt() * 60000); - m_settings.useCenteredPopup = settings->value(kUseCenteredPopup, def.useCenteredPopup).toBool(); + DB::beginGroup(settingsGroup); + m_refreshTimer.setInterval(DB::value("RefreshInterval", 60).toInt() * 60000); + m_settings.useCenteredPopup = DB::value(kUseCenteredPopup, def.useCenteredPopup).toBool(); for (ILocatorFilter *filter : std::as_const(m_filters)) { - if (settings->contains(filter->id().toString())) { - const QByteArray state = settings->value(filter->id().toString()).toByteArray(); + if (DB::contains(filter->id().toString())) { + const QByteArray state = DB::value(filter->id().toString()).toByteArray(); if (!state.isEmpty()) filter->restoreState(state); } } - settings->beginGroup("CustomFilters"); + DB::beginGroup("CustomFilters"); QList<ILocatorFilter *> customFilters; - const QStringList keys = settings->childKeys(); + const QStringList keys = DB::childKeys(); int count = 0; const Id directoryBaseId(Constants::CUSTOM_DIRECTORY_FILTER_BASEID); const Id urlBaseId(Constants::CUSTOM_URL_FILTER_BASEID); @@ -188,12 +188,12 @@ void Locator::loadSettings() urlFilter->setIsCustomFilter(true); filter = urlFilter; } - filter->restoreState(settings->value(key).toByteArray()); + filter->restoreState(DB::value(key).toByteArray()); customFilters.append(filter); } setCustomFilters(customFilters); - settings->endGroup(); - settings->endGroup(); + DB::endGroup(); + DB::endGroup(); if (m_refreshTimer.interval() > 0) m_refreshTimer.start(); @@ -288,19 +288,19 @@ void Locator::saveSettings() const return; const Settings def; - SettingsDatabase *s = ICore::settingsDatabase(); - s->beginTransaction(); - s->beginGroup("Locator"); - s->remove(QString()); - s->setValue("RefreshInterval", refreshInterval()); - s->setValueWithDefault(kUseCenteredPopup, m_settings.useCenteredPopup, def.useCenteredPopup); + namespace DB = SettingsDatabase; + DB::beginTransaction(); + DB::beginGroup("Locator"); + DB::remove(QString()); + DB::setValue("RefreshInterval", refreshInterval()); + DB::setValueWithDefault(kUseCenteredPopup, m_settings.useCenteredPopup, def.useCenteredPopup); for (ILocatorFilter *filter : m_filters) { if (!m_customFilters.contains(filter) && filter->id().isValid()) { const QByteArray state = filter->saveState(); - s->setValueWithDefault(filter->id().toString(), state); + DB::setValueWithDefault(filter->id().toString(), state); } } - s->beginGroup("CustomFilters"); + DB::beginGroup("CustomFilters"); int i = 0; for (ILocatorFilter *filter : m_customFilters) { const char *prefix = filter->id().name().startsWith( @@ -308,12 +308,12 @@ void Locator::saveSettings() const ? kDirectoryFilterPrefix : kUrlFilterPrefix; const QByteArray state = filter->saveState(); - s->setValueWithDefault(prefix + QString::number(i), state); + DB::setValueWithDefault(prefix + QString::number(i), state); ++i; } - s->endGroup(); - s->endGroup(); - s->endTransaction(); + DB::endGroup(); + DB::endGroup(); + DB::endTransaction(); } /*! diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 47d66c32b46..9e7648e21c9 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -39,7 +39,6 @@ #include "progressmanager/progressmanager_p.h" #include "progressmanager/progressview.h" #include "rightpane.h" -#include "settingsdatabase.h" #include "statusbarmanager.h" #include "systemsettings.h" #include "vcsmanager.h" @@ -73,7 +72,6 @@ #include <QComboBox> #include <QDebug> #include <QDialogButtonBox> -#include <QFileInfo> #include <QMenu> #include <QMenuBar> #include <QMessageBox> @@ -112,9 +110,6 @@ MainWindow::MainWindow() : AppMainWindow() , m_coreImpl(new ICore(this)) , m_lowPrioAdditionalContexts(Constants::C_GLOBAL) - , m_settingsDatabase( - new SettingsDatabase(QFileInfo(PluginManager::settings()->fileName()).path(), - QCoreApplication::applicationName())) , m_progressManager(new ProgressManagerPrivate) , m_jsExpander(JsExpander::createGlobalJsExpander()) , m_vcsManager(new VcsManager) @@ -296,9 +291,6 @@ MainWindow::~MainWindow() delete m_jsExpander; m_jsExpander = nullptr; - - delete m_settingsDatabase; - m_settingsDatabase = nullptr; } void MainWindow::init() diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index 325176a5825..1a1fc8e11cc 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -36,7 +36,6 @@ class ProgressManager; class NavigationWidget; enum class Side; class RightPaneWidget; -class SettingsDatabase; class VcsManager; namespace Internal { @@ -71,7 +70,6 @@ public: ICore::OpenFilesFlags flags, const Utils::FilePath &workingDirectory = {}); - inline SettingsDatabase *settingsDatabase() const { return m_settingsDatabase; } virtual QPrinter *printer() const; IContext * currentContextObject() const; QStatusBar *statusBar() const; @@ -137,7 +135,6 @@ private: QStringList m_aboutInformation; Context m_highPrioAdditionalContexts; Context m_lowPrioAdditionalContexts; - SettingsDatabase *m_settingsDatabase = nullptr; mutable QPrinter *m_printer = nullptr; WindowSupport *m_windowSupport = nullptr; EditorManager *m_editorManager = nullptr; diff --git a/src/plugins/coreplugin/settingsdatabase.cpp b/src/plugins/coreplugin/settingsdatabase.cpp index db17606c494..d5be946796d 100644 --- a/src/plugins/coreplugin/settingsdatabase.cpp +++ b/src/plugins/coreplugin/settingsdatabase.cpp @@ -3,6 +3,8 @@ #include "settingsdatabase.h" +#include <extensionsystem/pluginmanager.h> + #include <QDir> #include <QMap> #include <QString> @@ -13,13 +15,14 @@ #include <QSqlError> #include <QSqlQuery> #include <QDebug> +#include <QCoreApplication> /*! - \class Core::SettingsDatabase + \namespace Core::SettingsDatabase \inheaderfile coreplugin/settingsdatabase.h \inmodule QtCreator - \brief The SettingsDatabase class offers an alternative to the + \brief The SettingsDatabase namespace offers an alternative to the application-wide QSettings that is more suitable for storing large amounts of data. @@ -28,19 +31,20 @@ rewriting the whole file each time one of the settings change. The SettingsDatabase API mimics that of QSettings. + + \sa settings() */ using namespace Core; -using namespace Core::Internal; +using namespace ExtensionSystem; enum { debug_settings = 0 }; -namespace Core { -namespace Internal { +namespace Core::SettingsDatabase { using SettingsMap = QMap<QString, QVariant>; -class SettingsDatabasePrivate +class SettingsDatabaseImpl { public: QString effectiveGroup() const @@ -65,12 +69,17 @@ public: QSqlDatabase m_db; }; -} // namespace Internal -} // namespace Core +static SettingsDatabaseImpl *d; -SettingsDatabase::SettingsDatabase(const QString &path, const QString &application) - : d(new SettingsDatabasePrivate) +void ensureImpl() { + if (d) + return; + + d = new SettingsDatabaseImpl; + + const QString path = QFileInfo(PluginManager::settings()->fileName()).path(); + const QString application = QCoreApplication::applicationName(); const QLatin1Char slash('/'); // TODO: Don't rely on a path, but determine automatically @@ -111,16 +120,21 @@ SettingsDatabase::SettingsDatabase(const QString &path, const QString &applicati } } -SettingsDatabase::~SettingsDatabase() +void destroy() { - sync(); + if (!d) + return; + + // TODO: Delay writing of dirty keys and save them here delete d; + d = nullptr; QSqlDatabase::removeDatabase(QLatin1String("settings")); } -void SettingsDatabase::setValue(const QString &key, const QVariant &value) +void setValue(const QString &key, const QVariant &value) { + ensureImpl(); const QString effectiveKey = d->effectiveKey(key); // Add to cache @@ -140,8 +154,9 @@ void SettingsDatabase::setValue(const QString &key, const QVariant &value) qDebug() << "Stored:" << effectiveKey << "=" << value; } -QVariant SettingsDatabase::value(const QString &key, const QVariant &defaultValue) const +QVariant value(const QString &key, const QVariant &defaultValue) { + ensureImpl(); const QString effectiveKey = d->effectiveKey(key); QVariant value = defaultValue; @@ -168,8 +183,9 @@ QVariant SettingsDatabase::value(const QString &key, const QVariant &defaultValu return value; } -bool SettingsDatabase::contains(const QString &key) const +bool contains(const QString &key) { + ensureImpl(); // check exact key // this already caches the value if (value(key).isValid()) @@ -187,8 +203,9 @@ bool SettingsDatabase::contains(const QString &key) const return false; } -void SettingsDatabase::remove(const QString &key) +void remove(const QString &key) { + ensureImpl(); const QString effectiveKey = d->effectiveKey(key); // Remove keys from the cache @@ -214,23 +231,27 @@ void SettingsDatabase::remove(const QString &key) query.exec(); } -void SettingsDatabase::beginGroup(const QString &prefix) +void beginGroup(const QString &prefix) { + ensureImpl(); d->m_groups.append(prefix); } -void SettingsDatabase::endGroup() +void endGroup() { + ensureImpl(); d->m_groups.removeLast(); } -QString SettingsDatabase::group() const +QString group() { + ensureImpl(); return d->effectiveGroup(); } -QStringList SettingsDatabase::childKeys() const +QStringList childKeys() { + ensureImpl(); QStringList children; const QString g = group(); @@ -243,21 +264,20 @@ QStringList SettingsDatabase::childKeys() const return children; } -void SettingsDatabase::beginTransaction() +void beginTransaction() { + ensureImpl(); if (!d->m_db.isOpen()) return; d->m_db.transaction(); } -void SettingsDatabase::endTransaction() +void endTransaction() { + ensureImpl(); if (!d->m_db.isOpen()) return; d->m_db.commit(); } -void SettingsDatabase::sync() -{ - // TODO: Delay writing of dirty keys and save them here -} +} // Core::SettingsDatabase diff --git a/src/plugins/coreplugin/settingsdatabase.h b/src/plugins/coreplugin/settingsdatabase.h index 745c0d659af..e4c4f5a6622 100644 --- a/src/plugins/coreplugin/settingsdatabase.h +++ b/src/plugins/coreplugin/settingsdatabase.h @@ -5,48 +5,28 @@ #include "core_global.h" -#include <QObject> -#include <QString> -#include <QStringList> #include <QVariant> -namespace Core { +namespace Core::SettingsDatabase { -namespace Internal { class SettingsDatabasePrivate; } +CORE_EXPORT void setValue(const QString &key, const QVariant &value); +CORE_EXPORT QVariant value(const QString &key, const QVariant &defaultValue = {}); -class CORE_EXPORT SettingsDatabase final -{ -public: - SettingsDatabase(const QString &path, const QString &application); - ~SettingsDatabase(); +CORE_EXPORT bool contains(const QString &key); +CORE_EXPORT void remove(const QString &key); - void setValue(const QString &key, const QVariant &value); - QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const; +CORE_EXPORT void beginGroup(const QString &prefix); +CORE_EXPORT void endGroup(); +CORE_EXPORT QString group(); +CORE_EXPORT QStringList childKeys(); - template<typename T> - void setValueWithDefault(const QString &key, const T &val, const T &defaultValue); - template<typename T> - void setValueWithDefault(const QString &key, const T &val); +CORE_EXPORT void beginTransaction(); +CORE_EXPORT void endTransaction(); - bool contains(const QString &key) const; - void remove(const QString &key); - - void beginGroup(const QString &prefix); - void endGroup(); - QString group() const; - QStringList childKeys() const; - - void beginTransaction(); - void endTransaction(); - - void sync(); - -private: - Internal::SettingsDatabasePrivate *d; -}; +CORE_EXPORT void destroy(); template<typename T> -void SettingsDatabase::setValueWithDefault(const QString &key, const T &val, const T &defaultValue) +void setValueWithDefault(const QString &key, const T &val, const T &defaultValue) { if (val == defaultValue) remove(key); @@ -55,7 +35,7 @@ void SettingsDatabase::setValueWithDefault(const QString &key, const T &val, con } template<typename T> -void SettingsDatabase::setValueWithDefault(const QString &key, const T &val) +void setValueWithDefault(const QString &key, const T &val) { if (val == T()) remove(key); @@ -63,4 +43,4 @@ void SettingsDatabase::setValueWithDefault(const QString &key, const T &val) setValue(key, QVariant::fromValue(val)); } -} // namespace Core +} // Core::SettingsDatabase diff --git a/src/plugins/webassembly/webassemblyemsdk.cpp b/src/plugins/webassembly/webassemblyemsdk.cpp index 8ad69804648..4ba3563c2ec 100644 --- a/src/plugins/webassembly/webassemblyemsdk.cpp +++ b/src/plugins/webassembly/webassemblyemsdk.cpp @@ -36,11 +36,11 @@ static QString emSdkEnvOutput(const FilePath &sdkRoot) return {}; const QDateTime ts = tsFile.lastModified(); - Core::SettingsDatabase *db = Core::ICore::settingsDatabase(); - if (db->value(emSdkEnvTSKey).toDateTime() == ts - && FilePath::fromVariant(db->value(emSdkEnvTSFileKey)) == tsFile - && db->contains(emSdkEnvOutputKey)) { - return db->value(emSdkEnvOutputKey).toString(); + namespace DB = Core::SettingsDatabase; + if (DB::value(emSdkEnvTSKey).toDateTime() == ts + && FilePath::fromVariant(DB::value(emSdkEnvTSFileKey)) == tsFile + && DB::contains(emSdkEnvOutputKey)) { + return DB::value(emSdkEnvOutputKey).toString(); } const bool isWindows = sdkRoot.osType() == OsTypeWindows; @@ -55,9 +55,9 @@ static QString emSdkEnvOutput(const FilePath &sdkRoot) } emSdkEnv.runBlocking(); const QString result = emSdkEnv.allOutput(); - db->setValue(emSdkEnvTSFileKey, tsFile.toVariant()); - db->setValue(emSdkEnvTSKey, ts); - db->setValue(emSdkEnvOutputKey, result); + DB::setValue(emSdkEnvTSFileKey, tsFile.toVariant()); + DB::setValue(emSdkEnvTSKey, ts); + DB::setValue(emSdkEnvOutputKey, result); return result; } @@ -103,11 +103,11 @@ QVersionNumber version(const FilePath &sdkRoot) return {}; const QDateTime ts = tsFile.lastModified(); - Core::SettingsDatabase *db = Core::ICore::settingsDatabase(); - if (db->value(emSdkVersionTSKey).toDateTime() == ts - && FilePath::fromVariant(db->value(emSdkVersionTSFileKey)) == tsFile - && db->contains(emSdkVersionKey)) { - return QVersionNumber::fromString(db->value(emSdkVersionKey).toString()); + namespace DB = Core::SettingsDatabase; + if (DB::value(emSdkVersionTSKey).toDateTime() == ts + && FilePath::fromVariant(DB::value(emSdkVersionTSFileKey)) == tsFile + && DB::contains(emSdkVersionKey)) { + return QVersionNumber::fromString(DB::value(emSdkVersionKey).toString()); } Environment env = sdkRoot.deviceEnvironment(); @@ -121,21 +121,21 @@ QVersionNumber version(const FilePath &sdkRoot) emcc.runBlocking(); const QString versionStr = emcc.cleanedStdOut(); const QVersionNumber result = QVersionNumber::fromString(versionStr); - db->setValue(emSdkVersionTSFileKey, tsFile.toVariant()); - db->setValue(emSdkVersionTSKey, ts); - db->setValue(emSdkVersionKey, result.toString()); + DB::setValue(emSdkVersionTSFileKey, tsFile.toVariant()); + DB::setValue(emSdkVersionTSKey, ts); + DB::setValue(emSdkVersionKey, result.toString()); return result; } void clearCaches() { - Core::SettingsDatabase *db = Core::ICore::settingsDatabase(); - db->remove(emSdkEnvTSFileKey); - db->remove(emSdkEnvTSKey); - db->remove(emSdkEnvOutputKey); - db->remove(emSdkVersionTSFileKey); - db->remove(emSdkVersionTSKey); - db->remove(emSdkVersionKey); + namespace DB = Core::SettingsDatabase; + DB::remove(emSdkEnvTSFileKey); + DB::remove(emSdkEnvTSKey); + DB::remove(emSdkEnvOutputKey); + DB::remove(emSdkVersionTSFileKey); + DB::remove(emSdkVersionTSKey); + DB::remove(emSdkVersionKey); } } // namespace WebAssembly::Internal::WebAssemblyEmSdk From c7dbea2cab75ba29116fe9793b00ac5bb0d489fd Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 21 Sep 2023 16:05:03 +0200 Subject: [PATCH 1221/1777] DAP: Move logCategory to source file from header file Change-Id: Idb18175b830b7a79454dcb867d7910804785d3ca Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/cmakedapengine.cpp | 7 +++++++ src/plugins/debugger/dap/cmakedapengine.h | 7 +------ src/plugins/debugger/dap/gdbdapengine.cpp | 7 +++++++ src/plugins/debugger/dap/gdbdapengine.h | 7 +------ src/plugins/debugger/dap/pydapengine.cpp | 7 +++++++ src/plugins/debugger/dap/pydapengine.h | 7 +------ 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp index 65a31f4c3a3..a2e38fd09a1 100644 --- a/src/plugins/debugger/dap/cmakedapengine.cpp +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -176,4 +176,11 @@ void CMakeDapEngine::updateBreakpoint(const Breakpoint &bp) /* Needed for CMake support issue:25176 */ } +const QLoggingCategory &CMakeDapEngine::logCategory() +{ + static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.cmake", + QtWarningMsg); + return logCategory; +} + } // namespace Debugger::Internal diff --git a/src/plugins/debugger/dap/cmakedapengine.h b/src/plugins/debugger/dap/cmakedapengine.h index 8a0f8b73359..c7d02e3b858 100644 --- a/src/plugins/debugger/dap/cmakedapengine.h +++ b/src/plugins/debugger/dap/cmakedapengine.h @@ -23,12 +23,7 @@ private: bool hasCapability(unsigned cap) const override; - const QLoggingCategory &logCategory() override - { - static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.cmake", - QtWarningMsg); - return logCategory; - } + const QLoggingCategory &logCategory() override; }; } // Debugger::Internal diff --git a/src/plugins/debugger/dap/gdbdapengine.cpp b/src/plugins/debugger/dap/gdbdapengine.cpp index 40c7eaa21b8..3934aebe9d8 100644 --- a/src/plugins/debugger/dap/gdbdapengine.cpp +++ b/src/plugins/debugger/dap/gdbdapengine.cpp @@ -161,4 +161,11 @@ void GdbDapEngine::setupEngine() m_dapClient->dataProvider()->start(); } +const QLoggingCategory &GdbDapEngine::logCategory() +{ + static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.gdb", + QtWarningMsg); + return logCategory; +} + } // namespace Debugger::Internal diff --git a/src/plugins/debugger/dap/gdbdapengine.h b/src/plugins/debugger/dap/gdbdapengine.h index b4205544b73..3638a6d3aba 100644 --- a/src/plugins/debugger/dap/gdbdapengine.h +++ b/src/plugins/debugger/dap/gdbdapengine.h @@ -20,12 +20,7 @@ private: bool isLocalAttachEngine() const; - const QLoggingCategory &logCategory() override - { - static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.gdb", - QtWarningMsg); - return logCategory; - } + const QLoggingCategory &logCategory() override; }; } // Debugger::Internal diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index 6de21a29f46..86342d1621d 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -299,4 +299,11 @@ void PyDapEngine::setupEngine() m_dapClient->dataProvider()->start(); } +const QLoggingCategory &PyDapEngine::logCategory() +{ + static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.python", + QtWarningMsg); + return logCategory; +} + } // namespace Debugger::Internal diff --git a/src/plugins/debugger/dap/pydapengine.h b/src/plugins/debugger/dap/pydapengine.h index af28b3afef7..1339c7f971a 100644 --- a/src/plugins/debugger/dap/pydapengine.h +++ b/src/plugins/debugger/dap/pydapengine.h @@ -26,12 +26,7 @@ private: void removeBreakpoint(const Breakpoint &bp) override; /* Needed for Python support issue:1386 */ - const QLoggingCategory &logCategory() override - { - static const QLoggingCategory logCategory = QLoggingCategory("qtc.dbg.dapengine.python", - QtWarningMsg); - return logCategory; - } + const QLoggingCategory &logCategory() override; }; } // Debugger::Internal From ffea46707e11c43c354d129c0f60c654e7fafd26 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 21 Sep 2023 15:57:23 +0200 Subject: [PATCH 1222/1777] DAP: Fix debugger stopping when python script is finished Change-Id: If5fda34c4b570ba49067260252323e031007a3b3 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/pydapengine.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index 86342d1621d..01ec0f4dcd3 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -68,6 +68,7 @@ public: &QTcpSocket::errorOccurred, this, &IDataProvider::readyReadStandardError); + connect(&m_proc, &Process::done, this, &TcpSocketDataProvider::kill); } ~TcpSocketDataProvider() { m_socket.disconnect(); } From cd0f917886714e08df99de9defc405ced8688166 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 5 Sep 2023 12:02:18 +0200 Subject: [PATCH 1223/1777] ProjectExplorer: Don't consider a host named icecc to be a compiler Change-Id: Ie916d3477cc187707a908e8bcc01999c4fc6c7f6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 6794234e820..96a55122a81 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -436,12 +436,12 @@ static Utils::FilePath findLocalCompiler(const Utils::FilePath &compilerPath, // Get the path to the compiler, ignoring direct calls to icecc and distcc as we cannot // do anything about those. - if (!isNetworkCompiler(compilerPath.parentDir().toString())) + if (!isNetworkCompiler(compilerPath.parentDir().path())) return compilerPath; // Filter out network compilers const FilePaths pathComponents = Utils::filtered(env.path(), [] (const FilePath &dirPath) { - return !isNetworkCompiler(dirPath.toString()); + return !isNetworkCompiler(dirPath.path()); }); // This effectively searches the PATH twice, once via pathComponents and once via PATH itself: From 1d5ecdb5c754107129b3b275b7fbbabbf7bcd513 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 21 Sep 2023 20:14:06 +0200 Subject: [PATCH 1224/1777] CMakeProjectManager: Non-toolbar icon variant for "Reload CMake Presets" Change-Id: Ieadbe94ce22367eaf0ea0da220150051e924a266 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index bff808bba27..f90a3b71735 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -47,7 +47,7 @@ CMakeManager::CMakeManager() , m_runCMakeActionContextMenu(new QAction(QIcon(), Tr::tr("Run CMake"), this)) , m_rescanProjectAction(new QAction(QIcon(), Tr::tr("Rescan Project"), this)) , m_reloadCMakePresetsAction( - new QAction(Utils::Icons::RELOAD_TOOLBAR.icon(), Tr::tr("Reload CMake Presets"), this)) + new QAction(Utils::Icons::RELOAD.icon(), Tr::tr("Reload CMake Presets"), this)) { Core::ActionContainer *mbuild = Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT); From ed1568309b2c7b11de0be952ea6468cb5427fbac Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 21 Sep 2023 19:11:01 +0200 Subject: [PATCH 1225/1777] CMakePM: Add CMake Profiler action Change-Id: I17f258834724c37f0933d18b6214851be1965913 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 10 +++- .../cmakeprojectmanager/cmakebuildsystem.h | 4 +- .../cmakeprojectconstants.h | 1 + .../cmakeprojectmanager.cpp | 50 +++++++++++++++++++ .../cmakeprojectmanager/cmakeprojectmanager.h | 2 + .../cmakeprojectmanager/fileapireader.cpp | 9 +++- .../cmakeprojectmanager/fileapireader.h | 3 +- .../ctfvisualizer/ctfvisualizertool.cpp | 19 ++++--- src/plugins/ctfvisualizer/ctfvisualizertool.h | 2 +- 9 files changed, 88 insertions(+), 12 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index fac54a782e4..0d3dd00149e 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -201,7 +201,8 @@ void CMakeBuildSystem::triggerParsing() m_reader.parse(reparseParameters & REPARSE_FORCE_CMAKE_RUN, reparseParameters & REPARSE_FORCE_INITIAL_CONFIGURATION, reparseParameters & REPARSE_FORCE_EXTRA_CONFIGURATION, - (reparseParameters & REPARSE_DEBUG) && isDebuggable); + (reparseParameters & REPARSE_DEBUG) && isDebuggable, + reparseParameters & REPARSE_PROFILING); } void CMakeBuildSystem::requestDebugging() @@ -806,6 +807,13 @@ void CMakeBuildSystem::runCMakeWithExtraArguments() reparse(REPARSE_FORCE_CMAKE_RUN | REPARSE_FORCE_EXTRA_CONFIGURATION | REPARSE_URGENT); } +void CMakeBuildSystem::runCMakeWithProfiling() +{ + qCDebug(cmakeBuildSystemLog) << "Requesting parse due \"CMake Profiler\" command"; + reparse(REPARSE_FORCE_CMAKE_RUN | REPARSE_URGENT | REPARSE_FORCE_EXTRA_CONFIGURATION + | REPARSE_PROFILING); +} + void CMakeBuildSystem::stopCMakeRun() { qCDebug(cmakeBuildSystemLog) << buildConfiguration()->displayName() diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h index d802797ebd6..cc27c599db5 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h @@ -71,6 +71,7 @@ public: void runCMake(); void runCMakeAndScanProjectTree(); void runCMakeWithExtraArguments(); + void runCMakeWithProfiling(); void stopCMakeRun(); bool persistCMakeState(); @@ -150,7 +151,8 @@ private: = (1 << 1), // Force initial configuration arguments to cmake REPARSE_FORCE_EXTRA_CONFIGURATION = (1 << 2), // Force extra configuration arguments to cmake REPARSE_URGENT = (1 << 3), // Do not delay the parser run by 1s - REPARSE_DEBUG = (1 << 4), // Start with debugging + REPARSE_DEBUG = (1 << 4), // Start with debugging + REPARSE_PROFILING = (1 << 5), // Start profiling }; void reparse(int reparseParameters); QString reparseParametersString(int reparseFlags); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h b/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h index 183e9501360..53180461f3e 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h @@ -10,6 +10,7 @@ const char CMAKE_MIMETYPE[] = "text/x-cmake"; const char CMAKE_PROJECT_MIMETYPE[] = "text/x-cmake-project"; const char CMAKE_EDITOR_ID[] = "CMakeProject.CMakeEditor"; const char RUN_CMAKE[] = "CMakeProject.RunCMake"; +const char RUN_CMAKE_PROFILER[] = "CMakeProject.RunCMakeProfiler"; const char CLEAR_CMAKE_CACHE[] = "CMakeProject.ClearCache"; const char RESCAN_PROJECT[] = "CMakeProject.RescanProject"; const char RUN_CMAKE_CONTEXT_MENU[] = "CMakeProject.RunCMakeContextMenu"; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index f90a3b71735..fc6be84a2b8 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -21,11 +21,15 @@ #include <cppeditor/cpptoolsreuse.h> +#include <debugger/analyzer/analyzerconstants.h> +#include <debugger/analyzer/analyzermanager.h> + #include <projectexplorer/buildmanager.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/projecttree.h> +#include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> #include <utils/checkablemessagebox.h> @@ -48,6 +52,7 @@ CMakeManager::CMakeManager() , m_rescanProjectAction(new QAction(QIcon(), Tr::tr("Rescan Project"), this)) , m_reloadCMakePresetsAction( new QAction(Utils::Icons::RELOAD.icon(), Tr::tr("Reload CMake Presets"), this)) + , m_cmakeProfilerAction(new QAction(QIcon(), Tr::tr("CMake Profiler"), this)) { Core::ActionContainer *mbuild = Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT); @@ -57,6 +62,8 @@ CMakeManager::CMakeManager() Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT); Core::ActionContainer *mfile = Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_FILECONTEXT); + Core::ActionContainer *manalyzer = + Core::ActionManager::actionContainer(Debugger::Constants::M_DEBUG_ANALYZER); const Core::Context projectContext(CMakeProjectManager::Constants::CMAKE_PROJECT_ID); const Core::Context globalContext(Core::Constants::C_GLOBAL); @@ -128,6 +135,16 @@ CMakeManager::CMakeManager() mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); connect(m_buildFileAction, &QAction::triggered, this, [this] { buildFile(); }); + // CMake Profiler + command = Core::ActionManager::registerAction(m_cmakeProfilerAction, + Constants::RUN_CMAKE_PROFILER, + globalContext); + command->setDescription(m_cmakeProfilerAction->text()); + manalyzer->addAction(command, Debugger::Constants::G_ANALYZER_TOOLS); + connect(m_cmakeProfilerAction, &QAction::triggered, this, [this] { + runCMakeWithProfiling(ProjectManager::startupBuildSystem()); + }); + connect(ProjectManager::instance(), &ProjectManager::startupProjectChanged, this, [this] { updateCmakeActions(ProjectTree::currentNode()); }); @@ -150,6 +167,7 @@ void CMakeManager::updateCmakeActions(Node *node) m_runCMakeActionContextMenu->setEnabled(visible); m_clearCMakeCacheAction->setVisible(visible); m_rescanProjectAction->setVisible(visible); + m_cmakeProfilerAction->setEnabled(visible); const bool reloadPresetsVisible = [project] { if (!project) @@ -180,6 +198,38 @@ void CMakeManager::runCMake(BuildSystem *buildSystem) cmakeBuildSystem->runCMake(); } +void CMakeManager::runCMakeWithProfiling(BuildSystem *buildSystem) +{ + auto cmakeBuildSystem = dynamic_cast<CMakeBuildSystem *>(buildSystem); + QTC_ASSERT(cmakeBuildSystem, return ); + + if (ProjectExplorerPlugin::saveModifiedFiles()) { + // cmakeBuildSystem->runCMakeWithProfiling() below will trigger Target::buildSystemUpdated + // which will ensure that the "cmake-profile.json" has been created and we can load the viewer + std::unique_ptr<QObject> context{new QObject}; + QObject *pcontext = context.get(); + QObject::connect(cmakeBuildSystem->target(), + &Target::buildSystemUpdated, + pcontext, + [context = std::move(context)]() mutable { + context.reset(); + Core::Command *ctfVisualiserLoadTrace = Core::ActionManager::command( + "Analyzer.Menu.StartAnalyzer.CtfVisualizer.LoadTrace"); + + if (ctfVisualiserLoadTrace) { + auto *action = ctfVisualiserLoadTrace->actionForContext( + Core::Constants::C_GLOBAL); + const FilePath file = TemporaryDirectory::masterDirectoryFilePath() + / "cmake-profile.json"; + action->setData(file.nativePath()); + emit ctfVisualiserLoadTrace->action()->triggered(); + } + }); + + cmakeBuildSystem->runCMakeWithProfiling(); + } +} + void CMakeManager::rescanProject(BuildSystem *buildSystem) { auto cmakeBuildSystem = dynamic_cast<CMakeBuildSystem *>(buildSystem); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h index c47d724c9b6..149fe65e1c4 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h @@ -25,6 +25,7 @@ private: void updateCmakeActions(ProjectExplorer::Node *node); void clearCMakeCache(ProjectExplorer::BuildSystem *buildSystem); void runCMake(ProjectExplorer::BuildSystem *buildSystem); + void runCMakeWithProfiling(ProjectExplorer::BuildSystem *buildSystem); void rescanProject(ProjectExplorer::BuildSystem *buildSystem); void buildFileContextMenu(); void buildFile(ProjectExplorer::Node *node = nullptr); @@ -39,6 +40,7 @@ private: QAction *m_buildFileContextMenu; QAction *m_reloadCMakePresetsAction; Utils::ParameterAction *m_buildFileAction; + QAction *m_cmakeProfilerAction; }; } // namespace Internal diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp index 080ba1bcf65..fed19ca3d2b 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.cpp +++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp @@ -84,7 +84,8 @@ void FileApiReader::resetData() void FileApiReader::parse(bool forceCMakeRun, bool forceInitialConfiguration, bool forceExtraConfiguration, - bool debugging) + bool debugging, + bool profiling) { qCDebug(cmakeFileApiMode) << "Parse called with arguments: ForceCMakeRun:" << forceCMakeRun << " - forceConfiguration:" << forceInitialConfiguration @@ -109,6 +110,12 @@ void FileApiReader::parse(bool forceCMakeRun, } } + if (profiling) { + const FilePath file = TemporaryDirectory::masterDirectoryFilePath() / "cmake-profile.json"; + args << "--profiling-format=google-trace" + << "--profiling-output=" + file.path(); + } + qCDebug(cmakeFileApiMode) << "Parameters request these CMake arguments:" << args; const FilePath replyFile = FileApiParser::scanForCMakeReplyFile(m_parameters.buildDirectory); diff --git a/src/plugins/cmakeprojectmanager/fileapireader.h b/src/plugins/cmakeprojectmanager/fileapireader.h index b013770982d..1bf1e80332d 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.h +++ b/src/plugins/cmakeprojectmanager/fileapireader.h @@ -41,7 +41,8 @@ public: void parse(bool forceCMakeRun, bool forceInitialConfiguration, bool forceExtraConfiguration, - bool debugging); + bool debugging, + bool profiling); void stop(); void stopCMakeRun(); diff --git a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp index 5b13573bb3f..22b6bd50473 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp +++ b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp @@ -58,7 +58,15 @@ CtfVisualizerTool::CtfVisualizerTool() m_loadJson.reset(new QAction(Tr::tr("Load JSON File"), options)); Core::Command *command = Core::ActionManager::registerAction(m_loadJson.get(), Constants::CtfVisualizerTaskLoadJson, globalContext); - connect(m_loadJson.get(), &QAction::triggered, this, &CtfVisualizerTool::loadJson); + connect(m_loadJson.get(), &QAction::triggered, this, [this] { + QString filename = m_loadJson->data().toString(); + if (filename.isEmpty()) + filename = QFileDialog::getOpenFileName(ICore::dialogParent(), + Tr::tr("Load Chrome Trace Format File"), + "", + Tr::tr("JSON File (*.json)")); + loadJson(filename); + }); options->addAction(command); m_perspective.setAboutToActivateCallback([this]() { createViews(); }); @@ -142,21 +150,18 @@ Timeline::TimelineZoomControl *CtfVisualizerTool::zoomControl() const return m_zoomControl.get(); } -void CtfVisualizerTool::loadJson() +void CtfVisualizerTool::loadJson(const QString &filename) { if (m_isLoading) return; - m_isLoading = true; - - QString filename = QFileDialog::getOpenFileName( - ICore::dialogParent(), Tr::tr("Load Chrome Trace Format File"), - "", Tr::tr("JSON File (*.json)")); if (filename.isEmpty()) { m_isLoading = false; return; } + m_isLoading = true; + auto *futureInterface = new QFutureInterface<void>(); auto *task = new QFuture<void>(futureInterface); diff --git a/src/plugins/ctfvisualizer/ctfvisualizertool.h b/src/plugins/ctfvisualizer/ctfvisualizertool.h index 647ea3cb74c..baea670d5cf 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertool.h +++ b/src/plugins/ctfvisualizer/ctfvisualizertool.h @@ -34,7 +34,7 @@ public: CtfTraceManager *traceManager() const; Timeline::TimelineZoomControl *zoomControl() const; - void loadJson(); + void loadJson(const QString &filename); private: void createViews(); From 0ae0b8493624385a88c78add4737844d60a1e3e6 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Wed, 13 Sep 2023 17:00:30 +0200 Subject: [PATCH 1226/1777] Doc: Edit "Specifying Code Style" and "Indenting Text or Code" Turn these topics into several how-to and reference topics. Task-number: QTCREATORBUG-29361 Change-Id: I8d6a7af2db7eff2c852c2cc491878ce29272b59b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../src/editors/creator-code-indentation.qdoc | 282 ++---------------- .../src/editors/creator-editors-options.qdoc | 4 +- .../editors/creator-editors-writing-code.qdoc | 2 +- .../creator-preferences-cpp-code-style.qdoc | 128 ++++++++ .../creator-only/creator-preferences-nim.qdoc | 34 +++ ...ator-preferences-text-editor-behavior.qdoc | 96 ++++++ .../howto/creator-only/creator-how-tos.qdoc | 2 + .../creator-only/creator-reference.qdoc | 12 + .../creator-projects-settings-code-style.qdoc | 58 ++-- .../creator-projects-settings-editor.qdoc | 2 +- .../creator-projects-settings-overview.qdoc | 2 +- doc/qtcreator/src/qtcreator-toc.qdoc | 11 +- ...reator-preferences-qtquick-code-style.qdoc | 46 +++ .../src/qtquick/qtquick-toolbars.qdoc | 5 +- .../src/qtdesignstudio-toc.qdoc | 4 +- .../src/views/qtquick-text-editor.qdoc | 2 +- 16 files changed, 388 insertions(+), 302 deletions(-) create mode 100644 doc/qtcreator/src/editors/creator-only/creator-preferences-cpp-code-style.qdoc create mode 100644 doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc create mode 100644 doc/qtcreator/src/editors/creator-preferences-text-editor-behavior.qdoc create mode 100644 doc/qtcreator/src/qtquick/creator-preferences-qtquick-code-style.qdoc diff --git a/doc/qtcreator/src/editors/creator-code-indentation.qdoc b/doc/qtcreator/src/editors/creator-code-indentation.qdoc index 8e175856347..aaf37d64b9c 100644 --- a/doc/qtcreator/src/editors/creator-code-indentation.qdoc +++ b/doc/qtcreator/src/editors/creator-code-indentation.qdoc @@ -2,30 +2,23 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-completing-code.html \page creator-indenting-code.html - \nextpage qt-quick-toolbars.html + \if defined(qtdesignstudio) + \previouspage creator-completing-code.html + \nextpage creator-preferences-text-editor-behavior.html + \else + \previouspage creator-how-tos.html + \endif - \title Indenting Text or Code + \ingroup creator-how-to-edit + + \title Indent text or code When you type text or code, it is indented automatically according to the selected text editor or code style preferences. Select a block to indent it when you press \key Tab. Press \key {Shift+Tab} to decrease the indentation. You can disable automatic indentation. - You can specify indentation for: - - \list - \if defined(qtcreator) - \li C++ files - \endif - \li QML files - \if defined(qtcreator) - \li Nim files - \endif - \li Other text files - \endlist - To fix the indentation in the file currently open in the editor, select options in the \uicontrol Edit > \uicontrol Advanced menu or use \l{Keyboard Shortcuts}{keyboard shortcuts}: @@ -47,11 +40,7 @@ select \uicontrol {Clean Whitespace}. \endlist - \section1 Specifying Indentation Settings - - You can also specify indentation separately for each project. You can - specify several sets of code style settings and easily switch between them. - In addition, you can import and export code style settings. + \section1 Automatically fix indentation To automatically fix indentation according to the indentation settings when you save the file, select \uicontrol Edit > \uicontrol Preferences > @@ -62,15 +51,20 @@ \image qtcreator-options-text-editor-behavior.png {Text Editor Behavior preferences} + \section1 Show whitespace in editor + To visualize whitespace in the editor, select \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Display > - \uicontrol {Visualize whitespace}. To visualize indentation, select - \uicontrol {Visualize Indent}. To adjust the color of the visualization, - change the value of the Visual Whitespace setting of the editor color scheme - in \uicontrol {Font & Colors}. + \uicontrol {Visualize whitespace}. + + To visualize indentation, select \uicontrol {Visualize Indent}. To adjust the + color of the visualization, change the value of the Visual Whitespace setting + of the editor color scheme in \uicontrol {Font & Colors}. \image qtcreator-options-text-editor-display.png {Text Editor Display preferences} + \section1 Display right margin + To help you keep line length at a particular number of characters, set the number of characters in the \uicontrol {Display right margin at column} field. To use a different color for the margin area, select the @@ -83,242 +77,8 @@ Then, use the ClangFormat \c ColumnLimit option to set the margin, for example. - \section1 Indenting C++ Files - - \QC uses the Clang \l{https://clang.llvm.org/docs/LibFormat.html}{LibFormat} - library to automatically format and indent C++ code. It enforces a coding - style for a project or the whole organization. - - To specify indentation settings for the C++ editor: - - \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol {C++}. - \image qtcreator-code-style-clang-format-global.webp {Code Style preferences} - \li In \uicontrol {Formatting mode}, select \uicontrol {Indenting Only} - to only indent code. Select \uicontrol {Full Formatting} to use the - \key {Ctrl+I} keyboard shortcut to format code instead of indenting. - Select \uicontrol Disable to turn off ClangFormat. - \li To apply the formatting while you type, select - \uicontrol {Format while typing}. - \li To apply the formatting to the edited code when you save the file, - select \uicontrol {Format edited code on file save}. - \li To change the ClangFormat style globally for all projects, - select \uicontrol {Override ClangFormat configuration file}. - \li In the \uicontrol {Current settings} field, select the settings to - modify and click \uicontrol Copy. - \li Give a name to the settings and click \uicontrol OK. - \li Click \uicontrol Edit to set - \l{https://clang.llvm.org/docs/ClangFormatStyleOptions.html} - {ClangFormat Style Options}. - \endlist - - In the other tabs, you can specify how to: - - \list - \li Interpret the \key Tab and \key Backspace key presses. - \li Indent the contents of classes, functions, blocks, and namespaces. - \li Indent braces in classes, namespaces, enums, functions, and blocks. - \li Control switch statements and their contents. - \li Align continuation lines. - \li Bind pointers (*) and references (&) in types and declarations to - identifiers, type names, or left or right \c const or \c volatile - keywords. - \li Name getter functions. - \endlist - - Use the live preview to see how the preferences change the indentation. - - \section2 Creating Project-Specific ClangFormat Files - - To override the \c {.clang-format} file for a particular project, create a - copy of the built-in style and edit its settings by selecting - \uicontrol Projects > \uicontrol {Project Settings} > - \uicontrol {Code Style} > \uicontrol Copy > \uicontrol Edit > - \uicontrol {ClangFormat} > - \uicontrol {Override ClangFormat configuration file}. - - \section2 Creating ClangFormat Files from Command Line - - You can create \c {.clang-format} files that have the configuration - options of a certain predefined style from the command line. For example, - to create a format file for the LLVM style, enter the following command: - - \badcode - clang-format -style=llvm -dump-config > .clang-format - \endcode - + \sa {C++ Code Style} \endif - \section1 Indenting QML Files - - To specify settings for the Qt Quick editor: - - \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Qt Quick}. - \li In the \uicontrol {Current settings} field, select the settings to - modify and click \uicontrol Copy. - \image qtcreator-options-code-style-qml.png {QML Code Style preferences} - \li Give a name to the settings and click \uicontrol OK. - \li Click \uicontrol Edit to specify code style settings for the project. - \image qtcreator-code-style-settings-edit-qtquick.png {Edit Code Style dialog} - \endlist - - You can specify how to interpret the \key Tab key presses and how to align - continuation lines. - - In \uicontrol {Line length}, you can adjust the maximum line length for - code lines. - - To specify different settings for a particular project, select - \uicontrol Projects > \uicontrol {Code Style}. - - \if defined(qtcreator) - \section1 Indenting Nim Files - - To specify settings for the Nim editor (experimental): - - \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Nim. - \li In the \uicontrol {Current settings} field, select the settings to - modify and click \uicontrol Copy. - \image qtcreator-options-code-style-nim.png {Nim Code Style preferences} - \li Give a name to the settings and click \uicontrol OK. - \li Click \uicontrol Edit to specify code style settings for the project. - \image qtcreator-code-style-settings-edit-nim.png {Edit Code Style dialog} - \endlist - - You can specify how to interpret the \key Tab key presses and how to align - continuation lines. - - To specify different settings for a particular project, select - \uicontrol Projects > \uicontrol {Code Style}. - \endif - - \section1 Indenting Other Text Files - - To specify indentation settings for text files that do not have C++ or - QML code (such as Python code files), select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Behavior. - - \image qtcreator-indentation.png {Text Editor Behavior preferences} - - To specify different settings for a particular project, select - \uicontrol Projects > \uicontrol Editor. - - You can specify how to interpret the \key Tab and \key Backspace key - presses and how to align continuation lines. - - \section1 Specifying Tab Settings - - You can specify tab settings at the following levels: - - \list - \if defined(qtcreator) - \li For all C++ files - \endif - \li For all QML files - \li For all other text files - \if defined(qtcreator) - \li For C++ files in a project - \endif - \li For QML files in a project - \li For other text files in a project - \endlist - - \section2 Specifying Tabs and Indentation - - You can specify tab policy and tab size in the - \uicontrol {Tabs and Indentation} group. In the \uicontrol {Tab policy} - field, select whether to use only spaces or only tabs for indentation, - or to use a mixture of them. - - By default, the tab length in code editor is 8 spaces and the indent size is - 4 spaces. You can specify the tab length and indent size separately for each - project and for different types of files. - - You can have continuation lines aligned with the previous line. In the - \uicontrol {Align continuation lines} field, select - \uicontrol {Not at all} to disable automatic alignment and indent - continuation lines to the logical depth. To always use spaces for alignment, - select \uicontrol {With Spaces}. To follow the \uicontrol {Tab policy}, - select \uicontrol {With Regular Indent}. - - \section1 Setting Typing Preferences - - When you type text or code, it is indented automatically according to the - selected text editor or code style preferences. To set typing preferences, - select \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > - \uicontrol Behavior > \uicontrol Typing. - - To disable automatic indentation, deselect the - \uicontrol {Enable automatic indentation} check box. - - You can specify how the indentation is decreased when you press - \uicontrol Backspace in the \uicontrol {Backspace indentation} field. To go - back one space at a time, select \uicontrol None. To decrease indentation - in leading white space by one level, select - \uicontrol {Follows Previous Indents}. To move back one tab length if the - character to the left of the cursor is a space, select - \uicontrol Unindents. - - You can specify whether the \key Tab key automatically indents text when you - press it. To automatically indent text, select \uicontrol Always in the - \uicontrol {Tab key performs auto-indent} field. To only indent text when - the cursor is located within leading white space, select \uicontrol {In - Leading White Space}. - - Your highlight definition file can have definitions for both multi and - single line comments. To apply the single line comment definition when - commenting out a selection, select \uicontrol {Prefer single line comments}. - - \if defined(qtcreator) - \section1 Specifying Settings for Content - - You can indent public, protected, and private statements and declarations - related to them within classes. - - You can also indent statements within functions and blocks and declarations - within namespaces. - - \image qtcreator-code-style-content.png {Content preferences} - - \section1 Specifying Settings for Braces - - You can indent class, namespace, enum and function declarations and code - blocks. - - \image qtcreator-code-style-braces.png {Braces preferences} - - \section1 Specifying Settings for Switch Statements - - You can indent case or default statements, or statements or blocks related - to them within switch statements. - - \image qtcreator-code-style-switch.png {Switch preferences} - - \section1 Specifying Alignment - - To align continuation lines to tokens after assignments, such as \c = or - \c +=, select the \uicontrol {Align after assignments} check box. You can - specify additional settings for aligning continuation lines in the - \uicontrol General tab. - - You can also add spaces to conditional statements, so that they are not - aligned with the following line. Usually, this only affects \c if - statements. - - \image qtcreator-code-style-alignment.png {Alignment preferences} - - \section1 Binding Pointers and References - - To bind pointers (\c *) and references (\c &) in types and declarations to - identifiers, type names, or left or right \c const or \c volatile keywords, - select the check boxes in the \uicontrol {Pointers and References} tab. - - The \c * and \c & characters are automatically bound to identifiers of - pointers to functions and pointers to arrays. - - \image qtcreator-pointers-references.png {Pointers and References preferences} - \endif + \sa {Behavior}, {Qt Quick Code Style}, {Keyboard Shortcuts} */ diff --git a/doc/qtcreator/src/editors/creator-editors-options.qdoc b/doc/qtcreator/src/editors/creator-editors-options.qdoc index 027b41bdef6..d56f130c122 100644 --- a/doc/qtcreator/src/editors/creator-editors-options.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-options.qdoc @@ -36,7 +36,7 @@ You can also specify indentation settings separately for C++ and QML files either globally or for the open project. For more information, see - \l{Indenting Text or Code}. + \l{Indent text or code}. You can perform the following configuration actions: @@ -54,7 +54,7 @@ {definition files for syntax highlighting} for other types of files than C++ or QML in \uicontrol {Generic Highlighter}. - \li Set \l{Indenting Text or Code}{tabs, indentation, the handling of + \li Set \l{Indent text or code}{tabs, indentation, the handling of whitespace, and mouse operations} in \uicontrol Behavior. \li Set various display properties, such as diff --git a/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc b/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc index 133f0b7686d..78f9fbd84a5 100644 --- a/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc @@ -51,7 +51,7 @@ \QC anticipates what you are going to write and completes code and code snippets for elements, properties, and IDs. - \li \l{Indenting Text or Code} + \li \l{Indent text or code} \QC indents text and code according to rules that you specify separately for files that have C++, QML, or diff --git a/doc/qtcreator/src/editors/creator-only/creator-preferences-cpp-code-style.qdoc b/doc/qtcreator/src/editors/creator-only/creator-preferences-cpp-code-style.qdoc new file mode 100644 index 00000000000..b8e9d5e38b6 --- /dev/null +++ b/doc/qtcreator/src/editors/creator-only/creator-preferences-cpp-code-style.qdoc @@ -0,0 +1,128 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-preferences-cpp-code-style.html + \previouspage creator-reference.html + + \ingroup creator-reference-preferences-cpp + + \title C++ Code Style + + \brief Set global code style for C++ files. + + \QC uses the Clang \l{https://clang.llvm.org/docs/LibFormat.html}{LibFormat} + library to automatically format and indent C++ code. It enforces a coding + style for a project or the whole organization. + + To specify global indentation settings for the C++ editor: + + \list 1 + \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol {C++}. + \image qtcreator-code-style-clang-format-global.webp {Code Style preferences} + \li In \uicontrol {Formatting mode}, select: + \list + \li \uicontrol {Indenting Only} to only indent code. + \li \uicontrol {Full Formatting} to use the \key {Ctrl+I} + keyboard shortcut to format code instead of indenting. + \li \uicontrol Disable to turn off ClangFormat. + \endlist + \li To apply the formatting while you type, select + \uicontrol {Format while typing}. + \li To apply the formatting to the edited code when you save the file, + select \uicontrol {Format edited code on file save}. + \li To change the ClangFormat style globally for all projects, + select \uicontrol {Override ClangFormat configuration file}. + \li In the \uicontrol {Current settings} field, select the settings to + modify and click \uicontrol Copy. + \li Give a name to the settings and click \uicontrol OK. + \li Click \uicontrol Edit to set + \l{https://clang.llvm.org/docs/ClangFormatStyleOptions.html} + {ClangFormat Style Options}. + \endlist + + In the other tabs, you can specify how to: + + \list + \li Interpret the \key Tab and \key Backspace key presses. + \li Indent the contents of classes, functions, blocks, and namespaces. + \li Indent braces in classes, namespaces, enums, functions, and blocks. + \li Control switch statements and their contents. + \li Align continuation lines. + \li Bind pointers (*) and references (&) in types and declarations to + identifiers, type names, or left or right \c const or \c volatile + keywords. + \li Name getter functions. + \endlist + + Use the live preview to see how the preferences change the indentation. + + \section1 Specifying Settings for Content + + You can indent public, protected, and private statements and declarations + related to them within classes. + + You can also indent statements within functions and blocks and declarations + within namespaces. + + \image qtcreator-code-style-content.png {Content preferences} + + \section1 Specifying Settings for Braces + + You can indent class, namespace, enum and function declarations and code + blocks. + + \image qtcreator-code-style-braces.png {Braces preferences} + + \section1 Specifying Settings for Switch Statements + + You can indent case or default statements, or statements or blocks related + to them within switch statements. + + \image qtcreator-code-style-switch.png {Switch preferences} + + \section1 Specifying Alignment + + To align continuation lines to tokens after assignments, such as \c = or + \c +=, select the \uicontrol {Align after assignments} check box. You can + specify additional settings for aligning continuation lines in the + \uicontrol General tab. + + You can also add spaces to conditional statements, so that they are not + aligned with the following line. Usually, this only affects \c if + statements. + + \image qtcreator-code-style-alignment.png {Alignment preferences} + + \section1 Binding Pointers and References + + To bind pointers (\c *) and references (\c &) in types and declarations to + identifiers, type names, or left or right \c const or \c volatile keywords, + select the check boxes in the \uicontrol {Pointers and References} tab. + + The \c * and \c & characters are automatically bound to identifiers of + pointers to functions and pointers to arrays. + + \image qtcreator-pointers-references.png {Pointers and References preferences} + + \section1 Creating Project-Specific ClangFormat Files + + To override the \c {.clang-format} file for a particular project, create a + copy of the built-in style and edit its settings by selecting + \uicontrol Projects > \uicontrol {Project Settings} > + \uicontrol {Code Style} > \uicontrol Copy > \uicontrol Edit > + \uicontrol {ClangFormat} > + \uicontrol {Override ClangFormat configuration file}. + + \section1 Creating ClangFormat Files from Command Line + + You can create \c {.clang-format} files that have the configuration + options of a certain predefined style from the command line. For example, + to create a format file for the LLVM style, enter the following command: + + \badcode + clang-format -style=llvm -dump-config > .clang-format + \endcode + + \sa {Indent text or code}, {Behavior}, {Qt Quick Code Style}, {Nim} +*/ diff --git a/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc b/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc new file mode 100644 index 00000000000..e1d5d185087 --- /dev/null +++ b/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc @@ -0,0 +1,34 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-preferences-nim.html + \previouspage creator-reference.html + + \ingroup creator-reference-preferences + + \title Nim + + \brief Set Nim code style. + + To specify settings for the Nim editor (experimental): + + \list 1 + \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Nim. + \li In the \uicontrol {Current settings} field, select the settings to + modify and click \uicontrol Copy. + \image qtcreator-options-code-style-nim.png {Nim Code Style preferences} + \li Give a name to the settings and click \uicontrol OK. + \li Click \uicontrol Edit to specify code style settings for the project. + \image qtcreator-code-style-settings-edit-nim.png {Edit Code Style dialog} + \endlist + + You can specify how to interpret the \key Tab key presses and how to align + continuation lines. + + To specify different settings for a particular project, select + \uicontrol Projects > \uicontrol {Code Style}. + + \sa {Find a particular preference}, {Indent text or code}, + {Specify code style}, {Setting Up Nimble} +*/ diff --git a/doc/qtcreator/src/editors/creator-preferences-text-editor-behavior.qdoc b/doc/qtcreator/src/editors/creator-preferences-text-editor-behavior.qdoc new file mode 100644 index 00000000000..440d9a9e239 --- /dev/null +++ b/doc/qtcreator/src/editors/creator-preferences-text-editor-behavior.qdoc @@ -0,0 +1,96 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-preferences-text-editor-behavior.html + \if defined(qtdesignstudio) + \previouspage creator-indenting-code.html + \nextpage creator-preferences-qtquick-code-style.html + \else + \previouspage creator-reference.html + \endif + + \ingroup creator-reference-preferences-text-editor + + \title Behavior + + \brief Set preferences for the behavior of the text editor. + + To specify indentation settings for text files that do not have C++ or + QML code (such as Python code files), select \uicontrol Edit > + \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Behavior. + + \image qtcreator-indentation.png {Text Editor Behavior preferences} + + You can specify how to interpret the \key Tab and \key Backspace key + presses and how to align continuation lines. + + \section1 Specifying Tab Settings + + You can specify tab settings at the following levels: + + \list + \if defined(qtcreator) + \li For all C++ files + \endif + \li For all QML files + \li For all other text files + \if defined(qtcreator) + \li For C++ files in a project + \endif + \li For QML files in a project + \li For other text files in a project + \endlist + + \section2 Specifying Tabs and Indentation + + You can specify tab policy and tab size in the + \uicontrol {Tabs and Indentation} group. In the \uicontrol {Tab policy} + field, select whether to use only spaces or only tabs for indentation, + or to use a mixture of them. + + By default, the tab length in code editor is 8 spaces and the indent size is + 4 spaces. You can specify the tab length and indent size separately for each + project and for different types of files. + + You can have continuation lines aligned with the previous line. In the + \uicontrol {Align continuation lines} field, select + \uicontrol {Not at all} to disable automatic alignment and indent + continuation lines to the logical depth. To always use spaces for alignment, + select \uicontrol {With Spaces}. To follow the \uicontrol {Tab policy}, + select \uicontrol {With Regular Indent}. + + \section1 Setting Typing Preferences + + When you type text or code, it is indented automatically according to the + selected text editor or code style preferences. To set typing preferences, + select \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > + \uicontrol Behavior > \uicontrol Typing. + + To disable automatic indentation, deselect the + \uicontrol {Enable automatic indentation} check box. + + You can specify how the indentation is decreased when you press + \uicontrol Backspace in the \uicontrol {Backspace indentation} field. To go + back one space at a time, select \uicontrol None. To decrease indentation + in leading white space by one level, select + \uicontrol {Follows Previous Indents}. To move back one tab length if the + character to the left of the cursor is a space, select + \uicontrol Unindents. + + You can specify whether the \key Tab key automatically indents text when you + press it. To automatically indent text, select \uicontrol Always in the + \uicontrol {Tab key performs auto-indent} field. To only indent text when + the cursor is located within leading white space, select \uicontrol {In + Leading White Space}. + + Your highlight definition file can have definitions for both multi and + single line comments. To apply the single line comment definition when + commenting out a selection, select \uicontrol {Prefer single line comments}. + + \if defined(qtcreator) + \sa {Find a particular preference}, {C++ Code Style}, {Nim} + \endif + + \sa {Indent text or code}, {Qt Quick Code Style} +*/ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 2d00466ed24..bb28c643604 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -29,6 +29,7 @@ \list \li \l {Add code snippets to the auto-complete menu} \li \l {Enclose selected code in curly braces, parentheses, or double quotes} + \li \l {Indent text or code} \li \l {Jump to a function in QML code} \li \l {Locate files using the keyboard} \li \l {Move between open files} @@ -38,6 +39,7 @@ \li \l {Search and replace across files using a regular expression} \li \l {Select the enclosing block in C++} \li \l {Sort lines alphabetically} + \li \l {Specify code style} \li \l {Switch to Edit mode} \li \l {Write down notes} \endlist diff --git a/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc b/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc index dddfcd9840c..49bf944222f 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc @@ -23,6 +23,18 @@ \annotatedlist creator-reference-output-views + \section1 Preferences + + \annotatedlist creator-reference-preferences + + \section2 C++ + + \annotatedlist creator-reference-preferences-cpp + + \section2 Text Editor + + \annotatedlist creator-reference-preferences-text-editor + \section1 Sidebar Views \annotatedlist creator-reference-sidebar-views diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-code-style.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-code-style.qdoc index 083fd14fc38..bd90079372f 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-code-style.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-code-style.qdoc @@ -8,52 +8,44 @@ // ********************************************************************** /*! - \previouspage creator-editor-settings.html \page creator-code-style-settings.html - \nextpage creator-build-dependencies.html + \previouspage creator-how-tos.html - \title Specifying Code Style + \ingroup creator-how-to-edit - \QC uses the \l{Editing MIME Types}{MIME type} of the file to - determine which mode and editor to use for opening the file. - \QC opens C++ files in \uicontrol Edit mode in the C++ code editor and - QML files in the Qt Quick editor. + \title Specify code style - \QC uses ClangFormat to enforce the C++ code style specified in a - \c {.clang-format} file. It uses the - \l{https://clang.llvm.org/docs/LibFormat.html}{LibFormat} library for - automatic code formatting and indentation. For more information, see - \l {Indenting C++ Files}. + The \l{Editing MIME Types}{MIME type} of the file determines which mode + and editor the file opens in. \QC opens C++ files in \uicontrol Edit mode + in the C++ code editor and QML files in the Qt Quick editor. - \image qtcreator-code-style-clang-format-project.webp {Code Style settings in Projects mode} + You can specify indentation for: - In rare cases, ClangFormat can trip over a code construct and - trigger a \QC crash. If that happens for your project, select - \uicontrol {Formatting mode} > \uicontrol Disable to switch - ClangFormat off for the project. If you can reproduce the crash, - please select \uicontrol Help > \uicontrol {Report Bug} to report - the bug and and attach the code that triggers the crash. + \list + \li C++ files + \li QML files + \li Nim files + \li Other text files + \endlist - To specify a global code style for C++ files, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol C++. + You can specify code style either globally or separately for each project. + You can specify several sets of code style settings and easily switch between + them. In addition, you can import and export code style settings. - \image qtcreator-code-style-clang-format-global.webp {Code Style preferences} - - To specify a global code style for QML files, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Qt Quick}. - - \image qtcreator-code-style-settings-edit-qtquick.png {Code Style view} - - To configure the editor behavior for the current project: + To override the global code style for the current project: \list 1 \li Select \uicontrol Projects > \uicontrol {Project Settings} > \uicontrol {Code Style}. + \image qtcreator-code-style-clang-format-project.webp {Code Style settings in Projects mode} + \li In the \uicontrol Language field, select \uicontrol C++, \uicontrol {Qt Quick}, or \uicontrol Nim. + \li Deselect the \uicontrol {Use global settings} check box. + \li In the \uicontrol {Current settings} field, select the settings to modify and click \uicontrol Copy. @@ -63,6 +55,12 @@ \endlist - For more information about the settings, see \l{Indenting Text or Code}. + In rare cases, ClangFormat can trip over a code construct and + trigger a \QC crash. If that happens for your project, select + \uicontrol Disable as the formatting mode to switch + ClangFormat off for the project. If you can reproduce the crash, + please select \uicontrol Help > \uicontrol {Report Bug} to report + the bug and and attach the code that triggers the crash. + \sa {Indent text or code}, {C++ Code Style}, {Qt Quick Code Style}, {Nim} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc index fc35f3391e8..384874405a7 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc @@ -37,7 +37,7 @@ Click \uicontrol {Restore Global} to revert to the global settings. \sa {Configuring Fonts}, {File Encoding}, - {Moving to Symbol Definition or Declaration}, {Indenting Text or Code}, + {Moving to Symbol Definition or Declaration}, {Indent text or code}, {Highlighting and Folding Blocks}, {Selecting Line Ending Style}, {View function tooltips} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc index 37e7cd0ab25..2f2a2431c3a 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc @@ -39,7 +39,7 @@ \list \li \l{Parsing C++ Files with the Clang Code Model}{Clangd} \li \l{Using Clang Tools}{Clang Tools} - \li \l{Specifying Code Style}{Code Style} + \li \l{Specify code style}{C++ Code Style} \li \l{Using Custom Output Parsers}{Custom Output Parsers} \li \l{Specifying Dependencies}{Dependencies} \li \l{Specify editor settings}{Editor} diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index c5a20c5cd4e..2acd80cbf4d 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -43,7 +43,6 @@ \li \l{Conan Build Configuration} \endlist \li \l{Specifying Run Settings} - \li \l{Specifying Code Style} \li \l{Specifying Dependencies} \li \l{Specifying Environment Settings} \li \l{Using Custom Output Parsers} @@ -75,7 +74,6 @@ \li \l{Semantic Highlighting} \li \l{Checking Code Syntax} \li \l{Completing Code} - \li \l{Indenting Text or Code} \li \l{Using Qt Quick Toolbars} \li \l{Pasting and Fetching Code Snippets} \li \l{Using Text Editing Macros} @@ -196,6 +194,7 @@ \list \li \l {Add code snippets to the auto-complete menu} \li \l {Enclose selected code in curly braces, parentheses, or double quotes} + \li \l {Indent text or code} \li \l {Jump to a function in QML code} \li \l {Locate files using the keyboard} \li \l {Move between open files} @@ -205,6 +204,7 @@ \li \l {Search and replace across files using a regular expression} \li \l {Select the enclosing block in C++} \li \l {Sort lines alphabetically} + \li \l {Specify code style} \li \l {Switch to Edit mode} \li \l {Write down notes} \endlist @@ -299,6 +299,13 @@ \li \l {Search Results} \li \l {To-Do Entries} \endlist + \li Preferences + \list + \li \l {Behavior} + \li \l {C++ Code Style} + \li \l {Nim} + \li \l {Qt Quick Code Style} + \endlist \li Sidebar Views \list \li \l {Call Hierarchy} diff --git a/doc/qtcreator/src/qtquick/creator-preferences-qtquick-code-style.qdoc b/doc/qtcreator/src/qtquick/creator-preferences-qtquick-code-style.qdoc new file mode 100644 index 00000000000..6b179916457 --- /dev/null +++ b/doc/qtcreator/src/qtquick/creator-preferences-qtquick-code-style.qdoc @@ -0,0 +1,46 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-preferences-qtquick-code-style.html + \if defined(qtdesignstudio) + \previouspage creator-preferences-text-editor-behavior.html + \nextpage qt-quick-toolbars.html + \else + \previouspage creator-reference.html + \endif + + \ingroup creator-reference-preferences + + \title Qt Quick Code Style + + \brief Set QML code style. + + To specify QML code style globally: + + \list 1 + \li Select \uicontrol Edit > \uicontrol Preferences > + \uicontrol {Qt Quick}. + \li In the \uicontrol {Current settings} field, select the settings to + modify and click \uicontrol Copy. + \image qtcreator-options-code-style-qml.png {QML Code Style preferences} + \li Give a name to the settings and click \uicontrol OK. + \li Click \uicontrol Edit to specify code style settings for the project. + \image qtcreator-code-style-settings-edit-qtquick.png {Edit Code Style dialog} + \endlist + + You can specify how to interpret the \key Tab key presses and how to align + continuation lines. + + In \uicontrol {Line length}, you can adjust the maximum line length for + code lines. + + To override the global preferences for a particular project, select + \uicontrol Projects > \uicontrol {Code Style}. + + \sa {Indent text or code} + + \if defined(qtcreator) + \sa {Find a particular preference}, {Specify code style} + \endif +*/ diff --git a/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc b/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc index a1eea8edfb2..f5c3bafc894 100644 --- a/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,11 +8,12 @@ // ********************************************************************** /*! - \previouspage creator-indenting-code.html \page qt-quick-toolbars.html \if defined(qtdesignstudio) + \previouspage creator-preferences-qtquick-code-style.html \nextpage creator-diff-editor.html \else + \previouspage creator-completing-code.html \nextpage creator-editor-codepasting.html \endif diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index 92e15ced030..20b6df7c41c 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -204,7 +204,9 @@ \li \l{Semantic Highlighting} \li \l{Checking Code Syntax} \li \l{Completing Code} - \li \l{Indenting Text or Code} + \li \l{Indent text or code} + \li \l{Behavior} + \li \l{Qt Quick Code Style} \li \l{Using Qt Quick Toolbars} \li \l{Comparing Files} \endlist diff --git a/doc/qtdesignstudio/src/views/qtquick-text-editor.qdoc b/doc/qtdesignstudio/src/views/qtquick-text-editor.qdoc index 3b07e787ecc..948acd09c55 100644 --- a/doc/qtdesignstudio/src/views/qtquick-text-editor.qdoc +++ b/doc/qtdesignstudio/src/views/qtquick-text-editor.qdoc @@ -27,7 +27,7 @@ \li \l{Semantic Highlighting} \li \l{Checking Code Syntax} \li \l{Completing Code} - \li \l{Indenting Text or Code} + \li \l{Indent text or code} \li \l{Using Qt Quick Toolbars} \endlist */ From bd38c30759478bddb0a04c155f1e1c0107e6d7c6 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 19 Sep 2023 17:03:24 +0200 Subject: [PATCH 1227/1777] Doc: Reorganize info on kits Divide current topics into how-to and reference topics. Task-number: QTCREATORBUG-29361 Change-Id: I0e64b2bbe9d4f6d403815dffe937a567eb9d4844 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- doc/qtcreator/config/style/qt5-sidebar.html | 1 + doc/qtcreator/src/android/androiddev.qdoc | 2 +- .../src/baremetal/creator-baremetal-dev.qdoc | 2 +- .../src/cmake/creator-projects-cmake.qdoc | 2 +- .../creator-only/creator-debugger-setup.qdoc | 2 +- doc/qtcreator/src/docker/creator-docker.qdoc | 4 +- .../howto/creator-only/creator-how-tos.qdoc | 14 + doc/qtcreator/src/linux-mobile/b2qtdev.qdoc | 2 +- .../src/meson/creator-projects-meson.qdoc | 2 +- .../creator-only/creator-configuring.qdoc | 6 +- .../overview/creator-only/creator-issues.qdoc | 2 +- .../creator-custom-output-parser.qdoc | 2 +- .../creator-how-to-edit-qbs-profiles.qdoc | 43 +++ .../creator-projects-build-run-tutorial.qdoc | 6 +- .../creator-projects-compilers.qdoc | 315 +++++++++++------- .../creator-projects-debuggers.qdoc | 19 +- ...argets.qdoc => creator-projects-kits.qdoc} | 145 ++++---- .../creator-projects-opening.qdoc | 2 +- .../creator-only/creator-projects-qbs.qdoc | 2 +- .../creator-projects-qt-versions.qdoc | 46 +-- .../creator-projects-settings-overview.qdoc | 8 +- .../src/qnx/creator-developing-qnx.qdoc | 7 +- doc/qtcreator/src/qtcreator-toc.qdoc | 18 +- doc/qtcreator/src/qtcreator.qdoc | 2 + .../creator-only/qtquick-creating.qdoc | 4 +- ...uick-tutorial-create-empty-project.qdocinc | 2 +- 26 files changed, 385 insertions(+), 275 deletions(-) create mode 100644 doc/qtcreator/src/projects/creator-only/creator-how-to-edit-qbs-profiles.qdoc rename doc/qtcreator/src/projects/creator-only/{creator-projects-targets.qdoc => creator-projects-kits.qdoc} (68%) diff --git a/doc/qtcreator/config/style/qt5-sidebar.html b/doc/qtcreator/config/style/qt5-sidebar.html index c1745aec9d1..7ba89695cb1 100644 --- a/doc/qtcreator/config/style/qt5-sidebar.html +++ b/doc/qtcreator/config/style/qt5-sidebar.html @@ -87,6 +87,7 @@ <li><a href="creator-how-tos.html#design-uis">Design UIs</a></li> <li><a href="creator-how-tos.html#edit-code">Edit Code</a></li> <li><a href="creator-how-tos.html#manage-projects">Manage Projects</a></li> + <li><a href="creator-how-tos.html#build-and-run">Build and Run</a></li> <li><a href="creator-how-tos.html#read-qt-documentation">Read Qt Documentation</a></li> <li><a href="creator-how-tos.html#use-qt-creator">Use Qt Creator</a></li> <li><a href="creator-how-tos.html#use-the-ui">Use the UI</a></li> diff --git a/doc/qtcreator/src/android/androiddev.qdoc b/doc/qtcreator/src/android/androiddev.qdoc index 48c0cd8f273..d16d9a31fd3 100644 --- a/doc/qtcreator/src/android/androiddev.qdoc +++ b/doc/qtcreator/src/android/androiddev.qdoc @@ -162,7 +162,7 @@ To add custom NDK paths manually to the global list of NDKs, select \uicontrol Add. This creates custom tool chains and debuggers associated to that NDK. However, you have to manually create a kit that uses the - custom NDK. For more information, see \l{Adding Kits}. + custom NDK. For more information, see \l{Add kits}. \section2 Managing Android SDK Packages diff --git a/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc b/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc index 5d943b7ed7f..45740b650dc 100644 --- a/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc +++ b/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc @@ -266,7 +266,7 @@ To add a kit for building applications and running them on bare metal devices, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits - > \uicontrol Add. For more information, see \l{Adding Kits}. + > \uicontrol Add. For more information, see \l{Add kits}. \image qtcreator-baremetal-kit.png "Kit preferences for Bare Metal" diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc index 8d686f9f3fe..3b0a3d70a55 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc @@ -125,7 +125,7 @@ \image qtcreator-kits-cmake.png {Kits preferences} - For more information, see \l {Adding Kits}. + For more information, see \l {Add kits} and \l {Kits}. \section1 Editing CMake Configuration Files diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc index 564f93675f2..3de58c59ebc 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc @@ -16,7 +16,7 @@ \title Setting Up Debugger The main debugger preferences are associated with the - \l{Adding Kits}{kit} you build and run your project with. To + \l{Kits}{kit} you build and run your project with. To specify the debugger and compiler to use for each kit, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. diff --git a/doc/qtcreator/src/docker/creator-docker.qdoc b/doc/qtcreator/src/docker/creator-docker.qdoc index 33c358a5bed..c109aca5f94 100644 --- a/doc/qtcreator/src/docker/creator-docker.qdoc +++ b/doc/qtcreator/src/docker/creator-docker.qdoc @@ -18,8 +18,8 @@ To build, run, and debug applications on Docker devices, you must install and configure \c docker-cli on the development host. \QC automatically detects - \l{Adding Kits}{build and run kit} items, such \l{Adding Debuggers} - {debuggers} and \l{Adding Qt Versions}{Qt versions}, in the Docker container + \l{Kits}{build and run kit} items, such \l{Add debuggers} + {debuggers} and \l{Add Qt versions}{Qt versions}, in the Docker container and creates kits for the devices. You can use CMake or qmake to build applications in the Docker container. diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index bb28c643604..0b52935e487 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -75,6 +75,20 @@ \endlist \endtable + \section1 Build and Run + + \section2 Manage Kits + + \list + \li \l {Add compilers} + \li \l {Add custom compilers} + \li \l {Add debuggers} + \li \l {Add kits} + \li \l {Add Nim compilers} + \li \l {Add Qt versions} + \li \l {Edit Qbs profiles} + \endlist + \section1 Read Qt Documentation \list diff --git a/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc b/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc index 789b090ed65..00bc24e1224 100644 --- a/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc +++ b/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc @@ -18,7 +18,7 @@ To be able to run and debug applications on Boot2Qt devices, you must add devices and select them in the \QC - \l{Adding Kits}{kit}. + \l{Kits}{kit}. \section1 Enabling the Boot2Qt Plugin diff --git a/doc/qtcreator/src/meson/creator-projects-meson.qdoc b/doc/qtcreator/src/meson/creator-projects-meson.qdoc index 3e46abc5ed4..e38e820bef6 100644 --- a/doc/qtcreator/src/meson/creator-projects-meson.qdoc +++ b/doc/qtcreator/src/meson/creator-projects-meson.qdoc @@ -55,7 +55,7 @@ \image qtcreator-kits-meson.png "Setting Meson executable in Kit preferences" - For more information, see \l {Adding Kits}. + For more information, see \l {Kits}. \section1 Editing Meson Build Descriptions diff --git a/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc b/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc index 5fb9f2886cd..41991eebbde 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc @@ -48,7 +48,7 @@ To add kits, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > \uicontrol Add. - For more information, see \l{Adding Kits}. + For more information, see \l{Add kits}. Each kit consists of a set of values that define one environment, such as a \l{glossary-device}{device}, compiler, and Qt version. If \uicontrol Edit > @@ -58,12 +58,12 @@ If \uicontrol Auto-detected still does not show the Qt version, select \uicontrol {Add} to add it manually. - For more information, see \l{Adding Qt Versions}. + For more information, see \l{Add Qt versions}. Also check that \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > \uicontrol {Compilers} shows your compiler. - For more information, see \l{Adding Compilers}. + For more information, see \l{Add compilers}. You can connect devices to the development PC to run, debug, and analyze applications on them from \QC. You can connect the device to the diff --git a/doc/qtcreator/src/overview/creator-only/creator-issues.qdoc b/doc/qtcreator/src/overview/creator-only/creator-issues.qdoc index ca3b44304f7..593184d22b9 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-issues.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-issues.qdoc @@ -102,7 +102,7 @@ \li If error messages displayed in \l {Compile Output} have paths where slashes are missing (for example, C:QtSDK), check your PATH variable. For more information, see - \l{Troubleshooting MinGW Compilation Errors}. + \l{Troubleshoot MinGW compilation errors}. \endlist diff --git a/doc/qtcreator/src/projects/creator-only/creator-custom-output-parser.qdoc b/doc/qtcreator/src/projects/creator-only/creator-custom-output-parser.qdoc index aa4af6386c8..37fb44ee119 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-custom-output-parser.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-custom-output-parser.qdoc @@ -26,7 +26,7 @@ You can activate custom output parsers in the \uicontrol {Custom Output Parsers} section of the \uicontrol Build and \uicontrol Run settings, - as well as in the \l{Adding Custom Compilers} + as well as in the \l{Add custom compilers} {custom compiler settings}. \section1 Specifying Settings for Custom Output Parsers diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-edit-qbs-profiles.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-edit-qbs-profiles.qdoc new file mode 100644 index 00000000000..bbe2c7ea594 --- /dev/null +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-edit-qbs-profiles.qdoc @@ -0,0 +1,43 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-how-to-edit-qbs-profiles.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-build + + \title Edit Qbs profiles + + To view the Qbs profile associated with a kit, select \uicontrol Edit > + \uicontrol Preferences > \uicontrol Qbs > \uicontrol Profiles. + + \image creator-qbs-profiles.png "Qbs Profiles tab" + + You can add keys and values to the profile or remove them from it, as well + as modify existing values. For a list of available keys and values, see + \l{http://doc.qt.io/qbs/list-of-modules.html}{List of Modules} in the Qbs + Manual. + + To edit the Qbs profile associated with a kit: + + \list 1 + \li In \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits, select + the kit, and then select \uicontrol Change next to the + \uicontrol {Additional Qbs Profile Settings} field to open the + \uicontrol {Custom Properties} dialog. + \image qtcreator-qbs-profile-settings.png "Custom Properties dialog" + \li Double-click an empty cell in the \uicontrol Key column to specify + the key to add or modify as: \c <module_name>.<property_name>. + \li Double-click the cell on the same row in the \uicontrol Value column + to specify a value as a JSON literal. + \li Select \uicontrol Add to add the key-value pair. + \li Click \uicontrol OK. + \endlist + + To modify an existing value, double-click it in the \uicontrol Value field. + + To remove the selected property, select \uicontrol Remove. + + \sa {Activate kits for a project}, {Add kits}, {Kits} +*/ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc index 66bd2ce2b73..ef286dfb45e 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc @@ -37,7 +37,7 @@ \image qtcreator-gs-build-example-open.png "Selecting an example" If you cannot see any examples, check that the list of - \l{Adding Qt Versions}{Qt versions} (2) is not empty. If + \l{Add Qt versions}{Qt versions} (2) is not empty. If you select a Qt for Android or iOS, you can only see the examples that run on Android or iOS. @@ -56,7 +56,7 @@ If you installed \QC as part of a Qt installation, it should have automatically detected the installed kit. If you cannot see any kits, - see \l{Adding Kits}. + see \l{Add kits}. \li Click \inlineimage icons/run_small.png (\uicontrol Run) to build and run the application. @@ -65,7 +65,7 @@ \l {Compile Output}. If build errors occur, check that you have a Qt version, a - \l{Adding Compilers}{compiler}, and the necessary kits installed. If + \l{Add compilers}{compiler}, and the necessary kits installed. If you are building for an \l{Connecting Android Devices}{Android device} or \l{Connecting iOS Devices}{iOS device}, check that you set up the development environment correctly. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-compilers.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-compilers.qdoc index b156fef7ac0..e484735af22 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-compilers.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-compilers.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,17 +8,19 @@ // ********************************************************************** /*! - \previouspage creator-project-qmake.html \page creator-tool-chains.html - \nextpage creator-debuggers.html + \previouspage creator-how-tos.html - \title Adding Compilers + \ingroup creator-how-to-manage-kits - Qt is supported on a variety of 32-bit and 64-bit platforms, and can - usually be built on each platform with GCC, a vendor-supplied compiler, or - a third party compiler. In \QC, a \l{glossary-buildandrun-kit}{kit} - specifies the compiler and other necessary tools for building an application - for and running it on a particular platform. + \title Add compilers + + You can develop Qt applications on several 32-bit and 64-bit platforms. + Usually, you can build Qt applications on each platform with GCC, a + vendor-supplied compiler, or a third party compiler. In \QC, a + \l{glossary-buildandrun-kit}{kit} specifies the compiler and other + necessary tools for building an application for and running it on a + particular platform. \QC automatically detects the compilers that your system or \QOI registers and lists them in \uicontrol Edit > \uicontrol Preferences > @@ -32,65 +34,7 @@ \l{https://trac.macports.org/wiki/howto/ccache}{How to enable ccache} in the MacPorts wiki. - You can add the following compilers to build applications by using other - compilers or by using additional versions of the automatically detected - compilers: - - \list - - \li Clang is a C, C++, Objective C, and Objective C++ front-end for the - LLVM compiler for Windows, Linux, and \macos. - - \li \l{https://clang.llvm.org/docs/UsersManual.html#clang-cl}{clang-cl} - is an alternative command-line interface to Clang that is compatible - with the Visual C++ compiler, \c cl.exe. - - \li GNU Compiler Collection (GCC) is a compiler for Linux and - \macos. - - \li ICC (Intel C++ Compiler) is a group of C and C++ compilers. - Only the GCC-compatible variant, available for Linux and \macos, - is currently supported by \QC. - - \li \MinGW (Minimalist GNU for Windows) is a native software port of GCC - and GNU Binutils for use in the development of native Microsoft - Windows applications on Windows. \MinGW is distributed together with - \QC and Qt for Windows. - - \li MSVC (Microsoft Visual C++ Compiler) is a C++ compiler that is - installed with Microsoft Visual Studio. - - \li Nim is the Nim Compiler for Windows, Linux, and \macos. - - \li QCC is the interface for compiling C++ applications for QNX. - - \endlist - - In addition, the \QC Bare Metal Device plugin supports the - following compilers: - - \list - - \li \l{https://www.iar.com/iar-embedded-workbench/}{IAREW} is a group of - C and C++ bare-metal compilers from the various IAR Embedded Workbench - development environments. - Currently supported architectures are \c 8051, \c AVR, \c ARM, - \c STM8, and \c MSP430. - - \li \l{https://www.keil.com}{KEIL} is a group of C and C++ bare-metal - compilers from the various KEIL development environments. - Currently supported architectures are \c 8051 and \c ARM. - - \li \l{http://sdcc.sourceforge.net}{SDCC} is an optimizing - C bare-metal compiler for various architectures. - Currently supported architectures are \c 8051 and \c STM8. - - \endlist - - The emscripten compiler is tool chain for compiling to - \l{Building Applications for the Web}{WebAssembly}. - - \section1 Re-detecting Compilers + \section1 Re-detect compilers When \QC finds an x86_64 GCC compiler, it sets up an instance for the native x86_64 target. If you plan to create also 32-bit x86 binaries without using @@ -102,7 +46,140 @@ To remove manually added compilers, select \uicontrol Remove or \uicontrol {Remove All}. - \section1 Specifying Compiler Settings + \section1 Add C or C++ compilers + + To add a C or C++ compiler: + + \list 1 + \li Select \uicontrol Edit > \uicontrol Preferences > + \uicontrol Kits > \uicontrol Compilers. + \li Select \uicontrol Add to add a new compiler or \uicontrol Clone to + add another version of the selected compiler. + \li Select a compiler in the list. + \li Select \uicontrol C or \uicontrol C++. + \li Set \l{Compilers}{preferences} according to the selected compiler. + \endlist + + \section1 Supported compilers + + You can add the following compilers to build applications by using other + compilers or by using other versions of the automatically detected + compilers. + + \table + \header + \li Compiler + \li Description + \row + \li Clang + \li A C, C++, Objective C, and Objective C++ front-end for the + LLVM compiler for Windows, Linux, and \macos. + \row + \li \l{https://clang.llvm.org/docs/UsersManual.html#clang-cl}{clang-cl} + \li An alternative command-line interface to Clang that is compatible + with the Visual C++ compiler, \c cl.exe. + \row + \li GCC (GNU Compiler Collection) + \li A compiler for Linux and \macos. + \row + \li ICC (Intel C++ Compiler) + \li A group of C and C++ compilers. Only the GCC-compatible variant, + available for Linux and \macos, is currently supported by \QC. + \row + \li MinGW (Minimalist GNU for Windows) + \li A native software port of GCC and GNU Binutils for use in the + development of native Microsoft Windows applications on Windows. + \MinGW is distributed together with \QC and Qt for Windows. + \row + \li MSVC (Microsoft Visual C++ Compiler) + \li A C++ compiler that is installed with Microsoft Visual Studio. + \row + \li Nim + \li The Nim Compiler for Windows, Linux, and \macos. + \row + \li QCC + \li The interface for compiling C++ applications for QNX. + \row + \li Custom + \li Other than the listed compilers and remote compilers. + \endtable + + The emscripten compiler is tool chain for compiling to + \l{Building Applications for the Web}{WebAssembly}. + + \section2 Bare-metal compilers + + In addition, the \QC Bare Metal Device plugin supports the + following compilers. + + \table + \header + \li Compiler + \li Description + \row + \li \l{https://www.iar.com/iar-embedded-workbench/}{IAREW} + \li A group of C and C++ bare-metal compilers from the various + IAR Embedded Workbench development environments. + Currently supported architectures are \c 8051, \c AVR, \c ARM, + \c STM8, and \c MSP430. + \row + \li \l{https://www.keil.com}{KEIL} + \li A group of C and C++ bare-metal compilers from the various KEIL + development environments. + Currently supported architectures are \c 8051 and \c ARM. + \row + \li \l{http://sdcc.sourceforge.net}{SDCC} + \li An optimizing C bare-metal compiler for various architectures. + Currently supported architectures are \c 8051 and \c STM8. + \endtable + + \section1 Troubleshoot \MinGW compilation errors + + If error messages displayed in \l {Compile Output} contain + paths where slashes are missing (for example, \c {C:QtSDK}), + check your PATH variable. At the command line, enter the following commands: + + \code + where sh.exe + where make.exe + where mingw32-make.exe + \endcode + + If these commands show paths, they have been added to the global PATH + variable during the installation of a tool chain based on Cygwin or \MinGW, + even though this is against Windows conventions. + + To keep working with the third-party tool chain, create a new shell link + that adds the required paths (as Visual Studio and Qt do). The shell link + must point to cmd.exe: + + \c {C:\Windows\System32\cmd.exe /K C:\path_to\myenv.bat} + + where the /K parameter carries out the command specified in the bat file. + + Create the myenv.bat file at \e path_to, which should be in a convenient + location. In the file, specify the paths to the tool chains. For example, + + \c {set PATH=C:\path1;C:\path2;%PATH%} + + where \e path1 and \e path2 are paths to the tool chains. + + Finally, remove the paths from the global PATH, reboot the computer, and + run the \c where commands again to verify that the global PATH is now clean. + + You can use the shell link to run the tools in the third-party tool chains. + + \sa {Compilers}, {Add Nim compilers}, {Add custom compilers}, + {Connecting Bare Metal Devices}, {Supported Platforms} +*/ + +/*! + \page creator-preferences-kits-compilers.html + \previouspage creator-reference.html + + \ingroup creator-reference-preferences + + \title Compilers To build an application using GCC, \MinGW, Clang, or QCC, specify the path to the directory where the compiler is located and select @@ -120,20 +197,17 @@ You specify the compiler to use for each kit in \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. - To add a C or C++ compiler, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Kits > \uicontrol Compilers > \uicontrol Add. Select a compiler - in the list, and then select \uicontrol C or \uicontrol C++. - - To clone the selected compiler, select \uicontrol Clone. - - The settings to specify depend on the compiler: + To set compiler preferences according to the compiler type, select + \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > + \uicontrol Compilers: \list \li In the \uicontrol Name field, enter a name for the compiler to identify it in \QC. - \image qtcreator-options-cpp-compilers.png "Adding a clang-cl compiler" + \image qtcreator-options-cpp-compilers.png {Adding a clang-cl compiler} + \caption Adding a clang-cl compiler. \li In the \uicontrol Initialization field, select the \c {vcvarsall.bat} file for setting up the command @@ -146,11 +220,12 @@ to the compiler that specify the architecture on the target platform. - \li In the \uicontrol {Platform linker flags} field, check the flags passed to - the linker that specify the architecture on the target platform. - The linker flags are used only when building with Qbs. + \image qtcreator-options-clang-compilers.png {Adding a Clang compiler} + \caption Adding a Clang compiler. - \image qtcreator-options-clang-compilers.png "Adding a Clang compiler" + \li \b {When building with Qbs}: In the \uicontrol {Platform linker flags} + field, check the flags passed to the linker that specify the + architecture on the target platform. \li In the \uicontrol {Parent toolchain} field, select a \MinGW compiler, which is needed because Clang does not have its own @@ -159,7 +234,8 @@ \li In the \uicontrol {SPD path} field, specify the path to the QNX Software Development Platform (SDP). - \image qtcreator-options-qcc-compilers.png "Adding a QCC compiler" + \image qtcreator-options-qcc-compilers.png {Adding a QCC compiler} + \caption Adding a QCC compiler. \li In the \uicontrol ABI field, enter an identifier for the target architecture. This is used to warn about ABI mismatches @@ -170,22 +246,42 @@ Clang does not understand the target architecture, select \uicontrol {Override for code model}. - \image qtcreator-compilers-target-triple.png "Target triple field" - + \image qtcreator-compilers-target-triple.png {Target triple field} + \caption Target triple field. \endlist - \section1 Adding Nim Compilers + \sa {Add compilers}, {Add custom compilers}, {Add Nim compilers}, + {Supported Platforms} +*/ + +/*! + \page creator-how-to-add-nim-compilers.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-manage-kits + + \title Add Nim compilers To build an application using the Nim Compiler, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > \uicontrol Compilers > \uicontrol Add > \uicontrol Nim, and specify the path to the directory where the compiler is located. - \section1 Adding Custom Compilers + \sa {Add compilers}, {Compilers} +*/ - To add a compiler that is not listed above or a remote compiler, use the - \uicontrol Custom option and specify the paths to the directories where the - compiler and make tool are located and options for the compiler. +/*! + \page creator-how-to-add-custom-compilers.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-manage-kits + + \title Add custom compilers + + To add a compiler that is not listed \uicontrol Edit > \uicontrol Preferences + > \uicontrol Kits > \uicontrol Compilers or to add a remote compiler, use the + \uicontrol Custom option. Specify the paths to the directories where the + compiler and make tool are located and set preferences for the compiler. \image creator-compilers-custom.png @@ -223,44 +319,9 @@ to the Qt mkspecs directory. \li In the \uicontrol {Error parser} field, select the error parser to use. - You can add custom output parsers to the list. For more information, - see \l{Using Custom Output Parsers}. + You can add custom output parsers to the list. \endlist - \section1 Troubleshooting \MinGW Compilation Errors - - If error messages displayed in \l {Compile Output} contain - paths where slashes are missing (for example, \c {C:QtSDK}), - check your PATH variable. At the command line, enter the following commands: - - \code - where sh.exe - where make.exe - where mingw32-make.exe - \endcode - - If these commands show paths, they have been added to the global PATH - variable during the installation of a tool chain based on Cygwin or \MinGW, - even though this is against Windows conventions. - - To keep working with the third-party tool chain, create a new shell link - that adds the required paths (as Visual Studio and Qt do). The shell link - must point to cmd.exe: - - \c {C:\Windows\System32\cmd.exe /K C:\path_to\myenv.bat} - - where the /K parameter carries out the command specified in the bat file. - - Create the myenv.bat file at \e path_to, which should be in a convenient - location. In the file, specify the paths to the tool chains. For example, - - \c {set PATH=C:\path1;C:\path2;%PATH%} - - where \e path1 and \e path2 are paths to the tool chains. - - Finally, remove the paths from the global PATH, reboot the computer, and - run the \c where commands again to verify that the global PATH is now clean. - - You can use the shell link to run the tools in the third-party tool chains. - + \sa {Add compilers}, {Add Nim compilers}, {Compilers}, + {Using Custom Output Parsers} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-debuggers.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-debuggers.qdoc index a7d0aeb7b5e..4594fa34251 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-debuggers.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-debuggers.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2019 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,11 +8,12 @@ // ********************************************************************** /*! - \previouspage creator-tool-chains.html \page creator-debuggers.html - \nextpage creator-build-settings.html + \previouspage creator-how-tos.html - \title Adding Debuggers + \ingroup creator-how-to-manage-kits + + \title Add debuggers The \QC debugger plugin acts as an interface between the \QC core and external native debuggers such as the GNU Symbolic Debugger (GDB), @@ -24,10 +25,6 @@ To override this choice, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. - For more information about setting up the debugger, see - \l {Setting Up Debugger}. If you encounter problems, see - \l {Troubleshooting Debugger}. - To add debuggers: \list 1 @@ -35,7 +32,7 @@ \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > \uicontrol Debuggers > \uicontrol Add. - \image qtcreator-preferences-kits-debuggers.webp "Debuggers tab in Kits preferences" + \image qtcreator-preferences-kits-debuggers.webp {Debuggers tab in Kits preferences} \li In the \uicontrol Name field, give a descriptive name for the debugger. @@ -73,7 +70,11 @@ \endlist + \section1 Remove debuggers + To remove the selected manually added debugger, select \uicontrol Remove. The debugger disappears from the list when you select \uicontrol Apply. Until then, you can cancel the deletion by clicking \uicontrol Restore. + + \sa {Debugging}, {Setting Up Debugger}, {Troubleshooting Debugger} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-targets.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc similarity index 68% rename from doc/qtcreator/src/projects/creator-only/creator-projects-targets.qdoc rename to doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc index 08a6d988207..583751d1512 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-targets.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc @@ -8,77 +8,91 @@ // ********************************************************************** /*! - \previouspage creator-configuring-projects.html \page creator-targets.html - \nextpage creator-project-qmake.html + \previouspage creator-how-tos.html - \title Adding Kits + \ingroup creator-how-to-manage-kits - \QC groups settings used for building and running projects as kits + \title Add kits + + \QC groups settings used for building and running projects as \e kits to make cross-platform and cross-configuration development easier. Each kit consists of a set of values that define one environment, such as a \l{glossary-device}{device}, compiler, Qt version, and debugger command to use, and some metadata, such as an icon and a name for the kit. Once you have defined kits, you can select them to build and run projects. - \QC supports development for the desktop and for the following types of - devices: + You can add kits for the desktop and for the following types of devices: \list - \li \l{Connecting Android Devices}{Android Device} - \li \l{Connecting Bare Metal Devices}{Bare Metal Device} + \li \l{Connecting Android Devices}{Android} + \li \l{Connecting Bare Metal Devices}{Bare Metal} \li \l{https://doc.qt.io/Boot2Qt/b2qt-installation-guides.html} - {Boot2Qt Device} (commercial only) - \li \l{Emulator}{Boot2Qt Emulator Device} (commercial only) - \li \l{Adding Docker Devices}{Docker Device} (experimental) - \li \l{Connecting iOS Devices}{iOS Device} + {Boot2Qt} (commercial only) + \li \l{Emulator}{Boot2Qt Emulator} (commercial only) + \li \l{Adding Docker Devices}{Docker} (experimental) + \li \l{Connecting iOS Devices}{iOS} \li iOS Simulator - \li \l{Connecting MCUs}{MCU Device} (commercial only) - \li \l{Connecting QNX Devices}{QNX Device} - \li \l{Connecting Remote Linux Devices}{Remote Linux Device} + \li \l{Connecting MCUs}{MCU} (commercial only) + \li \l{Connecting QNX Devices}{QNX} + \li \l{Connecting Remote Linux Devices}{Remote Linux} \li \l{Building Applications for the Web}{WebAssembly Runtime} \endlist - \section1 Filtering Kit Settings - - Typically, only a subset of the kit settings is relevant for a particular - setup. Therefore, \QC plugins register sets of relevant settings that you - can view and modify in \uicontrol Edit > \uicontrol Preferences > - \uicontrol Kits. For example, if you use CMake to build all your projects, - you can hide Qbs and qmake settings by default. - - \image qtcreator-kits.png - - To hide and show settings in the \uicontrol Kits tab for the - current kit, select \uicontrol {Settings Filter}. To view and - modify the settings displayed when you add a new kit, select - \uicontrol {Default Settings Filter}. - - \section1 Specifying Kit Settings - To add kits: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > - \uicontrol Add. - - To clone the selected kit, select \uicontrol Clone. - - \li Specify kit settings. The settings to specify depend on the build - system and device type. + \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. + \li Select \uicontrol Add to start from an empty kit or \uicontrol Clone + to clone the selected kit and edit its preferences. + \image qtcreator-kits.png + \li Set \l{Kits}{kit preferences} according to the build system and + device type. \li Select \uicontrol OK to create the kit. \endlist + \section1 Set the default kit + \QC uses the \e {default kit} if it does not have enough information to choose the kit to use. To set the selected kit as the default kit, select \uicontrol {Make Default}. - \section2 Kit Settings + \sa {Activate kits for a project}, {Add debuggers}, {Add Qt versions}, + {Open projects}, {Compilers}, {Kits} +*/ - The following table summarizes the available kit settings. +/*! + \page creator-preferences-kits.html + \previouspage creator-reference.html + + \ingroup creator-reference-preferences + + \title Kits + + \brief Kit preferences. + + Typically, only a subset of the kit preferences is relevant for a particular + setup. Therefore, \QC plugins register sets of relevant preferences that you + can view and modify in \uicontrol Edit > \uicontrol Preferences > + \uicontrol Kits. For example, if you use CMake to build all your projects, + you can hide Qbs and qmake preferences by default. + + \image qtcreator-kits.png + + \section1 Filtering Kit Preferences + + To hide and show preferences in the \uicontrol Kits tab for the + current kit, select \uicontrol {Settings Filter}. + + To view and modify the preferences displayed when you add a new kit, select + \uicontrol {Default Settings Filter}. + + \section1 Kit Preferences + + The following table summarizes the available kit preferences. \table \header @@ -125,7 +139,7 @@ \li C or C++ compiler that you use to build the project. You can add compilers to the list if they are installed on the development PC, but were not detected automatically. For more information, see - \l{Adding Compilers}. + \l{Add compilers}. This setting is used to tell the code model which compiler is used. If your project type and build tool support it, \QC also tells the @@ -146,7 +160,7 @@ \li Debugger to debug the project on the target platform. \QC automatically detects available debuggers and displays a suitable debugger in the field. You can add debuggers to the list. - For more information, see \l{Adding Debuggers}. + For more information, see \l{Add debuggers}. For Android kits, the \uicontrol {Android GDB server} field will display the path to GDB server executable. @@ -154,7 +168,7 @@ \li \uicontrol {Qt version} \li Qt version to use for building the project. You can add Qt versions that \QC did not detect automatically. For more information, see - \l{Adding Qt Versions}. + \l{Add Qt versions}. \QC checks the directories listed in the \c{PATH} environment variable for the qmake executable. It refers to the qmake executable @@ -167,7 +181,7 @@ \row \li \uicontrol {Additional Qbs profile settings} \li Select \uicontrol Change to add settings to Qbs build profiles. - For more information, see \l {Editing Qbs Profiles}. + For more information, see \l {Edit Qbs profiles}. \row \li \uicontrol {CMake Tool} \li CMake executable to use for building the project. Select @@ -196,43 +210,6 @@ \uicontrol Manage to add installed Ninja tools to the list. \endtable - \section1 Editing Qbs Profiles - - To view the Qbs profile associated with the kit, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Qbs > \uicontrol Profiles. - - \image creator-qbs-profiles.png "Qbs Profiles tab" - - You can add keys and values to the profile or remove them from it, as well - as modify existing values. For a list of available keys and values, see - \l{http://doc.qt.io/qbs/list-of-modules.html}{List of Modules} in the Qbs - Manual. - - To edit the Qbs profile associated with the kit: - - \list 1 - - \li In \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits, select - the kit, and then select \uicontrol Change next to the - \uicontrol {Additional Qbs Profile Settings} field to open the - \uicontrol {Custom Properties} dialog. - - \image qtcreator-qbs-profile-settings.png "Custom Properties dialog" - - \li Double-click an empty cell in the \uicontrol Key column to specify - the key to add or modify as: \c <module_name>.<property_name>. - - \li Double-click the cell on the same row in the \uicontrol Value column - to specify a value as a JSON literal. - - \li Select \uicontrol Add to add the key-value pair. - - \li Click \uicontrol OK. - - \endlist - - To modify an existing value, double-click it in the \uicontrol Value field. - - To remove the selected property, select \uicontrol Remove. - + \sa {Activate kits for a project}, {Open projects}, {Add compilers}, + {Add debuggers}, {Add kits}, {Add Qt versions}, {Edit Qbs profiles} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc index 72714207d13..789dd63700c 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc @@ -113,5 +113,5 @@ later. Select the \inlineimage icons/pin.png (\uicontrol Pin) button to pin the progress bar back to the toggle button. - \sa {Adding Kits} + \sa {Activate kits for a project}, {Add kits}, {Kits}, */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc index fa663ba7609..deb2041ad6a 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc @@ -65,7 +65,7 @@ \li In the \uicontrol Kit field, select a build and run kit to view the properties of the associated profile. To modify the properties, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. - For more information, see \l{Editing Qbs Profiles}. + For more information, see \l{Edit Qbs profiles}. \endlist \section1 Related Topics diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-qt-versions.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-qt-versions.qdoc index 704a38ff436..1e6f3abf67a 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-qt-versions.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-qt-versions.qdoc @@ -1,4 +1,4 @@ -// 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 // ********************************************************************** @@ -8,33 +8,36 @@ // ********************************************************************** /*! - \previouspage creator-targets.html \page creator-project-qmake.html - \nextpage creator-tool-chains.html + \previouspage creator-how-tos.html - \title Adding Qt Versions + \ingroup creator-how-to-manage-kits - You can install multiple versions of Qt development PC and use them to build - your projects. For example, \l{glossary-device}{device} manufacturers offer - special Qt versions for developing applications for their devices. + \title Add Qt versions - \section1 Registering Installed Qt Versions + You can install multiple versions of Qt on the development PC and use them to + build your projects. For example, \l{glossary-device}{device} manufacturers + offer special Qt versions for developing applications for their devices. - The \uicontrol {Qt Versions} tab lists the installed Qt versions. To view - detailed information about each Qt version, select it in the list and select - \uicontrol Details in the \uicontrol {Qt version for} section. + To view the installed Qt versions, select \uicontrol Edit > + \uicontrol Preferences > \uicontrol Kits \uicontrol {Qt Versions}. - \image qtcreator-qt-versions.png "Qt Versions tab in Kit preferences" + \image qtcreator-qt-versions.png {Qt Versions tab in Kit preferences} + + To view detailed information about each Qt version, select it in the list and + select \uicontrol Details in the \uicontrol {Qt version for} section. To remove invalid Qt versions, select \uicontrol {Clean Up}. + \section1 Register installed Qt versions + You can link to a Qt that \QOI installed to automatically detect the installed Qt versions. However, you cannot link to a Qt that the system installed with some other package manager, such as your Linux distribution, brew on \macos, or Chocolatey on Windows, nor a self-built Qt. In those cases, select \uicontrol {Add} in the \uicontrol {Qt Versions} tab to add the Qt version manually, as - instructed in \l{Setting Up New Qt Versions}. + instructed in \l{Set up new Qt versions}. To link to a Qt installation: @@ -43,7 +46,7 @@ (or \uicontrol {Qt Creator} > \uicontrol Preferences on \macos) > \uicontrol Kits > \uicontrol {Qt Versions} > \uicontrol {Link with Qt}. - \image qtcreator-link-with-qt.png "Choose Qt Installation dialog" + \image qtcreator-link-with-qt.png {Choose Qt Installation dialog} \li In the \uicontrol {Qt installation path} field, enter the path to the directory where you installed Qt. \li Select \uicontrol {Link with Qt} to automatically register Qt @@ -55,15 +58,13 @@ \uicontrol {Remove Link}. If the \uicontrol {Qt Versions} tab does not show a Qt version - under \uicontrol Auto-detected, set it up manually, as described - in the following section. + under \uicontrol Auto-detected, set it up manually. You specify the Qt version to use for each \l{glossary-buildandrun-kit} {kit} for building and running your projects - in \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits, as described - in \l{Specifying Kit Settings}. + in \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. - \section1 Setting Up New Qt Versions + \section1 Set up new Qt versions To add a Qt version: @@ -90,7 +91,7 @@ To remove a Qt version that you added manually, select it in the \uicontrol Manual list and then select \uicontrol Remove. - \section1 Registering Documentation + \section1 Register documentation By default, \QC registers only the latest available version of the documentation for each installed Qt module. @@ -100,7 +101,7 @@ To register no Qt documentation at all, choose \uicontrol{None}. The default behavior is \uicontrol{Highest Version Only}. - \section1 Troubleshooting Qt Installations + \section1 Troubleshoot Qt installations If \QC detects problems in the installation of a Qt version, it displays warnings and errors beside the name of the Qt version in the list. Select @@ -115,7 +116,7 @@ Installer, run \QMT to check for updates or to reinstall the Qt version. - \section1 Minimum Requirements + \section1 Minimum requirements If your build of Qt is incomplete but you still want to use qmake as build system, you need to ensure the following minimum requirements to use that setup with \QC. @@ -131,5 +132,6 @@ If your Qt version has no \c libQtCore.so, \QC cannot detect the ABI. + \sa {Kits} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc index 2f2a2431c3a..2739bf352c1 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc @@ -84,12 +84,12 @@ \section1 Manage kits - To modify kit configuration or to \l{Adding Kits}{add kits} to the list or to + To modify kit configuration or to \l{Add kits}{add kits} to the list or to remove them from it, select \uicontrol {Manage Kits}. Each kit consists of a set of values that define one environment, such as a - \l{glossary-device}{device}, \l{Adding Compilers}{compiler}, - \l{Adding Debuggers}{debugger}, and \l{Adding Qt Versions}{Qt version}. + \l{glossary-device}{device}, \l{Add compilers}{compiler}, + \l{Add debuggers}{debugger}, and \l{Add Qt versions}{Qt version}. To copy the build and run settings for a kit to another kit, select \uicontrol {Copy Steps from Other Kit} in the context menu. @@ -103,5 +103,5 @@ To import an existing build for the project, select \uicontrol {Import Existing Build}. - \sa {Adding Kits}, {Configuring Projects} + \sa {Add kits}, {Configuring Projects}, {Kits} */ diff --git a/doc/qtcreator/src/qnx/creator-developing-qnx.qdoc b/doc/qtcreator/src/qnx/creator-developing-qnx.qdoc index cdf50eb5a08..8adb5ebe37e 100644 --- a/doc/qtcreator/src/qnx/creator-developing-qnx.qdoc +++ b/doc/qtcreator/src/qnx/creator-developing-qnx.qdoc @@ -22,10 +22,11 @@ you need to select \uicontrol {QNX Device} in the \uicontrol {Device Configuration} wizard. - \section1 Adding Kits for QNX Devices + \section1 Add kits for QNX Devices To view QNX device settings, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices > \uicontrol QNX. Select the \uicontrol {Generate kits} - check box to allow \QC to generate kits for QNX development. For more - information about how to create the kits manually, see \l {Adding Kits}. + check box to allow \QC to generate kits for QNX development. + + \sa {Add kits} */ diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 2acd80cbf4d..3b359dc72f2 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -26,10 +26,6 @@ \li \l{Creating Projects} \li \l{Configuring Projects} \list - \li \l{Adding Kits} - \li \l{Adding Qt Versions} - \li \l{Adding Compilers} - \li \l{Adding Debuggers} \li \l{Specifying Build Settings} \list \li \l{Cmake Build Configuration} @@ -227,7 +223,17 @@ \li \l {Specify project contents} \li \l {Use project wizards} \endlist - \li {Read Qt Documentation} + \li Build and Run + \list + \li \l {Add compilers} + \li \l {Add custom compilers} + \li \l {Add debuggers} + \li \l {Add kits} + \li \l {Add Nim compilers} + \li \l {Add Qt versions} + \li \l {Edit Qbs profiles} + \endlist + \li Read Qt Documentation \list \li \l {Add bookmarks to help pages} \li \l {Add external documentation} @@ -302,7 +308,9 @@ \li Preferences \list \li \l {Behavior} + \li \l {Compilers} \li \l {C++ Code Style} + \li \l {Kits} \li \l {Nim} \li \l {Qt Quick Code Style} \endlist diff --git a/doc/qtcreator/src/qtcreator.qdoc b/doc/qtcreator/src/qtcreator.qdoc index 12dd9430ebd..72d421c678c 100644 --- a/doc/qtcreator/src/qtcreator.qdoc +++ b/doc/qtcreator/src/qtcreator.qdoc @@ -96,6 +96,7 @@ \li \l{Design UIs} \li \l{Edit Code} \li \l{Manage Projects} + \li \l{Build and Run} \li \l{Read Qt Documentation} \li \l{Use \QC} \li \l{Use the UI} @@ -106,6 +107,7 @@ \li \l {Command-Line Options} \li \l {Custom Wizards} \li \l {Keyboard Shortcuts} + \li \l {Preferences} \li \l {Supported Platforms} \li \l {Reference}{See More...} \endlist diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc b/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc index e952d2a1e9b..93a0b3ee5ad 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc @@ -96,7 +96,7 @@ > \uicontrol Preferences > \uicontrol Kits (on Windows and Linux) or in \uicontrol {\QC} > \uicontrol Preferences > \uicontrol Kits (on \macos). - For more information, see \l {Adding Kits}. + For more information, see \l {Add kits} and \l {Kits}. \li Select \uicontrol Next to open the \uicontrol {Project Management} dialog. @@ -174,7 +174,7 @@ > \uicontrol Preferences > \uicontrol Kits (on Windows and Linux) or in \uicontrol {\QC} > \uicontrol Preferences > \uicontrol Kits (on \macos). - For more information, see \l {Adding Kits}. + For more information, see \l {Add kits} and \l {Kits}. \li Select \uicontrol Next to open the \uicontrol {Project Management} dialog. diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc b/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc index 8e439c3ce27..c6c11ebb917 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc @@ -46,7 +46,7 @@ > \uicontrol Preferences > \uicontrol Kits (on Windows and Linux) or in \uicontrol {\QC} > \uicontrol Preferences > \uicontrol Kits (on \macos). - For more information, see \l {Adding Kits}. + For more information, see \l {Add kits} and \l {Kits}. \li Select \uicontrol Next to open the \uicontrol {Project Management} dialog. From 3861608c63e848c6d8fe9977fc491c8ca9ddaa58 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 21 Sep 2023 17:26:35 +0200 Subject: [PATCH 1228/1777] AutoTest: Create sub-menu for "run test under cursor" actions No need to add all four variants to the top level of the context menu. Change-Id: Iffed7abdf06be5d6811b4dde83f27aa865627134 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/autotest/autotestplugin.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index edfac7559a4..0f93fb7dc75 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -307,43 +307,47 @@ void AutotestPlugin::extensionsInitialized() if (!contextMenu) // if QC is started without CppEditor plugin return; - QAction *action = new QAction(Tr::tr("&Run Test Under Cursor"), this); + ActionContainer * const runTestMenu = ActionManager::createMenu("Autotest.TestUnderCursor"); + runTestMenu->menu()->setTitle(Tr::tr("Run Test Under Cursor")); + contextMenu->addSeparator(); + contextMenu->addMenu(runTestMenu); + contextMenu->addSeparator(); + + QAction *action = new QAction(Tr::tr("&Run Test"), this); action->setEnabled(false); action->setIcon(Utils::Icons::RUN_SMALL.icon()); Command *command = ActionManager::registerAction(action, Constants::ACTION_RUN_UCURSOR); connect(action, &QAction::triggered, std::bind(&AutotestPluginPrivate::onRunUnderCursorTriggered, dd, TestRunMode::Run)); - contextMenu->addSeparator(); - contextMenu->addAction(command); + runTestMenu->addAction(command); - action = new QAction(Tr::tr("Run Test Under Cursor Without Deployment"), this); + action = new QAction(Tr::tr("Run Test Without Deployment"), this); action->setEnabled(false); action->setIcon(Utils::Icons::RUN_SMALL.icon()); command = ActionManager::registerAction(action, Constants::ACTION_RUN_UCURSOR_NODEPLOY); connect(action, &QAction::triggered, std::bind(&AutotestPluginPrivate::onRunUnderCursorTriggered, dd, TestRunMode::RunWithoutDeploy)); - contextMenu->addAction(command); + runTestMenu->addAction(command); - action = new QAction(Tr::tr("&Debug Test Under Cursor"), this); + action = new QAction(Tr::tr("&Debug Test"), this); action->setEnabled(false); action->setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL.icon()); command = ActionManager::registerAction(action, Constants::ACTION_RUN_DBG_UCURSOR); connect(action, &QAction::triggered, std::bind(&AutotestPluginPrivate::onRunUnderCursorTriggered, dd, TestRunMode::Debug)); - contextMenu->addAction(command); + runTestMenu->addAction(command); - action = new QAction(Tr::tr("Debug Test Under Cursor Without Deployment"), this); + action = new QAction(Tr::tr("Debug Test Without Deployment"), this); action->setEnabled(false); action->setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL.icon()); command = ActionManager::registerAction(action, Constants::ACTION_RUN_DBG_UCURSOR_NODEPLOY); connect(action, &QAction::triggered, std::bind(&AutotestPluginPrivate::onRunUnderCursorTriggered, dd, TestRunMode::DebugWithoutDeploy)); - contextMenu->addAction(command); - contextMenu->addSeparator(); + runTestMenu->addAction(command); } ExtensionSystem::IPlugin::ShutdownFlag AutotestPlugin::aboutToShutdown() From b0300ee48dcff11fa62fdb32f565e08485d9b040 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Thu, 21 Sep 2023 16:13:18 +0200 Subject: [PATCH 1229/1777] Doc: Turn "Specifying Dependencies" into a how-to topic Task-number: QTCREATORBUG-29361 Change-Id: I035ff1a99790c0af8c1abe12ab42f16411f346e0 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../src/howto/creator-only/creator-how-tos.qdoc | 1 + .../creator-projects-settings-dependencies.qdoc | 14 +++++++------- .../creator-projects-settings-overview.qdoc | 2 +- doc/qtcreator/src/qtcreator-toc.qdoc | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 0b52935e487..55151151a79 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -70,6 +70,7 @@ \li \l {Activate kits for a project} \li \l {Develop Qt for Python applications} \li \l {Open projects} + \li \l {Specify dependencies} \li \l {Specify editor settings} \li \l {Specify project contents} \endlist diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc index 61763c87579..6bc316b0e31 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc @@ -9,20 +9,20 @@ /*! \page creator-build-dependencies.html - \previouspage creator-code-style-settings.html - \nextpage creator-project-settings-environment.html + \previouspage creator-how-tos.html - \title Specifying Dependencies + \ingroup creator-how-to-projects + + \title Specify dependencies If you have multiple projects loaded in a session, you can define the order in which they are built. For example, if project A depends on project B, project B must be built first. \note The build order is stored as a property of a session, not a project. - You must open the session for these settings to take effect. For more - information, see \l{Managing Sessions}. + You must open the session for these settings to take effect. - \image qtcreator-build-dependencies.png "Dependencies view" + \image qtcreator-build-dependencies.png {Dependencies settings in Projects mode} To define the build order of projects within a session: @@ -46,6 +46,6 @@ \note You cannot use this view to specify subprojects for projects. - \sa {Add subprojects to projects} + \sa {Add subprojects to projects}, {Managing Sessions} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc index 2739bf352c1..2b71e1f5000 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc @@ -41,7 +41,7 @@ \li \l{Using Clang Tools}{Clang Tools} \li \l{Specify code style}{C++ Code Style} \li \l{Using Custom Output Parsers}{Custom Output Parsers} - \li \l{Specifying Dependencies}{Dependencies} + \li \l{Specify dependencies}{Dependencies} \li \l{Specify editor settings}{Editor} \li \l{Specifying Environment Settings}{Environment} \li \l{Applying Refactoring Actions}{Quick Fixes} diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 3b359dc72f2..6a5d621ed53 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -39,7 +39,6 @@ \li \l{Conan Build Configuration} \endlist \li \l{Specifying Run Settings} - \li \l{Specifying Dependencies} \li \l{Specifying Environment Settings} \li \l{Using Custom Output Parsers} \li \l{Sharing Project Settings} @@ -219,6 +218,7 @@ \li \l {Develop Qt for Python applications} \li \l {Open projects} \li \l {Select the build system} + \li \l {Specify dependencies} \li \l {Specify editor settings} \li \l {Specify project contents} \li \l {Use project wizards} From 8f27d2f79f92ea344802e71bca38df8de15daa72 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 21 Sep 2023 15:33:58 +0200 Subject: [PATCH 1230/1777] CppEditor: Properly group the menu actions Introduce four groups of actions (symbol, selection, file and global) and arrange them accordingly in the UI, with separators between them. Change-Id: If2468c8e88036c83c8ab7f040c5998f7ec8ffed6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/clangtools/clangtoolsplugin.cpp | 22 +- src/plugins/cppeditor/cppeditorconstants.h | 5 +- src/plugins/cppeditor/cppeditorplugin.cpp | 310 +++++++++++--------- src/plugins/cppeditor/cppeditorplugin.h | 4 + src/plugins/cppeditor/cppeditorwidget.cpp | 3 +- 5 files changed, 197 insertions(+), 147 deletions(-) diff --git a/src/plugins/clangtools/clangtoolsplugin.cpp b/src/plugins/clangtools/clangtoolsplugin.cpp index 5f4ed2654c2..6850cc96f42 100644 --- a/src/plugins/clangtools/clangtoolsplugin.cpp +++ b/src/plugins/clangtools/clangtoolsplugin.cpp @@ -138,6 +138,20 @@ void ClangToolsPlugin::onCurrentEditorChanged() void ClangToolsPlugin::registerAnalyzeActions() { + const char * const menuGroupId = "ClangToolsCppGroup"; + ActionContainer * const mtoolscpp + = ActionManager::actionContainer(CppEditor::Constants::M_TOOLS_CPP); + if (mtoolscpp) { + mtoolscpp->insertGroup(CppEditor::Constants::G_GLOBAL, menuGroupId); + mtoolscpp->addSeparator(menuGroupId); + } + Core::ActionContainer * const mcontext = Core::ActionManager::actionContainer( + CppEditor::Constants::M_CONTEXT); + if (mcontext) { + mcontext->insertGroup(CppEditor::Constants::G_GLOBAL, menuGroupId); + mcontext->addSeparator(menuGroupId); + } + for (const auto &toolInfo : {std::make_tuple(ClangTidyTool::instance(), Constants::RUN_CLANGTIDY_ON_PROJECT, Constants::RUN_CLANGTIDY_ON_CURRENT_FILE), @@ -148,14 +162,10 @@ void ClangToolsPlugin::registerAnalyzeActions() ActionManager::registerAction(tool->startAction(), std::get<1>(toolInfo)); Command *cmd = ActionManager::registerAction(tool->startOnCurrentFileAction(), std::get<2>(toolInfo)); - ActionContainer *mtoolscpp = ActionManager::actionContainer(CppEditor::Constants::M_TOOLS_CPP); if (mtoolscpp) - mtoolscpp->addAction(cmd); - - Core::ActionContainer *mcontext = Core::ActionManager::actionContainer( - CppEditor::Constants::M_CONTEXT); + mtoolscpp->addAction(cmd, menuGroupId); if (mcontext) - mcontext->addAction(cmd, CppEditor::Constants::G_CONTEXT_FIRST); + mcontext->addAction(cmd, menuGroupId); } // add button to tool bar of C++ source files diff --git a/src/plugins/cppeditor/cppeditorconstants.h b/src/plugins/cppeditor/cppeditorconstants.h index 179c3b3b9b0..ee8ec86a27e 100644 --- a/src/plugins/cppeditor/cppeditorconstants.h +++ b/src/plugins/cppeditor/cppeditorconstants.h @@ -9,7 +9,10 @@ namespace CppEditor { namespace Constants { const char M_CONTEXT[] = "CppEditor.ContextMenu"; -const char G_CONTEXT_FIRST[] = "CppEditor.GFirst"; +const char G_SYMBOL[] = "CppEditor.GSymbol"; +const char G_SELECTION[] = "CppEditor.GSelection"; +const char G_FILE[] = "CppEditor.GFile"; +const char G_GLOBAL[] = "CppEditor.GGlobal"; const char CPPEDITOR_ID[] = "CppEditor.C++Editor"; const char SWITCH_DECLARATION_DEFINITION[] = "CppEditor.SwitchDeclarationDefinition"; const char OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT[] = "CppEditor.OpenDeclarationDefinitionInNextSplit"; diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index daf5f844794..3f3c11bc73c 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -275,82 +275,52 @@ void CppEditorPlugin::extensionsInitialized() void CppEditorPlugin::setupMenus() { - ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS); - ActionContainer *mcpptools = ActionManager::createMenu(Constants::M_TOOLS_CPP); - QMenu *menu = mcpptools->menu(); - menu->setTitle(Tr::tr("&C++")); - menu->setEnabled(true); - mtools->addMenu(mcpptools); + ActionContainer * const cppToolsMenu = ActionManager::createMenu(Constants::M_TOOLS_CPP); + cppToolsMenu->menu()->setTitle(Tr::tr("&C++")); + cppToolsMenu->menu()->setEnabled(true); + ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(cppToolsMenu); + ActionContainer * const contextMenu = ActionManager::createMenu(Constants::M_CONTEXT); - Context context(Constants::CPPEDITOR_ID); - ActionContainer *contextMenu = ActionManager::createMenu(Constants::M_CONTEXT); - contextMenu->insertGroup(Core::Constants::G_DEFAULT_ONE, Constants::G_CONTEXT_FIRST); - ActionContainer *touchBar = ActionManager::actionContainer(Core::Constants::TOUCH_BAR); + for (ActionContainer * const menu : {cppToolsMenu, contextMenu}) { + menu->insertGroup(Core::Constants::G_DEFAULT_ONE, Constants::G_SYMBOL); + menu->insertGroup(Core::Constants::G_DEFAULT_ONE, Constants::G_SELECTION); + menu->insertGroup(Core::Constants::G_DEFAULT_ONE, Constants::G_FILE); + menu->insertGroup(Core::Constants::G_DEFAULT_ONE, Constants::G_GLOBAL); + menu->addSeparator(Constants::G_SELECTION); + menu->addSeparator(Constants::G_FILE); + menu->addSeparator(Constants::G_GLOBAL); + } - QAction *switchAction = new QAction(Tr::tr("Switch Header/Source"), this); - Command *cmd = ActionManager::registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, - context, true); - cmd->setTouchBarText(Tr::tr("Header/Source", "text on macOS touch bar")); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); - cmd->setDefaultKeySequence(QKeySequence(Qt::Key_F4)); - mcpptools->addAction(cmd); - connect(switchAction, &QAction::triggered, - this, [] { CppModelManager::switchHeaderSource(false); }); + addPerSymbolActions(); + addActionsForSelections(); + addPerFileActions(); + addGlobalActions(); - QAction *openInNextSplitAction - = new QAction(Tr::tr("Open Corresponding Header/Source in Next Split"), this); - cmd = ActionManager::registerAction( - openInNextSplitAction, Constants::OPEN_HEADER_SOURCE_IN_NEXT_SPLIT, context, true); - cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() - ? Tr::tr("Meta+E, F4") - : Tr::tr("Ctrl+E, F4"))); - mcpptools->addAction(cmd); - connect(openInNextSplitAction, &QAction::triggered, - this, [] { CppModelManager::switchHeaderSource(true); }); + ActionContainer * const toolsDebug + = ActionManager::actionContainer(Core::Constants::M_TOOLS_DEBUG); + QAction * const inspectCppCodeModel = new QAction(Tr::tr("Inspect C++ Code Model..."), this); + Command * const cmd = ActionManager::registerAction(inspectCppCodeModel, + Constants::INSPECT_CPP_CODEMODEL); + cmd->setDefaultKeySequence({useMacShortcuts ? Tr::tr("Meta+Shift+F12") + : Tr::tr("Ctrl+Shift+F12")}); + connect(inspectCppCodeModel, &QAction::triggered, + d, &CppEditorPluginPrivate::inspectCppCodeModel); + toolsDebug->addAction(cmd); +} - cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR); +void CppEditorPlugin::addPerSymbolActions() +{ + ActionContainer * const cppToolsMenu = ActionManager::actionContainer(Constants::M_TOOLS_CPP); + ActionContainer * const contextMenu = ActionManager::actionContainer(Constants::M_CONTEXT); + ActionContainer * const touchBar = ActionManager::actionContainer(Core::Constants::TOUCH_BAR); + const Context context(Constants::CPPEDITOR_ID); + + Command *cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR); cmd->setTouchBarText(Tr::tr("Follow", "text on macOS touch bar")); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - mcpptools->addAction(cmd); + contextMenu->addAction(cmd, Constants::G_SYMBOL); + cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); - QAction *openPreprocessorDialog = new QAction(Tr::tr("Additional Preprocessor Directives..."), - this); - cmd = ActionManager::registerAction(openPreprocessorDialog, - Constants::OPEN_PREPROCESSOR_DIALOG, context); - cmd->setDefaultKeySequence(QKeySequence()); - connect(openPreprocessorDialog, &QAction::triggered, - this, &CppEditorPlugin::showPreProcessorDialog); - mcpptools->addAction(cmd); - - QAction *switchDeclarationDefinition - = new QAction(Tr::tr("Switch Between Function Declaration/Definition"), this); - cmd = ActionManager::registerAction(switchDeclarationDefinition, - Constants::SWITCH_DECLARATION_DEFINITION, context, true); - cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Shift+F2"))); - cmd->setTouchBarText(Tr::tr("Decl/Def", "text on macOS touch bar")); - connect(switchDeclarationDefinition, &QAction::triggered, - this, &CppEditorPlugin::switchDeclarationDefinition); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - mcpptools->addAction(cmd); - touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); - - cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT); - mcpptools->addAction(cmd); - - QAction *openDeclarationDefinitionInNextSplit = - new QAction(Tr::tr("Open Function Declaration/Definition in Next Split"), this); - cmd = ActionManager::registerAction(openDeclarationDefinitionInNextSplit, - Constants::OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT, - context, true); - cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() - ? Tr::tr("Meta+E, Shift+F2") - : Tr::tr("Ctrl+E, Shift+F2"))); - connect(openDeclarationDefinitionInNextSplit, &QAction::triggered, - this, &CppEditorPlugin::openDeclarationDefinitionInNextSplit); - mcpptools->addAction(cmd); - QAction * const followSymbolToType = new QAction(Tr::tr("Follow Symbol Under Cursor to Type"), this); cmd = ActionManager::registerAction(followSymbolToType, Constants::FOLLOW_SYMBOL_TO_TYPE, @@ -360,8 +330,9 @@ void CppEditorPlugin::setupMenus() if (CppEditorWidget *editorWidget = currentCppEditorWidget()) editorWidget->followSymbolToType(false); }); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - mcpptools->addAction(cmd); + contextMenu->addAction(cmd, Constants::G_SYMBOL); + cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + QAction * const followSymbolToTypeInNextSplit = new QAction(Tr::tr("Follow Symbol to Type in Next Split"), this); cmd = ActionManager::registerAction(followSymbolToTypeInNextSplit, @@ -374,11 +345,38 @@ void CppEditorPlugin::setupMenus() if (CppEditorWidget *editorWidget = currentCppEditorWidget()) editorWidget->followSymbolToType(true); }); - mcpptools->addAction(cmd); + cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + + QAction * const switchDeclarationDefinition + = new QAction(Tr::tr("Switch Between Function Declaration/Definition"), this); + cmd = ActionManager::registerAction(switchDeclarationDefinition, + Constants::SWITCH_DECLARATION_DEFINITION, context, true); + cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Shift+F2"))); + cmd->setTouchBarText(Tr::tr("Decl/Def", "text on macOS touch bar")); + connect(switchDeclarationDefinition, &QAction::triggered, + this, &CppEditorPlugin::switchDeclarationDefinition); + contextMenu->addAction(cmd, Constants::G_SYMBOL); + cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); + + cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT); + cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + + QAction * const openDeclarationDefinitionInNextSplit = + new QAction(Tr::tr("Open Function Declaration/Definition in Next Split"), this); + cmd = ActionManager::registerAction(openDeclarationDefinitionInNextSplit, + Constants::OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT, + context, true); + cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() + ? Tr::tr("Meta+E, Shift+F2") + : Tr::tr("Ctrl+E, Shift+F2"))); + connect(openDeclarationDefinitionInNextSplit, &QAction::triggered, + this, &CppEditorPlugin::openDeclarationDefinitionInNextSplit); + cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); cmd = ActionManager::command(TextEditor::Constants::FIND_USAGES); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - mcpptools->addAction(cmd); + contextMenu->addAction(cmd, Constants::G_SYMBOL); + cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); d->m_findRefsCategorizedAction = new QAction(Tr::tr("Find References With Access Type"), this); cmd = ActionManager::registerAction(d->m_findRefsCategorizedAction, @@ -390,18 +388,84 @@ void CppEditorPlugin::setupMenus() codeModelSettings()->setCategorizeFindReferences(false); } }); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - mcpptools->addAction(cmd); + contextMenu->addAction(cmd, Constants::G_SYMBOL); + cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); cmd = ActionManager::command(TextEditor::Constants::RENAME_SYMBOL); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - mcpptools->addAction(cmd); + contextMenu->addAction(cmd, Constants::G_SYMBOL); + cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + + d->m_openTypeHierarchyAction = new QAction(Tr::tr("Open Type Hierarchy"), this); + cmd = ActionManager::registerAction(d->m_openTypeHierarchyAction, + Constants::OPEN_TYPE_HIERARCHY, context); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts + ? Tr::tr("Meta+Shift+T") : Tr::tr("Ctrl+Shift+T"))); + connect(d->m_openTypeHierarchyAction, &QAction::triggered, + this, &CppEditorPlugin::openTypeHierarchy); + contextMenu->addAction(cmd, Constants::G_SYMBOL); + cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + + cmd = ActionManager::command(TextEditor::Constants::OPEN_CALL_HIERARCHY); + contextMenu->addAction(cmd, Constants::G_SYMBOL); + cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + + // Refactoring sub-menu + Command *sep = contextMenu->addSeparator(Constants::G_SYMBOL); + sep->action()->setObjectName(QLatin1String(Constants::M_REFACTORING_MENU_INSERTION_POINT)); +} + +void CppEditorPlugin::addActionsForSelections() +{ + ActionContainer * const contextMenu = ActionManager::actionContainer(Constants::M_CONTEXT); + contextMenu->addAction(ActionManager::command(TextEditor::Constants::AUTO_INDENT_SELECTION), + Constants::G_SELECTION); + contextMenu->addAction(ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION), + Constants::G_SELECTION); +} + +void CppEditorPlugin::addPerFileActions() +{ + ActionContainer * const cppToolsMenu = ActionManager::actionContainer(Constants::M_TOOLS_CPP); + ActionContainer * const contextMenu = ActionManager::actionContainer(Constants::M_CONTEXT); + ActionContainer * const touchBar = ActionManager::actionContainer(Core::Constants::TOUCH_BAR); + const Context context(Constants::CPPEDITOR_ID); + + QAction * const switchAction = new QAction(Tr::tr("Switch Header/Source"), this); + Command *cmd = ActionManager::registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, + context, true); + cmd->setTouchBarText(Tr::tr("Header/Source", "text on macOS touch bar")); + contextMenu->addAction(cmd, Constants::G_FILE); + touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); + cmd->setDefaultKeySequence(QKeySequence(Qt::Key_F4)); + cppToolsMenu->addAction(cmd, Constants::G_FILE); + connect(switchAction, &QAction::triggered, + this, [] { CppModelManager::switchHeaderSource(false); }); + + QAction * const switchInNextSplitAction + = new QAction(Tr::tr("Open Corresponding Header/Source in Next Split"), this); + cmd = ActionManager::registerAction( + switchInNextSplitAction, Constants::OPEN_HEADER_SOURCE_IN_NEXT_SPLIT, context, true); + cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() + ? Tr::tr("Meta+E, F4") + : Tr::tr("Ctrl+E, F4"))); + cppToolsMenu->addAction(cmd, Constants::G_FILE); + connect(switchInNextSplitAction, &QAction::triggered, + this, [] { CppModelManager::switchHeaderSource(true); }); + + QAction * const openPreprocessorDialog + = new QAction(Tr::tr("Additional Preprocessor Directives..."), this); + cmd = ActionManager::registerAction(openPreprocessorDialog, + Constants::OPEN_PREPROCESSOR_DIALOG, context); + cmd->setDefaultKeySequence(QKeySequence()); + connect(openPreprocessorDialog, &QAction::triggered, + this, &CppEditorPlugin::showPreProcessorDialog); + cppToolsMenu->addAction(cmd, Constants::G_FILE); QAction * const showPreprocessedAction = new QAction(Tr::tr("Show Preprocessed Source"), this); cmd = ActionManager::registerAction(showPreprocessedAction, Constants::SHOW_PREPROCESSED_FILE, context); - mcpptools->addAction(cmd); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); + cppToolsMenu->addAction(cmd, Constants::G_FILE); + contextMenu->addAction(cmd, Constants::G_FILE); connect(showPreprocessedAction, &QAction::triggered, this, [] { CppModelManager::showPreprocessedFile(false); }); @@ -409,32 +473,48 @@ void CppEditorPlugin::setupMenus() (Tr::tr("Show Preprocessed Source in Next Split"), this); cmd = ActionManager::registerAction(showPreprocessedInSplitAction, Constants::SHOW_PREPROCESSED_FILE_SPLIT, context); - mcpptools->addAction(cmd); + cppToolsMenu->addAction(cmd, Constants::G_FILE); connect(showPreprocessedInSplitAction, &QAction::triggered, this, [] { CppModelManager::showPreprocessedFile(true); }); QAction * const foldCommentsAction = new QAction(Tr::tr("Fold All Comment Blocks"), this); cmd = ActionManager::registerAction(foldCommentsAction, "CppTools.FoldCommentBlocks", context); - mcpptools->addAction(cmd); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); + cppToolsMenu->addAction(cmd, Constants::G_FILE); + contextMenu->addAction(cmd, Constants::G_FILE); connect(foldCommentsAction, &QAction::triggered, this, [] { CppModelManager::foldComments(); }); QAction * const unfoldCommentsAction = new QAction(Tr::tr("Unfold All Comment Blocks"), this); cmd = ActionManager::registerAction(unfoldCommentsAction, "CppTools.UnfoldCommentBlocks", context); - mcpptools->addAction(cmd); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); + cppToolsMenu->addAction(cmd, Constants::G_FILE); + contextMenu->addAction(cmd, Constants::G_FILE); connect(unfoldCommentsAction, &QAction::triggered, this, [] { CppModelManager::unfoldComments(); }); - QAction *const findUnusedFunctionsAction = new QAction(Tr::tr("Find Unused Functions"), this); - cmd = ActionManager::registerAction(findUnusedFunctionsAction, - "CppTools.FindUnusedFunctions"); - mcpptools->addAction(cmd); + d->m_openIncludeHierarchyAction = new QAction(Tr::tr("Open Include Hierarchy"), this); + cmd = ActionManager::registerAction(d->m_openIncludeHierarchyAction, + Constants::OPEN_INCLUDE_HIERARCHY, context); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts + ? Tr::tr("Meta+Shift+I") : Tr::tr("Ctrl+Shift+I"))); + connect(d->m_openIncludeHierarchyAction, &QAction::triggered, + this, &CppEditorPlugin::openIncludeHierarchy); + contextMenu->addAction(cmd, Constants::G_FILE); + cppToolsMenu->addAction(cmd, Constants::G_FILE); +} + +void CppEditorPlugin::addGlobalActions() +{ + ActionContainer * const cppToolsMenu = ActionManager::actionContainer(Constants::M_TOOLS_CPP); + + QAction * const findUnusedFunctionsAction = new QAction(Tr::tr("Find Unused Functions"), this); + Command *cmd = ActionManager::registerAction(findUnusedFunctionsAction, + "CppTools.FindUnusedFunctions"); + cppToolsMenu->addAction(cmd, Constants::G_GLOBAL); connect(findUnusedFunctionsAction, &QAction::triggered, this, [] { CppModelManager::findUnusedFunctions({}); }); - QAction *const findUnusedFunctionsInSubProjectAction + + QAction * const findUnusedFunctionsInSubProjectAction = new QAction(Tr::tr("Find Unused C/C++ Functions"), this); cmd = ActionManager::registerAction(findUnusedFunctionsInSubProjectAction, "CppTools.FindUnusedFunctionsInSubProject"); @@ -449,61 +529,13 @@ void CppEditorPlugin::setupMenus() CppModelManager::findUnusedFunctions(node->directory()); }); - d->m_openTypeHierarchyAction = new QAction(Tr::tr("Open Type Hierarchy"), this); - cmd = ActionManager::registerAction(d->m_openTypeHierarchyAction, - Constants::OPEN_TYPE_HIERARCHY, context); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts - ? Tr::tr("Meta+Shift+T") : Tr::tr("Ctrl+Shift+T"))); - connect(d->m_openTypeHierarchyAction, &QAction::triggered, - this, &CppEditorPlugin::openTypeHierarchy); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - mcpptools->addAction(cmd); - - d->m_openIncludeHierarchyAction = new QAction(Tr::tr("Open Include Hierarchy"), this); - cmd = ActionManager::registerAction(d->m_openIncludeHierarchyAction, - Constants::OPEN_INCLUDE_HIERARCHY, context); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts - ? Tr::tr("Meta+Shift+I") : Tr::tr("Ctrl+Shift+I"))); - connect(d->m_openIncludeHierarchyAction, &QAction::triggered, - this, &CppEditorPlugin::openIncludeHierarchy); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - mcpptools->addAction(cmd); - - cmd = ActionManager::command(TextEditor::Constants::OPEN_CALL_HIERARCHY); - contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); - mcpptools->addAction(cmd); - - // Refactoring sub-menu - Command *sep = contextMenu->addSeparator(); - sep->action()->setObjectName(QLatin1String(Constants::M_REFACTORING_MENU_INSERTION_POINT)); - contextMenu->addSeparator(); - - // Update context in global context - mcpptools->addSeparator(Core::Constants::G_DEFAULT_THREE); d->m_reparseExternallyChangedFiles = new QAction(Tr::tr("Reparse Externally Changed Files"), this); cmd = ActionManager::registerAction(d->m_reparseExternallyChangedFiles, Constants::UPDATE_CODEMODEL); connect(d->m_reparseExternallyChangedFiles, &QAction::triggered, CppModelManager::instance(), &CppModelManager::updateModifiedSourceFiles); - mcpptools->addAction(cmd, Core::Constants::G_DEFAULT_THREE); - - ActionContainer *toolsDebug = ActionManager::actionContainer(Core::Constants::M_TOOLS_DEBUG); - QAction *inspectCppCodeModel = new QAction(Tr::tr("Inspect C++ Code Model..."), this); - cmd = ActionManager::registerAction(inspectCppCodeModel, Constants::INSPECT_CPP_CODEMODEL); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts - ? Tr::tr("Meta+Shift+F12") : Tr::tr("Ctrl+Shift+F12"))); - connect(inspectCppCodeModel, &QAction::triggered, - d, &CppEditorPluginPrivate::inspectCppCodeModel); - toolsDebug->addAction(cmd); - - contextMenu->addSeparator(context); - - cmd = ActionManager::command(TextEditor::Constants::AUTO_INDENT_SELECTION); - contextMenu->addAction(cmd); - - cmd = ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION); - contextMenu->addAction(cmd); + cppToolsMenu->addAction(cmd, Constants::G_GLOBAL); } void CppEditorPlugin::setupProjectPanels() diff --git a/src/plugins/cppeditor/cppeditorplugin.h b/src/plugins/cppeditor/cppeditorplugin.h index c24bce687f2..463455fb655 100644 --- a/src/plugins/cppeditor/cppeditorplugin.h +++ b/src/plugins/cppeditor/cppeditorplugin.h @@ -57,6 +57,10 @@ private: void extensionsInitialized() override; void setupMenus(); + void addPerSymbolActions(); + void addActionsForSelections(); + void addPerFileActions(); + void addGlobalActions(); void setupProjectPanels(); void registerVariables(); void registerTests(); diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index a06977ae5c1..43c6365c89c 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -1132,10 +1132,11 @@ static void appendCustomContextMenuActionsAndMenus(QMenu *menu, QMenu *refactorM bool isRefactoringMenuAdded = false; const QMenu *contextMenu = ActionManager::actionContainer(Constants::M_CONTEXT)->menu(); for (QAction *action : contextMenu->actions()) { - menu->addAction(action); if (action->objectName() == QLatin1String(Constants::M_REFACTORING_MENU_INSERTION_POINT)) { isRefactoringMenuAdded = true; menu->addMenu(refactorMenu); + } else { + menu->addAction(action); } } From 0a323274d48bc4233d71d94fe072ee77fb31f9d8 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 16 Aug 2023 12:36:41 +0200 Subject: [PATCH 1231/1777] Editor: transform the line column label into button Having a button instead of a labal makes it more obvious that there is an action triggered when clicking the label. Also fix the flickering introduced by f0bb7e8bfa9f9880a09872160c7765be1e44a594 by saving the maximum width of the sizeHint. Since the width can get big if we have a selection we do not save the size in that case to avoid blocking the width when the selection is removed again. Change-Id: If8210ecbabb8c6449c4f88652fbed99f8526057d Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/texteditor/texteditor.cpp | 29 +++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index ce6421d80c9..21aff756935 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -150,16 +150,16 @@ using ListTransformationMethod = void(QStringList &); static constexpr char dropProperty[] = "dropProp"; -class LineColumnLabel : public FixedSizeClickLabel +class LineColumnButton : public QToolButton { Q_OBJECT public: - LineColumnLabel(TextEditorWidget *parent) - : FixedSizeClickLabel(parent) + LineColumnButton(TextEditorWidget *parent) + : QToolButton(parent) , m_editor(parent) { - connect(m_editor, &QPlainTextEdit::cursorPositionChanged, this, &LineColumnLabel::update); - connect(this, &FixedSizeClickLabel::clicked, ActionManager::instance(), [this] { + connect(m_editor, &QPlainTextEdit::cursorPositionChanged, this, &LineColumnButton::update); + connect(this, &QToolButton::pressed, ActionManager::instance(), [this] { emit m_editor->activateEditor(EditorManager::IgnoreNavigationHistory); QMetaObject::invokeMethod(ActionManager::instance(), [] { if (Command *cmd = ActionManager::command(Core::Constants::GOTO)) { @@ -198,7 +198,7 @@ private: bool event(QEvent *event) override { if (event->type() != QEvent::ToolTip) - return FixedSizeClickLabel::event(event); + return QToolButton::event(event); QString tooltipText = "<table cellpadding='2'>\n"; @@ -243,6 +243,19 @@ private: return true; } + QSize sizeHint() const override + { + const QSize size = QToolButton::sizeHint(); + auto wider = [](const QSize &left, const QSize &right) { + return left.width() < right.width(); + }; + if (m_editor->multiTextCursor().hasSelection()) + return std::max(m_maxSize, size, wider); // do not save the size if we have a selection + m_maxSize = std::max(m_maxSize, size, wider); + return m_maxSize; + } + + mutable QSize m_maxSize; TextEditorWidget *m_editor; }; @@ -714,7 +727,7 @@ public: QWidget *m_stretchWidget = nullptr; QAction *m_stretchAction = nullptr; QAction *m_toolbarOutlineAction = nullptr; - LineColumnLabel *m_cursorPositionLabel = nullptr; + LineColumnButton *m_cursorPositionLabel = nullptr; FixedSizeClickLabel *m_fileEncodingLabel = nullptr; QAction *m_fileEncodingLabelAction = nullptr; BaseTextFind *m_find = nullptr; @@ -1023,8 +1036,8 @@ TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent) m_stretchAction = m_toolBar->addWidget(m_stretchWidget); m_toolBarWidget->layout()->addWidget(m_toolBar); - m_cursorPositionLabel = new LineColumnLabel(q); const int spacing = q->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2; + m_cursorPositionLabel = new LineColumnButton(q); m_cursorPositionLabel->setContentsMargins(spacing, 0, spacing, 0); m_toolBarWidget->layout()->addWidget(m_cursorPositionLabel); From d079ef5e2a883d79756b36823ed39d35990f907c Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 21 Sep 2023 17:05:32 +0200 Subject: [PATCH 1232/1777] ScreenRecorder: Add setting for capturing the mouse cursor This adds a boolean setting for capturing the mouse cursor which is by default true. macOS would otherwise not capture it by default. Change-Id: Ic70eb4c70e1be8c452ff32ef6c54f072ccc31caa Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/screenrecorder/record.cpp | 4 ++++ src/plugins/screenrecorder/screenrecordersettings.cpp | 6 ++++++ src/plugins/screenrecorder/screenrecordersettings.h | 5 +---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index 422087abbd4..a3e2f52d416 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -322,6 +322,7 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const Internal::settings().recordSettings(); const QString frameRateStr = QString::number(rS.frameRate); const QString screenIdStr = QString::number(rS.screenId); + const QString captureCursorStr = Internal::settings().captureCursor() ? "1" : "0"; QStringList videoGrabParams; // see http://trac.ffmpeg.org/wiki/Capture/Desktop switch (HostOsInfo::hostOs()) { @@ -334,6 +335,7 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const ? screen->size() * screen->devicePixelRatio() : rS.cropRect.size()); videoGrabParams.append({"-f", "x11grab"}); + videoGrabParams.append({"-draw_mouse", captureCursorStr}); videoGrabParams.append({"-framerate", frameRateStr}); videoGrabParams.append({"-video_size", videoSize}); videoGrabParams.append({"-i", QString("%1+%2,%3").arg(x11display) @@ -348,6 +350,7 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const .arg(rS.cropRect.y())); } filter.append(":framerate=" + frameRateStr); + filter.append(":draw_mouse=" + captureCursorStr); filter.append(",hwdownload"); filter.append(",format=bgra"); videoGrabParams = { @@ -359,6 +362,7 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const case OsTypeMac: { videoGrabParams = { "-f", "avfoundation", + "-capture_cursor", captureCursorStr, "-framerate", frameRateStr, "-pixel_format", "bgr0", "-i", QString("Capture screen %1:none").arg(rS.screenId), diff --git a/src/plugins/screenrecorder/screenrecordersettings.cpp b/src/plugins/screenrecorder/screenrecordersettings.cpp index ae01d321175..c0f42a8307c 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.cpp +++ b/src/plugins/screenrecorder/screenrecordersettings.cpp @@ -67,6 +67,11 @@ ScreenRecorderSettings::ScreenRecorderSettings() ffprobeTool.setDefaultValue(ffprobeDefault.toUserOutput()); ffprobeTool.setLabelText(Tr::tr("ffprobe tool:")); + captureCursor.setSettingsKey("CaptureCursor"); + captureCursor.setDefaultValue(true); + captureCursor.setLabel(Tr::tr("Capture the mouse cursor")); + captureCursor.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); + enableFileSizeLimit.setSettingsKey("EnableFileSizeLimit"); enableFileSizeLimit.setDefaultValue(true); enableFileSizeLimit.setLabel(Tr::tr("Size limit for intermediate output file")); @@ -145,6 +150,7 @@ ScreenRecorderSettings::ScreenRecorderSettings() Group { title(Tr::tr("Record settings")), Column { + captureCursor, Row { enableFileSizeLimit, fileSizeLimit, st }, Row { enableRtBuffer, rtBufferSize, st }, }, diff --git a/src/plugins/screenrecorder/screenrecordersettings.h b/src/plugins/screenrecorder/screenrecordersettings.h index 75527da6538..a38f7a38849 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.h +++ b/src/plugins/screenrecorder/screenrecordersettings.h @@ -5,10 +5,6 @@ #include <utils/aspects.h> -QT_BEGIN_NAMESPACE -class QScreen; -QT_END_NAMESPACE - namespace ScreenRecorder::Internal { class ScreenRecorderSettings : public Utils::AspectContainer @@ -30,6 +26,7 @@ public: // Visible in Settings page Utils::FilePathAspect ffmpegTool{this}; Utils::FilePathAspect ffprobeTool{this}; + Utils::BoolAspect captureCursor{this}; Utils::BoolAspect enableFileSizeLimit{this}; Utils::IntegerAspect fileSizeLimit{this}; // in MB Utils::BoolAspect enableRtBuffer{this}; From 9503f62f496038e8e5147770a5e525e2da5d6168 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 21 Sep 2023 17:41:04 +0200 Subject: [PATCH 1233/1777] ScreenRecorder: Add setting for capturing mouse clicks Only available for macOS/AVFoundation, and off by default. Change-Id: I30b3e6e472c62b5bb68b609c2cd945aa4fd70127 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/screenrecorder/record.cpp | 1 + src/plugins/screenrecorder/screenrecordersettings.cpp | 7 +++++++ src/plugins/screenrecorder/screenrecordersettings.h | 1 + 3 files changed, 9 insertions(+) diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index a3e2f52d416..e1360ffd109 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -363,6 +363,7 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const videoGrabParams = { "-f", "avfoundation", "-capture_cursor", captureCursorStr, + "-capture_mouse_clicks", Internal::settings().captureMouseClicks() ? "1" : "0", "-framerate", frameRateStr, "-pixel_format", "bgr0", "-i", QString("Capture screen %1:none").arg(rS.screenId), diff --git a/src/plugins/screenrecorder/screenrecordersettings.cpp b/src/plugins/screenrecorder/screenrecordersettings.cpp index c0f42a8307c..f8cc6018f31 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.cpp +++ b/src/plugins/screenrecorder/screenrecordersettings.cpp @@ -72,6 +72,12 @@ ScreenRecorderSettings::ScreenRecorderSettings() captureCursor.setLabel(Tr::tr("Capture the mouse cursor")); captureCursor.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); + captureMouseClicks.setSettingsKey("CaptureMouseClicks"); + captureMouseClicks.setDefaultValue(false); + captureMouseClicks.setLabel(Tr::tr("Capture the screen mouse clicks")); + captureMouseClicks.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); + captureMouseClicks.setVisible(HostOsInfo::isMacHost()); // only available with AVFoundation + enableFileSizeLimit.setSettingsKey("EnableFileSizeLimit"); enableFileSizeLimit.setDefaultValue(true); enableFileSizeLimit.setLabel(Tr::tr("Size limit for intermediate output file")); @@ -151,6 +157,7 @@ ScreenRecorderSettings::ScreenRecorderSettings() title(Tr::tr("Record settings")), Column { captureCursor, + captureMouseClicks, Row { enableFileSizeLimit, fileSizeLimit, st }, Row { enableRtBuffer, rtBufferSize, st }, }, diff --git a/src/plugins/screenrecorder/screenrecordersettings.h b/src/plugins/screenrecorder/screenrecordersettings.h index a38f7a38849..900847ac3f1 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.h +++ b/src/plugins/screenrecorder/screenrecordersettings.h @@ -27,6 +27,7 @@ public: Utils::FilePathAspect ffmpegTool{this}; Utils::FilePathAspect ffprobeTool{this}; Utils::BoolAspect captureCursor{this}; + Utils::BoolAspect captureMouseClicks{this}; Utils::BoolAspect enableFileSizeLimit{this}; Utils::IntegerAspect fileSizeLimit{this}; // in MB Utils::BoolAspect enableRtBuffer{this}; From 5d4849f058707ad90bb1641f4d0941900b585ce2 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 21 Sep 2023 18:14:17 +0200 Subject: [PATCH 1234/1777] ScreenRecorder: Remember the last used export format Requires unique format names, thus the lossy WebP is now "WebP/VP8". Default export format is WebP (lossless). Change-Id: I26ccfb86417787d300afbb986c8202713ab1cbba Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/screenrecorder/export.cpp | 14 +++++++++++--- .../screenrecorder/screenrecordersettings.cpp | 3 +++ .../screenrecorder/screenrecordersettings.h | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/plugins/screenrecorder/export.cpp b/src/plugins/screenrecorder/export.cpp index 24e8a935532..76696250943 100644 --- a/src/plugins/screenrecorder/export.cpp +++ b/src/plugins/screenrecorder/export.cpp @@ -51,7 +51,7 @@ static const QVector<ExportWidget::Format> &formats() { ExportWidget::Format::AnimatedImage, ExportWidget::Format::Lossy, - "WebP", + "WebP/VP8", ".webp", { "-pix_fmt", "yuv420p", @@ -148,11 +148,17 @@ ExportWidget::ExportWidget(QWidget *parent) connect(exportButton, &QToolButton::clicked, this, [this] { FilePathAspect &lastDir = Internal::settings().exportLastDirectory; - QString selectedFilter; + StringAspect &lastFormat = Internal::settings().exportLastFormat; + const Format &defaultFormat = formats().at(1); + QTC_CHECK(defaultFormat.displayName == lastFormat.defaultValue()); + QString selectedFilter = findOr(formats(), defaultFormat, + [&lastFormat] (const Format &f) { + return f.displayName == lastFormat(); + }).fileDialogFilter(); FilePath file = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save as"), lastDir(), fileDialogFilters(), &selectedFilter); if (!file.isEmpty()) { - m_currentFormat = findOr(formats(), formats().first(), + m_currentFormat = findOr(formats(), defaultFormat, [&selectedFilter] (const Format &fp) { return fp.fileDialogFilter() == selectedFilter; }); @@ -161,6 +167,8 @@ ExportWidget::ExportWidget(QWidget *parent) m_outputClipInfo.file = file; lastDir.setValue(file.parentDir()); lastDir.writeToSettingsImmediatly(); + lastFormat.setValue(m_currentFormat.displayName); + lastFormat.writeToSettingsImmediatly(); startExport(); } }); diff --git a/src/plugins/screenrecorder/screenrecordersettings.cpp b/src/plugins/screenrecorder/screenrecordersettings.cpp index f8cc6018f31..2dec4000873 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.cpp +++ b/src/plugins/screenrecorder/screenrecordersettings.cpp @@ -118,6 +118,9 @@ ScreenRecorderSettings::ScreenRecorderSettings() exportLastDirectory.setExpectedKind(PathChooser::ExistingDirectory); exportLastDirectory.setDefaultValue(FileUtils::homePath().toString()); + exportLastFormat.setSettingsKey("ExportLastFormat"); + exportLastFormat.setDefaultValue("WebP"); + lastSaveImageDirectory.setSettingsKey("LastSaveImageDir"); lastSaveImageDirectory.setExpectedKind(PathChooser::ExistingDirectory); lastSaveImageDirectory.setDefaultValue(FileUtils::homePath().toString()); diff --git a/src/plugins/screenrecorder/screenrecordersettings.h b/src/plugins/screenrecorder/screenrecordersettings.h index 900847ac3f1..18611ce5830 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.h +++ b/src/plugins/screenrecorder/screenrecordersettings.h @@ -38,6 +38,7 @@ public: // Used in other places Utils::FilePathAspect lastOpenDirectory{this}; Utils::FilePathAspect exportLastDirectory{this}; + Utils::StringAspect exportLastFormat{this}; Utils::FilePathAspect lastSaveImageDirectory{this}; Utils::IntegerAspect recordFrameRate{this}; Utils::IntegerAspect recordScreenId{this}; From 5420f99d8fdb2466df82f24fbdf5ac74c3f429ba Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 22 Sep 2023 10:05:59 +0200 Subject: [PATCH 1235/1777] Update qbs submodule to HEAD of 2.1 branch Change-Id: I1817cb737f2db33ad9b10be49baba37570f2c677 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index d361630f727..12041c01b82 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit d361630f727459ea6dccc1ca6cd5ad51162bfb62 +Subproject commit 12041c01b8247a05faa12e9d1a6678c8ba56afc5 From 7c28cc0565611c252340481321b61098cc63c7ac Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 22 Sep 2023 10:52:58 +0200 Subject: [PATCH 1236/1777] Editor: transform the encoding label into button Like for the line number label: Having a button instead of a labal makes it more obvious that there is an action triggered when clicking the label. Change-Id: Ied15c05658c0b0b7df75cbcf1704808e94f6985d Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/texteditor/texteditor.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 21aff756935..66d5617f363 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -54,7 +54,6 @@ #include <utils/fadingindicator.h> #include <utils/filesearch.h> #include <utils/fileutils.h> -#include <utils/fixedsizeclicklabel.h> #include <utils/hostosinfo.h> #include <utils/infobar.h> #include <utils/mimeutils.h> @@ -727,8 +726,8 @@ public: QWidget *m_stretchWidget = nullptr; QAction *m_stretchAction = nullptr; QAction *m_toolbarOutlineAction = nullptr; - LineColumnButton *m_cursorPositionLabel = nullptr; - FixedSizeClickLabel *m_fileEncodingLabel = nullptr; + LineColumnButton *m_cursorPositionButton = nullptr; + QToolButton *m_fileEncodingButton = nullptr; QAction *m_fileEncodingLabelAction = nullptr; BaseTextFind *m_find = nullptr; @@ -1037,9 +1036,9 @@ TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent) m_toolBarWidget->layout()->addWidget(m_toolBar); const int spacing = q->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing) / 2; - m_cursorPositionLabel = new LineColumnButton(q); - m_cursorPositionLabel->setContentsMargins(spacing, 0, spacing, 0); - m_toolBarWidget->layout()->addWidget(m_cursorPositionLabel); + m_cursorPositionButton = new LineColumnButton(q); + m_cursorPositionButton->setContentsMargins(spacing, 0, spacing, 0); + m_toolBarWidget->layout()->addWidget(m_cursorPositionButton); m_fileLineEnding = new QToolButton(q); m_fileLineEnding->setContentsMargins(spacing, 0, spacing, 0); @@ -1048,9 +1047,9 @@ TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent) connect(q, &TextEditorWidget::readOnlyChanged, this, &TextEditorWidgetPrivate::updateFileLineEndingVisible); - m_fileEncodingLabel = new FixedSizeClickLabel; - m_fileEncodingLabel->setContentsMargins(spacing, 0, spacing, 0); - m_fileEncodingLabelAction = m_toolBar->addWidget(m_fileEncodingLabel); + m_fileEncodingButton = new QToolButton; + m_fileEncodingButton->setContentsMargins(spacing, 0, spacing, 0); + m_fileEncodingLabelAction = m_toolBar->addWidget(m_fileEncodingButton); m_extraSelections.reserve(NExtraSelectionKinds); @@ -1091,7 +1090,7 @@ TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent) connect(&m_delayedUpdateTimer, &QTimer::timeout, q->viewport(), QOverload<>::of(&QWidget::update)); - connect(m_fileEncodingLabel, &FixedSizeClickLabel::clicked, + connect(m_fileEncodingButton, &QToolButton::clicked, q, &TextEditorWidget::selectEncoding); connect(m_fileLineEnding, &QToolButton::clicked, ActionManager::instance(), [this] { @@ -1834,7 +1833,7 @@ void TextEditorWidget::updateTextLineEndingLabel() void TextEditorWidget::updateTextCodecLabel() { QString text = QString::fromLatin1(d->m_document->codec()->name()); - d->m_fileEncodingLabel->setText(text, text); + d->m_fileEncodingButton->setText(text); } QString TextEditorWidget::msgTextTooLarge(quint64 size) From 6728b4a5503aa2e8534b8a776e7a0cfe3cf2a62b Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 22 Sep 2023 10:56:30 +0200 Subject: [PATCH 1237/1777] Utils: remove unused FixedSizeClickLabel Change-Id: I22236d922a236124debb56c67ffe44d210b01b72 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/utils/CMakeLists.txt | 1 - src/libs/utils/fixedsizeclicklabel.cpp | 96 -------------------------- src/libs/utils/fixedsizeclicklabel.h | 39 ----------- src/libs/utils/utils.qbs | 2 - 4 files changed, 138 deletions(-) delete mode 100644 src/libs/utils/fixedsizeclicklabel.cpp delete mode 100644 src/libs/utils/fixedsizeclicklabel.h diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index 2467f6dfbc5..881f78b115f 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -60,7 +60,6 @@ add_qtc_library(Utils filesystemwatcher.cpp filesystemwatcher.h fileutils.cpp fileutils.h filewizardpage.cpp filewizardpage.h - fixedsizeclicklabel.cpp fixedsizeclicklabel.h flowlayout.cpp flowlayout.h fsengine/fsengine.cpp fsengine/fsengine.h fsengine/fileiconprovider.cpp fsengine/fileiconprovider.h diff --git a/src/libs/utils/fixedsizeclicklabel.cpp b/src/libs/utils/fixedsizeclicklabel.cpp deleted file mode 100644 index 090ea1ca4a6..00000000000 --- a/src/libs/utils/fixedsizeclicklabel.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "fixedsizeclicklabel.h" - -#include <QMouseEvent> - -/*! - \class Utils::FixedSizeClickLabel - - \brief The FixedSizeClickLabel class is a label with a size hint derived from a sample text - that can be different to the text that is shown. - - For convenience it also has a clicked signal that is emitted whenever the label receives a mouse - click. - - \inmodule Qt Creator -*/ - -/*! - \fn Utils::FixedSizeClickLabel::clicked() - - This signal is emitted when the label is clicked with the left mouse button. -*/ - -/*! - \property Utils::FixedSizeClickLabel::maxText - - This property holds the text that is used to calculate the label's size hint. -*/ - -namespace Utils { - -/*! - Constructs a FixedSizeClickLabel with the parent \a parent. -*/ -FixedSizeClickLabel::FixedSizeClickLabel(QWidget *parent) - : QLabel(parent) -{ -} - -/*! - Sets the label's text to \a text, and changes the size hint of the label to the size of - \a maxText. - - \sa maxText - \sa setMaxText -*/ -void FixedSizeClickLabel::setText(const QString &text, const QString &maxText) -{ - QLabel::setText(text); - m_maxText = maxText; -} - -/*! - \reimp -*/ -QSize FixedSizeClickLabel::sizeHint() const -{ - return fontMetrics().boundingRect(m_maxText).size(); -} - -QString FixedSizeClickLabel::maxText() const -{ - return m_maxText; -} - -void FixedSizeClickLabel::setMaxText(const QString &maxText) -{ - m_maxText = maxText; -} - -/*! - \reimp -*/ -void FixedSizeClickLabel::mousePressEvent(QMouseEvent *ev) -{ - QLabel::mousePressEvent(ev); - if (ev->button() == Qt::LeftButton) - m_pressed = true; -} - -/*! - \reimp -*/ -void FixedSizeClickLabel::mouseReleaseEvent(QMouseEvent *ev) -{ - QLabel::mouseReleaseEvent(ev); - if (ev->button() != Qt::LeftButton) - return; - if (m_pressed && rect().contains(ev->pos())) - emit clicked(); - m_pressed = false; -} - -} // namespace Utils diff --git a/src/libs/utils/fixedsizeclicklabel.h b/src/libs/utils/fixedsizeclicklabel.h deleted file mode 100644 index b663efc47a8..00000000000 --- a/src/libs/utils/fixedsizeclicklabel.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "utils_global.h" - -#include <QLabel> - -namespace Utils { - -class QTCREATOR_UTILS_EXPORT FixedSizeClickLabel : public QLabel -{ - Q_OBJECT - Q_PROPERTY(QString maxText READ maxText WRITE setMaxText DESIGNABLE true) - -public: - explicit FixedSizeClickLabel(QWidget *parent = nullptr); - - void setText(const QString &text, const QString &maxText); - using QLabel::setText; - QSize sizeHint() const override; - - QString maxText() const; - void setMaxText(const QString &maxText); - -protected: - void mousePressEvent(QMouseEvent *ev) override; - void mouseReleaseEvent(QMouseEvent *ev) override; - -signals: - void clicked(); - -private: - QString m_maxText; - bool m_pressed = false; -}; - -} // namespace Utils diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index b3b3207a927..51d6857d122 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -135,8 +135,6 @@ QtcLibrary { "fileutils.h", "filewizardpage.cpp", "filewizardpage.h", - "fixedsizeclicklabel.cpp", - "fixedsizeclicklabel.h", "flowlayout.cpp", "flowlayout.h", "futuresynchronizer.cpp", From 3ef401cd9a6e0b9e8dfdc7cdef952fc9e1804437 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 22 Sep 2023 00:43:30 +0200 Subject: [PATCH 1238/1777] ScreenRecorder: Decouple capture type from host OS On Linux, we want to support more screen capture options than just x11grab. Also, on Windows, we might want to support alternatives to ddagrab. This change replaces host OS specific control flow with a setting based one. If there are multiple capture types available for an OS (not the case with this initial change), a combobox in the settings page allows the user to select one. Change-Id: Ic57be4a47d14f09f53635e53167aa20a5d74669b Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/screenrecorder/record.cpp | 10 +++---- .../screenrecorder/screenrecordersettings.cpp | 30 ++++++++++++++++++- .../screenrecorder/screenrecordersettings.h | 7 +++++ 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index e1360ffd109..76013b09311 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -324,9 +324,9 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const const QString screenIdStr = QString::number(rS.screenId); const QString captureCursorStr = Internal::settings().captureCursor() ? "1" : "0"; QStringList videoGrabParams; - // see http://trac.ffmpeg.org/wiki/Capture/Desktop - switch (HostOsInfo::hostOs()) { - case OsTypeLinux: { + + switch (Internal::settings().captureType()) { + case Internal::CaptureType::X11grab: { const QScreen *screen = QGuiApplication::screens()[rS.screenId]; const QPoint screenTopLeft = screen->geometry().topLeft(); const QRect cropRect = rS.cropRect.translated(screenTopLeft); @@ -342,7 +342,7 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const .arg(cropRect.x()).arg(cropRect.y())}); break; } - case OsTypeWindows: { + case Internal::CaptureType::Ddagrab: { QString filter = "ddagrab=output_idx=" + screenIdStr; if (!rS.cropRect.isNull()) { filter.append(":video_size=" + sizeStr(rS.cropRect.size())); @@ -359,7 +359,7 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const }; break; } - case OsTypeMac: { + case Internal::CaptureType::AVFoundation: { videoGrabParams = { "-f", "avfoundation", "-capture_cursor", captureCursorStr, diff --git a/src/plugins/screenrecorder/screenrecordersettings.cpp b/src/plugins/screenrecorder/screenrecordersettings.cpp index 2dec4000873..ef914616a96 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.cpp +++ b/src/plugins/screenrecorder/screenrecordersettings.cpp @@ -76,7 +76,30 @@ ScreenRecorderSettings::ScreenRecorderSettings() captureMouseClicks.setDefaultValue(false); captureMouseClicks.setLabel(Tr::tr("Capture the screen mouse clicks")); captureMouseClicks.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); - captureMouseClicks.setVisible(HostOsInfo::isMacHost()); // only available with AVFoundation + + captureType.setSettingsKey("CaptureType"); + captureType.setLabelText(Tr::tr("Capture device/filter:")); + captureType.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + captureType.setVisible(false); + switch (HostOsInfo::hostOs()) { + case OsTypeLinux: + captureType.addOption({"x11grab", {}, CaptureType::X11grab}); + captureType.setDefaultValue(CaptureType::X11grab); + break; + case OsTypeWindows: + captureType.addOption({"ddagrab", {}, CaptureType::Ddagrab}); + captureType.setDefaultValue(CaptureType::Ddagrab); + break; + case OsTypeMac: + captureType.addOption({"AVFoundation", {}, CaptureType::AVFoundation}); + captureType.setDefaultValue(CaptureType::AVFoundation); + break; + } + auto setCaptureMouseClicksVisible = [this] { + const QVariant value = captureType.itemValueForIndex(captureType.volatileValue()); + const bool visible = value.toInt() == CaptureType::AVFoundation; + captureMouseClicks.setVisible(visible); + }; enableFileSizeLimit.setSettingsKey("EnableFileSizeLimit"); enableFileSizeLimit.setDefaultValue(true); @@ -161,6 +184,7 @@ ScreenRecorderSettings::ScreenRecorderSettings() Column { captureCursor, captureMouseClicks, + Row { captureType, st }, Row { enableFileSizeLimit, fileSizeLimit, st }, Row { enableRtBuffer, rtBufferSize, st }, }, @@ -178,6 +202,10 @@ ScreenRecorderSettings::ScreenRecorderSettings() }); readSettings(); + + setCaptureMouseClicksVisible(); + connect(&captureType, &SelectionAspect::volatileValueChanged, this, + setCaptureMouseClicksVisible); } bool ScreenRecorderSettings::toolsRegistered() const diff --git a/src/plugins/screenrecorder/screenrecordersettings.h b/src/plugins/screenrecorder/screenrecordersettings.h index 18611ce5830..dbdda8311c9 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.h +++ b/src/plugins/screenrecorder/screenrecordersettings.h @@ -7,6 +7,12 @@ namespace ScreenRecorder::Internal { +enum CaptureType { + X11grab, + Ddagrab, + AVFoundation, +}; + class ScreenRecorderSettings : public Utils::AspectContainer { public: @@ -26,6 +32,7 @@ public: // Visible in Settings page Utils::FilePathAspect ffmpegTool{this}; Utils::FilePathAspect ffprobeTool{this}; + Utils::SelectionAspect captureType{this}; Utils::BoolAspect captureCursor{this}; Utils::BoolAspect captureMouseClicks{this}; Utils::BoolAspect enableFileSizeLimit{this}; From 0632648be64c2da5ecc8f9744cfd7967ead7fb7d Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 21 Sep 2023 13:45:26 +0200 Subject: [PATCH 1239/1777] CMakePM: Remove the CMake introspection after CMake project load Will be done in the CMake editor. No need to slow the project loading when you don't do any editing of CMake files. Initially I wanted to have it already loaded when code completion is done, but doing once when a CMake editor is opened is better. Change-Id: I1eda2a64e708bfa4fab5ab749059a08769800eba Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 0d3dd00149e..d8bb9155856 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1283,10 +1283,6 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() m_projectKeywords.functions << QString::fromUtf8(arg.Value); } } - - // Code completion setup - if (CMakeTool *tool = CMakeKitAspect::cmakeTool(target()->kit())) - tool->keywords(); } void CMakeBuildSystem::ensureBuildDirectory(const BuildDirParameters ¶meters) From d87e6db1681125272ac1e0c866e35ce5e866cdcc Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 15 Sep 2023 12:25:04 +0200 Subject: [PATCH 1240/1777] Axivion: Handle some SSL related issues ...when using QNetworkAccessManager. Change-Id: I2b1a6173052ce76e7aeed0897f3d6389ace36206 Reviewed-by: Andreas Loth <andreas.loth@qt.io> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/axivion/axivionplugin.cpp | 52 +++++++++++++++++++++++++-- src/plugins/axivion/axivionplugin.h | 1 + src/plugins/axivion/axivionquery.cpp | 23 +----------- 3 files changed, 52 insertions(+), 24 deletions(-) diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index 35404e81c06..0c09ecb475d 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -7,12 +7,14 @@ #include "axivionprojectsettings.h" #include "axivionquery.h" #include "axivionresultparser.h" +#include "axivionsettings.h" #include "axiviontr.h" #include "dashboard/dashboardclient.h" #include "dashboard/dto.h" #include <coreplugin/editormanager/documentmodel.h> #include <coreplugin/editormanager/editormanager.h> +#include <coreplugin/icore.h> #include <coreplugin/messagemanager.h> #include <extensionsystem/pluginmanager.h> @@ -26,6 +28,7 @@ #include <texteditor/texteditor.h> #include <texteditor/textmark.h> +#include <utils/algorithm.h> #include <utils/expected.h> #include <utils/networkaccessmanager.h> #include <utils/qtcassert.h> @@ -33,6 +36,9 @@ #include <QAction> #include <QFutureWatcher> +#include <QMessageBox> +#include <QNetworkAccessManager> +#include <QNetworkReply> #include <QTimer> #include <exception> @@ -45,6 +51,8 @@ namespace Axivion::Internal { class AxivionPluginPrivate : public QObject { public: + AxivionPluginPrivate(); + void handleSslErrors(QNetworkReply *reply, const QList<QSslError> &errors); void onStartupProjectChanged(); void fetchProjectInfo(const QString &projectName); void handleProjectInfo(DashboardClient::RawProjectInfo rawInfo); @@ -55,7 +63,7 @@ public: void handleIssuesForFile(const IssuesList &issues); void fetchRuleInfo(const QString &id); - Utils::NetworkAccessManager *m_networkAccessManager = Utils::NetworkAccessManager::instance(); + Utils::NetworkAccessManager m_networkAccessManager; AxivionOutputPane m_axivionOutputPane; std::shared_ptr<const DashboardClient::ProjectInfo> m_currentProjectInfo; bool m_runningQuery = false; @@ -128,6 +136,46 @@ std::shared_ptr<const DashboardClient::ProjectInfo> AxivionPlugin::projectInfo() return dd->m_currentProjectInfo; } +// FIXME: extend to give some details? +// FIXME: move when curl is no more in use? +bool AxivionPlugin::handleCertificateIssue() +{ + QTC_ASSERT(dd, return false); + const QString serverHost = QUrl(settings().server.dashboard).host(); + if (QMessageBox::question(Core::ICore::dialogParent(), Tr::tr("Certificate Error"), + Tr::tr("Server certificate for %1 cannot be authenticated.\n" + "Do you want to disable SSL verification for this server?\n" + "Note: This can expose you to man-in-the-middle attack.") + .arg(serverHost)) + != QMessageBox::Yes) { + return false; + } + settings().server.validateCert = false; + settings().apply(); + + return true; +} + +AxivionPluginPrivate::AxivionPluginPrivate() +{ + connect(&m_networkAccessManager, &QNetworkAccessManager::sslErrors, + this, &AxivionPluginPrivate::handleSslErrors); +} + +void AxivionPluginPrivate::handleSslErrors(QNetworkReply *reply, const QList<QSslError> &errors) +{ + const QList<QSslError::SslError> accepted{ + QSslError::CertificateNotYetValid, QSslError::CertificateExpired, + QSslError::InvalidCaCertificate, QSslError::CertificateUntrusted, + QSslError::HostNameMismatch + }; + if (Utils::allOf(errors, + [&accepted](const QSslError &e) { return accepted.contains(e.error()); })) { + if (!settings().server.validateCert || AxivionPlugin::handleCertificateIssue()) + reply->ignoreSslErrors(errors); + } +} + void AxivionPluginPrivate::onStartupProjectChanged() { ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject(); @@ -155,7 +203,7 @@ void AxivionPluginPrivate::fetchProjectInfo(const QString &projectName) return; } m_runningQuery = true; - DashboardClient client { *this->m_networkAccessManager }; + DashboardClient client { this->m_networkAccessManager }; QFuture<DashboardClient::RawProjectInfo> response = client.fetchProjectInfo(projectName); auto responseWatcher = std::make_shared<QFutureWatcher<DashboardClient::RawProjectInfo>>(); connect(responseWatcher.get(), diff --git a/src/plugins/axivion/axivionplugin.h b/src/plugins/axivion/axivionplugin.h index 0d072dab236..380b8630f61 100644 --- a/src/plugins/axivion/axivionplugin.h +++ b/src/plugins/axivion/axivionplugin.h @@ -27,6 +27,7 @@ public: static void fetchProjectInfo(const QString &projectName); static std::shared_ptr<const DashboardClient::ProjectInfo> projectInfo(); + static bool handleCertificateIssue(); private: void initialize() final; diff --git a/src/plugins/axivion/axivionquery.cpp b/src/plugins/axivion/axivionquery.cpp index b701c921371..13f18229087 100644 --- a/src/plugins/axivion/axivionquery.cpp +++ b/src/plugins/axivion/axivionquery.cpp @@ -5,14 +5,10 @@ #include "axivionplugin.h" #include "axivionsettings.h" -#include "axiviontr.h" - -#include <coreplugin/icore.h> #include <utils/processenums.h> #include <utils/qtcassert.h> -#include <QMessageBox> #include <QUrl> using namespace Utils; @@ -54,23 +50,6 @@ QString AxivionQuery::toString() const return {}; } -static bool handleCertificateIssue() -{ - const QString serverHost = QUrl(settings().server.dashboard).host(); - if (QMessageBox::question(Core::ICore::dialogParent(), Tr::tr("Certificate Error"), - Tr::tr("Server certificate for %1 cannot be authenticated.\n" - "Do you want to disable SSL verification for this server?\n" - "Note: This can expose you to man-in-the-middle attack.") - .arg(serverHost)) - != QMessageBox::Yes) { - return false; - } - settings().server.validateCert = false; - settings().apply(); - - return true; -} - AxivionQueryRunner::AxivionQueryRunner(const AxivionQuery &query, QObject *parent) : QObject(parent) { @@ -91,7 +70,7 @@ AxivionQueryRunner::AxivionQueryRunner(const AxivionQuery &query, QObject *paren const int exitCode = m_process.exitCode(); if (m_process.exitStatus() == QProcess::NormalExit && (exitCode == 35 || exitCode == 60) - && handleCertificateIssue()) { + && AxivionPlugin::handleCertificateIssue()) { // prepend -k for re-requesting same query CommandLine cmdline = m_process.commandLine(); cmdline.prependArgs({"-k"}); From 66317f0145ad32e18a1daf69469e051ebedae573 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 22 Sep 2023 12:24:23 +0200 Subject: [PATCH 1241/1777] CompilerExplorer: Fix Windows build with Qt6.2 Change-Id: Iacca1e17aec875b43e19000cea54daab5730838f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/compilerexplorer/api/request.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/compilerexplorer/api/request.h b/src/plugins/compilerexplorer/api/request.h index 81b892c42dd..0cc57d4c879 100644 --- a/src/plugins/compilerexplorer/api/request.h +++ b/src/plugins/compilerexplorer/api/request.h @@ -10,6 +10,7 @@ #include <QLoggingCategory> #include <QNetworkAccessManager> #include <QNetworkReply> +#include <QPromise> #include <QString> static Q_LOGGING_CATEGORY(apiLog, "qtc.compilerexplorer.api", QtWarningMsg); From b52f7a2e031e144efe6a74a1e2335d2b40c10faf Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 22 Sep 2023 09:54:14 +0200 Subject: [PATCH 1242/1777] Add change log for 11.0.3 Change-Id: I702c876d1af8884349367dbc1f21436656a05c76 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- dist/changelog/changes-11.0.3.md | 123 +++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 dist/changelog/changes-11.0.3.md diff --git a/dist/changelog/changes-11.0.3.md b/dist/changelog/changes-11.0.3.md new file mode 100644 index 00000000000..b7f435b47f8 --- /dev/null +++ b/dist/changelog/changes-11.0.3.md @@ -0,0 +1,123 @@ +Qt Creator 11.0.3 +================= + +Qt Creator version 11.0.3 contains bug fixes. + +The most important changes are listed in this document. For a complete list of +changes, see the Git log for the Qt Creator sources that you can check out from +the public Git repository. For example: + + git clone git://code.qt.io/qt-creator/qt-creator.git + git log --cherry-pick --pretty=oneline origin/v11.0.2..v11.0.3 + +Editing +------- + +### C++ + +* Fixed a crash with constructs that look similar to a function with initializer + ([QTCREATORBUG-29386](https://bugreports.qt.io/browse/QTCREATORBUG-29386)) +* Fixed an issue with Clang headers + ([QTCREATORBUG-29571](https://bugreports.qt.io/browse/QTCREATORBUG-29571)) +* Fixed missing lightbulbs for Clangd refactoring actions + ([QTCREATORBUG-29493](https://bugreports.qt.io/browse/QTCREATORBUG-29493)) + +### QML + +* Fixed wrong M16 warnings + ([QTCREATORBUG-28468](https://bugreports.qt.io/browse/QTCREATORBUG-28468)) + +### Language Server Protocol + +* Fixed the loading of client settings + ([QTCREATORBUG-29477](https://bugreports.qt.io/browse/QTCREATORBUG-29477)) + +Projects +-------- + +* Fixed that issue descriptions were cut off + ([QTCREATORBUG-29458](https://bugreports.qt.io/browse/QTCREATORBUG-29458)) +* Fixed an issue when running in terminal + ([QTCREATORBUG-29503](https://bugreports.qt.io/browse/QTCREATORBUG-29503)) + +### CMake + +* Fixed a crash when loading a project + ([QTCREATORBUG-29587](https://bugreports.qt.io/browse/QTCREATORBUG-29587)) +* Fixed that `Stage for installation` was enabled by default for iOS Simulator + and Bare Metal configurations + ([QTCREATORBUG-29293](https://bugreports.qt.io/browse/QTCREATORBUG-29293), + [QTCREATORBUG-29475](https://bugreports.qt.io/browse/QTCREATORBUG-29475)) +* Fixed adding and removing files from modified CMake files + ([QTCREATORBUG-29550](https://bugreports.qt.io/browse/QTCREATORBUG-29550)) + +### qmake + +* Fixed the ABI setting in the qmake build step + ([QTCREATORBUG-29552](https://bugreports.qt.io/browse/QTCREATORBUG-29552)) + +### Python + +* Fixed that `.pyw` files were missing from the target information + +Debugging +--------- + +* Fixed the debugging in terminal + ([QTCREATORBUG-29463](https://bugreports.qt.io/browse/QTCREATORBUG-29463), + [QTCREATORBUG-29497](https://bugreports.qt.io/browse/QTCREATORBUG-29497), + [QTCREATORBUG-29554](https://bugreports.qt.io/browse/QTCREATORBUG-29554)) +* Improved the pretty printer of `std::string` for `libc++` + ([QTCREATORBUG-29526](https://bugreports.qt.io/browse/QTCREATORBUG-29526)) + +Analyzer +-------- + +### CTF Visualizer + +* Fixed a crash when loading invalid JSON + +Terminal +-------- + +* Fixed the default environment variables + ([QTCREATORBUG-29515](https://bugreports.qt.io/browse/QTCREATORBUG-29515)) +* Fixed `gnome-terminal` and `xdg-terminal` for the external terminal + ([QTCREATORBUG-29488](https://bugreports.qt.io/browse/QTCREATORBUG-29488)) + +Test Integration +---------------- + +### CTest + +* Fixed the update of target information after a change in the kit + ([QTCREATORBUG-29477](https://bugreports.qt.io/browse/QTCREATORBUG-29477)) + +Platforms +--------- + +### Remote Linux + +* Fixed that SFTP was used (and failed) for deployment when the source is remote + ([QTCREATORBUG-29524](https://bugreports.qt.io/browse/QTCREATORBUG-29524)) +* Fixed deployment to the device root directory + ([QTCREATORBUG-29597](https://bugreports.qt.io/browse/QTCREATORBUG-29597)) + +### Docker + +* Fixed the registration of sysroots by the installer + ([QTCREATORBUG-29523](https://bugreports.qt.io/browse/QTCREATORBUG-29523)) + +Credits for these changes go to: +-------------------------------- +Alessandro Portale +Alexandre Laurent +André Pönitz +Christian Kandeler +Christian Stenger +Cristian Adam +David Schulz +Eike Ziller +Marcus Tillmanns +Miikka Heikkinen +Semih Yavuz From 45a8dc4e443dfbc9a7af11a1e2ae6d532ffe9ed4 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 22 Sep 2023 12:29:25 +0200 Subject: [PATCH 1243/1777] CMakePM: Support local functions and variables for code completion ... and also navigation via F2. Change-Id: I0f1242c6ff502973de180643b369c635636b0112 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakeeditor.cpp | 66 +++++++++++++++++-- .../cmakefilecompletionassist.cpp | 33 ++++++++++ 2 files changed, 95 insertions(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index d4e89a26a92..6ba35180c31 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -11,6 +11,8 @@ #include "cmakekitaspect.h" #include "cmakeprojectconstants.h" +#include "3rdparty/cmake/cmListFileCache.h" + #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/coreplugintr.h> @@ -146,6 +148,35 @@ static QString unescape(const QString &s) return result; } +QHash<QString, Utils::Link> getLocalSymbolsHash(const QByteArray &content, const Utils::FilePath &filePath) +{ + cmListFile cmakeListFile; + if (!content.isEmpty()) { + std::string errorString; + const std::string fileName = "buffer"; + if (!cmakeListFile.ParseString(content.toStdString(), fileName, errorString)) + return {}; + } + + QHash<QString, Utils::Link> hash; + for (const auto &func : cmakeListFile.Functions) { + if (func.LowerCaseName() != "function" && func.LowerCaseName() != "macro" + && func.LowerCaseName() != "set" && func.LowerCaseName() != "option") + continue; + + if (func.Arguments().size() == 0) + continue; + auto arg = func.Arguments()[0]; + + Utils::Link link; + link.targetFilePath = filePath; + link.targetLine = arg.Line; + link.targetColumn = arg.Column - 1; + hash.insert(QString::fromUtf8(arg.Value), link); + } + return hash; +} + void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, const Utils::LinkHandler &processLinkCallback, bool/* resolveTarget*/, @@ -194,6 +225,12 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, buffer.replace("${CMAKE_CURRENT_SOURCE_DIR}", dir.path()); buffer.replace("${CMAKE_CURRENT_LIST_DIR}", dir.path()); + auto addTextStartEndToLink = [&](Utils::Link &link) { + link.linkTextStart = cursor.position() - column + beginPos + 1; + link.linkTextEnd = cursor.position() - column + endPos; + return link; + }; + if (auto project = ProjectTree::currentProject()) { buffer.replace("${CMAKE_SOURCE_DIR}", project->projectDirectory().path()); if (auto bs = ProjectTree::currentBuildSystem()) { @@ -216,14 +253,35 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, const CMakeBuildSystem *cbs = static_cast<const CMakeBuildSystem *>(bs); if (cbs->cmakeSymbolsHash().contains(buffer)) { link = cbs->cmakeSymbolsHash().value(buffer); - link.linkTextStart = cursor.position() - column + beginPos + 1; - link.linkTextEnd = cursor.position() - column + endPos; + addTextStartEndToLink(link); return processLinkCallback(link); } } } // TODO: Resolve more variables + // Resolve local variables and functions + auto findFunctionEnd = [cursor, this]() -> int { + int pos = cursor.position(); + QChar chr; + do { + chr = textDocument()->characterAt(--pos); + } while (pos > 0 && chr != ')'); + return pos; + }; + auto hash = getLocalSymbolsHash(textDocument()->textAt(0, findFunctionEnd() + 1).toUtf8(), + textDocument()->filePath()); + + // Strip variable coating + if (buffer.startsWith("${") && buffer.endsWith("}")) + buffer = buffer.mid(2, buffer.size() - 3); + + if (hash.contains(buffer)) { + link = hash.value(buffer); + addTextStartEndToLink(link); + return processLinkCallback(link); + } + Utils::FilePath fileName = dir.withNewPath(unescape(buffer)); if (fileName.isRelativePath()) fileName = dir.pathAppended(fileName.path()); @@ -236,9 +294,9 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, return processLinkCallback(link); } link.targetFilePath = fileName; - link.linkTextStart = cursor.position() - column + beginPos + 1; - link.linkTextEnd = cursor.position() - column + endPos; + addTextStartEndToLink(link); } + processLinkCallback(link); } diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 1a1f9d57367..5319eb37509 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -11,6 +11,8 @@ #include "cmaketool.h" #include "cmaketoolmanager.h" +#include "3rdparty/cmake/cmListFileCache.h" + #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorericons.h> @@ -191,6 +193,30 @@ static int addFilePathItems(const AssistInterface *interface, return startPos; } +QPair<QStringList, QStringList> getLocalFunctionsAndVariables(const QByteArray &content) +{ + cmListFile cmakeListFile; + std::string errorString; + if (!content.isEmpty()) { + const std::string fileName = "buffer"; + if (!cmakeListFile.ParseString(content.toStdString(), fileName, errorString)) + return {{}, {}}; + } + + QStringList variables; + QStringList functions; + for (const auto &func : cmakeListFile.Functions) { + if (func.Arguments().size() == 0) + continue; + + if (func.LowerCaseName() == "macro" || func.LowerCaseName() == "function") + functions << QString::fromUtf8(func.Arguments()[0].Value); + if (func.LowerCaseName() == "set" || func.LowerCaseName() == "option") + variables << QString::fromUtf8(func.Arguments()[0].Value); + } + return {functions, variables}; +} + IAssistProposal *CMakeFileCompletionAssist::performAsync() { CMakeKeywords keywords; @@ -245,6 +271,9 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() } } + auto [localFunctions, localVariables] = getLocalFunctionsAndVariables( + interface()->textAt(0, prevFunctionEnd + 1).toUtf8()); + QList<AssistProposalItemInterface *> items; const QString varGenexToken = interface()->textAt(startPos - 2, 2); @@ -267,6 +296,7 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() || functionName == "cmake_print_variables") { items.append(generateList(keywords.variables, m_variableIcon)); items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); + items.append(generateList(localVariables, m_variableIcon)); } if (functionName == "if" || functionName == "elseif" || functionName == "cmake_policy") @@ -310,6 +340,7 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() // On a new line we just want functions items.append(generateList(keywords.functions, m_functionIcon)); items.append(generateList(projectKeywords.functions, m_projectFunctionIcon)); + items.append(generateList(localFunctions, m_functionIcon)); // Snippets would make more sense only for the top level suggestions items.append(m_snippetCollector.collect()); @@ -319,6 +350,8 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() if (!onlyFileItems()) { items.append(generateList(keywords.variables, m_variableIcon)); items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); + items.append(generateList(localVariables, m_variableIcon)); + items.append(generateList(keywords.properties, m_propertyIcon)); items.append(generateList(buildTargets, m_targetsIcon)); } From 53b8f0e49565ac594c0a13740bb673bd09674ffe Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 22 Sep 2023 16:22:49 +0200 Subject: [PATCH 1244/1777] CMakePM: Speed up CMake introspection By listing files instead of running cmake and asking CMake to provide the information. For properties and modules now the information is taken from the active CMake version and not from the Syntax-highlighting file. Change-Id: I0974cc816d990fd382d9e855eb08416b50d0368b Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmaketool.cpp | 76 ++++++++++++------- 1 file changed, 49 insertions(+), 27 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 22e980cd9c0..64fc5af5580 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -14,6 +14,7 @@ #include <utils/persistentcachestore.h> #include <utils/process.h> #include <utils/qtcassert.h> +#include <utils/temporarydirectory.h> #include <QDir> #include <QJsonDocument> @@ -261,26 +262,59 @@ CMakeKeywords CMakeTool::keywords() if (m_introspection->m_functions.isEmpty() && m_introspection->m_didRun) { Process proc; - runCMake(proc, {"--help-command-list"}, 5); - if (proc.result() == ProcessResult::FinishedWithSuccess) - m_introspection->m_functions = Utils::filtered(proc.cleanedStdOut().split('\n'), - std::not_fn(&QString::isEmpty)); - runCMake(proc, {"--help-property-list"}, 5); - if (proc.result() == ProcessResult::FinishedWithSuccess) - m_introspection->m_properties = parseVariableOutput(proc.cleanedStdOut()); + const FilePath findCMakeRoot = TemporaryDirectory::masterDirectoryFilePath() + / "find-root.cmake"; + findCMakeRoot.writeFileContents("message(${CMAKE_ROOT})"); - runCMake(proc, {"--help-variable-list"}, 5); + FilePath cmakeRoot; + runCMake(proc, {"-P", findCMakeRoot.nativePath()}, 5); if (proc.result() == ProcessResult::FinishedWithSuccess) { - m_introspection->m_variables = Utils::filteredUnique( - parseVariableOutput(proc.cleanedStdOut())); - Utils::sort(m_introspection->m_variables); + QStringList output = filtered(proc.allOutput().split('\n'), + std::not_fn(&QString::isEmpty)); + if (output.size() > 0) + cmakeRoot = FilePath::fromString(output[0]); } - runCMake(proc, {"--help-policy-list"}, 5); - if (proc.result() == ProcessResult::FinishedWithSuccess) - m_introspection->m_policies = Utils::filtered(proc.cleanedStdOut().split('\n'), - std::not_fn(&QString::isEmpty)); + const struct + { + const QString helpPath; + QStringList &targetList; + } introspections[] = { + // Functions + {"Help/command", m_introspection->m_functions}, + // Properties + {"Help/prop_dir", m_introspection->m_directoryProperties}, + {"Help/prop_sf", m_introspection->m_sourceProperties}, + {"Help/prop_test", m_introspection->m_testProperties}, + {"Help/prop_tgt", m_introspection->m_targetProperties}, + {"Help/prop_gbl", m_introspection->m_properties}, + // Variables + {"Help/variable", m_introspection->m_variables}, + // Policies + {"Help/policy", m_introspection->m_policies}, + }; + for (auto &i : introspections) { + const FilePaths files = cmakeRoot.pathAppended(i.helpPath) + .dirEntries({{"*.rst"}, QDir::Files}, QDir::Name); + i.targetList = transform<QStringList>(files, &FilePath::completeBaseName); + } + + m_introspection->m_properties << m_introspection->m_directoryProperties; + m_introspection->m_properties << m_introspection->m_sourceProperties; + m_introspection->m_properties << m_introspection->m_testProperties; + m_introspection->m_properties << m_introspection->m_targetProperties; + + // Modules + const FilePaths files + = cmakeRoot.pathAppended("Help/module").dirEntries({{"*.rst"}, QDir::Files}, QDir::Name); + const QStringList fileNames = transform<QStringList>(files, &FilePath::completeBaseName); + for (const QString &fileName : fileNames) { + if (fileName.startsWith("Find")) + m_introspection->m_findModules << fileName.mid(4); + else + m_introspection->m_includeStandardModules << fileName; + } parseSyntaxHighlightingXml(); } @@ -567,18 +601,6 @@ void CMakeTool::parseSyntaxHighlightingXml() } } else if (name == u"generator-expressions") { m_introspection->m_generatorExpressions = readItemList(reader); - } else if (name == u"directory-properties") { - m_introspection->m_directoryProperties = readItemList(reader); - } else if (name == u"source-properties") { - m_introspection->m_sourceProperties = readItemList(reader); - } else if (name == u"target-properties") { - m_introspection->m_targetProperties = readItemList(reader); - } else if (name == u"test-properties") { - m_introspection->m_testProperties = readItemList(reader); - } else if (name == u"standard-modules") { - m_introspection->m_includeStandardModules = readItemList(reader); - } else if (name == u"standard-finder-modules") { - m_introspection->m_findModules = readItemList(reader); } else { reader.skipCurrentElement(); } From 2e3c656ee17e7e3ae25e330e494c815357571ca6 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 22 Sep 2023 17:28:30 +0200 Subject: [PATCH 1245/1777] ScreenRecorder: Fix warning Change-Id: I83130abbf61c43ab7835ab012b3005287aa6d2f4 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/screenrecorder/screenrecordersettings.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/screenrecorder/screenrecordersettings.cpp b/src/plugins/screenrecorder/screenrecordersettings.cpp index ef914616a96..cd506057a0c 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.cpp +++ b/src/plugins/screenrecorder/screenrecordersettings.cpp @@ -94,6 +94,8 @@ ScreenRecorderSettings::ScreenRecorderSettings() captureType.addOption({"AVFoundation", {}, CaptureType::AVFoundation}); captureType.setDefaultValue(CaptureType::AVFoundation); break; + default: + break; } auto setCaptureMouseClicksVisible = [this] { const QVariant value = captureType.itemValueForIndex(captureType.volatileValue()); From db00f563860e1b05745881880b9155339435cd63 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 22 Sep 2023 19:30:31 +0200 Subject: [PATCH 1246/1777] ProjectExplorer: Remove unnecessary visual gap in runsettings Some Run Settings widgets had an unnecessary 2-pixel gap on the top. This removes it. Change-Id: Ie958940e6d2301ca0e51d93ddca9dc77f9ccaed1 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/projectexplorer/runsettingspropertiespage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index 0b780cee3e7..20758cbc4e3 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -496,7 +496,7 @@ void RunSettingsWidget::addRunControlWidgets() void RunSettingsWidget::addSubWidget(QWidget *widget, QLabel *label) { - widget->setContentsMargins(0, 2, 0, 0); + widget->setContentsMargins({}); QFont f = label->font(); f.setBold(true); From 0c104914ab25d233d16c32f159ba99257350c872 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 28 Aug 2023 15:31:40 +0200 Subject: [PATCH 1247/1777] ExtensionSystem: Always generate profiling data The overhead is minimal and can be shown at a later point even when not printing profiling data to the terminal. Move the data to the plugin spec for later retrieval. Task-number: QTCREATORBUG-29540 Change-Id: I392ff85a8a8b5c01ecba07fefd06e5029f692bf6 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 4da8430cab471afb6f43cd540d20e88be6545a10) --- src/app/main.cpp | 1 + src/libs/extensionsystem/optionsparser.cpp | 2 +- src/libs/extensionsystem/pluginmanager.cpp | 93 ++++++++++++---------- src/libs/extensionsystem/pluginmanager.h | 1 + src/libs/extensionsystem/pluginmanager_p.h | 7 +- src/libs/extensionsystem/pluginspec.cpp | 5 ++ src/libs/extensionsystem/pluginspec.h | 11 +++ src/libs/extensionsystem/pluginspec_p.h | 2 + 8 files changed, 75 insertions(+), 47 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 46233ba19ca..ac982d54672 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -642,6 +642,7 @@ int main(int argc, char **argv) PluginManager::setPluginIID(QLatin1String("org.qt-project.Qt.QtCreatorPlugin")); PluginManager::setGlobalSettings(globalSettings); PluginManager::setSettings(settings); + PluginManager::startProfiling(); QTranslator translator; QTranslator qtTranslator; diff --git a/src/libs/extensionsystem/optionsparser.cpp b/src/libs/extensionsystem/optionsparser.cpp index 8e3a5d900e7..116a1f4fe21 100644 --- a/src/libs/extensionsystem/optionsparser.cpp +++ b/src/libs/extensionsystem/optionsparser.cpp @@ -239,7 +239,7 @@ bool OptionsParser::checkForProfilingOption() { if (m_currentArg != QLatin1String(PROFILE_OPTION)) return false; - m_pmPrivate->initProfiling(); + m_pmPrivate->increaseProfilingVerbosity(); return true; } diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 45b9807958e..5fa8b4a8cfd 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -949,7 +949,7 @@ void PluginManagerPrivate::nextDelayedInitialize() delayedInitializeQueue.pop(); profilingReport(">delayedInitialize", spec); bool delay = spec->d->delayedInitialize(); - profilingReport("<delayedInitialize", spec); + profilingReport("<delayedInitialize", spec, &spec->d->performanceData.delayedInitialize); if (delay) break; // do next delayedInitialize after a delay } @@ -1305,7 +1305,7 @@ void PluginManagerPrivate::addObject(QObject *obj) if (debugLeaks) qDebug() << "PluginManagerPrivate::addObject" << obj << obj->objectName(); - if (m_profilingVerbosity && !m_profileTimer.isNull()) { + if (m_profilingVerbosity > 1 && m_profileTimer) { // Report a timestamp when adding an object. Useful for profiling // its initialization time. const int absoluteElapsedMS = int(m_profileTimer->elapsed()); @@ -1345,6 +1345,9 @@ void PluginManagerPrivate::removeObject(QObject *obj) */ void PluginManagerPrivate::loadPlugins() { + if (m_profilingVerbosity > 0) + qDebug("Profiling started"); + const QVector<PluginSpec *> queue = loadQueue(); Utils::setMimeStartupPhase(MimeStartupPhase::PluginsLoading); for (PluginSpec *spec : queue) @@ -1593,7 +1596,9 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt case PluginSpec::Running: profilingReport(">initializeExtensions", spec); spec->d->initializeExtensions(); - profilingReport("<initializeExtensions", spec); + profilingReport("<initializeExtensions", + spec, + &spec->d->performanceData.extensionsInitialized); return; case PluginSpec::Deleted: profilingReport(">delete", spec); @@ -1621,12 +1626,12 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt case PluginSpec::Loaded: profilingReport(">loadLibrary", spec); spec->d->loadLibrary(); - profilingReport("<loadLibrary", spec); + profilingReport("<loadLibrary", spec, &spec->d->performanceData.load); break; case PluginSpec::Initialized: profilingReport(">initializePlugin", spec); spec->d->initializePlugin(); - profilingReport("<initializePlugin", spec); + profilingReport("<initializePlugin", spec, &spec->d->performanceData.initialize); break; case PluginSpec::Stopped: profilingReport(">stop", spec); @@ -1762,34 +1767,30 @@ PluginSpec *PluginManagerPrivate::pluginByName(const QString &name) const return Utils::findOrDefault(pluginSpecs, [name](PluginSpec *spec) { return spec->name() == name; }); } -void PluginManagerPrivate::initProfiling() +void PluginManagerPrivate::increaseProfilingVerbosity() { - if (m_profileTimer.isNull()) { - m_profileTimer.reset(new QElapsedTimer); - m_profileTimer->start(); - m_profileElapsedMS = 0; - qDebug("Profiling started"); - } else { - m_profilingVerbosity++; - } + m_profilingVerbosity++; + if (!m_profileTimer) + PluginManager::startProfiling(); } -void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *spec /* = 0 */) +void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *spec, qint64 *target) { - if (!m_profileTimer.isNull()) { - const int absoluteElapsedMS = int(m_profileTimer->elapsed()); - const int elapsedMS = absoluteElapsedMS - m_profileElapsedMS; + if (m_profileTimer) { + const qint64 absoluteElapsedMS = m_profileTimer->elapsed(); + const qint64 elapsedMS = absoluteElapsedMS - m_profileElapsedMS; m_profileElapsedMS = absoluteElapsedMS; - if (spec) - qDebug("%-22s %-22s %8dms (%8dms)", what, qPrintable(spec->name()), absoluteElapsedMS, elapsedMS); - else - qDebug("%-45s %8dms (%8dms)", what, absoluteElapsedMS, elapsedMS); - if (what && *what == '<') { + if (m_profilingVerbosity > 0) { + qDebug("%-22s %-22s %8lldms (%8lldms)", + what, + qPrintable(spec->name()), + absoluteElapsedMS, + elapsedMS); + } + if (target) { QString tc; - if (spec) { - m_profileTotal[spec] += elapsedMS; - tc = spec->name() + '_'; - } + *target = elapsedMS; + tc = spec->name() + '_'; tc += QString::fromUtf8(QByteArray(what + 1)); Utils::Benchmarker::report("loadPlugins", tc, elapsedMS); } @@ -1798,22 +1799,23 @@ void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *s void PluginManagerPrivate::profilingSummary() const { - if (!m_profileTimer.isNull()) { - QMultiMap<int, const PluginSpec *> sorter; - int total = 0; - - auto totalEnd = m_profileTotal.constEnd(); - for (auto it = m_profileTotal.constBegin(); it != totalEnd; ++it) { - sorter.insert(it.value(), it.key()); - total += it.value(); + if (m_profilingVerbosity > 0) { + const QVector<PluginSpec *> specs + = Utils::sorted(pluginSpecs, [](PluginSpec *s1, PluginSpec *s2) { + return s1->performanceData().total() < s2->performanceData().total(); + }); + const qint64 total + = std::accumulate(specs.constBegin(), specs.constEnd(), 0, [](qint64 t, PluginSpec *s) { + return t + s->performanceData().total(); + }); + for (PluginSpec *s : specs) { + if (!s->isEffectivelyEnabled()) + continue; + const qint64 t = s->performanceData().total(); + qDebug("%-22s %8lldms ( %5.2f%% )", qPrintable(s->name()), t, 100.0 * t / total); } - - auto sorterEnd = sorter.constEnd(); - for (auto it = sorter.constBegin(); it != sorterEnd; ++it) - qDebug("%-22s %8dms ( %5.2f%% )", qPrintable(it.value()->name()), - it.key(), 100.0 * it.key() / total); - qDebug("Total: %8dms", total); - Utils::Benchmarker::report("loadPlugins", "Total", total); + qDebug("Total: %8lldms", total); + Utils::Benchmarker::report("loadPlugins", "Total", total); } } @@ -1857,4 +1859,11 @@ QObject *PluginManager::getObjectByName(const QString &name) }); } +void PluginManager::startProfiling() +{ + d->m_profileTimer.reset(new QElapsedTimer); + d->m_profileTimer->start(); + d->m_profileElapsedMS = 0; +} + } // ExtensionSystem diff --git a/src/libs/extensionsystem/pluginmanager.h b/src/libs/extensionsystem/pluginmanager.h index ecd0ee70b73..251db275ca7 100644 --- a/src/libs/extensionsystem/pluginmanager.h +++ b/src/libs/extensionsystem/pluginmanager.h @@ -64,6 +64,7 @@ public: static QObject *getObjectByName(const QString &name); + static void startProfiling(); // Plugin operations static QVector<PluginSpec *> loadQueue(); static void loadPlugins(); diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index c7a4291a6b7..75197013a8b 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -58,9 +58,9 @@ public: void loadPlugin(PluginSpec *spec, PluginSpec::State destState); void resolveDependencies(); void enableDependenciesIndirectly(); - void initProfiling(); + void increaseProfilingVerbosity(); void profilingSummary() const; - void profilingReport(const char *what, const PluginSpec *spec = nullptr); + void profilingReport(const char *what, const PluginSpec *spec, qint64 *target = nullptr); void setSettings(Utils::QtcSettings *settings); void setGlobalSettings(Utils::QtcSettings *settings); void readSettings(); @@ -106,8 +106,7 @@ public: QStringList arguments; QStringList argumentsForRestart; QScopedPointer<QElapsedTimer> m_profileTimer; - QHash<const PluginSpec *, int> m_profileTotal; - int m_profileElapsedMS = 0; + qint64 m_profileElapsedMS = 0; unsigned m_profilingVerbosity = 0; Utils::QtcSettings *settings = nullptr; Utils::QtcSettings *globalSettings = nullptr; diff --git a/src/libs/extensionsystem/pluginspec.cpp b/src/libs/extensionsystem/pluginspec.cpp index 62b3c0096f6..c633eaad610 100644 --- a/src/libs/extensionsystem/pluginspec.cpp +++ b/src/libs/extensionsystem/pluginspec.cpp @@ -402,6 +402,11 @@ QJsonObject PluginSpec::metaData() const return d->metaData; } +const PerformanceData &PluginSpec::performanceData() const +{ + return d->performanceData; +} + /*! Returns a list of descriptions of command line arguments the plugin processes. */ diff --git a/src/libs/extensionsystem/pluginspec.h b/src/libs/extensionsystem/pluginspec.h index 9abb4bf4475..43e39efeb1b 100644 --- a/src/libs/extensionsystem/pluginspec.h +++ b/src/libs/extensionsystem/pluginspec.h @@ -53,6 +53,16 @@ struct EXTENSIONSYSTEM_EXPORT PluginArgumentDescription QString description; }; +struct EXTENSIONSYSTEM_EXPORT PerformanceData +{ + qint64 load = 0; + qint64 initialize = 0; + qint64 extensionsInitialized = 0; + qint64 delayedInitialize = 0; + + qint64 total() const { return load + initialize + extensionsInitialized + delayedInitialize; } +}; + class EXTENSIONSYSTEM_EXPORT PluginSpec { public: @@ -84,6 +94,7 @@ public: bool isForceDisabled() const; QVector<PluginDependency> dependencies() const; QJsonObject metaData() const; + const PerformanceData &performanceData() const; using PluginArgumentDescriptions = QVector<PluginArgumentDescription>; PluginArgumentDescriptions argumentDescriptions() const; diff --git a/src/libs/extensionsystem/pluginspec_p.h b/src/libs/extensionsystem/pluginspec_p.h index 568ab943a31..c87111f02ae 100644 --- a/src/libs/extensionsystem/pluginspec_p.h +++ b/src/libs/extensionsystem/pluginspec_p.h @@ -84,6 +84,8 @@ public: bool hasError = false; QString errorString; + PerformanceData performanceData; + static bool isValidVersion(const QString &version); static int versionCompare(const QString &version1, const QString &version2); From aa4ff49f83869d543f656acf96b9f236555cc893 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 28 Aug 2023 16:21:39 +0200 Subject: [PATCH 1248/1777] ExtensionSystem: Add total real time to profiling report The original total only contained the time spent inside of plugin methods, but a lot of things get delayed arbitrarily to the event loop currently. That is included in the new "total startup". Task-number: QTCREATORBUG-29540 Change-Id: I832bb972d85bc4cf82f098e4cbf5d3ff3800d14a Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 026848eaddf377b70d42ddf13ec15fe1f73d3b0a) Reviewed-by: hjk <hjk@qt.io> --- src/libs/extensionsystem/pluginmanager.cpp | 5 ++++- src/libs/extensionsystem/pluginmanager_p.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 5fa8b4a8cfd..0f242ce1c1f 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -957,6 +957,8 @@ void PluginManagerPrivate::nextDelayedInitialize() m_isInitializationDone = true; delete delayedInitializeTimer; delayedInitializeTimer = nullptr; + if (m_profileTimer) + m_totalStartupMS = m_profileTimer->elapsed(); profilingSummary(); emit q->initializationDone(); #ifdef WITH_TESTS @@ -1814,7 +1816,8 @@ void PluginManagerPrivate::profilingSummary() const const qint64 t = s->performanceData().total(); qDebug("%-22s %8lldms ( %5.2f%% )", qPrintable(s->name()), t, 100.0 * t / total); } - qDebug("Total: %8lldms", total); + qDebug("Total plugins: %8lldms", total); + qDebug("Total startup: %8lldms", m_totalStartupMS); Utils::Benchmarker::report("loadPlugins", "Total", total); } } diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index 75197013a8b..4b5f45cccbc 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -107,6 +107,8 @@ public: QStringList argumentsForRestart; QScopedPointer<QElapsedTimer> m_profileTimer; qint64 m_profileElapsedMS = 0; + qint64 m_totalUntilDelayedInitialize = 0; + qint64 m_totalStartupMS = 0; unsigned m_profilingVerbosity = 0; Utils::QtcSettings *settings = nullptr; Utils::QtcSettings *globalSettings = nullptr; From 424ef68bd2938baa19287cf1353be37263bdcadc Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 21 Sep 2023 10:51:28 +0200 Subject: [PATCH 1249/1777] main: Warn if -installsettings points to a path without settings Especially confusing is that the "QtProject" part must be omitted, so include that information in the warning. Change-Id: I4214502fd045b0e13a55c50fa036194dec6dab35 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/app/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/main.cpp b/src/app/main.cpp index b403799e933..8a433d28d9e 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -614,6 +614,15 @@ int main(int argc, char **argv) QSettings::SystemScope, QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR), QLatin1String(Core::Constants::IDE_CASED_ID)); + // warn if -installsettings points to a place where no install settings are located + if (!options.installSettingsPath.isEmpty() && !QFileInfo::exists(installSettings->fileName())) { + displayError(QLatin1String("The install settings \"%1\" do not exist. The %2 option must " + "point to a path with existing settings, excluding the %3 part " + "of the path.") + .arg(QDir::toNativeSeparators(installSettings->fileName()), + INSTALL_SETTINGS_OPTION, + Core::Constants::IDE_SETTINGSVARIANT_STR)); + } Utils::TerminalCommand::setSettings(settings); setPixmapCacheLimit(); loadFonts(); From 1640b74dfb2d6708a93285f8d32e974d265ce1b5 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 21 Sep 2023 16:23:45 +0200 Subject: [PATCH 1250/1777] DAP: Fix the same name variables expanding Before when several variables had the same name it could be a cause that wrong variable will be expanded. Now the needed variables will be expanded. Change-Id: Icc945e573721d033db82cac85e2ed4dabb6ad25a Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/debugger/dap/dapengine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 74a0623911d..c83a125b312 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -720,7 +720,10 @@ void DapEngine::refreshLocals(const QJsonArray &variables) for (auto variable : variables) { WatchItem *item = new WatchItem; const QString name = variable.toObject().value("name").toString(); - item->iname = "local." + name; + if (m_isFirstLayer) + item->iname = "local." + name; + else + item->iname = m_currentWatchItem->iname + "." + name; item->name = name; item->type = variable.toObject().value("type").toString(); item->value = variable.toObject().value("value").toString(); From 99239927559586aa54fb302431e915464663e976 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 21 Sep 2023 16:07:15 +0200 Subject: [PATCH 1251/1777] Utils: Fix nullptr check in StringAspect Change-Id: Ibf649c7a00c9cc1ec778590c3c6b64bea9ad552a Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 1c4b1430b32..05b4d8796bf 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1131,12 +1131,15 @@ void StringAspect::addToLayout(LayoutItem &parent) lineEditDisplay->setValidatePlaceHolder(d->m_validatePlaceHolder); d->m_checkerImpl.updateWidgetFromCheckStatus(this, lineEditDisplay); - connect(d->m_checkerImpl.m_checked.get(), - &BoolAspect::volatileValueChanged, - lineEditDisplay, - [this, lineEditDisplay]() { - d->m_checkerImpl.updateWidgetFromCheckStatus(this, lineEditDisplay); - }); + + if (d->m_checkerImpl.m_checked.get()) { + connect(d->m_checkerImpl.m_checked.get(), + &BoolAspect::volatileValueChanged, + lineEditDisplay, + [this, lineEditDisplay]() { + d->m_checkerImpl.updateWidgetFromCheckStatus(this, lineEditDisplay); + }); + } addLabeledItem(parent, lineEditDisplay); useMacroExpander(lineEditDisplay); @@ -1206,12 +1209,14 @@ void StringAspect::addToLayout(LayoutItem &parent) textEditDisplay->setReadOnly(isReadOnly()); d->m_checkerImpl.updateWidgetFromCheckStatus(this, textEditDisplay); - connect(d->m_checkerImpl.m_checked.get(), - &BoolAspect::volatileValueChanged, - textEditDisplay, - [this, textEditDisplay]() { - d->m_checkerImpl.updateWidgetFromCheckStatus(this, textEditDisplay); - }); + if (d->m_checkerImpl.m_checked) { + connect(d->m_checkerImpl.m_checked.get(), + &BoolAspect::volatileValueChanged, + textEditDisplay, + [this, textEditDisplay]() { + d->m_checkerImpl.updateWidgetFromCheckStatus(this, textEditDisplay); + }); + } addLabeledItem(parent, textEditDisplay); useMacroExpander(textEditDisplay); From 68359f96a932fad3d230db4039abd9a900816e72 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 14 Aug 2023 12:39:25 +0200 Subject: [PATCH 1252/1777] Debugger: Make more noise again ... when attaching in connection with Run-in-terminal fails due to strict yama scope settings. Change-Id: I27731e36f07d99f817f606cb4625dc3a39dabc72 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/debugger/gdb/gdbengine.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 8b36ef539e6..0aeb7d0b5ae 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4993,8 +4993,7 @@ void GdbEngine::handleStubAttached(const DebuggerResponse &response, qint64 main break; case ResultError: if (response.data["msg"].data() == "ptrace: Operation not permitted.") { - showMessage(msgPtraceError(runParameters().startMode)); - notifyEngineRunFailed(); + notifyInferiorSetupFailedHelper(msgPtraceError(runParameters().startMode)); break; } showMessage(response.data["msg"].data()); From ee51a1cbdf8ee36b1cb98e00bcd815c1b70e49c0 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 25 Sep 2023 09:38:16 +0200 Subject: [PATCH 1253/1777] Docker: Remove superfluous default Change-Id: I05eee8021b48dae49cfe3a97a4bc8f89550b51be Reviewed-by: hjk <hjk@qt.io> --- src/plugins/docker/dockerdevice.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index a5dba04e4de..316ce591892 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -190,7 +190,6 @@ DockerDeviceSettings::DockerDeviceSettings() extraArgs.setSettingsKey(DockerDeviceExtraArgs); extraArgs.setLabelText(Tr::tr("Extra arguments:")); - extraArgs.setDefaultValue({}); extraArgs.setToolTip(Tr::tr("Extra arguments to pass to docker create.")); clangdExecutable.setSettingsKey(DockerDeviceClangDExecutable); From 92f76a33557ccd5acfd19016991b8f82083f8e49 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 22 Sep 2023 15:20:32 +0200 Subject: [PATCH 1254/1777] CppEditor: Do not call CanonicalSymbol::operator() on a temporary Somewhat surprisingly, the returned symbol is owned by the object. Prevent future instances of this mistake by making the function lvalue- ref-qualified. Change-Id: Id903ce160986d60cada55e181ad2f6eb2c7488da Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/cppeditor/cppcanonicalsymbol.cpp | 2 +- src/plugins/cppeditor/cppcanonicalsymbol.h | 2 +- src/plugins/cppeditor/cpptoolsreuse.cpp | 33 +++++++++++++++----- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/plugins/cppeditor/cppcanonicalsymbol.cpp b/src/plugins/cppeditor/cppcanonicalsymbol.cpp index 102a5d07819..4728f643096 100644 --- a/src/plugins/cppeditor/cppcanonicalsymbol.cpp +++ b/src/plugins/cppeditor/cppcanonicalsymbol.cpp @@ -54,7 +54,7 @@ Scope *CanonicalSymbol::getScopeAndExpression(const QTextCursor &cursor, QString return m_document->scopeAt(line, column); } -Symbol *CanonicalSymbol::operator()(const QTextCursor &cursor) +Symbol *CanonicalSymbol::operator()(const QTextCursor &cursor) & { QString code; diff --git a/src/plugins/cppeditor/cppcanonicalsymbol.h b/src/plugins/cppeditor/cppcanonicalsymbol.h index 010949bbbb3..6bf95c3181e 100644 --- a/src/plugins/cppeditor/cppcanonicalsymbol.h +++ b/src/plugins/cppeditor/cppcanonicalsymbol.h @@ -21,7 +21,7 @@ public: CPlusPlus::Scope *getScopeAndExpression(const QTextCursor &cursor, QString *code); - CPlusPlus::Symbol *operator()(const QTextCursor &cursor); + CPlusPlus::Symbol *operator()(const QTextCursor &cursor) &; CPlusPlus::Symbol *operator()(CPlusPlus::Scope *scope, const QString &code); public: diff --git a/src/plugins/cppeditor/cpptoolsreuse.cpp b/src/plugins/cppeditor/cpptoolsreuse.cpp index c098aca99c8..543f046237d 100644 --- a/src/plugins/cppeditor/cpptoolsreuse.cpp +++ b/src/plugins/cppeditor/cpptoolsreuse.cpp @@ -49,6 +49,7 @@ #include <QTextCursor> #include <QTextDocument> +#include <optional> #include <vector> using namespace CPlusPlus; @@ -687,8 +688,14 @@ SearchResultItems symbolOccurrencesInDeclarationComments( } }; + struct ClassInfo { + FilePath filePath; + int startOffset = -1; + int endOffset = -1; + }; + std::optional<ClassInfo> classInfo; + // Collect comment blocks associated with replace locations. - Symbol *canonicalSymbol = nullptr; for (const SearchResultItem &item : symbolOccurrencesInCode) { const FilePath filePath = FilePath::fromUserInput(item.path().last()); auto &[doc, content, cppDoc, allCommentTokens] = fileData(filePath); @@ -705,10 +712,19 @@ SearchResultItems symbolOccurrencesInDeclarationComments( for (const Token &tok : commentTokens) addToken(allCommentTokens, tok); - if (!canonicalSymbol) { + if (!classInfo) { QTextCursor cursor(doc); cursor.setPosition(Text::positionInText(doc, range.begin.line, range.begin.column + 1)); - canonicalSymbol = Internal::CanonicalSymbol(cppDoc, snapshot)(cursor); + Internal::CanonicalSymbol cs(cppDoc, snapshot); + Symbol * const canonicalSymbol = cs(cursor); + if (canonicalSymbol) { + classInfo.emplace(); + if (Class * const klass = canonicalSymbol->asClass()) { + classInfo->filePath = canonicalSymbol->filePath(); + classInfo->startOffset = klass->startOffset(); + classInfo->endOffset = klass->endOffset(); + } + } } // We hook in between the end of the "regular" search and (possibly non-interactive) @@ -722,14 +738,14 @@ SearchResultItems symbolOccurrencesInDeclarationComments( } // If the symbol is a class, collect all comment blocks in the class body. - if (Class * const klass = canonicalSymbol ? canonicalSymbol->asClass() : nullptr) { - auto &[_1, _2, symbolCppDoc, commentTokens] = fileData(canonicalSymbol->filePath()); + if (classInfo && !classInfo->filePath.isEmpty()) { + auto &[_1, _2, symbolCppDoc, commentTokens] = fileData(classInfo->filePath); TranslationUnit * const tu = symbolCppDoc->translationUnit(); for (int i = 0; i < tu->commentCount(); ++i) { const Token &tok = tu->commentAt(i); - if (tok.bytesBegin() < klass->startOffset()) + if (tok.bytesBegin() < classInfo->startOffset) continue; - if (tok.bytesBegin() >= klass->endOffset()) + if (tok.bytesBegin() >= classInfo->endOffset) break; addToken(commentTokens, tok); } @@ -806,7 +822,8 @@ QList<Text::Range> symbolOccurrencesInDeclarationComments(CppEditorWidget *edito const Document::Ptr &cppDoc = semanticInfo.doc; if (!cppDoc) return {}; - const Symbol * const symbol = Internal::CanonicalSymbol(cppDoc, semanticInfo.snapshot)(cursor); + Internal::CanonicalSymbol cs(cppDoc, semanticInfo.snapshot); + const Symbol * const symbol = cs(cursor); if (!symbol || !symbol->asArgument()) return {}; const QTextDocument * const textDoc = editorWidget->textDocument()->document(); From 4282aff307abe807f52310bdde65e87eb9ab3b82 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 25 Sep 2023 09:53:34 +0200 Subject: [PATCH 1255/1777] Core: Fix saving of session value keys Amends 621a2850d. Change-Id: If98ca4022cec76f5945db71dae29b4b9bb030128 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/coreplugin/session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/session.cpp b/src/plugins/coreplugin/session.cpp index 541ff527402..13d3902d96b 100644 --- a/src/plugins/coreplugin/session.cpp +++ b/src/plugins/coreplugin/session.cpp @@ -757,7 +757,7 @@ bool SessionManager::saveSession() data.insert("value-" + it.key(), it.value()); keys << it.key(); } - data.insert("valueKeys", QVariant::fromValue(keys)); + data.insert("valueKeys", stringsFromKeys(keys)); if (!d->m_writer || d->m_writer->fileName() != filePath) { delete d->m_writer; From 080cb867616f7c3a3502576ba4183d0a4f48e6c4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 15 Sep 2023 12:10:35 +0200 Subject: [PATCH 1256/1777] Core: Pimpl MainWindow I'd like to disentangle things a bit, and there's quite a bit non-window-ish stuff here. Change-Id: Iad1e1d17ccd10b3ffff14251039ae2a5d6bfb675 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/android/androidmanager.cpp | 1 + .../coreplugin/actionmanager/actionmanager.h | 2 + src/plugins/coreplugin/documentmanager.h | 4 +- .../coreplugin/editormanager/editormanager.h | 4 +- src/plugins/coreplugin/icore.h | 6 +- src/plugins/coreplugin/jsexpander.h | 4 +- src/plugins/coreplugin/mainwindow.cpp | 374 ++++++++++++------ src/plugins/coreplugin/mainwindow.h | 119 +----- src/plugins/coreplugin/messagemanager.h | 7 +- src/plugins/coreplugin/modemanager.h | 6 +- src/plugins/coreplugin/outputpanemanager.h | 2 + src/plugins/coreplugin/vcsmanager.h | 4 +- 12 files changed, 279 insertions(+), 254 deletions(-) diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index d8fd53432cc..13595e93c51 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -12,6 +12,7 @@ #include <cmakeprojectmanager/cmakeprojectconstants.h> +#include <coreplugin/icontext.h> #include <coreplugin/messagemanager.h> #include <projectexplorer/buildsteplist.h> diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.h b/src/plugins/coreplugin/actionmanager/actionmanager.h index c85c31a8d86..96ee3f79e19 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.h +++ b/src/plugins/coreplugin/actionmanager/actionmanager.h @@ -25,6 +25,7 @@ class Context; namespace Internal { class CorePlugin; class MainWindow; +class MainWindowPrivate; } // Internal class CORE_EXPORT ActionManager : public QObject @@ -67,6 +68,7 @@ private: friend class Core::Internal::CorePlugin; // initialization friend class Core::Internal::MainWindow; // saving settings and setting context + friend class Core::Internal::MainWindowPrivate; // saving settings and setting context }; } // namespace Core diff --git a/src/plugins/coreplugin/documentmanager.h b/src/plugins/coreplugin/documentmanager.h index 7f6e0eff55b..a731095398a 100644 --- a/src/plugins/coreplugin/documentmanager.h +++ b/src/plugins/coreplugin/documentmanager.h @@ -20,7 +20,7 @@ class IDocument; namespace Internal { class DocumentManagerPrivate; -class MainWindow; +class MainWindowPrivate; } class CORE_EXPORT DocumentManager : public QObject @@ -152,7 +152,7 @@ private: void updateSaveAll(); static void registerSaveAllAction(); - friend class Core::Internal::MainWindow; + friend class Core::Internal::MainWindowPrivate; friend class Core::Internal::DocumentManagerPrivate; }; diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index 5e211c88e2f..1313fb93b1e 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -29,7 +29,7 @@ namespace Core { class IDocument; class LocatorFilterEntry; -namespace Internal { class MainWindow; } +namespace Internal { class MainWindowPrivate; } class CORE_EXPORT EditorManagerPlaceHolder final : public QWidget { @@ -188,7 +188,7 @@ private: explicit EditorManager(QObject *parent); ~EditorManager() override; - friend class Core::Internal::MainWindow; + friend class Core::Internal::MainWindowPrivate; }; } // namespace Core diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index 8b41b016419..3b8dfe8a0b3 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -29,7 +29,10 @@ namespace Core { class Context; class IWizardFactory; -namespace Internal { class MainWindow; } +namespace Internal { +class MainWindow; +class MainWindowPrivate; +} // Internal class NewDialog; @@ -38,6 +41,7 @@ class CORE_EXPORT ICore : public QObject Q_OBJECT friend class Internal::MainWindow; + friend class Internal::MainWindowPrivate; friend class IWizardFactory; explicit ICore(Internal::MainWindow *mw); diff --git a/src/plugins/coreplugin/jsexpander.h b/src/plugins/coreplugin/jsexpander.h index 780b0dda742..03a575bd83d 100644 --- a/src/plugins/coreplugin/jsexpander.h +++ b/src/plugins/coreplugin/jsexpander.h @@ -20,7 +20,7 @@ class MacroExpander; namespace Core { namespace Internal { -class MainWindow; +class MainWindowPrivate; class JsExpanderPrivate; } // namespace Internal @@ -50,7 +50,7 @@ private: static JsExpander *createGlobalJsExpander(); Internal::JsExpanderPrivate *d; - friend class Core::Internal::MainWindow; + friend class Core::Internal::MainWindowPrivate; }; } // namespace Core diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 9e7648e21c9..852e33f5cfe 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -79,6 +79,7 @@ #include <QStatusBar> #include <QStyleFactory> #include <QTextBrowser> +#include <QTimer> #include <QToolButton> #include <QVersionNumber> @@ -106,26 +107,122 @@ static bool hideToolsMenu() enum { debugMainWindow = 0 }; -MainWindow::MainWindow() - : AppMainWindow() - , m_coreImpl(new ICore(this)) - , m_lowPrioAdditionalContexts(Constants::C_GLOBAL) - , m_progressManager(new ProgressManagerPrivate) - , m_jsExpander(JsExpander::createGlobalJsExpander()) - , m_vcsManager(new VcsManager) - , m_modeStack(new FancyTabWidget(this)) - , m_shortcutSettings(new ShortcutSettings) - , m_toolSettings(new ToolSettings) - , m_mimeTypeSettings(new MimeTypeSettings) - , m_systemEditor(new SystemEditor) - , m_toggleLeftSideBarButton(new QToolButton) - , m_toggleRightSideBarButton(new QToolButton) + +class MainWindowPrivate : public QObject { - (void) new DocumentManager(this); +public: + explicit MainWindowPrivate(MainWindow *mainWindow) + : q(mainWindow) + {} + + ~MainWindowPrivate(); + + void init(); + + static void openFile(); + static IDocument *openFiles(const FilePaths &filePaths, ICore::OpenFilesFlags flags, + const FilePath &workingDirectory = {}); + void aboutToShowRecentFiles(); + + static void setFocusToEditor(); + void aboutQtCreator(); + void aboutPlugins(); + void changeLog(); + void contact(); + void updateFocusWidget(QWidget *old, QWidget *now); + NavigationWidget *navigationWidget(Side side) const; + void setSidebarVisible(bool visible, Side side); + void destroyVersionDialog(); + void openDroppedFiles(const QList<Utils::DropSupport::FileSpec> &files); + void restoreWindowState(); + + void openFileFromDevice(); + + void updateContextObject(const QList<IContext *> &context); + void updateContext(); + + void registerDefaultContainers(); + void registerDefaultActions(); + void registerModeSelectorStyleActions(); + + void readSettings(); + void saveWindowSettings(); + + void updateModeSelectorStyleMenu(); + + MainWindow *q = nullptr; + ICore *m_coreImpl = nullptr; + QTimer m_trimTimer; + QStringList m_aboutInformation; + Context m_highPrioAdditionalContexts; + Context m_lowPrioAdditionalContexts{Constants::C_GLOBAL}; + mutable QPrinter *m_printer = nullptr; + WindowSupport *m_windowSupport = nullptr; + EditorManager *m_editorManager = nullptr; + ExternalToolManager *m_externalToolManager = nullptr; + MessageManager *m_messageManager = nullptr; + ProgressManagerPrivate *m_progressManager = nullptr; + JsExpander *m_jsExpander = nullptr; + VcsManager *m_vcsManager = nullptr; + ModeManager *m_modeManager = nullptr; + FancyTabWidget *m_modeStack = nullptr; + NavigationWidget *m_leftNavigationWidget = nullptr; + NavigationWidget *m_rightNavigationWidget = nullptr; + RightPaneWidget *m_rightPaneWidget = nullptr; + VersionDialog *m_versionDialog = nullptr; + + QList<IContext *> m_activeContext; + + std::unordered_map<QWidget *, IContext *> m_contextWidgets; + + ShortcutSettings *m_shortcutSettings = nullptr; + ToolSettings *m_toolSettings = nullptr; + MimeTypeSettings *m_mimeTypeSettings = nullptr; + SystemEditor *m_systemEditor = nullptr; + + // actions + QAction *m_focusToEditor = nullptr; + QAction *m_newAction = nullptr; + QAction *m_openAction = nullptr; + QAction *m_openWithAction = nullptr; + QAction *m_openFromDeviceAction = nullptr; + QAction *m_saveAllAction = nullptr; + QAction *m_exitAction = nullptr; + QAction *m_optionsAction = nullptr; + QAction *m_loggerAction = nullptr; + QAction *m_toggleLeftSideBarAction = nullptr; + QAction *m_toggleRightSideBarAction = nullptr; + QAction *m_toggleMenubarAction = nullptr; + QAction *m_cycleModeSelectorStyleAction = nullptr; + QAction *m_setModeSelectorStyleIconsAndTextAction = nullptr; + QAction *m_setModeSelectorStyleHiddenAction = nullptr; + QAction *m_setModeSelectorStyleIconsOnlyAction = nullptr; + QAction *m_themeAction = nullptr; + + QToolButton *m_toggleLeftSideBarButton = nullptr; + QToolButton *m_toggleRightSideBarButton = nullptr; + QColor m_overrideColor; + QList<std::function<bool()>> m_preCloseListeners; +}; + +void MainWindowPrivate::init() +{ + m_coreImpl = new ICore(q); + m_progressManager = new ProgressManagerPrivate; + m_jsExpander = JsExpander::createGlobalJsExpander(); + m_vcsManager = new VcsManager; + m_modeStack = new FancyTabWidget(q); + m_shortcutSettings = new ShortcutSettings; + m_toolSettings = new ToolSettings; + m_mimeTypeSettings = new MimeTypeSettings; + m_systemEditor = new SystemEditor; + m_toggleLeftSideBarButton = new QToolButton; + m_toggleRightSideBarButton = new QToolButton; + + (void) new DocumentManager(q); HistoryCompleter::setSettings(PluginManager::settings()); - setWindowTitle(QGuiApplication::applicationDisplayName()); if (HostOsInfo::isLinuxHost()) QApplication::setWindowIcon(Icons::QTCREATORLOGO_BIG.icon()); QString baseName = QApplication::style()->objectName(); @@ -148,12 +245,7 @@ MainWindow::MainWindow() QApplication::setStyle(new ManhattanStyle(baseName)); - setDockNestingEnabled(true); - - setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); - setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea); - - m_modeManager = new ModeManager(this, m_modeStack); + m_modeManager = new ModeManager(q, m_modeStack); connect(m_modeStack, &FancyTabWidget::topAreaClicked, this, [](Qt::MouseButton, Qt::KeyboardModifiers modifiers) { if (modifiers & Qt::ShiftModifier) { QColor color = QColorDialog::getColor(StyleHelper::requestedBaseColor(), ICore::dialogParent()); @@ -172,28 +264,27 @@ MainWindow::MainWindow() m_messageManager = new MessageManager; m_editorManager = new EditorManager(this); m_externalToolManager = new ExternalToolManager(); - setCentralWidget(m_modeStack); - m_progressManager->progressView()->setParent(this); + m_progressManager->progressView()->setParent(q); - connect(qApp, &QApplication::focusChanged, this, &MainWindow::updateFocusWidget); + connect(qApp, &QApplication::focusChanged, this, &MainWindowPrivate::updateFocusWidget); // Add small Toolbuttons for toggling the navigation widgets StatusBarManager::addStatusBarWidget(m_toggleLeftSideBarButton, StatusBarManager::First); - int childsCount = statusBar()->findChildren<QWidget *>(QString(), Qt::FindDirectChildrenOnly).count(); - statusBar()->insertPermanentWidget(childsCount - 1, m_toggleRightSideBarButton); // before QSizeGrip + int childsCount = q->statusBar()->findChildren<QWidget *>(QString(), Qt::FindDirectChildrenOnly).count(); + q->statusBar()->insertPermanentWidget(childsCount - 1, m_toggleRightSideBarButton); // before QSizeGrip // setUnifiedTitleAndToolBarOnMac(true); //if (HostOsInfo::isAnyUnixHost()) //signal(SIGINT, handleSigInt); - statusBar()->setProperty("p_styled", true); + q->statusBar()->setProperty("p_styled", true); - auto dropSupport = new DropSupport(this, [](QDropEvent *event, DropSupport *) { + auto dropSupport = new DropSupport(q, [](QDropEvent *event, DropSupport *) { return event->source() == nullptr; // only accept drops from the "outside" (e.g. file manager) }); connect(dropSupport, &DropSupport::filesDropped, - this, &MainWindow::openDroppedFiles); + this, &MainWindowPrivate::openDroppedFiles); if (HostOsInfo::isLinuxHost()) { m_trimTimer.setSingleShot(true); @@ -205,12 +296,25 @@ MainWindow::MainWindow() } } -NavigationWidget *MainWindow::navigationWidget(Side side) const +MainWindow::MainWindow() + : d(new MainWindowPrivate(this)) +{ + d->init(); // Separation needed for now as the call triggers other MainWindow calls. + + setWindowTitle(QGuiApplication::applicationDisplayName()); + setDockNestingEnabled(true); + setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); + setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea); + + setCentralWidget(d->m_modeStack); +} + +NavigationWidget *MainWindowPrivate::navigationWidget(Side side) const { return side == Side::Left ? m_leftNavigationWidget : m_rightNavigationWidget; } -void MainWindow::setSidebarVisible(bool visible, Side side) +void MainWindowPrivate::setSidebarVisible(bool visible, Side side) { if (NavigationWidgetPlaceHolder::current(side)) navigationWidget(side)->setShown(visible); @@ -218,30 +322,35 @@ void MainWindow::setSidebarVisible(bool visible, Side side) void MainWindow::setOverrideColor(const QColor &color) { - m_overrideColor = color; + d->m_overrideColor = color; } QStringList MainWindow::additionalAboutInformation() const { - return m_aboutInformation; + return d->m_aboutInformation; } void MainWindow::clearAboutInformation() { - m_aboutInformation.clear(); + d->m_aboutInformation.clear(); } void MainWindow::appendAboutInformation(const QString &line) { - m_aboutInformation.append(line); + d->m_aboutInformation.append(line); } void MainWindow::addPreCloseListener(const std::function<bool ()> &listener) { - m_preCloseListeners.append(listener); + d->m_preCloseListeners.append(listener); } MainWindow::~MainWindow() +{ + delete d; +} + +MainWindowPrivate::~MainWindowPrivate() { // explicitly delete window support, because that calls methods from ICore that call methods // from mainwindow, so mainwindow still needs to be alive @@ -295,7 +404,7 @@ MainWindow::~MainWindow() void MainWindow::init() { - m_progressManager->init(); // needs the status bar manager + d->m_progressManager->init(); // needs the status bar manager MessageManager::init(); OutputPaneManager::create(); } @@ -304,22 +413,22 @@ void MainWindow::extensionsInitialized() { EditorManagerPrivate::extensionsInitialized(); MimeTypeSettings::restoreSettings(); - m_windowSupport = new WindowSupport(this, Context("Core.MainWindow")); - m_windowSupport->setCloseActionEnabled(false); + d->m_windowSupport = new WindowSupport(this, Context("Core.MainWindow")); + d->m_windowSupport->setCloseActionEnabled(false); OutputPaneManager::initialize(); VcsManager::extensionsInitialized(); - m_leftNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories()); - m_rightNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories()); + d->m_leftNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories()); + d->m_rightNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories()); ModeManager::extensionsInitialized(); - readSettings(); - updateContext(); + d->readSettings(); + d->updateContext(); - emit m_coreImpl->coreAboutToOpen(); + emit d->m_coreImpl->coreAboutToOpen(); // Delay restoreWindowState, since it is overridden by LayoutRequest event - QMetaObject::invokeMethod(this, &MainWindow::restoreWindowState, Qt::QueuedConnection); - QMetaObject::invokeMethod(m_coreImpl, &ICore::coreOpened, Qt::QueuedConnection); + QMetaObject::invokeMethod(d, &MainWindowPrivate::restoreWindowState, Qt::QueuedConnection); + QMetaObject::invokeMethod(d->m_coreImpl, &ICore::coreOpened, Qt::QueuedConnection); } static void setRestart(bool restart) @@ -335,8 +444,8 @@ void MainWindow::restart() void MainWindow::restartTrimmer() { - if (HostOsInfo::isLinuxHost() && !m_trimTimer.isActive()) - m_trimTimer.start(); + if (HostOsInfo::isLinuxHost() && !d->m_trimTimer.isActive()) + d->m_trimTimer.start(); } void MainWindow::closeEvent(QCloseEvent *event) @@ -372,7 +481,7 @@ void MainWindow::closeEvent(QCloseEvent *event) return; } - const QList<std::function<bool()>> listeners = m_preCloseListeners; + const QList<std::function<bool()>> listeners = d->m_preCloseListeners; for (const std::function<bool()> &listener : listeners) { if (!listener()) { cancelClose(); @@ -380,12 +489,12 @@ void MainWindow::closeEvent(QCloseEvent *event) } } - emit m_coreImpl->coreAboutToClose(); + emit d->m_coreImpl->coreAboutToClose(); - saveWindowSettings(); + d->saveWindowSettings(); - m_leftNavigationWidget->closeSubWidgets(); - m_rightNavigationWidget->closeSubWidgets(); + d->m_leftNavigationWidget->closeSubWidgets(); + d->m_rightNavigationWidget->closeSubWidgets(); event->accept(); alreadyClosed = true; @@ -403,34 +512,34 @@ void MainWindow::mousePressEvent(QMouseEvent *event) AppMainWindow::mousePressEvent(event); } -void MainWindow::openDroppedFiles(const QList<DropSupport::FileSpec> &files) +void MainWindowPrivate::openDroppedFiles(const QList<DropSupport::FileSpec> &files) { - raiseWindow(); + q->raiseWindow(); const FilePaths filePaths = Utils::transform(files, &DropSupport::FileSpec::filePath); - openFiles(filePaths, ICore::SwitchMode); + q->openFiles(filePaths, ICore::SwitchMode); } IContext *MainWindow::currentContextObject() const { - return m_activeContext.isEmpty() ? nullptr : m_activeContext.first(); + return d->m_activeContext.isEmpty() ? nullptr : d->m_activeContext.first(); } QStatusBar *MainWindow::statusBar() const { - return m_modeStack->statusBar(); + return d->m_modeStack->statusBar(); } InfoBar *MainWindow::infoBar() const { - return m_modeStack->infoBar(); + return d->m_modeStack->infoBar(); } -void MainWindow::registerDefaultContainers() +void MainWindowPrivate::registerDefaultContainers() { ActionContainer *menubar = ActionManager::createMenuBar(Constants::MENU_BAR); if (!HostOsInfo::isMacHost()) // System menu bar on Mac - setMenuBar(menubar->menuBar()); + q->setMenuBar(menubar->menuBar()); menubar->appendGroup(Constants::G_FILE); menubar->appendGroup(Constants::G_EDIT); menubar->appendGroup(Constants::G_VIEW); @@ -451,7 +560,7 @@ void MainWindow::registerDefaultContainers() filemenu->appendGroup(Constants::G_FILE_CLOSE); filemenu->appendGroup(Constants::G_FILE_PRINT); filemenu->appendGroup(Constants::G_FILE_OTHER); - connect(filemenu->menu(), &QMenu::aboutToShow, this, &MainWindow::aboutToShowRecentFiles); + connect(filemenu->menu(), &QMenu::aboutToShow, this, &MainWindowPrivate::aboutToShowRecentFiles); // Edit Menu @@ -515,7 +624,7 @@ static QMenuBar *globalMenuBar() return ActionManager::actionContainer(Constants::MENU_BAR)->menuBar(); } -void MainWindow::registerDefaultActions() +void MainWindowPrivate::registerDefaultActions() { ActionContainer *mfile = ActionManager::actionContainer(Constants::M_FILE); ActionContainer *medit = ActionManager::actionContainer(Constants::M_EDIT); @@ -541,7 +650,7 @@ void MainWindow::registerDefaultActions() m_focusToEditor = new QAction(Tr::tr("Return to Editor"), this); Command *cmd = ActionManager::registerAction(m_focusToEditor, Constants::S_RETURNTOEDITOR); cmd->setDefaultKeySequence(QKeySequence(Qt::Key_Escape)); - connect(m_focusToEditor, &QAction::triggered, this, &MainWindow::setFocusToEditor); + connect(m_focusToEditor, &QAction::triggered, this, &MainWindowPrivate::setFocusToEditor); // New File Action QIcon icon = Icon::fromTheme("document-new"); @@ -585,7 +694,7 @@ void MainWindow::registerDefaultActions() cmd = ActionManager::registerAction(m_openAction, Constants::OPEN); cmd->setDefaultKeySequence(QKeySequence::Open); mfile->addAction(cmd, Constants::G_FILE_OPEN); - connect(m_openAction, &QAction::triggered, this, &MainWindow::openFile); + connect(m_openAction, &QAction::triggered, this, &MainWindowPrivate::openFile); // Open With Action m_openWithAction = new QAction(Tr::tr("Open File &With..."), this); @@ -598,7 +707,7 @@ void MainWindow::registerDefaultActions() m_openFromDeviceAction = new QAction(Tr::tr("Open From Device..."), this); cmd = ActionManager::registerAction(m_openFromDeviceAction, Constants::OPEN_FROM_DEVICE); mfile->addAction(cmd, Constants::G_FILE_OPEN); - connect(m_openFromDeviceAction, &QAction::triggered, this, &MainWindow::openFileFromDevice); + connect(m_openFromDeviceAction, &QAction::triggered, this, &MainWindowPrivate::openFileFromDevice); } // File->Recent Files Menu @@ -645,7 +754,7 @@ void MainWindow::registerDefaultActions() cmd = ActionManager::registerAction(m_exitAction, Constants::EXIT); cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Q"))); mfile->addAction(cmd, Constants::G_FILE_OTHER); - connect(m_exitAction, &QAction::triggered, this, &MainWindow::exit); + connect(m_exitAction, &QAction::triggered, q, &MainWindow::exit); // Undo Action icon = Icon::fromTheme("edit-undo"); @@ -872,7 +981,7 @@ void MainWindow::registerDefaultActions() cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_QTCREATOR); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); tmpaction->setEnabled(true); - connect(tmpaction, &QAction::triggered, this, &MainWindow::aboutQtCreator); + connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::aboutQtCreator); //About Plugins Action tmpaction = new QAction(Tr::tr("About &Plugins..."), this); @@ -880,7 +989,7 @@ void MainWindow::registerDefaultActions() cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_PLUGINS); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); tmpaction->setEnabled(true); - connect(tmpaction, &QAction::triggered, this, &MainWindow::aboutPlugins); + connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::aboutPlugins); // About Qt Action // tmpaction = new QAction(Tr::tr("About &Qt..."), this); // cmd = ActionManager::registerAction(tmpaction, Constants:: ABOUT_QT); @@ -894,14 +1003,14 @@ void MainWindow::registerDefaultActions() cmd = ActionManager::registerAction(tmpaction, Constants::CHANGE_LOG); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); tmpaction->setEnabled(true); - connect(tmpaction, &QAction::triggered, this, &MainWindow::changeLog); + connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::changeLog); // Contact tmpaction = new QAction(Tr::tr("Contact..."), this); cmd = ActionManager::registerAction(tmpaction, "QtCreator.Contact"); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); tmpaction->setEnabled(true); - connect(tmpaction, &QAction::triggered, this, &MainWindow::contact); + connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::contact); // About sep if (!HostOsInfo::isMacHost()) { // doesn't have the "About" actions in the Help menu @@ -912,7 +1021,7 @@ void MainWindow::registerDefaultActions() } } -void MainWindow::registerModeSelectorStyleActions() +void MainWindowPrivate::registerModeSelectorStyleActions() { ActionContainer *mview = ActionManager::actionContainer(Constants::M_VIEW); @@ -948,7 +1057,7 @@ void MainWindow::registerModeSelectorStyleActions() styleMenu->addActions(stylesGroup->actions()); } -void MainWindow::openFile() +void MainWindowPrivate::openFile() { openFiles(EditorManager::getOpenFilePaths(), ICore::SwitchMode); } @@ -981,6 +1090,13 @@ static IDocumentFactory *findDocumentFactory(const QList<IDocumentFactory*> &fil IDocument *MainWindow::openFiles(const FilePaths &filePaths, ICore::OpenFilesFlags flags, const FilePath &workingDirectory) +{ + return MainWindowPrivate::openFiles(filePaths, flags, workingDirectory); +} + +IDocument *MainWindowPrivate::openFiles(const FilePaths &filePaths, + ICore::OpenFilesFlags flags, + const FilePath &workingDirectory) { const QList<IDocumentFactory*> documentFactories = IDocumentFactory::allDocumentFactories(); IDocument *res = nullptr; @@ -1027,7 +1143,7 @@ IDocument *MainWindow::openFiles(const FilePaths &filePaths, return res; } -void MainWindow::setFocusToEditor() +void MainWindowPrivate::setFocusToEditor() { EditorManagerPrivate::doEscapeKeyFocusMoveMagic(); } @@ -1079,15 +1195,15 @@ void MainWindow::openFileWith() } } -void MainWindow::openFileFromDevice() +void MainWindowPrivate::openFileFromDevice() { openFiles(EditorManager::getOpenFilePaths(QFileDialog::DontUseNativeDialog), ICore::SwitchMode); } IContext *MainWindow::contextObject(QWidget *widget) const { - const auto it = m_contextWidgets.find(widget); - return it == m_contextWidgets.end() ? nullptr : it->second; + const auto it = d->m_contextWidgets.find(widget); + return it == d->m_contextWidgets.end() ? nullptr : it->second; } void MainWindow::addContextObject(IContext *context) @@ -1095,10 +1211,10 @@ void MainWindow::addContextObject(IContext *context) if (!context) return; QWidget *widget = context->widget(); - if (m_contextWidgets.find(widget) != m_contextWidgets.end()) + if (d->m_contextWidgets.find(widget) != d->m_contextWidgets.end()) return; - m_contextWidgets.insert({widget, context}); + d->m_contextWidgets.insert({widget, context}); connect(context, &QObject::destroyed, this, [this, context] { removeContextObject(context); }); } @@ -1109,20 +1225,20 @@ void MainWindow::removeContextObject(IContext *context) disconnect(context, &QObject::destroyed, this, nullptr); - const auto it = std::find_if(m_contextWidgets.cbegin(), - m_contextWidgets.cend(), + const auto it = std::find_if(d->m_contextWidgets.cbegin(), + d->m_contextWidgets.cend(), [context](const std::pair<QWidget *, IContext *> &v) { return v.second == context; }); - if (it == m_contextWidgets.cend()) + if (it == d->m_contextWidgets.cend()) return; - m_contextWidgets.erase(it); - if (m_activeContext.removeAll(context) > 0) - updateContextObject(m_activeContext); + d->m_contextWidgets.erase(it); + if (d->m_activeContext.removeAll(context) > 0) + d->updateContextObject(d->m_activeContext); } -void MainWindow::updateFocusWidget(QWidget *old, QWidget *now) +void MainWindowPrivate::updateFocusWidget(QWidget *old, QWidget *now) { Q_UNUSED(old) @@ -1134,7 +1250,7 @@ void MainWindow::updateFocusWidget(QWidget *old, QWidget *now) if (QWidget *p = QApplication::focusWidget()) { IContext *context = nullptr; while (p) { - context = contextObject(p); + context = q->contextObject(p); if (context) newContext.append(context); p = p->parentWidget(); @@ -1142,11 +1258,11 @@ void MainWindow::updateFocusWidget(QWidget *old, QWidget *now) } // ignore toplevels that define no context, like popups without parent - if (!newContext.isEmpty() || QApplication::focusWidget() == focusWidget()) + if (!newContext.isEmpty() || QApplication::focusWidget() == q->focusWidget()) updateContextObject(newContext); } -void MainWindow::updateContextObject(const QList<IContext *> &context) +void MainWindowPrivate::updateContextObject(const QList<IContext *> &context) { emit m_coreImpl->contextAboutToChange(context); m_activeContext = context; @@ -1160,14 +1276,14 @@ void MainWindow::updateContextObject(const QList<IContext *> &context) void MainWindow::aboutToShutdown() { - disconnect(qApp, &QApplication::focusChanged, this, &MainWindow::updateFocusWidget); - for (auto contextPair : m_contextWidgets) + disconnect(qApp, &QApplication::focusChanged, d, &MainWindowPrivate::updateFocusWidget); + for (auto contextPair : d->m_contextWidgets) disconnect(contextPair.second, &QObject::destroyed, this, nullptr); - m_activeContext.clear(); + d->m_activeContext.clear(); hide(); } -void MainWindow::readSettings() +void MainWindowPrivate::readSettings() { QtcSettings *settings = PluginManager::settings(); settings->beginGroup(QLatin1String(settingsGroup)); @@ -1217,7 +1333,7 @@ void MainWindow::saveSettings() QtcSettings *settings = PluginManager::settings(); settings->beginGroup(QLatin1String(settingsGroup)); - if (!(m_overrideColor.isValid() && StyleHelper::baseColor() == m_overrideColor)) + if (!(d->m_overrideColor.isValid() && StyleHelper::baseColor() == d->m_overrideColor)) settings->setValueWithDefault(colorKey, StyleHelper::requestedBaseColor(), QColor(StyleHelper::DEFAULT_BASE_COLOR)); @@ -1230,8 +1346,8 @@ void MainWindow::saveSettings() DocumentManager::saveSettings(); ActionManager::saveSettings(); EditorManagerPrivate::saveSettings(); - m_leftNavigationWidget->saveSettings(settings); - m_rightNavigationWidget->saveSettings(settings); + d->m_leftNavigationWidget->saveSettings(settings); + d->m_rightNavigationWidget->saveSettings(settings); // TODO Remove some time after Qt Creator 11 // Work around Qt Creator <= 10 writing the default terminal to the settings. @@ -1242,7 +1358,7 @@ void MainWindow::saveSettings() TerminalCommand::setTerminalEmulator(TerminalCommand::terminalEmulator()); } -void MainWindow::saveWindowSettings() +void MainWindowPrivate::saveWindowSettings() { QtcSettings *settings = PluginManager::settings(); settings->beginGroup(settingsGroup); @@ -1251,16 +1367,16 @@ void MainWindow::saveWindowSettings() // To be able to restore the correct non-full screen geometry, we have to put // the window out of full screen before saving the geometry. // Works around QTBUG-45241 - if (Utils::HostOsInfo::isMacHost() && isFullScreen()) - setWindowState(windowState() & ~Qt::WindowFullScreen); - settings->setValue(windowGeometryKey, saveGeometry()); - settings->setValue(windowStateKey, saveState()); + if (Utils::HostOsInfo::isMacHost() && q->isFullScreen()) + q->setWindowState(q->windowState() & ~Qt::WindowFullScreen); + settings->setValue(windowGeometryKey, q->saveGeometry()); + settings->setValue(windowStateKey, q->saveState()); settings->setValue(modeSelectorLayoutKey, int(ModeManager::modeStyle())); settings->endGroup(); } -void MainWindow::updateModeSelectorStyleMenu() +void MainWindowPrivate::updateModeSelectorStyleMenu() { switch (ModeManager::modeStyle()) { case ModeManager::Style::IconsAndText: @@ -1281,27 +1397,27 @@ void MainWindow::updateAdditionalContexts(const Context &remove, const Context & for (const Id id : remove) { if (!id.isValid()) continue; - int index = m_lowPrioAdditionalContexts.indexOf(id); + int index = d->m_lowPrioAdditionalContexts.indexOf(id); if (index != -1) - m_lowPrioAdditionalContexts.removeAt(index); - index = m_highPrioAdditionalContexts.indexOf(id); + d->m_lowPrioAdditionalContexts.removeAt(index); + index = d->m_highPrioAdditionalContexts.indexOf(id); if (index != -1) - m_highPrioAdditionalContexts.removeAt(index); + d->m_highPrioAdditionalContexts.removeAt(index); } for (const Id id : add) { if (!id.isValid()) continue; - Context &cref = (priority == ICore::ContextPriority::High ? m_highPrioAdditionalContexts - : m_lowPrioAdditionalContexts); + Context &cref = (priority == ICore::ContextPriority::High ? d->m_highPrioAdditionalContexts + : d->m_lowPrioAdditionalContexts); if (!cref.contains(id)) cref.prepend(id); } - updateContext(); + d->updateContext(); } -void MainWindow::updateContext() +void MainWindowPrivate::updateContext() { Context contexts = m_highPrioAdditionalContexts; @@ -1320,7 +1436,7 @@ void MainWindow::updateContext() emit m_coreImpl->contextChanged(uniquecontexts); } -void MainWindow::aboutToShowRecentFiles() +void MainWindowPrivate::aboutToShowRecentFiles() { ActionContainer *aci = ActionManager::actionContainer(Constants::M_FILE_RECENTFILES); QMenu *menu = aci->menu(); @@ -1350,12 +1466,12 @@ void MainWindow::aboutToShowRecentFiles() } } -void MainWindow::aboutQtCreator() +void MainWindowPrivate::aboutQtCreator() { if (!m_versionDialog) { - m_versionDialog = new VersionDialog(this); + m_versionDialog = new VersionDialog(q); connect(m_versionDialog, &QDialog::finished, - this, &MainWindow::destroyVersionDialog); + this, &MainWindowPrivate::destroyVersionDialog); ICore::registerWindow(m_versionDialog, Context("Core.VersionDialog")); m_versionDialog->show(); } else { @@ -1363,7 +1479,7 @@ void MainWindow::aboutQtCreator() } } -void MainWindow::destroyVersionDialog() +void MainWindowPrivate::destroyVersionDialog() { if (m_versionDialog) { m_versionDialog->deleteLater(); @@ -1371,9 +1487,9 @@ void MainWindow::destroyVersionDialog() } } -void MainWindow::aboutPlugins() +void MainWindowPrivate::aboutPlugins() { - PluginDialog dialog(this); + PluginDialog dialog(q); dialog.exec(); } @@ -1396,7 +1512,7 @@ public: } }; -void MainWindow::changeLog() +void MainWindowPrivate::changeLog() { static QPointer<LogDialog> dialog; if (dialog) { @@ -1497,7 +1613,7 @@ void MainWindow::changeLog() dialog->show(); } -void MainWindow::contact() +void MainWindowPrivate::contact() { QMessageBox dlg(QMessageBox::Information, Tr::tr("Contact"), Tr::tr("<p>Qt Creator developers can be reached at the Qt Creator mailing list:</p>" @@ -1520,27 +1636,27 @@ void MainWindow::contact() .arg("<a href=\"https://pastebin.com\">" "https://pastebin.com" "</a>"), - QMessageBox::Ok, this); + QMessageBox::Ok, q); dlg.exec(); } QPrinter *MainWindow::printer() const { - if (!m_printer) - m_printer = new QPrinter(QPrinter::HighResolution); - return m_printer; + if (!d->m_printer) + d->m_printer = new QPrinter(QPrinter::HighResolution); + return d->m_printer; } -void MainWindow::restoreWindowState() +void MainWindowPrivate::restoreWindowState() { NANOTRACE_SCOPE("Core", "MainWindow::restoreWindowState"); QtcSettings *settings = PluginManager::settings(); settings->beginGroup(settingsGroup); - if (!restoreGeometry(settings->value(windowGeometryKey).toByteArray())) - resize(1260, 700); // size without window decoration - restoreState(settings->value(windowStateKey).toByteArray()); + if (!q->restoreGeometry(settings->value(windowGeometryKey).toByteArray())) + q->resize(1260, 700); // size without window decoration + q->restoreState(settings->value(windowStateKey).toByteArray()); settings->endGroup(); - show(); + q->show(); StatusBarManager::restoreSettings(); } diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index 1a1fc8e11cc..c1cb685e072 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -7,48 +7,23 @@ #include "icore.h" #include <utils/appmainwindow.h> -#include <utils/dropsupport.h> - -#include <QColor> -#include <QTimer> #include <functional> -#include <unordered_map> QT_BEGIN_NAMESPACE +class QColor; class QPrinter; -class QToolButton; QT_END_NAMESPACE -namespace Utils { -class InfoBar; -} +namespace Utils { class InfoBar; } namespace Core { -class EditorManager; -class ExternalToolManager; class IDocument; -class JsExpander; -class MessageManager; -class ModeManager; -class ProgressManager; -class NavigationWidget; -enum class Side; -class RightPaneWidget; -class VcsManager; namespace Internal { -class FancyTabWidget; -class GeneralSettings; -class ProgressManagerPrivate; -class ShortcutSettings; -class ToolSettings; -class MimeTypeSettings; -class VersionDialog; -class WindowSupport; -class SystemEditor; +class MainWindowPrivate; class MainWindow : public Utils::AppMainWindow { @@ -70,8 +45,8 @@ public: ICore::OpenFilesFlags flags, const Utils::FilePath &workingDirectory = {}); - virtual QPrinter *printer() const; - IContext * currentContextObject() const; + QPrinter *printer() const; + IContext *currentContextObject() const; QStatusBar *statusBar() const; Utils::InfoBar *infoBar() const; @@ -90,98 +65,18 @@ public: void restart(); - void openFileFromDevice(); - void restartTrimmer(); public slots: static void openFileWith(); void exit(); -protected: +private: void closeEvent(QCloseEvent *event) override; void keyPressEvent(QKeyEvent *event) override; void mousePressEvent(QMouseEvent *event) override; -private: - static void openFile(); - void aboutToShowRecentFiles(); - static void setFocusToEditor(); - void aboutQtCreator(); - void aboutPlugins(); - void changeLog(); - void contact(); - void updateFocusWidget(QWidget *old, QWidget *now); - NavigationWidget *navigationWidget(Side side) const; - void setSidebarVisible(bool visible, Side side); - void destroyVersionDialog(); - void openDroppedFiles(const QList<Utils::DropSupport::FileSpec> &files); - void restoreWindowState(); - - void updateContextObject(const QList<IContext *> &context); - void updateContext(); - - void registerDefaultContainers(); - void registerDefaultActions(); - void registerModeSelectorStyleActions(); - - void readSettings(); - void saveWindowSettings(); - - void updateModeSelectorStyleMenu(); - - ICore *m_coreImpl = nullptr; - QTimer m_trimTimer; - QStringList m_aboutInformation; - Context m_highPrioAdditionalContexts; - Context m_lowPrioAdditionalContexts; - mutable QPrinter *m_printer = nullptr; - WindowSupport *m_windowSupport = nullptr; - EditorManager *m_editorManager = nullptr; - ExternalToolManager *m_externalToolManager = nullptr; - MessageManager *m_messageManager = nullptr; - ProgressManagerPrivate *m_progressManager = nullptr; - JsExpander *m_jsExpander = nullptr; - VcsManager *m_vcsManager = nullptr; - ModeManager *m_modeManager = nullptr; - FancyTabWidget *m_modeStack = nullptr; - NavigationWidget *m_leftNavigationWidget = nullptr; - NavigationWidget *m_rightNavigationWidget = nullptr; - RightPaneWidget *m_rightPaneWidget = nullptr; - VersionDialog *m_versionDialog = nullptr; - - QList<IContext *> m_activeContext; - - std::unordered_map<QWidget *, IContext *> m_contextWidgets; - - ShortcutSettings *m_shortcutSettings = nullptr; - ToolSettings *m_toolSettings = nullptr; - MimeTypeSettings *m_mimeTypeSettings = nullptr; - SystemEditor *m_systemEditor = nullptr; - - // actions - QAction *m_focusToEditor = nullptr; - QAction *m_newAction = nullptr; - QAction *m_openAction = nullptr; - QAction *m_openWithAction = nullptr; - QAction *m_openFromDeviceAction = nullptr; - QAction *m_saveAllAction = nullptr; - QAction *m_exitAction = nullptr; - QAction *m_optionsAction = nullptr; - QAction *m_loggerAction = nullptr; - QAction *m_toggleLeftSideBarAction = nullptr; - QAction *m_toggleRightSideBarAction = nullptr; - QAction *m_toggleMenubarAction = nullptr; - QAction *m_cycleModeSelectorStyleAction = nullptr; - QAction *m_setModeSelectorStyleIconsAndTextAction = nullptr; - QAction *m_setModeSelectorStyleHiddenAction = nullptr; - QAction *m_setModeSelectorStyleIconsOnlyAction = nullptr; - QAction *m_themeAction = nullptr; - - QToolButton *m_toggleLeftSideBarButton = nullptr; - QToolButton *m_toggleRightSideBarButton = nullptr; - QColor m_overrideColor; - QList<std::function<bool()>> m_preCloseListeners; + MainWindowPrivate *d = nullptr; }; } // namespace Internal diff --git a/src/plugins/coreplugin/messagemanager.h b/src/plugins/coreplugin/messagemanager.h index 1cd1950145b..147fe386af5 100644 --- a/src/plugins/coreplugin/messagemanager.h +++ b/src/plugins/coreplugin/messagemanager.h @@ -4,7 +4,6 @@ #pragma once #include "core_global.h" -#include "ioutputpane.h" #include <QMetaType> #include <QObject> @@ -15,7 +14,10 @@ QT_END_NAMESPACE namespace Core { -namespace Internal { class MainWindow; } +namespace Internal { +class MainWindow; +class MainWindowPrivate; +} class CORE_EXPORT MessageManager : public QObject { @@ -41,6 +43,7 @@ private: static void init(); friend class Core::Internal::MainWindow; + friend class Core::Internal::MainWindowPrivate; }; } // namespace Core diff --git a/src/plugins/coreplugin/modemanager.h b/src/plugins/coreplugin/modemanager.h index 5e90edb16bc..72427590194 100644 --- a/src/plugins/coreplugin/modemanager.h +++ b/src/plugins/coreplugin/modemanager.h @@ -18,8 +18,9 @@ namespace Core { class IMode; namespace Internal { - class MainWindow; - class FancyTabWidget; +class MainWindow; +class MainWindowPrivate; +class FancyTabWidget; } class CORE_EXPORT ModeManager : public QObject @@ -69,6 +70,7 @@ private: friend class IMode; friend class Core::Internal::MainWindow; + friend class Core::Internal::MainWindowPrivate; }; } // namespace Core diff --git a/src/plugins/coreplugin/outputpanemanager.h b/src/plugins/coreplugin/outputpanemanager.h index 49b161f35fc..a2224e9ae49 100644 --- a/src/plugins/coreplugin/outputpanemanager.h +++ b/src/plugins/coreplugin/outputpanemanager.h @@ -18,6 +18,7 @@ namespace Core { namespace Internal { class MainWindow; +class MainWindowPrivate; class OutputPaneToggleButton; class OutputPaneManageButton; @@ -45,6 +46,7 @@ protected: private: // the only class that is allowed to create and destroy friend class MainWindow; + friend class MainWindowPrivate; friend class OutputPaneManageButton; static void create(); diff --git a/src/plugins/coreplugin/vcsmanager.h b/src/plugins/coreplugin/vcsmanager.h index 0afaf05ff61..aa51809f7d5 100644 --- a/src/plugins/coreplugin/vcsmanager.h +++ b/src/plugins/coreplugin/vcsmanager.h @@ -15,7 +15,7 @@ namespace Core { class IVersionControl; -namespace Internal { class MainWindow; } +namespace Internal { class MainWindowPrivate; } /* VcsManager: * 1) Provides functionality for finding the IVersionControl * for a given @@ -87,7 +87,7 @@ private: void handleConfigurationChanges(IVersionControl *vc); static void addVersionControl(IVersionControl *vc); - friend class Core::Internal::MainWindow; + friend class Core::Internal::MainWindowPrivate; friend class Core::IVersionControl; }; From c4c76c86424e6cc3e390e67b5c333f76a5d4970e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 22 Sep 2023 17:58:42 +0200 Subject: [PATCH 1257/1777] CVS: Disable by default It's very likely not /that/ common anymore that everyone needs it by default. Change-Id: I516d612cc587df6b7184f15eafff213274b8f32e Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/cvs/CVS.json.in | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/cvs/CVS.json.in b/src/plugins/cvs/CVS.json.in index 6691722b0ae..6d2f92ea78a 100644 --- a/src/plugins/cvs/CVS.json.in +++ b/src/plugins/cvs/CVS.json.in @@ -14,6 +14,7 @@ ], "Category" : "Version Control", "Description" : "CVS integration.", + "DisabledByDefault" : true, "Url" : "http://www.qt.io", ${IDE_PLUGIN_DEPENDENCIES}, From b68bdbafce3398c75656658eeade856f548f5a5c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 4 Sep 2023 18:22:12 +0200 Subject: [PATCH 1258/1777] ProjectExplorer: Remove ClangToolChain as class of its own Change-Id: I92109855503d8696666a17f6e992bd5ca20cbf68 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/android/androidtoolchain.cpp | 6 ++--- src/plugins/android/androidtoolchain.h | 2 +- src/plugins/ios/iosconfigurations.cpp | 27 ++++++++++---------- src/plugins/projectexplorer/gcctoolchain.cpp | 19 +++++--------- src/plugins/projectexplorer/gcctoolchain.h | 11 -------- 5 files changed, 24 insertions(+), 41 deletions(-) diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index 0323267daa0..b472498a806 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -47,7 +47,7 @@ static ToolChain *findToolChain(FilePath &compilerPath, Id lang, const QString & } AndroidToolChain::AndroidToolChain() - : ClangToolChain(Constants::ANDROID_TOOLCHAIN_TYPEID) + : GccToolChain(Constants::ANDROID_TOOLCHAIN_TYPEID, Clang) { setTypeDisplayName(Tr::tr("Android Clang")); } @@ -80,7 +80,7 @@ bool AndroidToolChain::isValid() const const bool isChildofSdk = compilerCommand().isChildOf( AndroidConfigurations::currentConfig().sdkLocation()); - return ClangToolChain::isValid() && typeId() == Constants::ANDROID_TOOLCHAIN_TYPEID + return GccToolChain::isValid() && typeId() == Constants::ANDROID_TOOLCHAIN_TYPEID && targetAbi().isValid() && (isChildofNdk || isChildofSdk) && !originalTargetTriple().isEmpty(); } @@ -103,7 +103,7 @@ void AndroidToolChain::addToEnvironment(Environment &env) const void AndroidToolChain::fromMap(const Store &data) { - ClangToolChain::fromMap(data); + GccToolChain::fromMap(data); if (hasError()) return; if (!isValid()) diff --git a/src/plugins/android/androidtoolchain.h b/src/plugins/android/androidtoolchain.h index 5bc66c0119b..bd33dc75704 100644 --- a/src/plugins/android/androidtoolchain.h +++ b/src/plugins/android/androidtoolchain.h @@ -12,7 +12,7 @@ namespace Internal { using ToolChainList = QList<ProjectExplorer::ToolChain *>; -class AndroidToolChain : public ProjectExplorer::ClangToolChain +class AndroidToolChain : public ProjectExplorer::GccToolChain { public: ~AndroidToolChain() override; diff --git a/src/plugins/ios/iosconfigurations.cpp b/src/plugins/ios/iosconfigurations.cpp index a2dcdf2f940..545cf85bc8f 100644 --- a/src/plugins/ios/iosconfigurations.cpp +++ b/src/plugins/ios/iosconfigurations.cpp @@ -58,7 +58,7 @@ static Q_LOGGING_CATEGORY(kitSetupLog, "qtc.ios.kitSetup", QtWarningMsg) static Q_LOGGING_CATEGORY(iosCommonLog, "qtc.ios.common", QtWarningMsg) } -using ToolChainPair = std::pair<ClangToolChain *, ClangToolChain *>; +using ToolChainPair = std::pair<GccToolChain *, GccToolChain *>; namespace Ios { namespace Internal { @@ -95,19 +95,19 @@ static bool isSimulatorDeviceId(const Id &id) return id == Constants::IOS_SIMULATOR_TYPE; } -static QList<ClangToolChain *> clangToolChains(const Toolchains &toolChains) +static QList<GccToolChain *> clangToolChains(const Toolchains &toolChains) { - QList<ClangToolChain *> clangToolChains; + QList<GccToolChain *> clangToolChains; for (ToolChain *toolChain : toolChains) if (toolChain->typeId() == ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID) - clangToolChains.append(static_cast<ClangToolChain *>(toolChain)); + clangToolChains.append(static_cast<GccToolChain *>(toolChain)); return clangToolChains; } -static QList<ClangToolChain *> autoDetectedIosToolChains() +static QList<GccToolChain *> autoDetectedIosToolChains() { - const QList<ClangToolChain *> toolChains = clangToolChains(ToolChainManager::toolchains()); - return filtered(toolChains, [](ClangToolChain *toolChain) { + const QList<GccToolChain *> toolChains = clangToolChains(ToolChainManager::toolchains()); + return filtered(toolChains, [](GccToolChain *toolChain) { return toolChain->isAutoDetected() && (toolChain->displayName().startsWith("iphone") || toolChain->displayName().startsWith("Apple Clang")); // TODO tool chains should be marked directly @@ -116,10 +116,10 @@ static QList<ClangToolChain *> autoDetectedIosToolChains() static ToolChainPair findToolChainForPlatform(const XcodePlatform &platform, const XcodePlatform::ToolchainTarget &target, - const QList<ClangToolChain *> &toolChains) + const QList<GccToolChain *> &toolChains) { ToolChainPair platformToolChains; - auto toolchainMatch = [](ClangToolChain *toolChain, const FilePath &compilerPath, const QStringList &flags) { + auto toolchainMatch = [](GccToolChain *toolChain, const FilePath &compilerPath, const QStringList &flags) { return compilerPath == toolChain->compilerCommand() && flags == toolChain->platformCodeGenFlags() && flags == toolChain->platformLinkerFlags(); @@ -136,7 +136,7 @@ static ToolChainPair findToolChainForPlatform(const XcodePlatform &platform, static QHash<XcodePlatform::ToolchainTarget, ToolChainPair> findToolChains(const QList<XcodePlatform> &platforms) { QHash<XcodePlatform::ToolchainTarget, ToolChainPair> platformToolChainHash; - const QList<ClangToolChain *> toolChains = autoDetectedIosToolChains(); + const QList<GccToolChain *> toolChains = autoDetectedIosToolChains(); for (const XcodePlatform &platform : platforms) { for (const XcodePlatform::ToolchainTarget &target : platform.targets) { ToolChainPair platformToolchains = findToolChainForPlatform(platform, target, @@ -577,7 +577,7 @@ Toolchains IosToolChainFactory::autoDetect(const ToolchainDetector &detector) co if (detector.device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) return {}; - QList<ClangToolChain *> existingClangToolChains = clangToolChains(detector.alreadyKnown); + QList<GccToolChain *> existingClangToolChains = clangToolChains(detector.alreadyKnown); const QList<XcodePlatform> platforms = XcodeProbe::detectPlatforms().values(); Toolchains toolChains; toolChains.reserve(platforms.size()); @@ -585,9 +585,10 @@ Toolchains IosToolChainFactory::autoDetect(const ToolchainDetector &detector) co for (const XcodePlatform::ToolchainTarget &target : platform.targets) { ToolChainPair platformToolchains = findToolChainForPlatform(platform, target, existingClangToolChains); - auto createOrAdd = [&](ClangToolChain *toolChain, Id l) { + auto createOrAdd = [&](GccToolChain *toolChain, Id l) { if (!toolChain) { - toolChain = new ClangToolChain; + toolChain = new GccToolChain(ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID, + GccToolChain::Clang); toolChain->setPriority(ToolChain::PriorityHigh); toolChain->setDetection(ToolChain::AutoDetection); toolChain->setLanguage(l); diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 96a55122a81..71716ee3f14 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1656,15 +1656,6 @@ void GccToolChain::syncAutodetectedWithParentToolchains() }); } -ClangToolChain::ClangToolChain() : - ClangToolChain(Constants::CLANG_TOOLCHAIN_TYPEID) -{} - -ClangToolChain::ClangToolChain(Utils::Id typeId) : - GccToolChain(typeId, GccToolChain::Clang) -{ -} - bool GccToolChain::matchesCompilerCommand(const FilePath &command) const { if (m_subType == Clang) { @@ -1707,7 +1698,9 @@ ClangToolChainFactory::ClangToolChainFactory() setDisplayName(Tr::tr("Clang")); setSupportedToolChainType(Constants::CLANG_TOOLCHAIN_TYPEID); setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID}); - setToolchainConstructor([] { return new ClangToolChain; }); + setToolchainConstructor([] { + return new GccToolChain(Constants::CLANG_TOOLCHAIN_TYPEID, GccToolChain::Clang); + }); } Toolchains ClangToolChainFactory::autoDetect(const ToolchainDetector &detector) const @@ -1805,7 +1798,7 @@ ClangToolChainConfigWidget::ClangToolChainConfigWidget(GccToolChain *tc) : void ClangToolChainConfigWidget::updateParentToolChainComboBox() { - auto *tc = static_cast<ClangToolChain *>(toolChain()); + auto *tc = static_cast<GccToolChain *>(toolChain()); QByteArray parentId = m_parentToolchainCombo->currentData().toByteArray(); if (tc->isAutoDetected() || m_parentToolchainCombo->count() == 0) parentId = tc->m_parentToolChainId; @@ -1842,7 +1835,7 @@ void ClangToolChainConfigWidget::applyImpl() if (!m_parentToolchainCombo) return; - auto *tc = static_cast<ClangToolChain *>(toolChain()); + auto *tc = static_cast<GccToolChain *>(toolChain()); tc->m_parentToolChainId.clear(); const QByteArray parentId = m_parentToolchainCombo->currentData().toByteArray(); @@ -1866,7 +1859,7 @@ bool ClangToolChainConfigWidget::isDirtyImpl() const if (!m_parentToolchainCombo) return false; - auto tc = static_cast<ClangToolChain *>(toolChain()); + auto tc = static_cast<GccToolChain *>(toolChain()); Q_ASSERT(tc); const MingwToolChain *parentTC = mingwToolChainFromId(tc->m_parentToolChainId); const QByteArray parentId = parentTC ? parentTC->id() : QByteArray(); diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 554ccc78fd5..3f43bc62ad5 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -199,17 +199,6 @@ private: QMetaObject::Connection m_thisToolchainRemovedConnection; }; -// -------------------------------------------------------------------------- -// ClangToolChain -// -------------------------------------------------------------------------- - -class PROJECTEXPLORER_EXPORT ClangToolChain : public GccToolChain -{ -public: - ClangToolChain(); - explicit ClangToolChain(Utils::Id typeId); -}; - // -------------------------------------------------------------------------- // MingwToolChain // -------------------------------------------------------------------------- From cb2f24569ac8aa6a08758783a0b75c068a62542d Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 25 Sep 2023 13:18:18 +0200 Subject: [PATCH 1259/1777] QmakeProjectManager: Fix QmakeProjectImporter Presumably broke with e1d5e7c01f440e9554d0b0bec13e220608769c58. Change-Id: I9d05b552e68b8ea10b50501841d65578d51652f2 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp index 85316c7b772..9a9450a218f 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp @@ -72,7 +72,7 @@ FilePaths QmakeProjectImporter::importCandidates() (projectFilePath(), k, QString(), BuildConfiguration::Unknown); const FilePath baseDir = sbdir.absolutePath(); - for (const FilePath &path : baseDir.dirEntries(QDir::Filters())) { + for (const FilePath &path : baseDir.dirEntries(QDir::Dirs | QDir::NoDotAndDotDot)) { if (path.fileName().startsWith(prefix) && !candidates.contains(path)) candidates << path; } From 6e9568cb3460952090c60d7fe203cada863febef Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 5 Sep 2023 08:44:57 +0200 Subject: [PATCH 1260/1777] ProjectExplorer: Merge ClangToolChainConfigWidget into GccTCCW Change-Id: I002356b886015e6a07c13700168c45056279b4f3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 203 ++++++++----------- src/plugins/projectexplorer/gcctoolchain.h | 4 +- 2 files changed, 84 insertions(+), 123 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 71716ee3f14..f0a7e60f430 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -50,12 +50,10 @@ namespace Internal { class TargetTripleWidget; class GccToolChainConfigWidget : public ToolChainConfigWidget { - Q_OBJECT - public: explicit GccToolChainConfigWidget(GccToolChain *tc); -protected: +private: void handleCompilerCommandChange(); void handlePlatformCodeGenFlagsChange(); void handlePlatformLinkerFlagsChange(); @@ -67,32 +65,21 @@ protected: void setFromToolchain(); + void updateParentToolChainComboBox(); // Clang + AbiWidget *m_abiWidget; -private: - Utils::PathChooser *m_compilerCommand; + GccToolChain::SubType m_subType = GccToolChain::RealGcc; + + PathChooser *m_compilerCommand; QLineEdit *m_platformCodeGenFlagsLineEdit; QLineEdit *m_platformLinkerFlagsLineEdit; TargetTripleWidget * const m_targetTripleWidget; bool m_isReadOnly = false; ProjectExplorer::Macros m_macros; -}; -class ClangToolChainConfigWidget : public GccToolChainConfigWidget -{ - Q_OBJECT -public: - explicit ClangToolChainConfigWidget(GccToolChain *tc); - -private: - void applyImpl() override; - void discardImpl() override { setFromClangToolchain(); } - bool isDirtyImpl() const override; - void makeReadOnlyImpl() override; - - void setFromClangToolchain(); - void updateParentToolChainComboBox(); + // Clang only QList<QMetaObject::Connection> m_parentToolChainConnections; QComboBox *m_parentToolchainCombo = nullptr; }; @@ -970,9 +957,6 @@ bool GccToolChain::operator ==(const ToolChain &other) const std::unique_ptr<ToolChainConfigWidget> GccToolChain::createConfigurationWidget() { - if (m_subType == Clang) - return std::make_unique<ClangToolChainConfigWidget>(this); - return std::make_unique<GccToolChainConfigWidget>(this); } @@ -1442,11 +1426,10 @@ private: GccToolChainConfigWidget::GccToolChainConfigWidget(GccToolChain *tc) : ToolChainConfigWidget(tc), m_abiWidget(new AbiWidget), + m_subType(tc->m_subType), m_compilerCommand(new PathChooser), m_targetTripleWidget(new TargetTripleWidget(tc)) { - Q_ASSERT(tc); - const QStringList gnuVersionArgs = QStringList("--version"); m_compilerCommand->setExpectedKind(PathChooser::ExistingCommand); m_compilerCommand->setCommandVersionArguments(gnuVersionArgs); @@ -1476,6 +1459,44 @@ GccToolChainConfigWidget::GccToolChainConfigWidget(GccToolChain *tc) : connect(m_abiWidget, &AbiWidget::abiChanged, this, &ToolChainConfigWidget::dirty); connect(m_targetTripleWidget, &TargetTripleWidget::valueChanged, this, &ToolChainConfigWidget::dirty); + + if (m_subType == GccToolChain::Clang) { + if (!HostOsInfo::isWindowsHost() || tc->typeId() != Constants::CLANG_TOOLCHAIN_TYPEID) + return; + + // Remove m_abiWidget row because the parent toolchain abi is going to be used. + m_mainLayout->removeRow(m_mainLayout->rowCount() - 3); // FIXME: Do something sane instead. + m_abiWidget = nullptr; + + m_parentToolchainCombo = new QComboBox(this); + m_mainLayout->insertRow(m_mainLayout->rowCount() - 1, + Tr::tr("Parent toolchain:"), + m_parentToolchainCombo); + + ToolChainManager *tcManager = ToolChainManager::instance(); + m_parentToolChainConnections.append( + connect(tcManager, &ToolChainManager::toolChainUpdated, this, [this](ToolChain *tc) { + if (tc->typeId() == Constants::MINGW_TOOLCHAIN_TYPEID) + updateParentToolChainComboBox(); + })); + m_parentToolChainConnections.append( + connect(tcManager, &ToolChainManager::toolChainAdded, this, [this](ToolChain *tc) { + if (tc->typeId() == Constants::MINGW_TOOLCHAIN_TYPEID) + updateParentToolChainComboBox(); + })); + m_parentToolChainConnections.append( + connect(tcManager, &ToolChainManager::toolChainRemoved, this, [this](ToolChain *tc) { + if (tc->id() == toolChain()->id()) { + for (QMetaObject::Connection &connection : m_parentToolChainConnections) + QObject::disconnect(connection); + return; + } + if (tc->typeId() == Constants::MINGW_TOOLCHAIN_TYPEID) + updateParentToolChainComboBox(); + })); + + updateParentToolChainComboBox(); + } } void GccToolChainConfigWidget::applyImpl() @@ -1506,6 +1527,23 @@ void GccToolChainConfigWidget::applyImpl() ToolChain::MacroInspectionReport{m_macros, ToolChain::languageVersion(tc->language(), m_macros)}); + + if (m_subType == GccToolChain::Clang && m_parentToolchainCombo) { + + tc->m_parentToolChainId.clear(); + + const QByteArray parentId = m_parentToolchainCombo->currentData().toByteArray(); + if (!parentId.isEmpty()) { + for (const ToolChain *mingwTC : mingwToolChains()) { + if (parentId == mingwTC->id()) { + tc->m_parentToolChainId = mingwTC->id(); + tc->setTargetAbi(mingwTC->targetAbi()); + tc->setSupportedAbis(mingwTC->supportedAbis()); + break; + } + } + } + } } void GccToolChainConfigWidget::setFromToolchain() @@ -1523,20 +1561,32 @@ void GccToolChainConfigWidget::setFromToolchain() if (!m_isReadOnly && !m_compilerCommand->filePath().toString().isEmpty()) m_abiWidget->setEnabled(true); } + + if (m_parentToolchainCombo) + updateParentToolChainComboBox(); } bool GccToolChainConfigWidget::isDirtyImpl() const { auto tc = static_cast<GccToolChain *>(toolChain()); - Q_ASSERT(tc); - return m_compilerCommand->filePath() != tc->compilerCommand() + + if (m_compilerCommand->filePath() != tc->compilerCommand() || m_platformCodeGenFlagsLineEdit->text() != ProcessArgs::joinArgs(tc->platformCodeGenFlags()) || m_platformLinkerFlagsLineEdit->text() != ProcessArgs::joinArgs(tc->platformLinkerFlags()) || m_targetTripleWidget->explicitCodeModelTargetTriple() != tc->explicitCodeModelTargetTriple() - || (m_abiWidget && m_abiWidget->currentAbi() != tc->targetAbi()); + || (m_abiWidget && m_abiWidget->currentAbi() != tc->targetAbi())) { + return true; + } + + if (!m_parentToolchainCombo) + return false; + + const MingwToolChain *parentTC = mingwToolChainFromId(tc->m_parentToolChainId); + const QByteArray parentId = parentTC ? parentTC->id() : QByteArray(); + return parentId != m_parentToolchainCombo->currentData(); } void GccToolChainConfigWidget::makeReadOnlyImpl() @@ -1548,6 +1598,9 @@ void GccToolChainConfigWidget::makeReadOnlyImpl() m_platformLinkerFlagsLineEdit->setEnabled(false); m_targetTripleWidget->setEnabled(false); m_isReadOnly = true; + + if (m_parentToolchainCombo) + m_parentToolchainCombo->setEnabled(false); } void GccToolChainConfigWidget::handleCompilerCommandChange() @@ -1756,48 +1809,10 @@ Toolchains ClangToolChainFactory::detectForImport(const ToolChainDescription &tc return {}; } -ClangToolChainConfigWidget::ClangToolChainConfigWidget(GccToolChain *tc) : - GccToolChainConfigWidget(tc) +void GccToolChainConfigWidget::updateParentToolChainComboBox() { - if (!HostOsInfo::isWindowsHost() || tc->typeId() != Constants::CLANG_TOOLCHAIN_TYPEID) - return; + QTC_ASSERT(m_parentToolchainCombo, return); - // Remove m_abiWidget row because the parent toolchain abi is going to be used. - m_mainLayout->removeRow(m_mainLayout->rowCount() - 3); // FIXME: Do something sane instead. - m_abiWidget = nullptr; - - m_parentToolchainCombo = new QComboBox(this); - m_mainLayout->insertRow(m_mainLayout->rowCount() - 1, - Tr::tr("Parent toolchain:"), - m_parentToolchainCombo); - - ToolChainManager *tcManager = ToolChainManager::instance(); - m_parentToolChainConnections.append( - connect(tcManager, &ToolChainManager::toolChainUpdated, this, [this](ToolChain *tc) { - if (tc->typeId() == Constants::MINGW_TOOLCHAIN_TYPEID) - updateParentToolChainComboBox(); - })); - m_parentToolChainConnections.append( - connect(tcManager, &ToolChainManager::toolChainAdded, this, [this](ToolChain *tc) { - if (tc->typeId() == Constants::MINGW_TOOLCHAIN_TYPEID) - updateParentToolChainComboBox(); - })); - m_parentToolChainConnections.append( - connect(tcManager, &ToolChainManager::toolChainRemoved, this, [this](ToolChain *tc) { - if (tc->id() == toolChain()->id()) { - for (QMetaObject::Connection &connection : m_parentToolChainConnections) - QObject::disconnect(connection); - return; - } - if (tc->typeId() == Constants::MINGW_TOOLCHAIN_TYPEID) - updateParentToolChainComboBox(); - })); - - setFromClangToolchain(); -} - -void ClangToolChainConfigWidget::updateParentToolChainComboBox() -{ auto *tc = static_cast<GccToolChain *>(toolChain()); QByteArray parentId = m_parentToolchainCombo->currentData().toByteArray(); if (tc->isAutoDetected() || m_parentToolchainCombo->count() == 0) @@ -1821,58 +1836,6 @@ void ClangToolChainConfigWidget::updateParentToolChainComboBox() } } -void ClangToolChainConfigWidget::setFromClangToolchain() -{ - GccToolChainConfigWidget::setFromToolchain(); - - if (m_parentToolchainCombo) - updateParentToolChainComboBox(); -} - -void ClangToolChainConfigWidget::applyImpl() -{ - GccToolChainConfigWidget::applyImpl(); - if (!m_parentToolchainCombo) - return; - - auto *tc = static_cast<GccToolChain *>(toolChain()); - tc->m_parentToolChainId.clear(); - - const QByteArray parentId = m_parentToolchainCombo->currentData().toByteArray(); - if (!parentId.isEmpty()) { - for (const ToolChain *mingwTC : mingwToolChains()) { - if (parentId == mingwTC->id()) { - tc->m_parentToolChainId = mingwTC->id(); - tc->setTargetAbi(mingwTC->targetAbi()); - tc->setSupportedAbis(mingwTC->supportedAbis()); - break; - } - } - } -} - -bool ClangToolChainConfigWidget::isDirtyImpl() const -{ - if (GccToolChainConfigWidget::isDirtyImpl()) - return true; - - if (!m_parentToolchainCombo) - return false; - - auto tc = static_cast<GccToolChain *>(toolChain()); - Q_ASSERT(tc); - const MingwToolChain *parentTC = mingwToolChainFromId(tc->m_parentToolChainId); - const QByteArray parentId = parentTC ? parentTC->id() : QByteArray(); - return parentId != m_parentToolchainCombo->currentData(); -} - -void ClangToolChainConfigWidget::makeReadOnlyImpl() -{ - GccToolChainConfigWidget::makeReadOnlyImpl(); - if (m_parentToolchainCombo) - m_parentToolchainCombo->setEnabled(false); -} - // -------------------------------------------------------------------------- // MingwToolChain // -------------------------------------------------------------------------- diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 3f43bc62ad5..4daf7a9d354 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -20,7 +20,6 @@ namespace ProjectExplorer { namespace Internal { class ClangToolChainFactory; -class ClangToolChainConfigWidget; class GccToolChainConfigWidget; class GccToolChainFactory; class MingwToolChainFactory; @@ -186,9 +185,8 @@ private: friend class Internal::GccToolChainConfigWidget; friend class Internal::GccToolChainFactory; - friend class ToolChainFactory; friend class Internal::ClangToolChainFactory; - friend class Internal::ClangToolChainConfigWidget; + friend class ToolChainFactory; // "resolved" on macOS from /usr/bin/clang(++) etc to <DeveloperDir>/usr/bin/clang(++) // which is used for comparison with matchesCompilerCommand From f71c89d44aecdb1b599dba9948cbfbe14c7fcb2e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 5 Sep 2023 09:00:48 +0200 Subject: [PATCH 1261/1777] ProjectExplorer: Merge MingwToolChain into GccToolChain Change-Id: I8f817aa69d54b58d9a0b865c1e081559fcf9799e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 60 ++++++++------------ src/plugins/projectexplorer/gcctoolchain.h | 21 +------ 2 files changed, 26 insertions(+), 55 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index f0a7e60f430..694b9586ee3 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -296,7 +296,9 @@ GccToolChain::GccToolChain(Utils::Id typeId, SubType subType) setTypeDisplayName(Tr::tr("GCC")); setTargetAbiKey(targetAbiKeyC); setCompilerCommandKey("ProjectExplorer.GccToolChain.Path"); - if (m_subType == Clang) { + if (m_subType == MinGW) { + setTypeDisplayName(Tr::tr("MinGW")); + } else if (m_subType == Clang) { setTypeDisplayName(Tr::tr("Clang")); syncAutodetectedWithParentToolchains(); } @@ -366,14 +368,14 @@ static const Toolchains mingwToolChains() }); } -static const MingwToolChain *mingwToolChainFromId(const QByteArray &id) +static const GccToolChain *mingwToolChainFromId(const QByteArray &id) { if (id.isEmpty()) return nullptr; for (const ToolChain *tc : mingwToolChains()) { if (tc->id() == id) - return static_cast<const MingwToolChain *>(tc); + return static_cast<const GccToolChain *>(tc); } return nullptr; @@ -382,7 +384,7 @@ static const MingwToolChain *mingwToolChainFromId(const QByteArray &id) QString GccToolChain::originalTargetTriple() const { if (m_subType == Clang) { - if (const MingwToolChain *parentTC = mingwToolChainFromId(m_parentToolChainId)) + if (const GccToolChain *parentTC = mingwToolChainFromId(m_parentToolChainId)) return parentTC->originalTargetTriple(); } @@ -761,6 +763,17 @@ void GccToolChain::addToEnvironment(Environment &env) const QStringList GccToolChain::suggestedMkspecList() const { + if (m_subType == MinGW) { + if (HostOsInfo::isWindowsHost()) + return {"win32-g++"}; + if (HostOsInfo::isLinuxHost()) { + if (version().startsWith("4.6.")) + return {"win32-g++-4.6-cross", "unsupported/win32-g++-4.6-cross"}; + return {"win32-g++-cross", "unsupported/win32-g++-cross"}; + } + return {}; + } + if (m_subType == Clang) { if (const ToolChain * const parentTc = ToolChainManager::findToolChain(m_parentToolChainId)) return parentTc->suggestedMkspecList(); @@ -828,7 +841,7 @@ static FilePath mingwAwareMakeCommand(const Environment &environment) FilePath GccToolChain::makeCommand(const Environment &environment) const { - if (m_subType == Clang) + if (m_subType == Clang || m_subType == MinGW) return mingwAwareMakeCommand(environment); const FilePath tmp = environment.searchInPath("make"); @@ -1584,7 +1597,7 @@ bool GccToolChainConfigWidget::isDirtyImpl() const if (!m_parentToolchainCombo) return false; - const MingwToolChain *parentTC = mingwToolChainFromId(tc->m_parentToolChainId); + const GccToolChain *parentTC = mingwToolChainFromId(tc->m_parentToolChainId); const QByteArray parentId = parentTC ? parentTC->id() : QByteArray(); return parentId != m_parentToolchainCombo->currentData(); } @@ -1734,7 +1747,7 @@ bool GccToolChain::matchesCompilerCommand(const FilePath &command) const QString GccToolChain::sysRoot() const { if (m_subType == Clang) { - if (const MingwToolChain *parentTC = mingwToolChainFromId(m_parentToolChainId)) { + if (const GccToolChain *parentTC = mingwToolChainFromId(m_parentToolChainId)) { const FilePath mingwCompiler = parentTC->compilerCommand(); return mingwCompiler.parentDir().parentDir().toString(); } @@ -1818,7 +1831,7 @@ void GccToolChainConfigWidget::updateParentToolChainComboBox() if (tc->isAutoDetected() || m_parentToolchainCombo->count() == 0) parentId = tc->m_parentToolChainId; - const MingwToolChain *parentTC = mingwToolChainFromId(parentId); + const GccToolChain *parentTC = mingwToolChainFromId(parentId); m_parentToolchainCombo->clear(); m_parentToolchainCombo->addItem(parentTC ? parentTC->displayName() : QString(), @@ -1836,33 +1849,6 @@ void GccToolChainConfigWidget::updateParentToolChainComboBox() } } -// -------------------------------------------------------------------------- -// MingwToolChain -// -------------------------------------------------------------------------- - -MingwToolChain::MingwToolChain() : - GccToolChain(Constants::MINGW_TOOLCHAIN_TYPEID) -{ - setTypeDisplayName(Tr::tr("MinGW")); -} - -QStringList MingwToolChain::suggestedMkspecList() const -{ - if (HostOsInfo::isWindowsHost()) - return {"win32-g++"}; - if (HostOsInfo::isLinuxHost()) { - if (version().startsWith("4.6.")) - return {"win32-g++-4.6-cross", "unsupported/win32-g++-4.6-cross"}; - return {"win32-g++-cross", "unsupported/win32-g++-cross"}; - } - return {}; -} - -FilePath MingwToolChain::makeCommand(const Environment &environment) const -{ - return mingwAwareMakeCommand(environment); -} - // -------------------------------------------------------------------------- // MingwToolChainFactory // -------------------------------------------------------------------------- @@ -1872,7 +1858,9 @@ MingwToolChainFactory::MingwToolChainFactory() setDisplayName(Tr::tr("MinGW")); setSupportedToolChainType(Constants::MINGW_TOOLCHAIN_TYPEID); setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID}); - setToolchainConstructor([] { return new MingwToolChain; }); + setToolchainConstructor([] { + return new GccToolChain(Constants::MINGW_TOOLCHAIN_TYPEID, GccToolChain::MinGW); + }); } Toolchains MingwToolChainFactory::autoDetect(const ToolchainDetector &detector) const diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 4daf7a9d354..2282a9bc740 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -45,7 +45,7 @@ inline const QStringList gccPredefinedMacrosOptions(Utils::Id languageId) class PROJECTEXPLORER_EXPORT GccToolChain : public ToolChain { public: - enum SubType { RealGcc, Clang }; + enum SubType { RealGcc, Clang, MinGW }; GccToolChain(Utils::Id typeId, SubType subType = RealGcc); ~GccToolChain() override; @@ -185,6 +185,7 @@ private: friend class Internal::GccToolChainConfigWidget; friend class Internal::GccToolChainFactory; + friend class Internal::MingwToolChainFactory; friend class Internal::ClangToolChainFactory; friend class ToolChainFactory; @@ -197,24 +198,6 @@ private: QMetaObject::Connection m_thisToolchainRemovedConnection; }; -// -------------------------------------------------------------------------- -// MingwToolChain -// -------------------------------------------------------------------------- - -class PROJECTEXPLORER_EXPORT MingwToolChain : public GccToolChain -{ -public: - Utils::FilePath makeCommand(const Utils::Environment &environment) const override; - - QStringList suggestedMkspecList() const override; - -private: - MingwToolChain(); - - friend class Internal::MingwToolChainFactory; - friend class ToolChainFactory; -}; - // -------------------------------------------------------------------------- // LinuxIccToolChain // -------------------------------------------------------------------------- From 90050c05f3b14a93e26a3e731a18c74b43edb212 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 5 Sep 2023 09:55:42 +0200 Subject: [PATCH 1262/1777] ProjectExplorer: Merge LinuxIccToolChain into GccToolChain Change-Id: I181a98f534c6f3006f750f99190b2f81a3f5a13b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 85 ++++++++++---------- src/plugins/projectexplorer/gcctoolchain.h | 37 +-------- 2 files changed, 45 insertions(+), 77 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 694b9586ee3..bfe5e9621a6 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -47,6 +47,18 @@ using namespace Utils; namespace ProjectExplorer { namespace Internal { +static const QStringList languageOption(Id languageId) +{ + if (languageId == Constants::C_LANGUAGE_ID) + return {"-x", "c"}; + return {"-x", "c++"}; +} + +const QStringList gccPredefinedMacrosOptions(Id languageId) +{ + return languageOption(languageId) + QStringList({"-E", "-dM"}); +} + class TargetTripleWidget; class GccToolChainConfigWidget : public ToolChainConfigWidget { @@ -296,7 +308,9 @@ GccToolChain::GccToolChain(Utils::Id typeId, SubType subType) setTypeDisplayName(Tr::tr("GCC")); setTargetAbiKey(targetAbiKeyC); setCompilerCommandKey("ProjectExplorer.GccToolChain.Path"); - if (m_subType == MinGW) { + if (m_subType == LinuxIcc) { + setTypeDisplayName(Tr::tr("ICC")); + } else if (m_subType == MinGW) { setTypeDisplayName(Tr::tr("MinGW")); } else if (m_subType == Clang) { setTypeDisplayName(Tr::tr("Clang")); @@ -551,6 +565,23 @@ LanguageExtensions GccToolChain::languageExtensions(const QStringList &cxxflags) if (m_subType == Clang && cxxflags.contains("-fborland-extensions")) extensions |= LanguageExtension::Borland; + if (m_subType == LinuxIcc) { + // and "-fms-dialect[=ver]" instead of "-fms-extensions". + // see UNIX manual for "icc" + // FIXME: This copy seems unneeded. + QStringList copy = cxxflags; + copy.removeAll("-fopenmp"); + copy.removeAll("-fms-extensions"); + + if (cxxflags.contains("-openmp")) + extensions |= LanguageExtension::OpenMP; + if (cxxflags.contains("-fms-dialect") + || cxxflags.contains("-fms-dialect=8") + || cxxflags.contains("-fms-dialect=9") + || cxxflags.contains("-fms-dialect=10")) + extensions |= LanguageExtension::Microsoft; + } + return extensions; } @@ -763,6 +794,9 @@ void GccToolChain::addToEnvironment(Environment &env) const QStringList GccToolChain::suggestedMkspecList() const { + if (m_subType == LinuxIcc) + return {QString("linux-icc-%1").arg(targetAbi().wordWidth())}; + if (m_subType == MinGW) { if (HostOsInfo::isWindowsHost()) return {"win32-g++"}; @@ -850,6 +884,9 @@ FilePath GccToolChain::makeCommand(const Environment &environment) const QList<OutputLineParser *> GccToolChain::createOutputParsers() const { + if (m_subType == LinuxIcc) + return LinuxIccParser::iccParserSuite(); + if (m_subType == Clang) return ClangParser::clangParserSuite(); @@ -1906,48 +1943,6 @@ Toolchains MingwToolChainFactory::detectForImport(const ToolChainDescription &tc return {}; } -// -------------------------------------------------------------------------- -// LinuxIccToolChain -// -------------------------------------------------------------------------- - -LinuxIccToolChain::LinuxIccToolChain() : - GccToolChain(Constants::LINUXICC_TOOLCHAIN_TYPEID) -{ - setTypeDisplayName(Tr::tr("ICC")); -} - -/** - * Similar to \a GccToolchain::languageExtensions, but uses "-openmp" instead of - * "-fopenmp" and "-fms-dialect[=ver]" instead of "-fms-extensions". - * @see UNIX manual for "icc" - */ -LanguageExtensions LinuxIccToolChain::languageExtensions(const QStringList &cxxflags) const -{ - QStringList copy = cxxflags; - copy.removeAll("-fopenmp"); - copy.removeAll("-fms-extensions"); - - LanguageExtensions extensions = GccToolChain::languageExtensions(cxxflags); - if (cxxflags.contains("-openmp")) - extensions |= LanguageExtension::OpenMP; - if (cxxflags.contains("-fms-dialect") - || cxxflags.contains("-fms-dialect=8") - || cxxflags.contains("-fms-dialect=9") - || cxxflags.contains("-fms-dialect=10")) - extensions |= LanguageExtension::Microsoft; - return extensions; -} - -QList<OutputLineParser *> LinuxIccToolChain::createOutputParsers() const -{ - return LinuxIccParser::iccParserSuite(); -} - -QStringList LinuxIccToolChain::suggestedMkspecList() const -{ - return {QString("linux-icc-%1").arg(targetAbi().wordWidth())}; -} - // -------------------------------------------------------------------------- // LinuxIccToolChainFactory // -------------------------------------------------------------------------- @@ -1957,7 +1952,9 @@ LinuxIccToolChainFactory::LinuxIccToolChainFactory() setDisplayName(Tr::tr("ICC")); setSupportedToolChainType(Constants::LINUXICC_TOOLCHAIN_TYPEID); setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID}); - setToolchainConstructor([] { return new LinuxIccToolChain; }); + setToolchainConstructor([] { + return new GccToolChain(Constants::LINUXICC_TOOLCHAIN_TYPEID, GccToolChain::LinuxIcc); + }); } Toolchains LinuxIccToolChainFactory::autoDetect(const ToolchainDetector &detector) const diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 2282a9bc740..9607f0a8ef8 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -10,8 +10,6 @@ #include "abi.h" #include "headerpath.h" -#include <utils/fileutils.h> - #include <functional> #include <memory> #include <optional> @@ -24,28 +22,19 @@ class GccToolChainConfigWidget; class GccToolChainFactory; class MingwToolChainFactory; class LinuxIccToolChainFactory; + +const QStringList gccPredefinedMacrosOptions(Utils::Id languageId); } // -------------------------------------------------------------------------- // GccToolChain // -------------------------------------------------------------------------- -inline const QStringList languageOption(Utils::Id languageId) -{ - if (languageId == Constants::C_LANGUAGE_ID) - return {"-x", "c"}; - return {"-x", "c++"}; -} - -inline const QStringList gccPredefinedMacrosOptions(Utils::Id languageId) -{ - return languageOption(languageId) + QStringList({"-E", "-dM"}); -} class PROJECTEXPLORER_EXPORT GccToolChain : public ToolChain { public: - enum SubType { RealGcc, Clang, MinGW }; + enum SubType { RealGcc, Clang, MinGW, LinuxIcc }; GccToolChain(Utils::Id typeId, SubType subType = RealGcc); ~GccToolChain() override; @@ -185,6 +174,7 @@ private: friend class Internal::GccToolChainConfigWidget; friend class Internal::GccToolChainFactory; + friend class Internal::LinuxIccToolChainFactory; friend class Internal::MingwToolChainFactory; friend class Internal::ClangToolChainFactory; friend class ToolChainFactory; @@ -198,25 +188,6 @@ private: QMetaObject::Connection m_thisToolchainRemovedConnection; }; -// -------------------------------------------------------------------------- -// LinuxIccToolChain -// -------------------------------------------------------------------------- - -class PROJECTEXPLORER_EXPORT LinuxIccToolChain : public GccToolChain -{ -public: - Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const override; - QList<Utils::OutputLineParser *> createOutputParsers() const override; - - QStringList suggestedMkspecList() const override; - -private: - LinuxIccToolChain(); - - friend class Internal::LinuxIccToolChainFactory; - friend class ToolChainFactory; -}; - // -------------------------------------------------------------------------- // Factories // -------------------------------------------------------------------------- From a8f6df546c83124031d9f7d0b7fcfe4505c0122f Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 25 Sep 2023 11:23:30 +0200 Subject: [PATCH 1263/1777] ExtensionSystem: Restrict export of privates to building with tests Change-Id: Ie75fbd38770c832aab443c977b8f5c34094d17c7 Reviewed-by: hjk <hjk@qt.io> --- src/libs/extensionsystem/extensionsystem_global.h | 12 ++++++++++++ src/libs/extensionsystem/pluginmanager_p.h | 2 +- src/libs/extensionsystem/pluginspec_p.h | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/libs/extensionsystem/extensionsystem_global.h b/src/libs/extensionsystem/extensionsystem_global.h index 85fa8de831c..13c82e75d5c 100644 --- a/src/libs/extensionsystem/extensionsystem_global.h +++ b/src/libs/extensionsystem/extensionsystem_global.h @@ -14,4 +14,16 @@ # define EXTENSIONSYSTEM_EXPORT Q_DECL_IMPORT #endif +#if defined(WITH_TESTS) +# if defined(EXTENSIONSYSTEM_LIBRARY) +# define EXTENSIONSYSTEM_TEST_EXPORT Q_DECL_EXPORT +# elif defined(EXTENSIONSYSTEM_STATIC_LIBRARY) +# define EXTENSIONSYSTEM_TEST_EXPORT +# else +# define EXTENSIONSYSTEM_TEST_EXPORT Q_DECL_IMPORT +# endif +#else +# define QTSUPPORT_TEST_EXPORT +#endif + Q_DECLARE_LOGGING_CATEGORY(pluginLog) diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index 4b9a34b246d..5845684b862 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -38,7 +38,7 @@ namespace Internal { class PluginSpecPrivate; -class EXTENSIONSYSTEM_EXPORT PluginManagerPrivate : public QObject +class EXTENSIONSYSTEM_TEST_EXPORT PluginManagerPrivate : public QObject { Q_OBJECT public: diff --git a/src/libs/extensionsystem/pluginspec_p.h b/src/libs/extensionsystem/pluginspec_p.h index c87111f02ae..f802902e53c 100644 --- a/src/libs/extensionsystem/pluginspec_p.h +++ b/src/libs/extensionsystem/pluginspec_p.h @@ -22,7 +22,7 @@ class IPlugin; namespace Internal { -class EXTENSIONSYSTEM_EXPORT PluginSpecPrivate : public QObject +class EXTENSIONSYSTEM_TEST_EXPORT PluginSpecPrivate : public QObject { Q_OBJECT From 05614ab7402623eb0a69ae7d0301044f70f93e91 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 22 Sep 2023 22:47:31 +0200 Subject: [PATCH 1264/1777] CMakePM: Display help details for code completion The first 1024 bytes from the CMake .rst files are displayed raw data. A .rst to html or markdown would be needed for nicer user experience. Change-Id: Ie6adbb404d844ae88b868b465d4125c2177e6cfe Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 4 +- .../cmakefilecompletionassist.cpp | 32 +++++ src/plugins/cmakeprojectmanager/cmaketool.cpp | 118 ++++++++---------- src/plugins/cmakeprojectmanager/cmaketool.h | 22 ++-- 4 files changed, 95 insertions(+), 81 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index d8bb9155856..ecfbd3769aa 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1278,9 +1278,9 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() m_cmakeSymbolsHash.insert(QString::fromUtf8(arg.Value), link); if (func.LowerCaseName() == "option") - m_projectKeywords.variables << QString::fromUtf8(arg.Value); + m_projectKeywords.variables[QString::fromUtf8(arg.Value)] = FilePath(); else - m_projectKeywords.functions << QString::fromUtf8(arg.Value); + m_projectKeywords.functions[QString::fromUtf8(arg.Value)] = FilePath(); } } } diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 5319eb37509..a2ba8b3a604 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -153,6 +153,38 @@ QList<AssistProposalItemInterface *> generateList(const T &words, const QIcon &i }); } +QString readFirstParagraphs(const QString &element, const FilePath &helpFile) +{ + auto content = helpFile.fileContents(1024).value_or(QByteArray()); + return QString("```\n%1\n```").arg(QString::fromUtf8(content.left(content.lastIndexOf("\n")))); +} + +QList<AssistProposalItemInterface *> generateList(const QMap<QString, FilePath> &words, + const QIcon &icon) +{ + static QMap<FilePath, QString> map; + struct MarkDownAssitProposalItem : public AssistProposalItem + { + Qt::TextFormat detailFormat() const { return Qt::MarkdownText; } + }; + + QList<AssistProposalItemInterface *> list; + for (const auto &[text, helpFile] : words.asKeyValueRange()) { + MarkDownAssitProposalItem *item = new MarkDownAssitProposalItem(); + item->setText(text); + + if (!helpFile.isEmpty()) { + if (!map.contains(helpFile)) + map[helpFile] = readFirstParagraphs(text, helpFile); + item->setDetail(map.value(helpFile)); + } + + item->setIcon(icon); + list << item; + }; + return list; +} + static int addFilePathItems(const AssistInterface *interface, QList<AssistProposalItemInterface *> &items, int symbolStartPos) diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 64fc5af5580..0e2e1c64bf0 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -89,19 +89,8 @@ public: bool m_didRun = true; QList<CMakeTool::Generator> m_generators; - QMap<QString, QStringList> m_functionArgs; + CMakeKeywords m_keywords; QVector<FileApi> m_fileApis; - QStringList m_variables; - QStringList m_functions; - QStringList m_properties; - QStringList m_generatorExpressions; - QStringList m_directoryProperties; - QStringList m_sourceProperties; - QStringList m_targetProperties; - QStringList m_testProperties; - QStringList m_includeStandardModules; - QStringList m_findModules; - QStringList m_policies; CMakeTool::Version m_version; }; @@ -260,7 +249,7 @@ CMakeKeywords CMakeTool::keywords() if (!isValid()) return {}; - if (m_introspection->m_functions.isEmpty() && m_introspection->m_didRun) { + if (m_introspection->m_keywords.functions.isEmpty() && m_introspection->m_didRun) { Process proc; const FilePath findCMakeRoot = TemporaryDirectory::masterDirectoryFilePath() @@ -279,61 +268,52 @@ CMakeKeywords CMakeTool::keywords() const struct { const QString helpPath; - QStringList &targetList; + QMap<QString, FilePath> &targetMap; } introspections[] = { // Functions - {"Help/command", m_introspection->m_functions}, + {"Help/command", m_introspection->m_keywords.functions}, // Properties - {"Help/prop_dir", m_introspection->m_directoryProperties}, - {"Help/prop_sf", m_introspection->m_sourceProperties}, - {"Help/prop_test", m_introspection->m_testProperties}, - {"Help/prop_tgt", m_introspection->m_targetProperties}, - {"Help/prop_gbl", m_introspection->m_properties}, + {"Help/prop_dir", m_introspection->m_keywords.directoryProperties}, + {"Help/prop_sf", m_introspection->m_keywords.sourceProperties}, + {"Help/prop_test", m_introspection->m_keywords.testProperties}, + {"Help/prop_tgt", m_introspection->m_keywords.targetProperties}, + {"Help/prop_gbl", m_introspection->m_keywords.properties}, // Variables - {"Help/variable", m_introspection->m_variables}, + {"Help/variable", m_introspection->m_keywords.variables}, // Policies - {"Help/policy", m_introspection->m_policies}, + {"Help/policy", m_introspection->m_keywords.policies}, }; for (auto &i : introspections) { const FilePaths files = cmakeRoot.pathAppended(i.helpPath) .dirEntries({{"*.rst"}, QDir::Files}, QDir::Name); - i.targetList = transform<QStringList>(files, &FilePath::completeBaseName); + for (const auto &filePath : files) + i.targetMap[filePath.completeBaseName()] = filePath; } - m_introspection->m_properties << m_introspection->m_directoryProperties; - m_introspection->m_properties << m_introspection->m_sourceProperties; - m_introspection->m_properties << m_introspection->m_testProperties; - m_introspection->m_properties << m_introspection->m_targetProperties; + for (const auto &map : {m_introspection->m_keywords.directoryProperties, + m_introspection->m_keywords.sourceProperties, + m_introspection->m_keywords.testProperties, + m_introspection->m_keywords.targetProperties}) { + m_introspection->m_keywords.properties.insert(map); + } // Modules const FilePaths files = cmakeRoot.pathAppended("Help/module").dirEntries({{"*.rst"}, QDir::Files}, QDir::Name); - const QStringList fileNames = transform<QStringList>(files, &FilePath::completeBaseName); - for (const QString &fileName : fileNames) { + for (const FilePath &filePath : files) { + const QString fileName = filePath.completeBaseName(); if (fileName.startsWith("Find")) - m_introspection->m_findModules << fileName.mid(4); + m_introspection->m_keywords.findModules[fileName.mid(4)] = filePath; else - m_introspection->m_includeStandardModules << fileName; + m_introspection->m_keywords.includeStandardModules[fileName] = filePath; } - parseSyntaxHighlightingXml(); + const QStringList moduleFunctions = parseSyntaxHighlightingXml(); + for (const auto &function : moduleFunctions) + m_introspection->m_keywords.functions[function] = FilePath(); } - CMakeKeywords keywords; - keywords.functions = Utils::toSet(m_introspection->m_functions); - keywords.variables = Utils::toSet(m_introspection->m_variables); - keywords.functionArgs = m_introspection->m_functionArgs; - keywords.properties = Utils::toSet(m_introspection->m_properties); - keywords.generatorExpressions = Utils::toSet(m_introspection->m_generatorExpressions); - keywords.directoryProperties = Utils::toSet(m_introspection->m_directoryProperties); - keywords.sourceProperties = Utils::toSet(m_introspection->m_sourceProperties); - keywords.targetProperties = Utils::toSet(m_introspection->m_targetProperties); - keywords.testProperties = Utils::toSet(m_introspection->m_testProperties); - keywords.includeStandardModules = Utils::toSet(m_introspection->m_includeStandardModules); - keywords.findModules = Utils::toSet(m_introspection->m_findModules); - keywords.policies = Utils::toSet(m_introspection->m_policies); - - return keywords; + return m_introspection->m_keywords; } bool CMakeTool::hasFileApi(bool ignoreCache) const @@ -495,8 +475,6 @@ static QStringList parseDefinition(const QString &definition) void CMakeTool::parseFunctionDetailsOutput(const QString &output) { - const QSet<QString> functionSet = Utils::toSet(m_introspection->m_functions); - bool expectDefinition = false; QString currentDefinition; @@ -515,14 +493,15 @@ void CMakeTool::parseFunctionDetailsOutput(const QString &output) QStringList words = parseDefinition(currentDefinition); if (!words.isEmpty()) { const QString command = words.takeFirst(); - if (functionSet.contains(command)) { + if (m_introspection->m_keywords.functions.contains(command)) { const QStringList tmp = Utils::sorted( - words + m_introspection->m_functionArgs[command]); - m_introspection->m_functionArgs[command] = Utils::filteredUnique(tmp); + words + m_introspection->m_keywords.functionArgs[command]); + m_introspection->m_keywords.functionArgs[command] = Utils::filteredUnique( + tmp); } } - if (!words.isEmpty() && functionSet.contains(words.at(0))) - m_introspection->m_functionArgs[words.at(0)]; + if (!words.isEmpty() && m_introspection->m_keywords.functions.contains(words.at(0))) + m_introspection->m_keywords.functionArgs[words.at(0)]; currentDefinition.clear(); } else { currentDefinition.append(line.trimmed() + ' '); @@ -560,9 +539,9 @@ QStringList CMakeTool::parseVariableOutput(const QString &output) return result; } -void CMakeTool::parseSyntaxHighlightingXml() +QStringList CMakeTool::parseSyntaxHighlightingXml() { - QSet<QString> functionSet = Utils::toSet(m_introspection->m_functions); + QStringList moduleFunctions; const FilePath cmakeXml = Core::ICore::resourcePath("generic-highlighter/syntax/cmake.xml"); QXmlStreamReader reader(cmakeXml.fileContents().value_or(QByteArray())); @@ -588,19 +567,19 @@ void CMakeTool::parseSyntaxHighlightingXml() const auto functionName = name.left(name.length() - 6); QStringList arguments = readItemList(reader); - if (m_introspection->m_functionArgs.contains(functionName)) - arguments.append(m_introspection->m_functionArgs.value(functionName)); + if (m_introspection->m_keywords.functionArgs.contains(functionName)) + arguments.append( + m_introspection->m_keywords.functionArgs.value(functionName)); - m_introspection->m_functionArgs[functionName] = arguments; + m_introspection->m_keywords.functionArgs[functionName] = arguments; // Functions that are part of CMake modules like ExternalProject_Add // which are not reported by cmake --help-list-commands - if (!functionSet.contains(functionName)) { - functionSet.insert(functionName); - m_introspection->m_functions.append(functionName); + if (!m_introspection->m_keywords.functions.contains(functionName)) { + moduleFunctions << functionName; } } else if (name == u"generator-expressions") { - m_introspection->m_generatorExpressions = readItemList(reader); + m_introspection->m_keywords.generatorExpressions = toSet(readItemList(reader)); } else { reader.skipCurrentElement(); } @@ -623,16 +602,19 @@ void CMakeTool::parseSyntaxHighlightingXml() {"set_target_properties", "set_directory_properties"}, {"set_tests_properties", "set_directory_properties"}}; for (const auto &pair : std::as_const(functionPairs)) { - if (!m_introspection->m_functionArgs.contains(pair.first)) - m_introspection->m_functionArgs[pair.first] = m_introspection->m_functionArgs.value( - pair.second); + if (!m_introspection->m_keywords.functionArgs.contains(pair.first)) + m_introspection->m_keywords.functionArgs[pair.first] + = m_introspection->m_keywords.functionArgs.value(pair.second); } // Special case for cmake_print_variables, which will print the names and values for variables // and needs to be as a known function const QString cmakePrintVariables("cmake_print_variables"); - m_introspection->m_functionArgs[cmakePrintVariables] = {}; - m_introspection->m_functions.append(cmakePrintVariables); + m_introspection->m_keywords.functionArgs[cmakePrintVariables] = {}; + moduleFunctions << cmakePrintVariables; + + moduleFunctions.removeDuplicates(); + return moduleFunctions; } void CMakeTool::fetchFromCapabilities(bool ignoreCache) const diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index 0ad9780971b..b72a926c768 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -21,17 +21,17 @@ namespace Internal { class IntrospectionData; } struct CMAKE_EXPORT CMakeKeywords { - QSet<QString> variables; - QSet<QString> functions; - QSet<QString> properties; + QMap<QString, Utils::FilePath> variables; + QMap<QString, Utils::FilePath> functions; + QMap<QString, Utils::FilePath> properties; QSet<QString> generatorExpressions; - QSet<QString> directoryProperties; - QSet<QString> sourceProperties; - QSet<QString> targetProperties; - QSet<QString> testProperties; - QSet<QString> includeStandardModules; - QSet<QString> findModules; - QSet<QString> policies; + QMap<QString, Utils::FilePath> directoryProperties; + QMap<QString, Utils::FilePath> sourceProperties; + QMap<QString, Utils::FilePath> targetProperties; + QMap<QString, Utils::FilePath> testProperties; + QMap<QString, Utils::FilePath> includeStandardModules; + QMap<QString, Utils::FilePath> findModules; + QMap<QString, Utils::FilePath> policies; QMap<QString, QStringList> functionArgs; }; @@ -117,7 +117,7 @@ private: void runCMake(Utils::Process &proc, const QStringList &args, int timeoutS = 1) const; void parseFunctionDetailsOutput(const QString &output); QStringList parseVariableOutput(const QString &output); - void parseSyntaxHighlightingXml(); + QStringList parseSyntaxHighlightingXml(); void fetchFromCapabilities(bool ignoreCache = false) const; void parseFromCapabilities(const QString &input) const; From cd94514dbb7471d5c338e9ed7c0baca7ccc772bd Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 18 Sep 2023 22:08:23 +0200 Subject: [PATCH 1265/1777] CMakePM: Add hover help for CMakeEditor Fixes: QTCREATORBUG-25780 Change-Id: I954023f701e6c1c6ca5e25190b37f8b9a8becfb5 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../cmakeprojectmanager/cmakeeditor.cpp | 84 +++++++++++++++++++ .../cmakefilecompletionassist.cpp | 20 +++-- 2 files changed, 95 insertions(+), 9 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 6ba35180c31..1f1e873be52 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -9,6 +9,7 @@ #include "cmakefilecompletionassist.h" #include "cmakeindenter.h" #include "cmakekitaspect.h" +#include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "3rdparty/cmake/cmListFileCache.h" @@ -19,11 +20,14 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildsystem.h> #include <projectexplorer/project.h> +#include <projectexplorer/projectmanager.h> #include <projectexplorer/projecttree.h> #include <projectexplorer/target.h> +#include <texteditor/basehoverhandler.h> #include <texteditor/textdocument.h> #include <texteditor/texteditoractionhandler.h> #include <utils/textutils.h> +#include <utils/tooltip/tooltip.h> #include <QTextDocument> @@ -31,6 +35,7 @@ using namespace Core; using namespace ProjectExplorer; +using namespace Utils; using namespace TextEditor; namespace CMakeProjectManager::Internal { @@ -308,6 +313,83 @@ static TextDocument *createCMakeDocument() return doc; } +// +// CMakeHoverHandler +// + +class CMakeHoverHandler : public TextEditor::BaseHoverHandler +{ + mutable CMakeKeywords m_keywords; + QString m_helpToolTip; + +public: + const CMakeKeywords &keywords() const; + + void identifyMatch(TextEditor::TextEditorWidget *editorWidget, + int pos, + ReportPriority report) final; + void operateTooltip(TextEditorWidget *editorWidget, const QPoint &point) final; +}; + +const CMakeKeywords &CMakeHoverHandler::keywords() const +{ + if (m_keywords.functions.isEmpty()) { + CMakeTool *tool = nullptr; + if (auto bs = ProjectTree::currentBuildSystem()) + tool = CMakeKitAspect::cmakeTool(bs->target()->kit()); + if (!tool) + tool = CMakeToolManager::defaultCMakeTool(); + + if (tool) + m_keywords = tool->keywords(); + } + + return m_keywords; +} + +QString readFirstParagraphs(const QString &element, const FilePath &helpFile); + +void CMakeHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget, + int pos, + ReportPriority report) +{ + const QScopeGuard cleanup([this, report] { report(priority()); }); + + QTextCursor cursor = editorWidget->textCursor(); + cursor.setPosition(pos); + const QString word = Utils::Text::wordUnderCursor(cursor); + + FilePath helpFile; + for (const auto &map : {keywords().functions, + keywords().variables, + keywords().directoryProperties, + keywords().sourceProperties, + keywords().targetProperties, + keywords().testProperties, + keywords().properties, + keywords().includeStandardModules, + keywords().findModules, + keywords().policies}) { + if (map.contains(word)) { + helpFile = map.value(word); + break; + } + } + m_helpToolTip.clear(); + if (!helpFile.isEmpty()) + m_helpToolTip = readFirstParagraphs(word, helpFile); + + setPriority(m_helpToolTip.isEmpty() ? Priority_Tooltip : Priority_None); +} + +void CMakeHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoint &point) +{ + if (!m_helpToolTip.isEmpty()) + Utils::ToolTip::show(point, m_helpToolTip, Qt::MarkdownText, editorWidget); + else + Utils::ToolTip::hide(); +} + // // CMakeEditorFactory // @@ -334,6 +416,8 @@ CMakeEditorFactory::CMakeEditorFactory() | TextEditorActionHandler::FollowSymbolUnderCursor | TextEditorActionHandler::Format); + addHoverHandler(new CMakeHoverHandler); + ActionContainer *contextMenu = ActionManager::createMenu(Constants::M_CONTEXT); contextMenu->addAction(ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR)); contextMenu->addSeparator(Context(Constants::CMAKE_EDITOR_ID)); diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index a2ba8b3a604..339a11b64ae 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -155,14 +155,21 @@ QList<AssistProposalItemInterface *> generateList(const T &words, const QIcon &i QString readFirstParagraphs(const QString &element, const FilePath &helpFile) { + static QMap<FilePath, QString> map; + if (map.contains(helpFile)) + return map.value(helpFile); + auto content = helpFile.fileContents(1024).value_or(QByteArray()); - return QString("```\n%1\n```").arg(QString::fromUtf8(content.left(content.lastIndexOf("\n")))); + const QString firstParagraphs + = QString("```\n%1\n```").arg(QString::fromUtf8(content.left(content.lastIndexOf("\n")))); + + map[helpFile] = firstParagraphs; + return firstParagraphs; } QList<AssistProposalItemInterface *> generateList(const QMap<QString, FilePath> &words, const QIcon &icon) { - static QMap<FilePath, QString> map; struct MarkDownAssitProposalItem : public AssistProposalItem { Qt::TextFormat detailFormat() const { return Qt::MarkdownText; } @@ -172,13 +179,8 @@ QList<AssistProposalItemInterface *> generateList(const QMap<QString, FilePath> for (const auto &[text, helpFile] : words.asKeyValueRange()) { MarkDownAssitProposalItem *item = new MarkDownAssitProposalItem(); item->setText(text); - - if (!helpFile.isEmpty()) { - if (!map.contains(helpFile)) - map[helpFile] = readFirstParagraphs(text, helpFile); - item->setDetail(map.value(helpFile)); - } - + if (!helpFile.isEmpty()) + item->setDetail(readFirstParagraphs(text, helpFile)); item->setIcon(icon); list << item; }; From e374f809ad98610ccb5728417382f0b22e9bd141 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 25 Sep 2023 13:34:54 +0200 Subject: [PATCH 1266/1777] QmakeProjectManager: Remove bogus condition from importer Fixes: QTCREATORBUG-18150 Change-Id: If9c7aaa7745b9cd0ef57d3ecd71308ffb2991c48 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp index 9a9450a218f..e159f5dd6dc 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp @@ -61,11 +61,7 @@ QmakeProjectImporter::QmakeProjectImporter(const FilePath &path) : FilePaths QmakeProjectImporter::importCandidates() { - FilePaths candidates; - - const FilePath pfp = projectFilePath(); - const QString prefix = pfp.baseName(); - candidates << pfp.absolutePath(); + FilePaths candidates{projectFilePath().absolutePath()}; for (Kit *k : KitManager::kits()) { const FilePath sbdir = QmakeBuildConfiguration::shadowBuildDirectory @@ -73,7 +69,7 @@ FilePaths QmakeProjectImporter::importCandidates() const FilePath baseDir = sbdir.absolutePath(); for (const FilePath &path : baseDir.dirEntries(QDir::Dirs | QDir::NoDotAndDotDot)) { - if (path.fileName().startsWith(prefix) && !candidates.contains(path)) + if (!candidates.contains(path)) candidates << path; } } From a7d265852044751d174f2124b8d125ebfff9f64c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 25 Sep 2023 15:28:48 +0200 Subject: [PATCH 1267/1777] Utils: Bark when encountering a default-constructed QDir::Filter This would always result in no hits, contrary to NoFilter. Change-Id: I22591581373eed10fb1d1f660f705992e9653d5a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/utils/filepath.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index a5a51b43bbe..26d6d667f90 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -2173,6 +2173,7 @@ FileFilter::FileFilter(const QStringList &nameFilters, fileFilters(fileFilters), iteratorFlags(flags) { + QTC_CHECK(this->fileFilters != QDir::Filters()); } QStringList FileFilter::asFindArguments(const QString &path) const From e0f6ed0fe7339818550ccb6ae2696ff7fe77cf59 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 5 Sep 2023 11:16:52 +0200 Subject: [PATCH 1268/1777] ProjectExplorer: Move some code from derived GccTCFactory classes ... to base as preliminary step to merge the factories. Combining the code paths is not part of this change to keep it mechanical. Change-Id: Ia1a43000a1e3978eae85be36493a67a18ba0c3e6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 242 +++++++++---------- src/plugins/projectexplorer/gcctoolchain.h | 15 +- 2 files changed, 124 insertions(+), 133 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index bfe5e9621a6..8b9610ce0c6 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1208,6 +1208,76 @@ GccToolChainFactory::GccToolChainFactory() Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) const { + if (m_subType == GccToolChain::LinuxIcc) { + Toolchains result = autoDetectToolchains("icpc", + DetectVariants::No, + Constants::CXX_LANGUAGE_ID, + Constants::LINUXICC_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor()); + result += autoDetectToolchains("icc", + DetectVariants::Yes, + Constants::C_LANGUAGE_ID, + Constants::LINUXICC_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor()); + return result; + } + + if (m_subType == GccToolChain::MinGW) { + static const auto tcChecker = [](const ToolChain *tc) { + return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; + }; + Toolchains result = autoDetectToolchains("g++", + DetectVariants::Yes, + Constants::CXX_LANGUAGE_ID, + Constants::MINGW_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor(), + tcChecker); + result += autoDetectToolchains("gcc", + DetectVariants::Yes, + Constants::C_LANGUAGE_ID, + Constants::MINGW_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor(), + tcChecker); + return result; + } + + if (m_subType == GccToolChain::Clang) { + Toolchains tcs; + Toolchains known = detector.alreadyKnown; + + tcs.append(autoDetectToolchains("clang++", + DetectVariants::Yes, + Constants::CXX_LANGUAGE_ID, + Constants::CLANG_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor())); + tcs.append(autoDetectToolchains("clang", + DetectVariants::Yes, + Constants::C_LANGUAGE_ID, + Constants::CLANG_TOOLCHAIN_TYPEID, + detector, + toolchainConstructor())); + known.append(tcs); + + const FilePath compilerPath = Core::ICore::clangExecutable(CLANG_BINDIR); + if (!compilerPath.isEmpty()) { + const FilePath clang = compilerPath.parentDir().pathAppended("clang").withExecutableSuffix(); + tcs.append( + autoDetectToolchains(clang.toString(), + DetectVariants::No, + Constants::C_LANGUAGE_ID, + Constants::CLANG_TOOLCHAIN_TYPEID, + ToolchainDetector(known, detector.device, detector.searchPaths), + toolchainConstructor())); + } + + return tcs; + } + // GCC is almost never what you want on macOS, but it is by default found in /usr/bin if (HostOsInfo::isMacHost() && detector.device->type() == Constants::DESKTOP_DEVICE_TYPE) return {}; @@ -1237,6 +1307,53 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co Toolchains GccToolChainFactory::detectForImport(const ToolChainDescription &tcd) const { + if (m_subType == GccToolChain::LinuxIcc) { + const QString fileName = tcd.compilerPath.completeBaseName(); + if ((tcd.language == Constants::CXX_LANGUAGE_ID && fileName.startsWith("icpc")) || + (tcd.language == Constants::C_LANGUAGE_ID && fileName.startsWith("icc"))) { + return autoDetectToolChain(tcd, toolchainConstructor()); + } + return {}; + } + + if (m_subType == GccToolChain::MinGW) { + const QString fileName = tcd.compilerPath.completeBaseName(); + + const bool cCompiler = tcd.language == Constants::C_LANGUAGE_ID + && ((fileName.startsWith("gcc") || fileName.endsWith("gcc")) + || fileName == "cc"); + + const bool cxxCompiler = tcd.language == Constants::CXX_LANGUAGE_ID + && ((fileName.startsWith("g++") || fileName.endsWith("g++")) + || (fileName.startsWith("c++") || fileName.endsWith("c++"))); + + if (cCompiler || cxxCompiler) { + return autoDetectToolChain(tcd, toolchainConstructor(), [](const ToolChain *tc) { + return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; + }); + } + + return {}; + } + + if (m_subType == GccToolChain::Clang) { + const QString fileName = tcd.compilerPath.completeBaseName(); + const QString resolvedSymlinksFileName = tcd.compilerPath.resolveSymlinks().completeBaseName(); + + const bool isCCompiler = tcd.language == Constants::C_LANGUAGE_ID + && ((fileName.startsWith("clang") && !fileName.startsWith("clang++")) + || (fileName == "cc" && resolvedSymlinksFileName.contains("clang"))); + + const bool isCxxCompiler = tcd.language == Constants::CXX_LANGUAGE_ID + && (fileName.startsWith("clang++") + || (fileName == "c++" && resolvedSymlinksFileName.contains("clang"))); + + if (isCCompiler || isCxxCompiler) + return autoDetectToolChain(tcd, toolchainConstructor()); + + return {}; + } + const QString fileName = tcd.compilerPath.completeBaseName(); const QString resolvedSymlinksFileName = tcd.compilerPath.resolveSymlinks().completeBaseName(); @@ -1798,6 +1915,7 @@ QString GccToolChain::sysRoot() const ClangToolChainFactory::ClangToolChainFactory() { + m_subType = GccToolChain::Clang; setDisplayName(Tr::tr("Clang")); setSupportedToolChainType(Constants::CLANG_TOOLCHAIN_TYPEID); setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID}); @@ -1806,58 +1924,6 @@ ClangToolChainFactory::ClangToolChainFactory() }); } -Toolchains ClangToolChainFactory::autoDetect(const ToolchainDetector &detector) const -{ - Toolchains tcs; - Toolchains known = detector.alreadyKnown; - - tcs.append(autoDetectToolchains("clang++", - DetectVariants::Yes, - Constants::CXX_LANGUAGE_ID, - Constants::CLANG_TOOLCHAIN_TYPEID, - detector, - toolchainConstructor())); - tcs.append(autoDetectToolchains("clang", - DetectVariants::Yes, - Constants::C_LANGUAGE_ID, - Constants::CLANG_TOOLCHAIN_TYPEID, - detector, - toolchainConstructor())); - known.append(tcs); - - const FilePath compilerPath = Core::ICore::clangExecutable(CLANG_BINDIR); - if (!compilerPath.isEmpty()) { - const FilePath clang = compilerPath.parentDir().pathAppended("clang").withExecutableSuffix(); - tcs.append( - autoDetectToolchains(clang.toString(), - DetectVariants::No, - Constants::C_LANGUAGE_ID, - Constants::CLANG_TOOLCHAIN_TYPEID, - ToolchainDetector(known, detector.device, detector.searchPaths), - toolchainConstructor())); - } - - return tcs; -} - -Toolchains ClangToolChainFactory::detectForImport(const ToolChainDescription &tcd) const -{ - const QString fileName = tcd.compilerPath.completeBaseName(); - const QString resolvedSymlinksFileName = tcd.compilerPath.resolveSymlinks().completeBaseName(); - - const bool isCCompiler = tcd.language == Constants::C_LANGUAGE_ID - && ((fileName.startsWith("clang") && !fileName.startsWith("clang++")) - || (fileName == "cc" && resolvedSymlinksFileName.contains("clang"))); - - const bool isCxxCompiler = tcd.language == Constants::CXX_LANGUAGE_ID - && (fileName.startsWith("clang++") - || (fileName == "c++" && resolvedSymlinksFileName.contains("clang"))); - - if (isCCompiler || isCxxCompiler) { - return autoDetectToolChain(tcd, toolchainConstructor()); - } - return {}; -} void GccToolChainConfigWidget::updateParentToolChainComboBox() { @@ -1892,6 +1958,7 @@ void GccToolChainConfigWidget::updateParentToolChainComboBox() MingwToolChainFactory::MingwToolChainFactory() { + m_subType = GccToolChain::MinGW; setDisplayName(Tr::tr("MinGW")); setSupportedToolChainType(Constants::MINGW_TOOLCHAIN_TYPEID); setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID}); @@ -1900,55 +1967,13 @@ MingwToolChainFactory::MingwToolChainFactory() }); } -Toolchains MingwToolChainFactory::autoDetect(const ToolchainDetector &detector) const -{ - static const auto tcChecker = [](const ToolChain *tc) { - return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; - }; - Toolchains result = autoDetectToolchains("g++", - DetectVariants::Yes, - Constants::CXX_LANGUAGE_ID, - Constants::MINGW_TOOLCHAIN_TYPEID, - detector, - toolchainConstructor(), - tcChecker); - result += autoDetectToolchains("gcc", - DetectVariants::Yes, - Constants::C_LANGUAGE_ID, - Constants::MINGW_TOOLCHAIN_TYPEID, - detector, - toolchainConstructor(), - tcChecker); - return result; -} - -Toolchains MingwToolChainFactory::detectForImport(const ToolChainDescription &tcd) const -{ - const QString fileName = tcd.compilerPath.completeBaseName(); - - const bool cCompiler = tcd.language == Constants::C_LANGUAGE_ID - && ((fileName.startsWith("gcc") || fileName.endsWith("gcc")) - || fileName == "cc"); - - const bool cxxCompiler = tcd.language == Constants::CXX_LANGUAGE_ID - && ((fileName.startsWith("g++") || fileName.endsWith("g++")) - || (fileName.startsWith("c++") || fileName.endsWith("c++"))); - - if (cCompiler || cxxCompiler) { - return autoDetectToolChain(tcd, toolchainConstructor(), [](const ToolChain *tc) { - return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; - }); - } - - return {}; -} - // -------------------------------------------------------------------------- // LinuxIccToolChainFactory // -------------------------------------------------------------------------- LinuxIccToolChainFactory::LinuxIccToolChainFactory() { + m_subType = GccToolChain::LinuxIcc; setDisplayName(Tr::tr("ICC")); setSupportedToolChainType(Constants::LINUXICC_TOOLCHAIN_TYPEID); setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID}); @@ -1957,33 +1982,6 @@ LinuxIccToolChainFactory::LinuxIccToolChainFactory() }); } -Toolchains LinuxIccToolChainFactory::autoDetect(const ToolchainDetector &detector) const -{ - Toolchains result = autoDetectToolchains("icpc", - DetectVariants::No, - Constants::CXX_LANGUAGE_ID, - Constants::LINUXICC_TOOLCHAIN_TYPEID, - detector, - toolchainConstructor()); - result += autoDetectToolchains("icc", - DetectVariants::Yes, - Constants::C_LANGUAGE_ID, - Constants::LINUXICC_TOOLCHAIN_TYPEID, - detector, - toolchainConstructor()); - return result; -} - -Toolchains LinuxIccToolChainFactory::detectForImport(const ToolChainDescription &tcd) const -{ - const QString fileName = tcd.compilerPath.completeBaseName(); - if ((tcd.language == Constants::CXX_LANGUAGE_ID && fileName.startsWith("icpc")) || - (tcd.language == Constants::C_LANGUAGE_ID && fileName.startsWith("icc"))) { - return autoDetectToolChain(tcd, toolchainConstructor()); - } - return {}; -} - GccToolChain::WarningFlagAdder::WarningFlagAdder(const QString &flag, WarningFlags &flags) : m_flags(flags) { diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 9607f0a8ef8..87a2beaf62a 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -198,10 +198,12 @@ class GccToolChainFactory : public ToolChainFactory public: GccToolChainFactory(); - Toolchains autoDetect(const ToolchainDetector &detector) const override; - Toolchains detectForImport(const ToolChainDescription &tcd) const override; + Toolchains autoDetect(const ToolchainDetector &detector) const final; + Toolchains detectForImport(const ToolChainDescription &tcd) const final; protected: + GccToolChain::SubType m_subType = GccToolChain::RealGcc; + enum class DetectVariants { Yes, No }; using ToolchainChecker = std::function<bool(const ToolChain *)>; static Toolchains autoDetectToolchains(const QString &compilerName, @@ -220,27 +222,18 @@ class ClangToolChainFactory : public GccToolChainFactory { public: ClangToolChainFactory(); - - Toolchains autoDetect(const ToolchainDetector &detector) const final; - Toolchains detectForImport(const ToolChainDescription &tcd) const final; }; class MingwToolChainFactory : public GccToolChainFactory { public: MingwToolChainFactory(); - - Toolchains autoDetect(const ToolchainDetector &detector) const final; - Toolchains detectForImport(const ToolChainDescription &tcd) const final; }; class LinuxIccToolChainFactory : public GccToolChainFactory { public: LinuxIccToolChainFactory(); - - Toolchains autoDetect(const ToolchainDetector &detector) const final; - Toolchains detectForImport(const ToolChainDescription &tcd) const final; }; } // namespace Internal From 359f6e54b82d8ae89bb5c74a0b1e53db1145cf3a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 25 Sep 2023 17:09:21 +0200 Subject: [PATCH 1269/1777] ProjectExplorer: Reduce scope of projectexploererconstants include plus a bit of cosmetics. Change-Id: I744b28ebf4285bd61b948988a0192632f5b360a8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/android/androidplugin.cpp | 1 + src/plugins/android/androidtoolchain.cpp | 1 + src/plugins/projectexplorer/gcctoolchain.cpp | 1 + src/plugins/projectexplorer/gcctoolchain.h | 2 -- src/plugins/projectexplorer/projectexplorer.cpp | 1 + src/plugins/webassembly/webassemblysettings.cpp | 3 ++- 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/android/androidplugin.cpp b/src/plugins/android/androidplugin.cpp index 2ed71e194b4..9eeee4dad29 100644 --- a/src/plugins/android/androidplugin.cpp +++ b/src/plugins/android/androidplugin.cpp @@ -44,6 +44,7 @@ #include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/project.h> +#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/target.h> diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index b472498a806..26ca46be2a5 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -9,6 +9,7 @@ #include <projectexplorer/kitmanager.h> #include <projectexplorer/toolchainmanager.h> #include <projectexplorer/projectexplorer.h> +#include <projectexplorer/projectexplorerconstants.h> #include <utils/environment.h> diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 8b9610ce0c6..084fd9c8f33 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -8,6 +8,7 @@ #include "devicesupport/idevice.h" #include "gccparser.h" #include "linuxiccparser.h" +#include "projectexplorerconstants.h" #include "projectexplorertr.h" #include "projectmacro.h" #include "toolchainconfigwidget.h" diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 87a2beaf62a..e76398621d6 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -5,7 +5,6 @@ #include "projectexplorer_export.h" -#include "projectexplorerconstants.h" #include "toolchain.h" #include "abi.h" #include "headerpath.h" @@ -30,7 +29,6 @@ const QStringList gccPredefinedMacrosOptions(Utils::Id languageId); // GccToolChain // -------------------------------------------------------------------------- - class PROJECTEXPLORER_EXPORT GccToolChain : public ToolChain { public: diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index c1f90598218..3b199217212 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -56,6 +56,7 @@ #include "processstep.h" #include "project.h" #include "projectcommentssettings.h" +#include "projectexplorerconstants.h" #include "projectexplorericons.h" #include "projectexplorersettings.h" #include "projectexplorertr.h" diff --git a/src/plugins/webassembly/webassemblysettings.cpp b/src/plugins/webassembly/webassemblysettings.cpp index e6ad931ccb9..88a7cc22130 100644 --- a/src/plugins/webassembly/webassemblysettings.cpp +++ b/src/plugins/webassembly/webassemblysettings.cpp @@ -12,6 +12,8 @@ #include <coreplugin/icore.h> #include <coreplugin/dialogs/ioptionspage.h> +#include <projectexplorer/projectexplorerconstants.h> + #include <utils/aspects.h> #include <utils/environment.h> #include <utils/infolabel.h> @@ -19,7 +21,6 @@ #include <utils/pathchooser.h> #include <utils/utilsicons.h> -#include <QGroupBox> #include <QTextBrowser> #include <QTimer> From 6ff28649c2f596110486978c593e9cefe12a095b Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 21 Sep 2023 12:52:01 +0200 Subject: [PATCH 1270/1777] ProjectExplorer: speed up clang-cl toolchain detection Do not guess the extension when we already it's clang-cl.exe Change-Id: Ifd0d069f466d4b01bc3cfadc456ea6c97ea30743 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/msvctoolchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index c6f435a9f4f..dd5181990de 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -2057,7 +2057,7 @@ Toolchains ClangClToolChainFactory::autoDetect(const ToolchainDetector &detector } const Utils::Environment systemEnvironment = Utils::Environment::systemEnvironment(); - const Utils::FilePath clangClPath = systemEnvironment.searchInPath("clang-cl"); + const Utils::FilePath clangClPath = systemEnvironment.searchInPath("clang-cl.exe"); if (!clangClPath.isEmpty()) results.append(detectClangClToolChainInPath(clangClPath, known, "")); From 8ebcd73e130eb423736c311a3dd00fcc502fbf23 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 25 Aug 2023 16:06:18 +0200 Subject: [PATCH 1271/1777] AutoTest: Provide a couple of test related snippets Unfortunately there is no easy way to enhance existing providers based on conditions or by extending the snippet collection with plugin internal paths. So, add snippets to known snippet providers. Change-Id: I55da59389b5dc28aa27bb2974699aa4674c0bbf2 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- share/qtcreator/snippets/test.xml | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 share/qtcreator/snippets/test.xml diff --git a/share/qtcreator/snippets/test.xml b/share/qtcreator/snippets/test.xml new file mode 100644 index 00000000000..4c7f8d1c39b --- /dev/null +++ b/share/qtcreator/snippets/test.xml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="utf-8"?> +<snippets> +<snippet group="QML" trigger="TestCase" id="quicktest_case" complement="QuickTest Test Case">TestCase { + name: "$TestCaseName$" + + function test_$TestFunctionName$() { + $$ + } +} +</snippet> +<snippet group="C++" trigger="TEST" id="gtest_test_function" complement="GTest Function">TEST($TestSuite$, $TestName$) +{ + $$ +} +</snippet> +<snippet group="C++" trigger="TEST_F" id="gtest_test_function_fixture" complement="GTest Fixture">TEST_F($TestFixtureName$, $TestName$) +{ + $$ +} +</snippet> +<snippet group="C++" trigger="TEST_P" id="gtest_test_function_parameterized" complement="GTest Parameterized">INSTANTIATE_TEST_SUITE_P($InstantiationName$, $TestFixtureName$, $ParameterGenerator$); + +TEST_P($TestFixtureName$, $TestName$) +{ + $$ +} +</snippet> +<snippet group="C++" trigger="BOOST_AUTO_TEST_CASE" id="boost_test_case" complement="Test Case">BOOST_AUTO_TEST_CASE($TestName$) +{ + $$ +} +</snippet> +<snippet group="C++" trigger="BOOST_AUTO_TEST_SUITE" id="boost_test_suite" complement="Test Suite">BOOST_AUTO_TEST_SUITE($SuiteName$) +BOOST_AUTO_TEST_CASE($TestName$) +{ + $$ +} +BOOST_AUTO_TEST_SUITE_END() +</snippet> +<snippet group="C++" trigger="TEST_CASE" id="catch_testcase_with_section" complement="Catch Test Case">TEST_CASE("$TestCaseName$") { + SECTION("$SectionName$") { + $$ + } +} +</snippet> +<snippet group="C++" trigger="SCENARIO" id="catch_scenario" complement="Catch Scenario">SCENARIO("$ScenarioName$") { + GIVEN("$Initial$") { + $$ + WHEN("$Condition$") { + $$ + THEN("$Expectation$") { + $$ + } + } + } +} +</snippet> +</snippets> From e85f750debf45237613be4da04b9b4a80effc9be Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 26 Sep 2023 08:30:56 +0200 Subject: [PATCH 1272/1777] ProjectExplorer: Remove a few toolchain friends Change-Id: Ibc665d3ce0c9e1d65a5eee5dcc31e9c3369fd331 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/projectexplorer/gcctoolchain.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index e76398621d6..7694cc524c4 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -16,11 +16,8 @@ namespace ProjectExplorer { namespace Internal { -class ClangToolChainFactory; class GccToolChainConfigWidget; class GccToolChainFactory; -class MingwToolChainFactory; -class LinuxIccToolChainFactory; const QStringList gccPredefinedMacrosOptions(Utils::Id languageId); } @@ -172,9 +169,6 @@ private: friend class Internal::GccToolChainConfigWidget; friend class Internal::GccToolChainFactory; - friend class Internal::LinuxIccToolChainFactory; - friend class Internal::MingwToolChainFactory; - friend class Internal::ClangToolChainFactory; friend class ToolChainFactory; // "resolved" on macOS from /usr/bin/clang(++) etc to <DeveloperDir>/usr/bin/clang(++) From d7ef2f816cd97fce263e3f42a84a1155a41eedc0 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 26 Sep 2023 07:25:25 +0200 Subject: [PATCH 1273/1777] CompilerExplorer: Fix saving Change-Id: I7f6770170c76d636fa2d3631d9ff462da9e227bd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- .../compilerexplorer/compilerexplorereditor.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 719b61299fc..b02b3585ace 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -107,8 +107,11 @@ JsonSettingsDocument::JsonSettingsDocument(QUndoStack *undoStack) { setId(Constants::CE_EDITOR_ID); setMimeType("application/compiler-explorer"); - connect(&m_ceSettings, &CompilerExplorerSettings::changed, this, [this] { emit changed(); }); - m_ceSettings.setAutoApply(true); + connect(&m_ceSettings, &CompilerExplorerSettings::changed, this, [this] { + emit changed(); + emit contentsChanged(); + }); + m_ceSettings.setAutoApply(false); m_ceSettings.setUndoStack(undoStack); } @@ -157,8 +160,10 @@ bool JsonSettingsDocument::saveImpl(QString *errorString, const FilePath &newFil Utils::FilePath path = newFilePath.isEmpty() ? filePath() : newFilePath; - if (!newFilePath.isEmpty() && !autoSave) + if (!newFilePath.isEmpty() && !autoSave) { + setPreferredDisplayName({}); setFilePath(newFilePath); + } auto result = path.writeFileContents(jsonFromStore(store)); if (!result && errorString) { @@ -182,6 +187,8 @@ bool JsonSettingsDocument::setContents(const QByteArray &contents) m_ceSettings.fromMap(*result); emit settingsChanged(); + emit changed(); + emit contentsChanged(); return true; } From a43191497da10a874a5d9274dbaa50ce3f3d3662 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 26 Sep 2023 08:38:09 +0200 Subject: [PATCH 1274/1777] Utils: Fix StringSelectionAspect Previously the undo state was not updated when the value was set from the outside before the gui model was setup. Change-Id: I380916f888edd120f512089bdb94762977c11978 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 05b4d8796bf..d9bf38688ac 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -3286,8 +3286,10 @@ QStandardItem *StringSelectionAspect::itemById(const QString &id) void StringSelectionAspect::bufferToGui() { - if (!m_model) + if (!m_model) { + m_undoable.setSilently(m_buffer); return; + } auto selected = itemById(m_buffer); if (selected) { @@ -3302,8 +3304,10 @@ void StringSelectionAspect::bufferToGui() m_selectionModel->setCurrentIndex(m_model->item(0)->index(), QItemSelectionModel::SelectionFlag::ClearAndSelect); } else { + m_undoable.setSilently(m_buffer); m_selectionModel->setCurrentIndex(QModelIndex(), QItemSelectionModel::SelectionFlag::Clear); } + handleGuiChanged(); } From 658e2a3197362e03d5473c2dae014cf10e568621 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 26 Sep 2023 07:35:01 +0200 Subject: [PATCH 1275/1777] CMakePM: Fix build with Qt6.2 Change-Id: Iac128851da0aa7895d5c2352be550702fbc1e7f9 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../cmakeprojectmanager/cmakefilecompletionassist.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 339a11b64ae..84902f9d495 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -176,11 +176,11 @@ QList<AssistProposalItemInterface *> generateList(const QMap<QString, FilePath> }; QList<AssistProposalItemInterface *> list; - for (const auto &[text, helpFile] : words.asKeyValueRange()) { + for (auto it = words.cbegin(); it != words.cend(); ++it) { MarkDownAssitProposalItem *item = new MarkDownAssitProposalItem(); - item->setText(text); - if (!helpFile.isEmpty()) - item->setDetail(readFirstParagraphs(text, helpFile)); + item->setText(it.key()); + if (!it.value().isEmpty()) + item->setDetail(readFirstParagraphs(it.key(), it.value())); item->setIcon(icon); list << item; }; From 25c7390d0a6600a0ca31593fc3a78cd82b5800ef Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 22 Sep 2023 14:14:45 +0200 Subject: [PATCH 1276/1777] ClangCodeModel: Start fallback clangd on demand E.g. when a non-project source file is opened. Fixes: QTCREATORBUG-29576 Change-Id: Ia99346a7a1016c4c7dcdb41ad6c8dbbc85ed95ff Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../clangcodemodel/clangmodelmanagersupport.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp index e1bd9114717..b201d5a364c 100644 --- a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp +++ b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp @@ -231,10 +231,10 @@ ClangModelManagerSupport::ClangModelManagerSupport() connect(modelManager, &CppModelManager::fallbackProjectPartUpdated, this, [this] { if (sessionModeEnabled()) return; - if (ClangdClient * const fallbackClient = clientForProject(nullptr)) { + if (ClangdClient * const fallbackClient = clientForProject(nullptr)) LanguageClientManager::shutdownClient(fallbackClient); + if (ClangdSettings::instance().useClangd()) claimNonProjectSources(new ClangdClient(nullptr, {})); - } }); auto projectManager = ProjectManager::instance(); @@ -251,9 +251,6 @@ ClangModelManagerSupport::ClangModelManagerSupport() connect(&ClangdSettings::instance(), &ClangdSettings::changed, this, &ClangModelManagerSupport::onClangdSettingsChanged); - if (ClangdSettings::instance().useClangd()) - new ClangdClient(nullptr, {}); - new ClangdQuickFixFactory(); // memory managed by CppEditor::g_cppQuickFixFactories } @@ -777,8 +774,13 @@ void ClangModelManagerSupport::onEditorOpened(IEditor *editor) project = nullptr; else if (!project && ProjectFile::isHeader(document->filePath())) project = fallbackProject(); - if (ClangdClient * const client = clientForProject(project)) - LanguageClientManager::openDocumentWithClient(textDocument, client); + ClangdClient *client = clientForProject(project); + if (!client) { + if (project) + return; + client = new ClangdClient(nullptr, {}); + } + LanguageClientManager::openDocumentWithClient(textDocument, client); } } From 873a719174d2cc31d550c2c87bc7a6a979a56012 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 25 Sep 2023 16:00:02 +0200 Subject: [PATCH 1277/1777] QmakeProjectManager: Speed up project importer Change-Id: I0cc5661f76c1d8f9182473d5f8da18452e3f85bf Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp index e159f5dd6dc..832fb1a6809 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp @@ -27,9 +27,9 @@ #include <utils/qtcassert.h> #include <QDir> -#include <QFileInfo> -#include <QStringList> #include <QLoggingCategory> +#include <QSet> +#include <QStringList> #include <memory> @@ -63,11 +63,14 @@ FilePaths QmakeProjectImporter::importCandidates() { FilePaths candidates{projectFilePath().absolutePath()}; + QSet<FilePath> seenBaseDirs; for (Kit *k : KitManager::kits()) { const FilePath sbdir = QmakeBuildConfiguration::shadowBuildDirectory (projectFilePath(), k, QString(), BuildConfiguration::Unknown); const FilePath baseDir = sbdir.absolutePath(); + if (!Utils::insert(seenBaseDirs, baseDir)) + continue; for (const FilePath &path : baseDir.dirEntries(QDir::Dirs | QDir::NoDotAndDotDot)) { if (!candidates.contains(path)) candidates << path; From 61048fa7376ea4a3f4be0b319ad768d54319fec8 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 26 Sep 2023 09:57:35 +0200 Subject: [PATCH 1278/1777] Utils: Add AspectList::clear() Change-Id: Ic3e90bc76d271c1bb3b84e545fae5ba1c7a10468 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 15 +++++++++++++++ src/libs/utils/aspects.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index d9bf38688ac..04cf8b786d0 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -3154,6 +3154,21 @@ void AspectList::removeItem(const std::shared_ptr<BaseAspect> &item) actualRemoveItem(item); } +void AspectList::clear() +{ + if (undoStack()) { + undoStack()->beginMacro("Clear"); + + for (auto item : volatileItems()) + undoStack()->push(new RemoveItemCommand(this, item)); + + undoStack()->endMacro(); + } else { + for (auto item : volatileItems()) + actualRemoveItem(item); + } +} + void AspectList::apply() { d->items = d->volatileItems; diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index ccdaadcc631..d5d47a79d7e 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -1031,6 +1031,7 @@ public: void removeItem(const std::shared_ptr<BaseAspect> &item); void actualRemoveItem(const std::shared_ptr<BaseAspect> &item); + void clear(); void apply() override; From 4d2f3e8b01da7ceacfc4c10b25dc40e5211f3bff Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 26 Sep 2023 10:25:16 +0200 Subject: [PATCH 1279/1777] ProjectExplorer: Merge GccToolChainFactories further This replaces the four classes from the GccToolChainFactories hierarchy by a single (parametrized) GccToolChainFactory, but makes the "RealGcc" one responsible for all autodetection. This is a hack to move closer to a "scan only once" setup, and temporarily necessary as there is currently one factory creates one type of toolchain, so we need four factories for the current four gcc-ish toolchain types. Change-Id: Icbecb1be6e89cf5efad76baf92ef38ac63be074f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 360 +++++++++--------- src/plugins/projectexplorer/gcctoolchain.h | 28 +- .../projectexplorer/projectexplorer.cpp | 9 +- src/plugins/projectexplorer/toolchain.cpp | 3 +- 4 files changed, 190 insertions(+), 210 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 084fd9c8f33..ff5387d63a3 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1198,182 +1198,228 @@ static Utils::FilePaths renesasRl78SearchPathsFromRegistry() return searchPaths; } -GccToolChainFactory::GccToolChainFactory() +static ToolChain *constructRealGccToolchain() { - setDisplayName(Tr::tr("GCC")); - setSupportedToolChainType(Constants::GCC_TOOLCHAIN_TYPEID); + return new GccToolChain(Constants::GCC_TOOLCHAIN_TYPEID, GccToolChain::RealGcc); +} + +static ToolChain *constructClangToolchain() +{ + return new GccToolChain(Constants::CLANG_TOOLCHAIN_TYPEID, GccToolChain::Clang); +} + +static ToolChain *constructMinGWToolchain() +{ + return new GccToolChain(Constants::MINGW_TOOLCHAIN_TYPEID, GccToolChain::MinGW); +} + +static ToolChain *constructLinuxIccToolchain() +{ + return new GccToolChain(Constants::LINUXICC_TOOLCHAIN_TYPEID, GccToolChain::LinuxIcc); +} + +GccToolChainFactory::GccToolChainFactory(GccToolChain::SubType subType) + : m_autoDetecting(subType == GccToolChain::RealGcc) +{ + switch (subType) { + case GccToolChain::RealGcc: + setDisplayName(Tr::tr("GCC")); + setSupportedToolChainType(Constants::GCC_TOOLCHAIN_TYPEID); + setToolchainConstructor(&constructRealGccToolchain); + break; + case GccToolChain::Clang: + setDisplayName(Tr::tr("Clang")); + setSupportedToolChainType(Constants::CLANG_TOOLCHAIN_TYPEID); + setToolchainConstructor(&constructClangToolchain); + break; + case GccToolChain::MinGW: + setDisplayName(Tr::tr("MinGW")); + setSupportedToolChainType(Constants::MINGW_TOOLCHAIN_TYPEID); + setToolchainConstructor(&constructMinGWToolchain); + break; + case GccToolChain::LinuxIcc: + setDisplayName(Tr::tr("ICC")); + setSupportedToolChainType(Constants::LINUXICC_TOOLCHAIN_TYPEID); + setToolchainConstructor(&constructLinuxIccToolchain); + break; + } setSupportedLanguages({Constants::C_LANGUAGE_ID, Constants::CXX_LANGUAGE_ID}); - setToolchainConstructor([] { return new GccToolChain(Constants::GCC_TOOLCHAIN_TYPEID); }); setUserCreatable(true); } Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) const { - if (m_subType == GccToolChain::LinuxIcc) { - Toolchains result = autoDetectToolchains("icpc", - DetectVariants::No, - Constants::CXX_LANGUAGE_ID, - Constants::LINUXICC_TOOLCHAIN_TYPEID, - detector, - toolchainConstructor()); - result += autoDetectToolchains("icc", - DetectVariants::Yes, - Constants::C_LANGUAGE_ID, - Constants::LINUXICC_TOOLCHAIN_TYPEID, - detector, - toolchainConstructor()); + Toolchains result; + + // Do all autodetection in th 'RealGcc' case, and none in the others. + if (!m_autoDetecting) return result; - } - if (m_subType == GccToolChain::MinGW) { - static const auto tcChecker = [](const ToolChain *tc) { - return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; - }; - Toolchains result = autoDetectToolchains("g++", - DetectVariants::Yes, - Constants::CXX_LANGUAGE_ID, - Constants::MINGW_TOOLCHAIN_TYPEID, - detector, - toolchainConstructor(), - tcChecker); - result += autoDetectToolchains("gcc", - DetectVariants::Yes, - Constants::C_LANGUAGE_ID, - Constants::MINGW_TOOLCHAIN_TYPEID, - detector, - toolchainConstructor(), - tcChecker); - return result; - } + // Linux ICC - if (m_subType == GccToolChain::Clang) { - Toolchains tcs; - Toolchains known = detector.alreadyKnown; + result += autoDetectToolchains("icpc", + DetectVariants::No, + Constants::CXX_LANGUAGE_ID, + Constants::LINUXICC_TOOLCHAIN_TYPEID, + detector, + &constructLinuxIccToolchain); + result += autoDetectToolchains("icc", + DetectVariants::Yes, + Constants::C_LANGUAGE_ID, + Constants::LINUXICC_TOOLCHAIN_TYPEID, + detector, + &constructLinuxIccToolchain); - tcs.append(autoDetectToolchains("clang++", - DetectVariants::Yes, - Constants::CXX_LANGUAGE_ID, - Constants::CLANG_TOOLCHAIN_TYPEID, - detector, - toolchainConstructor())); - tcs.append(autoDetectToolchains("clang", - DetectVariants::Yes, - Constants::C_LANGUAGE_ID, - Constants::CLANG_TOOLCHAIN_TYPEID, - detector, - toolchainConstructor())); - known.append(tcs); + // MinGW - const FilePath compilerPath = Core::ICore::clangExecutable(CLANG_BINDIR); - if (!compilerPath.isEmpty()) { - const FilePath clang = compilerPath.parentDir().pathAppended("clang").withExecutableSuffix(); - tcs.append( - autoDetectToolchains(clang.toString(), - DetectVariants::No, - Constants::C_LANGUAGE_ID, - Constants::CLANG_TOOLCHAIN_TYPEID, - ToolchainDetector(known, detector.device, detector.searchPaths), - toolchainConstructor())); - } + static const auto tcChecker = [](const ToolChain *tc) { + return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; + }; + result += autoDetectToolchains("g++", + DetectVariants::Yes, + Constants::CXX_LANGUAGE_ID, + Constants::MINGW_TOOLCHAIN_TYPEID, + detector, + &constructMinGWToolchain, + tcChecker); + result += autoDetectToolchains("gcc", + DetectVariants::Yes, + Constants::C_LANGUAGE_ID, + Constants::MINGW_TOOLCHAIN_TYPEID, + detector, + &constructMinGWToolchain, + tcChecker); - return tcs; - } - - // GCC is almost never what you want on macOS, but it is by default found in /usr/bin - if (HostOsInfo::isMacHost() && detector.device->type() == Constants::DESKTOP_DEVICE_TYPE) - return {}; + // Clang Toolchains tcs; - static const auto tcChecker = [](const ToolChain *tc) { - return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor - && tc->compilerCommand().fileName() != "c89-gcc" - && tc->compilerCommand().fileName() != "c99-gcc"; - }; - tcs.append(autoDetectToolchains("g++", + Toolchains known = detector.alreadyKnown; + + tcs.append(autoDetectToolchains("clang++", DetectVariants::Yes, Constants::CXX_LANGUAGE_ID, - Constants::GCC_TOOLCHAIN_TYPEID, + Constants::CLANG_TOOLCHAIN_TYPEID, detector, - toolchainConstructor(), - tcChecker)); - tcs.append(autoDetectToolchains("gcc", + &constructClangToolchain)); + tcs.append(autoDetectToolchains("clang", DetectVariants::Yes, Constants::C_LANGUAGE_ID, - Constants::GCC_TOOLCHAIN_TYPEID, + Constants::CLANG_TOOLCHAIN_TYPEID, detector, - toolchainConstructor(), - tcChecker)); - return tcs; + &constructClangToolchain)); + known.append(tcs); + + const FilePath compilerPath = Core::ICore::clangExecutable(CLANG_BINDIR); + if (!compilerPath.isEmpty()) { + const FilePath clang = compilerPath.parentDir().pathAppended("clang").withExecutableSuffix(); + tcs.append( + autoDetectToolchains(clang.toString(), + DetectVariants::No, + Constants::C_LANGUAGE_ID, + Constants::CLANG_TOOLCHAIN_TYPEID, + ToolchainDetector(known, detector.device, detector.searchPaths), + &constructClangToolchain)); + } + + result += tcs; + + // GCC + + // Gcc is almost never what you want on macOS, but it is by default found in /usr/bin + if (!HostOsInfo::isMacHost() || detector.device->type() != Constants::DESKTOP_DEVICE_TYPE) { + + Toolchains tcs; + static const auto tcChecker = [](const ToolChain *tc) { + return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor + && tc->compilerCommand().fileName() != "c89-gcc" + && tc->compilerCommand().fileName() != "c99-gcc"; + }; + tcs.append(autoDetectToolchains("g++", + DetectVariants::Yes, + Constants::CXX_LANGUAGE_ID, + Constants::GCC_TOOLCHAIN_TYPEID, + detector, + &constructRealGccToolchain, + tcChecker)); + tcs.append(autoDetectToolchains("gcc", + DetectVariants::Yes, + Constants::C_LANGUAGE_ID, + Constants::GCC_TOOLCHAIN_TYPEID, + detector, + &constructRealGccToolchain, + tcChecker)); + result += tcs; + } + + return result; } Toolchains GccToolChainFactory::detectForImport(const ToolChainDescription &tcd) const { - if (m_subType == GccToolChain::LinuxIcc) { - const QString fileName = tcd.compilerPath.completeBaseName(); - if ((tcd.language == Constants::CXX_LANGUAGE_ID && fileName.startsWith("icpc")) || - (tcd.language == Constants::C_LANGUAGE_ID && fileName.startsWith("icc"))) { - return autoDetectToolChain(tcd, toolchainConstructor()); - } - return {}; - } + Toolchains result; - if (m_subType == GccToolChain::MinGW) { - const QString fileName = tcd.compilerPath.completeBaseName(); - - const bool cCompiler = tcd.language == Constants::C_LANGUAGE_ID - && ((fileName.startsWith("gcc") || fileName.endsWith("gcc")) - || fileName == "cc"); - - const bool cxxCompiler = tcd.language == Constants::CXX_LANGUAGE_ID - && ((fileName.startsWith("g++") || fileName.endsWith("g++")) - || (fileName.startsWith("c++") || fileName.endsWith("c++"))); - - if (cCompiler || cxxCompiler) { - return autoDetectToolChain(tcd, toolchainConstructor(), [](const ToolChain *tc) { - return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; - }); - } - - return {}; - } - - if (m_subType == GccToolChain::Clang) { - const QString fileName = tcd.compilerPath.completeBaseName(); - const QString resolvedSymlinksFileName = tcd.compilerPath.resolveSymlinks().completeBaseName(); - - const bool isCCompiler = tcd.language == Constants::C_LANGUAGE_ID - && ((fileName.startsWith("clang") && !fileName.startsWith("clang++")) - || (fileName == "cc" && resolvedSymlinksFileName.contains("clang"))); - - const bool isCxxCompiler = tcd.language == Constants::CXX_LANGUAGE_ID - && (fileName.startsWith("clang++") - || (fileName == "c++" && resolvedSymlinksFileName.contains("clang"))); - - if (isCCompiler || isCxxCompiler) - return autoDetectToolChain(tcd, toolchainConstructor()); - - return {}; - } + // Do all autodetection in th 'RealGcc' case, and none in the others. + if (!m_autoDetecting) + return result; const QString fileName = tcd.compilerPath.completeBaseName(); const QString resolvedSymlinksFileName = tcd.compilerPath.resolveSymlinks().completeBaseName(); - const bool isCCompiler = tcd.language == Constants::C_LANGUAGE_ID + // Linux ICC + + if ((tcd.language == Constants::CXX_LANGUAGE_ID && fileName.startsWith("icpc")) || + (tcd.language == Constants::C_LANGUAGE_ID && fileName.startsWith("icc"))) { + result += autoDetectToolChain(tcd, &constructLinuxIccToolchain); + } + + // MingW + + const bool cCompiler = tcd.language == Constants::C_LANGUAGE_ID + && ((fileName.startsWith("gcc") || fileName.endsWith("gcc")) + || fileName == "cc"); + + const bool cxxCompiler = tcd.language == Constants::CXX_LANGUAGE_ID + && ((fileName.startsWith("g++") || fileName.endsWith("g++")) + || (fileName.startsWith("c++") || fileName.endsWith("c++"))); + + if (cCompiler || cxxCompiler) { + result += autoDetectToolChain(tcd, &constructMinGWToolchain, [](const ToolChain *tc) { + return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; + }); + } + + // Clang + + bool isCCompiler = tcd.language == Constants::C_LANGUAGE_ID + && ((fileName.startsWith("clang") && !fileName.startsWith("clang++")) + || (fileName == "cc" && resolvedSymlinksFileName.contains("clang"))); + + bool isCxxCompiler = tcd.language == Constants::CXX_LANGUAGE_ID + && (fileName.startsWith("clang++") + || (fileName == "c++" && resolvedSymlinksFileName.contains("clang"))); + + if (isCCompiler || isCxxCompiler) + result += autoDetectToolChain(tcd, &constructClangToolchain); + + // GCC + + isCCompiler = tcd.language == Constants::C_LANGUAGE_ID && (fileName.startsWith("gcc") || fileName.endsWith("gcc") || (fileName == "cc" && !resolvedSymlinksFileName.contains("clang"))); - const bool isCxxCompiler = tcd.language == Constants::CXX_LANGUAGE_ID + isCxxCompiler = tcd.language == Constants::CXX_LANGUAGE_ID && (fileName.startsWith("g++") || fileName.endsWith("g++") || (fileName == "c++" && !resolvedSymlinksFileName.contains("clang"))); if (isCCompiler || isCxxCompiler) { - return autoDetectToolChain(tcd, toolchainConstructor(), [](const ToolChain *tc) { + result += autoDetectToolChain(tcd, &constructRealGccToolchain, [](const ToolChain *tc) { return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor; }); } - return {}; + + return result; } static FilePaths findCompilerCandidates(const ToolchainDetector &detector, @@ -1910,22 +1956,6 @@ QString GccToolChain::sysRoot() const return {}; } -// -------------------------------------------------------------------------- -// ClangToolChainFactory -// -------------------------------------------------------------------------- - -ClangToolChainFactory::ClangToolChainFactory() -{ - m_subType = GccToolChain::Clang; - setDisplayName(Tr::tr("Clang")); - setSupportedToolChainType(Constants::CLANG_TOOLCHAIN_TYPEID); - setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID}); - setToolchainConstructor([] { - return new GccToolChain(Constants::CLANG_TOOLCHAIN_TYPEID, GccToolChain::Clang); - }); -} - - void GccToolChainConfigWidget::updateParentToolChainComboBox() { QTC_ASSERT(m_parentToolchainCombo, return); @@ -1953,36 +1983,6 @@ void GccToolChainConfigWidget::updateParentToolChainComboBox() } } -// -------------------------------------------------------------------------- -// MingwToolChainFactory -// -------------------------------------------------------------------------- - -MingwToolChainFactory::MingwToolChainFactory() -{ - m_subType = GccToolChain::MinGW; - setDisplayName(Tr::tr("MinGW")); - setSupportedToolChainType(Constants::MINGW_TOOLCHAIN_TYPEID); - setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID}); - setToolchainConstructor([] { - return new GccToolChain(Constants::MINGW_TOOLCHAIN_TYPEID, GccToolChain::MinGW); - }); -} - -// -------------------------------------------------------------------------- -// LinuxIccToolChainFactory -// -------------------------------------------------------------------------- - -LinuxIccToolChainFactory::LinuxIccToolChainFactory() -{ - m_subType = GccToolChain::LinuxIcc; - setDisplayName(Tr::tr("ICC")); - setSupportedToolChainType(Constants::LINUXICC_TOOLCHAIN_TYPEID); - setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID}); - setToolchainConstructor([] { - return new GccToolChain(Constants::LINUXICC_TOOLCHAIN_TYPEID, GccToolChain::LinuxIcc); - }); -} - GccToolChain::WarningFlagAdder::WarningFlagAdder(const QString &flag, WarningFlags &flags) : m_flags(flags) { diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 7694cc524c4..fb8909d3881 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -180,22 +180,18 @@ private: QMetaObject::Connection m_thisToolchainRemovedConnection; }; -// -------------------------------------------------------------------------- -// Factories -// -------------------------------------------------------------------------- namespace Internal { + class GccToolChainFactory : public ToolChainFactory { public: - GccToolChainFactory(); + explicit GccToolChainFactory(GccToolChain::SubType subType); Toolchains autoDetect(const ToolchainDetector &detector) const final; Toolchains detectForImport(const ToolChainDescription &tcd) const final; -protected: - GccToolChain::SubType m_subType = GccToolChain::RealGcc; - +private: enum class DetectVariants { Yes, No }; using ToolchainChecker = std::function<bool(const ToolChain *)>; static Toolchains autoDetectToolchains(const QString &compilerName, @@ -208,24 +204,8 @@ protected: static Toolchains autoDetectToolChain(const ToolChainDescription &tcd, const ToolChainConstructor &constructor, const ToolchainChecker &checker = {}); -}; -class ClangToolChainFactory : public GccToolChainFactory -{ -public: - ClangToolChainFactory(); -}; - -class MingwToolChainFactory : public GccToolChainFactory -{ -public: - MingwToolChainFactory(); -}; - -class LinuxIccToolChainFactory : public GccToolChainFactory -{ -public: - LinuxIccToolChainFactory(); + const bool m_autoDetecting; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 3b199217212..b85e7abafce 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -626,15 +626,16 @@ public: MsvcToolChainFactory m_mscvToolChainFactory; ClangClToolChainFactory m_clangClToolChainFactory; #else - LinuxIccToolChainFactory m_linuxToolChainFactory; + GccToolChainFactory m_linuxToolChainFactory{GccToolChain::LinuxIcc}; #endif #ifndef Q_OS_MACOS - MingwToolChainFactory m_mingwToolChainFactory; // Mingw offers cross-compiling to windows + // Mingw offers cross-compiling to windows + GccToolChainFactory m_mingwToolChainFactory{GccToolChain::MinGW}; #endif - GccToolChainFactory m_gccToolChainFactory; - ClangToolChainFactory m_clangToolChainFactory; + GccToolChainFactory m_gccToolChainFactory{GccToolChain::RealGcc}; + GccToolChainFactory m_clangToolChainFactory{GccToolChain::Clang}; CustomToolChainFactory m_customToolChainFactory; DesktopDeviceFactory m_desktopDeviceFactory; diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index f4ceb06720d..5d51c501715 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -671,8 +671,7 @@ void ToolChainFactory::setSupportsAllLanguages(bool supportsAllLanguages) m_supportsAllLanguages = supportsAllLanguages; } -void ToolChainFactory::setToolchainConstructor - (const ToolChainConstructor &toolchainContructor) +void ToolChainFactory::setToolchainConstructor(const ToolChainConstructor &toolchainContructor) { m_toolchainConstructor = toolchainContructor; } From 1c24ef6406d56c4e5e45741caf5ea023ae5f9f31 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh <orgad.shaneh@audiocodes.com> Date: Tue, 26 Sep 2023 09:45:52 +0300 Subject: [PATCH 1280/1777] Welcome: Fix initial display of side area If the main window un-maximized size is small (below the threshold for hiding the side area) and the maximized size is large, the resizeEvent is called twice - once with the original size, and then on show, it is called again with the maximized size. The second call (with the delayed QTimer::singleShot), is called after delayedInitialize() is done, so the side area remains hidden for a few seconds before it reappears. The commit that exposed this behavior is 0b85fc5aa0, which changed the expensive toolchain loading to happen in delayedInitialize. Solve this by emitting the signal only after the widget is visible. Change-Id: I0ad2c16a42742046da6847a5f108b797f91fabff Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/welcome/welcomeplugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 8cc8165aa29..230dd27b936 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -80,7 +80,8 @@ signals: void ResizeSignallingWidget::resizeEvent(QResizeEvent *event) { - emit resized(event->size(), event->oldSize()); + if (isVisible()) + emit resized(event->size(), event->oldSize()); } class WelcomeMode : public IMode From e5f74d217b8c8c469ba16afd38c723be5e156555 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 15 Sep 2023 12:58:44 +0200 Subject: [PATCH 1281/1777] Core: Merge mainwindow and icore file pairs So far the main window acted a bit like ICore's pimpl. Aim at making that a bit more similar to other places. The files are kept for now to not have to adjust #includes all over the place and there's some hope to move code back there. Change-Id: I150e2dd0971bfab44cba89e0c51bb3f37062b8d3 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/icore.cpp | 1670 ++++++++++++++++++++++++- src/plugins/coreplugin/icore.h | 68 +- src/plugins/coreplugin/mainwindow.cpp | 1664 ------------------------ src/plugins/coreplugin/mainwindow.h | 77 -- 4 files changed, 1722 insertions(+), 1757 deletions(-) diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index fba0d66f1a5..a4cad44e702 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -3,23 +3,97 @@ #include "icore.h" +#include "actionmanager/actioncontainer.h" +#include "actionmanager/actionmanager.h" +#include "actionmanager/command.h" +#include "coreicons.h" #include "coreplugintr.h" +#include "coreplugintr.h" +#include "dialogs/externaltoolconfig.h" #include "dialogs/settingsdialog.h" +#include "dialogs/shortcutsettings.h" +#include "documentmanager.h" +#include "editormanager/documentmodel_p.h" +#include "editormanager/editormanager.h" +#include "editormanager/editormanager_p.h" +#include "editormanager/ieditor.h" +#include "editormanager/ieditorfactory.h" +#include "editormanager/systemeditor.h" +#include "externaltoolmanager.h" +#include "fancytabwidget.h" +#include "fileutils.h" +#include "find/basetextfind.h" +#include "findplaceholder.h" +#include "helpmanager.h" +#include "icore.h" +#include "idocumentfactory.h" +#include "inavigationwidgetfactory.h" +#include "iwizardfactory.h" +#include "jsexpander.h" +#include "loggingviewer.h" +#include "manhattanstyle.h" +#include "messagemanager.h" +#include "mimetypesettings.h" +#include "modemanager.h" +#include "navigationwidget.h" +#include "outputpanemanager.h" +#include "plugindialog.h" +#include "progressmanager/progressmanager_p.h" +#include "progressmanager/progressview.h" +#include "rightpane.h" +#include "statusbarmanager.h" +#include "systemsettings.h" +#include "vcsmanager.h" +#include "versiondialog.h" #include "windowsupport.h" #include <extensionsystem/pluginmanager.h> #include <utils/algorithm.h> #include <utils/appinfo.h> +#include <utils/checkablemessagebox.h> #include <utils/environment.h> #include <utils/fileutils.h> +#include <utils/fsengine/fileiconprovider.h> +#include <utils/fsengine/fsengine.h> +#include <utils/historycompleter.h> +#include <utils/hostosinfo.h> +#include <utils/mimeutils.h> +#include <utils/proxyaction.h> #include <utils/qtcassert.h> +#include <utils/stringutils.h> +#include <utils/stylehelper.h> +#include <utils/terminalcommand.h> +#include <utils/theme/theme.h> +#include <utils/touchbar/touchbar.h> +#include <utils/utilsicons.h> +#include <nanotrace/nanotrace.h> + +#include <QActionGroup> #include <QApplication> +#include <QCloseEvent> +#include <QColorDialog> +#include <QComboBox> #include <QDebug> +#include <QDialogButtonBox> #include <QLibraryInfo> +#include <QMenu> +#include <QMenuBar> +#include <QMessageBox> +#include <QPrinter> #include <QStandardPaths> +#include <QStatusBar> +#include <QStyleFactory> #include <QSysInfo> +#include <QTextBrowser> +#include <QTimer> +#include <QToolButton> +#include <QVersionNumber> + +#ifdef Q_OS_LINUX +#include <malloc.h> +#endif /*! \namespace Core @@ -127,7 +201,6 @@ #include "dialogs/newdialogwidget.h" #include "dialogs/newdialog.h" #include "iwizardfactory.h" -#include "mainwindow.h" #include "documentmanager.h" #include <utils/hostosinfo.h> @@ -146,7 +219,7 @@ using namespace Utils; namespace Core { // The Core Singleton -static ICore *m_instance = nullptr; +static ICore *m_core = nullptr; static MainWindow *m_mainwindow = nullptr; static NewDialog *defaultDialogFactory(QWidget *parent) @@ -154,6 +227,108 @@ static NewDialog *defaultDialogFactory(QWidget *parent) return new NewDialogWidget(parent); } +namespace Internal { + +class MainWindowPrivate : public QObject +{ +public: + explicit MainWindowPrivate(MainWindow *mainWindow) + : q(mainWindow) + {} + + ~MainWindowPrivate(); + + void init(); + + static void openFile(); + static IDocument *openFiles(const FilePaths &filePaths, ICore::OpenFilesFlags flags, + const FilePath &workingDirectory = {}); + void aboutToShowRecentFiles(); + + static void setFocusToEditor(); + void aboutQtCreator(); + void aboutPlugins(); + void changeLog(); + void contact(); + void updateFocusWidget(QWidget *old, QWidget *now); + NavigationWidget *navigationWidget(Side side) const; + void setSidebarVisible(bool visible, Side side); + void destroyVersionDialog(); + void openDroppedFiles(const QList<Utils::DropSupport::FileSpec> &files); + void restoreWindowState(); + + void openFileFromDevice(); + + void updateContextObject(const QList<IContext *> &context); + void updateContext(); + + void registerDefaultContainers(); + void registerDefaultActions(); + void registerModeSelectorStyleActions(); + + void readSettings(); + void saveWindowSettings(); + + void updateModeSelectorStyleMenu(); + + MainWindow *q = nullptr; + QTimer m_trimTimer; + QStringList m_aboutInformation; + Context m_highPrioAdditionalContexts; + Context m_lowPrioAdditionalContexts{Constants::C_GLOBAL}; + mutable QPrinter *m_printer = nullptr; + WindowSupport *m_windowSupport = nullptr; + EditorManager *m_editorManager = nullptr; + ExternalToolManager *m_externalToolManager = nullptr; + MessageManager *m_messageManager = nullptr; + ProgressManagerPrivate *m_progressManager = nullptr; + JsExpander *m_jsExpander = nullptr; + VcsManager *m_vcsManager = nullptr; + ModeManager *m_modeManager = nullptr; + FancyTabWidget *m_modeStack = nullptr; + NavigationWidget *m_leftNavigationWidget = nullptr; + NavigationWidget *m_rightNavigationWidget = nullptr; + RightPaneWidget *m_rightPaneWidget = nullptr; + VersionDialog *m_versionDialog = nullptr; + + QList<IContext *> m_activeContext; + + std::unordered_map<QWidget *, IContext *> m_contextWidgets; + + ShortcutSettings *m_shortcutSettings = nullptr; + ToolSettings *m_toolSettings = nullptr; + MimeTypeSettings *m_mimeTypeSettings = nullptr; + SystemEditor *m_systemEditor = nullptr; + + // actions + QAction *m_focusToEditor = nullptr; + QAction *m_newAction = nullptr; + QAction *m_openAction = nullptr; + QAction *m_openWithAction = nullptr; + QAction *m_openFromDeviceAction = nullptr; + QAction *m_saveAllAction = nullptr; + QAction *m_exitAction = nullptr; + QAction *m_optionsAction = nullptr; + QAction *m_loggerAction = nullptr; + QAction *m_toggleLeftSideBarAction = nullptr; + QAction *m_toggleRightSideBarAction = nullptr; + QAction *m_toggleMenubarAction = nullptr; + QAction *m_cycleModeSelectorStyleAction = nullptr; + QAction *m_setModeSelectorStyleIconsAndTextAction = nullptr; + QAction *m_setModeSelectorStyleHiddenAction = nullptr; + QAction *m_setModeSelectorStyleIconsOnlyAction = nullptr; + QAction *m_themeAction = nullptr; + + QToolButton *m_toggleLeftSideBarButton = nullptr; + QToolButton *m_toggleRightSideBarButton = nullptr; + QColor m_overrideColor; + QList<std::function<bool()>> m_preCloseListeners; +}; + +} // Internal + +static MainWindowPrivate *d = nullptr; + static std::function<NewDialog *(QWidget *)> m_newDialogFactory = defaultDialogFactory; /*! @@ -161,7 +336,7 @@ static std::function<NewDialog *(QWidget *)> m_newDialogFactory = defaultDialogF */ ICore *ICore::instance() { - return m_instance; + return m_core; } /*! @@ -188,10 +363,9 @@ QWidget *ICore::newItemDialog() /*! \internal */ -ICore::ICore(MainWindow *mainwindow) +ICore::ICore() { - m_instance = this; - m_mainwindow = mainwindow; + m_core = this; connect(PluginManager::instance(), &PluginManager::testsFinished, this, [this](int failedTests) { @@ -206,7 +380,7 @@ ICore::ICore(MainWindow *mainwindow) QCoreApplication::exit(exitCode); }); - FileUtils::setDialogParentGetter(&ICore::dialogParent); + Utils::FileUtils::setDialogParentGetter(&ICore::dialogParent); } /*! @@ -214,7 +388,7 @@ ICore::ICore(MainWindow *mainwindow) */ ICore::~ICore() { - m_instance = nullptr; + m_core = nullptr; m_mainwindow = nullptr; } @@ -257,7 +431,7 @@ void ICore::showNewItemDialog(const QString &title, dialogFactory = defaultDialogFactory; NewDialog *newDialog = dialogFactory(dialogParent()); - connect(newDialog->widget(), &QObject::destroyed, m_instance, &ICore::updateNewItemDialogState); + connect(newDialog->widget(), &QObject::destroyed, m_core, &ICore::updateNewItemDialogState); newDialog->setWizardFactories(factories, defaultLocation, extraVariables); newDialog->setWindowTitle(title); newDialog->showDialog(); @@ -908,7 +1082,7 @@ void ICore::restart() */ void ICore::saveSettings(SaveSettingsReason reason) { - emit m_instance->saveSettingsRequested(reason); + emit m_core->saveSettingsRequested(reason); m_mainwindow->saveSettings(); ICore::settings(QSettings::SystemScope)->sync(); @@ -958,4 +1132,1480 @@ void ICore::setNewDialogFactory(const std::function<NewDialog *(QWidget *)> &new m_newDialogFactory = newFactory; } + +namespace Internal { + +const char settingsGroup[] = "MainWindow"; +const char colorKey[] = "Color"; +const char windowGeometryKey[] = "WindowGeometry"; +const char windowStateKey[] = "WindowState"; +const char modeSelectorLayoutKey[] = "ModeSelectorLayout"; +const char menubarVisibleKey[] = "MenubarVisible"; + +static bool hideToolsMenu() +{ + return Core::ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_TOOLS, false).toBool(); +} + +enum { debugMainWindow = 0 }; + + +void MainWindowPrivate::init() +{ + m_core = new ICore; + m_progressManager = new ProgressManagerPrivate; + m_jsExpander = JsExpander::createGlobalJsExpander(); + m_vcsManager = new VcsManager; + m_modeStack = new FancyTabWidget(q); + m_shortcutSettings = new ShortcutSettings; + m_toolSettings = new ToolSettings; + m_mimeTypeSettings = new MimeTypeSettings; + m_systemEditor = new SystemEditor; + m_toggleLeftSideBarButton = new QToolButton; + m_toggleRightSideBarButton = new QToolButton; + + (void) new DocumentManager(q); + + HistoryCompleter::setSettings(PluginManager::settings()); + + if (HostOsInfo::isLinuxHost()) + QApplication::setWindowIcon(Icons::QTCREATORLOGO_BIG.icon()); + QString baseName = QApplication::style()->objectName(); + // Sometimes we get the standard windows 95 style as a fallback + if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost() + && baseName == QLatin1String("windows")) { + baseName = QLatin1String("fusion"); + } + + // if the user has specified as base style in the theme settings, + // prefer that + const QStringList available = QStyleFactory::keys(); + const QStringList styles = Utils::creatorTheme()->preferredStyles(); + for (const QString &s : styles) { + if (available.contains(s, Qt::CaseInsensitive)) { + baseName = s; + break; + } + } + + QApplication::setStyle(new ManhattanStyle(baseName)); + + m_modeManager = new ModeManager(q, m_modeStack); + connect(m_modeStack, &FancyTabWidget::topAreaClicked, this, [](Qt::MouseButton, Qt::KeyboardModifiers modifiers) { + if (modifiers & Qt::ShiftModifier) { + QColor color = QColorDialog::getColor(StyleHelper::requestedBaseColor(), ICore::dialogParent()); + if (color.isValid()) + StyleHelper::setBaseColor(color); + } + }); + + registerDefaultContainers(); + registerDefaultActions(); + + m_leftNavigationWidget = new NavigationWidget(m_toggleLeftSideBarAction, Side::Left); + m_rightNavigationWidget = new NavigationWidget(m_toggleRightSideBarAction, Side::Right); + m_rightPaneWidget = new RightPaneWidget(); + + m_messageManager = new MessageManager; + m_editorManager = new EditorManager(this); + m_externalToolManager = new ExternalToolManager(); + + m_progressManager->progressView()->setParent(q); + + connect(qApp, &QApplication::focusChanged, this, &MainWindowPrivate::updateFocusWidget); + + // Add small Toolbuttons for toggling the navigation widgets + StatusBarManager::addStatusBarWidget(m_toggleLeftSideBarButton, StatusBarManager::First); + int childsCount = q->statusBar()->findChildren<QWidget *>(QString(), Qt::FindDirectChildrenOnly).count(); + q->statusBar()->insertPermanentWidget(childsCount - 1, m_toggleRightSideBarButton); // before QSizeGrip + +// setUnifiedTitleAndToolBarOnMac(true); + //if (HostOsInfo::isAnyUnixHost()) + //signal(SIGINT, handleSigInt); + + q->statusBar()->setProperty("p_styled", true); + + /*auto dropSupport = new DropSupport(this, [](QDropEvent *event, DropSupport *) { + return event->source() == nullptr; // only accept drops from the "outside" (e.g. file manager) + }); + connect(dropSupport, &DropSupport::filesDropped, + this, &MainWindow::openDroppedFiles); +*/ + if (HostOsInfo::isLinuxHost()) { + m_trimTimer.setSingleShot(true); + m_trimTimer.setInterval(60000); + // glibc may not actually free memory in free(). +#ifdef Q_OS_LINUX + connect(&m_trimTimer, &QTimer::timeout, this, [] { malloc_trim(0); }); +#endif + } +} + +MainWindow::MainWindow() +{ + m_mainwindow = this; + d = new MainWindowPrivate(this); + d->init(); // Separation needed for now as the call triggers other MainWindow calls. + + setWindowTitle(QGuiApplication::applicationDisplayName()); + setDockNestingEnabled(true); + setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); + setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea); + + setCentralWidget(d->m_modeStack); +} + +NavigationWidget *MainWindowPrivate::navigationWidget(Side side) const +{ + return side == Side::Left ? m_leftNavigationWidget : m_rightNavigationWidget; +} + +void MainWindowPrivate::setSidebarVisible(bool visible, Side side) +{ + if (NavigationWidgetPlaceHolder::current(side)) + navigationWidget(side)->setShown(visible); +} + +void MainWindow::setOverrideColor(const QColor &color) +{ + d->m_overrideColor = color; +} + +QStringList MainWindow::additionalAboutInformation() const +{ + return d->m_aboutInformation; +} + +void MainWindow::clearAboutInformation() +{ + d->m_aboutInformation.clear(); +} + +void MainWindow::appendAboutInformation(const QString &line) +{ + d->m_aboutInformation.append(line); +} + +void MainWindow::addPreCloseListener(const std::function<bool ()> &listener) +{ + d->m_preCloseListeners.append(listener); +} + +MainWindow::~MainWindow() +{ + delete d; + d = nullptr; +} + +MainWindowPrivate::~MainWindowPrivate() +{ + // explicitly delete window support, because that calls methods from ICore that call methods + // from mainwindow, so mainwindow still needs to be alive + delete m_windowSupport; + m_windowSupport = nullptr; + + delete m_externalToolManager; + m_externalToolManager = nullptr; + delete m_messageManager; + m_messageManager = nullptr; + delete m_shortcutSettings; + m_shortcutSettings = nullptr; + delete m_toolSettings; + m_toolSettings = nullptr; + delete m_mimeTypeSettings; + m_mimeTypeSettings = nullptr; + delete m_systemEditor; + m_systemEditor = nullptr; + delete m_printer; + m_printer = nullptr; + delete m_vcsManager; + m_vcsManager = nullptr; + //we need to delete editormanager and statusbarmanager explicitly before the end of the destructor, + //because they might trigger stuff that tries to access data from editorwindow, like removeContextWidget + + // All modes are now gone + OutputPaneManager::destroy(); + + delete m_leftNavigationWidget; + delete m_rightNavigationWidget; + m_leftNavigationWidget = nullptr; + m_rightNavigationWidget = nullptr; + + delete m_editorManager; + m_editorManager = nullptr; + delete m_progressManager; + m_progressManager = nullptr; + + delete m_core; + m_core = nullptr; + + delete m_rightPaneWidget; + m_rightPaneWidget = nullptr; + + delete m_modeManager; + m_modeManager = nullptr; + + delete m_jsExpander; + m_jsExpander = nullptr; +} + +void MainWindow::init() +{ + d->m_progressManager->init(); // needs the status bar manager + MessageManager::init(); + OutputPaneManager::create(); +} + +void MainWindow::extensionsInitialized() +{ + EditorManagerPrivate::extensionsInitialized(); + MimeTypeSettings::restoreSettings(); + d->m_windowSupport = new WindowSupport(this, Context("Core.MainWindow")); + d->m_windowSupport->setCloseActionEnabled(false); + OutputPaneManager::initialize(); + VcsManager::extensionsInitialized(); + d->m_leftNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories()); + d->m_rightNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories()); + + ModeManager::extensionsInitialized(); + + d->readSettings(); + d->updateContext(); + + emit m_core->coreAboutToOpen(); + // Delay restoreWindowState, since it is overridden by LayoutRequest event + QMetaObject::invokeMethod(d, &MainWindowPrivate::restoreWindowState, Qt::QueuedConnection); + QMetaObject::invokeMethod(m_core, &ICore::coreOpened, Qt::QueuedConnection); +} + +static void setRestart(bool restart) +{ + qApp->setProperty("restart", restart); +} + +void MainWindow::restart() +{ + setRestart(true); + exit(); +} + +void MainWindow::restartTrimmer() +{ + if (HostOsInfo::isLinuxHost() && !d->m_trimTimer.isActive()) + d->m_trimTimer.start(); +} + +void MainWindow::closeEvent(QCloseEvent *event) +{ + const auto cancelClose = [event] { + event->ignore(); + setRestart(false); + }; + + // work around QTBUG-43344 + static bool alreadyClosed = false; + if (alreadyClosed) { + event->accept(); + return; + } + + if (systemSettings().askBeforeExit() + && (QMessageBox::question(this, + Tr::tr("Exit %1?").arg(QGuiApplication::applicationDisplayName()), + Tr::tr("Exit %1?").arg(QGuiApplication::applicationDisplayName()), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::No) + == QMessageBox::No)) { + event->ignore(); + return; + } + + ICore::saveSettings(ICore::MainWindowClosing); + + // Save opened files + if (!DocumentManager::saveAllModifiedDocuments()) { + cancelClose(); + return; + } + + const QList<std::function<bool()>> listeners = d->m_preCloseListeners; + for (const std::function<bool()> &listener : listeners) { + if (!listener()) { + cancelClose(); + return; + } + } + + emit m_core->coreAboutToClose(); + + d->saveWindowSettings(); + + d->m_leftNavigationWidget->closeSubWidgets(); + d->m_rightNavigationWidget->closeSubWidgets(); + + event->accept(); + alreadyClosed = true; +} + +void MainWindow::keyPressEvent(QKeyEvent *event) +{ + restartTrimmer(); + AppMainWindow::keyPressEvent(event); +} + +void MainWindow::mousePressEvent(QMouseEvent *event) +{ + restartTrimmer(); + AppMainWindow::mousePressEvent(event); +} + +void MainWindowPrivate::openDroppedFiles(const QList<DropSupport::FileSpec> &files) +{ + q->raiseWindow(); + const FilePaths filePaths = Utils::transform(files, &DropSupport::FileSpec::filePath); + q->openFiles(filePaths, ICore::SwitchMode); +} + +IContext *MainWindow::currentContextObject() const +{ + return d->m_activeContext.isEmpty() ? nullptr : d->m_activeContext.first(); +} + +QStatusBar *MainWindow::statusBar() const +{ + return d->m_modeStack->statusBar(); +} + +InfoBar *MainWindow::infoBar() const +{ + return d->m_modeStack->infoBar(); +} + +void MainWindowPrivate::registerDefaultContainers() +{ + ActionContainer *menubar = ActionManager::createMenuBar(Constants::MENU_BAR); + + if (!HostOsInfo::isMacHost()) // System menu bar on Mac + q->setMenuBar(menubar->menuBar()); + menubar->appendGroup(Constants::G_FILE); + menubar->appendGroup(Constants::G_EDIT); + menubar->appendGroup(Constants::G_VIEW); + menubar->appendGroup(Constants::G_TOOLS); + menubar->appendGroup(Constants::G_WINDOW); + menubar->appendGroup(Constants::G_HELP); + + // File Menu + ActionContainer *filemenu = ActionManager::createMenu(Constants::M_FILE); + menubar->addMenu(filemenu, Constants::G_FILE); + filemenu->menu()->setTitle(Tr::tr("&File")); + filemenu->appendGroup(Constants::G_FILE_NEW); + filemenu->appendGroup(Constants::G_FILE_OPEN); + filemenu->appendGroup(Constants::G_FILE_SESSION); + filemenu->appendGroup(Constants::G_FILE_PROJECT); + filemenu->appendGroup(Constants::G_FILE_SAVE); + filemenu->appendGroup(Constants::G_FILE_EXPORT); + filemenu->appendGroup(Constants::G_FILE_CLOSE); + filemenu->appendGroup(Constants::G_FILE_PRINT); + filemenu->appendGroup(Constants::G_FILE_OTHER); + connect(filemenu->menu(), &QMenu::aboutToShow, this, &MainWindowPrivate::aboutToShowRecentFiles); + + + // Edit Menu + ActionContainer *medit = ActionManager::createMenu(Constants::M_EDIT); + menubar->addMenu(medit, Constants::G_EDIT); + medit->menu()->setTitle(Tr::tr("&Edit")); + medit->appendGroup(Constants::G_EDIT_UNDOREDO); + medit->appendGroup(Constants::G_EDIT_COPYPASTE); + medit->appendGroup(Constants::G_EDIT_SELECTALL); + medit->appendGroup(Constants::G_EDIT_ADVANCED); + medit->appendGroup(Constants::G_EDIT_FIND); + medit->appendGroup(Constants::G_EDIT_OTHER); + + ActionContainer *mview = ActionManager::createMenu(Constants::M_VIEW); + menubar->addMenu(mview, Constants::G_VIEW); + mview->menu()->setTitle(Tr::tr("&View")); + mview->appendGroup(Constants::G_VIEW_VIEWS); + mview->appendGroup(Constants::G_VIEW_PANES); + + // Tools Menu + ActionContainer *ac = ActionManager::createMenu(Constants::M_TOOLS); + ac->setParent(this); + if (!hideToolsMenu()) + menubar->addMenu(ac, Constants::G_TOOLS); + + ac->menu()->setTitle(Tr::tr("&Tools")); + + // Window Menu + ActionContainer *mwindow = ActionManager::createMenu(Constants::M_WINDOW); + menubar->addMenu(mwindow, Constants::G_WINDOW); + mwindow->menu()->setTitle(Tr::tr("&Window")); + mwindow->appendGroup(Constants::G_WINDOW_SIZE); + mwindow->appendGroup(Constants::G_WINDOW_SPLIT); + mwindow->appendGroup(Constants::G_WINDOW_NAVIGATE); + mwindow->appendGroup(Constants::G_WINDOW_LIST); + mwindow->appendGroup(Constants::G_WINDOW_OTHER); + + // Help Menu + ac = ActionManager::createMenu(Constants::M_HELP); + menubar->addMenu(ac, Constants::G_HELP); + ac->menu()->setTitle(Tr::tr("&Help")); + Theme::setHelpMenu(ac->menu()); + ac->appendGroup(Constants::G_HELP_HELP); + ac->appendGroup(Constants::G_HELP_SUPPORT); + ac->appendGroup(Constants::G_HELP_ABOUT); + ac->appendGroup(Constants::G_HELP_UPDATES); + + // macOS touch bar + ac = ActionManager::createTouchBar(Constants::TOUCH_BAR, + QIcon(), + "Main TouchBar" /*never visible*/); + ac->appendGroup(Constants::G_TOUCHBAR_HELP); + ac->appendGroup(Constants::G_TOUCHBAR_NAVIGATION); + ac->appendGroup(Constants::G_TOUCHBAR_EDITOR); + ac->appendGroup(Constants::G_TOUCHBAR_OTHER); + ac->touchBar()->setApplicationTouchBar(); +} + +static QMenuBar *globalMenuBar() +{ + return ActionManager::actionContainer(Constants::MENU_BAR)->menuBar(); +} + +void MainWindowPrivate::registerDefaultActions() +{ + ActionContainer *mfile = ActionManager::actionContainer(Constants::M_FILE); + ActionContainer *medit = ActionManager::actionContainer(Constants::M_EDIT); + ActionContainer *mview = ActionManager::actionContainer(Constants::M_VIEW); + ActionContainer *mtools = ActionManager::actionContainer(Constants::M_TOOLS); + ActionContainer *mwindow = ActionManager::actionContainer(Constants::M_WINDOW); + ActionContainer *mhelp = ActionManager::actionContainer(Constants::M_HELP); + + // File menu separators + mfile->addSeparator(Constants::G_FILE_SAVE); + mfile->addSeparator(Constants::G_FILE_EXPORT); + mfile->addSeparator(Constants::G_FILE_PRINT); + mfile->addSeparator(Constants::G_FILE_CLOSE); + mfile->addSeparator(Constants::G_FILE_OTHER); + // Edit menu separators + medit->addSeparator(Constants::G_EDIT_COPYPASTE); + medit->addSeparator(Constants::G_EDIT_SELECTALL); + medit->addSeparator(Constants::G_EDIT_FIND); + medit->addSeparator(Constants::G_EDIT_ADVANCED); + + // Return to editor shortcut: Note this requires Qt to fix up + // handling of shortcut overrides in menus, item views, combos.... + m_focusToEditor = new QAction(Tr::tr("Return to Editor"), this); + Command *cmd = ActionManager::registerAction(m_focusToEditor, Constants::S_RETURNTOEDITOR); + cmd->setDefaultKeySequence(QKeySequence(Qt::Key_Escape)); + connect(m_focusToEditor, &QAction::triggered, this, &MainWindowPrivate::setFocusToEditor); + + // New File Action + QIcon icon = Icon::fromTheme("document-new"); + + m_newAction = new QAction(icon, Tr::tr("&New Project..."), this); + cmd = ActionManager::registerAction(m_newAction, Constants::NEW); + cmd->setDefaultKeySequence(QKeySequence("Ctrl+Shift+N")); + mfile->addAction(cmd, Constants::G_FILE_NEW); + connect(m_newAction, &QAction::triggered, this, [] { + if (!ICore::isNewItemDialogRunning()) { + ICore::showNewItemDialog( + Tr::tr("New Project", "Title of dialog"), + Utils::filtered(Core::IWizardFactory::allWizardFactories(), + Utils::equal(&Core::IWizardFactory::kind, + Core::IWizardFactory::ProjectWizard)), + FilePath()); + } else { + ICore::raiseWindow(ICore::newItemDialog()); + } + }); + + auto action = new QAction(icon, Tr::tr("New File..."), this); + cmd = ActionManager::registerAction(action, Constants::NEW_FILE); + cmd->setDefaultKeySequence(QKeySequence::New); + mfile->addAction(cmd, Constants::G_FILE_NEW); + connect(action, &QAction::triggered, this, [] { + if (!ICore::isNewItemDialogRunning()) { + ICore::showNewItemDialog(Tr::tr("New File", "Title of dialog"), + Utils::filtered(Core::IWizardFactory::allWizardFactories(), + Utils::equal(&Core::IWizardFactory::kind, + Core::IWizardFactory::FileWizard)), + FilePath()); + } else { + ICore::raiseWindow(ICore::newItemDialog()); + } + }); + + // Open Action + icon = Icon::fromTheme("document-open"); + m_openAction = new QAction(icon, Tr::tr("&Open File or Project..."), this); + cmd = ActionManager::registerAction(m_openAction, Constants::OPEN); + cmd->setDefaultKeySequence(QKeySequence::Open); + mfile->addAction(cmd, Constants::G_FILE_OPEN); + connect(m_openAction, &QAction::triggered, this, &MainWindowPrivate::openFile); + + // Open With Action + m_openWithAction = new QAction(Tr::tr("Open File &With..."), this); + cmd = ActionManager::registerAction(m_openWithAction, Constants::OPEN_WITH); + mfile->addAction(cmd, Constants::G_FILE_OPEN); + connect(m_openWithAction, &QAction::triggered, this, &MainWindow::openFileWith); + + if (FSEngine::isAvailable()) { + // Open From Device Action + m_openFromDeviceAction = new QAction(Tr::tr("Open From Device..."), this); + cmd = ActionManager::registerAction(m_openFromDeviceAction, Constants::OPEN_FROM_DEVICE); + mfile->addAction(cmd, Constants::G_FILE_OPEN); + connect(m_openFromDeviceAction, &QAction::triggered, this, &MainWindowPrivate::openFileFromDevice); + } + + // File->Recent Files Menu + ActionContainer *ac = ActionManager::createMenu(Constants::M_FILE_RECENTFILES); + mfile->addMenu(ac, Constants::G_FILE_OPEN); + ac->menu()->setTitle(Tr::tr("Recent &Files")); + ac->setOnAllDisabledBehavior(ActionContainer::Show); + + // Save Action + icon = Icon::fromTheme("document-save"); + QAction *tmpaction = new QAction(icon, Tr::tr("&Save"), this); + tmpaction->setEnabled(false); + cmd = ActionManager::registerAction(tmpaction, Constants::SAVE); + cmd->setDefaultKeySequence(QKeySequence::Save); + cmd->setAttribute(Command::CA_UpdateText); + cmd->setDescription(Tr::tr("Save")); + mfile->addAction(cmd, Constants::G_FILE_SAVE); + + // Save As Action + icon = Icon::fromTheme("document-save-as"); + tmpaction = new QAction(icon, Tr::tr("Save &As..."), this); + tmpaction->setEnabled(false); + cmd = ActionManager::registerAction(tmpaction, Constants::SAVEAS); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Shift+S") : QString())); + cmd->setAttribute(Command::CA_UpdateText); + cmd->setDescription(Tr::tr("Save As...")); + mfile->addAction(cmd, Constants::G_FILE_SAVE); + + // SaveAll Action + DocumentManager::registerSaveAllAction(); + + // Print Action + icon = Icon::fromTheme("document-print"); + tmpaction = new QAction(icon, Tr::tr("&Print..."), this); + tmpaction->setEnabled(false); + cmd = ActionManager::registerAction(tmpaction, Constants::PRINT); + cmd->setDefaultKeySequence(QKeySequence::Print); + mfile->addAction(cmd, Constants::G_FILE_PRINT); + + // Exit Action + icon = Icon::fromTheme("application-exit"); + m_exitAction = new QAction(icon, Tr::tr("E&xit"), this); + m_exitAction->setMenuRole(QAction::QuitRole); + cmd = ActionManager::registerAction(m_exitAction, Constants::EXIT); + cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Q"))); + mfile->addAction(cmd, Constants::G_FILE_OTHER); + connect(m_exitAction, &QAction::triggered, q, &MainWindow::exit); + + // Undo Action + icon = Icon::fromTheme("edit-undo"); + tmpaction = new QAction(icon, Tr::tr("&Undo"), this); + cmd = ActionManager::registerAction(tmpaction, Constants::UNDO); + cmd->setDefaultKeySequence(QKeySequence::Undo); + cmd->setAttribute(Command::CA_UpdateText); + cmd->setDescription(Tr::tr("Undo")); + medit->addAction(cmd, Constants::G_EDIT_UNDOREDO); + tmpaction->setEnabled(false); + + // Redo Action + icon = Icon::fromTheme("edit-redo"); + tmpaction = new QAction(icon, Tr::tr("&Redo"), this); + cmd = ActionManager::registerAction(tmpaction, Constants::REDO); + cmd->setDefaultKeySequence(QKeySequence::Redo); + cmd->setAttribute(Command::CA_UpdateText); + cmd->setDescription(Tr::tr("Redo")); + medit->addAction(cmd, Constants::G_EDIT_UNDOREDO); + tmpaction->setEnabled(false); + + // Cut Action + icon = Icon::fromTheme("edit-cut"); + tmpaction = new QAction(icon, Tr::tr("Cu&t"), this); + cmd = ActionManager::registerAction(tmpaction, Constants::CUT); + cmd->setDefaultKeySequence(QKeySequence::Cut); + medit->addAction(cmd, Constants::G_EDIT_COPYPASTE); + tmpaction->setEnabled(false); + + // Copy Action + icon = Icon::fromTheme("edit-copy"); + tmpaction = new QAction(icon, Tr::tr("&Copy"), this); + cmd = ActionManager::registerAction(tmpaction, Constants::COPY); + cmd->setDefaultKeySequence(QKeySequence::Copy); + medit->addAction(cmd, Constants::G_EDIT_COPYPASTE); + tmpaction->setEnabled(false); + + // Paste Action + icon = Icon::fromTheme("edit-paste"); + tmpaction = new QAction(icon, Tr::tr("&Paste"), this); + cmd = ActionManager::registerAction(tmpaction, Constants::PASTE); + cmd->setDefaultKeySequence(QKeySequence::Paste); + medit->addAction(cmd, Constants::G_EDIT_COPYPASTE); + tmpaction->setEnabled(false); + + // Select All + icon = Icon::fromTheme("edit-select-all"); + tmpaction = new QAction(icon, Tr::tr("Select &All"), this); + cmd = ActionManager::registerAction(tmpaction, Constants::SELECTALL); + cmd->setDefaultKeySequence(QKeySequence::SelectAll); + medit->addAction(cmd, Constants::G_EDIT_SELECTALL); + tmpaction->setEnabled(false); + + // Goto Action + icon = Icon::fromTheme("go-jump"); + tmpaction = new QAction(icon, Tr::tr("&Go to Line..."), this); + cmd = ActionManager::registerAction(tmpaction, Constants::GOTO); + cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+L"))); + medit->addAction(cmd, Constants::G_EDIT_OTHER); + tmpaction->setEnabled(false); + + // Zoom In Action + icon = Icon::fromTheme("zoom-in"); + tmpaction = new QAction(icon, Tr::tr("Zoom In"), this); + cmd = ActionManager::registerAction(tmpaction, Constants::ZOOM_IN); + cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl++"))); + tmpaction->setEnabled(false); + + // Zoom Out Action + icon = Icon::fromTheme("zoom-out"); + tmpaction = new QAction(icon, Tr::tr("Zoom Out"), this); + cmd = ActionManager::registerAction(tmpaction, Constants::ZOOM_OUT); + if (useMacShortcuts) + cmd->setDefaultKeySequences({QKeySequence(Tr::tr("Ctrl+-")), QKeySequence(Tr::tr("Ctrl+Shift+-"))}); + else + cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+-"))); + tmpaction->setEnabled(false); + + // Zoom Reset Action + icon = Icon::fromTheme("zoom-original"); + tmpaction = new QAction(icon, Tr::tr("Original Size"), this); + cmd = ActionManager::registerAction(tmpaction, Constants::ZOOM_RESET); + cmd->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+0") : Tr::tr("Ctrl+0"))); + tmpaction->setEnabled(false); + + // Debug Qt Creator menu + mtools->appendGroup(Constants::G_TOOLS_DEBUG); + ActionContainer *mtoolsdebug = ActionManager::createMenu(Constants::M_TOOLS_DEBUG); + mtoolsdebug->menu()->setTitle(Tr::tr("Debug %1").arg(QGuiApplication::applicationDisplayName())); + mtools->addMenu(mtoolsdebug, Constants::G_TOOLS_DEBUG); + + m_loggerAction = new QAction(Tr::tr("Show Logs..."), this); + cmd = ActionManager::registerAction(m_loggerAction, Constants::LOGGER); + mtoolsdebug->addAction(cmd); + connect(m_loggerAction, &QAction::triggered, this, [] { LoggingViewer::showLoggingView(); }); + + // Options Action + medit->appendGroup(Constants::G_EDIT_PREFERENCES); + medit->addSeparator(Constants::G_EDIT_PREFERENCES); + + m_optionsAction = new QAction(Tr::tr("Pr&eferences..."), this); + m_optionsAction->setMenuRole(QAction::PreferencesRole); + cmd = ActionManager::registerAction(m_optionsAction, Constants::OPTIONS); + cmd->setDefaultKeySequence(QKeySequence::Preferences); + medit->addAction(cmd, Constants::G_EDIT_PREFERENCES); + connect(m_optionsAction, &QAction::triggered, this, [] { ICore::showOptionsDialog(Id()); }); + + mwindow->addSeparator(Constants::G_WINDOW_LIST); + + if (useMacShortcuts) { + // Minimize Action + QAction *minimizeAction = new QAction(Tr::tr("Minimize"), this); + minimizeAction->setEnabled(false); // actual implementation in WindowSupport + cmd = ActionManager::registerAction(minimizeAction, Constants::MINIMIZE_WINDOW); + cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+M"))); + mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); + + // Zoom Action + QAction *zoomAction = new QAction(Tr::tr("Zoom"), this); + zoomAction->setEnabled(false); // actual implementation in WindowSupport + cmd = ActionManager::registerAction(zoomAction, Constants::ZOOM_WINDOW); + mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); + } + + // Full Screen Action + QAction *toggleFullScreenAction = new QAction(Tr::tr("Full Screen"), this); + toggleFullScreenAction->setCheckable(!HostOsInfo::isMacHost()); + toggleFullScreenAction->setEnabled(false); // actual implementation in WindowSupport + cmd = ActionManager::registerAction(toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Meta+F") : Tr::tr("Ctrl+Shift+F11"))); + if (HostOsInfo::isMacHost()) + cmd->setAttribute(Command::CA_UpdateText); + mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); + + if (useMacShortcuts) { + mwindow->addSeparator(Constants::G_WINDOW_SIZE); + + QAction *closeAction = new QAction(Tr::tr("Close Window"), this); + closeAction->setEnabled(false); + cmd = ActionManager::registerAction(closeAction, Constants::CLOSE_WINDOW); + cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Meta+W"))); + mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); + + mwindow->addSeparator(Constants::G_WINDOW_SIZE); + } + + // Show Left Sidebar Action + m_toggleLeftSideBarAction = new QAction(Utils::Icons::TOGGLE_LEFT_SIDEBAR.icon(), + Tr::tr(Constants::TR_SHOW_LEFT_SIDEBAR), + this); + m_toggleLeftSideBarAction->setCheckable(true); + cmd = ActionManager::registerAction(m_toggleLeftSideBarAction, Constants::TOGGLE_LEFT_SIDEBAR); + cmd->setAttribute(Command::CA_UpdateText); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+0") : Tr::tr("Alt+0"))); + connect(m_toggleLeftSideBarAction, &QAction::triggered, + this, [this](bool visible) { setSidebarVisible(visible, Side::Left); }); + ProxyAction *toggleLeftSideBarProxyAction = + ProxyAction::proxyActionWithIcon(cmd->action(), Utils::Icons::TOGGLE_LEFT_SIDEBAR_TOOLBAR.icon()); + m_toggleLeftSideBarButton->setDefaultAction(toggleLeftSideBarProxyAction); + mview->addAction(cmd, Constants::G_VIEW_VIEWS); + m_toggleLeftSideBarAction->setEnabled(false); + + // Show Right Sidebar Action + m_toggleRightSideBarAction = new QAction(Utils::Icons::TOGGLE_RIGHT_SIDEBAR.icon(), + Tr::tr(Constants::TR_SHOW_RIGHT_SIDEBAR), + this); + m_toggleRightSideBarAction->setCheckable(true); + cmd = ActionManager::registerAction(m_toggleRightSideBarAction, Constants::TOGGLE_RIGHT_SIDEBAR); + cmd->setAttribute(Command::CA_UpdateText); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Shift+0") : Tr::tr("Alt+Shift+0"))); + connect(m_toggleRightSideBarAction, &QAction::triggered, + this, [this](bool visible) { setSidebarVisible(visible, Side::Right); }); + ProxyAction *toggleRightSideBarProxyAction = + ProxyAction::proxyActionWithIcon(cmd->action(), Utils::Icons::TOGGLE_RIGHT_SIDEBAR_TOOLBAR.icon()); + m_toggleRightSideBarButton->setDefaultAction(toggleRightSideBarProxyAction); + mview->addAction(cmd, Constants::G_VIEW_VIEWS); + m_toggleRightSideBarButton->setEnabled(false); + + // Show Menubar Action + if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) { + m_toggleMenubarAction = new QAction(Tr::tr("Show Menubar"), this); + m_toggleMenubarAction->setCheckable(true); + cmd = ActionManager::registerAction(m_toggleMenubarAction, Constants::TOGGLE_MENUBAR); + cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Alt+M"))); + connect(m_toggleMenubarAction, &QAction::toggled, this, [cmd](bool visible) { + if (!visible) { + CheckableMessageBox::information( + Core::ICore::dialogParent(), + Tr::tr("Hide Menubar"), + Tr::tr( + "This will hide the menu bar completely. You can show it again by typing ") + + cmd->keySequence().toString(QKeySequence::NativeText), + QString("ToogleMenuBarHint")); + } + globalMenuBar()->setVisible(visible); + }); + mview->addAction(cmd, Constants::G_VIEW_VIEWS); + } + + registerModeSelectorStyleActions(); + + // Window->Views + ActionContainer *mviews = ActionManager::createMenu(Constants::M_VIEW_VIEWS); + mview->addMenu(mviews, Constants::G_VIEW_VIEWS); + mviews->menu()->setTitle(Tr::tr("&Views")); + + // "Help" separators + mhelp->addSeparator(Constants::G_HELP_SUPPORT); + if (!HostOsInfo::isMacHost()) + mhelp->addSeparator(Constants::G_HELP_ABOUT); + + // About IDE Action + icon = Icon::fromTheme("help-about"); + if (HostOsInfo::isMacHost()) + tmpaction = new QAction(icon, + Tr::tr("About &%1").arg(QGuiApplication::applicationDisplayName()), + this); // it's convention not to add dots to the about menu + else + tmpaction + = new QAction(icon, + Tr::tr("About &%1...").arg(QGuiApplication::applicationDisplayName()), + this); + tmpaction->setMenuRole(QAction::AboutRole); + cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_QTCREATOR); + mhelp->addAction(cmd, Constants::G_HELP_ABOUT); + tmpaction->setEnabled(true); + connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::aboutQtCreator); + + //About Plugins Action + tmpaction = new QAction(Tr::tr("About &Plugins..."), this); + tmpaction->setMenuRole(QAction::ApplicationSpecificRole); + cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_PLUGINS); + mhelp->addAction(cmd, Constants::G_HELP_ABOUT); + tmpaction->setEnabled(true); + connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::aboutPlugins); + // About Qt Action + // tmpaction = new QAction(Tr::tr("About &Qt..."), this); + // cmd = ActionManager::registerAction(tmpaction, Constants:: ABOUT_QT); + // mhelp->addAction(cmd, Constants::G_HELP_ABOUT); + // tmpaction->setEnabled(true); + // connect(tmpaction, &QAction::triggered, qApp, &QApplication::aboutQt); + + // Change Log Action + tmpaction = new QAction(Tr::tr("Change Log..."), this); + tmpaction->setMenuRole(QAction::ApplicationSpecificRole); + cmd = ActionManager::registerAction(tmpaction, Constants::CHANGE_LOG); + mhelp->addAction(cmd, Constants::G_HELP_ABOUT); + tmpaction->setEnabled(true); + connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::changeLog); + + // Contact + tmpaction = new QAction(Tr::tr("Contact..."), this); + cmd = ActionManager::registerAction(tmpaction, "QtCreator.Contact"); + mhelp->addAction(cmd, Constants::G_HELP_ABOUT); + tmpaction->setEnabled(true); + connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::contact); + + // About sep + if (!HostOsInfo::isMacHost()) { // doesn't have the "About" actions in the Help menu + tmpaction = new QAction(this); + tmpaction->setSeparator(true); + cmd = ActionManager::registerAction(tmpaction, "QtCreator.Help.Sep.About"); + mhelp->addAction(cmd, Constants::G_HELP_ABOUT); + } +} + +void MainWindowPrivate::registerModeSelectorStyleActions() +{ + ActionContainer *mview = ActionManager::actionContainer(Constants::M_VIEW); + + // Cycle Mode Selector Styles + m_cycleModeSelectorStyleAction = new QAction(Tr::tr("Cycle Mode Selector Styles"), this); + ActionManager::registerAction(m_cycleModeSelectorStyleAction, Constants::CYCLE_MODE_SELECTOR_STYLE); + connect(m_cycleModeSelectorStyleAction, &QAction::triggered, this, [this] { + ModeManager::cycleModeStyle(); + updateModeSelectorStyleMenu(); + }); + + // Mode Selector Styles + ActionContainer *mmodeLayouts = ActionManager::createMenu(Constants::M_VIEW_MODESTYLES); + mview->addMenu(mmodeLayouts, Constants::G_VIEW_VIEWS); + QMenu *styleMenu = mmodeLayouts->menu(); + styleMenu->setTitle(Tr::tr("Mode Selector Style")); + auto *stylesGroup = new QActionGroup(styleMenu); + stylesGroup->setExclusive(true); + + m_setModeSelectorStyleIconsAndTextAction = stylesGroup->addAction(Tr::tr("Icons and Text")); + connect(m_setModeSelectorStyleIconsAndTextAction, &QAction::triggered, + [] { ModeManager::setModeStyle(ModeManager::Style::IconsAndText); }); + m_setModeSelectorStyleIconsAndTextAction->setCheckable(true); + m_setModeSelectorStyleIconsOnlyAction = stylesGroup->addAction(Tr::tr("Icons Only")); + connect(m_setModeSelectorStyleIconsOnlyAction, &QAction::triggered, + [] { ModeManager::setModeStyle(ModeManager::Style::IconsOnly); }); + m_setModeSelectorStyleIconsOnlyAction->setCheckable(true); + m_setModeSelectorStyleHiddenAction = stylesGroup->addAction(Tr::tr("Hidden")); + connect(m_setModeSelectorStyleHiddenAction, &QAction::triggered, + [] { ModeManager::setModeStyle(ModeManager::Style::Hidden); }); + m_setModeSelectorStyleHiddenAction->setCheckable(true); + + styleMenu->addActions(stylesGroup->actions()); +} + +void MainWindowPrivate::openFile() +{ + openFiles(EditorManager::getOpenFilePaths(), ICore::SwitchMode); +} + +static IDocumentFactory *findDocumentFactory(const QList<IDocumentFactory*> &fileFactories, + const FilePath &filePath) +{ + const QString typeName = Utils::mimeTypeForFile(filePath, MimeMatchMode::MatchDefaultAndRemote) + .name(); + return Utils::findOrDefault(fileFactories, [typeName](IDocumentFactory *f) { + return f->mimeTypes().contains(typeName); + }); +} + +/*! + * \internal + * Either opens \a filePaths with editors or loads a project. + * + * \a flags can be used to stop on first failure, indicate that a file name + * might include line numbers and/or switch mode to edit mode. + * + * \a workingDirectory is used when files are opened by a remote client, since + * the file names are relative to the client working directory. + * + * Returns the first opened document. Required to support the \c -block flag + * for client mode. + * + * \sa IPlugin::remoteArguments() + */ +IDocument *MainWindow::openFiles(const FilePaths &filePaths, + ICore::OpenFilesFlags flags, + const FilePath &workingDirectory) +{ + return MainWindowPrivate::openFiles(filePaths, flags, workingDirectory); +} + +IDocument *MainWindowPrivate::openFiles(const FilePaths &filePaths, + ICore::OpenFilesFlags flags, + const FilePath &workingDirectory) +{ + const QList<IDocumentFactory*> documentFactories = IDocumentFactory::allDocumentFactories(); + IDocument *res = nullptr; + + const FilePath workingDirBase = + workingDirectory.isEmpty() ? FilePath::currentWorkingPath() : workingDirectory; + for (const FilePath &filePath : filePaths) { + const FilePath absoluteFilePath = workingDirBase.resolvePath(filePath); + if (IDocumentFactory *documentFactory = findDocumentFactory(documentFactories, filePath)) { + IDocument *document = documentFactory->open(absoluteFilePath); + if (!document) { + if (flags & ICore::StopOnLoadFail) + return res; + } else { + if (!res) + res = document; + if (flags & ICore::SwitchMode) + ModeManager::activateMode(Id(Constants::MODE_EDIT)); + } + } else if (flags & (ICore::SwitchSplitIfAlreadyVisible | ICore::CanContainLineAndColumnNumbers) + || !res) { + QFlags<EditorManager::OpenEditorFlag> emFlags; + if (flags & ICore::SwitchSplitIfAlreadyVisible) + emFlags |= EditorManager::SwitchSplitIfAlreadyVisible; + IEditor *editor = nullptr; + if (flags & ICore::CanContainLineAndColumnNumbers) { + const Link &link = Link::fromString(absoluteFilePath.toString(), true); + editor = EditorManager::openEditorAt(link, {}, emFlags); + } else { + editor = EditorManager::openEditor(absoluteFilePath, {}, emFlags); + } + if (!editor) { + if (flags & ICore::StopOnLoadFail) + return res; + } else if (!res) { + res = editor->document(); + } + } else { + auto factory = IEditorFactory::preferredEditorFactories(absoluteFilePath).value(0); + DocumentModelPrivate::addSuspendedDocument(absoluteFilePath, {}, + factory ? factory->id() : Id()); + } + } + return res; +} + +void MainWindowPrivate::setFocusToEditor() +{ + EditorManagerPrivate::doEscapeKeyFocusMoveMagic(); +} + +static void acceptModalDialogs() +{ + const QWidgetList topLevels = QApplication::topLevelWidgets(); + QList<QDialog *> dialogsToClose; + for (QWidget *topLevel : topLevels) { + if (auto dialog = qobject_cast<QDialog *>(topLevel)) { + if (dialog->isModal()) + dialogsToClose.append(dialog); + } + } + for (QDialog *dialog : dialogsToClose) + dialog->accept(); +} + +void MainWindow::exit() +{ + // this function is most likely called from a user action + // that is from an event handler of an object + // since on close we are going to delete everything + // so to prevent the deleting of that object we + // just append it + QMetaObject::invokeMethod( + this, + [this] { + // Modal dialogs block the close event. So close them, in case this was triggered from + // a RestartDialog in the settings dialog. + acceptModalDialogs(); + close(); + }, + Qt::QueuedConnection); +} + +void MainWindow::openFileWith() +{ + const FilePaths filePaths = EditorManager::getOpenFilePaths(); + for (const FilePath &filePath : filePaths) { + bool isExternal; + const Id editorId = EditorManagerPrivate::getOpenWithEditorId(filePath, &isExternal); + if (!editorId.isValid()) + continue; + if (isExternal) + EditorManager::openExternalEditor(filePath, editorId); + else + EditorManagerPrivate::openEditorWith(filePath, editorId); + } +} + +void MainWindowPrivate::openFileFromDevice() +{ + openFiles(EditorManager::getOpenFilePaths(QFileDialog::DontUseNativeDialog), ICore::SwitchMode); +} + +IContext *MainWindow::contextObject(QWidget *widget) const +{ + const auto it = d->m_contextWidgets.find(widget); + return it == d->m_contextWidgets.end() ? nullptr : it->second; +} + +void MainWindow::addContextObject(IContext *context) +{ + if (!context) + return; + QWidget *widget = context->widget(); + if (d->m_contextWidgets.find(widget) != d->m_contextWidgets.end()) + return; + + d->m_contextWidgets.insert({widget, context}); + connect(context, &QObject::destroyed, this, [this, context] { removeContextObject(context); }); +} + +void MainWindow::removeContextObject(IContext *context) +{ + if (!context) + return; + + disconnect(context, &QObject::destroyed, this, nullptr); + + const auto it = std::find_if(d->m_contextWidgets.cbegin(), + d->m_contextWidgets.cend(), + [context](const std::pair<QWidget *, IContext *> &v) { + return v.second == context; + }); + if (it == d->m_contextWidgets.cend()) + return; + + d->m_contextWidgets.erase(it); + if (d->m_activeContext.removeAll(context) > 0) + d->updateContextObject(d->m_activeContext); +} + +void MainWindowPrivate::updateFocusWidget(QWidget *old, QWidget *now) +{ + Q_UNUSED(old) + + // Prevent changing the context object just because the menu or a menu item is activated + if (qobject_cast<QMenuBar*>(now) || qobject_cast<QMenu*>(now)) + return; + + QList<IContext *> newContext; + if (QWidget *p = QApplication::focusWidget()) { + IContext *context = nullptr; + while (p) { + context = q->contextObject(p); + if (context) + newContext.append(context); + p = p->parentWidget(); + } + } + + // ignore toplevels that define no context, like popups without parent + if (!newContext.isEmpty() || QApplication::focusWidget() == q->focusWidget()) + updateContextObject(newContext); +} + +void MainWindowPrivate::updateContextObject(const QList<IContext *> &context) +{ + emit m_core->contextAboutToChange(context); + m_activeContext = context; + updateContext(); + if (debugMainWindow) { + qDebug() << "new context objects =" << context; + for (const IContext *c : context) + qDebug() << (c ? c->widget() : nullptr) << (c ? c->widget()->metaObject()->className() : nullptr); + } +} + +void MainWindow::aboutToShutdown() +{ + disconnect(qApp, &QApplication::focusChanged, d, &MainWindowPrivate::updateFocusWidget); + for (auto contextPair : d->m_contextWidgets) + disconnect(contextPair.second, &QObject::destroyed, this, nullptr); + d->m_activeContext.clear(); + hide(); +} + +void MainWindowPrivate::readSettings() +{ + QtcSettings *settings = PluginManager::settings(); + settings->beginGroup(QLatin1String(settingsGroup)); + + if (m_overrideColor.isValid()) { + StyleHelper::setBaseColor(m_overrideColor); + // Get adapted base color. + m_overrideColor = StyleHelper::baseColor(); + } else { + StyleHelper::setBaseColor(settings->value(colorKey, + QColor(StyleHelper::DEFAULT_BASE_COLOR)).value<QColor>()); + } + + { + ModeManager::Style modeStyle = + ModeManager::Style(settings->value(modeSelectorLayoutKey, int(ModeManager::Style::IconsAndText)).toInt()); + + // Migrate legacy setting from Qt Creator 4.6 and earlier + static const char modeSelectorVisibleKey[] = "ModeSelectorVisible"; + if (!settings->contains(modeSelectorLayoutKey) && settings->contains(modeSelectorVisibleKey)) { + bool visible = settings->value(modeSelectorVisibleKey, true).toBool(); + modeStyle = visible ? ModeManager::Style::IconsAndText : ModeManager::Style::Hidden; + } + + ModeManager::setModeStyle(modeStyle); + updateModeSelectorStyleMenu(); + } + + if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) { + const bool isVisible = settings->value(menubarVisibleKey, true).toBool(); + + globalMenuBar()->setVisible(isVisible); + if (m_toggleMenubarAction) + m_toggleMenubarAction->setChecked(isVisible); + } + + settings->endGroup(); + + EditorManagerPrivate::readSettings(); + m_leftNavigationWidget->restoreSettings(settings); + m_rightNavigationWidget->restoreSettings(settings); + m_rightPaneWidget->readSettings(settings); +} + +void MainWindow::saveSettings() +{ + QtcSettings *settings = PluginManager::settings(); + settings->beginGroup(QLatin1String(settingsGroup)); + + if (!(d->m_overrideColor.isValid() && StyleHelper::baseColor() == d->m_overrideColor)) + settings->setValueWithDefault(colorKey, + StyleHelper::requestedBaseColor(), + QColor(StyleHelper::DEFAULT_BASE_COLOR)); + + if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) + settings->setValue(menubarVisibleKey, globalMenuBar()->isVisible()); + + settings->endGroup(); + + DocumentManager::saveSettings(); + ActionManager::saveSettings(); + EditorManagerPrivate::saveSettings(); + d->m_leftNavigationWidget->saveSettings(settings); + d->m_rightNavigationWidget->saveSettings(settings); + + // TODO Remove some time after Qt Creator 11 + // Work around Qt Creator <= 10 writing the default terminal to the settings. + // TerminalCommand writes the terminal to the settings when changing it, which usually is + // enough. But because of the bug in Qt Creator <= 10 we want to clean up the settings + // even if the user never touched the terminal setting. + if (HostOsInfo::isMacHost()) + TerminalCommand::setTerminalEmulator(TerminalCommand::terminalEmulator()); +} + +void MainWindowPrivate::saveWindowSettings() +{ + QtcSettings *settings = PluginManager::settings(); + settings->beginGroup(settingsGroup); + + // On OS X applications usually do not restore their full screen state. + // To be able to restore the correct non-full screen geometry, we have to put + // the window out of full screen before saving the geometry. + // Works around QTBUG-45241 + if (Utils::HostOsInfo::isMacHost() && q->isFullScreen()) + q->setWindowState(q->windowState() & ~Qt::WindowFullScreen); + settings->setValue(windowGeometryKey, q->saveGeometry()); + settings->setValue(windowStateKey, q->saveState()); + settings->setValue(modeSelectorLayoutKey, int(ModeManager::modeStyle())); + + settings->endGroup(); +} + +void MainWindowPrivate::updateModeSelectorStyleMenu() +{ + switch (ModeManager::modeStyle()) { + case ModeManager::Style::IconsAndText: + m_setModeSelectorStyleIconsAndTextAction->setChecked(true); + break; + case ModeManager::Style::IconsOnly: + m_setModeSelectorStyleIconsOnlyAction->setChecked(true); + break; + case ModeManager::Style::Hidden: + m_setModeSelectorStyleHiddenAction->setChecked(true); + break; + } +} + +void MainWindow::updateAdditionalContexts(const Context &remove, const Context &add, + ICore::ContextPriority priority) +{ + for (const Id id : remove) { + if (!id.isValid()) + continue; + int index = d->m_lowPrioAdditionalContexts.indexOf(id); + if (index != -1) + d->m_lowPrioAdditionalContexts.removeAt(index); + index = d->m_highPrioAdditionalContexts.indexOf(id); + if (index != -1) + d->m_highPrioAdditionalContexts.removeAt(index); + } + + for (const Id id : add) { + if (!id.isValid()) + continue; + Context &cref = (priority == ICore::ContextPriority::High ? d->m_highPrioAdditionalContexts + : d->m_lowPrioAdditionalContexts); + if (!cref.contains(id)) + cref.prepend(id); + } + + d->updateContext(); +} + +void MainWindowPrivate::updateContext() +{ + Context contexts = m_highPrioAdditionalContexts; + + for (IContext *context : std::as_const(m_activeContext)) + contexts.add(context->context()); + + contexts.add(m_lowPrioAdditionalContexts); + + Context uniquecontexts; + for (const Id &id : std::as_const(contexts)) { + if (!uniquecontexts.contains(id)) + uniquecontexts.add(id); + } + + ActionManager::setContext(uniquecontexts); + emit m_core->contextChanged(uniquecontexts); +} + +void MainWindowPrivate::aboutToShowRecentFiles() +{ + ActionContainer *aci = ActionManager::actionContainer(Constants::M_FILE_RECENTFILES); + QMenu *menu = aci->menu(); + menu->clear(); + + const QList<DocumentManager::RecentFile> recentFiles = DocumentManager::recentFiles(); + for (int i = 0; i < recentFiles.count(); ++i) { + const DocumentManager::RecentFile file = recentFiles[i]; + + const QString filePath = Utils::quoteAmpersands(file.first.shortNativePath()); + const QString actionText = ActionManager::withNumberAccelerator(filePath, i + 1); + QAction *action = menu->addAction(actionText); + connect(action, &QAction::triggered, this, [file] { + EditorManager::openEditor(file.first, file.second); + }); + } + + bool hasRecentFiles = !recentFiles.isEmpty(); + menu->setEnabled(hasRecentFiles); + + // add the Clear Menu item + if (hasRecentFiles) { + menu->addSeparator(); + QAction *action = menu->addAction(Tr::tr(Constants::TR_CLEAR_MENU)); + connect(action, &QAction::triggered, + DocumentManager::instance(), &DocumentManager::clearRecentFiles); + } +} + +void MainWindowPrivate::aboutQtCreator() +{ + if (!m_versionDialog) { + m_versionDialog = new VersionDialog(q); + connect(m_versionDialog, &QDialog::finished, + this, &MainWindowPrivate::destroyVersionDialog); + ICore::registerWindow(m_versionDialog, Context("Core.VersionDialog")); + m_versionDialog->show(); + } else { + ICore::raiseWindow(m_versionDialog); + } +} + +void MainWindowPrivate::destroyVersionDialog() +{ + if (m_versionDialog) { + m_versionDialog->deleteLater(); + m_versionDialog = nullptr; + } +} + +void MainWindowPrivate::aboutPlugins() +{ + PluginDialog dialog(q); + dialog.exec(); +} + +class LogDialog : public QDialog +{ +public: + LogDialog(QWidget *parent) + : QDialog(parent) + {} + bool event(QEvent *event) override + { + if (event->type() == QEvent::ShortcutOverride) { + auto ke = static_cast<QKeyEvent *>(event); + if (ke->key() == Qt::Key_Escape && !ke->modifiers()) { + ke->accept(); + return true; + } + } + return QDialog::event(event); + } +}; + +void MainWindowPrivate::changeLog() +{ + static QPointer<LogDialog> dialog; + if (dialog) { + ICore::raiseWindow(dialog); + return; + } + const FilePaths files = + ICore::resourcePath("changelog").dirEntries({{"changes-*"}, QDir::Files}); + static const QRegularExpression versionRegex("\\d+[.]\\d+[.]\\d+"); + using VersionFilePair = std::pair<QVersionNumber, FilePath>; + QList<VersionFilePair> versionedFiles = Utils::transform(files, [](const FilePath &fp) { + const QRegularExpressionMatch match = versionRegex.match(fp.fileName()); + const QVersionNumber version = match.hasMatch() + ? QVersionNumber::fromString(match.captured()) + : QVersionNumber(); + return std::make_pair(version, fp); + }); + Utils::sort(versionedFiles, [](const VersionFilePair &a, const VersionFilePair &b) { + return a.first > b.first; + }); + + auto versionCombo = new QComboBox; + for (const VersionFilePair &f : versionedFiles) + versionCombo->addItem(f.first.toString()); + dialog = new LogDialog(ICore::dialogParent()); + auto versionLayout = new QHBoxLayout; + versionLayout->addWidget(new QLabel(Tr::tr("Version:"))); + versionLayout->addWidget(versionCombo); + versionLayout->addStretch(1); + auto showInExplorer = new QPushButton(FileUtils::msgGraphicalShellAction()); + versionLayout->addWidget(showInExplorer); + auto textEdit = new QTextBrowser; + textEdit->setOpenExternalLinks(true); + + auto aggregate = new Aggregation::Aggregate; + aggregate->add(textEdit); + aggregate->add(new Core::BaseTextFind(textEdit)); + + new MarkdownHighlighter(textEdit->document()); + + auto textEditWidget = new QFrame; + textEditWidget->setFrameStyle(QFrame::NoFrame); + auto findToolBar = new FindToolBarPlaceHolder(dialog); + findToolBar->setLightColored(true); + auto textEditLayout = new QVBoxLayout; + textEditLayout->setContentsMargins(0, 0, 0, 0); + textEditLayout->setSpacing(0); + textEditLayout->addWidget(textEdit); + textEditLayout->addWidget(findToolBar); + textEditWidget->setLayout(textEditLayout); + auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); + auto dialogLayout = new QVBoxLayout; + dialogLayout->addLayout(versionLayout); + dialogLayout->addWidget(textEditWidget); + dialogLayout->addWidget(buttonBox); + dialog->setLayout(dialogLayout); + dialog->resize(700, 600); + dialog->setWindowTitle(Tr::tr("Change Log")); + dialog->setAttribute(Qt::WA_DeleteOnClose); + ICore::registerWindow(dialog, Context("CorePlugin.VersionDialog")); + + connect(buttonBox, &QDialogButtonBox::rejected, dialog, &QDialog::close); + QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close); + if (QTC_GUARD(closeButton)) + closeButton->setDefault(true); // grab from "Open in Explorer" button + + const auto showLog = [textEdit, versionedFiles](int index) { + if (index < 0 || index >= versionedFiles.size()) + return; + const FilePath file = versionedFiles.at(index).second; + QString contents = QString::fromUtf8(file.fileContents().value_or(QByteArray())); + // (?<![[\/]) == don't replace if it is preceded by "[" or "/" + // i.e. if it already is part of a link + static const QRegularExpression bugexpr(R"((?<![[\/])((QT(CREATOR)?BUG|PYSIDE)-\d+))"); + contents.replace(bugexpr, R"([\1](https://bugreports.qt.io/browse/\1))"); + static const QRegularExpression docexpr("https://doc[.]qt[.]io/qtcreator/([.a-zA-Z/_-]*)"); + QList<QRegularExpressionMatch> matches; + for (const QRegularExpressionMatch &m : docexpr.globalMatch(contents)) + matches.append(m); + Utils::reverseForeach(matches, [&contents](const QRegularExpressionMatch &match) { + const QString qthelpUrl = "qthelp://org.qt-project.qtcreator/doc/" + match.captured(1); + if (!HelpManager::fileData(qthelpUrl).isEmpty()) + contents.replace(match.capturedStart(), match.capturedLength(), qthelpUrl); + }); + textEdit->setMarkdown(contents); + }; + connect(versionCombo, &QComboBox::currentIndexChanged, textEdit, showLog); + showLog(versionCombo->currentIndex()); + + connect(showInExplorer, &QPushButton::clicked, this, [versionCombo, versionedFiles] { + const int index = versionCombo->currentIndex(); + if (index >= 0 && index < versionedFiles.size()) + FileUtils::showInGraphicalShell(ICore::dialogParent(), versionedFiles.at(index).second); + else + FileUtils::showInGraphicalShell(ICore::dialogParent(), ICore::resourcePath("changelog")); + }); + + dialog->show(); +} + +void MainWindowPrivate::contact() +{ + QMessageBox dlg(QMessageBox::Information, Tr::tr("Contact"), + Tr::tr("<p>Qt Creator developers can be reached at the Qt Creator mailing list:</p>" + "%1" + "<p>or the #qt-creator channel on Libera.Chat IRC:</p>" + "%2" + "<p>Our bug tracker is located at %3.</p>" + "<p>Please use %4 for bigger chunks of text.</p>") + .arg("<p>    " + "<a href=\"https://lists.qt-project.org/listinfo/qt-creator\">" + "mailto:qt-creator@qt-project.org" + "</a></p>") + .arg("<p>    " + "<a href=\"https://web.libera.chat/#qt-creator\">" + "https://web.libera.chat/#qt-creator" + "</a></p>") + .arg("<a href=\"https://bugreports.qt.io/projects/QTCREATORBUG\">" + "https://bugreports.qt.io" + "</a>") + .arg("<a href=\"https://pastebin.com\">" + "https://pastebin.com" + "</a>"), + QMessageBox::Ok, q); + dlg.exec(); +} + +QPrinter *MainWindow::printer() const +{ + if (!d->m_printer) + d->m_printer = new QPrinter(QPrinter::HighResolution); + return d->m_printer; +} + +void MainWindowPrivate::restoreWindowState() +{ + NANOTRACE_SCOPE("Core", "MainWindow::restoreWindowState"); + QtcSettings *settings = PluginManager::settings(); + settings->beginGroup(settingsGroup); + if (!q->restoreGeometry(settings->value(windowGeometryKey).toByteArray())) + q->resize(1260, 700); // size without window decoration + q->restoreState(settings->value(windowStateKey).toByteArray()); + settings->endGroup(); + q->show(); + StatusBarManager::restoreSettings(); +} + +} // namespace Internal } // namespace Core diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index 3b8dfe8a0b3..95ba146cd32 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -6,6 +6,7 @@ #include "core_global.h" #include "icontext.h" +#include <utils/appmainwindow.h> #include <utils/filepath.h> #include <utils/qtcsettings.h> @@ -17,6 +18,7 @@ #include <functional> QT_BEGIN_NAMESPACE +class QColor; class QMainWindow; class QPrinter; class QStatusBar; @@ -26,25 +28,25 @@ QT_END_NAMESPACE namespace Utils { class InfoBar; } namespace Core { + class Context; +class IDocument; class IWizardFactory; +class NewDialog; namespace Internal { class MainWindow; class MainWindowPrivate; } // Internal -class NewDialog; - class CORE_EXPORT ICore : public QObject { Q_OBJECT friend class Internal::MainWindow; friend class Internal::MainWindowPrivate; - friend class IWizardFactory; - explicit ICore(Internal::MainWindow *mw); + ICore(); ~ICore() override; public: @@ -154,9 +156,63 @@ public: static void saveSettings(SaveSettingsReason reason); static void setNewDialogFactory(const std::function<NewDialog *(QWidget *)> &newFactory); - -private: static void updateNewItemDialogState(); }; +namespace Internal { + +class MainWindow : public Utils::AppMainWindow +{ + Q_OBJECT + +public: + MainWindow(); + ~MainWindow() override; + + void init(); + void extensionsInitialized(); + void aboutToShutdown(); + + IContext *contextObject(QWidget *widget) const; + void addContextObject(IContext *context); + void removeContextObject(IContext *context); + + static IDocument *openFiles(const Utils::FilePaths &filePaths, + ICore::OpenFilesFlags flags, + const Utils::FilePath &workingDirectory = {}); + + QPrinter *printer() const; + IContext *currentContextObject() const; + QStatusBar *statusBar() const; + Utils::InfoBar *infoBar() const; + + void updateAdditionalContexts(const Context &remove, const Context &add, + ICore::ContextPriority priority); + + void setOverrideColor(const QColor &color); + + QStringList additionalAboutInformation() const; + void clearAboutInformation(); + void appendAboutInformation(const QString &line); + + void addPreCloseListener(const std::function<bool()> &listener); + + void saveSettings(); + + void restart(); + + void restartTrimmer(); + +public slots: + static void openFileWith(); + void exit(); + +private: + void closeEvent(QCloseEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; +}; + +} // namespace Internal + } // namespace Core diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 852e33f5cfe..e69de29bb2d 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -1,1664 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "mainwindow.h" - -#include "actionmanager/actioncontainer.h" -#include "actionmanager/actionmanager.h" -#include "actionmanager/command.h" -#include "coreicons.h" -#include "coreplugintr.h" -#include "dialogs/externaltoolconfig.h" -#include "dialogs/shortcutsettings.h" -#include "documentmanager.h" -#include "editormanager/documentmodel_p.h" -#include "editormanager/editormanager.h" -#include "editormanager/editormanager_p.h" -#include "editormanager/ieditor.h" -#include "editormanager/ieditorfactory.h" -#include "editormanager/systemeditor.h" -#include "externaltoolmanager.h" -#include "fancytabwidget.h" -#include "fileutils.h" -#include "find/basetextfind.h" -#include "findplaceholder.h" -#include "helpmanager.h" -#include "icore.h" -#include "idocumentfactory.h" -#include "inavigationwidgetfactory.h" -#include "iwizardfactory.h" -#include "jsexpander.h" -#include "loggingviewer.h" -#include "manhattanstyle.h" -#include "messagemanager.h" -#include "mimetypesettings.h" -#include "modemanager.h" -#include "navigationwidget.h" -#include "outputpanemanager.h" -#include "plugindialog.h" -#include "progressmanager/progressmanager_p.h" -#include "progressmanager/progressview.h" -#include "rightpane.h" -#include "statusbarmanager.h" -#include "systemsettings.h" -#include "vcsmanager.h" -#include "versiondialog.h" -#include "windowsupport.h" - -#include <extensionsystem/pluginmanager.h> - -#include <utils/algorithm.h> -#include <utils/fsengine/fileiconprovider.h> -#include <utils/fsengine/fsengine.h> -#include <utils/historycompleter.h> -#include <utils/hostosinfo.h> -#include <utils/mimeutils.h> -#include <utils/proxyaction.h> -#include <utils/qtcassert.h> -#include <utils/stringutils.h> -#include <utils/stylehelper.h> -#include <utils/theme/theme.h> -#include <utils/touchbar/touchbar.h> -#include <utils/checkablemessagebox.h> -#include <utils/terminalcommand.h> -#include <utils/utilsicons.h> - -#include <nanotrace/nanotrace.h> - -#include <QActionGroup> -#include <QApplication> -#include <QCloseEvent> -#include <QColorDialog> -#include <QComboBox> -#include <QDebug> -#include <QDialogButtonBox> -#include <QMenu> -#include <QMenuBar> -#include <QMessageBox> -#include <QPrinter> -#include <QStatusBar> -#include <QStyleFactory> -#include <QTextBrowser> -#include <QTimer> -#include <QToolButton> -#include <QVersionNumber> - -#ifdef Q_OS_LINUX -#include <malloc.h> -#endif - -using namespace ExtensionSystem; -using namespace Utils; - -namespace Core { -namespace Internal { - -const char settingsGroup[] = "MainWindow"; -const char colorKey[] = "Color"; -const char windowGeometryKey[] = "WindowGeometry"; -const char windowStateKey[] = "WindowState"; -const char modeSelectorLayoutKey[] = "ModeSelectorLayout"; -const char menubarVisibleKey[] = "MenubarVisible"; - -static bool hideToolsMenu() -{ - return Core::ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_TOOLS, false).toBool(); -} - -enum { debugMainWindow = 0 }; - - -class MainWindowPrivate : public QObject -{ -public: - explicit MainWindowPrivate(MainWindow *mainWindow) - : q(mainWindow) - {} - - ~MainWindowPrivate(); - - void init(); - - static void openFile(); - static IDocument *openFiles(const FilePaths &filePaths, ICore::OpenFilesFlags flags, - const FilePath &workingDirectory = {}); - void aboutToShowRecentFiles(); - - static void setFocusToEditor(); - void aboutQtCreator(); - void aboutPlugins(); - void changeLog(); - void contact(); - void updateFocusWidget(QWidget *old, QWidget *now); - NavigationWidget *navigationWidget(Side side) const; - void setSidebarVisible(bool visible, Side side); - void destroyVersionDialog(); - void openDroppedFiles(const QList<Utils::DropSupport::FileSpec> &files); - void restoreWindowState(); - - void openFileFromDevice(); - - void updateContextObject(const QList<IContext *> &context); - void updateContext(); - - void registerDefaultContainers(); - void registerDefaultActions(); - void registerModeSelectorStyleActions(); - - void readSettings(); - void saveWindowSettings(); - - void updateModeSelectorStyleMenu(); - - MainWindow *q = nullptr; - ICore *m_coreImpl = nullptr; - QTimer m_trimTimer; - QStringList m_aboutInformation; - Context m_highPrioAdditionalContexts; - Context m_lowPrioAdditionalContexts{Constants::C_GLOBAL}; - mutable QPrinter *m_printer = nullptr; - WindowSupport *m_windowSupport = nullptr; - EditorManager *m_editorManager = nullptr; - ExternalToolManager *m_externalToolManager = nullptr; - MessageManager *m_messageManager = nullptr; - ProgressManagerPrivate *m_progressManager = nullptr; - JsExpander *m_jsExpander = nullptr; - VcsManager *m_vcsManager = nullptr; - ModeManager *m_modeManager = nullptr; - FancyTabWidget *m_modeStack = nullptr; - NavigationWidget *m_leftNavigationWidget = nullptr; - NavigationWidget *m_rightNavigationWidget = nullptr; - RightPaneWidget *m_rightPaneWidget = nullptr; - VersionDialog *m_versionDialog = nullptr; - - QList<IContext *> m_activeContext; - - std::unordered_map<QWidget *, IContext *> m_contextWidgets; - - ShortcutSettings *m_shortcutSettings = nullptr; - ToolSettings *m_toolSettings = nullptr; - MimeTypeSettings *m_mimeTypeSettings = nullptr; - SystemEditor *m_systemEditor = nullptr; - - // actions - QAction *m_focusToEditor = nullptr; - QAction *m_newAction = nullptr; - QAction *m_openAction = nullptr; - QAction *m_openWithAction = nullptr; - QAction *m_openFromDeviceAction = nullptr; - QAction *m_saveAllAction = nullptr; - QAction *m_exitAction = nullptr; - QAction *m_optionsAction = nullptr; - QAction *m_loggerAction = nullptr; - QAction *m_toggleLeftSideBarAction = nullptr; - QAction *m_toggleRightSideBarAction = nullptr; - QAction *m_toggleMenubarAction = nullptr; - QAction *m_cycleModeSelectorStyleAction = nullptr; - QAction *m_setModeSelectorStyleIconsAndTextAction = nullptr; - QAction *m_setModeSelectorStyleHiddenAction = nullptr; - QAction *m_setModeSelectorStyleIconsOnlyAction = nullptr; - QAction *m_themeAction = nullptr; - - QToolButton *m_toggleLeftSideBarButton = nullptr; - QToolButton *m_toggleRightSideBarButton = nullptr; - QColor m_overrideColor; - QList<std::function<bool()>> m_preCloseListeners; -}; - -void MainWindowPrivate::init() -{ - m_coreImpl = new ICore(q); - m_progressManager = new ProgressManagerPrivate; - m_jsExpander = JsExpander::createGlobalJsExpander(); - m_vcsManager = new VcsManager; - m_modeStack = new FancyTabWidget(q); - m_shortcutSettings = new ShortcutSettings; - m_toolSettings = new ToolSettings; - m_mimeTypeSettings = new MimeTypeSettings; - m_systemEditor = new SystemEditor; - m_toggleLeftSideBarButton = new QToolButton; - m_toggleRightSideBarButton = new QToolButton; - - (void) new DocumentManager(q); - - HistoryCompleter::setSettings(PluginManager::settings()); - - if (HostOsInfo::isLinuxHost()) - QApplication::setWindowIcon(Icons::QTCREATORLOGO_BIG.icon()); - QString baseName = QApplication::style()->objectName(); - // Sometimes we get the standard windows 95 style as a fallback - if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost() - && baseName == QLatin1String("windows")) { - baseName = QLatin1String("fusion"); - } - - // if the user has specified as base style in the theme settings, - // prefer that - const QStringList available = QStyleFactory::keys(); - const QStringList styles = Utils::creatorTheme()->preferredStyles(); - for (const QString &s : styles) { - if (available.contains(s, Qt::CaseInsensitive)) { - baseName = s; - break; - } - } - - QApplication::setStyle(new ManhattanStyle(baseName)); - - m_modeManager = new ModeManager(q, m_modeStack); - connect(m_modeStack, &FancyTabWidget::topAreaClicked, this, [](Qt::MouseButton, Qt::KeyboardModifiers modifiers) { - if (modifiers & Qt::ShiftModifier) { - QColor color = QColorDialog::getColor(StyleHelper::requestedBaseColor(), ICore::dialogParent()); - if (color.isValid()) - StyleHelper::setBaseColor(color); - } - }); - - registerDefaultContainers(); - registerDefaultActions(); - - m_leftNavigationWidget = new NavigationWidget(m_toggleLeftSideBarAction, Side::Left); - m_rightNavigationWidget = new NavigationWidget(m_toggleRightSideBarAction, Side::Right); - m_rightPaneWidget = new RightPaneWidget(); - - m_messageManager = new MessageManager; - m_editorManager = new EditorManager(this); - m_externalToolManager = new ExternalToolManager(); - - m_progressManager->progressView()->setParent(q); - - connect(qApp, &QApplication::focusChanged, this, &MainWindowPrivate::updateFocusWidget); - - // Add small Toolbuttons for toggling the navigation widgets - StatusBarManager::addStatusBarWidget(m_toggleLeftSideBarButton, StatusBarManager::First); - int childsCount = q->statusBar()->findChildren<QWidget *>(QString(), Qt::FindDirectChildrenOnly).count(); - q->statusBar()->insertPermanentWidget(childsCount - 1, m_toggleRightSideBarButton); // before QSizeGrip - -// setUnifiedTitleAndToolBarOnMac(true); - //if (HostOsInfo::isAnyUnixHost()) - //signal(SIGINT, handleSigInt); - - q->statusBar()->setProperty("p_styled", true); - - auto dropSupport = new DropSupport(q, [](QDropEvent *event, DropSupport *) { - return event->source() == nullptr; // only accept drops from the "outside" (e.g. file manager) - }); - connect(dropSupport, &DropSupport::filesDropped, - this, &MainWindowPrivate::openDroppedFiles); - - if (HostOsInfo::isLinuxHost()) { - m_trimTimer.setSingleShot(true); - m_trimTimer.setInterval(60000); - // glibc may not actually free memory in free(). -#ifdef Q_OS_LINUX - connect(&m_trimTimer, &QTimer::timeout, this, [] { malloc_trim(0); }); -#endif - } -} - -MainWindow::MainWindow() - : d(new MainWindowPrivate(this)) -{ - d->init(); // Separation needed for now as the call triggers other MainWindow calls. - - setWindowTitle(QGuiApplication::applicationDisplayName()); - setDockNestingEnabled(true); - setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); - setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea); - - setCentralWidget(d->m_modeStack); -} - -NavigationWidget *MainWindowPrivate::navigationWidget(Side side) const -{ - return side == Side::Left ? m_leftNavigationWidget : m_rightNavigationWidget; -} - -void MainWindowPrivate::setSidebarVisible(bool visible, Side side) -{ - if (NavigationWidgetPlaceHolder::current(side)) - navigationWidget(side)->setShown(visible); -} - -void MainWindow::setOverrideColor(const QColor &color) -{ - d->m_overrideColor = color; -} - -QStringList MainWindow::additionalAboutInformation() const -{ - return d->m_aboutInformation; -} - -void MainWindow::clearAboutInformation() -{ - d->m_aboutInformation.clear(); -} - -void MainWindow::appendAboutInformation(const QString &line) -{ - d->m_aboutInformation.append(line); -} - -void MainWindow::addPreCloseListener(const std::function<bool ()> &listener) -{ - d->m_preCloseListeners.append(listener); -} - -MainWindow::~MainWindow() -{ - delete d; -} - -MainWindowPrivate::~MainWindowPrivate() -{ - // explicitly delete window support, because that calls methods from ICore that call methods - // from mainwindow, so mainwindow still needs to be alive - delete m_windowSupport; - m_windowSupport = nullptr; - - delete m_externalToolManager; - m_externalToolManager = nullptr; - delete m_messageManager; - m_messageManager = nullptr; - delete m_shortcutSettings; - m_shortcutSettings = nullptr; - delete m_toolSettings; - m_toolSettings = nullptr; - delete m_mimeTypeSettings; - m_mimeTypeSettings = nullptr; - delete m_systemEditor; - m_systemEditor = nullptr; - delete m_printer; - m_printer = nullptr; - delete m_vcsManager; - m_vcsManager = nullptr; - //we need to delete editormanager and statusbarmanager explicitly before the end of the destructor, - //because they might trigger stuff that tries to access data from editorwindow, like removeContextWidget - - // All modes are now gone - OutputPaneManager::destroy(); - - delete m_leftNavigationWidget; - delete m_rightNavigationWidget; - m_leftNavigationWidget = nullptr; - m_rightNavigationWidget = nullptr; - - delete m_editorManager; - m_editorManager = nullptr; - delete m_progressManager; - m_progressManager = nullptr; - - delete m_coreImpl; - m_coreImpl = nullptr; - - delete m_rightPaneWidget; - m_rightPaneWidget = nullptr; - - delete m_modeManager; - m_modeManager = nullptr; - - delete m_jsExpander; - m_jsExpander = nullptr; -} - -void MainWindow::init() -{ - d->m_progressManager->init(); // needs the status bar manager - MessageManager::init(); - OutputPaneManager::create(); -} - -void MainWindow::extensionsInitialized() -{ - EditorManagerPrivate::extensionsInitialized(); - MimeTypeSettings::restoreSettings(); - d->m_windowSupport = new WindowSupport(this, Context("Core.MainWindow")); - d->m_windowSupport->setCloseActionEnabled(false); - OutputPaneManager::initialize(); - VcsManager::extensionsInitialized(); - d->m_leftNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories()); - d->m_rightNavigationWidget->setFactories(INavigationWidgetFactory::allNavigationFactories()); - - ModeManager::extensionsInitialized(); - - d->readSettings(); - d->updateContext(); - - emit d->m_coreImpl->coreAboutToOpen(); - // Delay restoreWindowState, since it is overridden by LayoutRequest event - QMetaObject::invokeMethod(d, &MainWindowPrivate::restoreWindowState, Qt::QueuedConnection); - QMetaObject::invokeMethod(d->m_coreImpl, &ICore::coreOpened, Qt::QueuedConnection); -} - -static void setRestart(bool restart) -{ - qApp->setProperty("restart", restart); -} - -void MainWindow::restart() -{ - setRestart(true); - exit(); -} - -void MainWindow::restartTrimmer() -{ - if (HostOsInfo::isLinuxHost() && !d->m_trimTimer.isActive()) - d->m_trimTimer.start(); -} - -void MainWindow::closeEvent(QCloseEvent *event) -{ - const auto cancelClose = [event] { - event->ignore(); - setRestart(false); - }; - - // work around QTBUG-43344 - static bool alreadyClosed = false; - if (alreadyClosed) { - event->accept(); - return; - } - - if (systemSettings().askBeforeExit() - && (QMessageBox::question(this, - Tr::tr("Exit %1?").arg(QGuiApplication::applicationDisplayName()), - Tr::tr("Exit %1?").arg(QGuiApplication::applicationDisplayName()), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::No) - == QMessageBox::No)) { - event->ignore(); - return; - } - - ICore::saveSettings(ICore::MainWindowClosing); - - // Save opened files - if (!DocumentManager::saveAllModifiedDocuments()) { - cancelClose(); - return; - } - - const QList<std::function<bool()>> listeners = d->m_preCloseListeners; - for (const std::function<bool()> &listener : listeners) { - if (!listener()) { - cancelClose(); - return; - } - } - - emit d->m_coreImpl->coreAboutToClose(); - - d->saveWindowSettings(); - - d->m_leftNavigationWidget->closeSubWidgets(); - d->m_rightNavigationWidget->closeSubWidgets(); - - event->accept(); - alreadyClosed = true; -} - -void MainWindow::keyPressEvent(QKeyEvent *event) -{ - restartTrimmer(); - AppMainWindow::keyPressEvent(event); -} - -void MainWindow::mousePressEvent(QMouseEvent *event) -{ - restartTrimmer(); - AppMainWindow::mousePressEvent(event); -} - -void MainWindowPrivate::openDroppedFiles(const QList<DropSupport::FileSpec> &files) -{ - q->raiseWindow(); - const FilePaths filePaths = Utils::transform(files, &DropSupport::FileSpec::filePath); - q->openFiles(filePaths, ICore::SwitchMode); -} - -IContext *MainWindow::currentContextObject() const -{ - return d->m_activeContext.isEmpty() ? nullptr : d->m_activeContext.first(); -} - -QStatusBar *MainWindow::statusBar() const -{ - return d->m_modeStack->statusBar(); -} - -InfoBar *MainWindow::infoBar() const -{ - return d->m_modeStack->infoBar(); -} - -void MainWindowPrivate::registerDefaultContainers() -{ - ActionContainer *menubar = ActionManager::createMenuBar(Constants::MENU_BAR); - - if (!HostOsInfo::isMacHost()) // System menu bar on Mac - q->setMenuBar(menubar->menuBar()); - menubar->appendGroup(Constants::G_FILE); - menubar->appendGroup(Constants::G_EDIT); - menubar->appendGroup(Constants::G_VIEW); - menubar->appendGroup(Constants::G_TOOLS); - menubar->appendGroup(Constants::G_WINDOW); - menubar->appendGroup(Constants::G_HELP); - - // File Menu - ActionContainer *filemenu = ActionManager::createMenu(Constants::M_FILE); - menubar->addMenu(filemenu, Constants::G_FILE); - filemenu->menu()->setTitle(Tr::tr("&File")); - filemenu->appendGroup(Constants::G_FILE_NEW); - filemenu->appendGroup(Constants::G_FILE_OPEN); - filemenu->appendGroup(Constants::G_FILE_SESSION); - filemenu->appendGroup(Constants::G_FILE_PROJECT); - filemenu->appendGroup(Constants::G_FILE_SAVE); - filemenu->appendGroup(Constants::G_FILE_EXPORT); - filemenu->appendGroup(Constants::G_FILE_CLOSE); - filemenu->appendGroup(Constants::G_FILE_PRINT); - filemenu->appendGroup(Constants::G_FILE_OTHER); - connect(filemenu->menu(), &QMenu::aboutToShow, this, &MainWindowPrivate::aboutToShowRecentFiles); - - - // Edit Menu - ActionContainer *medit = ActionManager::createMenu(Constants::M_EDIT); - menubar->addMenu(medit, Constants::G_EDIT); - medit->menu()->setTitle(Tr::tr("&Edit")); - medit->appendGroup(Constants::G_EDIT_UNDOREDO); - medit->appendGroup(Constants::G_EDIT_COPYPASTE); - medit->appendGroup(Constants::G_EDIT_SELECTALL); - medit->appendGroup(Constants::G_EDIT_ADVANCED); - medit->appendGroup(Constants::G_EDIT_FIND); - medit->appendGroup(Constants::G_EDIT_OTHER); - - ActionContainer *mview = ActionManager::createMenu(Constants::M_VIEW); - menubar->addMenu(mview, Constants::G_VIEW); - mview->menu()->setTitle(Tr::tr("&View")); - mview->appendGroup(Constants::G_VIEW_VIEWS); - mview->appendGroup(Constants::G_VIEW_PANES); - - // Tools Menu - ActionContainer *ac = ActionManager::createMenu(Constants::M_TOOLS); - ac->setParent(this); - if (!hideToolsMenu()) - menubar->addMenu(ac, Constants::G_TOOLS); - - ac->menu()->setTitle(Tr::tr("&Tools")); - - // Window Menu - ActionContainer *mwindow = ActionManager::createMenu(Constants::M_WINDOW); - menubar->addMenu(mwindow, Constants::G_WINDOW); - mwindow->menu()->setTitle(Tr::tr("&Window")); - mwindow->appendGroup(Constants::G_WINDOW_SIZE); - mwindow->appendGroup(Constants::G_WINDOW_SPLIT); - mwindow->appendGroup(Constants::G_WINDOW_NAVIGATE); - mwindow->appendGroup(Constants::G_WINDOW_LIST); - mwindow->appendGroup(Constants::G_WINDOW_OTHER); - - // Help Menu - ac = ActionManager::createMenu(Constants::M_HELP); - menubar->addMenu(ac, Constants::G_HELP); - ac->menu()->setTitle(Tr::tr("&Help")); - Theme::setHelpMenu(ac->menu()); - ac->appendGroup(Constants::G_HELP_HELP); - ac->appendGroup(Constants::G_HELP_SUPPORT); - ac->appendGroup(Constants::G_HELP_ABOUT); - ac->appendGroup(Constants::G_HELP_UPDATES); - - // macOS touch bar - ac = ActionManager::createTouchBar(Constants::TOUCH_BAR, - QIcon(), - "Main TouchBar" /*never visible*/); - ac->appendGroup(Constants::G_TOUCHBAR_HELP); - ac->appendGroup(Constants::G_TOUCHBAR_NAVIGATION); - ac->appendGroup(Constants::G_TOUCHBAR_EDITOR); - ac->appendGroup(Constants::G_TOUCHBAR_OTHER); - ac->touchBar()->setApplicationTouchBar(); -} - -static QMenuBar *globalMenuBar() -{ - return ActionManager::actionContainer(Constants::MENU_BAR)->menuBar(); -} - -void MainWindowPrivate::registerDefaultActions() -{ - ActionContainer *mfile = ActionManager::actionContainer(Constants::M_FILE); - ActionContainer *medit = ActionManager::actionContainer(Constants::M_EDIT); - ActionContainer *mview = ActionManager::actionContainer(Constants::M_VIEW); - ActionContainer *mtools = ActionManager::actionContainer(Constants::M_TOOLS); - ActionContainer *mwindow = ActionManager::actionContainer(Constants::M_WINDOW); - ActionContainer *mhelp = ActionManager::actionContainer(Constants::M_HELP); - - // File menu separators - mfile->addSeparator(Constants::G_FILE_SAVE); - mfile->addSeparator(Constants::G_FILE_EXPORT); - mfile->addSeparator(Constants::G_FILE_PRINT); - mfile->addSeparator(Constants::G_FILE_CLOSE); - mfile->addSeparator(Constants::G_FILE_OTHER); - // Edit menu separators - medit->addSeparator(Constants::G_EDIT_COPYPASTE); - medit->addSeparator(Constants::G_EDIT_SELECTALL); - medit->addSeparator(Constants::G_EDIT_FIND); - medit->addSeparator(Constants::G_EDIT_ADVANCED); - - // Return to editor shortcut: Note this requires Qt to fix up - // handling of shortcut overrides in menus, item views, combos.... - m_focusToEditor = new QAction(Tr::tr("Return to Editor"), this); - Command *cmd = ActionManager::registerAction(m_focusToEditor, Constants::S_RETURNTOEDITOR); - cmd->setDefaultKeySequence(QKeySequence(Qt::Key_Escape)); - connect(m_focusToEditor, &QAction::triggered, this, &MainWindowPrivate::setFocusToEditor); - - // New File Action - QIcon icon = Icon::fromTheme("document-new"); - - m_newAction = new QAction(icon, Tr::tr("&New Project..."), this); - cmd = ActionManager::registerAction(m_newAction, Constants::NEW); - cmd->setDefaultKeySequence(QKeySequence("Ctrl+Shift+N")); - mfile->addAction(cmd, Constants::G_FILE_NEW); - connect(m_newAction, &QAction::triggered, this, [] { - if (!ICore::isNewItemDialogRunning()) { - ICore::showNewItemDialog( - Tr::tr("New Project", "Title of dialog"), - Utils::filtered(Core::IWizardFactory::allWizardFactories(), - Utils::equal(&Core::IWizardFactory::kind, - Core::IWizardFactory::ProjectWizard)), - FilePath()); - } else { - ICore::raiseWindow(ICore::newItemDialog()); - } - }); - - auto action = new QAction(icon, Tr::tr("New File..."), this); - cmd = ActionManager::registerAction(action, Constants::NEW_FILE); - cmd->setDefaultKeySequence(QKeySequence::New); - mfile->addAction(cmd, Constants::G_FILE_NEW); - connect(action, &QAction::triggered, this, [] { - if (!ICore::isNewItemDialogRunning()) { - ICore::showNewItemDialog(Tr::tr("New File", "Title of dialog"), - Utils::filtered(Core::IWizardFactory::allWizardFactories(), - Utils::equal(&Core::IWizardFactory::kind, - Core::IWizardFactory::FileWizard)), - FilePath()); - } else { - ICore::raiseWindow(ICore::newItemDialog()); - } - }); - - // Open Action - icon = Icon::fromTheme("document-open"); - m_openAction = new QAction(icon, Tr::tr("&Open File or Project..."), this); - cmd = ActionManager::registerAction(m_openAction, Constants::OPEN); - cmd->setDefaultKeySequence(QKeySequence::Open); - mfile->addAction(cmd, Constants::G_FILE_OPEN); - connect(m_openAction, &QAction::triggered, this, &MainWindowPrivate::openFile); - - // Open With Action - m_openWithAction = new QAction(Tr::tr("Open File &With..."), this); - cmd = ActionManager::registerAction(m_openWithAction, Constants::OPEN_WITH); - mfile->addAction(cmd, Constants::G_FILE_OPEN); - connect(m_openWithAction, &QAction::triggered, this, &MainWindow::openFileWith); - - if (FSEngine::isAvailable()) { - // Open From Device Action - m_openFromDeviceAction = new QAction(Tr::tr("Open From Device..."), this); - cmd = ActionManager::registerAction(m_openFromDeviceAction, Constants::OPEN_FROM_DEVICE); - mfile->addAction(cmd, Constants::G_FILE_OPEN); - connect(m_openFromDeviceAction, &QAction::triggered, this, &MainWindowPrivate::openFileFromDevice); - } - - // File->Recent Files Menu - ActionContainer *ac = ActionManager::createMenu(Constants::M_FILE_RECENTFILES); - mfile->addMenu(ac, Constants::G_FILE_OPEN); - ac->menu()->setTitle(Tr::tr("Recent &Files")); - ac->setOnAllDisabledBehavior(ActionContainer::Show); - - // Save Action - icon = Icon::fromTheme("document-save"); - QAction *tmpaction = new QAction(icon, Tr::tr("&Save"), this); - tmpaction->setEnabled(false); - cmd = ActionManager::registerAction(tmpaction, Constants::SAVE); - cmd->setDefaultKeySequence(QKeySequence::Save); - cmd->setAttribute(Command::CA_UpdateText); - cmd->setDescription(Tr::tr("Save")); - mfile->addAction(cmd, Constants::G_FILE_SAVE); - - // Save As Action - icon = Icon::fromTheme("document-save-as"); - tmpaction = new QAction(icon, Tr::tr("Save &As..."), this); - tmpaction->setEnabled(false); - cmd = ActionManager::registerAction(tmpaction, Constants::SAVEAS); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Shift+S") : QString())); - cmd->setAttribute(Command::CA_UpdateText); - cmd->setDescription(Tr::tr("Save As...")); - mfile->addAction(cmd, Constants::G_FILE_SAVE); - - // SaveAll Action - DocumentManager::registerSaveAllAction(); - - // Print Action - icon = Icon::fromTheme("document-print"); - tmpaction = new QAction(icon, Tr::tr("&Print..."), this); - tmpaction->setEnabled(false); - cmd = ActionManager::registerAction(tmpaction, Constants::PRINT); - cmd->setDefaultKeySequence(QKeySequence::Print); - mfile->addAction(cmd, Constants::G_FILE_PRINT); - - // Exit Action - icon = Icon::fromTheme("application-exit"); - m_exitAction = new QAction(icon, Tr::tr("E&xit"), this); - m_exitAction->setMenuRole(QAction::QuitRole); - cmd = ActionManager::registerAction(m_exitAction, Constants::EXIT); - cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Q"))); - mfile->addAction(cmd, Constants::G_FILE_OTHER); - connect(m_exitAction, &QAction::triggered, q, &MainWindow::exit); - - // Undo Action - icon = Icon::fromTheme("edit-undo"); - tmpaction = new QAction(icon, Tr::tr("&Undo"), this); - cmd = ActionManager::registerAction(tmpaction, Constants::UNDO); - cmd->setDefaultKeySequence(QKeySequence::Undo); - cmd->setAttribute(Command::CA_UpdateText); - cmd->setDescription(Tr::tr("Undo")); - medit->addAction(cmd, Constants::G_EDIT_UNDOREDO); - tmpaction->setEnabled(false); - - // Redo Action - icon = Icon::fromTheme("edit-redo"); - tmpaction = new QAction(icon, Tr::tr("&Redo"), this); - cmd = ActionManager::registerAction(tmpaction, Constants::REDO); - cmd->setDefaultKeySequence(QKeySequence::Redo); - cmd->setAttribute(Command::CA_UpdateText); - cmd->setDescription(Tr::tr("Redo")); - medit->addAction(cmd, Constants::G_EDIT_UNDOREDO); - tmpaction->setEnabled(false); - - // Cut Action - icon = Icon::fromTheme("edit-cut"); - tmpaction = new QAction(icon, Tr::tr("Cu&t"), this); - cmd = ActionManager::registerAction(tmpaction, Constants::CUT); - cmd->setDefaultKeySequence(QKeySequence::Cut); - medit->addAction(cmd, Constants::G_EDIT_COPYPASTE); - tmpaction->setEnabled(false); - - // Copy Action - icon = Icon::fromTheme("edit-copy"); - tmpaction = new QAction(icon, Tr::tr("&Copy"), this); - cmd = ActionManager::registerAction(tmpaction, Constants::COPY); - cmd->setDefaultKeySequence(QKeySequence::Copy); - medit->addAction(cmd, Constants::G_EDIT_COPYPASTE); - tmpaction->setEnabled(false); - - // Paste Action - icon = Icon::fromTheme("edit-paste"); - tmpaction = new QAction(icon, Tr::tr("&Paste"), this); - cmd = ActionManager::registerAction(tmpaction, Constants::PASTE); - cmd->setDefaultKeySequence(QKeySequence::Paste); - medit->addAction(cmd, Constants::G_EDIT_COPYPASTE); - tmpaction->setEnabled(false); - - // Select All - icon = Icon::fromTheme("edit-select-all"); - tmpaction = new QAction(icon, Tr::tr("Select &All"), this); - cmd = ActionManager::registerAction(tmpaction, Constants::SELECTALL); - cmd->setDefaultKeySequence(QKeySequence::SelectAll); - medit->addAction(cmd, Constants::G_EDIT_SELECTALL); - tmpaction->setEnabled(false); - - // Goto Action - icon = Icon::fromTheme("go-jump"); - tmpaction = new QAction(icon, Tr::tr("&Go to Line..."), this); - cmd = ActionManager::registerAction(tmpaction, Constants::GOTO); - cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+L"))); - medit->addAction(cmd, Constants::G_EDIT_OTHER); - tmpaction->setEnabled(false); - - // Zoom In Action - icon = Icon::fromTheme("zoom-in"); - tmpaction = new QAction(icon, Tr::tr("Zoom In"), this); - cmd = ActionManager::registerAction(tmpaction, Constants::ZOOM_IN); - cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl++"))); - tmpaction->setEnabled(false); - - // Zoom Out Action - icon = Icon::fromTheme("zoom-out"); - tmpaction = new QAction(icon, Tr::tr("Zoom Out"), this); - cmd = ActionManager::registerAction(tmpaction, Constants::ZOOM_OUT); - if (useMacShortcuts) - cmd->setDefaultKeySequences({QKeySequence(Tr::tr("Ctrl+-")), QKeySequence(Tr::tr("Ctrl+Shift+-"))}); - else - cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+-"))); - tmpaction->setEnabled(false); - - // Zoom Reset Action - icon = Icon::fromTheme("zoom-original"); - tmpaction = new QAction(icon, Tr::tr("Original Size"), this); - cmd = ActionManager::registerAction(tmpaction, Constants::ZOOM_RESET); - cmd->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+0") : Tr::tr("Ctrl+0"))); - tmpaction->setEnabled(false); - - // Debug Qt Creator menu - mtools->appendGroup(Constants::G_TOOLS_DEBUG); - ActionContainer *mtoolsdebug = ActionManager::createMenu(Constants::M_TOOLS_DEBUG); - mtoolsdebug->menu()->setTitle(Tr::tr("Debug %1").arg(QGuiApplication::applicationDisplayName())); - mtools->addMenu(mtoolsdebug, Constants::G_TOOLS_DEBUG); - - m_loggerAction = new QAction(Tr::tr("Show Logs..."), this); - cmd = ActionManager::registerAction(m_loggerAction, Constants::LOGGER); - mtoolsdebug->addAction(cmd); - connect(m_loggerAction, &QAction::triggered, this, [] { LoggingViewer::showLoggingView(); }); - - // Options Action - medit->appendGroup(Constants::G_EDIT_PREFERENCES); - medit->addSeparator(Constants::G_EDIT_PREFERENCES); - - m_optionsAction = new QAction(Tr::tr("Pr&eferences..."), this); - m_optionsAction->setMenuRole(QAction::PreferencesRole); - cmd = ActionManager::registerAction(m_optionsAction, Constants::OPTIONS); - cmd->setDefaultKeySequence(QKeySequence::Preferences); - medit->addAction(cmd, Constants::G_EDIT_PREFERENCES); - connect(m_optionsAction, &QAction::triggered, this, [] { ICore::showOptionsDialog(Id()); }); - - mwindow->addSeparator(Constants::G_WINDOW_LIST); - - if (useMacShortcuts) { - // Minimize Action - QAction *minimizeAction = new QAction(Tr::tr("Minimize"), this); - minimizeAction->setEnabled(false); // actual implementation in WindowSupport - cmd = ActionManager::registerAction(minimizeAction, Constants::MINIMIZE_WINDOW); - cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+M"))); - mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); - - // Zoom Action - QAction *zoomAction = new QAction(Tr::tr("Zoom"), this); - zoomAction->setEnabled(false); // actual implementation in WindowSupport - cmd = ActionManager::registerAction(zoomAction, Constants::ZOOM_WINDOW); - mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); - } - - // Full Screen Action - QAction *toggleFullScreenAction = new QAction(Tr::tr("Full Screen"), this); - toggleFullScreenAction->setCheckable(!HostOsInfo::isMacHost()); - toggleFullScreenAction->setEnabled(false); // actual implementation in WindowSupport - cmd = ActionManager::registerAction(toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Meta+F") : Tr::tr("Ctrl+Shift+F11"))); - if (HostOsInfo::isMacHost()) - cmd->setAttribute(Command::CA_UpdateText); - mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); - - if (useMacShortcuts) { - mwindow->addSeparator(Constants::G_WINDOW_SIZE); - - QAction *closeAction = new QAction(Tr::tr("Close Window"), this); - closeAction->setEnabled(false); - cmd = ActionManager::registerAction(closeAction, Constants::CLOSE_WINDOW); - cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Meta+W"))); - mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); - - mwindow->addSeparator(Constants::G_WINDOW_SIZE); - } - - // Show Left Sidebar Action - m_toggleLeftSideBarAction = new QAction(Utils::Icons::TOGGLE_LEFT_SIDEBAR.icon(), - Tr::tr(Constants::TR_SHOW_LEFT_SIDEBAR), - this); - m_toggleLeftSideBarAction->setCheckable(true); - cmd = ActionManager::registerAction(m_toggleLeftSideBarAction, Constants::TOGGLE_LEFT_SIDEBAR); - cmd->setAttribute(Command::CA_UpdateText); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+0") : Tr::tr("Alt+0"))); - connect(m_toggleLeftSideBarAction, &QAction::triggered, - this, [this](bool visible) { setSidebarVisible(visible, Side::Left); }); - ProxyAction *toggleLeftSideBarProxyAction = - ProxyAction::proxyActionWithIcon(cmd->action(), Utils::Icons::TOGGLE_LEFT_SIDEBAR_TOOLBAR.icon()); - m_toggleLeftSideBarButton->setDefaultAction(toggleLeftSideBarProxyAction); - mview->addAction(cmd, Constants::G_VIEW_VIEWS); - m_toggleLeftSideBarAction->setEnabled(false); - - // Show Right Sidebar Action - m_toggleRightSideBarAction = new QAction(Utils::Icons::TOGGLE_RIGHT_SIDEBAR.icon(), - Tr::tr(Constants::TR_SHOW_RIGHT_SIDEBAR), - this); - m_toggleRightSideBarAction->setCheckable(true); - cmd = ActionManager::registerAction(m_toggleRightSideBarAction, Constants::TOGGLE_RIGHT_SIDEBAR); - cmd->setAttribute(Command::CA_UpdateText); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Shift+0") : Tr::tr("Alt+Shift+0"))); - connect(m_toggleRightSideBarAction, &QAction::triggered, - this, [this](bool visible) { setSidebarVisible(visible, Side::Right); }); - ProxyAction *toggleRightSideBarProxyAction = - ProxyAction::proxyActionWithIcon(cmd->action(), Utils::Icons::TOGGLE_RIGHT_SIDEBAR_TOOLBAR.icon()); - m_toggleRightSideBarButton->setDefaultAction(toggleRightSideBarProxyAction); - mview->addAction(cmd, Constants::G_VIEW_VIEWS); - m_toggleRightSideBarButton->setEnabled(false); - - // Show Menubar Action - if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) { - m_toggleMenubarAction = new QAction(Tr::tr("Show Menubar"), this); - m_toggleMenubarAction->setCheckable(true); - cmd = ActionManager::registerAction(m_toggleMenubarAction, Constants::TOGGLE_MENUBAR); - cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Alt+M"))); - connect(m_toggleMenubarAction, &QAction::toggled, this, [cmd](bool visible) { - if (!visible) { - CheckableMessageBox::information( - Core::ICore::dialogParent(), - Tr::tr("Hide Menubar"), - Tr::tr( - "This will hide the menu bar completely. You can show it again by typing ") - + cmd->keySequence().toString(QKeySequence::NativeText), - QString("ToogleMenuBarHint")); - } - globalMenuBar()->setVisible(visible); - }); - mview->addAction(cmd, Constants::G_VIEW_VIEWS); - } - - registerModeSelectorStyleActions(); - - // Window->Views - ActionContainer *mviews = ActionManager::createMenu(Constants::M_VIEW_VIEWS); - mview->addMenu(mviews, Constants::G_VIEW_VIEWS); - mviews->menu()->setTitle(Tr::tr("&Views")); - - // "Help" separators - mhelp->addSeparator(Constants::G_HELP_SUPPORT); - if (!HostOsInfo::isMacHost()) - mhelp->addSeparator(Constants::G_HELP_ABOUT); - - // About IDE Action - icon = Icon::fromTheme("help-about"); - if (HostOsInfo::isMacHost()) - tmpaction = new QAction(icon, - Tr::tr("About &%1").arg(QGuiApplication::applicationDisplayName()), - this); // it's convention not to add dots to the about menu - else - tmpaction - = new QAction(icon, - Tr::tr("About &%1...").arg(QGuiApplication::applicationDisplayName()), - this); - tmpaction->setMenuRole(QAction::AboutRole); - cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_QTCREATOR); - mhelp->addAction(cmd, Constants::G_HELP_ABOUT); - tmpaction->setEnabled(true); - connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::aboutQtCreator); - - //About Plugins Action - tmpaction = new QAction(Tr::tr("About &Plugins..."), this); - tmpaction->setMenuRole(QAction::ApplicationSpecificRole); - cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_PLUGINS); - mhelp->addAction(cmd, Constants::G_HELP_ABOUT); - tmpaction->setEnabled(true); - connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::aboutPlugins); - // About Qt Action - // tmpaction = new QAction(Tr::tr("About &Qt..."), this); - // cmd = ActionManager::registerAction(tmpaction, Constants:: ABOUT_QT); - // mhelp->addAction(cmd, Constants::G_HELP_ABOUT); - // tmpaction->setEnabled(true); - // connect(tmpaction, &QAction::triggered, qApp, &QApplication::aboutQt); - - // Change Log Action - tmpaction = new QAction(Tr::tr("Change Log..."), this); - tmpaction->setMenuRole(QAction::ApplicationSpecificRole); - cmd = ActionManager::registerAction(tmpaction, Constants::CHANGE_LOG); - mhelp->addAction(cmd, Constants::G_HELP_ABOUT); - tmpaction->setEnabled(true); - connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::changeLog); - - // Contact - tmpaction = new QAction(Tr::tr("Contact..."), this); - cmd = ActionManager::registerAction(tmpaction, "QtCreator.Contact"); - mhelp->addAction(cmd, Constants::G_HELP_ABOUT); - tmpaction->setEnabled(true); - connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::contact); - - // About sep - if (!HostOsInfo::isMacHost()) { // doesn't have the "About" actions in the Help menu - tmpaction = new QAction(this); - tmpaction->setSeparator(true); - cmd = ActionManager::registerAction(tmpaction, "QtCreator.Help.Sep.About"); - mhelp->addAction(cmd, Constants::G_HELP_ABOUT); - } -} - -void MainWindowPrivate::registerModeSelectorStyleActions() -{ - ActionContainer *mview = ActionManager::actionContainer(Constants::M_VIEW); - - // Cycle Mode Selector Styles - m_cycleModeSelectorStyleAction = new QAction(Tr::tr("Cycle Mode Selector Styles"), this); - ActionManager::registerAction(m_cycleModeSelectorStyleAction, Constants::CYCLE_MODE_SELECTOR_STYLE); - connect(m_cycleModeSelectorStyleAction, &QAction::triggered, this, [this] { - ModeManager::cycleModeStyle(); - updateModeSelectorStyleMenu(); - }); - - // Mode Selector Styles - ActionContainer *mmodeLayouts = ActionManager::createMenu(Constants::M_VIEW_MODESTYLES); - mview->addMenu(mmodeLayouts, Constants::G_VIEW_VIEWS); - QMenu *styleMenu = mmodeLayouts->menu(); - styleMenu->setTitle(Tr::tr("Mode Selector Style")); - auto *stylesGroup = new QActionGroup(styleMenu); - stylesGroup->setExclusive(true); - - m_setModeSelectorStyleIconsAndTextAction = stylesGroup->addAction(Tr::tr("Icons and Text")); - connect(m_setModeSelectorStyleIconsAndTextAction, &QAction::triggered, - [] { ModeManager::setModeStyle(ModeManager::Style::IconsAndText); }); - m_setModeSelectorStyleIconsAndTextAction->setCheckable(true); - m_setModeSelectorStyleIconsOnlyAction = stylesGroup->addAction(Tr::tr("Icons Only")); - connect(m_setModeSelectorStyleIconsOnlyAction, &QAction::triggered, - [] { ModeManager::setModeStyle(ModeManager::Style::IconsOnly); }); - m_setModeSelectorStyleIconsOnlyAction->setCheckable(true); - m_setModeSelectorStyleHiddenAction = stylesGroup->addAction(Tr::tr("Hidden")); - connect(m_setModeSelectorStyleHiddenAction, &QAction::triggered, - [] { ModeManager::setModeStyle(ModeManager::Style::Hidden); }); - m_setModeSelectorStyleHiddenAction->setCheckable(true); - - styleMenu->addActions(stylesGroup->actions()); -} - -void MainWindowPrivate::openFile() -{ - openFiles(EditorManager::getOpenFilePaths(), ICore::SwitchMode); -} - -static IDocumentFactory *findDocumentFactory(const QList<IDocumentFactory*> &fileFactories, - const FilePath &filePath) -{ - const QString typeName = Utils::mimeTypeForFile(filePath, MimeMatchMode::MatchDefaultAndRemote) - .name(); - return Utils::findOrDefault(fileFactories, [typeName](IDocumentFactory *f) { - return f->mimeTypes().contains(typeName); - }); -} - -/*! - * \internal - * Either opens \a filePaths with editors or loads a project. - * - * \a flags can be used to stop on first failure, indicate that a file name - * might include line numbers and/or switch mode to edit mode. - * - * \a workingDirectory is used when files are opened by a remote client, since - * the file names are relative to the client working directory. - * - * Returns the first opened document. Required to support the \c -block flag - * for client mode. - * - * \sa IPlugin::remoteArguments() - */ -IDocument *MainWindow::openFiles(const FilePaths &filePaths, - ICore::OpenFilesFlags flags, - const FilePath &workingDirectory) -{ - return MainWindowPrivate::openFiles(filePaths, flags, workingDirectory); -} - -IDocument *MainWindowPrivate::openFiles(const FilePaths &filePaths, - ICore::OpenFilesFlags flags, - const FilePath &workingDirectory) -{ - const QList<IDocumentFactory*> documentFactories = IDocumentFactory::allDocumentFactories(); - IDocument *res = nullptr; - - const FilePath workingDirBase = - workingDirectory.isEmpty() ? FilePath::currentWorkingPath() : workingDirectory; - for (const FilePath &filePath : filePaths) { - const FilePath absoluteFilePath = workingDirBase.resolvePath(filePath); - if (IDocumentFactory *documentFactory = findDocumentFactory(documentFactories, filePath)) { - IDocument *document = documentFactory->open(absoluteFilePath); - if (!document) { - if (flags & ICore::StopOnLoadFail) - return res; - } else { - if (!res) - res = document; - if (flags & ICore::SwitchMode) - ModeManager::activateMode(Id(Constants::MODE_EDIT)); - } - } else if (flags & (ICore::SwitchSplitIfAlreadyVisible | ICore::CanContainLineAndColumnNumbers) - || !res) { - QFlags<EditorManager::OpenEditorFlag> emFlags; - if (flags & ICore::SwitchSplitIfAlreadyVisible) - emFlags |= EditorManager::SwitchSplitIfAlreadyVisible; - IEditor *editor = nullptr; - if (flags & ICore::CanContainLineAndColumnNumbers) { - const Link &link = Link::fromString(absoluteFilePath.toString(), true); - editor = EditorManager::openEditorAt(link, {}, emFlags); - } else { - editor = EditorManager::openEditor(absoluteFilePath, {}, emFlags); - } - if (!editor) { - if (flags & ICore::StopOnLoadFail) - return res; - } else if (!res) { - res = editor->document(); - } - } else { - auto factory = IEditorFactory::preferredEditorFactories(absoluteFilePath).value(0); - DocumentModelPrivate::addSuspendedDocument(absoluteFilePath, {}, - factory ? factory->id() : Id()); - } - } - return res; -} - -void MainWindowPrivate::setFocusToEditor() -{ - EditorManagerPrivate::doEscapeKeyFocusMoveMagic(); -} - -static void acceptModalDialogs() -{ - const QWidgetList topLevels = QApplication::topLevelWidgets(); - QList<QDialog *> dialogsToClose; - for (QWidget *topLevel : topLevels) { - if (auto dialog = qobject_cast<QDialog *>(topLevel)) { - if (dialog->isModal()) - dialogsToClose.append(dialog); - } - } - for (QDialog *dialog : dialogsToClose) - dialog->accept(); -} - -void MainWindow::exit() -{ - // this function is most likely called from a user action - // that is from an event handler of an object - // since on close we are going to delete everything - // so to prevent the deleting of that object we - // just append it - QMetaObject::invokeMethod( - this, - [this] { - // Modal dialogs block the close event. So close them, in case this was triggered from - // a RestartDialog in the settings dialog. - acceptModalDialogs(); - close(); - }, - Qt::QueuedConnection); -} - -void MainWindow::openFileWith() -{ - const FilePaths filePaths = EditorManager::getOpenFilePaths(); - for (const FilePath &filePath : filePaths) { - bool isExternal; - const Id editorId = EditorManagerPrivate::getOpenWithEditorId(filePath, &isExternal); - if (!editorId.isValid()) - continue; - if (isExternal) - EditorManager::openExternalEditor(filePath, editorId); - else - EditorManagerPrivate::openEditorWith(filePath, editorId); - } -} - -void MainWindowPrivate::openFileFromDevice() -{ - openFiles(EditorManager::getOpenFilePaths(QFileDialog::DontUseNativeDialog), ICore::SwitchMode); -} - -IContext *MainWindow::contextObject(QWidget *widget) const -{ - const auto it = d->m_contextWidgets.find(widget); - return it == d->m_contextWidgets.end() ? nullptr : it->second; -} - -void MainWindow::addContextObject(IContext *context) -{ - if (!context) - return; - QWidget *widget = context->widget(); - if (d->m_contextWidgets.find(widget) != d->m_contextWidgets.end()) - return; - - d->m_contextWidgets.insert({widget, context}); - connect(context, &QObject::destroyed, this, [this, context] { removeContextObject(context); }); -} - -void MainWindow::removeContextObject(IContext *context) -{ - if (!context) - return; - - disconnect(context, &QObject::destroyed, this, nullptr); - - const auto it = std::find_if(d->m_contextWidgets.cbegin(), - d->m_contextWidgets.cend(), - [context](const std::pair<QWidget *, IContext *> &v) { - return v.second == context; - }); - if (it == d->m_contextWidgets.cend()) - return; - - d->m_contextWidgets.erase(it); - if (d->m_activeContext.removeAll(context) > 0) - d->updateContextObject(d->m_activeContext); -} - -void MainWindowPrivate::updateFocusWidget(QWidget *old, QWidget *now) -{ - Q_UNUSED(old) - - // Prevent changing the context object just because the menu or a menu item is activated - if (qobject_cast<QMenuBar*>(now) || qobject_cast<QMenu*>(now)) - return; - - QList<IContext *> newContext; - if (QWidget *p = QApplication::focusWidget()) { - IContext *context = nullptr; - while (p) { - context = q->contextObject(p); - if (context) - newContext.append(context); - p = p->parentWidget(); - } - } - - // ignore toplevels that define no context, like popups without parent - if (!newContext.isEmpty() || QApplication::focusWidget() == q->focusWidget()) - updateContextObject(newContext); -} - -void MainWindowPrivate::updateContextObject(const QList<IContext *> &context) -{ - emit m_coreImpl->contextAboutToChange(context); - m_activeContext = context; - updateContext(); - if (debugMainWindow) { - qDebug() << "new context objects =" << context; - for (const IContext *c : context) - qDebug() << (c ? c->widget() : nullptr) << (c ? c->widget()->metaObject()->className() : nullptr); - } -} - -void MainWindow::aboutToShutdown() -{ - disconnect(qApp, &QApplication::focusChanged, d, &MainWindowPrivate::updateFocusWidget); - for (auto contextPair : d->m_contextWidgets) - disconnect(contextPair.second, &QObject::destroyed, this, nullptr); - d->m_activeContext.clear(); - hide(); -} - -void MainWindowPrivate::readSettings() -{ - QtcSettings *settings = PluginManager::settings(); - settings->beginGroup(QLatin1String(settingsGroup)); - - if (m_overrideColor.isValid()) { - StyleHelper::setBaseColor(m_overrideColor); - // Get adapted base color. - m_overrideColor = StyleHelper::baseColor(); - } else { - StyleHelper::setBaseColor(settings->value(colorKey, - QColor(StyleHelper::DEFAULT_BASE_COLOR)).value<QColor>()); - } - - { - ModeManager::Style modeStyle = - ModeManager::Style(settings->value(modeSelectorLayoutKey, int(ModeManager::Style::IconsAndText)).toInt()); - - // Migrate legacy setting from Qt Creator 4.6 and earlier - static const char modeSelectorVisibleKey[] = "ModeSelectorVisible"; - if (!settings->contains(modeSelectorLayoutKey) && settings->contains(modeSelectorVisibleKey)) { - bool visible = settings->value(modeSelectorVisibleKey, true).toBool(); - modeStyle = visible ? ModeManager::Style::IconsAndText : ModeManager::Style::Hidden; - } - - ModeManager::setModeStyle(modeStyle); - updateModeSelectorStyleMenu(); - } - - if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) { - const bool isVisible = settings->value(menubarVisibleKey, true).toBool(); - - globalMenuBar()->setVisible(isVisible); - if (m_toggleMenubarAction) - m_toggleMenubarAction->setChecked(isVisible); - } - - settings->endGroup(); - - EditorManagerPrivate::readSettings(); - m_leftNavigationWidget->restoreSettings(settings); - m_rightNavigationWidget->restoreSettings(settings); - m_rightPaneWidget->readSettings(settings); -} - -void MainWindow::saveSettings() -{ - QtcSettings *settings = PluginManager::settings(); - settings->beginGroup(QLatin1String(settingsGroup)); - - if (!(d->m_overrideColor.isValid() && StyleHelper::baseColor() == d->m_overrideColor)) - settings->setValueWithDefault(colorKey, - StyleHelper::requestedBaseColor(), - QColor(StyleHelper::DEFAULT_BASE_COLOR)); - - if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) - settings->setValue(menubarVisibleKey, globalMenuBar()->isVisible()); - - settings->endGroup(); - - DocumentManager::saveSettings(); - ActionManager::saveSettings(); - EditorManagerPrivate::saveSettings(); - d->m_leftNavigationWidget->saveSettings(settings); - d->m_rightNavigationWidget->saveSettings(settings); - - // TODO Remove some time after Qt Creator 11 - // Work around Qt Creator <= 10 writing the default terminal to the settings. - // TerminalCommand writes the terminal to the settings when changing it, which usually is - // enough. But because of the bug in Qt Creator <= 10 we want to clean up the settings - // even if the user never touched the terminal setting. - if (HostOsInfo::isMacHost()) - TerminalCommand::setTerminalEmulator(TerminalCommand::terminalEmulator()); -} - -void MainWindowPrivate::saveWindowSettings() -{ - QtcSettings *settings = PluginManager::settings(); - settings->beginGroup(settingsGroup); - - // On OS X applications usually do not restore their full screen state. - // To be able to restore the correct non-full screen geometry, we have to put - // the window out of full screen before saving the geometry. - // Works around QTBUG-45241 - if (Utils::HostOsInfo::isMacHost() && q->isFullScreen()) - q->setWindowState(q->windowState() & ~Qt::WindowFullScreen); - settings->setValue(windowGeometryKey, q->saveGeometry()); - settings->setValue(windowStateKey, q->saveState()); - settings->setValue(modeSelectorLayoutKey, int(ModeManager::modeStyle())); - - settings->endGroup(); -} - -void MainWindowPrivate::updateModeSelectorStyleMenu() -{ - switch (ModeManager::modeStyle()) { - case ModeManager::Style::IconsAndText: - m_setModeSelectorStyleIconsAndTextAction->setChecked(true); - break; - case ModeManager::Style::IconsOnly: - m_setModeSelectorStyleIconsOnlyAction->setChecked(true); - break; - case ModeManager::Style::Hidden: - m_setModeSelectorStyleHiddenAction->setChecked(true); - break; - } -} - -void MainWindow::updateAdditionalContexts(const Context &remove, const Context &add, - ICore::ContextPriority priority) -{ - for (const Id id : remove) { - if (!id.isValid()) - continue; - int index = d->m_lowPrioAdditionalContexts.indexOf(id); - if (index != -1) - d->m_lowPrioAdditionalContexts.removeAt(index); - index = d->m_highPrioAdditionalContexts.indexOf(id); - if (index != -1) - d->m_highPrioAdditionalContexts.removeAt(index); - } - - for (const Id id : add) { - if (!id.isValid()) - continue; - Context &cref = (priority == ICore::ContextPriority::High ? d->m_highPrioAdditionalContexts - : d->m_lowPrioAdditionalContexts); - if (!cref.contains(id)) - cref.prepend(id); - } - - d->updateContext(); -} - -void MainWindowPrivate::updateContext() -{ - Context contexts = m_highPrioAdditionalContexts; - - for (IContext *context : std::as_const(m_activeContext)) - contexts.add(context->context()); - - contexts.add(m_lowPrioAdditionalContexts); - - Context uniquecontexts; - for (const Id &id : std::as_const(contexts)) { - if (!uniquecontexts.contains(id)) - uniquecontexts.add(id); - } - - ActionManager::setContext(uniquecontexts); - emit m_coreImpl->contextChanged(uniquecontexts); -} - -void MainWindowPrivate::aboutToShowRecentFiles() -{ - ActionContainer *aci = ActionManager::actionContainer(Constants::M_FILE_RECENTFILES); - QMenu *menu = aci->menu(); - menu->clear(); - - const QList<DocumentManager::RecentFile> recentFiles = DocumentManager::recentFiles(); - for (int i = 0; i < recentFiles.count(); ++i) { - const DocumentManager::RecentFile file = recentFiles[i]; - - const QString filePath = Utils::quoteAmpersands(file.first.shortNativePath()); - const QString actionText = ActionManager::withNumberAccelerator(filePath, i + 1); - QAction *action = menu->addAction(actionText); - connect(action, &QAction::triggered, this, [file] { - EditorManager::openEditor(file.first, file.second); - }); - } - - bool hasRecentFiles = !recentFiles.isEmpty(); - menu->setEnabled(hasRecentFiles); - - // add the Clear Menu item - if (hasRecentFiles) { - menu->addSeparator(); - QAction *action = menu->addAction(Tr::tr(Constants::TR_CLEAR_MENU)); - connect(action, &QAction::triggered, - DocumentManager::instance(), &DocumentManager::clearRecentFiles); - } -} - -void MainWindowPrivate::aboutQtCreator() -{ - if (!m_versionDialog) { - m_versionDialog = new VersionDialog(q); - connect(m_versionDialog, &QDialog::finished, - this, &MainWindowPrivate::destroyVersionDialog); - ICore::registerWindow(m_versionDialog, Context("Core.VersionDialog")); - m_versionDialog->show(); - } else { - ICore::raiseWindow(m_versionDialog); - } -} - -void MainWindowPrivate::destroyVersionDialog() -{ - if (m_versionDialog) { - m_versionDialog->deleteLater(); - m_versionDialog = nullptr; - } -} - -void MainWindowPrivate::aboutPlugins() -{ - PluginDialog dialog(q); - dialog.exec(); -} - -class LogDialog : public QDialog -{ -public: - LogDialog(QWidget *parent) - : QDialog(parent) - {} - bool event(QEvent *event) override - { - if (event->type() == QEvent::ShortcutOverride) { - auto ke = static_cast<QKeyEvent *>(event); - if (ke->key() == Qt::Key_Escape && !ke->modifiers()) { - ke->accept(); - return true; - } - } - return QDialog::event(event); - } -}; - -void MainWindowPrivate::changeLog() -{ - static QPointer<LogDialog> dialog; - if (dialog) { - ICore::raiseWindow(dialog); - return; - } - const FilePaths files = - ICore::resourcePath("changelog").dirEntries({{"changes-*"}, QDir::Files}); - static const QRegularExpression versionRegex("\\d+[.]\\d+[.]\\d+"); - using VersionFilePair = std::pair<QVersionNumber, FilePath>; - QList<VersionFilePair> versionedFiles = Utils::transform(files, [](const FilePath &fp) { - const QRegularExpressionMatch match = versionRegex.match(fp.fileName()); - const QVersionNumber version = match.hasMatch() - ? QVersionNumber::fromString(match.captured()) - : QVersionNumber(); - return std::make_pair(version, fp); - }); - Utils::sort(versionedFiles, [](const VersionFilePair &a, const VersionFilePair &b) { - return a.first > b.first; - }); - - auto versionCombo = new QComboBox; - for (const VersionFilePair &f : versionedFiles) - versionCombo->addItem(f.first.toString()); - dialog = new LogDialog(ICore::dialogParent()); - auto versionLayout = new QHBoxLayout; - versionLayout->addWidget(new QLabel(Tr::tr("Version:"))); - versionLayout->addWidget(versionCombo); - versionLayout->addStretch(1); - auto showInExplorer = new QPushButton(FileUtils::msgGraphicalShellAction()); - versionLayout->addWidget(showInExplorer); - auto textEdit = new QTextBrowser; - textEdit->setOpenExternalLinks(true); - - auto aggregate = new Aggregation::Aggregate; - aggregate->add(textEdit); - aggregate->add(new Core::BaseTextFind(textEdit)); - - new MarkdownHighlighter(textEdit->document()); - - auto textEditWidget = new QFrame; - textEditWidget->setFrameStyle(QFrame::NoFrame); - auto findToolBar = new FindToolBarPlaceHolder(dialog); - findToolBar->setLightColored(true); - auto textEditLayout = new QVBoxLayout; - textEditLayout->setContentsMargins(0, 0, 0, 0); - textEditLayout->setSpacing(0); - textEditLayout->addWidget(textEdit); - textEditLayout->addWidget(findToolBar); - textEditWidget->setLayout(textEditLayout); - auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); - auto dialogLayout = new QVBoxLayout; - dialogLayout->addLayout(versionLayout); - dialogLayout->addWidget(textEditWidget); - dialogLayout->addWidget(buttonBox); - dialog->setLayout(dialogLayout); - dialog->resize(700, 600); - dialog->setWindowTitle(Tr::tr("Change Log")); - dialog->setAttribute(Qt::WA_DeleteOnClose); - ICore::registerWindow(dialog, Context("CorePlugin.VersionDialog")); - - connect(buttonBox, &QDialogButtonBox::rejected, dialog, &QDialog::close); - QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close); - if (QTC_GUARD(closeButton)) - closeButton->setDefault(true); // grab from "Open in Explorer" button - - const auto showLog = [textEdit, versionedFiles](int index) { - if (index < 0 || index >= versionedFiles.size()) - return; - const FilePath file = versionedFiles.at(index).second; - QString contents = QString::fromUtf8(file.fileContents().value_or(QByteArray())); - // (?<![[\/]) == don't replace if it is preceded by "[" or "/" - // i.e. if it already is part of a link - static const QRegularExpression bugexpr(R"((?<![[\/])((QT(CREATOR)?BUG|PYSIDE)-\d+))"); - contents.replace(bugexpr, R"([\1](https://bugreports.qt.io/browse/\1))"); - static const QRegularExpression docexpr("https://doc[.]qt[.]io/qtcreator/([.a-zA-Z/_-]*)"); - QList<QRegularExpressionMatch> matches; - for (const QRegularExpressionMatch &m : docexpr.globalMatch(contents)) - matches.append(m); - Utils::reverseForeach(matches, [&contents](const QRegularExpressionMatch &match) { - const QString qthelpUrl = "qthelp://org.qt-project.qtcreator/doc/" + match.captured(1); - if (!HelpManager::fileData(qthelpUrl).isEmpty()) - contents.replace(match.capturedStart(), match.capturedLength(), qthelpUrl); - }); - textEdit->setMarkdown(contents); - }; - connect(versionCombo, &QComboBox::currentIndexChanged, textEdit, showLog); - showLog(versionCombo->currentIndex()); - - connect(showInExplorer, &QPushButton::clicked, this, [versionCombo, versionedFiles] { - const int index = versionCombo->currentIndex(); - if (index >= 0 && index < versionedFiles.size()) - FileUtils::showInGraphicalShell(ICore::dialogParent(), versionedFiles.at(index).second); - else - FileUtils::showInGraphicalShell(ICore::dialogParent(), ICore::resourcePath("changelog")); - }); - - dialog->show(); -} - -void MainWindowPrivate::contact() -{ - QMessageBox dlg(QMessageBox::Information, Tr::tr("Contact"), - Tr::tr("<p>Qt Creator developers can be reached at the Qt Creator mailing list:</p>" - "%1" - "<p>or the #qt-creator channel on Libera.Chat IRC:</p>" - "%2" - "<p>Our bug tracker is located at %3.</p>" - "<p>Please use %4 for bigger chunks of text.</p>") - .arg("<p>    " - "<a href=\"https://lists.qt-project.org/listinfo/qt-creator\">" - "mailto:qt-creator@qt-project.org" - "</a></p>") - .arg("<p>    " - "<a href=\"https://web.libera.chat/#qt-creator\">" - "https://web.libera.chat/#qt-creator" - "</a></p>") - .arg("<a href=\"https://bugreports.qt.io/projects/QTCREATORBUG\">" - "https://bugreports.qt.io" - "</a>") - .arg("<a href=\"https://pastebin.com\">" - "https://pastebin.com" - "</a>"), - QMessageBox::Ok, q); - dlg.exec(); -} - -QPrinter *MainWindow::printer() const -{ - if (!d->m_printer) - d->m_printer = new QPrinter(QPrinter::HighResolution); - return d->m_printer; -} - -void MainWindowPrivate::restoreWindowState() -{ - NANOTRACE_SCOPE("Core", "MainWindow::restoreWindowState"); - QtcSettings *settings = PluginManager::settings(); - settings->beginGroup(settingsGroup); - if (!q->restoreGeometry(settings->value(windowGeometryKey).toByteArray())) - q->resize(1260, 700); // size without window decoration - q->restoreState(settings->value(windowStateKey).toByteArray()); - settings->endGroup(); - q->show(); - StatusBarManager::restoreSettings(); -} - -} // namespace Internal -} // namespace Core diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index c1cb685e072..fe84d72dcb3 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -3,81 +3,4 @@ #pragma once -#include "icontext.h" #include "icore.h" - -#include <utils/appmainwindow.h> - -#include <functional> - -QT_BEGIN_NAMESPACE -class QColor; -class QPrinter; -QT_END_NAMESPACE - -namespace Utils { class InfoBar; } - -namespace Core { - -class IDocument; - -namespace Internal { - -class MainWindowPrivate; - -class MainWindow : public Utils::AppMainWindow -{ - Q_OBJECT - -public: - MainWindow(); - ~MainWindow() override; - - void init(); - void extensionsInitialized(); - void aboutToShutdown(); - - IContext *contextObject(QWidget *widget) const; - void addContextObject(IContext *context); - void removeContextObject(IContext *context); - - static IDocument *openFiles(const Utils::FilePaths &filePaths, - ICore::OpenFilesFlags flags, - const Utils::FilePath &workingDirectory = {}); - - QPrinter *printer() const; - IContext *currentContextObject() const; - QStatusBar *statusBar() const; - Utils::InfoBar *infoBar() const; - - void updateAdditionalContexts(const Context &remove, const Context &add, - ICore::ContextPriority priority); - - void setOverrideColor(const QColor &color); - - QStringList additionalAboutInformation() const; - void clearAboutInformation(); - void appendAboutInformation(const QString &line); - - void addPreCloseListener(const std::function<bool()> &listener); - - void saveSettings(); - - void restart(); - - void restartTrimmer(); - -public slots: - static void openFileWith(); - void exit(); - -private: - void closeEvent(QCloseEvent *event) override; - void keyPressEvent(QKeyEvent *event) override; - void mousePressEvent(QMouseEvent *event) override; - - MainWindowPrivate *d = nullptr; -}; - -} // namespace Internal -} // namespace Core From 9e241add5f717ba461a2d258e0a4f59813ce9af7 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 25 Sep 2023 17:52:44 +0200 Subject: [PATCH 1282/1777] ProjectExplorer: Remove an unused include Change-Id: I46e5a2e3cdd4b3abc6108a8d07f35d7a4d6a51f1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/projectexplorer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index b85e7abafce..e5dc64d79c9 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -49,7 +49,6 @@ #include "kitfeatureprovider.h" #include "kitaspects.h" #include "kitmanager.h" -#include "kitoptionspage.h" #include "miniprojecttargetselector.h" #include "namedwidget.h" #include "parseissuesdialog.h" From b60a4705d0d91a8c2c34c3a52e5031b9704a08c2 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 26 Sep 2023 09:20:26 +0200 Subject: [PATCH 1283/1777] CompilerExplorer: Add wizard template Also include "src/plugins/**/wizard.json" into .gitignore. Change-Id: Ib0576df15af4c112a4a27101d337522db6c19f25 Reviewed-by: David Schulz <david.schulz@qt.io> --- .gitignore | 1 + src/plugins/compilerexplorer/CMakeLists.txt | 4 +- .../compilerexplorer/compilerexplorer.qbs | 3 ++ .../compilerexplorer/compilerexplorer.qrc | 6 +++ .../compilerexplorereditor.cpp | 3 ++ .../compilerexplorerplugin.cpp | 8 +++- .../compilerexplorer/wizard/cpp/file.qtce | 10 +++++ .../compilerexplorer/wizard/cpp/wizard.json | 37 +++++++++++++++++++ 8 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 src/plugins/compilerexplorer/compilerexplorer.qrc create mode 100644 src/plugins/compilerexplorer/wizard/cpp/file.qtce create mode 100644 src/plugins/compilerexplorer/wizard/cpp/wizard.json diff --git a/.gitignore b/.gitignore index 6cbeb2503d5..7c56e80373d 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,7 @@ CMakeLists.txt.user* /share/qtcreator/qmldesigner/QtProject/ /src/app/Info.plist /src/plugins/**/*.json +!/src/plugins/**/wizard.json /src/plugins/coreplugin/ide_version.h /src/libs/qt-breakpad/bin /.cmake/ diff --git a/src/plugins/compilerexplorer/CMakeLists.txt b/src/plugins/compilerexplorer/CMakeLists.txt index 4df45f95f30..55368044706 100644 --- a/src/plugins/compilerexplorer/CMakeLists.txt +++ b/src/plugins/compilerexplorer/CMakeLists.txt @@ -1,5 +1,5 @@ add_qtc_plugin(CompilerExplorer - PLUGIN_DEPENDS Core TextEditor + PLUGIN_DEPENDS Core ProjectExplorer TextEditor DEPENDS Qt::Network TerminalLib Spinner SOURCES api/config.h @@ -14,6 +14,8 @@ add_qtc_plugin(CompilerExplorer api/library.h api/request.h + compilerexplorer.qrc + compilerexploreraspects.cpp compilerexploreraspects.h compilerexplorerplugin.cpp diff --git a/src/plugins/compilerexplorer/compilerexplorer.qbs b/src/plugins/compilerexplorer/compilerexplorer.qbs index 88fda3bf616..47eb03f9e46 100644 --- a/src/plugins/compilerexplorer/compilerexplorer.qbs +++ b/src/plugins/compilerexplorer/compilerexplorer.qbs @@ -4,6 +4,7 @@ QtcPlugin { name: "CompilerExplorer" Depends { name: "Core" } + Depends { name: "ProjectExplorer" } Depends { name: "Spinner" } Depends { name: "TerminalLib" } Depends { name: "TextEditor" } @@ -22,6 +23,8 @@ QtcPlugin { "api/library.h", "api/request.h", + "compilerexplorer.qrc", + "compilerexploreraspects.cpp", "compilerexploreraspects.h", "compilerexplorerconstants.h", diff --git a/src/plugins/compilerexplorer/compilerexplorer.qrc b/src/plugins/compilerexplorer/compilerexplorer.qrc new file mode 100644 index 00000000000..592a92d463a --- /dev/null +++ b/src/plugins/compilerexplorer/compilerexplorer.qrc @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="/compilerexplorer/wizard/"> + <file>wizard/cpp/wizard.json</file> + <file>wizard/cpp/file.qtce</file> + </qresource> +</RCC> diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index b02b3585ace..633ac3622be 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -136,6 +136,8 @@ Core::IDocument::OpenResult JsonSettingsDocument::open(QString *errorString, return OpenResult::ReadError; } + setFilePath(filePath); + m_ceSettings.fromMap(*result); emit settingsChanged(); return OpenResult::Success; @@ -171,6 +173,7 @@ bool JsonSettingsDocument::saveImpl(QString *errorString, const FilePath &newFil return false; } + emit changed(); return true; } diff --git a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp index 5845aa7dea2..4063814e6ca 100644 --- a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp +++ b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp @@ -14,10 +14,12 @@ #include <cppeditor/cppeditorconstants.h> -#include <QMenu> - #include <extensionsystem/iplugin.h> +#include <projectexplorer/jsonwizard/jsonwizardfactory.h> + +#include <QMenu> + using namespace Core; namespace CompilerExplorer::Internal { @@ -40,6 +42,8 @@ public: settings().defaultDocument().toUtf8()); }); + ProjectExplorer::JsonWizardFactory::addWizardPath(":/compilerexplorer/wizard/"); + ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS); ActionContainer *mCompilerExplorer = ActionManager::createMenu("Tools.CompilerExplorer"); QMenu *menu = mCompilerExplorer->menu(); diff --git a/src/plugins/compilerexplorer/wizard/cpp/file.qtce b/src/plugins/compilerexplorer/wizard/cpp/file.qtce new file mode 100644 index 00000000000..903d5187165 --- /dev/null +++ b/src/plugins/compilerexplorer/wizard/cpp/file.qtce @@ -0,0 +1,10 @@ +{ + "Sources": [{ + "LanguageId": "c++", + "Source": "int main() {\n return 0;\n}", + "Compilers": [{ + "Id": "clang_trunk", + "Options": "-O3" + }] + }] +} diff --git a/src/plugins/compilerexplorer/wizard/cpp/wizard.json b/src/plugins/compilerexplorer/wizard/cpp/wizard.json new file mode 100644 index 00000000000..b736551b69e --- /dev/null +++ b/src/plugins/compilerexplorer/wizard/cpp/wizard.json @@ -0,0 +1,37 @@ +{ + "version": 1, + "supportedProjectTypes": [], + "id": "QTCE.CppSource", + "category": "U.CompilerExplorer", + "trDescription": "Creates an example CompilerExplorer setup for C++.", + "trDisplayName": "Compiler Explorer C++ Source", + "trDisplayCategory": "Compiler Explorer", + "icon": "", + "iconKind": "Plain", + "options": { + "key": "DefaultSuffix", + "value": "%{JS: Util.preferredSuffix('application/compiler-explorer')}" + }, + "pages": [ + { + "trDisplayName": "Location", + "trShortTitle": "Location", + "typeId": "File" + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": [ + { + "typeId": "File", + "data": { + "source": "file.qtce", + "target": "%{JS: Util.fileName(value('TargetPath'), value('DefaultSuffix'))}", + "openInEditor": true + } + } + ] +} From 6e1c9825e8a1a0fb0cf5c445f88ffea3b91e8684 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 26 Sep 2023 09:35:49 +0200 Subject: [PATCH 1284/1777] CompilerExplorer: Add python template Change-Id: If838a2a89df98763dc424fb6285daa4699cce7ab Reviewed-by: David Schulz <david.schulz@qt.io> --- .../compilerexplorer/compilerexplorer.qrc | 2 + .../compilerexplorer/wizard/python/file.qtce | 9 +++++ .../wizard/python/wizard.json | 37 +++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 src/plugins/compilerexplorer/wizard/python/file.qtce create mode 100644 src/plugins/compilerexplorer/wizard/python/wizard.json diff --git a/src/plugins/compilerexplorer/compilerexplorer.qrc b/src/plugins/compilerexplorer/compilerexplorer.qrc index 592a92d463a..ea46de321c6 100644 --- a/src/plugins/compilerexplorer/compilerexplorer.qrc +++ b/src/plugins/compilerexplorer/compilerexplorer.qrc @@ -2,5 +2,7 @@ <qresource prefix="/compilerexplorer/wizard/"> <file>wizard/cpp/wizard.json</file> <file>wizard/cpp/file.qtce</file> + <file>wizard/python/wizard.json</file> + <file>wizard/python/file.qtce</file> </qresource> </RCC> diff --git a/src/plugins/compilerexplorer/wizard/python/file.qtce b/src/plugins/compilerexplorer/wizard/python/file.qtce new file mode 100644 index 00000000000..5cd735227c9 --- /dev/null +++ b/src/plugins/compilerexplorer/wizard/python/file.qtce @@ -0,0 +1,9 @@ +{ + "Sources": [{ + "LanguageId": "python", + "Source": "def main():\\n print(\\"Hello World\\")\\n\\nif __name__ == \\"__main__\\":\\n main()", + "Compilers": [{ + "Id": "python311" + }] + }] +} diff --git a/src/plugins/compilerexplorer/wizard/python/wizard.json b/src/plugins/compilerexplorer/wizard/python/wizard.json new file mode 100644 index 00000000000..b026adb4cdb --- /dev/null +++ b/src/plugins/compilerexplorer/wizard/python/wizard.json @@ -0,0 +1,37 @@ +{ + "version": 1, + "supportedProjectTypes": [], + "id": "QTCE.PySource", + "category": "U.CompilerExplorer", + "trDescription": "Creates an example CompilerExplorer setup for Python.", + "trDisplayName": "Compiler Explorer Python Source", + "trDisplayCategory": "Compiler Explorer", + "icon": "", + "iconKind": "Plain", + "options": { + "key": "DefaultSuffix", + "value": "%{JS: Util.preferredSuffix('application/compiler-explorer')}" + }, + "pages": [ + { + "trDisplayName": "Location", + "trShortTitle": "Location", + "typeId": "File" + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": [ + { + "typeId": "File", + "data": { + "source": "file.qtce", + "target": "%{JS: Util.fileName(value('TargetPath'), value('DefaultSuffix'))}", + "openInEditor": true + } + } + ] +} From bb8961c893be5d023f73bcb56f6bfab8b0178753 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 26 Sep 2023 10:28:49 +0200 Subject: [PATCH 1285/1777] CompilerExplorer: Cleanup Split up EditorWidget constructor into member functions. Change-Id: I4c762671263b802612a750568f608ac1823b41a4 Reviewed-by: David Schulz <david.schulz@qt.io> --- .../compilerexplorereditor.cpp | 373 ++++++++++-------- .../compilerexplorer/compilerexplorereditor.h | 23 +- 2 files changed, 233 insertions(+), 163 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 633ac3622be..2a184152d24 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -323,11 +323,6 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett m_spinner = new SpinnerSolution::Spinner(SpinnerSolution::SpinnerSize::Large, this); } -CompilerWidget::~CompilerWidget() -{ - qDebug() << "Good bye!"; -} - Core::SearchableTerminal *CompilerWidget::createTerminal() { m_resultTerminal = new Core::SearchableTerminal(); @@ -477,172 +472,31 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, QWidget *parent) : Utils::FancyMainWindow(parent) , m_document(document) + , m_undoStack(undoStack) + , m_actionHandler(actionHandler) { setAutoHideTitleBars(false); setDockNestingEnabled(true); setDocumentMode(true); setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::TabPosition::South); - document->setWindowStateCallback([this] { - auto settings = saveSettings(); - QVariantMap result; + document->setWindowStateCallback([this] { return windowStateCallback(); }); - for (const auto &key : settings.keys()) { - // QTBUG-116339 - if (key != "State") { - result.insert(key, settings.value(key)); - } else { - QVariantMap m; - m["type"] = "Base64"; - m["value"] = settings.value(key).toByteArray().toBase64(); - result.insert(key, m); - } - } + document->settings()->m_sources.setItemAddedCallback<SourceSettings>( + [this](const std::shared_ptr<SourceSettings> &source) { addSourceEditor(source); }); - return result; + document->settings()->m_sources.setItemRemovedCallback<SourceSettings>( + [this](const std::shared_ptr<SourceSettings> &source) { removeSourceEditor(source); }); + + connect(document.get(), + &JsonSettingsDocument::settingsChanged, + this, + &EditorWidget::recreateEditors); + + connect(this, &EditorWidget::gotFocus, this, [&actionHandler] { + actionHandler.updateCurrentEditor(); }); - auto addCompiler = [this, - &actionHandler](const std::shared_ptr<SourceSettings> &sourceSettings, - const std::shared_ptr<CompilerSettings> &compilerSettings, - int idx) { - auto compiler = new CompilerWidget(sourceSettings, compilerSettings); - compiler->setWindowTitle("Compiler #" + QString::number(idx)); - compiler->setObjectName("compiler_" + QString::number(idx)); - QDockWidget *dockWidget = addDockForWidget(compiler); - addDockWidget(Qt::RightDockWidgetArea, dockWidget); - m_compilerWidgets.append(dockWidget); - - connect(compiler, - &CompilerWidget::remove, - this, - [sourceSettings = sourceSettings.get(), compilerSettings = compilerSettings.get()] { - sourceSettings->compilers.removeItem(compilerSettings->shared_from_this()); - }); - - connect(compiler, &CompilerWidget::gotFocus, this, [&actionHandler] { - actionHandler.updateCurrentEditor(); - }); - }; - - auto addSourceEditor = [this, &actionHandler, document = document.get(), addCompiler, undoStack]( - const std::shared_ptr<SourceSettings> &sourceSettings) { - auto sourceEditor = new SourceEditorWidget(sourceSettings, undoStack); - sourceEditor->setWindowTitle("Source Code #" + QString::number(m_sourceWidgets.size() + 1)); - sourceEditor->setObjectName("source_code_editor_" - + QString::number(m_sourceWidgets.size() + 1)); - - QDockWidget *dockWidget = addDockForWidget(sourceEditor); - connect(sourceEditor, - &SourceEditorWidget::remove, - this, - [document, sourceSettings = sourceSettings.get()] { - document->settings()->m_sources.removeItem(sourceSettings->shared_from_this()); - }); - - connect(sourceEditor, &SourceEditorWidget::addCompiler, this, [sourceSettings] { - auto newCompiler = std::make_shared<CompilerSettings>( - sourceSettings->apiConfigFunction()); - newCompiler->setLanguageId(sourceSettings->languageId()); - sourceSettings->compilers.addItem(newCompiler); - }); - - connect(sourceEditor, &SourceEditorWidget::gotFocus, this, [&actionHandler] { - actionHandler.updateCurrentEditor(); - }); - - addDockWidget(Qt::LeftDockWidgetArea, dockWidget); - - sourceSettings->compilers.forEachItem<CompilerSettings>( - [addCompiler, sourceSettings](const std::shared_ptr<CompilerSettings> &compilerSettings, - int idx) { - addCompiler(sourceSettings, compilerSettings, idx + 1); - }); - - sourceSettings->compilers.setItemAddedCallback<CompilerSettings>( - [addCompiler, sourceSettings = sourceSettings.get()]( - const std::shared_ptr<CompilerSettings> &compilerSettings) { - addCompiler(sourceSettings->shared_from_this(), - compilerSettings, - sourceSettings->compilers.size()); - }); - - sourceSettings->compilers.setItemRemovedCallback<CompilerSettings>( - [this](const std::shared_ptr<CompilerSettings> &compilerSettings) { - auto it = std::find_if(m_compilerWidgets.begin(), - m_compilerWidgets.end(), - [compilerSettings](const QDockWidget *c) { - return static_cast<CompilerWidget *>(c->widget()) - ->m_compilerSettings - == compilerSettings; - }); - QTC_ASSERT(it != m_compilerWidgets.end(), return); - delete *it; - m_compilerWidgets.erase(it); - }); - - /*Aggregate *agg = Aggregate::parentAggregate(sourceEditor); - if (!agg) { - agg = new Aggregate; - agg->add(sourceEditor); - } - agg->add(this); - - setFocusProxy(sourceEditor); -*/ - m_sourceWidgets.append(dockWidget); - }; - - auto removeSourceEditor = [this](const std::shared_ptr<SourceSettings> &sourceSettings) { - auto it = std::find_if(m_sourceWidgets.begin(), - m_sourceWidgets.end(), - [sourceSettings](const QDockWidget *c) { - return static_cast<SourceEditorWidget *>(c->widget()) - ->sourceSettings() - == sourceSettings.get(); - }); - QTC_ASSERT(it != m_sourceWidgets.end(), return); - delete *it; - m_sourceWidgets.erase(it); - }; - - auto recreateEditors = [this, addSourceEditor]() { - qDeleteAll(m_sourceWidgets); - qDeleteAll(m_compilerWidgets); - - m_sourceWidgets.clear(); - m_compilerWidgets.clear(); - - m_document->settings()->m_sources.forEachItem<SourceSettings>(addSourceEditor); - QVariantMap windowState = m_document->settings()->windowState.value(); - - if (!windowState.isEmpty()) { - QHash<QString, QVariant> hashMap; - for (const auto &key : windowState.keys()) { - if (key != "State") - hashMap.insert(key, windowState.value(key)); - else { - QVariant v = windowState.value(key); - if (v.userType() == QMetaType::QByteArray) { - hashMap.insert(key, v); - } else if (v.userType() == QMetaType::QVariantMap) { - QVariantMap m = v.toMap(); - if (m.value("type") == "Base64") { - hashMap.insert(key, - QByteArray::fromBase64(m.value("value").toByteArray())); - } - } - } - } - - restoreSettings(hashMap); - } - }; - - document->settings()->m_sources.setItemAddedCallback<SourceSettings>(addSourceEditor); - document->settings()->m_sources.setItemRemovedCallback<SourceSettings>(removeSourceEditor); - connect(document.get(), &JsonSettingsDocument::settingsChanged, this, recreateEditors); - m_context = new Core::IContext(this); m_context->setWidget(this); m_context->setContext(Core::Context(Constants::CE_EDITOR_CONTEXT_ID)); @@ -655,6 +509,203 @@ EditorWidget::~EditorWidget() m_sourceWidgets.clear(); } +void EditorWidget::focusInEvent(QFocusEvent *event) +{ + emit gotFocus(); + FancyMainWindow::focusInEvent(event); +} + +void EditorWidget::addCompiler(const std::shared_ptr<SourceSettings> &sourceSettings, + const std::shared_ptr<CompilerSettings> &compilerSettings, + int idx, + QDockWidget *parentDockWidget) +{ + auto compiler = new CompilerWidget(sourceSettings, compilerSettings); + compiler->setWindowTitle("Compiler #" + QString::number(idx)); + compiler->setObjectName("compiler_" + QString::number(idx)); + QDockWidget *dockWidget = addDockForWidget(compiler, parentDockWidget); + addDockWidget(Qt::RightDockWidgetArea, dockWidget); + m_compilerWidgets.append(dockWidget); + + connect(compiler, + &CompilerWidget::remove, + this, + [sourceSettings = sourceSettings.get(), compilerSettings = compilerSettings.get()] { + sourceSettings->compilers.removeItem(compilerSettings->shared_from_this()); + }); + + connect(compiler, &CompilerWidget::gotFocus, this, [this]() { + m_actionHandler.updateCurrentEditor(); + }); +} + +QVariantMap EditorWidget::windowStateCallback() +{ + auto settings = saveSettings(); + QVariantMap result; + + for (const auto &key : settings.keys()) { + // QTBUG-116339 + if (key != "State") { + result.insert(key, settings.value(key)); + } else { + QVariantMap m; + m["type"] = "Base64"; + m["value"] = settings.value(key).toByteArray().toBase64(); + result.insert(key, m); + } + } + + return result; +} + +void EditorWidget::addSourceEditor(const std::shared_ptr<SourceSettings> &sourceSettings) +{ + auto sourceEditor = new SourceEditorWidget(sourceSettings, m_undoStack); + sourceEditor->setWindowTitle("Source Code #" + QString::number(m_sourceWidgets.size() + 1)); + sourceEditor->setObjectName("source_code_editor_" + QString::number(m_sourceWidgets.size() + 1)); + + QDockWidget *dockWidget = addDockForWidget(sourceEditor); + connect(sourceEditor, &SourceEditorWidget::remove, this, [this, sourceSettings]() { + m_undoStack->beginMacro("Remove source"); + sourceSettings->compilers.clear(); + m_document->settings()->m_sources.removeItem(sourceSettings->shared_from_this()); + m_undoStack->endMacro(); + + setupHelpWidget(); + }); + + connect(sourceEditor, &SourceEditorWidget::addCompiler, this, [sourceSettings]() { + auto newCompiler = std::make_shared<CompilerSettings>(sourceSettings->apiConfigFunction()); + newCompiler->setLanguageId(sourceSettings->languageId()); + sourceSettings->compilers.addItem(newCompiler); + }); + + connect(sourceEditor, &SourceEditorWidget::gotFocus, this, [this]() { + m_actionHandler.updateCurrentEditor(); + }); + + addDockWidget(Qt::LeftDockWidgetArea, dockWidget); + + sourceSettings->compilers.forEachItem<CompilerSettings>( + [this, sourceSettings, dockWidget](const std::shared_ptr<CompilerSettings> &compilerSettings, + int idx) { + addCompiler(sourceSettings, compilerSettings, idx + 1, dockWidget); + }); + + sourceSettings->compilers.setItemAddedCallback<CompilerSettings>( + [this, sourceSettings, dockWidget]( + const std::shared_ptr<CompilerSettings> &compilerSettings) { + addCompiler(sourceSettings->shared_from_this(), + compilerSettings, + sourceSettings->compilers.size(), + dockWidget); + }); + + sourceSettings->compilers.setItemRemovedCallback<CompilerSettings>( + [this, sourceSettings](const std::shared_ptr<CompilerSettings> &compilerSettings) { + auto it = std::find_if(m_compilerWidgets.begin(), + m_compilerWidgets.end(), + [compilerSettings](const QDockWidget *c) { + return static_cast<CompilerWidget *>(c->widget()) + ->m_compilerSettings + == compilerSettings; + }); + QTC_ASSERT(it != m_compilerWidgets.end(), return); + delete *it; + m_compilerWidgets.erase(it); + }); + + m_sourceWidgets.append(dockWidget); + + setupHelpWidget(); +} + +void EditorWidget::removeSourceEditor(const std::shared_ptr<SourceSettings> &sourceSettings) +{ + auto it + = std::find_if(m_sourceWidgets.begin(), + m_sourceWidgets.end(), + [sourceSettings](const QDockWidget *c) { + return static_cast<SourceEditorWidget *>(c->widget())->sourceSettings() + == sourceSettings.get(); + }); + QTC_ASSERT(it != m_sourceWidgets.end(), return); + delete *it; + m_sourceWidgets.erase(it); +} + +void EditorWidget::recreateEditors() +{ + qDeleteAll(m_sourceWidgets); + qDeleteAll(m_compilerWidgets); + + m_sourceWidgets.clear(); + m_compilerWidgets.clear(); + + m_document->settings()->m_sources.forEachItem<SourceSettings>( + [this](const auto &sourceSettings) { addSourceEditor(sourceSettings); }); + + QVariantMap windowState = m_document->settings()->windowState.value(); + + if (!windowState.isEmpty()) { + QHash<QString, QVariant> hashMap; + for (const auto &key : windowState.keys()) { + if (key != "State") + hashMap.insert(key, windowState.value(key)); + else { + QVariant v = windowState.value(key); + if (v.userType() == QMetaType::QByteArray) { + hashMap.insert(key, v); + } else if (v.userType() == QMetaType::QVariantMap) { + QVariantMap m = v.toMap(); + if (m.value("type") == "Base64") { + hashMap.insert(key, QByteArray::fromBase64(m.value("value").toByteArray())); + } + } + } + } + + restoreSettings(hashMap); + } +} + +void EditorWidget::setupHelpWidget() +{ + if (m_document->settings()->m_sources.size() == 0) { + setCentralWidget(createHelpWidget()); + } else { + delete takeCentralWidget(); + } +} + +QWidget *EditorWidget::createHelpWidget() const +{ + using namespace Layouting; + + auto addSourceButton = new QPushButton(Tr::tr("Add source code")); + connect(addSourceButton, &QPushButton::clicked, this, [this] { + auto newSource = std::make_shared<SourceSettings>( + [settings = m_document->settings()] { return settings->apiConfig(); }); + m_document->settings()->m_sources.addItem(newSource); + }); + + // clang-format off + return Column { + st, + Row { + st, + Column { + Tr::tr("No source code added yet. Add one using the button below."), + Row { st, addSourceButton, st } + }, + st, + }, + st, + }.emerge(); + // clang-format on +} + TextEditor::TextEditorWidget *EditorWidget::focusedEditorWidget() const { for (const QDockWidget *sourceWidget : m_sourceWidgets) { diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.h b/src/plugins/compilerexplorer/compilerexplorereditor.h index 54befd824ef..7b827aa1625 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.h +++ b/src/plugins/compilerexplorer/compilerexplorereditor.h @@ -140,8 +140,6 @@ public: CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSettings, const std::shared_ptr<CompilerSettings> &compilerSettings); - ~CompilerWidget(); - Core::SearchableTerminal *createTerminal(); void compile(const QString &source); @@ -188,11 +186,32 @@ public: signals: void sourceCodeChanged(); + void gotFocus(); + +protected: + void focusInEvent(QFocusEvent *event) override; + + void setupHelpWidget(); + QWidget *createHelpWidget() const; + + void addCompiler(const std::shared_ptr<SourceSettings> &sourceSettings, + const std::shared_ptr<CompilerSettings> &compilerSettings, + int idx, + QDockWidget *parentDockWidget); + + void addSourceEditor(const std::shared_ptr<SourceSettings> &sourceSettings); + void removeSourceEditor(const std::shared_ptr<SourceSettings> &sourceSettings); + + void recreateEditors(); + + QVariantMap windowStateCallback(); private: QSplitter *m_mainSplitter; int m_compilerCount{0}; QSharedPointer<JsonSettingsDocument> m_document; + QUndoStack *m_undoStack; + TextEditor::TextEditorActionHandler &m_actionHandler; Core::IContext *m_context; From 75cfa8a222bd24634e01d2e1e6ee26411632d7d1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 26 Sep 2023 11:14:03 +0200 Subject: [PATCH 1286/1777] Project: Avoid a temporary in gcc toolchain autodetection Change-Id: I4bd1ee6b63cf2e18ddd83649ee869566011b990f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 30 +++++++++----------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index ff5387d63a3..1ac10103cca 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1328,27 +1328,25 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co // Gcc is almost never what you want on macOS, but it is by default found in /usr/bin if (!HostOsInfo::isMacHost() || detector.device->type() != Constants::DESKTOP_DEVICE_TYPE) { - Toolchains tcs; static const auto tcChecker = [](const ToolChain *tc) { return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor && tc->compilerCommand().fileName() != "c89-gcc" && tc->compilerCommand().fileName() != "c99-gcc"; }; - tcs.append(autoDetectToolchains("g++", - DetectVariants::Yes, - Constants::CXX_LANGUAGE_ID, - Constants::GCC_TOOLCHAIN_TYPEID, - detector, - &constructRealGccToolchain, - tcChecker)); - tcs.append(autoDetectToolchains("gcc", - DetectVariants::Yes, - Constants::C_LANGUAGE_ID, - Constants::GCC_TOOLCHAIN_TYPEID, - detector, - &constructRealGccToolchain, - tcChecker)); - result += tcs; + result += autoDetectToolchains("g++", + DetectVariants::Yes, + Constants::CXX_LANGUAGE_ID, + Constants::GCC_TOOLCHAIN_TYPEID, + detector, + &constructRealGccToolchain, + tcChecker); + result += autoDetectToolchains("gcc", + DetectVariants::Yes, + Constants::C_LANGUAGE_ID, + Constants::GCC_TOOLCHAIN_TYPEID, + detector, + &constructRealGccToolchain, + tcChecker); } return result; From ef88a5c3d08165c0278f07574e3dd6975d37be01 Mon Sep 17 00:00:00 2001 From: Semih Yavuz <semih.yavuz@qt.io> Date: Tue, 26 Sep 2023 10:59:33 +0200 Subject: [PATCH 1287/1777] designer: Fix livepreview crash Show Live Preview can be triggered with key sequence Alt+P even if you are not in the designer view which results in access to invalid pointers. To fix this, replace the check in action handler with safer isValid which checks the validity of view and initialize live preview for valid contexts. Fixes: QTCREATORBUG-29642 Change-Id: I9dd1741f1de2722a7ac715a2726b6effbe91529c Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> --- src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewactions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewactions.cpp b/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewactions.cpp index ebd53b7f649..f44cb0ab24d 100644 --- a/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewactions.cpp +++ b/src/plugins/qmldesigner/qmlpreviewplugin/qmlpreviewactions.cpp @@ -33,7 +33,7 @@ const QByteArray livePreviewId = "LivePreview"; static void handleAction(const SelectionContext &context) { - if (context.view()->isAttached()) { + if (context.isValid()) { if (context.toggled()) { bool skipDeploy = false; if (const Target *startupTarget = ProjectManager::startupTarget()) { From ec13beff1cb707d8dbc57655476dea98a7456d94 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 25 Sep 2023 23:01:31 +0200 Subject: [PATCH 1288/1777] CMakePM: Initial import of the RSTparser Change-Id: I45bc3d53df3358c1f52ca219b53a1dec8e85a4ca Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- README.md | 33 +++ .../overview/creator-acknowledgements.qdoc | 37 +++ .../3rdparty/rstparser/README.qt | 3 + .../3rdparty/rstparser/README.rst | 32 +++ .../3rdparty/rstparser/rstparser-test.cc | 169 ++++++++++++ .../3rdparty/rstparser/rstparser.cc | 249 ++++++++++++++++++ .../3rdparty/rstparser/rstparser.h | 97 +++++++ 7 files changed, 620 insertions(+) create mode 100644 src/plugins/cmakeprojectmanager/3rdparty/rstparser/README.qt create mode 100644 src/plugins/cmakeprojectmanager/3rdparty/rstparser/README.rst create mode 100644 src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser-test.cc create mode 100644 src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc create mode 100644 src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.h diff --git a/README.md b/README.md index 7d6102f94f2..70500da736d 100644 --- a/README.md +++ b/README.md @@ -970,3 +970,36 @@ SQLite (https://www.sqlite.org) is in the Public Domain. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +### RSTParser + + RSTParser is an open-source C++ library for parsing reStructuredText + + https://github.com/vitaut-archive/rstparser + + License + ------- + + Copyright (c) 2013, Victor Zverovich + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/doc/qtcreator/src/overview/creator-acknowledgements.qdoc b/doc/qtcreator/src/overview/creator-acknowledgements.qdoc index 0e5b2a60ab2..a9773753b67 100644 --- a/doc/qtcreator/src/overview/creator-acknowledgements.qdoc +++ b/doc/qtcreator/src/overview/creator-acknowledgements.qdoc @@ -938,6 +938,43 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \endcode + \li \b RSTParser + + RSTParser is an open-source C++ library for parsing reStructuredText + + \list + \li \l https://github.com/vitaut-archive/rstparser + \endlist + + \badcode + License + ------- + + Copyright (c) 2013, Victor Zverovich + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + \endcode + \endlist */ diff --git a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/README.qt b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/README.qt new file mode 100644 index 00000000000..776cb07f0b8 --- /dev/null +++ b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/README.qt @@ -0,0 +1,3 @@ +Files taken from the CMake repository https://github.com/vitaut-archive/rstparser.git + +49e1e6626ba28357749acfe3bf07c4a19e5bc4ef diff --git a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/README.rst b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/README.rst new file mode 100644 index 00000000000..1d481382226 --- /dev/null +++ b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/README.rst @@ -0,0 +1,32 @@ +RSTParser +========= + +RSTParser is an open-source C++ library for parsing +`reStructuredText <http://docutils.sourceforge.net/rst.html>`__. + +License +------- + +Copyright (c) 2013, Victor Zverovich + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser-test.cc b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser-test.cc new file mode 100644 index 00000000000..c70fc67c6da --- /dev/null +++ b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser-test.cc @@ -0,0 +1,169 @@ +/* + reStructuredText parser tests. + + Copyright (c) 2012, Victor Zverovich + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <gtest/gtest.h> + +#include <stack> + +#ifdef _WIN32 +# include <crtdbg.h> +#endif + +#include "rstparser.h" + +namespace { + +class TestHandler : public rst::ContentHandler { + private: + std::stack<std::string> tags_; + std::string content_; + + public: + const std::string &content() const { return content_; } + + void StartBlock(rst::BlockType type) { + std::string tag; + switch (type) { + case rst::PARAGRAPH: + tag = "p"; + break; + case rst::LINE_BLOCK: + tag = "lineblock"; + break; + case rst::BLOCK_QUOTE: + tag = "blockquote"; + break; + case rst::BULLET_LIST: + tag = "ul"; + break; + case rst::LIST_ITEM: + tag = "li"; + break; + case rst::LITERAL_BLOCK: + tag = "code"; + break; + } + content_ += "<" + tag + ">"; + tags_.push(tag); + } + + void EndBlock() { + content_ += "</" + tags_.top() + ">"; + tags_.pop(); + } + + void HandleText(const char *text, std::size_t size) { + content_.append(text, size); + } + + void HandleDirective(const char *type) { + content_ += std::string("<") + type + " />"; + } +}; + +std::string Parse(const char *s) { + TestHandler handler; + rst::Parser parser(&handler); + parser.Parse(s); + return handler.content(); +} +} + +TEST(ParserTest, Paragraph) { + EXPECT_EQ("<p>test</p>", Parse("test")); + EXPECT_EQ("<p>test</p>", Parse("\ntest")); + EXPECT_EQ("<p>.</p>", Parse(".")); + EXPECT_EQ("<p>..test</p>", Parse("..test")); +} + +TEST(ParserTest, LineBlock) { + EXPECT_EQ("<lineblock>test</lineblock>", Parse("| test")); + EXPECT_EQ("<lineblock> abc\ndef</lineblock>", Parse("| abc\n| def")); +} + +TEST(ParserTest, BlockQuote) { + EXPECT_EQ("<blockquote>test</blockquote>", Parse(" test")); +} + +TEST(ParserTest, PreserveInnerSpace) { + EXPECT_EQ("<p>a b</p>", Parse("a b")); +} + +TEST(ParserTest, ReplaceWhitespace) { + EXPECT_EQ("<p>a b</p>", Parse("a\tb")); + EXPECT_EQ("<blockquote>a b</blockquote>", Parse(" a\tb")); + EXPECT_EQ("<p>a b</p>", Parse("a\vb")); +} + +TEST(ParserTest, StripTrailingSpace) { + EXPECT_EQ("<p>test</p>", Parse("test \t")); +} + +TEST(ParserTest, MultiLineBlock) { + EXPECT_EQ("<p>line 1\nline 2</p>", Parse("line 1\nline 2")); +} + +TEST(ParserTest, UnindentBlock) { + EXPECT_EQ("<blockquote>abc</blockquote><p>def</p>", Parse(" abc\ndef")); +} + +TEST(ParserTest, BulletList) { + EXPECT_EQ("<ul><li>item</li></ul>", Parse("* item")); + EXPECT_EQ("<ul><li>abc\ndef</li></ul>", Parse("* abc\n def")); +} + +TEST(ParserTest, Literal) { + EXPECT_EQ("<p>abc:</p><code>def</code>", Parse("abc::\n\n def")); + EXPECT_EQ("<code>abc\ndef</code>", Parse("::\n\n abc\n def")); + EXPECT_EQ("<p>abc\ndef</p>", Parse("::\n\nabc\ndef")); + EXPECT_EQ("<p>::\nabc\ndef</p>", Parse("::\nabc\ndef")); +} + +TEST(ParserTest, Comment) { + EXPECT_EQ("", Parse("..")); + EXPECT_EQ("", Parse("..\n")); + EXPECT_EQ("", Parse(".. comment")); + EXPECT_EQ("", Parse(".. comment:")); +} + +TEST(ParserTest, Directive) { + EXPECT_EQ("<test />", Parse(".. test::")); + EXPECT_EQ("<test />", Parse(".. test::")); + EXPECT_EQ("<test />", Parse("..\ttest::")); +} + +int main(int argc, char **argv) { +#ifdef _WIN32 + // Disable message boxes on assertion failures. + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); +#endif + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc new file mode 100644 index 00000000000..528c572f683 --- /dev/null +++ b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc @@ -0,0 +1,249 @@ +/* + A reStructuredText parser written in C++. + + Copyright (c) 2013, Victor Zverovich + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "rstparser.h" + +#include <cctype> +#include <cstring> + +namespace { +inline bool IsSpace(char c) { + switch (c) { + case ' ': case '\t': case '\v': case '\f': + return true; + } + return false; +} + +// Returns true if s ends with string end. +bool EndsWith(const std::string &s, const char *end) { + std::size_t size = s.size(), end_size = std::strlen(end); + return size >= end_size ? std::strcmp(&s[size - end_size], end) == 0 : false; +} +} + +rst::ContentHandler::~ContentHandler() {} + +void rst::Parser::SkipSpace() { + while (IsSpace(*ptr_)) + ++ptr_; +} + +std::string rst::Parser::ParseDirectiveType() { + const char *s = ptr_; + if (!std::isalnum(*s)) + return std::string(); + for (;;) { + ++s; + if (std::isalnum(*s)) + continue; + switch (*s) { + case '-': case '_': case '+': case ':': case '.': + if (std::isalnum(s[1])) { + ++s; + continue; + } + // Fall through. + } + break; + } + std::string type; + if (s != ptr_) + type.assign(ptr_, s); + ptr_ = s; + return type; +} + +void rst::Parser::EnterBlock(rst::BlockType &prev_type, rst::BlockType type) { + if (type == prev_type) + return; + if (prev_type == LIST_ITEM) + handler_->EndBlock(); + if (type == LIST_ITEM) + handler_->StartBlock(BULLET_LIST); + prev_type = type; +} + +void rst::Parser::ParseBlock( + rst::BlockType type, rst::BlockType &prev_type, int indent) { + std::string text; + for (bool first = true; ; first = false) { + const char *line_start = ptr_; + if (!first) { + // Check indentation. + SkipSpace(); + if (ptr_ - line_start != indent) + break; + if (*ptr_ == '\n') { + ++ptr_; + break; // Empty line ends the block. + } + if (!*ptr_) + break; // End of input. + } + // Strip indentation. + line_start = ptr_; + + // Find the end of the line. + while (*ptr_ && *ptr_ != '\n') + ++ptr_; + + // Strip whitespace at the end of the line. + const char *end = ptr_; + while (end != line_start && IsSpace(end[-1])) + --end; + + // Copy text converting all whitespace characters to spaces. + text.reserve(end - line_start + 1); + if (!first) + text.push_back('\n'); + enum {TAB_WIDTH = 8}; + for (const char *s = line_start; s != end; ++s) { + char c = *s; + if (c == '\t') { + text.append(" ", + TAB_WIDTH - ((indent + s - line_start) % TAB_WIDTH)); + } else if (IsSpace(c)) { + text.push_back(' '); + } else { + text.push_back(*s); + } + } + if (*ptr_ == '\n') + ++ptr_; + } + + // Remove a trailing newline. + if (*text.rbegin() == '\n') + text.resize(text.size() - 1); + + bool literal = type == PARAGRAPH && EndsWith(text, "::"); + if (!literal || text.size() != 2) { + std::size_t size = text.size(); + if (literal) + --size; + EnterBlock(prev_type, type); + handler_->StartBlock(type); + handler_->HandleText(text.c_str(), size); + handler_->EndBlock(); + } + if (literal) { + // Parse a literal block. + const char *line_start = ptr_; + SkipSpace(); + int new_indent = static_cast<int>(ptr_ - line_start); + if (new_indent > indent) + ParseBlock(LITERAL_BLOCK, prev_type, new_indent); + } +} + +void rst::Parser::ParseLineBlock(rst::BlockType &prev_type, int indent) { + std::string text; + for (bool first = true; ; first = false) { + const char *line_start = ptr_; + if (!first) { + // Check indentation. + SkipSpace(); + if (*ptr_ != '|' || !IsSpace(ptr_[1]) || ptr_ - line_start != indent) + break; + ptr_ += 2; + if (!*ptr_) + break; // End of input. + } + // Strip indentation. + line_start = ptr_; + + // Find the end of the line. + while (*ptr_ && *ptr_ != '\n') + ++ptr_; + if (*ptr_ == '\n') + ++ptr_; + text.append(line_start, ptr_); + } + + EnterBlock(prev_type, rst::LINE_BLOCK); + handler_->StartBlock(rst::LINE_BLOCK); + handler_->HandleText(text.c_str(), text.size()); + handler_->EndBlock(); +} + +void rst::Parser::Parse(const char *s) { + BlockType prev_type = PARAGRAPH; + ptr_ = s; + while (*ptr_) { + // Skip whitespace and empty lines. + const char *line_start = ptr_; + SkipSpace(); + if (*ptr_ == '\n') { + ++ptr_; + continue; + } + switch (*ptr_) { + case '.': + if (ptr_[1] == '.') { + char c = ptr_[2]; + if (!IsSpace(c) && c != '\n' && c) + break; + // Parse a directive or a comment. + ptr_ += 2; + SkipSpace(); + std::string type = ParseDirectiveType(); + if (!type.empty() && ptr_[0] == ':' && ptr_[1] == ':') { + ptr_ += 2; + handler_->HandleDirective(type.c_str()); + } + // Skip everything till the end of the line. + while (*ptr_ && *ptr_ != '\n') + ++ptr_; + if (*ptr_ == '\n') + ++ptr_; + continue; + } + break; + case '*': case '+': case '-': + if (IsSpace(ptr_[1])) { + // Parse a bullet list item. + ptr_ += 2; + ParseBlock(LIST_ITEM, prev_type, static_cast<int>(ptr_ - line_start)); + continue; + } + break; + case '|': + if (IsSpace(ptr_[1])) { + // Parse a line block. + int indent = static_cast<int>(ptr_ - line_start); + ptr_ += 2; + ParseLineBlock(prev_type, indent); + continue; + } + break; + } + ParseBlock(std::isspace(line_start[0]) ? BLOCK_QUOTE : PARAGRAPH, + prev_type, static_cast<int>(ptr_ - line_start)); + } + EnterBlock(prev_type, PARAGRAPH); +} diff --git a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.h b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.h new file mode 100644 index 00000000000..547f128af7c --- /dev/null +++ b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.h @@ -0,0 +1,97 @@ +/* + A reStructuredText parser written in C++. + + Copyright (c) 2013, Victor Zverovich + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RSTPARSER_H_ +#define RSTPARSER_H_ + +#include <memory> +#include <string> +#include <vector> + +namespace rst { + +enum BlockType { + PARAGRAPH, + LINE_BLOCK, + BLOCK_QUOTE, + BULLET_LIST, + LIST_ITEM, + LITERAL_BLOCK +}; + +// Receive notification of the logical content of a document. +class ContentHandler { + public: + virtual ~ContentHandler(); + + // Receives notification of the beginning of a text block. + virtual void StartBlock(BlockType type) = 0; + + // Receives notification of the end of a text block. + virtual void EndBlock() = 0; + + // Receives notification of text. + virtual void HandleText(const char *text, std::size_t size) = 0; + + // Receives notification of a directive. + virtual void HandleDirective(const char *type) = 0; +}; + +// A parser for a subset of reStructuredText. +class Parser { + private: + ContentHandler *handler_; + const char *ptr_; + + // Skips whitespace. + void SkipSpace(); + + // Parses a directive type. + std::string ParseDirectiveType(); + + // Parses a paragraph. + void ParseParagraph(); + + // Changes the current block type sending notifications if necessary. + void EnterBlock(rst::BlockType &prev_type, rst::BlockType type); + + // Parses a block of text. + void ParseBlock(rst::BlockType type, rst::BlockType &prev_type, int indent); + + // Parses a line block. + void ParseLineBlock(rst::BlockType &prev_type, int indent); + + public: + explicit Parser(ContentHandler *h) : handler_(h), ptr_(0) {} + + // Parses a string containing reStructuredText and returns a document node. + void Parse(const char *s); +}; +} + +#endif // RSTPARSER_H_ + From fbbb78ee7ec4f8a03a21ae6593b45680cd82c3f3 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 26 Sep 2023 13:59:23 +0200 Subject: [PATCH 1289/1777] ProjectExplorer: Actually instantiate the DeviceTypeKAFactory again Task-number: QTCREATORBUG-29647 Change-Id: Ic2d29ae8d053f6526d6c5e4f4370153ab5b7d902 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/kitaspects.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/projectexplorer/kitaspects.cpp b/src/plugins/projectexplorer/kitaspects.cpp index 57ef6b0fcd4..489f267b7a1 100644 --- a/src/plugins/projectexplorer/kitaspects.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -855,6 +855,8 @@ QSet<Id> DeviceTypeKitAspectFactory::availableFeatures(const Kit *k) const return {}; } +const DeviceTypeKitAspectFactory theDeviceTypeKitAspectFactory; + // -------------------------------------------------------------------------- // DeviceKitAspect: // -------------------------------------------------------------------------- From 7adee4da24757b65622260487885d3cd76a04151 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 21 Sep 2023 08:59:15 +0200 Subject: [PATCH 1290/1777] Utils: allow specifying the requested extension for searchInPath Reducing the expected executable extensions can improve the performance for search in path on Window. Especially if PATHEXT and PATH has a lot of entries, since we collect file attributes for PATHEXT entry count times PATH entry count file paths. Use this optimization in the android toolchain to search for java.exe on windows. Change-Id: I2c2865d685c2de0c03a0fa1fbe7e8afd283174da Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/environment.cpp | 5 +++-- src/libs/utils/environment.h | 3 ++- src/plugins/android/androidtoolchain.cpp | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index 4af5399a7af..d71d76c8b8a 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -225,11 +225,12 @@ QString Environment::expandedValueForKey(const QString &key) const FilePath Environment::searchInPath(const QString &executable, const FilePaths &additionalDirs, - const FilePathPredicate &filter) const + const FilePathPredicate &filter, + FilePath::MatchScope scope) const { const FilePath exec = FilePath::fromUserInput(expandVariables(executable)); const FilePaths dirs = path() + additionalDirs; - return exec.searchInDirectories(dirs, filter, FilePath::WithAnySuffix); + return exec.searchInDirectories(dirs, filter, scope); } FilePaths Environment::path() const diff --git a/src/libs/utils/environment.h b/src/libs/utils/environment.h index 06ac5d20a5c..679b28f0e08 100644 --- a/src/libs/utils/environment.h +++ b/src/libs/utils/environment.h @@ -61,7 +61,8 @@ public: FilePath searchInPath(const QString &executable, const FilePaths &additionalDirs = FilePaths(), - const FilePathPredicate &func = {}) const; + const FilePathPredicate &func = {}, + FilePath::MatchScope = FilePath::WithAnySuffix) const; FilePaths path() const; FilePaths pathListValue(const QString &varName) const; diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index 26ca46be2a5..5d96d8c4bdc 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -94,7 +94,8 @@ void AndroidToolChain::addToEnvironment(Environment &env) const if (javaHome.exists()) { env.set(Constants::JAVA_HOME_ENV_VAR, javaHome.toUserOutput()); const FilePath javaBin = javaHome.pathAppended("bin"); - const FilePath currentJavaFilePath = env.searchInPath("java"); + const FilePath currentJavaFilePath + = env.searchInPath("java", {}, {}, FilePath::WithExeSuffix); if (!currentJavaFilePath.isChildOf(javaBin)) env.prependOrSetPath(javaBin); } From 288d2e76bcf8695c885d4c585a3a1fc2da9e1b20 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 27 Sep 2023 08:43:35 +0200 Subject: [PATCH 1291/1777] FancyLineEdit: Fix some warnings - initialize opacity (was never used uninitialized though) - fix include Change-Id: Ic3a9f8154f1c4bd77e759b6b45ee06b20a394c8d Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/fancylineedit.cpp | 3 +-- src/libs/utils/fancylineedit.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index f30fa4bd841..f1e177e0633 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -7,8 +7,8 @@ #include "execmenu.h" #include "historycompleter.h" #include "hostosinfo.h" +#include "icon.h" #include "qtcassert.h" -#include "utilsicons.h" #include "utilstr.h" #include <solutions/spinner/spinner.h> @@ -621,7 +621,6 @@ QString FancyLineEdit::fixInputString(const QString &string) FancyIconButton::FancyIconButton(QWidget *parent) : QAbstractButton(parent) - , m_autoHide(false) { setCursor(Qt::ArrowCursor); setFocusPolicy(Qt::NoFocus); diff --git a/src/libs/utils/fancylineedit.h b/src/libs/utils/fancylineedit.h index 1b9cf4d5e52..a8bd9501274 100644 --- a/src/libs/utils/fancylineedit.h +++ b/src/libs/utils/fancylineedit.h @@ -45,8 +45,8 @@ protected: void keyReleaseEvent(QKeyEvent *ke) override; private: - float m_iconOpacity; - bool m_autoHide; + float m_iconOpacity = 1.0f; + bool m_autoHide = false; QIcon m_icon; }; From d04585b519f51b47cfc4200a048acc416c187b86 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 27 Sep 2023 09:44:35 +0200 Subject: [PATCH 1292/1777] CMakeProjectManager: Remove unused arg Make some methods static. Amends 05614ab7402623eb0a69ae7d0301044f70f93e91 Change-Id: Ia72a95c0c3bf0acf7a94e1bac0a162db23aa0c77 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../cmakeprojectmanager/cmakefilecompletionassist.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 84902f9d495..62cc290aa8d 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -143,7 +143,7 @@ static int findPathStart(const AssistInterface *interface) } template<typename T> -QList<AssistProposalItemInterface *> generateList(const T &words, const QIcon &icon) +static QList<AssistProposalItemInterface *> generateList(const T &words, const QIcon &icon) { return transform<QList>(words, [&icon](const QString &word) -> AssistProposalItemInterface * { AssistProposalItem *item = new AssistProposalItem(); @@ -153,7 +153,7 @@ QList<AssistProposalItemInterface *> generateList(const T &words, const QIcon &i }); } -QString readFirstParagraphs(const QString &element, const FilePath &helpFile) +static QString readFirstParagraphs(const FilePath &helpFile) { static QMap<FilePath, QString> map; if (map.contains(helpFile)) @@ -167,8 +167,8 @@ QString readFirstParagraphs(const QString &element, const FilePath &helpFile) return firstParagraphs; } -QList<AssistProposalItemInterface *> generateList(const QMap<QString, FilePath> &words, - const QIcon &icon) +static QList<AssistProposalItemInterface *> generateList(const QMap<QString, FilePath> &words, + const QIcon &icon) { struct MarkDownAssitProposalItem : public AssistProposalItem { @@ -180,7 +180,7 @@ QList<AssistProposalItemInterface *> generateList(const QMap<QString, FilePath> MarkDownAssitProposalItem *item = new MarkDownAssitProposalItem(); item->setText(it.key()); if (!it.value().isEmpty()) - item->setDetail(readFirstParagraphs(it.key(), it.value())); + item->setDetail(readFirstParagraphs(it.value())); item->setIcon(icon); list << item; }; From fa58a55b4f16fc2206475d804af8a34fc829f29c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 26 Sep 2023 11:50:39 +0200 Subject: [PATCH 1293/1777] ProjectExplorer: Move path collection in gcc autodetection one level up Closer to doing it just once. Change-Id: I8d9c7d8c4d3b7bd3afb57eb612eaae9bc4f7b616 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 40 +++++++++----------- src/plugins/projectexplorer/gcctoolchain.h | 4 +- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 1ac10103cca..47c91a150d4 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1247,6 +1247,11 @@ GccToolChainFactory::GccToolChainFactory(GccToolChain::SubType subType) setUserCreatable(true); } +// FIXME: Re-order later. +static FilePaths findCompilerCandidates(const ToolchainDetector &detector, + const QString &compilerName, + bool detectVariants); + Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) const { Toolchains result; @@ -1257,14 +1262,14 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co // Linux ICC - result += autoDetectToolchains("icpc", - DetectVariants::No, + result += autoDetectToolchains(findCompilerCandidates(detector, "icpc", false), Constants::CXX_LANGUAGE_ID, Constants::LINUXICC_TOOLCHAIN_TYPEID, detector, &constructLinuxIccToolchain); - result += autoDetectToolchains("icc", - DetectVariants::Yes, + + + result += autoDetectToolchains(findCompilerCandidates(detector, "icc", true), Constants::C_LANGUAGE_ID, Constants::LINUXICC_TOOLCHAIN_TYPEID, detector, @@ -1275,15 +1280,14 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co static const auto tcChecker = [](const ToolChain *tc) { return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; }; - result += autoDetectToolchains("g++", - DetectVariants::Yes, + + result += autoDetectToolchains(findCompilerCandidates(detector, "g++", true), Constants::CXX_LANGUAGE_ID, Constants::MINGW_TOOLCHAIN_TYPEID, detector, &constructMinGWToolchain, tcChecker); - result += autoDetectToolchains("gcc", - DetectVariants::Yes, + result += autoDetectToolchains(findCompilerCandidates(detector, "gcc", true), Constants::C_LANGUAGE_ID, Constants::MINGW_TOOLCHAIN_TYPEID, detector, @@ -1295,14 +1299,12 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co Toolchains tcs; Toolchains known = detector.alreadyKnown; - tcs.append(autoDetectToolchains("clang++", - DetectVariants::Yes, + tcs.append(autoDetectToolchains(findCompilerCandidates(detector, "clang++", true), Constants::CXX_LANGUAGE_ID, Constants::CLANG_TOOLCHAIN_TYPEID, detector, &constructClangToolchain)); - tcs.append(autoDetectToolchains("clang", - DetectVariants::Yes, + tcs.append(autoDetectToolchains(findCompilerCandidates(detector, "clang", true), Constants::C_LANGUAGE_ID, Constants::CLANG_TOOLCHAIN_TYPEID, detector, @@ -1313,8 +1315,7 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co if (!compilerPath.isEmpty()) { const FilePath clang = compilerPath.parentDir().pathAppended("clang").withExecutableSuffix(); tcs.append( - autoDetectToolchains(clang.toString(), - DetectVariants::No, + autoDetectToolchains(findCompilerCandidates(detector, clang.toString(), false), Constants::C_LANGUAGE_ID, Constants::CLANG_TOOLCHAIN_TYPEID, ToolchainDetector(known, detector.device, detector.searchPaths), @@ -1333,15 +1334,13 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co && tc->compilerCommand().fileName() != "c89-gcc" && tc->compilerCommand().fileName() != "c99-gcc"; }; - result += autoDetectToolchains("g++", - DetectVariants::Yes, + result += autoDetectToolchains(findCompilerCandidates(detector, "g++", true), Constants::CXX_LANGUAGE_ID, Constants::GCC_TOOLCHAIN_TYPEID, detector, &constructRealGccToolchain, tcChecker); - result += autoDetectToolchains("gcc", - DetectVariants::Yes, + result += autoDetectToolchains(findCompilerCandidates(detector, "gcc", true), Constants::C_LANGUAGE_ID, Constants::GCC_TOOLCHAIN_TYPEID, detector, @@ -1488,16 +1487,13 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, return compilerPaths; } -Toolchains GccToolChainFactory::autoDetectToolchains(const QString &compilerName, - DetectVariants detectVariants, +Toolchains GccToolChainFactory::autoDetectToolchains(const FilePaths &compilerPaths, const Id language, const Id requiredTypeId, const ToolchainDetector &detector, const ToolChainConstructor &constructor, const ToolchainChecker &checker) { - const FilePaths compilerPaths = - findCompilerCandidates(detector, compilerName, detectVariants == DetectVariants::Yes); Toolchains existingCandidates = filtered(detector.alreadyKnown, [language](const ToolChain *tc) { return tc->language() == language; }); Toolchains result; diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index fb8909d3881..a549d2bbb37 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -192,10 +192,8 @@ public: Toolchains detectForImport(const ToolChainDescription &tcd) const final; private: - enum class DetectVariants { Yes, No }; using ToolchainChecker = std::function<bool(const ToolChain *)>; - static Toolchains autoDetectToolchains(const QString &compilerName, - DetectVariants detectVariants, + static Toolchains autoDetectToolchains(const Utils::FilePaths &compilerPaths, const Utils::Id language, const Utils::Id requiredTypeId, const ToolchainDetector &detector, From 0df7fe319db387e5d50d6d87318c5cbd0ed12c5f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 26 Sep 2023 14:17:27 +0200 Subject: [PATCH 1294/1777] ProjectExplorer: Remove some repeated checks This should already bark in the ToolchainDetector nowadays. Change-Id: Id835b4e2946f78cf508b13d75aeb08a289346806 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 47c91a150d4..c7a80e50973 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1424,6 +1424,8 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, bool detectVariants) { const IDevice::ConstPtr device = detector.device; + QTC_ASSERT(device, return {}); + const QFileInfo fi(compilerName); if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE && fi.isAbsolute() && fi.isFile()) return {FilePath::fromString(compilerName)}; @@ -1440,14 +1442,14 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, << ("*-*-*-*-" + compilerName + "-[1-9]*"); // "x86_64-pc-linux-gnu-gcc-7.4.1" } - const Utils::OsType os = device ? device->osType() : HostOsInfo::hostOs(); + const Utils::OsType os = device->osType(); nameFilters = transform(nameFilters, [os](const QString &baseName) { return OsSpecificAspects::withExecutableSuffix(os, baseName); }); FilePaths compilerPaths; FilePaths searchPaths = detector.searchPaths; - if (device && device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { + if (device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { if (searchPaths.isEmpty()) searchPaths = device->systemEnvironment().path(); searchPaths = Utils::transform(searchPaths, [&](const FilePath &onDevice) { From cd5cbd64f7e50db9c1a31333b309db177d46fa52 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 26 Sep 2023 15:46:04 +0200 Subject: [PATCH 1295/1777] SquishTests: Fix finding line edit on wizard Change-Id: I26be629e11e2d768b3afed518cd6026028d2e17a Reviewed-by: David Schulz <david.schulz@qt.io> --- src/libs/utils/projectintropage.cpp | 1 + tests/system/shared/project.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index 0b1a0a63557..b710e68723b 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -79,6 +79,7 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) : d->m_nameLineEdit = new Utils::FancyLineEdit(frame); d->m_pathChooser = new Utils::PathChooser(frame); + d->m_pathChooser->setObjectName("baseFolder"); // used by Squish d->m_pathChooser->setExpectedKind(PathChooser::Directory); d->m_pathChooser->setDisabled(d->m_forceSubProject); diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index b39ef8060ee..317067142a4 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -81,8 +81,8 @@ def __createProjectOrFileSelectType__(category, template, fromWelcome = False, i return __getSupportedPlatforms__(str(text), template)[0] def __createProjectSetNameAndPath__(path, projectName = None, checks = True): - directoryEdit = waitForObject("{type='Utils::FancyLineEdit' unnamed='1' visible='1' " - "toolTip~='Full path: .*'}") + pathChooser = waitForObject("{type='Utils::PathChooser' name='baseFolder' visible='1'}") + directoryEdit = getChildByClass(pathChooser, "Utils::FancyLineEdit") replaceEditorContent(directoryEdit, path) projectNameEdit = waitForObject("{name='nameLineEdit' visible='1' " "type='Utils::FancyLineEdit'}") From dda6d05282e078b5295843915bbc56ad5fe84365 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 26 Sep 2023 16:01:24 +0200 Subject: [PATCH 1296/1777] SquishTests: Adapt to changed ui Change-Id: I906f4f9dc07f905b9efa71b1ada60409349a1b05 Reviewed-by: David Schulz <david.schulz@qt.io> --- 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 cc359d6b7fc..940739813a9 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -126,7 +126,7 @@ :Qt Creator.DragDoc_QToolButton {toolTip='Drag to drag documents between splits' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Events_QDockWidget {name='QmlProfiler.Statistics.DockDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Events_QTabBar {aboveWidget=':Qt Creator.Events_QDockWidget' type='QTabBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator.Issues_QListView {type='Utils::TreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'} +:Qt Creator.Issues_QListView {type='QTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'} :Qt Creator.Project.Menu.File_QMenu {name='Project.Menu.File' type='QMenu'} :Qt Creator.Project.Menu.Folder_QMenu {name='Project.Menu.Folder' type='QMenu' visible='1'} :Qt Creator.QML debugging and profiling:_QComboBox {leftWidget=':Qt Creator.QML debugging and profiling:_QLabel' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} From d3b9b9b2d14eebf932a8c94e57a584fac06e486d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 26 Sep 2023 14:31:02 +0200 Subject: [PATCH 1297/1777] ProjectExplorer: Move some compiler detection path setup one level up Not the big win yet, but doing the activity just once instead of previously nine times. Change-Id: Ibe8a782e1261228ef1ea8891878c45ea19e9bcf2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 72 ++++++++++---------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index c7a80e50973..bbed2800a86 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1252,13 +1252,44 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, const QString &compilerName, bool detectVariants); -Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) const +Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector_) const { - Toolchains result; + QTC_ASSERT(detector_.device, return {}); // Do all autodetection in th 'RealGcc' case, and none in the others. if (!m_autoDetecting) - return result; + return {}; + + FilePaths searchPaths = detector_.searchPaths; + if (detector_.device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { + if (searchPaths.isEmpty()) + searchPaths = detector_.device->systemEnvironment().path(); + searchPaths = Utils::transform(searchPaths, [&](const FilePath &onDevice) { + return detector_.device->filePath(onDevice.path()); + }); + } else if (searchPaths.isEmpty()) { + searchPaths = Environment::systemEnvironment().path(); + searchPaths << gnuSearchPathsFromRegistry(); + searchPaths << atmelSearchPathsFromRegistry(); + searchPaths << renesasRl78SearchPathsFromRegistry(); + if (HostOsInfo::isMacHost()) { + searchPaths << "/opt/homebrew/opt/ccache/libexec" // homebrew arm + << "/usr/local/opt/ccache/libexec" // homebrew intel + << "/opt/local/libexec/ccache"; // macports, no links are created automatically though + } + if (HostOsInfo::isAnyUnixHost()) { + FilePath ccachePath = "/usr/lib/ccache/bin"; + if (!ccachePath.exists()) + ccachePath = "/usr/lib/ccache"; + if (ccachePath.exists() && !searchPaths.contains(ccachePath)) + searchPaths << ccachePath; + } + } + + + ToolchainDetector detector{detector_.alreadyKnown, detector_.device, searchPaths}; + + Toolchains result; // Linux ICC @@ -1423,11 +1454,8 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, const QString &compilerName, bool detectVariants) { - const IDevice::ConstPtr device = detector.device; - QTC_ASSERT(device, return {}); - const QFileInfo fi(compilerName); - if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE && fi.isAbsolute() && fi.isFile()) + if (detector.device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE && fi.isAbsolute() && fi.isFile()) return {FilePath::fromString(compilerName)}; QStringList nameFilters(compilerName); @@ -1442,39 +1470,13 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, << ("*-*-*-*-" + compilerName + "-[1-9]*"); // "x86_64-pc-linux-gnu-gcc-7.4.1" } - const Utils::OsType os = device->osType(); + const Utils::OsType os = detector.device->osType(); nameFilters = transform(nameFilters, [os](const QString &baseName) { return OsSpecificAspects::withExecutableSuffix(os, baseName); }); FilePaths compilerPaths; - FilePaths searchPaths = detector.searchPaths; - if (device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { - if (searchPaths.isEmpty()) - searchPaths = device->systemEnvironment().path(); - searchPaths = Utils::transform(searchPaths, [&](const FilePath &onDevice) { - return device->filePath(onDevice.path()); - }); - } else if (searchPaths.isEmpty()) { - searchPaths = Environment::systemEnvironment().path(); - searchPaths << gnuSearchPathsFromRegistry(); - searchPaths << atmelSearchPathsFromRegistry(); - searchPaths << renesasRl78SearchPathsFromRegistry(); - if (HostOsInfo::isMacHost()) { - searchPaths << "/opt/homebrew/opt/ccache/libexec" // homebrew arm - << "/usr/local/opt/ccache/libexec" // homebrew intel - << "/opt/local/libexec/ccache"; // macports, no links are created automatically though - } - if (HostOsInfo::isAnyUnixHost()) { - FilePath ccachePath = "/usr/lib/ccache/bin"; - if (!ccachePath.exists()) - ccachePath = "/usr/lib/ccache"; - if (ccachePath.exists() && !searchPaths.contains(ccachePath)) - searchPaths << ccachePath; - } - } - - for (const FilePath &searchPath : std::as_const(searchPaths)) { + for (const FilePath &searchPath : detector.searchPaths) { static const QRegularExpression regexp(binaryRegexp); const auto callBack = [os, &compilerPaths, compilerName](const FilePath &candidate) { if (candidate.fileName() == OsSpecificAspects::withExecutableSuffix(os, compilerName) From d6fe357d81da96475c02eb3c73f660d8121381e4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 5 Sep 2023 15:25:26 +0200 Subject: [PATCH 1298/1777] Utils: Use a proper class as Key The Key encapsulates now a QByteArray. Plan is to use QByteArray::fromRawData on literals, but that's not active yet due to an unclear ASAN report, see the gerrit discussion. For now we also paddle back when interfacing QSettings, instead of mimicing writing a QVariantMap (and fail in some corners), always convert the Store. This is meant to go away in the future when code paths are better controled. Change-Id: Id1206a434d511f8003903d5322c7c9bd5f5fb859 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 2 +- src/libs/utils/persistentsettings.cpp | 65 ++++++----- src/libs/utils/persistentsettings.h | 2 +- src/libs/utils/qtcsettings.cpp | 11 ++ src/libs/utils/qtcsettings.h | 8 +- src/libs/utils/store.cpp | 108 ++++++++++++------ src/libs/utils/store.h | 5 + src/libs/utils/storekey.h | 52 ++++++++- src/libs/utils/unixutils.cpp | 2 +- .../baremetal/debugserverprovidermanager.cpp | 4 +- .../clangformat/clangformatsettings.cpp | 4 +- .../classviewnavigationwidgetfactory.cpp | 1 + src/plugins/coreplugin/coreplugin.cpp | 1 + src/plugins/coreplugin/find/findplugin.cpp | 18 +-- .../coreplugin/foldernavigationwidget.cpp | 1 + src/plugins/coreplugin/icore.cpp | 4 +- src/plugins/coreplugin/session.cpp | 2 +- .../cppeditor/cppcodemodelsettings.cpp | 8 +- src/plugins/debugger/debuggeractions.cpp | 6 +- src/plugins/designer/settingsmanager.cpp | 6 +- src/plugins/fakevim/fakevimactions.cpp | 8 +- src/plugins/fakevim/fakevimactions.h | 10 +- src/plugins/fakevim/fakevimhandler.cpp | 8 +- .../languageclient/languageclientsettings.cpp | 4 +- .../languageclient/languageclientsettings.h | 4 +- src/plugins/mcusupport/test/unittest.cpp | 19 ++- src/plugins/perfprofiler/perfsettings.cpp | 12 +- .../customwizard/customwizardpage.cpp | 4 +- .../projectexplorer/editorconfiguration.cpp | 4 +- src/plugins/projectexplorer/extraabi.cpp | 8 +- .../projectexplorer/userfileaccessor.cpp | 3 +- .../qmakeprojectmanager/wizards/qtwizard.cpp | 2 +- src/plugins/qtsupport/baseqtversion.cpp | 6 +- src/plugins/qtsupport/qtversionmanager.cpp | 12 +- 34 files changed, 255 insertions(+), 159 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 04cf8b786d0..bcd424bd623 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -2996,7 +2996,7 @@ SettingsGroupNester::SettingsGroupNester(const QStringList &groups) { QTC_ASSERT(theSettings, return); for (const QString &group : groups) - theSettings->beginGroup(group); + theSettings->beginGroup(keyFromString(group)); } SettingsGroupNester::~SettingsGroupNester() diff --git a/src/libs/utils/persistentsettings.cpp b/src/libs/utils/persistentsettings.cpp index 97c0fb9e943..54a829004b3 100644 --- a/src/libs/utils/persistentsettings.cpp +++ b/src/libs/utils/persistentsettings.cpp @@ -106,20 +106,20 @@ const QString keyAttribute("key"); struct ParseValueStackEntry { - explicit ParseValueStackEntry(QVariant::Type t = QVariant::Invalid, const Key &k = {}) : type(t), key(k) {} - explicit ParseValueStackEntry(const QVariant &aSimpleValue, const Key &k); + explicit ParseValueStackEntry(QVariant::Type t = QVariant::Invalid, const QString &k = {}) : type(t), key(k) {} + explicit ParseValueStackEntry(const QVariant &aSimpleValue, const QString &k); QVariant value() const; - void addChild(const Key &key, const QVariant &v); + void addChild(const QString &key, const QVariant &v); QVariant::Type type; - Key key; + QString key; QVariant simpleValue; QVariantList listValue; - Store mapValue; + QVariantMap mapValue; }; -ParseValueStackEntry::ParseValueStackEntry(const QVariant &aSimpleValue, const Key &k) +ParseValueStackEntry::ParseValueStackEntry(const QVariant &aSimpleValue, const QString &k) : type(aSimpleValue.type()), key(k), simpleValue(aSimpleValue) { QTC_ASSERT(simpleValue.isValid(), return); @@ -131,7 +131,7 @@ QVariant ParseValueStackEntry::value() const case QVariant::Invalid: return QVariant(); case QVariant::Map: - return variantFromStore(mapValue); + return QVariant(mapValue); case QVariant::List: return QVariant(listValue); default: @@ -140,7 +140,7 @@ QVariant ParseValueStackEntry::value() const return simpleValue; } -void ParseValueStackEntry::addChild(const Key &key, const QVariant &v) +void ParseValueStackEntry::addChild(const QString &key, const QVariant &v) { switch (type) { case QVariant::Map: @@ -159,7 +159,7 @@ void ParseValueStackEntry::addChild(const Key &key, const QVariant &v) class ParseContext { public: - Store parse(const FilePath &file); + QVariantMap parse(const FilePath &file); private: QVariant readSimpleValue(QXmlStreamReader &r, const QXmlStreamAttributes &attributes) const; @@ -170,11 +170,11 @@ private: static QString formatWarning(const QXmlStreamReader &r, const QString &message); QStack<ParseValueStackEntry> m_valueStack; - Store m_result; - Key m_currentVariableName; + QVariantMap m_result; + QString m_currentVariableName; }; -Store ParseContext::parse(const FilePath &file) +QVariantMap ParseContext::parse(const FilePath &file) { QXmlStreamReader r(file.fileContents().value_or(QByteArray())); @@ -194,7 +194,7 @@ Store ParseContext::parse(const FilePath &file) case QXmlStreamReader::Invalid: qWarning("Error reading %s:%d: %s", qPrintable(file.fileName()), int(r.lineNumber()), qPrintable(r.errorString())); - return Store(); + return {}; default: break; } // switch token @@ -206,13 +206,13 @@ bool ParseContext::handleStartElement(QXmlStreamReader &r) { const QStringView name = r.name(); if (name == variableElement) { - m_currentVariableName = keyFromString(r.readElementText()); + m_currentVariableName = r.readElementText(); return false; } if (name == valueElement) { const QXmlStreamAttributes attributes = r.attributes(); - const Key key = attributes.hasAttribute(keyAttribute) ? - keyFromString(attributes.value(keyAttribute).toString()) : Key(); + const QString key = attributes.hasAttribute(keyAttribute) ? + attributes.value(keyAttribute).toString() : QString(); // This reads away the end element, so, handle end element right here. const QVariant v = readSimpleValue(r, attributes); if (!v.isValid()) { @@ -224,15 +224,15 @@ bool ParseContext::handleStartElement(QXmlStreamReader &r) } if (name == valueListElement) { const QXmlStreamAttributes attributes = r.attributes(); - const Key key = attributes.hasAttribute(keyAttribute) ? - keyFromString(attributes.value(keyAttribute).toString()) : Key(); + const QString key = attributes.hasAttribute(keyAttribute) ? + attributes.value(keyAttribute).toString() : QString(); m_valueStack.push_back(ParseValueStackEntry(QVariant::List, key)); return false; } if (name == valueMapElement) { const QXmlStreamAttributes attributes = r.attributes(); - const Key key = attributes.hasAttribute(keyAttribute) ? - keyFromString(attributes.value(keyAttribute).toString()) : Key(); + const QString key = attributes.hasAttribute(keyAttribute) ? + attributes.value(keyAttribute).toString() : QString(); m_valueStack.push_back(ParseValueStackEntry(QVariant::Map, key)); return false; } @@ -293,14 +293,14 @@ PersistentSettingsReader::PersistentSettingsReader() = default; QVariant PersistentSettingsReader::restoreValue(const Key &variable, const QVariant &defaultValue) const { - if (m_valueMap.contains(variable)) - return m_valueMap.value(variable); + if (m_valueMap.contains(stringFromKey(variable))) + return m_valueMap.value(stringFromKey(variable)); return defaultValue; } Store PersistentSettingsReader::restoreValues() const { - return m_valueMap; + return storeFromMap(m_valueMap); } bool PersistentSettingsReader::load(const FilePath &fileName) @@ -331,12 +331,12 @@ FilePath PersistentSettingsReader::filePath() */ #if QT_VERSION < QT_VERSION_CHECK(6, 5, 0) -static QString xmlAttrFromKey(const Key &key) { return stringFromKey(key); } +static QString xmlAttrFromKey(const QString &key) { return key; } #else -static Key xmlAttrFromKey(const Key &key) { return key; } +static QString xmlAttrFromKey(const QString &key) { return key; } #endif -static void writeVariantValue(QXmlStreamWriter &w, const QVariant &variant, const Key &key = {}) +static void writeVariantValue(QXmlStreamWriter &w, const QVariant &variant, const QString &key = {}) { static const int storeId = qMetaTypeId<Store>(); @@ -355,9 +355,9 @@ static void writeVariantValue(QXmlStreamWriter &w, const QVariant &variant, cons w.writeAttribute(typeAttribute, "QVariantMap"); if (!key.isEmpty()) w.writeAttribute(keyAttribute, xmlAttrFromKey(key)); - const Store varMap = storeFromVariant(variant); - const Store::const_iterator cend = varMap.constEnd(); - for (Store::const_iterator i = varMap.constBegin(); i != cend; ++i) + const QVariantMap varMap = variant.toMap(); + const auto cend = varMap.constEnd(); + for (auto i = varMap.constBegin(); i != cend; ++i) writeVariantValue(w, i.value(), i.key()); w.writeEndElement(); } else if (variantType == QMetaType::QObjectStar) { @@ -427,11 +427,10 @@ bool PersistentSettingsWriter::write(const Store &data, QString *errorString) co QCoreApplication::applicationVersion(), QDateTime::currentDateTime().toString(Qt::ISODate))); w.writeStartElement(qtCreatorElement); - const Store::const_iterator cend = data.constEnd(); - for (Store::const_iterator it = data.constBegin(); it != cend; ++it) { + const QVariantMap map = mapFromStore(data); + for (auto it = map.constBegin(), cend = map.constEnd(); it != cend; ++it) { w.writeStartElement(dataElement); - // FIXME: stringFromKey() not needed from Qt 6.5 onward. - w.writeTextElement(variableElement, stringFromKey(it.key())); + w.writeTextElement(variableElement, it.key()); writeVariantValue(w, it.value()); w.writeEndElement(); } diff --git a/src/libs/utils/persistentsettings.h b/src/libs/utils/persistentsettings.h index 4997433ef68..8092e8a0118 100644 --- a/src/libs/utils/persistentsettings.h +++ b/src/libs/utils/persistentsettings.h @@ -26,7 +26,7 @@ public: FilePath filePath(); private: - Store m_valueMap; + QVariantMap m_valueMap; FilePath m_filePath; }; diff --git a/src/libs/utils/qtcsettings.cpp b/src/libs/utils/qtcsettings.cpp index 65e73615e2d..921e47946c7 100644 --- a/src/libs/utils/qtcsettings.cpp +++ b/src/libs/utils/qtcsettings.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "qtcsettings.h" +#include "store.h" namespace Utils { @@ -29,4 +30,14 @@ namespace Utils { \sa QSettings::setValue() */ +QVariant QtcSettings::value(const Key &key, const QVariant &def) const +{ + return QSettings::value(stringFromKey(key), def); +} + +void QtcSettings::setValue(const Key &key, const QVariant &value) +{ + QSettings::setValue(stringFromKey(key), mapEntryFromStoreEntry(value)); +} + } // namespace Utils diff --git a/src/libs/utils/qtcsettings.h b/src/libs/utils/qtcsettings.h index e4fd76d8396..3d670cf6052 100644 --- a/src/libs/utils/qtcsettings.h +++ b/src/libs/utils/qtcsettings.h @@ -5,7 +5,7 @@ #include "utils_global.h" -#include "store.h" +#include "storekey.h" #include <QSettings> @@ -17,12 +17,10 @@ public: using QSettings::QSettings; void beginGroup(const Key &prefix) { QSettings::beginGroup(stringFromKey(prefix)); } - void beginGroup(const QString &prefix) { QSettings::beginGroup(prefix); } - void beginGroup(const char *prefix) { QSettings::beginGroup(stringFromKey(prefix)); } QVariant value(const Key &key) const { return QSettings::value(stringFromKey(key)); } - QVariant value(const Key &key, const QVariant &def) const { return QSettings::value(stringFromKey(key), def); } - void setValue(const Key &key, const QVariant &value) { QSettings::setValue(stringFromKey(key), value); } + QVariant value(const Key &key, const QVariant &def) const; + void setValue(const Key &key, const QVariant &value); void remove(const Key &key) { QSettings::remove(stringFromKey(key)); } bool contains(const Key &key) const { return QSettings::contains(stringFromKey(key)); } diff --git a/src/libs/utils/store.cpp b/src/libs/utils/store.cpp index 4047aced9fe..8ca42a5560c 100644 --- a/src/libs/utils/store.cpp +++ b/src/libs/utils/store.cpp @@ -42,18 +42,37 @@ Store storeFromVariant(const QVariant &value) return Store(); } +static QVariantList storeListFromMapList(const QVariantList &mapList); +static QVariantList mapListFromStoreList(const QVariantList &storeList); + +QVariant storeEntryFromMapEntry(const QVariant &mapEntry) +{ + if (mapEntry.type() == QVariant::Map) + return QVariant::fromValue(storeFromMap(mapEntry.toMap())); + + if (mapEntry.type() == QVariant::List) + return QVariant::fromValue(storeListFromMapList(mapEntry.toList())); + + return mapEntry; +} + +QVariant mapEntryFromStoreEntry(const QVariant &storeEntry) +{ + if (storeEntry.metaType() == QMetaType::fromType<Store>()) + return QVariant::fromValue(mapFromStore(storeEntry.value<Store>())); + + if (storeEntry.type() == QVariant::List) + return QVariant::fromValue(mapListFromStoreList(storeEntry.toList())); + + return storeEntry; +} + static QVariantList storeListFromMapList(const QVariantList &mapList) { QVariantList storeList; - for (const auto &mapEntry : mapList) { - if (mapEntry.type() == QVariant::Map) - storeList.append(QVariant::fromValue(storeFromMap(mapEntry.toMap()))); - else if (mapEntry.type() == QVariant::List) - storeList.append(QVariant::fromValue(storeListFromMapList(mapEntry.toList()))); - else - storeList.append(mapEntry); - } + for (const auto &mapEntry : mapList) + storeList.append(storeEntryFromMapEntry(mapEntry)); return storeList; } @@ -62,14 +81,8 @@ static QVariantList mapListFromStoreList(const QVariantList &storeList) { QVariantList mapList; - for (const auto &storeEntry : storeList) { - if (storeEntry.metaType() == QMetaType::fromType<Store>()) - mapList.append(QVariant::fromValue(mapFromStore(storeEntry.value<Store>()))); - else if (storeEntry.type() == QVariant::List) - mapList.append(QVariant::fromValue(mapListFromStoreList(storeEntry.toList()))); - else - mapList.append(storeEntry); - } + for (const QVariant &storeEntry : storeList) + mapList.append(mapEntryFromStoreEntry(storeEntry)); return mapList; } @@ -77,30 +90,20 @@ static QVariantList mapListFromStoreList(const QVariantList &storeList) Store storeFromMap(const QVariantMap &map) { Store store; - for (auto it = map.begin(); it != map.end(); ++it) { - if (it.value().type() == QVariant::Map) { - store.insert(keyFromString(it.key()), QVariant::fromValue(storeFromMap(it->toMap()))); - } else if (it.value().type() == QVariant::List) { - store.insert(keyFromString(it.key()), - QVariant::fromValue(storeListFromMapList(it->toList()))); - } else { - store.insert(keyFromString(it.key()), it.value()); - } - } + + for (auto it = map.begin(); it != map.end(); ++it) + store.insert(keyFromString(it.key()), storeEntryFromMapEntry(it.value())); + return store; } QVariantMap mapFromStore(const Store &store) { QVariantMap map; - for (auto it = store.begin(); it != store.end(); ++it) { - if (it.value().metaType() == QMetaType::fromType<Store>()) - map.insert(stringFromKey(it.key()), mapFromStore(it->value<Store>())); - else if (it.value().type() == QVariant::List) - map.insert(stringFromKey(it.key()), mapListFromStoreList(it->toList())); - else - map.insert(stringFromKey(it.key()), it.value()); - } + + for (auto it = store.begin(); it != store.end(); ++it) + map.insert(stringFromKey(it.key()), mapEntryFromStoreEntry(it.value())); + return map; } @@ -110,9 +113,40 @@ bool isStore(const QVariant &value) return typeId == QMetaType::QVariantMap || typeId == qMetaTypeId<Store>(); } +Key::Key(const char *key, size_t n) + : data(QByteArray::fromRawData(key, n)) +{} + +Key::Key(const Key &base, int number) + : data(base.data + QByteArray::number(number)) +{} + +Key::~Key() +{} + +const QByteArrayView Key::view() const +{ + return data; +} + +const QByteArray &Key::toByteArray() const +{ + return data; +} + Key numberedKey(const Key &key, int number) { - return key + Key::number(number); + return Key(key, number); +} + +Key keyFromString(const QString &str) +{ + return str.toUtf8(); +} + +QString stringFromKey(const Key &key) +{ + return QString::fromLatin1(key.view()); } expected_str<Store> storeFromJson(const QByteArray &json) @@ -140,7 +174,7 @@ Store storeFromSettings(const Key &groupKey, QtcSettings *s) s->beginGroup(groupKey); const KeyList keys = keysFromStrings(s->allKeys()); for (const Key &key : keys) - store.insert(key, s->value(key)); + store.insert(key, storeEntryFromMapEntry(s->value(key))); s->endGroup(); return store; } @@ -149,7 +183,7 @@ void storeToSettings(const Key &groupKey, QtcSettings *s, const Store &store) { s->beginGroup(groupKey); for (auto it = store.constBegin(), end = store.constEnd(); it != end; ++it) - s->setValue(it.key(), it.value()); + s->setValue(it.key(), mapEntryFromStoreEntry(it.value())); s->endGroup(); } diff --git a/src/libs/utils/store.h b/src/libs/utils/store.h index 196f9777e44..df45cc8e9ce 100644 --- a/src/libs/utils/store.h +++ b/src/libs/utils/store.h @@ -16,6 +16,7 @@ class QtcSettings; using KeyList = QList<Key>; using Store = QMap<Key, QVariant>; +using OldStore = QMap<QByteArray, QVariant>; QTCREATOR_UTILS_EXPORT KeyList keysFromStrings(const QStringList &list); QTCREATOR_UTILS_EXPORT QStringList stringsFromKeys(const KeyList &list); @@ -33,6 +34,9 @@ QTCREATOR_UTILS_EXPORT Key numberedKey(const Key &key, int number); QTCREATOR_UTILS_EXPORT expected_str<Store> storeFromJson(const QByteArray &json); QTCREATOR_UTILS_EXPORT QByteArray jsonFromStore(const Store &store); +// These recursively change type. +QTCREATOR_UTILS_EXPORT QVariant storeEntryFromMapEntry(const QVariant &value); +QTCREATOR_UTILS_EXPORT QVariant mapEntryFromStoreEntry(const QVariant &value); // Don't use in new code. QTCREATOR_UTILS_EXPORT Store storeFromSettings(const Key &groupKey, QtcSettings *s); @@ -41,3 +45,4 @@ QTCREATOR_UTILS_EXPORT void storeToSettings(const Key &groupKey, QtcSettings *s, } // Utils Q_DECLARE_METATYPE(Utils::Store) +Q_DECLARE_METATYPE(Utils::OldStore) diff --git a/src/libs/utils/storekey.h b/src/libs/utils/storekey.h index 7e02353e17a..79e43609156 100644 --- a/src/libs/utils/storekey.h +++ b/src/libs/utils/storekey.h @@ -5,13 +5,59 @@ #include "utils_global.h" +#include <QByteArrayView> #include <QString> +#include <QHashFunctions> namespace Utils { -using Key = QByteArray; +class QTCREATOR_UTILS_EXPORT Key +{ +public: + Key() = default; + Key(const QByteArray &key) : data(key) {} -inline Key keyFromString(const QString &str) { return str.toUtf8(); } -inline QString stringFromKey(const Key &key) { return QString::fromUtf8(key); } + template <int N> + Key(const char (&key)[N]) : data(key) {} + + // FIXME: + // The following is wanted, but not used yet due to unclear ASAN report. + // template <int N> + // Key(const char (&key)[N]) : Key(key, strlen(key)) {} + + Key(const char *key, size_t n); + + Key(const Key &base, int number); + ~Key(); + + const QByteArrayView view() const; + const QByteArray &toByteArray() const; + QByteArrayView operator()() const { return data; } + + bool isEmpty() const { return data.isEmpty(); } + void clear() { data.clear(); } + + friend bool operator<(const Key &a, const Key &b) { return a.data < b.data; } + friend bool operator==(const Key &a, const Key &b) { return a.data == b.data; } + + friend Key operator+(const Key &a, const Key &b) + { + return Key(a.data + b.data); + } + friend Key operator+(const Key &a, char b) + { + return Key(a.data + b); + } + friend size_t qHash(const Key &key, size_t seed = 0) + { + return qHash(key.data, seed); + } + +private: + QByteArray data; +}; + +QTCREATOR_UTILS_EXPORT Key keyFromString(const QString &str); +QTCREATOR_UTILS_EXPORT QString stringFromKey(const Key &key); } // Utils diff --git a/src/libs/utils/unixutils.cpp b/src/libs/utils/unixutils.cpp index 5d626c74f24..c275d2c303e 100644 --- a/src/libs/utils/unixutils.cpp +++ b/src/libs/utils/unixutils.cpp @@ -27,7 +27,7 @@ QString UnixUtils::fileBrowser(const QSettings *settings) void UnixUtils::setFileBrowser(QSettings *settings, const QString &term) { - QtcSettings::setValueWithDefault(settings, "General/FileBrowser", term, defaultFileBrowser()); + QtcSettings::setValueWithDefault(settings, Key("General/FileBrowser"), term, defaultFileBrowser()); } diff --git a/src/plugins/baremetal/debugserverprovidermanager.cpp b/src/plugins/baremetal/debugserverprovidermanager.cpp index 536b279700c..7716c200c07 100644 --- a/src/plugins/baremetal/debugserverprovidermanager.cpp +++ b/src/plugins/baremetal/debugserverprovidermanager.cpp @@ -97,9 +97,9 @@ void DebugServerProviderManager::restoreProviders() Store map = storeFromVariant(data.value(key)); const KeyList keys = map.keys(); for (const Key &key : keys) { - const int lastDot = key.lastIndexOf('.'); + const int lastDot = key.view().lastIndexOf('.'); if (lastDot != -1) - map[key.mid(lastDot + 1)] = map[key]; + map[key.view().mid(lastDot + 1).toByteArray()] = map[key]; } bool restored = false; for (IDebugServerProviderFactory *f : std::as_const(m_factories)) { diff --git a/src/plugins/clangformat/clangformatsettings.cpp b/src/plugins/clangformat/clangformatsettings.cpp index f6be8e922ab..daefd3f88bf 100644 --- a/src/plugins/clangformat/clangformatsettings.cpp +++ b/src/plugins/clangformat/clangformatsettings.cpp @@ -21,7 +21,7 @@ ClangFormatSettings &ClangFormatSettings::instance() ClangFormatSettings::ClangFormatSettings() { QtcSettings *settings = Core::ICore::settings(); - settings->beginGroup(QLatin1String(Constants::SETTINGS_ID)); + settings->beginGroup(Constants::SETTINGS_ID); m_overrideDefaultFile = settings->value(Constants::OVERRIDE_FILE_ID, false).toBool(); m_formatWhileTyping = settings->value(Constants::FORMAT_WHILE_TYPING_ID, false).toBool(); m_formatOnSave = settings->value(Constants::FORMAT_CODE_ON_SAVE_ID, false).toBool(); @@ -45,7 +45,7 @@ ClangFormatSettings::ClangFormatSettings() void ClangFormatSettings::write() const { QtcSettings *settings = Core::ICore::settings(); - settings->beginGroup(QLatin1String(Constants::SETTINGS_ID)); + settings->beginGroup(Constants::SETTINGS_ID); settings->setValue(Constants::OVERRIDE_FILE_ID, m_overrideDefaultFile); settings->setValue(Constants::FORMAT_WHILE_TYPING_ID, m_formatWhileTyping); settings->setValue(Constants::FORMAT_CODE_ON_SAVE_ID, m_formatOnSave); diff --git a/src/plugins/classview/classviewnavigationwidgetfactory.cpp b/src/plugins/classview/classviewnavigationwidgetfactory.cpp index 91612317be5..aa1429fc4b7 100644 --- a/src/plugins/classview/classviewnavigationwidgetfactory.cpp +++ b/src/plugins/classview/classviewnavigationwidgetfactory.cpp @@ -8,6 +8,7 @@ #include <utils/qtcassert.h> #include <utils/qtcsettings.h> +#include <utils/store.h> using namespace Utils; diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index d1265d18efc..9dbd1980b9f 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -81,6 +81,7 @@ CorePlugin::CorePlugin() qRegisterMetaType<Utils::Store>(); qRegisterMetaType<Utils::Key>(); qRegisterMetaType<Utils::KeyList>(); + qRegisterMetaType<Utils::OldStore>(); m_instance = this; setupSystemEnvironment(); } diff --git a/src/plugins/coreplugin/find/findplugin.cpp b/src/plugins/coreplugin/find/findplugin.cpp index 5cf8eedd2e7..6836b70e077 100644 --- a/src/plugins/coreplugin/find/findplugin.cpp +++ b/src/plugins/coreplugin/find/findplugin.cpp @@ -371,7 +371,7 @@ bool Find::hasFindFlag(FindFlag flag) void FindPrivate::writeSettings() { QtcSettings *settings = ICore::settings(); - settings->beginGroup(QLatin1String("Find")); + settings->beginGroup("Find"); settings->setValueWithDefault("Backward", bool(m_findFlags & FindBackward), false); settings->setValueWithDefault("CaseSensitively", bool(m_findFlags & FindCaseSensitively), false); settings->setValueWithDefault("WholeWords", bool(m_findFlags & FindWholeWords), false); @@ -389,18 +389,18 @@ void FindPrivate::writeSettings() void FindPrivate::readSettings() { - QSettings *settings = ICore::settings(); - settings->beginGroup(QLatin1String("Find")); + QtcSettings *settings = ICore::settings(); + settings->beginGroup("Find"); { QSignalBlocker blocker(m_instance); - Find::setBackward(settings->value(QLatin1String("Backward"), false).toBool()); - Find::setCaseSensitive(settings->value(QLatin1String("CaseSensitively"), false).toBool()); - Find::setWholeWord(settings->value(QLatin1String("WholeWords"), false).toBool()); - Find::setRegularExpression(settings->value(QLatin1String("RegularExpression"), false).toBool()); - Find::setPreserveCase(settings->value(QLatin1String("PreserveCase"), false).toBool()); + Find::setBackward(settings->value("Backward", false).toBool()); + Find::setCaseSensitive(settings->value("CaseSensitively", false).toBool()); + Find::setWholeWord(settings->value("WholeWords", false).toBool()); + Find::setRegularExpression(settings->value("RegularExpression", false).toBool()); + Find::setPreserveCase(settings->value("PreserveCase", false).toBool()); } m_findCompletionModel.readSettings(settings); - m_replaceCompletions = settings->value(QLatin1String("ReplaceStrings")).toStringList(); + m_replaceCompletions = settings->value("ReplaceStrings").toStringList(); m_replaceCompletionModel.setStringList(m_replaceCompletions); settings->endGroup(); m_findToolBar->readSettings(); diff --git a/src/plugins/coreplugin/foldernavigationwidget.cpp b/src/plugins/coreplugin/foldernavigationwidget.cpp index 82101df8131..b58b6c4e466 100644 --- a/src/plugins/coreplugin/foldernavigationwidget.cpp +++ b/src/plugins/coreplugin/foldernavigationwidget.cpp @@ -27,6 +27,7 @@ #include <utils/navigationtreeview.h> #include <utils/qtcassert.h> #include <utils/removefiledialog.h> +#include <utils/store.h> #include <utils/stringutils.h> #include <utils/styledbar.h> #include <utils/stylehelper.h> diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index a4cad44e702..570dbc5d8de 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -2233,7 +2233,7 @@ void MainWindow::aboutToShutdown() void MainWindowPrivate::readSettings() { QtcSettings *settings = PluginManager::settings(); - settings->beginGroup(QLatin1String(settingsGroup)); + settings->beginGroup(settingsGroup); if (m_overrideColor.isValid()) { StyleHelper::setBaseColor(m_overrideColor); @@ -2278,7 +2278,7 @@ void MainWindowPrivate::readSettings() void MainWindow::saveSettings() { QtcSettings *settings = PluginManager::settings(); - settings->beginGroup(QLatin1String(settingsGroup)); + settings->beginGroup(settingsGroup); if (!(d->m_overrideColor.isValid() && StyleHelper::baseColor() == d->m_overrideColor)) settings->setValueWithDefault(colorKey, diff --git a/src/plugins/coreplugin/session.cpp b/src/plugins/coreplugin/session.cpp index 13d3902d96b..106558c14ba 100644 --- a/src/plugins/coreplugin/session.cpp +++ b/src/plugins/coreplugin/session.cpp @@ -541,7 +541,7 @@ void SessionManagerPrivate::restoreSessionValues(const PersistentSettingsReader // restore toplevel items that are not restored by restoreValues const auto end = values.constEnd(); for (auto it = values.constBegin(); it != end; ++it) { - if (it.key() == "valueKeys" || it.key().startsWith("value-")) + if (it.key() == "valueKeys" || it.key().view().startsWith("value-")) continue; m_sessionValues.insert(it.key(), it.value()); } diff --git a/src/plugins/cppeditor/cppcodemodelsettings.cpp b/src/plugins/cppeditor/cppcodemodelsettings.cpp index 02b22e3a545..02ec37a8205 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettings.cpp @@ -69,7 +69,7 @@ static FilePath fallbackClangdFilePath() void CppCodeModelSettings::fromSettings(QtcSettings *s) { - s->beginGroup(QLatin1String(Constants::CPPEDITOR_SETTINGSGROUP)); + s->beginGroup(Constants::CPPEDITOR_SETTINGSGROUP); setEnableLowerClazyLevels(s->value(enableLowerClazyLevelsKey(), true).toBool()); @@ -101,7 +101,7 @@ void CppCodeModelSettings::fromSettings(QtcSettings *s) void CppCodeModelSettings::toSettings(QtcSettings *s) { - s->beginGroup(QLatin1String(Constants::CPPEDITOR_SETTINGSGROUP)); + s->beginGroup(Constants::CPPEDITOR_SETTINGSGROUP); s->setValue(enableLowerClazyLevelsKey(), enableLowerClazyLevels()); s->setValue(pchUsageKey(), pchUsage()); @@ -402,7 +402,7 @@ void ClangdSettings::loadSettings() m_data.fromMap(Utils::storeFromSettings(clangdSettingsKey(), settings)); - settings->beginGroup(QLatin1String(Constants::CPPEDITOR_SETTINGSGROUP)); + settings->beginGroup(Constants::CPPEDITOR_SETTINGSGROUP); m_data.customDiagnosticConfigs = diagnosticConfigsFromSettings(settings); // Pre-8.0 compat @@ -420,7 +420,7 @@ void ClangdSettings::saveSettings() { const auto settings = Core::ICore::settings(); Utils::storeToSettings(clangdSettingsKey(), settings, m_data.toMap()); - settings->beginGroup(QLatin1String(Constants::CPPEDITOR_SETTINGSGROUP)); + settings->beginGroup(Constants::CPPEDITOR_SETTINGSGROUP); diagnosticConfigsToSettings(settings, m_data.customDiagnosticConfigs); settings->endGroup(); } diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index ab9d29eabf4..36c25631002 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -290,12 +290,12 @@ QString DebuggerSettings::dump() settings().all.forEachAspect([&msg](BaseAspect *aspect) { Key key = aspect->settingsKey(); if (!key.isEmpty()) { - const int pos = key.indexOf('/'); + const int pos = key.view().indexOf('/'); if (pos >= 0) - key = key.mid(pos); + key = key.view().mid(pos).toByteArray(); const QString current = aspect->variantValue().toString(); const QString default_ = aspect->defaultVariantValue().toString(); - QString setting = key + ": " + current + " (default: " + default_ + ')'; + QString setting = stringFromKey(key) + ": " + current + " (default: " + default_ + ')'; if (current != default_) setting += " ***"; msg << setting; diff --git a/src/plugins/designer/settingsmanager.cpp b/src/plugins/designer/settingsmanager.cpp index 1cef5f4b074..59a032595d4 100644 --- a/src/plugins/designer/settingsmanager.cpp +++ b/src/plugins/designer/settingsmanager.cpp @@ -13,10 +13,10 @@ namespace Designer::Internal { static Key addPrefix(const QString &name) { - Key result = keyFromString(name); + Key result; if (Core::ICore::settings()->group().isEmpty()) - result.prepend("Designer"); - return result; + result = "Designer"; + return Key(result + name.toUtf8()); } void SettingsManager::beginGroup(const QString &prefix) diff --git a/src/plugins/fakevim/fakevimactions.cpp b/src/plugins/fakevim/fakevimactions.cpp index 7440257eead..b4d568c7f07 100644 --- a/src/plugins/fakevim/fakevimactions.cpp +++ b/src/plugins/fakevim/fakevimactions.cpp @@ -244,7 +244,7 @@ FakeVimSettings::FakeVimSettings() FakeVimSettings::~FakeVimSettings() = default; -FvBaseAspect *FakeVimSettings::item(const Key &name) +FvBaseAspect *FakeVimSettings::item(const Utils::Key &name) { return m_nameToAspect.value(name, nullptr); } @@ -265,8 +265,8 @@ QString FakeVimSettings::trySetValue(const QString &name, const QString &value) void FakeVimSettings::setup(FvBaseAspect *aspect, const QVariant &value, - const Key &settingsKey, - const Key &shortName, + const Utils::Key &settingsKey, + const Utils::Key &shortName, const QString &labelText) { aspect->setSettingsKey("FakeVim", settingsKey); @@ -282,7 +282,7 @@ void FakeVimSettings::setup(FvBaseAspect *aspect, Q_UNUSED(labelText) #endif - const Key longName = settingsKey.toLower(); + const Key longName = settingsKey.toByteArray().toLower(); if (!longName.isEmpty()) { m_nameToAspect[longName] = aspect; m_aspectToName[aspect] = longName; diff --git a/src/plugins/fakevim/fakevimactions.h b/src/plugins/fakevim/fakevimactions.h index ac4256eca02..1ad91bb968c 100644 --- a/src/plugins/fakevim/fakevimactions.h +++ b/src/plugins/fakevim/fakevimactions.h @@ -25,8 +25,6 @@ namespace FakeVim::Internal { #ifdef FAKEVIM_STANDALONE -using Key = QByteArray; - class FvBaseAspect { public: @@ -37,15 +35,15 @@ public: virtual void setDefaultVariantValue(const QVariant &) {} virtual QVariant variantValue() const { return {}; } virtual QVariant defaultVariantValue() const { return {}; } - void setSettingsKey(const Key &group, const Key &key); - Key settingsKey() const; + void setSettingsKey(const Utils::Key &group, const Utils::Key &key); + Utils::Key settingsKey() const; void setCheckable(bool) {} void setDisplayName(const QString &) {} void setToolTip(const QString &) {} private: - Key m_settingsGroup; - Key m_settingsKey; + Utils::Key m_settingsGroup; + Utils::Key m_settingsKey; }; template <class ValueType> diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 4a5d8e0415b..a1bee53b6ad 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -6125,7 +6125,7 @@ bool FakeVimHandler::Private::handleExSetCommand(const ExCommand &cmd) if (!error.isEmpty()) showMessage(MessageError, error); } else { - Utils::Key optionName = Utils::keyFromString(cmd.args); + QString optionName = cmd.args; bool toggleOption = optionName.endsWith('!'); bool printOption = !toggleOption && optionName.endsWith('?'); @@ -6136,14 +6136,14 @@ bool FakeVimHandler::Private::handleExSetCommand(const ExCommand &cmd) if (negateOption) optionName.remove(0, 2); - FvBaseAspect *act = s.item(optionName); + FvBaseAspect *act = s.item(Utils::keyFromString(optionName)); if (!act) { showMessage(MessageError, Tr::tr("Unknown option:") + ' ' + cmd.args); } else if (act->defaultVariantValue().type() == QVariant::Bool) { bool oldValue = act->variantValue().toBool(); if (printOption) { showMessage(MessageInfo, QLatin1String(oldValue ? "" : "no") - + act->settingsKey().toLower()); + + act->settingsKey().toByteArray().toLower()); } else if (toggleOption || negateOption == oldValue) { act->setVariantValue(!oldValue); } @@ -6152,7 +6152,7 @@ bool FakeVimHandler::Private::handleExSetCommand(const ExCommand &cmd) } else if (toggleOption) { showMessage(MessageError, Tr::tr("Trailing characters:") + ' ' + cmd.args); } else { - showMessage(MessageInfo, act->settingsKey().toLower() + "=" + showMessage(MessageInfo, act->settingsKey().toByteArray().toLower() + "=" + act->variantValue().toString()); } } diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index d14ca1d816a..8b406c2d1c0 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -605,7 +605,7 @@ void LanguageClientSettings::init() LanguageClientManager::applySettings(); } -QList<BaseSettings *> LanguageClientSettings::fromSettings(QSettings *settingsIn) +QList<BaseSettings *> LanguageClientSettings::fromSettings(QtcSettings *settingsIn) { settingsIn->beginGroup(settingsGroupKey); QList<BaseSettings *> result; @@ -654,7 +654,7 @@ void LanguageClientSettings::enableSettings(const QString &id, bool enable) settingsPage().enableSettings(id, enable); } -void LanguageClientSettings::toSettings(QSettings *settings, +void LanguageClientSettings::toSettings(QtcSettings *settings, const QList<BaseSettings *> &languageClientSettings) { settings->beginGroup(settingsGroupKey); diff --git a/src/plugins/languageclient/languageclientsettings.h b/src/plugins/languageclient/languageclientsettings.h index 903edcba80f..7c33fedad1a 100644 --- a/src/plugins/languageclient/languageclientsettings.h +++ b/src/plugins/languageclient/languageclientsettings.h @@ -135,7 +135,7 @@ class LANGUAGECLIENT_EXPORT LanguageClientSettings { public: static void init(); - static QList<BaseSettings *> fromSettings(QSettings *settings); + static QList<BaseSettings *> fromSettings(Utils::QtcSettings *settings); static QList<BaseSettings *> pageSettings(); static QList<BaseSettings *> changedSettings(); @@ -146,7 +146,7 @@ public: static void registerClientType(const ClientType &type); static void addSettings(BaseSettings *settings); static void enableSettings(const QString &id, bool enable = true); - static void toSettings(QSettings *settings, const QList<BaseSettings *> &languageClientSettings); + static void toSettings(Utils::QtcSettings *settings, const QList<BaseSettings *> &languageClientSettings); static bool outlineComboBoxIsSorted(); static void setOutlineComboBoxSorted(bool sorted); diff --git a/src/plugins/mcusupport/test/unittest.cpp b/src/plugins/mcusupport/test/unittest.cpp index 136a0832883..5692ceee751 100644 --- a/src/plugins/mcusupport/test/unittest.cpp +++ b/src/plugins/mcusupport/test/unittest.cpp @@ -694,20 +694,19 @@ void McuSupportTest::test_legacy_createPackagesWithCorrespondingSettings_data() QTest::newRow("iar_mimxrt1064_evk_freertos_json") << iar_mimxrt1064_evk_freertos_json - << QSet<Key>{{"EVK_MIMXRT1064_SDK_PATH"}, - {Key{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append( - "IMXRT1064")}, - "IARToolchain"} + << QSet<Key>{"EVK_MIMXRT1064_SDK_PATH", + Key{QByteArray(Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX).append("IMXRT1064")}, + "IARToolchain"} .unite(commonSettings); QTest::newRow("stm32f469i") << iar_stm32f469i_discovery_baremetal_json << QSet<Key>{{"STM32Cube_FW_F4_SDK_PATH"}, "IARToolchain"}.unite( commonSettings); - QTest::newRow("nxp1050") << armgcc_mimxrt1050_evk_freertos_json - << QSet<Key>{{"EVKB_IMXRT1050_SDK_PATH"}, - {Key{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX} - .append("IMXRT1050")}, - "GNUArmEmbeddedToolchain"} - .unite(commonSettings); + QTest::newRow("nxp1050") + << armgcc_mimxrt1050_evk_freertos_json + << QSet<Key>{"EVKB_IMXRT1050_SDK_PATH", + Key{QByteArray(Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX).append("IMXRT1050")}, + "GNUArmEmbeddedToolchain"} + .unite(commonSettings); QTest::newRow("armgcc_stm32h750b_discovery_baremetal_json") << armgcc_stm32h750b_discovery_baremetal_json << QSet<Key>{{"STM32Cube_FW_H7_SDK_PATH"}, "GNUArmEmbeddedToolchain"}.unite( diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp index e8524e6395e..456f8909a99 100644 --- a/src/plugins/perfprofiler/perfsettings.cpp +++ b/src/plugins/perfprofiler/perfsettings.cpp @@ -428,11 +428,11 @@ void PerfSettings::readGlobalSettings() Store defaults; // Read stored values - QSettings *settings = Core::ICore::settings(); - settings->beginGroup(QLatin1String(Constants::AnalyzerSettingsGroupId)); + QtcSettings *settings = Core::ICore::settings(); + settings->beginGroup(Constants::AnalyzerSettingsGroupId); Store map = defaults; for (Store::ConstIterator it = defaults.constBegin(); it != defaults.constEnd(); ++it) - map.insert(it.key(), settings->value(stringFromKey(it.key()), it.value())); + map.insert(it.key(), settings->value(it.key(), it.value())); settings->endGroup(); fromMap(map); @@ -440,12 +440,12 @@ void PerfSettings::readGlobalSettings() void PerfSettings::writeGlobalSettings() const { - QSettings *settings = Core::ICore::settings(); - settings->beginGroup(QLatin1String(Constants::AnalyzerSettingsGroupId)); + QtcSettings *settings = Core::ICore::settings(); + settings->beginGroup(Constants::AnalyzerSettingsGroupId); Store map; toMap(map); for (Store::ConstIterator it = map.constBegin(); it != map.constEnd(); ++it) - settings->setValue(stringFromKey(it.key()), it.value()); + settings->setValue(it.key(), it.value()); settings->endGroup(); } diff --git a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp index 7cfe6faba4f..1337e2183f6 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp @@ -225,8 +225,8 @@ QWidget *CustomWizardFieldPage::registerPathChooser(const QString &fieldName, pathChooser->setExpectedKind(PathChooser::Command); else if (expectedKind == QLatin1String("any")) pathChooser->setExpectedKind(PathChooser::Any); - pathChooser->setHistoryCompleter("PE.Custom." + m_parameters->id.name() - + '.' + keyFromString(field.name)); + pathChooser->setHistoryCompleter(keyFromString("PE.Custom." + m_parameters->id.name() + + '.' + field.name)); registerField(fieldName, pathChooser, "path", SIGNAL(rawPathChanged(QString))); // Connect to completeChanged() for derived classes that reimplement isComplete() diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index 33e2b4d9c89..5230caeba7e 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -218,8 +218,8 @@ void EditorConfiguration::fromMap(const Store &map) Store submap; for (auto it = map.constBegin(), end = map.constEnd(); it != end; ++it) { - if (it.key().startsWith(kPrefix)) - submap.insert(it.key().mid(kPrefix.size()), it.value()); + if (it.key().view().startsWith(kPrefix.view())) + submap.insert(it.key().view().mid(kPrefix.view().size()).toByteArray(), it.value()); } d->m_defaultCodeStyle->fromMap(submap); d->m_typingSettings.fromMap(submap); diff --git a/src/plugins/projectexplorer/extraabi.cpp b/src/plugins/projectexplorer/extraabi.cpp index 80992381562..619d66733f1 100644 --- a/src/plugins/projectexplorer/extraabi.cpp +++ b/src/plugins/projectexplorer/extraabi.cpp @@ -62,10 +62,12 @@ void ExtraAbi::load() std::vector<Abi::OS> oses; for (const QString &osName : osNames) { Abi::OS os = Abi::osFromString(osName); - if (Abi::toString(os) != osName) - qWarning() << "Invalid OS found when registering extra abi flavor" << it.key(); - else + if (Abi::toString(os) != osName) { + qWarning() << "Invalid OS found when registering extra abi flavor" + << it.key().toByteArray(); + } else { oses.push_back(os); + } } Abi::registerOsFlavor(oses, stringFromKey(flavor)); diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index d4b413ae124..467fe0c0a87 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -802,7 +802,8 @@ QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const KeyList for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) { Key key = it.key(); QVariant value = it.value(); - if (path.size() == 2 && path.at(1).startsWith("ProjectExplorer.Target.RunConfiguration.")) { + if (path.size() == 2 + && path.at(1).view().startsWith("ProjectExplorer.Target.RunConfiguration.")) { if (argsKeys.contains(key)) key = "RunConfiguration.Arguments"; else if (wdKeys.contains(key)) diff --git a/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp b/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp index fbfa7cee520..f7735415c47 100644 --- a/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp +++ b/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp @@ -89,7 +89,7 @@ QString QtWizard::templateDir() bool QtWizard::lowerCaseFiles() { - Key lowerCaseSettingsKey = CppEditor::Constants::CPPEDITOR_SETTINGSGROUP; + QByteArray lowerCaseSettingsKey = CppEditor::Constants::CPPEDITOR_SETTINGSGROUP; lowerCaseSettingsKey += '/'; lowerCaseSettingsKey += CppEditor::Constants::LOWERCASE_CPPFILES_KEY; const bool lowerCaseDefault = CppEditor::Constants::LOWERCASE_CPPFILES_DEFAULT; diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 4cfe178e6df..8cc56857231 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -765,7 +765,7 @@ void QtVersion::fromMap(const Store &map, const FilePath &filePath, bool forceRe d->m_qmakeCommand = filePath.resolvePath(d->m_qmakeCommand); const expected_str<Utils::Store> persistentStore = PersistentCacheStore::byKey( - "QtVersionData" + d->m_qmakeCommand.toString().toUtf8()); + Key("QtVersionData" + d->m_qmakeCommand.toString().toUtf8())); if (persistentStore && !forceRefreshCache) { d->m_data.fromMap(*persistentStore); @@ -799,7 +799,7 @@ Store QtVersion::toMap() const result.insert(QTVERSIONQMAKEPATH, qmakeFilePath().toSettings()); if (d->m_data.versionInfoUpToDate) - PersistentCacheStore::write("QtVersionData" + d->m_qmakeCommand.toString().toUtf8(), + PersistentCacheStore::write(Key("QtVersionData" + d->m_qmakeCommand.toString().toUtf8()), d->m_data.toMap()); return result; @@ -1407,7 +1407,7 @@ void QtVersionPrivate::updateVersionInfo() m_isUpdating = false; m_data.versionInfoUpToDate = true; - PersistentCacheStore::write("QtVersionData" + m_qmakeCommand.toString().toUtf8(), + PersistentCacheStore::write(Key("QtVersionData" + m_qmakeCommand.toString().toUtf8()), m_data.toMap()); } diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index c329d24db01..4674bb07075 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -213,14 +213,14 @@ bool QtVersionManagerImpl::restoreQtVersions() if (version < 1) return false; - const Key keyPrefix(QTVERSION_DATA_KEY); + const QByteArray keyPrefix(QTVERSION_DATA_KEY); const Store::ConstIterator dcend = data.constEnd(); for (Store::ConstIterator it = data.constBegin(); it != dcend; ++it) { const Key &key = it.key(); - if (!key.startsWith(keyPrefix)) + if (!key.view().startsWith(keyPrefix)) continue; bool ok; - int count = key.mid(keyPrefix.count()).toInt(&ok); + int count = key.view().mid(keyPrefix.count()).toInt(&ok); if (!ok || count < 0) continue; @@ -287,14 +287,14 @@ void QtVersionManagerImpl::updateFromInstaller(bool emitSignal) QStringList sdkVersions; - const Key keyPrefix(QTVERSION_DATA_KEY); + const QByteArray keyPrefix(QTVERSION_DATA_KEY); const Store::ConstIterator dcend = data.constEnd(); for (Store::ConstIterator it = data.constBegin(); it != dcend; ++it) { const Key &key = it.key(); - if (!key.startsWith(keyPrefix)) + if (!key.view().startsWith(keyPrefix)) continue; bool ok; - int count = key.mid(keyPrefix.count()).toInt(&ok); + int count = key.view().mid(keyPrefix.count()).toInt(&ok); if (!ok || count < 0) continue; From 621a492b6a2aa1c691c454894abf2ea6d65bc76f Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 27 Sep 2023 09:57:59 +0200 Subject: [PATCH 1299/1777] AutoTest: Guard against concurrent access While parsing for Qt Quick Tests it may happen that an internal map is accessed concurrently by different threads. Guard against this. Minor drive-by optimizations. Change-Id: Ic3b62c27feddb9a5ac5588a6c9643fc0e623ce19 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/autotest/quick/quicktestparser.cpp | 15 ++++++++++----- src/plugins/autotest/quick/quicktestparser.h | 4 +++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/plugins/autotest/quick/quicktestparser.cpp b/src/plugins/autotest/quick/quicktestparser.cpp index ef0bba8cc89..017f9f4c6dd 100644 --- a/src/plugins/autotest/quick/quicktestparser.cpp +++ b/src/plugins/autotest/quick/quicktestparser.cpp @@ -261,7 +261,10 @@ bool QuickTestParser::handleQtQuickTest(QPromise<TestParseResultPtr> &promise, return false; const FilePath cppFileName = document->filePath(); const FilePath proFile = FilePath::fromString(ppList.at(0)->projectFile); - m_mainCppFiles.insert(cppFileName, proFile); + { + QWriteLocker lock(&m_parseLock); + m_mainCppFiles.insert(cppFileName, proFile); + } const FilePath srcDir = FilePath::fromString(quickTestSrcDir(cppFileName)); if (srcDir.isEmpty()) return false; @@ -340,13 +343,13 @@ QuickTestParser::QuickTestParser(ITestFramework *framework) void QuickTestParser::init(const QSet<FilePath> &filesToParse, bool fullParse) { m_qmlSnapshot = QmlJSTools::Internal::ModelManager::instance()->snapshot(); + QWriteLocker lock(&m_parseLock); // should not be necessary if (!fullParse) { // in a full parse we get the correct entry points by the respective main m_proFilesForQmlFiles = QuickTestUtils::proFilesForQmlFiles(framework(), filesToParse); // get rid of cached main cpp files that are going to get processed anyhow for (const FilePath &file : filesToParse) { - if (m_mainCppFiles.contains(file)) { - m_mainCppFiles.remove(file); + if (m_mainCppFiles.remove(file) == 1) { if (m_mainCppFiles.isEmpty()) break; } @@ -355,6 +358,7 @@ void QuickTestParser::init(const QSet<FilePath> &filesToParse, bool fullParse) // get rid of all cached main cpp files m_mainCppFiles.clear(); } + lock.unlock(); m_checkForDerivedTests = theQtTestFramework().quickCheckForDerivedTests(); @@ -399,9 +403,10 @@ bool QuickTestParser::processDocument(QPromise<TestParseResultPtr> &promise, return handleQtQuickTest(promise, cppdoc, framework()); } -FilePath QuickTestParser::projectFileForMainCppFile(const FilePath &fileName) const +FilePath QuickTestParser::projectFileForMainCppFile(const FilePath &fileName) { - return m_mainCppFiles.contains(fileName) ? m_mainCppFiles.value(fileName) : FilePath(); + QReadLocker lock(&m_parseLock); + return m_mainCppFiles.value(fileName); } } // namespace Autotest::Internal diff --git a/src/plugins/autotest/quick/quicktestparser.h b/src/plugins/autotest/quick/quicktestparser.h index e93fa9605f4..c22e1d480e1 100644 --- a/src/plugins/autotest/quick/quicktestparser.h +++ b/src/plugins/autotest/quick/quicktestparser.h @@ -8,6 +8,7 @@ #include <qmljs/qmljsdocument.h> #include <QFileSystemWatcher> +#include <QReadWriteLock> namespace Autotest { namespace Internal { @@ -28,7 +29,7 @@ public: void release() override; bool processDocument(QPromise<TestParseResultPtr> &promise, const Utils::FilePath &fileName) override; - Utils::FilePath projectFileForMainCppFile(const Utils::FilePath &fileName) const; + Utils::FilePath projectFileForMainCppFile(const Utils::FilePath &fileName); QStringList supportedExtensions() const override { return {"qml"}; }; private: @@ -45,6 +46,7 @@ private: QMap<QString, QMap<QString, QDateTime> > m_watchedFiles; QMap<Utils::FilePath, Utils::FilePath> m_mainCppFiles; QSet<Utils::FilePath> m_prefilteredFiles; + QReadWriteLock m_parseLock; // guard for m_mainCppFiles bool m_checkForDerivedTests = false; }; From 8f741e3ab0ca7d8eb38db6a2e2848e9a7147f723 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 26 Sep 2023 11:07:16 +0200 Subject: [PATCH 1300/1777] AutoTest: Split and re-organize wizard Split off the single wizard into separate wizards listed inside a separate projects category. Simplifies maintenance and additional handling to be added in a later patch. Minor drive-by fixes for the cmake based projects. Change-Id: I4f2f83c3892ea9a0f31691770a927294922c382d Reviewed-by: David Schulz <david.schulz@qt.io> --- .../autotest/{ => boosttest}/wizard.json | 168 ++------------- .../wizards/autotest/catch/wizard.json | 184 +++++++++++++++++ .../templates/wizards/autotest/files/tst.txt | 5 +- .../wizards/autotest/gtest/wizard.json | 192 ++++++++++++++++++ .../wizards/autotest/qttest/wizard.json | 180 ++++++++++++++++ .../wizards/autotest/quicktest/wizard.json | 192 ++++++++++++++++++ 6 files changed, 765 insertions(+), 156 deletions(-) rename share/qtcreator/templates/wizards/autotest/{ => boosttest}/wizard.json (50%) create mode 100644 share/qtcreator/templates/wizards/autotest/catch/wizard.json create mode 100644 share/qtcreator/templates/wizards/autotest/gtest/wizard.json create mode 100644 share/qtcreator/templates/wizards/autotest/qttest/wizard.json create mode 100644 share/qtcreator/templates/wizards/autotest/quicktest/wizard.json diff --git a/share/qtcreator/templates/wizards/autotest/wizard.json b/share/qtcreator/templates/wizards/autotest/boosttest/wizard.json similarity index 50% rename from share/qtcreator/templates/wizards/autotest/wizard.json rename to share/qtcreator/templates/wizards/autotest/boosttest/wizard.json index 71dd8de4b7a..4b674389bc4 100644 --- a/share/qtcreator/templates/wizards/autotest/wizard.json +++ b/share/qtcreator/templates/wizards/autotest/boosttest/wizard.json @@ -1,12 +1,12 @@ { "version": 1, "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ], - "id": "R.AutoTest", - "category": "H.Project", - "trDescription": "Creates a new unit test project. Unit tests allow you to verify that the code is fit for use and that there are no regressions.", - "trDisplayName": "Auto Test Project", - "trDisplayCategory": "Other Project", - "icon": "autotest.png", + "id": "M.BoostAutoTest", + "category": "I.TestProject", + "trDescription": "Creates a new unit test project using Boost. Unit tests allow you to verify that the code is fit for use and that there are no regressions.", + "trDisplayName": "Boost Test Project", + "trDisplayCategory": "Test Project", + "icon": "../autotest.png", "iconKind": "Themed", "featuresRequired": [ "QtSupport.Wizards.FeatureDesktop" ], "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", @@ -33,10 +33,6 @@ { "key": "MainCppName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src') }" }, - { - "key": "TestCaseFileGTestWithCppSuffix", - "value": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Util.preferredSuffix('text/x-c++src') }" - }, { "key": "GUARD", "value": "%{JS: value('TestCaseFileWithHeaderSuffix').toUpperCase().replace('.', '_') }" @@ -44,10 +40,6 @@ { "key": "TestCaseFileWithCppSuffix", "value": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Util.preferredSuffix('text/x-c++src') }" - }, - { - "key": "TestCaseFileWithQmlSuffix", - "value": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.qml' }" } ], @@ -59,7 +51,7 @@ "typeId": "Project", "data": { - "trDescription": "This wizard creates a simple unit test project." + "trDescription": "This wizard creates a simple unit test project using Boost." } }, { @@ -77,18 +69,6 @@ "index": 0, "items": [ - { - "trKey": "Qt Test", - "value": "QtTest" - }, - { - "trKey": "Google Test", - "value": "GTest" - }, - { - "trKey": "Qt Quick Test", - "value": "QtQuickTest" - }, { "trKey": "Boost Test (header only)", "value": "BoostTest" @@ -96,28 +76,13 @@ { "trKey": "Boost Test (shared libraries)", "value": "BoostTest_dyn" - }, - { - "trKey": "Catch2", - "value": "Catch2" } - ] } }, - { - "name": "RequireGUI", - "trDisplayName": "GUI Application", - "visible": "%{JS: value('TestFrameWork') === 'QtTest'}", - "type": "CheckBox", - "data": { - "checked": false - } - }, { "name": "TestSuiteName", "trDisplayName": "Test suite name:", - "visible": "%{JS: ['BoostTest', 'BoostTest_dyn', 'GTest'].indexOf(value('TestFrameWork')) >= 0}", "mandatory": true, "type": "LineEdit", "data": { "validator": "^[a-zA-Z_0-9]+$" } @@ -129,43 +94,6 @@ "type": "LineEdit", "data": { "validator": "^[a-zA-Z_0-9]+$" } }, - { - "name": "RequireApplication", - "trDisplayName": "Requires QApplication", - "visible": "%{JS: value('TestFrameWork') === 'QtTest'}", - "type": "CheckBox", - "data": { - "checked": false - } - }, - { - "name": "UseSetupCode", - "trDisplayName": "Generate setup code", - "visible": "%{JS: value('TestFrameWork') === 'QtQuickTest'}", - "type": "CheckBox", - "data": { - "checked": false - } - }, - { - "name": "GenerateInitAndCleanup", - "trDisplayName": "Generate initialization and cleanup code", - "visible": "%{JS: [ 'QtTest', 'QtQuickTest' ].indexOf(value('TestFrameWork')) >= 0 }", - "type": "CheckBox", - "data": { - "checked": false - } - }, - { - "name": "GTestRepository", - "trDisplayName": "Googletest source directory (optional):", - "visible": "%{JS: value('TestFrameWork') === 'GTest'}", - "mandatory": false, - "type": "PathChooser", - "data": { - "kind": "existingDirectory" - } - }, { "name": "BoostIncDir", "trDisplayName": "Boost include directory (optional):", @@ -186,25 +114,6 @@ "kind": "existingDirectory" } }, - { - "name": "CatchIncDir", - "trDisplayName": "Catch2 include directory (optional):", - "visible": "%{JS: value('TestFrameWork') === 'Catch2'}", - "mandatory": false, - "type": "PathChooser", - "data": { - "kind": "existingDirectory" - } - }, - { - "name": "Catch2NeedsQt", - "trDisplayName": "Use Qt libraries", - "visible": "%{JS: '%{TestFrameWork}' === 'Catch2'}", - "type": "CheckBox", - "data": { - "checked": true - } - }, { "name": "BuildSystem", "trDisplayName": "Build system:", @@ -242,7 +151,7 @@ "enabled": "%{IsTopLevelProject}", "data": { "projectFilePath": "%{ProjectFilePath}", - "requiredFeatures": [ "%{JS: (value('TestFrameWork') === 'QtQuickTest' ? 'QtSupport.Wizards.FeatureQtQuick.2' : ((value('BuildSystem') === 'qmake' || value('TestFrameWork') === 'QtTest') ? 'QtSupport.Wizards.FeatureQt' : 'QtSupport.Wizards.FeatureDesktop' )) }" ] + "requiredFeatures": [ "%{JS: value('BuildSystem') === 'qmake' ? 'QtSupport.Wizards.FeatureQt' : 'QtSupport.Wizards.FeatureDesktop' }" ] } }, { @@ -258,87 +167,38 @@ "data": [ { - "source": "files/gtest_dependency.pri", - "target": "gtest_dependency.pri", - "condition": "%{JS: value('TestFrameWork') == 'GTest' && value('BuildSystem') == 'qmake'}", - "openInEditor": false - }, - { - "source": "files/googlecommon.js", - "target": "googlecommon.js", - "condition": "%{JS: value('TestFrameWork') == 'GTest' && value('BuildSystem') == 'qbs'}", - "openInEditor": false - }, - { - "source": "files/tst.pro", + "source": "../files/tst.pro", "target": "%{ProjectFilePath}", "condition": "%{JS: value('BuildSystem') == 'qmake'}", "openInEditor": false, "openAsProject": true }, { - "source": "files/tst.qbs", + "source": "../files/tst.qbs", "target": "%{ProjectFilePath}", "condition": "%{JS: value('BuildSystem') == 'qbs'}", "openInEditor": false, "openAsProject": true }, { - "source": "files/tst.txt", + "source": "../files/tst.txt", "target": "CMakeLists.txt", "condition": "%{JS: value('BuildSystem') == 'cmake'}", "openInEditor": false, "openAsProject": true }, { - "source": "files/tst_src_gt.cpp", - "target": "%{TestCaseFileGTestWithCppSuffix}", - "condition": "%{JS: value('TestFrameWork') == 'GTest'}", - "openInEditor": true - }, - { - "source": "files/tst_src.cpp", - "target": "%{TestCaseFileWithCppSuffix}", - "condition": "%{JS: value('TestFrameWork') == 'QtTest'}", - "openInEditor": true - }, - { - "source": "files/tst_main.cpp", + "source": "../files/tst_main.cpp", "target": "%{MainCppName}", - "condition": "%{JS: ['GTest', 'QtQuickTest', 'BoostTest', 'BoostTest_dyn', 'Catch2'].indexOf(value('TestFrameWork')) >= 0}", "openInEditor": true }, { - "source": "files/tst_src_boost.cpp", + "source": "../files/tst_src_boost.cpp", "target": "%{TestCaseFileWithCppSuffix}", "condition": "%{JS: value('TestFrameWork') === 'BoostTest_dyn'}" }, { - "source": "files/tst_qml.tmpl", - "target": "%{TestCaseFileWithQmlSuffix}", - "condition": "%{JS: value('TestFrameWork') === 'QtQuickTest'}", - "openInEditor": true - }, - { - "source": "files/setup.cpp", - "target": "setup.cpp", - "condition": "%{JS: value('TestFrameWork') === 'QtQuickTest'}", - "openInEditor": true - }, - { - "source": "files/setup.h", - "target": "setup.h", - "condition": "%{JS: value('TestFrameWork') === 'QtQuickTest'}", - "openInEditor": true - }, - { - "source": "files/catch2_tst.cpp", - "target": "%{TestCaseFileWithCppSuffix}", - "condition": "%{JS: '%{TestFrameWork}' === 'Catch2'}", - "openInEditor": true - }, - { - "source": "../projects/git.ignore", + "source": "../../projects/git.ignore", "target": ".gitignore", "condition": "%{JS: ( %{IsTopLevelProject} && value('VersionControl') === 'G.Git' )}" } diff --git a/share/qtcreator/templates/wizards/autotest/catch/wizard.json b/share/qtcreator/templates/wizards/autotest/catch/wizard.json new file mode 100644 index 00000000000..d9ca160459a --- /dev/null +++ b/share/qtcreator/templates/wizards/autotest/catch/wizard.json @@ -0,0 +1,184 @@ +{ + "version": 1, + "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ], + "id": "R.CatchAutoTest", + "category": "I.TestProject", + "trDescription": "Creates a new unit test project using Catch2. Unit tests allow you to verify that the code is fit for use and that there are no regressions.", + "trDisplayName": "Catch2 Test Project", + "trDisplayCategory": "Test Project", + "icon": "../autotest.png", + "iconKind": "Themed", + "featuresRequired": [ "QtSupport.Wizards.FeatureDesktop" ], + "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", + + "options": + [ + { "key": "TestFrameWork", + "value": "Catch2" + }, + { "key": "ProjectFilePath", + "value": "%{JS: value('BuildSystem') == 'qmake' ? value('ProFileName') : (value('BuildSystem') == 'qbs' ? value('QbsFileName') : value('CMakeFileName')) }" + }, + { "key": "ProFileName", + "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" + }, + { + "key": "QbsFileName", + "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" + }, + { + "key": "CMakeFileName", + "value": "%{ProjectDirectory}/CMakeLists.txt" + }, + { "key": "IsTopLevelProject", + "value": "%{JS: !'%{Exists:ProjectExplorer.Profile.Ids}' }" + }, + { "key": "MainCppName", + "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src') }" + }, + { + "key": "GUARD", + "value": "%{JS: value('TestCaseFileWithHeaderSuffix').toUpperCase().replace('.', '_') }" + }, + { + "key": "TestCaseFileWithCppSuffix", + "value": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Util.preferredSuffix('text/x-c++src') }" + } + ], + + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project", + "data": + { + "trDescription": "This wizard creates a simple unit test project using Catch2." + } + }, + { + "trDisplayName": "Project and Test Information", + "trShortTitle": "Details", + "typeId": "Fields", + "data": + [ + { + "name": "TestCaseName", + "trDisplayName": "Test case name:", + "mandatory": true, + "type": "LineEdit", + "data": { "validator": "^[a-zA-Z_0-9]+$" } + }, + { + "name": "CatchIncDir", + "trDisplayName": "Catch2 include directory (optional):", + "visible": "%{JS: value('TestFrameWork') === 'Catch2'}", + "mandatory": false, + "type": "PathChooser", + "data": { + "kind": "existingDirectory" + } + }, + { + "name": "Catch2NeedsQt", + "trDisplayName": "Use Qt libraries", + "visible": "%{JS: '%{TestFrameWork}' === 'Catch2'}", + "type": "CheckBox", + "data": { + "checked": false + } + }, + { + "name": "BuildSystem", + "trDisplayName": "Build system:", + "type": "ComboBox", + "persistenceKey": "BuildSystemType", + "data": + { + "index": 1, + "items": + [ + { + "trKey": "qmake", + "value": "qmake", + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" + }, + { + "trKey": "CMake", + "value": "cmake", + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" + }, + { + "trKey": "Qbs", + "value": "qbs", + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" + } + ] + } + } + ] + }, + { + "trDisplayName": "Kit Selection", + "trShortTitle": "Kits", + "typeId": "Kits", + "enabled": "%{IsTopLevelProject}", + "data": { + "projectFilePath": "%{ProjectFilePath}", + "requiredFeatures": [ "%{JS: (value('Catch2NeedsQt') || value('BuildSystem') === 'qmake') ? 'QtSupport.Wizards.FeatureQt' : 'QtSupport.Wizards.FeatureDesktop' }" ] + } + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": + [ + { + "typeId": "File", + "data": + [ + { + "source": "../files/tst.pro", + "target": "%{ProjectFilePath}", + "condition": "%{JS: value('BuildSystem') == 'qmake'}", + "openInEditor": false, + "openAsProject": true + }, + { + "source": "../files/tst.qbs", + "target": "%{ProjectFilePath}", + "condition": "%{JS: value('BuildSystem') == 'qbs'}", + "openInEditor": false, + "openAsProject": true + }, + { + "source": "../files/tst.txt", + "target": "CMakeLists.txt", + "condition": "%{JS: value('BuildSystem') == 'cmake'}", + "openInEditor": false, + "openAsProject": true + }, + { + "source": "../files/tst_main.cpp", + "target": "%{MainCppName}", + "openInEditor": true + }, + { + "source": "../files/catch2_tst.cpp", + "target": "%{TestCaseFileWithCppSuffix}", + "condition": "%{JS: '%{TestFrameWork}' === 'Catch2'}", + "openInEditor": true + }, + { + "source": "../../projects/git.ignore", + "target": ".gitignore", + "condition": "%{JS: ( %{IsTopLevelProject} && value('VersionControl') === 'G.Git' )}" + } + ] + } + ] +} diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.txt b/share/qtcreator/templates/wizards/autotest/files/tst.txt index 5e486318ce5..f451cd1ba75 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.txt +++ b/share/qtcreator/templates/wizards/autotest/files/tst.txt @@ -150,7 +150,7 @@ find_package(Boost COMPONENTS unit_test_framework REQUIRED) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -add_executable(%{TestCaseName} %{MainCppName} %{TestCaseFileGTestWithCppSuffix}) +add_executable(%{TestCaseName} %{MainCppName} %{TestCaseFileWithCppSuffix}) add_test(NAME %{TestCaseName} COMMAND %{TestCaseName}) if (Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) @@ -165,7 +165,8 @@ find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Gui) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui) @endif -add_executable(${PROJECT_NAME} %{TestCaseFileWithCppSuffix} main.cpp) +add_executable(%{TestCaseName} %{TestCaseFileWithCppSuffix} main.cpp) +add_test(NAME %{TestCaseName} COMMAND %{TestCaseName}) @if "%{Catch2NeedsQt}" == "true" target_link_libraries(%{TestCaseName} PRIVATE Qt${QT_VERSION_MAJOR}::Gui) diff --git a/share/qtcreator/templates/wizards/autotest/gtest/wizard.json b/share/qtcreator/templates/wizards/autotest/gtest/wizard.json new file mode 100644 index 00000000000..5e79ab5539a --- /dev/null +++ b/share/qtcreator/templates/wizards/autotest/gtest/wizard.json @@ -0,0 +1,192 @@ +{ + "version": 1, + "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ], + "id": "G.AutoTest", + "category": "I.TestProject", + "trDescription": "Creates a new unit test project using Google Test. Unit tests allow you to verify that the code is fit for use and that there are no regressions.", + "trDisplayName": "Google Test Project", + "trDisplayCategory": "Test Project", + "icon": "../autotest.png", + "iconKind": "Themed", + "featuresRequired": [ "QtSupport.Wizards.FeatureDesktop" ], + "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", + + "options": + [ + { "key": "TestFrameWork", + "value": "GTest" + }, + { "key": "ProjectFilePath", + "value": "%{JS: value('BuildSystem') == 'qmake' ? value('ProFileName') : (value('BuildSystem') == 'qbs' ? value('QbsFileName') : value('CMakeFileName')) }" + }, + { "key": "ProFileName", + "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" + }, + { + "key": "QbsFileName", + "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" + }, + { + "key": "CMakeFileName", + "value": "%{ProjectDirectory}/CMakeLists.txt" + }, + { "key": "IsTopLevelProject", + "value": "%{JS: !'%{Exists:ProjectExplorer.Profile.Ids}' }" + }, + { "key": "MainCppName", + "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src') }" + }, + { + "key": "TestCaseFileGTestWithCppSuffix", + "value": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Util.preferredSuffix('text/x-c++src') }" + }, + { + "key": "GUARD", + "value": "%{JS: value('TestCaseFileWithHeaderSuffix').toUpperCase().replace('.', '_') }" + } + ], + + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project", + "data": + { + "trDescription": "This wizard creates a simple unit test project using Google Test." + } + }, + { + "trDisplayName": "Project and Test Information", + "trShortTitle": "Details", + "typeId": "Fields", + "data": + [ + { + "name": "TestSuiteName", + "trDisplayName": "Test suite name:", + "mandatory": true, + "type": "LineEdit", + "data": { "validator": "^[a-zA-Z_0-9]+$" } + }, + { + "name": "TestCaseName", + "trDisplayName": "Test case name:", + "mandatory": true, + "type": "LineEdit", + "data": { "validator": "^[a-zA-Z_0-9]+$" } + }, + { + "name": "GTestRepository", + "trDisplayName": "Googletest source directory (optional):", + "mandatory": false, + "type": "PathChooser", + "data": { + "kind": "existingDirectory" + } + }, + { + "name": "BuildSystem", + "trDisplayName": "Build system:", + "type": "ComboBox", + "persistenceKey": "BuildSystemType", + "data": + { + "index": 1, + "items": + [ + { + "trKey": "qmake", + "value": "qmake", + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" + }, + { + "trKey": "CMake", + "value": "cmake", + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" + }, + { + "trKey": "Qbs", + "value": "qbs", + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" + } + ] + } + } + ] + }, + { + "trDisplayName": "Kit Selection", + "trShortTitle": "Kits", + "typeId": "Kits", + "enabled": "%{IsTopLevelProject}", + "data": { + "projectFilePath": "%{ProjectFilePath}", + "requiredFeatures": [ "%{JS: value('BuildSystem') === 'qmake' ? 'QtSupport.Wizards.FeatureQt' : 'QtSupport.Wizards.FeatureDesktop' }" ] + } + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": + [ + { + "typeId": "File", + "data": + [ + { + "source": "../files/gtest_dependency.pri", + "target": "gtest_dependency.pri", + "condition": "%{JS: value('BuildSystem') == 'qmake'}", + "openInEditor": false + }, + { + "source": "../files/googlecommon.js", + "target": "googlecommon.js", + "condition": "%{JS: value('BuildSystem') == 'qbs'}", + "openInEditor": false + }, + { + "source": "../files/tst.pro", + "target": "%{ProjectFilePath}", + "condition": "%{JS: value('BuildSystem') == 'qmake'}", + "openInEditor": false, + "openAsProject": true + }, + { + "source": "../files/tst.qbs", + "target": "%{ProjectFilePath}", + "condition": "%{JS: value('BuildSystem') == 'qbs'}", + "openInEditor": false, + "openAsProject": true + }, + { + "source": "../files/tst.txt", + "target": "CMakeLists.txt", + "condition": "%{JS: value('BuildSystem') == 'cmake'}", + "openInEditor": false, + "openAsProject": true + }, + { + "source": "../files/tst_src_gt.cpp", + "target": "%{TestCaseFileGTestWithCppSuffix}", + "openInEditor": true + }, + { + "source": "../files/tst_main.cpp", + "target": "%{MainCppName}", + "openInEditor": true + }, + { + "source": "../../projects/git.ignore", + "target": ".gitignore", + "condition": "%{JS: ( %{IsTopLevelProject} && value('VersionControl') === 'G.Git' )}" + } + ] + } + ] +} diff --git a/share/qtcreator/templates/wizards/autotest/qttest/wizard.json b/share/qtcreator/templates/wizards/autotest/qttest/wizard.json new file mode 100644 index 00000000000..75de005b3ad --- /dev/null +++ b/share/qtcreator/templates/wizards/autotest/qttest/wizard.json @@ -0,0 +1,180 @@ +{ + "version": 1, + "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ], + "id": "A.QtTestAutoTest", + "category": "I.TestProject", + "trDescription": "Creates a new unit test project using Qt Test. Unit tests allow you to verify that the code is fit for use and that there are no regressions.", + "trDisplayName": "Qt Test Project", + "trDisplayCategory": "Test Project", + "icon": "../autotest.png", + "iconKind": "Themed", + "featuresRequired": [ "QtSupport.Wizards.FeatureDesktop" ], + "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", + + "options": + [ + { "key": "TestFrameWork", + "value": "QtTest" + }, + { "key": "ProjectFilePath", + "value": "%{JS: value('BuildSystem') == 'qmake' ? value('ProFileName') : (value('BuildSystem') == 'qbs' ? value('QbsFileName') : value('CMakeFileName')) }" + }, + { "key": "ProFileName", + "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" + }, + { + "key": "QbsFileName", + "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" + }, + { + "key": "CMakeFileName", + "value": "%{ProjectDirectory}/CMakeLists.txt" + }, + { "key": "IsTopLevelProject", + "value": "%{JS: !'%{Exists:ProjectExplorer.Profile.Ids}' }" + }, + { + "key": "GUARD", + "value": "%{JS: value('TestCaseFileWithHeaderSuffix').toUpperCase().replace('.', '_') }" + }, + { + "key": "TestCaseFileWithCppSuffix", + "value": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Util.preferredSuffix('text/x-c++src') }" + } + ], + + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project", + "data": + { + "trDescription": "This wizard creates a simple unit test project using Qt Test." + } + }, + { + "trDisplayName": "Project and Test Information", + "trShortTitle": "Details", + "typeId": "Fields", + "data": + [ + { + "name": "TestCaseName", + "trDisplayName": "Test case name:", + "mandatory": true, + "type": "LineEdit", + "data": { "validator": "^[a-zA-Z_0-9]+$" } + }, + { + "name": "RequireApplication", + "trDisplayName": "Requires QApplication", + "type": "CheckBox", + "data": { + "checked": false + } + }, + { + "name": "RequireGUI", + "trDisplayName": "GUI Application", + "type": "CheckBox", + "data": { + "checked": false + } + }, + { + "name": "GenerateInitAndCleanup", + "trDisplayName": "Generate initialization and cleanup code", + "type": "CheckBox", + "data": { + "checked": false + } + }, + { + "name": "BuildSystem", + "trDisplayName": "Build system:", + "type": "ComboBox", + "persistenceKey": "BuildSystemType", + "data": + { + "index": 1, + "items": + [ + { + "trKey": "qmake", + "value": "qmake", + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" + }, + { + "trKey": "CMake", + "value": "cmake", + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" + }, + { + "trKey": "Qbs", + "value": "qbs", + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" + } + ] + } + } + ] + }, + { + "trDisplayName": "Kit Selection", + "trShortTitle": "Kits", + "typeId": "Kits", + "enabled": "%{IsTopLevelProject}", + "data": { + "projectFilePath": "%{ProjectFilePath}", + "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "QtSupport.Wizards.FeatureDesktop" ] + } + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": + [ + { + "typeId": "File", + "data": + [ + { + "source": "../files/tst.pro", + "target": "%{ProjectFilePath}", + "condition": "%{JS: value('BuildSystem') == 'qmake'}", + "openInEditor": false, + "openAsProject": true + }, + { + "source": "../files/tst.qbs", + "target": "%{ProjectFilePath}", + "condition": "%{JS: value('BuildSystem') == 'qbs'}", + "openInEditor": false, + "openAsProject": true + }, + { + "source": "../files/tst.txt", + "target": "CMakeLists.txt", + "condition": "%{JS: value('BuildSystem') == 'cmake'}", + "openInEditor": false, + "openAsProject": true + }, + { + "source": "../files/tst_src.cpp", + "target": "%{TestCaseFileWithCppSuffix}", + "openInEditor": true + }, + { + "source": "../../projects/git.ignore", + "target": ".gitignore", + "condition": "%{JS: ( %{IsTopLevelProject} && value('VersionControl') === 'G.Git' )}" + } + ] + } + ] +} diff --git a/share/qtcreator/templates/wizards/autotest/quicktest/wizard.json b/share/qtcreator/templates/wizards/autotest/quicktest/wizard.json new file mode 100644 index 00000000000..e23fca42d98 --- /dev/null +++ b/share/qtcreator/templates/wizards/autotest/quicktest/wizard.json @@ -0,0 +1,192 @@ +{ + "version": 1, + "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ], + "id": "C.QuickAutoTest", + "category": "I.TestProject", + "trDescription": "Creates a new unit test project using Qt Quick Test. Unit tests allow you to verify that the code is fit for use and that there are no regressions.", + "trDisplayName": "Qt Quick Test Project", + "trDisplayCategory": "Test Project", + "icon": "../autotest.png", + "iconKind": "Themed", + "featuresRequired": [ "QtSupport.Wizards.FeatureDesktop" ], + "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", + + "options": + [ + { "key": "TestFrameWork", + "value": "QtQuickTest" + }, + { "key": "ProjectFilePath", + "value": "%{JS: value('BuildSystem') == 'qmake' ? value('ProFileName') : (value('BuildSystem') == 'qbs' ? value('QbsFileName') : value('CMakeFileName')) }" + }, + { "key": "ProFileName", + "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" + }, + { + "key": "QbsFileName", + "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" + }, + { + "key": "CMakeFileName", + "value": "%{ProjectDirectory}/CMakeLists.txt" + }, + { "key": "IsTopLevelProject", + "value": "%{JS: !'%{Exists:ProjectExplorer.Profile.Ids}' }" + }, + { "key": "MainCppName", + "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src') }" + }, + { + "key": "GUARD", + "value": "%{JS: value('TestCaseFileWithHeaderSuffix').toUpperCase().replace('.', '_') }" + }, + { + "key": "TestCaseFileWithQmlSuffix", + "value": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.qml' }" + } + ], + + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project", + "data": + { + "trDescription": "This wizard creates a simple unit test project using Qt Quick Test." + } + }, + { + "trDisplayName": "Project and Test Information", + "trShortTitle": "Details", + "typeId": "Fields", + "data": + [ + { + "name": "TestCaseName", + "trDisplayName": "Test case name:", + "mandatory": true, + "type": "LineEdit", + "data": { "validator": "^[a-zA-Z_0-9]+$" } + }, + { + "name": "UseSetupCode", + "trDisplayName": "Generate setup code", + "type": "CheckBox", + "data": { + "checked": false + } + }, + { + "name": "GenerateInitAndCleanup", + "trDisplayName": "Generate initialization and cleanup code", + "type": "CheckBox", + "data": { + "checked": false + } + }, + { + "name": "BuildSystem", + "trDisplayName": "Build system:", + "type": "ComboBox", + "persistenceKey": "BuildSystemType", + "data": + { + "index": 1, + "items": + [ + { + "trKey": "qmake", + "value": "qmake", + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" + }, + { + "trKey": "CMake", + "value": "cmake", + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" + }, + { + "trKey": "Qbs", + "value": "qbs", + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" + } + ] + } + } + ] + }, + { + "trDisplayName": "Kit Selection", + "trShortTitle": "Kits", + "typeId": "Kits", + "enabled": "%{IsTopLevelProject}", + "data": { + "projectFilePath": "%{ProjectFilePath}", + "requiredFeatures": [ "QtSupport.Wizards.FeatureQtQuick.2", "QtSupport.Wizards.FeatureDesktop" ] + } + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": + [ + { + "typeId": "File", + "data": + [ + { + "source": "../files/tst.pro", + "target": "%{ProjectFilePath}", + "condition": "%{JS: value('BuildSystem') == 'qmake'}", + "openInEditor": false, + "openAsProject": true + }, + { + "source": "../files/tst.qbs", + "target": "%{ProjectFilePath}", + "condition": "%{JS: value('BuildSystem') == 'qbs'}", + "openInEditor": false, + "openAsProject": true + }, + { + "source": "../files/tst.txt", + "target": "CMakeLists.txt", + "condition": "%{JS: value('BuildSystem') == 'cmake'}", + "openInEditor": false, + "openAsProject": true + }, + { + "source": "../files/tst_main.cpp", + "target": "%{MainCppName}", + "openInEditor": true + }, + { + "source": "../files/tst_qml.tmpl", + "target": "%{TestCaseFileWithQmlSuffix}", + "openInEditor": true + }, + { + "source": "../files/setup.cpp", + "target": "setup.cpp", + "condition": "%{JS: value('UseSetupCode')}", + "openInEditor": true + }, + { + "source": "../files/setup.h", + "target": "setup.h", + "condition": "%{JS: value('UseSetupCode')}", + "openInEditor": true + }, + { + "source": "../../projects/git.ignore", + "target": ".gitignore", + "condition": "%{JS: ( %{IsTopLevelProject} && value('VersionControl') === 'G.Git' )}" + } + ] + } + ] +} From 3e0f7773b83b096ed96a97c5f4f56f0c4a1c7b0f Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 27 Sep 2023 12:11:00 +0200 Subject: [PATCH 1301/1777] Autotest: Ensure m_checkStateCache isn't nullptr Fixes: QTCREATORBUG-29654 Change-Id: Ia1864756a232663c4109fdae61de1dcaf1fbcd14 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/autotest/testtreemodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/autotest/testtreemodel.cpp b/src/plugins/autotest/testtreemodel.cpp index fb06b40a07b..85b8156ff39 100644 --- a/src/plugins/autotest/testtreemodel.cpp +++ b/src/plugins/autotest/testtreemodel.cpp @@ -611,7 +611,8 @@ void TestTreeModel::insertItemInParent(TestTreeItem *item, TestTreeItem *root, b delete item; } else { // restore former check state if available - std::optional<Qt::CheckState> cached = m_checkStateCache->get(item); + std::optional<Qt::CheckState> cached = m_checkStateCache ? m_checkStateCache->get(item) + : std::optional<Qt::CheckState>{}; if (cached.has_value()) item->setData(0, cached.value(), Qt::CheckStateRole); else From cbc6809b28a0a0aaa3e8399601ce5275184443ed Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 27 Sep 2023 09:52:20 +0200 Subject: [PATCH 1302/1777] SSH: Fix Askpass on Windows 11 The standard openssh on windows 11 will not use the "askpass" unless SSH_ASKPASS_REQUIRE is set to "force". see: https://github.com/PowerShell/Win32-OpenSSH/issues/2115 Change-Id: I96a32e333a39e0cf5f5dab4c0f9c201b20daf533 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/devicesupport/sshparameters.cpp | 1 + src/plugins/vcsbase/vcsbaseplugin.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/devicesupport/sshparameters.cpp b/src/plugins/projectexplorer/devicesupport/sshparameters.cpp index 744e350eaef..22055cf7946 100644 --- a/src/plugins/projectexplorer/devicesupport/sshparameters.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshparameters.cpp @@ -77,6 +77,7 @@ bool SshParameters::setupSshEnvironment(Process *process) const bool hasDisplay = env.hasKey("DISPLAY") && (env.value("DISPLAY") != QString(":0")); if (SshSettings::askpassFilePath().exists()) { env.set("SSH_ASKPASS", SshSettings::askpassFilePath().toUserOutput()); + env.set("SSH_ASKPASS_REQUIRE", "force"); // OpenSSH only uses the askpass program if DISPLAY is set, regardless of the platform. if (!env.hasKey("DISPLAY")) diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index 6880e42e5a2..29a25e1627b 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -751,8 +751,10 @@ FilePath source(IDocument *document) void setProcessEnvironment(Environment *e) { const QString prompt = Internal::commonSettings().sshPasswordPrompt().path(); - if (!prompt.isEmpty()) + if (!prompt.isEmpty()) { e->set("SSH_ASKPASS", prompt); + e->set("SSH_ASKPASS_REQUIRE", "force"); + } } } // namespace VcsBase From 3d0ff7ef290c24b239fc92ef045c6293fb930dcf Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 26 Sep 2023 14:39:02 +0200 Subject: [PATCH 1303/1777] ProjectExplorer: Simplify detection of "built-in" clang This is also the only case that triggered the short code path in findCompilerCandidates(). Change-Id: Id8a88a275655526733e80c30250800db66ac6653 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index bbed2800a86..41b6cf2dc1f 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1344,9 +1344,8 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector_) c const FilePath compilerPath = Core::ICore::clangExecutable(CLANG_BINDIR); if (!compilerPath.isEmpty()) { - const FilePath clang = compilerPath.parentDir().pathAppended("clang").withExecutableSuffix(); tcs.append( - autoDetectToolchains(findCompilerCandidates(detector, clang.toString(), false), + autoDetectToolchains({compilerPath}, Constants::C_LANGUAGE_ID, Constants::CLANG_TOOLCHAIN_TYPEID, ToolchainDetector(known, detector.device, detector.searchPaths), @@ -1454,10 +1453,6 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, const QString &compilerName, bool detectVariants) { - const QFileInfo fi(compilerName); - if (detector.device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE && fi.isAbsolute() && fi.isFile()) - return {FilePath::fromString(compilerName)}; - QStringList nameFilters(compilerName); if (detectVariants) { nameFilters From 4e90ca1b59a3ed3e4abbac81d47d752de569cd60 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 27 Sep 2023 13:01:18 +0200 Subject: [PATCH 1304/1777] CMakeToolManager: Add static readFirstParagraphs() Reuse it in CMakeEditor and CMakeFileCompletionAssistProvider. Amends d04585b519f51b47cfc4200a048acc416c187b86 Change-Id: I8dbd59c815e017404ff215ca1ff68740d6653e91 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 5 +---- .../cmakefilecompletionassist.cpp | 16 +--------------- .../cmakeprojectmanager/cmaketoolmanager.cpp | 15 +++++++++++++++ .../cmakeprojectmanager/cmaketoolmanager.h | 2 ++ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 1f1e873be52..9b363faebe3 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -9,7 +9,6 @@ #include "cmakefilecompletionassist.h" #include "cmakeindenter.h" #include "cmakekitaspect.h" -#include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "3rdparty/cmake/cmListFileCache.h" @@ -347,8 +346,6 @@ const CMakeKeywords &CMakeHoverHandler::keywords() const return m_keywords; } -QString readFirstParagraphs(const QString &element, const FilePath &helpFile); - void CMakeHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos, ReportPriority report) @@ -377,7 +374,7 @@ void CMakeHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget } m_helpToolTip.clear(); if (!helpFile.isEmpty()) - m_helpToolTip = readFirstParagraphs(word, helpFile); + m_helpToolTip = CMakeToolManager::readFirstParagraphs(helpFile); setPriority(m_helpToolTip.isEmpty() ? Priority_Tooltip : Priority_None); } diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 62cc290aa8d..f8d7bb7a3b1 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -153,20 +153,6 @@ static QList<AssistProposalItemInterface *> generateList(const T &words, const Q }); } -static QString readFirstParagraphs(const FilePath &helpFile) -{ - static QMap<FilePath, QString> map; - if (map.contains(helpFile)) - return map.value(helpFile); - - auto content = helpFile.fileContents(1024).value_or(QByteArray()); - const QString firstParagraphs - = QString("```\n%1\n```").arg(QString::fromUtf8(content.left(content.lastIndexOf("\n")))); - - map[helpFile] = firstParagraphs; - return firstParagraphs; -} - static QList<AssistProposalItemInterface *> generateList(const QMap<QString, FilePath> &words, const QIcon &icon) { @@ -180,7 +166,7 @@ static QList<AssistProposalItemInterface *> generateList(const QMap<QString, Fil MarkDownAssitProposalItem *item = new MarkDownAssitProposalItem(); item->setText(it.key()); if (!it.value().isEmpty()) - item->setDetail(readFirstParagraphs(it.value())); + item->setDetail(CMakeToolManager::readFirstParagraphs(it.value())); item->setIcon(icon); list << item; }; diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index d8978e3bc61..da2bcff6e05 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -167,6 +167,21 @@ void CMakeToolManager::updateDocumentation() Core::HelpManager::registerDocumentation(docs); } +QString CMakeToolManager::readFirstParagraphs(const FilePath &helpFile) +{ + static QMap<FilePath, QString> map; + if (map.contains(helpFile)) + return map.value(helpFile); + + auto content = helpFile.fileContents(1024).value_or(QByteArray()); + const QString firstParagraphs + = QString("```\n%1\n```").arg(QString::fromUtf8(content.left(content.lastIndexOf("\n")))); + + map[helpFile] = firstParagraphs; + return firstParagraphs; +} + + QList<Id> CMakeToolManager::autoDetectCMakeForDevice(const FilePaths &searchPaths, const QString &detectionSource, QString *logMessage) diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h index 1b5ee74c8f1..85dbcb53b9e 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h @@ -40,6 +40,8 @@ public: static void updateDocumentation(); + static QString readFirstParagraphs(const Utils::FilePath &helpFile); + public slots: QList<Utils::Id> autoDetectCMakeForDevice(const Utils::FilePaths &searchPaths, const QString &detectionSource, From eb5cdb4293be8c4c878425ea9d45f5c105205bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20De=20Canni=C3=A8re?= <olivier.decanniere@qt.io> Date: Fri, 15 Sep 2023 11:10:13 +0200 Subject: [PATCH 1305/1777] Revert: qmljs: add check for comparisons not depending on values The warnings produced by these checks have always been somewhat broken. Ever since they were added people users complained about the M325 warnings because they were confusing or because of false positives. Fixes: QTCREATORBUG-29601 Change-Id: Ifac1ed0819a05251b3c4b583627cc45553e3d680 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/qmljs/qmljscheck.cpp | 47 ------------------- src/libs/qmljs/qmljsstaticanalysismessage.cpp | 2 - src/libs/qmljs/qmljsstaticanalysismessage.h | 1 - .../qml/codemodel/check/equality-checks.qml | 38 --------------- 4 files changed, 88 deletions(-) diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index 9aaf5c02a19..1d81080c7e7 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -1364,14 +1364,6 @@ static bool shouldAvoidNonStrictEqualityCheck(const Value *lhs, const Value *rhs return false; } -static bool equalIsAlwaysFalse(const Value *lhs, const Value *rhs) -{ - if ((lhs->asNullValue() || lhs->asUndefinedValue()) - && (rhs->asNumberValue() || rhs->asBooleanValue() || rhs->asStringValue())) - return true; - return false; -} - static bool isIntegerValue(const Value *value) { if (value->asNumberValue() || value->asIntValue()) @@ -1402,33 +1394,6 @@ static bool isBooleanValue(const Value *value) return false; } -static bool strictCompareConstant(const Value *lhs, const Value *rhs) -{ - // attached properties and working at runtime cases may be undefined at evaluation time - if (lhs->asUndefinedValue() || rhs->asUndefinedValue()) - return false; - if (lhs->asUnknownValue() || rhs->asUnknownValue()) - return false; - if (lhs->asFunctionValue() || rhs->asFunctionValue()) // function evaluation not implemented - return false; - if (isIntegerValue(lhs) && isIntegerValue(rhs)) - return false; - if (isStringValue(lhs) && isStringValue(rhs)) - return false; - if (isBooleanValue(lhs) && isBooleanValue(rhs)) - return false; - if (lhs->asBooleanValue() && !rhs->asBooleanValue()) - return true; - if (lhs->asNumberValue() && !rhs->asNumberValue()) - return true; - if (lhs->asStringValue() && !rhs->asStringValue()) - return true; - if (lhs->asObjectValue() && (!rhs->asObjectValue() || !rhs->asNullValue())) - return true; - return false; -} - - bool Check::visit(BinaryExpression *ast) { const QString source = _doc->source(); @@ -1454,18 +1419,6 @@ bool Check::visit(BinaryExpression *ast) || shouldAvoidNonStrictEqualityCheck(rhsValue, lhsValue)) { addMessage(MaybeWarnEqualityTypeCoercion, ast->operatorToken); } - if (equalIsAlwaysFalse(lhsValue, rhsValue) - || equalIsAlwaysFalse(rhsValue, lhsValue)) - addMessage(WarnLogicalValueDoesNotDependOnValues, ast->operatorToken); - } - if (ast->op == QSOperator::StrictEqual || ast->op == QSOperator::StrictNotEqual) { - Evaluate eval(&_scopeChain); - const Value *lhsValue = eval(ast->left); - const Value *rhsValue = eval(ast->right); - if (strictCompareConstant(lhsValue, rhsValue) - || strictCompareConstant(rhsValue, lhsValue)) { - addMessage(WarnLogicalValueDoesNotDependOnValues, ast->operatorToken); - } } // check odd + ++ combinations diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.cpp b/src/libs/qmljs/qmljsstaticanalysismessage.cpp index 98bff3a4b69..5b15e694281 100644 --- a/src/libs/qmljs/qmljsstaticanalysismessage.cpp +++ b/src/libs/qmljs/qmljsstaticanalysismessage.cpp @@ -229,8 +229,6 @@ StaticAnalysisMessages::StaticAnalysisMessages() Tr::tr("Hit maximum recursion limit when visiting AST.")); newMsg(ErrTypeIsInstantiatedRecursively, Error, Tr::tr("Type cannot be instantiated recursively (%1)."), 1); - newMsg(WarnLogicalValueDoesNotDependOnValues, Warning, - Tr::tr("Logical value does not depend on actual values.")); newMsg(ErrToManyComponentChildren, Error, Tr::tr("Components are only allowed to have a single child element.")); newMsg(WarnComponentRequiresChildren, Warning, diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.h b/src/libs/qmljs/qmljsstaticanalysismessage.h index 01b3b52d698..97dd95c5eb9 100644 --- a/src/libs/qmljs/qmljsstaticanalysismessage.h +++ b/src/libs/qmljs/qmljsstaticanalysismessage.h @@ -109,7 +109,6 @@ enum Type { ErrShorterStringValueExpected = 322, ErrInvalidArrayValueLength = 323, ErrHitMaximumRecursion = 324, - WarnLogicalValueDoesNotDependOnValues = 325, ErrToManyComponentChildren = 326, WarnComponentRequiresChildren = 327, WarnDuplicateImport = 400, diff --git a/tests/auto/qml/codemodel/check/equality-checks.qml b/tests/auto/qml/codemodel/check/equality-checks.qml index 9355142df40..e24e8afad99 100644 --- a/tests/auto/qml/codemodel/check/equality-checks.qml +++ b/tests/auto/qml/codemodel/check/equality-checks.qml @@ -12,42 +12,30 @@ Rectangle { if (s == s) {} if (s == n) {} // 126 15 16 - if (s == N) {} // 325 15 16 - if (s == u) {} // 325 15 16 if (s == b) {} // 126 15 16 if (s == o) {} // 126 15 16 if (s == k) {} // 126 15 16 if (n == s) {} // 126 15 16 if (n == n) {} - if (n == N) {} // 325 15 16 - if (n == u) {} // 325 15 16 if (n == b) {} // 126 15 16 if (n == o) {} // 126 15 16 if (n == k) {} // 126 15 16 - if (N == s) {} // 325 15 16 - if (N == n) {} // 325 15 16 if (N == N) {} if (N == u) {} - if (N == b) {} // 325 15 16 if (N == o) {} if (N == k) {} // 126 15 16 - if (u == s) {} // 325 15 16 - if (u == n) {} // 325 15 16 if (u == N) {} if (u == u) {} - if (u == b) {} // 325 15 16 if (u == o) {} if (u == k) {} // 126 15 16 if (b == s) {} // 126 15 16 if (b == n) {} // 126 15 16 - if (b == N) {} // 325 15 16 - if (b == u) {} // 325 15 16 if (b == b) {} if (b == o) {} // 126 15 16 if (b == k) {} // 126 15 16 @@ -69,35 +57,19 @@ Rectangle { if (k == k) {} // 126 15 16 if (s === s) {} - if (s === n) {} // 325 15 17 - if (s === N) {} // 325 15 17 if (s === u) {} - if (s === b) {} // 325 15 17 - if (s === o) {} // 325 15 17 if (s === k) {} if (s !== s) {} - if (s !== n) {} // 325 15 17 - if (s !== N) {} // 325 15 17 if (s !== u) {} - if (s !== b) {} // 325 15 17 - if (s !== o) {} // 325 15 17 if (s !== k) {} - if (n === s) {} // 325 15 17 if (n === n) {} - if (n === N) {} // 325 15 17 if (n === u) {} - if (n === b) {} // 325 15 17 - if (n === o) {} // 325 15 17 if (n === k) {} - if (N === s) {} // 325 15 17 - if (N === n) {} // 325 15 17 if (N === N) {} if (N === u) {} - if (N === b) {} // 325 15 17 - if (N === o) {} // 325 15 17 if (N === k) {} if (u === s) {} @@ -108,21 +80,11 @@ Rectangle { if (u === o) {} if (u === k) {} - if (b === s) {} // 325 15 17 - if (b === n) {} // 325 15 17 - - if (b === N) {} // 325 15 17 if (b === u) {} if (b === b) {} - if (b === o) {} // 325 15 17 if (b === k) {} - if (o === s) {} // 325 15 17 - if (o === n) {} // 325 15 17 - if (o === N) {} // 325 15 17 if (o === u) {} - if (o === b) {} // 325 15 17 - if (o === o) {} // 325 15 17 if (o === k) {} if (k === s) {} From 2c298097e9a117835f1e10dfd3cf5ea8459f2cf8 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 20 Sep 2023 14:28:21 +0200 Subject: [PATCH 1306/1777] Python: detect pythons async Change-Id: I74484a4f2c33c4fd7754f87bfbf3b9d711542741 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/python/pythonsettings.cpp | 84 ++++++++++++++++++++------- 1 file changed, 62 insertions(+), 22 deletions(-) diff --git a/src/plugins/python/pythonsettings.cpp b/src/plugins/python/pythonsettings.cpp index 020aad52259..4aa8ef6181f 100644 --- a/src/plugins/python/pythonsettings.cpp +++ b/src/plugins/python/pythonsettings.cpp @@ -21,13 +21,14 @@ #include <texteditor/texteditor.h> #include <utils/algorithm.h> -#include <utils/qtcassert.h> +#include <utils/async.h> #include <utils/detailswidget.h> #include <utils/environment.h> -#include <utils/listmodel.h> #include <utils/layoutbuilder.h> +#include <utils/listmodel.h> #include <utils/pathchooser.h> #include <utils/process.h> +#include <utils/qtcassert.h> #include <utils/treemodel.h> #include <utils/utilsicons.h> @@ -366,14 +367,6 @@ private: InterpreterOptionsWidget *m_widget = nullptr; }; -static bool alreadyRegistered(const QList<Interpreter> &pythons, const FilePath &pythonExecutable) -{ - return Utils::anyOf(pythons, [pythonExecutable](const Interpreter &interpreter) { - return interpreter.command.toFileInfo().canonicalFilePath() - == pythonExecutable.toFileInfo().canonicalFilePath(); - }); -} - static InterpreterOptionsPage &interpreterOptionsPage() { static InterpreterOptionsPage page; @@ -626,8 +619,9 @@ static void disableOutdatedPyls() } } -static void addPythonsFromRegistry(QList<Interpreter> &pythons) +static QList<Interpreter> pythonsFromRegistry() { + QList<Interpreter> pythons; QSettings pythonRegistry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore", QSettings::NativeFormat); for (const QString &versionGroup : pythonRegistry.childGroups()) { @@ -636,7 +630,7 @@ static void addPythonsFromRegistry(QList<Interpreter> &pythons) QVariant regVal = pythonRegistry.value("InstallPath/ExecutablePath"); if (regVal.isValid()) { const FilePath &executable = FilePath::fromUserInput(regVal.toString()); - if (executable.exists() && !alreadyRegistered(pythons, executable)) { + if (executable.exists()) { pythons << Interpreter{QUuid::createUuid().toString(), name, FilePath::fromUserInput(regVal.toString())}; @@ -645,7 +639,7 @@ static void addPythonsFromRegistry(QList<Interpreter> &pythons) regVal = pythonRegistry.value("InstallPath/WindowedExecutablePath"); if (regVal.isValid()) { const FilePath &executable = FilePath::fromUserInput(regVal.toString()); - if (executable.exists() && !alreadyRegistered(pythons, executable)) { + if (executable.exists()) { pythons << Interpreter{QUuid::createUuid().toString(), //: <python display name> (Windowed) Tr::tr("%1 (Windowed)").arg(name), @@ -656,28 +650,30 @@ static void addPythonsFromRegistry(QList<Interpreter> &pythons) if (regVal.isValid()) { const FilePath &path = FilePath::fromUserInput(regVal.toString()); const FilePath python = path.pathAppended("python").withExecutableSuffix(); - if (python.exists() && !alreadyRegistered(pythons, python)) + if (python.exists()) pythons << createInterpreter(python, "Python " + versionGroup); const FilePath pythonw = path.pathAppended("pythonw").withExecutableSuffix(); - if (pythonw.exists() && !alreadyRegistered(pythons, pythonw)) + if (pythonw.exists()) pythons << createInterpreter(pythonw, "Python " + versionGroup, "(Windowed)"); } pythonRegistry.endGroup(); } + return pythons; } -static void addPythonsFromPath(QList<Interpreter> &pythons) +static QList<Interpreter> pythonsFromPath() { + QList<Interpreter> pythons; if (HostOsInfo::isWindowsHost()) { for (const FilePath &executable : FilePath("python").searchAllInPath()) { // Windows creates empty redirector files that may interfere if (executable.toFileInfo().size() == 0) continue; - if (executable.exists() && !alreadyRegistered(pythons, executable)) + if (executable.exists()) pythons << createInterpreter(executable, "Python from Path"); } for (const FilePath &executable : FilePath("pythonw").searchAllInPath()) { - if (executable.exists() && !alreadyRegistered(pythons, executable)) + if (executable.exists()) pythons << createInterpreter(executable, "Python from Path", "(Windowed)"); } } else { @@ -690,11 +686,12 @@ static void addPythonsFromPath(QList<Interpreter> &pythons) const QDir dir(path.toString()); for (const QFileInfo &fi : dir.entryInfoList(filters)) { const FilePath executable = Utils::FilePath::fromFileInfo(fi); - if (executable.exists() && !alreadyRegistered(pythons, executable)) + if (executable.exists()) pythons << createInterpreter(executable, "Python from Path"); } } } + return pythons; } static QString idForPythonFromPath(const QList<Interpreter> &pythons) @@ -713,6 +710,51 @@ static QString idForPythonFromPath(const QList<Interpreter> &pythons) static PythonSettings *settingsInstance = nullptr; +static bool alreadyRegistered(const Interpreter &candidate) +{ + return Utils::anyOf(settingsInstance->interpreters(), + [candidate = candidate.command](const Interpreter &interpreter) { + return interpreter.command.isSameDevice(candidate) + && interpreter.command.resolveSymlinks() + == candidate.resolveSymlinks(); + }); +} + +static void scanPath() +{ + auto watcher = new QFutureWatcher<QList<Interpreter>>(); + QObject::connect(watcher, &QFutureWatcher<QList<Interpreter>>::finished, [watcher]() { + for (const Interpreter &interpreter : watcher->result()) { + if (!alreadyRegistered(interpreter)) + settingsInstance->addInterpreter(interpreter); + } + watcher->deleteLater(); + }); + watcher->setFuture(Utils::asyncRun(pythonsFromPath)); +} + +static void scanRegistry() +{ + auto watcher = new QFutureWatcher<QList<Interpreter>>(); + QObject::connect(watcher, &QFutureWatcher<QList<Interpreter>>::finished, [watcher]() { + for (const Interpreter &interpreter : watcher->result()) { + if (!alreadyRegistered(interpreter)) + settingsInstance->addInterpreter(interpreter); + } + watcher->deleteLater(); + scanPath(); + }); + watcher->setFuture(Utils::asyncRun(pythonsFromRegistry)); +} + +static void scanSystemForInterpreters() +{ + if (Utils::HostOsInfo::isWindowsHost()) + scanRegistry(); + else + scanPath(); +} + PythonSettings::PythonSettings() { QTC_ASSERT(!settingsInstance, return); @@ -723,9 +765,7 @@ PythonSettings::PythonSettings() initFromSettings(Core::ICore::settings()); - if (HostOsInfo::isWindowsHost()) - addPythonsFromRegistry(m_interpreters); - addPythonsFromPath(m_interpreters); + scanSystemForInterpreters(); if (m_defaultInterpreterId.isEmpty()) m_defaultInterpreterId = idForPythonFromPath(m_interpreters); From b986ce5175e3b9d7634f5b7b87149b479bf14b21 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 22 Sep 2023 11:18:03 +0200 Subject: [PATCH 1307/1777] CppEditor: Make all actions available in Tools menu and context menu The differences seemed rather arbitrary and were possibly unintended. Change-Id: I68151739875e6bb6bf5fedf8cc7ae54d4b70f42c Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cppeditor/cppeditorplugin.cpp | 111 ++++++++++++---------- 1 file changed, 59 insertions(+), 52 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 3f3c11bc73c..6d4adb3ca86 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -273,6 +273,18 @@ void CppEditorPlugin::extensionsInitialized() Constants::CPP_HEADER_MIMETYPE); } +static void insertIntoMenus(const QList<ActionContainer *> &menus, + const std::function<void(ActionContainer *)> &func) +{ + for (ActionContainer * const menu : menus) + func(menu); +} + +static void addActionToMenus(const QList<ActionContainer *> &menus, Command *cmd, Id id) +{ + insertIntoMenus(menus, [cmd, id](ActionContainer *menu) { menu->addAction(cmd, id); }); +} + void CppEditorPlugin::setupMenus() { ActionContainer * const cppToolsMenu = ActionManager::createMenu(Constants::M_TOOLS_CPP); @@ -281,7 +293,7 @@ void CppEditorPlugin::setupMenus() ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(cppToolsMenu); ActionContainer * const contextMenu = ActionManager::createMenu(Constants::M_CONTEXT); - for (ActionContainer * const menu : {cppToolsMenu, contextMenu}) { + insertIntoMenus({cppToolsMenu, contextMenu}, [](ActionContainer *menu) { menu->insertGroup(Core::Constants::G_DEFAULT_ONE, Constants::G_SYMBOL); menu->insertGroup(Core::Constants::G_DEFAULT_ONE, Constants::G_SELECTION); menu->insertGroup(Core::Constants::G_DEFAULT_ONE, Constants::G_FILE); @@ -289,7 +301,7 @@ void CppEditorPlugin::setupMenus() menu->addSeparator(Constants::G_SELECTION); menu->addSeparator(Constants::G_FILE); menu->addSeparator(Constants::G_GLOBAL); - } + }); addPerSymbolActions(); addActionsForSelections(); @@ -310,16 +322,20 @@ void CppEditorPlugin::setupMenus() void CppEditorPlugin::addPerSymbolActions() { - ActionContainer * const cppToolsMenu = ActionManager::actionContainer(Constants::M_TOOLS_CPP); - ActionContainer * const contextMenu = ActionManager::actionContainer(Constants::M_CONTEXT); + const QList<ActionContainer *> menus{ActionManager::actionContainer(Constants::M_TOOLS_CPP), + ActionManager::actionContainer(Constants::M_CONTEXT)}; ActionContainer * const touchBar = ActionManager::actionContainer(Core::Constants::TOUCH_BAR); const Context context(Constants::CPPEDITOR_ID); + const auto addSymbolActionToMenus = [&menus](Command *cmd) { + addActionToMenus(menus, cmd, Constants::G_SYMBOL); + }; Command *cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR); cmd->setTouchBarText(Tr::tr("Follow", "text on macOS touch bar")); - contextMenu->addAction(cmd, Constants::G_SYMBOL); - cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + addSymbolActionToMenus(cmd); touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); + addSymbolActionToMenus(ActionManager::command( + TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT)); QAction * const followSymbolToType = new QAction(Tr::tr("Follow Symbol Under Cursor to Type"), this); @@ -330,8 +346,7 @@ void CppEditorPlugin::addPerSymbolActions() if (CppEditorWidget *editorWidget = currentCppEditorWidget()) editorWidget->followSymbolToType(false); }); - contextMenu->addAction(cmd, Constants::G_SYMBOL); - cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + addSymbolActionToMenus(cmd); QAction * const followSymbolToTypeInNextSplit = new QAction(Tr::tr("Follow Symbol to Type in Next Split"), this); @@ -345,7 +360,7 @@ void CppEditorPlugin::addPerSymbolActions() if (CppEditorWidget *editorWidget = currentCppEditorWidget()) editorWidget->followSymbolToType(true); }); - cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + addSymbolActionToMenus(cmd); QAction * const switchDeclarationDefinition = new QAction(Tr::tr("Switch Between Function Declaration/Definition"), this); @@ -355,13 +370,9 @@ void CppEditorPlugin::addPerSymbolActions() cmd->setTouchBarText(Tr::tr("Decl/Def", "text on macOS touch bar")); connect(switchDeclarationDefinition, &QAction::triggered, this, &CppEditorPlugin::switchDeclarationDefinition); - contextMenu->addAction(cmd, Constants::G_SYMBOL); - cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + addSymbolActionToMenus(cmd); touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); - cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT); - cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); - QAction * const openDeclarationDefinitionInNextSplit = new QAction(Tr::tr("Open Function Declaration/Definition in Next Split"), this); cmd = ActionManager::registerAction(openDeclarationDefinitionInNextSplit, @@ -372,11 +383,9 @@ void CppEditorPlugin::addPerSymbolActions() : Tr::tr("Ctrl+E, Shift+F2"))); connect(openDeclarationDefinitionInNextSplit, &QAction::triggered, this, &CppEditorPlugin::openDeclarationDefinitionInNextSplit); - cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + addSymbolActionToMenus(cmd); - cmd = ActionManager::command(TextEditor::Constants::FIND_USAGES); - contextMenu->addAction(cmd, Constants::G_SYMBOL); - cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + addSymbolActionToMenus(ActionManager::command(TextEditor::Constants::FIND_USAGES)); d->m_findRefsCategorizedAction = new QAction(Tr::tr("Find References With Access Type"), this); cmd = ActionManager::registerAction(d->m_findRefsCategorizedAction, @@ -388,12 +397,9 @@ void CppEditorPlugin::addPerSymbolActions() codeModelSettings()->setCategorizeFindReferences(false); } }); - contextMenu->addAction(cmd, Constants::G_SYMBOL); - cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + addSymbolActionToMenus(cmd); - cmd = ActionManager::command(TextEditor::Constants::RENAME_SYMBOL); - contextMenu->addAction(cmd, Constants::G_SYMBOL); - cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + addSymbolActionToMenus(ActionManager::command(TextEditor::Constants::RENAME_SYMBOL)); d->m_openTypeHierarchyAction = new QAction(Tr::tr("Open Type Hierarchy"), this); cmd = ActionManager::registerAction(d->m_openTypeHierarchyAction, @@ -402,42 +408,43 @@ void CppEditorPlugin::addPerSymbolActions() ? Tr::tr("Meta+Shift+T") : Tr::tr("Ctrl+Shift+T"))); connect(d->m_openTypeHierarchyAction, &QAction::triggered, this, &CppEditorPlugin::openTypeHierarchy); - contextMenu->addAction(cmd, Constants::G_SYMBOL); - cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + addSymbolActionToMenus(cmd); - cmd = ActionManager::command(TextEditor::Constants::OPEN_CALL_HIERARCHY); - contextMenu->addAction(cmd, Constants::G_SYMBOL); - cppToolsMenu->addAction(cmd, Constants::G_SYMBOL); + addSymbolActionToMenus(ActionManager::command(TextEditor::Constants::OPEN_CALL_HIERARCHY)); // Refactoring sub-menu - Command *sep = contextMenu->addSeparator(Constants::G_SYMBOL); + Command *sep = menus.last()->addSeparator(Constants::G_SYMBOL); sep->action()->setObjectName(QLatin1String(Constants::M_REFACTORING_MENU_INSERTION_POINT)); } void CppEditorPlugin::addActionsForSelections() { - ActionContainer * const contextMenu = ActionManager::actionContainer(Constants::M_CONTEXT); - contextMenu->addAction(ActionManager::command(TextEditor::Constants::AUTO_INDENT_SELECTION), - Constants::G_SELECTION); - contextMenu->addAction(ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION), - Constants::G_SELECTION); + const QList<ActionContainer *> menus{ActionManager::actionContainer(Constants::M_TOOLS_CPP), + ActionManager::actionContainer(Constants::M_CONTEXT)}; + const auto addSelectionActionToMenus = [&menus](Command *cmd) { + addActionToMenus(menus, cmd, Constants::G_SELECTION); + }; + addSelectionActionToMenus(ActionManager::command(TextEditor::Constants::AUTO_INDENT_SELECTION)); + addSelectionActionToMenus(ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION)); } void CppEditorPlugin::addPerFileActions() { - ActionContainer * const cppToolsMenu = ActionManager::actionContainer(Constants::M_TOOLS_CPP); - ActionContainer * const contextMenu = ActionManager::actionContainer(Constants::M_CONTEXT); + const QList<ActionContainer *> menus{ActionManager::actionContainer(Constants::M_TOOLS_CPP), + ActionManager::actionContainer(Constants::M_CONTEXT)}; ActionContainer * const touchBar = ActionManager::actionContainer(Core::Constants::TOUCH_BAR); + const auto addFileActionToMenus = [&menus](Command *cmd) { + addActionToMenus(menus, cmd, Constants::G_FILE); + }; const Context context(Constants::CPPEDITOR_ID); QAction * const switchAction = new QAction(Tr::tr("Switch Header/Source"), this); Command *cmd = ActionManager::registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context, true); cmd->setTouchBarText(Tr::tr("Header/Source", "text on macOS touch bar")); - contextMenu->addAction(cmd, Constants::G_FILE); + addFileActionToMenus(cmd); touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); cmd->setDefaultKeySequence(QKeySequence(Qt::Key_F4)); - cppToolsMenu->addAction(cmd, Constants::G_FILE); connect(switchAction, &QAction::triggered, this, [] { CppModelManager::switchHeaderSource(false); }); @@ -448,7 +455,7 @@ void CppEditorPlugin::addPerFileActions() cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() ? Tr::tr("Meta+E, F4") : Tr::tr("Ctrl+E, F4"))); - cppToolsMenu->addAction(cmd, Constants::G_FILE); + addFileActionToMenus(cmd); connect(switchInNextSplitAction, &QAction::triggered, this, [] { CppModelManager::switchHeaderSource(true); }); @@ -459,13 +466,12 @@ void CppEditorPlugin::addPerFileActions() cmd->setDefaultKeySequence(QKeySequence()); connect(openPreprocessorDialog, &QAction::triggered, this, &CppEditorPlugin::showPreProcessorDialog); - cppToolsMenu->addAction(cmd, Constants::G_FILE); + addFileActionToMenus(cmd); QAction * const showPreprocessedAction = new QAction(Tr::tr("Show Preprocessed Source"), this); cmd = ActionManager::registerAction(showPreprocessedAction, Constants::SHOW_PREPROCESSED_FILE, context); - cppToolsMenu->addAction(cmd, Constants::G_FILE); - contextMenu->addAction(cmd, Constants::G_FILE); + addFileActionToMenus(cmd); connect(showPreprocessedAction, &QAction::triggered, this, [] { CppModelManager::showPreprocessedFile(false); }); @@ -473,21 +479,19 @@ void CppEditorPlugin::addPerFileActions() (Tr::tr("Show Preprocessed Source in Next Split"), this); cmd = ActionManager::registerAction(showPreprocessedInSplitAction, Constants::SHOW_PREPROCESSED_FILE_SPLIT, context); - cppToolsMenu->addAction(cmd, Constants::G_FILE); + addFileActionToMenus(cmd); connect(showPreprocessedInSplitAction, &QAction::triggered, this, [] { CppModelManager::showPreprocessedFile(true); }); QAction * const foldCommentsAction = new QAction(Tr::tr("Fold All Comment Blocks"), this); cmd = ActionManager::registerAction(foldCommentsAction, "CppTools.FoldCommentBlocks", context); - cppToolsMenu->addAction(cmd, Constants::G_FILE); - contextMenu->addAction(cmd, Constants::G_FILE); + addFileActionToMenus(cmd); connect(foldCommentsAction, &QAction::triggered, this, [] { CppModelManager::foldComments(); }); QAction * const unfoldCommentsAction = new QAction(Tr::tr("Unfold All Comment Blocks"), this); cmd = ActionManager::registerAction(unfoldCommentsAction, "CppTools.UnfoldCommentBlocks", context); - cppToolsMenu->addAction(cmd, Constants::G_FILE); - contextMenu->addAction(cmd, Constants::G_FILE); + addFileActionToMenus(cmd); connect(unfoldCommentsAction, &QAction::triggered, this, [] { CppModelManager::unfoldComments(); }); @@ -498,18 +502,21 @@ void CppEditorPlugin::addPerFileActions() ? Tr::tr("Meta+Shift+I") : Tr::tr("Ctrl+Shift+I"))); connect(d->m_openIncludeHierarchyAction, &QAction::triggered, this, &CppEditorPlugin::openIncludeHierarchy); - contextMenu->addAction(cmd, Constants::G_FILE); - cppToolsMenu->addAction(cmd, Constants::G_FILE); + addFileActionToMenus(cmd); } void CppEditorPlugin::addGlobalActions() { - ActionContainer * const cppToolsMenu = ActionManager::actionContainer(Constants::M_TOOLS_CPP); + const QList<ActionContainer *> menus{ActionManager::actionContainer(Constants::M_TOOLS_CPP), + ActionManager::actionContainer(Constants::M_CONTEXT)}; + const auto addGlobalActionToMenus = [&menus](Command *cmd) { + addActionToMenus(menus, cmd, Constants::G_GLOBAL); + }; QAction * const findUnusedFunctionsAction = new QAction(Tr::tr("Find Unused Functions"), this); Command *cmd = ActionManager::registerAction(findUnusedFunctionsAction, "CppTools.FindUnusedFunctions"); - cppToolsMenu->addAction(cmd, Constants::G_GLOBAL); + addGlobalActionToMenus(cmd); connect(findUnusedFunctionsAction, &QAction::triggered, this, [] { CppModelManager::findUnusedFunctions({}); }); @@ -535,7 +542,7 @@ void CppEditorPlugin::addGlobalActions() Constants::UPDATE_CODEMODEL); connect(d->m_reparseExternallyChangedFiles, &QAction::triggered, CppModelManager::instance(), &CppModelManager::updateModifiedSourceFiles); - cppToolsMenu->addAction(cmd, Constants::G_GLOBAL); + addGlobalActionToMenus(cmd); } void CppEditorPlugin::setupProjectPanels() From 91c0b60752e3a328ad530808699a85ed4d106adc Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 27 Sep 2023 13:41:16 +0200 Subject: [PATCH 1308/1777] ProjectExplorer: Fix build Change-Id: Iee85ecce556df3235775e150466d5fcde9fab252 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/editorconfiguration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index 5230caeba7e..26b247f7ae0 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -219,7 +219,7 @@ void EditorConfiguration::fromMap(const Store &map) Store submap; for (auto it = map.constBegin(), end = map.constEnd(); it != end; ++it) { if (it.key().view().startsWith(kPrefix.view())) - submap.insert(it.key().view().mid(kPrefix.view().size()).toByteArray(), it.value()); + submap.insert(it.key().toByteArray().mid(kPrefix.view().size()), it.value()); } d->m_defaultCodeStyle->fromMap(submap); d->m_typingSettings.fromMap(submap); From 4629b0f69ec4320b1ac6d8006b2f1957d5024683 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 25 Sep 2023 14:15:56 +0200 Subject: [PATCH 1309/1777] ScreenRecorder: Fix handling of capture type Amends 3ef401cd9a6e0b9e8dfdc7cdef952fc9e1804437. Change-Id: I09e6de09358843ee0109e906577c0f152b0ed22a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/screenrecorder/screenrecordersettings.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/screenrecorder/screenrecordersettings.cpp b/src/plugins/screenrecorder/screenrecordersettings.cpp index cd506057a0c..812b8d4d9dd 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.cpp +++ b/src/plugins/screenrecorder/screenrecordersettings.cpp @@ -98,8 +98,7 @@ ScreenRecorderSettings::ScreenRecorderSettings() break; } auto setCaptureMouseClicksVisible = [this] { - const QVariant value = captureType.itemValueForIndex(captureType.volatileValue()); - const bool visible = value.toInt() == CaptureType::AVFoundation; + const bool visible = captureType.volatileValue() == CaptureType::AVFoundation; captureMouseClicks.setVisible(visible); }; From 4924e5afec12c1b0aa100b79e5a5830e5c15a8af Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 27 Sep 2023 13:07:16 +0200 Subject: [PATCH 1310/1777] CMakeProjectManager: Fix warnings Change-Id: I190646684a1cadbcc1a5906642ed48e9dd84ed88 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../cmakeprojectmanager/cmakefilecompletionassist.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index f8d7bb7a3b1..adf223e9a9b 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -158,7 +158,7 @@ static QList<AssistProposalItemInterface *> generateList(const QMap<QString, Fil { struct MarkDownAssitProposalItem : public AssistProposalItem { - Qt::TextFormat detailFormat() const { return Qt::MarkdownText; } + Qt::TextFormat detailFormat() const override { return Qt::MarkdownText; } }; QList<AssistProposalItemInterface *> list; @@ -169,7 +169,7 @@ static QList<AssistProposalItemInterface *> generateList(const QMap<QString, Fil item->setDetail(CMakeToolManager::readFirstParagraphs(it.value())); item->setIcon(icon); list << item; - }; + } return list; } @@ -189,7 +189,7 @@ static int addFilePathItems(const AssistInterface *interface, const QString word = interface->textAt(startPos, interface->position() - startPos); FilePath baseDir = interface->filePath().absoluteFilePath().parentDir(); - const int lastSlashPos = word.lastIndexOf(QLatin1Char('/')); + const qsizetype lastSlashPos = word.lastIndexOf(QLatin1Char('/')); QString prefix = word; if (lastSlashPos != -1) { @@ -213,7 +213,7 @@ static int addFilePathItems(const AssistInterface *interface, return startPos; } -QPair<QStringList, QStringList> getLocalFunctionsAndVariables(const QByteArray &content) +static QPair<QStringList, QStringList> getLocalFunctionsAndVariables(const QByteArray &content) { cmListFile cmakeListFile; std::string errorString; From 342e066886ff4d472d9e07eb1f5702a548ac3e6e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 22 Sep 2023 16:15:27 +0200 Subject: [PATCH 1311/1777] Utils, all: Standardize on QtcSettings Change-Id: Id222016f15b1c3bfe6710fe5d0297666d4565ef1 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/app/main.cpp | 4 +- .../advanceddockingsystem/dockmanager.cpp | 5 +- src/libs/advanceddockingsystem/dockmanager.h | 5 +- src/libs/utils/basetreeview.cpp | 16 +-- src/libs/utils/basetreeview.h | 8 +- src/libs/utils/checkablemessagebox.cpp | 18 +-- src/libs/utils/checkablemessagebox.h | 11 +- src/libs/utils/fancymainwindow.cpp | 32 ++--- src/libs/utils/fancymainwindow.h | 15 +- src/libs/utils/qtcsettings.cpp | 5 + src/libs/utils/qtcsettings.h | 30 +++- src/libs/utils/terminalcommand.cpp | 9 +- src/libs/utils/terminalcommand.h | 7 +- src/libs/utils/unixutils.cpp | 6 +- src/libs/utils/unixutils.h | 9 +- src/plugins/android/androidconfigurations.cpp | 11 +- src/plugins/android/androidconfigurations.h | 12 +- src/plugins/autotest/testsettings.cpp | 20 +-- src/plugins/bookmarks/bookmarkmanager.cpp | 2 +- src/plugins/boot2qt/qdbplugin.cpp | 2 +- src/plugins/boot2qt/qdbutils.cpp | 15 +- src/plugins/boot2qt/qdbutils.h | 5 +- .../clangformat/clangformatindenter.cpp | 4 +- src/plugins/clangtools/clangtool.cpp | 2 +- src/plugins/clangtools/clangtoolssettings.cpp | 2 +- src/plugins/clangtools/clangtoolsutils.cpp | 2 +- src/plugins/clearcase/clearcasesettings.cpp | 65 ++++----- src/plugins/clearcase/clearcasesettings.h | 12 +- src/plugins/clearcase/clearcasesync.cpp | 4 +- src/plugins/clearcase/clearcasesync.h | 4 +- .../compilerexplorereditor.cpp | 16 +-- .../compilerexplorer/compilerexplorereditor.h | 4 +- .../compilerexplorersettings.h | 2 +- .../actionmanager/actionmanager.cpp | 6 +- src/plugins/coreplugin/coreplugin.cpp | 2 +- .../coreplugin/dialogs/settingsdialog.cpp | 14 +- src/plugins/coreplugin/documentmanager.cpp | 14 +- .../editormanager/editormanager.cpp | 8 +- .../editormanager/editormanager_p.h | 2 +- .../coreplugin/externaltoolmanager.cpp | 18 +-- src/plugins/coreplugin/find/findplugin.cpp | 18 +-- src/plugins/coreplugin/find/findtoolbar.cpp | 16 +-- .../coreplugin/find/findtoolwindow.cpp | 6 +- src/plugins/coreplugin/find/ifindfilter.h | 7 +- .../coreplugin/find/searchresultwindow.cpp | 6 +- src/plugins/coreplugin/generalsettings.cpp | 6 +- src/plugins/coreplugin/icore.cpp | 2 +- .../coreplugin/locator/filesystemfilter.cpp | 2 +- src/plugins/coreplugin/outputpanemanager.cpp | 24 ++-- .../progressmanager/progressmanager.cpp | 2 +- src/plugins/coreplugin/rightpane.cpp | 4 +- src/plugins/coreplugin/rightpane.h | 2 +- src/plugins/coreplugin/sidebar.cpp | 32 +++-- src/plugins/coreplugin/sidebar.h | 7 +- src/plugins/coreplugin/statusbarmanager.cpp | 16 ++- src/plugins/cpaster/pasteview.cpp | 19 +-- .../cppeditor/clangdiagnosticconfig.cpp | 7 +- src/plugins/cppeditor/clangdiagnosticconfig.h | 8 +- src/plugins/cppeditor/cppfilesettingspage.cpp | 7 +- src/plugins/cppeditor/cppfilesettingspage.h | 4 +- .../cppeditor/cppquickfixprojectsettings.cpp | 4 +- src/plugins/cppeditor/cppquickfixsettings.cpp | 8 +- src/plugins/cppeditor/cppquickfixsettings.h | 8 +- src/plugins/cppeditor/symbolsfindfilter.cpp | 17 ++- src/plugins/cppeditor/symbolsfindfilter.h | 4 +- .../debugger/analyzer/startremotedialog.cpp | 4 +- src/plugins/debugger/breakhandler.cpp | 2 +- src/plugins/debugger/cdb/cdbengine.cpp | 4 +- src/plugins/debugger/debuggerdialogs.cpp | 12 +- src/plugins/debugger/debuggerengine.cpp | 4 +- src/plugins/debugger/debuggermainwindow.cpp | 6 +- src/plugins/debugger/debuggerplugin.cpp | 2 +- .../debuggersourcepathmappingwidget.cpp | 12 +- src/plugins/debugger/watchhandler.cpp | 2 +- src/plugins/designer/formeditor.cpp | 23 ++- src/plugins/diffeditor/diffeditor.cpp | 6 +- src/plugins/diffeditor/diffeditor.h | 2 +- src/plugins/fakevim/fakevimplugin.cpp | 6 +- src/plugins/git/gerrit/gerritparameters.cpp | 10 +- src/plugins/git/gerrit/gerritparameters.h | 10 +- src/plugins/git/gerrit/gerritserver.cpp | 12 +- src/plugins/git/gitclient.cpp | 2 +- src/plugins/git/gitgrep.cpp | 4 +- src/plugins/git/gitgrep.h | 4 +- src/plugins/gitlab/gitlabparameters.cpp | 17 ++- src/plugins/gitlab/gitlabparameters.h | 7 +- src/plugins/help/helpplugin.cpp | 3 +- src/plugins/help/localhelpmanager.cpp | 2 +- src/plugins/imageviewer/multiexportdialog.cpp | 12 +- src/plugins/ios/iosconfigurations.cpp | 4 +- src/plugins/mcusupport/settingshandler.cpp | 4 +- .../modeleditor/modeleditor_plugin.cpp | 4 +- .../modeleditor/settingscontroller.cpp | 12 +- src/plugins/modeleditor/settingscontroller.h | 15 +- src/plugins/modeleditor/uicontroller.cpp | 33 ++--- src/plugins/modeleditor/uicontroller.h | 11 +- src/plugins/perfprofiler/perfprofilertool.cpp | 11 +- .../projectexplorer/allprojectsfind.cpp | 9 +- src/plugins/projectexplorer/allprojectsfind.h | 4 +- src/plugins/projectexplorer/appoutputpane.cpp | 4 +- .../projectexplorer/currentprojectfind.cpp | 11 +- .../projectexplorer/currentprojectfind.h | 4 +- .../devicesupport/sshsettings.cpp | 21 +-- .../devicesupport/sshsettings.h | 10 +- .../filesinallprojectsfind.cpp | 8 +- .../projectexplorer/filesinallprojectsfind.h | 4 +- src/plugins/projectexplorer/projectwindow.cpp | 4 +- src/plugins/python/pythonsettings.cpp | 4 +- src/plugins/python/pythonsettings.h | 4 +- src/plugins/qbsprojectmanager/qbssettings.cpp | 4 +- .../componentcore/modelnodeoperations.cpp | 6 +- .../propertyeditor/aligndistribute.cpp | 4 +- .../components/toolbar/toolbar.cpp | 7 +- .../studio/studiosettingspage.cpp | 11 +- .../utils/designersettings.cpp | 26 ++-- .../qmldesignerbase/utils/designersettings.h | 16 +-- .../qmljseditor/qmljseditingsettingspage.cpp | 13 +- .../qmljseditor/qmljseditingsettingspage.h | 10 +- src/plugins/qmlprofiler/qmlprofilertool.cpp | 10 +- .../tests/qmlprofilertool_test.cpp | 10 +- src/plugins/qmlprojectmanager/qmlproject.cpp | 10 +- .../qmlprojectmanager/qmlprojectplugin.cpp | 6 +- src/plugins/qtsupport/exampleslistmodel.cpp | 2 +- .../remotelinux/publickeydeploymentdialog.cpp | 1 + .../scxmleditor/common/colorsettings.cpp | 11 +- .../scxmleditor/common/colorthemes.cpp | 12 +- src/plugins/scxmleditor/common/mainwidget.cpp | 8 +- .../scxmleditor/outputpane/errorwidget.cpp | 4 +- .../serialterminal/serialterminalsettings.cpp | 15 +- .../serialterminal/serialterminalsettings.h | 12 +- .../findinfilessilversearcher.cpp | 13 +- .../findinfilessilversearcher.h | 4 +- src/plugins/squish/squishnavigationwidget.cpp | 6 +- .../studiowelcome/studiowelcomeplugin.cpp | 8 +- src/plugins/texteditor/basefilefind.cpp | 8 +- src/plugins/texteditor/basefilefind.h | 8 +- src/plugins/texteditor/completionsettings.cpp | 46 +++--- src/plugins/texteditor/completionsettings.h | 9 +- .../texteditor/completionsettingspage.cpp | 2 +- src/plugins/texteditor/displaysettings.cpp | 134 +++++++++--------- src/plugins/texteditor/displaysettings.h | 7 +- src/plugins/texteditor/findincurrentfile.cpp | 11 +- src/plugins/texteditor/findincurrentfile.h | 4 +- src/plugins/texteditor/findinfiles.cpp | 8 +- src/plugins/texteditor/findinfiles.h | 9 +- src/plugins/texteditor/findinopenfiles.cpp | 10 +- src/plugins/texteditor/findinopenfiles.h | 4 +- src/plugins/texteditor/fontsettings.cpp | 52 +++---- src/plugins/texteditor/fontsettings.h | 7 +- src/plugins/texteditor/fontsettingspage.cpp | 2 +- src/plugins/texteditor/highlighter.cpp | 17 +-- .../texteditor/highlightersettings.cpp | 18 +-- src/plugins/texteditor/highlightersettings.h | 11 +- .../texteditor/highlightersettingspage.cpp | 2 +- src/plugins/texteditor/marginsettings.cpp | 32 +++-- src/plugins/texteditor/marginsettings.h | 8 +- src/plugins/texteditor/markdowneditor.cpp | 7 +- src/plugins/texteditor/outlinefactory.cpp | 28 ++-- .../texteditor/snippets/snippetssettings.cpp | 24 ++-- .../texteditor/snippets/snippetssettings.h | 11 +- .../snippets/snippetssettingspage.cpp | 4 +- src/plugins/todo/settings.cpp | 20 +-- src/plugins/todo/settings.h | 11 +- src/plugins/todo/todooutputtreeview.cpp | 9 +- src/plugins/updateinfo/updateinfoplugin.cpp | 4 +- src/plugins/valgrind/callgrindtool.cpp | 2 +- src/plugins/valgrind/memchecktool.cpp | 19 +-- src/plugins/welcome/introductionwidget.cpp | 2 +- src/plugins/welcome/welcomeplugin.cpp | 2 +- src/shared/help/bookmarkmanager.cpp | 4 +- .../crashhandlerdialog.cpp | 11 +- .../qmldesigner/coretests/tst_testcore.cpp | 20 +-- 172 files changed, 955 insertions(+), 874 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 8a433d28d9e..49f0a10a6a8 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -283,7 +283,7 @@ static void setHighDpiEnvironmentVariable() if (Utils::HostOsInfo::isMacHost() || qEnvironmentVariableIsSet("QT_SCALE_FACTOR_ROUNDING_POLICY")) return; - std::unique_ptr<QSettings> settings(createUserSettings()); + std::unique_ptr<Utils::QtcSettings> settings(createUserSettings()); const bool defaultValue = Utils::HostOsInfo::isWindowsHost(); const bool enableHighDpiScaling = settings->value("Core/EnableHighDpiScaling", defaultValue).toBool(); @@ -413,7 +413,7 @@ QStringList lastSessionArgument() // and src\tools\qml2puppet\qml2puppet\qmlpuppet.cpp -> QString crashReportsPath() QString crashReportsPath() { - std::unique_ptr<QSettings> settings(createUserSettings()); + std::unique_ptr<Utils::QtcSettings> settings(createUserSettings()); QFileInfo(settings->fileName()).path() + "/crashpad_reports"; if (Utils::HostOsInfo::isMacHost()) return QFileInfo(createUserSettings()->fileName()).path() + "/crashpad_reports"; diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp index ce85293fef8..ee21f77ac29 100644 --- a/src/libs/advanceddockingsystem/dockmanager.cpp +++ b/src/libs/advanceddockingsystem/dockmanager.cpp @@ -21,6 +21,7 @@ #include <utils/algorithm.h> #include <utils/fileutils.h> #include <utils/qtcassert.h> +#include <utils/qtcsettings.h> #include <algorithm> #include <iostream> @@ -90,7 +91,7 @@ public: QList<Workspace> m_workspaces; Workspace m_workspace; - QSettings *m_settings = nullptr; + QtcSettings *m_settings = nullptr; bool m_modeChangeState = false; bool m_workspaceOrderDirty = false; @@ -439,7 +440,7 @@ int DockManager::startDragDistance() return static_cast<int>(QApplication::startDragDistance() * 1.5); } -void DockManager::setSettings(QSettings *settings) +void DockManager::setSettings(QtcSettings *settings) { d->m_settings = settings; } diff --git a/src/libs/advanceddockingsystem/dockmanager.h b/src/libs/advanceddockingsystem/dockmanager.h index 195f634023b..242b773fa77 100644 --- a/src/libs/advanceddockingsystem/dockmanager.h +++ b/src/libs/advanceddockingsystem/dockmanager.h @@ -23,9 +23,10 @@ QT_BEGIN_NAMESPACE class QMenu; -class QSettings; QT_END_NAMESPACE +namespace Utils { class QtcSettings; } + namespace ADS { namespace Constants { @@ -276,7 +277,7 @@ public: /** * Set the QtCreator settings. */ - void setSettings(QSettings *settings); + void setSettings(Utils::QtcSettings *settings); /** * Set the path to the workspace presets folder. diff --git a/src/libs/utils/basetreeview.cpp b/src/libs/utils/basetreeview.cpp index 60c239d5355..2b3339514c5 100644 --- a/src/libs/utils/basetreeview.cpp +++ b/src/libs/utils/basetreeview.cpp @@ -92,13 +92,13 @@ public: m_userHandled.clear(); if (m_settings && !m_settingsKey.isEmpty()) { m_settings->beginGroup(m_settingsKey); - QVariantList l = m_settings->value(QLatin1String(ColumnKey)).toList(); - QTC_ASSERT(l.size() % 2 == 0, qDebug() << m_settingsKey; l.append(0)); + QVariantList l = m_settings->value(ColumnKey).toList(); + QTC_ASSERT(l.size() % 2 == 0, qDebug() << m_settingsKey.view(); l.append(0)); for (int i = 0; i < l.size(); i += 2) { int column = l.at(i).toInt(); int width = l.at(i + 1).toInt(); - QTC_ASSERT(column >= 0 && column < 20, qDebug() << m_settingsKey << column; continue); - QTC_ASSERT(width > 0 && width < 10000, qDebug() << m_settingsKey << width; continue); + QTC_ASSERT(column >= 0 && column < 20, qDebug() << m_settingsKey.view() << column; continue); + QTC_ASSERT(width > 0 && width < 10000, qDebug() << m_settingsKey.view() << width; continue); m_userHandled[column] = width; } m_settings->endGroup(); @@ -306,9 +306,9 @@ public: public: BaseTreeView *q; QMap<int, int> m_userHandled; // column -> width, "not present" means "automatic" - QSettings *m_settings = nullptr; + QtcSettings *m_settings = nullptr; QTimer m_settingsTimer; - QString m_settingsKey; + Key m_settingsKey; bool m_expectUserChanges = false; ProgressIndicator *m_progressIndicator = nullptr; int m_spanColumn = -1; @@ -560,11 +560,11 @@ void BaseTreeView::refreshSpanColumn() d->rebalanceColumns(); } -void BaseTreeView::setSettings(QSettings *settings, const QByteArray &key) +void BaseTreeView::setSettings(QtcSettings *settings, const QByteArray &key) { QTC_ASSERT(!d->m_settings, qDebug() << "DUPLICATED setSettings" << key); d->m_settings = settings; - d->m_settingsKey = QString::fromLatin1(key); + d->m_settingsKey = key; d->readSettings(); } diff --git a/src/libs/utils/basetreeview.h b/src/libs/utils/basetreeview.h index 9c8096fc4fc..a127d1087a2 100644 --- a/src/libs/utils/basetreeview.h +++ b/src/libs/utils/basetreeview.h @@ -7,12 +7,10 @@ #include "itemviews.h" -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - namespace Utils { +class QtcSettings; + namespace Internal { class BaseTreeViewPrivate; } class QTCREATOR_UTILS_EXPORT BaseTreeView : public TreeView @@ -34,7 +32,7 @@ public: BaseTreeView(QWidget *parent = nullptr); ~BaseTreeView() override; - void setSettings(QSettings *settings, const QByteArray &key); + void setSettings(Utils::QtcSettings *settings, const QByteArray &key); void setModel(QAbstractItemModel *model) override; void mousePressEvent(QMouseEvent *ev) override; diff --git a/src/libs/utils/checkablemessagebox.cpp b/src/libs/utils/checkablemessagebox.cpp index d3ede7d4e7e..40f8b17076a 100644 --- a/src/libs/utils/checkablemessagebox.cpp +++ b/src/libs/utils/checkablemessagebox.cpp @@ -5,6 +5,7 @@ #include "hostosinfo.h" #include "qtcassert.h" +#include "qtcsettings.h" #include "utilstr.h" #include <QApplication> @@ -12,7 +13,6 @@ #include <QHBoxLayout> #include <QLabel> #include <QPushButton> -#include <QSettings> #include <QStyle> #include <QTextEdit> @@ -32,7 +32,7 @@ static const char kDoNotAskAgainKey[] = "DoNotAskAgain"; namespace Utils { -static QSettings *theSettings; +static QtcSettings *theSettings; static QMessageBox::StandardButton exec( QWidget *parent, @@ -86,17 +86,17 @@ static QMessageBox::StandardButton exec( return clickedBtn; } -CheckableDecider::CheckableDecider(const QString &settingsSubKey) +CheckableDecider::CheckableDecider(const Key &settingsSubKey) { QTC_ASSERT(theSettings, return); shouldAskAgain = [settingsSubKey] { - theSettings->beginGroup(QLatin1String(kDoNotAskAgainKey)); + theSettings->beginGroup(kDoNotAskAgainKey); bool shouldNotAsk = theSettings->value(settingsSubKey, false).toBool(); theSettings->endGroup(); return !shouldNotAsk; }; doNotAskAgain = [settingsSubKey] { - theSettings->beginGroup(QLatin1String(kDoNotAskAgainKey)); + theSettings->beginGroup(kDoNotAskAgainKey); theSettings->setValue(settingsSubKey, true); theSettings->endGroup(); }; @@ -160,8 +160,8 @@ QMessageBox::StandardButton CheckableMessageBox::information( void CheckableMessageBox::resetAllDoNotAskAgainQuestions() { QTC_ASSERT(theSettings, return); - theSettings->beginGroup(QLatin1String(kDoNotAskAgainKey)); - theSettings->remove(QString()); + theSettings->beginGroup(kDoNotAskAgainKey); + theSettings->remove(Key()); theSettings->endGroup(); } @@ -172,7 +172,7 @@ void CheckableMessageBox::resetAllDoNotAskAgainQuestions() bool CheckableMessageBox::hasSuppressedQuestions() { QTC_ASSERT(theSettings, return false); - theSettings->beginGroup(QLatin1String(kDoNotAskAgainKey)); + theSettings->beginGroup(kDoNotAskAgainKey); const bool hasSuppressed = !theSettings->childKeys().isEmpty() || !theSettings->childGroups().isEmpty(); theSettings->endGroup(); @@ -195,7 +195,7 @@ QString CheckableMessageBox::msgDoNotShowAgain() return Tr::tr("Do not &show again"); } -void CheckableMessageBox::initialize(QSettings *settings) +void CheckableMessageBox::initialize(QtcSettings *settings) { theSettings = settings; } diff --git a/src/libs/utils/checkablemessagebox.h b/src/libs/utils/checkablemessagebox.h index 297ff22b623..de5f73ca90a 100644 --- a/src/libs/utils/checkablemessagebox.h +++ b/src/libs/utils/checkablemessagebox.h @@ -8,17 +8,16 @@ #include <QMap> #include <QMessageBox> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - namespace Utils { +class Key; +class QtcSettings; + class QTCREATOR_UTILS_EXPORT CheckableDecider { public: CheckableDecider() = default; - CheckableDecider(const QString &settingsSubKey); + CheckableDecider(const Key &settingsSubKey); CheckableDecider(bool *doNotAskAgain); CheckableDecider(const std::function<bool()> &should, const std::function<void()> &doNot) : shouldAskAgain(should), doNotAskAgain(doNot) @@ -58,7 +57,7 @@ public: static QString msgDoNotAskAgain(); static QString msgDoNotShowAgain(); - static void initialize(QSettings *settings); + static void initialize(QtcSettings *settings); }; } // namespace Utils diff --git a/src/libs/utils/fancymainwindow.cpp b/src/libs/utils/fancymainwindow.cpp index 539df572b51..0c47be23679 100644 --- a/src/libs/utils/fancymainwindow.cpp +++ b/src/libs/utils/fancymainwindow.cpp @@ -5,6 +5,7 @@ #include "algorithm.h" #include "qtcassert.h" +#include "qtcsettings.h" #include "stringutils.h" #include "utilstr.h" @@ -434,49 +435,48 @@ void FancyMainWindow::handleVisibilityChanged(bool visible) d->m_handleDockVisibilityChanges = true; } -void FancyMainWindow::saveSettings(QSettings *settings) const +void FancyMainWindow::saveSettings(QtcSettings *settings) const { - const QHash<QString, QVariant> hash = saveSettings(); + const QHash<Key, QVariant> hash = saveSettings(); for (auto it = hash.cbegin(), end = hash.cend(); it != end; ++it) settings->setValue(it.key(), it.value()); } -void FancyMainWindow::restoreSettings(const QSettings *settings) +void FancyMainWindow::restoreSettings(const QtcSettings *settings) { - QHash<QString, QVariant> hash; - const QStringList childKeys = settings->childKeys(); - for (const QString &key : childKeys) + QHash<Key, QVariant> hash; + const KeyList childKeys = settings->childKeys(); + for (const Key &key : childKeys) hash.insert(key, settings->value(key)); restoreSettings(hash); } -QHash<QString, QVariant> FancyMainWindow::saveSettings() const +QHash<Key, QVariant> FancyMainWindow::saveSettings() const { - QHash<QString, QVariant> settings; - settings.insert(QLatin1String(StateKey), saveState(settingsVersion)); - settings.insert(QLatin1String(AutoHideTitleBarsKey), - d->m_autoHideTitleBars.isChecked()); + QHash<Key, QVariant> settings; + settings.insert(StateKey, saveState(settingsVersion)); + settings.insert(AutoHideTitleBarsKey, d->m_autoHideTitleBars.isChecked()); settings.insert(ShowCentralWidgetKey, d->m_showCentralWidget.isChecked()); for (QDockWidget *dockWidget : dockWidgets()) { - settings.insert(dockWidget->objectName(), + settings.insert(keyFromString(dockWidget->objectName()), dockWidget->property(dockWidgetActiveState)); } return settings; } -void FancyMainWindow::restoreSettings(const QHash<QString, QVariant> &settings) +void FancyMainWindow::restoreSettings(const QHash<Key, QVariant> &settings) { - QByteArray ba = settings.value(QLatin1String(StateKey), QByteArray()).toByteArray(); + QByteArray ba = settings.value(StateKey, QByteArray()).toByteArray(); if (!ba.isEmpty()) { if (!restoreState(ba, settingsVersion)) qWarning() << "Restoring the state of dock widgets failed."; } - bool on = settings.value(QLatin1String(AutoHideTitleBarsKey), true).toBool(); + bool on = settings.value(AutoHideTitleBarsKey, true).toBool(); d->m_autoHideTitleBars.setChecked(on); d->m_showCentralWidget.setChecked(settings.value(ShowCentralWidgetKey, true).toBool()); for (QDockWidget *widget : dockWidgets()) { widget->setProperty(dockWidgetActiveState, - settings.value(widget->objectName(), false)); + settings.value(keyFromString(widget->objectName()), false)); } } diff --git a/src/libs/utils/fancymainwindow.h b/src/libs/utils/fancymainwindow.h index 19618bb41c4..40066de95f6 100644 --- a/src/libs/utils/fancymainwindow.h +++ b/src/libs/utils/fancymainwindow.h @@ -5,15 +5,14 @@ #include "utils_global.h" -#include <QMainWindow> +#include "storekey.h" -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +#include <QMainWindow> namespace Utils { struct FancyMainWindowPrivate; +class QtcSettings; class QTCREATOR_UTILS_EXPORT FancyMainWindow : public QMainWindow { @@ -30,10 +29,10 @@ public: void setTrackingEnabled(bool enabled); - void saveSettings(QSettings *settings) const; - void restoreSettings(const QSettings *settings); - QHash<QString, QVariant> saveSettings() const; - void restoreSettings(const QHash<QString, QVariant> &settings); + void saveSettings(QtcSettings *settings) const; + void restoreSettings(const QtcSettings *settings); + QHash<Key, QVariant> saveSettings() const; + void restoreSettings(const QHash<Key, QVariant> &settings); // Additional context menu actions QAction *menuSeparator1() const; diff --git a/src/libs/utils/qtcsettings.cpp b/src/libs/utils/qtcsettings.cpp index 921e47946c7..e778ff4411b 100644 --- a/src/libs/utils/qtcsettings.cpp +++ b/src/libs/utils/qtcsettings.cpp @@ -40,4 +40,9 @@ void QtcSettings::setValue(const Key &key, const QVariant &value) QSettings::setValue(stringFromKey(key), mapEntryFromStoreEntry(value)); } +KeyList QtcSettings::childKeys() const +{ + return keysFromStrings(QSettings::childKeys()); +} + } // namespace Utils diff --git a/src/libs/utils/qtcsettings.h b/src/libs/utils/qtcsettings.h index 3d670cf6052..e44e8fcb7b8 100644 --- a/src/libs/utils/qtcsettings.h +++ b/src/libs/utils/qtcsettings.h @@ -5,16 +5,30 @@ #include "utils_global.h" -#include "storekey.h" +#include "store.h" #include <QSettings> namespace Utils { +// FIXME: In theory, this could be private or aggregated. class QTCREATOR_UTILS_EXPORT QtcSettings : public QSettings { public: using QSettings::QSettings; + using QSettings::group; + using QSettings::endGroup; + using QSettings::allKeys; + using QSettings::fileName; + using QSettings::setParent; + using QSettings::sync; + using QSettings::beginReadArray; + using QSettings::beginWriteArray; + using QSettings::endArray; + using QSettings::setArrayIndex; + using QSettings::childGroups; + using QSettings::status; + using QSettings::clear; void beginGroup(const Key &prefix) { QSettings::beginGroup(stringFromKey(prefix)); } @@ -24,6 +38,8 @@ public: void remove(const Key &key) { QSettings::remove(stringFromKey(key)); } bool contains(const Key &key) const { return QSettings::contains(stringFromKey(key)); } + KeyList childKeys() const; + template<typename T> void setValueWithDefault(const Key &key, const T &val, const T &defaultValue) { @@ -31,15 +47,15 @@ public: } template<typename T> - static void setValueWithDefault(QSettings *settings, + static void setValueWithDefault(QtcSettings *settings, const Key &key, const T &val, const T &defaultValue) { if (val == defaultValue) - settings->remove(stringFromKey(key)); + settings->QSettings::remove(stringFromKey(key)); else - settings->setValue(stringFromKey(key), QVariant::fromValue(val)); + settings->QSettings::setValue(stringFromKey(key), QVariant::fromValue(val)); } @@ -50,12 +66,12 @@ public: } template<typename T> - static void setValueWithDefault(QSettings *settings, const Key &key, const T &val) + static void setValueWithDefault(QtcSettings *settings, const Key &key, const T &val) { if (val == T()) - settings->remove(stringFromKey(key)); + settings->QSettings::remove(stringFromKey(key)); else - settings->setValue(stringFromKey(key), QVariant::fromValue(val)); + settings->QSettings::setValue(stringFromKey(key), QVariant::fromValue(val)); } }; diff --git a/src/libs/utils/terminalcommand.cpp b/src/libs/utils/terminalcommand.cpp index afb0c3fe546..0d6ab280ede 100644 --- a/src/libs/utils/terminalcommand.cpp +++ b/src/libs/utils/terminalcommand.cpp @@ -6,14 +6,11 @@ #include "algorithm.h" #include "environment.h" #include "hostosinfo.h" - -#include <QCoreApplication> -#include <QFileInfo> -#include <QSettings> +#include "qtcsettings.h" namespace Utils { -static QSettings *s_settings = nullptr; +static QtcSettings *s_settings = nullptr; TerminalCommand::TerminalCommand(const FilePath &command, const QString &openArgs, const QString &executeArgs, bool needsQuotes) @@ -40,7 +37,7 @@ bool TerminalCommand::operator<(const TerminalCommand &other) const return command < other.command; } -void TerminalCommand::setSettings(QSettings *settings) +void TerminalCommand::setSettings(QtcSettings *settings) { s_settings = settings; } diff --git a/src/libs/utils/terminalcommand.h b/src/libs/utils/terminalcommand.h index 92a136d9655..5ef1eba1cf4 100644 --- a/src/libs/utils/terminalcommand.h +++ b/src/libs/utils/terminalcommand.h @@ -10,13 +10,10 @@ #include <QList> #include <QMetaType> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - namespace Utils { class Environment; +class QtcSettings; class QTCREATOR_UTILS_EXPORT TerminalCommand { @@ -33,7 +30,7 @@ public: QString executeArgs; bool needsQuotes = false; - static void setSettings(QSettings *settings); + static void setSettings(QtcSettings *settings); static TerminalCommand defaultTerminalEmulator(); static QList<TerminalCommand> availableTerminalEmulators(); static TerminalCommand terminalEmulator(); diff --git a/src/libs/utils/unixutils.cpp b/src/libs/utils/unixutils.cpp index c275d2c303e..a47c0da6735 100644 --- a/src/libs/utils/unixutils.cpp +++ b/src/libs/utils/unixutils.cpp @@ -17,15 +17,15 @@ QString UnixUtils::defaultFileBrowser() return QLatin1String("xdg-open %d"); } -QString UnixUtils::fileBrowser(const QSettings *settings) +QString UnixUtils::fileBrowser(const QtcSettings *settings) { const QString dflt = defaultFileBrowser(); if (!settings) return dflt; - return settings->value(QLatin1String("General/FileBrowser"), dflt).toString(); + return settings->value("General/FileBrowser", dflt).toString(); } -void UnixUtils::setFileBrowser(QSettings *settings, const QString &term) +void UnixUtils::setFileBrowser(QtcSettings *settings, const QString &term) { QtcSettings::setValueWithDefault(settings, Key("General/FileBrowser"), term, defaultFileBrowser()); } diff --git a/src/libs/utils/unixutils.h b/src/libs/utils/unixutils.h index f82517e9005..2080efa95d1 100644 --- a/src/libs/utils/unixutils.h +++ b/src/libs/utils/unixutils.h @@ -6,21 +6,22 @@ #include "utils_global.h" QT_BEGIN_NAMESPACE -class QSettings; class QString; QT_END_NAMESPACE namespace Utils { +class QtcSettings; + class QTCREATOR_UTILS_EXPORT UnixUtils { public: static QString defaultFileBrowser(); - static QString fileBrowser(const QSettings *settings); - static void setFileBrowser(QSettings *settings, const QString &term); + static QString fileBrowser(const QtcSettings *settings); + static void setFileBrowser(QtcSettings *settings, const QString &term); static QString fileBrowserHelpText(); static QString substituteFileBrowserParameters(const QString &command, const QString &file); }; -} +} // Utils diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index c6be6b0aab3..65dae8e7fb5 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -36,6 +36,7 @@ #include <utils/persistentsettings.h> #include <utils/process.h> #include <utils/qtcassert.h> +#include <utils/qtcsettings.h> #include <utils/stringutils.h> #include <QApplication> @@ -112,7 +113,7 @@ const QLatin1String X86_64ToolsPrefix("x86_64-linux-android"); const QLatin1String Unknown("unknown"); const QLatin1String keytoolName("keytool"); -const QLatin1String changeTimeStamp("ChangeTimeStamp"); +const Key changeTimeStamp("ChangeTimeStamp"); const char sdkToolsVersionKey[] = "Pkg.Revision"; const char ndkRevisionKey[] = "Pkg.Revision"; @@ -180,7 +181,7 @@ QLatin1String AndroidConfig::displayName(const Abi &abi) } } -void AndroidConfig::load(const QSettings &settings) +void AndroidConfig::load(const QtcSettings &settings) { // user settings QVariant emulatorArgs = settings.value(EmulatorArgsKey, QString("-netdelay none -netspeed full")); @@ -220,7 +221,7 @@ void AndroidConfig::load(const QSettings &settings) parseDependenciesJson(); } -void AndroidConfig::save(QSettings &settings) const +void AndroidConfig::save(QtcSettings &settings) const { QFileInfo fileInfo(sdkSettingsFileName()); if (fileInfo.exists()) @@ -1442,7 +1443,7 @@ AndroidConfigurations *AndroidConfigurations::instance() void AndroidConfigurations::save() { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(SettingsGroup); m_config.save(*settings); settings->endGroup(); @@ -1541,7 +1542,7 @@ FilePath AndroidConfig::getJdkPath() void AndroidConfigurations::load() { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(SettingsGroup); m_config.load(*settings); settings->endGroup(); diff --git a/src/plugins/android/androidconfigurations.h b/src/plugins/android/androidconfigurations.h index e0d74c05222..c92deec331c 100644 --- a/src/plugins/android/androidconfigurations.h +++ b/src/plugins/android/androidconfigurations.h @@ -11,18 +11,14 @@ #include <projectexplorer/toolchain.h> #include <qtsupport/qtversionmanager.h> +#include <utils/filepath.h> + #include <QStringList> #include <QVector> #include <QHash> #include <QMap> #include <QVersionNumber> -#include <utils/filepath.h> - -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - namespace ProjectExplorer { class Abi; } namespace Android { @@ -58,8 +54,8 @@ public: class AndroidConfig { public: - void load(const QSettings &settings); - void save(QSettings &settings) const; + void load(const Utils::QtcSettings &settings); + void save(Utils::QtcSettings &settings) const; static QStringList apiLevelNamesFor(const SdkPlatformList &platforms); static QString apiLevelNameFor(const SdkPlatform *platform); diff --git a/src/plugins/autotest/testsettings.cpp b/src/plugins/autotest/testsettings.cpp index c2293a0b4ff..1d5230d711d 100644 --- a/src/plugins/autotest/testsettings.cpp +++ b/src/plugins/autotest/testsettings.cpp @@ -7,7 +7,9 @@ #include "autotesttr.h" #include "testframeworkmanager.h" -#include <QSettings> +#include <utils/qtcsettings.h> + +using namespace Utils; namespace Autotest::Internal { @@ -109,18 +111,18 @@ void TestSettings::toSettings() const { AspectContainer::writeSettings(); - QSettings *s = Utils::BaseAspect::qtcSettings(); + QtcSettings *s = BaseAspect::qtcSettings(); s->beginGroup(Constants::SETTINGSGROUP); // store frameworks and their current active and grouping state for (auto it = frameworks.cbegin(); it != frameworks.cend(); ++it) { const Utils::Id &id = it.key(); - s->setValue(id.toString(), it.value()); - s->setValue(id.toString() + groupSuffix, frameworksGrouping.value(id)); + s->setValue(id.toKey(), it.value()); + s->setValue(id.toKey() + groupSuffix, frameworksGrouping.value(id)); } // ..and the testtools as well for (auto it = tools.cbegin(); it != tools.cend(); ++it) - s->setValue(it.key().toString(), it.value()); + s->setValue(it.key().toKey(), it.value()); s->endGroup(); } @@ -128,7 +130,7 @@ void TestSettings::fromSettings() { AspectContainer::readSettings(); - QSettings *s = Utils::BaseAspect::qtcSettings(); + QtcSettings *s = BaseAspect::qtcSettings(); s->beginGroup(Constants::SETTINGSGROUP); // try to get settings for registered frameworks @@ -137,8 +139,8 @@ void TestSettings::fromSettings() frameworksGrouping.clear(); for (const ITestFramework *framework : registered) { // get their active state - const Utils::Id id = framework->id(); - const QString key = id.toString(); + const Id id = framework->id(); + const Key key = id.toKey(); frameworks.insert(id, s->value(key, framework->active()).toBool()); // and whether grouping is enabled frameworksGrouping.insert(id, s->value(key + groupSuffix, framework->grouping()).toBool()); @@ -148,7 +150,7 @@ void TestSettings::fromSettings() tools.clear(); for (const ITestTool *testTool : registeredTools) { const Utils::Id id = testTool->id(); - tools.insert(id, s->value(id.toString(), testTool->active()).toBool()); + tools.insert(id, s->value(id.toKey(), testTool->active()).toBool()); } s->endGroup(); } diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index 18a4206afd3..427d6b9738b 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -293,7 +293,7 @@ void BookmarkView::removeAll() Tr::tr("Remove All Bookmarks"), Tr::tr("Are you sure you want to remove all bookmarks from " "all files in the current session?"), - QString("RemoveAllBookmarks")) + Key("RemoveAllBookmarks")) != QMessageBox::Yes) return; diff --git a/src/plugins/boot2qt/qdbplugin.cpp b/src/plugins/boot2qt/qdbplugin.cpp index 6557be0db66..64be4075ee8 100644 --- a/src/plugins/boot2qt/qdbplugin.cpp +++ b/src/plugins/boot2qt/qdbplugin.cpp @@ -61,7 +61,7 @@ static void startFlashingWizard() static bool isFlashActionDisabled() { - QSettings * const settings = Core::ICore::settings(); + QtcSettings * const settings = Core::ICore::settings(); settings->beginGroup(settingsGroupKey()); bool disabled = settings->value("flashActionDisabled", false).toBool(); settings->endGroup(); diff --git a/src/plugins/boot2qt/qdbutils.cpp b/src/plugins/boot2qt/qdbutils.cpp index fcc6e38da29..922f0838f7a 100644 --- a/src/plugins/boot2qt/qdbutils.cpp +++ b/src/plugins/boot2qt/qdbutils.cpp @@ -34,7 +34,7 @@ FilePath findTool(QdbTool tool) QString filePath = Utils::qtcEnvironmentVariable(overridingEnvironmentVariable(tool)); if (filePath.isEmpty()) { - QSettings * const settings = Core::ICore::settings(); + QtcSettings * const settings = Core::ICore::settings(); settings->beginGroup(settingsGroupKey()); filePath = settings->value(settingsKey(tool)).toString(); settings->endGroup(); @@ -72,20 +72,21 @@ void showMessage(const QString &message, bool important) Core::MessageManager::writeSilently(fullMessage); } -QString settingsGroupKey() +Key settingsGroupKey() { - return QLatin1String("Boot2Qt"); + return "Boot2Qt"; } -QString settingsKey(QdbTool tool) +Key settingsKey(QdbTool tool) { switch (tool) { case QdbTool::FlashingWizard: - return QLatin1String("flashingWizardFilePath"); + return "flashingWizardFilePath"; case QdbTool::Qdb: - return QLatin1String("qdbFilePath"); + return "qdbFilePath"; } - QTC_ASSERT(false, return QString()); + QTC_CHECK(false); + return {}; } } // Qdb::Internal diff --git a/src/plugins/boot2qt/qdbutils.h b/src/plugins/boot2qt/qdbutils.h index 1a04007218a..61b8ab71434 100644 --- a/src/plugins/boot2qt/qdbutils.h +++ b/src/plugins/boot2qt/qdbutils.h @@ -4,6 +4,7 @@ #pragma once #include <utils/filepath.h> +#include <utils/storekey.h> namespace Qdb::Internal { @@ -15,7 +16,7 @@ enum class QdbTool { Utils::FilePath findTool(QdbTool tool); QString overridingEnvironmentVariable(QdbTool tool); void showMessage(const QString &message, bool important = false); -QString settingsGroupKey(); -QString settingsKey(QdbTool tool); +Utils::Key settingsGroupKey(); +Utils::Key settingsKey(QdbTool tool); } // Qdb::Internal diff --git a/src/plugins/clangformat/clangformatindenter.cpp b/src/plugins/clangformat/clangformatindenter.cpp index 821a434f11c..00199827209 100644 --- a/src/plugins/clangformat/clangformatindenter.cpp +++ b/src/plugins/clangformat/clangformatindenter.cpp @@ -13,6 +13,7 @@ #include <extensionsystem/pluginspec.h> #include <utils/genericconstants.h> +#include <utils/qtcsettings.h> #include <projectexplorer/project.h> #include <projectexplorer/projectmanager.h> @@ -23,6 +24,7 @@ using namespace clang; using namespace format; using namespace TextEditor; +using namespace Utils; namespace ClangFormat { @@ -42,7 +44,7 @@ static bool isBeautifierOnSaveActivated() if (!isBeautifierPluginActivated()) return false; - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); bool activated = false; s->beginGroup(Utils::Constants::BEAUTIFIER_SETTINGS_GROUP); s->beginGroup(Utils::Constants::BEAUTIFIER_GENERAL_GROUP); diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index 652b24b90fa..2e3a5c3ae5d 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -633,7 +633,7 @@ static bool continueDespiteReleaseBuild(const QString &toolName) return CheckableMessageBox::question(ICore::dialogParent(), title, message, - QString("ClangToolsCorrectModeWarning")) + Key("ClangToolsCorrectModeWarning")) == QMessageBox::Yes; } diff --git a/src/plugins/clangtools/clangtoolssettings.cpp b/src/plugins/clangtools/clangtoolssettings.cpp index 8d8f176389e..6699be10bdc 100644 --- a/src/plugins/clangtools/clangtoolssettings.cpp +++ b/src/plugins/clangtools/clangtoolssettings.cpp @@ -104,7 +104,7 @@ ClangToolsSettings::ClangToolsSettings() readSettings(); } -static Store convertToMapFromVersionBefore410(QSettings *s) +static Store convertToMapFromVersionBefore410(QtcSettings *s) { const char oldParallelJobsKey[] = "simultaneousProcesses"; const char oldBuildBeforeAnalysisKey[] = "buildBeforeAnalysis"; diff --git a/src/plugins/clangtools/clangtoolsutils.cpp b/src/plugins/clangtools/clangtoolsutils.cpp index effab6f3252..5b4eb702c91 100644 --- a/src/plugins/clangtools/clangtoolsutils.cpp +++ b/src/plugins/clangtools/clangtoolsutils.cpp @@ -141,7 +141,7 @@ void showHintAboutBuildBeforeAnalysis() Utils::CheckableMessageBox::information(Core::ICore::dialogParent(), Tr::tr("Info About Build the Project Before Analysis"), hintAboutBuildBeforeAnalysis(), - QString("ClangToolsDisablingBuildBeforeAnalysisHint")); + Key("ClangToolsDisablingBuildBeforeAnalysisHint")); } FilePath fullPath(const FilePath &executable) diff --git a/src/plugins/clearcase/clearcasesettings.cpp b/src/plugins/clearcase/clearcasesettings.cpp index 8ad40642b8e..eeff96b2a30 100644 --- a/src/plugins/clearcase/clearcasesettings.cpp +++ b/src/plugins/clearcase/clearcasesettings.cpp @@ -4,8 +4,9 @@ #include "clearcasesettings.h" #include <utils/environment.h> +#include <utils/qtcsettings.h> -#include <QSettings> +using namespace Utils; namespace ClearCase::Internal { @@ -40,59 +41,59 @@ ClearCaseSettings::ClearCaseSettings() : timeOutS(defaultTimeOutS) { } -void ClearCaseSettings::fromSettings(QSettings *settings) +void ClearCaseSettings::fromSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String(groupC)); - ccCommand = settings->value(QLatin1String(commandKeyC), defaultCommand()).toString(); + settings->beginGroup(groupC); + ccCommand = settings->value(commandKeyC, defaultCommand()).toString(); ccBinaryPath = Utils::Environment::systemEnvironment().searchInPath(ccCommand); - timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt(); - autoCheckOut = settings->value(QLatin1String(autoCheckOutKeyC), false).toBool(); - noComment = settings->value(QLatin1String(noCommentKeyC), false).toBool(); - keepFileUndoCheckout = settings->value(QLatin1String(keepFileUndoCheckoutKeyC), true).toBool(); - const QString sDiffType = settings->value(QLatin1String(diffTypeKeyC), + timeOutS = settings->value(timeOutKeyC, defaultTimeOutS).toInt(); + autoCheckOut = settings->value(autoCheckOutKeyC, false).toBool(); + noComment = settings->value(noCommentKeyC, false).toBool(); + keepFileUndoCheckout = settings->value(keepFileUndoCheckoutKeyC, true).toBool(); + const QString sDiffType = settings->value(diffTypeKeyC, QLatin1String("Graphical")).toString(); switch (sDiffType[0].toUpper().toLatin1()) { case 'G': diffType = GraphicalDiff; break; case 'E': diffType = ExternalDiff; break; } - diffArgs = settings->value(QLatin1String(diffArgsKeyC), QLatin1String(defaultDiffArgs)).toString(); - autoAssignActivityName = settings->value(QLatin1String(autoAssignActivityKeyC), true).toBool(); - historyCount = settings->value(QLatin1String(historyCountKeyC), int(defaultHistoryCount)).toInt(); - disableIndexer = settings->value(QLatin1String(disableIndexerKeyC), false).toBool(); - indexOnlyVOBs = settings->value(QLatin1String(indexOnlyVOBsC), QString()).toString(); + diffArgs = settings->value(diffArgsKeyC, QLatin1String(defaultDiffArgs)).toString(); + autoAssignActivityName = settings->value(autoAssignActivityKeyC, true).toBool(); + historyCount = settings->value(historyCountKeyC, int(defaultHistoryCount)).toInt(); + disableIndexer = settings->value(disableIndexerKeyC, false).toBool(); + indexOnlyVOBs = settings->value(indexOnlyVOBsC, QString()).toString(); extDiffAvailable = !Utils::Environment::systemEnvironment().searchInPath(QLatin1String("diff")).isEmpty(); - settings->beginGroup(QLatin1String(totalFilesKeyC)); - const QStringList views = settings->childKeys(); - for (const QString &view : views) + settings->beginGroup(totalFilesKeyC); + const KeyList views = settings->childKeys(); + for (const Key &view : views) totalFiles[view] = settings->value(view).toInt(); settings->endGroup(); settings->endGroup(); } -void ClearCaseSettings::toSettings(QSettings *settings) const +void ClearCaseSettings::toSettings(QtcSettings *settings) const { - using FilesConstIt = QHash<QString, int>::ConstIterator; + using FilesConstIt = QHash<Key, int>::ConstIterator; - settings->beginGroup(QLatin1String(groupC)); - settings->setValue(QLatin1String(commandKeyC), ccCommand); - settings->setValue(QLatin1String(autoCheckOutKeyC), autoCheckOut); - settings->setValue(QLatin1String(noCommentKeyC), noComment); - settings->setValue(QLatin1String(keepFileUndoCheckoutKeyC), keepFileUndoCheckout); - settings->setValue(QLatin1String(timeOutKeyC), timeOutS); + settings->beginGroup(groupC); + settings->setValue(commandKeyC, ccCommand); + settings->setValue(autoCheckOutKeyC, autoCheckOut); + settings->setValue(noCommentKeyC, noComment); + settings->setValue(keepFileUndoCheckoutKeyC, keepFileUndoCheckout); + settings->setValue(timeOutKeyC, timeOutS); QString sDiffType; switch (diffType) { case ExternalDiff: sDiffType = QLatin1String("External"); break; default: sDiffType = QLatin1String("Graphical"); break; } - settings->setValue(QLatin1String(diffArgsKeyC), diffArgs); - settings->setValue(QLatin1String(diffTypeKeyC), sDiffType); - settings->setValue(QLatin1String(autoAssignActivityKeyC), autoAssignActivityName); - settings->setValue(QLatin1String(historyCountKeyC), historyCount); - settings->setValue(QLatin1String(disableIndexerKeyC), disableIndexer); - settings->setValue(QLatin1String(indexOnlyVOBsC), indexOnlyVOBs); - settings->beginGroup(QLatin1String(totalFilesKeyC)); + settings->setValue(diffArgsKeyC, diffArgs); + settings->setValue(diffTypeKeyC, sDiffType); + settings->setValue(autoAssignActivityKeyC, autoAssignActivityName); + settings->setValue(historyCountKeyC, historyCount); + settings->setValue(disableIndexerKeyC, disableIndexer); + settings->setValue(indexOnlyVOBsC, indexOnlyVOBs); + settings->beginGroup(totalFilesKeyC); const FilesConstIt fcend = totalFiles.constEnd(); for (FilesConstIt it = totalFiles.constBegin(); it != fcend; ++it) settings->setValue(it.key(), it.value()); diff --git a/src/plugins/clearcase/clearcasesettings.h b/src/plugins/clearcase/clearcasesettings.h index e65b2009ea5..344c31d6c9f 100644 --- a/src/plugins/clearcase/clearcasesettings.h +++ b/src/plugins/clearcase/clearcasesettings.h @@ -4,13 +4,11 @@ #pragma once #include <utils/filepath.h> +#include <utils/storekey.h> #include <QHash> -#include <QString> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace Utils { class QtcSettings; } namespace ClearCase::Internal { @@ -25,8 +23,8 @@ class ClearCaseSettings public: ClearCaseSettings(); - void fromSettings(QSettings *); - void toSettings(QSettings *) const; + void fromSettings(Utils::QtcSettings *); + void toSettings(Utils::QtcSettings *) const; bool equals(const ClearCaseSettings &s) const; @@ -40,7 +38,7 @@ public: DiffType diffType = GraphicalDiff; QString diffArgs; QString indexOnlyVOBs; - QHash<QString, int> totalFiles; + QHash<Utils::Key, int> totalFiles; bool autoAssignActivityName = true; bool autoCheckOut = true; bool noComment = false; diff --git a/src/plugins/clearcase/clearcasesync.cpp b/src/plugins/clearcase/clearcasesync.cpp index 8476d1f04ac..a61408e75ac 100644 --- a/src/plugins/clearcase/clearcasesync.cpp +++ b/src/plugins/clearcase/clearcasesync.cpp @@ -118,7 +118,7 @@ void ClearCaseSync::processCleartoolLsLine(const QDir &viewRootDir, const QStrin ClearCasePlugin::setStatus(absFile, FileStatus::CheckedIn, true); } -void ClearCaseSync::updateTotalFilesCount(const QString &view, ClearCaseSettings settings, +void ClearCaseSync::updateTotalFilesCount(const Key &view, ClearCaseSettings settings, const int processed) { settings = ClearCasePlugin::settings(); // Might have changed while task was running @@ -138,7 +138,7 @@ void ClearCaseSync::updateStatusForNotManagedFiles(const QStringList &files) void ClearCaseSync::syncSnapshotView(QPromise<void> &promise, QStringList &files, const ClearCaseSettings &settings) { - const QString view = ClearCasePlugin::viewData().name; + const Key view = keyFromString(ClearCasePlugin::viewData().name); int totalFileCount = files.size(); const bool hot = (totalFileCount < 10); diff --git a/src/plugins/clearcase/clearcasesync.h b/src/plugins/clearcase/clearcasesync.h index 4b69985b0c7..a93d1852c06 100644 --- a/src/plugins/clearcase/clearcasesync.h +++ b/src/plugins/clearcase/clearcasesync.h @@ -5,6 +5,8 @@ #include "clearcaseplugin.h" +#include <utils/storekey.h> + QT_BEGIN_NAMESPACE class QDir; template <typename T> @@ -24,7 +26,7 @@ public: void invalidateStatus(const QDir &viewRootDir, const QStringList &files); void invalidateStatusAllFiles(); void processCleartoolLsLine(const QDir &viewRootDir, const QString &buffer); - void updateTotalFilesCount(const QString &view, ClearCaseSettings settings, + void updateTotalFilesCount(const Utils::Key &view, ClearCaseSettings settings, const int processed); void updateStatusForNotManagedFiles(const QStringList &files); diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 2a184152d24..f0829853630 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -480,7 +480,7 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, setDocumentMode(true); setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::TabPosition::South); - document->setWindowStateCallback([this] { return windowStateCallback(); }); + document->setWindowStateCallback([this] { return storeFromMap(windowStateCallback()); }); document->settings()->m_sources.setItemAddedCallback<SourceSettings>( [this](const std::shared_ptr<SourceSettings> &source) { addSourceEditor(source); }); @@ -544,15 +544,15 @@ QVariantMap EditorWidget::windowStateCallback() auto settings = saveSettings(); QVariantMap result; - for (const auto &key : settings.keys()) { + for (const Key &key : settings.keys()) { // QTBUG-116339 - if (key != "State") { - result.insert(key, settings.value(key)); + if (stringFromKey(key) != "State") { + result.insert(stringFromKey(key), settings.value(key)); } else { QVariantMap m; m["type"] = "Base64"; m["value"] = settings.value(key).toByteArray().toBase64(); - result.insert(key, m); + result.insert(stringFromKey(key), m); } } @@ -646,12 +646,12 @@ void EditorWidget::recreateEditors() m_document->settings()->m_sources.forEachItem<SourceSettings>( [this](const auto &sourceSettings) { addSourceEditor(sourceSettings); }); - QVariantMap windowState = m_document->settings()->windowState.value(); + Store windowState = m_document->settings()->windowState.value(); if (!windowState.isEmpty()) { - QHash<QString, QVariant> hashMap; + QHash<Key, QVariant> hashMap; for (const auto &key : windowState.keys()) { - if (key != "State") + if (key.view() != "State") hashMap.insert(key, windowState.value(key)); else { QVariant v = windowState.value(key); diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.h b/src/plugins/compilerexplorer/compilerexplorereditor.h index 7b827aa1625..c2dcfdaebe4 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.h +++ b/src/plugins/compilerexplorer/compilerexplorereditor.h @@ -95,7 +95,7 @@ public: CompilerExplorerSettings *settings() { return &m_ceSettings; } - void setWindowStateCallback(std::function<QVariantMap()> callback) + void setWindowStateCallback(std::function<Utils::Store()> callback) { m_windowStateCallback = callback; } @@ -105,7 +105,7 @@ signals: private: mutable CompilerExplorerSettings m_ceSettings; - std::function<QVariantMap()> m_windowStateCallback; + std::function<Utils::Store()> m_windowStateCallback; QUndoStack *m_undoStack; }; diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.h b/src/plugins/compilerexplorer/compilerexplorersettings.h index de0aa75e300..64f67122fe6 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.h +++ b/src/plugins/compilerexplorer/compilerexplorersettings.h @@ -32,7 +32,7 @@ public: ~CompilerExplorerSettings(); Utils::StringAspect compilerExplorerUrl{this}; - Utils::TypedAspect<QVariantMap> windowState{this}; + Utils::TypedAspect<Utils::Store> windowState{this}; Utils::AspectList m_sources{this}; diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index 57d1f19e15f..cdca2ba5fd9 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -475,10 +475,10 @@ Command *ActionManagerPrivate::overridableAction(Id id) void ActionManagerPrivate::readUserSettings(Id id, Command *cmd) { - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); settings->beginGroup(kKeyboardSettingsKeyV2); - if (settings->contains(id.toString())) { - const QVariant v = settings->value(id.toString()); + if (settings->contains(id.toKey())) { + const QVariant v = settings->value(id.toKey()); if (QMetaType::Type(v.type()) == QMetaType::QStringList) { cmd->setKeySequences(Utils::transform<QList>(v.toStringList(), [](const QString &s) { return QKeySequence::fromString(s); diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 9dbd1980b9f..c143a3e54a1 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -403,7 +403,7 @@ void CorePlugin::checkSettings() msgBox.exec(); }, Qt::QueuedConnection); }; - const QSettings * const userSettings = ICore::settings(); + const QtcSettings * const userSettings = ICore::settings(); QString errorDetails; switch (userSettings->status()) { case QSettings::NoError: { diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 9d610ddd135..3217a3c3684 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -490,8 +490,8 @@ SettingsDialog::SettingsDialog(QWidget *parent) : connect(m_sortCheckBox, &QAbstractButton::toggled, this, [this](bool checked) { m_proxyModel.sort(checked ? 0 : -1); }); - QSettings *settings = ICore::settings(); - m_sortCheckBox->setChecked(settings->value(QLatin1String(sortKeyC), false).toBool()); + QtcSettings *settings = ICore::settings(); + m_sortCheckBox->setChecked(settings->value(sortKeyC, false).toBool()); connect(m_categoryList->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &SettingsDialog::currentChanged); @@ -516,8 +516,8 @@ void SettingsDialog::showPage(const Id pageId) // handle the case of "show last page" Id initialPageId = pageId; if (!initialPageId.isValid()) { - QSettings *settings = ICore::settings(); - initialPageId = Id::fromSetting(settings->value(QLatin1String(pageKeyC))); + QtcSettings *settings = ICore::settings(); + initialPageId = Id::fromSetting(settings->value(pageKeyC)); } int initialCategoryIndex = -1; @@ -752,9 +752,9 @@ void SettingsDialog::apply() void SettingsDialog::done(int val) { - QSettings *settings = ICore::settings(); - settings->setValue(QLatin1String(pageKeyC), m_currentPage.toSetting()); - settings->setValue(QLatin1String(sortKeyC), m_sortCheckBox->isChecked()); + QtcSettings *settings = ICore::settings(); + settings->setValue(pageKeyC, m_currentPage.toSetting()); + settings->setValue(sortKeyC, m_sortCheckBox->isChecked()); ICore::saveSettings(ICore::SettingsDialogDone); // save all settings diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index 859119dc1c2..38d1d9b2ecb 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -1399,22 +1399,22 @@ void restoreRecentFiles(const QVariantList &recentFiles, const QStringList &rece void readSettings() { - QSettings *s = ICore::settings(); + QtcSettings *s = ICore::settings(); d->m_recentFiles.clear(); - s->beginGroup(QLatin1String(settingsGroupC)); - const QVariantList recentFiles = s->value(QLatin1String(filesKeyC)).toList(); - const QStringList recentEditorIds = s->value(QLatin1String(editorsKeyC)).toStringList(); + s->beginGroup(settingsGroupC); + const QVariantList recentFiles = s->value(filesKeyC).toList(); + const QStringList recentEditorIds = s->value(editorsKeyC).toStringList(); s->endGroup(); restoreRecentFiles(recentFiles, recentEditorIds); - s->beginGroup(QLatin1String(directoryGroupC)); + s->beginGroup(directoryGroupC); d->m_projectsDirectory = FilePath::fromSettings( - s->value(QLatin1String(projectDirectoryKeyC), PathChooser::homePath().toSettings())); + s->value(projectDirectoryKeyC, PathChooser::homePath().toSettings())); d->m_useProjectsDirectory - = s->value(QLatin1String(useProjectDirectoryKeyC), kUseProjectsDirectoryDefault).toBool(); + = s->value(useProjectDirectoryKeyC, kUseProjectsDirectoryDefault).toBool(); s->endGroup(); } diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 8ce244e4256..4b059a10fd7 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1210,7 +1210,7 @@ void EditorManagerPrivate::saveSettings() void EditorManagerPrivate::readSettings() { - QSettings *qs = ICore::settings(); + QtcSettings *qs = ICore::settings(); const Qt::CaseSensitivity defaultSensitivity = OsSpecificAspects::fileNameCaseSensitivity( HostOsInfo::hostOs()); @@ -1232,7 +1232,7 @@ void EditorManagerPrivate::readSettings() updateAutoSave(); } -Qt::CaseSensitivity EditorManagerPrivate::readFileSystemSensitivity(QSettings *settings) +Qt::CaseSensitivity EditorManagerPrivate::readFileSystemSensitivity(QtcSettings *settings) { const Qt::CaseSensitivity defaultSensitivity = OsSpecificAspects::fileNameCaseSensitivity( HostOsInfo::hostOs()); @@ -3570,7 +3570,7 @@ void EditorManager::hideEditorStatusBar(const QString &id) */ QTextCodec *EditorManager::defaultTextCodec() { - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); const QByteArray codecName = settings->value(Constants::SETTINGS_DEFAULTTEXTENCODING).toByteArray(); if (QTextCodec *candidate = QTextCodec::codecForName(codecName)) @@ -3591,7 +3591,7 @@ QTextCodec *EditorManager::defaultTextCodec() */ TextFileFormat::LineTerminationMode EditorManager::defaultLineEnding() { - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); const int defaultLineTerminator = settings->value(Constants::SETTINGS_DEFAULT_LINE_TERMINATOR, TextFileFormat::LineTerminationMode::NativeLineTerminator).toInt(); diff --git a/src/plugins/coreplugin/editormanager/editormanager_p.h b/src/plugins/coreplugin/editormanager/editormanager_p.h index 7e3863e5cf6..25c7007b5be 100644 --- a/src/plugins/coreplugin/editormanager/editormanager_p.h +++ b/src/plugins/coreplugin/editormanager/editormanager_p.h @@ -96,7 +96,7 @@ public: static void saveSettings(); static void readSettings(); - static Qt::CaseSensitivity readFileSystemSensitivity(QSettings *settings); + static Qt::CaseSensitivity readFileSystemSensitivity(Utils::QtcSettings *settings); static void writeFileSystemSensitivity(Utils::QtcSettings *settings, Qt::CaseSensitivity sensitivity); diff --git a/src/plugins/coreplugin/externaltoolmanager.cpp b/src/plugins/coreplugin/externaltoolmanager.cpp index 0a42bfc9ab7..6f85a2b4c11 100644 --- a/src/plugins/coreplugin/externaltoolmanager.cpp +++ b/src/plugins/coreplugin/externaltoolmanager.cpp @@ -233,11 +233,11 @@ void ExternalToolManager::setToolsByCategory(const QMap<QString, QList<ExternalT void ExternalToolManager::readSettings(const QMap<QString, ExternalTool *> &tools, QMap<QString, QList<ExternalTool *> > *categoryMap) { - QSettings *settings = ICore::settings(); - settings->beginGroup(QLatin1String("ExternalTools")); + QtcSettings *settings = ICore::settings(); + settings->beginGroup("ExternalTools"); if (categoryMap) { - settings->beginGroup(QLatin1String("OverrideCategories")); + settings->beginGroup("OverrideCategories"); const QStringList settingsCategories = settings->childGroups(); for (const QString &settingsCategory : settingsCategories) { QString displayCategory = settingsCategory; @@ -246,7 +246,7 @@ void ExternalToolManager::readSettings(const QMap<QString, ExternalTool *> &tool int count = settings->beginReadArray(settingsCategory); for (int i = 0; i < count; ++i) { settings->setArrayIndex(i); - const QString &toolId = settings->value(QLatin1String("Tool")).toString(); + const QString &toolId = settings->value("Tool").toString(); if (tools.contains(toolId)) { ExternalTool *tool = tools.value(toolId); // remove from old category @@ -267,11 +267,11 @@ void ExternalToolManager::readSettings(const QMap<QString, ExternalTool *> &tool static void writeSettings() { - QSettings *settings = ICore::settings(); - settings->beginGroup(QLatin1String("ExternalTools")); - settings->remove(QLatin1String("")); + QtcSettings *settings = ICore::settings(); + settings->beginGroup("ExternalTools"); + settings->remove(""); - settings->beginGroup(QLatin1String("OverrideCategories")); + settings->beginGroup("OverrideCategories"); for (auto it = d->m_categoryMap.cbegin(), end = d->m_categoryMap.cend(); it != end; ++it) { QString category = it.key(); if (category.isEmpty()) @@ -281,7 +281,7 @@ static void writeSettings() const QList<ExternalTool *> values = it.value(); for (const ExternalTool *tool : values) { settings->setArrayIndex(i); - settings->setValue(QLatin1String("Tool"), tool->id()); + settings->setValue("Tool", tool->id()); ++i; } settings->endArray(); diff --git a/src/plugins/coreplugin/find/findplugin.cpp b/src/plugins/coreplugin/find/findplugin.cpp index 6836b70e077..0aedf610f8c 100644 --- a/src/plugins/coreplugin/find/findplugin.cpp +++ b/src/plugins/coreplugin/find/findplugin.cpp @@ -76,8 +76,8 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - void writeSettings(QSettings *settings) const; - void readSettings(QSettings *settings); + void writeSettings(QtcSettings *settings) const; + void readSettings(QtcSettings *settings); void updateCompletion(const QString &text, FindFlags f); @@ -102,17 +102,17 @@ QVariant CompletionModel::data(const QModelIndex &index, int role) const return QVariant(); } -static inline QString completionSettingsArrayPrefix() { return QStringLiteral("FindCompletions"); } -static inline QString completionSettingsTextKey() { return QStringLiteral("Text"); } -static inline QString completionSettingsFlagsKey() { return QStringLiteral("Flags"); } +static Utils::Key completionSettingsArrayPrefix() { return "FindCompletions"; } +static Utils::Key completionSettingsTextKey() { return "Text"; } +static Utils::Key completionSettingsFlagsKey() { return "Flags"; } -void CompletionModel::writeSettings(QSettings *settings) const +void CompletionModel::writeSettings(QtcSettings *settings) const { if (m_entries.isEmpty()) { settings->remove(completionSettingsArrayPrefix()); } else { const int size = m_entries.size(); - settings->beginWriteArray(completionSettingsArrayPrefix(), size); + settings->beginWriteArray(completionSettingsArrayPrefix().view(), size); for (int i = 0; i < size; ++i) { settings->setArrayIndex(i); settings->setValue(completionSettingsTextKey(), m_entries.at(i).text); @@ -122,10 +122,10 @@ void CompletionModel::writeSettings(QSettings *settings) const } } -void CompletionModel::readSettings(QSettings *settings) +void CompletionModel::readSettings(QtcSettings *settings) { beginResetModel(); - const int size = settings->beginReadArray(completionSettingsArrayPrefix()); + const int size = settings->beginReadArray(completionSettingsArrayPrefix().view()); m_entries.clear(); m_entries.reserve(size); for (int i = 0; i < size; ++i) { diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index caece8a0737..da8c3a1e015 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -1045,19 +1045,19 @@ void FindToolBar::writeSettings() void FindToolBar::readSettings() { - QSettings *settings = ICore::settings(); - settings->beginGroup(QLatin1String("Find")); - settings->beginGroup(QLatin1String("FindToolBar")); + QtcSettings *settings = ICore::settings(); + settings->beginGroup("Find"); + settings->beginGroup("FindToolBar"); FindFlags flags; - if (settings->value(QLatin1String("Backward"), false).toBool()) + if (settings->value("Backward", false).toBool()) flags |= FindBackward; - if (settings->value(QLatin1String("CaseSensitively"), false).toBool()) + if (settings->value("CaseSensitively", false).toBool()) flags |= FindCaseSensitively; - if (settings->value(QLatin1String("WholeWords"), false).toBool()) + if (settings->value("WholeWords", false).toBool()) flags |= FindWholeWords; - if (settings->value(QLatin1String("RegularExpression"), false).toBool()) + if (settings->value("RegularExpression", false).toBool()) flags |= FindRegularExpression; - if (settings->value(QLatin1String("PreserveCase"), false).toBool()) + if (settings->value("PreserveCase", false).toBool()) flags |= FindPreserveCase; settings->endGroup(); settings->endGroup(); diff --git a/src/plugins/coreplugin/find/findtoolwindow.cpp b/src/plugins/coreplugin/find/findtoolwindow.cpp index d1e3a9fd235..15ca8542db8 100644 --- a/src/plugins/coreplugin/find/findtoolwindow.cpp +++ b/src/plugins/coreplugin/find/findtoolwindow.cpp @@ -360,9 +360,9 @@ void FindToolWindow::writeSettings() void FindToolWindow::readSettings() { - QSettings *settings = ICore::settings(); - settings->beginGroup(QLatin1String("Find")); - const QString currentFilter = settings->value(QLatin1String("CurrentFilter")).toString(); + QtcSettings *settings = ICore::settings(); + settings->beginGroup("Find"); + const QString currentFilter = settings->value("CurrentFilter").toString(); for (int i = 0; i < m_filters.size(); ++i) { IFindFilter *filter = m_filters.at(i); filter->readSettings(settings); diff --git a/src/plugins/coreplugin/find/ifindfilter.h b/src/plugins/coreplugin/find/ifindfilter.h index 107439fdfd8..2d6325eda01 100644 --- a/src/plugins/coreplugin/find/ifindfilter.h +++ b/src/plugins/coreplugin/find/ifindfilter.h @@ -9,11 +9,12 @@ QT_BEGIN_NAMESPACE class QWidget; -class QSettings; class QKeySequence; class Pixmap; QT_END_NAMESPACE +namespace Utils { class QtcSettings; } + namespace Core { class CORE_EXPORT IFindFilter : public QObject @@ -41,8 +42,8 @@ public: { Q_UNUSED(txt) Q_UNUSED(findFlags) } virtual QWidget *createConfigWidget() { return nullptr; } - virtual void writeSettings(QSettings *settings) { Q_UNUSED(settings) } - virtual void readSettings(QSettings *settings) { Q_UNUSED(settings) } + virtual void writeSettings(Utils::QtcSettings *settings) { Q_UNUSED(settings) } + virtual void readSettings(Utils::QtcSettings *settings) { Q_UNUSED(settings) } static QPixmap pixmapForFindFlags(Utils::FindFlags flags); static QString descriptionForFindFlags(Utils::FindFlags flags); diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp index ba121114876..8711ad3b61f 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.cpp +++ b/src/plugins/coreplugin/find/searchresultwindow.cpp @@ -638,9 +638,9 @@ QList<QWidget *> SearchResultWindowPrivate::toolBarWidgets() */ void SearchResultWindow::readSettings() { - QSettings *s = ICore::settings(); - s->beginGroup(QLatin1String(SETTINGSKEYSECTIONNAME)); - d->m_expandCollapseAction->setChecked(s->value(QLatin1String(SETTINGSKEYEXPANDRESULTS), + Utils::QtcSettings *s = ICore::settings(); + s->beginGroup(SETTINGSKEYSECTIONNAME); + d->m_expandCollapseAction->setChecked(s->value(SETTINGSKEYEXPANDRESULTS, SearchResultWindowPrivate::m_initiallyExpand).toBool()); s->endGroup(); } diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 07b539da91e..208c2f87321 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -255,8 +255,8 @@ void GeneralSettingsWidget::resetLanguage() QString GeneralSettingsWidget::language() { - QSettings *settings = ICore::settings(); - return settings->value(QLatin1String("General/OverrideLanguage")).toString(); + QtcSettings *settings = ICore::settings(); + return settings->value("General/OverrideLanguage").toString(); } void GeneralSettingsWidget::setLanguage(const QString &locale) @@ -285,7 +285,7 @@ void GeneralSettingsWidget::fillCodecBox() const QByteArray GeneralSettingsWidget::codecForLocale() { - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); QByteArray codec = settings->value(settingsKeyCodecForLocale).toByteArray(); if (codec.isEmpty()) codec = QTextCodec::codecForLocale()->name(); diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 570dbc5d8de..ba4c16a5d5d 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -1894,7 +1894,7 @@ void MainWindowPrivate::registerDefaultActions() Tr::tr( "This will hide the menu bar completely. You can show it again by typing ") + cmd->keySequence().toString(QKeySequence::NativeText), - QString("ToogleMenuBarHint")); + Key("ToogleMenuBarHint")); } globalMenuBar()->setVisible(visible); }); diff --git a/src/plugins/coreplugin/locator/filesystemfilter.cpp b/src/plugins/coreplugin/locator/filesystemfilter.cpp index 7c6ac13abda..39eea1200fe 100644 --- a/src/plugins/coreplugin/locator/filesystemfilter.cpp +++ b/src/plugins/coreplugin/locator/filesystemfilter.cpp @@ -63,7 +63,7 @@ static bool askForCreating(const QString &title, const FilePath &filePath) = CheckableMessageBox::question(ICore::dialogParent(), title, Tr::tr("Create \"%1\"?").arg(filePath.shortNativePath()), - QString(kAlwaysCreate), + Key(kAlwaysCreate), QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel, QMessageBox::Yes, diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index cac44faf6fd..66fddd1b5d4 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -628,23 +628,23 @@ void OutputPaneManager::buttonTriggered(int idx) void OutputPaneManager::readSettings() { - QSettings *settings = ICore::settings(); - int num = settings->beginReadArray(QLatin1String(outputPaneSettingsKeyC)); + QtcSettings *settings = ICore::settings(); + int num = settings->beginReadArray(outputPaneSettingsKeyC); for (int i = 0; i < num; ++i) { settings->setArrayIndex(i); - Id id = Id::fromSetting(settings->value(QLatin1String(outputPaneIdKeyC))); + Id id = Id::fromSetting(settings->value(outputPaneIdKeyC)); const int idx = Utils::indexOf(g_outputPanes, Utils::equal(&OutputPaneData::id, id)); if (idx < 0) // happens for e.g. disabled plugins (with outputpanes) that were loaded before continue; - const bool visible = settings->value(QLatin1String(outputPaneVisibleKeyC)).toBool(); + const bool visible = settings->value(outputPaneVisibleKeyC).toBool(); g_outputPanes[idx].button->setVisible(visible); } settings->endArray(); m_outputPaneHeightSetting - = settings->value(QLatin1String("OutputPanePlaceHolder/Height"), 0).toInt(); + = settings->value("OutputPanePlaceHolder/Height", 0).toInt(); const int currentIdx - = settings->value(QLatin1String("OutputPanePlaceHolder/CurrentIndex"), 0).toInt(); + = settings->value("OutputPanePlaceHolder/CurrentIndex", 0).toInt(); if (QTC_GUARD(currentIdx >= 0 && currentIdx < g_outputPanes.size())) setCurrentIndex(currentIdx); } @@ -809,22 +809,22 @@ void OutputPaneManager::popupMenu() void OutputPaneManager::saveSettings() const { - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); const int n = g_outputPanes.size(); - settings->beginWriteArray(QLatin1String(outputPaneSettingsKeyC), n); + settings->beginWriteArray(outputPaneSettingsKeyC, n); for (int i = 0; i < n; ++i) { const OutputPaneData &data = g_outputPanes.at(i); settings->setArrayIndex(i); - settings->setValue(QLatin1String(outputPaneIdKeyC), data.id.toSetting()); - settings->setValue(QLatin1String(outputPaneVisibleKeyC), data.button->isPaneVisible()); + settings->setValue(outputPaneIdKeyC, data.id.toSetting()); + settings->setValue(outputPaneVisibleKeyC, data.button->isPaneVisible()); } settings->endArray(); int heightSetting = m_outputPaneHeightSetting; // update if possible if (OutputPanePlaceHolder *curr = OutputPanePlaceHolder::getCurrent()) heightSetting = curr->nonMaximizedSize(); - settings->setValue(QLatin1String("OutputPanePlaceHolder/Height"), heightSetting); - settings->setValue(QLatin1String("OutputPanePlaceHolder/CurrentIndex"), currentIndex()); + settings->setValue("OutputPanePlaceHolder/Height", heightSetting); + settings->setValue("OutputPanePlaceHolder/CurrentIndex", currentIndex()); } void OutputPaneManager::clearPage() diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.cpp b/src/plugins/coreplugin/progressmanager/progressmanager.cpp index 5504f8fe0ce..bbad151c032 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.cpp +++ b/src/plugins/coreplugin/progressmanager/progressmanager.cpp @@ -250,7 +250,7 @@ ProgressManagerPrivate::~ProgressManagerPrivate() void ProgressManagerPrivate::readSettings() { - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); settings->beginGroup(kSettingsGroup); m_progressViewPinned = settings->value(kDetailsPinned, kDetailsPinnedDefault).toBool(); settings->endGroup(); diff --git a/src/plugins/coreplugin/rightpane.cpp b/src/plugins/coreplugin/rightpane.cpp index d4f8f7aa250..4363735ceab 100644 --- a/src/plugins/coreplugin/rightpane.cpp +++ b/src/plugins/coreplugin/rightpane.cpp @@ -157,9 +157,9 @@ void RightPaneWidget::saveSettings(Utils::QtcSettings *settings) settings->setValueWithDefault("RightPane/Width", m_width, kWidthDefault); } -void RightPaneWidget::readSettings(QSettings *settings) +void RightPaneWidget::readSettings(QtcSettings *settings) { - setShown(settings->value(QLatin1String("RightPane/Visible"), kVisibleDefault).toBool()); + setShown(settings->value("RightPane/Visible", kVisibleDefault).toBool()); m_width = settings->value("RightPane/Width", kWidthDefault).toInt(); // Apply diff --git a/src/plugins/coreplugin/rightpane.h b/src/plugins/coreplugin/rightpane.h index a7371f406ad..0dd11669515 100644 --- a/src/plugins/coreplugin/rightpane.h +++ b/src/plugins/coreplugin/rightpane.h @@ -48,7 +48,7 @@ public: ~RightPaneWidget() override; void saveSettings(Utils::QtcSettings *settings); - void readSettings(QSettings *settings); + void readSettings(Utils::QtcSettings *settings); bool isShown() const; void setShown(bool b); diff --git a/src/plugins/coreplugin/sidebar.cpp b/src/plugins/coreplugin/sidebar.cpp index e1cf32777b3..8e38ec224ce 100644 --- a/src/plugins/coreplugin/sidebar.cpp +++ b/src/plugins/coreplugin/sidebar.cpp @@ -5,14 +5,17 @@ #include "sidebarwidget.h" #include "actionmanager/command.h" + #include <utils/algorithm.h> #include <utils/qtcassert.h> +#include <utils/qtcsettings.h> #include <utils/utilsicons.h> -#include <QSettings> #include <QPointer> #include <QToolButton> +using namespace Utils; + namespace Core { SideBarItem::SideBarItem(QWidget *widget, const QString &id) : @@ -228,9 +231,9 @@ void SideBar::updateWidgets() i->updateAvailableItems(); } -void SideBar::saveSettings(QSettings *settings, const QString &name) +void SideBar::saveSettings(QtcSettings *settings, const QString &name) { - const QString prefix = name.isEmpty() ? name : (name + QLatin1Char('/')); + const Key prefix = keyFromString(name.isEmpty() ? name : (name + QLatin1Char('/'))); QStringList views; for (int i = 0; i < d->m_widgets.count(); ++i) { @@ -241,11 +244,10 @@ void SideBar::saveSettings(QSettings *settings, const QString &name) if (views.isEmpty() && !d->m_itemMap.isEmpty()) views.append(d->m_itemMap.cbegin().key()); - settings->setValue(prefix + QLatin1String("Views"), views); - settings->setValue(prefix + QLatin1String("Visible"), - parentWidget() ? isVisibleTo(parentWidget()) : true); - settings->setValue(prefix + QLatin1String("VerticalPosition"), saveState()); - settings->setValue(prefix + QLatin1String("Width"), width()); + settings->setValue(prefix + "Views", views); + settings->setValue(prefix + "Visible", parentWidget() ? isVisibleTo(parentWidget()) : true); + settings->setValue(prefix + "VerticalPosition", saveState()); + settings->setValue(prefix + "Width", width()); } void SideBar::closeAllWidgets() @@ -254,13 +256,13 @@ void SideBar::closeAllWidgets() removeSideBarWidget(widget); } -void SideBar::readSettings(QSettings *settings, const QString &name) +void SideBar::readSettings(QtcSettings *settings, const QString &name) { - const QString prefix = name.isEmpty() ? name : (name + QLatin1Char('/')); + const Key prefix = keyFromString(name.isEmpty() ? name : (name + QLatin1Char('/'))); closeAllWidgets(); - const QString viewsKey = prefix + QLatin1String("Views"); + const Key viewsKey = prefix + "Views"; if (settings->contains(viewsKey)) { const QStringList views = settings->value(viewsKey).toStringList(); if (!views.isEmpty()) { @@ -277,15 +279,15 @@ void SideBar::readSettings(QSettings *settings, const QString &name) insertSideBarWidget(d->m_widgets.count(), id); } - const QString visibleKey = prefix + QLatin1String("Visible"); + const Key visibleKey = prefix + "Visible"; if (settings->contains(visibleKey)) setVisible(settings->value(visibleKey).toBool()); - const QString positionKey = prefix + QLatin1String("VerticalPosition"); + const Key positionKey = prefix + "VerticalPosition"; if (settings->contains(positionKey)) restoreState(settings->value(positionKey).toByteArray()); - const QString widthKey = prefix + QLatin1String("Width"); + const Key widthKey = prefix + "Width"; if (settings->contains(widthKey)) { QSize s = size(); s.setWidth(settings->value(widthKey).toInt()); @@ -318,5 +320,5 @@ QMap<QString, Command*> SideBar::shortcutMap() const { return d->m_shortcutMap; } -} // namespace Core +} // namespace Core diff --git a/src/plugins/coreplugin/sidebar.h b/src/plugins/coreplugin/sidebar.h index adbfde1b1dd..733d9c9cc62 100644 --- a/src/plugins/coreplugin/sidebar.h +++ b/src/plugins/coreplugin/sidebar.h @@ -10,10 +10,11 @@ #include <QList> QT_BEGIN_NAMESPACE -class QSettings; class QToolButton; QT_END_NAMESPACE +namespace Utils { class QtcSettings; } + namespace Core { class Command; @@ -78,8 +79,8 @@ public: bool closeWhenEmpty() const; void setCloseWhenEmpty(bool value); - void saveSettings(QSettings *settings, const QString &name); - void readSettings(QSettings *settings, const QString &name); + void saveSettings(Utils::QtcSettings *settings, const QString &name); + void readSettings(Utils::QtcSettings *settings, const QString &name); void closeAllWidgets(); void activateItem(const QString &id); diff --git a/src/plugins/coreplugin/statusbarmanager.cpp b/src/plugins/coreplugin/statusbarmanager.cpp index 83d910867bf..c590b3f29ef 100644 --- a/src/plugins/coreplugin/statusbarmanager.cpp +++ b/src/plugins/coreplugin/statusbarmanager.cpp @@ -3,8 +3,8 @@ #include "statusbarmanager.h" +#include "icore.h" #include "imode.h" -#include "mainwindow.h" #include "minisplitter.h" #include "modemanager.h" @@ -16,6 +16,8 @@ #include <QSplitter> #include <QStatusBar> +using namespace Utils; + namespace Core { const char kSettingsGroup[] = "StatusBar"; @@ -80,9 +82,9 @@ static void createStatusBarManager() ICore::addContextObject(statusContext); QObject::connect(ICore::instance(), &ICore::saveSettingsRequested, ICore::instance(), [] { - QSettings *s = ICore::settings(); - s->beginGroup(QLatin1String(kSettingsGroup)); - s->setValue(QLatin1String(kLeftSplitWidthKey), m_splitter->sizes().at(0)); + QtcSettings *s = ICore::settings(); + s->beginGroup(kSettingsGroup); + s->setValue(kLeftSplitWidthKey, m_splitter->sizes().at(0)); s->endGroup(); }); @@ -132,9 +134,9 @@ void StatusBarManager::destroyStatusBarWidget(QWidget *widget) void StatusBarManager::restoreSettings() { - QSettings *s = ICore::settings(); - s->beginGroup(QLatin1String(kSettingsGroup)); - int leftSplitWidth = s->value(QLatin1String(kLeftSplitWidthKey), -1).toInt(); + QtcSettings *s = ICore::settings(); + s->beginGroup(kSettingsGroup); + int leftSplitWidth = s->value(kLeftSplitWidthKey, -1).toInt(); s->endGroup(); if (leftSplitWidth < 0) { // size first split after its sizeHint + a bit of buffer diff --git a/src/plugins/cpaster/pasteview.cpp b/src/plugins/cpaster/pasteview.cpp index b1f4864b6e0..6602efe6ba1 100644 --- a/src/plugins/cpaster/pasteview.cpp +++ b/src/plugins/cpaster/pasteview.cpp @@ -11,6 +11,7 @@ #include <utils/layoutbuilder.h> #include <utils/qtcassert.h> +#include <utils/qtcsettings.h> #include <QApplication> #include <QComboBox> @@ -27,6 +28,8 @@ #include <QStackedWidget> #include <QTextEdit> +using namespace Utils; + namespace CodePaster { const char groupC[] = "CPaster"; @@ -197,11 +200,11 @@ int PasteView::showDialog() m_uiDescription->selectAll(); // (Re)store dialog size - const QSettings *settings = Core::ICore::settings(); - const QString rootKey = QLatin1String(groupC) + QLatin1Char('/'); - const int h = settings->value(rootKey + QLatin1String(heightKeyC), height()).toInt(); + const QtcSettings *settings = Core::ICore::settings(); + const Key rootKey = Key(groupC) + '/'; + const int h = settings->value(rootKey + heightKeyC, height()).toInt(); const int defaultWidth = m_uiPatchView->columnIndicator() + 50; - const int w = settings->value(rootKey + QLatin1String(widthKeyC), defaultWidth).toInt(); + const int w = settings->value(rootKey + widthKeyC, defaultWidth).toInt(); resize(w, h); @@ -273,10 +276,10 @@ void PasteView::accept() const Protocol::ContentType ct = Protocol::contentType(m_mimeType); protocol->paste(data, ct, expiryDays(), user(), comment(), description()); // Store settings and close - QSettings *settings = Core::ICore::settings(); - settings->beginGroup(QLatin1String(groupC)); - settings->setValue(QLatin1String(heightKeyC), height()); - settings->setValue(QLatin1String(widthKeyC), width()); + QtcSettings *settings = Core::ICore::settings(); + settings->beginGroup(groupC); + settings->setValue(heightKeyC, height()); + settings->setValue(widthKeyC, width()); settings->endGroup(); QDialog::accept(); } diff --git a/src/plugins/cppeditor/clangdiagnosticconfig.cpp b/src/plugins/cppeditor/clangdiagnosticconfig.cpp index d97ece6616a..bfc7b0436e9 100644 --- a/src/plugins/cppeditor/clangdiagnosticconfig.cpp +++ b/src/plugins/cppeditor/clangdiagnosticconfig.cpp @@ -5,8 +5,9 @@ #include "cpptoolsreuse.h" #include <utils/qtcassert.h> +#include <utils/qtcsettings.h> -#include <QSettings> +using namespace Utils; namespace CppEditor { @@ -215,7 +216,7 @@ static const char diagnosticConfigsTidyModeKey[] = "clangTidyMode"; static const char diagnosticConfigsClazyModeKey[] = "clazyMode"; static const char diagnosticConfigsClazyChecksKey[] = "clazyChecks"; -void diagnosticConfigsToSettings(QSettings *s, const ClangDiagnosticConfigs &configs) +void diagnosticConfigsToSettings(QtcSettings *s, const ClangDiagnosticConfigs &configs) { s->beginWriteArray(diagnosticConfigsArrayKey); for (int i = 0, size = configs.size(); i < size; ++i) { @@ -234,7 +235,7 @@ void diagnosticConfigsToSettings(QSettings *s, const ClangDiagnosticConfigs &con s->endArray(); } -ClangDiagnosticConfigs diagnosticConfigsFromSettings(QSettings *s) +ClangDiagnosticConfigs diagnosticConfigsFromSettings(QtcSettings *s) { ClangDiagnosticConfigs configs; diff --git a/src/plugins/cppeditor/clangdiagnosticconfig.h b/src/plugins/cppeditor/clangdiagnosticconfig.h index 3442c95db50..5c1070de366 100644 --- a/src/plugins/cppeditor/clangdiagnosticconfig.h +++ b/src/plugins/cppeditor/clangdiagnosticconfig.h @@ -12,9 +12,7 @@ #include <QStringList> #include <QVector> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace Utils { class QtcSettings; } namespace CppEditor { @@ -88,8 +86,8 @@ private: using ClangDiagnosticConfigs = QVector<ClangDiagnosticConfig>; -ClangDiagnosticConfigs CPPEDITOR_EXPORT diagnosticConfigsFromSettings(QSettings *s); -void CPPEDITOR_EXPORT diagnosticConfigsToSettings(QSettings *s, +ClangDiagnosticConfigs CPPEDITOR_EXPORT diagnosticConfigsFromSettings(Utils::QtcSettings *s); +void CPPEDITOR_EXPORT diagnosticConfigsToSettings(Utils::QtcSettings *s, const ClangDiagnosticConfigs &configs); } // namespace CppEditor diff --git a/src/plugins/cppeditor/cppfilesettingspage.cpp b/src/plugins/cppeditor/cppfilesettingspage.cpp index 3d3014f86b1..fa314408847 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.cpp +++ b/src/plugins/cppeditor/cppfilesettingspage.cpp @@ -9,11 +9,13 @@ #include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> #include <projectexplorer/project.h> + #include <utils/fileutils.h> #include <utils/hostosinfo.h> #include <utils/layoutbuilder.h> #include <utils/mimeutils.h> #include <utils/pathchooser.h> +#include <utils/qtcsettings.h> #include <QCheckBox> #include <QComboBox> @@ -22,7 +24,6 @@ #include <QGuiApplication> #include <QLineEdit> #include <QLocale> -#include <QSettings> #include <QTextStream> #include <QVBoxLayout> @@ -49,7 +50,7 @@ const char *licenseTemplateTemplate = QT_TRANSLATE_NOOP("QtC::CppEditor", "** To protect a percent sign, use '%%'.\n" "**************************************************************************/\n"); -void CppFileSettings::toSettings(QSettings *s) const +void CppFileSettings::toSettings(QtcSettings *s) const { const CppFileSettings def; s->beginGroup(Constants::CPPEDITOR_SETTINGSGROUP); @@ -77,7 +78,7 @@ void CppFileSettings::toSettings(QSettings *s) const s->endGroup(); } -void CppFileSettings::fromSettings(QSettings *s) +void CppFileSettings::fromSettings(QtcSettings *s) { const CppFileSettings def; s->beginGroup(Constants::CPPEDITOR_SETTINGSGROUP); diff --git a/src/plugins/cppeditor/cppfilesettingspage.h b/src/plugins/cppeditor/cppfilesettingspage.h index 3232ba4d4d5..d82ca6e8bb3 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.h +++ b/src/plugins/cppeditor/cppfilesettingspage.h @@ -36,8 +36,8 @@ public: bool headerPragmaOnce = false; bool lowerCaseFiles = Constants::LOWERCASE_CPPFILES_DEFAULT; - void toSettings(QSettings *) const; - void fromSettings(QSettings *); + void toSettings(Utils::QtcSettings *) const; + void fromSettings(Utils::QtcSettings *); void addMimeInitializer() const; bool applySuffixesToMimeDB(); diff --git a/src/plugins/cppeditor/cppquickfixprojectsettings.cpp b/src/plugins/cppeditor/cppquickfixprojectsettings.cpp index 6c4c6cfbe68..3f3f4bc366b 100644 --- a/src/plugins/cppeditor/cppquickfixprojectsettings.cpp +++ b/src/plugins/cppeditor/cppquickfixprojectsettings.cpp @@ -148,7 +148,7 @@ bool CppQuickFixProjectsSettings::saveOwnSettings() if (m_settingsFile.isEmpty()) return false; - QSettings settings(m_settingsFile.toString(), QSettings::IniFormat); + QtcSettings settings(m_settingsFile.toString(), QSettings::IniFormat); if (settings.status() == QSettings::NoError) { m_ownSettings.saveSettingsTo(&settings); settings.sync(); @@ -160,7 +160,7 @@ bool CppQuickFixProjectsSettings::saveOwnSettings() void CppQuickFixProjectsSettings::loadOwnSettingsFromFile() { - QSettings settings(m_settingsFile.toString(), QSettings::IniFormat); + QtcSettings settings(m_settingsFile.toString(), QSettings::IniFormat); if (settings.status() == QSettings::NoError) { m_ownSettings.loadSettingsFrom(&settings); return; diff --git a/src/plugins/cppeditor/cppquickfixsettings.cpp b/src/plugins/cppeditor/cppquickfixsettings.cpp index 32377cc8fc9..f1992aede27 100644 --- a/src/plugins/cppeditor/cppquickfixsettings.cpp +++ b/src/plugins/cppeditor/cppquickfixsettings.cpp @@ -7,10 +7,13 @@ #include "cppeditorconstants.h" #include <coreplugin/icore.h> + #include <utils/qtcsettings.h> #include <QRegularExpression> +using namespace Utils; + namespace CppEditor { CppQuickFixSettings::CppQuickFixSettings(bool loadGlobalSettings) @@ -35,7 +38,7 @@ void CppQuickFixSettings::loadGlobalSettings() } } -void CppQuickFixSettings::loadSettingsFrom(QSettings *s) +void CppQuickFixSettings::loadSettingsFrom(QtcSettings *s) { CppQuickFixSettings def; s->beginGroup(Constants::QUICK_FIX_SETTINGS_ID); @@ -110,9 +113,8 @@ void CppQuickFixSettings::loadSettingsFrom(QSettings *s) s->endGroup(); } -void CppQuickFixSettings::saveSettingsTo(QSettings *s) +void CppQuickFixSettings::saveSettingsTo(QtcSettings *s) { - using Utils::QtcSettings; CppQuickFixSettings def; s->beginGroup(Constants::QUICK_FIX_SETTINGS_ID); QtcSettings::setValueWithDefault(s, diff --git a/src/plugins/cppeditor/cppquickfixsettings.h b/src/plugins/cppeditor/cppquickfixsettings.h index c2184289247..d0335162768 100644 --- a/src/plugins/cppeditor/cppquickfixsettings.h +++ b/src/plugins/cppeditor/cppquickfixsettings.h @@ -9,9 +9,7 @@ #include <optional> #include <vector> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace Utils { class QtcSettings; } namespace CppEditor { @@ -65,8 +63,8 @@ public: explicit CppQuickFixSettings(bool loadGlobalSettings = false); void loadGlobalSettings(); - void loadSettingsFrom(QSettings *); - void saveSettingsTo(QSettings *); + void loadSettingsFrom(Utils::QtcSettings *); + void saveSettingsTo(Utils::QtcSettings *); void saveAsGlobalSettings(); void setDefaultSettings(); diff --git a/src/plugins/cppeditor/symbolsfindfilter.cpp b/src/plugins/cppeditor/symbolsfindfilter.cpp index 54a0e6a6463..bd05107c646 100644 --- a/src/plugins/cppeditor/symbolsfindfilter.cpp +++ b/src/plugins/cppeditor/symbolsfindfilter.cpp @@ -166,22 +166,21 @@ QWidget *SymbolsFindFilter::createConfigWidget() return new SymbolsFindFilterConfigWidget(this); } -void SymbolsFindFilter::writeSettings(QSettings *settings) +void SymbolsFindFilter::writeSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String(SETTINGS_GROUP)); - settings->setValue(QLatin1String(SETTINGS_SYMBOLTYPES), int(m_symbolsToSearch)); - settings->setValue(QLatin1String(SETTINGS_SEARCHSCOPE), int(m_scope)); + settings->beginGroup(SETTINGS_GROUP); + settings->setValue(SETTINGS_SYMBOLTYPES, int(m_symbolsToSearch)); + settings->setValue(SETTINGS_SEARCHSCOPE, int(m_scope)); settings->endGroup(); } -void SymbolsFindFilter::readSettings(QSettings *settings) +void SymbolsFindFilter::readSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String(SETTINGS_GROUP)); + settings->beginGroup(SETTINGS_GROUP); m_symbolsToSearch = static_cast<SearchSymbols::SymbolTypes>( - settings->value(QLatin1String(SETTINGS_SYMBOLTYPES), - int(SearchSymbols::AllTypes)).toInt()); + settings->value(SETTINGS_SYMBOLTYPES, int(SearchSymbols::AllTypes)).toInt()); m_scope = static_cast<SearchScope>( - settings->value(QLatin1String(SETTINGS_SEARCHSCOPE), + settings->value(SETTINGS_SEARCHSCOPE, int(SymbolSearcher::SearchProjectsOnly)).toInt()); settings->endGroup(); emit symbolsToSearchChanged(); diff --git a/src/plugins/cppeditor/symbolsfindfilter.h b/src/plugins/cppeditor/symbolsfindfilter.h index a308bd93074..0cdfee87c1c 100644 --- a/src/plugins/cppeditor/symbolsfindfilter.h +++ b/src/plugins/cppeditor/symbolsfindfilter.h @@ -37,8 +37,8 @@ public: void findAll(const QString &txt, Utils::FindFlags findFlags) override; QWidget *createConfigWidget() override; - void writeSettings(QSettings *settings) override; - void readSettings(QSettings *settings) override; + void writeSettings(Utils::QtcSettings *settings) override; + void readSettings(Utils::QtcSettings *settings) override; void setSymbolsToSearch(const SearchSymbols::SymbolTypes &types) { m_symbolsToSearch = types; } SearchSymbols::SymbolTypes symbolsToSearch() const { return m_symbolsToSearch; } diff --git a/src/plugins/debugger/analyzer/startremotedialog.cpp b/src/plugins/debugger/analyzer/startremotedialog.cpp index f5e6fad3fe2..3e7ec624cf1 100644 --- a/src/plugins/debugger/analyzer/startremotedialog.cpp +++ b/src/plugins/debugger/analyzer/startremotedialog.cpp @@ -67,7 +67,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent) verticalLayout->addLayout(formLayout); verticalLayout->addWidget(d->buttonBox); - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup("AnalyzerStartRemoteDialog"); d->kitChooser->populate(); d->kitChooser->setCurrentKitId(Id::fromSetting(settings->value("profile"))); @@ -93,7 +93,7 @@ StartRemoteDialog::~StartRemoteDialog() void StartRemoteDialog::accept() { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup("AnalyzerStartRemoteDialog"); settings->setValue("profile", d->kitChooser->currentKitId().toString()); settings->setValue("executable", d->executable->text()); diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 1c414367add..53696f8e910 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -2709,7 +2709,7 @@ void BreakpointManager::executeDeleteAllBreakpointsDialog() Tr::tr("Remove All Breakpoints"), Tr::tr("Are you sure you want to remove all breakpoints " "from all files in the current session?"), - QString("RemoveAllBreakpoints")); + Key("RemoveAllBreakpoints")); if (pressed != QMessageBox::Yes) return; diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 54aa3f6ca17..7d126701d80 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -2264,7 +2264,7 @@ void CdbEngine::checkQtSdkPdbFiles(const QString &module) CheckableMessageBox::information(Core::ICore::dialogParent(), Tr::tr("Missing Qt Debug Information"), message, - QString("CdbQtSdkPdbHint")); + Key("CdbQtSdkPdbHint")); showMessage("Missing Qt Debug Information Files package for " + qtName, LogMisc); }; @@ -2292,7 +2292,7 @@ void CdbEngine::parseOutputLine(QString line) "Make sure that your antivirus solution is up to date and if that does not work " "consider adding an exception for \"%1\".") .arg(m_extensionFileName), - QString("SecureInfoCdbextCannotBeLoaded")); + Key("SecureInfoCdbextCannotBeLoaded")); notifyEngineSetupFailed(); } static const QString creatorExtPrefix = "<qtcreatorcdbext>|"; diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index a222432887b..2b8278b01e0 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -86,8 +86,8 @@ class StartApplicationParameters public: QString displayName() const; bool equals(const StartApplicationParameters &rhs) const; - void toSettings(QSettings *) const; - void fromSettings(const QSettings *settings); + void toSettings(QtcSettings *) const; + void fromSettings(const QtcSettings *settings); bool operator==(const StartApplicationParameters &p) const { return equals(p); } bool operator!=(const StartApplicationParameters &p) const { return !equals(p); } @@ -140,7 +140,7 @@ QString StartApplicationParameters::displayName() const return name; } -void StartApplicationParameters::toSettings(QSettings *settings) const +void StartApplicationParameters::toSettings(QtcSettings *settings) const { settings->setValue("LastKitId", kitId.toSetting()); settings->setValue("LastServerPort", serverPort); @@ -157,7 +157,7 @@ void StartApplicationParameters::toSettings(QSettings *settings) const settings->setValue("LastSysRoot", sysRoot.toSettings()); } -void StartApplicationParameters::fromSettings(const QSettings *settings) +void StartApplicationParameters::fromSettings(const QtcSettings *settings) { kitId = Id::fromSetting(settings->value("LastKitId")); serverPort = settings->value("LastServerPort").toUInt(); @@ -344,11 +344,11 @@ void StartApplicationDialog::updateState() void StartApplicationDialog::run(bool attachRemote) { - const QString settingsGroup = "DebugMode"; + const Key settingsGroup = "DebugMode"; const QString arrayName = "StartApplication"; QList<StartApplicationParameters> history; - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); settings->beginGroup(settingsGroup); if (const int arraySize = settings->beginReadArray(arrayName)) { for (int i = 0; i < arraySize; ++i) { diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index a4751628ec1..9568c685533 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -607,7 +607,7 @@ void DebuggerEnginePrivate::setupViews() connect(&m_locationTimer, &QTimer::timeout, this, &DebuggerEnginePrivate::resetLocation); - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); m_modulesView = new BaseTreeView; m_modulesView->setModel(m_modulesHandler.model()); @@ -2730,7 +2730,7 @@ Context CppDebuggerEngine::languageContext() const void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp) { - static const QString warnOnInappropriateDebuggerKey = "DebuggerWarnOnInappropriateDebugger"; + static const Key warnOnInappropriateDebuggerKey = "DebuggerWarnOnInappropriateDebugger"; const bool warnOnRelease = settings().warnOnReleaseBuilds() && rp.toolChainAbi.osFlavor() != Abi::AndroidLinuxFlavor; diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index fbe3c8079ab..8949322d0e9 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -399,7 +399,7 @@ void DebuggerMainWindow::enterDebugMode() if (theMainWindow->d->needRestoreOnModeEnter) theMainWindow->restorePersistentSettings(); - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); const QString lastPerspectiveId = settings->value(LAST_PERSPECTIVE_KEY).toString(); Perspective *perspective = Perspective::findPerspective(lastPerspectiveId); // If we don't find a perspective with the stored name, pick any. @@ -440,7 +440,7 @@ void DebuggerMainWindow::leaveDebugMode() void DebuggerMainWindow::restorePersistentSettings() { qCDebug(perspectivesLog) << "RESTORE ALL PERSPECTIVES"; - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); settings->beginGroup(MAINWINDOW_KEY); // state2 is current, state is kept for upgradeing from <=4.10 @@ -488,7 +488,7 @@ void DebuggerMainWindow::savePersistentSettings() const states.insert(type, QVariant::fromValue(state)); } - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); settings->beginGroup(MAINWINDOW_KEY); settings->setValue(CHANGED_DOCK_KEY, QStringList(Utils::toList(d->m_persistentChangedDocks))); settings->setValue(STATE_KEY2, states); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index f2c8c59de2f..d48a024f440 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -2362,7 +2362,7 @@ bool wantRunTool(ToolMode toolMode, const QString &toolName) if (Utils::CheckableMessageBox::question(ICore::dialogParent(), title, message, - QString("AnalyzerCorrectModeWarning")) + Key("AnalyzerCorrectModeWarning")) != QMessageBox::Yes) return false; } diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 5242ebfc2d2..cb0f6064168 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -491,11 +491,11 @@ const char sourcePathMappingTargetKeyC[] = "Target"; void SourcePathMapAspect::writeSettings() const { const SourcePathMap sourcePathMap = value(); - QSettings *s = qtcSettings(); + QtcSettings *s = qtcSettings(); s->beginWriteArray(sourcePathMappingArrayNameC); if (!sourcePathMap.isEmpty()) { - const QString sourcePathMappingSourceKey(sourcePathMappingSourceKeyC); - const QString sourcePathMappingTargetKey(sourcePathMappingTargetKeyC); + const Key sourcePathMappingSourceKey(sourcePathMappingSourceKeyC); + const Key sourcePathMappingTargetKey(sourcePathMappingTargetKeyC); int i = 0; for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd(); it != cend; @@ -510,11 +510,11 @@ void SourcePathMapAspect::writeSettings() const void SourcePathMapAspect::readSettings() { - QSettings *s = qtcSettings(); + QtcSettings *s = qtcSettings(); SourcePathMap sourcePathMap; if (const int count = s->beginReadArray(sourcePathMappingArrayNameC)) { - const QString sourcePathMappingSourceKey(sourcePathMappingSourceKeyC); - const QString sourcePathMappingTargetKey(sourcePathMappingTargetKeyC); + const Key sourcePathMappingSourceKey(sourcePathMappingSourceKeyC); + const Key sourcePathMappingTargetKey(sourcePathMappingTargetKeyC); for (int i = 0; i < count; ++i) { s->setArrayIndex(i); const QString key = s->value(sourcePathMappingSourceKey).toString(); diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index aebf092e8d9..08160e22dd8 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -2573,7 +2573,7 @@ void WatchModel::clearWatches() ICore::dialogParent(), Tr::tr("Remove All Expression Evaluators"), Tr::tr("Are you sure you want to remove all expression evaluators?"), - QString("RemoveAllWatchers")); + Key("RemoveAllWatchers")); if (ret != QMessageBox::Yes) return; diff --git a/src/plugins/designer/formeditor.cpp b/src/plugins/designer/formeditor.cpp index 090f01cf6ef..776e74f0f90 100644 --- a/src/plugins/designer/formeditor.cpp +++ b/src/plugins/designer/formeditor.cpp @@ -28,6 +28,7 @@ #include <utils/infobar.h> #include <utils/qtcassert.h> +#include <utils/qtcsettings.h> #include <utils/stringutils.h> #include <utils/theme/theme.h> @@ -44,23 +45,21 @@ #include <QActionGroup> #include <QApplication> #include <QCursor> +#include <QDebug> #include <QDockWidget> +#include <QElapsedTimer> +#include <QKeySequence> #include <QMenu> #include <QMessageBox> -#include <QKeySequence> +#include <QPainter> +#include <QPluginLoader> #include <QPrintDialog> #include <QPrinter> -#include <QPainter> #include <QStyle> +#include <QTime> #include <QToolBar> #include <QVBoxLayout> -#include <QDebug> -#include <QSettings> -#include <QPluginLoader> -#include <QTime> -#include <QElapsedTimer> - #include <algorithm> static const char settingsGroupC[] = "Designer"; @@ -145,7 +144,7 @@ public: void fullInit(); - void saveSettings(QSettings *s); + void saveSettings(QtcSettings *s); void initDesignerSubWindows(); @@ -283,7 +282,7 @@ FormEditorData::FormEditorData() FormEditorData::~FormEditorData() { if (m_initStage == FullyInitialized) { - QSettings *s = ICore::settings(); + QtcSettings *s = ICore::settings(); s->beginGroup(settingsGroupC); m_editorWidget->saveSettings(s); s->endGroup(); @@ -400,7 +399,7 @@ void FormEditorData::fullInit() // Nest toolbar and editor widget m_editorWidget = new EditorWidget; - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); settings->beginGroup(settingsGroupC); m_editorWidget->restoreSettings(settings); settings->endGroup(); @@ -702,7 +701,7 @@ void FormEditorData::setPreviewMenuEnabled(bool e) m_previewInStyleMenu->setEnabled(e); } -void FormEditorData::saveSettings(QSettings *s) +void FormEditorData::saveSettings(QtcSettings *s) { s->beginGroup(settingsGroupC); m_editorWidget->saveSettings(s); diff --git a/src/plugins/diffeditor/diffeditor.cpp b/src/plugins/diffeditor/diffeditor.cpp index ddf91b4e1ec..d202fb4338a 100644 --- a/src/plugins/diffeditor/diffeditor.cpp +++ b/src/plugins/diffeditor/diffeditor.cpp @@ -518,7 +518,7 @@ void DiffEditor::toggleSync() IDiffView *DiffEditor::loadSettings() { QTC_ASSERT(currentView(), return nullptr); - QSettings *s = ICore::settings(); + QtcSettings *s = ICore::settings(); // Read current settings: s->beginGroup(settingsGroupC); @@ -537,9 +537,9 @@ IDiffView *DiffEditor::loadSettings() return view; } -void DiffEditor::saveSetting(const QString &key, const QVariant &value) const +void DiffEditor::saveSetting(const Key &key, const QVariant &value) const { - QSettings *s = ICore::settings(); + QtcSettings *s = ICore::settings(); s->beginGroup(settingsGroupC); s->setValue(key, value); s->endGroup(); diff --git a/src/plugins/diffeditor/diffeditor.h b/src/plugins/diffeditor/diffeditor.h index 0bf3d52c6d1..3bf270b5248 100644 --- a/src/plugins/diffeditor/diffeditor.h +++ b/src/plugins/diffeditor/diffeditor.h @@ -59,7 +59,7 @@ private: void toggleSync(); IDiffView *loadSettings(); - void saveSetting(const QString &key, const QVariant &value) const; + void saveSetting(const Utils::Key &key, const QVariant &value) const; void updateEntryToolTip(); void showDiffView(IDiffView *view); void updateDiffEditorSwitcher(); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index dffae9b45cd..496fdd786f6 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -636,7 +636,7 @@ void FakeVimExCommandsMappings::apply() if (newMapping != globalCommandMapping) { const ExCommandMap &defaultMap = dd->m_defaultExCommandMap; - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); settings->beginWriteArray(exCommandMapGroup); int count = 0; using Iterator = ExCommandMap::const_iterator; @@ -776,7 +776,7 @@ private: UserCommandMap &userMap = dd->m_userCommandMap; if (current != userMap) { - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); settings->beginWriteArray(userCommandMapGroup); int count = 0; using Iterator = UserCommandMap::const_iterator; @@ -1146,7 +1146,7 @@ void FakeVimPluginPrivate::createRelativeNumberWidget(IEditor *editor) void FakeVimPluginPrivate::readSettings() { - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); m_exCommandMap = m_defaultExCommandMap; int size = settings->beginReadArray(exCommandMapGroup); diff --git a/src/plugins/git/gerrit/gerritparameters.cpp b/src/plugins/git/gerrit/gerritparameters.cpp index ace85a81c47..781597e5e78 100644 --- a/src/plugins/git/gerrit/gerritparameters.cpp +++ b/src/plugins/git/gerrit/gerritparameters.cpp @@ -8,9 +8,9 @@ #include <utils/environment.h> #include <utils/hostosinfo.h> #include <utils/pathchooser.h> +#include <utils/qtcsettings.h> #include <QDir> -#include <QSettings> #include <QStandardPaths> using namespace Utils; @@ -86,7 +86,7 @@ bool GerritParameters::equals(const GerritParameters &rhs) const return server == rhs.server && ssh == rhs.ssh && curl == rhs.curl && https == rhs.https; } -void GerritParameters::toSettings(QSettings *s) const +void GerritParameters::toSettings(QtcSettings *s) const { s->beginGroup(settingsGroupC); s->setValue(hostKeyC, server.host); @@ -99,16 +99,16 @@ void GerritParameters::toSettings(QSettings *s) const s->endGroup(); } -void GerritParameters::saveQueries(QSettings *s) const +void GerritParameters::saveQueries(QtcSettings *s) const { s->beginGroup(settingsGroupC); s->setValue(savedQueriesKeyC, savedQueries.join(',')); s->endGroup(); } -void GerritParameters::fromSettings(const QSettings *s) +void GerritParameters::fromSettings(const QtcSettings *s) { - const QString rootKey = QLatin1String(settingsGroupC) + '/'; + const Key rootKey = Key(settingsGroupC) + '/'; server.host = s->value(rootKey + hostKeyC, GerritServer::defaultHost()).toString(); server.user.userName = s->value(rootKey + userKeyC, QString()).toString(); ssh = FilePath::fromSettings(s->value(rootKey + sshKeyC, QString())); diff --git a/src/plugins/git/gerrit/gerritparameters.h b/src/plugins/git/gerrit/gerritparameters.h index 38a65778853..81644dcfa39 100644 --- a/src/plugins/git/gerrit/gerritparameters.h +++ b/src/plugins/git/gerrit/gerritparameters.h @@ -7,9 +7,7 @@ #include <utils/filepath.h> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace Utils { class QtcSettings; } namespace Gerrit { namespace Internal { @@ -21,9 +19,9 @@ public: bool isValid() const; bool equals(const GerritParameters &rhs) const; - void toSettings(QSettings *) const; - void saveQueries(QSettings *) const; - void fromSettings(const QSettings *); + void toSettings(Utils::QtcSettings *) const; + void saveQueries(Utils::QtcSettings *) const; + void fromSettings(const Utils::QtcSettings *); void setPortFlagBySshType(); friend bool operator==(const GerritParameters &p1, const GerritParameters &p2) diff --git a/src/plugins/git/gerrit/gerritserver.cpp b/src/plugins/git/gerrit/gerritserver.cpp index a91c963d6a4..2bcb305853b 100644 --- a/src/plugins/git/gerrit/gerritserver.cpp +++ b/src/plugins/git/gerrit/gerritserver.cpp @@ -170,8 +170,8 @@ bool GerritServer::fillFromRemote(const QString &remote, GerritServer::StoredHostValidity GerritServer::loadSettings() { StoredHostValidity validity = Invalid; - QSettings *settings = Core::ICore::settings(); - settings->beginGroup("Gerrit/" + host); + QtcSettings *settings = Core::ICore::settings(); + settings->beginGroup("Gerrit/" + keyFromString(host)); if (!settings->value(isGerritKey, true).toBool()) { validity = NotGerrit; } else if (settings->contains(isAuthenticatedKey)) { @@ -188,8 +188,8 @@ GerritServer::StoredHostValidity GerritServer::loadSettings() void GerritServer::saveSettings(StoredHostValidity validity) const { - QSettings *settings = Core::ICore::settings(); - settings->beginGroup("Gerrit/" + host); + QtcSettings *settings = Core::ICore::settings(); + settings->beginGroup("Gerrit/" + keyFromString(host)); switch (validity) { case NotGerrit: settings->setValue(isGerritKey, false); @@ -310,8 +310,8 @@ bool GerritServer::resolveRoot() bool GerritServer::resolveVersion(const GerritParameters &p, bool forceReload) { - QSettings *settings = Core::ICore::settings(); - const QString fullVersionKey = "Gerrit/" + host + '/' + versionKey; + QtcSettings *settings = Core::ICore::settings(); + const Key fullVersionKey = "Gerrit/" + keyFromString(host) + '/' + versionKey; version = settings->value(fullVersionKey).toString(); if (!version.isEmpty() && !forceReload) return true; diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index ad6c667428f..3b561368f0e 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1280,7 +1280,7 @@ QStringList GitClient::setupCheckoutArguments(const FilePath &workingDirectory, ICore::dialogParent() /*parent*/, Tr::tr("Create Local Branch") /*title*/, Tr::tr("Would you like to create a local branch?") /*message*/, - QString("Git.CreateLocalBranchOnCheckout"), /* decider */ + Key("Git.CreateLocalBranchOnCheckout"), /* decider */ QMessageBox::Yes | QMessageBox::No /*buttons*/, QMessageBox::No /*default button*/, QMessageBox::No /*button to save*/) diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index c82226fa83b..4d05afffda0 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -246,12 +246,12 @@ GitGrepParameters GitGrep::gitParameters() const return {m_treeLineEdit->text(), m_recurseSubmodules && m_recurseSubmodules->isChecked()}; } -void GitGrep::readSettings(QSettings *settings) +void GitGrep::readSettings(QtcSettings *settings) { m_treeLineEdit->setText(settings->value(GitGrepRef).toString()); } -void GitGrep::writeSettings(QSettings *settings) const +void GitGrep::writeSettings(QtcSettings *settings) const { settings->setValue(GitGrepRef, m_treeLineEdit->text()); } diff --git a/src/plugins/git/gitgrep.h b/src/plugins/git/gitgrep.h index 2f74cfa3322..bb6967eb675 100644 --- a/src/plugins/git/gitgrep.h +++ b/src/plugins/git/gitgrep.h @@ -24,8 +24,8 @@ public: QString title() const override; QString toolTip() const override; QWidget *widget() const override; - void readSettings(QSettings *settings) override; - void writeSettings(QSettings *settings) const override; + void readSettings(Utils::QtcSettings *settings) override; + void writeSettings(Utils::QtcSettings *settings) const override; TextEditor::SearchExecutor searchExecutor() const override; TextEditor::EditorOpener editorOpener() const override; diff --git a/src/plugins/gitlab/gitlabparameters.cpp b/src/plugins/gitlab/gitlabparameters.cpp index 79a6ce7da67..c501c23b9fd 100644 --- a/src/plugins/gitlab/gitlabparameters.cpp +++ b/src/plugins/gitlab/gitlabparameters.cpp @@ -5,6 +5,7 @@ #include <utils/algorithm.h> #include <utils/hostosinfo.h> +#include <utils/qtcsettings.h> #include <QFile> #include <QJsonArray> @@ -13,6 +14,8 @@ #include <QSettings> #include <QStandardPaths> +using namespace Utils; + namespace GitLab { const char settingsGroupC[] = "GitLab"; @@ -153,13 +156,13 @@ static QList<GitLabServer> readTokensFile(const Utils::FilePath &filePath) return result; } -static Utils::FilePath tokensFilePath(const QSettings *s) +static FilePath tokensFilePath(const QtcSettings *s) { - return Utils::FilePath::fromString(s->fileName()).parentDir() + return FilePath::fromString(s->fileName()).parentDir() .pathAppended("/qtcreator/gitlabtokens.json"); } -void GitLabParameters::toSettings(QSettings *s) const +void GitLabParameters::toSettings(QtcSettings *s) const { writeTokensFile(tokensFilePath(s), gitLabServers); @@ -169,11 +172,11 @@ void GitLabParameters::toSettings(QSettings *s) const s->endGroup(); } -void GitLabParameters::fromSettings(const QSettings *s) +void GitLabParameters::fromSettings(const QtcSettings *s) { - const QString rootKey = QLatin1String(settingsGroupC) + '/'; - curl = Utils::FilePath::fromSettings(s->value(rootKey + curlKeyC)); - defaultGitLabServer = Utils::Id::fromSetting(s->value(rootKey + defaultUuidKeyC)); + const Key rootKey = Key(settingsGroupC) + '/'; + curl = FilePath::fromSettings(s->value(rootKey + curlKeyC)); + defaultGitLabServer = Id::fromSetting(s->value(rootKey + defaultUuidKeyC)); gitLabServers = readTokensFile(tokensFilePath(s)); diff --git a/src/plugins/gitlab/gitlabparameters.h b/src/plugins/gitlab/gitlabparameters.h index 7a21976dc24..7dcd6d9dafb 100644 --- a/src/plugins/gitlab/gitlabparameters.h +++ b/src/plugins/gitlab/gitlabparameters.h @@ -7,10 +7,11 @@ #include <utils/id.h> QT_BEGIN_NAMESPACE -class QSettings; class QJsonObject; QT_END_NAMESPACE +namespace Utils { class QtcSettings; } + namespace GitLab { class GitLabServer @@ -49,8 +50,8 @@ public: bool equals(const GitLabParameters &other) const; bool isValid() const; - void toSettings(QSettings *s) const; - void fromSettings(const QSettings *s); + void toSettings(Utils::QtcSettings *s) const; + void fromSettings(const Utils::QtcSettings *s); GitLabServer currentDefaultServer() const; GitLabServer serverForId(const Utils::Id &id) const; diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 2879d57dd5e..d693c9973e8 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -47,6 +47,7 @@ #include <utils/qtcassert.h> #include <utils/styledbar.h> #include <utils/stringutils.h> +#include <utils/qtcsettings.h> #include <utils/theme/theme.h> #include <utils/tooltip/tooltip.h> @@ -354,7 +355,7 @@ HelpViewer *HelpPluginPrivate::externalHelpViewer() m_externalWindow = createHelpWidget(Context(Constants::C_HELP_EXTERNAL), HelpWidget::ExternalWindow); if (m_externalWindowState.isNull()) { - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); m_externalWindowState = settings->value(kExternalWindowStateKey).toRect(); } if (m_externalWindowState.isNull()) diff --git a/src/plugins/help/localhelpmanager.cpp b/src/plugins/help/localhelpmanager.cpp index d17a3e83949..bfa827b3319 100644 --- a/src/plugins/help/localhelpmanager.cpp +++ b/src/plugins/help/localhelpmanager.cpp @@ -137,7 +137,7 @@ void LocalHelpManager::setHomePage(const QString &page) QFont LocalHelpManager::fallbackFont() { - QSettings *settings = Core::ICore::settings(); + Utils::QtcSettings *settings = Core::ICore::settings(); const QString family = settings->value(kFontFamilyKey, defaultFallbackFontFamily()).toString(); const int size = settings->value(kFontSizeKey, kDefaultFallbackFontSize).toInt(); QFont font(family, size); diff --git a/src/plugins/imageviewer/multiexportdialog.cpp b/src/plugins/imageviewer/multiexportdialog.cpp index 1b526c9b11f..1a22598d267 100644 --- a/src/plugins/imageviewer/multiexportdialog.cpp +++ b/src/plugins/imageviewer/multiexportdialog.cpp @@ -104,27 +104,27 @@ static FilePath fileNameForSize(QString pattern, const QSize &s) // Helpers for writing/reading the user-specified size specifications // from/to the settings. -static inline QString settingsGroup() { return QStringLiteral("ExportSvgSizes"); } +static Key settingsGroup() { return "ExportSvgSizes"; } static QVector<QSize> readSettings(const QSize &size) { QVector<QSize> result; - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(settingsGroup()); const QStringList keys = settings->allKeys(); const int idx = keys.indexOf(sizeToString(size)); if (idx >= 0) - result = stringToSizes(settings->value(keys.at(idx)).toString()); + result = stringToSizes(settings->value(keyFromString(keys.at(idx))).toString()); settings->endGroup(); return result; } static void writeSettings(const QSize &size, const QString &sizeSpec) { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(settingsGroup()); const QString spec = sizeToString(size); - settings->setValue(spec, QVariant(sizeSpec)); + settings->setValue(keyFromString(spec), QVariant(sizeSpec)); // Limit the number of sizes to 10. Remove the // first element unless it is the newly added spec. @@ -132,7 +132,7 @@ static void writeSettings(const QSize &size, const QString &sizeSpec) while (keys.size() > 10) { const int existingIndex = keys.indexOf(spec); const int removeIndex = existingIndex == 0 ? 1 : 0; - settings->remove(keys.takeAt(removeIndex)); + settings->remove(keyFromString(keys.takeAt(removeIndex))); } settings->endGroup(); } diff --git a/src/plugins/ios/iosconfigurations.cpp b/src/plugins/ios/iosconfigurations.cpp index 545cf85bc8f..04ab69b8a25 100644 --- a/src/plugins/ios/iosconfigurations.cpp +++ b/src/plugins/ios/iosconfigurations.cpp @@ -365,7 +365,7 @@ QVersionNumber IosConfigurations::xcodeVersion() void IosConfigurations::save() { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(SettingsGroup); settings->setValue(ignoreAllDevicesKey, m_ignoreAllDevices); settings->setValue(screenshotDirPathKey, m_screenshotDir.toString()); @@ -382,7 +382,7 @@ IosConfigurations::IosConfigurations(QObject *parent) void IosConfigurations::load() { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(SettingsGroup); m_ignoreAllDevices = settings->value(ignoreAllDevicesKey, false).toBool(); m_screenshotDir = FilePath::fromString(settings->value(screenshotDirPathKey).toString()); diff --git a/src/plugins/mcusupport/settingshandler.cpp b/src/plugins/mcusupport/settingshandler.cpp index 26fcbfb0ae8..2bae687cfc8 100644 --- a/src/plugins/mcusupport/settingshandler.cpp +++ b/src/plugins/mcusupport/settingshandler.cpp @@ -68,13 +68,13 @@ void SettingsHandler::setAutomaticKitCreation(bool isEnabled) void SettingsHandler::setInitialPlatformName(const QString &platform) { - QSettings *settings = Core::ICore::settings(QSettings::UserScope); + QtcSettings *settings = Core::ICore::settings(QSettings::UserScope); settings->setValue(Constants::SETTINGS_KEY_INITIAL_PLATFORM_KEY, platform); } QString SettingsHandler::initialPlatformName() const { - QSettings *settings = Core::ICore::settings(QSettings::UserScope); + QtcSettings *settings = Core::ICore::settings(QSettings::UserScope); const QString name = settings->value(Constants::SETTINGS_KEY_INITIAL_PLATFORM_KEY, "").toString(); return name; diff --git a/src/plugins/modeleditor/modeleditor_plugin.cpp b/src/plugins/modeleditor/modeleditor_plugin.cpp index 4cdbf85a749..aa98ae10f66 100644 --- a/src/plugins/modeleditor/modeleditor_plugin.cpp +++ b/src/plugins/modeleditor/modeleditor_plugin.cpp @@ -65,9 +65,9 @@ void ModelEditorPlugin::initialize() Core::JsExpander::registerGlobalObject<JsExtension>("Modeling"); connect(&d->settingsController, &SettingsController::saveSettings, - &d->uiController, &UiController::saveSettings); + &d->uiController, [this](Utils::QtcSettings *s) { d->uiController.saveSettings(s); }); connect(&d->settingsController, &SettingsController::loadSettings, - &d->uiController, &UiController::loadSettings); + &d->uiController, [this](Utils::QtcSettings *s) { d->uiController.loadSettings(s); }); } void ModelEditorPlugin::extensionsInitialized() diff --git a/src/plugins/modeleditor/settingscontroller.cpp b/src/plugins/modeleditor/settingscontroller.cpp index d4f9424af9f..5bb9b5ff101 100644 --- a/src/plugins/modeleditor/settingscontroller.cpp +++ b/src/plugins/modeleditor/settingscontroller.cpp @@ -5,7 +5,9 @@ #include "modeleditor_constants.h" -#include <QSettings> +#include <utils/qtcsettings.h> + +using namespace Utils; namespace ModelEditor { namespace Internal { @@ -19,17 +21,17 @@ void SettingsController::reset() emit resetSettings(); } -void SettingsController::save(QSettings *settings) +void SettingsController::save(QtcSettings *settings) { - settings->beginGroup(QLatin1String(Constants::SETTINGS_GROUP)); + settings->beginGroup(Constants::SETTINGS_GROUP); emit saveSettings(settings); settings->endGroup(); settings->sync(); } -void SettingsController::load(QSettings *settings) +void SettingsController::load(QtcSettings *settings) { - settings->beginGroup(QLatin1String(Constants::SETTINGS_GROUP)); + settings->beginGroup(Constants::SETTINGS_GROUP); emit loadSettings(settings); settings->endGroup(); } diff --git a/src/plugins/modeleditor/settingscontroller.h b/src/plugins/modeleditor/settingscontroller.h index 6efc7063b37..d0d4f496b78 100644 --- a/src/plugins/modeleditor/settingscontroller.h +++ b/src/plugins/modeleditor/settingscontroller.h @@ -5,15 +5,12 @@ #include <QObject> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace Utils { class QtcSettings; } namespace ModelEditor { namespace Internal { -class SettingsController : - public QObject +class SettingsController : public QObject { Q_OBJECT @@ -22,13 +19,13 @@ public: signals: void resetSettings(); - void saveSettings(QSettings *settings); - void loadSettings(QSettings *settings); + void saveSettings(Utils::QtcSettings *settings); + void loadSettings(Utils::QtcSettings *settings); public: void reset(); - void save(QSettings *settings); - void load(QSettings *settings); + void save(Utils::QtcSettings *settings); + void load(Utils::QtcSettings *settings); }; } // namespace Internal diff --git a/src/plugins/modeleditor/uicontroller.cpp b/src/plugins/modeleditor/uicontroller.cpp index 8584b09b0f0..f354cf3c535 100644 --- a/src/plugins/modeleditor/uicontroller.cpp +++ b/src/plugins/modeleditor/uicontroller.cpp @@ -5,7 +5,9 @@ #include "modeleditor_constants.h" -#include <QSettings> +#include <utils/qtcsettings.h> + +using namespace Utils; namespace ModelEditor { namespace Internal { @@ -59,28 +61,21 @@ void UiController::onRightHorizSplitterChanged(const QByteArray &state) emit rightHorizSplitterChanged(state); } -void UiController::saveSettings(QSettings *settings) +void UiController::saveSettings(QtcSettings *settings) { - if (hasRightSplitterState()) { - settings->setValue( - QLatin1String(Constants::SETTINGS_RIGHT_SPLITTER), d->rightSplitterState); - } - if (hasRightHorizSplitterState()) { - settings->setValue( - QLatin1String(Constants::SETTINGS_RIGHT_HORIZ_SPLITTER), - d->rightHorizSplitterState); - } + if (hasRightSplitterState()) + settings->setValue(Constants::SETTINGS_RIGHT_SPLITTER, d->rightSplitterState); + if (hasRightHorizSplitterState()) + settings->setValue(Constants::SETTINGS_RIGHT_HORIZ_SPLITTER, d->rightHorizSplitterState); } -void UiController::loadSettings(QSettings *settings) +void UiController::loadSettings(QtcSettings *settings) { - if (settings->contains(QLatin1String(Constants::SETTINGS_RIGHT_SPLITTER))) { - d->rightSplitterState = settings->value( - QLatin1String(Constants::SETTINGS_RIGHT_SPLITTER)).toByteArray(); - } - if (settings->contains(QLatin1String(Constants::SETTINGS_RIGHT_HORIZ_SPLITTER))) { - d->rightHorizSplitterState = settings->value( - QLatin1String(Constants::SETTINGS_RIGHT_HORIZ_SPLITTER)).toByteArray(); + if (settings->contains(Constants::SETTINGS_RIGHT_SPLITTER)) + d->rightSplitterState = settings->value(Constants::SETTINGS_RIGHT_SPLITTER).toByteArray(); + if (settings->contains(Constants::SETTINGS_RIGHT_HORIZ_SPLITTER)) { + d->rightHorizSplitterState = settings->value(Constants::SETTINGS_RIGHT_HORIZ_SPLITTER) + .toByteArray(); } } diff --git a/src/plugins/modeleditor/uicontroller.h b/src/plugins/modeleditor/uicontroller.h index ce68f65322a..44155a6eaee 100644 --- a/src/plugins/modeleditor/uicontroller.h +++ b/src/plugins/modeleditor/uicontroller.h @@ -5,15 +5,12 @@ #include <QObject> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace Utils { class QtcSettings; } namespace ModelEditor { namespace Internal { -class UiController : - public QObject +class UiController : public QObject { Q_OBJECT class UiControllerPrivate; @@ -34,8 +31,8 @@ public: void onRightSplitterChanged(const QByteArray &state); void onRightHorizSplitterChanged(const QByteArray &state); - void saveSettings(QSettings *settings); - void loadSettings(QSettings *settings); + void saveSettings(Utils::QtcSettings *settings); + void loadSettings(Utils::QtcSettings *settings); private: UiControllerPrivate *d; diff --git a/src/plugins/perfprofiler/perfprofilertool.cpp b/src/plugins/perfprofiler/perfprofilertool.cpp index 9c9e9d5ec54..6951622e52b 100644 --- a/src/plugins/perfprofiler/perfprofilertool.cpp +++ b/src/plugins/perfprofiler/perfprofilertool.cpp @@ -213,12 +213,11 @@ void PerfProfilerTool::createViews() m_flameGraphView, &PerfProfilerFlameGraphView::selectByTypeId); // Clear settings if the statistics or flamegraph view isn't there yet. - QSettings *settings = Core::ICore::settings(); - settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + - QLatin1String(Constants::PerfProfilerPerspectiveId)); - if (!settings->contains(m_statisticsView->objectName()) - || !settings->contains(m_flameGraphView->objectName())) { - settings->remove(QString()); + QtcSettings *settings = Core::ICore::settings(); + settings->beginGroup(Key("AnalyzerViewSettings_") + Constants::PerfProfilerPerspectiveId); + if (!settings->contains(keyFromString(m_statisticsView->objectName())) + || !settings->contains(keyFromString(m_flameGraphView->objectName()))) { + settings->remove(Key()); } settings->endGroup(); diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp index a4163193994..1c8f4c9d94a 100644 --- a/src/plugins/projectexplorer/allprojectsfind.cpp +++ b/src/plugins/projectexplorer/allprojectsfind.cpp @@ -14,6 +14,7 @@ #include <texteditor/textdocument.h> #include <utils/algorithm.h> +#include <utils/qtcsettings.h> #include <QGridLayout> #include <QSettings> @@ -113,16 +114,16 @@ QWidget *AllProjectsFind::createConfigWidget() return m_configWidget; } -void AllProjectsFind::writeSettings(QSettings *settings) +void AllProjectsFind::writeSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String("AllProjectsFind")); + settings->beginGroup("AllProjectsFind"); writeCommonSettings(settings); settings->endGroup(); } -void AllProjectsFind::readSettings(QSettings *settings) +void AllProjectsFind::readSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String("AllProjectsFind")); + settings->beginGroup("AllProjectsFind"); readCommonSettings(settings, "*", ""); settings->endGroup(); } diff --git a/src/plugins/projectexplorer/allprojectsfind.h b/src/plugins/projectexplorer/allprojectsfind.h index d3fcd536d57..02dfc2a27ae 100644 --- a/src/plugins/projectexplorer/allprojectsfind.h +++ b/src/plugins/projectexplorer/allprojectsfind.h @@ -26,8 +26,8 @@ public: bool isEnabled() const override; QWidget *createConfigWidget() override; - void writeSettings(QSettings *settings) override; - void readSettings(QSettings *settings) override; + void writeSettings(Utils::QtcSettings *settings) override; + void readSettings(Utils::QtcSettings *settings) override; protected: static Utils::FileContainer filesForProjects(const QStringList &nameFilters, diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 13f3d2e5d3c..9bea0e0d842 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -536,8 +536,8 @@ void AppOutputPane::storeSettings() const void AppOutputPane::loadSettings() { - QSettings * const s = Core::ICore::settings(); - const auto modeFromSettings = [s](const QString key, AppOutputPaneMode defaultValue) { + QtcSettings * const s = Core::ICore::settings(); + const auto modeFromSettings = [s](const Key key, AppOutputPaneMode defaultValue) { return static_cast<AppOutputPaneMode>(s->value(key, int(defaultValue)).toInt()); }; m_settings.runOutputMode = modeFromSettings(POP_UP_FOR_RUN_OUTPUT_KEY, kRunOutputModeDefault); diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index 43d709d7661..fe95d318313 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -9,8 +9,7 @@ #include "projecttree.h" #include <utils/qtcassert.h> - -#include <QSettings> +#include <utils/qtcsettings.h> using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; @@ -93,16 +92,16 @@ void CurrentProjectFind::setupSearch(Core::SearchResult *search) }); } -void CurrentProjectFind::writeSettings(QSettings *settings) +void CurrentProjectFind::writeSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String("CurrentProjectFind")); + settings->beginGroup("CurrentProjectFind"); writeCommonSettings(settings); settings->endGroup(); } -void CurrentProjectFind::readSettings(QSettings *settings) +void CurrentProjectFind::readSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String("CurrentProjectFind")); + settings->beginGroup("CurrentProjectFind"); readCommonSettings(settings, "*", ""); settings->endGroup(); } diff --git a/src/plugins/projectexplorer/currentprojectfind.h b/src/plugins/projectexplorer/currentprojectfind.h index c9ed8cdba33..c9081bcd9f9 100644 --- a/src/plugins/projectexplorer/currentprojectfind.h +++ b/src/plugins/projectexplorer/currentprojectfind.h @@ -23,8 +23,8 @@ public: bool isEnabled() const override; - void writeSettings(QSettings *settings) override; - void readSettings(QSettings *settings) override; + void writeSettings(Utils::QtcSettings *settings) override; + void readSettings(Utils::QtcSettings *settings) override; protected: QString label() const override; diff --git a/src/plugins/projectexplorer/devicesupport/sshsettings.cpp b/src/plugins/projectexplorer/devicesupport/sshsettings.cpp index adbf458d264..083ad062c99 100644 --- a/src/plugins/projectexplorer/devicesupport/sshsettings.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshsettings.cpp @@ -5,6 +5,7 @@ #include <utils/environment.h> #include <utils/hostosinfo.h> +#include <utils/qtcsettings.h> #include <QReadWriteLock> #include <QSettings> @@ -33,23 +34,23 @@ Q_GLOBAL_STATIC(Internal::SshSettings, sshSettings) class AccessSettingsGroup { public: - AccessSettingsGroup(QSettings *settings) : m_settings(settings) + AccessSettingsGroup(QtcSettings *settings) : m_settings(settings) { settings->beginGroup("SshSettings"); } ~AccessSettingsGroup() { m_settings->endGroup(); } private: - QSettings * const m_settings; + QtcSettings * const m_settings; }; -static QString connectionSharingKey() { return QString("UseConnectionSharing"); } -static QString connectionSharingTimeoutKey() { return QString("ConnectionSharingTimeout"); } -static QString sshFilePathKey() { return QString("SshFilePath"); } -static QString sftpFilePathKey() { return QString("SftpFilePath"); } -static QString askPassFilePathKey() { return QString("AskpassFilePath"); } -static QString keygenFilePathKey() { return QString("KeygenFilePath"); } +static Key connectionSharingKey() { return Key("UseConnectionSharing"); } +static Key connectionSharingTimeoutKey() { return Key("ConnectionSharingTimeout"); } +static Key sshFilePathKey() { return Key("SshFilePath"); } +static Key sftpFilePathKey() { return Key("SftpFilePath"); } +static Key askPassFilePathKey() { return Key("AskpassFilePath"); } +static Key keygenFilePathKey() { return Key("KeygenFilePath"); } -void SshSettings::loadSettings(QSettings *settings) +void SshSettings::loadSettings(QtcSettings *settings) { QWriteLocker locker(&sshSettings->lock); AccessSettingsGroup g(settings); @@ -67,7 +68,7 @@ void SshSettings::loadSettings(QSettings *settings) settings->value(keygenFilePathKey()).toString()); } -void SshSettings::storeSettings(QSettings *settings) +void SshSettings::storeSettings(QtcSettings *settings) { QReadLocker locker(&sshSettings->lock); AccessSettingsGroup g(settings); diff --git a/src/plugins/projectexplorer/devicesupport/sshsettings.h b/src/plugins/projectexplorer/devicesupport/sshsettings.h index 47d54413de6..ce039bd06bc 100644 --- a/src/plugins/projectexplorer/devicesupport/sshsettings.h +++ b/src/plugins/projectexplorer/devicesupport/sshsettings.h @@ -5,21 +5,19 @@ #include "../projectexplorer_export.h" -#include <utils/fileutils.h> +#include <utils/filepath.h> #include <functional> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace Utils { class QtcSettings; } namespace ProjectExplorer { class PROJECTEXPLORER_EXPORT SshSettings { public: - static void loadSettings(QSettings *settings); - static void storeSettings(QSettings *settings); + static void loadSettings(Utils::QtcSettings *settings); + static void storeSettings(Utils::QtcSettings *settings); static void setConnectionSharingEnabled(bool share); static bool connectionSharingEnabled(); diff --git a/src/plugins/projectexplorer/filesinallprojectsfind.cpp b/src/plugins/projectexplorer/filesinallprojectsfind.cpp index c5e8412572f..f3554f18a9e 100644 --- a/src/plugins/projectexplorer/filesinallprojectsfind.cpp +++ b/src/plugins/projectexplorer/filesinallprojectsfind.cpp @@ -8,9 +8,9 @@ #include "projectmanager.h" #include <coreplugin/editormanager/editormanager.h> -#include <utils/algorithm.h> -#include <QSettings> +#include <utils/algorithm.h> +#include <utils/qtcsettings.h> using namespace TextEditor; using namespace Utils; @@ -30,14 +30,14 @@ QString FilesInAllProjectsFind::displayName() const const char kSettingsKey[] = "FilesInAllProjectDirectories"; -void FilesInAllProjectsFind::writeSettings(QSettings *settings) +void FilesInAllProjectsFind::writeSettings(QtcSettings *settings) { settings->beginGroup(kSettingsKey); writeCommonSettings(settings); settings->endGroup(); } -void FilesInAllProjectsFind::readSettings(QSettings *settings) +void FilesInAllProjectsFind::readSettings(QtcSettings *settings) { settings->beginGroup(kSettingsKey); readCommonSettings( diff --git a/src/plugins/projectexplorer/filesinallprojectsfind.h b/src/plugins/projectexplorer/filesinallprojectsfind.h index 1e27b06a309..f96d2a6df9a 100644 --- a/src/plugins/projectexplorer/filesinallprojectsfind.h +++ b/src/plugins/projectexplorer/filesinallprojectsfind.h @@ -16,8 +16,8 @@ public: QString id() const override; QString displayName() const override; - void writeSettings(QSettings *settings) override; - void readSettings(QSettings *settings) override; + void writeSettings(Utils::QtcSettings *settings) override; + void readSettings(Utils::QtcSettings *settings) override; protected: TextEditor::FileContainerProvider fileContainerProvider() const override; diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index e9f5d82adb3..66ce26e41f6 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -862,7 +862,7 @@ void ProjectWindow::savePersistentSettings() const { if (!centralWidget()) return; - QSettings * const settings = ICore::settings(); + QtcSettings * const settings = ICore::settings(); settings->beginGroup(PROJECT_WINDOW_KEY); saveSettings(settings); settings->endGroup(); @@ -872,7 +872,7 @@ void ProjectWindow::loadPersistentSettings() { if (!centralWidget()) return; - QSettings * const settings = ICore::settings(); + QtcSettings * const settings = ICore::settings(); settings->beginGroup(PROJECT_WINDOW_KEY); restoreSettings(settings); settings->endGroup(); diff --git a/src/plugins/python/pythonsettings.cpp b/src/plugins/python/pythonsettings.cpp index 020aad52259..6cc3ab3e182 100644 --- a/src/plugins/python/pythonsettings.cpp +++ b/src/plugins/python/pythonsettings.cpp @@ -908,7 +908,7 @@ QList<Interpreter> PythonSettings::detectPythonVenvs(const FilePath &path) return result; } -void PythonSettings::initFromSettings(QSettings *settings) +void PythonSettings::initFromSettings(QtcSettings *settings) { settings->beginGroup(settingsGroupKey); const QVariantList interpreters = settings->value(interpreterKey).toList(); @@ -954,7 +954,7 @@ void PythonSettings::initFromSettings(QSettings *settings) settings->endGroup(); } -void PythonSettings::writeToSettings(QSettings *settings) +void PythonSettings::writeToSettings(QtcSettings *settings) { settings->beginGroup(settingsGroupKey); QVariantList interpretersVar; diff --git a/src/plugins/python/pythonsettings.h b/src/plugins/python/pythonsettings.h index 35939c1ecd1..373054094e1 100644 --- a/src/plugins/python/pythonsettings.h +++ b/src/plugins/python/pythonsettings.h @@ -57,8 +57,8 @@ public slots: void listDetectedPython(const QString &detectionSource, QString *logMessage); private: - void initFromSettings(QSettings *settings); - void writeToSettings(QSettings *settings); + void initFromSettings(Utils::QtcSettings *settings); + void writeToSettings(Utils::QtcSettings *settings); QList<Interpreter> m_interpreters; QString m_defaultInterpreterId; diff --git a/src/plugins/qbsprojectmanager/qbssettings.cpp b/src/plugins/qbsprojectmanager/qbssettings.cpp index 87d5b5b284b..087f11d5e37 100644 --- a/src/plugins/qbsprojectmanager/qbssettings.cpp +++ b/src/plugins/qbsprojectmanager/qbssettings.cpp @@ -131,7 +131,7 @@ QbsSettings::QbsSettings() void QbsSettings::loadSettings() { - QSettings * const s = Core::ICore::settings(); + QtcSettings * const s = Core::ICore::settings(); m_settings.qbsExecutableFilePath = FilePath::fromString(s->value(QBS_EXE_KEY).toString()); m_settings.defaultInstallDirTemplate = s->value( QBS_DEFAULT_INSTALL_DIR_KEY, @@ -141,7 +141,7 @@ void QbsSettings::loadSettings() void QbsSettings::storeSettings() const { - QSettings * const s = Core::ICore::settings(); + QtcSettings * const s = Core::ICore::settings(); QtcSettings::setValueWithDefault(s, QBS_EXE_KEY, m_settings.qbsExecutableFilePath.toString(), defaultQbsExecutableFilePath().toString()); s->setValue(QBS_DEFAULT_INSTALL_DIR_KEY, m_settings.defaultInstallDirTemplate); diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp index 27f196dc5ad..176f4d7bc78 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp @@ -77,6 +77,8 @@ #include <bindingeditor/signallist.h> +using namespace Utils; + namespace QmlDesigner { namespace { @@ -1709,8 +1711,8 @@ QString getEffectIcon(const QString &effectPath) bool useLayerEffect() { - QSettings *settings = Core::ICore::settings(); - const QString layerEffectEntry = "QML/Designer/UseLayerEffect"; + QtcSettings *settings = Core::ICore::settings(); + const Key layerEffectEntry = "QML/Designer/UseLayerEffect"; return settings->value(layerEffectEntry, true).toBool(); } diff --git a/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp b/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp index f14e423c9f0..b74190bb911 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp @@ -19,6 +19,8 @@ #include <cmath> +using namespace Utils; + namespace QmlDesigner { AlignDistribute::AlignDistribute(QObject *parent) @@ -663,7 +665,7 @@ AlignDistribute::Dimension AlignDistribute::getDimension(Target target) const bool AlignDistribute::executePixelPerfectDialog() const { - Utils::CheckableDecider decider(QString("WarnAboutPixelPerfectDistribution")); + Utils::CheckableDecider decider(Key("WarnAboutPixelPerfectDistribution")); QMessageBox::StandardButton pressed = Utils::CheckableMessageBox::question( Core::ICore::dialogParent(), diff --git a/src/plugins/qmldesigner/components/toolbar/toolbar.cpp b/src/plugins/qmldesigner/components/toolbar/toolbar.cpp index e4f523c55cc..c5a6e9745b6 100644 --- a/src/plugins/qmldesigner/components/toolbar/toolbar.cpp +++ b/src/plugins/qmldesigner/components/toolbar/toolbar.cpp @@ -10,6 +10,7 @@ #include <qmldesignerconstants.h> #include <coreplugin/icore.h> + #include <utils/filepath.h> #include <utils/qtcassert.h> @@ -18,6 +19,8 @@ #include <QStatusBar> #include <QToolBar> +using namespace Utils; + namespace QmlDesigner { static Utils::FilePath propertyEditorResourcesPath() @@ -127,8 +130,8 @@ Utils::UniqueObjectPtr<QWidget> ToolBar::createStatusBar() bool ToolBar::isVisible() { - QSettings *settings = Core::ICore::settings(); - const QString qdsToolbarEntry = "QML/Designer/TopToolBar"; + QtcSettings *settings = Core::ICore::settings(); + const Key qdsToolbarEntry = "QML/Designer/TopToolBar"; return settings->value(qdsToolbarEntry, false).toBool(); } diff --git a/src/plugins/qmldesignerbase/studio/studiosettingspage.cpp b/src/plugins/qmldesignerbase/studio/studiosettingspage.cpp index d88c4cf409b..05db597c5b8 100644 --- a/src/plugins/qmldesignerbase/studio/studiosettingspage.cpp +++ b/src/plugins/qmldesignerbase/studio/studiosettingspage.cpp @@ -8,8 +8,11 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/dialogs/restartdialog.h> #include <coreplugin/icore.h> + #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> + +#include <utils/qtcsettings.h> #include <utils/theme/theme.h> #include <QApplication> @@ -23,6 +26,8 @@ #include <QStyleFactory> #include <QVBoxLayout> +using namespace Utils; + namespace QmlDesigner { namespace { @@ -53,9 +58,9 @@ bool hideToolsMenuSetting() return Core::ICore::settings()->value(Core::Constants::SETTINGS_MENU_HIDE_TOOLS, false).toBool(); } -void setSettingIfDifferent(const QString &key, bool value, bool &dirty) +void setSettingIfDifferent(const Key &key, bool value, bool &dirty) { - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); if (s->value(key, false).toBool() != value) { dirty = true; s->setValue(key, value); @@ -175,7 +180,7 @@ void StudioSettingsPage::apply() restartDialog.exec(); } - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); const QString value = m_pathChooserExamples->filePath().toString(); if (s->value(Paths::exampleDownloadPath, false).toString() != value) { diff --git a/src/plugins/qmldesignerbase/utils/designersettings.cpp b/src/plugins/qmldesignerbase/utils/designersettings.cpp index 8157712437b..87248bbc207 100644 --- a/src/plugins/qmldesignerbase/utils/designersettings.cpp +++ b/src/plugins/qmldesignerbase/utils/designersettings.cpp @@ -3,7 +3,9 @@ #include "designersettings.h" -#include <QSettings> +#include <utils/qtcsettings.h> + +using namespace Utils; namespace QmlDesigner { @@ -12,7 +14,7 @@ namespace DesignerSettingsGroupKey { const char QML_DESIGNER_SETTINGS_GROUP[] = "Designer"; } -DesignerSettings::DesignerSettings(QSettings *settings) : +DesignerSettings::DesignerSettings(QtcSettings *settings) : m_settings(settings) { fromSettings(settings); @@ -38,15 +40,15 @@ QVariant DesignerSettings::value(const QByteArray &key, const QVariant &defaultV return m_cache.value(key, defaultValue); } -void DesignerSettings::restoreValue(QSettings *settings, const QByteArray &key, const QVariant &defaultValue) +void DesignerSettings::restoreValue(QtcSettings *settings, const QByteArray &key, const QVariant &defaultValue) { - m_cache.insert(key, settings->value(QString::fromLatin1(key), defaultValue)); + m_cache.insert(key, settings->value(key, defaultValue)); } -void DesignerSettings::fromSettings(QSettings *settings) +void DesignerSettings::fromSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String(DesignerSettingsGroupKey::QML_SETTINGS_GROUP)); - settings->beginGroup(QLatin1String(DesignerSettingsGroupKey::QML_DESIGNER_SETTINGS_GROUP)); + settings->beginGroup(DesignerSettingsGroupKey::QML_SETTINGS_GROUP); + settings->beginGroup(DesignerSettingsGroupKey::QML_DESIGNER_SETTINGS_GROUP); restoreValue(settings, DesignerSettingsKey::ITEMSPACING, 6); restoreValue(settings, DesignerSettingsKey::CONTAINERPADDING, 8); @@ -103,17 +105,17 @@ void DesignerSettings::fromSettings(QSettings *settings) settings->endGroup(); } -void DesignerSettings::storeValue(QSettings *settings, const QByteArray &key, const QVariant &value) const +void DesignerSettings::storeValue(QtcSettings *settings, const QByteArray &key, const QVariant &value) const { if (key.isEmpty()) return; - settings->setValue(QString::fromLatin1(key), value); + settings->setValue(key, value); } -void DesignerSettings::toSettings(QSettings *settings) const +void DesignerSettings::toSettings(QtcSettings *settings) const { - settings->beginGroup(QLatin1String(DesignerSettingsGroupKey::QML_SETTINGS_GROUP)); - settings->beginGroup(QLatin1String(DesignerSettingsGroupKey::QML_DESIGNER_SETTINGS_GROUP)); + settings->beginGroup(DesignerSettingsGroupKey::QML_SETTINGS_GROUP); + settings->beginGroup(DesignerSettingsGroupKey::QML_DESIGNER_SETTINGS_GROUP); QHash<QByteArray, QVariant>::const_iterator i = m_cache.constBegin(); while (i != m_cache.constEnd()) { diff --git a/src/plugins/qmldesignerbase/utils/designersettings.h b/src/plugins/qmldesignerbase/utils/designersettings.h index 850e2a43a06..aaeec55ec37 100644 --- a/src/plugins/qmldesignerbase/utils/designersettings.h +++ b/src/plugins/qmldesignerbase/utils/designersettings.h @@ -10,9 +10,7 @@ #include <QByteArray> #include <QMutex> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace Utils { class QtcSettings; } namespace QmlDesigner { @@ -74,21 +72,21 @@ inline constexpr char CONTENT_LIBRARY_NEW_FLAG_EXPIRATION_DAYS[] = "ContentLibra class QMLDESIGNERBASE_EXPORT DesignerSettings { public: - DesignerSettings(QSettings *settings); + DesignerSettings(Utils::QtcSettings *settings); void insert(const QByteArray &key, const QVariant &value); void insert(const QHash<QByteArray, QVariant> &settingsHash); QVariant value(const QByteArray &key, const QVariant &defaultValue = {}) const; private: - void fromSettings(QSettings *); - void toSettings(QSettings *) const; + void fromSettings(Utils::QtcSettings *); + void toSettings(Utils::QtcSettings *) const; - void restoreValue(QSettings *settings, const QByteArray &key, + void restoreValue(Utils::QtcSettings *settings, const QByteArray &key, const QVariant &defaultValue = QVariant()); - void storeValue(QSettings *settings, const QByteArray &key, const QVariant &value) const; + void storeValue(Utils::QtcSettings *settings, const QByteArray &key, const QVariant &value) const; - QSettings *m_settings; + Utils::QtcSettings *m_settings; QHash<QByteArray, QVariant> m_cache; mutable QMutex m_mutex; }; diff --git a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp index f28fa5d8c17..ee243eb5bcd 100644 --- a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp +++ b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp @@ -7,9 +7,11 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/icore.h> + #include <qmljs/qmljscheck.h> #include <qmljs/qmljsstaticanalysismessage.h> #include <qmljstools/qmljstoolsconstants.h> + #include <utils/algorithm.h> #include <utils/layoutbuilder.h> #include <utils/macroexpander.h> @@ -22,7 +24,6 @@ #include <QLabel> #include <QLineEdit> #include <QMenu> -#include <QSettings> #include <QTextStream> #include <QTreeView> @@ -43,8 +44,10 @@ const char DISABLED_MESSAGES[] = "QmlJSEditor.disabledMessages"; const char DISABLED_MESSAGES_NONQUICKUI[] = "QmlJSEditor.disabledMessagesNonQuickUI"; const char DEFAULT_CUSTOM_FORMAT_COMMAND[] = "%{CurrentDocument:Project:QT_HOST_BINS}/qmlformat"; -using namespace QmlJSEditor; using namespace QmlJSEditor::Internal; +using namespace Utils; + +namespace QmlJSEditor { static QList<int> defaultDisabledMessages() { @@ -90,7 +93,7 @@ static QStringList defaultDisabledNonQuickUiAsString() return result; } -void QmlJsEditingSettings::fromSettings(QSettings *settings) +void QmlJsEditingSettings::fromSettings(QtcSettings *settings) { settings->beginGroup(QmlJSEditor::Constants::SETTINGS_CATEGORY_QML); m_enableContextPane = settings->value(QML_CONTEXTPANE_KEY, QVariant(false)).toBool(); @@ -120,7 +123,7 @@ void QmlJsEditingSettings::fromSettings(QSettings *settings) settings->endGroup(); } -void QmlJsEditingSettings::toSettings(QSettings *settings) const +void QmlJsEditingSettings::toSettings(QtcSettings *settings) const { settings->beginGroup(QmlJSEditor::Constants::SETTINGS_CATEGORY_QML); settings->setValue(QML_CONTEXTPANE_KEY, m_enableContextPane); @@ -590,3 +593,5 @@ QmlJsEditingSettingsPage::QmlJsEditingSettingsPage() setCategory(Constants::SETTINGS_CATEGORY_QML); setWidgetCreator([] { return new QmlJsEditingSettingsPageWidget; }); } + +} // QmlJsEditor diff --git a/src/plugins/qmljseditor/qmljseditingsettingspage.h b/src/plugins/qmljseditor/qmljseditingsettingspage.h index d7f8f78bd30..5f6d954fbdb 100644 --- a/src/plugins/qmljseditor/qmljseditingsettingspage.h +++ b/src/plugins/qmljseditor/qmljseditingsettingspage.h @@ -4,14 +4,12 @@ #pragma once #include "qmllssettings.h" + #include <coreplugin/dialogs/ioptionspage.h> + #include <QPointer> #include <QWidget> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - namespace QmlJSEditor { class QmlJsEditingSettings @@ -22,8 +20,8 @@ public: static QmlJsEditingSettings get(); void set(); - void fromSettings(QSettings *); - void toSettings(QSettings *) const; + void fromSettings(Utils::QtcSettings *); + void toSettings(Utils::QtcSettings *) const; bool equals(const QmlJsEditingSettings &other) const; diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index ecb064c851f..ea02239a64e 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -569,10 +569,10 @@ ProjectExplorer::RunControl *QmlProfilerTool::attachToWaitingApplication() Kit *kit = nullptr; { - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); - kitId = Id::fromSetting(settings->value(QLatin1String("AnalyzerQmlAttachDialog/kitId"))); - port = settings->value(QLatin1String("AnalyzerQmlAttachDialog/port"), 3768).toInt(); + kitId = Id::fromSetting(settings->value("AnalyzerQmlAttachDialog/kitId")); + port = settings->value("AnalyzerQmlAttachDialog/port", 3768).toInt(); QmlProfilerAttachDialog dialog; @@ -587,8 +587,8 @@ ProjectExplorer::RunControl *QmlProfilerTool::attachToWaitingApplication() QTC_ASSERT(port >= 0, return nullptr); QTC_ASSERT(port <= std::numeric_limits<quint16>::max(), return nullptr); - settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/kitId"), kit->id().toSetting()); - settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/port"), port); + settings->setValue("AnalyzerQmlAttachDialog/kitId", kit->id().toSetting()); + settings->setValue("AnalyzerQmlAttachDialog/port", port); } QUrl serverUrl; diff --git a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp index ea119517ff0..1b16b421141 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp @@ -5,18 +5,24 @@ #include "fakedebugserver.h" #include <coreplugin/icore.h> + #include <projectexplorer/kit.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/runcontrol.h> + #include <qmlprofiler/qmlprofilerattachdialog.h> #include <qmlprofiler/qmlprofilerclientmanager.h> #include <qmlprofiler/qmlprofilermodelmanager.h> #include <qmlprofiler/qmlprofilerstatemanager.h> + +#include <utils/qtcsettings.h> #include <utils/url.h> #include <QTcpServer> #include <QtTest> +using namespace Utils; + namespace QmlProfiler { namespace Internal { @@ -26,9 +32,9 @@ void QmlProfilerToolTest::testAttachToWaitingApplication() QVERIFY(kitManager); ProjectExplorer::Kit * const newKit = ProjectExplorer::KitManager::registerKit({}, "fookit"); QVERIFY(newKit); - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); QVERIFY(settings); - settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/kitId"), newKit->id().toSetting()); + settings->setValue("AnalyzerQmlAttachDialog/kitId", newKit->id().toSetting()); QmlProfilerTool &profilerTool = *QmlProfilerTool::instance(); diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index fd977a2d4c8..7ed655b01be 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -209,8 +209,8 @@ Tasks QmlProject::projectIssues(const Kit *k) const bool QmlProject::isQtDesignStudio() { - QSettings *settings = Core::ICore::settings(); - const QString qdsStandaloneEntry = "QML/Designer/StandAloneMode"; + QtcSettings *settings = Core::ICore::settings(); + const Key qdsStandaloneEntry = "QML/Designer/StandAloneMode"; return settings->value(qdsStandaloneEntry, false).toBool(); } @@ -240,9 +240,9 @@ int QmlProject::preferedQtTarget(Target *target) bool QmlProject::allowOnlySingleProject() { - QSettings *settings = Core::ICore::settings(); - auto key = "QML/Designer/AllowMultipleProjects"; - return !settings->value(QString::fromUtf8(key), false).toBool(); + QtcSettings *settings = Core::ICore::settings(); + const Key key = "QML/Designer/AllowMultipleProjects"; + return !settings->value(key, false).toBool(); } } // namespace QmlProjectManager diff --git a/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp b/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp index 2876c3c366a..7c12e312b10 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp @@ -41,6 +41,7 @@ #include <utils/fileutils.h> #include <utils/fsengine/fileiconprovider.h> #include <utils/process.h> +#include <utils/qtcsettings.h> #include <QAction> #include <QDesktopServices> @@ -50,6 +51,7 @@ #include <QTimer> using namespace ProjectExplorer; +using namespace Utils; namespace QmlProjectManager::Internal { @@ -131,8 +133,8 @@ void QmlProjectPlugin::openQDS(const Utils::FilePath &fileName) Utils::FilePath QmlProjectPlugin::qdsInstallationEntry() { - QSettings *settings = Core::ICore::settings(); - const QString qdsInstallationEntry = "QML/Designer/DesignStudioInstallation"; //set in installer + QtcSettings *settings = Core::ICore::settings(); + const Key qdsInstallationEntry = "QML/Designer/DesignStudioInstallation"; //set in installer return Utils::FilePath::fromUserInput(settings->value(qdsInstallationEntry).toString()); } diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index bb2f9e0fa00..e18016834b8 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -68,7 +68,7 @@ ExampleSetModel::ExampleSetModel() if (debugExamples() && !log().isDebugEnabled()) log().setEnabled(QtDebugMsg, true); // read extra example sets settings - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); const QStringList list = settings->value("Help/InstalledExamples", QStringList()).toStringList(); qCDebug(log) << "Reading Help/InstalledExamples from settings:" << list; for (const QString &item : list) { diff --git a/src/plugins/remotelinux/publickeydeploymentdialog.cpp b/src/plugins/remotelinux/publickeydeploymentdialog.cpp index f06f28790d9..6d0ead4ac6f 100644 --- a/src/plugins/remotelinux/publickeydeploymentdialog.cpp +++ b/src/plugins/remotelinux/publickeydeploymentdialog.cpp @@ -10,6 +10,7 @@ #include <projectexplorer/devicesupport/sshsettings.h> #include <utils/filepath.h> +#include <utils/fileutils.h> #include <utils/process.h> #include <utils/stringutils.h> #include <utils/theme/theme.h> diff --git a/src/plugins/scxmleditor/common/colorsettings.cpp b/src/plugins/scxmleditor/common/colorsettings.cpp index 1419b481bc5..2f84087fa2b 100644 --- a/src/plugins/scxmleditor/common/colorsettings.cpp +++ b/src/plugins/scxmleditor/common/colorsettings.cpp @@ -12,10 +12,13 @@ #include <QToolButton> #include <coreplugin/icore.h> + #include <utils/layoutbuilder.h> #include <utils/utilsicons.h> -using namespace ScxmlEditor::Common; +using namespace Utils; + +namespace ScxmlEditor::Common { ColorSettings::ColorSettings(QWidget *parent) : QFrame(parent) @@ -29,7 +32,7 @@ ColorSettings::ColorSettings(QWidget *parent) auto removeTheme = new QToolButton; removeTheme->setIcon(Utils::Icons::MINUS.icon()); removeTheme->setAutoRaise(true); - const QSettings *s = Core::ICore::settings(); + const QtcSettings *s = Core::ICore::settings(); m_colorThemes = s->value(Constants::C_SETTINGS_COLORSETTINGS_COLORTHEMES).toMap(); m_comboColorThemes->addItems(m_colorThemes.keys()); m_comboColorThemes->setCurrentText( @@ -57,7 +60,7 @@ ColorSettings::ColorSettings(QWidget *parent) void ColorSettings::save() { - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); s->setValue(Constants::C_SETTINGS_COLORSETTINGS_COLORTHEMES, m_colorThemes); s->setValue(Constants::C_SETTINGS_COLORSETTINGS_CURRENTCOLORTHEME, m_comboColorThemes->currentText()); } @@ -110,3 +113,5 @@ void ColorSettings::removeTheme() m_colorThemeView->setEnabled(false); } } + +} // ScxmlEditor::Common diff --git a/src/plugins/scxmleditor/common/colorthemes.cpp b/src/plugins/scxmleditor/common/colorthemes.cpp index 5a40783a315..6a98572f2e9 100644 --- a/src/plugins/scxmleditor/common/colorthemes.cpp +++ b/src/plugins/scxmleditor/common/colorthemes.cpp @@ -10,12 +10,16 @@ #include "scxmltag.h" #include <coreplugin/icore.h> + +#include <utils/qtcsettings.h> #include <utils/stringutils.h> #include <QMenu> #include <QToolButton> -using namespace ScxmlEditor::Common; +using namespace Utils; + +namespace ScxmlEditor::Common { ColorThemes::ColorThemes(QObject *parent) : QObject(parent) @@ -69,7 +73,7 @@ void ColorThemes::updateColorThemeMenu() { m_menu->clear(); - const QSettings *s = Core::ICore::settings(); + const QtcSettings *s = Core::ICore::settings(); const QString currentTheme = s->value(Constants::C_SETTINGS_COLORSETTINGS_CURRENTCOLORTHEME, QString(Constants::C_COLOR_SCHEME_DEFAULT)).toString(); const QVariantMap data = s->value(Constants::C_SETTINGS_COLORSETTINGS_COLORTHEMES).toMap(); @@ -100,7 +104,7 @@ void ColorThemes::selectColorTheme(const QString &name) { QVariantMap colorData; if (m_document && !name.isEmpty()) { - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); if (name == Constants::C_COLOR_SCHEME_SCXMLDOCUMENT) { colorData = m_documentColors; @@ -168,3 +172,5 @@ void ColorThemes::setCurrentColors(const QVariantMap &colorData) m_document->setLevelColors(colors); m_document->setEditorInfo(m_document->scxmlRootTag(), Constants::C_SCXML_EDITORINFO_COLORS, serializedColors.join(";;")); } + +} // ScxmlEditor::Common diff --git a/src/plugins/scxmleditor/common/mainwidget.cpp b/src/plugins/scxmleditor/common/mainwidget.cpp index 795e183bd67..a55d59f6ad1 100644 --- a/src/plugins/scxmleditor/common/mainwidget.cpp +++ b/src/plugins/scxmleditor/common/mainwidget.cpp @@ -372,7 +372,7 @@ void MainWidget::init() m_toolButtons << stateColorButton << fontColorButton << alignToolButton << adjustToolButton; - const QSettings *s = Core::ICore::settings(); + const QtcSettings *s = Core::ICore::settings(); m_horizontalSplitter->restoreState(s->value(Constants::C_SETTINGS_SPLITTER).toByteArray()); m_actionHandler->action(ActionPaste)->setEnabled(false); @@ -412,7 +412,7 @@ void MainWidget::exportToImage() if (suggestedFileName.isEmpty()) suggestedFileName = Tr::tr("Untitled"); - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); const QString documentsLocation = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); const QString lastFolder = s->value( Constants::C_SETTINGS_LASTEXPORTFOLDER, documentsLocation).toString(); @@ -446,7 +446,7 @@ void MainWidget::saveScreenShot() if (!view) return; - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); const QString documentsLocation = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); const FilePath lastFolder = FilePath::fromSettings( s->value(Constants::C_SETTINGS_LASTSAVESCREENSHOTFOLDER, documentsLocation)); @@ -467,7 +467,7 @@ void MainWidget::saveScreenShot() void MainWidget::saveSettings() { - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); s->setValue(Constants::C_SETTINGS_SPLITTER, m_horizontalSplitter->saveState()); } diff --git a/src/plugins/scxmleditor/outputpane/errorwidget.cpp b/src/plugins/scxmleditor/outputpane/errorwidget.cpp index b38da63f62d..e48fc370caa 100644 --- a/src/plugins/scxmleditor/outputpane/errorwidget.cpp +++ b/src/plugins/scxmleditor/outputpane/errorwidget.cpp @@ -73,7 +73,7 @@ ErrorWidget::ErrorWidget(QWidget *parent) connect(m_warningModel, &WarningModel::warningsChanged, this, &ErrorWidget::updateWarnings); connect(m_warningModel, &WarningModel::countChanged, this, &ErrorWidget::warningCountChanged); - const QSettings *s = Core::ICore::settings(); + const QtcSettings *s = Core::ICore::settings(); m_errorsTable->restoreGeometry(s->value(Constants::C_SETTINGS_ERRORPANE_GEOMETRY).toByteArray()); m_showErrors->setChecked(s->value(Constants::C_SETTINGS_ERRORPANE_SHOWERRORS, true).toBool()); m_showWarnings->setChecked(s->value(Constants::C_SETTINGS_ERRORPANE_SHOWWARNINGS, true).toBool()); @@ -84,7 +84,7 @@ ErrorWidget::ErrorWidget(QWidget *parent) ErrorWidget::~ErrorWidget() { - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); s->setValue(Constants::C_SETTINGS_ERRORPANE_GEOMETRY, m_errorsTable->saveGeometry()); s->setValue(Constants::C_SETTINGS_ERRORPANE_SHOWERRORS, m_showErrors->isChecked()); s->setValue(Constants::C_SETTINGS_ERRORPANE_SHOWWARNINGS, m_showWarnings->isChecked()); diff --git a/src/plugins/serialterminal/serialterminalsettings.cpp b/src/plugins/serialterminal/serialterminalsettings.cpp index db938ce673a..b8f023f93f8 100644 --- a/src/plugins/serialterminal/serialterminalsettings.cpp +++ b/src/plugins/serialterminal/serialterminalsettings.cpp @@ -5,8 +5,11 @@ #include "serialterminalconstants.h" #include "serialterminaltr.h" +#include <utils/qtcsettings.h> + #include <QLoggingCategory> -#include <QSettings> + +using namespace Utils; namespace SerialTerminal { namespace Internal { @@ -15,7 +18,7 @@ static Q_LOGGING_CATEGORY(log, Constants::LOGGING_CATEGORY, QtWarningMsg) // Set 'value' only if the key exists in the settings template <typename T> -void readSetting(const QSettings &settings, T &value, const QString &key) { +void readSetting(const QtcSettings &settings, T &value, const Key &key) { if (settings.contains(key)) value = settings.value(key).value<T>(); } @@ -32,7 +35,7 @@ Settings::Settings() } // Save settings to a QSettings -void Settings::save(QSettings *settings) +void Settings::save(QtcSettings *settings) { if (!settings || !edited) return; @@ -61,7 +64,7 @@ void Settings::save(QSettings *settings) } // Load available settings from a QSettings -void Settings::load(QSettings *settings) +void Settings::load(QtcSettings *settings) { if (!settings) return; @@ -129,7 +132,7 @@ void Settings::setDefaultLineEndingIndex(unsigned int index) } -void Settings::saveLineEndings(QSettings &settings) +void Settings::saveLineEndings(QtcSettings &settings) { settings.beginWriteArray(Constants::SETTINGS_LINE_ENDINGS, lineEndings.size()); int i = 0; @@ -141,7 +144,7 @@ void Settings::saveLineEndings(QSettings &settings) settings.endArray(); } -void Settings::loadLineEndings(QSettings &settings) +void Settings::loadLineEndings(QtcSettings &settings) { const int size = settings.beginReadArray(Constants::SETTINGS_LINE_ENDINGS); if (size > 0) // If null, keep default line endings diff --git a/src/plugins/serialterminal/serialterminalsettings.h b/src/plugins/serialterminal/serialterminalsettings.h index b2a4ec84e43..48efdb08064 100644 --- a/src/plugins/serialterminal/serialterminalsettings.h +++ b/src/plugins/serialterminal/serialterminalsettings.h @@ -9,9 +9,7 @@ #include <QString> #include <QVector> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace Utils { class QtcSettings; } namespace SerialTerminal { namespace Internal { @@ -36,8 +34,8 @@ public: bool clearInputOnSend = false; - void save(QSettings *settings); - void load(QSettings *settings); + void save(Utils::QtcSettings *settings); + void load(Utils::QtcSettings *settings); void setBaudRate(qint32 br); void setPortName(const QString &name); @@ -47,8 +45,8 @@ public: void setDefaultLineEndingIndex(unsigned int index); private: - void saveLineEndings(QSettings &settings); - void loadLineEndings(QSettings &settings); + void saveLineEndings(Utils::QtcSettings &settings); + void loadLineEndings(Utils::QtcSettings &settings); }; } // namespace Internal diff --git a/src/plugins/silversearcher/findinfilessilversearcher.cpp b/src/plugins/silversearcher/findinfilessilversearcher.cpp index 728367d1e5e..50ceeccdba9 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.cpp +++ b/src/plugins/silversearcher/findinfilessilversearcher.cpp @@ -6,14 +6,15 @@ #include "silversearchertr.h" #include <texteditor/findinfiles.h> + #include <utils/async.h> #include <utils/process.h> #include <utils/qtcassert.h> +#include <utils/qtcsettings.h> #include <QHBoxLayout> #include <QLabel> #include <QLineEdit> -#include <QSettings> using namespace Core; using namespace SilverSearcher; @@ -21,11 +22,13 @@ using namespace TextEditor; using namespace Utils; namespace { -const QLatin1String s_metaCharacters = QLatin1String("+()^$.{}[]|\\"); -const QLatin1String s_searchOptionsString = QLatin1String("SearchOptionsString"); + +const char s_searchOptionsString[] = "SearchOptionsString"; static QString convertWildcardToRegex(const QString &wildcard) { + static const QString s_metaCharacters("+()^$.{}[]|\\"); + QString regex; const int wildcardSize = wildcard.size(); regex.append('^'); @@ -140,7 +143,7 @@ QWidget *FindInFilesSilverSearcher::widget() const return m_widget; } -void FindInFilesSilverSearcher::writeSettings(QSettings *settings) const +void FindInFilesSilverSearcher::writeSettings(QtcSettings *settings) const { settings->setValue(s_searchOptionsString, m_searchOptionsLineEdit->text()); } @@ -152,7 +155,7 @@ SearchExecutor FindInFilesSilverSearcher::searchExecutor() const }; } -void FindInFilesSilverSearcher::readSettings(QSettings *settings) +void FindInFilesSilverSearcher::readSettings(QtcSettings *settings) { m_searchOptionsLineEdit->setText(settings->value(s_searchOptionsString).toString()); } diff --git a/src/plugins/silversearcher/findinfilessilversearcher.h b/src/plugins/silversearcher/findinfilessilversearcher.h index 82c32f1422d..1819260a0ec 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.h +++ b/src/plugins/silversearcher/findinfilessilversearcher.h @@ -28,8 +28,8 @@ public: QString title() const override; QString toolTip() const override; QWidget *widget() const override; - void readSettings(QSettings *settings) override; - void writeSettings(QSettings *settings) const override; + void readSettings(Utils::QtcSettings *settings) override; + void writeSettings(Utils::QtcSettings *settings) const override; TextEditor::SearchExecutor searchExecutor() const override; private: diff --git a/src/plugins/squish/squishnavigationwidget.cpp b/src/plugins/squish/squishnavigationwidget.cpp index 34077ad2555..b6e68aad871 100644 --- a/src/plugins/squish/squishnavigationwidget.cpp +++ b/src/plugins/squish/squishnavigationwidget.cpp @@ -24,6 +24,8 @@ #include <QMenu> #include <QVBoxLayout> +using namespace Utils; + namespace Squish::Internal { const int defaultSectionSize = 17; @@ -319,13 +321,13 @@ void SquishNavigationWidget::onRemoveAllSharedFolderTriggered() void SquishNavigationWidget::onRecordTestCase(const QString &suiteName, const QString &testCase) { - QMessageBox::StandardButton pressed = Utils::CheckableMessageBox::question( + QMessageBox::StandardButton pressed = CheckableMessageBox::question( Core::ICore::dialogParent(), Tr::tr("Record Test Case"), Tr::tr("Do you want to record over the test case \"%1\"? The existing content will " "be overwritten by the recorded script.") .arg(testCase), - QString("RecordWithoutApproval")); + Key("RecordWithoutApproval")); if (pressed != QMessageBox::Yes) return; diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index 2f576b331b9..829b761d108 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -75,8 +75,8 @@ namespace Internal { static bool useNewWelcomePage() { - QSettings *settings = Core::ICore::settings(); - const QString newWelcomePageEntry = "QML/Designer/NewWelcomePage"; //entry from qml settings + QtcSettings *settings = Core::ICore::settings(); + const Key newWelcomePageEntry = "QML/Designer/NewWelcomePage"; //entry from qml settings return settings->value(newWelcomePageEntry, false).toBool(); } @@ -527,9 +527,9 @@ static bool forceDownLoad() static bool showSplashScreen() { - const QString lastQDSVersionEntry = "QML/Designer/lastQDSVersion"; + const Key lastQDSVersionEntry = "QML/Designer/lastQDSVersion"; - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); const QString lastQDSVersion = settings->value(lastQDSVersionEntry).toString(); diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 91c0b8e259a..efea4e9ba17 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -140,8 +140,8 @@ public: QString title() const override { return Tr::tr("Internal"); } QString toolTip() const override { return {}; } QWidget *widget() const override { return m_widget; } - void readSettings(QSettings * /*settings*/) override {} - void writeSettings(QSettings * /*settings*/) const override {} + void readSettings(QtcSettings * /*settings*/) override {} + void writeSettings(QtcSettings * /*settings*/) const override {} SearchExecutor searchExecutor() const override { return [](const FileFindParameters ¶meters) { @@ -444,7 +444,7 @@ FilePath BaseFileFind::searchDir() const return d->m_searchDir; } -void BaseFileFind::writeCommonSettings(QSettings *settings) +void BaseFileFind::writeCommonSettings(QtcSettings *settings) { const auto fromNativeSeparators = [](const QStringList &files) -> QStringList { return Utils::transform(files, &QDir::fromNativeSeparators); @@ -464,7 +464,7 @@ void BaseFileFind::writeCommonSettings(QSettings *settings) settings->setValue("currentSearchEngineIndex", d->m_currentSearchEngineIndex); } -void BaseFileFind::readCommonSettings(QSettings *settings, const QString &defaultFilter, +void BaseFileFind::readCommonSettings(QtcSettings *settings, const QString &defaultFilter, const QString &defaultExclusionFilter) { const auto toNativeSeparators = [](const QStringList &files) -> QStringList { diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index c7d53f80338..47adae4b866 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -69,8 +69,8 @@ public: virtual QString title() const = 0; virtual QString toolTip() const = 0; // add %1 placeholder where the find flags should be put virtual QWidget *widget() const = 0; - virtual void readSettings(QSettings *settings) = 0; - virtual void writeSettings(QSettings *settings) const = 0; + virtual void readSettings(Utils::QtcSettings *settings) = 0; + virtual void writeSettings(Utils::QtcSettings *settings) const = 0; virtual SearchExecutor searchExecutor() const = 0; virtual EditorOpener editorOpener() const { return {}; } bool isEnabled() const; @@ -108,8 +108,8 @@ protected: virtual QString toolTip() const = 0; // see Core::SearchResultWindow::startNewSearch, // add %1 placeholder where the find flags should be put - void writeCommonSettings(QSettings *settings); - void readCommonSettings(QSettings *settings, const QString &defaultFilter, const QString &defaultExclusionFilter); + void writeCommonSettings(Utils::QtcSettings *settings); + void readCommonSettings(Utils::QtcSettings *settings, const QString &defaultFilter, const QString &defaultExclusionFilter); QList<QPair<QWidget *, QWidget *>> createPatternWidgets(); QStringList fileNameFilters() const; QStringList fileExclusionFilters() const; diff --git a/src/plugins/texteditor/completionsettings.cpp b/src/plugins/texteditor/completionsettings.cpp index e4d6e76028a..033f322a6e4 100644 --- a/src/plugins/texteditor/completionsettings.cpp +++ b/src/plugins/texteditor/completionsettings.cpp @@ -3,29 +3,31 @@ #include "completionsettings.h" -#include <QSettings> +#include <utils/qtcsettings.h> -static const char settingsGroup[] = "CppTools/Completion"; -static const char caseSensitivityKey[] = "CaseSensitivity"; -static const char completionTriggerKey[] = "CompletionTrigger"; -static const char automaticProposalTimeoutKey[] = "AutomaticProposalTimeout"; -static const char characterThresholdKey[] = "CharacterThreshold"; -static const char autoInsertBracesKey[] = "AutoInsertBraces"; -static const char surroundingAutoBracketsKey[] = "SurroundingAutoBrackets"; -static const char autoInsertQuotesKey[] = "AutoInsertQuotes"; -static const char surroundingAutoQuotesKey[] = "SurroundingAutoQuotes"; -static const char partiallyCompleteKey[] = "PartiallyComplete"; -static const char spaceAfterFunctionNameKey[] = "SpaceAfterFunctionName"; -static const char autoSplitStringsKey[] = "AutoSplitStrings"; -static const char animateAutoCompleteKey[] = "AnimateAutoComplete"; -static const char highlightAutoCompleteKey[] = "HighlightAutoComplete"; -static const char skipAutoCompleteKey[] = "SkipAutoComplete"; -static const char autoRemoveKey[] = "AutoRemove"; -static const char overwriteClosingCharsKey[] = "OverwriteClosingChars"; +using namespace Utils; -using namespace TextEditor; +namespace TextEditor { -void CompletionSettings::toSettings(QSettings *s) const +const char settingsGroup[] = "CppTools/Completion"; +const char caseSensitivityKey[] = "CaseSensitivity"; +const char completionTriggerKey[] = "CompletionTrigger"; +const char automaticProposalTimeoutKey[] = "AutomaticProposalTimeout"; +const char characterThresholdKey[] = "CharacterThreshold"; +const char autoInsertBracesKey[] = "AutoInsertBraces"; +const char surroundingAutoBracketsKey[] = "SurroundingAutoBrackets"; +const char autoInsertQuotesKey[] = "AutoInsertQuotes"; +const char surroundingAutoQuotesKey[] = "SurroundingAutoQuotes"; +const char partiallyCompleteKey[] = "PartiallyComplete"; +const char spaceAfterFunctionNameKey[] = "SpaceAfterFunctionName"; +const char autoSplitStringsKey[] = "AutoSplitStrings"; +const char animateAutoCompleteKey[] = "AnimateAutoComplete"; +const char highlightAutoCompleteKey[] = "HighlightAutoComplete"; +const char skipAutoCompleteKey[] = "SkipAutoComplete"; +const char autoRemoveKey[] = "AutoRemove"; +const char overwriteClosingCharsKey[] = "OverwriteClosingChars"; + +void CompletionSettings::toSettings(QtcSettings *s) const { s->beginGroup(settingsGroup); s->setValue(caseSensitivityKey, (int) m_caseSensitivity); @@ -47,7 +49,7 @@ void CompletionSettings::toSettings(QSettings *s) const s->endGroup(); } -void CompletionSettings::fromSettings(QSettings *s) +void CompletionSettings::fromSettings(QtcSettings *s) { *this = CompletionSettings(); // Assign defaults @@ -107,3 +109,5 @@ bool CompletionSettings::equals(const CompletionSettings &cs) const && m_overwriteClosingChars == cs.m_overwriteClosingChars ; } + +} // TextEditor diff --git a/src/plugins/texteditor/completionsettings.h b/src/plugins/texteditor/completionsettings.h index b2d201e8975..61294e65ad9 100644 --- a/src/plugins/texteditor/completionsettings.h +++ b/src/plugins/texteditor/completionsettings.h @@ -5,10 +5,7 @@ #include "texteditor_global.h" -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - +namespace Utils { class QtcSettings; } namespace TextEditor { enum CaseSensitivity { @@ -29,8 +26,8 @@ enum CompletionTrigger { class TEXTEDITOR_EXPORT CompletionSettings { public: - void toSettings(QSettings *s) const; - void fromSettings(QSettings *s); + void toSettings(Utils::QtcSettings *s) const; + void fromSettings(Utils::QtcSettings *s); bool equals(const CompletionSettings &bs) const; diff --git a/src/plugins/texteditor/completionsettingspage.cpp b/src/plugins/texteditor/completionsettingspage.cpp index 3d93af5226c..aba86467143 100644 --- a/src/plugins/texteditor/completionsettingspage.cpp +++ b/src/plugins/texteditor/completionsettingspage.cpp @@ -313,7 +313,7 @@ CompletionSettingsPage::CompletionSettingsPage() setCategoryIconPath(TextEditor::Constants::TEXT_EDITOR_SETTINGS_CATEGORY_ICON_PATH); setWidgetCreator([this] { return new CompletionSettingsPageWidget(this); }); - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); m_completionSettings.fromSettings(s); } diff --git a/src/plugins/texteditor/displaysettings.cpp b/src/plugins/texteditor/displaysettings.cpp index fde9774cf3f..5cd8e86c151 100644 --- a/src/plugins/texteditor/displaysettings.cpp +++ b/src/plugins/texteditor/displaysettings.cpp @@ -6,90 +6,92 @@ #include "texteditorconstants.h" #include <coreplugin/icore.h> + +#include <utils/qtcsettings.h> #include <utils/tooltip/tooltip.h> #include <QLabel> -#include <QSettings> -#include <QString> -static const char displayLineNumbersKey[] = "DisplayLineNumbers"; -static const char textWrappingKey[] = "TextWrapping"; -static const char visualizeWhitespaceKey[] = "VisualizeWhitespace"; -static const char visualizeIndentKey[] = "VisualizeIndent"; -static const char displayFoldingMarkersKey[] = "DisplayFoldingMarkers"; -static const char highlightCurrentLineKey[] = "HighlightCurrentLine2Key"; -static const char highlightBlocksKey[] = "HighlightBlocksKey"; -static const char animateMatchingParenthesesKey[] = "AnimateMatchingParenthesesKey"; -static const char highlightMatchingParenthesesKey[] = "HightlightMatchingParenthesesKey"; -static const char markTextChangesKey[] = "MarkTextChanges"; -static const char autoFoldFirstCommentKey[] = "AutoFoldFirstComment"; -static const char centerCursorOnScrollKey[] = "CenterCursorOnScroll"; -static const char openLinksInNextSplitKey[] = "OpenLinksInNextSplitKey"; -static const char displayFileEncodingKey[] = "DisplayFileEncoding"; -static const char displayFileLineEndingKey[] = "DisplayFileLineEnding"; -static const char scrollBarHighlightsKey[] = "ScrollBarHighlights"; -static const char animateNavigationWithinFileKey[] = "AnimateNavigationWithinFile"; -static const char animateWithinFileTimeMaxKey[] = "AnimateWithinFileTimeMax"; -static const char displayAnnotationsKey[] = "DisplayAnnotations"; -static const char annotationAlignmentKey[] = "AnnotationAlignment"; -static const char minimalAnnotationContentKey[] = "MinimalAnnotationContent"; -static const char groupPostfix[] = "textDisplaySettings"; +using namespace Utils; namespace TextEditor { -void DisplaySettings::toSettings(QSettings *s) const +const char displayLineNumbersKey[] = "DisplayLineNumbers"; +const char textWrappingKey[] = "TextWrapping"; +const char visualizeWhitespaceKey[] = "VisualizeWhitespace"; +const char visualizeIndentKey[] = "VisualizeIndent"; +const char displayFoldingMarkersKey[] = "DisplayFoldingMarkers"; +const char highlightCurrentLineKey[] = "HighlightCurrentLine2Key"; +const char highlightBlocksKey[] = "HighlightBlocksKey"; +const char animateMatchingParenthesesKey[] = "AnimateMatchingParenthesesKey"; +const char highlightMatchingParenthesesKey[] = "HightlightMatchingParenthesesKey"; +const char markTextChangesKey[] = "MarkTextChanges"; +const char autoFoldFirstCommentKey[] = "AutoFoldFirstComment"; +const char centerCursorOnScrollKey[] = "CenterCursorOnScroll"; +const char openLinksInNextSplitKey[] = "OpenLinksInNextSplitKey"; +const char displayFileEncodingKey[] = "DisplayFileEncoding"; +const char displayFileLineEndingKey[] = "DisplayFileLineEnding"; +const char scrollBarHighlightsKey[] = "ScrollBarHighlights"; +const char animateNavigationWithinFileKey[] = "AnimateNavigationWithinFile"; +const char animateWithinFileTimeMaxKey[] = "AnimateWithinFileTimeMax"; +const char displayAnnotationsKey[] = "DisplayAnnotations"; +const char annotationAlignmentKey[] = "AnnotationAlignment"; +const char minimalAnnotationContentKey[] = "MinimalAnnotationContent"; +const char groupPostfix[] = "textDisplaySettings"; + +void DisplaySettings::toSettings(QtcSettings *s) const { s->beginGroup(groupPostfix); - s->setValue(QLatin1String(displayLineNumbersKey), m_displayLineNumbers); - s->setValue(QLatin1String(textWrappingKey), m_textWrapping); - s->setValue(QLatin1String(visualizeWhitespaceKey), m_visualizeWhitespace); - s->setValue(QLatin1String(visualizeIndentKey), m_visualizeIndent); - s->setValue(QLatin1String(displayFoldingMarkersKey), m_displayFoldingMarkers); - s->setValue(QLatin1String(highlightCurrentLineKey), m_highlightCurrentLine); - s->setValue(QLatin1String(highlightBlocksKey), m_highlightBlocks); - s->setValue(QLatin1String(animateMatchingParenthesesKey), m_animateMatchingParentheses); - s->setValue(QLatin1String(highlightMatchingParenthesesKey), m_highlightMatchingParentheses); - s->setValue(QLatin1String(markTextChangesKey), m_markTextChanges); - s->setValue(QLatin1String(autoFoldFirstCommentKey), m_autoFoldFirstComment); - s->setValue(QLatin1String(centerCursorOnScrollKey), m_centerCursorOnScroll); - s->setValue(QLatin1String(openLinksInNextSplitKey), m_openLinksInNextSplit); - s->setValue(QLatin1String(displayFileEncodingKey), m_displayFileEncoding); - s->setValue(QLatin1String(displayFileLineEndingKey), m_displayFileLineEnding); - s->setValue(QLatin1String(scrollBarHighlightsKey), m_scrollBarHighlights); - s->setValue(QLatin1String(animateNavigationWithinFileKey), m_animateNavigationWithinFile); - s->setValue(QLatin1String(displayAnnotationsKey), m_displayAnnotations); - s->setValue(QLatin1String(annotationAlignmentKey), static_cast<int>(m_annotationAlignment)); + s->setValue(displayLineNumbersKey, m_displayLineNumbers); + s->setValue(textWrappingKey, m_textWrapping); + s->setValue(visualizeWhitespaceKey, m_visualizeWhitespace); + s->setValue(visualizeIndentKey, m_visualizeIndent); + s->setValue(displayFoldingMarkersKey, m_displayFoldingMarkers); + s->setValue(highlightCurrentLineKey, m_highlightCurrentLine); + s->setValue(highlightBlocksKey, m_highlightBlocks); + s->setValue(animateMatchingParenthesesKey, m_animateMatchingParentheses); + s->setValue(highlightMatchingParenthesesKey, m_highlightMatchingParentheses); + s->setValue(markTextChangesKey, m_markTextChanges); + s->setValue(autoFoldFirstCommentKey, m_autoFoldFirstComment); + s->setValue(centerCursorOnScrollKey, m_centerCursorOnScroll); + s->setValue(openLinksInNextSplitKey, m_openLinksInNextSplit); + s->setValue(displayFileEncodingKey, m_displayFileEncoding); + s->setValue(displayFileLineEndingKey, m_displayFileLineEnding); + s->setValue(scrollBarHighlightsKey, m_scrollBarHighlights); + s->setValue(animateNavigationWithinFileKey, m_animateNavigationWithinFile); + s->setValue(displayAnnotationsKey, m_displayAnnotations); + s->setValue(annotationAlignmentKey, static_cast<int>(m_annotationAlignment)); s->endGroup(); } -void DisplaySettings::fromSettings(QSettings *s) +void DisplaySettings::fromSettings(QtcSettings *s) { s->beginGroup(groupPostfix); *this = DisplaySettings(); // Assign defaults - m_displayLineNumbers = s->value(QLatin1String(displayLineNumbersKey), m_displayLineNumbers).toBool(); - m_textWrapping = s->value(QLatin1String(textWrappingKey), m_textWrapping).toBool(); - m_visualizeWhitespace = s->value(QLatin1String(visualizeWhitespaceKey), m_visualizeWhitespace).toBool(); - m_visualizeIndent = s->value(QLatin1String(visualizeIndentKey), m_visualizeIndent).toBool(); - m_displayFoldingMarkers = s->value(QLatin1String(displayFoldingMarkersKey), m_displayFoldingMarkers).toBool(); - m_highlightCurrentLine = s->value(QLatin1String(highlightCurrentLineKey), m_highlightCurrentLine).toBool(); - m_highlightBlocks = s->value(QLatin1String(highlightBlocksKey), m_highlightBlocks).toBool(); - m_animateMatchingParentheses = s->value(QLatin1String(animateMatchingParenthesesKey), m_animateMatchingParentheses).toBool(); - m_highlightMatchingParentheses = s->value(QLatin1String(highlightMatchingParenthesesKey), m_highlightMatchingParentheses).toBool(); - m_markTextChanges = s->value(QLatin1String(markTextChangesKey), m_markTextChanges).toBool(); - m_autoFoldFirstComment = s->value(QLatin1String(autoFoldFirstCommentKey), m_autoFoldFirstComment).toBool(); - m_centerCursorOnScroll = s->value(QLatin1String(centerCursorOnScrollKey), m_centerCursorOnScroll).toBool(); - m_openLinksInNextSplit = s->value(QLatin1String(openLinksInNextSplitKey), m_openLinksInNextSplit).toBool(); - m_displayFileEncoding = s->value(QLatin1String(displayFileEncodingKey), m_displayFileEncoding).toBool(); - m_displayFileLineEnding = s->value(QLatin1String(displayFileLineEndingKey), m_displayFileLineEnding).toBool(); - m_scrollBarHighlights = s->value(QLatin1String(scrollBarHighlightsKey), m_scrollBarHighlights).toBool(); - m_animateNavigationWithinFile = s->value(QLatin1String(animateNavigationWithinFileKey), m_animateNavigationWithinFile).toBool(); - m_animateWithinFileTimeMax = s->value(QLatin1String(animateWithinFileTimeMaxKey), m_animateWithinFileTimeMax).toInt(); - m_displayAnnotations = s->value(QLatin1String(displayAnnotationsKey), m_displayAnnotations).toBool(); + m_displayLineNumbers = s->value(displayLineNumbersKey, m_displayLineNumbers).toBool(); + m_textWrapping = s->value(textWrappingKey, m_textWrapping).toBool(); + m_visualizeWhitespace = s->value(visualizeWhitespaceKey, m_visualizeWhitespace).toBool(); + m_visualizeIndent = s->value(visualizeIndentKey, m_visualizeIndent).toBool(); + m_displayFoldingMarkers = s->value(displayFoldingMarkersKey, m_displayFoldingMarkers).toBool(); + m_highlightCurrentLine = s->value(highlightCurrentLineKey, m_highlightCurrentLine).toBool(); + m_highlightBlocks = s->value(highlightBlocksKey, m_highlightBlocks).toBool(); + m_animateMatchingParentheses = s->value(animateMatchingParenthesesKey, m_animateMatchingParentheses).toBool(); + m_highlightMatchingParentheses = s->value(highlightMatchingParenthesesKey, m_highlightMatchingParentheses).toBool(); + m_markTextChanges = s->value(markTextChangesKey, m_markTextChanges).toBool(); + m_autoFoldFirstComment = s->value(autoFoldFirstCommentKey, m_autoFoldFirstComment).toBool(); + m_centerCursorOnScroll = s->value(centerCursorOnScrollKey, m_centerCursorOnScroll).toBool(); + m_openLinksInNextSplit = s->value(openLinksInNextSplitKey, m_openLinksInNextSplit).toBool(); + m_displayFileEncoding = s->value(displayFileEncodingKey, m_displayFileEncoding).toBool(); + m_displayFileLineEnding = s->value(displayFileLineEndingKey, m_displayFileLineEnding).toBool(); + m_scrollBarHighlights = s->value(scrollBarHighlightsKey, m_scrollBarHighlights).toBool(); + m_animateNavigationWithinFile = s->value(animateNavigationWithinFileKey, m_animateNavigationWithinFile).toBool(); + m_animateWithinFileTimeMax = s->value(animateWithinFileTimeMaxKey, m_animateWithinFileTimeMax).toInt(); + m_displayAnnotations = s->value(displayAnnotationsKey, m_displayAnnotations).toBool(); m_annotationAlignment = static_cast<TextEditor::AnnotationAlignment>( - s->value(QLatin1String(annotationAlignmentKey), + s->value(annotationAlignmentKey, static_cast<int>(m_annotationAlignment)).toInt()); - m_minimalAnnotationContent = s->value(QLatin1String(minimalAnnotationContentKey), m_minimalAnnotationContent).toInt(); + m_minimalAnnotationContent = s->value(minimalAnnotationContentKey, m_minimalAnnotationContent).toInt(); s->endGroup(); } diff --git a/src/plugins/texteditor/displaysettings.h b/src/plugins/texteditor/displaysettings.h index 635a17b2485..1c8a27f037d 100644 --- a/src/plugins/texteditor/displaysettings.h +++ b/src/plugins/texteditor/displaysettings.h @@ -8,10 +8,11 @@ #include "QMetaType" QT_BEGIN_NAMESPACE -class QSettings; class QLabel; QT_END_NAMESPACE +namespace Utils { class QtcSettings; } + namespace TextEditor { enum class AnnotationAlignment @@ -27,8 +28,8 @@ class TEXTEDITOR_EXPORT DisplaySettings public: DisplaySettings() = default; - void toSettings(QSettings *s) const; - void fromSettings(QSettings *s); + void toSettings(Utils::QtcSettings *s) const; + void fromSettings(Utils::QtcSettings *s); friend bool operator==(const DisplaySettings &t1, const DisplaySettings &t2) { return t1.equals(t2); } friend bool operator!=(const DisplaySettings &t1, const DisplaySettings &t2) { return !t1.equals(t2); } diff --git a/src/plugins/texteditor/findincurrentfile.cpp b/src/plugins/texteditor/findincurrentfile.cpp index d26b3cea2b4..b3f749977a0 100644 --- a/src/plugins/texteditor/findincurrentfile.cpp +++ b/src/plugins/texteditor/findincurrentfile.cpp @@ -9,7 +9,7 @@ #include <coreplugin/editormanager/ieditor.h> #include <coreplugin/editormanager/editormanager.h> -#include <QSettings> +#include <utils/qtcsettings.h> using namespace Utils; @@ -73,17 +73,16 @@ void FindInCurrentFile::handleFileChange(Core::IEditor *editor) } } - -void FindInCurrentFile::writeSettings(QSettings *settings) +void FindInCurrentFile::writeSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String("FindInCurrentFile")); + settings->beginGroup("FindInCurrentFile"); writeCommonSettings(settings); settings->endGroup(); } -void FindInCurrentFile::readSettings(QSettings *settings) +void FindInCurrentFile::readSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String("FindInCurrentFile")); + settings->beginGroup("FindInCurrentFile"); readCommonSettings(settings, "*", ""); settings->endGroup(); } diff --git a/src/plugins/texteditor/findincurrentfile.h b/src/plugins/texteditor/findincurrentfile.h index 7b0b17712c8..e551db0b7f1 100644 --- a/src/plugins/texteditor/findincurrentfile.h +++ b/src/plugins/texteditor/findincurrentfile.h @@ -25,8 +25,8 @@ public: QString id() const override; QString displayName() const override; bool isEnabled() const override; - void writeSettings(QSettings *settings) override; - void readSettings(QSettings *settings) override; + void writeSettings(Utils::QtcSettings *settings) override; + void readSettings(Utils::QtcSettings *settings) override; protected: QString label() const override; diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index d780d1b1fbd..3fa4de9b59a 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -174,16 +174,16 @@ QWidget *FindInFiles::createConfigWidget() return m_configWidget; } -void FindInFiles::writeSettings(QSettings *settings) +void FindInFiles::writeSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String("FindInFiles")); + settings->beginGroup("FindInFiles"); writeCommonSettings(settings); settings->endGroup(); } -void FindInFiles::readSettings(QSettings *settings) +void FindInFiles::readSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String("FindInFiles")); + settings->beginGroup("FindInFiles"); readCommonSettings(settings, "*.cpp,*.h", "*/.git/*,*/.cvs/*,*/.svn/*,*.autosave"); settings->endGroup(); } diff --git a/src/plugins/texteditor/findinfiles.h b/src/plugins/texteditor/findinfiles.h index 8510d99a51f..49c78d2a74b 100644 --- a/src/plugins/texteditor/findinfiles.h +++ b/src/plugins/texteditor/findinfiles.h @@ -12,7 +12,10 @@ class QComboBox; class QStackedWidget; QT_END_NAMESPACE -namespace Utils { class PathChooser; } +namespace Utils { +class PathChooser; +class QtcSettings; +} // Utils namespace TextEditor { @@ -27,8 +30,8 @@ public: QString id() const override; QString displayName() const override; QWidget *createConfigWidget() override; - void writeSettings(QSettings *settings) override; - void readSettings(QSettings *settings) override; + void writeSettings(Utils::QtcSettings *settings) override; + void readSettings(Utils::QtcSettings *settings) override; bool isValid() const override; void setDirectory(const Utils::FilePath &directory); diff --git a/src/plugins/texteditor/findinopenfiles.cpp b/src/plugins/texteditor/findinopenfiles.cpp index f4449ea3fc7..52c04d3b1d0 100644 --- a/src/plugins/texteditor/findinopenfiles.cpp +++ b/src/plugins/texteditor/findinopenfiles.cpp @@ -9,7 +9,7 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/documentmodel.h> -#include <QSettings> +#include <utils/qtcsettings.h> using namespace Utils; @@ -70,16 +70,16 @@ bool FindInOpenFiles::isEnabled() const return Core::DocumentModel::entryCount() > 0; } -void FindInOpenFiles::writeSettings(QSettings *settings) +void FindInOpenFiles::writeSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String("FindInOpenFiles")); + settings->beginGroup("FindInOpenFiles"); writeCommonSettings(settings); settings->endGroup(); } -void FindInOpenFiles::readSettings(QSettings *settings) +void FindInOpenFiles::readSettings(QtcSettings *settings) { - settings->beginGroup(QLatin1String("FindInOpenFiles")); + settings->beginGroup("FindInOpenFiles"); readCommonSettings(settings, "*", ""); settings->endGroup(); } diff --git a/src/plugins/texteditor/findinopenfiles.h b/src/plugins/texteditor/findinopenfiles.h index 969a5ea5318..8e2f42695a0 100644 --- a/src/plugins/texteditor/findinopenfiles.h +++ b/src/plugins/texteditor/findinopenfiles.h @@ -18,8 +18,8 @@ public: QString id() const override; QString displayName() const override; bool isEnabled() const override; - void writeSettings(QSettings *settings) override; - void readSettings(QSettings *settings) override; + void writeSettings(Utils::QtcSettings *settings) override; + void readSettings(Utils::QtcSettings *settings) override; protected: QString label() const override; diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp index 873be0ae78a..c9c0a95fed1 100644 --- a/src/plugins/texteditor/fontsettings.cpp +++ b/src/plugins/texteditor/fontsettings.cpp @@ -56,57 +56,57 @@ void FontSettings::clear() clearCaches(); } -static QString settingsGroup() +static Key settingsGroup() { - return Utils::settingsKey(TextEditor::Constants::TEXT_EDITOR_SETTINGS_CATEGORY); + return keyFromString(Utils::settingsKey(TextEditor::Constants::TEXT_EDITOR_SETTINGS_CATEGORY)); } -void FontSettings::toSettings(QSettings *s) const +void FontSettings::toSettings(QtcSettings *s) const { s->beginGroup(settingsGroup()); - if (m_family != defaultFixedFontFamily() || s->contains(QLatin1String(fontFamilyKey))) - s->setValue(QLatin1String(fontFamilyKey), m_family); + if (m_family != defaultFixedFontFamily() || s->contains(fontFamilyKey)) + s->setValue(fontFamilyKey, m_family); - if (m_fontSize != defaultFontSize() || s->contains(QLatin1String(fontSizeKey))) - s->setValue(QLatin1String(fontSizeKey), m_fontSize); + if (m_fontSize != defaultFontSize() || s->contains(fontSizeKey)) + s->setValue(fontSizeKey, m_fontSize); - if (m_fontZoom!= 100 || s->contains(QLatin1String(fontZoomKey))) - s->setValue(QLatin1String(fontZoomKey), m_fontZoom); + if (m_fontZoom!= 100 || s->contains(fontZoomKey)) + s->setValue(fontZoomKey, m_fontZoom); - if (m_lineSpacing != 100 || s->contains(QLatin1String(lineSpacingKey))) - s->setValue(QLatin1String(lineSpacingKey), m_lineSpacing); + if (m_lineSpacing != 100 || s->contains(lineSpacingKey)) + s->setValue(lineSpacingKey, m_lineSpacing); - if (m_antialias != DEFAULT_ANTIALIAS || s->contains(QLatin1String(antialiasKey))) - s->setValue(QLatin1String(antialiasKey), m_antialias); + if (m_antialias != DEFAULT_ANTIALIAS || s->contains(antialiasKey)) + s->setValue(antialiasKey, m_antialias); - auto schemeFileNames = s->value(QLatin1String(schemeFileNamesKey)).toMap(); + auto schemeFileNames = s->value(schemeFileNamesKey).toMap(); if (m_schemeFileName != defaultSchemeFileName() || schemeFileNames.contains(Utils::creatorTheme()->id())) { schemeFileNames.insert(Utils::creatorTheme()->id(), m_schemeFileName.toSettings()); - s->setValue(QLatin1String(schemeFileNamesKey), schemeFileNames); + s->setValue(schemeFileNamesKey, schemeFileNames); } s->endGroup(); } -bool FontSettings::fromSettings(const FormatDescriptions &descriptions, const QSettings *s) +bool FontSettings::fromSettings(const FormatDescriptions &descriptions, const QtcSettings *s) { clear(); - QString group = settingsGroup(); - if (!s->childGroups().contains(group)) + Key group = settingsGroup(); + if (!s->childGroups().contains(stringFromKey(group))) return false; - group += QLatin1Char('/'); + group = group + '/'; - m_family = s->value(group + QLatin1String(fontFamilyKey), defaultFixedFontFamily()).toString(); - m_fontSize = s->value(group + QLatin1String(fontSizeKey), m_fontSize).toInt(); - m_fontZoom= s->value(group + QLatin1String(fontZoomKey), m_fontZoom).toInt(); - m_lineSpacing = s->value(group + QLatin1String(lineSpacingKey), m_lineSpacing).toInt(); - m_antialias = s->value(group + QLatin1String(antialiasKey), DEFAULT_ANTIALIAS).toBool(); + m_family = s->value(group + fontFamilyKey, defaultFixedFontFamily()).toString(); + m_fontSize = s->value(group + fontSizeKey, m_fontSize).toInt(); + m_fontZoom= s->value(group + fontZoomKey, m_fontZoom).toInt(); + m_lineSpacing = s->value(group + lineSpacingKey, m_lineSpacing).toInt(); + m_antialias = s->value(group + antialiasKey, DEFAULT_ANTIALIAS).toBool(); - if (s->contains(group + QLatin1String(schemeFileNamesKey))) { + if (s->contains(group + schemeFileNamesKey)) { // Load the selected color scheme for the current theme - auto schemeFileNames = s->value(group + QLatin1String(schemeFileNamesKey)).toMap(); + auto schemeFileNames = s->value(group + schemeFileNamesKey).toMap(); if (schemeFileNames.contains(Utils::creatorTheme()->id())) { const FilePath scheme = FilePath::fromSettings(schemeFileNames.value(Utils::creatorTheme()->id())); loadColorScheme(scheme, descriptions); diff --git a/src/plugins/texteditor/fontsettings.h b/src/plugins/texteditor/fontsettings.h index 44cb074c492..c6924128b0e 100644 --- a/src/plugins/texteditor/fontsettings.h +++ b/src/plugins/texteditor/fontsettings.h @@ -17,10 +17,11 @@ #include <QVector> QT_BEGIN_NAMESPACE -class QSettings; class QFont; QT_END_NAMESPACE +namespace Utils { class QtcSettings; } + namespace TextEditor { class FormatDescription; @@ -37,10 +38,10 @@ public: void clear(); inline bool isEmpty() const { return m_scheme.isEmpty(); } - void toSettings(QSettings *s) const; + void toSettings(Utils::QtcSettings *s) const; bool fromSettings(const FormatDescriptions &descriptions, - const QSettings *s); + const Utils::QtcSettings *s); QVector<QTextCharFormat> toTextCharFormats(const QVector<TextStyle> &categories) const; QTextCharFormat toTextCharFormat(TextStyle category) const; diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index 44889864059..369389a513f 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -767,7 +767,7 @@ void FontSettingsPageWidget::finish() FontSettingsPage::FontSettingsPage(FontSettings *fontSettings, const FormatDescriptions &fd) { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); if (settings) fontSettings->fromSettings(fd, settings); diff --git a/src/plugins/texteditor/highlighter.cpp b/src/plugins/texteditor/highlighter.cpp index 4512b71910f..cc7bc395bd1 100644 --- a/src/plugins/texteditor/highlighter.cpp +++ b/src/plugins/texteditor/highlighter.cpp @@ -138,10 +138,10 @@ Highlighter::Definitions Highlighter::definitionsForDocument(const TextDocument return definitions; } -static Highlighter::Definition definitionForSetting(const QString &settingsKey, +static Highlighter::Definition definitionForSetting(const Key &settingsKey, const QString &mapKey) { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(Constants::HIGHLIGHTER_SETTINGS_CATEGORY); const QString &definitionName = settings->value(settingsKey).toMap().value(mapKey).toString(); settings->endGroup(); @@ -188,23 +188,23 @@ void Highlighter::rememberDefinitionForDocument(const Highlighter::Definition &d const QString &mimeType = document->mimeType(); const FilePath &path = document->filePath(); const QString &fileExtension = path.completeSuffix(); - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(Constants::HIGHLIGHTER_SETTINGS_CATEGORY); const Definitions &fileNameDefinitions = definitionsForFileName(path); if (fileNameDefinitions.contains(definition)) { if (!fileExtension.isEmpty()) { - const QString id(kDefinitionForExtension); + const Key id(kDefinitionForExtension); QMap<QString, QVariant> map = settings->value(id).toMap(); map.insert(fileExtension, definition.name()); settings->setValue(id, map); } else if (!path.isEmpty()) { - const QString id(kDefinitionForFilePath); + const Key id(kDefinitionForFilePath); QMap<QString, QVariant> map = settings->value(id).toMap(); map.insert(path.absoluteFilePath().toString(), definition.name()); settings->setValue(id, map); } } else if (!mimeType.isEmpty()) { - const QString id(kDefinitionForMimeType); + const Key id(kDefinitionForMimeType); QMap<QString, QVariant> map = settings->value(id).toMap(); map.insert(mimeType, definition.name()); settings->setValue(id, map); @@ -214,7 +214,7 @@ void Highlighter::rememberDefinitionForDocument(const Highlighter::Definition &d void Highlighter::clearDefinitionForDocumentCache() { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(Constants::HIGHLIGHTER_SETTINGS_CATEGORY); settings->remove(kDefinitionForMimeType); settings->remove(kDefinitionForExtension); @@ -227,7 +227,8 @@ void Highlighter::addCustomHighlighterPath(const FilePath &path) highlightRepository()->addCustomSearchPath(path.toString()); } -void Highlighter::downloadDefinitions(std::function<void()> callback) { +void Highlighter::downloadDefinitions(std::function<void()> callback) +{ auto downloader = new KSyntaxHighlighting::DefinitionDownloader(highlightRepository()); connect(downloader, &KSyntaxHighlighting::DefinitionDownloader::done, [downloader, callback]() { diff --git a/src/plugins/texteditor/highlightersettings.cpp b/src/plugins/texteditor/highlightersettings.cpp index 095295162ad..b93faa76105 100644 --- a/src/plugins/texteditor/highlightersettings.cpp +++ b/src/plugins/texteditor/highlightersettings.cpp @@ -7,34 +7,34 @@ #include <coreplugin/icore.h> -#include <QSettings> +#include <utils/qtcsettings.h> using namespace Utils; namespace TextEditor { -const QLatin1String kDefinitionFilesPath("UserDefinitionFilesPath"); -const QLatin1String kIgnoredFilesPatterns("IgnoredFilesPatterns"); +const char kDefinitionFilesPath[] = "UserDefinitionFilesPath"; +const char kIgnoredFilesPatterns[] = "IgnoredFilesPatterns"; -static QString groupSpecifier(const QString &postFix, const QString &category) +static Key groupSpecifier(const Key &postFix, const Key &category) { if (category.isEmpty()) return postFix; - return QString(category + postFix); + return Key(category + postFix); } -void HighlighterSettings::toSettings(const QString &category, QSettings *s) const +void HighlighterSettings::toSettings(const Key &category, QtcSettings *s) const { - const QString &group = groupSpecifier(Constants::HIGHLIGHTER_SETTINGS_CATEGORY, category); + const Key group = groupSpecifier(Constants::HIGHLIGHTER_SETTINGS_CATEGORY, category); s->beginGroup(group); s->setValue(kDefinitionFilesPath, m_definitionFilesPath.toSettings()); s->setValue(kIgnoredFilesPatterns, ignoredFilesPatterns()); s->endGroup(); } -void HighlighterSettings::fromSettings(const QString &category, QSettings *s) +void HighlighterSettings::fromSettings(const Key &category, QtcSettings *s) { - const QString &group = groupSpecifier(Constants::HIGHLIGHTER_SETTINGS_CATEGORY, category); + const Key group = groupSpecifier(Constants::HIGHLIGHTER_SETTINGS_CATEGORY, category); s->beginGroup(group); m_definitionFilesPath = FilePath::fromSettings(s->value(kDefinitionFilesPath)); if (!s->contains(kDefinitionFilesPath)) diff --git a/src/plugins/texteditor/highlightersettings.h b/src/plugins/texteditor/highlightersettings.h index adbe828bfb0..4082901c992 100644 --- a/src/plugins/texteditor/highlightersettings.h +++ b/src/plugins/texteditor/highlightersettings.h @@ -10,9 +10,10 @@ #include <QList> #include <QRegularExpression> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace Utils { +class Key; +class QtcSettings; +} // Utils namespace TextEditor { @@ -21,8 +22,8 @@ class HighlighterSettings public: HighlighterSettings() = default; - void toSettings(const QString &category, QSettings *s) const; - void fromSettings(const QString &category, QSettings *s); + void toSettings(const Utils::Key &category, Utils::QtcSettings *s) const; + void fromSettings(const Utils::Key &category, Utils::QtcSettings *s); void setDefinitionFilesPath(const Utils::FilePath &path) { m_definitionFilesPath = path; } const Utils::FilePath &definitionFilesPath() const { return m_definitionFilesPath; } diff --git a/src/plugins/texteditor/highlightersettingspage.cpp b/src/plugins/texteditor/highlightersettingspage.cpp index 856a181009d..8b704a7157a 100644 --- a/src/plugins/texteditor/highlightersettingspage.cpp +++ b/src/plugins/texteditor/highlightersettingspage.cpp @@ -51,7 +51,7 @@ public: } bool m_initialized = false; - const QString m_settingsPrefix{"Text"}; + const Key m_settingsPrefix{"Text"}; HighlighterSettings m_settings; diff --git a/src/plugins/texteditor/marginsettings.cpp b/src/plugins/texteditor/marginsettings.cpp index de564ba8486..f47e326c92c 100644 --- a/src/plugins/texteditor/marginsettings.cpp +++ b/src/plugins/texteditor/marginsettings.cpp @@ -5,16 +5,18 @@ #include <QSettings> -static const char showWrapColumnKey[] = "ShowMargin"; -static const char wrapColumnKey[] = "MarginColumn"; -static const char groupPostfix[] = "textMarginSettings"; -static const char useIndenterColumnKey[] = "UseIndenter"; -static const char tintMarginAreaColumnKey[] = "tintMarginArea"; +#include <utils/qtcsettings.h> using namespace Utils; namespace TextEditor { +const char showWrapColumnKey[] = "ShowMargin"; +const char wrapColumnKey[] = "MarginColumn"; +const char groupPostfix[] = "textMarginSettings"; +const char useIndenterColumnKey[] = "UseIndenter"; +const char tintMarginAreaColumnKey[] = "tintMarginArea"; + MarginSettings::MarginSettings() : m_showMargin(false) , m_tintMarginArea(true) @@ -23,25 +25,25 @@ MarginSettings::MarginSettings() { } -void MarginSettings::toSettings(QSettings *s) const +void MarginSettings::toSettings(QtcSettings *s) const { s->beginGroup(groupPostfix); - s->setValue(QLatin1String(showWrapColumnKey), m_showMargin); - s->setValue(QLatin1String(tintMarginAreaColumnKey), m_tintMarginArea); - s->setValue(QLatin1String(useIndenterColumnKey), m_useIndenter); - s->setValue(QLatin1String(wrapColumnKey), m_marginColumn); + s->setValue(showWrapColumnKey, m_showMargin); + s->setValue(tintMarginAreaColumnKey, m_tintMarginArea); + s->setValue(useIndenterColumnKey, m_useIndenter); + s->setValue(wrapColumnKey, m_marginColumn); s->endGroup(); } -void MarginSettings::fromSettings(QSettings *s) +void MarginSettings::fromSettings(QtcSettings *s) { s->beginGroup(groupPostfix); *this = MarginSettings(); // Assign defaults - m_showMargin = s->value(QLatin1String(showWrapColumnKey), m_showMargin).toBool(); - m_tintMarginArea = s->value(QLatin1String(tintMarginAreaColumnKey), m_tintMarginArea).toBool(); - m_useIndenter = s->value(QLatin1String(useIndenterColumnKey), m_useIndenter).toBool(); - m_marginColumn = s->value(QLatin1String(wrapColumnKey), m_marginColumn).toInt(); + m_showMargin = s->value(showWrapColumnKey, m_showMargin).toBool(); + m_tintMarginArea = s->value(tintMarginAreaColumnKey, m_tintMarginArea).toBool(); + m_useIndenter = s->value(useIndenterColumnKey, m_useIndenter).toBool(); + m_marginColumn = s->value(wrapColumnKey, m_marginColumn).toInt(); s->endGroup(); } diff --git a/src/plugins/texteditor/marginsettings.h b/src/plugins/texteditor/marginsettings.h index cf5c1c0aaab..903e1c6d00f 100644 --- a/src/plugins/texteditor/marginsettings.h +++ b/src/plugins/texteditor/marginsettings.h @@ -7,10 +7,6 @@ #include <utils/store.h> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - namespace TextEditor { class TEXTEDITOR_EXPORT MarginSettings @@ -18,8 +14,8 @@ class TEXTEDITOR_EXPORT MarginSettings public: MarginSettings(); - void toSettings(QSettings *s) const; - void fromSettings(QSettings *s); + void toSettings(Utils::QtcSettings *s) const; + void fromSettings(Utils::QtcSettings *s); Utils::Store toMap() const; void fromMap(const Utils::Store &map); diff --git a/src/plugins/texteditor/markdowneditor.cpp b/src/plugins/texteditor/markdowneditor.cpp index 6a168294ae6..43face29777 100644 --- a/src/plugins/texteditor/markdowneditor.cpp +++ b/src/plugins/texteditor/markdowneditor.cpp @@ -12,6 +12,9 @@ #include <coreplugin/coreplugintr.h> #include <coreplugin/icore.h> #include <coreplugin/minisplitter.h> + +#include <utils/qtcsettings.h> +#include <utils/qtcsettings.h> #include <utils/stringutils.h> #include <utils/utilsicons.h> @@ -23,6 +26,8 @@ #include <optional> +using namespace Utils; + namespace TextEditor::Internal { const char MARKDOWNVIEWER_ID[] = "Editors.MarkdownViewer"; @@ -43,7 +48,7 @@ public: { m_document->setMimeType(MARKDOWNVIEWER_MIME_TYPE); - QSettings *s = Core::ICore::settings(); + QtcSettings *s = Core::ICore::settings(); const bool textEditorRight = s->value(MARKDOWNVIEWER_TEXTEDITOR_RIGHT, kTextEditorRightDefault).toBool(); const bool showPreview = s->value(MARKDOWNVIEWER_SHOW_PREVIEW, kShowPreviewDefault).toBool(); diff --git a/src/plugins/texteditor/outlinefactory.cpp b/src/plugins/texteditor/outlinefactory.cpp index 2b2cc5e73af..2c462127026 100644 --- a/src/plugins/texteditor/outlinefactory.cpp +++ b/src/plugins/texteditor/outlinefactory.cpp @@ -13,6 +13,7 @@ #include <utils/utilsicons.h> #include <utils/qtcassert.h> +#include <utils/store.h> #include <utils/stylehelper.h> #include <QDebug> @@ -21,6 +22,8 @@ #include <QStackedWidget> #include <QToolButton> +using namespace Utils; + namespace TextEditor { static QList<IOutlineWidgetFactory *> g_outlineWidgetFactories; @@ -54,8 +57,8 @@ public: QList<QToolButton *> toolButtons(); - void saveSettings(QSettings *settings, int position); - void restoreSettings(QSettings *settings, int position); + void saveSettings(Utils::QtcSettings *settings, int position); + void restoreSettings(Utils::QtcSettings *settings, int position); private: bool isCursorSynchronized() const; @@ -131,32 +134,33 @@ QList<QToolButton *> OutlineWidgetStack::toolButtons() OutlineWidgetStack::~OutlineWidgetStack() = default; -void OutlineWidgetStack::saveSettings(QSettings *settings, int position) +void OutlineWidgetStack::saveSettings(QtcSettings *settings, int position) { - const QString baseKey = QStringLiteral("Outline.%1.").arg(position); - settings->setValue(baseKey + QLatin1String("SyncWithEditor"), m_toggleSync->isChecked()); + const Key baseKey = numberedKey("Outline.", position) + '.'; + settings->setValue(baseKey + "SyncWithEditor", m_toggleSync->isChecked()); for (auto iter = m_widgetSettings.constBegin(); iter != m_widgetSettings.constEnd(); ++iter) - settings->setValue(baseKey + iter.key(), iter.value()); + settings->setValue(baseKey + keyFromString(iter.key()), iter.value()); } -void OutlineWidgetStack::restoreSettings(QSettings *settings, int position) +void OutlineWidgetStack::restoreSettings(Utils::QtcSettings *settings, int position) { - const QString baseKey = QStringLiteral("Outline.%1.").arg(position); + const Key baseKey = numberedKey("Outline.", position) + '.'; + const QString baseKeyString = stringFromKey(baseKey); bool syncWithEditor = true; m_widgetSettings.clear(); const QStringList longKeys = settings->allKeys(); for (const QString &longKey : longKeys) { - if (!longKey.startsWith(baseKey)) + if (!longKey.startsWith(baseKeyString)) continue; - const QString key = longKey.mid(baseKey.length()); + const QString key = longKey.mid(baseKeyString.length()); if (key == QLatin1String("SyncWithEditor")) { - syncWithEditor = settings->value(longKey).toBool(); + syncWithEditor = settings->value(keyFromString(longKey)).toBool(); continue; } - m_widgetSettings.insert(key, settings->value(longKey)); + m_widgetSettings.insert(key, settings->value(keyFromString(longKey))); } m_toggleSync->setChecked(syncWithEditor); diff --git a/src/plugins/texteditor/snippets/snippetssettings.cpp b/src/plugins/texteditor/snippets/snippetssettings.cpp index c041343dad4..cce25bc7109 100644 --- a/src/plugins/texteditor/snippets/snippetssettings.cpp +++ b/src/plugins/texteditor/snippets/snippetssettings.cpp @@ -2,31 +2,27 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "snippetssettings.h" -#include "reuse.h" -#include <QSettings> +#include <utils/qtcsettings.h> -namespace { +using namespace Utils; -static const QLatin1String kGroupPostfix("SnippetsSettings"); -static const QLatin1String kLastUsedSnippetGroup("LastUsedSnippetGroup"); +namespace TextEditor { -} // Anonymous +const char kGroupPostfix[] = "SnippetsSettings"; +const char kLastUsedSnippetGroup[] = "LastUsedSnippetGroup"; -using namespace TextEditor; -using namespace Internal; - -void SnippetsSettings::toSettings(const QString &category, QSettings *s) const +void SnippetsSettings::toSettings(const Key &category, QtcSettings *s) const { - const QString &group = category + kGroupPostfix; + const Key group = category + kGroupPostfix; s->beginGroup(group); s->setValue(kLastUsedSnippetGroup, m_lastUsedSnippetGroup); s->endGroup(); } -void SnippetsSettings::fromSettings(const QString &category, QSettings *s) +void SnippetsSettings::fromSettings(const Key &category, QtcSettings *s) { - const QString &group = category + kGroupPostfix; + const Key group = category + kGroupPostfix; s->beginGroup(group); m_lastUsedSnippetGroup = s->value(kLastUsedSnippetGroup, QString()).toString(); s->endGroup(); @@ -46,3 +42,5 @@ bool SnippetsSettings::equals(const SnippetsSettings &snippetsSettings) const { return m_lastUsedSnippetGroup == snippetsSettings.m_lastUsedSnippetGroup; } + +} // TextEditor diff --git a/src/plugins/texteditor/snippets/snippetssettings.h b/src/plugins/texteditor/snippets/snippetssettings.h index af74fd960a2..732d51f6716 100644 --- a/src/plugins/texteditor/snippets/snippetssettings.h +++ b/src/plugins/texteditor/snippets/snippetssettings.h @@ -5,9 +5,10 @@ #include <QString> -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace Utils { +class Key; +class QtcSettings; +} // Utils namespace TextEditor { @@ -16,8 +17,8 @@ class SnippetsSettings public: SnippetsSettings() = default; - void toSettings(const QString &category, QSettings *s) const; - void fromSettings(const QString &category, QSettings *s); + void toSettings(const Utils::Key &category, Utils::QtcSettings *s) const; + void fromSettings(const Utils::Key &category, Utils::QtcSettings *s); void setLastUsedSnippetGroup(const QString &lastUsed); const QString &lastUsedSnippetGroup() const; diff --git a/src/plugins/texteditor/snippets/snippetssettingspage.cpp b/src/plugins/texteditor/snippets/snippetssettingspage.cpp index e4bfdf7df84..51deff5ad1f 100644 --- a/src/plugins/texteditor/snippets/snippetssettingspage.cpp +++ b/src/plugins/texteditor/snippets/snippetssettingspage.cpp @@ -35,6 +35,8 @@ #include <QStackedWidget> #include <QTextStream> +using namespace Utils; + namespace TextEditor::Internal { // SnippetsTableModel @@ -273,7 +275,7 @@ private: bool settingsChanged() const; void writeSettings(); - const QString m_settingsPrefix{QLatin1String("Text")}; + const Key m_settingsPrefix{"Text"}; SnippetsTableModel m_model; bool m_snippetsCollectionChanged = false; SnippetsSettings m_settings; diff --git a/src/plugins/todo/settings.cpp b/src/plugins/todo/settings.cpp index cf6c0003de8..d5aafadd37f 100644 --- a/src/plugins/todo/settings.cpp +++ b/src/plugins/todo/settings.cpp @@ -6,14 +6,16 @@ #include "constants.h" #include <coreplugin/coreconstants.h> + +#include <utils/qtcsettings.h> #include <utils/theme/theme.h> -#include <QSettings> +using namespace Utils; namespace Todo { namespace Internal { -void Settings::save(QSettings *settings) const +void Settings::save(QtcSettings *settings) const { if (!keywordsEdited) return; @@ -23,9 +25,9 @@ void Settings::save(QSettings *settings) const settings->beginWriteArray(Constants::KEYWORDS_LIST); if (const int size = keywords.size()) { - const QString nameKey = "name"; - const QString colorKey = "color"; - const QString iconTypeKey = "iconType"; + const Key nameKey = "name"; + const Key colorKey = "color"; + const Key iconTypeKey = "iconType"; for (int i = 0; i < size; ++i) { settings->setArrayIndex(i); settings->setValue(nameKey, keywords.at(i).name); @@ -39,7 +41,7 @@ void Settings::save(QSettings *settings) const settings->sync(); } -void Settings::load(QSettings *settings) +void Settings::load(QtcSettings *settings) { setDefault(); @@ -53,9 +55,9 @@ void Settings::load(QSettings *settings) KeywordList newKeywords; const int keywordsSize = settings->beginReadArray(Constants::KEYWORDS_LIST); if (keywordsSize > 0) { - const QString nameKey = "name"; - const QString colorKey = "color"; - const QString iconTypeKey = "iconType"; + const Key nameKey = "name"; + const Key colorKey = "color"; + const Key iconTypeKey = "iconType"; for (int i = 0; i < keywordsSize; ++i) { settings->setArrayIndex(i); Keyword keyword; diff --git a/src/plugins/todo/settings.h b/src/plugins/todo/settings.h index 57dc13990c1..534b1a1b0ca 100644 --- a/src/plugins/todo/settings.h +++ b/src/plugins/todo/settings.h @@ -6,9 +6,7 @@ #include "keyword.h" -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE +namespace Utils { class QtcSettings; } namespace Todo { namespace Internal { @@ -20,14 +18,15 @@ enum ScanningScope { ScanningScopeMax }; -class Settings { +class Settings +{ public: KeywordList keywords; ScanningScope scanningScope = ScanningScopeCurrentFile; bool keywordsEdited = false; - void save(QSettings *settings) const; - void load(QSettings *settings); + void save(Utils::QtcSettings *settings) const; + void load(Utils::QtcSettings *settings); void setDefault(); bool equals(const Settings &other) const; }; diff --git a/src/plugins/todo/todooutputtreeview.cpp b/src/plugins/todo/todooutputtreeview.cpp index 5f20d381de1..a0519d59e94 100644 --- a/src/plugins/todo/todooutputtreeview.cpp +++ b/src/plugins/todo/todooutputtreeview.cpp @@ -7,9 +7,12 @@ #include <coreplugin/icore.h> +#include <utils/qtcsettings.h> + #include <QResizeEvent> #include <QHeaderView> -#include <QSettings> + +using namespace Utils; namespace Todo { namespace Internal { @@ -38,7 +41,7 @@ TodoOutputTreeView::~TodoOutputTreeView() void TodoOutputTreeView::saveDisplaySettings() { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(Constants::SETTINGS_GROUP); settings->setValue(Constants::OUTPUT_PANE_TEXT_WIDTH, columnWidth(Constants::OUTPUT_COLUMN_TEXT)); @@ -49,7 +52,7 @@ void TodoOutputTreeView::saveDisplaySettings() void TodoOutputTreeView::loadDisplaySettings() { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); settings->beginGroup(Constants::SETTINGS_GROUP); m_textColumnDefaultWidth = settings->value(Constants::OUTPUT_PANE_TEXT_WIDTH, 0).toInt(); m_fileColumnDefaultWidth = settings->value(Constants::OUTPUT_PANE_FILE_WIDTH, 0).toInt(); diff --git a/src/plugins/updateinfo/updateinfoplugin.cpp b/src/plugins/updateinfo/updateinfoplugin.cpp index ab134915257..1b631cb82cf 100644 --- a/src/plugins/updateinfo/updateinfoplugin.cpp +++ b/src/plugins/updateinfo/updateinfoplugin.cpp @@ -338,8 +338,8 @@ bool UpdateInfoPlugin::initialize(const QStringList & /* arguments */, QString * void UpdateInfoPlugin::loadSettings() const { UpdateInfoPluginPrivate::Settings def; - QSettings *settings = ICore::settings(); - const QString updaterKey = QLatin1String(UpdaterGroup) + '/'; + QtcSettings *settings = ICore::settings(); + const Key updaterKey = Key(UpdaterGroup) + '/'; d->m_maintenanceTool = FilePath::fromSettings(settings->value(updaterKey + MaintenanceToolKey)); d->m_lastCheckDate = settings->value(updaterKey + LastCheckDateKey, QDate()).toDate(); d->m_settings.automaticCheck diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 219fe800bc1..fe488cc1af8 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -281,7 +281,7 @@ CallgrindToolPrivate::CallgrindToolPrivate() cmd->setAttribute(Command::CA_NonConfigurable); } - QSettings *coreSettings = ICore::settings(); + QtcSettings *coreSettings = ICore::settings(); // // DockWidgets diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 6482f9ac5f5..1cbd522571c 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -800,7 +800,7 @@ void MemcheckToolPrivate::heobAction() .arg( "<a " "href=\"https://github.com/ssbssa/dwarfstack/releases\">Dwarfstack</a>"), - QString("HeobDwarfstackInfo"), + Key("HeobDwarfstackInfo"), QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok) != QMessageBox::Ok) @@ -1187,7 +1187,7 @@ const char heobPathC[] = "Path"; HeobDialog::HeobDialog(QWidget *parent) : QDialog(parent) { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); bool hasSelProfile = settings->contains(heobProfileC); const QString selProfile = hasSelProfile ? settings->value(heobProfileC).toString() : "Heob"; m_profiles = settings->childGroups().filter(QRegularExpression("^Heob\\.Profile\\.")); @@ -1199,7 +1199,7 @@ HeobDialog::HeobDialog(QWidget *parent) : auto profilesLayout = new QHBoxLayout; m_profilesCombo = new QComboBox; for (const auto &profile : std::as_const(m_profiles)) - m_profilesCombo->addItem(settings->value(profile + "/" + heobProfileNameC).toString()); + m_profilesCombo->addItem(settings->value(keyFromString(profile) + "/" + heobProfileNameC).toString()); if (hasSelProfile) { int selIdx = m_profiles.indexOf(selProfile); if (selIdx >= 0) @@ -1402,8 +1402,9 @@ void HeobDialog::keyPressEvent(QKeyEvent *e) void HeobDialog::updateProfile() { - QSettings *settings = Core::ICore::settings(); - const QString selProfile = m_profiles.empty() ? "heob" : m_profiles[m_profilesCombo->currentIndex()]; + QtcSettings *settings = Core::ICore::settings(); + const Key selProfile = + keyFromString(m_profiles.empty() ? "heob" : m_profiles[m_profilesCombo->currentIndex()]); settings->beginGroup(selProfile); const QString xml = settings->value(heobXmlC, "leaks.xml").toString(); @@ -1456,12 +1457,12 @@ void HeobDialog::updateEnabled() void HeobDialog::saveOptions() { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); const QString selProfile = m_profiles.at(m_profilesCombo->currentIndex()); settings->setValue(heobProfileC, selProfile); - settings->beginGroup(selProfile); + settings->beginGroup(keyFromString(selProfile)); settings->setValue(heobProfileNameC, m_profilesCombo->currentText()); settings->setValue(heobXmlC, m_xmlEdit->text()); settings->setValue(heobHandleExceptionC, m_handleExceptionCombo->currentIndex()); @@ -1528,11 +1529,11 @@ void HeobDialog::deleteProfileDialog() void HeobDialog::deleteProfile() { - QSettings *settings = Core::ICore::settings(); + QtcSettings *settings = Core::ICore::settings(); int index = m_profilesCombo->currentIndex(); const QString profile = m_profiles.at(index); bool isDefault = settings->value(heobProfileC).toString() == profile; - settings->remove(profile); + settings->remove(keyFromString(profile)); m_profiles.removeAt(index); m_profilesCombo->removeItem(index); if (isDefault) diff --git a/src/plugins/welcome/introductionwidget.cpp b/src/plugins/welcome/introductionwidget.cpp index ef56d9ab3ed..d89805037af 100644 --- a/src/plugins/welcome/introductionwidget.cpp +++ b/src/plugins/welcome/introductionwidget.cpp @@ -29,7 +29,7 @@ namespace Internal { void IntroductionWidget::askUserAboutIntroduction(QWidget *parent) { // CheckableMessageBox for compatibility with Qt Creator < 4.11 - if (!CheckableDecider(QString(kTakeTourSetting)).shouldAskAgain() + if (!CheckableDecider(Key(kTakeTourSetting)).shouldAskAgain() || !Core::ICore::infoBar()->canInfoBeAdded(kTakeTourSetting)) return; diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 230dd27b936..342375c4e2f 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -399,7 +399,7 @@ WelcomeMode::~WelcomeMode() void WelcomeMode::initPlugins() { - QSettings *settings = ICore::settings(); + QtcSettings *settings = ICore::settings(); m_activePage = Id::fromSetting(settings->value(currentPageSettingsKeyC)); for (IWelcomePage *page : IWelcomePage::allWelcomePages()) diff --git a/src/shared/help/bookmarkmanager.cpp b/src/shared/help/bookmarkmanager.cpp index 2f287f2d310..523b7521c22 100644 --- a/src/shared/help/bookmarkmanager.cpp +++ b/src/shared/help/bookmarkmanager.cpp @@ -720,8 +720,8 @@ void BookmarkManager::setupBookmarkModels() QList<QStandardItem*> parents; QByteArray ba; - QSettings *settings = Core::ICore::settings(); - ba = settings->value(QLatin1String(kBookmarksKey)).toByteArray(); + Utils::QtcSettings *settings = Core::ICore::settings(); + ba = settings->value(kBookmarksKey).toByteArray(); QDataStream stream(ba); while (!stream.atEnd()) { stream >> depth >> name >> type >> expanded; diff --git a/src/tools/qtcreatorcrashhandler/crashhandlerdialog.cpp b/src/tools/qtcreatorcrashhandler/crashhandlerdialog.cpp index c8853f53459..77084cab5ce 100644 --- a/src/tools/qtcreatorcrashhandler/crashhandlerdialog.cpp +++ b/src/tools/qtcreatorcrashhandler/crashhandlerdialog.cpp @@ -10,6 +10,7 @@ #include <utils/checkablemessagebox.h> #include <utils/layoutbuilder.h> +#include <utils/qtcsettings.h> #include <utils/stringutils.h> #include <QApplication> @@ -205,10 +206,10 @@ CrashHandlerDialog::~CrashHandlerDialog() bool CrashHandlerDialog::runDebuggerWhileBacktraceNotFinished() { // Check settings. - QSettings settings(QSettings::IniFormat, - QSettings::UserScope, - QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR), - QLatin1String(SettingsApplication)); + Utils::QtcSettings settings(QSettings::IniFormat, + QSettings::UserScope, + QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR), + QLatin1String(SettingsApplication)); Utils::CheckableMessageBox::initialize(&settings); // Ask user. @@ -224,7 +225,7 @@ bool CrashHandlerDialog::runDebuggerWhileBacktraceNotFinished() = Utils::CheckableMessageBox::question(this, title, message, - QString(SettingsKeySkipWarningAbortingBacktrace), + Utils::Key(SettingsKeySkipWarningAbortingBacktrace), QMessageBox::Yes | QMessageBox::No, QMessageBox::No); diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp index 7ce2617e417..dfeea21344a 100644 --- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp @@ -3,13 +3,6 @@ #include "tst_testcore.h" -#include <QScopedPointer> -#include <QLatin1String> -#include <QGraphicsObject> -#include <QQueue> -#include <QTest> -#include <QVariant> - #include <designersettings.h> #include <externaldependenciesinterface.h> #include <invalididexception.h> @@ -23,7 +16,6 @@ #include <rewritingexception.h> #include <stylesheetmerger.h> #include <subcomponentmanager.h> -#include <QDebug> #include <qmlanchors.h> #include <qmlmodelnodefacade.h> @@ -40,13 +32,21 @@ #include <bytearraymodifier.h> #include "testrewriterview.h" -#include <utils/fileutils.h> #include <qmljs/qmljsinterpreter.h> #include <qmljs/qmljssimplereader.h> #include <extensionsystem/pluginmanager.h> +#include <utils/fileutils.h> +#include <utils/qtcsettings.h> + +#include <QDebug> +#include <QGraphicsObject> #include <QPlainTextEdit> +#include <QQueue> +#include <QScopedPointer> +#include <QTest> +#include <QVariant> //TESTED_COMPONENT=src/plugins/qmldesigner/designercore @@ -164,7 +164,7 @@ public: Utils::FilePath resourcePath(const QString &) const override { return {}; } public: - QSettings qsettings; + Utils::QtcSettings qsettings; QmlDesigner::DesignerSettings settings{&qsettings}; Model *model; }; From b3c23435b4da3a0fdd3f0350f722c4231fce01c7 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 27 Sep 2023 15:18:25 +0200 Subject: [PATCH 1312/1777] ModelEditor: Simplify settings use Change-Id: Ic9a82e09d65a9a8136baea785d01bebb5cea2c58 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/modeleditor/CMakeLists.txt | 1 - src/plugins/modeleditor/modeleditor.qbs | 2 - .../modeleditor/modeleditor_plugin.cpp | 13 +----- .../modeleditor/settingscontroller.cpp | 40 ------------------- src/plugins/modeleditor/settingscontroller.h | 32 --------------- src/plugins/modeleditor/uicontroller.cpp | 10 ++++- src/plugins/modeleditor/uicontroller.h | 6 +-- 7 files changed, 12 insertions(+), 92 deletions(-) delete mode 100644 src/plugins/modeleditor/settingscontroller.cpp delete mode 100644 src/plugins/modeleditor/settingscontroller.h diff --git a/src/plugins/modeleditor/CMakeLists.txt b/src/plugins/modeleditor/CMakeLists.txt index bb21d68692f..aeefa8c47c6 100644 --- a/src/plugins/modeleditor/CMakeLists.txt +++ b/src/plugins/modeleditor/CMakeLists.txt @@ -27,7 +27,6 @@ add_qtc_plugin(ModelEditor pxnodecontroller.cpp pxnodecontroller.h pxnodeutilities.cpp pxnodeutilities.h resources/modeleditor.qrc - settingscontroller.cpp settingscontroller.h uicontroller.cpp uicontroller.h EXPLICIT_MOC actionhandler.h diff --git a/src/plugins/modeleditor/modeleditor.qbs b/src/plugins/modeleditor/modeleditor.qbs index a2ac96adc49..b9ad90bd3e8 100644 --- a/src/plugins/modeleditor/modeleditor.qbs +++ b/src/plugins/modeleditor/modeleditor.qbs @@ -70,8 +70,6 @@ QtcPlugin { "pxnodeutilities.cpp", "pxnodeutilities.h", "resources/modeleditor.qrc", - "settingscontroller.cpp", - "settingscontroller.h", "uicontroller.cpp", "uicontroller.h", ] diff --git a/src/plugins/modeleditor/modeleditor_plugin.cpp b/src/plugins/modeleditor/modeleditor_plugin.cpp index aa98ae10f66..9e89a6ad452 100644 --- a/src/plugins/modeleditor/modeleditor_plugin.cpp +++ b/src/plugins/modeleditor/modeleditor_plugin.cpp @@ -4,11 +4,8 @@ #include "modeleditor_plugin.h" #include "jsextension.h" -#include "modeleditor_constants.h" #include "modeleditorfactory.h" -#include "modeleditor_global.h" #include "modelsmanager.h" -#include "settingscontroller.h" #include "uicontroller.h" #include "actionhandler.h" @@ -41,7 +38,6 @@ public: UiController uiController; ActionHandler actionHandler; ModelEditorFactory modelFactory{&uiController, &actionHandler}; - SettingsController settingsController; }; ModelEditorPlugin::ModelEditorPlugin() @@ -63,22 +59,17 @@ void ModelEditorPlugin::initialize() d = new ModelEditorPluginPrivate; Core::JsExpander::registerGlobalObject<JsExtension>("Modeling"); - - connect(&d->settingsController, &SettingsController::saveSettings, - &d->uiController, [this](Utils::QtcSettings *s) { d->uiController.saveSettings(s); }); - connect(&d->settingsController, &SettingsController::loadSettings, - &d->uiController, [this](Utils::QtcSettings *s) { d->uiController.loadSettings(s); }); } void ModelEditorPlugin::extensionsInitialized() { d->actionHandler.createActions(); - d->settingsController.load(Core::ICore::settings()); + d->uiController.loadSettings(); } ExtensionSystem::IPlugin::ShutdownFlag ModelEditorPlugin::aboutToShutdown() { - d->settingsController.save(Core::ICore::settings()); + d->uiController.saveSettings(); return SynchronousShutdown; } diff --git a/src/plugins/modeleditor/settingscontroller.cpp b/src/plugins/modeleditor/settingscontroller.cpp deleted file mode 100644 index 5bb9b5ff101..00000000000 --- a/src/plugins/modeleditor/settingscontroller.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2016 Jochen Becher -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "settingscontroller.h" - -#include "modeleditor_constants.h" - -#include <utils/qtcsettings.h> - -using namespace Utils; - -namespace ModelEditor { -namespace Internal { - -SettingsController::SettingsController() -{ -} - -void SettingsController::reset() -{ - emit resetSettings(); -} - -void SettingsController::save(QtcSettings *settings) -{ - settings->beginGroup(Constants::SETTINGS_GROUP); - emit saveSettings(settings); - settings->endGroup(); - settings->sync(); -} - -void SettingsController::load(QtcSettings *settings) -{ - settings->beginGroup(Constants::SETTINGS_GROUP); - emit loadSettings(settings); - settings->endGroup(); -} - -} // namespace Internal -} // namespace ModelEditor diff --git a/src/plugins/modeleditor/settingscontroller.h b/src/plugins/modeleditor/settingscontroller.h deleted file mode 100644 index d0d4f496b78..00000000000 --- a/src/plugins/modeleditor/settingscontroller.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2016 Jochen Becher -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <QObject> - -namespace Utils { class QtcSettings; } - -namespace ModelEditor { -namespace Internal { - -class SettingsController : public QObject -{ - Q_OBJECT - -public: - SettingsController(); - -signals: - void resetSettings(); - void saveSettings(Utils::QtcSettings *settings); - void loadSettings(Utils::QtcSettings *settings); - -public: - void reset(); - void save(Utils::QtcSettings *settings); - void load(Utils::QtcSettings *settings); -}; - -} // namespace Internal -} // namespace ModelEditor diff --git a/src/plugins/modeleditor/uicontroller.cpp b/src/plugins/modeleditor/uicontroller.cpp index f354cf3c535..43b02a6ab1e 100644 --- a/src/plugins/modeleditor/uicontroller.cpp +++ b/src/plugins/modeleditor/uicontroller.cpp @@ -5,6 +5,7 @@ #include "modeleditor_constants.h" +#include <coreplugin/icore.h> #include <utils/qtcsettings.h> using namespace Utils; @@ -61,22 +62,27 @@ void UiController::onRightHorizSplitterChanged(const QByteArray &state) emit rightHorizSplitterChanged(state); } -void UiController::saveSettings(QtcSettings *settings) +void UiController::saveSettings() { + QtcSettings *settings = Core::ICore::settings(); if (hasRightSplitterState()) settings->setValue(Constants::SETTINGS_RIGHT_SPLITTER, d->rightSplitterState); if (hasRightHorizSplitterState()) settings->setValue(Constants::SETTINGS_RIGHT_HORIZ_SPLITTER, d->rightHorizSplitterState); + settings->endGroup(); } -void UiController::loadSettings(QtcSettings *settings) +void UiController::loadSettings() { + QtcSettings *settings = Core::ICore::settings(); + settings->beginGroup(Constants::SETTINGS_GROUP); if (settings->contains(Constants::SETTINGS_RIGHT_SPLITTER)) d->rightSplitterState = settings->value(Constants::SETTINGS_RIGHT_SPLITTER).toByteArray(); if (settings->contains(Constants::SETTINGS_RIGHT_HORIZ_SPLITTER)) { d->rightHorizSplitterState = settings->value(Constants::SETTINGS_RIGHT_HORIZ_SPLITTER) .toByteArray(); } + settings->endGroup(); } } // namespace Internal diff --git a/src/plugins/modeleditor/uicontroller.h b/src/plugins/modeleditor/uicontroller.h index 44155a6eaee..96bc06efd1c 100644 --- a/src/plugins/modeleditor/uicontroller.h +++ b/src/plugins/modeleditor/uicontroller.h @@ -5,8 +5,6 @@ #include <QObject> -namespace Utils { class QtcSettings; } - namespace ModelEditor { namespace Internal { @@ -31,8 +29,8 @@ public: void onRightSplitterChanged(const QByteArray &state); void onRightHorizSplitterChanged(const QByteArray &state); - void saveSettings(Utils::QtcSettings *settings); - void loadSettings(Utils::QtcSettings *settings); + void saveSettings(); + void loadSettings(); private: UiControllerPrivate *d; From 0eacd0190d96f0d1eb123f0e9470e28946361fad Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 27 Sep 2023 15:41:10 +0200 Subject: [PATCH 1313/1777] All: Remove some unneeded #includes Change-Id: If9a8fb5e0b32424e3b37ecf3adefc060f86b3630 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/advanceddockingsystem/ads_globals.cpp | 1 - src/libs/utils/aspects.cpp | 1 - src/libs/utils/basetreeview.cpp | 1 - src/libs/utils/fancymainwindow.cpp | 1 - src/libs/utils/infobar.cpp | 1 - src/libs/utils/qtcsettings.h | 3 +-- src/libs/utils/unixutils.cpp | 1 - src/plugins/android/androidsdkmanager.cpp | 1 - src/plugins/baremetal/debugserverproviderchooser.cpp | 1 - .../coreplugin/actionmanager/actionmanager.cpp | 1 - src/plugins/coreplugin/coreplugin.cpp | 1 - src/plugins/coreplugin/dialogs/settingsdialog.cpp | 1 - src/plugins/coreplugin/documentmanager.cpp | 1 - src/plugins/coreplugin/find/findplugin.cpp | 1 - src/plugins/coreplugin/find/findtoolbar.cpp | 1 - src/plugins/coreplugin/find/findtoolwindow.cpp | 1 - src/plugins/coreplugin/navigationwidget.cpp | 4 +--- src/plugins/debugger/debuggerplugin.cpp | 1 - .../debugger/debuggersourcepathmappingwidget.cpp | 1 - src/plugins/git/gerrit/gerritserver.cpp | 1 - src/plugins/git/gitgrep.cpp | 1 - src/plugins/gitlab/gitlabparameters.cpp | 1 - src/plugins/glsleditor/glsleditor.cpp | 1 - src/plugins/help/generalsettingspage.cpp | 1 - src/plugins/imageviewer/multiexportdialog.cpp | 1 - src/plugins/ios/iosprobe.h | 1 - src/plugins/macros/macrosplugin.cpp | 1 - src/plugins/projectexplorer/projecttreewidget.cpp | 1 - src/plugins/projectexplorer/runconfiguration.cpp | 1 - src/plugins/projectexplorer/toolchainmanager.cpp | 2 -- .../propertyeditor/colorpalettebackend.cpp | 1 - src/plugins/qmljseditor/qmljsoutline.cpp | 1 - src/plugins/texteditor/commentssettings.cpp | 1 - src/plugins/texteditor/fontsettings.cpp | 1 - src/plugins/texteditor/fontsettingspage.cpp | 1 - src/plugins/texteditor/marginsettings.cpp | 2 -- src/plugins/todo/todoplugin.cpp | 2 -- .../qml/connectioneditor/tst_connectioneditor.cpp | 7 +++---- tests/auto/qml/reformatter/tst_reformatter.cpp | 12 +++++------- .../infolabel/tst_manual_widgets_infolabel.cpp | 1 - .../tst_manual_widgets_manhattanstyle.cpp | 1 - 41 files changed, 10 insertions(+), 56 deletions(-) diff --git a/src/libs/advanceddockingsystem/ads_globals.cpp b/src/libs/advanceddockingsystem/ads_globals.cpp index 664f10ca8a5..5642651e717 100644 --- a/src/libs/advanceddockingsystem/ads_globals.cpp +++ b/src/libs/advanceddockingsystem/ads_globals.cpp @@ -17,7 +17,6 @@ #if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) #include <QApplication> #include <QFile> -#include <QSettings> #endif namespace ADS { diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index bcd424bd623..5a122937bdb 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -35,7 +35,6 @@ #include <QPushButton> #include <QRadioButton> #include <QScrollArea> -#include <QSettings> #include <QSpinBox> #include <QStandardItemModel> #include <QTextEdit> diff --git a/src/libs/utils/basetreeview.cpp b/src/libs/utils/basetreeview.cpp index 2b3339514c5..01dbe869ca8 100644 --- a/src/libs/utils/basetreeview.cpp +++ b/src/libs/utils/basetreeview.cpp @@ -18,7 +18,6 @@ #include <QMap> #include <QMenu> #include <QMouseEvent> -#include <QSettings> #include <QSortFilterProxyModel> #include <QTimer> diff --git a/src/libs/utils/fancymainwindow.cpp b/src/libs/utils/fancymainwindow.cpp index 0c47be23679..5f2aad9a949 100644 --- a/src/libs/utils/fancymainwindow.cpp +++ b/src/libs/utils/fancymainwindow.cpp @@ -17,7 +17,6 @@ #include <QLabel> #include <QMenu> #include <QPainter> -#include <QSettings> #include <QStyle> #include <QStyleOption> #include <QTimer> diff --git a/src/libs/utils/infobar.cpp b/src/libs/utils/infobar.cpp index 9571d6164f1..4d980b809a5 100644 --- a/src/libs/utils/infobar.cpp +++ b/src/libs/utils/infobar.cpp @@ -13,7 +13,6 @@ #include <QHBoxLayout> #include <QLabel> #include <QPainter> -#include <QSettings> #include <QToolButton> #include <QVBoxLayout> diff --git a/src/libs/utils/qtcsettings.h b/src/libs/utils/qtcsettings.h index e44e8fcb7b8..6b593ef0832 100644 --- a/src/libs/utils/qtcsettings.h +++ b/src/libs/utils/qtcsettings.h @@ -11,8 +11,7 @@ namespace Utils { -// FIXME: In theory, this could be private or aggregated. -class QTCREATOR_UTILS_EXPORT QtcSettings : public QSettings +class QTCREATOR_UTILS_EXPORT QtcSettings : private QSettings { public: using QSettings::QSettings; diff --git a/src/libs/utils/unixutils.cpp b/src/libs/utils/unixutils.cpp index a47c0da6735..2b5937f089d 100644 --- a/src/libs/utils/unixutils.cpp +++ b/src/libs/utils/unixutils.cpp @@ -8,7 +8,6 @@ #include "utilstr.h" #include <QFileInfo> -#include <QSettings> using namespace Utils; diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp index 45dc1009dc8..ca0be7770c4 100644 --- a/src/plugins/android/androidsdkmanager.cpp +++ b/src/plugins/android/androidsdkmanager.cpp @@ -17,7 +17,6 @@ #include <QLoggingCategory> #include <QReadWriteLock> #include <QRegularExpression> -#include <QSettings> #include <QTextCodec> namespace { diff --git a/src/plugins/baremetal/debugserverproviderchooser.cpp b/src/plugins/baremetal/debugserverproviderchooser.cpp index acf25b5a791..ac05c88e0d4 100644 --- a/src/plugins/baremetal/debugserverproviderchooser.cpp +++ b/src/plugins/baremetal/debugserverproviderchooser.cpp @@ -13,7 +13,6 @@ #include <QComboBox> #include <QHBoxLayout> #include <QPushButton> -#include <QSettings> namespace BareMetal::Internal { diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index cdca2ba5fd9..d58fe42cec0 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -19,7 +19,6 @@ #include <QMainWindow> #include <QMenu> #include <QMenuBar> -#include <QSettings> namespace { enum { warnAboutFindFailures = 0 }; diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index c143a3e54a1..cf51496b517 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -49,7 +49,6 @@ #include <QLabel> #include <QMenu> #include <QMessageBox> -#include <QSettings> #include <QUuid> #include <cstdlib> diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 3217a3c3684..f420c0ff492 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -30,7 +30,6 @@ #include <QScrollArea> #include <QScrollBar> #include <QSet> -#include <QSettings> #include <QSortFilterProxyModel> #include <QSpacerItem> #include <QStackedLayout> diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index 38d1d9b2ecb..9c1934103c0 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -46,7 +46,6 @@ #include <QMainWindow> #include <QMenu> #include <QMessageBox> -#include <QSettings> #include <QStringList> #include <QTimer> diff --git a/src/plugins/coreplugin/find/findplugin.cpp b/src/plugins/coreplugin/find/findplugin.cpp index 0aedf610f8c..01e624b9669 100644 --- a/src/plugins/coreplugin/find/findplugin.cpp +++ b/src/plugins/coreplugin/find/findplugin.cpp @@ -27,7 +27,6 @@ #include <QStringListModel> #include <QVector> #include <QAction> -#include <QSettings> /*! \namespace Core::Internal::ItemDataRoles diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index da8c3a1e015..2bffcef810a 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -36,7 +36,6 @@ #include <QLabel> #include <QMenu> #include <QPainter> -#include <QSettings> #include <QSpacerItem> #include <QStringListModel> #include <QToolButton> diff --git a/src/plugins/coreplugin/find/findtoolwindow.cpp b/src/plugins/coreplugin/find/findtoolwindow.cpp index 15ca8542db8..a239d310be6 100644 --- a/src/plugins/coreplugin/find/findtoolwindow.cpp +++ b/src/plugins/coreplugin/find/findtoolwindow.cpp @@ -22,7 +22,6 @@ #include <QPushButton> #include <QRegularExpression> #include <QScrollArea> -#include <QSettings> #include <QStringListModel> using namespace Utils; diff --git a/src/plugins/coreplugin/navigationwidget.cpp b/src/plugins/coreplugin/navigationwidget.cpp index e271a492a11..382a290bc6d 100644 --- a/src/plugins/coreplugin/navigationwidget.cpp +++ b/src/plugins/coreplugin/navigationwidget.cpp @@ -15,11 +15,9 @@ #include <utils/qtcassert.h> #include <utils/utilsicons.h> +#include <QAction> #include <QCoreApplication> #include <QDebug> -#include <QSettings> - -#include <QAction> #include <QHBoxLayout> #include <QResizeEvent> #include <QStandardItemModel> diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index d48a024f440..88bcbd081c0 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -112,7 +112,6 @@ #include <QPointer> #include <QPushButton> #include <QScopeGuard> -#include <QSettings> #include <QSortFilterProxyModel> #include <QStackedWidget> #include <QTextBlock> diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index cb0f6064168..e64fb904763 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -22,7 +22,6 @@ #include <QLabel> #include <QLineEdit> #include <QPushButton> -#include <QSettings> #include <QStandardItemModel> #include <QTreeView> diff --git a/src/plugins/git/gerrit/gerritserver.cpp b/src/plugins/git/gerrit/gerritserver.cpp index 2bcb305853b..114e8b020c2 100644 --- a/src/plugins/git/gerrit/gerritserver.cpp +++ b/src/plugins/git/gerrit/gerritserver.cpp @@ -20,7 +20,6 @@ #include <QJsonObject> #include <QMessageBox> #include <QRegularExpression> -#include <QSettings> using namespace Git::Internal; using namespace Utils; diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index 4d05afffda0..f4a2c4f452b 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -23,7 +23,6 @@ #include <QCheckBox> #include <QHBoxLayout> #include <QRegularExpressionValidator> -#include <QSettings> using namespace Core; using namespace TextEditor; diff --git a/src/plugins/gitlab/gitlabparameters.cpp b/src/plugins/gitlab/gitlabparameters.cpp index c501c23b9fd..e226d3a523f 100644 --- a/src/plugins/gitlab/gitlabparameters.cpp +++ b/src/plugins/gitlab/gitlabparameters.cpp @@ -11,7 +11,6 @@ #include <QJsonArray> #include <QJsonDocument> #include <QJsonObject> -#include <QSettings> #include <QStandardPaths> using namespace Utils; diff --git a/src/plugins/glsleditor/glsleditor.cpp b/src/plugins/glsleditor/glsleditor.cpp index 2ade8fb4c74..893aaf47d36 100644 --- a/src/plugins/glsleditor/glsleditor.cpp +++ b/src/plugins/glsleditor/glsleditor.cpp @@ -42,7 +42,6 @@ #include <utils/uncommentselection.h> #include <QCoreApplication> -#include <QSettings> #include <QComboBox> #include <QFileInfo> #include <QHeaderView> diff --git a/src/plugins/help/generalsettingspage.cpp b/src/plugins/help/generalsettingspage.cpp index 6337bafd11e..ff1e7e82182 100644 --- a/src/plugins/help/generalsettingspage.cpp +++ b/src/plugins/help/generalsettingspage.cpp @@ -32,7 +32,6 @@ #include <QLineEdit> #include <QLabel> #include <QPushButton> -#include <QSettings> #include <QSpinBox> #include <QTextStream> #include <QVBoxLayout> diff --git a/src/plugins/imageviewer/multiexportdialog.cpp b/src/plugins/imageviewer/multiexportdialog.cpp index 1a22598d267..c7e18b8fe1b 100644 --- a/src/plugins/imageviewer/multiexportdialog.cpp +++ b/src/plugins/imageviewer/multiexportdialog.cpp @@ -21,7 +21,6 @@ #include <QMenu> #include <QMessageBox> #include <QScreen> -#include <QSettings> #include <QToolButton> #include <QWidgetAction> diff --git a/src/plugins/ios/iosprobe.h b/src/plugins/ios/iosprobe.h index f0bd4bf6609..9d2896162f9 100644 --- a/src/plugins/ios/iosprobe.h +++ b/src/plugins/ios/iosprobe.h @@ -5,7 +5,6 @@ #include <utils/filepath.h> -#include <QSettings> #include <QSharedPointer> #include <QString> #include <QStringList> diff --git a/src/plugins/macros/macrosplugin.cpp b/src/plugins/macros/macrosplugin.cpp index 74fffddeb43..c87686fea3c 100644 --- a/src/plugins/macros/macrosplugin.cpp +++ b/src/plugins/macros/macrosplugin.cpp @@ -18,7 +18,6 @@ #include <coreplugin/icore.h> #include <coreplugin/icontext.h> -#include <QSettings> #include <QAction> #include <QKeySequence> #include <QMenu> diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 6a26300265a..2a82cf46ac0 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -33,7 +33,6 @@ #include <QLineEdit> #include <QMenu> #include <QPainter> -#include <QSettings> #include <QStyledItemDelegate> #include <QToolButton> #include <QVBoxLayout> diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index cd01a9f26b8..f6cb72bde84 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -36,7 +36,6 @@ #include <QPushButton> #include <QTimer> #include <QLoggingCategory> -#include <QSettings> using namespace Utils; using namespace ProjectExplorer::Internal; diff --git a/src/plugins/projectexplorer/toolchainmanager.cpp b/src/plugins/projectexplorer/toolchainmanager.cpp index 3c90d590a39..d04510679ed 100644 --- a/src/plugins/projectexplorer/toolchainmanager.cpp +++ b/src/plugins/projectexplorer/toolchainmanager.cpp @@ -18,8 +18,6 @@ #include <nanotrace/nanotrace.h> -#include <QSettings> - using namespace Utils; namespace ProjectExplorer { diff --git a/src/plugins/qmldesigner/components/propertyeditor/colorpalettebackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/colorpalettebackend.cpp index f2f5ba77063..8b48ca0ce7f 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/colorpalettebackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/colorpalettebackend.cpp @@ -4,7 +4,6 @@ #include "colorpalettebackend.h" #include <QDebug> -#include <QSettings> #include <QColorDialog> #include <QTimer> diff --git a/src/plugins/qmljseditor/qmljsoutline.cpp b/src/plugins/qmljseditor/qmljsoutline.cpp index a987120731d..291907179d9 100644 --- a/src/plugins/qmljseditor/qmljsoutline.cpp +++ b/src/plugins/qmljseditor/qmljsoutline.cpp @@ -12,7 +12,6 @@ #include <coreplugin/idocument.h> #include <coreplugin/editormanager/editormanager.h> -#include <QSettings> #include <QAction> #include <QVBoxLayout> #include <QTextBlock> diff --git a/src/plugins/texteditor/commentssettings.cpp b/src/plugins/texteditor/commentssettings.cpp index 533b9bab441..bc6f76cb4bd 100644 --- a/src/plugins/texteditor/commentssettings.cpp +++ b/src/plugins/texteditor/commentssettings.cpp @@ -13,7 +13,6 @@ #include <QCheckBox> #include <QComboBox> -#include <QSettings> using namespace Layouting; using namespace Utils; diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp index c9c0a95fed1..af92c179cb7 100644 --- a/src/plugins/texteditor/fontsettings.cpp +++ b/src/plugins/texteditor/fontsettings.cpp @@ -17,7 +17,6 @@ #include <QFile> #include <QFont> #include <QFontDatabase> -#include <QSettings> #include <QTextCharFormat> #include <cmath> diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index 369389a513f..654a3a19b20 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -32,7 +32,6 @@ #include <QPalette> #include <QPointer> #include <QPushButton> -#include <QSettings> #include <QSpacerItem> #include <QSpinBox> #include <QTimer> diff --git a/src/plugins/texteditor/marginsettings.cpp b/src/plugins/texteditor/marginsettings.cpp index f47e326c92c..c393d588e18 100644 --- a/src/plugins/texteditor/marginsettings.cpp +++ b/src/plugins/texteditor/marginsettings.cpp @@ -3,8 +3,6 @@ #include "marginsettings.h" -#include <QSettings> - #include <utils/qtcsettings.h> using namespace Utils; diff --git a/src/plugins/todo/todoplugin.cpp b/src/plugins/todo/todoplugin.cpp index 764217b76be..dfb0f866fb8 100644 --- a/src/plugins/todo/todoplugin.cpp +++ b/src/plugins/todo/todoplugin.cpp @@ -17,8 +17,6 @@ #include <projectexplorer/projectpanelfactory.h> #include <utils/link.h> -#include <QSettings> - namespace Todo { namespace Internal { diff --git a/tests/auto/qml/connectioneditor/tst_connectioneditor.cpp b/tests/auto/qml/connectioneditor/tst_connectioneditor.cpp index 61e19d1253d..ecb8983271c 100644 --- a/tests/auto/qml/connectioneditor/tst_connectioneditor.cpp +++ b/tests/auto/qml/connectioneditor/tst_connectioneditor.cpp @@ -4,15 +4,14 @@ #include "qmldesigner/components/connectioneditor/connectioneditorevaluator.h" #include "qmljs/parser/qmljsast_p.h" #include "qmljs/qmljsdocument.h" -#include <algorithm> + #include <QApplication> -#include <QFileInfo> #include <QGraphicsObject> -#include <QLatin1String> #include <QScopedPointer> -#include <QSettings> #include <QtTest> +#include <algorithm> + using namespace QmlJS; using namespace QmlJS::AST; using namespace QmlDesigner; diff --git a/tests/auto/qml/reformatter/tst_reformatter.cpp b/tests/auto/qml/reformatter/tst_reformatter.cpp index 68b192fa600..36c8f2a83e8 100644 --- a/tests/auto/qml/reformatter/tst_reformatter.cpp +++ b/tests/auto/qml/reformatter/tst_reformatter.cpp @@ -1,21 +1,19 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include <QScopedPointer> -#include <QLatin1String> -#include <QGraphicsObject> -#include <QApplication> -#include <QSettings> -#include <QFileInfo> - #include <qmljs/qmljsdocument.h> #include <qmljs/qmljsmodelmanagerinterface.h> #include <qmljs/qmljsreformatter.h> #include <qmljs/parser/qmljsast_p.h> #include <qmljs/parser/qmljsengine_p.h> + #include <utils/filepath.h> +#include <QApplication> +#include <QGraphicsObject> +#include <QScopedPointer> #include <QtTest> + #include <algorithm> using namespace QmlJS; diff --git a/tests/manual/widgets/infolabel/tst_manual_widgets_infolabel.cpp b/tests/manual/widgets/infolabel/tst_manual_widgets_infolabel.cpp index 3943176a93c..7e323ed167a 100644 --- a/tests/manual/widgets/infolabel/tst_manual_widgets_infolabel.cpp +++ b/tests/manual/widgets/infolabel/tst_manual_widgets_infolabel.cpp @@ -6,7 +6,6 @@ #include <QApplication> #include <QFormLayout> #include <QMessageBox> -#include <QSettings> #include <utils/infolabel.h> diff --git a/tests/manual/widgets/manhattanstyle/tst_manual_widgets_manhattanstyle.cpp b/tests/manual/widgets/manhattanstyle/tst_manual_widgets_manhattanstyle.cpp index 30ec55a4015..0189fe6a631 100644 --- a/tests/manual/widgets/manhattanstyle/tst_manual_widgets_manhattanstyle.cpp +++ b/tests/manual/widgets/manhattanstyle/tst_manual_widgets_manhattanstyle.cpp @@ -15,7 +15,6 @@ #include <QMainWindow> #include <QMessageBox> #include <QScrollBar> -#include <QSettings> #include <QSpinBox> #include <utils/utilsicons.h> From 018993fc37cbcbf79d35d2bd6fc0bbab6f5a2f72 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 27 Sep 2023 15:48:29 +0200 Subject: [PATCH 1314/1777] ModelEditor: Simplify UiController Change-Id: I3182f3e3c038d0c2d6daa94d59cb96865d2baf20 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/modeleditor/uicontroller.cpp | 51 ++++++++---------------- src/plugins/modeleditor/uicontroller.h | 6 +-- 2 files changed, 19 insertions(+), 38 deletions(-) diff --git a/src/plugins/modeleditor/uicontroller.cpp b/src/plugins/modeleditor/uicontroller.cpp index 43b02a6ab1e..138b3a028b1 100644 --- a/src/plugins/modeleditor/uicontroller.cpp +++ b/src/plugins/modeleditor/uicontroller.cpp @@ -3,9 +3,8 @@ #include "uicontroller.h" -#include "modeleditor_constants.h" - #include <coreplugin/icore.h> + #include <utils/qtcsettings.h> using namespace Utils; @@ -13,52 +12,39 @@ using namespace Utils; namespace ModelEditor { namespace Internal { -class UiController::UiControllerPrivate -{ -public: - QByteArray rightSplitterState; - QByteArray rightHorizSplitterState; -}; - -UiController::UiController() - : d(new UiControllerPrivate) -{ -} - -UiController::~UiController() -{ - delete d; -} +// Settings entries +const char SETTINGS_RIGHT_SPLITTER[] = "ModelEditorPlugin/RightSplitter"; +const char SETTINGS_RIGHT_HORIZ_SPLITTER[] = "ModelEditorPlugin/RightHorizSplitter"; bool UiController::hasRightSplitterState() const { - return !d->rightSplitterState.isEmpty(); + return !m_rightSplitterState.isEmpty(); } QByteArray UiController::rightSplitterState() const { - return d->rightSplitterState; + return m_rightSplitterState; } bool UiController::hasRightHorizSplitterState() const { - return !d->rightHorizSplitterState.isEmpty(); + return !m_rightHorizSplitterState.isEmpty(); } QByteArray UiController::rightHorizSplitterState() const { - return d->rightHorizSplitterState; + return m_rightHorizSplitterState; } void UiController::onRightSplitterChanged(const QByteArray &state) { - d->rightSplitterState = state; + m_rightSplitterState = state; emit rightSplitterChanged(state); } void UiController::onRightHorizSplitterChanged(const QByteArray &state) { - d->rightHorizSplitterState = state; + m_rightHorizSplitterState = state; emit rightHorizSplitterChanged(state); } @@ -66,23 +52,18 @@ void UiController::saveSettings() { QtcSettings *settings = Core::ICore::settings(); if (hasRightSplitterState()) - settings->setValue(Constants::SETTINGS_RIGHT_SPLITTER, d->rightSplitterState); + settings->setValue(SETTINGS_RIGHT_SPLITTER, m_rightSplitterState); if (hasRightHorizSplitterState()) - settings->setValue(Constants::SETTINGS_RIGHT_HORIZ_SPLITTER, d->rightHorizSplitterState); - settings->endGroup(); + settings->setValue(SETTINGS_RIGHT_HORIZ_SPLITTER, m_rightHorizSplitterState); } void UiController::loadSettings() { QtcSettings *settings = Core::ICore::settings(); - settings->beginGroup(Constants::SETTINGS_GROUP); - if (settings->contains(Constants::SETTINGS_RIGHT_SPLITTER)) - d->rightSplitterState = settings->value(Constants::SETTINGS_RIGHT_SPLITTER).toByteArray(); - if (settings->contains(Constants::SETTINGS_RIGHT_HORIZ_SPLITTER)) { - d->rightHorizSplitterState = settings->value(Constants::SETTINGS_RIGHT_HORIZ_SPLITTER) - .toByteArray(); - } - settings->endGroup(); + if (settings->contains(SETTINGS_RIGHT_SPLITTER)) + m_rightSplitterState = settings->value(SETTINGS_RIGHT_SPLITTER).toByteArray(); + if (settings->contains(SETTINGS_RIGHT_HORIZ_SPLITTER)) + m_rightHorizSplitterState = settings->value(SETTINGS_RIGHT_HORIZ_SPLITTER).toByteArray(); } } // namespace Internal diff --git a/src/plugins/modeleditor/uicontroller.h b/src/plugins/modeleditor/uicontroller.h index 96bc06efd1c..0709d26be63 100644 --- a/src/plugins/modeleditor/uicontroller.h +++ b/src/plugins/modeleditor/uicontroller.h @@ -14,8 +14,7 @@ class UiController : public QObject class UiControllerPrivate; public: - UiController(); - ~UiController(); + UiController() {} signals: void rightSplitterChanged(const QByteArray &state); @@ -33,7 +32,8 @@ public: void loadSettings(); private: - UiControllerPrivate *d; + QByteArray m_rightSplitterState; + QByteArray m_rightHorizSplitterState; }; } // namespace Internal From 60d1fe4cb7f437a27094efce5ba4eedcac476256 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 27 Sep 2023 15:57:54 +0200 Subject: [PATCH 1315/1777] All: Even less #include <QSettings> Change-Id: Ifbb2af34169036236e6f2f7b09ef115de5c6a6c7 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/coreplugin/find/searchresultwindow.cpp | 1 - src/plugins/coreplugin/systemsettings.cpp | 1 - src/plugins/cppeditor/cppincludehierarchy.cpp | 1 - src/plugins/fakevim/fakevimplugin.cpp | 1 - src/plugins/languageclient/languageclientsettings.cpp | 1 - src/plugins/macros/macromanager.cpp | 1 - src/plugins/perforce/perforceplugin.cpp | 1 - src/plugins/projectexplorer/allprojectsfind.cpp | 1 - src/plugins/projectexplorer/devicesupport/sshsettings.cpp | 1 - src/plugins/projectexplorer/kitchooser.cpp | 1 - src/plugins/projectexplorer/kitmanager.cpp | 1 - src/plugins/projectexplorer/projectexplorer.cpp | 1 - .../components/propertyeditor/gradientpresetlistmodel.cpp | 1 - src/plugins/qtsupport/codegenerator.cpp | 1 - src/plugins/qtsupport/qtversionmanager.cpp | 1 - src/plugins/squish/squishsettings.cpp | 1 - src/plugins/texteditor/basefilefind.cpp | 1 - src/plugins/texteditor/findinfiles.cpp | 1 - src/plugins/texteditor/tabsettings.cpp | 1 - 19 files changed, 19 deletions(-) diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp index 8711ad3b61f..d2b23e6f1e4 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.cpp +++ b/src/plugins/coreplugin/find/searchresultwindow.cpp @@ -22,7 +22,6 @@ #include <QFont> #include <QLabel> #include <QScrollArea> -#include <QSettings> #include <QStackedWidget> #include <QToolButton> diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index a40930b980f..26527a4286e 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -31,7 +31,6 @@ #include <QLineEdit> #include <QMessageBox> #include <QPushButton> -#include <QSettings> #include <QToolButton> using namespace Utils; diff --git a/src/plugins/cppeditor/cppincludehierarchy.cpp b/src/plugins/cppeditor/cppincludehierarchy.cpp index 130cf35472f..3ee1efc6af9 100644 --- a/src/plugins/cppeditor/cppincludehierarchy.cpp +++ b/src/plugins/cppeditor/cppincludehierarchy.cpp @@ -33,7 +33,6 @@ #include <QCoreApplication> #include <QKeyEvent> #include <QLabel> -#include <QSettings> #include <QStackedWidget> #include <QTimer> #include <QToolButton> diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 496fdd786f6..f14cbbb2027 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -73,7 +73,6 @@ #include <QPushButton> #include <QRegularExpression> #include <QScrollBar> -#include <QSettings> #include <QStackedWidget> #include <QStandardPaths> #include <QStyleHints> diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index 8b406c2d1c0..1fa4c5ed377 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -44,7 +44,6 @@ #include <QMenu> #include <QMimeData> #include <QPushButton> -#include <QSettings> #include <QSortFilterProxyModel> #include <QStringListModel> #include <QToolButton> diff --git a/src/plugins/macros/macromanager.cpp b/src/plugins/macros/macromanager.cpp index a5e01155893..b5151b7ee25 100644 --- a/src/plugins/macros/macromanager.cpp +++ b/src/plugins/macros/macromanager.cpp @@ -28,7 +28,6 @@ #include <QDir> #include <QFile> #include <QFileInfo> -#include <QSettings> #include <QList> #include <QAction> diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index aa4d9e90c0c..a94a12adb30 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -49,7 +49,6 @@ #include <QMenu> #include <QMessageBox> #include <QRegularExpression> -#include <QSettings> #include <QTextCodec> using namespace Core; diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp index 1c8f4c9d94a..c2cee55e309 100644 --- a/src/plugins/projectexplorer/allprojectsfind.cpp +++ b/src/plugins/projectexplorer/allprojectsfind.cpp @@ -17,7 +17,6 @@ #include <utils/qtcsettings.h> #include <QGridLayout> -#include <QSettings> using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; diff --git a/src/plugins/projectexplorer/devicesupport/sshsettings.cpp b/src/plugins/projectexplorer/devicesupport/sshsettings.cpp index 083ad062c99..f815ef058b4 100644 --- a/src/plugins/projectexplorer/devicesupport/sshsettings.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshsettings.cpp @@ -8,7 +8,6 @@ #include <utils/qtcsettings.h> #include <QReadWriteLock> -#include <QSettings> using namespace Utils; diff --git a/src/plugins/projectexplorer/kitchooser.cpp b/src/plugins/projectexplorer/kitchooser.cpp index b4d0031cd45..4830f617f5f 100644 --- a/src/plugins/projectexplorer/kitchooser.cpp +++ b/src/plugins/projectexplorer/kitchooser.cpp @@ -14,7 +14,6 @@ #include <QComboBox> #include <QHBoxLayout> #include <QPushButton> -#include <QSettings> using namespace Core; using namespace Utils; diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index d206234cbd1..792d7e86a63 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -33,7 +33,6 @@ #include <QHash> #include <QLabel> #include <QPushButton> -#include <QSettings> #include <QStyle> using namespace Core; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index e5dc64d79c9..ddd07732c90 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -148,7 +148,6 @@ #include <QMessageBox> #include <QPair> #include <QPushButton> -#include <QSettings> #include <QThreadPool> #include <QTimer> #include <QVBoxLayout> diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientpresetlistmodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/gradientpresetlistmodel.cpp index b4b41773321..da6e67993e6 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/gradientpresetlistmodel.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/gradientpresetlistmodel.cpp @@ -7,7 +7,6 @@ #include <QHash> #include <QByteArray> #include <QDebug> -#include <QSettings> GradientPresetListModel::GradientPresetListModel(QObject *parent) : QAbstractListModel(parent) diff --git a/src/plugins/qtsupport/codegenerator.cpp b/src/plugins/qtsupport/codegenerator.cpp index 5e9437b8184..2188e59012a 100644 --- a/src/plugins/qtsupport/codegenerator.cpp +++ b/src/plugins/qtsupport/codegenerator.cpp @@ -11,7 +11,6 @@ #include <utils/qtcassert.h> #include <QDomDocument> -#include <QSettings> #include <QTextStream> #include <QXmlStreamReader> diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 4674bb07075..941bd763b69 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -29,7 +29,6 @@ #include <QDir> #include <QFile> #include <QLoggingCategory> -#include <QSettings> #include <QStandardPaths> #include <QStringList> #include <QTextStream> diff --git a/src/plugins/squish/squishsettings.cpp b/src/plugins/squish/squishsettings.cpp index 8d4cfe5ded0..bfa0a127d18 100644 --- a/src/plugins/squish/squishsettings.cpp +++ b/src/plugins/squish/squishsettings.cpp @@ -22,7 +22,6 @@ #include <QFrame> #include <QHeaderView> #include <QPushButton> -#include <QSettings> #include <QVBoxLayout> #include <QXmlStreamReader> diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index efea4e9ba17..2e7ae4471df 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -31,7 +31,6 @@ #include <QPair> #include <QPointer> #include <QPromise> -#include <QSettings> #include <QStringListModel> using namespace Utils; diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index 3fa4de9b59a..c8a6531ba65 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -16,7 +16,6 @@ #include <QComboBox> #include <QGridLayout> #include <QLabel> -#include <QSettings> #include <QStackedWidget> using namespace Core; diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index c6c0558636f..e0c5142dcce 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -4,7 +4,6 @@ #include "tabsettings.h" #include <QDebug> -#include <QSettings> #include <QTextCursor> #include <QTextDocument> From 24f8990511032dd388e54e37d0dc9463b5a0e0c2 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 27 Sep 2023 15:58:32 +0200 Subject: [PATCH 1316/1777] ModelEditor: Clean up exposed constants Change-Id: Ic8b51dc2d121f7bfefb58a6b15a961e70ee8c74a Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../modeleditor/modeleditor_constants.h | 19 ++----------------- .../modeleditor/modeleditorfactory.cpp | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/plugins/modeleditor/modeleditor_constants.h b/src/plugins/modeleditor/modeleditor_constants.h index e600993fedf..c7731810613 100644 --- a/src/plugins/modeleditor/modeleditor_constants.h +++ b/src/plugins/modeleditor/modeleditor_constants.h @@ -3,18 +3,13 @@ #pragma once -#include <QtGlobal> - -namespace ModelEditor { -namespace Constants { +namespace ModelEditor::Constants { const char MODEL_EDITOR_ID[] = "Editors.ModelEditor"; -const char MODEL_EDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::Core", "Model Editor"); const char REMOVE_SELECTED_ELEMENTS[] = "ModelEditor.RemoveSelectedElements"; const char DELETE_SELECTED_ELEMENTS[] = "ModelEditor.DeleteSelectedElements"; const char OPEN_PARENT_DIAGRAM[] = "ModelEditor.OpenParentDiagram"; -const char MENU_ID[] = "ModelEditor.Menu"; const char EXPORT_DIAGRAM[] = "ModelEditor.ExportDiagram"; const char EXPORT_SELECTED_ELEMENTS[] = "ModelEditor.ExportSelectedElements"; const char ACTION_ADD_PACKAGE[] = "ModelEditor.Action.AddPackage"; @@ -31,16 +26,6 @@ const char SHORTCUT_MODEL_EDITOR_EDIT_PROPERTIES[] = const char SHORTCUT_MODEL_EDITOR_EDIT_ITEM[] = "ModelEditor.ModelEditor.Shortcut.EditItem"; -const char WIZARD_CATEGORY[] = "O.Model"; -const char WIZARD_TR_CATEGORY[] = QT_TRANSLATE_NOOP("Modeling", "Modeling"); -const char WIZARD_MODEL_ID[] = "SA.Model"; - const char MIME_TYPE_MODEL[] = "text/vnd.qtcreator.model"; -// Settings entries -const char SETTINGS_GROUP[] = "ModelEditorPlugin"; -const char SETTINGS_RIGHT_SPLITTER[] = "RightSplitter"; -const char SETTINGS_RIGHT_HORIZ_SPLITTER[] = "RightHorizSplitter"; - -} // namespace Constants -} // namespace ModelEditor +} // ModelEditor::Constants diff --git a/src/plugins/modeleditor/modeleditorfactory.cpp b/src/plugins/modeleditor/modeleditorfactory.cpp index 394ba071f0c..f6670c66074 100644 --- a/src/plugins/modeleditor/modeleditorfactory.cpp +++ b/src/plugins/modeleditor/modeleditorfactory.cpp @@ -17,7 +17,7 @@ namespace Internal { ModelEditorFactory::ModelEditorFactory(UiController *uiController, ActionHandler *actionHandler) { setId(Constants::MODEL_EDITOR_ID); - setDisplayName(::Core::Tr::tr(Constants::MODEL_EDITOR_DISPLAY_NAME)); + setDisplayName(::Core::Tr::tr("Model Editor")); addMimeType(Constants::MIME_TYPE_MODEL); setEditorCreator([uiController, actionHandler] { return new ModelEditor(uiController, actionHandler); }); } From 50a4ece91fea731caee3388b82850a72b55a1fea Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 26 Sep 2023 17:35:20 +0200 Subject: [PATCH 1317/1777] ProjectExplorer: Re-order some code Change-Id: Iab4be8f5d55bc88518f7473cef20b024ef6cd26d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 74 +++++++++----------- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 41b6cf2dc1f..e004f6b77e7 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1247,10 +1247,43 @@ GccToolChainFactory::GccToolChainFactory(GccToolChain::SubType subType) setUserCreatable(true); } -// FIXME: Re-order later. static FilePaths findCompilerCandidates(const ToolchainDetector &detector, const QString &compilerName, - bool detectVariants); + bool detectVariants) +{ + QStringList nameFilters(compilerName); + if (detectVariants) { + nameFilters + << compilerName + "-[1-9]*" // "clang-8", "gcc-5" + << ("*-" + compilerName) // "avr-gcc", "avr32-gcc" + << ("*-" + compilerName + "-[1-9]*")// "avr-gcc-4.8.1", "avr32-gcc-4.4.7" + << ("*-*-*-" + compilerName) // "arm-none-eabi-gcc" + << ("*-*-*-" + compilerName + "-[1-9]*") // "arm-none-eabi-gcc-9.1.0" + << ("*-*-*-*-" + compilerName) // "x86_64-pc-linux-gnu-gcc" + << ("*-*-*-*-" + compilerName + + "-[1-9]*"); // "x86_64-pc-linux-gnu-gcc-7.4.1" + } + const Utils::OsType os = detector.device->osType(); + nameFilters = transform(nameFilters, [os](const QString &baseName) { + return OsSpecificAspects::withExecutableSuffix(os, baseName); + }); + + FilePaths compilerPaths; + for (const FilePath &searchPath : std::as_const(detector.searchPaths)) { + static const QRegularExpression regexp(binaryRegexp); + const auto callBack = [os, &compilerPaths, compilerName](const FilePath &candidate) { + if (candidate.fileName() == OsSpecificAspects::withExecutableSuffix(os, compilerName) + || regexp.match(candidate.path()).hasMatch()) { + compilerPaths << candidate; + } + return IterationPolicy::Continue; + }; + searchPath.iterateDirectory(callBack, {nameFilters, QDir::Files | QDir::Executable}); + } + + return compilerPaths; +} + Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector_) const { @@ -1449,43 +1482,6 @@ Toolchains GccToolChainFactory::detectForImport(const ToolChainDescription &tcd) return result; } -static FilePaths findCompilerCandidates(const ToolchainDetector &detector, - const QString &compilerName, - bool detectVariants) -{ - QStringList nameFilters(compilerName); - if (detectVariants) { - nameFilters - << compilerName + "-[1-9]*" // "clang-8", "gcc-5" - << ("*-" + compilerName) // "avr-gcc", "avr32-gcc" - << ("*-" + compilerName + "-[1-9]*")// "avr-gcc-4.8.1", "avr32-gcc-4.4.7" - << ("*-*-*-" + compilerName) // "arm-none-eabi-gcc" - << ("*-*-*-" + compilerName + "-[1-9]*") // "arm-none-eabi-gcc-9.1.0" - << ("*-*-*-*-" + compilerName) // "x86_64-pc-linux-gnu-gcc" - << ("*-*-*-*-" + compilerName - + "-[1-9]*"); // "x86_64-pc-linux-gnu-gcc-7.4.1" - } - const Utils::OsType os = detector.device->osType(); - nameFilters = transform(nameFilters, [os](const QString &baseName) { - return OsSpecificAspects::withExecutableSuffix(os, baseName); - }); - - FilePaths compilerPaths; - for (const FilePath &searchPath : detector.searchPaths) { - static const QRegularExpression regexp(binaryRegexp); - const auto callBack = [os, &compilerPaths, compilerName](const FilePath &candidate) { - if (candidate.fileName() == OsSpecificAspects::withExecutableSuffix(os, compilerName) - || regexp.match(candidate.path()).hasMatch()) { - compilerPaths << candidate; - } - return IterationPolicy::Continue; - }; - searchPath.iterateDirectory(callBack, {nameFilters, QDir::Files | QDir::Executable}); - } - - return compilerPaths; -} - Toolchains GccToolChainFactory::autoDetectToolchains(const FilePaths &compilerPaths, const Id language, const Id requiredTypeId, From 94d7c76d674d90a680ed334f8b6601a77cd7478b Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 25 Sep 2023 23:07:02 +0200 Subject: [PATCH 1318/1777] CMakePM: Add missing features to RSTParser To be able to parse the rst help files from CMake Change-Id: Ibec21e8571324276d2080f81728b1268581601d0 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../3rdparty/rstparser/rstparser-test.cc | 89 ++++++++- .../3rdparty/rstparser/rstparser.cc | 185 +++++++++++++++++- .../3rdparty/rstparser/rstparser.h | 19 +- 3 files changed, 279 insertions(+), 14 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser-test.cc b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser-test.cc index c70fc67c6da..70b9a6df337 100644 --- a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser-test.cc +++ b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser-test.cc @@ -48,6 +48,27 @@ class TestHandler : public rst::ContentHandler { void StartBlock(rst::BlockType type) { std::string tag; switch (type) { + case rst::REFERENCE_LINK: + // not used, HandleReferenceLink is used instead + break; + case rst::H1: + tag = "h1"; + break; + case rst::H2: + tag = "h2"; + break; + case rst::H3: + tag = "h3"; + break; + case rst::H4: + tag = "h4"; + break; + case rst::H5: + tag = "h5"; + break; + case rst::CODE: + tag = "code"; + break; case rst::PARAGRAPH: tag = "p"; break; @@ -80,8 +101,12 @@ class TestHandler : public rst::ContentHandler { content_.append(text, size); } - void HandleDirective(const char *type) { - content_ += std::string("<") + type + " />"; + void HandleDirective(const std::string &type, const std::string &name) { + content_ += std::string("<div class=\"") + name + "\">" + type + "</div>"; + } + + void HandleReferenceLink(const std::string &type, const std::string &text) { + content_ += std::string("<a href=\"#") + type + "\">" + text + "</a>"; } }; @@ -93,6 +118,14 @@ std::string Parse(const char *s) { } } +TEST(ParserTest, HX) { + EXPECT_EQ("<h1>test</h1>", Parse("====\ntest\n====")); + EXPECT_EQ("<h2>test</h2>", Parse("test\n====")); + EXPECT_EQ("<h3>test</h3>", Parse("test\n----")); + EXPECT_EQ("<h4>test</h4>", Parse("test\n^^^^")); + EXPECT_EQ("<h5>test</h5>", Parse("test\n\"\"\"\"")); +} + TEST(ParserTest, Paragraph) { EXPECT_EQ("<p>test</p>", Parse("test")); EXPECT_EQ("<p>test</p>", Parse("\ntest")); @@ -143,6 +176,14 @@ TEST(ParserTest, Literal) { EXPECT_EQ("<p>::\nabc\ndef</p>", Parse("::\nabc\ndef")); } +TEST(ParserTest, InlineCode) { + EXPECT_EQ("<p><code>code</code></p>", Parse("``code``")); + EXPECT_EQ("<p>`code``</p>", Parse("`code``")); + EXPECT_EQ("<p>some <code>code</code></p>", Parse("some ``code``")); + EXPECT_EQ("<p><code>code</code> some</p>", Parse("``code`` some")); + EXPECT_EQ("<p>some <code>code</code> and more</p>", Parse("some ``code`` and more")); +} + TEST(ParserTest, Comment) { EXPECT_EQ("", Parse("..")); EXPECT_EQ("", Parse("..\n")); @@ -151,11 +192,49 @@ TEST(ParserTest, Comment) { } TEST(ParserTest, Directive) { - EXPECT_EQ("<test />", Parse(".. test::")); - EXPECT_EQ("<test />", Parse(".. test::")); - EXPECT_EQ("<test />", Parse("..\ttest::")); + EXPECT_EQ("<div class=\"\">test</div>", Parse(".. test::")); + EXPECT_EQ("<div class=\"name\">test</div>", Parse(".. test:: name")); + EXPECT_EQ("<div class=\"\">test</div>", Parse(".. test::")); + EXPECT_EQ("<div class=\"\">test</div>", Parse("..\ttest::")); + + EXPECT_EQ("<div class=\"to-text\">|from-text| replace</div>", Parse(".. |from-text| replace:: to-text")); + + std::string rst = +R"(.. code-block:: c++ + int main() { + if (false) + return 1; + return 0; + })"; + + std::string html = +R"(<div class="c++">code-block</div><blockquote>int main() { + if (false) + return 1; + return 0; +}</blockquote>)"; + + EXPECT_EQ(html, Parse(rst.c_str())); + + rst = +R"(.. note:: This is a cool + note. Such a cool note.)"; + + html = +R"(<div class="">note</div><blockquote>This is a cool + note. Such a cool note.</blockquote>)"; + + EXPECT_EQ(html, Parse(rst.c_str())); } +TEST(ParserTest, ReferenceLinks) { + EXPECT_EQ("<p><a href=\"#ref\">info</a></p>", Parse(":ref:`info`")); + EXPECT_EQ("<p>some <a href=\"#ref\">info</a></p>", Parse("some :ref:`info`")); + EXPECT_EQ("<p>some <a href=\"#ref\">info</a> and more</p>", Parse("some :ref:`info` and more")); + EXPECT_EQ("<p><a href=\"#ref\">info</a>.</p>", Parse(":ref:`info`.")); +} + + int main(int argc, char **argv) { #ifdef _WIN32 // Disable message boxes on assertion failures. diff --git a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc index 528c572f683..f430c40e95d 100644 --- a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc +++ b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc @@ -27,6 +27,7 @@ #include "rstparser.h" +#include <algorithm> #include <cctype> #include <cstring> @@ -55,15 +56,15 @@ void rst::Parser::SkipSpace() { std::string rst::Parser::ParseDirectiveType() { const char *s = ptr_; - if (!std::isalnum(*s)) + if (!std::isalnum(*s) && *s != '|') return std::string(); for (;;) { ++s; if (std::isalnum(*s)) continue; switch (*s) { - case '-': case '_': case '+': case ':': case '.': - if (std::isalnum(s[1])) { + case '-': case '_': case '+': case ':': case '.': case '|': + if (std::isalnum(s[1]) || (*s == '|' && IsSpace(s[1]))) { ++s; continue; } @@ -91,13 +92,28 @@ void rst::Parser::EnterBlock(rst::BlockType &prev_type, rst::BlockType type) { void rst::Parser::ParseBlock( rst::BlockType type, rst::BlockType &prev_type, int indent) { std::string text; + + struct InlineTags { + rst::BlockType type; + std::size_t pos {}; + std::string text; + std::string type_string; + }; + std::vector<InlineTags> inline_tags; + + bool have_h1 = false; for (bool first = true; ; first = false) { const char *line_start = ptr_; if (!first) { // Check indentation. SkipSpace(); - if (ptr_ - line_start != indent) + const int new_indent = ptr_ - line_start; + if (new_indent < indent) break; + // Restore the indent + if (new_indent > indent) + std::advance(ptr_, indent - new_indent); + if (*ptr_ == '\n') { ++ptr_; break; // Empty line ends the block. @@ -119,9 +135,17 @@ void rst::Parser::ParseBlock( // Copy text converting all whitespace characters to spaces. text.reserve(end - line_start + 1); - if (!first) + if (!first && !have_h1) text.push_back('\n'); enum {TAB_WIDTH = 8}; + + // Used the sections mapping from https://docs.anaconda.com/restructuredtext/index.html + struct { + BlockType type; + int count = 0; + char c = 0; + } hx[] = { {H1, 0, '=' }, {H2, 0, '='}, {H3, 0, '-'}, {H4, 0, '^'}, {H5, 0, '\"'}}; + for (const char *s = line_start; s != end; ++s) { char c = *s; if (c == '\t') { @@ -129,10 +153,60 @@ void rst::Parser::ParseBlock( TAB_WIDTH - ((indent + s - line_start) % TAB_WIDTH)); } else if (IsSpace(c)) { text.push_back(' '); + } else if (c == hx[0].c) { + ++hx[0].count; + ++hx[1].count; + } else if (c == hx[2].c) { + ++hx[2].count; + } else if (c == hx[3].c) { + ++hx[3].count; + } else if (c == hx[4].c) { + ++hx[4].count; + } else if (c == '`') { + std::string code_tag_text; + if (ParseCode(s, end - s, code_tag_text)) { + InlineTags code; + code.type = rst::CODE; + code.pos = text.size(); + code.text = code_tag_text; + inline_tags.push_back(code); + const int tag_size = 4; + s = s + code_tag_text.size() + tag_size - 1; + } else { + text.push_back(*s); + } + } else if (c == ':') { + std::string link_type; + std::string link_text; + if (ParseReferenceLink(s, end - s, link_type, link_text)) { + InlineTags link; + link.type = rst::REFERENCE_LINK; + link.pos = text.size(); + link.text = link_text; + link.type_string = link_type; + inline_tags.push_back(link); + const int tag_size = 4; + s = s + link_type.size() + link_text.size() + tag_size - 1; + } else { + text.push_back(*s); + } } else { text.push_back(*s); } } + + for (int i = 0; i < 5; ++i) { + if (hx[i].count > 0 && hx[i].count == end - line_start) { + // h1 and h2 have the same underline character + // only if there was one ontop then is h1 otherwise h2 + if (i == 0 && first) + have_h1 = true; + if ((i == 0 && !have_h1) || (i == 1 && have_h1)) + continue; + type = hx[i].type; + } + } + if (*ptr_ == '\n') ++ptr_; } @@ -144,11 +218,35 @@ void rst::Parser::ParseBlock( bool literal = type == PARAGRAPH && EndsWith(text, "::"); if (!literal || text.size() != 2) { std::size_t size = text.size(); + if (size == 0 && inline_tags.size() == 0) + return; + if (literal) --size; EnterBlock(prev_type, type); handler_->StartBlock(type); - handler_->HandleText(text.c_str(), size); + + if (inline_tags.size() == 0) { + handler_->HandleText(text.c_str(), size); + } else { + std::size_t start = 0; + for (const InlineTags &in : inline_tags) { + if (in.pos > start) + handler_->HandleText(text.c_str() + start, in.pos - start); + if (in.type == rst::REFERENCE_LINK) { + handler_->HandleReferenceLink(in.type_string, in.text); + } else { + handler_->StartBlock(in.type); + handler_->HandleText(in.text.c_str(), in.text.size()); + handler_->EndBlock(); + } + start = in.pos; + } + + if (start < size) + handler_->HandleText(text.c_str() + start, size - start); + } + handler_->EndBlock(); } if (literal) { @@ -191,6 +289,58 @@ void rst::Parser::ParseLineBlock(rst::BlockType &prev_type, int indent) { handler_->EndBlock(); } +bool rst::Parser::ParseCode(const char *s, std::size_t size, std::string &code) +{ + // It requires at least four ticks ``text`` + if (s[0] != '`' || s[1] != '`') + return false; + + if (size < 4) + return false; + + std::size_t start_pos = 2; + std::size_t end_pos = 0; + for (std::size_t i = start_pos; i < size - 1; ++i) { + if (s[i] == '`' && s[i + 1] == '`') { + end_pos = i; + break; + } + } + + if (end_pos == 0) + return false; + + code.assign(s + start_pos, end_pos - start_pos); + + return true; +} + +bool rst::Parser::ParseReferenceLink(const char *s, std::size_t size, std::string &type, std::string &text) +{ + // :type:`text` + if (size < 4) + return false; + + auto start_type_tag = s + 1; + auto end_type_tag = std::find(start_type_tag, s + size, ':'); + if (end_type_tag == s + size) + return false; + + type.assign(start_type_tag, end_type_tag - start_type_tag); + + if (*(end_type_tag + 1) != '`') + return false; + + auto start_text_tag = end_type_tag + 2; + auto end_text_tag = std::find(start_text_tag, s + size, '`'); + if (end_text_tag == s + size) + return false; + + text.assign(start_text_tag, end_text_tag - start_text_tag); + + return true; +} + void rst::Parser::Parse(const char *s) { BlockType prev_type = PARAGRAPH; ptr_ = s; @@ -214,7 +364,28 @@ void rst::Parser::Parse(const char *s) { std::string type = ParseDirectiveType(); if (!type.empty() && ptr_[0] == ':' && ptr_[1] == ':') { ptr_ += 2; - handler_->HandleDirective(type.c_str()); + + const char* after_directive = ptr_; + + // Get the name of the directive + std::string name; + while (*ptr_ && *ptr_ != '\n') { + c = *ptr_++; + if (!IsSpace(c)) + name.push_back(c); + } + + // Special case for ".. note::" which can start directly after the :: + if (type == "note" && name.size() > 0) { + ptr_ = after_directive; + SkipSpace(); + handler_->HandleDirective(type, ""); + + ParseBlock(BLOCK_QUOTE, prev_type, 0); + break; + } + + handler_->HandleDirective(type, name); } // Skip everything till the end of the line. while (*ptr_ && *ptr_ != '\n') diff --git a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.h b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.h index 547f128af7c..4fabdbf46ec 100644 --- a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.h +++ b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.h @@ -35,6 +35,13 @@ namespace rst { enum BlockType { + H1, + H2, + H3, + H4, + H5, + CODE, + REFERENCE_LINK, PARAGRAPH, LINE_BLOCK, BLOCK_QUOTE, @@ -58,7 +65,10 @@ class ContentHandler { virtual void HandleText(const char *text, std::size_t size) = 0; // Receives notification of a directive. - virtual void HandleDirective(const char *type) = 0; + virtual void HandleDirective(const std::string &type, const std::string &name) = 0; + + // Receives notification of a link. + virtual void HandleReferenceLink(const std::string &type, const std::string &text) = 0; }; // A parser for a subset of reStructuredText. @@ -85,6 +95,12 @@ class Parser { // Parses a line block. void ParseLineBlock(rst::BlockType &prev_type, int indent); + // Parses inline ``code`` + bool ParseCode(const char* s, std::size_t size, std::string &code); + + // Parses :reference:`link` + bool ParseReferenceLink(const char* s, std::size_t size, std::string &type, std::string &text); + public: explicit Parser(ContentHandler *h) : handler_(h), ptr_(0) {} @@ -94,4 +110,3 @@ class Parser { } #endif // RSTPARSER_H_ - From 695952f84bef0d88744b27965ec3c9522014012e Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 25 Sep 2023 23:08:38 +0200 Subject: [PATCH 1319/1777] CMakePM: Integrate RSTParser into hover help / code completion Change-Id: I1618be1aff83e8164c53040bb2c7230bcc1ec8ee Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/CMakeLists.txt | 1 + .../cmakeprojectmanager/cmakeeditor.cpp | 64 +++--- .../cmakefilecompletionassist.cpp | 16 +- .../cmakeprojectmanager.qbs | 14 +- .../cmakeprojectmanager/cmaketoolmanager.cpp | 186 +++++++++++++++++- .../cmakeprojectmanager/cmaketoolmanager.h | 4 +- 6 files changed, 227 insertions(+), 58 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/CMakeLists.txt b/src/plugins/cmakeprojectmanager/CMakeLists.txt index f1989cec6c7..010f948f8a9 100644 --- a/src/plugins/cmakeprojectmanager/CMakeLists.txt +++ b/src/plugins/cmakeprojectmanager/CMakeLists.txt @@ -46,4 +46,5 @@ add_qtc_plugin(CMakeProjectManager 3rdparty/cmake/cmListFileCache.cxx 3rdparty/cmake/cmListFileLexer.cxx 3rdparty/cmake/cmListFileCache.h + 3rdparty/rstparser/rstparser.cc 3rdparty/rstparser/rstparser.h ) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 9b363faebe3..86f8823fdee 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -8,7 +8,6 @@ #include "cmakebuildsystem.h" #include "cmakefilecompletionassist.h" #include "cmakeindenter.h" -#include "cmakekitaspect.h" #include "cmakeprojectconstants.h" #include "3rdparty/cmake/cmListFileCache.h" @@ -53,13 +52,7 @@ public: CMakeEditor::CMakeEditor() { - CMakeTool *tool = nullptr; - if (auto bs = ProjectTree::currentBuildSystem()) - tool = CMakeKitAspect::cmakeTool(bs->target()->kit()); - if (!tool) - tool = CMakeToolManager::defaultCMakeTool(); - - if (tool) + if (auto tool = CMakeToolManager::defaultProjectOrDefaultCMakeTool()) m_keywords = tool->keywords(); } @@ -320,6 +313,7 @@ class CMakeHoverHandler : public TextEditor::BaseHoverHandler { mutable CMakeKeywords m_keywords; QString m_helpToolTip; + QString m_contextHelp; public: const CMakeKeywords &keywords() const; @@ -332,16 +326,9 @@ public: const CMakeKeywords &CMakeHoverHandler::keywords() const { - if (m_keywords.functions.isEmpty()) { - CMakeTool *tool = nullptr; - if (auto bs = ProjectTree::currentBuildSystem()) - tool = CMakeKitAspect::cmakeTool(bs->target()->kit()); - if (!tool) - tool = CMakeToolManager::defaultCMakeTool(); - - if (tool) + if (m_keywords.functions.isEmpty()) + if (auto tool = CMakeToolManager::defaultProjectOrDefaultCMakeTool()) m_keywords = tool->keywords(); - } return m_keywords; } @@ -357,24 +344,39 @@ void CMakeHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget const QString word = Utils::Text::wordUnderCursor(cursor); FilePath helpFile; - for (const auto &map : {keywords().functions, - keywords().variables, - keywords().directoryProperties, - keywords().sourceProperties, - keywords().targetProperties, - keywords().testProperties, - keywords().properties, - keywords().includeStandardModules, - keywords().findModules, - keywords().policies}) { - if (map.contains(word)) { - helpFile = map.value(word); + QString helpCategory; + struct + { + const QMap<QString, Utils::FilePath> ↦ + QString helpCategory; + } keywordsListMaps[] = {{keywords().functions, "command"}, + {keywords().variables, "variable"}, + {keywords().directoryProperties, "prop_dir"}, + {keywords().sourceProperties, "prop_sf"}, + {keywords().targetProperties, "prop_tgt"}, + {keywords().testProperties, "prop_test"}, + {keywords().properties, "prop_gbl"}, + {keywords().includeStandardModules, "module"}, + {keywords().findModules, "module"}, + {keywords().policies, "policy"}}; + + for (const auto &pair : keywordsListMaps) { + if (pair.map.contains(word)) { + helpFile = pair.map.value(word); + helpCategory = pair.helpCategory; break; } } m_helpToolTip.clear(); if (!helpFile.isEmpty()) - m_helpToolTip = CMakeToolManager::readFirstParagraphs(helpFile); + m_helpToolTip = CMakeToolManager::toolTipForRstHelpFile(helpFile); + + if (auto tool = CMakeToolManager::defaultProjectOrDefaultCMakeTool()) + m_contextHelp = QString("%1/%2/%3") + .arg(tool->documentationUrl(tool->version(), + tool->qchFilePath().isEmpty()), + helpCategory, + word); setPriority(m_helpToolTip.isEmpty() ? Priority_Tooltip : Priority_None); } @@ -382,7 +384,7 @@ void CMakeHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget void CMakeHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoint &point) { if (!m_helpToolTip.isEmpty()) - Utils::ToolTip::show(point, m_helpToolTip, Qt::MarkdownText, editorWidget); + Utils::ToolTip::show(point, m_helpToolTip, Qt::MarkdownText, editorWidget, m_contextHelp); else Utils::ToolTip::hide(); } diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index adf223e9a9b..dbaf380d250 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -5,8 +5,6 @@ #include "cmakebuildsystem.h" #include "cmakebuildtarget.h" -#include "cmakekitaspect.h" -#include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "cmaketool.h" #include "cmaketoolmanager.h" @@ -166,7 +164,7 @@ static QList<AssistProposalItemInterface *> generateList(const QMap<QString, Fil MarkDownAssitProposalItem *item = new MarkDownAssitProposalItem(); item->setText(it.key()); if (!it.value().isEmpty()) - item->setDetail(CMakeToolManager::readFirstParagraphs(it.value())); + item->setDetail(CMakeToolManager::toolTipForRstHelpFile(it.value())); item->setIcon(icon); list << item; } @@ -244,16 +242,8 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() Project *project = nullptr; const FilePath &filePath = interface()->filePath(); if (!filePath.isEmpty() && filePath.isFile()) { - CMakeTool *cmake = nullptr; - project = static_cast<CMakeProject *>(ProjectManager::projectForFile(filePath)); - if (project && project->activeTarget()) - cmake = CMakeKitAspect::cmakeTool(project->activeTarget()->kit()); - - if (!cmake) - cmake = CMakeToolManager::defaultCMakeTool(); - - if (cmake && cmake->isValid()) - keywords = cmake->keywords(); + if (auto tool = CMakeToolManager::defaultProjectOrDefaultCMakeTool()) + keywords = tool->keywords(); } QStringList buildTargets; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs index 96520f9127d..94dfa408e15 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs @@ -93,13 +93,15 @@ QtcPlugin { name: "3rdparty" cpp.includePaths: base.concat("3rdparty/cmake") - prefix: "3rdparty/cmake/" + prefix: "3rdparty/" files: [ - "cmListFileCache.cxx", - "cmListFileCache.h", - "cmListFileLexer.cxx", - "cmListFileLexer.h", - "cmStandardLexer.h", + "cmake/cmListFileCache.cxx", + "cmake/cmListFileCache.h", + "cmake/cmListFileLexer.cxx", + "cmake/cmListFileLexer.h", + "cmake/cmStandardLexer.h", + "rstparser/rstparser.cc", + "rstparser/rstparser.h" ] } } diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index da2bcff6e05..65a4f55aa24 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -8,11 +8,17 @@ #include "cmakespecificsettings.h" #include "cmaketoolsettingsaccessor.h" +#include "3rdparty/rstparser/rstparser.h" + #include <extensionsystem/pluginmanager.h> #include <coreplugin/helpmanager.h> #include <coreplugin/icore.h> +#include <projectexplorer/buildsystem.h> +#include <projectexplorer/projecttree.h> +#include <projectexplorer/target.h> +#include <stack> #include <utils/environment.h> #include <utils/pointeralgorithm.h> #include <utils/qtcassert.h> @@ -32,6 +38,137 @@ public: Internal::CMakeToolSettingsAccessor m_accessor; }; +class HtmlHandler : public rst::ContentHandler +{ +private: + std::stack<QString> m_tags; + + QStringList m_p; + QStringList m_h3; + QStringList m_cmake_code; + + QString m_last_directive_type; + QString m_last_directive_class; + + void StartBlock(rst::BlockType type) final + { + QString tag; + switch (type) { + case rst::REFERENCE_LINK: + // not used, HandleReferenceLink is used instead + break; + case rst::H1: + tag = "h1"; + break; + case rst::H2: + tag = "h2"; + break; + case rst::H3: + tag = "h3"; + break; + case rst::H4: + tag = "h4"; + break; + case rst::H5: + tag = "h5"; + break; + case rst::CODE: + tag = "code"; + break; + case rst::PARAGRAPH: + tag = "p"; + break; + case rst::LINE_BLOCK: + tag = "pre"; + break; + case rst::BLOCK_QUOTE: + if (m_last_directive_type == "code-block" && m_last_directive_class == "cmake") + tag = "cmake-code"; + else + tag = "blockquote"; + break; + case rst::BULLET_LIST: + tag = "ul"; + break; + case rst::LIST_ITEM: + tag = "li"; + break; + case rst::LITERAL_BLOCK: + tag = "pre"; + break; + } + + if (tag == "p") + m_p.push_back(QString()); + if (tag == "h3") + m_h3.push_back(QString()); + if (tag == "cmake-code") + m_cmake_code.push_back(QString()); + + if (tag == "code" && m_tags.top() == "p") + m_p.last().append("`"); + + m_tags.push(tag); + } + + void EndBlock() final + { + // Add a new "p" collector for any `code` markup that comes afterwads + // since we are insterested only in the first paragraph. + if (m_tags.top() == "p") + m_p.push_back(QString()); + + if (m_tags.top() == "code" && !m_p.isEmpty()) { + m_tags.pop(); + + if (m_tags.size() > 0 && m_tags.top() == "p") + m_p.last().append("`"); + } else { + m_tags.pop(); + } + } + + void HandleText(const char *text, std::size_t size) final + { + if (m_last_directive_type.endsWith("replace")) + return; + + QString str = QString::fromUtf8(text, size); + + if (m_tags.top() == "h3") + m_h3.last().append(str); + if (m_tags.top() == "p") + m_p.last().append(str); + if (m_tags.top() == "cmake-code") + m_cmake_code.last().append(str); + if (m_tags.top() == "code" && !m_p.isEmpty()) + m_p.last().append(str); + } + + void HandleDirective(const std::string &type, const std::string &name) final + { + m_last_directive_type = QString::fromStdString(type); + m_last_directive_class = QString::fromStdString(name); + } + + void HandleReferenceLink(const std::string &type, const std::string &text) final + { + Q_UNUSED(type) + if (!m_p.isEmpty()) + m_p.last().append(QString::fromStdString(text)); + } + +public: + QString content() const + { + const QString title = m_h3.isEmpty() ? QString() : m_h3.first(); + const QString description = m_p.isEmpty() ? QString() : m_p.first(); + const QString cmakeCode = m_cmake_code.isEmpty() ? QString() : m_cmake_code.first(); + + return QString("### %1\n\n%2\n\n````\n%3\n````").arg(title, description, cmakeCode); + } +}; + static CMakeToolManagerPrivate *d = nullptr; CMakeToolManager *CMakeToolManager::m_instance = nullptr; @@ -108,6 +245,37 @@ void CMakeToolManager::deregisterCMakeTool(const Id &id) } } +CMakeTool *CMakeToolManager::defaultProjectOrDefaultCMakeTool() +{ + static CMakeTool *tool = nullptr; + + auto updateTool = [&] { + tool = nullptr; + if (auto bs = ProjectExplorer::ProjectTree::currentBuildSystem()) + tool = CMakeKitAspect::cmakeTool(bs->target()->kit()); + if (!tool) + tool = CMakeToolManager::defaultCMakeTool(); + }; + + if (!tool) + updateTool(); + + QObject::connect(CMakeToolManager::instance(), + &CMakeToolManager::cmakeUpdated, + CMakeToolManager::instance(), + [&]() { updateTool(); }); + QObject::connect(CMakeToolManager::instance(), + &CMakeToolManager::cmakeRemoved, + CMakeToolManager::instance(), + [&]() { updateTool(); }); + QObject::connect(CMakeToolManager::instance(), + &CMakeToolManager::defaultCMakeChanged, + CMakeToolManager::instance(), + [&]() { updateTool(); }); + + return tool; +} + CMakeTool *CMakeToolManager::defaultCMakeTool() { return findById(d->m_defaultCMake); @@ -167,21 +335,25 @@ void CMakeToolManager::updateDocumentation() Core::HelpManager::registerDocumentation(docs); } -QString CMakeToolManager::readFirstParagraphs(const FilePath &helpFile) +QString CMakeToolManager::toolTipForRstHelpFile(const FilePath &helpFile) { - static QMap<FilePath, QString> map; + static QHash<FilePath, QString> map; if (map.contains(helpFile)) return map.value(helpFile); auto content = helpFile.fileContents(1024).value_or(QByteArray()); - const QString firstParagraphs - = QString("```\n%1\n```").arg(QString::fromUtf8(content.left(content.lastIndexOf("\n")))); + content.replace("\r\n", "\n"); - map[helpFile] = firstParagraphs; - return firstParagraphs; + HtmlHandler handler; + rst::Parser parser(&handler); + parser.Parse(content.left(content.lastIndexOf('\n'))); + + const QString tooltip = handler.content(); + + map[helpFile] = tooltip; + return tooltip; } - QList<Id> CMakeToolManager::autoDetectCMakeForDevice(const FilePaths &searchPaths, const QString &detectionSource, QString *logMessage) diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h index 85dbcb53b9e..761ba22ad76 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h @@ -30,6 +30,8 @@ public: static bool registerCMakeTool(std::unique_ptr<CMakeTool> &&tool); static void deregisterCMakeTool(const Utils::Id &id); + static CMakeTool *defaultProjectOrDefaultCMakeTool(); + static CMakeTool *defaultCMakeTool(); static void setDefaultCMakeTool(const Utils::Id &id); static CMakeTool *findByCommand(const Utils::FilePath &command); @@ -40,7 +42,7 @@ public: static void updateDocumentation(); - static QString readFirstParagraphs(const Utils::FilePath &helpFile); + static QString toolTipForRstHelpFile(const Utils::FilePath &helpFile); public slots: QList<Utils::Id> autoDetectCMakeForDevice(const Utils::FilePaths &searchPaths, From 9c6bb1ac804a85c1306219bbd9c958f4d95ca711 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 27 Sep 2023 14:54:03 +0200 Subject: [PATCH 1320/1777] ProjectExplorer: Use less overlapping patterns in toolchain detection Change-Id: I7de28d736e940d06267a16c9619e95d6fa2c6112 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index e004f6b77e7..34257ccaa78 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1254,14 +1254,12 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, QStringList nameFilters(compilerName); if (detectVariants) { nameFilters - << compilerName + "-[1-9]*" // "clang-8", "gcc-5" - << ("*-" + compilerName) // "avr-gcc", "avr32-gcc" - << ("*-" + compilerName + "-[1-9]*")// "avr-gcc-4.8.1", "avr32-gcc-4.4.7" - << ("*-*-*-" + compilerName) // "arm-none-eabi-gcc" - << ("*-*-*-" + compilerName + "-[1-9]*") // "arm-none-eabi-gcc-9.1.0" - << ("*-*-*-*-" + compilerName) // "x86_64-pc-linux-gnu-gcc" - << ("*-*-*-*-" + compilerName - + "-[1-9]*"); // "x86_64-pc-linux-gnu-gcc-7.4.1" + << compilerName + "-[1-9]*" // "clang-8", "gcc-5" + << ("*-" + compilerName) // "avr-gcc", "avr32-gcc", "arm-none-eabi-gcc", + // "x86_64-pc-linux-gnu-gcc" + << ("*-" + compilerName + "-[1-9]*"); // "avr-gcc-4.8.1", "avr32-gcc-4.4.7", + // "arm-none-eabi-gcc-9.1.0" + // "x86_64-pc-linux-gnu-gcc-7.4.1" } const Utils::OsType os = detector.device->osType(); nameFilters = transform(nameFilters, [os](const QString &baseName) { From c32022f0857dfca38359c7cc32a578a677af18d5 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 27 Sep 2023 14:29:35 +0200 Subject: [PATCH 1321/1777] GitHub/Coin: Update LLVM/Clang to 17.0.1 Change-Id: I0cc3e3640eb60cd991fba073f8d32d3de9b900fe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .github/workflows/build_cmake.yml | 2 +- coin/instructions/common_environment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 52c2a0e4d29..3b2c1755b2f 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -9,7 +9,7 @@ on: env: QT_VERSION: 6.5.2 MACOS_DEPLOYMENT_TARGET: 10.15 - CLANG_VERSION: 17.0.0-rc4 + CLANG_VERSION: 17.0.1 ELFUTILS_VERSION: 0.175 CMAKE_VERSION: 3.21.1 NINJA_VERSION: 1.10.2 diff --git a/coin/instructions/common_environment.yaml b/coin/instructions/common_environment.yaml index 2a56fe600e9..ea72589c1df 100644 --- a/coin/instructions/common_environment.yaml +++ b/coin/instructions/common_environment.yaml @@ -7,7 +7,7 @@ instructions: variableValue: "RelWithDebInfo" - type: EnvironmentVariable variableName: LLVM_BASE_URL - variableValue: https://ci-files02-hki.ci.qt.io/packages/jenkins/qtcreator_libclang/libclang-release_17.0.0-rc4-based + variableValue: https://ci-files02-hki.ci.qt.io/packages/jenkins/qtcreator_libclang/libclang-release_17.0.1-based - type: EnvironmentVariable variableName: QTC_QT_BASE_URL variableValue: "https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.2-released/Qt" From c05f9cacc6be1038a1a9ecee0af07ac84c01738c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 27 Sep 2023 16:16:43 +0200 Subject: [PATCH 1322/1777] CtfVisualizer: Fix multithreading issues Simplify the CtfVisualizerTool::loadJson(). Don't create a QThread manually, but use TaskTree with AsyncTask instead. Move pure parsing into the separate thread, and leave the nlohmann::json event handling in the main thread. Avoid moving m_modelAggregator between threads. Fixes: QTCREATORBUG-29657 Change-Id: I0c6a9a4ea8298dbbdbafcddd338d39ad73c3f82b Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/ctfvisualizer/ctftracemanager.cpp | 71 +--------- src/plugins/ctfvisualizer/ctftracemanager.h | 14 +- .../ctfvisualizer/ctfvisualizertool.cpp | 128 +++++++++++++----- src/plugins/ctfvisualizer/ctfvisualizertool.h | 10 +- 4 files changed, 103 insertions(+), 120 deletions(-) diff --git a/src/plugins/ctfvisualizer/ctftracemanager.cpp b/src/plugins/ctfvisualizer/ctftracemanager.cpp index 82e5b54b762..29dbed73c28 100644 --- a/src/plugins/ctfvisualizer/ctftracemanager.cpp +++ b/src/plugins/ctfvisualizer/ctftracemanager.cpp @@ -8,17 +8,11 @@ #include "ctfvisualizertr.h" #include <coreplugin/icore.h> + #include <tracing/timelinemodelaggregator.h> -#include <QByteArray> -#include <QDebug> -#include <QFile> -#include <QList> #include <QMessageBox> -#include <fstream> - - namespace CtfVisualizer { namespace Internal { @@ -26,48 +20,6 @@ using json = nlohmann::json; using namespace Constants; - -class CtfJsonParserCallback -{ - -public: - - explicit CtfJsonParserCallback(CtfTraceManager *traceManager) - : m_traceManager(traceManager) - {} - - bool callback(int depth, nlohmann::json::parse_event_t event, nlohmann::json &parsed) - { - if ((event == json::parse_event_t::array_start && depth == 0) - || (event == json::parse_event_t::key && depth == 1 && parsed == json(CtfTraceEventsKey))) { - m_isInTraceArray = true; - m_traceArrayDepth = depth; - return true; - } - if (m_isInTraceArray && event == json::parse_event_t::array_end && depth == m_traceArrayDepth) { - m_isInTraceArray = false; - return false; - } - if (m_isInTraceArray && event == json::parse_event_t::object_end && depth == m_traceArrayDepth + 1) { - m_traceManager->addEvent(parsed); - return false; - } - if (m_isInTraceArray || (event == json::parse_event_t::object_start && depth == 0)) { - // keep outer object and values in trace objects: - return true; - } - // discard any objects outside of trace array: - // TODO: parse other data, e.g. stack frames - return false; - } - -protected: - CtfTraceManager *m_traceManager; - - bool m_isInTraceArray = false; - int m_traceArrayDepth = 0; -}; - CtfTraceManager::CtfTraceManager(QObject *parent, Timeline::TimelineModelAggregator *modelAggregator, CtfStatisticsModel *statisticsModel) @@ -75,7 +27,6 @@ CtfTraceManager::CtfTraceManager(QObject *parent, , m_modelAggregator(modelAggregator) , m_statisticsModel(statisticsModel) { - } qint64 CtfTraceManager::traceDuration() const @@ -142,26 +93,6 @@ void CtfTraceManager::addEvent(const json &event) } } -void CtfTraceManager::load(const QString &filename) -{ - clearAll(); - - std::ifstream file(filename.toStdString()); - if (!file.is_open()) { - QMessageBox::warning(Core::ICore::dialogParent(), - Tr::tr("CTF Visualizer"), - Tr::tr("Cannot read the CTF file.")); - return; - } - CtfJsonParserCallback ctfParser(this); - json::parser_callback_t callback = [&ctfParser](int depth, json::parse_event_t event, json &parsed) { - return ctfParser.callback(depth, event, parsed); - }; - json unusedValues = json::parse(file, callback, /*allow_exceptions*/ false); - file.close(); - updateStatistics(); -} - void CtfTraceManager::finalize() { bool userConsentToIgnoreDeepTraces = false; diff --git a/src/plugins/ctfvisualizer/ctftracemanager.h b/src/plugins/ctfvisualizer/ctftracemanager.h index d376d010b5c..29694740297 100644 --- a/src/plugins/ctfvisualizer/ctftracemanager.h +++ b/src/plugins/ctfvisualizer/ctftracemanager.h @@ -5,13 +5,11 @@ #include "json/json.hpp" #include <QHash> +#include <QList> #include <QMap> #include <QObject> -#include <QVector> -namespace Timeline { -class TimelineModelAggregator; -} +namespace Timeline { class TimelineModelAggregator; } namespace CtfVisualizer { namespace Internal { @@ -34,7 +32,6 @@ public: void addEvent(const nlohmann::json &event); - void load(const QString &filename); void finalize(); bool isEmpty() const; @@ -46,6 +43,9 @@ public: void setThreadRestriction(const QString &tid, bool restrictToThisThread); bool isRestrictedTo(const QString &tid) const; + void updateStatistics(); + void clearAll(); + signals: void detailsRequested(const QString &title); @@ -53,10 +53,6 @@ protected: void addModelForThread(const QString &threadId, const QString &processId); void addModelsToAggregator(); - void updateStatistics(); - - void clearAll(); - Timeline::TimelineModelAggregator *const m_modelAggregator; CtfStatisticsModel *const m_statisticsModel; diff --git a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp index 22b6bd50473..6aee14e1236 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp +++ b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp @@ -13,30 +13,29 @@ #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/icore.h> -#include <coreplugin/progressmanager/progressmanager.h> +#include <coreplugin/progressmanager/taskprogress.h> + #include <debugger/analyzer/analyzerconstants.h> +#include <utils/async.h> #include <utils/stylehelper.h> #include <utils/utilsicons.h> -#include <QAction> -#include <QApplication> #include <QFileDialog> -#include <QFutureInterface> #include <QMenu> #include <QMessageBox> -#include <QThread> + +#include <fstream> using namespace Core; using namespace CtfVisualizer::Constants; - +using namespace Utils; namespace CtfVisualizer { namespace Internal { CtfVisualizerTool::CtfVisualizerTool() : QObject (nullptr) - , m_isLoading(false) , m_loadJson(nullptr) , m_traceView(nullptr) , m_modelAggregator(new Timeline::TimelineModelAggregator(this)) @@ -150,34 +149,84 @@ Timeline::TimelineZoomControl *CtfVisualizerTool::zoomControl() const return m_zoomControl.get(); } -void CtfVisualizerTool::loadJson(const QString &filename) +class CtfJsonParserFunctor { - if (m_isLoading) - return; +public: + CtfJsonParserFunctor(QPromise<nlohmann::json> &promise) + : m_promise(promise) {} - if (filename.isEmpty()) { - m_isLoading = false; + bool operator()(int depth, nlohmann::json::parse_event_t event, nlohmann::json &parsed) + { + using json = nlohmann::json; + if ((event == json::parse_event_t::array_start && depth == 0) + || (event == json::parse_event_t::key && depth == 1 && parsed == json(CtfTraceEventsKey))) { + m_isInTraceArray = true; + m_traceArrayDepth = depth; + return true; + } + if (m_isInTraceArray && event == json::parse_event_t::array_end && depth == m_traceArrayDepth) { + m_isInTraceArray = false; + return false; + } + if (m_isInTraceArray && event == json::parse_event_t::object_end && depth == m_traceArrayDepth + 1) { + m_promise.addResult(parsed); + return false; + } + if (m_isInTraceArray || (event == json::parse_event_t::object_start && depth == 0)) { + // keep outer object and values in trace objects: + return true; + } + // discard any objects outside of trace array: + // TODO: parse other data, e.g. stack frames + return false; + } + +protected: + QPromise<nlohmann::json> &m_promise; + bool m_isInTraceArray = false; + int m_traceArrayDepth = 0; +}; + +static void load(QPromise<nlohmann::json> &promise, const QString &fileName) +{ + using json = nlohmann::json; + + std::ifstream file(fileName.toStdString()); + if (!file.is_open()) { + promise.future().cancel(); return; } - m_isLoading = true; + CtfJsonParserFunctor functor(promise); + json::parser_callback_t callback = [&functor](int depth, json::parse_event_t event, json &parsed) { + return functor(depth, event, parsed); + }; - auto *futureInterface = new QFutureInterface<void>(); - auto *task = new QFuture<void>(futureInterface); + try { + json unusedValues = json::parse(file, callback, /*allow_exceptions*/ false); + } catch (...) { + // nlohmann::json can throw exceptions when requesting type that is wrong + } - QThread *thread = QThread::create([this, filename, futureInterface]() { - try { - m_traceManager->load(filename); - } catch (...) { - // nlohmann::json can throw exceptions when requesting type that is wrong - } - m_modelAggregator->moveToThread(QApplication::instance()->thread()); - m_modelAggregator->setParent(this); - futureInterface->reportFinished(); - }); + file.close(); +} - connect(thread, &QThread::finished, this, [this, thread, task, futureInterface]() { - // in main thread: +void CtfVisualizerTool::loadJson(const QString &fileName) +{ + using namespace Tasking; + + if (m_loader || fileName.isEmpty()) + return; + + const auto onSetup = [this, fileName](Async<nlohmann::json> &async) { + m_traceManager->clearAll(); + async.setConcurrentCallData(load, fileName); + connect(&async, &AsyncBase::resultReadyAt, this, [this, asyncPtr = &async](int index) { + m_traceManager->addEvent(asyncPtr->resultAt(index)); + }); + }; + const auto onDone = [this] { + m_traceManager->updateStatistics(); if (m_traceManager->isEmpty()) { QMessageBox::warning(Core::ICore::dialogParent(), Tr::tr("CTF Visualizer"), @@ -189,17 +238,22 @@ void CtfVisualizerTool::loadJson(const QString &filename) zoomControl()->setRange(m_traceManager->traceBegin(), m_traceManager->traceEnd() + m_traceManager->traceDuration() / 20); } setAvailableThreads(m_traceManager->getSortedThreads()); - thread->deleteLater(); - delete task; - delete futureInterface; - m_isLoading = false; - }, Qt::QueuedConnection); + m_loader.release()->deleteLater(); + }; + const auto onError = [this] { + QMessageBox::warning(Core::ICore::dialogParent(), + Tr::tr("CTF Visualizer"), + Tr::tr("Cannot read the CTF file.")); + m_loader.release()->deleteLater(); + }; - m_modelAggregator->setParent(nullptr); - m_modelAggregator->moveToThread(thread); - - thread->start(); - Core::ProgressManager::addTask(*task, Tr::tr("Loading CTF File"), CtfVisualizerTaskLoadJson); + const Group recipe { AsyncTask<nlohmann::json>(onSetup) }; + m_loader.reset(new TaskTree(recipe)); + connect(m_loader.get(), &TaskTree::done, this, onDone); + connect(m_loader.get(), &TaskTree::errorOccurred, this, onError); + auto progress = new TaskProgress(m_loader.get()); + progress->setDisplayName(Tr::tr("Loading CTF File")); + m_loader->start(); } } // namespace Internal diff --git a/src/plugins/ctfvisualizer/ctfvisualizertool.h b/src/plugins/ctfvisualizer/ctfvisualizertool.h index baea670d5cf..00be211efac 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertool.h +++ b/src/plugins/ctfvisualizer/ctfvisualizertool.h @@ -6,12 +6,15 @@ #include "ctfvisualizerconstants.h" #include <debugger/debuggermainwindow.h> + #include <tracing/timelinemodelaggregator.h> #include <tracing/timelinezoomcontrol.h> #include <QCoreApplication> #include <QScopedPointer> +namespace Tasking { class TaskTree; } + namespace CtfVisualizer { namespace Internal { @@ -21,7 +24,6 @@ class CtfStatisticsView; class CtfTimelineModel; class CtfVisualizerTraceView; - class CtfVisualizerTool : public QObject { Q_OBJECT @@ -34,7 +36,7 @@ public: CtfTraceManager *traceManager() const; Timeline::TimelineZoomControl *zoomControl() const; - void loadJson(const QString &filename); + void loadJson(const QString &fileName); private: void createViews(); @@ -45,11 +47,11 @@ private: void setAvailableThreads(const QList<CtfTimelineModel *> &threads); void toggleThreadRestriction(QAction *action); - Utils::Perspective m_perspective{Constants::CtfVisualizerPerspectiveId, + Utils::Perspective m_perspective{CtfVisualizer::Constants::CtfVisualizerPerspectiveId, QCoreApplication::translate("QtC::CtfVisualizer", "Chrome Trace Format Visualizer")}; - bool m_isLoading; + std::unique_ptr<Tasking::TaskTree> m_loader; QScopedPointer<QAction> m_loadJson; CtfVisualizerTraceView *m_traceView; From aeb05db3af4e570a04da4d5108a659976f341bf7 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 27 Sep 2023 08:36:18 +0200 Subject: [PATCH 1323/1777] CompilerExplorer: Disable Dock menu and close Change-Id: I874e624cc35c337a7774377847f5f1a79b07a2b4 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/compilerexplorer/compilerexplorereditor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index f0829853630..9c3f00feb5a 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -475,6 +475,7 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, , m_undoStack(undoStack) , m_actionHandler(actionHandler) { + setContextMenuPolicy(Qt::NoContextMenu); setAutoHideTitleBars(false); setDockNestingEnabled(true); setDocumentMode(true); @@ -524,6 +525,7 @@ void EditorWidget::addCompiler(const std::shared_ptr<SourceSettings> &sourceSett compiler->setWindowTitle("Compiler #" + QString::number(idx)); compiler->setObjectName("compiler_" + QString::number(idx)); QDockWidget *dockWidget = addDockForWidget(compiler, parentDockWidget); + dockWidget->setFeatures(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable); addDockWidget(Qt::RightDockWidgetArea, dockWidget); m_compilerWidgets.append(dockWidget); @@ -585,6 +587,7 @@ void EditorWidget::addSourceEditor(const std::shared_ptr<SourceSettings> &source m_actionHandler.updateCurrentEditor(); }); + dockWidget->setFeatures(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable); addDockWidget(Qt::LeftDockWidgetArea, dockWidget); sourceSettings->compilers.forEachItem<CompilerSettings>( From 7a4e66992c7ded022886dbca0119c7807c139c6e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 27 Sep 2023 16:53:35 +0200 Subject: [PATCH 1324/1777] Utils: Streamline QtcSettings interface Change-Id: Icd9592c0fca5df1e52bdafb570665d92deeb70bb Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 3 +- src/libs/utils/basetreeview.cpp | 2 +- src/libs/utils/infobar.cpp | 2 +- src/libs/utils/minimizableinfobars.cpp | 5 +- src/libs/utils/qtcsettings.cpp | 23 +++- src/libs/utils/qtcsettings.h | 32 ++--- src/libs/utils/unixutils.cpp | 3 +- src/plugins/cppeditor/cppfilesettingspage.cpp | 30 ++--- src/plugins/cppeditor/cppincludehierarchy.cpp | 2 +- src/plugins/cppeditor/cppquickfixsettings.cpp | 119 ++++++++---------- src/plugins/qbsprojectmanager/qbssettings.cpp | 4 +- .../qmljseditor/qmljseditingsettingspage.cpp | 31 ++--- .../qtsupport/gettingstartedwelcomepage.cpp | 3 +- 13 files changed, 110 insertions(+), 149 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 5a122937bdb..13e8d0df49f 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -655,8 +655,7 @@ void BaseAspect::writeSettings() const if (settingsKey().isEmpty()) return; QTC_ASSERT(theSettings, return); - QtcSettings::setValueWithDefault(theSettings, - settingsKey(), + theSettings->setValueWithDefault(settingsKey(), toSettingsValue(variantValue()), toSettingsValue(defaultVariantValue())); } diff --git a/src/libs/utils/basetreeview.cpp b/src/libs/utils/basetreeview.cpp index 01dbe869ca8..8719bfc9b59 100644 --- a/src/libs/utils/basetreeview.cpp +++ b/src/libs/utils/basetreeview.cpp @@ -137,7 +137,7 @@ public: l.append(column); l.append(width); } - QtcSettings::setValueWithDefault(m_settings, ColumnKey, l); + m_settings->setValueWithDefault(ColumnKey, l); m_settings->endGroup(); } } diff --git a/src/libs/utils/infobar.cpp b/src/libs/utils/infobar.cpp index 4d980b809a5..37daa486def 100644 --- a/src/libs/utils/infobar.cpp +++ b/src/libs/utils/infobar.cpp @@ -215,7 +215,7 @@ void InfoBar::writeGloballySuppressedToSettings() if (!m_settings) return; const QStringList list = transform<QList>(globallySuppressed, &Id::toString); - QtcSettings::setValueWithDefault(m_settings, C_SUPPRESSED_WARNINGS, list); + m_settings->setValueWithDefault(C_SUPPRESSED_WARNINGS, list); } diff --git a/src/libs/utils/minimizableinfobars.cpp b/src/libs/utils/minimizableinfobars.cpp index c3775bdf899..d2ff3fe96f7 100644 --- a/src/libs/utils/minimizableinfobars.cpp +++ b/src/libs/utils/minimizableinfobars.cpp @@ -127,10 +127,7 @@ bool MinimizableInfoBars::showInInfoBar(const Id &id) const void MinimizableInfoBars::setShowInInfoBar(const Id &id, bool show) { - QtcSettings::setValueWithDefault(InfoBar::settings(), - settingsKey(id), - show, - kShowInInfoBarDefault); + InfoBar::settings()->setValueWithDefault(settingsKey(id), show, kShowInInfoBarDefault); } } // namespace Utils diff --git a/src/libs/utils/qtcsettings.cpp b/src/libs/utils/qtcsettings.cpp index e778ff4411b..2fb036422c1 100644 --- a/src/libs/utils/qtcsettings.cpp +++ b/src/libs/utils/qtcsettings.cpp @@ -11,7 +11,8 @@ namespace Utils { \inheaderfile utils/qtcsettings.h \inmodule QtCreator - \brief The QtcSettings class is an extension of the QSettings class. + \brief The QtcSettings class is an extension of the QSettings class + the uses Utils::Key instead of QString for keys. Use Utils::QtcSettings::setValueWithDefault() to write values with a default. @@ -30,6 +31,16 @@ namespace Utils { \sa QSettings::setValue() */ +void QtcSettings::beginGroup(const Key &prefix) +{ + QSettings::beginGroup(stringFromKey(prefix)); +} + +QVariant QtcSettings::value(const Key &key) const +{ + return QSettings::value(stringFromKey(key)); +} + QVariant QtcSettings::value(const Key &key, const QVariant &def) const { return QSettings::value(stringFromKey(key), def); @@ -40,6 +51,16 @@ void QtcSettings::setValue(const Key &key, const QVariant &value) QSettings::setValue(stringFromKey(key), mapEntryFromStoreEntry(value)); } +void QtcSettings::remove(const Key &key) +{ + QSettings::remove(stringFromKey(key)); +} + +bool QtcSettings::contains(const Key &key) const +{ + return QSettings::contains(stringFromKey(key)); +} + KeyList QtcSettings::childKeys() const { return keysFromStrings(QSettings::childKeys()); diff --git a/src/libs/utils/qtcsettings.h b/src/libs/utils/qtcsettings.h index 6b593ef0832..8a048b73482 100644 --- a/src/libs/utils/qtcsettings.h +++ b/src/libs/utils/qtcsettings.h @@ -29,48 +29,32 @@ public: using QSettings::status; using QSettings::clear; - void beginGroup(const Key &prefix) { QSettings::beginGroup(stringFromKey(prefix)); } + void beginGroup(const Key &prefix); - QVariant value(const Key &key) const { return QSettings::value(stringFromKey(key)); } + QVariant value(const Key &key) const; QVariant value(const Key &key, const QVariant &def) const; void setValue(const Key &key, const QVariant &value); - void remove(const Key &key) { QSettings::remove(stringFromKey(key)); } - bool contains(const Key &key) const { return QSettings::contains(stringFromKey(key)); } + void remove(const Key &key); + bool contains(const Key &key) const; KeyList childKeys() const; template<typename T> void setValueWithDefault(const Key &key, const T &val, const T &defaultValue) - { - setValueWithDefault(this, key, val, defaultValue); - } - - template<typename T> - static void setValueWithDefault(QtcSettings *settings, - const Key &key, - const T &val, - const T &defaultValue) { if (val == defaultValue) - settings->QSettings::remove(stringFromKey(key)); + remove(key); else - settings->QSettings::setValue(stringFromKey(key), QVariant::fromValue(val)); + setValue(key, val); } - template<typename T> void setValueWithDefault(const Key &key, const T &val) - { - setValueWithDefault(this, key, val); - } - - template<typename T> - static void setValueWithDefault(QtcSettings *settings, const Key &key, const T &val) { if (val == T()) - settings->QSettings::remove(stringFromKey(key)); + remove(key); else - settings->QSettings::setValue(stringFromKey(key), QVariant::fromValue(val)); + setValue(key, val); } }; diff --git a/src/libs/utils/unixutils.cpp b/src/libs/utils/unixutils.cpp index 2b5937f089d..388f8549fe8 100644 --- a/src/libs/utils/unixutils.cpp +++ b/src/libs/utils/unixutils.cpp @@ -26,10 +26,9 @@ QString UnixUtils::fileBrowser(const QtcSettings *settings) void UnixUtils::setFileBrowser(QtcSettings *settings, const QString &term) { - QtcSettings::setValueWithDefault(settings, Key("General/FileBrowser"), term, defaultFileBrowser()); + settings->setValueWithDefault("General/FileBrowser", term, defaultFileBrowser()); } - QString UnixUtils::fileBrowserHelpText() { QString help = Tr::tr("<table border=1 cellspacing=0 cellpadding=3>" diff --git a/src/plugins/cppeditor/cppfilesettingspage.cpp b/src/plugins/cppeditor/cppfilesettingspage.cpp index fa314408847..4303fe67d4f 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.cpp +++ b/src/plugins/cppeditor/cppfilesettingspage.cpp @@ -54,27 +54,15 @@ void CppFileSettings::toSettings(QtcSettings *s) const { const CppFileSettings def; s->beginGroup(Constants::CPPEDITOR_SETTINGSGROUP); - QtcSettings::setValueWithDefault(s, headerPrefixesKeyC, headerPrefixes, def.headerPrefixes); - QtcSettings::setValueWithDefault(s, sourcePrefixesKeyC, sourcePrefixes, def.sourcePrefixes); - QtcSettings::setValueWithDefault(s, headerSuffixKeyC, headerSuffix, def.headerSuffix); - QtcSettings::setValueWithDefault(s, sourceSuffixKeyC, sourceSuffix, def.sourceSuffix); - QtcSettings::setValueWithDefault(s, - headerSearchPathsKeyC, - headerSearchPaths, - def.headerSearchPaths); - QtcSettings::setValueWithDefault(s, - sourceSearchPathsKeyC, - sourceSearchPaths, - def.sourceSearchPaths); - QtcSettings::setValueWithDefault(s, - Constants::LOWERCASE_CPPFILES_KEY, - lowerCaseFiles, - def.lowerCaseFiles); - QtcSettings::setValueWithDefault(s, headerPragmaOnceC, headerPragmaOnce, def.headerPragmaOnce); - QtcSettings::setValueWithDefault(s, - licenseTemplatePathKeyC, - licenseTemplatePath, - def.licenseTemplatePath); + s->setValueWithDefault(headerPrefixesKeyC, headerPrefixes, def.headerPrefixes); + s->setValueWithDefault(sourcePrefixesKeyC, sourcePrefixes, def.sourcePrefixes); + s->setValueWithDefault(headerSuffixKeyC, headerSuffix, def.headerSuffix); + s->setValueWithDefault(sourceSuffixKeyC, sourceSuffix, def.sourceSuffix); + s->setValueWithDefault(headerSearchPathsKeyC, headerSearchPaths, def.headerSearchPaths); + s->setValueWithDefault(sourceSearchPathsKeyC, sourceSearchPaths, def.sourceSearchPaths); + s->setValueWithDefault(Constants::LOWERCASE_CPPFILES_KEY, lowerCaseFiles, def.lowerCaseFiles); + s->setValueWithDefault(headerPragmaOnceC, headerPragmaOnce, def.headerPragmaOnce); + s->setValueWithDefault(licenseTemplatePathKeyC, licenseTemplatePath, def.licenseTemplatePath); s->endGroup(); } diff --git a/src/plugins/cppeditor/cppincludehierarchy.cpp b/src/plugins/cppeditor/cppincludehierarchy.cpp index 3ee1efc6af9..a2009c89900 100644 --- a/src/plugins/cppeditor/cppincludehierarchy.cpp +++ b/src/plugins/cppeditor/cppincludehierarchy.cpp @@ -432,7 +432,7 @@ const bool kSyncDefault = false; void CppIncludeHierarchyWidget::saveSettings(QtcSettings *settings, int position) { const Key key = keyFromString(QString("IncludeHierarchy.%1.SyncWithEditor").arg(position)); - QtcSettings::setValueWithDefault(settings, key, m_toggleSync->isChecked(), kSyncDefault); + settings->setValueWithDefault(key, m_toggleSync->isChecked(), kSyncDefault); } void CppIncludeHierarchyWidget::restoreSettings(QtcSettings *settings, int position) diff --git a/src/plugins/cppeditor/cppquickfixsettings.cpp b/src/plugins/cppeditor/cppquickfixsettings.cpp index f1992aede27..4ce10822678 100644 --- a/src/plugins/cppeditor/cppquickfixsettings.cpp +++ b/src/plugins/cppeditor/cppquickfixsettings.cpp @@ -117,75 +117,58 @@ void CppQuickFixSettings::saveSettingsTo(QtcSettings *s) { CppQuickFixSettings def; s->beginGroup(Constants::QUICK_FIX_SETTINGS_ID); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_GETTER_OUTSIDE_CLASS_FROM, - getterOutsideClassFrom, - def.getterOutsideClassFrom); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_GETTER_IN_CPP_FILE_FROM, - getterInCppFileFrom, - def.getterInCppFileFrom); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_SETTER_OUTSIDE_CLASS_FROM, - setterOutsideClassFrom, - def.setterOutsideClassFrom); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_SETTER_IN_CPP_FILE_FROM, - setterInCppFileFrom, - def.setterInCppFileFrom); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_GETTER_OUTSIDE_CLASS_FROM, + getterOutsideClassFrom, + def.getterOutsideClassFrom); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_GETTER_IN_CPP_FILE_FROM, + getterInCppFileFrom, + def.getterInCppFileFrom); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SETTER_OUTSIDE_CLASS_FROM, + setterOutsideClassFrom, + def.setterOutsideClassFrom); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SETTER_IN_CPP_FILE_FROM, + setterInCppFileFrom, + def.setterInCppFileFrom); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_GETTER_ATTRIBUTES, - getterAttributes, - def.getterAttributes); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_GETTER_NAME_TEMPLATE, - getterNameTemplate, - def.getterNameTemplate); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_SETTER_NAME_TEMPLATE, - setterNameTemplate, - def.setterNameTemplate); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_RESET_NAME_TEMPLATE, - resetNameTemplate, - def.resetNameTemplate); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_SIGNAL_NAME_TEMPLATE, - signalNameTemplate, - def.signalNameTemplate); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_SIGNAL_WITH_NEW_VALUE, - signalWithNewValue, - def.signalWithNewValue); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_CPP_FILE_NAMESPACE_HANDLING, - int(cppFileNamespaceHandling), - int(def.cppFileNamespaceHandling)); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_MEMBER_VARIABEL_NAME_TEMPLATE, - memberVariableNameTemplate, - def.memberVariableNameTemplate); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_SETTER_PARAMETER_NAME, - setterParameterNameTemplate, - def.setterParameterNameTemplate); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_SETTER_AS_SLOT, - setterAsSlot, - def.setterAsSlot); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_USE_AUTO, - useAuto, - def.useAuto); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_VALUE_TYPES, - valueTypes, - def.valueTypes); - QtcSettings::setValueWithDefault(s, - Constants::QUICK_FIX_SETTING_RETURN_BY_CONST_REF, - returnByConstRef, - def.returnByConstRef); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_GETTER_ATTRIBUTES, + getterAttributes, + def.getterAttributes); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_GETTER_NAME_TEMPLATE, + getterNameTemplate, + def.getterNameTemplate); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SETTER_NAME_TEMPLATE, + setterNameTemplate, + def.setterNameTemplate); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_RESET_NAME_TEMPLATE, + resetNameTemplate, + def.resetNameTemplate); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SIGNAL_NAME_TEMPLATE, + signalNameTemplate, + def.signalNameTemplate); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SIGNAL_WITH_NEW_VALUE, + signalWithNewValue, + def.signalWithNewValue); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_CPP_FILE_NAMESPACE_HANDLING, + int(cppFileNamespaceHandling), + int(def.cppFileNamespaceHandling)); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_MEMBER_VARIABEL_NAME_TEMPLATE, + memberVariableNameTemplate, + def.memberVariableNameTemplate); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SETTER_PARAMETER_NAME, + setterParameterNameTemplate, + def.setterParameterNameTemplate); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SETTER_AS_SLOT, + setterAsSlot, + def.setterAsSlot); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_USE_AUTO, + useAuto, + def.useAuto); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_VALUE_TYPES, + valueTypes, + def.valueTypes); + s->setValueWithDefault(Constants::QUICK_FIX_SETTING_RETURN_BY_CONST_REF, + returnByConstRef, + def.returnByConstRef); if (customTemplates == def.customTemplates) { s->remove(Constants::QUICK_FIX_SETTING_CUSTOM_TEMPLATES); } else { diff --git a/src/plugins/qbsprojectmanager/qbssettings.cpp b/src/plugins/qbsprojectmanager/qbssettings.cpp index 087f11d5e37..317bbf92c9c 100644 --- a/src/plugins/qbsprojectmanager/qbssettings.cpp +++ b/src/plugins/qbsprojectmanager/qbssettings.cpp @@ -142,8 +142,8 @@ void QbsSettings::loadSettings() void QbsSettings::storeSettings() const { QtcSettings * const s = Core::ICore::settings(); - QtcSettings::setValueWithDefault(s, QBS_EXE_KEY, m_settings.qbsExecutableFilePath.toString(), - defaultQbsExecutableFilePath().toString()); + s->setValueWithDefault(QBS_EXE_KEY, m_settings.qbsExecutableFilePath.toString(), + defaultQbsExecutableFilePath().toString()); s->setValue(QBS_DEFAULT_INSTALL_DIR_KEY, m_settings.defaultInstallDirTemplate); s->setValue(USE_CREATOR_SETTINGS_KEY, m_settings.useCreatorSettings); } diff --git a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp index ee243eb5bcd..642a5facc59 100644 --- a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp +++ b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp @@ -135,27 +135,16 @@ void QmlJsEditingSettings::toSettings(QtcSettings *settings) const settings->setValue(USE_QMLLS, m_qmllsSettings.useQmlls); settings->setValue(USE_LATEST_QMLLS, m_qmllsSettings.useLatestQmlls); settings->setValue(DISABLE_BUILTIN_CODEMODEL, m_qmllsSettings.disableBuiltinCodemodel); - Utils::QtcSettings::setValueWithDefault(settings, FORMAT_COMMAND, m_formatCommand, {}); - Utils::QtcSettings::setValueWithDefault(settings, - FORMAT_COMMAND_OPTIONS, - m_formatCommandOptions, - {}); - Utils::QtcSettings::setValueWithDefault(settings, - CUSTOM_COMMAND, - m_useCustomFormatCommand, - false); - Utils::QtcSettings::setValueWithDefault(settings, - CUSTOM_ANALYZER, - m_useCustomAnalyzer, - false); - Utils::QtcSettings::setValueWithDefault(settings, - DISABLED_MESSAGES, - intListToStringList(Utils::sorted(Utils::toList(m_disabledMessages))), - defaultDisabledMessagesAsString()); - Utils::QtcSettings::setValueWithDefault(settings, - DISABLED_MESSAGES_NONQUICKUI, - intListToStringList(Utils::sorted(Utils::toList(m_disabledMessagesForNonQuickUi))), - defaultDisabledNonQuickUiAsString()); + settings->setValueWithDefault(FORMAT_COMMAND, m_formatCommand, {}); + settings->setValueWithDefault(FORMAT_COMMAND_OPTIONS, m_formatCommandOptions, {}); + settings->setValueWithDefault(CUSTOM_COMMAND, m_useCustomFormatCommand, false); + settings->setValueWithDefault(CUSTOM_ANALYZER, m_useCustomAnalyzer, false); + settings->setValueWithDefault(DISABLED_MESSAGES, + intListToStringList(Utils::sorted(Utils::toList(m_disabledMessages))), + defaultDisabledMessagesAsString()); + settings->setValueWithDefault(DISABLED_MESSAGES_NONQUICKUI, + intListToStringList(Utils::sorted(Utils::toList(m_disabledMessagesForNonQuickUi))), + defaultDisabledNonQuickUiAsString()); settings->endGroup(); QmllsSettingsManager::instance()->checkForChanges(); } diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index b6f42fb8d1f..fc0575027f1 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp @@ -116,7 +116,8 @@ FilePath ExamplesWelcomePage::copyToAlternativeLocation(const FilePath &proFile, if (code == Copy) { const QString exampleDirName = projectDir.fileName(); const FilePath destBaseDir = chooser->filePath(); - settings->setValueWithDefault(C_FALLBACK_ROOT, destBaseDir, defaultRootDirectory); + settings->setValueWithDefault(C_FALLBACK_ROOT, destBaseDir.toSettings(), + defaultRootDirectory.toSettings()); const FilePath targetDir = destBaseDir / exampleDirName; if (targetDir.exists()) { QMessageBox::warning(ICore::dialogParent(), From 895f8e73961d82a2a7971087df9248584eaa4eb0 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 27 Sep 2023 18:03:18 +0200 Subject: [PATCH 1325/1777] Meson: Merge MesonProcess into project parser file pair Only used there. Also remove the translation line in the test project to help with incomplete Qt 5 installations. Change-Id: Id7029b499cec69a7e1733e2ac4ade9026c522951 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../mesonprojectmanager/CMakeLists.txt | 2 - .../mesonprojectmanager/mesonprocess.cpp | 119 ------------- .../mesonprojectmanager/mesonprocess.h | 54 ------ .../mesonprojectmanager.qbs | 2 - .../mesonprojectparser.cpp | 159 ++++++++++++++---- .../mesonprojectmanager/mesonprojectparser.h | 18 +- .../meson/mesonsampleproject/meson.build | 2 +- 7 files changed, 143 insertions(+), 213 deletions(-) delete mode 100644 src/plugins/mesonprojectmanager/mesonprocess.cpp delete mode 100644 src/plugins/mesonprojectmanager/mesonprocess.h diff --git a/src/plugins/mesonprojectmanager/CMakeLists.txt b/src/plugins/mesonprojectmanager/CMakeLists.txt index 33fc6b25b71..9fc1f89b6f8 100644 --- a/src/plugins/mesonprojectmanager/CMakeLists.txt +++ b/src/plugins/mesonprojectmanager/CMakeLists.txt @@ -23,8 +23,6 @@ add_qtc_plugin(MesonProjectManager mesoninfoparser.h mesonoutputparser.cpp mesonoutputparser.h - mesonprocess.cpp - mesonprocess.h mesonproject.cpp mesonproject.h mesonprojectimporter.cpp diff --git a/src/plugins/mesonprojectmanager/mesonprocess.cpp b/src/plugins/mesonprojectmanager/mesonprocess.cpp deleted file mode 100644 index 2e4ba024559..00000000000 --- a/src/plugins/mesonprojectmanager/mesonprocess.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (C) 2020 Alexis Jeandet. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "mesonprocess.h" - -#include "mesonprojectmanagertr.h" -#include "toolwrapper.h" - -#include <coreplugin/messagemanager.h> -#include <coreplugin/progressmanager/processprogress.h> - -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/taskhub.h> - -#include <utils/environment.h> -#include <utils/process.h> -#include <utils/stringutils.h> - -#include <QLoggingCategory> - -using namespace Core; -using namespace Utils; - -namespace MesonProjectManager { -namespace Internal { - -static Q_LOGGING_CATEGORY(mesonProcessLog, "qtc.meson.buildsystem", QtWarningMsg); - -MesonProcess::MesonProcess() = default; -MesonProcess::~MesonProcess() = default; - -bool MesonProcess::run(const Command &command, - const Environment &env, - const QString &projectName, - bool captureStdo) -{ - if (!sanityCheck(command)) - return false; - m_stdo.clear(); - ProjectExplorer::TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); - setupProcess(command, env, projectName, captureStdo); - m_elapsed.start(); - m_process->start(); - qCDebug(mesonProcessLog()) << "Starting:" << command.toUserOutput(); - return true; -} - -void MesonProcess::handleProcessDone() -{ - if (m_process->result() != ProcessResult::FinishedWithSuccess) { - ProjectExplorer::TaskHub::addTask(ProjectExplorer::BuildSystemTask{ - ProjectExplorer::Task::TaskType::Error, m_process->exitMessage()}); - } - m_stdo = m_process->readAllRawStandardOutput(); - m_stderr = m_process->readAllRawStandardError(); - const QString elapsedTime = formatElapsedTime(m_elapsed.elapsed()); - MessageManager::writeSilently(elapsedTime); - emit finished(m_process->exitCode(), m_process->exitStatus()); -} - -void MesonProcess::setupProcess(const Command &command, const Environment &env, - const QString &projectName, bool captureStdo) -{ - if (m_process) - m_process.release()->deleteLater(); - m_process.reset(new Process); - connect(m_process.get(), &Process::done, this, &MesonProcess::handleProcessDone); - if (!captureStdo) { - connect(m_process.get(), &Process::readyReadStandardOutput, - this, &MesonProcess::processStandardOutput); - connect(m_process.get(), &Process::readyReadStandardError, - this, &MesonProcess::processStandardError); - } - - m_process->setWorkingDirectory(command.workDir()); - m_process->setEnvironment(env); - MessageManager::writeFlashing(Tr::tr("Running %1 in %2.") - .arg(command.toUserOutput(), command.workDir().toUserOutput())); - m_process->setCommand(command.cmdLine()); - m_process->setTimeoutS(10); - ProcessProgress *progress = new ProcessProgress(m_process.get()); - progress->setDisplayName(Tr::tr("Configuring \"%1\".").arg(projectName)); -} - -bool MesonProcess::sanityCheck(const Command &command) const -{ - const auto &exe = command.cmdLine().executable(); - if (!exe.exists()) { - //Should only reach this point if Meson exe is removed while a Meson project is opened - ProjectExplorer::TaskHub::addTask( - ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::TaskType::Error, - Tr::tr("Executable does not exist: %1") - .arg(exe.toUserOutput())}); - return false; - } - if (!exe.toFileInfo().isExecutable()) { - ProjectExplorer::TaskHub::addTask( - ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::TaskType::Error, - Tr::tr("Command is not executable: %1") - .arg(exe.toUserOutput())}); - return false; - } - return true; -} - -void MesonProcess::processStandardOutput() -{ - const auto data = m_process->readAllRawStandardOutput(); - MessageManager::writeSilently(QString::fromLocal8Bit(data)); - emit readyReadStandardOutput(data); -} - -void MesonProcess::processStandardError() -{ - MessageManager::writeSilently(QString::fromLocal8Bit(m_process->readAllRawStandardError())); -} - -} // namespace Internal -} // namespace MesonProjectManager diff --git a/src/plugins/mesonprojectmanager/mesonprocess.h b/src/plugins/mesonprojectmanager/mesonprocess.h deleted file mode 100644 index c01427c8fb9..00000000000 --- a/src/plugins/mesonprojectmanager/mesonprocess.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) 2020 Alexis Jeandet. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <QByteArray> -#include <QElapsedTimer> -#include <QObject> -#include <QProcess> - -#include <memory> - -namespace Utils { -class Environment; -class Process; -} - -namespace MesonProjectManager { -namespace Internal { - -class Command; - -class MesonProcess final : public QObject -{ - Q_OBJECT -public: - MesonProcess(); - ~MesonProcess(); - bool run(const Command &command, const Utils::Environment &env, - const QString &projectName, bool captureStdo = false); - - const QByteArray &stdOut() const { return m_stdo; } - const QByteArray &stdErr() const { return m_stderr; } -signals: - void finished(int exitCode, QProcess::ExitStatus exitStatus); - void readyReadStandardOutput(const QByteArray &data); - -private: - void handleProcessDone(); - void setupProcess(const Command &command, const Utils::Environment &env, - const QString &projectName, bool captureStdo); - bool sanityCheck(const Command &command) const; - - void processStandardOutput(); - void processStandardError(); - - std::unique_ptr<Utils::Process> m_process; - QElapsedTimer m_elapsed; - QByteArray m_stdo; - QByteArray m_stderr; -}; - -} // namespace Internal -} // namespace MesonProjectManager diff --git a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs index 9167f025b20..df1c076eb60 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs +++ b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs @@ -49,8 +49,6 @@ Project { "mesonbuildconfiguration.h", "mesonbuildsystem.cpp", "mesonbuildsystem.h", - "mesonprocess.cpp", - "mesonprocess.h", "mesonproject.cpp", "mesonproject.h", "mesonprojectimporter.cpp", diff --git a/src/plugins/mesonprojectmanager/mesonprojectparser.cpp b/src/plugins/mesonprojectmanager/mesonprojectparser.cpp index 9de424bf282..a4ac7a13252 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectparser.cpp +++ b/src/plugins/mesonprojectmanager/mesonprojectparser.cpp @@ -4,25 +4,36 @@ #include "mesonprojectparser.h" #include "mesoninfoparser.h" +#include "mesonprojectmanagertr.h" #include "mesonprojectnodes.h" #include "mesontools.h" #include "projecttree.h" +#include <coreplugin/messagemanager.h> #include <coreplugin/messagemanager.h> #include <projectexplorer/projectexplorer.h> +#include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/taskhub.h> #include <utils/async.h> +#include <utils/environment.h> #include <utils/fileinprojectfinder.h> - -#include <QStringList> -#include <QTextStream> +#include <utils/stringutils.h> #include <optional> +#include <coreplugin/progressmanager/processprogress.h> + +using namespace Core; +using namespace ProjectExplorer; +using namespace Utils; + namespace MesonProjectManager { namespace Internal { +static Q_LOGGING_CATEGORY(mesonProcessLog, "qtc.meson.buildsystem", QtWarningMsg); + struct CompilerArgs { QStringList args; @@ -30,8 +41,8 @@ struct CompilerArgs ProjectExplorer::Macros macros; }; -inline std::optional<QString> extractValueIfMatches(const QString &arg, - const QStringList &candidates) +static std::optional<QString> extractValueIfMatches(const QString &arg, + const QStringList &candidates) { for (const auto &flag : candidates) { if (arg.startsWith(flag)) @@ -40,11 +51,12 @@ inline std::optional<QString> extractValueIfMatches(const QString &arg, return std::nullopt; } -inline std::optional<QString> extractInclude(const QString &arg) +static std::optional<QString> extractInclude(const QString &arg) { return extractValueIfMatches(arg, {"-I", "/I", "-isystem", "-imsvc", "/imsvc"}); } -inline std::optional<ProjectExplorer::Macro> extractMacro(const QString &arg) + +static std::optional<ProjectExplorer::Macro> extractMacro(const QString &arg) { auto define = extractValueIfMatches(arg, {"-D", "/D"}); if (define) @@ -93,18 +105,12 @@ MesonProjectParser::MesonProjectParser(const Utils::Id &meson, , m_meson{meson} , m_projectName{project->displayName()} { - connect(&m_process, &MesonProcess::finished, this, &MesonProjectParser::processFinished); - connect(&m_process, - &MesonProcess::readyReadStandardOutput, - &m_outputParser, - &MesonOutputParser::readStdo); - // TODO re-think the way all BuildSystem/ProjectParser are tied // I take project info here, I also take build and src dir later from // functions args. auto fileFinder = new Utils::FileInProjectFinder; fileFinder->setProjectDirectory(project->projectDirectory()); - fileFinder->setProjectFiles(project->files(ProjectExplorer::Project::AllFiles)); + fileFinder->setProjectFiles(project->files(Project::AllFiles)); m_outputParser.setFileFinder(fileFinder); } @@ -126,7 +132,7 @@ bool MesonProjectParser::configure(const Utils::FilePath &sourcePath, m_pendingCommands.enqueue( std::make_tuple(MesonTools::mesonWrapper(m_meson)->regenerate(sourcePath, buildPath), false)); - return m_process.run(cmd, m_env, m_projectName); + return run(cmd, m_env, m_projectName); } bool MesonProjectParser::wipe(const Utils::FilePath &sourcePath, @@ -149,7 +155,7 @@ bool MesonProjectParser::setup(const Utils::FilePath &sourcePath, if (forceWipe || isSetup(buildPath)) cmdArgs << "--wipe"; auto cmd = MesonTools::mesonWrapper(m_meson)->setup(sourcePath, buildPath, cmdArgs); - return m_process.run(cmd, m_env, m_projectName); + return run(cmd, m_env, m_projectName); } bool MesonProjectParser::parse(const Utils::FilePath &sourcePath, const Utils::FilePath &buildPath) @@ -170,18 +176,18 @@ bool MesonProjectParser::parse(const Utils::FilePath &sourcePath) m_srcDir = sourcePath; m_introType = IntroDataType::stdo; m_outputParser.setSourceDirectory(sourcePath); - return m_process.run(MesonTools::mesonWrapper(m_meson)->introspect(sourcePath), - m_env, - m_projectName, - true); + return run(MesonTools::mesonWrapper(m_meson)->introspect(sourcePath), + m_env, + m_projectName, + true); } -QList<ProjectExplorer::BuildTargetInfo> MesonProjectParser::appsTargets() const +QList<BuildTargetInfo> MesonProjectParser::appsTargets() const { - QList<ProjectExplorer::BuildTargetInfo> apps; + QList<BuildTargetInfo> apps; for (const Target &target : m_parserResult.targets) { if (target.type == Target::Type::executable) { - ProjectExplorer::BuildTargetInfo bti; + BuildTargetInfo bti; bti.displayName = target.name; bti.buildKey = Target::fullName(m_buildDir, target); bti.displayNameUniquifier = bti.buildKey; @@ -198,8 +204,8 @@ QList<ProjectExplorer::BuildTargetInfo> MesonProjectParser::appsTargets() const bool MesonProjectParser::startParser() { m_parserFutureResult = Utils::asyncRun( - ProjectExplorer::ProjectExplorerPlugin::sharedThreadPool(), - [processOutput = m_process.stdOut(), introType = m_introType, + ProjectExplorerPlugin::sharedThreadPool(), + [processOutput = m_stdo, introType = m_introType, buildDir = m_buildDir, srcDir = m_srcDir] { if (introType == IntroDataType::file) return extractParserResults(srcDir, MesonInfoParser::parse(buildDir)); @@ -245,13 +251,13 @@ void MesonProjectParser::update(const QFuture<MesonProjectParser::ParserData *> emit parsingCompleted(true); } -ProjectExplorer::RawProjectPart MesonProjectParser::buildRawPart( +RawProjectPart MesonProjectParser::buildRawPart( const Target &target, const Target::SourceGroup &sources, - const ProjectExplorer::ToolChain *cxxToolChain, - const ProjectExplorer::ToolChain *cToolChain) + const ToolChain *cxxToolChain, + const ToolChain *cToolChain) { - ProjectExplorer::RawProjectPart part; + RawProjectPart part; part.setDisplayName(target.name); part.setBuildSystemTarget(Target::fullName(m_buildDir, target)); part.setFiles(sources.sources + sources.generatedSources); @@ -275,13 +281,12 @@ void MesonProjectParser::processFinished(int exitCode, QProcess::ExitStatus exit else { // see comment near m_pendingCommands declaration std::tuple<Command, bool> args = m_pendingCommands.dequeue(); - m_process.run(std::get<0>(args), m_env, m_projectName, std::get<1>(args)); + run(std::get<0>(args), m_env, m_projectName, std::get<1>(args)); } } else { if (m_introType == IntroDataType::stdo) { - auto data = m_process.stdErr(); - Core::MessageManager::writeSilently(QString::fromLocal8Bit(data)); - m_outputParser.readStdo(data); + Core::MessageManager::writeSilently(QString::fromLocal8Bit(m_stderr)); + m_outputParser.readStdo(m_stderr); } emit parsingCompleted(false); } @@ -327,5 +332,93 @@ bool MesonProjectParser::usesSameMesonVersion(const Utils::FilePath &buildPath) auto meson = MesonTools::mesonWrapper(m_meson); return info && meson && info->mesonVersion == meson->version(); } + + +bool MesonProjectParser::run(const Command &command, + const Environment &env, + const QString &projectName, + bool captureStdo) +{ + if (!sanityCheck(command)) + return false; + m_stdo.clear(); + ProjectExplorer::TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); + setupProcess(command, env, projectName, captureStdo); + m_elapsed.start(); + m_process->start(); + qCDebug(mesonProcessLog()) << "Starting:" << command.toUserOutput(); + return true; +} + +void MesonProjectParser::handleProcessDone() +{ + if (m_process->result() != ProcessResult::FinishedWithSuccess) { + ProjectExplorer::TaskHub::addTask(ProjectExplorer::BuildSystemTask{ + ProjectExplorer::Task::TaskType::Error, m_process->exitMessage()}); + } + m_stdo = m_process->readAllRawStandardOutput(); + m_stderr = m_process->readAllRawStandardError(); + const QString elapsedTime = formatElapsedTime(m_elapsed.elapsed()); + MessageManager::writeSilently(elapsedTime); + processFinished(m_process->exitCode(), m_process->exitStatus()); +} + +void MesonProjectParser::setupProcess(const Command &command, const Environment &env, + const QString &projectName, bool captureStdo) +{ + if (m_process) + m_process.release()->deleteLater(); + m_process.reset(new Process); + connect(m_process.get(), &Process::done, this, &MesonProjectParser::handleProcessDone); + if (!captureStdo) { + connect(m_process.get(), &Process::readyReadStandardOutput, + this, &MesonProjectParser::processStandardOutput); + connect(m_process.get(), &Process::readyReadStandardError, + this, &MesonProjectParser::processStandardError); + } + + m_process->setWorkingDirectory(command.workDir()); + m_process->setEnvironment(env); + MessageManager::writeFlashing(Tr::tr("Running %1 in %2.") + .arg(command.toUserOutput(), command.workDir().toUserOutput())); + m_process->setCommand(command.cmdLine()); + m_process->setTimeoutS(10); + ProcessProgress *progress = new ProcessProgress(m_process.get()); + progress->setDisplayName(Tr::tr("Configuring \"%1\".").arg(projectName)); +} + +bool MesonProjectParser::sanityCheck(const Command &command) const +{ + const auto &exe = command.cmdLine().executable(); + if (!exe.exists()) { + //Should only reach this point if Meson exe is removed while a Meson project is opened + ProjectExplorer::TaskHub::addTask( + ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::TaskType::Error, + Tr::tr("Executable does not exist: %1") + .arg(exe.toUserOutput())}); + return false; + } + if (!exe.toFileInfo().isExecutable()) { + ProjectExplorer::TaskHub::addTask( + ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::TaskType::Error, + Tr::tr("Command is not executable: %1") + .arg(exe.toUserOutput())}); + return false; + } + return true; +} + +void MesonProjectParser::processStandardOutput() +{ + const auto data = m_process->readAllRawStandardOutput(); + MessageManager::writeSilently(QString::fromLocal8Bit(data)); + m_outputParser.readStdo(data); +} + +void MesonProjectParser::processStandardError() +{ + MessageManager::writeSilently(QString::fromLocal8Bit(m_process->readAllRawStandardError())); +} + } // namespace Internal } // namespace MesonProjectManager diff --git a/src/plugins/mesonprojectmanager/mesonprojectparser.h b/src/plugins/mesonprojectmanager/mesonprojectparser.h index 168b4f1448d..3a129d60af1 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectparser.h +++ b/src/plugins/mesonprojectmanager/mesonprojectparser.h @@ -6,7 +6,6 @@ #include "kitdata.h" #include "mesoninfoparser.h" #include "mesonoutputparser.h" -#include "mesonprocess.h" #include "mesonprojectnodes.h" #include "mesonwrapper.h" @@ -91,7 +90,6 @@ private: const ProjectExplorer::ToolChain *cxxToolChain, const ProjectExplorer::ToolChain *cToolChain); void processFinished(int exitCode, QProcess::ExitStatus exitStatus); - MesonProcess m_process; MesonOutputParser m_outputParser; Utils::Environment m_env; Utils::Id m_meson; @@ -108,6 +106,22 @@ private: // maybe moving meson to build step could make this class simpler // also this should ease command dependencies QQueue<std::tuple<Command, bool>> m_pendingCommands; + + bool run(const Command &command, const Utils::Environment &env, + const QString &projectName, bool captureStdo = false); + + void handleProcessDone(); + void setupProcess(const Command &command, const Utils::Environment &env, + const QString &projectName, bool captureStdo); + bool sanityCheck(const Command &command) const; + + void processStandardOutput(); + void processStandardError(); + + std::unique_ptr<Utils::Process> m_process; + QElapsedTimer m_elapsed; + QByteArray m_stdo; + QByteArray m_stderr; }; } // namespace Internal diff --git a/tests/manual/meson/mesonsampleproject/meson.build b/tests/manual/meson/mesonsampleproject/meson.build index 901285a587e..8edea0d4d53 100644 --- a/tests/manual/meson/mesonsampleproject/meson.build +++ b/tests/manual/meson/mesonsampleproject/meson.build @@ -4,7 +4,7 @@ project('mesonsampleproject', 'cpp',default_options : ['cpp_std=c++11']) qt5 = import('qt5') qt5dep = dependency('qt5', modules : ['Core', 'Widgets']) -translations = qt5.compile_translations(ts_files : 'mesonsampleproject_fr_FR.ts', build_by_default : true) +#translations = qt5.compile_translations(ts_files : 'mesonsampleproject_fr_FR.ts', build_by_default : true) generated_files = qt5.preprocess( moc_headers : 'mesonsampleproject.h', From 7bf1b6e586e8e56a1923419f58672772e575d7a6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 27 Sep 2023 18:31:52 +0200 Subject: [PATCH 1326/1777] Meson: De-noise project parser a bit Change-Id: Ic0b19e5a1e10057f750c2ad13f61c09f1105d05d Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../mesonprojectparser.cpp | 131 +++++++++--------- .../mesonprojectmanager/mesonprojectparser.h | 37 ++--- 2 files changed, 76 insertions(+), 92 deletions(-) diff --git a/src/plugins/mesonprojectmanager/mesonprojectparser.cpp b/src/plugins/mesonprojectmanager/mesonprojectparser.cpp index a4ac7a13252..5fb39a5f845 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectparser.cpp +++ b/src/plugins/mesonprojectmanager/mesonprojectparser.cpp @@ -38,7 +38,7 @@ struct CompilerArgs { QStringList args; QStringList includePaths; - ProjectExplorer::Macros macros; + Macros macros; }; static std::optional<QString> extractValueIfMatches(const QString &arg, @@ -56,18 +56,18 @@ static std::optional<QString> extractInclude(const QString &arg) return extractValueIfMatches(arg, {"-I", "/I", "-isystem", "-imsvc", "/imsvc"}); } -static std::optional<ProjectExplorer::Macro> extractMacro(const QString &arg) +static std::optional<Macro> extractMacro(const QString &arg) { auto define = extractValueIfMatches(arg, {"-D", "/D"}); if (define) - return ProjectExplorer::Macro::fromKeyValue(define->toLatin1()); + return Macro::fromKeyValue(define->toLatin1()); auto undef = extractValueIfMatches(arg, {"-U", "/U"}); if (undef) - return ProjectExplorer::Macro(undef->toLatin1(), ProjectExplorer::MacroType::Undefine); + return Macro(undef->toLatin1(), MacroType::Undefine); return std::nullopt; } -CompilerArgs splitArgs(const QStringList &args) +static CompilerArgs splitArgs(const QStringList &args) { CompilerArgs splited; for (const QString &arg : args) { @@ -86,7 +86,7 @@ CompilerArgs splitArgs(const QStringList &args) return splited; } -QStringList toAbsolutePath(const Utils::FilePath &refPath, QStringList &pathList) +static QStringList toAbsolutePath(const FilePath &refPath, QStringList &pathList) { QStringList allAbs; std::transform(std::cbegin(pathList), @@ -98,9 +98,7 @@ QStringList toAbsolutePath(const Utils::FilePath &refPath, QStringList &pathList return allAbs; } -MesonProjectParser::MesonProjectParser(const Utils::Id &meson, - Utils::Environment env, - ProjectExplorer::Project *project) +MesonProjectParser::MesonProjectParser(const Id &meson, const Environment &env, Project *project) : m_env{env} , m_meson{meson} , m_projectName{project->displayName()} @@ -108,19 +106,14 @@ MesonProjectParser::MesonProjectParser(const Utils::Id &meson, // TODO re-think the way all BuildSystem/ProjectParser are tied // I take project info here, I also take build and src dir later from // functions args. - auto fileFinder = new Utils::FileInProjectFinder; + auto fileFinder = new FileInProjectFinder; fileFinder->setProjectDirectory(project->projectDirectory()); fileFinder->setProjectFiles(project->files(Project::AllFiles)); m_outputParser.setFileFinder(fileFinder); } -void MesonProjectParser::setMesonTool(const Utils::Id &meson) -{ - m_meson = meson; -} - -bool MesonProjectParser::configure(const Utils::FilePath &sourcePath, - const Utils::FilePath &buildPath, +bool MesonProjectParser::configure(const FilePath &sourcePath, + const FilePath &buildPath, const QStringList &args) { m_introType = IntroDataType::file; @@ -135,15 +128,15 @@ bool MesonProjectParser::configure(const Utils::FilePath &sourcePath, return run(cmd, m_env, m_projectName); } -bool MesonProjectParser::wipe(const Utils::FilePath &sourcePath, - const Utils::FilePath &buildPath, +bool MesonProjectParser::wipe(const FilePath &sourcePath, + const FilePath &buildPath, const QStringList &args) { return setup(sourcePath, buildPath, args, true); } -bool MesonProjectParser::setup(const Utils::FilePath &sourcePath, - const Utils::FilePath &buildPath, +bool MesonProjectParser::setup(const FilePath &sourcePath, + const FilePath &buildPath, const QStringList &args, bool forceWipe) { @@ -158,7 +151,7 @@ bool MesonProjectParser::setup(const Utils::FilePath &sourcePath, return run(cmd, m_env, m_projectName); } -bool MesonProjectParser::parse(const Utils::FilePath &sourcePath, const Utils::FilePath &buildPath) +bool MesonProjectParser::parse(const FilePath &sourcePath, const FilePath &buildPath) { m_srcDir = sourcePath; m_buildDir = buildPath; @@ -171,7 +164,7 @@ bool MesonProjectParser::parse(const Utils::FilePath &sourcePath, const Utils::F } } -bool MesonProjectParser::parse(const Utils::FilePath &sourcePath) +bool MesonProjectParser::parse(const FilePath &sourcePath) { m_srcDir = sourcePath; m_introType = IntroDataType::stdo; @@ -191,9 +184,9 @@ QList<BuildTargetInfo> MesonProjectParser::appsTargets() const bti.displayName = target.name; bti.buildKey = Target::fullName(m_buildDir, target); bti.displayNameUniquifier = bti.buildKey; - bti.targetFilePath = Utils::FilePath::fromString(target.fileName.first()); - bti.workingDirectory = Utils::FilePath::fromString(target.fileName.first()).absolutePath(); - bti.projectFilePath = Utils::FilePath::fromString(target.definedIn); + bti.targetFilePath = FilePath::fromString(target.fileName.first()); + bti.workingDirectory = FilePath::fromString(target.fileName.first()).absolutePath(); + bti.projectFilePath = FilePath::fromString(target.definedIn); bti.usesTerminal = true; apps.append(bti); } @@ -218,7 +211,7 @@ bool MesonProjectParser::startParser() } MesonProjectParser::ParserData *MesonProjectParser::extractParserResults( - const Utils::FilePath &srcDir, MesonInfoParser::Result &&parserResult) + const FilePath &srcDir, MesonInfoParser::Result &&parserResult) { auto rootNode = ProjectTree::buildTree(srcDir, parserResult.targets, @@ -226,13 +219,20 @@ MesonProjectParser::ParserData *MesonProjectParser::extractParserResults( return new ParserData{std::move(parserResult), std::move(rootNode)}; } -void MesonProjectParser::addMissingTargets(QStringList &targetList) +static void addMissingTargets(QStringList &targetList) { // Not all targets are listed in introspection data - for (const auto &target : additionalTargets()) { - if (!targetList.contains(target)) { + static const QString additionalTargets[] { + Constants::Targets::all, + Constants::Targets::clean, + Constants::Targets::install, + Constants::Targets::benchmark, + Constants::Targets::scan_build + }; + + for (const QString &target : additionalTargets) { + if (!targetList.contains(target)) targetList.append(target); - } } } @@ -261,7 +261,7 @@ RawProjectPart MesonProjectParser::buildRawPart( part.setDisplayName(target.name); part.setBuildSystemTarget(Target::fullName(m_buildDir, target)); part.setFiles(sources.sources + sources.generatedSources); - auto flags = splitArgs(sources.parameters); + CompilerArgs flags = splitArgs(sources.parameters); part.setMacros(flags.macros); part.setIncludePaths(toAbsolutePath(m_buildDir, flags.includePaths)); part.setProjectFileLocation(target.definedIn); @@ -273,29 +273,10 @@ RawProjectPart MesonProjectParser::buildRawPart( return part; } -void MesonProjectParser::processFinished(int exitCode, QProcess::ExitStatus exitStatus) +RawProjectParts MesonProjectParser::buildProjectParts( + const ToolChain *cxxToolChain, const ToolChain *cToolChain) { - if (exitCode == 0 && exitStatus == QProcess::NormalExit) { - if (m_pendingCommands.isEmpty()) - startParser(); - else { - // see comment near m_pendingCommands declaration - std::tuple<Command, bool> args = m_pendingCommands.dequeue(); - run(std::get<0>(args), m_env, m_projectName, std::get<1>(args)); - } - } else { - if (m_introType == IntroDataType::stdo) { - Core::MessageManager::writeSilently(QString::fromLocal8Bit(m_stderr)); - m_outputParser.readStdo(m_stderr); - } - emit parsingCompleted(false); - } -} - -ProjectExplorer::RawProjectParts MesonProjectParser::buildProjectParts( - const ProjectExplorer::ToolChain *cxxToolChain, const ProjectExplorer::ToolChain *cToolChain) -{ - ProjectExplorer::RawProjectParts parts; + RawProjectParts parts; for_each_source_group(m_parserResult.targets, [&parts, &cxxToolChain, @@ -326,7 +307,7 @@ bool MesonProjectParser::matchesKit(const KitData &kit) return matches; } -bool MesonProjectParser::usesSameMesonVersion(const Utils::FilePath &buildPath) +bool MesonProjectParser::usesSameMesonVersion(const FilePath &buildPath) { auto info = MesonInfoParser::mesonInfo(buildPath); auto meson = MesonTools::mesonWrapper(m_meson); @@ -342,7 +323,7 @@ bool MesonProjectParser::run(const Command &command, if (!sanityCheck(command)) return false; m_stdo.clear(); - ProjectExplorer::TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); + TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); setupProcess(command, env, projectName, captureStdo); m_elapsed.start(); m_process->start(); @@ -352,15 +333,29 @@ bool MesonProjectParser::run(const Command &command, void MesonProjectParser::handleProcessDone() { - if (m_process->result() != ProcessResult::FinishedWithSuccess) { - ProjectExplorer::TaskHub::addTask(ProjectExplorer::BuildSystemTask{ - ProjectExplorer::Task::TaskType::Error, m_process->exitMessage()}); - } + if (m_process->result() != ProcessResult::FinishedWithSuccess) + TaskHub::addTask(BuildSystemTask{Task::TaskType::Error, m_process->exitMessage()}); + m_stdo = m_process->readAllRawStandardOutput(); m_stderr = m_process->readAllRawStandardError(); const QString elapsedTime = formatElapsedTime(m_elapsed.elapsed()); MessageManager::writeSilently(elapsedTime); - processFinished(m_process->exitCode(), m_process->exitStatus()); + + if (m_process->exitCode() == 0 && m_process->exitStatus() == QProcess::NormalExit) { + if (m_pendingCommands.isEmpty()) + startParser(); + else { + // see comment near m_pendingCommands declaration + std::tuple<Command, bool> args = m_pendingCommands.dequeue(); + run(std::get<0>(args), m_env, m_projectName, std::get<1>(args)); + } + } else { + if (m_introType == IntroDataType::stdo) { + MessageManager::writeSilently(QString::fromLocal8Bit(m_stderr)); + m_outputParser.readStdo(m_stderr); + } + emit parsingCompleted(false); + } } void MesonProjectParser::setupProcess(const Command &command, const Environment &env, @@ -392,17 +387,15 @@ bool MesonProjectParser::sanityCheck(const Command &command) const const auto &exe = command.cmdLine().executable(); if (!exe.exists()) { //Should only reach this point if Meson exe is removed while a Meson project is opened - ProjectExplorer::TaskHub::addTask( - ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::TaskType::Error, - Tr::tr("Executable does not exist: %1") - .arg(exe.toUserOutput())}); + TaskHub::addTask( + BuildSystemTask{Task::TaskType::Error, + Tr::tr("Executable does not exist: %1").arg(exe.toUserOutput())}); return false; } if (!exe.toFileInfo().isExecutable()) { - ProjectExplorer::TaskHub::addTask( - ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::TaskType::Error, - Tr::tr("Command is not executable: %1") - .arg(exe.toUserOutput())}); + TaskHub::addTask( + BuildSystemTask{Task::TaskType::Error, + Tr::tr("Command is not executable: %1").arg(exe.toUserOutput())}); return false; } return true; diff --git a/src/plugins/mesonprojectmanager/mesonprojectparser.h b/src/plugins/mesonprojectmanager/mesonprojectparser.h index 3a129d60af1..a027aaa4d03 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectparser.h +++ b/src/plugins/mesonprojectmanager/mesonprojectparser.h @@ -13,9 +13,6 @@ #include <projectexplorer/kit.h> #include <projectexplorer/rawprojectpart.h> -#include <utils/environment.h> -#include <utils/fileutils.h> - #include <QFuture> #include <QQueue> @@ -25,6 +22,7 @@ namespace Internal { class MesonProjectParser : public QObject { Q_OBJECT + enum class IntroDataType { file, stdo }; struct ParserData { @@ -33,8 +31,10 @@ class MesonProjectParser : public QObject }; public: - MesonProjectParser(const Utils::Id &meson, Utils::Environment env, ProjectExplorer::Project* project); - void setMesonTool(const Utils::Id &meson); + MesonProjectParser(const Utils::Id &meson, + const Utils::Environment &env, + ProjectExplorer::Project *project); + bool configure(const Utils::FilePath &sourcePath, const Utils::FilePath &buildPath, const QStringList &args); @@ -48,22 +48,11 @@ public: bool parse(const Utils::FilePath &sourcePath, const Utils::FilePath &buildPath); bool parse(const Utils::FilePath &sourcePath); - Q_SIGNAL void parsingCompleted(bool success); - std::unique_ptr<MesonProjectNode> takeProjectNode() { return std::move(m_rootNode); } - inline const BuildOptionsList &buildOptions() const { return m_parserResult.buildOptions; }; - inline const TargetsList &targets() const { return m_parserResult.targets; } - inline const QStringList &targetsNames() const { return m_targetsNames; } - - static inline QStringList additionalTargets() - { - return QStringList{Constants::Targets::all, - Constants::Targets::clean, - Constants::Targets::install, - Constants::Targets::benchmark, - Constants::Targets::scan_build}; - } + const BuildOptionsList &buildOptions() const { return m_parserResult.buildOptions; }; + const TargetsList &targets() const { return m_parserResult.targets; } + const QStringList &targetsNames() const { return m_targetsNames; } QList<ProjectExplorer::BuildTargetInfo> appsTargets() const; @@ -71,25 +60,27 @@ public: const ProjectExplorer::ToolChain *cxxToolChain, const ProjectExplorer::ToolChain *cToolChain); - inline void setEnvironment(const Utils::Environment &environment) { m_env = environment; } + void setEnvironment(const Utils::Environment &environment) { m_env = environment; } - inline void setQtVersion(Utils::QtMajorVersion v) { m_qtVersion = v; } + void setQtVersion(Utils::QtMajorVersion v) { m_qtVersion = v; } bool matchesKit(const KitData &kit); bool usesSameMesonVersion(const Utils::FilePath &buildPath); +signals: + void parsingCompleted(bool success); + private: bool startParser(); static ParserData *extractParserResults(const Utils::FilePath &srcDir, MesonInfoParser::Result &&parserResult); - static void addMissingTargets(QStringList &targetList); void update(const QFuture<ParserData *> &data); ProjectExplorer::RawProjectPart buildRawPart(const Target &target, const Target::SourceGroup &sources, const ProjectExplorer::ToolChain *cxxToolChain, const ProjectExplorer::ToolChain *cToolChain); - void processFinished(int exitCode, QProcess::ExitStatus exitStatus); + MesonOutputParser m_outputParser; Utils::Environment m_env; Utils::Id m_meson; From 071416fde32fc52cd089327b1c95e918fba112af Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 28 Sep 2023 07:56:57 +0200 Subject: [PATCH 1327/1777] Meson: Move some code out of visible plugin setup Background for the activity here is that this plugin's setup activities take on my machine around 0.2s on Creator during Creator startup and I'd like to reduce that a bit. Change-Id: I880a0b5ce5c4dce52a041b6a3ef9dc3cef346adb Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../mesonprojectplugin.cpp | 25 +------------------ .../toolssettingsaccessor.cpp | 19 +++++++++----- .../toolssettingsaccessor.h | 5 ++-- 3 files changed, 17 insertions(+), 32 deletions(-) diff --git a/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp b/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp index cc1e3eb1e27..71ef57462b2 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp +++ b/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp @@ -12,36 +12,20 @@ #include "toolssettingsaccessor.h" #include "toolssettingspage.h" -#include <coreplugin/icore.h> - #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/runcontrol.h> #include <utils/fsengine/fileiconprovider.h> -using namespace Core; using namespace ProjectExplorer; using namespace Utils; namespace MesonProjectManager::Internal { -class MesonProjectPluginPrivate : public QObject +class MesonProjectPluginPrivate { - Q_OBJECT public: - MesonProjectPluginPrivate() - { - MesonTools::setTools(m_toolsSettings.loadMesonTools(ICore::dialogParent())); - connect(ICore::instance(), - &ICore::saveSettingsRequested, - this, - &MesonProjectPluginPrivate::saveAll); - } - - ~MesonProjectPluginPrivate() {} - -private: ToolsSettingsPage m_toolslSettingsPage; ToolsSettingsAccessor m_toolsSettings; MesonBuildStepFactory m_buildStepFactory; @@ -50,11 +34,6 @@ private: MesonActionsManager m_actions; MachineFileManager m_machineFilesManager; SimpleTargetRunnerFactory m_mesonRunWorkerFactory{{m_runConfigurationFactory.runConfigurationId()}}; - - void saveAll() - { - m_toolsSettings.saveMesonTools(MesonTools::tools(), ICore::dialogParent()); - } }; MesonProjectPlugin::~MesonProjectPlugin() @@ -72,5 +51,3 @@ void MesonProjectPlugin::initialize() } } // MesonProjectManager::Internal - -#include "mesonprojectplugin.moc" diff --git a/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp b/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp index 3f5cdfa45a7..80e5274c481 100644 --- a/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp +++ b/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp @@ -6,6 +6,7 @@ #include "mesonpluginconstants.h" #include "mesonprojectmanagertr.h" +#include <coreplugin/icore.h> #include <coreplugin/icore.h> #include <utils/filepath.h> @@ -16,6 +17,7 @@ #include <iterator> #include <vector> +using namespace Core; using namespace Utils; namespace MesonProjectManager { @@ -30,11 +32,16 @@ ToolsSettingsAccessor::ToolsSettingsAccessor() { setDocType("QtCreatorMesonTools"); setApplicationDisplayName(QGuiApplication::applicationDisplayName()); - setBaseFilePath(Core::ICore::userResourcePath(Constants::ToolsSettings::FILENAME)); + setBaseFilePath(ICore::userResourcePath(Constants::ToolsSettings::FILENAME)); + + MesonTools::setTools(loadMesonTools()); + + QObject::connect(ICore::instance(), &ICore::saveSettingsRequested, [this] { + saveMesonTools(MesonTools::tools()); + }); } -void ToolsSettingsAccessor::saveMesonTools(const std::vector<MesonTools::Tool_t> &tools, - QWidget *parent) +void ToolsSettingsAccessor::saveMesonTools(const std::vector<MesonTools::Tool_t> &tools) { using namespace Constants; Store data; @@ -51,13 +58,13 @@ void ToolsSettingsAccessor::saveMesonTools(const std::vector<MesonTools::Tool_t> entry_count++; } data.insert(ToolsSettings::ENTRY_COUNT, entry_count); - saveSettings(data, parent); + saveSettings(data, ICore::dialogParent()); } -std::vector<MesonTools::Tool_t> ToolsSettingsAccessor::loadMesonTools(QWidget *parent) +std::vector<MesonTools::Tool_t> ToolsSettingsAccessor::loadMesonTools() { using namespace Constants; - auto data = restoreSettings(parent); + auto data = restoreSettings(ICore::dialogParent()); auto entry_count = data.value(ToolsSettings::ENTRY_COUNT, 0).toInt(); std::vector<MesonTools::Tool_t> result; for (auto toolIndex = 0; toolIndex < entry_count; toolIndex++) { diff --git a/src/plugins/mesonprojectmanager/toolssettingsaccessor.h b/src/plugins/mesonprojectmanager/toolssettingsaccessor.h index 61cc505d3a7..10fce88099d 100644 --- a/src/plugins/mesonprojectmanager/toolssettingsaccessor.h +++ b/src/plugins/mesonprojectmanager/toolssettingsaccessor.h @@ -14,8 +14,9 @@ class ToolsSettingsAccessor final : public Utils::UpgradingSettingsAccessor { public: ToolsSettingsAccessor(); - void saveMesonTools(const std::vector<MesonTools::Tool_t> &tools, QWidget *parent); - std::vector<MesonTools::Tool_t> loadMesonTools(QWidget *parent); + + void saveMesonTools(const std::vector<MesonTools::Tool_t> &tools); + std::vector<MesonTools::Tool_t> loadMesonTools(); }; } // namespace Internal From 4872532ef11b01cbfb16ff4fa87625ef956711c8 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 28 Sep 2023 06:44:54 +0200 Subject: [PATCH 1328/1777] Fix build Change-Id: I2edadc699c7177f3239a686dd01f92e54fa56bf9 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/baremetal/debugserverprovidermanager.cpp | 2 +- src/plugins/debugger/debuggeractions.cpp | 2 +- src/plugins/qtsupport/qtversionmanager.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/baremetal/debugserverprovidermanager.cpp b/src/plugins/baremetal/debugserverprovidermanager.cpp index 7716c200c07..e7afc2ef10d 100644 --- a/src/plugins/baremetal/debugserverprovidermanager.cpp +++ b/src/plugins/baremetal/debugserverprovidermanager.cpp @@ -99,7 +99,7 @@ void DebugServerProviderManager::restoreProviders() for (const Key &key : keys) { const int lastDot = key.view().lastIndexOf('.'); if (lastDot != -1) - map[key.view().mid(lastDot + 1).toByteArray()] = map[key]; + map[key.toByteArray().mid(lastDot + 1)] = map[key]; } bool restored = false; for (IDebugServerProviderFactory *f : std::as_const(m_factories)) { diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 36c25631002..5c313d1be53 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -292,7 +292,7 @@ QString DebuggerSettings::dump() if (!key.isEmpty()) { const int pos = key.view().indexOf('/'); if (pos >= 0) - key = key.view().mid(pos).toByteArray(); + key = key.toByteArray().mid(pos); const QString current = aspect->variantValue().toString(); const QString default_ = aspect->defaultVariantValue().toString(); QString setting = stringFromKey(key) + ": " + current + " (default: " + default_ + ')'; diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 941bd763b69..3a4209cee83 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -219,7 +219,7 @@ bool QtVersionManagerImpl::restoreQtVersions() if (!key.view().startsWith(keyPrefix)) continue; bool ok; - int count = key.view().mid(keyPrefix.count()).toInt(&ok); + int count = key.toByteArray().mid(keyPrefix.count()).toInt(&ok); if (!ok || count < 0) continue; @@ -293,7 +293,7 @@ void QtVersionManagerImpl::updateFromInstaller(bool emitSignal) if (!key.view().startsWith(keyPrefix)) continue; bool ok; - int count = key.view().mid(keyPrefix.count()).toInt(&ok); + int count = key.toByteArray().mid(keyPrefix.count()).toInt(&ok); if (!ok || count < 0) continue; From aef5a94c22e40a5127325c92a66b9897c8687f81 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 28 Sep 2023 07:12:12 +0200 Subject: [PATCH 1329/1777] QmlJS: Remove unused functions Amends eb5cdb4293be8c4c878425ea9d45f5c105205bb2. Change-Id: I8d8627b9471547df0334f6035d4a0241a21c1f1f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> --- src/libs/qmljs/qmljscheck.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index 1d81080c7e7..e9faed95abb 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -1364,36 +1364,6 @@ static bool shouldAvoidNonStrictEqualityCheck(const Value *lhs, const Value *rhs return false; } -static bool isIntegerValue(const Value *value) -{ - if (value->asNumberValue() || value->asIntValue()) - return true; - if (auto obj = value->asObjectValue()) - return obj->className() == "Number" || obj->className() == "int"; - - return false; -} - -static bool isStringValue(const Value *value) -{ - if (value->asStringValue()) - return true; - if (auto obj = value->asObjectValue()) - return obj->className() == "QString" || obj->className() == "string" || obj->className() == "String"; - - return false; -} - -static bool isBooleanValue(const Value *value) -{ - if (value->asBooleanValue()) - return true; - if (auto obj = value->asObjectValue()) - return obj->className() == "boolean" || obj->className() == "Boolean"; - - return false; -} - bool Check::visit(BinaryExpression *ast) { const QString source = _doc->source(); From e39c6d4f412607ae8d178d9be7fc4bbe3203b6b9 Mon Sep 17 00:00:00 2001 From: Tim Jenssen <tim.jenssen@qt.io> Date: Wed, 27 Sep 2023 16:58:51 +0200 Subject: [PATCH 1330/1777] McuSupport: fix build with latest QtcSettings adjustments Change-Id: Iea1ff349ef00a8f4255651c0a1baf3656b5153b7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/mcusupport/mcusupportplugin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/mcusupport/mcusupportplugin.cpp b/src/plugins/mcusupport/mcusupportplugin.cpp index a9f8ff0d499..1dd8d455566 100644 --- a/src/plugins/mcusupport/mcusupportplugin.cpp +++ b/src/plugins/mcusupport/mcusupportplugin.cpp @@ -40,6 +40,7 @@ #include <utils/filepath.h> #include <utils/infobar.h> +#include <utils/qtcsettings.h> #include <QAction> #include <QDateTime> @@ -114,6 +115,12 @@ McuSupportPlugin::~McuSupportPlugin() dd = nullptr; } +static bool isQtDesignStudio() +{ + QtcSettings *settings = Core::ICore::settings(); + return settings->value("QML/Designer/StandAloneMode", false).toBool(); +} + void McuSupportPlugin::initialize() { setObjectName("McuSupportPlugin"); From b9e327bb10c7cbe1c3fed403957c7489c6ea04c3 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 8 Sep 2023 13:31:41 +0200 Subject: [PATCH 1331/1777] Python: read installer settings for pyside wheel requirement This should be more stable than relying on a specific folder structure in the Qt Package. Change-Id: I20dea176df43c9f6e768f4db69ac4eb70633f01a Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/python/pyside.cpp | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/plugins/python/pyside.cpp b/src/plugins/python/pyside.cpp index 896620ae32e..bae0c0753af 100644 --- a/src/plugins/python/pyside.cpp +++ b/src/plugins/python/pyside.cpp @@ -86,17 +86,36 @@ void PySideInstaller::installPyside(const FilePath &python, { QMap<QVersionNumber, Utils::FilePath> availablePySides; - const std::optional<FilePath> qtInstallDir - = QtSupport::LinkWithQtSupport::linkedQt().tailRemoved("Tools/sdktool/share/qtcreator"); - if (qtInstallDir) { - const FilePath qtForPythonDir = qtInstallDir->pathAppended("QtForPython"); - for (const FilePath &versionDir : qtForPythonDir.dirEntries(QDir::Dirs | QDir::NoDotAndDotDot)) { - FilePath requirements = versionDir.pathAppended("requirements.txt"); - if (requirements.exists()) - availablePySides[QVersionNumber::fromString(versionDir.fileName())] = requirements; + const Utils::QtcSettings *settings = Core::ICore::settings(QSettings::SystemScope); + + const FilePaths requirementsList + = Utils::transform(settings->value("Python/PySideWheelsRequirements").toList(), + &FilePath::fromSettings); + for (const FilePath &requirements : requirementsList) { + if (requirements.exists()) { + auto version = QVersionNumber::fromString(requirements.parentDir().fileName()); + availablePySides[version] = requirements; } } + if (requirementsList.isEmpty()) { // fallback remove in Qt Creator 13 + const QString hostQtTail = HostOsInfo::isMacHost() + ? QString("Tools/sdktool") + : QString("Tools/sdktool/share/qtcreator"); + + const std::optional<FilePath> qtInstallDir + = QtSupport::LinkWithQtSupport::linkedQt().tailRemoved(hostQtTail); + if (qtInstallDir) { + const FilePath qtForPythonDir = qtInstallDir->pathAppended("QtForPython"); + for (const FilePath &versionDir : + qtForPythonDir.dirEntries(QDir::Dirs | QDir::NoDotAndDotDot)) { + FilePath requirements = versionDir.pathAppended("requirements.txt"); + if (!requirementsList.contains(requirements) && requirements.exists()) + availablePySides[QVersionNumber::fromString(versionDir.fileName())] + = requirements; + } + } + } auto install = new PipInstallTask(python); connect(install, &PipInstallTask::finished, install, &QObject::deleteLater); From 51a406900c7b8e5a50e29dc13894fb3d71b5ed70 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 8 Sep 2023 09:48:26 +0200 Subject: [PATCH 1332/1777] Python: fix installing PySide wheels on Mac Change-Id: I3f9f9ee5580176a65ca8e6b5c62b793fed170462 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/python/pyside.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/python/pyside.cpp b/src/plugins/python/pyside.cpp index 896620ae32e..3451b2b9782 100644 --- a/src/plugins/python/pyside.cpp +++ b/src/plugins/python/pyside.cpp @@ -86,8 +86,11 @@ void PySideInstaller::installPyside(const FilePath &python, { QMap<QVersionNumber, Utils::FilePath> availablePySides; + const QString hostQtTail = HostOsInfo::isMacHost() ? QString("Tools/sdktool") + : QString("Tools/sdktool/share/qtcreator"); + const std::optional<FilePath> qtInstallDir - = QtSupport::LinkWithQtSupport::linkedQt().tailRemoved("Tools/sdktool/share/qtcreator"); + = QtSupport::LinkWithQtSupport::linkedQt().tailRemoved(hostQtTail); if (qtInstallDir) { const FilePath qtForPythonDir = qtInstallDir->pathAppended("QtForPython"); for (const FilePath &versionDir : qtForPythonDir.dirEntries(QDir::Dirs | QDir::NoDotAndDotDot)) { From 7033bbf7e0542b6ab7616859b048e458e19396b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= <tor.arne.vestbo@qt.io> Date: Fri, 22 Sep 2023 22:18:48 +0200 Subject: [PATCH 1333/1777] lldb: Set environment variable to detect when running lldb from Creator Instead of relying on __name__ being 'lldbbridge', which can also be the case if the lldbbridge.py script is imported into a plain LLDB process, we can now look at the environment variable. This also lets us break out early from __lldb_init_module if the user has a `command script import llbdbridge.py` in their .lldbinit, or is automatically loading the bridge via the Qt Core debug script. Change-Id: Id8168c692ef66ce50119b7426ca85c7bc99d9503 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- share/qtcreator/debugger/lldbbridge.py | 17 ++++++++++------- src/plugins/debugger/lldb/lldbengine.cpp | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index df1f57dc1c4..a421f829330 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -2068,6 +2068,13 @@ class Tester(Dumper): lldb.SBDebugger.Destroy(self.debugger) +if 'QT_CREATOR_LLDB_PROCESS' in os.environ: + # Initialize Qt Creator dumper + try: + theDumper = Dumper() + except Exception as error: + print('@\nstate="enginesetupfailed",error="{}"@\n'.format(error)) + # ------------------------------ For use in LLDB ------------------------------ @@ -2437,6 +2444,9 @@ class SyntheticChildrenProvider(SummaryProvider): def __lldb_init_module(debugger, internal_dict): # Module is being imported in an LLDB session + if 'QT_CREATOR_LLDB_PROCESS' in os.environ: + # Let Qt Creator take care of its own dumper + return if not __name__ == 'qt': # Make available under global 'qt' name for consistency, @@ -2471,10 +2481,3 @@ def __lldb_init_module(debugger, internal_dict): % ("qt.SyntheticChildrenProvider", type_category)) debugger.HandleCommand('type category enable %s' % type_category) - - -if __name__ == "lldbbridge": - try: - theDumper = Dumper() - except Exception as error: - print('@\nstate="enginesetupfailed",error="{}"@\n'.format(error)) diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 2d90f1e76c9..9d1717fff54 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -179,6 +179,7 @@ void LldbEngine::setupEngine() showMessage("STARTING LLDB: " + lldbCmd.toUserOutput()); Environment environment = runParameters().debugger.environment; + environment.appendOrSet("QT_CREATOR_LLDB_PROCESS", "1"); environment.appendOrSet("PYTHONUNBUFFERED", "1"); // avoid flushing problem on macOS DebuggerItem::addAndroidLldbPythonEnv(lldbCmd, environment); From 182d4540b3d5d5e28820f821757c724408080889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= <tor.arne.vestbo@qt.io> Date: Fri, 22 Sep 2023 22:28:07 +0200 Subject: [PATCH 1334/1777] lldb: Add summary provider basic debugging facility Change-Id: I166ad0c2e7d4ed508b1f4a8eeaf5e1e2488a3b70 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- share/qtcreator/debugger/lldbbridge.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index a421f829330..8c25b90c380 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -2077,18 +2077,14 @@ if 'QT_CREATOR_LLDB_PROCESS' in os.environ: # ------------------------------ For use in LLDB ------------------------------ +debug = print if 'QT_LLDB_SUMMARY_PROVIDER_DEBUG' in os.environ \ + else lambda *a, **k: None -from pprint import pprint - -__module__ = sys.modules[__name__] -DEBUG = False if not hasattr(__module__, 'DEBUG') else DEBUG - +debug(f"Loading lldbbridge.py from {__file__}") class LogMixin(): @staticmethod def log(message='', log_caller=False, frame=1, args=''): - if not DEBUG: - return if log_caller: message = ": " + message if len(message) else '' # FIXME: Compute based on first frame not in this class? @@ -2097,7 +2093,7 @@ class LogMixin(): localz = frame.f_locals instance = str(localz["self"]) + "." if 'self' in localz else '' message = "%s%s(%s)%s" % (instance, fn, args, message) - print(message) + debug(message) @staticmethod def log_fn(arg_str=''): @@ -2448,6 +2444,8 @@ def __lldb_init_module(debugger, internal_dict): # Let Qt Creator take care of its own dumper return + debug("Initializing module with", debugger) + if not __name__ == 'qt': # Make available under global 'qt' name for consistency, # and so we can refer to SyntheticChildrenProvider below. From 1723af02068a28ca85e49758f8dacc4c2860c5d0 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 25 Sep 2023 15:33:14 +0200 Subject: [PATCH 1335/1777] ClangCodeModel: Enable clangd hidden features when server logging is on Potentially useful for debugging. Change-Id: Iada7f2809d0f42bd5445ac6f9a8161a03ffd9bb5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/clangcodemodel/clangdclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index c2529a94e1a..5631f9fbc3c 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -215,7 +215,7 @@ static BaseClientInterface *clientInterface(Project *project, const Utils::FileP if (!jsonDbDir.isEmpty()) cmd.addArg("--compile-commands-dir=" + clangdExePath.withNewMappedPath(jsonDbDir).path()); if (clangdLogServer().isDebugEnabled()) - cmd.addArgs({"--log=verbose", "--pretty"}); + cmd.addArgs({"--log=verbose", "--pretty", "--hidden-features=1"}); cmd.addArg("--use-dirty-headers"); const auto interface = new StdIOClientInterface; interface->setCommandLine(cmd); From fe24faa12b92c75e819d8b20e4c5699a10dd14ea Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 28 Sep 2023 11:59:05 +0200 Subject: [PATCH 1336/1777] Fix issues found by coverity Change-Id: I1eba9b800fed419bea4169ec6d6042c2f99b505d Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/utils/aspects.cpp | 10 +++++----- src/plugins/compilerexplorer/compilerexplorereditor.h | 4 ---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 13e8d0df49f..27628402423 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -595,7 +595,7 @@ void BaseAspect::registerSubWidget(QWidget *widget) void BaseAspect::forEachSubWidget(const std::function<void(QWidget *)> &func) { - for (auto w : d->m_subWidgets) + for (const QPointer<QWidget> &w : d->m_subWidgets) func(w); } @@ -3074,7 +3074,7 @@ QVariantList AspectList::toList(bool v) const QVariantList list; const auto &items = v ? d->volatileItems : d->items; - for (const auto &item : items) { + for (const std::shared_ptr<BaseAspect> &item : items) { Utils::Store childStore; if (v) item->volatileToMap(childStore); @@ -3157,12 +3157,12 @@ void AspectList::clear() if (undoStack()) { undoStack()->beginMacro("Clear"); - for (auto item : volatileItems()) + for (const std::shared_ptr<BaseAspect> &item : volatileItems()) undoStack()->push(new RemoveItemCommand(this, item)); undoStack()->endMacro(); } else { - for (auto item : volatileItems()) + for (const std::shared_ptr<BaseAspect> &item : volatileItems()) actualRemoveItem(item); } } @@ -3198,7 +3198,7 @@ bool AspectList::isDirty() if (d->items != d->volatileItems) return true; - for (const auto &item : d->volatileItems) { + for (const std::shared_ptr<BaseAspect> &item : d->volatileItems) { if (item->isDirty()) return true; } diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.h b/src/plugins/compilerexplorer/compilerexplorereditor.h index c2dcfdaebe4..c404ea40552 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.h +++ b/src/plugins/compilerexplorer/compilerexplorereditor.h @@ -207,14 +207,10 @@ protected: QVariantMap windowStateCallback(); private: - QSplitter *m_mainSplitter; - int m_compilerCount{0}; QSharedPointer<JsonSettingsDocument> m_document; QUndoStack *m_undoStack; TextEditor::TextEditorActionHandler &m_actionHandler; - Core::IContext *m_context; - QList<QDockWidget *> m_compilerWidgets; QList<QDockWidget *> m_sourceWidgets; }; From 14e2294fb2c63c60f6f1c18f45310e731bec6716 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 27 Sep 2023 08:34:59 +0200 Subject: [PATCH 1337/1777] Utils: Allow hiding Dock close / float buttons Change-Id: I18e17ebe4fa049699a731c00448cd615ad9c6c19 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/utils/fancymainwindow.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/fancymainwindow.cpp b/src/libs/utils/fancymainwindow.cpp index 5f2aad9a949..ad5e4ed9c3a 100644 --- a/src/libs/utils/fancymainwindow.cpp +++ b/src/libs/utils/fancymainwindow.cpp @@ -169,6 +169,11 @@ public: setLayout(layout); setProperty("managed_titlebar", 1); + + connect(parent, &QDockWidget::featuresChanged, this, [this, parent] { + m_closeButton->setVisible(parent->features().testFlag(QDockWidget::DockWidgetClosable)); + m_floatButton->setVisible(parent->features().testFlag(QDockWidget::DockWidgetFloatable)); + }); } void enterEvent(QEnterEvent *event) override @@ -187,8 +192,11 @@ public: { bool clickable = isClickable(); m_titleLabel->setVisible(clickable); - m_floatButton->setVisible(clickable); - m_closeButton->setVisible(clickable); + + m_floatButton->setVisible(clickable + && q->features().testFlag(QDockWidget::DockWidgetFloatable)); + m_closeButton->setVisible(clickable + && q->features().testFlag(QDockWidget::DockWidgetClosable)); } bool isClickable() const @@ -349,7 +357,8 @@ FancyMainWindowPrivate::FancyMainWindowPrivate(FancyMainWindow *parent) : }); QObject::connect(&m_showCentralWidget, &QAction::toggled, q, [this](bool visible) { - q->centralWidget()->setVisible(visible); + if (q->centralWidget()) + q->centralWidget()->setVisible(visible); }); } From 72bcaeaab4641cbd70d84a12308e1db7d2e2f199 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 28 Sep 2023 12:23:09 +0200 Subject: [PATCH 1338/1777] CompilerExplorer: Add missing variable Wrongly removed in previous patch Change-Id: Idaa3a2010bdf90c0c2d303a61ecf0e741faae98d Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/compilerexplorer/compilerexplorereditor.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.h b/src/plugins/compilerexplorer/compilerexplorereditor.h index c404ea40552..061f735b02c 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.h +++ b/src/plugins/compilerexplorer/compilerexplorereditor.h @@ -207,6 +207,8 @@ protected: QVariantMap windowStateCallback(); private: + Core::IContext *m_context; + QSharedPointer<JsonSettingsDocument> m_document; QUndoStack *m_undoStack; TextEditor::TextEditorActionHandler &m_actionHandler; From d915e22adbc5ff756c4ede8cdaa41742475d6469 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 27 Sep 2023 17:55:43 +0200 Subject: [PATCH 1339/1777] CMakePM: Add imported targets to code completion / navigation This allows e.g. Qt6::Core to be specified as argument for target_link_libraries and navigation via F2. Also fixes a bug introduced with 695952f84bef0d88744b27965ec3c9522014012e which removed the project specific features due to project being nullptr. Change-Id: I5efa28c498d337e6bab564533a5445e6c364b26b Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 58 ++++++++++++++----- .../cmakeprojectmanager/cmakebuildsystem.h | 2 + .../cmakefilecompletionassist.cpp | 35 ++++++----- 3 files changed, 69 insertions(+), 26 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index ecfbd3769aa..a79ca304ee6 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1261,26 +1261,58 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() m_projectKeywords.functions.clear(); m_projectKeywords.variables.clear(); - for (const auto &cmakeFile : std::as_const(m_cmakeFiles)) { - for (const auto &func : cmakeFile.cmakeListFile.Functions) { - if (func.LowerCaseName() != "function" && func.LowerCaseName() != "macro" - && func.LowerCaseName() != "option") - continue; + auto handleFunctionMacroOption = [&](const CMakeFileInfo &cmakeFile, + const cmListFileFunction &func) { + if (func.LowerCaseName() != "function" && func.LowerCaseName() != "macro" + && func.LowerCaseName() != "option") + return; - if (func.Arguments().size() == 0) - continue; - auto arg = func.Arguments()[0]; + if (func.Arguments().size() == 0) + return; + auto arg = func.Arguments()[0]; + Utils::Link link; + link.targetFilePath = cmakeFile.path; + link.targetLine = arg.Line; + link.targetColumn = arg.Column - 1; + m_cmakeSymbolsHash.insert(QString::fromUtf8(arg.Value), link); + + if (func.LowerCaseName() == "option") + m_projectKeywords.variables[QString::fromUtf8(arg.Value)] = FilePath(); + else + m_projectKeywords.functions[QString::fromUtf8(arg.Value)] = FilePath(); + }; + + m_projectImportedTargets.clear(); + auto handleImportedTargets = [&](const CMakeFileInfo &cmakeFile, + const cmListFileFunction &func) { + if (func.LowerCaseName() != "add_library") + return; + + if (func.Arguments().size() == 0) + return; + auto arg = func.Arguments()[0]; + const QString targetName = QString::fromUtf8(arg.Value); + + const bool haveImported = Utils::contains(func.Arguments(), [](const auto &arg) { + return arg.Value == "IMPORTED"; + }); + if (haveImported && !targetName.contains("${")) { + m_projectImportedTargets << targetName; + + // Allow navigation to the imported target Utils::Link link; link.targetFilePath = cmakeFile.path; link.targetLine = arg.Line; link.targetColumn = arg.Column - 1; - m_cmakeSymbolsHash.insert(QString::fromUtf8(arg.Value), link); + m_cmakeSymbolsHash.insert(targetName, link); + } + }; - if (func.LowerCaseName() == "option") - m_projectKeywords.variables[QString::fromUtf8(arg.Value)] = FilePath(); - else - m_projectKeywords.functions[QString::fromUtf8(arg.Value)] = FilePath(); + for (const auto &cmakeFile : std::as_const(m_cmakeFiles)) { + for (const auto &func : cmakeFile.cmakeListFile.Functions) { + handleFunctionMacroOption(cmakeFile, func); + handleImportedTargets(cmakeFile, func); } } } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h index cc27c599db5..a8f2a66308b 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h @@ -121,6 +121,7 @@ public: const QHash<QString, Utils::Link> &cmakeSymbolsHash() const { return m_cmakeSymbolsHash; } CMakeKeywords projectKeywords() const { return m_projectKeywords; } + QStringList projectImportedTargets() const { return m_projectImportedTargets; } signals: void configurationCleared(); @@ -227,6 +228,7 @@ private: QSet<CMakeFileInfo> m_cmakeFiles; QHash<QString, Utils::Link> m_cmakeSymbolsHash; CMakeKeywords m_projectKeywords; + QStringList m_projectImportedTargets; QHash<QString, ProjectFileArgumentPosition> m_filesToBeRenamed; diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index dbaf380d250..80bd513fd6d 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -16,6 +16,7 @@ #include <projectexplorer/projectexplorericons.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/projectnodes.h> +#include <projectexplorer/projecttree.h> #include <projectexplorer/target.h> #include <texteditor/codeassist/assistinterface.h> @@ -47,6 +48,7 @@ public: const QIcon m_genexIcon; const QIcon m_moduleIcon; const QIcon m_targetsIcon; + const QIcon m_importedTargetIcon; TextEditor::SnippetAssistCollector m_snippetCollector; }; @@ -61,10 +63,15 @@ CMakeFileCompletionAssist::CMakeFileCompletionAssist() , m_genexIcon(CodeModelIcon::iconForType(CodeModelIcon::Class)) , m_moduleIcon( ProjectExplorer::DirectoryIcon(ProjectExplorer::Constants::FILEOVERLAY_MODULES).icon()) - , m_targetsIcon(ProjectExplorer::Icons::BUILD.icon()) + , m_targetsIcon(ProjectExplorer::Icons::BUILD_SMALL.icon()) + , m_importedTargetIcon(Icon({{":/projectexplorer/images/buildhammerhandle.png", + Theme::IconsCodeModelKeywordColor}, + {":/projectexplorer/images/buildhammerhead.png", + Theme::IconsCodeModelKeywordColor}}, + Icon::MenuTintedStyle) + .icon()) , m_snippetCollector(Constants::CMAKE_SNIPPETS_GROUP_ID, FileIconProvider::icon(FilePath::fromString("CMakeLists.txt"))) - {} static bool isInComment(const AssistInterface *interface) @@ -239,7 +246,6 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() { CMakeKeywords keywords; CMakeKeywords projectKeywords; - Project *project = nullptr; const FilePath &filePath = interface()->filePath(); if (!filePath.isEmpty() && filePath.isFile()) { if (auto tool = CMakeToolManager::defaultProjectOrDefaultCMakeTool()) @@ -247,14 +253,13 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() } QStringList buildTargets; - if (project && project->activeTarget()) { - const auto bs = qobject_cast<CMakeBuildSystem *>(project->activeTarget()->buildSystem()); - if (bs) { - for (const auto &target : std::as_const(bs->buildTargets())) - if (target.targetType != TargetType::UtilityType) - buildTargets << target.title; - projectKeywords = bs->projectKeywords(); - } + QStringList importedTargets; + if (auto bs = qobject_cast<CMakeBuildSystem *>(ProjectTree::currentBuildSystem())) { + for (const auto &target : std::as_const(bs->buildTargets())) + if (target.targetType != TargetType::UtilityType) + buildTargets << target.title; + projectKeywords = bs->projectKeywords(); + importedTargets = bs->projectImportedTargets(); } if (isInComment(interface())) @@ -339,9 +344,12 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() if ((functionName.contains("target") || functionName == "install" || functionName == "add_dependencies" || functionName == "set_property" - || functionName == "export" || functionName == "cmake_print_properties") - && !onlyFileItems()) + || functionName == "export" || functionName == "cmake_print_properties" + || functionName == "if" || functionName == "elseif") + && !onlyFileItems()) { items.append(generateList(buildTargets, m_targetsIcon)); + items.append(generateList(importedTargets, m_importedTargetIcon)); + } if (keywords.functionArgs.contains(functionName) && !onlyFileItems()) { QStringList functionSymbols = keywords.functionArgs.value(functionName); @@ -364,6 +372,7 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() items.append(generateList(keywords.properties, m_propertyIcon)); items.append(generateList(buildTargets, m_targetsIcon)); + items.append(generateList(importedTargets, m_importedTargetIcon)); } } From d08f1c6e9415c6aa2e47410c9c8763580e28b046 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 27 Sep 2023 18:47:16 +0200 Subject: [PATCH 1340/1777] CMakePM: Allow navigation to project targets They were available via Ctrl-K and "cmo <target_name>". But they should be working also in the text editor. Change-Id: Iaad72b784485364776b67d6dfdef7ba73dd2df70 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index a79ca304ee6..8d5f9823245 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1309,10 +1309,39 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() } }; + // Handle project targets, unfortunately the CMake file-api doesn't deliver the + // column of the target, just the line. Make sure to find it out + QHash<FilePath, int> projectTargetsSourceAndLine; + for (const auto &target : std::as_const(buildTargets())) { + if (target.targetType == TargetType::UtilityType) + continue; + if (target.backtrace.isEmpty()) + continue; + + projectTargetsSourceAndLine.insert(target.backtrace.last().path, + target.backtrace.last().line); + } + auto handleProjectTargets = [&](const CMakeFileInfo &cmakeFile, const cmListFileFunction &func) { + if (!projectTargetsSourceAndLine.contains(cmakeFile.path) + || projectTargetsSourceAndLine.value(cmakeFile.path) != func.Line()) + return; + + if (func.Arguments().size() == 0) + return; + auto arg = func.Arguments()[0]; + + Utils::Link link; + link.targetFilePath = cmakeFile.path; + link.targetLine = arg.Line; + link.targetColumn = arg.Column - 1; + m_cmakeSymbolsHash.insert(QString::fromUtf8(arg.Value), link); + }; + for (const auto &cmakeFile : std::as_const(m_cmakeFiles)) { for (const auto &func : cmakeFile.cmakeListFile.Functions) { handleFunctionMacroOption(cmakeFile, func); handleImportedTargets(cmakeFile, func); + handleProjectTargets(cmakeFile, func); } } } From 776c8670d7e8124c8b78dc505b85a94d51372e54 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 27 Sep 2023 20:20:46 +0200 Subject: [PATCH 1341/1777] CMakePM: Handle project FindPackage package variables For example find_package(ZLIB QUEIT) will result in the package variables ZLIB_LIBRARY ZLIB_INCLUDE_DIR. The variables are available for both code completion and navigation. Change-Id: I4ea6090f44a980dc91632fcabbda16987b0f0285 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 45 +++++++++++++++++++ .../cmakeprojectmanager/cmakebuildsystem.h | 2 + .../cmakeprojectmanager/cmakeeditor.cpp | 4 ++ .../cmakefilecompletionassist.cpp | 5 +++ 4 files changed, 56 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 8d5f9823245..a055d07149c 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1337,13 +1337,58 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() m_cmakeSymbolsHash.insert(QString::fromUtf8(arg.Value), link); }; + // Gather the exported variables for the Find<Package> CMake packages + m_projectFindPackageVariables.clear(); + + const std::string fphsFunctionName = "find_package_handle_standard_args"; + CMakeKeywords keywords; + if (auto tool = CMakeKitAspect::cmakeTool(target()->kit())) + keywords = tool->keywords(); + QSet<std::string> fphsFunctionArgs; + if (keywords.functionArgs.contains(QString::fromStdString(fphsFunctionName))) { + const QList<std::string> args + = Utils::transform(keywords.functionArgs.value(QString::fromStdString(fphsFunctionName)), + &QString::toStdString); + fphsFunctionArgs = Utils::toSet(args); + } + + auto handleFindPackageVariables = [&](const CMakeFileInfo &cmakeFile, const cmListFileFunction &func) { + if (func.LowerCaseName() != fphsFunctionName) + return; + + if (func.Arguments().size() == 0) + return; + auto firstArgument = func.Arguments()[0]; + const auto filteredArguments = Utils::filtered(func.Arguments(), [&](const auto &arg) { + return !fphsFunctionArgs.contains(arg.Value) && arg != firstArgument; + }); + + for (const auto &arg : filteredArguments) { + const QString value = QString::fromUtf8(arg.Value); + if (value.contains("${") || (value.startsWith('"') && value.endsWith('"')) + || (value.startsWith("'") && value.endsWith("'"))) + continue; + + m_projectFindPackageVariables << value; + + Utils::Link link; + link.targetFilePath = cmakeFile.path; + link.targetLine = arg.Line; + link.targetColumn = arg.Column - 1; + m_cmakeSymbolsHash.insert(value, link); + } + }; + for (const auto &cmakeFile : std::as_const(m_cmakeFiles)) { for (const auto &func : cmakeFile.cmakeListFile.Functions) { handleFunctionMacroOption(cmakeFile, func); handleImportedTargets(cmakeFile, func); handleProjectTargets(cmakeFile, func); + handleFindPackageVariables(cmakeFile, func); } } + + m_projectFindPackageVariables.removeDuplicates(); } void CMakeBuildSystem::ensureBuildDirectory(const BuildDirParameters ¶meters) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h index a8f2a66308b..d29ee777d41 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h @@ -122,6 +122,7 @@ public: const QHash<QString, Utils::Link> &cmakeSymbolsHash() const { return m_cmakeSymbolsHash; } CMakeKeywords projectKeywords() const { return m_projectKeywords; } QStringList projectImportedTargets() const { return m_projectImportedTargets; } + QStringList projectFindPackageVariables() const { return m_projectFindPackageVariables; } signals: void configurationCleared(); @@ -229,6 +230,7 @@ private: QHash<QString, Utils::Link> m_cmakeSymbolsHash; CMakeKeywords m_projectKeywords; QStringList m_projectImportedTargets; + QStringList m_projectFindPackageVariables; QHash<QString, ProjectFileArgumentPosition> m_filesToBeRenamed; diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 86f8823fdee..beed0d2ebe5 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -248,6 +248,10 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, // Check if the symbols is a user defined function or macro const CMakeBuildSystem *cbs = static_cast<const CMakeBuildSystem *>(bs); + // Strip variable coating + if (buffer.startsWith("${") && buffer.endsWith("}")) + buffer = buffer.mid(2, buffer.size() - 3); + if (cbs->cmakeSymbolsHash().contains(buffer)) { link = cbs->cmakeSymbolsHash().value(buffer); addTextStartEndToLink(link); diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 80bd513fd6d..93c00509c0c 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -254,12 +254,14 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() QStringList buildTargets; QStringList importedTargets; + QStringList findPackageVariables; if (auto bs = qobject_cast<CMakeBuildSystem *>(ProjectTree::currentBuildSystem())) { for (const auto &target : std::as_const(bs->buildTargets())) if (target.targetType != TargetType::UtilityType) buildTargets << target.title; projectKeywords = bs->projectKeywords(); importedTargets = bs->projectImportedTargets(); + findPackageVariables = bs->projectFindPackageVariables(); } if (isInComment(interface())) @@ -296,6 +298,7 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() if (varGenexToken == "${") { items.append(generateList(keywords.variables, m_variableIcon)); items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); + items.append(generateList(findPackageVariables, m_projectVariableIcon)); } if (varGenexToken == "$<") items.append(generateList(keywords.generatorExpressions, m_genexIcon)); @@ -311,6 +314,7 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() || functionName == "cmake_print_variables") { items.append(generateList(keywords.variables, m_variableIcon)); items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); + items.append(generateList(findPackageVariables, m_projectVariableIcon)); items.append(generateList(localVariables, m_variableIcon)); } @@ -369,6 +373,7 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() items.append(generateList(keywords.variables, m_variableIcon)); items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); items.append(generateList(localVariables, m_variableIcon)); + items.append(generateList(findPackageVariables, m_projectVariableIcon)); items.append(generateList(keywords.properties, m_propertyIcon)); items.append(generateList(buildTargets, m_targetsIcon)); From 963ff4381d5a3b2edb27c1d538299e23d15d8fa1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 22 Sep 2023 18:05:03 +0200 Subject: [PATCH 1342/1777] Bookmarks: Merge plugin into TextEditor Change-Id: I4c9438f3596daff2c18680a731764bf5010e1e25 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/CMakeLists.txt | 1 - src/plugins/bookmarks/Bookmarks.json.in | 19 -- src/plugins/bookmarks/CMakeLists.txt | 10 - src/plugins/bookmarks/bookmarks.qbs | 25 -- src/plugins/bookmarks/bookmarks_global.h | 26 -- src/plugins/bookmarks/bookmarksplugin.cpp | 223 ------------------ src/plugins/bookmarks/bookmarksplugin.h | 22 -- src/plugins/bookmarks/bookmarkstr.h | 15 -- src/plugins/plugins.qbs | 1 - src/plugins/texteditor/CMakeLists.txt | 3 + src/plugins/texteditor/basefilefind.cpp | 2 +- .../{bookmarks => texteditor}/bookmark.cpp | 12 +- .../{bookmarks => texteditor}/bookmark.h | 6 +- .../bookmarkfilter.cpp | 6 +- .../bookmarkfilter.h | 4 +- .../bookmarkmanager.cpp | 20 +- .../bookmarkmanager.h | 2 +- src/plugins/texteditor/texteditor.qbs | 6 + src/plugins/texteditor/texteditorconstants.h | 3 + src/plugins/texteditor/texteditorplugin.cpp | 202 +++++++++++++++- 20 files changed, 228 insertions(+), 380 deletions(-) delete mode 100644 src/plugins/bookmarks/Bookmarks.json.in delete mode 100644 src/plugins/bookmarks/CMakeLists.txt delete mode 100644 src/plugins/bookmarks/bookmarks.qbs delete mode 100644 src/plugins/bookmarks/bookmarks_global.h delete mode 100644 src/plugins/bookmarks/bookmarksplugin.cpp delete mode 100644 src/plugins/bookmarks/bookmarksplugin.h delete mode 100644 src/plugins/bookmarks/bookmarkstr.h rename src/plugins/{bookmarks => texteditor}/bookmark.cpp (86%) rename src/plugins/{bookmarks => texteditor}/bookmark.h (88%) rename src/plugins/{bookmarks => texteditor}/bookmarkfilter.cpp (98%) rename src/plugins/{bookmarks => texteditor}/bookmarkfilter.h (89%) rename src/plugins/{bookmarks => texteditor}/bookmarkmanager.cpp (98%) rename src/plugins/{bookmarks => texteditor}/bookmarkmanager.h (99%) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 8fd10b68374..d10f434eb10 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -22,7 +22,6 @@ add_subdirectory(silversearcher) # Level 3: (only depends on Level 2 and below) add_subdirectory(axivion) -add_subdirectory(bookmarks) add_subdirectory(cppeditor) add_subdirectory(haskell) add_subdirectory(help) diff --git a/src/plugins/bookmarks/Bookmarks.json.in b/src/plugins/bookmarks/Bookmarks.json.in deleted file mode 100644 index 46a307f517a..00000000000 --- a/src/plugins/bookmarks/Bookmarks.json.in +++ /dev/null @@ -1,19 +0,0 @@ -{ - "Name" : "Bookmarks", - "Version" : "${IDE_VERSION}", - "CompatVersion" : "${IDE_VERSION_COMPAT}", - "Vendor" : "The Qt Company Ltd", - "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", - "License" : [ "Commercial Usage", - "", - "Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.", - "", - "GNU General Public License Usage", - "", - "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." - ], - "Category" : "Core", - "Description" : "Bookmarks in text editors.", - "Url" : "http://www.qt.io", - ${IDE_PLUGIN_DEPENDENCIES} -} diff --git a/src/plugins/bookmarks/CMakeLists.txt b/src/plugins/bookmarks/CMakeLists.txt deleted file mode 100644 index 62a83b5adb1..00000000000 --- a/src/plugins/bookmarks/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_qtc_plugin(Bookmarks - PLUGIN_DEPENDS Core ProjectExplorer TextEditor - SOURCES - bookmark.cpp bookmark.h - bookmarkfilter.cpp bookmarkfilter.h - bookmarkmanager.cpp bookmarkmanager.h - bookmarks_global.h - bookmarkstr.h - bookmarksplugin.cpp bookmarksplugin.h -) diff --git a/src/plugins/bookmarks/bookmarks.qbs b/src/plugins/bookmarks/bookmarks.qbs deleted file mode 100644 index d42fa43cdfd..00000000000 --- a/src/plugins/bookmarks/bookmarks.qbs +++ /dev/null @@ -1,25 +0,0 @@ -import qbs 1.0 - -QtcPlugin { - name: "Bookmarks" - - Depends { name: "Qt.widgets" } - Depends { name: "Utils" } - - Depends { name: "Core" } - Depends { name: "ProjectExplorer" } - Depends { name: "TextEditor" } - - files: [ - "bookmark.cpp", - "bookmark.h", - "bookmarkfilter.cpp", - "bookmarkfilter.h", - "bookmarkmanager.cpp", - "bookmarkmanager.h", - "bookmarks_global.h", "bookmarkstr.h", - "bookmarksplugin.cpp", - "bookmarksplugin.h", - ] -} - diff --git a/src/plugins/bookmarks/bookmarks_global.h b/src/plugins/bookmarks/bookmarks_global.h deleted file mode 100644 index 2b9727d1c6e..00000000000 --- a/src/plugins/bookmarks/bookmarks_global.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -namespace Bookmarks { -namespace Constants { - -const char BOOKMARKS_TOGGLE_ACTION[] = "Bookmarks.Toggle"; -const char BOOKMARKS_EDIT_ACTION[] = "Bookmarks.Edit"; -const char BOOKMARKS_MOVEUP_ACTION[] = "Bookmarks.MoveUp"; -const char BOOKMARKS_MOVEDOWN_ACTION[] = "Bookmarks.MoveDown"; -const char BOOKMARKS_EDITNOTE_ACTION[] = "Bookmarks.EditNote"; -const char BOOKMARKS_PREV_ACTION[] = "Bookmarks.Previous"; -const char BOOKMARKS_NEXT_ACTION[] = "Bookmarks.Next"; -const char BOOKMARKS_PREVDIR_ACTION[] = "Bookmarks.PreviousDirectory"; -const char BOOKMARKS_NEXTDIR_ACTION[] = "Bookmarks.NextDirectory"; -const char BOOKMARKS_PREVDOC_ACTION[] = "Bookmarks.PreviousDocument"; -const char BOOKMARKS_NEXTDOC_ACTION[] = "Bookmarks.NextDocument"; -const char BOOKMARKS_TEXT_MARK_CATEGORY[] = "Bookmarks.TextMarkCategory"; - -const char BOOKMARKS_MENU[] = "Bookmarks.Menu"; -const char BOOKMARKS_CONTEXT[] = "Bookmarks"; - -} // namespace Constants -} // namespace Bookmarks diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp deleted file mode 100644 index fc8f1ba7503..00000000000 --- a/src/plugins/bookmarks/bookmarksplugin.cpp +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "bookmarksplugin.h" - -#include "bookmarkfilter.h" -#include "bookmarkmanager.h" -#include "bookmarks_global.h" -#include "bookmarkstr.h" - -#include <coreplugin/icore.h> -#include <coreplugin/editormanager/ieditor.h> -#include <coreplugin/editormanager/editormanager.h> -#include <coreplugin/coreconstants.h> -#include <coreplugin/actionmanager/actionmanager.h> -#include <coreplugin/actionmanager/actioncontainer.h> -#include <coreplugin/actionmanager/command.h> - -#include <texteditor/texteditor.h> -#include <texteditor/textdocument.h> -#include <texteditor/texteditorconstants.h> - -#include <utils/utilsicons.h> - -#include <QMenu> - -using namespace Core; -using namespace TextEditor; -using namespace Utils; - -using namespace Bookmarks::Constants; - -namespace Bookmarks::Internal { - -class BookmarksPluginPrivate : public QObject -{ -public: - BookmarksPluginPrivate(); - - void updateActions(bool enableToggle, int stateMask); - void editorOpened(Core::IEditor *editor); - void editorAboutToClose(Core::IEditor *editor); - - void requestContextMenu(TextEditor::TextEditorWidget *widget, - int lineNumber, QMenu *menu); - - BookmarkManager m_bookmarkManager; - BookmarkFilter m_bookmarkFilter; - BookmarkViewFactory m_bookmarkViewFactory; - - QAction m_toggleAction{Tr::tr("Toggle Bookmark"), nullptr}; - QAction m_editAction{Tr::tr("Edit Bookmark"), nullptr}; - QAction m_prevAction{Tr::tr("Previous Bookmark"), nullptr}; - QAction m_nextAction{Tr::tr("Next Bookmark"), nullptr}; - QAction m_docPrevAction{Tr::tr("Previous Bookmark in Document"), nullptr}; - QAction m_docNextAction{Tr::tr("Next Bookmark in Document"), nullptr}; - QAction m_editBookmarkAction{Tr::tr("Edit Bookmark"), nullptr}; - QAction m_bookmarkMarginAction{Tr::tr("Toggle Bookmark"), nullptr}; - - int m_marginActionLineNumber = 0; - Utils::FilePath m_marginActionFileName; -}; - -BookmarksPlugin::~BookmarksPlugin() -{ - delete d; -} - -void BookmarksPlugin::initialize() -{ - d = new BookmarksPluginPrivate; -} - -BookmarksPluginPrivate::BookmarksPluginPrivate() - : m_bookmarkFilter(&m_bookmarkManager) - , m_bookmarkViewFactory(&m_bookmarkManager) -{ - ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS); - ActionContainer *touchBar = ActionManager::actionContainer(Core::Constants::TOUCH_BAR); - ActionContainer *mbm = ActionManager::createMenu(Id(BOOKMARKS_MENU)); - mbm->menu()->setTitle(Tr::tr("&Bookmarks")); - mtools->addMenu(mbm); - - const Context editorManagerContext(Core::Constants::C_EDITORMANAGER); - - // Toggle - Command *cmd = ActionManager::registerAction(&m_toggleAction, BOOKMARKS_TOGGLE_ACTION, - editorManagerContext); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+M") : Tr::tr("Ctrl+M"))); - cmd->setTouchBarIcon(Utils::Icons::MACOS_TOUCHBAR_BOOKMARK.icon()); - mbm->addAction(cmd); - touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_EDITOR); - - cmd = ActionManager::registerAction(&m_editAction, BOOKMARKS_EDIT_ACTION, editorManagerContext); - cmd->setDefaultKeySequence( - QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+M") : Tr::tr("Ctrl+Shift+M"))); - mbm->addAction(cmd); - - mbm->addSeparator(); - - // Previous - m_prevAction.setIcon(Utils::Icons::PREV_TOOLBAR.icon()); - m_prevAction.setIconVisibleInMenu(false); - cmd = ActionManager::registerAction(&m_prevAction, BOOKMARKS_PREV_ACTION, editorManagerContext); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+,") - : Tr::tr("Ctrl+,"))); - mbm->addAction(cmd); - - // Next - m_nextAction.setIcon(Utils::Icons::NEXT_TOOLBAR.icon()); - m_nextAction.setIconVisibleInMenu(false); - cmd = ActionManager::registerAction(&m_nextAction, BOOKMARKS_NEXT_ACTION, editorManagerContext); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+.") - : Tr::tr("Ctrl+."))); - mbm->addAction(cmd); - - mbm->addSeparator(); - - // Previous Doc - cmd = ActionManager::registerAction(&m_docPrevAction, BOOKMARKS_PREVDOC_ACTION, - editorManagerContext); - mbm->addAction(cmd); - - // Next Doc - cmd = ActionManager::registerAction(&m_docNextAction, BOOKMARKS_NEXTDOC_ACTION, - editorManagerContext); - mbm->addAction(cmd); - - connect(&m_toggleAction, &QAction::triggered, this, [this] { - IEditor *editor = EditorManager::currentEditor(); - auto widget = TextEditorWidget::fromEditor(editor); - if (widget && editor && !editor->document()->isTemporary()) - m_bookmarkManager.toggleBookmark(editor->document()->filePath(), editor->currentLine()); - }); - - connect(&m_editAction, &QAction::triggered, this, [this] { - IEditor *editor = EditorManager::currentEditor(); - auto widget = TextEditorWidget::fromEditor(editor); - if (widget && editor && !editor->document()->isTemporary()) { - const FilePath filePath = editor->document()->filePath(); - const int line = editor->currentLine(); - if (!m_bookmarkManager.hasBookmarkInPosition(filePath, line)) - m_bookmarkManager.toggleBookmark(filePath, line); - m_bookmarkManager.editByFileAndLine(filePath, line); - } - }); - - connect(&m_prevAction, &QAction::triggered, &m_bookmarkManager, &BookmarkManager::prev); - connect(&m_nextAction, &QAction::triggered, &m_bookmarkManager, &BookmarkManager::next); - connect(&m_docPrevAction, &QAction::triggered, - &m_bookmarkManager, &BookmarkManager::prevInDocument); - connect(&m_docNextAction, &QAction::triggered, - &m_bookmarkManager, &BookmarkManager::nextInDocument); - - connect(&m_editBookmarkAction, &QAction::triggered, this, [this] { - m_bookmarkManager.editByFileAndLine(m_marginActionFileName, m_marginActionLineNumber); - }); - - connect(&m_bookmarkManager, &BookmarkManager::updateActions, - this, &BookmarksPluginPrivate::updateActions); - updateActions(false, m_bookmarkManager.state()); - - connect(&m_bookmarkMarginAction, &QAction::triggered, this, [this] { - m_bookmarkManager.toggleBookmark(m_marginActionFileName, m_marginActionLineNumber); - }); - - // EditorManager - connect(EditorManager::instance(), &EditorManager::editorAboutToClose, - this, &BookmarksPluginPrivate::editorAboutToClose); - connect(EditorManager::instance(), &EditorManager::editorOpened, - this, &BookmarksPluginPrivate::editorOpened); -} - -void BookmarksPluginPrivate::updateActions(bool enableToggle, int state) -{ - const bool hasbm = state >= BookmarkManager::HasBookMarks; - const bool hasdocbm = state == BookmarkManager::HasBookmarksInDocument; - - m_toggleAction.setEnabled(enableToggle); - m_editAction.setEnabled(enableToggle); - m_prevAction.setEnabled(hasbm); - m_nextAction.setEnabled(hasbm); - m_docPrevAction.setEnabled(hasdocbm); - m_docNextAction.setEnabled(hasdocbm); -} - -void BookmarksPluginPrivate::editorOpened(IEditor *editor) -{ - if (auto widget = TextEditorWidget::fromEditor(editor)) { - connect(widget, &TextEditorWidget::markRequested, - this, [this, editor](TextEditorWidget *, int line, TextMarkRequestKind kind) { - if (kind == BookmarkRequest && !editor->document()->isTemporary()) - m_bookmarkManager.toggleBookmark(editor->document()->filePath(), line); - }); - - connect(widget, &TextEditorWidget::markContextMenuRequested, - this, &BookmarksPluginPrivate::requestContextMenu); - } -} - -void BookmarksPluginPrivate::editorAboutToClose(IEditor *editor) -{ - if (auto widget = TextEditorWidget::fromEditor(editor)) { - disconnect(widget, &TextEditorWidget::markContextMenuRequested, - this, &BookmarksPluginPrivate::requestContextMenu); - } -} - -void BookmarksPluginPrivate::requestContextMenu(TextEditorWidget *widget, - int lineNumber, QMenu *menu) -{ - if (widget->textDocument()->isTemporary()) - return; - - m_marginActionLineNumber = lineNumber; - m_marginActionFileName = widget->textDocument()->filePath(); - - menu->addAction(&m_bookmarkMarginAction); - if (m_bookmarkManager.hasBookmarkInPosition(m_marginActionFileName, m_marginActionLineNumber)) - menu->addAction(&m_editBookmarkAction); -} - -} // Bookmarks::Internal diff --git a/src/plugins/bookmarks/bookmarksplugin.h b/src/plugins/bookmarks/bookmarksplugin.h deleted file mode 100644 index 06764043c7b..00000000000 --- a/src/plugins/bookmarks/bookmarksplugin.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <extensionsystem/iplugin.h> - -namespace Bookmarks::Internal { - -class BookmarksPlugin final : public ExtensionSystem::IPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Bookmarks.json") - - ~BookmarksPlugin() final; - - void initialize() final; - - class BookmarksPluginPrivate *d = nullptr; -}; - -} // Bookmarks::Internal diff --git a/src/plugins/bookmarks/bookmarkstr.h b/src/plugins/bookmarks/bookmarkstr.h deleted file mode 100644 index c48879d3470..00000000000 --- a/src/plugins/bookmarks/bookmarkstr.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <QCoreApplication> - -namespace Bookmarks { - -struct Tr -{ - Q_DECLARE_TR_FUNCTIONS(QtC::Bookmarks) -}; - -} // namespace Bookmarks diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs index 0ea388ec705..6adaa25ae7e 100644 --- a/src/plugins/plugins.qbs +++ b/src/plugins/plugins.qbs @@ -12,7 +12,6 @@ Project { "bazaar/bazaar.qbs", "beautifier/beautifier.qbs", "bineditor/bineditor.qbs", - "bookmarks/bookmarks.qbs", "boot2qt/boot2qt.qbs", "clangcodemodel/clangcodemodel.qbs", "clangformat/clangformat.qbs", diff --git a/src/plugins/texteditor/CMakeLists.txt b/src/plugins/texteditor/CMakeLists.txt index 81d562778d5..03efc189224 100644 --- a/src/plugins/texteditor/CMakeLists.txt +++ b/src/plugins/texteditor/CMakeLists.txt @@ -16,6 +16,9 @@ add_qtc_plugin(TextEditor behaviorsettingspage.cpp behaviorsettingspage.h behaviorsettingswidget.cpp behaviorsettingswidget.h blockrange.h + bookmark.cpp bookmark.h + bookmarkfilter.cpp bookmarkfilter.h + bookmarkmanager.cpp bookmarkmanager.h circularclipboard.cpp circularclipboard.h circularclipboardassist.cpp circularclipboardassist.h codeassist/assistenums.h diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 91c0b8e259a..3b9d68d3c37 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -357,7 +357,7 @@ void BaseFileFind::runSearch(SearchResult *search) d->m_futureSynchronizer.addFuture(future); FutureProgress *progress = ProgressManager::addTask(future, Tr::tr("Searching"), - Constants::TASK_SEARCH); + Core::Constants::TASK_SEARCH); connect(search, &SearchResult::countChanged, progress, [progress](int c) { progress->setSubtitle(Tr::tr("%n found.", nullptr, c)); }); diff --git a/src/plugins/bookmarks/bookmark.cpp b/src/plugins/texteditor/bookmark.cpp similarity index 86% rename from src/plugins/bookmarks/bookmark.cpp rename to src/plugins/texteditor/bookmark.cpp index 27c8365e19e..9d13d5a6b23 100644 --- a/src/plugins/bookmarks/bookmark.cpp +++ b/src/plugins/texteditor/bookmark.cpp @@ -4,8 +4,8 @@ #include "bookmark.h" #include "bookmarkmanager.h" -#include "bookmarks_global.h" -#include "bookmarkstr.h" +#include "texteditor_global.h" +#include "texteditortr.h" #include <utils/utilsicons.h> @@ -13,16 +13,18 @@ using namespace Utils; -namespace Bookmarks::Internal { +namespace TextEditor::Internal { + +const char BOOKMARKS_TEXT_MARK_CATEGORY[] = "Bookmarks.TextMarkCategory"; Bookmark::Bookmark(int lineNumber, BookmarkManager *manager) : - TextMark(FilePath(), lineNumber, {Tr::tr("Bookmark"), Constants::BOOKMARKS_TEXT_MARK_CATEGORY}), + TextMark(FilePath(), lineNumber, {Tr::tr("Bookmark"), BOOKMARKS_TEXT_MARK_CATEGORY}), m_manager(manager) { setColor(Theme::Bookmarks_TextMarkColor); setIcon(Icons::BOOKMARK_TEXTEDITOR.icon()); setDefaultToolTip(Tr::tr("Bookmark")); - setPriority(TextEditor::TextMark::NormalPriority); + setPriority(TextMark::NormalPriority); } void Bookmark::removedFromEditor() diff --git a/src/plugins/bookmarks/bookmark.h b/src/plugins/texteditor/bookmark.h similarity index 88% rename from src/plugins/bookmarks/bookmark.h rename to src/plugins/texteditor/bookmark.h index 44277d19c60..1c8c522363e 100644 --- a/src/plugins/bookmarks/bookmark.h +++ b/src/plugins/texteditor/bookmark.h @@ -5,11 +5,11 @@ #include <texteditor/textmark.h> -namespace Bookmarks::Internal { +namespace TextEditor::Internal { class BookmarkManager; -class Bookmark : public TextEditor::TextMark +class Bookmark : public TextMark { public: Bookmark(int lineNumber, BookmarkManager *manager); @@ -34,4 +34,4 @@ private: QString m_lineText; }; -} // Bookmarks::Internal +} // TextEditor::Internal diff --git a/src/plugins/bookmarks/bookmarkfilter.cpp b/src/plugins/texteditor/bookmarkfilter.cpp similarity index 98% rename from src/plugins/bookmarks/bookmarkfilter.cpp rename to src/plugins/texteditor/bookmarkfilter.cpp index 1cedbade481..2756521cd89 100644 --- a/src/plugins/bookmarks/bookmarkfilter.cpp +++ b/src/plugins/texteditor/bookmarkfilter.cpp @@ -5,14 +5,14 @@ #include "bookmark.h" #include "bookmarkmanager.h" -#include "bookmarkstr.h" +#include "texteditortr.h" #include <utils/algorithm.h> using namespace Core; using namespace Utils; -namespace Bookmarks::Internal { +namespace TextEditor::Internal { BookmarkFilter::BookmarkFilter(BookmarkManager *manager) : m_manager(manager) @@ -112,4 +112,4 @@ LocatorFilterEntries BookmarkFilter::match(const QString &input) const return entries; } -} // Bookmarks::Internal +} // TextEditor::Internal diff --git a/src/plugins/bookmarks/bookmarkfilter.h b/src/plugins/texteditor/bookmarkfilter.h similarity index 89% rename from src/plugins/bookmarks/bookmarkfilter.h rename to src/plugins/texteditor/bookmarkfilter.h index f85eff9b7d7..fca42dd679d 100644 --- a/src/plugins/bookmarks/bookmarkfilter.h +++ b/src/plugins/texteditor/bookmarkfilter.h @@ -5,7 +5,7 @@ #include <coreplugin/locator/ilocatorfilter.h> -namespace Bookmarks::Internal { +namespace TextEditor::Internal { class BookmarkManager; @@ -21,4 +21,4 @@ private: BookmarkManager *m_manager = nullptr; // not owned }; -} // Bookmarks::Internal +} // TextEditor::Internal diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/texteditor/bookmarkmanager.cpp similarity index 98% rename from src/plugins/bookmarks/bookmarkmanager.cpp rename to src/plugins/texteditor/bookmarkmanager.cpp index 18a4206afd3..1ab12cfb88d 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/texteditor/bookmarkmanager.cpp @@ -4,8 +4,8 @@ #include "bookmarkmanager.h" #include "bookmark.h" -#include "bookmarks_global.h" -#include "bookmarkstr.h" +#include "texteditorconstants.h" +#include "texteditortr.h" #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/command.h> @@ -14,8 +14,6 @@ #include <coreplugin/idocument.h> #include <coreplugin/session.h> -#include <texteditor/texteditor.h> - #include <utils/algorithm.h> #include <utils/icon.h> #include <utils/qtcassert.h> @@ -35,12 +33,14 @@ #include <QSpinBox> #include <QToolButton> -Q_DECLARE_METATYPE(Bookmarks::Internal::Bookmark*) +Q_DECLARE_METATYPE(TextEditor::Internal::Bookmark*) using namespace Core; using namespace Utils; -namespace Bookmarks::Internal { +namespace TextEditor::Internal { + +const char BOOKMARKS_CONTEXT[] = "Bookmarks"; class BookmarkDelegate : public QStyledItemDelegate { @@ -201,7 +201,7 @@ BookmarkView::BookmarkView(BookmarkManager *manager) : setWindowTitle(Tr::tr("Bookmarks")); m_bookmarkContext->setWidget(this); - m_bookmarkContext->setContext(Context(Constants::BOOKMARKS_CONTEXT)); + m_bookmarkContext->setContext(Context(BOOKMARKS_CONTEXT)); ICore::addContextObject(m_bookmarkContext); @@ -223,8 +223,8 @@ BookmarkView::BookmarkView(BookmarkManager *manager) : QList<QToolButton *> BookmarkView::createToolBarWidgets() { - Command *prevCmd = ActionManager::command(Constants::BOOKMARKS_PREV_ACTION); - Command *nextCmd = ActionManager::command(Constants::BOOKMARKS_NEXT_ACTION); + Command *prevCmd = ActionManager::command(TextEditor::Constants::BOOKMARKS_PREV_ACTION); + Command *nextCmd = ActionManager::command(TextEditor::Constants::BOOKMARKS_NEXT_ACTION); QTC_ASSERT(prevCmd && nextCmd, return {}); auto prevButton = new QToolButton(this); prevButton->setToolButtonStyle(Qt::ToolButtonIconOnly); @@ -827,4 +827,4 @@ NavigationView BookmarkViewFactory::createWidget() return {view, view->createToolBarWidgets()}; } -} // Bookmarks::Internal +} // TextEditor::Internal diff --git a/src/plugins/bookmarks/bookmarkmanager.h b/src/plugins/texteditor/bookmarkmanager.h similarity index 99% rename from src/plugins/bookmarks/bookmarkmanager.h rename to src/plugins/texteditor/bookmarkmanager.h index 0455d316375..4df91094e3d 100644 --- a/src/plugins/bookmarks/bookmarkmanager.h +++ b/src/plugins/texteditor/bookmarkmanager.h @@ -16,7 +16,7 @@ namespace Core { class IContext; } -namespace Bookmarks::Internal { +namespace TextEditor::Internal { class Bookmark; class BookmarksPlugin; diff --git a/src/plugins/texteditor/texteditor.qbs b/src/plugins/texteditor/texteditor.qbs index 76644a13570..a041fbcaa66 100644 --- a/src/plugins/texteditor/texteditor.qbs +++ b/src/plugins/texteditor/texteditor.qbs @@ -31,6 +31,12 @@ QtcPlugin { "behaviorsettingswidget.cpp", "behaviorsettingswidget.h", "blockrange.h", + "bookmark.cpp", + "bookmark.h", + "bookmarkfilter.cpp", + "bookmarkfilter.h", + "bookmarkmanager.cpp", + "bookmarkmanager.h", "circularclipboard.cpp", "circularclipboard.h", "circularclipboardassist.cpp", diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index 9da6b86eb37..03433fd0e8c 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -236,6 +236,9 @@ const char TEXT_SNIPPET_GROUP_ID[] = "Text"; const char GLOBAL_SETTINGS_ID[] = "Global"; const char GENERIC_PROPOSAL_ID[] = "TextEditor.GenericProposalId"; +const char BOOKMARKS_PREV_ACTION[] = "Bookmarks.Previous"; +const char BOOKMARKS_NEXT_ACTION[] = "Bookmarks.Next"; + /** * Delay before tooltip will be shown near completion assistant proposal */ diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index d0df98fb8af..f8de8503937 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -3,7 +3,8 @@ #include "texteditorplugin.h" -#include "commentssettings.h" +#include "bookmarkfilter.h" +#include "bookmarkmanager.h" #include "findincurrentfile.h" #include "findinfiles.h" #include "findinopenfiles.h" @@ -18,7 +19,9 @@ #include "snippets/snippetprovider.h" #include "tabsettings.h" #include "textdocument.h" +#include "textdocument.h" #include "texteditor.h" +#include "texteditorconstants.h" #include "texteditorsettings.h" #include "texteditortr.h" @@ -30,26 +33,28 @@ #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/command.h> +#include <coreplugin/coreconstants.h> #include <coreplugin/diffservice.h> +#include <coreplugin/editormanager/editormanager.h> +#include <coreplugin/editormanager/ieditor.h> #include <coreplugin/externaltoolmanager.h> #include <coreplugin/foldernavigationwidget.h> #include <coreplugin/icore.h> #include <extensionsystem/pluginmanager.h> -#include <projectexplorer/projectpanelfactory.h> - #include <utils/fancylineedit.h> #include <utils/qtcassert.h> #include <utils/macroexpander.h> +#include <utils/utilsicons.h> #include <QMenu> using namespace Core; using namespace Utils; +using namespace TextEditor::Constants; -namespace TextEditor { -namespace Internal { +namespace TextEditor::Internal { const char kCurrentDocumentSelection[] = "CurrentDocument:Selection"; const char kCurrentDocumentRow[] = "CurrentDocument:Row"; @@ -62,13 +67,37 @@ const char kCurrentDocumentWordUnderCursor[] = "CurrentDocument:WordUnderCursor" class TextEditorPluginPrivate : public QObject { public: + TextEditorPluginPrivate(); + + void updateActions(bool enableToggle, int stateMask); + void editorOpened(Core::IEditor *editor); + void editorAboutToClose(Core::IEditor *editor); + + void requestContextMenu(TextEditorWidget *widget, int lineNumber, QMenu *menu); + void extensionsInitialized(); - void updateSearchResultsFont(const TextEditor::FontSettings &); - void updateSearchResultsTabWidth(const TextEditor::TabSettings &tabSettings); + void updateSearchResultsFont(const FontSettings &); + void updateSearchResultsTabWidth(const TabSettings &tabSettings); void updateCurrentSelection(const QString &text); void createStandardContextMenu(); + BookmarkManager m_bookmarkManager; + BookmarkFilter m_bookmarkFilter{&m_bookmarkManager}; + BookmarkViewFactory m_bookmarkViewFactory{&m_bookmarkManager}; + + QAction m_toggleAction{Tr::tr("Toggle Bookmark")}; + QAction m_editAction{Tr::tr("Edit Bookmark")}; + QAction m_prevAction{Tr::tr("Previous Bookmark")}; + QAction m_nextAction{Tr::tr("Next Bookmark")}; + QAction m_docPrevAction{Tr::tr("Previous Bookmark in Document")}; + QAction m_docNextAction{Tr::tr("Next Bookmark in Document")}; + QAction m_editBookmarkAction{Tr::tr("Edit Bookmark")}; + QAction m_bookmarkMarginAction{Tr::tr("Toggle Bookmark")}; + + int m_marginActionLineNumber = 0; + FilePath m_marginActionFileName; + TextEditorSettings settings; LineNumberFilter lineNumberFilter; // Goto line functionality for quick open OutlineFactory outlineFactory; @@ -82,6 +111,154 @@ public: JsonEditorFactory jsonEditorFactory; }; +TextEditorPluginPrivate::TextEditorPluginPrivate() +{ + ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS); + ActionContainer *touchBar = ActionManager::actionContainer(Core::Constants::TOUCH_BAR); + ActionContainer *mbm = ActionManager::createMenu(Id("Bookmarks.Menu")); + + mbm->menu()->setTitle(Tr::tr("&Bookmarks")); + mtools->addMenu(mbm); + + const Context editorManagerContext(Core::Constants::C_EDITORMANAGER); + + // Toggle + Command *cmd = ActionManager::registerAction(&m_toggleAction, "Bookmarks.Toggle", + editorManagerContext); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+M") : Tr::tr("Ctrl+M"))); + cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_BOOKMARK.icon()); + mbm->addAction(cmd); + touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_EDITOR); + + cmd = ActionManager::registerAction(&m_editAction, "Bookmarks.Edit", editorManagerContext); + cmd->setDefaultKeySequence( + QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+M") : Tr::tr("Ctrl+Shift+M"))); + mbm->addAction(cmd); + + mbm->addSeparator(); + + // Previous + m_prevAction.setIcon(Icons::PREV_TOOLBAR.icon()); + m_prevAction.setIconVisibleInMenu(false); + cmd = ActionManager::registerAction(&m_prevAction, BOOKMARKS_PREV_ACTION, editorManagerContext); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+,") + : Tr::tr("Ctrl+,"))); + mbm->addAction(cmd); + + // Next + m_nextAction.setIcon(Icons::NEXT_TOOLBAR.icon()); + m_nextAction.setIconVisibleInMenu(false); + cmd = ActionManager::registerAction(&m_nextAction, BOOKMARKS_NEXT_ACTION, editorManagerContext); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+.") + : Tr::tr("Ctrl+."))); + mbm->addAction(cmd); + + mbm->addSeparator(); + + // Previous Doc + cmd = ActionManager::registerAction(&m_docPrevAction, "Bookmarks.PreviousDocument", + editorManagerContext); + mbm->addAction(cmd); + + // Next Doc + cmd = ActionManager::registerAction(&m_docNextAction, "Bookmarks.NextDocument", + editorManagerContext); + mbm->addAction(cmd); + + connect(&m_toggleAction, &QAction::triggered, this, [this] { + IEditor *editor = EditorManager::currentEditor(); + auto widget = TextEditorWidget::fromEditor(editor); + if (widget && editor && !editor->document()->isTemporary()) + m_bookmarkManager.toggleBookmark(editor->document()->filePath(), editor->currentLine()); + }); + + connect(&m_editAction, &QAction::triggered, this, [this] { + IEditor *editor = EditorManager::currentEditor(); + auto widget = TextEditorWidget::fromEditor(editor); + if (widget && editor && !editor->document()->isTemporary()) { + const FilePath filePath = editor->document()->filePath(); + const int line = editor->currentLine(); + if (!m_bookmarkManager.hasBookmarkInPosition(filePath, line)) + m_bookmarkManager.toggleBookmark(filePath, line); + m_bookmarkManager.editByFileAndLine(filePath, line); + } + }); + + connect(&m_prevAction, &QAction::triggered, &m_bookmarkManager, &BookmarkManager::prev); + connect(&m_nextAction, &QAction::triggered, &m_bookmarkManager, &BookmarkManager::next); + connect(&m_docPrevAction, &QAction::triggered, + &m_bookmarkManager, &BookmarkManager::prevInDocument); + connect(&m_docNextAction, &QAction::triggered, + &m_bookmarkManager, &BookmarkManager::nextInDocument); + + connect(&m_editBookmarkAction, &QAction::triggered, this, [this] { + m_bookmarkManager.editByFileAndLine(m_marginActionFileName, m_marginActionLineNumber); + }); + + connect(&m_bookmarkManager, &BookmarkManager::updateActions, + this, &TextEditorPluginPrivate::updateActions); + updateActions(false, m_bookmarkManager.state()); + + connect(&m_bookmarkMarginAction, &QAction::triggered, this, [this] { + m_bookmarkManager.toggleBookmark(m_marginActionFileName, m_marginActionLineNumber); + }); + + // EditorManager + connect(EditorManager::instance(), &EditorManager::editorAboutToClose, + this, &TextEditorPluginPrivate::editorAboutToClose); + connect(EditorManager::instance(), &EditorManager::editorOpened, + this, &TextEditorPluginPrivate::editorOpened); +} + +void TextEditorPluginPrivate::updateActions(bool enableToggle, int state) +{ + const bool hasbm = state >= BookmarkManager::HasBookMarks; + const bool hasdocbm = state == BookmarkManager::HasBookmarksInDocument; + + m_toggleAction.setEnabled(enableToggle); + m_editAction.setEnabled(enableToggle); + m_prevAction.setEnabled(hasbm); + m_nextAction.setEnabled(hasbm); + m_docPrevAction.setEnabled(hasdocbm); + m_docNextAction.setEnabled(hasdocbm); +} + +void TextEditorPluginPrivate::editorOpened(IEditor *editor) +{ + if (auto widget = TextEditorWidget::fromEditor(editor)) { + connect(widget, &TextEditorWidget::markRequested, + this, [this, editor](TextEditorWidget *, int line, TextMarkRequestKind kind) { + if (kind == BookmarkRequest && !editor->document()->isTemporary()) + m_bookmarkManager.toggleBookmark(editor->document()->filePath(), line); + }); + + connect(widget, &TextEditorWidget::markContextMenuRequested, + this, &TextEditorPluginPrivate::requestContextMenu); + } +} + +void TextEditorPluginPrivate::editorAboutToClose(IEditor *editor) +{ + if (auto widget = TextEditorWidget::fromEditor(editor)) { + disconnect(widget, &TextEditorWidget::markContextMenuRequested, + this, &TextEditorPluginPrivate::requestContextMenu); + } +} + +void TextEditorPluginPrivate::requestContextMenu(TextEditorWidget *widget, + int lineNumber, QMenu *menu) +{ + if (widget->textDocument()->isTemporary()) + return; + + m_marginActionLineNumber = lineNumber; + m_marginActionFileName = widget->textDocument()->filePath(); + + menu->addAction(&m_bookmarkMarginAction); + if (m_bookmarkManager.hasBookmarkInPosition(m_marginActionFileName, m_marginActionLineNumber)) + menu->addAction(&m_editBookmarkAction); +} + static TextEditorPlugin *m_instance = nullptr; TextEditorPlugin::TextEditorPlugin() @@ -117,9 +294,9 @@ void TextEditorPlugin::initialize() editor->editorWidget()->invokeAssist(Completion); }); connect(command, &Command::keySequenceChanged, [command] { - Utils::FancyLineEdit::setCompletionShortcut(command->keySequence()); + FancyLineEdit::setCompletionShortcut(command->keySequence()); }); - Utils::FancyLineEdit::setCompletionShortcut(command->keySequence()); + FancyLineEdit::setCompletionShortcut(command->keySequence()); // Add shortcut for invoking function hint completion QAction *functionHintAction = new QAction(Tr::tr("Display Function Hint"), this); @@ -167,7 +344,7 @@ void TextEditorPluginPrivate::extensionsInitialized() &FolderNavigationWidgetFactory::aboutToShowContextMenu, this, [](QMenu *menu, const FilePath &filePath, bool isDir) { if (!isDir && Core::DiffService::instance()) { - menu->addAction(TextEditor::TextDocument::createDiffAgainstCurrentFileAction( + menu->addAction(TextDocument::createDiffAgainstCurrentFileAction( menu, [filePath] { return filePath; })); } }); @@ -192,7 +369,7 @@ void TextEditorPlugin::extensionsInitialized() { d->extensionsInitialized(); - Utils::MacroExpander *expander = Utils::globalMacroExpander(); + MacroExpander *expander = Utils::globalMacroExpander(); expander->registerVariable(kCurrentDocumentSelection, Tr::tr("Selected text within the current document."), @@ -341,5 +518,4 @@ void TextEditorPluginPrivate::createStandardContextMenu() add(Constants::SWITCH_UTF8BOM, Constants::G_BOM); } -} // namespace Internal -} // namespace TextEditor +} // namespace TextEditor::Internal From 97518b3f6a55585b9845d1395feb35c704f71f7b Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 28 Sep 2023 10:54:28 +0200 Subject: [PATCH 1343/1777] CtfVisualizer: Do not crash on unexpected types again And print a nicer error message. Amends c05f9cacc6be1038a1a9ecee0af07ac84c01738c Task-number: QTCREATORBUG-29659 Change-Id: I1db6bea0bedf1fae034fecbbbeae56bb2fee49ed Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/ctfvisualizer/ctftracemanager.cpp | 93 +++++++++++-------- src/plugins/ctfvisualizer/ctftracemanager.h | 3 + .../ctfvisualizer/ctfvisualizertool.cpp | 4 + 3 files changed, 59 insertions(+), 41 deletions(-) diff --git a/src/plugins/ctfvisualizer/ctftracemanager.cpp b/src/plugins/ctfvisualizer/ctftracemanager.cpp index 29dbed73c28..c9fe7f2b351 100644 --- a/src/plugins/ctfvisualizer/ctftracemanager.cpp +++ b/src/plugins/ctfvisualizer/ctftracemanager.cpp @@ -46,50 +46,56 @@ qint64 CtfTraceManager::traceEnd() const void CtfTraceManager::addEvent(const json &event) { - const double timestamp = event.value(CtfTracingClockTimestampKey, -1.0); - if (timestamp < 0) { - // events without or with negative timestamp will be ignored - return; - } - if (m_timeOffset < 0) { - // the timestamp of the first event is used as the global offset - m_timeOffset = timestamp; - } - - static const auto getStringValue = [](const json &event, const char *key, const QString &def) { - if (!event.contains(key)) - return def; - const json val = event[key]; - if (val.is_string()) - return QString::fromStdString(val); - if (val.is_number()) { - return QString::number(int(val)); + try { + const double timestamp = event.value(CtfTracingClockTimestampKey, -1.0); + if (timestamp < 0) { + // events without or with negative timestamp will be ignored + return; } - return def; - }; - const QString processId = getStringValue(event, CtfProcessIdKey, "0"); - const QString threadId = getStringValue(event, CtfThreadIdKey, processId); - if (!m_threadModels.contains(threadId)) { - addModelForThread(threadId, processId); - } - if (event.value(CtfEventPhaseKey, "") == CtfEventTypeMetadata) { - const std::string name = event[CtfEventNameKey]; - if (name == "thread_name") { - m_threadNames[threadId] = QString::fromStdString(event["args"]["name"]); - } else if (name == "process_name") { - m_processNames[processId] = QString::fromStdString(event["args"]["name"]); + if (m_timeOffset < 0) { + // the timestamp of the first event is used as the global offset + m_timeOffset = timestamp; } - } - const QPair<bool, qint64> result = m_threadModels[threadId]->addEvent(event, m_timeOffset); - const bool visibleOnTimeline = result.first; - if (visibleOnTimeline) { - m_traceBegin = std::min(m_traceBegin, timestamp); - m_traceEnd = std::max(m_traceEnd, timestamp); - } else if (m_timeOffset == timestamp) { - // this timestamp was used as the time offset but it is not a visible element - // -> reset the time offset again: - m_timeOffset = -1.0; + static const auto getStringValue = + [](const json &event, const char *key, const QString &def) { + if (!event.contains(key)) + return def; + const json val = event[key]; + if (val.is_string()) + return QString::fromStdString(val); + if (val.is_number()) { + return QString::number(int(val)); + } + return def; + }; + const QString processId = getStringValue(event, CtfProcessIdKey, "0"); + const QString threadId = getStringValue(event, CtfThreadIdKey, processId); + if (!m_threadModels.contains(threadId)) { + addModelForThread(threadId, processId); + } + if (event.value(CtfEventPhaseKey, "") == CtfEventTypeMetadata) { + const std::string name = event[CtfEventNameKey]; + if (name == "thread_name") { + m_threadNames[threadId] = QString::fromStdString(event["args"]["name"]); + } else if (name == "process_name") { + m_processNames[processId] = QString::fromStdString(event["args"]["name"]); + } + } + + const QPair<bool, qint64> result = m_threadModels[threadId]->addEvent(event, m_timeOffset); + const bool visibleOnTimeline = result.first; + if (visibleOnTimeline) { + m_traceBegin = std::min(m_traceBegin, timestamp); + m_traceEnd = std::max(m_traceEnd, timestamp); + } else if (m_timeOffset == timestamp) { + // this timestamp was used as the time offset but it is not a visible element + // -> reset the time offset again: + m_timeOffset = -1.0; + } + } catch (...) { + m_errorString = Tr::tr("Error while parsing CTF data: %1.") + .arg("<pre>" + QString::fromStdString(event.dump()) + "</pre>"); } } @@ -216,6 +222,7 @@ void CtfTraceManager::updateStatistics() void CtfTraceManager::clearAll() { + m_errorString.clear(); m_modelAggregator->clear(); for (CtfTimelineModel *model: std::as_const(m_threadModels)) { model->deleteLater(); @@ -226,6 +233,10 @@ void CtfTraceManager::clearAll() m_timeOffset = -1; } +QString CtfTraceManager::errorString() const +{ + return m_errorString; +} } // namespace Internal } // namespace CtfVisualizer diff --git a/src/plugins/ctfvisualizer/ctftracemanager.h b/src/plugins/ctfvisualizer/ctftracemanager.h index 29694740297..82d879ab463 100644 --- a/src/plugins/ctfvisualizer/ctftracemanager.h +++ b/src/plugins/ctfvisualizer/ctftracemanager.h @@ -46,6 +46,8 @@ public: void updateStatistics(); void clearAll(); + QString errorString() const; + signals: void detailsRequested(const QString &title); @@ -66,6 +68,7 @@ protected: double m_traceEnd = std::numeric_limits<double>::min(); double m_timeOffset = -1.0; + QString m_errorString; }; } // namespace Internal diff --git a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp index 6aee14e1236..7e21050d9d8 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp +++ b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp @@ -231,6 +231,10 @@ void CtfVisualizerTool::loadJson(const QString &fileName) QMessageBox::warning(Core::ICore::dialogParent(), Tr::tr("CTF Visualizer"), Tr::tr("The file does not contain any trace data.")); + } else if (!m_traceManager->errorString().isEmpty()) { + QMessageBox::warning(Core::ICore::dialogParent(), + Tr::tr("CTF Visualizer"), + m_traceManager->errorString()); } else { m_traceManager->finalize(); m_perspective.select(); From a1585ea5c0c05fbcc54245927d7df49529671142 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 27 Sep 2023 09:31:59 +0200 Subject: [PATCH 1344/1777] Examples: Adhere to filter when switching example set Fixes: QTCREATORBUG-29652 Change-Id: I0ccea2da7338c98bd3c5bf919e137339ed12e837 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/coreplugin/welcomepagehelper.cpp | 34 ++++++++----------- src/plugins/coreplugin/welcomepagehelper.h | 8 ++--- .../marketplace/qtmarketplacewelcomepage.cpp | 6 ++-- src/plugins/qtsupport/exampleslistmodel.cpp | 8 +++++ src/plugins/qtsupport/exampleslistmodel.h | 2 ++ .../qtsupport/gettingstartedwelcomepage.cpp | 4 +-- 6 files changed, 35 insertions(+), 27 deletions(-) diff --git a/src/plugins/coreplugin/welcomepagehelper.cpp b/src/plugins/coreplugin/welcomepagehelper.cpp index d0b1c9f3f91..8129a644ae1 100644 --- a/src/plugins/coreplugin/welcomepagehelper.cpp +++ b/src/plugins/coreplugin/welcomepagehelper.cpp @@ -298,24 +298,6 @@ bool ListModelFilter::filterAcceptsRow(int sourceRow, const QModelIndex &sourceP return QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent); } -void ListModelFilter::delayedUpdateFilter() -{ - if (m_timerId != 0) - killTimer(m_timerId); - - m_timerId = startTimer(320); -} - -void ListModelFilter::timerEvent(QTimerEvent *timerEvent) -{ - if (m_timerId == timerEvent->timerId()) { - invalidateFilter(); - emit layoutChanged(); - killTimer(m_timerId); - m_timerId = 0; - } -} - struct SearchStringLexer { QString code; @@ -427,7 +409,8 @@ void ListModelFilter::setSearchString(const QString &arg) } } - delayedUpdateFilter(); + invalidateFilter(); + emit layoutChanged(); } ListModel *ListModelFilter::sourceListModel() const @@ -677,6 +660,13 @@ void ListItemDelegate::goon() SectionedGridView::SectionedGridView(QWidget *parent) : QStackedWidget(parent) { + m_searchTimer.setInterval(320); + m_searchTimer.setSingleShot(true); + connect(&m_searchTimer, &QTimer::timeout, this, [this] { + setSearchString(m_delayedSearchString); + m_delayedSearchString.clear(); + }); + m_allItemsModel.reset(new ListModel); m_allItemsModel->setPixmapFunction(m_pixmapFunction); @@ -718,6 +708,12 @@ void SectionedGridView::setPixmapFunction(const Core::ListModel::PixmapFunction model->setPixmapFunction(pixmapFunction); } +void SectionedGridView::setSearchStringDelayed(const QString &searchString) +{ + m_delayedSearchString = searchString; + m_searchTimer.start(); +} + void SectionedGridView::setSearchString(const QString &searchString) { if (searchString.isEmpty()) { diff --git a/src/plugins/coreplugin/welcomepagehelper.h b/src/plugins/coreplugin/welcomepagehelper.h index 8599c227b90..1677e1e893a 100644 --- a/src/plugins/coreplugin/welcomepagehelper.h +++ b/src/plugins/coreplugin/welcomepagehelper.h @@ -12,6 +12,7 @@ #include <QSortFilterProxyModel> #include <QStackedWidget> #include <QStyledItemDelegate> +#include <QTimer> #include <functional> #include <optional> @@ -132,14 +133,10 @@ protected: private: bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const final; - void timerEvent(QTimerEvent *event) final; - - void delayedUpdateFilter(); QString m_searchString; QStringList m_filterTags; QStringList m_filterStrings; - int m_timerId = 0; }; class CORE_EXPORT ListItemDelegate : public QStyledItemDelegate @@ -211,6 +208,7 @@ public: void setItemDelegate(QAbstractItemDelegate *delegate); void setPixmapFunction(const Core::ListModel::PixmapFunction &pixmapFunction); + void setSearchStringDelayed(const QString &searchString); void setSearchString(const QString &searchString); Core::ListModel *addSection(const Section §ion, const QList<Core::ListItem *> &items); @@ -228,6 +226,8 @@ private: QPointer<QWidget> m_zoomedInWidget; Core::ListModel::PixmapFunction m_pixmapFunction; QAbstractItemDelegate *m_itemDelegate = nullptr; + QTimer m_searchTimer; + QString m_delayedSearchString; }; } // namespace Core diff --git a/src/plugins/marketplace/qtmarketplacewelcomepage.cpp b/src/plugins/marketplace/qtmarketplacewelcomepage.cpp index b894454b18d..a81f252b03c 100644 --- a/src/plugins/marketplace/qtmarketplacewelcomepage.cpp +++ b/src/plugins/marketplace/qtmarketplacewelcomepage.cpp @@ -94,8 +94,10 @@ public: this, []() { QDesktopServices::openUrl(QUrl("https://marketplace.qt.io")); }); }); - connect(m_searcher, &QLineEdit::textChanged, - m_sectionedProducts, &SectionedProducts::setSearchString); + connect(m_searcher, + &QLineEdit::textChanged, + m_sectionedProducts, + &SectionedProducts::setSearchStringDelayed); connect(m_sectionedProducts, &SectionedProducts::tagClicked, this, &QtMarketplacePageWidget::onTagClicked); } diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index bb2f9e0fa00..0749ab8c841 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -269,11 +269,13 @@ static QPixmap fetchPixmapAndUpdatePixmapCache(const QString &url) ExamplesViewController::ExamplesViewController(ExampleSetModel *exampleSetModel, SectionedGridView *view, + QLineEdit *searchField, bool isExamples, QObject *parent) : QObject(parent) , m_exampleSetModel(exampleSetModel) , m_view(view) + , m_searchField(searchField) , m_isExamples(isExamples) { if (isExamples) { @@ -286,6 +288,10 @@ ExamplesViewController::ExamplesViewController(ExampleSetModel *exampleSetModel, &Core::HelpManager::Signals::documentationChanged, this, &ExamplesViewController::updateExamples); + connect(m_searchField, + &QLineEdit::textChanged, + m_view, + &SectionedGridView::setSearchStringDelayed); view->setPixmapFunction(fetchPixmapAndUpdatePixmapCache); updateExamples(); } @@ -399,6 +405,8 @@ void ExamplesViewController::updateExamples() m_view->addSection(sections.at(i).first, static_container_cast<ListItem *>(sections.at(i).second)); } + if (!m_searchField->text().isEmpty()) + m_view->setSearchString(m_searchField->text()); } void ExamplesViewController::setVisible(bool visible) diff --git a/src/plugins/qtsupport/exampleslistmodel.h b/src/plugins/qtsupport/exampleslistmodel.h index 9aa1ddba529..142f1c72f6c 100644 --- a/src/plugins/qtsupport/exampleslistmodel.h +++ b/src/plugins/qtsupport/exampleslistmodel.h @@ -88,6 +88,7 @@ class ExamplesViewController : public QObject public: explicit ExamplesViewController(ExampleSetModel *exampleSetModel, Core::SectionedGridView *view, + QLineEdit *searchField, bool isExamples, QObject *parent); @@ -98,6 +99,7 @@ public: private: ExampleSetModel *m_exampleSetModel; Core::SectionedGridView *m_view; + QLineEdit *m_searchField; bool m_isExamples; bool m_isVisible = false; bool m_needsUpdateExamples = false; diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index b6f42fb8d1f..2aea09a1a1a 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp @@ -304,14 +304,14 @@ public: grid->addWidget(WelcomePageHelpers::panelBar(this), 0, 2); auto gridView = new SectionedGridView(this); - m_viewController = new ExamplesViewController(s_exampleSetModel, gridView, isExamples, this); + m_viewController + = new ExamplesViewController(s_exampleSetModel, gridView, m_searcher, isExamples, this); gridView->setItemDelegate(&m_exampleDelegate); grid->addWidget(gridView, 1, 1, 1, 2); connect(&m_exampleDelegate, &ExampleDelegate::tagClicked, this, &ExamplesPageWidget::onTagClicked); - connect(m_searcher, &QLineEdit::textChanged, gridView, &SectionedGridView::setSearchString); } void onTagClicked(const QString &tag) From 6bbebaac51366967ee005e915a813a8dca8aaf66 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 28 Sep 2023 07:56:23 +0200 Subject: [PATCH 1345/1777] SquishTests: Fix accessing clear button on find tool bar Change-Id: I9af1e6c2eb622254e9011942acb2004bf7b01970 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- 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 940739813a9..5e50a7e54ea 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -12,7 +12,7 @@ :*Qt Creator.findEdit_Utils::FilterLineEdit {name='findEdit' type='Utils::FancyLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator_Core::Internal::FancyToolButton {name='KitSelector.Button' type='Core::Internal::FancyToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator_Utils::FilterLineEdit {type='Utils::FancyLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:*Qt Creator_Utils::IconButton {occurrence='4' type='Utils::IconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:*Qt Creator_Utils::IconButton {occurrence='5' type='Utils::FancyIconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :About Qt Creator_Core::Internal::VersionDialog {type='Core::Internal::VersionDialog' unnamed='1' visible='1' windowTitle='About Qt Creator'} :Activate completion:_QComboBox {buddy=':Behavior.Activate completion:_QLabel' type='QComboBox' unnamed='1' visible='1'} :Add Bookmark.ExpandBookmarksList_QToolButton {text='+' type='QToolButton' unnamed='1' visible='1' window=':Add Bookmark_BookmarkDialog'} From 51fbe9672833d7bd0da46454a3a2f4909187eefe Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 28 Sep 2023 08:11:01 +0200 Subject: [PATCH 1346/1777] SquishTests: Fix accessing navigation tree view Change-Id: I0f392c39c75c553cc65ade4c1689cf1085f1c5a1 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/projectexplorer/projecttreewidget.cpp | 1 + tests/system/objects.map | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 6a26300265a..fc865e96f18 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -126,6 +126,7 @@ class ProjectTreeView : public NavigationTreeView public: ProjectTreeView() { + setObjectName("projectTreeView"); // used by Squish setEditTriggers(QAbstractItemView::EditKeyPressed); setContextMenuPolicy(Qt::CustomContextMenu); setDragEnabled(true); diff --git a/tests/system/objects.map b/tests/system/objects.map index 5e50a7e54ea..edfe5dd3988 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -166,7 +166,7 @@ :Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton {occurrence='2' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_TextEditor::TextEditorWidget {type='TextEditor::TextEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Utils::BuildDirectoryLineEdit {name='LineEdit' type='Utils::FancyLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_Utils::NavigationTreeView {name='projectTreeView' type='QTreeView' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit {container=':Qt Creator_Utils::NavigationTreeView' type='QExpandingLineEdit' unnamed='1' visible='1'} :QtSupport__Internal__QtVersionManager.errorLabel.QLabel {container=':qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget' name='errorLabel' type='QLabel' visible='1'} :QtSupport__Internal__QtVersionManager.qmake_QLabel {container=':qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget' name='qmakePath' type='QLabel' visible='1'} From f2451f8cd36c3c71a227f654f33aefb3c275b75a Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 28 Sep 2023 08:44:52 +0200 Subject: [PATCH 1347/1777] SquishTests: Improve lldb expectations LLDB provides a couple of executables that are not usable as standalone debugger - explicitly filter them out. Change-Id: I293479adb6b47b1a63e6cad5a9d1ab34e255d9ed Reviewed-by: David Schulz <david.schulz@qt.io> --- tests/system/suite_general/tst_default_settings/test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/system/suite_general/tst_default_settings/test.py b/tests/system/suite_general/tst_default_settings/test.py index 57d7ae02cb1..428276722e9 100644 --- a/tests/system/suite_general/tst_default_settings/test.py +++ b/tests/system/suite_general/tst_default_settings/test.py @@ -268,7 +268,9 @@ def __getExpectedDebuggers__(): for debugger in ["gdb", "lldb"]: result.extend(findAllFilesInPATH(debugger + exeSuffix)) if platform.system() == 'Linux': - result.extend(filter(lambda s: not ("lldb-platform" in s or "lldb-gdbserver" in s), + explicitlyOmitted = ("lldb-platform", "lldb-gdbserver", "lldb-instr", "lldb-argdumper", + "lldb-server", "lldb-vscode") + result.extend(filter(lambda s: not (any(omitted in s for omitted in explicitlyOmitted)), findAllFilesInPATH("lldb-*"))) if platform.system() == 'Darwin': xcodeLLDB = getOutputFromCmdline(["xcrun", "--find", "lldb"]).strip("\n") From 6d92639a2de1375275d2636dd2737119e7f84805 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Fri, 22 Sep 2023 11:48:23 +0200 Subject: [PATCH 1348/1777] DAP: Update expanded variables over debugging process Update and save expanded variables over debugging process Change-Id: Iff35389fb5e56c0cde549565e88288e4bc9b52e7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/dapengine.cpp | 51 ++++++++++++++++++++----- src/plugins/debugger/dap/dapengine.h | 3 ++ src/plugins/debugger/debuggerengine.cpp | 4 ++ src/plugins/debugger/debuggerengine.h | 2 + src/plugins/debugger/watchhandler.cpp | 1 + 5 files changed, 51 insertions(+), 10 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index c83a125b312..8df09b0d0d6 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -278,7 +278,6 @@ void DapEngine::updateBreakpoint(const Breakpoint &bp) { BreakpointParameters parameters = bp->requestedParameters(); notifyBreakpointChangeProceeding(bp); - qDebug() << "updateBreakpoint"; if (parameters.enabled != bp->isEnabled()) { if (bp->isEnabled()) @@ -413,14 +412,39 @@ void DapEngine::assignValueInDebugger(WatchItem *, const QString &/*expression*/ void DapEngine::updateItem(const QString &iname) { WatchItem *item = watchHandler()->findItem(iname); - - if (m_currentWatchItem != item) { + if (item && m_currentWatchItem != item) { m_currentWatchItem = item; - m_isFirstLayer = false; m_dapClient->variables(item->variablesReference); } } +void DapEngine::getVariableFromQueue() +{ + WatchItem *item = nullptr; + while (!item && !m_variablesReferenceInameQueue.empty()) { + item = watchHandler()->findItem(m_variablesReferenceInameQueue.front()); + m_variablesReferenceInameQueue.pop(); + } + + if (item) { + m_currentWatchItem = item; + m_dapClient->variables(item->variablesReference); + } +} + +void DapEngine::reexpandItems(const QSet<QString> &inames) +{ + QList<QString> inamesVector = inames.values().toVector(); + inamesVector.sort(); + + for (const QString &iname : inamesVector) { + if (iname.startsWith("local.")) + m_variablesReferenceInameQueue.push(iname); + } + + getVariableFromQueue(); +} + QString DapEngine::errorMessage(QProcess::ProcessError error) const { switch (error) { @@ -557,7 +581,6 @@ void DapEngine::handleScopesResponse(const QJsonObject &response) if (!response.value("success").toBool()) return; - watchHandler()->cleanup(); watchHandler()->removeAllData(); watchHandler()->notifyUpdateStarted(); @@ -735,7 +758,7 @@ void DapEngine::refreshLocals(const QJsonArray &variables) if (variablesReference > 0) item->wantsChildren = true; - qCDebug(logCategory()) << "variable" << name << variablesReference; + qCDebug(logCategory()) << "variable" << item->iname << variablesReference; if (m_isFirstLayer) m_watchItems.append(item); else @@ -746,15 +769,22 @@ void DapEngine::refreshLocals(const QJsonArray &variables) if (m_variablesReferenceQueue.empty()) { for (auto item : m_watchItems) watchHandler()->insertItem(item); + m_isFirstLayer = false; + watchHandler()->notifyUpdateFinished(); } else { m_dapClient->variables(m_variablesReferenceQueue.front()); m_variablesReferenceQueue.pop(); } - } else { - watchHandler()->updateWatchExpression(m_currentWatchItem, ""); + return; } - watchHandler()->notifyUpdateFinished(); + if (m_currentWatchItem) { + emit watchHandler()->model()->inameIsExpanded(m_currentWatchItem->iname); + emit watchHandler()->model()->itemIsExpanded( + watchHandler()->model()->indexForItem(m_currentWatchItem)); + } + + getVariableFromQueue(); } void DapEngine::refreshStack(const QJsonArray &stackFrames) @@ -803,7 +833,8 @@ bool DapEngine::hasCapability(unsigned cap) const return cap & (ReloadModuleCapability | BreakConditionCapability | ShowModuleSymbolsCapability - | RunToLineCapability); + | RunToLineCapability + | AddWatcherCapability); } void DapEngine::claimInitialBreakpoints() diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index d0033a0cb83..5d197f94153 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -69,6 +69,8 @@ protected: bool supportsThreads() const { return true; } void updateItem(const QString &iname) override; + void reexpandItems(const QSet<QString> &inames) override; + void getVariableFromQueue(); void runCommand(const DebuggerCommand &cmd) override; @@ -118,6 +120,7 @@ protected: bool m_isFirstLayer = true; std::queue<int> m_variablesReferenceQueue; + std::queue<QString> m_variablesReferenceInameQueue; WatchItem *m_currentWatchItem = nullptr; QList<WatchItem *> m_watchItems; diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 9568c685533..bd7f227ec8a 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -2401,6 +2401,10 @@ void DebuggerEngine::updateItem(const QString &iname) doUpdateLocals(params); } +void DebuggerEngine::reexpandItems(const QSet<QString> &) +{ +} + void DebuggerEngine::updateWatchData(const QString &iname) { // This is used in cases where re-evaluation is ok for the same iname diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index c1b6cfc630f..354ebb95fe0 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -290,6 +290,8 @@ public: virtual bool canHandleToolTip(const DebuggerToolTipContext &) const; virtual void expandItem(const QString &iname); // Called when item in tree gets expanded. + virtual void reexpandItems( + const QSet<QString> &inames); // Called when items in tree need to be reexpanded. virtual void updateItem(const QString &iname); // Called for fresh watch items. void updateWatchData(const QString &iname); // FIXME: Merge with above. virtual void selectWatchData(const QString &iname); diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 08160e22dd8..4a016c80527 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -2241,6 +2241,7 @@ bool WatchHandler::insertItem(WatchItem *item) void WatchModel::reexpandItems() { + m_engine->reexpandItems(m_expandedINames); for (const QString &iname: m_expandedINames) { if (WatchItem *item = findItem(iname)) { emit itemIsExpanded(indexForItem(item)); From 32001b7e2aa95054454e37bc0178109ed06fce7c Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 28 Sep 2023 09:12:56 +0200 Subject: [PATCH 1349/1777] SquishTests: Adapt to changed ui Change-Id: Ib1b13648b48e66e8932ee2c904cd783f8ccde727 Reviewed-by: David Schulz <david.schulz@qt.io> --- 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 edfe5dd3988..36d38fb7706 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -206,7 +206,7 @@ :popupFrame_Proposal_QListView {container=':popupFrame_TextEditor::GenericProposalWidget' type='QListView' unnamed='1' visible='1'} :popupFrame_TextEditor::GenericProposalWidget {name='m_popupFrame' type='TextEditor::GenericProposalWidget' visible='1'} :projectComboBox_QComboBox {buddy=':New Text File.Add to project:_QLabel' name='projectComboBox' type='QComboBox' visible='1'} -:projectComboBox_Utils::TreeViewComboBox {buddy=':New Text File.Add to project:_QLabel' name='projectComboBox' type='Utils::TreeViewComboBox' visible='1'} +:projectComboBox_Utils::TreeViewComboBox {buddy=':New Text File.Add to project:_QLabel' name='projectComboBox' type='QComboBox' visible='1'} :qdesigner_internal::WidgetBoxCategoryListView {container=':Widget Box_qdesigner_internal::WidgetBoxTreeWidget' occurrence='3' type='qdesigner_internal::WidgetBoxCategoryListView' unnamed='1' visible='1'} :qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' type='QScrollArea' unnamed='1' visible='1'} :qt_tabwidget_stackedwidget_QScrollArea {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' type='QScrollArea' unnamed='1' visible='1'} From 19faf1a25a71e4554292bf1219aa3ba285ac9a85 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Mon, 25 Sep 2023 16:08:16 +0200 Subject: [PATCH 1350/1777] DAP: Add watcher feature It is possible currently to add/remove watcher. Also it saves expanded structure during the debugging process. Note: It doesn't work for CMake because of the issue #25282. Change-Id: Ia0a48ca5cd0062617ae427b56b001ef87d5894ed Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/dap/cmakedapengine.cpp | 1 + src/plugins/debugger/dap/dapclient.cpp | 16 +- src/plugins/debugger/dap/dapclient.h | 4 + src/plugins/debugger/dap/dapengine.cpp | 221 ++++++++++++-------- src/plugins/debugger/dap/dapengine.h | 40 +++- 5 files changed, 188 insertions(+), 94 deletions(-) diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp index a2e38fd09a1..d01f4488417 100644 --- a/src/plugins/debugger/dap/cmakedapengine.cpp +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -147,6 +147,7 @@ bool CMakeDapEngine::hasCapability(unsigned cap) const return cap & (ReloadModuleCapability | BreakConditionCapability | ShowModuleSymbolsCapability + /*| AddWatcherCapability*/ // disable while the #25282 bug is not fixed /*| RunToLineCapability*/); // disable while the #25176 bug is not fixed } diff --git a/src/plugins/debugger/dap/dapclient.cpp b/src/plugins/debugger/dap/dapclient.cpp index 80fadd19ce3..f63d45b2bb9 100644 --- a/src/plugins/debugger/dap/dapclient.cpp +++ b/src/plugins/debugger/dap/dapclient.cpp @@ -114,11 +114,19 @@ void DapClient::sendStepOver(int threadId) postRequest("next", QJsonObject{{"threadId", threadId}}); } +void DapClient::evaluateVariable(const QString &expression, int frameId) +{ + postRequest("evaluate", + QJsonObject{{"expression", expression}, + {"frameId", frameId}, + {"context", "variables"}}); +} + void DapClient::stackTrace(int threadId) { QTC_ASSERT(threadId != -1, return); postRequest("stackTrace", - QJsonObject{{"threadId", threadId}, {"startFrame", 0}, {"levels", 10}}); + QJsonObject{{"threadId", threadId}, {"startFrame", 0}, {"levels", 10}}); } void DapClient::scopes(int frameId) @@ -139,8 +147,8 @@ void DapClient::variables(int variablesReference) void DapClient::setBreakpoints(const QJsonArray &breakpoints, const FilePath &fileName) { postRequest("setBreakpoints", - QJsonObject{{"source", QJsonObject{{"path", fileName.path()}}}, - {"breakpoints", breakpoints}}); + QJsonObject{{"source", QJsonObject{{"path", fileName.path()}}}, + {"breakpoints", breakpoints}}); } void DapClient::readOutput() @@ -214,6 +222,8 @@ void DapClient::emitSignals(const QJsonDocument &doc) type = DapResponseType::DapThreads; } else if (command == "pause") { type = DapResponseType::Pause; + } else if (command == "evaluate") { + type = DapResponseType::Evaluate; } emit responseReady(type, ob); return; diff --git a/src/plugins/debugger/dap/dapclient.h b/src/plugins/debugger/dap/dapclient.h index 066abd3fd53..d2a6f52bb22 100644 --- a/src/plugins/debugger/dap/dapclient.h +++ b/src/plugins/debugger/dap/dapclient.h @@ -51,6 +51,7 @@ enum class DapResponseType StepOut, StepOver, Pause, + Evaluate, Unknown }; @@ -93,11 +94,14 @@ public: void sendStepOut(int threadId); void sendStepOver(int threadId); + void evaluateVariable(const QString &expression, int frameId); + void stackTrace(int threadId); void scopes(int frameId); void threads(); void variables(int variablesReference); void setBreakpoints(const QJsonArray &breakpoints, const Utils::FilePath &fileName); + void emitSignals(const QJsonDocument &doc); signals: diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 8df09b0d0d6..d722c14019c 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -63,6 +63,79 @@ using namespace Utils; namespace Debugger::Internal { +VariablesHandler::VariablesHandler(DapEngine *dapEngine) + : m_dapEngine(dapEngine) +{} + +void VariablesHandler::addVariable(const QString &iname, int variablesReference) +{ + VariableItem varItem = {iname, variablesReference}; + bool wasEmpty = m_queue.empty(); + bool inserted = false; + + for (auto i = m_queue.begin(); i != m_queue.end(); ++i) { + if (i->iname > iname) { + m_queue.insert(i, varItem); + inserted = true; + break; + } + } + if (!inserted) + m_queue.push_back(varItem); + + if (wasEmpty) { + startHandling(); + } +} + +void VariablesHandler::handleNext() +{ + if (m_queue.empty()) + return; + + m_queue.pop_front(); + startHandling(); +} + +void VariablesHandler::startHandling() +{ + if (m_queue.empty()) + return; + + m_currentVarItem = m_queue.front(); + + WatchItem *watchItem = m_dapEngine->watchHandler()->findItem(m_currentVarItem.iname); + int variablesReference = m_currentVarItem.variablesReference; + + if (variablesReference == -1 && watchItem && watchItem->iname.startsWith("watch.") + && watchItem->iname.split('.').size() == 2) { + watchItem->removeChildren(); + m_dapEngine->dapClient()->evaluateVariable(watchItem->name, + m_dapEngine->currentStackFrameId()); + return; + } + + if (variablesReference == -1) { + if (watchItem) { + variablesReference = watchItem->variablesReference; + } else { + handleNext(); + return; + } + } + + if (variablesReference == 0) { + handleNext(); + return; + } + + m_dapEngine->dapClient()->variables(variablesReference); +} + +DapEngine::DapEngine() + : m_variablesHandler(std::make_unique<VariablesHandler>(this)) +{} + void DapEngine::executeDebuggerCommand(const QString &/*command*/) { QTC_ASSERT(state() == InferiorStopOk, qCDebug(logCategory()) << state()); @@ -350,13 +423,6 @@ void DapEngine::refreshModules(const GdbMi &modules) handler->endUpdateAll(); } -void DapEngine::requestModuleSymbols(const Utils::FilePath &/*moduleName*/) -{ -// DebuggerCommand cmd("listSymbols"); -// cmd.arg("module", moduleName); -// runCommand(cmd); -} - void DapEngine::refreshState(const GdbMi &reportedState) { QString newState = reportedState.data(); @@ -399,50 +465,32 @@ bool DapEngine::canHandleToolTip(const DebuggerToolTipContext &) const return state() == InferiorStopOk; } -void DapEngine::assignValueInDebugger(WatchItem *, const QString &/*expression*/, const QVariant &/*value*/) -{ - //DebuggerCommand cmd("assignValue"); - //cmd.arg("expression", expression); - //cmd.arg("value", value.toString()); - //runCommand(cmd); - // postDirectCommand("global " + expression + ';' + expression + "=" + value.toString()); - updateLocals(); -} - void DapEngine::updateItem(const QString &iname) { WatchItem *item = watchHandler()->findItem(iname); - if (item && m_currentWatchItem != item) { - m_currentWatchItem = item; - m_dapClient->variables(item->variablesReference); - } -} -void DapEngine::getVariableFromQueue() -{ - WatchItem *item = nullptr; - while (!item && !m_variablesReferenceInameQueue.empty()) { - item = watchHandler()->findItem(m_variablesReferenceInameQueue.front()); - m_variablesReferenceInameQueue.pop(); - } - - if (item) { - m_currentWatchItem = item; - m_dapClient->variables(item->variablesReference); - } + if (item && m_variablesHandler->currentItem().iname != item->iname) + m_variablesHandler->addVariable(item->iname, item->variablesReference); } void DapEngine::reexpandItems(const QSet<QString> &inames) { - QList<QString> inamesVector = inames.values().toVector(); + QSet<QString> expandedInames = inames; + for (auto inames : watchHandler()->watcherNames().keys()) + expandedInames.insert(watchHandler()->watcherName(inames)); + + QList<QString> inamesVector = expandedInames.values().toVector(); inamesVector.sort(); for (const QString &iname : inamesVector) { - if (iname.startsWith("local.")) - m_variablesReferenceInameQueue.push(iname); + if (iname.startsWith("local.") || iname.startsWith("watch.")) + m_variablesHandler->addVariable(iname, -1); } +} - getVariableFromQueue(); +void DapEngine::doUpdateLocals(const UpdateParameters ¶ms) +{ + m_variablesHandler->addVariable(params.partialVariable, -1); } QString DapEngine::errorMessage(QProcess::ProcessError error) const @@ -508,12 +556,6 @@ void DapEngine::handleResponse(DapResponseType type, const QJsonObject &response { const QString command = response.value("command").toString(); - if (response.contains("success") && !response.value("success").toBool()) { - showMessage(QString("DAP COMMAND FAILED: %1").arg(command)); - qCDebug(logCategory()) << "DAP COMMAND FAILED:" << command; - return; - } - switch (type) { case DapResponseType::Initialize: qCDebug(logCategory()) << "initialize success"; @@ -553,9 +595,18 @@ void DapEngine::handleResponse(DapResponseType type, const QJsonObject &response case DapResponseType::DapThreads: handleThreadsResponse(response); break; + case DapResponseType::Evaluate: + handleEvaluateResponse(response); + break; default: showMessage("UNKNOWN RESPONSE:" + command); }; + + if (response.contains("success") && !response.value("success").toBool()) { + showMessage(QString("DAP COMMAND FAILED: %1").arg(command)); + qCDebug(logCategory()) << "DAP COMMAND FAILED:" << command; + return; + } } void DapEngine::handleStackTraceResponse(const QJsonObject &response) @@ -581,24 +632,17 @@ void DapEngine::handleScopesResponse(const QJsonObject &response) if (!response.value("success").toBool()) return; - watchHandler()->removeAllData(); watchHandler()->notifyUpdateStarted(); - m_watchItems.clear(); - QJsonArray scopes = response.value("body").toObject().value("scopes").toArray(); for (const QJsonValueRef &scope : scopes) { const QString name = scope.toObject().value("name").toString(); if (name == "Registers") continue; - m_variablesReferenceQueue.push(scope.toObject().value("variablesReference").toInt()); + m_variablesHandler->addVariable("", scope.toObject().value("variablesReference").toInt()); } - if (!m_variablesReferenceQueue.empty()) { - m_isFirstLayer = true; - m_dapClient->variables(m_variablesReferenceQueue.front()); - m_variablesReferenceQueue.pop(); - } else { + if (m_variablesHandler->queueSize() == 0) { watchHandler()->notifyUpdateFinished(); } } @@ -625,6 +669,28 @@ void DapEngine::handleThreadsResponse(const QJsonObject &response) } } +void DapEngine::handleEvaluateResponse(const QJsonObject &response) +{ + WatchItem *watchItem = watchHandler()->findItem( + m_variablesHandler->currentItem().iname); + if (watchItem + && response.value("body").toObject().contains("variablesReference")) { + watchItem->variablesReference + = response.value("body").toObject().value("variablesReference").toInt(); + watchItem->value + = response.value("body").toObject().value("result").toString(); + watchItem->type = response.value("body").toObject().value("type").toString(); + watchItem->wantsChildren = watchItem->variablesReference > 0; + + watchItem->updateValueCache(); + watchItem->update(); + + m_variablesHandler->addVariable(watchItem->iname, + watchItem->variablesReference); + } + m_variablesHandler->handleNext(); +} + void DapEngine::handleEvent(DapEventType type, const QJsonObject &event) { const QString eventType = event.value("event").toString(); @@ -740,51 +806,42 @@ void DapEngine::handleBreakpointEvent(const QJsonObject &event) void DapEngine::refreshLocals(const QJsonArray &variables) { + WatchItem *currentItem = watchHandler()->findItem(m_variablesHandler->currentItem().iname); + if (currentItem && currentItem->iname.startsWith("watch")) + currentItem->removeChildren(); + for (auto variable : variables) { WatchItem *item = new WatchItem; const QString name = variable.toObject().value("name").toString(); - if (m_isFirstLayer) - item->iname = "local." + name; - else - item->iname = m_currentWatchItem->iname + "." + name; + + item->iname = (currentItem ? currentItem->iname : "local") + "." + + name; item->name = name; item->type = variable.toObject().value("type").toString(); item->value = variable.toObject().value("value").toString(); item->address = variable.toObject().value("address").toInt(); item->type = variable.toObject().value("type").toString(); + item->variablesReference = variable.toObject().value("variablesReference").toInt(); + item->wantsChildren = item->variablesReference > 0; - const int variablesReference = variable.toObject().value("variablesReference").toInt(); - item->variablesReference = variablesReference; - if (variablesReference > 0) - item->wantsChildren = true; - - qCDebug(logCategory()) << "variable" << item->iname << variablesReference; - if (m_isFirstLayer) - m_watchItems.append(item); + qCDebug(logCategory()) << "variable" << item->iname << item->variablesReference; + if (currentItem) + currentItem->appendChild(item); else - m_currentWatchItem->appendChild(item); + watchHandler()->insertItem(item); } - if (m_isFirstLayer) { - if (m_variablesReferenceQueue.empty()) { - for (auto item : m_watchItems) - watchHandler()->insertItem(item); - m_isFirstLayer = false; - watchHandler()->notifyUpdateFinished(); - } else { - m_dapClient->variables(m_variablesReferenceQueue.front()); - m_variablesReferenceQueue.pop(); - } - return; + QModelIndex idx = watchHandler()->model()->indexForItem(currentItem); + if (currentItem && idx.isValid() && idx.data(LocalsExpandedRole).toBool()) { + emit watchHandler()->model()->inameIsExpanded(currentItem->iname); + emit watchHandler()->model()->itemIsExpanded(idx); } - if (m_currentWatchItem) { - emit watchHandler()->model()->inameIsExpanded(m_currentWatchItem->iname); - emit watchHandler()->model()->itemIsExpanded( - watchHandler()->model()->indexForItem(m_currentWatchItem)); + if (m_variablesHandler->queueSize() == 1 && currentItem == nullptr) { + watchHandler()->notifyUpdateFinished(); } - getVariableFromQueue(); + m_variablesHandler->handleNext(); } void DapEngine::refreshStack(const QJsonArray &stackFrames) diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 5d197f94153..52b84a36a6f 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -20,6 +20,30 @@ class IDataProvider; class GdbMi; enum class DapResponseType; enum class DapEventType; +class DapEngine; + +class VariablesHandler { +public: + VariablesHandler(DapEngine *dapEngine); + + struct VariableItem { + QString iname; + int variablesReference; + }; + + void addVariable(const QString &iname, int variablesReference); + void handleNext(); + + VariableItem currentItem() const { return m_currentVarItem; } + int queueSize() const { return m_queue.size(); } + +private: + void startHandling(); + + DapEngine *m_dapEngine; + std::list<VariableItem> m_queue; + VariableItem m_currentVarItem; +}; /* * A debugger engine for the debugger adapter protocol. @@ -27,9 +51,12 @@ enum class DapEventType; class DapEngine : public DebuggerEngine { public: - DapEngine() = default; + DapEngine(); ~DapEngine() override = default; + DapClient *dapClient() const { return m_dapClient; } + int currentStackFrameId() const { return m_currentStackFrameId; } + protected: void executeStepIn(bool) override; void executeStepOut() override; @@ -55,13 +82,10 @@ protected: void updateBreakpoint(const Breakpoint &bp) override; void removeBreakpoint(const Breakpoint &bp) override; - void assignValueInDebugger(WatchItem *item, - const QString &expr, const QVariant &value) override; void executeDebuggerCommand(const QString &command) override; void loadSymbols(const Utils::FilePath &moduleName) override; void loadAllSymbols() override; - void requestModuleSymbols(const Utils::FilePath &moduleName) override; void reloadModules() override; void reloadRegisters() override {} void reloadSourceFiles() override {} @@ -70,6 +94,7 @@ protected: bool supportsThreads() const { return true; } void updateItem(const QString &iname) override; void reexpandItems(const QSet<QString> &inames) override; + void doUpdateLocals(const UpdateParameters ¶ms) override; void getVariableFromQueue(); void runCommand(const DebuggerCommand &cmd) override; @@ -102,6 +127,7 @@ protected: void handleStackTraceResponse(const QJsonObject &response); void handleScopesResponse(const QJsonObject &response); void handleThreadsResponse(const QJsonObject &response); + void handleEvaluateResponse(const QJsonObject &response); void handleEvent(DapEventType type, const QJsonObject &event); void handleBreakpointEvent(const QJsonObject &event); @@ -118,11 +144,7 @@ protected: int m_currentThreadId = -1; int m_currentStackFrameId = -1; - bool m_isFirstLayer = true; - std::queue<int> m_variablesReferenceQueue; - std::queue<QString> m_variablesReferenceInameQueue; - WatchItem *m_currentWatchItem = nullptr; - QList<WatchItem *> m_watchItems; + std::unique_ptr<VariablesHandler> m_variablesHandler; virtual const QLoggingCategory &logCategory() { From e5aaf90467929d31e15de146aed8fcab011ede3c Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 28 Sep 2023 07:11:56 +0200 Subject: [PATCH 1351/1777] Core: Fix build for Qt6.2 Change-Id: Ifbe1bf349eca5462c83afdcb62a108f7e3f7b2af Reviewed-by: hjk <hjk@qt.io> --- src/plugins/coreplugin/find/findplugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/find/findplugin.cpp b/src/plugins/coreplugin/find/findplugin.cpp index 01e624b9669..d7cb36e7ae2 100644 --- a/src/plugins/coreplugin/find/findplugin.cpp +++ b/src/plugins/coreplugin/find/findplugin.cpp @@ -111,7 +111,7 @@ void CompletionModel::writeSettings(QtcSettings *settings) const settings->remove(completionSettingsArrayPrefix()); } else { const int size = m_entries.size(); - settings->beginWriteArray(completionSettingsArrayPrefix().view(), size); + settings->beginWriteArray(stringFromKey(completionSettingsArrayPrefix()), size); for (int i = 0; i < size; ++i) { settings->setArrayIndex(i); settings->setValue(completionSettingsTextKey(), m_entries.at(i).text); @@ -124,7 +124,7 @@ void CompletionModel::writeSettings(QtcSettings *settings) const void CompletionModel::readSettings(QtcSettings *settings) { beginResetModel(); - const int size = settings->beginReadArray(completionSettingsArrayPrefix().view()); + const int size = settings->beginReadArray(stringFromKey(completionSettingsArrayPrefix())); m_entries.clear(); m_entries.reserve(size); for (int i = 0; i < size; ++i) { From 7235e977ffb9e0802091545d1f3e6abb17700135 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 28 Sep 2023 15:48:11 +0200 Subject: [PATCH 1352/1777] CMakePM: Fix concurrent access crash Change-Id: I9ea11619860d4066cb06dfd4a60def8208f21add Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmaketool.cpp | 22 +++++++++++++------ .../cmakeprojectmanager/cmaketoolmanager.cpp | 3 +++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 0e2e1c64bf0..5eba0d642de 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -86,10 +86,12 @@ class IntrospectionData { public: bool m_didAttemptToRun = false; - bool m_didRun = true; + bool m_haveCapabilitites = true; + bool m_haveKeywords = false; QList<CMakeTool::Generator> m_generators; CMakeKeywords m_keywords; + QMutex m_keywordsMutex; QVector<FileApi> m_fileApis; CMakeTool::Version m_version; }; @@ -161,7 +163,7 @@ bool CMakeTool::isValid(bool ignoreCache) const if (!m_introspection->m_didAttemptToRun) readInformation(ignoreCache); - return m_introspection->m_didRun && !m_introspection->m_fileApis.isEmpty(); + return m_introspection->m_haveCapabilitites && !m_introspection->m_fileApis.isEmpty(); } void CMakeTool::runCMake(Process &cmake, const QStringList &args, int timeoutS) const @@ -249,7 +251,11 @@ CMakeKeywords CMakeTool::keywords() if (!isValid()) return {}; - if (m_introspection->m_keywords.functions.isEmpty() && m_introspection->m_didRun) { + if (!m_introspection->m_haveKeywords && m_introspection->m_haveCapabilitites) { + QMutexLocker locker(&m_introspection->m_keywordsMutex); + if (m_introspection->m_haveKeywords) + return m_introspection->m_keywords; + Process proc; const FilePath findCMakeRoot = TemporaryDirectory::masterDirectoryFilePath() @@ -311,6 +317,8 @@ CMakeKeywords CMakeTool::keywords() const QStringList moduleFunctions = parseSyntaxHighlightingXml(); for (const auto &function : moduleFunctions) m_introspection->m_keywords.functions[function] = FilePath(); + + m_introspection->m_haveKeywords = true; } return m_introspection->m_keywords; @@ -433,7 +441,7 @@ void CMakeTool::openCMakeHelpUrl(const CMakeTool *tool, const QString &linkUrl) void CMakeTool::readInformation(bool ignoreCache) const { QTC_ASSERT(m_introspection, return ); - if (!m_introspection->m_didRun && m_introspection->m_didAttemptToRun) + if (!m_introspection->m_haveCapabilitites && m_introspection->m_didAttemptToRun) return; m_introspection->m_didAttemptToRun = true; @@ -623,7 +631,7 @@ void CMakeTool::fetchFromCapabilities(bool ignoreCache) const keyFromString("CMake_" + cmakeExecutable().toUserOutput())); if (cache && !ignoreCache) { - m_introspection->m_didRun = true; + m_introspection->m_haveCapabilitites = true; parseFromCapabilities(cache->value("CleanedStdOut").toString()); return; } @@ -632,11 +640,11 @@ void CMakeTool::fetchFromCapabilities(bool ignoreCache) const runCMake(cmake, {"-E", "capabilities"}); if (cmake.result() == ProcessResult::FinishedWithSuccess) { - m_introspection->m_didRun = true; + m_introspection->m_haveCapabilitites = true; parseFromCapabilities(cmake.cleanedStdOut()); } else { qCCritical(cmakeToolLog) << "Fetching capabilities failed: " << cmake.allOutput() << cmake.error(); - m_introspection->m_didRun = false; + m_introspection->m_haveCapabilitites = false; } Store newData{{"CleanedStdOut", cmake.cleanedStdOut()}}; diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index 65a4f55aa24..6eb16cc4af1 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -338,6 +338,9 @@ void CMakeToolManager::updateDocumentation() QString CMakeToolManager::toolTipForRstHelpFile(const FilePath &helpFile) { static QHash<FilePath, QString> map; + static QMutex mutex; + QMutexLocker locker(&mutex); + if (map.contains(helpFile)) return map.value(helpFile); From 9e3165433911d7ee799fc1abfe1d67f65a4fcce2 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 28 Sep 2023 15:55:19 +0200 Subject: [PATCH 1353/1777] Terminal: Fix bash shell integration on KDE Change-Id: I7c84cee276f1ee2fd902a447b763609534285911 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/terminal/shellintegration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/terminal/shellintegration.cpp b/src/plugins/terminal/shellintegration.cpp index 8cd6acd7443..cc5c50706ea 100644 --- a/src/plugins/terminal/shellintegration.cpp +++ b/src/plugins/terminal/shellintegration.cpp @@ -146,7 +146,7 @@ void ShellIntegration::prepareProcess(Utils::Process &process) CommandLine newCmd = {cmd.executable(), {"--init-file", tmpRc.nativePath()}}; if (cmd.arguments() == "-l") - newCmd.addArg("-l"); + env.set("VSCODE_SHELL_LOGIN", "1"); cmd = newCmd; } else if (cmd.executable().baseName() == "zsh") { From 4803c634233d76c9d8d6f1c77aeb24b5759e1c05 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 27 Sep 2023 13:33:50 +0200 Subject: [PATCH 1354/1777] CompilerExplorer: Add Icon Also adds function to FileIconProvider to register a full icon instead of an overlay. Change-Id: I2d9415a3b57fa50ae313ad4e52fc929b418f9708 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/libs/utils/fsengine/fileiconprovider.cpp | 19 ++++++++++++++++++ src/libs/utils/fsengine/fileiconprovider.h | 2 ++ .../compilerexplorerplugin.cpp | 5 +++++ src/plugins/compilerexplorer/logos/ce.ico | Bin 0 -> 8648 bytes src/plugins/compilerexplorer/logos/logos.qrc | 4 +++- .../compilerexplorer/wizard/cpp/wizard.json | 2 +- .../wizard/python/wizard.json | 2 +- 7 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 src/plugins/compilerexplorer/logos/ce.ico diff --git a/src/libs/utils/fsengine/fileiconprovider.cpp b/src/libs/utils/fsengine/fileiconprovider.cpp index 41c1f727c6a..9d2a7c8c050 100644 --- a/src/libs/utils/fsengine/fileiconprovider.cpp +++ b/src/libs/utils/fsengine/fileiconprovider.cpp @@ -93,6 +93,13 @@ public: }); } + void registerIconForMimeType(const QIcon &icon, const QString &mimeName) + { + // avoid accessing the MIME database right away + m_mimeUpdater.append( + [this, icon, mimeName] { addIconForMimeType(icon, Utils::mimeTypeForName(mimeName)); }); + } + void registerIconOverlayForMimeType(const QString &iconFilePath, const QString &mimeName) { // avoid accessing the MIME database right away @@ -123,6 +130,13 @@ private: registerIconOverlayForSuffix(iconFilePath, suffix); } + void addIconForMimeType(const QIcon &icon, const Utils::MimeType &mimeType) + { + const QStringList suffixes = mimeType.suffixes(); + for (const QString &suffix : suffixes) + m_suffixCache.insert(suffix, icon); + } + void ensureMimeOverlays() const { for (const std::function<void()> &f : m_mimeUpdater) @@ -306,6 +320,11 @@ void registerIconOverlayForMimeType(const QIcon &icon, const QString &mimeType) instance()->registerIconOverlayForMimeType(icon, mimeType); } +void registerIconForMimeType(const QIcon &icon, const QString &mimeType) +{ + instance()->registerIconForMimeType(icon, mimeType); +} + /*! \internal \overload diff --git a/src/libs/utils/fsengine/fileiconprovider.h b/src/libs/utils/fsengine/fileiconprovider.h index 60479220cd8..5db70e62587 100644 --- a/src/libs/utils/fsengine/fileiconprovider.h +++ b/src/libs/utils/fsengine/fileiconprovider.h @@ -37,6 +37,8 @@ QTCREATOR_UTILS_EXPORT void registerIconOverlayForMimeType(const QIcon &icon, QTCREATOR_UTILS_EXPORT QIcon directoryIcon(const QString &overlay); +QTCREATOR_UTILS_EXPORT void registerIconForMimeType(const QIcon &icon, const QString &mimeType); + } // namespace FileIconProvider } // namespace Utils diff --git a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp index 4063814e6ca..f6670df80ad 100644 --- a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp +++ b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp @@ -18,6 +18,8 @@ #include <projectexplorer/jsonwizard/jsonwizardfactory.h> +#include <utils/fsengine/fileiconprovider.h> + #include <QMenu> using namespace Core; @@ -42,6 +44,9 @@ public: settings().defaultDocument().toUtf8()); }); + Utils::FileIconProvider::registerIconForMimeType(QIcon(":/compilerexplorer/logos/ce.ico"), + "application/compiler-explorer"); + ProjectExplorer::JsonWizardFactory::addWizardPath(":/compilerexplorer/wizard/"); ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS); diff --git a/src/plugins/compilerexplorer/logos/ce.ico b/src/plugins/compilerexplorer/logos/ce.ico new file mode 100644 index 0000000000000000000000000000000000000000..e0d26b2f5ff30abab7986dc62f9982c8909f9b69 GIT binary patch literal 8648 zcmZQzU}Rur5D);-3JexZ3=Clm3=9ei5PmNU14ADZ1A~D9gdfMoz#z@ez~JBj;X89M zFjVp~FeD^E_&hue40}Ww7&-&|+<CdAxEL51cs)H_f*2SW1VEUBje&td{`3Dt1_lPk z;vjb?hIQv;UNSH+e)4p246*QEI@vHII8dZ*e{p<Va`4d$TDq?kqAqapnQ<(Nl@aN& zvg#}`TH4{fwOi?hQd4%f8~a61F0Drk7H|{>Ojxp@W8xG(C&w*Po<Sa;C+#VJ!s;{G z#PN#t{NHo`|9NhIsNU}77yD^lEgItd(x%gLE%lduJ1c(csu|-sJ6RsR@9Q{cJA7C^ zWzOS{a()gDsncz#%k;%Lrk`p(bhmlF_x{9E2OZIkM>Xd%+j7=0DmidC2FhFz@z}q@ zZX@^9)xj4lkGEf8OuzT;P4VhyGY`cj9F%w@RS>^YT`r67fnnb!Ud7z%cMD%m?75%9 zTJY%cx^?&F*s<IU{+oF0UaZWI3l^U*JY8>HWmbLN(I~bueT(P8BeQkyp5A4*>ILt{ zlwW^c{(GM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?Q1+&m58=trjy8SB6%Y+>5j!(+JA9Y~Mq}#XtU0EC?Ue0iO!Ar*T zrYw3!v-d<Z6(%lTz2D(>sY?joG5?_Y$z``>-g(@++b+ewCt}Nb)xbr(l^dtLJtwC- zxt#e|`nm}mIx{2GH=Cv{Ny%Ydap9V0{CXzW?%FB8x${^rW;3uYzax6td+t&<kDc>* z%wAm6cIdO772sLF{cmoORzMB&g)?1`9?S}nDlNU6=ik7x#Ad>^`9E?lch>DYB0VMg zY+iH~2V>@+UeOKDUi{lt9kO)lNs(sTriLs3PxQ{3dDJG}bMK$BlGm4%IVN21VBfrN zAA5_tQvEjp_2d1Y!`me1WE<P<y7rc9D^Kd-7tjC9OlNDfyT0q4pxTQZwWEp$(#m9E jZQ*lV1soeB8D}50)`m8i|JT3B=ifb3CEA$*Y33XNokYN= literal 0 HcmV?d00001 diff --git a/src/plugins/compilerexplorer/logos/logos.qrc b/src/plugins/compilerexplorer/logos/logos.qrc index 501cafddfcb..a7aa39684f2 100644 --- a/src/plugins/compilerexplorer/logos/logos.qrc +++ b/src/plugins/compilerexplorer/logos/logos.qrc @@ -1,3 +1,5 @@ <RCC> - <qresource prefix="/compilerexplorer/logos/"></qresource> + <qresource prefix="/compilerexplorer/logos/"> + <file>ce.ico</file> + </qresource> </RCC> diff --git a/src/plugins/compilerexplorer/wizard/cpp/wizard.json b/src/plugins/compilerexplorer/wizard/cpp/wizard.json index b736551b69e..6851a0b3139 100644 --- a/src/plugins/compilerexplorer/wizard/cpp/wizard.json +++ b/src/plugins/compilerexplorer/wizard/cpp/wizard.json @@ -6,7 +6,7 @@ "trDescription": "Creates an example CompilerExplorer setup for C++.", "trDisplayName": "Compiler Explorer C++ Source", "trDisplayCategory": "Compiler Explorer", - "icon": "", + "icon": ":/compilerexplorer/logos/ce.ico", "iconKind": "Plain", "options": { "key": "DefaultSuffix", diff --git a/src/plugins/compilerexplorer/wizard/python/wizard.json b/src/plugins/compilerexplorer/wizard/python/wizard.json index b026adb4cdb..35a0106ab34 100644 --- a/src/plugins/compilerexplorer/wizard/python/wizard.json +++ b/src/plugins/compilerexplorer/wizard/python/wizard.json @@ -6,7 +6,7 @@ "trDescription": "Creates an example CompilerExplorer setup for Python.", "trDisplayName": "Compiler Explorer Python Source", "trDisplayCategory": "Compiler Explorer", - "icon": "", + "icon": ":/compilerexplorer/logos/ce.ico", "iconKind": "Plain", "options": { "key": "DefaultSuffix", From 7a90fbaa0cd65171bf948997176091b2a4791f42 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 28 Sep 2023 16:44:32 +0200 Subject: [PATCH 1355/1777] Translations: Rename QtC::Bookmarks to QtC::TextEditor Change-Id: I36a56bf3ec50c47a86f56cdd8428fd352defde8e Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- share/qtcreator/translations/qtcreator_cs.ts | 14 +++----------- share/qtcreator/translations/qtcreator_da.ts | 6 +----- share/qtcreator/translations/qtcreator_de.ts | 2 +- share/qtcreator/translations/qtcreator_es.ts | 10 +--------- share/qtcreator/translations/qtcreator_fr.ts | 2 +- share/qtcreator/translations/qtcreator_hr.ts | 10 +++------- share/qtcreator/translations/qtcreator_hu.ts | 2 +- share/qtcreator/translations/qtcreator_it.ts | 10 +--------- share/qtcreator/translations/qtcreator_ja.ts | 10 +++------- share/qtcreator/translations/qtcreator_pl.ts | 15 ++++----------- share/qtcreator/translations/qtcreator_ru.ts | 6 +----- share/qtcreator/translations/qtcreator_sl.ts | 10 +--------- share/qtcreator/translations/qtcreator_uk.ts | 14 +++----------- share/qtcreator/translations/qtcreator_zh_CN.ts | 2 +- share/qtcreator/translations/qtcreator_zh_TW.ts | 12 ++---------- 15 files changed, 27 insertions(+), 98 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_cs.ts b/share/qtcreator/translations/qtcreator_cs.ts index 025ee46159d..888786eba13 100644 --- a/share/qtcreator/translations/qtcreator_cs.ts +++ b/share/qtcreator/translations/qtcreator_cs.ts @@ -44,7 +44,7 @@ </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Add Bookmark</source> <translation>Přidat záložku</translation> @@ -40281,10 +40281,6 @@ Určuje, jak se chová zpětná klávesa (backspace) co se týče odsazování. <source>Edit...</source> <translation>Upravit...</translation> </message> - <message> - <source>Remove</source> - <translation>Odstranit</translation> - </message> <message> <source>Export...</source> <translation>Exportovat...</translation> @@ -40391,10 +40387,6 @@ Určuje, jak se chová zpětná klávesa (backspace) co se týče odsazování. <source>Group: </source> <translation>Skupina: </translation> </message> - <message> - <source>Add</source> - <translation>Přidat</translation> - </message> <message> <source>Revert Built-in</source> <translation>Vrátit zpět vestavěný</translation> @@ -44826,7 +44818,7 @@ Nainstalujte, prosím, alespoň jedno SDK.</translation> </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Alt+Meta+M</source> <translation>Alt+Meta+M</translation> @@ -48370,7 +48362,7 @@ nelze najít v cestě.</translation> </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Note text:</source> <translation>Text poznámky:</translation> diff --git a/share/qtcreator/translations/qtcreator_da.ts b/share/qtcreator/translations/qtcreator_da.ts index 5b3b918cb9c..485b2f6dcb3 100644 --- a/share/qtcreator/translations/qtcreator_da.ts +++ b/share/qtcreator/translations/qtcreator_da.ts @@ -3454,7 +3454,7 @@ F.eks., vil "Revision: 15" efterlade grenen ved revision 15.</translat </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Add Bookmark</source> <translation>Tilføj bogmærke</translation> @@ -33663,10 +33663,6 @@ Angiver hvordan backspace interagerer med indrykning. <source>Edit...</source> <translation>Rediger...</translation> </message> - <message> - <source>Remove</source> - <translation>Fjern</translation> - </message> <message> <source>Export...</source> <translation>Eksportér...</translation> diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index e031dd68f54..5651190fae9 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -13927,7 +13927,7 @@ Zum Beispiel bewirkt die Angabe "Revision: 15" dass der Branch auf Rev </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Bookmarks</source> <translation>Lesezeichen</translation> diff --git a/share/qtcreator/translations/qtcreator_es.ts b/share/qtcreator/translations/qtcreator_es.ts index a4dc26ed74f..623ffc7e0ae 100644 --- a/share/qtcreator/translations/qtcreator_es.ts +++ b/share/qtcreator/translations/qtcreator_es.ts @@ -85,7 +85,7 @@ </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Add Bookmark</source> <translation>Agregar marcador</translation> @@ -130,10 +130,6 @@ <source>You are going to delete a Folder which will also<br>remove its content. Are you sure you would like to continue?</source> <translation>Se dispone a eliminar un directorio y todo su contenido. ¿Está seguro?</translation> </message> - <message> - <source>New Folder</source> - <translation>Nuevo directorio</translation> - </message> <message> <source>Show Bookmark</source> <translation>Mostrar marcador</translation> @@ -9376,10 +9372,6 @@ The following encodings are likely to fit:</source> <source>Copy...</source> <translation type="unfinished"></translation> </message> - <message> - <source>Delete</source> - <translation type="unfinished">Suprimir</translation> - </message> <message> <source>Line in current document</source> <translation>Línea en el documento actual</translation> diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index 53e6fd3b7e4..20b0d641001 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -13722,7 +13722,7 @@ Par exemple, « Revision : 15 » laissera la branche à la révis </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Bookmarks</source> <translation>Signets</translation> diff --git a/share/qtcreator/translations/qtcreator_hr.ts b/share/qtcreator/translations/qtcreator_hr.ts index 1c4db2eb695..4a204546976 100644 --- a/share/qtcreator/translations/qtcreator_hr.ts +++ b/share/qtcreator/translations/qtcreator_hr.ts @@ -8805,7 +8805,7 @@ should a repository require SSH-authentication (see documentation on SSH and the </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Add Bookmark</source> <translation>Dodaj knjižnu oznaku</translation> @@ -15383,15 +15383,11 @@ Check the test environment.</source> </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Bookmark</source> <translation>Knjižna oznaka</translation> </message> - <message> - <source>Remove</source> - <translation>Ukloni</translation> - </message> <message> <source>Deleting a folder also removes its content.<br>Do you want to continue?</source> <translation>Brisanjem mape se uklanja i njen sadržaj.<br>Želiš li nastaviti?</translation> @@ -36253,7 +36249,7 @@ What do you want to do?</source> </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Show Bookmark</source> <translation>Prikaži knjižnu oznaku</translation> diff --git a/share/qtcreator/translations/qtcreator_hu.ts b/share/qtcreator/translations/qtcreator_hu.ts index 843d55c8525..9f29949c84d 100644 --- a/share/qtcreator/translations/qtcreator_hu.ts +++ b/share/qtcreator/translations/qtcreator_hu.ts @@ -77,7 +77,7 @@ </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Add Bookmark</source> <translation>Künyvjelző hozzáadása</translation> diff --git a/share/qtcreator/translations/qtcreator_it.ts b/share/qtcreator/translations/qtcreator_it.ts index 8e092a00d77..549bf8f77b7 100644 --- a/share/qtcreator/translations/qtcreator_it.ts +++ b/share/qtcreator/translations/qtcreator_it.ts @@ -93,7 +93,7 @@ </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Add Bookmark</source> <translation>Aggiungi un Segnalibro</translation> @@ -138,10 +138,6 @@ <source>You are going to delete a Folder which will also<br>remove its content. Are you sure you would like to continue?</source> <translation>Stai per cancellare una Cartella, questo cancellerà<br>anche il suo contenuto. Sei sicuro di volerlo fare?</translation> </message> - <message> - <source>New Folder</source> - <translation>Nuova Cartella</translation> - </message> <message> <source>Show Bookmark</source> <translation>Mostra il Segnalibro</translation> @@ -9219,10 +9215,6 @@ Queste codifiche dovrebbero andare bene:</translation> <source>Copy...</source> <translation type="unfinished"></translation> </message> - <message> - <source>Delete</source> - <translation type="unfinished">Elimina</translation> - </message> <message> <source>Line %1</source> <translation>Riga %1</translation> diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts index 42800af9390..4ee46da7e0c 100644 --- a/share/qtcreator/translations/qtcreator_ja.ts +++ b/share/qtcreator/translations/qtcreator_ja.ts @@ -7092,7 +7092,7 @@ SSH 認証が必要とされるリポジトリで使用されます(SSH の SSH_ </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Add Bookmark</source> <translation>ブックマークの追加</translation> @@ -12201,7 +12201,7 @@ in the system's browser for manual download.</source> </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Move Up</source> <translation>上に移動</translation> @@ -30728,7 +30728,7 @@ When a problem is detected, the application is interrupted and can be debugged.< </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Show Bookmark</source> <translation>ブックマークを開く</translation> @@ -30745,10 +30745,6 @@ When a problem is detected, the application is interrupted and can be debugged.< <source>Rename Bookmark</source> <translation>ブックマークの名前変更</translation> </message> - <message> - <source>Remove</source> - <translation>削除</translation> - </message> <message> <source>Deleting a folder also removes its content.<br>Do you want to continue?</source> <translation>フォルダを削除すると中身も削除されます。<br>続行しますか?</translation> diff --git a/share/qtcreator/translations/qtcreator_pl.ts b/share/qtcreator/translations/qtcreator_pl.ts index 27826c1aa99..8f2281e1f47 100644 --- a/share/qtcreator/translations/qtcreator_pl.ts +++ b/share/qtcreator/translations/qtcreator_pl.ts @@ -1301,9 +1301,6 @@ <source>Zoom:</source> <translation>Powiększenie:</translation> </message> -</context> -<context> - <name>QtC::Bookmarks</name> <message> <source>Add Bookmark</source> <translation>Dodaj zakładkę</translation> @@ -1872,7 +1869,7 @@ Przyczyna: %3</translation> </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Move Up</source> <translation>Przenieś do góry</translation> @@ -9431,7 +9428,7 @@ Nie zostanie zastosowane do białych znaków w komentarzach i ciągach znakowych </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Show Bookmark</source> <translation>Pokaż zakładkę</translation> @@ -19038,10 +19035,6 @@ Ustala, jak klawisz "Backspace" reaguje na wcięcia. <source>Edit...</source> <translation>Modyfikuj...</translation> </message> - <message> - <source>Remove</source> - <translation>Usuń</translation> - </message> <message> <source>Export...</source> <translation>Eksportuj...</translation> @@ -20027,7 +20020,7 @@ Wersje Qt można dodać w: Opcje > Budowanie i uruchamianie > Wersje Qt.</ </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Alt+Meta+M</source> <translation>Alt+Meta+M</translation> @@ -23455,7 +23448,7 @@ Więcej informacji w dokumentacji "Checking Code Syntax".</translation </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Note text:</source> <translation>Tekst notatki:</translation> diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index 6e06d08ee18..2d0de058a66 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -4874,7 +4874,7 @@ For example, "Revision: 15" will leave the branch at revision 15.</sou </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Add Bookmark</source> <translation>Добавить закладку</translation> @@ -43005,10 +43005,6 @@ Specifies how backspace interacts with indentation. <source>Edit...</source> <translation>Изменить...</translation> </message> - <message> - <source>Remove</source> - <translation>Удалить</translation> - </message> <message> <source>Export...</source> <translation>Экспорт...</translation> diff --git a/share/qtcreator/translations/qtcreator_sl.ts b/share/qtcreator/translations/qtcreator_sl.ts index b9ce29e5633..97b4fe1b6cc 100644 --- a/share/qtcreator/translations/qtcreator_sl.ts +++ b/share/qtcreator/translations/qtcreator_sl.ts @@ -102,7 +102,7 @@ </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Add Bookmark</source> <translation>Dodaj zaznamek</translation> @@ -18441,14 +18441,6 @@ Potreben je Qt 4.7.4 ali novejši in nabor komponent za vašo različico Qt.</tr <source>Group: </source> <translation>Skupina: </translation> </message> - <message> - <source>Add</source> - <translation>Dodaj</translation> - </message> - <message> - <source>Remove</source> - <translation>Odstrani</translation> - </message> <message> <source>Revert Built-in</source> <translation>Povrni vgrajene</translation> diff --git a/share/qtcreator/translations/qtcreator_uk.ts b/share/qtcreator/translations/qtcreator_uk.ts index 87518bce072..e0c0aefa6d2 100644 --- a/share/qtcreator/translations/qtcreator_uk.ts +++ b/share/qtcreator/translations/qtcreator_uk.ts @@ -795,7 +795,7 @@ Local pulls are not applied to the master branch.</source> </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Add Bookmark</source> <translation>Додати закладку</translation> @@ -852,10 +852,6 @@ Local pulls are not applied to the master branch.</source> <source>Rename Bookmark</source> <translation>Перейменувати закладку</translation> </message> - <message> - <source>Add</source> - <translation type="vanished">Додати</translation> - </message> <message> <source>Move Up</source> <translation>Пересунути вгору</translation> @@ -21652,10 +21648,6 @@ Specifies how backspace interacts with indentation. <source>Edit...</source> <translation>Редагувати...</translation> </message> - <message> - <source>Remove</source> - <translation>Видалити</translation> - </message> <message> <source>Export...</source> <translation>Експортувати...</translation> @@ -25113,7 +25105,7 @@ To add the Qt versions, select Options > Build & Run > Qt Versions.</s </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Alt+Meta+M</source> <translation>Alt+Meta+M</translation> @@ -28986,7 +28978,7 @@ cannot be found in the path.</source> </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Note text:</source> <translation>Текст примітки:</translation> diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 5d358e80ac5..9eb7428ef59 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -5199,7 +5199,7 @@ Local pulls are not applied to the master branch.</source> </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Bookmarks</source> <translation>书签</translation> diff --git a/share/qtcreator/translations/qtcreator_zh_TW.ts b/share/qtcreator/translations/qtcreator_zh_TW.ts index 587948f7c94..500e7548e81 100644 --- a/share/qtcreator/translations/qtcreator_zh_TW.ts +++ b/share/qtcreator/translations/qtcreator_zh_TW.ts @@ -32,7 +32,7 @@ </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Add Bookmark</source> <translation>新增書籤</translation> @@ -25150,10 +25150,6 @@ Specifies how backspace interacts with indentation. <source>Edit...</source> <translation>編輯...</translation> </message> - <message> - <source>Remove</source> - <translation>移除</translation> - </message> <message> <source>Export...</source> <translation>匯出...</translation> @@ -25244,10 +25240,6 @@ Specifies how backspace interacts with indentation. <source>Group: </source> <translation>群組:</translation> </message> - <message> - <source>Add</source> - <translation>新增</translation> - </message> <message> <source>Revert Built-in</source> <translation>回復到內建</translation> @@ -28363,7 +28355,7 @@ Please choose a valid package name for your application (e.g. "org.example. </message> </context> <context> - <name>QtC::Bookmarks</name> + <name>QtC::TextEditor</name> <message> <source>Alt+Meta+M</source> <translation type="unfinished"></translation> From e4ec7f0d142c64b587edb0e352cd589429645a31 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Date: Fri, 15 Sep 2023 01:22:24 +0900 Subject: [PATCH 1356/1777] Markdown: Enable action buttons with unselected text Add appropriate indicators and adjust cursor position. Change-Id: Ia4e3027899e0cedd83e94327bbeb0a2c4e518fdc Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/texteditor/markdowneditor.cpp | 51 +++++++++++++++-------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/src/plugins/texteditor/markdowneditor.cpp b/src/plugins/texteditor/markdowneditor.cpp index 43face29777..22683d0c99c 100644 --- a/src/plugins/texteditor/markdowneditor.cpp +++ b/src/plugins/texteditor/markdowneditor.cpp @@ -110,8 +110,13 @@ public: button->setFont([button]{ auto f = button->font(); f.setItalic(true); return f; }()); button->setToolTip(Tr::tr("Emphasis")); connect(button, &QToolButton::clicked, this, [this] { - triggerFormatingAction([](QString *selectedText) { - *selectedText = QStringLiteral("*%1*").arg(*selectedText); + triggerFormatingAction([](QString *selectedText, int *cursorOffset) { + if (selectedText->isEmpty()) { + *selectedText = QStringLiteral("**"); + *cursorOffset = -1; + } else { + *selectedText = QStringLiteral("*%1*").arg(*selectedText); + } }); }); m_markDownButtons.append(button); @@ -120,8 +125,13 @@ public: button->setFont([button]{ auto f = button->font(); f.setBold(true); return f; }()); button->setToolTip(Tr::tr("Strong")); connect(button, &QToolButton::clicked, this, [this] { - triggerFormatingAction([](QString *selectedText) { - *selectedText = QStringLiteral("**%1**").arg(*selectedText); + triggerFormatingAction([](QString *selectedText, int *cursorOffset) { + if (selectedText->isEmpty()) { + *selectedText = QStringLiteral("****"); + *cursorOffset = -2; + } else { + *selectedText = QStringLiteral("**%1**").arg(*selectedText); + } }); }); m_markDownButtons.append(button); @@ -129,8 +139,13 @@ public: button->setText("`"); button->setToolTip(Tr::tr("Inline Code")); connect(button, &QToolButton::clicked, this, [this] { - triggerFormatingAction([](QString *selectedText) { - *selectedText = QStringLiteral("`%1`").arg(*selectedText); + triggerFormatingAction([](QString *selectedText, int *cursorOffset) { + if (selectedText->isEmpty()) { + *selectedText = QStringLiteral("``"); + *cursorOffset = -1; + } else { + *selectedText = QStringLiteral("`%1`").arg(*selectedText); + } }); }); m_markDownButtons.append(button); @@ -139,23 +154,22 @@ public: button->setToolTip(Tr::tr("Hyper Link")); connect(button, &QToolButton::clicked, this, [this] { triggerFormatingAction([](QString *selectedText, int *cursorOffset, int *selectionLength) { - *selectedText = QStringLiteral("[%1](https://)").arg(*selectedText); - *cursorOffset = -1; - *selectionLength = -8; + if (selectedText->isEmpty()) { + *selectedText = QStringLiteral("[](https://)"); + *cursorOffset = -11; // ](https://) is 11 chars + } else { + *selectedText = QStringLiteral("[%1](https://)").arg(*selectedText); + *cursorOffset = -1; + *selectionLength = -8; // https:// is 8 chars + } }); }); m_markDownButtons.append(button); for (auto button : m_markDownButtons) { - button->setEnabled(!m_textEditorWidget->selectedText().isEmpty()); // do not call setVisible(true) at this point, this destroys the hover effect on macOS if (!showEditor) button->setVisible(false); } - connect(m_textEditorWidget, &QPlainTextEdit::copyAvailable, [this](bool yes) { - for (auto button : m_markDownButtons) { - button->setEnabled(yes); - } - }); auto swapViews = new QToolButton; swapViews->setText(Tr::tr("Swap Views")); @@ -362,11 +376,12 @@ public: } private: - void triggerFormatingAction(std::function<void(QString *selectedText)> action) + void triggerFormatingAction(std::function<void(QString *selectedText, int *cursorOffset)> action) { auto formattedText = m_textEditorWidget->selectedText(); - action(&formattedText); - format(formattedText); + int cursorOffset = 0; + action(&formattedText, &cursorOffset); + format(formattedText, cursorOffset); } void triggerFormatingAction(std::function<void(QString *selectedText, int *cursorOffset, int *selectionLength)> action) { From 23828a1d9c3b4b7cedec8c65a4797728a5d02505 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 28 Sep 2023 09:13:20 +0200 Subject: [PATCH 1357/1777] SquishTests: Adapt to changed behavior We nowadays use pragma once by default for include guards. Enhance former check to be able to check for both later on. Change-Id: I0955158f53e056fed2e3751cf42f51855ff95515 Reviewed-by: David Schulz <david.schulz@qt.io> --- tests/system/suite_general/tst_new_class/test.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/system/suite_general/tst_new_class/test.py b/tests/system/suite_general/tst_new_class/test.py index d63c6d4a582..d45b5918e08 100644 --- a/tests/system/suite_general/tst_new_class/test.py +++ b/tests/system/suite_general/tst_new_class/test.py @@ -35,10 +35,18 @@ def main(): editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") editorText = str(editor.plainText) includeGuard = newClassName.upper().replace(".", "_") - test.verify("#ifndef " + includeGuard in editorText, - "Include guard check in header file?") - test.verify("#define " + includeGuard in editorText, - "Include guard definition in header file?") + + guardCount = 0 + if "#pragma once" in editorText: + guardCount += 1 + test.passes("Include guard in header file.") + if "#ifndef " + includeGuard in editorText: + guardCount += 1 + test.passes("Include guard check in header file.") + test.verify("#define " + includeGuard in editorText, + "Include guard definition in header file.") + test.compare(guardCount, 1, "Either pragma once or conventional include guard present.") + test.verify("class " + newClassName in editorText, "Class definition in header file?") test.verify(" " + newClassName + "();" in editorText, From 80633a59aabca94e52e473837164203041e72c6e Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 5 Sep 2023 11:14:10 +0200 Subject: [PATCH 1358/1777] LanguageClient: support additional goto targets in symbol support Allow to follow to the symbol definition as well as to the type definition for the symbol under the cursor position. Change-Id: I8ff50b33a1e739f81b0832b1b28ffc525e1f7177 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/clangcodemodel/clangdclient.cpp | 6 +- .../clangcodemodel/clangdfindreferences.cpp | 6 +- .../clangcodemodel/clangdfollowsymbol.cpp | 6 +- src/plugins/cppeditor/cppeditorconstants.h | 2 - src/plugins/cppeditor/cppeditorplugin.cpp | 30 +---- src/plugins/cppeditor/cppeditorwidget.cpp | 40 +++--- src/plugins/cppeditor/cppeditorwidget.h | 6 +- src/plugins/languageclient/client.cpp | 10 +- src/plugins/languageclient/client.h | 5 +- .../languageclient/languageclientmanager.cpp | 20 ++- .../languageclientsymbolsupport.cpp | 117 ++++++++++++++---- .../languageclientsymbolsupport.h | 9 +- src/plugins/qmljseditor/qmljseditor.cpp | 6 +- .../texteditor/plaintexteditorfactory.cpp | 3 +- src/plugins/texteditor/texteditor.cpp | 72 ++++++++--- src/plugins/texteditor/texteditor.h | 10 +- .../texteditor/texteditoractionhandler.cpp | 12 ++ .../texteditor/texteditoractionhandler.h | 9 +- src/plugins/texteditor/texteditorconstants.h | 2 + 19 files changed, 265 insertions(+), 106 deletions(-) diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 5631f9fbc3c..87f3e77c5d2 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -1013,7 +1013,11 @@ void ClangdClient::followSymbol(TextDocument *document, const QTextCursor adjustedCursor = d->adjustedCursor(cursor, document); if (followTo == FollowTo::SymbolDef && !resolveTarget) { - symbolSupport().findLinkAt(document, adjustedCursor, callback, false); + symbolSupport().findLinkAt(document, + adjustedCursor, + callback, + false, + LanguageClient::LinkTarget::SymbolDef); return; } diff --git a/src/plugins/clangcodemodel/clangdfindreferences.cpp b/src/plugins/clangcodemodel/clangdfindreferences.cpp index 24175a82504..c3ba6c2b8f6 100644 --- a/src/plugins/clangcodemodel/clangdfindreferences.cpp +++ b/src/plugins/clangcodemodel/clangdfindreferences.cpp @@ -714,7 +714,11 @@ void ClangdFindLocalReferences::Private::findDefinition() if (sentinel) getDefinitionAst(l); }; - client()->symbolSupport().findLinkAt(document, cursor, linkHandler, true); + client()->symbolSupport().findLinkAt(document, + cursor, + linkHandler, + true, + LanguageClient::LinkTarget::SymbolDef); } void ClangdFindLocalReferences::Private::getDefinitionAst(const Link &link) diff --git a/src/plugins/clangcodemodel/clangdfollowsymbol.cpp b/src/plugins/clangcodemodel/clangdfollowsymbol.cpp index 730a3fdd375..ee56e3f4c75 100644 --- a/src/plugins/clangcodemodel/clangdfollowsymbol.cpp +++ b/src/plugins/clangcodemodel/clangdfollowsymbol.cpp @@ -154,7 +154,11 @@ ClangdFollowSymbol::ClangdFollowSymbol(ClangdClient *client, const QTextCursor & if (self->d->cursorNode) self->d->handleGotoDefinitionResult(); }; - client->symbolSupport().findLinkAt(document, cursor, std::move(gotoDefCallback), true); + client->symbolSupport().findLinkAt(document, + cursor, + std::move(gotoDefCallback), + true, + LanguageClient::LinkTarget::SymbolDef); const auto astHandler = [self = QPointer(this)](const ClangdAstNode &ast, const MessageId &) { qCDebug(clangdLog) << "received ast response for cursor"; diff --git a/src/plugins/cppeditor/cppeditorconstants.h b/src/plugins/cppeditor/cppeditorconstants.h index ee8ec86a27e..3e3c02dc434 100644 --- a/src/plugins/cppeditor/cppeditorconstants.h +++ b/src/plugins/cppeditor/cppeditorconstants.h @@ -16,8 +16,6 @@ const char G_GLOBAL[] = "CppEditor.GGlobal"; const char CPPEDITOR_ID[] = "CppEditor.C++Editor"; const char SWITCH_DECLARATION_DEFINITION[] = "CppEditor.SwitchDeclarationDefinition"; const char OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT[] = "CppEditor.OpenDeclarationDefinitionInNextSplit"; -const char FOLLOW_SYMBOL_TO_TYPE[] = "TextEditor.FollowSymbolToType"; -const char FOLLOW_SYMBOL_TO_TYPE_IN_NEXT_SPLIT[] = "TextEditor.FollowSymbolToTypeInNextSplit"; const char OPEN_PREPROCESSOR_DIALOG[] = "CppEditor.OpenPreprocessorDialog"; const char MULTIPLE_PARSE_CONTEXTS_AVAILABLE[] = "CppEditor.MultipleParseContextsAvailable"; const char M_REFACTORING_MENU_INSERTION_POINT[] = "CppEditor.RefactorGroup"; diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 6d4adb3ca86..13d62e4cee2 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -152,6 +152,7 @@ public: | TextEditorActionHandler::UnCommentSelection | TextEditorActionHandler::UnCollapseAll | TextEditorActionHandler::FollowSymbolUnderCursor + | TextEditorActionHandler::FollowTypeUnderCursor | TextEditorActionHandler::RenameSymbol | TextEditorActionHandler::FindUsage); } @@ -336,31 +337,10 @@ void CppEditorPlugin::addPerSymbolActions() touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); addSymbolActionToMenus(ActionManager::command( TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT)); - - QAction * const followSymbolToType = new QAction(Tr::tr("Follow Symbol Under Cursor to Type"), - this); - cmd = ActionManager::registerAction(followSymbolToType, Constants::FOLLOW_SYMBOL_TO_TYPE, - context, true); - cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Shift+F2"))); - connect(followSymbolToType, &QAction::triggered, this, []{ - if (CppEditorWidget *editorWidget = currentCppEditorWidget()) - editorWidget->followSymbolToType(false); - }); - addSymbolActionToMenus(cmd); - - QAction * const followSymbolToTypeInNextSplit = - new QAction(Tr::tr("Follow Symbol to Type in Next Split"), this); - cmd = ActionManager::registerAction(followSymbolToTypeInNextSplit, - Constants::FOLLOW_SYMBOL_TO_TYPE_IN_NEXT_SPLIT, - context, true); - cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() - ? Tr::tr("Meta+E, Ctrl+Shift+F2") - : Tr::tr("Ctrl+E, Ctrl+Shift+F2"))); - connect(followSymbolToTypeInNextSplit, &QAction::triggered, this, []{ - if (CppEditorWidget *editorWidget = currentCppEditorWidget()) - editorWidget->followSymbolToType(true); - }); - addSymbolActionToMenus(cmd); + addSymbolActionToMenus(ActionManager::command( + TextEditor::Constants::FOLLOW_SYMBOL_TO_TYPE)); + addSymbolActionToMenus(ActionManager::command( + TextEditor::Constants::FOLLOW_SYMBOL_TO_TYPE_IN_NEXT_SPLIT)); QAction * const switchDeclarationDefinition = new QAction(Tr::tr("Switch Between Function Declaration/Definition"), this); diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index 43c6365c89c..7559e028e2e 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -893,20 +893,6 @@ void CppEditorWidget::switchDeclarationDefinition(bool inNextSplit) CppModelManager::switchDeclDef(cursor, std::move(callback)); } -void CppEditorWidget::followSymbolToType(bool inNextSplit) -{ - if (!CppModelManager::instance()) - return; - - const CursorInEditor cursor(textCursor(), textDocument()->filePath(), this, textDocument()); - const auto callback = [self = QPointer(this), - split = inNextSplit != alwaysOpenLinksInNextSplit()](const Link &link) { - if (self && link.hasValidTarget()) - self->openLink(link, split); - }; - CppModelManager::followSymbolToType(cursor, callback, inNextSplit); -} - bool CppEditorWidget::followUrl(const QTextCursor &cursor, const Utils::LinkHandler &processLinkCallback) { @@ -997,11 +983,27 @@ void CppEditorWidget::findLinkAt(const QTextCursor &cursor, } callback(link); }; - CppModelManager::followSymbol( - CursorInEditor{cursor, filePath, this, textDocument()}, - callbackWrapper, - resolveTarget, - inNextSplit); + CppModelManager::followSymbol(CursorInEditor{cursor, filePath, this, textDocument()}, + callbackWrapper, + resolveTarget, + inNextSplit); +} + +void CppEditorWidget::findTypeAt(const QTextCursor &cursor, + const Utils::LinkHandler &processLinkCallback, + bool resolveTarget, + bool inNextSplit) +{ + if (!CppModelManager::instance()) + return; + + const CursorInEditor cursorInEditor(cursor, textDocument()->filePath(), this, textDocument()); + const auto callback = [self = QPointer(this), + split = inNextSplit != alwaysOpenLinksInNextSplit()](const Link &link) { + if (self && link.hasValidTarget()) + self->openLink(link, split); + }; + CppModelManager::followSymbolToType(cursorInEditor, callback, inNextSplit); } unsigned CppEditorWidget::documentRevision() const diff --git a/src/plugins/cppeditor/cppeditorwidget.h b/src/plugins/cppeditor/cppeditorwidget.h index a379c5f55b4..58d40c8a592 100644 --- a/src/plugins/cppeditor/cppeditorwidget.h +++ b/src/plugins/cppeditor/cppeditorwidget.h @@ -57,7 +57,6 @@ public: void selectAll() override; void switchDeclarationDefinition(bool inNextSplit); - void followSymbolToType(bool inNextSplit); void showPreProcessorWidget(); void findUsages() override; @@ -105,6 +104,11 @@ protected: bool resolveTarget = true, bool inNextSplit = false) override; + void findTypeAt(const QTextCursor &cursor, + const Utils::LinkHandler &processLinkCallback, + bool resolveTarget = true, + bool inNextSplit = false) override; + void slotCodeStyleSettingsChanged(const QVariant &) override; private: diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 13f51d2cde9..c0922538c3f 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -936,6 +936,10 @@ void Client::activateEditor(Core::IEditor *editor) optionalActions |= TextEditor::TextEditorActionHandler::FindUsage; if (symbolSupport().supportsRename(widget->textDocument())) optionalActions |= TextEditor::TextEditorActionHandler::RenameSymbol; + if (symbolSupport().supportsFindLink(widget->textDocument(), LinkTarget::SymbolDef)) + optionalActions |= TextEditor::TextEditorActionHandler::FollowSymbolUnderCursor; + if (symbolSupport().supportsFindLink(widget->textDocument(), LinkTarget::SymbolTypeDef)) + optionalActions |= TextEditor::TextEditorActionHandler::FollowTypeUnderCursor; if (CallHierarchyFactory::supportsCallHierarchy(this, textEditor->document())) optionalActions |= TextEditor::TextEditorActionHandler::CallHierarchy; widget->setOptionalActions(optionalActions); @@ -1306,7 +1310,8 @@ SymbolSupport &Client::symbolSupport() void Client::findLinkAt(TextEditor::TextDocument *document, const QTextCursor &cursor, Utils::LinkHandler callback, - const bool resolveTarget) + const bool resolveTarget, + LinkTarget target) { if (d->m_runningFindLinkRequest.isValid()) cancelRequest(d->m_runningFindLinkRequest); @@ -1317,7 +1322,8 @@ void Client::findLinkAt(TextEditor::TextDocument *document, d->m_runningFindLinkRequest = {}; callback(link); }, - resolveTarget); + resolveTarget, + target); } void Client::requestCodeActions(const LanguageServerProtocol::DocumentUri &uri, diff --git a/src/plugins/languageclient/client.h b/src/plugins/languageclient/client.h index 8aede4b249d..da8c8166644 100644 --- a/src/plugins/languageclient/client.h +++ b/src/plugins/languageclient/client.h @@ -4,6 +4,7 @@ #pragma once #include "languageclient_global.h" +#include "languageclientsymbolsupport.h" #include "languageclientutils.h" #include "semantichighlightsupport.h" @@ -45,7 +46,6 @@ class LanguageClientOutlineItem; class LanguageClientQuickFixProvider; class LanguageFilter; class ProgressManager; -class SymbolSupport; class LANGUAGECLIENT_EXPORT Client : public QObject { @@ -157,7 +157,8 @@ public: void findLinkAt(TextEditor::TextDocument *document, const QTextCursor &cursor, Utils::LinkHandler callback, - const bool resolveTarget); + const bool resolveTarget, + LinkTarget target); DocumentSymbolCache *documentSymbolCache(); HoverHandler *hoverHandler(); QList<LanguageServerProtocol::Diagnostic> diagnosticsAt(const Utils::FilePath &filePath, diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index fcfc7c49fa7..c05b84db4aa 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -479,8 +479,24 @@ void LanguageClientManager::editorOpened(Core::IEditor *editor) connect(widget, &TextEditorWidget::requestLinkAt, this, [document = textEditor->textDocument()] (const QTextCursor &cursor, const Utils::LinkHandler &callback, bool resolveTarget) { - if (auto client = clientForDocument(document)) - client->findLinkAt(document, cursor, callback, resolveTarget); + if (auto client = clientForDocument(document)) { + client->findLinkAt(document, + cursor, + callback, + resolveTarget, + LinkTarget::SymbolDef); + } + }); + connect(widget, &TextEditorWidget::requestTypeAt, this, + [document = textEditor->textDocument()] + (const QTextCursor &cursor, const Utils::LinkHandler &callback, bool resolveTarget) { + if (auto client = clientForDocument(document)) { + client->findLinkAt(document, + cursor, + callback, + resolveTarget, + LinkTarget::SymbolTypeDef); + } }); connect(widget, &TextEditorWidget::requestUsages, this, [document = textEditor->textDocument()](const QTextCursor &cursor) { diff --git a/src/plugins/languageclient/languageclientsymbolsupport.cpp b/src/plugins/languageclient/languageclientsymbolsupport.cpp index b6ac1bdb307..268bd391e81 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.cpp +++ b/src/plugins/languageclient/languageclientsymbolsupport.cpp @@ -77,15 +77,14 @@ SymbolSupport::SymbolSupport(Client *client) {} template<typename Request> -static void sendTextDocumentPositionParamsRequest(Client *client, - const Request &request, - const DynamicCapabilities &dynamicCapabilities, - const ServerCapabilities &serverCapability) +static MessageId sendTextDocumentPositionParamsRequest(Client *client, const Request &request) { if (!request.isValid(nullptr)) - return; + return {}; const DocumentUri uri = request.params().value().textDocument().uri(); const bool supportedFile = client->isSupportedUri(uri); + const DynamicCapabilities dynamicCapabilities = client->dynamicCapabilities(); + const ServerCapabilities serverCapability = client->capabilities(); bool sendMessage = dynamicCapabilities.isRegistered(Request::methodName).value_or(false); if (sendMessage) { const TextDocumentRegistrationOptions option( @@ -102,14 +101,17 @@ static void sendTextDocumentPositionParamsRequest(Client *client, if (sendMessage && std::holds_alternative<bool>(*provider)) sendMessage = std::get<bool>(*provider); } - if (sendMessage) + if (sendMessage) { client->sendMessage(request); + return request.id(); + } + return {}; } -static void handleGotoDefinitionResponse(const GotoDefinitionRequest::Response &response, - Utils::LinkHandler callback, - std::optional<Utils::Link> linkUnderCursor, - const Client *client) +static void handleGotoResponse(const GotoDefinitionRequest::Response &response, + Utils::LinkHandler callback, + std::optional<Utils::Link> linkUnderCursor, + const Client *client) { if (std::optional<GotoResult> result = response.result()) { if (std::holds_alternative<std::nullptr_t>(*result)) { @@ -137,14 +139,69 @@ static TextDocumentPositionParams generateDocPosParams(TextEditor::TextDocument return TextDocumentPositionParams(documentId, pos); } +template<typename Request> +static MessageId sendGotoRequest(TextEditor::TextDocument *document, + const QTextCursor &cursor, + Utils::LinkHandler callback, + Client *client, + std::optional<Utils::Link> linkUnderCursor) +{ + Request request(generateDocPosParams(document, cursor, client)); + request.setResponseCallback([callback, linkUnderCursor, client]( + const GotoDefinitionRequest::Response &response) { + handleGotoResponse(response, callback, linkUnderCursor, client); + }); + return sendTextDocumentPositionParamsRequest(client, request); + return request.id(); +} + +bool SymbolSupport::supportsFindLink(TextEditor::TextDocument *document, LinkTarget target) const +{ + const DocumentUri uri = m_client->hostPathToServerUri(document->filePath()); + const DynamicCapabilities dynamicCapabilities = m_client->dynamicCapabilities(); + const ServerCapabilities serverCapability = m_client->capabilities(); + QString methodName; + std::optional<std::variant<bool, ServerCapabilities::RegistrationOptions>> provider; + switch (target) { + case LinkTarget::SymbolDef: + methodName = GotoDefinitionRequest::methodName; + provider = serverCapability.definitionProvider(); + break; + case LinkTarget::SymbolTypeDef: + methodName = GotoTypeDefinitionRequest::methodName; + provider = serverCapability.typeDefinitionProvider(); + break; + case LinkTarget::SymbolImplementation: + methodName = GotoImplementationRequest::methodName; + provider = serverCapability.implementationProvider(); + break; + } + if (methodName.isEmpty()) + return false; + bool supported = dynamicCapabilities.isRegistered(methodName).value_or(false); + if (supported) { + const TextDocumentRegistrationOptions option(dynamicCapabilities.option(methodName)); + if (option.isValid()) + supported = option.filterApplies( + Utils::FilePath::fromString(QUrl(uri).adjusted(QUrl::PreferLocalFile).toString())); + else + supported = m_client->isSupportedUri(uri); + } else { + supported = provider.has_value(); + if (supported && std::holds_alternative<bool>(*provider)) + supported = std::get<bool>(*provider); + } + return supported; +} + MessageId SymbolSupport::findLinkAt(TextEditor::TextDocument *document, const QTextCursor &cursor, Utils::LinkHandler callback, - const bool resolveTarget) + const bool resolveTarget, + const LinkTarget target) { if (!m_client->reachable()) return {}; - GotoDefinitionRequest request(generateDocPosParams(document, cursor, m_client)); std::optional<Utils::Link> linkUnderCursor; if (!resolveTarget) { QTextCursor linkCursor = cursor; @@ -156,16 +213,29 @@ MessageId SymbolSupport::findLinkAt(TextEditor::TextDocument *document, link.linkTextEnd = linkCursor.selectionEnd(); linkUnderCursor = link; } - request.setResponseCallback([callback, linkUnderCursor, client = m_client]( - const GotoDefinitionRequest::Response &response) { - handleGotoDefinitionResponse(response, callback, linkUnderCursor, client); - }); - sendTextDocumentPositionParamsRequest(m_client, - request, - m_client->dynamicCapabilities(), - m_client->capabilities()); - return request.id(); + const TextDocumentPositionParams params = generateDocPosParams(document, cursor, m_client); + switch (target) { + case LinkTarget::SymbolDef: + return sendGotoRequest<GotoDefinitionRequest>(document, + cursor, + callback, + m_client, + linkUnderCursor); + case LinkTarget::SymbolTypeDef: + return sendGotoRequest<GotoTypeDefinitionRequest>(document, + cursor, + callback, + m_client, + linkUnderCursor); + case LinkTarget::SymbolImplementation: + return sendGotoRequest<GotoImplementationRequest>(document, + cursor, + callback, + m_client, + linkUnderCursor); + } + return {}; } bool SymbolSupport::supportsFindUsages(TextEditor::TextDocument *document) const @@ -317,10 +387,7 @@ std::optional<MessageId> SymbolSupport::findUsages(TextEditor::TextDocument *doc handleFindReferencesResponse(response, wordUnderCursor, handler); }); - sendTextDocumentPositionParamsRequest(m_client, - request, - m_client->dynamicCapabilities(), - m_client->capabilities()); + sendTextDocumentPositionParamsRequest(m_client, request); return request.id(); } diff --git a/src/plugins/languageclient/languageclientsymbolsupport.h b/src/plugins/languageclient/languageclientsymbolsupport.h index 54666e7b1f9..b3c7f4edb50 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.h +++ b/src/plugins/languageclient/languageclientsymbolsupport.h @@ -19,16 +19,19 @@ namespace LanguageServerProtocol { class MessageId; } namespace LanguageClient { class Client; +enum class LinkTarget { SymbolDef, SymbolTypeDef, SymbolImplementation }; class LANGUAGECLIENT_EXPORT SymbolSupport : public QObject { public: explicit SymbolSupport(Client *client); + bool supportsFindLink(TextEditor::TextDocument *document, LinkTarget target) const; LanguageServerProtocol::MessageId findLinkAt(TextEditor::TextDocument *document, - const QTextCursor &cursor, - Utils::LinkHandler callback, - const bool resolveTarget); + const QTextCursor &cursor, + Utils::LinkHandler callback, + const bool resolveTarget, + const LinkTarget target); bool supportsFindUsages(TextEditor::TextDocument *document) const; using ResultHandler = std::function<void(const QList<LanguageServerProtocol::Location> &)>; diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index e6ceb513072..69948be3835 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -757,7 +757,11 @@ void QmlJSEditorWidget::findLinkAt(const QTextCursor &cursor, bool /*inNextSplit*/) { if (auto client = getQmllsClient(textDocument()->filePath())) { - client->findLinkAt(textDocument(), cursor, processLinkCallback, resolveTarget); + client->findLinkAt(textDocument(), + cursor, + processLinkCallback, + resolveTarget, + LanguageClient::LinkTarget::SymbolDef); return; } diff --git a/src/plugins/texteditor/plaintexteditorfactory.cpp b/src/plugins/texteditor/plaintexteditorfactory.cpp index a28f05e38e2..fd6b8d96b9b 100644 --- a/src/plugins/texteditor/plaintexteditorfactory.cpp +++ b/src/plugins/texteditor/plaintexteditorfactory.cpp @@ -48,8 +48,7 @@ PlainTextEditorFactory::PlainTextEditorFactory() setEditorActionHandlers(TextEditorActionHandler::Format | TextEditorActionHandler::UnCommentSelection | - TextEditorActionHandler::UnCollapseAll | - TextEditorActionHandler::FollowSymbolUnderCursor); + TextEditorActionHandler::UnCollapseAll); } PlainTextEditorFactory *PlainTextEditorFactory::instance() diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 66d5617f363..33e6cd295ab 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -717,6 +717,7 @@ public: KSyntaxHighlighting::Definition currentDefinition(); void rememberCurrentSyntaxDefinition(); void openLinkUnderCursor(bool openInNextSplit); + void openTypeUnderCursor(bool openInNextSplit); qreal charWidth() const; public: @@ -2446,6 +2447,16 @@ void TextEditorWidget::openLinkUnderCursorInNextSplit() d->openLinkUnderCursor(!alwaysOpenLinksInNextSplit()); } +void TextEditorWidget::openTypeUnderCursor() +{ + d->openTypeUnderCursor(alwaysOpenLinksInNextSplit()); +} + +void TextEditorWidget::openTypeUnderCursorInNextSplit() +{ + d->openTypeUnderCursor(!alwaysOpenLinksInNextSplit()); +} + void TextEditorWidget::findUsages() { emit requestUsages(textCursor()); @@ -3642,11 +3653,26 @@ void TextEditorWidgetPrivate::rememberCurrentSyntaxDefinition() void TextEditorWidgetPrivate::openLinkUnderCursor(bool openInNextSplit) { - q->findLinkAt(q->textCursor(), - [openInNextSplit, self = QPointer<TextEditorWidget>(q)](const Link &symbolLink) { - if (self) - self->openLink(symbolLink, openInNextSplit); - }, true, openInNextSplit); + q->findLinkAt( + q->textCursor(), + [openInNextSplit, self = QPointer<TextEditorWidget>(q)](const Link &symbolLink) { + if (self) + self->openLink(symbolLink, openInNextSplit); + }, + true, + openInNextSplit); +} + +void TextEditorWidgetPrivate::openTypeUnderCursor(bool openInNextSplit) +{ + q->findTypeAt( + q->textCursor(), + [openInNextSplit, self = QPointer<TextEditorWidget>(q)](const Link &symbolLink) { + if (self) + self->openLink(symbolLink, openInNextSplit); + }, + true, + openInNextSplit); } qreal TextEditorWidgetPrivate::charWidth() const @@ -6682,6 +6708,14 @@ void TextEditorWidget::findLinkAt(const QTextCursor &cursor, emit requestLinkAt(cursor, callback, resolveTarget, inNextSplit); } +void TextEditorWidget::findTypeAt(const QTextCursor &cursor, + const Utils::LinkHandler &callback, + bool resolveTarget, + bool inNextSplit) +{ + emit requestTypeAt(cursor, callback, resolveTarget, inNextSplit); +} + bool TextEditorWidget::openLink(const Utils::Link &link, bool inNextSplit) { #ifdef WITH_TESTS @@ -8394,20 +8428,30 @@ void TextEditorWidget::setupFallBackEditor(Id id) void TextEditorWidget::appendStandardContextMenuActions(QMenu *menu) { + if (optionalActions() & TextEditorActionHandler::FollowSymbolUnderCursor) { + const auto action = ActionManager::command(Constants::FOLLOW_SYMBOL_UNDER_CURSOR)->action(); + if (!menu->actions().contains(action)) + menu->addAction(action); + } + if (optionalActions() & TextEditorActionHandler::FollowTypeUnderCursor) { + const auto action = ActionManager::command(Constants::FOLLOW_SYMBOL_TO_TYPE)->action(); + if (!menu->actions().contains(action)) + menu->addAction(action); + } if (optionalActions() & TextEditorActionHandler::FindUsage) { - const auto findUsage = ActionManager::command(Constants::FIND_USAGES)->action(); - if (!menu->actions().contains(findUsage)) - menu->addAction(findUsage); + const auto action = ActionManager::command(Constants::FIND_USAGES)->action(); + if (!menu->actions().contains(action)) + menu->addAction(action); } if (optionalActions() & TextEditorActionHandler::RenameSymbol) { - const auto renameSymbol = ActionManager::command(Constants::RENAME_SYMBOL)->action(); - if (!menu->actions().contains(renameSymbol)) - menu->addAction(renameSymbol); + const auto action = ActionManager::command(Constants::RENAME_SYMBOL)->action(); + if (!menu->actions().contains(action)) + menu->addAction(action); } if (optionalActions() & TextEditorActionHandler::CallHierarchy) { - const auto callHierarchy = ActionManager::command(Constants::OPEN_CALL_HIERARCHY)->action(); - if (!menu->actions().contains(callHierarchy)) - menu->addAction(callHierarchy); + const auto action = ActionManager::command(Constants::OPEN_CALL_HIERARCHY)->action(); + if (!menu->actions().contains(action)) + menu->addAction(action); } menu->addSeparator(); diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index 0afa17f83a0..6f67fe67748 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -154,7 +154,6 @@ private: Internal::BaseTextEditorPrivate *d; }; - class TEXTEDITOR_EXPORT TextEditorWidget : public QPlainTextEdit { Q_OBJECT @@ -438,6 +437,8 @@ public: void openLinkUnderCursor(); void openLinkUnderCursorInNextSplit(); + void openTypeUnderCursor(); + void openTypeUnderCursorInNextSplit(); virtual void findUsages(); virtual void renameSymbolUnderCursor(); @@ -496,6 +497,8 @@ signals: void requestLinkAt(const QTextCursor &cursor, const Utils::LinkHandler &callback, bool resolveTarget, bool inNextSplit); + void requestTypeAt(const QTextCursor &cursor, const Utils::LinkHandler &callback, + bool resolveTarget, bool inNextSplit); void requestUsages(const QTextCursor &cursor); void requestRename(const QTextCursor &cursor); void requestCallHierarchy(const QTextCursor &cursor); @@ -588,6 +591,11 @@ protected: bool resolveTarget = true, bool inNextSplit = false); + virtual void findTypeAt(const QTextCursor &, + const Utils::LinkHandler &processLinkCallback, + bool resolveTarget = true, + bool inNextSplit = false); + /*! Returns whether the link was opened successfully. */ diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index d8405d33469..80625cc42e1 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -118,6 +118,8 @@ public: QAction *m_unfoldAllAction = nullptr; QAction *m_followSymbolAction = nullptr; QAction *m_followSymbolInNextSplitAction = nullptr; + QAction *m_followToTypeAction = nullptr; + QAction *m_followToTypeInNextSplitAction = nullptr; QAction *m_findUsageAction = nullptr; QAction *m_openCallHierarchyAction = nullptr; QAction *m_renameSymbolAction = nullptr; @@ -224,6 +226,12 @@ void TextEditorActionHandlerPrivate::createActions() m_followSymbolInNextSplitAction = registerAction(FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT, [] (TextEditorWidget *w) { w->openLinkUnderCursorInNextSplit(); }, true, Tr::tr("Follow Symbol Under Cursor in Next Split"), QKeySequence(Utils::HostOsInfo::isMacHost() ? Tr::tr("Meta+E, F2") : Tr::tr("Ctrl+E, F2"))); + m_followToTypeAction = registerAction(FOLLOW_SYMBOL_TO_TYPE, + [] (TextEditorWidget *w) { w->openTypeUnderCursor(); }, true, Tr::tr("Follow Type Under Cursor"), + QKeySequence(Tr::tr("Ctrl+Shift+F2"))); + m_followToTypeInNextSplitAction = registerAction(FOLLOW_SYMBOL_TO_TYPE_IN_NEXT_SPLIT, + [] (TextEditorWidget *w) { w->openTypeUnderCursorInNextSplit(); }, true, Tr::tr("Follow Type Under Cursor in Next Split"), + QKeySequence(Utils::HostOsInfo::isMacHost() ? Tr::tr("Meta+E, Shift+F2") : Tr::tr("Ctrl+E, Ctrl+Shift+F2"))); m_findUsageAction = registerAction(FIND_USAGES, [] (TextEditorWidget *w) { w->findUsages(); }, true, Tr::tr("Find References to Symbol Under Cursor"), QKeySequence(Tr::tr("Ctrl+Shift+U"))); @@ -492,6 +500,10 @@ void TextEditorActionHandlerPrivate::updateOptionalActions() optionalActions & TextEditorActionHandler::FollowSymbolUnderCursor); m_followSymbolInNextSplitAction->setEnabled( optionalActions & TextEditorActionHandler::FollowSymbolUnderCursor); + m_followToTypeAction->setEnabled( + optionalActions & TextEditorActionHandler::FollowTypeUnderCursor); + m_followToTypeInNextSplitAction->setEnabled( + optionalActions & TextEditorActionHandler::FollowTypeUnderCursor); m_findUsageAction->setEnabled( optionalActions & TextEditorActionHandler::FindUsage); m_jumpToFileAction->setEnabled( diff --git a/src/plugins/texteditor/texteditoractionhandler.h b/src/plugins/texteditor/texteditoractionhandler.h index 0886b6a909b..e1d06f7e3cd 100644 --- a/src/plugins/texteditor/texteditoractionhandler.h +++ b/src/plugins/texteditor/texteditoractionhandler.h @@ -34,10 +34,11 @@ public: UnCommentSelection = 2, UnCollapseAll = 4, FollowSymbolUnderCursor = 8, - JumpToFileUnderCursor = 16, - RenameSymbol = 32, - FindUsage = 64, - CallHierarchy = 128 + FollowTypeUnderCursor = 16, + JumpToFileUnderCursor = 32, + RenameSymbol = 64, + FindUsage = 128, + CallHierarchy = 256 }; using TextEditorWidgetResolver = std::function<TextEditorWidget *(Core::IEditor *)>; diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index 03433fd0e8c..4cac6a9dd7f 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -206,6 +206,8 @@ const char INDENT[] = "TextEditor.Indent"; const char UNINDENT[] = "TextEditor.Unindent"; const char FOLLOW_SYMBOL_UNDER_CURSOR[] = "TextEditor.FollowSymbolUnderCursor"; const char FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT[] = "TextEditor.FollowSymbolUnderCursorInNextSplit"; +const char FOLLOW_SYMBOL_TO_TYPE[] = "TextEditor.FollowSymbolToType"; +const char FOLLOW_SYMBOL_TO_TYPE_IN_NEXT_SPLIT[] = "TextEditor.FollowSymbolToTypeInNextSplit"; const char FIND_USAGES[] = "TextEditor.FindUsages"; // moved from CppEditor to TextEditor avoid breaking the setting by using the old key const char RENAME_SYMBOL[] = "CppEditor.RenameSymbolUnderCursor"; From ed6595a66ec654e3cdb12f4a4863425ab43ffb71 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 26 Sep 2023 09:39:32 +0200 Subject: [PATCH 1359/1777] Python: improve pyside tool detection Look right next to the used python. For virtual env setups this should be a lot faster than asking pip for the installed files. Additionally this should work for pyside devenvs. Change-Id: I2a8cf6877636785453426c348cfac252645aa4e1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/python/pythonrunconfiguration.cpp | 62 +++++++++++-------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 05366abff24..12141ba1a93 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -149,6 +149,13 @@ public: void updateExtraCompilers(); void currentInterpreterChanged(); + struct PySideTools + { + FilePath pySideProjectPath; + FilePath pySideUicPath; + }; + void updateTools(const PySideTools &tools); + FilePath m_pySideUicPath; PythonInterpreterAspect *q; @@ -195,7 +202,15 @@ PythonInterpreterAspect::~PythonInterpreterAspect() void PythonInterpreterAspectPrivate::checkForPySide(const FilePath &python) { - checkForPySide(python, "PySide6-Essentials"); + PySideTools tools; + const FilePath dir = python.parentDir(); + tools.pySideProjectPath = dir.pathAppended("pyside6-project").withExecutableSuffix(); + tools.pySideUicPath = dir.pathAppended("pyside6-uic").withExecutableSuffix(); + + if (tools.pySideProjectPath.isExecutableFile() && tools.pySideUicPath.isExecutableFile()) + updateTools(tools); + else + checkForPySide(python, "PySide6-Essentials"); } void PythonInterpreterAspectPrivate::checkForPySide(const FilePath &python, @@ -215,24 +230,10 @@ void PythonInterpreterAspectPrivate::handlePySidePackageInfo(const PipPackageInf const FilePath &python, const QString &requestedPackageName) { - struct PythonTools - { - FilePath pySideProjectPath; - FilePath pySideUicPath; - }; - - BuildStepList *buildSteps = nullptr; - if (Target *target = rc->target()) { - if (auto buildConfiguration = target->activeBuildConfiguration()) - buildSteps = buildConfiguration->buildSteps(); - } - if (!buildSteps) - return; - const auto findPythonTools = [](const FilePaths &files, const FilePath &location, - const FilePath &python) -> PythonTools { - PythonTools result; + const FilePath &python) -> PySideTools { + PySideTools result; const QString pySide6ProjectName = OsSpecificAspects::withExecutableSuffix(python.osType(), "pyside6-project"); const QString pySide6UicName @@ -253,18 +254,13 @@ void PythonInterpreterAspectPrivate::handlePySidePackageInfo(const PipPackageInf return {}; }; - PythonTools pythonTools = findPythonTools(pySideInfo.files, pySideInfo.location, python); - if (!pythonTools.pySideProjectPath.isExecutableFile() && requestedPackageName != "PySide6") { + PySideTools tools = findPythonTools(pySideInfo.files, pySideInfo.location, python); + if (!tools.pySideProjectPath.isExecutableFile() && requestedPackageName != "PySide6") { checkForPySide(python, "PySide6"); return; } - m_pySideUicPath = pythonTools.pySideUicPath; - - updateExtraCompilers(); - - if (auto pySideBuildStep = buildSteps->firstOfType<PySideBuildStep>()) - pySideBuildStep->updatePySideProjectPath(pythonTools.pySideProjectPath); + updateTools(tools); } void PythonInterpreterAspectPrivate::currentInterpreterChanged() @@ -283,6 +279,22 @@ void PythonInterpreterAspectPrivate::currentInterpreterChanged() } } +void PythonInterpreterAspectPrivate::updateTools(const PySideTools &tools) +{ + m_pySideUicPath = tools.pySideUicPath; + + updateExtraCompilers(); + + if (Target *target = rc->target()) { + if (BuildConfiguration *buildConfiguration = target->activeBuildConfiguration()) { + if (BuildStepList *buildSteps = buildConfiguration->buildSteps()) { + if (auto buildStep = buildSteps->firstOfType<PySideBuildStep>()) + buildStep->updatePySideProjectPath(tools.pySideProjectPath); + } + } + } +} + QList<PySideUicExtraCompiler *> PythonInterpreterAspect::extraCompilers() const { return d->m_extraCompilers; From d6dd1958612548ea10e4053e360c019e314e9730 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 29 Sep 2023 11:24:22 +0200 Subject: [PATCH 1360/1777] ExtensionSystem: Fix copy & paste error for building without tests Amends a8f6df546c83124031d9f7d0b7fcfe4505c0122f Change-Id: Ifff6ae60df631fd1ee9ab8801aea46c12bf15f2c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/libs/extensionsystem/extensionsystem_global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/extensionsystem/extensionsystem_global.h b/src/libs/extensionsystem/extensionsystem_global.h index 13c82e75d5c..8e1c1ee463c 100644 --- a/src/libs/extensionsystem/extensionsystem_global.h +++ b/src/libs/extensionsystem/extensionsystem_global.h @@ -23,7 +23,7 @@ # define EXTENSIONSYSTEM_TEST_EXPORT Q_DECL_IMPORT # endif #else -# define QTSUPPORT_TEST_EXPORT +# define EXTENSIONSYSTEM_TEST_EXPORT #endif Q_DECLARE_LOGGING_CATEGORY(pluginLog) From 3ac81855673f5210542615a5f0df8803e495cdbe Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 28 Sep 2023 16:10:07 +0200 Subject: [PATCH 1361/1777] Markdown: Add missing actions for text styles Change-Id: Ie3fcbd49158be4a12e1577ea24d3d6783489877e Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/texteditor/markdowneditor.cpp | 172 ++++++++++++++-------- src/plugins/texteditor/markdowneditor.h | 6 + 2 files changed, 115 insertions(+), 63 deletions(-) diff --git a/src/plugins/texteditor/markdowneditor.cpp b/src/plugins/texteditor/markdowneditor.cpp index 22683d0c99c..41e9a0c5303 100644 --- a/src/plugins/texteditor/markdowneditor.cpp +++ b/src/plugins/texteditor/markdowneditor.cpp @@ -8,6 +8,8 @@ #include "texteditortr.h" #include <aggregation/aggregate.h> +#include <coreplugin/actionmanager/actionmanager.h> +#include <coreplugin/actionmanager/commandbutton.h> #include <coreplugin/coreconstants.h> #include <coreplugin/coreplugintr.h> #include <coreplugin/icore.h> @@ -26,6 +28,7 @@ #include <optional> +using namespace Core; using namespace Utils; namespace TextEditor::Internal { @@ -39,23 +42,28 @@ const char MARKDOWNVIEWER_SHOW_PREVIEW[] = "Markdown.ShowPreview"; const bool kTextEditorRightDefault = false; const bool kShowEditorDefault = true; const bool kShowPreviewDefault = true; +const char EMPHASIS_ACTION[] = "Markdown.Emphasis"; +const char STRONG_ACTION[] = "Markdown.Strong"; +const char INLINECODE_ACTION[] = "Markdown.InlineCode"; +const char LINK_ACTION[] = "Markdown.Link"; -class MarkdownEditor : public Core::IEditor +class MarkdownEditor : public IEditor { + Q_OBJECT public: MarkdownEditor() : m_document(new TextDocument(MARKDOWNVIEWER_ID)) { m_document->setMimeType(MARKDOWNVIEWER_MIME_TYPE); - QtcSettings *s = Core::ICore::settings(); + QtcSettings *s = ICore::settings(); const bool textEditorRight = s->value(MARKDOWNVIEWER_TEXTEDITOR_RIGHT, kTextEditorRightDefault).toBool(); const bool showPreview = s->value(MARKDOWNVIEWER_SHOW_PREVIEW, kShowPreviewDefault).toBool(); const bool showEditor = s->value(MARKDOWNVIEWER_SHOW_EDITOR, kShowEditorDefault).toBool() || !showPreview; // ensure at least one is visible - m_splitter = new Core::MiniSplitter; + m_splitter = new MiniSplitter; // preview m_previewWidget = new QTextBrowser(); @@ -68,15 +76,15 @@ public: m_textEditorWidget->setTextDocument(m_document); m_textEditorWidget->setupGenericHighlighter(); m_textEditorWidget->setMarksVisible(false); - auto context = new Core::IContext(this); + auto context = new IContext(this); context->setWidget(m_textEditorWidget); - context->setContext(Core::Context(MARKDOWNVIEWER_TEXT_CONTEXT)); - Core::ICore::addContextObject(context); + context->setContext(Context(MARKDOWNVIEWER_TEXT_CONTEXT)); + ICore::addContextObject(context); m_splitter->addWidget(m_textEditorWidget); // sets splitter->focusWidget() on non-Windows m_splitter->addWidget(m_previewWidget); - setContext(Core::Context(MARKDOWNVIEWER_ID)); + setContext(Context(MARKDOWNVIEWER_ID)); auto widget = new QWidget; auto layout = new QVBoxLayout; @@ -105,65 +113,23 @@ public: m_toggleEditorVisible->setChecked(showEditor); m_textEditorWidget->setVisible(showEditor); - auto button = new QToolButton; + auto button = new CommandButton(EMPHASIS_ACTION); button->setText("i"); button->setFont([button]{ auto f = button->font(); f.setItalic(true); return f; }()); - button->setToolTip(Tr::tr("Emphasis")); - connect(button, &QToolButton::clicked, this, [this] { - triggerFormatingAction([](QString *selectedText, int *cursorOffset) { - if (selectedText->isEmpty()) { - *selectedText = QStringLiteral("**"); - *cursorOffset = -1; - } else { - *selectedText = QStringLiteral("*%1*").arg(*selectedText); - } - }); - }); + connect(button, &QToolButton::clicked, this, &MarkdownEditor::triggerEmphasis); m_markDownButtons.append(button); - button = new QToolButton; + button = new CommandButton(STRONG_ACTION); button->setText("b"); button->setFont([button]{ auto f = button->font(); f.setBold(true); return f; }()); - button->setToolTip(Tr::tr("Strong")); - connect(button, &QToolButton::clicked, this, [this] { - triggerFormatingAction([](QString *selectedText, int *cursorOffset) { - if (selectedText->isEmpty()) { - *selectedText = QStringLiteral("****"); - *cursorOffset = -2; - } else { - *selectedText = QStringLiteral("**%1**").arg(*selectedText); - } - }); - }); + connect(button, &QToolButton::clicked, this, &MarkdownEditor::triggerStrong); m_markDownButtons.append(button); - button = new QToolButton; + button = new CommandButton(INLINECODE_ACTION); button->setText("`"); - button->setToolTip(Tr::tr("Inline Code")); - connect(button, &QToolButton::clicked, this, [this] { - triggerFormatingAction([](QString *selectedText, int *cursorOffset) { - if (selectedText->isEmpty()) { - *selectedText = QStringLiteral("``"); - *cursorOffset = -1; - } else { - *selectedText = QStringLiteral("`%1`").arg(*selectedText); - } - }); - }); + connect(button, &QToolButton::clicked, this, &MarkdownEditor::triggerInlineCode); m_markDownButtons.append(button); - button = new QToolButton; + button = new CommandButton(LINK_ACTION); button->setIcon(Utils::Icons::LINK_TOOLBAR.icon()); - button->setToolTip(Tr::tr("Hyper Link")); - connect(button, &QToolButton::clicked, this, [this] { - triggerFormatingAction([](QString *selectedText, int *cursorOffset, int *selectionLength) { - if (selectedText->isEmpty()) { - *selectedText = QStringLiteral("[](https://)"); - *cursorOffset = -11; // ](https://) is 11 chars - } else { - *selectedText = QStringLiteral("[%1](https://)").arg(*selectedText); - *cursorOffset = -1; - *selectionLength = -8; // https:// is 8 chars - } - }); - }); + connect(button, &QToolButton::clicked, this, &MarkdownEditor::triggerLink); m_markDownButtons.append(button); for (auto button : m_markDownButtons) { // do not call setVisible(true) at this point, this destroys the hover effect on macOS @@ -222,7 +188,7 @@ public: swapViews->setEnabled(view->isVisible() && otherView->isVisible()); }; const auto saveViewSettings = [this] { - Utils::QtcSettings *s = Core::ICore::settings(); + Utils::QtcSettings *s = ICore::settings(); s->setValueWithDefault(MARKDOWNVIEWER_SHOW_PREVIEW, m_togglePreviewVisible->isChecked(), kShowPreviewDefault); @@ -259,7 +225,7 @@ public: const bool textEditorRight = isTextEditorRight(); setWidgetOrder(!textEditorRight); // save settings - Utils::QtcSettings *s = Core::ICore::settings(); + Utils::QtcSettings *s = ICore::settings(); s->setValueWithDefault(MARKDOWNVIEWER_TEXTEDITOR_RIGHT, !textEditorRight, kTextEditorRightDefault); @@ -280,6 +246,53 @@ public: }); } + void triggerEmphasis() + { + triggerFormatingAction([](QString *selectedText, int *cursorOffset) { + if (selectedText->isEmpty()) { + *selectedText = QStringLiteral("**"); + *cursorOffset = -1; + } else { + *selectedText = QStringLiteral("*%1*").arg(*selectedText); + } + }); + } + void triggerStrong() + { + triggerFormatingAction([](QString *selectedText, int *cursorOffset) { + if (selectedText->isEmpty()) { + *selectedText = QStringLiteral("****"); + *cursorOffset = -2; + } else { + *selectedText = QStringLiteral("**%1**").arg(*selectedText); + } + }); + } + void triggerInlineCode() + { + triggerFormatingAction([](QString *selectedText, int *cursorOffset) { + if (selectedText->isEmpty()) { + *selectedText = QStringLiteral("``"); + *cursorOffset = -1; + } else { + *selectedText = QStringLiteral("`%1`").arg(*selectedText); + } + }); + } + void triggerLink() + { + triggerFormatingAction([](QString *selectedText, int *cursorOffset, int *selectionLength) { + if (selectedText->isEmpty()) { + *selectedText = QStringLiteral("[](https://)"); + *cursorOffset = -11; // ](https://) is 11 chars + } else { + *selectedText = QStringLiteral("[%1](https://)").arg(*selectedText); + *cursorOffset = -1; + *selectionLength = -8; // https:// is 8 chars + } + }); + } + bool isTextEditorRight() const { return m_splitter->widget(0) == m_previewWidget; } void setWidgetOrder(bool textEditorRight) @@ -301,7 +314,7 @@ public: QWidget *toolBar() override { return &m_toolbar; } - Core::IDocument *document() const override { return m_document.data(); } + IDocument *document() const override { return m_document.data(); } TextEditorWidget *textEditorWidget() const { return m_textEditorWidget; } int currentLine() const override { return textEditorWidget()->textCursor().blockNumber() + 1; }; int currentColumn() const override @@ -327,7 +340,7 @@ public: m_splitter->widget(0)->setFocus(); return true; } - return Core::IEditor::eventFilter(obj, ev); + return IEditor::eventFilter(obj, ev); } QByteArray saveState() const override @@ -416,7 +429,7 @@ private: private: QTimer m_previewTimer; bool m_performDelayedUpdate = false; - Core::MiniSplitter *m_splitter; + MiniSplitter *m_splitter; QTextBrowser *m_previewWidget; TextEditorWidget *m_textEditorWidget; TextDocumentPtr m_document; @@ -432,7 +445,7 @@ MarkdownEditorFactory::MarkdownEditorFactory() : m_actionHandler(MARKDOWNVIEWER_ID, MARKDOWNVIEWER_TEXT_CONTEXT, TextEditor::TextEditorActionHandler::None, - [](Core::IEditor *editor) { + [](IEditor *editor) { return static_cast<MarkdownEditor *>(editor)->textEditorWidget(); }) { @@ -440,6 +453,39 @@ MarkdownEditorFactory::MarkdownEditorFactory() setDisplayName(::Core::Tr::tr("Markdown Editor")); addMimeType(MARKDOWNVIEWER_MIME_TYPE); setEditorCreator([] { return new MarkdownEditor; }); + + const auto textContext = Context(MARKDOWNVIEWER_TEXT_CONTEXT); + Command *cmd = nullptr; + cmd = ActionManager::registerAction(&m_emphasisAction, EMPHASIS_ACTION, textContext); + cmd->setDescription(Tr::tr("Emphasis")); + QObject::connect(&m_emphasisAction, &QAction::triggered, EditorManager::instance(), [] { + auto editor = qobject_cast<MarkdownEditor *>(EditorManager::currentEditor()); + if (editor) + editor->triggerEmphasis(); + }); + cmd = ActionManager::registerAction(&m_strongAction, STRONG_ACTION, textContext); + cmd->setDescription(Tr::tr("Strong")); + QObject::connect(&m_strongAction, &QAction::triggered, EditorManager::instance(), [] { + auto editor = qobject_cast<MarkdownEditor *>(EditorManager::currentEditor()); + if (editor) + editor->triggerStrong(); + }); + cmd = ActionManager::registerAction(&m_inlineCodeAction, INLINECODE_ACTION, textContext); + cmd->setDescription(Tr::tr("Inline Code")); + QObject::connect(&m_inlineCodeAction, &QAction::triggered, EditorManager::instance(), [] { + auto editor = qobject_cast<MarkdownEditor *>(EditorManager::currentEditor()); + if (editor) + editor->triggerInlineCode(); + }); + cmd = ActionManager::registerAction(&m_linkAction, LINK_ACTION, textContext); + cmd->setDescription(Tr::tr("Hyper Link")); + QObject::connect(&m_linkAction, &QAction::triggered, EditorManager::instance(), [] { + auto editor = qobject_cast<MarkdownEditor *>(EditorManager::currentEditor()); + if (editor) + editor->triggerLink(); + }); } } // namespace TextEditor::Internal + +#include "markdowneditor.moc" diff --git a/src/plugins/texteditor/markdowneditor.h b/src/plugins/texteditor/markdowneditor.h index de87c558e1b..46a7f4baf51 100644 --- a/src/plugins/texteditor/markdowneditor.h +++ b/src/plugins/texteditor/markdowneditor.h @@ -7,6 +7,8 @@ #include <texteditor/texteditoractionhandler.h> +#include <QAction> + namespace TextEditor::Internal { class MarkdownEditorFactory final : public Core::IEditorFactory @@ -16,6 +18,10 @@ public: private: TextEditor::TextEditorActionHandler m_actionHandler; + QAction m_emphasisAction; + QAction m_strongAction; + QAction m_inlineCodeAction; + QAction m_linkAction; }; } // TextEditor::Internal From 3601e18bc5088a065ecd66785ab666f7d86c9094 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 29 Sep 2023 10:37:45 +0200 Subject: [PATCH 1362/1777] Deb: Depend on requirements from Qt Qt requires libxcb-cursor0 and libdouble-conversion, so declare them as requirements for the Qt Creator debian package. Change-Id: I2ac9912e93d063ba47a45fffa880505baedb6e83 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- packaging/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt index 7b9b46538c1..771d16566c0 100644 --- a/packaging/CMakeLists.txt +++ b/packaging/CMakeLists.txt @@ -23,6 +23,7 @@ set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) set(CPACK_DEBIAN_COMPRESSION_TYPE lzma) set(CPACK_DEBIAN_PACKAGE_RELEASE 1) set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Qt Project <qt-creator@qt-project.org>") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libdouble-conversion3,libxcb-cursor0") # Make CMAKE_INSTALL_DEFAULT_COMPONENT_NAME the first component to install get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS) From 088b0246d4a1a9b8ead35bd8ba4b0f717d4c204a Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Thu, 28 Sep 2023 13:42:20 +0200 Subject: [PATCH 1363/1777] CppEditor: Let clangd quickfixes also appear in the "Refactor" menu It was annoyingly inconsistent that they appeared on Alt+Enter, but not in the menu. Change-Id: I4cf19242719c79b60ba7758c4bcd433f97bb3251 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/cppeditor/cppeditorwidget.cpp | 31 ++++++++++++++--------- src/plugins/cppeditor/cppeditorwidget.h | 1 + 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index 7559e028e2e..bb8849ab4b8 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -1054,18 +1054,20 @@ void CppEditorWidget::processKeyNormally(QKeyEvent *e) TextEditorWidget::keyPressEvent(e); } -static void addRefactoringActions(QMenu *menu, std::unique_ptr<AssistInterface> iface) +void CppEditorWidget::addRefactoringActions(QMenu *menu) const { - if (!iface || !menu) + if (!menu) return; - using Processor = QScopedPointer<IAssistProcessor>; - using Proposal = QScopedPointer<IAssistProposal>; - - const Processor processor( - CppEditorPlugin::instance()->quickFixProvider()->createProcessor(iface.get())); - const Proposal proposal(processor->start(std::move(iface))); - if (proposal) { + auto iface = createAssistInterface(QuickFix, ExplicitlyInvoked); + IAssistProcessor * const processor + = textDocument()->quickFixAssistProvider()->createProcessor(iface.get()); + IAssistProposal* const proposal(processor->start(std::move(iface))); + const auto handleProposal = [menu = QPointer(menu), processor](IAssistProposal *proposal) { + QScopedPointer<IAssistProposal> proposalHolder(proposal); + QScopedPointer<IAssistProcessor> processorHolder(processor); + if (!menu || !proposal) + return; auto model = proposal->model().staticCast<GenericProposalModel>(); for (int index = 0; index < model->size(); ++index) { const auto item = static_cast<AssistProposalItem *>(model->proposalItem(index)); @@ -1073,7 +1075,12 @@ static void addRefactoringActions(QMenu *menu, std::unique_ptr<AssistInterface> const QAction *action = menu->addAction(op->description()); QObject::connect(action, &QAction::triggered, menu, [op] { op->perform(); }); } - } + }; + + if (proposal) + handleProposal(proposal); + else + processor->setAsyncCompletionAvailableHandler(handleProposal); } class ProgressIndicatorMenuItem : public QWidgetAction @@ -1105,7 +1112,7 @@ QMenu *CppEditorWidget::createRefactorMenu(QWidget *parent) const const CppUseSelectionsUpdater::RunnerInfo runnerInfo = d->m_useSelectionsUpdater.update(); switch (runnerInfo) { case CppUseSelectionsUpdater::RunnerInfo::AlreadyUpToDate: - addRefactoringActions(menu, createAssistInterface(QuickFix, ExplicitlyInvoked)); + addRefactoringActions(menu); break; case CppUseSelectionsUpdater::RunnerInfo::Started: { // Update the refactor menu once we get the results. @@ -1116,7 +1123,7 @@ QMenu *CppEditorWidget::createRefactorMenu(QWidget *parent) const menu, [=] (SemanticInfo::LocalUseMap, bool success) { QTC_CHECK(success); menu->removeAction(progressIndicatorMenuItem); - addRefactoringActions(menu, createAssistInterface(QuickFix, ExplicitlyInvoked)); + addRefactoringActions(menu); }); break; } diff --git a/src/plugins/cppeditor/cppeditorwidget.h b/src/plugins/cppeditor/cppeditorwidget.h index 58d40c8a592..e9259f8f4c7 100644 --- a/src/plugins/cppeditor/cppeditorwidget.h +++ b/src/plugins/cppeditor/cppeditorwidget.h @@ -142,6 +142,7 @@ private: void handleOutlineChanged(const QWidget* newOutline); void showRenameWarningIfFileIsGenerated(const Utils::FilePath &filePath); + void addRefactoringActions(QMenu *menu) const; private: QScopedPointer<Internal::CppEditorWidgetPrivate> d; From fee2fb638b089702adad4ce066bb0e01f732046c Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 28 Sep 2023 16:21:58 +0200 Subject: [PATCH 1364/1777] DAP: Fix start CMake debugging without executable Task-number: QTCREATORBUG-29630 Change-Id: Ib7acb7d231fe45d52f816de9d8c85897e2808aec Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/projectexplorer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index ddd07732c90..6a4eba09116 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2438,7 +2438,9 @@ MiniProjectTargetSelector *ProjectExplorerPlugin::targetSelector() void ProjectExplorerPluginPrivate::executeRunConfiguration(RunConfiguration *runConfiguration, Id runMode) { - const Tasks runConfigIssues = runConfiguration->checkForIssues(); + const Tasks runConfigIssues = runMode == Constants::DAP_CMAKE_DEBUG_RUN_MODE + ? Tasks() + : runConfiguration->checkForIssues(); if (!runConfigIssues.isEmpty()) { for (const Task &t : runConfigIssues) TaskHub::addTask(t); From 278ce651a23a79a1fe5079d5cbe10cac5f4e13f3 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 29 Sep 2023 06:50:20 +0200 Subject: [PATCH 1365/1777] LanguageClient: fix crash on inspector widget destruction Avoid calling functionality of the LspInspectorWidget while it is destructed by resetting the reference before the deletion. Change-Id: I335cd1154fe4654be888a0d8cf02a0f6642edcb7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/languageclient/lspinspector.cpp | 15 +++++++++++---- src/plugins/languageclient/lspinspector.h | 4 +++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/plugins/languageclient/lspinspector.cpp b/src/plugins/languageclient/lspinspector.cpp index 31a353c2787..c01b5061cea 100644 --- a/src/plugins/languageclient/lspinspector.cpp +++ b/src/plugins/languageclient/lspinspector.cpp @@ -341,14 +341,15 @@ private: void LspInspector::show(const QString &defaultClient) { if (!m_currentWidget) { - m_currentWidget = new LspInspectorWidget(this); - m_currentWidget->setAttribute(Qt::WA_DeleteOnClose); - Core::ICore::registerWindow(m_currentWidget, Core::Context("LanguageClient.Inspector")); + auto widget = new LspInspectorWidget(this); + connect(widget, &LspInspectorWidget::finished, this, &LspInspector::onInspectorClosed); + Core::ICore::registerWindow(widget, Core::Context("LanguageClient.Inspector")); + m_currentWidget = widget; } else { QApplication::setActiveWindow(m_currentWidget); } if (!defaultClient.isEmpty()) - static_cast<LspInspectorWidget *>(m_currentWidget.data())->selectClient(defaultClient); + static_cast<LspInspectorWidget *>(m_currentWidget)->selectClient(defaultClient); m_currentWidget->show(); } @@ -392,6 +393,12 @@ QList<QString> LspInspector::clients() const return m_logs.keys(); } +void LspInspector::onInspectorClosed() +{ + m_currentWidget->deleteLater(); + m_currentWidget = nullptr; +} + LspInspectorWidget::LspInspectorWidget(LspInspector *inspector) : m_inspector(inspector), m_tabWidget(new QTabWidget(this)) { diff --git a/src/plugins/languageclient/lspinspector.h b/src/plugins/languageclient/lspinspector.h index de37b9f713f..aa3620fb2ba 100644 --- a/src/plugins/languageclient/lspinspector.h +++ b/src/plugins/languageclient/lspinspector.h @@ -68,9 +68,11 @@ signals: void capabilitiesUpdated(const QString &clientName); private: + void onInspectorClosed(); + QMap<QString, std::list<LspLogMessage>> m_logs; QMap<QString, Capabilities> m_capabilities; - QPointer<QWidget> m_currentWidget; + QWidget *m_currentWidget = nullptr; int m_logSize = 100; // default log size if no widget is currently visible }; From 8ba5174415c582e07b5a7d012e456c7b6242f147 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 28 Sep 2023 15:52:42 +0200 Subject: [PATCH 1366/1777] Utils: Make UnixUtils a namespace Change-Id: Id60c4165cf88af03d4010ee19cedc4bad39285e5 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/utils/unixutils.cpp | 29 +++++++++++++++-------------- src/libs/utils/unixutils.h | 22 +++++++++------------- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/src/libs/utils/unixutils.cpp b/src/libs/utils/unixutils.cpp index 388f8549fe8..f0a7bbf0a13 100644 --- a/src/libs/utils/unixutils.cpp +++ b/src/libs/utils/unixutils.cpp @@ -9,14 +9,14 @@ #include <QFileInfo> -using namespace Utils; +namespace Utils::UnixUtils { -QString UnixUtils::defaultFileBrowser() +QString defaultFileBrowser() { return QLatin1String("xdg-open %d"); } -QString UnixUtils::fileBrowser(const QtcSettings *settings) +QString fileBrowser(const QtcSettings *settings) { const QString dflt = defaultFileBrowser(); if (!settings) @@ -24,24 +24,23 @@ QString UnixUtils::fileBrowser(const QtcSettings *settings) return settings->value("General/FileBrowser", dflt).toString(); } -void UnixUtils::setFileBrowser(QtcSettings *settings, const QString &term) +void setFileBrowser(QtcSettings *settings, const QString &term) { settings->setValueWithDefault("General/FileBrowser", term, defaultFileBrowser()); } -QString UnixUtils::fileBrowserHelpText() +QString fileBrowserHelpText() { - QString help = Tr::tr("<table border=1 cellspacing=0 cellpadding=3>" - "<tr><th>Variable</th><th>Expands to</th></tr>" - "<tr><td>%d</td><td>directory of current file</td></tr>" - "<tr><td>%f</td><td>file name (with full path)</td></tr>" - "<tr><td>%n</td><td>file name (without path)</td></tr>" - "<tr><td>%%</td><td>%</td></tr>" - "</table>"); - return help; + return Tr::tr("<table border=1 cellspacing=0 cellpadding=3>" + "<tr><th>Variable</th><th>Expands to</th></tr>" + "<tr><td>%d</td><td>directory of current file</td></tr>" + "<tr><td>%f</td><td>file name (with full path)</td></tr>" + "<tr><td>%n</td><td>file name (without path)</td></tr>" + "<tr><td>%%</td><td>%</td></tr>" + "</table>"); } -QString UnixUtils::substituteFileBrowserParameters(const QString &pre, const QString &file) +QString substituteFileBrowserParameters(const QString &pre, const QString &file) { QString cmd; for (int i = 0; i < pre.size(); ++i) { @@ -70,3 +69,5 @@ QString UnixUtils::substituteFileBrowserParameters(const QString &pre, const QSt return cmd; } + +} // Utils::UnixUtils diff --git a/src/libs/utils/unixutils.h b/src/libs/utils/unixutils.h index 2080efa95d1..a2396d5cc2d 100644 --- a/src/libs/utils/unixutils.h +++ b/src/libs/utils/unixutils.h @@ -9,19 +9,15 @@ QT_BEGIN_NAMESPACE class QString; QT_END_NAMESPACE -namespace Utils { +namespace Utils { class QtcSettings; } -class QtcSettings; +namespace Utils::UnixUtils { -class QTCREATOR_UTILS_EXPORT UnixUtils -{ -public: - static QString defaultFileBrowser(); - static QString fileBrowser(const QtcSettings *settings); - static void setFileBrowser(QtcSettings *settings, const QString &term); - static QString fileBrowserHelpText(); - static QString substituteFileBrowserParameters(const QString &command, - const QString &file); -}; +QTCREATOR_UTILS_EXPORT QString defaultFileBrowser(); +QTCREATOR_UTILS_EXPORT QString fileBrowser(const QtcSettings *settings); +QTCREATOR_UTILS_EXPORT void setFileBrowser(QtcSettings *settings, const QString &term); +QTCREATOR_UTILS_EXPORT QString fileBrowserHelpText(); +QTCREATOR_UTILS_EXPORT QString substituteFileBrowserParameters(const QString &command, + const QString &file); -} // Utils +} // Utils::UnixUtils From 61270e910fe3bc6b64c8ebecae2b174288d19339 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 15 Sep 2023 14:53:59 +0200 Subject: [PATCH 1367/1777] Core: Swap ICore and MainWindow "ownership" Change-Id: Ibfa223da0f4d5195ae2f2783352346ca72b920bd Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/coreplugin.cpp | 17 ++++---- src/plugins/coreplugin/coreplugin.h | 3 +- src/plugins/coreplugin/icore.cpp | 50 +++++++++++++--------- src/plugins/coreplugin/icore.h | 15 ++++--- src/plugins/coreplugin/messagemanager.h | 8 +++- src/plugins/coreplugin/modemanager.h | 2 + src/plugins/coreplugin/outputpanemanager.h | 13 ++++-- 7 files changed, 64 insertions(+), 44 deletions(-) diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index cf51496b517..a6911772ee9 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -9,7 +9,6 @@ #include "icore.h" #include "idocument.h" #include "iwizardfactory.h" -#include "mainwindow.h" #include "modemanager.h" #include "session.h" #include "settingsdatabase.h" @@ -96,7 +95,7 @@ CorePlugin::~CorePlugin() DesignMode::destroyModeIfRequired(); - delete m_mainWindow; + delete m_core; SettingsDatabase::destroy(); setCreatorTheme(nullptr); } @@ -158,12 +157,12 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) CheckableMessageBox::initialize(ICore::settings()); new ActionManager(this); ActionManager::setPresentationModeEnabled(args.presentationMode); - m_mainWindow = new MainWindow; + m_core = new ICore; if (args.overrideColor.isValid()) - m_mainWindow->setOverrideColor(args.overrideColor); + ICore::setOverrideColor(args.overrideColor); m_locator = new Locator; std::srand(unsigned(QDateTime::currentDateTime().toSecsSinceEpoch())); - m_mainWindow->init(); + ICore::init(); m_editMode = new EditMode; ModeManager::activateMode(m_editMode->id()); m_folderNavigationWidgetFactory = new FolderNavigationWidgetFactory; @@ -291,9 +290,9 @@ void CorePlugin::extensionsInitialized() DesignMode::createModeIfRequired(); Find::extensionsInitialized(); m_locator->extensionsInitialized(); - m_mainWindow->extensionsInitialized(); + ICore::extensionsInitialized(); if (ExtensionSystem::PluginManager::hasError()) { - auto errorOverview = new ExtensionSystem::PluginErrorOverview(m_mainWindow); + auto errorOverview = new ExtensionSystem::PluginErrorOverview(ICore::mainWindow()); errorOverview->setAttribute(Qt::WA_DeleteOnClose); errorOverview->setModal(true); errorOverview->show(); @@ -324,7 +323,7 @@ QObject *CorePlugin::remoteCommand(const QStringList & /* options */, filePaths, ICore::OpenFilesFlags(ICore::SwitchMode | ICore::CanContainLineAndColumnNumbers | ICore::SwitchSplitIfAlreadyVisible), FilePath::fromString(workingDirectory)); - m_mainWindow->raiseWindow(); + ICore::raiseMainWindow(); return res; } @@ -493,6 +492,6 @@ ExtensionSystem::IPlugin::ShutdownFlag CorePlugin::aboutToShutdown() { Find::aboutToShutdown(); m_locator->aboutToShutdown(); - m_mainWindow->aboutToShutdown(); + ICore::aboutToShutdown(); return SynchronousShutdown; } diff --git a/src/plugins/coreplugin/coreplugin.h b/src/plugins/coreplugin/coreplugin.h index fa73f951c13..f06caa83d7d 100644 --- a/src/plugins/coreplugin/coreplugin.h +++ b/src/plugins/coreplugin/coreplugin.h @@ -23,6 +23,7 @@ namespace Core { class FolderNavigationWidgetFactory; class SessionManager; +class ICore; namespace Internal { @@ -74,7 +75,7 @@ private: void checkSettings(); void warnAboutCrashReporing(); - MainWindow *m_mainWindow = nullptr; + ICore *m_core = nullptr; EditMode *m_editMode = nullptr; Locator *m_locator = nullptr; std::unique_ptr<SessionManager> m_sessionManager; diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index ba4c16a5d5d..144a34c337e 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -366,6 +366,7 @@ QWidget *ICore::newItemDialog() ICore::ICore() { m_core = this; + m_mainwindow = new MainWindow; connect(PluginManager::instance(), &PluginManager::testsFinished, this, [this](int failedTests) { @@ -388,6 +389,7 @@ ICore::ICore() */ ICore::~ICore() { + delete m_mainwindow; m_core = nullptr; m_mainwindow = nullptr; } @@ -886,6 +888,11 @@ void ICore::raiseWindow(QWidget *widget) } } +void ICore::raiseMainWindow() +{ + m_mainwindow->raiseWindow(); +} + /*! Removes the contexts specified by \a remove from the list of active additional contexts, and adds the contexts specified by \a add with \a @@ -1152,7 +1159,6 @@ enum { debugMainWindow = 0 }; void MainWindowPrivate::init() { - m_core = new ICore; m_progressManager = new ProgressManagerPrivate; m_jsExpander = JsExpander::createGlobalJsExpander(); m_vcsManager = new VcsManager; @@ -1266,11 +1272,6 @@ void MainWindowPrivate::setSidebarVisible(bool visible, Side side) navigationWidget(side)->setShown(visible); } -void MainWindow::setOverrideColor(const QColor &color) -{ - d->m_overrideColor = color; -} - QStringList MainWindow::additionalAboutInformation() const { return d->m_aboutInformation; @@ -1336,9 +1337,6 @@ MainWindowPrivate::~MainWindowPrivate() delete m_progressManager; m_progressManager = nullptr; - delete m_core; - m_core = nullptr; - delete m_rightPaneWidget; m_rightPaneWidget = nullptr; @@ -1349,18 +1347,20 @@ MainWindowPrivate::~MainWindowPrivate() m_jsExpander = nullptr; } -void MainWindow::init() +} // Internal + +void ICore::init() { d->m_progressManager->init(); // needs the status bar manager MessageManager::init(); OutputPaneManager::create(); } -void MainWindow::extensionsInitialized() +void ICore::extensionsInitialized() { EditorManagerPrivate::extensionsInitialized(); MimeTypeSettings::restoreSettings(); - d->m_windowSupport = new WindowSupport(this, Context("Core.MainWindow")); + d->m_windowSupport = new WindowSupport(m_mainwindow, Context("Core.MainWindow")); d->m_windowSupport->setCloseActionEnabled(false); OutputPaneManager::initialize(); VcsManager::extensionsInitialized(); @@ -1378,6 +1378,17 @@ void MainWindow::extensionsInitialized() QMetaObject::invokeMethod(m_core, &ICore::coreOpened, Qt::QueuedConnection); } +void ICore::aboutToShutdown() +{ + disconnect(qApp, &QApplication::focusChanged, d, &MainWindowPrivate::updateFocusWidget); + for (auto contextPair : d->m_contextWidgets) + disconnect(contextPair.second, &QObject::destroyed, m_mainwindow, nullptr); + d->m_activeContext.clear(); + m_mainwindow->hide(); +} + +namespace Internal { + static void setRestart(bool restart) { qApp->setProperty("restart", restart); @@ -2221,15 +2232,6 @@ void MainWindowPrivate::updateContextObject(const QList<IContext *> &context) } } -void MainWindow::aboutToShutdown() -{ - disconnect(qApp, &QApplication::focusChanged, d, &MainWindowPrivate::updateFocusWidget); - for (auto contextPair : d->m_contextWidgets) - disconnect(contextPair.second, &QObject::destroyed, this, nullptr); - d->m_activeContext.clear(); - hide(); -} - void MainWindowPrivate::readSettings() { QtcSettings *settings = PluginManager::settings(); @@ -2608,4 +2610,10 @@ void MainWindowPrivate::restoreWindowState() } } // namespace Internal + +void ICore::setOverrideColor(const QColor &color) +{ + d->m_overrideColor = color; +} + } // namespace Core diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index 95ba146cd32..62206c94594 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -46,10 +46,10 @@ class CORE_EXPORT ICore : public QObject friend class Internal::MainWindow; friend class Internal::MainWindowPrivate; +public: ICore(); ~ICore() override; -public: enum class ContextPriority { High, Low @@ -91,6 +91,7 @@ public: static Utils::InfoBar *infoBar(); static void raiseWindow(QWidget *widget); + static void raiseMainWindow(); static IContext *currentContextObject(); static QWidget *currentContextWidget(); @@ -157,6 +158,12 @@ public: static void saveSettings(SaveSettingsReason reason); static void setNewDialogFactory(const std::function<NewDialog *(QWidget *)> &newFactory); static void updateNewItemDialogState(); + + static void setOverrideColor(const QColor &color); + + static void init(); + static void extensionsInitialized(); + static void aboutToShutdown(); }; namespace Internal { @@ -169,10 +176,6 @@ public: MainWindow(); ~MainWindow() override; - void init(); - void extensionsInitialized(); - void aboutToShutdown(); - IContext *contextObject(QWidget *widget) const; void addContextObject(IContext *context); void removeContextObject(IContext *context); @@ -189,8 +192,6 @@ public: void updateAdditionalContexts(const Context &remove, const Context &add, ICore::ContextPriority priority); - void setOverrideColor(const QColor &color); - QStringList additionalAboutInformation() const; void clearAboutInformation(); void appendAboutInformation(const QString &line); diff --git a/src/plugins/coreplugin/messagemanager.h b/src/plugins/coreplugin/messagemanager.h index 147fe386af5..bde352afee4 100644 --- a/src/plugins/coreplugin/messagemanager.h +++ b/src/plugins/coreplugin/messagemanager.h @@ -14,6 +14,8 @@ QT_END_NAMESPACE namespace Core { +class ICore; + namespace Internal { class MainWindow; class MainWindowPrivate; @@ -42,8 +44,10 @@ private: ~MessageManager() override; static void init(); - friend class Core::Internal::MainWindow; - friend class Core::Internal::MainWindowPrivate; + + friend class ICore; + friend class Internal::MainWindow; + friend class Internal::MainWindowPrivate; }; } // namespace Core diff --git a/src/plugins/coreplugin/modemanager.h b/src/plugins/coreplugin/modemanager.h index 72427590194..191c9ee04e1 100644 --- a/src/plugins/coreplugin/modemanager.h +++ b/src/plugins/coreplugin/modemanager.h @@ -15,6 +15,7 @@ QT_END_NAMESPACE namespace Core { +class ICore; class IMode; namespace Internal { @@ -68,6 +69,7 @@ private: void currentTabAboutToChange(int index); void currentTabChanged(int index); + friend class ICore; friend class IMode; friend class Core::Internal::MainWindow; friend class Core::Internal::MainWindowPrivate; diff --git a/src/plugins/coreplugin/outputpanemanager.h b/src/plugins/coreplugin/outputpanemanager.h index a2224e9ae49..50a51c0416d 100644 --- a/src/plugins/coreplugin/outputpanemanager.h +++ b/src/plugins/coreplugin/outputpanemanager.h @@ -15,6 +15,9 @@ class QTimeLine; QT_END_NAMESPACE namespace Core { + +class ICore; + namespace Internal { class MainWindow; @@ -34,6 +37,11 @@ public: static int outputPaneHeightSetting(); static void setOutputPaneHeightSetting(int value); + // FIXME: Hide again + static void create(); + static void initialize(); + static void destroy(); + public slots: void slotHide(); void slotNext(); @@ -45,14 +53,11 @@ protected: private: // the only class that is allowed to create and destroy + friend class ICore; friend class MainWindow; friend class MainWindowPrivate; friend class OutputPaneManageButton; - static void create(); - static void initialize(); - static void destroy(); - explicit OutputPaneManager(QWidget *parent = nullptr); ~OutputPaneManager() override; From f01c4c40550349bec11fdbeeca17c2961c1c95c8 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 29 Sep 2023 12:11:25 +0200 Subject: [PATCH 1368/1777] SquishTests: Adapt to changed wizard Test projects have moved to their own category. Change-Id: If69aecffd19f40a3d24be1b88970f9cc0045272a Reviewed-by: David Schulz <david.schulz@qt.io> --- tests/system/suite_general/tst_create_proj_wizard/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py index d521f2092dd..4da9d39d732 100644 --- a/tests/system/suite_general/tst_create_proj_wizard/test.py +++ b/tests/system/suite_general/tst_create_proj_wizard/test.py @@ -33,8 +33,8 @@ def main(): # skip non-configurable if "Import" in category: continue - # FIXME - if "Qt for Python" in category: + # FIXME special or complicated + if "Qt for Python" in category or "Test Project" in category: continue mouseClick(waitForObjectItem(categoriesView, "Projects." + category)) templatesView = waitForObject("{name='templatesView' type='QListView' visible='1'}") @@ -45,7 +45,7 @@ def main(): if template == "Qt Quick 2 Extension Plugin": continue # skip non-configurable - if template not in ["Qt Quick UI Prototype", "Auto Test Project", "Qt Creator Plugin"]: + if template not in ["Qt Quick UI Prototype", "Qt Creator Plugin"]: availableProjectTypes.append({category:template}) safeClickButton("Cancel") for current in availableProjectTypes: From 1c5ecec39347a564b8595cbb69d1f3a1ae3c5360 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 26 Sep 2023 18:11:05 +0200 Subject: [PATCH 1369/1777] ProjectExplorer: Rewrite GccToolchain candidate identification Change-Id: I9555588b64e0beeafc854d13a43dd0fad32662e2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 133 ++++++++++++------- src/plugins/projectexplorer/gcctoolchain.h | 2 +- 2 files changed, 83 insertions(+), 52 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 34257ccaa78..700fff23b75 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -23,6 +23,7 @@ #include <utils/pathchooser.h> #include <utils/process.h> #include <utils/qtcassert.h> +#include <utils/scopedtimer.h> #include <QBuffer> #include <QCheckBox> @@ -1247,56 +1248,78 @@ GccToolChainFactory::GccToolChainFactory(GccToolChain::SubType subType) setUserCreatable(true); } -static FilePaths findCompilerCandidates(const ToolchainDetector &detector, +static FilePaths findCompilerCandidates(OsType os, + const FilePaths &executables, const QString &compilerName, bool detectVariants) { - QStringList nameFilters(compilerName); - if (detectVariants) { - nameFilters - << compilerName + "-[1-9]*" // "clang-8", "gcc-5" - << ("*-" + compilerName) // "avr-gcc", "avr32-gcc", "arm-none-eabi-gcc", - // "x86_64-pc-linux-gnu-gcc" - << ("*-" + compilerName + "-[1-9]*"); // "avr-gcc-4.8.1", "avr32-gcc-4.4.7", - // "arm-none-eabi-gcc-9.1.0" - // "x86_64-pc-linux-gnu-gcc-7.4.1" - } - const Utils::OsType os = detector.device->osType(); - nameFilters = transform(nameFilters, [os](const QString &baseName) { - return OsSpecificAspects::withExecutableSuffix(os, baseName); - }); + // We expect the following patterns: + // compilerName "clang", "gcc" + // compilerName + "-[1-9]*" "clang-8", "gcc-5" + // "*-" + compilerName "avr-gcc", "avr32-gcc" + // "arm-none-eabi-gcc" + // "x86_64-pc-linux-gnu-gcc" + // "*-" + compilerName + "-[1-9]*" "avr-gcc-4.8.1", "avr32-gcc-4.4.7" + // "arm-none-eabi-gcc-9.1.0" + // "x86_64-pc-linux-gnu-gcc-7.4.1" FilePaths compilerPaths; - for (const FilePath &searchPath : std::as_const(detector.searchPaths)) { - static const QRegularExpression regexp(binaryRegexp); - const auto callBack = [os, &compilerPaths, compilerName](const FilePath &candidate) { - if (candidate.fileName() == OsSpecificAspects::withExecutableSuffix(os, compilerName) - || regexp.match(candidate.path()).hasMatch()) { - compilerPaths << candidate; - } - return IterationPolicy::Continue; - }; - searchPath.iterateDirectory(callBack, {nameFilters, QDir::Files | QDir::Executable}); + const int cl = compilerName.size(); + for (const FilePath &executable : executables) { + QStringView fileName = executable.fileNameView(); + if (os == OsTypeWindows && fileName.endsWith(u".exe", Qt::CaseInsensitive)) + fileName.chop(4); + + if (fileName == compilerName) + compilerPaths << executable; + + if (!detectVariants) + continue; + + int pos = fileName.indexOf(compilerName); + if (pos == -1) + continue; + + // if not at the beginning, it must be preceded by a hyphen. + if (pos > 0 && fileName.at(pos - 1) != '-') + continue; + + // if not at the end, it must by followed by a hyphen and a digit between 1 and 9 + pos += cl; + if (pos != fileName.size()) { + if (pos + 2 >= fileName.size()) + continue; + if (fileName.at(pos) != '-') + continue; + const QChar c = fileName.at(pos + 1); + if (c < '1' || c > '9') + continue; + } + + compilerPaths << executable; } return compilerPaths; } -Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector_) const +Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) const { - QTC_ASSERT(detector_.device, return {}); + QTC_SCOPED_TIMER("Autodetect"); + + QTC_ASSERT(detector.device, return {}); // Do all autodetection in th 'RealGcc' case, and none in the others. if (!m_autoDetecting) return {}; - FilePaths searchPaths = detector_.searchPaths; - if (detector_.device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { + const bool isLocal = detector.device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE; + FilePaths searchPaths = detector.searchPaths; + if (!isLocal) { if (searchPaths.isEmpty()) - searchPaths = detector_.device->systemEnvironment().path(); + searchPaths = detector.device->systemEnvironment().path(); searchPaths = Utils::transform(searchPaths, [&](const FilePath &onDevice) { - return detector_.device->filePath(onDevice.path()); + return detector.device->filePath(onDevice.path()); }); } else if (searchPaths.isEmpty()) { searchPaths = Environment::systemEnvironment().path(); @@ -1317,24 +1340,32 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector_) c } } + FilePaths executables; - ToolchainDetector detector{detector_.alreadyKnown, detector_.device, searchPaths}; + QStringList nameFilters = {"*icpc*", "*icc*", "*g++*", "*gcc*", "*clang++*", "*clang*"}; + + FilePath::iterateDirectories(searchPaths, [&executables](const FilePath &path) { + executables.append(path); + return IterationPolicy::Continue; + }, {nameFilters, QDir::Files | QDir::Executable}); + + const OsType os = detector.device->osType(); Toolchains result; // Linux ICC - result += autoDetectToolchains(findCompilerCandidates(detector, "icpc", false), + result += autoDetectToolchains(findCompilerCandidates(os, executables, "icpc", false), Constants::CXX_LANGUAGE_ID, Constants::LINUXICC_TOOLCHAIN_TYPEID, - detector, + detector.alreadyKnown, &constructLinuxIccToolchain); - result += autoDetectToolchains(findCompilerCandidates(detector, "icc", true), + result += autoDetectToolchains(findCompilerCandidates(os, executables, "icc", true), Constants::C_LANGUAGE_ID, Constants::LINUXICC_TOOLCHAIN_TYPEID, - detector, + detector.alreadyKnown, &constructLinuxIccToolchain); // MinGW @@ -1343,16 +1374,16 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector_) c return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; }; - result += autoDetectToolchains(findCompilerCandidates(detector, "g++", true), + result += autoDetectToolchains(findCompilerCandidates(os, executables, "g++", true), Constants::CXX_LANGUAGE_ID, Constants::MINGW_TOOLCHAIN_TYPEID, - detector, + detector.alreadyKnown, &constructMinGWToolchain, tcChecker); - result += autoDetectToolchains(findCompilerCandidates(detector, "gcc", true), + result += autoDetectToolchains(findCompilerCandidates(os, executables, "gcc", true), Constants::C_LANGUAGE_ID, Constants::MINGW_TOOLCHAIN_TYPEID, - detector, + detector.alreadyKnown, &constructMinGWToolchain, tcChecker); @@ -1361,15 +1392,15 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector_) c Toolchains tcs; Toolchains known = detector.alreadyKnown; - tcs.append(autoDetectToolchains(findCompilerCandidates(detector, "clang++", true), + tcs.append(autoDetectToolchains(findCompilerCandidates(os, executables, "clang++", true), Constants::CXX_LANGUAGE_ID, Constants::CLANG_TOOLCHAIN_TYPEID, - detector, + detector.alreadyKnown, &constructClangToolchain)); - tcs.append(autoDetectToolchains(findCompilerCandidates(detector, "clang", true), + tcs.append(autoDetectToolchains(findCompilerCandidates(os, executables, "clang", true), Constants::C_LANGUAGE_ID, Constants::CLANG_TOOLCHAIN_TYPEID, - detector, + detector.alreadyKnown, &constructClangToolchain)); known.append(tcs); @@ -1379,7 +1410,7 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector_) c autoDetectToolchains({compilerPath}, Constants::C_LANGUAGE_ID, Constants::CLANG_TOOLCHAIN_TYPEID, - ToolchainDetector(known, detector.device, detector.searchPaths), + known, &constructClangToolchain)); } @@ -1395,16 +1426,16 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector_) c && tc->compilerCommand().fileName() != "c89-gcc" && tc->compilerCommand().fileName() != "c99-gcc"; }; - result += autoDetectToolchains(findCompilerCandidates(detector, "g++", true), + result += autoDetectToolchains(findCompilerCandidates(os, executables, "g++", true), Constants::CXX_LANGUAGE_ID, Constants::GCC_TOOLCHAIN_TYPEID, - detector, + detector.alreadyKnown, &constructRealGccToolchain, tcChecker); - result += autoDetectToolchains(findCompilerCandidates(detector, "gcc", true), + result += autoDetectToolchains(findCompilerCandidates(os, executables, "gcc", true), Constants::C_LANGUAGE_ID, Constants::GCC_TOOLCHAIN_TYPEID, - detector, + detector.alreadyKnown, &constructRealGccToolchain, tcChecker); } @@ -1483,11 +1514,11 @@ Toolchains GccToolChainFactory::detectForImport(const ToolChainDescription &tcd) Toolchains GccToolChainFactory::autoDetectToolchains(const FilePaths &compilerPaths, const Id language, const Id requiredTypeId, - const ToolchainDetector &detector, + const Toolchains &known, const ToolChainConstructor &constructor, const ToolchainChecker &checker) { - Toolchains existingCandidates = filtered(detector.alreadyKnown, + Toolchains existingCandidates = filtered(known, [language](const ToolChain *tc) { return tc->language() == language; }); Toolchains result; for (const FilePath &compilerPath : std::as_const(compilerPaths)) { diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index a549d2bbb37..0ab475195fa 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -196,7 +196,7 @@ private: static Toolchains autoDetectToolchains(const Utils::FilePaths &compilerPaths, const Utils::Id language, const Utils::Id requiredTypeId, - const ToolchainDetector &detector, + const Toolchains &known, const ToolChainConstructor &constructor, const ToolchainChecker &checker = {}); static Toolchains autoDetectToolChain(const ToolChainDescription &tcd, From 0c806f135937dc56b504962115eaf411d46a2c6e Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 29 Sep 2023 13:58:16 +0200 Subject: [PATCH 1370/1777] QtSupport: Fix VersionData cache Change-Id: I90d2b7d152123118b6244c86539868d185fde51b Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/qtsupport/baseqtversion.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 8cc56857231..8bc703e1817 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -119,19 +119,19 @@ public: QHash<ProKey, ProString> versionInfo; bool versionInfoUpToDate = false; - static QHash<ProKey, ProString> fromVariantMap(const QVariantMap &map) + static QHash<ProKey, ProString> fromStore(const Store &map) { QHash<ProKey, ProString> result; for (auto it = map.constBegin(); it != map.constEnd(); ++it) - result.insert(ProKey(it.key()), ProString(it.value().toString())); + result.insert(ProKey(it.key().toByteArray()), ProString(it.value().toString())); return result; } - static QVariantMap toVariantMap(const QHash<ProKey, ProString> &map) + static Store toStore(const QHash<ProKey, ProString> &map) { - QVariantMap result; + Store result; for (auto it = map.constBegin(); it != map.constEnd(); ++it) - result.insert(it.key().toQString(), it.value().toQString()); + result.insert(it.key().toString().toQString().toUtf8(), it.value().toQString()); return result; } @@ -170,7 +170,7 @@ public: result.insert("HostDataPath", hostDataPath.toSettings()); result.insert("HostPrefixPath", hostPrefixPath.toSettings()); result.insert("QtAbis", Utils::transform(qtAbis, &Abi::toString)); - result.insert("VersionInfo", toVariantMap(versionInfo)); + result.insert("VersionInfo", QVariant::fromValue(toStore(versionInfo))); return result; } @@ -209,7 +209,7 @@ public: hostDataPath = FilePath::fromSettings(map.value("HostDataPath")); hostPrefixPath = FilePath::fromSettings(map.value("HostPrefixPath")); qtAbis = Utils::transform(map.value("QtAbis").toStringList(), &Abi::fromString); - versionInfo = fromVariantMap(map.value("VersionInfo").toMap()); + versionInfo = fromStore(map.value("VersionInfo").value<Store>()); } }; From ba1e54b8a487a215a3105dacae159b909cc96375 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 29 Sep 2023 16:58:16 +0200 Subject: [PATCH 1371/1777] CMakePM: Add a sample Find Module CMake package snippet This is taken from https://cmake.org/cmake/help/latest/manual/cmake- developer.7.html#a-sample-find-module And provides three customization points: 1. $package$ - ZLIB 2. $header$.h - zlib.h 3. $library$ - zlib This way users can easily create FindZLIB.cmake find modules which can be easily used as target_link_libraries(my-app PRIVATE ZLIB::ZLIB) Change-Id: Id5143c46ecfde09419d4f43b9a3ff156401a88f9 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- share/qtcreator/snippets/cmake.xml | 85 ++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/share/qtcreator/snippets/cmake.xml b/share/qtcreator/snippets/cmake.xml index bed6ba042a7..96b1d563ac6 100644 --- a/share/qtcreator/snippets/cmake.xml +++ b/share/qtcreator/snippets/cmake.xml @@ -34,5 +34,90 @@ target_link_libraries($executable$ PRIVATE Qt6::Widgets) set_target_properties($executable$ PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE ON +)</snippet> + <snippet group="CMake" trigger="sample_find_module" id="cmake_sample_find_module" complement=""># https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#a-sample-find-module + +#[=======================================================================[.rst: +Find$package$ +------- + +Finds the $package$ library. + +Imported Targets +^^^^^^^^^^^^^^^^ + +This module provides the following imported targets, if found: + +``$package$::$package$`` + The $package$ library + +Result Variables +^^^^^^^^^^^^^^^^ + +This will define the following variables: + +``$package$_FOUND`` + True if the system has the $package$ library. +``$package$_VERSION`` + The version of the $package$ library which was found. +``$package$_INCLUDE_DIRS`` + Include directories needed to use $package$. +``$package$_LIBRARIES`` + Libraries needed to link to $package$. + +Cache Variables +^^^^^^^^^^^^^^^ + +The following cache variables may also be set: + +``$package$_INCLUDE_DIR`` + The directory containing ``$header$.h``. +``$package$_LIBRARY`` + The path to the $library$ library. + +#]=======================================================================] + +find_package(PkgConfig) +pkg_check_modules(PC_$package$ QUIET $package$) + +find_path($package$_INCLUDE_DIR + NAMES $header$.h + PATHS \\${PC_$package$_INCLUDE_DIRS} + PATH_SUFFIXES $package$ +) + +find_library($package$_LIBRARY + NAMES $library$ + PATHS \\${PC_$package$_LIBRARY_DIRS} +) + +set($package$_VERSION \\${PC_$package$_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args($package$ + FOUND_VAR $package$_FOUND + REQUIRED_VARS + $package$_LIBRARY + $package$_INCLUDE_DIR + VERSION_VAR $package$_VERSION +) + +if($package$_FOUND) + set($package$_LIBRARIES \\${$package$_LIBRARY}) + set($package$_INCLUDE_DIRS \\${$package$_INCLUDE_DIR}) +endif() + +if($package$_FOUND AND NOT TARGET $package$::$package$) + add_library($package$::$package$ UNKNOWN IMPORTED) + set_target_properties($package$::$package$ PROPERTIES + IMPORTED_LOCATION "\\${$package$_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "\\${PC_$package$_CFLAGS_OTHER}" + INTERFACE_INCLUDE_DIRECTORIES "\\${$package$_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced( + $package$_INCLUDE_DIR + $package$_LIBRARY )</snippet> </snippets> From 15903ad17ade0cba5ca98a3b40273465dbb8f826 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 29 Sep 2023 18:07:51 +0200 Subject: [PATCH 1372/1777] CMakePM: Allow http(s) Url navigation The CMake snippets do have comments with the origin of the snippet and this patchset allows navigation to the url in question. Change-Id: I6eb2565e8f7b9100a1cc19dbf8ccda430c698613 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakeeditor.cpp | 56 ++++++++++++++++--- 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index beed0d2ebe5..2a971048c92 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -145,6 +145,14 @@ static QString unescape(const QString &s) return result; } +static bool isValidUrlChar(const QChar &c) +{ + static QSet<QChar> urlChars{'-', '.', '_', '~', ':', '/', '?', '#', '[', ']', '@', '!', + '$', '&', '\'', '(', ')', '*', '+', ',', ';', '%', '='}; + + return (c.isLetterOrNumber() || urlChars.contains(c)) && !c.isSpace(); +} + QHash<QString, Utils::Link> getLocalSymbolsHash(const QByteArray &content, const Utils::FilePath &filePath) { cmListFile cmakeListFile; @@ -187,14 +195,50 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, const QString block = cursor.block().text(); + int beginPos = 0; + int endPos = 0; + auto addTextStartEndToLink = [&](Utils::Link &link) { + link.linkTextStart = cursor.position() - column + beginPos + 1; + link.linkTextEnd = cursor.position() - column + endPos; + return link; + }; + // check if the current position is commented out const qsizetype hashPos = block.indexOf(QLatin1Char('#')); - if (hashPos >= 0 && hashPos < column) + if (hashPos >= 0 && hashPos < column) { + // Check to see if we have a https:// link + QString buffer; + beginPos = column - 1; + while (beginPos > hashPos) { + if (isValidUrlChar(block[beginPos])) { + buffer.prepend(block.at(beginPos)); + beginPos--; + } else { + break; + } + } + // find the end of the url + endPos = column; + while (endPos < block.size()) { + if (isValidUrlChar(block[endPos])) { + buffer.append(block.at(endPos)); + endPos++; + } else { + break; + } + } + if (buffer.startsWith("http")) { + link.targetFilePath = FilePath::fromPathPart(buffer); + addTextStartEndToLink(link); + return processLinkCallback(link); + } + return processLinkCallback(link); + } // find the beginning of a filename QString buffer; - int beginPos = column - 1; + beginPos = column - 1; while (beginPos >= 0) { if (isValidFileNameChar(block, beginPos)) { buffer.prepend(block.at(beginPos)); @@ -205,7 +249,7 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, } // find the end of a filename - int endPos = column; + endPos = column; while (endPos < block.size()) { if (isValidFileNameChar(block, endPos)) { buffer.append(block.at(endPos)); @@ -222,12 +266,6 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, buffer.replace("${CMAKE_CURRENT_SOURCE_DIR}", dir.path()); buffer.replace("${CMAKE_CURRENT_LIST_DIR}", dir.path()); - auto addTextStartEndToLink = [&](Utils::Link &link) { - link.linkTextStart = cursor.position() - column + beginPos + 1; - link.linkTextEnd = cursor.position() - column + endPos; - return link; - }; - if (auto project = ProjectTree::currentProject()) { buffer.replace("${CMAKE_SOURCE_DIR}", project->projectDirectory().path()); if (auto bs = ProjectTree::currentBuildSystem()) { From b004a78645e98dd026e668b2c2f7d3beaa64d3f8 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh <orgad.shaneh@audiocodes.com> Date: Sun, 1 Oct 2023 20:51:46 +0300 Subject: [PATCH 1373/1777] ClearCase: Remove pointless function argument Change-Id: I5545090a5f28994b126cedd97496678d891f5184 Coverity-Id: 1568460 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/clearcase/clearcasesync.cpp | 7 +++---- src/plugins/clearcase/clearcasesync.h | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/plugins/clearcase/clearcasesync.cpp b/src/plugins/clearcase/clearcasesync.cpp index a61408e75ac..cc9d837fd2e 100644 --- a/src/plugins/clearcase/clearcasesync.cpp +++ b/src/plugins/clearcase/clearcasesync.cpp @@ -118,10 +118,9 @@ void ClearCaseSync::processCleartoolLsLine(const QDir &viewRootDir, const QStrin ClearCasePlugin::setStatus(absFile, FileStatus::CheckedIn, true); } -void ClearCaseSync::updateTotalFilesCount(const Key &view, ClearCaseSettings settings, - const int processed) +void ClearCaseSync::updateTotalFilesCount(const Key &view, const int processed) { - settings = ClearCasePlugin::settings(); // Might have changed while task was running + ClearCaseSettings settings = ClearCasePlugin::settings(); settings.totalFiles[view] = processed; ClearCasePlugin::setSettings(settings); } @@ -180,7 +179,7 @@ void ClearCaseSync::syncSnapshotView(QPromise<void> &promise, QStringList &files updateStatusForNotManagedFiles(files); promise.setProgressValue(totalFileCount + 1); if (!hot) - updateTotalFilesCount(view, settings, totalProcessed); + updateTotalFilesCount(view, totalProcessed); } } diff --git a/src/plugins/clearcase/clearcasesync.h b/src/plugins/clearcase/clearcasesync.h index a93d1852c06..7a303e6593b 100644 --- a/src/plugins/clearcase/clearcasesync.h +++ b/src/plugins/clearcase/clearcasesync.h @@ -26,8 +26,7 @@ public: void invalidateStatus(const QDir &viewRootDir, const QStringList &files); void invalidateStatusAllFiles(); void processCleartoolLsLine(const QDir &viewRootDir, const QString &buffer); - void updateTotalFilesCount(const Utils::Key &view, ClearCaseSettings settings, - const int processed); + void updateTotalFilesCount(const Utils::Key &view, const int processed); void updateStatusForNotManagedFiles(const QStringList &files); void syncDynamicView(QPromise<void> &promise, const ClearCaseSettings &settings); From 96abaa9d5df417d5e0b04a15e64d8438cc672420 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh <orgad.shaneh@audiocodes.com> Date: Sun, 1 Oct 2023 18:16:54 +0300 Subject: [PATCH 1374/1777] Meson: Add missing member initialization Coverity-Id: 1568464 Change-Id: I13baf0f7c807475d4a8452771579407565d6a3e2 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/mesonprojectmanager/mesonprojectparser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/mesonprojectmanager/mesonprojectparser.h b/src/plugins/mesonprojectmanager/mesonprojectparser.h index a027aaa4d03..e21fe5ec476 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectparser.h +++ b/src/plugins/mesonprojectmanager/mesonprojectparser.h @@ -88,7 +88,7 @@ private: Utils::FilePath m_srcDir; QFuture<ParserData *> m_parserFutureResult; bool m_configuring = false; - IntroDataType m_introType; + IntroDataType m_introType = IntroDataType::file; MesonInfoParser::Result m_parserResult; QStringList m_targetsNames; Utils::QtMajorVersion m_qtVersion = Utils::QtMajorVersion::Unknown; From eb9d2d8f17cee34dc9853d67af36473ac75b3861 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 2 Oct 2023 09:46:11 +0200 Subject: [PATCH 1375/1777] ProjectExplorer: Remove timing test code Amends 1c5ecec3934. Change-Id: I679da19b5c7cdb6d401ee396d11e0df37d6cc026 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 700fff23b75..c70ebab1cab 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1305,8 +1305,6 @@ static FilePaths findCompilerCandidates(OsType os, Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) const { - QTC_SCOPED_TIMER("Autodetect"); - QTC_ASSERT(detector.device, return {}); // Do all autodetection in th 'RealGcc' case, and none in the others. From 58c8fe823c8a4f91e99ad5411058c53e54d59db2 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 28 Sep 2023 15:16:50 +0200 Subject: [PATCH 1376/1777] ProjectExplorer: Simplify autoDetectToolChain parameters This leaves us larger freedom on what tool chain to construct later in the process, hopefully allowing us to handle real GCC and MinGW in one pass. Change-Id: I6b0ca1af428129924cef0ae31d684e6bc2735213 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 63 ++++++++++++-------- src/plugins/projectexplorer/gcctoolchain.h | 4 +- 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index c70ebab1cab..02fdc2b75d0 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -304,8 +304,24 @@ static FilePath gccInstallDir(const FilePath &compiler, // GccToolChain // -------------------------------------------------------------------------- +static Id idForSubType(GccToolChain::SubType subType) +{ + switch (subType) { + case GccToolChain::RealGcc: + return Constants::GCC_TOOLCHAIN_TYPEID; + case GccToolChain::Clang: + return Constants::CLANG_TOOLCHAIN_TYPEID; + case GccToolChain::MinGW: + return Constants::MINGW_TOOLCHAIN_TYPEID; + case GccToolChain::LinuxIcc: + return Constants::LINUXICC_TOOLCHAIN_TYPEID; + } + QTC_CHECK(false); + return Constants::GCC_TOOLCHAIN_TYPEID; +} + GccToolChain::GccToolChain(Utils::Id typeId, SubType subType) - : ToolChain(typeId), m_subType(subType) + : ToolChain(typeId.isValid() ? typeId : idForSubType(subType)), m_subType(subType) { setTypeDisplayName(Tr::tr("GCC")); setTargetAbiKey(targetAbiKeyC); @@ -1357,14 +1373,14 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co Constants::CXX_LANGUAGE_ID, Constants::LINUXICC_TOOLCHAIN_TYPEID, detector.alreadyKnown, - &constructLinuxIccToolchain); + GccToolChain::LinuxIcc); result += autoDetectToolchains(findCompilerCandidates(os, executables, "icc", true), Constants::C_LANGUAGE_ID, Constants::LINUXICC_TOOLCHAIN_TYPEID, detector.alreadyKnown, - &constructLinuxIccToolchain); + GccToolChain::LinuxIcc); // MinGW @@ -1376,13 +1392,13 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co Constants::CXX_LANGUAGE_ID, Constants::MINGW_TOOLCHAIN_TYPEID, detector.alreadyKnown, - &constructMinGWToolchain, + GccToolChain::MinGW, tcChecker); result += autoDetectToolchains(findCompilerCandidates(os, executables, "gcc", true), Constants::C_LANGUAGE_ID, Constants::MINGW_TOOLCHAIN_TYPEID, detector.alreadyKnown, - &constructMinGWToolchain, + GccToolChain::MinGW, tcChecker); // Clang @@ -1394,22 +1410,21 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co Constants::CXX_LANGUAGE_ID, Constants::CLANG_TOOLCHAIN_TYPEID, detector.alreadyKnown, - &constructClangToolchain)); + GccToolChain::Clang)); tcs.append(autoDetectToolchains(findCompilerCandidates(os, executables, "clang", true), Constants::C_LANGUAGE_ID, Constants::CLANG_TOOLCHAIN_TYPEID, detector.alreadyKnown, - &constructClangToolchain)); + GccToolChain::Clang)); known.append(tcs); const FilePath compilerPath = Core::ICore::clangExecutable(CLANG_BINDIR); if (!compilerPath.isEmpty()) { - tcs.append( - autoDetectToolchains({compilerPath}, - Constants::C_LANGUAGE_ID, - Constants::CLANG_TOOLCHAIN_TYPEID, - known, - &constructClangToolchain)); + tcs.append(autoDetectToolchains({compilerPath}, + Constants::C_LANGUAGE_ID, + Constants::CLANG_TOOLCHAIN_TYPEID, + known, + GccToolChain::Clang)); } result += tcs; @@ -1428,13 +1443,13 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co Constants::CXX_LANGUAGE_ID, Constants::GCC_TOOLCHAIN_TYPEID, detector.alreadyKnown, - &constructRealGccToolchain, + GccToolChain::RealGcc, tcChecker); result += autoDetectToolchains(findCompilerCandidates(os, executables, "gcc", true), Constants::C_LANGUAGE_ID, Constants::GCC_TOOLCHAIN_TYPEID, detector.alreadyKnown, - &constructRealGccToolchain, + GccToolChain::RealGcc, tcChecker); } @@ -1456,7 +1471,7 @@ Toolchains GccToolChainFactory::detectForImport(const ToolChainDescription &tcd) if ((tcd.language == Constants::CXX_LANGUAGE_ID && fileName.startsWith("icpc")) || (tcd.language == Constants::C_LANGUAGE_ID && fileName.startsWith("icc"))) { - result += autoDetectToolChain(tcd, &constructLinuxIccToolchain); + result += autoDetectToolChain(tcd, GccToolChain::LinuxIcc); } // MingW @@ -1470,7 +1485,7 @@ Toolchains GccToolChainFactory::detectForImport(const ToolChainDescription &tcd) || (fileName.startsWith("c++") || fileName.endsWith("c++"))); if (cCompiler || cxxCompiler) { - result += autoDetectToolChain(tcd, &constructMinGWToolchain, [](const ToolChain *tc) { + result += autoDetectToolChain(tcd, GccToolChain::MinGW, [](const ToolChain *tc) { return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; }); } @@ -1486,7 +1501,7 @@ Toolchains GccToolChainFactory::detectForImport(const ToolChainDescription &tcd) || (fileName == "c++" && resolvedSymlinksFileName.contains("clang"))); if (isCCompiler || isCxxCompiler) - result += autoDetectToolChain(tcd, &constructClangToolchain); + result += autoDetectToolChain(tcd, GccToolChain::Clang); // GCC @@ -1501,7 +1516,7 @@ Toolchains GccToolChainFactory::detectForImport(const ToolChainDescription &tcd) || (fileName == "c++" && !resolvedSymlinksFileName.contains("clang"))); if (isCCompiler || isCxxCompiler) { - result += autoDetectToolChain(tcd, &constructRealGccToolchain, [](const ToolChain *tc) { + result += autoDetectToolChain(tcd, GccToolChain::RealGcc, [](const ToolChain *tc) { return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor; }); } @@ -1513,7 +1528,7 @@ Toolchains GccToolChainFactory::autoDetectToolchains(const FilePaths &compilerPa const Id language, const Id requiredTypeId, const Toolchains &known, - const ToolChainConstructor &constructor, + const GccToolChain::SubType subType, const ToolchainChecker &checker) { Toolchains existingCandidates = filtered(known, @@ -1555,7 +1570,7 @@ Toolchains GccToolChainFactory::autoDetectToolchains(const FilePaths &compilerPa } if (!alreadyExists) { const QList<ToolChain *> newToolchains - = autoDetectToolChain({compilerPath, language}, constructor, checker); + = autoDetectToolChain({compilerPath, language}, subType, checker); result << newToolchains; existingCandidates << newToolchains; } @@ -1565,7 +1580,7 @@ Toolchains GccToolChainFactory::autoDetectToolchains(const FilePaths &compilerPa } Toolchains GccToolChainFactory::autoDetectToolChain(const ToolChainDescription &tcd, - const ToolChainConstructor &constructor, + const GccToolChain::SubType subType, const ToolchainChecker &checker) { Toolchains result; @@ -1586,9 +1601,7 @@ Toolchains GccToolChainFactory::autoDetectToolChain(const ToolChainDescription & systemEnvironment, macros); for (const Abi &abi : detectedAbis.supportedAbis) { - std::unique_ptr<GccToolChain> tc(dynamic_cast<GccToolChain *>(constructor())); - if (!tc) - return result; + std::unique_ptr<GccToolChain> tc(new GccToolChain({}, subType)); tc->setLanguage(tcd.language); tc->setDetection(ToolChain::AutoDetection); diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 0ab475195fa..542adb22d58 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -197,10 +197,10 @@ private: const Utils::Id language, const Utils::Id requiredTypeId, const Toolchains &known, - const ToolChainConstructor &constructor, + const GccToolChain::SubType subType, const ToolchainChecker &checker = {}); static Toolchains autoDetectToolChain(const ToolChainDescription &tcd, - const ToolChainConstructor &constructor, + const GccToolChain::SubType subType, const ToolchainChecker &checker = {}); const bool m_autoDetecting; From 064ebaf0a47d52bcbbf32d34234155b407b227d1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 28 Sep 2023 15:27:42 +0200 Subject: [PATCH 1377/1777] ProjectExplorer: Move autodetection checker creation ... to a later point in time, closer to its use. Change-Id: I578f818a9e11f0cbdbaece58a4b2b55ed482f65e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/projectexplorer/gcctoolchain.cpp | 40 ++++++++++---------- src/plugins/projectexplorer/gcctoolchain.h | 3 +- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 02fdc2b75d0..ecdb89d0e0a 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1384,22 +1384,17 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co // MinGW - static const auto tcChecker = [](const ToolChain *tc) { - return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; - }; - result += autoDetectToolchains(findCompilerCandidates(os, executables, "g++", true), Constants::CXX_LANGUAGE_ID, Constants::MINGW_TOOLCHAIN_TYPEID, detector.alreadyKnown, - GccToolChain::MinGW, - tcChecker); + GccToolChain::MinGW); + result += autoDetectToolchains(findCompilerCandidates(os, executables, "gcc", true), Constants::C_LANGUAGE_ID, Constants::MINGW_TOOLCHAIN_TYPEID, detector.alreadyKnown, - GccToolChain::MinGW, - tcChecker); + GccToolChain::MinGW); // Clang @@ -1434,23 +1429,16 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co // Gcc is almost never what you want on macOS, but it is by default found in /usr/bin if (!HostOsInfo::isMacHost() || detector.device->type() != Constants::DESKTOP_DEVICE_TYPE) { - static const auto tcChecker = [](const ToolChain *tc) { - return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor - && tc->compilerCommand().fileName() != "c89-gcc" - && tc->compilerCommand().fileName() != "c99-gcc"; - }; result += autoDetectToolchains(findCompilerCandidates(os, executables, "g++", true), Constants::CXX_LANGUAGE_ID, Constants::GCC_TOOLCHAIN_TYPEID, detector.alreadyKnown, - GccToolChain::RealGcc, - tcChecker); + GccToolChain::RealGcc); result += autoDetectToolchains(findCompilerCandidates(os, executables, "gcc", true), Constants::C_LANGUAGE_ID, Constants::GCC_TOOLCHAIN_TYPEID, detector.alreadyKnown, - GccToolChain::RealGcc, - tcChecker); + GccToolChain::RealGcc); } return result; @@ -1528,11 +1516,25 @@ Toolchains GccToolChainFactory::autoDetectToolchains(const FilePaths &compilerPa const Id language, const Id requiredTypeId, const Toolchains &known, - const GccToolChain::SubType subType, - const ToolchainChecker &checker) + const GccToolChain::SubType subType) { + ToolchainChecker checker; + + if (subType == GccToolChain::MinGW) { + checker = [](const ToolChain *tc) { + return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; + }; + } else if (subType == GccToolChain::RealGcc) { + checker = [](const ToolChain *tc) { + return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor + && tc->compilerCommand().fileName() != "c89-gcc" + && tc->compilerCommand().fileName() != "c99-gcc"; + }; + } + Toolchains existingCandidates = filtered(known, [language](const ToolChain *tc) { return tc->language() == language; }); + Toolchains result; for (const FilePath &compilerPath : std::as_const(compilerPaths)) { bool alreadyExists = false; diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 542adb22d58..5ed17857eaf 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -197,8 +197,7 @@ private: const Utils::Id language, const Utils::Id requiredTypeId, const Toolchains &known, - const GccToolChain::SubType subType, - const ToolchainChecker &checker = {}); + const GccToolChain::SubType subType); static Toolchains autoDetectToolChain(const ToolChainDescription &tcd, const GccToolChain::SubType subType, const ToolchainChecker &checker = {}); From 44836247ca6230b55f560eada727667f4cb52ce7 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Mon, 2 Oct 2023 10:01:28 +0200 Subject: [PATCH 1378/1777] DAP: Fix coverity warning Change-Id: Ieb8cc7133b9b2dea4a4d97ec109f82dac28f7950 Coverity-Id: 1568465 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/debugger/dap/dapengine.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index d722c14019c..686df98c472 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -476,13 +476,14 @@ void DapEngine::updateItem(const QString &iname) void DapEngine::reexpandItems(const QSet<QString> &inames) { QSet<QString> expandedInames = inames; - for (auto inames : watchHandler()->watcherNames().keys()) + const QList<QString> &watcherNames = watchHandler()->watcherNames().keys(); + for (const QString &inames : watcherNames) expandedInames.insert(watchHandler()->watcherName(inames)); - QList<QString> inamesVector = expandedInames.values().toVector(); + QList<QString> inamesVector = expandedInames.values(); inamesVector.sort(); - for (const QString &iname : inamesVector) { + for (const QString &iname : std::as_const(inamesVector)) { if (iname.startsWith("local.") || iname.startsWith("watch.")) m_variablesHandler->addVariable(iname, -1); } From 762b0518a26fbe4f0415902d2196d03b6e8c25c7 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 29 Sep 2023 22:39:01 +0200 Subject: [PATCH 1379/1777] CMakePM: Handle include(CMakeFileWithoutSuffix) navigation Check that the function operating upon is "include" and then match the word under cursor with a file from the project. Change-Id: Ia0131f08515c56582a1fb02a59d6b2e41ac04288 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 13 ++++ .../cmakeprojectmanager/cmakebuildsystem.h | 2 + .../cmakeprojectmanager/cmakeeditor.cpp | 64 ++++++++++++++++--- 3 files changed, 70 insertions(+), 9 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index a055d07149c..c0dbd23604b 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1379,12 +1379,25 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() } }; + // Prepare a hash with all .cmake files + m_dotCMakeFilesHash.clear(); + auto handleDotCMakeFiles = [&](const CMakeFileInfo &cmakeFile) { + if (cmakeFile.path.suffix() == "cmake") { + Utils::Link link; + link.targetFilePath = cmakeFile.path; + link.targetLine = 1; + link.targetColumn = 0; + m_dotCMakeFilesHash.insert(cmakeFile.path.completeBaseName(), link); + } + }; + for (const auto &cmakeFile : std::as_const(m_cmakeFiles)) { for (const auto &func : cmakeFile.cmakeListFile.Functions) { handleFunctionMacroOption(cmakeFile, func); handleImportedTargets(cmakeFile, func); handleProjectTargets(cmakeFile, func); handleFindPackageVariables(cmakeFile, func); + handleDotCMakeFiles(cmakeFile); } } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h index d29ee777d41..ffe32f7e210 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h @@ -123,6 +123,7 @@ public: CMakeKeywords projectKeywords() const { return m_projectKeywords; } QStringList projectImportedTargets() const { return m_projectImportedTargets; } QStringList projectFindPackageVariables() const { return m_projectFindPackageVariables; } + const QHash<QString, Utils::Link> &dotCMakeFilesHash() const { return m_dotCMakeFilesHash; } signals: void configurationCleared(); @@ -228,6 +229,7 @@ private: QList<CMakeBuildTarget> m_buildTargets; QSet<CMakeFileInfo> m_cmakeFiles; QHash<QString, Utils::Link> m_cmakeSymbolsHash; + QHash<QString, Utils::Link> m_dotCMakeFilesHash; CMakeKeywords m_projectKeywords; QStringList m_projectImportedTargets; QStringList m_projectFindPackageVariables; diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 2a971048c92..0e77b2f1745 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -153,6 +153,11 @@ static bool isValidUrlChar(const QChar &c) return (c.isLetterOrNumber() || urlChars.contains(c)) && !c.isSpace(); } +static bool isValidIdentifierChar(const QChar &chr) +{ + return chr.isLetterOrNumber() || chr == '_' || chr == '-'; +} + QHash<QString, Utils::Link> getLocalSymbolsHash(const QByteArray &content, const Utils::FilePath &filePath) { cmListFile cmakeListFile; @@ -266,6 +271,43 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, buffer.replace("${CMAKE_CURRENT_SOURCE_DIR}", dir.path()); buffer.replace("${CMAKE_CURRENT_LIST_DIR}", dir.path()); + // Lambdas to find the CMake function name + auto findFunctionStart = [cursor, this]() -> int { + int pos = cursor.position(); + QChar chr; + do { + chr = textDocument()->characterAt(--pos); + } while (pos > 0 && chr != '('); + + if (pos > 0 && chr == '(') { + // allow space between function name and ( + do { + chr = textDocument()->characterAt(--pos); + } while (pos > 0 && chr.isSpace()); + ++pos; + } + return pos; + }; + auto findFunctionEnd = [cursor, this]() -> int { + int pos = cursor.position(); + QChar chr; + do { + chr = textDocument()->characterAt(--pos); + } while (pos > 0 && chr != ')'); + return pos; + }; + auto findWordStart = [cursor, this](int pos) -> int { + // Find start position + QChar chr; + do { + chr = textDocument()->characterAt(--pos); + } while (pos > 0 && isValidIdentifierChar(chr)); + + return ++pos; + }; + const int funcStart = findFunctionStart(); + const int funcEnd = findFunctionEnd(); + if (auto project = ProjectTree::currentProject()) { buffer.replace("${CMAKE_SOURCE_DIR}", project->projectDirectory().path()); if (auto bs = ProjectTree::currentBuildSystem()) { @@ -295,20 +337,24 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, addTextStartEndToLink(link); return processLinkCallback(link); } + + // Handle include(CMakeFileWithoutSuffix) + QString functionName; + if (funcStart > funcEnd) { + int funcStartPos = findWordStart(funcStart); + functionName = textDocument()->textAt(funcStartPos, funcStart - funcStartPos); + if (functionName == "include" && cbs->dotCMakeFilesHash().contains(buffer)) { + link = cbs->dotCMakeFilesHash().value(buffer); + addTextStartEndToLink(link); + return processLinkCallback(link); + } + } } } // TODO: Resolve more variables // Resolve local variables and functions - auto findFunctionEnd = [cursor, this]() -> int { - int pos = cursor.position(); - QChar chr; - do { - chr = textDocument()->characterAt(--pos); - } while (pos > 0 && chr != ')'); - return pos; - }; - auto hash = getLocalSymbolsHash(textDocument()->textAt(0, findFunctionEnd() + 1).toUtf8(), + auto hash = getLocalSymbolsHash(textDocument()->textAt(0, funcEnd + 1).toUtf8(), textDocument()->filePath()); // Strip variable coating From 5c52bdd0e9142905881e28808c70d8ebae09a494 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 28 Sep 2023 08:12:35 +0200 Subject: [PATCH 1380/1777] Meson: Hide plugin class definition in .cpp file Not meant to be used outside. Change-Id: Ic9de5cd19d01e25c2d24ee3b03dd60c61fc6f205 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../mesonprojectmanager/CMakeLists.txt | 1 - .../mesonprojectmanager.qbs | 1 - .../mesonprojectplugin.cpp | 36 ++++++++++++------- .../mesonprojectmanager/mesonprojectplugin.h | 26 -------------- 4 files changed, 24 insertions(+), 40 deletions(-) delete mode 100644 src/plugins/mesonprojectmanager/mesonprojectplugin.h diff --git a/src/plugins/mesonprojectmanager/CMakeLists.txt b/src/plugins/mesonprojectmanager/CMakeLists.txt index 9fc1f89b6f8..da8f32ef701 100644 --- a/src/plugins/mesonprojectmanager/CMakeLists.txt +++ b/src/plugins/mesonprojectmanager/CMakeLists.txt @@ -33,7 +33,6 @@ add_qtc_plugin(MesonProjectManager mesonprojectparser.cpp mesonprojectparser.h mesonprojectplugin.cpp - mesonprojectplugin.h mesonrunconfiguration.cpp mesonrunconfiguration.h mesontoolkitaspect.cpp diff --git a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs index df1c076eb60..b0c84579132 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs +++ b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs @@ -40,7 +40,6 @@ Project { "target.h", "mesonpluginconstants.h", "mesonprojectplugin.cpp", - "mesonprojectplugin.h", "arrayoptionlineedit.cpp", "arrayoptionlineedit.h", "buildoptionsmodel.cpp", diff --git a/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp b/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp index 71ef57462b2..3b3a9e6b862 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp +++ b/src/plugins/mesonprojectmanager/mesonprojectplugin.cpp @@ -1,8 +1,6 @@ // Copyright (C) 2020 Alexis Jeandet. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "mesonprojectplugin.h" - #include "mesonactionsmanager.h" #include "mesonbuildconfiguration.h" #include "mesonbuildsystem.h" @@ -12,6 +10,8 @@ #include "toolssettingsaccessor.h" #include "toolssettingspage.h" +#include <extensionsystem/iplugin.h> + #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/runcontrol.h> @@ -36,18 +36,30 @@ public: SimpleTargetRunnerFactory m_mesonRunWorkerFactory{{m_runConfigurationFactory.runConfigurationId()}}; }; -MesonProjectPlugin::~MesonProjectPlugin() +class MesonProjectPlugin final : public ExtensionSystem::IPlugin { - delete d; -} + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "MesonProjectManager.json") -void MesonProjectPlugin::initialize() -{ - d = new MesonProjectPluginPrivate; +public: + ~MesonProjectPlugin() final + { + delete d; + } - ProjectManager::registerProjectType<MesonProject>(Constants::Project::MIMETYPE); - FileIconProvider::registerIconOverlayForFilename(Constants::Icons::MESON, "meson.build"); - FileIconProvider::registerIconOverlayForFilename(Constants::Icons::MESON, "meson_options.txt"); -} +private: + void initialize() final + { + d = new MesonProjectPluginPrivate; + + ProjectManager::registerProjectType<MesonProject>(Constants::Project::MIMETYPE); + FileIconProvider::registerIconOverlayForFilename(Constants::Icons::MESON, "meson.build"); + FileIconProvider::registerIconOverlayForFilename(Constants::Icons::MESON, "meson_options.txt"); + } + + class MesonProjectPluginPrivate *d = nullptr; +}; } // MesonProjectManager::Internal + +#include "mesonprojectplugin.moc" diff --git a/src/plugins/mesonprojectmanager/mesonprojectplugin.h b/src/plugins/mesonprojectmanager/mesonprojectplugin.h deleted file mode 100644 index 6cae4586dc5..00000000000 --- a/src/plugins/mesonprojectmanager/mesonprojectplugin.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2020 Alexis Jeandet. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <extensionsystem/iplugin.h> - -namespace MesonProjectManager { -namespace Internal { - -class MesonProjectPlugin final : public ExtensionSystem::IPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "MesonProjectManager.json") - -public: - ~MesonProjectPlugin() final; - -private: - void initialize() final; - - class MesonProjectPluginPrivate *d = nullptr; -}; - -} // namespace Internal -} // namespace MesonProjectManager From bc5a2dbf143d62276c9bae5b08d0defed98d4506 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 27 Sep 2023 19:36:19 +0200 Subject: [PATCH 1381/1777] CtfVisualizer: Do some cleanup Remove unused headers. Use using namespace and drop unneeded namespace scopes. Replace QVector with QList. Return default constructed objects in default return statements. Avoid empty arg brackets in some lambdas. Use default member initializers. Change-Id: I11e62a291be3fa5bde4156e7a316765ee697b852 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../ctfvisualizer/ctfstatisticsmodel.cpp | 18 +++----- .../ctfvisualizer/ctfstatisticsmodel.h | 13 ++---- .../ctfvisualizer/ctfstatisticsview.cpp | 8 ++-- src/plugins/ctfvisualizer/ctfstatisticsview.h | 8 +--- .../ctfvisualizer/ctftimelinemodel.cpp | 16 +++---- src/plugins/ctfvisualizer/ctftimelinemodel.h | 26 +++++------ src/plugins/ctfvisualizer/ctftracemanager.cpp | 9 ++-- src/plugins/ctfvisualizer/ctftracemanager.h | 6 +-- .../ctfvisualizer/ctfvisualizerconstants.h | 6 +-- .../ctfvisualizer/ctfvisualizerplugin.cpp | 6 +-- .../ctfvisualizer/ctfvisualizerplugin.h | 6 +-- .../ctfvisualizer/ctfvisualizertool.cpp | 43 ++++++++----------- src/plugins/ctfvisualizer/ctfvisualizertool.h | 12 +++--- .../ctfvisualizer/ctfvisualizertraceview.cpp | 11 ++--- .../ctfvisualizer/ctfvisualizertraceview.h | 8 +--- 15 files changed, 71 insertions(+), 125 deletions(-) diff --git a/src/plugins/ctfvisualizer/ctfstatisticsmodel.cpp b/src/plugins/ctfvisualizer/ctfstatisticsmodel.cpp index f9b16569034..6c29e787970 100644 --- a/src/plugins/ctfvisualizer/ctfstatisticsmodel.cpp +++ b/src/plugins/ctfvisualizer/ctfstatisticsmodel.cpp @@ -2,21 +2,18 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "ctfstatisticsmodel.h" -#include "ctfvisualizerconstants.h" #include "ctfvisualizertr.h" +#include "json/json.hpp" #include <tracing/timelineformattime.h> -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { using json = nlohmann::json; -using namespace Constants; CtfStatisticsModel::CtfStatisticsModel(QObject *parent) : QAbstractTableModel(parent) { - } void CtfStatisticsModel::beginLoading() @@ -59,7 +56,7 @@ int CtfStatisticsModel::columnCount(const QModelIndex &parent) const QVariant CtfStatisticsModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) - return QVariant(); + return {}; auto it = m_data.cbegin(); std::advance(it, index.row()); @@ -79,7 +76,7 @@ QVariant CtfStatisticsModel::data(const QModelIndex &index, int role) const return Qt::AlignRight; default: Q_UNREACHABLE(); - return QVariant(); + return {}; } case SortRole: switch (index.column()) { @@ -106,7 +103,7 @@ QVariant CtfStatisticsModel::data(const QModelIndex &index, int role) const case Column::MaxDuration: return m_data.value(title).maxDuration; default: - return QVariant(); + return {}; } case Qt::DisplayRole: switch (index.column()) { @@ -158,7 +155,7 @@ QVariant CtfStatisticsModel::data(const QModelIndex &index, int role) const } } - return QVariant(); + return {}; } QVariant CtfStatisticsModel::headerData(int section, Qt::Orientation orientation, int role) const @@ -186,5 +183,4 @@ QVariant CtfStatisticsModel::headerData(int section, Qt::Orientation orientation } } -} // Internal -} // CtfVisualizer +} // CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctfstatisticsmodel.h b/src/plugins/ctfvisualizer/ctfstatisticsmodel.h index 49d7022ca1f..aaf0f65b8ff 100644 --- a/src/plugins/ctfvisualizer/ctfstatisticsmodel.h +++ b/src/plugins/ctfvisualizer/ctfstatisticsmodel.h @@ -3,16 +3,10 @@ #pragma once -#include "json/json.hpp" - -#include <QHash> -#include <QStack> -#include <QVector> -#include <QPointer> #include <QAbstractTableModel> +#include <QHash> -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { class CtfStatisticsModel : public QAbstractTableModel { @@ -61,5 +55,4 @@ private: }; -} // Internal -} // CtfVisualizer +} // CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctfstatisticsview.cpp b/src/plugins/ctfvisualizer/ctfstatisticsview.cpp index 583d1929a42..a1bb52f7e7a 100644 --- a/src/plugins/ctfvisualizer/ctfstatisticsview.cpp +++ b/src/plugins/ctfvisualizer/ctfstatisticsview.cpp @@ -7,8 +7,7 @@ #include <QHeaderView> #include <QSortFilterProxyModel> -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { CtfStatisticsView::CtfStatisticsView(CtfStatisticsModel *model, QWidget *parent) : Utils::TreeView(parent) @@ -31,7 +30,7 @@ CtfStatisticsView::CtfStatisticsView(CtfStatisticsModel *model, QWidget *parent) setSortingEnabled(true); connect(selectionModel(), &QItemSelectionModel::currentChanged, this, - [this] (const QModelIndex ¤t, const QModelIndex &previous) + [this](const QModelIndex ¤t, const QModelIndex &previous) { Q_UNUSED(previous); QModelIndex index = this->model()->index(current.row(), CtfStatisticsModel::Title); @@ -56,5 +55,4 @@ void CtfStatisticsView::selectByTitle(const QString &title) } } -} // Internal -} // CtfVisualizer +} // CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctfstatisticsview.h b/src/plugins/ctfvisualizer/ctfstatisticsview.h index 5c3e5f85a25..1a178180bcb 100644 --- a/src/plugins/ctfvisualizer/ctfstatisticsview.h +++ b/src/plugins/ctfvisualizer/ctfstatisticsview.h @@ -3,12 +3,9 @@ #pragma once -#include "ctfvisualizerconstants.h" - #include <utils/itemviews.h> -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { class CtfStatisticsModel; @@ -25,5 +22,4 @@ signals: void eventTypeSelected(const QString &title); }; -} // Internal -} // CtfVisualizer +} // CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctftimelinemodel.cpp b/src/plugins/ctfvisualizer/ctftimelinemodel.cpp index f558e3599f9..01288772760 100644 --- a/src/plugins/ctfvisualizer/ctftimelinemodel.cpp +++ b/src/plugins/ctfvisualizer/ctftimelinemodel.cpp @@ -8,16 +8,12 @@ #include "ctfvisualizertr.h" #include <tracing/timelineformattime.h> -#include <tracing/timelinemodelaggregator.h> -#include <utils/qtcassert.h> -#include <QDebug> +#include <utils/qtcassert.h> #include <string> - -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { using json = nlohmann::json; using namespace Constants; @@ -46,7 +42,7 @@ QVariantList CtfTimelineModel::labels() const { QVariantList result; - QVector<std::string> sortedCounterNames = m_counterNames; + QList<std::string> sortedCounterNames = m_counterNames; std::sort(sortedCounterNames.begin(), sortedCounterNames.end()); for (int i = 0; i < sortedCounterNames.size(); ++i) { QVariantMap element; @@ -190,7 +186,7 @@ void CtfTimelineModel::finalize(double traceBegin, double traceEnd, const QStrin m_rows = computeRows(&m_maxStackSize); ++m_maxStackSize; // index -> count - QVector<std::string> sortedCounterNames = m_counterNames; + QList<std::string> sortedCounterNames = m_counterNames; std::sort(sortedCounterNames.begin(), sortedCounterNames.end()); m_counterIndexToRow.resize(m_counterNames.size()); for (int i = 0; i < m_counterIndexToRow.size(); ++i) { @@ -376,7 +372,5 @@ const QString &CtfTimelineModel::reuse(const QString &value) return *it; } - -} // namespace Internal -} // namespace CtfVisualizer +} // namespace CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctftimelinemodel.h b/src/plugins/ctfvisualizer/ctftimelinemodel.h index fe7d8c4c0ad..00d8b80bacc 100644 --- a/src/plugins/ctfvisualizer/ctftimelinemodel.h +++ b/src/plugins/ctfvisualizer/ctftimelinemodel.h @@ -6,17 +6,14 @@ #include <tracing/timelinemodel.h> +#include <QList> #include <QMap> #include <QSet> #include <QStack> -#include <QVector> -namespace Timeline { -class TimelineModelAggregator; -} +namespace Timeline { class TimelineModelAggregator; } -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { class CtfTraceManager; @@ -73,8 +70,8 @@ protected: QString m_processName; int m_maxStackSize = 0; - QVector<int> m_rows; - QVector<QMap<int, QPair<QString, QString>>> m_details; + QList<int> m_rows; + QList<QMap<int, QPair<QString, QString>>> m_details; QSet<int> m_handledTypeIds; QStack<int> m_openEventIds; QSet<QString> m_reusableStrings; @@ -86,12 +83,11 @@ protected: float max = std::numeric_limits<float>::min(); }; - QVector<std::string> m_counterNames; - QVector<CounterData> m_counterData; - QVector<float> m_counterValues; - QVector<int> m_itemToCounterIdx; - QVector<int> m_counterIndexToRow; + QList<std::string> m_counterNames; + QList<CounterData> m_counterData; + QList<float> m_counterValues; + QList<int> m_itemToCounterIdx; + QList<int> m_counterIndexToRow; }; -} // namespace Internal -} // namespace CtfVisualizer +} // namespace CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctftracemanager.cpp b/src/plugins/ctfvisualizer/ctftracemanager.cpp index c9fe7f2b351..5a83a2f6c17 100644 --- a/src/plugins/ctfvisualizer/ctftracemanager.cpp +++ b/src/plugins/ctfvisualizer/ctftracemanager.cpp @@ -13,11 +13,9 @@ #include <QMessageBox> -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { using json = nlohmann::json; - using namespace Constants; CtfTraceManager::CtfTraceManager(QObject *parent, @@ -152,7 +150,7 @@ QList<CtfTimelineModel *> CtfTraceManager::getSortedThreads() const QList<CtfTimelineModel *> models = m_threadModels.values(); std::sort(models.begin(), models.end(), - [](const CtfTimelineModel *a, const CtfTimelineModel *b) -> bool { + [](const CtfTimelineModel *a, const CtfTimelineModel *b) { return (a->m_processId != b->m_processId) ? (a->m_processId < b->m_processId) : (a->m_threadId < b->m_threadId); }); @@ -238,5 +236,4 @@ QString CtfTraceManager::errorString() const return m_errorString; } -} // namespace Internal -} // namespace CtfVisualizer +} // namespace CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctftracemanager.h b/src/plugins/ctfvisualizer/ctftracemanager.h index 82d879ab463..94b5b1d7ca1 100644 --- a/src/plugins/ctfvisualizer/ctftracemanager.h +++ b/src/plugins/ctfvisualizer/ctftracemanager.h @@ -11,8 +11,7 @@ namespace Timeline { class TimelineModelAggregator; } -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { class CtfStatisticsModel; class CtfTimelineModel; @@ -71,5 +70,4 @@ protected: QString m_errorString; }; -} // namespace Internal -} // namespace CtfVisualizer +} // namespace CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctfvisualizerconstants.h b/src/plugins/ctfvisualizer/ctfvisualizerconstants.h index f5fcca12a75..fae1ab7dd85 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizerconstants.h +++ b/src/plugins/ctfvisualizer/ctfvisualizerconstants.h @@ -4,8 +4,7 @@ #include <string> -namespace CtfVisualizer { -namespace Constants { +namespace CtfVisualizer::Constants { const char CtfVisualizerMenuId[] = "Analyzer.Menu.CtfVisualizer"; const char CtfVisualizerTaskLoadJson[] = @@ -31,5 +30,4 @@ const char CtfEventTypeInstant[] = "i"; const char CtfEventTypeInstantDeprecated[] = "I"; const char CtfEventTypeCounter[] = "C"; -} // namespace Constants -} // namespace CtfVisualizer +} // namespace CtfVisualizer::Constants diff --git a/src/plugins/ctfvisualizer/ctfvisualizerplugin.cpp b/src/plugins/ctfvisualizer/ctfvisualizerplugin.cpp index 9c908536bb9..1ccbc210dfc 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizerplugin.cpp +++ b/src/plugins/ctfvisualizer/ctfvisualizerplugin.cpp @@ -5,8 +5,7 @@ #include "ctfvisualizertool.h" -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { class CtfVisualizerPluginPrivate { @@ -24,5 +23,4 @@ void CtfVisualizerPlugin::initialize() d = new CtfVisualizerPluginPrivate; } -} // namespace Internal -} // namespace CtfVisualizer +} // namespace CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctfvisualizerplugin.h b/src/plugins/ctfvisualizer/ctfvisualizerplugin.h index 4550606940b..54e759db580 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizerplugin.h +++ b/src/plugins/ctfvisualizer/ctfvisualizerplugin.h @@ -5,8 +5,7 @@ #include <extensionsystem/iplugin.h> -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { class CtfVisualizerPlugin : public ExtensionSystem::IPlugin { @@ -21,5 +20,4 @@ public: class CtfVisualizerPluginPrivate *d = nullptr; }; -} // namespace Internal -} // namespace CtfVisualizer +} // namespace CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp index 7e21050d9d8..7214e9130da 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp +++ b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp @@ -31,17 +31,14 @@ using namespace Core; using namespace CtfVisualizer::Constants; using namespace Utils; -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { + +using json = nlohmann::json; CtfVisualizerTool::CtfVisualizerTool() - : QObject (nullptr) - , m_loadJson(nullptr) - , m_traceView(nullptr) - , m_modelAggregator(new Timeline::TimelineModelAggregator(this)) + : m_modelAggregator(new Timeline::TimelineModelAggregator(this)) , m_zoomControl(new Timeline::TimelineZoomControl(this)) , m_statisticsModel(new CtfStatisticsModel(this)) - , m_statisticsView(nullptr) , m_traceManager(new CtfTraceManager(this, m_modelAggregator.get(), m_statisticsModel.get())) , m_restrictToThreadsButton(new QToolButton) , m_restrictToThreadsMenu(new QMenu(m_restrictToThreadsButton)) @@ -68,12 +65,12 @@ CtfVisualizerTool::CtfVisualizerTool() }); options->addAction(command); - m_perspective.setAboutToActivateCallback([this]() { createViews(); }); + m_perspective.setAboutToActivateCallback([this] { createViews(); }); - m_restrictToThreadsButton->setIcon(Utils::Icons::FILTER.icon()); + m_restrictToThreadsButton->setIcon(Icons::FILTER.icon()); m_restrictToThreadsButton->setToolTip(Tr::tr("Restrict to Threads")); m_restrictToThreadsButton->setPopupMode(QToolButton::InstantPopup); - m_restrictToThreadsButton->setProperty(Utils::StyleHelper::C_NO_ARROW, true); + m_restrictToThreadsButton->setProperty(StyleHelper::C_NO_ARROW, true); m_restrictToThreadsButton->setMenu(m_restrictToThreadsMenu); connect(m_restrictToThreadsMenu, &QMenu::triggered, this, &CtfVisualizerTool::toggleThreadRestriction); @@ -90,7 +87,7 @@ void CtfVisualizerTool::createViews() QMenu *contextMenu = new QMenu(m_traceView); contextMenu->addAction(m_loadJson.get()); - connect(contextMenu->addAction(Tr::tr("Reset Zoom")), &QAction::triggered, this, [this](){ + connect(contextMenu->addAction(Tr::tr("Reset Zoom")), &QAction::triggered, this, [this] { m_zoomControl->setRange(m_zoomControl->traceStart(), m_zoomControl->traceEnd()); }); @@ -100,7 +97,7 @@ void CtfVisualizerTool::createViews() contextMenu->exec(m_traceView->mapToGlobal(pos)); }); - m_perspective.addWindow(m_traceView, Utils::Perspective::OperationType::SplitVertical, nullptr); + m_perspective.addWindow(m_traceView, Perspective::OperationType::SplitVertical, nullptr); m_statisticsView = new CtfStatisticsView(m_statisticsModel.get()); m_statisticsView->setWindowTitle(Tr::tr("Statistics")); @@ -111,9 +108,9 @@ void CtfVisualizerTool::createViews() connect(m_traceManager.get(), &CtfTraceManager::detailsRequested, m_statisticsView, &CtfStatisticsView::selectByTitle); - m_perspective.addWindow(m_statisticsView, Utils::Perspective::AddToTab, m_traceView); + m_perspective.addWindow(m_statisticsView, Perspective::AddToTab, m_traceView); - m_perspective.setAboutToActivateCallback(Utils::Perspective::Callback()); + m_perspective.setAboutToActivateCallback(Perspective::Callback()); } void CtfVisualizerTool::setAvailableThreads(const QList<CtfTimelineModel *> &threads) @@ -152,12 +149,11 @@ Timeline::TimelineZoomControl *CtfVisualizerTool::zoomControl() const class CtfJsonParserFunctor { public: - CtfJsonParserFunctor(QPromise<nlohmann::json> &promise) + CtfJsonParserFunctor(QPromise<json> &promise) : m_promise(promise) {} - bool operator()(int depth, nlohmann::json::parse_event_t event, nlohmann::json &parsed) + bool operator()(int depth, json::parse_event_t event, json &parsed) { - using json = nlohmann::json; if ((event == json::parse_event_t::array_start && depth == 0) || (event == json::parse_event_t::key && depth == 1 && parsed == json(CtfTraceEventsKey))) { m_isInTraceArray = true; @@ -182,15 +178,13 @@ public: } protected: - QPromise<nlohmann::json> &m_promise; + QPromise<json> &m_promise; bool m_isInTraceArray = false; int m_traceArrayDepth = 0; }; -static void load(QPromise<nlohmann::json> &promise, const QString &fileName) +static void load(QPromise<json> &promise, const QString &fileName) { - using json = nlohmann::json; - std::ifstream file(fileName.toStdString()); if (!file.is_open()) { promise.future().cancel(); @@ -218,7 +212,7 @@ void CtfVisualizerTool::loadJson(const QString &fileName) if (m_loader || fileName.isEmpty()) return; - const auto onSetup = [this, fileName](Async<nlohmann::json> &async) { + const auto onSetup = [this, fileName](Async<json> &async) { m_traceManager->clearAll(); async.setConcurrentCallData(load, fileName); connect(&async, &AsyncBase::resultReadyAt, this, [this, asyncPtr = &async](int index) { @@ -251,7 +245,7 @@ void CtfVisualizerTool::loadJson(const QString &fileName) m_loader.release()->deleteLater(); }; - const Group recipe { AsyncTask<nlohmann::json>(onSetup) }; + const Group recipe { AsyncTask<json>(onSetup) }; m_loader.reset(new TaskTree(recipe)); connect(m_loader.get(), &TaskTree::done, this, onDone); connect(m_loader.get(), &TaskTree::errorOccurred, this, onError); @@ -260,5 +254,4 @@ void CtfVisualizerTool::loadJson(const QString &fileName) m_loader->start(); } -} // namespace Internal -} // namespace CtfVisualizer +} // namespace CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctfvisualizertool.h b/src/plugins/ctfvisualizer/ctfvisualizertool.h index 00be211efac..de2facffe75 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertool.h +++ b/src/plugins/ctfvisualizer/ctfvisualizertool.h @@ -15,8 +15,7 @@ namespace Tasking { class TaskTree; } -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { class CtfTraceManager; class CtfStatisticsModel; @@ -47,19 +46,19 @@ private: void setAvailableThreads(const QList<CtfTimelineModel *> &threads); void toggleThreadRestriction(QAction *action); - Utils::Perspective m_perspective{CtfVisualizer::Constants::CtfVisualizerPerspectiveId, + Utils::Perspective m_perspective{Constants::CtfVisualizerPerspectiveId, QCoreApplication::translate("QtC::CtfVisualizer", "Chrome Trace Format Visualizer")}; std::unique_ptr<Tasking::TaskTree> m_loader; QScopedPointer<QAction> m_loadJson; - CtfVisualizerTraceView *m_traceView; + CtfVisualizerTraceView *m_traceView = nullptr; const QScopedPointer<Timeline::TimelineModelAggregator> m_modelAggregator; const QScopedPointer<Timeline::TimelineZoomControl> m_zoomControl; const QScopedPointer<CtfStatisticsModel> m_statisticsModel; - CtfStatisticsView *m_statisticsView; + CtfStatisticsView *m_statisticsView = nullptr; const QScopedPointer<CtfTraceManager> m_traceManager; @@ -67,5 +66,4 @@ private: QMenu *const m_restrictToThreadsMenu; }; -} // namespace Internal -} // namespace CtfVisualizer +} // namespace CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctfvisualizertraceview.cpp b/src/plugins/ctfvisualizer/ctfvisualizertraceview.cpp index fd43a5f1396..90aee8ef528 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertraceview.cpp +++ b/src/plugins/ctfvisualizer/ctfvisualizertraceview.cpp @@ -13,8 +13,7 @@ #include <QQmlContext> #include <QQmlEngine> -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { CtfVisualizerTraceView::CtfVisualizerTraceView(QWidget *parent, CtfVisualizerTool *tool) : QQuickWidget(parent) @@ -36,8 +35,8 @@ CtfVisualizerTraceView::CtfVisualizerTraceView(QWidget *parent, CtfVisualizerToo setSource(QUrl(QLatin1String("qrc:/qt/qml/QtCreator/Tracing/MainView.qml"))); // Avoid ugly warnings when reading from null properties in QML. - connect(tool->modelAggregator(), &QObject::destroyed, this, [this]{ setSource(QUrl()); }); - connect(tool->zoomControl(), &QObject::destroyed, this, [this]{ setSource(QUrl()); }); + connect(tool->modelAggregator(), &QObject::destroyed, this, [this] { setSource({}); }); + connect(tool->zoomControl(), &QObject::destroyed, this, [this] { setSource({}); }); } CtfVisualizerTraceView::~CtfVisualizerTraceView() = default; @@ -48,7 +47,5 @@ void CtfVisualizerTraceView::selectByTypeId(int typeId) Q_ARG(QVariant,QVariant::fromValue<int>(typeId))); } - -} // namespace Internal -} // namespace CtfVisualizer +} // namespace CtfVisualizer::Internal diff --git a/src/plugins/ctfvisualizer/ctfvisualizertraceview.h b/src/plugins/ctfvisualizer/ctfvisualizertraceview.h index d9976eb37d5..ebfaab885ac 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertraceview.h +++ b/src/plugins/ctfvisualizer/ctfvisualizertraceview.h @@ -3,10 +3,8 @@ #pragma once #include <QQuickWidget> -#include <QWidget> -namespace CtfVisualizer { -namespace Internal { +namespace CtfVisualizer::Internal { class CtfVisualizerTool; @@ -22,7 +20,5 @@ public: void selectByTypeId(int typeId); }; - -} // namespace Internal -} // namespace CtfVisualizer +} // namespace CtfVisualizer::Internal From 3705b4b609095322f8129c3f9ab0fa8cb43fa7a9 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 2 Oct 2023 12:47:05 +0200 Subject: [PATCH 1382/1777] CMakePM: Navigate to find_package CMake files Fixes: QTCREATORBUG-25524 Change-Id: I6dc7dc1b2d0da06ceba0314438d3bd12467a3223 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 35 +++++++++++++++++++ .../cmakeprojectmanager/cmakebuildsystem.h | 2 ++ .../cmakeprojectmanager/cmakeeditor.cpp | 20 ++++++++--- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index c0dbd23604b..11e6429d967 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1391,6 +1391,40 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() } }; + // Gather all Find<Package>.cmake and <Package>Config.cmake / <Package>-config.cmake files + m_findPackagesFilesHash.clear(); + auto handleFindPackageCMakeFiles = [&](const CMakeFileInfo &cmakeFile) { + const QString fileName = cmakeFile.path.fileName(); + + const QString findPackageName = [fileName]() -> QString { + auto findIdx = fileName.indexOf("Find"); + auto endsWithCMakeIdx = fileName.lastIndexOf(".cmake"); + if (findIdx == 0 && endsWithCMakeIdx > 0) + return fileName.mid(4, endsWithCMakeIdx - 4); + return QString(); + }(); + + const QString configPackageName = [fileName]() -> QString { + auto configCMakeIdx = fileName.lastIndexOf("Config.cmake"); + if (configCMakeIdx > 0) + return fileName.left(configCMakeIdx); + auto dashConfigCMakeIdx = fileName.lastIndexOf("-config.cmake"); + if (dashConfigCMakeIdx > 0) + return fileName.left(dashConfigCMakeIdx); + return QString(); + }(); + + if (!findPackageName.isEmpty() || !configPackageName.isEmpty()) { + Utils::Link link; + link.targetFilePath = cmakeFile.path; + link.targetLine = 1; + link.targetColumn = 0; + m_findPackagesFilesHash.insert(!findPackageName.isEmpty() ? findPackageName + : configPackageName, + link); + } + }; + for (const auto &cmakeFile : std::as_const(m_cmakeFiles)) { for (const auto &func : cmakeFile.cmakeListFile.Functions) { handleFunctionMacroOption(cmakeFile, func); @@ -1398,6 +1432,7 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() handleProjectTargets(cmakeFile, func); handleFindPackageVariables(cmakeFile, func); handleDotCMakeFiles(cmakeFile); + handleFindPackageCMakeFiles(cmakeFile); } } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h index ffe32f7e210..bf0f2c581d2 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h @@ -124,6 +124,7 @@ public: QStringList projectImportedTargets() const { return m_projectImportedTargets; } QStringList projectFindPackageVariables() const { return m_projectFindPackageVariables; } const QHash<QString, Utils::Link> &dotCMakeFilesHash() const { return m_dotCMakeFilesHash; } + const QHash<QString, Utils::Link> &findPackagesFilesHash() const { return m_findPackagesFilesHash; } signals: void configurationCleared(); @@ -230,6 +231,7 @@ private: QSet<CMakeFileInfo> m_cmakeFiles; QHash<QString, Utils::Link> m_cmakeSymbolsHash; QHash<QString, Utils::Link> m_dotCMakeFilesHash; + QHash<QString, Utils::Link> m_findPackagesFilesHash; CMakeKeywords m_projectKeywords; QStringList m_projectImportedTargets; QStringList m_projectFindPackageVariables; diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 0e77b2f1745..325cfb94f6b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -338,15 +338,25 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, return processLinkCallback(link); } - // Handle include(CMakeFileWithoutSuffix) + // Handle include(CMakeFileWithoutSuffix) and find_package(Package) QString functionName; if (funcStart > funcEnd) { int funcStartPos = findWordStart(funcStart); functionName = textDocument()->textAt(funcStartPos, funcStart - funcStartPos); - if (functionName == "include" && cbs->dotCMakeFilesHash().contains(buffer)) { - link = cbs->dotCMakeFilesHash().value(buffer); - addTextStartEndToLink(link); - return processLinkCallback(link); + + struct FunctionToHash + { + QString functionName; + const QHash<QString, Utils::Link> &hash; + } functionToHashes[] = {{"include", cbs->dotCMakeFilesHash()}, + {"find_package", cbs->findPackagesFilesHash()}}; + + for (const auto &pair : functionToHashes) { + if (functionName == pair.functionName && pair.hash.contains(buffer)) { + link = pair.hash.value(buffer); + addTextStartEndToLink(link); + return processLinkCallback(link); + } } } } From 3d7cf53a1ed66072f823d6efac56a49022ffb3d5 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 15 Sep 2023 16:47:37 +0200 Subject: [PATCH 1383/1777] Core: Ramp down MainWindow in it's ICore::pimpl function Change-Id: I7c4934248ea4794f7d4eb95f98d19994b56fa0f1 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../coreplugin/actionmanager/actionmanager.h | 3 +- src/plugins/coreplugin/coreplugin.cpp | 2 +- src/plugins/coreplugin/icore.cpp | 394 +++++++----------- src/plugins/coreplugin/icore.h | 64 +-- src/plugins/coreplugin/modemanager.cpp | 4 +- 5 files changed, 173 insertions(+), 294 deletions(-) diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.h b/src/plugins/coreplugin/actionmanager/actionmanager.h index 96ee3f79e19..a5542df03d0 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.h +++ b/src/plugins/coreplugin/actionmanager/actionmanager.h @@ -21,6 +21,7 @@ namespace Core { class ActionContainer; class Command; class Context; +class ICore; namespace Internal { class CorePlugin; @@ -67,7 +68,7 @@ private: static void setContext(const Context &context); friend class Core::Internal::CorePlugin; // initialization - friend class Core::Internal::MainWindow; // saving settings and setting context + friend class Core::ICore; // saving settings and setting context friend class Core::Internal::MainWindowPrivate; // saving settings and setting context }; diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index a6911772ee9..dca909d0752 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -319,7 +319,7 @@ QObject *CorePlugin::remoteCommand(const QStringList & /* options */, return nullptr; } const FilePaths filePaths = Utils::transform(args, FilePath::fromUserInput); - IDocument *res = MainWindow::openFiles( + IDocument *res = ICore::openFiles( filePaths, ICore::OpenFilesFlags(ICore::SwitchMode | ICore::CanContainLineAndColumnNumbers | ICore::SwitchSplitIfAlreadyVisible), FilePath::fromString(workingDirectory)); diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 144a34c337e..175c9f3a037 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -218,6 +218,29 @@ using namespace Utils; namespace Core { +const char settingsGroup[] = "MainWindow"; +const char colorKey[] = "Color"; +const char windowGeometryKey[] = "WindowGeometry"; +const char windowStateKey[] = "WindowState"; +const char modeSelectorLayoutKey[] = "ModeSelectorLayout"; +const char menubarVisibleKey[] = "MenubarVisible"; + +namespace Internal { + +class MainWindow : public AppMainWindow +{ +public: + MainWindow(); + ~MainWindow() override; + +private: + void closeEvent(QCloseEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; +}; + +} // Internal + // The Core Singleton static ICore *m_core = nullptr; static MainWindow *m_mainwindow = nullptr; @@ -241,8 +264,6 @@ public: void init(); static void openFile(); - static IDocument *openFiles(const FilePaths &filePaths, ICore::OpenFilesFlags flags, - const FilePath &workingDirectory = {}); void aboutToShowRecentFiles(); static void setFocusToEditor(); @@ -325,6 +346,11 @@ public: QList<std::function<bool()>> m_preCloseListeners; }; +static QMenuBar *globalMenuBar() +{ + return ActionManager::actionContainer(Constants::MENU_BAR)->menuBar(); +} + } // Internal static MainWindowPrivate *d = nullptr; @@ -546,7 +572,9 @@ QtcSettings *ICore::settings(QSettings::Scope scope) */ QPrinter *ICore::printer() { - return m_mainwindow->printer(); + if (!d->m_printer) + d->m_printer = new QPrinter(QPrinter::HighResolution); + return d->m_printer; } /*! @@ -802,7 +830,7 @@ QString ICore::buildCompatibilityString() */ IContext *ICore::currentContextObject() { - return m_mainwindow->currentContextObject(); + return d->m_activeContext.isEmpty() ? nullptr : d->m_activeContext.first(); } /*! @@ -817,15 +845,6 @@ QWidget *ICore::currentContextWidget() return context ? context->widget() : nullptr; } -/*! - Returns the registered IContext instance for the specified \a widget, - if any. -*/ -IContext *ICore::contextObject(QWidget *widget) -{ - return m_mainwindow->contextObject(widget); -} - /*! Returns the main window of the application. @@ -856,7 +875,7 @@ QWidget *ICore::dialogParent() */ QStatusBar *ICore::statusBar() { - return m_mainwindow->statusBar(); + return d->m_modeStack->statusBar(); } /*! @@ -866,7 +885,7 @@ QStatusBar *ICore::statusBar() */ Utils::InfoBar *ICore::infoBar() { - return m_mainwindow->infoBar(); + return d->m_modeStack->infoBar(); } /*! @@ -910,7 +929,27 @@ void ICore::raiseMainWindow() void ICore::updateAdditionalContexts(const Context &remove, const Context &add, ContextPriority priority) { - m_mainwindow->updateAdditionalContexts(remove, add, priority); + for (const Id id : remove) { + if (!id.isValid()) + continue; + int index = d->m_lowPrioAdditionalContexts.indexOf(id); + if (index != -1) + d->m_lowPrioAdditionalContexts.removeAt(index); + index = d->m_highPrioAdditionalContexts.indexOf(id); + if (index != -1) + d->m_highPrioAdditionalContexts.removeAt(index); + } + + for (const Id id : add) { + if (!id.isValid()) + continue; + Context &cref = (priority == ICore::ContextPriority::High ? d->m_highPrioAdditionalContexts + : d->m_lowPrioAdditionalContexts); + if (!cref.contains(id)) + cref.prepend(id); + } + + d->updateContext(); } /*! @@ -920,7 +959,7 @@ void ICore::updateAdditionalContexts(const Context &remove, const Context &add, */ void ICore::addAdditionalContext(const Context &context, ContextPriority priority) { - m_mainwindow->updateAdditionalContexts(Context(), context, priority); + updateAdditionalContexts(Context(), context, priority); } /*! @@ -930,37 +969,7 @@ void ICore::addAdditionalContext(const Context &context, ContextPriority priorit */ void ICore::removeAdditionalContext(const Context &context) { - m_mainwindow->updateAdditionalContexts(context, Context(), ContextPriority::Low); -} - -/*! - Adds \a context to the list of registered IContext instances. - Whenever the IContext's \l{IContext::widget()}{widget} is in the application - focus widget's parent hierarchy, its \l{IContext::context()}{context} is - added to the list of active contexts. - - \sa removeContextObject() - \sa updateAdditionalContexts() - \sa currentContextObject() - \sa {The Action Manager and Commands} -*/ -void ICore::addContextObject(IContext *context) -{ - m_mainwindow->addContextObject(context); -} - -/*! - Unregisters a \a context object from the list of registered IContext - instances. IContext instances are automatically removed when they are - deleted. - - \sa addContextObject() - \sa updateAdditionalContexts() - \sa currentContextObject() -*/ -void ICore::removeContextObject(IContext *context) -{ - m_mainwindow->removeContextObject(context); + updateAdditionalContexts(context, Context(), ContextPriority::Low); } /*! @@ -977,22 +986,6 @@ void ICore::registerWindow(QWidget *window, const Context &context) new WindowSupport(window, context); // deletes itself when widget is destroyed } -void ICore::restartTrimmer() -{ - m_mainwindow->restartTrimmer(); -} - -/*! - Opens files using \a filePaths and \a flags like it would be - done if they were given to \QC on the command line, or - they were opened via \uicontrol File > \uicontrol Open. -*/ - -void ICore::openFiles(const FilePaths &filePaths, ICore::OpenFilesFlags flags) -{ - MainWindow::openFiles(filePaths, flags); -} - /*! Provides a hook for plugins to veto on closing the application. @@ -1003,7 +996,7 @@ void ICore::openFiles(const FilePaths &filePaths, ICore::OpenFilesFlags flags) */ void ICore::addPreCloseListener(const std::function<bool ()> &listener) { - m_mainwindow->addPreCloseListener(listener); + d->m_preCloseListeners.append(listener); } /*! @@ -1076,12 +1069,18 @@ void ICore::setupScreenShooter(const QString &name, QWidget *w, const QRect &rc) new ScreenShooter(w, name, rc); } +static void setRestart(bool restart) +{ + qApp->setProperty("restart", restart); +} + /*! Restarts \QC and restores the last session. */ void ICore::restart() { - m_mainwindow->restart(); + setRestart(true); + exit(); } /*! @@ -1090,7 +1089,33 @@ void ICore::restart() void ICore::saveSettings(SaveSettingsReason reason) { emit m_core->saveSettingsRequested(reason); - m_mainwindow->saveSettings(); + + QtcSettings *settings = PluginManager::settings(); + settings->beginGroup(settingsGroup); + + if (!(d->m_overrideColor.isValid() && StyleHelper::baseColor() == d->m_overrideColor)) + settings->setValueWithDefault(colorKey, + StyleHelper::requestedBaseColor(), + QColor(StyleHelper::DEFAULT_BASE_COLOR)); + + if (Internal::globalMenuBar() && !Internal::globalMenuBar()->isNativeMenuBar()) + settings->setValue(menubarVisibleKey, Internal::globalMenuBar()->isVisible()); + + settings->endGroup(); + + DocumentManager::saveSettings(); + ActionManager::saveSettings(); + EditorManagerPrivate::saveSettings(); + d->m_leftNavigationWidget->saveSettings(settings); + d->m_rightNavigationWidget->saveSettings(settings); + + // TODO Remove some time after Qt Creator 11 + // Work around Qt Creator <= 10 writing the default terminal to the settings. + // TerminalCommand writes the terminal to the settings when changing it, which usually is + // enough. But because of the bug in Qt Creator <= 10 we want to clean up the settings + // even if the user never touched the terminal setting. + if (HostOsInfo::isMacHost()) + TerminalCommand::setTerminalEmulator(TerminalCommand::terminalEmulator()); ICore::settings(QSettings::SystemScope)->sync(); ICore::settings(QSettings::UserScope)->sync(); @@ -1101,7 +1126,7 @@ void ICore::saveSettings(SaveSettingsReason reason) */ QStringList ICore::additionalAboutInformation() { - return m_mainwindow->additionalAboutInformation(); + return d->m_aboutInformation; } /*! @@ -1109,7 +1134,7 @@ QStringList ICore::additionalAboutInformation() */ void ICore::clearAboutInformation() { - m_mainwindow->clearAboutInformation(); + d->m_aboutInformation.clear(); } /*! @@ -1117,7 +1142,7 @@ void ICore::clearAboutInformation() */ void ICore::appendAboutInformation(const QString &line) { - m_mainwindow->appendAboutInformation(line); + d->m_aboutInformation.append(line); } void ICore::updateNewItemDialogState() @@ -1139,16 +1164,6 @@ void ICore::setNewDialogFactory(const std::function<NewDialog *(QWidget *)> &new m_newDialogFactory = newFactory; } - -namespace Internal { - -const char settingsGroup[] = "MainWindow"; -const char colorKey[] = "Color"; -const char windowGeometryKey[] = "WindowGeometry"; -const char windowStateKey[] = "WindowState"; -const char modeSelectorLayoutKey[] = "ModeSelectorLayout"; -const char menubarVisibleKey[] = "MenubarVisible"; - static bool hideToolsMenu() { return Core::ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_TOOLS, false).toBool(); @@ -1156,13 +1171,14 @@ static bool hideToolsMenu() enum { debugMainWindow = 0 }; +namespace Internal { void MainWindowPrivate::init() { m_progressManager = new ProgressManagerPrivate; m_jsExpander = JsExpander::createGlobalJsExpander(); m_vcsManager = new VcsManager; - m_modeStack = new FancyTabWidget(q); + m_modeStack = new FancyTabWidget(m_mainwindow); m_shortcutSettings = new ShortcutSettings; m_toolSettings = new ToolSettings; m_mimeTypeSettings = new MimeTypeSettings; @@ -1170,7 +1186,7 @@ void MainWindowPrivate::init() m_toggleLeftSideBarButton = new QToolButton; m_toggleRightSideBarButton = new QToolButton; - (void) new DocumentManager(q); + (void) new DocumentManager(this); HistoryCompleter::setSettings(PluginManager::settings()); @@ -1272,26 +1288,6 @@ void MainWindowPrivate::setSidebarVisible(bool visible, Side side) navigationWidget(side)->setShown(visible); } -QStringList MainWindow::additionalAboutInformation() const -{ - return d->m_aboutInformation; -} - -void MainWindow::clearAboutInformation() -{ - d->m_aboutInformation.clear(); -} - -void MainWindow::appendAboutInformation(const QString &line) -{ - d->m_aboutInformation.append(line); -} - -void MainWindow::addPreCloseListener(const std::function<bool ()> &listener) -{ - d->m_preCloseListeners.append(listener); -} - MainWindow::~MainWindow() { delete d; @@ -1387,25 +1383,14 @@ void ICore::aboutToShutdown() m_mainwindow->hide(); } -namespace Internal { - -static void setRestart(bool restart) -{ - qApp->setProperty("restart", restart); -} - -void MainWindow::restart() -{ - setRestart(true); - exit(); -} - -void MainWindow::restartTrimmer() +void ICore::restartTrimmer() { if (HostOsInfo::isLinuxHost() && !d->m_trimTimer.isActive()) d->m_trimTimer.start(); } +namespace Internal { + void MainWindow::closeEvent(QCloseEvent *event) { const auto cancelClose = [event] { @@ -1460,13 +1445,13 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::keyPressEvent(QKeyEvent *event) { - restartTrimmer(); + ICore::restartTrimmer(); AppMainWindow::keyPressEvent(event); } void MainWindow::mousePressEvent(QMouseEvent *event) { - restartTrimmer(); + ICore::restartTrimmer(); AppMainWindow::mousePressEvent(event); } @@ -1474,22 +1459,7 @@ void MainWindowPrivate::openDroppedFiles(const QList<DropSupport::FileSpec> &fil { q->raiseWindow(); const FilePaths filePaths = Utils::transform(files, &DropSupport::FileSpec::filePath); - q->openFiles(filePaths, ICore::SwitchMode); -} - -IContext *MainWindow::currentContextObject() const -{ - return d->m_activeContext.isEmpty() ? nullptr : d->m_activeContext.first(); -} - -QStatusBar *MainWindow::statusBar() const -{ - return d->m_modeStack->statusBar(); -} - -InfoBar *MainWindow::infoBar() const -{ - return d->m_modeStack->infoBar(); + ICore::openFiles(filePaths, ICore::SwitchMode); } void MainWindowPrivate::registerDefaultContainers() @@ -1577,11 +1547,6 @@ void MainWindowPrivate::registerDefaultContainers() ac->touchBar()->setApplicationTouchBar(); } -static QMenuBar *globalMenuBar() -{ - return ActionManager::actionContainer(Constants::MENU_BAR)->menuBar(); -} - void MainWindowPrivate::registerDefaultActions() { ActionContainer *mfile = ActionManager::actionContainer(Constants::M_FILE); @@ -1658,7 +1623,7 @@ void MainWindowPrivate::registerDefaultActions() m_openWithAction = new QAction(Tr::tr("Open File &With..."), this); cmd = ActionManager::registerAction(m_openWithAction, Constants::OPEN_WITH); mfile->addAction(cmd, Constants::G_FILE_OPEN); - connect(m_openWithAction, &QAction::triggered, this, &MainWindow::openFileWith); + connect(m_openWithAction, &QAction::triggered, m_core, &ICore::openFileWith); if (FSEngine::isAvailable()) { // Open From Device Action @@ -1712,7 +1677,7 @@ void MainWindowPrivate::registerDefaultActions() cmd = ActionManager::registerAction(m_exitAction, Constants::EXIT); cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Q"))); mfile->addAction(cmd, Constants::G_FILE_OTHER); - connect(m_exitAction, &QAction::triggered, q, &MainWindow::exit); + connect(m_exitAction, &QAction::triggered, m_core, &ICore::exit); // Undo Action icon = Icon::fromTheme("edit-undo"); @@ -2017,7 +1982,7 @@ void MainWindowPrivate::registerModeSelectorStyleActions() void MainWindowPrivate::openFile() { - openFiles(EditorManager::getOpenFilePaths(), ICore::SwitchMode); + ICore::openFiles(EditorManager::getOpenFilePaths(), ICore::SwitchMode); } static IDocumentFactory *findDocumentFactory(const QList<IDocumentFactory*> &fileFactories, @@ -2030,6 +1995,8 @@ static IDocumentFactory *findDocumentFactory(const QList<IDocumentFactory*> &fil }); } +} // Internal + /*! * \internal * Either opens \a filePaths with editors or loads a project. @@ -2045,16 +2012,10 @@ static IDocumentFactory *findDocumentFactory(const QList<IDocumentFactory*> &fil * * \sa IPlugin::remoteArguments() */ -IDocument *MainWindow::openFiles(const FilePaths &filePaths, - ICore::OpenFilesFlags flags, - const FilePath &workingDirectory) -{ - return MainWindowPrivate::openFiles(filePaths, flags, workingDirectory); -} -IDocument *MainWindowPrivate::openFiles(const FilePaths &filePaths, - ICore::OpenFilesFlags flags, - const FilePath &workingDirectory) +IDocument *ICore::openFiles(const FilePaths &filePaths, + ICore::OpenFilesFlags flags, + const FilePath &workingDirectory) { const QList<IDocumentFactory*> documentFactories = IDocumentFactory::allDocumentFactories(); IDocument *res = nullptr; @@ -2101,11 +2062,18 @@ IDocument *MainWindowPrivate::openFiles(const FilePaths &filePaths, return res; } +namespace Internal { + void MainWindowPrivate::setFocusToEditor() { EditorManagerPrivate::doEscapeKeyFocusMoveMagic(); } +void MainWindowPrivate::openFileFromDevice() +{ + ICore::openFiles(EditorManager::getOpenFilePaths(QFileDialog::DontUseNativeDialog), ICore::SwitchMode); +} + static void acceptModalDialogs() { const QWidgetList topLevels = QApplication::topLevelWidgets(); @@ -2120,7 +2088,9 @@ static void acceptModalDialogs() dialog->accept(); } -void MainWindow::exit() +} // Internal + +void ICore::exit() { // this function is most likely called from a user action // that is from an event handler of an object @@ -2128,17 +2098,17 @@ void MainWindow::exit() // so to prevent the deleting of that object we // just append it QMetaObject::invokeMethod( - this, - [this] { + m_mainwindow, + [] { // Modal dialogs block the close event. So close them, in case this was triggered from // a RestartDialog in the settings dialog. acceptModalDialogs(); - close(); + m_mainwindow->close(); }, Qt::QueuedConnection); } -void MainWindow::openFileWith() +void ICore::openFileWith() { const FilePaths filePaths = EditorManager::getOpenFilePaths(); for (const FilePath &filePath : filePaths) { @@ -2153,18 +2123,29 @@ void MainWindow::openFileWith() } } -void MainWindowPrivate::openFileFromDevice() -{ - openFiles(EditorManager::getOpenFilePaths(QFileDialog::DontUseNativeDialog), ICore::SwitchMode); -} - -IContext *MainWindow::contextObject(QWidget *widget) const +/*! + Returns the registered IContext instance for the specified \a widget, + if any. +*/ +IContext *ICore::contextObject(QWidget *widget) { const auto it = d->m_contextWidgets.find(widget); return it == d->m_contextWidgets.end() ? nullptr : it->second; } -void MainWindow::addContextObject(IContext *context) +/*! + Adds \a context to the list of registered IContext instances. + Whenever the IContext's \l{IContext::widget()}{widget} is in the application + focus widget's parent hierarchy, its \l{IContext::context()}{context} is + added to the list of active contexts. + + \sa removeContextObject() + \sa updateAdditionalContexts() + \sa currentContextObject() + \sa {The Action Manager and Commands} +*/ + +void ICore::addContextObject(IContext *context) { if (!context) return; @@ -2173,15 +2154,25 @@ void MainWindow::addContextObject(IContext *context) return; d->m_contextWidgets.insert({widget, context}); - connect(context, &QObject::destroyed, this, [this, context] { removeContextObject(context); }); + connect(context, &QObject::destroyed, m_core, [context] { removeContextObject(context); }); } -void MainWindow::removeContextObject(IContext *context) +/*! + Unregisters a \a context object from the list of registered IContext + instances. IContext instances are automatically removed when they are + deleted. + + \sa addContextObject() + \sa updateAdditionalContexts() + \sa currentContextObject() +*/ + +void ICore::removeContextObject(IContext *context) { if (!context) return; - disconnect(context, &QObject::destroyed, this, nullptr); + disconnect(context, &QObject::destroyed, m_core, nullptr); const auto it = std::find_if(d->m_contextWidgets.cbegin(), d->m_contextWidgets.cend(), @@ -2196,6 +2187,8 @@ void MainWindow::removeContextObject(IContext *context) d->updateContextObject(d->m_activeContext); } +namespace Internal { + void MainWindowPrivate::updateFocusWidget(QWidget *old, QWidget *now) { Q_UNUSED(old) @@ -2208,7 +2201,7 @@ void MainWindowPrivate::updateFocusWidget(QWidget *old, QWidget *now) if (QWidget *p = QApplication::focusWidget()) { IContext *context = nullptr; while (p) { - context = q->contextObject(p); + context = ICore::contextObject(p); if (context) newContext.append(context); p = p->parentWidget(); @@ -2277,36 +2270,6 @@ void MainWindowPrivate::readSettings() m_rightPaneWidget->readSettings(settings); } -void MainWindow::saveSettings() -{ - QtcSettings *settings = PluginManager::settings(); - settings->beginGroup(settingsGroup); - - if (!(d->m_overrideColor.isValid() && StyleHelper::baseColor() == d->m_overrideColor)) - settings->setValueWithDefault(colorKey, - StyleHelper::requestedBaseColor(), - QColor(StyleHelper::DEFAULT_BASE_COLOR)); - - if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) - settings->setValue(menubarVisibleKey, globalMenuBar()->isVisible()); - - settings->endGroup(); - - DocumentManager::saveSettings(); - ActionManager::saveSettings(); - EditorManagerPrivate::saveSettings(); - d->m_leftNavigationWidget->saveSettings(settings); - d->m_rightNavigationWidget->saveSettings(settings); - - // TODO Remove some time after Qt Creator 11 - // Work around Qt Creator <= 10 writing the default terminal to the settings. - // TerminalCommand writes the terminal to the settings when changing it, which usually is - // enough. But because of the bug in Qt Creator <= 10 we want to clean up the settings - // even if the user never touched the terminal setting. - if (HostOsInfo::isMacHost()) - TerminalCommand::setTerminalEmulator(TerminalCommand::terminalEmulator()); -} - void MainWindowPrivate::saveWindowSettings() { QtcSettings *settings = PluginManager::settings(); @@ -2340,32 +2303,6 @@ void MainWindowPrivate::updateModeSelectorStyleMenu() } } -void MainWindow::updateAdditionalContexts(const Context &remove, const Context &add, - ICore::ContextPriority priority) -{ - for (const Id id : remove) { - if (!id.isValid()) - continue; - int index = d->m_lowPrioAdditionalContexts.indexOf(id); - if (index != -1) - d->m_lowPrioAdditionalContexts.removeAt(index); - index = d->m_highPrioAdditionalContexts.indexOf(id); - if (index != -1) - d->m_highPrioAdditionalContexts.removeAt(index); - } - - for (const Id id : add) { - if (!id.isValid()) - continue; - Context &cref = (priority == ICore::ContextPriority::High ? d->m_highPrioAdditionalContexts - : d->m_lowPrioAdditionalContexts); - if (!cref.contains(id)) - cref.prepend(id); - } - - d->updateContext(); -} - void MainWindowPrivate::updateContext() { Context contexts = m_highPrioAdditionalContexts; @@ -2585,17 +2522,10 @@ void MainWindowPrivate::contact() .arg("<a href=\"https://pastebin.com\">" "https://pastebin.com" "</a>"), - QMessageBox::Ok, q); + QMessageBox::Ok, m_mainwindow); dlg.exec(); } -QPrinter *MainWindow::printer() const -{ - if (!d->m_printer) - d->m_printer = new QPrinter(QPrinter::HighResolution); - return d->m_printer; -} - void MainWindowPrivate::restoreWindowState() { NANOTRACE_SCOPE("Core", "MainWindow::restoreWindowState"); @@ -2609,7 +2539,7 @@ void MainWindowPrivate::restoreWindowState() StatusBarManager::restoreSettings(); } -} // namespace Internal +} // Internal void ICore::setOverrideColor(const QColor &color) { diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index 62206c94594..eb27d3a47a5 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -11,9 +11,7 @@ #include <utils/qtcsettings.h> #include <QList> -#include <QObject> #include <QRect> -#include <QSettings> #include <functional> @@ -34,18 +32,10 @@ class IDocument; class IWizardFactory; class NewDialog; -namespace Internal { -class MainWindow; -class MainWindowPrivate; -} // Internal - class CORE_EXPORT ICore : public QObject { Q_OBJECT - friend class Internal::MainWindow; - friend class Internal::MainWindowPrivate; - public: ICore(); ~ICore() override; @@ -115,7 +105,6 @@ public: StopOnLoadFail = 4, SwitchSplitIfAlreadyVisible = 8 }; - static void openFiles(const Utils::FilePaths &filePaths, OpenFilesFlags flags = None); static void addPreCloseListener(const std::function<bool()> &listener); @@ -127,6 +116,10 @@ public: MainWindowClosing, }; +public slots: + static void openFileWith(); + static void exit(); + signals: void coreAboutToOpen(); void coreOpened(); @@ -164,56 +157,11 @@ public: static void init(); static void extensionsInitialized(); static void aboutToShutdown(); -}; - -namespace Internal { - -class MainWindow : public Utils::AppMainWindow -{ - Q_OBJECT - -public: - MainWindow(); - ~MainWindow() override; - - IContext *contextObject(QWidget *widget) const; - void addContextObject(IContext *context); - void removeContextObject(IContext *context); + static void saveSettings(); static IDocument *openFiles(const Utils::FilePaths &filePaths, - ICore::OpenFilesFlags flags, + OpenFilesFlags flags = None, const Utils::FilePath &workingDirectory = {}); - - QPrinter *printer() const; - IContext *currentContextObject() const; - QStatusBar *statusBar() const; - Utils::InfoBar *infoBar() const; - - void updateAdditionalContexts(const Context &remove, const Context &add, - ICore::ContextPriority priority); - - QStringList additionalAboutInformation() const; - void clearAboutInformation(); - void appendAboutInformation(const QString &line); - - void addPreCloseListener(const std::function<bool()> &listener); - - void saveSettings(); - - void restart(); - - void restartTrimmer(); - -public slots: - static void openFileWith(); - void exit(); - -private: - void closeEvent(QCloseEvent *event) override; - void keyPressEvent(QKeyEvent *event) override; - void mousePressEvent(QMouseEvent *event) override; }; -} // namespace Internal - } // namespace Core diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index 9608ed6caff..d9600188ccc 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -205,7 +205,7 @@ void ModeManagerPrivate::appendMode(IMode *mode) { const int index = m_modeCommands.count(); - m_mainWindow->addContextObject(mode); + ICore::addContextObject(mode); m_modeStack->insertTab(index, mode->widget(), mode->icon(), mode->displayName(), mode->menu() != nullptr); @@ -246,7 +246,7 @@ void ModeManager::removeMode(IMode *mode) d->m_modeCommands.remove(index); d->m_modeStack->removeTab(index); - d->m_mainWindow->removeContextObject(mode); + ICore::removeContextObject(mode); } void ModeManagerPrivate::enabledStateChanged(IMode *mode) From 81d571468c23d655d462004020033750621edb88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= <tor.arne.vestbo@qt.io> Date: Wed, 20 Sep 2023 00:22:46 +0200 Subject: [PATCH 1384/1777] lldb: Auto install pygdbmi if not found It's quite awkward that the user has to manually install pygdbmi for the LLDB summary provider to work. And if the user has python from homebrew, their 'pip3 install pygdbmi' won't be seen by LLDB either, causing confusion. By automatically installing pygdbmi via the python3 interpreter we know we're running under, we simplify this for the user. The user can opt out by setting QT_LLDB_SUMMARY_PROVIDER_NO_AUTO_INSTALL in the environment. Change-Id: Iad7935fd77e6f56ddf719126ef7ad1cb1a024877 Reviewed-by: hjk <hjk@qt.io> --- share/qtcreator/debugger/lldbbridge.py | 40 ++++++++++++++++++++------ 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 8c25b90c380..da99546cec2 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -2157,14 +2157,7 @@ class SummaryDumper(Dumper, LogMixin): return # Don't mess up lldb output def dump_summary(self, valobj, expanded=False): - try: - from pygdbmi import gdbmiparser - except ImportError: - print("Qt summary provider requires the pygdbmi module, " - "please install using 'sudo /usr/bin/easy_install pygdbmi', " - "and then restart Xcode.") - lldb.debugger.HandleCommand('type category delete Qt') - return None + from pygdbmi import gdbmiparser value = self.fromNativeValue(valobj) @@ -2437,6 +2430,34 @@ class SyntheticChildrenProvider(SummaryProvider): self.valobj = self.create_value(dereference_child) self.update() +def ensure_gdbmiparser(): + try: + from pygdbmi import gdbmiparser + return True + except ImportError: + try: + if not 'QT_LLDB_SUMMARY_PROVIDER_NO_AUTO_INSTALL' in os.environ: + print("Required module 'pygdbmi' not installed. Installing automatically...") + import subprocess + python3 = os.path.join(sys.exec_prefix, 'bin', 'python3') + process = subprocess.run([python3, '-m', 'pip', + '--disable-pip-version-check', + 'install', '--user', 'pygdbmi' ], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + print(process.stdout.decode('utf-8').strip()) + process.check_returncode() + from importlib import invalidate_caches + invalidate_caches() + from pygdbmi import gdbmiparser + return True + except Exception as e: + print(e) + + print("Qt summary provider requires the pygdbmi module. Please install\n" \ + "manually using '/usr/bin/pip3 install pygdbmi', and restart Xcode.") + return False + def __lldb_init_module(debugger, internal_dict): # Module is being imported in an LLDB session @@ -2446,6 +2467,9 @@ def __lldb_init_module(debugger, internal_dict): debug("Initializing module with", debugger) + if not ensure_gdbmiparser(): + return + if not __name__ == 'qt': # Make available under global 'qt' name for consistency, # and so we can refer to SyntheticChildrenProvider below. From 35f865fa7bc93f4f9e00027cbe5980e3a122bc8f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 2 Oct 2023 11:17:11 +0200 Subject: [PATCH 1385/1777] Core: Remove mainwindow.{h,cpp} Interface was moved to icore.h. The initial worry that lots of code need changes was apparently unfounded. Change-Id: I53a494d1ca914c7b1b16500c979029d06f5ab5f6 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/CMakeLists.txt | 2 -- src/plugins/coreplugin/coreplugin.qbs | 2 -- src/plugins/coreplugin/mainwindow.h | 6 ------ src/plugins/coreplugin/modemanager.cpp | 1 - src/plugins/coreplugin/systemsettings.cpp | 1 - 5 files changed, 12 deletions(-) delete mode 100644 src/plugins/coreplugin/mainwindow.h diff --git a/src/plugins/coreplugin/CMakeLists.txt b/src/plugins/coreplugin/CMakeLists.txt index 6ed9dbe2234..d7f04d88ed5 100644 --- a/src/plugins/coreplugin/CMakeLists.txt +++ b/src/plugins/coreplugin/CMakeLists.txt @@ -213,8 +213,6 @@ add_qtc_plugin(Core loggingmanager.h loggingviewer.cpp loggingviewer.h - mainwindow.cpp - mainwindow.h manhattanstyle.cpp manhattanstyle.h messagebox.cpp diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index bc4a27ff035..37c8a9b73f8 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -106,8 +106,6 @@ QtcPlugin { "loggingmanager.h", "loggingviewer.cpp", "loggingviewer.h", - "mainwindow.cpp", - "mainwindow.h", "manhattanstyle.cpp", "manhattanstyle.h", "messagebox.cpp", diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h deleted file mode 100644 index fe84d72dcb3..00000000000 --- a/src/plugins/coreplugin/mainwindow.h +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include "icore.h" diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index d9600188ccc..80ecfc004df 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -10,7 +10,6 @@ #include "fancytabwidget.h" #include "icore.h" #include "imode.h" -#include "mainwindow.h" #include <extensionsystem/pluginmanager.h> diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index 26527a4286e..b40c5058347 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -12,7 +12,6 @@ #include "fileutils.h" #include "icore.h" #include "iversioncontrol.h" -#include "mainwindow.h" #include "vcsmanager.h" #include <utils/algorithm.h> From 195c6810c68251707e045170b71bceddaf9d94f2 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 28 Sep 2023 15:39:36 +0200 Subject: [PATCH 1386/1777] ProjectExplorer: gcctoolchain.cpp code cosmetics Change-Id: I3bd569c63a0a583260daef0ef79462dfdc60358d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 32 +++++++++----------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index ecdb89d0e0a..53e65a3acb1 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -28,7 +28,6 @@ #include <QBuffer> #include <QCheckBox> #include <QComboBox> -#include <QCoreApplication> #include <QDir> #include <QFileInfo> #include <QFormLayout> @@ -320,7 +319,7 @@ static Id idForSubType(GccToolChain::SubType subType) return Constants::GCC_TOOLCHAIN_TYPEID; } -GccToolChain::GccToolChain(Utils::Id typeId, SubType subType) +GccToolChain::GccToolChain(Id typeId, SubType subType) : ToolChain(typeId.isValid() ? typeId : idForSubType(subType)), m_subType(subType) { setTypeDisplayName(Tr::tr("GCC")); @@ -362,7 +361,7 @@ void GccToolChain::setOriginalTargetTriple(const QString &targetTriple) toolChainUpdated(); } -void GccToolChain::setInstallDir(const Utils::FilePath &installDir) +void GccToolChain::setInstallDir(const FilePath &installDir) { if (m_installDir == installDir) return; @@ -449,8 +448,7 @@ static bool isNetworkCompiler(const QString &dirPath) return dirPath.contains("icecc") || dirPath.contains("distcc"); } -static Utils::FilePath findLocalCompiler(const Utils::FilePath &compilerPath, - const Environment &env) +static FilePath findLocalCompiler(const FilePath &compilerPath, const Environment &env) { // Find the "real" compiler if icecc, distcc or similar are in use. Ignore ccache, since that // is local already. @@ -467,7 +465,7 @@ static Utils::FilePath findLocalCompiler(const Utils::FilePath &compilerPath, // This effectively searches the PATH twice, once via pathComponents and once via PATH itself: // searchInPath filters duplicates, so that will not hurt. - const Utils::FilePath path = env.searchInPath(compilerPath.fileName(), pathComponents); + const FilePath path = env.searchInPath(compilerPath.fileName(), pathComponents); return path.isEmpty() ? compilerPath : path; } @@ -514,7 +512,7 @@ ToolChain::MacroInspectionRunner GccToolChain::createMacroInspectionRunner() con OptionsReinterpreter reinterpretOptions = m_optionsReinterpreter; QTC_CHECK(reinterpretOptions); MacrosCache macroCache = predefinedMacrosCache(); - Utils::Id lang = language(); + Id lang = language(); /* * Asks compiler for set of predefined macros @@ -690,15 +688,15 @@ void GccToolChain::initExtraHeaderPathsFunction(ExtraHeaderPathsFunction &&extra m_extraHeaderPathsFunction = std::move(extraHeaderPathsFunction); } -HeaderPaths GccToolChain::builtInHeaderPaths(const Utils::Environment &env, - const Utils::FilePath &compilerCommand, +HeaderPaths GccToolChain::builtInHeaderPaths(const Environment &env, + const FilePath &compilerCommand, const QStringList &platformCodeGenFlags, OptionsReinterpreter reinterpretOptions, HeaderPathsCache headerCache, - Utils::Id languageId, + Id languageId, ExtraHeaderPathsFunction extraHeaderPathsFunction, const QStringList &flags, - const Utils::FilePath &sysRoot, + const FilePath &sysRoot, const QString &originalTargetTriple) { QStringList arguments = gccPrepareArguments(flags, @@ -1061,7 +1059,7 @@ QString GccToolChain::detectVersion() const filteredFlags(platformCodeGenFlags(), true)); } -Utils::FilePath GccToolChain::detectInstallDir() const +FilePath GccToolChain::detectInstallDir() const { Environment env = compilerCommand().deviceEnvironment(); addToEnvironment(env); @@ -1073,7 +1071,7 @@ Utils::FilePath GccToolChain::detectInstallDir() const // GccToolChainFactory // -------------------------------------------------------------------------- -static Utils::FilePaths gnuSearchPathsFromRegistry() +static FilePaths gnuSearchPathsFromRegistry() { if (!HostOsInfo::isWindowsHost()) return {}; @@ -1082,7 +1080,7 @@ static Utils::FilePaths gnuSearchPathsFromRegistry() static const char kRegistryToken[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \ "Windows\\CurrentVersion\\Uninstall\\"; - Utils::FilePaths searchPaths; + FilePaths searchPaths; QSettings registry(kRegistryToken, QSettings::NativeFormat); const auto productGroups = registry.childGroups(); @@ -1571,7 +1569,7 @@ Toolchains GccToolChainFactory::autoDetectToolchains(const FilePaths &compilerPa } } if (!alreadyExists) { - const QList<ToolChain *> newToolchains + const Toolchains newToolchains = autoDetectToolChain({compilerPath, language}, subType, checker); result << newToolchains; existingCandidates << newToolchains; @@ -1929,7 +1927,7 @@ void GccToolChain::syncAutodetectedWithParentToolchains() } if (!mingwToolChainFromId(m_parentToolChainId)) { - const QList<ToolChain *> mingwTCs = mingwToolChains(); + const Toolchains mingwTCs = mingwToolChains(); m_parentToolChainId = mingwTCs.isEmpty() ? QByteArray() : mingwTCs.front()->id(); } @@ -1948,7 +1946,7 @@ void GccToolChain::syncAutodetectedWithParentToolchains() QObject::disconnect(m_thisToolchainRemovedConnection); QObject::disconnect(m_mingwToolchainAddedConnection); } else if (m_parentToolChainId == tc->id()) { - const QList<ToolChain *> mingwTCs = mingwToolChains(); + const Toolchains mingwTCs = mingwToolChains(); m_parentToolChainId = mingwTCs.isEmpty() ? QByteArray() : mingwTCs.front()->id(); } }); From a931ebf1e51149472aedba69d9b27d23c181c062 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 28 Sep 2023 16:50:53 +0200 Subject: [PATCH 1387/1777] ProjectExplorer: Simplify gcc options re-interpretation interface Change-Id: I6fc293389e301d7ec36a897c856a0e2d57e35964 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 14 ++++++-------- src/plugins/projectexplorer/gcctoolchain.h | 5 ----- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 53e65a3acb1..f73e996b173 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -662,11 +662,10 @@ FilePaths GccToolChain::includedFiles(const QStringList &flags, const FilePath & return ToolChain::includedFiles("-include", flags, directoryPath, PossiblyConcatenatedFlag::No); } -QStringList GccToolChain::gccPrepareArguments(const QStringList &flags, - const FilePath &sysRoot, - const QStringList &platformCodeGenFlags, - Id languageId, - OptionsReinterpreter reinterpretOptions) +static QStringList gccPrepareArguments(const QStringList &flags, + const FilePath &sysRoot, + const QStringList &platformCodeGenFlags, + Id languageId) { QStringList arguments; const bool hasKitSysroot = !sysRoot.isEmpty(); @@ -677,7 +676,6 @@ QStringList GccToolChain::gccPrepareArguments(const QStringList &flags, allFlags << platformCodeGenFlags << flags; arguments += filteredFlags(allFlags, !hasKitSysroot); arguments << languageOption(languageId) << "-E" << "-v" << "-"; - arguments = reinterpretOptions(arguments); return arguments; } @@ -702,8 +700,8 @@ HeaderPaths GccToolChain::builtInHeaderPaths(const Environment &env, QStringList arguments = gccPrepareArguments(flags, sysRoot, platformCodeGenFlags, - languageId, - reinterpretOptions); + languageId); + arguments = reinterpretOptions(arguments); // Must be clang case only. if (!originalTargetTriple.isEmpty()) diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 5ed17857eaf..853b61add12 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -146,11 +146,6 @@ protected: private: void syncAutodetectedWithParentToolchains(); void updateSupportedAbis() const; - static QStringList gccPrepareArguments(const QStringList &flags, - const Utils::FilePath &sysRoot, - const QStringList &platformCodeGenFlags, - Utils::Id languageId, - OptionsReinterpreter reinterpretOptions); protected: QStringList m_platformCodeGenFlags; From b5f73e6dbd2ab35fcdf20a73d58a00fe4ab222e9 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 28 Sep 2023 17:38:50 +0200 Subject: [PATCH 1388/1777] ProjectExplorer: Simplify autodetection of SDK clang toolchain We know what it looks like pretty well. This also makes the other detection calls more similar. Change-Id: I421826c94c637fdc35781f60ad0e0b4c6ee7b650 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 23 +++++++++++++------- src/plugins/projectexplorer/gcctoolchain.h | 1 + 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index f73e996b173..6747cda6b61 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1409,14 +1409,7 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co GccToolChain::Clang)); known.append(tcs); - const FilePath compilerPath = Core::ICore::clangExecutable(CLANG_BINDIR); - if (!compilerPath.isEmpty()) { - tcs.append(autoDetectToolchains({compilerPath}, - Constants::C_LANGUAGE_ID, - Constants::CLANG_TOOLCHAIN_TYPEID, - known, - GccToolChain::Clang)); - } + tcs.append(autoDetectSdkClangToolchain(known)); result += tcs; @@ -1508,6 +1501,20 @@ Toolchains GccToolChainFactory::detectForImport(const ToolChainDescription &tcd) return result; } +Toolchains GccToolChainFactory::autoDetectSdkClangToolchain(const Toolchains &known) +{ + const FilePath compilerPath = Core::ICore::clangExecutable(CLANG_BINDIR); + if (compilerPath.isEmpty()) + return {}; + + for (ToolChain * const existingTc : known) { + if (existingTc->compilerCommand() == compilerPath) + return {existingTc}; + } + + return {autoDetectToolChain({compilerPath, Constants::C_LANGUAGE_ID}, GccToolChain::Clang)}; +} + Toolchains GccToolChainFactory::autoDetectToolchains(const FilePaths &compilerPaths, const Id language, const Id requiredTypeId, diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 853b61add12..4c26fd7f2dc 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -196,6 +196,7 @@ private: static Toolchains autoDetectToolChain(const ToolChainDescription &tcd, const GccToolChain::SubType subType, const ToolchainChecker &checker = {}); + static Toolchains autoDetectSdkClangToolchain(const Toolchains &known); const bool m_autoDetecting; }; From 25feb7db895bc7e71dce46a86ff01d2352c65e2e Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Mon, 2 Oct 2023 14:29:47 +0200 Subject: [PATCH 1389/1777] Android: Adapt SDK tree view to Android Studio This adds a category for "Android API 34" and puts the nicknames into quotes. This makes the tree look like in Android Studio's most recent SDK manager. Change-Id: If80ea5738da208151fe22e307183752b68d2b550 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> --- src/plugins/android/androidmanager.cpp | 64 +++++++++++++------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index 13595e93c51..b161698d686 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -450,67 +450,69 @@ QString androidNameForApiLevel(int x) case 2: return QLatin1String("Android 1.1"); case 3: - return QLatin1String("Android 1.5 (Cupcake)"); + return QLatin1String("Android 1.5 (\"Cupcake\")"); case 4: - return QLatin1String("Android 1.6 (Donut)"); + return QLatin1String("Android 1.6 (\"Donut\")"); case 5: - return QLatin1String("Android 2.0 (Eclair)"); + return QLatin1String("Android 2.0 (\"Eclair\")"); case 6: - return QLatin1String("Android 2.0.1 (Eclair)"); + return QLatin1String("Android 2.0.1 (\"Eclair\")"); case 7: - return QLatin1String("Android 2.1 (Eclair)"); + return QLatin1String("Android 2.1 (\"Eclair\")"); case 8: - return QLatin1String("Android 2.2 (Froyo)"); + return QLatin1String("Android 2.2 (\"Froyo\")"); case 9: - return QLatin1String("Android 2.3 (Gingerbread)"); + return QLatin1String("Android 2.3 (\"Gingerbread\")"); case 10: - return QLatin1String("Android 2.3.3 (Gingerbread)"); + return QLatin1String("Android 2.3.3 (\"Gingerbread\")"); case 11: - return QLatin1String("Android 3.0 (Honeycomb)"); + return QLatin1String("Android 3.0 (\"Honeycomb\")"); case 12: - return QLatin1String("Android 3.1 (Honeycomb)"); + return QLatin1String("Android 3.1 (\"Honeycomb\")"); case 13: - return QLatin1String("Android 3.2 (Honeycomb)"); + return QLatin1String("Android 3.2 (\"Honeycomb\")"); case 14: - return QLatin1String("Android 4.0 (IceCreamSandwich)"); + return QLatin1String("Android 4.0 (\"IceCreamSandwich\")"); case 15: - return QLatin1String("Android 4.0.3 (IceCreamSandwich)"); + return QLatin1String("Android 4.0.3 (\"IceCreamSandwich\")"); case 16: - return QLatin1String("Android 4.1 (Jelly Bean)"); + return QLatin1String("Android 4.1 (\"Jelly Bean\")"); case 17: - return QLatin1String("Android 4.2 (Jelly Bean)"); + return QLatin1String("Android 4.2 (\"Jelly Bean\")"); case 18: - return QLatin1String("Android 4.3 (Jelly Bean)"); + return QLatin1String("Android 4.3 (\"Jelly Bean\")"); case 19: - return QLatin1String("Android 4.4 (KitKat)"); + return QLatin1String("Android 4.4 (\"KitKat\")"); case 20: - return QLatin1String("Android 4.4W (KitKat Wear)"); + return QLatin1String("Android 4.4W (\"KitKat Wear\")"); case 21: - return QLatin1String("Android 5.0 (Lollipop)"); + return QLatin1String("Android 5.0 (\"Lollipop\")"); case 22: - return QLatin1String("Android 5.1 (Lollipop)"); + return QLatin1String("Android 5.1 (\"Lollipop\")"); case 23: - return QLatin1String("Android 6.0 (Marshmallow)"); + return QLatin1String("Android 6.0 (\"Marshmallow\")"); case 24: - return QLatin1String("Android 7.0 (Nougat)"); + return QLatin1String("Android 7.0 (\"Nougat\")"); case 25: - return QLatin1String("Android 7.1.1 (Nougat)"); + return QLatin1String("Android 7.1.1 (\"Nougat\")"); case 26: - return QLatin1String("Android 8.0 (Oreo)"); + return QLatin1String("Android 8.0 (\"Oreo\")"); case 27: - return QLatin1String("Android 8.1 (Oreo)"); + return QLatin1String("Android 8.1 (\"Oreo\")"); case 28: - return QLatin1String("Android 9.0 (Pie)"); + return QLatin1String("Android 9.0 (\"Pie\")"); case 29: - return QLatin1String("Android 10.0 (Q)"); + return QLatin1String("Android 10.0 (\"Q\")"); case 30: - return QLatin1String("Android 11.0 (R)"); + return QLatin1String("Android 11.0 (\"R\")"); case 31: - return QLatin1String("Android 12.0 (S)"); + return QLatin1String("Android 12.0 (\"S\")"); case 32: - return QLatin1String("Android 12L (Sv2, API 32)"); + return QLatin1String("Android 12L (\"Sv2\")"); case 33: - return QLatin1String("Android 13.0 (Tiramisu)"); + return QLatin1String("Android 13.0 (\"Tiramisu\")"); + case 34: + return QLatin1String("Android API 34"); default: return Tr::tr("Unknown Android version. API Level: %1").arg(x); } From 07e758147b90a9e35944fd14acbc27ca1336594b Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 2 Oct 2023 17:19:09 +0200 Subject: [PATCH 1390/1777] CMakeFileCompletionAssist: Fix a crash on completion Avoid calling not-thread safe functions from inside the CMakeFileCompletionAssist::performAsync(). Move calling these functions before the asyncRun, collect the needed data inside the PerformInputData structure and pass it to the other thread instead. Fixes: QTCREATORBUG-29683 Change-Id: I56127163a47339bc45d47f3a7d2c76d518b640f7 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../cmakefilecompletionassist.cpp | 119 +++++++++++------- .../texteditor/codeassist/asyncprocessor.h | 4 +- 2 files changed, 75 insertions(+), 48 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 93c00509c0c..0eb312736b5 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -23,6 +23,7 @@ #include <texteditor/codeassist/genericproposal.h> #include <texteditor/texteditorsettings.h> +#include <utils/async.h> #include <utils/fsengine/fileiconprovider.h> #include <utils/utilsicons.h> @@ -32,12 +33,15 @@ using namespace Utils; namespace CMakeProjectManager::Internal { +class PerformInputData; + class CMakeFileCompletionAssist : public AsyncProcessor { public: CMakeFileCompletionAssist(); - IAssistProposal *performAsync() final; + IAssistProposal *perform() final; + IAssistProposal *performAsync() final { return nullptr; } const QIcon m_variableIcon; const QIcon m_projectVariableIcon; @@ -51,6 +55,10 @@ public: const QIcon m_importedTargetIcon; TextEditor::SnippetAssistCollector m_snippetCollector; + +private: + IAssistProposal *doPerform(const PerformInputData &data); + PerformInputData generatePerformInputData() const; }; CMakeFileCompletionAssist::CMakeFileCompletionAssist() @@ -242,41 +250,62 @@ static QPair<QStringList, QStringList> getLocalFunctionsAndVariables(const QByte return {functions, variables}; } -IAssistProposal *CMakeFileCompletionAssist::performAsync() +class PerformInputData { +public: CMakeKeywords keywords; CMakeKeywords projectKeywords; - const FilePath &filePath = interface()->filePath(); - if (!filePath.isEmpty() && filePath.isFile()) { - if (auto tool = CMakeToolManager::defaultProjectOrDefaultCMakeTool()) - keywords = tool->keywords(); - } - QStringList buildTargets; QStringList importedTargets; QStringList findPackageVariables; +}; + +PerformInputData CMakeFileCompletionAssist::generatePerformInputData() const +{ + PerformInputData data; + + const FilePath &filePath = interface()->filePath(); + if (!filePath.isEmpty() && filePath.isFile()) { + if (auto tool = CMakeToolManager::defaultProjectOrDefaultCMakeTool()) + data.keywords = tool->keywords(); + } + if (auto bs = qobject_cast<CMakeBuildSystem *>(ProjectTree::currentBuildSystem())) { for (const auto &target : std::as_const(bs->buildTargets())) if (target.targetType != TargetType::UtilityType) - buildTargets << target.title; - projectKeywords = bs->projectKeywords(); - importedTargets = bs->projectImportedTargets(); - findPackageVariables = bs->projectFindPackageVariables(); + data.buildTargets << target.title; + data.projectKeywords = bs->projectKeywords(); + data.importedTargets = bs->projectImportedTargets(); + data.findPackageVariables = bs->projectFindPackageVariables(); } + return data; +} + +IAssistProposal *CMakeFileCompletionAssist::perform() +{ + IAssistProposal *result = immediateProposal(); + interface()->prepareForAsyncUse(); + m_watcher.setFuture(Utils::asyncRun([this, inputData = generatePerformInputData()] { + interface()->recreateTextDocument(); + return doPerform(inputData); + })); + return result; +} + +IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &data) +{ if (isInComment(interface())) return nullptr; const int startPos = findWordStart(interface(), interface()->position()); - const int functionStart = findFunctionStart(interface()); const int prevFunctionEnd = findFunctionEnd(interface()); QString functionName; if (functionStart > prevFunctionEnd) { - int functionStartPos = findWordStart(interface(), functionStart); - functionName - = interface()->textAt(functionStartPos, functionStart - functionStartPos); + const int functionStartPos = findWordStart(interface(), functionStart); + functionName = interface()->textAt(functionStartPos, functionStart - functionStartPos); } if (interface()->reason() == IdleEditor) { @@ -296,12 +325,12 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() const QString varGenexToken = interface()->textAt(startPos - 2, 2); if (varGenexToken == "${" || varGenexToken == "$<") { if (varGenexToken == "${") { - items.append(generateList(keywords.variables, m_variableIcon)); - items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); - items.append(generateList(findPackageVariables, m_projectVariableIcon)); + items.append(generateList(data.keywords.variables, m_variableIcon)); + items.append(generateList(data.projectKeywords.variables, m_projectVariableIcon)); + items.append(generateList(data.findPackageVariables, m_projectVariableIcon)); } if (varGenexToken == "$<") - items.append(generateList(keywords.generatorExpressions, m_genexIcon)); + items.append(generateList(data.keywords.generatorExpressions, m_genexIcon)); return new GenericProposal(startPos, items); } @@ -312,56 +341,56 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() if (functionName == "if" || functionName == "elseif" || functionName == "while" || functionName == "set" || functionName == "list" || functionName == "cmake_print_variables") { - items.append(generateList(keywords.variables, m_variableIcon)); - items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); - items.append(generateList(findPackageVariables, m_projectVariableIcon)); + items.append(generateList(data.keywords.variables, m_variableIcon)); + items.append(generateList(data.projectKeywords.variables, m_projectVariableIcon)); + items.append(generateList(data.findPackageVariables, m_projectVariableIcon)); items.append(generateList(localVariables, m_variableIcon)); } if (functionName == "if" || functionName == "elseif" || functionName == "cmake_policy") - items.append(generateList(keywords.policies, m_variableIcon)); + items.append(generateList(data.keywords.policies, m_variableIcon)); if (functionName.contains("path") || functionName.contains("file") || functionName.contains("add_executable") || functionName.contains("add_library") || functionName == "include" || functionName == "add_subdirectory" - || functionName == "install" || functionName == "target_sources" || functionName == "set" - || functionName == "list") { + || functionName == "install" || functionName == "target_sources" + || functionName == "set" || functionName == "list") { fileStartPos = addFilePathItems(interface(), items, startPos); } if (functionName == "set_property" || functionName == "cmake_print_properties") - items.append(generateList(keywords.properties, m_propertyIcon)); + items.append(generateList(data.keywords.properties, m_propertyIcon)); if (functionName == "set_directory_properties") - items.append(generateList(keywords.directoryProperties, m_propertyIcon)); + items.append(generateList(data.keywords.directoryProperties, m_propertyIcon)); if (functionName == "set_source_files_properties") - items.append(generateList(keywords.sourceProperties, m_propertyIcon)); + items.append(generateList(data.keywords.sourceProperties, m_propertyIcon)); if (functionName == "set_target_properties") - items.append(generateList(keywords.targetProperties, m_propertyIcon)); + items.append(generateList(data.keywords.targetProperties, m_propertyIcon)); if (functionName == "set_tests_properties") - items.append(generateList(keywords.testProperties, m_propertyIcon)); + items.append(generateList(data.keywords.testProperties, m_propertyIcon)); if (functionName == "include" && !onlyFileItems()) - items.append(generateList(keywords.includeStandardModules, m_moduleIcon)); + items.append(generateList(data.keywords.includeStandardModules, m_moduleIcon)); if (functionName == "find_package") - items.append(generateList(keywords.findModules, m_moduleIcon)); + items.append(generateList(data.keywords.findModules, m_moduleIcon)); if ((functionName.contains("target") || functionName == "install" || functionName == "add_dependencies" || functionName == "set_property" || functionName == "export" || functionName == "cmake_print_properties" || functionName == "if" || functionName == "elseif") && !onlyFileItems()) { - items.append(generateList(buildTargets, m_targetsIcon)); - items.append(generateList(importedTargets, m_importedTargetIcon)); + items.append(generateList(data.buildTargets, m_targetsIcon)); + items.append(generateList(data.importedTargets, m_importedTargetIcon)); } - if (keywords.functionArgs.contains(functionName) && !onlyFileItems()) { - QStringList functionSymbols = keywords.functionArgs.value(functionName); + if (data.keywords.functionArgs.contains(functionName) && !onlyFileItems()) { + const QStringList functionSymbols = data.keywords.functionArgs.value(functionName); items.append(generateList(functionSymbols, m_argsIcon)); } else if (functionName.isEmpty()) { // On a new line we just want functions - items.append(generateList(keywords.functions, m_functionIcon)); - items.append(generateList(projectKeywords.functions, m_projectFunctionIcon)); + items.append(generateList(data.keywords.functions, m_functionIcon)); + items.append(generateList(data.projectKeywords.functions, m_projectFunctionIcon)); items.append(generateList(localFunctions, m_functionIcon)); // Snippets would make more sense only for the top level suggestions @@ -370,14 +399,14 @@ IAssistProposal *CMakeFileCompletionAssist::performAsync() // Inside an unknown function we could have variables or properties fileStartPos = addFilePathItems(interface(), items, startPos); if (!onlyFileItems()) { - items.append(generateList(keywords.variables, m_variableIcon)); - items.append(generateList(projectKeywords.variables, m_projectVariableIcon)); + items.append(generateList(data.keywords.variables, m_variableIcon)); + items.append(generateList(data.projectKeywords.variables, m_projectVariableIcon)); items.append(generateList(localVariables, m_variableIcon)); - items.append(generateList(findPackageVariables, m_projectVariableIcon)); + items.append(generateList(data.findPackageVariables, m_projectVariableIcon)); - items.append(generateList(keywords.properties, m_propertyIcon)); - items.append(generateList(buildTargets, m_targetsIcon)); - items.append(generateList(importedTargets, m_importedTargetIcon)); + items.append(generateList(data.keywords.properties, m_propertyIcon)); + items.append(generateList(data.buildTargets, m_targetsIcon)); + items.append(generateList(data.importedTargets, m_importedTargetIcon)); } } diff --git a/src/plugins/texteditor/codeassist/asyncprocessor.h b/src/plugins/texteditor/codeassist/asyncprocessor.h index 9894239af1d..94336fd537d 100644 --- a/src/plugins/texteditor/codeassist/asyncprocessor.h +++ b/src/plugins/texteditor/codeassist/asyncprocessor.h @@ -14,7 +14,7 @@ class TEXTEDITOR_EXPORT AsyncProcessor : public TextEditor::IAssistProcessor public: AsyncProcessor(); - IAssistProposal *perform() final; + IAssistProposal *perform() override; bool running() override; void cancel() override; @@ -23,8 +23,6 @@ public: protected: bool isCanceled() const; - -private: QFutureWatcher<IAssistProposal *> m_watcher; }; From 3956d5b2793758b64da88d446a3420f23db95d0a Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 2 Oct 2023 14:25:58 +0200 Subject: [PATCH 1391/1777] CMakePM: Remove caching of CMakeTool No need to cache the value of the CMakeTool, since it causes issues with the update mechanism. Task-number: QTCREATORBUG-29683 Change-Id: Id5925b9a90d6010aa09b4a2f7b5ed3d447f5cd7a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../cmakeprojectmanager/cmaketoolmanager.cpp | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index 6eb16cc4af1..3cb04046204 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -247,31 +247,12 @@ void CMakeToolManager::deregisterCMakeTool(const Id &id) CMakeTool *CMakeToolManager::defaultProjectOrDefaultCMakeTool() { - static CMakeTool *tool = nullptr; - - auto updateTool = [&] { - tool = nullptr; - if (auto bs = ProjectExplorer::ProjectTree::currentBuildSystem()) - tool = CMakeKitAspect::cmakeTool(bs->target()->kit()); - if (!tool) - tool = CMakeToolManager::defaultCMakeTool(); - }; + CMakeTool *tool = nullptr; + if (auto bs = ProjectExplorer::ProjectTree::currentBuildSystem()) + tool = CMakeKitAspect::cmakeTool(bs->target()->kit()); if (!tool) - updateTool(); - - QObject::connect(CMakeToolManager::instance(), - &CMakeToolManager::cmakeUpdated, - CMakeToolManager::instance(), - [&]() { updateTool(); }); - QObject::connect(CMakeToolManager::instance(), - &CMakeToolManager::cmakeRemoved, - CMakeToolManager::instance(), - [&]() { updateTool(); }); - QObject::connect(CMakeToolManager::instance(), - &CMakeToolManager::defaultCMakeChanged, - CMakeToolManager::instance(), - [&]() { updateTool(); }); + tool = CMakeToolManager::defaultCMakeTool(); return tool; } From 298921be2d420e3aadafb9304459b9cead6ec20f Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 2 Oct 2023 21:58:23 +0200 Subject: [PATCH 1392/1777] CMakePM: Do not show the same tooltip on mouse pointer change Let's say you move the mouse left and right on the keyword, we shouldn't flicker showing the same tooltip to the new position. Change-Id: I45b69578d377384422535ce5f33f81bc916a42e2 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 325cfb94f6b..1c836594d08 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -476,15 +476,16 @@ void CMakeHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget helpCategory, word); - setPriority(m_helpToolTip.isEmpty() ? Priority_Tooltip : Priority_None); + setPriority(!m_helpToolTip.isEmpty() ? Priority_Tooltip : Priority_None); } void CMakeHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoint &point) { - if (!m_helpToolTip.isEmpty()) + if (!m_helpToolTip.isEmpty() && toolTip() != m_helpToolTip) Utils::ToolTip::show(point, m_helpToolTip, Qt::MarkdownText, editorWidget, m_contextHelp); - else + else if (m_helpToolTip.isEmpty()) Utils::ToolTip::hide(); + setToolTip(m_helpToolTip); } // From 8404f05ce6a2d0ac0322d5707760c50b0fb82b73 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 29 Sep 2023 13:46:39 +0200 Subject: [PATCH 1393/1777] CppEditor: use the corrrect link callback when looking for type Also fixes an unused argument warning. amends 80633a59aabca94e52e473837164203041e72c6e Change-Id: I6be122c44010a612d95a20dd987aac6e73a08430 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/cppeditor/cppeditorwidget.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index bb8849ab4b8..0419ef6b035 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -991,19 +991,14 @@ void CppEditorWidget::findLinkAt(const QTextCursor &cursor, void CppEditorWidget::findTypeAt(const QTextCursor &cursor, const Utils::LinkHandler &processLinkCallback, - bool resolveTarget, + bool /*resolveTarget*/, bool inNextSplit) { if (!CppModelManager::instance()) return; const CursorInEditor cursorInEditor(cursor, textDocument()->filePath(), this, textDocument()); - const auto callback = [self = QPointer(this), - split = inNextSplit != alwaysOpenLinksInNextSplit()](const Link &link) { - if (self && link.hasValidTarget()) - self->openLink(link, split); - }; - CppModelManager::followSymbolToType(cursorInEditor, callback, inNextSplit); + CppModelManager::followSymbolToType(cursorInEditor, processLinkCallback, inNextSplit); } unsigned CppEditorWidget::documentRevision() const From 47c4aa36a7750632959474f2769a5428559e2c9a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 2 Oct 2023 14:24:48 +0200 Subject: [PATCH 1394/1777] Utils: Add default move to Utils::Key coverity complains otherwise. Change-Id: I9d552782561addcb74e3b72d2d71cd0b5f2114ca Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/storekey.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libs/utils/storekey.h b/src/libs/utils/storekey.h index 79e43609156..68b433d05a6 100644 --- a/src/libs/utils/storekey.h +++ b/src/libs/utils/storekey.h @@ -15,6 +15,9 @@ class QTCREATOR_UTILS_EXPORT Key { public: Key() = default; + Key(const Key &) = default; + Key(Key &&) = default; + Key(const QByteArray &key) : data(key) {} template <int N> @@ -30,6 +33,9 @@ public: Key(const Key &base, int number); ~Key(); + Key &operator=(const Key &) = default; + Key &operator=(Key &&) = default; + const QByteArrayView view() const; const QByteArray &toByteArray() const; QByteArrayView operator()() const { return data; } From 895c588dd6c8a777b860b4e4ec3f69d2f7c25eea Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 3 Oct 2023 14:52:50 +0200 Subject: [PATCH 1395/1777] Core: Brings back revision in About dialog The revision is part of the Utils::appInfo() structure. Make sure to display it when is set. Change-Id: I0dece3bdd011127f63974b963e35f73834416b6c Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/icore.cpp | 5 ++--- src/plugins/coreplugin/versiondialog.cpp | 15 +++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 175c9f3a037..e4706c62499 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -1007,9 +1007,8 @@ QString ICore::systemInformation() QString result = PluginManager::systemInformation() + '\n'; result += versionString() + '\n'; result += buildCompatibilityString() + '\n'; -#ifdef IDE_REVISION - result += QString("From revision %1\n").arg(QString::fromLatin1(Constants::IDE_REVISION_STR).left(10)); -#endif + if (!Utils::appInfo().revision.isEmpty()) + result += QString("From revision %1\n").arg(Utils::appInfo().revision.left(10)); #ifdef QTC_SHOW_BUILD_DATE result += QString("Built on %1 %2\n").arg(QLatin1String(__DATE__), QLatin1String(__TIME__)); #endif diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp index 8c0e70186da..8e68172de2c 100644 --- a/src/plugins/coreplugin/versiondialog.cpp +++ b/src/plugins/coreplugin/versiondialog.cpp @@ -38,14 +38,13 @@ VersionDialog::VersionDialog(QWidget *parent) const Utils::AppInfo appInfo = Utils::appInfo(); QString ideRev; -#ifdef IDE_REVISION - ideRev = Tr::tr("<br/>From revision %1<br/>") - .arg(appInfo.revisionUrl.isEmpty() - ? appInfo.revision - : QString::fromLatin1("<a href=\"%1\">%2</a>") - .arg(appInfo.revisionUrl, appInfo.revision)); -#endif - QString buildDateInfo; + if (!appInfo.revision.isEmpty()) + ideRev = Tr::tr("<br/>From revision %1<br/>") + .arg(appInfo.revisionUrl.isEmpty() + ? appInfo.revision + : QString::fromLatin1("<a href=\"%1\">%2</a>") + .arg(appInfo.revisionUrl, appInfo.revision)); + QString buildDateInfo; #ifdef QTC_SHOW_BUILD_DATE buildDateInfo = Tr::tr("<br/>Built on %1 %2<br/>").arg(QLatin1String(__DATE__), QLatin1String(__TIME__)); #endif From 91a9410aa3e2900c31ec6093285fd7da3d33bc2f Mon Sep 17 00:00:00 2001 From: Orgad Shaneh <orgad.shaneh@audiocodes.com> Date: Mon, 2 Oct 2023 21:09:19 +0300 Subject: [PATCH 1396/1777] DAP: Fix MSVC warning conversion from 'size_t' to 'int', possible loss of data Change-Id: Iaea0dde9be1bec467dd788058dc7b64c7af33da4 Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> --- src/plugins/debugger/dap/dapengine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/dap/dapengine.h b/src/plugins/debugger/dap/dapengine.h index 52b84a36a6f..6f0ae730c17 100644 --- a/src/plugins/debugger/dap/dapengine.h +++ b/src/plugins/debugger/dap/dapengine.h @@ -35,7 +35,7 @@ public: void handleNext(); VariableItem currentItem() const { return m_currentVarItem; } - int queueSize() const { return m_queue.size(); } + int queueSize() const { return int(m_queue.size()); } private: void startHandling(); From 17d4099b89bbf9130342ca7e5898635327e563f2 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 4 Oct 2023 07:41:19 +0200 Subject: [PATCH 1397/1777] SquishTests: Adapt to changed class Change-Id: Id4ae34299ef80f22a466340511c2fa12dd6cf191 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- 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 36d38fb7706..a321ad26081 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -147,7 +147,7 @@ :Qt Creator_CloseButton {type='CloseButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton {occurrence='4' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::Internal::CommandComboBox {type='Core::Internal::CommandComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' visible='1' windowTitle?='*Qt Creator'} +:Qt Creator_Core::Internal::MainWindow {type='Utils::AppMainWindow' visible='1' windowTitle?='*Qt Creator'} :Qt Creator_Core::Internal::NavComboBox {type='Core::Internal::NavComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::Internal::ProgressBar {type='Core::Internal::ProgressBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} From 67e4c280aa76029dac7459e835d6562b77a86dfc Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 4 Oct 2023 09:37:45 +0200 Subject: [PATCH 1398/1777] Utils: Fix connection Change-Id: I88090c4200cec2a80d6b871b9b443ad7891573e1 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 27628402423..cf5dd311085 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1245,7 +1245,7 @@ void StringAspect::addToLayout(LayoutItem &parent) labelDisplay->setTextInteractionFlags(Qt::TextSelectableByMouse); labelDisplay->setText(displayedString); labelDisplay->setToolTip(d->m_showToolTipOnLabel ? displayedString : toolTip()); - connect(this, &StringAspect::setElideMode, labelDisplay, &ElidingLabel::setElideMode); + connect(this, &StringAspect::elideModeChanged, labelDisplay, &ElidingLabel::setElideMode); addLabeledItem(parent, labelDisplay); connect(&d->undoable.m_signal, &UndoSignaller::changed, labelDisplay, [this, labelDisplay] { From ce291a0bc201fb985f20c974bff64b5fbfca334c Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 4 Oct 2023 10:13:36 +0200 Subject: [PATCH 1399/1777] Core: Fix appearance of mutltiple status bars There should only be one. Fixes: QTCREATORBUG-29691 Change-Id: I02b4aaec35d6a35b0130cdbc9d933aed9cfb8132 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/icore.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index e4706c62499..67ea33ccc8a 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -1237,14 +1237,17 @@ void MainWindowPrivate::init() // Add small Toolbuttons for toggling the navigation widgets StatusBarManager::addStatusBarWidget(m_toggleLeftSideBarButton, StatusBarManager::First); - int childsCount = q->statusBar()->findChildren<QWidget *>(QString(), Qt::FindDirectChildrenOnly).count(); - q->statusBar()->insertPermanentWidget(childsCount - 1, m_toggleRightSideBarButton); // before QSizeGrip + int childsCount = m_modeStack->statusBar() + ->findChildren<QWidget *>(QString(), Qt::FindDirectChildrenOnly) + .count(); + m_modeStack->statusBar()->insertPermanentWidget(childsCount - 1, + m_toggleRightSideBarButton); // before QSizeGrip -// setUnifiedTitleAndToolBarOnMac(true); + // setUnifiedTitleAndToolBarOnMac(true); //if (HostOsInfo::isAnyUnixHost()) - //signal(SIGINT, handleSigInt); + //signal(SIGINT, handleSigInt); - q->statusBar()->setProperty("p_styled", true); + m_modeStack->statusBar()->setProperty("p_styled", true); /*auto dropSupport = new DropSupport(this, [](QDropEvent *event, DropSupport *) { return event->source() == nullptr; // only accept drops from the "outside" (e.g. file manager) From 7028e27a81dfe46cd9fe9fb750ed5f7b0ae61241 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 2 Oct 2023 16:31:57 +0200 Subject: [PATCH 1400/1777] CMakePM: Add Debugger -> Start Debugging -> Start CMake Debugging This is where the user would expect it. It is an action, so the user can assign a keyboard shortcut if needed. Change-Id: I4c6db3b1dafb5fb173a07c21d271715310a2b091 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> --- .../cmakeprojectconstants.h | 2 ++ .../cmakeprojectmanager.cpp | 30 +++++++++++++++++++ .../cmakeprojectmanager/cmakeprojectmanager.h | 3 ++ 3 files changed, 35 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h b/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h index 53180461f3e..f0da2a488ae 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h @@ -11,6 +11,7 @@ const char CMAKE_PROJECT_MIMETYPE[] = "text/x-cmake-project"; const char CMAKE_EDITOR_ID[] = "CMakeProject.CMakeEditor"; const char RUN_CMAKE[] = "CMakeProject.RunCMake"; const char RUN_CMAKE_PROFILER[] = "CMakeProject.RunCMakeProfiler"; +const char RUN_CMAKE_DEBUGGER[] = "CMakeProject.RunCMakeDebugger"; const char CLEAR_CMAKE_CACHE[] = "CMakeProject.ClearCache"; const char RESCAN_PROJECT[] = "CMakeProject.RescanProject"; const char RUN_CMAKE_CONTEXT_MENU[] = "CMakeProject.RunCMakeContextMenu"; @@ -24,6 +25,7 @@ const char CMAKEFORMATTER_SETTINGS_GROUP[] = "CMakeFormatter"; const char CMAKEFORMATTER_GENERAL_GROUP[] = "General"; const char CMAKEFORMATTER_ACTION_ID[] = "CMakeFormatter.Action"; const char CMAKEFORMATTER_MENU_ID[] = "CMakeFormatter.Menu"; +const char CMAKE_DEBUGGING_GROUP[] = "Debugger.Group.CMake"; const char PACKAGE_MANAGER_DIR[] = ".qtc/package-manager"; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index fc6be84a2b8..0140ffdc907 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -53,6 +53,7 @@ CMakeManager::CMakeManager() , m_reloadCMakePresetsAction( new QAction(Utils::Icons::RELOAD.icon(), Tr::tr("Reload CMake Presets"), this)) , m_cmakeProfilerAction(new QAction(QIcon(), Tr::tr("CMake Profiler"), this)) + , m_cmakeDebuggerAction(new QAction(QIcon(), Tr::tr("Start CMake Debugging"), this)) { Core::ActionContainer *mbuild = Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT); @@ -64,6 +65,8 @@ CMakeManager::CMakeManager() Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_FILECONTEXT); Core::ActionContainer *manalyzer = Core::ActionManager::actionContainer(Debugger::Constants::M_DEBUG_ANALYZER); + Core::ActionContainer *mdebugger = + Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING); const Core::Context projectContext(CMakeProjectManager::Constants::CMAKE_PROJECT_ID); const Core::Context globalContext(Core::Constants::C_GLOBAL); @@ -145,8 +148,32 @@ CMakeManager::CMakeManager() runCMakeWithProfiling(ProjectManager::startupBuildSystem()); }); + // CMake Debugger + mdebugger->appendGroup(Constants::CMAKE_DEBUGGING_GROUP); + mdebugger->addSeparator(Core::Context(Core::Constants::C_GLOBAL), + Constants::CMAKE_DEBUGGING_GROUP, + &m_cmakeDebuggerSeparator); + + command = Core::ActionManager::registerAction(m_cmakeDebuggerAction, + Constants::RUN_CMAKE_DEBUGGER, + globalContext); + command->setDescription(m_cmakeDebuggerAction->text()); + mdebugger->addAction(command, Constants::CMAKE_DEBUGGING_GROUP); + connect(m_cmakeDebuggerAction, &QAction::triggered, this, [] { + ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DAP_CMAKE_DEBUG_RUN_MODE, + false); + }); + connect(ProjectManager::instance(), &ProjectManager::startupProjectChanged, this, [this] { updateCmakeActions(ProjectTree::currentNode()); + + auto cmakeBuildSystem = static_cast<CMakeBuildSystem*>(ProjectManager::startupBuildSystem()); + if (cmakeBuildSystem) { + const BuildDirParameters parameters(cmakeBuildSystem); + const auto tool = parameters.cmakeTool(); + CMakeTool::Version version = tool ? tool->version() : CMakeTool::Version(); + m_canDebugCMake = (version.major == 3 && version.minor >= 27) || version.major > 3; + } }); connect(BuildManager::instance(), &BuildManager::buildStateChanged, this, [this] { updateCmakeActions(ProjectTree::currentNode()); @@ -169,6 +196,9 @@ void CMakeManager::updateCmakeActions(Node *node) m_rescanProjectAction->setVisible(visible); m_cmakeProfilerAction->setEnabled(visible); + m_cmakeDebuggerAction->setEnabled(m_canDebugCMake && visible); + m_cmakeDebuggerSeparator->setVisible(m_canDebugCMake && visible); + const bool reloadPresetsVisible = [project] { if (!project) return false; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h index 149fe65e1c4..2004538b58d 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h @@ -41,6 +41,9 @@ private: QAction *m_reloadCMakePresetsAction; Utils::ParameterAction *m_buildFileAction; QAction *m_cmakeProfilerAction; + QAction *m_cmakeDebuggerAction; + QAction *m_cmakeDebuggerSeparator; + bool m_canDebugCMake = false; }; } // namespace Internal From 8d7a42095baef19452b71e504a70b75307a71cc6 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 28 Sep 2023 18:00:16 +0200 Subject: [PATCH 1401/1777] ProjextExplorer: Combine gcc and mingw compiler search Instead of running detection for (non-mingw-)gcc and mingw twice and discarding "non-matching" results, run detection once and determine the subtype afterwards. This practically halves the time for their detection except for Mac hosts where only mingw was searched before. Change-Id: Id5c43c82125ca95570b890fef7ccd59d1edd5a6e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 115 ++++++------------- src/plugins/projectexplorer/gcctoolchain.h | 4 +- 2 files changed, 36 insertions(+), 83 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 6747cda6b61..e43022f403b 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1274,6 +1274,7 @@ static FilePaths findCompilerCandidates(OsType os, // "*-" + compilerName + "-[1-9]*" "avr-gcc-4.8.1", "avr32-gcc-4.4.7" // "arm-none-eabi-gcc-9.1.0" // "x86_64-pc-linux-gnu-gcc-7.4.1" + // but not "c89-gcc" or "c99-gcc" FilePaths compilerPaths; const int cl = compilerName.size(); @@ -1288,6 +1289,9 @@ static FilePaths findCompilerCandidates(OsType os, if (!detectVariants) continue; + if (fileName == u"c89-gcc" || fileName == u"c99-gcc") + continue; + int pos = fileName.indexOf(compilerName); if (pos == -1) continue; @@ -1352,12 +1356,18 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co FilePaths executables; - QStringList nameFilters = {"*icpc*", "*icc*", "*g++*", "*gcc*", "*clang++*", "*clang*"}; + QStringList nameFilters = {"*icpc*", "*icc*", "*clang++*", "*clang*", "*gcc*", "*g++*"}; FilePath::iterateDirectories(searchPaths, [&executables](const FilePath &path) { executables.append(path); return IterationPolicy::Continue; - }, {nameFilters, QDir::Files | QDir::Executable}); + }, {nameFilters, QDir::Files | QDir::Executable }); + + // Gcc is almost never what you want on macOS, but it is by default found in /usr/bin + if (HostOsInfo::isMacHost() && detector.device->type() != Constants::DESKTOP_DEVICE_TYPE) { + executables.removeOne(FilePath::fromPathPart(u"/usr/bin/gcc")); + executables.removeOne(FilePath::fromPathPart(u"/usr/bin/g++")); + } const OsType os = detector.device->osType(); @@ -1378,20 +1388,6 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co detector.alreadyKnown, GccToolChain::LinuxIcc); - // MinGW - - result += autoDetectToolchains(findCompilerCandidates(os, executables, "g++", true), - Constants::CXX_LANGUAGE_ID, - Constants::MINGW_TOOLCHAIN_TYPEID, - detector.alreadyKnown, - GccToolChain::MinGW); - - result += autoDetectToolchains(findCompilerCandidates(os, executables, "gcc", true), - Constants::C_LANGUAGE_ID, - Constants::MINGW_TOOLCHAIN_TYPEID, - detector.alreadyKnown, - GccToolChain::MinGW); - // Clang Toolchains tcs; @@ -1413,22 +1409,18 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co result += tcs; - // GCC + // Real GCC or MingGW - // Gcc is almost never what you want on macOS, but it is by default found in /usr/bin - if (!HostOsInfo::isMacHost() || detector.device->type() != Constants::DESKTOP_DEVICE_TYPE) { - - result += autoDetectToolchains(findCompilerCandidates(os, executables, "g++", true), - Constants::CXX_LANGUAGE_ID, - Constants::GCC_TOOLCHAIN_TYPEID, - detector.alreadyKnown, - GccToolChain::RealGcc); - result += autoDetectToolchains(findCompilerCandidates(os, executables, "gcc", true), - Constants::C_LANGUAGE_ID, - Constants::GCC_TOOLCHAIN_TYPEID, - detector.alreadyKnown, - GccToolChain::RealGcc); - } + result += autoDetectToolchains(findCompilerCandidates(os, executables, "g++", true), + Constants::CXX_LANGUAGE_ID, + Constants::GCC_TOOLCHAIN_TYPEID, + detector.alreadyKnown, + GccToolChain::RealGcc /*sic!*/); + result += autoDetectToolchains(findCompilerCandidates(os, executables, "gcc", true), + Constants::C_LANGUAGE_ID, + Constants::GCC_TOOLCHAIN_TYPEID, + detector.alreadyKnown, + GccToolChain::RealGcc /*sic!*/); return result; } @@ -1451,24 +1443,6 @@ Toolchains GccToolChainFactory::detectForImport(const ToolChainDescription &tcd) result += autoDetectToolChain(tcd, GccToolChain::LinuxIcc); } - // MingW - - const bool cCompiler = tcd.language == Constants::C_LANGUAGE_ID - && ((fileName.startsWith("gcc") || fileName.endsWith("gcc")) - || fileName == "cc"); - - const bool cxxCompiler = tcd.language == Constants::CXX_LANGUAGE_ID - && ((fileName.startsWith("g++") || fileName.endsWith("g++")) - || (fileName.startsWith("c++") || fileName.endsWith("c++"))); - - if (cCompiler || cxxCompiler) { - result += autoDetectToolChain(tcd, GccToolChain::MinGW, [](const ToolChain *tc) { - return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; - }); - } - - // Clang - bool isCCompiler = tcd.language == Constants::C_LANGUAGE_ID && ((fileName.startsWith("clang") && !fileName.startsWith("clang++")) || (fileName == "cc" && resolvedSymlinksFileName.contains("clang"))); @@ -1492,11 +1466,8 @@ Toolchains GccToolChainFactory::detectForImport(const ToolChainDescription &tcd) || fileName.endsWith("g++") || (fileName == "c++" && !resolvedSymlinksFileName.contains("clang"))); - if (isCCompiler || isCxxCompiler) { - result += autoDetectToolChain(tcd, GccToolChain::RealGcc, [](const ToolChain *tc) { - return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor; - }); - } + if (isCCompiler || isCxxCompiler) + result += autoDetectToolChain(tcd, GccToolChain::RealGcc); return result; } @@ -1521,20 +1492,6 @@ Toolchains GccToolChainFactory::autoDetectToolchains(const FilePaths &compilerPa const Toolchains &known, const GccToolChain::SubType subType) { - ToolchainChecker checker; - - if (subType == GccToolChain::MinGW) { - checker = [](const ToolChain *tc) { - return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor; - }; - } else if (subType == GccToolChain::RealGcc) { - checker = [](const ToolChain *tc) { - return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor - && tc->compilerCommand().fileName() != "c89-gcc" - && tc->compilerCommand().fileName() != "c99-gcc"; - }; - } - Toolchains existingCandidates = filtered(known, [language](const ToolChain *tc) { return tc->language() == language; }); @@ -1561,21 +1518,17 @@ Toolchains GccToolChainFactory::autoDetectToolchains(const FilePaths &compilerPa && HostOsInfo::isWindowsHost() && !existingCommand.needsDevice() && !compilerPath.needsDevice()) { - existingTcMatches = existingCommand.fileSize() - == compilerPath.fileSize(); + existingTcMatches = existingCommand.fileSize() == compilerPath.fileSize(); } } if (existingTcMatches) { - if (existingTc->typeId() == requiredTypeId && (!checker || checker(existingTc)) - && !result.contains(existingTc)) { + if (existingTc->typeId() == requiredTypeId && !result.contains(existingTc)) result << existingTc; - } alreadyExists = true; } } if (!alreadyExists) { - const Toolchains newToolchains - = autoDetectToolChain({compilerPath, language}, subType, checker); + const Toolchains newToolchains = autoDetectToolChain({compilerPath, language}, subType); result << newToolchains; existingCandidates << newToolchains; } @@ -1585,8 +1538,7 @@ Toolchains GccToolChainFactory::autoDetectToolchains(const FilePaths &compilerPa } Toolchains GccToolChainFactory::autoDetectToolChain(const ToolChainDescription &tcd, - const GccToolChain::SubType subType, - const ToolchainChecker &checker) + GccToolChain::SubType subType) { Toolchains result; @@ -1606,7 +1558,11 @@ Toolchains GccToolChainFactory::autoDetectToolChain(const ToolChainDescription & systemEnvironment, macros); for (const Abi &abi : detectedAbis.supportedAbis) { - std::unique_ptr<GccToolChain> tc(new GccToolChain({}, subType)); + GccToolChain::SubType detectedSubType = subType; + if (detectedSubType == GccToolChain::RealGcc && abi.osFlavor() == Abi::WindowsMSysFlavor) + detectedSubType = GccToolChain::MinGW; + + auto tc = new GccToolChain({}, detectedSubType); tc->setLanguage(tcd.language); tc->setDetection(ToolChain::AutoDetection); @@ -1619,8 +1575,7 @@ Toolchains GccToolChainFactory::autoDetectToolChain(const ToolChainDescription & tc->setTargetAbi(abi); tc->setOriginalTargetTriple(detectedAbis.originalTargetTriple); tc->setDisplayName(tc->defaultDisplayName()); // reset displayname - if (!checker || checker(tc.get())) - result.append(tc.release()); + result.append(tc); } return result; } diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 4c26fd7f2dc..207d93f5bd8 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -187,15 +187,13 @@ public: Toolchains detectForImport(const ToolChainDescription &tcd) const final; private: - using ToolchainChecker = std::function<bool(const ToolChain *)>; static Toolchains autoDetectToolchains(const Utils::FilePaths &compilerPaths, const Utils::Id language, const Utils::Id requiredTypeId, const Toolchains &known, const GccToolChain::SubType subType); static Toolchains autoDetectToolChain(const ToolChainDescription &tcd, - const GccToolChain::SubType subType, - const ToolchainChecker &checker = {}); + const GccToolChain::SubType subType); static Toolchains autoDetectSdkClangToolchain(const Toolchains &known); const bool m_autoDetecting; From 51a650f30b0d75129b3eb77ed7b7d38a07cf810e Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 3 Oct 2023 10:59:31 +0200 Subject: [PATCH 1402/1777] ClangTools: Fix clang-tidy documentationUrl for version 17.0.0 Change-Id: I6fd71fd5a390316a5c523865b6b1e866d8450e2e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/clangtools/clangtoolsutils.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/plugins/clangtools/clangtoolsutils.cpp b/src/plugins/clangtools/clangtoolsutils.cpp index 5b4eb702c91..1ad142fd459 100644 --- a/src/plugins/clangtools/clangtoolsutils.cpp +++ b/src/plugins/clangtools/clangtoolsutils.cpp @@ -307,12 +307,25 @@ QStringList extraClangToolsAppendOptions() return options; } +static QVersionNumber fixupVersion(const VersionAndSuffix &versionAndSuffix) +{ + // llvm.org only does document releases for the first released version + QVersionNumber version = QVersionNumber(versionAndSuffix.first.majorVersion(), 0, 0); + + if (version == QVersionNumber(0)) + version = QVersionNumber(12); + + // Version 17.0.0 was never released due to a git issue + if (version == QVersionNumber(17)) + version = QVersionNumber(17, 0, 1); + + return version; +} + QString clangTidyDocUrl(const QString &check) { VersionAndSuffix version = ClangToolsSettings::clangTidyVersion(); - version.first = QVersionNumber(version.first.majorVersion(), 0, 0); - if (version.first == QVersionNumber(0)) - version.first = QVersionNumber(12); + version.first = fixupVersion(version); static const char versionedUrlPrefix[] = "https://releases.llvm.org/%1/tools/clang/tools/extra/docs/"; static const char unversionedUrlPrefix[] = "https://clang.llvm.org/extra/"; From fc93f7d1b71c93b573660c7b59cb5b748ec4fc51 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Mon, 2 Oct 2023 21:07:24 +0200 Subject: [PATCH 1403/1777] ProjectExplorer: Move cmake icon from Vcpkg to ProjectExplorer Other plugins that depend on ProjectExplorer will use it, for example CMakeProjectManager. Change-Id: Ic5cb0ecac4e06ad04da7590f7759bf1ccdd59b3a Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../{vcpkg => projectexplorer}/images/cmakeicon.png | Bin .../images/cmakeicon@2x.png | Bin src/plugins/projectexplorer/projectexplorer.qrc | 2 ++ .../projectexplorer/projectexplorericons.cpp | 4 ++++ src/plugins/projectexplorer/projectexplorericons.h | 2 ++ src/plugins/vcpkg/vcpkg.qrc | 2 -- src/plugins/vcpkg/vcpkgmanifesteditor.cpp | 5 +++-- src/tools/icons/qtcreatoricons.svg | 2 +- 8 files changed, 12 insertions(+), 5 deletions(-) rename src/plugins/{vcpkg => projectexplorer}/images/cmakeicon.png (100%) rename src/plugins/{vcpkg => projectexplorer}/images/cmakeicon@2x.png (100%) diff --git a/src/plugins/vcpkg/images/cmakeicon.png b/src/plugins/projectexplorer/images/cmakeicon.png similarity index 100% rename from src/plugins/vcpkg/images/cmakeicon.png rename to src/plugins/projectexplorer/images/cmakeicon.png diff --git a/src/plugins/vcpkg/images/cmakeicon@2x.png b/src/plugins/projectexplorer/images/cmakeicon@2x.png similarity index 100% rename from src/plugins/vcpkg/images/cmakeicon@2x.png rename to src/plugins/projectexplorer/images/cmakeicon@2x.png diff --git a/src/plugins/projectexplorer/projectexplorer.qrc b/src/plugins/projectexplorer/projectexplorer.qrc index f40c1b8d5bf..0926397f423 100644 --- a/src/plugins/projectexplorer/projectexplorer.qrc +++ b/src/plugins/projectexplorer/projectexplorer.qrc @@ -70,6 +70,8 @@ <file>images/fileoverlay_unknown@2x.png</file> <file>images/cancelbuild_overlay.png</file> <file>images/cancelbuild_overlay@2x.png</file> + <file>images/cmakeicon.png</file> + <file>images/cmakeicon@2x.png</file> <file>images/settingscategory_buildrun.png</file> <file>images/settingscategory_buildrun@2x.png</file> <file>images/settingscategory_devices.png</file> diff --git a/src/plugins/projectexplorer/projectexplorericons.cpp b/src/plugins/projectexplorer/projectexplorericons.cpp index 9d1dd991a49..2a61f5bb2f8 100644 --- a/src/plugins/projectexplorer/projectexplorericons.cpp +++ b/src/plugins/projectexplorer/projectexplorericons.cpp @@ -44,6 +44,10 @@ const Icon DEVICE_DISCONNECTED_INDICATOR_OVERLAY({ {":/projectexplorer/images/devicestatusindicator.png", Theme::IconsStopToolBarColor}}); const Icon WIZARD_IMPORT_AS_PROJECT({ {":/projectexplorer/images/importasproject.png", Theme::PanelTextColorDark}}, Icon::Tint); +const Icon CMAKE_LOGO({ + {":/projectexplorer/images/cmakeicon.png", Theme::PanelTextColorMid}}, Icon::Tint); +const Icon CMAKE_LOGO_TOOLBAR({ + {":/projectexplorer/images/cmakeicon.png", Theme::IconsBaseColor}}); const Icon DEBUG_START_FLAT({ {":/projectexplorer/images/run_mask.png", Theme::IconsRunToolBarColor}, diff --git a/src/plugins/projectexplorer/projectexplorericons.h b/src/plugins/projectexplorer/projectexplorericons.h index 112b5a967b0..fbd46c8cc68 100644 --- a/src/plugins/projectexplorer/projectexplorericons.h +++ b/src/plugins/projectexplorer/projectexplorericons.h @@ -26,6 +26,8 @@ PROJECTEXPLORER_EXPORT extern const Utils::Icon DEVICE_CONNECTED_INDICATOR_OVERL PROJECTEXPLORER_EXPORT extern const Utils::Icon DEVICE_DISCONNECTED_INDICATOR; PROJECTEXPLORER_EXPORT extern const Utils::Icon DEVICE_DISCONNECTED_INDICATOR_OVERLAY; PROJECTEXPLORER_EXPORT extern const Utils::Icon WIZARD_IMPORT_AS_PROJECT; +PROJECTEXPLORER_EXPORT extern const Utils::Icon CMAKE_LOGO; +PROJECTEXPLORER_EXPORT extern const Utils::Icon CMAKE_LOGO_TOOLBAR; PROJECTEXPLORER_EXPORT extern const Utils::Icon DEBUG_START_FLAT; PROJECTEXPLORER_EXPORT extern const Utils::Icon DEBUG_START_SMALL; diff --git a/src/plugins/vcpkg/vcpkg.qrc b/src/plugins/vcpkg/vcpkg.qrc index ed7019bdc84..e01340cab4d 100644 --- a/src/plugins/vcpkg/vcpkg.qrc +++ b/src/plugins/vcpkg/vcpkg.qrc @@ -2,8 +2,6 @@ <qresource prefix="/vcpkg"> <file>wizards/manifest/vcpkg.json.tpl</file> <file>wizards/manifest/wizard.json</file> - <file>images/cmakeicon.png</file> - <file>images/cmakeicon@2x.png</file> <file>images/vcpkgicon.png</file> <file>images/vcpkgicon@2x.png</file> </qresource> diff --git a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp index e2d3ab66554..94774ab7183 100644 --- a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp +++ b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp @@ -15,6 +15,8 @@ #include <utils/stringutils.h> #include <utils/utilsicons.h> +#include <projectexplorer/projectexplorericons.h> + #include <texteditor/fontsettings.h> #include <texteditor/textdocument.h> #include <texteditor/texteditorsettings.h> @@ -108,8 +110,7 @@ public: } }); - const QIcon cmakeIcon = Utils::Icon({{":/vcpkg/images/cmakeicon.png", - Utils::Theme::IconsBaseColor}}).icon(); + const QIcon cmakeIcon = ProjectExplorer::Icons::CMAKE_LOGO_TOOLBAR.icon(); m_cmakeCodeAction = toolBar()->addAction(cmakeIcon, Tr::tr("CMake code...")); connect(m_cmakeCodeAction, &QAction::triggered, this, [this] { CMakeCodeDialog dlg(documentToManifest().dependencies); diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg index e1154577f7b..60accd46bb6 100644 --- a/src/tools/icons/qtcreatoricons.svg +++ b/src/tools/icons/qtcreatoricons.svg @@ -3665,7 +3665,7 @@ sodipodi:nodetypes="cczczcc" /> </g> <g - id="src/plugins/vcpkg/images/cmakeicon" + id="src/plugins/projectexplorer/images/cmakeicon" transform="translate(862,88.5)" style="display:inline"> <use From 43f770b08778739f45fb2e25aec564acd3114669 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 28 Sep 2023 16:07:17 +0200 Subject: [PATCH 1404/1777] Terminal: Pull upstream shellintegration scripts Change-Id: Ic0fed1a56ec635351716dca1e410050990d2dd98 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../shellintegration-bash.sh | 43 +++++++- .../shellintegrations/shellintegration-rc.zsh | 33 ++++++- .../shellintegrations/shellintegration.fish | 99 +++++++++++++++---- .../shellintegrations/shellintegration.ps1 | 39 +++++++- 4 files changed, 185 insertions(+), 29 deletions(-) diff --git a/src/plugins/terminal/shellintegrations/shellintegration-bash.sh b/src/plugins/terminal/shellintegrations/shellintegration-bash.sh index 7db188be08e..d9792f34baa 100755 --- a/src/plugins/terminal/shellintegrations/shellintegration-bash.sh +++ b/src/plugins/terminal/shellintegrations/shellintegration-bash.sh @@ -3,7 +3,7 @@ # Prevent the script recursing when setting up -if [[ -n "$VSCODE_SHELL_INTEGRATION" ]]; then +if [[ -n "${VSCODE_SHELL_INTEGRATION:-}" ]]; then builtin return fi @@ -32,7 +32,7 @@ if [ "$VSCODE_INJECTION" == "1" ]; then builtin unset VSCODE_SHELL_LOGIN # Apply any explicit path prefix (see #99878) - if [ -n "$VSCODE_PATH_PREFIX" ]; then + if [ -n "${VSCODE_PATH_PREFIX:-}" ]; then export PATH=$VSCODE_PATH_PREFIX$PATH builtin unset VSCODE_PATH_PREFIX fi @@ -44,6 +44,35 @@ if [ -z "$VSCODE_SHELL_INTEGRATION" ]; then builtin return fi +# Apply EnvironmentVariableCollections if needed +if [ -n "${VSCODE_ENV_REPLACE:-}" ]; then + IFS=':' read -ra ADDR <<< "$VSCODE_ENV_REPLACE" + for ITEM in "${ADDR[@]}"; do + VARNAME="$(echo $ITEM | cut -d "=" -f 1)" + VALUE="$(echo -e "$ITEM" | cut -d "=" -f 2)" + export $VARNAME="$VALUE" + done + builtin unset VSCODE_ENV_REPLACE +fi +if [ -n "${VSCODE_ENV_PREPEND:-}" ]; then + IFS=':' read -ra ADDR <<< "$VSCODE_ENV_PREPEND" + for ITEM in "${ADDR[@]}"; do + VARNAME="$(echo $ITEM | cut -d "=" -f 1)" + VALUE="$(echo -e "$ITEM" | cut -d "=" -f 2)" + export $VARNAME="$VALUE${!VARNAME}" + done + builtin unset VSCODE_ENV_PREPEND +fi +if [ -n "${VSCODE_ENV_APPEND:-}" ]; then + IFS=':' read -ra ADDR <<< "$VSCODE_ENV_APPEND" + for ITEM in "${ADDR[@]}"; do + VARNAME="$(echo $ITEM | cut -d "=" -f 1)" + VALUE="$(echo -e "$ITEM" | cut -d "=" -f 2)" + export $VARNAME="${!VARNAME}$VALUE" + done + builtin unset VSCODE_ENV_APPEND +fi + __vsc_get_trap() { # 'trap -p DEBUG' outputs a shell command like `trap -- '…shellcode…' DEBUG`. # The terms are quoted literals, but are not guaranteed to be on a single line. @@ -110,6 +139,10 @@ __vsc_custom_PS2="" __vsc_in_command_execution="1" __vsc_current_command="" +# It's fine this is in the global scope as it getting at it requires access to the shell environment +__vsc_nonce="$VSCODE_NONCE" +unset VSCODE_NONCE + __vsc_prompt_start() { builtin printf '\e]633;A\a' } @@ -124,7 +157,7 @@ __vsc_update_cwd() { __vsc_command_output_start() { builtin printf '\e]633;C\a' - builtin printf '\e]633;E;%s\a' "$(__vsc_escape_value "${__vsc_current_command}")" + builtin printf '\e]633;E;%s;%s\a' "$(__vsc_escape_value "${__vsc_current_command}")" $__vsc_nonce } __vsc_continuation_start() { @@ -241,10 +274,10 @@ __vsc_prompt_cmd() { # PROMPT_COMMAND arrays and strings seem to be handled the same (handling only the first entry of # the array?) -__vsc_original_prompt_command=$PROMPT_COMMAND +__vsc_original_prompt_command=${PROMPT_COMMAND:-} if [[ -z "${bash_preexec_imported:-}" ]]; then - if [[ -n "$__vsc_original_prompt_command" && "$__vsc_original_prompt_command" != "__vsc_prompt_cmd" ]]; then + if [[ -n "${__vsc_original_prompt_command:-}" && "${__vsc_original_prompt_command:-}" != "__vsc_prompt_cmd" ]]; then PROMPT_COMMAND=__vsc_prompt_cmd_original else PROMPT_COMMAND=__vsc_prompt_cmd diff --git a/src/plugins/terminal/shellintegrations/shellintegration-rc.zsh b/src/plugins/terminal/shellintegrations/shellintegration-rc.zsh index df4109131a9..119c85be9e0 100644 --- a/src/plugins/terminal/shellintegrations/shellintegration-rc.zsh +++ b/src/plugins/terminal/shellintegrations/shellintegration-rc.zsh @@ -37,6 +37,32 @@ if [ -z "$VSCODE_SHELL_INTEGRATION" ]; then builtin return fi +# Apply EnvironmentVariableCollections if needed +if [ -n "${VSCODE_ENV_REPLACE:-}" ]; then + IFS=':' read -rA ADDR <<< "$VSCODE_ENV_REPLACE" + for ITEM in "${ADDR[@]}"; do + VARNAME="$(echo ${ITEM%%=*})" + export $VARNAME="$(echo -e ${ITEM#*=})" + done + unset VSCODE_ENV_REPLACE +fi +if [ -n "${VSCODE_ENV_PREPEND:-}" ]; then + IFS=':' read -rA ADDR <<< "$VSCODE_ENV_PREPEND" + for ITEM in "${ADDR[@]}"; do + VARNAME="$(echo ${ITEM%%=*})" + export $VARNAME="$(echo -e ${ITEM#*=})${(P)VARNAME}" + done + unset VSCODE_ENV_PREPEND +fi +if [ -n "${VSCODE_ENV_APPEND:-}" ]; then + IFS=':' read -rA ADDR <<< "$VSCODE_ENV_APPEND" + for ITEM in "${ADDR[@]}"; do + VARNAME="$(echo ${ITEM%%=*})" + export $VARNAME="${(P)VARNAME}$(echo -e ${ITEM#*=})" + done + unset VSCODE_ENV_APPEND +fi + # The property (P) and command (E) codes embed values which require escaping. # Backslashes are doubled. Non-alphanumeric characters are converted to escaped hex. __vsc_escape_value() { @@ -66,6 +92,10 @@ __vsc_escape_value() { __vsc_in_command_execution="1" __vsc_current_command="" +# It's fine this is in the global scope as it getting at it requires access to the shell environment +__vsc_nonce="$VSCODE_NONCE" +unset VSCODE_NONCE + __vsc_prompt_start() { builtin printf '\e]633;A\a' } @@ -80,7 +110,7 @@ __vsc_update_cwd() { __vsc_command_output_start() { builtin printf '\e]633;C\a' - builtin printf '\e]633;E;%s\a' "${__vsc_current_command}" + builtin printf '\e]633;E;%s;%s\a' "$(__vsc_escape_value "${__vsc_current_command}")" $__vsc_nonce } __vsc_continuation_start() { @@ -149,6 +179,7 @@ __vsc_preexec() { RPROMPT="$__vsc_prior_rprompt" fi __vsc_in_command_execution="1" + # For some reason Qt Creator needs this to be $2 instead of $1 __vsc_current_command=$2 __vsc_command_output_start } diff --git a/src/plugins/terminal/shellintegrations/shellintegration.fish b/src/plugins/terminal/shellintegrations/shellintegration.fish index 7495bab3f40..21cc823c480 100644 --- a/src/plugins/terminal/shellintegrations/shellintegration.fish +++ b/src/plugins/terminal/shellintegrations/shellintegration.fish @@ -26,16 +26,48 @@ if status --is-login; and set -q VSCODE_PATH_PREFIX end set -e VSCODE_PATH_PREFIX +# Apply EnvironmentVariableCollections if needed +if test -n "$VSCODE_ENV_REPLACE" + set ITEMS (string split : $VSCODE_ENV_REPLACE) + for B in $ITEMS + set split (string split = $B) + set -gx "$split[1]" (echo -e "$split[2]") + end + set -e VSCODE_ENV_REPLACE +end +if test -n "$VSCODE_ENV_PREPEND" + set ITEMS (string split : $VSCODE_ENV_PREPEND) + for B in $ITEMS + set split (string split = $B) + set -gx "$split[1]" (echo -e "$split[2]")"$$split[1]" # avoid -p as it adds a space + end + set -e VSCODE_ENV_PREPEND +end +if test -n "$VSCODE_ENV_APPEND" + set ITEMS (string split : $VSCODE_ENV_APPEND) + for B in $ITEMS + set split (string split = $B) + set -gx "$split[1]" "$$split[1]"(echo -e "$split[2]") # avoid -a as it adds a space + end + set -e VSCODE_ENV_APPEND +end + +# Handle the shell integration nonce +if set -q VSCODE_NONCE + set -l __vsc_nonce $VSCODE_NONCE + set -e VSCODE_NONCE +end + # Helper function function __vsc_esc -d "Emit escape sequences for VS Code shell integration" - builtin printf "\e]633;%s\a" (string join ";" $argv) + builtin printf "\e]633;%s\a" (string join ";" -- $argv) end # Sent right before executing an interactive command. # Marks the beginning of command output. function __vsc_cmd_executed --on-event fish_preexec __vsc_esc C - __vsc_esc E (__vsc_escape_value "$argv") + __vsc_esc E (__vsc_escape_value "$argv") $__vsc_nonce # Creates a marker to indicate a command was run. set --global _vsc_has_cmd @@ -64,6 +96,31 @@ function __vsc_cmd_clear --on-event fish_cancel __vsc_esc D end +# Preserve the user's existing prompt, to wrap in our escape sequences. +function __preserve_fish_prompt --on-event fish_prompt + if functions --query fish_prompt + if functions --query __vsc_fish_prompt + # Erase the fallback so it can be set to the user's prompt + functions --erase __vsc_fish_prompt + end + functions --copy fish_prompt __vsc_fish_prompt + functions --erase __preserve_fish_prompt + # Now __vsc_fish_prompt is guaranteed to be defined + __init_vscode_shell_integration + else + if functions --query __vsc_fish_prompt + functions --erase __preserve_fish_prompt + __init_vscode_shell_integration + else + # There is no fish_prompt set, so stick with the default + # Now __vsc_fish_prompt is guaranteed to be defined + function __vsc_fish_prompt + echo -n (whoami)@(prompt_hostname) (prompt_pwd) '~> ' + end + end + end +end + # Sent whenever a new fish prompt is about to be displayed. # Updates the current working directory. function __vsc_update_cwd --on-event fish_prompt @@ -94,29 +151,29 @@ function __vsc_fish_has_mode_prompt -d "Returns true if fish_mode_prompt is defi functions fish_mode_prompt | string match -rvq '^ *(#|function |end$|$)' end -# Preserve the user's existing prompt, to wrap in our escape sequences. -functions --copy fish_prompt __vsc_fish_prompt - # Preserve and wrap fish_mode_prompt (which appears to the left of the regular # prompt), but only if it's not defined as an empty function (which is the # officially documented way to disable that feature). -if __vsc_fish_has_mode_prompt - functions --copy fish_mode_prompt __vsc_fish_mode_prompt +function __init_vscode_shell_integration + if __vsc_fish_has_mode_prompt + functions --copy fish_mode_prompt __vsc_fish_mode_prompt - function fish_mode_prompt - __vsc_fish_prompt_start - __vsc_fish_mode_prompt - end + function fish_mode_prompt + __vsc_fish_prompt_start + __vsc_fish_mode_prompt + __vsc_fish_cmd_start + end - function fish_prompt - __vsc_fish_prompt - __vsc_fish_cmd_start - end -else - # No fish_mode_prompt, so put everything in fish_prompt. - function fish_prompt - __vsc_fish_prompt_start - __vsc_fish_prompt - __vsc_fish_cmd_start + function fish_prompt + __vsc_fish_prompt + end + else + # No fish_mode_prompt, so put everything in fish_prompt. + function fish_prompt + __vsc_fish_prompt_start + __vsc_fish_prompt + __vsc_fish_cmd_start + end end end +__preserve_fish_prompt diff --git a/src/plugins/terminal/shellintegrations/shellintegration.ps1 b/src/plugins/terminal/shellintegrations/shellintegration.ps1 index 4fd978a8844..e277724b0a2 100644 --- a/src/plugins/terminal/shellintegrations/shellintegration.ps1 +++ b/src/plugins/terminal/shellintegrations/shellintegration.ps1 @@ -15,6 +15,35 @@ $Global:__VSCodeOriginalPrompt = $function:Prompt $Global:__LastHistoryId = -1 +# Store the nonce in script scope and unset the global +$Nonce = $env:VSCODE_NONCE +$env:VSCODE_NONCE = $null + +if ($env:VSCODE_ENV_REPLACE) { + $Split = $env:VSCODE_ENV_REPLACE.Split(":") + foreach ($Item in $Split) { + $Inner = $Item.Split('=') + [Environment]::SetEnvironmentVariable($Inner[0], $Inner[1].Replace('\x3a', ':')) + } + $env:VSCODE_ENV_REPLACE = $null +} +if ($env:VSCODE_ENV_PREPEND) { + $Split = $env:VSCODE_ENV_PREPEND.Split(":") + foreach ($Item in $Split) { + $Inner = $Item.Split('=') + [Environment]::SetEnvironmentVariable($Inner[0], $Inner[1].Replace('\x3a', ':') + [Environment]::GetEnvironmentVariable($Inner[0])) + } + $env:VSCODE_ENV_PREPEND = $null +} +if ($env:VSCODE_ENV_APPEND) { + $Split = $env:VSCODE_ENV_APPEND.Split(":") + foreach ($Item in $Split) { + $Inner = $Item.Split('=') + [Environment]::SetEnvironmentVariable($Inner[0], [Environment]::GetEnvironmentVariable($Inner[0]) + $Inner[1].Replace('\x3a', ':')) + } + $env:VSCODE_ENV_APPEND = $null +} + function Global:__VSCode-Escape-Value([string]$value) { # NOTE: In PowerShell v6.1+, this can be written `$value -replace '…', { … }` instead of `[regex]::Replace`. # Replace any non-alphanumeric characters. @@ -40,7 +69,7 @@ function Global:Prompt() { $Result += "$([char]0x1b)]633;D`a" } else { # Command finished command line - # OSC 633 ; A ; <CommandLine?> ST + # OSC 633 ; E ; <CommandLine?> ; <Nonce?> ST $Result = "$([char]0x1b)]633;E;" # Sanitize the command line to ensure it can get transferred to the terminal and can be parsed # correctly. This isn't entirely safe but good for most cases, it's important for the Pt parameter @@ -51,6 +80,7 @@ function Global:Prompt() { $CommandLine = "" } $Result += $(__VSCode-Escape-Value $CommandLine) + $Result += ";$Nonce" $Result += "`a" # Command finished exit code # OSC 633 ; D [; <ExitCode>] ST @@ -88,7 +118,12 @@ if (Get-Module -Name PSReadLine) { } # Set IsWindows property -[Console]::Write("$([char]0x1b)]633;P;IsWindows=$($IsWindows)`a") +if ($PSVersionTable.PSVersion -lt "6.0") { + # Windows PowerShell is only available on Windows + [Console]::Write("$([char]0x1b)]633;P;IsWindows=$true`a") +} else { + [Console]::Write("$([char]0x1b)]633;P;IsWindows=$IsWindows`a") +} # Set always on key handlers which map to default VS Code keybindings function Set-MappedKeyHandler { From 759535be1a9a01f3b91243a2356754a57b41c421 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Wed, 4 Oct 2023 11:00:01 +0200 Subject: [PATCH 1405/1777] ClangFormat: Regenerate clangformatchecks for clangformat 17 Fixes: QTCREATORBUG-29690 Change-Id: I9bbe0c531087824fc160bae210c8444b3ac67ba5 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/clangformat/clangformatchecks.cpp | 111 ++++++++++++------ src/plugins/clangformat/clangformatchecks.h | 27 +++-- .../clangformat/clangformatconfigwidget.cpp | 2 +- 3 files changed, 97 insertions(+), 43 deletions(-) diff --git a/src/plugins/clangformat/clangformatchecks.cpp b/src/plugins/clangformat/clangformatchecks.cpp index 4cb200871c9..41bd75caa22 100644 --- a/src/plugins/clangformat/clangformatchecks.cpp +++ b/src/plugins/clangformat/clangformatchecks.cpp @@ -1,7 +1,7 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT! +// THIS FILE IS AUTOMATICALLY GENERATED by generateClangFormatChecksLayout. DO NOT EDIT! #include "clangformatchecks.h" @@ -121,6 +121,22 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_AlignConsecutiveDeclarationsPadOperators->addItems({"Default","true","false",}); m_AlignConsecutiveDeclarationsPadOperators->setObjectName("AlignConsecutiveDeclarationsPadOperators"); + m_AlignConsecutiveShortCaseStatementsEnabled = new QComboBox(this); + m_AlignConsecutiveShortCaseStatementsEnabled->addItems({"Default","true","false",}); + m_AlignConsecutiveShortCaseStatementsEnabled->setObjectName("AlignConsecutiveShortCaseStatementsEnabled"); + + m_AlignConsecutiveShortCaseStatementsAcrossEmptyLines = new QComboBox(this); + m_AlignConsecutiveShortCaseStatementsAcrossEmptyLines->addItems({"Default","true","false",}); + m_AlignConsecutiveShortCaseStatementsAcrossEmptyLines->setObjectName("AlignConsecutiveShortCaseStatementsAcrossEmptyLines"); + + m_AlignConsecutiveShortCaseStatementsAcrossComments = new QComboBox(this); + m_AlignConsecutiveShortCaseStatementsAcrossComments->addItems({"Default","true","false",}); + m_AlignConsecutiveShortCaseStatementsAcrossComments->setObjectName("AlignConsecutiveShortCaseStatementsAcrossComments"); + + m_AlignConsecutiveShortCaseStatementsAlignCaseColons = new QComboBox(this); + m_AlignConsecutiveShortCaseStatementsAlignCaseColons->addItems({"Default","true","false",}); + m_AlignConsecutiveShortCaseStatementsAlignCaseColons->setObjectName("AlignConsecutiveShortCaseStatementsAlignCaseColons"); + m_AlignEscapedNewlines = new QComboBox(this); m_AlignEscapedNewlines->addItems({"DontAlign","Left","Right",}); m_AlignEscapedNewlines->setObjectName("AlignEscapedNewlines"); @@ -434,6 +450,10 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_JavaScriptWrapImports->addItems({"Default","true","false",}); m_JavaScriptWrapImports->setObjectName("JavaScriptWrapImports"); + m_KeepEmptyLinesAtEOF = new QComboBox(this); + m_KeepEmptyLinesAtEOF->addItems({"Default","true","false",}); + m_KeepEmptyLinesAtEOF->setObjectName("KeepEmptyLinesAtEOF"); + m_KeepEmptyLinesAtTheStartOfBlocks = new QComboBox(this); m_KeepEmptyLinesAtTheStartOfBlocks->addItems({"Default","true","false",}); m_KeepEmptyLinesAtTheStartOfBlocks->setObjectName("KeepEmptyLinesAtTheStartOfBlocks"); @@ -460,6 +480,12 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_setMacroBlockEnd = new QPushButton("Set", this); m_setMacroBlockEnd->setObjectName("setMacroBlockEnd"); + m_Macros = new QPlainTextEdit(this); + m_Macros->setObjectName("Macros"); + m_Macros->setFixedHeight(100); + m_setMacros = new QPushButton("Set", this); + + m_setMacros->setObjectName("setMacros"); m_MaxEmptyLinesToKeep = new QLineEdit(this); m_MaxEmptyLinesToKeep->setObjectName("MaxEmptyLinesToKeep"); m_setMaxEmptyLinesToKeep = new QPushButton("Set", this); @@ -497,7 +523,7 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_ObjCSpaceBeforeProtocolList->setObjectName("ObjCSpaceBeforeProtocolList"); m_PackConstructorInitializers = new QComboBox(this); - m_PackConstructorInitializers->addItems({"Never","BinPack","CurrentLine","NextLine",}); + m_PackConstructorInitializers->addItems({"Never","BinPack","CurrentLine","NextLine","NextLineOnly",}); m_PackConstructorInitializers->setObjectName("PackConstructorInitializers"); m_PenaltyBreakAssignment = new QLineEdit(this); @@ -581,6 +607,10 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_RemoveBracesLLVM->addItems({"Default","true","false",}); m_RemoveBracesLLVM->setObjectName("RemoveBracesLLVM"); + m_RemoveParentheses = new QComboBox(this); + m_RemoveParentheses->addItems({"Leave","MultipleParentheses","ReturnStatement",}); + m_RemoveParentheses->setObjectName("RemoveParentheses"); + m_RemoveSemicolon = new QComboBox(this); m_RemoveSemicolon->addItems({"Default","true","false",}); m_RemoveSemicolon->setObjectName("RemoveSemicolon"); @@ -650,6 +680,10 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_SpaceBeforeInheritanceColon->addItems({"Default","true","false",}); m_SpaceBeforeInheritanceColon->setObjectName("SpaceBeforeInheritanceColon"); + m_SpaceBeforeJsonColon = new QComboBox(this); + m_SpaceBeforeJsonColon->addItems({"Default","true","false",}); + m_SpaceBeforeJsonColon->setObjectName("SpaceBeforeJsonColon"); + m_SpaceBeforeParens = new QComboBox(this); m_SpaceBeforeParens->addItems({"Never","ControlStatements","ControlStatementsExceptControlMacros","NonEmptyParentheses","Always","Custom",}); m_SpaceBeforeParens->setObjectName("SpaceBeforeParens"); @@ -702,31 +736,10 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_SpaceInEmptyBlock->addItems({"Default","true","false",}); m_SpaceInEmptyBlock->setObjectName("SpaceInEmptyBlock"); - m_SpaceInEmptyParentheses = new QComboBox(this); - m_SpaceInEmptyParentheses->addItems({"Default","true","false",}); - m_SpaceInEmptyParentheses->setObjectName("SpaceInEmptyParentheses"); - - m_SpacesBeforeTrailingComments = new QLineEdit(this); - m_SpacesBeforeTrailingComments->setObjectName("SpacesBeforeTrailingComments"); - m_setSpacesBeforeTrailingComments = new QPushButton("Set", this); - - m_setSpacesBeforeTrailingComments->setObjectName("setSpacesBeforeTrailingComments"); m_SpacesInAngles = new QComboBox(this); m_SpacesInAngles->addItems({"Never","Always","Leave",}); m_SpacesInAngles->setObjectName("SpacesInAngles"); - m_SpacesInConditionalStatement = new QComboBox(this); - m_SpacesInConditionalStatement->addItems({"Default","true","false",}); - m_SpacesInConditionalStatement->setObjectName("SpacesInConditionalStatement"); - - m_SpacesInContainerLiterals = new QComboBox(this); - m_SpacesInContainerLiterals->addItems({"Default","true","false",}); - m_SpacesInContainerLiterals->setObjectName("SpacesInContainerLiterals"); - - m_SpacesInCStyleCastParentheses = new QComboBox(this); - m_SpacesInCStyleCastParentheses->addItems({"Default","true","false",}); - m_SpacesInCStyleCastParentheses->setObjectName("SpacesInCStyleCastParentheses"); - m_SpacesInLineCommentPrefixMinimum = new QLineEdit(this); m_SpacesInLineCommentPrefixMinimum->setObjectName("SpacesInLineCommentPrefixMinimum"); m_setSpacesInLineCommentPrefixMinimum = new QPushButton("Set", this); @@ -737,9 +750,21 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_setSpacesInLineCommentPrefixMaximum = new QPushButton("Set", this); m_setSpacesInLineCommentPrefixMaximum->setObjectName("setSpacesInLineCommentPrefixMaximum"); - m_SpacesInParentheses = new QComboBox(this); - m_SpacesInParentheses->addItems({"Default","true","false",}); - m_SpacesInParentheses->setObjectName("SpacesInParentheses"); + m_SpacesInParensOptionsInConditionalStatements = new QComboBox(this); + m_SpacesInParensOptionsInConditionalStatements->addItems({"Default","true","false",}); + m_SpacesInParensOptionsInConditionalStatements->setObjectName("SpacesInParensOptionsInConditionalStatements"); + + m_SpacesInParensOptionsInCStyleCasts = new QComboBox(this); + m_SpacesInParensOptionsInCStyleCasts->addItems({"Default","true","false",}); + m_SpacesInParensOptionsInCStyleCasts->setObjectName("SpacesInParensOptionsInCStyleCasts"); + + m_SpacesInParensOptionsInEmptyParentheses = new QComboBox(this); + m_SpacesInParensOptionsInEmptyParentheses->addItems({"Default","true","false",}); + m_SpacesInParensOptionsInEmptyParentheses->setObjectName("SpacesInParensOptionsInEmptyParentheses"); + + m_SpacesInParensOptionsOther = new QComboBox(this); + m_SpacesInParensOptionsOther->addItems({"Default","true","false",}); + m_SpacesInParensOptionsOther->setObjectName("SpacesInParensOptionsOther"); m_SpacesInSquareBrackets = new QComboBox(this); m_SpacesInSquareBrackets->addItems({"Default","true","false",}); @@ -766,6 +791,12 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_setTabWidth = new QPushButton("Set", this); m_setTabWidth->setObjectName("setTabWidth"); + m_TypeNames = new QPlainTextEdit(this); + m_TypeNames->setObjectName("TypeNames"); + m_TypeNames->setFixedHeight(100); + m_setTypeNames = new QPushButton("Set", this); + + m_setTypeNames->setObjectName("setTypeNames"); m_TypenameMacros = new QPlainTextEdit(this); m_TypenameMacros->setObjectName("TypenameMacros"); m_TypenameMacros->setFixedHeight(100); @@ -776,6 +807,10 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) m_UseTab->addItems({"Never","ForIndentation","ForContinuationAndIndentation","AlignWithSpaces","Always",}); m_UseTab->setObjectName("UseTab"); + m_VerilogBreakBetweenInstancePorts = new QComboBox(this); + m_VerilogBreakBetweenInstancePorts->addItems({"Default","true","false",}); + m_VerilogBreakBetweenInstancePorts->setObjectName("VerilogBreakBetweenInstancePorts"); + m_WhitespaceSensitiveMacros = new QPlainTextEdit(this); m_WhitespaceSensitiveMacros->setObjectName("WhitespaceSensitiveMacros"); m_WhitespaceSensitiveMacros->setFixedHeight(100); @@ -815,6 +850,11 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) new QLabel(" AcrossComments"), m_AlignConsecutiveDeclarationsAcrossComments, br, new QLabel(" AlignCompound"), m_AlignConsecutiveDeclarationsAlignCompound, br, new QLabel(" PadOperators"), m_AlignConsecutiveDeclarationsPadOperators, br, + new QLabel("AlignConsecutiveShortCaseStatements"), br, + new QLabel(" Enabled"), m_AlignConsecutiveShortCaseStatementsEnabled, br, + new QLabel(" AcrossEmptyLines"), m_AlignConsecutiveShortCaseStatementsAcrossEmptyLines, br, + new QLabel(" AcrossComments"), m_AlignConsecutiveShortCaseStatementsAcrossComments, br, + new QLabel(" AlignCaseColons"), m_AlignConsecutiveShortCaseStatementsAlignCaseColons, br, new QLabel("AlignEscapedNewlines"), m_AlignEscapedNewlines, br, new QLabel("AlignOperands"), m_AlignOperands, br, new QLabel("AlignTrailingComments"), br, @@ -893,12 +933,14 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) new QLabel("JavaImportGroups"), Row {m_JavaImportGroups, m_setJavaImportGroups}, br, new QLabel("JavaScriptQuotes"), m_JavaScriptQuotes, br, new QLabel("JavaScriptWrapImports"), m_JavaScriptWrapImports, br, + new QLabel("KeepEmptyLinesAtEOF"), m_KeepEmptyLinesAtEOF, br, new QLabel("KeepEmptyLinesAtTheStartOfBlocks"), m_KeepEmptyLinesAtTheStartOfBlocks, br, new QLabel("LambdaBodyIndentation"), m_LambdaBodyIndentation, br, new QLabel("Language"), m_Language, br, new QLabel("LineEnding"), m_LineEnding, br, new QLabel("MacroBlockBegin"), Row {m_MacroBlockBegin, m_setMacroBlockBegin}, br, new QLabel("MacroBlockEnd"), Row {m_MacroBlockEnd, m_setMacroBlockEnd}, br, + new QLabel("Macros"), Row {m_Macros, m_setMacros}, br, new QLabel("MaxEmptyLinesToKeep"), Row {m_MaxEmptyLinesToKeep, m_setMaxEmptyLinesToKeep}, br, new QLabel("NamespaceIndentation"), m_NamespaceIndentation, br, new QLabel("NamespaceMacros"), Row {m_NamespaceMacros, m_setNamespaceMacros}, br, @@ -925,6 +967,7 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) new QLabel("ReferenceAlignment"), m_ReferenceAlignment, br, new QLabel("ReflowComments"), m_ReflowComments, br, new QLabel("RemoveBracesLLVM"), m_RemoveBracesLLVM, br, + new QLabel("RemoveParentheses"), m_RemoveParentheses, br, new QLabel("RemoveSemicolon"), m_RemoveSemicolon, br, new QLabel("RequiresClausePosition"), m_RequiresClausePosition, br, new QLabel("RequiresExpressionIndentation"), m_RequiresExpressionIndentation, br, @@ -942,6 +985,7 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) new QLabel("SpaceBeforeCpp11BracedList"), m_SpaceBeforeCpp11BracedList, br, new QLabel("SpaceBeforeCtorInitializerColon"), m_SpaceBeforeCtorInitializerColon, br, new QLabel("SpaceBeforeInheritanceColon"), m_SpaceBeforeInheritanceColon, br, + new QLabel("SpaceBeforeJsonColon"), m_SpaceBeforeJsonColon, br, new QLabel("SpaceBeforeParens"), m_SpaceBeforeParens, br, new QLabel("SpaceBeforeParensOptions"), br, new QLabel(" AfterControlStatements"), m_SpaceBeforeParensOptionsAfterControlStatements, br, @@ -956,23 +1000,24 @@ ClangFormatChecks::ClangFormatChecks(QWidget *parent) new QLabel("SpaceBeforeSquareBrackets"), m_SpaceBeforeSquareBrackets, br, new QLabel("SpaceBeforeRangeBasedForLoopColon"), m_SpaceBeforeRangeBasedForLoopColon, br, new QLabel("SpaceInEmptyBlock"), m_SpaceInEmptyBlock, br, - new QLabel("SpaceInEmptyParentheses"), m_SpaceInEmptyParentheses, br, - new QLabel("SpacesBeforeTrailingComments"), Row {m_SpacesBeforeTrailingComments, m_setSpacesBeforeTrailingComments}, br, new QLabel("SpacesInAngles"), m_SpacesInAngles, br, - new QLabel("SpacesInConditionalStatement"), m_SpacesInConditionalStatement, br, - new QLabel("SpacesInContainerLiterals"), m_SpacesInContainerLiterals, br, - new QLabel("SpacesInCStyleCastParentheses"), m_SpacesInCStyleCastParentheses, br, new QLabel("SpacesInLineCommentPrefix"), br, new QLabel(" Minimum"), Row {m_SpacesInLineCommentPrefixMinimum, m_setSpacesInLineCommentPrefixMinimum}, br, new QLabel(" Maximum"), Row {m_SpacesInLineCommentPrefixMaximum, m_setSpacesInLineCommentPrefixMaximum}, br, - new QLabel("SpacesInParentheses"), m_SpacesInParentheses, br, + new QLabel("SpacesInParensOptions"), br, + new QLabel(" InConditionalStatements"), m_SpacesInParensOptionsInConditionalStatements, br, + new QLabel(" InCStyleCasts"), m_SpacesInParensOptionsInCStyleCasts, br, + new QLabel(" InEmptyParentheses"), m_SpacesInParensOptionsInEmptyParentheses, br, + new QLabel(" Other"), m_SpacesInParensOptionsOther, br, new QLabel("SpacesInSquareBrackets"), m_SpacesInSquareBrackets, br, new QLabel("Standard"), m_Standard, br, new QLabel("StatementAttributeLikeMacros"), Row {m_StatementAttributeLikeMacros, m_setStatementAttributeLikeMacros}, br, new QLabel("StatementMacros"), Row {m_StatementMacros, m_setStatementMacros}, br, new QLabel("TabWidth"), Row {m_TabWidth, m_setTabWidth}, br, + new QLabel("TypeNames"), Row {m_TypeNames, m_setTypeNames}, br, new QLabel("TypenameMacros"), Row {m_TypenameMacros, m_setTypenameMacros}, br, new QLabel("UseTab"), m_UseTab, br, + new QLabel("VerilogBreakBetweenInstancePorts"), m_VerilogBreakBetweenInstancePorts, br, new QLabel("WhitespaceSensitiveMacros"), Row {m_WhitespaceSensitiveMacros, m_setWhitespaceSensitiveMacros}, br, }.attachTo(this); } diff --git a/src/plugins/clangformat/clangformatchecks.h b/src/plugins/clangformat/clangformatchecks.h index 1c72aac1bee..b0f8a8d8623 100644 --- a/src/plugins/clangformat/clangformatchecks.h +++ b/src/plugins/clangformat/clangformatchecks.h @@ -1,7 +1,7 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT! +// THIS FILE IS AUTOMATICALLY GENERATED by generateClangFormatChecksLayout. DO NOT EDIT! #pragma once @@ -52,6 +52,10 @@ private: QComboBox *m_AlignConsecutiveDeclarationsAcrossComments = nullptr; QComboBox *m_AlignConsecutiveDeclarationsAlignCompound = nullptr; QComboBox *m_AlignConsecutiveDeclarationsPadOperators = nullptr; + QComboBox *m_AlignConsecutiveShortCaseStatementsEnabled = nullptr; + QComboBox *m_AlignConsecutiveShortCaseStatementsAcrossEmptyLines = nullptr; + QComboBox *m_AlignConsecutiveShortCaseStatementsAcrossComments = nullptr; + QComboBox *m_AlignConsecutiveShortCaseStatementsAlignCaseColons = nullptr; QComboBox *m_AlignEscapedNewlines = nullptr; QComboBox *m_AlignOperands = nullptr; QComboBox *m_AlignTrailingCommentsKind = nullptr; @@ -136,6 +140,7 @@ private: QPushButton *m_setJavaImportGroups = nullptr; QComboBox *m_JavaScriptQuotes = nullptr; QComboBox *m_JavaScriptWrapImports = nullptr; + QComboBox *m_KeepEmptyLinesAtEOF = nullptr; QComboBox *m_KeepEmptyLinesAtTheStartOfBlocks = nullptr; QComboBox *m_LambdaBodyIndentation = nullptr; QComboBox *m_Language = nullptr; @@ -144,6 +149,8 @@ private: QPushButton *m_setMacroBlockBegin = nullptr; QLineEdit *m_MacroBlockEnd = nullptr; QPushButton *m_setMacroBlockEnd = nullptr; + QPlainTextEdit *m_Macros = nullptr; + QPushButton *m_setMacros = nullptr; QLineEdit *m_MaxEmptyLinesToKeep = nullptr; QPushButton *m_setMaxEmptyLinesToKeep = nullptr; QComboBox *m_NamespaceIndentation = nullptr; @@ -185,6 +192,7 @@ private: QComboBox *m_ReferenceAlignment = nullptr; QComboBox *m_ReflowComments = nullptr; QComboBox *m_RemoveBracesLLVM = nullptr; + QComboBox *m_RemoveParentheses = nullptr; QComboBox *m_RemoveSemicolon = nullptr; QComboBox *m_RequiresClausePosition = nullptr; QComboBox *m_RequiresExpressionIndentation = nullptr; @@ -203,6 +211,7 @@ private: QComboBox *m_SpaceBeforeCpp11BracedList = nullptr; QComboBox *m_SpaceBeforeCtorInitializerColon = nullptr; QComboBox *m_SpaceBeforeInheritanceColon = nullptr; + QComboBox *m_SpaceBeforeJsonColon = nullptr; QComboBox *m_SpaceBeforeParens = nullptr; QComboBox *m_SpaceBeforeParensOptionsAfterControlStatements = nullptr; QComboBox *m_SpaceBeforeParensOptionsAfterForeachMacros = nullptr; @@ -216,18 +225,15 @@ private: QComboBox *m_SpaceBeforeSquareBrackets = nullptr; QComboBox *m_SpaceBeforeRangeBasedForLoopColon = nullptr; QComboBox *m_SpaceInEmptyBlock = nullptr; - QComboBox *m_SpaceInEmptyParentheses = nullptr; - QLineEdit *m_SpacesBeforeTrailingComments = nullptr; - QPushButton *m_setSpacesBeforeTrailingComments = nullptr; QComboBox *m_SpacesInAngles = nullptr; - QComboBox *m_SpacesInConditionalStatement = nullptr; - QComboBox *m_SpacesInContainerLiterals = nullptr; - QComboBox *m_SpacesInCStyleCastParentheses = nullptr; QLineEdit *m_SpacesInLineCommentPrefixMinimum = nullptr; QPushButton *m_setSpacesInLineCommentPrefixMinimum = nullptr; QLineEdit *m_SpacesInLineCommentPrefixMaximum = nullptr; QPushButton *m_setSpacesInLineCommentPrefixMaximum = nullptr; - QComboBox *m_SpacesInParentheses = nullptr; + QComboBox *m_SpacesInParensOptionsInConditionalStatements = nullptr; + QComboBox *m_SpacesInParensOptionsInCStyleCasts = nullptr; + QComboBox *m_SpacesInParensOptionsInEmptyParentheses = nullptr; + QComboBox *m_SpacesInParensOptionsOther = nullptr; QComboBox *m_SpacesInSquareBrackets = nullptr; QComboBox *m_Standard = nullptr; QPlainTextEdit *m_StatementAttributeLikeMacros = nullptr; @@ -236,9 +242,12 @@ private: QPushButton *m_setStatementMacros = nullptr; QLineEdit *m_TabWidth = nullptr; QPushButton *m_setTabWidth = nullptr; + QPlainTextEdit *m_TypeNames = nullptr; + QPushButton *m_setTypeNames = nullptr; QPlainTextEdit *m_TypenameMacros = nullptr; QPushButton *m_setTypenameMacros = nullptr; QComboBox *m_UseTab = nullptr; + QComboBox *m_VerilogBreakBetweenInstancePorts = nullptr; QPlainTextEdit *m_WhitespaceSensitiveMacros = nullptr; QPushButton *m_setWhitespaceSensitiveMacros = nullptr; diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index e736570058c..d1735b15fb7 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -97,7 +97,7 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferenc && !codeStyle->isAdditionalTabDisabled()); - static const int expectedMajorVersion = 16; + static const int expectedMajorVersion = 17; d->clangVersion = new QLabel(Tr::tr("Current clang-format version: ") + LLVM_VERSION_STRING, this); d->clangWarningText From c999f4f8803159d714272e8c563aafa7b49c137c Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 4 Oct 2023 09:50:53 +0200 Subject: [PATCH 1406/1777] Docker: Fix threading Make sure that the container state is synchronized with the main thread. Change-Id: I8b50a380779038b273a1eb6645aa08309e90bc56 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/docker/dockerdevice.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 316ce591892..d30dbcc107c 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -888,6 +888,15 @@ expected_str<void> DockerDevicePrivate::startContainer() bool DockerDevicePrivate::updateContainerAccess() { + if (QThread::currentThread() != thread()) { + bool result = false; + QMetaObject::invokeMethod(this, + &DockerDevicePrivate::updateContainerAccess, + Qt::BlockingQueuedConnection, + &result); + return result; + } + if (m_isShutdown) return false; From c50f9a927343bd5645330e5641e7ded9308f6b57 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 4 Oct 2023 10:00:28 +0200 Subject: [PATCH 1407/1777] Docker: Move rootPath into Settings Change-Id: I11aa1d928281b13ccb136b907c9eb8f98582fd28 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/docker/dockerdevice.cpp | 7 ++++++- src/plugins/docker/dockerdevice.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index d30dbcc107c..b8c3fe47d89 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -261,6 +261,11 @@ QString DockerDeviceSettings::repoAndTagEncoded() const return repoAndTag().replace(':', '.'); } +FilePath DockerDeviceSettings::rootPath() const +{ + return FilePath::fromParts(Constants::DOCKER_DEVICE_SCHEME, repoAndTagEncoded(), u"/"); +} + class DockerDevicePrivate : public QObject { public: @@ -959,7 +964,7 @@ FilePath DockerDevice::filePath(const QString &pathOnDevice) const FilePath DockerDevice::rootPath() const { - return FilePath::fromParts(Constants::DOCKER_DEVICE_SCHEME, d->repoAndTagEncoded(), u"/"); + return d->deviceSettings->rootPath(); } bool DockerDevice::handlesFile(const FilePath &filePath) const diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 7c170182160..477de04168a 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -23,6 +23,7 @@ public: QString repoAndTag() const; QString repoAndTagEncoded() const; + Utils::FilePath rootPath() const; Utils::StringAspect imageId{this}; Utils::StringAspect repo{this}; From 6cd2e6de0cd7fe62ba62e1448b7d3d0654acf77f Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 4 Oct 2023 14:31:35 +0200 Subject: [PATCH 1408/1777] Utils: Fix StringAspect TextEditDisplay Remove the unnecessary re-setting of the text edit content due to the undo => edit => undo => edit connection. Fixes: QTCREATORBUG-29688 Change-Id: I7838ed594ae3741df757fa5eb3cdd90506428be3 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index cf5dd311085..551e6ca1244 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1229,14 +1229,19 @@ void StringAspect::addToLayout(LayoutItem &parent) &QTextEdit::setPlaceholderText); connect(textEditDisplay, &QTextEdit::textChanged, this, [this, textEditDisplay]() { - d->undoable.set(undoStack(), textEditDisplay->toPlainText()); - handleGuiChanged(); + if (textEditDisplay->toPlainText() != d->undoable.get()) { + d->undoable.set(undoStack(), textEditDisplay->toPlainText()); + handleGuiChanged(); + } }); connect(&d->undoable.m_signal, &UndoSignaller::changed, textEditDisplay, - [this, textEditDisplay] { textEditDisplay->setText(d->undoable.get()); }); + [this, textEditDisplay] { + if (textEditDisplay->toPlainText() != d->undoable.get()) + textEditDisplay->setText(d->undoable.get()); + }); break; } case LabelDisplay: { From 9af8ecd935b8647d49574e1b66a522970025dcb8 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Fri, 29 Sep 2023 14:50:58 +0200 Subject: [PATCH 1409/1777] DAP: Fix dap engine selection with the translated strings Change-Id: I051c1f7e9776922a98f7c54676c237c63984050d Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/debuggerplugin.cpp | 44 ++++++++++----------- src/plugins/debugger/debuggerruncontrol.cpp | 10 ++--- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 88bcbd081c0..bb90a260cc9 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1239,17 +1239,29 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) void DebuggerPluginPrivate::createDapDebuggerPerspective(QWidget *globalLogWindow) { - EngineManager::registerDefaultPerspective(Tr::tr("CMake Preset"), - "DAP", - Constants::DAP_PERSPECTIVE_ID); + struct DapPerspective + { + QString name; + char const *runMode; + }; - EngineManager::registerDefaultPerspective(Tr::tr("GDB Preset"), - "DAP", - Constants::DAP_PERSPECTIVE_ID); + const QList<DapPerspective> perspectiveList = { + DapPerspective{Tr::tr("CMake Preset"), ProjectExplorer::Constants::DAP_CMAKE_DEBUG_RUN_MODE}, + DapPerspective{Tr::tr("GDB Preset"), ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE}, + DapPerspective{Tr::tr("Python Preset"), + ProjectExplorer::Constants::DAP_PY_DEBUG_RUN_MODE}, + }; - EngineManager::registerDefaultPerspective(Tr::tr("Python Preset"), - "DAP", - Constants::DAP_PERSPECTIVE_ID); + for (const DapPerspective &dp : perspectiveList) + EngineManager::registerDefaultPerspective(dp.name, "DAP", Constants::DAP_PERSPECTIVE_ID); + + connect(&m_startDapAction, &QAction::triggered, this, [perspectiveList] { + QComboBox *combo = qobject_cast<QComboBox *>(EngineManager::dapEngineChooser()); + if (perspectiveList.size() > combo->currentIndex()) + ProjectExplorerPlugin::runStartupProject(perspectiveList.at(combo->currentIndex()) + .runMode, + false); + }); auto breakpointManagerView = createBreakpointManagerView("DAPDebugger.BreakWindow"); auto breakpointManagerWindow @@ -1265,20 +1277,6 @@ void DebuggerPluginPrivate::createDapDebuggerPerspective(QWidget *globalLogWindo Tr::tr("DAP Debugger Perspectives"), "DAPDebugger.Docks.Snapshots"); - connect(&m_startDapAction, &QAction::triggered, this, [] { - QComboBox *combo = qobject_cast<QComboBox *>(EngineManager::dapEngineChooser()); - if (combo->currentText() == "CMake Preset") { - ProjectExplorerPlugin::runStartupProject( - ProjectExplorer::Constants::DAP_CMAKE_DEBUG_RUN_MODE, false); - } else if (combo->currentText() == "GDB Preset") { - ProjectExplorerPlugin::runStartupProject( - ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE, false); - } else { - ProjectExplorerPlugin::runStartupProject( - ProjectExplorer::Constants::DAP_PY_DEBUG_RUN_MODE, false); - } - }); - m_perspectiveDap.addToolBarAction(&m_startDapAction); m_startDapAction.setToolTip(Tr::tr("Start DAP Debugging")); m_startDapAction.setText(Tr::tr("Start DAP Debugging")); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 788eacb4bfa..d797586d793 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -481,14 +481,10 @@ void DebuggerRunTool::start() runControl()->setDisplayName(m_runParameters.displayName); + m_engine = createDapEngine(runControl()->runMode()); + if (!m_engine) { - if (runControl()->runMode() == ProjectExplorer::Constants::DAP_CMAKE_DEBUG_RUN_MODE) - m_engine = createDapEngine(runControl()->runMode()); - else if (runControl()->runMode() == ProjectExplorer::Constants::DAP_GDB_DEBUG_RUN_MODE) - m_engine = createDapEngine(runControl()->runMode()); - else if (runControl()->runMode() == ProjectExplorer::Constants::DAP_PY_DEBUG_RUN_MODE) - m_engine = createDapEngine(runControl()->runMode()); - else if (m_runParameters.isCppDebugging()) { + if (m_runParameters.isCppDebugging()) { switch (m_runParameters.cppEngineType) { case GdbEngineType: m_engine = createGdbEngine(); From 70f4d9bda083d4db1e9faa80ebad649076d82e65 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Wed, 4 Oct 2023 13:33:00 +0200 Subject: [PATCH 1410/1777] ClangFormat: Lower the file size threshold E.g. cppquickfix_test.cpp in Qt Creator is ~260KB, and editing it is quite sluggish with ClangFormat enabled. Change-Id: Ifa0db8198b8c15fd03571176b9e94f046da3e44d Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> --- src/plugins/clangformat/clangformatsettings.cpp | 3 ++- src/plugins/clangformat/clangformatsettings.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/clangformat/clangformatsettings.cpp b/src/plugins/clangformat/clangformatsettings.cpp index daefd3f88bf..48e34dc573e 100644 --- a/src/plugins/clangformat/clangformatsettings.cpp +++ b/src/plugins/clangformat/clangformatsettings.cpp @@ -25,7 +25,8 @@ ClangFormatSettings::ClangFormatSettings() m_overrideDefaultFile = settings->value(Constants::OVERRIDE_FILE_ID, false).toBool(); m_formatWhileTyping = settings->value(Constants::FORMAT_WHILE_TYPING_ID, false).toBool(); m_formatOnSave = settings->value(Constants::FORMAT_CODE_ON_SAVE_ID, false).toBool(); - m_fileSizeThreshold = settings->value(Constants::FILE_SIZE_THREDSHOLD, 1024).toInt(); + m_fileSizeThreshold = settings->value(Constants::FILE_SIZE_THREDSHOLD, + m_fileSizeThreshold).toInt(); // Convert old settings to new ones. New settings were added to QtC 8.0 bool isOldFormattingOn = settings->value(FORMAT_CODE_INSTEAD_OF_INDENT_ID, false).toBool(); diff --git a/src/plugins/clangformat/clangformatsettings.h b/src/plugins/clangformat/clangformatsettings.h index 07e854df461..b2ecd744688 100644 --- a/src/plugins/clangformat/clangformatsettings.h +++ b/src/plugins/clangformat/clangformatsettings.h @@ -41,7 +41,7 @@ private: bool m_overrideDefaultFile = false; bool m_formatWhileTyping = false; bool m_formatOnSave = false; - int m_fileSizeThreshold = 1024; + int m_fileSizeThreshold = 200; }; } // namespace ClangFormat From 3726f0d6c1d05452f070b911683c51fe95df65c4 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 29 Sep 2023 23:28:23 +0200 Subject: [PATCH 1411/1777] Core: Add a setting for HighDpiScaleFactorRoundingPolicy In Qt 6, the API and environment variables intended to influence the HighDPI behavior changed quite a bit. Until recently, (see "Amends" change), Qt Creator still supported the Qt 5 options instead of the Qt 6 options. With Qt 6, HighDpi support is always enabled. Just the DPI rounding policy should be set by user or application. This change adds a ComboBox in the General settings, which allows to select a DPI rounding policy: https://doc.qt.io/qt-6/qt.html#HighDpiScaleFactorRoundingPolicy-enum The default setting is "PassThrough", which is the default policy for Qt 6, and which is also the default in Qt Creator since version 11.0.2. Amends: d1deeb2c0d2c3f22be7d970e5e0f166f5101667b Fixes: QTCREATORBUG-29501 Change-Id: Ib19b40cb3945cecc71b7c10f42fa2b06b3cc6153 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/app/main.cpp | 12 +++-- src/libs/utils/hostosinfo.h | 6 +++ src/plugins/coreplugin/generalsettings.cpp | 51 +++++++++++++++++----- 3 files changed, 51 insertions(+), 18 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 49f0a10a6a8..ce09e0d6ada 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -285,11 +285,11 @@ static void setHighDpiEnvironmentVariable() std::unique_ptr<Utils::QtcSettings> settings(createUserSettings()); - const bool defaultValue = Utils::HostOsInfo::isWindowsHost(); - const bool enableHighDpiScaling = settings->value("Core/EnableHighDpiScaling", defaultValue).toBool(); - const auto policy = enableHighDpiScaling ? Qt::HighDpiScaleFactorRoundingPolicy::PassThrough - : Qt::HighDpiScaleFactorRoundingPolicy::Floor; - QGuiApplication::setHighDpiScaleFactorRoundingPolicy(policy); + using Policy = Qt::HighDpiScaleFactorRoundingPolicy; + const Policy defaultPolicy = Utils::HostOsInfo::defaultHighDpiScaleFactorRoundingPolicy(); + const Policy userPolicy = settings->value("Core/HighDpiScaleFactorRoundingPolicy", + int(defaultPolicy)).value<Policy>(); + QGuiApplication::setHighDpiScaleFactorRoundingPolicy(userPolicy); } void setPixmapCacheLimit() @@ -522,8 +522,6 @@ int main(int argc, char **argv) } qputenv("QSG_RHI_BACKEND", "opengl"); - QGuiApplication::setHighDpiScaleFactorRoundingPolicy( - Qt::HighDpiScaleFactorRoundingPolicy::Round); if (qEnvironmentVariableIsSet("QTCREATOR_DISABLE_NATIVE_MENUBAR") || qgetenv("XDG_CURRENT_DESKTOP").startsWith("Unity")) { diff --git a/src/libs/utils/hostosinfo.h b/src/libs/utils/hostosinfo.h index 44880f7885c..2c5f54b447f 100644 --- a/src/libs/utils/hostosinfo.h +++ b/src/libs/utils/hostosinfo.h @@ -90,6 +90,12 @@ public: static const FilePath &root(); + static constexpr Qt::HighDpiScaleFactorRoundingPolicy + defaultHighDpiScaleFactorRoundingPolicy() { + return isMacHost() ? Qt::HighDpiScaleFactorRoundingPolicy::Unset + : Qt::HighDpiScaleFactorRoundingPolicy::PassThrough; + } + private: static Qt::CaseSensitivity m_overrideFileNameCaseSensitivity; static bool m_useOverrideFileNameCaseSensitivity; diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 208c2f87321..97b5c222cdd 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -37,7 +37,7 @@ using namespace Layouting; namespace Core::Internal { -const char settingsKeyDPI[] = "Core/EnableHighDpiScaling"; +const char settingsKeyDpiPolicy[] = "Core/HighDpiScaleFactorRoundingPolicy"; const char settingsKeyCodecForLocale[] = "General/OverrideCodecForLocale"; const char settingsKeyToolbarStyle[] = "General/ToolbarStyle"; @@ -89,6 +89,7 @@ public: static QByteArray codecForLocale(); static void setCodecForLocale(const QByteArray&); void fillToolbarSyleBox() const; + static void setDpiPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy); QComboBox *m_languageBox; QComboBox *m_codecBox; @@ -96,6 +97,7 @@ public: ThemeChooser *m_themeChooser; QPushButton *m_resetWarningsButton; QComboBox *m_toolbarStyleBox; + QComboBox *m_policyComboBox = nullptr; }; GeneralSettingsWidget::GeneralSettingsWidget() @@ -134,16 +136,23 @@ GeneralSettingsWidget::GeneralSettingsWidget() form.addRow({Tr::tr("Language:"), m_languageBox, st}); if (!Utils::HostOsInfo::isMacHost()) { - auto dpiCheckbox = new QCheckBox(Tr::tr("Enable high DPI scaling")); - form.addRow({empty, dpiCheckbox}); - const bool defaultValue = Utils::HostOsInfo::isWindowsHost(); - dpiCheckbox->setChecked(ICore::settings()->value(settingsKeyDPI, defaultValue).toBool()); - connect(dpiCheckbox, &QCheckBox::toggled, this, [defaultValue](bool checked) { - ICore::settings()->setValueWithDefault(settingsKeyDPI, checked, defaultValue); - QMessageBox::information(ICore::dialogParent(), - Tr::tr("Restart Required"), - Tr::tr("The high DPI settings will take effect after restart.")); - }); + using Policy = Qt::HighDpiScaleFactorRoundingPolicy; + m_policyComboBox = new QComboBox; + m_policyComboBox->addItem(Tr::tr("Round up for .5 and above"), int(Policy::Round)); + m_policyComboBox->addItem(Tr::tr("Always round up"), int(Policy::Ceil)); + m_policyComboBox->addItem(Tr::tr("Always round down"), int(Policy::Floor)); + m_policyComboBox->addItem(Tr::tr("Round up for .75 and above"), + int(Policy::RoundPreferFloor)); + m_policyComboBox->addItem(Tr::tr("Don't round"), int(Policy::PassThrough)); + m_policyComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); + + const Policy userPolicy = + ICore::settings()->value(settingsKeyDpiPolicy, + int(HostOsInfo::defaultHighDpiScaleFactorRoundingPolicy())) + .value<Policy>(); + m_policyComboBox->setCurrentIndex(m_policyComboBox->findData(int(userPolicy))); + + form.addRow({Tr::tr("DPI Rounding Policy:"), m_policyComboBox, st}); } form.addRow({empty, generalSettings().showShortcutsInContextMenus}); @@ -214,6 +223,11 @@ void GeneralSettingsWidget::apply() int currentIndex = m_languageBox->currentIndex(); setLanguage(m_languageBox->itemData(currentIndex, Qt::UserRole).toString()); + if (m_policyComboBox) { + const Qt::HighDpiScaleFactorRoundingPolicy selectedPolicy = + m_policyComboBox->currentData().value<Qt::HighDpiScaleFactorRoundingPolicy>(); + setDpiPolicy(selectedPolicy); + } currentIndex = m_codecBox->currentIndex(); setCodecForLocale(m_codecBox->itemText(currentIndex).toLocal8Bit()); // Apply the new base color if accepted @@ -317,6 +331,21 @@ void GeneralSettingsWidget::fillToolbarSyleBox() const m_toolbarStyleBox->setCurrentIndex(curId); } +void GeneralSettingsWidget::setDpiPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy) +{ + QtcSettings *settings = ICore::settings(); + const Qt::HighDpiScaleFactorRoundingPolicy previousPolicy = + settings->value(settingsKeyDpiPolicy).value<Qt::HighDpiScaleFactorRoundingPolicy>(); + if (policy != previousPolicy) { + RestartDialog dialog(ICore::dialogParent(), + Tr::tr("The DPI rounding policy change will take effect after " + "restart.")); + dialog.exec(); + } + settings->setValueWithDefault(settingsKeyDpiPolicy, int(policy), + int(HostOsInfo::defaultHighDpiScaleFactorRoundingPolicy())); +} + void GeneralSettings::applyToolbarStyleFromSettings() { StyleHelper::setToolbarStyle(toolbarStylefromSettings()); From 39354fd5e13eba3ca4f124b25ffe36763858e388 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 4 Oct 2023 15:17:18 +0200 Subject: [PATCH 1412/1777] Docker: Add missing display style for extraArgs Change-Id: I09150ee63ab9911e4f1ae555575b068e4f93d5fa Reviewed-by: hjk <hjk@qt.io> --- src/plugins/docker/dockerdevice.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index b8c3fe47d89..22120f74054 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -191,6 +191,7 @@ DockerDeviceSettings::DockerDeviceSettings() extraArgs.setSettingsKey(DockerDeviceExtraArgs); extraArgs.setLabelText(Tr::tr("Extra arguments:")); extraArgs.setToolTip(Tr::tr("Extra arguments to pass to docker create.")); + extraArgs.setDisplayStyle(StringAspect::LineEditDisplay); clangdExecutable.setSettingsKey(DockerDeviceClangDExecutable); clangdExecutable.setLabelText(Tr::tr("Clangd Executable:")); From 34fdac0d841548f1a158b9b716963e74f58ed90b Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 4 Oct 2023 15:34:21 +0200 Subject: [PATCH 1413/1777] CMake: Improve remote parsing speed To improve the speed of parsing the result of a remote cmake call, we move the file fetching and parsing into a mapped concurrent call. We also first uniquify the list of files to remove duplicates. Fixes: QTCREATORBUG-29618 Change-Id: I18108928ba3b5f4f8ec3d5610b216c5ccf060877 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../fileapidataextractor.cpp | 98 +++++++++++-------- .../fileapidataextractor.h | 2 + 2 files changed, 58 insertions(+), 42 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 980ba47cbe3..96d991d1e17 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -20,6 +20,7 @@ #include <projectexplorer/projecttree.h> #include <QLoggingCategory> +#include <QtConcurrent> using namespace ProjectExplorer; using namespace Utils; @@ -50,52 +51,65 @@ CMakeFileResult extractCMakeFilesData(const std::vector<CMakeFileInfo> &cmakefil { CMakeFileResult result; - for (const CMakeFileInfo &info : cmakefiles) { - const FilePath sfn = sourceDirectory.resolvePath(info.path); - const int oldCount = result.cmakeFiles.count(); - CMakeFileInfo absolute(info); - absolute.path = sfn; + if (cmakefiles.empty()) + return result; - const auto mimeType = Utils::mimeTypeForFile(info.path); - if (mimeType.matchesName(Constants::CMAKE_MIMETYPE) - || mimeType.matchesName(Constants::CMAKE_PROJECT_MIMETYPE)) { - expected_str<QByteArray> fileContent = sfn.fileContents(); - std::string errorString; - if (fileContent) { - fileContent = fileContent->replace("\r\n", "\n"); - if (!absolute.cmakeListFile.ParseString(fileContent->toStdString(), - sfn.fileName().toStdString(), - errorString)) - qCWarning(cmakeLogger) - << "Failed to parse:" << sfn.path() << QString::fromLatin1(errorString); - } + // Uniquify fileInfos + std::set<CMakeFileInfo> cmakeFileSet{cmakefiles.begin(), cmakefiles.end()}; + + // Load and parse cmake files. We use concurrency here to speed up the process of + // reading many small files, which can get slow especially on remote devices. + QFuture<CMakeFileInfo> mapResult + = QtConcurrent::mapped(cmakeFileSet, [sourceDirectory](const auto &info) { + const FilePath sfn = sourceDirectory.resolvePath(info.path); + CMakeFileInfo absolute(info); + absolute.path = sfn; + + const auto mimeType = Utils::mimeTypeForFile(info.path); + if (mimeType.matchesName(Constants::CMAKE_MIMETYPE) + || mimeType.matchesName(Constants::CMAKE_PROJECT_MIMETYPE)) { + expected_str<QByteArray> fileContent = sfn.fileContents(); + std::string errorString; + if (fileContent) { + fileContent = fileContent->replace("\r\n", "\n"); + if (!absolute.cmakeListFile.ParseString(fileContent->toStdString(), + sfn.fileName().toStdString(), + errorString)) { + qCWarning(cmakeLogger) << "Failed to parse:" << sfn.path() + << QString::fromLatin1(errorString); + } + } + } + + return absolute; + }); + + mapResult.waitForFinished(); + + for (const auto &info : mapResult.results()) { + result.cmakeFiles.insert(info); + + if (info.isCMake && !info.isCMakeListsDotTxt) { + // Skip files that cmake considers to be part of the installation -- but include + // CMakeLists.txt files. This fixes cmake binaries running from their own + // build directory. + continue; } - result.cmakeFiles.insert(absolute); + auto node = std::make_unique<FileNode>(info.path, FileType::Project); + node->setIsGenerated(info.isGenerated + && !info.isCMakeListsDotTxt); // CMakeLists.txt are never + // generated, independent + // what cmake thinks:-) - if (oldCount < result.cmakeFiles.count()) { - if (info.isCMake && !info.isCMakeListsDotTxt) { - // Skip files that cmake considers to be part of the installation -- but include - // CMakeLists.txt files. This fixes cmake binaries running from their own - // build directory. - continue; - } - - auto node = std::make_unique<FileNode>(sfn, FileType::Project); - node->setIsGenerated(info.isGenerated - && !info.isCMakeListsDotTxt); // CMakeLists.txt are never - // generated, independent - // what cmake thinks:-) - - if (info.isCMakeListsDotTxt) { - result.cmakeListNodes.emplace_back(std::move(node)); - } else if (sfn.isChildOf(sourceDirectory)) { - result.cmakeNodesSource.emplace_back(std::move(node)); - } else if (sfn.isChildOf(buildDirectory)) { - result.cmakeNodesBuild.emplace_back(std::move(node)); - } else { - result.cmakeNodesOther.emplace_back(std::move(node)); - } + if (info.isCMakeListsDotTxt) { + result.cmakeListNodes.emplace_back(std::move(node)); + } else if (info.path.isChildOf(sourceDirectory)) { + result.cmakeNodesSource.emplace_back(std::move(node)); + } else if (info.path.isChildOf(buildDirectory)) { + result.cmakeNodesBuild.emplace_back(std::move(node)); + } else { + result.cmakeNodesOther.emplace_back(std::move(node)); } } diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.h b/src/plugins/cmakeprojectmanager/fileapidataextractor.h index e4ed3aa778c..946833b1c34 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.h +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.h @@ -28,6 +28,8 @@ public: bool operator==(const CMakeFileInfo& other) const { return path == other.path; } friend size_t qHash(const CMakeFileInfo &info, uint seed = 0) { return qHash(info.path, seed); } + bool operator<(const CMakeFileInfo &other) const { return path < other.path; } + Utils::FilePath path; bool isCMake = false; bool isCMakeListsDotTxt = false; From ae4852a3ea98db7a83bfc8abaa4d48554f2c7b80 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 2 Oct 2023 16:24:02 +0200 Subject: [PATCH 1414/1777] Core: Rename MainWindowPrivate to ICorePrivate Mechanical, plan is to move m_mainWindow there and switch around construction. Change-Id: Ic7936623586ac68c2cdd69a40042262802579d23 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../coreplugin/actionmanager/actionmanager.h | 4 +- src/plugins/coreplugin/documentmanager.h | 6 +- .../coreplugin/editormanager/editormanager.h | 4 +- src/plugins/coreplugin/icore.cpp | 82 +++++++++---------- src/plugins/coreplugin/jsexpander.h | 8 +- src/plugins/coreplugin/messagemanager.h | 4 +- src/plugins/coreplugin/modemanager.h | 8 +- src/plugins/coreplugin/outputpanemanager.h | 4 +- src/plugins/coreplugin/vcsmanager.h | 6 +- 9 files changed, 62 insertions(+), 64 deletions(-) diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.h b/src/plugins/coreplugin/actionmanager/actionmanager.h index a5542df03d0..a0b522610f8 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.h +++ b/src/plugins/coreplugin/actionmanager/actionmanager.h @@ -25,8 +25,8 @@ class ICore; namespace Internal { class CorePlugin; +class ICorePrivate; class MainWindow; -class MainWindowPrivate; } // Internal class CORE_EXPORT ActionManager : public QObject @@ -69,7 +69,7 @@ private: friend class Core::Internal::CorePlugin; // initialization friend class Core::ICore; // saving settings and setting context - friend class Core::Internal::MainWindowPrivate; // saving settings and setting context + friend class Core::Internal::ICorePrivate; // saving settings and setting context }; } // namespace Core diff --git a/src/plugins/coreplugin/documentmanager.h b/src/plugins/coreplugin/documentmanager.h index a731095398a..67b65659a4b 100644 --- a/src/plugins/coreplugin/documentmanager.h +++ b/src/plugins/coreplugin/documentmanager.h @@ -20,7 +20,7 @@ class IDocument; namespace Internal { class DocumentManagerPrivate; -class MainWindowPrivate; +class ICorePrivate; } class CORE_EXPORT DocumentManager : public QObject @@ -152,8 +152,8 @@ private: void updateSaveAll(); static void registerSaveAllAction(); - friend class Core::Internal::MainWindowPrivate; - friend class Core::Internal::DocumentManagerPrivate; + friend class Internal::DocumentManagerPrivate; + friend class Internal::ICorePrivate; }; class CORE_EXPORT FileChangeBlocker diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index 1313fb93b1e..aea9e2eebf1 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -29,7 +29,7 @@ namespace Core { class IDocument; class LocatorFilterEntry; -namespace Internal { class MainWindowPrivate; } +namespace Internal { class ICorePrivate; } class CORE_EXPORT EditorManagerPlaceHolder final : public QWidget { @@ -188,7 +188,7 @@ private: explicit EditorManager(QObject *parent); ~EditorManager() override; - friend class Core::Internal::MainWindowPrivate; + friend class Internal::ICorePrivate; }; } // namespace Core diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 67ea33ccc8a..6d302ac8776 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -252,14 +252,14 @@ static NewDialog *defaultDialogFactory(QWidget *parent) namespace Internal { -class MainWindowPrivate : public QObject +class ICorePrivate : public QObject { public: - explicit MainWindowPrivate(MainWindow *mainWindow) + explicit ICorePrivate(MainWindow *mainWindow) : q(mainWindow) {} - ~MainWindowPrivate(); + ~ICorePrivate(); void init(); @@ -353,7 +353,7 @@ static QMenuBar *globalMenuBar() } // Internal -static MainWindowPrivate *d = nullptr; +static ICorePrivate *d = nullptr; static std::function<NewDialog *(QWidget *)> m_newDialogFactory = defaultDialogFactory; @@ -1172,7 +1172,7 @@ enum { debugMainWindow = 0 }; namespace Internal { -void MainWindowPrivate::init() +void ICorePrivate::init() { m_progressManager = new ProgressManagerPrivate; m_jsExpander = JsExpander::createGlobalJsExpander(); @@ -1233,7 +1233,7 @@ void MainWindowPrivate::init() m_progressManager->progressView()->setParent(q); - connect(qApp, &QApplication::focusChanged, this, &MainWindowPrivate::updateFocusWidget); + connect(qApp, &QApplication::focusChanged, this, &ICorePrivate::updateFocusWidget); // Add small Toolbuttons for toggling the navigation widgets StatusBarManager::addStatusBarWidget(m_toggleLeftSideBarButton, StatusBarManager::First); @@ -1268,7 +1268,7 @@ void MainWindowPrivate::init() MainWindow::MainWindow() { m_mainwindow = this; - d = new MainWindowPrivate(this); + d = new ICorePrivate(this); d->init(); // Separation needed for now as the call triggers other MainWindow calls. setWindowTitle(QGuiApplication::applicationDisplayName()); @@ -1279,12 +1279,12 @@ MainWindow::MainWindow() setCentralWidget(d->m_modeStack); } -NavigationWidget *MainWindowPrivate::navigationWidget(Side side) const +NavigationWidget *ICorePrivate::navigationWidget(Side side) const { return side == Side::Left ? m_leftNavigationWidget : m_rightNavigationWidget; } -void MainWindowPrivate::setSidebarVisible(bool visible, Side side) +void ICorePrivate::setSidebarVisible(bool visible, Side side) { if (NavigationWidgetPlaceHolder::current(side)) navigationWidget(side)->setShown(visible); @@ -1296,7 +1296,7 @@ MainWindow::~MainWindow() d = nullptr; } -MainWindowPrivate::~MainWindowPrivate() +ICorePrivate::~ICorePrivate() { // explicitly delete window support, because that calls methods from ICore that call methods // from mainwindow, so mainwindow still needs to be alive @@ -1372,13 +1372,13 @@ void ICore::extensionsInitialized() emit m_core->coreAboutToOpen(); // Delay restoreWindowState, since it is overridden by LayoutRequest event - QMetaObject::invokeMethod(d, &MainWindowPrivate::restoreWindowState, Qt::QueuedConnection); + QMetaObject::invokeMethod(d, &ICorePrivate::restoreWindowState, Qt::QueuedConnection); QMetaObject::invokeMethod(m_core, &ICore::coreOpened, Qt::QueuedConnection); } void ICore::aboutToShutdown() { - disconnect(qApp, &QApplication::focusChanged, d, &MainWindowPrivate::updateFocusWidget); + disconnect(qApp, &QApplication::focusChanged, d, &ICorePrivate::updateFocusWidget); for (auto contextPair : d->m_contextWidgets) disconnect(contextPair.second, &QObject::destroyed, m_mainwindow, nullptr); d->m_activeContext.clear(); @@ -1457,14 +1457,14 @@ void MainWindow::mousePressEvent(QMouseEvent *event) AppMainWindow::mousePressEvent(event); } -void MainWindowPrivate::openDroppedFiles(const QList<DropSupport::FileSpec> &files) +void ICorePrivate::openDroppedFiles(const QList<DropSupport::FileSpec> &files) { q->raiseWindow(); const FilePaths filePaths = Utils::transform(files, &DropSupport::FileSpec::filePath); ICore::openFiles(filePaths, ICore::SwitchMode); } -void MainWindowPrivate::registerDefaultContainers() +void ICorePrivate::registerDefaultContainers() { ActionContainer *menubar = ActionManager::createMenuBar(Constants::MENU_BAR); @@ -1490,7 +1490,7 @@ void MainWindowPrivate::registerDefaultContainers() filemenu->appendGroup(Constants::G_FILE_CLOSE); filemenu->appendGroup(Constants::G_FILE_PRINT); filemenu->appendGroup(Constants::G_FILE_OTHER); - connect(filemenu->menu(), &QMenu::aboutToShow, this, &MainWindowPrivate::aboutToShowRecentFiles); + connect(filemenu->menu(), &QMenu::aboutToShow, this, &ICorePrivate::aboutToShowRecentFiles); // Edit Menu @@ -1549,7 +1549,7 @@ void MainWindowPrivate::registerDefaultContainers() ac->touchBar()->setApplicationTouchBar(); } -void MainWindowPrivate::registerDefaultActions() +void ICorePrivate::registerDefaultActions() { ActionContainer *mfile = ActionManager::actionContainer(Constants::M_FILE); ActionContainer *medit = ActionManager::actionContainer(Constants::M_EDIT); @@ -1575,7 +1575,7 @@ void MainWindowPrivate::registerDefaultActions() m_focusToEditor = new QAction(Tr::tr("Return to Editor"), this); Command *cmd = ActionManager::registerAction(m_focusToEditor, Constants::S_RETURNTOEDITOR); cmd->setDefaultKeySequence(QKeySequence(Qt::Key_Escape)); - connect(m_focusToEditor, &QAction::triggered, this, &MainWindowPrivate::setFocusToEditor); + connect(m_focusToEditor, &QAction::triggered, this, &ICorePrivate::setFocusToEditor); // New File Action QIcon icon = Icon::fromTheme("document-new"); @@ -1619,7 +1619,7 @@ void MainWindowPrivate::registerDefaultActions() cmd = ActionManager::registerAction(m_openAction, Constants::OPEN); cmd->setDefaultKeySequence(QKeySequence::Open); mfile->addAction(cmd, Constants::G_FILE_OPEN); - connect(m_openAction, &QAction::triggered, this, &MainWindowPrivate::openFile); + connect(m_openAction, &QAction::triggered, this, &ICorePrivate::openFile); // Open With Action m_openWithAction = new QAction(Tr::tr("Open File &With..."), this); @@ -1632,7 +1632,7 @@ void MainWindowPrivate::registerDefaultActions() m_openFromDeviceAction = new QAction(Tr::tr("Open From Device..."), this); cmd = ActionManager::registerAction(m_openFromDeviceAction, Constants::OPEN_FROM_DEVICE); mfile->addAction(cmd, Constants::G_FILE_OPEN); - connect(m_openFromDeviceAction, &QAction::triggered, this, &MainWindowPrivate::openFileFromDevice); + connect(m_openFromDeviceAction, &QAction::triggered, this, &ICorePrivate::openFileFromDevice); } // File->Recent Files Menu @@ -1906,7 +1906,7 @@ void MainWindowPrivate::registerDefaultActions() cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_QTCREATOR); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); tmpaction->setEnabled(true); - connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::aboutQtCreator); + connect(tmpaction, &QAction::triggered, this, &ICorePrivate::aboutQtCreator); //About Plugins Action tmpaction = new QAction(Tr::tr("About &Plugins..."), this); @@ -1914,7 +1914,7 @@ void MainWindowPrivate::registerDefaultActions() cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_PLUGINS); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); tmpaction->setEnabled(true); - connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::aboutPlugins); + connect(tmpaction, &QAction::triggered, this, &ICorePrivate::aboutPlugins); // About Qt Action // tmpaction = new QAction(Tr::tr("About &Qt..."), this); // cmd = ActionManager::registerAction(tmpaction, Constants:: ABOUT_QT); @@ -1928,14 +1928,14 @@ void MainWindowPrivate::registerDefaultActions() cmd = ActionManager::registerAction(tmpaction, Constants::CHANGE_LOG); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); tmpaction->setEnabled(true); - connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::changeLog); + connect(tmpaction, &QAction::triggered, this, &ICorePrivate::changeLog); // Contact tmpaction = new QAction(Tr::tr("Contact..."), this); cmd = ActionManager::registerAction(tmpaction, "QtCreator.Contact"); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); tmpaction->setEnabled(true); - connect(tmpaction, &QAction::triggered, this, &MainWindowPrivate::contact); + connect(tmpaction, &QAction::triggered, this, &ICorePrivate::contact); // About sep if (!HostOsInfo::isMacHost()) { // doesn't have the "About" actions in the Help menu @@ -1946,7 +1946,7 @@ void MainWindowPrivate::registerDefaultActions() } } -void MainWindowPrivate::registerModeSelectorStyleActions() +void ICorePrivate::registerModeSelectorStyleActions() { ActionContainer *mview = ActionManager::actionContainer(Constants::M_VIEW); @@ -1982,7 +1982,7 @@ void MainWindowPrivate::registerModeSelectorStyleActions() styleMenu->addActions(stylesGroup->actions()); } -void MainWindowPrivate::openFile() +void ICorePrivate::openFile() { ICore::openFiles(EditorManager::getOpenFilePaths(), ICore::SwitchMode); } @@ -2066,12 +2066,12 @@ IDocument *ICore::openFiles(const FilePaths &filePaths, namespace Internal { -void MainWindowPrivate::setFocusToEditor() +void ICorePrivate::setFocusToEditor() { EditorManagerPrivate::doEscapeKeyFocusMoveMagic(); } -void MainWindowPrivate::openFileFromDevice() +void ICorePrivate::openFileFromDevice() { ICore::openFiles(EditorManager::getOpenFilePaths(QFileDialog::DontUseNativeDialog), ICore::SwitchMode); } @@ -2191,7 +2191,7 @@ void ICore::removeContextObject(IContext *context) namespace Internal { -void MainWindowPrivate::updateFocusWidget(QWidget *old, QWidget *now) +void ICorePrivate::updateFocusWidget(QWidget *old, QWidget *now) { Q_UNUSED(old) @@ -2215,7 +2215,7 @@ void MainWindowPrivate::updateFocusWidget(QWidget *old, QWidget *now) updateContextObject(newContext); } -void MainWindowPrivate::updateContextObject(const QList<IContext *> &context) +void ICorePrivate::updateContextObject(const QList<IContext *> &context) { emit m_core->contextAboutToChange(context); m_activeContext = context; @@ -2227,7 +2227,7 @@ void MainWindowPrivate::updateContextObject(const QList<IContext *> &context) } } -void MainWindowPrivate::readSettings() +void ICorePrivate::readSettings() { QtcSettings *settings = PluginManager::settings(); settings->beginGroup(settingsGroup); @@ -2272,7 +2272,7 @@ void MainWindowPrivate::readSettings() m_rightPaneWidget->readSettings(settings); } -void MainWindowPrivate::saveWindowSettings() +void ICorePrivate::saveWindowSettings() { QtcSettings *settings = PluginManager::settings(); settings->beginGroup(settingsGroup); @@ -2290,7 +2290,7 @@ void MainWindowPrivate::saveWindowSettings() settings->endGroup(); } -void MainWindowPrivate::updateModeSelectorStyleMenu() +void ICorePrivate::updateModeSelectorStyleMenu() { switch (ModeManager::modeStyle()) { case ModeManager::Style::IconsAndText: @@ -2305,7 +2305,7 @@ void MainWindowPrivate::updateModeSelectorStyleMenu() } } -void MainWindowPrivate::updateContext() +void ICorePrivate::updateContext() { Context contexts = m_highPrioAdditionalContexts; @@ -2324,7 +2324,7 @@ void MainWindowPrivate::updateContext() emit m_core->contextChanged(uniquecontexts); } -void MainWindowPrivate::aboutToShowRecentFiles() +void ICorePrivate::aboutToShowRecentFiles() { ActionContainer *aci = ActionManager::actionContainer(Constants::M_FILE_RECENTFILES); QMenu *menu = aci->menu(); @@ -2354,12 +2354,12 @@ void MainWindowPrivate::aboutToShowRecentFiles() } } -void MainWindowPrivate::aboutQtCreator() +void ICorePrivate::aboutQtCreator() { if (!m_versionDialog) { m_versionDialog = new VersionDialog(q); connect(m_versionDialog, &QDialog::finished, - this, &MainWindowPrivate::destroyVersionDialog); + this, &ICorePrivate::destroyVersionDialog); ICore::registerWindow(m_versionDialog, Context("Core.VersionDialog")); m_versionDialog->show(); } else { @@ -2367,7 +2367,7 @@ void MainWindowPrivate::aboutQtCreator() } } -void MainWindowPrivate::destroyVersionDialog() +void ICorePrivate::destroyVersionDialog() { if (m_versionDialog) { m_versionDialog->deleteLater(); @@ -2375,7 +2375,7 @@ void MainWindowPrivate::destroyVersionDialog() } } -void MainWindowPrivate::aboutPlugins() +void ICorePrivate::aboutPlugins() { PluginDialog dialog(q); dialog.exec(); @@ -2400,7 +2400,7 @@ public: } }; -void MainWindowPrivate::changeLog() +void ICorePrivate::changeLog() { static QPointer<LogDialog> dialog; if (dialog) { @@ -2501,7 +2501,7 @@ void MainWindowPrivate::changeLog() dialog->show(); } -void MainWindowPrivate::contact() +void ICorePrivate::contact() { QMessageBox dlg(QMessageBox::Information, Tr::tr("Contact"), Tr::tr("<p>Qt Creator developers can be reached at the Qt Creator mailing list:</p>" @@ -2528,7 +2528,7 @@ void MainWindowPrivate::contact() dlg.exec(); } -void MainWindowPrivate::restoreWindowState() +void ICorePrivate::restoreWindowState() { NANOTRACE_SCOPE("Core", "MainWindow::restoreWindowState"); QtcSettings *settings = PluginManager::settings(); diff --git a/src/plugins/coreplugin/jsexpander.h b/src/plugins/coreplugin/jsexpander.h index 03a575bd83d..f5737588b74 100644 --- a/src/plugins/coreplugin/jsexpander.h +++ b/src/plugins/coreplugin/jsexpander.h @@ -13,14 +13,12 @@ class QObject; class QString; QT_END_NAMESPACE -namespace Utils { -class MacroExpander; -} +namespace Utils { class MacroExpander; } namespace Core { namespace Internal { -class MainWindowPrivate; +class ICorePrivate; class JsExpanderPrivate; } // namespace Internal @@ -50,7 +48,7 @@ private: static JsExpander *createGlobalJsExpander(); Internal::JsExpanderPrivate *d; - friend class Core::Internal::MainWindowPrivate; + friend class Internal::ICorePrivate; }; } // namespace Core diff --git a/src/plugins/coreplugin/messagemanager.h b/src/plugins/coreplugin/messagemanager.h index bde352afee4..98eb0635a12 100644 --- a/src/plugins/coreplugin/messagemanager.h +++ b/src/plugins/coreplugin/messagemanager.h @@ -17,8 +17,8 @@ namespace Core { class ICore; namespace Internal { +class ICorePrivate; class MainWindow; -class MainWindowPrivate; } class CORE_EXPORT MessageManager : public QObject @@ -46,8 +46,8 @@ private: static void init(); friend class ICore; + friend class Internal::ICorePrivate; friend class Internal::MainWindow; - friend class Internal::MainWindowPrivate; }; } // namespace Core diff --git a/src/plugins/coreplugin/modemanager.h b/src/plugins/coreplugin/modemanager.h index 191c9ee04e1..9ec8812ad8d 100644 --- a/src/plugins/coreplugin/modemanager.h +++ b/src/plugins/coreplugin/modemanager.h @@ -19,9 +19,9 @@ class ICore; class IMode; namespace Internal { -class MainWindow; -class MainWindowPrivate; class FancyTabWidget; +class ICorePrivate; +class MainWindow; } class CORE_EXPORT ModeManager : public QObject @@ -71,8 +71,8 @@ private: friend class ICore; friend class IMode; - friend class Core::Internal::MainWindow; - friend class Core::Internal::MainWindowPrivate; + friend class Internal::MainWindow; + friend class Internal::ICorePrivate; }; } // namespace Core diff --git a/src/plugins/coreplugin/outputpanemanager.h b/src/plugins/coreplugin/outputpanemanager.h index 50a51c0416d..74c14012ccc 100644 --- a/src/plugins/coreplugin/outputpanemanager.h +++ b/src/plugins/coreplugin/outputpanemanager.h @@ -20,8 +20,8 @@ class ICore; namespace Internal { +class ICorePrivate; class MainWindow; -class MainWindowPrivate; class OutputPaneToggleButton; class OutputPaneManageButton; @@ -54,8 +54,8 @@ protected: private: // the only class that is allowed to create and destroy friend class ICore; + friend class ICorePrivate; friend class MainWindow; - friend class MainWindowPrivate; friend class OutputPaneManageButton; explicit OutputPaneManager(QWidget *parent = nullptr); diff --git a/src/plugins/coreplugin/vcsmanager.h b/src/plugins/coreplugin/vcsmanager.h index aa51809f7d5..5bb5a2e9c7d 100644 --- a/src/plugins/coreplugin/vcsmanager.h +++ b/src/plugins/coreplugin/vcsmanager.h @@ -15,7 +15,7 @@ namespace Core { class IVersionControl; -namespace Internal { class MainWindowPrivate; } +namespace Internal { class ICorePrivate; } /* VcsManager: * 1) Provides functionality for finding the IVersionControl * for a given @@ -87,8 +87,8 @@ private: void handleConfigurationChanges(IVersionControl *vc); static void addVersionControl(IVersionControl *vc); - friend class Core::Internal::MainWindowPrivate; - friend class Core::IVersionControl; + friend class Internal::ICorePrivate; + friend class IVersionControl; }; } // namespace Core From f81bf729243da827a0da3156534bdf7fabb63830 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 4 Oct 2023 15:51:38 +0200 Subject: [PATCH 1415/1777] CMakePM: Fix assert with non CMake projects Amends 7028e27a81dfe46cd9fe9fb750ed5f7b0ae61241 Change-Id: I5d1e29abf19135aea8a401f2b971767f8a308c28 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 0140ffdc907..99ba8b972df 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -167,7 +167,8 @@ CMakeManager::CMakeManager() connect(ProjectManager::instance(), &ProjectManager::startupProjectChanged, this, [this] { updateCmakeActions(ProjectTree::currentNode()); - auto cmakeBuildSystem = static_cast<CMakeBuildSystem*>(ProjectManager::startupBuildSystem()); + auto cmakeBuildSystem = qobject_cast<CMakeBuildSystem *>( + ProjectManager::startupBuildSystem()); if (cmakeBuildSystem) { const BuildDirParameters parameters(cmakeBuildSystem); const auto tool = parameters.cmakeTool(); From ed59fd06b0f62de5465b79b6ac074b835414d920 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 25 Sep 2023 09:14:42 +0200 Subject: [PATCH 1416/1777] Add change log for 12.0.0 Change-Id: Ie12a4248d79e416ef0781561962b1ad1ee246957 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- dist/changelog/changes-12.0.0.md | 251 +++++++++++++++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100644 dist/changelog/changes-12.0.0.md diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md new file mode 100644 index 00000000000..e0c3529d924 --- /dev/null +++ b/dist/changelog/changes-12.0.0.md @@ -0,0 +1,251 @@ +Qt Creator 12 +============= + +Qt Creator version 12 contains bug fixes and new features. + +The most important changes are listed in this document. For a complete list of +changes, see the Git log for the Qt Creator sources that you can check out from +the public Git repository. For example: + + git clone git://code.qt.io/qt-creator/qt-creator.git + git log --cherry-pick --pretty=oneline origin/11.0..v12.0.0 + +What's new? +----------- + +* Experimental support for Compiler Explorer +* CMake debugging and the [Debugger Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/) +* Screen recording + +General +------- + +* Added the option to keep the sorting from the tool used for the file system + index locator filter + ([QTCREATORBUG-27789](https://bugreports.qt.io/browse/QTCREATORBUG-27789)) +* Added the option to hide the menu bar on platforms without unified menu bar + ([QTCREATORBUG-29498](https://bugreports.qt.io/browse/QTCREATORBUG-29498)) +* Fixed an issue with growing session files + +Help +---- + +* Added an option for text anti-aliasing + ([QTCREATORBUG-12177](https://bugreports.qt.io/browse/QTCREATORBUG-12177)) + +Editing +------- + +* Added the count of selected characters to line and column information + ([QTCREATORBUG-29381](https://bugreports.qt.io/browse/QTCREATORBUG-29381)) +* Added an indenter, auto-brace and auto-quote for JSON +* Fixed that the historical order of open documents was not restored +* Fixed that suggestions were rendered with the wrong tab size + ([QTCREATORBUG-29483](https://bugreports.qt.io/browse/QTCREATORBUG-29483)) + +### C++ + +* Updated to LLVM 17.0.1 +* Added `Tools > C++ > Fold All Comment Blocks` and `Unfold All Comment Blocks` + ([QTCREATORBUG-2449](https://bugreports.qt.io/browse/QTCREATORBUG-2449)) +* Added a refactoring action for converting comments between C++-style and + C-style + ([QTCREATORBUG-27501](https://bugreports.qt.io/browse/QTCREATORBUG-27501)) +* Added a refactoring action for moving documentation between function + declaration and definition + ([QTCREATORBUG-13877](https://bugreports.qt.io/browse/QTCREATORBUG-13877)) +* Extended the application of renaming operations to documentation comments + ([QTCREATORBUG-12051](https://bugreports.qt.io/browse/QTCREATORBUG-12051), + [QTCREATORBUG-15425](https://bugreports.qt.io/browse/QTCREATORBUG-15425)) +* Fixed that code inserted by refactoring actions was not formatted according + to the Clang Format settings + ([QTCREATORBUG-10807](https://bugreports.qt.io/browse/QTCREATORBUG-10807), + [QTCREATORBUG-19158](https://bugreports.qt.io/browse/QTCREATORBUG-19158)) +* Fixed that automatically created functions could be added between another + function and its documentation + ([QTCREATORBUG-6934](https://bugreports.qt.io/browse/QTCREATORBUG-6934)) +* Fixed that the refactoring actions from Clangd were not available in the + context menu +* Clang Format + * Fixed the style settings for Clang Format 16 and later + ([QTCREATORBUG-29434](https://bugreports.qt.io/browse/QTCREATORBUG-29434)) + +### QML + +* Fixed invalid `M325` warnings + ([QTCREATORBUG-29601](https://bugreports.qt.io/browse/QTCREATORBUG-29601)) +* Language Server + * Fixed the shortcut for applying refactoring actions + ([QTCREATORBUG-29557](https://bugreports.qt.io/browse/QTCREATORBUG-29557)) + +### Python + +* Fixed duplicate code when renaming + ([QTCREATORBUG-29389](https://bugreports.qt.io/browse/QTCREATORBUG-29389)) + +### Copilot + +* Added support for proxies + ([QTCREATORBUG-29485](https://bugreports.qt.io/browse/QTCREATORBUG-29485)) + +### TODO + +* Added the `\todo` keyword to the default + +### Markdown + +* Added buttons and configurable shortcuts for text styles + +### Images + +* Fixed that animations could not be restarted + ([QTCREATORBUG-29606](https://bugreports.qt.io/browse/QTCREATORBUG-29606)) +* Fixed that looping animations did not loop + ([QTCREATORBUG-29606](https://bugreports.qt.io/browse/QTCREATORBUG-29606)) + +Projects +-------- + +* Project specific settings + * Added C++ file naming settings + ([QTCREATORBUG-22033](https://bugreports.qt.io/browse/QTCREATORBUG-22033)) + * Added documentation comment settings +* Added an option for the Doxygen command prefix + ([QTCREATORBUG-8096](https://bugreports.qt.io/browse/QTCREATORBUG-8096)) +* Improved performance of filtering the target setup page + ([QTCREATORBUG-29494](https://bugreports.qt.io/browse/QTCREATORBUG-29494)) +* Fixed that run configurations were removed when the corresponding target + vanishes (even temporarily) + ([QTCREATORBUG-23163](https://bugreports.qt.io/browse/QTCREATORBUG-23163), + [QTCREATORBUG-28273](https://bugreports.qt.io/browse/QTCREATORBUG-28273)) + +### CMake + +* Removed support for extra generators +* Added `Follow Symbol Under Cursor` for functions, macros, targets and packages + ([QTCREATORBUG-25523](https://bugreports.qt.io/browse/QTCREATORBUG-25523), + [QTCREATORBUG-25524](https://bugreports.qt.io/browse/QTCREATORBUG-25524)) +* Added support for `CMAKE_SOURCE_DIR` and similar variables for + `Jump to File Under Cursor` + ([QTCREATORBUG-29467](https://bugreports.qt.io/browse/QTCREATORBUG-29467)) +* Added support for `CMAKE_UNITY_BUILD` + ([QTCREATORBUG-23635](https://bugreports.qt.io/browse/QTCREATORBUG-23635), + [QTCREATORBUG-26822](https://bugreports.qt.io/browse/QTCREATORBUG-26822), + [QTCREATORBUG-29080](https://bugreports.qt.io/browse/QTCREATORBUG-29080)) +* Added support for `cmake-format` configuration files + ([QTCREATORBUG-28969](https://bugreports.qt.io/browse/QTCREATORBUG-28969)) +* Added help tooltips + ([QTCREATORBUG-25780](https://bugreports.qt.io/browse/QTCREATORBUG-25780)) +* Extended context help for variables, properties and modules + +### Python + +* Added auto-detection of PySide from the installer + ([PYSIDE-2153](https://bugreports.qt.io/browse/PYSIDE-2153)) +* Added the option to forward the display for remote Linux +* Fixed PySide wheels installation on macOS + +### vcpkg + +* Added the generation of code for `CMakeLists.txt` +* Added parsing the dependencies from `vcpkg.json` manifest files +* Improved the addition of dependencies to `vcpkg.json` + +### Qt Safe Renderer + +* Added a wizard for Qt Safe Renderer 2.1 and later + +Debugging +--------- + +### C++ + +* Added support for remote Linux debugging with LLDB + +Analyzer +-------- + +### Clang + +* Fixed that error messages were not shown + ([QTCREATORBUG-29298](https://bugreports.qt.io/browse/QTCREATORBUG-29298)) + +### CTF Visualizer + +* Fixed that process and thread IDs could not be strings +* Fixed the computation of nesting levels +* Fixed a crash when zooming with a touch pad + +Terminal +-------- + +* Added mouse support +* Fixed `Ctrl+C/V` on Windows + +Version Control Systems +----------------------- + +### Git + +* Added option for ignoring whitespace changes and line moves in `Instant Blame` + ([QTCREATORBUG-29378](https://bugreports.qt.io/browse/QTCREATORBUG-29378)) + +### CVS + +* Disabled by default + +Test Integration +---------------- + +* Added an option for the number of threads used for scanning + ([QTCREATORBUG-29301](https://bugreports.qt.io/browse/QTCREATORBUG-29301)) + +Credits for these changes go to: +-------------------------------- +Aleksei German +Alessandro Portale +Ali Kianian +Amr Essam +Andre Hartmann +André Pönitz +Andreas Loth +Artem Sokolovskii +Brook Cronin +Burak Hancerli +Christian Kandeler +Christian Stenger +Cristian Adam +David Schulz +Dominic Ernst +Eike Ziller +Esa Törmänen +Friedemann Kleint +Henning Gruendl +Jaroslaw Kobus +Johnny Jazeix +Jonas Karlsson +Jussi Witick +Knud Dollereder +Leena Miettinen +Mahmoud Badri +Marco Bubke +Marcus Tillmanns +Mats Honkamaa +Mehdi Salem +Miikka Heikkinen +Olivier De Cannière +Olivier Delaune +Orgad Shaneh +Robert Löhning +Sami Shalayel +Samuel Ghinet +Semih Yavuz +Tasuku Suzuki +Thiago Macieira +Thomas Hartmann +Tim Jenssen +Tim Jenßen +Tor Arne Vestbø +Vikas Pachdha +Xavier Besson +Yasser Grimes From 0aa83222060e3e67cc8a253842526b6869bb3925 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 4 Oct 2023 10:09:09 +0200 Subject: [PATCH 1417/1777] McuSupport: Remove unused method This basically reverts e39c6d4f412607ae8d178d9be7fc4bbe3203b6b9 Change-Id: Ia0d40addc03ddefa9c1c74d8ac615ffb4f15508e Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/mcusupport/mcusupportplugin.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/plugins/mcusupport/mcusupportplugin.cpp b/src/plugins/mcusupport/mcusupportplugin.cpp index 1dd8d455566..a9f8ff0d499 100644 --- a/src/plugins/mcusupport/mcusupportplugin.cpp +++ b/src/plugins/mcusupport/mcusupportplugin.cpp @@ -40,7 +40,6 @@ #include <utils/filepath.h> #include <utils/infobar.h> -#include <utils/qtcsettings.h> #include <QAction> #include <QDateTime> @@ -115,12 +114,6 @@ McuSupportPlugin::~McuSupportPlugin() dd = nullptr; } -static bool isQtDesignStudio() -{ - QtcSettings *settings = Core::ICore::settings(); - return settings->value("QML/Designer/StandAloneMode", false).toBool(); -} - void McuSupportPlugin::initialize() { setObjectName("McuSupportPlugin"); From 4875b25e31a363beaca6f73504c9458a6b74d48e Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 4 Oct 2023 13:07:23 +0200 Subject: [PATCH 1418/1777] CMakePM: Use the cmake logo for actions Change-Id: Id19c8405e44218ad62da4d60b3d6eb71637033ad Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakeformatter.cpp | 2 ++ .../cmakeprojectmanager/cmakeprojectmanager.cpp | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeformatter.cpp b/src/plugins/cmakeprojectmanager/cmakeformatter.cpp index 38e9f0cb32c..58a3c537973 100644 --- a/src/plugins/cmakeprojectmanager/cmakeformatter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeformatter.cpp @@ -17,6 +17,7 @@ #include <coreplugin/idocument.h> #include <projectexplorer/project.h> +#include <projectexplorer/projectexplorericons.h> #include <projectexplorer/projectnodes.h> #include <projectexplorer/projecttree.h> @@ -92,6 +93,7 @@ public: ActionContainer *menu = ActionManager::createMenu(Constants::CMAKEFORMATTER_MENU_ID); menu->menu()->setTitle(Tr::tr("CMakeFormatter")); + menu->menu()->setIcon(ProjectExplorer::Icons::CMAKE_LOGO.icon()); menu->setOnAllDisabledBehavior(ActionContainer::Show); ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 99ba8b972df..640fb53edb4 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -27,6 +27,7 @@ #include <projectexplorer/buildmanager.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/projectexplorericons.h> #include <projectexplorer/projectmanager.h> #include <projectexplorer/projecttree.h> #include <projectexplorer/runcontrol.h> @@ -46,14 +47,19 @@ using namespace Utils; namespace CMakeProjectManager::Internal { CMakeManager::CMakeManager() - : m_runCMakeAction(new QAction(QIcon(), Tr::tr("Run CMake"), this)) + : m_runCMakeAction( + new QAction(ProjectExplorer::Icons::CMAKE_LOGO.icon(), Tr::tr("Run CMake"), this)) , m_clearCMakeCacheAction(new QAction(QIcon(), Tr::tr("Clear CMake Configuration"), this)) - , m_runCMakeActionContextMenu(new QAction(QIcon(), Tr::tr("Run CMake"), this)) + , m_runCMakeActionContextMenu( + new QAction(ProjectExplorer::Icons::CMAKE_LOGO.icon(), Tr::tr("Run CMake"), this)) , m_rescanProjectAction(new QAction(QIcon(), Tr::tr("Rescan Project"), this)) , m_reloadCMakePresetsAction( new QAction(Utils::Icons::RELOAD.icon(), Tr::tr("Reload CMake Presets"), this)) - , m_cmakeProfilerAction(new QAction(QIcon(), Tr::tr("CMake Profiler"), this)) - , m_cmakeDebuggerAction(new QAction(QIcon(), Tr::tr("Start CMake Debugging"), this)) + , m_cmakeProfilerAction( + new QAction(ProjectExplorer::Icons::CMAKE_LOGO.icon(), Tr::tr("CMake Profiler"), this)) + , m_cmakeDebuggerAction(new QAction(ProjectExplorer::Icons::CMAKE_LOGO.icon(), + Tr::tr("Start CMake Debugging"), + this)) { Core::ActionContainer *mbuild = Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT); From 4feafe9db278ce96d19a6924f26918e6a1e7c32d Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 4 Oct 2023 21:05:49 +0200 Subject: [PATCH 1419/1777] ScreenRecorder: Assign "Tools/Record..." a menu icon Change-Id: I66102d5919c83f50145d549c0ae39ff447309b33 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/screenrecorder/screenrecorderplugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/screenrecorder/screenrecorderplugin.cpp b/src/plugins/screenrecorder/screenrecorderplugin.cpp index a0993593f04..e5160eec348 100644 --- a/src/plugins/screenrecorder/screenrecorderplugin.cpp +++ b/src/plugins/screenrecorder/screenrecorderplugin.cpp @@ -20,6 +20,7 @@ #include <utils/styledbar.h> #include <utils/stylehelper.h> #include <utils/temporaryfile.h> +#include <utils/utilsicons.h> #include <solutions/spinner/spinner.h> @@ -109,7 +110,9 @@ class ScreenRecorderPlugin final : public ExtensionSystem::IPlugin public: void initialize() final { - auto action = new QAction(Tr::tr("Record Screen..."), this); + const QIcon menuIcon = Icon({{":/utils/images/filledcircle.png", Theme::IconsStopColor}}, + Icon::MenuTintedStyle).icon(); + auto action = new QAction(menuIcon, Tr::tr("Record Screen..."), this); Command *cmd = ActionManager::registerAction(action, Constants::ACTION_ID, Context(Core::Constants::C_GLOBAL)); connect(action, &QAction::triggered, this, &ScreenRecorderPlugin::showDialogOrSettings); From f630964139419aa236d5bf091845fee6d1cd0889 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 4 Oct 2023 21:24:01 +0200 Subject: [PATCH 1420/1777] ScreenRecorder: Make the "Stop" tool button icon red This is more consistent. Change-Id: I717b85fa696b29d8a6d5cfff2cd583ecb44a445e Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/screenrecorder/record.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index 76013b09311..936270284a8 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -203,7 +203,7 @@ RecordWidget::RecordWidget(const FilePath &recordFile, QWidget *parent) auto stopButton = new QToolButton; stopButton->setIcon(Icon({{":/utils/images/stop_small.png", - Theme::IconsBaseColor}}).icon()); + Theme::IconsStopToolBarColor}}).icon()); stopButton->setEnabled(false); auto progressLabel = new TimeLabel(m_clipInfo); From d0f2d8dd354939e92b40f104215d4fce5f770573 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 4 Oct 2023 21:38:28 +0200 Subject: [PATCH 1421/1777] ScreenRecorder: Fix invalid "-1" CaptureType setting This fixes the issue that the SelectionAspect was read incorrectly, causing an invalid settings entry of "-1". Also the settings key changed for the quite probable case that some early testers have the invalid "-1" in their settings. Change-Id: I97061e2787068bc3bb6cf4bd2d7b0aab767598d5 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/screenrecorder/record.cpp | 2 +- .../screenrecorder/screenrecordersettings.cpp | 30 +++++++++++-------- .../screenrecorder/screenrecordersettings.h | 3 +- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index 936270284a8..fdbc66d0f0d 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -325,7 +325,7 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const const QString captureCursorStr = Internal::settings().captureCursor() ? "1" : "0"; QStringList videoGrabParams; - switch (Internal::settings().captureType()) { + switch (Internal::settings().volatileScreenCaptureType()) { case Internal::CaptureType::X11grab: { const QScreen *screen = QGuiApplication::screens()[rS.screenId]; const QPoint screenTopLeft = screen->geometry().topLeft(); diff --git a/src/plugins/screenrecorder/screenrecordersettings.cpp b/src/plugins/screenrecorder/screenrecordersettings.cpp index 812b8d4d9dd..34579a3412d 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.cpp +++ b/src/plugins/screenrecorder/screenrecordersettings.cpp @@ -77,28 +77,26 @@ ScreenRecorderSettings::ScreenRecorderSettings() captureMouseClicks.setLabel(Tr::tr("Capture the screen mouse clicks")); captureMouseClicks.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); - captureType.setSettingsKey("CaptureType"); - captureType.setLabelText(Tr::tr("Capture device/filter:")); - captureType.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - captureType.setVisible(false); + screenCaptureType.setSettingsKey("ScreenCaptureType"); + screenCaptureType.setLabelText(Tr::tr("Capture device/filter:")); + screenCaptureType.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + screenCaptureType.setDefaultValue(0); + screenCaptureType.setVisible(false); switch (HostOsInfo::hostOs()) { case OsTypeLinux: - captureType.addOption({"x11grab", {}, CaptureType::X11grab}); - captureType.setDefaultValue(CaptureType::X11grab); + screenCaptureType.addOption({"x11grab", {}, CaptureType::X11grab}); break; case OsTypeWindows: - captureType.addOption({"ddagrab", {}, CaptureType::Ddagrab}); - captureType.setDefaultValue(CaptureType::Ddagrab); + screenCaptureType.addOption({"ddagrab", {}, CaptureType::Ddagrab}); break; case OsTypeMac: - captureType.addOption({"AVFoundation", {}, CaptureType::AVFoundation}); - captureType.setDefaultValue(CaptureType::AVFoundation); + screenCaptureType.addOption({"AVFoundation", {}, CaptureType::AVFoundation}); break; default: break; } auto setCaptureMouseClicksVisible = [this] { - const bool visible = captureType.volatileValue() == CaptureType::AVFoundation; + const bool visible = volatileScreenCaptureType() == CaptureType::AVFoundation; captureMouseClicks.setVisible(visible); }; @@ -185,7 +183,7 @@ ScreenRecorderSettings::ScreenRecorderSettings() Column { captureCursor, captureMouseClicks, - Row { captureType, st }, + Row { screenCaptureType, st }, Row { enableFileSizeLimit, fileSizeLimit, st }, Row { enableRtBuffer, rtBufferSize, st }, }, @@ -205,7 +203,7 @@ ScreenRecorderSettings::ScreenRecorderSettings() readSettings(); setCaptureMouseClicksVisible(); - connect(&captureType, &SelectionAspect::volatileValueChanged, this, + connect(&screenCaptureType, &SelectionAspect::volatileValueChanged, this, setCaptureMouseClicksVisible); } @@ -247,6 +245,12 @@ void ScreenRecorderSettings::applyRecordSettings(const RecordSettings &settings) recordFrameRate.writeToSettingsImmediatly(); } +CaptureType ScreenRecorderSettings::volatileScreenCaptureType() const +{ + const QVariant value = screenCaptureType.itemValueForIndex(screenCaptureType.volatileValue()); + return value.value<CaptureType>(); +} + class ScreenRecorderSettingsPage : public Core::IOptionsPage { public: diff --git a/src/plugins/screenrecorder/screenrecordersettings.h b/src/plugins/screenrecorder/screenrecordersettings.h index dbdda8311c9..7ab5ac4bd57 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.h +++ b/src/plugins/screenrecorder/screenrecordersettings.h @@ -28,11 +28,12 @@ public: static RecordSettings sanitizedRecordSettings(const RecordSettings &settings); RecordSettings recordSettings() const; void applyRecordSettings(const RecordSettings &settings); + CaptureType volatileScreenCaptureType() const; // Visible in Settings page Utils::FilePathAspect ffmpegTool{this}; Utils::FilePathAspect ffprobeTool{this}; - Utils::SelectionAspect captureType{this}; + Utils::SelectionAspect screenCaptureType{this}; Utils::BoolAspect captureCursor{this}; Utils::BoolAspect captureMouseClicks{this}; Utils::BoolAspect enableFileSizeLimit{this}; From 58efc778f5014d3fbea21cfbcc121c2643c4518d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 2 Oct 2023 17:27:26 +0200 Subject: [PATCH 1422/1777] Core: Swap ICore/MainWindow "ownership" Change-Id: Iba387781624d88f814293af0f7b7ed697da1d822 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/icore.cpp | 100 ++++++++++++++----------------- 1 file changed, 46 insertions(+), 54 deletions(-) diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 6d302ac8776..1df14f631b0 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -230,8 +230,13 @@ namespace Internal { class MainWindow : public AppMainWindow { public: - MainWindow(); - ~MainWindow() override; + MainWindow() + { + setWindowTitle(QGuiApplication::applicationDisplayName()); + setDockNestingEnabled(true); + setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); + setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea); + } private: void closeEvent(QCloseEvent *event) override; @@ -243,7 +248,6 @@ private: // The Core Singleton static ICore *m_core = nullptr; -static MainWindow *m_mainwindow = nullptr; static NewDialog *defaultDialogFactory(QWidget *parent) { @@ -255,9 +259,7 @@ namespace Internal { class ICorePrivate : public QObject { public: - explicit ICorePrivate(MainWindow *mainWindow) - : q(mainWindow) - {} + ICorePrivate() {} ~ICorePrivate(); @@ -292,7 +294,7 @@ public: void updateModeSelectorStyleMenu(); - MainWindow *q = nullptr; + MainWindow *m_mainwindow = nullptr; QTimer m_trimTimer; QStringList m_aboutInformation; Context m_highPrioAdditionalContexts; @@ -392,7 +394,9 @@ QWidget *ICore::newItemDialog() ICore::ICore() { m_core = this; - m_mainwindow = new MainWindow; + + d = new ICorePrivate; + d->init(); // Separation needed for now as the call triggers other MainWindow calls. connect(PluginManager::instance(), &PluginManager::testsFinished, this, [this](int failedTests) { @@ -415,9 +419,8 @@ ICore::ICore() */ ICore::~ICore() { - delete m_mainwindow; + delete d; m_core = nullptr; - m_mainwindow = nullptr; } /*! @@ -525,7 +528,7 @@ bool ICore::showWarningWithOptions(const QString &title, const QString &text, const QString &details, Id settingsId, QWidget *parent) { if (!parent) - parent = m_mainwindow; + parent = d->m_mainwindow; QMessageBox msgBox(QMessageBox::Warning, title, text, QMessageBox::Ok, parent); msgBox.setEscapeButton(QMessageBox::Ok); @@ -854,7 +857,7 @@ QWidget *ICore::currentContextWidget() */ QMainWindow *ICore::mainWindow() { - return m_mainwindow; + return d->m_mainwindow; } /*! @@ -866,7 +869,7 @@ QWidget *ICore::dialogParent() if (!active) active = QApplication::activeWindow(); if (!active || (active && active->windowFlags().testAnyFlags(Qt::SplashScreen | Qt::Popup))) - active = m_mainwindow; + active = d->m_mainwindow; return active; } @@ -899,8 +902,8 @@ void ICore::raiseWindow(QWidget *widget) QWidget *window = widget->window(); if (!window) return; - if (window == m_mainwindow) { - m_mainwindow->raiseWindow(); + if (window == d->m_mainwindow) { + d->m_mainwindow->raiseWindow(); } else { window->raise(); window->activateWindow(); @@ -909,7 +912,7 @@ void ICore::raiseWindow(QWidget *widget) void ICore::raiseMainWindow() { - m_mainwindow->raiseWindow(); + d->m_mainwindow->raiseWindow(); } /*! @@ -1174,6 +1177,8 @@ namespace Internal { void ICorePrivate::init() { + m_mainwindow = new MainWindow; + m_progressManager = new ProgressManagerPrivate; m_jsExpander = JsExpander::createGlobalJsExpander(); m_vcsManager = new VcsManager; @@ -1211,7 +1216,7 @@ void ICorePrivate::init() QApplication::setStyle(new ManhattanStyle(baseName)); - m_modeManager = new ModeManager(q, m_modeStack); + m_modeManager = new ModeManager(m_mainwindow, m_modeStack); connect(m_modeStack, &FancyTabWidget::topAreaClicked, this, [](Qt::MouseButton, Qt::KeyboardModifiers modifiers) { if (modifiers & Qt::ShiftModifier) { QColor color = QColorDialog::getColor(StyleHelper::requestedBaseColor(), ICore::dialogParent()); @@ -1220,6 +1225,8 @@ void ICorePrivate::init() } }); + m_mainwindow->setCentralWidget(d->m_modeStack); + registerDefaultContainers(); registerDefaultActions(); @@ -1231,7 +1238,7 @@ void ICorePrivate::init() m_editorManager = new EditorManager(this); m_externalToolManager = new ExternalToolManager(); - m_progressManager->progressView()->setParent(q); + m_progressManager->progressView()->setParent(m_mainwindow); connect(qApp, &QApplication::focusChanged, this, &ICorePrivate::updateFocusWidget); @@ -1265,19 +1272,7 @@ void ICorePrivate::init() } } -MainWindow::MainWindow() -{ - m_mainwindow = this; - d = new ICorePrivate(this); - d->init(); // Separation needed for now as the call triggers other MainWindow calls. - setWindowTitle(QGuiApplication::applicationDisplayName()); - setDockNestingEnabled(true); - setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); - setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea); - - setCentralWidget(d->m_modeStack); -} NavigationWidget *ICorePrivate::navigationWidget(Side side) const { @@ -1290,12 +1285,6 @@ void ICorePrivate::setSidebarVisible(bool visible, Side side) navigationWidget(side)->setShown(visible); } -MainWindow::~MainWindow() -{ - delete d; - d = nullptr; -} - ICorePrivate::~ICorePrivate() { // explicitly delete window support, because that calls methods from ICore that call methods @@ -1343,6 +1332,9 @@ ICorePrivate::~ICorePrivate() delete m_jsExpander; m_jsExpander = nullptr; + + delete m_mainwindow; + m_mainwindow = nullptr; } } // Internal @@ -1358,7 +1350,7 @@ void ICore::extensionsInitialized() { EditorManagerPrivate::extensionsInitialized(); MimeTypeSettings::restoreSettings(); - d->m_windowSupport = new WindowSupport(m_mainwindow, Context("Core.MainWindow")); + d->m_windowSupport = new WindowSupport(d->m_mainwindow, Context("Core.MainWindow")); d->m_windowSupport->setCloseActionEnabled(false); OutputPaneManager::initialize(); VcsManager::extensionsInitialized(); @@ -1380,9 +1372,9 @@ void ICore::aboutToShutdown() { disconnect(qApp, &QApplication::focusChanged, d, &ICorePrivate::updateFocusWidget); for (auto contextPair : d->m_contextWidgets) - disconnect(contextPair.second, &QObject::destroyed, m_mainwindow, nullptr); + disconnect(contextPair.second, &QObject::destroyed, d->m_mainwindow, nullptr); d->m_activeContext.clear(); - m_mainwindow->hide(); + d->m_mainwindow->hide(); } void ICore::restartTrimmer() @@ -1459,7 +1451,7 @@ void MainWindow::mousePressEvent(QMouseEvent *event) void ICorePrivate::openDroppedFiles(const QList<DropSupport::FileSpec> &files) { - q->raiseWindow(); + m_mainwindow->raiseWindow(); const FilePaths filePaths = Utils::transform(files, &DropSupport::FileSpec::filePath); ICore::openFiles(filePaths, ICore::SwitchMode); } @@ -1469,7 +1461,7 @@ void ICorePrivate::registerDefaultContainers() ActionContainer *menubar = ActionManager::createMenuBar(Constants::MENU_BAR); if (!HostOsInfo::isMacHost()) // System menu bar on Mac - q->setMenuBar(menubar->menuBar()); + m_mainwindow->setMenuBar(menubar->menuBar()); menubar->appendGroup(Constants::G_FILE); menubar->appendGroup(Constants::G_EDIT); menubar->appendGroup(Constants::G_VIEW); @@ -2100,12 +2092,12 @@ void ICore::exit() // so to prevent the deleting of that object we // just append it QMetaObject::invokeMethod( - m_mainwindow, + d->m_mainwindow, [] { // Modal dialogs block the close event. So close them, in case this was triggered from // a RestartDialog in the settings dialog. acceptModalDialogs(); - m_mainwindow->close(); + d->m_mainwindow->close(); }, Qt::QueuedConnection); } @@ -2211,7 +2203,7 @@ void ICorePrivate::updateFocusWidget(QWidget *old, QWidget *now) } // ignore toplevels that define no context, like popups without parent - if (!newContext.isEmpty() || QApplication::focusWidget() == q->focusWidget()) + if (!newContext.isEmpty() || QApplication::focusWidget() == m_mainwindow->focusWidget()) updateContextObject(newContext); } @@ -2281,10 +2273,10 @@ void ICorePrivate::saveWindowSettings() // To be able to restore the correct non-full screen geometry, we have to put // the window out of full screen before saving the geometry. // Works around QTBUG-45241 - if (Utils::HostOsInfo::isMacHost() && q->isFullScreen()) - q->setWindowState(q->windowState() & ~Qt::WindowFullScreen); - settings->setValue(windowGeometryKey, q->saveGeometry()); - settings->setValue(windowStateKey, q->saveState()); + if (Utils::HostOsInfo::isMacHost() && m_mainwindow->isFullScreen()) + m_mainwindow->setWindowState(m_mainwindow->windowState() & ~Qt::WindowFullScreen); + settings->setValue(windowGeometryKey, m_mainwindow->saveGeometry()); + settings->setValue(windowStateKey, m_mainwindow->saveState()); settings->setValue(modeSelectorLayoutKey, int(ModeManager::modeStyle())); settings->endGroup(); @@ -2357,7 +2349,7 @@ void ICorePrivate::aboutToShowRecentFiles() void ICorePrivate::aboutQtCreator() { if (!m_versionDialog) { - m_versionDialog = new VersionDialog(q); + m_versionDialog = new VersionDialog(m_mainwindow); connect(m_versionDialog, &QDialog::finished, this, &ICorePrivate::destroyVersionDialog); ICore::registerWindow(m_versionDialog, Context("Core.VersionDialog")); @@ -2377,7 +2369,7 @@ void ICorePrivate::destroyVersionDialog() void ICorePrivate::aboutPlugins() { - PluginDialog dialog(q); + PluginDialog dialog(m_mainwindow); dialog.exec(); } @@ -2533,11 +2525,11 @@ void ICorePrivate::restoreWindowState() NANOTRACE_SCOPE("Core", "MainWindow::restoreWindowState"); QtcSettings *settings = PluginManager::settings(); settings->beginGroup(settingsGroup); - if (!q->restoreGeometry(settings->value(windowGeometryKey).toByteArray())) - q->resize(1260, 700); // size without window decoration - q->restoreState(settings->value(windowStateKey).toByteArray()); + if (!m_mainwindow->restoreGeometry(settings->value(windowGeometryKey).toByteArray())) + m_mainwindow->resize(1260, 700); // size without window decoration + m_mainwindow->restoreState(settings->value(windowStateKey).toByteArray()); settings->endGroup(); - q->show(); + m_mainwindow->show(); StatusBarManager::restoreSettings(); } From 4e8bcc40e789bb51aff04518fbd76cab9ad4377a Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 4 Oct 2023 17:01:15 +0200 Subject: [PATCH 1423/1777] ModeManager: Remove unused constructor argument Change-Id: I7856a832db61a27ab5fdabf79ff9a359acdb866a Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/coreplugin/icore.cpp | 2 +- src/plugins/coreplugin/modemanager.cpp | 5 +---- src/plugins/coreplugin/modemanager.h | 4 +--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 1df14f631b0..1c2a1a0dc8d 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -1216,7 +1216,7 @@ void ICorePrivate::init() QApplication::setStyle(new ManhattanStyle(baseName)); - m_modeManager = new ModeManager(m_mainwindow, m_modeStack); + m_modeManager = new ModeManager(m_modeStack); connect(m_modeStack, &FancyTabWidget::topAreaClicked, this, [](Qt::MouseButton, Qt::KeyboardModifiers modifiers) { if (modifiers & Qt::ShiftModifier) { QColor color = QColorDialog::getColor(StyleHelper::requestedBaseColor(), ICore::dialogParent()); diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index 80ecfc004df..cebc5f8422d 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -68,7 +68,6 @@ struct ModeManagerPrivate void activateModeHelper(Id id); void extensionsInitializedHelper(); - Internal::MainWindow *m_mainWindow; Internal::FancyTabWidget *m_modeStack; Internal::FancyActionBar *m_actionBar; QMap<QAction*, int> m_actions; @@ -101,12 +100,10 @@ void ModeManagerPrivate::showMenu(int index, QMouseEvent *event) m_modes.at(index)->menu()->popup(event->globalPosition().toPoint()); } -ModeManager::ModeManager(Internal::MainWindow *mainWindow, - Internal::FancyTabWidget *modeStack) +ModeManager::ModeManager(Internal::FancyTabWidget *modeStack) { m_instance = this; d = new ModeManagerPrivate(); - d->m_mainWindow = mainWindow; d->m_modeStack = modeStack; d->m_oldCurrent = -1; d->m_actionBar = new Internal::FancyActionBar(modeStack); diff --git a/src/plugins/coreplugin/modemanager.h b/src/plugins/coreplugin/modemanager.h index 9ec8812ad8d..a4a1a26ebc3 100644 --- a/src/plugins/coreplugin/modemanager.h +++ b/src/plugins/coreplugin/modemanager.h @@ -21,7 +21,6 @@ class IMode; namespace Internal { class FancyTabWidget; class ICorePrivate; -class MainWindow; } class CORE_EXPORT ModeManager : public QObject @@ -60,7 +59,7 @@ signals: void currentModeChanged(Utils::Id mode, Utils::Id oldMode = {}); private: - explicit ModeManager(Internal::MainWindow *mainWindow, Internal::FancyTabWidget *modeStack); + explicit ModeManager(Internal::FancyTabWidget *modeStack); ~ModeManager() override; static void extensionsInitialized(); @@ -71,7 +70,6 @@ private: friend class ICore; friend class IMode; - friend class Internal::MainWindow; friend class Internal::ICorePrivate; }; From 257af1ebd80e0c0b9ac2e4104c6aea5c4d9e6281 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 4 Oct 2023 17:04:58 +0200 Subject: [PATCH 1424/1777] Core: Don't mark two ModeManager functions as slot Not needed. Change-Id: I9ed5c1dd8f36e4bec101732f37a10f399d9c2b30 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/coreplugin/modemanager.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/coreplugin/modemanager.h b/src/plugins/coreplugin/modemanager.h index a4a1a26ebc3..96b8b252c23 100644 --- a/src/plugins/coreplugin/modemanager.h +++ b/src/plugins/coreplugin/modemanager.h @@ -48,7 +48,6 @@ public: static void removeMode(IMode *mode); -public slots: static void setModeStyle(Style layout); static void cycleModeStyle(); From 64870f9163327290e79b9b59ac76c927a43e617b Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 4 Oct 2023 17:41:42 +0200 Subject: [PATCH 1425/1777] Utils: Move defaultHighDpiScaleFactorRoundingPolicy() to StyleHelper ... from HostOSInfo. A better suited place. Amends: 3726f0d6c1d05452f070b911683c51fe95df65c4 Change-Id: I5ba052603ae438b9347f1091088f0d105d19f587 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/app/main.cpp | 3 ++- src/libs/utils/hostosinfo.h | 6 ------ src/libs/utils/stylehelper.cpp | 6 ++++++ src/libs/utils/stylehelper.h | 3 +++ src/plugins/coreplugin/generalsettings.cpp | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index ce09e0d6ada..5acc468d9c5 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -19,6 +19,7 @@ #include <utils/hostosinfo.h> #include <utils/qtcsettings.h> #include <utils/singleton.h> +#include <utils/stylehelper.h> #include <utils/temporarydirectory.h> #include <utils/terminalcommand.h> @@ -286,7 +287,7 @@ static void setHighDpiEnvironmentVariable() std::unique_ptr<Utils::QtcSettings> settings(createUserSettings()); using Policy = Qt::HighDpiScaleFactorRoundingPolicy; - const Policy defaultPolicy = Utils::HostOsInfo::defaultHighDpiScaleFactorRoundingPolicy(); + const Policy defaultPolicy = Utils::StyleHelper::defaultHighDpiScaleFactorRoundingPolicy(); const Policy userPolicy = settings->value("Core/HighDpiScaleFactorRoundingPolicy", int(defaultPolicy)).value<Policy>(); QGuiApplication::setHighDpiScaleFactorRoundingPolicy(userPolicy); diff --git a/src/libs/utils/hostosinfo.h b/src/libs/utils/hostosinfo.h index 2c5f54b447f..44880f7885c 100644 --- a/src/libs/utils/hostosinfo.h +++ b/src/libs/utils/hostosinfo.h @@ -90,12 +90,6 @@ public: static const FilePath &root(); - static constexpr Qt::HighDpiScaleFactorRoundingPolicy - defaultHighDpiScaleFactorRoundingPolicy() { - return isMacHost() ? Qt::HighDpiScaleFactorRoundingPolicy::Unset - : Qt::HighDpiScaleFactorRoundingPolicy::PassThrough; - } - private: static Qt::CaseSensitivity m_overrideFileNameCaseSensitivity; static bool m_useOverrideFileNameCaseSensitivity; diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp index 2f205da9359..506601e8260 100644 --- a/src/libs/utils/stylehelper.cpp +++ b/src/libs/utils/stylehelper.cpp @@ -712,6 +712,12 @@ bool StyleHelper::isQDSTheme() return creatorTheme() ? creatorTheme()->flag(Theme::QDSTheme) : false; } +Qt::HighDpiScaleFactorRoundingPolicy StyleHelper::defaultHighDpiScaleFactorRoundingPolicy() +{ + return HostOsInfo::isMacHost() ? Qt::HighDpiScaleFactorRoundingPolicy::Unset + : Qt::HighDpiScaleFactorRoundingPolicy::PassThrough; +} + QIcon StyleHelper::getIconFromIconFont(const QString &fontName, const QList<IconFontHelper> ¶meters) { QFontDatabase a; diff --git a/src/libs/utils/stylehelper.h b/src/libs/utils/stylehelper.h index 2b898cb1049..bfca04e2914 100644 --- a/src/libs/utils/stylehelper.h +++ b/src/libs/utils/stylehelper.h @@ -107,6 +107,9 @@ QTCREATOR_UTILS_EXPORT void setPanelWidgetSingleRow(QWidget *widget, bool value QTCREATOR_UTILS_EXPORT bool isQDSTheme(); +QTCREATOR_UTILS_EXPORT + Qt::HighDpiScaleFactorRoundingPolicy defaultHighDpiScaleFactorRoundingPolicy(); + class IconFontHelper { public: diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 97b5c222cdd..e7da40832d7 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -148,7 +148,7 @@ GeneralSettingsWidget::GeneralSettingsWidget() const Policy userPolicy = ICore::settings()->value(settingsKeyDpiPolicy, - int(HostOsInfo::defaultHighDpiScaleFactorRoundingPolicy())) + int(StyleHelper::defaultHighDpiScaleFactorRoundingPolicy())) .value<Policy>(); m_policyComboBox->setCurrentIndex(m_policyComboBox->findData(int(userPolicy))); @@ -343,7 +343,7 @@ void GeneralSettingsWidget::setDpiPolicy(Qt::HighDpiScaleFactorRoundingPolicy po dialog.exec(); } settings->setValueWithDefault(settingsKeyDpiPolicy, int(policy), - int(HostOsInfo::defaultHighDpiScaleFactorRoundingPolicy())); + int(StyleHelper::defaultHighDpiScaleFactorRoundingPolicy())); } void GeneralSettings::applyToolbarStyleFromSettings() From a1ac447d90cca9fce7fe36f87fdaaeaa71588da2 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Mon, 2 Oct 2023 16:06:03 +0200 Subject: [PATCH 1426/1777] DAP: Fix highlighting changed variables Change-Id: Idae543ba3af1a7c02c22d6619857cf0cf8b04f28 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/debugger/dap/dapengine.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 686df98c472..b39e664f211 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -633,6 +633,7 @@ void DapEngine::handleScopesResponse(const QJsonObject &response) if (!response.value("success").toBool()) return; + watchHandler()->resetValueCache(); watchHandler()->notifyUpdateStarted(); QJsonArray scopes = response.value("body").toObject().value("scopes").toArray(); @@ -832,10 +833,12 @@ void DapEngine::refreshLocals(const QJsonArray &variables) watchHandler()->insertItem(item); } - QModelIndex idx = watchHandler()->model()->indexForItem(currentItem); - if (currentItem && idx.isValid() && idx.data(LocalsExpandedRole).toBool()) { - emit watchHandler()->model()->inameIsExpanded(currentItem->iname); - emit watchHandler()->model()->itemIsExpanded(idx); + if (currentItem) { + QModelIndex idx = watchHandler()->model()->indexForItem(currentItem); + if (idx.isValid() && idx.data(LocalsExpandedRole).toBool()) { + emit watchHandler()->model()->inameIsExpanded(currentItem->iname); + emit watchHandler()->model()->itemIsExpanded(idx); + } } if (m_variablesHandler->queueSize() == 1 && currentItem == nullptr) { From 664be8ed48db0062813dd8d5a0bb83c71067aced Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 5 Oct 2023 10:04:36 +0200 Subject: [PATCH 1427/1777] Utils: Remove an QTC_ASSERT In principle that'd be fine there, but the host equality is too strong in some cases (isSameDevice should help), but it also still gets fed more or less random content to create display names. Finding the exact condition is tricky, and the remaining path is good enough. Change-Id: I4ec29c2f259a7b761d00012bcd9a6d69a057043c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/filepath.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 26d6d667f90..1cd57e581b6 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -1554,11 +1554,6 @@ QString FilePath::calcRelativePath(const QString &absolutePath, const QString &a */ FilePath FilePath::withNewMappedPath(const FilePath &newPath) const { - const bool sameDevice = newPath.scheme() == scheme() && newPath.host() == host(); - if (sameDevice) - return newPath; - // TODO: converting paths between different non local devices is still unsupported - QTC_CHECK(!newPath.needsDevice() || !needsDevice()); FilePath res; res.setParts(scheme(), host(), fileAccess()->mapToDevicePath(newPath.path())); return res; From d79c69918f0b912e737f0bb6b00d39aa5b1fd4ad Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 4 Oct 2023 10:01:44 +0200 Subject: [PATCH 1428/1777] Docker: Add clangd path to sdktool This patch also allows the user/installer to supply a path without the device root, to make it easier for the installer. Fixes: QTCREATORBUG-29694 Change-Id: I641b06dd2f4a9d94079fb26f2ed949c5246c1c1e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/docker/dockerdevice.cpp | 25 ++++++++++++++++++++---- src/tools/sdktool/adddeviceoperation.cpp | 15 ++++++++++++-- src/tools/sdktool/adddeviceoperation.h | 1 + 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 22120f74054..cdb2e8b95e8 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -232,13 +232,28 @@ DockerDeviceSettings::DockerDeviceSettings() &StringSelectionAspect::refill); clangdExecutable.setValidationFunction( - [](const QString &newValue) -> FancyLineEdit::AsyncValidationFuture { - return asyncRun([newValue]() -> expected_str<QString> { + [this](const QString &newValue) -> FancyLineEdit::AsyncValidationFuture { + const FilePath rootPath = FilePath::fromParts(Constants::DOCKER_DEVICE_SCHEME, + repoAndTagEncoded(), + u"/"); + return asyncRun([rootPath, newValue]() -> expected_str<QString> { + QString changedValue = newValue; + FilePath path = FilePath::fromUserInput(newValue); + if (!path.needsDevice()) { + const FilePath onDevicePath = rootPath.withNewMappedPath(path); + if (onDevicePath.exists()) { + changedValue = onDevicePath.toUserOutput(); + path = onDevicePath; + } else { + return make_unexpected( + Tr::tr("Path \"%1\" does not exist.").arg(onDevicePath.toUserOutput())); + } + } QString error; - bool result = checkClangdVersion(FilePath::fromUserInput(newValue), &error); + bool result = checkClangdVersion(path, &error); if (!result) return make_unexpected(error); - return newValue; + return changedValue; }); }); @@ -320,6 +335,8 @@ public: { if (deviceSettings->clangdExecutable().isEmpty()) return std::nullopt; + if (!deviceSettings->clangdExecutable().needsDevice()) + return deviceSettings->rootPath().withNewMappedPath(deviceSettings->clangdExecutable()); return deviceSettings->clangdExecutable(); } diff --git a/src/tools/sdktool/adddeviceoperation.cpp b/src/tools/sdktool/adddeviceoperation.cpp index 938ea13cc6d..4838e071058 100644 --- a/src/tools/sdktool/adddeviceoperation.cpp +++ b/src/tools/sdktool/adddeviceoperation.cpp @@ -58,6 +58,7 @@ QString AddDeviceOperation::argumentsHelpText() const " --dockerRepo <STRING> Docker image repo.\n" " --dockerTag <STRING> Docker image tag.\n" " --dockerMappedPaths <STRING> Docker mapped paths (semi-colon separated).\n" + " --dockerClangdExecutable <STRING> Path to clangd inside the docker " " <KEY> <TYPE:VALUE> extra key value pairs\n"); } @@ -219,6 +220,14 @@ bool AddDeviceOperation::setArguments(const QStringList &args) continue; } + if (current == QLatin1String("--dockerClangdExecutable")) { + if (next.isNull()) + return false; + ++i; // skip next; + m_clangdExecutable = next; + continue; + } + if (current == QLatin1String("--dockerRepo")) { if (next.isNull()) return false; @@ -292,14 +301,14 @@ void AddDeviceOperation::unittest() devData.m_dockerMappedPaths = QStringList{"/opt", "/data"}; devData.m_dockerRepo = "repo"; devData.m_dockerTag = "tag"; - + devData.m_clangdExecutable = "clangdexe"; QVariantMap result = devData.addDevice(map); QVariantMap data = result.value(QLatin1String(DEVICEMANAGER_ID)).toMap(); QVariantList devList = data.value(QLatin1String(DEVICE_LIST_ID)).toList(); QCOMPARE(devList.count(), 1); QVariantMap dev = devList.at(0).toMap(); - QCOMPARE(dev.count(), 20); + QCOMPARE(dev.count(), 21); QCOMPARE(dev.value(QLatin1String("Authentication")).toInt(), 2); QCOMPARE(dev.value(QLatin1String("DebugServerKey")).toString(), QLatin1String("debugServer")); QCOMPARE(dev.value(QLatin1String("FreePortsSpec")).toString(), QLatin1String("ports")); @@ -317,6 +326,7 @@ void AddDeviceOperation::unittest() QCOMPARE(dev.value(QLatin1String("Version")).toInt(), 6); QCOMPARE(dev.value(QLatin1String("DockerDeviceDataRepo")).toString(), "repo"); QCOMPARE(dev.value(QLatin1String("DockerDeviceDataTag")).toString(), "tag"); + QCOMPARE(dev.value(QLatin1String("DockerDeviceClangDExecutable")).toString(), "clangdexe"); const QStringList paths = dev.value(QLatin1String("DockerDeviceMappedPaths")).toStringList(); QCOMPARE(paths, QStringList({"/opt", "/data"})); @@ -353,6 +363,7 @@ QVariantMap AddDeviceData::addDevice(const QVariantMap &map) const dev.append(KeyValuePair(QLatin1String("Uname"), QVariant(m_uname))); dev.append(KeyValuePair(QLatin1String("Version"), QVariant(m_version))); dev.append(KeyValuePair(QLatin1String("DockerDeviceMappedPaths"), QVariant(m_dockerMappedPaths))); + dev.append(KeyValuePair(QLatin1String("DockerDeviceClangDExecutable"), QVariant(m_clangdExecutable))); dev.append(KeyValuePair(QLatin1String("DockerDeviceDataRepo"), QVariant(m_dockerRepo))); dev.append(KeyValuePair(QLatin1String("DockerDeviceDataTag"), QVariant(m_dockerTag))); dev.append(m_extra); diff --git a/src/tools/sdktool/adddeviceoperation.h b/src/tools/sdktool/adddeviceoperation.h index d7ae62d235c..8ddbf0069d2 100644 --- a/src/tools/sdktool/adddeviceoperation.h +++ b/src/tools/sdktool/adddeviceoperation.h @@ -43,6 +43,7 @@ public: QStringList m_dockerMappedPaths; QString m_dockerRepo; QString m_dockerTag; + QString m_clangdExecutable; KeyValuePairList m_extra; }; From dbfaa6a842dcbfc04d524d5f14247e74997867e5 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 5 Oct 2023 08:59:51 +0200 Subject: [PATCH 1429/1777] ScreenRecorder: Add gdigrab as alternative option on Windows Some ffmpeg binaries come without the ddagrab filter, e.g. the ffmpeg binary that is contained in the latest ImageMagick package for Windows. Therefore, offer the older and omnipresent "gdigrab" device option as an alternative, chosable via ComboBox in the settings. Change-Id: Idc5f8e2a6597d93f79a603733456f83a90c31505 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/screenrecorder/record.cpp | 33 +++++++++++++++---- .../screenrecorder/screenrecordersettings.cpp | 2 ++ .../screenrecorder/screenrecordersettings.h | 1 + 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index fdbc66d0f0d..60635219bba 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -316,6 +316,19 @@ static QString sizeStr(const QSize &size) return QString("%1x%2").arg(size.width()).arg(size.height()); } +static QRect cropRectForContinuousMulitScreen( + const Internal::ScreenRecorderSettings::RecordSettings &rS) +{ + const QScreen *screen = QGuiApplication::screens()[rS.screenId]; + const QPoint screenTopLeft = screen->geometry().topLeft(); + const QPoint cropTopLeft = rS.cropRect.translated(screenTopLeft).topLeft(); + const QSize cropSize = rS.cropRect.isNull() + ? screen->size() * screen->devicePixelRatio() + : rS.cropRect.size(); + const QRect cropRect(cropTopLeft, cropSize); + return cropRect; +} + QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const { const Internal::ScreenRecorderSettings::RecordSettings rS = @@ -327,13 +340,9 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const switch (Internal::settings().volatileScreenCaptureType()) { case Internal::CaptureType::X11grab: { - const QScreen *screen = QGuiApplication::screens()[rS.screenId]; - const QPoint screenTopLeft = screen->geometry().topLeft(); - const QRect cropRect = rS.cropRect.translated(screenTopLeft); + const QRect cropRect = cropRectForContinuousMulitScreen(rS); + const QString videoSize = sizeStr(cropRect.size()); const QString x11display = qtcEnvironmentVariable("DISPLAY", ":0.0"); - const QString videoSize = sizeStr(rS.cropRect.isNull() - ? screen->size() * screen->devicePixelRatio() - : rS.cropRect.size()); videoGrabParams.append({"-f", "x11grab"}); videoGrabParams.append({"-draw_mouse", captureCursorStr}); videoGrabParams.append({"-framerate", frameRateStr}); @@ -359,6 +368,18 @@ QStringList RecordWidget::ffmpegParameters(const ClipInfo &clipInfo) const }; break; } + case Internal::CaptureType::Gdigrab: { + const QRect cropRect = cropRectForContinuousMulitScreen(rS); + const QString videoSize = sizeStr(cropRect.size()); + videoGrabParams.append({"-f", "gdigrab"}); + videoGrabParams.append({"-draw_mouse", captureCursorStr}); + videoGrabParams.append({"-framerate", frameRateStr}); + videoGrabParams.append({"-video_size", videoSize}); + videoGrabParams.append({"-offset_x", QString::number(cropRect.x())}); + videoGrabParams.append({"-offset_y", QString::number(cropRect.y())}); + videoGrabParams.append({"-i", "desktop"}); + break; + } case Internal::CaptureType::AVFoundation: { videoGrabParams = { "-f", "avfoundation", diff --git a/src/plugins/screenrecorder/screenrecordersettings.cpp b/src/plugins/screenrecorder/screenrecordersettings.cpp index 34579a3412d..f5ac792a949 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.cpp +++ b/src/plugins/screenrecorder/screenrecordersettings.cpp @@ -88,6 +88,8 @@ ScreenRecorderSettings::ScreenRecorderSettings() break; case OsTypeWindows: screenCaptureType.addOption({"ddagrab", {}, CaptureType::Ddagrab}); + screenCaptureType.addOption({"gdigrab", {}, CaptureType::Gdigrab}); + screenCaptureType.setVisible(true); break; case OsTypeMac: screenCaptureType.addOption({"AVFoundation", {}, CaptureType::AVFoundation}); diff --git a/src/plugins/screenrecorder/screenrecordersettings.h b/src/plugins/screenrecorder/screenrecordersettings.h index 7ab5ac4bd57..411c20ca106 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.h +++ b/src/plugins/screenrecorder/screenrecordersettings.h @@ -10,6 +10,7 @@ namespace ScreenRecorder::Internal { enum CaptureType { X11grab, Ddagrab, + Gdigrab, AVFoundation, }; From 718de1bf787bf8047b8c012d238de2918316b038 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 5 Oct 2023 10:05:37 +0200 Subject: [PATCH 1430/1777] App/Core: Only set DPI rounding options if default not "Unset" Instead of making the OS specific decision whether to set DPI rounding options or not in several places, leave the OS specific check to StyleHelper::defaultHighDpiScaleFactorRoundingPolicy() and test for "Unset". Change-Id: I37ab4a0c643d1b1597e5f45496510f2f36f1a386 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/app/main.cpp | 4 +++- src/plugins/coreplugin/generalsettings.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 5acc468d9c5..036d169c063 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -281,7 +281,9 @@ static Utils::QtcSettings *createUserSettings() static void setHighDpiEnvironmentVariable() { - if (Utils::HostOsInfo::isMacHost() || qEnvironmentVariableIsSet("QT_SCALE_FACTOR_ROUNDING_POLICY")) + if (Utils::StyleHelper::defaultHighDpiScaleFactorRoundingPolicy() + == Qt::HighDpiScaleFactorRoundingPolicy::Unset + || qEnvironmentVariableIsSet("QT_SCALE_FACTOR_ROUNDING_POLICY")) return; std::unique_ptr<Utils::QtcSettings> settings(createUserSettings()); diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index e7da40832d7..3a8b90b57bd 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -135,7 +135,8 @@ GeneralSettingsWidget::GeneralSettingsWidget() form.addRow({Tr::tr("Toolbar style:"), m_toolbarStyleBox, st}); form.addRow({Tr::tr("Language:"), m_languageBox, st}); - if (!Utils::HostOsInfo::isMacHost()) { + if (StyleHelper::defaultHighDpiScaleFactorRoundingPolicy() + != Qt::HighDpiScaleFactorRoundingPolicy::Unset) { using Policy = Qt::HighDpiScaleFactorRoundingPolicy; m_policyComboBox = new QComboBox; m_policyComboBox->addItem(Tr::tr("Round up for .5 and above"), int(Policy::Round)); From 1d449ad7d628e7da70378aecb216f1d6db423fea Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 5 Oct 2023 09:43:35 +0200 Subject: [PATCH 1431/1777] SquishTests: Fix CSUP test Function completions nowadays provide the special tooltip holding the variations of argument lists if it is an overloaded function. Check for it and if it is present just close it to avoid an endless loop. (When processing the file we use 'Cursor Down' to navigate through the file but if the tooltip is open we just toggle between the overloads and process the same line again and again) Change-Id: I21742c5a460cf1537151e30c3135bebb83695703 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- tests/system/suite_CSUP/tst_CSUP06/test.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/system/suite_CSUP/tst_CSUP06/test.py b/tests/system/suite_CSUP/tst_CSUP06/test.py index 7682d1a6723..507fdd7881c 100644 --- a/tests/system/suite_CSUP/tst_CSUP06/test.py +++ b/tests/system/suite_CSUP/tst_CSUP06/test.py @@ -87,7 +87,7 @@ def checkSymbolCompletion(editor, isClangCodeModel): "internal.o":"internal.one", "freefunc2":"freefunc2(", "using namespace st":"using namespace std", "afun":"afunc()"} if isClangCodeModel: - missing = ["dummy.bla("] + missing = ["dummy.bla(", "freefunc2("] expectedSuggestion["internal.o"] = ["one"] if platform.system() in ('Microsoft', 'Windows'): expectedSuggestion["using namespace st"] = ["std", "stdext"] @@ -118,6 +118,16 @@ def checkSymbolCompletion(editor, isClangCodeModel): suggestionToClick = " " + suggestionToClick doubleClickItem(':popupFrame_Proposal_QListView', suggestionToClick, 5, 5, 0, Qt.LeftButton) + + try: + multiSuggestionToolTip = findObject( + "{leftWidget={text~='[0-9]+ of [0-9]+' type='QLabel'} type='QToolButton'}") + if multiSuggestionToolTip is not None: + test.log("Closing tooltip containing overloaded function completion.") + type(editor, "<Esc>") + except LookupError: # no proposal or tool tip for unambiguous stuff - direct completion + pass + changedLine = str(lineUnderCursor(editor)).strip() if symbol in expectedRes: exp = expectedRes[symbol] From 08cebc7e08d5fdd8ebe6e4a399251d3622b74879 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 4 Oct 2023 20:35:23 +0200 Subject: [PATCH 1432/1777] CMakePM: Fix crash when runing qtcreator -test CMakeProjectManager Change-Id: I3535c1edd0c72eba3c1bcd50234baeb4c1acecc5 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 640fb53edb4..47515593186 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -149,7 +149,8 @@ CMakeManager::CMakeManager() Constants::RUN_CMAKE_PROFILER, globalContext); command->setDescription(m_cmakeProfilerAction->text()); - manalyzer->addAction(command, Debugger::Constants::G_ANALYZER_TOOLS); + if (manalyzer) + manalyzer->addAction(command, Debugger::Constants::G_ANALYZER_TOOLS); connect(m_cmakeProfilerAction, &QAction::triggered, this, [this] { runCMakeWithProfiling(ProjectManager::startupBuildSystem()); }); From bda5c6a22804102b064b7d2bbeeee240dda6f815 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 4 Oct 2023 20:37:37 +0200 Subject: [PATCH 1433/1777] CMakePM: Preserve newlines in multi-line error messages This way the popup message is not spanning the whole screen. Testable with find_package(Qt7 REQUIRED). Change-Id: I3f1943b603baa02c55f2f8f63c75908468e69d9a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../cmakeprojectmanager/cmakeparser.cpp | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.cpp b/src/plugins/cmakeprojectmanager/cmakeparser.cpp index ecc33463d8d..2eac3aea31e 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeparser.cpp @@ -62,7 +62,7 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm QRegularExpressionMatch match; QString trimmedLine = rightTrimmed(line); switch (m_expectTripleLineErrorData) { - case NONE: + case NONE: { if (trimmedLine.isEmpty() && !m_lastTask.isNull()) { if (m_skippedFirstEmptyLine) { flush(); @@ -71,8 +71,10 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm m_skippedFirstEmptyLine = true; return Status::InProgress; } - if (m_skippedFirstEmptyLine) - m_skippedFirstEmptyLine = false; + QScopeGuard cleanup([this] { + if (m_skippedFirstEmptyLine) + m_skippedFirstEmptyLine = false; + }); match = m_commonError.match(trimmedLine); if (match.hasMatch()) { @@ -112,10 +114,10 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm return {Status::InProgress, linkSpecs}; } else if (trimmedLine.startsWith(QLatin1String(" ")) && !m_lastTask.isNull()) { - if (!m_lastTask.summary.isEmpty()) - m_lastTask.summary.append(' '); - m_lastTask.summary.append(trimmedLine.trimmed()); - ++m_lines; + if (m_skippedFirstEmptyLine) + m_lastTask.details.append(QString()); + m_lastTask.details.append(trimmedLine.mid(2)); + return Status::InProgress; } else if (trimmedLine.endsWith(QLatin1String("in cmake code at"))) { m_expectTripleLineErrorData = LINE_LOCATION; @@ -133,6 +135,7 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm return Status::InProgress; } return Status::NotHandled; + } case LINE_LOCATION: { match = m_locationLine.match(trimmedLine); @@ -169,6 +172,11 @@ void CMakeParser::flush() { if (m_lastTask.isNull()) return; + + if (m_lastTask.summary.isEmpty()) + m_lastTask.summary = m_lastTask.details.takeFirst(); + m_lines += m_lastTask.details.count(); + Task t = m_lastTask; m_lastTask.clear(); scheduleTask(t, m_lines, 1); @@ -223,12 +231,17 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() << QString() << QString() << (Tasks() << BuildSystemTask(Task::Error, - "Cannot find source file: unknownFile.qml Tried extensions " - ".c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx", + "Cannot find source file:\n\n" + " unknownFile.qml\n\n" + "Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp\n" + ".hxx .in .txx", FilePath::fromUserInput("src/1/app/CMakeLists.txt"), 70) << BuildSystemTask(Task::Error, - "Cannot find source file: CMakeLists.txt2 Tried extensions " - ".c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx", + "Cannot find source file:\n\n" + " CMakeLists.txt2\n\n" + "Tried extensions " + ".c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp\n" + ".hxx .in .txx", FilePath::fromUserInput("src/1/app/CMakeLists.txt"), -1)) << QString(); @@ -299,7 +312,9 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() << QString() << QString() << (Tasks() << BuildSystemTask(Task::Error, - "Parse error. Expected \"(\", got newline with text \" \".", + "Parse error. Expected \"(\", got newline with text \"\n" + "\n" + "\".", FilePath::fromUserInput("CMakeLists.txt"), 4)) << QString(); From 7c446268b90cf0758e0b65daea366f0871cc61e1 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 27 Sep 2023 12:06:31 +0200 Subject: [PATCH 1434/1777] Android: Pull androiddeployqt .json name retrieval into extra function The name of the android-*-deployment-settings.json file will be required in other places. This factors AndroidQtVersion::androidDeploymentSettingsFileName out of AndroidQtVersion::androidDeploymentSettings. Change-Id: I41d4c978adb94776df7621369dbe545faabf81ac Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> --- src/plugins/android/androidqtversion.cpp | 25 +++++++++++++++--------- src/plugins/android/androidqtversion.h | 1 + 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/plugins/android/androidqtversion.cpp b/src/plugins/android/androidqtversion.cpp index b5d4d54c431..5ba8775b67e 100644 --- a/src/plugins/android/androidqtversion.cpp +++ b/src/plugins/android/androidqtversion.cpp @@ -133,6 +133,20 @@ int AndroidQtVersion::minimumNDK() const return m_minNdk; } +QString AndroidQtVersion::androidDeploymentSettingsFileName(const Target *target) +{ + const BuildSystem *bs = target->buildSystem(); + if (!bs) + return {}; + const QString buildKey = target->activeBuildKey(); + const QString displayName = bs->buildTarget(buildKey).displayName; + const QString fileName = AndroidManager::isQt5CmakeProject(target) + ? QLatin1String("android_deployment_settings.json") + : QString::fromLatin1("android-%1-deployment-settings.json") + .arg(displayName); + return fileName; +} + Utils::FilePath AndroidQtVersion::androidDeploymentSettings(const Target *target) { // Try to fetch the file name from node data as provided by qmake and Qbs @@ -145,15 +159,8 @@ Utils::FilePath AndroidQtVersion::androidDeploymentSettings(const Target *target } // If unavailable, construct the name by ourselves (CMake) - const BuildSystem *bs = target->buildSystem(); - if (!bs) - return {}; - const QString displayName = bs->buildTarget(buildKey).displayName; - return AndroidManager::buildDirectory(target).pathAppended( - AndroidManager::isQt5CmakeProject(target) - ? QLatin1String("android_deployment_settings.json") - : QString::fromLatin1("android-%1-deployment-settings.json") - .arg(displayName)); + const QString fileName = androidDeploymentSettingsFileName(target); + return AndroidManager::buildDirectory(target) / fileName; } AndroidQtVersion::BuiltWith AndroidQtVersion::builtWith(bool *ok) const diff --git a/src/plugins/android/androidqtversion.h b/src/plugins/android/androidqtversion.h index f80cf92b5ad..95a69a6c2ea 100644 --- a/src/plugins/android/androidqtversion.h +++ b/src/plugins/android/androidqtversion.h @@ -32,6 +32,7 @@ public: const QStringList &androidAbis() const; int minimumNDK() const; + static QString androidDeploymentSettingsFileName(const ProjectExplorer::Target *target); static Utils::FilePath androidDeploymentSettings(const ProjectExplorer::Target *target); struct BuiltWith { From 2537e73eb9494470b8c86599ce95d71a70292a0a Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 5 Oct 2023 11:02:13 +0200 Subject: [PATCH 1435/1777] Revert "Adapt find tool bar input fields to searched widget's font" This reverts commit 9dc9a43f40ad41a6b6f819aac3104f43a0665c8d as this may lead to having multiple different fonts in similar widgets, even inside the find toolbar compared to the editor when having different font sizes. As there is no good solution to make this more consistent and appealing revert the original patch. Change-Id: Ie59bdb43721c467345e029376f13fa88b12d5e92 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/coreplugin/find/currentdocumentfind.cpp | 5 ----- src/plugins/coreplugin/find/currentdocumentfind.h | 2 -- src/plugins/coreplugin/find/findtoolbar.cpp | 6 ------ 3 files changed, 13 deletions(-) diff --git a/src/plugins/coreplugin/find/currentdocumentfind.cpp b/src/plugins/coreplugin/find/currentdocumentfind.cpp index ed5803b24e2..232c8904c0e 100644 --- a/src/plugins/coreplugin/find/currentdocumentfind.cpp +++ b/src/plugins/coreplugin/find/currentdocumentfind.cpp @@ -240,11 +240,6 @@ bool CurrentDocumentFind::eventFilter(QObject *obj, QEvent *event) return QObject::eventFilter(obj, event); } -QWidget *CurrentDocumentFind::currentWidget() const -{ - return m_currentWidget.get(); -} - void CurrentDocumentFind::aggregationChanged() { if (m_currentWidget) { diff --git a/src/plugins/coreplugin/find/currentdocumentfind.h b/src/plugins/coreplugin/find/currentdocumentfind.h index 241d9d54e62..31fbefa2baa 100644 --- a/src/plugins/coreplugin/find/currentdocumentfind.h +++ b/src/plugins/coreplugin/find/currentdocumentfind.h @@ -45,8 +45,6 @@ public: bool eventFilter(QObject *obj, QEvent *event) override; - QWidget *currentWidget() const; - signals: void changed(); void candidateChanged(); diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index 2bffcef810a..616f4c47719 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -489,12 +489,6 @@ void FindToolBar::adaptToCandidate() updateActions(); if (findToolBarPlaceHolder() == FindToolBarPlaceHolder::getCurrent()) { m_currentDocumentFind->acceptCandidate(); - if (QWidget *widget = m_currentDocumentFind->currentWidget()) { - QFont f = font(); - f.setFamily(widget->font().family()); - m_findEdit->setFont(f); - m_replaceEdit->setFont(f); - } if (isVisible() && m_currentDocumentFind->isEnabled()) m_currentDocumentFind->highlightAll(getFindText(), effectiveFindFlags()); } From b8d8fbf2c803b91891b2b268e25a863de1a733c9 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 5 Oct 2023 12:10:28 +0200 Subject: [PATCH 1436/1777] Core: De-O_OBJECT-ify OpenEditorsWindow Not used. Also, move a helper class to the .cpp. Change-Id: I039655539974ebc40806dedb0706f5da831dd4e1 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../editormanager/openeditorswindow.cpp | 21 +++++++++------ .../editormanager/openeditorswindow.h | 26 +++---------------- 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index 10127fc0e05..1e5a96f00b6 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -19,12 +19,25 @@ #include <QHeaderView> #include <QVBoxLayout> #include <QScrollBar> +#include <QTreeWidget> Q_DECLARE_METATYPE(Core::Internal::EditorView*) Q_DECLARE_METATYPE(Core::IDocument*) namespace Core::Internal { +class OpenEditorsTreeWidget : public QTreeWidget +{ +public: + explicit OpenEditorsTreeWidget(QWidget *parent) : QTreeWidget(parent) {} + + QSize sizeHint() const override + { + return QSize(sizeHintForColumn(0) + verticalScrollBar()->width() + frameWidth() * 2, + viewportSizeHint().height() + frameWidth() * 2); + } +}; + enum class Role { Entry = Qt::UserRole, @@ -138,12 +151,6 @@ void OpenEditorsWindow::selectPreviousEditor() selectUpDown(false); } -QSize OpenEditorsTreeWidget::sizeHint() const -{ - return QSize(sizeHintForColumn(0) + verticalScrollBar()->width() + frameWidth() * 2, - viewportSizeHint().height() + frameWidth() * 2); -} - QSize OpenEditorsWindow::sizeHint() const { return m_editorList->sizeHint() + QSize(frameWidth() * 2, frameWidth() * 2); @@ -168,7 +175,6 @@ void OpenEditorsWindow::setEditors(const QList<EditLocation> &globalHistory, Edi addRemainingItems(view, entriesDone); } - void OpenEditorsWindow::selectEditor(QTreeWidgetItem *item) { if (!item) @@ -186,7 +192,6 @@ void OpenEditorsWindow::editorClicked(QTreeWidgetItem *item) setFocus(); } - void OpenEditorsWindow::ensureCurrentVisible() { m_editorList->scrollTo(m_editorList->currentIndex(), QAbstractItemView::PositionAtCenter); diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.h b/src/plugins/coreplugin/editormanager/openeditorswindow.h index eb644e09581..6124ccf6a17 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.h +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.h @@ -7,32 +7,16 @@ #include "editorview.h" #include <QFrame> -#include <QIcon> #include <QList> -#include <QTreeWidget> QT_BEGIN_NAMESPACE class QTreeWidgetItem; QT_END_NAMESPACE -namespace Core { - -class IEditor; - -namespace Internal { - -class OpenEditorsTreeWidget : public QTreeWidget { -public: - explicit OpenEditorsTreeWidget(QWidget *parent = nullptr) : QTreeWidget(parent) {} - ~OpenEditorsTreeWidget() override = default; - QSize sizeHint() const override; -}; - +namespace Core::Internal { class OpenEditorsWindow : public QFrame { - Q_OBJECT - public: enum Mode {ListMode, HistoryMode }; @@ -47,7 +31,6 @@ public: void selectPreviousEditor(); QSize sizeHint() const override; -public slots: void selectAndHide(); private: @@ -63,10 +46,7 @@ private: void ensureCurrentVisible(); void selectUpDown(bool up); - bool isSameFile(IEditor *editorA, IEditor *editorB) const; - - OpenEditorsTreeWidget *m_editorList; + class OpenEditorsTreeWidget *m_editorList; }; -} // namespace Internal -} // namespace Core +} // Core::Internal From 86b8eefa519d6360a4cf4fcfe6050d990938cca7 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 5 Oct 2023 12:21:06 +0200 Subject: [PATCH 1437/1777] Core: Use uniform row height in OpenEditorsWindow Change-Id: Iee1b0c187d9265dc1204e88ffe5f1ba390773877 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/editormanager/openeditorswindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index 1e5a96f00b6..08f52d4128b 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -57,6 +57,7 @@ OpenEditorsWindow::OpenEditorsWindow(QWidget *parent) : if (Utils::HostOsInfo::isMacHost()) m_editorList->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); m_editorList->installEventFilter(this); + m_editorList->setUniformRowHeights(true); // We disable the frame on this list view and use a QFrame around it instead. // This improves the look with QGTKStyle. From 52c47063b4868e676a148b381eff604fa8872269 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 5 Oct 2023 14:37:19 +0200 Subject: [PATCH 1438/1777] SquishTests: Adapt to changed wizard template Change-Id: Iee09bbfdcd700d8a6a66c9ad7fec356d84dd2bd7 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../tst_simple_analyze/testdata/events_qt6.2.4.tsv | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt6.2.4.tsv b/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt6.2.4.tsv index 7ab9ac87edb..c52d83b338c 100644 --- a/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt6.2.4.tsv +++ b/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt6.2.4.tsv @@ -1,10 +1,10 @@ "0" "1" "6" "11" "<program>" "" "1" "Main program" -"Main.qml:15" "Handling Signal" "2" "onTriggered: { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }" -"Main.qml:15" "JavaScript" "2" "expression for onTriggered" -"Main.qml:4" "Creating" "2" "QtQuick/Window" +"Main.qml:14" "Handling Signal" "2" "onTriggered: { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }" +"Main.qml:14" "JavaScript" "2" "expression for onTriggered" +"Main.qml:3" "Creating" "2" "QtQuick/Window" "Main.qml:0" "Compiling" "1" "Main.qml" -"Main.qml:10" "Creating" "2" "QtQml/Timer" -"Main.qml:14" "Binding" "3" "running: runCount < 2" -"Main.qml:14" "JavaScript" "3" "expression for running" +"Main.qml:9" "Creating" "2" "QtQml/Timer" +"Main.qml:13" "Binding" "3" "running: runCount < 2" +"Main.qml:13" "JavaScript" "3" "expression for running" "<bytecode>" "Binding" "1" "Source code not available" From ea01be4a49902dd79302d3e10cce4a81c68375a9 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 5 Oct 2023 14:37:43 +0200 Subject: [PATCH 1439/1777] SquishTests: Fix debugger test Assign a name for a label for easier retrieval and fix the used objects inside the shared script. Change-Id: I1769b87d776a2dc9fee9ca9eb26805f6a8475fc0 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/debugger/debuggermainwindow.cpp | 1 + tests/system/objects.map | 2 +- tests/system/shared/debugger.py | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index 8949322d0e9..81e3a4435aa 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -162,6 +162,7 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *parent) { m_centralWidgetStack = new QStackedWidget; m_statusLabel = new Utils::StatusLabel; + m_statusLabel->setObjectName("DebuggerStatusLabel"); // used by Squish StyleHelper::setPanelWidget(m_statusLabel); m_statusLabel->setIndent(2 * QFontMetrics(q->font()).horizontalAdvance(QChar('x'))); m_editorPlaceHolder = new EditorManagerPlaceHolder; diff --git a/tests/system/objects.map b/tests/system/objects.map index a321ad26081..39961ffb4f3 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -53,7 +53,7 @@ :DebugModeWidget_QComboBox {container=':Qt Creator_Core::Internal::MainWindow' occurrence='3' type='QComboBox' unnamed='1' visible='1'} :Debugger Toolbar.Continue_QToolButton {container=':DebugModeWidget.Toolbar_QDockWidget' toolTip?='Continue*' type='QToolButton' unnamed='1' visible='1'} :Debugger Toolbar.Exit Debugger_QToolButton {container=':DebugModeWidget.Toolbar_QDockWidget' text='Stop Debugger' type='QToolButton' unnamed='1' visible='1'} -:Debugger Toolbar.StatusText_Utils::StatusLabel {container=':DebugModeWidget.Toolbar_QDockWidget' type='Utils::StatusLabel' unnamed='1'} +:Debugger Toolbar.StatusText_Utils::StatusLabel {container=':DebugModeWidget.Toolbar_QDockWidget' name='DebuggerStatusLabel' type='QLabel'} :Debugger.Docks.BreakDockWidget.Debugger.Docks.Break_QFrame {container=':DebugModeWidget.Debugger.Docks.BreakDockWidget_QDockWidget' name='Debugger.Docks.BreakpointManager' type='QFrame' visible='1'} :Debugger.Docks.LocalsAndWatchersDockWidget.Inspector_QFrame {container=':DebugModeWidget.Debugger.Docks.LocalsAndInspectorDockWidget_QDockWidget' name~='Debugger\\\\.Dock\\\\.Inspector\\\\.\\\\d+' type='QFrame' visible='1'} :Debugger::Internal::ConsoleEdit {columnIndex='0' container=':DebugModeWidget_Debugger::Internal::ConsoleView' rowIndex='0' type='Debugger::Internal::ConsoleEdit' unnamed='1' visible='1'} diff --git a/tests/system/shared/debugger.py b/tests/system/shared/debugger.py index b878f9efef6..d409d5b0668 100644 --- a/tests/system/shared/debugger.py +++ b/tests/system/shared/debugger.py @@ -53,8 +53,7 @@ def setBreakpointsForCurrentProject(filesAndLines): if not filesAndLines or not isinstance(filesAndLines, (list,tuple)): test.fatal("This function only takes a non-empty list/tuple holding dicts.") return None - waitForObject("{type='Utils::NavigationTreeView' unnamed='1' visible='1' " - "window=':Qt Creator_Core::Internal::MainWindow'}") + waitForObject(":Qt Creator_Utils::NavigationTreeView") breakPointList = [] for current in filesAndLines: for curFile,curLine in current.items(): From 4b70069e5154c2cafd488e3bda11f86a56f74f14 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 5 Oct 2023 13:39:17 +0200 Subject: [PATCH 1440/1777] Core: Fix handling of settings Without the default value setting the initial value already triggers a 'Restart now or later' on closing the settings dialog without canceling. Amends 3726f0d6c1d05452f070b911683c51fe95df65c4. Change-Id: I3fa7071d945fbee1d282e46ad47b0d46b47ddbcb Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/coreplugin/generalsettings.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 3a8b90b57bd..9ed391d99e1 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -335,8 +335,10 @@ void GeneralSettingsWidget::fillToolbarSyleBox() const void GeneralSettingsWidget::setDpiPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy) { QtcSettings *settings = ICore::settings(); - const Qt::HighDpiScaleFactorRoundingPolicy previousPolicy = - settings->value(settingsKeyDpiPolicy).value<Qt::HighDpiScaleFactorRoundingPolicy>(); + using Policy = Qt::HighDpiScaleFactorRoundingPolicy; + const Policy previousPolicy = settings->value( + settingsKeyDpiPolicy, + int(StyleHelper::defaultHighDpiScaleFactorRoundingPolicy())).value<Policy>(); if (policy != previousPolicy) { RestartDialog dialog(ICore::dialogParent(), Tr::tr("The DPI rounding policy change will take effect after " From 3d18390bba247cbbc50e69dd58fec59cbb0aa352 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 5 Oct 2023 15:03:21 +0200 Subject: [PATCH 1441/1777] Core: Fix typo Change-Id: Ia612c40f4fddfeff97e571f27f3c498ea2ca6407 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/coreplugin/generalsettings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 9ed391d99e1..1e2c5515342 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -88,7 +88,7 @@ public: void fillCodecBox() const; static QByteArray codecForLocale(); static void setCodecForLocale(const QByteArray&); - void fillToolbarSyleBox() const; + void fillToolbarStyleBox() const; static void setDpiPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy); QComboBox *m_languageBox; @@ -163,7 +163,7 @@ GeneralSettingsWidget::GeneralSettingsWidget() fillLanguageBox(); fillCodecBox(); - fillToolbarSyleBox(); + fillToolbarStyleBox(); m_colorButton->setColor(StyleHelper::requestedBaseColor()); m_resetWarningsButton->setEnabled(canResetWarnings()); @@ -324,7 +324,7 @@ StyleHelper::ToolbarStyle toolbarStylefromSettings() StyleHelper::defaultToolbarStyle).toInt()); } -void GeneralSettingsWidget::fillToolbarSyleBox() const +void GeneralSettingsWidget::fillToolbarStyleBox() const { m_toolbarStyleBox->addItem(Tr::tr("Compact"), StyleHelper::ToolbarStyleCompact); m_toolbarStyleBox->addItem(Tr::tr("Relaxed"), StyleHelper::ToolbarStyleRelaxed); From af558a431f480f311b1d7511ece31262f207f9bc Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 5 Oct 2023 11:55:42 +0200 Subject: [PATCH 1442/1777] ProjectExplorer: Introduce 'userAtHostAndPort' There is a case where we need the no-port version even with a non-standard port. Provide access to both version, but to avoid confusion, make the difference explicit in the function names. Fixes: QTCREATORBUG-29616 Change-Id: I9b93b7dd89099a4f24a7c7c0174bdc97b85666d4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../devicesupport/sshparameters.cpp | 15 +++++++++++++++ .../projectexplorer/devicesupport/sshparameters.h | 2 ++ src/plugins/remotelinux/filesystemaccess_test.cpp | 4 ++-- src/plugins/remotelinux/linuxdevice.cpp | 14 ++++++++++---- src/plugins/remotelinux/linuxdevice.h | 1 + 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/sshparameters.cpp b/src/plugins/projectexplorer/devicesupport/sshparameters.cpp index 22055cf7946..1467f958b99 100644 --- a/src/plugins/projectexplorer/devicesupport/sshparameters.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshparameters.cpp @@ -27,6 +27,12 @@ QString SshParameters::userAtHost() const if (!m_userName.isEmpty()) res = m_userName + '@'; res += m_host; + return res; +} + +QString SshParameters::userAtHostAndPort() const +{ + QString res = SshParameters::userAtHost(); if (m_port != 22) res += QString(":%1").arg(m_port); return res; @@ -142,6 +148,15 @@ const QString userAtHost() return userMidFix + getHostFromEnvironment(); } +const QString userAtHostAndPort() +{ + QString res = userAtHost(); + const int port = getPortFromEnvironment(); + if (port != 22) + res += QString(":%1").arg(port); + return res; +} + SshParameters getParameters() { SshParameters params; diff --git a/src/plugins/projectexplorer/devicesupport/sshparameters.h b/src/plugins/projectexplorer/devicesupport/sshparameters.h index 3ee483d5f3d..5a5f32da268 100644 --- a/src/plugins/projectexplorer/devicesupport/sshparameters.h +++ b/src/plugins/projectexplorer/devicesupport/sshparameters.h @@ -32,6 +32,7 @@ public: QString userName() const { return m_userName; } QString userAtHost() const; + QString userAtHostAndPort() const; void setHost(const QString &host) { m_host = host; } void setPort(int port) { m_port = port; } @@ -63,6 +64,7 @@ quint16 PROJECTEXPLORER_EXPORT getPortFromEnvironment(); const QString PROJECTEXPLORER_EXPORT getUserFromEnvironment(); const QString PROJECTEXPLORER_EXPORT getKeyFileFromEnvironment(); const PROJECTEXPLORER_EXPORT QString userAtHost(); +const PROJECTEXPLORER_EXPORT QString userAtHostAndPort(); SshParameters PROJECTEXPLORER_EXPORT getParameters(); bool PROJECTEXPLORER_EXPORT checkParameters(const SshParameters ¶ms); void PROJECTEXPLORER_EXPORT printSetupHelp(); diff --git a/src/plugins/remotelinux/filesystemaccess_test.cpp b/src/plugins/remotelinux/filesystemaccess_test.cpp index 2edb78fa7b3..f8afdd22423 100644 --- a/src/plugins/remotelinux/filesystemaccess_test.cpp +++ b/src/plugins/remotelinux/filesystemaccess_test.cpp @@ -33,7 +33,7 @@ static const char TEST_DIR[] = "/tmp/testdir"; static const FilePath baseFilePath() { - return FilePath::fromString("ssh://" + SshTest::userAtHost() + QString(TEST_DIR)); + return FilePath::fromString("ssh://" + SshTest::userAtHostAndPort() + QString(TEST_DIR)); } TestLinuxDeviceFactory::TestLinuxDeviceFactory() @@ -55,7 +55,7 @@ TestLinuxDeviceFactory::TestLinuxDeviceFactory() FilePath createFile(const QString &name) { FilePath testFilePath = baseFilePath() / name; - FilePath dummyFilePath = FilePath::fromString("ssh://" + SshTest::userAtHost() + "/dev/null"); + FilePath dummyFilePath = FilePath::fromString("ssh://" + SshTest::userAtHostAndPort() + "/dev/null"); dummyFilePath.copyFile(testFilePath); return testFilePath; } diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 3707f660052..1b4af90f912 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -843,13 +843,14 @@ public: << m_displaylessSshParameters.host()); cmd.addArg("/bin/sh"); - m_shell.reset(new LinuxDeviceShell(cmd, FilePath::fromString(QString("ssh://%1/").arg(parameters.userAtHost())))); + m_shell.reset(new LinuxDeviceShell(cmd, + FilePath::fromString(QString("ssh://%1/").arg(parameters.userAtHostAndPort())))); connect(m_shell.get(), &DeviceShell::done, this, [this] { m_shell.release()->deleteLater(); }); auto result = m_shell->start(); if (!result) { - qCWarning(linuxDeviceLog) << "Failed to start shell for:" << parameters.userAtHost() + qCWarning(linuxDeviceLog) << "Failed to start shell for:" << parameters.userAtHostAndPort() << ", " << result.error(); } return result.has_value(); @@ -1027,16 +1028,21 @@ QString LinuxDevice::userAtHost() const return sshParameters().userAtHost(); } +QString LinuxDevice::userAtHostAndPort() const +{ + return sshParameters().userAtHostAndPort(); +} + FilePath LinuxDevice::rootPath() const { - return FilePath::fromParts(u"ssh", userAtHost(), u"/"); + return FilePath::fromParts(u"ssh", userAtHostAndPort(), u"/"); } bool LinuxDevice::handlesFile(const FilePath &filePath) const { if (filePath.scheme() == u"device" && filePath.host() == id().toString()) return true; - if (filePath.scheme() == u"ssh" && filePath.host() == userAtHost()) + if (filePath.scheme() == u"ssh" && filePath.host() == userAtHostAndPort()) return true; return false; } diff --git a/src/plugins/remotelinux/linuxdevice.h b/src/plugins/remotelinux/linuxdevice.h index d0a06219e8e..40ce9c4860e 100644 --- a/src/plugins/remotelinux/linuxdevice.h +++ b/src/plugins/remotelinux/linuxdevice.h @@ -29,6 +29,7 @@ public: bool usableAsBuildDevice() const override; QString userAtHost() const; + QString userAtHostAndPort() const; Utils::FilePath rootPath() const override; From 42bda582d57b68a3b9d990b14e118d56bdafe0d7 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 5 Oct 2023 16:18:34 +0200 Subject: [PATCH 1443/1777] GridGeometry: Remove unused variable Amends 1c76217a7055b4fba1e04633fcc0ceb5f7b1b785 Change-Id: I625df52dc6c18304598f95e921c3d3dea7bf74c6 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> --- src/tools/qml2puppet/qml2puppet/editor3d/gridgeometry.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tools/qml2puppet/qml2puppet/editor3d/gridgeometry.cpp b/src/tools/qml2puppet/qml2puppet/editor3d/gridgeometry.cpp index 4af31d072f0..616b904e9e3 100644 --- a/src/tools/qml2puppet/qml2puppet/editor3d/gridgeometry.cpp +++ b/src/tools/qml2puppet/qml2puppet/editor3d/gridgeometry.cpp @@ -80,8 +80,6 @@ void GridGeometry::doUpdateGeometry() setVertexData(vertexData); - int lastIndex = (vertexData.size() - 1) / int(sizeof(QVector3D)); - // Set bounds based on main grid size instead of actual mesh size to make all parts of the // grid have consistent bounds. const float extent = float(m_lines) * m_step; From edf4280bd97aceb692ead83ac30ecc6d49a93f6b Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 5 Oct 2023 12:06:33 +0200 Subject: [PATCH 1444/1777] CMakePM: Support errors with call stack This is usually the case when using a custom CMake API e.g. qt_add_executable. The topmost function is highlighting the error now, presenting the callstack in the tooltip. Change-Id: Ic8b8f60e8fe94d88dfa0b384639172370382a421 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakeparser.cpp | 91 ++++++++++++++++++- src/plugins/cmakeprojectmanager/cmakeparser.h | 9 ++ 2 files changed, 98 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.cpp b/src/plugins/cmakeprojectmanager/cmakeparser.cpp index 2eac3aea31e..bec93bf2f1f 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeparser.cpp @@ -3,6 +3,7 @@ #include "cmakeparser.h" +#include <utils/algorithm.h> #include <utils/qtcassert.h> #include <projectexplorer/projectexplorerconstants.h> @@ -16,6 +17,7 @@ const char COMMON_ERROR_PATTERN[] = "^CMake Error at (.*?):([0-9]*?)( \\((.*?)\\ const char NEXT_SUBERROR_PATTERN[] = "^CMake Error in (.*?):"; const char COMMON_WARNING_PATTERN[] = "^CMake Warning (\\(dev\\) )?at (.*?):([0-9]*?)( \\((.*?)\\))?:"; const char LOCATION_LINE_PATTERN[] = ":(\\d+?):(?:(\\d+?))?$"; +const char SOURCE_LINE_AND_FUNCTION_PATTERN[] = " (.*?):([0-9]*?)( \\((.*?)\\))"; CMakeParser::CMakeParser() { @@ -30,6 +32,9 @@ CMakeParser::CMakeParser() m_locationLine.setPattern(QLatin1String(LOCATION_LINE_PATTERN)); QTC_CHECK(m_locationLine.isValid()); + + m_sourceLineAndFunction.setPattern(QLatin1String(SOURCE_LINE_AND_FUNCTION_PATTERN)); + QTC_CHECK(m_sourceLineAndFunction.isValid()); } void CMakeParser::setSourceDirectory(const FilePath &sourceDir) @@ -113,12 +118,21 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm match, 1); return {Status::InProgress, linkSpecs}; } - else if (trimmedLine.startsWith(QLatin1String(" ")) && !m_lastTask.isNull()) { + else if (trimmedLine.startsWith(QLatin1String(" ")) && !m_lastTask.isNull() && !m_callStack) { if (m_skippedFirstEmptyLine) m_lastTask.details.append(QString()); m_lastTask.details.append(trimmedLine.mid(2)); - return Status::InProgress; + } else if (trimmedLine.startsWith(QLatin1String(" ")) && !m_lastTask.isNull()) { + match = m_sourceLineAndFunction.match(trimmedLine); + if (match.hasMatch()) { + CallStackLine stackLine; + stackLine.file = absoluteFilePath(resolvePath(match.captured(1))); + stackLine.line = match.captured(2).toInt(); + stackLine.function = match.captured(3); + m_callStack.value() << stackLine; + } + return {Status::InProgress}; } else if (trimmedLine.endsWith(QLatin1String("in cmake code at"))) { m_expectTripleLineErrorData = LINE_LOCATION; flush(); @@ -133,6 +147,9 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm } else if (trimmedLine.startsWith("-- ") || trimmedLine.startsWith(" * ")) { // Do not pass on lines starting with "-- " or "* ". Those are typical CMake output return Status::InProgress; + } else if (trimmedLine.startsWith("Call Stack (most recent call first):")) { + m_callStack = QList<CallStackLine>(); + return {Status::InProgress}; } return Status::NotHandled; } @@ -177,10 +194,40 @@ void CMakeParser::flush() m_lastTask.summary = m_lastTask.details.takeFirst(); m_lines += m_lastTask.details.count(); + if (m_callStack) { + m_lastTask.file = m_callStack.value().last().file; + m_lastTask.line = m_callStack.value().last().line; + + LinkSpecs specs; + m_lastTask.details << QString(); + m_lastTask.details << tr("Call stack:"); + m_lines += 2; + + int offset = m_lastTask.details.join('\n').size(); + Utils::reverseForeach(m_callStack.value(), [&](const auto &line) { + const QString fileAndLine = QString("%1:%2").arg(line.file.path()).arg(line.line); + const QString completeLine = QString(" %1%2").arg(fileAndLine).arg(line.function); + + // newline and " " + offset += 3; + specs.append(LinkSpec{offset, + int(fileAndLine.length()), + createLinkTarget(line.file, line.line, -1)}); + + m_lastTask.details << completeLine; + offset += completeLine.length() - 2; + ++m_lines; + }); + + setDetailsFormat(m_lastTask, specs); + } + Task t = m_lastTask; m_lastTask.clear(); scheduleTask(t, m_lines, 1); m_lines = 0; + + m_callStack.reset(); } } // CMakeProjectManager @@ -356,6 +403,46 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() << QString::fromLatin1("-- Qt5 install prefix: /usr/lib\n" " * Plugin componentsplugin, with CONDITION TARGET QmlDesigner") << OutputParserTester::STDERR << QString() << QString() << (Tasks()) << QString(); + + QTest::newRow("cmake call-stack") + << QString::fromLatin1( + "CMake Error at /Qt/6.5.3/mingw_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:588 " + "(add_executable):\n" + "\n" + " Cannot find source file:\n" + "\n" + " not-existing\n" + "\n" + " Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm\n" + " .ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90\n" + " .f95 .f03 .hip .ispc\n" + "Call Stack (most recent call first):\n" + " /Qt/6.5.3/mingw_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:549 " + "(_qt_internal_create_executable)\n" + " /Qt/6.5.3/mingw_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:741 " + "(qt6_add_executable)\n" + " /Projects/Test-Project/CMakeLists.txt:13 (qt_add_executable)\n") + << OutputParserTester::STDERR << QString() << QString() + << (Tasks() << BuildSystemTask( + Task::Error, + "\n" + "Cannot find source file:\n" + "\n" + " not-existing\n" + "\n" + "Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm\n" + ".ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90\n" + ".f95 .f03 .hip .ispc\n" + "\n" + "Call stack:\n" + " /Projects/Test-Project/CMakeLists.txt:13 (qt_add_executable)\n" + " /Qt/6.5.3/mingw_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:741 " + "(qt6_add_executable)\n" + " /Qt/6.5.3/mingw_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:549 " + "(_qt_internal_create_executable)", + FilePath::fromUserInput("/Projects/Test-Project/CMakeLists.txt"), + 13)) + << QString(); } void Internal::CMakeProjectPlugin::testCMakeParser() diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.h b/src/plugins/cmakeprojectmanager/cmakeparser.h index b9aabc2b2da..36278bada0b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.h +++ b/src/plugins/cmakeprojectmanager/cmakeparser.h @@ -39,8 +39,17 @@ private: QRegularExpression m_nextSubError; QRegularExpression m_commonWarning; QRegularExpression m_locationLine; + QRegularExpression m_sourceLineAndFunction; bool m_skippedFirstEmptyLine = false; int m_lines = 0; + + struct CallStackLine + { + Utils::FilePath file; + int line = -1; + QString function; + }; + std::optional<QList<CallStackLine>> m_callStack; }; } // CMakeProjectManager From 16dfd2d3742f434437c2081a5295446ef3f0a006 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Wed, 4 Oct 2023 17:31:20 +0200 Subject: [PATCH 1445/1777] CMakePM: Add "[cmake] " prefix to all output messages With this one could easily filter the "[cmake] " messages from all the messages in the "Generate Messages" pane. Change-Id: I690650f0ccb0372c9361b95cfec41809737720d7 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 14 +++++--- .../cmakeprojectmanager/cmakeprocess.cpp | 32 +++++++++++++------ .../cmakeprojectmanager/cmakeprocess.h | 3 ++ .../cmakeprojectconstants.h | 3 ++ .../cmakeprojectmanager.cpp | 5 +-- .../cmakeprojectmanager/fileapiparser.cpp | 8 +++-- .../cmakeprojectmanager/fileapireader.cpp | 9 +++--- 7 files changed, 50 insertions(+), 24 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 11e6429d967..e6ee235e62c 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -8,6 +8,7 @@ #include "cmakebuildstep.h" #include "cmakebuildtarget.h" #include "cmakekitaspect.h" +#include "cmakeprocess.h" #include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "cmakeprojectmanagertr.h" @@ -1934,7 +1935,8 @@ void CMakeBuildSystem::runGenerator(Id id) { QTC_ASSERT(cmakeBuildConfiguration(), return); const auto showError = [](const QString &detail) { - Core::MessageManager::writeDisrupting(Tr::tr("cmake generator failed: %1.").arg(detail)); + Core::MessageManager::writeDisrupting( + addCMakePrefix(Tr::tr("cmake generator failed: %1.").arg(detail))); }; const CMakeTool * const cmakeTool = CMakeKitAspect::cmakeTool(buildConfiguration()->target()->kit()); @@ -1981,16 +1983,18 @@ void CMakeBuildSystem::runGenerator(Id id) const auto proc = new Process(this); connect(proc, &Process::done, proc, &Process::deleteLater); connect(proc, &Process::readyReadStandardOutput, this, [proc] { - Core::MessageManager::writeFlashing(QString::fromLocal8Bit(proc->readAllRawStandardOutput())); + Core::MessageManager::writeFlashing( + addCMakePrefix(QString::fromLocal8Bit(proc->readAllRawStandardOutput()).split('\n'))); }); connect(proc, &Process::readyReadStandardError, this, [proc] { - Core::MessageManager::writeDisrupting(QString::fromLocal8Bit(proc->readAllRawStandardError())); + Core::MessageManager::writeDisrupting( + addCMakePrefix(QString::fromLocal8Bit(proc->readAllRawStandardError()).split('\n'))); }); proc->setWorkingDirectory(outDir); proc->setEnvironment(buildConfiguration()->environment()); proc->setCommand(cmdLine); - Core::MessageManager::writeFlashing( - Tr::tr("Running in %1: %2.").arg(outDir.toUserOutput(), cmdLine.toUserOutput())); + Core::MessageManager::writeFlashing(addCMakePrefix( + Tr::tr("Running in %1: %2.").arg(outDir.toUserOutput(), cmdLine.toUserOutput()))); proc->start(); } diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index 1294f597297..b2e0fd24342 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -18,6 +18,7 @@ #include <extensionsystem/invoker.h> #include <extensionsystem/pluginmanager.h> +#include <utils/algorithm.h> #include <utils/process.h> #include <utils/processinfo.h> #include <utils/processinterface.h> @@ -58,7 +59,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & const QString msg = ::CMakeProjectManager::Tr::tr( "The source directory %1 is not reachable by the CMake executable %2.") .arg(parameters.sourceDirectory.displayName()).arg(cmakeExecutable.displayName()); - BuildSystem::appendBuildSystemOutput(msg + '\n'); + BuildSystem::appendBuildSystemOutput(addCMakePrefix({msg, QString()}).join('\n')); emit finished(failedToStartExitCode); return; } @@ -67,7 +68,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & const QString msg = ::CMakeProjectManager::Tr::tr( "The build directory %1 is not reachable by the CMake executable %2.") .arg(parameters.buildDirectory.displayName()).arg(cmakeExecutable.displayName()); - BuildSystem::appendBuildSystemOutput(msg + '\n'); + BuildSystem::appendBuildSystemOutput(addCMakePrefix({msg, QString()}).join('\n')); emit finished(failedToStartExitCode); return; } @@ -78,7 +79,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & if (!buildDirectory.exists()) { const QString msg = ::CMakeProjectManager::Tr::tr( "The build directory \"%1\" does not exist").arg(buildDirectory.toUserOutput()); - BuildSystem::appendBuildSystemOutput(msg + '\n'); + BuildSystem::appendBuildSystemOutput(addCMakePrefix({msg, QString()}).join('\n')); emit finished(failedToStartExitCode); return; } @@ -88,7 +89,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & const QString msg = ::CMakeProjectManager::Tr::tr( "CMake executable \"%1\" and build directory \"%2\" must be on the same device.") .arg(cmake->cmakeExecutable().toUserOutput(), buildDirectory.toUserOutput()); - BuildSystem::appendBuildSystemOutput(msg + '\n'); + BuildSystem::appendBuildSystemOutput(addCMakePrefix({msg, QString()}).join('\n')); emit finished(failedToStartExitCode); return; } @@ -117,13 +118,13 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & m_process->setEnvironment(parameters.environment); m_process->setStdOutLineCallback([this](const QString &s) { - BuildSystem::appendBuildSystemOutput(stripTrailingNewline(s)); + BuildSystem::appendBuildSystemOutput(addCMakePrefix(stripTrailingNewline(s))); emit stdOutReady(s); }); m_process->setStdErrLineCallback([this](const QString &s) { m_parser.appendMessage(s, StdErrFormat); - BuildSystem::appendBuildSystemOutput(stripTrailingNewline(s)); + BuildSystem::appendBuildSystemOutput(addCMakePrefix(stripTrailingNewline(s))); }); connect(m_process.get(), &Process::done, this, [this] { @@ -136,8 +137,9 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); - BuildSystem::startNewBuildSystemOutput(::CMakeProjectManager::Tr::tr("Running %1 in %2.") - .arg(commandLine.toUserOutput(), buildDirectory.toUserOutput())); + BuildSystem::startNewBuildSystemOutput( + addCMakePrefix(::CMakeProjectManager::Tr::tr("Running %1 in %2.") + .arg(commandLine.toUserOutput(), buildDirectory.toUserOutput()))); ProcessProgress *progress = new ProcessProgress(m_process.get()); progress->setDisplayName(::CMakeProjectManager::Tr::tr("Configuring \"%1\"") @@ -170,14 +172,24 @@ void CMakeProcess::handleProcessDone(const Utils::ProcessResultData &resultData) } if (!msg.isEmpty()) { - BuildSystem::appendBuildSystemOutput(msg + '\n'); + BuildSystem::appendBuildSystemOutput(addCMakePrefix({msg, QString()}).join('\n')); TaskHub::addTask(BuildSystemTask(Task::Error, msg)); } emit finished(code); const QString elapsedTime = Utils::formatElapsedTime(m_elapsed.elapsed()); - BuildSystem::appendBuildSystemOutput(elapsedTime + '\n'); + BuildSystem::appendBuildSystemOutput(addCMakePrefix({elapsedTime, QString()}).join('\n')); +} + +QString addCMakePrefix(const QString &str) +{ + return QString("%1%2").arg(Constants::OUTPUT_PREFIX, str); +} + +QStringList addCMakePrefix(const QStringList &list) +{ + return Utils::transform(list, [](const QString &str) { return addCMakePrefix(str); }); } } // CMakeProjectManager::Internal diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.h b/src/plugins/cmakeprojectmanager/cmakeprocess.h index a49033c929b..c46a4ba84c9 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.h +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.h @@ -43,4 +43,7 @@ private: QElapsedTimer m_elapsed; }; +QString addCMakePrefix(const QString &str); +QStringList addCMakePrefix(const QStringList &list); + } // CMakeProjectManager::Internal diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h b/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h index f0da2a488ae..2e9a6ea58e0 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h @@ -71,5 +71,8 @@ const char TOOL_ID[] = "CMakeProjectManager.CMakeKitInformation"; // Data const char BUILD_FOLDER_ROLE[] = "CMakeProjectManager.data.buildFolder"; +// Output +const char OUTPUT_PREFIX[] = "[cmake] "; + } // namespace Constants } // namespace CMakeProjectManager diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 47515593186..4388aef0225 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -5,6 +5,7 @@ #include "cmakebuildsystem.h" #include "cmakekitaspect.h" +#include "cmakeprocess.h" #include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "cmakeprojectmanagertr.h" @@ -411,8 +412,8 @@ void CMakeManager::buildFile(Node *node) bc->buildDirectory()); targetBase = relativeBuildDir / "CMakeFiles" / (targetNode->displayName() + ".dir"); } else if (!generator.contains("Makefiles")) { - Core::MessageManager::writeFlashing( - Tr::tr("Build File is not supported for generator \"%1\"").arg(generator)); + Core::MessageManager::writeFlashing(addCMakePrefix( + Tr::tr("Build File is not supported for generator \"%1\"").arg(generator))); return; } diff --git a/src/plugins/cmakeprojectmanager/fileapiparser.cpp b/src/plugins/cmakeprojectmanager/fileapiparser.cpp index 3899cb45d39..943bebc1c18 100644 --- a/src/plugins/cmakeprojectmanager/fileapiparser.cpp +++ b/src/plugins/cmakeprojectmanager/fileapiparser.cpp @@ -3,6 +3,7 @@ #include "fileapiparser.h" +#include "cmakeprocess.h" #include "cmakeprojectmanagertr.h" #include <coreplugin/messagemanager.h> @@ -42,9 +43,10 @@ FilePath FileApiParser::cmakeReplyDirectory(const FilePath &buildDirectory) static void reportFileApiSetupFailure() { - Core::MessageManager::writeFlashing(Tr::tr("Failed to set up CMake file API support. %1 cannot " - "extract project information.") - .arg(QGuiApplication::applicationDisplayName())); + Core::MessageManager::writeFlashing( + addCMakePrefix(Tr::tr("Failed to set up CMake file API support. %1 cannot " + "extract project information.") + .arg(QGuiApplication::applicationDisplayName()))); } static std::pair<int, int> cmakeVersion(const QJsonObject &obj) diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp index fed19ca3d2b..7c27c2e5b53 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.cpp +++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp @@ -303,8 +303,9 @@ void FileApiReader::makeBackupConfiguration(bool store) replyPrev.removeRecursively(); QTC_CHECK(!replyPrev.exists()); if (!reply.renameFile(replyPrev)) - Core::MessageManager::writeFlashing(Tr::tr("Failed to rename \"%1\" to \"%2\".") - .arg(reply.toString(), replyPrev.toString())); + Core::MessageManager::writeFlashing( + addCMakePrefix(Tr::tr("Failed to rename \"%1\" to \"%2\".") + .arg(reply.toString(), replyPrev.toString()))); } FilePath cmakeCacheTxt = m_parameters.buildDirectory.pathAppended("CMakeCache.txt"); @@ -315,8 +316,8 @@ void FileApiReader::makeBackupConfiguration(bool store) if (cmakeCacheTxt.exists()) if (!FileUtils::copyIfDifferent(cmakeCacheTxt, cmakeCacheTxtPrev)) Core::MessageManager::writeFlashing( - Tr::tr("Failed to copy \"%1\" to \"%2\".") - .arg(cmakeCacheTxt.toString(), cmakeCacheTxtPrev.toString())); + addCMakePrefix(Tr::tr("Failed to copy \"%1\" to \"%2\".") + .arg(cmakeCacheTxt.toString(), cmakeCacheTxtPrev.toString()))); } void FileApiReader::writeConfigurationIntoBuildDirectory(const QStringList &configurationArguments) From 4d4bc2de7ec890ab3ef139875879474587400347 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 5 Oct 2023 17:00:03 +0200 Subject: [PATCH 1446/1777] CMakePM: Theme the CMake output prefix Change-Id: Ic762867cb7249ae8f4e54e801dc5b6319f3f3e72 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/cmakeprocess.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index b2e0fd24342..88cc88bd8ae 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -23,6 +23,8 @@ #include <utils/processinfo.h> #include <utils/processinterface.h> #include <utils/stringutils.h> +#include <utils/stylehelper.h> +#include <utils/theme/theme.h> using namespace Core; using namespace ProjectExplorer; @@ -184,7 +186,16 @@ void CMakeProcess::handleProcessDone(const Utils::ProcessResultData &resultData) QString addCMakePrefix(const QString &str) { - return QString("%1%2").arg(Constants::OUTPUT_PREFIX, str); + auto qColorToAnsiCode = [] (const QColor &color) { + return QString::fromLatin1("\033[38;2;%1;%2;%3m") + .arg(color.red()).arg(color.green()).arg(color.blue()); + }; + static const QColor bgColor = creatorTheme()->color(Theme::BackgroundColorNormal); + static const QColor fgColor = creatorTheme()->color(Theme::TextColorNormal); + static const QColor grey = StyleHelper::mergedColors(fgColor, bgColor, 80); + static const QString prefixString = qColorToAnsiCode(grey) + Constants::OUTPUT_PREFIX + + qColorToAnsiCode(fgColor); + return QString("%1%2").arg(prefixString, str); } QStringList addCMakePrefix(const QStringList &list) From 224b409013e59b2c5c8b23ce34916fc68503154f Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 5 Oct 2023 13:47:44 +0200 Subject: [PATCH 1447/1777] CMakePM: Fix opening context help via F1 in hover tooltip Change-Id: I9ebd6a6ec8e00c63bd6f9182ba8530944f3437ea Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 1c836594d08..c06edffd322 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -411,7 +411,7 @@ class CMakeHoverHandler : public TextEditor::BaseHoverHandler { mutable CMakeKeywords m_keywords; QString m_helpToolTip; - QString m_contextHelp; + QVariant m_contextHelp; public: const CMakeKeywords &keywords() const; @@ -469,12 +469,8 @@ void CMakeHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget if (!helpFile.isEmpty()) m_helpToolTip = CMakeToolManager::toolTipForRstHelpFile(helpFile); - if (auto tool = CMakeToolManager::defaultProjectOrDefaultCMakeTool()) - m_contextHelp = QString("%1/%2/%3") - .arg(tool->documentationUrl(tool->version(), - tool->qchFilePath().isEmpty()), - helpCategory, - word); + m_contextHelp = QVariant::fromValue( + HelpItem({QString("%1/%2").arg(helpCategory, word), word}, {}, {}, HelpItem::Unknown)); setPriority(!m_helpToolTip.isEmpty() ? Priority_Tooltip : Priority_None); } From 9ab9c88e0a5cb0cfb669a4b3efe568c51705aba8 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 5 Oct 2023 17:42:25 +0200 Subject: [PATCH 1448/1777] CMakePM: Include the last error/warning line from call stack This was the first one reported by CMake, and we need to make sure it's also included. Change-Id: I5becfffc1afb35a4f69fd26d8563aa1ea6eaea60 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakeparser.cpp | 16 +++++++++++++++- src/plugins/cmakeprojectmanager/cmakeparser.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.cpp b/src/plugins/cmakeprojectmanager/cmakeparser.cpp index bec93bf2f1f..3546fa11cf4 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeparser.cpp @@ -93,6 +93,11 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm LinkSpecs linkSpecs; addLinkSpecForAbsoluteFilePath(linkSpecs, m_lastTask.file, m_lastTask.line, match, 1); + + m_errorOrWarningLine.file = m_lastTask.file; + m_errorOrWarningLine.line = m_lastTask.line; + m_errorOrWarningLine.function = match.captured(3); + return {Status::InProgress, linkSpecs}; } match = m_nextSubError.match(trimmedLine); @@ -116,6 +121,11 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm LinkSpecs linkSpecs; addLinkSpecForAbsoluteFilePath(linkSpecs, m_lastTask.file, m_lastTask.line, match, 1); + + m_errorOrWarningLine.file = m_lastTask.file; + m_errorOrWarningLine.line = m_lastTask.line; + m_errorOrWarningLine.function = match.captured(4); + return {Status::InProgress, linkSpecs}; } else if (trimmedLine.startsWith(QLatin1String(" ")) && !m_lastTask.isNull() && !m_callStack) { @@ -203,6 +213,8 @@ void CMakeParser::flush() m_lastTask.details << tr("Call stack:"); m_lines += 2; + m_callStack->push_front(m_errorOrWarningLine); + int offset = m_lastTask.details.join('\n').size(); Utils::reverseForeach(m_callStack.value(), [&](const auto &line) { const QString fileAndLine = QString("%1:%2").arg(line.file.path()).arg(line.line); @@ -439,7 +451,9 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() " /Qt/6.5.3/mingw_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:741 " "(qt6_add_executable)\n" " /Qt/6.5.3/mingw_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:549 " - "(_qt_internal_create_executable)", + "(_qt_internal_create_executable)\n" + " /Qt/6.5.3/mingw_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:588 " + "(add_executable)", FilePath::fromUserInput("/Projects/Test-Project/CMakeLists.txt"), 13)) << QString(); diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.h b/src/plugins/cmakeprojectmanager/cmakeparser.h index 36278bada0b..08f57a75342 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.h +++ b/src/plugins/cmakeprojectmanager/cmakeparser.h @@ -50,6 +50,7 @@ private: QString function; }; std::optional<QList<CallStackLine>> m_callStack; + CallStackLine m_errorOrWarningLine; }; } // CMakeProjectManager From 951f513088f8c494cc5a934219de080364a8e823 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh <orgad.shaneh@audiocodes.com> Date: Sun, 1 Oct 2023 20:53:26 +0300 Subject: [PATCH 1449/1777] LanguageClient: Use reference type in iterator Coverity-Id: 1568462 Change-Id: I52e2ae4d271a7c5636f5f811dd7a2b07189166a3 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/languageclient/languageclientsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index 1fa4c5ed377..95d5b1a2e1b 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -609,7 +609,7 @@ QList<BaseSettings *> LanguageClientSettings::fromSettings(QtcSettings *settings settingsIn->beginGroup(settingsGroupKey); QList<BaseSettings *> result; - for (auto varList : + for (const QVariantList &varList : {settingsIn->value(clientsKey).toList(), settingsIn->value(typedClientsKey).toList()}) { for (const QVariant &var : varList) { const Store map = storeFromVariant(var); From 1da8f62783716217f9aaa1eb7ed8301914b112cc Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 5 Oct 2023 14:51:21 +0200 Subject: [PATCH 1450/1777] HelloWorld: Cleanup Change-Id: I19abb60e9a6db3a99955924f52c0b920b7fbd7f6 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/helloworld/helloworld.qbs | 3 ++- src/plugins/helloworld/helloworldplugin.cpp | 17 ++++------------- src/plugins/helloworld/helloworldplugin.h | 9 +++------ src/plugins/helloworld/helloworldwindow.h | 7 ++----- 4 files changed, 11 insertions(+), 25 deletions(-) diff --git a/src/plugins/helloworld/helloworld.qbs b/src/plugins/helloworld/helloworld.qbs index 65fc74e3b3e..41f6571426e 100644 --- a/src/plugins/helloworld/helloworld.qbs +++ b/src/plugins/helloworld/helloworld.qbs @@ -4,13 +4,14 @@ QtcPlugin { name: "HelloWorld" Depends { name: "Core" } - Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] } + Depends { name: "Qt"; submodules: ["widgets"] } files: [ "helloworldplugin.cpp", "helloworldplugin.h", "helloworldwindow.cpp", "helloworldwindow.h", + "helloworldtr.h" ] } diff --git a/src/plugins/helloworld/helloworldplugin.cpp b/src/plugins/helloworld/helloworldplugin.cpp index 5a7c22f2163..9269910ce55 100644 --- a/src/plugins/helloworld/helloworldplugin.cpp +++ b/src/plugins/helloworld/helloworldplugin.cpp @@ -16,8 +16,7 @@ #include <QMessageBox> #include <QPushButton> -namespace HelloWorld { -namespace Internal { +namespace HelloWorld::Internal { /*! A mode with a push button based on BaseMode. */ @@ -53,17 +52,12 @@ HelloWorldPlugin::~HelloWorldPlugin() delete m_helloMode; } -/*! Initializes the plugin. Returns true on success. +/*! Initializes the plugin. Plugins want to register objects with the plugin manager here. - \a errorMessage can be used to pass an error message to the plugin system, - if there was any. */ -bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *errorMessage) +void HelloWorldPlugin::initialize() { - Q_UNUSED(arguments) - Q_UNUSED(errorMessage) - // Create a unique context for our own view, that will be used for the // menu entry later. Core::Context context("HelloWorld.MainView"); @@ -94,8 +88,6 @@ bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *errorMe // Add a mode with a push button based on BaseMode. m_helloMode = new HelloMode; - - return true; } /*! Notification that all extensions that this plugin depends on have been @@ -121,5 +113,4 @@ void HelloWorldPlugin::sayHelloWorld() nullptr, tr("Hello World!"), tr("Hello World! Beautiful day today, isn't it?")); } -} // namespace Internal -} // namespace HelloWorld +} // namespace HelloWorld::Internal diff --git a/src/plugins/helloworld/helloworldplugin.h b/src/plugins/helloworld/helloworldplugin.h index 4c37aed60c6..773308b2eb7 100644 --- a/src/plugins/helloworld/helloworldplugin.h +++ b/src/plugins/helloworld/helloworldplugin.h @@ -5,8 +5,7 @@ #include <extensionsystem/iplugin.h> -namespace HelloWorld { -namespace Internal { +namespace HelloWorld::Internal { class HelloMode; @@ -20,8 +19,7 @@ public: HelloWorldPlugin(); ~HelloWorldPlugin() override; - bool initialize(const QStringList &arguments, QString *errorMessage) override; - + void initialize() override; void extensionsInitialized() override; private: @@ -30,5 +28,4 @@ private: HelloMode *m_helloMode = nullptr; }; -} // namespace Internal -} // namespace HelloWorld +} // namespace HelloWorld::Internal diff --git a/src/plugins/helloworld/helloworldwindow.h b/src/plugins/helloworld/helloworldwindow.h index 8afb694b71e..d9e57615a32 100644 --- a/src/plugins/helloworld/helloworldwindow.h +++ b/src/plugins/helloworld/helloworldwindow.h @@ -5,16 +5,13 @@ #include <QWidget> -namespace HelloWorld { -namespace Internal { +namespace HelloWorld::Internal { class HelloWorldWindow : public QWidget { Q_OBJECT - public: explicit HelloWorldWindow(QWidget *parent = nullptr); }; -} // namespace Internal -} // namespace HelloWorld +} // namespace HelloWorld::Internal From 577b26bf1c4becdcfaddaf198c268d56dee0b873 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 5 Oct 2023 14:55:34 +0200 Subject: [PATCH 1451/1777] Utils: Remove unused function Change-Id: Ib6aadb180a1208f5ee124f788619afa213aa6823 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/process.cpp | 12 ------------ src/libs/utils/process.h | 4 ---- .../projectexplorer/devicesupport/devicemanager.cpp | 6 ------ 3 files changed, 22 deletions(-) diff --git a/src/libs/utils/process.cpp b/src/libs/utils/process.cpp index 70a1d12b449..0eeeb1721b4 100644 --- a/src/libs/utils/process.cpp +++ b/src/libs/utils/process.cpp @@ -1486,18 +1486,6 @@ QString Process::errorString() const return resultData().m_errorString; } -// Path utilities - -Environment Process::systemEnvironmentForBinary(const FilePath &filePath) -{ - if (filePath.needsDevice()) { - QTC_ASSERT(s_deviceHooks.systemEnvironmentForBinary, return {}); - return s_deviceHooks.systemEnvironmentForBinary(filePath); - } - - return Environment::systemEnvironment(); -} - qint64 Process::applicationMainThreadId() const { return d->m_applicationMainThreadId; diff --git a/src/libs/utils/process.h b/src/libs/utils/process.h index 4bcbd767294..3134894b393 100644 --- a/src/libs/utils/process.h +++ b/src/libs/utils/process.h @@ -139,9 +139,6 @@ public: // These (or some of them) may be potentially moved outside of the class. // Some of them could be aggregated in another public utils class. - // TODO: Unused currently? Should it serve as a compartment for contrary of remoteEnvironment? - static Environment systemEnvironmentForBinary(const FilePath &filePath); - static bool startDetached(const CommandLine &cmd, const FilePath &workingDirectory = {}, qint64 *pid = nullptr); @@ -212,7 +209,6 @@ class DeviceProcessHooks { public: std::function<ProcessInterface *(const FilePath &)> processImplHook; - std::function<Environment(const FilePath &)> systemEnvironmentForBinary; }; class QTCREATOR_UTILS_EXPORT ProcessTaskAdapter : public Tasking::TaskAdapter<Process> diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index d7ffcf20981..83f07a70792 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -465,12 +465,6 @@ DeviceManager::DeviceManager(bool isInstance) : d(std::make_unique<DeviceManager return device->createProcessInterface(); }; - processHooks.systemEnvironmentForBinary = [](const FilePath &filePath) { - auto device = DeviceManager::deviceForPath(filePath); - QTC_ASSERT(device, return Environment()); - return device->systemEnvironment(); - }; - Process::setRemoteProcessHooks(processHooks); } From fa0035cef3283c1414ec26d4ea968a5cb600693f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 5 Oct 2023 14:26:26 +0200 Subject: [PATCH 1452/1777] Core: Use TreeModel for OpenEditorWindow With 2000 open files this brings the population time from ~170ms to ~20ms on my machine. Change-Id: I1e6ba77ee4595276a7eaecafc9d7c84386b2155a Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../editormanager/openeditorswindow.cpp | 172 +++++++++++------- .../editormanager/openeditorswindow.h | 12 +- 2 files changed, 110 insertions(+), 74 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index 08f52d4128b..f05f0ac3cdc 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -10,9 +10,11 @@ #include "../idocument.h" #include <utils/algorithm.h> +#include <utils/basetreeview.h> #include <utils/fsengine/fileiconprovider.h> #include <utils/hostosinfo.h> #include <utils/qtcassert.h> +#include <utils/treemodel.h> #include <utils/utilsicons.h> #include <QFocusEvent> @@ -24,59 +26,120 @@ Q_DECLARE_METATYPE(Core::Internal::EditorView*) Q_DECLARE_METATYPE(Core::IDocument*) +using namespace Utils; + namespace Core::Internal { -class OpenEditorsTreeWidget : public QTreeWidget +class OpenEditorsItem : public TreeItem { public: - explicit OpenEditorsTreeWidget(QWidget *parent) : QTreeWidget(parent) {} + QVariant data(int column, int role) const override + { + if (column != 0) + return {}; + + if (!entry) + return {}; + + if (role == Qt::DecorationRole) { + return !entry->filePath().isEmpty() && entry->document->isFileReadOnly() + ? DocumentModel::lockedIcon() : FileIconProvider::icon(entry->filePath()); + } + + if (role == Qt::DisplayRole) { + QString title = entry->displayName(); + if (entry->document->isModified()) + title += Tr::tr("*"); + return title; + } + + if (role == Qt::ToolTipRole) + return entry->filePath().toUserOutput(); + + return {}; + } + + DocumentModel::Entry *entry = nullptr; + EditorView *view = nullptr; +}; + +static void selectEditor(OpenEditorsItem *item) +{ + if (!item) + return; + if (!EditorManagerPrivate::activateEditorForEntry(item->view, item->entry)) + delete item; +} + +class OpenEditorsView : public QTreeView +{ +public: + OpenEditorsView() + { + m_model.setHeader({{}}); + setModel(&m_model); + } QSize sizeHint() const override { return QSize(sizeHintForColumn(0) + verticalScrollBar()->width() + frameWidth() * 2, viewportSizeHint().height() + frameWidth() * 2); } -}; -enum class Role -{ - Entry = Qt::UserRole, - View = Qt::UserRole + 1 + OpenEditorsItem *currentItem() const + { + QModelIndexList indexes = selectedIndexes(); + return indexes.size() == 1 ? m_model.itemForIndexAtLevel<1>(indexes.front()) : nullptr; + } + + int currentRow() const + { + QModelIndexList indexes = selectedIndexes(); + return indexes.size() == 1 ? indexes.front().row() : -1; + } + + void mouseReleaseEvent(QMouseEvent *ev) override + { + QPoint pos = ev->pos(); + QModelIndex idx = indexAt(pos); + if (OpenEditorsItem *item = m_model.itemForIndexAtLevel<1>(idx)) + selectEditor(item); + setFocus(); + } + + TreeModel<TreeItem, OpenEditorsItem> m_model; }; OpenEditorsWindow::OpenEditorsWindow(QWidget *parent) : - QFrame(parent, Qt::Popup), - m_editorList(new OpenEditorsTreeWidget(this)) + QFrame(parent, Qt::Popup) { + m_editorView = new OpenEditorsView; + setMinimumSize(300, 200); - m_editorList->setColumnCount(1); - m_editorList->header()->hide(); - m_editorList->setIndentation(0); - m_editorList->setSelectionMode(QAbstractItemView::SingleSelection); - m_editorList->setTextElideMode(Qt::ElideMiddle); + m_editorView->header()->hide(); + m_editorView->setIndentation(0); + m_editorView->setSelectionMode(QAbstractItemView::SingleSelection); + m_editorView->setTextElideMode(Qt::ElideMiddle); if (Utils::HostOsInfo::isMacHost()) - m_editorList->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - m_editorList->installEventFilter(this); - m_editorList->setUniformRowHeights(true); + m_editorView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + m_editorView->installEventFilter(this); + m_editorView->setUniformRowHeights(true); // We disable the frame on this list view and use a QFrame around it instead. // This improves the look with QGTKStyle. if (!Utils::HostOsInfo::isMacHost()) - setFrameStyle(m_editorList->frameStyle()); - m_editorList->setFrameStyle(QFrame::NoFrame); + setFrameStyle(m_editorView->frameStyle()); + m_editorView->setFrameStyle(QFrame::NoFrame); auto layout = new QVBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); - layout->addWidget(m_editorList); - - connect(m_editorList, &QTreeWidget::itemClicked, - this, &OpenEditorsWindow::editorClicked); + layout->addWidget(m_editorView); } void OpenEditorsWindow::selectAndHide() { setVisible(false); - selectEditor(m_editorList->currentItem()); + selectEditor(m_editorView->currentItem()); } void OpenEditorsWindow::setVisible(bool visible) @@ -88,7 +151,7 @@ void OpenEditorsWindow::setVisible(bool visible) bool OpenEditorsWindow::eventFilter(QObject *obj, QEvent *e) { - if (obj == m_editorList) { + if (obj == m_editorView) { if (e->type() == QEvent::KeyPress) { auto ke = static_cast<QKeyEvent*>(e); if (ke->key() == Qt::Key_Escape) { @@ -97,7 +160,7 @@ bool OpenEditorsWindow::eventFilter(QObject *obj, QEvent *e) } if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter) { - selectEditor(m_editorList->currentItem()); + selectEditor(m_editorView->currentItem()); return true; } } else if (e->type() == QEvent::KeyRelease) { @@ -115,18 +178,18 @@ bool OpenEditorsWindow::eventFilter(QObject *obj, QEvent *e) void OpenEditorsWindow::focusInEvent(QFocusEvent *) { - m_editorList->setFocus(); + m_editorView->setFocus(); } void OpenEditorsWindow::selectUpDown(bool up) { - int itemCount = m_editorList->topLevelItemCount(); + int itemCount = m_editorView->m_model.rootItem()->childCount(); if (itemCount < 2) return; - int index = m_editorList->indexOfTopLevelItem(m_editorList->currentItem()); + int index = m_editorView->currentRow(); if (index < 0) return; - QTreeWidgetItem *editor = nullptr; + TreeItem *editor = nullptr; int count = 0; while (!editor && count < itemCount) { if (up) { @@ -138,11 +201,12 @@ void OpenEditorsWindow::selectUpDown(bool up) if (index >= itemCount) index = 0; } - editor = m_editorList->topLevelItem(index); + editor = m_editorView->m_model.rootItem()->childAt(index); count++; } if (editor) { - m_editorList->setCurrentItem(editor); + // m_editorView->setCurrentItem(editor); + m_editorView->setCurrentIndex(m_editorView->m_model.index(index, 0)); ensureCurrentVisible(); } } @@ -154,7 +218,7 @@ void OpenEditorsWindow::selectPreviousEditor() QSize OpenEditorsWindow::sizeHint() const { - return m_editorList->sizeHint() + QSize(frameWidth() * 2, frameWidth() * 2); + return m_editorView->sizeHint() + QSize(frameWidth() * 2, frameWidth() * 2); } void OpenEditorsWindow::selectNextEditor() @@ -164,7 +228,7 @@ void OpenEditorsWindow::selectNextEditor() void OpenEditorsWindow::setEditors(const QList<EditLocation> &globalHistory, EditorView *view) { - m_editorList->clear(); + m_editorView->m_model.clear(); QSet<const DocumentModel::Entry *> entriesDone; addHistoryItems(view->editorHistory(), view, entriesDone); @@ -176,26 +240,9 @@ void OpenEditorsWindow::setEditors(const QList<EditLocation> &globalHistory, Edi addRemainingItems(view, entriesDone); } -void OpenEditorsWindow::selectEditor(QTreeWidgetItem *item) -{ - if (!item) - return; - auto entry = item->data(0, int(Role::Entry)).value<DocumentModel::Entry *>(); - QTC_ASSERT(entry, return); - auto view = item->data(0, int(Role::View)).value<EditorView *>(); - if (!EditorManagerPrivate::activateEditorForEntry(view, entry)) - delete item; -} - -void OpenEditorsWindow::editorClicked(QTreeWidgetItem *item) -{ - selectEditor(item); - setFocus(); -} - void OpenEditorsWindow::ensureCurrentVisible() { - m_editorList->scrollTo(m_editorList->currentIndex(), QAbstractItemView::PositionAtCenter); + m_editorView->scrollTo(m_editorView->currentIndex(), QAbstractItemView::PositionAtCenter); } static DocumentModel::Entry *entryForEditLocation(const EditLocation &item) @@ -228,23 +275,14 @@ void OpenEditorsWindow::addItem(DocumentModel::Entry *entry, { if (!Utils::insert(entriesDone, entry)) return; - QString title = entry->displayName(); - QTC_ASSERT(!title.isEmpty(), return); - auto item = new QTreeWidgetItem(); - if (entry->document->isModified()) - title += Tr::tr("*"); - item->setIcon(0, !entry->filePath().isEmpty() && entry->document->isFileReadOnly() - ? DocumentModel::lockedIcon() : Utils::FileIconProvider::icon(entry->filePath())); - item->setText(0, title); - item->setToolTip(0, entry->filePath().toString()); - item->setData(0, int(Role::Entry), QVariant::fromValue(entry)); - item->setData(0, int(Role::View), QVariant::fromValue(view)); - item->setTextAlignment(0, Qt::AlignLeft); - m_editorList->addTopLevelItem(item); + auto item = new OpenEditorsItem; + item->entry = entry; + item->view = view; + m_editorView->m_model.rootItem()->appendChild(item); - if (m_editorList->topLevelItemCount() == 1) - m_editorList->setCurrentItem(item); + if (m_editorView->m_model.rootItem()->childCount() == 1) + m_editorView->setCurrentIndex(m_editorView->m_model.index(0, 0)); } } // Core::Internal diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.h b/src/plugins/coreplugin/editormanager/openeditorswindow.h index 6124ccf6a17..f1c3ad98716 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.h +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.h @@ -9,12 +9,11 @@ #include <QFrame> #include <QList> -QT_BEGIN_NAMESPACE -class QTreeWidgetItem; -QT_END_NAMESPACE - namespace Core::Internal { +class OpenEditorsItem; +class OpenEditorsView; + class OpenEditorsWindow : public QFrame { public: @@ -34,8 +33,7 @@ public: void selectAndHide(); private: - void editorClicked(QTreeWidgetItem *item); - static void selectEditor(QTreeWidgetItem *item); + void editorClicked(OpenEditorsItem *item); void addHistoryItems(const QList<EditLocation> &history, EditorView *view, QSet<const DocumentModel::Entry *> &entriesDone); @@ -46,7 +44,7 @@ private: void ensureCurrentVisible(); void selectUpDown(bool up); - class OpenEditorsTreeWidget *m_editorList; + OpenEditorsView *m_editorView; }; } // Core::Internal From 113efbfc85aed462902ea115ed9ace385b0b1f07 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 5 Oct 2023 15:06:41 +0200 Subject: [PATCH 1453/1777] Core: Cleanup OpenEditorsWindow interface a bit Change-Id: Ie8c6e6ad76241ac35bda3f1e0234369f104b9cb2 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../editormanager/openeditorswindow.cpp | 85 ++++++++++--------- .../editormanager/openeditorswindow.h | 26 ++---- 2 files changed, 50 insertions(+), 61 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index f05f0ac3cdc..d59f49bf803 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -3,6 +3,7 @@ #include "openeditorswindow.h" +#include "documentmodel.h" #include "editormanager.h" #include "editormanager_p.h" #include "editorview.h" @@ -21,10 +22,6 @@ #include <QHeaderView> #include <QVBoxLayout> #include <QScrollBar> -#include <QTreeWidget> - -Q_DECLARE_METATYPE(Core::Internal::EditorView*) -Q_DECLARE_METATYPE(Core::IDocument*) using namespace Utils; @@ -78,6 +75,14 @@ public: { m_model.setHeader({{}}); setModel(&m_model); + + header()->hide(); + setIndentation(0); + setSelectionMode(QAbstractItemView::SingleSelection); + setTextElideMode(Qt::ElideMiddle); + if (Utils::HostOsInfo::isMacHost()) + setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + setUniformRowHeights(true); } QSize sizeHint() const override @@ -107,23 +112,27 @@ public: setFocus(); } + void addHistoryItems(const QList<EditLocation> &history, EditorView *view, + QSet<const DocumentModel::Entry *> &entriesDone); + + void addRemainingItems(EditorView *view, + QSet<const DocumentModel::Entry *> &entriesDone); + + void addItem(DocumentModel::Entry *entry, QSet<const DocumentModel::Entry *> &entriesDone, + EditorView *view); + + void selectUpDown(bool up); + TreeModel<TreeItem, OpenEditorsItem> m_model; }; -OpenEditorsWindow::OpenEditorsWindow(QWidget *parent) : - QFrame(parent, Qt::Popup) +OpenEditorsWindow::OpenEditorsWindow(QWidget *parent) + : QFrame(parent, Qt::Popup) { m_editorView = new OpenEditorsView; setMinimumSize(300, 200); - m_editorView->header()->hide(); - m_editorView->setIndentation(0); - m_editorView->setSelectionMode(QAbstractItemView::SingleSelection); - m_editorView->setTextElideMode(Qt::ElideMiddle); - if (Utils::HostOsInfo::isMacHost()) - m_editorView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); m_editorView->installEventFilter(this); - m_editorView->setUniformRowHeights(true); // We disable the frame on this list view and use a QFrame around it instead. // This improves the look with QGTKStyle. @@ -181,12 +190,12 @@ void OpenEditorsWindow::focusInEvent(QFocusEvent *) m_editorView->setFocus(); } -void OpenEditorsWindow::selectUpDown(bool up) +void OpenEditorsView::selectUpDown(bool up) { - int itemCount = m_editorView->m_model.rootItem()->childCount(); + int itemCount = m_model.rootItem()->childCount(); if (itemCount < 2) return; - int index = m_editorView->currentRow(); + int index = currentRow(); if (index < 0) return; TreeItem *editor = nullptr; @@ -201,19 +210,23 @@ void OpenEditorsWindow::selectUpDown(bool up) if (index >= itemCount) index = 0; } - editor = m_editorView->m_model.rootItem()->childAt(index); + editor = m_model.rootItem()->childAt(index); count++; } if (editor) { - // m_editorView->setCurrentItem(editor); - m_editorView->setCurrentIndex(m_editorView->m_model.index(index, 0)); - ensureCurrentVisible(); + setCurrentIndex(m_model.index(index, 0)); + scrollTo(currentIndex(), QAbstractItemView::PositionAtCenter); } } void OpenEditorsWindow::selectPreviousEditor() { - selectUpDown(false); + m_editorView->selectUpDown(false); +} + +void OpenEditorsWindow::selectNextEditor() +{ + m_editorView->selectUpDown(true); } QSize OpenEditorsWindow::sizeHint() const @@ -221,28 +234,18 @@ QSize OpenEditorsWindow::sizeHint() const return m_editorView->sizeHint() + QSize(frameWidth() * 2, frameWidth() * 2); } -void OpenEditorsWindow::selectNextEditor() -{ - selectUpDown(true); -} - void OpenEditorsWindow::setEditors(const QList<EditLocation> &globalHistory, EditorView *view) { m_editorView->m_model.clear(); QSet<const DocumentModel::Entry *> entriesDone; - addHistoryItems(view->editorHistory(), view, entriesDone); + m_editorView->addHistoryItems(view->editorHistory(), view, entriesDone); // add missing editors from the global history - addHistoryItems(globalHistory, view, entriesDone); + m_editorView->addHistoryItems(globalHistory, view, entriesDone); // add purely suspended editors which are not initialised yet - addRemainingItems(view, entriesDone); -} - -void OpenEditorsWindow::ensureCurrentVisible() -{ - m_editorView->scrollTo(m_editorView->currentIndex(), QAbstractItemView::PositionAtCenter); + m_editorView->addRemainingItems(view, entriesDone); } static DocumentModel::Entry *entryForEditLocation(const EditLocation &item) @@ -252,7 +255,7 @@ static DocumentModel::Entry *entryForEditLocation(const EditLocation &item) return DocumentModel::entryForFilePath(item.filePath); } -void OpenEditorsWindow::addHistoryItems(const QList<EditLocation> &history, EditorView *view, +void OpenEditorsView::addHistoryItems(const QList<EditLocation> &history, EditorView *view, QSet<const DocumentModel::Entry *> &entriesDone) { for (const EditLocation &hi : history) { @@ -261,15 +264,15 @@ void OpenEditorsWindow::addHistoryItems(const QList<EditLocation> &history, Edit } } -void OpenEditorsWindow::addRemainingItems(EditorView *view, - QSet<const DocumentModel::Entry *> &entriesDone) +void OpenEditorsView::addRemainingItems(EditorView *view, + QSet<const DocumentModel::Entry *> &entriesDone) { const QList<DocumentModel::Entry *> entries = DocumentModel::entries(); for (DocumentModel::Entry *entry : entries) addItem(entry, entriesDone, view); } -void OpenEditorsWindow::addItem(DocumentModel::Entry *entry, +void OpenEditorsView::addItem(DocumentModel::Entry *entry, QSet<const DocumentModel::Entry *> &entriesDone, EditorView *view) { @@ -279,10 +282,10 @@ void OpenEditorsWindow::addItem(DocumentModel::Entry *entry, auto item = new OpenEditorsItem; item->entry = entry; item->view = view; - m_editorView->m_model.rootItem()->appendChild(item); + m_model.rootItem()->appendChild(item); - if (m_editorView->m_model.rootItem()->childCount() == 1) - m_editorView->setCurrentIndex(m_editorView->m_model.index(0, 0)); + if (m_model.rootItem()->childCount() == 1) + setCurrentIndex(m_model.index(0, 0)); } } // Core::Internal diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.h b/src/plugins/coreplugin/editormanager/openeditorswindow.h index f1c3ad98716..e7a53809e27 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.h +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.h @@ -3,7 +3,6 @@ #pragma once -#include "documentmodel.h" #include "editorview.h" #include <QFrame> @@ -11,38 +10,25 @@ namespace Core::Internal { -class OpenEditorsItem; class OpenEditorsView; -class OpenEditorsWindow : public QFrame +class OpenEditorsWindow final : public QFrame { public: - enum Mode {ListMode, HistoryMode }; - explicit OpenEditorsWindow(QWidget *parent = nullptr); void setEditors(const QList<EditLocation> &globalHistory, EditorView *view); - bool eventFilter(QObject *src, QEvent *e) override; - void focusInEvent(QFocusEvent*) override; - void setVisible(bool visible) override; void selectNextEditor(); void selectPreviousEditor(); - QSize sizeHint() const override; - void selectAndHide(); -private: - void editorClicked(OpenEditorsItem *item); + QSize sizeHint() const final; + void setVisible(bool visible) final; - void addHistoryItems(const QList<EditLocation> &history, EditorView *view, - QSet<const DocumentModel::Entry *> &entriesDone); - void addRemainingItems(EditorView *view, - QSet<const DocumentModel::Entry *> &entriesDone); - void addItem(DocumentModel::Entry *entry, QSet<const DocumentModel::Entry *> &entriesDone, - EditorView *view); - void ensureCurrentVisible(); - void selectUpDown(bool up); +private: + bool eventFilter(QObject *src, QEvent *e) final; + void focusInEvent(QFocusEvent *) final; OpenEditorsView *m_editorView; }; From 1fabd72514a6fdf529cbbc1a19c13ad537edd8dd Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 6 Oct 2023 08:51:17 +0200 Subject: [PATCH 1454/1777] DeviceSupport: Add more error output Previously most errors when opening shells were completely opaque to the user. This patch adds error output either via QMessageBox if there is another modal dialog, or as flashing disrupting messages. Change-Id: I54be7a90295b61c23c739294c2d1d37c288ad273 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/deviceshell.cpp | 3 +- src/libs/utils/filepath.cpp | 24 ++-- src/libs/utils/filepath.h | 3 +- src/libs/utils/terminalhooks.cpp | 15 +-- src/libs/utils/terminalhooks.h | 2 +- src/plugins/docker/dockerdevice.cpp | 116 ++++++++++-------- src/plugins/docker/dockerdevice.h | 4 +- src/plugins/docker/dockerdevicewidget.cpp | 8 +- .../devicesupport/desktopdevice.cpp | 12 +- .../devicesupport/desktopdevice.h | 2 +- .../devicesupport/devicemanager.cpp | 9 +- .../projectexplorer/devicesupport/idevice.cpp | 14 ++- .../projectexplorer/devicesupport/idevice.h | 10 +- .../projectexplorer/projectexplorer.cpp | 29 +++-- src/plugins/remotelinux/linuxdevice.cpp | 11 +- src/plugins/terminal/terminalwidget.cpp | 25 ++-- src/plugins/terminal/terminalwidget.h | 2 +- 17 files changed, 185 insertions(+), 104 deletions(-) diff --git a/src/libs/utils/deviceshell.cpp b/src/libs/utils/deviceshell.cpp index 4fd693b22a0..9c117ea0c5a 100644 --- a/src/libs/utils/deviceshell.cpp +++ b/src/libs/utils/deviceshell.cpp @@ -243,7 +243,8 @@ expected_str<QByteArray> DeviceShell::checkCommand(const QByteArray &command) if (out.contains("<missing>")) { m_shellScriptState = State::Failed; m_missingFeatures.append(QString::fromUtf8(command)); - return make_unexpected(Tr::tr("Command %1 was not found.").arg(QString::fromUtf8(command))); + return make_unexpected( + Tr::tr("Command \"%1\" was not found.").arg(QString::fromUtf8(command))); } return out; diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 1cd57e581b6..a489db6c1a0 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -508,13 +508,16 @@ std::optional<FilePath> FilePath::refersToExecutableFile(MatchScope matchScope) expected_str<FilePath> FilePath::tmpDir() const { if (needsDevice()) { - const Environment env = deviceEnvironment(); - if (env.hasKey("TMPDIR")) - return withNewPath(env.value("TMPDIR")).cleanPath(); - if (env.hasKey("TEMP")) - return withNewPath(env.value("TEMP")).cleanPath(); - if (env.hasKey("TMP")) - return withNewPath(env.value("TMP")).cleanPath(); + const expected_str<Environment> env = deviceEnvironmentWithError(); + if (!env) + return make_unexpected(env.error()); + + if (env->hasKey("TMPDIR")) + return withNewPath(env->value("TMPDIR")).cleanPath(); + if (env->hasKey("TEMP")) + return withNewPath(env->value("TEMP")).cleanPath(); + if (env->hasKey("TMP")) + return withNewPath(env->value("TMP")).cleanPath(); if (osType() != OsTypeWindows) return withNewPath("/tmp"); @@ -1707,6 +1710,13 @@ FilePaths FilePath::searchAllInPath(const FilePaths &additionalDirs, } Environment FilePath::deviceEnvironment() const +{ + expected_str<Environment> env = deviceEnvironmentWithError(); + QTC_ASSERT_EXPECTED(env, return {}); + return *env; +} + +expected_str<Environment> FilePath::deviceEnvironmentWithError() const { if (needsDevice()) { QTC_ASSERT(s_deviceHooks.environment, return {}); diff --git a/src/libs/utils/filepath.h b/src/libs/utils/filepath.h index 9d7b3ce5862..a35a3a09403 100644 --- a/src/libs/utils/filepath.h +++ b/src/libs/utils/filepath.h @@ -164,6 +164,7 @@ public: [[nodiscard]] FilePath relativeChildPath(const FilePath &parent) const; [[nodiscard]] FilePath relativePathFrom(const FilePath &anchor) const; [[nodiscard]] Environment deviceEnvironment() const; + [[nodiscard]] expected_str<Environment> deviceEnvironmentWithError() const; [[nodiscard]] FilePaths devicePathEnvironmentVariable() const; [[nodiscard]] FilePath withNewPath(const QString &newPath) const; [[nodiscard]] FilePath withNewMappedPath(const FilePath &newPath) const; @@ -301,7 +302,7 @@ public: std::function<expected_str<DeviceFileAccess *>(const FilePath &)> fileAccess; std::function<QString(const FilePath &)> deviceDisplayName; std::function<bool(const FilePath &, const FilePath &)> ensureReachable; - std::function<Environment(const FilePath &)> environment; + std::function<expected_str<Environment>(const FilePath &)> environment; std::function<bool(const FilePath &left, const FilePath &right)> isSameDevice; std::function<expected_str<FilePath>(const FilePath &)> localSource; std::function<void(const FilePath &, const Environment &)> openTerminal; diff --git a/src/libs/utils/terminalhooks.cpp b/src/libs/utils/terminalhooks.cpp index f1420755c59..6072e168e8a 100644 --- a/src/libs/utils/terminalhooks.cpp +++ b/src/libs/utils/terminalhooks.cpp @@ -6,27 +6,28 @@ #include "externalterminalprocessimpl.h" #include "filepath.h" #include "process.h" +#include "utilstr.h" #include <QMutex> namespace Utils::Terminal { -FilePath defaultShellForDevice(const FilePath &deviceRoot) +expected_str<FilePath> defaultShellForDevice(const FilePath &deviceRoot) { if (deviceRoot.osType() == OsTypeWindows) return deviceRoot.withNewPath("cmd.exe").searchInPath(); - const Environment env = deviceRoot.deviceEnvironment(); - if (!env.hasChanges()) - return {}; + const expected_str<Environment> env = deviceRoot.deviceEnvironmentWithError(); + if (!env) + return make_unexpected(env.error()); - FilePath shell = FilePath::fromUserInput(env.value_or("SHELL", "/bin/sh")); + FilePath shell = FilePath::fromUserInput(env->value_or("SHELL", "/bin/sh")); if (!shell.isAbsolutePath()) - shell = env.searchInPath(shell.nativePath()); + shell = env->searchInPath(shell.nativePath()); if (shell.isEmpty()) - return shell; + return make_unexpected(Tr::tr("Could not find any shell")); return deviceRoot.withNewMappedPath(shell); } diff --git a/src/libs/utils/terminalhooks.h b/src/libs/utils/terminalhooks.h index f5b55111c1e..449c23daa93 100644 --- a/src/libs/utils/terminalhooks.h +++ b/src/libs/utils/terminalhooks.h @@ -71,7 +71,7 @@ struct NameAndCommandLine CommandLine commandLine; }; -QTCREATOR_UTILS_EXPORT FilePath defaultShellForDevice(const FilePath &deviceRoot); +QTCREATOR_UTILS_EXPORT expected_str<FilePath> defaultShellForDevice(const FilePath &deviceRoot); class QTCREATOR_UTILS_EXPORT Hooks { diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index cdb2e8b95e8..7129c6acd14 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -65,6 +65,7 @@ #include <QHeaderView> #include <QHostAddress> #include <QLoggingCategory> +#include <QMessageBox> #include <QNetworkInterface> #include <QPushButton> #include <QRandomGenerator> @@ -302,7 +303,7 @@ public: RunResult runInShell(const CommandLine &cmd, const QByteArray &stdInData = {}); - bool updateContainerAccess(); + expected_str<void> updateContainerAccess(); void changeMounts(QStringList newMounts); bool ensureReachable(const FilePath &other); void shutdown(); @@ -314,7 +315,7 @@ public: QString repoAndTagEncoded() const { return deviceSettings->repoAndTagEncoded(); } QString dockerImageId() const { return deviceSettings->imageId(); } - Environment environment(); + expected_str<Environment> environment(); CommandLine withDockerExecCmd(const CommandLine &cmd, const std::optional<Environment> &env = std::nullopt, @@ -329,7 +330,7 @@ public: expected_str<QString> createContainer(); expected_str<void> startContainer(); void stopCurrentContainer(); - void fetchSystemEnviroment(); + expected_str<void> fetchSystemEnviroment(); std::optional<FilePath> clangdExecutable() const { @@ -587,32 +588,43 @@ DockerDevice::DockerDevice(std::unique_ptr<DockerDeviceSettings> deviceSettings) setMachineType(IDevice::Hardware); setAllowEmptyCommand(true); - setOpenTerminal([this](const Environment &env, const FilePath &workingDir) { + setOpenTerminal([this](const Environment &env, + const FilePath &workingDir) -> expected_str<void> { Q_UNUSED(env); // TODO: That's the runnable's environment in general. Use it via -e below. - if (!updateContainerAccess()) - return; - if (d->containerId().isEmpty()) { - MessageManager::writeDisrupting(Tr::tr("Error starting remote shell. No container.")); - return; - } + expected_str<void> result = d->updateContainerAccess(); + + if (!result) + return result; + + if (d->containerId().isEmpty()) + return make_unexpected(Tr::tr("Error starting remote shell. No container.")); + + expected_str<FilePath> shell = Terminal::defaultShellForDevice(rootPath()); + if (!shell) + return make_unexpected(shell.error()); Process proc; proc.setTerminalMode(TerminalMode::Detached); proc.setEnvironment(env); proc.setWorkingDirectory(workingDir); - proc.setCommand({Terminal::defaultShellForDevice(rootPath()), {}}); + proc.setCommand({*shell, {}}); proc.start(); - if (proc.error() != QProcess::UnknownError && MessageManager::instance()) { - MessageManager::writeDisrupting( - Tr::tr("Error starting remote shell: %1").arg(proc.errorString())); - } + return {}; }); - addDeviceAction({Tr::tr("Open Shell in Container"), [](const IDevice::Ptr &device, QWidget *) { - device->openTerminal(device->systemEnvironment(), FilePath()); - }}); + addDeviceAction( + {Tr::tr("Open Shell in Container"), [](const IDevice::Ptr &device, QWidget *) { + expected_str<Environment> env = device->systemEnvironmentWithError(); + if (!env) { + QMessageBox::warning(ICore::dialogParent(), Tr::tr("Error"), env.error()); + return; + } + expected_str<void> result = device->openTerminal(*env, FilePath()); + if (!result) + QMessageBox::warning(ICore::dialogParent(), Tr::tr("Error"), result.error()); + }}); } DockerDevice::~DockerDevice() @@ -625,7 +637,7 @@ void DockerDevice::shutdown() d->shutdown(); } -bool DockerDevice::updateContainerAccess() const +expected_str<void> DockerDevice::updateContainerAccess() const { return d->updateContainerAccess(); } @@ -909,10 +921,10 @@ expected_str<void> DockerDevicePrivate::startContainer() return m_shell->start(); } -bool DockerDevicePrivate::updateContainerAccess() +expected_str<void> DockerDevicePrivate::updateContainerAccess() { if (QThread::currentThread() != thread()) { - bool result = false; + expected_str<void> result; QMetaObject::invokeMethod(this, &DockerDevicePrivate::updateContainerAccess, Qt::BlockingQueuedConnection, @@ -921,23 +933,23 @@ bool DockerDevicePrivate::updateContainerAccess() } if (m_isShutdown) - return false; + return make_unexpected(Tr::tr("Device is shutdown")); if (DockerApi::isDockerDaemonAvailable(false).value_or(false) == false) - return false; + return make_unexpected(Tr::tr("Docker system is not reachable")); - if (m_shell) - return true; + if (m_shell && m_shell->state() == DeviceShell::State::Succeeded) + return {}; - auto result = startContainer(); + expected_str<void> result = startContainer(); if (result) { deviceSettings->containerStatus.setText(Tr::tr("Running")); - return true; + return result; } - qCWarning(dockerDeviceLog) << "Failed to start container:" << result.error(); - deviceSettings->containerStatus.setText(result.error()); - return false; + const QString error = QString("Failed to start container: %1").arg(result.error()); + deviceSettings->containerStatus.setText(result.error().trimmed()); + return make_unexpected(error); } void DockerDevice::setMounts(const QStringList &mounts) const @@ -1025,7 +1037,7 @@ expected_str<FilePath> DockerDevice::localSource(const FilePath &other) const return d->localSource(other); } -Environment DockerDevice::systemEnvironment() const +expected_str<Environment> DockerDevice::systemEnvironmentWithError() const { return d->environment(); } @@ -1036,29 +1048,34 @@ void DockerDevice::aboutToBeRemoved() const detector.undoAutoDetect(id().toString()); } -void DockerDevicePrivate::fetchSystemEnviroment() +expected_str<void> DockerDevicePrivate::fetchSystemEnviroment() { - if (!updateContainerAccess()) - return; + expected_str<void> result = updateContainerAccess(); + if (!result) + return result; + + QString stdErr; if (m_shell && m_shell->state() == DeviceShell::State::Succeeded) { const RunResult result = runInShell({"env", {}}); const QString out = QString::fromUtf8(result.stdOut); m_cachedEnviroment = Environment(out.split('\n', Qt::SkipEmptyParts), q->osType()); - return; + stdErr = QString::fromUtf8(result.stdErr); + } else { + Process proc; + proc.setCommand(withDockerExecCmd({"env", {}})); + proc.start(); + proc.waitForFinished(); + const QString remoteOutput = proc.cleanedStdOut(); + + m_cachedEnviroment = Environment(remoteOutput.split('\n', Qt::SkipEmptyParts), q->osType()); + stdErr = proc.cleanedStdErr(); } - Process proc; - proc.setCommand(withDockerExecCmd({"env", {}})); - proc.start(); - proc.waitForFinished(); - const QString remoteOutput = proc.cleanedStdOut(); + if (stdErr.isEmpty()) + return {}; - m_cachedEnviroment = Environment(remoteOutput.split('\n', Qt::SkipEmptyParts), q->osType()); - - const QString remoteError = proc.cleanedStdErr(); - if (!remoteError.isEmpty()) - qCWarning(dockerDeviceLog) << "Cannot read container environment:", qPrintable(remoteError); + return make_unexpected("Could not read container environment: " + stdErr); } RunResult DockerDevicePrivate::runInShell(const CommandLine &cmd, const QByteArray &stdInData) @@ -1313,10 +1330,13 @@ bool DockerDevicePrivate::addTemporaryMount(const FilePath &path, const FilePath return true; } -Environment DockerDevicePrivate::environment() +expected_str<Environment> DockerDevicePrivate::environment() { - if (!m_cachedEnviroment) - fetchSystemEnviroment(); + if (!m_cachedEnviroment) { + expected_str<void> result = fetchSystemEnviroment(); + if (!result) + return make_unexpected(result.error()); + } QTC_ASSERT(m_cachedEnviroment, return {}); return m_cachedEnviroment.value(); diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 477de04168a..ab88d0b9d00 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -74,9 +74,9 @@ public: bool ensureReachable(const Utils::FilePath &other) const override; Utils::expected_str<Utils::FilePath> localSource(const Utils::FilePath &other) const override; - Utils::Environment systemEnvironment() const override; + Utils::expected_str<Utils::Environment> systemEnvironmentWithError() const override; - bool updateContainerAccess() const; + Utils::expected_str<void> updateContainerAccess() const; void setMounts(const QStringList &mounts) const; bool prepareForBuild(const ProjectExplorer::Target *target) override; diff --git a/src/plugins/docker/dockerdevicewidget.cpp b/src/plugins/docker/dockerdevicewidget.cpp index fbb80bf640e..01d80106b68 100644 --- a/src/plugins/docker/dockerdevicewidget.cpp +++ b/src/plugins/docker/dockerdevicewidget.cpp @@ -106,7 +106,13 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) this, [this, logView, dockerDevice, searchPaths, deviceSettings] { logView->clear(); - dockerDevice->updateContainerAccess(); + expected_str<void> startResult = dockerDevice->updateContainerAccess(); + + if (!startResult) { + logView->append(Tr::tr("Failed to start container.")); + logView->append(startResult.error()); + return; + } const FilePath clangdPath = dockerDevice->filePath("clangd") diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index cc9649cfca7..08880aff3b7 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -55,17 +55,21 @@ DesktopDevice::DesktopDevice() = QString::fromLatin1("%1-%2").arg(DESKTOP_PORT_START).arg(DESKTOP_PORT_END); setFreePorts(Utils::PortList::fromString(portRange)); - setOpenTerminal([](const Environment &env, const FilePath &path) { + setOpenTerminal([](const Environment &env, const FilePath &path) -> expected_str<void> { const Environment realEnv = env.hasChanges() ? env : Environment::systemEnvironment(); - const FilePath shell = Terminal::defaultShellForDevice(path); + const expected_str<FilePath> shell = Terminal::defaultShellForDevice(path); + if (!shell) + return make_unexpected(shell.error()); Process process; process.setTerminalMode(TerminalMode::Detached); process.setEnvironment(realEnv); - process.setCommand({shell, {}}); + process.setCommand({*shell, {}}); process.setWorkingDirectory(path); process.start(); + + return {}; }); } @@ -117,7 +121,7 @@ FilePath DesktopDevice::filePath(const QString &pathOnDevice) const return FilePath::fromParts({}, {}, pathOnDevice); } -Environment DesktopDevice::systemEnvironment() const +expected_str<Environment> DesktopDevice::systemEnvironmentWithError() const { return Environment::systemEnvironment(); } diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.h b/src/plugins/projectexplorer/devicesupport/desktopdevice.h index fd9b81f123c..437a4f8c074 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.h @@ -31,7 +31,7 @@ public: bool usableAsBuildDevice() const override; bool handlesFile(const Utils::FilePath &filePath) const override; - Utils::Environment systemEnvironment() const override; + Utils::expected_str<Utils::Environment> systemEnvironmentWithError() const override; Utils::FilePath rootPath() const override; Utils::FilePath filePath(const QString &pathOnDevice) const override; diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 83f07a70792..57052d354f6 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -425,10 +425,13 @@ DeviceManager::DeviceManager(bool isInstance) : d(std::make_unique<DeviceManager return device->fileAccess(); }; - deviceHooks.environment = [](const FilePath &filePath) { + deviceHooks.environment = [](const FilePath &filePath) -> expected_str<Environment> { auto device = DeviceManager::deviceForPath(filePath); - QTC_ASSERT(device, qDebug() << filePath.toString(); return Environment{}); - return device->systemEnvironment(); + if (!device) { + return make_unexpected( + Tr::tr("No device found for path \"%1\"").arg(filePath.toUserOutput())); + } + return device->systemEnvironmentWithError(); }; deviceHooks.deviceDisplayName = [](const FilePath &filePath) { diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 85d32b7a0eb..05c013c4bd5 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -226,10 +226,11 @@ bool IDevice::canOpenTerminal() const return bool(d->openTerminal); } -void IDevice::openTerminal(const Environment &env, const FilePath &workingDir) const +expected_str<void> IDevice::openTerminal(const Environment &env, const FilePath &workingDir) const { - QTC_ASSERT(canOpenTerminal(), return); - d->openTerminal(env, workingDir); + QTC_ASSERT(canOpenTerminal(), + return make_unexpected(Tr::tr("Opening a terminal is not supported."))); + return d->openTerminal(env, workingDir); } bool IDevice::isEmptyCommandAllowed() const @@ -302,6 +303,13 @@ FileTransferInterface *IDevice::createFileTransferInterface( } Environment IDevice::systemEnvironment() const +{ + expected_str<Environment> env = systemEnvironmentWithError(); + QTC_ASSERT_EXPECTED(env, return {}); + return *env; +} + +expected_str<Environment> IDevice::systemEnvironmentWithError() const { DeviceFileAccess *access = fileAccess(); QTC_ASSERT(access, return Environment::systemEnvironment()); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index fb9366860e4..a6f9d860b84 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -192,7 +192,8 @@ public: void setupId(Origin origin, Utils::Id id = Utils::Id()); bool canOpenTerminal() const; - void openTerminal(const Utils::Environment &env, const Utils::FilePath &workingDir) const; + Utils::expected_str<void> openTerminal(const Utils::Environment &env, + const Utils::FilePath &workingDir) const; bool isEmptyCommandAllowed() const; void setAllowEmptyCommand(bool allow); @@ -212,7 +213,9 @@ public: virtual Utils::ProcessInterface *createProcessInterface() const; virtual FileTransferInterface *createFileTransferInterface( const FileTransferSetupData &setup) const; - virtual Utils::Environment systemEnvironment() const; + + Utils::Environment systemEnvironment() const; + virtual Utils::expected_str<Utils::Environment> systemEnvironmentWithError() const; virtual void aboutToBeRemoved() const {} @@ -230,7 +233,8 @@ protected: virtual void fromMap(const Utils::Store &map); virtual Utils::Store toMap() const; - using OpenTerminal = std::function<void(const Utils::Environment &, const Utils::FilePath &)>; + using OpenTerminal = std::function<Utils::expected_str<void>(const Utils::Environment &, + const Utils::FilePath &)>; void setOpenTerminal(const OpenTerminal &openTerminal); void setDisplayType(const QString &type); void setOsType(Utils::OsType osType); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 6a4eba09116..98c8690900c 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -104,6 +104,7 @@ #include <coreplugin/imode.h> #include <coreplugin/iversioncontrol.h> #include <coreplugin/locator/directoryfilter.h> +#include <coreplugin/messagemanager.h> #include <coreplugin/minisplitter.h> #include <coreplugin/modemanager.h> #include <coreplugin/navigationwidget.h> @@ -3641,13 +3642,18 @@ void ProjectExplorerPluginPrivate::openTerminalHere(const EnvironmentGetter &env && !buildDevice->ensureReachable(workingDir)) workingDir.clear(); - const FilePath shell = Terminal::defaultShellForDevice(buildDevice->rootPath()); + const expected_str<FilePath> shell = Terminal::defaultShellForDevice(buildDevice->rootPath()); - if (!shell.isEmpty() && buildDevice->rootPath().needsDevice()) { - Terminal::Hooks::instance().openTerminal({CommandLine{shell, {}}, workingDir, environment}); - } else { - Terminal::Hooks::instance().openTerminal({workingDir, environment}); + if (!shell) { + Core::MessageManager::writeDisrupting( + Tr::tr("Failed opening terminal.\n%1").arg(shell.error())); + return; } + + if (buildDevice->rootPath().needsDevice()) + Terminal::Hooks::instance().openTerminal({CommandLine{*shell, {}}, workingDir, environment}); + else + Terminal::Hooks::instance().openTerminal({workingDir, environment}); } void ProjectExplorerPluginPrivate::openTerminalHereWithRunEnv() @@ -3676,10 +3682,17 @@ void ProjectExplorerPluginPrivate::openTerminalHereWithRunEnv() if (!device->filePath(workingDir.path()).exists() && !device->ensureReachable(workingDir)) workingDir.clear(); - const FilePath shell = Terminal::defaultShellForDevice(device->rootPath()); - if (!shell.isEmpty() && device->rootPath().needsDevice()) { + const expected_str<FilePath> shell = Terminal::defaultShellForDevice(device->rootPath()); + + if (!shell) { + Core::MessageManager::writeDisrupting( + Tr::tr("Failed opening terminal.\n%1").arg(shell.error())); + return; + } + + if (device->rootPath().needsDevice()) { Terminal::Hooks::instance().openTerminal( - {CommandLine{shell, {}}, workingDir, runnable.environment}); + {CommandLine{*shell, {}}, workingDir, runnable.environment}); } else { Terminal::Hooks::instance().openTerminal({workingDir, runnable.environment}); } diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 1b4af90f912..8386175e82c 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -37,6 +37,7 @@ #include <QDateTime> #include <QLoggingCategory> +#include <QMessageBox> #include <QMutex> #include <QReadWriteLock> #include <QRegularExpression> @@ -971,7 +972,8 @@ LinuxDevice::LinuxDevice() } }}); - setOpenTerminal([this](const Environment &env, const FilePath &workingDir) { + setOpenTerminal([this](const Environment &env, + const FilePath &workingDir) -> expected_str<void> { Process proc; // If we will not set any environment variables, we can leave out the shell executable @@ -985,10 +987,15 @@ LinuxDevice::LinuxDevice() proc.setEnvironment(env); proc.setWorkingDirectory(workingDir); proc.start(); + + return {}; }); addDeviceAction({Tr::tr("Open Remote Shell"), [](const IDevice::Ptr &device, QWidget *) { - device->openTerminal(Environment(), FilePath()); + expected_str<void> result = device->openTerminal(Environment(), FilePath()); + + if (!result) + QMessageBox::warning(nullptr, Tr::tr("Error"), result.error()); }}); } diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 681ad9c538f..604a0d82bc8 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -87,25 +87,28 @@ void TerminalWidget::setupPty() if (shellCommand.executable().isRootPath()) { writeToTerminal(Tr::tr("Connecting ...\r\n").toUtf8(), true); // We still have to find the shell to start ... - m_findShellWatcher.reset(new QFutureWatcher<FilePath>()); + m_findShellWatcher.reset(new QFutureWatcher<expected_str<FilePath>>()); connect(m_findShellWatcher.get(), &QFutureWatcher<FilePath>::finished, this, [this] { - const FilePath result = m_findShellWatcher->result(); - if (!result.isEmpty()) { - m_openParameters.shellCommand->setExecutable(m_findShellWatcher->result()); + const expected_str<FilePath> result = m_findShellWatcher->result(); + if (result) { + m_openParameters.shellCommand->setExecutable(*result); restart(m_openParameters); return; } - writeToTerminal( - ("\r\n\033[31m" + Tr::tr("Could not find shell to start.") + "\r\n").toUtf8(), true); + writeToTerminal(("\r\n\033[31m" + + Tr::tr("Failed to start shell: %1").arg(result.error()) + "\r\n") + .toUtf8(), + true); }); - m_findShellWatcher->setFuture(Utils::asyncRun([shellCommand] { - const FilePath result = Utils::Terminal::defaultShellForDevice( + m_findShellWatcher->setFuture(Utils::asyncRun([shellCommand]() -> expected_str<FilePath> { + const expected_str<FilePath> result = Utils::Terminal::defaultShellForDevice( shellCommand.executable()); - if (result.isExecutableFile()) - return result; - return FilePath{}; + if (result && !result->isExecutableFile()) + return make_unexpected( + Tr::tr("'%1' is not executable.").arg(result->toUserOutput())); + return result; })); return; diff --git a/src/plugins/terminal/terminalwidget.h b/src/plugins/terminal/terminalwidget.h index b696d8af1c0..e30366bf0cc 100644 --- a/src/plugins/terminal/terminalwidget.h +++ b/src/plugins/terminal/terminalwidget.h @@ -110,7 +110,7 @@ private: Internal::ShortcutMap m_shortcutMap; - std::unique_ptr<QFutureWatcher<Utils::FilePath>> m_findShellWatcher; + std::unique_ptr<QFutureWatcher<Utils::expected_str<Utils::FilePath>>> m_findShellWatcher; }; } // namespace Terminal From 85889e6a09a7d237e4dd092906fff315403fadb2 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 6 Oct 2023 10:26:28 +0200 Subject: [PATCH 1455/1777] Utils: Fix connection Change-Id: I1c17525be7326f836359ddcb911ae048f733a56e Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/aspects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 551e6ca1244..fd0800c7c22 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -2508,7 +2508,7 @@ void FilePathListAspect::addToLayout(LayoutItem &parent) connect(editor, &PathListEditor::changed, this, [this, editor] { d->undoable.set(undoStack(), editor->pathList()); }); - connect(&d->undoable.m_signal, &UndoSignaller::changed, this, [this, editor] { + connect(&d->undoable.m_signal, &UndoSignaller::changed, editor, [this, editor] { if (editor->pathList() != d->undoable.get()) editor->setPathList(d->undoable.get()); From 3baaf16e49b20dc68e851c4c669c1dc94521f65b Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 6 Oct 2023 09:24:53 +0200 Subject: [PATCH 1456/1777] Compile with recent Qt6 Some implicit #include <QPointer> apparently vanished in qtbase with a0d931e4822. Change-Id: I5e6c821fb0a8997c1b5767aeb7bd4007df7d501f Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/solutions/tasking/tasktree.cpp | 1 + src/plugins/coreplugin/progressmanager/processprogress.cpp | 1 + src/plugins/coreplugin/progressmanager/taskprogress.cpp | 1 + src/plugins/qmakeprojectmanager/qmakeparsernodes.h | 1 + 4 files changed, 4 insertions(+) diff --git a/src/libs/solutions/tasking/tasktree.cpp b/src/libs/solutions/tasking/tasktree.cpp index 029d90b27d4..5dc743f1324 100644 --- a/src/libs/solutions/tasking/tasktree.cpp +++ b/src/libs/solutions/tasking/tasktree.cpp @@ -6,6 +6,7 @@ #include <QEventLoop> #include <QFutureWatcher> #include <QPromise> +#include <QPointer> #include <QSet> #include <QTimer> diff --git a/src/plugins/coreplugin/progressmanager/processprogress.cpp b/src/plugins/coreplugin/progressmanager/processprogress.cpp index 9aeebf4ecf0..6a82f5dde82 100644 --- a/src/plugins/coreplugin/progressmanager/processprogress.cpp +++ b/src/plugins/coreplugin/progressmanager/processprogress.cpp @@ -10,6 +10,7 @@ #include <utils/qtcassert.h> #include <QFutureWatcher> +#include <QPointer> using namespace Utils; diff --git a/src/plugins/coreplugin/progressmanager/taskprogress.cpp b/src/plugins/coreplugin/progressmanager/taskprogress.cpp index 5ee5feb24a8..d60fa71e125 100644 --- a/src/plugins/coreplugin/progressmanager/taskprogress.cpp +++ b/src/plugins/coreplugin/progressmanager/taskprogress.cpp @@ -12,6 +12,7 @@ #include <utils/qtcassert.h> #include <QFutureWatcher> +#include <QPointer> #include <QTimer> using namespace Utils; diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h index 9296addfa80..1fca2d9866f 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h @@ -17,6 +17,7 @@ #include <QLoggingCategory> #include <QMap> #include <QPair> +#include <QPointer> #include <QStringList> #include <memory> From 6b3cf966bc6e406536dc2e51dcc97227bee26627 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 6 Oct 2023 11:11:46 +0200 Subject: [PATCH 1457/1777] QbsProjectManager: Fix restoring custom build properties Amends d6fe357d81da96475c02eb3c73f660d8121381e4. Change-Id: Icdc59c5ead49621854906ed94528c98ddc78433b Reviewed-by: hjk <hjk@qt.io> --- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 7968a555bf9..cea9b83d14d 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -355,7 +355,7 @@ void QbsBuildStep::fromMap(const Store &map) BuildStep::fromMap(map); if (hasError()) return; - setQbsConfiguration(map.value(QBS_CONFIG).toMap()); + setQbsConfiguration(mapEntryFromStoreEntry(map.value(QBS_CONFIG)).toMap()); } void QbsBuildStep::toMap(Store &map) const From 449f62294282f6474a120b7fbc99a74f5b082908 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 6 Oct 2023 12:29:07 +0200 Subject: [PATCH 1458/1777] ProjectExplorer: Allow more than one sub-row for tasks Amends a475632c66bc9fadad37. The sub-entries are not uniform. Change-Id: I6660d3a45a973ac5c5037b8bf0974a6da563e8c8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/taskwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index db25d4e9de5..b00e7a14188 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -661,6 +661,7 @@ TaskView::TaskView() { setMouseTracking(true); setVerticalScrollMode(ScrollPerPixel); + setUniformRowHeights(false); } void TaskView::resizeColumns() From 17003555343c405824fc82b3c6bf64f8883f2041 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 5 Oct 2023 17:31:58 +0200 Subject: [PATCH 1459/1777] RemoteLinux: Try better wording for upload options The actual deploy method is not really fixed until the step starts running. Task-number: QTCREATORBUG-29710 Change-Id: Ide4f76b1270f1e998dfac516ae101ddf6f4cebed Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/remotelinux/rsyncdeploystep.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index 64544096b9c..e33bee2d4dd 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -38,7 +38,7 @@ public: { flags.setDisplayStyle(StringAspect::LineEditDisplay); flags.setSettingsKey("RemoteLinux.RsyncDeployStep.Flags"); - flags.setLabelText(Tr::tr("Flags:")); + flags.setLabelText(Tr::tr("Flags for rsync:")); flags.setValue(FileTransferSetupData::defaultRsyncFlags()); ignoreMissingFiles.setSettingsKey("RemoteLinux.RsyncDeployStep.IgnoreMissingFiles"); @@ -47,9 +47,9 @@ public: method.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); method.setDisplayName(Tr::tr("Transfer method:")); - method.addOption(Tr::tr("rsync"), Tr::tr("Use rsync if available.")); - method.addOption(Tr::tr("SFTP"), Tr::tr("Use sftp if available.")); - method.addOption(Tr::tr("Generic Copy"), Tr::tr("Use generic copy, most likely to succeed.")); + method.addOption(Tr::tr("Use rsync if available. Otherwise use default transfer.")); + method.addOption(Tr::tr("Use sftp if available. Otherwise use default transfer.")); + method.addOption(Tr::tr("Use default transfer. This might be slow.")); setInternalInitializer([this]() -> expected_str<void> { if (BuildDeviceKitAspect::device(kit()) == DeviceKitAspect::device(kit())) { @@ -202,7 +202,7 @@ GroupItem RsyncDeployStep::deployRecipe() RsyncDeployStepFactory::RsyncDeployStepFactory() { registerStep<RsyncDeployStep>(Constants::RsyncDeployStepId); - setDisplayName(Tr::tr("Deploy files via rsync")); + setDisplayName(Tr::tr("Deploy files")); } } // RemoteLinux::Internal From 5b8b585d04e09a12e274ac94dafe1ced195d4587 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 5 Oct 2023 17:48:47 +0200 Subject: [PATCH 1460/1777] RemoteLinux: Rename RsyncDeployStep into GenericDeployStep It's handling several options nowadays. Change-Id: Iee599489521c7cb6fa7ec5e28739f7a5ef9bbd8e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/boot2qt/qdbplugin.cpp | 4 ++-- .../remotelinux/remotelinux_constants.h | 2 +- src/plugins/remotelinux/remotelinuxplugin.cpp | 4 ++-- src/plugins/remotelinux/rsyncdeploystep.cpp | 18 +++++++++--------- src/plugins/remotelinux/rsyncdeploystep.h | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/plugins/boot2qt/qdbplugin.cpp b/src/plugins/boot2qt/qdbplugin.cpp index 64be4075ee8..a66bf2846a6 100644 --- a/src/plugins/boot2qt/qdbplugin.cpp +++ b/src/plugins/boot2qt/qdbplugin.cpp @@ -124,7 +124,7 @@ public: && prj->hasMakeInstallEquivalent(); }); addInitialStep(Qdb::Constants::QdbStopApplicationStepId); - addInitialStep(RemoteLinux::Constants::RsyncDeployStepId, [](Target *target) { + addInitialStep(RemoteLinux::Constants::GenericDeployStepId, [](Target *target) { auto device = DeviceKitAspect::device(target->kit()); auto buildDevice = BuildDeviceKitAspect::device(target->kit()); if (buildDevice && buildDevice->rootPath().needsDevice()) @@ -165,7 +165,7 @@ public: QdbMakeDefaultAppStepFactory m_makeDefaultAppStepFactory; QdbDeployStepFactory m_directUploadStepFactory{RemoteLinux::Constants::DirectUploadStepId}; - QdbDeployStepFactory m_rsyncDeployStepFactory{RemoteLinux::Constants::RsyncDeployStepId}; + QdbDeployStepFactory m_rsyncDeployStepFactory{RemoteLinux::Constants::GenericDeployStepId}; QdbDeployStepFactory m_makeInstallStepFactory{RemoteLinux::Constants::MakeInstallStepId}; const QList<Id> supportedRunConfigs { diff --git a/src/plugins/remotelinux/remotelinux_constants.h b/src/plugins/remotelinux/remotelinux_constants.h index 24821c6f36a..90e34826469 100644 --- a/src/plugins/remotelinux/remotelinux_constants.h +++ b/src/plugins/remotelinux/remotelinux_constants.h @@ -15,7 +15,7 @@ const char MakeInstallStepId[] = "RemoteLinux.MakeInstall"; const char TarPackageCreationStepId[] = "MaemoTarPackageCreationStep"; const char TarPackageFilePathId[] = "TarPackageFilePath"; const char TarPackageDeployStepId[] = "MaemoUploadAndInstallTarPackageStep"; -const char RsyncDeployStepId[] = "RemoteLinux.RsyncDeployStep"; +const char GenericDeployStepId[] = "RemoteLinux.RsyncDeployStep"; const char CustomCommandDeployStepId[] = "RemoteLinux.GenericRemoteLinuxCustomCommandDeploymentStep"; const char KillAppStepId[] = "RemoteLinux.KillAppStep"; diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index 8d75e6e6c73..d6e5f86dc1f 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -73,7 +73,7 @@ public: addInitialStep(Constants::KillAppStepId); // TODO: Rename RsyncDeployStep to something more generic. - addInitialStep(Constants::RsyncDeployStepId); + addInitialStep(Constants::GenericDeployStepId); } }; @@ -87,7 +87,7 @@ public: TarPackageCreationStepFactory tarPackageCreationStepFactory; TarPackageDeployStepFactory tarPackageDeployStepFactory; RemoteLinuxDeployStepFactory<GenericDirectUploadStepFactory> genericDirectUploadStepFactory; - RemoteLinuxDeployStepFactory<RsyncDeployStepFactory> rsyncDeployStepFactory; + RemoteLinuxDeployStepFactory<GenericDeployStepFactory> rsyncDeployStepFactory; CustomCommandDeployStepFactory customCommandDeployStepFactory; KillAppStepFactory killAppStepFactory; RemoteLinuxDeployStepFactory<MakeInstallStepFactory> makeInstallStepFactory; diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index e33bee2d4dd..d3558461514 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -30,10 +30,10 @@ namespace RemoteLinux::Internal { // RsyncDeployStep -class RsyncDeployStep : public AbstractRemoteLinuxDeployStep +class GenericDeployStep : public AbstractRemoteLinuxDeployStep { public: - RsyncDeployStep(BuildStepList *bsl, Id id) + GenericDeployStep(BuildStepList *bsl, Id id) : AbstractRemoteLinuxDeployStep(bsl, id) { flags.setDisplayStyle(StringAspect::LineEditDisplay); @@ -75,7 +75,7 @@ private: mutable FilesToTransfer m_files; }; -bool RsyncDeployStep::isDeploymentNecessary() const +bool GenericDeployStep::isDeploymentNecessary() const { const QList<DeployableFile> files = target()->deploymentData().allFiles(); m_files.clear(); @@ -86,7 +86,7 @@ bool RsyncDeployStep::isDeploymentNecessary() const return !m_files.empty(); } -GroupItem RsyncDeployStep::mkdirTask() +GroupItem GenericDeployStep::mkdirTask() { using ResultType = expected_str<void>; @@ -147,7 +147,7 @@ static FileTransferMethod supportedTransferMethodFor(const FileToTransfer &fileT return FileTransferMethod::GenericCopy; } -GroupItem RsyncDeployStep::transferTask() +GroupItem GenericDeployStep::transferTask() { const auto setupHandler = [this](FileTransfer &transfer) { FileTransferMethod preferredTransferMethod = FileTransferMethod::Rsync; @@ -176,7 +176,7 @@ GroupItem RsyncDeployStep::transferTask() transfer.setRsyncFlags(flags()); transfer.setFilesToTransfer(m_files); - connect(&transfer, &FileTransfer::progress, this, &RsyncDeployStep::handleStdOutData); + connect(&transfer, &FileTransfer::progress, this, &GenericDeployStep::handleStdOutData); }; const auto errorHandler = [this](const FileTransfer &transfer) { const ProcessResultData result = transfer.resultData(); @@ -192,16 +192,16 @@ GroupItem RsyncDeployStep::transferTask() return FileTransferTask(setupHandler, {}, errorHandler); } -GroupItem RsyncDeployStep::deployRecipe() +GroupItem GenericDeployStep::deployRecipe() { return Group { mkdirTask(), transferTask() }; } // Factory -RsyncDeployStepFactory::RsyncDeployStepFactory() +GenericDeployStepFactory::GenericDeployStepFactory() { - registerStep<RsyncDeployStep>(Constants::RsyncDeployStepId); + registerStep<GenericDeployStep>(Constants::GenericDeployStepId); setDisplayName(Tr::tr("Deploy files")); } diff --git a/src/plugins/remotelinux/rsyncdeploystep.h b/src/plugins/remotelinux/rsyncdeploystep.h index 20a16e9597a..4967e2c7bc2 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.h +++ b/src/plugins/remotelinux/rsyncdeploystep.h @@ -7,10 +7,10 @@ namespace RemoteLinux::Internal { -class RsyncDeployStepFactory : public ProjectExplorer::BuildStepFactory +class GenericDeployStepFactory : public ProjectExplorer::BuildStepFactory { public: - RsyncDeployStepFactory(); + GenericDeployStepFactory(); }; } // namespace RemoteLinux::Internal From 0cdced6914376a16f68ed24cd8c8a84a46618dc6 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 07:15:45 +0200 Subject: [PATCH 1461/1777] CompilationDbParser: Make readExtraFiles() static Make a local variable const. Change-Id: I9befa9e9714bc6b3bf3f524c64880ad1bf9400d6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../compilationdbparser.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp index aa5feae21dc..444d9b873a2 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp @@ -191,7 +191,7 @@ std::vector<DbEntry> CompilationDbParser::readJsonObjects() const return result; } -QStringList readExtraFiles(const QString &filePath) +static QStringList readExtraFiles(const QString &filePath) { QStringList result; @@ -200,8 +200,7 @@ QStringList readExtraFiles(const QString &filePath) QTextStream stream(&file); while (!stream.atEnd()) { - QString line = stream.readLine(); - line = line.trimmed(); + const QString line = stream.readLine().trimmed(); if (line.isEmpty() || line.startsWith('#')) continue; From 509249cac6ca68c0b86abb5321c39ac20c3b3e9e Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 07:54:34 +0200 Subject: [PATCH 1462/1777] CppIndexingSupport: Make some functions static Change-Id: Id91e4e88e65d706f8dc555896631b79b3159f31d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/cppeditor/cppindexingsupport.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/cppeditor/cppindexingsupport.cpp b/src/plugins/cppeditor/cppindexingsupport.cpp index 8cb0677edd9..d5bf992be76 100644 --- a/src/plugins/cppeditor/cppindexingsupport.cpp +++ b/src/plugins/cppeditor/cppindexingsupport.cpp @@ -106,7 +106,7 @@ private: int m_processedDiagnostics = 0; }; -void classifyFiles(const QSet<QString> &files, QStringList *headers, QStringList *sources) +static void classifyFiles(const QSet<QString> &files, QStringList *headers, QStringList *sources) { for (const QString &file : files) { if (ProjectFile::isSource(ProjectFile::classify(file))) @@ -116,7 +116,7 @@ void classifyFiles(const QSet<QString> &files, QStringList *headers, QStringList } } -void indexFindErrors(QPromise<void> &promise, const ParseParams params) +static void indexFindErrors(QPromise<void> &promise, const ParseParams params) { QStringList sources, headers; classifyFiles(params.sourceFiles, &headers, &sources); @@ -158,7 +158,7 @@ void indexFindErrors(QPromise<void> &promise, const ParseParams params) qDebug("FindErrorsIndexing: %s", qPrintable(elapsedTime)); } -void index(QPromise<void> &promise, const ParseParams params) +static void index(QPromise<void> &promise, const ParseParams params) { QScopedPointer<Internal::CppSourceProcessor> sourceProcessor(CppModelManager::createSourceProcessor()); sourceProcessor->setFileSizeLimitInMb(params.indexerFileSizeLimitInMb); @@ -220,7 +220,7 @@ void index(QPromise<void> &promise, const ParseParams params) qCDebug(indexerLog) << "Indexing finished."; } -void parse(QPromise<void> &promise, const ParseParams params) +static void parse(QPromise<void> &promise, const ParseParams params) { const QSet<QString> &files = params.sourceFiles; if (files.isEmpty()) From c45ab95400a3bc553948713047c9dfda72a1f2a3 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 6 Oct 2023 11:01:56 +0200 Subject: [PATCH 1463/1777] SquishTests: Fix finding line edit on wizard Change-Id: I75059b7e302b1e54b8ac78357f631ca2fd15269a Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/filewizardpage.cpp | 3 ++- tests/system/suite_debugger/tst_debug_empty_main/test.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/filewizardpage.cpp b/src/libs/utils/filewizardpage.cpp index a883f960566..4d2dba6ab30 100644 --- a/src/libs/utils/filewizardpage.cpp +++ b/src/libs/utils/filewizardpage.cpp @@ -50,9 +50,10 @@ FileWizardPage::FileWizardPage(QWidget *parent) : d->m_defaultSuffixLabel = new QLabel; d->m_nameLabel = new QLabel; d->m_nameLineEdit = new FileNameValidatingLineEdit; - d->m_nameLineEdit->setObjectName("nameLineEdit"); + d->m_nameLineEdit->setObjectName("nameLineEdit"); // used by Squish d->m_pathLabel = new QLabel; d->m_pathChooser = new PathChooser; + d->m_pathChooser->setObjectName("fullPathChooser"); // used by Squish d->m_pathChooser->setExpectedKind(PathChooser::Directory); d->m_nameLabel->setText(Tr::tr("File name:")); diff --git a/tests/system/suite_debugger/tst_debug_empty_main/test.py b/tests/system/suite_debugger/tst_debug_empty_main/test.py index 5e981b7b494..019b55e5f00 100644 --- a/tests/system/suite_debugger/tst_debug_empty_main/test.py +++ b/tests/system/suite_debugger/tst_debug_empty_main/test.py @@ -8,8 +8,8 @@ def addFileToProject(projectPath, category, fileTemplate, fileName): nameLineEdit = waitForObject("{name='nameLineEdit' type='Utils::FileNameValidatingLineEdit' " "visible='1'}") replaceEditorContent(nameLineEdit, fileName) - pathLineEdit = waitForObject("{type='Utils::FancyLineEdit' unnamed='1' visible='1' " - "toolTip?='Full path: *'}") + pathChooser = waitForObject("{type='Utils::PathChooser' name='fullPathChooser'}") + pathLineEdit = getChildByClass(pathChooser, "Utils::FancyLineEdit") if not test.compare(pathLineEdit.text, projectPath, "Verifying whether path is correct."): replaceEditorContent(pathLineEdit, projectPath) From 248ac4a6584d8bb1d8cee89422261faa1983f9dd Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 6 Oct 2023 11:30:00 +0200 Subject: [PATCH 1464/1777] SquishTests: Adapt to moved menu item Change-Id: Ib8df3f315b3e82b5ac4cc81f1347db801de994ff Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- tests/system/suite_editors/tst_rename_macros/test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/system/suite_editors/tst_rename_macros/test.py b/tests/system/suite_editors/tst_rename_macros/test.py index 49737f3b492..574310940cb 100644 --- a/tests/system/suite_editors/tst_rename_macros/test.py +++ b/tests/system/suite_editors/tst_rename_macros/test.py @@ -98,8 +98,7 @@ def testRenameMacroAfterSourceMoving(): def performMacroRenaming(newMacroName): for _ in range(10): type(cppEditorStr, "<Left>") - invokeContextMenuItem(waitForObject(cppEditorStr), "Refactor", - "Rename Symbol Under Cursor") + invokeContextMenuItem(waitForObject(cppEditorStr), "Rename Symbol Under Cursor") waitForSearchResults() validateSearchResult(2) replaceLineEdit = waitForObject("{leftWidget={text='Replace with:' type='QLabel' " From 687dfea03bf3ecebd4f5aac8b5ad161063f86cab Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 5 Oct 2023 17:53:35 +0200 Subject: [PATCH 1465/1777] RemoteLinux: Rename rscyncdeploystep.* to genericdeploystep.* Change-Id: Ia1a3a18690fb1f3301e97a628ebe3d20568871eb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/remotelinux/CMakeLists.txt | 2 +- .../{rsyncdeploystep.cpp => genericdeploystep.cpp} | 2 +- .../remotelinux/{rsyncdeploystep.h => genericdeploystep.h} | 0 src/plugins/remotelinux/remotelinux.qbs | 4 ++-- src/plugins/remotelinux/remotelinuxplugin.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename src/plugins/remotelinux/{rsyncdeploystep.cpp => genericdeploystep.cpp} (99%) rename src/plugins/remotelinux/{rsyncdeploystep.h => genericdeploystep.h} (100%) diff --git a/src/plugins/remotelinux/CMakeLists.txt b/src/plugins/remotelinux/CMakeLists.txt index b13dac3f7ed..188e3609ac5 100644 --- a/src/plugins/remotelinux/CMakeLists.txt +++ b/src/plugins/remotelinux/CMakeLists.txt @@ -5,6 +5,7 @@ add_qtc_plugin(RemoteLinux abstractremotelinuxdeploystep.cpp abstractremotelinuxdeploystep.h customcommanddeploystep.cpp customcommanddeploystep.h deploymenttimeinfo.cpp deploymenttimeinfo.h + genericdeploystep.cpp genericdeploystep.h genericdirectuploadstep.cpp genericdirectuploadstep.h genericlinuxdeviceconfigurationwidget.cpp genericlinuxdeviceconfigurationwidget.h killappstep.cpp killappstep.h @@ -23,7 +24,6 @@ add_qtc_plugin(RemoteLinux remotelinuxrunconfiguration.cpp remotelinuxrunconfiguration.h remotelinuxsignaloperation.cpp remotelinuxsignaloperation.h remotelinuxtr.h - rsyncdeploystep.cpp rsyncdeploystep.h sshdevicewizard.cpp sshdevicewizard.h sshkeycreationdialog.cpp sshkeycreationdialog.h tarpackagecreationstep.cpp tarpackagecreationstep.h diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/genericdeploystep.cpp similarity index 99% rename from src/plugins/remotelinux/rsyncdeploystep.cpp rename to src/plugins/remotelinux/genericdeploystep.cpp index d3558461514..9ca4063e390 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/genericdeploystep.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "rsyncdeploystep.h" +#include "genericdeploystep.h" #include "abstractremotelinuxdeploystep.h" #include "remotelinux_constants.h" diff --git a/src/plugins/remotelinux/rsyncdeploystep.h b/src/plugins/remotelinux/genericdeploystep.h similarity index 100% rename from src/plugins/remotelinux/rsyncdeploystep.h rename to src/plugins/remotelinux/genericdeploystep.h diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs index 5a834fdef92..8eaab69e479 100644 --- a/src/plugins/remotelinux/remotelinux.qbs +++ b/src/plugins/remotelinux/remotelinux.qbs @@ -16,6 +16,8 @@ QtcPlugin { "deploymenttimeinfo.h", "customcommanddeploystep.cpp", "customcommanddeploystep.h", + "genericdeploystep.cpp", + "genericdeploystep.h", "genericdirectuploadstep.cpp", "genericdirectuploadstep.h", "genericlinuxdeviceconfigurationwidget.cpp", @@ -47,8 +49,6 @@ QtcPlugin { "remotelinuxsignaloperation.cpp", "remotelinuxsignaloperation.h", "remotelinuxtr.h", - "rsyncdeploystep.cpp", - "rsyncdeploystep.h", "sshdevicewizard.cpp", "sshdevicewizard.h", "sshkeycreationdialog.cpp", diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index d6e5f86dc1f..a84772b3f39 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -4,6 +4,7 @@ #include "remotelinuxplugin.h" #include "customcommanddeploystep.h" +#include "genericdeploystep.h" #include "genericdirectuploadstep.h" #include "killappstep.h" #include "linuxdevice.h" @@ -13,7 +14,6 @@ #include "remotelinuxdebugsupport.h" #include "remotelinuxrunconfiguration.h" #include "remotelinuxtr.h" -#include "rsyncdeploystep.h" #include "tarpackagecreationstep.h" #include "tarpackagedeploystep.h" From b09f4ac1b61ae8b30d18e32fa81cede65d376639 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 6 Oct 2023 10:51:22 +0200 Subject: [PATCH 1466/1777] Update qbs submodule to HEAD of 2.2 branch Change-Id: I652a2ec439f2c05eee79431cef9cbf961e94b37c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 12041c01b82..871e4c29b3e 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 12041c01b8247a05faa12e9d1a6678c8ba56afc5 +Subproject commit 871e4c29b3e1d6611dc7c71c4bb01950ebf9874d From 436b215bce855e364bd6e25cc020508f145327b7 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 6 Oct 2023 13:07:48 +0200 Subject: [PATCH 1467/1777] QmakeProjectManager: Remove unused arch detection remains As the comment from f3418d8661 indicated. Change-Id: I0735130b5162fc7d2bacf8ba7c5fd968f030e67e Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/qmakeprojectmanager/qmakestep.cpp | 5 ----- src/plugins/qmakeprojectmanager/qmakestep.h | 15 +++------------ 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index afeba2bc446..95a2d487e4b 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -695,11 +695,6 @@ QMakeStepFactory::QMakeStepFactory() setFlags(BuildStep::UniqueStep); } -QMakeStepConfig::TargetArchConfig QMakeStepConfig::targetArchFor(const Abi &, const QtVersion *) -{ - return NoArch; -} - QMakeStepConfig::OsType QMakeStepConfig::osTypeFor(const Abi &targetAbi, const QtVersion *version) { OsType os = NoOsType; diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index e90139f279c..a10fd023ab4 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -42,22 +42,16 @@ public: class QMAKEPROJECTMANAGER_EXPORT QMakeStepConfig { public: - // TODO remove, does nothing - enum TargetArchConfig { NoArch, X86, X86_64, PowerPC, PowerPC64 }; - enum OsType { NoOsType, IphoneSimulator, IphoneOS }; - // TODO remove, does nothing - static TargetArchConfig targetArchFor(const ProjectExplorer::Abi &targetAbi, - const QtSupport::QtVersion *version); static OsType osTypeFor(const ProjectExplorer::Abi &targetAbi, const QtSupport::QtVersion *version); QStringList toArguments() const; friend bool operator==(const QMakeStepConfig &a, const QMakeStepConfig &b) { - return std::tie(a.archConfig, a.osType, a.linkQmlDebuggingQQ2) - == std::tie(b.archConfig, b.osType, b.linkQmlDebuggingQQ2) + return std::tie(a.osType, a.linkQmlDebuggingQQ2) + == std::tie(b.osType, b.linkQmlDebuggingQQ2) && std::tie(a.useQtQuickCompiler, a.separateDebugInfo) == std::tie(b.useQtQuickCompiler, b.separateDebugInfo); } @@ -66,18 +60,15 @@ public: friend QDebug operator<<(QDebug dbg, const QMakeStepConfig &c) { - dbg << c.archConfig << c.osType + dbg << c.osType << (c.linkQmlDebuggingQQ2 == Utils::TriState::Enabled) << (c.useQtQuickCompiler == Utils::TriState::Enabled) << (c.separateDebugInfo == Utils::TriState::Enabled); return dbg; } - // Actual data QString sysRoot; QString targetTriple; - // TODO remove, does nothing - TargetArchConfig archConfig = NoArch; OsType osType = NoOsType; Utils::TriState separateDebugInfo; Utils::TriState linkQmlDebuggingQQ2; From db0091e6a39613d8da65c9f3525073fc7d95abdf Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 6 Oct 2023 13:15:39 +0200 Subject: [PATCH 1468/1777] QMakeProjectManager: Use more common operator==() implementation Change-Id: I623b49b92913e2f813554b664b3c79683c3a35cf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/qmakeprojectmanager/qmakestep.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index a10fd023ab4..1cebb2b756f 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -12,8 +12,6 @@ #include <utils/commandline.h> #include <utils/guard.h> -#include <memory> - #include <QDebug> QT_BEGIN_NAMESPACE @@ -50,10 +48,10 @@ public: friend bool operator==(const QMakeStepConfig &a, const QMakeStepConfig &b) { - return std::tie(a.osType, a.linkQmlDebuggingQQ2) - == std::tie(b.osType, b.linkQmlDebuggingQQ2) - && std::tie(a.useQtQuickCompiler, a.separateDebugInfo) - == std::tie(b.useQtQuickCompiler, b.separateDebugInfo); + return a.osType == b.osType + && a.linkQmlDebuggingQQ2 == b.linkQmlDebuggingQQ2 + && a.useQtQuickCompiler == b.useQtQuickCompiler + && a.separateDebugInfo == b.separateDebugInfo; } friend bool operator!=(const QMakeStepConfig &a, const QMakeStepConfig &b) { return !(a == b); } From e8da3b5119ccbbc815e263657b99bc36f1d93a7c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 08:07:50 +0200 Subject: [PATCH 1469/1777] CompilationDataBaseUtils: Pass arg via const ref Change-Id: I6374b0064249a4574ed77e6c9ae4bca3122878c5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../compilationdatabaseutils.cpp | 2 +- .../compilationdatabaseutils.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.cpp index be0ab87e547..fd6d070f49d 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.cpp @@ -54,7 +54,7 @@ static CppEditor::ProjectFile::Kind fileKindFromString(QString flag) return ProjectFile::Unclassified; } -QStringList filterFromFileName(const QStringList &flags, QString fileName) +QStringList filterFromFileName(const QStringList &flags, const QString &fileName) { QStringList result; result.reserve(flags.size()); diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.h b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.h index ec024443d8f..df0d4c9c9fe 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.h +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.h @@ -31,7 +31,7 @@ public: using MimeBinaryCache = QHash<QString, bool>; -QStringList filterFromFileName(const QStringList &flags, QString baseName); +QStringList filterFromFileName(const QStringList &flags, const QString &fileName); void filteredFlags(const Utils::FilePath &filePath, const Utils::FilePath &workingDir, From d6f2a73c819a53001fb031173fecb672e54967cb Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 08:11:24 +0200 Subject: [PATCH 1470/1777] CppIndexingSupport: Pass params to parse() with const ref Change-Id: Ia54ea81907963e55047f2a5a2a283fd928fdfc2e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cppeditor/cppindexingsupport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppindexingsupport.cpp b/src/plugins/cppeditor/cppindexingsupport.cpp index d5bf992be76..ada400556e5 100644 --- a/src/plugins/cppeditor/cppindexingsupport.cpp +++ b/src/plugins/cppeditor/cppindexingsupport.cpp @@ -220,7 +220,7 @@ static void index(QPromise<void> &promise, const ParseParams params) qCDebug(indexerLog) << "Indexing finished."; } -static void parse(QPromise<void> &promise, const ParseParams params) +static void parse(QPromise<void> &promise, const ParseParams ¶ms) { const QSet<QString> &files = params.sourceFiles; if (files.isEmpty()) From 162f9f59d778697357e2aae80706fc920787abcf Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 5 Oct 2023 18:44:00 +0200 Subject: [PATCH 1471/1777] CMakePM: print newline before the message This way we'll get: [cmake] [cmake] Elapsed time: 00:05. And not the other way around. Change-Id: Ica7352cd112b9017c8a39b98618be69494527be9 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakeprocess.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index 88cc88bd8ae..57ff1df2d2c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -61,7 +61,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & const QString msg = ::CMakeProjectManager::Tr::tr( "The source directory %1 is not reachable by the CMake executable %2.") .arg(parameters.sourceDirectory.displayName()).arg(cmakeExecutable.displayName()); - BuildSystem::appendBuildSystemOutput(addCMakePrefix({msg, QString()}).join('\n')); + BuildSystem::appendBuildSystemOutput(addCMakePrefix({QString(), msg}).join('\n')); emit finished(failedToStartExitCode); return; } @@ -70,7 +70,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & const QString msg = ::CMakeProjectManager::Tr::tr( "The build directory %1 is not reachable by the CMake executable %2.") .arg(parameters.buildDirectory.displayName()).arg(cmakeExecutable.displayName()); - BuildSystem::appendBuildSystemOutput(addCMakePrefix({msg, QString()}).join('\n')); + BuildSystem::appendBuildSystemOutput(addCMakePrefix({QString(), msg}).join('\n')); emit finished(failedToStartExitCode); return; } @@ -81,7 +81,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & if (!buildDirectory.exists()) { const QString msg = ::CMakeProjectManager::Tr::tr( "The build directory \"%1\" does not exist").arg(buildDirectory.toUserOutput()); - BuildSystem::appendBuildSystemOutput(addCMakePrefix({msg, QString()}).join('\n')); + BuildSystem::appendBuildSystemOutput(addCMakePrefix({QString(), msg}).join('\n')); emit finished(failedToStartExitCode); return; } @@ -91,7 +91,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & const QString msg = ::CMakeProjectManager::Tr::tr( "CMake executable \"%1\" and build directory \"%2\" must be on the same device.") .arg(cmake->cmakeExecutable().toUserOutput(), buildDirectory.toUserOutput()); - BuildSystem::appendBuildSystemOutput(addCMakePrefix({msg, QString()}).join('\n')); + BuildSystem::appendBuildSystemOutput(addCMakePrefix({QString(), msg}).join('\n')); emit finished(failedToStartExitCode); return; } @@ -174,14 +174,14 @@ void CMakeProcess::handleProcessDone(const Utils::ProcessResultData &resultData) } if (!msg.isEmpty()) { - BuildSystem::appendBuildSystemOutput(addCMakePrefix({msg, QString()}).join('\n')); + BuildSystem::appendBuildSystemOutput(addCMakePrefix({QString(), msg}).join('\n')); TaskHub::addTask(BuildSystemTask(Task::Error, msg)); } emit finished(code); const QString elapsedTime = Utils::formatElapsedTime(m_elapsed.elapsed()); - BuildSystem::appendBuildSystemOutput(addCMakePrefix({elapsedTime, QString()}).join('\n')); + BuildSystem::appendBuildSystemOutput(addCMakePrefix({QString(), elapsedTime}).join('\n')); } QString addCMakePrefix(const QString &str) From fbe23282fc39e4084699d5ce5079d7f700b19369 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 5 Oct 2023 11:50:59 +0200 Subject: [PATCH 1472/1777] AndroidDeviceManager: Execute avd removal in main thread Instead of executing it blocking in a separate thread. Change-Id: I0d847f22917edc9782467f173728c13287844acb Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/android/androidavdmanager.cpp | 12 ------ src/plugins/android/androidavdmanager.h | 2 +- src/plugins/android/androiddevice.cpp | 46 +++++++++++------------ src/plugins/android/androiddevice.h | 3 +- 4 files changed, 23 insertions(+), 40 deletions(-) diff --git a/src/plugins/android/androidavdmanager.cpp b/src/plugins/android/androidavdmanager.cpp index 6a296be2b9a..dfb78ed29cd 100644 --- a/src/plugins/android/androidavdmanager.cpp +++ b/src/plugins/android/androidavdmanager.cpp @@ -141,18 +141,6 @@ QFuture<CreateAvdInfo> AndroidAvdManager::createAvd(CreateAvdInfo info) const return Utils::asyncRun(&createAvdCommand, m_config, info); } -bool AndroidAvdManager::removeAvd(const QString &name) const -{ - const CommandLine command(m_config.avdManagerToolPath(), {"delete", "avd", "-n", name}); - qCDebug(avdManagerLog).noquote() << "Running command (removeAvd):" << command.toUserOutput(); - Process proc; - proc.setTimeoutS(5); - proc.setEnvironment(m_config.toolsEnvironment()); - proc.setCommand(command); - proc.runBlocking(); - return proc.result() == ProcessResult::FinishedWithSuccess; -} - static void avdConfigEditManufacturerTag(const FilePath &avdPath, bool recoverMode = false) { if (!avdPath.exists()) diff --git a/src/plugins/android/androidavdmanager.h b/src/plugins/android/androidavdmanager.h index 545dedbfe21..807bf2258ed 100644 --- a/src/plugins/android/androidavdmanager.h +++ b/src/plugins/android/androidavdmanager.h @@ -17,7 +17,6 @@ public: ~AndroidAvdManager(); QFuture<CreateAvdInfo> createAvd(CreateAvdInfo info) const; - bool removeAvd(const QString &name) const; QFuture<AndroidDeviceInfoList> avdList() const; QString startAvd(const QString &name) const; @@ -28,6 +27,7 @@ public: static bool avdManagerCommand(const AndroidConfig &config, const QStringList &args, QString *output); + const AndroidConfig &config() const { return m_config; } private: bool waitForBooted(const QString &serialNumber, const std::optional<QFuture<void>> &future = {}) const; diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index 08dc2ca0d15..23cfa76592f 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -474,14 +474,27 @@ void AndroidDeviceManager::eraseAvd(const IDevice::Ptr &device, QWidget *parent) return; qCDebug(androidDeviceLog) << QString("Erasing Android AVD \"%1\" from the system.").arg(name); - m_removeAvdFutureWatcher.setFuture(Utils::asyncRun([this, name, device] { - QPair<IDevice::ConstPtr, bool> pair; - pair.first = device; - pair.second = false; - if (m_avdManager.removeAvd(name)) - pair.second = true; - return pair; - })); + m_removeAvdProcess.reset(new Process); + const AndroidConfig &config = m_avdManager.config(); + const CommandLine command(config.avdManagerToolPath(), {"delete", "avd", "-n", name}); + qCDebug(androidDeviceLog).noquote() << "Running command (removeAvd):" << command.toUserOutput(); + m_removeAvdProcess->setTimeoutS(5); + m_removeAvdProcess->setEnvironment(config.toolsEnvironment()); + m_removeAvdProcess->setCommand(command); + connect(m_removeAvdProcess.get(), &Process::done, this, [this, device] { + const QString name = device->displayName(); + if (m_removeAvdProcess->result() == ProcessResult::FinishedWithSuccess) { + qCDebug(androidDeviceLog, "Android AVD id \"%s\" removed from the system.", + qPrintable(name)); + // Remove the device from QtC after it's been removed using avdmanager. + DeviceManager::instance()->removeDevice(device->id()); + } else { + AndroidDeviceWidget::criticalDialog(Tr::tr("An error occurred while removing the " + "Android AVD \"%1\" using avdmanager tool.").arg(name)); + } + m_removeAvdProcess.release()->deleteLater(); + }); + m_removeAvdProcess->start(); } void AndroidDeviceManager::setupWifiForDevice(const IDevice::Ptr &device, QWidget *parent) @@ -544,20 +557,6 @@ void AndroidDeviceManager::setupWifiForDevice(const IDevice::Ptr &device, QWidge }); } -void AndroidDeviceManager::handleAvdRemoved() -{ - const QPair<IDevice::ConstPtr, bool> result = m_removeAvdFutureWatcher.result(); - const QString name = result.first->displayName(); - if (result.second) { - qCDebug(androidDeviceLog, "Android AVD id \"%s\" removed from the system.", qPrintable(name)); - // Remove the device from QtC after it's been removed using avdmanager. - DeviceManager::instance()->removeDevice(result.first->id()); - } else { - AndroidDeviceWidget::criticalDialog(Tr::tr("An error occurred while removing the " - "Android AVD \"%1\" using avdmanager tool.").arg(name)); - } -} - QString AndroidDeviceManager::emulatorName(const QString &serialNumber) const { QStringList args = AndroidDeviceInfo::adbSelector(serialNumber); @@ -819,8 +818,6 @@ AndroidDeviceManager::AndroidDeviceManager(QObject *parent) m_androidConfig(AndroidConfigurations::currentConfig()), m_avdManager(m_androidConfig) { - connect(&m_removeAvdFutureWatcher, &QFutureWatcherBase::finished, - this, &AndroidDeviceManager::handleAvdRemoved); QTC_ASSERT(!s_instance, return); s_instance = this; } @@ -828,7 +825,6 @@ AndroidDeviceManager::AndroidDeviceManager(QObject *parent) AndroidDeviceManager::~AndroidDeviceManager() { m_avdsFutureWatcher.waitForFinished(); - m_removeAvdFutureWatcher.waitForFinished(); QTC_ASSERT(s_instance == this, return); s_instance = nullptr; } diff --git a/src/plugins/android/androiddevice.h b/src/plugins/android/androiddevice.h index 53a5960e7cc..2ac753e50ab 100644 --- a/src/plugins/android/androiddevice.h +++ b/src/plugins/android/androiddevice.h @@ -101,12 +101,11 @@ private: ~AndroidDeviceManager(); void HandleDevicesListChange(const QString &serialNumber); void HandleAvdsListChange(); - void handleAvdRemoved(); QString emulatorName(const QString &serialNumber) const; QFutureWatcher<AndroidDeviceInfoList> m_avdsFutureWatcher; - QFutureWatcher<QPair<ProjectExplorer::IDevice::ConstPtr, bool>> m_removeAvdFutureWatcher; + std::unique_ptr<Utils::Process> m_removeAvdProcess; QFileSystemWatcher m_avdFileSystemWatcher; std::unique_ptr<Utils::Process> m_adbDeviceWatcherProcess; AndroidConfig &m_androidConfig; From 72118e018eddd6d36e0236f2cdfa401ad9daf535 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 07:35:01 +0200 Subject: [PATCH 1473/1777] CompilationDbParser: Make parseProject() static Don't operate on the same CompilationDbParser instance in the main and the separate threads. Pass needed data as parseProject's arguments. Change-Id: Idf5e5d92727d5a279256673088880e6d2f48a7c1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../compilationdbparser.cpp | 186 +++++++++--------- .../compilationdbparser.h | 11 +- 2 files changed, 93 insertions(+), 104 deletions(-) diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp index 444d9b873a2..5f860956026 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp @@ -18,11 +18,97 @@ #include <QJsonDocument> #include <QJsonObject> +#include <vector> + using namespace ProjectExplorer; using namespace Utils; -namespace CompilationDatabaseProjectManager { -namespace Internal { +namespace CompilationDatabaseProjectManager::Internal { + +static QStringList jsonObjectFlags(const QJsonObject &object, QSet<QString> &flagsCache) +{ + QStringList flags; + const QJsonArray arguments = object["arguments"].toArray(); + if (arguments.isEmpty()) { + flags = splitCommandLine(object["command"].toString(), flagsCache); + } else { + flags.reserve(arguments.size()); + for (const QJsonValue &arg : arguments) { + auto flagIt = flagsCache.insert(arg.toString()); + flags.append(*flagIt); + } + } + return flags; +} + +static FilePath jsonObjectFilePath(const QJsonObject &object) +{ + const FilePath workingDir = FilePath::fromUserInput(object["directory"].toString()); + return workingDir.resolvePath(object["file"].toString()); +} + +static std::vector<DbEntry> readJsonObjects(const QByteArray &projectFileContents) +{ + std::vector<DbEntry> result; + + int objectStart = projectFileContents.indexOf('{'); + int objectEnd = projectFileContents.indexOf('}', objectStart + 1); + + QSet<QString> flagsCache; + while (objectStart >= 0 && objectEnd >= 0) { + const QJsonDocument document = QJsonDocument::fromJson( + projectFileContents.mid(objectStart, objectEnd - objectStart + 1)); + if (document.isNull()) { + // The end was found incorrectly, search for the next one. + objectEnd = projectFileContents.indexOf('}', objectEnd + 1); + continue; + } + + const QJsonObject object = document.object(); + const FilePath filePath = jsonObjectFilePath(object); + const QStringList flags = filterFromFileName(jsonObjectFlags(object, flagsCache), + filePath.fileName()); + result.push_back({flags, filePath, FilePath::fromUserInput(object["directory"].toString())}); + + objectStart = projectFileContents.indexOf('{', objectEnd + 1); + objectEnd = projectFileContents.indexOf('}', objectStart + 1); + } + return result; +} + +static QStringList readExtraFiles(const QString &filePath) +{ + QStringList result; + + QFile file(filePath); + if (file.open(QFile::ReadOnly)) { + QTextStream stream(&file); + while (!stream.atEnd()) { + const QString line = stream.readLine().trimmed(); + if (line.isEmpty() || line.startsWith('#')) + continue; + + result.push_back(line); + } + } + return result; +} + +static DbContents parseProject(const QByteArray &projectFileContents, + const FilePath &projectFilePath) +{ + DbContents dbContents; + dbContents.entries = readJsonObjects(projectFileContents); + dbContents.extraFileName = projectFilePath.toString() + + Constants::COMPILATIONDATABASEPROJECT_FILES_SUFFIX; + dbContents.extras = readExtraFiles(dbContents.extraFileName); + std::sort(dbContents.entries.begin(), dbContents.entries.end(), + [](const DbEntry &lhs, const DbEntry &rhs) { + return std::lexicographical_compare(lhs.flags.begin(), lhs.flags.end(), + rhs.flags.begin(), rhs.flags.end()); + }); + return dbContents; +} CompilationDbParser::CompilationDbParser(const QString &projectName, const FilePath &projectPath, @@ -82,7 +168,7 @@ void CompilationDbParser::start() return isIgnored; }); - m_treeScanner->setTypeFactory([](const Utils::MimeType &mimeType, const Utils::FilePath &fn) { + m_treeScanner->setTypeFactory([](const MimeType &mimeType, const FilePath &fn) { return TreeScanner::genericFileType(mimeType, fn); }); m_treeScanner->asyncScanForFiles(m_rootPath); @@ -95,7 +181,7 @@ void CompilationDbParser::start() } // Thread 2: Parse the project file. - const QFuture<DbContents> future = Utils::asyncRun(&CompilationDbParser::parseProject, this); + const auto future = Utils::asyncRun(parseProject, m_projectFileContents, m_projectFilePath); Core::ProgressManager::addTask(future, Tr::tr("Parse \"%1\" project").arg(m_projectName), "CompilationDatabase.Parse"); @@ -138,94 +224,4 @@ void CompilationDbParser::finish(ParseResult result) deleteLater(); } -static QStringList jsonObjectFlags(const QJsonObject &object, QSet<QString> &flagsCache) -{ - QStringList flags; - const QJsonArray arguments = object["arguments"].toArray(); - if (arguments.isEmpty()) { - flags = splitCommandLine(object["command"].toString(), flagsCache); - } else { - flags.reserve(arguments.size()); - for (const QJsonValue &arg : arguments) { - auto flagIt = flagsCache.insert(arg.toString()); - flags.append(*flagIt); - } - } - - return flags; -} - -static FilePath jsonObjectFilePath(const QJsonObject &object) -{ - const FilePath workingDir = FilePath::fromUserInput(object["directory"].toString()); - return workingDir.resolvePath(object["file"].toString()); -} - -std::vector<DbEntry> CompilationDbParser::readJsonObjects() const -{ - std::vector<DbEntry> result; - - int objectStart = m_projectFileContents.indexOf('{'); - int objectEnd = m_projectFileContents.indexOf('}', objectStart + 1); - - QSet<QString> flagsCache; - while (objectStart >= 0 && objectEnd >= 0) { - const QJsonDocument document = QJsonDocument::fromJson( - m_projectFileContents.mid(objectStart, objectEnd - objectStart + 1)); - if (document.isNull()) { - // The end was found incorrectly, search for the next one. - objectEnd = m_projectFileContents.indexOf('}', objectEnd + 1); - continue; - } - - const QJsonObject object = document.object(); - const Utils::FilePath filePath = jsonObjectFilePath(object); - const QStringList flags = filterFromFileName(jsonObjectFlags(object, flagsCache), - filePath.fileName()); - result.push_back({flags, filePath, FilePath::fromUserInput(object["directory"].toString())}); - - objectStart = m_projectFileContents.indexOf('{', objectEnd + 1); - objectEnd = m_projectFileContents.indexOf('}', objectStart + 1); - } - - return result; -} - -static QStringList readExtraFiles(const QString &filePath) -{ - QStringList result; - - QFile file(filePath); - if (file.open(QFile::ReadOnly)) { - QTextStream stream(&file); - - while (!stream.atEnd()) { - const QString line = stream.readLine().trimmed(); - - if (line.isEmpty() || line.startsWith('#')) - continue; - - result.push_back(line); - } - } - - return result; -} - -DbContents CompilationDbParser::parseProject() -{ - DbContents dbContents; - dbContents.entries = readJsonObjects(); - dbContents.extraFileName = m_projectFilePath.toString() + - Constants::COMPILATIONDATABASEPROJECT_FILES_SUFFIX; - dbContents.extras = readExtraFiles(dbContents.extraFileName); - std::sort(dbContents.entries.begin(), dbContents.entries.end(), - [](const DbEntry &lhs, const DbEntry &rhs) { - return std::lexicographical_compare(lhs.flags.begin(), lhs.flags.end(), - rhs.flags.begin(), rhs.flags.end()); - }); - return dbContents; -} - -} // namespace Internal -} // namespace CompilationDatabaseProjectManager +} // namespace CompilationDatabaseProjectManager::Internal diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.h b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.h index d0d8eb80798..a06ba82581e 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.h +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.h @@ -10,19 +10,15 @@ #include <utils/fileutils.h> #include <QFutureWatcher> -#include <QList> #include <QObject> #include <QStringList> -#include <vector> - namespace ProjectExplorer { class FileNode; class TreeScanner; } -namespace CompilationDatabaseProjectManager { -namespace Internal { +namespace CompilationDatabaseProjectManager::Internal { enum class ParseResult { Success, Failure, Cached }; @@ -56,8 +52,6 @@ signals: private: void parserJobFinished(); void finish(ParseResult result); - DbContents parseProject(); - std::vector<DbEntry> readJsonObjects() const; const QString m_projectName; const Utils::FilePath m_projectFilePath; @@ -73,5 +67,4 @@ private: ProjectExplorer::BuildSystem::ParseGuard m_guard; }; -} // namespace Internal -} // namespace CompilationDatabaseProjectManager +} // namespace CompilationDatabaseProjectManager::Internal From e4ae894c96c476dc6874a81f492380e00fa0fbdb Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 13:23:53 +0200 Subject: [PATCH 1474/1777] FileApiReader: Make stopping faster On the session switch we are busy waiting for the running async task, started before by the FileApiReader::endState(). This blocks the main thread for considerable amount of time. E.g. when switching between sessions both containing Qt project, it may block the main thread up to 10 seconds. Instead, we employ the future synchronizer and move the awaiting to the shutdown phase. The next patch is going to limit the awaiting in shutdown phase. Task-number: QTCREATORBUG-27729 Change-Id: I956ed26edcd699d8a4e2b9309d109963f1d4bb20 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/fileapireader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp index 7c27c2e5b53..a3038815b4e 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.cpp +++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp @@ -11,10 +11,13 @@ #include <coreplugin/messagemanager.h> +#include <extensionsystem/pluginmanager.h> + #include <projectexplorer/projectexplorer.h> #include <utils/algorithm.h> #include <utils/async.h> +#include <utils/futuresynchronizer.h> #include <utils/qtcassert.h> #include <utils/temporarydirectory.h> @@ -168,7 +171,7 @@ void FileApiReader::stop() if (m_future) { m_future->cancel(); - m_future->waitForFinished(); + ExtensionSystem::PluginManager::futureSynchronizer()->addFuture(*m_future); } m_future = {}; m_isParsing = false; From ee48dba19e777a6ed7ffc639c60480167e01bf4c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 14:47:46 +0200 Subject: [PATCH 1475/1777] FileApiReader: Make shutdown faster Check more often for canceled future. Make more functions static. Fixes: QTCREATORBUG-27729 Change-Id: I8dd787acea6343008c7515fb6a4fdfde50b37aee Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../fileapidataextractor.cpp | 411 ++++++++++-------- .../fileapidataextractor.h | 5 +- .../cmakeprojectmanager/fileapireader.cpp | 11 +- 3 files changed, 243 insertions(+), 184 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 96d991d1e17..89993f24056 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -12,10 +12,10 @@ #include <cppeditor/cppeditorconstants.h> #include <utils/algorithm.h> +#include <utils/icon.h> #include <utils/mimeutils.h> #include <utils/process.h> #include <utils/qtcassert.h> -#include <utils/icon.h> #include <projectexplorer/projecttree.h> @@ -45,14 +45,13 @@ public: std::vector<std::unique_ptr<ProjectExplorer::FileNode>> cmakeListNodes; }; -CMakeFileResult extractCMakeFilesData(const std::vector<CMakeFileInfo> &cmakefiles, - const FilePath &sourceDirectory, - const FilePath &buildDirectory) +static CMakeFileResult extractCMakeFilesData(const QFuture<void> &cancelFuture, + const std::vector<CMakeFileInfo> &cmakefiles, + const FilePath &sourceDirectory, + const FilePath &buildDirectory) { - CMakeFileResult result; - if (cmakefiles.empty()) - return result; + return {}; // Uniquify fileInfos std::set<CMakeFileInfo> cmakeFileSet{cmakefiles.begin(), cmakefiles.end()}; @@ -60,7 +59,9 @@ CMakeFileResult extractCMakeFilesData(const std::vector<CMakeFileInfo> &cmakefil // Load and parse cmake files. We use concurrency here to speed up the process of // reading many small files, which can get slow especially on remote devices. QFuture<CMakeFileInfo> mapResult - = QtConcurrent::mapped(cmakeFileSet, [sourceDirectory](const auto &info) { + = QtConcurrent::mapped(cmakeFileSet, [cancelFuture, sourceDirectory](const auto &info) { + if (cancelFuture.isCanceled()) + return CMakeFileInfo(); const FilePath sfn = sourceDirectory.resolvePath(info.path); CMakeFileInfo absolute(info); absolute.path = sfn; @@ -86,7 +87,15 @@ CMakeFileResult extractCMakeFilesData(const std::vector<CMakeFileInfo> &cmakefil mapResult.waitForFinished(); + if (cancelFuture.isCanceled()) + return {}; + + CMakeFileResult result; + for (const auto &info : mapResult.results()) { + if (cancelFuture.isCanceled()) + return {}; + result.cmakeFiles.insert(info); if (info.isCMake && !info.isCMakeListsDotTxt) { @@ -132,22 +141,17 @@ public: std::vector<TargetDetails> targetDetails; }; -PreprocessedData preprocess(FileApiData &data, - const FilePath &sourceDirectory, - const FilePath &buildDirectory, - QString &errorMessage) +static PreprocessedData preprocess(const QFuture<void> &cancelFuture, FileApiData &data, + const FilePath &sourceDirectory, const FilePath &buildDirectory) { - Q_UNUSED(errorMessage) - PreprocessedData result; result.cache = std::move(data.cache); // Make sure this is available, even when nothing else is result.codemodel = std::move(data.codemodel); - CMakeFileResult cmakeFileResult = extractCMakeFilesData(data.cmakeFiles, - sourceDirectory, - buildDirectory); + CMakeFileResult cmakeFileResult = extractCMakeFilesData(cancelFuture, data.cmakeFiles, + sourceDirectory, buildDirectory); result.cmakeFiles = std::move(cmakeFileResult.cmakeFiles); result.cmakeNodesSource = std::move(cmakeFileResult.cmakeNodesSource); @@ -160,10 +164,11 @@ PreprocessedData preprocess(FileApiData &data, return result; } -QVector<FolderNode::LocationInfo> extractBacktraceInformation(const BacktraceInfo &backtraces, - const FilePath &sourceDir, - int backtraceIndex, - unsigned int locationInfoPriority) +static QVector<FolderNode::LocationInfo> extractBacktraceInformation( + const BacktraceInfo &backtraces, + const FilePath &sourceDir, + int backtraceIndex, + unsigned int locationInfoPriority) { QVector<FolderNode::LocationInfo> info; // Set up a default target path: @@ -200,135 +205,145 @@ static bool isChildOf(const FilePath &path, const FilePaths &prefixes) return false; } -QList<CMakeBuildTarget> generateBuildTargets(const PreprocessedData &input, - const FilePath &sourceDirectory, - const FilePath &buildDirectory, - bool haveLibrariesRelativeToBuildDirectory) +static CMakeBuildTarget toBuildTarget(const TargetDetails &t, + const FilePath &sourceDirectory, + const FilePath &buildDirectory, + bool relativeLibs) { - const QList<CMakeBuildTarget> result = transform<QList>(input.targetDetails, - [&sourceDirectory, &buildDirectory, - &haveLibrariesRelativeToBuildDirectory](const TargetDetails &t) { - const FilePath currentBuildDir = buildDirectory.resolvePath(t.buildDir); + const FilePath currentBuildDir = buildDirectory.resolvePath(t.buildDir); - CMakeBuildTarget ct; - ct.title = t.name; - if (!t.artifacts.isEmpty()) - ct.executable = buildDirectory.resolvePath(t.artifacts.at(0)); - TargetType type = UtilityType; - if (t.type == "EXECUTABLE") - type = ExecutableType; - else if (t.type == "STATIC_LIBRARY") - type = StaticLibraryType; - else if (t.type == "OBJECT_LIBRARY") - type = ObjectLibraryType; - else if (t.type == "MODULE_LIBRARY" || t.type == "SHARED_LIBRARY") - type = DynamicLibraryType; - else - type = UtilityType; - ct.targetType = type; - ct.workingDirectory = ct.executable.isEmpty() - ? currentBuildDir.absolutePath() - : ct.executable.parentDir(); - ct.sourceDirectory = sourceDirectory.resolvePath(t.sourceDir); + CMakeBuildTarget ct; + ct.title = t.name; + if (!t.artifacts.isEmpty()) + ct.executable = buildDirectory.resolvePath(t.artifacts.at(0)); + TargetType type = UtilityType; + if (t.type == "EXECUTABLE") + type = ExecutableType; + else if (t.type == "STATIC_LIBRARY") + type = StaticLibraryType; + else if (t.type == "OBJECT_LIBRARY") + type = ObjectLibraryType; + else if (t.type == "MODULE_LIBRARY" || t.type == "SHARED_LIBRARY") + type = DynamicLibraryType; + else + type = UtilityType; + ct.targetType = type; + ct.workingDirectory = ct.executable.isEmpty() + ? currentBuildDir.absolutePath() + : ct.executable.parentDir(); + ct.sourceDirectory = sourceDirectory.resolvePath(t.sourceDir); - ct.backtrace = extractBacktraceInformation(t.backtraceGraph, sourceDirectory, t.backtrace, 0); + ct.backtrace = extractBacktraceInformation(t.backtraceGraph, sourceDirectory, t.backtrace, 0); - for (const DependencyInfo &d : t.dependencies) { - ct.dependencyDefinitions.append( - extractBacktraceInformation(t.backtraceGraph, sourceDirectory, d.backtrace, 100)); - } - for (const SourceInfo &si : t.sources) { - ct.sourceDefinitions.append( - extractBacktraceInformation(t.backtraceGraph, sourceDirectory, si.backtrace, 200)); - } - for (const CompileInfo &ci : t.compileGroups) { - for (const IncludeInfo &ii : ci.includes) { - ct.includeDefinitions.append( - extractBacktraceInformation(t.backtraceGraph, sourceDirectory, ii.backtrace, 300)); + for (const DependencyInfo &d : t.dependencies) { + ct.dependencyDefinitions.append( + extractBacktraceInformation(t.backtraceGraph, sourceDirectory, d.backtrace, 100)); + } + for (const SourceInfo &si : t.sources) { + ct.sourceDefinitions.append( + extractBacktraceInformation(t.backtraceGraph, sourceDirectory, si.backtrace, 200)); + } + for (const CompileInfo &ci : t.compileGroups) { + for (const IncludeInfo &ii : ci.includes) { + ct.includeDefinitions.append( + extractBacktraceInformation(t.backtraceGraph, sourceDirectory, ii.backtrace, 300)); + } + for (const DefineInfo &di : ci.defines) { + ct.defineDefinitions.append( + extractBacktraceInformation(t.backtraceGraph, sourceDirectory, di.backtrace, 400)); + } + } + for (const InstallDestination &id : t.installDestination) { + ct.installDefinitions.append( + extractBacktraceInformation(t.backtraceGraph, sourceDirectory, id.backtrace, 500)); + } + + if (ct.targetType == ExecutableType) { + Utils::FilePaths librarySeachPaths; + // Is this a GUI application? + ct.linksToQtGui = Utils::contains(t.link.value().fragments, + [](const FragmentInfo &f) { + return f.role == "libraries" + && (f.fragment.contains("QtGui") + || f.fragment.contains("Qt5Gui") + || f.fragment.contains("Qt6Gui")); + }); + + ct.qtcRunnable = t.folderTargetProperty == "qtc_runnable"; + + // Extract library directories for executables: + for (const FragmentInfo &f : t.link.value().fragments) { + if (f.role == "flags") // ignore all flags fragments + continue; + + // CMake sometimes mixes several shell-escaped pieces into one fragment. Disentangle that again: + const QStringList parts = ProcessArgs::splitArgs(f.fragment, HostOsInfo::hostOs()); + for (QString part : parts) { + // Library search paths that are added with target_link_directories are added as + // -LIBPATH:... (Windows/MSVC), or + // -L... (Unix/GCC) + // with role "libraryPath" + if (f.role == "libraryPath") { + if (part.startsWith("-LIBPATH:")) + part = part.mid(9); + else if (part.startsWith("-L")) + part = part.mid(2); } - for (const DefineInfo &di : ci.defines) { - ct.defineDefinitions.append( - extractBacktraceInformation(t.backtraceGraph, sourceDirectory, di.backtrace, 400)); - } - } - for (const InstallDestination &id : t.installDestination) { - ct.installDefinitions.append( - extractBacktraceInformation(t.backtraceGraph, sourceDirectory, id.backtrace, 500)); - } - if (ct.targetType == ExecutableType) { - Utils::FilePaths librarySeachPaths; - // Is this a GUI application? - ct.linksToQtGui = Utils::contains(t.link.value().fragments, - [](const FragmentInfo &f) { - return f.role == "libraries" - && (f.fragment.contains("QtGui") - || f.fragment.contains("Qt5Gui") - || f.fragment.contains("Qt6Gui")); - }); + // Some projects abuse linking to libraries to pass random flags to the linker, so ignore + // flags mixed into a fragment + if (part.startsWith("-")) + continue; - ct.qtcRunnable = t.folderTargetProperty == "qtc_runnable"; + const FilePath buildDir = relativeLibs ? buildDirectory : currentBuildDir; + FilePath tmp = buildDir.resolvePath(part); - // Extract library directories for executables: - for (const FragmentInfo &f : t.link.value().fragments) { - if (f.role == "flags") // ignore all flags fragments - continue; + if (f.role == "libraries") + tmp = tmp.parentDir(); - // CMake sometimes mixes several shell-escaped pieces into one fragment. Disentangle that again: - const QStringList parts = ProcessArgs::splitArgs(f.fragment, HostOsInfo::hostOs()); - for (QString part : parts) { - // Library search paths that are added with target_link_directories are added as - // -LIBPATH:... (Windows/MSVC), or - // -L... (Unix/GCC) - // with role "libraryPath" - if (f.role == "libraryPath") { - if (part.startsWith("-LIBPATH:")) - part = part.mid(9); - else if (part.startsWith("-L")) - part = part.mid(2); - } - - // Some projects abuse linking to libraries to pass random flags to the linker, so ignore - // flags mixed into a fragment - if (part.startsWith("-")) - continue; - - const FilePath buildDir = haveLibrariesRelativeToBuildDirectory ? buildDirectory : currentBuildDir; - FilePath tmp = buildDir.resolvePath(part); - - if (f.role == "libraries") - tmp = tmp.parentDir(); - - if (!tmp.isEmpty() && tmp.isDir()) { - // f.role is libraryPath or frameworkPath - // On *nix, exclude sub-paths from "/lib(64)", "/usr/lib(64)" and - // "/usr/local/lib" since these are usually in the standard search - // paths. There probably are more, but the naming schemes are arbitrary - // so we'd need to ask the linker ("ld --verbose | grep SEARCH_DIR"). - if (buildDir.osType() == OsTypeWindows - || !isChildOf(tmp, - {"/lib", - "/lib64", - "/usr/lib", - "/usr/lib64", - "/usr/local/lib"})) { - librarySeachPaths.append(tmp); - // Libraries often have their import libs in ../lib and the - // actual dll files in ../bin on windows. Qt is one example of that. - if (tmp.fileName() == "lib" && buildDir.osType() == OsTypeWindows) { - const FilePath path = tmp.parentDir().pathAppended("bin"); - if (path.isDir()) - librarySeachPaths.append(path); - } - } + if (!tmp.isEmpty() && tmp.isDir()) { + // f.role is libraryPath or frameworkPath + // On *nix, exclude sub-paths from "/lib(64)", "/usr/lib(64)" and + // "/usr/local/lib" since these are usually in the standard search + // paths. There probably are more, but the naming schemes are arbitrary + // so we'd need to ask the linker ("ld --verbose | grep SEARCH_DIR"). + if (buildDir.osType() == OsTypeWindows + || !isChildOf(tmp, + {"/lib", + "/lib64", + "/usr/lib", + "/usr/lib64", + "/usr/local/lib"})) { + librarySeachPaths.append(tmp); + // Libraries often have their import libs in ../lib and the + // actual dll files in ../bin on windows. Qt is one example of that. + if (tmp.fileName() == "lib" && buildDir.osType() == OsTypeWindows) { + const FilePath path = tmp.parentDir().pathAppended("bin"); + if (path.isDir()) + librarySeachPaths.append(path); } } } - ct.libraryDirectories = filteredUnique(librarySeachPaths); } + } + ct.libraryDirectories = filteredUnique(librarySeachPaths); + } + return ct; +} - return ct; - }); +static QList<CMakeBuildTarget> generateBuildTargets(const QFuture<void> &cancelFuture, + const PreprocessedData &input, + const FilePath &sourceDirectory, + const FilePath &buildDirectory, + bool relativeLibs) +{ + QList<CMakeBuildTarget> result; + result.reserve(input.targetDetails.size()); + for (const TargetDetails &t : input.targetDetails) { + if (cancelFuture.isCanceled()) + return {}; + result.append(toBuildTarget(t, sourceDirectory, buildDirectory, relativeLibs)); + } return result; } @@ -341,24 +356,28 @@ static QStringList splitFragments(const QStringList &fragments) return result; } -bool isPchFile(const FilePath &buildDirectory, const FilePath &path) +static bool isPchFile(const FilePath &buildDirectory, const FilePath &path) { return path.isChildOf(buildDirectory) && path.fileName().startsWith("cmake_pch"); } -bool isUnityFile(const FilePath &buildDirectory, const FilePath &path) +static bool isUnityFile(const FilePath &buildDirectory, const FilePath &path) { return path.isChildOf(buildDirectory) && path.parentDir().fileName() == "Unity" && path.fileName().startsWith("unity_"); } -RawProjectParts generateRawProjectParts(const PreprocessedData &input, - const FilePath &sourceDirectory, - const FilePath &buildDirectory) +static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture, + const PreprocessedData &input, + const FilePath &sourceDirectory, + const FilePath &buildDirectory) { RawProjectParts rpps; for (const TargetDetails &t : input.targetDetails) { + if (cancelFuture.isCanceled()) + return {}; + bool needPostfix = t.compileGroups.size() > 1; int count = 1; for (const CompileInfo &ci : t.compileGroups) { @@ -520,7 +539,9 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input, return rpps; } -FilePath directorySourceDir(const Configuration &c, const FilePath &sourceDir, int directoryIndex) +static FilePath directorySourceDir(const Configuration &c, + const FilePath &sourceDir, + int directoryIndex) { const size_t di = static_cast<size_t>(directoryIndex); QTC_ASSERT(di < c.directories.size(), return {}); @@ -528,7 +549,9 @@ FilePath directorySourceDir(const Configuration &c, const FilePath &sourceDir, i return sourceDir.resolvePath(c.directories[di].sourcePath); } -FilePath directoryBuildDir(const Configuration &c, const FilePath &buildDir, int directoryIndex) +static FilePath directoryBuildDir(const Configuration &c, + const FilePath &buildDir, + int directoryIndex) { const size_t di = static_cast<size_t>(directoryIndex); QTC_ASSERT(di < c.directories.size(), return {}); @@ -536,11 +559,15 @@ FilePath directoryBuildDir(const Configuration &c, const FilePath &buildDir, int return buildDir.resolvePath(c.directories[di].buildPath); } -void addProjects(const QHash<Utils::FilePath, ProjectNode *> &cmakeListsNodes, - const Configuration &config, - const FilePath &sourceDir) +static void addProjects(const QFuture<void> &cancelFuture, + const QHash<Utils::FilePath, ProjectNode *> &cmakeListsNodes, + const Configuration &config, + const FilePath &sourceDir) { for (const FileApiDetails::Project &p : config.projects) { + if (cancelFuture.isCanceled()) + return; + if (p.parent == -1) continue; // Top-level project has already been covered FilePath dir = directorySourceDir(config, sourceDir, p.directories[0]); @@ -548,9 +575,9 @@ void addProjects(const QHash<Utils::FilePath, ProjectNode *> &cmakeListsNodes, } } -FolderNode *createSourceGroupNode(const QString &sourceGroupName, - const FilePath &sourceDirectory, - FolderNode *targetRoot) +static FolderNode *createSourceGroupNode(const QString &sourceGroupName, + const FilePath &sourceDirectory, + FolderNode *targetRoot) { FolderNode *currentNode = targetRoot; @@ -576,11 +603,11 @@ FolderNode *createSourceGroupNode(const QString &sourceGroupName, return currentNode; } -void addCompileGroups(ProjectNode *targetRoot, - const Utils::FilePath &topSourceDirectory, - const Utils::FilePath &sourceDirectory, - const Utils::FilePath &buildDirectory, - const TargetDetails &td) +static void addCompileGroups(ProjectNode *targetRoot, + const Utils::FilePath &topSourceDirectory, + const Utils::FilePath &sourceDirectory, + const Utils::FilePath &buildDirectory, + const TargetDetails &td) { const bool showSourceFolders = settings().showSourceSubFolders(); const bool inSourceBuild = (sourceDirectory == buildDirectory); @@ -683,11 +710,12 @@ static void addGeneratedFilesNode(ProjectNode *targetRoot, const FilePath &topLe addCMakeVFolder(targetRoot, buildDir, 10, Tr::tr("<Generated Files>"), std::move(nodes)); } -void addTargets(const QHash<Utils::FilePath, ProjectExplorer::ProjectNode *> &cmakeListsNodes, - const Configuration &config, - const std::vector<TargetDetails> &targetDetails, - const FilePath &sourceDir, - const FilePath &buildDir) +static void addTargets(const QFuture<void> &cancelFuture, + const QHash<Utils::FilePath, ProjectExplorer::ProjectNode *> &cmakeListsNodes, + const Configuration &config, + const std::vector<TargetDetails> &targetDetails, + const FilePath &sourceDir, + const FilePath &buildDir) { QHash<QString, const TargetDetails *> targetDetailsHash; for (const TargetDetails &t : targetDetails) @@ -702,6 +730,9 @@ void addTargets(const QHash<Utils::FilePath, ProjectExplorer::ProjectNode *> &cm }; for (const FileApiDetails::Target &t : config.targets) { + if (cancelFuture.isCanceled()) + return; + const TargetDetails &td = getTargetDetails(t.id); const FilePath dir = directorySourceDir(config, sourceDir, t.directory); @@ -717,8 +748,10 @@ void addTargets(const QHash<Utils::FilePath, ProjectExplorer::ProjectNode *> &cm } } -std::unique_ptr<CMakeProjectNode> generateRootProjectNode( - PreprocessedData &data, const FilePath &sourceDirectory, const FilePath &buildDirectory) +static std::unique_ptr<CMakeProjectNode> generateRootProjectNode(const QFuture<void> &cancelFuture, + PreprocessedData &data, + const FilePath &sourceDirectory, + const FilePath &buildDirectory) { std::unique_ptr<CMakeProjectNode> result = std::make_unique<CMakeProjectNode>(sourceDirectory); @@ -733,25 +766,34 @@ std::unique_ptr<CMakeProjectNode> generateRootProjectNode( std::move(data.cmakeListNodes)); data.cmakeListNodes.clear(); // Remove all the nullptr in the vector... - addProjects(cmakeListsNodes, data.codemodel, sourceDirectory); + addProjects(cancelFuture, cmakeListsNodes, data.codemodel, sourceDirectory); + if (cancelFuture.isCanceled()) + return {}; - addTargets(cmakeListsNodes, + addTargets(cancelFuture, + cmakeListsNodes, data.codemodel, data.targetDetails, sourceDirectory, buildDirectory); + if (cancelFuture.isCanceled()) + return {}; if (!data.cmakeNodesSource.empty() || !data.cmakeNodesBuild.empty() - || !data.cmakeNodesOther.empty()) + || !data.cmakeNodesOther.empty()) { addCMakeInputs(result.get(), sourceDirectory, buildDirectory, std::move(data.cmakeNodesSource), std::move(data.cmakeNodesBuild), std::move(data.cmakeNodesOther)); - + } + if (cancelFuture.isCanceled()) + return {}; addCMakePresets(result.get(), sourceDirectory); + if (cancelFuture.isCanceled()) + return {}; data.cmakeNodesSource.clear(); // Remove all the nullptr in the vector... data.cmakeNodesBuild.clear(); // Remove all the nullptr in the vector... @@ -760,7 +802,9 @@ std::unique_ptr<CMakeProjectNode> generateRootProjectNode( return result; } -void setupLocationInfoForTargets(CMakeProjectNode *rootNode, const QList<CMakeBuildTarget> &targets) +static void setupLocationInfoForTargets(const QFuture<void> &cancelFuture, + CMakeProjectNode *rootNode, + const QList<CMakeBuildTarget> &targets) { const QSet<QString> titles = Utils::transform<QSet>(targets, &CMakeBuildTarget::title); QHash<QString, FolderNode *> buildKeyToNode; @@ -771,6 +815,9 @@ void setupLocationInfoForTargets(CMakeProjectNode *rootNode, const QList<CMakeBu buildKeyToNode.insert(buildKey, folderNode); }); for (const CMakeBuildTarget &t : targets) { + if (cancelFuture.isCanceled()) + return; + FolderNode *folderNode = buildKeyToNode.value(t.title); if (folderNode) { QSet<std::pair<FilePath, int>> locations; @@ -811,33 +858,43 @@ using namespace FileApiDetails; // extractData: // -------------------------------------------------------------------- -FileApiQtcData extractData(FileApiData &input, - const FilePath &sourceDirectory, - const FilePath &buildDirectory) +FileApiQtcData extractData(const QFuture<void> &cancelFuture, FileApiData &input, + const Utils::FilePath &sourceDir, const Utils::FilePath &buildDir) { FileApiQtcData result; // Preprocess our input: - PreprocessedData data = preprocess(input, sourceDirectory, buildDirectory, result.errorMessage); - result.cache = std::move(data.cache); // Make sure this is available, even when nothing else is - if (!result.errorMessage.isEmpty()) { + PreprocessedData data = preprocess(cancelFuture, input, sourceDir, buildDir); + if (cancelFuture.isCanceled()) + return {}; + + result.cache = std::move(data.cache); // Make sure this is available, even when nothing else is + if (!result.errorMessage.isEmpty()) return {}; - } // Ninja generator from CMake version 3.20.5 has libraries relative to build directory const bool haveLibrariesRelativeToBuildDirectory = input.replyFile.generator.startsWith("Ninja") && input.replyFile.cmakeVersion >= QVersionNumber(3, 20, 5); - result.buildTargets = generateBuildTargets(data, sourceDirectory, buildDirectory, haveLibrariesRelativeToBuildDirectory); + result.buildTargets = generateBuildTargets(cancelFuture, data, sourceDir, buildDir, + haveLibrariesRelativeToBuildDirectory); + if (cancelFuture.isCanceled()) + return {}; result.cmakeFiles = std::move(data.cmakeFiles); - result.projectParts = generateRawProjectParts(data, sourceDirectory, buildDirectory); + result.projectParts = generateRawProjectParts(cancelFuture, data, sourceDir, buildDir); + if (cancelFuture.isCanceled()) + return {}; - auto rootProjectNode = generateRootProjectNode(data, sourceDirectory, buildDirectory); + auto rootProjectNode = generateRootProjectNode(cancelFuture, data, sourceDir, buildDir); + if (cancelFuture.isCanceled()) + return {}; ProjectTree::applyTreeManager(rootProjectNode.get(), ProjectTree::AsyncPhase); // QRC nodes result.rootProjectNode = std::move(rootProjectNode); - setupLocationInfoForTargets(result.rootProjectNode.get(), result.buildTargets); + setupLocationInfoForTargets(cancelFuture, result.rootProjectNode.get(), result.buildTargets); + if (cancelFuture.isCanceled()) + return {}; result.ctestPath = input.replyFile.ctestExecutable; result.isMultiConfig = input.replyFile.isMultiConfig; diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.h b/src/plugins/cmakeprojectmanager/fileapidataextractor.h index 946833b1c34..dbe562421e6 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.h +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.h @@ -52,8 +52,7 @@ public: bool usesAllCapsTargets = false; }; -FileApiQtcData extractData(FileApiData &data, - const Utils::FilePath &sourceDirectory, - const Utils::FilePath &buildDirectory); +FileApiQtcData extractData(const QFuture<void> &cancelFuture, FileApiData &input, + const Utils::FilePath &sourceDir, const Utils::FilePath &buildDir); } // CMakeProjectManager::Internal diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp index a3038815b4e..732be976b7e 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.cpp +++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp @@ -252,7 +252,8 @@ void FileApiReader::endState(const FilePath &replyFilePath, bool restoredFromBac const FilePath sourceDirectory = m_parameters.sourceDirectory; const FilePath buildDirectory = m_parameters.buildDirectory; - const QString cmakeBuildType = m_parameters.cmakeBuildType == "Build" ? "" : m_parameters.cmakeBuildType; + const QString cmakeBuildType = m_parameters.cmakeBuildType == "Build" + ? "" : m_parameters.cmakeBuildType; m_lastReplyTimestamp = replyFilePath.lastModified(); @@ -264,10 +265,12 @@ void FileApiReader::endState(const FilePath &replyFilePath, bool restoredFromBac replyFilePath, cmakeBuildType, result->errorMessage); - if (result->errorMessage.isEmpty()) - *result = extractData(data, sourceDirectory, buildDirectory); - else + if (result->errorMessage.isEmpty()) { + *result = extractData(QFuture<void>(promise.future()), data, + sourceDirectory, buildDirectory); + } else { qWarning() << result->errorMessage; + } promise.addResult(result); }); From a31287dfe1858ab49a3c33fb3b2d9cda6c865d2b Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 18:44:30 +0200 Subject: [PATCH 1476/1777] IosToolHandler: Avoid 3 arg connect Fix signal arg for LogTailFiles::logMessage(). Change-Id: I8d50ee954e9fff2ececfcb17766e0b0cccb98a2b Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/ios/iostoolhandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/ios/iostoolhandler.cpp b/src/plugins/ios/iostoolhandler.cpp index 3d6fe1cfde1..67f4fb981c5 100644 --- a/src/plugins/ios/iostoolhandler.cpp +++ b/src/plugins/ios/iostoolhandler.cpp @@ -50,8 +50,8 @@ static QString CONSOLE_PATH_TEMPLATE = QDir::homePath() + class LogTailFiles : public QObject { Q_OBJECT -public: +public: void exec(QPromise<void> &promise, std::shared_ptr<QTemporaryFile> stdoutFile, std::shared_ptr<QTemporaryFile> stderrFile) { @@ -87,7 +87,7 @@ public: } signals: - void logMessage(QString message); + void logMessage(const QString &message); }; struct ParserState { @@ -727,7 +727,7 @@ IosSimulatorToolHandlerPrivate::IosSimulatorToolHandlerPrivate(const IosDeviceTy : IosToolHandlerPrivate(devType, q) { QObject::connect(&outputLogger, &LogTailFiles::logMessage, - std::bind(&IosToolHandlerPrivate::appOutput, this, _1)); + q, [q](const QString &message) { q->appOutput(q, message); }); } void IosSimulatorToolHandlerPrivate::requestTransferApp(const FilePath &appBundlePath, From 1d2c942360bb1a32a789519cef766928af0a1f98 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 6 Oct 2023 21:35:11 +0200 Subject: [PATCH 1477/1777] CMakePM: Only process cmake files for include and modules ... and not for every function. Just the CMake files. Change-Id: I6e361f4913f8334942a3135adaa0480fdc0cee31 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index e6ee235e62c..025676ef579 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1432,9 +1432,9 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() handleImportedTargets(cmakeFile, func); handleProjectTargets(cmakeFile, func); handleFindPackageVariables(cmakeFile, func); - handleDotCMakeFiles(cmakeFile); - handleFindPackageCMakeFiles(cmakeFile); } + handleDotCMakeFiles(cmakeFile); + handleFindPackageCMakeFiles(cmakeFile); } m_projectFindPackageVariables.removeDuplicates(); From a70ead958e3e0a01701eef2521fb38af9d1329bb Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 5 Oct 2023 10:31:26 +0200 Subject: [PATCH 1478/1777] Docker: Use "type" instead of "which" "which" fails for builtin commands, while "type" finds both builtin and executables. Change-Id: I2e508a01e28b827ed498add50f8faa9d58551e59 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/utils/deviceshell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/deviceshell.cpp b/src/libs/utils/deviceshell.cpp index 9c117ea0c5a..6d99d399841 100644 --- a/src/libs/utils/deviceshell.cpp +++ b/src/libs/utils/deviceshell.cpp @@ -232,7 +232,7 @@ expected_str<void> DeviceShell::start() expected_str<QByteArray> DeviceShell::checkCommand(const QByteArray &command) { - const QByteArray checkCmd = "(which " + command + " || echo '<missing>')\n"; + const QByteArray checkCmd = "(type " + command + " || echo '<missing>')\n"; m_shellProcess->writeRaw(checkCmd); if (!m_shellProcess->waitForReadyRead()) { From 3984108c0cd51d114c1becea09dc3fe576df2ad1 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 9 Oct 2023 09:50:43 +0200 Subject: [PATCH 1479/1777] CMakeFileCompletionAssist: Limit the size of PerformInputData The size should drop down to 184 (from 264) bytes. Amends 07e758147b90a9e35944fd14acbc27ca1336594b Change-Id: Ia07b153f3f75b9e7b6199d857d58bffbb7b3e7d4 Reviewed-by: hjk <hjk@qt.io> --- .../cmakefilecompletionassist.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 0eb312736b5..1ca5e5f23f7 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -254,7 +254,8 @@ class PerformInputData { public: CMakeKeywords keywords; - CMakeKeywords projectKeywords; + QMap<QString, FilePath> projectVariables; + QMap<QString, FilePath> projectFunctions; QStringList buildTargets; QStringList importedTargets; QStringList findPackageVariables; @@ -274,7 +275,9 @@ PerformInputData CMakeFileCompletionAssist::generatePerformInputData() const for (const auto &target : std::as_const(bs->buildTargets())) if (target.targetType != TargetType::UtilityType) data.buildTargets << target.title; - data.projectKeywords = bs->projectKeywords(); + const CMakeKeywords &projectKeywords = bs->projectKeywords(); + data.projectVariables = projectKeywords.variables; + data.projectFunctions = projectKeywords.functions; data.importedTargets = bs->projectImportedTargets(); data.findPackageVariables = bs->projectFindPackageVariables(); } @@ -326,7 +329,7 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &da if (varGenexToken == "${" || varGenexToken == "$<") { if (varGenexToken == "${") { items.append(generateList(data.keywords.variables, m_variableIcon)); - items.append(generateList(data.projectKeywords.variables, m_projectVariableIcon)); + items.append(generateList(data.projectVariables, m_projectVariableIcon)); items.append(generateList(data.findPackageVariables, m_projectVariableIcon)); } if (varGenexToken == "$<") @@ -342,7 +345,7 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &da || functionName == "set" || functionName == "list" || functionName == "cmake_print_variables") { items.append(generateList(data.keywords.variables, m_variableIcon)); - items.append(generateList(data.projectKeywords.variables, m_projectVariableIcon)); + items.append(generateList(data.projectVariables, m_projectVariableIcon)); items.append(generateList(data.findPackageVariables, m_projectVariableIcon)); items.append(generateList(localVariables, m_variableIcon)); } @@ -390,7 +393,7 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &da } else if (functionName.isEmpty()) { // On a new line we just want functions items.append(generateList(data.keywords.functions, m_functionIcon)); - items.append(generateList(data.projectKeywords.functions, m_projectFunctionIcon)); + items.append(generateList(data.projectFunctions, m_projectFunctionIcon)); items.append(generateList(localFunctions, m_functionIcon)); // Snippets would make more sense only for the top level suggestions @@ -400,7 +403,7 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &da fileStartPos = addFilePathItems(interface(), items, startPos); if (!onlyFileItems()) { items.append(generateList(data.keywords.variables, m_variableIcon)); - items.append(generateList(data.projectKeywords.variables, m_projectVariableIcon)); + items.append(generateList(data.projectVariables, m_projectVariableIcon)); items.append(generateList(localVariables, m_variableIcon)); items.append(generateList(data.findPackageVariables, m_projectVariableIcon)); From cbeeec2dc638144d43a5d1197260d021a4984e97 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 9 Oct 2023 10:09:33 +0200 Subject: [PATCH 1480/1777] CMakePM: Fix Coverity issue "Arguments in wrong order" Coverity-Id: 1526499 Change-Id: I4b5d7c4d12eca39b9c4e60b45ea3e67bce069069 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 025676ef579..f1c10344b59 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1018,7 +1018,7 @@ void CMakeBuildSystem::updateProjectData() const FilePath includeFileBaseDir = buildConfiguration()->buildDirectory(); QStringList cxxFlags = rpp.flagsForCxx.commandLineFlags; QStringList cFlags = rpp.flagsForC.commandLineFlags; - addTargetFlagForIos(cxxFlags, cFlags, this, [this] { + addTargetFlagForIos(cFlags, cxxFlags, this, [this] { return m_configurationFromCMake.stringValueOf("CMAKE_OSX_DEPLOYMENT_TARGET"); }); if (kitInfo.cxxToolChain) From c2ba2185833bceb50cc8af7a4c27bc18094faacf Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 29 Sep 2023 13:34:44 +0200 Subject: [PATCH 1481/1777] Markdown: Add missing commands for show editor/preview and swap Change-Id: I4ea63d2bd7a89a1fc8299e83a0050e4f639190c5 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/texteditor/markdowneditor.cpp | 57 +++++++++++++++++------ src/plugins/texteditor/markdowneditor.h | 3 ++ 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/src/plugins/texteditor/markdowneditor.cpp b/src/plugins/texteditor/markdowneditor.cpp index 41e9a0c5303..0ad3f0ac2f3 100644 --- a/src/plugins/texteditor/markdowneditor.cpp +++ b/src/plugins/texteditor/markdowneditor.cpp @@ -46,6 +46,9 @@ const char EMPHASIS_ACTION[] = "Markdown.Emphasis"; const char STRONG_ACTION[] = "Markdown.Strong"; const char INLINECODE_ACTION[] = "Markdown.InlineCode"; const char LINK_ACTION[] = "Markdown.Link"; +const char TOGGLEEDITOR_ACTION[] = "Markdown.ToggleEditor"; +const char TOGGLEPREVIEW_ACTION[] = "Markdown.TogglePreview"; +const char SWAPVIEWS_ACTION[] = "Markdown.SwapViews"; class MarkdownEditor : public IEditor { @@ -101,14 +104,14 @@ public: } agg->add(m_widget.get()); - m_togglePreviewVisible = new QToolButton; - m_togglePreviewVisible->setText(Tr::tr("Show Preview")); + m_togglePreviewVisible = new CommandButton(TOGGLEPREVIEW_ACTION); + m_togglePreviewVisible->setText(m_togglePreviewVisible->toolTipBase()); m_togglePreviewVisible->setCheckable(true); m_togglePreviewVisible->setChecked(showPreview); m_previewWidget->setVisible(showPreview); - m_toggleEditorVisible = new QToolButton; - m_toggleEditorVisible->setText(Tr::tr("Show Editor")); + m_toggleEditorVisible = new CommandButton(TOGGLEEDITOR_ACTION); + m_toggleEditorVisible->setText(m_toggleEditorVisible->toolTipBase()); m_toggleEditorVisible->setCheckable(true); m_toggleEditorVisible->setChecked(showEditor); m_textEditorWidget->setVisible(showEditor); @@ -137,9 +140,9 @@ public: button->setVisible(false); } - auto swapViews = new QToolButton; - swapViews->setText(Tr::tr("Swap Views")); - swapViews->setEnabled(showEditor && showPreview); + m_swapViews = new CommandButton(SWAPVIEWS_ACTION); + m_swapViews->setText(m_swapViews->toolTipBase()); + m_swapViews->setEnabled(showEditor && showPreview); m_toolbarLayout = new QHBoxLayout(&m_toolbar); m_toolbarLayout->setSpacing(0); @@ -149,7 +152,7 @@ public: m_toolbarLayout->addStretch(); m_toolbarLayout->addWidget(m_togglePreviewVisible); m_toolbarLayout->addWidget(m_toggleEditorVisible); - m_toolbarLayout->addWidget(swapViews); + m_toolbarLayout->addWidget(m_swapViews); setWidgetOrder(textEditorRight); @@ -173,7 +176,7 @@ public: }; const auto viewToggled = - [swapViews](QWidget *view, bool visible, QWidget *otherView, QToolButton *otherButton) { + [this](QWidget *view, bool visible, QWidget *otherView, QToolButton *otherButton) { if (view->isVisible() == visible) return; view->setVisible(visible); @@ -185,7 +188,7 @@ public: // make sure at least one view is visible otherButton->toggle(); } - swapViews->setEnabled(view->isVisible() && otherView->isVisible()); + m_swapViews->setEnabled(view->isVisible() && otherView->isVisible()); }; const auto saveViewSettings = [this] { Utils::QtcSettings *s = ICore::settings(); @@ -221,7 +224,7 @@ public: saveViewSettings(); }); - connect(swapViews, &QToolButton::clicked, m_textEditorWidget, [this] { + connect(m_swapViews, &QToolButton::clicked, m_textEditorWidget, [this] { const bool textEditorRight = isTextEditorRight(); setWidgetOrder(!textEditorRight); // save settings @@ -293,6 +296,10 @@ public: }); } + void toggleEditor() { m_toggleEditorVisible->toggle(); } + void togglePreview() { m_togglePreviewVisible->toggle(); } + void swapViews() { m_swapViews->click(); } + bool isTextEditorRight() const { return m_splitter->widget(0) == m_previewWidget; } void setWidgetOrder(bool textEditorRight) @@ -436,8 +443,9 @@ private: QWidget m_toolbar; QHBoxLayout *m_toolbarLayout; QList<QToolButton *> m_markDownButtons; - QToolButton *m_toggleEditorVisible; - QToolButton *m_togglePreviewVisible; + CommandButton *m_toggleEditorVisible; + CommandButton *m_togglePreviewVisible; + CommandButton *m_swapViews; std::optional<QPoint> m_previewRestoreScrollPosition; }; @@ -455,6 +463,7 @@ MarkdownEditorFactory::MarkdownEditorFactory() setEditorCreator([] { return new MarkdownEditor; }); const auto textContext = Context(MARKDOWNVIEWER_TEXT_CONTEXT); + const auto context = Context(MARKDOWNVIEWER_ID); Command *cmd = nullptr; cmd = ActionManager::registerAction(&m_emphasisAction, EMPHASIS_ACTION, textContext); cmd->setDescription(Tr::tr("Emphasis")); @@ -484,6 +493,28 @@ MarkdownEditorFactory::MarkdownEditorFactory() if (editor) editor->triggerLink(); }); + + cmd = ActionManager::registerAction(&m_toggleEditorAction, TOGGLEEDITOR_ACTION, context); + cmd->setDescription(Tr::tr("Show Editor")); + QObject::connect(&m_toggleEditorAction, &QAction::triggered, EditorManager::instance(), [] { + auto editor = qobject_cast<MarkdownEditor *>(EditorManager::currentEditor()); + if (editor) + editor->toggleEditor(); + }); + cmd = ActionManager::registerAction(&m_togglePreviewAction, TOGGLEPREVIEW_ACTION, context); + cmd->setDescription(Tr::tr("Show Preview")); + QObject::connect(&m_togglePreviewAction, &QAction::triggered, EditorManager::instance(), [] { + auto editor = qobject_cast<MarkdownEditor *>(EditorManager::currentEditor()); + if (editor) + editor->togglePreview(); + }); + cmd = ActionManager::registerAction(&m_swapAction, SWAPVIEWS_ACTION, context); + cmd->setDescription(Tr::tr("Swap Views")); + QObject::connect(&m_swapAction, &QAction::triggered, EditorManager::instance(), [] { + auto editor = qobject_cast<MarkdownEditor *>(EditorManager::currentEditor()); + if (editor) + editor->swapViews(); + }); } } // namespace TextEditor::Internal diff --git a/src/plugins/texteditor/markdowneditor.h b/src/plugins/texteditor/markdowneditor.h index 46a7f4baf51..92fc18a8b88 100644 --- a/src/plugins/texteditor/markdowneditor.h +++ b/src/plugins/texteditor/markdowneditor.h @@ -22,6 +22,9 @@ private: QAction m_strongAction; QAction m_inlineCodeAction; QAction m_linkAction; + QAction m_toggleEditorAction; + QAction m_togglePreviewAction; + QAction m_swapAction; }; } // TextEditor::Internal From ac5ab71db83017a186ca9d06a21c8f7cb3e4ec41 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Mon, 28 Aug 2023 15:00:08 +0200 Subject: [PATCH 1482/1777] LSP: add resource operations to the protocol implementation This allows the language server to request file creation, renaming, or deletion. Fixes: QTCREATORBUG-29542 Change-Id: I31ab3c0b36f87d3b797b54ff4261cab85a322e2c Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../clientcapabilities.cpp | 42 ++++++ .../clientcapabilities.h | 8 ++ src/libs/languageserverprotocol/jsonkeys.h | 9 +- src/libs/languageserverprotocol/lsptypes.cpp | 74 +++++++++++ src/libs/languageserverprotocol/lsptypes.h | 124 ++++++++++++++++-- src/plugins/languageclient/client.cpp | 8 ++ .../languageclientsymbolsupport.cpp | 50 ++++++- .../languageclient/languageclientutils.cpp | 75 +++++++++-- .../languageclient/languageclientutils.h | 2 + 9 files changed, 364 insertions(+), 28 deletions(-) diff --git a/src/libs/languageserverprotocol/clientcapabilities.cpp b/src/libs/languageserverprotocol/clientcapabilities.cpp index 321b46ecd2e..acae7ad554a 100644 --- a/src/libs/languageserverprotocol/clientcapabilities.cpp +++ b/src/libs/languageserverprotocol/clientcapabilities.cpp @@ -77,4 +77,46 @@ bool SemanticTokensClientCapabilities::isValid() const && contains(formatsKey); } +const char resourceOperationCreate[] = "create"; +const char resourceOperationRename[] = "rename"; +const char resourceOperationDelete[] = "delete"; + +std::optional<QList<WorkspaceClientCapabilities::WorkspaceEditCapabilities::ResourceOperationKind>> +WorkspaceClientCapabilities::WorkspaceEditCapabilities::resourceOperations() const +{ + if (!contains(resourceOperationsKey)) + return std::nullopt; + QList<ResourceOperationKind> result; + for (const QJsonValue &value : this->value(resourceOperationsKey).toArray()) { + const QString str = value.toString(); + if (str == resourceOperationCreate) + result << ResourceOperationKind::Create; + else if (str == resourceOperationRename) + result << ResourceOperationKind::Rename; + else if (str == resourceOperationDelete) + result << ResourceOperationKind::Delete; + } + return result; +} + +void WorkspaceClientCapabilities::WorkspaceEditCapabilities::setResourceOperations( + const QList<ResourceOperationKind> &resourceOperations) +{ + QJsonArray array; + for (const auto &kind : resourceOperations) { + switch (kind) { + case ResourceOperationKind::Create: + array << resourceOperationCreate; + break; + case ResourceOperationKind::Rename: + array << resourceOperationRename; + break; + case ResourceOperationKind::Delete: + array << resourceOperationDelete; + break; + } + } + insert(resourceOperationsKey, array); +} + } // namespace LanguageServerProtocol diff --git a/src/libs/languageserverprotocol/clientcapabilities.h b/src/libs/languageserverprotocol/clientcapabilities.h index 7b18c24a762..584c4b8d539 100644 --- a/src/libs/languageserverprotocol/clientcapabilities.h +++ b/src/libs/languageserverprotocol/clientcapabilities.h @@ -555,6 +555,14 @@ public: void setDocumentChanges(bool documentChanges) { insert(documentChangesKey, documentChanges); } void clearDocumentChanges() { remove(documentChangesKey); } + + enum class ResourceOperationKind { Create, Rename, Delete }; + + // The resource operations the client supports. Clients should at least support 'create', + // 'rename' and 'delete' files and folders. + std::optional<QList<ResourceOperationKind>> resourceOperations() const; + void setResourceOperations(const QList<ResourceOperationKind> &resourceOperations); + void clearResourceOperations() { remove(resourceOperationsKey); } }; // Capabilities specific to `WorkspaceEdit`s diff --git a/src/libs/languageserverprotocol/jsonkeys.h b/src/libs/languageserverprotocol/jsonkeys.h index e7190afce2e..250b5ca87c1 100644 --- a/src/libs/languageserverprotocol/jsonkeys.h +++ b/src/libs/languageserverprotocol/jsonkeys.h @@ -98,6 +98,8 @@ constexpr char hierarchicalDocumentSymbolSupportKey[] = "hierarchicalDocumentSym constexpr char hoverKey[] = "hover"; constexpr char hoverProviderKey[] = "hoverProvider"; constexpr char idKey[] = "id"; +constexpr char ignoreIfExistsKey[] = "ignoreIfExists"; +constexpr char ignoreIfNotExistsKey[] = "ignoreIfNotExists"; constexpr char implementationKey[] = "implementation"; constexpr char implementationProviderKey[] = "implementationProvider"; constexpr char includeDeclarationKey[] = "includeDeclaration"; @@ -127,11 +129,14 @@ constexpr char multiLineTokenSupportKey[] = "multiLineTokenSupport"; constexpr char nameKey[] = "name"; constexpr char newNameKey[] = "newName"; constexpr char newTextKey[] = "newText"; +constexpr char newUriKey[] = "newUri"; +constexpr char oldUriKey[] = "oldUri"; constexpr char onTypeFormattingKey[] = "onTypeFormatting"; constexpr char onlyKey[] = "only"; constexpr char openCloseKey[] = "openClose"; constexpr char optionsKey[] = "options"; constexpr char overlappingTokenSupportKey[] = "overlappingTokenSupport"; +constexpr char overwriteKey[] = "overwrite"; constexpr char parametersKey[] = "parameters"; constexpr char paramsKey[] = "params"; constexpr char patternKey[] = "pattern"; @@ -147,6 +152,7 @@ constexpr char rangeFormattingKey[] = "rangeFormatting"; constexpr char rangeKey[] = "range"; constexpr char rangeLengthKey[] = "rangeLength"; constexpr char reasonKey[] = "reason"; +constexpr char recursiveKey[] = "recursive"; constexpr char redKey[] = "red"; constexpr char referencesKey[] = "references"; constexpr char referencesProviderKey[] = "referencesProvider"; @@ -158,6 +164,7 @@ constexpr char renameKey[] = "rename"; constexpr char renameProviderKey[] = "renameProvider"; constexpr char requestsKey[] = "requests"; constexpr char resolveProviderKey[] = "resolveProvider"; +constexpr char resourceOperationsKey[] = "resourceOperations"; constexpr char resultIdKey[] = "resultId"; constexpr char resultKey[] = "result"; constexpr char retryKey[] = "retry"; @@ -194,8 +201,8 @@ constexpr char textDocumentSyncKey[] = "textDocumentSync"; constexpr char textEditKey[] = "textEdit"; constexpr char textKey[] = "text"; constexpr char titleKey[] = "title"; -constexpr char tokenKey[] = "token"; constexpr char toKey[] = "to"; +constexpr char tokenKey[] = "token"; constexpr char tokenModifiersKey[] = "tokenModifiers"; constexpr char tokenTypesKey[] = "tokenTypes"; constexpr char traceKey[] = "trace"; diff --git a/src/libs/languageserverprotocol/lsptypes.cpp b/src/libs/languageserverprotocol/lsptypes.cpp index d8f02e256fc..6b2975fbe51 100644 --- a/src/libs/languageserverprotocol/lsptypes.cpp +++ b/src/libs/languageserverprotocol/lsptypes.cpp @@ -2,6 +2,8 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "lsptypes.h" + +#include "languageserverprotocoltr.h" #include "lsputils.h" #include <utils/textutils.h> @@ -413,4 +415,76 @@ LanguageServerProtocol::MarkupKind::operator QJsonValue() const return {}; } +DocumentChange::DocumentChange(const QJsonValue &value) +{ + const QString kind = value["kind"].toString(); + if (kind == "create") + emplace<CreateFile>(value); + else if (kind == "rename") + emplace<RenameFile>(value); + else if (kind == "delete") + emplace<DeleteFile>(value); + else + emplace<TextDocumentEdit>(value); +} + +using DocumentChangeBase = std::variant<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>; + +bool DocumentChange::isValid() const +{ + return std::visit([](const auto &v) { return v.isValid(); }, DocumentChangeBase(*this)); +} + +DocumentChange::operator const QJsonValue () const +{ + return std::visit([](const auto &v) { return QJsonValue(v); }, DocumentChangeBase(*this)); +} + +CreateFile::CreateFile() +{ + insert(kindKey, "create"); +} + +QString CreateFile::message(const DocumentUri::PathMapper &mapToHostPath) const +{ + return Tr::tr("Create %1").arg(uri().toFilePath(mapToHostPath).toUserOutput()); +} + +bool LanguageServerProtocol::CreateFile::isValid() const +{ + return contains(uriKey) && value(kindKey) == "create"; +} + +RenameFile::RenameFile() +{ + insert(kindKey, "rename"); +} + +QString RenameFile::message(const DocumentUri::PathMapper &mapToHostPath) const +{ + return Tr::tr("Rename %1 to %2") + .arg(oldUri().toFilePath(mapToHostPath).toUserOutput(), + newUri().toFilePath(mapToHostPath).toUserOutput()); +} + +bool RenameFile::isValid() const +{ + return contains(oldUriKey) && contains(newUriKey) && value(kindKey) == "rename"; +} + +DeleteFile::DeleteFile() +{ + insert(kindKey, "delete"); +} + +QString DeleteFile::message(const DocumentUri::PathMapper &mapToHostPath) const +{ + return Tr::tr("Delete %1").arg(uri().toFilePath(mapToHostPath).toUserOutput()); +} + +bool DeleteFile::isValid() const +{ + return contains(uriKey) && value(kindKey) == "delete"; +} + } // namespace LanguageServerProtocol diff --git a/src/libs/languageserverprotocol/lsptypes.h b/src/libs/languageserverprotocol/lsptypes.h index c4a4e7a0bc8..135b4c124a2 100644 --- a/src/libs/languageserverprotocol/lsptypes.h +++ b/src/libs/languageserverprotocol/lsptypes.h @@ -285,6 +285,106 @@ public: bool isValid() const override { return contains(textDocumentKey) && contains(editsKey); } }; +class CreateFileOptions : public JsonObject +{ +public: + using JsonObject::JsonObject; + + std::optional<bool> overwrite() const { return optionalValue<bool>(overwriteKey); } + void setOverwrite(bool overwrite) { insert(overwriteKey, overwrite); } + void clearOverwrite() { remove(overwriteKey); } + + std::optional<bool> ignoreIfExists() const { return optionalValue<bool>(ignoreIfExistsKey); } + void setIgnoreIfExists(bool ignoreIfExists) { insert(ignoreIfExistsKey, ignoreIfExists); } + void clearIgnoreIfExists() { remove(ignoreIfExistsKey); } +}; + +class LANGUAGESERVERPROTOCOL_EXPORT CreateFile : public JsonObject +{ +public: + using JsonObject::JsonObject; + CreateFile(); + + DocumentUri uri() const { return DocumentUri::fromProtocol(typedValue<QString>(uriKey)); } + void setUri(const DocumentUri &uri) { insert(uriKey, uri); } + + std::optional<CreateFileOptions> options() const + { return optionalValue<CreateFileOptions>(optionsKey); } + void setOptions(const CreateFileOptions &options) { insert(optionsKey, options); } + void clearOptions() { remove(optionsKey); } + + QString message(const DocumentUri::PathMapper &mapToHostPath) const; + + bool isValid() const override; +}; + +class LANGUAGESERVERPROTOCOL_EXPORT RenameFile : public JsonObject +{ +public: + using JsonObject::JsonObject; + RenameFile(); + + DocumentUri oldUri() const { return DocumentUri::fromProtocol(typedValue<QString>(oldUriKey)); } + void setOldUri(const DocumentUri &oldUri) { insert(oldUriKey, oldUri); } + + DocumentUri newUri() const { return DocumentUri::fromProtocol(typedValue<QString>(newUriKey)); } + void setNewUri(const DocumentUri &newUri) { insert(newUriKey, newUri); } + + std::optional<CreateFileOptions> options() const + { return optionalValue<CreateFileOptions>(optionsKey); } + void setOptions(const CreateFileOptions &options) { insert(optionsKey, options); } + void clearOptions() { remove(optionsKey); } + + QString message(const DocumentUri::PathMapper &mapToHostPath) const; + + bool isValid() const override; +}; + +class DeleteFileOptions : public JsonObject +{ +public: + using JsonObject::JsonObject; + + std::optional<bool> recursive() const { return optionalValue<bool>(recursiveKey); } + void setRecursive(bool recursive) { insert(recursiveKey, recursive); } + void clearRecursive() { remove(recursiveKey); } + + std::optional<bool> ignoreIfNotExists() const { return optionalValue<bool>(ignoreIfNotExistsKey); } + void setIgnoreIfNotExists(bool ignoreIfNotExists) { insert(ignoreIfNotExistsKey, ignoreIfNotExists); } + void clearIgnoreIfNotExists() { remove(ignoreIfNotExistsKey); } +}; + +class LANGUAGESERVERPROTOCOL_EXPORT DeleteFile : public JsonObject +{ +public: + using JsonObject::JsonObject; + DeleteFile(); + + DocumentUri uri() const { return DocumentUri::fromProtocol(typedValue<QString>(uriKey)); } + void setUri(const DocumentUri &uri) { insert(uriKey, uri); } + + std::optional<DeleteFileOptions> options() const + { return optionalValue<DeleteFileOptions>(optionsKey); } + void setOptions(const DeleteFileOptions &options) { insert(optionsKey, options); } + void clearOptions() { remove(optionsKey); } + + QString message(const DocumentUri::PathMapper &mapToHostPath) const; + + bool isValid() const override; +}; + +class LANGUAGESERVERPROTOCOL_EXPORT DocumentChange + : public std::variant<TextDocumentEdit, CreateFile, RenameFile, DeleteFile> +{ +public: + using variant::variant; + DocumentChange(const QJsonValue &value); + + bool isValid() const; + + operator const QJsonValue() const; +}; + class LANGUAGESERVERPROTOCOL_EXPORT WorkspaceEdit : public JsonObject { public: @@ -296,17 +396,23 @@ public: void setChanges(const Changes &changes); /* - * An array of `TextDocumentEdit`s to express changes to n different text documents - * where each text document edit addresses a specific version of a text document. - * Whether a client supports versioned document edits is expressed via - * `WorkspaceClientCapabilities.workspaceEdit.documentChanges`. + * Depending on the client capability + * `workspace.workspaceEdit.resourceOperations` document changes are either + * an array of `TextDocumentEdit`s to express changes to n different text + * documents where each text document edit addresses a specific version of + * a text document. Or it can contain above `TextDocumentEdit`s mixed with + * create, rename and delete file / folder operations. * - * Note: If the client can handle versioned document edits and if documentChanges are present, - * the latter are preferred over changes. + * Whether a client supports versioned document edits is expressed via + * `workspace.workspaceEdit.documentChanges` client capability. + * + * If a client neither supports `documentChanges` nor + * `workspace.workspaceEdit.resourceOperations` then only plain `TextEdit`s + * using the `changes` property are supported. */ - std::optional<QList<TextDocumentEdit>> documentChanges() const - { return optionalArray<TextDocumentEdit>(documentChangesKey); } - void setDocumentChanges(const QList<TextDocumentEdit> &changes) + std::optional<QList<DocumentChange>> documentChanges() const + { return optionalArray<DocumentChange>(documentChangesKey); } + void setDocumentChanges(const QList<DocumentChange> &changes) { insertArray(documentChangesKey, changes); } }; diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index c0922538c3f..1d93f869540 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -375,6 +375,14 @@ static ClientCapabilities generateClientCapabilities() { ClientCapabilities capabilities; WorkspaceClientCapabilities workspaceCapabilities; + WorkspaceClientCapabilities::WorkspaceEditCapabilities workspaceEditCapabilities; + workspaceEditCapabilities.setDocumentChanges(true); + using ResourceOperationKind + = WorkspaceClientCapabilities::WorkspaceEditCapabilities::ResourceOperationKind; + workspaceEditCapabilities.setResourceOperations({ResourceOperationKind::Create, + ResourceOperationKind::Rename, + ResourceOperationKind::Delete}); + workspaceCapabilities.setWorkspaceEdit(workspaceEditCapabilities); workspaceCapabilities.setWorkspaceFolders(true); workspaceCapabilities.setApplyEdit(true); DynamicRegistrationCapabilities allowDynamicRegistration; diff --git a/src/plugins/languageclient/languageclientsymbolsupport.cpp b/src/plugins/languageclient/languageclientsymbolsupport.cpp index 268bd391e81..8ba9507a640 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.cpp +++ b/src/plugins/languageclient/languageclientsymbolsupport.cpp @@ -539,24 +539,50 @@ Utils::SearchResultItems generateReplaceItems(const WorkspaceEdit &edits, bool limitToProjects, const DocumentUri::PathMapper &pathMapper) { + Utils::SearchResultItems items; auto convertEdits = [](const QList<TextEdit> &edits) { return Utils::transform(edits, [](const TextEdit &edit) { return ItemData{SymbolSupport::convertRange(edit.range()), QVariant(edit)}; }); }; QMap<Utils::FilePath, QList<ItemData>> rangesInDocument; - auto documentChanges = edits.documentChanges().value_or(QList<TextDocumentEdit>()); + auto documentChanges = edits.documentChanges().value_or(QList<DocumentChange>()); if (!documentChanges.isEmpty()) { - for (const TextDocumentEdit &documentChange : std::as_const(documentChanges)) { - rangesInDocument[documentChange.textDocument().uri().toFilePath(pathMapper)] - = convertEdits(documentChange.edits()); + for (const DocumentChange &documentChange : std::as_const(documentChanges)) { + if (std::holds_alternative<TextDocumentEdit>(documentChange)) { + const TextDocumentEdit edit = std::get<TextDocumentEdit>(documentChange); + rangesInDocument[edit.textDocument().uri().toFilePath(pathMapper)] = convertEdits( + edit.edits()); + } else { + Utils::SearchResultItem item; + + if (std::holds_alternative<LanguageServerProtocol::CreateFile>(documentChange)) { + auto op = std::get<LanguageServerProtocol::CreateFile>(documentChange); + item.setLineText(op.message(pathMapper)); + item.setFilePath(op.uri().toFilePath(pathMapper)); + item.setUserData(QVariant(op)); + } else if (std::holds_alternative<RenameFile>(documentChange)) { + auto op = std::get<RenameFile>(documentChange); + item.setLineText(op.message(pathMapper)); + item.setFilePath(op.oldUri().toFilePath(pathMapper)); + item.setUserData(QVariant(op)); + } else if (std::holds_alternative<LanguageServerProtocol::DeleteFile>(documentChange)) { + auto op = std::get<LanguageServerProtocol::DeleteFile>(documentChange); + item.setLineText(op.message(pathMapper)); + item.setFilePath(op.uri().toFilePath(pathMapper)); + item.setUserData(QVariant(op)); + } + + items << item; + } } } else { auto changes = edits.changes().value_or(WorkspaceEdit::Changes()); for (auto it = changes.begin(), end = changes.end(); it != end; ++it) rangesInDocument[it.key().toFilePath(pathMapper)] = convertEdits(it.value()); } - return generateSearchResultItems(rangesInDocument, search, limitToProjects); + items += generateSearchResultItems(rangesInDocument, search, limitToProjects); + return items; } Core::SearchResult *SymbolSupport::createSearch(const TextDocumentPositionParams &positionParams, @@ -659,15 +685,25 @@ void SymbolSupport::applyRename(const Utils::SearchResultItems &checkedItems, { QSet<Utils::FilePath> affectedNonOpenFilePaths; QMap<Utils::FilePath, QList<TextEdit>> editsForDocuments; + QList<DocumentChange> changes; for (const Utils::SearchResultItem &item : checkedItems) { const auto filePath = Utils::FilePath::fromUserInput(item.path().value(0)); if (!m_client->documentForFilePath(filePath)) affectedNonOpenFilePaths << filePath; - TextEdit edit(item.userData().toJsonObject()); - if (edit.isValid()) + const QJsonObject jsonObject = item.userData().toJsonObject(); + if (const TextEdit edit(jsonObject); edit.isValid()) editsForDocuments[filePath] << edit; + else if (const LanguageServerProtocol::CreateFile createFile(jsonObject); createFile.isValid()) + changes << createFile; + else if (const RenameFile renameFile(jsonObject); renameFile.isValid()) + changes << renameFile; + else if (const LanguageServerProtocol::DeleteFile deleteFile(jsonObject); deleteFile.isValid()) + changes << deleteFile; } + for (const DocumentChange &change : changes) + applyDocumentChange(m_client, change); + for (auto it = editsForDocuments.begin(), end = editsForDocuments.end(); it != end; ++it) applyTextEdits(m_client, it.key(), it.value()); diff --git a/src/plugins/languageclient/languageclientutils.cpp b/src/plugins/languageclient/languageclientutils.cpp index 19cd740506b..2df9331d2bf 100644 --- a/src/plugins/languageclient/languageclientutils.cpp +++ b/src/plugins/languageclient/languageclientutils.cpp @@ -120,11 +120,10 @@ void applyTextEdit(TextDocumentManipulatorInterface &manipulator, bool applyWorkspaceEdit(const Client *client, const WorkspaceEdit &edit) { bool result = true; - const QList<TextDocumentEdit> &documentChanges - = edit.documentChanges().value_or(QList<TextDocumentEdit>()); + const auto documentChanges = edit.documentChanges().value_or(QList<DocumentChange>()); if (!documentChanges.isEmpty()) { - for (const TextDocumentEdit &documentChange : documentChanges) - result |= applyTextDocumentEdit(client, documentChange); + for (const DocumentChange &documentChange : documentChanges) + result |= applyDocumentChange(client, documentChange); } else { const WorkspaceEdit::Changes &changes = edit.changes().value_or(WorkspaceEdit::Changes()); for (auto it = changes.cbegin(); it != changes.cend(); ++it) @@ -188,13 +187,13 @@ void updateCodeActionRefactoringMarker(Client *client, if (std::optional<WorkspaceEdit> edit = action.edit()) { if (diagnostics.isEmpty()) { QList<TextEdit> edits; - if (std::optional<QList<TextDocumentEdit>> documentChanges = edit->documentChanges()) { - QList<TextDocumentEdit> changesForUri = Utils::filtered( - *documentChanges, [uri](const TextDocumentEdit &edit) { - return edit.textDocument().uri() == uri; - }); - for (const TextDocumentEdit &edit : changesForUri) - edits << edit.edits(); + if (std::optional<QList<DocumentChange>> documentChanges = edit->documentChanges()) { + for (const DocumentChange &change : *documentChanges) { + if (auto edit = std::get_if<TextDocumentEdit>(&change)) { + if (edit->textDocument().uri() == uri) + edits << edit->edits(); + } + } } else if (std::optional<WorkspaceEdit::Changes> localChanges = edit->changes()) { edits = (*localChanges)[uri]; } @@ -345,4 +344,58 @@ const QIcon symbolIcon(int type) return icons[kind]; } +bool applyDocumentChange(const Client *client, const DocumentChange &change) +{ + if (!client) + return false; + + if (std::holds_alternative<TextDocumentEdit>(change)) { + return applyTextDocumentEdit(client, std::get<TextDocumentEdit>(change)); + } else if (std::holds_alternative<LanguageServerProtocol::CreateFile>(change)) { + const auto createOperation = std::get<LanguageServerProtocol::CreateFile>(change); + const FilePath filePath = createOperation.uri().toFilePath(client->hostPathMapper()); + if (filePath.exists()) { + if (const std::optional<CreateFileOptions> options = createOperation.options()) { + if (options->overwrite().value_or(false)) { + if (!filePath.removeFile()) + return false; + } else if (options->ignoreIfExists().value_or(false)) { + return true; + } + } + } + return filePath.ensureExistingFile(); + } else if (std::holds_alternative<RenameFile>(change)) { + const RenameFile renameOperation = std::get<RenameFile>(change); + const FilePath oldPath = renameOperation.oldUri().toFilePath(client->hostPathMapper()); + if (!oldPath.exists()) + return false; + const FilePath newPath = renameOperation.newUri().toFilePath(client->hostPathMapper()); + if (oldPath == newPath) + return true; + if (newPath.exists()) { + if (const std::optional<CreateFileOptions> options = renameOperation.options()) { + if (options->overwrite().value_or(false)) { + if (!newPath.removeFile()) + return false; + } else if (options->ignoreIfExists().value_or(false)) { + return true; + } + } + } + return oldPath.renameFile(newPath); + } else if (std::holds_alternative<LanguageServerProtocol::DeleteFile>(change)) { + const auto deleteOperation = std::get<LanguageServerProtocol::DeleteFile>(change); + const FilePath filePath = deleteOperation.uri().toFilePath(client->hostPathMapper()); + if (const std::optional<DeleteFileOptions> options = deleteOperation.options()) { + if (!filePath.exists()) + return options->ignoreIfNotExists().value_or(false); + if (filePath.isDir() && options->recursive().value_or(false)) + return filePath.removeRecursively(); + } + return filePath.removeFile(); + } + return false; +} + } // namespace LanguageClient diff --git a/src/plugins/languageclient/languageclientutils.h b/src/plugins/languageclient/languageclientutils.h index f24b8e45e74..13795f52d85 100644 --- a/src/plugins/languageclient/languageclientutils.h +++ b/src/plugins/languageclient/languageclientutils.h @@ -35,6 +35,8 @@ bool LANGUAGECLIENT_EXPORT applyTextEdits(const Client *client, bool LANGUAGECLIENT_EXPORT applyTextEdits(const Client *client, const Utils::FilePath &filePath, const QList<LanguageServerProtocol::TextEdit> &edits); +bool LANGUAGECLIENT_EXPORT applyDocumentChange(const Client *client, + const LanguageServerProtocol::DocumentChange &change); void LANGUAGECLIENT_EXPORT applyTextEdit(TextEditor::TextDocumentManipulatorInterface &manipulator, const LanguageServerProtocol::TextEdit &edit, bool newTextIsSnippet = false); From f25413a1512fdf7b9fa178ee7bcd457e0cc5ec20 Mon Sep 17 00:00:00 2001 From: Marco Bubke <marco.bubke@qt.io> Date: Sun, 8 Oct 2023 14:58:48 +0200 Subject: [PATCH 1483/1777] QmlDesigner: Fix duplicate in .clang-format Change-Id: I88b1a126e30894167de0e3023a957eb22b5368fb Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> --- src/plugins/qmldesigner/.clang-format | 1 - tests/unit/.clang-format | 1 - 2 files changed, 2 deletions(-) diff --git a/src/plugins/qmldesigner/.clang-format b/src/plugins/qmldesigner/.clang-format index 968dfdec7d1..87648a20579 100644 --- a/src/plugins/qmldesigner/.clang-format +++ b/src/plugins/qmldesigner/.clang-format @@ -110,7 +110,6 @@ SpaceAfterCStyleCast: true SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true -SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true diff --git a/tests/unit/.clang-format b/tests/unit/.clang-format index 968dfdec7d1..87648a20579 100644 --- a/tests/unit/.clang-format +++ b/tests/unit/.clang-format @@ -110,7 +110,6 @@ SpaceAfterCStyleCast: true SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true -SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true From ad680902b22e548547691624484658655c3a1f44 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 9 Oct 2023 10:24:03 +0200 Subject: [PATCH 1484/1777] CMakePM: Fix condition for filtering out non CMake parameters Coverity-Id: 1515708 Change-Id: I97de84f4db79977d7833337be87ae4877c10136b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cmakeprojectmanager/cmakekitaspect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp index 720d2e5f156..c18d047e613 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp @@ -1087,7 +1087,7 @@ QStringList CMakeConfigurationKitAspect::toArgumentsList(const Kit *k) [](const CMakeConfigItem &i) { return i.toArgument(nullptr); }); - current = Utils::filtered(current, [](const QString &s) { return s != "-D" || s != "-U"; }); + current = Utils::filtered(current, [](const QString &s) { return s != "-D" && s != "-U"; }); return current; } From 399e12c973ec12ee66b6038ad5acbdf574fd95b0 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 6 Oct 2023 17:55:57 +0200 Subject: [PATCH 1485/1777] CMakePM: Fix crash in findLinkAt Fixes: QTCREATORBUG-29715 Change-Id: I4db919c8858631beb573789d1888b3dbee606c50 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../cmakeprojectmanager/cmakeeditor.cpp | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index c06edffd322..1979d6ef76d 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -310,7 +310,7 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, if (auto project = ProjectTree::currentProject()) { buffer.replace("${CMAKE_SOURCE_DIR}", project->projectDirectory().path()); - if (auto bs = ProjectTree::currentBuildSystem()) { + if (auto bs = ProjectTree::currentBuildSystem(); bs->buildConfiguration()) { buffer.replace("${CMAKE_BINARY_DIR}", bs->buildConfiguration()->buildDirectory().path()); // Get the path suffix from current source dir to project source dir and apply it @@ -327,35 +327,36 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, .path()); // Check if the symbols is a user defined function or macro - const CMakeBuildSystem *cbs = static_cast<const CMakeBuildSystem *>(bs); - // Strip variable coating - if (buffer.startsWith("${") && buffer.endsWith("}")) - buffer = buffer.mid(2, buffer.size() - 3); + if (const auto cbs = qobject_cast<const CMakeBuildSystem *>(bs)) { + // Strip variable coating + if (buffer.startsWith("${") && buffer.endsWith("}")) + buffer = buffer.mid(2, buffer.size() - 3); - if (cbs->cmakeSymbolsHash().contains(buffer)) { - link = cbs->cmakeSymbolsHash().value(buffer); - addTextStartEndToLink(link); - return processLinkCallback(link); - } + if (cbs->cmakeSymbolsHash().contains(buffer)) { + link = cbs->cmakeSymbolsHash().value(buffer); + addTextStartEndToLink(link); + return processLinkCallback(link); + } - // Handle include(CMakeFileWithoutSuffix) and find_package(Package) - QString functionName; - if (funcStart > funcEnd) { - int funcStartPos = findWordStart(funcStart); - functionName = textDocument()->textAt(funcStartPos, funcStart - funcStartPos); + // Handle include(CMakeFileWithoutSuffix) and find_package(Package) + QString functionName; + if (funcStart > funcEnd) { + int funcStartPos = findWordStart(funcStart); + functionName = textDocument()->textAt(funcStartPos, funcStart - funcStartPos); - struct FunctionToHash - { - QString functionName; - const QHash<QString, Utils::Link> &hash; - } functionToHashes[] = {{"include", cbs->dotCMakeFilesHash()}, - {"find_package", cbs->findPackagesFilesHash()}}; + struct FunctionToHash + { + QString functionName; + const QHash<QString, Utils::Link> &hash; + } functionToHashes[] = {{"include", cbs->dotCMakeFilesHash()}, + {"find_package", cbs->findPackagesFilesHash()}}; - for (const auto &pair : functionToHashes) { - if (functionName == pair.functionName && pair.hash.contains(buffer)) { - link = pair.hash.value(buffer); - addTextStartEndToLink(link); - return processLinkCallback(link); + for (const auto &pair : functionToHashes) { + if (functionName == pair.functionName && pair.hash.contains(buffer)) { + link = pair.hash.value(buffer); + addTextStartEndToLink(link); + return processLinkCallback(link); + } } } } From fe430bebbe86e0a0465673313f94b38e95edc934 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 26 Sep 2023 10:43:33 +0200 Subject: [PATCH 1486/1777] CompilerExplorer: Fix undo Fixes context handling for the Editor. This allows Undo/Redo actions to activate correctly. Change-Id: Ieb7fa27215f5746cf5f26e8e7b3b74f44023481c Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../compilerexplorerconstants.h | 1 - .../compilerexplorereditor.cpp | 140 +++++++++++------- .../compilerexplorer/compilerexplorereditor.h | 41 ++++- .../compilerexplorerplugin.cpp | 2 +- .../compilerexplorersettings.cpp | 6 +- .../texteditor/texteditoractionhandler.cpp | 78 ++++++---- .../texteditor/texteditoractionhandler.h | 3 + 7 files changed, 187 insertions(+), 84 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexplorerconstants.h b/src/plugins/compilerexplorer/compilerexplorerconstants.h index 33a7d528df3..1e8a244626b 100644 --- a/src/plugins/compilerexplorer/compilerexplorerconstants.h +++ b/src/plugins/compilerexplorer/compilerexplorerconstants.h @@ -5,5 +5,4 @@ namespace CompilerExplorer::Constants { const char CE_EDITOR_ID[] = "CompilerExplorer.Editor"; -const char CE_EDITOR_CONTEXT_ID[] = "CompilerExplorer.Editor.Context"; } diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 9c3f00feb5a..9fe794002cb 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -249,7 +249,8 @@ QString SourceEditorWidget::sourceCode() } CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSettings, - const std::shared_ptr<CompilerSettings> &compilerSettings) + const std::shared_ptr<CompilerSettings> &compilerSettings, + QUndoStack *undoStack) : m_sourceSettings(sourceSettings) , m_compilerSettings(compilerSettings) { @@ -266,7 +267,7 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett m_delayTimer, qOverload<>(&QTimer::start)); - m_asmEditor = new AsmEditorWidget; + m_asmEditor = new AsmEditorWidget(undoStack); m_asmDocument = QSharedPointer<TextDocument>(new TextDocument); m_asmDocument->setFilePath("asm.asm"); m_asmEditor->setTextDocument(m_asmDocument); @@ -498,10 +499,7 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document, actionHandler.updateCurrentEditor(); }); - m_context = new Core::IContext(this); - m_context->setWidget(this); - m_context->setContext(Core::Context(Constants::CE_EDITOR_CONTEXT_ID)); - Core::ICore::addContextObject(m_context); + setupHelpWidget(); } EditorWidget::~EditorWidget() @@ -521,7 +519,7 @@ void EditorWidget::addCompiler(const std::shared_ptr<SourceSettings> &sourceSett int idx, QDockWidget *parentDockWidget) { - auto compiler = new CompilerWidget(sourceSettings, compilerSettings); + auto compiler = new CompilerWidget(sourceSettings, compilerSettings, m_undoStack); compiler->setWindowTitle("Compiler #" + QString::number(idx)); compiler->setObjectName("compiler_" + QString::number(idx)); QDockWidget *dockWidget = addDockForWidget(compiler, parentDockWidget); @@ -573,7 +571,6 @@ void EditorWidget::addSourceEditor(const std::shared_ptr<SourceSettings> &source sourceSettings->compilers.clear(); m_document->settings()->m_sources.removeItem(sourceSettings->shared_from_this()); m_undoStack->endMacro(); - setupHelpWidget(); }); @@ -615,12 +612,16 @@ void EditorWidget::addSourceEditor(const std::shared_ptr<SourceSettings> &source == compilerSettings; }); QTC_ASSERT(it != m_compilerWidgets.end(), return); + if (!m_sourceWidgets.isEmpty()) + m_sourceWidgets.first()->widget()->setFocus(Qt::OtherFocusReason); delete *it; m_compilerWidgets.erase(it); }); m_sourceWidgets.append(dockWidget); + sourceEditor->setFocus(Qt::OtherFocusReason); + setupHelpWidget(); } @@ -636,6 +637,8 @@ void EditorWidget::removeSourceEditor(const std::shared_ptr<SourceSettings> &sou QTC_ASSERT(it != m_sourceWidgets.end(), return); delete *it; m_sourceWidgets.erase(it); + + setupHelpWidget(); } void EditorWidget::recreateEditors() @@ -677,24 +680,25 @@ void EditorWidget::setupHelpWidget() { if (m_document->settings()->m_sources.size() == 0) { setCentralWidget(createHelpWidget()); + centralWidget()->setFocus(Qt::OtherFocusReason); } else { delete takeCentralWidget(); } } -QWidget *EditorWidget::createHelpWidget() const +HelperWidget::HelperWidget() { using namespace Layouting; + setFocusPolicy(Qt::ClickFocus); + setAttribute(Qt::WA_TransparentForMouseEvents, false); + auto addSourceButton = new QPushButton(Tr::tr("Add source code")); - connect(addSourceButton, &QPushButton::clicked, this, [this] { - auto newSource = std::make_shared<SourceSettings>( - [settings = m_document->settings()] { return settings->apiConfig(); }); - m_document->settings()->m_sources.addItem(newSource); - }); + + connect(addSourceButton, &QPushButton::clicked, this, &HelperWidget::addSource); // clang-format off - return Column { + Column { st, Row { st, @@ -705,10 +709,30 @@ QWidget *EditorWidget::createHelpWidget() const st, }, st, - }.emerge(); + }.attachTo(this); // clang-format on } +void HelperWidget::mousePressEvent(QMouseEvent *event) +{ + setFocus(Qt::MouseFocusReason); + event->accept(); +} + +void EditorWidget::addNewSource() +{ + auto newSource = std::make_shared<SourceSettings>( + [settings = m_document->settings()] { return settings->apiConfig(); }); + m_document->settings()->m_sources.addItem(newSource); +} + +QWidget *EditorWidget::createHelpWidget() const +{ + auto w = new HelperWidget; + connect(w, &HelperWidget::addSource, this, &EditorWidget::addNewSource); + return w; +} + TextEditor::TextEditorWidget *EditorWidget::focusedEditorWidget() const { for (const QDockWidget *sourceWidget : m_sourceWidgets) { @@ -728,49 +752,40 @@ TextEditor::TextEditorWidget *EditorWidget::focusedEditorWidget() const return nullptr; } -class Editor : public Core::IEditor +Editor::Editor(TextEditorActionHandler &actionHandler) + : m_document(new JsonSettingsDocument(&m_undoStack)) { -public: - Editor(TextEditorActionHandler &actionHandler) - : m_document(new JsonSettingsDocument(&m_undoStack)) - { - setWidget(new EditorWidget(m_document, &m_undoStack, actionHandler)); + setContext(Core::Context(Constants::CE_EDITOR_ID)); + setWidget(new EditorWidget(m_document, &m_undoStack, actionHandler)); - connect(&m_undoStack, &QUndoStack::canUndoChanged, this, [&actionHandler] { - actionHandler.updateActions(); - }); - connect(&m_undoStack, &QUndoStack::canRedoChanged, this, [&actionHandler] { - actionHandler.updateActions(); - }); - } + connect(&m_undoStack, &QUndoStack::canUndoChanged, this, [&actionHandler] { + actionHandler.updateActions(); + }); + connect(&m_undoStack, &QUndoStack::canRedoChanged, this, [&actionHandler] { + actionHandler.updateActions(); + }); +} - ~Editor() - { - if (m_document->isModified()) { - auto settings = m_document->settings(); - if (settings->isDirty()) { - settings->apply(); - Utils::Store store; - settings->toMap(store); - QJsonDocument doc = QJsonDocument::fromVariant(Utils::mapFromStore(store)); +Editor::~Editor() +{ + delete widget(); +} - CompilerExplorer::settings().defaultDocument.setValue( - QString::fromUtf8(doc.toJson())); - } - } - delete widget(); - } +static bool childHasFocus(QWidget *parent) +{ + if (parent->hasFocus()) + return true; - Core::IDocument *document() const override { return m_document.data(); } - QWidget *toolBar() override { return nullptr; } + for (QWidget *child : parent->findChildren<QWidget *>()) + if (childHasFocus(child)) + return true; - QSharedPointer<JsonSettingsDocument> m_document; - QUndoStack m_undoStack; -}; + return false; +} EditorFactory::EditorFactory() : m_actionHandler(Constants::CE_EDITOR_ID, - Constants::CE_EDITOR_CONTEXT_ID, + Constants::CE_EDITOR_ID, TextEditor::TextEditorActionHandler::None, [](Core::IEditor *editor) -> TextEditorWidget * { return static_cast<EditorWidget *>(editor->widget())->focusedEditorWidget(); @@ -798,7 +813,32 @@ EditorFactory::EditorFactory() return false; }); + m_actionHandler.setUnhandledCallback( + [undoStackFromEditor](Utils::Id cmdId, Core::IEditor *editor) { + if (cmdId != Core::Constants::UNDO && cmdId != Core::Constants::REDO) + return false; + + if (!childHasFocus(editor->widget())) + return false; + + QUndoStack *undoStack = undoStackFromEditor(editor); + + if (!undoStack) + return false; + + if (cmdId == Core::Constants::UNDO) + undoStack->undo(); + else + undoStack->redo(); + + return true; + }); + setEditorCreator([this]() { return new Editor(m_actionHandler); }); } +AsmEditorWidget::AsmEditorWidget(QUndoStack *stack) + : m_undoStack(stack) +{} + } // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.h b/src/plugins/compilerexplorer/compilerexplorereditor.h index 061f735b02c..73b417c3ab1 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.h +++ b/src/plugins/compilerexplorer/compilerexplorereditor.h @@ -61,7 +61,7 @@ class AsmEditorWidget : public TextEditor::TextEditorWidget Q_OBJECT public: - using TextEditor::TextEditorWidget::TextEditorWidget; + AsmEditorWidget(QUndoStack *undoStack); void focusInEvent(QFocusEvent *event) override { @@ -69,8 +69,14 @@ public: emit gotFocus(); } + void undo() override { m_undoStack->undo(); } + void redo() override { m_undoStack->redo(); } + signals: void gotFocus(); + +private: + QUndoStack *m_undoStack; }; class JsonSettingsDocument : public Core::IDocument @@ -138,7 +144,8 @@ class CompilerWidget : public QWidget Q_OBJECT public: CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSettings, - const std::shared_ptr<CompilerSettings> &compilerSettings); + const std::shared_ptr<CompilerSettings> &compilerSettings, + QUndoStack *undoStack); Core::SearchableTerminal *createTerminal(); @@ -172,6 +179,19 @@ private: QList<TextEditor::TextMark *> m_marks; }; +class HelperWidget : public QWidget +{ + Q_OBJECT +public: + HelperWidget(); + +protected: + void mousePressEvent(QMouseEvent *event) override; + +signals: + void addSource(); +}; + class EditorWidget : public Utils::FancyMainWindow { Q_OBJECT @@ -194,6 +214,8 @@ protected: void setupHelpWidget(); QWidget *createHelpWidget() const; + void addNewSource(); + void addCompiler(const std::shared_ptr<SourceSettings> &sourceSettings, const std::shared_ptr<CompilerSettings> &compilerSettings, int idx, @@ -207,8 +229,6 @@ protected: QVariantMap windowStateCallback(); private: - Core::IContext *m_context; - QSharedPointer<JsonSettingsDocument> m_document; QUndoStack *m_undoStack; TextEditor::TextEditorActionHandler &m_actionHandler; @@ -217,6 +237,19 @@ private: QList<QDockWidget *> m_sourceWidgets; }; +class Editor : public Core::IEditor +{ +public: + Editor(TextEditor::TextEditorActionHandler &actionHandler); + ~Editor(); + + Core::IDocument *document() const override { return m_document.data(); } + QWidget *toolBar() override { return nullptr; } + + QSharedPointer<JsonSettingsDocument> m_document; + QUndoStack m_undoStack; +}; + class EditorFactory : public Core::IEditorFactory { public: diff --git a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp index f6670df80ad..0a5dbd764b7 100644 --- a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp +++ b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp @@ -38,7 +38,7 @@ public: auto action = new QAction(Tr::tr("Open Compiler Explorer"), this); connect(action, &QAction::triggered, this, [] { - QString name("Compiler Explorer"); + QString name("Compiler Explorer $"); Core::EditorManager::openEditorWithContents(Constants::CE_EDITOR_ID, &name, settings().defaultDocument().toUtf8()); diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp index 078b60f73eb..8accdbcc214 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.cpp +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -199,7 +199,6 @@ void CompilerSettings::fillLibraries(const LibrarySelectionAspect::ResultCallbac auto future = Api::libraries(m_apiConfigFunction(), lang); auto watcher = new QFutureWatcher<Api::Libraries>(this); - watcher->setFuture(future); QObject::connect(watcher, &QFutureWatcher<Api::Libraries>::finished, this, @@ -212,6 +211,7 @@ void CompilerSettings::fillLibraries(const LibrarySelectionAspect::ResultCallbac return; } }); + watcher->setFuture(future); } void SourceSettings::fillLanguageIdModel(const Utils::StringSelectionAspect::ResultCallback &cb) @@ -241,7 +241,6 @@ void SourceSettings::fillLanguageIdModel(const Utils::StringSelectionAspect::Res auto future = Api::languages(m_apiConfigFunction()); auto watcher = new QFutureWatcher<Api::Languages>(this); - watcher->setFuture(future); QObject::connect(watcher, &QFutureWatcher<Api::Languages>::finished, this, @@ -254,6 +253,7 @@ void SourceSettings::fillLanguageIdModel(const Utils::StringSelectionAspect::Res return; } }); + watcher->setFuture(future); } void CompilerSettings::fillCompilerModel(const Utils::StringSelectionAspect::ResultCallback &cb) @@ -277,7 +277,6 @@ void CompilerSettings::fillCompilerModel(const Utils::StringSelectionAspect::Res auto future = Api::compilers(m_apiConfigFunction(), m_languageId); auto watcher = new QFutureWatcher<Api::Compilers>(this); - watcher->setFuture(future); QObject::connect(watcher, &QFutureWatcher<Api::Compilers>::finished, this, @@ -295,6 +294,7 @@ void CompilerSettings::fillCompilerModel(const Utils::StringSelectionAspect::Res return; } }); + watcher->setFuture(future); } CompilerExplorerSettings::CompilerExplorerSettings() diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 80625cc42e1..49b83b8a756 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -62,8 +62,18 @@ public: Utils::Id menueGroup = Utils::Id(), Core::ActionContainer *container = nullptr) { - return registerActionHelper(id, scriptable, title, keySequence, menueGroup, container, - [this, slot](bool) { if (m_currentEditorWidget) slot(m_currentEditorWidget); }); + return registerActionHelper(id, + scriptable, + title, + keySequence, + menueGroup, + container, + [this, slot, id](bool) { + if (m_currentEditorWidget) + slot(m_currentEditorWidget); + else if (m_unhandledCallback) + m_unhandledCallback(id, m_currentEditor); + }); } QAction *registerBoolAction(Utils::Id id, @@ -135,6 +145,8 @@ public: TextEditorActionHandler::Predicate m_canUndoCallback; TextEditorActionHandler::Predicate m_canRedoCallback; + + TextEditorActionHandler::UnhandledCallback m_unhandledCallback; }; TextEditorActionHandlerPrivate::TextEditorActionHandlerPrivate @@ -478,17 +490,28 @@ void TextEditorActionHandlerPrivate::updateActions() m_textWrappingAction->setChecked(m_currentEditorWidget->displaySettings().m_textWrapping); } - if (m_currentEditorWidget) { - updateRedoAction(m_canRedoCallback ? m_canRedoCallback(m_currentEditor) - : m_currentEditorWidget->document()->isRedoAvailable()); - updateUndoAction(m_canUndoCallback ? m_canUndoCallback(m_currentEditor) - : m_currentEditorWidget->document()->isUndoAvailable()); - updateCopyAction(m_currentEditorWidget->textCursor().hasSelection()); - } else { - updateRedoAction(false); - updateUndoAction(false); - updateCopyAction(false); + bool canRedo = false; + bool canUndo = false; + bool canCopy = false; + + if (m_currentEditor && m_currentEditor->document() + && m_currentEditor->document()->id() == m_editorId) { + canRedo = m_canRedoCallback ? m_canRedoCallback(m_currentEditor) : false; + canUndo = m_canUndoCallback ? m_canUndoCallback(m_currentEditor) : false; + + if (m_currentEditorWidget) { + canRedo = m_canRedoCallback ? canRedo + : m_currentEditorWidget->document()->isRedoAvailable(); + canUndo = m_canUndoCallback ? canUndo + : m_currentEditorWidget->document()->isUndoAvailable(); + canCopy = m_currentEditorWidget->textCursor().hasSelection(); + } } + + updateRedoAction(canRedo); + updateUndoAction(canUndo); + updateCopyAction(canCopy); + updateOptionalActions(); } @@ -553,19 +576,19 @@ void TextEditorActionHandlerPrivate::updateCurrentEditor(Core::IEditor *editor) m_currentEditor = editor; if (editor && editor->document()->id() == m_editorId) { - TextEditorWidget *editorWidget = m_findTextWidget(editor); - QTC_ASSERT(editorWidget, return); // editor has our id, so shouldn't happen - m_currentEditorWidget = editorWidget; - connect(editorWidget, &QPlainTextEdit::undoAvailable, - this, &TextEditorActionHandlerPrivate::updateUndoAction); - connect(editorWidget, &QPlainTextEdit::redoAvailable, - this, &TextEditorActionHandlerPrivate::updateRedoAction); - connect(editorWidget, &QPlainTextEdit::copyAvailable, - this, &TextEditorActionHandlerPrivate::updateCopyAction); - connect(editorWidget, &TextEditorWidget::readOnlyChanged, - this, &TextEditorActionHandlerPrivate::updateActions); - connect(editorWidget, &TextEditorWidget::optionalActionMaskChanged, - this, &TextEditorActionHandlerPrivate::updateOptionalActions); + m_currentEditorWidget = m_findTextWidget(editor); + if (m_currentEditorWidget) { + connect(m_currentEditorWidget, &QPlainTextEdit::undoAvailable, + this, &TextEditorActionHandlerPrivate::updateUndoAction); + connect(m_currentEditorWidget, &QPlainTextEdit::redoAvailable, + this, &TextEditorActionHandlerPrivate::updateRedoAction); + connect(m_currentEditorWidget, &QPlainTextEdit::copyAvailable, + this, &TextEditorActionHandlerPrivate::updateCopyAction); + connect(m_currentEditorWidget, &TextEditorWidget::readOnlyChanged, + this, &TextEditorActionHandlerPrivate::updateActions); + connect(m_currentEditorWidget, &TextEditorWidget::optionalActionMaskChanged, + this, &TextEditorActionHandlerPrivate::updateOptionalActions); + } } updateActions(); } @@ -614,4 +637,9 @@ void TextEditorActionHandler::setCanRedoCallback(const Predicate &callback) d->m_canRedoCallback = callback; } +void TextEditorActionHandler::setUnhandledCallback(const UnhandledCallback &callback) +{ + d->m_unhandledCallback = callback; +} + } // namespace TextEditor diff --git a/src/plugins/texteditor/texteditoractionhandler.h b/src/plugins/texteditor/texteditoractionhandler.h index e1d06f7e3cd..344a4a553e1 100644 --- a/src/plugins/texteditor/texteditoractionhandler.h +++ b/src/plugins/texteditor/texteditoractionhandler.h @@ -58,6 +58,9 @@ public: void setCanUndoCallback(const Predicate &callback); void setCanRedoCallback(const Predicate &callback); + using UnhandledCallback = std::function<void(Utils::Id commandId, Core::IEditor *editor)>; + void setUnhandledCallback(const UnhandledCallback &callback); + private: Internal::TextEditorActionHandlerPrivate *d; }; From d4e7dfca76997a72e49b6486d51f562c3773d8f7 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 9 Oct 2023 12:52:28 +0200 Subject: [PATCH 1487/1777] Utils: Add compatibility for older settings Adds compatibility for older settings - likely only relevant for settings of snapshots or development QCs. Change-Id: Icb6a9c054dea4deac5adbc4255bc60dcd6c14ea7 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/store.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/utils/store.cpp b/src/libs/utils/store.cpp index 8ca42a5560c..37f939f5a8c 100644 --- a/src/libs/utils/store.cpp +++ b/src/libs/utils/store.cpp @@ -35,6 +35,9 @@ Store storeFromVariant(const QVariant &value) if (value.typeId() == QMetaType::QVariantMap) return storeFromMap(value.toMap()); + if (value.typeId() == qMetaTypeId<OldStore>()) + return storeFromMap(value.toMap()); + if (!value.isValid()) return {}; From 3b516524e3da4c38dd50c02f89fa856b7bb4e96f Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 9 Oct 2023 10:53:57 +0200 Subject: [PATCH 1488/1777] Fix QmlProfiler when built with Qt 6.6 qrc:/qt/qml/QtCreator/Tracing/TimelineLabels.qml:29:5: Cannot override FINAL property property bool dragging: false ^ Flickable has a `dragging` property itself, and in Qt 6.6 that leads to this error. Fixes: QTCREATORBUG-29719 Change-Id: I882e944035141622c0bdf65ee4fcb3cf145aef0d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> --- src/libs/tracing/qml/CategoryLabel.qml | 10 +++++----- src/libs/tracing/qml/TimelineLabels.qml | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libs/tracing/qml/CategoryLabel.qml b/src/libs/tracing/qml/CategoryLabel.qml index 58704aa175a..db58b13c0ff 100644 --- a/src/libs/tracing/qml/CategoryLabel.qml +++ b/src/libs/tracing/qml/CategoryLabel.qml @@ -15,7 +15,7 @@ Item { property bool expanded: model && model.expanded property var labels: (expanded && model) ? model.labels : [] - property bool dragging + property bool isDragging property int visualIndex property int dragOffset property Item draggerParent @@ -38,10 +38,10 @@ Item { id: dragArea anchors.fill: txt drag.target: dragger - cursorShape: labelContainer.dragging ? Qt.ClosedHandCursor : Qt.OpenHandCursor + cursorShape: labelContainer.isDragging ? Qt.ClosedHandCursor : Qt.OpenHandCursor // Account for parent change below - drag.minimumY: labelContainer.dragging ? 0 : -labelContainer.dragOffset - drag.maximumY: labelContainer.visibleHeight - (labelContainer.dragging ? 0 : labelContainer.dragOffset) + drag.minimumY: labelContainer.isDragging ? 0 : -labelContainer.dragOffset + drag.maximumY: labelContainer.visibleHeight - (labelContainer.isDragging ? 0 : labelContainer.dragOffset) drag.axis: Drag.YAxis hoverEnabled: true ToolTip { @@ -221,7 +221,7 @@ Item { MouseArea { anchors.top: dragArea.bottom - anchors.bottom: labelContainer.dragging ? labelContainer.bottom : dragArea.bottom + anchors.bottom: labelContainer.isDragging ? labelContainer.bottom : dragArea.bottom anchors.left: labelContainer.left anchors.right: labelContainer.right cursorShape: dragArea.cursorShape diff --git a/src/libs/tracing/qml/TimelineLabels.qml b/src/libs/tracing/qml/TimelineLabels.qml index 754f36e1902..99f36467875 100644 --- a/src/libs/tracing/qml/TimelineLabels.qml +++ b/src/libs/tracing/qml/TimelineLabels.qml @@ -26,7 +26,7 @@ Flickable { // Dispatch the cursor shape to all labels. When dragging the DropArea receiving // the drag events is not necessarily related to the MouseArea receiving the mouse // events, so we can't use the drag events to determine the cursor shape. - property bool dragging: false + property bool isDragging: false Column { id: categoryContent @@ -75,10 +75,10 @@ Flickable { model: modelData notesModel: categories.modelProxy.notes visualIndex: loader.visualIndex - dragging: categories.dragging + isDragging: categories.isDragging reverseSelect: categories.reverseSelect - onDragStarted: categories.dragging = true - onDragStopped: categories.dragging = false + onDragStarted: categories.isDragging = true + onDragStopped: categories.isDragging = false draggerParent: categories contentY: categories.contentY contentHeight: categories.contentHeight From 222bae949fadc6c45eac6f1499514eeb8d6a389d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 9 Oct 2023 11:42:39 +0200 Subject: [PATCH 1489/1777] BuildSystem: Remove unused signal Change-Id: I5d0d58f749633dd2a00448868fc6068f9866972c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/projectexplorer/buildsystem.cpp | 1 - src/plugins/projectexplorer/buildsystem.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/plugins/projectexplorer/buildsystem.cpp b/src/plugins/projectexplorer/buildsystem.cpp index 583e532cc4b..405de77e178 100644 --- a/src/plugins/projectexplorer/buildsystem.cpp +++ b/src/plugins/projectexplorer/buildsystem.cpp @@ -323,7 +323,6 @@ void BuildSystem::setDeploymentData(const DeploymentData &deploymentData) { if (d->m_deploymentData != deploymentData) { d->m_deploymentData = deploymentData; - emit deploymentDataChanged(); emit target()->deploymentDataChanged(); } } diff --git a/src/plugins/projectexplorer/buildsystem.h b/src/plugins/projectexplorer/buildsystem.h index 55de9b30ac8..276427a7f91 100644 --- a/src/plugins/projectexplorer/buildsystem.h +++ b/src/plugins/projectexplorer/buildsystem.h @@ -152,7 +152,6 @@ public: signals: void parsingStarted(); void parsingFinished(bool success); - void deploymentDataChanged(); void testInformationUpdated(); void debuggingStarted(); From 04ee682bcc9a25090824d6b5b066a2f5004be1a4 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 2 Oct 2023 18:14:27 +0200 Subject: [PATCH 1490/1777] Core: Remove SessionManager::isStartupSessionRestored() mechanism Apparently not used anymore. Change-Id: I0ea8f70979450799c979ca5cd3314c834560b336 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/coreplugin/session.cpp | 7 ------- src/plugins/coreplugin/session.h | 3 --- 2 files changed, 10 deletions(-) diff --git a/src/plugins/coreplugin/session.cpp b/src/plugins/coreplugin/session.cpp index 106558c14ba..bf6d9205b3e 100644 --- a/src/plugins/coreplugin/session.cpp +++ b/src/plugins/coreplugin/session.cpp @@ -89,7 +89,6 @@ public: static QString sessionTitle(const FilePath &filePath); QString m_sessionName = "default"; - bool m_isStartupSessionRestored = false; bool m_isAutoRestoreLastSession = false; bool m_virginSession = true; bool m_loadingSession = false; @@ -403,7 +402,6 @@ static QString determineSessionToRestoreAtStartup() void SessionManagerPrivate::restoreStartupSession() { NANOTRACE_SCOPE("Core", "SessionManagerPrivate::restoreStartupSession"); - m_isStartupSessionRestored = true; QString sessionToRestoreAtStartup = determineSessionToRestoreAtStartup(); if (!sessionToRestoreAtStartup.isEmpty()) ModeManager::activateMode(Core::Constants::MODE_EDIT); @@ -778,9 +776,4 @@ bool SessionManager::saveSession() return result; } -bool SessionManager::isStartupSessionRestored() -{ - return d->m_isStartupSessionRestored; -} - } // namespace Core diff --git a/src/plugins/coreplugin/session.h b/src/plugins/coreplugin/session.h index f0c433e1cdc..19209b60414 100644 --- a/src/plugins/coreplugin/session.h +++ b/src/plugins/coreplugin/session.h @@ -80,9 +80,6 @@ signals: void sessionRenamed(const QString &oldName, const QString &newName); void sessionRemoved(const QString &name); -public: // internal - static bool isStartupSessionRestored(); - private: static void saveActiveMode(Utils::Id mode); }; From d278923dd49816b2193245be0bae459fb483d892 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 9 Oct 2023 14:08:56 +0200 Subject: [PATCH 1491/1777] CMakeParser: Ensure the details list isn't empty Amends bda5c6a22804102b064b7d2bbeeee240dda6f815 Fixes: QTCREATORBUG-29732 Change-Id: Iac518227df42c4d22b808028958210485a9c02ff Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/cmakeparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.cpp b/src/plugins/cmakeprojectmanager/cmakeparser.cpp index 3546fa11cf4..2e3c954f029 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeparser.cpp @@ -200,7 +200,7 @@ void CMakeParser::flush() if (m_lastTask.isNull()) return; - if (m_lastTask.summary.isEmpty()) + if (m_lastTask.summary.isEmpty() && !m_lastTask.details.isEmpty()) m_lastTask.summary = m_lastTask.details.takeFirst(); m_lines += m_lastTask.details.count(); From 8af6d16b6c2a0a08ee4f49abdfc7b0a503276bde Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 28 Sep 2023 13:22:14 +0200 Subject: [PATCH 1492/1777] TextEditor: Hide LineNumberFilter implementation One of the two non-standard items exposed in the TextEditorPlugin class interface. Change-Id: I89755c6a2b168f31b69d3904d6d043273b462ea6 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/texteditor/linenumberfilter.cpp | 108 ++++++++++-------- src/plugins/texteditor/linenumberfilter.h | 13 +-- .../texteditor/texteditoractionhandler.cpp | 3 +- src/plugins/texteditor/texteditorplugin.cpp | 6 - src/plugins/texteditor/texteditorplugin.h | 3 - 5 files changed, 63 insertions(+), 70 deletions(-) diff --git a/src/plugins/texteditor/linenumberfilter.cpp b/src/plugins/texteditor/linenumberfilter.cpp index b718e5b4331..245d8565190 100644 --- a/src/plugins/texteditor/linenumberfilter.cpp +++ b/src/plugins/texteditor/linenumberfilter.cpp @@ -1,69 +1,79 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "linenumberfilter.h" - #include "texteditortr.h" #include <coreplugin/editormanager/editormanager.h> +#include <coreplugin/locator/ilocatorfilter.h> using namespace Core; using namespace Utils; namespace TextEditor::Internal { -LineNumberFilter::LineNumberFilter() +class LineNumberFilter : public ILocatorFilter { - setId("Line in current document"); - setDisplayName(Tr::tr("Line in Current Document")); - setDescription(Tr::tr("Jumps to the given line in the current document.")); - setDefaultSearchText(Tr::tr("<line>:<column>")); - setPriority(High); - setDefaultShortcutString("l"); - setDefaultIncludedByDefault(true); -} +public: + LineNumberFilter() + { + setId("Line in current document"); + setDisplayName(Tr::tr("Line in Current Document")); + setDescription(Tr::tr("Jumps to the given line in the current document.")); + setDefaultSearchText(Tr::tr("<line>:<column>")); + setPriority(High); + setDefaultShortcutString("l"); + setDefaultIncludedByDefault(true); + } -LocatorMatcherTasks LineNumberFilter::matchers() -{ - using namespace Tasking; +private: + LocatorMatcherTasks matchers() final + { + using namespace Tasking; - TreeStorage<LocatorStorage> storage; + TreeStorage<LocatorStorage> storage; - const auto onSetup = [storage] { - const QStringList lineAndColumn = storage->input().split(':'); - int sectionCount = lineAndColumn.size(); - int line = 0; - int column = 0; - bool ok = false; - if (sectionCount > 0) - line = lineAndColumn.at(0).toInt(&ok); - if (ok && sectionCount > 1) - column = lineAndColumn.at(1).toInt(&ok); - if (!ok) - return; - if (EditorManager::currentEditor() && (line > 0 || column > 0)) { - QString text; - if (line > 0 && column > 0) - text = Tr::tr("Line %1, Column %2").arg(line).arg(column); - else if (line > 0) - text = Tr::tr("Line %1").arg(line); - else - text = Tr::tr("Column %1").arg(column); - LocatorFilterEntry entry; - entry.displayName = text; - entry.acceptor = [line, targetColumn = column - 1] { - IEditor *editor = EditorManager::currentEditor(); - if (!editor) + const auto onSetup = [storage] { + const QStringList lineAndColumn = storage->input().split(':'); + int sectionCount = lineAndColumn.size(); + int line = 0; + int column = 0; + bool ok = false; + if (sectionCount > 0) + line = lineAndColumn.at(0).toInt(&ok); + if (ok && sectionCount > 1) + column = lineAndColumn.at(1).toInt(&ok); + if (!ok) + return; + if (EditorManager::currentEditor() && (line > 0 || column > 0)) { + QString text; + if (line > 0 && column > 0) + text = Tr::tr("Line %1, Column %2").arg(line).arg(column); + else if (line > 0) + text = Tr::tr("Line %1").arg(line); + else + text = Tr::tr("Column %1").arg(column); + LocatorFilterEntry entry; + entry.displayName = text; + entry.acceptor = [line, targetColumn = column - 1] { + IEditor *editor = EditorManager::currentEditor(); + if (!editor) + return AcceptResult(); + EditorManager::addCurrentPositionToNavigationHistory(); + editor->gotoLine(line < 1 ? editor->currentLine() : line, targetColumn); + EditorManager::activateEditor(editor); return AcceptResult(); - EditorManager::addCurrentPositionToNavigationHistory(); - editor->gotoLine(line < 1 ? editor->currentLine() : line, targetColumn); - EditorManager::activateEditor(editor); - return AcceptResult(); - }; - storage->reportOutput({entry}); - } - }; - return {{Sync(onSetup), storage}}; + }; + storage->reportOutput({entry}); + } + }; + return {{Sync(onSetup), storage}}; + } +}; + +ILocatorFilter *lineNumberFilter() +{ + static LineNumberFilter theLineNumberFilter; + return &theLineNumberFilter; } } // namespace TextEditor::Internal diff --git a/src/plugins/texteditor/linenumberfilter.h b/src/plugins/texteditor/linenumberfilter.h index ec72c1bb029..cbae14ea014 100644 --- a/src/plugins/texteditor/linenumberfilter.h +++ b/src/plugins/texteditor/linenumberfilter.h @@ -3,17 +3,10 @@ #pragma once -#include <coreplugin/locator/ilocatorfilter.h> +namespace Core { class ILocatorFilter; } namespace TextEditor::Internal { -class LineNumberFilter : public Core::ILocatorFilter -{ -public: - LineNumberFilter(); +Core::ILocatorFilter *lineNumberFilter(); -private: - Core::LocatorMatcherTasks matchers() final; -}; - -} // namespace TextEditor::Internal +} // TextEditor::Internal diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 49b83b8a756..c105a26cc4a 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -7,7 +7,6 @@ #include "displaysettings.h" #include "fontsettings.h" #include "linenumberfilter.h" -#include "texteditorplugin.h" #include "texteditortr.h" #include "texteditorsettings.h" @@ -180,7 +179,7 @@ void TextEditorActionHandlerPrivate::createActions() registerAction(SELECTALL, [] (TextEditorWidget *w) { w->selectAll(); }, true); registerAction(GOTO, [] (TextEditorWidget *) { - Core::LocatorManager::showFilter(TextEditorPlugin::lineNumberFilter()); + Core::LocatorManager::showFilter(lineNumberFilter()); }); m_modifyingActions << registerAction(PRINT, [] (TextEditorWidget *widget) { widget->print(Core::ICore::printer()); }); diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index f8de8503937..7746ddb4491 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -99,7 +99,6 @@ public: FilePath m_marginActionFileName; TextEditorSettings settings; - LineNumberFilter lineNumberFilter; // Goto line functionality for quick open OutlineFactory outlineFactory; FindInFiles findInFilesFilter; @@ -426,11 +425,6 @@ void TextEditorPlugin::extensionsInitialized() }); } -LineNumberFilter *TextEditorPlugin::lineNumberFilter() -{ - return &m_instance->d->lineNumberFilter; -} - ExtensionSystem::IPlugin::ShutdownFlag TextEditorPlugin::aboutToShutdown() { Highlighter::handleShutdown(); diff --git a/src/plugins/texteditor/texteditorplugin.h b/src/plugins/texteditor/texteditorplugin.h index f5725061950..3f21b7ce2f5 100644 --- a/src/plugins/texteditor/texteditorplugin.h +++ b/src/plugins/texteditor/texteditorplugin.h @@ -8,8 +8,6 @@ namespace TextEditor { namespace Internal { -class LineNumberFilter; - class TextEditorPlugin final : public ExtensionSystem::IPlugin { Q_OBJECT @@ -20,7 +18,6 @@ public: ~TextEditorPlugin() final; static TextEditorPlugin *instance(); - static LineNumberFilter *lineNumberFilter(); ShutdownFlag aboutToShutdown() override; From 6adaa850e8bd15b9b9165710cae139bec8d3f7c3 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Mon, 9 Oct 2023 13:50:32 +0200 Subject: [PATCH 1493/1777] LSP: rename Create/Rename/DeleteFile classes Since they clash with default windows functions and cause issues with PCH build. Change-Id: Ice0339c7dad14b40e172c885ffb71d923469614a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/libs/languageserverprotocol/lsptypes.cpp | 26 +++++++++---------- src/libs/languageserverprotocol/lsptypes.h | 14 +++++----- .../languageclientsymbolsupport.cpp | 18 ++++++------- .../languageclient/languageclientutils.cpp | 12 ++++----- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/libs/languageserverprotocol/lsptypes.cpp b/src/libs/languageserverprotocol/lsptypes.cpp index 6b2975fbe51..ddd9b0e66c0 100644 --- a/src/libs/languageserverprotocol/lsptypes.cpp +++ b/src/libs/languageserverprotocol/lsptypes.cpp @@ -419,16 +419,16 @@ DocumentChange::DocumentChange(const QJsonValue &value) { const QString kind = value["kind"].toString(); if (kind == "create") - emplace<CreateFile>(value); + emplace<CreateFileOperation>(value); else if (kind == "rename") - emplace<RenameFile>(value); + emplace<RenameFileOperation>(value); else if (kind == "delete") - emplace<DeleteFile>(value); + emplace<DeleteFileOperation>(value); else emplace<TextDocumentEdit>(value); } -using DocumentChangeBase = std::variant<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>; +using DocumentChangeBase = std::variant<TextDocumentEdit, CreateFileOperation, RenameFileOperation, DeleteFileOperation>; bool DocumentChange::isValid() const { @@ -440,49 +440,49 @@ DocumentChange::operator const QJsonValue () const return std::visit([](const auto &v) { return QJsonValue(v); }, DocumentChangeBase(*this)); } -CreateFile::CreateFile() +CreateFileOperation::CreateFileOperation() { insert(kindKey, "create"); } -QString CreateFile::message(const DocumentUri::PathMapper &mapToHostPath) const +QString CreateFileOperation::message(const DocumentUri::PathMapper &mapToHostPath) const { return Tr::tr("Create %1").arg(uri().toFilePath(mapToHostPath).toUserOutput()); } -bool LanguageServerProtocol::CreateFile::isValid() const +bool LanguageServerProtocol::CreateFileOperation::isValid() const { return contains(uriKey) && value(kindKey) == "create"; } -RenameFile::RenameFile() +RenameFileOperation::RenameFileOperation() { insert(kindKey, "rename"); } -QString RenameFile::message(const DocumentUri::PathMapper &mapToHostPath) const +QString RenameFileOperation::message(const DocumentUri::PathMapper &mapToHostPath) const { return Tr::tr("Rename %1 to %2") .arg(oldUri().toFilePath(mapToHostPath).toUserOutput(), newUri().toFilePath(mapToHostPath).toUserOutput()); } -bool RenameFile::isValid() const +bool RenameFileOperation::isValid() const { return contains(oldUriKey) && contains(newUriKey) && value(kindKey) == "rename"; } -DeleteFile::DeleteFile() +DeleteFileOperation::DeleteFileOperation() { insert(kindKey, "delete"); } -QString DeleteFile::message(const DocumentUri::PathMapper &mapToHostPath) const +QString DeleteFileOperation::message(const DocumentUri::PathMapper &mapToHostPath) const { return Tr::tr("Delete %1").arg(uri().toFilePath(mapToHostPath).toUserOutput()); } -bool DeleteFile::isValid() const +bool DeleteFileOperation::isValid() const { return contains(uriKey) && value(kindKey) == "delete"; } diff --git a/src/libs/languageserverprotocol/lsptypes.h b/src/libs/languageserverprotocol/lsptypes.h index 135b4c124a2..ae19f36145b 100644 --- a/src/libs/languageserverprotocol/lsptypes.h +++ b/src/libs/languageserverprotocol/lsptypes.h @@ -299,11 +299,11 @@ public: void clearIgnoreIfExists() { remove(ignoreIfExistsKey); } }; -class LANGUAGESERVERPROTOCOL_EXPORT CreateFile : public JsonObject +class LANGUAGESERVERPROTOCOL_EXPORT CreateFileOperation : public JsonObject { public: using JsonObject::JsonObject; - CreateFile(); + CreateFileOperation(); DocumentUri uri() const { return DocumentUri::fromProtocol(typedValue<QString>(uriKey)); } void setUri(const DocumentUri &uri) { insert(uriKey, uri); } @@ -318,11 +318,11 @@ public: bool isValid() const override; }; -class LANGUAGESERVERPROTOCOL_EXPORT RenameFile : public JsonObject +class LANGUAGESERVERPROTOCOL_EXPORT RenameFileOperation : public JsonObject { public: using JsonObject::JsonObject; - RenameFile(); + RenameFileOperation(); DocumentUri oldUri() const { return DocumentUri::fromProtocol(typedValue<QString>(oldUriKey)); } void setOldUri(const DocumentUri &oldUri) { insert(oldUriKey, oldUri); } @@ -354,11 +354,11 @@ public: void clearIgnoreIfNotExists() { remove(ignoreIfNotExistsKey); } }; -class LANGUAGESERVERPROTOCOL_EXPORT DeleteFile : public JsonObject +class LANGUAGESERVERPROTOCOL_EXPORT DeleteFileOperation : public JsonObject { public: using JsonObject::JsonObject; - DeleteFile(); + DeleteFileOperation(); DocumentUri uri() const { return DocumentUri::fromProtocol(typedValue<QString>(uriKey)); } void setUri(const DocumentUri &uri) { insert(uriKey, uri); } @@ -374,7 +374,7 @@ public: }; class LANGUAGESERVERPROTOCOL_EXPORT DocumentChange - : public std::variant<TextDocumentEdit, CreateFile, RenameFile, DeleteFile> + : public std::variant<TextDocumentEdit, CreateFileOperation, RenameFileOperation, DeleteFileOperation> { public: using variant::variant; diff --git a/src/plugins/languageclient/languageclientsymbolsupport.cpp b/src/plugins/languageclient/languageclientsymbolsupport.cpp index 8ba9507a640..13dddd38e23 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.cpp +++ b/src/plugins/languageclient/languageclientsymbolsupport.cpp @@ -556,18 +556,18 @@ Utils::SearchResultItems generateReplaceItems(const WorkspaceEdit &edits, } else { Utils::SearchResultItem item; - if (std::holds_alternative<LanguageServerProtocol::CreateFile>(documentChange)) { - auto op = std::get<LanguageServerProtocol::CreateFile>(documentChange); + if (std::holds_alternative<CreateFileOperation>(documentChange)) { + auto op = std::get<CreateFileOperation>(documentChange); item.setLineText(op.message(pathMapper)); item.setFilePath(op.uri().toFilePath(pathMapper)); item.setUserData(QVariant(op)); - } else if (std::holds_alternative<RenameFile>(documentChange)) { - auto op = std::get<RenameFile>(documentChange); + } else if (std::holds_alternative<RenameFileOperation>(documentChange)) { + auto op = std::get<RenameFileOperation>(documentChange); item.setLineText(op.message(pathMapper)); item.setFilePath(op.oldUri().toFilePath(pathMapper)); item.setUserData(QVariant(op)); - } else if (std::holds_alternative<LanguageServerProtocol::DeleteFile>(documentChange)) { - auto op = std::get<LanguageServerProtocol::DeleteFile>(documentChange); + } else if (std::holds_alternative<DeleteFileOperation>(documentChange)) { + auto op = std::get<DeleteFileOperation>(documentChange); item.setLineText(op.message(pathMapper)); item.setFilePath(op.uri().toFilePath(pathMapper)); item.setUserData(QVariant(op)); @@ -693,11 +693,11 @@ void SymbolSupport::applyRename(const Utils::SearchResultItems &checkedItems, const QJsonObject jsonObject = item.userData().toJsonObject(); if (const TextEdit edit(jsonObject); edit.isValid()) editsForDocuments[filePath] << edit; - else if (const LanguageServerProtocol::CreateFile createFile(jsonObject); createFile.isValid()) + else if (const CreateFileOperation createFile(jsonObject); createFile.isValid()) changes << createFile; - else if (const RenameFile renameFile(jsonObject); renameFile.isValid()) + else if (const RenameFileOperation renameFile(jsonObject); renameFile.isValid()) changes << renameFile; - else if (const LanguageServerProtocol::DeleteFile deleteFile(jsonObject); deleteFile.isValid()) + else if (const DeleteFileOperation deleteFile(jsonObject); deleteFile.isValid()) changes << deleteFile; } diff --git a/src/plugins/languageclient/languageclientutils.cpp b/src/plugins/languageclient/languageclientutils.cpp index 2df9331d2bf..8fc032f06d6 100644 --- a/src/plugins/languageclient/languageclientutils.cpp +++ b/src/plugins/languageclient/languageclientutils.cpp @@ -351,8 +351,8 @@ bool applyDocumentChange(const Client *client, const DocumentChange &change) if (std::holds_alternative<TextDocumentEdit>(change)) { return applyTextDocumentEdit(client, std::get<TextDocumentEdit>(change)); - } else if (std::holds_alternative<LanguageServerProtocol::CreateFile>(change)) { - const auto createOperation = std::get<LanguageServerProtocol::CreateFile>(change); + } else if (std::holds_alternative<CreateFileOperation>(change)) { + const auto createOperation = std::get<CreateFileOperation>(change); const FilePath filePath = createOperation.uri().toFilePath(client->hostPathMapper()); if (filePath.exists()) { if (const std::optional<CreateFileOptions> options = createOperation.options()) { @@ -365,8 +365,8 @@ bool applyDocumentChange(const Client *client, const DocumentChange &change) } } return filePath.ensureExistingFile(); - } else if (std::holds_alternative<RenameFile>(change)) { - const RenameFile renameOperation = std::get<RenameFile>(change); + } else if (std::holds_alternative<RenameFileOperation>(change)) { + const RenameFileOperation renameOperation = std::get<RenameFileOperation>(change); const FilePath oldPath = renameOperation.oldUri().toFilePath(client->hostPathMapper()); if (!oldPath.exists()) return false; @@ -384,8 +384,8 @@ bool applyDocumentChange(const Client *client, const DocumentChange &change) } } return oldPath.renameFile(newPath); - } else if (std::holds_alternative<LanguageServerProtocol::DeleteFile>(change)) { - const auto deleteOperation = std::get<LanguageServerProtocol::DeleteFile>(change); + } else if (std::holds_alternative<DeleteFileOperation>(change)) { + const auto deleteOperation = std::get<DeleteFileOperation>(change); const FilePath filePath = deleteOperation.uri().toFilePath(client->hostPathMapper()); if (const std::optional<DeleteFileOptions> options = deleteOperation.options()) { if (!filePath.exists()) From 23908b283e429a65d937231d59375c72ac1b62f3 Mon Sep 17 00:00:00 2001 From: Xavier BESSON <developer@xavi-b.fr> Date: Thu, 28 Sep 2023 08:54:34 +0200 Subject: [PATCH 1494/1777] Bookmarks: goto on double click + drag & drop on view Change-Id: Iec21843fb6679d156e9839f84e56005b8eef7f32 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/texteditor/bookmarkmanager.cpp | 78 +++++++++++++++++++++- src/plugins/texteditor/bookmarkmanager.h | 4 ++ 2 files changed, 79 insertions(+), 3 deletions(-) diff --git a/src/plugins/texteditor/bookmarkmanager.cpp b/src/plugins/texteditor/bookmarkmanager.cpp index c6cc58d7627..ae21a75be88 100644 --- a/src/plugins/texteditor/bookmarkmanager.cpp +++ b/src/plugins/texteditor/bookmarkmanager.cpp @@ -215,9 +215,9 @@ BookmarkView::BookmarkView(BookmarkManager *manager) : setSelectionMode(QAbstractItemView::SingleSelection); setSelectionBehavior(QAbstractItemView::SelectRows); setDragEnabled(true); - setDragDropMode(QAbstractItemView::DragOnly); + setDragDropMode(QAbstractItemView::DragDrop); - connect(this, &QAbstractItemView::clicked, this, &BookmarkView::gotoBookmark); + connect(this, &QAbstractItemView::doubleClicked, this, &BookmarkView::gotoBookmark); connect(this, &QAbstractItemView::activated, this, &BookmarkView::gotoBookmark); } @@ -395,7 +395,7 @@ Qt::ItemFlags BookmarkManager::flags(const QModelIndex &index) const { if (!index.isValid() || index.column() !=0 || index.row() < 0 || index.row() >= m_bookmarksList.count()) return Qt::NoItemFlags; - return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled; + return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled; } Qt::DropActions BookmarkManager::supportedDragActions() const @@ -416,10 +416,62 @@ QMimeData *BookmarkManager::mimeData(const QModelIndexList &indexes) const continue; Bookmark *bookMark = m_bookmarksList.at(index.row()); data->addFile(bookMark->filePath(), bookMark->lineNumber()); + data->addValue(QVariant::fromValue(bookMark)); } return data; } +Qt::DropActions BookmarkManager::supportedDropActions() const +{ + return Qt::MoveAction; +} + +bool BookmarkManager::canDropMimeData(const QMimeData *data, Qt::DropAction action, + int row, int column, + const QModelIndex &parent) const +{ + Q_UNUSED(row); + Q_UNUSED(column); + Q_UNUSED(parent); + + if (!(action & supportedDropActions())) + return false; + + const DropMimeData* customData = qobject_cast<const DropMimeData*>(data); + if (!customData) + return false; + + return true; +} + +bool BookmarkManager::dropMimeData(const QMimeData *data, Qt::DropAction action, + int row, int column, const QModelIndex &parent) +{ + Q_UNUSED(column); + + if (!(action & supportedDropActions())) + return false; + + const DropMimeData* customData = qobject_cast<const DropMimeData*>(data); + if (!customData) + return false; + + row = parent.row(); + if (row >= m_bookmarksList.size()) + row = m_bookmarksList.size() - 1; + if (row == -1) + row = m_bookmarksList.size() - 1; + + const QList<QVariant> values = customData->values(); + for (const QVariant &value : values) { + auto mark = value.value<Bookmark*>(); + if (mark) + move(mark, row); + } + + return true; +} + void BookmarkManager::toggleBookmark(const FilePath &fileName, int lineNumber) { if (lineNumber <= 0 || fileName.isEmpty()) @@ -628,6 +680,25 @@ void BookmarkManager::updateActionStatus() emit updateActions(enableToggle, state()); } +void BookmarkManager::move(Bookmark* mark, int newRow) +{ + int currentRow = m_bookmarksList.indexOf(mark); + if (newRow <= currentRow) + ++currentRow; + else + ++newRow; + m_bookmarksList.insert(newRow, mark); + m_bookmarksList.removeAt(currentRow); + + QModelIndex current = selectionModel()->currentIndex(); + QModelIndex topLeft = current.sibling(std::min(newRow, currentRow), 0); + QModelIndex bottomRight = current.sibling(std::max(newRow, currentRow), 2); + emit dataChanged(topLeft, bottomRight); + selectionModel()->setCurrentIndex(topLeft, QItemSelectionModel::Select | QItemSelectionModel::Clear); + + saveBookmarks(); +} + void BookmarkManager::moveUp() { QModelIndex current = selectionModel()->currentIndex(); @@ -824,6 +895,7 @@ BookmarkViewFactory::BookmarkViewFactory(BookmarkManager *bm) NavigationView BookmarkViewFactory::createWidget() { auto view = new BookmarkView(m_manager); + view->setActivationMode(Utils::DoubleClickActivation); // QUESTION: is this useful ? return {view, view->createToolBarWidgets()}; } diff --git a/src/plugins/texteditor/bookmarkmanager.h b/src/plugins/texteditor/bookmarkmanager.h index 4df91094e3d..c83763d870f 100644 --- a/src/plugins/texteditor/bookmarkmanager.h +++ b/src/plugins/texteditor/bookmarkmanager.h @@ -50,6 +50,9 @@ public: Qt::DropActions supportedDragActions() const final; QStringList mimeTypes() const final; QMimeData *mimeData(const QModelIndexList &indexes) const final; + Qt::DropActions supportedDropActions() const final; + bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const final; + bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) final; // this QItemSelectionModel is shared by all views QItemSelectionModel *selectionModel() const; @@ -69,6 +72,7 @@ public: void prevInDocument(); void next(); void prev(); + void move(Bookmark* mark, int newRow); void moveUp(); void moveDown(); void edit(); From 8169e233c0e333615d9bdf03a2553b0a6017cdcb Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 27 Sep 2023 08:36:40 +0200 Subject: [PATCH 1495/1777] CompilerExplorer: Add Toolbar button to add source Change-Id: I0d8fb50fe1ce5305a93b524a9807997124ab119b Reviewed-by: David Schulz <david.schulz@qt.io> --- .../compilerexplorereditor.cpp | 32 ++++++++++++++----- .../compilerexplorer/compilerexplorereditor.h | 5 ++- .../compilerexplorersettings.cpp | 6 ++++ .../compilerexplorersettings.h | 2 ++ 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 9fe794002cb..3e11f667d6c 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -38,6 +38,7 @@ #include <QStandardItemModel> #include <QTemporaryFile> #include <QTimer> +#include <QToolBar> #include <QToolButton> #include <QUndoStack> @@ -719,17 +720,13 @@ void HelperWidget::mousePressEvent(QMouseEvent *event) event->accept(); } -void EditorWidget::addNewSource() -{ - auto newSource = std::make_shared<SourceSettings>( - [settings = m_document->settings()] { return settings->apiConfig(); }); - m_document->settings()->m_sources.addItem(newSource); -} - QWidget *EditorWidget::createHelpWidget() const { auto w = new HelperWidget; - connect(w, &HelperWidget::addSource, this, &EditorWidget::addNewSource); + connect(w, + &HelperWidget::addSource, + m_document->settings(), + &CompilerExplorerSettings::addNewSource); return w; } @@ -783,6 +780,25 @@ static bool childHasFocus(QWidget *parent) return false; } +QWidget *Editor::toolBar() +{ + if (!m_toolBar) { + m_toolBar = std::make_unique<QToolBar>(); + + QAction *newSource = new QAction(m_toolBar.get()); + newSource->setIcon(Utils::Icons::PLUS_TOOLBAR.icon()); + newSource->setToolTip(Tr::tr("Add source")); + m_toolBar->addAction(newSource); + + connect(newSource, + &QAction::triggered, + m_document->settings(), + &CompilerExplorerSettings::addNewSource); + } + + return m_toolBar.get(); +} + EditorFactory::EditorFactory() : m_actionHandler(Constants::CE_EDITOR_ID, Constants::CE_EDITOR_ID, diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.h b/src/plugins/compilerexplorer/compilerexplorereditor.h index 73b417c3ab1..2db21e4808c 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.h +++ b/src/plugins/compilerexplorer/compilerexplorereditor.h @@ -214,8 +214,6 @@ protected: void setupHelpWidget(); QWidget *createHelpWidget() const; - void addNewSource(); - void addCompiler(const std::shared_ptr<SourceSettings> &sourceSettings, const std::shared_ptr<CompilerSettings> &compilerSettings, int idx, @@ -244,10 +242,11 @@ public: ~Editor(); Core::IDocument *document() const override { return m_document.data(); } - QWidget *toolBar() override { return nullptr; } + QWidget *toolBar() override; QSharedPointer<JsonSettingsDocument> m_document; QUndoStack m_undoStack; + std::unique_ptr<QToolBar> m_toolBar; }; class EditorFactory : public Core::IEditorFactory diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp index 8accdbcc214..94059052d3b 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.cpp +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -337,4 +337,10 @@ CompilerExplorerSettings::CompilerExplorerSettings() CompilerExplorerSettings::~CompilerExplorerSettings() = default; +void CompilerExplorerSettings::addNewSource() +{ + auto newSource = std::make_shared<SourceSettings>([this] { return apiConfig(); }); + m_sources.addItem(newSource); +} + } // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.h b/src/plugins/compilerexplorer/compilerexplorersettings.h index 64f67122fe6..fadb03798f6 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.h +++ b/src/plugins/compilerexplorer/compilerexplorersettings.h @@ -41,6 +41,8 @@ public: return Api::Config(m_networkAccessManager, compilerExplorerUrl()); } + void addNewSource(); + QNetworkAccessManager *networkAccessManager() const { return m_networkAccessManager; } private: From ad13144cc0e2effa7752bfcdbdc4160da9dd825c Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 6 Oct 2023 23:49:27 +0200 Subject: [PATCH 1496/1777] CMakePM: Search after packages in CMAKE_PREFIX|MODULE_PATH This way code completion will have Qt6 package suggestions for find_packages. Change-Id: I9ab64425f850a0d990e77a559ce9f121bc9cf2d7 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakefilecompletionassist.cpp | 79 ++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 1ca5e5f23f7..57867e0974f 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -5,6 +5,8 @@ #include "cmakebuildsystem.h" #include "cmakebuildtarget.h" +#include "cmakebuildconfiguration.h" +#include "cmakeconfigitem.h" #include "cmakeprojectconstants.h" #include "cmaketool.h" #include "cmaketoolmanager.h" @@ -250,6 +252,71 @@ static QPair<QStringList, QStringList> getLocalFunctionsAndVariables(const QByte return {functions, variables}; } +static QPair<QStringList, QStringList> getFindAndConfigCMakePackages(const CMakeConfig &cmakeCache, + const Environment &environment) +{ + auto toFilePath = [](const QByteArray &str) -> FilePath { + return FilePath::fromUserInput(QString::fromUtf8(str)); + }; + + auto findPackageName = [](const QString &fileName) -> QString { + auto findIdx = fileName.indexOf("Find"); + auto endsWithCMakeIdx = fileName.lastIndexOf(".cmake"); + if (findIdx == 0 && endsWithCMakeIdx > 0) + return fileName.mid(4, endsWithCMakeIdx - 4); + return QString(); + }; + + auto configPackageName = [](const QString &fileName) -> QString { + auto configCMakeIdx = fileName.lastIndexOf("Config.cmake"); + if (configCMakeIdx > 0) + return fileName.left(configCMakeIdx); + auto dashConfigCMakeIdx = fileName.lastIndexOf("-config.cmake"); + if (dashConfigCMakeIdx > 0) + return fileName.left(dashConfigCMakeIdx); + return QString(); + }; + + QStringList modulePackages; + QStringList configPackages; + + struct + { + const QByteArray cmakeVariable; + const QString pathPrefix; + std::function<QString(const QString &)> function; + QStringList &result; + } mapping[] = {{"CMAKE_PREFIX_PATH", "lib/cmake", configPackageName, configPackages}, + {"CMAKE_MODULE_PATH", QString(), findPackageName, modulePackages}}; + + for (const auto &m : mapping) { + FilePaths paths = Utils::transform<FilePaths>(cmakeCache.valueOf(m.cmakeVariable).split(';'), + toFilePath); + + paths << Utils::transform<FilePaths>(environment.value(QString::fromUtf8(m.cmakeVariable)) + .split(";"), + &FilePath::fromUserInput); + + for (const auto &prefix : paths) { + // Only search for directories if we have a prefix + const FilePaths dirs = !m.pathPrefix.isEmpty() + ? prefix.pathAppended(m.pathPrefix) + .dirEntries({{"*"}, QDir::Dirs | QDir::NoDotAndDotDot}) + : FilePaths{prefix}; + const QStringList cmakeFiles + = Utils::transform<QStringList>(dirs, [](const FilePath &path) { + return Utils::transform(path.dirEntries({{"*.cmake"}, QDir::Files}, + QDir::Name), + &FilePath::fileName); + }); + m.result << Utils::transform(cmakeFiles, m.function); + } + m.result = Utils::filtered(m.result, std::not_fn(&QString::isEmpty)); + } + + return {modulePackages, configPackages}; +} + class PerformInputData { public: @@ -259,6 +326,8 @@ public: QStringList buildTargets; QStringList importedTargets; QStringList findPackageVariables; + CMakeConfig cmakeConfiguration; + Environment environment = Environment::systemEnvironment(); }; PerformInputData CMakeFileCompletionAssist::generatePerformInputData() const @@ -280,6 +349,8 @@ PerformInputData CMakeFileCompletionAssist::generatePerformInputData() const data.projectFunctions = projectKeywords.functions; data.importedTargets = bs->projectImportedTargets(); data.findPackageVariables = bs->projectFindPackageVariables(); + data.cmakeConfiguration = bs->configurationFromCMake(); + data.environment = bs->cmakeBuildConfiguration()->configureEnvironment(); } return data; @@ -323,6 +394,9 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &da auto [localFunctions, localVariables] = getLocalFunctionsAndVariables( interface()->textAt(0, prevFunctionEnd + 1).toUtf8()); + auto [findModules, configModules] = getFindAndConfigCMakePackages(data.cmakeConfiguration, + data.environment); + QList<AssistProposalItemInterface *> items; const QString varGenexToken = interface()->textAt(startPos - 2, 2); @@ -375,8 +449,11 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &da if (functionName == "include" && !onlyFileItems()) items.append(generateList(data.keywords.includeStandardModules, m_moduleIcon)); - if (functionName == "find_package") + if (functionName == "find_package") { items.append(generateList(data.keywords.findModules, m_moduleIcon)); + items.append(generateList(findModules, m_moduleIcon)); + items.append(generateList(configModules, m_moduleIcon)); + } if ((functionName.contains("target") || functionName == "install" || functionName == "add_dependencies" || functionName == "set_property" From a5f8214c23432d1e68eb0432e70055d85626d0cf Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Sat, 7 Oct 2023 13:17:10 +0200 Subject: [PATCH 1497/1777] CMakePM: Consider local CMAKE_PREFIX|MODULE_PATH for code completion If projects are using a local "cmake" directory containing Find<Package>.cmake modules the common practice is to use something like this: ## Add paths to check for cmake modules: list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") This commit makes sure that these packages are taken into consideration for code completion. Change-Id: I152ccce0c97ab2385eda93ff6bc5fc4e7cefb6c4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakefilecompletionassist.cpp | 80 +++++++++++++++++-- 1 file changed, 74 insertions(+), 6 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 57867e0974f..82598f4993b 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -228,16 +228,20 @@ static int addFilePathItems(const AssistInterface *interface, return startPos; } -static QPair<QStringList, QStringList> getLocalFunctionsAndVariables(const QByteArray &content) +static cmListFile parseCMakeListFromBuffer(const QByteArray &content) { cmListFile cmakeListFile; std::string errorString; if (!content.isEmpty()) { const std::string fileName = "buffer"; if (!cmakeListFile.ParseString(content.toStdString(), fileName, errorString)) - return {{}, {}}; + return {}; } + return cmakeListFile; +} +static QPair<QStringList, QStringList> getLocalFunctionsAndVariables(const cmListFile &cmakeListFile) +{ QStringList variables; QStringList functions; for (const auto &func : cmakeListFile.Functions) { @@ -252,8 +256,67 @@ static QPair<QStringList, QStringList> getLocalFunctionsAndVariables(const QByte return {functions, variables}; } -static QPair<QStringList, QStringList> getFindAndConfigCMakePackages(const CMakeConfig &cmakeCache, - const Environment &environment) +static void updateCMakeConfigurationWithLocalData(CMakeConfig &cmakeCache, + const cmListFile &cmakeListFile, + const FilePath ¤tDir) +{ + auto isValidCMakeVariable = [](const std::string &var) { + return var == "CMAKE_PREFIX_PATH" || var == "CMAKE_MODULE_PATH"; + }; + + const FilePath projectDir = ProjectTree::currentBuildSystem()->projectDirectory(); + auto updateDirVariables = [currentDir, projectDir, cmakeCache](QByteArray &value) { + value.replace("${CMAKE_CURRENT_SOURCE_DIR}", currentDir.path().toUtf8()); + value.replace("${CMAKE_CURRENT_LIST_DIR}", currentDir.path().toUtf8()); + value.replace("${CMAKE_SOURCE_DIR}", projectDir.path().toUtf8()); + value.replace("${CMAKE_PREFIX_PATH}", cmakeCache.valueOf("CMAKE_PREFIX_PATH")); + value.replace("${CMAKE_MODULE_PATH}", cmakeCache.valueOf("CMAKE_MODULE_PATH")); + }; + + auto insertOrAppendListValue = [&cmakeCache](const QByteArray &key, const QByteArray &value) { + auto it = std::find_if(cmakeCache.begin(), cmakeCache.end(), [key](const auto &item) { + return item.key == key; + }); + if (it == cmakeCache.end()) { + cmakeCache << CMakeConfigItem(key, value); + } else { + it->value.append(";"); + it->value.append(value); + } + }; + + for (const auto &func : cmakeListFile.Functions) { + const bool isSet = func.LowerCaseName() == "set" && func.Arguments().size() > 1; + const bool isList = func.LowerCaseName() == "list" && func.Arguments().size() > 2; + if (!isSet && !isList) + continue; + + QByteArray key; + QByteArray value; + if (isSet) { + const auto firstArg = func.Arguments()[0]; + const auto secondArg = func.Arguments()[1]; + if (!isValidCMakeVariable(firstArg.Value)) + continue; + key = QByteArray::fromStdString(firstArg.Value); + value = QByteArray::fromStdString(secondArg.Value); + } + if (isList) { + const auto firstArg = func.Arguments()[0]; + const auto secondArg = func.Arguments()[1]; + const auto thirdArg = func.Arguments()[2]; + if (firstArg.Value != "APPEND" || !isValidCMakeVariable(secondArg.Value)) + continue; + key = QByteArray::fromStdString(secondArg.Value); + value = QByteArray::fromStdString(thirdArg.Value); + } + updateDirVariables(value); + insertOrAppendListValue(key, value); + } +} + +static QPair<QStringList, QStringList> getFindAndConfigCMakePackages( + const CMakeConfig &cmakeCache, const Environment &environment) { auto toFilePath = [](const QByteArray &str) -> FilePath { return FilePath::fromUserInput(QString::fromUtf8(str)); @@ -391,10 +454,15 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &da } } - auto [localFunctions, localVariables] = getLocalFunctionsAndVariables( + cmListFile cmakeListFile = parseCMakeListFromBuffer( interface()->textAt(0, prevFunctionEnd + 1).toUtf8()); + auto [localFunctions, localVariables] = getLocalFunctionsAndVariables(cmakeListFile); - auto [findModules, configModules] = getFindAndConfigCMakePackages(data.cmakeConfiguration, + CMakeConfig cmakeConfiguration = data.cmakeConfiguration; + const FilePath currentDir = interface()->filePath().absolutePath(); + updateCMakeConfigurationWithLocalData(cmakeConfiguration, cmakeListFile, currentDir); + + auto [findModules, configModules] = getFindAndConfigCMakePackages(cmakeConfiguration, data.environment); QList<AssistProposalItemInterface *> items; From 6010b096c1d36ffa6fd28fdf711a8d1f0a629940 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Sun, 8 Oct 2023 11:29:37 +0200 Subject: [PATCH 1498/1777] CMakePM: Move specific manual tests to cmakeprojectmanager Previously this folder didn't exist, but now it's better to have them all in one place. Change-Id: Ib8a2f24157a34e817e653929d01dfc9675f1c019 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../manual/{ => cmakeprojectmanager}/cmakepresets/CMakeLists.txt | 0 .../{ => cmakeprojectmanager}/cmakepresets/CMakePresets.json | 0 tests/manual/{ => cmakeprojectmanager}/cmakepresets/main.cpp | 0 .../manual/{ => cmakeprojectmanager}/cmakepresets/mainwindow.cpp | 0 tests/manual/{ => cmakeprojectmanager}/cmakepresets/mainwindow.h | 0 tests/manual/{ => cmakeprojectmanager}/cmakepresets/mainwindow.ui | 0 tests/manual/{ => cmakeprojectmanager}/cmakepresets/mingw.json | 0 .../{ => cmakeprojectmanager}/cmakepresets/msvc-toolchain.cmake | 0 tests/manual/{ => cmakeprojectmanager}/cmakepresets/msvc.json | 0 tests/manual/{ => cmakeprojectmanager}/conan/CMakeLists.txt | 0 tests/manual/{ => cmakeprojectmanager}/conan/conanfile.txt | 0 tests/manual/{ => cmakeprojectmanager}/conan/main.cpp | 0 tests/manual/{ => cmakeprojectmanager}/vcpkg/CMakeLists.txt | 0 tests/manual/{ => cmakeprojectmanager}/vcpkg/README.md | 0 tests/manual/{ => cmakeprojectmanager}/vcpkg/main.cpp | 0 tests/manual/{ => cmakeprojectmanager}/vcpkg/vcpkg.json | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename tests/manual/{ => cmakeprojectmanager}/cmakepresets/CMakeLists.txt (100%) rename tests/manual/{ => cmakeprojectmanager}/cmakepresets/CMakePresets.json (100%) rename tests/manual/{ => cmakeprojectmanager}/cmakepresets/main.cpp (100%) rename tests/manual/{ => cmakeprojectmanager}/cmakepresets/mainwindow.cpp (100%) rename tests/manual/{ => cmakeprojectmanager}/cmakepresets/mainwindow.h (100%) rename tests/manual/{ => cmakeprojectmanager}/cmakepresets/mainwindow.ui (100%) rename tests/manual/{ => cmakeprojectmanager}/cmakepresets/mingw.json (100%) rename tests/manual/{ => cmakeprojectmanager}/cmakepresets/msvc-toolchain.cmake (100%) rename tests/manual/{ => cmakeprojectmanager}/cmakepresets/msvc.json (100%) rename tests/manual/{ => cmakeprojectmanager}/conan/CMakeLists.txt (100%) rename tests/manual/{ => cmakeprojectmanager}/conan/conanfile.txt (100%) rename tests/manual/{ => cmakeprojectmanager}/conan/main.cpp (100%) rename tests/manual/{ => cmakeprojectmanager}/vcpkg/CMakeLists.txt (100%) rename tests/manual/{ => cmakeprojectmanager}/vcpkg/README.md (100%) rename tests/manual/{ => cmakeprojectmanager}/vcpkg/main.cpp (100%) rename tests/manual/{ => cmakeprojectmanager}/vcpkg/vcpkg.json (100%) diff --git a/tests/manual/cmakepresets/CMakeLists.txt b/tests/manual/cmakeprojectmanager/cmakepresets/CMakeLists.txt similarity index 100% rename from tests/manual/cmakepresets/CMakeLists.txt rename to tests/manual/cmakeprojectmanager/cmakepresets/CMakeLists.txt diff --git a/tests/manual/cmakepresets/CMakePresets.json b/tests/manual/cmakeprojectmanager/cmakepresets/CMakePresets.json similarity index 100% rename from tests/manual/cmakepresets/CMakePresets.json rename to tests/manual/cmakeprojectmanager/cmakepresets/CMakePresets.json diff --git a/tests/manual/cmakepresets/main.cpp b/tests/manual/cmakeprojectmanager/cmakepresets/main.cpp similarity index 100% rename from tests/manual/cmakepresets/main.cpp rename to tests/manual/cmakeprojectmanager/cmakepresets/main.cpp diff --git a/tests/manual/cmakepresets/mainwindow.cpp b/tests/manual/cmakeprojectmanager/cmakepresets/mainwindow.cpp similarity index 100% rename from tests/manual/cmakepresets/mainwindow.cpp rename to tests/manual/cmakeprojectmanager/cmakepresets/mainwindow.cpp diff --git a/tests/manual/cmakepresets/mainwindow.h b/tests/manual/cmakeprojectmanager/cmakepresets/mainwindow.h similarity index 100% rename from tests/manual/cmakepresets/mainwindow.h rename to tests/manual/cmakeprojectmanager/cmakepresets/mainwindow.h diff --git a/tests/manual/cmakepresets/mainwindow.ui b/tests/manual/cmakeprojectmanager/cmakepresets/mainwindow.ui similarity index 100% rename from tests/manual/cmakepresets/mainwindow.ui rename to tests/manual/cmakeprojectmanager/cmakepresets/mainwindow.ui diff --git a/tests/manual/cmakepresets/mingw.json b/tests/manual/cmakeprojectmanager/cmakepresets/mingw.json similarity index 100% rename from tests/manual/cmakepresets/mingw.json rename to tests/manual/cmakeprojectmanager/cmakepresets/mingw.json diff --git a/tests/manual/cmakepresets/msvc-toolchain.cmake b/tests/manual/cmakeprojectmanager/cmakepresets/msvc-toolchain.cmake similarity index 100% rename from tests/manual/cmakepresets/msvc-toolchain.cmake rename to tests/manual/cmakeprojectmanager/cmakepresets/msvc-toolchain.cmake diff --git a/tests/manual/cmakepresets/msvc.json b/tests/manual/cmakeprojectmanager/cmakepresets/msvc.json similarity index 100% rename from tests/manual/cmakepresets/msvc.json rename to tests/manual/cmakeprojectmanager/cmakepresets/msvc.json diff --git a/tests/manual/conan/CMakeLists.txt b/tests/manual/cmakeprojectmanager/conan/CMakeLists.txt similarity index 100% rename from tests/manual/conan/CMakeLists.txt rename to tests/manual/cmakeprojectmanager/conan/CMakeLists.txt diff --git a/tests/manual/conan/conanfile.txt b/tests/manual/cmakeprojectmanager/conan/conanfile.txt similarity index 100% rename from tests/manual/conan/conanfile.txt rename to tests/manual/cmakeprojectmanager/conan/conanfile.txt diff --git a/tests/manual/conan/main.cpp b/tests/manual/cmakeprojectmanager/conan/main.cpp similarity index 100% rename from tests/manual/conan/main.cpp rename to tests/manual/cmakeprojectmanager/conan/main.cpp diff --git a/tests/manual/vcpkg/CMakeLists.txt b/tests/manual/cmakeprojectmanager/vcpkg/CMakeLists.txt similarity index 100% rename from tests/manual/vcpkg/CMakeLists.txt rename to tests/manual/cmakeprojectmanager/vcpkg/CMakeLists.txt diff --git a/tests/manual/vcpkg/README.md b/tests/manual/cmakeprojectmanager/vcpkg/README.md similarity index 100% rename from tests/manual/vcpkg/README.md rename to tests/manual/cmakeprojectmanager/vcpkg/README.md diff --git a/tests/manual/vcpkg/main.cpp b/tests/manual/cmakeprojectmanager/vcpkg/main.cpp similarity index 100% rename from tests/manual/vcpkg/main.cpp rename to tests/manual/cmakeprojectmanager/vcpkg/main.cpp diff --git a/tests/manual/vcpkg/vcpkg.json b/tests/manual/cmakeprojectmanager/vcpkg/vcpkg.json similarity index 100% rename from tests/manual/vcpkg/vcpkg.json rename to tests/manual/cmakeprojectmanager/vcpkg/vcpkg.json From 380ca70d6111e7dec9a3709ebad31854073810c1 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 9 Oct 2023 16:12:47 +0200 Subject: [PATCH 1499/1777] CMakePM: Add manual test for code completion / navigation Change-Id: Id7ad47babf4c6fff8e7b823805d6ccf858a3d513 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/completion/.gitignore | 74 +++++++++++++++++ .../completion/CMakeLists.txt | 79 +++++++++++++++++++ .../cmakeprojectmanager/completion/README.md | 1 + .../completion/cmake/Findstdvector.cmake | 61 ++++++++++++++ .../cmakeprojectmanager/completion/main.cpp | 14 ++++ .../completion/mainwindow.cpp | 17 ++++ .../completion/mainwindow.h | 25 ++++++ .../completion/mainwindow.ui | 24 ++++++ 8 files changed, 295 insertions(+) create mode 100644 tests/manual/cmakeprojectmanager/completion/.gitignore create mode 100644 tests/manual/cmakeprojectmanager/completion/CMakeLists.txt create mode 100644 tests/manual/cmakeprojectmanager/completion/README.md create mode 100644 tests/manual/cmakeprojectmanager/completion/cmake/Findstdvector.cmake create mode 100644 tests/manual/cmakeprojectmanager/completion/main.cpp create mode 100644 tests/manual/cmakeprojectmanager/completion/mainwindow.cpp create mode 100644 tests/manual/cmakeprojectmanager/completion/mainwindow.h create mode 100644 tests/manual/cmakeprojectmanager/completion/mainwindow.ui diff --git a/tests/manual/cmakeprojectmanager/completion/.gitignore b/tests/manual/cmakeprojectmanager/completion/.gitignore new file mode 100644 index 00000000000..4a0b530afd2 --- /dev/null +++ b/tests/manual/cmakeprojectmanager/completion/.gitignore @@ -0,0 +1,74 @@ +# This file is used to ignore files which are generated +# ---------------------------------------------------------------------------- + +*~ +*.autosave +*.a +*.core +*.moc +*.o +*.obj +*.orig +*.rej +*.so +*.so.* +*_pch.h.cpp +*_resource.rc +*.qm +.#* +*.*# +core +!core/ +tags +.DS_Store +.directory +*.debug +Makefile* +*.prl +*.app +moc_*.cpp +ui_*.h +qrc_*.cpp +Thumbs.db +*.res +*.rc +/.qmake.cache +/.qmake.stash + +# qtcreator generated files +*.pro.user* +CMakeLists.txt.user* + +# xemacs temporary files +*.flc + +# Vim temporary files +.*.swp + +# Visual Studio generated files +*.ib_pdb_index +*.idb +*.ilk +*.pdb +*.sln +*.suo +*.vcproj +*vcproj.*.*.user +*.ncb +*.sdf +*.opensdf +*.vcxproj +*vcxproj.* + +# MinGW generated files +*.Debug +*.Release + +# Python byte code +*.pyc + +# Binaries +# -------- +*.dll +*.exe + diff --git a/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt b/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt new file mode 100644 index 00000000000..785fea0408f --- /dev/null +++ b/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt @@ -0,0 +1,79 @@ +# Only parameters for the function should be mentioned, +# In the case for cmake_minimum_required should be +# VERSION and FATAL_ERROR +cmake_minimum_required(VERSION 3.15) + +# Mouse hover over "project" should display a help popup +project(completion LANGUAGES CXX) + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") + +# F2 on the URL should open the url in the web browser +# https://doc.qt.io/qt-6/cmake-get-started.html + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# here code completion for "find_package(Qt|" should popup +# Qt, Qt3, Qt4 and Qt6 +#find_package(Qt + +find_package(Qt6 REQUIRED COMPONENTS Widgets) + +# here code completion "find_package(std|" should popup stdvector +#find_package(std + +qt_standard_project_setup() + +set(SOURCE_FILES + mainwindow.ui + mainwindow.cpp mainwindow.h + main.cpp + + # here code completion for "main|" should popup the source files + #main +) + +# here code completion for "if (SOU|" should popup SOURCE_FILES +#if (SOU + +if (SOURCE_FILES) + # here code completion for "print_v|" should popup "print_variables" + #print_v + + # here code completion for "include(CMakePrint|" should popup "CMakePrintHelpers" + #include(CMakePrint + + # + # F2 on CMakePrintHelpers would open the CMake module + # on cmake_print_variables would open the cursor at the function + # on SOURCE_FILES would jump above to the set(SOURCE_FILES + # + include(CMakePrintHelpers) + cmake_print_variables(SOURCE_FILES) +endif() + + +qt_add_executable(completion ${SOURCE_FILES}) + +# here code completino on "target_link_libraries(comp|" should poupup "completion" +# with a hammer icon, which suggests a project target +#target_link_libraries(comp + +# here code completion after "target_link_libraries(completion PRIVATE Qt6::Wid|" +# should complete with "Qt6::Widgets" having a grayish hammer icon + +#target_link_libraries(completion PRIVATE Qt6::Wid + + +# F2 on "completion" would jump above to qt_add_executable +target_link_libraries(completion PRIVATE Qt6::Widgets) + +set_target_properties(completion PROPERTIES + # F1 on WIN32_EXECUTABLE should open the help + WIN32_EXECUTABLE ON + MACOSX_BUNDLE ON + + # here completion for "WIN32|" should popup WIN32_EXECUTABLE + #WIN32 +) diff --git a/tests/manual/cmakeprojectmanager/completion/README.md b/tests/manual/cmakeprojectmanager/completion/README.md new file mode 100644 index 00000000000..7d96bd3f17a --- /dev/null +++ b/tests/manual/cmakeprojectmanager/completion/README.md @@ -0,0 +1 @@ +Qt6 project to test code completion and navigation in CMakeLists.txt diff --git a/tests/manual/cmakeprojectmanager/completion/cmake/Findstdvector.cmake b/tests/manual/cmakeprojectmanager/completion/cmake/Findstdvector.cmake new file mode 100644 index 00000000000..7409b65b0fd --- /dev/null +++ b/tests/manual/cmakeprojectmanager/completion/cmake/Findstdvector.cmake @@ -0,0 +1,61 @@ +# https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#a-sample-find-module + +#[=======================================================================[.rst: +Findstdvector +------- + +Finds the stdvector library. + +Imported Targets +^^^^^^^^^^^^^^^^ + +This module provides the following imported targets, if found: + +``stdvector::stdvector`` +The stdvector library + +Result Variables +^^^^^^^^^^^^^^^^ + +This will define the following variables: + +``stdvector_FOUND`` +True if the system has the stdvector library. +``stdvector_INCLUDE_DIRS`` +Include directories needed to use stdvector. + +Cache Variables +^^^^^^^^^^^^^^^ + +The following cache variables may also be set: + +``stdvector_INCLUDE_DIR`` +The directory containing ``vector``. + +#]=======================================================================] + +find_path(stdvector_INCLUDE_DIR + NAMES vector +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(stdvector + FOUND_VAR stdvector_FOUND + REQUIRED_VARS + stdvector_INCLUDE_DIR +) + +if(stdvector_FOUND) + set(stdvector_INCLUDE_DIRS ${stdvector_INCLUDE_DIR}) +endif() + +if(stdvector_FOUND AND NOT TARGET stdvector::stdvector) + add_library(stdvector::stdvector UNKNOWN IMPORTED) + set_target_properties(stdvector::stdvector PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${stdvector_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced( + stdvector_INCLUDE_DIR +) diff --git a/tests/manual/cmakeprojectmanager/completion/main.cpp b/tests/manual/cmakeprojectmanager/completion/main.cpp new file mode 100644 index 00000000000..b368a389e34 --- /dev/null +++ b/tests/manual/cmakeprojectmanager/completion/main.cpp @@ -0,0 +1,14 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include "mainwindow.h" + +#include <QApplication> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/tests/manual/cmakeprojectmanager/completion/mainwindow.cpp b/tests/manual/cmakeprojectmanager/completion/mainwindow.cpp new file mode 100644 index 00000000000..5e056ab090f --- /dev/null +++ b/tests/manual/cmakeprojectmanager/completion/mainwindow.cpp @@ -0,0 +1,17 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} diff --git a/tests/manual/cmakeprojectmanager/completion/mainwindow.h b/tests/manual/cmakeprojectmanager/completion/mainwindow.h new file mode 100644 index 00000000000..f877d77cd1b --- /dev/null +++ b/tests/manual/cmakeprojectmanager/completion/mainwindow.h @@ -0,0 +1,25 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include <QMainWindow> + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + +private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/tests/manual/cmakeprojectmanager/completion/mainwindow.ui b/tests/manual/cmakeprojectmanager/completion/mainwindow.ui new file mode 100644 index 00000000000..0e5f87509e6 --- /dev/null +++ b/tests/manual/cmakeprojectmanager/completion/mainwindow.ui @@ -0,0 +1,24 @@ +<ui version="4.0"> + <author/> + <comment/> + <exportmacro/> + <class>MainWindow</class> + <widget class="QMainWindow" name="MainWindow"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>600</height> + </rect> + </property> + <property name="windowTitle"> + <string>MainWindow</string> + </property> + <widget class="QMenuBar" name="menubar"/> + <widget class="QWidget" name="centralwidget"/> + <widget class="QStatusBar" name="statusbar"/> + </widget> + <pixmapfunction/> + <connections/> +</ui> From 6620add7dfacacde0c49491265968e3a0001001f Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 6 Oct 2023 17:29:17 +0200 Subject: [PATCH 1500/1777] Debugger: Use device env of gdb for its own use Fixes: QTCREATORBUG-29556 Change-Id: I966d4f226c4eee08ba35e1b3dfc6fcd1d771ce6f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/debugger/debuggerkitaspect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggerkitaspect.cpp b/src/plugins/debugger/debuggerkitaspect.cpp index 36fac323035..b881e90332d 100644 --- a/src/plugins/debugger/debuggerkitaspect.cpp +++ b/src/plugins/debugger/debuggerkitaspect.cpp @@ -188,7 +188,7 @@ ProcessRunData DebuggerKitAspect::runnable(const Kit *kit) } runnable.command.setExecutable(cmd); runnable.workingDirectory = item->workingDirectory(); - runnable.environment = kit->runEnvironment(); + runnable.environment = cmd.deviceEnvironment(); runnable.environment.set("LC_NUMERIC", "C"); } return runnable; From e607c5530ea3ff7b15b5b99d0b1c7624858b4e30 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 9 Oct 2023 13:54:26 +0200 Subject: [PATCH 1501/1777] Wizards: Fix "pragma once" check Obviously, boolean functions return a string that you need to compare to "true" and "false" explicitly. Amends 8e75381fce29504cd3f278f90cfcda22b9e47b4d. Fixes: QTCREATORBUG-29713 Change-Id: I19966555badd67f95f51ea1c1757d8b86e727010 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- share/qtcreator/templates/wizards/classes/cpp/file.h | 4 ++-- .../qtcreator/templates/wizards/classes/itemmodel/itemmodel.h | 4 ++-- .../qtcreator/templates/wizards/classes/itemmodel/listmodel.h | 4 ++-- .../templates/wizards/classes/itemmodel/tablemodel.h | 4 ++-- share/qtcreator/templates/wizards/files/cppheader/file.h | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/share/qtcreator/templates/wizards/classes/cpp/file.h b/share/qtcreator/templates/wizards/classes/cpp/file.h index aa5e50913ad..6c12d054de7 100644 --- a/share/qtcreator/templates/wizards/classes/cpp/file.h +++ b/share/qtcreator/templates/wizards/classes/cpp/file.h @@ -1,5 +1,5 @@ %{JS: Cpp.licenseTemplate()}\ -@if '%{JS: Cpp.usePragmaOnce()}' +@if '%{JS: Cpp.usePragmaOnce()}' === 'true' #pragma once @else #ifndef %{GUARD} @@ -65,6 +65,6 @@ private: @endif }; %{JS: Cpp.closeNamespaces('%{Class}')} -@if ! '%{JS: Cpp.usePragmaOnce()}' +@if '%{JS: Cpp.usePragmaOnce()}' === 'false' #endif // %{GUARD} @endif diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.h b/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.h index 1ca540277d4..a9b104c03e7 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.h +++ b/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.h @@ -1,5 +1,5 @@ %{JS: Cpp.licenseTemplate()}\ -@if '%{JS: Cpp.usePragmaOnce()}' +@if '%{JS: Cpp.usePragmaOnce()}' === 'true' #pragma once @else #ifndef %{GUARD} @@ -66,6 +66,6 @@ public: private: }; %{JS: Cpp.closeNamespaces('%{Class}')} -@if ! '%{JS: Cpp.usePragmaOnce()}' +@if '%{JS: Cpp.usePragmaOnce()}' === 'false' #endif // %{GUARD} @endif diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h index 7b756f99baf..339c582563b 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h +++ b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h @@ -1,5 +1,5 @@ %{JS: Cpp.licenseTemplate()}\ -@if '%{JS: Cpp.usePragmaOnce()}' +@if '%{JS: Cpp.usePragmaOnce()}' === 'true' #pragma once @else #ifndef %{GUARD} @@ -59,6 +59,6 @@ public: private: }; %{JS: Cpp.closeNamespaces('%{Class}')} -@if ! '%{JS: Cpp.usePragmaOnce()}' +@if '%{JS: Cpp.usePragmaOnce()}' === 'false' #endif // %{GUARD} @endif diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h index cfc07fb5acc..2be8f5ddcb8 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h +++ b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h @@ -1,5 +1,5 @@ %{JS: Cpp.licenseTemplate()}\ -@if '%{JS: Cpp.usePragmaOnce()}' +@if '%{JS: Cpp.usePragmaOnce()}' == 'true' #pragma once @else #ifndef %{GUARD} @@ -62,6 +62,6 @@ public: private: }; %{JS: Cpp.closeNamespaces('%{Class}')} -@if ! '%{JS: Cpp.usePragmaOnce()}' +@if '%{JS: Cpp.usePragmaOnce()}' === 'false' #endif // %{GUARD} @endif diff --git a/share/qtcreator/templates/wizards/files/cppheader/file.h b/share/qtcreator/templates/wizards/files/cppheader/file.h index d7432eb5234..f92c0d7d75f 100644 --- a/share/qtcreator/templates/wizards/files/cppheader/file.h +++ b/share/qtcreator/templates/wizards/files/cppheader/file.h @@ -1,5 +1,5 @@ %{JS: Cpp.licenseTemplate()}\ -@if '%{JS: Cpp.usePragmaOnce()}' +@if '%{JS: Cpp.usePragmaOnce()}' === 'true' #pragma once @else #ifndef %{JS: Cpp.headerGuard('%{FileName}')} From 01dc62b0196765aa36f841c531c1492fa45712d9 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 29 Sep 2023 07:42:36 +0200 Subject: [PATCH 1502/1777] Editor: Fix loading color schemes When the user switched to another builtin color scheme the full paths check do not match anymore if the user starts a Qt Creator with a different install dir. Change-Id: I4692c85a23a7d524497786db4dd8e1a00bb7a9fe Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/texteditor/fontsettingspage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index 654a3a19b20..bdd899b7e04 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -700,7 +700,7 @@ void FontSettingsPageWidget::refreshColorSchemeList() int selected = 0; for (const FilePath &file : std::as_const(schemeList)) { - if (m_value.colorSchemeFileName() == file) + if (m_value.colorSchemeFileName().fileName() == file.fileName()) selected = colorSchemes.size(); colorSchemes.append(ColorSchemeEntry(file, true)); } @@ -710,7 +710,7 @@ void FontSettingsPageWidget::refreshColorSchemeList() const FilePaths files = customStylesPath().dirEntries(FileFilter({"*.xml"}, QDir::Files)); for (const FilePath &file : files) { - if (m_value.colorSchemeFileName() == file) + if (m_value.colorSchemeFileName().fileName() == file.fileName()) selected = colorSchemes.size(); colorSchemes.append(ColorSchemeEntry(file, false)); } From 6c9a7100369fb3f29f5149e549a97a8f7128f3ad Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 10 Oct 2023 08:14:10 +0200 Subject: [PATCH 1503/1777] Utils: remove Q_ASSERT in comment detection Change-Id: I076397ee56887c8b402d4c2b97838ceade165412 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/uncommentselection.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/libs/utils/uncommentselection.cpp b/src/libs/utils/uncommentselection.cpp index 5f9217a08cc..d2feb494e77 100644 --- a/src/libs/utils/uncommentselection.cpp +++ b/src/libs/utils/uncommentselection.cpp @@ -10,8 +10,6 @@ #include <QTextCursor> #include <QTextDocument> -#include <limits> - namespace Utils { CommentDefinition CommentDefinition::CppStyle = CommentDefinition("//", "/*", "*/"); @@ -42,23 +40,11 @@ bool CommentDefinition::hasMultiLineStyle() const return !multiLineStart.isEmpty() && !multiLineEnd.isEmpty(); } -static bool isComment(const QString &text, int index, - const QString &commentType) +static bool isComment(const QString &text, int index, const QString &commentType) { - const int length = commentType.length(); - - Q_ASSERT(text.length() - index >= length); - - int i = 0; - while (i < length) { - if (text.at(index + i) != commentType.at(i)) - return false; - ++i; - } - return true; + return QStringView(text).mid(index).startsWith(commentType); } - QTextCursor unCommentSelection(const QTextCursor &cursorIn, const CommentDefinition &definition, bool preferSingleLine) From 45fb2c09860b00e3b4fc5a00a4602668dc682e3a Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 9 Oct 2023 15:01:51 +0200 Subject: [PATCH 1504/1777] CMakePM: Remove pointer check for null The pointer contains the parent class passed with "this" and will never be null. Coverity-Id: 1568097 Dereference after null check (FORWARD_NULL) Coverity-Id: 1568100 Uninitialized pointer field (UNINIT_CTOR) Coverity-Id: 1568111 Dereference before null check (REVERSE_INULL) Change-Id: I40e32d162689c749d498c4a63c073c0e336a3626 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 07d182b5ced..40562776967 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -171,8 +171,6 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) m_configFilterModel(new CategorySortFilterModel(this)), m_configTextFilterModel(new CategorySortFilterModel(this)) { - QTC_ASSERT(m_buildConfig, return); - m_configureDetailsWidget = new DetailsWidget; updateConfigureDetailsWidgetsSummary(); @@ -682,7 +680,7 @@ void CMakeBuildSettingsWidget::updateConfigureDetailsWidgetsSummary( const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildConfig->kit()); cmd.setExecutable(tool ? tool->cmakeExecutable() : "cmake"); - const FilePath buildDirectory = m_buildConfig ? m_buildConfig->buildDirectory() : "."; + const FilePath buildDirectory = m_buildConfig->buildDirectory(); cmd.addArgs({"-S", m_buildConfig->project()->projectDirectory().path()}); cmd.addArgs({"-B", buildDirectory.path()}); From c9cf86856c325a9424d5d8af9e343cdd82f434b0 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 10 Oct 2023 09:14:08 +0200 Subject: [PATCH 1505/1777] Terminal: Add support for Windows Terminal schemes Change-Id: Ic6911bdcd2152a5fec8be54a515c5df13c3c08d7 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/terminal/terminalsettings.cpp | 75 ++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index ea7d48762fe..c098ff0ed81 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -174,6 +174,72 @@ static expected_str<void> loadItermColors(const FilePath &path) return {}; } +static expected_str<void> loadWindowsTerminalColors(const FilePath &path) +{ + const expected_str<QByteArray> readResult = path.fileContents(); + if (!readResult) + return make_unexpected(readResult.error()); + + QJsonParseError error; + QJsonDocument doc = QJsonDocument::fromJson(*readResult, &error); + if (error.error != QJsonParseError::NoError) + return make_unexpected(Tr::tr("JSON parsing error: \"%1\", at offset: %2") + .arg(error.errorString()) + .arg(error.offset)); + + const QJsonObject colors = doc.object(); + + // clang-format off + const QList<QPair<QStringView, ColorAspect *>> colorKeys = { + qMakePair(u"background", &settings().backgroundColor), + qMakePair(u"foreground", &settings().foregroundColor), + qMakePair(u"selectionBackground", &settings().selectionColor), + + qMakePair(u"black", &settings().colors[0]), + qMakePair(u"brightBlack", &settings().colors[8]), + + qMakePair(u"red", &settings().colors[1]), + qMakePair(u"brightRed", &settings().colors[9]), + + qMakePair(u"green", &settings().colors[2]), + qMakePair(u"brightGreen", &settings().colors[10]), + + qMakePair(u"yellow", &settings().colors[3]), + qMakePair(u"brightYellow", &settings().colors[11]), + + qMakePair(u"blue", &settings().colors[4]), + qMakePair(u"brightBlue", &settings().colors[12]), + + qMakePair(u"magenta", &settings().colors[5]), + qMakePair(u"brightMagenta", &settings().colors[13]), + + qMakePair(u"cyan", &settings().colors[6]), + qMakePair(u"brightCyan", &settings().colors[14]), + + qMakePair(u"white", &settings().colors[7]), + qMakePair(u"brightWhite", &settings().colors[15]) + }; + // clang-format on + + for (const auto &pair : colorKeys) { + const auto it = colors.find(pair.first); + if (it != colors.end()) { + const QString colorString = it->toString(); + if (colorString.startsWith("#")) { + QColor color(colorString.mid(0, 7)); + if (colorString.size() > 7) { + int alpha = colorString.mid(7).toInt(nullptr, 16); + color.setAlpha(alpha); + } + if (color.isValid()) + pair.second->setVolatileValue(color); + } + } + } + + return {}; +} + static expected_str<void> loadVsCodeColors(const FilePath &path) { const expected_str<QByteArray> readResult = path.fileContents(); @@ -336,6 +402,12 @@ static expected_str<void> loadXFCE4ColorScheme(const FilePath &path) return {}; } +static expected_str<void> loadVsCodeOrWindows(const FilePath &path) +{ + return loadVsCodeColors(path).or_else( + [path](const auto &) { return loadWindowsTerminalColors(path); }); +} + static expected_str<void> loadColorScheme(const FilePath &path) { if (path.endsWith("Xdefaults")) @@ -343,7 +415,7 @@ static expected_str<void> loadColorScheme(const FilePath &path) else if (path.suffix() == "itermcolors") return loadItermColors(path); else if (path.suffix() == "json") - return loadVsCodeColors(path); + return loadVsCodeOrWindows(path); else if (path.suffix() == "colorscheme") return loadKonsoleColorScheme(path); else if (path.suffix() == "theme" || path.completeSuffix() == "theme.txt") @@ -491,6 +563,7 @@ TerminalSettings::TerminalSettings() "Xdefaults (.Xdefaults Xdefaults);;" "iTerm Color Schemes(*.itermcolors);;" "VS Code Color Schemes(*.json);;" + "Windows Terminal Schemes(*.json);;" "Konsole Color Schemes(*.colorscheme);;" "XFCE4 Terminal Color Schemes(*.theme *.theme.txt);;" "All files (*)", From f1c3482e0d06f5e18480d25f2ac36f4b410f0b51 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 10 Oct 2023 09:45:10 +0200 Subject: [PATCH 1506/1777] CMake: Fix default cmake tool If Boot2Qt devices are registered, their CMake tool would often end up as the default. Instead now we only auto select a cmake tool on the local machine. Change-Id: I677ab06ae88ff36209e691ea0fadb356436e973c Reviewed-by: hjk <hjk@qt.io> --- src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index 3cb04046204..19d7d5f2c12 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -426,8 +426,9 @@ void CMakeToolManager::ensureDefaultCMakeToolIsValid() } else { if (findById(d->m_defaultCMake)) return; - auto cmakeTool = Utils::findOrDefault( - cmakeTools(), [](CMakeTool *tool){ return tool->detectionSource().isEmpty(); }); + auto cmakeTool = Utils::findOrDefault(cmakeTools(), [](CMakeTool *tool) { + return tool->detectionSource().isEmpty() && !tool->cmakeExecutable().needsDevice(); + }); if (cmakeTool) d->m_defaultCMake = cmakeTool->id(); } From 8ca689081430dfa2ca3c385768d732d17ce5d54b Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 9 Oct 2023 10:55:56 +0200 Subject: [PATCH 1507/1777] QmlDesigner: Quiet messages from find_package The information is available via the CONDITION and FEATURE_INFO Change-Id: I0da6338736316e5976c1addad6c25d083e7d772d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> --- src/plugins/qmldesigner/CMakeLists.txt | 2 +- tests/unit/tests/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index a2f0dba38ea..5110d8b7de5 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -1,7 +1,7 @@ #only if the plugin is requested by qtc_plugin_enabled continue if not stop as early as possible -find_package(Qt6 COMPONENTS QmlDomPrivate QmlCompilerPrivate) +find_package(Qt6 COMPONENTS QmlDomPrivate QmlCompilerPrivate QUIET) set(QmlDesignerPluginInstallPrefix "${IDE_PLUGIN_PATH}/qmldesigner") if (APPLE) diff --git a/tests/unit/tests/CMakeLists.txt b/tests/unit/tests/CMakeLists.txt index fe1f0c84b32..bd7ec6ce3d6 100644 --- a/tests/unit/tests/CMakeLists.txt +++ b/tests/unit/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(Qt6 COMPONENTS QmlDomPrivate QmlCompilerPrivate) +find_package(Qt6 COMPONENTS QmlDomPrivate QmlCompilerPrivate QUIET) if (MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") From c90a6df6efcdb35c8a6e4617043a9532601c5bfa Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 10 Oct 2023 10:29:11 +0200 Subject: [PATCH 1508/1777] Revert "Utils: Fix BoolAspect::action" This reverts commit 4c5e3aa6bae2ee209f4c42e55ec36375a568409b. Not needed anymore. The action likely ends up in a menu or such where it is effectively 'autoapply'. Change-Id: Ib02cba871028fa1422e10622d263218089226c56 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index fd0800c7c22..fc78b7d2d86 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -1831,9 +1831,7 @@ QAction *BoolAspect::action() act->setChecked(m_internal); act->setToolTip(toolTip()); connect(act, &QAction::triggered, this, [this](bool newValue) { - setVolatileValue(newValue); - if (isAutoApply()) - apply(); + setValue(newValue); }); return act; } From 6899e0cfae9d0227608d40ecbc06003cca24b4c8 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 10 Oct 2023 11:31:14 +0200 Subject: [PATCH 1509/1777] BuildManager: Add a progress label for awaiter task Change-Id: I01d70a9dc4115407c33e171e44943935825a6ac9 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/projectexplorer/buildmanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index ed38b621c1e..dcb0bdf87ff 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -593,6 +593,8 @@ void BuildManager::startBuildQueue() // Delay if any of the involved build systems are currently parsing. buildSystems = transform<QSet<BuildSystem *>>( d->m_buildQueue, [](const BuildItem &item) { return item.buildStep->buildSystem(); }); + if (d->m_futureProgress && !d->m_buildQueue.isEmpty()) + d->m_futureProgress.data()->setTitle(d->m_buildQueue.first().name); }; const GroupItem abortPolicy From afc6d555b3e47fa91a804167ea171718c76c91f7 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 10 Oct 2023 11:43:18 +0200 Subject: [PATCH 1510/1777] CMakePM: Do not copy the PerformInputData structure I needed to add more members to the structure, and will get static analyser to complain that the number of bytes is to high. Amends 3984108c0cd51d114c1becea09dc3fe576df2ad1 Change-Id: I162b9ef615dc7f6f76b08c5599eed24488bf7e88 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- .../cmakefilecompletionassist.cpp | 85 ++++++++++--------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 82598f4993b..8be8fa7f91d 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -36,6 +36,7 @@ using namespace Utils; namespace CMakeProjectManager::Internal { class PerformInputData; +using PerformInputDataPtr = std::shared_ptr<PerformInputData>; class CMakeFileCompletionAssist : public AsyncProcessor { @@ -59,8 +60,8 @@ public: TextEditor::SnippetAssistCollector m_snippetCollector; private: - IAssistProposal *doPerform(const PerformInputData &data); - PerformInputData generatePerformInputData() const; + IAssistProposal *doPerform(const PerformInputDataPtr &data); + PerformInputDataPtr generatePerformInputData() const; }; CMakeFileCompletionAssist::CMakeFileCompletionAssist() @@ -393,27 +394,27 @@ public: Environment environment = Environment::systemEnvironment(); }; -PerformInputData CMakeFileCompletionAssist::generatePerformInputData() const +PerformInputDataPtr CMakeFileCompletionAssist::generatePerformInputData() const { - PerformInputData data; + PerformInputDataPtr data = PerformInputDataPtr(new PerformInputData); const FilePath &filePath = interface()->filePath(); if (!filePath.isEmpty() && filePath.isFile()) { if (auto tool = CMakeToolManager::defaultProjectOrDefaultCMakeTool()) - data.keywords = tool->keywords(); + data->keywords = tool->keywords(); } if (auto bs = qobject_cast<CMakeBuildSystem *>(ProjectTree::currentBuildSystem())) { for (const auto &target : std::as_const(bs->buildTargets())) if (target.targetType != TargetType::UtilityType) - data.buildTargets << target.title; + data->buildTargets << target.title; const CMakeKeywords &projectKeywords = bs->projectKeywords(); - data.projectVariables = projectKeywords.variables; - data.projectFunctions = projectKeywords.functions; - data.importedTargets = bs->projectImportedTargets(); - data.findPackageVariables = bs->projectFindPackageVariables(); - data.cmakeConfiguration = bs->configurationFromCMake(); - data.environment = bs->cmakeBuildConfiguration()->configureEnvironment(); + data->projectVariables = projectKeywords.variables; + data->projectFunctions = projectKeywords.functions; + data->importedTargets = bs->projectImportedTargets(); + data->findPackageVariables = bs->projectFindPackageVariables(); + data->cmakeConfiguration = bs->configurationFromCMake(); + data->environment = bs->cmakeBuildConfiguration()->configureEnvironment(); } return data; @@ -430,7 +431,7 @@ IAssistProposal *CMakeFileCompletionAssist::perform() return result; } -IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &data) +IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputDataPtr &data) { if (isInComment(interface())) return nullptr; @@ -458,24 +459,24 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &da interface()->textAt(0, prevFunctionEnd + 1).toUtf8()); auto [localFunctions, localVariables] = getLocalFunctionsAndVariables(cmakeListFile); - CMakeConfig cmakeConfiguration = data.cmakeConfiguration; + CMakeConfig cmakeConfiguration = data->cmakeConfiguration; const FilePath currentDir = interface()->filePath().absolutePath(); updateCMakeConfigurationWithLocalData(cmakeConfiguration, cmakeListFile, currentDir); auto [findModules, configModules] = getFindAndConfigCMakePackages(cmakeConfiguration, - data.environment); + data->environment); QList<AssistProposalItemInterface *> items; const QString varGenexToken = interface()->textAt(startPos - 2, 2); if (varGenexToken == "${" || varGenexToken == "$<") { if (varGenexToken == "${") { - items.append(generateList(data.keywords.variables, m_variableIcon)); - items.append(generateList(data.projectVariables, m_projectVariableIcon)); - items.append(generateList(data.findPackageVariables, m_projectVariableIcon)); + items.append(generateList(data->keywords.variables, m_variableIcon)); + items.append(generateList(data->projectVariables, m_projectVariableIcon)); + items.append(generateList(data->findPackageVariables, m_projectVariableIcon)); } if (varGenexToken == "$<") - items.append(generateList(data.keywords.generatorExpressions, m_genexIcon)); + items.append(generateList(data->keywords.generatorExpressions, m_genexIcon)); return new GenericProposal(startPos, items); } @@ -486,14 +487,14 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &da if (functionName == "if" || functionName == "elseif" || functionName == "while" || functionName == "set" || functionName == "list" || functionName == "cmake_print_variables") { - items.append(generateList(data.keywords.variables, m_variableIcon)); - items.append(generateList(data.projectVariables, m_projectVariableIcon)); - items.append(generateList(data.findPackageVariables, m_projectVariableIcon)); + items.append(generateList(data->keywords.variables, m_variableIcon)); + items.append(generateList(data->projectVariables, m_projectVariableIcon)); + items.append(generateList(data->findPackageVariables, m_projectVariableIcon)); items.append(generateList(localVariables, m_variableIcon)); } if (functionName == "if" || functionName == "elseif" || functionName == "cmake_policy") - items.append(generateList(data.keywords.policies, m_variableIcon)); + items.append(generateList(data->keywords.policies, m_variableIcon)); if (functionName.contains("path") || functionName.contains("file") || functionName.contains("add_executable") || functionName.contains("add_library") @@ -504,21 +505,21 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &da } if (functionName == "set_property" || functionName == "cmake_print_properties") - items.append(generateList(data.keywords.properties, m_propertyIcon)); + items.append(generateList(data->keywords.properties, m_propertyIcon)); if (functionName == "set_directory_properties") - items.append(generateList(data.keywords.directoryProperties, m_propertyIcon)); + items.append(generateList(data->keywords.directoryProperties, m_propertyIcon)); if (functionName == "set_source_files_properties") - items.append(generateList(data.keywords.sourceProperties, m_propertyIcon)); + items.append(generateList(data->keywords.sourceProperties, m_propertyIcon)); if (functionName == "set_target_properties") - items.append(generateList(data.keywords.targetProperties, m_propertyIcon)); + items.append(generateList(data->keywords.targetProperties, m_propertyIcon)); if (functionName == "set_tests_properties") - items.append(generateList(data.keywords.testProperties, m_propertyIcon)); + items.append(generateList(data->keywords.testProperties, m_propertyIcon)); if (functionName == "include" && !onlyFileItems()) - items.append(generateList(data.keywords.includeStandardModules, m_moduleIcon)); + items.append(generateList(data->keywords.includeStandardModules, m_moduleIcon)); if (functionName == "find_package") { - items.append(generateList(data.keywords.findModules, m_moduleIcon)); + items.append(generateList(data->keywords.findModules, m_moduleIcon)); items.append(generateList(findModules, m_moduleIcon)); items.append(generateList(configModules, m_moduleIcon)); } @@ -528,17 +529,17 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &da || functionName == "export" || functionName == "cmake_print_properties" || functionName == "if" || functionName == "elseif") && !onlyFileItems()) { - items.append(generateList(data.buildTargets, m_targetsIcon)); - items.append(generateList(data.importedTargets, m_importedTargetIcon)); + items.append(generateList(data->buildTargets, m_targetsIcon)); + items.append(generateList(data->importedTargets, m_importedTargetIcon)); } - if (data.keywords.functionArgs.contains(functionName) && !onlyFileItems()) { - const QStringList functionSymbols = data.keywords.functionArgs.value(functionName); + if (data->keywords.functionArgs.contains(functionName) && !onlyFileItems()) { + const QStringList functionSymbols = data->keywords.functionArgs.value(functionName); items.append(generateList(functionSymbols, m_argsIcon)); } else if (functionName.isEmpty()) { // On a new line we just want functions - items.append(generateList(data.keywords.functions, m_functionIcon)); - items.append(generateList(data.projectFunctions, m_projectFunctionIcon)); + items.append(generateList(data->keywords.functions, m_functionIcon)); + items.append(generateList(data->projectFunctions, m_projectFunctionIcon)); items.append(generateList(localFunctions, m_functionIcon)); // Snippets would make more sense only for the top level suggestions @@ -547,14 +548,14 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputData &da // Inside an unknown function we could have variables or properties fileStartPos = addFilePathItems(interface(), items, startPos); if (!onlyFileItems()) { - items.append(generateList(data.keywords.variables, m_variableIcon)); - items.append(generateList(data.projectVariables, m_projectVariableIcon)); + items.append(generateList(data->keywords.variables, m_variableIcon)); + items.append(generateList(data->projectVariables, m_projectVariableIcon)); items.append(generateList(localVariables, m_variableIcon)); - items.append(generateList(data.findPackageVariables, m_projectVariableIcon)); + items.append(generateList(data->findPackageVariables, m_projectVariableIcon)); - items.append(generateList(data.keywords.properties, m_propertyIcon)); - items.append(generateList(data.buildTargets, m_targetsIcon)); - items.append(generateList(data.importedTargets, m_importedTargetIcon)); + items.append(generateList(data->keywords.properties, m_propertyIcon)); + items.append(generateList(data->buildTargets, m_targetsIcon)); + items.append(generateList(data->importedTargets, m_importedTargetIcon)); } } From 87856470f7480f0fe7e9151adfa60464bf656c54 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 5 Oct 2023 12:35:09 +0200 Subject: [PATCH 1511/1777] TextEditor: Suppress warning in QFont Change-Id: I2ffaa8f9ebebc048c298c84143e9bf3d55520554 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/texteditor/fontsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp index af92c179cb7..be550460488 100644 --- a/src/plugins/texteditor/fontsettings.cpp +++ b/src/plugins/texteditor/fontsettings.cpp @@ -332,7 +332,7 @@ void FontSettings::setFontZoom(int zoom) qreal FontSettings::lineSpacing() const { QFont currentFont = font(); - currentFont.setPointSize(m_fontSize * m_fontZoom / 100); + currentFont.setPointSize(std::max(m_fontSize * m_fontZoom / 100, 1)); qreal spacing = QFontMetricsF(currentFont).lineSpacing(); if (m_lineSpacing != 100) spacing *= qreal(m_lineSpacing) / 100; From f723b59bfc33728612328e8eabac265efd201525 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 9 Oct 2023 15:20:07 +0200 Subject: [PATCH 1512/1777] ProjectExplorer: Do not follow recursive symlinks Also fix some inverted logic along the way. Fixes: QTCREATORBUG-29663 Change-Id: I7a5027d4536e6a05e5d91a4d2d24780bae3ca259 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/projectexplorer/selectablefilesmodel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/selectablefilesmodel.cpp b/src/plugins/projectexplorer/selectablefilesmodel.cpp index 5c34bd1d9b6..d7da1ad1f6d 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.cpp +++ b/src/plugins/projectexplorer/selectablefilesmodel.cpp @@ -111,13 +111,18 @@ void SelectableFilesFromDirModel::buildTree(const Utils::FilePath &baseDir, Tree bool allUnchecked = true; for (const QFileInfo &fileInfo : fileInfoList) { Utils::FilePath fn = Utils::FilePath::fromFileInfo(fileInfo); - if (m_futureCount % 100) { + if ((m_futureCount % 100) == 0) { emit parsingProgress(fn); if (promise.isCanceled()) return; } ++m_futureCount; if (fileInfo.isDir()) { + if (fileInfo.isSymLink()) { + const FilePath target = FilePath::fromString(fileInfo.symLinkTarget()); + if (target == baseDir || baseDir.isChildOf(target)) + continue; + } auto t = new Tree; t->parent = tree; t->name = fileInfo.fileName(); From fa01c8029aa1986ff63b4cb48993ec0ff263f714 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 10 Oct 2023 14:20:47 +0200 Subject: [PATCH 1513/1777] CppEditor: Keep track of FilePath instead of QString ... in CppSourceProcessor::mergeEnvironment(). This is functionally equivalent as the scheme/host bits are identical within normal projects. The temporaries for path() were responsible for 10% of the time in the function, in total ~0.5% of the C++ parsing in my Creator-in-Creator setup. Change-Id: I7f4f163f0f4b46ebf876d631a8dc5fae667e9fd2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/cppeditor/cppsourceprocessor.cpp | 4 +--- src/plugins/cppeditor/cppsourceprocessor.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/cppeditor/cppsourceprocessor.cpp b/src/plugins/cppeditor/cppsourceprocessor.cpp index 1c8c79a2c2c..4cdc6962416 100644 --- a/src/plugins/cppeditor/cppsourceprocessor.cpp +++ b/src/plugins/cppeditor/cppsourceprocessor.cpp @@ -364,9 +364,7 @@ void CppSourceProcessor::mergeEnvironment(Document::Ptr doc) if (!doc) return; - const QString fn = doc->filePath().path(); - - if (!Utils::insert(m_processed, fn)) + if (!Utils::insert(m_processed, doc->filePath())) return; const QList<Document::Include> includes = doc->resolvedIncludes(); diff --git a/src/plugins/cppeditor/cppsourceprocessor.h b/src/plugins/cppeditor/cppsourceprocessor.h index 75ea0fa8d21..d5a2763e30d 100644 --- a/src/plugins/cppeditor/cppsourceprocessor.h +++ b/src/plugins/cppeditor/cppsourceprocessor.h @@ -96,7 +96,7 @@ private: QSet<Utils::FilePath> m_included; CPlusPlus::Document::Ptr m_currentDoc; QSet<QString> m_todo; - QSet<QString> m_processed; + QSet<Utils::FilePath> m_processed; QHash<Utils::FilePath, Utils::FilePath> m_fileNameCache; int m_fileSizeLimitInMb = -1; QTextCodec *m_defaultCodec; From 4e649a0ac9bc2279260dcb2837329ef9bab09614 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 20:53:32 +0200 Subject: [PATCH 1514/1777] RefreshTranslationWorker: Call RunWorker::stop from main thread Amends dc78c8faa2f4832444268d12a1c5fc8638964a94 Change-Id: I7254d6ea275f84e8e39fa4b21c4f33d24f81a3ae Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/qmlpreview/qmlpreviewruncontrol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp index 2857c15fbb1..5bdb2e78a08 100644 --- a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp +++ b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp @@ -32,7 +32,7 @@ namespace QmlPreview { static const Key QmlServerUrl = "QmlServerUrl"; -class RefreshTranslationWorker final : public ProjectExplorer::RunWorker +class RefreshTranslationWorker final : public RunWorker { public: explicit RefreshTranslationWorker(ProjectExplorer::RunControl *runControl, @@ -42,6 +42,7 @@ public: setId("RefreshTranslationWorker"); connect(this, &RunWorker::started, this, &RefreshTranslationWorker::startRefreshTranslationsAsync); connect(this, &RunWorker::stopped, &m_futureWatcher, &QFutureWatcher<void>::cancel); + connect(&m_futureWatcher, &QFutureWatcherBase::finished, this, &RefreshTranslationWorker::stop); } ~RefreshTranslationWorker() { @@ -54,7 +55,6 @@ private: { m_futureWatcher.setFuture(Utils::asyncRun([this] { m_runnerSettings.refreshTranslationsFunction(); - stop(); })); } QmlPreviewRunnerSetting m_runnerSettings; From b14e7d0cb745bc4d04e25bce400905d494aa4634 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 10 Oct 2023 11:25:46 +0200 Subject: [PATCH 1515/1777] Fix the name of Win/ARM/64 wininterrupt executable Just differentiating between 32 and 64 bits isn't enough anymore. Do the same as for the cdbextension. Change-Id: Ic5acc256641b5b63568d1ef4df825aea0724d756 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/tools/wininterrupt/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tools/wininterrupt/CMakeLists.txt b/src/tools/wininterrupt/CMakeLists.txt index 4a41fa7b08f..9dd3a658d7c 100644 --- a/src/tools/wininterrupt/CMakeLists.txt +++ b/src/tools/wininterrupt/CMakeLists.txt @@ -23,6 +23,10 @@ if (CMAKE_SIZEOF_VOID_P EQUAL 8) set(Arch 64) endif() +if (MSVC_CXX_ARCHITECTURE_ID MATCHES "^ARM") + set(Arch "arm${Arch}") +endif() + add_qtc_executable(win${Arch}interrupt COMPONENT wininterrupt SOURCES wininterrupt.c From 839f737946db31fa1534f578dce71c19bbcdb515 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 5 Oct 2023 13:45:44 +0200 Subject: [PATCH 1516/1777] build.py: Apply additional config to all builds Not only Qt Creator but also cdbextension & wininterrupt. Otherwise there is no way to pass additional configuration to these. Change-Id: I2bd4894f212df9795e1d66577bb25a26b29224a4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- scripts/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.py b/scripts/build.py index 2fced683b1b..72c7d3571ad 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -146,6 +146,8 @@ def common_cmake_arguments(args): # Qt otherwise adds dependencies on libGLX and libOpenGL cmake_args += ['-DOpenGL_GL_PREFERENCE=LEGACY'] + cmake_args += args.config_args + return cmake_args def build_qtcreator(args, paths): @@ -194,8 +196,6 @@ def build_qtcreator(args, paths): if common.is_linux_platform(): cmake_args += ['-DCPACK_INSTALL_PREFIX=/opt/qt-creator'] - cmake_args += args.config_args - common.check_print_call(cmake_args + [paths.src], paths.build) build_args = ['cmake', '--build', '.'] if args.make_args: From 311fe1bf249a32c0cf18a61d6e34197c606cc330 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 10 Oct 2023 16:22:31 +0200 Subject: [PATCH 1517/1777] Beautifier: Fix saving of settings Applying didn't actually apply the new values. Fixes: QTCREATORBUG-29586 Change-Id: If9416cc18fffd269f6ca3d27523aa138e6f91d7a Reviewed-by: hjk <hjk@qt.io> --- src/plugins/beautifier/artisticstyle/artisticstyle.cpp | 1 + src/plugins/beautifier/clangformat/clangformat.cpp | 4 +--- src/plugins/beautifier/generalsettings.cpp | 1 + src/plugins/beautifier/uncrustify/uncrustify.cpp | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp index 14d8ea1c246..95c3d43ecbf 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp @@ -221,6 +221,7 @@ public: setOnApply([&s, configurations] { s.customStyle.setValue(configurations->currentConfiguration()); + settings().apply(); s.save(); }); diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index 2a2cad2f41d..c8eab5ea0c2 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -82,9 +82,6 @@ public: fallbackStyle.addOption("WebKit"); fallbackStyle.setDefaultValue("Default"); - predefinedStyle.setSettingsKey("predefinedStyle"); - predefinedStyle.setDefaultValue("LLVM"); - customStyle.setSettingsKey("customStyle"); documentationFilePath = Core::ICore::userResourcePath(Constants::SETTINGS_DIRNAME) @@ -299,6 +296,7 @@ public: setOnApply([configurations, customizedStyleButton] { settings().usePredefinedStyle.setValue(!customizedStyleButton->isChecked()); settings().customStyle.setValue(configurations->currentConfiguration()); + settings().apply(); settings().save(); }); diff --git a/src/plugins/beautifier/generalsettings.cpp b/src/plugins/beautifier/generalsettings.cpp index 7b8d37416ac..be80de39385 100644 --- a/src/plugins/beautifier/generalsettings.cpp +++ b/src/plugins/beautifier/generalsettings.cpp @@ -24,6 +24,7 @@ GeneralSettings &generalSettings() GeneralSettings::GeneralSettings() { + setAutoApply(false); setSettingsGroups("Beautifier", "General"); autoFormatOnSave.setSettingsKey(Utils::Constants::BEAUTIFIER_AUTO_FORMAT_ON_SAVE); diff --git a/src/plugins/beautifier/uncrustify/uncrustify.cpp b/src/plugins/beautifier/uncrustify/uncrustify.cpp index f04e5e61800..29722d4df19 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustify.cpp @@ -222,6 +222,7 @@ public: setOnApply([&s, configurations] { s.customStyle.setValue(configurations->currentConfiguration()); + settings().apply(); s.save(); }); } From 524634f1248b421890b0c59880ed4f34896b1e37 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 10 Oct 2023 15:50:18 +0200 Subject: [PATCH 1518/1777] CMakePM: Add support for "$ENV{" code completion and help CMake has a few environment variables that are documented and this commit adds support for them. Change-Id: Iaa31bdc97b343581fcf519d19e66bc6ce8ace150 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../cmakeprojectmanager/cmakeeditor.cpp | 21 +++++++++++-------- .../cmakefilecompletionassist.cpp | 14 ++++++++++--- src/plugins/cmakeprojectmanager/cmaketool.cpp | 2 ++ src/plugins/cmakeprojectmanager/cmaketool.h | 1 + .../completion/CMakeLists.txt | 7 +++++++ 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 1979d6ef76d..a821648f24b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -77,6 +77,8 @@ void CMakeEditor::contextHelp(const HelpCallback &callback) const return "prop_gbl/"; if (m_keywords.policies.contains(word)) return "policy/"; + if (m_keywords.environmentVariables.contains(word)) + return "envvar/"; return "unknown/"; }; @@ -449,15 +451,16 @@ void CMakeHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget const QMap<QString, Utils::FilePath> ↦ QString helpCategory; } keywordsListMaps[] = {{keywords().functions, "command"}, - {keywords().variables, "variable"}, - {keywords().directoryProperties, "prop_dir"}, - {keywords().sourceProperties, "prop_sf"}, - {keywords().targetProperties, "prop_tgt"}, - {keywords().testProperties, "prop_test"}, - {keywords().properties, "prop_gbl"}, - {keywords().includeStandardModules, "module"}, - {keywords().findModules, "module"}, - {keywords().policies, "policy"}}; + {keywords().variables, "variable"}, + {keywords().directoryProperties, "prop_dir"}, + {keywords().sourceProperties, "prop_sf"}, + {keywords().targetProperties, "prop_tgt"}, + {keywords().testProperties, "prop_test"}, + {keywords().properties, "prop_gbl"}, + {keywords().includeStandardModules, "module"}, + {keywords().findModules, "module"}, + {keywords().policies, "policy"}, + {keywords().environmentVariables, "envvar"}}; for (const auto &pair : keywordsListMaps) { if (pair.map.contains(word)) { diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 8be8fa7f91d..2161c9b72d5 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -469,7 +469,8 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputDataPtr QList<AssistProposalItemInterface *> items; const QString varGenexToken = interface()->textAt(startPos - 2, 2); - if (varGenexToken == "${" || varGenexToken == "$<") { + const QString varEnvironmentToken = interface()->textAt(startPos - 5, 5); + if (varGenexToken == "${" || varGenexToken == "$<" || varEnvironmentToken == "$ENV{") { if (varGenexToken == "${") { items.append(generateList(data->keywords.variables, m_variableIcon)); items.append(generateList(data->projectVariables, m_projectVariableIcon)); @@ -478,9 +479,16 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputDataPtr if (varGenexToken == "$<") items.append(generateList(data->keywords.generatorExpressions, m_genexIcon)); + if (varEnvironmentToken == "$ENV{") + items.append(generateList(data->keywords.environmentVariables, m_variableIcon)); + return new GenericProposal(startPos, items); } + const QString ifEnvironmentToken = interface()->textAt(startPos - 4, 4); + if ((functionName == "if" || functionName == "elseif") && ifEnvironmentToken == "ENV{") + items.append(generateList(data->keywords.environmentVariables, m_variableIcon)); + int fileStartPos = startPos; const auto onlyFileItems = [&] { return fileStartPos != startPos; }; @@ -569,13 +577,13 @@ IAssistProcessor *CMakeFileCompletionAssistProvider::createProcessor(const Assis int CMakeFileCompletionAssistProvider::activationCharSequenceLength() const { - return 2; + return 4; } bool CMakeFileCompletionAssistProvider::isActivationCharSequence(const QString &sequence) const { return sequence.endsWith("${") || sequence.endsWith("$<") || sequence.endsWith("/") - || sequence.endsWith("("); + || sequence.endsWith("(") || sequence.endsWith("ENV{"); } } // namespace CMakeProjectManager::Internal diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 5eba0d642de..a24114bb352 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -288,6 +288,8 @@ CMakeKeywords CMakeTool::keywords() {"Help/variable", m_introspection->m_keywords.variables}, // Policies {"Help/policy", m_introspection->m_keywords.policies}, + // Environment Variables + {"Help/envvar", m_introspection->m_keywords.environmentVariables}, }; for (auto &i : introspections) { const FilePaths files = cmakeRoot.pathAppended(i.helpPath) diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index b72a926c768..c9bc6e02e3c 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -25,6 +25,7 @@ struct CMAKE_EXPORT CMakeKeywords QMap<QString, Utils::FilePath> functions; QMap<QString, Utils::FilePath> properties; QSet<QString> generatorExpressions; + QMap<QString, Utils::FilePath> environmentVariables; QMap<QString, Utils::FilePath> directoryProperties; QMap<QString, Utils::FilePath> sourceProperties; QMap<QString, Utils::FilePath> targetProperties; diff --git a/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt b/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt index 785fea0408f..15b083cbd5a 100644 --- a/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt +++ b/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt @@ -53,6 +53,13 @@ if (SOURCE_FILES) cmake_print_variables(SOURCE_FILES) endif() +# here code completion for "if (ENV{|" should popup the CMake supported environment variables +# also deleting { and typing again { should trigger the menu +#if (ENV{ + +# hover over CXX should display the help for the CXX environment variable +# and F1 should open the help page +message(STATUS $ENV{CXX}) qt_add_executable(completion ${SOURCE_FILES}) From c929b71acdfc4285dee5333b29f76188f9225165 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Sat, 7 Oct 2023 16:07:29 +0200 Subject: [PATCH 1519/1777] CMakePM: Add cache variables to code completion Change-Id: I5ac4fcf3ca7755ab52ffecafd83922e4e380363e Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakefilecompletionassist.cpp | 61 +++++++++++++++++-- .../completion/CMakeLists.txt | 5 ++ .../completion/cmake/JustACacheVariable.cmake | 1 + 3 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 tests/manual/cmakeprojectmanager/completion/cmake/JustACacheVariable.cmake diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 2161c9b72d5..7a656722bb4 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -158,6 +158,11 @@ static int findPathStart(const AssistInterface *interface) return ++pos; } +struct MarkDownAssitProposalItem : public AssistProposalItem +{ + Qt::TextFormat detailFormat() const override { return Qt::MarkdownText; } +}; + template<typename T> static QList<AssistProposalItemInterface *> generateList(const T &words, const QIcon &icon) { @@ -172,11 +177,6 @@ static QList<AssistProposalItemInterface *> generateList(const T &words, const Q static QList<AssistProposalItemInterface *> generateList(const QMap<QString, FilePath> &words, const QIcon &icon) { - struct MarkDownAssitProposalItem : public AssistProposalItem - { - Qt::TextFormat detailFormat() const override { return Qt::MarkdownText; } - }; - QList<AssistProposalItemInterface *> list; for (auto it = words.cbegin(); it != words.cend(); ++it) { MarkDownAssitProposalItem *item = new MarkDownAssitProposalItem(); @@ -189,6 +189,55 @@ static QList<AssistProposalItemInterface *> generateList(const QMap<QString, Fil return list; } +static QList<AssistProposalItemInterface *> generateList( + const CMakeConfig &cache, + const QIcon &icon, + const QList<AssistProposalItemInterface *> &existingList) +{ + QHash<QString, AssistProposalItemInterface *> hash; + for (const auto &item : existingList) + hash.insert(item->text(), item); + + auto makeDetail = [](const CMakeConfigItem &item) { + QString detail = QString("### %1 (cache)").arg(QString::fromUtf8(item.key)); + + if (!item.documentation.isEmpty()) + detail.append(QString("\n%1\n").arg(QString::fromUtf8(item.documentation))); + else + detail.append("\n"); + + const QString value = item.toString(); + if (!value.isEmpty()) + detail.append(QString("\n```\n%1\n```\n").arg(value)); + + return detail; + }; + + QList<AssistProposalItemInterface *> list; + for (auto it = cache.cbegin(); it != cache.cend(); ++it) { + if (it->isAdvanced || it->isUnset || it->type == CMakeConfig::Type::INTERNAL) + continue; + + QString text = QString::fromUtf8(it->key); + if (!hash.contains(text)) { + MarkDownAssitProposalItem *item = new MarkDownAssitProposalItem(); + item->setText(text); + item->setDetail(makeDetail(*it)); + item->setIcon(icon); + list << item; + } else { + auto item = static_cast<AssistProposalItem *>(hash.value(text)); + + QString detail = item->detail(); + detail.append("\n"); + detail.append(makeDetail(*it)); + + item->setDetail(detail); + } + } + return list; +} + static int addFilePathItems(const AssistInterface *interface, QList<AssistProposalItemInterface *> &items, int symbolStartPos) @@ -499,6 +548,7 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputDataPtr items.append(generateList(data->projectVariables, m_projectVariableIcon)); items.append(generateList(data->findPackageVariables, m_projectVariableIcon)); items.append(generateList(localVariables, m_variableIcon)); + items.append(generateList(cmakeConfiguration, m_variableIcon, items)); } if (functionName == "if" || functionName == "elseif" || functionName == "cmake_policy") @@ -559,6 +609,7 @@ IAssistProposal *CMakeFileCompletionAssist::doPerform(const PerformInputDataPtr items.append(generateList(data->keywords.variables, m_variableIcon)); items.append(generateList(data->projectVariables, m_projectVariableIcon)); items.append(generateList(localVariables, m_variableIcon)); + items.append(generateList(cmakeConfiguration, m_variableIcon, items)); items.append(generateList(data->findPackageVariables, m_projectVariableIcon)); items.append(generateList(data->keywords.properties, m_propertyIcon)); diff --git a/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt b/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt index 15b083cbd5a..a3b5ddf4efb 100644 --- a/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt +++ b/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt @@ -84,3 +84,8 @@ set_target_properties(completion PROPERTIES # here completion for "WIN32|" should popup WIN32_EXECUTABLE #WIN32 ) + +include(JustACacheVariable) +# here code completion for "if (JUST|" should complete with if (JUST_A_CACHE_VARIABLE +# as a tooltip containing the description +#if (JUST diff --git a/tests/manual/cmakeprojectmanager/completion/cmake/JustACacheVariable.cmake b/tests/manual/cmakeprojectmanager/completion/cmake/JustACacheVariable.cmake new file mode 100644 index 00000000000..ce9ed4aab42 --- /dev/null +++ b/tests/manual/cmakeprojectmanager/completion/cmake/JustACacheVariable.cmake @@ -0,0 +1 @@ +set(JUST_A_CACHE_VARIABLE ON CACHE BOOL "This was set from cmake/JustACacheVariable" FORCE) From b63c0670f88ff1189cd7030b1b75090e481875ca Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 10 Oct 2023 08:51:41 +0200 Subject: [PATCH 1520/1777] SquishTests: Fix finding help contents Fixes suite_HELP. Change-Id: I57c0b82a758d3c91f29c4c48a8c33672f71afde2 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/shared/help/contentwindow.cpp | 1 + tests/system/objects.map | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/help/contentwindow.cpp b/src/shared/help/contentwindow.cpp index 52c27a60180..216a63b3efe 100644 --- a/src/shared/help/contentwindow.cpp +++ b/src/shared/help/contentwindow.cpp @@ -27,6 +27,7 @@ ContentWindow::ContentWindow() { m_contentModel = (&LocalHelpManager::helpEngine())->contentModel(); m_contentWidget = new Utils::NavigationTreeView; + m_contentWidget->setObjectName("helpContentWidget"); // used by Squish m_contentWidget->setModel(m_contentModel); m_contentWidget->setActivationMode(Utils::SingleClickActivation); m_contentWidget->installEventFilter(this); diff --git a/tests/system/objects.map b/tests/system/objects.map index 39961ffb4f3..66681c6b056 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -160,7 +160,7 @@ :Qt Creator_Git::Internal::GitEditor {type='Git::Internal::GitEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_HelpSelector_QComboBox {occurrence='3' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Issues_Core::Internal::OutputPaneToggleButton {occurrence='1' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator_QHelpContentWidget {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_QHelpContentWidget {name='helpContentWidget' type='QTreeView' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_QmlJSEditor::Internal::QmlJSOutlineTreeView {type='QmlJSEditor::Internal::QmlJSOutlineTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_QmlJSEditor::QmlJSTextEditorWidget {type='QmlJSEditor::QmlJSEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton {occurrence='2' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} From 511c70615322c0d30abfb0f533488538620caea1 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 10 Oct 2023 10:37:02 +0200 Subject: [PATCH 1521/1777] SquishTests: Fix handling of clang based proposals Change-Id: I6e66537ba2a562c835fef4363bdd422330288506 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> --- tests/system/suite_CSUP/tst_CSUP01/test.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/system/suite_CSUP/tst_CSUP01/test.py b/tests/system/suite_CSUP/tst_CSUP01/test.py index 5ca6d9500ab..0e443d4d89c 100644 --- a/tests/system/suite_CSUP/tst_CSUP01/test.py +++ b/tests/system/suite_CSUP/tst_CSUP01/test.py @@ -19,6 +19,15 @@ def triggerCompletion(editorWidget): else: type(editorWidget, "<Ctrl+Space>") + +def proposalItemFrom(baseText, useClang, isFunction): + if not useClang: + return baseText + if isFunction: + return ' ' + baseText + '(*' + return ' ' + baseText + + # entry of test def main(): for useClang in [False, True]: @@ -48,8 +57,9 @@ def main(): functionName = "realpath" if platform.system() in ('Windows', 'Microsoft'): functionName = "realloc" - waitForObjectItem(":popupFrame_Proposal_QListView", functionName) - doubleClickItem(":popupFrame_Proposal_QListView", functionName, 5, 5, 0, Qt.LeftButton) + proposalItem = proposalItemFrom(functionName, useClang, True) + waitForObjectItem(":popupFrame_Proposal_QListView", proposalItem) + doubleClickItem(":popupFrame_Proposal_QListView", proposalItem, 5, 5, 0, Qt.LeftButton) test.compare(str(lineUnderCursor(editorWidget)).strip(), functionName + "()", "Step 3: Verifying if: The list of suggestions is opened. It is " "possible to select one of the suggestions.") @@ -58,11 +68,11 @@ def main(): type(editorWidget, "unsig") try: proposalListView = waitForObject(":popupFrame_Proposal_QListView") - waitForObjectItem(proposalListView, "unsigned") + waitForObjectItem(proposalListView, proposalItemFrom("unsigned", useClang, False)) model = proposalListView.model() if test.verify(model.rowCount() >= 1, 'At least one proposal for "unsi"?'): - test.compare(dumpItems(model)[0], 'unsigned', + test.compare(dumpItems(model)[0].strip(), 'unsigned', '"unsigned" is the first proposal for "unsi"?') type(proposalListView, "<Tab>") test.compare(str(lineUnderCursor(editorWidget)).strip(), "unsigned", @@ -90,8 +100,8 @@ def main(): try: proposal = "return" if useClang: - # clang adds a whitespace because the function needs to return a value - proposal += " ;" + # clang adds more because the function needs to return a value + proposal = " return expression;" waitForObjectItem(":popupFrame_Proposal_QListView", proposal) except: test.fail("Could not find proposal popup.") From 52ebafda4d0be4892dabdac9bf57f20f4fb5a91a Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 10 Oct 2023 10:50:47 +0200 Subject: [PATCH 1522/1777] SquishTests: Fix handling of arguments proposal On slower machines or high load the proposal can take a split of a second to appear. Wait shortly for the proposal to appear. Amends 1d449ad7d628e7da70378aecb216f1d6db423fea. Change-Id: I705ce3819e13116386304994da60ab6660ccfbd8 Reviewed-by: David Schulz <david.schulz@qt.io> --- tests/system/suite_CSUP/tst_CSUP06/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system/suite_CSUP/tst_CSUP06/test.py b/tests/system/suite_CSUP/tst_CSUP06/test.py index 507fdd7881c..b1b890b6b36 100644 --- a/tests/system/suite_CSUP/tst_CSUP06/test.py +++ b/tests/system/suite_CSUP/tst_CSUP06/test.py @@ -120,8 +120,8 @@ def checkSymbolCompletion(editor, isClangCodeModel): 5, 5, 0, Qt.LeftButton) try: - multiSuggestionToolTip = findObject( - "{leftWidget={text~='[0-9]+ of [0-9]+' type='QLabel'} type='QToolButton'}") + multiSuggestionToolTip = waitForObject( + "{leftWidget={text~='[0-9]+ of [0-9]+' type='QLabel'} type='QToolButton'}", 1000) if multiSuggestionToolTip is not None: test.log("Closing tooltip containing overloaded function completion.") type(editor, "<Esc>") From 3391d789b9d3e79f842d4f0a86ff890733423b42 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 10 Oct 2023 19:39:55 +0200 Subject: [PATCH 1523/1777] PluginManager: Don't delete timer in its signal handler Delete it later instead. The startDelayedInitialize() is invoked directly by delayedInitializeTimer's timeout() signal. Change-Id: I8813679c5cf150cfe91b6bf48559c83b7e3cd893 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/libs/extensionsystem/pluginmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 5dda665d7f7..ff9c632184b 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -940,7 +940,7 @@ PluginSpecPrivate *PluginManagerPrivate::privateSpec(PluginSpec *spec) void PluginManagerPrivate::startDelayedInitialize() { - delayedInitializeTimer.reset(); + delayedInitializeTimer.release()->deleteLater(); Utils::setMimeStartupPhase(MimeStartupPhase::PluginsDelayedInitializing); { NANOTRACE_SCOPE("ExtensionSystem", "DelayedInitialize"); From 5a715330fc04c02a05228ce7bf2addc504fa5b7e Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 10 Oct 2023 11:15:59 +0200 Subject: [PATCH 1524/1777] Doc: Describe detaching views Fixes: QTCREATORBUG-29636 Change-Id: I980d7c523bd40cbc7ad56696987688839baf154d Reviewed-by: David Schulz <david.schulz@qt.io> --- doc/qtcreator/images/icons/detach-view.png | Bin 0 -> 191 bytes .../images/qtcreator-attach-views.webp | Bin 0 -> 4234 bytes .../src/analyze/creator-valgrind.qdoc | 1 + .../creator-coding-edit-mode.qdoc | 2 + .../howto/creator-only/creator-how-tos.qdoc | 1 + doc/qtcreator/src/qtcreator-toc.qdoc | 1 + .../creator-how-to-detach-views.qdoc | 41 ++++++++++++++++++ 7 files changed, 46 insertions(+) create mode 100644 doc/qtcreator/images/icons/detach-view.png create mode 100644 doc/qtcreator/images/qtcreator-attach-views.webp create mode 100644 doc/qtcreator/src/user-interface/creator-only/creator-how-to-detach-views.qdoc diff --git a/doc/qtcreator/images/icons/detach-view.png b/doc/qtcreator/images/icons/detach-view.png new file mode 100644 index 0000000000000000000000000000000000000000..1cc3d8df400060bf1aeffc7ad519b7f65339603f GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4i*LmhONKMUokK+w0XKXhG?8mPEcTw5Iobi zo+szUCEhhYEj|h>8dy93wmNns$_m}@bYxhyAW@!~pP89inwhy-DdwXQn{*4OS;28B zr<ebEPIr_rPwe}1^1y+B4i&53#)*km%k%{v=rb!Hj;`VQXJBCBF<BzOhv%J!-~aY? s4ZVsCu8;XcSj8nOF8ciANoHX9aZE(ed_&6_1_lNOPgg&ebxsLQ0I}sim;e9( literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-attach-views.webp b/doc/qtcreator/images/qtcreator-attach-views.webp new file mode 100644 index 0000000000000000000000000000000000000000..9d9785088505186d2c4ceb0e54d8620fa0e0a025 GIT binary patch literal 4234 zcmWIYbaQJGU|<M$bqWXzu<$7rU|`Un=VZcg^+waSyM<Dj#pf#57x_&t7O}X^F~_&a zAz*fMI$O--n{NW<&1uel^lVLP_oJdu&-UH=z4!L%IqR0a_&onY(CWJxO>g969c~DD zHnik6szy)iQ877md6VU#NvXGQ-7+&*Fb_P%BmCmjdjngs^o!finfU}=2ryv#x>hUC z=l;Yew{G1wdv9kpef}j4dsPE&4hQk7MXXEo?oD;9OJ&uY6yvtY`a*r@rd;mK&HP4< zFJAAfIJkV<Uj}X)?&zEgh1FhvtR(*%yJ<E?PLO*sp-68*g7QVfjzYy(DTg)BG*3;E zm2i6(u;%f}odrMN%8M{dcUJBGwY+1YK6BU#m+S=DXQf6wytBDu>>}q{s9ReKHOsI~ zvvN~iS6E~j$J!SE|AY1RV}c8d)tCx$RHV|Cj6#+Nt(e5zJ?Eyufm2o{?`%#j5K}M? z=9wTXk$2hj5QC-7+v{vRSCbY_|EA)(Y-iy={ew=ocCVfjZMpcpT)C1@#Ek9l&iZWr z`Zl4Gc@5X<yuWuCBKF^&U8leH)3s{}mB#sZqa&Xw$O(QjOt`wR`oX6&?yjaft)d4+ zQ+hp$)0Z-(g*jWgl}Nj>7HJqd?@R0!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/src/analyze/creator-valgrind.qdoc +++ b/doc/qtcreator/src/analyze/creator-valgrind.qdoc @@ -324,6 +324,7 @@ \endlist + \sa {Detach views} */ /*! diff --git a/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc b/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc index 6602548e7b1..dc2d905cadc 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc @@ -338,4 +338,6 @@ \QC underlines semantic errors in olive in the C++ code editor. To check the correct paths for includes that are not resolved or that are resolved to the wrong file, select \uicontrol {Project Parts} > \uicontrol {Header Paths}. + + \sa {Detach views} */ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 55151151a79..94a4f288393 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -124,6 +124,7 @@ \list \li \l {Assign keyboard shortcuts} + \li \l {Detach views} \li \l {Find a particular preference} \li \l {Find keyboard shortcuts} \li \l {Find menu items on \macos} diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 6a5d621ed53..5fcbee47a94 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -262,6 +262,7 @@ \li Use the UI \list \li \l {Assign keyboard shortcuts} + \li \l {Detach views} \li \l {Find a particular preference} \li \l {Find keyboard shortcuts} \li \l {Find menu items on \macos} diff --git a/doc/qtcreator/src/user-interface/creator-only/creator-how-to-detach-views.qdoc b/doc/qtcreator/src/user-interface/creator-only/creator-how-to-detach-views.qdoc new file mode 100644 index 00000000000..3534e055ec8 --- /dev/null +++ b/doc/qtcreator/src/user-interface/creator-only/creator-how-to-detach-views.qdoc @@ -0,0 +1,41 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-how-to-detach-views.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-ui + + \title Detach views + + You can detach \QC views that have the \inlineimage icons/detach-view.png + icon. You can then move them to other places on the screen or to other + screens. + + To detach views: + + \list + \li Double-click the title bar of the view. + \li Grab the title bar of the view with the mouse and start moving the + view to another position on the screen. + \li Select \inlineimage icons/detach-view.png + . + \endlist + + To show the title bars of views, select \uicontrol View > \uicontrol Views, + and deselect the \uicontrol {Automatically Hide Title Bars} check box. + + \section1 Attach views + + To attach views, drag them to a highlighted dock area. + + \image qtcreator-attach-views.webp {Attaching a view to a dock area} + + \section1 Revert changes + + To open closed views, select \uicontrol View > \uicontrol Views. + + To revert the changes, select \uicontrol View > \uicontrol Views > + \uicontrol {Reset to Default Layout}. +*/ From ab13b7b155b4e4dd61cdaa564ffb9d6661ead53e Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 10:25:31 +0200 Subject: [PATCH 1525/1777] HelpManager: Hide registerDocumentationNow() in cpp This avoid calling collectionFilePath() concurrently, which might be potentially problematic. Change-Id: Ic873b6429b933f2f3359623b1e9cb14409ef3c4b Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/help/helpmanager.cpp | 67 ++++++++++++++++---------------- src/plugins/help/helpmanager.h | 1 - 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/plugins/help/helpmanager.cpp b/src/plugins/help/helpmanager.cpp index f971f825689..5aaa98651e1 100644 --- a/src/plugins/help/helpmanager.cpp +++ b/src/plugins/help/helpmanager.cpp @@ -94,6 +94,39 @@ QString HelpManager::collectionFilePath() return ICore::userResourcePath("helpcollection.qhc").toString(); } +static void registerDocumentationNow(QPromise<bool> &promise, const QString &collectionFilePath, + const QStringList &files) +{ + QMutexLocker locker(&d->m_helpengineMutex); + + promise.setProgressRange(0, files.count()); + promise.setProgressValue(0); + + QHelpEngineCore helpEngine(collectionFilePath); + helpEngine.setReadOnly(false); + helpEngine.setupData(); + bool docsChanged = false; + QStringList nameSpaces = helpEngine.registeredDocumentations(); + for (const QString &file : files) { + if (promise.isCanceled()) + break; + promise.setProgressValue(promise.future().progressValue() + 1); + const QString &nameSpace = QHelpEngineCore::namespaceName(file); + if (nameSpace.isEmpty()) + continue; + if (!nameSpaces.contains(nameSpace)) { + if (helpEngine.registerDocumentation(file)) { + nameSpaces.append(nameSpace); + docsChanged = true; + } else { + qWarning() << "Error registering namespace '" << nameSpace + << "' from file '" << file << "':" << helpEngine.error(); + } + } + } + promise.addResult(docsChanged); +} + void HelpManager::registerDocumentation(const QStringList &files) { if (d->m_needsSetup) { @@ -102,7 +135,7 @@ void HelpManager::registerDocumentation(const QStringList &files) return; } - QFuture<bool> future = Utils::asyncRun(&HelpManager::registerDocumentationNow, files); + QFuture<bool> future = Utils::asyncRun(registerDocumentationNow, collectionFilePath(), files); Utils::onResultReady(future, this, [](bool docsChanged){ if (docsChanged) { d->m_helpEngine->setupData(); @@ -125,38 +158,6 @@ void HelpManager::unregisterDocumentation(const QStringList &fileNames) unregisterNamespaces(getNamespaces(fileNames)); } -void HelpManager::registerDocumentationNow(QPromise<bool> &promise, const QStringList &files) -{ - QMutexLocker locker(&d->m_helpengineMutex); - - promise.setProgressRange(0, files.count()); - promise.setProgressValue(0); - - QHelpEngineCore helpEngine(collectionFilePath()); - helpEngine.setReadOnly(false); - helpEngine.setupData(); - bool docsChanged = false; - QStringList nameSpaces = helpEngine.registeredDocumentations(); - for (const QString &file : files) { - if (promise.isCanceled()) - break; - promise.setProgressValue(promise.future().progressValue() + 1); - const QString &nameSpace = QHelpEngineCore::namespaceName(file); - if (nameSpace.isEmpty()) - continue; - if (!nameSpaces.contains(nameSpace)) { - if (helpEngine.registerDocumentation(file)) { - nameSpaces.append(nameSpace); - docsChanged = true; - } else { - qWarning() << "Error registering namespace '" << nameSpace - << "' from file '" << file << "':" << helpEngine.error(); - } - } - } - promise.addResult(docsChanged); -} - void HelpManager::unregisterNamespaces(const QStringList &nameSpaces) { if (d->m_needsSetup) { diff --git a/src/plugins/help/helpmanager.h b/src/plugins/help/helpmanager.h index 739d5a68767..0e2d1fbd5a1 100644 --- a/src/plugins/help/helpmanager.h +++ b/src/plugins/help/helpmanager.h @@ -59,7 +59,6 @@ public: Core::HelpManager::HelpViewerLocation location = Core::HelpManager::HelpModeAlways) override; static void setupHelpManager(); - static void registerDocumentationNow(QPromise<bool> &promise, const QStringList &fileNames); signals: void collectionFileChanged(); From adfdf3fe27126834602b07dca26c20864f6aa390 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 10 Oct 2023 14:55:06 +0200 Subject: [PATCH 1526/1777] Help: make unregisterDocumentation async Just like registerDocumentation this function can take a considerable amount of time. As this function is also executed on startup it increases the perceived startup time. Change-Id: I43f4bb61293948c78eb7394d202757af83210eaa Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/help/docsettingspage.cpp | 2 +- src/plugins/help/helpmanager.cpp | 88 +++++++++++++++++----------- src/plugins/help/helpmanager.h | 2 - 3 files changed, 54 insertions(+), 38 deletions(-) diff --git a/src/plugins/help/docsettingspage.cpp b/src/plugins/help/docsettingspage.cpp index 354971a1200..2d0cc9de2b2 100644 --- a/src/plugins/help/docsettingspage.cpp +++ b/src/plugins/help/docsettingspage.cpp @@ -289,7 +289,7 @@ void DocSettingsPageWidget::addDocumentation() void DocSettingsPageWidget::apply() { - HelpManager::unregisterNamespaces(m_filesToUnregister.keys()); + HelpManager::instance()->unregisterDocumentation(m_filesToUnregister.values()); QStringList files; auto it = m_filesToRegisterUserManaged.constBegin(); while (it != m_filesToRegisterUserManaged.constEnd()) { diff --git a/src/plugins/help/helpmanager.cpp b/src/plugins/help/helpmanager.cpp index 5aaa98651e1..6a232083bd1 100644 --- a/src/plugins/help/helpmanager.cpp +++ b/src/plugins/help/helpmanager.cpp @@ -36,6 +36,7 @@ namespace Internal { const char kUserDocumentationKey[] = "Help/UserDocumentation"; const char kUpdateDocumentationTask[] = "UpdateDocumentationTask"; +const char kPurgeDocumentationTask[] = "PurgeDocumentationTask"; struct HelpManagerPrivate { @@ -53,7 +54,7 @@ struct HelpManagerPrivate // data for delayed initialization QSet<QString> m_filesToRegister; - QSet<QString> m_nameSpacesToUnregister; + QSet<QString> m_filesToUnregister; QHash<QString, QVariant> m_customValues; QSet<QString> m_userRegisteredFiles; @@ -135,7 +136,7 @@ void HelpManager::registerDocumentation(const QStringList &files) return; } - QFuture<bool> future = Utils::asyncRun(registerDocumentationNow, collectionFilePath(), files); + QFuture<bool> future = Utils::asyncRun(®isterDocumentationNow, collectionFilePath(), files); Utils::onResultReady(future, this, [](bool docsChanged){ if (docsChanged) { d->m_helpEngine->setupData(); @@ -145,45 +146,62 @@ void HelpManager::registerDocumentation(const QStringList &files) ProgressManager::addTask(future, Tr::tr("Update Documentation"), kUpdateDocumentationTask); } -void HelpManager::unregisterDocumentation(const QStringList &fileNames) +static void unregisterDocumentationNow(QPromise<bool> &promise, + const QString collectionFilePath, + const QStringList &files) { - if (fileNames.isEmpty()) - return; - const auto getNamespaces = [](const QStringList &fileNames) { - QMutexLocker locker(&d->m_helpengineMutex); - return Utils::transform(fileNames, [](const QString &filePath) { - return QHelpEngineCore::namespaceName(filePath); - }); - }; - unregisterNamespaces(getNamespaces(fileNames)); -} - -void HelpManager::unregisterNamespaces(const QStringList &nameSpaces) -{ - if (d->m_needsSetup) { - for (const QString &name : nameSpaces) - d->m_nameSpacesToUnregister.insert(name); - return; - } - QMutexLocker locker(&d->m_helpengineMutex); + + promise.setProgressRange(0, files.count()); + promise.setProgressValue(0); + bool docsChanged = false; - for (const QString &nameSpace : nameSpaces) { - const QString filePath = d->m_helpEngine->documentationFileName(nameSpace); + + QHelpEngineCore helpEngine(collectionFilePath); + helpEngine.setReadOnly(false); + helpEngine.setupData(); + for (const QString &file : files) { + if (promise.isCanceled()) + break; + promise.setProgressValue(promise.future().progressValue() + 1); + const QString nameSpace = QHelpEngineCore::namespaceName(file); + const QString filePath = helpEngine.documentationFileName(nameSpace); if (filePath.isEmpty()) // wasn't registered anyhow, ignore continue; - if (d->m_helpEngine->unregisterDocumentation(nameSpace)) { + if (helpEngine.unregisterDocumentation(nameSpace)) { docsChanged = true; - d->m_userRegisteredFiles.remove(filePath); + } else { qWarning() << "Error unregistering namespace '" << nameSpace - << "' from file '" << filePath - << "': " << d->m_helpEngine->error(); + << "' from file '" << filePath + << "': " << helpEngine.error(); } } - locker.unlock(); - if (docsChanged) - emit Core::HelpManager::Signals::instance()->documentationChanged(); + promise.addResult(docsChanged); +} + +void HelpManager::unregisterDocumentation(const QStringList &files) +{ + if (d->m_needsSetup) { + for (const QString &file : files) + d->m_filesToUnregister.insert(file); + return; + } + + if (files.isEmpty()) + return; + + d->m_userRegisteredFiles.subtract(Utils::toSet(files)); + QFuture<bool> future = Utils::asyncRun(&unregisterDocumentationNow, collectionFilePath(), files); + Utils::onResultReady(future, this, [](bool docsChanged){ + if (docsChanged) { + d->m_helpEngine->setupData(); + emit Core::HelpManager::Signals::instance()->documentationChanged(); + } + }); + ProgressManager::addTask(future, + Tr::tr("Purge Outdated Documentation"), + kPurgeDocumentationTask); } void HelpManager::registerUserDocumentation(const QStringList &filePaths) @@ -318,9 +336,9 @@ void HelpManager::setupHelpManager() d->cleanUpDocumentation(); - if (!d->m_nameSpacesToUnregister.isEmpty()) { - m_instance->unregisterNamespaces(Utils::toList(d->m_nameSpacesToUnregister)); - d->m_nameSpacesToUnregister.clear(); + if (!d->m_filesToUnregister.isEmpty()) { + m_instance->unregisterDocumentation(Utils::toList(d->m_filesToUnregister)); + d->m_filesToUnregister.clear(); } if (!d->m_filesToRegister.isEmpty()) { @@ -345,7 +363,7 @@ void HelpManagerPrivate::cleanUpDocumentation() if (!QFileInfo::exists(filePath) || (!m_filesToRegister.contains(filePath) && !m_userRegisteredFiles.contains(filePath))) { - m_nameSpacesToUnregister.insert(nameSpace); + m_filesToUnregister.insert(filePath); } } } diff --git a/src/plugins/help/helpmanager.h b/src/plugins/help/helpmanager.h index 0e2d1fbd5a1..6a5874e7df2 100644 --- a/src/plugins/help/helpmanager.h +++ b/src/plugins/help/helpmanager.h @@ -31,8 +31,6 @@ public: void registerDocumentation(const QStringList &fileNames) override; void unregisterDocumentation(const QStringList &fileNames) override; - static void unregisterNamespaces(const QStringList &nameSpaces); - static void registerUserDocumentation(const QStringList &filePaths); static QSet<QString> userDocumentationPaths(); From 973dbaed98aedeb95ef1841922e42823c914a09c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Wed, 4 Oct 2023 15:15:57 +0200 Subject: [PATCH 1527/1777] PyDapEngine: Start install process directly from the main thread There is no need to start it from a separate thread. Change-Id: I0f560345ed0f02832176a8986a9fbdd97061d3ae Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> --- src/plugins/debugger/dap/pydapengine.cpp | 19 +++++-------------- src/plugins/debugger/dap/pydapengine.h | 2 ++ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index 01ec0f4dcd3..2257aab76ad 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -11,7 +11,6 @@ #include <debugger/debuggermainwindow.h> #include <debugger/debuggertr.h> -#include <utils/async.h> #include <utils/infobar.h> #include <utils/temporarydirectory.h> @@ -200,16 +199,6 @@ void PyDapEngine::quitDebugger() DebuggerEngine::quitDebugger(); } -void installDebugpyPackage(const FilePath &pythonPath) -{ - CommandLine cmd{pythonPath, {"-m", "pip", "install", "debugpy"}}; - Process process; - process.setCommand(cmd); - process.setTerminalMode(TerminalMode::Run); - process.start(); - process.waitForFinished(); -} - bool PyDapEngine::acceptsBreakpoint(const BreakpointParameters &bp) const { return bp.fileName.endsWith(".py"); @@ -269,9 +258,11 @@ void PyDapEngine::setupEngine() info.addCustomButton(Tr::tr("Install debugpy"), [this] { Core::ICore::infoBar()->removeInfo(installDebugPyInfoBarId); Core::ICore::infoBar()->globallySuppressInfo(installDebugPyInfoBarId); - QTimer::singleShot(0, this, [interpreter = runParameters().interpreter] { - Utils::asyncRun(&installDebugpyPackage, interpreter); - }); + m_installProcess.reset(new Process); + m_installProcess->setCommand({runParameters().interpreter, + {"-m", "pip", "install", "debugpy"}}); + m_installProcess->setTerminalMode(TerminalMode::Run); + m_installProcess->start(); }); Core::ICore::infoBar()->addInfo(info); diff --git a/src/plugins/debugger/dap/pydapengine.h b/src/plugins/debugger/dap/pydapengine.h index 1339c7f971a..2c5f53e63a9 100644 --- a/src/plugins/debugger/dap/pydapengine.h +++ b/src/plugins/debugger/dap/pydapengine.h @@ -27,6 +27,8 @@ private: /* Needed for Python support issue:1386 */ const QLoggingCategory &logCategory() override; + + std::unique_ptr<Utils::Process> m_installProcess; }; } // Debugger::Internal From 692fe58427ded3fd7d0b4d0a211be91b5ece50da Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 10 Oct 2023 09:17:04 +0200 Subject: [PATCH 1528/1777] Terminal: Add debug button to easily copy theme Adds a button to copy the current theme to the clipboard in a format suitable for the Qt Creator Theme files. Change-Id: Ib302d0544507b3111675a99f0915323d61d684c5 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/terminal/terminalsettings.cpp | 43 ++++++++++++++++------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index c098ff0ed81..0493237f0c5 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -15,17 +15,21 @@ #include <utils/hostosinfo.h> #include <utils/layoutbuilder.h> #include <utils/pathchooser.h> +#include <utils/stringutils.h> #include <utils/theme/theme.h> #include <QFontComboBox> #include <QJsonDocument> #include <QJsonObject> +#include <QLoggingCategory> #include <QMessageBox> #include <QPushButton> #include <QRegularExpression> #include <QTemporaryFile> #include <QXmlStreamReader> +Q_LOGGING_CATEGORY(schemeLog, "qtc.terminal.scheme", QtWarningMsg) + using namespace Utils; namespace Terminal { @@ -553,6 +557,8 @@ TerminalSettings::TerminalSettings() auto loadThemeButton = new QPushButton(Tr::tr("Load Theme...")); auto resetTheme = new QPushButton(Tr::tr("Reset Theme")); + auto copyTheme = schemeLog().isDebugEnabled() ? new QPushButton(Tr::tr("Copy Theme")) + : nullptr; connect(loadThemeButton, &QPushButton::clicked, this, [] { const FilePath path = FileUtils::getOpenFilePath( @@ -589,20 +595,31 @@ TerminalSettings::TerminalSettings() color.setVolatileValue(color.defaultValue()); }); -// FIXME: Implement and use a Layouting::DropArea item + if (schemeLog().isDebugEnabled()) { + connect(copyTheme, &QPushButton::clicked, this, [this] { + auto toThemeColor = [](const ColorAspect &color) -> QString { + QColor c = color.value(); + QString a = c.alpha() != 255 ? QString("%1").arg(c.alpha(), 2, 16, QChar('0')) + : QString(); + return QString("%1%2%3%4") + .arg(a) + .arg(c.red(), 2, 16, QChar('0')) + .arg(c.green(), 2, 16, QChar('0')) + .arg(c.blue(), 2, 16, QChar('0')); + }; -// DropSupport *dropSupport = new DropSupport; -// connect(dropSupport, -// &DropSupport::filesDropped, -// this, -// [this](const QList<DropSupport::FileSpec> &files) { -// if (files.size() != 1) -// return; + QString theme; + QTextStream stream(&theme); + stream << "TerminalForeground=" << toThemeColor(foregroundColor) << '\n'; + stream << "TerminalBackground=" << toThemeColor(backgroundColor) << '\n'; + stream << "TerminalSelection=" << toThemeColor(selectionColor) << '\n'; + stream << "TerminalFindMatch=" << toThemeColor(findMatchColor) << '\n'; + for (int i = 0; i < 16; ++i) + stream << "TerminalAnsi" << i << '=' << toThemeColor(colors[i]) << '\n'; -// const expected_str<void> result = loadColorScheme(files.at(0).filePath); -// if (!result) -// QMessageBox::warning(Core::ICore::dialogParent(), Tr::tr("Error"), result.error()); -// }); + setClipboardAndSelection(theme); + }); + } // clang-format off return Column { @@ -646,7 +663,7 @@ TerminalSettings::TerminalSettings() colors[14], colors[15] }, Row { - loadThemeButton, resetTheme, st, + loadThemeButton, resetTheme, copyTheme, st, } }, }, From 5e65223451f5282a59bc84193c8ba4f052d275e2 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 10 Oct 2023 14:57:18 +0200 Subject: [PATCH 1529/1777] Update change log With some details on the new features and things that were done in the meantime. Change-Id: Ib42447d472b271e70645e0660cc1fa01f99ea224 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- dist/changelog/changes-12.0.0.md | 53 ++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index e0c3529d924..0107cab7302 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -13,13 +13,47 @@ the public Git repository. For example: What's new? ----------- -* Experimental support for Compiler Explorer -* CMake debugging and the [Debugger Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/) +* Support for Compiler Explorer +* CMake debugging and the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/) * Screen recording +### Compiler Explorer + +Use [Compiler Explorer](https://godbolt.org) in Qt Creator and enter example +code to explore the capabilities of your compilers and interpreters. + +To enable the CompilerExplorer plugin, select +`Help > About Plugins > Utilities > CompilerExplorer`. Then select +`Restart Now` to restart Qt Creator and load the plugin. + +Select `File > New File` and select one of the new `Compiler Explorer` templates +to get started. + +Alternatively, you can open a new `Compiler Explorer` editor via +`Tools > Compiler Explorer > Open Compiler Explorer`. + +Every language, compiler and library that is supported at https://godbolt.org +is also supported in Qt Creator. You can save your Compiler Explorer session as +a `.qtce` file (JSON-based). + +### CMake Debugging and the Debug Adapter Protocol + +Set breakpoints in a CMake file and select `DAP` and `CMake Preset` in `Debug` +mode to debug CMake project files. + +### Screen Recording + +Use `Tools > Record Screen` to record a part of your screen. Requires an +installation of [FFmpeg](https://ffmpeg.org). + +To enable the ScreenRecorder plugin, select +`Help > About Plugins > Utilities > ScreenRecorder`. Then select +`Restart Now` to restart Qt Creator and load the plugin. + General ------- +* Improved the startup performance significantly on various setups * Added the option to keep the sorting from the tool used for the file system index locator filter ([QTCREATORBUG-27789](https://bugreports.qt.io/browse/QTCREATORBUG-27789)) @@ -83,6 +117,11 @@ Editing * Fixed duplicate code when renaming ([QTCREATORBUG-29389](https://bugreports.qt.io/browse/QTCREATORBUG-29389)) +### Language Server Protocol + +* Added support for Language servers that request creating, renaming or deleting of files + ([QTCREATORBUG-29542](https://bugreports.qt.io/browse/QTCREATORBUG-29542)) + ### Copilot * Added support for proxies @@ -118,6 +157,8 @@ Projects vanishes (even temporarily) ([QTCREATORBUG-23163](https://bugreports.qt.io/browse/QTCREATORBUG-23163), [QTCREATORBUG-28273](https://bugreports.qt.io/browse/QTCREATORBUG-28273)) +* Fixed issues with recursive symbolic links + ([QTCREATORBUG-29663](https://bugreports.qt.io/browse/QTCREATORBUG-29663)) ### CMake @@ -128,6 +169,9 @@ Projects * Added support for `CMAKE_SOURCE_DIR` and similar variables for `Jump to File Under Cursor` ([QTCREATORBUG-29467](https://bugreports.qt.io/browse/QTCREATORBUG-29467)) +* Added code completion for various aspects of CMake (local functions and + variables, cache variables, `ENV`, targets, packages, variables added by + `find_package`) * Added support for `CMAKE_UNITY_BUILD` ([QTCREATORBUG-23635](https://bugreports.qt.io/browse/QTCREATORBUG-23635), [QTCREATORBUG-26822](https://bugreports.qt.io/browse/QTCREATORBUG-26822), @@ -161,6 +205,8 @@ Debugging ### C++ * Added support for remote Linux debugging with LLDB +* Fixed warnings about index cache permissions + ([QTCREATORBUG-29556](https://bugreports.qt.io/browse/QTCREATORBUG-29556)) Analyzer -------- @@ -180,6 +226,7 @@ Terminal -------- * Added mouse support +* Added support for Windows Terminal schemes * Fixed `Ctrl+C/V` on Windows Version Control Systems @@ -222,6 +269,7 @@ Esa Törmänen Friedemann Kleint Henning Gruendl Jaroslaw Kobus +Johanna Vanhatapio Johnny Jazeix Jonas Karlsson Jussi Witick @@ -236,6 +284,7 @@ Miikka Heikkinen Olivier De Cannière Olivier Delaune Orgad Shaneh +Pranta Dastider Robert Löhning Sami Shalayel Samuel Ghinet From 7ee0687ad58dd62d833ddd1802abf47ad15b15f4 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 09:29:13 +0200 Subject: [PATCH 1530/1777] SemanticInfoUpdater: Make doUpdate() static Don't operate on the same SemanticInfoUpdaterPrivate instance from 2 threads. Use future synchronizer for quick cancel. Drop using QMutex, as now the threads are separated. Change-Id: I33bb1485ff03751ec5a1481f5be5c21a48ac3fd4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../cppeditor/cppsemanticinfoupdater.cpp | 133 ++++++++---------- 1 file changed, 58 insertions(+), 75 deletions(-) diff --git a/src/plugins/cppeditor/cppsemanticinfoupdater.cpp b/src/plugins/cppeditor/cppsemanticinfoupdater.cpp index 4edc7dac13a..b272b363106 100644 --- a/src/plugins/cppeditor/cppsemanticinfoupdater.cpp +++ b/src/plugins/cppeditor/cppsemanticinfoupdater.cpp @@ -5,18 +5,22 @@ #include "cppmodelmanager.h" -#include <utils/async.h> -#include <utils/qtcassert.h> - #include <cplusplus/Control.h> #include <cplusplus/CppDocument.h> #include <cplusplus/TranslationUnit.h> +#include <extensionsystem/pluginmanager.h> + +#include <utils/async.h> +#include <utils/futuresynchronizer.h> +#include <utils/qtcassert.h> + #include <QLoggingCategory> enum { debug = 0 }; using namespace CPlusPlus; +using namespace Utils; static Q_LOGGING_CATEGORY(log, "qtc.cppeditor.semanticinfoupdater", QtWarningMsg) @@ -24,90 +28,73 @@ namespace CppEditor { class SemanticInfoUpdaterPrivate { -public: - class FuturizedTopLevelDeclarationProcessor: public TopLevelDeclarationProcessor - { - public: - explicit FuturizedTopLevelDeclarationProcessor(QPromise<void> &promise): m_promise(promise) {} - bool processDeclaration(DeclarationAST *) override { return !isCanceled(); } - bool isCanceled() { return m_promise.isCanceled(); } - private: - QPromise<void> &m_promise; - }; - public: explicit SemanticInfoUpdaterPrivate(SemanticInfoUpdater *q); - ~SemanticInfoUpdaterPrivate(); + ~SemanticInfoUpdaterPrivate() { cancelFuture(); } - SemanticInfo semanticInfo() const; + SemanticInfo semanticInfo() const { return m_semanticInfo; } void setSemanticInfo(const SemanticInfo &semanticInfo, bool emitSignal); - SemanticInfo update(const SemanticInfo::Source &source, - bool emitSignalWhenFinished, - FuturizedTopLevelDeclarationProcessor *processor); - bool reuseCurrentSemanticInfo(const SemanticInfo::Source &source, bool emitSignalWhenFinished); - void update_helper(QPromise<void> &promise, const SemanticInfo::Source &source); - + void cancelFuture(); public: SemanticInfoUpdater *q; - mutable QMutex m_lock; SemanticInfo m_semanticInfo; - QFuture<void> m_future; + std::unique_ptr<QFutureWatcher<SemanticInfo>> m_watcher; }; SemanticInfoUpdaterPrivate::SemanticInfoUpdaterPrivate(SemanticInfoUpdater *q) : q(q) -{ -} - -SemanticInfoUpdaterPrivate::~SemanticInfoUpdaterPrivate() -{ - m_future.cancel(); - m_future.waitForFinished(); -} - -SemanticInfo SemanticInfoUpdaterPrivate::semanticInfo() const -{ - QMutexLocker locker(&m_lock); - return m_semanticInfo; -} +{} void SemanticInfoUpdaterPrivate::setSemanticInfo(const SemanticInfo &semanticInfo, bool emitSignal) { - { - QMutexLocker locker(&m_lock); - m_semanticInfo = semanticInfo; - } + m_semanticInfo = semanticInfo; if (emitSignal) { qCDebug(log) << "emiting new info"; emit q->updated(semanticInfo); } } -SemanticInfo SemanticInfoUpdaterPrivate::update(const SemanticInfo::Source &source, - bool emitSignalWhenFinished, - FuturizedTopLevelDeclarationProcessor *processor) +void SemanticInfoUpdaterPrivate::cancelFuture() +{ + if (!m_watcher) + return; + + m_watcher->cancel(); + m_watcher.reset(); +} + +class FuturizedTopLevelDeclarationProcessor: public TopLevelDeclarationProcessor +{ +public: + explicit FuturizedTopLevelDeclarationProcessor(const QFuture<void> &future): m_future(future) {} + bool processDeclaration(DeclarationAST *) override { return !m_future.isCanceled(); } +private: + QFuture<void> m_future; +}; + +static void doUpdate(QPromise<SemanticInfo> &promise, const SemanticInfo::Source &source) { SemanticInfo newSemanticInfo; newSemanticInfo.revision = source.revision; newSemanticInfo.snapshot = source.snapshot; - Document::Ptr doc = newSemanticInfo.snapshot.preprocessedDocument(source.code, - Utils::FilePath::fromString(source.fileName)); - if (processor) - doc->control()->setTopLevelDeclarationProcessor(processor); + Document::Ptr doc = newSemanticInfo.snapshot.preprocessedDocument( + source.code, FilePath::fromString(source.fileName)); + + FuturizedTopLevelDeclarationProcessor processor(QFuture<void>(promise.future())); + doc->control()->setTopLevelDeclarationProcessor(&processor); doc->check(); - if (processor && processor->isCanceled()) + if (promise.isCanceled()) newSemanticInfo.complete = false; newSemanticInfo.doc = doc; qCDebug(log) << "update() for source revision:" << source.revision << "canceled:" << !newSemanticInfo.complete; - setSemanticInfo(newSemanticInfo, emitSignalWhenFinished); - return newSemanticInfo; + promise.addResult(newSemanticInfo); } bool SemanticInfoUpdaterPrivate::reuseCurrentSemanticInfo(const SemanticInfo::Source &source, @@ -135,51 +122,47 @@ bool SemanticInfoUpdaterPrivate::reuseCurrentSemanticInfo(const SemanticInfo::So return false; } -void SemanticInfoUpdaterPrivate::update_helper(QPromise<void> &promise, - const SemanticInfo::Source &source) -{ - FuturizedTopLevelDeclarationProcessor processor(promise); - update(source, true, &processor); -} - SemanticInfoUpdater::SemanticInfoUpdater() : d(new SemanticInfoUpdaterPrivate(this)) { } -SemanticInfoUpdater::~SemanticInfoUpdater() -{ - d->m_future.cancel(); - d->m_future.waitForFinished(); -} +SemanticInfoUpdater::~SemanticInfoUpdater() = default; SemanticInfo SemanticInfoUpdater::update(const SemanticInfo::Source &source) { qCDebug(log) << "update() - synchronous"; - d->m_future.cancel(); + d->cancelFuture(); const bool emitSignalWhenFinished = false; - if (d->reuseCurrentSemanticInfo(source, emitSignalWhenFinished)) { - d->m_future = QFuture<void>(); + if (d->reuseCurrentSemanticInfo(source, emitSignalWhenFinished)) return semanticInfo(); - } - return d->update(source, emitSignalWhenFinished, nullptr); + QPromise<SemanticInfo> dummy; + dummy.start(); + doUpdate(dummy, source); + const SemanticInfo result = dummy.future().result(); + d->setSemanticInfo(result, emitSignalWhenFinished); + return result; } void SemanticInfoUpdater::updateDetached(const SemanticInfo::Source &source) { qCDebug(log) << "updateDetached() - asynchronous"; - d->m_future.cancel(); + d->cancelFuture(); const bool emitSignalWhenFinished = true; - if (d->reuseCurrentSemanticInfo(source, emitSignalWhenFinished)) { - d->m_future = QFuture<void>(); + if (d->reuseCurrentSemanticInfo(source, emitSignalWhenFinished)) return; - } - d->m_future = Utils::asyncRun(CppModelManager::sharedThreadPool(), - &SemanticInfoUpdaterPrivate::update_helper, d.data(), source); + d->m_watcher.reset(new QFutureWatcher<SemanticInfo>); + connect(d->m_watcher.get(), &QFutureWatcherBase::finished, this, [this] { + d->setSemanticInfo(d->m_watcher->result(), true); + d->m_watcher.release()->deleteLater(); + }); + const auto future = Utils::asyncRun(CppModelManager::sharedThreadPool(), doUpdate, source); + d->m_watcher->setFuture(future); + ExtensionSystem::PluginManager::futureSynchronizer()->addFuture(future); } SemanticInfo SemanticInfoUpdater::semanticInfo() const From 716c1948463bd9f424525f005943a9bddfa1a5ad Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 10 Oct 2023 14:39:36 +0200 Subject: [PATCH 1531/1777] KitManager: Use static methods instead of lambdas Get rid of kitMatchesAbiOfBinary lambda - use kitMatchesAbiList directly instead. Change-Id: Iefd142b97967517b9c5abbd0721470a6ded584ed Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/kitmanager.cpp | 125 ++++++++++----------- 1 file changed, 62 insertions(+), 63 deletions(-) diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 792d7e86a63..73d9d48feab 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -153,6 +153,65 @@ void KitManager::destroy() d = nullptr; } +static bool kitMatchesAbiList(const Kit *kit, const Abis &abis) +{ + const QList<ToolChain *> toolchains = ToolChainKitAspect::toolChains(kit); + for (const ToolChain * const tc : toolchains) { + const Abi tcAbi = tc->targetAbi(); + for (const Abi &abi : abis) { + if (tcAbi.os() == abi.os() && tcAbi.architecture() == abi.architecture() + && (tcAbi.os() != Abi::LinuxOS || tcAbi.osFlavor() == abi.osFlavor())) { + return true; + } + } + } + return false; +}; + +static bool isHostKit(const Kit *kit) +{ + const Abi hostAbi = Abi::hostAbi(); + if (HostOsInfo::isMacHost() && hostAbi.architecture() == Abi::ArmArchitecture) { + const Abi x86Abi(Abi::X86Architecture, + hostAbi.os(), + hostAbi.osFlavor(), + hostAbi.binaryFormat(), + hostAbi.wordWidth()); + + return kitMatchesAbiList(kit, {hostAbi, x86Abi}); + } + return kitMatchesAbiList(kit, {hostAbi}); +}; + +static Id deviceTypeForKit(const Kit *kit) +{ + if (isHostKit(kit)) + return Constants::DESKTOP_DEVICE_TYPE; + const QList<ToolChain *> toolchains = ToolChainKitAspect::toolChains(kit); + for (const ToolChain * const tc : toolchains) { + const Abi tcAbi = tc->targetAbi(); + switch (tcAbi.os()) { + case Abi::BareMetalOS: + return BareMetal::Constants::BareMetalOsType; + case Abi::BsdOS: + case Abi::DarwinOS: + case Abi::UnixOS: + return RemoteLinux::Constants::GenericLinuxOsType; + case Abi::LinuxOS: + if (tcAbi.osFlavor() == Abi::AndroidLinuxFlavor) + return Android::Constants::ANDROID_DEVICE_TYPE; + return RemoteLinux::Constants::GenericLinuxOsType; + case Abi::QnxOS: + return Qnx::Constants::QNX_QNX_OS_TYPE; + case Abi::VxWorks: + return "VxWorks.Device.Type"; + default: + break; + } + } + return Constants::DESKTOP_DEVICE_TYPE; +}; + void KitManager::restoreKits() { NANOTRACE_SCOPE("ProjectExplorer", "KitManager::restoreKits"); @@ -233,28 +292,11 @@ void KitManager::restoreKits() } } - static const auto kitMatchesAbiList = [](const Kit *kit, const Abis &abis) { - const QList<ToolChain *> toolchains = ToolChainKitAspect::toolChains(kit); - for (const ToolChain * const tc : toolchains) { - const Abi tcAbi = tc->targetAbi(); - for (const Abi &abi : abis) { - if (tcAbi.os() == abi.os() && tcAbi.architecture() == abi.architecture() - && (tcAbi.os() != Abi::LinuxOS || tcAbi.osFlavor() == abi.osFlavor())) { - return true; - } - } - } - return false; - }; - const Abis abisOfBinary = d->m_binaryForKit.isEmpty() ? Abis() : Abi::abisOfBinary(d->m_binaryForKit); - const auto kitMatchesAbiOfBinary = [&abisOfBinary](const Kit *kit) { - return kitMatchesAbiList(kit, abisOfBinary); - }; const bool haveKitForBinary = abisOfBinary.isEmpty() - || contains(resultList, [&kitMatchesAbiOfBinary](const std::unique_ptr<Kit> &kit) { - return kitMatchesAbiOfBinary(kit.get()); + || contains(resultList, [&abisOfBinary](const std::unique_ptr<Kit> &kit) { + return kitMatchesAbiList(kit.get(), abisOfBinary); }); Kit *kitForBinary = nullptr; @@ -302,49 +344,6 @@ void KitManager::restoreKits() bestTc = tc; } - static const auto isHostKit = [](const Kit *kit) { - const Abi hostAbi = Abi::hostAbi(); - if (HostOsInfo::isMacHost() && hostAbi.architecture() == Abi::ArmArchitecture) { - const Abi x86Abi(Abi::X86Architecture, - hostAbi.os(), - hostAbi.osFlavor(), - hostAbi.binaryFormat(), - hostAbi.wordWidth()); - - return kitMatchesAbiList(kit, {hostAbi, x86Abi}); - } - - return kitMatchesAbiList(kit, {hostAbi}); - }; - - static const auto deviceTypeForKit = [](const Kit *kit) { - if (isHostKit(kit)) - return Constants::DESKTOP_DEVICE_TYPE; - const QList<ToolChain *> toolchains = ToolChainKitAspect::toolChains(kit); - for (const ToolChain * const tc : toolchains) { - const Abi tcAbi = tc->targetAbi(); - switch (tcAbi.os()) { - case Abi::BareMetalOS: - return BareMetal::Constants::BareMetalOsType; - case Abi::BsdOS: - case Abi::DarwinOS: - case Abi::UnixOS: - return RemoteLinux::Constants::GenericLinuxOsType; - case Abi::LinuxOS: - if (tcAbi.osFlavor() == Abi::AndroidLinuxFlavor) - return Android::Constants::ANDROID_DEVICE_TYPE; - return RemoteLinux::Constants::GenericLinuxOsType; - case Abi::QnxOS: - return Qnx::Constants::QNX_QNX_OS_TYPE; - case Abi::VxWorks: - return "VxWorks.Device.Type"; - default: - break; - } - } - return Constants::DESKTOP_DEVICE_TYPE; - }; - // Create temporary kits for all toolchains found. decltype(resultList) tempList; for (auto it = uniqueToolchains.cbegin(); it != uniqueToolchains.cend(); ++it) { @@ -380,7 +379,7 @@ void KitManager::restoreKits() }); if (!abisOfBinary.isEmpty()) { for (auto it = tempList.begin(); it != tempList.end(); ++it) { - if (kitMatchesAbiOfBinary(it->get())) { + if (kitMatchesAbiList(it->get(), abisOfBinary)) { kitForBinary = it->get(); resultList.emplace_back(std::move(*it)); tempList.erase(it); From d021f9158beafde43337c261e6549778850465a8 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 10:00:53 +0200 Subject: [PATCH 1532/1777] SemanticInfoUpdater: Simplify internal implementation Change-Id: If9913ccbc66d35608d18286ea3ca12d751ad2115 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../cppeditor/cppsemanticinfoupdater.cpp | 61 +++++++------------ 1 file changed, 21 insertions(+), 40 deletions(-) diff --git a/src/plugins/cppeditor/cppsemanticinfoupdater.cpp b/src/plugins/cppeditor/cppsemanticinfoupdater.cpp index b272b363106..e398c14b861 100644 --- a/src/plugins/cppeditor/cppsemanticinfoupdater.cpp +++ b/src/plugins/cppeditor/cppsemanticinfoupdater.cpp @@ -29,34 +29,14 @@ namespace CppEditor { class SemanticInfoUpdaterPrivate { public: - explicit SemanticInfoUpdaterPrivate(SemanticInfoUpdater *q); ~SemanticInfoUpdaterPrivate() { cancelFuture(); } - SemanticInfo semanticInfo() const { return m_semanticInfo; } - void setSemanticInfo(const SemanticInfo &semanticInfo, bool emitSignal); - - bool reuseCurrentSemanticInfo(const SemanticInfo::Source &source, bool emitSignalWhenFinished); - void cancelFuture(); -public: - SemanticInfoUpdater *q; + SemanticInfo m_semanticInfo; std::unique_ptr<QFutureWatcher<SemanticInfo>> m_watcher; }; -SemanticInfoUpdaterPrivate::SemanticInfoUpdaterPrivate(SemanticInfoUpdater *q) - : q(q) -{} - -void SemanticInfoUpdaterPrivate::setSemanticInfo(const SemanticInfo &semanticInfo, bool emitSignal) -{ - m_semanticInfo = semanticInfo; - if (emitSignal) { - qCDebug(log) << "emiting new info"; - emit q->updated(semanticInfo); - } -} - void SemanticInfoUpdaterPrivate::cancelFuture() { if (!m_watcher) @@ -97,11 +77,9 @@ static void doUpdate(QPromise<SemanticInfo> &promise, const SemanticInfo::Source promise.addResult(newSemanticInfo); } -bool SemanticInfoUpdaterPrivate::reuseCurrentSemanticInfo(const SemanticInfo::Source &source, - bool emitSignalWhenFinished) +static std::optional<SemanticInfo> canReuseSemanticInfo( + const SemanticInfo ¤tSemanticInfo, const SemanticInfo::Source &source) { - const SemanticInfo currentSemanticInfo = semanticInfo(); - if (!source.force && currentSemanticInfo.complete && currentSemanticInfo.revision == source.revision @@ -114,18 +92,15 @@ bool SemanticInfoUpdaterPrivate::reuseCurrentSemanticInfo(const SemanticInfo::So newSemanticInfo.revision = source.revision; newSemanticInfo.snapshot = source.snapshot; newSemanticInfo.doc = currentSemanticInfo.doc; - setSemanticInfo(newSemanticInfo, emitSignalWhenFinished); qCDebug(log) << "re-using current semantic info, source revision:" << source.revision; - return true; + return newSemanticInfo; } - - return false; + return {}; } SemanticInfoUpdater::SemanticInfoUpdater() - : d(new SemanticInfoUpdaterPrivate(this)) -{ -} + : d(new SemanticInfoUpdaterPrivate) +{} SemanticInfoUpdater::~SemanticInfoUpdater() = default; @@ -134,15 +109,17 @@ SemanticInfo SemanticInfoUpdater::update(const SemanticInfo::Source &source) qCDebug(log) << "update() - synchronous"; d->cancelFuture(); - const bool emitSignalWhenFinished = false; - if (d->reuseCurrentSemanticInfo(source, emitSignalWhenFinished)) - return semanticInfo(); + const auto info = canReuseSemanticInfo(d->m_semanticInfo, source); + if (info) { + d->m_semanticInfo = *info; + return d->m_semanticInfo; + } QPromise<SemanticInfo> dummy; dummy.start(); doUpdate(dummy, source); const SemanticInfo result = dummy.future().result(); - d->setSemanticInfo(result, emitSignalWhenFinished); + d->m_semanticInfo = result; return result; } @@ -151,13 +128,17 @@ void SemanticInfoUpdater::updateDetached(const SemanticInfo::Source &source) qCDebug(log) << "updateDetached() - asynchronous"; d->cancelFuture(); - const bool emitSignalWhenFinished = true; - if (d->reuseCurrentSemanticInfo(source, emitSignalWhenFinished)) + const auto info = canReuseSemanticInfo(d->m_semanticInfo, source); + if (info) { + d->m_semanticInfo = *info; + emit updated(d->m_semanticInfo); return; + } d->m_watcher.reset(new QFutureWatcher<SemanticInfo>); connect(d->m_watcher.get(), &QFutureWatcherBase::finished, this, [this] { - d->setSemanticInfo(d->m_watcher->result(), true); + d->m_semanticInfo = d->m_watcher->result(); + emit updated(d->m_semanticInfo); d->m_watcher.release()->deleteLater(); }); const auto future = Utils::asyncRun(CppModelManager::sharedThreadPool(), doUpdate, source); @@ -167,7 +148,7 @@ void SemanticInfoUpdater::updateDetached(const SemanticInfo::Source &source) SemanticInfo SemanticInfoUpdater::semanticInfo() const { - return d->semanticInfo(); + return d->m_semanticInfo; } } // namespace CppEditor From 4aef48de5ec6987957593b24fe5cb3ce25639103 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 9 Oct 2023 15:14:59 +0200 Subject: [PATCH 1533/1777] Utils: Add AspectList::createAndAddItem Adds a function to add a "default" constructed new item to the list. Change-Id: I3d826b6f3e3705ae431efa5d778219f431509ea8 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/libs/utils/aspects.cpp | 5 +++++ src/libs/utils/aspects.h | 1 + .../compilerexplorereditor.cpp | 19 ++++++++----------- .../compilerexplorer/compilerexplorereditor.h | 1 - .../compilerexplorersettings.cpp | 6 ------ .../compilerexplorersettings.h | 2 -- 6 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index fc78b7d2d86..b14a429ed92 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -3127,6 +3127,11 @@ QList<std::shared_ptr<BaseAspect>> AspectList::volatileItems() const return d->volatileItems; } +std::shared_ptr<BaseAspect> AspectList::createAndAddItem() +{ + return addItem(d->createItem()); +} + std::shared_ptr<BaseAspect> AspectList::addItem(const std::shared_ptr<BaseAspect> &item) { if (undoStack()) diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index d5d47a79d7e..e46ce5ab9b8 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -1026,6 +1026,7 @@ public: QList<std::shared_ptr<BaseAspect>> items() const; QList<std::shared_ptr<BaseAspect>> volatileItems() const; + std::shared_ptr<BaseAspect> createAndAddItem(); std::shared_ptr<BaseAspect> addItem(const std::shared_ptr<BaseAspect> &item); std::shared_ptr<BaseAspect> actualAddItem(const std::shared_ptr<BaseAspect> &item); diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 3e11f667d6c..7946e92b821 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -216,7 +216,10 @@ SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &se auto addCompilerButton = new QPushButton; addCompilerButton->setText(Tr::tr("Add compiler")); - connect(addCompilerButton, &QPushButton::clicked, this, &SourceEditorWidget::addCompiler); + connect(addCompilerButton, + &QPushButton::clicked, + &settings->compilers, + &AspectList::createAndAddItem); auto removeSourceButton = new QPushButton; removeSourceButton->setIcon(Utils::Icons::EDIT_CLEAR.icon()); @@ -575,12 +578,6 @@ void EditorWidget::addSourceEditor(const std::shared_ptr<SourceSettings> &source setupHelpWidget(); }); - connect(sourceEditor, &SourceEditorWidget::addCompiler, this, [sourceSettings]() { - auto newCompiler = std::make_shared<CompilerSettings>(sourceSettings->apiConfigFunction()); - newCompiler->setLanguageId(sourceSettings->languageId()); - sourceSettings->compilers.addItem(newCompiler); - }); - connect(sourceEditor, &SourceEditorWidget::gotFocus, this, [this]() { m_actionHandler.updateCurrentEditor(); }); @@ -725,8 +722,8 @@ QWidget *EditorWidget::createHelpWidget() const auto w = new HelperWidget; connect(w, &HelperWidget::addSource, - m_document->settings(), - &CompilerExplorerSettings::addNewSource); + &m_document->settings()->m_sources, + &AspectList::createAndAddItem); return w; } @@ -792,8 +789,8 @@ QWidget *Editor::toolBar() connect(newSource, &QAction::triggered, - m_document->settings(), - &CompilerExplorerSettings::addNewSource); + &m_document->settings()->m_sources, + &AspectList::createAndAddItem); } return m_toolBar.get(); diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.h b/src/plugins/compilerexplorer/compilerexplorereditor.h index 2db21e4808c..510e5e9eb3c 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.h +++ b/src/plugins/compilerexplorer/compilerexplorereditor.h @@ -130,7 +130,6 @@ public: signals: void sourceCodeChanged(); - void addCompiler(); void remove(); void gotFocus(); diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp index 94059052d3b..8accdbcc214 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.cpp +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -337,10 +337,4 @@ CompilerExplorerSettings::CompilerExplorerSettings() CompilerExplorerSettings::~CompilerExplorerSettings() = default; -void CompilerExplorerSettings::addNewSource() -{ - auto newSource = std::make_shared<SourceSettings>([this] { return apiConfig(); }); - m_sources.addItem(newSource); -} - } // namespace CompilerExplorer diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.h b/src/plugins/compilerexplorer/compilerexplorersettings.h index fadb03798f6..64f67122fe6 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.h +++ b/src/plugins/compilerexplorer/compilerexplorersettings.h @@ -41,8 +41,6 @@ public: return Api::Config(m_networkAccessManager, compilerExplorerUrl()); } - void addNewSource(); - QNetworkAccessManager *networkAccessManager() const { return m_networkAccessManager; } private: From 03cca64eea78f892615552fbcb2a15a99201a56e Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 10 Oct 2023 16:52:48 +0200 Subject: [PATCH 1534/1777] ProjectExplorer: Add non-translatable text options to text edit fields LineEdit and TextEdit have a couple of text options which start with "tr". These strings can be translated via Qt Linguist. In some cases, these text options contain macros or even JavaScript code which must not be translated. Translation of these fields can easily break the wizard. This change adds the possibility to set non-translatable options for LineEdits and TextEdits "(tr)Text", "(tr)DisabledText" and "(tr)Placeholder" in the .json files. Task-number: QTCREATORBUG-29649 Change-Id: I278a0bec848888cf96bdb49306e319c14a09236c Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- ...eator-projects-custom-wizards-json.qdocinc | 25 ++++++++++++++----- .../jsonwizard/jsonfieldpage.cpp | 21 ++++++++++++---- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc index 852bfeb2461..d9cd6573c36 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards-json.qdocinc @@ -793,16 +793,24 @@ \list - \li \c trText specifies the default text to display. + \li \c trText specifies the translatable default text to display. - \li \c trDisabledText specifies the text to display in a disabled field. + \li \c text specifies the non-translatable default text to display. + + \li \c trDisabledText specifies the translatable text to display in a + disabled field. + + \li \c disabledText specifies the non-translatable text to display in + a disabled field. \li \c completion lists existing \c namespaces for the class name line edit and existing \c classes for the base class line edit. This value replaces the history completer that is usually available for such fields. - \li \c trPlaceholder specifies the placeholder text. + \li \c trPlaceholder specifies the translatable placeholder text. + + \li \c placeholder specifies the non-translatable placeholder text. \li \c validator specifies a QRegularExpression to validate the line edit against. @@ -886,10 +894,15 @@ \list - \li \c trText specifies the text to display. + \li \c trText specifies the translatable text to display. - \li \c trDisabledText specifies the text to display when the text edit - is disabled. + \li \c text specifies the non-translatable text to display. + + \li \c trDisabledText specifies the translatable text to display when + the text edit is disabled. + + \li \c disabledText specifies the non-translatable text to display when + the text edit is disabled. \li \c richText is set to \c true for rich text, otherwise \c{false}. diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp index 52f3b2bc59a..49a0ed89571 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp @@ -81,6 +81,17 @@ static Key fullSettingsKey(const QString &fieldKey) return "Wizards/" + keyFromString(fieldKey); } +static QString translatedOrUntranslatedText(QVariantMap &map, const QString &key) +{ + if (key.size() >= 1) { + const QString trKey = "tr" + key.at(0).toUpper() + key.mid(1); // "text" -> "trText" + const QString trValue = JsonWizardFactory::localizedString(consumeValue(map, trKey).toString()); + if (!trValue.isEmpty()) + return trValue; + } + + return consumeValue(map, key).toString(); +} // -------------------------------------------------------------------- // Helper: @@ -489,9 +500,9 @@ bool LineEditField::parseData(const QVariant &data, QString *errorMessage) QVariantMap tmp = data.toMap(); m_isPassword = consumeValue(tmp, "isPassword", false).toBool(); - m_defaultText = JsonWizardFactory::localizedString(consumeValue(tmp, "trText").toString()); - m_disabledText = JsonWizardFactory::localizedString(consumeValue(tmp, "trDisabledText").toString()); - m_placeholderText = JsonWizardFactory::localizedString(consumeValue(tmp, "trPlaceholder").toString()); + m_defaultText = translatedOrUntranslatedText(tmp, "text"); + m_disabledText = translatedOrUntranslatedText(tmp, "disabledText"); + m_placeholderText = translatedOrUntranslatedText(tmp, "placeholder"); m_historyId = consumeValue(tmp, "historyId").toString(); m_restoreLastHistoryItem = consumeValue(tmp, "restoreLastHistoryItem", false).toBool(); QString pattern = consumeValue(tmp, "validator").toString(); @@ -686,8 +697,8 @@ bool TextEditField::parseData(const QVariant &data, QString *errorMessage) QVariantMap tmp = data.toMap(); - m_defaultText = JsonWizardFactory::localizedString(consumeValue(tmp, "trText").toString()); - m_disabledText = JsonWizardFactory::localizedString(consumeValue(tmp, "trDisabledText").toString()); + m_defaultText = translatedOrUntranslatedText(tmp, "text"); + m_disabledText = translatedOrUntranslatedText(tmp, "disabledText"); m_acceptRichText = consumeValue(tmp, "richText", true).toBool(); warnAboutUnsupportedKeys(tmp, name(), type()); From f73d28860987c91b3672fced0a38715533e59028 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 10 Oct 2023 09:12:17 +0200 Subject: [PATCH 1535/1777] Terminal: Fix default colors for dark themes Certain colors, especially red, were pretty hard to read with the selected default colors on dark themes. Change-Id: I9f5a2b5f14113499dbb662e1cbcc2b833952f201 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- share/qtcreator/themes/dark.creatortheme | 34 +++++++++---------- share/qtcreator/themes/design.creatortheme | 34 +++++++++---------- share/qtcreator/themes/flat-dark.creatortheme | 34 +++++++++---------- 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/share/qtcreator/themes/dark.creatortheme b/share/qtcreator/themes/dark.creatortheme index 09378040b1d..e5b312ed159 100644 --- a/share/qtcreator/themes/dark.creatortheme +++ b/share/qtcreator/themes/dark.creatortheme @@ -477,26 +477,26 @@ QmlDesigner_FormeditorBackgroundColor=qmlDesignerButtonColor QmlDesigner_AlternateBackgroundColor=qmlDesignerButtonColor QmlDesigner_ScrollBarHandleColor=ff505050 -TerminalForeground=ffffffff +TerminalForeground=ffffff TerminalBackground=normalBackground -TerminalSelection=7fffffff +TerminalSelection=3fd1d1d1 TerminalFindMatch=7fffff00 -TerminalAnsi0=000000 -TerminalAnsi1=8b1b10 -TerminalAnsi2=4aa32e -TerminalAnsi3=9a9a2f -TerminalAnsi4=0058D1 +TerminalAnsi0=151515 +TerminalAnsi1=ac4142 +TerminalAnsi2=7e8e50 +TerminalAnsi3=e5b567 +TerminalAnsi4=6c99bb TerminalAnsi5=a320ac -TerminalAnsi6=49a3b0 -TerminalAnsi7=bfbfbf -TerminalAnsi8=666666 -TerminalAnsi9=d22d1f -TerminalAnsi10=62d63f -TerminalAnsi11=e5e54b -TerminalAnsi12=003EFF -TerminalAnsi13=d22dde -TerminalAnsi14=69e2e4 -TerminalAnsi15=e5e5e6 +TerminalAnsi6=7dd6cf +TerminalAnsi7=d0d0d0 +TerminalAnsi8=505050 +TerminalAnsi9=d05e5b +TerminalAnsi10=a7b773 +TerminalAnsi11=ffd184 +TerminalAnsi12=94c8ea +TerminalAnsi13=f257fb +TerminalAnsi14=a1fcf7 +TerminalAnsi15=ffffff [Flags] ComboBoxDrawTextShadow=false diff --git a/share/qtcreator/themes/design.creatortheme b/share/qtcreator/themes/design.creatortheme index f2a12766b9d..6abbcc5de49 100644 --- a/share/qtcreator/themes/design.creatortheme +++ b/share/qtcreator/themes/design.creatortheme @@ -537,26 +537,26 @@ PaletteTextDisabled=textDisabled PaletteMid=ffafafaf PalettePlaceholderText=ff808081 -TerminalForeground=ffffffff +TerminalForeground=ffffff TerminalBackground=normalBackground -TerminalSelection=7fffffff +TerminalSelection=3fd1d1d1 TerminalFindMatch=7fffff00 -TerminalAnsi0=000000 -TerminalAnsi1=8b1b10 -TerminalAnsi2=4aa32e -TerminalAnsi3=9a9a2f -TerminalAnsi4=0058D1 +TerminalAnsi0=151515 +TerminalAnsi1=ac4142 +TerminalAnsi2=7e8e50 +TerminalAnsi3=e5b567 +TerminalAnsi4=6c99bb TerminalAnsi5=a320ac -TerminalAnsi6=49a3b0 -TerminalAnsi7=bfbfbf -TerminalAnsi8=666666 -TerminalAnsi9=d22d1f -TerminalAnsi10=62d63f -TerminalAnsi11=e5e54b -TerminalAnsi12=003EFF -TerminalAnsi13=d22dde -TerminalAnsi14=69e2e4 -TerminalAnsi15=e5e5e6 +TerminalAnsi6=7dd6cf +TerminalAnsi7=d0d0d0 +TerminalAnsi8=505050 +TerminalAnsi9=d05e5b +TerminalAnsi10=a7b773 +TerminalAnsi11=ffd184 +TerminalAnsi12=94c8ea +TerminalAnsi13=f257fb +TerminalAnsi14=a1fcf7 +TerminalAnsi15=ffffff [Flags] ComboBoxDrawTextShadow=false diff --git a/share/qtcreator/themes/flat-dark.creatortheme b/share/qtcreator/themes/flat-dark.creatortheme index 7803e42bc27..d015c149f0b 100644 --- a/share/qtcreator/themes/flat-dark.creatortheme +++ b/share/qtcreator/themes/flat-dark.creatortheme @@ -481,26 +481,26 @@ PaletteTextDisabled=textDisabled PaletteMid=ffa0a0a0 PalettePlaceholderText=ff7f7f80 -TerminalForeground=ffffffff +TerminalForeground=ffffff TerminalBackground=normalBackground -TerminalSelection=7fffffff +TerminalSelection=3fd1d1d1 TerminalFindMatch=7fffff00 -TerminalAnsi0=000000 -TerminalAnsi1=8b1b10 -TerminalAnsi2=4aa32e -TerminalAnsi3=9a9a2f -TerminalAnsi4=0058D1 +TerminalAnsi0=151515 +TerminalAnsi1=ac4142 +TerminalAnsi2=7e8e50 +TerminalAnsi3=e5b567 +TerminalAnsi4=6c99bb TerminalAnsi5=a320ac -TerminalAnsi6=49a3b0 -TerminalAnsi7=bfbfbf -TerminalAnsi8=666666 -TerminalAnsi9=d22d1f -TerminalAnsi10=62d63f -TerminalAnsi11=e5e54b -TerminalAnsi12=003EFF -TerminalAnsi13=d22dde -TerminalAnsi14=69e2e4 -TerminalAnsi15=e5e5e6 +TerminalAnsi6=7dd6cf +TerminalAnsi7=d0d0d0 +TerminalAnsi8=505050 +TerminalAnsi9=d05e5b +TerminalAnsi10=a7b773 +TerminalAnsi11=ffd184 +TerminalAnsi12=94c8ea +TerminalAnsi13=f257fb +TerminalAnsi14=a1fcf7 +TerminalAnsi15=ffffff [Flags] ComboBoxDrawTextShadow=false From c4ea695411b425ec7605b72a57aba4a6ec6b89d0 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 10 Oct 2023 10:19:53 +0200 Subject: [PATCH 1536/1777] Terminal: Improve color tooltips Change-Id: Ifc2fdb4369767a65c79a784d1f68caac81497db1 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/terminal/terminalsettings.cpp | 60 ++++++++++------------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index 0493237f0c5..63fcdac3bb1 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -69,11 +69,13 @@ static QString defaultShell() void setupColor(TerminalSettings *settings, ColorAspect &color, const QString &label, - const QColor &defaultColor) + const QColor &defaultColor, + const QString &humanReadableName = {}) { color.setSettingsKey(keyFromString(label)); color.setDefaultValue(defaultColor); - color.setToolTip(Tr::tr("The color used for %1.").arg(label)); + color.setToolTip(Tr::tr("The color used for %1.") + .arg(humanReadableName.isEmpty() ? label : humanReadableName)); settings->registerAspect(&color); } @@ -502,47 +504,37 @@ TerminalSettings::TerminalSettings() enableMouseTracking.setToolTip(Tr::tr("Enables mouse tracking in the terminal.")); enableMouseTracking.setDefaultValue(true); - setupColor(this, - foregroundColor, - "Foreground", - Utils::creatorTheme()->color(Theme::TerminalForeground)); - setupColor(this, - backgroundColor, - "Background", - Utils::creatorTheme()->color(Theme::TerminalBackground)); - setupColor(this, - selectionColor, - "Selection", - Utils::creatorTheme()->color(Theme::TerminalSelection)); + Theme *theme = Utils::creatorTheme(); - setupColor(this, - findMatchColor, - "Find matches", - Utils::creatorTheme()->color(Theme::TerminalFindMatch)); + setupColor(this, foregroundColor, "Foreground", theme->color(Theme::TerminalForeground)); + setupColor(this, backgroundColor, "Background", theme->color(Theme::TerminalBackground)); + setupColor(this, selectionColor, "Selection", theme->color(Theme::TerminalSelection)); - setupColor(this, colors[0], "0", Utils::creatorTheme()->color(Theme::TerminalAnsi0)); - setupColor(this, colors[8], "8", Utils::creatorTheme()->color(Theme::TerminalAnsi8)); + setupColor(this, findMatchColor, "Find matches", theme->color(Theme::TerminalFindMatch)); - setupColor(this, colors[1], "1", Utils::creatorTheme()->color(Theme::TerminalAnsi1)); - setupColor(this, colors[9], "9", Utils::creatorTheme()->color(Theme::TerminalAnsi9)); + setupColor(this, colors[0], "0", theme->color(Theme::TerminalAnsi0), "black"); + setupColor(this, colors[8], "8", theme->color(Theme::TerminalAnsi8), "bright black"); - setupColor(this, colors[2], "2", Utils::creatorTheme()->color(Theme::TerminalAnsi2)); - setupColor(this, colors[10], "10", Utils::creatorTheme()->color(Theme::TerminalAnsi10)); + setupColor(this, colors[1], "1", theme->color(Theme::TerminalAnsi1), "red"); + setupColor(this, colors[9], "9", theme->color(Theme::TerminalAnsi9), "bright red"); - setupColor(this, colors[3], "3", Utils::creatorTheme()->color(Theme::TerminalAnsi3)); - setupColor(this, colors[11], "11", Utils::creatorTheme()->color(Theme::TerminalAnsi11)); + setupColor(this, colors[2], "2", theme->color(Theme::TerminalAnsi2), "green"); + setupColor(this, colors[10], "10", theme->color(Theme::TerminalAnsi10), "bright green"); - setupColor(this, colors[4], "4", Utils::creatorTheme()->color(Theme::TerminalAnsi4)); - setupColor(this, colors[12], "12", Utils::creatorTheme()->color(Theme::TerminalAnsi12)); + setupColor(this, colors[3], "3", theme->color(Theme::TerminalAnsi3), "yellow"); + setupColor(this, colors[11], "11", theme->color(Theme::TerminalAnsi11), "bright yellow"); - setupColor(this, colors[5], "5", Utils::creatorTheme()->color(Theme::TerminalAnsi5)); - setupColor(this, colors[13], "13", Utils::creatorTheme()->color(Theme::TerminalAnsi13)); + setupColor(this, colors[4], "4", theme->color(Theme::TerminalAnsi4), "blue"); + setupColor(this, colors[12], "12", theme->color(Theme::TerminalAnsi12), "bright blue"); - setupColor(this, colors[6], "6", Utils::creatorTheme()->color(Theme::TerminalAnsi6)); - setupColor(this, colors[14], "14", Utils::creatorTheme()->color(Theme::TerminalAnsi14)); + setupColor(this, colors[5], "5", theme->color(Theme::TerminalAnsi5), "magenta"); + setupColor(this, colors[13], "13", theme->color(Theme::TerminalAnsi13), "bright magenta"); - setupColor(this, colors[7], "7", Utils::creatorTheme()->color(Theme::TerminalAnsi7)); - setupColor(this, colors[15], "15", Utils::creatorTheme()->color(Theme::TerminalAnsi15)); + setupColor(this, colors[6], "6", theme->color(Theme::TerminalAnsi6), "cyan"); + setupColor(this, colors[14], "14", theme->color(Theme::TerminalAnsi14), "bright cyan"); + + setupColor(this, colors[7], "7", theme->color(Theme::TerminalAnsi7), "white"); + setupColor(this, colors[15], "15", theme->color(Theme::TerminalAnsi15), "bright white"); setLayouter([this] { using namespace Layouting; From a386b5467a0e4d5b7a2a15a71fcd98772c5195b0 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 11 Oct 2023 11:45:20 +0200 Subject: [PATCH 1537/1777] ExtensionSystem: One indirection less for delatedTimer ... at the price of a fatter #include that only ends up in very few TUs Change-Id: I983e2082d5b894ee561e7c7ba96731ef6bc58e3a Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/extensionsystem/pluginmanager.cpp | 15 +++++---------- src/libs/extensionsystem/pluginmanager_p.h | 5 ++--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index ff9c632184b..84bea5b7bfa 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -940,7 +940,6 @@ PluginSpecPrivate *PluginManagerPrivate::privateSpec(PluginSpec *spec) void PluginManagerPrivate::startDelayedInitialize() { - delayedInitializeTimer.release()->deleteLater(); Utils::setMimeStartupPhase(MimeStartupPhase::PluginsDelayedInitializing); { NANOTRACE_SCOPE("ExtensionSystem", "DelayedInitialize"); @@ -1036,10 +1035,7 @@ void PluginManagerPrivate::readSettings() void PluginManagerPrivate::stopAll() { m_isShuttingDown = true; - if (delayedInitializeTimer && delayedInitializeTimer->isActive()) { - delayedInitializeTimer->stop(); - delayedInitializeTimer.reset(); - } + delayedInitializeTimer.stop(); const QVector<PluginSpec *> queue = loadQueue(); for (PluginSpec *spec : queue) @@ -1377,14 +1373,13 @@ void PluginManagerPrivate::loadPlugins() } emit q->pluginsChanged(); - delayedInitializeTimer.reset(new QTimer); - delayedInitializeTimer->setInterval(DELAYED_INITIALIZE_INTERVAL); - delayedInitializeTimer->setSingleShot(true); - connect(delayedInitializeTimer.get(), + delayedInitializeTimer.setInterval(DELAYED_INITIALIZE_INTERVAL); + delayedInitializeTimer.setSingleShot(true); + connect(&delayedInitializeTimer, &QTimer::timeout, this, &PluginManagerPrivate::startDelayedInitialize); - delayedInitializeTimer->start(); + delayedInitializeTimer.start(); } /*! diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index 5845684b862..3de21388bbb 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -15,13 +15,13 @@ #include <QScopedPointer> #include <QSet> #include <QStringList> +#include <QTimer> #include <QWaitCondition> #include <queue> QT_BEGIN_NAMESPACE class QTime; -class QTimer; class QEventLoop; QT_END_NAMESPACE @@ -40,7 +40,6 @@ class PluginSpecPrivate; class EXTENSIONSYSTEM_TEST_EXPORT PluginManagerPrivate : public QObject { - Q_OBJECT public: PluginManagerPrivate(PluginManager *pluginManager); ~PluginManagerPrivate() override; @@ -99,7 +98,7 @@ public: QStringList disabledPlugins; QStringList forceEnabledPlugins; // delayed initialization - std::unique_ptr<QTimer> delayedInitializeTimer; + QTimer delayedInitializeTimer; std::queue<PluginSpec *> delayedInitializeQueue; // ansynchronous shutdown QSet<PluginSpec *> asynchronousPlugins; // plugins that have requested async shutdown From 2a84b9f02b679a7b31ff8420d6c5136aca8f8147 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 11 Oct 2023 12:41:33 +0200 Subject: [PATCH 1538/1777] Utils: Fix FileAccess if device returns nullptr A device may return a nullptr if it does not support device access. Change-Id: I302a2c63406268a2ff876c1bf408c5e26137fd9d Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/libs/utils/filepath.cpp | 4 ++-- .../projectexplorer/devicesupport/devicemanager.cpp | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index a489db6c1a0..1a34bd038c8 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -1179,13 +1179,13 @@ DeviceFileAccess *FilePath::fileAccess() const static DeviceFileAccess dummy; const expected_str<DeviceFileAccess *> access = getFileAccess(*this); QTC_ASSERT_EXPECTED(access, return &dummy); - return *access ? *access : &dummy; + return *access; } bool FilePath::hasFileAccess() const { const expected_str<DeviceFileAccess *> access = getFileAccess(*this); - return access && access.value(); + return access.has_value(); } /*! diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 57052d354f6..b06d5a14694 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -417,12 +417,17 @@ DeviceManager::DeviceManager(bool isInstance) : d(std::make_unique<DeviceManager deviceHooks.fileAccess = [](const FilePath &filePath) -> expected_str<DeviceFileAccess *> { if (!filePath.needsDevice()) return DesktopDeviceFileAccess::instance(); - auto device = DeviceManager::deviceForPath(filePath); + IDevice::ConstPtr device = DeviceManager::deviceForPath(filePath); if (!device) { return make_unexpected( QString("No device found for path \"%1\"").arg(filePath.toUserOutput())); } - return device->fileAccess(); + DeviceFileAccess *fileAccess = device->fileAccess(); + if (!fileAccess) { + return make_unexpected( + QString("No file access for device \"%1\"").arg(device->displayName())); + } + return fileAccess; }; deviceHooks.environment = [](const FilePath &filePath) -> expected_str<Environment> { From 520cbfa39a1b57b336000d520d2dab1b0d0cf1db Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 11 Oct 2023 13:27:45 +0200 Subject: [PATCH 1539/1777] DeviceSupport: Make errors translatable Change-Id: Ieccb48cb5335e8eace4990e52f93ea431c7085de Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/projectexplorer/devicesupport/devicemanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index b06d5a14694..2a934c5b9f6 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -420,12 +420,12 @@ DeviceManager::DeviceManager(bool isInstance) : d(std::make_unique<DeviceManager IDevice::ConstPtr device = DeviceManager::deviceForPath(filePath); if (!device) { return make_unexpected( - QString("No device found for path \"%1\"").arg(filePath.toUserOutput())); + Tr::tr("No device found for path \"%1\"").arg(filePath.toUserOutput())); } DeviceFileAccess *fileAccess = device->fileAccess(); if (!fileAccess) { return make_unexpected( - QString("No file access for device \"%1\"").arg(device->displayName())); + Tr::tr("No file access for device \"%1\"").arg(device->displayName())); } return fileAccess; }; From 551dde7fa9b218e84bc79e01da008a9f1d0bbf97 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 6 Oct 2023 14:06:20 +0200 Subject: [PATCH 1540/1777] Doc: Describe Documentation Comments preferences - Add a topic for setting preferences for Doxygen-style docs - Update screenshot for Text Editor > Completion preferences, where the documentation settings used to be Task-number: QTCREATORBUG-29392 Change-Id: Ifb915e78f3d2a5fb97555dd99bfaa5abf12ef14b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- ...tcreator-options-texteditor-completion.png | Bin 14439 -> 0 bytes ...or-preferences-documentation-comments.webp | Bin 0 -> 3222 bytes ...tor-preferences-texteditor-completion.webp | Bin 0 -> 7932 bytes .../src/editors/creator-code-completion.qdoc | 4 ++- .../creator-how-to-document-code.qdoc | 27 ++++++++++++++++++ .../howto/creator-only/creator-how-tos.qdoc | 5 +++- .../creator-projects-settings-overview.qdoc | 1 + doc/qtcreator/src/qtcreator-toc.qdoc | 1 + 8 files changed, 36 insertions(+), 2 deletions(-) delete mode 100644 doc/qtcreator/images/qtcreator-options-texteditor-completion.png create mode 100644 doc/qtcreator/images/qtcreator-preferences-documentation-comments.webp create mode 100644 doc/qtcreator/images/qtcreator-preferences-texteditor-completion.webp create mode 100644 doc/qtcreator/src/howto/creator-only/creator-how-to-document-code.qdoc diff --git a/doc/qtcreator/images/qtcreator-options-texteditor-completion.png b/doc/qtcreator/images/qtcreator-options-texteditor-completion.png deleted file mode 100644 index a891ed6365c4b9b2a22127c4546b43a4f6739c67..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal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zd3pYOhuxCA3qztf#DsIiyjPcT9x1vuVW!TTz*9Qb_j3JrUh6!oB5e75?d0MG+Dr<Y zJ5M9eREJHODa!u&SjwOFjD_mC6UFUcoJ{96f9~LLf=6#^yX4&yGq&i?SrIkEuw+4I z$Bt7;CF@+$ZoP?qEwlsDiFw^7dHC$RIU4pyijN+R+HJ|j8)}_?PnR*p>?qP~U+aE` zM{9WQR3uC_SX|g)=c-cu)jGjC{W<epmdXtpT}po+PXF-FDe~i;@PIACnU%MS_kQ*2 zu3YfPZ1MAQnI@y+`w<+mOyIVJg?>Xz|KDSCfA=0a<f@bVEy@4Wx2_+vy57~TRy?yh zZ4YzGUh!b_=MLd44r!MaLD`<K{#;g&#rnDf9@4YFiXK>VqQ~CE#?_<$Gy`b$N5+KX qyKFkZ%R->DdPHVwpJ_M$v)k;;@SD9LOpt+rfx*+&&t;ucLK6Uqa#?Wz diff --git a/doc/qtcreator/images/qtcreator-preferences-documentation-comments.webp b/doc/qtcreator/images/qtcreator-preferences-documentation-comments.webp new file mode 100644 index 0000000000000000000000000000000000000000..0e65dde2aeb0606671d1802299fdf4e91858e3f1 GIT binary patch literal 3222 zcmWIYbaU(DVPFV%bqWXzu<&W(VPMdIc+iC5IJ@N}71yAY{;j&7<&5VGE&u=iN<!4L zQ_ivp?wi&|%`A<b_uE;xqMpT{jm3fO-MjGVI=8p^?tWE#eB0b#^~<C*8*;7t)6dr5 z+B&K4#{KvZFLo7E4(COR4ilQ>LIN(Y$@ufR<j!HO*(;pgESF9(WZ=6|Da9f@%YlnW zi&4}dfwSyqJKNL+ECvlClbW0w1QcBbO_daaE_gU7xGYeT(yUWe2)Yn*TCurkidy~7 ziV6SZIyuT0%t#Usj+-Yf`0$+7Pxf;%Ox0hybCnd9oLFo>>!XpNfYPe&pu}k$7foI; zCL8e{=}MfbxW2&qfcZNGIW}Vjfh+YNFLJZm*B?~k66jHAWBtJKuX2ZS{g+9H{2wrF z7Ff-<Poi|kaW>;>wmjb#txig}jNbfzI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pQ(6&P>pJas89S}F(+uv<<cJB4bhW{5VxOb@VWaj=n&BY<h^Y?yV z*Rw7!VPmoC@xP5MLiayA&ngIMeE8CdQ#)X>SV*jzJHO+Hw~vc98S(QnAAWz!`P$bF z#Z3o0=3W#3_~FR?m=E{GH+lPWZwmYKS#a^s32UlFKGz+3^q%wjv)*US*UzVM%=KP6 z`AT&~*Ofyb&wjtZ^6IYL3y%0ro%4xDMWD}vH#@DJx6d`Z^Rmp!gtejZYV0RE3O5}* zb->#sAU3o^Gl@xw!CPu${I%Mk3tfFR4|NQe7QV@gY@5r%?{8U9Yqjg%bbGsoA|4fi z_ns5fE;&y3&FqN^cwD6YX4NVm>GqVw<Ge0sY&XRD^R0|8dzJsRWapC4{x`P9&EL4* z<lyD=GG~*OR1~+0eC*vHxn@K1(Rpt^IWWaK8D=@gF3NnOTC^)?f1*gN-5gh$-M^nM z|EI^5qcgqa9%rw{teyQPj+a|cDo;-GQo7XtR{PuKQ^pe<Vh+sOb%6WX1pe594ccpZ zHaQd>6V!LRs66?*;L;a8h8w=}yq~sTNwDbo+>XkWPmKRsjCfQ8W-W@8s$AV7w{^iI zBg?M>EGthPi1brWznQn#V&2wzouq>YrRSclIkR&2ky5*g#l`L)XT(0z)-n8h@np@H ziU%w%ZN~3qvyYWc{j_-te`6!dscA3IrDxvGd9(M%vY?=SjV$Y0YVw8OyT)j0-gjWq zW<FMU?D6i|Rr+f(KkQt-f8WgOi>^(bb?p1$Uv^*LzOT?Wy8WJe*+<=b`pbORyGqUa QVE%FSzu>R){iPEb0mFhBNdN!< literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-preferences-texteditor-completion.webp b/doc/qtcreator/images/qtcreator-preferences-texteditor-completion.webp new file mode 100644 index 0000000000000000000000000000000000000000..e2b68ec78520e1ea2fc25d07df31acefbc1f3af2 GIT binary patch literal 7932 zcmWIYbaVS6$G{No>J$(bVBzyZj)6h{wNnwpRj#IOxsyM%@BRC}j7iXtF-TRnA?DUo z=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Ozp{&21@OB>}esy|(eI?~1T_>2%7i`DWJX)`pV# zr@z$|9d*ApL1C&ZZ^5GOxjK5BJ1v|{qjOhJcxf^HZS6B>nayo2r@Dn^WT|+TY}}xx zakkej;B44zjg(zyQ>*9ioH>1sV)&Y%K88JKx(zNKb@CDqGO=R0nzMDK)3a;aN@t$_ rwl90B@-mIsACD&edCHQPd`^vXm(I=ri=w`{JZt)Ai~kd5l3)P<LkL~x literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/editors/creator-code-completion.qdoc b/doc/qtcreator/src/editors/creator-code-completion.qdoc index a7a1b17c4a2..409855ab73d 100644 --- a/doc/qtcreator/src/editors/creator-code-completion.qdoc +++ b/doc/qtcreator/src/editors/creator-code-completion.qdoc @@ -31,7 +31,7 @@ To specify settings for code completion, select \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Completion. - \image qtcreator-options-texteditor-completion.png "Text Editor Completion preferences" + \image qtcreator-preferences-texteditor-completion.webp "Text Editor Completion preferences" By default, code completion does not consider case. To apply full or first-letter case-sensitivity, select \uicontrol Full or @@ -298,6 +298,8 @@ To use Nimsuggest, you must install it on the development PC. Then select \uicontrol Edit > \uicontrol Preferences > \uicontrol Nim > \uicontrol Tools, and enter the path to the tool executable in the \uicontrol Path field. + + \sa {Document code} \else \include qtcreator-variables.qdocinc qtcreator variables \endif diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-to-document-code.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-to-document-code.qdoc new file mode 100644 index 00000000000..3050f4a9a4e --- /dev/null +++ b/doc/qtcreator/src/howto/creator-only/creator-how-to-document-code.qdoc @@ -0,0 +1,27 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-how-to-document-code.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-edit + + \title Document code + + When you write documentation comments in the \uicontrol Edit mode, you can + enable Doxygen code blocks and add brief descriptions and leading asterisks + automatically. Also, you can select the Doxygen command prefix to use. + + To set preferences for documentation comments for a particular project, + select \uicontrol Projects > \uicontrol {Project Settings} > + \uicontrol {Documentation Comments}, and deselect the + \uicontrol {Use global settings} check box. + + \image qtcreator-preferences-documentation-comments.webp {Documentation Comments settings} + + To set global preferences, select \uicontrol Edit > \uicontrol Preferences > + \uicontrol {Text Editor} > \uicontrol {Documentation Comments}. + + \sa {Configuring Projects} +*/ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 94a4f288393..a716f7aede6 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -28,6 +28,7 @@ \list \li \l {Add code snippets to the auto-complete menu} + \li \l {Document code} \li \l {Enclose selected code in curly braces, parentheses, or double quotes} \li \l {Indent text or code} \li \l {Jump to a function in QML code} @@ -410,7 +411,9 @@ select \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Completion. - \image qtcreator-options-texteditor-completion.png "Completion preferences" + \image qtcreator-preferences-texteditor-completion.webp "Completion preferences" + + \sa {Completing Code} */ /*! diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc index 2b71e1f5000..3276706a95e 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc @@ -42,6 +42,7 @@ \li \l{Specify code style}{C++ Code Style} \li \l{Using Custom Output Parsers}{Custom Output Parsers} \li \l{Specify dependencies}{Dependencies} + \li \l{Document code}{Documentation Comments} \li \l{Specify editor settings}{Editor} \li \l{Specifying Environment Settings}{Environment} \li \l{Applying Refactoring Actions}{Quick Fixes} diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 5fcbee47a94..bfc6e8122fa 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -188,6 +188,7 @@ \li Edit Code \list \li \l {Add code snippets to the auto-complete menu} + \li \l {Document code} \li \l {Enclose selected code in curly braces, parentheses, or double quotes} \li \l {Indent text or code} \li \l {Jump to a function in QML code} From efc168fb61c9fdf571f82805defcbf66d9d3f29e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 9 Oct 2023 18:28:41 +0200 Subject: [PATCH 1541/1777] Core: Re-order system settings dialog a bit Change-Id: I853ac869769dd55d118bf722d3cbfa4416a54972 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/coreplugin/systemsettings.cpp | 69 +++++++++++++---------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index b40c5058347..aef7055c975 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -142,6 +142,7 @@ SystemSettings::SystemSettings() #ifdef ENABLE_CRASHPAD enableCrashReporting.setSettingsKey("CrashReportingEnabled"); + enableCrashReporting.setLabelPlacement(BoolAspect::LabelPlacement::Compact); enableCrashReporting.setLabelText(tr("Enable crash reporting")); enableCrashReporting.setToolTip( Tr::tr("Allow crashes to be automatically reported. Collected reports are " @@ -165,8 +166,10 @@ public: , m_terminalOpenArgs(new QLineEdit) , m_terminalExecuteArgs(new QLineEdit) , m_environmentChangesLabel(new Utils::ElidingLabel) - , m_clearCrashReportsButton(new QPushButton(Tr::tr("Clear Local Crash Reports"))) - , m_crashReportsSizeText(new QLabel) +#ifdef ENABLE_CRASHPAD + , m_clearCrashReportsButton(new QPushButton(Tr::tr("Clear Local Crash Reports"), this)) + , m_crashReportsSizeText(new QLabel(this)) +#endif { SystemSettings &s = systemSettings(); @@ -191,54 +194,56 @@ public: resetFileBrowserButton->setToolTip(Tr::tr("Reset to default.")); auto helpExternalFileBrowserButton = new QToolButton; helpExternalFileBrowserButton->setText(Tr::tr("?")); - auto helpCrashReportingButton = new QToolButton; +#ifdef ENABLE_CRASHPAD + auto helpCrashReportingButton = new QToolButton(this); helpCrashReportingButton->setText(Tr::tr("?")); +#endif auto resetTerminalButton = new QPushButton(Tr::tr("Reset")); resetTerminalButton->setToolTip(Tr::tr("Reset to default.", "Terminal")); auto environmentButton = new QPushButton(Tr::tr("Change...")); environmentButton->setSizePolicy(QSizePolicy::Fixed, environmentButton->sizePolicy().verticalPolicy()); - Grid form; - form.addRow( - {Tr::tr("Environment:"), Span(2, Row{m_environmentChangesLabel, environmentButton})}); + Grid grid; + grid.addRow({Tr::tr("Environment:"), + Span(3, m_environmentChangesLabel), environmentButton}); if (HostOsInfo::isAnyUnixHost()) { - form.addRow({Tr::tr("Terminal:"), - Span(2, - Row{m_terminalComboBox, - m_terminalOpenArgs, - m_terminalExecuteArgs, - resetTerminalButton})}); + grid.addRow({Tr::tr("Terminal:"), + m_terminalComboBox, + m_terminalOpenArgs, + m_terminalExecuteArgs, + resetTerminalButton}); } if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) { - form.addRow({Tr::tr("External file browser:"), - Span(2, - Row{m_externalFileBrowserEdit, - resetFileBrowserButton, - helpExternalFileBrowserButton})}); + grid.addRow({Tr::tr("External file browser:"), + Span(3, m_externalFileBrowserEdit), + resetFileBrowserButton, + helpExternalFileBrowserButton}); } - form.addRow({Span(3, s.patchCommand)}); + grid.addRow({Span(4, s.patchCommand)}); if (HostOsInfo::isMacHost()) { - form.addRow({fileSystemCaseSensitivityLabel, - Span(2, Row{m_fileSystemCaseSensitivityChooser, st})}); + grid.addRow({fileSystemCaseSensitivityLabel, + m_fileSystemCaseSensitivityChooser}); } - form.addRow({s.reloadSetting, st}); - form.addRow({s.autoSaveModifiedFiles, Span(2, Row{s.autoSaveInterval, st})}); - form.addRow({Span(3, s.autoSaveAfterRefactoring)}); - form.addRow({s.autoSuspendEnabled, Span(2, Row{s.autoSuspendMinDocumentCount, st})}); - form.addRow({s.warnBeforeOpeningBigFiles, Span(2, Row{s.bigFileSizeLimitInMB, st})}); - form.addRow({Tr::tr("Maximum number of entries in \"Recent Files\":"), - Span(2, Row{s.maxRecentFiles, st})}); - form.addRow({s.askBeforeExit}); + grid.addRow({s.reloadSetting}); + grid.addRow({s.autoSaveModifiedFiles, Row{s.autoSaveInterval, st}}); + grid.addRow({s.autoSuspendEnabled, Row{s.autoSuspendMinDocumentCount, st}}); + grid.addRow({s.autoSaveAfterRefactoring}); + grid.addRow({s.warnBeforeOpeningBigFiles, Row{s.bigFileSizeLimitInMB, st}}); + grid.addRow({Tr::tr("Maximum number of entries in \"Recent Files\":"), + Row{s.maxRecentFiles, st}}); + grid.addRow({s.askBeforeExit}); #ifdef ENABLE_CRASHPAD - form.addRow({Span(3, Row{s.enableCrashReporting, helpCrashReportingButton, st})}); - form.addRow({Span(3, Row{m_clearCrashReportsButton, m_crashReportsSizeText, st})}); + grid.addRow({s.enableCrashReporting, + Row{m_clearCrashReportsButton, + m_crashReportsSizeText, + helpCrashReportingButton, st}}); #endif Column { Group { title(Tr::tr("System")), - Column { form, st } + Column { grid, st } } }.attachTo(this); @@ -367,8 +372,10 @@ private: QLineEdit *m_terminalOpenArgs; QLineEdit *m_terminalExecuteArgs; Utils::ElidingLabel *m_environmentChangesLabel; +#ifdef ENABLE_CRASHPAD QPushButton *m_clearCrashReportsButton; QLabel *m_crashReportsSizeText; +#endif QPointer<QMessageBox> m_dialog; EnvironmentItems m_environmentChanges; }; From 6193cb3294a3b351daa8bc0175c4f3bc96e21971 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 11 Oct 2023 13:14:06 +0200 Subject: [PATCH 1542/1777] CppEditor: Stop updating things when shutting down Fixes: QTCREATORBUG-29735 Change-Id: Ic1ee1798e156b5ddf564a721f5a4e8892ae40f63 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/cppeditor/cppmodelmanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index cc08724373d..6f986bb7dd1 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -1940,6 +1940,8 @@ QSet<QString> CppModelManager::symbolsInFiles(const QSet<FilePath> &files) const void CppModelManager::onCoreAboutToClose() { + d->m_fallbackProjectPartTimer.disconnect(); + d->m_fallbackProjectPartTimer.stop(); ProgressManager::cancelTasks(Constants::TASK_INDEX); d->m_enableGC = false; } From 09d066108ed83dbe51c8c0e78bee8a461ce53ea1 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 11 Oct 2023 15:13:13 +0200 Subject: [PATCH 1543/1777] CompilerExplorer: Improve error reporting Displays network errors as disrupting, instead of just sending them to the log. Change-Id: If5a3dbb733f1433dcc2bcd0a52ad12d8ee3b85ef Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../compilerexplorer/compilerexplorereditor.cpp | 4 +++- .../compilerexplorersettings.cpp | 17 +++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 7946e92b821..d5003cf8c20 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -13,6 +13,7 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/icontext.h> #include <coreplugin/icore.h> +#include <coreplugin/messagemanager.h> #include <texteditor/textdocument.h> #include <texteditor/texteditor.h> @@ -464,7 +465,8 @@ void CompilerWidget::doCompile() m_marks.append(mark); } } catch (const std::exception &e) { - qCritical() << "Exception: " << e.what(); + Core::MessageManager::writeDisrupting( + Tr::tr("Failed to compile: \"%1\"").arg(QString::fromUtf8(e.what()))); } }); diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp index 8accdbcc214..2cd22aa6414 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.cpp +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -8,6 +8,8 @@ #include "api/language.h" #include "api/library.h" +#include <coreplugin/messagemanager.h> + #include <QComboBox> #include <QFutureWatcher> #include <QNetworkAccessManager> @@ -207,8 +209,9 @@ void CompilerSettings::fillLibraries(const LibrarySelectionAspect::ResultCallbac cachedLibraries(lang) = watcher->result(); fillFromCache(); } catch (const std::exception &e) { - qCritical() << e.what(); - return; + Core::MessageManager::writeDisrupting( + Tr::tr("Failed to fetch libraries: \"%1\"") + .arg(QString::fromUtf8(e.what()))); } }); watcher->setFuture(future); @@ -249,8 +252,9 @@ void SourceSettings::fillLanguageIdModel(const Utils::StringSelectionAspect::Res cachedLanguages() = watcher->result(); fillFromCache(); } catch (const std::exception &e) { - qCritical() << e.what(); - return; + Core::MessageManager::writeDisrupting( + Tr::tr("Failed to fetch languages: \"%1\"") + .arg(QString::fromUtf8(e.what()))); } }); watcher->setFuture(future); @@ -290,8 +294,9 @@ void CompilerSettings::fillCompilerModel(const Utils::StringSelectionAspect::Res fillFromCache(itCache); } catch (const std::exception &e) { - qCritical() << e.what(); - return; + Core::MessageManager::writeDisrupting( + Tr::tr("Failed to fetch compilers: \"%1\"") + .arg(QString::fromUtf8(e.what()))); } }); watcher->setFuture(future); From fbe6c0d9773258b4f75d7f3bd7c9f0305c433c61 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Wed, 11 Oct 2023 16:50:21 +0200 Subject: [PATCH 1544/1777] CompilerExplorer: Fix UI text caps and punctuation Change-Id: I44fff47e3aef1b2910f22efd05201e81f6995024 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../compilerexplorer/compilerexplorereditor.cpp | 12 ++++++------ .../compilerexplorer/compilerexplorersettings.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index d5003cf8c20..3942e668a64 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -216,7 +216,7 @@ SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &se m_codeEditor->updateHighlighter(); auto addCompilerButton = new QPushButton; - addCompilerButton->setText(Tr::tr("Add compiler")); + addCompilerButton->setText(Tr::tr("Add Compiler")); connect(addCompilerButton, &QPushButton::clicked, &settings->compilers, @@ -224,7 +224,7 @@ SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &se auto removeSourceButton = new QPushButton; removeSourceButton->setIcon(Utils::Icons::EDIT_CLEAR.icon()); - removeSourceButton->setToolTip(Tr::tr("Remove source")); + removeSourceButton->setToolTip(Tr::tr("Remove Source")); connect(removeSourceButton, &QPushButton::clicked, this, &SourceEditorWidget::remove); // clang-format off @@ -302,7 +302,7 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett auto removeCompilerBtn = new QPushButton; removeCompilerBtn->setIcon(Utils::Icons::EDIT_CLEAR.icon()); - removeCompilerBtn->setToolTip(Tr::tr("Remove compiler")); + removeCompilerBtn->setToolTip(Tr::tr("Remove Compiler")); connect(removeCompilerBtn, &QPushButton::clicked, this, &CompilerWidget::remove); compile(m_sourceSettings->source()); @@ -693,7 +693,7 @@ HelperWidget::HelperWidget() setFocusPolicy(Qt::ClickFocus); setAttribute(Qt::WA_TransparentForMouseEvents, false); - auto addSourceButton = new QPushButton(Tr::tr("Add source code")); + auto addSourceButton = new QPushButton(Tr::tr("Add Source Code")); connect(addSourceButton, &QPushButton::clicked, this, &HelperWidget::addSource); @@ -703,7 +703,7 @@ HelperWidget::HelperWidget() Row { st, Column { - Tr::tr("No source code added yet. Add one using the button below."), + Tr::tr("No source code added yet. Add some using the button below."), Row { st, addSourceButton, st } }, st, @@ -786,7 +786,7 @@ QWidget *Editor::toolBar() QAction *newSource = new QAction(m_toolBar.get()); newSource->setIcon(Utils::Icons::PLUS_TOOLBAR.icon()); - newSource->setToolTip(Tr::tr("Add source")); + newSource->setToolTip(Tr::tr("Add Source")); m_toolBar->addAction(newSource); connect(newSource, diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp index 2cd22aa6414..ae47f67f9e2 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.cpp +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -128,7 +128,7 @@ CompilerSettings::CompilerSettings(const ApiConfigFunction &apiConfigFunction) compilerOptions.setSettingsKey("Options"); compilerOptions.setLabelText(Tr::tr("Compiler options:")); - compilerOptions.setToolTip(Tr::tr("Arguments passed to the compiler")); + compilerOptions.setToolTip(Tr::tr("Arguments passed to the compiler.")); compilerOptions.setDisplayStyle(Utils::StringAspect::DisplayStyle::LineEditDisplay); libraries.setSettingsKey("Libraries"); From e50861524323790e15431d6aee3eb33074d81301 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 10 Oct 2023 15:37:29 +0200 Subject: [PATCH 1545/1777] Designer: Remove unused code Amends bbbc90ee1d1ff1ff265d0cbb1de1fe668103d9ad. Change-Id: I963859c6f38621f0b2d6a21b45078c23c89d99e6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/designer/cpp/newclasswidget.cpp | 10 ---------- src/plugins/designer/cpp/newclasswidget.h | 1 - 2 files changed, 11 deletions(-) diff --git a/src/plugins/designer/cpp/newclasswidget.cpp b/src/plugins/designer/cpp/newclasswidget.cpp index 924700b59c0..8d678303405 100644 --- a/src/plugins/designer/cpp/newclasswidget.cpp +++ b/src/plugins/designer/cpp/newclasswidget.cpp @@ -36,7 +36,6 @@ struct NewClassWidgetPrivate { QString m_sourceExtension; QString m_formExtension; bool m_valid = false; - bool m_classEdited = false; ClassNameValidatingLineEdit *m_classLineEdit; FileNameValidatingLineEdit *m_headerFileLineEdit; @@ -78,8 +77,6 @@ NewClassWidget::NewClassWidget(QWidget *parent) : connect(d->m_classLineEdit, &ClassNameValidatingLineEdit::updateFileName, this, &NewClassWidget::slotUpdateFileNames); - connect(d->m_classLineEdit, &QLineEdit::textEdited, - this, &NewClassWidget::classNameEdited); connect(d->m_classLineEdit, &FancyLineEdit::validChanged, this, &NewClassWidget::slotValidChanged); connect(d->m_headerFileLineEdit, &FancyLineEdit::validChanged, @@ -110,13 +107,6 @@ NewClassWidget::~NewClassWidget() delete d; } -void NewClassWidget::classNameEdited() -{ - if (debugNewClassWidget) - qDebug() << Q_FUNC_INFO << d->m_headerExtension << d->m_sourceExtension; - d->m_classEdited = true; -} - void NewClassWidget::setClassName(const QString &suggestedName) { if (debugNewClassWidget) diff --git a/src/plugins/designer/cpp/newclasswidget.h b/src/plugins/designer/cpp/newclasswidget.h index bba1d9a82aa..e8fe4e4b125 100644 --- a/src/plugins/designer/cpp/newclasswidget.h +++ b/src/plugins/designer/cpp/newclasswidget.h @@ -53,7 +53,6 @@ private: void slotUpdateFileNames(const QString &t); void slotValidChanged(); void slotActivated(); - void classNameEdited(); QString fixSuffix(const QString &suffix); NewClassWidgetPrivate *d; From 344ac9813d1f714705b8061d70bc6ce8efc64bc1 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 11 Oct 2023 15:04:55 +0200 Subject: [PATCH 1546/1777] CMakePM: Fix crash in rstparser Change-Id: I5a9e456214581800c977e69da01aab1053cc554f Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc index f430c40e95d..8cf7af6fcb3 100644 --- a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc +++ b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc @@ -212,7 +212,7 @@ void rst::Parser::ParseBlock( } // Remove a trailing newline. - if (*text.rbegin() == '\n') + if (!text.empty() && *text.rbegin() == '\n') text.resize(text.size() - 1); bool literal = type == PARAGRAPH && EndsWith(text, "::"); From c6c09712652b6f0031d615e2f3f5d5c3517639a5 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 4 Oct 2023 13:47:55 +0200 Subject: [PATCH 1547/1777] Wizard: Fix kit selection for Qt Quick Application Fixes: QTCREATORBUG-29698 Change-Id: If0d962352096ebcbf2cdca2b85005add06d85d71 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../templates/wizards/projects/qtquickapplication/wizard.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json index 806787d4591..f50ef00577a 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json @@ -21,6 +21,7 @@ { "key": "HasFailureSignal", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.3' }"}, { "key": "UsesAutoResourcePrefix", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.4' }"}, { "key": "HasLoadFromModule", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.4' && value('UsesAutoResourcePrefix') }"}, + { "key": "FeatureQt", "value": "QtSupport.Wizards.FeatureQt.%{MinimumSupportedQtVersion}"}, { "key": "QdsWizardPath", "value": "%{IDE:ResourcePath}/qmldesigner/studio_templates/projects" }, { "key": "NoQdsProjectStyle", "value": "%{JS: !%{QdsProjectStyle} }" }, @@ -98,7 +99,7 @@ "enabled": "%{JS: !value('IsSubproject')}", "data": { "projectFilePath": "%{ProjectFile}", - "requiredFeatures": [ "QtSupport.Wizards.FeatureQtQmlCMakeApi" ] + "requiredFeatures": [ "QtSupport.Wizards.FeatureQtQmlCMakeApi", "%{FeatureQt}" ] } }, { From e5d0bab0eac7d0263fe6e066b979ab410d5eae1a Mon Sep 17 00:00:00 2001 From: Samuli Piippo <samuli.piippo@qt.io> Date: Wed, 11 Oct 2023 15:27:44 +0300 Subject: [PATCH 1548/1777] sdktool: add line break after clangd option Amend d79c69918f0b912e737f0bb6b00d39aa5b1fd4ad and add line break. Change-Id: I5082f0e6339cd161fa9c9030ad257e4246ff051f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/tools/sdktool/adddeviceoperation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/sdktool/adddeviceoperation.cpp b/src/tools/sdktool/adddeviceoperation.cpp index 4838e071058..3c439e3e536 100644 --- a/src/tools/sdktool/adddeviceoperation.cpp +++ b/src/tools/sdktool/adddeviceoperation.cpp @@ -58,7 +58,7 @@ QString AddDeviceOperation::argumentsHelpText() const " --dockerRepo <STRING> Docker image repo.\n" " --dockerTag <STRING> Docker image tag.\n" " --dockerMappedPaths <STRING> Docker mapped paths (semi-colon separated).\n" - " --dockerClangdExecutable <STRING> Path to clangd inside the docker " + " --dockerClangdExecutable <STRING> Path to clangd inside the docker.\n" " <KEY> <TYPE:VALUE> extra key value pairs\n"); } From da03156259e00f421d4c75590af393813e55b99c Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 12 Oct 2023 08:16:40 +0200 Subject: [PATCH 1549/1777] Utils: Allow nullptr widgets in layouts Change-Id: I33ee85bd809a3388872bee4a470e9439010ed8a8 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/layoutbuilder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/layoutbuilder.cpp b/src/libs/utils/layoutbuilder.cpp index 6f10220aaf1..a61a5fc474b 100644 --- a/src/libs/utils/layoutbuilder.cpp +++ b/src/libs/utils/layoutbuilder.cpp @@ -221,8 +221,8 @@ LayoutItem::~LayoutItem() = default; struct ResultItem { ResultItem() = default; - explicit ResultItem(QLayout *l) : layout(l) {} - explicit ResultItem(QWidget *w) : widget(w) {} + explicit ResultItem(QLayout *l) : layout(l), empty(!l) {} + explicit ResultItem(QWidget *w) : widget(w), empty(!w) {} QString text; QLayout *layout = nullptr; From eda0dbd8dda8ea91e8a7849e540266147aa57aeb Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 11 Oct 2023 13:33:34 +0200 Subject: [PATCH 1550/1777] TextEditor: modernize highlighting search results Change-Id: I365a09dfd9d371119044da5567a1adb397f3ac93 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/texteditor/texteditor.cpp | 58 +++++++++------------------ 1 file changed, 20 insertions(+), 38 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 33e6cd295ab..7939adf13c6 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -681,8 +681,6 @@ public: void documentAboutToBeReloaded(); void documentReloadFinished(bool success); void highlightSearchResultsSlot(const QString &txt, FindFlags findFlags); - void searchResultsReady(int beginIndex, int endIndex); - void searchFinished(); void setupScrollBar(); void highlightSearchResultsInScrollBar(); void scheduleUpdateHighlightScrollBar(); @@ -872,7 +870,7 @@ public: QScopedPointer<AutoCompleter> m_autoCompleter; CommentDefinition m_commentDefinition; - QFutureWatcher<SearchResultItems> *m_searchWatcher = nullptr; + QFuture<SearchResultItems> m_searchFuture; QVector<SearchResult> m_searchResults; QTimer m_scrollBarUpdateTimer; HighlightScrollBarController *m_highlightScrollBarController = nullptr; @@ -1139,6 +1137,8 @@ TextEditorWidgetPrivate::~TextEditorWidgetPrivate() q->disconnect(this); delete m_toolBarWidget; delete m_highlightScrollBarController; + if (m_searchFuture.isRunning()) + m_searchFuture.cancel(); } static QFrame *createSeparator(const QString &styleSheet) @@ -6847,27 +6847,6 @@ void TextEditorWidgetPrivate::highlightSearchResultsSlot(const QString &txt, Fin m_scrollBarUpdateTimer.start(50); } -void TextEditorWidgetPrivate::searchResultsReady(int beginIndex, int endIndex) -{ - QVector<SearchResult> results; - for (int index = beginIndex; index < endIndex; ++index) { - const SearchResultItems resultList = m_searchWatcher->resultAt(index); - for (const SearchResultItem &result : resultList) { - SearchResult searchResult; - if (q->inFindScope(selectRange(q->document(), result.mainRange(), &searchResult))) - results << searchResult; - } - } - m_searchResults << results; - addSearchResultsToScrollBar(results); -} - -void TextEditorWidgetPrivate::searchFinished() -{ - delete m_searchWatcher; - m_searchWatcher = nullptr; -} - void TextEditorWidgetPrivate::adjustScrollBarRanges() { if (!m_highlightScrollBarController) @@ -6888,12 +6867,8 @@ void TextEditorWidgetPrivate::highlightSearchResultsInScrollBar() m_highlightScrollBarController->removeHighlights(Constants::SCROLL_BAR_SEARCH_RESULT); m_searchResults.clear(); - if (m_searchWatcher) { - m_searchWatcher->disconnect(); - m_searchWatcher->cancel(); - m_searchWatcher->deleteLater(); - m_searchWatcher = nullptr; - } + if (m_searchFuture.isRunning()) + m_searchFuture.cancel(); const QString &txt = m_findText; if (txt.isEmpty()) @@ -6901,14 +6876,21 @@ void TextEditorWidgetPrivate::highlightSearchResultsInScrollBar() adjustScrollBarRanges(); - m_searchWatcher = new QFutureWatcher<SearchResultItems>; - connect(m_searchWatcher, &QFutureWatcher<SearchResultItems>::resultsReadyAt, - this, &TextEditorWidgetPrivate::searchResultsReady); - connect(m_searchWatcher, &QFutureWatcher<SearchResultItems>::finished, - this, &TextEditorWidgetPrivate::searchFinished); - m_searchWatcher->setPendingResultsLimit(10); - m_searchWatcher->setFuture(Utils::asyncRun(Utils::searchInContents, txt, m_findFlags, - m_document->filePath(), m_document->plainText())); + m_searchFuture = Utils::asyncRun(Utils::searchInContents, + txt, + m_findFlags, + m_document->filePath(), + m_document->plainText()); + Utils::onResultReady(m_searchFuture, this, [this](const SearchResultItems &resultList) { + QList<SearchResult> results; + for (const SearchResultItem &result : resultList) { + SearchResult searchResult; + if (q->inFindScope(selectRange(q->document(), result.mainRange(), &searchResult))) + results << searchResult; + } + m_searchResults << results; + addSearchResultsToScrollBar(results); + }); } void TextEditorWidgetPrivate::scheduleUpdateHighlightScrollBar() From b1b83c5c5eabb59aea45971bab6fe23a0617a6ac Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 12 Oct 2023 08:29:59 +0200 Subject: [PATCH 1551/1777] Copilot: Fix connection Change-Id: I8d32e5bdfd90968ac7c578f647ea7ae0325dbc9b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/copilot/authwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/copilot/authwidget.cpp b/src/plugins/copilot/authwidget.cpp index a0890cae3dc..ffafc8381b4 100644 --- a/src/plugins/copilot/authwidget.cpp +++ b/src/plugins/copilot/authwidget.cpp @@ -59,8 +59,8 @@ AuthWidget::AuthWidget(QWidget *parent) }); connect(&settings(), &CopilotSettings::applied, this, update); - connect(settings().nodeJsPath.pathChooser(), &PathChooser::textChanged, this, update); - connect(settings().distPath.pathChooser(), &PathChooser::textChanged, this, update); + connect(&settings().nodeJsPath, &FilePathAspect::volatileValueChanged, this, update); + connect(&settings().distPath, &FilePathAspect::volatileValueChanged, this, update); update(); } From 2a510011f178a8c4319f6bebc9ce054265c51785 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 11 Oct 2023 13:16:02 +0200 Subject: [PATCH 1552/1777] Utils: Send start failed if no ProcessInterface Change-Id: I38cdce9812bcec3240e3fb4f30a1dd266a5515e9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/libs/utils/process.cpp | 14 +++++++++++++- .../projectexplorer/devicesupport/idevice.cpp | 1 - 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/process.cpp b/src/libs/utils/process.cpp index 0eeeb1721b4..b10ea090dfc 100644 --- a/src/libs/utils/process.cpp +++ b/src/libs/utils/process.cpp @@ -1251,7 +1251,19 @@ void Process::start() } else { processImpl = d->createProcessInterface(); } - QTC_ASSERT(processImpl, return); + + if (!processImpl) { + // This happens if a device does not implement the createProcessInterface() function. + d->m_result = ProcessResult::StartFailed; + d->m_resultData.m_exitCode = 255; + d->m_resultData.m_exitStatus = QProcess::CrashExit; + d->m_resultData.m_errorString = Tr::tr("Failed to create process interface for \"%1\"") + .arg(d->m_setup.m_commandLine.toUserOutput()); + d->m_resultData.m_error = QProcess::FailedToStart; + d->emitGuardedSignal(&Process::done); + return; + } + d->setProcessInterface(processImpl); d->m_state = QProcess::Starting; d->m_process->m_setup = d->m_setup; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 05c013c4bd5..489e6b337e6 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -290,7 +290,6 @@ FilePath IDevice::searchExecutable(const QString &fileName, const FilePaths &dir ProcessInterface *IDevice::createProcessInterface() const { - QTC_CHECK(false); return nullptr; } From f734ba4461497738b945c9387545ea4b6f2eca54 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 10 Oct 2023 18:12:55 +0200 Subject: [PATCH 1553/1777] Wizards: Make editable text options with macros/code non-translatable Options with contain %{Macros} (sometimes with JavaScript code) should not be translatable, since a translation can easily a prevent a wizard from successfully working. This change turns a couple of trText, trDisabledText and trPlaceholder options into their non-translatable pendants. Fixes: QTCREATORBUG-29649 Change-Id: Ia46ab7ac35f78d6368868d78e24179197744921d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- share/qtcreator/templates/wizards/classes/cpp/wizard.json | 8 ++++---- .../templates/wizards/classes/itemmodel/wizard.json | 4 ++-- .../templates/wizards/classes/python/wizard.json | 4 ++-- share/qtcreator/templates/wizards/codesnippet/wizard.json | 2 +- .../qtcreator/templates/wizards/files/testing/wizard.json | 4 ++-- .../templates/wizards/projects/cpplibrary/wizard.json | 6 +++--- .../qtforpythonapplication/mainwindow/wizard.json | 6 +++--- .../projects/qtforpythonapplication/widget/wizard.json | 6 +++--- .../wizards/projects/qtwidgetsapplication/wizard.json | 8 ++++---- .../templates/wizards/projects/vcs/bazaar/wizard.json | 2 +- .../templates/wizards/projects/vcs/git/wizard.json | 2 +- .../templates/wizards/projects/vcs/mercurial/wizard.json | 2 +- .../templates/wizards/projects/vcs/subversion/wizard.json | 2 +- .../templates/wizards/qtcreatorplugin/wizard.json | 4 ++-- src/plugins/fossil/wizard/projects/vcs/wizard.json | 8 ++++---- src/plugins/vcpkg/wizards/manifest/wizard.json | 2 +- 16 files changed, 35 insertions(+), 35 deletions(-) diff --git a/share/qtcreator/templates/wizards/classes/cpp/wizard.json b/share/qtcreator/templates/wizards/classes/cpp/wizard.json index 06e856c1ab5..12b7eefbbeb 100644 --- a/share/qtcreator/templates/wizards/classes/cpp/wizard.json +++ b/share/qtcreator/templates/wizards/classes/cpp/wizard.json @@ -58,8 +58,8 @@ "mandatory": false, "data": { - "trText": "%{BaseCB}", - "trDisabledText": "%{BaseCB}", + "text": "%{BaseCB}", + "disabledText": "%{BaseCB}", "completion": "classes" } }, @@ -167,14 +167,14 @@ "type": "LineEdit", "trDisplayName": "Header file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Cpp.cxxHeaderSuffix())}" } + "data": { "text": "%{JS: Cpp.classToFileName(value('Class'), Cpp.cxxHeaderSuffix())}" } }, { "name": "SrcFileName", "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Cpp.cxxSourceSuffix())}" } + "data": { "text": "%{JS: Cpp.classToFileName(value('Class'), Cpp.cxxSourceSuffix())}" } }, { "name": "Path", diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json b/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json index afecf16c334..786fa8e70c5 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json +++ b/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json @@ -92,14 +92,14 @@ "type": "LineEdit", "trDisplayName": "Header file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Cpp.cxxHeaderSuffix())}" } + "data": { "text": "%{JS: Cpp.classToFileName(value('Class'), Cpp.cxxHeaderSuffix())}" } }, { "name": "SrcFileName", "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Cpp.cxxSourceSuffix())}" } + "data": { "text": "%{JS: Cpp.classToFileName(value('Class'), Cpp.cxxSourceSuffix())}" } }, { "name": "Path", diff --git a/share/qtcreator/templates/wizards/classes/python/wizard.json b/share/qtcreator/templates/wizards/classes/python/wizard.json index d42d8f0ab52..381718c054f 100644 --- a/share/qtcreator/templates/wizards/classes/python/wizard.json +++ b/share/qtcreator/templates/wizards/classes/python/wizard.json @@ -58,7 +58,7 @@ "type": "LineEdit", "enabled": "%{JS: value('BaseCB') === ''}", "mandatory": false, - "data": { "trText": "%{BaseCB}" } + "data": { "text": "%{BaseCB}" } }, @@ -115,7 +115,7 @@ "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Util.fileName(value('Class'), Util.preferredSuffix('text/x-python'))}" } + "data": { "text": "%{JS: Util.fileName(value('Class'), Util.preferredSuffix('text/x-python'))}" } }, { "name": "TargetPath", diff --git a/share/qtcreator/templates/wizards/codesnippet/wizard.json b/share/qtcreator/templates/wizards/codesnippet/wizard.json index e5dbc0c70c2..ddcd41295fc 100644 --- a/share/qtcreator/templates/wizards/codesnippet/wizard.json +++ b/share/qtcreator/templates/wizards/codesnippet/wizard.json @@ -38,7 +38,7 @@ "type": "TextEdit", "data": { - "trText": "int main(int argc, char *argv[])\n{\n return 0;\n}" + "text": "int main(int argc, char *argv[])\n{\n return 0;\n}" } }, { diff --git a/share/qtcreator/templates/wizards/files/testing/wizard.json b/share/qtcreator/templates/wizards/files/testing/wizard.json index 9a9718ef55d..8a5bb84bf56 100644 --- a/share/qtcreator/templates/wizards/files/testing/wizard.json +++ b/share/qtcreator/templates/wizards/files/testing/wizard.json @@ -91,7 +91,7 @@ "trDisplayName": "Source file:", "mandatory": true, "visible": "%{JS: value('TestFrameWork') !== 'QtQuickTest' }", - "data": { "trText": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Cpp.cxxSourceSuffix()}" } + "data": { "text": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Cpp.cxxSourceSuffix()}" } }, { "name": "QmlSrcFile", @@ -99,7 +99,7 @@ "trDisplayName": "Source file:", "mandatory": true, "visible": "%{JS: value('TestFrameWork') === 'QtQuickTest' }", - "data": { "trText": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.qml'}" } + "data": { "text": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.qml'}" } }, { "name": "Path", diff --git a/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json b/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json index 28e2242f7de..df4c59edbfd 100644 --- a/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json +++ b/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json @@ -138,7 +138,7 @@ "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)", - "trText": "%{JS: value('Type') === 'qtplugin' ? value('BaseClassName').slice(1) : (value('ProjectName').charAt(0).toUpperCase() + value('ProjectName').slice(1))}" + "text": "%{JS: value('Type') === 'qtplugin' ? value('BaseClassName').slice(1) : (value('ProjectName').charAt(0).toUpperCase() + value('ProjectName').slice(1))}" } }, { @@ -269,14 +269,14 @@ "type": "LineEdit", "trDisplayName": "Header file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" } + "data": { "text": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" } }, { "name": "SrcFileName", "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++src'))}" } + "data": { "text": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++src'))}" } } ] }, diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json index 9156caaffd8..7ed2498faf8 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json @@ -38,7 +38,7 @@ "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)", - "trText": "%{JS: value('BaseCB') ? value('BaseCB').slice(1) : 'MyClass'}" + "text": "%{JS: value('BaseCB') ? value('BaseCB').slice(1) : 'MyClass'}" } }, { @@ -56,14 +56,14 @@ "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-python'))}" } + "data": { "text": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-python'))}" } }, { "name": "ProjectFileName", "type": "LineEdit", "trDisplayName": "Project file:", "mandatory": true, - "data": { "trText": "%{JS: Util.fileName('%{ProjectName}', 'pyproject')}" } + "data": { "text": "%{JS: Util.fileName('%{ProjectName}', 'pyproject')}" } } ] }, diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json index 6251eaf3341..a2005335668 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json @@ -38,7 +38,7 @@ "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)", - "trText": "%{JS: value('BaseCB') ? value('BaseCB').slice(1) : 'MyClass'}" + "text": "%{JS: value('BaseCB') ? value('BaseCB').slice(1) : 'MyClass'}" } }, @@ -56,14 +56,14 @@ "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-python'))}" } + "data": { "text": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-python'))}" } }, { "name": "ProjectFileName", "type": "LineEdit", "trDisplayName": "Project file:", "mandatory": true, - "data": { "trText": "%{JS: Util.fileName('%{ProjectName}', 'pyproject')}" } + "data": { "text": "%{JS: Util.fileName('%{ProjectName}', 'pyproject')}" } } ] }, diff --git a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json index 58abd94344d..d4c7602c487 100644 --- a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json @@ -102,7 +102,7 @@ "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)", - "trText": "%{JS: value('BaseClass') ? value('BaseClass').slice(1) : 'MyClass'}" + "text": "%{JS: value('BaseClass') ? value('BaseClass').slice(1) : 'MyClass'}" } }, { @@ -123,14 +123,14 @@ "type": "LineEdit", "trDisplayName": "Header file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" } + "data": { "text": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" } }, { "name": "SrcFileName", "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++src'))}" } + "data": { "text": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++src'))}" } }, { "name": "GenerateForm", @@ -144,7 +144,7 @@ "trDisplayName": "Form file:", "enabled": "%{GenerateForm}", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), 'ui')}" } + "data": { "text": "%{JS: Cpp.classToFileName(value('Class'), 'ui')}" } } ] }, diff --git a/share/qtcreator/templates/wizards/projects/vcs/bazaar/wizard.json b/share/qtcreator/templates/wizards/projects/vcs/bazaar/wizard.json index 8a20a1ef2e8..101a73dc64c 100644 --- a/share/qtcreator/templates/wizards/projects/vcs/bazaar/wizard.json +++ b/share/qtcreator/templates/wizards/projects/vcs/bazaar/wizard.json @@ -70,7 +70,7 @@ "trIncompleteMessage": "\"%{JS: Util.toNativeSeparators('%{TargetPath}')}\" exists in the filesystem.", "data": { - "trText": "%{defaultDir}" + "text": "%{defaultDir}" } }, { diff --git a/share/qtcreator/templates/wizards/projects/vcs/git/wizard.json b/share/qtcreator/templates/wizards/projects/vcs/git/wizard.json index 2967a51f31c..ab193990fc1 100644 --- a/share/qtcreator/templates/wizards/projects/vcs/git/wizard.json +++ b/share/qtcreator/templates/wizards/projects/vcs/git/wizard.json @@ -82,7 +82,7 @@ "trIncompleteMessage": "\"%{JS: Util.toNativeSeparators('%{TargetPath}')}\" exists in the filesystem.", "data": { - "trText": "%{defaultDir}" + "text": "%{defaultDir}" } }, { diff --git a/share/qtcreator/templates/wizards/projects/vcs/mercurial/wizard.json b/share/qtcreator/templates/wizards/projects/vcs/mercurial/wizard.json index cb7e5ab4f10..84ec489c3ae 100644 --- a/share/qtcreator/templates/wizards/projects/vcs/mercurial/wizard.json +++ b/share/qtcreator/templates/wizards/projects/vcs/mercurial/wizard.json @@ -69,7 +69,7 @@ "trIncompleteMessage": "\"%{JS: Util.toNativeSeparators('%{TargetPath}')}\" exists in the filesystem.", "data": { - "trText": "%{defaultDir}" + "text": "%{defaultDir}" } } ] diff --git a/share/qtcreator/templates/wizards/projects/vcs/subversion/wizard.json b/share/qtcreator/templates/wizards/projects/vcs/subversion/wizard.json index 1ced38032e0..5ef76615509 100644 --- a/share/qtcreator/templates/wizards/projects/vcs/subversion/wizard.json +++ b/share/qtcreator/templates/wizards/projects/vcs/subversion/wizard.json @@ -69,7 +69,7 @@ "trIncompleteMessage": "\"%{JS: Util.toNativeSeparators('%{TargetPath}')}\" exists in the filesystem.", "data": { - "trText": "%{defaultDir}" + "text": "%{defaultDir}" } }, { diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.json b/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.json index 6bbc9ce8038..0d3e20ef5e2 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.json +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.json @@ -57,7 +57,7 @@ "data": { "validator": "[a-zA-Z_][a-zA-Z_0-9]*", - "trText": "%{JS: value('ProjectName').charAt(0).toUpperCase() + value('ProjectName').slice(1)}" + "text": "%{JS: value('ProjectName').charAt(0).toUpperCase() + value('ProjectName').slice(1)}" } }, { @@ -109,7 +109,7 @@ "type": "LineEdit", "data": { - "trText": "https://www.%{JS: encodeURIComponent(value('VendorName').toLowerCase())}.com" + "text": "https://www.%{JS: encodeURIComponent(value('VendorName').toLowerCase())}.com" } }, { diff --git a/src/plugins/fossil/wizard/projects/vcs/wizard.json b/src/plugins/fossil/wizard/projects/vcs/wizard.json index 7f5fb174520..e1d92573574 100644 --- a/src/plugins/fossil/wizard/projects/vcs/wizard.json +++ b/src/plugins/fossil/wizard/projects/vcs/wizard.json @@ -80,7 +80,7 @@ "trIncompleteMessage": "The clone fossil already exists in local repositories path.", "data": { - "trText": "%{JS: (%{isCloneRepo} && '%{Repo}' !== '' && '%{FossilName}' !== '') || (%{isLocalRepo} && '%{LocalRepo}' !== '') ? 'true' : '' }" + "text": "%{JS: (%{isCloneRepo} && '%{Repo}' !== '' && '%{FossilName}' !== '') || (%{isLocalRepo} && '%{LocalRepo}' !== '') ? 'true' : '' }" } }, { @@ -100,7 +100,7 @@ "mandatory": false, "data": { - "trText": "%{defaultFossilName}" + "text": "%{defaultFossilName}" } }, { @@ -139,7 +139,7 @@ "trIncompleteMessage": "The checkout directory already exists in the filesystem.", "data": { - "trText": "%{defaultDir}" + "text": "%{defaultDir}" } }, { @@ -167,7 +167,7 @@ "enabled": "%{isCloneRepo}", "data": { - "trText": "%{JS: Fossil.defaultAdminUser()}" + "text": "%{JS: Fossil.defaultAdminUser()}" } }, { diff --git a/src/plugins/vcpkg/wizards/manifest/wizard.json b/src/plugins/vcpkg/wizards/manifest/wizard.json index 80e8b0fcc52..ae43ceef064 100644 --- a/src/plugins/vcpkg/wizards/manifest/wizard.json +++ b/src/plugins/vcpkg/wizards/manifest/wizard.json @@ -54,7 +54,7 @@ "type": "TextEdit", "data": { - "trText": " \"dependencies\": [\n \"fmt\"\n ]" + "text": " \"dependencies\": [\n \"fmt\"\n ]" } } ] From c732c137f70b94e5dd71f11f0376e3315355aeee Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 2 Oct 2023 18:24:45 +0200 Subject: [PATCH 1554/1777] Core: Minor cleanup to session.h Change-Id: Ic3a9280529946247e5e4526676c5e979ccb17c48 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/coreplugin/session.cpp | 12 ++++-------- src/plugins/coreplugin/session.h | 12 ++++++------ src/plugins/projectexplorer/projectmanager.cpp | 4 +--- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/plugins/coreplugin/session.cpp b/src/plugins/coreplugin/session.cpp index bf6d9205b3e..c188f6812c3 100644 --- a/src/plugins/coreplugin/session.cpp +++ b/src/plugins/coreplugin/session.cpp @@ -118,8 +118,10 @@ SessionManager::SessionManager() d->restoreStartupSession(); }); - connect(ModeManager::instance(), &ModeManager::currentModeChanged, - this, &SessionManager::saveActiveMode); + connect(ModeManager::instance(), &ModeManager::currentModeChanged, [](Id mode) { + if (mode != Core::Constants::MODE_WELCOME) + setValue("ActiveMode", mode.toString()); + }); connect(ICore::instance(), &ICore::saveSettingsRequested, this, [] { if (!SessionManager::isLoadingSession()) @@ -194,12 +196,6 @@ bool SessionManager::isDefaultSession(const QString &session) return session == QLatin1String(DEFAULT_SESSION); } -void SessionManager::saveActiveMode(Id mode) -{ - if (mode != Core::Constants::MODE_WELCOME) - setValue("ActiveMode", mode.toString()); -} - bool SessionManager::isLoadingSession() { return d->m_loadingSession; diff --git a/src/plugins/coreplugin/session.h b/src/plugins/coreplugin/session.h index 19209b60414..962db5172b5 100644 --- a/src/plugins/coreplugin/session.h +++ b/src/plugins/coreplugin/session.h @@ -5,13 +5,16 @@ #include "core_global.h" -#include <utils/id.h> -#include <utils/persistentsettings.h> - #include <QDateTime> +#include <QObject> #include <QString> #include <QStringList> +namespace Utils { +class FilePath; +class Key; +} // Utils + namespace Core { class CORE_EXPORT SessionManager : public QObject @@ -79,9 +82,6 @@ signals: void sessionCreated(const QString &name); void sessionRenamed(const QString &oldName, const QString &newName); void sessionRemoved(const QString &name); - -private: - static void saveActiveMode(Utils::Id mode); }; } // namespace Core diff --git a/src/plugins/projectexplorer/projectmanager.cpp b/src/plugins/projectexplorer/projectmanager.cpp index 3f2f9cee749..9706a011ae2 100644 --- a/src/plugins/projectexplorer/projectmanager.cpp +++ b/src/plugins/projectexplorer/projectmanager.cpp @@ -3,7 +3,6 @@ #include "projectmanager.h" - #include "buildconfiguration.h" #include "editorconfiguration.h" #include "project.h" @@ -27,10 +26,9 @@ #include <texteditor/texteditor.h> #include <utils/algorithm.h> -#include <utils/filepath.h> +#include <utils/persistentsettings.h> #include <utils/qtcassert.h> #include <utils/stylehelper.h> -#include <utils/qtcassert.h> #include <QDebug> #include <QMessageBox> From 1a1dcfc5c779202f66282a2ecd544256c7e22b7c Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Wed, 4 Oct 2023 16:15:43 +0200 Subject: [PATCH 1555/1777] Core: Un-export and hide only locally used ProgressTimer Change-Id: If67b0d55972620a59a38a811fda6238d9cd4ab56 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../progressmanager/progressmanager.cpp | 60 +++++++++++-------- .../progressmanager/progressmanager.h | 17 ------ 2 files changed, 34 insertions(+), 43 deletions(-) diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.cpp b/src/plugins/coreplugin/progressmanager/progressmanager.cpp index bbad151c032..a2d61902b1c 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.cpp +++ b/src/plugins/coreplugin/progressmanager/progressmanager.cpp @@ -24,7 +24,8 @@ #include <QAction> #include <QEvent> -#include <QHBoxLayout> +#include <QFuture> +#include <QFutureInterfaceBase> #include <QMouseEvent> #include <QPainter> #include <QPropertyAnimation> @@ -42,6 +43,38 @@ using namespace Core::Internal; using namespace Utils; namespace Core { + +class ProgressTimer : public QObject +{ +public: + ProgressTimer(const QFutureInterfaceBase &futureInterface, int expectedSeconds, QObject *parent) + : QObject(parent), + m_futureInterface(futureInterface), + m_expectedTime(expectedSeconds) + { + m_futureInterface.setProgressRange(0, 100); + m_futureInterface.setProgressValue(0); + + m_timer.setInterval(TimerInterval); + connect(&m_timer, &QTimer::timeout, this, &ProgressTimer::handleTimeout); + m_timer.start(); + } + +private: + void handleTimeout() + { + ++m_currentTime; + const int halfLife = qRound(1000.0 * m_expectedTime / TimerInterval); + const int progress = MathUtils::interpolateTangential(m_currentTime, halfLife, 0, 100); + m_futureInterface.setProgressValue(progress); + } + + QFutureInterfaceBase m_futureInterface; + int m_expectedTime; + int m_currentTime = 0; + QTimer m_timer; +}; + /*! \class Core::ProgressManager \inheaderfile coreplugin/progressmanager/progressmanager.h @@ -789,29 +822,4 @@ void ProgressManager::cancelTasks(Id type) m_instance->doCancelTasks(type); } - -ProgressTimer::ProgressTimer(const QFutureInterfaceBase &futureInterface, - int expectedSeconds, - QObject *parent) - : QObject(parent), - m_futureInterface(futureInterface), - m_expectedTime(expectedSeconds) -{ - m_futureInterface.setProgressRange(0, 100); - m_futureInterface.setProgressValue(0); - - m_timer = new QTimer(this); - m_timer->setInterval(TimerInterval); - connect(m_timer, &QTimer::timeout, this, &ProgressTimer::handleTimeout); - m_timer->start(); -} - -void ProgressTimer::handleTimeout() -{ - ++m_currentTime; - const int halfLife = qRound(1000.0 * m_expectedTime / TimerInterval); - const int progress = MathUtils::interpolateTangential(m_currentTime, halfLife, 0, 100); - m_futureInterface.setProgressValue(progress); -} - } // Core diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.h b/src/plugins/coreplugin/progressmanager/progressmanager.h index 99580436ca2..f59fb0562fd 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.h +++ b/src/plugins/coreplugin/progressmanager/progressmanager.h @@ -11,8 +11,6 @@ #include <QFutureInterfaceBase> #include <QObject> -QT_FORWARD_DECLARE_CLASS(QTimer) - namespace Core { class FutureProgress; @@ -58,21 +56,6 @@ private: friend class Core::Internal::ProgressManagerPrivate; }; -class CORE_EXPORT ProgressTimer : public QObject -{ -public: - ProgressTimer(const QFutureInterfaceBase &futureInterface, int expectedSeconds, - QObject *parent = nullptr); - -private: - void handleTimeout(); - - QFutureInterfaceBase m_futureInterface; - int m_expectedTime; - int m_currentTime = 0; - QTimer *m_timer; -}; - } // namespace Core Q_DECLARE_OPERATORS_FOR_FLAGS(Core::ProgressManager::ProgressFlags) From 644e88ae2eef1e3042ef27e26a3f60141055ce85 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 12 Oct 2023 10:01:49 +0200 Subject: [PATCH 1556/1777] Utils: Emerge widgets from LayoutItem This allows us to call e.g. PushButton{}.emerge(); without having to add another unnecessary layout. Change-Id: Ica26f4776dee1843e1f40c238e1f3c1a54d14ea5 Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/layoutbuilder.cpp | 34 +++++++++++++++++-- .../tst_manual_widgets_layoutbuilder.cpp | 11 ++++++ 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/layoutbuilder.cpp b/src/libs/utils/layoutbuilder.cpp index a61a5fc474b..7fa3d5adf33 100644 --- a/src/libs/utils/layoutbuilder.cpp +++ b/src/libs/utils/layoutbuilder.cpp @@ -573,9 +573,26 @@ void LayoutItem::attachTo(QWidget *w) const QWidget *LayoutItem::emerge() { - auto w = new QWidget; - attachTo(w); - return w; + LayoutBuilder builder; + + builder.stack.append(Slice()); + addItemHelper(builder, *this); + + if (builder.stack.empty()) + return nullptr; + + QTC_ASSERT(builder.stack.last().pendingItems.size() == 1, return nullptr); + ResultItem ri = builder.stack.last().pendingItems.takeFirst(); + + QTC_ASSERT(ri.layout || ri.widget, return nullptr); + + if (ri.layout) { + auto w = new QWidget; + w->setLayout(ri.layout); + return w; + } + + return ri.widget; } static void layoutExit(LayoutBuilder &builder) @@ -861,6 +878,17 @@ LayoutItem title(const QString &title) }; } +LayoutItem windowTitle(const QString &windowTitle) +{ + return [windowTitle](QObject *target) { + if (auto widget = qobject_cast<QWidget *>(target)) { + widget->setWindowTitle(windowTitle); + } else { + QTC_CHECK(false); + } + }; +} + LayoutItem text(const QString &text) { return [text](QObject *target) { diff --git a/tests/manual/widgets/layoutbuilder/tst_manual_widgets_layoutbuilder.cpp b/tests/manual/widgets/layoutbuilder/tst_manual_widgets_layoutbuilder.cpp index 03a1cbc4bef..26ffe7f80f8 100644 --- a/tests/manual/widgets/layoutbuilder/tst_manual_widgets_layoutbuilder.cpp +++ b/tests/manual/widgets/layoutbuilder/tst_manual_widgets_layoutbuilder.cpp @@ -38,5 +38,16 @@ int main(int argc, char *argv[]) }, }.emerge()->show(); + Group { + windowTitle("Group without parent layout"), + title("This group was emerged without parent layout"), + Column { + Splitter { + new QTextEdit("First Widget"), + new QTextEdit("Second Widget"), + }, + } + }.emerge()->show(); + return app.exec(); } From db8d82e51e03a8e8675b7f9c29dada636c478078 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 12 Oct 2023 10:05:49 +0200 Subject: [PATCH 1557/1777] Utils: Change Stack to QStackedWidget We use a QStackedWidget instead of a QStackedLayout here because the latter will call "setVisible()" when a child is added, which can lead to the widget being spawned as a top-level widget. This can lead to the focus shifting away from the main application. Change-Id: I4746de2ea1a300d7c97735f0bbd9338cd2818b5d Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/layoutbuilder.cpp | 35 +++++++++++++------ .../compilerexploreraspects.cpp | 4 +-- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/libs/utils/layoutbuilder.cpp b/src/libs/utils/layoutbuilder.cpp index 7fa3d5adf33..23def250e25 100644 --- a/src/libs/utils/layoutbuilder.cpp +++ b/src/libs/utils/layoutbuilder.cpp @@ -14,6 +14,7 @@ #include <QSpinBox> #include <QSplitter> #include <QStackedLayout> +#include <QStackedWidget> #include <QStyle> #include <QTabWidget> #include <QTextEdit> @@ -396,14 +397,18 @@ void Slice::flush() for (const ResultItem &item : std::as_const(pendingItems)) addItemToFlowLayout(flowLayout, item); - } else if (auto stackLayout = qobject_cast<QStackedLayout *>(layout)) { + } else if (auto stackWidget = qobject_cast<QStackedWidget *>(widget)) { for (const ResultItem &item : std::as_const(pendingItems)) { if (item.widget) - stackLayout->addWidget(item.widget); - else + stackWidget->addWidget(item.widget); + else if (item.layout) { + auto w = new QWidget(); + w->setLayout(item.layout); + stackWidget->addWidget(w); + } else { QTC_CHECK(false); + } } - } else { QTC_CHECK(false); } @@ -656,13 +661,6 @@ Form::Form(std::initializer_list<LayoutItem> items) onExit = layoutExit; } -Stack::Stack(std::initializer_list<LayoutItem> items) -{ - subItems = items; - onAdd = [](LayoutBuilder &builder) { builder.stack.append(new QStackedLayout); }; - onExit = layoutExit; -} - LayoutItem br() { LayoutItem item; @@ -754,6 +752,21 @@ Group::Group(std::initializer_list<LayoutItem> items) setupWidget<QGroupBox>(this); } +Stack::Stack(std::initializer_list<LayoutItem> items) +{ + // We use a QStackedWidget instead of a QStackedLayout here because the latter will call + // "setVisible()" when a child is added, which can lead to the widget being spawned as a + // top-level widget. This can lead to the focus shifting away from the main application. + subItems = items; + onAdd = [](LayoutBuilder &builder) { builder.stack.append(new QStackedWidget); }; + onExit = [](LayoutBuilder &builder) { + QWidget *widget = builder.stack.last().widget; + builder.stack.last().flush(); + builder.stack.pop_back(); + builder.stack.last().pendingItems.append(ResultItem(widget)); + }; +} + PushButton::PushButton(std::initializer_list<LayoutItem> items) { this->subItems = items; diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.cpp b/src/plugins/compilerexplorer/compilerexploreraspects.cpp index 021914310de..0fd56d10500 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.cpp +++ b/src/plugins/compilerexplorer/compilerexploreraspects.cpp @@ -13,7 +13,7 @@ #include <QCompleter> #include <QFutureWatcher> #include <QPushButton> -#include <QStackedLayout> +#include <QStackedWidget> using namespace Utils; @@ -207,7 +207,7 @@ void LibrarySelectionAspect::addToLayout(Layouting::LayoutItem &parent) QPushButton *editBtn = new QPushButton(Tr::tr("Edit")); - QStackedLayout *stack{nullptr}; + QStackedWidget *stack{nullptr}; // clang-format off auto s = Stack { From 413fda678fc3c13b00f5f26c3867a62160f5abad Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 12 Oct 2023 10:39:25 +0200 Subject: [PATCH 1558/1777] Utils: Add "layouting" widgets to layoutbuilder This allows us to handle widgets that have an "addWidget" function. Change-Id: Id1b63bae7032403fdd3c5e6ba60283cf56cc1cfe Reviewed-by: hjk <hjk@qt.io> --- src/libs/utils/layoutbuilder.cpp | 76 ++++++++----------- .../tst_manual_widgets_layoutbuilder.cpp | 7 ++ 2 files changed, 39 insertions(+), 44 deletions(-) diff --git a/src/libs/utils/layoutbuilder.cpp b/src/libs/utils/layoutbuilder.cpp index 23def250e25..31c67e4d0f6 100644 --- a/src/libs/utils/layoutbuilder.cpp +++ b/src/libs/utils/layoutbuilder.cpp @@ -238,7 +238,7 @@ struct Slice { Slice() = default; Slice(QLayout *l) : layout(l) {} - Slice(QWidget *w) : widget(w) {} + Slice(QWidget *w, bool isLayouting=false) : widget(w), isLayouting(isLayouting) {} QLayout *layout = nullptr; QWidget *widget = nullptr; @@ -249,6 +249,7 @@ struct Slice int currentGridColumn = 0; int currentGridRow = 0; bool isFormAlignment = false; + bool isLayouting = false; Qt::Alignment align = {}; // Can be changed to // Grid or Form @@ -397,18 +398,6 @@ void Slice::flush() for (const ResultItem &item : std::as_const(pendingItems)) addItemToFlowLayout(flowLayout, item); - } else if (auto stackWidget = qobject_cast<QStackedWidget *>(widget)) { - for (const ResultItem &item : std::as_const(pendingItems)) { - if (item.widget) - stackWidget->addWidget(item.widget); - else if (item.layout) { - auto w = new QWidget(); - w->setLayout(item.layout); - stackWidget->addWidget(w); - } else { - QTC_CHECK(false); - } - } } else { QTC_CHECK(false); } @@ -606,10 +595,30 @@ static void layoutExit(LayoutBuilder &builder) QLayout *layout = builder.stack.last().layout; builder.stack.pop_back(); - if (QWidget *widget = builder.stack.last().widget) - widget->setLayout(layout); - else + if (builder.stack.last().isLayouting) { builder.stack.last().pendingItems.append(ResultItem(layout)); + } else if (QWidget *widget = builder.stack.last().widget) { + widget->setLayout(layout); + } else + builder.stack.last().pendingItems.append(ResultItem(layout)); +} + +template<class T> +static void layoutingWidgetExit(LayoutBuilder &builder) +{ + const Slice slice = builder.stack.last(); + T *w = qobject_cast<T *>(slice.widget); + for (const ResultItem &ri : slice.pendingItems) { + if (ri.widget) { + w->addWidget(ri.widget); + } else if (ri.layout) { + auto child = new QWidget; + child->setLayout(ri.layout); + w->addWidget(child); + } + } + builder.stack.pop_back(); + builder.stack.last().pendingItems.append(ResultItem(w)); } static void widgetExit(LayoutBuilder &builder) @@ -758,13 +767,10 @@ Stack::Stack(std::initializer_list<LayoutItem> items) // "setVisible()" when a child is added, which can lead to the widget being spawned as a // top-level widget. This can lead to the focus shifting away from the main application. subItems = items; - onAdd = [](LayoutBuilder &builder) { builder.stack.append(new QStackedWidget); }; - onExit = [](LayoutBuilder &builder) { - QWidget *widget = builder.stack.last().widget; - builder.stack.last().flush(); - builder.stack.pop_back(); - builder.stack.last().pendingItems.append(ResultItem(widget)); + onAdd = [](LayoutBuilder &builder) { + builder.stack.append(Slice(new QStackedWidget, true)); }; + onExit = layoutingWidgetExit<QStackedWidget>; } PushButton::PushButton(std::initializer_list<LayoutItem> items) @@ -791,18 +797,9 @@ Splitter::Splitter(std::initializer_list<LayoutItem> items) onAdd = [](LayoutBuilder &builder) { auto splitter = new QSplitter; splitter->setOrientation(Qt::Vertical); - builder.stack.append(splitter); - }; - onExit = [](LayoutBuilder &builder) { - const Slice slice = builder.stack.last(); - QSplitter *splitter = qobject_cast<QSplitter *>(slice.widget); - for (const ResultItem &ri : slice.pendingItems) { - if (ri.widget) - splitter->addWidget(ri.widget); - } - builder.stack.pop_back(); - builder.stack.last().pendingItems.append(ResultItem(splitter)); + builder.stack.append(Slice(splitter, true)); }; + onExit = layoutingWidgetExit<QSplitter>; } ToolBar::ToolBar(std::initializer_list<LayoutItem> items) @@ -811,18 +808,9 @@ ToolBar::ToolBar(std::initializer_list<LayoutItem> items) onAdd = [](LayoutBuilder &builder) { auto toolbar = new QToolBar; toolbar->setOrientation(Qt::Horizontal); - builder.stack.append(toolbar); - }; - onExit = [](LayoutBuilder &builder) { - const Slice slice = builder.stack.last(); - QToolBar *toolBar = qobject_cast<QToolBar *>(slice.widget); - for (const ResultItem &ri : slice.pendingItems) { - if (ri.widget) - toolBar->addWidget(ri.widget); - } - builder.stack.pop_back(); - builder.stack.last().pendingItems.append(ResultItem(toolBar)); + builder.stack.append(Slice(toolbar, true)); }; + onExit = layoutingWidgetExit<QToolBar>; } TabWidget::TabWidget(std::initializer_list<LayoutItem> items) diff --git a/tests/manual/widgets/layoutbuilder/tst_manual_widgets_layoutbuilder.cpp b/tests/manual/widgets/layoutbuilder/tst_manual_widgets_layoutbuilder.cpp index 26ffe7f80f8..343c500c287 100644 --- a/tests/manual/widgets/layoutbuilder/tst_manual_widgets_layoutbuilder.cpp +++ b/tests/manual/widgets/layoutbuilder/tst_manual_widgets_layoutbuilder.cpp @@ -49,5 +49,12 @@ int main(int argc, char *argv[]) } }.emerge()->show(); + + Splitter { + windowTitle("Splitter with sub layouts"), + Column {"First Widget"}, + Row {"Second Widget"}, + }.emerge()->show(); + return app.exec(); } From 25b747b00c0874edf1a13f2bcf5ff22836313326 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Wed, 11 Oct 2023 13:33:52 +0200 Subject: [PATCH 1559/1777] QmakeProjectManager: Compress project tree once from the root node We must not compress a half-built tree, as the relevant conditions might change later. For example, after setting up the headers node, we might have a tree src -> headers -> header.h, and compression will lead to src/headers -> header.h. Now after adding the sources node, we might have an additional main.cpp under src, which means src and headers should not have been merged. Fixes: QTCREATORBUG-29733 Change-Id: I1419a87a0671f43ad65cbe3d108c36cfeba17781 Reviewed-by: hjk <hjk@qt.io> --- src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp index 914c15cf155..01bae3472fd 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp @@ -195,7 +195,6 @@ static void createTree(QmakeBuildSystem *buildSystem, fileNode->setEnabled(fn.second == FileOrigin::ExactParse); vfolder->addNestedNode(std::move(fileNode)); } - vfolder->forEachFolderNode([](FolderNode *fn) { fn->compress(); }); } node->addNode(std::move(vfolder)); } @@ -265,6 +264,7 @@ std::unique_ptr<QmakeProFileNode> QmakeNodeTreeBuilder::buildTree(QmakeBuildSyst buildSystem->rootProFile()); root->setIcon(iconForProfile(buildSystem->rootProFile())); createTree(buildSystem, buildSystem->rootProFile(), root.get(), toExclude); + root->compress(); return root; } From 07f2c2430871026313657951965a4c1985e99364 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 12 Oct 2023 10:39:57 +0200 Subject: [PATCH 1560/1777] CompilerExplorer: Remove unnecessary emerge() Change-Id: Ibacd732c408a3aad31a5e1254fa2e7c551438a56 Reviewed-by: hjk <hjk@qt.io> --- .../compilerexploreraspects.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.cpp b/src/plugins/compilerexplorer/compilerexploreraspects.cpp index 0fd56d10500..35ec39ca62d 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.cpp +++ b/src/plugins/compilerexplorer/compilerexploreraspects.cpp @@ -207,22 +207,21 @@ void LibrarySelectionAspect::addToLayout(Layouting::LayoutItem &parent) QPushButton *editBtn = new QPushButton(Tr::tr("Edit")); - QStackedWidget *stack{nullptr}; - // clang-format off - auto s = Stack { - bindTo(&stack), - noMargin, - Row { noMargin, displayLabel, editBtn }.emerge(), - Row { noMargin, nameCombo, versionCombo, clearBtn }.emerge() - }.emerge(); + QStackedWidget *stack = static_cast<QStackedWidget*>( + Stack { + noMargin, + Row { noMargin, displayLabel, editBtn }, + Row { noMargin, nameCombo, versionCombo, clearBtn } + }.emerge() + ); // clang-format on connect(editBtn, &QPushButton::clicked, stack, [stack] { stack->setCurrentIndex(1); }); connect(this, &LibrarySelectionAspect::returnToDisplay, stack, [stack] { stack->setCurrentIndex(0); }); - addLabeledItem(parent, s); + addLabeledItem(parent, stack); } } // namespace CompilerExplorer From fe6dd868c525776c7aa98a965786ce157a4cf37c Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Wed, 11 Oct 2023 13:47:08 +0200 Subject: [PATCH 1561/1777] Doc: Describe Compiler Explorer Fixes: QTCREATORBUG-29720 Change-Id: I1de27d01a684249cd8bd3e5e8c98a551947a4436 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- dist/changelog/changes-12.0.0.md | 2 + .../images/qtcreator-compiler-explorer.webp | Bin 0 -> 16336 bytes doc/qtcreator/images/qtcreator-new-file.webp | Bin 17272 -> 8314 bytes .../howto/creator-only/creator-how-tos.qdoc | 5 + .../creator-only/creator-files-creating.qdoc | 9 +- ...how-to-create-compiler-explorer-setup.qdoc | 95 ++++++++++++++++++ doc/qtcreator/src/qtcreator-toc.qdoc | 2 + 7 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-compiler-explorer.webp create mode 100644 doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 0107cab7302..2c027e6530b 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -36,6 +36,8 @@ Every language, compiler and library that is supported at https://godbolt.org is also supported in Qt Creator. You can save your Compiler Explorer session as a `.qtce` file (JSON-based). +([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-explore-compiler-code.html)) + ### CMake Debugging and the Debug Adapter Protocol Set breakpoints in a CMake file and select `DAP` and `CMake Preset` in `Debug` diff --git a/doc/qtcreator/images/qtcreator-compiler-explorer.webp b/doc/qtcreator/images/qtcreator-compiler-explorer.webp new file mode 100644 index 0000000000000000000000000000000000000000..91efe84f9bfbab1fcb0a0f2ad21f72d94b7fad7a GIT binary patch literal 16336 zcmWIYbaOjl&%hAw>J$(bVBxdJo`FGM^6&(Pw8T4Zla$K;CF&nOXso2>pt9utt$-92 z^{AUmb9~hIX3c0{uv*WP$INTz(&<L`g}yG_Kl^W;_vI;*r_K8iC0pRBT()BY^Rd8d z|Nd{e>r<`2F;|*>W8e9ko^Q>*y_s`k+ge#`$+g*0um9h#PGn!b?QNWcHMib^J*>r3 zmLHy%xNPgr*T-(Y&GEmyF!!E=+t%CO7fO7~Ew@OjXYZJA<+p0{yjMM0x3}eP->l|* zHP5|P?)J8?C$?>U+p}czK7re1;?YO{Xi68}+P0g&xvYQUl^g%6a&CV+6YC+yu%Tzo z?>e{JiMHRi#6};zCGmL6w*1=%qn6Ly8#Qz5*EqYC|AkaMi&RuUJxK_53GSTpnEBSd z|J8cid+&KqdYihX(3AhPm{ttOf;%2dFH9+$aW6DsxnNBB?Axwf^S%`PZa6ntQQ?H{ zUUg%Ahxe`*YGeQZ|G#VfZ@cR|&(|KA$(}bkj*m^^JwugC^0siP3BPj$*X;1{2)%u; z!|?i@duiR<=DEJt?r6Bo&8g?mbUV$vsyNX?kUibBf%DYua!!rX>idEUiC<UD>tR^d zuJA`=?-|biEf37Z9WNg8dTcyzDJSDg*LP~IUrywjolV_lVDhMJ8^?pREewpycJ*lU zGJbBqJli4S$+aWz1_*zj267muIi@mUvAUObaDT<J19qv)8;$-7T{;^%2ha!uQA zTIppwJG$Cy+M7*nGWk3G{xw|v*P?m$|8q0{d)`(Hrv76TJRICoF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Av|NDn$UvIs)RMu zRa2UIQ<r?@w`VC4WtaYcY1Q92X{GZ_-jhn0cO7CD{SaC3`{K0&sRw?BFkMXHSKwXr zA-eBT^WO<vHEkZDVzYx;9+~p&iFISts(8Y(V5)nU?$(Lznjr!WN_(0V&Ay!QddQM0 z;G1Bl`}Qb%d^?NB?QfS`)glhY*RKEEX?OBt6ubBNgRj>Vt=zS?f<3;*z}Dg3n$zDm zzO8QpnWypgv)ymugX<H!`KLYkT<y8OP~eI48I}tynp3u&Y=~2kJ~LCvLHN(s_kv05 zJR3|FW=?f`zd4obPII4&^OKVd=cC^x*64pwdUB0vzRSFAISu@K)L)DHalAZ`|81H_ WbZGm=^L>F{jsHb{_#gazh93Yx9`#`W literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-new-file.webp b/doc/qtcreator/images/qtcreator-new-file.webp index 4429f37cd3c6315bfbc791a0c90c6aee2ff914eb..9bea2de2f9c71acae4fb01cf4f80dbf7744e511e 100644 GIT binary patch literal 8314 zcmWIYbaN|GU|<M$bqWXzu<%J$U|`Tcc_@kDYuBS~xiXpmH(p-%PdSO{z}hdSjyGSN zJ{f*N|JIR4>&a09OYf-V9aWsY?%A4tCiS^qzZ;fcwtcvt$GzdmqXSF<W@5QHvH$m5 z`5nFeu*>{G$hr-0-h4dRDPHbjHQ}Ib@SReYa-;0W@BS2&f9EPY{^<YzzyEJuexr8w zm~C_Q-RLhG>w=wfpZHvxHTl81;uA05XYj^O`u5-d_Otq|{5du!C73TM9^JmFJSfeo zcjnCUsPJdPn?1{36ml`T%WZyQ`}_2*ZMM15AMbzfyz}{%<l#tN(;FA%Q_|AX?2@19 zZt$CAoVI)t``_sgJSHi5zH<+ae!#xB;0r_c=l`0MZoim$zeWCM<d&k?Q`64$Xg1EA z>6e&h(>k;A@R>Qh#>Hkotp4zYnEw6$e|LIb-mhhE@60mO@J*;)wl?Z|UuM=Bo?V~L z?cBD6)8~m{weI?x;U{CKyO(OYMuo;I9N%_#+s@RA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;kPQ@?v3m_5%96b z#J;I*!MmMu&qNZ>O}pwc`^w_)bt$WsKWEl`wLIaz`ldc%o<8>jCaXoetzvb!x$>$i zZkPIY2%KPO<=Mxu<E7Aojf>vIUubXZ;JI}4b$dhm<F!$%H_khBqIE`gU7T?De}Npc z3JVLFX{rXlDylX)dW8llD%Dn0UF~XBZB<JA`YQai$YC=Pro^oqHq^Oy&1`PfNi6;S zcAJWFizKU3;?~^RXD*lC-)WV%wD$M4_a_RLJIf1kuC{(Rp>o%mx!RAzX3gHLS~=@o z#LCBEw>BPrmbl`@g~f}a-uEpw^1mo6eN5ZzjYaC`3-KmrJVk2*R90-e^G9mt@rS`5 z1%DXGEWh;alUsFr|E{^!fr{C80}`{QcYNC(&1d^GKWl!CXp8i+c}o2kj<&zFm?9Rv zecmmD|KAec$8^4_cCTJ_*(&ktwa1^Po~WC#ZP~H4S8kc^zkP3~)Q9pX?C)28lYjf% z<VNO;dd?O9{_cHND;3WCFY(iZ$4^dv3XyET6#urmVD-^r(+6+)|4k5l_5Z}d-7hV! xE3ua)t**GU;IfunzSR1P;1^*ZXDG`)w>ST74;u9YRpf>LHcyx^o9(>>0{|*=UpxQ+ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index a716f7aede6..04da01aaccf 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -58,6 +58,7 @@ \li \l {Add libraries to projects} \li \l {Add subprojects to projects} \li \l {Add wizards} + \li \l {Create compiler explorer sessions} \li \l {Create C++ classes} \li \l {Create files} \li \l {Create OpenGL fragment and vertex shaders} @@ -79,6 +80,10 @@ \section1 Build and Run + \list + \li \l {Explore compiler code} + \endlist + \section2 Manage Kits \list diff --git a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc index 494c7069b12..6498f2c70dd 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc @@ -46,6 +46,10 @@ or list models, \QD forms and a matching classes for Qt Widgets projects, Qt resource files, as well as QML and JavaScript files for Qt Quick projects. + \row + \li \uicontrol {Compiler Explorer} + \li Example setup for using Compiler Explorer to compile C++ or Python + code. \row \li \uicontrol {GLSL} \li OpenGL fragment and vertex shaders. @@ -68,8 +72,9 @@ \li Empty Nim source and script files. \endtable - \sa {Create C++ classes}, {Create OpenGL fragment and vertex shaders}, - {Create resource files}, {Use project wizards} + \sa {Create compiler explorer sessions}, {Create C++ classes}, + {Create OpenGL fragment and vertex shaders}, {Create resource files}, + {Use project wizards} */ /*! diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc new file mode 100644 index 00000000000..21e99086df3 --- /dev/null +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc @@ -0,0 +1,95 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-how-to-create-compiler-explorer-sessions.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects + + \title Create compiler explorer sessions + + To create a compiler explorer session for a C++ or Python project: + + \list 1 + \li Select \uicontrol File > \uicontrol {New File} > + \uicontrol {Compiler Explorer} > \uicontrol C++ or \uicontrol Python + > \uicontrol Choose. + \li Follow the instructions of the wizard to create an example + compiler explorer session as a JSON-based \c .qtce file and to open + it. + \endlist + + \note Enable the Compiler Explorer plugin to use it. + + \sa {Create files}, {Enable and disable plugins}, {Explore compiler code} +*/ + +/*! + \page creator-how-to-explore-compiler-code.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-build + + \title Explore compiler code + + With the \l{https://godbolt.org/}{Compiler Explorer}, you can enter code to + explore the capabilities of your compilers and interpreters. \QC supports + all languages, compilers, and libraries that Compiler Explorer supports. You + can save your compiler explorer session as a JSON-based \c .qtce file. + + \image qtcreator-compiler-explorer.webp {Python code in the compiler explorer} + + \note Enable the Compiler Explorer plugin to use it. + + To check how a compiler sees C++ or Python code: + + \list 1 + \li Select \uicontrol Tools > \uicontrol {Compiler Explorer} > + \uicontrol {Open Compiler Explorer}. + \li In the \uicontrol Language field, select the language to compile. + \li In the \uicontrol Compiler field, select a compiler to see the + assembly code. + \li Enter code to see the resulting assembly code. + \endlist + + You can also see the application status and output. + + To explore several compilers, select \uicontrol {Add Compiler}. + + \section1 Set compiler options + + Select \inlineimage icons/settings.png + to set compiler options. + + \table + \header + \li Setting + \li Value + \row + \li Compiler options + \li Arguments passed to the compiler. Add options to enable optimization + and to change other aspects of the compilation. + \row + \li Libraries + \li Add the libraries that your code links against. + \row + \li Execute the code + \li Execute the resulting executable. + \row + \li Compile to binary object + \li Convert the source code to a binary executable. + \row + \li Intel asm syntax + \li Use the Intel ASM syntax for writing the assembly code. + \row + \li Demangle identifiers + \li Extract and demangle identifiers from mangled symbols. + \e {Name mangling} adds descriptive data to a function's identifier + at link time. The data indicates which namespace and object a + function belongs to and which arguments it handles in which order. + \endtable + + \sa {Create compiler explorer sessions}, {Enable and disable plugins}, + {Add compilers}, {Add custom compilers} +*/ diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index bfc6e8122fa..bf2a02eba2a 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -211,6 +211,7 @@ \li \l {Add libraries to projects} \li \l {Add subprojects to projects} \li \l {Add wizards} + \li \l {Create compiler explorer sessions} \li \l {Create C++ classes} \li \l {Create files} \li \l {Create OpenGL fragment and vertex shaders} @@ -233,6 +234,7 @@ \li \l {Add Nim compilers} \li \l {Add Qt versions} \li \l {Edit Qbs profiles} + \li \l {Explore compiler code} \endlist \li Read Qt Documentation \list From c43ee0885cd2e96801322b1c9e30c9de65501e6d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 6 Oct 2023 19:17:18 +0200 Subject: [PATCH 1562/1777] SelectableFilesModel: Remove redundant variable Change-Id: I259ab5e918aa5fd8a12f08bdd683b2f8392f20ac Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> --- src/plugins/projectexplorer/selectablefilesmodel.cpp | 5 ++--- src/plugins/projectexplorer/selectablefilesmodel.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/projectexplorer/selectablefilesmodel.cpp b/src/plugins/projectexplorer/selectablefilesmodel.cpp index d7da1ad1f6d..7eef9c3ff41 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.cpp +++ b/src/plugins/projectexplorer/selectablefilesmodel.cpp @@ -38,7 +38,6 @@ SelectableFilesModel::SelectableFilesModel(QObject *parent) : QAbstractItemModel void SelectableFilesModel::setInitialMarkedFiles(const Utils::FilePaths &files) { m_files = Utils::toSet(files); - m_allFiles = files.isEmpty(); } void SelectableFilesFromDirModel::startParsing(const Utils::FilePath &baseDir) @@ -136,8 +135,8 @@ void SelectableFilesFromDirModel::buildTree(const Utils::FilePath &baseDir, Tree auto t = new Tree; t->parent = tree; t->name = fileInfo.fileName(); - FilterState state = filter(t); - t->checked = ((m_allFiles && state == FilterState::CHECKED) + const FilterState state = filter(t); + t->checked = ((m_files.isEmpty() && state == FilterState::CHECKED) || m_files.contains(fn)) ? Qt::Checked : Qt::Unchecked; t->fullPath = fn; t->isDir = false; diff --git a/src/plugins/projectexplorer/selectablefilesmodel.h b/src/plugins/projectexplorer/selectablefilesmodel.h index 38553c375ac..b8ce51111ed 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.h +++ b/src/plugins/projectexplorer/selectablefilesmodel.h @@ -121,7 +121,6 @@ private: void selectAllFiles(Tree *root); protected: - bool m_allFiles = true; QSet<Utils::FilePath> m_outOfBaseDirFiles; QSet<Utils::FilePath> m_files; Tree *m_root = nullptr; From be47810673c8d525106118010ebc1c45abbf38a1 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Wed, 11 Oct 2023 14:10:25 +0200 Subject: [PATCH 1563/1777] Debugger: Fix setting wrong engine manager for qml engine Fixes: QTCREATORBUG-29718 Change-Id: Iffd4c9ad6831b4a326fd9b84b9ae2829992caf80 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/debugger/debuggerengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index bd7f227ec8a..04befbf071c 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -727,7 +727,7 @@ void DebuggerEnginePrivate::setupViews() m_breakWindow->setObjectName("Debugger.Dock.Break." + engineId); m_breakWindow->setWindowTitle(Tr::tr("&Breakpoints")); - if (currentPerspective && currentPerspective->id() != Constants::PRESET_PERSPECTIVE_ID) + if (currentPerspective && currentPerspective->id() == Constants::DAP_PERSPECTIVE_ID) m_perspective->useSubPerspectiveSwitcher(EngineManager::dapEngineChooser()); else m_perspective->useSubPerspectiveSwitcher(EngineManager::engineChooser()); From 03e064f1ce858bd3ee1e4e492175b11463b8e938 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 12 Oct 2023 13:27:50 +0200 Subject: [PATCH 1564/1777] Copilot: Do not request completions for read only editors Fixes: QTCREATORBUG-29738 Change-Id: I7e894a079595265f163c63243a3e8b098696f696 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/copilot/copilotclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/copilot/copilotclient.cpp b/src/plugins/copilot/copilotclient.cpp index c166e2e37f6..6b09882dee9 100644 --- a/src/plugins/copilot/copilotclient.cpp +++ b/src/plugins/copilot/copilotclient.cpp @@ -129,7 +129,7 @@ void CopilotClient::openDocument(TextDocument *document) if (!textEditor || textEditor->document() != document) return; TextEditorWidget *widget = textEditor->editorWidget(); - if (widget->multiTextCursor().hasMultipleCursors()) + if (widget->isReadOnly() || widget->multiTextCursor().hasMultipleCursors()) return; const int cursorPosition = widget->textCursor().position(); if (cursorPosition < position || cursorPosition > position + charsAdded) From c8e5db79baf31b0f83de3d926462a1106f891f74 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 12 Oct 2023 14:19:18 +0200 Subject: [PATCH 1565/1777] DAP: Fix grey out cmake debug option Change-Id: Ic4f593c87b874835f923ca5d171f5c78c3fee191 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 4388aef0225..eb1c68eae36 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -173,8 +173,6 @@ CMakeManager::CMakeManager() }); connect(ProjectManager::instance(), &ProjectManager::startupProjectChanged, this, [this] { - updateCmakeActions(ProjectTree::currentNode()); - auto cmakeBuildSystem = qobject_cast<CMakeBuildSystem *>( ProjectManager::startupBuildSystem()); if (cmakeBuildSystem) { @@ -183,6 +181,7 @@ CMakeManager::CMakeManager() CMakeTool::Version version = tool ? tool->version() : CMakeTool::Version(); m_canDebugCMake = (version.major == 3 && version.minor >= 27) || version.major > 3; } + updateCmakeActions(ProjectTree::currentNode()); }); connect(BuildManager::instance(), &BuildManager::buildStateChanged, this, [this] { updateCmakeActions(ProjectTree::currentNode()); From b1b3a801d78ba5b2ba8e6a9a91c38b6e27c8a6d5 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 12 Oct 2023 14:23:50 +0200 Subject: [PATCH 1566/1777] DAP: Fix lower case m in cmake debugger engine Change-Id: I35d28c82ed0bde0c25a388d138e2bdc8648eefaf Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/debugger/dap/cmakedapengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/dap/cmakedapengine.cpp b/src/plugins/debugger/dap/cmakedapengine.cpp index d01f4488417..2c6400b0feb 100644 --- a/src/plugins/debugger/dap/cmakedapengine.cpp +++ b/src/plugins/debugger/dap/cmakedapengine.cpp @@ -103,7 +103,7 @@ CMakeDapEngine::CMakeDapEngine() : DapEngine() { setObjectName("CmakeDapEngine"); - setDebuggerName("Cmake"); + setDebuggerName("CMake"); setDebuggerType("DAP"); } From 2ebd21e0d4644d042927875ac5d0eddb68995f4e Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Thu, 12 Oct 2023 14:20:07 +0200 Subject: [PATCH 1567/1777] Beautifier: Fix layout of clang format settings page Change-Id: I972bf300ca7fb268174bda8a2b1334cab6350b1f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/beautifier/clangformat/clangformat.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index c8eab5ea0c2..0d6c9235da0 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -58,8 +58,9 @@ public: command.setLabelText(Tr::tr("Clang Format command:")); usePredefinedStyle.setSettingsKey("usePredefinedStyle"); - usePredefinedStyle.setLabelText(Tr::tr("Use predefined style:")); usePredefinedStyle.setDefaultValue(true); + usePredefinedStyle.setLabelPlacement(BoolAspect::LabelPlacement::Compact); + usePredefinedStyle.setLabelText(Tr::tr("Use predefined style:")); predefinedStyle.setSettingsKey("predefinedStyle"); predefinedStyle.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); From 78974347c5bbf2099f4954fe03fe2323c27012f3 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Thu, 12 Oct 2023 13:31:33 +0200 Subject: [PATCH 1568/1777] Doc: Describe screen recorder Fixes: QTCREATORBUG-29721 Change-Id: I19c1067b9394ff24e94be3ded4b9c20c5a01c364 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- dist/changelog/changes-12.0.0.md | 2 + doc/qtcreator/images/icons/camera.png | Bin 0 -> 208 bytes .../images/qtcreator-crop-and-trim.webp | Bin 0 -> 9840 bytes ...tcreator-preferences-screen-recording.webp | Bin 0 -> 8334 bytes .../images/qtcreator-record-screen.webp | Bin 0 -> 1972 bytes .../qtcreator-screen-recording-options.webp | Bin 0 -> 34220 bytes .../creator-how-to-record-screens.qdoc | 150 ++++++++++++++++++ .../howto/creator-only/creator-how-tos.qdoc | 1 + doc/qtcreator/src/qtcreator-toc.qdoc | 2 + 9 files changed, 155 insertions(+) create mode 100644 doc/qtcreator/images/icons/camera.png create mode 100644 doc/qtcreator/images/qtcreator-crop-and-trim.webp create mode 100644 doc/qtcreator/images/qtcreator-preferences-screen-recording.webp create mode 100644 doc/qtcreator/images/qtcreator-record-screen.webp create mode 100644 doc/qtcreator/images/qtcreator-screen-recording-options.webp create mode 100644 doc/qtcreator/src/howto/creator-only/creator-how-to-record-screens.qdoc diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 2c027e6530b..59efd088f94 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -52,6 +52,8 @@ To enable the ScreenRecorder plugin, select `Help > About Plugins > Utilities > ScreenRecorder`. Then select `Restart Now` to restart Qt Creator and load the plugin. +([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-record-screens.html)) + General ------- diff --git a/doc/qtcreator/images/icons/camera.png b/doc/qtcreator/images/icons/camera.png new file mode 100644 index 0000000000000000000000000000000000000000..34e29256ba1a4d79f2a50cff3d86619b7892aa4d GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd7G?$phPQVgfdsSyd_r6q7#JFe13!-5Sp_n# zB*-tAVdbjT+jks1eDvv$pTD`@|9Hs2z~JHO;uyjaot)snq*Ko9aODi=J)Y=Blkc$x zHx3-&p1AM8fzziC6fR>p^g<|#FHt7tLZbnn;SC3g&{L-sc)l5PDzN!j-*LFZz;JoD XtoLHc`4<@&7#KWV{an^LB{Ts5inUN? literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-crop-and-trim.webp b/doc/qtcreator/images/qtcreator-crop-and-trim.webp new file mode 100644 index 0000000000000000000000000000000000000000..d851b7a408ad588081fc259106e5a8957b220f24 GIT binary patch literal 9840 zcmWIYbaTs4V_*n(bqWXzu<(gdV_?vCcWPz$+VyB#u1xgr{MxfSzx8!+PS}&|p1MA? z^7&2`;rdl6kCwejG~U9<<8tq$ScU(Mr1I3rqO@Jxm(O4f+BQ?K<I=53TbMtsEBf-^ z{`m`!oz8g%`x@6TFiznUyuIybZ|?0EpKSKqvpsx&ed%mHv-0h?PNgl?^4n$GurGGr zO2wPoX1iUII~D0185eJOxnpDHmF4cXDQRib?w--mcbdT55GbN*YY@$#uNJNTj_>)q zy6?s1(>dSyy;%6a@5Z)571fz<_rAY(v_9s;|J`}FJ#JUO|2=Jym*$je{hsT-k2g(x zqII%&VYTo3FW>H&xB9&AoEL7am;d|DhOcY)eZ4o|#O`_hzvp*~`789-Wd<rcs^p$X z*kg1jA*gs^#GZybhFc_snH<}dlX(vtx=U7;=1%^k!4t0dUSiV<rxTH0o3`dooW<@T zeU9T?{AQ_RYyVAMVm9Hesq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loOTrHzA?7oAHx+ z+^u+hzZs>`TVLw$D|w#uQ`Mkx&6CMeI}L>x89tgWPLf_F@I~Eq!^US5`vT-e8SC0g zX1%Xbo1A$sK79SR&)l2yw736#bv6I)?%IEvDzf&XSFFrhX5}V0{88Zy@DXLwF_%7- zGK*h4;Yse9(`QAkw<<CzYt87En06}G(e-#6M~_CjUP^@4f7y_d`TxS#2TKJU*brjX z+||b`D6r68JeVns<%zM*l&2?sSM~7<axDCNf?K}QB|vD0OTx@MCM7R2H~&usCHF>w h*IV;1&M(%k-8*@A$jyz477>>9^^wo*uNOS71OQsg1yBG0 literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-preferences-screen-recording.webp b/doc/qtcreator/images/qtcreator-preferences-screen-recording.webp new file mode 100644 index 0000000000000000000000000000000000000000..b95ecb70a028441e2f747b8f317be71268c22061 GIT binary patch literal 8334 zcmWIYbaQJ{U|<M$bqWXzu<)r;U|`T!Je0$5mFw}gUYVJHr|-4ATdSPJRJ7p8rjune zI@r=wFP<uTTBi18RjreC$*n|H=|6#HKc?N-mRo(t<x>63nZ2?$md|YrJRP3Pyg7IG zxM8R4><`=)*K*?W(;{-uz1Dx>e<l7=?WO2^&vja*0SXzZiFX#Rx+|1=@`Mq`YJQf8 zJrbeSVO?9_mP*%lPhff@`ow<GHKD^@K_O{rVIk9aT~<6_vHxLA@#fyN3$g2Ea{u4n z_R}sjzTtvG+yRHGh1)}N?OM$8ZyFVzp0@koVit?s;`ZfVQeN5Xp4fJH+gZm$e3?Oe z``tXFjPx3h*PWcSH8*$m(WyKCEj5^YAYjiL)5zwU>%1P_Kg>VouKcw>e&PD>iD_wR zCl!y*a{K1<Fyr>^Z3hMK^eu4uaKf%}yN{*gvK%cD)1|AMW}E*h;W@GO?Xld3^&1;B zgBc&XFSFZoT8}qndKu>l-3A}tzvazllT@}Y{wrmEJEqLrc(U(<)hti_e%w9QzTkk@ z^K))Le*J!VEcr)IjTrZ;H*0FR-V4|rp8JXK5AT;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<@6rs(+$1@${;bbC5;)=W8Ntl`6x|HDh!>Fe>pn`#G>SOo7#OjyY$ z&AmHKV)556chhRKjJNwo<m`xQz9Rf!mtyo1F8;r<;)xwcZtM<amSUHku`zo?=b8s> zr{6G(s5QObD04UTOZwABRq>;Dc+{KZnT?Ehq#O(oTf6+d+3R5aDd!jK>WOe4W%^Qj yt>e~qd&8I;5fN7E*Q3||{FX1Plk+6=`4gKrQn7|l%%^+(3;s0!dT-Dhjn@EJG~NOL literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-record-screen.webp b/doc/qtcreator/images/qtcreator-record-screen.webp new file mode 100644 index 0000000000000000000000000000000000000000..b66e9c9e0646a0a88c45423eaa98bc291afa1548 GIT binary patch literal 1972 zcmWIYbaPw7&cG1v>J$(bVBs^Loq<9B?g24|t8Go&a%Z&KzuQ*Lpp?XvB_<<fV0O5r zJMW`p<=imW$bbJ$COy7w=bbe(^F(4BpYac|v^G1oxTJH5=ZxOZWAc7~IrP{6uiJ0g z&f{DDR*$#D_3EoeulE(QQf&GqkK*_bugkq1x+&1}I+L8PO_5@n?fhfk^!9q>IsQ{^ z-<xoK+gq*3*9^yA@86QJ=V-;MJ!YSicq1B~T&VAuq;fTv&6erX#J!Iheu~ezv2Cl) z=lPuPz<}@P^y@$VyOiy6yH?f7`9a)Vh+)Fn<;mHbY@b?{Zn=GOTW;;4Tn2`e;@X_( zt$S~7%YEGbPdn%KwnVq@jI|FvC%*S`d$RS@XMd}wUJ?usPKZxXU!5s>TIRCxk?Ty4 zGYw1jJaD{d;mv>h@7w2_fB$_pyY^nu4wmCS$3MS)Uv6J#C~2yEA!`3@V{0Mhd;Wd* z8p{`F=4u#As(bD?UHf&drKi!XX~&j)z2urE_GHHTqe8C>Z95M(3(7T3TebD*%SjWj zO0@CaZa(@>B7H^Jx(#)Ei<TWd8er0OV6)4ad%f2tpR_n|^4$81CyN7L-c7ZtY|`HD zw%b(QUM2A4iw}9{JY39A6#Y7|Tp_9H&AITO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qtcreator/images/qtcreator-screen-recording-options.webp b/doc/qtcreator/images/qtcreator-screen-recording-options.webp new file mode 100644 index 0000000000000000000000000000000000000000..1b4385e7a6bd7531ae545d1eceac05ff548ce12d GIT binary patch literal 34220 zcmWIYbaPwM%D@or>J$(bVBs^pm4QKD@K7a#DEAYyNiv>1|Ie<QCsp`JR#4bsef`7u zmztkX8GCDO4iK1aY~{G&!J~g%ix(N^o_nTNvFMDW^y!JkTRZ%?bYo|fF8DrISlc{k zQf0#Rz@^!m;{4g%{T`e4g*r!7Jh1ovd7%B}{(t``&N+6gJ~hAW&CGMLcVn+!ow|D0 z>grv~msh(9n=Y38nlZ^uBSNUhbsOiopU-x5?y!75=Y*s*Yjc5$Mf>5IuU5VC@c!mM zTblE|l*Nuc36`0u?`CD6R<e{^-`w%~3+uXv>pY}yOe|*Mewf2Jt$AI6O2s<9JEn<G z-#m7_R%N(*L-O6?LW^P<R=$`|n^@X;W3tay-QMOq@y@Ml?>bJLIrVB?R$8N}?UIAS z*B%@_v#0KK$}<1%nKNh3ys0rc=VV^wognAJ&>$C^k9T%#eH*CaIjPPw?b$m)$<ENJ zcUjNwF*#Gb<9IcD^&as<XF%YF$qk;Vtez7kB_A^SseO$XOW9p|dycgu(}|J`+qotw zrT)*{!|-9|Y_~`JH}A<xr}Qql=pl91L)rIwMu=|YwjA$>O;1m?mUJ<_w4IQ(+<Z<< z{=Q|e_bxf}^<MS+y&wMkuG@eA``I(g^Y?xH*k^M8frQ5tBWan*%=XthYbqCrEd3$$ zJV|hhIN!JK4Ik`gi-yZQ?ETykv{pt*%rO7{kH-0i7biVdX?Fa6B(T^pa8F$Nr4p`A zPlL^e%zk)FzKPWd=CN^=juUbJw=K7Rj@j*PZ-1QiV4Hrq@j=`9S5Hk8&V3Wt`S~FI zKikEdK{_wjtW-OxnUu1@@Y0$5zO&c1{eOMi?EL4yfB$b<Y!S&^#CIy@uPNK!=Dqi1 zbD#U1s@VL*DQFY-q}MYX>;LZiyWI75*oA9RyD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3t=P~}x&B7aH0h<w(*lET73EmWKkn1Q%QLILvhG64JkjLz z8T#AHk9@xEFBTbT_%7{?yUqTqDHBVd6x}=UXVbCnOMPKi{`e)_-oiWQrKQ)>y>E<S zj@;o7&`<lU^7!(_u=d}EvpXNM{#m)+I8M1&6?9MZ3f2v0Or@TkIdd!PUN7ik=JgG= zDRcjEWjAg*aqmFjs^^jE5$6{3GhOL^H!r2e>wNR#7kNn)8}DSLr$p$jx4WMq+rKG$ zOHk1H)bE>KblNOgn>LrRg8B5k$)Q{Bx_-UL^=ZRQ=jqZ7&&w_535RK9hHvxDO!0r9 zA$ryJX8!5LtShcR&M{JdrLbt%$un~8?$LE7lHY~hrB^!#2AO(kYM#2=b2H=g<4WFz z(Cd>6*Y`-;s;$;g7oQuz{OJJ82Bz!EYXUBLZ99A0cHZKv)Bexs>8_GHz1VE>uD5F4 zPoGP~=~T<e=-z*~Snu&cn^$!b*`I8bSKchTCdp9qcJI@Bd+Z(`jJq<gTKe2{4QH|Q zZ~LCR#2%jWcn!xbmvbC4TetnlIQ03C*yN+q_XKX%-v5v^v#R1toB5j$h33ki_8MGz z9H*ff;S{*?bY~*x`STq$2}^cMZWf&XF=6ILm9G_|FOL{R+wEjIC7t%+kJ$0z6Bqf8 zSGVwbS<TD6tad=wVxftos;knJuvtg9X>t~@`f2<X@G6&e)As$py?#sI8FoL7vo4j7 zjG|t4>PUa_<Z?OJ`-W$ZgH*i>^Shkg8B6-j<BqS}7{l^O=T~dDQdf(xoBl4Je?<!a z>bq@k>uv756<M|MO&sI2&kc5+%t9Vp&mWzaE8bgjcgjLR+xD_=^XE1cS}_0sy}F$8 literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-to-record-screens.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-to-record-screens.qdoc new file mode 100644 index 00000000000..b252eecc786 --- /dev/null +++ b/doc/qtcreator/src/howto/creator-only/creator-how-to-record-screens.qdoc @@ -0,0 +1,150 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-how-to-record-screens.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects + + \title Record screens + + With \l{https://ffmpeg.org/download.html}{FFmpeg}, you can record your + screens and save the recordings as animated images or videos. + + To record screens: + + \list 1 + \li Select \uicontrol Tools > \uicontrol {Screen Recording}. + \image qtcreator-record-screen.webp {Record Screen dialog} + \li Select \inlineimage icons/settings.png + to select the screen to record from and to set the recorded + screen area. + \li Select \inlineimage icons/recordfill.png + to start recording. + \li Select \inlineimage icons/stop_small.png + when you are done recording. + \li Select \uicontrol {Crop and Trim} to edit the recording. + \li Select \uicontrol Export to save the recording as an animated image + or a video. + \endlist + + \note Enable the Screen Recorder plugin to use it. + + \section1 Set the screen and area to record + + Set the screen and the area to record in the + \uicontrol {Screen Recording Options} dialog. + + \image qtcreator-screen-recording-options.webp {Screen Recording Options dialog} + + To select a screen and area: + + \list 1 + \li In \uicontrol Display, select the display to record. + \li In \uicontrol {Recorded screen area}, drag the guides to set the + \uicontrol x and \uicontrol y coordinates of the starting point for + the recording area, as well as the width and height of the area. + \li Select \uicontrol OK to return to the \uicontrol {Record Screen} + dialog. + \endlist + + Select \inlineimage icons/reset.png + to reset the area. + + \section1 Edit recordings + + You can crop and trim the recording in the \uicontrol {Crop and Trim} dialog. + + \image qtcreator-crop-and-trim.webp {Crop and Trim} + + To crop a recording, in \uicontrol Cropping, drag the guides to set the + \uicontrol x and \uicontrol y coordinates of the starting point of + the recorded area, as well as the width and height of the area. + + To save a cropped version of the current frame as a file, select + \inlineimage icons/savefile.png + . + + To copy a cropped version of the current frame to the clipboard, select + \inlineimage icons/camera.png + . + + To trim a recording: + + \list 1 + \li Click the slider to show a handle and drag it to the frame where + you want the recording to start. + \li Click \uicontrol Start to set the first frame. + \li Click the slider again and drag the handle to the frame where you + want the recording to end. + \li Click \uicontrol End to set the last frame. + \endlist + + Select \inlineimage icons/reset.png + to reset the crop area and trim range. + + \sa {Screen Recording}, {Enable and disable plugins} +*/ + +/*! + \page creator-preferences-screen-recording.html + \previouspage creator-reference.html + + \ingroup creator-reference-preferences + + \title Screen Recording + + \brief Set preferences for recording screens with FFmpeg. + + With \l{https://ffmpeg.org/download.html}{FFmpeg}, you can record your + screens and save the recordings as animated images or videos. You have + to download and install FFmpeg and FFprobe to use the screen recorder. + + \note Enable the Screen Recorder plugin to use it. + + To set up screen recording: + + \list 1 + \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > + \uicontrol {Screen Recording}. + \image qtcreator-preferences-screen-recording.webp {Screen Recording preferences} + \li In \uicontrol {ffmpeg tool}, set the path to the FFmpeg executable. + \li In \uicontrol {ffprobe tool}, set the path to the FFprobe executable. + \li Set preferences for recording screens and saving the recordings. + \endlist + + The following table lists the available preferences. + + \table + \header + \li Setting + \li Value + \row + \li \uicontrol {Capture the mouse cursor} + \li Whether to show the mouse cursor in the recording. + \row + \li \uicontrol {Capture device/filter} + \li The grabbing device or filter to use. If the recorder shows + error messages, try another grabbing device. + \row + \li \uicontrol {Size limit for intermediate output file} + \li To prevent huge files on your hard disk if you forget to stop + recording, for example, recording automatically stops when this + limit is reached. + \row + \li \uicontrol {RAM buffer for real-time frames} + \li The maximum size of a RAM buffer for storing real-time frames. + Increase the limit if frames are dropped during the recording. + \row + \li \uicontrol {Export animated images as infinite loop} + \li Whether to export animated images as inifite loops. Deselect + this check box to only play the animation once. + \row + \li \uicontrol {Write command line of FFmpeg calls to General Messages} + \li Shows the options used to run FFmpeg in the + \uicontrol {General Messages} view. + \endtable + + \sa {Record screens}, {Enable and disable plugins}, {View output} +*/ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 04da01aaccf..f00cedd5e80 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -118,6 +118,7 @@ \li \l {Inspect internal logs} \li \l {Install plugins} \li \l {Manage data collection} + \li \l {Record screens} \li \l {Run \QC from the command line} \li \l {Set up version control systems} \li \l {Use common VCS functions} diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index bf2a02eba2a..7c755247a9d 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -255,6 +255,7 @@ \li \l {Inspect internal logs} \li \l {Install plugins} \li \l {Manage data collection} + \li \l {Record screens} \li \l {Run \QC from the command line} \li \l {Set up version control systems} \li \l {Use common VCS functions} @@ -317,6 +318,7 @@ \li \l {Kits} \li \l {Nim} \li \l {Qt Quick Code Style} + \li \l {Screen Recording} \endlist \li Sidebar Views \list From fd92781e8758a37ebd128bc7cdfb4fa77b00bdec Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Thu, 12 Oct 2023 15:35:58 +0200 Subject: [PATCH 1569/1777] Doc: Use the \generatelist command in TOC, How To, and Reference ...to automatically list the topics in each group and avoid manual work. Task-number: QTCREATORBUG-29361 Change-Id: I45391b548354e6499bbd0698a9da8d6f9dc77dff Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../howto/creator-only/creator-how-tos.qdoc | 121 +---------- .../creator-only/creator-reference.qdoc | 12 +- doc/qtcreator/src/qtcreator-toc.qdoc | 188 +++--------------- 3 files changed, 44 insertions(+), 277 deletions(-) diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index f00cedd5e80..8b3bc4e31ad 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -16,134 +16,33 @@ The following topics describe how to use \QC to perform a particular task. + \section1 Build and Run + + \generatelist creator-how-to-build + \section1 Design UIs - \list - \li \l {Export SVG images} - \li \l {Run QML files} - \li \l {View images} - \endlist + \generatelist creator-how-to-design \section1 Edit Code - \list - \li \l {Add code snippets to the auto-complete menu} - \li \l {Document code} - \li \l {Enclose selected code in curly braces, parentheses, or double quotes} - \li \l {Indent text or code} - \li \l {Jump to a function in QML code} - \li \l {Locate files using the keyboard} - \li \l {Move between open files} - \li \l {Move to symbols} - \li \l {Paste text from clipboard history} - \li \l {Perform calculations} - \li \l {Search and replace across files using a regular expression} - \li \l {Select the enclosing block in C++} - \li \l {Sort lines alphabetically} - \li \l {Specify code style} - \li \l {Switch to Edit mode} - \li \l {Write down notes} - \endlist + \generatelist creator-how-to-edit \section1 Manage Projects - \table - \header - \li Create Projects - \li Configure Projects - \row - \li - \list - \li \l {Add a license header template for C++ code} - \li \l {Add libraries to projects} - \li \l {Add subprojects to projects} - \li \l {Add wizards} - \li \l {Create compiler explorer sessions} - \li \l {Create C++ classes} - \li \l {Create files} - \li \l {Create OpenGL fragment and vertex shaders} - \li \l {Create resource files} - \li \l {Create VCS repositories for new projects} - \li \l {Select the build system} - \li \l {Use project wizards} - \endlist - \li - \list - \li \l {Activate kits for a project} - \li \l {Develop Qt for Python applications} - \li \l {Open projects} - \li \l {Specify dependencies} - \li \l {Specify editor settings} - \li \l {Specify project contents} - \endlist - \endtable - - \section1 Build and Run - - \list - \li \l {Explore compiler code} - \endlist - - \section2 Manage Kits - - \list - \li \l {Add compilers} - \li \l {Add custom compilers} - \li \l {Add debuggers} - \li \l {Add kits} - \li \l {Add Nim compilers} - \li \l {Add Qt versions} - \li \l {Edit Qbs profiles} - \endlist + \generatelist creator-how-to-projects \section1 Read Qt Documentation - \list - \li \l {Add bookmarks to help pages} - \li \l {Add external documentation} - \li \l {Detach the help window} - \li \l {Filter documentation} - \li \l {Find information in Qt documentation} - \li \l {Get help} - \li \l {Search from documentation} - \li \l {Select the help start page} - \endlist + \generatelist creator-how-to-get-help \section1 Use \QC - \list - \li \l {Collect usage statistics} - \li \l {Enable and disable plugins} - \li \l {Find settings files} - \li \l {Inspect internal logs} - \li \l {Install plugins} - \li \l {Manage data collection} - \li \l {Record screens} - \li \l {Run \QC from the command line} - \li \l {Set up version control systems} - \li \l {Use common VCS functions} - \li \l {Use external text editors} - \li \l {Use external tools} - \li \l {Use Qt Linguist} - \endlist + \generatelist creator-how-to-use \section1 Use the UI - \list - \li \l {Assign keyboard shortcuts} - \li \l {Detach views} - \li \l {Find a particular preference} - \li \l {Find keyboard shortcuts} - \li \l {Find menu items on \macos} - \li \l {Import and export keyboard shortcuts} - \li \l {Set high DPI scaling} - \li \l {Set the number of recent files shown} - \li \l {Show and hide sidebars} - \li \l {Show task list files in Issues} - \li \l {Switch between modes} - \li \l {Switch UI themes} - \li \l {View output} - \endlist + \generatelist creator-how-to-ui */ /*! diff --git a/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc b/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc index 49bf944222f..2408b7f1828 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-reference.qdoc @@ -19,10 +19,6 @@ \annotatedlist creator-reference-build-systems - \section1 Output Views - - \annotatedlist creator-reference-output-views - \section1 Preferences \annotatedlist creator-reference-preferences @@ -35,7 +31,13 @@ \annotatedlist creator-reference-preferences-text-editor - \section1 Sidebar Views + \section1 Views + + \section2 Output Views + + \annotatedlist creator-reference-output-views + + \section2 Sidebar Views \annotatedlist creator-reference-sidebar-views */ diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 7c755247a9d..1694e78d9a0 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -145,7 +145,6 @@ \li \l{Viewing and Editing Register State} \li \l{Debugger Log} \li \l{Viewing Disassembled Code} - \li \endlist \li \l{Stopping Applications} \li \l{Examining Data} @@ -179,176 +178,43 @@ \endlist \li \l{How To} \list - \li Design UIs - \list - \li \l {Export SVG images} - \li \l {Run QML files} - \li \l {View images} - \endlist - \li Edit Code - \list - \li \l {Add code snippets to the auto-complete menu} - \li \l {Document code} - \li \l {Enclose selected code in curly braces, parentheses, or double quotes} - \li \l {Indent text or code} - \li \l {Jump to a function in QML code} - \li \l {Locate files using the keyboard} - \li \l {Move between open files} - \li \l {Move to symbols} - \li \l {Paste text from clipboard history} - \li \l {Perform calculations} - \li \l {Search and replace across files using a regular expression} - \li \l {Select the enclosing block in C++} - \li \l {Sort lines alphabetically} - \li \l {Specify code style} - \li \l {Switch to Edit mode} - \li \l {Write down notes} - \endlist - \li Manage Projects - \list - \li \l {Activate kits for a project} - \li \l {Add a license header template for C++ code} - \li \l {Add libraries to projects} - \li \l {Add subprojects to projects} - \li \l {Add wizards} - \li \l {Create compiler explorer sessions} - \li \l {Create C++ classes} - \li \l {Create files} - \li \l {Create OpenGL fragment and vertex shaders} - \li \l {Create resource files} - \li \l {Create VCS repositories for new projects} - \li \l {Develop Qt for Python applications} - \li \l {Open projects} - \li \l {Select the build system} - \li \l {Specify dependencies} - \li \l {Specify editor settings} - \li \l {Specify project contents} - \li \l {Use project wizards} - \endlist \li Build and Run - \list - \li \l {Add compilers} - \li \l {Add custom compilers} - \li \l {Add debuggers} - \li \l {Add kits} - \li \l {Add Nim compilers} - \li \l {Add Qt versions} - \li \l {Edit Qbs profiles} - \li \l {Explore compiler code} - \endlist + \generatelist creator-how-to-build + \li Design UIs + \generatelist creator-how-to-design + \li Edit Code + \generatelist creator-how-to-edit + \li Manage Projects + \generatelist creator-how-to-projects \li Read Qt Documentation - \list - \li \l {Add bookmarks to help pages} - \li \l {Add external documentation} - \li \l {Detach the help window} - \li \l {Filter documentation} - \li \l {Find information in Qt documentation} - \li \l {Get help} - \li \l {Search from documentation} - \li \l {Select the help start page} - \endlist + \generatelist creator-how-to-get-help \li Use \QC - \list - \li \l {Collect usage statistics} - \li \l {Enable and disable plugins} - \li \l {Find settings files} - \li \l {Inspect internal logs} - \li \l {Install plugins} - \li \l {Manage data collection} - \li \l {Record screens} - \li \l {Run \QC from the command line} - \li \l {Set up version control systems} - \li \l {Use common VCS functions} - \li \l {Use external text editors} - \li \l {Use external tools} - \li \l {Use Qt Linguist} - \endlist + \generatelist creator-how-to-use \li Use the UI - \list - \li \l {Assign keyboard shortcuts} - \li \l {Detach views} - \li \l {Find a particular preference} - \li \l {Find keyboard shortcuts} - \li \l {Find menu items on \macos} - \li \l {Import and export keyboard shortcuts} - \li \l {Set high DPI scaling} - \li \l {Set the number of recent files shown} - \li \l {Show and hide sidebars} - \li \l {Show task list files in Issues} - \li \l {Switch between modes} - \li \l {Switch UI themes} - \li \l {View output} - \endlist + \generatelist creator-how-to-ui \endlist \li \l{Reference} + \generatelist creator-reference \list - \li \l {Acknowledgements} - \li \l {Command-Line Options} - \li \l {Custom Wizards} - \li \l {FAQ} - \li \l {Glossary} - \li \l {Keyboard Shortcuts} - \li \l {Known Issues} - \li \l {Technical Support} - \li \l {Build Systems} - \list - \li \l{Managing Packages with vcpkg} - \li \l{Setting Up CMake} - \li \l{Setting Up Conan} - \li \l{Setting Up IncrediBuild} - \li \l{Setting Up Nimble} - \li \l{Setting Up Meson} - \li \l{Setting Up Qbs} - \li \l{Setting Up a Generic Project} - \li \l{Setting Up an Autotools Project} - \endlist - \li Output Views - \list - \li \l {Application Output} - \li \l {Compile Output} - \li \l {Issues} - \li \l {Search Results} - \li \l {To-Do Entries} - \endlist + \li Build Systems + \generatelist creator-reference-build-systems \li Preferences + \generatelist creator-reference-preferences \list - \li \l {Behavior} - \li \l {Compilers} - \li \l {C++ Code Style} - \li \l {Kits} - \li \l {Nim} - \li \l {Qt Quick Code Style} - \li \l {Screen Recording} - \endlist - \li Sidebar Views - \list - \li \l {Call Hierarchy} - \li \l {Class View} - \li \l {File System} - \li \l {Include Hierarchy} - \li \l {Open Documents} - \li \l {Outline} - \li \l {Projects} - \li \l {Type Hierarchy} - \endlist - \li \l {Supported Platforms} - \list - \li \l {Desktop Platforms} - \li \l {Embedded Platforms} - \li \l {Mobile Platforms} - \endlist - \li \l{Version Control Systems} - \list - \li \l {Bazaar} - \li \l {ClearCase} - \li \l {CVS} - \li \l {Fossil} - \li \l {Git} - \li \l {GitLab} - \li \l {Mercurial} - \li \l {Perforce} - \li \l {Subversion} + \li C++ + \generatelist creator-reference-preferences-cpp + \li Text editor + \generatelist creator-reference-preferences-text-editor \endlist + \li Version Control Systems + \generatelist creator-reference-vcs + \li Views + \list + \li Output Views + \generatelist creator-reference-output-views + \li Sidebar Views + \generatelist creator-reference-sidebar-views + \endlist \endlist \endlist */ From c044f6104bf0e87fc38e66645e731df6b12a36f5 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Thu, 12 Oct 2023 16:14:08 +0200 Subject: [PATCH 1570/1777] Doc: Add missing section to TOC and How To ...and fix some \brief commands. Task-number: QTCREATORBUG-29361 Change-Id: Ic37845ed5c7a02035fcc2e140fd35ad466fff2e3 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc | 4 ++++ .../src/projects/creator-only/creator-projects-compilers.qdoc | 3 +++ .../src/projects/creator-only/creator-projects-kits.qdoc | 4 +++- doc/qtcreator/src/qtcreator-toc.qdoc | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 8b3bc4e31ad..c5a61602087 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -28,6 +28,10 @@ \generatelist creator-how-to-edit + \section1 Manage Kits + + \generatelist creator-how-to-manage-kits + \section1 Manage Projects \generatelist creator-how-to-projects diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-compilers.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-compilers.qdoc index e484735af22..0499de45f7a 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-compilers.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-compilers.qdoc @@ -181,6 +181,9 @@ \title Compilers + \brief Lists the registered compilers. You can add custom compilers to the + list. + To build an application using GCC, \MinGW, Clang, or QCC, specify the path to the directory where the compiler is located and select the application binary interface (ABI) version from the list of available diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc index 583751d1512..16f14496f8d 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc @@ -72,7 +72,9 @@ \title Kits - \brief Kit preferences. + \brief Sets kit preferences. A kit consists of a set of values that define + one environment, such as a \e {device}, tool chain, Qt version, and debugger + command to use. Typically, only a subset of the kit preferences is relevant for a particular setup. Therefore, \QC plugins register sets of relevant preferences that you diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 1694e78d9a0..abebcb43861 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -184,6 +184,8 @@ \generatelist creator-how-to-design \li Edit Code \generatelist creator-how-to-edit + \li Manage Kits + \generatelist creator-how-to-manage-kits \li Manage Projects \generatelist creator-how-to-projects \li Read Qt Documentation From b265e0906c88d58f1999b52288a9a93ed483fbb9 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 11 Oct 2023 15:42:33 +0200 Subject: [PATCH 1571/1777] CompilerExplorer: Use StyledBar Change-Id: I9f80a025a6ed3a4732794b4715a25ce3b90f6d43 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../compilerexplorereditor.cpp | 56 ++++++++++++------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 3942e668a64..6ca54b356ac 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -28,6 +28,7 @@ #include <utils/mimetypes2/mimetype.h> #include <utils/mimeutils.h> #include <utils/store.h> +#include <utils/styledbar.h> #include <utils/utilsicons.h> #include <QCompleter> @@ -201,6 +202,8 @@ SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &se QUndoStack *undoStack) : m_sourceSettings(settings) { + auto toolBar = new StyledBar; + m_codeEditor = new CodeEditorWidget(m_sourceSettings, undoStack); connect(m_codeEditor, &CodeEditorWidget::gotFocus, this, &SourceEditorWidget::gotFocus); @@ -215,28 +218,32 @@ SourceEditorWidget::SourceEditorWidget(const std::shared_ptr<SourceSettings> &se m_codeEditor->setTextDocument(document); m_codeEditor->updateHighlighter(); - auto addCompilerButton = new QPushButton; + auto addCompilerButton = new QToolButton; addCompilerButton->setText(Tr::tr("Add Compiler")); connect(addCompilerButton, - &QPushButton::clicked, + &QToolButton::clicked, &settings->compilers, &AspectList::createAndAddItem); - auto removeSourceButton = new QPushButton; - removeSourceButton->setIcon(Utils::Icons::EDIT_CLEAR.icon()); + auto removeSourceButton = new QToolButton; + removeSourceButton->setIcon(Utils::Icons::CLOSE_TOOLBAR.icon()); removeSourceButton->setToolTip(Tr::tr("Remove Source")); - connect(removeSourceButton, &QPushButton::clicked, this, &SourceEditorWidget::remove); + connect(removeSourceButton, &QToolButton::clicked, this, &SourceEditorWidget::remove); // clang-format off using namespace Layouting; + Row { + settings->languageId, + addCompilerButton, + removeSourceButton, + customMargin({6, 0, 0, 0}), spacing(0), + }.attachTo(toolBar); + Column { - Row { - settings->languageId, - addCompilerButton, - removeSourceButton, - }, + toolBar, m_codeEditor, + noMargin(), spacing(0), }.attachTo(this); // clang-format on @@ -272,6 +279,8 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett m_delayTimer, qOverload<>(&QTimer::start)); + auto toolBar = new StyledBar; + m_asmEditor = new AsmEditorWidget(undoStack); m_asmDocument = QSharedPointer<TextDocument>(new TextDocument); m_asmDocument->setFilePath("asm.asm"); @@ -281,7 +290,7 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett connect(m_asmEditor, &AsmEditorWidget::gotFocus, this, &CompilerWidget::gotFocus); - auto advButton = new QPushButton; + auto advButton = new QToolButton; QSplitter *splitter{nullptr}; auto advDlg = new QAction; @@ -297,13 +306,13 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett dlg->setGeometry(rect); }); - connect(advButton, &QPushButton::clicked, advDlg, &QAction::trigger); + connect(advButton, &QToolButton::clicked, advDlg, &QAction::trigger); advButton->setIcon(advDlg->icon()); - auto removeCompilerBtn = new QPushButton; - removeCompilerBtn->setIcon(Utils::Icons::EDIT_CLEAR.icon()); + auto removeCompilerBtn = new QToolButton; + removeCompilerBtn->setIcon(Utils::Icons::CLOSE_TOOLBAR.icon()); removeCompilerBtn->setToolTip(Tr::tr("Remove Compiler")); - connect(removeCompilerBtn, &QPushButton::clicked, this, &CompilerWidget::remove); + connect(removeCompilerBtn, &QToolButton::clicked, this, &CompilerWidget::remove); compile(m_sourceSettings->source()); @@ -312,17 +321,22 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett }); // clang-format off + + Row { + m_compilerSettings->compiler, + advButton, + removeCompilerBtn, + customMargin({6, 0, 0, 0}), spacing(0), + }.attachTo(toolBar); + Column { - Row { - m_compilerSettings->compiler, - advButton, - removeCompilerBtn, - }, + toolBar, Splitter { bindTo(&splitter), m_asmEditor, createTerminal() - } + }, + noMargin(), spacing(0), }.attachTo(this); // clang-format on From 9f0068a4e17f7d824d6a326262114f62bd76b37b Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 12 Oct 2023 19:40:41 +0200 Subject: [PATCH 1572/1777] Perfparser: Update submodule ... contains a test fix for MSVC. Change-Id: I5127075bd32e52ad205324728f05bc288b04a8be Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/tools/perfparser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/perfparser b/src/tools/perfparser index be86a8ea6b7..ca9077a4ae9 160000 --- a/src/tools/perfparser +++ b/src/tools/perfparser @@ -1 +1 @@ -Subproject commit be86a8ea6b7671c7a60abc6e51db27ace7baedb9 +Subproject commit ca9077a4ae9d301383fc2f3021eadfede5d48804 From 7cd63a597efd7b86456e78e8a6d5355825f40611 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 13 Oct 2023 08:54:03 +0200 Subject: [PATCH 1573/1777] Copilot: Add more search paths for agent.js Fixes: QTCREATORBUG-29750 Change-Id: I19c5ad41705daf00ae08fec88bd9ed40b8a34d12 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/copilot/copilotsettings.cpp | 30 +++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index 38683d9acdf..24e83618788 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -43,15 +43,27 @@ CopilotSettings::CopilotSettings() const FilePath nodeFromPath = FilePath("node").searchInPath(); - const FilePaths searchDirs - = {FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/dist/agent.js"), - FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/copilot/dist/agent.js"), - FilePath::fromUserInput( - "~/.config/nvim/pack/github/start/copilot.vim/copilot/dist/agent.js"), - FilePath::fromUserInput( - "~/vimfiles/pack/github/start/copilot.vim/copilot/dist/agent.js"), - FilePath::fromUserInput( - "~/AppData/Local/nvim/pack/github/start/copilot.vim/copilot/dist/agent.js")}; + // clang-format off + + // From: https://github.com/github/copilot.vim/blob/release/README.md#getting-started + const FilePaths searchDirs = { + // Vim, Linux/macOS: + FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/dist/agent.js"), + FilePath::fromUserInput("~/.vim/pack/github/start/copilot.vim/copilot/dist/agent.js"), + + // Neovim, Linux/macOS: + FilePath::fromUserInput("~/.config/nvim/pack/github/start/copilot.vim/dist/agent.js"), + FilePath::fromUserInput("~/.config/nvim/pack/github/start/copilot.vim/copilot/dist/agent.js"), + + // Vim, Windows (PowerShell command): + FilePath::fromUserInput("~/vimfiles/pack/github/start/copilot.vim/dist/agent.js"), + FilePath::fromUserInput("~/vimfiles/pack/github/start/copilot.vim/copilot/dist/agent.js"), + + // Neovim, Windows (PowerShell command): + FilePath::fromUserInput("~/AppData/Local/nvim/pack/github/start/copilot.vim/dist/agent.js"), + FilePath::fromUserInput("~/AppData/Local/nvim/pack/github/start/copilot.vim/copilot/dist/agent.js") + }; + // clang-format on const FilePath distFromVim = findOrDefault(searchDirs, &FilePath::exists); From 1418dc04e022c4d193c1fb0b5f9a0a4c53434d01 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 12 Oct 2023 13:36:35 +0200 Subject: [PATCH 1574/1777] ScreenRecorder: Allow only one screen recorder dialog at a time And show the dialog if it was already open but minimized. Change-Id: I9aebebba88488c795b253f6dadda7f356ffc9dc4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../screenrecorder/screenrecorderplugin.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/plugins/screenrecorder/screenrecorderplugin.cpp b/src/plugins/screenrecorder/screenrecorderplugin.cpp index e5160eec348..e72ebf945e9 100644 --- a/src/plugins/screenrecorder/screenrecorderplugin.cpp +++ b/src/plugins/screenrecorder/screenrecorderplugin.cpp @@ -94,6 +94,19 @@ public: layout()->setSizeConstraint(QLayout::SetFixedSize); } + static void showDialog() + { + static QPointer<QDialog> staticInstance; + + if (staticInstance.isNull()) { + staticInstance = new ScreenRecorderDialog(Core::ICore::dialogParent()); + staticInstance->setAttribute(Qt::WA_DeleteOnClose); + } + staticInstance->show(); + staticInstance->raise(); + staticInstance->activateWindow(); + } + private: RecordWidget *m_recordWidget; TemporaryFile m_recordFile; @@ -132,9 +145,7 @@ private: return; } - auto dialog = new ScreenRecorderDialog(Core::ICore::dialogParent()); - dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->show(); + ScreenRecorderDialog::showDialog(); } }; From 7459fb0c7556d5d368165749d914b220bc1c10e0 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 11 Oct 2023 10:08:40 +0200 Subject: [PATCH 1575/1777] SquishTests: Tweak the handling of special clang When expecting the clang from llvm used to build QC we nowadays have to resolve symbolc links. Change-Id: I54cfecc15d77f244eccd81d5cdd14ec7297e1eeb Reviewed-by: David Schulz <david.schulz@qt.io> --- tests/system/suite_general/tst_default_settings/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/system/suite_general/tst_default_settings/test.py b/tests/system/suite_general/tst_default_settings/test.py index 428276722e9..95391864c24 100644 --- a/tests/system/suite_general/tst_default_settings/test.py +++ b/tests/system/suite_general/tst_default_settings/test.py @@ -39,6 +39,7 @@ def __checkKits__(): internalClangExe = os.path.join(llvmForBuild, "bin", "clang") if platform.system() in ("Microsoft", "Windows"): internalClangExe += ".exe" + internalClangExe = os.path.realpath(internalClangExe) # clean symlinks if os.path.exists(internalClangExe): expectedCompilers.append(internalClangExe) foundCompilers = [] From 25a1fb4e9c3b7ee6f179a36092ed1a65d8fd8709 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 11 Oct 2023 13:11:39 +0200 Subject: [PATCH 1576/1777] SquishTests: Fix testing of welcome page The examples and tutorials part of the welcome page got a new approach which is either having a sectioned grid view or a non-sectioned grid view (while searching). That means we have now a model holding the items of several other (sub)models and a filter model taking care of what is shown while searching. While searching we need to check the filter model, while for not-search the original list view could be used as we did before this patch. But as there are no access or verification of the whole list this done is just replacing the old approach. Change-Id: I1777340f8c6ea88af3bfc20a600ee1c174a18807 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/coreplugin/welcomepagehelper.cpp | 1 + tests/system/shared/welcome.py | 10 +++++++++- tests/system/suite_WELP/tst_WELP01/test.py | 2 +- tests/system/suite_WELP/tst_WELP03/test.py | 18 ++++++++++-------- tests/system/suite_WELP/tst_WELP04/test.py | 8 ++++---- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/plugins/coreplugin/welcomepagehelper.cpp b/src/plugins/coreplugin/welcomepagehelper.cpp index 8129a644ae1..d80942f13d4 100644 --- a/src/plugins/coreplugin/welcomepagehelper.cpp +++ b/src/plugins/coreplugin/welcomepagehelper.cpp @@ -729,6 +729,7 @@ void SectionedGridView::setSearchString(const QString &searchString) // We don't have a grid set for searching yet. // Create all items view for filtering. m_allItemsView.reset(new GridView); + m_allItemsView->setObjectName("AllItemsView"); // used by Squish m_allItemsView->setModel(new ListModelFilter(m_allItemsModel.get(), m_allItemsView.get())); if (m_itemDelegate) m_allItemsView->setItemDelegate(m_itemDelegate); diff --git a/tests/system/shared/welcome.py b/tests/system/shared/welcome.py index e945956b6e6..8066f271318 100644 --- a/tests/system/shared/welcome.py +++ b/tests/system/shared/welcome.py @@ -44,7 +44,15 @@ def switchToSubMode(subModeLabel): return frameAndLabelFound def findExampleOrTutorial(tableView, regex, verbose=False): - children = __childrenOfType__(tableView, 'QModelIndex') + filterModel = __childrenOfType__(tableView, 'QSortFilterProxyModel') + if len(filterModel) != 1: + test.fatal("Something's wrong - could not find filter proxy model.") + return None + filterModel = filterModel[0] + if filterModel.rowCount() == 0: + return None + + children = dumpIndices(filterModel) for child in children: if re.match(regex, str(child.text)): if verbose: diff --git a/tests/system/suite_WELP/tst_WELP01/test.py b/tests/system/suite_WELP/tst_WELP01/test.py index b64edcd2b7f..0bc65d1f001 100644 --- a/tests/system/suite_WELP/tst_WELP01/test.py +++ b/tests/system/suite_WELP/tst_WELP01/test.py @@ -137,7 +137,7 @@ def main(): for (qType, prop, info) in expect: test.verify(checkIfObjectExists(search % (qType, prop)), "Verifying whether %s is shown" % info) - checkTableViewForContent(search % (expect[0][0], expect[0][1]), "Help: Creating .*", "Tutorials", + checkTableViewForContent(search % (expect[0][0], expect[0][1]), "Creating .*", "Tutorials", "Verifying that at least one tutorial is displayed.") # exit Qt Creator invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_WELP/tst_WELP03/test.py b/tests/system/suite_WELP/tst_WELP03/test.py index 7c672464eb3..b09fa9e2a90 100644 --- a/tests/system/suite_WELP/tst_WELP03/test.py +++ b/tests/system/suite_WELP/tst_WELP03/test.py @@ -21,19 +21,21 @@ def handlePackagingMessageBoxes(): def openExample(examplesLineEdit, input, exampleRegex, exampleName, waitForChildCount=0): replaceEditorContent(examplesLineEdit, input) - listView = waitForObject("{type='QListView' unnamed='1' visible='1' " + listView = waitForObject("{type='QListView' name='AllItemsView' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow'}") + filterModel = __childrenOfType__(listView, 'QSortFilterProxyModel') + if len(filterModel) != 1: + test.fatal("Failed to find filter proxy model.") + return None + + filterModel = filterModel[0] if waitForChildCount > 0: - - def childCount(view): - return len(__childrenOfType__(view, 'QModelIndex')) - - waitFor("childCount(listView) == waitForChildCount", 3000) + waitFor("filterModel.rowCount() == waitForChildCount", 3000) waitFor('findExampleOrTutorial(listView, exampleRegex) is not None', 3000) example = findExampleOrTutorial(listView, exampleRegex, True) if test.verify(example is not None, "Verifying: Example (%s) is shown." % exampleName): - mouseClick(example) + mouseClick(waitForObjectItem(listView, str(example.text))) handlePackagingMessageBoxes() helpWidget = waitForObject(":Help Widget_Help::Internal::HelpWidget") test.verify(waitFor('exampleName in str(helpWidget.windowTitle)', 5000), @@ -74,7 +76,7 @@ def main(): combo = waitForObject(search % (expect[2][0], expect[2][1])) test.log("Using examples from Kit %s." % str(combo.currentText)) replaceEditorContent(examplesLineEdit, "qwerty") - listView = waitForObject(search % (expect[0][0], expect[0][1])) + listView = waitForObject("{type='QListView' name='AllItemsView'}") waitFor('findExampleOrTutorial(listView, ".*") is None', 3000) example = findExampleOrTutorial(listView, ".*", True) test.verify(example is None, "Verifying: No example is shown.") diff --git a/tests/system/suite_WELP/tst_WELP04/test.py b/tests/system/suite_WELP/tst_WELP04/test.py index 557059a3309..c9a18066693 100644 --- a/tests/system/suite_WELP/tst_WELP04/test.py +++ b/tests/system/suite_WELP/tst_WELP04/test.py @@ -6,7 +6,7 @@ source("../../shared/qtcreator.py") def __waitForListView__(): listView = waitForObject("{container=':Qt Creator.WelcomeScreenStackedWidget' " - "type='QListView' unnamed='1' visible='1'}") + "type='QListView' name='AllItemsView' visible='1'}") return listView @@ -34,7 +34,7 @@ def main(): tutorial = findExampleOrTutorial(listView, ".*", True) test.verify(tutorial is None, "Verifying: 'Tutorials' topic is opened and nothing is shown.") - bnr = "Help: Building and Running an Example" + bnr = "Building and Running an Example" replaceEditorContent(searchTutorials, bnr.lower()) listView = __waitForListView__() waitFor('findExampleOrTutorial(listView, "%s.*") is not None' % bnr, 3000) @@ -43,7 +43,7 @@ def main(): # clicking before documentation was updated will open the tutorial in browser progressBarWait(warn=False) # select a text tutorial - mouseClick(tutorial) + mouseClick(waitForObjectItem(listView, str(tutorial.text))) test.verify("Building and Running an Example" in str(waitForObject(":Help Widget_Help::Internal::HelpWidget").windowTitle), "Verifying: The tutorial is opened inside Help.") @@ -52,7 +52,7 @@ def main(): # check a demonstration video link mouseClick(searchTutorials) replaceEditorContent(searchTutorials, "embedded device") - embeddedTutorial = "Online: How to install and set up Qt for Device Creation.*" + embeddedTutorial = "How to install and set up Qt for Device Creation.*" listView = __waitForListView__() waitFor('findExampleOrTutorial(listView, embeddedTutorial) is not None', 3000) tutorial = findExampleOrTutorial(listView, embeddedTutorial, True) From c324ef6321e949e275e951b461aa5e35f135709a Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 13 Oct 2023 11:48:54 +0200 Subject: [PATCH 1577/1777] Doc: Edit compiler explorer options docs Update the screenshot after string changes. Change-Id: Ie6efb13018828b20180b0ff3df2e4607089c8b03 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../qtcreator-compiler-explorer-options.webp | Bin 0 -> 4706 bytes .../images/qtcreator-compiler-explorer.webp | Bin 16336 -> 14210 bytes ...how-to-create-compiler-explorer-setup.qdoc | 12 +++++++++--- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-compiler-explorer-options.webp diff --git a/doc/qtcreator/images/qtcreator-compiler-explorer-options.webp b/doc/qtcreator/images/qtcreator-compiler-explorer-options.webp new file mode 100644 index 0000000000000000000000000000000000000000..d0fc90988508c1101e8becd295377ce7673b6d36 GIT binary patch literal 4706 zcmWIYbaRUmVqge&bqWXzu<-E{VqnnsJ><-=mF@AiT$P!Br`uMqH~-z+!Rg`en%0>t zrZ4bY{hr1o<7SuM`n7By)%woFy}40){-W)@@(m~3wJu%pkaFt1GR2pxBrN5hnT_}F z``b2d%e}mn_hZ*w8NIJli_cj;mwBRn{NkxOaX+Q>`_}DYj6E8e&*HvU_Ez(1pFjWW z8yH-e_tfa#6u-OZZ~1Ny$CA}Km$Wpt<)&xz{k?c&-4VsrCue7ts&0Cb&$d&lQ)N@| ziN+@$lT?n*{mUD&`7a~WkN<{~=ZY(Yp66Yc?frK;i|3>}W~Pb}+;P0exfC3IipBl} z{`+sA`}vRlPP;S7X?*?VS}e!T?1|-0PD{J@XN&qf&;OTH{w}${ZBEgtDO)ziT33Yz z9t?DF%DG*3JBM$gVTk{ql{FR~OBd``aM>igZKr744T+>yd(qQJ6Q(-<e`qjiiN`6c znjYrY7wc2r_il;lnjZFuU;eiLJ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c0W z8(nQV6u`+k<vQcWuEUG<)K(iiD0?}iiUmxX=u^RG^LM6srcU{T^dEMA7uv0QEVTSV zDMO>GXv*Q46H>&}IW$+CVe&GXq-ke$ceV8UEA@wDIi5XhxuJ4Y@W3Rl0|jaxA2`$# zX0lF6(YU<-A^&N;^;Z)=TvV@Mnij&q=BdQY(<?V6vO%%U>ET`8T{3I?HCH=S%Q9TJ zp?07^Eu~N-B8^c~^2DDT0#cekzRJcjD*Le6xGSb!+I{ws&(~?Z?uR7wH!sMsT9<WS z#Q6V1$$$UYpJYrgbxbi|&?xJnDdhQhrrpc0hQ(KZZvW4CW<uv`lSL}5&pAGS)Oi2R zUZHC4j}r;MS6J`=X0O0FUyf%kzsF+ct?y4NPjD4e;1yhOL62)g1M{>wJ5F7UIC4|; zYs7zM%MT*Klib+7?oVbnox!Z&6;|GO##Ql(?CE`X`VVIR<zJ$*aPb^|r@NYU{&Jfd z6$7$TCTXfnYRPQ6{!9Kuy7wvlfIstWUNkCtG)xkm;L)@^{b2N8ew7aKx<fx3oPJh+ zn!wM~xN5h9;Lpz0F>Y7w-qcTEOSo|O!cT_9e{3sRR-Ir9>UG(qagD*Tey98elZ7rH z>=}0JpXx22?OWq7xAfvfgR@>a3a7z2!FaXIqm*?q!Lfxep9;F?C9KVPVOqIi@7*H* NV412)7vFec9so_+2|)k= literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-compiler-explorer.webp b/doc/qtcreator/images/qtcreator-compiler-explorer.webp index 91efe84f9bfbab1fcb0a0f2ad21f72d94b7fad7a..3fb945df38b29ae5b54c66453a2b1e1058e106ee 100644 GIT binary patch literal 14210 zcmWIYbaSgRXJ80-bqWXzu<*$>XJF9hJ>1A3+WmOjL>bRh_HVN5|A`9<Gido9JuCR+ zYgC`kwGd{ONi!Ui12~l@xQ4QoG6q!Jhsx)--m9K`?|1X=2R+}`^hub#tIC(S{k#7B z-EEb(%rCjWW;q)-?F`S(FDs^~rfK$hDOYpI#kz5tRV6H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s)RMu zRa2UIQ<r?@w`VC4WtaYcY1Q92X{GZ_-jhn0cO7CD{SaC3`{K0&sRw?BFkMXHSKwXr zA-eBT^WO<vHEkZDVzYx;9+~p&iFISts(8Y(V5)nU?$(Lznjr!WN_(0V&Ay!QddQM0 z;G1Bl`}Qb%d^?NB?QfS`)glhY*RKEEX?OBt6ubBNgRj>Vt=zS?f<3;*z}Dg3n$zDm zzO8QpnWypgv)ymugX<H!`KLYkT<y8OP~eI48I}tynp3u&Y=~2kJ~LCvLHN(s_kv05 zJR3|FW=?f`zd4obPII4&^OKVd=cC^x*64pwdUB0vzRSFAISu@K)L)DHalAZ`|81H_ WbZGm=^L>F{jsHb{_#gazh93Yx9`#`W diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc index 21e99086df3..5c20e55d2c2 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc @@ -60,7 +60,9 @@ \section1 Set compiler options Select \inlineimage icons/settings.png - to set compiler options. + to set options for the selected compiler. + + \image qtcreator-compiler-explorer-options.webp {Compiler Explorer options} \table \header @@ -69,10 +71,14 @@ \row \li Compiler options \li Arguments passed to the compiler. Add options to enable optimization - and to change other aspects of the compilation. + and to change other aspects of the compilation. For example, the + value \c -O3 enables the optimizer with aggressive optimization. \row \li Libraries - \li Add the libraries that your code links against. + \li Select \uicontrol Edit to add the libraries that your code links + against. Start typing in the field to find a particular library. + The selection is saved only after you select the version of the + library next to the library name. \row \li Execute the code \li Execute the resulting executable. From f77635883b0777fd7b852a40c2ef60955df4bf34 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 12 Oct 2023 15:10:29 +0200 Subject: [PATCH 1578/1777] Utils: avoid assert in FileWatcher Remove a file from the watcher while handling the fileChanged signal can lead into untracking the directory of the file before it got added to the watcher, so make sure it is tracked before emitting fileChanged. Change-Id: I63e80c20856af3d58ee23763180859f44f07b73d Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/filesystemwatcher.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/libs/utils/filesystemwatcher.cpp b/src/libs/utils/filesystemwatcher.cpp index 155f83fba03..d410ff2507f 100644 --- a/src/libs/utils/filesystemwatcher.cpp +++ b/src/libs/utils/filesystemwatcher.cpp @@ -428,13 +428,11 @@ QStringList FileSystemWatcher::directories() const void FileSystemWatcher::slotFileChanged(const QString &path) { const auto it = d->m_files.find(path); - QStringList toAdd; if (it != d->m_files.end() && it.value().trigger(path)) { qCDebug(fileSystemWatcherLog) << this << "triggers on file" << it.key() << it.value().watchMode << it.value().modifiedTime.toString(Qt::ISODate); - d->fileChanged(path); QFileInfo fi(path); if (!fi.exists()) { @@ -443,12 +441,10 @@ void FileSystemWatcher::slotFileChanged(const QString &path) Q_ASSERT(dirCount > 0); if (dirCount == 1) - toAdd << directory; + d->m_staticData->m_watcher->addPath(directory); } + d->fileChanged(path); } - - if (!toAdd.isEmpty()) - d->m_staticData->m_watcher->addPaths(toAdd); } void FileSystemWatcher::slotDirectoryChanged(const QString &path) From db77f214ca91c20eb3b1bfca23ba2c95849670fe Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 13 Oct 2023 10:18:15 +0200 Subject: [PATCH 1579/1777] Update qbs submodule to HEAD of 2.2 branch Change-Id: I3ec6c2388858c80867c538901903a5226caa39e7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 871e4c29b3e..40327c8277b 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 871e4c29b3e1d6611dc7c71c4bb01950ebf9874d +Subproject commit 40327c8277b904944dbd9a227f9a819e3d53666d From 2893e892dfe194e042d184fde2d3c4b156dd14da Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 13 Oct 2023 12:42:11 +0200 Subject: [PATCH 1580/1777] Debugger: Adjust expectations of manual bigint test It was wrong. Fixes: QTCREATORBUG-29705 Change-Id: I4870d0f1b6b80a4b70803be213cfed51fa37982c Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- tests/manual/debugger/simple/simple_test_app.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index 5b38d85f3ee..f32c1baaf15 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -5657,8 +5657,8 @@ namespace basic { quint64 c = std::numeric_limits<quint64>::max() - quint64(1); BREAK_HERE; // Check a -1143861252567568256 qint64. - // Check b -1143861252567568256 quint64. - // Check c -2 quint64. + // Check b 17302882821141983360 quint64. + // Check c 18446744073709551614 quint64. // Continue. dummyStatement(&a, &b, &c); } From 0aded7311ab7a46e11c757e1dad39221c2f451fd Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 13 Oct 2023 12:04:56 +0200 Subject: [PATCH 1581/1777] Bump version to 12.0.0-beta2 Change-Id: I739670e5cf1d8c99c18d6fb30d1dd7a825e295cf Reviewed-by: David Schulz <david.schulz@qt.io> --- cmake/QtCreatorIDEBranding.cmake | 6 +++--- qbs/modules/qtc/qtc.qbs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index e5ef7a4b73d..40cee3ed827 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,6 +1,6 @@ -set(IDE_VERSION "11.0.82") # The IDE version. -set(IDE_VERSION_COMPAT "11.0.82") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "12.0.0-beta1") # The IDE display version. +set(IDE_VERSION "11.0.83") # The IDE version. +set(IDE_VERSION_COMPAT "11.0.83") # The IDE Compatibility version. +set(IDE_VERSION_DISPLAY "12.0.0-beta2") # The IDE display version. set(IDE_COPYRIGHT_YEAR "2023") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index eca67fc9d55..e225d1189aa 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -4,16 +4,16 @@ import qbs.FileInfo import qbs.Utilities Module { - property string qtcreator_display_version: '12.0.0-beta1' + property string qtcreator_display_version: '12.0.0-beta2' property string ide_version_major: '11' property string ide_version_minor: '0' - property string ide_version_release: '82' + property string ide_version_release: '83' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release property string ide_compat_version_major: '11' property string ide_compat_version_minor: '0' - property string ide_compat_version_release: '82' + property string ide_compat_version_release: '83' property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release From 483a340e7347e99b69ba5b2e23c8059198d52b66 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 12 Oct 2023 10:05:38 +0200 Subject: [PATCH 1582/1777] TextEditor: speed up searching in huge documents Avoid creating QTextCursors for checking whether a search result is inside the find scope. QTextCursor::setPosition seems to layout the block the cursor is positioned at, which is not for free and not needed to verify whether a search result is inside the find scope. Change-Id: Ia1658fbbaa89a61f862e0b97eaa5b059972e2311 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/textutils.cpp | 10 ++++++ src/libs/utils/textutils.h | 2 ++ src/plugins/coreplugin/find/basetextfind.cpp | 14 ++++++-- src/plugins/coreplugin/find/basetextfind.h | 1 + src/plugins/texteditor/texteditor.cpp | 36 +++++++++++++------- 5 files changed, 48 insertions(+), 15 deletions(-) diff --git a/src/libs/utils/textutils.cpp b/src/libs/utils/textutils.cpp index 252152415f8..f8ada6cca68 100644 --- a/src/libs/utils/textutils.cpp +++ b/src/libs/utils/textutils.cpp @@ -64,6 +64,16 @@ Position Position::fromCursor(const QTextCursor &c) return c.isNull() ? Position{} : Position{c.blockNumber() + 1, c.positionInBlock()}; } +int Position::toPositionInDocument(const QTextDocument *document) const +{ + QTC_ASSERT(document, return -1); + const QTextBlock block = document->findBlockByNumber(line - 1); + if (block.isValid()) + return block.position() + qMin(column, block.length() - 1); + + return -1; +} + int Range::length(const QString &text) const { if (end.line < begin.line) diff --git a/src/libs/utils/textutils.h b/src/libs/utils/textutils.h index 3394e45054b..d21ca20d4d9 100644 --- a/src/libs/utils/textutils.h +++ b/src/libs/utils/textutils.h @@ -33,6 +33,8 @@ public: static Position fromFileName(QStringView fileName, int &postfixPos); static Position fromPositionInDocument(const QTextDocument *document, int pos); static Position fromCursor(const QTextCursor &cursor); + + int toPositionInDocument(const QTextDocument *document) const; }; class QTCREATOR_UTILS_EXPORT Range diff --git a/src/plugins/coreplugin/find/basetextfind.cpp b/src/plugins/coreplugin/find/basetextfind.cpp index eca378045ab..a11bf7d33da 100644 --- a/src/plugins/coreplugin/find/basetextfind.cpp +++ b/src/plugins/coreplugin/find/basetextfind.cpp @@ -425,9 +425,17 @@ bool BaseTextFind::inScope(const QTextCursor &candidate) const return false; if (d->m_scope.isNull()) return true; - return Utils::anyOf(d->m_scope, [candidate](const QTextCursor &scope){ - return candidate.selectionStart() >= scope.selectionStart() - && candidate.selectionEnd() <= scope.selectionEnd(); + return inScope(candidate.selectionStart(), candidate.selectionEnd()); +} + +bool BaseTextFind::inScope(int candidateStart, int candidateEnd) const +{ + if (d->m_scope.isNull()) + return true; + if (candidateStart > candidateEnd) + std::swap(candidateStart, candidateEnd); + return Utils::anyOf(d->m_scope, [&](const QTextCursor &scope) { + return candidateStart >= scope.selectionStart() && candidateEnd <= scope.selectionEnd(); }); } diff --git a/src/plugins/coreplugin/find/basetextfind.h b/src/plugins/coreplugin/find/basetextfind.h index 97ebd072bf3..2c2abf90014 100644 --- a/src/plugins/coreplugin/find/basetextfind.h +++ b/src/plugins/coreplugin/find/basetextfind.h @@ -50,6 +50,7 @@ public: using CursorProvider = std::function<Utils::MultiTextCursor ()>; void setMultiTextCursorProvider(const CursorProvider &provider); bool inScope(const QTextCursor &candidate) const; + bool inScope(int candidateStart, int candidateEnd) const; static QRegularExpression regularExpression(const QString &txt, Utils::FindFlags flags); diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 7939adf13c6..c5b73125d5f 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -4031,10 +4031,7 @@ void TextEditorWidgetPrivate::highlightSearchResults(const QTextBlock &block, co const int start = blockPosition + idx; const int end = start + l; - QTextCursor result = cursor; - result.setPosition(start); - result.setPosition(end, QTextCursor::KeepAnchor); - if (!q->inFindScope(result)) + if (!m_find->inScope(start, end)) continue; // check if the result is inside the visibale area for long blocks @@ -6884,9 +6881,16 @@ void TextEditorWidgetPrivate::highlightSearchResultsInScrollBar() Utils::onResultReady(m_searchFuture, this, [this](const SearchResultItems &resultList) { QList<SearchResult> results; for (const SearchResultItem &result : resultList) { - SearchResult searchResult; - if (q->inFindScope(selectRange(q->document(), result.mainRange(), &searchResult))) - results << searchResult; + int start = result.mainRange().begin.toPositionInDocument(m_document->document()); + if (start < 0) + continue; + int end = result.mainRange().end.toPositionInDocument(m_document->document()); + if (end < 0) + continue; + if (start > end) + std::swap(start, end); + if (m_find->inScope(start, end)) + results << SearchResult{start, start - end}; } m_searchResults << results; addSearchResultsToScrollBar(results); @@ -6924,12 +6928,20 @@ void TextEditorWidgetPrivate::addSearchResultsToScrollBar(const QVector<SearchRe for (const SearchResult &result : results) { const QTextBlock &block = q->document()->findBlock(result.start); if (block.isValid() && block.isVisible()) { - const int firstLine = block.layout()->lineForTextPosition(result.start - block.position()).lineNumber(); - const int lastLine = block.layout()->lineForTextPosition(result.start - block.position() + result.length).lineNumber(); - for (int line = firstLine; line <= lastLine; ++line) { + if (q->lineWrapMode() == QPlainTextEdit::WidgetWidth) { + const int firstLine = block.layout()->lineForTextPosition(result.start - block.position()).lineNumber(); + const int lastLine = block.layout()->lineForTextPosition(result.start - block.position() + result.length).lineNumber(); + for (int line = firstLine; line <= lastLine; ++line) { + m_highlightScrollBarController->addHighlight( + {Constants::SCROLL_BAR_SEARCH_RESULT, block.firstLineNumber() + line, + Theme::TextEditor_SearchResult_ScrollBarColor, Highlight::HighPriority}); + } + } else { m_highlightScrollBarController->addHighlight( - {Constants::SCROLL_BAR_SEARCH_RESULT, block.firstLineNumber() + line, - Theme::TextEditor_SearchResult_ScrollBarColor, Highlight::HighPriority}); + {Constants::SCROLL_BAR_SEARCH_RESULT, + block.blockNumber(), + Theme::TextEditor_SearchResult_ScrollBarColor, + Highlight::HighPriority}); } } } From 3a671c2bb9e4b9a7b86903687b7869d298f3bcba Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 13 Oct 2023 09:35:31 +0200 Subject: [PATCH 1583/1777] ProjectExplorer: Fix autodetect of toolchains on macOS ...when not loading the iOS plugin. Fixes a condition and lowers priority of gcc/g++ on macOS in general. Without this patch Qt related kits had a detected g++/gcc assigned as compiler which made the kits useless. When loading the iOS plugin the Apple related clang is preferred which made the issue not present by default. Fixes execution of AutoTest and ClangTools plugin unit tests too. Change-Id: I7515980c0fda48c942d7f3e7cb4d8c66965a1ab3 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/projectexplorer/gcctoolchain.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index e43022f403b..78b5ba4737a 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1364,7 +1364,7 @@ Toolchains GccToolChainFactory::autoDetect(const ToolchainDetector &detector) co }, {nameFilters, QDir::Files | QDir::Executable }); // Gcc is almost never what you want on macOS, but it is by default found in /usr/bin - if (HostOsInfo::isMacHost() && detector.device->type() != Constants::DESKTOP_DEVICE_TYPE) { + if (HostOsInfo::isMacHost() && detector.device->type() == Constants::DESKTOP_DEVICE_TYPE) { executables.removeOne(FilePath::fromPathPart(u"/usr/bin/gcc")); executables.removeOne(FilePath::fromPathPart(u"/usr/bin/g++")); } @@ -1575,6 +1575,9 @@ Toolchains GccToolChainFactory::autoDetectToolChain(const ToolChainDescription & tc->setTargetAbi(abi); tc->setOriginalTargetTriple(detectedAbis.originalTargetTriple); tc->setDisplayName(tc->defaultDisplayName()); // reset displayname + // lower priority of g++/gcc on macOS - usually just a frontend to clang + if (detectedSubType == GccToolChain::RealGcc && abi.binaryFormat() == Abi::MachOFormat) + tc->setPriority(ToolChain::PriorityLow); result.append(tc); } return result; From 43cfe48fed82e02ab659d9b8034190fcc9fdcdf2 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 13 Oct 2023 13:05:21 +0200 Subject: [PATCH 1584/1777] ClangCodeModel: Respect settings If the user disables usage of clangd and opens a cpp file without a project we still tried to set up the fallback clangd. Silences a soft assert. Change-Id: I753ce2eddb00b344b109ba4ff3da61a849767a79 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/clangcodemodel/clangmodelmanagersupport.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp index b201d5a364c..e117e6b36f1 100644 --- a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp +++ b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp @@ -768,6 +768,8 @@ void ClangModelManagerSupport::onEditorOpened(IEditor *editor) Project * project = ProjectManager::projectForFile(document->filePath()); const ClangdSettings settings(ClangdProjectSettings(project).settings()); + if (!settings.useClangd()) + return; if (!settings.sizeIsOkay(textDocument->filePath())) return; if (sessionModeEnabled()) From 0bfa8fd718c6197cf4fc9da776283b8c767abf91 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 13 Oct 2023 13:50:21 +0200 Subject: [PATCH 1585/1777] ClangCodeModel: Allow users to choose between completion ranking models ... in clangd. Task-number: QTCREATORBUG-29013 Change-Id: Idd80a195709e9813f1713a048f6229a7dd6493ba Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/clangcodemodel/clangdclient.cpp | 4 +++ .../cppeditor/cppcodemodelsettings.cpp | 24 ++++++++++++++ src/plugins/cppeditor/cppcodemodelsettings.h | 6 ++++ .../cppeditor/cppcodemodelsettingspage.cpp | 32 +++++++++++++++++++ 4 files changed, 66 insertions(+) diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 87f3e77c5d2..565c8306a0b 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -217,6 +217,10 @@ static BaseClientInterface *clientInterface(Project *project, const Utils::FileP if (clangdLogServer().isDebugEnabled()) cmd.addArgs({"--log=verbose", "--pretty", "--hidden-features=1"}); cmd.addArg("--use-dirty-headers"); + if (settings.completionRankingModel() != ClangdSettings::CompletionRankingModel::Default) { + cmd.addArg("--ranking-model=" + ClangdSettings::rankingModelToCmdLineString( + settings.completionRankingModel())); + } const auto interface = new StdIOClientInterface; interface->setCommandLine(cmd); return interface; diff --git a/src/plugins/cppeditor/cppcodemodelsettings.cpp b/src/plugins/cppeditor/cppcodemodelsettings.cpp index 02ec37a8205..2d94e1c86ec 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettings.cpp @@ -47,6 +47,7 @@ static Key clangdPathKey() { return "ClangdPath"; } static Key clangdIndexingKey() { return "ClangdIndexing"; } static Key clangdIndexingPriorityKey() { return "ClangdIndexingPriority"; } static Key clangdHeaderSourceSwitchModeKey() { return "ClangdHeaderSourceSwitchMode"; } +static Key clangdCompletionRankingModelKey() { return "ClangdCompletionRankingModel"; } static Key clangdHeaderInsertionKey() { return "ClangdHeaderInsertion"; } static Key clangdThreadLimitKey() { return "ClangdThreadLimit"; } static Key clangdDocumentThresholdKey() { return "ClangdDocumentThreshold"; } @@ -222,6 +223,26 @@ QString ClangdSettings::headerSourceSwitchModeToDisplayString(HeaderSourceSwitch return {}; } +QString ClangdSettings::rankingModelToCmdLineString(CompletionRankingModel model) +{ + switch (model) { + case CompletionRankingModel::Default: break; + case CompletionRankingModel::DecisionForest: return "decision_forest"; + case CompletionRankingModel::Heuristics: return "heuristics"; + } + QTC_ASSERT(false, return {}); +} + +QString ClangdSettings::rankingModelToDisplayString(CompletionRankingModel model) +{ + switch (model) { + case CompletionRankingModel::Default: return Tr::tr("Default"); + case CompletionRankingModel::DecisionForest: return Tr::tr("Decision Forest"); + case CompletionRankingModel::Heuristics: return Tr::tr("Heuristics"); + } + QTC_ASSERT(false, return {}); +} + ClangdSettings &ClangdSettings::instance() { static ClangdSettings settings; @@ -527,6 +548,7 @@ Store ClangdSettings::Data::toMap() const map.insert(clangdIndexingKey(), indexingPriority != IndexingPriority::Off); map.insert(clangdIndexingPriorityKey(), int(indexingPriority)); map.insert(clangdHeaderSourceSwitchModeKey(), int(headerSourceSwitchMode)); + map.insert(clangdCompletionRankingModelKey(), int(completionRankingModel)); map.insert(clangdHeaderInsertionKey(), autoIncludeHeaders); map.insert(clangdThreadLimitKey(), workerThreadLimit); map.insert(clangdDocumentThresholdKey(), documentUpdateThreshold); @@ -550,6 +572,8 @@ void ClangdSettings::Data::fromMap(const Store &map) indexingPriority = IndexingPriority::Off; headerSourceSwitchMode = HeaderSourceSwitchMode(map.value(clangdHeaderSourceSwitchModeKey(), int(headerSourceSwitchMode)).toInt()); + completionRankingModel = CompletionRankingModel(map.value(clangdCompletionRankingModelKey(), + int(completionRankingModel)).toInt()); autoIncludeHeaders = map.value(clangdHeaderInsertionKey(), false).toBool(); workerThreadLimit = map.value(clangdThreadLimitKey(), 0).toInt(); documentUpdateThreshold = map.value(clangdDocumentThresholdKey(), 500).toInt(); diff --git a/src/plugins/cppeditor/cppcodemodelsettings.h b/src/plugins/cppeditor/cppcodemodelsettings.h index a2095f55e3e..33ba3fae235 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.h +++ b/src/plugins/cppeditor/cppcodemodelsettings.h @@ -83,10 +83,13 @@ class CPPEDITOR_EXPORT ClangdSettings : public QObject public: enum class IndexingPriority { Off, Background, Normal, Low, }; enum class HeaderSourceSwitchMode { BuiltinOnly, ClangdOnly, Both }; + enum class CompletionRankingModel { Default, DecisionForest, Heuristics }; static QString priorityToString(const IndexingPriority &priority); static QString priorityToDisplayString(const IndexingPriority &priority); static QString headerSourceSwitchModeToDisplayString(HeaderSourceSwitchMode mode); + static QString rankingModelToCmdLineString(CompletionRankingModel model); + static QString rankingModelToDisplayString(CompletionRankingModel model); class CPPEDITOR_EXPORT Data { @@ -104,6 +107,7 @@ public: && s1.workerThreadLimit == s2.workerThreadLimit && s1.indexingPriority == s2.indexingPriority && s1.headerSourceSwitchMode == s2.headerSourceSwitchMode + && s1.completionRankingModel == s2.completionRankingModel && s1.autoIncludeHeaders == s2.autoIncludeHeaders && s1.documentUpdateThreshold == s2.documentUpdateThreshold && s1.sizeThresholdEnabled == s2.sizeThresholdEnabled @@ -125,6 +129,7 @@ public: bool useClangd = true; IndexingPriority indexingPriority = IndexingPriority::Low; HeaderSourceSwitchMode headerSourceSwitchMode = HeaderSourceSwitchMode::Both; + CompletionRankingModel completionRankingModel = CompletionRankingModel::Default; bool autoIncludeHeaders = false; bool sizeThresholdEnabled = false; bool haveCheckedHardwareReqirements = false; @@ -146,6 +151,7 @@ public: Utils::FilePath clangdFilePath() const; IndexingPriority indexingPriority() const { return m_data.indexingPriority; } HeaderSourceSwitchMode headerSourceSwitchMode() const { return m_data.headerSourceSwitchMode; } + CompletionRankingModel completionRankingModel() const { return m_data.completionRankingModel; } bool autoIncludeHeaders() const { return m_data.autoIncludeHeaders; } int workerThreadLimit() const { return m_data.workerThreadLimit; } int documentUpdateThreshold() const { return m_data.documentUpdateThreshold; } diff --git a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp index f2a96111f41..a2639f380b3 100644 --- a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp @@ -194,6 +194,7 @@ public: QCheckBox useClangdCheckBox; QComboBox indexingComboBox; QComboBox headerSourceSwitchComboBox; + QComboBox completionRankingModelComboBox; QCheckBox autoIncludeHeadersCheckBox; QCheckBox sizeThresholdCheckBox; QSpinBox threadLimitSpinBox; @@ -228,6 +229,16 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD "in the built-in variant." "<p>When \"Try Both\" is selected, clangd will be employed only if the built-in variant " "does not find anything."); + using RankingModel = ClangdSettings::CompletionRankingModel; + const QString completionRankingModelToolTip = Tr::tr( + "<p>Which model clangd should use to rank possible completions." + "<p>This determines the order of candidates in the combo box when doing code completion." + "<p>The \"%1\" model used by default results from (pre-trained) machine learning and " + "provides superior results on average." + "<p>If you feel that its suggestions stray too much from your expectations for your " + "code base, you can try switching to the hand-crafted \"%2\" model.").arg( + ClangdSettings::rankingModelToDisplayString(RankingModel::DecisionForest), + ClangdSettings::rankingModelToDisplayString(RankingModel::Heuristics)); const QString workerThreadsToolTip = Tr::tr( "Number of worker threads used by clangd. Background indexing also uses this many " "worker threads."); @@ -266,6 +277,16 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD d->headerSourceSwitchComboBox.count() - 1); } d->headerSourceSwitchComboBox.setToolTip(headerSourceSwitchToolTip); + for (RankingModel model : {RankingModel::Default, RankingModel::DecisionForest, + RankingModel::Heuristics}) { + d->completionRankingModelComboBox.addItem( + ClangdSettings::rankingModelToDisplayString(model), int(model)); + if (model == settings.completionRankingModel()) + d->completionRankingModelComboBox.setCurrentIndex( + d->completionRankingModelComboBox.count() - 1); + } + d->completionRankingModelComboBox.setToolTip(completionRankingModelToolTip); + d->autoIncludeHeadersCheckBox.setText(Tr::tr("Insert header files on completion")); d->autoIncludeHeadersCheckBox.setChecked(settings.autoIncludeHeaders()); d->autoIncludeHeadersCheckBox.setToolTip(autoIncludeToolTip); @@ -331,6 +352,13 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD limitResultsLayout->addStretch(1); formLayout->addRow(completionResultsLabel, limitResultsLayout); + const auto completionRankingModelLayout = new QHBoxLayout; + completionRankingModelLayout->addWidget(&d->completionRankingModelComboBox); + completionRankingModelLayout->addStretch(1); + const auto completionRankingModelLabel = new QLabel(Tr::tr("Completion ranking model:")); + completionRankingModelLabel->setToolTip(completionRankingModelToolTip); + formLayout->addRow(completionRankingModelLabel, completionRankingModelLayout); + const auto documentUpdateThresholdLayout = new QHBoxLayout; documentUpdateThresholdLayout->addWidget(&d->documentUpdateThreshold); documentUpdateThresholdLayout->addStretch(1); @@ -476,6 +504,8 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD this, &ClangdSettingsWidget::settingsDataChanged); connect(&d->headerSourceSwitchComboBox, &QComboBox::currentIndexChanged, this, &ClangdSettingsWidget::settingsDataChanged); + connect(&d->completionRankingModelComboBox, &QComboBox::currentIndexChanged, + this, &ClangdSettingsWidget::settingsDataChanged); connect(&d->autoIncludeHeadersCheckBox, &QCheckBox::toggled, this, &ClangdSettingsWidget::settingsDataChanged); connect(&d->threadLimitSpinBox, &QSpinBox::valueChanged, @@ -508,6 +538,8 @@ ClangdSettings::Data ClangdSettingsWidget::settingsData() const d->indexingComboBox.currentData().toInt()); data.headerSourceSwitchMode = ClangdSettings::HeaderSourceSwitchMode( d->headerSourceSwitchComboBox.currentData().toInt()); + data.completionRankingModel = ClangdSettings::CompletionRankingModel( + d->completionRankingModelComboBox.currentData().toInt()); data.autoIncludeHeaders = d->autoIncludeHeadersCheckBox.isChecked(); data.workerThreadLimit = d->threadLimitSpinBox.value(); data.documentUpdateThreshold = d->documentUpdateThreshold.value(); From 57606dfb5509edcbc777ace7d9d4829c3051c908 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 13 Oct 2023 14:20:12 +0200 Subject: [PATCH 1586/1777] Doc: Describe how to hide and show the main menu bar After users hide the menubar, they cannot see the keyboard shortcut for showing it anymore. Task-number: QTCREATORBUG-29392 Change-Id: I7a26d6bd0972457e225b33d2b041c158ad71548e Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../images/qtcreator-without-menubar.webp | Bin 0 -> 13312 bytes ...reator-how-to-show-and-hide-main-menu.qdoc | 22 ++++++++++++++++++ ...creator-how-to-show-and-hide-sidebars.qdoc | 2 +- .../creator-how-to-switch-between-modes.qdoc | 2 ++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 doc/qtcreator/images/qtcreator-without-menubar.webp create mode 100644 doc/qtcreator/src/user-interface/creator-only/creator-how-to-show-and-hide-main-menu.qdoc diff --git a/doc/qtcreator/images/qtcreator-without-menubar.webp b/doc/qtcreator/images/qtcreator-without-menubar.webp new file mode 100644 index 0000000000000000000000000000000000000000..0201ea89321674bcd83aed7df49a04c0de0ccebe GIT binary patch literal 13312 zcmWIYbaVS*%)k)t>J$(bVBzz|n1Mn6^dVOU)9$8iy>nXZ-~2A*c5v}wh&U5^k=ZLs z^U4ILc``d>Uf=o@J=J5%8~Z|&6TDANQ)4&%cUbECHtm1IlZ#Wg)lXfbAinX=(OtXW zf3xE2J$q%P(w(#0x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Uo3SmbN2Pjke?Qo|9sNZ zEK7x5qi6TNUnW+(%|3W%QF`f4|I06v9!E)XWxLMbyNvDYY_@s7=NB^7*9O`O)So;3 zW;w@ht?!lBrrj#DdVj3&T`_x^*|X9O^BXfSrmz3F>xU@A`KvCjFS5C8zS}>Zwr1|K z56}1P*|IgQ@|$tP*@E}??ZfB&{gIt*)>d-mPkx8#>0+w}(GMUk4fXHp-MB9J&)QLT zj&VV<W%jMUt9DvWH~3k8&6%G6LZz%WWldV;x~-Rct{?Qx*SQobT(M3~jJ=c*0FVky At^fc4 literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/user-interface/creator-only/creator-how-to-show-and-hide-main-menu.qdoc b/doc/qtcreator/src/user-interface/creator-only/creator-how-to-show-and-hide-main-menu.qdoc new file mode 100644 index 00000000000..4055f0b7d45 --- /dev/null +++ b/doc/qtcreator/src/user-interface/creator-only/creator-how-to-show-and-hide-main-menu.qdoc @@ -0,0 +1,22 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-how-to-show-and-hide-main-menu.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-ui + + \title Show and hide the main menu + + On Linux and Windows, you can hide the main menu bar to save space on the + screen. Select \uicontrol View, and deselect the \uicontrol {Show Menubar} + check box. + + \image qtcreator-without-menubar.webp {Qt Creator without the main menu} + \caption \QC without the main menu bar. + + To show the main menu again, press \key {Ctrl+Alt+M}. + + \sa {Show and hide sidebars},{Switch between modes} +*/ diff --git a/doc/qtcreator/src/user-interface/creator-only/creator-how-to-show-and-hide-sidebars.qdoc b/doc/qtcreator/src/user-interface/creator-only/creator-how-to-show-and-hide-sidebars.qdoc index 52ecb03c011..230ce2adde6 100644 --- a/doc/qtcreator/src/user-interface/creator-only/creator-how-to-show-and-hide-sidebars.qdoc +++ b/doc/qtcreator/src/user-interface/creator-only/creator-how-to-show-and-hide-sidebars.qdoc @@ -35,5 +35,5 @@ In some views, right-clicking opens a context menu that has functions for managing the objects listed in the view. - \sa {Sidebar Views} + \sa {Sidebar Views},{Show and hide the main menu},{Switch between modes} */ diff --git a/doc/qtcreator/src/user-interface/creator-only/creator-how-to-switch-between-modes.qdoc b/doc/qtcreator/src/user-interface/creator-only/creator-how-to-switch-between-modes.qdoc index a2f5646ef71..a9c4e26dcbc 100644 --- a/doc/qtcreator/src/user-interface/creator-only/creator-how-to-switch-between-modes.qdoc +++ b/doc/qtcreator/src/user-interface/creator-only/creator-how-to-switch-between-modes.qdoc @@ -72,4 +72,6 @@ \uicontrol View > \uicontrol {Mode Selector Style} > \uicontrol Hidden. To only show icons on the mode selector, select the \uicontrol {Icons Only} style. + + \sa {Show and hide sidebars},{Show and hide the main menu} */ From 52fa2c369ef8351ceb201d452cf1476b9d2fbce6 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 12 Oct 2023 14:49:05 +0200 Subject: [PATCH 1587/1777] CMakePM: Remove compiler group for all generated sources Change-Id: Ie30bb63c96438d3582a7d2b753b9677a4a95fe9b Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/fileapidataextractor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 89993f24056..fd492289555 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -411,7 +411,8 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture RawProjectPart rpp; rpp.setProjectFileLocation(t.sourceDir.pathAppended("CMakeLists.txt").toString()); rpp.setBuildSystemTarget(t.name); - const QString postfix = needPostfix ? "_cg" + QString::number(count) : QString(); + const QString postfix = needPostfix ? QString("_%1_%2").arg(ci.language).arg(count) + : QString(); rpp.setDisplayName(t.id + postfix); rpp.setMacros(transform<QVector>(ci.defines, &DefineInfo::define)); rpp.setHeaderPaths(transform<QVector>(ci.includes, &IncludeInfo::path)); @@ -436,6 +437,10 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture addToSources(si.path); } + // Skip groups with only generated source files e.g. <build-dir>/.rcc/qrc_<target>.cpp + if (allOf(ci.sources, [t](const auto &idx) { return t.sources.at(idx).isGenerated; })) + continue; + // If we are not in a pch compiler group, add all the headers that are not generated const bool hasPchSource = anyOf(sources, [buildDirectory](const QString &path) { return isPchFile(buildDirectory, FilePath::fromString(path)); From 184509228a63acd605ca409f137f4c7784c03b57 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 13 Oct 2023 15:34:28 +0200 Subject: [PATCH 1588/1777] GitHub: Mark build as failed if the tests fail We have now 100% test pass rate, so we want to keep it this way. Change-Id: Ie7dc5fa24921a1b32eff09470cc77ba01e65939a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .github/workflows/build_cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 3b2c1755b2f..416223c75af 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -663,8 +663,8 @@ jobs: if (NOT result EQUAL 0) string(REGEX MATCH "[0-9]+% tests.*[0-9.]+ sec.*$" test_results "${output}") string(REPLACE "\n" "%0A" test_results "${test_results}") - # Do not fail on ctest failure - message("::warning::${test_results}") + message("::error::${test_results}") + message(FATAL_ERROR "Tests failed") endif() - name: Upload From 085949bbae83f01f1e6abada7d326c99d7851e65 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 13 Oct 2023 10:42:30 +0200 Subject: [PATCH 1589/1777] LanguageClient: do not assert on sending messages to a dying client Fixes: QTCREATORBUG-29747 Change-Id: I14067695425d74eaeaa255b370ebf4106c0ac591 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/languageclient/client.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 1d93f869540..e6ee9cf6d18 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -697,6 +697,12 @@ void Client::sendMessage(const JsonRpcMessage &message, SendDocUpdates sendUpdat Schedule semanticTokensSchedule) { QTC_ASSERT(d->m_clientInterface, return); + if (d->m_state == Shutdown || d->m_state == ShutdownRequested) { + auto key = message.toJsonObject().contains(methodKey) ? QString(methodKey) : QString(idKey); + const QString method = message.toJsonObject()[key].toString(); + qCDebug(LOGLSPCLIENT) << "Ignoring message " << method << " because client is shutting down"; + return; + } QTC_ASSERT(d->m_state == Initialized, return); if (sendUpdates == SendDocUpdates::Send) d->sendPostponedDocumentUpdates(semanticTokensSchedule); From eab779d13adbaef5d1e5215e180051689152a4dc Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 13 Oct 2023 15:34:47 +0200 Subject: [PATCH 1590/1777] LanguageClient: report error for requests on unreachable server Change-Id: I5444279b544a1aab3896f9e12ab7cad595a49267 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/languageclient/client.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index e6ee9cf6d18..6c6098be215 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -696,6 +696,20 @@ void Client::openDocument(TextEditor::TextDocument *document) void Client::sendMessage(const JsonRpcMessage &message, SendDocUpdates sendUpdates, Schedule semanticTokensSchedule) { + QScopeGuard guard([responseHandler = message.responseHandler()](){ + if (responseHandler) { + static ResponseError<std::nullptr_t> error; + if (!error.isValid()) { + error.setCode(-32803); // RequestFailed + error.setMessage("The server is currently in an unreachable state."); + } + QJsonObject response; + response[idKey] = responseHandler->id; + response[errorKey] = QJsonObject(error); + responseHandler->callback(JsonRpcMessage(response)); + } + }); + QTC_ASSERT(d->m_clientInterface, return); if (d->m_state == Shutdown || d->m_state == ShutdownRequested) { auto key = message.toJsonObject().contains(methodKey) ? QString(methodKey) : QString(idKey); @@ -704,6 +718,8 @@ void Client::sendMessage(const JsonRpcMessage &message, SendDocUpdates sendUpdat return; } QTC_ASSERT(d->m_state == Initialized, return); + guard.dismiss(); + if (sendUpdates == SendDocUpdates::Send) d->sendPostponedDocumentUpdates(semanticTokensSchedule); if (std::optional<ResponseHandler> responseHandler = message.responseHandler()) From d7f44cdd2417443b2b6e669029a678bf92a991a4 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Sat, 14 Oct 2023 14:35:07 +0200 Subject: [PATCH 1591/1777] CMakePM: Enable ANSI codes colored output Qt Creator is able to display colored output for the _Compile Output_ and _General Messages_ panes. This commit enables CMake and tools to use this functionality. See https://cmake.org/cmake/help/latest/variable/ CMAKE_COLOR_DIAGNOSTICS.html and http://bixense.com/clicolors/ for more details. Change-Id: Ied4058bbd2522750d559b05d585092830ce3a911 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/cmakeprojectmanager/builddirparameters.cpp | 2 ++ src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/builddirparameters.cpp b/src/plugins/cmakeprojectmanager/builddirparameters.cpp index b231cc74b77..2a72521d1c5 100644 --- a/src/plugins/cmakeprojectmanager/builddirparameters.cpp +++ b/src/plugins/cmakeprojectmanager/builddirparameters.cpp @@ -66,6 +66,8 @@ BuildDirParameters::BuildDirParameters(CMakeBuildSystem *buildSystem) environment.set("ICECC", "no"); environment.set("QTC_RUN", "1"); + environment.setFallback("CMAKE_COLOR_DIAGNOSTICS", "1"); + environment.setFallback("CLICOLOR_FORCE", "1"); cmakeToolId = CMakeKitAspect::cmakeToolId(k); } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 7fba5bb98eb..8187311a887 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -261,6 +261,8 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Id id) : env.set("NINJA_STATUS", ninjaProgressString + "%o/sec] "); env.modify(m_userEnvironmentChanges); + env.setFallback("CLICOLOR_FORCE", "1"); + if (useStaging()) env.set("DESTDIR", stagingDir().path()); }); From 5859384250a215b8a7a5b32d572073193df34541 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 13 Oct 2023 11:34:22 +0200 Subject: [PATCH 1592/1777] Debugger: Update internal buffer before checking dirtyness Fixes: QTCREATORBUG-29746 Change-Id: I63f3c5bd2c628b42ba23dd19d80a410dbca8cfc1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/debugger/commonoptionspage.h | 2 ++ src/plugins/debugger/debuggersourcepathmappingwidget.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h index 91e9b45fdcd..5bf41af7a41 100644 --- a/src/plugins/debugger/commonoptionspage.h +++ b/src/plugins/debugger/commonoptionspage.h @@ -30,6 +30,8 @@ public: void readSettings() override; void writeSettings() const override; + bool isDirty() override; + private: bool guiToBuffer() override; void bufferToGui() override; diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index e64fb904763..1cb7c6402cd 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -461,6 +461,12 @@ void SourcePathMapAspect::toMap(Store &) const QTC_CHECK(false); } +bool SourcePathMapAspect::isDirty() +{ + guiToBuffer(); + return m_internal != m_buffer; +} + void SourcePathMapAspect::addToLayout(Layouting::LayoutItem &parent) { QTC_CHECK(!d->m_widget); From 3e1ac24141fce1fb0918e967a148e2ef1fe1a09c Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 13 Oct 2023 13:38:49 +0200 Subject: [PATCH 1593/1777] Doc: Describe the "Sort results" option in md locator filter config Users can clear the check box to use the sorting from the tool. Task-number: QTCREATORBUG-29392 Change-Id: I8c656b7dd480ebc4bf16be33b198989bd65d8ecd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../qtcreator-locator-filter-edit-ai.webp | Bin 0 -> 2680 bytes .../qtcreator-locator-filter-edit-md.webp | Bin 0 -> 4436 bytes doc/qtcreator/src/editors/creator-locator.qdoc | 17 +++++++++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-locator-filter-edit-ai.webp create mode 100644 doc/qtcreator/images/qtcreator-locator-filter-edit-md.webp diff --git a/doc/qtcreator/images/qtcreator-locator-filter-edit-ai.webp b/doc/qtcreator/images/qtcreator-locator-filter-edit-ai.webp new file mode 100644 index 0000000000000000000000000000000000000000..ed8f7088046ebb7b489c8a5844e3b9e98a2ec6e4 GIT binary patch literal 2680 zcmWIYbaN}<Vqge&bqWXzu<%LYVqnl0J*dF&we8Wi+&LNlH(oCODk&(epuCWK_w(12 zbi5vGzqxWx^Ys7aCvv|<))ccOruiK?^H68z+u(?*E(7D{Ro|9`bND<6Eegy0_5c6( zH>=!D`HW}Jw9S4M)oLl&8<NJSp3HN26>H+#IECZe?ry7mb-+?=!4@`c!&NO(7vn7* zz1^SjeOUO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;l7JvSG z^S7UmqyOv1)%?A^QT4x4V%40EkEd!(H16NoBDpl`Q~ufK>-64--hJzTw<rJmZ2!xj z&R>>quG3w7<>qeff|9@Q4&_K(@-lu@`q{?mC2x=TrvQ!8Sraecjp+}V)nh4J9H>!i z@a@1#Q%kvpR~juvivu)lQ=Rz!-<x(d<Z4Pa%cZ98b?rQDMr#h`h<I54`**)a#$;W8 zruow6bAoK2$|RcX{r#e>_`(*q{o?O;2Cyyf2zHcM`#Y0=B9q#m<4+eP*8ceJwxmAh b&UKYbdY}G>HGcUo9ro1zwEBgkvofp!vt>-x literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-locator-filter-edit-md.webp b/doc/qtcreator/images/qtcreator-locator-filter-edit-md.webp new file mode 100644 index 0000000000000000000000000000000000000000..4526245b68efd0e1dcfefe43bc7d0bb1a58b1af9 GIT binary patch literal 4436 zcmWIYbaV3&WMBw)bqWXzu<&sZWMI%YceG&m+V*H$u5#q>{JCG;{tFs1#>|%XOmcD- z;!;VB`?=z=WGOT6f?IF5J`erA{!H6bfk`_}*2T=8SoLI2^!6>4ld6kPs|V*--12mA z-0Nuh_RUOlTkG4)J&OL<KYt{<d}iW-GiP$l%V&qZvEz20HFM=sD{kj`J=d?L*sKqC zNp*L-Hsfa8Qb}*;V*ycdMx}kBn=Va|dw%N7`|rE2&f;46#q2p(UdrvFDb|@bl{0?) zPhFt!!PChuv1hf#jqT~d5!NrJtF`{$=fz%>d)sezvD~AFa(1PA{yjf`*yNO%iQtld z-bpH+IkWF|e7LA$93v+gXdd}d_xQG4(;^f3-sR7N55F`s27~k{@ArFu@4vF-#F`6d z-h`)F7qtYY_n9=vdv2V$Ht5l@ZEGJ_K0awax5oJA+yDOQyH9ydO|_nzdt0Ja`S!N6 zFZ$H$tty?pg0|)EUX{Kr=eCr~f7u<mk3DWNeVMxa?LAw^zQ6TdOJZ_1*FGsJ{c19) zU(WHo!RGQ8#}qd^t^3gbkvZa+^3qki<p1A2bf|X6Z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q(Ea4`C2VYc*%zT&2rlk-=%F4M2Qqm{Fi zBTvPPQ}t|olr+2AqLN;LjhUuf<!5*9+md-eqs-6XO7<-unR)M~EDSv}J7LBA&wo_g zzuho&UTtA}FkpSAvf=OQo4b$yvn@MuK_l$_|AbZ7w{+h4VUoY|NnEtdCEFD4+@!$d o$=hphe$Tt|VV0Ro&Yp9d_XjWkc)Z<sTTgO@@BO39y3v0)0BaYM-v9sr literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/editors/creator-locator.qdoc b/doc/qtcreator/src/editors/creator-locator.qdoc index bcc12f9ba14..f26024a6864 100644 --- a/doc/qtcreator/src/editors/creator-locator.qdoc +++ b/doc/qtcreator/src/editors/creator-locator.qdoc @@ -108,6 +108,18 @@ for how to make them known to the locator. \endif + \section2 Locating Files from Global File System Index + + You can install tools such as Spotlight, Locate, or Everything and use them + to locate files from a global file system index. Use the \c md locator + filter to locate the files. + + To use the sorting from the selected tool instead of from \QC, + deselect the \uicontrol {Sort results} check box in the \c md + locator filter configuration. + + \image qtcreator-locator-filter-edit-md.webp {Filter Configuration dialog} + \section2 Locating Lines and Columns To move directly to a particular line and column in the document when you @@ -183,6 +195,8 @@ example, you can change the filter prefix and restrict the search to items that match the filter. + \image qtcreator-locator-filter-edit-ai.webp {Filter Configuration dialog} + To configure a locator filter: \list 1 @@ -198,8 +212,7 @@ \li To implicitly include the filter even when not typing a prefix as a part of the search string, select \uicontrol {Include by default}. - \li Set other available preferences. For more information, see - \l{Adding Web Search Engines}. + \li Set other available preferences. \endlist From 7064fd1a3278c71f99e11bef12adcc09e3ebff86 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 13 Oct 2023 16:43:49 +0200 Subject: [PATCH 1594/1777] Doc: Add option names and paths to the options into the change log Task-number: QTCREATORBUG-29392 Change-Id: Ia34ecc376700a0be3721de94562ce05d0ceeda82 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- dist/changelog/changes-12.0.0.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 59efd088f94..1416c7cc2e2 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -58,17 +58,20 @@ General ------- * Improved the startup performance significantly on various setups -* Added the option to keep the sorting from the tool used for the file system - index locator filter +* Added the `Sort results` check box for configuring the `md` locator filter in + `Edit > Preferences > Environment > Locator` to keep the sorting from the tool + used for the file system index locator filter ([QTCREATORBUG-27789](https://bugreports.qt.io/browse/QTCREATORBUG-27789)) -* Added the option to hide the menu bar on platforms without unified menu bar +* Added the `View > Show Menubar` option to hide the menu bar on platforms + without a unified menu bar ([QTCREATORBUG-29498](https://bugreports.qt.io/browse/QTCREATORBUG-29498)) * Fixed an issue with growing session files Help ---- -* Added an option for text anti-aliasing +* Added the `Edit > Preferences > Help > General > Antialias` check box for + setting the anti-aliasing of text ([QTCREATORBUG-12177](https://bugreports.qt.io/browse/QTCREATORBUG-12177)) Editing From a4bc7b6ec2a2bb6ccf69a5aafa0a180d9c24a5c5 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 13 Oct 2023 16:37:25 +0200 Subject: [PATCH 1595/1777] Doc: Describe the line and column indicator It now shows information about all cursors in the current document, including selection length for selections. Task-number: QTCREATORBUG-29392 Change-Id: I160f618215ee969ebb8509bf196c5e4df171b83d Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../images/qtcreator-editor-line-column.webp | Bin 0 -> 9048 bytes .../creator-only/creator-coding-edit-mode.qdoc | 5 +++++ 2 files changed, 5 insertions(+) create mode 100644 doc/qtcreator/images/qtcreator-editor-line-column.webp diff --git a/doc/qtcreator/images/qtcreator-editor-line-column.webp b/doc/qtcreator/images/qtcreator-editor-line-column.webp new file mode 100644 index 0000000000000000000000000000000000000000..e46f50d94d9eaf420623c7c8d25e1727ffd347b8 GIT binary pat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?vS39s7*)lJJkoKgF;(_qdq)gInDPoa}PH!i&O(eEpJ z{+f$Zm#Kt(ss4~{cT+6#hLg0;{_k?i|9>1xYCK_ok7fSc2U5S583y^CEzIeS-7_(v z?o<1j$4h4%kNcx~EB~Eh)dBBm2lwASSMy@;|HV`Obzf{X;Eqq~PybrBKDS?nB|fva z{c#PiT!@nIx9X-niZhwJnI5UypR>L9*znaOh6K(3S1Qi<%dzZu{XJ6b>K*=e(J(XV z$8Vb1?|rSd5Gp!3|E5qaXXT%pp*vXhSH9IM-KE05diL)FM&H-W_P!Fx)_MKo^`yI- z>#SO<^7ZQT7GK;fz4ErkUMJ&VF8zDOn=fB@Cu%02xMk^v?AvXzKY4YmbZ=cQ)0;Z; z`Rci|%HN*Kzf)SmoN~`}{fxtsu>pr~i8k)qdQ`<f&duqTW{TtQ))I}#g%1}*6dEsW zv%hhRRdq%0QFY#zhu(bu`6hk;gs_bjZ+p$R$NH8!{ubkyu$OULyuurS33r*cC7&q! z#{E-R;r*m<x@T&G8d(qBW7vN4a2dx9KSuYP=js&ona=K>aXzP5jQb6*!ScE^y_MYx zw{Pk{aaE|C&QZ8BVMb2+{t5rju*G+aw!dcjrrW{rjm_i)Ut`0D<P$~TxGTf%#!TOm z&v;ulp_(~of5RIAj@_&|$0s~}Bfh8e*Gqn#)7!prSE|I`uxruD-hUzaL9v%@KckDw z|D|WLzqqk}-<hBMs9OKqEM@IKbDGj)9zAugeSb90?#lPLH&Eu0?{RNls;_vz_lEc3 Ty~ljFd^yNmTFh@eKb{EyE5nlH literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc b/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc index dc2d905cadc..4596447924d 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc @@ -56,6 +56,11 @@ \l{Searching with the Locator}{locator}. Enter the line number and column number in the locator, separated by a colon (:). + The line and column indicator shows more information about the current + cursor positions, including the length of the selection for selected text. + + \image qtcreator-editor-line-column.webp {Line and column indicator on the Edit mode toolbar} + \note You can also use the \l{Show and hide sidebars}{sidebars} to move around in \QC. From 3e404945cf2e30072b4fb6da568b18d568775e92 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 13 Oct 2023 15:41:02 +0200 Subject: [PATCH 1596/1777] Doc: Describe the Antialias check box ...in Edit > Preferences > Help > General. Used to disable antialiasing of help text. Task-number: QTCREATORBUG-29392 Change-Id: Idc9611d4dd514f8099231b937634cc4da540e957 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- doc/qtcreator/images/qtcreator-help-options.png | Bin 14466 -> 0 bytes .../qtcreator-preferences-help-general.webp | Bin 0 -> 10672 bytes doc/qtcreator/src/howto/creator-help.qdoc | 8 +++++--- 3 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 doc/qtcreator/images/qtcreator-help-options.png create mode 100644 doc/qtcreator/images/qtcreator-preferences-help-general.webp diff --git a/doc/qtcreator/images/qtcreator-help-options.png b/doc/qtcreator/images/qtcreator-help-options.png deleted file mode 100644 index b0916ab7b1952bbcfafd1c0e7f4a5529bf8a30c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14466 zcmeAS@N?(olHy`uVBq!ia0y~yU|PYzz_^5iiGhKk=!3&s1_ldHPZ!6Kid%2z#^%c$ z-?`wkJ&TKo^CiAVN0d~f`;PXyw2G+)$&0C8w)}TuCx;k!q%?2sWb1eh#~c@xCwosF z+kLb9K#A}PUx7DFj75tB3(n1-5x+UVJUsk*dii;u^95DUDh($5TD)u5ueGo0R%Ok4 z@;xjpY+d~ReY<z>HvjCQxO7F(gQriQnldmjNX&cR>9u|PcKuQo%~c{l{`~y>=pVPZ zUX6T?idyCR47SIMPqQ&Fq-)kmy2ZZ|33^cc{M_FM?DiGk@0Q=Me!q8ifWpNIGdx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ID21r0{VQ_YE}_6?8c;Vk$L>h4?z|757!!7`^;8SJx$NiH{Xf;N zxu5i(KF`qemtf#ZpT4@;62&({i==%2T<iaQQqt?UmLND48q|I~J>O&JjS0{>|3j{v zQ9gf;Y(5H#Y0%6OsMpz}_;2pqx#o!;Dj9|!h0lvY5@}jyW@d45adtNMcN6zRs*aN{ z2%h&m4oYcT&Y;fC^G<N^+@X@OdiClf#h1W|^Q|&}jAYK-=3^c^v~*l;Zuf#>mm$Ie iGRlFs`DIY}&wlaEUp;#hcFKYF_ISGbxvX<aXaWF}0aK^| diff --git a/doc/qtcreator/images/qtcreator-preferences-help-general.webp b/doc/qtcreator/images/qtcreator-preferences-help-general.webp new file mode 100644 index 0000000000000000000000000000000000000000..b13a22430d95f6b1551bfe9292b55c2d9a59b2bf GIT binary patch literal 10672 zcmWIYbaPvw$-ofq>J$(bVBs@IlYv41zEcsyRj$WolSFzy^H)pq#|bV}$YpMmdePVQ z<G6wQ89zf|V<qOzC0d#Sa<8PXb2`QJ9LV^;|M9lMd8yTf55G+{&#f+;yi)JGn^%#i ze~gCi`~&J!F3p^mvGB{I;%%Ij9hIv0f9D&|U^M)$!RF%Fq&Y#)-8hhekKKeNh(VEi z8b@q%!_JAxx6AIDmGd!%bTD(=kIp&ybGw`O{`MN{+no)T4=!xnwl`0Dum0v%2CXHm zEDcwa{@ccQ{jl7A?vkZ*!MfB{|1KxpJ~2r}v#@r>y?K%DA=mxRo}MZz880v=*Z;Q6 zMs4Hb*?OC&|Mvd+-+HBN`~sov$!Ti++dYyKZZqUcu-Q2L|8L^5%J_lDq&wR#K44&7 z^Y4G~8s>nj_39H;G=sjc<Xxp6?f*`@`}l_mHa+wDojZ;%so~kzGGDZOQA*FkNSXeJ zlXtKeTh2SM-G1{9-#Rh-zCS-$eih$oE7w_cJN1?Q&V6SCb|mbcbNk~z_XpkGwLfM& zIsW*?`HMdm`Rw14@xy;zzHy0l8y8=4U*+$`7b*naA8hDZ@i8*DSL1n6^W=rM4MH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Zi<cj zDWLmk>x-s+FLkqYm%ep6{{NyB^NM9>T;`e_VY>ch*5#?4w^S0sSZ7BFy~&!qLt|Ud z*NW*|D{el&*jBx+VVD0y@8IC+@oMq9d{;}HLvpJ;Vjn+Yi%8`8cItA(r7JmCPM=^j zj5!$Nxc*JivHvWxYa+kZZc%Juh~NB+@z$XwYZGENSjF;2fQ2rXtIPYz*yU#}uv#X! zA>(|)V^5w3tgD+P3p86MsIQBB``z>a-;LBwhuMEVnsv1<p7~8eteSPrkDxP=*Vo*O P;z>IIOIPccyE6d*M3{ep literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/howto/creator-help.qdoc b/doc/qtcreator/src/howto/creator-help.qdoc index 0b7610f1c9d..005153cb13c 100644 --- a/doc/qtcreator/src/howto/creator-help.qdoc +++ b/doc/qtcreator/src/howto/creator-help.qdoc @@ -50,13 +50,15 @@ family, style, and size in \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > \uicontrol General. - \image qtcreator-help-options.png {General tab in Help preferences} + \image qtcreator-preferences-help-general.webp {General tab in Help preferences} You can set the default zoom level in the \uicontrol Zoom field. When viewing help pages, you can use the mouse scroll wheel to zoom them. To disable this feature, deselect the \uicontrol {Enable scroll wheel zooming} check box. + To disable antialiasing, deselect the \uicontrol Antialiasing check box. + \section1 Return to the editor To switch to the editor context when you close the last help page, select @@ -290,7 +292,7 @@ is detached to an external window, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > \uicontrol General. - \image qtcreator-help-options.png {General tab in Help preferences} + \image qtcreator-preferences-help-general.webp {General tab in Help preferences} Set preferences for displaying context-sensitive help in the \uicontrol {On context help} field. To detach the help window, select @@ -318,7 +320,7 @@ \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > \uicontrol General > \uicontrol {On help start} field. - \image qtcreator-help-options.png {General tab in Help preferences} + \image qtcreator-preferences-help-general.webp {General tab in Help preferences} \list \li To display the page and help views that were open when you exited the mode, From 8475872e10b1881258bdbe14a7c9010a74a2b929 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 16 Oct 2023 09:52:08 +0200 Subject: [PATCH 1597/1777] CompilerExplorer: Add missing translation Change-Id: If12a0530addf3c815d7b3a25b6dfdd90d29361a6 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/compilerexplorer/compilerexplorereditor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 6ca54b356ac..ac0dd963bb1 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -474,7 +474,9 @@ void CompilerWidget::doCompile() if (l.opcodes.empty()) continue; - auto mark = new TextMark(m_asmDocument.get(), i, TextMarkCategory{"Bytes", "Bytes"}); + auto mark = new TextMark(m_asmDocument.get(), + i, + TextMarkCategory{Tr::tr("Bytes"), "Bytes"}); mark->setLineAnnotation(l.opcodes.join(' ')); m_marks.append(mark); } From a4df0a3cc4ec952dd511b1794b1624d21d5dbccd Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 16 Oct 2023 09:39:29 +0200 Subject: [PATCH 1598/1777] CompilerExplorer: Add "powered by" label Change-Id: I0006d314ee69f863e48196a7719a3ef7ebc127ae Reviewed-by: hjk <hjk@qt.io> --- .../compilerexplorer/compilerexplorereditor.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index ac0dd963bb1..14abaaed0b1 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -32,6 +32,7 @@ #include <utils/utilsicons.h> #include <QCompleter> +#include <QDesktopServices> #include <QDockWidget> #include <QNetworkAccessManager> #include <QPushButton> @@ -805,6 +806,22 @@ QWidget *Editor::toolBar() newSource->setToolTip(Tr::tr("Add Source")); m_toolBar->addAction(newSource); + m_toolBar->addSeparator(); + + QString link = QString(R"(<a href="%1">%1</a>)") + .arg(m_document->settings()->compilerExplorerUrl.value()); + + auto poweredByLabel = new QLabel(Tr::tr("powered by %1").arg(link)); + + poweredByLabel->setTextInteractionFlags(Qt::TextInteractionFlag::TextBrowserInteraction); + poweredByLabel->setContentsMargins(6, 0, 0, 0); + + connect(poweredByLabel, &QLabel::linkActivated, this, [](const QString &link) { + QDesktopServices::openUrl(link); + }); + + m_toolBar->addWidget(poweredByLabel); + connect(newSource, &QAction::triggered, &m_document->settings()->m_sources, From 4bf97ce30cce35d24ed8ef3c2ce43be027bc9212 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 16 Oct 2023 09:36:09 +0200 Subject: [PATCH 1599/1777] Change log: Make reference to godbolt.org more explicit Change-Id: I19a5acd21c7168388a0bc6f4b6299af7e2ebc37b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- dist/changelog/changes-12.0.0.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 1416c7cc2e2..9012ad70d30 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -13,14 +13,15 @@ the public Git repository. For example: What's new? ----------- -* Support for Compiler Explorer +* Integrated [Compiler Explorer (https://godbolt.org)](https://godbolt.org) * CMake debugging and the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/) * Screen recording ### Compiler Explorer -Use [Compiler Explorer](https://godbolt.org) in Qt Creator and enter example -code to explore the capabilities of your compilers and interpreters. +Use [Compiler Explorer (https://godbolt.org)](https://godbolt.org) in Qt Creator +and enter example code to explore the capabilities of your compilers and +interpreters. To enable the CompilerExplorer plugin, select `Help > About Plugins > Utilities > CompilerExplorer`. Then select @@ -32,7 +33,7 @@ to get started. Alternatively, you can open a new `Compiler Explorer` editor via `Tools > Compiler Explorer > Open Compiler Explorer`. -Every language, compiler and library that is supported at https://godbolt.org +Every language, compiler, and library that is supported at <https://godbolt.org> is also supported in Qt Creator. You can save your Compiler Explorer session as a `.qtce` file (JSON-based). From f1fe8392d2978ca7adaee4c496ef0f2f0f865b20 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 16 Oct 2023 11:12:29 +0200 Subject: [PATCH 1600/1777] Tr: Fix shortcut display for exiting FakeVim Qt "Meta" is macOS "Control" Change-Id: I9c2ca5fe25d70da97871e54060c892eb6fa78e0a Reviewed-by: hjk <hjk@qt.io> --- share/qtcreator/translations/qtcreator_de.ts | 2 +- share/qtcreator/translations/qtcreator_fr.ts | 4 ++-- share/qtcreator/translations/qtcreator_zh_CN.ts | 2 +- src/plugins/fakevim/fakevimhandler.cpp | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 5651190fae9..b2a8efb3742 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -28420,7 +28420,7 @@ zu deaktivieren, deaktiviert auch die folgenden Plugins: <translation>In FakeVim nicht implementiert.</translation> </message> <message> - <source>Type Meta-Shift-Y, Meta-Shift-Y to quit FakeVim mode.</source> + <source>Type Control-Shift-Y, Control-Shift-Y to quit FakeVim mode.</source> <translatorcomment>These are the names of the actual keys on my german Apple keyboard https://support.apple.com/de-de/HT201236</translatorcomment> <translation>Benutzen sie Control-Umschalt-Y, Control-Umschalt-Y, um den FakeVim-Modus zu verlassen.</translation> </message> diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index 20b0d641001..aefa806c6e8 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -28049,8 +28049,8 @@ Raison : %3</translation> <translation>La marque « %1 » n'est pas définie.</translation> </message> <message> - <source>Type Meta-Shift-Y, Meta-Shift-Y to quit FakeVim mode.</source> - <translation>Tapez Meta-Maj-Y, Meta-Maj-Y pour quitter le mode FakeVim.</translation> + <source>Type Control-Shift-Y, Control-Shift-Y to quit FakeVim mode.</source> + <translation>Tapez Contrôle-Maj-Y, Contrôle-Maj-Y pour quitter le mode FakeVim.</translation> </message> <message> <source>Type Alt-Y, Alt-Y to quit FakeVim mode.</source> diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 9eb7428ef59..99850f9df5a 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -18911,7 +18911,7 @@ will also disable the following plugins: <translation type="unfinished"></translation> </message> <message> - <source>Type Meta-Shift-Y, Meta-Shift-Y to quit FakeVim mode.</source> + <source>Type Control-Shift-Y, Control-Shift-Y to quit FakeVim mode.</source> <translation type="unfinished"></translation> </message> <message> diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index a1bee53b6ad..06ad9703c48 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -4538,7 +4538,8 @@ bool FakeVimHandler::Private::handleNoSubMode(const Input &input) } else if (input.isControl('c')) { if (isNoVisualMode()) { #if defined(Q_OS_MACOS) - showMessage(MessageInfo, Tr::tr("Type Meta-Shift-Y, Meta-Shift-Y to quit FakeVim mode.")); + showMessage(MessageInfo, + Tr::tr("Type Control-Shift-Y, Control-Shift-Y to quit FakeVim mode.")); #else showMessage(MessageInfo, Tr::tr("Type Alt-Y, Alt-Y to quit FakeVim mode.")); #endif From 3078aaadcfdb5e39194b4f3eb21a344a48a0c691 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 13 Oct 2023 10:52:28 +0200 Subject: [PATCH 1601/1777] Doc: Describe debugging CMake project files over DAP Task-number: QTCREATORBUG-29392 Change-Id: Iceb7f0d07cae62e14b2e2c52c43aaaca090ad07d Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- dist/changelog/changes-12.0.0.md | 7 ++-- .../images/qtcreator-debugger-cmake.webp | Bin 0 -> 22586 bytes .../creator-how-to-debug-cmake-files.qdoc | 32 ++++++++++++++++++ .../src/cmake/creator-projects-cmake.qdoc | 4 +-- .../src/debugger/creator-debug-views.qdoc | 4 +++ .../creator-only/creator-debugger.qdoc | 1 + .../howto/creator-only/creator-how-tos.qdoc | 4 +++ doc/qtcreator/src/qtcreator-toc.qdoc | 2 ++ 8 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-debugger-cmake.webp create mode 100644 doc/qtcreator/src/cmake/creator-how-to-debug-cmake-files.qdoc diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 9012ad70d30..0c5f7d211e6 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -41,8 +41,11 @@ a `.qtce` file (JSON-based). ### CMake Debugging and the Debug Adapter Protocol -Set breakpoints in a CMake file and select `DAP` and `CMake Preset` in `Debug` -mode to debug CMake project files. +Set breakpoints in a CMake file and select +`Debug > Start Debugging > Start CMake Debugging` to start debugging. + +([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-debug-cmake-files.html)) + ### Screen Recording diff --git a/doc/qtcreator/images/qtcreator-debugger-cmake.webp b/doc/qtcreator/images/qtcreator-debugger-cmake.webp new file mode 100644 index 0000000000000000000000000000000000000000..5200f2a060bce490bc96f36b40a5b4725e14f38b GIT binary patch literal 22586 zcmWIYbaOL`U|<M$bqWXzu<%ihU|`U{>72%3`f~pN_c!O7{VM(6_oa@9U1n7;i<*fn zClA}rL#;|FGdU{`$j;8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2Q;**AigK*c zwMe-7<bP7z2BUy~e`ox?d?0nk&I2rQo7eUA@XVC+oB!p+d#$A66YY;*f1J!#!|59< zYipOMd}7MXgWg6ZH=-izJA`s%j;L39*#t7Jcf5G@;>O8la|-*J94|U(OMUOKw|F=4 z{?%D$AFe5>JsUIO%zMp;$-DL)yOt(CtER{Nch=T(uk6#m&fom&eB|HfI(ds27y!=| B+t&a9 literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/cmake/creator-how-to-debug-cmake-files.qdoc b/doc/qtcreator/src/cmake/creator-how-to-debug-cmake-files.qdoc new file mode 100644 index 00000000000..3631b24cec1 --- /dev/null +++ b/doc/qtcreator/src/cmake/creator-how-to-debug-cmake-files.qdoc @@ -0,0 +1,32 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-how-to-debug-cmake-files.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-debug + + \title Debug CMake project files + + With the \QC implementation of the + \l {https://microsoft.github.io/debug-adapter-protocol/} + {Debug Adapter Protocol (DAP)}, you can debug CMake project files. + + \note You need CMake 3.27 or later for DAP. + + To debug CMake project files: + + \list 1 + \li In the \uicontrol Edit mode, set breakpoints in a CMake file. + \li Select \uicontrol Debug > \uicontrol {Start Debugging} > + \uicontrol {Start CMake Debugging}. + \image qtcreator-debugger-cmake.webp {DAP CMake Preset view in the Debug mode} + \endlist + + When the application stops at a breakpoint, you can examine data in the + \uicontrol Debug mode views. + + \sa {Debugging},{Examining Data},{Debug Mode Views},{Setting Breakpoints}, + {Setting Up CMake} +*/ diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc index 3b0a3d70a55..4491afb9d72 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc @@ -216,6 +216,6 @@ Syntax completion and highlighting work once your project successfully builds and links against the external library. - \sa {Open projects}, {CMake Build Configuration}, {Specifying Run Settings}, - {Deploying to Remote Linux} + \sa {Open projects}, {CMake Build Configuration}, {Debug CMake project files}, + {Specifying Run Settings}, {Deploying to Remote Linux} */ diff --git a/doc/qtcreator/src/debugger/creator-debug-views.qdoc b/doc/qtcreator/src/debugger/creator-debug-views.qdoc index a963701d555..8dfed8b2212 100644 --- a/doc/qtcreator/src/debugger/creator-debug-views.qdoc +++ b/doc/qtcreator/src/debugger/creator-debug-views.qdoc @@ -348,6 +348,10 @@ is unlikely that the used addresses will stay the same at the next application launch. If you really want a data breakpoint to be active again, re-enable it manually. + + \if defined(qtcreator) + \sa {Debug CMake project files} + \endif */ /*! diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index b87444f83b8..1c1f64d419c 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -116,6 +116,7 @@ solutions to them. \endlist + \sa {Debug CMake project files} */ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index c5a61602087..025c2bd2ef1 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -20,6 +20,10 @@ \generatelist creator-how-to-build + \section1 Debug + + \generatelist creator-how-to-debug + \section1 Design UIs \generatelist creator-how-to-design diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index abebcb43861..7e633a338c3 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -180,6 +180,8 @@ \list \li Build and Run \generatelist creator-how-to-build + \li Debug + \generatelist creator-how-to-debug \li Design UIs \generatelist creator-how-to-design \li Edit Code From cad73e4f1adcaf1d66722ab0069416b7ed61659b Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Mon, 16 Oct 2023 07:55:57 +0200 Subject: [PATCH 1602/1777] LanguageClient: avoid assert on init response Fixes: QTCREATORBUG-29748 Change-Id: I6b86906f302be6e0eb3a89eaf851f7231bf78586 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/languageclient/client.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 6c6098be215..2fcfc0210fc 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -537,7 +537,7 @@ void Client::initialize() else params.setWorkSpaceFolders(workspaces); InitializeRequest initRequest(params); - initRequest.setResponseCallback([this](const InitializeRequest::Response &initResponse){ + initRequest.setResponseCallback([this](const InitializeRequest::Response &initResponse) { d->initializeCallback(initResponse); }); if (std::optional<ResponseHandler> responseHandler = initRequest.responseHandler()) @@ -2105,7 +2105,11 @@ void Client::setDocumentChangeUpdateThreshold(int msecs) void ClientPrivate::initializeCallback(const InitializeRequest::Response &initResponse) { - QTC_ASSERT(m_state == Client::InitializeRequested, return); + if (m_state != Client::InitializeRequested) { + qCWarning(LOGLSPCLIENT) << "Dropping initialize response in unexpected state " << m_state; + qCDebug(LOGLSPCLIENT) << initResponse.toJsonObject(); + return; + } if (std::optional<ResponseError<InitializeError>> error = initResponse.error()) { if (std::optional<InitializeError> data = error->data()) { if (data->retry()) { From 358ecee5e8dbb84f279493b142187232b0d1fe85 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Fri, 13 Oct 2023 17:05:02 +0200 Subject: [PATCH 1603/1777] DAP: Remember current engine after restart Change-Id: I13a6c559a3a5bb9f40c95ef3932d796776cd26ce Reviewed-by: hjk <hjk@qt.io> --- src/plugins/debugger/enginemanager.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/enginemanager.cpp b/src/plugins/debugger/enginemanager.cpp index 4656f15cb30..a0f515897c4 100644 --- a/src/plugins/debugger/enginemanager.cpp +++ b/src/plugins/debugger/enginemanager.cpp @@ -30,6 +30,7 @@ using namespace Utils; namespace Debugger::Internal { const bool hideSwitcherUnlessNeeded = false; +const char INDEX_ID[] = "Debugger/Debugger.SelectedEngineIndex"; #if 0 SnapshotData::SnapshotData() @@ -125,13 +126,15 @@ class ModelChooser : public QObject Q_OBJECT public: ModelChooser(QAbstractItemModel *sourceModel, - const QString &enginType, + const QString &engineType, QObject *parent = nullptr) : QObject(parent) , m_engineChooser(new QComboBox()) - , m_proxyModel(new EngineTypeFilterProxyModel(enginType)) + , m_proxyModel(new EngineTypeFilterProxyModel(engineType)) , m_sourceModel(sourceModel) - , m_enginType(enginType) + , m_enginType(engineType) + , m_key(engineType.isEmpty() ? Utils::Key(INDEX_ID) + "." + engineType.toUtf8() + : Utils::Key(INDEX_ID)) { m_proxyModel->setSourceModel(sourceModel); @@ -144,6 +147,7 @@ public: QModelIndex sourceIndex = m_proxyModel->mapToSource(m_proxyModel->index(index, 0)); emit activated(sourceIndex.row()); m_lastActivatedIndex = sourceIndex.row(); + ICore::settings()->setValue(m_key, m_lastActivatedIndex); }); connect(m_proxyModel, &QAbstractItemModel::rowsRemoved, this, [this] { @@ -161,6 +165,13 @@ public: QAbstractItemModel *model() const { return m_proxyModel; } const QString &engineType() const { return m_enginType; } + void restoreIndex() + { + m_lastActivatedIndex = ICore::settings()->value(m_key, 0).toInt(); + if (m_lastActivatedIndex <= m_engineChooser->count()) + setCurrentIndex(m_lastActivatedIndex); + } + void setCurrentIndex(int index) { const QModelIndex sourceIndex = m_proxyModel->mapFromSource(m_sourceModel->index(index, 0)); @@ -193,6 +204,7 @@ private: QPointer<EngineTypeFilterProxyModel> m_proxyModel; QAbstractItemModel *m_sourceModel; QString m_enginType; + const Utils::Key m_key; int m_lastActivatedIndex = -1; }; @@ -570,6 +582,8 @@ QString EngineManager::registerDefaultPerspective(const QString &name, engineItem->m_perspective.type = type; engineItem->m_perspective.id = id; d->m_engineModel.rootItem()->appendChild(engineItem); + d->m_engineDAPChooser->restoreIndex(); + d->m_engineChooser->restoreIndex(); return QString::number(d->m_engineModel.rootItem()->childCount()); } From b6d7990f2529407d61977700f87f0ce32421162b Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 16 Oct 2023 10:59:31 +0200 Subject: [PATCH 1604/1777] TextEditor: Add missing colon to label text Change-Id: Ie8b727d2405ff14f0ce7aa55dec4d56514405b37 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/texteditor/behaviorsettingswidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/behaviorsettingswidget.cpp b/src/plugins/texteditor/behaviorsettingswidget.cpp index 4e7c70fb22c..b5f8967a832 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.cpp +++ b/src/plugins/texteditor/behaviorsettingswidget.cpp @@ -136,7 +136,7 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent) .arg(afterWhitespaceCommentPosition); d->commentPosition->setToolTip(commentPositionToolTip); - auto commentPositionLabel = new QLabel(Tr::tr("Preferred comment position")); + auto commentPositionLabel = new QLabel(Tr::tr("Preferred comment position:")); commentPositionLabel->setToolTip(commentPositionToolTip); d->skipTrailingWhitespace = new QCheckBox(Tr::tr("Skip clean whitespace for file types:")); From ab16e61ab4324d35a4206e1758907de16eabc705 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 13 Oct 2023 15:45:20 +0200 Subject: [PATCH 1605/1777] CppEditor: Do not match scope names in "all symbols" locator Instead, put the scope name into the extra info. Amends 91dbac03033a077e77cbc58bc1321ecf6f571bfb. Fixes: QTCREATORBUG-29133 Change-Id: I7eb0d76782135c4246769728451985dc72e31f4d Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cppeditor/cpplocatorfilter.cpp | 6 +++-- .../cppeditor/cpplocatorfilter_test.cpp | 25 +++++++------------ src/plugins/cppeditor/searchsymbols.cpp | 11 +++++++- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/plugins/cppeditor/cpplocatorfilter.cpp b/src/plugins/cppeditor/cpplocatorfilter.cpp index 383db4b94d3..5e429ece522 100644 --- a/src/plugins/cppeditor/cpplocatorfilter.cpp +++ b/src/plugins/cppeditor/cpplocatorfilter.cpp @@ -119,10 +119,12 @@ LocatorMatcherTask allSymbolsMatcher() { const auto converter = [](const IndexItem::Ptr &info) { LocatorFilterEntry filterEntry; - filterEntry.displayName = info->scopedSymbolName(); + filterEntry.displayName = info->symbolName(); filterEntry.displayIcon = info->icon(); filterEntry.linkForEditor = {info->filePath(), info->line(), info->column()}; - if (info->type() == IndexItem::Class || info->type() == IndexItem::Enum) + if (!info->symbolScope().isEmpty()) + filterEntry.extraInfo = info->symbolScope(); + else if (info->type() == IndexItem::Class || info->type() == IndexItem::Enum) filterEntry.extraInfo = info->shortNativeFilePath(); else filterEntry.extraInfo = info->symbolType(); diff --git a/src/plugins/cppeditor/cpplocatorfilter_test.cpp b/src/plugins/cppeditor/cpplocatorfilter_test.cpp index 18e9b933cbe..a621d1c1103 100644 --- a/src/plugins/cppeditor/cpplocatorfilter_test.cpp +++ b/src/plugins/cppeditor/cpplocatorfilter_test.cpp @@ -220,25 +220,18 @@ void LocatorFilterTest::testLocatorFilter_data() << MatcherType::AllSymbols << "my" << ResultDataList{ + ResultData("MyClass", "<anonymous namespace>"), + ResultData("MyClass", "<anonymous namespace>::MyClass"), + ResultData("MyClass", "MyClass"), + ResultData("MyClass", "MyNamespace"), + ResultData("MyClass", "MyNamespace::MyClass"), ResultData("MyClass", testFileShort), - ResultData("MyClass::MyClass", "()"), - ResultData("MyClass::functionDefinedOutSideClass", "(char)"), + ResultData("MyEnum", "<anonymous namespace>"), + ResultData("MyEnum", "MyNamespace"), ResultData("MyEnum", testFileShort), - ResultData("MyNamespace::MyClass", testFileShort), - ResultData("MyNamespace::MyClass::MyClass", "()"), - ResultData("MyNamespace::MyClass::functionDefinedOutSideClass", - "(char)"), - ResultData("MyNamespace::MyClass::functionDefinedOutSideClassAndNamespace", - "(float)"), - ResultData("MyNamespace::MyEnum", testFileShort), - ResultData("MyNamespace::myFunction", "(bool, int)"), ResultData("myFunction", "(bool, int)"), - ResultData("<anonymous namespace>::MyClass", testFileShort), - ResultData("<anonymous namespace>::MyClass::MyClass", "()"), - ResultData("<anonymous namespace>::MyClass::functionDefinedOutSideClass", - "(char)"), - ResultData("<anonymous namespace>::MyEnum", testFileShort), - ResultData("<anonymous namespace>::myFunction", "(bool, int)") + ResultData("myFunction", "<anonymous namespace>"), + ResultData("myFunction", "MyNamespace"), }; QTest::newRow("CppClassesFilter-ObjC") diff --git a/src/plugins/cppeditor/searchsymbols.cpp b/src/plugins/cppeditor/searchsymbols.cpp index 2aea7f8e1bf..ef2a4ed05fa 100644 --- a/src/plugins/cppeditor/searchsymbols.cpp +++ b/src/plugins/cppeditor/searchsymbols.cpp @@ -315,8 +315,17 @@ void SearchSymbols::processFunction(T *func) if (!(symbolsToSearchFor & SymbolSearcher::Functions) || !func->name()) return; QString name = overview.prettyName(func->name()); + QString scope = _scope; + const int scopeSep = name.lastIndexOf("::"); + if (scopeSep != -1) { + if (!scope.isEmpty()) + scope.append("::"); + scope.append(name.left(scopeSep)); + name.remove(0, scopeSep + 2); + } QString type = overview.prettyType(func->type()); - addChildItem(name, type, _scope, IndexItem::Function, func); + + addChildItem(name, type, scope, IndexItem::Function, func); } } // namespace CppEditor From 0634f9259bba899e60fd9dac91b49c813be2a337 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Mon, 16 Oct 2023 14:29:41 +0200 Subject: [PATCH 1606/1777] Tr: Remove full stop in lable names Fixes: QTCREATORBUG-29355 Change-Id: Ib3769c1c797c0bc500b5b60e2b06b6f8ab7a6fb2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- .../templates/wizards/projects/qtquickapplication/wizard.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json index f50ef00577a..2e885c2bb63 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json @@ -55,7 +55,7 @@ [ { "name": "QdsProjectStyle", - "trDisplayName": "Creates a project that you can open in Qt Design Studio.", + "trDisplayName": "Creates a project that you can open in Qt Design Studio", "trToolTip": "Creates a project with a structure that is compatible both with Qt Design Studio (via .qmlproject) and with Qt Creator (via CMakeLists.txt). It contains a .ui.qml form that you can visually edit in Qt Design Studio.", "type": "CheckBox", "span": true, @@ -78,7 +78,7 @@ }, { "name": "MinimumSupportedQtVersion", - "trDisplayName": "The minimum version of Qt you want to build the application for.", + "trDisplayName": "The minimum version of Qt you want to build the application for", "type": "ComboBox", "data": { From 3d3a3c8ba849011eeafc2de4a6e7661a588022d1 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Mon, 16 Oct 2023 10:28:15 +0200 Subject: [PATCH 1607/1777] Doc: Fix grouping of the Record screens topic to "How to Use Qt Creator" Change-Id: Ic967149435fbb772cfa81e2cdf7eb52fb9baecaa Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../src/howto/creator-only/creator-how-to-record-screens.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-to-record-screens.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-to-record-screens.qdoc index b252eecc786..e12aebd6188 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-to-record-screens.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-to-record-screens.qdoc @@ -5,7 +5,7 @@ \page creator-how-to-record-screens.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-use \title Record screens From abeb2287ceef9d0b106b254a1da9fe94a8bf4379 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 16 Oct 2023 09:29:21 +0200 Subject: [PATCH 1608/1777] Tr: Fix some quoting Change-Id: I91c515822d48b4efb7c7869c5afe06b5375bf20e Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- share/qtcreator/translations/qtcreator_da.ts | 8 +++--- share/qtcreator/translations/qtcreator_de.ts | 20 +++++++------- share/qtcreator/translations/qtcreator_fr.ts | 26 +++++++++---------- share/qtcreator/translations/qtcreator_hr.ts | 8 +++--- share/qtcreator/translations/qtcreator_ja.ts | 8 +++--- share/qtcreator/translations/qtcreator_pl.ts | 4 +-- share/qtcreator/translations/qtcreator_ru.ts | 12 ++++----- share/qtcreator/translations/qtcreator_uk.ts | 8 +++--- .../qtcreator/translations/qtcreator_zh_CN.ts | 20 +++++++------- src/plugins/android/androidbuildapkstep.cpp | 12 +++++---- .../androidpackageinstallationstep.cpp | 2 +- src/plugins/android/androidsdkdownloader.cpp | 2 +- src/plugins/bazaar/pullorpushdialog.cpp | 4 +-- .../cmakeprojectmanager/cmakebuildsystem.cpp | 2 +- src/plugins/mercurial/srcdestdialog.cpp | 5 ++-- 15 files changed, 72 insertions(+), 69 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_da.ts b/share/qtcreator/translations/qtcreator_da.ts index 485b2f6dcb3..d30843de390 100644 --- a/share/qtcreator/translations/qtcreator_da.ts +++ b/share/qtcreator/translations/qtcreator_da.ts @@ -2953,8 +2953,8 @@ Lokale commits pushes ikke til master-grenen inden en normal commit udføres.</t <translation>Lokalt filsystem:</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> - <translation>F.eks.: 'https://[bruger[:kode]@]vært[:port]/[sti]'.</translation> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> + <translation>F.eks.: "https://[bruger[:kode]@]vært[:port]/[sti]".</translation> </message> <message> <source>Specify URL:</source> @@ -19514,8 +19514,8 @@ Fejl: %5</translation> <translation>Lokalt filsystem:</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> - <translation>F.eks.: 'https://[bruger[:kode]@]vært[:port]/[sti]'.</translation> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> + <translation>F.eks.: "https://[bruger[:kode]@]vært[:port]/[sti]".</translation> </message> <message> <source>Specify URL:</source> diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index b2a8efb3742..bcd7d0571a5 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -9522,7 +9522,7 @@ Locked components cannot be modified or selected.</source> <translation>SDK-Werkzeuge herunterladen</translation> </message> <message> - <source>Could not open %1 for writing: %2.</source> + <source>Could not open "%1" for writing: %2.</source> <translation>Die Datei "%1" konnte nicht zum Schreiben geöffnet werden: %2.</translation> </message> <message> @@ -10240,11 +10240,11 @@ Der vom Kit mindestens benötigte API-Level ist %1.</translation> <translation>Die Version des Android Build-SDK ist nicht definiert. Überprüfen Sie die Android-Einstellungen.</translation> </message> <message> - <source>The Android build folder %1 was not found and could not be created.</source> + <source>The Android build folder "%1" was not found and could not be created.</source> <translation>Das Build-Verzeichnis "%1" für Android wurde nicht gefunden und konnte nicht erstellt werden.</translation> </message> <message> - <source>Cannot copy the target's lib file %1 to the Android build folder %2.</source> + <source>Cannot copy the target's lib file "%1" to the Android build folder "%2".</source> <translation>Die lib-Datei "%1" des Targets konnte nicht in das Build-Verzeichnis "%2" für Android kopiert werden.</translation> </message> <message> @@ -10567,7 +10567,7 @@ Breche ausstehende Operationen ab... <translation>Anwendungsdaten kopieren</translation> </message> <message> - <source><b>Make install:</b> Copy App Files to %1</source> + <source><b>Make install:</b> Copy App Files to "%1"</source> <translation><b>Installieren:</b> Anwendungsdateien nach "%1" kopieren</translation> </message> <message> @@ -13260,8 +13260,8 @@ This flag will allow push to proceed.</source> Die Einstellung gestattet es, unter diesen Umständen fortzusetzen.</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> - <translation>Zum Beispiel: 'https://[user[:pass]@]host[:port]/[path]'.</translation> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> + <translation>Zum Beispiel: "https://[user[:pass]@]host[:port]/[path]".</translation> </message> <message> <source>Ignores differences between branches and overwrites @@ -14676,8 +14676,8 @@ Zum Beispiel bewirkt die Angabe "Revision: 15" dass der Branch auf Rev <translation>Keine gültige ausführbare CMake-Datei.</translation> </message> <message> - <source>Running in %1: %2.</source> - <translation>Führe in %1 aus: %2.</translation> + <source>Running in "%1": %2.</source> + <translation>Führe in "%1" aus: %2.</translation> </message> <message> <source><No CMake Tool available></source> @@ -34345,8 +34345,8 @@ Beispiel: *.cpp%1*.h</translation> <translation>Nutzerdaten abfragen</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> - <translation>Zum Beispiel: 'https://[user[:pass]@]host[:port]/[path]'.</translation> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> + <translation>Zum Beispiel: "https://[user[:pass]@]host[:port]/[path]".</translation> </message> <message> <source>Commit Editor</source> diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index aefa806c6e8..fd910819165 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -9643,12 +9643,12 @@ Le niveau minimum d'API nécessaire par le kit est %1.</translation> <translation>Le fichier des paramètres de déploiement Android est introuvable. Aucune construction d'APK.</translation> </message> <message> - <source>The Android build folder %1 was not found and could not be created.</source> - <translation>Le dossier de compilation Android %1 n'a pas été trouvé ou ne peut être créé.</translation> + <source>The Android build folder "%1" was not found and could not be created.</source> + <translation>Le dossier de compilation Android « %1 » n'a pas été trouvé ou ne peut être créé.</translation> </message> <message> - <source>Cannot copy the target's lib file %1 to the Android build folder %2.</source> - <translation>Impossible de copier le fichier cible de la bibliothèque %1 dans le répertoire de compilation Android %2.</translation> + <source>Cannot copy the target's lib file "%1" to the Android build folder "%2".</source> + <translation>Impossible de copier le fichier cible de la bibliothèque « %1 » dans le répertoire de compilation Android « %2 ».</translation> </message> <message> <source>Cannot copy file "%1" to Android build libs folder "%2".</source> @@ -9989,8 +9989,8 @@ Cela ne peut être annulé.</translation> <translation>Copie des données de l’application</translation> </message> <message> - <source><b>Make install:</b> Copy App Files to %1</source> - <translation><b>Make install :</b> Copie des fichiers de l'application vers %1</translation> + <source><b>Make install:</b> Copy App Files to "%1"</source> + <translation><b>Make install :</b> Copie des fichiers de l'application vers « %1 »</translation> </message> <message> <source>"%1" step has an invalid C++ toolchain.</source> @@ -10644,8 +10644,8 @@ Les fichiers du répertoire source du paquet Android sont copiés dans le réper <translation>Télécharger les outils du SDK</translation> </message> <message> - <source>Could not open %1 for writing: %2.</source> - <translation>Impossible d'ouvrir %1 en écriture : %2.</translation> + <source>Could not open "%1" for writing: %2.</source> + <translation>Impossible d'ouvrir « %1 » en écriture : %2.</translation> </message> <message> <source>Downloading Android SDK Tools from URL %1 has failed: %2.</source> @@ -12999,9 +12999,9 @@ Les commits locaux ne sont pas envoyés vers la branche master jusqu'à ce <translation>Boite de dialogue</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> <translatorcomment>Should we translate the URL?</translatorcomment> - <translation>Par exemple : 'https://[user[:pass]@]host[:port]/[path]'.</translation> + <translation>Par exemple : « https://[user[:pass]@]host[:port]/[path] ».</translation> </message> <message> <source>Ignores differences between branches and overwrites @@ -14427,8 +14427,8 @@ Par exemple, « Revision : 15 » laissera la branche à la révis <translation>Exécutable CMake invalide.</translation> </message> <message> - <source>Running in %1: %2.</source> - <translation>Exécution dans %1 : %2.</translation> + <source>Running in "%1": %2.</source> + <translation>Exécution dans « %1 » : %2.</translation> </message> <message> <source>Failed to open %1 for reading.</source> @@ -34096,7 +34096,7 @@ Exemple : *.cpp%1*.h</translation> <translation>Spécifier l’URL :</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> <translation>Par exemple : « https://[utilisateur[:motdepasse]@]hôte[:port]/[chemin] ».</translation> </message> <message> diff --git a/share/qtcreator/translations/qtcreator_hr.ts b/share/qtcreator/translations/qtcreator_hr.ts index 4a204546976..35294aedfff 100644 --- a/share/qtcreator/translations/qtcreator_hr.ts +++ b/share/qtcreator/translations/qtcreator_hr.ts @@ -1428,8 +1428,8 @@ Lokalne obveze se ne guraju u glavnu granu sve dok se ne izvrši normalna obveza <translation>Lokalni datotečni sustav:</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> - <translation>Na primjer: 'https://[user[:pass]@]host[:port]/[path]'.</translation> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> + <translation>Na primjer: "https://[user[:pass]@]host[:port]/[path]".</translation> </message> <message> <source>Specify URL:</source> @@ -4824,8 +4824,8 @@ Greška: %5</translation> <translation>Lokalni datotečni sustav:</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> - <translation>Na primjer: 'https://[user[:pass]@]host[:port]/[path]'.</translation> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> + <translation>Na primjer: "https://[user[:pass]@]host[:port]/[path]".</translation> </message> <message> <source>Specify URL:</source> diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts index 4ee46da7e0c..6bfd303b72d 100644 --- a/share/qtcreator/translations/qtcreator_ja.ts +++ b/share/qtcreator/translations/qtcreator_ja.ts @@ -982,8 +982,8 @@ This flag will allow push to proceed.</source> <translation>サーバーへプッシュ</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> - <translation>例: 'https://[user[:pass]@]host[:port]/[path]'.</translation> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> + <translation>例: "https://[user[:pass]@]host[:port]/[path]".</translation> </message> <message> <source>Ignores differences between branches and overwrites @@ -3821,8 +3821,8 @@ Add, modify, and remove document filters, which determine the documentation set <translation>認証情報を確認する</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> - <translation>例: 'https://[user[:pass]@]host[:port]/[path]'.</translation> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> + <translation>例: "https://[user[:pass]@]host[:port]/[path]".</translation> </message> </context> <context> diff --git a/share/qtcreator/translations/qtcreator_pl.ts b/share/qtcreator/translations/qtcreator_pl.ts index 8f2281e1f47..f207ab64d56 100644 --- a/share/qtcreator/translations/qtcreator_pl.ts +++ b/share/qtcreator/translations/qtcreator_pl.ts @@ -9771,7 +9771,7 @@ Możesz odłożyć zmiany lub je porzucić.</translation> <translation>Pytaj o listy uwierzytelniające</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> <translation>Na przykład: "https://[użytkownik[:hasło]@]host[:port]/[ścieżka]".</translation> </message> </context> @@ -13330,7 +13330,7 @@ This flag will allow push to proceed.</source> <translation type="unfinished"></translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> <translation>Na przykład: "https://[użytkownik[:hasło]@]host[:port]/[ścieżka]".</translation> </message> <message> diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index 2d0de058a66..9dc5e7249e0 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -578,8 +578,8 @@ The minimum API level required by the kit is %1.</source> <translation>Установка на устройство</translation> </message> <message> - <source><b>Make install:</b> Copy App Files to %1</source> - <translation><b>Make install:</b> Копирование файлов приложения в %1</translation> + <source><b>Make install:</b> Copy App Files to "%1"</source> + <translation><b>Make install:</b> Копирование файлов приложения в «%1»</translation> </message> <message> <source>Activity manager start options:</source> @@ -1378,8 +1378,8 @@ Do you want to uninstall the existing package?</source> <translation>Загрузка SDK Tools</translation> </message> <message> - <source>Could not open %1 for writing: %2.</source> - <translation>Не удалось открыть %1 для записи: %2.</translation> + <source>Could not open "%1" for writing: %2.</source> + <translation>Не удалось открыть «%1» для записи: %2.</translation> </message> <message> <source>Downloading Android SDK Tools from URL %1 has failed: %2.</source> @@ -4428,7 +4428,7 @@ This flag will allow push to proceed.</source> Этот флаг позволяет выполнить эту операцию.</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> <translation>Например: «https://[имя[:пароль]@]адрес[:порт]/[путь]».</translation> </message> <message> @@ -24645,7 +24645,7 @@ Error: %5</translation> <translation>Спрашивать имя пользователя и пароль</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> <translation>Например: «https://[имя[:пароль]@]адрес[:порт]/[путь]».</translation> </message> </context> diff --git a/share/qtcreator/translations/qtcreator_uk.ts b/share/qtcreator/translations/qtcreator_uk.ts index e0c0aefa6d2..5e90d729015 100644 --- a/share/qtcreator/translations/qtcreator_uk.ts +++ b/share/qtcreator/translations/qtcreator_uk.ts @@ -764,8 +764,8 @@ This flag will allow push to proceed.</source> <translation type="unfinished"></translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> - <translation>Наприклад: 'https://[user[:pass]@]host[:port]/[path]'.</translation> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> + <translation>Наприклад: "https://[user[:pass]@]host[:port]/[path]".</translation> </message> <message> <source>Ignores differences between branches and overwrites @@ -10790,8 +10790,8 @@ Ids must begin with a lowercase letter.</source> <translation type="unfinished"></translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> - <translation>Наприклад: 'https://[user[:pass]@]host[:port]/[path]'.</translation> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> + <translation>Наприклад: "https://[user[:pass]@]host[:port]/[path]".</translation> </message> </context> <context> diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 99850f9df5a..cb89a89d43d 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -597,12 +597,12 @@ The minimum API level required by the kit is %1.</source> <translation>安卓部署设定文件不存在,未构建 APK。</translation> </message> <message> - <source>The Android build folder %1 was not found and could not be created.</source> - <translation>未找到安卓构建文件夹%1,并无法创建。</translation> + <source>The Android build folder "%1" was not found and could not be created.</source> + <translation>未找到安卓构建文件夹“%1“,并无法创建。</translation> </message> <message> - <source>Cannot copy the target's lib file %1 to the Android build folder %2.</source> - <translation>无法复制目标的库文件%1到安卓构建目录%2。</translation> + <source>Cannot copy the target's lib file "%1" to the Android build folder "%2".</source> + <translation>无法复制目标的库文件“%1“到安卓构建目录“%2“。</translation> </message> <message> <source>Cannot copy file "%1" to Android build libs folder "%2".</source> @@ -1211,8 +1211,8 @@ This cannot be undone.</source> <translation>服务无效。无法保存 Manifest。请在保存前修正服务定义。</translation> </message> <message> - <source><b>Make install:</b> Copy App Files to %1</source> - <translation><b>Make install:</b> 拷贝应用到 %1</translation> + <source><b>Make install:</b> Copy App Files to "%1"</source> + <translation><b>Make install:</b> 拷贝应用到 “%1“</translation> </message> <message> <source>"%1" step has an invalid C++ toolchain.</source> @@ -1432,8 +1432,8 @@ This cannot be undone.</source> <translation>下载 SDK 工具</translation> </message> <message> - <source>Could not open %1 for writing: %2.</source> - <translation>无法打开 %1 以写入:%2。</translation> + <source>Could not open "%1" for writing: %2.</source> + <translation>无法打开 “%1“ 以写入:%2。</translation> </message> <message> <source>Downloading Android SDK Tools from URL %1 has failed: %2.</source> @@ -4718,7 +4718,7 @@ For example, "Revision: 15" will leave the branch at revision 15.</sou <translation>未提交...</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> <translation>例如:“https://[user[:pass]@]host[:port]/[path]”。</translation> </message> <message> @@ -24591,7 +24591,7 @@ Error: %5</source> <translation type="unfinished">Alt+G,Alt+C</translation> </message> <message> - <source>For example: 'https://[user[:pass]@]host[:port]/[path]'.</source> + <source>For example: "https://[user[:pass]@]host[:port]/[path]".</source> <translation type="unfinished"></translation> </message> <message> diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 6cdf21c6126..3e840715499 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -697,9 +697,11 @@ Tasking::GroupItem AndroidBuildApkStep::runRecipe() FilePath androidLibsDir = androidBuildDir / "libs" / abi; if (!androidLibsDir.exists()) { if (!androidLibsDir.ensureWritableDir()) { - reportWarningOrError(Tr::tr("The Android build folder %1 was not found and could " - "not be created.").arg(androidLibsDir.toUserOutput()), - Task::Error); + reportWarningOrError( + Tr::tr("The Android build folder \"%1\" was not found and could " + "not be created.") + .arg(androidLibsDir.toUserOutput()), + Task::Error); return false; } else if (version->qtVersion() >= QVersionNumber(6, 0, 0) && version->qtVersion() <= QVersionNumber(6, 1, 1)) { @@ -713,8 +715,8 @@ Tasking::GroupItem AndroidBuildApkStep::runRecipe() continue; if (!from.copyFile(to)) { - reportWarningOrError(Tr::tr("Cannot copy the target's lib file %1 to the " - "Android build folder %2.") + reportWarningOrError(Tr::tr("Cannot copy the target's lib file \"%1\" to " + "the Android build folder \"%2\".") .arg(fileName, androidLibsDir.toUserOutput()), Task::Error); return false; diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp index 1cebb663ab0..7aea1208510 100644 --- a/src/plugins/android/androidpackageinstallationstep.cpp +++ b/src/plugins/android/androidpackageinstallationstep.cpp @@ -60,7 +60,7 @@ AndroidPackageInstallationStep::AndroidPackageInstallationStep(BuildStepList *bs setWidgetExpandedByDefault(false); setImmutable(true); setSummaryUpdater([this] { - return Tr::tr("<b>Make install:</b> Copy App Files to %1") + return Tr::tr("<b>Make install:</b> Copy App Files to \"%1\"") .arg(QDir::toNativeSeparators(nativeAndroidBuildPath())); }); setUseEnglishOutput(); diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp index 13348492e73..20d89436a7c 100644 --- a/src/plugins/android/androidsdkdownloader.cpp +++ b/src/plugins/android/androidsdkdownloader.cpp @@ -65,7 +65,7 @@ static std::optional<QString> saveToDisk(const FilePath &filename, QIODevice *da { QFile file(filename.toString()); if (!file.open(QIODevice::WriteOnly)) { - return Tr::tr("Could not open %1 for writing: %2.") + return Tr::tr("Could not open \"%1\" for writing: %2.") .arg(filename.toUserOutput(), file.errorString()); } file.write(data->readAll()); diff --git a/src/plugins/bazaar/pullorpushdialog.cpp b/src/plugins/bazaar/pullorpushdialog.cpp index 1b607622369..1c4f8a36ddf 100644 --- a/src/plugins/bazaar/pullorpushdialog.cpp +++ b/src/plugins/bazaar/pullorpushdialog.cpp @@ -32,11 +32,11 @@ PullOrPushDialog::PullOrPushDialog(Mode mode, QWidget *parent) m_localPathChooser->setEnabled(false); auto urlButton = new QRadioButton(Tr::tr("Specify URL:")); - urlButton->setToolTip(Tr::tr("For example: 'https://[user[:pass]@]host[:port]/[path]'.")); + urlButton->setToolTip(Tr::tr("For example: \"https://[user[:pass]@]host[:port]/[path]\".")); m_urlLineEdit = new QLineEdit; m_urlLineEdit->setEnabled(false); - m_urlLineEdit->setToolTip(Tr::tr("For example: 'https://[user[:pass]@]host[:port]/[path]'.")); + m_urlLineEdit->setToolTip(Tr::tr("For example: \"https://[user[:pass]@]host[:port]/[path]\".")); m_rememberCheckBox = new QCheckBox(Tr::tr("Remember specified location as default")); m_rememberCheckBox->setEnabled(false); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index f1c10344b59..57c7cda2961 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1994,7 +1994,7 @@ void CMakeBuildSystem::runGenerator(Id id) proc->setEnvironment(buildConfiguration()->environment()); proc->setCommand(cmdLine); Core::MessageManager::writeFlashing(addCMakePrefix( - Tr::tr("Running in %1: %2.").arg(outDir.toUserOutput(), cmdLine.toUserOutput()))); + Tr::tr("Running in \"%1\": %2.").arg(outDir.toUserOutput(), cmdLine.toUserOutput()))); proc->start(); } diff --git a/src/plugins/mercurial/srcdestdialog.cpp b/src/plugins/mercurial/srcdestdialog.cpp index 607507b2a6f..1e4f0b76b9b 100644 --- a/src/plugins/mercurial/srcdestdialog.cpp +++ b/src/plugins/mercurial/srcdestdialog.cpp @@ -33,7 +33,7 @@ SrcDestDialog::SrcDestDialog(const VcsBasePluginState &state, Direction dir, QWi m_localButton = new QRadioButton(Tr::tr("Local filesystem:")); auto urlButton = new QRadioButton(Tr::tr("Specify URL:")); - urlButton->setToolTip(Tr::tr("For example: 'https://[user[:pass]@]host[:port]/[path]'.")); + urlButton->setToolTip(Tr::tr("For example: \"https://[user[:pass]@]host[:port]/[path]\".")); m_localPathChooser = new Utils::PathChooser; m_localPathChooser->setEnabled(false); @@ -41,7 +41,8 @@ SrcDestDialog::SrcDestDialog(const VcsBasePluginState &state, Direction dir, QWi m_localPathChooser->setHistoryCompleter("Hg.SourceDir.History"); m_urlLineEdit = new QLineEdit; - m_urlLineEdit->setToolTip(Tr::tr("For example: 'https://[user[:pass]@]host[:port]/[path]'.", nullptr)); + m_urlLineEdit->setToolTip( + Tr::tr("For example: \"https://[user[:pass]@]host[:port]/[path]\".", nullptr)); m_urlLineEdit->setEnabled(false); QUrl repoUrl = getRepoUrl(); From 1359e9c84fbbb7d8e41c5573c63759bf191dc8fa Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 16 Oct 2023 10:08:48 +0200 Subject: [PATCH 1609/1777] Tr: Fix some plurals Change-Id: I9d7a52a64536e6e1c0a9da4f3cb2f3a116afb6cd Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/devicefileaccess.cpp | 2 +- src/plugins/autotest/boost/boosttestoutputreader.cpp | 2 +- src/plugins/cppeditor/cppmodelmanager.cpp | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/devicefileaccess.cpp b/src/libs/utils/devicefileaccess.cpp index 3da5484b709..71f694c6649 100644 --- a/src/libs/utils/devicefileaccess.cpp +++ b/src/libs/utils/devicefileaccess.cpp @@ -721,7 +721,7 @@ expected_str<qint64> DesktopDeviceFileAccess::writeFileContents(const FilePath & qint64 res = file.write(data); if (res != data.size()) return make_unexpected( - Tr::tr("Could not write to file \"%1\" (only %2 of %3 bytes written).") + Tr::tr("Could not write to file \"%1\" (only %2 of %n byte(s) written).") .arg(filePath.toUserOutput()) .arg(res) .arg(data.size())); diff --git a/src/plugins/autotest/boost/boosttestoutputreader.cpp b/src/plugins/autotest/boost/boosttestoutputreader.cpp index 1dab105e243..439fe480814 100644 --- a/src/plugins/autotest/boost/boosttestoutputreader.cpp +++ b/src/plugins/autotest/boost/boosttestoutputreader.cpp @@ -327,7 +327,7 @@ void BoostTestOutputReader::processOutputLine(const QByteArray &outputLine) BoostTestResult result(id(), {}, m_projectFile); const int failed = match.captured(1).toInt(); const int fatals = m_summary.value(ResultType::MessageFatal); - QString txt = Tr::tr("%1 failures detected in %2.").arg(failed).arg(match.captured(3)); + QString txt = Tr::tr("%n failure(s) detected in %2.").arg(failed).arg(match.captured(3)); const int passed = qMax(0, m_testCaseCount - failed); if (m_testCaseCount != -1) txt.append(' ').append(Tr::tr("%1 tests passed.").arg(passed)); diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index 6f986bb7dd1..2deaea4290c 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -567,8 +567,10 @@ static void checkNextFunctionForUnused( if (!search || findRefsFuture->isCanceled()) return; const int newProgress = findRefsFuture->progressValue() + 1; - findRefsFuture->setProgressValueAndText(newProgress, Tr::tr("Checked %1 of %2 functions") - .arg(newProgress).arg(findRefsFuture->progressMaximum())); + findRefsFuture->setProgressValueAndText(newProgress, + Tr::tr("Checked %1 of %n function(s)") + .arg(newProgress) + .arg(findRefsFuture->progressMaximum())); QVariantMap data = search->userData().toMap(); QVariant &activeLinks = data["active"]; QVariantList activeLinksList = activeLinks.toList(); From d62f368ceb06c0d121ce57366da167e84bbd89d2 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 16 Oct 2023 14:39:03 +0200 Subject: [PATCH 1610/1777] Tr: Adapt to source string change Amends 0634f9259bba899e60fd9dac91b49c813be2a337 Change-Id: I4fd8a3e8d7503d14676380a2c0eac958f99814ae Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- share/qtcreator/translations/qtcreator_de.ts | 8 ++++---- share/qtcreator/translations/qtcreator_fr.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index bcd7d0571a5..6ad0490d986 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -39864,8 +39864,8 @@ Sie sollten nicht mehrere Test-Frameworks im selben Projekt mischen.</translatio <translation>Nimble-Anwendung</translation> </message> <message> - <source>Creates a project that you can open in Qt Design Studio.</source> - <translation>Erstellt ein Projekt, das in Qt Design Studio geöffnet werden kann.</translation> + <source>Creates a project that you can open in Qt Design Studio</source> + <translation>Erstellt ein Projekt, das in Qt Design Studio geöffnet werden kann</translation> </message> <message> <source>Creates a project with a structure that is compatible both with Qt Design Studio (via .qmlproject) and with Qt Creator (via CMakeLists.txt). It contains a .ui.qml form that you can visually edit in Qt Design Studio.</source> @@ -39880,8 +39880,8 @@ Sie sollten nicht mehrere Test-Frameworks im selben Projekt mischen.</translatio <translation>Qt 6.5</translation> </message> <message> - <source>The minimum version of Qt you want to build the application for.</source> - <translation>Die niedrigste Qt-Version, die Sie zum Bauen der Anwendung benutzen wollen.</translation> + <source>The minimum version of Qt you want to build the application for</source> + <translation>Die niedrigste Qt-Version, die Sie zum Bauen der Anwendung benutzen wollen</translation> </message> <message> <source>Creates a CMake-based test project for which a code snippet can be entered.</source> diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index fd910819165..de55e61972a 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -38491,8 +38491,8 @@ Pour développer une application complête, créer un projet Qt Quick Applicatio <translation>Génère le code d’initialisation et de nettoyage</translation> </message> <message> - <source>Creates a project that you can open in Qt Design Studio.</source> - <translation>Génère un projet qui peut être ouvert dans Qt Design Studio.</translation> + <source>Creates a project that you can open in Qt Design Studio</source> + <translation>Génère un projet qui peut être ouvert dans Qt Design Studio</translation> </message> <message> <source>Creates a project with a structure that is compatible both with Qt Design Studio (via .qmlproject) and with Qt Creator (via CMakeLists.txt). It contains a .ui.qml form that you can visually edit in Qt Design Studio.</source> @@ -38507,8 +38507,8 @@ Pour développer une application complête, créer un projet Qt Quick Applicatio <translation>Qt 6.5</translation> </message> <message> - <source>The minimum version of Qt you want to build the application for.</source> - <translation>La verison minimale de Qt pour laquelle vous voulez construire votre application.</translation> + <source>The minimum version of Qt you want to build the application for</source> + <translation>La verison minimale de Qt pour laquelle vous voulez construire votre application</translation> </message> <message> <source>Creates a Qt Quick application that can have both QML and C++ code. You can build the application and deploy it to desktop, embedded, and mobile target platforms. From 12a6d9e5dc9703e0904e5a69f99be1c413d6da13 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 16 Oct 2023 21:04:55 +0200 Subject: [PATCH 1611/1777] CMakePM: Update CMake conan to latest version Url: https://github.com/conan-io/cmake-conan/blob/develop2/ conan_provider.cmake sha: 451fa97d2c59c07b13fb4812a64b2a6391f9e781 Change-Id: Ia52f5d856cf045d7a1d1871d6d43fd1d014439c4 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../3rdparty/package-manager/auto-setup.cmake | 6 +- .../package-manager/conan_provider.cmake | 544 ++++++++++++++++++ .../package-manager/conan_support.cmake | 211 ------- 3 files changed, 549 insertions(+), 212 deletions(-) create mode 100644 src/share/3rdparty/package-manager/conan_provider.cmake delete mode 100644 src/share/3rdparty/package-manager/conan_support.cmake diff --git a/src/share/3rdparty/package-manager/auto-setup.cmake b/src/share/3rdparty/package-manager/auto-setup.cmake index 60c21440449..eafdb91aa68 100644 --- a/src/share/3rdparty/package-manager/auto-setup.cmake +++ b/src/share/3rdparty/package-manager/auto-setup.cmake @@ -102,16 +102,20 @@ macro(qtc_auto_setup_conan) project(conan-setup) if (${conan_version} VERSION_GREATER_EQUAL 2.0) - include(\"${CMAKE_CURRENT_LIST_DIR}/conan_support.cmake\") + include(\"${CMAKE_CURRENT_LIST_DIR}/conan_provider.cmake\") conan_profile_detect_default() detect_host_profile(\"${CMAKE_BINARY_DIR}/conan-dependencies/conan_host_profile\") + set(CONAN_COMMAND \"${conan_program}\") conan_install( -pr \"${CMAKE_BINARY_DIR}/conan-dependencies/conan_host_profile\" --build=${QT_CREATOR_CONAN_BUILD_POLICY} -s build_type=${CMAKE_BUILD_TYPE} -g CMakeDeps) + + get_property(CONAN_INSTALL_SUCCESS GLOBAL PROPERTY CONAN_INSTALL_SUCCESS) if (CONAN_INSTALL_SUCCESS) + get_property(CONAN_GENERATORS_FOLDER GLOBAL PROPERTY CONAN_GENERATORS_FOLDER) file(WRITE \"${CMAKE_BINARY_DIR}/conan-dependencies/conan_paths.cmake\" \" list(PREPEND CMAKE_PREFIX_PATH \\\"\${CONAN_GENERATORS_FOLDER}\\\") list(PREPEND CMAKE_MODULE_PATH \\\"\${CONAN_GENERATORS_FOLDER}\\\") diff --git a/src/share/3rdparty/package-manager/conan_provider.cmake b/src/share/3rdparty/package-manager/conan_provider.cmake new file mode 100644 index 00000000000..d94a9d811f8 --- /dev/null +++ b/src/share/3rdparty/package-manager/conan_provider.cmake @@ -0,0 +1,544 @@ +# https://github.com/conan-io/cmake-conan/blob/develop2/conan_provider.cmake +# commit: 451fa97d2c59c07b13fb4812a64b2a6391f9e781 +# +# The MIT License (MIT) +# +# Copyright (c) 2019 JFrog +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +set(CONAN_MINIMUM_VERSION 2.0.5) + + +function(detect_os OS OS_API_LEVEL OS_SDK OS_SUBSYSTEM OS_VERSION) + # it could be cross compilation + message(STATUS "CMake-Conan: cmake_system_name=${CMAKE_SYSTEM_NAME}") + if(CMAKE_SYSTEM_NAME AND NOT CMAKE_SYSTEM_NAME STREQUAL "Generic") + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(${OS} Macos PARENT_SCOPE) + elseif(${CMAKE_SYSTEM_NAME} STREQUAL "QNX") + set(${OS} Neutrino PARENT_SCOPE) + elseif(${CMAKE_SYSTEM_NAME} STREQUAL "CYGWIN") + set(${OS} Windows PARENT_SCOPE) + set(${OS_SUBSYSTEM} cygwin PARENT_SCOPE) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "^MSYS") + set(${OS} Windows PARENT_SCOPE) + set(${OS_SUBSYSTEM} msys2 PARENT_SCOPE) + else() + set(${OS} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE) + endif() + if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") + string(REGEX MATCH "[0-9]+" _OS_API_LEVEL ${ANDROID_PLATFORM}) + message(STATUS "CMake-Conan: android_platform=${ANDROID_PLATFORM}") + set(${OS_API_LEVEL} ${_OS_API_LEVEL} PARENT_SCOPE) + endif() + if(CMAKE_SYSTEM_NAME MATCHES "Darwin|iOS|tvOS|watchOS") + # CMAKE_OSX_SYSROOT contains the full path to the SDK for MakeFile/Ninja + # generators, but just has the original input string for Xcode. + if(NOT IS_DIRECTORY ${CMAKE_OSX_SYSROOT}) + set(_OS_SDK ${CMAKE_OSX_SYSROOT}) + else() + if(CMAKE_OSX_SYSROOT MATCHES Simulator) + set(apple_platform_suffix simulator) + else() + set(apple_platform_suffix os) + endif() + if(CMAKE_OSX_SYSROOT MATCHES AppleTV) + set(_OS_SDK "appletv${apple_platform_suffix}") + elseif(CMAKE_OSX_SYSROOT MATCHES iPhone) + set(_OS_SDK "iphone${apple_platform_suffix}") + elseif(CMAKE_OSX_SYSROOT MATCHES Watch) + set(_OS_SDK "watch${apple_platform_suffix}") + endif() + endif() + if(DEFINED _OS_SDK) + message(STATUS "CMake-Conan: cmake_osx_sysroot=${CMAKE_OSX_SYSROOT}") + set(${OS_SDK} ${_OS_SDK} PARENT_SCOPE) + endif() + if(DEFINED CMAKE_OSX_DEPLOYMENT_TARGET) + message(STATUS "CMake-Conan: cmake_osx_deployment_target=${CMAKE_OSX_DEPLOYMENT_TARGET}") + set(${OS_VERSION} ${CMAKE_OSX_DEPLOYMENT_TARGET} PARENT_SCOPE) + endif() + endif() + endif() +endfunction() + + +function(detect_arch ARCH) + # CMAKE_OSX_ARCHITECTURES can contain multiple architectures, but Conan only supports one. + # Therefore this code only finds one. If the recipes support multiple architectures, the + # build will work. Otherwise, there will be a linker error for the missing architecture(s). + if(DEFINED CMAKE_OSX_ARCHITECTURES) + string(REPLACE " " ";" apple_arch_list "${CMAKE_OSX_ARCHITECTURES}") + list(LENGTH apple_arch_list apple_arch_count) + if(apple_arch_count GREATER 1) + message(WARNING "CMake-Conan: Multiple architectures detected, this will only work if Conan recipe(s) produce fat binaries.") + endif() + endif() + if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64" OR CMAKE_OSX_ARCHITECTURES MATCHES arm64) + set(_ARCH armv8) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7-a|armv7l" OR CMAKE_OSX_ARCHITECTURES MATCHES armv7) + set(_ARCH armv7) + elseif(CMAKE_OSX_ARCHITECTURES MATCHES armv7s) + set(_ARCH armv7s) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686" OR CMAKE_OSX_ARCHITECTURES MATCHES i386) + set(_ARCH x86) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64|amd64|x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64) + set(_ARCH x86_64) + endif() + message(STATUS "CMake-Conan: cmake_system_processor=${_ARCH}") + set(${ARCH} ${_ARCH} PARENT_SCOPE) +endfunction() + + +function(detect_cxx_standard CXX_STANDARD) + set(${CXX_STANDARD} ${CMAKE_CXX_STANDARD} PARENT_SCOPE) + if(CMAKE_CXX_EXTENSIONS) + set(${CXX_STANDARD} "gnu${CMAKE_CXX_STANDARD}" PARENT_SCOPE) + endif() +endfunction() + +macro(detect_gnu_libstdcxx) + # _CONAN_IS_GNU_LIBSTDCXX true if GNU libstdc++ + check_cxx_source_compiles(" + #include <cstddef> + #if !defined(__GLIBCXX__) && !defined(__GLIBCPP__) + static_assert(false); + #endif + int main(){}" _CONAN_IS_GNU_LIBSTDCXX) + + # _CONAN_GNU_LIBSTDCXX_IS_CXX11_ABI true if C++11 ABI + check_cxx_source_compiles(" + #include <string> + static_assert(sizeof(std::string) != sizeof(void*), \"using libstdc++\"); + int main () {}" _CONAN_GNU_LIBSTDCXX_IS_CXX11_ABI) + + set(_CONAN_GNU_LIBSTDCXX_SUFFIX "") + if(_CONAN_GNU_LIBSTDCXX_IS_CXX11_ABI) + set(_CONAN_GNU_LIBSTDCXX_SUFFIX "11") + endif() + unset (_CONAN_GNU_LIBSTDCXX_IS_CXX11_ABI) +endmacro() + +macro(detect_libcxx) + # _CONAN_IS_LIBCXX true if LLVM libc++ + check_cxx_source_compiles(" + #include <cstddef> + #if !defined(_LIBCPP_VERSION) + static_assert(false); + #endif + int main(){}" _CONAN_IS_LIBCXX) +endmacro() + + +function(detect_lib_cxx OS LIB_CXX) + if(${OS} STREQUAL "Android") + message(STATUS "CMake-Conan: android_stl=${ANDROID_STL}") + set(${LIB_CXX} ${ANDROID_STL} PARENT_SCOPE) + return() + endif() + + include(CheckCXXSourceCompiles) + + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + detect_gnu_libstdcxx() + set(${LIB_CXX} "libstdc++${_CONAN_GNU_LIBSTDCXX_SUFFIX}" PARENT_SCOPE) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") + set(${LIB_CXX} "libc++" PARENT_SCOPE) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_SYSTEM_NAME MATCHES "Windows") + # Check for libc++ + detect_libcxx() + if(_CONAN_IS_LIBCXX) + set(${LIB_CXX} "libc++" PARENT_SCOPE) + return() + endif() + + # Check for libstdc++ + detect_gnu_libstdcxx() + if(_CONAN_IS_GNU_LIBSTDCXX) + set(${LIB_CXX} "libstdc++${_CONAN_GNU_LIBSTDCXX_SUFFIX}" PARENT_SCOPE) + return() + endif() + + # TODO: it would be an error if we reach this point + elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + # Do nothing - compiler.runtime and compiler.runtime_type + # should be handled separately: https://github.com/conan-io/cmake-conan/pull/516 + return() + else() + # TODO: unable to determine, ask user to provide a full profile file instead + endif() +endfunction() + + +function(detect_compiler COMPILER COMPILER_VERSION COMPILER_RUNTIME COMPILER_RUNTIME_TYPE) + if(DEFINED CMAKE_CXX_COMPILER_ID) + set(_COMPILER ${CMAKE_CXX_COMPILER_ID}) + set(_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}) + else() + if(NOT DEFINED CMAKE_C_COMPILER_ID) + message(FATAL_ERROR "C or C++ compiler not defined") + endif() + set(_COMPILER ${CMAKE_C_COMPILER_ID}) + set(_COMPILER_VERSION ${CMAKE_C_COMPILER_VERSION}) + endif() + + message(STATUS "CMake-Conan: CMake compiler=${_COMPILER}") + message(STATUS "CMake-Conan: CMake compiler version=${_COMPILER_VERSION}") + + if(_COMPILER MATCHES MSVC) + set(_COMPILER "msvc") + string(SUBSTRING ${MSVC_VERSION} 0 3 _COMPILER_VERSION) + # Configure compiler.runtime and compiler.runtime_type settings for MSVC + if(CMAKE_MSVC_RUNTIME_LIBRARY) + set(_KNOWN_MSVC_RUNTIME_VALUES "") + list(APPEND _KNOWN_MSVC_RUNTIME_VALUES MultiThreaded MultiThreadedDLL) + list(APPEND _KNOWN_MSVC_RUNTIME_VALUES MultiThreadedDebug MultiThreadedDebugDLL) + list(APPEND _KNOWN_MSVC_RUNTIME_VALUES MultiThreaded$<$<CONFIG:Debug>:Debug> MultiThreaded$<$<CONFIG:Debug>:Debug>DLL) + + # only accept the 6 possible values, otherwise we don't don't know to map this + if(NOT CMAKE_MSVC_RUNTIME_LIBRARY IN_LIST _KNOWN_MSVC_RUNTIME_VALUES) + message(FATAL_ERROR "CMake-Conan: unable to map MSVC runtime: ${CMAKE_MSVC_RUNTIME_LIBRARY} to Conan settings") + endif() + + # Runtime is "dynamic" in all cases if it ends in DLL + if(CMAKE_MSVC_RUNTIME_LIBRARY MATCHES ".*DLL$") + set(_COMPILER_RUNTIME "dynamic") + else() + set(_COMPILER_RUNTIME "static") + endif() + + # Only define compiler.runtime_type when explicitly requested + # If a generator expression is used, let Conan handle it conditional on build_type + get_property(_IS_MULTI_CONFIG_GENERATOR GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(NOT CMAKE_MSVC_RUNTIME_LIBRARY MATCHES "<CONFIG:Debug>:Debug>") + if(CMAKE_MSVC_RUNTIME_LIBRARY MATCHES "Debug") + set(_COMPILER_RUNTIME_TYPE "Debug") + else() + set(_COMPILER_RUNTIME_TYPE "Release") + endif() + endif() + + unset(_KNOWN_MSVC_RUNTIME_VALUES) + unset(_IS_MULTI_CONFIG_GENERATOR) + endif() + elseif(_COMPILER MATCHES AppleClang) + set(_COMPILER "apple-clang") + string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) + list(GET VERSION_LIST 0 _COMPILER_VERSION) + elseif(_COMPILER MATCHES Clang) + set(_COMPILER "clang") + string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) + list(GET VERSION_LIST 0 _COMPILER_VERSION) + elseif(_COMPILER MATCHES GNU) + set(_COMPILER "gcc") + string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) + list(GET VERSION_LIST 0 _COMPILER_VERSION) + endif() + + message(STATUS "CMake-Conan: [settings] compiler=${_COMPILER}") + message(STATUS "CMake-Conan: [settings] compiler.version=${_COMPILER_VERSION}") + if (_COMPILER_RUNTIME) + message(STATUS "CMake-Conan: [settings] compiler.runtime=${_COMPILER_RUNTIME}") + endif() + if (_COMPILER_RUNTIME_TYPE) + message(STATUS "CMake-Conan: [settings] compiler.runtime_type=${_COMPILER_RUNTIME_TYPE}") + endif() + + set(${COMPILER} ${_COMPILER} PARENT_SCOPE) + set(${COMPILER_VERSION} ${_COMPILER_VERSION} PARENT_SCOPE) + set(${COMPILER_RUNTIME} ${_COMPILER_RUNTIME} PARENT_SCOPE) + set(${COMPILER_RUNTIME_TYPE} ${_COMPILER_RUNTIME_TYPE} PARENT_SCOPE) +endfunction() + +function(detect_build_type BUILD_TYPE) + get_property(_MULTICONFIG_GENERATOR GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(NOT _MULTICONFIG_GENERATOR) + # Only set when we know we are in a single-configuration generator + # Note: we may want to fail early if `CMAKE_BUILD_TYPE` is not defined + set(${BUILD_TYPE} ${CMAKE_BUILD_TYPE} PARENT_SCOPE) + endif() +endfunction() + +macro(append_compiler_executables_configuration) + set(_conan_c_compiler "") + set(_conan_cpp_compiler "") + if(CMAKE_C_COMPILER) + set(_conan_c_compiler "\"c\":\"${CMAKE_C_COMPILER}\",") + else() + message(WARNING "CMake-Conan: The C compiler is not defined. " + "Please define CMAKE_C_COMPILER or enable the C language.") + endif() + if(CMAKE_CXX_COMPILER) + set(_conan_cpp_compiler "\"cpp\":\"${CMAKE_CXX_COMPILER}\"") + else() + message(WARNING "CMake-Conan: The C++ compiler is not defined. " + "Please define CMAKE_CXX_COMPILER or enable the C++ language.") + endif() + + string(APPEND PROFILE "tools.build:compiler_executables={${_conan_c_compiler}${_conan_cpp_compiler}}\n") + unset(_conan_c_compiler) + unset(_conan_cpp_compiler) +endmacro() + + +function(detect_host_profile output_file) + detect_os(MYOS MYOS_API_LEVEL MYOS_SDK MYOS_SUBSYSTEM MYOS_VERSION) + detect_arch(MYARCH) + detect_compiler(MYCOMPILER MYCOMPILER_VERSION MYCOMPILER_RUNTIME MYCOMPILER_RUNTIME_TYPE) + detect_cxx_standard(MYCXX_STANDARD) + detect_lib_cxx(MYOS MYLIB_CXX) + detect_build_type(MYBUILD_TYPE) + + set(PROFILE "") + string(APPEND PROFILE "[settings]\n") + if(MYARCH) + string(APPEND PROFILE arch=${MYARCH} "\n") + endif() + if(MYOS) + string(APPEND PROFILE os=${MYOS} "\n") + endif() + if(MYOS_API_LEVEL) + string(APPEND PROFILE os.api_level=${MYOS_API_LEVEL} "\n") + endif() + if(MYOS_VERSION) + string(APPEND PROFILE os.version=${MYOS_VERSION} "\n") + endif() + if(MYOS_SDK) + string(APPEND PROFILE os.sdk=${MYOS_SDK} "\n") + endif() + if(MYOS_SUBSYSTEM) + string(APPEND PROFILE os.subsystem=${MYOS_SUBSYSTEM} "\n") + endif() + if(MYCOMPILER) + string(APPEND PROFILE compiler=${MYCOMPILER} "\n") + endif() + if(MYCOMPILER_VERSION) + string(APPEND PROFILE compiler.version=${MYCOMPILER_VERSION} "\n") + endif() + if(MYCOMPILER_RUNTIME) + string(APPEND PROFILE compiler.runtime=${MYCOMPILER_RUNTIME} "\n") + endif() + if(MYCOMPILER_RUNTIME_TYPE) + string(APPEND PROFILE compiler.runtime_type=${MYCOMPILER_RUNTIME_TYPE} "\n") + endif() + if(MYCXX_STANDARD) + string(APPEND PROFILE compiler.cppstd=${MYCXX_STANDARD} "\n") + endif() + if(MYLIB_CXX) + string(APPEND PROFILE compiler.libcxx=${MYLIB_CXX} "\n") + endif() + if(MYBUILD_TYPE) + string(APPEND PROFILE "build_type=${MYBUILD_TYPE}\n") + endif() + + if(NOT DEFINED output_file) + set(_FN "${CMAKE_BINARY_DIR}/profile") + else() + set(_FN ${output_file}) + endif() + + string(APPEND PROFILE "[conf]\n") + string(APPEND PROFILE "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}\n") + + # propagate compilers via profile + append_compiler_executables_configuration() + + if(${MYOS} STREQUAL "Android") + string(APPEND PROFILE "tools.android:ndk_path=${CMAKE_ANDROID_NDK}\n") + endif() + + message(STATUS "CMake-Conan: Creating profile ${_FN}") + file(WRITE ${_FN} ${PROFILE}) + message(STATUS "CMake-Conan: Profile: \n${PROFILE}") +endfunction() + + +function(conan_profile_detect_default) + message(STATUS "CMake-Conan: Checking if a default profile exists") + execute_process(COMMAND ${CONAN_COMMAND} profile path default + RESULT_VARIABLE return_code + OUTPUT_VARIABLE conan_stdout + ERROR_VARIABLE conan_stderr + ECHO_ERROR_VARIABLE # show the text output regardless + ECHO_OUTPUT_VARIABLE + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + if(NOT ${return_code} EQUAL "0") + message(STATUS "CMake-Conan: The default profile doesn't exist, detecting it.") + execute_process(COMMAND ${CONAN_COMMAND} profile detect + RESULT_VARIABLE return_code + OUTPUT_VARIABLE conan_stdout + ERROR_VARIABLE conan_stderr + ECHO_ERROR_VARIABLE # show the text output regardless + ECHO_OUTPUT_VARIABLE + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + endif() +endfunction() + + +function(conan_install) + cmake_parse_arguments(ARGS CONAN_ARGS ${ARGN}) + set(CONAN_OUTPUT_FOLDER ${CMAKE_BINARY_DIR}/conan) + # Invoke "conan install" with the provided arguments + set(CONAN_ARGS ${CONAN_ARGS} -of=${CONAN_OUTPUT_FOLDER}) + message(STATUS "CMake-Conan: conan install ${CMAKE_SOURCE_DIR} ${CONAN_ARGS} ${ARGN}") + execute_process(COMMAND ${CONAN_COMMAND} install ${CMAKE_SOURCE_DIR} ${CONAN_ARGS} ${ARGN} --format=json + RESULT_VARIABLE return_code + OUTPUT_VARIABLE conan_stdout + ERROR_VARIABLE conan_stderr + ECHO_ERROR_VARIABLE # show the text output regardless + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + if(NOT "${return_code}" STREQUAL "0") + message(FATAL_ERROR "Conan install failed='${return_code}'") + else() + # the files are generated in a folder that depends on the layout used, if + # one is specified, but we don't know a priori where this is. + # TODO: this can be made more robust if Conan can provide this in the json output + string(JSON CONAN_GENERATORS_FOLDER GET ${conan_stdout} graph nodes 0 generators_folder) + # message("conan stdout: ${conan_stdout}") + message(STATUS "CMake-Conan: CONAN_GENERATORS_FOLDER=${CONAN_GENERATORS_FOLDER}") + set_property(GLOBAL PROPERTY CONAN_GENERATORS_FOLDER "${CONAN_GENERATORS_FOLDER}") + # reconfigure on conanfile changes + string(JSON CONANFILE GET ${conan_stdout} graph nodes 0 label) + message(STATUS "CMake-Conan: CONANFILE=${CMAKE_SOURCE_DIR}/${CONANFILE}") + set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/${CONANFILE}") + # success + set_property(GLOBAL PROPERTY CONAN_INSTALL_SUCCESS TRUE) + endif() +endfunction() + + +function(conan_get_version conan_command conan_current_version) + execute_process( + COMMAND ${conan_command} --version + OUTPUT_VARIABLE conan_output + RESULT_VARIABLE conan_result + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(conan_result) + message(FATAL_ERROR "CMake-Conan: Error when trying to run Conan") + endif() + + string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" conan_version ${conan_output}) + set(${conan_current_version} ${conan_version} PARENT_SCOPE) +endfunction() + + +function(conan_version_check) + set(options ) + set(oneValueArgs MINIMUM CURRENT) + set(multiValueArgs ) + cmake_parse_arguments(CONAN_VERSION_CHECK + "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(NOT CONAN_VERSION_CHECK_MINIMUM) + message(FATAL_ERROR "CMake-Conan: Required parameter MINIMUM not set!") + endif() + if(NOT CONAN_VERSION_CHECK_CURRENT) + message(FATAL_ERROR "CMake-Conan: Required parameter CURRENT not set!") + endif() + + if(CONAN_VERSION_CHECK_CURRENT VERSION_LESS CONAN_VERSION_CHECK_MINIMUM) + message(FATAL_ERROR "CMake-Conan: Conan version must be ${CONAN_VERSION_CHECK_MINIMUM} or later") + endif() +endfunction() + +macro(construct_profile_argument argument_variable profile_list) + set(${argument_variable} "") + if("${profile_list}" STREQUAL "CONAN_HOST_PROFILE") + set(_arg_flag "--profile:host=") + elseif("${profile_list}" STREQUAL "CONAN_BUILD_PROFILE") + set(_arg_flag "--profile:build=") + endif() + + set(_profile_list "${${profile_list}}") + list(TRANSFORM _profile_list REPLACE "auto-cmake" "${CMAKE_BINARY_DIR}/conan_host_profile") + list(TRANSFORM _profile_list PREPEND ${_arg_flag}) + set(${argument_variable} ${_profile_list}) + + unset(_arg_flag) + unset(_profile_list) +endmacro() + + +macro(conan_provide_dependency method package_name) + set_property(GLOBAL PROPERTY CONAN_PROVIDE_DEPENDENCY_INVOKED TRUE) + get_property(CONAN_INSTALL_SUCCESS GLOBAL PROPERTY CONAN_INSTALL_SUCCESS) + if(NOT CONAN_INSTALL_SUCCESS) + find_program(CONAN_COMMAND "conan" REQUIRED) + conan_get_version(${CONAN_COMMAND} CONAN_CURRENT_VERSION) + conan_version_check(MINIMUM ${CONAN_MINIMUM_VERSION} CURRENT ${CONAN_CURRENT_VERSION}) + message(STATUS "CMake-Conan: first find_package() found. Installing dependencies with Conan") + if("default" IN_LIST CONAN_HOST_PROFILE OR "default" IN_LIST CONAN_BUILD_PROFILE) + conan_profile_detect_default() + endif() + if("auto-cmake" IN_LIST CONAN_HOST_PROFILE) + detect_host_profile(${CMAKE_BINARY_DIR}/conan_host_profile) + endif() + construct_profile_argument(_host_profile_flags CONAN_HOST_PROFILE) + construct_profile_argument(_build_profile_flags CONAN_BUILD_PROFILE) + get_property(_MULTICONFIG_GENERATOR GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(NOT _MULTICONFIG_GENERATOR) + message(STATUS "CMake-Conan: Installing single configuration ${CMAKE_BUILD_TYPE}") + conan_install(${_host_profile_flags} ${_build_profile_flags} --build=missing -g CMakeDeps) + else() + message(STATUS "CMake-Conan: Installing both Debug and Release") + conan_install(${_host_profile_flags} ${_build_profile_flags} -s build_type=Release --build=missing -g CMakeDeps) + conan_install(${_host_profile_flags} ${_build_profile_flags} -s build_type=Debug --build=missing -g CMakeDeps) + endif() + unset(_MULTICONFIG_GENERATOR) + else() + message(STATUS "CMake-Conan: find_package(${ARGV1}) found, 'conan install' already ran") + endif() + + get_property(CONAN_GENERATORS_FOLDER GLOBAL PROPERTY CONAN_GENERATORS_FOLDER) + + # Ensure that we consider Conan-provided packages ahead of any other, + # irrespective of other settings that modify the search order or search paths + # This follows the guidelines from the find_package documentation + # (https://cmake.org/cmake/help/latest/command/find_package.html): + # find_package (<PackageName> PATHS paths... NO_DEFAULT_PATH) + # find_package (<PackageName>) + + # Filter out `REQUIRED` from the argument list, as the first call may fail + set(_find_args "${ARGN}") + list(REMOVE_ITEM _find_args "REQUIRED") + if(NOT "MODULE" IN_LIST _find_args) + find_package(${package_name} ${_find_args} BYPASS_PROVIDER PATHS "${CONAN_GENERATORS_FOLDER}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + endif() + + # Invoke find_package a second time - if the first call succeeded, + # this will simply reuse the result. If not, fall back to CMake default search + # behaviour, also allowing modules to be searched. + set(_cmake_module_path_orig "${CMAKE_MODULE_PATH}") + list(PREPEND CMAKE_MODULE_PATH "${CONAN_GENERATORS_FOLDER}") + if(NOT ${package_name}_FOUND) + find_package(${package_name} ${ARGN} BYPASS_PROVIDER) + endif() + + set(CMAKE_MODULE_PATH "${_cmake_module_path_orig}") + unset(_find_args) + unset(_cmake_module_path_orig) + unset(_host_profile_flags) + unset(_build_profile_flags) +endmacro() + +# Configurable variables for Conan profiles +set(CONAN_HOST_PROFILE "default;auto-cmake" CACHE STRING "Conan host profile") +set(CONAN_BUILD_PROFILE "default" CACHE STRING "Conan build profile") diff --git a/src/share/3rdparty/package-manager/conan_support.cmake b/src/share/3rdparty/package-manager/conan_support.cmake deleted file mode 100644 index f1dbccf2aaf..00000000000 --- a/src/share/3rdparty/package-manager/conan_support.cmake +++ /dev/null @@ -1,211 +0,0 @@ -# https://github.com/conan-io/cmake-conan/blob/develop2/conan_support.cmake -# commit: 3e088cd3e1d9d69e04b5250d565c1b8b55b0400b -# -# The MIT License (MIT) -# -# Copyright (c) 2019 JFrog -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -function(detect_os OS) - # it could be cross compilation - message(STATUS "Conan-cmake: cmake_system_name=${CMAKE_SYSTEM_NAME}") - if(CMAKE_SYSTEM_NAME AND NOT CMAKE_SYSTEM_NAME STREQUAL "Generic") - if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - set(${OS} Macos PARENT_SCOPE) - elseif(${CMAKE_SYSTEM_NAME} STREQUAL "QNX") - set(${OS} Neutrino PARENT_SCOPE) - else() - set(${OS} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE) - endif() - endif() -endfunction() - - -function(detect_cxx_standard CXX_STANDARD) - set(${CXX_STANDARD} ${CMAKE_CXX_STANDARD} PARENT_SCOPE) - if (CMAKE_CXX_EXTENSIONS) - set(${CXX_STANDARD} "gnu${CMAKE_CXX_STANDARD}" PARENT_SCOPE) - endif() -endfunction() - - -function(detect_compiler COMPILER COMPILER_VERSION) - if(DEFINED CMAKE_CXX_COMPILER_ID) - set(_COMPILER ${CMAKE_CXX_COMPILER_ID}) - set(_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}) - else() - if(NOT DEFINED CMAKE_C_COMPILER_ID) - message(FATAL_ERROR "C or C++ compiler not defined") - endif() - set(_COMPILER ${CMAKE_C_COMPILER_ID}) - set(_COMPILER_VERSION ${CMAKE_C_COMPILER_VERSION}) - endif() - - message(STATUS "Conan-cmake: CMake compiler=${_COMPILER}") - message(STATUS "Conan-cmake: CMake cmpiler version=${_COMPILER_VERSION}") - - if(_COMPILER MATCHES MSVC) - set(_COMPILER "msvc") - string(SUBSTRING ${MSVC_VERSION} 0 3 _COMPILER_VERSION) - elseif(_COMPILER MATCHES AppleClang) - set(_COMPILER "apple-clang") - string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) - list(GET VERSION_LIST 0 _COMPILER_VERSION) - elseif(_COMPILER MATCHES Clang) - set(_COMPILER "clang") - string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) - list(GET VERSION_LIST 0 _COMPILER_VERSION) - elseif(_COMPILER MATCHES GNU) - set(_COMPILER "gcc") - string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) - list(GET VERSION_LIST 0 _COMPILER_VERSION) - endif() - - message(STATUS "Conan-cmake: [settings] compiler=${_COMPILER}") - message(STATUS "Conan-cmake: [settings] compiler.version=${_COMPILER_VERSION}") - - set(${COMPILER} ${_COMPILER} PARENT_SCOPE) - set(${COMPILER_VERSION} ${_COMPILER_VERSION} PARENT_SCOPE) -endfunction() - -function(detect_build_type BUILD_TYPE) - if(NOT CMAKE_CONFIGURATION_TYPES) - # Only set when we know we are in a single-configuration generator - # Note: we may want to fail early if `CMAKE_BUILD_TYPE` is not defined - set(${BUILD_TYPE} ${CMAKE_BUILD_TYPE} PARENT_SCOPE) - endif() -endfunction() - - -function(detect_host_profile output_file) - detect_os(MYOS) - detect_compiler(MYCOMPILER MYCOMPILER_VERSION) - detect_cxx_standard(MYCXX_STANDARD) - detect_build_type(MYBUILD_TYPE) - - set(PROFILE "") - string(APPEND PROFILE "include(default)\n") - string(APPEND PROFILE "[settings]\n") - if(MYOS) - string(APPEND PROFILE os=${MYOS} "\n") - endif() - if(MYCOMPILER) - string(APPEND PROFILE compiler=${MYCOMPILER} "\n") - endif() - if(MYCOMPILER_VERSION) - string(APPEND PROFILE compiler.version=${MYCOMPILER_VERSION} "\n") - endif() - if(MYCXX_STANDARD) - string(APPEND PROFILE compiler.cppstd=${MYCXX_STANDARD} "\n") - endif() - if(MYBUILD_TYPE) - string(APPEND PROFILE "build_type=${MYBUILD_TYPE}\n") - endif() - - if(NOT DEFINED output_file) - set(_FN "${CMAKE_BINARY_DIR}/profile") - else() - set(_FN ${output_file}) - endif() - - string(APPEND PROFILE "[conf]\n") - string(APPEND PROFILE "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}\n") - - message(STATUS "Conan-cmake: Creating profile ${_FN}") - file(WRITE ${_FN} ${PROFILE}) - message(STATUS "Conan-cmake: Profile: \n${PROFILE}") -endfunction() - - -function(conan_profile_detect_default) - message(STATUS "Conan-cmake: Checking if a default profile exists") - execute_process(COMMAND conan profile path default - RESULT_VARIABLE return_code - OUTPUT_VARIABLE conan_stdout - ERROR_VARIABLE conan_stderr - ECHO_ERROR_VARIABLE # show the text output regardless - ECHO_OUTPUT_VARIABLE - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - if(NOT ${return_code} EQUAL "0") - message(STATUS "Conan-cmake: The default profile doesn't exist, detecting it.") - execute_process(COMMAND conan profile detect - RESULT_VARIABLE return_code - OUTPUT_VARIABLE conan_stdout - ERROR_VARIABLE conan_stderr - ECHO_ERROR_VARIABLE # show the text output regardless - ECHO_OUTPUT_VARIABLE - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - endif() -endfunction() - - -function(conan_install) - cmake_parse_arguments(ARGS CONAN_ARGS ${ARGN}) - set(CONAN_OUTPUT_FOLDER ${CMAKE_BINARY_DIR}/conan) - # Invoke "conan install" with the provided arguments - set(CONAN_ARGS ${CONAN_ARGS} -of=${CONAN_OUTPUT_FOLDER}) - message(STATUS "CMake-conan: conan install ${CMAKE_SOURCE_DIR} ${CONAN_ARGS} ${ARGN}") - execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} ${CONAN_ARGS} ${ARGN} --format=json - RESULT_VARIABLE return_code - OUTPUT_VARIABLE conan_stdout - ERROR_VARIABLE conan_stderr - ECHO_ERROR_VARIABLE # show the text output regardless - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - if(NOT "${return_code}" STREQUAL "0") - message(FATAL_ERROR "Conan install failed='${return_code}'") - else() - # the files are generated in a folder that depends on the layout used, if - # one if specified, but we don't know a priori where this is. - # TODO: this can be made more robust if Conan can provide this in the json output - string(JSON CONAN_GENERATORS_FOLDER GET ${conan_stdout} graph nodes 0 generators_folder) - # message("conan stdout: ${conan_stdout}") - message(STATUS "CMake-conan: CONAN_GENERATORS_FOLDER=${CONAN_GENERATORS_FOLDER}") - set(CONAN_GENERATORS_FOLDER "${CONAN_GENERATORS_FOLDER}" PARENT_SCOPE) - set(CONAN_INSTALL_SUCCESS TRUE CACHE BOOL "Conan install has been invoked and was successful") - endif() -endfunction() - - -function(conan_provide_dependency package_name) - if(NOT CONAN_INSTALL_SUCCESS) - message(STATUS "CMake-conan: first find_package() found. Installing dependencies with Conan") - conan_profile_detect_default() - detect_host_profile(${CMAKE_BINARY_DIR}/conan_host_profile) - if(NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "CMake-conan: Installing single configuration ${CMAKE_BUILD_TYPE}") - conan_install(-pr ${CMAKE_BINARY_DIR}/conan_host_profile --build=missing -g CMakeDeps) - else() - message(STATUS "CMake-conan: Installing both Debug and Release") - conan_install(-pr ${CMAKE_BINARY_DIR}/conan_host_profile -s build_type=Release --build=missing -g CMakeDeps) - conan_install(-pr ${CMAKE_BINARY_DIR}/conan_host_profile -s build_type=Debug --build=missing -g CMakeDeps) - endif() - if (CONAN_INSTALL_SUCCESS) - set(CONAN_GENERATORS_FOLDER "${CONAN_GENERATORS_FOLDER}" CACHE PATH "Conan generators folder") - endif() - else() - message(STATUS "CMake-conan: find_package(${package_name}) found, 'conan install' aready ran") - endif() - - if (CONAN_GENERATORS_FOLDER) - list(PREPEND CMAKE_PREFIX_PATH "${CONAN_GENERATORS_FOLDER}") - endif() - - find_package(${ARGN} BYPASS_PROVIDER) -endfunction() From 16b147d563478ae1aa88423e47e9086ee98d280c Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 13 Oct 2023 19:03:43 +0200 Subject: [PATCH 1612/1777] CMakePM: Expand macros in cmakeExecutable CMake preset value The specification allows this, so we need to support it. Task-number: QTCREATORBUG-29643 Change-Id: I8bd0a91ba05d2ed27b7a7af2d268539de020826f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index bacde7ea39c..6455ad3ea26 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -658,6 +658,11 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath, const CMakeTool *cmakeTool = CMakeToolManager::defaultCMakeTool(); if (cmakeTool) configurePreset.cmakeExecutable = cmakeTool->cmakeExecutable().toString(); + } else { + QString cmakeExecutable = configurePreset.cmakeExecutable.value(); + CMakePresets::Macros::expand(configurePreset, env, projectDirectory(), cmakeExecutable); + + configurePreset.cmakeExecutable = FilePath::fromUserInput(cmakeExecutable).path(); } data->cmakeBinary = Utils::FilePath::fromString(configurePreset.cmakeExecutable.value()); From b26e12e1995a5945ca0af57f1056a04cb554fe42 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Mon, 16 Oct 2023 13:35:39 +0200 Subject: [PATCH 1613/1777] Debugger: Add a dumper for Utils::Key Change-Id: I7e586b622160d5b06a3971fec825521231c09522 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- share/qtcreator/debugger/creatortypes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/share/qtcreator/debugger/creatortypes.py b/share/qtcreator/debugger/creatortypes.py index a11377b0db5..24c16ce0094 100644 --- a/share/qtcreator/debugger/creatortypes.py +++ b/share/qtcreator/debugger/creatortypes.py @@ -81,6 +81,11 @@ def qdump__Utils__Id(d, value): d.putPlainChildren(value) +def qdump__Utils__Key(d, value): + d.putByteArrayValue(value["data"]) + d.putBetterType(value.type) + + def qdump__Debugger__Internal__GdbMi(d, value): val = d.encodeString(value["m_name"]) + "3a002000" \ + d.encodeString(value["m_data"]) From 98d3508baaaf83688462861f906bcd4e120f2da5 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 17 Oct 2023 07:53:03 +0200 Subject: [PATCH 1614/1777] Docker: Fix deadlock The blocking queued connection could block the main thread if the main thread was blocking for an action that would access the docker device. Change-Id: I79c0c74688ac77f2763b9aa748386f27be011304 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/docker/dockerdevice.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 7129c6acd14..17a2e64165c 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -358,6 +358,7 @@ public: QList<TemporaryMountInfo> m_temporaryMounts; + QMutex m_shellMutex; std::unique_ptr<ContainerShell> m_shell; QString m_container; @@ -694,9 +695,11 @@ void DockerDevicePrivate::stopCurrentContainer() { if (m_container.isEmpty()) return; + if (!DockerApi::isDockerDaemonAvailable(false).value_or(false)) return; + QMutexLocker lk(&m_shellMutex); if (m_shell) { // We have to disconnect the shell from the device, otherwise it will try to // tell us about the container being stopped. Since that signal is emitted in a different @@ -896,6 +899,7 @@ expected_str<void> DockerDevicePrivate::startContainer() if (!createResult) return make_unexpected(createResult.error()); + QMutexLocker lk(&m_shellMutex); m_shell = std::make_unique<ContainerShell>(m_container, q->rootPath()); connect(m_shell.get(), &DeviceShell::done, this, [this](const ProcessResultData &resultData) { @@ -923,13 +927,15 @@ expected_str<void> DockerDevicePrivate::startContainer() expected_str<void> DockerDevicePrivate::updateContainerAccess() { + { + QMutexLocker lk(&m_shellMutex); + if (m_shell && m_shell->state() == DeviceShell::State::Succeeded) + return {}; + } + if (QThread::currentThread() != thread()) { expected_str<void> result; - QMetaObject::invokeMethod(this, - &DockerDevicePrivate::updateContainerAccess, - Qt::BlockingQueuedConnection, - &result); - return result; + return make_unexpected(Tr::tr("Cannot start docker device from non-main thread")); } if (m_isShutdown) @@ -938,9 +944,6 @@ expected_str<void> DockerDevicePrivate::updateContainerAccess() if (DockerApi::isDockerDaemonAvailable(false).value_or(false) == false) return make_unexpected(Tr::tr("Docker system is not reachable")); - if (m_shell && m_shell->state() == DeviceShell::State::Succeeded) - return {}; - expected_str<void> result = startContainer(); if (result) { deviceSettings->containerStatus.setText(Tr::tr("Running")); From bded2147912ddad9b5580fdc555743c88eb263ba Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 11 Oct 2023 16:21:04 +0200 Subject: [PATCH 1615/1777] AutoTest: Improve GTest wizard It is possible to use the header-only approach as well as linking against googletest, so make this explicit inside the wizard and fix the projects for the respective choice. The old approach could work, but mostly coincidentally. Change-Id: I5b1c0b8dfd9a2ffac3268fc4c724ba47c2bf124c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../wizards/autotest/files/googlecommon.js | 11 +++ .../autotest/files/gtest_dependency.pri | 17 +++- .../templates/wizards/autotest/files/tst.pro | 2 +- .../templates/wizards/autotest/files/tst.qbs | 30 +++++-- .../templates/wizards/autotest/files/tst.txt | 84 ++++++++++++------- .../wizards/autotest/files/tst_main.cpp | 2 +- .../wizards/autotest/gtest/wizard.json | 41 +++++++-- 7 files changed, 137 insertions(+), 50 deletions(-) diff --git a/share/qtcreator/templates/wizards/autotest/files/googlecommon.js b/share/qtcreator/templates/wizards/autotest/files/googlecommon.js index 7f754cc9e86..6e09b3ad5e9 100644 --- a/share/qtcreator/templates/wizards/autotest/files/googlecommon.js +++ b/share/qtcreator/templates/wizards/autotest/files/googlecommon.js @@ -16,6 +16,17 @@ var File = require("qbs.File") var FileInfo = require("qbs.FileInfo") +function getChildPath(qbs, baseFolder, childFolder) +{ + if (!baseFolder) + return []; + + var childPath = FileInfo.joinPaths(baseFolder, childFolder); + if (File.exists(childPath)) + return [childPath]; + return []; +} + function getGTestDir(qbs, str) { if (!str) { if (qbs.hostOS.contains("linux") && File.exists("/usr/src/gtest")) diff --git a/share/qtcreator/templates/wizards/autotest/files/gtest_dependency.pri b/share/qtcreator/templates/wizards/autotest/files/gtest_dependency.pri index f6c7245419e..8d0e458c105 100644 --- a/share/qtcreator/templates/wizards/autotest/files/gtest_dependency.pri +++ b/share/qtcreator/templates/wizards/autotest/files/gtest_dependency.pri @@ -1,16 +1,17 @@ isEmpty(GOOGLETEST_DIR):GOOGLETEST_DIR=$$(GOOGLETEST_DIR) isEmpty(GOOGLETEST_DIR) { - GOOGLETEST_DIR = %{GTestRepository} + GOOGLETEST_DIR = "%{GTestBaseFolder}" !isEmpty(GOOGLETEST_DIR) { warning("Using googletest src dir specified at Qt Creator wizard") message("set GOOGLETEST_DIR as environment variable or qmake variable to get rid of this message") } } +@if "%{TestFrameWork}" == "GTest" !isEmpty(GOOGLETEST_DIR): { - GTEST_SRCDIR = $$GOOGLETEST_DIR/googletest - GMOCK_SRCDIR = $$GOOGLETEST_DIR/googlemock + GTEST_SRCDIR = "$$GOOGLETEST_DIR/googletest" + GMOCK_SRCDIR = "$$GOOGLETEST_DIR/googlemock" } else: unix { exists(/usr/src/gtest):GTEST_SRCDIR=/usr/src/gtest exists(/usr/src/gmock):GMOCK_SRCDIR=/usr/src/gmock @@ -36,3 +37,13 @@ requires(exists($$GTEST_SRCDIR):exists($$GMOCK_SRCDIR)) SOURCES += \\ $$GMOCK_SRCDIR/src/gmock-all.cc } +@endif +@if "%{TestFrameWork}" == "GTest_dyn" +!isEmpty(GOOGLETEST_DIR): { + INCLUDEPATH *= "$$GOOGLETEST_DIR/include" + + LIBS *= -L"$$GOOGLETEST_DIR/lib" -lgtest -lgmock +} else { + LIBS *= -lgtest -lgmock +} +@endif diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.pro b/share/qtcreator/templates/wizards/autotest/files/tst.pro index bc5ac3992f6..8bb21eb80de 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.pro +++ b/share/qtcreator/templates/wizards/autotest/files/tst.pro @@ -33,7 +33,7 @@ SOURCES += \\ setup.cpp @endif @endif -@if "%{TestFrameWork}" == "GTest" +@if "%{TestFrameWork}" == "GTest" || "%{TestFrameWork}" == "GTest_dyn" include(gtest_dependency.pri) TEMPLATE = app diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.qbs b/share/qtcreator/templates/wizards/autotest/files/tst.qbs index 45590e1251a..67c821a3035 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.qbs +++ b/share/qtcreator/templates/wizards/autotest/files/tst.qbs @@ -1,5 +1,5 @@ import qbs -@if "%{TestFrameWork}" == "GTest" +@if "%{TestFrameWork}" == "GTest" || "%{TestFrameWork}" == "GTest_dyn" import qbs.Environment import "googlecommon.js" as googleCommon @endif @@ -32,16 +32,16 @@ CppApplication { consoleApplication: true @endif -@if "%{TestFrameWork}" == "GTest" +@if "%{TestFrameWork}" == "GTest" || "%{TestFrameWork}" == "GTest_dyn" property string googletestDir: { if (typeof Environment.getEnv("GOOGLETEST_DIR") === 'undefined') { - if ("%{GTestRepository}" === "" && googleCommon.getGTestDir(qbs, undefined) !== "") { + if ("%{GTestBaseFolder}" === "" && googleCommon.getGTestDir(qbs, undefined) !== "") { console.warn("Using googletest from system") } else { console.warn("Using googletest src dir specified at Qt Creator wizard") console.log("set GOOGLETEST_DIR as environment variable or Qbs property to get rid of this message") } - return "%{GTestRepository}" + return "%{GTestBaseFolder}" } else { return Environment.getEnv("GOOGLETEST_DIR") } @@ -49,14 +49,19 @@ CppApplication { cpp.cxxLanguageVersion: "c++14" cpp.dynamicLibraries: { +@if "%{TestFrameWork}" == "GTest" + var tmp = []; +@else + var tmp = ["gtest", "gmock"]; +@endif if (qbs.hostOS.contains("windows")) { - return []; + return tmp; } else { - return [ "pthread" ]; + return tmp.concat([ "pthread" ]); } } - - +@endif +@if "%{TestFrameWork}" == "GTest" cpp.includePaths: [].concat(googleCommon.getGTestIncludes(qbs, googletestDir)) .concat(googleCommon.getGMockIncludes(qbs, googletestDir)) @@ -66,6 +71,15 @@ CppApplication { ].concat(googleCommon.getGTestAll(qbs, googletestDir)) .concat(googleCommon.getGMockAll(qbs, googletestDir)) @endif +@if "%{TestFrameWork}" == "GTest_dyn" + cpp.includePaths: [].concat(googleCommon.getChildPath(qbs, googletestDir, "include")); + cpp.libraryPaths: googleCommon.getChildPath(qbs, googletestDir, "lib") + + files: [ + "%{MainCppName}", + "%{TestCaseFileGTestWithCppSuffix}", + ] +@endif @if "%{TestFrameWork}" == "QtQuickTest" Depends { name: "cpp" } Depends { name: "Qt.core" } diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.txt b/share/qtcreator/templates/wizards/autotest/files/tst.txt index f451cd1ba75..e632febdc58 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.txt +++ b/share/qtcreator/templates/wizards/autotest/files/tst.txt @@ -70,47 +70,67 @@ target_link_libraries(%{TestCaseName} PRIVATE Qt${QT_VERSION_MAJOR}::QuickTest) @endif @if "%{TestFrameWork}" == "GTest" - set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) +if ($ENV{GOOGLETEST_DIR}) + get_filename_component(_GTEST_BASE $ENV{GOOGLETEST_DIR} REALPATH) +elseif (EXISTS "%{GTestBaseFolder}") # set by QC + get_filename_component(_GTEST_BASE "%{GTestBaseFolder}" REALPATH) # set by QC +elseif (UNIX AND EXISTS "/usr/src/gtest") + set(_GTEST_BASE "/usr/src/gtest") +endif() + +if (_GTEST_BASE AND NOT EXISTS "${_GTEST_BASE}/googletest/src/gtest-all.cc" + OR NOT EXISTS "${_GTEST_BASE}/googlemock/src/gmock-all.cc") + message(ERROR "Missing source components (gtest-all.cc and/or gmock-all.cc).") +endif() + find_package(Threads REQUIRED) -if ($ENV{GOOGLETEST_DIR}) - set(GOOGLETEST_DIR $ENV{GOOGLETEST_DIR}) -else () - if (NOT "%{GTestRepository}" STREQUAL "") - message(WARNING "Using googletest src dir specified at Qt Creator wizard") - endif () - set(GOOGLETEST_DIR "%{GTestRepository}") -endif () -if (EXISTS ${GOOGLETEST_DIR}) - set(GTestSrc ${GOOGLETEST_DIR}/googletest) - set(GMockSrc ${GOOGLETEST_DIR}/googlemock) -elseif (UNIX AND EXISTS /usr/src/gtest) - set(GTestSrc /usr/src/gtest) - message(WARNING "Using gtest from system") - if (EXISTS /usr/src/gmock) - set(GMockSrc /usr/src/gmock) - endif () -else () - message( FATAL_ERROR "No googletest src dir found - set GOOGLETEST_DIR to enable!") -endif () - -set(GTestFiles ${GTestSrc}/src/gtest-all.cc) -set(GTestIncludes ${GTestSrc} ${GTestSrc}/include) -if (NOT ${GMockSrc} STREQUAL "") - list(APPEND GTestFiles ${GMockSrc}/src/gmock-all.cc) - list(APPEND GTestIncludes ${GMockSrc} ${GMockSrc}/include) -endif () - -include_directories(${GTestIncludes}) - +include_directories( + ${_GTEST_BASE}/googletest ${_GTEST_BASE}/googletest/include + ${_GTEST_BASE}/googlemock ${_GTEST_BASE}/googlemock/include +) add_executable(%{TestCaseName} %{MainCppName} %{TestCaseFileGTestWithCppSuffix} - ${GTestFiles}) + ${_GTEST_BASE}/googletest/src/gtest-all.cc + ${_GTEST_BASE}/googlemock/src/gmock-all.cc + ) + add_test(NAME %{TestCaseName} COMMAND %{TestCaseName}) target_link_libraries(%{TestCaseName} PRIVATE Threads::Threads) +@endif +@if "%{TestFrameWork}" == "GTest_dyn" +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +if ($ENV{GOOGLETEST_DIR}) + get_filename_component(_GTEST_BASE $ENV{GOOGLETEST_DIR} REALPATH) +elseif (EXISTS "%{GTestBaseFolder}") # set by QC + get_filename_component(_GTEST_BASE "%{GTestBaseFolder}" REALPATH) # set by QC +endif() + +if (NOT GTEST_ROOT) + if (_GTEST_BASE) + message("Setting GTEST_ROOT to ${_GTEST_BASE}") + set(GTEST_ROOT ${_GTEST_BASE}) + else() + message("No GTEST_ROOT specified - using system defaults.") + endif() +endif() + +find_package(GTest REQUIRED) +if (NOT GTest_FOUND) + message (FATAL_ERROR "No GTest Found") +endif() + +add_executable(%{TestCaseName} %{MainCppName} %{TestCaseFileGTestWithCppSuffix}) +add_test(NAME %{TestCaseName} COMMAND %{TestCaseName}) + +target_link_libraries(%{TestCaseName} PRIVATE GTest::GTest) +if (GMock_FOUND) + target_link_libraries(%{TestCaseName} INTERFACE GTest::GMock) +endif() @endif @if "%{TestFrameWork}" == "BoostTest" set(CMAKE_CXX_STANDARD 11) diff --git a/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp b/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp index 1c915089d6f..bd3e3a66ef7 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp +++ b/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp @@ -9,7 +9,7 @@ QUICK_TEST_MAIN_WITH_SETUP(example, Setup) QUICK_TEST_MAIN(example) @endif @endif -@if "%{TestFrameWork}" == "GTest" +@if "%{TestFrameWork}" == "GTest" || "%{TestFrameWork}" == "GTest_dyn" %{Cpp:LicenseTemplate}\ #include <gtest/gtest.h> diff --git a/share/qtcreator/templates/wizards/autotest/gtest/wizard.json b/share/qtcreator/templates/wizards/autotest/gtest/wizard.json index 5e79ab5539a..7d8b88b552e 100644 --- a/share/qtcreator/templates/wizards/autotest/gtest/wizard.json +++ b/share/qtcreator/templates/wizards/autotest/gtest/wizard.json @@ -8,14 +8,10 @@ "trDisplayCategory": "Test Project", "icon": "../autotest.png", "iconKind": "Themed", - "featuresRequired": [ "QtSupport.Wizards.FeatureDesktop" ], "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", "options": [ - { "key": "TestFrameWork", - "value": "GTest" - }, { "key": "ProjectFilePath", "value": "%{JS: value('BuildSystem') == 'qmake' ? value('ProFileName') : (value('BuildSystem') == 'qbs' ? value('QbsFileName') : value('CMakeFileName')) }" }, @@ -40,6 +36,10 @@ "key": "TestCaseFileGTestWithCppSuffix", "value": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Util.preferredSuffix('text/x-c++src') }" }, + { + "key": "GTestBaseFolder", + "value": "%{JS: value('TestFrameWork') === 'GTest' ? value('GTestRepository') : value('GTestInstallFolder')}" + }, { "key": "GUARD", "value": "%{JS: value('TestCaseFileWithHeaderSuffix').toUpperCase().replace('.', '_') }" @@ -63,6 +63,26 @@ "typeId": "Fields", "data": [ + { + "name": "TestFrameWork", + "trDisplayName": "Test framework:", + "type": "ComboBox", + "data": + { + "index": 1, + "items": + [ + { + "trKey": "Google Test (header only)", + "value": "GTest" + }, + { + "trKey": "Google Test (shared libraries)", + "value": "GTest_dyn" + } + ] + } + }, { "name": "TestSuiteName", "trDisplayName": "Test suite name:", @@ -79,6 +99,7 @@ }, { "name": "GTestRepository", + "visible": "%{JS: '%{TestFrameWork}' === 'GTest'}", "trDisplayName": "Googletest source directory (optional):", "mandatory": false, "type": "PathChooser", @@ -86,6 +107,16 @@ "kind": "existingDirectory" } }, + { + "name": "GTestInstallFolder", + "visible": "%{JS: '%{TestFrameWork}' === 'GTest_dyn'}", + "trDisplayName": "Googletest install directory (optional):", + "mandatory": false, + "type": "PathChooser", + "data": { + "kind": "existingDirectory" + } + }, { "name": "BuildSystem", "trDisplayName": "Build system:", @@ -123,7 +154,7 @@ "enabled": "%{IsTopLevelProject}", "data": { "projectFilePath": "%{ProjectFilePath}", - "requiredFeatures": [ "%{JS: value('BuildSystem') === 'qmake' ? 'QtSupport.Wizards.FeatureQt' : 'QtSupport.Wizards.FeatureDesktop' }" ] + "requiredFeatures": [ "%{JS: value('BuildSystem') === 'qmake' ? 'QtSupport.Wizards.FeatureQt' : 'DeviceType.Desktop' }" ] } }, { From 67ad0cf55631dd275ee3904b0b061f3af672a8a7 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 16 Oct 2023 12:39:23 +0200 Subject: [PATCH 1616/1777] AutoTest: Improve Catch2 wizard Since version 3 of Catch2 it is recommended to use the approach to link against Catch2 instead of using a single include. Make both variants work. There is still a third variant of using a single include for version 3, which is left out here, but can easily be fixed for Catch2 users. Change-Id: I2c25837cb1df4b460b662466dde68563fa7d713c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../wizards/autotest/catch/wizard.json | 60 ++++++++++++++++--- .../wizards/autotest/files/catch-common.pri | 21 +++++++ .../wizards/autotest/files/catch2_tst.cpp | 4 ++ .../wizards/autotest/files/catchCommon.js | 16 +++++ .../templates/wizards/autotest/files/tst.pro | 22 ++++++- .../templates/wizards/autotest/files/tst.qbs | 41 +++++++++++++ .../templates/wizards/autotest/files/tst.txt | 42 ++++++++++++- .../wizards/autotest/files/tst_main.cpp | 19 ++++++ 8 files changed, 214 insertions(+), 11 deletions(-) create mode 100644 share/qtcreator/templates/wizards/autotest/files/catch-common.pri create mode 100644 share/qtcreator/templates/wizards/autotest/files/catchCommon.js diff --git a/share/qtcreator/templates/wizards/autotest/catch/wizard.json b/share/qtcreator/templates/wizards/autotest/catch/wizard.json index d9ca160459a..1aa35ed0ec3 100644 --- a/share/qtcreator/templates/wizards/autotest/catch/wizard.json +++ b/share/qtcreator/templates/wizards/autotest/catch/wizard.json @@ -8,14 +8,10 @@ "trDisplayCategory": "Test Project", "icon": "../autotest.png", "iconKind": "Themed", - "featuresRequired": [ "QtSupport.Wizards.FeatureDesktop" ], "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", "options": [ - { "key": "TestFrameWork", - "value": "Catch2" - }, { "key": "ProjectFilePath", "value": "%{JS: value('BuildSystem') == 'qmake' ? value('ProFileName') : (value('BuildSystem') == 'qbs' ? value('QbsFileName') : value('CMakeFileName')) }" }, @@ -63,6 +59,26 @@ "typeId": "Fields", "data": [ + { + "name": "TestFrameWork", + "trDisplayName": "Test framework:", + "type": "ComboBox", + "data": + { + "index": 1, + "items": + [ + { + "trKey": "Catch2 v2 (header only)", + "value": "Catch2" + }, + { + "trKey": "Catch2 v3 (shared libraries)", + "value": "Catch2_dyn" + } + ] + } + }, { "name": "TestCaseName", "trDisplayName": "Test case name:", @@ -80,10 +96,28 @@ "kind": "existingDirectory" } }, + { + "name": "CatchInstallDir", + "trDisplayName": "Catch2 install directory (optional):", + "visible": "%{JS: value('TestFrameWork') === 'Catch2_dyn'}", + "mandatory": false, + "type": "PathChooser", + "data": { + "kind": "existingDirectory" + } + }, + { + "name": "Catch2Main", + "trDisplayName": "Use own main", + "visible": "%{JS: '%{TestFrameWork}' === 'Catch2_dyn'}", + "type": "CheckBox", + "data": { + "checked": false + } + }, { "name": "Catch2NeedsQt", "trDisplayName": "Use Qt libraries", - "visible": "%{JS: '%{TestFrameWork}' === 'Catch2'}", "type": "CheckBox", "data": { "checked": false @@ -126,7 +160,7 @@ "enabled": "%{IsTopLevelProject}", "data": { "projectFilePath": "%{ProjectFilePath}", - "requiredFeatures": [ "%{JS: (value('Catch2NeedsQt') || value('BuildSystem') === 'qmake') ? 'QtSupport.Wizards.FeatureQt' : 'QtSupport.Wizards.FeatureDesktop' }" ] + "requiredFeatures": [ "%{JS: (value('Catch2NeedsQt') == 'true' || value('BuildSystem') === 'qmake') ? 'QtSupport.Wizards.FeatureQt' : 'DeviceType.Desktop' }" ] } }, { @@ -148,6 +182,12 @@ "openInEditor": false, "openAsProject": true }, + { + "source": "../files/catch-common.pri", + "target": "catch-common.pri", + "openInEditor": false, + "condition": "%{JS: value('BuildSystem') == 'qmake' && '%{TestFrameWork}' == 'Catch2_dyn'}" + }, { "source": "../files/tst.qbs", "target": "%{ProjectFilePath}", @@ -155,6 +195,12 @@ "openInEditor": false, "openAsProject": true }, + { + "source": "../files/catchCommon.js", + "target": "catchCommon.js", + "condition": "%{JS: value('BuildSystem') == 'qbs'}", + "openInEditor": false + }, { "source": "../files/tst.txt", "target": "CMakeLists.txt", @@ -164,13 +210,13 @@ }, { "source": "../files/tst_main.cpp", + "condition": "%{JS: '%{TestFrameWork}' == 'Catch2' || value('Catch2Main') == 'true'}", "target": "%{MainCppName}", "openInEditor": true }, { "source": "../files/catch2_tst.cpp", "target": "%{TestCaseFileWithCppSuffix}", - "condition": "%{JS: '%{TestFrameWork}' === 'Catch2'}", "openInEditor": true }, { diff --git a/share/qtcreator/templates/wizards/autotest/files/catch-common.pri b/share/qtcreator/templates/wizards/autotest/files/catch-common.pri new file mode 100644 index 00000000000..69676992182 --- /dev/null +++ b/share/qtcreator/templates/wizards/autotest/files/catch-common.pri @@ -0,0 +1,21 @@ +isEmpty(CATCH2_INSTALL_DIR):CATCH2_INSTALL_DIR=$$(CATCH2_INSTALL_DIR) + +isEmpty(CATCH2_INSTALL_DIR) { + CATCH2_INSTALL_DIR = "%{CatchInstallDir}" # set by QC + !isEmpty(CATCH2_INSTALL_DIR) { + warning("Using Catch2 installation specified at Qt Creator wizard.") + message("Set CATCH2_INSTALL_DIR as environment variable or qmake variable to get rid of this message") + } else { + message("Using Catch2 from system - set CATCH2_INSTALL_DIR is it cannot be found automatically.") + } +} + +!isEmpty(CATCH2_INSTALL_DIR): { + INCLUDEPATH *= "$$CATCH2_INSTALL_DIR/include" + + equals(CATCH2_MAIN, 0): LIBS *= -L"$$CATCH2_INSTALL_DIR/lib" -lCatch2Main -lCatch2 + else: LIBS *= -L"$$CATCH2_INSTALL_DIR/lib" -lCatch2 +} else { + equals(CATCH2_MAIN, 0): LIBS *= -lCatch2Main -lCatch2 + else: LIBS *= -lCatch2 +} diff --git a/share/qtcreator/templates/wizards/autotest/files/catch2_tst.cpp b/share/qtcreator/templates/wizards/autotest/files/catch2_tst.cpp index 604b339e1cc..191f8fdeeaa 100644 --- a/share/qtcreator/templates/wizards/autotest/files/catch2_tst.cpp +++ b/share/qtcreator/templates/wizards/autotest/files/catch2_tst.cpp @@ -1,4 +1,8 @@ +@if "%{TestFrameWork}" == "Catch2" #include <catch2/catch.hpp> +@else +#include <catch2/catch_test_macros.hpp> +@endif TEST_CASE("My first test with Catch2", "[fancy]") { diff --git a/share/qtcreator/templates/wizards/autotest/files/catchCommon.js b/share/qtcreator/templates/wizards/autotest/files/catchCommon.js new file mode 100644 index 00000000000..c8f633ab799 --- /dev/null +++ b/share/qtcreator/templates/wizards/autotest/files/catchCommon.js @@ -0,0 +1,16 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +var File = require("qbs.File") +var FileInfo = require("qbs.FileInfo") + +function getChildPath(qbs, baseFolder, childFolder) +{ + if (!baseFolder) + return []; + + var childPath = FileInfo.joinPaths(baseFolder, childFolder); + if (File.exists(childPath)) + return [childPath]; + return []; +} diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.pro b/share/qtcreator/templates/wizards/autotest/files/tst.pro index 8bb21eb80de..075d87443df 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.pro +++ b/share/qtcreator/templates/wizards/autotest/files/tst.pro @@ -95,7 +95,7 @@ SOURCES += \\ %{MainCppName} \\ %{TestCaseFileWithCppSuffix} @endif -@if "%{TestFrameWork}" == "Catch2" +@if "%{TestFrameWork}" == "Catch2" || "%{TestFrameWork}" == "Catch2_dyn" TEMPLATE = app @if "%{Catch2NeedsQt}" == "true" QT += gui @@ -106,7 +106,8 @@ CONFIG += console @endif CONFIG += c++11 - +@endif +@if "%{TestFrameWork}" == "Catch2" isEmpty(CATCH_INCLUDE_DIR): CATCH_INCLUDE_DIR=$$(CATCH_INCLUDE_DIR) @if "%{CatchIncDir}" != "" # set by Qt Creator wizard @@ -119,6 +120,21 @@ isEmpty(CATCH_INCLUDE_DIR): { } SOURCES += \\ - main.cpp \\ + %{MainCppName} \\ %{TestCaseFileWithCppSuffix} @endif +@if "%{TestFrameWork}" == "Catch2_dyn" +@if "%{Catch2Main}" == "true" +SOURCES = %{TestCaseFileWithCppSuffix} \\ + %{MainCppName} + +CATCH2_MAIN=0 + +@else +SOURCES = %{TestCaseFileWithCppSuffix} + +CATCH2_MAIN=1 + +@endif +include(catch-common.pri) +@endif diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.qbs b/share/qtcreator/templates/wizards/autotest/files/tst.qbs index 67c821a3035..990219a32f5 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.qbs +++ b/share/qtcreator/templates/wizards/autotest/files/tst.qbs @@ -16,6 +16,12 @@ import qbs.FileInfo import qbs.Environment import qbs.File @endif +@if "%{TestFrameWork}" == "Catch2_dyn" +import qbs.Environment +import qbs.File + +import "catchCommon.js" as catchCommon +@endif CppApplication { @if "%{TestFrameWork}" == "QtTest" @@ -197,5 +203,40 @@ CppApplication { "%{TestCaseFileWithCppSuffix}", ] @endif +@if "%{TestFrameWork}" == "Catch2_dyn" + property string catch2Dir: { + if (typeof Environment.getEnv("CATCH_INSTALL_DIR") === 'undefined') { + if ("%{CatchInstallDir}" === "") { + console.warn("Using Catch2 from system") + } else { + console.warn("Using Catch2 install dir specified at Qt Creator wizard") + console.log("set CATCH_INSTALL_DIR as environment variable or Qbs property to get rid of this message") + return "%{CatchInstallDir}"; + } + return ""; + } else { + return Environment.getEnv("CATCH_INSTALL_DIR"); + } + } + + Properties { + condition: catch2Dir !== "" && File.exists(catch2Dir) + cpp.includePaths: [].concat(catchCommon.getChildPath(qbs, catch2Dir, "include")); + cpp.libraryPaths: catchCommon.getChildPath(qbs, catch2Dir, "lib") + } +@if "%{Catch2Main}" == "false" + cpp.dynamicLibraries: base.concat(["Catch2Main", "Catch2"]) +@else + cpp.dynamicLibraries: base.concat(["Catch2"]) +@endif + + files: [ +@if "%{Catch2Main}" == "true" + "%{MainCppName}", +@endif + "%{TestCaseFileWithCppSuffix}", + ] + +@endif } diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.txt b/share/qtcreator/templates/wizards/autotest/files/tst.txt index e632febdc58..f0eeb813392 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.txt +++ b/share/qtcreator/templates/wizards/autotest/files/tst.txt @@ -185,7 +185,7 @@ find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Gui) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui) @endif -add_executable(%{TestCaseName} %{TestCaseFileWithCppSuffix} main.cpp) +add_executable(%{TestCaseName} %{TestCaseFileWithCppSuffix} %{MainCppName}) add_test(NAME %{TestCaseName} COMMAND %{TestCaseName}) @if "%{Catch2NeedsQt}" == "true" @@ -203,3 +203,43 @@ elseif (EXISTS ${CATCH_INCLUDE_DIR}) include_directories(${CATCH_INCLUDE_DIR}) endif () @endif +@if "%{TestFrameWork}" == "Catch2_dyn" +SET(CMAKE_CXX_STANDARD 11) + +if ($ENV{CATCH2_INSTALL_DIR}) + get_filename_component(_CATCH2_BASE $ENV{CATCH2_INSTALL_DIR} REALPATH) +elseif (EXISTS "%{CatchInstallDir}") # set by QC + get_filename_component(_CATCH2_BASE "%{CatchInstallDir}" REALPATH) # set by QC +endif() + +if (NOT Catch2_DIR) + if (_CATCH2_BASE) + if (EXISTS "${_CATCH2_BASE}/lib/cmake/Catch2") + set(_CATCH2_BASE "${_CATCH2_BASE}/lib/cmake/Catch2") + endif() + message("Setting Catch2_DIR to ${_CATCH2_BASE}") + set(Catch2_DIR ${_CATCH2_BASE}) + else() + message("No Catch2_DIR specified - using system defaults.") + endif() +endif() + +find_package(Catch2 3 REQUIRED) +@if "%{Catch2NeedsQt}" == "true" +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Gui) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui) +@endif + +@if "%{Catch2Main}" == "false" +add_executable(%{TestCaseName} %{TestCaseFileWithCppSuffix}) +target_link_libraries(%{TestCaseName} PRIVATE Catch2::Catch2WithMain) +@else +add_executable(%{TestCaseName} %{TestCaseFileWithCppSuffix} %{MainCppName}) +target_link_libraries(%{TestCaseName} PRIVATE Catch2::Catch2) +@endif +@if "%{Catch2NeedsQt}" == "true" +target_link_libraries(%{TestCaseName} PRIVATE Qt${QT_VERSION_MAJOR}::Gui) +@endif + +add_test(NAME %{TestCaseName} COMMAND %{TestCaseName}) +@endif diff --git a/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp b/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp index bd3e3a66ef7..e2aabc9a87b 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp +++ b/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp @@ -55,3 +55,22 @@ int main(int argc, char** argv) } @endif @endif +@if "%{TestFrameWork}" == "Catch2_dyn" && "%{Catch2Main}" == "true" +#include <catch2/catch_session.hpp> +@if "%{Catch2NeedsQt}" == "true" +#include <QtGui/QGuiApplication> +@endif + +int main( int argc, char* argv[] ) { + // your setup ... +@if "%{Catch2NeedsQt}" == "true" + QGuiApplication app(argc, argv); +@endif + + int result = Catch::Session().run( argc, argv ); + + // your clean-up... + + return result; +} +@endif From 3363d71888532299d6cba5377573727c7ee40d77 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 16 Oct 2023 15:54:44 +0200 Subject: [PATCH 1617/1777] Build: Fix handling of (s)ccache support So it also works when building individual projects like cdbext Change-Id: Ibb9cac77146a9f19cbbe22f2c7257b951f38f3fc Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/libs/qtcreatorcdbext/CMakeLists.txt | 1 + src/tools/qml2puppet/CMakeLists.txt | 1 + src/tools/sdktool/CMakeLists.txt | 1 + src/tools/wininterrupt/CMakeLists.txt | 1 + tests/auto/debugger/CMakeLists.txt | 1 + 5 files changed, 5 insertions(+) diff --git a/src/libs/qtcreatorcdbext/CMakeLists.txt b/src/libs/qtcreatorcdbext/CMakeLists.txt index 8c95cb400b8..07a5493de34 100644 --- a/src/libs/qtcreatorcdbext/CMakeLists.txt +++ b/src/libs/qtcreatorcdbext/CMakeLists.txt @@ -12,6 +12,7 @@ if (NOT QT_CREATOR_API_DEFINED) # standalone build include(QtCreatorIDEBranding) include(QtCreatorAPI) + qtc_handle_compiler_cache_support() endif() if (NOT WIN32 OR NOT MSVC) diff --git a/src/tools/qml2puppet/CMakeLists.txt b/src/tools/qml2puppet/CMakeLists.txt index 2ffebbc59db..9244a9454db 100644 --- a/src/tools/qml2puppet/CMakeLists.txt +++ b/src/tools/qml2puppet/CMakeLists.txt @@ -16,6 +16,7 @@ if (NOT QT_CREATOR_API_DEFINED) set(DESTINATION DESTINATION .) include(QtCreatorIDEBranding) include(QtCreatorAPI) + qtc_handle_compiler_cache_support() find_package(Qt6 COMPONENTS Concurrent Core Gui Network PrintSupport Qml Quick Sql Widgets Xml diff --git a/src/tools/sdktool/CMakeLists.txt b/src/tools/sdktool/CMakeLists.txt index 937aa04087a..19b8571f562 100644 --- a/src/tools/sdktool/CMakeLists.txt +++ b/src/tools/sdktool/CMakeLists.txt @@ -16,6 +16,7 @@ if (NOT QT_CREATOR_API_DEFINED) set(DESTINATION DESTINATION .) include(QtCreatorIDEBranding) include(QtCreatorAPI) + qtc_handle_compiler_cache_support() find_package(QT NAMES Qt6 Qt5 COMPONENTS Core diff --git a/src/tools/wininterrupt/CMakeLists.txt b/src/tools/wininterrupt/CMakeLists.txt index 9dd3a658d7c..ee40ff769b8 100644 --- a/src/tools/wininterrupt/CMakeLists.txt +++ b/src/tools/wininterrupt/CMakeLists.txt @@ -12,6 +12,7 @@ if (NOT QT_CREATOR_API_DEFINED) # standalone build include(QtCreatorIDEBranding) include(QtCreatorAPI) + qtc_handle_compiler_cache_support() endif() if (NOT WIN32) diff --git a/tests/auto/debugger/CMakeLists.txt b/tests/auto/debugger/CMakeLists.txt index 4abe98c05e8..2f06a6b2fc7 100644 --- a/tests/auto/debugger/CMakeLists.txt +++ b/tests/auto/debugger/CMakeLists.txt @@ -24,6 +24,7 @@ if (NOT QT_CREATOR_API_DEFINED) include(QtCreatorIDEBranding) include(QtCreatorAPI) + qtc_handle_compiler_cache_support() set(WITH_TESTS ON) From 54b841f78972b10933059691a0a2b262b0bfc901 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 17 Oct 2023 08:53:25 +0200 Subject: [PATCH 1618/1777] QtSupport: Store Qt versions after autodetection on startup Restores old behavior. When QC is started with a Qt in PATH but without existing settings it ran the autodetection and stored the Qt versions to disk. This made it possible to restart QC later with the same settingspath, but without having Qt in PATH. Without this patch the Qt versions of QC only got persisted if the settings dialog had been opened at least once and closed with Ok (or an explicit Apply). Change-Id: I74bd9bc0b96d5ff66e5a81200d6a269a5411a5ea Reviewed-by: hjk <hjk@qt.io> --- src/plugins/qtsupport/qtversionmanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 3a4209cee83..88c88ae15a0 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -155,6 +155,8 @@ void QtVersionManagerImpl::triggerQtVersionRestore() // in that case figure out if there's a qt in path // and add it to the Qt versions findSystemQt(); + if (m_versions.size()) + saveQtVersions(); } { From c2a470e8539af72807911ce465242964bbe308f6 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 16 Oct 2023 16:18:56 +0200 Subject: [PATCH 1619/1777] Revert "TextEditor: Hide LineNumberFilter implementation" Fixes missing "Line in Current Document" locator filter. Locator filters need to be created during startup. This reverts commit 8af6d16b6c2a0a08ee4f49abdfc7b0a503276bde. Change-Id: I53ec1c1079b4a719169e8db95b6d77f703264b65 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/texteditor/linenumberfilter.cpp | 108 ++++++++---------- src/plugins/texteditor/linenumberfilter.h | 13 ++- .../texteditor/texteditoractionhandler.cpp | 3 +- src/plugins/texteditor/texteditorplugin.cpp | 6 + src/plugins/texteditor/texteditorplugin.h | 3 + 5 files changed, 70 insertions(+), 63 deletions(-) diff --git a/src/plugins/texteditor/linenumberfilter.cpp b/src/plugins/texteditor/linenumberfilter.cpp index 245d8565190..b718e5b4331 100644 --- a/src/plugins/texteditor/linenumberfilter.cpp +++ b/src/plugins/texteditor/linenumberfilter.cpp @@ -1,79 +1,69 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#include "linenumberfilter.h" + #include "texteditortr.h" #include <coreplugin/editormanager/editormanager.h> -#include <coreplugin/locator/ilocatorfilter.h> using namespace Core; using namespace Utils; namespace TextEditor::Internal { -class LineNumberFilter : public ILocatorFilter +LineNumberFilter::LineNumberFilter() { -public: - LineNumberFilter() - { - setId("Line in current document"); - setDisplayName(Tr::tr("Line in Current Document")); - setDescription(Tr::tr("Jumps to the given line in the current document.")); - setDefaultSearchText(Tr::tr("<line>:<column>")); - setPriority(High); - setDefaultShortcutString("l"); - setDefaultIncludedByDefault(true); - } + setId("Line in current document"); + setDisplayName(Tr::tr("Line in Current Document")); + setDescription(Tr::tr("Jumps to the given line in the current document.")); + setDefaultSearchText(Tr::tr("<line>:<column>")); + setPriority(High); + setDefaultShortcutString("l"); + setDefaultIncludedByDefault(true); +} -private: - LocatorMatcherTasks matchers() final - { - using namespace Tasking; +LocatorMatcherTasks LineNumberFilter::matchers() +{ + using namespace Tasking; - TreeStorage<LocatorStorage> storage; + TreeStorage<LocatorStorage> storage; - const auto onSetup = [storage] { - const QStringList lineAndColumn = storage->input().split(':'); - int sectionCount = lineAndColumn.size(); - int line = 0; - int column = 0; - bool ok = false; - if (sectionCount > 0) - line = lineAndColumn.at(0).toInt(&ok); - if (ok && sectionCount > 1) - column = lineAndColumn.at(1).toInt(&ok); - if (!ok) - return; - if (EditorManager::currentEditor() && (line > 0 || column > 0)) { - QString text; - if (line > 0 && column > 0) - text = Tr::tr("Line %1, Column %2").arg(line).arg(column); - else if (line > 0) - text = Tr::tr("Line %1").arg(line); - else - text = Tr::tr("Column %1").arg(column); - LocatorFilterEntry entry; - entry.displayName = text; - entry.acceptor = [line, targetColumn = column - 1] { - IEditor *editor = EditorManager::currentEditor(); - if (!editor) - return AcceptResult(); - EditorManager::addCurrentPositionToNavigationHistory(); - editor->gotoLine(line < 1 ? editor->currentLine() : line, targetColumn); - EditorManager::activateEditor(editor); + const auto onSetup = [storage] { + const QStringList lineAndColumn = storage->input().split(':'); + int sectionCount = lineAndColumn.size(); + int line = 0; + int column = 0; + bool ok = false; + if (sectionCount > 0) + line = lineAndColumn.at(0).toInt(&ok); + if (ok && sectionCount > 1) + column = lineAndColumn.at(1).toInt(&ok); + if (!ok) + return; + if (EditorManager::currentEditor() && (line > 0 || column > 0)) { + QString text; + if (line > 0 && column > 0) + text = Tr::tr("Line %1, Column %2").arg(line).arg(column); + else if (line > 0) + text = Tr::tr("Line %1").arg(line); + else + text = Tr::tr("Column %1").arg(column); + LocatorFilterEntry entry; + entry.displayName = text; + entry.acceptor = [line, targetColumn = column - 1] { + IEditor *editor = EditorManager::currentEditor(); + if (!editor) return AcceptResult(); - }; - storage->reportOutput({entry}); - } - }; - return {{Sync(onSetup), storage}}; - } -}; - -ILocatorFilter *lineNumberFilter() -{ - static LineNumberFilter theLineNumberFilter; - return &theLineNumberFilter; + EditorManager::addCurrentPositionToNavigationHistory(); + editor->gotoLine(line < 1 ? editor->currentLine() : line, targetColumn); + EditorManager::activateEditor(editor); + return AcceptResult(); + }; + storage->reportOutput({entry}); + } + }; + return {{Sync(onSetup), storage}}; } } // namespace TextEditor::Internal diff --git a/src/plugins/texteditor/linenumberfilter.h b/src/plugins/texteditor/linenumberfilter.h index cbae14ea014..ec72c1bb029 100644 --- a/src/plugins/texteditor/linenumberfilter.h +++ b/src/plugins/texteditor/linenumberfilter.h @@ -3,10 +3,17 @@ #pragma once -namespace Core { class ILocatorFilter; } +#include <coreplugin/locator/ilocatorfilter.h> namespace TextEditor::Internal { -Core::ILocatorFilter *lineNumberFilter(); +class LineNumberFilter : public Core::ILocatorFilter +{ +public: + LineNumberFilter(); -} // TextEditor::Internal +private: + Core::LocatorMatcherTasks matchers() final; +}; + +} // namespace TextEditor::Internal diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index c105a26cc4a..49b83b8a756 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -7,6 +7,7 @@ #include "displaysettings.h" #include "fontsettings.h" #include "linenumberfilter.h" +#include "texteditorplugin.h" #include "texteditortr.h" #include "texteditorsettings.h" @@ -179,7 +180,7 @@ void TextEditorActionHandlerPrivate::createActions() registerAction(SELECTALL, [] (TextEditorWidget *w) { w->selectAll(); }, true); registerAction(GOTO, [] (TextEditorWidget *) { - Core::LocatorManager::showFilter(lineNumberFilter()); + Core::LocatorManager::showFilter(TextEditorPlugin::lineNumberFilter()); }); m_modifyingActions << registerAction(PRINT, [] (TextEditorWidget *widget) { widget->print(Core::ICore::printer()); }); diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 7746ddb4491..f8de8503937 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -99,6 +99,7 @@ public: FilePath m_marginActionFileName; TextEditorSettings settings; + LineNumberFilter lineNumberFilter; // Goto line functionality for quick open OutlineFactory outlineFactory; FindInFiles findInFilesFilter; @@ -425,6 +426,11 @@ void TextEditorPlugin::extensionsInitialized() }); } +LineNumberFilter *TextEditorPlugin::lineNumberFilter() +{ + return &m_instance->d->lineNumberFilter; +} + ExtensionSystem::IPlugin::ShutdownFlag TextEditorPlugin::aboutToShutdown() { Highlighter::handleShutdown(); diff --git a/src/plugins/texteditor/texteditorplugin.h b/src/plugins/texteditor/texteditorplugin.h index 3f21b7ce2f5..f5725061950 100644 --- a/src/plugins/texteditor/texteditorplugin.h +++ b/src/plugins/texteditor/texteditorplugin.h @@ -8,6 +8,8 @@ namespace TextEditor { namespace Internal { +class LineNumberFilter; + class TextEditorPlugin final : public ExtensionSystem::IPlugin { Q_OBJECT @@ -18,6 +20,7 @@ public: ~TextEditorPlugin() final; static TextEditorPlugin *instance(); + static LineNumberFilter *lineNumberFilter(); ShutdownFlag aboutToShutdown() override; From f2934f84973db0f8cd4157a226a031cf87911212 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 17 Oct 2023 09:31:46 +0200 Subject: [PATCH 1620/1777] Utils: avoid another assert in FileSystemWatcher amends f77635883b0777fd7b852a40c2ef60955df4bf34 Change-Id: I2b0f92db3218192457a08ff8a473444fd2f811a8 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/filesystemwatcher.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libs/utils/filesystemwatcher.cpp b/src/libs/utils/filesystemwatcher.cpp index d410ff2507f..ac9043f878c 100644 --- a/src/libs/utils/filesystemwatcher.cpp +++ b/src/libs/utils/filesystemwatcher.cpp @@ -470,20 +470,17 @@ void FileSystemWatcher::slotDirectoryChanged(const QString &path) for (const QString &rejected : d->m_staticData->m_watcher->addPaths(toReadd)) toReadd.removeOne(rejected); - QStringList toRemove; // If we've successfully added the file, that means it was deleted and replaced. for (const QString &reAdded : std::as_const(toReadd)) { - d->fileChanged(reAdded); const QString directory = QFileInfo(reAdded).path(); const int dirCount = --d->m_staticData->m_directoryCount[directory]; Q_ASSERT(dirCount >= 0); if (!dirCount) - toRemove << directory; - } + d->m_staticData->m_watcher->removePath(directory); - if (!toRemove.isEmpty()) - d->m_staticData->m_watcher->removePaths(toRemove); + d->fileChanged(reAdded); + } } } From d8a75d48a303ca0de50c47f1e592e5e56be916d2 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 17 Oct 2023 09:23:25 +0200 Subject: [PATCH 1621/1777] TextEditor: Add selecting highlighter by name Change-Id: I5c706dd151173bf08c5fbd4dacbf6e5d6416b87b Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/texteditor/highlighter.h | 3 ++- src/plugins/texteditor/texteditor.cpp | 6 ++++++ src/plugins/texteditor/texteditor.h | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/highlighter.h b/src/plugins/texteditor/highlighter.h index 0183c9c171e..b3f10d0671d 100644 --- a/src/plugins/texteditor/highlighter.h +++ b/src/plugins/texteditor/highlighter.h @@ -13,7 +13,8 @@ namespace TextEditor { class TextDocument; -class Highlighter : public SyntaxHighlighter, public KSyntaxHighlighting::AbstractHighlighter +class TEXTEDITOR_EXPORT Highlighter : public SyntaxHighlighter, + public KSyntaxHighlighting::AbstractHighlighter { Q_OBJECT Q_INTERFACES(KSyntaxHighlighting::AbstractHighlighter) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index c5b73125d5f..70265e14a47 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -9068,6 +9068,12 @@ void TextEditorWidget::configureGenericHighlighter(const Utils::MimeType &mimeTy d->removeSyntaxInfoBar(); } +void TextEditorWidget::configureGenericHighlighter(const Highlighter::Definition &definition) +{ + d->configureGenericHighlighter(definition); + d->removeSyntaxInfoBar(); +} + int TextEditorWidget::blockNumberForVisibleRow(int row) const { QTextBlock block = blockForVisibleRow(row); diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index 6f67fe67748..2af45826368 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -6,6 +6,7 @@ #include "texteditor_global.h" #include "codeassist/assistenums.h" +#include "highlighter.h" #include "indenter.h" #include "refactoroverlay.h" #include "snippets/snippetparser.h" @@ -453,6 +454,9 @@ public: /// Overwrite the current highlighter with a new generic highlighter based on the given mimetype void configureGenericHighlighter(const Utils::MimeType &mimeType); + /// Overwrite the current highlighter with a new generic highlighter based on the given definition + void configureGenericHighlighter(const Highlighter::Definition &definition); + Q_INVOKABLE void inSnippetMode(bool *active); // Used by FakeVim. /*! Returns the document line number for the visible \a row. From 5b97cb375b9d5d9bcdcbca5bce9becfb0b3983c8 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Mon, 16 Oct 2023 16:20:29 +0200 Subject: [PATCH 1622/1777] Doc: Describe new C++ refactoring actions - Convert Comment to C/C++ Style - Move Function Documentation to Declaration/Definition Task-number: QTCREATORBUG-29392 Change-Id: Iae48cd752c909a0007929e0111aa149fbfea02ee Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- doc/qtcreator/src/editors/creator-quick-fixes.qdoc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/qtcreator/src/editors/creator-quick-fixes.qdoc b/doc/qtcreator/src/editors/creator-quick-fixes.qdoc index a55c8f5cd23..88fddf01514 100644 --- a/doc/qtcreator/src/editors/creator-quick-fixes.qdoc +++ b/doc/qtcreator/src/editors/creator-quick-fixes.qdoc @@ -829,6 +829,18 @@ \li Convert connect() to Qt 5 Style \li Converts a Qt 4 QObject::connect() to Qt 5 style. \li QObject::connect() (Qt 4 style) + \row + \li Convert Comment to C/C++ Style + \li Converts C-style comments into C++-style comments, and vice + versa. Tries to preserve \e pretty layout and takes Doxygen and + qdoc formatting into consideration, but you might need to clean + up the results. + \li Code comment + \row + \li Move Function Documentation to Declaration/Definition + \li Moves the documentation comment for a function between its + declaration and definition. + \li Documentation comment for a function \endtable \section2 Refactoring QML Code From e3f33962e34444935f9ae381212875a7b4956b54 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 17 Oct 2023 09:23:50 +0200 Subject: [PATCH 1623/1777] CompilerExplorer: Fix highlighter for assembly Change-Id: Id58546d99232b19252c99da5018c1ce45a2e8dc5 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/compilerexplorer/compilerexplorereditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 14abaaed0b1..2fcb4f8f073 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -284,9 +284,9 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett m_asmEditor = new AsmEditorWidget(undoStack); m_asmDocument = QSharedPointer<TextDocument>(new TextDocument); - m_asmDocument->setFilePath("asm.asm"); m_asmEditor->setTextDocument(m_asmDocument); - m_asmEditor->configureGenericHighlighter(Utils::mimeTypeForName("text/x-asm")); + m_asmEditor->configureGenericHighlighter( + TextEditor::Highlighter::definitionForName("Intel x86 (NASM)")); m_asmEditor->setReadOnly(true); connect(m_asmEditor, &AsmEditorWidget::gotFocus, this, &CompilerWidget::gotFocus); From 1891c37b46dad7842c99669570c9cfdade663ac2 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 17 Oct 2023 09:24:21 +0200 Subject: [PATCH 1624/1777] CompilerExplorer: Fix restoring library selection Change-Id: Iae64cf8629495457e423d9e635b2ffcf912d89b8 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/compilerexplorer/compilerexploreraspects.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.cpp b/src/plugins/compilerexplorer/compilerexploreraspects.cpp index 35ec39ca62d..0ba5da377d6 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.cpp +++ b/src/plugins/compilerexplorer/compilerexploreraspects.cpp @@ -81,9 +81,9 @@ QVariant LibrarySelectionAspect::volatileVariantValue() const void LibrarySelectionAspect::setVariantValue(const QVariant &value, Announcement howToAnnounce) { QMap<QString, QString> map; - QVariantMap variant = value.toMap(); - for (const auto &key : variant.keys()) - map[key] = variant[key].toString(); + Store store = storeFromVariant(value); + for (const auto &key : store.keys()) + map[stringFromKey(key)] = store[key].toString(); setValue(map, howToAnnounce); } From 66f77f749ef8e61b2e93da5512e8f128f3386e95 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 17 Oct 2023 09:36:00 +0200 Subject: [PATCH 1625/1777] Copilot: Fix UI text for proxy settings Change-Id: I36854db711d697bd1cb0ffc8a646e00c97979e2f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/copilot/copilotsettings.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index 24e83618788..4ef4e2b2a9b 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -87,7 +87,7 @@ CopilotSettings::CopilotSettings() "Select path to agent.js in Copilot Neovim plugin. See " "https://github.com/github/copilot.vim#getting-started for installation instructions.")); - autoComplete.setDisplayName(Tr::tr("Auto Complete")); + autoComplete.setDisplayName(Tr::tr("Auto Request")); autoComplete.setSettingsKey("Copilot.Autocomplete"); autoComplete.setLabelText(Tr::tr("Auto request")); autoComplete.setDefaultValue(true); @@ -97,7 +97,7 @@ CopilotSettings::CopilotSettings() useProxy.setDisplayName(Tr::tr("Use Proxy")); useProxy.setSettingsKey("Copilot.UseProxy"); - useProxy.setLabelText(Tr::tr("Use Proxy")); + useProxy.setLabelText(Tr::tr("Use proxy")); useProxy.setDefaultValue(false); useProxy.setToolTip(Tr::tr("Use a proxy to connect to the Copilot servers.")); useProxy.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); @@ -105,14 +105,14 @@ CopilotSettings::CopilotSettings() proxyHost.setDisplayName(Tr::tr("Proxy Host")); proxyHost.setDisplayStyle(StringAspect::LineEditDisplay); proxyHost.setSettingsKey("Copilot.ProxyHost"); - proxyHost.setLabelText(Tr::tr("Proxy Host")); + proxyHost.setLabelText(Tr::tr("Proxy host")); proxyHost.setDefaultValue(""); proxyHost.setToolTip(Tr::tr("The host name of the proxy server.")); proxyHost.setHistoryCompleter("Copilot.ProxyHost.History"); proxyPort.setDisplayName(Tr::tr("Proxy Port")); proxyPort.setSettingsKey("Copilot.ProxyPort"); - proxyPort.setLabelText(Tr::tr("Proxy Port")); + proxyPort.setLabelText(Tr::tr("Proxy port")); proxyPort.setDefaultValue(3128); proxyPort.setToolTip(Tr::tr("The port of the proxy server.")); proxyPort.setRange(1, 65535); @@ -120,29 +120,29 @@ CopilotSettings::CopilotSettings() proxyUser.setDisplayName(Tr::tr("Proxy User")); proxyUser.setDisplayStyle(StringAspect::LineEditDisplay); proxyUser.setSettingsKey("Copilot.ProxyUser"); - proxyUser.setLabelText(Tr::tr("Proxy User")); + proxyUser.setLabelText(Tr::tr("Proxy user")); proxyUser.setDefaultValue(""); - proxyUser.setToolTip(Tr::tr("The user name for the proxy server.")); + proxyUser.setToolTip(Tr::tr("The user name to access the proxy server.")); proxyUser.setHistoryCompleter("Copilot.ProxyUser.History"); saveProxyPassword.setDisplayName(Tr::tr("Save Proxy Password")); saveProxyPassword.setSettingsKey("Copilot.SaveProxyPassword"); - saveProxyPassword.setLabelText(Tr::tr("Save Proxy Password")); + saveProxyPassword.setLabelText(Tr::tr("Save proxy password")); saveProxyPassword.setDefaultValue(false); saveProxyPassword.setToolTip( - Tr::tr("Save the password for the proxy server (Password is stored insecurely!).")); + Tr::tr("Save the password to access the proxy server. The password is stored insecurely.")); saveProxyPassword.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); proxyPassword.setDisplayName(Tr::tr("Proxy Password")); proxyPassword.setDisplayStyle(StringAspect::PasswordLineEditDisplay); proxyPassword.setSettingsKey("Copilot.ProxyPassword"); - proxyPassword.setLabelText(Tr::tr("Proxy Password")); + proxyPassword.setLabelText(Tr::tr("Proxy password")); proxyPassword.setDefaultValue(""); proxyPassword.setToolTip(Tr::tr("The password for the proxy server.")); proxyRejectUnauthorized.setDisplayName(Tr::tr("Reject Unauthorized")); proxyRejectUnauthorized.setSettingsKey("Copilot.ProxyRejectUnauthorized"); - proxyRejectUnauthorized.setLabelText(Tr::tr("Reject Unauthorized")); + proxyRejectUnauthorized.setLabelText(Tr::tr("Reject unauthorized")); proxyRejectUnauthorized.setDefaultValue(true); proxyRejectUnauthorized.setToolTip(Tr::tr("Reject unauthorized certificates from the proxy " "server. This is a security risk.")); From 2119ef72b0401d4e7e97107793b638e55b3b9204 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 16 Oct 2023 14:12:55 +0200 Subject: [PATCH 1626/1777] AutoTest: Fix creating test projects for cmake and qbs ...if the respective kits have no Qt configured. GTest and Catch2 get fixed with separate patches. Change-Id: Ib3eb92e97fd683f42e3666bd41728a3824e230ec Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../qtcreator/templates/wizards/autotest/boosttest/wizard.json | 3 +-- share/qtcreator/templates/wizards/autotest/qttest/wizard.json | 3 +-- .../qtcreator/templates/wizards/autotest/quicktest/wizard.json | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/share/qtcreator/templates/wizards/autotest/boosttest/wizard.json b/share/qtcreator/templates/wizards/autotest/boosttest/wizard.json index 4b674389bc4..01b79081268 100644 --- a/share/qtcreator/templates/wizards/autotest/boosttest/wizard.json +++ b/share/qtcreator/templates/wizards/autotest/boosttest/wizard.json @@ -8,7 +8,6 @@ "trDisplayCategory": "Test Project", "icon": "../autotest.png", "iconKind": "Themed", - "featuresRequired": [ "QtSupport.Wizards.FeatureDesktop" ], "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", "options": @@ -151,7 +150,7 @@ "enabled": "%{IsTopLevelProject}", "data": { "projectFilePath": "%{ProjectFilePath}", - "requiredFeatures": [ "%{JS: value('BuildSystem') === 'qmake' ? 'QtSupport.Wizards.FeatureQt' : 'QtSupport.Wizards.FeatureDesktop' }" ] + "requiredFeatures": [ "%{JS: value('BuildSystem') === 'qmake' ? 'QtSupport.Wizards.FeatureQt' : 'DeviceType.Desktop' }" ] } }, { diff --git a/share/qtcreator/templates/wizards/autotest/qttest/wizard.json b/share/qtcreator/templates/wizards/autotest/qttest/wizard.json index 75de005b3ad..0236a24a5ab 100644 --- a/share/qtcreator/templates/wizards/autotest/qttest/wizard.json +++ b/share/qtcreator/templates/wizards/autotest/qttest/wizard.json @@ -8,7 +8,6 @@ "trDisplayCategory": "Test Project", "icon": "../autotest.png", "iconKind": "Themed", - "featuresRequired": [ "QtSupport.Wizards.FeatureDesktop" ], "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", "options": @@ -128,7 +127,7 @@ "enabled": "%{IsTopLevelProject}", "data": { "projectFilePath": "%{ProjectFilePath}", - "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "QtSupport.Wizards.FeatureDesktop" ] + "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "DeviceType.Desktop" ] } }, { diff --git a/share/qtcreator/templates/wizards/autotest/quicktest/wizard.json b/share/qtcreator/templates/wizards/autotest/quicktest/wizard.json index e23fca42d98..bbcf7c41479 100644 --- a/share/qtcreator/templates/wizards/autotest/quicktest/wizard.json +++ b/share/qtcreator/templates/wizards/autotest/quicktest/wizard.json @@ -8,7 +8,6 @@ "trDisplayCategory": "Test Project", "icon": "../autotest.png", "iconKind": "Themed", - "featuresRequired": [ "QtSupport.Wizards.FeatureDesktop" ], "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", "options": @@ -123,7 +122,7 @@ "enabled": "%{IsTopLevelProject}", "data": { "projectFilePath": "%{ProjectFilePath}", - "requiredFeatures": [ "QtSupport.Wizards.FeatureQtQuick.2", "QtSupport.Wizards.FeatureDesktop" ] + "requiredFeatures": [ "QtSupport.Wizards.FeatureQtQuick.2", "DeviceType.Desktop" ] } }, { From 30e8a1db55c58311eb86e55ecb1f52794038d992 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Mon, 16 Oct 2023 23:41:55 +0200 Subject: [PATCH 1627/1777] ScreenRecorder: Switch from Experimental to DisabledByDefault Trivial plugins may apparently skip the experimental state on their introduction. At least according to the mutilple request towards me to do so with the ScreenRecorder plugin. Change-Id: I1e3d911ee79548d0fd72d3af0e3a568f6ab88d5a Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/screenrecorder/ScreenRecorder.json.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/screenrecorder/ScreenRecorder.json.in b/src/plugins/screenrecorder/ScreenRecorder.json.in index 2805bf7604b..87391fd4380 100644 --- a/src/plugins/screenrecorder/ScreenRecorder.json.in +++ b/src/plugins/screenrecorder/ScreenRecorder.json.in @@ -12,7 +12,7 @@ "", "Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html." ], - "Experimental" : true, + "DisabledByDefault" : true, "Description" : "Screen recording.", "Url" : "http://www.qt.io", ${IDE_PLUGIN_DEPENDENCIES} From effe73024f6c81aec83ddea4758f35a2533ac2f5 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Tue, 17 Oct 2023 10:40:51 +0200 Subject: [PATCH 1628/1777] AutoTest: Avoid duplicated logging category Change-Id: I6b8b56176f4f5e919badd87e7603f1b05a0f0245 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/autotest/testprojectsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/autotest/testprojectsettings.cpp b/src/plugins/autotest/testprojectsettings.cpp index b9c2312029e..0b75dd9804c 100644 --- a/src/plugins/autotest/testprojectsettings.cpp +++ b/src/plugins/autotest/testprojectsettings.cpp @@ -23,7 +23,7 @@ static const char SK_ACTIVE_FRAMEWORKS[] = "AutoTest.ActiveFrameworks"; static const char SK_RUN_AFTER_BUILD[] = "AutoTest.RunAfterBuild"; static const char SK_CHECK_STATES[] = "AutoTest.CheckStates"; -static Q_LOGGING_CATEGORY(LOG, "qtc.autotest.frameworkmanager", QtWarningMsg) +static Q_LOGGING_CATEGORY(LOG, "qtc.autotest.projectsettings", QtWarningMsg) TestProjectSettings::TestProjectSettings(ProjectExplorer::Project *project) : m_project(project) From e13c1a1239a02379da0e16fd5f9a73f0b877285f Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 17 Oct 2023 09:24:50 +0200 Subject: [PATCH 1629/1777] CompilerExplorer: Fix display of selected library Change-Id: I44085ef914930a16f14a2fc79e2941852dc2e4fb Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- .../compilerexploreraspects.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.cpp b/src/plugins/compilerexplorer/compilerexploreraspects.cpp index 0ba5da377d6..cf02893d770 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.cpp +++ b/src/plugins/compilerexplorer/compilerexploreraspects.cpp @@ -189,10 +189,20 @@ void LibrarySelectionAspect::addToLayout(Layouting::LayoutItem &parent) QStringList libs; for (int i = 0; i < m_model->rowCount(); i++) { QModelIndex idx = m_model->index(i, 0); - if (idx.data(SelectedVersion).isValid()) { - libs.append(QString("%1 %2") - .arg(idx.data().toString()) - .arg(idx.data(SelectedVersion).toString())); + if (idx.data(LibraryData).isValid() && idx.data(SelectedVersion).isValid()) { + auto libData = idx.data(LibraryData).value<Api::Library>(); + auto id = idx.data(SelectedVersion).toString(); + + auto versionIt = std::find_if(libData.versions.begin(), + libData.versions.end(), + [id](const Api::Library::Version &v) { + return v.id == id; + }); + const QString versionName = versionIt == libData.versions.end() + ? id + : versionIt->version; + + libs.append(QString("%1 %2").arg(libData.name).arg(versionName)); } } if (libs.empty()) From 2e2248e80e30243d638fe3b8a4a01ca71039301a Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 13 Oct 2023 20:48:08 +0200 Subject: [PATCH 1630/1777] CMakePM: Allow invalid file characters as part of preset names The fact that Qt Creator uses the preset name to create a directory and then import the directory is an implementation detail. This changeset will allow characters like ":" to be part of the preset name. Task-number: QTCREATORBUG-29643 Change-Id: I84a224b78eb3d2233f80d9bdb8bf4478471349b0 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectimporter.cpp | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index 6455ad3ea26..583729ee933 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -104,6 +104,40 @@ CMakeProjectImporter::CMakeProjectImporter(const FilePath &path, const CMakeProj } +using CharToHexList = QList<QPair<QString, QString>>; +static const CharToHexList &charToHexList() +{ + static const CharToHexList list = { + {"<", "{3C}"}, + {">", "{3E}"}, + {":", "{3A}"}, + {"\"", "{22}"}, + {"\\", "{5C}"}, + {"/", "{2F}"}, + {"|", "{7C}"}, + {"?", "{3F}"}, + {"*", "{2A}"}, + }; + + return list; +} + +static QString presetNameToFileName(const QString &name) +{ + QString fileName = name; + for (const auto &p : charToHexList()) + fileName.replace(p.first, p.second); + return fileName; +} + +static QString fileNameToPresetName(const QString &fileName) +{ + QString name = fileName; + for (const auto &p : charToHexList()) + name.replace(p.second, p.first); + return name; +} + FilePaths CMakeProjectImporter::importCandidates() { FilePaths candidates; @@ -129,7 +163,8 @@ FilePaths CMakeProjectImporter::importCandidates() continue; } - const FilePath configPresetDir = m_presetsTempDir.filePath(configPreset.name); + const FilePath configPresetDir = m_presetsTempDir.filePath( + presetNameToFileName(configPreset.name)); configPresetDir.createDir(); candidates << configPresetDir; @@ -638,7 +673,7 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath, if (importPath.isChildOf(m_presetsTempDir.path())) { auto data = std::make_unique<DirectoryData>(); - const QString presetName = importPath.fileName(); + const QString presetName = fileNameToPresetName(importPath.fileName()); PresetsDetails::ConfigurePreset configurePreset = Utils::findOrDefault(m_project->presetsData().configurePresets, [presetName](const PresetsDetails::ConfigurePreset &preset) { From ab23ee98f9ded7ea0318e0ab35d036edf6faf647 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 17 Oct 2023 13:19:25 +0200 Subject: [PATCH 1631/1777] PackageManager: Search for vcpkg in project root Change-Id: I467476e6897f36558afc76a262f631cdaa47320e Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/share/3rdparty/package-manager/auto-setup.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/3rdparty/package-manager/auto-setup.cmake b/src/share/3rdparty/package-manager/auto-setup.cmake index eafdb91aa68..caa8eeddb81 100644 --- a/src/share/3rdparty/package-manager/auto-setup.cmake +++ b/src/share/3rdparty/package-manager/auto-setup.cmake @@ -165,7 +165,7 @@ macro(qtc_auto_setup_vcpkg) if (EXISTS "${CMAKE_SOURCE_DIR}/vcpkg.json" AND NOT QT_CREATOR_SKIP_VCPKG_SETUP) option(QT_CREATOR_SKIP_VCPKG_SETUP "Skip Qt Creator's vcpkg package manager auto-setup" OFF) - find_program(vcpkg_program vcpkg) + find_program(vcpkg_program vcpkg ${CMAKE_SOURCE_DIR}/vcpkg) if (NOT vcpkg_program) message(WARNING "Qt Creator: vcpkg executable not found. " "Package manager auto-setup will be skipped. " From fdeff13ca336b5288a441ad3d7cab358eee4112b Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 17 Oct 2023 15:13:45 +0200 Subject: [PATCH 1632/1777] TextEditor: Don't export KSyntaxHighlighting Change-Id: I84fa8c758af412d8847391a628deac60279b9448 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/compilerexplorer/compilerexplorereditor.cpp | 5 +++-- src/plugins/texteditor/highlighter.h | 3 +-- src/plugins/texteditor/texteditor.cpp | 7 ++++++- src/plugins/texteditor/texteditor.h | 3 +-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 2fcb4f8f073..c6040d65a42 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -285,8 +285,9 @@ CompilerWidget::CompilerWidget(const std::shared_ptr<SourceSettings> &sourceSett m_asmEditor = new AsmEditorWidget(undoStack); m_asmDocument = QSharedPointer<TextDocument>(new TextDocument); m_asmEditor->setTextDocument(m_asmDocument); - m_asmEditor->configureGenericHighlighter( - TextEditor::Highlighter::definitionForName("Intel x86 (NASM)")); + QTC_ASSERT_EXPECTED(m_asmEditor->configureGenericHighlighter("Intel x86 (NASM)"), + m_asmEditor->configureGenericHighlighter( + Utils::mimeTypeForName("text/x-asm"))); m_asmEditor->setReadOnly(true); connect(m_asmEditor, &AsmEditorWidget::gotFocus, this, &CompilerWidget::gotFocus); diff --git a/src/plugins/texteditor/highlighter.h b/src/plugins/texteditor/highlighter.h index b3f10d0671d..0183c9c171e 100644 --- a/src/plugins/texteditor/highlighter.h +++ b/src/plugins/texteditor/highlighter.h @@ -13,8 +13,7 @@ namespace TextEditor { class TextDocument; -class TEXTEDITOR_EXPORT Highlighter : public SyntaxHighlighter, - public KSyntaxHighlighting::AbstractHighlighter +class Highlighter : public SyntaxHighlighter, public KSyntaxHighlighting::AbstractHighlighter { Q_OBJECT Q_INTERFACES(KSyntaxHighlighting::AbstractHighlighter) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 70265e14a47..ab1ab4cbc42 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -9068,10 +9068,15 @@ void TextEditorWidget::configureGenericHighlighter(const Utils::MimeType &mimeTy d->removeSyntaxInfoBar(); } -void TextEditorWidget::configureGenericHighlighter(const Highlighter::Definition &definition) +expected_str<void> TextEditorWidget::configureGenericHighlighter(const QString &definitionName) { + Highlighter::Definition definition = TextEditor::Highlighter::definitionForName(definitionName); + if (!definition.isValid()) + return make_unexpected(Tr::tr("Could not find definition")); + d->configureGenericHighlighter(definition); d->removeSyntaxInfoBar(); + return {}; } int TextEditorWidget::blockNumberForVisibleRow(int row) const diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index 2af45826368..0abe3305639 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -6,7 +6,6 @@ #include "texteditor_global.h" #include "codeassist/assistenums.h" -#include "highlighter.h" #include "indenter.h" #include "refactoroverlay.h" #include "snippets/snippetparser.h" @@ -455,7 +454,7 @@ public: void configureGenericHighlighter(const Utils::MimeType &mimeType); /// Overwrite the current highlighter with a new generic highlighter based on the given definition - void configureGenericHighlighter(const Highlighter::Definition &definition); + Utils::expected_str<void> configureGenericHighlighter(const QString &definitionName); Q_INVOKABLE void inSnippetMode(bool *active); // Used by FakeVim. From 879692381fdfaa3343cb0078b1ee1504dbe56184 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 17 Oct 2023 15:40:40 +0200 Subject: [PATCH 1633/1777] CMakePM: Fix conan default profile auto-detection CONAN_COMMAND was not available for `conan_profile_detect_default` function. Change-Id: I03df06aa88e6588101bb5ec54b3ce2cb64dee2c8 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/share/3rdparty/package-manager/auto-setup.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/3rdparty/package-manager/auto-setup.cmake b/src/share/3rdparty/package-manager/auto-setup.cmake index caa8eeddb81..526dd333fa7 100644 --- a/src/share/3rdparty/package-manager/auto-setup.cmake +++ b/src/share/3rdparty/package-manager/auto-setup.cmake @@ -102,11 +102,11 @@ macro(qtc_auto_setup_conan) project(conan-setup) if (${conan_version} VERSION_GREATER_EQUAL 2.0) + set(CONAN_COMMAND \"${conan_program}\") include(\"${CMAKE_CURRENT_LIST_DIR}/conan_provider.cmake\") conan_profile_detect_default() detect_host_profile(\"${CMAKE_BINARY_DIR}/conan-dependencies/conan_host_profile\") - set(CONAN_COMMAND \"${conan_program}\") conan_install( -pr \"${CMAKE_BINARY_DIR}/conan-dependencies/conan_host_profile\" --build=${QT_CREATOR_CONAN_BUILD_POLICY} From 058a931d271ee544ffce48654ff1c21f67da47e1 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 17 Oct 2023 15:06:41 +0200 Subject: [PATCH 1634/1777] ProjectExplorer: Manually check whether a runconfig has a creator This is used in ProjectConfigurationModel::data() Constructing the full list is comparatively expensive, and the extra decoration is not needed. Change-Id: I5b6c76376f806ea92444916a87d1f2e671e16d5f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../projectconfigurationmodel.cpp | 2 +- .../projectexplorer/runconfiguration.cpp | 30 +++++++++++++++---- .../projectexplorer/runconfiguration.h | 7 +++-- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/plugins/projectexplorer/projectconfigurationmodel.cpp b/src/plugins/projectexplorer/projectconfigurationmodel.cpp index 23b790a4943..f2b731a6e1a 100644 --- a/src/plugins/projectexplorer/projectconfigurationmodel.cpp +++ b/src/plugins/projectexplorer/projectconfigurationmodel.cpp @@ -93,9 +93,9 @@ QVariant ProjectConfigurationModel::data(const QModelIndex &index, int role) con { if (index.row() >= m_projectConfigurations.size()) return {}; - ProjectConfiguration * const config = m_projectConfigurations.at(index.row()); if (role == Qt::DisplayRole) { + ProjectConfiguration * const config = m_projectConfigurations.at(index.row()); QString displayName = config->expandedDisplayName(); if (const auto rc = qobject_cast<RunConfiguration *>(config); rc && !rc->hasCreator()) displayName += QString(" [%1]").arg(Tr::tr("unavailable")); diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index f6cb72bde84..4a1e03d031d 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -140,6 +140,8 @@ void GlobalOrProjectAspect::resetProjectToGlobalSettings() static std::vector<RunConfiguration::AspectFactory> theAspectFactories; +static QList<RunConfigurationFactory *> g_runConfigurationFactories; + RunConfiguration::RunConfiguration(Target *target, Utils::Id id) : ProjectConfiguration(target, id) { @@ -236,10 +238,13 @@ bool RunConfiguration::isCustomized() const bool RunConfiguration::hasCreator() const { - return Utils::contains(RunConfigurationFactory::creatorsForTarget(target()), - [this](const RunConfigurationCreationInfo &info) { - return info.factory->runConfigurationId() == id() && info.buildKey == buildKey(); - }); + for (RunConfigurationFactory *factory : std::as_const(g_runConfigurationFactories)) { + if (factory->runConfigurationId() == id()) { + if (factory->supportsBuildKey(target(), buildKey())) + return true; + } + } + return false; } void RunConfiguration::setPristineState() @@ -453,8 +458,6 @@ QVariantHash RunConfiguration::extraData() const ExtensionSystem::IPlugin::initialize() method. */ -static QList<RunConfigurationFactory *> g_runConfigurationFactories; - /*! Constructs a RunConfigurationFactory instance and registers it into a global list. @@ -522,6 +525,14 @@ RunConfigurationFactory::availableCreators(Target *target) const }); } +bool RunConfigurationFactory::supportsBuildKey(Target *target, const QString &key) const +{ + if (!canHandle(target)) + return false; + const QList<BuildTargetInfo> buildTargets = target->buildSystem()->applicationTargets(); + return anyOf(buildTargets, [&key](const BuildTargetInfo &info) { return info.buildKey == key; }); +} + /*! Adds a device type for which this RunConfigurationFactory can create RunConfigurations. @@ -674,4 +685,11 @@ FixedRunConfigurationFactory::availableCreators(Target *parent) const return {rci}; } +bool FixedRunConfigurationFactory::supportsBuildKey(Target *target, const QString &key) const +{ + Q_UNUSED(target) + Q_UNUSED(key) + return false; +} + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 85c770a5d36..629fcd2c614 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -197,6 +197,7 @@ public: protected: virtual QList<RunConfigurationCreationInfo> availableCreators(Target *target) const; + virtual bool supportsBuildKey(Target *target, const QString &key) const; using RunConfigurationCreator = std::function<RunConfiguration *(Target *)>; @@ -218,6 +219,7 @@ private: RunConfiguration *create(Target *target) const; friend class RunConfigurationCreationInfo; + friend class RunConfiguration; RunConfigurationCreator m_creator; Utils::Id m_runConfigurationId; QList<Utils::Id> m_supportedProjectTypes; @@ -231,9 +233,10 @@ public: explicit FixedRunConfigurationFactory(const QString &displayName, bool addDeviceName = false); - QList<RunConfigurationCreationInfo> availableCreators(Target *parent) const override; - private: + QList<RunConfigurationCreationInfo> availableCreators(Target *parent) const override; + bool supportsBuildKey(Target *target, const QString &key) const override; + const QString m_fixedBuildTarget; const bool m_decorateTargetName; }; From b38c7a452e79f424e8ea9133b329d3cd4661af26 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 17 Oct 2023 16:42:14 +0200 Subject: [PATCH 1635/1777] CMakeProjectManager: Fix path construction of pch files This triggered soft asserts in FileUtils::copyIfDifferent() when opening top-level qt. Amends 246f33c20d which introduced a unwanted extra .parentDir() call which removed part of the path. Change-Id: Id0475a74a589372d37b7ec65d33d3faf6194013c Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/fileapidataextractor.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index fd492289555..79b17536bb3 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -497,10 +497,7 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture return si.path.endsWith(ending); }).path); if (!precompiled_header.isEmpty()) { - if (precompiled_header.toFileInfo().isRelative()) { - const FilePath parentDir = sourceDirectory.parentDir(); - precompiled_header = parentDir.pathAppended(precompiled_header.toString()); - } + precompiled_header = sourceDirectory.resolvePath(precompiled_header); // Remove the CMake PCH usage command line options in order to avoid the case // when the build system would produce a .pch/.gch file that would be treated From 8845a7f896e2b7a6b206f96844e176eb5f7e2755 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 17 Oct 2023 16:51:48 +0200 Subject: [PATCH 1636/1777] CMakeProjectManager: Use a few FilePath::path() instead of toString() ... when appropriate. Change-Id: I2c23e4688ec69f78b0ce873e578139d5c4e89c35 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../cmakeprojectmanager/fileapidataextractor.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 79b17536bb3..7e469238058 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -509,17 +509,17 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture fragments.erase(foundPos, std::next(foundPos, args.size())); }; - remove({"-Xclang", "-include-pch", "-Xclang", precompiled_header.toString() + ".gch"}); - remove({"-Xclang", "-include-pch", "-Xclang", precompiled_header.toString() + ".pch"}); - remove({"-Xclang", "-include", "-Xclang", precompiled_header.toString()}); - remove({"-include", precompiled_header.toString()}); - remove({"/FI", precompiled_header.toString()}); + remove({"-Xclang", "-include-pch", "-Xclang", precompiled_header.path() + ".gch"}); + remove({"-Xclang", "-include-pch", "-Xclang", precompiled_header.path() + ".pch"}); + remove({"-Xclang", "-include", "-Xclang", precompiled_header.path()}); + remove({"-include", precompiled_header.path()}); + remove({"/FI", precompiled_header.path()}); // Make a copy of the CMake PCH header and use it instead FilePath qtc_precompiled_header = precompiled_header.parentDir().pathAppended(qtcPchFile); FileUtils::copyIfDifferent(precompiled_header, qtc_precompiled_header); - rpp.setPreCompiledHeaders({qtc_precompiled_header.toString()}); + rpp.setPreCompiledHeaders({qtc_precompiled_header.path()}); } RawProjectPartFlags cProjectFlags; From b5dec80d6b64253ff66f755e1ca0d87e58cd2f12 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Fri, 13 Oct 2023 12:47:08 +0200 Subject: [PATCH 1637/1777] ProjectExplorer: Don't create Replacement kits for Design Studio It's not wanted in this use case Fixes: QTCREATORBUG-29717 Change-Id: I04ccd4c9e8bfe15e76294a42f3f0bd9d879599e5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/projectexplorer/project.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 320df648064..20c65655627 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -821,7 +821,7 @@ void Project::createTargetFromMap(const Store &map, int index) } Kit *k = KitManager::kit(id); - if (!k) { + if (!k && !ICore::isQtDesignStudio()) { Id deviceTypeId = Id::fromSetting(targetMap.value(Target::deviceTypeKey())); if (!deviceTypeId.isValid()) deviceTypeId = Constants::DESKTOP_DEVICE_TYPE; From 53b325525639764bfc2972ae48877f055bd3e904 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 17 Oct 2023 17:11:53 +0200 Subject: [PATCH 1638/1777] CMake: De-noise fileapidataextractor.cpp a bit Change-Id: I1ed8b18e394246cbfd14394c7f9b79fd90f680d2 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../fileapidataextractor.cpp | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 7e469238058..ed5e64b3874 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -11,14 +11,14 @@ #include <cppeditor/cppeditorconstants.h> +#include <projectexplorer/projecttree.h> + #include <utils/algorithm.h> #include <utils/icon.h> #include <utils/mimeutils.h> #include <utils/process.h> #include <utils/qtcassert.h> -#include <projectexplorer/projecttree.h> - #include <QLoggingCategory> #include <QtConcurrent> @@ -39,10 +39,10 @@ class CMakeFileResult public: QSet<CMakeFileInfo> cmakeFiles; - std::vector<std::unique_ptr<ProjectExplorer::FileNode>> cmakeNodesSource; - std::vector<std::unique_ptr<ProjectExplorer::FileNode>> cmakeNodesBuild; - std::vector<std::unique_ptr<ProjectExplorer::FileNode>> cmakeNodesOther; - std::vector<std::unique_ptr<ProjectExplorer::FileNode>> cmakeListNodes; + std::vector<std::unique_ptr<FileNode>> cmakeNodesSource; + std::vector<std::unique_ptr<FileNode>> cmakeNodesBuild; + std::vector<std::unique_ptr<FileNode>> cmakeNodesOther; + std::vector<std::unique_ptr<FileNode>> cmakeListNodes; }; static CMakeFileResult extractCMakeFilesData(const QFuture<void> &cancelFuture, @@ -132,10 +132,10 @@ public: QSet<CMakeFileInfo> cmakeFiles; - std::vector<std::unique_ptr<ProjectExplorer::FileNode>> cmakeNodesSource; - std::vector<std::unique_ptr<ProjectExplorer::FileNode>> cmakeNodesBuild; - std::vector<std::unique_ptr<ProjectExplorer::FileNode>> cmakeNodesOther; - std::vector<std::unique_ptr<ProjectExplorer::FileNode>> cmakeListNodes; + std::vector<std::unique_ptr<FileNode>> cmakeNodesSource; + std::vector<std::unique_ptr<FileNode>> cmakeNodesBuild; + std::vector<std::unique_ptr<FileNode>> cmakeNodesOther; + std::vector<std::unique_ptr<FileNode>> cmakeListNodes; Configuration codemodel; std::vector<TargetDetails> targetDetails; @@ -259,7 +259,7 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t, } if (ct.targetType == ExecutableType) { - Utils::FilePaths librarySeachPaths; + FilePaths librarySeachPaths; // Is this a GUI application? ct.linksToQtGui = Utils::contains(t.link.value().fragments, [](const FragmentInfo &f) { @@ -531,8 +531,8 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture rpp.setFlagsForCxx(cxxProjectFlags); const bool isExecutable = t.type == "EXECUTABLE"; - rpp.setBuildTargetType(isExecutable ? ProjectExplorer::BuildTargetType::Executable - : ProjectExplorer::BuildTargetType::Library); + rpp.setBuildTargetType(isExecutable ? BuildTargetType::Executable + : BuildTargetType::Library); rpps.append(rpp); ++count; } @@ -562,7 +562,7 @@ static FilePath directoryBuildDir(const Configuration &c, } static void addProjects(const QFuture<void> &cancelFuture, - const QHash<Utils::FilePath, ProjectNode *> &cmakeListsNodes, + const QHash<FilePath, ProjectNode *> &cmakeListsNodes, const Configuration &config, const FilePath &sourceDir) { @@ -606,15 +606,15 @@ static FolderNode *createSourceGroupNode(const QString &sourceGroupName, } static void addCompileGroups(ProjectNode *targetRoot, - const Utils::FilePath &topSourceDirectory, - const Utils::FilePath &sourceDirectory, - const Utils::FilePath &buildDirectory, + const FilePath &topSourceDirectory, + const FilePath &sourceDirectory, + const FilePath &buildDirectory, const TargetDetails &td) { const bool showSourceFolders = settings().showSourceSubFolders(); const bool inSourceBuild = (sourceDirectory == buildDirectory); - QSet<Utils::FilePath> alreadyListed; + QSet<FilePath> alreadyListed; // Files already added by other configurations: targetRoot->forEachGenericNode( @@ -661,7 +661,7 @@ static void addCompileGroups(ProjectNode *targetRoot, if (baseDirectory.isEmpty()) { baseDirectory = fn->filePath().parentDir(); } else { - baseDirectory = Utils::FileUtils::commonPath(baseDirectory, fn->filePath()); + baseDirectory = FileUtils::commonPath(baseDirectory, fn->filePath()); } } @@ -684,7 +684,7 @@ static void addCompileGroups(ProjectNode *targetRoot, Tr::tr("<Build Directory>"), std::move(buildFileNodes)); addCMakeVFolder(targetRoot, - Utils::FilePath(), + FilePath(), 10, Tr::tr("<Other Locations>"), std::move(otherFileNodes)); @@ -713,7 +713,7 @@ static void addGeneratedFilesNode(ProjectNode *targetRoot, const FilePath &topLe } static void addTargets(const QFuture<void> &cancelFuture, - const QHash<Utils::FilePath, ProjectExplorer::ProjectNode *> &cmakeListsNodes, + const QHash<FilePath, ProjectNode *> &cmakeListsNodes, const Configuration &config, const std::vector<TargetDetails> &targetDetails, const FilePath &sourceDir, @@ -854,14 +854,12 @@ static void setupLocationInfoForTargets(const QFuture<void> &cancelFuture, } } -using namespace FileApiDetails; - // -------------------------------------------------------------------- // extractData: // -------------------------------------------------------------------- FileApiQtcData extractData(const QFuture<void> &cancelFuture, FileApiData &input, - const Utils::FilePath &sourceDir, const Utils::FilePath &buildDir) + const FilePath &sourceDir, const FilePath &buildDir) { FileApiQtcData result; From df9808562f3cdb7a2cdd95c7733659db4ed234f0 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 17 Oct 2023 17:49:54 +0200 Subject: [PATCH 1639/1777] Vcpkg: Fix a vcpkg detection regression Amends: ec7abcf98c5915364cd354d8ee62c645bcdd3a8d Change-Id: If1e8c124208b2d8eeea22b1b88f80b325c4d2efb Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/vcpkg/vcpkgsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/vcpkg/vcpkgsettings.cpp b/src/plugins/vcpkg/vcpkgsettings.cpp index da91ef486b6..c0c5156d94f 100644 --- a/src/plugins/vcpkg/vcpkgsettings.cpp +++ b/src/plugins/vcpkg/vcpkgsettings.cpp @@ -37,7 +37,7 @@ VcpkgSettings::VcpkgSettings() vcpkgRoot.setExpectedKind(PathChooser::ExistingDirectory); FilePath defaultPath = Environment::systemEnvironment().searchInPath(Constants::VCPKG_COMMAND) .parentDir(); - if (defaultPath.isDir()) + if (!defaultPath.isDir()) defaultPath = FilePath::fromUserInput(qtcEnvironmentVariable(Constants::ENVVAR_VCPKG_ROOT)); if (defaultPath.isDir()) vcpkgRoot.setDefaultValue(defaultPath.toUserOutput()); From 70e9c2685fb75edab6af8ee2b889f868c945aeea Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 17 Oct 2023 18:43:57 +0200 Subject: [PATCH 1640/1777] vcpkg: Set VCPKG_ROOT environment variable for Qt Creator process This way CMakeProjectManager's auto-setup.cmake would pick it up and find vcpkg.exe Change-Id: Iafa84f13e0f50321ce771fc687ecc9e2df148de7 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/vcpkg/vcpkgplugin.cpp | 3 +++ src/plugins/vcpkg/vcpkgsettings.cpp | 8 ++++++++ src/plugins/vcpkg/vcpkgsettings.h | 2 ++ src/share/3rdparty/package-manager/auto-setup.cmake | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/plugins/vcpkg/vcpkgplugin.cpp b/src/plugins/vcpkg/vcpkgplugin.cpp index 2a0153d49ad..9dc717e08e1 100644 --- a/src/plugins/vcpkg/vcpkgplugin.cpp +++ b/src/plugins/vcpkg/vcpkgplugin.cpp @@ -5,6 +5,7 @@ #include "vcpkg_test.h" #endif // WITH_TESTS #include "vcpkgmanifesteditor.h" +#include "vcpkgsettings.h" #include <extensionsystem/iplugin.h> @@ -35,6 +36,8 @@ public: #endif } + virtual void extensionsInitialized() final { settings().setVcpkgRootEnvironmentVariable(); } + std::unique_ptr<VcpkgPluginPrivate> d; }; diff --git a/src/plugins/vcpkg/vcpkgsettings.cpp b/src/plugins/vcpkg/vcpkgsettings.cpp index c0c5156d94f..4ea4496519d 100644 --- a/src/plugins/vcpkg/vcpkgsettings.cpp +++ b/src/plugins/vcpkg/vcpkgsettings.cpp @@ -42,6 +42,8 @@ VcpkgSettings::VcpkgSettings() if (defaultPath.isDir()) vcpkgRoot.setDefaultValue(defaultPath.toUserOutput()); + connect(this, &AspectContainer::applied, this, &VcpkgSettings::setVcpkgRootEnvironmentVariable); + setLayouter([this] { using namespace Layouting; auto websiteButton = new QToolButton; @@ -70,6 +72,12 @@ VcpkgSettings::VcpkgSettings() readSettings(); } +void VcpkgSettings::setVcpkgRootEnvironmentVariable() +{ + // Set VCPKG_ROOT environment variable so that auto-setup.cmake would pick it up + Environment::modifySystemEnvironment({{Constants::ENVVAR_VCPKG_ROOT, vcpkgRoot.value()}}); +} + class VcpkgSettingsPage : public Core::IOptionsPage { public: diff --git a/src/plugins/vcpkg/vcpkgsettings.h b/src/plugins/vcpkg/vcpkgsettings.h index dd266ad3716..acb41110b40 100644 --- a/src/plugins/vcpkg/vcpkgsettings.h +++ b/src/plugins/vcpkg/vcpkgsettings.h @@ -12,6 +12,8 @@ class VcpkgSettings : public Utils::AspectContainer public: VcpkgSettings(); + void setVcpkgRootEnvironmentVariable(); + Utils::FilePathAspect vcpkgRoot{this}; }; diff --git a/src/share/3rdparty/package-manager/auto-setup.cmake b/src/share/3rdparty/package-manager/auto-setup.cmake index 526dd333fa7..f6e6ce129aa 100644 --- a/src/share/3rdparty/package-manager/auto-setup.cmake +++ b/src/share/3rdparty/package-manager/auto-setup.cmake @@ -165,7 +165,7 @@ macro(qtc_auto_setup_vcpkg) if (EXISTS "${CMAKE_SOURCE_DIR}/vcpkg.json" AND NOT QT_CREATOR_SKIP_VCPKG_SETUP) option(QT_CREATOR_SKIP_VCPKG_SETUP "Skip Qt Creator's vcpkg package manager auto-setup" OFF) - find_program(vcpkg_program vcpkg ${CMAKE_SOURCE_DIR}/vcpkg) + find_program(vcpkg_program vcpkg $ENV{VCPKG_ROOT} ${CMAKE_SOURCE_DIR}/vcpkg) if (NOT vcpkg_program) message(WARNING "Qt Creator: vcpkg executable not found. " "Package manager auto-setup will be skipped. " From 865b6d57773c39da9ea54539af908fdd425af97a Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 17 Oct 2023 16:47:38 +0200 Subject: [PATCH 1641/1777] Doc: Add paths to options and links to docs to the change log Change-Id: I1c9ae020a7af9a0a88c7204cb90569b2f37f2c67 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- dist/changelog/changes-12.0.0.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 0c5f7d211e6..53ad7d575f1 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -66,9 +66,11 @@ General `Edit > Preferences > Environment > Locator` to keep the sorting from the tool used for the file system index locator filter ([QTCREATORBUG-27789](https://bugreports.qt.io/browse/QTCREATORBUG-27789)) + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-editor-locator.html#locating-files-from-global-file-system-index)) * Added the `View > Show Menubar` option to hide the menu bar on platforms without a unified menu bar ([QTCREATORBUG-29498](https://bugreports.qt.io/browse/QTCREATORBUG-29498)) + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-show-and-hide-main-menu.html)) * Fixed an issue with growing session files Help @@ -77,13 +79,17 @@ Help * Added the `Edit > Preferences > Help > General > Antialias` check box for setting the anti-aliasing of text ([QTCREATORBUG-12177](https://bugreports.qt.io/browse/QTCREATORBUG-12177)) + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-get-help.html#change-the-font)) Editing ------- * Added the count of selected characters to line and column information + on the `Edit` mode toolbar ([QTCREATORBUG-29381](https://bugreports.qt.io/browse/QTCREATORBUG-29381)) + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-coding-navigating.html#navigating-between-open-files-and-symbols)) * Added an indenter, auto-brace and auto-quote for JSON + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-enclose-code-in-characters.html)) * Fixed that the historical order of open documents was not restored * Fixed that suggestions were rendered with the wrong tab size ([QTCREATORBUG-29483](https://bugreports.qt.io/browse/QTCREATORBUG-29483)) @@ -93,11 +99,15 @@ Editing * Updated to LLVM 17.0.1 * Added `Tools > C++ > Fold All Comment Blocks` and `Unfold All Comment Blocks` ([QTCREATORBUG-2449](https://bugreports.qt.io/browse/QTCREATORBUG-2449)) -* Added a refactoring action for converting comments between C++-style and + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-highlighting.html#folding-blocks)) +* Added the `Convert Comment to C Style` and `Convert Comment to C++ Style` + refactoring actions for converting comments between C++-style and C-style ([QTCREATORBUG-27501](https://bugreports.qt.io/browse/QTCREATORBUG-27501)) -* Added a refactoring action for moving documentation between function - declaration and definition + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-editor-quick-fixes.html#refactoring-c-code)) +* Added the `Move Function Documentation to Declaration` and + `Move Function Documentation to Definition` refactoring actions for moving + documentation between function declaration and definition ([QTCREATORBUG-13877](https://bugreports.qt.io/browse/QTCREATORBUG-13877)) * Extended the application of renaming operations to documentation comments ([QTCREATORBUG-12051](https://bugreports.qt.io/browse/QTCREATORBUG-12051), @@ -130,13 +140,15 @@ Editing ### Language Server Protocol -* Added support for Language servers that request creating, renaming or deleting of files +* Added support for Language servers that request creating, renaming, or deleting + of files ([QTCREATORBUG-29542](https://bugreports.qt.io/browse/QTCREATORBUG-29542)) ### Copilot * Added support for proxies ([QTCREATORBUG-29485](https://bugreports.qt.io/browse/QTCREATORBUG-29485)) + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-copilot.html)) ### TODO @@ -145,6 +157,7 @@ Editing ### Markdown * Added buttons and configurable shortcuts for text styles + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-markdown-editor.html)) ### Images From 5d79b010bf739dd0d200649ef13618be36256626 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 17 Oct 2023 16:45:08 +0200 Subject: [PATCH 1642/1777] Doc: Describe the Markdown editor toolbar buttons Task-number: QTCREATORBUG-29392 Change-Id: I390e2c525f9c1c6cadf874cfc313b17429f1f52a Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../images/qtcreator-markdown-editor.webp | Bin 22486 -> 23288 bytes .../creator-only/creator-markdown-editor.qdoc | 6 ++++++ 2 files changed, 6 insertions(+) diff --git a/doc/qtcreator/images/qtcreator-markdown-editor.webp b/doc/qt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_OgIg=K3exjk28sC%W#fpD6%{=!S)Rq19hWY%pm(oX0SLt2QpPjj99`~c^ zXI0|Pv;ImomXq7E!_sKc;&`*@+n=8;jW-jvT+IA4_43L3pNnLQQ||02ah3v)Rrx$F z<_D$xkKkTC%RJ@g*tg4acYNP)>E|71&?upeJm1IDX;JmO=U4pi`F8fzjQX?lt62YM z8o0B4Je{V|ZQ1Wozk6by<NTbac(cQrTwnF3yUYM>>v>sZdbQQE@xUGD4n8As0bl;l zN7X9USTjC5;jllas-}YP`Lo7ien(jgae-L=k4M$caH?>AgDmGeA9_ym*)zvIuUEV~ zXwW>*uRieOnpCDUps}?Q$9FpoIIlAnGX{Q*@Th-&c5?m$#xtBP3*H|zh~@t{LsO}C z<xG!*mW>boEaa&+@VVN&@5U3E*{_zJx&Hd+Io2bu@Bau=+gHr!x&OyGRu#Vk3;-$J BaRUGV diff --git a/doc/qtcreator/src/editors/creator-only/creator-markdown-editor.qdoc b/doc/qtcreator/src/editors/creator-only/creator-markdown-editor.qdoc index 9a3d2444e61..95b31c2fd15 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-markdown-editor.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-markdown-editor.qdoc @@ -19,4 +19,10 @@ To hide and show the views, select \uicontrol {Show Preview} and \uicontrol {Show Editor}. To swap the places of the views, select \uicontrol {Swap Views}. + + \section1 Formatting Text + + Use the buttons on the editor toolbar to format text as italic (i), bold (b), + or inline code (`), and to create links to web sites + (\inlineimage icons/linkicon.png). */ From 755eefcbb2ae46bf516fa40d5c98d83a4ffbd23c Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 13 Oct 2023 12:28:52 +0200 Subject: [PATCH 1643/1777] Core: Refactor logging viewer * All log categories that were ever used are captured. * Fixed various small issues. * Allow disabling individual logging types. * Add Splitter between messages and categories. * No longer needs to interpret or change QT_LOGGING_RULES. Change-Id: I33be4754d550064bc66274f655a59e7af67ae487 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/coreplugin/CMakeLists.txt | 2 - src/plugins/coreplugin/coreplugin.cpp | 7 +- src/plugins/coreplugin/coreplugin.qbs | 2 - src/plugins/coreplugin/loggingmanager.cpp | 304 ------ src/plugins/coreplugin/loggingmanager.h | 121 --- src/plugins/coreplugin/loggingviewer.cpp | 1114 +++++++++++++-------- src/plugins/coreplugin/loggingviewer.h | 7 +- 7 files changed, 720 insertions(+), 837 deletions(-) delete mode 100644 src/plugins/coreplugin/loggingmanager.cpp delete mode 100644 src/plugins/coreplugin/loggingmanager.h diff --git a/src/plugins/coreplugin/CMakeLists.txt b/src/plugins/coreplugin/CMakeLists.txt index d7f04d88ed5..6079989c718 100644 --- a/src/plugins/coreplugin/CMakeLists.txt +++ b/src/plugins/coreplugin/CMakeLists.txt @@ -209,8 +209,6 @@ add_qtc_plugin(Core locator/spotlightlocatorfilter.h locator/urllocatorfilter.cpp locator/urllocatorfilter.h - loggingmanager.cpp - loggingmanager.h loggingviewer.cpp loggingviewer.h manhattanstyle.cpp diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index dca909d0752..bfd0669c338 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -9,18 +9,18 @@ #include "icore.h" #include "idocument.h" #include "iwizardfactory.h" +#include "loggingviewer.h" #include "modemanager.h" #include "session.h" #include "settingsdatabase.h" #include "themechooser.h" #include "actionmanager/actionmanager.h" +#include "coreconstants.h" #include "documentmanager.h" -#include "editormanager/editormanager.h" +#include "fileutils.h" #include "find/findplugin.h" #include "locator/locator.h" -#include "coreconstants.h" -#include "fileutils.h" #include <extensionsystem/pluginerroroverview.h> #include <extensionsystem/pluginmanager.h> @@ -490,6 +490,7 @@ QString CorePlugin::msgCrashpadInformation() ExtensionSystem::IPlugin::ShutdownFlag CorePlugin::aboutToShutdown() { + LoggingViewer::hideLoggingView(); Find::aboutToShutdown(); m_locator->aboutToShutdown(); ICore::aboutToShutdown(); diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index 37c8a9b73f8..9bd3923a6fb 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -102,8 +102,6 @@ QtcPlugin { "iwizardfactory.h", "jsexpander.cpp", "jsexpander.h", - "loggingmanager.cpp", - "loggingmanager.h", "loggingviewer.cpp", "loggingviewer.h", "manhattanstyle.cpp", diff --git a/src/plugins/coreplugin/loggingmanager.cpp b/src/plugins/coreplugin/loggingmanager.cpp deleted file mode 100644 index 608e7ce4706..00000000000 --- a/src/plugins/coreplugin/loggingmanager.cpp +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "loggingmanager.h" - -#include <utils/environment.h> -#include <utils/filepath.h> - -#include <QCoreApplication> -#include <QDateTime> -#include <QLibraryInfo> -#include <QRegularExpression> -#include <QSettings> -#include <QStandardPaths> - -// -// WARNING! Do not use qDebug(), qWarning() or similar inside this file - -// same applies for indirect usages (e.g. QTC_ASSERT() and the like). -// Using static functions of QLoggingCategory may cause dead locks as well. -// - -using namespace Utils; - -namespace Core { -namespace Internal { - -static QtMessageHandler s_originalMessageHandler = nullptr; - -static LoggingViewManager *s_instance = nullptr; - -static QString levelToString(QtMsgType t) -{ - switch (t) { - case QtMsgType::QtCriticalMsg: return {"critical"}; - case QtMsgType::QtDebugMsg: return {"debug"}; - case QtMsgType::QtInfoMsg: return {"info"}; - case QtMsgType::QtWarningMsg: return {"warning"}; - default: - return {"fatal"}; // wrong but we don't care - } -} - -static QtMsgType parseLevel(const QString &level) -{ - switch (level.at(0).toLatin1()) { - case 'c': return QtMsgType::QtCriticalMsg; - case 'd': return QtMsgType::QtDebugMsg; - case 'i': return QtMsgType::QtInfoMsg; - case 'w': return QtMsgType::QtWarningMsg; - default: - return QtMsgType::QtFatalMsg; // wrong but we don't care - } -} - -static bool parseLine(const QString &line, FilterRuleSpec *filterRule) -{ - const QStringList parts = line.split('='); - if (parts.size() != 2) - return false; - - const QString category = parts.at(0); - static const QRegularExpression regex("^(.+?)(\\.(debug|info|warning|critical))?$"); - const QRegularExpressionMatch match = regex.match(category); - if (!match.hasMatch()) - return false; - - const QString categoryName = match.captured(1); - if (categoryName.size() > 2) { - if (categoryName.mid(1, categoryName.size() - 2).contains('*')) - return false; - } else if (categoryName.size() == 2) { - if (categoryName.count('*') == 2) - return false; - } - filterRule->category = categoryName; - - if (match.capturedLength(2) == 0) - filterRule->level = std::nullopt; - else - filterRule->level = std::make_optional(parseLevel(match.captured(2).mid(1))); - - const QString enabled = parts.at(1); - if (enabled == "true" || enabled == "false") { - filterRule->enabled = (enabled == "true"); - return true; - } - return false; -} - -static QList<FilterRuleSpec> fetchOriginalRules() -{ - QList<FilterRuleSpec> rules; - - auto appendRulesFromFile = [&rules](const QString &fileName) { - QSettings iniSettings(fileName, QSettings::IniFormat); - iniSettings.beginGroup("Rules"); - const QStringList keys = iniSettings.allKeys(); - for (const QString &key : keys) { - const QString value = iniSettings.value(key).toString(); - FilterRuleSpec filterRule; - if (parseLine(key + "=" + value, &filterRule)) - rules.append(filterRule); - } - iniSettings.endGroup(); - }; - - Utils::FilePath iniFile = Utils::FilePath::fromString( - QLibraryInfo::path(QLibraryInfo::DataPath)).pathAppended("qtlogging.ini"); - if (iniFile.exists()) - appendRulesFromFile(iniFile.toString()); - - const QString qtProjectString = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, - "QtProject/qtlogging.ini"); - if (!qtProjectString.isEmpty()) - appendRulesFromFile(qtProjectString); - - iniFile = Utils::FilePath::fromString(qtcEnvironmentVariable("QT_LOGGING_CONF")); - if (iniFile.exists()) - appendRulesFromFile(iniFile.toString()); - - if (qtcEnvironmentVariableIsSet("QT_LOGGING_RULES")) { - const QStringList rulesStrings = qtcEnvironmentVariable("QT_LOGGING_RULES").split(';'); - for (const QString &rule : rulesStrings) { - FilterRuleSpec filterRule; - if (parseLine(rule, &filterRule)) - rules.append(filterRule); - } - } - return rules; -} - -LoggingViewManager::LoggingViewManager(QObject *parent) - : QObject(parent) - , m_originalLoggingRules(qtcEnvironmentVariable("QT_LOGGING_RULES")) -{ - qRegisterMetaType<Core::Internal::LoggingCategoryEntry>(); - s_instance = this; - s_originalMessageHandler = qInstallMessageHandler(logMessageHandler); - m_enabled = true; - m_originalRules = fetchOriginalRules(); - prefillCategories(); - QLoggingCategory::setFilterRules("*=true"); -} - -LoggingViewManager::~LoggingViewManager() -{ - m_enabled = false; - qInstallMessageHandler(s_originalMessageHandler); - s_originalMessageHandler = nullptr; - qputenv("QT_LOGGING_RULES", m_originalLoggingRules.toLocal8Bit()); - QLoggingCategory::setFilterRules("*=false"); - resetFilterRules(); - s_instance = nullptr; -} - -LoggingViewManager *LoggingViewManager::instance() -{ - return s_instance; -} - -void LoggingViewManager::logMessageHandler(QtMsgType type, const QMessageLogContext &context, - const QString &mssg) -{ - if (!s_instance->m_enabled) { - if (s_instance->enabledInOriginalRules(context, type)) - s_originalMessageHandler(type, context, mssg); - return; - } - - if (!context.category) { - s_originalMessageHandler(type, context, mssg); - return; - } - - const QString category = QString::fromLocal8Bit(context.category); - auto it = s_instance->m_categories.find(category); - if (it == s_instance->m_categories.end()) { - if (!s_instance->m_listQtInternal && category.startsWith("qt.")) - return; - LoggingCategoryEntry entry; - entry.level = QtMsgType::QtDebugMsg; - entry.enabled = (category == "default") || s_instance->enabledInOriginalRules(context, type); - it = s_instance->m_categories.insert(category, entry); - emit s_instance->foundNewCategory(category, entry); - } - - const LoggingCategoryEntry entry = it.value(); - if (entry.enabled && enabled(type, entry.level)) { - const QString timestamp = QDateTime::currentDateTime().toString("HH:mm:ss.zzz"); - emit s_instance->receivedLog(timestamp, category, - LoggingViewManager::messageTypeToString(type), mssg); - } -} - -bool LoggingViewManager::isCategoryEnabled(const QString &category) -{ - auto entry = m_categories.find(category); - if (entry == m_categories.end()) // shall not happen - paranoia - return false; - - return entry.value().enabled; -} - -void LoggingViewManager::setCategoryEnabled(const QString &category, bool enabled) -{ - auto entry = m_categories.find(category); - if (entry == m_categories.end()) // shall not happen - paranoia - return; - - entry->enabled = enabled; -} - -void LoggingViewManager::setLogLevel(const QString &category, QtMsgType type) -{ - auto entry = m_categories.find(category); - if (entry == m_categories.end()) // shall not happen - paranoia - return; - - entry->level = type; -} - -void LoggingViewManager::setListQtInternal(bool listQtInternal) -{ - m_listQtInternal = listQtInternal; -} - -void LoggingViewManager::appendOrUpdate(const QString &category, const LoggingCategoryEntry &entry) -{ - auto it = m_categories.find(category); - bool append = it == m_categories.end(); - m_categories.insert(category, entry); - if (append) - emit foundNewCategory(category, entry); - else - emit updatedCategory(category, entry); -} - -/* - * Does not check categories for being present, will perform early exit if m_categories is not empty - */ -void LoggingViewManager::prefillCategories() -{ - if (!m_categories.isEmpty()) - return; - - for (int i = 0, end = m_originalRules.size(); i < end; ++i) { - const FilterRuleSpec &rule = m_originalRules.at(i); - if (rule.category.startsWith('*') || rule.category.endsWith('*')) - continue; - - bool enabled = rule.enabled; - // check following rules whether they might overwrite - for (int j = i + 1; j < end; ++j) { - const FilterRuleSpec &secondRule = m_originalRules.at(j); - const QRegularExpression regex( - QRegularExpression::wildcardToRegularExpression(secondRule.category)); - if (!regex.match(rule.category).hasMatch()) - continue; - - if (secondRule.level.has_value() && rule.level != secondRule.level) - continue; - - enabled = secondRule.enabled; - } - LoggingCategoryEntry entry; - entry.level = rule.level.value_or(QtMsgType::QtInfoMsg); - entry.enabled = enabled; - m_categories.insert(rule.category, entry); - } -} - -void LoggingViewManager::resetFilterRules() -{ - for (const FilterRuleSpec &rule : std::as_const(m_originalRules)) { - const QString level = rule.level.has_value() ? '.' + levelToString(rule.level.value()) - : QString(); - const QString ruleString = rule.category + level + '=' + (rule.enabled ? "true" : "false"); - QLoggingCategory::setFilterRules(ruleString); - } -} - -bool LoggingViewManager::enabledInOriginalRules(const QMessageLogContext &context, QtMsgType type) -{ - if (!context.category) - return false; - const QString category = QString::fromUtf8(context.category); - bool result = false; - for (const FilterRuleSpec &rule : std::as_const(m_originalRules)) { - const QRegularExpression regex( - QRegularExpression::wildcardToRegularExpression(rule.category)); - if (regex.match(category).hasMatch()) { - if (rule.level.has_value()) { - if (rule.level.value() == type) - result = rule.enabled; - } else { - result = rule.enabled; - } - } - } - return result; -} - -} // namespace Internal -} // namespace Core diff --git a/src/plugins/coreplugin/loggingmanager.h b/src/plugins/coreplugin/loggingmanager.h deleted file mode 100644 index 1b8830c0aa1..00000000000 --- a/src/plugins/coreplugin/loggingmanager.h +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <QColor> -#include <QLoggingCategory> -#include <QMap> -#include <QObject> - -#include <optional> - -namespace Core { -namespace Internal { - -struct FilterRuleSpec -{ - QString category; - std::optional<QtMsgType> level; - bool enabled; -}; - -class LoggingCategoryEntry -{ -public: - QtMsgType level = QtDebugMsg; - bool enabled = false; - QColor color; -}; - -class LoggingViewManager : public QObject -{ - Q_OBJECT -public: - static inline QString messageTypeToString(QtMsgType type) - { - switch (type) { - case QtDebugMsg: return {"Debug"}; - case QtInfoMsg: return {"Info"}; - case QtCriticalMsg: return {"Critical"}; - case QtWarningMsg: return {"Warning"}; - case QtFatalMsg: return {"Fatal"}; - default: return {"Unknown"}; - } - } - - static inline QtMsgType messageTypeFromString(const QString &type) - { - if (type.isEmpty()) - return QtDebugMsg; - - // shortcut - only handle expected - switch (type.at(0).toLatin1()) { - case 'I': - return QtInfoMsg; - case 'C': - return QtCriticalMsg; - case 'W': - return QtWarningMsg; - case 'D': - default: - return QtDebugMsg; - } - } - - explicit LoggingViewManager(QObject *parent = nullptr); - ~LoggingViewManager(); - - static LoggingViewManager *instance(); - - static inline bool enabled(QtMsgType current, QtMsgType stored) - { - if (stored == QtMsgType::QtInfoMsg) - return true; - if (current == stored) - return true; - if (stored == QtMsgType::QtDebugMsg) - return current != QtMsgType::QtInfoMsg; - if (stored == QtMsgType::QtWarningMsg) - return current == QtMsgType::QtCriticalMsg || current == QtMsgType::QtFatalMsg; - if (stored == QtMsgType::QtCriticalMsg) - return current == QtMsgType::QtFatalMsg; - return false; - } - - static void logMessageHandler(QtMsgType type, const QMessageLogContext &context, - const QString &mssg); - - void setEnabled(bool enabled) { m_enabled = enabled; } - bool isEnabled() const { return m_enabled; } - bool isCategoryEnabled(const QString &category); - void setCategoryEnabled(const QString &category, bool enabled); - void setLogLevel(const QString &category, QtMsgType type); - void setListQtInternal(bool listQtInternal); - QList<FilterRuleSpec> originalRules() const { return m_originalRules; } - - QMap<QString, LoggingCategoryEntry> categories() const { return m_categories; } - void appendOrUpdate(const QString &category, const LoggingCategoryEntry &entry); - -signals: - void receivedLog(const QString ×tamp, const QString &type, const QString &category, - const QString &msg); - void foundNewCategory(const QString &category, const LoggingCategoryEntry &entry); - void updatedCategory(const QString &category, const LoggingCategoryEntry &entry); - -private: - void prefillCategories(); - void resetFilterRules(); - bool enabledInOriginalRules(const QMessageLogContext &context, QtMsgType type); - - QMap<QString, LoggingCategoryEntry> m_categories; - const QString m_originalLoggingRules; - QList<FilterRuleSpec> m_originalRules; - bool m_enabled = false; - bool m_listQtInternal = false; -}; - -} // namespace Internal -} // namespace Core - -Q_DECLARE_METATYPE(Core::Internal::LoggingCategoryEntry) diff --git a/src/plugins/coreplugin/loggingviewer.cpp b/src/plugins/coreplugin/loggingviewer.cpp index 742e65a34c5..bf1f8b736f0 100644 --- a/src/plugins/coreplugin/loggingviewer.cpp +++ b/src/plugins/coreplugin/loggingviewer.cpp @@ -3,26 +3,22 @@ #include "loggingviewer.h" -#include "actionmanager/actionmanager.h" #include "coreicons.h" #include "coreplugintr.h" #include "icore.h" -#include "loggingmanager.h" -#include <utils/algorithm.h> #include <utils/basetreeview.h> #include <utils/fileutils.h> +#include <utils/layoutbuilder.h> #include <utils/listmodel.h> #include <utils/qtcassert.h> +#include <utils/stringutils.h> #include <utils/theme/theme.h> #include <utils/utilsicons.h> #include <QAction> -#include <QClipboard> #include <QColorDialog> -#include <QComboBox> #include <QDialog> -#include <QGuiApplication> #include <QHBoxLayout> #include <QJsonArray> #include <QJsonDocument> @@ -31,138 +27,348 @@ #include <QMenu> #include <QMessageBox> #include <QPushButton> -#include <QRegularExpression> -#include <QScopeGuard> #include <QSortFilterProxyModel> -#include <QStyledItemDelegate> +#include <QSplitter> #include <QToolButton> -#include <QTreeView> #include <QVBoxLayout> -namespace Core { -namespace Internal { +namespace Core::Internal { -class LoggingCategoryItem +static QColor colorForCategory(const QString &category); +void setCategoryColor(const QString &category, const QColor &color); + +QHash<QString, QColor> s_categoryColor; + +static inline QString messageTypeToString(QtMsgType type) { -public: - QString name; - LoggingCategoryEntry entry; + switch (type) { + case QtDebugMsg: + return {"Debug"}; + case QtInfoMsg: + return {"Info"}; + case QtCriticalMsg: + return {"Critical"}; + case QtWarningMsg: + return {"Warning"}; + case QtFatalMsg: + return {"Fatal"}; + default: + return {"Unknown"}; + } +} - static LoggingCategoryItem fromJson(const QJsonObject &object, bool *ok); +class LogCategoryRegistry : public QObject +{ + Q_OBJECT +public: + static LogCategoryRegistry &instance() + { + static LogCategoryRegistry s_instance; + return s_instance; + } + + static void filter(QLoggingCategory *category) + { + if (s_oldFilter) + s_oldFilter(category); + + LogCategoryRegistry::instance().onFilter(category); + } + + void start() + { + if (m_started) + return; + + m_started = true; + s_oldFilter = QLoggingCategory::installFilter(&LogCategoryRegistry::filter); + } + + QList<QLoggingCategory *> categories() { return m_categories; } + +signals: + void newLogCategory(QLoggingCategory *category); + +private: + LogCategoryRegistry() = default; + + void onFilter(QLoggingCategory *category) + { + if (!m_categories.contains(category)) { + m_categories.append(category); + emit newLogCategory(category); + } + } + +private: + static QLoggingCategory::CategoryFilter s_oldFilter; + + QList<QLoggingCategory *> m_categories; + bool m_started{false}; }; -LoggingCategoryItem LoggingCategoryItem::fromJson(const QJsonObject &object, bool *ok) +QLoggingCategory::CategoryFilter LogCategoryRegistry::s_oldFilter; + +struct SavedEntry { - if (!object.contains("name")) { - *ok = false; - return {}; + QColor color; + QString name; + QtMsgType level; + std::optional<std::array<bool, 5>> levels; + + static Utils::expected_str<SavedEntry> fromJson(const QJsonObject &obj) + { + if (!obj.contains("name")) + return Utils::make_unexpected(Tr::tr("Entry is missing a logging category name.")); + + SavedEntry result; + result.name = obj.value("name").toString(); + + if (!obj.contains("entry")) + return Utils::make_unexpected(Tr::tr("Entry is missing data.")); + + auto entry = obj.value("entry").toObject(); + if (entry.contains("color")) + result.color = QColor(entry.value("color").toString()); + + if (entry.contains("level")) { + int lvl = entry.value("level").toInt(0); + if (lvl < QtDebugMsg || lvl > QtInfoMsg) + return Utils::make_unexpected(Tr::tr("Invalid level: %1").arg(lvl)); + result.level = static_cast<QtMsgType>(lvl); + } + + if (entry.contains("levels")) { + QVariantMap map = entry.value("levels").toVariant().toMap(); + std::array<bool, 5> levels{ + map.contains("Debug") && map["Debug"].toBool(), + map.contains("Warning") && map["Warning"].toBool(), + map.contains("Critical") && map["Critical"].toBool(), + true, + map.contains("Info") && map["Info"].toBool(), + }; + result.levels = levels; + } + + return result; } - const QJsonValue entryVal = object.value("entry"); - if (entryVal.isUndefined()) { - *ok = false; - return {}; - } - const QJsonObject entryObj = entryVal.toObject(); - if (!entryObj.contains("level")) { - *ok = false; - return {}; +}; + +class LoggingCategoryEntry +{ +public: + LoggingCategoryEntry(const QString &name) + : m_name(name) + {} + LoggingCategoryEntry(QLoggingCategory *category) + : m_name(QString::fromUtf8(category->categoryName())) + { + setLogCategory(category); } - LoggingCategoryEntry entry; - entry.level = QtMsgType(entryObj.value("level").toInt()); - entry.enabled = true; - if (entryObj.contains("color")) - entry.color = QColor(entryObj.value("color").toString()); - LoggingCategoryItem item {object.value("name").toString(), entry}; - *ok = true; - return item; -} + LoggingCategoryEntry(const SavedEntry &savedEntry) + : m_name(savedEntry.name) + { + m_saved = savedEntry.levels; + m_color = savedEntry.color; + if (!m_saved) { + m_saved = std::array<bool, 5>(); + for (int i = QtDebugMsg; i <= QtInfoMsg; ++i) { + (*m_saved)[i] = savedEntry.level <= i; + } + } + } + + QString name() const { return m_name; } + QColor color() const { return m_color; } + void setColor(const QColor &c) { m_color = c; } + + void setUseOriginal(bool useOriginal) + { + if (!m_useOriginal && m_category && m_originalSettings) { + m_saved = std::array<bool, 5>{}; + + for (int i = QtDebugMsg; i < QtInfoMsg; i++) { + (*m_saved)[i] = m_category->isEnabled(static_cast<QtMsgType>(i)); + m_category->setEnabled(static_cast<QtMsgType>(i), (*m_originalSettings)[i]); + } + + } else if (!useOriginal && m_useOriginal && m_saved && m_category) { + for (int i = QtDebugMsg; i < QtInfoMsg; i++) + m_category->setEnabled(static_cast<QtMsgType>(i), (*m_saved)[i]); + } + m_useOriginal = useOriginal; + } + + bool isEnabled(QtMsgType msgType) const + { + if (m_category) + return m_category->isEnabled(msgType); + if (m_saved) + return (*m_saved)[msgType]; + return false; + } + + void setEnabled(QtMsgType msgType, bool isEnabled) + { + QTC_ASSERT(!m_useOriginal, return); + + if (m_category) + m_category->setEnabled(msgType, isEnabled); + + if (m_saved) + (*m_saved)[msgType] = isEnabled; + } + + void setSaved(const SavedEntry &entry) + { + QTC_ASSERT(entry.name == name(), return); + + m_saved = entry.levels; + m_color = entry.color; + if (!m_saved) { + m_saved = std::array<bool, 5>(); + for (int i = QtDebugMsg; i <= QtInfoMsg; ++i) { + (*m_saved)[i] = entry.level <= i; + } + } + if (m_category) + setLogCategory(m_category); + } + + void setLogCategory(QLoggingCategory *category) + { + QTC_ASSERT(QString::fromUtf8(category->categoryName()) == m_name, return); + + m_category = category; + if (!m_originalSettings) { + m_originalSettings = { + category->isDebugEnabled(), + category->isWarningEnabled(), + category->isCriticalEnabled(), + true, // always enable fatal + category->isInfoEnabled(), + }; + } + + if (m_saved && !m_useOriginal) { + m_category->setEnabled(QtDebugMsg, m_saved->at(0)); + m_category->setEnabled(QtWarningMsg, m_saved->at(1)); + m_category->setEnabled(QtCriticalMsg, m_saved->at(2)); + m_category->setEnabled(QtInfoMsg, m_saved->at(4)); + } + } + + bool isDebugEnabled() const { return isEnabled(QtDebugMsg); } + bool isWarningEnabled() const { return isEnabled(QtWarningMsg); } + bool isCriticalEnabled() const { return isEnabled(QtCriticalMsg); } + bool isInfoEnabled() const { return isEnabled(QtInfoMsg); } + +private: + QString m_name; + QLoggingCategory *m_category{nullptr}; + std::optional<std::array<bool, 5>> m_originalSettings; + std::optional<std::array<bool, 5>> m_saved; + QColor m_color; + bool m_useOriginal{false}; +}; class LoggingCategoryModel : public QAbstractListModel { Q_OBJECT public: - LoggingCategoryModel() = default; - ~LoggingCategoryModel() override; + LoggingCategoryModel(QObject *parent) + : QAbstractListModel(parent) + { + auto newCategory = [this](QLoggingCategory *category) { + QString name = QString::fromUtf8(category->categoryName()); + auto itExists = std::find_if(m_categories.begin(), + m_categories.end(), + [name](const auto &cat) { return name == cat.name(); }); - bool append(const QString &category, const LoggingCategoryEntry &entry = {}); - bool update(const QString &category, const LoggingCategoryEntry &entry); - int columnCount(const QModelIndex &) const final { return 3; } - int rowCount(const QModelIndex & = QModelIndex()) const final { return m_categories.count(); } + if (itExists != m_categories.end()) { + itExists->setLogCategory(category); + } else { + LoggingCategoryEntry entry(category); + append(entry); + } + }; + + for (QLoggingCategory *cat : LogCategoryRegistry::instance().categories()) + newCategory(cat); + + connect(&LogCategoryRegistry::instance(), + &LogCategoryRegistry::newLogCategory, + this, + newCategory); + + LogCategoryRegistry::instance().start(); + }; + + ~LoggingCategoryModel() override; + enum Column { Color, Name, Debug, Warning, Critical, Fatal, Info }; + + void append(const LoggingCategoryEntry &entry); + int columnCount(const QModelIndex &) const final { return 7; } + int rowCount(const QModelIndex & = QModelIndex()) const final { return m_categories.size(); } QVariant data(const QModelIndex &index, int role) const final; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) final; Qt::ItemFlags flags(const QModelIndex &index) const final; - QVariant headerData(int section, Qt::Orientation orientation, + QVariant headerData(int section, + Qt::Orientation orientation, int role = Qt::DisplayRole) const final; - void reset(); - void setFromManager(LoggingViewManager *manager); - QList<LoggingCategoryItem> enabledCategories() const; - void disableAll(); -signals: - void categoryChanged(const QString &category, bool enabled); - void colorChanged(const QString &category, const QColor &color); - void logLevelChanged(const QString &category, QtMsgType logLevel); + void saveEnabledCategoryPreset() const; + void loadAndUpdateFromPreset(); + + void setUseOriginal(bool useOriginal) + { + if (useOriginal != m_useOriginal) { + beginResetModel(); + for (auto &entry : m_categories) + entry.setUseOriginal(useOriginal); + + m_useOriginal = useOriginal; + endResetModel(); + } + } + + const QList<LoggingCategoryEntry> &categories() const { return m_categories; } private: - QList<LoggingCategoryItem *> m_categories; + QList<LoggingCategoryEntry> m_categories; + bool m_useOriginal{false}; }; -LoggingCategoryModel::~LoggingCategoryModel() -{ - reset(); -} +LoggingCategoryModel::~LoggingCategoryModel() {} -bool LoggingCategoryModel::append(const QString &category, const LoggingCategoryEntry &entry) +void LoggingCategoryModel::append(const LoggingCategoryEntry &entry) { - // no check? - beginInsertRows(QModelIndex(), m_categories.size(), m_categories.size()); - m_categories.append(new LoggingCategoryItem{category, entry}); + beginInsertRows(QModelIndex(), m_categories.size(), m_categories.size() + 1); + m_categories.push_back(entry); endInsertRows(); - return true; -} - -bool LoggingCategoryModel::update(const QString &category, const LoggingCategoryEntry &entry) -{ - if (m_categories.size() == 0) // should not happen - return false; - - int row = 0; - for (int end = m_categories.size(); row < end; ++row) { - if (m_categories.at(row)->name == category) - break; - } - if (row == m_categories.size()) // should not happen - return false; - - setData(index(row, 0), Qt::Checked, Qt::CheckStateRole); - setData(index(row, 1), LoggingViewManager::messageTypeToString(entry.level), Qt::EditRole); - setData(index(row, 2), entry.color, Qt::DecorationRole); - return true; } QVariant LoggingCategoryModel::data(const QModelIndex &index, int role) const { - static const QColor defaultColor = Utils::creatorTheme()->palette().text().color(); if (!index.isValid()) return {}; - if (role == Qt::DisplayRole) { - if (index.column() == 0) - return m_categories.at(index.row())->name; - if (index.column() == 1) { - return LoggingViewManager::messageTypeToString( - m_categories.at(index.row())->entry.level); - } - } - if (role == Qt::DecorationRole && index.column() == 2) { - const QColor color = m_categories.at(index.row())->entry.color; + + if (index.column() == Column::Name && role == Qt::DisplayRole) { + return m_categories.at(index.row()).name(); + } else if (role == Qt::DecorationRole && index.column() == Column::Color) { + const QColor color = m_categories.at(index.row()).color(); if (color.isValid()) return color; + + static const QColor defaultColor = Utils::creatorTheme()->palette().text().color(); return defaultColor; - } - if (role == Qt::CheckStateRole && index.column() == 0) { - const LoggingCategoryEntry entry = m_categories.at(index.row())->entry; - return entry.enabled ? Qt::Checked : Qt::Unchecked; + } else if (role == Qt::CheckStateRole && index.column() >= Column::Debug + && index.column() <= Column::Info) { + const LoggingCategoryEntry &entry = m_categories.at(index.row()); + return entry.isEnabled(static_cast<QtMsgType>(index.column() - Column::Debug)) + ? Qt::Checked + : Qt::Unchecked; } return {}; } @@ -172,27 +378,28 @@ bool LoggingCategoryModel::setData(const QModelIndex &index, const QVariant &val if (!index.isValid()) return false; - if (role == Qt::CheckStateRole && index.column() == 0) { - LoggingCategoryItem *item = m_categories.at(index.row()); - const Qt::CheckState current = item->entry.enabled ? Qt::Checked : Qt::Unchecked; + if (role == Qt::CheckStateRole && index.column() >= Column::Debug + && index.column() <= Column::Info) { + QtMsgType msgType = static_cast<QtMsgType>(index.column() - Column::Debug); + auto &entry = m_categories[index.row()]; + bool isEnabled = entry.isEnabled(msgType); + + const Qt::CheckState current = isEnabled ? Qt::Checked : Qt::Unchecked; + if (current != value.toInt()) { - item->entry.enabled = !item->entry.enabled; - emit categoryChanged(item->name, item->entry.enabled); + entry.setEnabled(msgType, value.toInt() == Qt::Checked); return true; } - } else if (role == Qt::DecorationRole && index.column() == 2) { - LoggingCategoryItem *item = m_categories.at(index.row()); + } else if (role == Qt::DecorationRole && index.column() == Column::Color) { + auto &category = m_categories[index.row()]; + QColor currentColor = category.color(); QColor color = value.value<QColor>(); - if (color.isValid() && color != item->entry.color) { - item->entry.color = color; - emit colorChanged(item->name, color); + if (color.isValid() && color != currentColor) { + category.setColor(color); + setCategoryColor(category.name(), color); + emit dataChanged(index, index, {Qt::DisplayRole}); return true; } - } else if (role == Qt::EditRole && index.column() == 1) { - LoggingCategoryItem *item = m_categories.at(index.row()); - item->entry.level = LoggingViewManager::messageTypeFromString(value.toString()); - emit logLevelChanged(item->name, item->entry.level); - return true; } return false; @@ -203,111 +410,47 @@ Qt::ItemFlags LoggingCategoryModel::flags(const QModelIndex &index) const if (!index.isValid()) return Qt::NoItemFlags; - // ItemIsEnabled should depend on availability (Qt logging enabled?) - if (index.column() == 0) - return Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable; - if (index.column() == 1) - return Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable; - return Qt::ItemIsEnabled | Qt::ItemIsSelectable; + if (index.column() == LoggingCategoryModel::Column::Fatal) + return Qt::NoItemFlags; + + if (index.column() == Column::Name || index.column() == Column::Color) + return Qt::ItemIsEnabled | Qt::ItemIsSelectable; + + if (m_useOriginal) + return Qt::ItemIsSelectable | Qt::ItemIsUserCheckable; + + return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable; } QVariant LoggingCategoryModel::headerData(int section, Qt::Orientation orientation, int role) const { - if (role == Qt::DisplayRole && orientation == Qt::Horizontal && section >= 0 && section < 3) { + if (role == Qt::DisplayRole && orientation == Qt::Horizontal && section >= 0 && section < 8) { switch (section) { - case 0: return Tr::tr("Category"); - case 1: return Tr::tr("Type"); - case 2: return Tr::tr("Color"); + case Column::Name: + return Tr::tr("Category"); + case Column::Color: + return Tr::tr("Color"); + case Column::Debug: + return Tr::tr("Debug"); + case Column::Warning: + return Tr::tr("Warning"); + case Column::Critical: + return Tr::tr("Critical"); + case Column::Fatal: + return Tr::tr("Fatal"); + case Column::Info: + return Tr::tr("Info"); } } return {}; } -void LoggingCategoryModel::reset() -{ - beginResetModel(); - qDeleteAll(m_categories); - m_categories.clear(); - endResetModel(); -} - -void LoggingCategoryModel::setFromManager(LoggingViewManager *manager) -{ - beginResetModel(); - qDeleteAll(m_categories); - m_categories.clear(); - const QMap<QString, LoggingCategoryEntry> categories = manager->categories(); - auto it = categories.begin(); - for (auto end = categories.end() ; it != end; ++it) - m_categories.append(new LoggingCategoryItem{it.key(), it.value()}); - endResetModel(); -} - -QList<LoggingCategoryItem> LoggingCategoryModel::enabledCategories() const -{ - QList<LoggingCategoryItem> result; - for (auto item : m_categories) { - if (item->entry.enabled) - result.append({item->name, item->entry}); - } - return result; -} - -void LoggingCategoryModel::disableAll() -{ - for (int row = 0, end = m_categories.count(); row < end; ++row) - setData(index(row, 0), Qt::Unchecked, Qt::CheckStateRole); -} - -class LoggingLevelDelegate : public QStyledItemDelegate -{ -public: - explicit LoggingLevelDelegate(QObject *parent = nullptr) : QStyledItemDelegate(parent) {} - ~LoggingLevelDelegate() = default; - -protected: - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const override; - void setEditorData(QWidget *editor, const QModelIndex &index) const override; - void setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const override; -}; - -QWidget *LoggingLevelDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/*option*/, - const QModelIndex &index) const -{ - if (!index.isValid() || index.column() != 1) - return nullptr; - QComboBox *combo = new QComboBox(parent); - combo->addItems({ {"Critical"}, {"Warning"}, {"Debug"}, {"Info"} }); - return combo; -} - -void LoggingLevelDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const -{ - QComboBox *combo = qobject_cast<QComboBox *>(editor); - if (!combo) - return; - - const int i = combo->findText(index.data().toString()); - if (i >= 0) - combo->setCurrentIndex(i); -} - -void LoggingLevelDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const -{ - QComboBox *combo = qobject_cast<QComboBox *>(editor); - if (combo) - model->setData(index, combo->currentText()); -} - class LogEntry { public: QString timestamp; - QString category; QString type; + QString category; QString message; QString outputLine(bool printTimestamp, bool printType) const @@ -325,95 +468,157 @@ public: } }; +class LoggingEntryModel : public Utils::ListModel<LogEntry> +{ +public: + ~LoggingEntryModel() { qInstallMessageHandler(m_originalMessageHandler); } + + static void logMessageHandler(QtMsgType type, + const QMessageLogContext &context, + const QString &mssg) + { + instance().msgHandler(type, context, mssg); + } + + static QVariant logEntryDataAccessor(const LogEntry &entry, int column, int role) + { + if (column >= 0 && column <= 3 && (role == Qt::DisplayRole || role == Qt::ToolTipRole)) { + switch (column) { + case 0: + return entry.timestamp; + case 1: + return entry.category; + case 2: + return entry.type; + case 3: { + if (role == Qt::ToolTipRole) + return entry.message; + return entry.message.left(1000); + } + } + } + if (role == Qt::TextAlignmentRole) + return Qt::AlignTop; + if (column == 1 && role == Qt::ForegroundRole) + return colorForCategory(entry.category); + return {}; + } + + static LoggingEntryModel &instance() + { + static LoggingEntryModel model; + return model; + } + + void setEnabled(bool enabled) { m_enabled = enabled; } + +private: + LoggingEntryModel() + { + setHeader({Tr::tr("Timestamp"), Tr::tr("Category"), Tr::tr("Type"), Tr::tr("Message")}); + setDataAccessor(&logEntryDataAccessor); + + m_originalMessageHandler = qInstallMessageHandler(logMessageHandler); + } + + void msgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) + { + if (!m_enabled) { + m_originalMessageHandler(type, context, msg); + return; + } + + if (!context.category) { + m_originalMessageHandler(type, context, msg); + return; + } + + const QString category = QString::fromLocal8Bit(context.category); + + const QString timestamp = QDateTime::currentDateTime().toString("HH:mm:ss.zzz"); + + if (rowCount() >= 1000000) // limit log to 1000000 items + destroyItem(itemForIndex(index(0, 0))); + + appendItem(LogEntry{timestamp, messageTypeToString(type), category, msg}); + } + +private: + QtMessageHandler m_originalMessageHandler{nullptr}; + bool m_enabled{true}; +}; + class LoggingViewManagerWidget : public QDialog { public: - explicit LoggingViewManagerWidget(QWidget *parent); - ~LoggingViewManagerWidget() + ~LoggingViewManagerWidget() { LoggingEntryModel::instance().setEnabled(false); } + + static LoggingViewManagerWidget *instance() { - setEnabled(false); - delete m_manager; + static QPointer<LoggingViewManagerWidget> instance = new LoggingViewManagerWidget( + Core::ICore::dialogParent()); + return instance; } - static QColor colorForCategory(const QString &category); +protected: + void showEvent(QShowEvent *) override + { + if (!m_stopLog->isChecked()) + m_categoryModel->setUseOriginal(false); + + LoggingEntryModel::instance().setEnabled(!m_stopLog->isChecked()); + } + void hideEvent(QHideEvent *) override + { + m_categoryModel->setUseOriginal(true); + LoggingEntryModel::instance().setEnabled(false); + } + +private: + explicit LoggingViewManagerWidget(QWidget *parent); + private: void showLogViewContextMenu(const QPoint &pos) const; void showLogCategoryContextMenu(const QPoint &pos) const; void saveLoggingsToFile() const; - void saveEnabledCategoryPreset() const; - void loadAndUpdateFromPreset(); - LoggingViewManager *m_manager = nullptr; - void setCategoryColor(const QString &category, const QColor &color); - // should category model be owned directly by the manager? or is this duplication of - // categories in manager and widget beneficial? + QSortFilterProxyModel *m_sortFilterModel = nullptr; LoggingCategoryModel *m_categoryModel = nullptr; Utils::BaseTreeView *m_logView = nullptr; Utils::BaseTreeView *m_categoryView = nullptr; - Utils::ListModel<LogEntry> *m_logModel = nullptr; QToolButton *m_timestamps = nullptr; QToolButton *m_messageTypes = nullptr; - static QHash<QString, QColor> m_categoryColor; + QToolButton *m_stopLog = nullptr; }; -QHash<QString, QColor> LoggingViewManagerWidget::m_categoryColor; - -static QVariant logEntryDataAccessor(const LogEntry &entry, int column, int role) -{ - if (column >= 0 && column <= 3 && (role == Qt::DisplayRole || role == Qt::ToolTipRole)) { - switch (column) { - case 0: return entry.timestamp; - case 1: return entry.category; - case 2: return entry.type; - case 3: { - if (role == Qt::ToolTipRole) - return entry.message; - return entry.message.left(1000); - } - } - } - if (role == Qt::TextAlignmentRole) - return Qt::AlignTop; - if (column == 1 && role == Qt::ForegroundRole) - return LoggingViewManagerWidget::colorForCategory(entry.category); - return {}; -} - LoggingViewManagerWidget::LoggingViewManagerWidget(QWidget *parent) : QDialog(parent) - , m_manager(new LoggingViewManager) { setWindowTitle(Tr::tr("Logging Category Viewer")); - setModal(false); - - auto mainLayout = new QVBoxLayout; - - auto buttonsLayout = new QHBoxLayout; - buttonsLayout->setSpacing(0); - // add further buttons.. auto save = new QToolButton; save->setIcon(Utils::Icons::SAVEFILE.icon()); save->setToolTip(Tr::tr("Save Log")); - buttonsLayout->addWidget(save); + auto clean = new QToolButton; clean->setIcon(Utils::Icons::CLEAN.icon()); clean->setToolTip(Tr::tr("Clear")); - buttonsLayout->addWidget(clean); - auto stop = new QToolButton; - stop->setIcon(Utils::Icons::STOP_SMALL.icon()); - stop->setToolTip(Tr::tr("Stop Logging")); - buttonsLayout->addWidget(stop); + + m_stopLog = new QToolButton; + m_stopLog->setIcon(Utils::Icons::STOP_SMALL.icon()); + m_stopLog->setToolTip(Tr::tr("Stop Logging")); + m_stopLog->setCheckable(true); + auto qtInternal = new QToolButton; qtInternal->setIcon(Core::Icons::QTLOGO.icon()); qtInternal->setToolTip(Tr::tr("Toggle Qt Internal Logging")); qtInternal->setCheckable(true); qtInternal->setChecked(false); - buttonsLayout->addWidget(qtInternal); + auto autoScroll = new QToolButton; autoScroll->setIcon(Utils::Icons::ARROW_DOWN.icon()); autoScroll->setToolTip(Tr::tr("Auto Scroll")); autoScroll->setCheckable(true); autoScroll->setChecked(true); - buttonsLayout->addWidget(autoScroll); + m_timestamps = new QToolButton; auto icon = Utils::Icon({{":/utils/images/stopwatch.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint); @@ -421,7 +626,7 @@ LoggingViewManagerWidget::LoggingViewManagerWidget(QWidget *parent) m_timestamps->setToolTip(Tr::tr("Timestamps")); m_timestamps->setCheckable(true); m_timestamps->setChecked(true); - buttonsLayout->addWidget(m_timestamps); + m_messageTypes = new QToolButton; icon = Utils::Icon({{":/utils/images/message.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint); @@ -429,18 +634,9 @@ LoggingViewManagerWidget::LoggingViewManagerWidget(QWidget *parent) m_messageTypes->setToolTip(Tr::tr("Message Types")); m_messageTypes->setCheckable(true); m_messageTypes->setChecked(false); - buttonsLayout->addWidget(m_messageTypes); - buttonsLayout->addSpacerItem(new QSpacerItem(10, 10, QSizePolicy::Expanding)); - mainLayout->addLayout(buttonsLayout); - - auto horizontal = new QHBoxLayout; m_logView = new Utils::BaseTreeView; - m_logModel = new Utils::ListModel<LogEntry>; - m_logModel->setHeader({Tr::tr("Timestamp"), Tr::tr("Category"), Tr::tr("Type"), Tr::tr("Message")}); - m_logModel->setDataAccessor(&logEntryDataAccessor); - m_logView->setModel(m_logModel); - horizontal->addWidget(m_logView); + m_logView->setModel(&LoggingEntryModel::instance()); m_logView->setUniformRowHeights(true); m_logView->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); m_logView->setFrameStyle(QFrame::Box); @@ -449,91 +645,123 @@ LoggingViewManagerWidget::LoggingViewManagerWidget(QWidget *parent) m_logView->setColumnHidden(2, true); m_logView->setContextMenuPolicy(Qt::CustomContextMenu); + m_categoryModel = new LoggingCategoryModel(this); + m_sortFilterModel = new QSortFilterProxyModel(m_categoryModel); + m_sortFilterModel->setSourceModel(m_categoryModel); + m_sortFilterModel->sort(LoggingCategoryModel::Column::Name); + m_sortFilterModel->setSortRole(Qt::DisplayRole); + m_sortFilterModel->setFilterKeyColumn(LoggingCategoryModel::Column::Name); + m_categoryView = new Utils::BaseTreeView; m_categoryView->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); - m_categoryView->setUniformRowHeights(true); m_categoryView->setFrameStyle(QFrame::Box); m_categoryView->setAttribute(Qt::WA_MacShowFocusRect, false); m_categoryView->setSelectionMode(QAbstractItemView::SingleSelection); m_categoryView->setContextMenuPolicy(Qt::CustomContextMenu); - m_categoryModel = new LoggingCategoryModel; - m_categoryModel->setFromManager(m_manager); - auto sortFilterModel = new QSortFilterProxyModel(this); - sortFilterModel->setSourceModel(m_categoryModel); - sortFilterModel->sort(0); - m_categoryView->setModel(sortFilterModel); - m_categoryView->setItemDelegateForColumn(1, new LoggingLevelDelegate(this)); - horizontal->addWidget(m_categoryView); - horizontal->setStretch(0, 5); - horizontal->setStretch(1, 3); + m_categoryView->setModel(m_sortFilterModel); + + for (int i = LoggingCategoryModel::Column::Color; i < LoggingCategoryModel::Column::Info; i++) + m_categoryView->resizeColumnToContents(i); + + QSplitter *splitter{nullptr}; + + using namespace Layouting; + // clang-format off + Column { + Row { + spacing(0), + save, + clean, + m_stopLog, + qtInternal, + autoScroll, + m_timestamps, + m_messageTypes, + st, + }, + Splitter { + bindTo(&splitter), + m_logView, + m_categoryView, + } + }.attachTo(this); + // clang-format on + + splitter->setOrientation(Qt::Horizontal); - mainLayout->addLayout(horizontal); - setLayout(mainLayout); resize(800, 300); - connect(m_manager, &LoggingViewManager::receivedLog, - this, [this](const QString ×tamp, - const QString &type, - const QString &category, - const QString &msg) { - if (m_logModel->rowCount() >= 1000000) // limit log to 1000000 items - m_logModel->destroyItem(m_logModel->itemForIndex(m_logModel->index(0, 0))); - m_logModel->appendItem(LogEntry{timestamp, type, category, msg}); - }, Qt::QueuedConnection); - connect(m_logModel, &QAbstractItemModel::rowsInserted, this, [this, autoScroll] { + connect( + &LoggingEntryModel::instance(), + &LoggingEntryModel::rowsInserted, + this, + [this, autoScroll] { if (autoScroll->isChecked()) m_logView->scrollToBottom(); - }, Qt::QueuedConnection); - connect(m_manager, &LoggingViewManager::foundNewCategory, - m_categoryModel, &LoggingCategoryModel::append, Qt::QueuedConnection); - connect(m_manager, &LoggingViewManager::updatedCategory, - m_categoryModel, &LoggingCategoryModel::update, Qt::QueuedConnection); - connect(m_categoryModel, &LoggingCategoryModel::categoryChanged, - m_manager, &LoggingViewManager::setCategoryEnabled); - connect(m_categoryModel, &LoggingCategoryModel::colorChanged, - this, &LoggingViewManagerWidget::setCategoryColor); - connect(m_categoryModel, &LoggingCategoryModel::logLevelChanged, - m_manager, &LoggingViewManager::setLogLevel); - connect(m_categoryView, &Utils::BaseTreeView::activated, - this, [this, sortFilterModel](const QModelIndex &index) { - const QModelIndex modelIndex = sortFilterModel->mapToSource(index); - const QVariant value = m_categoryModel->data(modelIndex, Qt::DecorationRole); - if (!value.isValid()) - return; - const QColor original = value.value<QColor>(); - if (!original.isValid()) - return; - QColor changed = QColorDialog::getColor(original, this); - if (!changed.isValid()) - return; - if (original != changed) - m_categoryModel->setData(modelIndex, changed, Qt::DecorationRole); - }); - connect(save, &QToolButton::clicked, - this, &LoggingViewManagerWidget::saveLoggingsToFile); - connect(m_logView, &Utils::BaseTreeView::customContextMenuRequested, - this, &LoggingViewManagerWidget::showLogViewContextMenu); - connect(m_categoryView, &Utils::BaseTreeView::customContextMenuRequested, - this, &LoggingViewManagerWidget::showLogCategoryContextMenu); - connect(clean, &QToolButton::clicked, m_logModel, &Utils::ListModel<LogEntry>::clear); - connect(stop, &QToolButton::clicked, this, [this, stop] { - if (m_manager->isEnabled()) { - m_manager->setEnabled(false); - stop->setIcon(Utils::Icons::RUN_SMALL.icon()); - stop->setToolTip(Tr::tr("Start Logging")); + }, + Qt::QueuedConnection); + + connect(m_categoryView, + &QAbstractItemView::activated, + m_sortFilterModel, + [this](const QModelIndex &index) { + const QVariant value = m_sortFilterModel->data(index, Qt::DecorationRole); + if (!value.isValid()) + return; + const QColor original = value.value<QColor>(); + if (!original.isValid()) + return; + QColor changed = QColorDialog::getColor(original, this); + if (!changed.isValid()) + return; + if (original != changed) + m_sortFilterModel->setData(index, changed, Qt::DecorationRole); + }); + connect(save, &QToolButton::clicked, this, &LoggingViewManagerWidget::saveLoggingsToFile); + connect(m_logView, + &QAbstractItemView::customContextMenuRequested, + this, + &LoggingViewManagerWidget::showLogViewContextMenu); + connect(m_categoryView, + &QAbstractItemView::customContextMenuRequested, + this, + &LoggingViewManagerWidget::showLogCategoryContextMenu); + connect(clean, + &QToolButton::clicked, + &LoggingEntryModel::instance(), + &Utils::ListModel<LogEntry>::clear); + connect(m_stopLog, &QToolButton::toggled, this, [this](bool checked) { + LoggingEntryModel::instance().setEnabled(!checked); + + if (checked) { + m_stopLog->setIcon(Utils::Icons::RUN_SMALL.icon()); + m_stopLog->setToolTip(Tr::tr("Start Logging")); + m_categoryModel->setUseOriginal(true); } else { - m_manager->setEnabled(true); - stop->setIcon(Utils::Icons::STOP_SMALL.icon()); - stop->setToolTip(Tr::tr("Stop Logging")); + m_stopLog->setIcon(Utils::Icons::STOP_SMALL.icon()); + m_stopLog->setToolTip(Tr::tr("Stop Logging")); + m_categoryModel->setUseOriginal(false); } }); - connect(qtInternal, &QToolButton::toggled, m_manager, &LoggingViewManager::setListQtInternal); - connect(m_timestamps, &QToolButton::toggled, this, [this](bool checked){ + + m_sortFilterModel->setFilterRegularExpression("^(?!qt\\.).+"); + + connect(qtInternal, &QToolButton::toggled, m_sortFilterModel, [this](bool checked) { + if (checked) { + m_sortFilterModel->setFilterRegularExpression(""); + } else { + m_sortFilterModel->setFilterRegularExpression("^(?!qt\\.).+"); + } + }); + + connect(m_timestamps, &QToolButton::toggled, this, [this](bool checked) { m_logView->setColumnHidden(0, !checked); }); - connect(m_messageTypes, &QToolButton::toggled, this, [this](bool checked){ + connect(m_messageTypes, &QToolButton::toggled, this, [this](bool checked) { m_logView->setColumnHidden(2, !checked); }); + + ICore::registerWindow(this, Context("Qtc.LogViewer")); } void LoggingViewManagerWidget::showLogViewContextMenu(const QPoint &pos) const @@ -548,104 +776,162 @@ void LoggingViewManagerWidget::showLogViewContextMenu(const QPoint &pos) const QString copied; const bool useTS = m_timestamps->isChecked(); const bool useLL = m_messageTypes->isChecked(); - for (int row = 0, end = m_logModel->rowCount(); row < end; ++row) { + for (int row = 0, end = LoggingEntryModel::instance().rowCount(); row < end; ++row) { if (selectionModel->isRowSelected(row, QModelIndex())) - copied.append(m_logModel->dataAt(row).outputLine(useTS, useLL)); + copied.append(LoggingEntryModel::instance().dataAt(row).outputLine(useTS, useLL)); } - QGuiApplication::clipboard()->setText(copied); + Utils::setClipboardAndSelection(copied); }); connect(copyAll, &QAction::triggered, &m, [this] { QString copied; const bool useTS = m_timestamps->isChecked(); const bool useLL = m_messageTypes->isChecked(); - for (int row = 0, end = m_logModel->rowCount(); row < end; ++row) - copied.append(m_logModel->dataAt(row).outputLine(useTS, useLL)); + for (int row = 0, end = LoggingEntryModel::instance().rowCount(); row < end; ++row) + copied.append(LoggingEntryModel::instance().dataAt(row).outputLine(useTS, useLL)); - QGuiApplication::clipboard()->setText(copied); + Utils::setClipboardAndSelection(copied); }); m.exec(m_logView->mapToGlobal(pos)); } void LoggingViewManagerWidget::showLogCategoryContextMenu(const QPoint &pos) const { + QModelIndex idx = m_categoryView->indexAt(pos); + QMenu m; + auto uncheckAll = new QAction(Tr::tr("Uncheck All"), &m); + + int column = 0; + + if (idx.isValid()) { + column = idx.column(); + if (column >= LoggingCategoryModel::Column::Debug + && column <= LoggingCategoryModel::Column::Info) { + bool isChecked = idx.data(Qt::CheckStateRole).toBool(); + + QString text = isChecked ? Tr::tr("Uncheck All %1") : Tr::tr("Check All %1"); + + uncheckAll->setText(text.arg(messageTypeToString( + static_cast<QtMsgType>(column - LoggingCategoryModel::Column::Debug)))); + + connect(uncheckAll, &QAction::triggered, m_sortFilterModel, [this, idx, isChecked] { + for (int i = 0; i < m_sortFilterModel->rowCount(); ++i) { + m_sortFilterModel->setData(m_sortFilterModel->index(i, idx.column()), + !isChecked, + Qt::CheckStateRole); + } + }); + } else { + connect(uncheckAll, &QAction::triggered, m_sortFilterModel, [this] { + for (int i = 0; i < m_sortFilterModel->rowCount(); ++i) { + for (int c = LoggingCategoryModel::Column::Debug; + c <= LoggingCategoryModel::Column::Info; + ++c) { + m_sortFilterModel->setData(m_sortFilterModel->index(i, c), + false, + Qt::CheckStateRole); + } + } + }); + } + } + // minimal load/save - plugins could later provide presets on their own? auto savePreset = new QAction(Tr::tr("Save Enabled as Preset..."), &m); m.addAction(savePreset); auto loadPreset = new QAction(Tr::tr("Update from Preset..."), &m); m.addAction(loadPreset); - auto uncheckAll = new QAction(Tr::tr("Uncheck All"), &m); m.addAction(uncheckAll); - connect(savePreset, &QAction::triggered, - this, &LoggingViewManagerWidget::saveEnabledCategoryPreset); - connect(loadPreset, &QAction::triggered, - this, &LoggingViewManagerWidget::loadAndUpdateFromPreset); - connect(uncheckAll, &QAction::triggered, - m_categoryModel, &LoggingCategoryModel::disableAll); + connect(savePreset, + &QAction::triggered, + m_categoryModel, + &LoggingCategoryModel::saveEnabledCategoryPreset); + connect(loadPreset, + &QAction::triggered, + m_categoryModel, + &LoggingCategoryModel::loadAndUpdateFromPreset); m.exec(m_categoryView->mapToGlobal(pos)); } void LoggingViewManagerWidget::saveLoggingsToFile() const { - // should we just let it continue without temporarily disabling? - const bool enabled = m_manager->isEnabled(); - const QScopeGuard cleanup([this, enabled] { m_manager->setEnabled(enabled); }); - if (enabled) - m_manager->setEnabled(false); const Utils::FilePath fp = Utils::FileUtils::getSaveFilePath(ICore::dialogParent(), - Tr::tr("Save Logs As")); + Tr::tr("Save Logs As"), + {}, + "*.log"); if (fp.isEmpty()) return; + const bool useTS = m_timestamps->isChecked(); const bool useLL = m_messageTypes->isChecked(); QFile file(fp.path()); if (file.open(QIODevice::WriteOnly)) { - for (int row = 0, end = m_logModel->rowCount(); row < end; ++row) { - qint64 res = file.write( m_logModel->dataAt(row).outputLine(useTS, useLL).toUtf8()); + for (int row = 0, end = LoggingEntryModel::instance().rowCount(); row < end; ++row) { + qint64 res = file.write( + LoggingEntryModel::instance().dataAt(row).outputLine(useTS, useLL).toUtf8()); if (res == -1) { - QMessageBox::critical( - ICore::dialogParent(), Tr::tr("Error"), - Tr::tr("Failed to write logs to \"%1\".").arg(fp.toUserOutput())); + QMessageBox::critical(ICore::dialogParent(), + Tr::tr("Error"), + Tr::tr("Failed to write logs to \"%1\".") + .arg(fp.toUserOutput())); break; } } file.close(); } else { - QMessageBox::critical( - ICore::dialogParent(), Tr::tr("Error"), - Tr::tr("Failed to open file \"%1\" for writing logs.").arg(fp.toUserOutput())); + QMessageBox::critical(ICore::dialogParent(), + Tr::tr("Error"), + Tr::tr("Failed to open file \"%1\" for writing logs.") + .arg(fp.toUserOutput())); } } -void LoggingViewManagerWidget::saveEnabledCategoryPreset() const +void LoggingCategoryModel::saveEnabledCategoryPreset() const { Utils::FilePath fp = Utils::FileUtils::getSaveFilePath(ICore::dialogParent(), - Tr::tr("Save Enabled Categories As...")); + Tr::tr("Save Enabled Categories As..."), + {}, + "*.json"); if (fp.isEmpty()) return; - const QList<LoggingCategoryItem> enabled = m_categoryModel->enabledCategories(); - // write them to file + + auto minLevel = [](const LoggingCategoryEntry &logCategory) { + for (int i = QtDebugMsg; i <= QtInfoMsg; i++) { + if (logCategory.isEnabled(static_cast<QtMsgType>(i))) + return i; + } + return QtInfoMsg + 1; + }; + QJsonArray array; - for (const LoggingCategoryItem &item : enabled) { + + for (auto item : m_categories) { QJsonObject itemObj; - itemObj.insert("name", item.name); + itemObj.insert("name", item.name()); QJsonObject entryObj; - entryObj.insert("level", item.entry.level); - if (item.entry.color.isValid()) - entryObj.insert("color", item.entry.color.name(QColor::HexArgb)); + entryObj.insert("level", minLevel(item)); + if (item.color().isValid()) + entryObj.insert("color", item.color().name(QColor::HexArgb)); + + QVariantMap levels = {{"Debug", item.isDebugEnabled()}, + {"Warning", item.isWarningEnabled()}, + {"Critical", item.isCriticalEnabled()}, + {"Info", item.isInfoEnabled()}}; + entryObj.insert("levels", QJsonValue::fromVariant(levels)); + itemObj.insert("entry", entryObj); array.append(itemObj); } QJsonDocument doc(array); if (!fp.writeFileContents(doc.toJson(QJsonDocument::Compact))) - QMessageBox::critical( - ICore::dialogParent(), Tr::tr("Error"), - Tr::tr("Failed to write preset file \"%1\".").arg(fp.toUserOutput())); + QMessageBox::critical(ICore::dialogParent(), + Tr::tr("Error"), + Tr::tr("Failed to write preset file \"%1\".").arg(fp.toUserOutput())); } -void LoggingViewManagerWidget::loadAndUpdateFromPreset() +void LoggingCategoryModel::loadAndUpdateFromPreset() { Utils::FilePath fp = Utils::FileUtils::getOpenFilePath(ICore::dialogParent(), Tr::tr("Load Enabled Categories From")); @@ -663,13 +949,15 @@ void LoggingViewManagerWidget::loadAndUpdateFromPreset() QJsonParseError error; QJsonDocument doc = QJsonDocument::fromJson(*contents, &error); if (error.error != QJsonParseError::NoError) { - QMessageBox::critical(ICore::dialogParent(), Tr::tr("Error"), - Tr::tr("Failed to read preset file \"%1\": %2").arg(fp.toUserOutput()) - .arg(error.errorString())); + QMessageBox::critical(ICore::dialogParent(), + Tr::tr("Error"), + Tr::tr("Failed to read preset file \"%1\": %2") + .arg(fp.toUserOutput()) + .arg(error.errorString())); return; } bool formatError = false; - QList<LoggingCategoryItem> presetItems; + QList<SavedEntry> presetItems; if (doc.isArray()) { const QJsonArray array = doc.array(); for (const QJsonValue &value : array) { @@ -678,57 +966,81 @@ void LoggingViewManagerWidget::loadAndUpdateFromPreset() break; } const QJsonObject itemObj = value.toObject(); - bool ok = true; - LoggingCategoryItem item = LoggingCategoryItem::fromJson(itemObj, &ok); - if (!ok) { + Utils::expected_str<SavedEntry> item = SavedEntry::fromJson(itemObj); + if (!item) { formatError = true; break; } - presetItems.append(item); + presetItems.append(*item); } } else { formatError = true; } if (formatError) { - QMessageBox::critical(ICore::dialogParent(), Tr::tr("Error"), + QMessageBox::critical(ICore::dialogParent(), + Tr::tr("Error"), Tr::tr("Unexpected preset file format.")); } - for (const LoggingCategoryItem &item : presetItems) - m_manager->appendOrUpdate(item.name, item.entry); + + int idx = 0; + + for (auto it = presetItems.begin(); it != presetItems.end(); ++it, ++idx) { + QList<LoggingCategoryEntry>::iterator itExisting + = std::find_if(m_categories.begin(), + m_categories.end(), + [e = *it](const LoggingCategoryEntry &cat) { + return cat.name() == e.name; + }); + + if (it->color.isValid()) + setCategoryColor(it->name, it->color); + + if (itExisting != m_categories.end()) { + itExisting->setSaved(*it); + emit dataChanged(createIndex(idx, Column::Color), createIndex(idx, Column::Info)); + } else { + LoggingCategoryEntry newEntry(*it); + append(newEntry); + } + } } -QColor LoggingViewManagerWidget::colorForCategory(const QString &category) +QColor colorForCategory(const QString &category) { - auto entry = m_categoryColor.find(category); - if (entry == m_categoryColor.end()) + auto entry = s_categoryColor.find(category); + if (entry == s_categoryColor.end()) return Utils::creatorTheme()->palette().text().color(); return entry.value(); } -void LoggingViewManagerWidget::setCategoryColor(const QString &category, const QColor &color) +void setCategoryColor(const QString &category, const QColor &color) { const QColor baseColor = Utils::creatorTheme()->palette().text().color(); if (color != baseColor) - m_categoryColor.insert(category, color); + s_categoryColor.insert(category, color); else - m_categoryColor.remove(category); + s_categoryColor.remove(category); } void LoggingViewer::showLoggingView() { - ActionManager::command(Constants::LOGGER)->action()->setEnabled(false); - auto widget = new LoggingViewManagerWidget(ICore::dialogParent()); - QObject::connect(widget, &QDialog::finished, widget, [widget] { - ActionManager::command(Constants::LOGGER)->action()->setEnabled(true); - // explicitly disable manager again - widget->deleteLater(); - }); - ICore::registerWindow(widget, Context("Qtc.LogViewer")); - widget->show(); + LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance(); + QTC_ASSERT(staticLogWidget, return); + + staticLogWidget->show(); + staticLogWidget->raise(); + staticLogWidget->activateWindow(); } -} // namespace Internal -} // namespace Core +void LoggingViewer::hideLoggingView() +{ + LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance(); + QTC_ASSERT(staticLogWidget, return); + staticLogWidget->close(); + delete staticLogWidget; +} + +} // namespace Core::Internal #include "loggingviewer.moc" diff --git a/src/plugins/coreplugin/loggingviewer.h b/src/plugins/coreplugin/loggingviewer.h index cb8bf031ca4..4cde2a6501f 100644 --- a/src/plugins/coreplugin/loggingviewer.h +++ b/src/plugins/coreplugin/loggingviewer.h @@ -3,14 +3,13 @@ #pragma once -namespace Core { -namespace Internal { +namespace Core::Internal { class LoggingViewer { public: static void showLoggingView(); + static void hideLoggingView(); }; -} // Internal -} // Core +} // namespace Core::Internal From 0e77cdcc2e45f484cd85fb06acc3e8439d66ac4d Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 17 Oct 2023 17:00:22 +0200 Subject: [PATCH 1644/1777] CMake: save a few cycles Cheaper checks first. Change-Id: I7487862abf409ef0a885d6ac9511066a6f814039 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../cmakeprojectmanager/fileapidataextractor.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index ed5e64b3874..13a240d4e85 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -358,13 +358,13 @@ static QStringList splitFragments(const QStringList &fragments) static bool isPchFile(const FilePath &buildDirectory, const FilePath &path) { - return path.isChildOf(buildDirectory) && path.fileName().startsWith("cmake_pch"); + return path.fileName().startsWith("cmake_pch") && path.isChildOf(buildDirectory); } static bool isUnityFile(const FilePath &buildDirectory, const FilePath &path) { - return path.isChildOf(buildDirectory) && path.parentDir().fileName() == "Unity" - && path.fileName().startsWith("unity_"); + return path.fileName().startsWith("unity_") && path.isChildOf(buildDirectory) + && path.parentDir().fileName() == "Unity"; } static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture, @@ -478,10 +478,9 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture // Set project files except pch / unity files rpp.setFiles(Utils::filtered(sources, [buildDirectory](const QString &path) { - return !isPchFile(buildDirectory, - FilePath::fromString(path)) - && !isUnityFile(buildDirectory, - FilePath::fromString(path)); + const FilePath filePath = FilePath::fromString(path); + return !isPchFile(buildDirectory, filePath) + && !isUnityFile(buildDirectory, filePath); }), {}, [headerMimeType](const QString &path) { From 5336fd83a004c1fe5265b9f9ba87320c031d2040 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Mon, 16 Oct 2023 20:53:46 +0200 Subject: [PATCH 1645/1777] QmlPreview: Tell users how to preview single files In order to preview a specific (QML) file, a QML Preview process has to have been started, before. The "Preview File" context menu action was therefore disabled until at least one QML Preview was running. This precondition is neither documented nor evident to users. This change removes the disabling/enabling of the context menu action and shows an explanatory message box for the case that no running QML Preview is available. Fixes: QTCREATORBUG-29300 Change-Id: I643c57cab15ef4893a8efa6ac8839a3c00e956fb Reviewed-by: hjk <hjk@qt.io> --- src/plugins/qmlpreview/qmlpreviewplugin.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmlpreview/qmlpreviewplugin.cpp b/src/plugins/qmlpreview/qmlpreviewplugin.cpp index 9d05d0ee398..2722ecb016e 100644 --- a/src/plugins/qmlpreview/qmlpreviewplugin.cpp +++ b/src/plugins/qmlpreview/qmlpreviewplugin.cpp @@ -44,6 +44,7 @@ #include <android/androidconstants.h> #include <QAction> +#include <QMessageBox> #include <QPointer> #include <QTimer> @@ -174,11 +175,6 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent) menu = Core::ActionManager::actionContainer(Constants::M_FILECONTEXT); action = new QAction(Tr::tr("Preview File"), this); - action->setEnabled(false); - connect(q, &QmlPreviewPlugin::runningPreviewsChanged, - action, [action](const QmlPreviewRunControlList &previews) { - action->setEnabled(!previews.isEmpty()); - }); connect(action, &QAction::triggered, q, &QmlPreviewPlugin::previewCurrentFile); menu->addAction( Core::ActionManager::registerAction(action, "QmlPreview.PreviewFile", Core::Context(Constants::C_PROJECT_TREE)), @@ -336,6 +332,11 @@ void QmlPreviewPlugin::previewCurrentFile() || currentNode->asFileNode()->fileType() != FileType::QML) return; + if (runningPreviews().isEmpty()) + QMessageBox::warning(Core::ICore::dialogParent(), Tr::tr("QML Preview not running"), + Tr::tr("Please start the QML Preview for the project before selecting " + "a specific file for preview.")); + const QString file = currentNode->filePath().toString(); if (file != d->m_previewedFile) setPreviewedFile(file); From e6ecfa051751dc6b9975c487afe49d062930c3e5 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 16 Oct 2023 10:43:39 +0200 Subject: [PATCH 1646/1777] Tr: Move some line endings at beginning and end out of tr Change-Id: Ibb0aba4d6e58bfe4684a818a894876c1f8f7df15 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- share/qtcreator/translations/qtcreator_da.ts | 28 ++----- share/qtcreator/translations/qtcreator_de.ts | 74 ++++++------------- share/qtcreator/translations/qtcreator_fr.ts | 70 +++++------------- share/qtcreator/translations/qtcreator_hr.ts | 20 ++--- share/qtcreator/translations/qtcreator_ru.ts | 34 +++------ .../qtcreator/translations/qtcreator_zh_CN.ts | 48 ++++-------- src/plugins/android/androidsdkmanager.cpp | 8 +- .../android/androidsdkmanagerwidget.cpp | 9 ++- src/plugins/docker/dockerdevice.cpp | 2 +- src/plugins/remotelinux/linuxdevicetester.cpp | 37 ++++++---- 10 files changed, 110 insertions(+), 220 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_da.ts b/share/qtcreator/translations/qtcreator_da.ts index d30843de390..2d6ee616342 100644 --- a/share/qtcreator/translations/qtcreator_da.ts +++ b/share/qtcreator/translations/qtcreator_da.ts @@ -751,12 +751,8 @@ Vil du afinstallere den eksisterende pakke?</translation> <translation>Handlingen kræver indgriben fra brugeren. Brug kommandolinjeværktøjet "sdkmanager".</translation> </message> <message> - <source>License command failed. - -</source> - <translation>Licens-kommando mislykkedes. - -</translation> + <source>License command failed.</source> + <translation>Licens-kommando mislykkedes.</translation> </message> <message> <source>Android SDK Manager</source> @@ -807,16 +803,12 @@ Vil du afinstallere den eksisterende pakke?</translation> <translation>Vil du acceptere Android SDK-licensen?</translation> </message> <message> - <source>Checking pending licenses... -</source> - <translation>Tjekker afventende licenser... -</translation> + <source>Checking pending licenses...</source> + <translation>Tjekker afventende licenser...</translation> </message> <message> - <source> -SDK Manager is busy.</source> - <translation> -SDK manager er optaget.</translation> + <source>SDK Manager is busy.</source> + <translation>SDK manager er optaget.</translation> </message> <message> <source>Android SDK Changes</source> @@ -1295,12 +1287,8 @@ Installer en SDK af mindst API version %1.</translation> <translation>Mislykkedes.</translation> </message> <message> - <source>Done - -</source> - <translation>Færdig - -</translation> + <source>Done</source> + <translation>Færdig</translation> </message> <message> <source>Installing</source> diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 6ad0490d986..77be1e4ada2 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -10396,22 +10396,16 @@ Installieren Sie diese manuell, nachdem der aktuelle Vorgang abgeschlossen ist. </translation> </message> <message> - <source>Checking pending licenses... -</source> - <translation>Prüfe auf ausstehende Lizenzen... -</translation> + <source>Checking pending licenses...</source> + <translation>Prüfe auf ausstehende Lizenzen...</translation> </message> <message> - <source>The installation of Android SDK packages may fail if the respective licenses are not accepted. -</source> - <translation>Die Installation von Android-SDK-Paketen kann fehlschlagen, wenn die entsprechenden Lizenzen nicht akzeptiert werden. -</translation> + <source>The installation of Android SDK packages may fail if the respective licenses are not accepted.</source> + <translation>Die Installation von Android-SDK-Paketen kann fehlschlagen, wenn die entsprechenden Lizenzen nicht akzeptiert werden.</translation> </message> <message> - <source> -SDK Manager is busy.</source> - <translation> -SDK-Manager arbeitet.</translation> + <source>SDK Manager is busy.</source> + <translation>SDK-Manager arbeitet.</translation> </message> <message> <source>Android SDK Changes</source> @@ -10503,12 +10497,8 @@ Breche ausstehende Operationen ab... <translation type="unfinished"></translation> </message> <message> - <source>License command failed. - -</source> - <translation>Lizenzkommando fehlgeschlagen. - -</translation> + <source>License command failed.</source> + <translation>Lizenzkommando fehlgeschlagen.</translation> </message> <message> <source>Updating installed packages.</source> @@ -10519,12 +10509,8 @@ Breche ausstehende Operationen ab... <translation>Fehlgeschlagen.</translation> </message> <message> - <source>Done - -</source> - <translation>Fertig - -</translation> + <source>Done</source> + <translation>Fertig</translation> </message> <message> <source>Installing</source> @@ -27607,10 +27593,8 @@ Versuchen Sie, das Projekt neu zu erstellen.</translation> <translation>Lade...</translation> </message> <message> - <source>Running "%1" -</source> - <translation>Führe "%1" aus -</translation> + <source>Running "%1"</source> + <translation>Führe "%1" aus</translation> </message> <message> <source>Unexpected result: %1</source> @@ -47127,22 +47111,16 @@ Zusätzlich wird die Verbindung zum Gerät getestet.</translation> <translation>Überprüfe, ob "%1" funktioniert...</translation> </message> <message> - <source>Failed to start "%1": %2 -</source> - <translation>"%1" konnte nicht gestartet werden: %2 -</translation> + <source>Failed to start "%1": %2</source> + <translation>"%1" konnte nicht gestartet werden: %2</translation> </message> <message> - <source>"%1" crashed. -</source> - <translation>"%1" ist abgestürzt. -</translation> + <source>"%1" crashed.</source> + <translation>"%1" ist abgestürzt.</translation> </message> <message> - <source>"%1" failed with exit code %2: %3 -</source> - <translation>"%1" ist mit Rückgabewert %2 fehlgeschlagen: %3 -</translation> + <source>"%1" failed with exit code %2: %3</source> + <translation>"%1" ist mit Rückgabewert %2 fehlgeschlagen: %3</translation> </message> <message> <source>"%1" is functional. @@ -47151,10 +47129,8 @@ Zusätzlich wird die Verbindung zum Gerät getestet.</translation> </translation> </message> <message> - <source>"%1" will be used for deployment, because "%2" and "%3" are not available. -</source> - <translation>"%1" wird für das Deployment benutzt, da "%2" und "%3" nicht verfügbar sind. -</translation> + <source>"%1" will be used for deployment, because "%2" and "%3" are not available.</source> + <translation>"%1" wird für das Deployment benutzt, da "%2" und "%3" nicht verfügbar sind.</translation> </message> <message> <source>Checking if required commands are available...</source> @@ -47177,10 +47153,8 @@ Zusätzlich wird die Verbindung zum Gerät getestet.</translation> <translation>%1 nicht gefunden.</translation> </message> <message> - <source>Deployment to this device will not work out of the box. -</source> - <translation>Deployment auf dieses Gerät wird nicht von Anfang an funktionieren. -</translation> + <source>Deployment to this device will not work out of the box.</source> + <translation>Deployment auf dieses Gerät wird nicht von Anfang an funktionieren.</translation> </message> <message> <source>Checking if specified ports are available...</source> @@ -47446,10 +47420,6 @@ Der Kontrollprozess konnte nicht gestartet werden.</translation> <source>"%1" failed to start: %2</source> <translation>"%1" konnte nicht gestartet werden: %2</translation> </message> - <message> - <source>"%1" crashed.</source> - <translation>"%1" ist abgestürzt.</translation> - </message> <message> <source>"sftp" binary "%1" does not exist.</source> <translation>Ausführbare "sftp"-Datei "%1" existiert nicht.</translation> diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index de55e61972a..f587f274099 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -9058,22 +9058,16 @@ Installez-les manuellement après que l'opération en cours soit finie. <translation>L'installation du SDK Android ne contient pas certains paquets nécessaires. Souhaitez-vous installer les paquets manquants ?</translation> </message> <message> - <source>Checking pending licenses... -</source> - <translation>Vérification des licences en cours… -</translation> + <source>Checking pending licenses...</source> + <translation>Vérification des licences en cours…</translation> </message> <message> - <source>The installation of Android SDK packages may fail if the respective licenses are not accepted. -</source> - <translation>L'installation des paquets du SDK Android peut échouer si les licences respectives ne sont pas acceptées. -</translation> + <source>The installation of Android SDK packages may fail if the respective licenses are not accepted.</source> + <translation>L'installation des paquets du SDK Android peut échouer si les licences respectives ne sont pas acceptées.</translation> </message> <message> - <source> -SDK Manager is busy.</source> - <translation> -Le gestionnaire de SDK est occupé.</translation> + <source>SDK Manager is busy.</source> + <translation>Le gestionnaire de SDK est occupé.</translation> </message> <message numerus="yes"> <source>%n Android SDK packages shall be updated.</source> @@ -10672,12 +10666,8 @@ Les fichiers du répertoire source du paquet Android sont copiés dans le réper <translation>Échec.</translation> </message> <message> - <source>Done - -</source> - <translation>Fini - -</translation> + <source>Done</source> + <translation>Fini</translation> </message> <message> <source>Installing</source> @@ -10700,12 +10690,8 @@ Les fichiers du répertoire source du paquet Android sont copiés dans le réper <translation type="unfinished"></translation> </message> <message> - <source>License command failed. - -</source> - <translation>Échec de la commande de licence. - -</translation> + <source>License command failed.</source> + <translation>Échec de la commande de licence.</translation> </message> <message> <source>Revision</source> @@ -27352,10 +27338,8 @@ La recompilation du projet peut aider.</translation> <translation>Chargement …</translation> </message> <message> - <source>Running "%1" -</source> - <translation>Exécution de « %1 » -</translation> + <source>Running "%1"</source> + <translation>Exécution de « %1 »</translation> </message> <message> <source>Unexpected result: %1</source> @@ -46947,34 +46931,20 @@ Le processus de contrôle n'a pas pu démarrer.</translation> </translation> </message> <message> - <source>Failed to start "%1": %2 -</source> - <translation>Échec du démarrage de « %1 » : %2 -</translation> + <source>Failed to start "%1": %2</source> + <translation>Échec du démarrage de « %1 » : %2</translation> </message> <message> - <source>"%1" crashed. -</source> - <translation>« %1 » a planté. -</translation> + <source>"%1" failed with exit code %2: %3</source> + <translation>« %1 » a échoué avec le code de sortie %2 : %3</translation> </message> <message> - <source>"%1" failed with exit code %2: %3 -</source> - <translation>« %1 » a échoué avec le code de sortie %2 : %3 -</translation> + <source>"%1" will be used for deployment, because "%2" and "%3" are not available.</source> + <translation>« %1 » sera utilisé pour le déploiement, car « %2 » et « %3 » ne sont pas disponibles.</translation> </message> <message> - <source>"%1" will be used for deployment, because "%2" and "%3" are not available. -</source> - <translation>« %1 » sera utilisé pour le déploiement, car « %2 » et « %3 » ne sont pas disponibles. -</translation> - </message> - <message> - <source>Deployment to this device will not work out of the box. -</source> - <translation>Le déploiement vers ce périphérique ne fonctionnera pas directement. -</translation> + <source>Deployment to this device will not work out of the box.</source> + <translation>Le déploiement vers ce périphérique ne fonctionnera pas directement.</translation> </message> <message> <source>%1...</source> diff --git a/share/qtcreator/translations/qtcreator_hr.ts b/share/qtcreator/translations/qtcreator_hr.ts index 35294aedfff..c408f28563a 100644 --- a/share/qtcreator/translations/qtcreator_hr.ts +++ b/share/qtcreator/translations/qtcreator_hr.ts @@ -874,16 +874,12 @@ <translation>Želiš li prihvatiti licencu za Android SDK?</translation> </message> <message> - <source>Checking pending licenses... -</source> - <translation>Provjera neriješenih licenca … -</translation> + <source>Checking pending licenses...</source> + <translation>Provjera neriješenih licenca …</translation> </message> <message> - <source> -SDK Manager is busy.</source> - <translation> -Upravljač za SDK je zauzet.</translation> + <source>SDK Manager is busy.</source> + <translation>Upravljač za SDK je zauzet.</translation> </message> <message> <source>Android SDK Changes</source> @@ -13630,9 +13626,7 @@ Do you want to uninstall the existing package?</source> <translation type="unfinished"></translation> </message> <message> - <source>License command failed. - -</source> + <source>License command failed.</source> <translation type="unfinished"></translation> </message> <message> @@ -13644,9 +13638,7 @@ Do you want to uninstall the existing package?</source> <translation type="unfinished">Neuspjelo.</translation> </message> <message> - <source>Done - -</source> + <source>Done</source> <translation type="unfinished"></translation> </message> <message> diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index 9dc5e7249e0..23561e76c50 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -1398,12 +1398,8 @@ Do you want to uninstall the existing package?</source> <translation>Операция требует вмешательства пользователя. Используйте «sdkmanager» в командной строке.</translation> </message> <message> - <source>License command failed. - -</source> - <translation>Команда License завершилась с ошибкой. - -</translation> + <source>License command failed.</source> + <translation>Команда License завершилась с ошибкой.</translation> </message> <message> <source>Android SDK Manager</source> @@ -1446,16 +1442,12 @@ Do you want to uninstall the existing package?</source> <translation>Принимаете условия лицензии Android SDK?</translation> </message> <message> - <source>Checking pending licenses... -</source> - <translation>Проверка ожидающих лицензий... -</translation> + <source>Checking pending licenses...</source> + <translation>Проверка ожидающих лицензий...</translation> </message> <message> - <source> -SDK Manager is busy.</source> - <translation> -SDK Manager занят.</translation> + <source>SDK Manager is busy.</source> + <translation>SDK Manager занят.</translation> </message> <message> <source>Android SDK Changes</source> @@ -2081,12 +2073,8 @@ To hide a sticky splash screen, invoke QtAndroid::hideSplashScreen().</source> <translation>Ошибка.</translation> </message> <message> - <source>Done - -</source> - <translation>Готово - -</translation> + <source>Done</source> + <translation>Готово</translation> </message> <message> <source>Installing</source> @@ -40173,10 +40161,8 @@ If you do not have a private key yet, you can also create one here.</source> </translation> </message> <message> - <source>Deployment to this device will not work out of the box. -</source> - <translation>Развёртывание на это устройство не работает «из коробки». -</translation> + <source>Deployment to this device will not work out of the box.</source> + <translation>Развёртывание на это устройство не работает «из коробки».</translation> </message> <message> <source>rsync is functional. diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index cb89a89d43d..335d2bbc377 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -1460,12 +1460,8 @@ This cannot be undone.</source> <translation>失败.</translation> </message> <message> - <source>Done - -</source> - <translation>完成 - -</translation> + <source>Done</source> + <translation>完成</translation> </message> <message> <source>Installing</source> @@ -1488,12 +1484,8 @@ This cannot be undone.</source> <translation>安卓 SDK 管理器</translation> </message> <message> - <source>License command failed. - -</source> - <translation>许可命令失败。 - -</translation> + <source>License command failed.</source> + <translation>许可命令失败。</translation> </message> <message> <source>Android SDK Manager</source> @@ -1580,21 +1572,16 @@ Install them manually after the current operation is done. <translation>缺失安卓 SDK 安装所必要的包。你想安装这些缺失包吗?</translation> </message> <message> - <source>Checking pending licenses... -</source> - <translation>正在检查待处理的许可证... -</translation> + <source>Checking pending licenses...</source> + <translation>正在检查待处理的许可证...</translation> </message> <message> - <source>The installation of Android SDK packages may fail if the respective licenses are not accepted. -</source> + <source>The installation of Android SDK packages may fail if the respective licenses are not accepted.</source> <translation>如果不接受相应的许可证,安卓 SDK 包安装可能会失败。</translation> </message> <message> - <source> -SDK Manager is busy.</source> - <translation> -SDK 管理器繁忙。</translation> + <source>SDK Manager is busy.</source> + <translation>SDK 管理器繁忙。</translation> </message> <message numerus="yes"> <source>%n Android SDK packages shall be updated.</source> @@ -18093,8 +18080,7 @@ Rebuilding the project might help.</source> <translation type="unfinished"></translation> </message> <message> - <source>Running "%1" -</source> + <source>Running "%1"</source> <translation type="unfinished"></translation> </message> <message> @@ -39240,18 +39226,11 @@ Control process failed to start.</source> <translation type="unfinished"></translation> </message> <message> - <source>Failed to start "%1": %2 -</source> + <source>Failed to start "%1": %2</source> <translation type="unfinished"></translation> </message> <message> - <source>"%1" crashed. -</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>"%1" failed with exit code %2: %3 -</source> + <source>"%1" failed with exit code %2: %3</source> <translation type="unfinished"></translation> </message> <message> @@ -39265,8 +39244,7 @@ Control process failed to start.</source> <translation type="unfinished"></translation> </message> <message> - <source>Deployment to this device will not work out of the box. -</source> + <source>Deployment to this device will not work out of the box.</source> <translation type="unfinished"></translation> </message> <message> diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp index ca0be7770c4..b0da90123e8 100644 --- a/src/plugins/android/androidsdkmanager.cpp +++ b/src/plugins/android/androidsdkmanager.cpp @@ -438,7 +438,7 @@ void AndroidSdkManagerPrivate::updateInstalled(SdkCmdPromise &promise) if (result.stdError.isEmpty() && !result.success) result.stdError = Tr::tr("Failed."); - result.stdOutput = Tr::tr("Done\n\n"); + result.stdOutput = Tr::tr("Done") + "\n\n"; promise.addResult(result); promise.setProgressValue(100); } @@ -468,8 +468,8 @@ void AndroidSdkManagerPrivate::update(SdkCmdPromise &fi, const QStringList &inst currentProgress += progressQuota; fi.setProgressValue(currentProgress); if (result.stdError.isEmpty() && !result.success) - result.stdError = Tr::tr("AndroidSdkManager", "Failed"); - result.stdOutput = Tr::tr("AndroidSdkManager", "Done\n\n"); + result.stdError = Tr::tr("Failed"); + result.stdOutput = Tr::tr("Done") + "\n\n"; fi.addResult(result); return fi.isCanceled(); }; @@ -569,7 +569,7 @@ void AndroidSdkManagerPrivate::getPendingLicense(SdkCmdPromise &fi) m_licenseTextCache.clear(); result.success = licenseCommand.exitStatus() == QProcess::NormalExit; if (!result.success) - result.stdError = Tr::tr("License command failed.\n\n"); + result.stdError = Tr::tr("License command failed.") + "\n\n"; fi.addResult(result); fi.setProgressValue(100); } diff --git a/src/plugins/android/androidsdkmanagerwidget.cpp b/src/plugins/android/androidsdkmanagerwidget.cpp index d228cd46024..cd3bbb8532b 100644 --- a/src/plugins/android/androidsdkmanagerwidget.cpp +++ b/src/plugins/android/androidsdkmanagerwidget.cpp @@ -290,9 +290,10 @@ void AndroidSdkManagerWidget::installEssentials() void AndroidSdkManagerWidget::beginLicenseCheck() { - m_formatter->appendMessage(Tr::tr("Checking pending licenses...\n"), NormalMessageFormat); + m_formatter->appendMessage(Tr::tr("Checking pending licenses...") + "\n", NormalMessageFormat); m_formatter->appendMessage(Tr::tr("The installation of Android SDK packages may fail if the " - "respective licenses are not accepted.\n"), + "respective licenses are not accepted.") + + "\n", LogMessageFormat); addPackageFuture(m_sdkManager->checkPendingLicenses()); } @@ -302,7 +303,7 @@ void AndroidSdkManagerWidget::onApplyButton(const QString &extraMessage) QTC_ASSERT(m_currentView == PackageListing, return); if (m_sdkManager->isBusy()) { - m_formatter->appendMessage(Tr::tr("\nSDK Manager is busy."), StdErrFormat); + m_formatter->appendMessage("\n" + Tr::tr("SDK Manager is busy."), StdErrFormat); return; } @@ -356,7 +357,7 @@ void AndroidSdkManagerWidget::onApplyButton(const QString &extraMessage) void AndroidSdkManagerWidget::onUpdatePackages() { if (m_sdkManager->isBusy()) { - m_formatter->appendMessage(Tr::tr("\nSDK Manager is busy."), StdErrFormat); + m_formatter->appendMessage("\n" + Tr::tr("SDK Manager is busy."), StdErrFormat); return; } switchView(Operations); diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 17a2e64165c..a13e2f19513 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -1201,7 +1201,7 @@ public: CommandLine cmd{settings().dockerBinaryPath(), {"images", "--format", "{{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.Size}}"}}; - m_log->append(Tr::tr("Running \"%1\"\n").arg(cmd.toUserOutput())); + m_log->append(Tr::tr("Running \"%1\"").arg(cmd.toUserOutput()) + "\n"); m_process = new Process(this); m_process->setCommand(cmd); diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp index 9eb44b8f00c..e908541aa57 100644 --- a/src/plugins/remotelinux/linuxdevicetester.cpp +++ b/src/plugins/remotelinux/linuxdevicetester.cpp @@ -188,12 +188,16 @@ GroupItem GenericLinuxDeviceTesterPrivate::transferTask(FileTransferMethod metho const ProcessResultData resultData = transfer.resultData(); QString error; if (resultData.m_error == QProcess::FailedToStart) { - error = Tr::tr("Failed to start \"%1\": %2\n").arg(methodName, resultData.m_errorString); + error = Tr::tr("Failed to start \"%1\": %2").arg(methodName, resultData.m_errorString) + + "\n"; } else if (resultData.m_exitStatus == QProcess::CrashExit) { - error = Tr::tr("\"%1\" crashed.\n").arg(methodName); + error = Tr::tr("\"%1\" crashed.").arg(methodName) + "\n"; } else if (resultData.m_exitCode != 0) { - error = Tr::tr("\"%1\" failed with exit code %2: %3\n") - .arg(methodName).arg(resultData.m_exitCode).arg(resultData.m_errorString); + error = Tr::tr("\"%1\" failed with exit code %2: %3") + .arg(methodName) + .arg(resultData.m_exitCode) + .arg(resultData.m_errorString) + + "\n"; } emit q->errorMessage(error); if (method == FileTransferMethod::Rsync) @@ -209,8 +213,9 @@ GroupItem GenericLinuxDeviceTesterPrivate::transferTask(FileTransferMethod metho const QString sftp = FileTransfer::transferMethodName(FileTransferMethod::Sftp); const QString rsync = FileTransfer::transferMethodName(FileTransferMethod::Rsync); emit q->progressMessage(Tr::tr("\"%1\" will be used for deployment, because \"%2\" " - "and \"%3\" are not available.\n") - .arg(generic, sftp, rsync)); + "and \"%3\" are not available.") + .arg(generic, sftp, rsync) + + "\n"); } }; return FileTransferTestTask(setup, done, error); @@ -219,16 +224,16 @@ GroupItem GenericLinuxDeviceTesterPrivate::transferTask(FileTransferMethod metho GroupItem GenericLinuxDeviceTesterPrivate::transferTasks() const { TreeStorage<TransferStorage> storage; - return Group { - continueOnDone, - Tasking::Storage(storage), - transferTask(FileTransferMethod::GenericCopy, storage), - transferTask(FileTransferMethod::Sftp, storage), - transferTask(FileTransferMethod::Rsync, storage), - onGroupError([this] { emit q->errorMessage(Tr::tr("Deployment to this device will not " - "work out of the box.\n")); - }) - }; + return Group{continueOnDone, + Tasking::Storage(storage), + transferTask(FileTransferMethod::GenericCopy, storage), + transferTask(FileTransferMethod::Sftp, storage), + transferTask(FileTransferMethod::Rsync, storage), + onGroupError([this] { + emit q->errorMessage(Tr::tr("Deployment to this device will not " + "work out of the box.") + + "\n"); + })}; } GroupItem GenericLinuxDeviceTesterPrivate::commandTask(const QString &commandName) const From 22c1d34e645c53840413b289478f5ef55baae17c Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 18 Oct 2023 10:54:18 +0200 Subject: [PATCH 1647/1777] Copilot: Use normal checkboxes in settings We usually do not use the "Label [ ]" style, at the very least it looks different to other places in the settings. And without a ":" ("Label: [ ]") it also looks different to other lines in the same page. Just use normal checkboxes like we do elsewhere. Change-Id: I7f7d7aab399bef50dacb1efd83a5da460237e044 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/copilot/copilotsettings.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index 4ef4e2b2a9b..586fd8528b9 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -93,14 +93,12 @@ CopilotSettings::CopilotSettings() autoComplete.setDefaultValue(true); autoComplete.setToolTip(Tr::tr("Automatically request suggestions for the current text cursor " "position after changes to the document.")); - autoComplete.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); useProxy.setDisplayName(Tr::tr("Use Proxy")); useProxy.setSettingsKey("Copilot.UseProxy"); useProxy.setLabelText(Tr::tr("Use proxy")); useProxy.setDefaultValue(false); useProxy.setToolTip(Tr::tr("Use a proxy to connect to the Copilot servers.")); - useProxy.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); proxyHost.setDisplayName(Tr::tr("Proxy Host")); proxyHost.setDisplayStyle(StringAspect::LineEditDisplay); @@ -131,7 +129,6 @@ CopilotSettings::CopilotSettings() saveProxyPassword.setDefaultValue(false); saveProxyPassword.setToolTip( Tr::tr("Save the password to access the proxy server. The password is stored insecurely.")); - saveProxyPassword.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); proxyPassword.setDisplayName(Tr::tr("Proxy Password")); proxyPassword.setDisplayStyle(StringAspect::PasswordLineEditDisplay); @@ -146,10 +143,8 @@ CopilotSettings::CopilotSettings() proxyRejectUnauthorized.setDefaultValue(true); proxyRejectUnauthorized.setToolTip(Tr::tr("Reject unauthorized certificates from the proxy " "server. This is a security risk.")); - proxyRejectUnauthorized.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); initEnableAspect(enableCopilot); - enableCopilot.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); readSettings(); From 2886b2b3835f9ec3adc243272633d2186cc2d428 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 17 Oct 2023 13:45:40 +0200 Subject: [PATCH 1648/1777] Debugger: Robustify gdb stack frame extraction frame.older() might run into invalid debuginfo and throw. Change-Id: Iba1d395f21719bf28184302427c7ab2435c6a663 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- share/qtcreator/debugger/gdbbridge.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index b25c139f10f..d61160eed3b 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -1409,7 +1409,13 @@ class Dumper(DumperBase): 'file="%s",line="%s",module="%s",language="c"}') % (i, pc, functionName, fileName, line, objfile)) - frame = frame.older() + try: + # This may fail with something like + # gdb.error: DW_FORM_addr_index used without .debug_addr section + #[in module /data/dev/qt-6/qtbase/lib/libQt6Widgets.so.6] + frame = frame.older() + except: + break i += 1 self.put(']}') self.reportResult(self.takeOutput(), args) From 499a7860539169c68c772d031df54f9880c6d128 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 17 Oct 2023 15:06:01 +0200 Subject: [PATCH 1649/1777] Utils: Be a bit more verbose in debug output Change-Id: I0fd7bc92784efa184bac1cdbd5ae4c2d0158fb28 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/fileutils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index 4f67ee8105a..fdae7c6b8d8 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -721,7 +721,7 @@ bool FileUtils::copyRecursively( bool FileUtils::copyIfDifferent(const FilePath &srcFilePath, const FilePath &tgtFilePath) { - QTC_ASSERT(srcFilePath.exists(), return false); + QTC_ASSERT(srcFilePath.exists(), qDebug() << srcFilePath.toUserOutput(); return false); QTC_ASSERT(srcFilePath.isSameDevice(tgtFilePath), return false); if (tgtFilePath.exists()) { From 18c00cd381780bfaadcc74bd40ab8cee5521c481 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 18 Oct 2023 07:25:23 +0200 Subject: [PATCH 1650/1777] Python: reduce freezes in settings page with remote interpreter Do not check the existence of remote interpreters when opening the settingspage since we could run into device timeouts for unreachable devices. Change-Id: I5d0d1316961fc4ecbd2be55f6df70091ff65ecd5 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/python/pythonsettings.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/python/pythonsettings.cpp b/src/plugins/python/pythonsettings.cpp index 57d951ec1d2..410714af090 100644 --- a/src/plugins/python/pythonsettings.cpp +++ b/src/plugins/python/pythonsettings.cpp @@ -170,6 +170,8 @@ InterpreterOptionsWidget::InterpreterOptionsWidget() return f; } case Qt::ToolTipRole: + if (interpreter.command.needsDevice()) + break; if (interpreter.command.isEmpty()) return Tr::tr("Executable is empty."); if (!interpreter.command.exists()) @@ -179,6 +181,8 @@ InterpreterOptionsWidget::InterpreterOptionsWidget() .arg(interpreter.command.toUserOutput()); break; case Qt::DecorationRole: + if (interpreter.command.needsDevice()) + break; if (column == 0 && !interpreter.command.isExecutableFile()) return Utils::Icons::CRITICAL.icon(); break; From 74cf082ee916db0bb6b3f465f2cdab4a36b6b9c5 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 18 Oct 2023 11:42:26 +0200 Subject: [PATCH 1651/1777] LanguageClient: properly deactivate documents for closing Clients Deactivating the documents resets all client specific data and objects in the document like the formatter or highlighting information. Fixes an assert in the LanguageClientFormatter. Change-Id: I7069abb273749ae335fed11010a5055eacaf58b2 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/languageclient/languageclientmanager.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index c05b84db4aa..839ececce7c 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -168,10 +168,10 @@ void LanguageClientManager::clientFinished(Client *client) const bool unexpectedFinish = client->state() != Client::Shutdown && client->state() != Client::ShutdownRequested; + const QList<TextEditor::TextDocument *> &clientDocs + = managerInstance->m_clientForDocument.keys(client); if (unexpectedFinish) { if (!PluginManager::isShuttingDown()) { - const QList<TextEditor::TextDocument *> &clientDocs - = managerInstance->m_clientForDocument.keys(client); if (client->state() == Client::Initialized && client->reset()) { qCDebug(Log) << "restart unexpectedly finished client: " << client->name() << client; client->log( @@ -186,10 +186,14 @@ void LanguageClientManager::clientFinished(Client *client) } qCDebug(Log) << "client finished unexpectedly: " << client->name() << client; client->log(Tr::tr("Unexpectedly finished.")); - for (TextEditor::TextDocument *document : clientDocs) - managerInstance->m_clientForDocument.remove(document); } } + + if (unexpectedFinish || !QTC_GUARD(clientDocs.isEmpty())) { + for (TextEditor::TextDocument *document : clientDocs) + openDocumentWithClient(document, nullptr); + } + deleteClient(client); if (isShutdownFinished()) emit managerInstance->shutdownFinished(); From cee8309998cd63dcb8c6512e9777cdf22b012387 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 16 Oct 2023 10:58:23 +0200 Subject: [PATCH 1652/1777] Tr: Parametrize some application names Change-Id: I5222455d895aecb94c9a96d0a0f4fd7c279a7388 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- share/qtcreator/translations/qtcreator_de.ts | 12 ++++++------ share/qtcreator/translations/qtcreator_fr.ts | 12 ++++++------ share/qtcreator/translations/qtcreator_zh_CN.ts | 2 +- src/plugins/cppeditor/cppcodemodelsettingspage.cpp | 13 ++++++++----- src/plugins/docker/dockerdevice.cpp | 4 +++- src/plugins/terminal/terminalpane.cpp | 13 ++++++++++--- 6 files changed, 34 insertions(+), 22 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 77be1e4ada2..695b64e9774 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -21872,9 +21872,9 @@ z.B. name = "m_test_foo_": <translation>Bestimmt, ob Clangd beim Vervollständigen von Symbolen Header-Dateien einfügen darf.</translation> </message> <message> - <source>Defines the amount of time Qt Creator waits before sending document changes to the server. + <source>Defines the amount of time %1 waits before sending document changes to the server. If the document changes again while waiting, this timeout resets.</source> - <translation>Bestimmt die Zeit, die Qt Creator vor dem Senden von Dokumentänderungen an den Server wartet. + <translation>Bestimmt die Zeit, die %1 vor dem Senden von Dokumentänderungen an den Server wartet. Falls sich das Dokument innerhalb dieser Zeit wieder ändert, wird erneut die volle Zeit gewartet.</translation> </message> <message> @@ -27577,8 +27577,8 @@ Versuchen Sie, das Projekt neu zu erstellen.</translation> <translation>Shell in Container öffnen</translation> </message> <message> - <source>Docker daemon appears to be not running. Verify daemon is up and running and reset the Docker daemon in Docker device preferences or restart Qt Creator.</source> - <translation>Der Docker-Daemon scheint nicht zu laufen. Stellen Sie sicher, dass der Daemon ausgeführt wird, und setzen Sie den Docker-Daemon in den Einstellungen des Docker-Geräts zurück oder starten Sie Qt Creator neu.</translation> + <source>Docker daemon appears to be not running. Verify daemon is up and running and reset the Docker daemon in Docker device preferences or restart %1.</source> + <translation>Der Docker-Daemon scheint nicht zu laufen. Stellen Sie sicher, dass der Daemon ausgeführt wird, und setzen Sie den Docker-Daemon in den Einstellungen des Docker-Geräts zurück oder starten Sie %1 neu.</translation> </message> <message> <source>Docker Image Selection</source> @@ -49685,8 +49685,8 @@ Die Datei "%1" konnte nicht geöffnet werden</translation> <translation>Einstellungen...</translation> </message> <message> - <source>Sends Esc to terminal instead of Qt Creator.</source> - <translation>Sendet Escape zum Terminal statt zu Qt Creator.</translation> + <source>Sends Esc to terminal instead of %1.</source> + <translation>Sendet Escape zum Terminal statt zu %1.</translation> </message> <message> <source>Press %1 to send Esc to terminal.</source> diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index f587f274099..6865214290b 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -20297,9 +20297,9 @@ Double-cliquez pour modifier l’élément.</translation> <translation>Contrôle si clangd peut insérer des fichiers d’en-tête dans le cadre de la complétion de symboles.</translation> </message> <message> - <source>Defines the amount of time Qt Creator waits before sending document changes to the server. + <source>Defines the amount of time %1 waits before sending document changes to the server. If the document changes again while waiting, this timeout resets.</source> - <translation>Définit le temps d’attente de Qt Creator avant d’envoyer les modifications du document au serveur. + <translation>Définit le temps d’attente de %1 avant d’envoyer les modifications du document au serveur. Si le document est à nouveau modifié pendant l’attente, ce délai est réinitialisé.</translation> </message> <message> @@ -27322,8 +27322,8 @@ La recompilation du projet peut aider.</translation> <translation>Ouvrir un shell dans le conteneur</translation> </message> <message> - <source>Docker daemon appears to be not running. Verify daemon is up and running and reset the Docker daemon in Docker device preferences or restart Qt Creator.</source> - <translation>Le démon Docker ne semble pas fonctionner. Vérifiez que le démon est présent et en cours d'exécution et réinitialisez le démon docker dans les paramètres du périphérique docker ou redémarrez Qt Creator.</translation> + <source>Docker daemon appears to be not running. Verify daemon is up and running and reset the Docker daemon in Docker device preferences or restart %1.</source> + <translation>Le démon Docker ne semble pas fonctionner. Vérifiez que le démon est présent et en cours d'exécution et réinitialisez le démon docker dans les paramètres du périphérique docker ou redémarrez %1.</translation> </message> <message> <source>Docker Image Selection</source> @@ -49353,8 +49353,8 @@ Impossible d'ouvrir le fichier « %1 »</translation> <translation>Configurer…</translation> </message> <message> - <source>Sends Esc to terminal instead of Qt Creator.</source> - <translation>Envoie Échap au terminal au lieu d'à Qt Creator.</translation> + <source>Sends Esc to terminal instead of %1.</source> + <translation>Envoie Échap au terminal au lieu d'à %1.</translation> </message> <message> <source>Press %1 to send Esc to terminal.</source> diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 335d2bbc377..0cae4a5a7a2 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -11554,7 +11554,7 @@ to version control (%2) <translation type="unfinished"></translation> </message> <message> - <source>Defines the amount of time Qt Creator waits before sending document changes to the server. + <source>Defines the amount of time %1 waits before sending document changes to the server. If the document changes again while waiting, this timeout resets.</source> <translation type="unfinished"></translation> </message> diff --git a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp index a2639f380b3..1c8ff05fee8 100644 --- a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp @@ -24,14 +24,15 @@ #include <QDesktopServices> #include <QFormLayout> #include <QGroupBox> +#include <QGuiApplication> #include <QInputDialog> #include <QPushButton> #include <QSpinBox> #include <QStringListModel> +#include <QTextBlock> #include <QTextStream> #include <QVBoxLayout> #include <QVersionNumber> -#include <QTextBlock> #include <limits> @@ -244,10 +245,12 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD "worker threads."); const QString autoIncludeToolTip = Tr::tr( "Controls whether clangd may insert header files as part of symbol completion."); - const QString documentUpdateToolTip = Tr::tr( - "Defines the amount of time Qt Creator waits before sending document changes to the " - "server.\n" - "If the document changes again while waiting, this timeout resets."); + const QString documentUpdateToolTip + //: %1 is the application name (Qt Creator) + = Tr::tr("Defines the amount of time %1 waits before sending document changes to the " + "server.\n" + "If the document changes again while waiting, this timeout resets.") + .arg(QGuiApplication::applicationDisplayName()); const QString sizeThresholdToolTip = Tr::tr( "Files greater than this will not be opened as documents in clangd.\n" "The built-in code model will handle highlighting, completion and so on."); diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index a13e2f19513..ec6403dd79f 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -913,10 +913,12 @@ expected_str<void> DockerDevicePrivate::startContainer() qCWarning(dockerDeviceLog) << "Container shell encountered error:" << resultData.m_error; DockerApi::recheckDockerDaemon(); + //: %1 is the application name (Qt Creator) MessageManager::writeFlashing(Tr::tr("Docker daemon appears to be not running. " "Verify daemon is up and running and reset the " "Docker daemon in Docker device preferences " - "or restart Qt Creator.")); + "or restart %1.") + .arg(QGuiApplication::applicationDisplayName())); }); QTC_ASSERT(m_shell, diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index df059d03b3b..a11284ef1bd 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -26,6 +26,7 @@ #include <utils/utilsicons.h> #include <QFileIconProvider> +#include <QGuiApplication> #include <QMenu> #include <QStandardPaths> #include <QToolButton> @@ -81,7 +82,9 @@ TerminalPane::TerminalPane(QObject *parent) .toString(QKeySequence::NativeText); if (settings().sendEscapeToTerminal()) { m_escSettingButton->setText(escKey); - m_escSettingButton->setToolTip(Tr::tr("Sends Esc to terminal instead of Qt Creator.")); + //: %1 is the application name (Qt Creator) + m_escSettingButton->setToolTip(Tr::tr("Sends Esc to terminal instead of %1.") + .arg(QGuiApplication::applicationDisplayName())); } else { m_escSettingButton->setText(shiftEsc); m_escSettingButton->setToolTip( @@ -106,10 +109,14 @@ TerminalPane::TerminalPane(QObject *parent) if (settings().lockKeyboard()) { m_lockKeyboardButton->setIcon(LOCK_KEYBOARD_ICON.icon()); m_lockKeyboardButton->setToolTip( - Tr::tr("Qt Creator shortcuts are blocked when focus is inside the terminal.")); + //: %1 is the application name (Qt Creator) + Tr::tr("%1 shortcuts are blocked when focus is inside the terminal.") + .arg(QGuiApplication::applicationDisplayName())); } else { m_lockKeyboardButton->setIcon(UNLOCK_KEYBOARD_ICON.icon()); - m_lockKeyboardButton->setToolTip(Tr::tr("Qt Creator shortcuts take precedence.")); + //: %1 is the application name (Qt Creator) + m_lockKeyboardButton->setToolTip(Tr::tr("%1 shortcuts take precedence.") + .arg(QGuiApplication::applicationDisplayName())); } }; From 64550e13399224872427103ee7b69bd6c77ad06c Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 16 Oct 2023 11:42:53 +0200 Subject: [PATCH 1653/1777] Tr: Small fixes like full stops, whitespace and typos Change-Id: I4d1edba6d28661af3c2255add35141f1e73fc304 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- share/qtcreator/translations/qtcreator_cs.ts | 4 +-- share/qtcreator/translations/qtcreator_da.ts | 4 +-- share/qtcreator/translations/qtcreator_de.ts | 34 +++++++++---------- share/qtcreator/translations/qtcreator_fr.ts | 34 +++++++++---------- share/qtcreator/translations/qtcreator_hr.ts | 4 +-- share/qtcreator/translations/qtcreator_ja.ts | 8 ++--- share/qtcreator/translations/qtcreator_pl.ts | 4 +-- share/qtcreator/translations/qtcreator_ru.ts | 8 ++--- share/qtcreator/translations/qtcreator_sl.ts | 4 +-- share/qtcreator/translations/qtcreator_uk.ts | 4 +-- .../qtcreator/translations/qtcreator_zh_CN.ts | 14 ++++---- .../qtcreator/translations/qtcreator_zh_TW.ts | 4 +-- src/libs/utils/filesearch.cpp | 2 +- src/plugins/android/androidsettingswidget.cpp | 2 +- .../debugservers/uvsc/uvscserverprovider.cpp | 3 +- src/plugins/copilot/copilotplugin.cpp | 4 +-- src/plugins/coreplugin/patchtool.cpp | 4 +-- src/plugins/docker/dockerdevice.cpp | 2 +- src/plugins/qmldesigner/generateresource.cpp | 7 ++-- src/plugins/squish/squishxmloutputhandler.cpp | 2 +- src/plugins/terminal/terminalsettings.cpp | 5 ++- src/plugins/vcpkg/vcpkgsearch.cpp | 4 ++- 22 files changed, 81 insertions(+), 80 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_cs.ts b/share/qtcreator/translations/qtcreator_cs.ts index 888786eba13..94bbf49d0b3 100644 --- a/share/qtcreator/translations/qtcreator_cs.ts +++ b/share/qtcreator/translations/qtcreator_cs.ts @@ -24897,8 +24897,8 @@ Vybere pro napodobovatele a přenosné cíle vhodné verze Qt, jsou-li dostupné <translation>'%1' se nepodařilo spustit: %2</translation> </message> <message> - <source>A timeout occurred running '%1'</source> - <translation>Překročení času při spuštění '%1'</translation> + <source>A timeout occurred running "%1".</source> + <translation>Překročení času při spuštění "%1".</translation> </message> <message> <source>'%1' crashed.</source> diff --git a/share/qtcreator/translations/qtcreator_da.ts b/share/qtcreator/translations/qtcreator_da.ts index 2d6ee616342..8421c0a6242 100644 --- a/share/qtcreator/translations/qtcreator_da.ts +++ b/share/qtcreator/translations/qtcreator_da.ts @@ -7806,8 +7806,8 @@ Vil du dræbe den?</translation> <translation>Kunne ikke starte "%1": %2</translation> </message> <message> - <source>A timeout occurred running "%1"</source> - <translation>Timeout under kørsel af "%1"</translation> + <source>A timeout occurred running "%1".</source> + <translation>Timeout under kørsel af "%1".</translation> </message> <message> <source>"%1" crashed.</source> diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 695b64e9774..3fc1a98bfe2 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -6385,8 +6385,8 @@ Exporting assets: %2</source> <translation type="unfinished"></translation> </message> <message> - <source>A timeout occurred running "%1"</source> - <translation>Zeitüberschreitung bei Ausführung von "%1"</translation> + <source>A timeout occurred running "%1".</source> + <translation>Zeitüberschreitung bei Ausführung von "%1".</translation> </message> <message> <source>"%1" crashed.</source> @@ -9410,7 +9410,7 @@ Locked components cannot be modified or selected.</source> <translation>Kommandozeilen-Werkzeug für Android-SDK ist installiert.</translation> </message> <message> - <source>Android SDK Command-line Tools run.</source> + <source>Android SDK Command-line Tools runs.</source> <translation>Kommandozeilen-Werkzeug für Android-SDK startet erfolgreich.</translation> </message> <message> @@ -12470,8 +12470,8 @@ Siehe auch die Einstellungen für Google Test.</translation> <translation>Zieltreiber:</translation> </message> <message> - <source>Starting %1 ...</source> - <translation>Starte %1 ...</translation> + <source>Starting %1...</source> + <translation>Starte %1...</translation> </message> <message> <source>Choose the desired startup mode of the GDB server provider.</source> @@ -17014,7 +17014,7 @@ Ansonsten müssen Sie den Pfad zur Datei %2 aus dem Copilot-Plugin für Neovim a <translation>Fordert Vorschläge für die Cursorposition des aktuellen Editors von Copilot an.</translation> </message> <message> - <source>Show next Copilot Suggestion</source> + <source>Show Next Copilot Suggestion</source> <translation>Nächsten Copilot-Vorschlag zeigen</translation> </message> <message> @@ -17022,7 +17022,7 @@ Ansonsten müssen Sie den Pfad zur Datei %2 aus dem Copilot-Plugin für Neovim a <translation>Iteriert über die Vorschläge von Copilot und zeigt den nächsten verfügbaren Vorschlag.</translation> </message> <message> - <source>Show previos Copilot Suggestion</source> + <source>Show Previous Copilot Suggestion</source> <translation>Vorangehenden Copilot-Vorschlag zeigen</translation> </message> <message> @@ -17991,8 +17991,8 @@ Trotzdem fortfahren?</translation> <translation>"%1" konnte nicht gestartet werden: %2</translation> </message> <message> - <source>A timeout occurred running "%1"</source> - <translation>Zeitüberschreitung bei Ausführung von "%1"</translation> + <source>A timeout occurred running "%1".</source> + <translation>Zeitüberschreitung bei Ausführung von "%1".</translation> </message> <message> <source>"%1" crashed.</source> @@ -27673,8 +27673,8 @@ Versuchen Sie, das Projekt neu zu erstellen.</translation> <translation>Die Liste der Quellverzeichnisse sollte nicht leer sein.</translation> </message> <message> - <source>Host directories to mount into the container</source> - <translation>Host-Verzeichnisse die in den Container eingehängt werden sollen</translation> + <source>Host directories to mount into the container.</source> + <translation>Host-Verzeichnisse die in den Container eingehängt werden sollen.</translation> </message> <message> <source>Maps paths in this list one-to-one to the docker container.</source> @@ -49406,9 +49406,9 @@ Zieldatei "%1" existiert bereits.</translation> </message> <message> <source>Could not merge results into single results.xml. -Failed to open file "%1"</source> +Failed to open file "%1".</source> <translation>Die Ergebnisse konnten nicht in einer einzelnen 'results.xml'-Datei zusammengeführt werden. -Die Datei "%1" konnte nicht geöffnet werden</translation> +Die Datei "%1" konnte nicht geöffnet werden.</translation> </message> <message> <source>Error while parsing first test result.</source> @@ -49805,7 +49805,7 @@ Die Datei "%1" konnte nicht geöffnet werden</translation> <translation>Escape-Taste zum Terminal senden</translation> </message> <message> - <source>Sends the escape key to the terminal when pressedinstead of closing the terminal.</source> + <source>Sends the escape key to the terminal when pressed instead of closing the terminal.</source> <translation>Sendet die Escape-Taste zum Terminal, anstatt das Terminal zu schliessen.</translation> </message> <message> @@ -52963,8 +52963,8 @@ Die Trace-Daten sind verloren.</translation> <translation>Ausschl&ussmuster:</translation> </message> <message> - <source>List of comma separated wildcard filters. </source> - <translation>Kommaseparierte Liste von Platzhalter-Filtern. </translation> + <source>List of comma separated wildcard filters.</source> + <translation>Kommaseparierte Liste von Platzhalter-Filtern.</translation> </message> <message> <source>Files with file name or full file path matching any filter are included.</source> @@ -58306,7 +58306,7 @@ Are you sure you want to remove the material?</source> <translation>Vcpkg Manifest-Editor</translation> </message> <message> - <source>Name:</source> + <source>Name:</source> <translation>Name:</translation> </message> <message> diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index 6865214290b..ab8e488103b 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -6336,8 +6336,8 @@ Export des ressources : %2</translation> <translation>Impossible de générer le fichier de ressource : %1</translation> </message> <message> - <source>A timeout occurred running "%1"</source> - <translation>Un dépassement de délai s’est produit lors de l’exécution de « %1 »</translation> + <source>A timeout occurred running "%1".</source> + <translation>Un dépassement de délai s’est produit lors de l’exécution de « %1 ».</translation> </message> <message> <source>"%1" crashed.</source> @@ -12731,8 +12731,8 @@ Avertissement : fonctionnalité expérimentale pouvant entraîner un échec <translation>Pilote cible :</translation> </message> <message> - <source>Starting %1 ...</source> - <translation>Démarrage de %1 …</translation> + <source>Starting %1...</source> + <translation>Démarrage de %1…</translation> </message> <message> <source>Version</source> @@ -16725,7 +16725,7 @@ Le code a été copié dans votre presse-papiers.</translation> <translation>Requête de suggestion Copilot à la position actuelle du curseur de l'éditeur.</translation> </message> <message> - <source>Show next Copilot Suggestion</source> + <source>Show Next Copilot Suggestion</source> <translation>Afficher la suggestion Copilot suivante</translation> </message> <message> @@ -16733,7 +16733,7 @@ Le code a été copié dans votre presse-papiers.</translation> <translation>Alterner parmi les suggestions Copilot reçues pour afficher la suggestion suivante disponible.</translation> </message> <message> - <source>Show previos Copilot Suggestion</source> + <source>Show Previous Copilot Suggestion</source> <translation>Afficher la suggestion Copilot précédente</translation> </message> <message> @@ -20030,8 +20030,8 @@ Double-cliquez pour modifier l’élément.</translation> <translation>Impossible de lancer « %1 » : %2</translation> </message> <message> - <source>A timeout occurred running "%1"</source> - <translation>Un dépassement de délai s’est produit lors de l’exécution de « %1 »</translation> + <source>A timeout occurred running "%1".</source> + <translation>Un dépassement de délai s’est produit lors de l’exécution de « %1 ».</translation> </message> <message> <source>"%1" crashed.</source> @@ -27418,8 +27418,8 @@ La recompilation du projet peut aider.</translation> <translation>La liste des répertoires sources ne doit pas être vide.</translation> </message> <message> - <source>Host directories to mount into the container</source> - <translation>Répertoires hôtes à monter dans le conteneur</translation> + <source>Host directories to mount into the container.</source> + <translation>Répertoires hôtes à monter dans le conteneur.</translation> </message> <message> <source>Maps paths in this list one-to-one to the docker container.</source> @@ -49074,9 +49074,9 @@ Le fichier de destination « %1 » existe déjà.</translation> </message> <message> <source>Could not merge results into single results.xml. -Failed to open file "%1"</source> +Failed to open file "%1".</source> <translation>Impossible de fusionner les résultats dans un unique fichier results.xml. -Impossible d'ouvrir le fichier « %1 »</translation> +Impossible d'ouvrir le fichier « %1 ».</translation> </message> <message> <source>Error while parsing first test result.</source> @@ -49473,7 +49473,7 @@ Impossible d'ouvrir le fichier « %1 »</translation> <translation>Envoyer la touche d'échappement au terminal</translation> </message> <message> - <source>Sends the escape key to the terminal when pressedinstead of closing the terminal.</source> + <source>Sends the escape key to the terminal when pressed instead of closing the terminal.</source> <translation>Envoi la touche d'échappement au terminal lorsque appuyé au lieu de fermer le terminal.</translation> </message> <message> @@ -52695,8 +52695,8 @@ Les données de la trace sont perdues.</translation> <translation>Motif d’excl&usion :</translation> </message> <message> - <source>List of comma separated wildcard filters. </source> - <translation>Liste de filtres joker séparés par des virgules. </translation> + <source>List of comma separated wildcard filters.</source> + <translation>Liste de filtres joker séparés par des virgules.</translation> </message> <message> <source>Files with file name or full file path matching any filter are included.</source> @@ -54704,8 +54704,8 @@ Vérifiez les paramètres pour vous assurer que Valgrind est installé et dispon <translation>Éditeur de Manifest Vcpkg</translation> </message> <message> - <source>Name:</source> - <translation>Nom:</translation> + <source>Name:</source> + <translation>Nom :</translation> </message> <message> <source>Version:</source> diff --git a/share/qtcreator/translations/qtcreator_hr.ts b/share/qtcreator/translations/qtcreator_hr.ts index c408f28563a..5cb6489b7ed 100644 --- a/share/qtcreator/translations/qtcreator_hr.ts +++ b/share/qtcreator/translations/qtcreator_hr.ts @@ -18568,8 +18568,8 @@ Do you want to kill it?</source> <translation>Nije moguće pokrenuti „%1”: %2</translation> </message> <message> - <source>A timeout occurred running "%1"</source> - <translation>Došlo je do prekoračenja vremena prilikom pokretanja „%1”</translation> + <source>A timeout occurred running "%1".</source> + <translation>Došlo je do prekoračenja vremena prilikom pokretanja „%1”.</translation> </message> <message> <source>"%1" crashed.</source> diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts index 6bfd303b72d..71665c23d51 100644 --- a/share/qtcreator/translations/qtcreator_ja.ts +++ b/share/qtcreator/translations/qtcreator_ja.ts @@ -32559,8 +32559,8 @@ API バージョンが %1 以上の SDK をインストールしてください <translation>"%1" を起動できません: %2</translation> </message> <message> - <source>A timeout occurred running "%1"</source> - <translation>"%1" を実行中にタイムアウトが発生しました</translation> + <source>A timeout occurred running "%1".</source> + <translation>"%1" を実行中にタイムアウトが発生しました。</translation> </message> <message> <source>"%1" crashed.</source> @@ -46500,8 +46500,8 @@ Stepping into the module or setting breakpoints by file and line is expected to <context> <name>QmlDesigner::GenerateResource</name> <message> - <source>A timeout occurred running "%1"</source> - <translation>"%1" を実行中にタイムアウトが発生しました</translation> + <source>A timeout occurred running "%1".</source> + <translation>"%1" を実行中にタイムアウトが発生しました。</translation> </message> <message> <source>"%1" crashed.</source> diff --git a/share/qtcreator/translations/qtcreator_pl.ts b/share/qtcreator/translations/qtcreator_pl.ts index f207ab64d56..fb3b9a36e3f 100644 --- a/share/qtcreator/translations/qtcreator_pl.ts +++ b/share/qtcreator/translations/qtcreator_pl.ts @@ -28623,8 +28623,8 @@ Do you want to check them out now?</source> <translation>Nie można uruchomić "%1": %2</translation> </message> <message> - <source>A timeout occurred running "%1"</source> - <translation>Przekroczono limit czasu oczekiwania na odpowiedź od uruchomionego "%1"</translation> + <source>A timeout occurred running "%1".</source> + <translation>Przekroczono limit czasu oczekiwania na odpowiedź od uruchomionego "%1".</translation> </message> <message> <source>"%1" crashed.</source> diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index 23561e76c50..ed5d78ba7a2 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -10560,8 +10560,8 @@ Double-click to edit item.</source> <translation>Не удалось запустить «%1»: %2</translation> </message> <message> - <source>A timeout occurred running "%1"</source> - <translation>Истекло время работы «%1»</translation> + <source>A timeout occurred running "%1".</source> + <translation>Истекло время работы «%1».</translation> </message> <message> <source>"%1" crashed.</source> @@ -34843,8 +34843,8 @@ Neither the path to the library nor the path to its includes is added to the .pr <translation>Не удалось создать файл ресурсов: %1</translation> </message> <message> - <source>A timeout occurred running "%1"</source> - <translation>Истекло время работы «%1»</translation> + <source>A timeout occurred running "%1".</source> + <translation>Истекло время работы «%1».</translation> </message> <message> <source>"%1" crashed.</source> diff --git a/share/qtcreator/translations/qtcreator_sl.ts b/share/qtcreator/translations/qtcreator_sl.ts index 97b4fe1b6cc..e5b3b87b02b 100644 --- a/share/qtcreator/translations/qtcreator_sl.ts +++ b/share/qtcreator/translations/qtcreator_sl.ts @@ -15893,8 +15893,8 @@ Projekte programov QML izvede pregledovalnik QML in jih ni potrebno zgraditi.</t <translation>Ni moč zagnati »%1«: %2</translation> </message> <message> - <source>A timeout occurred running '%1'</source> - <translation>Med poganjanjem »%1« je potekel čas</translation> + <source>A timeout occurred running "%1".</source> + <translation>Med poganjanjem »%1« je potekel čas.</translation> </message> <message> <source>'%1' crashed.</source> diff --git a/share/qtcreator/translations/qtcreator_uk.ts b/share/qtcreator/translations/qtcreator_uk.ts index 5e90d729015..432f5ab3a24 100644 --- a/share/qtcreator/translations/qtcreator_uk.ts +++ b/share/qtcreator/translations/qtcreator_uk.ts @@ -35645,8 +35645,8 @@ Install an SDK of at least API version %1.</source> <translation>Неможливо запустити "%1": %2</translation> </message> <message> - <source>A timeout occurred running "%1"</source> - <translation>Час очікування вичерпано для "%1"</translation> + <source>A timeout occurred running "%1".</source> + <translation>Час очікування вичерпано для "%1".</translation> </message> <message> <source>"%1" crashed.</source> diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 0cae4a5a7a2..3ae81e4f3ea 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -1308,8 +1308,8 @@ This cannot be undone.</source> <translation>无法为 %1 创建文件 “%2”</translation> </message> <message> - <source>A timeout occurred running "%1"</source> - <translation>运行 “%1” 时超时</translation> + <source>A timeout occurred running "%1".</source> + <translation>运行 “%1” 时超时。</translation> </message> <message> <source>Crash while creating file for %1 "%2"</source> @@ -4114,7 +4114,7 @@ Warning: this is an experimental feature and might lead to failing to execute th <translation>目标驱动器:</translation> </message> <message> - <source>Starting %1 ...</source> + <source>Starting %1...</source> <translation>启动 %1...</translation> </message> <message> @@ -8538,7 +8538,7 @@ Set a valid executable first.</source> <translation type="unfinished"></translation> </message> <message> - <source>A timeout occurred running "%1"</source> + <source>A timeout occurred running "%1".</source> <translation type="unfinished"></translation> </message> <message> @@ -18145,7 +18145,7 @@ Rebuilding the project might help.</source> <translation type="unfinished"></translation> </message> <message> - <source>Host directories to mount into the container</source> + <source>Host directories to mount into the container.</source> <translation type="unfinished"></translation> </message> <message> @@ -33329,7 +33329,7 @@ The following files or directories are missing: <translation type="unfinished"></translation> </message> <message> - <source>A timeout occurred running "%1"</source> + <source>A timeout occurred running "%1".</source> <translation type="unfinished"></translation> </message> <message> @@ -41375,7 +41375,7 @@ Destination file "%1" already exists.</source> </message> <message> <source>Could not merge results into single results.xml. -Failed to open file "%1"</source> +Failed to open file "%1".</source> <translation type="unfinished"></translation> </message> <message> diff --git a/share/qtcreator/translations/qtcreator_zh_TW.ts b/share/qtcreator/translations/qtcreator_zh_TW.ts index 500e7548e81..d21d4d9bca2 100644 --- a/share/qtcreator/translations/qtcreator_zh_TW.ts +++ b/share/qtcreator/translations/qtcreator_zh_TW.ts @@ -13569,8 +13569,8 @@ Requires <b>Qt 4.7.4</b> or newer.</source> <translation>無法啟動 '%1':%2</translation> </message> <message> - <source>A timeout occurred running '%1'</source> - <translation>執行 '%1' 發生逾時</translation> + <source>A timeout occurred running "%1".</source> + <translation>執行 '%1' 發生逾時。</translation> </message> <message> <source>'%1' crashed.</source> diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index 6340d5e1191..f97934cde40 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -495,7 +495,7 @@ QString msgExclusionPatternLabel() QString msgFilePatternToolTip(InclusionType inclusionType) { - return Tr::tr("List of comma separated wildcard filters. ") + return Tr::tr("List of comma separated wildcard filters.") + " " + (inclusionType == InclusionType::Included ? Tr::tr("Files with file name or full file path matching any filter are included.") : Tr::tr("Files with file name or full file path matching any filter are excluded.")); diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index c48ad217ec0..ce8fbcf8614 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -281,7 +281,7 @@ AndroidSettingsWidget::AndroidSettingsWidget() { JavaPathExistsAndWritableRow, Tr::tr("JDK path exists and is writable.") }, { SdkPathExistsAndWritableRow, Tr::tr("Android SDK path exists and is writable.") }, { SdkToolsInstalledRow, Tr::tr("Android SDK Command-line Tools installed.") }, - { SdkManagerSuccessfulRow, Tr::tr("Android SDK Command-line Tools run.") }, + { SdkManagerSuccessfulRow, Tr::tr("Android SDK Command-line Tools runs.") }, { PlatformToolsInstalledRow, Tr::tr("Android SDK Platform-Tools installed.") }, { AllEssentialsInstalledRow, Tr::tr( "All essential packages installed for all installed Qt versions.") }, diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index 49eccb1187c..f77a0ce0cfd 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -368,8 +368,7 @@ UvscServerProviderRunner::UvscServerProviderRunner(ProjectExplorer::RunControl * void UvscServerProviderRunner::start() { - const QString msg = Tr::tr("Starting %1 ...") - .arg(m_process.commandLine().displayName()); + const QString msg = Tr::tr("Starting %1...").arg(m_process.commandLine().displayName()); appendMessage(msg, NormalMessageFormat); m_process.start(); diff --git a/src/plugins/copilot/copilotplugin.cpp b/src/plugins/copilot/copilotplugin.cpp index 8af42ae0c07..47364c60d7d 100644 --- a/src/plugins/copilot/copilotplugin.cpp +++ b/src/plugins/copilot/copilotplugin.cpp @@ -72,7 +72,7 @@ void CopilotPlugin::initialize() ActionManager::registerAction(requestAction, Constants::COPILOT_REQUEST_SUGGESTION); QAction *nextSuggestionAction = new QAction(this); - nextSuggestionAction->setText(Tr::tr("Show next Copilot Suggestion")); + nextSuggestionAction->setText(Tr::tr("Show Next Copilot Suggestion")); nextSuggestionAction->setToolTip(Tr::tr( "Cycles through the received Copilot Suggestions showing the next available Suggestion.")); @@ -84,7 +84,7 @@ void CopilotPlugin::initialize() ActionManager::registerAction(nextSuggestionAction, Constants::COPILOT_NEXT_SUGGESTION); QAction *previousSuggestionAction = new QAction(this); - previousSuggestionAction->setText(Tr::tr("Show previos Copilot Suggestion")); + previousSuggestionAction->setText(Tr::tr("Show Previous Copilot Suggestion")); previousSuggestionAction->setToolTip(Tr::tr("Cycles through the received Copilot Suggestions " "showing the previous available Suggestion.")); diff --git a/src/plugins/coreplugin/patchtool.cpp b/src/plugins/coreplugin/patchtool.cpp index 89144f7a27d..c17db9ba927 100644 --- a/src/plugins/coreplugin/patchtool.cpp +++ b/src/plugins/coreplugin/patchtool.cpp @@ -97,8 +97,8 @@ static bool runPatchHelper(const QByteArray &input, const FilePath &workingDirec if (!patchProcess.readDataFromProcess(&stdOut, &stdErr)) { patchProcess.stop(); patchProcess.waitForFinished(); - MessageManager::writeFlashing(Tr::tr("A timeout occurred running \"%1\"") - .arg(patch.toUserOutput())); + MessageManager::writeFlashing( + Tr::tr("A timeout occurred running \"%1\".").arg(patch.toUserOutput())); return false; } diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index ec6403dd79f..c47de707914 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -187,7 +187,7 @@ DockerDeviceSettings::DockerDeviceSettings() mounts.setLabelText(Tr::tr("Paths to mount:")); mounts.setDefaultValue({Core::DocumentManager::projectsDirectory().toString()}); mounts.setToolTip(Tr::tr("Maps paths in this list one-to-one to the docker container.")); - mounts.setPlaceHolderText(Tr::tr("Host directories to mount into the container")); + mounts.setPlaceHolderText(Tr::tr("Host directories to mount into the container.")); extraArgs.setSettingsKey(DockerDeviceExtraArgs); extraArgs.setLabelText(Tr::tr("Extra arguments:")); diff --git a/src/plugins/qmldesigner/generateresource.cpp b/src/plugins/qmldesigner/generateresource.cpp index e2d6dad9a95..de8cd5a80b4 100644 --- a/src/plugins/qmldesigner/generateresource.cpp +++ b/src/plugins/qmldesigner/generateresource.cpp @@ -190,9 +190,10 @@ static bool runRcc(const CommandLine &command, const FilePath &workingDir, QByteArray stdOut; QByteArray stdErr; if (!rccProcess.readDataFromProcess(&stdOut, &stdErr)) { - Core::MessageManager::writeDisrupting(QCoreApplication::translate( - "QmlDesigner::GenerateResource", "A timeout occurred running \"%1\"") - .arg(rccProcess.commandLine().toUserOutput())); + Core::MessageManager::writeDisrupting( + QCoreApplication::translate("QmlDesigner::GenerateResource", + "A timeout occurred running \"%1\".") + .arg(rccProcess.commandLine().toUserOutput())); return false; } if (!stdOut.trimmed().isEmpty()) diff --git a/src/plugins/squish/squishxmloutputhandler.cpp b/src/plugins/squish/squishxmloutputhandler.cpp index a9f59af44a3..d41e4bccc8d 100644 --- a/src/plugins/squish/squishxmloutputhandler.cpp +++ b/src/plugins/squish/squishxmloutputhandler.cpp @@ -50,7 +50,7 @@ void SquishXmlOutputHandler::mergeResultFiles(const Utils::FilePaths &reportFile if (!resultsXML.open(QFile::WriteOnly)) { if (error) *error = Tr::tr("Could not merge results into single results.xml.\n" - "Failed to open file \"%1\"") + "Failed to open file \"%1\".") .arg(resultsXML.fileName()); return; } diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index 63fcdac3bb1..57093d20a6e 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -482,9 +482,8 @@ TerminalSettings::TerminalSettings() sendEscapeToTerminal.setSettingsKey("SendEscapeToTerminal"); sendEscapeToTerminal.setLabelText(Tr::tr("Send escape key to terminal")); - sendEscapeToTerminal.setToolTip( - Tr::tr("Sends the escape key to the terminal when pressed" - "instead of closing the terminal.")); + sendEscapeToTerminal.setToolTip(Tr::tr("Sends the escape key to the terminal when pressed " + "instead of closing the terminal.")); sendEscapeToTerminal.setDefaultValue(false); lockKeyboard.setSettingsKey("LockKeyboard"); diff --git a/src/plugins/vcpkg/vcpkgsearch.cpp b/src/plugins/vcpkg/vcpkgsearch.cpp index ddf42bd8a61..dd0f4e93d7d 100644 --- a/src/plugins/vcpkg/vcpkgsearch.cpp +++ b/src/plugins/vcpkg/vcpkgsearch.cpp @@ -88,6 +88,7 @@ VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(const VcpkgManifest &preexist m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + // clang-format off using namespace Layouting; Column { Row { @@ -99,7 +100,7 @@ VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(const VcpkgManifest &preexist Group { title(Tr::tr("Package details")), Form { - Tr::tr("Name:"), m_vcpkgName, br, + Tr::tr("Name:"), m_vcpkgName, br, Tr::tr("Version:"), m_vcpkgVersion, br, Tr::tr("License:"), m_vcpkgLicense, br, Tr::tr("Description:"), m_vcpkgDescription, br, @@ -109,6 +110,7 @@ VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(const VcpkgManifest &preexist }, Row { m_infoLabel, m_buttonBox }, }.attachTo(this); + // clang-format on m_allPackages = vcpkgManifests(settings().vcpkgRoot()); From 15d31610ee0ceafa8d84f39ed8191794cb36f791 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 16 Oct 2023 12:10:15 +0200 Subject: [PATCH 1654/1777] Tr: Use more arg() and move tags out Change-Id: I80e28de3add81d0569b87dbb1712229cda5fb42a Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- share/qtcreator/translations/qtcreator_de.ts | 20 +++++++++---------- share/qtcreator/translations/qtcreator_fr.ts | 20 +++++++++---------- .../qtcreator/translations/qtcreator_zh_CN.ts | 8 ++++---- .../androidmanifesteditoriconwidget.cpp | 10 +++++++--- src/plugins/autotest/qtest/qttesttreeitem.cpp | 9 ++++++--- src/plugins/copilot/authwidget.cpp | 5 +++-- src/plugins/copilot/copilotsettings.cpp | 14 +++++++------ 7 files changed, 48 insertions(+), 38 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 3fc1a98bfe2..57623ee8908 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -10836,8 +10836,8 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni <translation>Klicken zum Auswählen...</translation> </message> <message> - <source>Images (*.png *.jpg *.jpeg *.webp *.svg)</source> - <translation>Bilder (*.png *.jpg *.jpeg *.webp *.svg)</translation> + <source>Images %1</source> + <translation>Bilder %1</translation> </message> <message> <source>%1 has been stopped.</source> @@ -12301,8 +12301,8 @@ Siehe auch die Einstellungen für Google Test.</translation> <translation>Qt Test</translation> </message> <message> - <source><p>Multiple testcases inside a single executable are not officially supported. Depending on the implementation they might get executed or not, but never will be explicitly selectable.</p></source> - <translation><p>Mehrere Testfälle in der gleichen ausführbaren Datei werden nicht offiziell unterstützt. Abhängig von der Implementation werden sie möglicherweise ausgeführt oder auch nicht, aber sie werden niemals explizit auswählbar sein.</p></translation> + <source>Multiple testcases inside a single executable are not officially supported. Depending on the implementation they might get executed or not, but never will be explicitly selectable.</source> + <translation>Mehrere Testfälle in der gleichen ausführbaren Datei werden nicht offiziell unterstützt. Abhängig von der Implementation werden sie möglicherweise ausgeführt oder auch nicht, aber sie werden niemals explizit auswählbar sein.</translation> </message> <message> <source>inherited</source> @@ -16965,8 +16965,8 @@ Der Code wurde in die Zwischenablage kopiert.</translation> <translation>Anmeldung fehlgeschlagen</translation> </message> <message> - <source>The login request failed: </source> - <translation>Die Anmeldung ist fehlgeschlagen: </translation> + <source>The login request failed: %1</source> + <translation>Die Anmeldung ist fehlgeschlagen: %1</translation> </message> <message> <source>Select Previous Copilot Suggestion</source> @@ -17066,8 +17066,8 @@ Ansonsten müssen Sie den Pfad zur Datei %2 aus dem Copilot-Plugin für Neovim a <translation>Pfad zu Node.js</translation> </message> <message> - <source>Select path to node.js executable. See https://nodejs.org/en/download/for installation instructions.</source> - <translation>Wählen Sie den Pfad zur ausführbaren node.js-Datei. Siehe auch https://nodejs.org/en/download/ für eine Installationsanleitung.</translation> + <source>Select path to node.js executable. See %1 for installation instructions.</source> + <translation>Wählen Sie den Pfad zur ausführbaren node.js-Datei. Siehe auch %1 für eine Installationsanleitung.</translation> </message> <message> <source>Path to agent.js:</source> @@ -17078,8 +17078,8 @@ Ansonsten müssen Sie den Pfad zur Datei %2 aus dem Copilot-Plugin für Neovim a <translation>Pfad zu agent.js</translation> </message> <message> - <source>Select path to agent.js in Copilot Neovim plugin. See https://github.com/github/copilot.vim#getting-started for installation instructions.</source> - <translation>Wählen Sie den Pfad zur agent.js-Datei vom Copilot-Plugin für Neovim. Siehe auch https://github.com/github/copilot.vim#getting-started für eine Installationsanleitung.</translation> + <source>Select path to agent.js in Copilot Neovim plugin. See %1 for installation instructions.</source> + <translation>Wählen Sie den Pfad zur agent.js-Datei vom Copilot-Plugin für Neovim. Siehe auch %1 für eine Installationsanleitung.</translation> </message> <message> <source>Auto Complete</source> diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index ab8e488103b..c050a6f3a0a 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -10478,8 +10478,8 @@ Les fichiers du répertoire source du paquet Android sont copiés dans le réper <translation>Cliquer pour sélectionner…</translation> </message> <message> - <source>Images (*.png *.jpg *.jpeg *.webp *.svg)</source> - <translation>Images (*.png *.jpg *.jpeg *.webp *.svg)</translation> + <source>Images %1</source> + <translation>Images %1</translation> </message> <message> <source>Deploy to Android Device</source> @@ -11597,8 +11597,8 @@ Avertissement : l'activation de cette fonctionnalité augmente signifi <translation>Métriques du benchmark</translation> </message> <message> - <source><p>Multiple testcases inside a single executable are not officially supported. Depending on the implementation they might get executed or not, but never will be explicitly selectable.</p></source> - <translation><p>La présence de plusieurs cas de tests dans un unique exécutable n'est officiellement pas supportée. Suivant l'implémentation, ils peuvent être exécutés ou non mais il ne seront jamais sélectionnables explicitement.</p></translation> + <source>Multiple testcases inside a single executable are not officially supported. Depending on the implementation they might get executed or not, but never will be explicitly selectable.</source> + <translation>La présence de plusieurs cas de tests dans un unique exécutable n'est officiellement pas supportée. Suivant l'implémentation, ils peuvent être exécutés ou non mais il ne seront jamais sélectionnables explicitement.</translation> </message> <message> <source>inherited</source> @@ -16689,8 +16689,8 @@ Le code a été copié dans votre presse-papiers.</translation> <translation>Identification échouée</translation> </message> <message> - <source>The login request failed: </source> - <translation>La requête d'identification a échouée : </translation> + <source>The login request failed: %1</source> + <translation>La requête d'identification a échouée : %1</translation> </message> <message> <source>Copilot</source> @@ -16773,8 +16773,8 @@ Le code a été copié dans votre presse-papiers.</translation> <translation>Chemin Node.js</translation> </message> <message> - <source>Select path to node.js executable. See https://nodejs.org/en/download/for installation instructions.</source> - <translation>Sélectionner le chemin menant à l'exécutable node.js. Voir https://nodejs.org/fr/download/ pour les instructions d'installation.</translation> + <source>Select path to node.js executable. See %1 for installation instructions.</source> + <translation>Sélectionner le chemin menant à l'exécutable node.js. Voir %1 pour les instructions d'installation.</translation> </message> <message> <source>Path to agent.js:</source> @@ -16785,8 +16785,8 @@ Le code a été copié dans votre presse-papiers.</translation> <translation>Chemin Agent.js</translation> </message> <message> - <source>Select path to agent.js in Copilot Neovim plugin. See https://github.com/github/copilot.vim#getting-started for installation instructions.</source> - <translation>Sélectionner le chemin vers agent.js dans le plug-in Copilot Neovim Voir https://github.com/github/copilot.vim#getting-started pour les instructions d'installation.</translation> + <source>Select path to agent.js in Copilot Neovim plugin. See %1 for installation instructions.</source> + <translation>Sélectionner le chemin vers agent.js dans le plug-in Copilot Neovim Voir %1 pour les instructions d'installation.</translation> </message> <message> <source>Auto Complete</source> diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 3ae81e4f3ea..92175bdf0c5 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -1083,8 +1083,8 @@ This cannot be undone.</source> <translation>单击以选择...</translation> </message> <message> - <source>Images (*.png *.jpg *.jpeg *.webp *.svg)</source> - <translation>图片(*.png *.jpg *.jpeg *.webp *.svg)</translation> + <source>Images %1</source> + <translation>图片 %1</translation> </message> <message> <source>Include default permissions for Qt modules.</source> @@ -2986,8 +2986,8 @@ Warning: Plain text misses some information, such as duration.</source> <translation>基准测试指标</translation> </message> <message> - <source><p>Multiple testcases inside a single executable are not officially supported. Depending on the implementation they might get executed or not, but never will be explicitly selectable.</p></source> - <translation><p>官方不支持单一可执行程序中的多个测试用例,根据具体实现,它可能会被执行,但绝不会被明确选择</p></translation> + <source>Multiple testcases inside a single executable are not officially supported. Depending on the implementation they might get executed or not, but never will be explicitly selectable.</source> + <translation>官方不支持单一可执行程序中的多个测试用例,根据具体实现,它可能会被执行,但绝不会被明确选择</translation> </message> <message> <source>inherited</source> diff --git a/src/plugins/android/androidmanifesteditoriconwidget.cpp b/src/plugins/android/androidmanifesteditoriconwidget.cpp index e0b23ff6ae8..2c2dfca47e1 100644 --- a/src/plugins/android/androidmanifesteditoriconwidget.cpp +++ b/src/plugins/android/androidmanifesteditoriconwidget.cpp @@ -143,9 +143,13 @@ void AndroidManifestEditorIconWidget::setIconFromPath(const FilePath &iconPath) void AndroidManifestEditorIconWidget::selectIcon() { - FilePath file = FileUtils::getOpenFilePath(this, m_iconSelectionText, - FileUtils::homePath(), - Tr::tr("Images (*.png *.jpg *.jpeg *.webp *.svg)")); // TODO: See SplashContainterWidget + FilePath file = FileUtils::getOpenFilePath( + this, + m_iconSelectionText, + FileUtils::homePath(), + //: %1 expands to wildcard list for file dialog, do not change order + Tr::tr("Images %1") + .arg("(*.png *.jpg *.jpeg *.webp *.svg)")); // TODO: See SplashContainterWidget if (file.isEmpty()) return; setIconFromPath(file); diff --git a/src/plugins/autotest/qtest/qttesttreeitem.cpp b/src/plugins/autotest/qtest/qttesttreeitem.cpp index 0c535fa9f81..de27cb089ff 100644 --- a/src/plugins/autotest/qtest/qttesttreeitem.cpp +++ b/src/plugins/autotest/qtest/qttesttreeitem.cpp @@ -47,9 +47,12 @@ QVariant QtTestTreeItem::data(int column, int role) const case Qt::ToolTipRole: { QString toolTip = TestTreeItem::data(column, role).toString(); if (m_multiTest && type() == TestCase) { - toolTip.append(Tr::tr("<p>Multiple testcases inside a single executable are not officially " - "supported. Depending on the implementation they might get executed " - "or not, but never will be explicitly selectable.</p>")); + toolTip.append( + "<p>" + + Tr::tr("Multiple testcases inside a single executable are not officially " + "supported. Depending on the implementation they might get executed " + "or not, but never will be explicitly selectable.") + + "</p>"); } else if (type() == TestFunction) { // avoid confusion (displaying header file, but ending up inside source) toolTip = parentItem()->name() + "::" + name(); diff --git a/src/plugins/copilot/authwidget.cpp b/src/plugins/copilot/authwidget.cpp index ffafc8381b4..0b5cfd2d93d 100644 --- a/src/plugins/copilot/authwidget.cpp +++ b/src/plugins/copilot/authwidget.cpp @@ -155,8 +155,9 @@ void AuthWidget::signIn() QMessageBox::critical(this, Tr::tr("Login Failed"), Tr::tr( - "The login request failed: ") - + response.error()->message()); + "The login request failed: %1") + .arg(response.error() + ->message())); setState("Sign in", response.error()->message(), false); return; } diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index 586fd8528b9..1f2b59523d3 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -73,9 +73,10 @@ CopilotSettings::CopilotSettings() nodeJsPath.setLabelText(Tr::tr("Node.js path:")); nodeJsPath.setHistoryCompleter("Copilot.NodePath.History"); nodeJsPath.setDisplayName(Tr::tr("Node.js Path")); - nodeJsPath.setToolTip( - Tr::tr("Select path to node.js executable. See https://nodejs.org/en/download/" - "for installation instructions.")); + //: %1 is the URL to nodejs + nodeJsPath.setToolTip(Tr::tr("Select path to node.js executable. See %1 " + "for installation instructions.") + .arg("https://nodejs.org/en/download/")); distPath.setExpectedKind(PathChooser::File); distPath.setDefaultValue(distFromVim.toUserOutput()); @@ -83,9 +84,10 @@ CopilotSettings::CopilotSettings() distPath.setLabelText(Tr::tr("Path to agent.js:")); distPath.setHistoryCompleter("Copilot.DistPath.History"); distPath.setDisplayName(Tr::tr("Agent.js path")); - distPath.setToolTip(Tr::tr( - "Select path to agent.js in Copilot Neovim plugin. See " - "https://github.com/github/copilot.vim#getting-started for installation instructions.")); + //: %1 is the URL to copilot.vim getting started + distPath.setToolTip(Tr::tr("Select path to agent.js in Copilot Neovim plugin. See " + "%1 for installation instructions.") + .arg("https://github.com/github/copilot.vim#getting-started")); autoComplete.setDisplayName(Tr::tr("Auto Request")); autoComplete.setSettingsKey("Copilot.Autocomplete"); From a253a2aa9553b219cb3444706461f6ddb630c5b2 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Mon, 16 Oct 2023 15:14:01 +0200 Subject: [PATCH 1655/1777] Tr: Fix lupdate issues Add missing `Tr::` and use some fully qualified namespaces where lupdate fails to resolve it correctly. Change-Id: Ied4ac7bf0438a9080d0b76a9a1f5033dbc94a163 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../advanceddockingsystem/autohidetab.cpp | 17 +++++----- .../dockareatitlebar.cpp | 32 ++++++++++--------- .../advanceddockingsystem/dockwidgettab.cpp | 18 +++++------ .../autoreconfstep.cpp | 3 +- .../cmakeprojectmanager/cmakeparser.cpp | 4 ++- .../cmakeprojectmanager/presetsparser.cpp | 18 +++++++---- src/plugins/compilerexplorer/api/request.h | 3 +- src/plugins/coreplugin/systemsettings.cpp | 2 +- .../qmakeprojectmanager/addlibrarywizard.cpp | 4 +-- .../connectioneditor/connectionview.cpp | 5 +-- .../qmljseditor/qmljseditingsettingspage.cpp | 2 +- src/plugins/qtsupport/qtoptionspage.cpp | 4 +-- src/plugins/texteditor/texteditor.cpp | 10 +++--- 13 files changed, 66 insertions(+), 56 deletions(-) diff --git a/src/libs/advanceddockingsystem/autohidetab.cpp b/src/libs/advanceddockingsystem/autohidetab.cpp index 1d8f7a50a65..dd3f3f6c820 100644 --- a/src/libs/advanceddockingsystem/autohidetab.cpp +++ b/src/libs/advanceddockingsystem/autohidetab.cpp @@ -4,6 +4,7 @@ #include "autohidetab.h" #include "ads_globals_p.h" +#include "advanceddockingsystemtr.h" #include "autohidedockcontainer.h" #include "autohidesidebar.h" #include "dockareawidget.h" @@ -335,7 +336,7 @@ void AutoHideTab::contextMenuEvent(QContextMenuEvent *event) const bool isFloatable = d->m_dockWidget->features().testFlag(DockWidget::DockWidgetFloatable); QMenu menu(this); - QAction *detachAction = menu.addAction(tr("Detach")); + QAction *detachAction = menu.addAction(Tr::tr("Detach")); detachAction->connect(detachAction, &QAction::triggered, this, @@ -345,17 +346,17 @@ void AutoHideTab::contextMenuEvent(QContextMenuEvent *event) auto isPinnable = d->m_dockWidget->features().testFlag(DockWidget::DockWidgetPinnable); detachAction->setEnabled(isPinnable); - auto pinToMenu = menu.addMenu(tr("Pin To...")); + auto pinToMenu = menu.addMenu(Tr::tr("Pin To...")); pinToMenu->setEnabled(isPinnable); - d->createAutoHideToAction(tr("Top"), SideBarTop, pinToMenu); - d->createAutoHideToAction(tr("Left"), SideBarLeft, pinToMenu); - d->createAutoHideToAction(tr("Right"), SideBarRight, pinToMenu); - d->createAutoHideToAction(tr("Bottom"), SideBarBottom, pinToMenu); + d->createAutoHideToAction(Tr::tr("Top"), SideBarTop, pinToMenu); + d->createAutoHideToAction(Tr::tr("Left"), SideBarLeft, pinToMenu); + d->createAutoHideToAction(Tr::tr("Right"), SideBarRight, pinToMenu); + d->createAutoHideToAction(Tr::tr("Bottom"), SideBarBottom, pinToMenu); - QAction *unpinAction = menu.addAction(tr("Unpin (Dock)")); + QAction *unpinAction = menu.addAction(Tr::tr("Unpin (Dock)")); unpinAction->connect(unpinAction, &QAction::triggered, this, &AutoHideTab::unpinDockWidget); menu.addSeparator(); - QAction *closeAction = menu.addAction(tr("Close")); + QAction *closeAction = menu.addAction(Tr::tr("Close")); closeAction->connect(closeAction, &QAction::triggered, this, diff --git a/src/libs/advanceddockingsystem/dockareatitlebar.cpp b/src/libs/advanceddockingsystem/dockareatitlebar.cpp index 234916d530d..7a2e6770621 100644 --- a/src/libs/advanceddockingsystem/dockareatitlebar.cpp +++ b/src/libs/advanceddockingsystem/dockareatitlebar.cpp @@ -656,7 +656,8 @@ void DockAreaTitleBar::contextMenuEvent(QContextMenuEvent *event) QMenu menu(this); if (!isTopLevelArea) { - QAction *detachAction = menu.addAction(isAutoHide ? tr("Detach") : tr("Detach Group")); + QAction *detachAction = menu.addAction(isAutoHide ? Tr::tr("Detach") + : Tr::tr("Detach Group")); detachAction->connect(detachAction, &QAction::triggered, this, @@ -665,7 +666,8 @@ void DockAreaTitleBar::contextMenuEvent(QContextMenuEvent *event) d->m_dockArea->features().testFlag(DockWidget::DockWidgetFloatable)); if (DockManager::testAutoHideConfigFlag(DockManager::AutoHideFeatureEnabled)) { - QAction *pinAction = menu.addAction(isAutoHide ? tr("Unpin (Dock)") : tr("Pin Group")); + QAction *pinAction = menu.addAction(isAutoHide ? Tr::tr("Unpin (Dock)") + : Tr::tr("Pin Group")); pinAction->connect(pinAction, &QAction::triggered, this, @@ -674,17 +676,17 @@ void DockAreaTitleBar::contextMenuEvent(QContextMenuEvent *event) auto areaIsPinnable = d->m_dockArea->features().testFlag(DockWidget::DockWidgetPinnable); pinAction->setEnabled(areaIsPinnable); if (!isAutoHide) { - auto tmp = menu.addMenu(tr("Pin Group To...")); + auto tmp = menu.addMenu(Tr::tr("Pin Group To...")); tmp->setEnabled(areaIsPinnable); - d->createAutoHideToAction(tr("Top"), SideBarTop, tmp); - d->createAutoHideToAction(tr("Left"), SideBarLeft, tmp); - d->createAutoHideToAction(tr("Right"), SideBarRight, tmp); - d->createAutoHideToAction(tr("Bottom"), SideBarBottom, tmp); + d->createAutoHideToAction(Tr::tr("Top"), SideBarTop, tmp); + d->createAutoHideToAction(Tr::tr("Left"), SideBarLeft, tmp); + d->createAutoHideToAction(Tr::tr("Right"), SideBarRight, tmp); + d->createAutoHideToAction(Tr::tr("Bottom"), SideBarBottom, tmp); } } menu.addSeparator(); } - QAction *closeAction = menu.addAction(isAutoHide ? tr("Close") : tr("Close Group")); + QAction *closeAction = menu.addAction(isAutoHide ? Tr::tr("Close") : Tr::tr("Close Group")); closeAction->connect(closeAction, &QAction::triggered, this, @@ -692,7 +694,7 @@ void DockAreaTitleBar::contextMenuEvent(QContextMenuEvent *event) closeAction->setEnabled(d->m_dockArea->features().testFlag(DockWidget::DockWidgetClosable)); if (!isAutoHide && !isTopLevelArea) { - QAction *closeOthersAction = menu.addAction(tr("Close Other Groups")); + QAction *closeOthersAction = menu.addAction(Tr::tr("Close Other Groups")); closeOthersAction->connect(closeOthersAction, &QAction::triggered, d->m_dockArea, @@ -717,22 +719,22 @@ QString DockAreaTitleBar::titleBarButtonToolTip(eTitleBarButton button) const switch (button) { case TitleBarButtonAutoHide: if (d->m_dockArea->isAutoHide()) - return tr("Unpin (Dock)"); + return Tr::tr("Unpin (Dock)"); if (DockManager::testAutoHideConfigFlag(DockManager::AutoHideButtonTogglesArea)) - return tr("Pin Group"); + return Tr::tr("Pin Group"); else - return tr("Pin Active Tab (Press Ctrl to Pin Group)"); + return Tr::tr("Pin Active Tab (Press Ctrl to Pin Group)"); break; case TitleBarButtonClose: if (d->m_dockArea->isAutoHide()) - return tr("Close"); + return Tr::tr("Close"); if (DockManager::testConfigFlag(DockManager::DockAreaCloseButtonClosesTab)) - return tr("Close Active Tab"); + return Tr::tr("Close Active Tab"); else - return tr("Close Group"); + return Tr::tr("Close Group"); break; default: diff --git a/src/libs/advanceddockingsystem/dockwidgettab.cpp b/src/libs/advanceddockingsystem/dockwidgettab.cpp index 4efa339e34e..d450c6ddd19 100644 --- a/src/libs/advanceddockingsystem/dockwidgettab.cpp +++ b/src/libs/advanceddockingsystem/dockwidgettab.cpp @@ -474,7 +474,7 @@ void DockWidgetTab::contextMenuEvent(QContextMenuEvent *event) QMenu menu(this); if (!isTopLevelArea) { - QAction *detachAction = menu.addAction(tr("Detach")); + QAction *detachAction = menu.addAction(Tr::tr("Detach")); detachAction->connect(detachAction, &QAction::triggered, this, @@ -482,7 +482,7 @@ void DockWidgetTab::contextMenuEvent(QContextMenuEvent *event) detachAction->setEnabled(isDetachable); if (DockManager::testAutoHideConfigFlag(DockManager::AutoHideFeatureEnabled)) { - QAction *pinAction = menu.addAction(tr("Pin")); + QAction *pinAction = menu.addAction(Tr::tr("Pin")); pinAction->connect(pinAction, &QAction::triggered, this, @@ -491,23 +491,23 @@ void DockWidgetTab::contextMenuEvent(QContextMenuEvent *event) auto isPinnable = d->m_dockWidget->features().testFlag(DockWidget::DockWidgetPinnable); pinAction->setEnabled(isPinnable); - auto subMenu = menu.addMenu(tr("Pin To...")); + auto subMenu = menu.addMenu(Tr::tr("Pin To...")); subMenu->setEnabled(isPinnable); - d->createAutoHideToAction(tr("Top"), SideBarTop, subMenu); - d->createAutoHideToAction(tr("Left"), SideBarLeft, subMenu); - d->createAutoHideToAction(tr("Right"), SideBarRight, subMenu); - d->createAutoHideToAction(tr("Bottom"), SideBarBottom, subMenu); + d->createAutoHideToAction(Tr::tr("Top"), SideBarTop, subMenu); + d->createAutoHideToAction(Tr::tr("Left"), SideBarLeft, subMenu); + d->createAutoHideToAction(Tr::tr("Right"), SideBarRight, subMenu); + d->createAutoHideToAction(Tr::tr("Bottom"), SideBarBottom, subMenu); } } menu.addSeparator(); - QAction *closeAction = menu.addAction(tr("Close")); + QAction *closeAction = menu.addAction(Tr::tr("Close")); closeAction->connect(closeAction, &QAction::triggered, this, &DockWidgetTab::closeRequested); closeAction->setEnabled(isClosable()); if (d->m_dockArea->openDockWidgetsCount() > 1) { - QAction *closeOthersAction = menu.addAction(tr("Close Others")); + QAction *closeOthersAction = menu.addAction(Tr::tr("Close Others")); closeOthersAction->connect(closeOthersAction, &QAction::triggered, this, diff --git a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp index 2afc690387e..9dea7d6f7fb 100644 --- a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp @@ -72,7 +72,8 @@ private: m_runAutoreconf = true; if (!m_runAutoreconf) { - emit addOutput(Tr::tr("Configuration unchanged, skipping autoreconf step."), + emit addOutput(::AutotoolsProjectManager::Tr::tr( + "Configuration unchanged, skipping autoreconf step."), OutputFormat::NormalMessage); return SetupResult::StopWithDone; } diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.cpp b/src/plugins/cmakeprojectmanager/cmakeparser.cpp index 2e3c954f029..de4633ea617 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeparser.cpp @@ -3,6 +3,8 @@ #include "cmakeparser.h" +#include "cmakeprojectmanagertr.h" + #include <utils/algorithm.h> #include <utils/qtcassert.h> @@ -210,7 +212,7 @@ void CMakeParser::flush() LinkSpecs specs; m_lastTask.details << QString(); - m_lastTask.details << tr("Call stack:"); + m_lastTask.details << Tr::tr("Call stack:"); m_lines += 2; m_callStack->push_front(m_errorOrWarningLine); diff --git a/src/plugins/cmakeprojectmanager/presetsparser.cpp b/src/plugins/cmakeprojectmanager/presetsparser.cpp index f3f92f76fd5..91943b02f7d 100644 --- a/src/plugins/cmakeprojectmanager/presetsparser.cpp +++ b/src/plugins/cmakeprojectmanager/presetsparser.cpp @@ -444,7 +444,8 @@ bool PresetsParser::parse(const Utils::FilePath &jsonFile, QString &errorMessage { const Utils::expected_str<QByteArray> jsonContents = jsonFile.fileContents(); if (!jsonContents) { - errorMessage = Tr::tr("Failed to read file \"%1\".").arg(jsonFile.fileName()); + errorMessage + = ::CMakeProjectManager::Tr::tr("Failed to read file \"%1\".").arg(jsonFile.fileName()); return false; } @@ -460,7 +461,8 @@ bool PresetsParser::parse(const Utils::FilePath &jsonFile, QString &errorMessage } if (!jsonDoc.isObject()) { - errorMessage = Tr::tr("Invalid file \"%1\".").arg(jsonFile.fileName()); + errorMessage + = ::CMakeProjectManager::Tr::tr("Invalid file \"%1\".").arg(jsonFile.fileName()); return false; } @@ -469,7 +471,8 @@ bool PresetsParser::parse(const Utils::FilePath &jsonFile, QString &errorMessage m_presetsData.fileDir = jsonFile.parentDir(); if (!parseVersion(root.value("version"), m_presetsData.version)) { - errorMessage = Tr::tr("Invalid \"version\" in file \"%1\".").arg(jsonFile.fileName()); + errorMessage = ::CMakeProjectManager::Tr::tr("Invalid \"version\" in file \"%1\".") + .arg(jsonFile.fileName()); return false; } @@ -484,8 +487,9 @@ bool PresetsParser::parse(const Utils::FilePath &jsonFile, QString &errorMessage if (!parseConfigurePresets(root.value("configurePresets"), m_presetsData.configurePresets, jsonFile.parentDir())) { - errorMessage - = Tr::tr("Invalid \"configurePresets\" section in %1 file").arg(jsonFile.fileName()); + errorMessage = ::CMakeProjectManager::Tr::tr( + "Invalid \"configurePresets\" section in %1 file") + .arg(jsonFile.fileName()); return false; } @@ -493,8 +497,8 @@ bool PresetsParser::parse(const Utils::FilePath &jsonFile, QString &errorMessage if (!parseBuildPresets(root.value("buildPresets"), m_presetsData.buildPresets, jsonFile.parentDir())) { - errorMessage - = Tr::tr("Invalid \"buildPresets\" section in %1 file").arg(jsonFile.fileName()); + errorMessage = ::CMakeProjectManager::Tr::tr("Invalid \"buildPresets\" section in %1 file") + .arg(jsonFile.fileName()); return false; } diff --git a/src/plugins/compilerexplorer/api/request.h b/src/plugins/compilerexplorer/api/request.h index 0cc57d4c879..dc55ab80b6e 100644 --- a/src/plugins/compilerexplorer/api/request.h +++ b/src/plugins/compilerexplorer/api/request.h @@ -3,6 +3,7 @@ #pragma once +#include <QCoreApplication> #include <QFuture> #include <QJsonArray> #include <QJsonDocument> @@ -91,7 +92,7 @@ QFuture<Result> request( QString errorMessage; if (reply->error() == QNetworkReply::ContentNotFoundError) { - errorMessage = QObject::tr("Not found"); + errorMessage = QCoreApplication::translate("QtC::CompilerExplorer", "Not found"); } else errorMessage = reply->errorString(); diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index aef7055c975..1477fcf747d 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -143,7 +143,7 @@ SystemSettings::SystemSettings() #ifdef ENABLE_CRASHPAD enableCrashReporting.setSettingsKey("CrashReportingEnabled"); enableCrashReporting.setLabelPlacement(BoolAspect::LabelPlacement::Compact); - enableCrashReporting.setLabelText(tr("Enable crash reporting")); + enableCrashReporting.setLabelText(Tr::tr("Enable crash reporting")); enableCrashReporting.setToolTip( Tr::tr("Allow crashes to be automatically reported. Collected reports are " "used for the sole purpose of fixing bugs.")); diff --git a/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp b/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp index 856c5fdd1d4..c6500df0cfd 100644 --- a/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp +++ b/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp @@ -45,7 +45,7 @@ static FancyLineEdit::AsyncValidationResult validateLibraryPath(const QString &i { const FilePath filePath = FilePath::fromUserInput(input); if (!filePath.exists()) - return make_unexpected(Tr::tr("File does not exist.")); + return make_unexpected(::QmakeProjectManager::Tr::tr("File does not exist.")); const QString fileName = filePath.fileName(); @@ -61,7 +61,7 @@ static FancyLineEdit::AsyncValidationResult validateLibraryPath(const QString &i if (regExp.match(fileName).hasMatch()) return input; } - return make_unexpected(Tr::tr("File does not match filter.")); + return make_unexpected(::QmakeProjectManager::Tr::tr("File does not match filter.")); } AddLibraryWizard::AddLibraryWizard(const FilePath &proFile, QWidget *parent) diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionview.cpp b/src/plugins/qmldesigner/components/connectioneditor/connectionview.cpp index b96afd69665..cd63231d5bd 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectionview.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/connectionview.cpp @@ -17,6 +17,7 @@ #include <viewmanager.h> #include <qmldesignerconstants.h> #include <qmldesignerplugin.h> +#include <qmldesignertr.h> #include <studioquickwidget.h> @@ -128,8 +129,8 @@ private: errorString += "\n" + error.toString(); Core::AsynchronousMessageBox::warning( - tr("Cannot Create QtQuick View"), - tr("ConnectionsEditorWidget: %1 cannot be created.%2") + Tr::tr("Cannot Create QtQuick View"), + Tr::tr("ConnectionsEditorWidget: %1 cannot be created.%2") .arg(qmlSourcesPath(), errorString)); return; } diff --git a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp index 642a5facc59..11c7985fd1c 100644 --- a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp +++ b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp @@ -578,7 +578,7 @@ QmlJsEditingSettings QmlJsEditingSettings::get() QmlJsEditingSettingsPage::QmlJsEditingSettingsPage() { setId("C.QmlJsEditing"); - setDisplayName(Tr::tr("QML/JS Editing")); + setDisplayName(::QmlJSEditor::Tr::tr("QML/JS Editing")); setCategory(Constants::SETTINGS_CATEGORY_QML); setWidgetCreator([] { return new QmlJsEditingSettingsPageWidget; }); } diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 741aeeb567c..99a237d7960 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -951,8 +951,8 @@ static FancyLineEdit::AsyncValidationResult validateQtInstallDir(const QString & const QStringList filesToCheck = settingsFilesToCheck() + qtversionFilesToCheck(); return make_unexpected( "<html><body>" - + Tr::tr("Qt installation information was not found in \"%1\". " - "Choose a directory that contains one of the files %2") + + ::QtSupport::Tr::tr("Qt installation information was not found in \"%1\". " + "Choose a directory that contains one of the files %2") .arg(qtDir.toUserOutput(), "<pre>" + filesToCheck.join('\n') + "</pre>")); } return input; diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index ab1ab4cbc42..66e3616af91 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -1094,12 +1094,10 @@ TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent) connect(m_fileLineEnding, &QToolButton::clicked, ActionManager::instance(), [this] { QMenu *menu = new QMenu; - menu->addAction(tr("Unix Line Endings (LF)"), [this] { - q->selectLineEnding(TextFileFormat::LFLineTerminator); - }); - menu->addAction(tr("Windows Line Endings (CRLF)"), [this] { - q->selectLineEnding(TextFileFormat::CRLFLineTerminator); - }); + menu->addAction(Tr::tr("Unix Line Endings (LF)"), + [this] { q->selectLineEnding(TextFileFormat::LFLineTerminator); }); + menu->addAction(Tr::tr("Windows Line Endings (CRLF)"), + [this] { q->selectLineEnding(TextFileFormat::CRLFLineTerminator); }); menu->popup(QCursor::pos()); }); From 8f3e77a3ae7bdf1d46a63feced8d7fa4e899b5c3 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 18 Oct 2023 09:42:15 +0200 Subject: [PATCH 1656/1777] Tr: Re-fix plurals The number for the plural must be given as the 3rd argument to the tr() call, not as an arg(). Amends 1359e9c84fbbb7d8e41c5573c63759bf191dc8fa Change-Id: I45241a6acd82041c320bbe476cd2b4cc92247ef3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/libs/utils/devicefileaccess.cpp | 7 ++++--- src/plugins/autotest/boost/boosttestoutputreader.cpp | 3 ++- src/plugins/cppeditor/cppmodelmanager.cpp | 7 ++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/libs/utils/devicefileaccess.cpp b/src/libs/utils/devicefileaccess.cpp index 71f694c6649..a38a3617a7e 100644 --- a/src/libs/utils/devicefileaccess.cpp +++ b/src/libs/utils/devicefileaccess.cpp @@ -721,10 +721,11 @@ expected_str<qint64> DesktopDeviceFileAccess::writeFileContents(const FilePath & qint64 res = file.write(data); if (res != data.size()) return make_unexpected( - Tr::tr("Could not write to file \"%1\" (only %2 of %n byte(s) written).") + Tr::tr("Could not write to file \"%1\" (only %2 of %n byte(s) written).", + nullptr, + data.size()) .arg(filePath.toUserOutput()) - .arg(res) - .arg(data.size())); + .arg(res)); return res; } diff --git a/src/plugins/autotest/boost/boosttestoutputreader.cpp b/src/plugins/autotest/boost/boosttestoutputreader.cpp index 439fe480814..7b58d74f528 100644 --- a/src/plugins/autotest/boost/boosttestoutputreader.cpp +++ b/src/plugins/autotest/boost/boosttestoutputreader.cpp @@ -327,7 +327,8 @@ void BoostTestOutputReader::processOutputLine(const QByteArray &outputLine) BoostTestResult result(id(), {}, m_projectFile); const int failed = match.captured(1).toInt(); const int fatals = m_summary.value(ResultType::MessageFatal); - QString txt = Tr::tr("%n failure(s) detected in %2.").arg(failed).arg(match.captured(3)); + QString txt + = Tr::tr("%n failure(s) detected in %1.", nullptr, failed).arg(match.captured(3)); const int passed = qMax(0, m_testCaseCount - failed); if (m_testCaseCount != -1) txt.append(' ').append(Tr::tr("%1 tests passed.").arg(passed)); diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index 2deaea4290c..e72c630cbf7 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -568,9 +568,10 @@ static void checkNextFunctionForUnused( return; const int newProgress = findRefsFuture->progressValue() + 1; findRefsFuture->setProgressValueAndText(newProgress, - Tr::tr("Checked %1 of %n function(s)") - .arg(newProgress) - .arg(findRefsFuture->progressMaximum())); + Tr::tr("Checked %1 of %n function(s)", + nullptr, + findRefsFuture->progressMaximum()) + .arg(newProgress)); QVariantMap data = search->userData().toMap(); QVariant &activeLinks = data["active"]; QVariantList activeLinksList = activeLinks.toList(); From 9f7203b0d2b4eb87449e47eb89b7f1686e4ecb93 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 18 Oct 2023 11:12:42 +0200 Subject: [PATCH 1657/1777] PE: Allow skipping of compress on specialized folder nodes Fixes wrong handling of multiple qrc files when having just a single prefix. Change-Id: Id5ac357d4ab6a7f7556b36a9fc44da398ede093c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/projectnodes.h | 2 +- src/plugins/resourceeditor/resourcenode.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index 25868d0ed75..5e424b62bbc 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -248,7 +248,7 @@ public: const Utils::FilePath &overrideBaseDir = Utils::FilePath(), const FolderNodeFactory &factory = [](const Utils::FilePath &fn) { return std::make_unique<FolderNode>(fn); }); - void compress(); + virtual void compress(); // takes ownership of newNode. // Will delete newNode if oldNode is not a child of this node. diff --git a/src/plugins/resourceeditor/resourcenode.h b/src/plugins/resourceeditor/resourcenode.h index 8e04267768e..d857a643761 100644 --- a/src/plugins/resourceeditor/resourcenode.h +++ b/src/plugins/resourceeditor/resourcenode.h @@ -25,6 +25,8 @@ public: ProjectExplorer::RemovedFilesFromProject removeFiles(const Utils::FilePaths &filePaths, Utils::FilePaths *notRemoved) override; + void compress() override { } // do not compress + bool addPrefix(const QString &prefix, const QString &lang); bool removePrefix(const QString &prefix, const QString &lang); From b519ebf1c947b7893af7c1f06521ac8f2468086e Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 18 Oct 2023 11:18:12 +0200 Subject: [PATCH 1658/1777] ProjectExplorer: Do not use Yes/No as buttons in dialogs It is clearer to name the "accept" button after the action that is performed when clicking it. Change-Id: I1153169d48082e95722150a4cfcd92939ba92889 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../projectexplorer/runsettingspropertiespage.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index 20758cbc4e3..2c675b0a043 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -237,12 +237,15 @@ void RunSettingsWidget::removeRunConfiguration() void RunSettingsWidget::removeAllRunConfigurations() { - QMessageBox msgBox(QMessageBox::Question, Tr::tr("Remove Run Configurations?"), + QMessageBox msgBox(QMessageBox::Question, + Tr::tr("Remove Run Configurations?"), Tr::tr("Do you really want to delete all run configurations?"), - QMessageBox::Yes|QMessageBox::No, this); - msgBox.setDefaultButton(QMessageBox::No); - msgBox.setEscapeButton(QMessageBox::No); - if (msgBox.exec() == QMessageBox::No) + QMessageBox::Cancel, + this); + msgBox.addButton(Tr::tr("Delete"), QMessageBox::YesRole); + msgBox.setDefaultButton(QMessageBox::Cancel); + msgBox.setEscapeButton(QMessageBox::Cancel); + if (msgBox.exec() == QMessageBox::Cancel) return; m_target->removeAllRunConfigurations(); From ad7d5590281019233d11d640e7e1b4e1a5b8026b Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 18 Oct 2023 09:59:28 +0200 Subject: [PATCH 1659/1777] Tr: More small fixes Change-Id: I5d9324d3f64eaa522fa1d435efa39fa43d84798a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- src/libs/utils/passworddialog.cpp | 2 +- src/libs/utils/terminalhooks.cpp | 2 +- src/plugins/clangcodemodel/clangtextmark.cpp | 4 ++-- .../clangformat/clangformatconfigwidget.cpp | 2 +- .../compilerexplorer/compilerexplorereditor.cpp | 2 +- .../compilerexplorersettings.cpp | 8 ++++---- .../coreplugin/dialogs/settingsdialog.cpp | 16 ++++++++-------- src/plugins/coreplugin/generalsettings.cpp | 14 +++++++------- src/plugins/cppeditor/cppquickfixes.cpp | 8 ++++---- src/plugins/docker/dockerdevicewidget.cpp | 4 ++-- src/plugins/git/gitplugin.cpp | 11 +++++++++-- src/plugins/git/gitsettings.cpp | 16 ++++++++++++---- src/plugins/git/gitsettings.h | 3 +++ src/plugins/python/pyside.cpp | 4 ++-- src/plugins/terminal/terminalwidget.cpp | 4 ++-- src/plugins/vcpkg/vcpkgmanifesteditor.cpp | 4 ++-- src/plugins/vcpkg/vcpkgsearch.cpp | 4 ++-- 17 files changed, 63 insertions(+), 45 deletions(-) diff --git a/src/libs/utils/passworddialog.cpp b/src/libs/utils/passworddialog.cpp index 05bdf268da9..7958f7d6bd9 100644 --- a/src/libs/utils/passworddialog.cpp +++ b/src/libs/utils/passworddialog.cpp @@ -22,7 +22,7 @@ ShowPasswordButton::ShowPasswordButton(QWidget *parent) { setAttribute(Qt::WA_Hover); setCheckable(true); - setToolTip(Tr::tr("Show/hide password")); + setToolTip(Tr::tr("Show/Hide Password")); } void ShowPasswordButton::paintEvent(QPaintEvent *e) diff --git a/src/libs/utils/terminalhooks.cpp b/src/libs/utils/terminalhooks.cpp index 6072e168e8a..bb517cb9554 100644 --- a/src/libs/utils/terminalhooks.cpp +++ b/src/libs/utils/terminalhooks.cpp @@ -27,7 +27,7 @@ expected_str<FilePath> defaultShellForDevice(const FilePath &deviceRoot) shell = env->searchInPath(shell.nativePath()); if (shell.isEmpty()) - return make_unexpected(Tr::tr("Could not find any shell")); + return make_unexpected(Tr::tr("Could not find any shell.")); return deviceRoot.withNewMappedPath(shell); } diff --git a/src/plugins/clangcodemodel/clangtextmark.cpp b/src/plugins/clangcodemodel/clangtextmark.cpp index 4f5be51a7c1..80e2956021f 100644 --- a/src/plugins/clangcodemodel/clangtextmark.cpp +++ b/src/plugins/clangcodemodel/clangtextmark.cpp @@ -105,8 +105,8 @@ void disableDiagnosticInCurrentProjectConfig(const ClangDiagnostic &diagnostic) projectSettings.setDiagnosticConfigId(config.id()); // Notify the user about changed project specific settings - const QString text = Tr::tr("Changes applied to diagnostic configuration \"%1\"") - .arg(config.displayName()); + const QString text + = Tr::tr("Changes applied to diagnostic configuration \"%1\".").arg(config.displayName()); FadingIndicator::showText(Core::ICore::mainWindow(), text, FadingIndicator::SmallText); diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index d1735b15fb7..e3328bb2695 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -98,7 +98,7 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferenc static const int expectedMajorVersion = 17; - d->clangVersion = new QLabel(Tr::tr("Current clang-format version: ") + LLVM_VERSION_STRING, + d->clangVersion = new QLabel(Tr::tr("Current ClangFormat version: %1.").arg(LLVM_VERSION_STRING), this); d->clangWarningText = new QLabel(Tr::tr("The widget was generated for ClangFormat %1. " diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index c6040d65a42..180878ef937 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -484,7 +484,7 @@ void CompilerWidget::doCompile() } } catch (const std::exception &e) { Core::MessageManager::writeDisrupting( - Tr::tr("Failed to compile: \"%1\"").arg(QString::fromUtf8(e.what()))); + Tr::tr("Failed to compile: \"%1\".").arg(QString::fromUtf8(e.what()))); } }); diff --git a/src/plugins/compilerexplorer/compilerexplorersettings.cpp b/src/plugins/compilerexplorer/compilerexplorersettings.cpp index ae47f67f9e2..a93508b5e4e 100644 --- a/src/plugins/compilerexplorer/compilerexplorersettings.cpp +++ b/src/plugins/compilerexplorer/compilerexplorersettings.cpp @@ -210,7 +210,7 @@ void CompilerSettings::fillLibraries(const LibrarySelectionAspect::ResultCallbac fillFromCache(); } catch (const std::exception &e) { Core::MessageManager::writeDisrupting( - Tr::tr("Failed to fetch libraries: \"%1\"") + Tr::tr("Failed to fetch libraries: \"%1\".") .arg(QString::fromUtf8(e.what()))); } }); @@ -253,7 +253,7 @@ void SourceSettings::fillLanguageIdModel(const Utils::StringSelectionAspect::Res fillFromCache(); } catch (const std::exception &e) { Core::MessageManager::writeDisrupting( - Tr::tr("Failed to fetch languages: \"%1\"") + Tr::tr("Failed to fetch languages: \"%1\".") .arg(QString::fromUtf8(e.what()))); } }); @@ -295,7 +295,7 @@ void CompilerSettings::fillCompilerModel(const Utils::StringSelectionAspect::Res fillFromCache(itCache); } catch (const std::exception &e) { Core::MessageManager::writeDisrupting( - Tr::tr("Failed to fetch compilers: \"%1\"") + Tr::tr("Failed to fetch compilers: \"%1\".") .arg(QString::fromUtf8(e.what()))); } }); @@ -311,7 +311,7 @@ CompilerExplorerSettings::CompilerExplorerSettings() compilerExplorerUrl.setSettingsKey("CompilerExplorerUrl"); compilerExplorerUrl.setLabelText(Tr::tr("Compiler Explorer URL:")); - compilerExplorerUrl.setToolTip(Tr::tr("URL of the Compiler Explorer instance to use")); + compilerExplorerUrl.setToolTip(Tr::tr("URL of the Compiler Explorer instance to use.")); compilerExplorerUrl.setDefaultValue("https://godbolt.org/"); compilerExplorerUrl.setDisplayStyle(Utils::StringAspect::DisplayStyle::LineEditDisplay); compilerExplorerUrl.setHistoryCompleter("CompilerExplorer.Url.History"); diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index f420c0ff492..1f7aa77d2e4 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -463,14 +463,14 @@ private: static QPointer<SettingsDialog> m_instance = nullptr; -SettingsDialog::SettingsDialog(QWidget *parent) : - QDialog(parent), - m_pages(sortedOptionsPages()), - m_stackedLayout(new QStackedLayout), - m_filterLineEdit(new Utils::FancyLineEdit), - m_sortCheckBox(new QCheckBox(Tr::tr("Sort Categories"))), - m_categoryList(new CategoryListView), - m_headerLabel(new QLabel) +SettingsDialog::SettingsDialog(QWidget *parent) + : QDialog(parent) + , m_pages(sortedOptionsPages()) + , m_stackedLayout(new QStackedLayout) + , m_filterLineEdit(new Utils::FancyLineEdit) + , m_sortCheckBox(new QCheckBox(Tr::tr("Sort categories"))) + , m_categoryList(new CategoryListView) + , m_headerLabel(new QLabel) { m_filterLineEdit->setFiltering(true); diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 1e2c5515342..3087b0d8c4b 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -139,12 +139,12 @@ GeneralSettingsWidget::GeneralSettingsWidget() != Qt::HighDpiScaleFactorRoundingPolicy::Unset) { using Policy = Qt::HighDpiScaleFactorRoundingPolicy; m_policyComboBox = new QComboBox; - m_policyComboBox->addItem(Tr::tr("Round up for .5 and above"), int(Policy::Round)); - m_policyComboBox->addItem(Tr::tr("Always round up"), int(Policy::Ceil)); - m_policyComboBox->addItem(Tr::tr("Always round down"), int(Policy::Floor)); - m_policyComboBox->addItem(Tr::tr("Round up for .75 and above"), - int(Policy::RoundPreferFloor)); - m_policyComboBox->addItem(Tr::tr("Don't round"), int(Policy::PassThrough)); + m_policyComboBox->addItem(Tr::tr("Round Up for .5 and Above"), int(Policy::Round)); + m_policyComboBox->addItem(Tr::tr("Always Round Up"), int(Policy::Ceil)); + m_policyComboBox->addItem(Tr::tr("Always Round Down"), int(Policy::Floor)); + m_policyComboBox->addItem(Tr::tr("Round Up for .75 and Above"), + int(Policy::RoundPreferFloor)); + m_policyComboBox->addItem(Tr::tr("Don't Round"), int(Policy::PassThrough)); m_policyComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); const Policy userPolicy = @@ -153,7 +153,7 @@ GeneralSettingsWidget::GeneralSettingsWidget() .value<Policy>(); m_policyComboBox->setCurrentIndex(m_policyComboBox->findData(int(userPolicy))); - form.addRow({Tr::tr("DPI Rounding Policy:"), m_policyComboBox, st}); + form.addRow({Tr::tr("DPI rounding policy:"), m_policyComboBox, st}); } form.addRow({empty, generalSettings().showShortcutsInContextMenus}); diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index a65c9b61a47..7f08b962009 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -9329,8 +9329,8 @@ public: m_wasCxxStyle(m_kind == T_CPP_COMMENT || m_kind == T_CPP_DOXY_COMMENT), m_isDoxygen(m_kind == T_DOXY_COMMENT || m_kind == T_CPP_DOXY_COMMENT) { - setDescription(m_wasCxxStyle ? Tr::tr("Convert comment to C style") - : Tr::tr("Convert comment to C++ style")); + setDescription(m_wasCxxStyle ? Tr::tr("Convert Comment to C-Style") + : Tr::tr("Convert Comment to C++-Style")); } private: @@ -9552,8 +9552,8 @@ public: : CppQuickFixOperation(interface), m_symbol(symbol), m_commentTokens(commentTokens) { setDescription(direction == Direction::ToDecl - ? Tr::tr("Move function documentation to declaration") - : Tr::tr("Move function documentation to definition")); + ? Tr::tr("Move Function Documentation to Declaration") + : Tr::tr("Move Function Documentation to Definition")); } private: diff --git a/src/plugins/docker/dockerdevicewidget.cpp b/src/plugins/docker/dockerdevicewidget.cpp index 01d80106b68..0e269ee3972 100644 --- a/src/plugins/docker/dockerdevicewidget.cpp +++ b/src/plugins/docker/dockerdevicewidget.cpp @@ -173,7 +173,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) deviceSettings->tag, br, deviceSettings->imageId, br, daemonStateLabel, m_daemonReset, m_daemonState, br, - Tr::tr("Container State:"), deviceSettings->containerStatus, br, + Tr::tr("Container state:"), deviceSettings->containerStatus, br, deviceSettings->useLocalUidGid, br, deviceSettings->keepEntryPoint, br, deviceSettings->enableLldbFlags, br, @@ -187,7 +187,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) If { dockerDevice->isAutoDetected(), {}, {detectionControls} }, noMargin, },br, - Tr::tr("Command Line:"), createLineLabel, br, + Tr::tr("Command line:"), createLineLabel, br, }.attachTo(this); // clang-format on diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 693b12cc028..3f8c55b18d4 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -10,6 +10,7 @@ #include "gitconstants.h" #include "giteditor.h" #include "gitgrep.h" +#include "gitsettings.h" #include "gitsubmiteditor.h" #include "gittr.h" #include "gitutils.h" @@ -247,8 +248,14 @@ public: if (settings().instantBlameIgnoreSpaceChanges() || settings().instantBlameIgnoreLineMoves()) { - result.append(Tr::tr("<p><b>Note:</b> Ignore whitespace changes or line moves" - " is enabled in the instant blame settings.</p>")); + result.append( + "<p>" + //: %1 and %2 are the "ignore whitespace changes" and "ignore line moves" options + + Tr::tr("<b>Note:</b> \"%1\" or \"%2\"" + " is enabled in the instant blame settings.") + .arg(GitSettings::trIgnoreWhitespaceChanges(), + GitSettings::trIgnoreLineMoves()) + + "</p>"); } return result; } diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index 79d85566986..cb23f55c9a8 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -91,14 +91,12 @@ GitSettings::GitSettings() Tr::tr("Annotate the current line in the editor with Git \"blame\" output.")); instantBlameIgnoreSpaceChanges.setSettingsKey("GitInstantIgnoreSpaceChanges"); instantBlameIgnoreSpaceChanges.setDefaultValue(false); - instantBlameIgnoreSpaceChanges.setLabelText( - Tr::tr("Ignore whitespace changes")); + instantBlameIgnoreSpaceChanges.setLabelText(trIgnoreWhitespaceChanges()); instantBlameIgnoreSpaceChanges.setToolTip( Tr::tr("Finds the commit that introduced the last real code changes to the line.")); instantBlameIgnoreLineMoves.setSettingsKey("GitInstantIgnoreLineMoves"); instantBlameIgnoreLineMoves.setDefaultValue(false); - instantBlameIgnoreLineMoves.setLabelText( - Tr::tr("Ignore line moves")); + instantBlameIgnoreLineMoves.setLabelText(trIgnoreLineMoves()); instantBlameIgnoreLineMoves.setToolTip( Tr::tr("Finds the commit that introduced the line before it was moved.")); @@ -187,6 +185,16 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const return resolvedBinPath; } +QString GitSettings::trIgnoreWhitespaceChanges() +{ + return Tr::tr("Ignore whitespace changes"); +} + +QString GitSettings::trIgnoreLineMoves() +{ + return Tr::tr("Ignore line moves"); +} + // GitSettingsPage class GitSettingsPage final : public Core::IOptionsPage diff --git a/src/plugins/git/gitsettings.h b/src/plugins/git/gitsettings.h index f5a83c5e8a9..f6ec650c2e8 100644 --- a/src/plugins/git/gitsettings.h +++ b/src/plugins/git/gitsettings.h @@ -45,6 +45,9 @@ public: mutable bool tryResolve = true; Utils::FilePath gitExecutable(bool *ok = nullptr, QString *errorMessage = nullptr) const; + + static QString trIgnoreWhitespaceChanges(); + static QString trIgnoreLineMoves(); }; GitSettings &settings(); diff --git a/src/plugins/python/pyside.cpp b/src/plugins/python/pyside.cpp index bae0c0753af..a17ae89dca8 100644 --- a/src/plugins/python/pyside.cpp +++ b/src/plugins/python/pyside.cpp @@ -127,7 +127,7 @@ void PySideInstaller::installPyside(const FilePath &python, install->setPackages({PipPackage(pySide)}); } else { QDialog dialog; - dialog.setWindowTitle(Tr::tr("Select PySide version")); + dialog.setWindowTitle(Tr::tr("Select PySide Version")); dialog.setLayout(new QVBoxLayout()); dialog.layout()->addWidget(new QLabel(Tr::tr("Select which PySide version to install:"))); QComboBox *pySideSelector = new QComboBox(); @@ -135,7 +135,7 @@ void PySideInstaller::installPyside(const FilePath &python, for (const Utils::FilePath &version : std::as_const(availablePySides)) { const FilePath dir = version.parentDir(); const QString text - = Tr::tr("PySide %1 wheel (%2)").arg(dir.fileName(), dir.toUserOutput()); + = Tr::tr("PySide %1 Wheel (%2)").arg(dir.fileName(), dir.toUserOutput()); pySideSelector->addItem(text, version.toVariant()); } dialog.layout()->addWidget(pySideSelector); diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 604a0d82bc8..69f0256ef5c 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -85,7 +85,7 @@ void TerminalWidget::setupPty() CommandLine{settings().shell(), settings().shellArguments(), CommandLine::Raw}); if (shellCommand.executable().isRootPath()) { - writeToTerminal(Tr::tr("Connecting ...\r\n").toUtf8(), true); + writeToTerminal((Tr::tr("Connecting...") + "\r\n").toUtf8(), true); // We still have to find the shell to start ... m_findShellWatcher.reset(new QFutureWatcher<expected_str<FilePath>>()); connect(m_findShellWatcher.get(), &QFutureWatcher<FilePath>::finished, this, [this] { @@ -107,7 +107,7 @@ void TerminalWidget::setupPty() shellCommand.executable()); if (result && !result->isExecutableFile()) return make_unexpected( - Tr::tr("'%1' is not executable.").arg(result->toUserOutput())); + Tr::tr("\"%1\" is not executable.").arg(result->toUserOutput())); return result; })); diff --git a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp index 94774ab7183..3e90b0f7076 100644 --- a/src/plugins/vcpkg/vcpkgmanifesteditor.cpp +++ b/src/plugins/vcpkg/vcpkgmanifesteditor.cpp @@ -99,7 +99,7 @@ public: { const QIcon vcpkgIcon = Utils::Icon({{":/vcpkg/images/vcpkgicon.png", Utils::Theme::IconsBaseColor}}).icon(); - m_searchPkgAction = toolBar()->addAction(vcpkgIcon, Tr::tr("Add vcpkg package...")); + m_searchPkgAction = toolBar()->addAction(vcpkgIcon, Tr::tr("Add vcpkg Package...")); connect(m_searchPkgAction, &QAction::triggered, this, [this] { const Search::VcpkgManifest package = Search::showVcpkgPackageSearchDialog(documentToManifest()); @@ -111,7 +111,7 @@ public: }); const QIcon cmakeIcon = ProjectExplorer::Icons::CMAKE_LOGO_TOOLBAR.icon(); - m_cmakeCodeAction = toolBar()->addAction(cmakeIcon, Tr::tr("CMake code...")); + m_cmakeCodeAction = toolBar()->addAction(cmakeIcon, Tr::tr("CMake Code...")); connect(m_cmakeCodeAction, &QAction::triggered, this, [this] { CMakeCodeDialog dlg(documentToManifest().dependencies); dlg.exec(); diff --git a/src/plugins/vcpkg/vcpkgsearch.cpp b/src/plugins/vcpkg/vcpkgsearch.cpp index dd0f4e93d7d..d5e300893f4 100644 --- a/src/plugins/vcpkg/vcpkgsearch.cpp +++ b/src/plugins/vcpkg/vcpkgsearch.cpp @@ -60,7 +60,7 @@ VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(const VcpkgManifest &preexist , m_projectManifest(preexistingPackages) { resize(920, 400); - setWindowTitle(Tr::tr("Add vcpkg package")); + setWindowTitle(Tr::tr("Add vcpkg Package")); m_packagesFilter = new FancyLineEdit; m_packagesFilter->setFiltering(true); @@ -98,7 +98,7 @@ VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(const VcpkgManifest &preexist m_packagesList, }, Group { - title(Tr::tr("Package details")), + title(Tr::tr("Package Details")), Form { Tr::tr("Name:"), m_vcpkgName, br, Tr::tr("Version:"), m_vcpkgVersion, br, From f8beeb9edc5c7501724a4d10c50e3ba81fdd899d Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Tue, 17 Oct 2023 15:16:14 +0200 Subject: [PATCH 1660/1777] CppEditor: Filter out another GCC-only flag Qt applications are built with "-mno-direct-extern-access" these days, which throws off clang-tidy. Change-Id: Ifaaef84f6da37a0abb7b7a68296723fa41b572a7 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cppeditor/compileroptionsbuilder.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/cppeditor/compileroptionsbuilder.cpp b/src/plugins/cppeditor/compileroptionsbuilder.cpp index 8376f7d1acc..12403bd1533 100644 --- a/src/plugins/cppeditor/compileroptionsbuilder.cpp +++ b/src/plugins/cppeditor/compileroptionsbuilder.cpp @@ -900,6 +900,10 @@ void CompilerOptionsBuilder::evaluateCompilerFlags() continue; } + // GCC option that clang doesn't know. + if (option.contains("direct-extern-access")) + continue; + // These were already parsed into ProjectPart::includedFiles. if (option == includeFileOptionCl || option == includeFileOptionGcc) { skipNext = true; From 4aefd9a74d1fd262e7b2fd8566c9353652903c5d Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 18 Oct 2023 14:54:46 +0200 Subject: [PATCH 1661/1777] Copilot: Fix some strings - add missing colons - rejecting unauthorized certificates is the secure option, turning it off is insecure Change-Id: Ia09994ea75460fd5ebdd8354412d3122bd32eeed Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- src/plugins/copilot/copilotsettings.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/copilot/copilotsettings.cpp b/src/plugins/copilot/copilotsettings.cpp index 1f2b59523d3..c75f7124235 100644 --- a/src/plugins/copilot/copilotsettings.cpp +++ b/src/plugins/copilot/copilotsettings.cpp @@ -105,14 +105,14 @@ CopilotSettings::CopilotSettings() proxyHost.setDisplayName(Tr::tr("Proxy Host")); proxyHost.setDisplayStyle(StringAspect::LineEditDisplay); proxyHost.setSettingsKey("Copilot.ProxyHost"); - proxyHost.setLabelText(Tr::tr("Proxy host")); + proxyHost.setLabelText(Tr::tr("Proxy host:")); proxyHost.setDefaultValue(""); proxyHost.setToolTip(Tr::tr("The host name of the proxy server.")); proxyHost.setHistoryCompleter("Copilot.ProxyHost.History"); proxyPort.setDisplayName(Tr::tr("Proxy Port")); proxyPort.setSettingsKey("Copilot.ProxyPort"); - proxyPort.setLabelText(Tr::tr("Proxy port")); + proxyPort.setLabelText(Tr::tr("Proxy port:")); proxyPort.setDefaultValue(3128); proxyPort.setToolTip(Tr::tr("The port of the proxy server.")); proxyPort.setRange(1, 65535); @@ -120,7 +120,7 @@ CopilotSettings::CopilotSettings() proxyUser.setDisplayName(Tr::tr("Proxy User")); proxyUser.setDisplayStyle(StringAspect::LineEditDisplay); proxyUser.setSettingsKey("Copilot.ProxyUser"); - proxyUser.setLabelText(Tr::tr("Proxy user")); + proxyUser.setLabelText(Tr::tr("Proxy user:")); proxyUser.setDefaultValue(""); proxyUser.setToolTip(Tr::tr("The user name to access the proxy server.")); proxyUser.setHistoryCompleter("Copilot.ProxyUser.History"); @@ -135,7 +135,7 @@ CopilotSettings::CopilotSettings() proxyPassword.setDisplayName(Tr::tr("Proxy Password")); proxyPassword.setDisplayStyle(StringAspect::PasswordLineEditDisplay); proxyPassword.setSettingsKey("Copilot.ProxyPassword"); - proxyPassword.setLabelText(Tr::tr("Proxy password")); + proxyPassword.setLabelText(Tr::tr("Proxy password:")); proxyPassword.setDefaultValue(""); proxyPassword.setToolTip(Tr::tr("The password for the proxy server.")); @@ -144,7 +144,7 @@ CopilotSettings::CopilotSettings() proxyRejectUnauthorized.setLabelText(Tr::tr("Reject unauthorized")); proxyRejectUnauthorized.setDefaultValue(true); proxyRejectUnauthorized.setToolTip(Tr::tr("Reject unauthorized certificates from the proxy " - "server. This is a security risk.")); + "server. Turning this off is a security risk.")); initEnableAspect(enableCopilot); From e51b378ac989bede498a5b445d7ca84cb9b02ea2 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 18 Oct 2023 15:18:10 +0200 Subject: [PATCH 1662/1777] Core/Tr: Fix menu bar action It is "menu bar", and use placeholder for shortcut instead of concatenation. Change-Id: I60094a5fac3893663180f7ef573b6dece7670111 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- dist/changelog/changes-12.0.0.md | 2 +- .../creator-how-to-show-and-hide-main-menu.qdoc | 2 +- src/plugins/coreplugin/icore.cpp | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 53ad7d575f1..b26621ddf2e 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -67,7 +67,7 @@ General used for the file system index locator filter ([QTCREATORBUG-27789](https://bugreports.qt.io/browse/QTCREATORBUG-27789)) ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-editor-locator.html#locating-files-from-global-file-system-index)) -* Added the `View > Show Menubar` option to hide the menu bar on platforms +* Added the `View > Show Menu Bar` option to hide the menu bar on platforms without a unified menu bar ([QTCREATORBUG-29498](https://bugreports.qt.io/browse/QTCREATORBUG-29498)) ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-show-and-hide-main-menu.html)) diff --git a/doc/qtcreator/src/user-interface/creator-only/creator-how-to-show-and-hide-main-menu.qdoc b/doc/qtcreator/src/user-interface/creator-only/creator-how-to-show-and-hide-main-menu.qdoc index 4055f0b7d45..22d57b98c27 100644 --- a/doc/qtcreator/src/user-interface/creator-only/creator-how-to-show-and-hide-main-menu.qdoc +++ b/doc/qtcreator/src/user-interface/creator-only/creator-how-to-show-and-hide-main-menu.qdoc @@ -10,7 +10,7 @@ \title Show and hide the main menu On Linux and Windows, you can hide the main menu bar to save space on the - screen. Select \uicontrol View, and deselect the \uicontrol {Show Menubar} + screen. Select \uicontrol View, and deselect the \uicontrol {Show Menu Bar} check box. \image qtcreator-without-menubar.webp {Qt Creator without the main menu} diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 4a73eb6e9eb..eaf94e45cf5 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -1858,19 +1858,19 @@ void ICorePrivate::registerDefaultActions() // Show Menubar Action if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) { - m_toggleMenubarAction = new QAction(Tr::tr("Show Menubar"), this); + m_toggleMenubarAction = new QAction(Tr::tr("Show Menu Bar"), this); m_toggleMenubarAction->setCheckable(true); cmd = ActionManager::registerAction(m_toggleMenubarAction, Constants::TOGGLE_MENUBAR); cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Alt+M"))); connect(m_toggleMenubarAction, &QAction::toggled, this, [cmd](bool visible) { if (!visible) { - CheckableMessageBox::information( - Core::ICore::dialogParent(), - Tr::tr("Hide Menubar"), - Tr::tr( - "This will hide the menu bar completely. You can show it again by typing ") - + cmd->keySequence().toString(QKeySequence::NativeText), - Key("ToogleMenuBarHint")); + CheckableMessageBox::information(Core::ICore::dialogParent(), + Tr::tr("Hide Menu Bar"), + Tr::tr("This will hide the menu bar completely. " + "You can show it again by typing %1.") + .arg(cmd->keySequence().toString( + QKeySequence::NativeText)), + Key("ToogleMenuBarHint")); } globalMenuBar()->setVisible(visible); }); From 81898c675cb554490e38478b4e33e32c0a63038e Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 17 Oct 2023 16:19:40 +0200 Subject: [PATCH 1663/1777] Doc: Add a \preferences macro and use it everywhere The macro can be used to show the path to Preferences on Windows, Linux, and macOS. The current value expands to: "Edit (or Qt Creator on macOS) > Preferences". We can now change this in one place if we so wish. Task-number: QTCREATORBUG-29734 Change-Id: I9afe4f7093dbcc8e62a2b18e1ae3f6f243bbb72b Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- doc/config/macros.qdocconf | 1 + .../src/analyze/cpu-usage-analyzer.qdoc | 2 +- .../src/analyze/creator-axivion.qdoc | 2 +- .../creator-clang-static-analyzer.qdoc | 2 +- doc/qtcreator/src/analyze/creator-coco.qdoc | 4 +- .../src/analyze/creator-cppcheck.qdoc | 2 +- doc/qtcreator/src/analyze/creator-heob.qdoc | 2 +- .../analyze/creator-valgrind-overview.qdoc | 4 +- .../src/analyze/creator-valgrind.qdoc | 17 ++-- doc/qtcreator/src/android/androiddev.qdoc | 30 ++---- .../src/baremetal/creator-baremetal-dev.qdoc | 6 +- .../creator-projects-cmake-building.qdoc | 11 +-- .../cmake/creator-projects-cmake-presets.qdoc | 2 +- .../src/cmake/creator-projects-cmake.qdoc | 19 ++-- .../src/debugger/creator-debug-views.qdoc | 5 +- .../creator-debugger-settings.qdoc | 17 ++-- .../creator-only/creator-debugger-setup.qdoc | 6 +- .../creator-only/creator-debugger.qdoc | 94 +++++++++---------- .../src/debugger/qtquick-debugging.qdoc | 7 +- doc/qtcreator/src/docker/creator-docker.qdoc | 4 +- .../src/editors/creator-code-completion.qdoc | 8 +- .../src/editors/creator-code-indentation.qdoc | 10 +- .../src/editors/creator-code-refactoring.qdoc | 2 +- .../src/editors/creator-code-syntax.qdoc | 19 ++-- .../src/editors/creator-diff-editor.qdoc | 2 +- .../editors/creator-editors-options-text.qdoc | 21 ++--- .../src/editors/creator-editors-options.qdoc | 2 +- .../src/editors/creator-locator.qdoc | 6 +- .../creator-only/creator-beautifier.qdoc | 6 +- .../creator-only/creator-clang-codemodel.qdoc | 6 +- .../creator-only/creator-code-pasting.qdoc | 3 +- .../creator-coding-edit-mode.qdoc | 19 ++-- .../editors/creator-only/creator-copilot.qdoc | 6 +- .../editors/creator-only/creator-fakevim.qdoc | 24 ++--- .../creator-only/creator-language-server.qdoc | 26 +++-- .../creator-only/creator-mime-types.qdoc | 2 +- .../creator-preferences-cpp-code-style.qdoc | 2 +- .../creator-only/creator-preferences-nim.qdoc | 2 +- .../creator-text-editing-macros.qdoc | 6 +- ...ator-preferences-text-editor-behavior.qdoc | 6 +- .../src/editors/creator-quick-fixes.qdoc | 5 +- doc/qtcreator/src/editors/creator-search.qdoc | 10 +- .../creator-semantic-highlighting.qdoc | 23 ++--- .../src/howto/creator-external-tools.qdoc | 4 +- doc/qtcreator/src/howto/creator-help.qdoc | 34 ++++--- .../creator-how-to-set-high-dpi-scaling.qdoc | 2 +- .../creator-how-to-switch-ui-themes.qdoc | 2 +- .../src/howto/creator-keyboard-shortcuts.qdoc | 23 ++--- .../howto/creator-only/creator-autotest.qdoc | 32 +++---- .../creator-how-to-document-code.qdoc | 2 +- .../creator-how-to-record-screens.qdoc | 3 +- .../howto/creator-only/creator-how-tos.qdoc | 19 ++-- .../howto/creator-only/creator-squish.qdoc | 2 +- .../src/howto/creator-only/creator-vcpkg.qdoc | 8 +- .../src/howto/creator-only/qtcreator-faq.qdoc | 10 +- .../src/howto/creator-telemetry.qdoc | 2 +- doc/qtcreator/src/linux-mobile/b2qtdev.qdoc | 22 ++--- .../src/linux-mobile/linuxdev-keys.qdocinc | 6 +- .../linux-mobile/linuxdev-processes.qdocinc | 2 +- doc/qtcreator/src/linux-mobile/linuxdev.qdoc | 10 +- doc/qtcreator/src/mcu/creator-mcu-dev.qdoc | 11 +-- .../src/meson/creator-projects-meson.qdoc | 4 +- .../creator-only/creator-configuring.qdoc | 35 ++++--- .../creator-only/creator-glossary.qdoc | 2 +- .../overview/creator-only/creator-issues.qdoc | 2 +- .../creator-supported-platforms.qdoc | 3 +- .../creator-build-settings-qmake.qdoc | 17 ++-- .../creator-custom-output-parser.qdoc | 8 +- .../creator-only/creator-files-creating.qdoc | 4 +- .../creator-how-to-edit-qbs-profiles.qdoc | 6 +- .../creator-how-to-select-build-systems.qdoc | 4 +- .../creator-projects-building.qdoc | 11 +-- .../creator-projects-builds-customizing.qdoc | 3 +- .../creator-projects-compilers.qdoc | 27 +++--- .../creator-projects-creating.qdoc | 6 +- .../creator-projects-custom-wizards.qdoc | 5 +- .../creator-projects-debuggers.qdoc | 5 +- .../creator-only/creator-projects-kits.qdoc | 4 +- .../creator-only/creator-projects-nimble.qdoc | 2 +- .../creator-projects-opening.qdoc | 7 +- .../creator-only/creator-projects-qbs.qdoc | 8 +- .../creator-projects-qt-versions.qdoc | 14 ++- ...creator-projects-settings-environment.qdoc | 2 +- .../creator-projects-settings-overview.qdoc | 2 +- ...ator-projects-settings-run-analyze.qdocinc | 4 +- ...ator-projects-settings-run-desktop.qdocinc | 11 +-- .../creator-projects-settings-run.qdoc | 2 +- .../projects/creator-projects-running.qdoc | 2 +- .../python/creator-python-development.qdoc | 3 +- .../src/qnx/creator-developing-qnx.qdoc | 2 +- .../creator-only/qtquick-creating.qdoc | 12 +-- ...uick-tutorial-create-empty-project.qdocinc | 6 +- ...reator-preferences-qtquick-code-style.qdoc | 3 +- .../src/qtquick/qtquick-profiler.qdoc | 2 +- .../src/qtquick/qtquick-toolbars.qdoc | 2 +- .../creator-file-system-view.qdoc | 13 ++- .../creator-how-to-view-output.qdoc | 4 +- .../creator-reference-terminal-view.qdoc | 15 ++- .../creator-reference-to-do-entries-view.qdoc | 2 +- .../creator-open-documents-view.qdoc | 3 +- .../user-interface/creator-projects-view.qdoc | 15 ++- .../creator-reference-output-views.qdoc | 12 +-- .../src/user-interface/creator-ui.qdoc | 2 +- .../vcs/creator-only/creator-vcs-bazaar.qdoc | 2 +- .../creator-only/creator-vcs-clearcase.qdoc | 23 +++-- .../src/vcs/creator-only/creator-vcs-cvs.qdoc | 2 +- .../vcs/creator-only/creator-vcs-fossil.qdoc | 4 +- .../vcs/creator-only/creator-vcs-gitlab.qdoc | 4 +- .../creator-only/creator-vcs-mercurial.qdoc | 4 +- .../creator-only/creator-vcs-perforce.qdoc | 8 +- .../creator-only/creator-vcs-preferences.qdoc | 6 +- .../creator-only/creator-vcs-subversion.qdoc | 5 +- doc/qtcreator/src/vcs/creator-vcs-git.qdoc | 29 +++--- .../src/webassembly/creator-webassembly.qdoc | 8 +- .../src/widgets/qtdesigner-overview.qdoc | 4 +- 115 files changed, 467 insertions(+), 575 deletions(-) diff --git a/doc/config/macros.qdocconf b/doc/config/macros.qdocconf index f806b1dff18..f70ce0c3926 100644 --- a/doc/config/macros.qdocconf +++ b/doc/config/macros.qdocconf @@ -39,6 +39,7 @@ macro.QOI = "Qt Online Installer" macro.QMT = "Qt Maintenance Tool" macro.qtcversion = $QTC_VERSION macro.param = "\\e" +macro.preferences = "\\uicontrol Edit (or \\uicontrol {\\QC} on \\macos) > \\uicontrol Preferences" macro.raisedaster.HTML = "<sup>*</sup>" macro.rarrow.HTML = "→" macro.reg.HTML = "<sup>®</sup>" diff --git a/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc b/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc index ddcdd551ca4..07dd1128a17 100644 --- a/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc +++ b/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc @@ -104,7 +104,7 @@ \section1 Specifying Performance Analyzer Settings To specify global settings for the Performance Analyzer, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Analyzer > + \preferences > \uicontrol Analyzer > \uicontrol {CPU Usage}. For each run configuration, you can also use specialized settings. Select \uicontrol Projects > \uicontrol Run, and then select \uicontrol Details next to diff --git a/doc/qtcreator/src/analyze/creator-axivion.qdoc b/doc/qtcreator/src/analyze/creator-axivion.qdoc index 244991c7834..610fee09b3f 100644 --- a/doc/qtcreator/src/analyze/creator-axivion.qdoc +++ b/doc/qtcreator/src/analyze/creator-axivion.qdoc @@ -59,7 +59,7 @@ To connect to Axivion: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Axivion. + \li Select \preferences > \uicontrol Axivion. \image qtcreator-preferences-axivion.webp {General tab in Axivion Preferences} \li Select \uicontrol Edit to create a connection to the Axivion dashboard server. diff --git a/doc/qtcreator/src/analyze/creator-clang-static-analyzer.qdoc b/doc/qtcreator/src/analyze/creator-clang-static-analyzer.qdoc index 06f5e6275b7..ea2f73b844d 100644 --- a/doc/qtcreator/src/analyze/creator-clang-static-analyzer.qdoc +++ b/doc/qtcreator/src/analyze/creator-clang-static-analyzer.qdoc @@ -111,7 +111,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Analyzer > + \li Select \preferences > \uicontrol Analyzer > \uicontrol {Clang Tools}. \image qtcreator-clang-tools-options.png {Clang Tools preferences} diff --git a/doc/qtcreator/src/analyze/creator-coco.qdoc b/doc/qtcreator/src/analyze/creator-coco.qdoc index 0818e9a5b92..b95c1901fb8 100644 --- a/doc/qtcreator/src/analyze/creator-coco.qdoc +++ b/doc/qtcreator/src/analyze/creator-coco.qdoc @@ -75,8 +75,8 @@ \section1 Changing Fonts and Colors - To change the default fonts and colors, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol {Font & Colors}. + To change the default fonts and colors, select \preferences > + \uicontrol {Text Editor} > \uicontrol {Font & Colors}. Create your own color scheme and select new fonts and colors for the following results: diff --git a/doc/qtcreator/src/analyze/creator-cppcheck.qdoc b/doc/qtcreator/src/analyze/creator-cppcheck.qdoc index a77c8dfe7f9..324f747da47 100644 --- a/doc/qtcreator/src/analyze/creator-cppcheck.qdoc +++ b/doc/qtcreator/src/analyze/creator-cppcheck.qdoc @@ -72,6 +72,6 @@ marks or annotations. To specify the settings above for the automatically run checks, - select \uicontrol Edit > \uicontrol Preferences > \uicontrol Analyzer + select \preferences > \uicontrol Analyzer > \uicontrol Cppcheck. */ diff --git a/doc/qtcreator/src/analyze/creator-heob.qdoc b/doc/qtcreator/src/analyze/creator-heob.qdoc index 3fbd2d62285..449d3cc86ab 100644 --- a/doc/qtcreator/src/analyze/creator-heob.qdoc +++ b/doc/qtcreator/src/analyze/creator-heob.qdoc @@ -92,7 +92,7 @@ In the \uicontrol {Handle exceptions} list, select \uicontrol Off to use the standard exception handler and have the debugger automatically attached if the application crashes. This works only if you register \QC is as a - post-mortem debugger by selecting \uicontrol Edit > \uicontrol Preferences > + post-mortem debugger by selecting \preferences > \uicontrol Debugger > \uicontrol General > \uicontrol {Use Qt Creator for post-mortem debugging}. diff --git a/doc/qtcreator/src/analyze/creator-valgrind-overview.qdoc b/doc/qtcreator/src/analyze/creator-valgrind-overview.qdoc index 9a2f914648f..bd3d21f7516 100644 --- a/doc/qtcreator/src/analyze/creator-valgrind-overview.qdoc +++ b/doc/qtcreator/src/analyze/creator-valgrind-overview.qdoc @@ -36,8 +36,8 @@ For more information about analyzing applications for which you do not have a project, see \l{Running Valgrind Tools on External Applications}. - To set preferences for the Valgrind tools, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Analyzer. You can override the general + To set preferences for the Valgrind tools, select \preferences > + \uicontrol Analyzer. You can override the general settings for each project in the \uicontrol {Run Settings} for the project. The following sections describe how to use the Valgrind tools: diff --git a/doc/qtcreator/src/analyze/creator-valgrind.qdoc b/doc/qtcreator/src/analyze/creator-valgrind.qdoc index 9ccfa45c409..537f1acfea6 100644 --- a/doc/qtcreator/src/analyze/creator-valgrind.qdoc +++ b/doc/qtcreator/src/analyze/creator-valgrind.qdoc @@ -81,18 +81,17 @@ separately for each project in the \l{Specifying Run Settings}{run settings} of the project. - To specify global settings for Valgrind, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Analyzer. The \uicontrol - {Memcheck Memory Analysis Options} group has Memcheck options. + To specify global settings for Valgrind, select \preferences > + \uicontrol Analyzer. The \uicontrol {Memcheck Memory Analysis Options} + group has Memcheck options. In \uicontrol {Extra Memcheck arguments}, specify additional arguments for launching the executable. Stack traces can get quite large and confusing, and therefore, reading them from the bottom up can help. If the stack trace is not big enough or it is - too big, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Analyzer - and define the length of the stack trace in the - \uicontrol {Backtrace frame count} field. + too big, select \preferences > \uicontrol Analyzer and define the length of + the stack trace in the \uicontrol {Backtrace frame count} field. \image qtcreator-valgrind-memcheck-options.png "Memory Analysis options" @@ -268,9 +267,9 @@ separately for each project in the \l{Specifying Run Settings}{run settings} of the project. - To specify global settings for Valgrind, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Analyzer. The \uicontrol - {Callgrind Profiling Options} group has Callgrind options. + To specify global settings for Valgrind, select \preferences > + \uicontrol Analyzer. The \uicontrol {Callgrind Profiling Options} + group has Callgrind options. \image qtcreator-valgrind-callgrind-options.png "Valgrind options" diff --git a/doc/qtcreator/src/android/androiddev.qdoc b/doc/qtcreator/src/android/androiddev.qdoc index d16d9a31fd3..c16c80d4e70 100644 --- a/doc/qtcreator/src/android/androiddev.qdoc +++ b/doc/qtcreator/src/android/androiddev.qdoc @@ -55,10 +55,7 @@ To set up the development environment for Android: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices > - \uicontrol Android on Windows and Linux or \uicontrol {\QC} > - \uicontrol Preferences > \uicontrol Devices > \uicontrol Android on - \macos. + \li Select \preferences > \uicontrol Devices > \uicontrol Android. \image qtcreator-options-android-main.png {Android preferences} \li In the \uicontrol {JDK location} field, set the path to the JDK. \QC checks the JDK installation and reports errors. @@ -142,10 +139,8 @@ \section2 Managing Android NDK Packages - To view the installed \l{Android NDK} versions, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Devices > \uicontrol Android on Windows and - Linux or \uicontrol {\QC} > \uicontrol Preferences > \uicontrol Devices > - \uicontrol Android on \macos. + To view the installed \l{Android NDK} versions, select \preferences > + \uicontrol Devices > \uicontrol Android. \image qtcreator-options-android-sdk-tools.png {Android NDK and SDK checks} @@ -172,11 +167,8 @@ installing, updating, and removing SDK packages. You can still use \c sdkmanager for advanced SDK management. - To view the installed Android SDK packages, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Devices > \uicontrol Android > - \uicontrol {SDK Manager} on Windows and Linux or \uicontrol {\QC} > - \uicontrol Preferences > \uicontrol Devices > \uicontrol Android > - \uicontrol {SDK Manager} on \macos. + To view the installed Android SDK packages, select \preferences > + \uicontrol Devices > \uicontrol Android > \uicontrol {SDK Manager}. \image qtcreator-android-sdk-manager.webp {Android SDK Manager} @@ -200,10 +192,8 @@ \section1 Managing Android Virtual Devices (AVD) - To view the available AVDs, select \uicontrol Edit > \uicontrol Preferences - > \uicontrol Devices on Windows and Linux or \uicontrol {\QC} > - \uicontrol Preferences > \uicontrol Devices > on \macos. You can add more - AVDs. + To view the available AVDs, select \preferences > \uicontrol Devices. + You can add more AVDs. \image qtcreator-android-avd-manager.png {Android device in Devices} @@ -239,10 +229,8 @@ To create new virtual devices: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices > - \uicontrol Add > \uicontrol {Android Device} on Windows and Linux - or \uicontrol {\QC} > \uicontrol Preferences > \uicontrol Devices > - \uicontrol Add > \uicontrol {Android Device} on \macos to open the + \li Select \preferences > \uicontrol Devices > + \uicontrol Add > \uicontrol {Android Device} to open the \uicontrol {Create New AVD} dialog. \image qtcreator-android-create-avd.png {Create New AVD dialog} \li Set the name, definition, architecture, target API level, and diff --git a/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc b/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc index 45740b650dc..d49d947ff34 100644 --- a/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc +++ b/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc @@ -70,7 +70,7 @@ \section1 Specifying Settings for Debug Server Providers To create connections to bare metal devices using a debug server provider, - select \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices + select \preferences > \uicontrol Devices > \uicontrol {Bare Metal} > \uicontrol Add > \uicontrol Default. The available settings depend on the debug server provider. @@ -251,7 +251,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices + \li Select \preferences > \uicontrol Devices > \uicontrol Add > \uicontrol {Bare Metal Device} > \uicontrol {Start Wizard}. @@ -265,7 +265,7 @@ \section1 Building for and Running on Bare Metal Devices To add a kit for building applications and running them on bare metal - devices, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits + devices, select \preferences > \uicontrol Kits > \uicontrol Add. For more information, see \l{Add kits}. \image qtcreator-baremetal-kit.png "Kit preferences for Bare Metal" diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc index 2c302e5fcc5..2ef8d2e107c 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc @@ -137,9 +137,8 @@ To view all variables, select the \uicontrol Advanced check box. - To view all variables by default, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol CMake > \uicontrol General > - \uicontrol {Show advanced options by default}. + To view all variables by default, select \preferences > \uicontrol CMake > + \uicontrol General > \uicontrol {Show advanced options by default}. \image qtcreator-preferences-cmake-general.webp "General tab in CMake Preferences" @@ -152,8 +151,8 @@ stored in the CMakeLists.txt.user file, so deleting a build directory does not delete the initial configuration. - To be asked before \QC resets the changes, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol CMake > \uicontrol General > + To be asked before \QC resets the changes, select \preferences > + \uicontrol CMake > \uicontrol General > \uicontrol {Ask before re-configuring with initial parameters}. \section1 Viewing CMake Output @@ -230,7 +229,7 @@ \QC can automatically set up the \l {Setting Up Conan} {Conan package manager} for use with CMake. - Select \uicontrol Edit > \uicontrol Preferences > \uicontrol CMake + Select \preferences > \uicontrol CMake \uicontrol General > \uicontrol {Package manager auto setup} to set the value of the \c CMAKE_PROJECT_INCLUDE_BEFORE variable to the path to a CMake script that installs dependencies from a \c conanfile.txt, diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake-presets.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake-presets.qdoc index 12b5d61ba7b..3a51034199e 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake-presets.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake-presets.qdoc @@ -141,7 +141,7 @@ \endcode This example assumes that the CMake executable path is set in - \uicontrol Edit > \uicontrol Preferences > \uicontrol CMake > + \preferences > \uicontrol CMake > \uicontrol Tools. \section1 MSVC Example diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc index 4491afb9d72..999d58c67bc 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc @@ -39,9 +39,8 @@ \QC automatically runs CMake to refresh project information when you edit a \c CMakeLists.txt configuration file in a project. Project information is also automatically refreshed when you build the project. To disable this - behavior, select \uicontrol Edit > \uicontrol Preferences > \uicontrol CMake - > \uicontrol General, and then deselect the \uicontrol {Autorun CMake} - check box. + behavior, select \preferences > \uicontrol CMake > \uicontrol General, and + then deselect the \uicontrol {Autorun CMake} check box. \image qtcreator-projects-view-edit.png {CMake project in Projects view} @@ -54,8 +53,8 @@ The \uicontrol Projects view shows the names of the subfolders where the source files are located. To hide the subfolder names and arrange the files - only according to their source group, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol CMake > \uicontrol General, and then + only according to their source group, select \preferences > + \uicontrol CMake > \uicontrol General, and then deselect the \uicontrol {Show subfolders inside source group folders} check box. The change takes effect after you select \uicontrol Build > \uicontrol {Run CMake}. @@ -89,8 +88,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol CMake > - \uicontrol Tools. + \li Select \preferences > \uicontrol CMake > \uicontrol Tools. \image qtcreator-preferences-cmake-tools.webp {Tools tab in CMake Preferences} @@ -118,8 +116,8 @@ To remove the selected CMake executable from the list, select \uicontrol Remove. - To add the CMake tool to a build and run kit, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Kits. + To add the CMake tool to a build and run kit, select \preferences > + \uicontrol Kits. The kit also specifies the CMake generator that is used for producing project files for \QC and the initial configuration parameters: @@ -169,8 +167,7 @@ To automatically format CMake files upon file save: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol CMake > - \uicontrol Formatter. + \li Select \preferences > \uicontrol CMake > \uicontrol Formatter. \image qtcreator-preferences-cmake-formatter.webp {Formatter tab in CMake Preferences} \li In \uicontrol {CMakeFormat command}, enter the path to \c {cmake-format.exe}. diff --git a/doc/qtcreator/src/debugger/creator-debug-views.qdoc b/doc/qtcreator/src/debugger/creator-debug-views.qdoc index 8dfed8b2212..149ac127a8c 100644 --- a/doc/qtcreator/src/debugger/creator-debug-views.qdoc +++ b/doc/qtcreator/src/debugger/creator-debug-views.qdoc @@ -218,9 +218,8 @@ \if defined(qtcreator) \section1 Specifying Breakpoint Settings - You can specify settings for breakpoints in \uicontrol Edit > - \uicontrol Preferences > \uicontrol Debugger. For more information, - see \l{Debugger Preferences}. + You can specify settings for breakpoints in \preferences > + \uicontrol Debugger. For more information, see \l{Debugger Preferences}. \image qtcreator-debugger-general-options.png {General tab in Debugger preferences} diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger-settings.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger-settings.qdoc index ab0aff0f548..06b8d05bc52 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger-settings.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger-settings.qdoc @@ -8,9 +8,9 @@ \title Debugger Preferences - To specify settings for managing debugger processes, select \uicontrol Edit - > \uicontrol Preferences > \uicontrol Debugger. In the \uicontrol General tab, - you can specify settings that are common to all debuggers. + To specify settings for managing debugger processes, select \preferences > + \uicontrol Debugger. In the \uicontrol General tab,you can specify settings + that are common to all debuggers. \image qtcreator-debugger-general-options.png "Debugger General preferences" @@ -50,8 +50,8 @@ \section1 Specifying GDB Settings - To specify settings for managing the GDB process, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Debugger > \uicontrol GDB. + To specify settings for managing the GDB process, select \preferences > + \uicontrol Debugger > \uicontrol GDB. \image qtcreator-gdb-options.png "GDB preferences" @@ -136,8 +136,8 @@ \section1 Specifying CDB Settings - To specify settings for managing the CDB process, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Debugger > \uicontrol CDB. + To specify settings for managing the CDB process, select \preferences > + \uicontrol Debugger > \uicontrol CDB. \image qtcreator-cdb-options.png "CDB preferences" @@ -187,8 +187,7 @@ to the symbol search path of the debugger: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger > - \uicontrol {CDB Paths}. + \li Select \preferences > \uicontrol Debugger > \uicontrol {CDB Paths}. \image qtcreator-debugger-cdb-paths.png \li In the \uicontrol {Symbol Paths} group, select \uicontrol Insert. \li Select the directory where you want to store the cached information. diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc index 3de58c59ebc..39fd8013715 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc @@ -18,7 +18,7 @@ The main debugger preferences are associated with the \l{Kits}{kit} you build and run your project with. To specify the debugger and compiler to use for each kit, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. + \preferences > \uicontrol Kits. \image qtcreator-kits.png {Kits preferences} @@ -30,13 +30,13 @@ installed replacement instead. To change the debugger in an automatically detected kit, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > + \preferences > \uicontrol Kits > \uicontrol Clone to create a copy of the kit, and change the parameters in the cloned kit. Make sure to enable the cloned kit for your project. If the debugger you want to use is not automatically detected, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > + \preferences > \uicontrol Kits > \uicontrol Debuggers > \uicontrol Add to add it. \image qtcreator-preferences-kits-debuggers.webp {Debuggers tab in Kits preferences} diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index 1c1f64d419c..fe61cd19eae 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -133,19 +133,18 @@ \QC checks whether the compiled application is up-to-date, and rebuilds and deploys it if you set the \uicontrol {Build before deploying} field to - build the whole project or the application to run and select he - \uicontrol {Always deploy before running} check box in - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Build & Run} > - \uicontrol General. To debug the application without deploying - it, select \uicontrol Debug > \uicontrol {Start Debugging} > - \uicontrol {Start Debugging Without Deployment}. + build the whole project or the application to run and select the + \uicontrol {Always deploy before running} check box in \preferences > + \uicontrol {Build & Run} > \uicontrol General. To debug the application + without deploying it, select \uicontrol Debug > \uicontrol {Start Debugging} + > \uicontrol {Start Debugging Without Deployment}. The debugger then takes over and starts the application with suitable parameters. When using GDB or CDB as debug backend, you can specify additional commands to execute before and after the backend and debugged application are started or - attached in \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger > + attached in \preferences > \uicontrol Debugger > \uicontrol GDB and \uicontrol CDB. For more information, see \l{Debugger Preferences}. @@ -210,7 +209,7 @@ If a console application does not start up properly in the configured console and the subsequent attach fails, you can diagnose the issue by - using CDB's native console. Select \uicontrol Edit > \uicontrol Preferences > + using CDB's native console. Select \preferences > \uicontrol Debugger > \uicontrol CDB > \uicontrol {Use CDB console} to override the console set in the Windows system environment variables. Note that the native console does not prompt on application exit. @@ -364,7 +363,7 @@ The \QC installation program asks you whether you want to register \QC as a post-mortem debugger. To change the setting, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger > + \preferences > \uicontrol Debugger > \uicontrol General > \uicontrol {Use \QC for post-mortem debugging}. You can launch the debugger in the post-mortem mode if an application @@ -487,7 +486,7 @@ By default, a non-responsive GDB process is terminated after 20 seconds. To increase the timeout in the \uicontrol {GDB timeout} field, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger > + \preferences > \uicontrol Debugger > \uicontrol GDB. For more information about settings that you can specify to manage the GDB process, see \l{Specifying GDB Settings}. @@ -560,9 +559,9 @@ \endlist - To specify settings for managing the CDB process, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Debugger > \uicontrol CDB. For more - information, see \l{Specifying CDB Settings}. + To specify settings for managing the CDB process, select \preferences > + \uicontrol Debugger > \uicontrol CDB. For more information, see + \l{Specifying CDB Settings}. */ @@ -706,8 +705,7 @@ \section1 Customizing Debug Views To change the appearance and behavior of the debug views, set preferences - in \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger > - \uicontrol General. + in \preferences > \uicontrol Debugger > \uicontrol General. \image qtcreator-debugger-general-options.png {General tab in Debugger preferences} @@ -800,8 +798,8 @@ select \uicontrol {Close Editor Tooltips} in the context menu in the \uicontrol Locals or \uicontrol Expressions view. - To disable tooltips for performance reasons, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Debugger > \uicontrol General > + To disable tooltips for performance reasons, select \preferences > + \uicontrol Debugger > \uicontrol General > \uicontrol {Use tooltips in main editor when debugging}. \section1 Examining Complex Values in Debug Views @@ -848,9 +846,8 @@ classes in a useful way. To change the number of array elements that are - requested when expanding entries, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Debugger} > - \uicontrol {Locals & Expressions} > \uicontrol {Default array size}. + requested when expanding entries, select \preferences > \uicontrol {Debugger} + > \uicontrol {Locals & Expressions} > \uicontrol {Default array size}. \section1 Stepping Through Code @@ -948,9 +945,8 @@ value display format. The available options depend on the type of the current items, and are provided by the debugging helpers. - To force a plain C-like display of structures, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger > - \uicontrol {Locals & Expressions}, and then deselect the + To force a plain C-like display of structures, select \preferences > + \uicontrol Debugger > \uicontrol {Locals & Expressions}, and then deselect the \uicontrol {Use Debugging Helpers} check box. This still uses the Python scripts, but generates more basic output. To force the plain display for a single object or for all objects of a given type, select @@ -990,9 +986,8 @@ If an instance of a class is derived from QObject, you can find all other objects connected to this object's slots with Qt's signals and slots - mechanism. Select \uicontrol Edit > \uicontrol Preferences - > \uicontrol {Debugger} > \uicontrol {Locals & Expressions} > - \uicontrol {Use Debugging Helpers}. + mechanism. Select \preferences > \uicontrol {Debugger} > + \uicontrol {Locals & Expressions} > \uicontrol {Use Debugging Helpers}. \image qtcreator-debugging-helper-options.webp {Locals & Expressions preferences} @@ -1006,9 +1001,8 @@ switch off the debugging helpers to make low-level structures visible. To switch off the debugging helpers, deselect - \uicontrol {Use Debugging Helpers} in \uicontrol Edit > - \uicontrol Preferences > \uicontrol Debugger > - \uicontrol {Locals & Expressions}. + \uicontrol {Use Debugging Helpers} in \preferences > + \uicontrol Debugger > \uicontrol {Locals & Expressions}. \omit \section2 Creating Snapshots @@ -1112,8 +1106,8 @@ When using CDB as debug backend, you can specify that the debugger should break when application modules are loaded or unloaded. To enable breaking - for the specified modules, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Debugger > \uicontrol CDB. + for the specified modules, select \preferences > \uicontrol Debugger > + \uicontrol CDB. \image qtcreator-cdb-options.png {CDB tab in Debugger preferences} @@ -1150,8 +1144,7 @@ To enable the debugger to step into the code and display the source code when using a copy of the source tree at a location different from the one at which the libraries were built, you can map source paths to target - paths in \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger > - \uicontrol General: + paths in \preferences > \uicontrol Debugger > \uicontrol General: \image qtcreator-debugger-general-options.png {General tab in Debugger preferences} @@ -1264,8 +1257,8 @@ \image qtcreator-debugger-log-view.webp {Debugger Log view} - If debug output is sent to the system log, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Debugger > \uicontrol General > + If debug output is sent to the system log, select \preferences > + \uicontrol Debugger > \uicontrol General > \uicontrol {Force logging to console} check box. Right-click the view to select the following actions: @@ -1315,7 +1308,7 @@ \image qtcreator-debugger-disassembler-view.webp {Disassembler view} By default, GDB shows AT&T style disassembly. To switch to the Intel style, - select \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger > + select \preferences > \uicontrol Debugger > \uicontrol GDB > \uicontrol {Use Intel style disassembly}. To open the \uicontrol Disassembler view: @@ -1371,7 +1364,7 @@ least one of the three supported backends is available. To use the default GDB pretty printers installed in your system or linked - to the libraries your application uses, select \uicontrol Preferences > + to the libraries your application uses, select \preferences > \uicontrol Debugger > \uicontrol GDB > \uicontrol {Load system GDB pretty printers}. For more information, see \l{Specifying GDB Settings}. @@ -1381,9 +1374,9 @@ You can have commands executed after built-in debugging helpers have been loaded and fully initialized. To load additional debugging helpers or - modify existing ones, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Debugger > \uicontrol {Locals & Expressions}, and enter the - commands in the \uicontrol {Debugging Helper Customization} field. + modify existing ones, select \preferences > \uicontrol Debugger > + \uicontrol {Locals & Expressions}, and enter the commands in the + \uicontrol {Debugging Helper Customization} field. \image qtcreator-debugging-helper-options.webp {Locals & Expressions preferences} @@ -1403,9 +1396,8 @@ \endcode To display a message box as soon as your application receives a signal - during debugging, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Debugger > \uicontrol GDB > \uicontrol {Show a message box - when receiving a signal}. + during debugging, select \preferences > \uicontrol Debugger > \uicontrol GDB > + \uicontrol {Show a message box when receiving a signal}. \section2 Adding Custom Debugging Helpers @@ -1416,8 +1408,8 @@ To add debugging helpers for custom types, add debugging helper implementations to the startup file of the native debuggers (for example, \c{~/.gdbinit} or \c{~/.lldbinit}) or specify them directly in the - \uicontrol {Additional Startup Commands} in \uicontrol Edit > - \uicontrol Preferences > \uicontrol Debugger > \uicontrol GDB. + \uicontrol {Additional Startup Commands} in \preferences > + \uicontrol Debugger > \uicontrol GDB. To get started with implementing debugging helpers for your own data types, you can put their implementation into the file @@ -1450,9 +1442,8 @@ update your \QC installation (when updating your Qt installation, for example), copy it to a safe location outside the \QC installation in your file system and specify the location in - \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger > - \uicontrol {Locals & Expressions} > - \uicontrol {Extra Debugging Helper}. + \preferences > \uicontrol Debugger > \uicontrol {Locals & Expressions} + > \uicontrol {Extra Debugging Helper}. \endlist The custom debugging helpers will be automatically picked up from @@ -1593,7 +1584,7 @@ common situations. When using CDB as debugger backend, you can enable the Python dumper by - selecting \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger > + selecting \preferences > \uicontrol Debugger > \uicontrol CDB > \uicontrol {Use Python dumper}. \image qtcreator-cdb-options.png {CDB preferences} @@ -2042,9 +2033,8 @@ When using GDB as backend, you can automatically save a copy of its symbol index in a cache on disk and retrieve it from there - when loading the same binary in the future. Select \uicontrol Edit - > \uicontrol Preferences > \uicontrol Debugger > \uicontrol GDB > - \uicontrol {Use automatic symbol cache}. + when loading the same binary in the future. Select \preferences > + \uicontrol Debugger > \uicontrol GDB > \uicontrol {Use automatic symbol cache}. \image qtcreator-gdb-options.png {GDB preferences} diff --git a/doc/qtcreator/src/debugger/qtquick-debugging.qdoc b/doc/qtcreator/src/debugger/qtquick-debugging.qdoc index 739095b5a03..29589073f9a 100644 --- a/doc/qtcreator/src/debugger/qtquick-debugging.qdoc +++ b/doc/qtcreator/src/debugger/qtquick-debugging.qdoc @@ -91,9 +91,8 @@ \section2 Using Default Values - You can enable or disable QML debugging globally in \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Build & Run} > - \uicontrol {Default Build Properties}. + You can enable or disable QML debugging globally in \preferences > + \uicontrol {Build & Run} > \uicontrol {Default Build Properties}. \image qtcreator-build-settings-default.png "Default Build Properties tab in Build & Run Preferences" @@ -120,7 +119,7 @@ \QC, it will be kept as you want it. There are some known issues in the interaction between the global setting - in \uicontrol Edit > \uicontrol Preferences > \uicontrol {Build & Run} > + in \preferences > \uicontrol {Build & Run} > \uicontrol {Default Build Properties} and the build configuration. For example, for qmake the global setting only affects build configurations that are automatically created when enabling a kit. Also, CMake ignores the diff --git a/doc/qtcreator/src/docker/creator-docker.qdoc b/doc/qtcreator/src/docker/creator-docker.qdoc index c109aca5f94..ae1dced8cea 100644 --- a/doc/qtcreator/src/docker/creator-docker.qdoc +++ b/doc/qtcreator/src/docker/creator-docker.qdoc @@ -33,7 +33,7 @@ To add a Docker image as a device: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices + \li Select \preferences > \uicontrol Devices > \uicontrol Docker and enter the path to the Docker CLI in the \uicontrol Command field. \image qtcreator-preferences-devices-docker.webp "Docker tab in Devices preferences" @@ -145,7 +145,7 @@ \section1 Editing Docker Device Kits - Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits to check + Select \preferences > \uicontrol Kits to check that the automatically generated kits point to the appropriate kit items. To specify build settings: diff --git a/doc/qtcreator/src/editors/creator-code-completion.qdoc b/doc/qtcreator/src/editors/creator-code-completion.qdoc index 409855ab73d..b3d1830640b 100644 --- a/doc/qtcreator/src/editors/creator-code-completion.qdoc +++ b/doc/qtcreator/src/editors/creator-code-completion.qdoc @@ -28,8 +28,8 @@ \section1 Specifying Completion Settings - To specify settings for code completion, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Completion. + To specify settings for code completion, select \preferences > + \uicontrol {Text Editor} > \uicontrol Completion. \image qtcreator-preferences-texteditor-completion.webp "Text Editor Completion preferences" @@ -153,7 +153,7 @@ Code snippets specify code constructs. You can add, modify, and remove snippets in the snippet editor. To open the editor, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > + \preferences > \uicontrol {Text Editor} > \uicontrol Snippets. \if defined(qtcreator) @@ -296,7 +296,7 @@ completion. To use Nimsuggest, you must install it on the development PC. Then select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Nim > \uicontrol Tools, + \preferences > \uicontrol Nim > \uicontrol Tools, and enter the path to the tool executable in the \uicontrol Path field. \sa {Document code} diff --git a/doc/qtcreator/src/editors/creator-code-indentation.qdoc b/doc/qtcreator/src/editors/creator-code-indentation.qdoc index aaf37d64b9c..6dcb32a4aa6 100644 --- a/doc/qtcreator/src/editors/creator-code-indentation.qdoc +++ b/doc/qtcreator/src/editors/creator-code-indentation.qdoc @@ -43,9 +43,9 @@ \section1 Automatically fix indentation To automatically fix indentation according to the indentation settings - when you save the file, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Text Editor} > \uicontrol Behavior > - \uicontrol {Clean whitespace} > \uicontrol {Clean indentation}. Select + when you save the file, select \preferences > \uicontrol {Text Editor} > + \uicontrol Behavior > \uicontrol {Clean whitespace} > + \uicontrol {Clean indentation}. Select the \uicontrol {Skip clean whitespace for file types} check box to exclude the specified file types. @@ -53,8 +53,8 @@ \section1 Show whitespace in editor - To visualize whitespace in the editor, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Display > + To visualize whitespace in the editor, select \preferences > + \uicontrol {Text Editor} > \uicontrol Display > \uicontrol {Visualize whitespace}. To visualize indentation, select \uicontrol {Visualize Indent}. To adjust the diff --git a/doc/qtcreator/src/editors/creator-code-refactoring.qdoc b/doc/qtcreator/src/editors/creator-code-refactoring.qdoc index a9ff5a20b5e..37f45c5b259 100644 --- a/doc/qtcreator/src/editors/creator-code-refactoring.qdoc +++ b/doc/qtcreator/src/editors/creator-code-refactoring.qdoc @@ -22,7 +22,7 @@ \l{Applying Refactoring Actions}. By default, the refactored files are saved automatically. To disable - this feature, deselect \uicontrol Edit > \uicontrol Preferences > + this feature, deselect \preferences > \uicontrol Environment > \uicontrol System > \uicontrol {Auto-save files after refactoring}. \if defined(qtcreator) diff --git a/doc/qtcreator/src/editors/creator-code-syntax.qdoc b/doc/qtcreator/src/editors/creator-code-syntax.qdoc index 87203f8bd3a..15c4fa47229 100644 --- a/doc/qtcreator/src/editors/creator-code-syntax.qdoc +++ b/doc/qtcreator/src/editors/creator-code-syntax.qdoc @@ -39,7 +39,7 @@ of the line annotations. To modify the colors used for underlining errors and warnings, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > + \preferences > \uicontrol {Text Editor} > \uicontrol {Font & Colors} > \uicontrol Copy, and select new colors for \uicontrol Error and \uicontrol Warning. @@ -55,7 +55,7 @@ \section1 Specifying Line Annotation Positions To specify the position where the annotations are displayed, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > + \preferences > \uicontrol {Text Editor} > \uicontrol Display > \uicontrol {Line annotations}, and then select whether to display the annotations directly next to the code, aligned to the right of the code, or in the right margin. Showing annotations @@ -701,9 +701,9 @@ \section1 Enabling and Disabling Messages - To enable and disable QML and JavaScript messages, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Qt Quick} > \uicontrol {QML/JS Editing} - > \uicontrol {Use customized static analyzer}. + To enable and disable QML and JavaScript messages, select \preferences > + \uicontrol {Qt Quick} > \uicontrol {QML/JS Editing} > + \uicontrol {Use customized static analyzer}. \image qtcreator-preferences-qtquick-qmljs-editing.webp {QML/JS Editing tab in Qt Quick preferences} @@ -739,8 +739,8 @@ \section1 Automatically Formatting QML/JS Files - To automatically format QML/JS files upon saving, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Qt Quick} > \uicontrol {QML/JS Editing} > + To automatically format QML/JS files upon saving, select \preferences > + \uicontrol {Qt Quick} > \uicontrol {QML/JS Editing} > \uicontrol {Enable auto format on file save}. To only format files that belong to the current project, select \uicontrol {Restrict to files contained in the current project}. @@ -763,9 +763,8 @@ This action expands all C++ macros to their actual code and removes code that is guarded by a currently inactive \c {#ifdef} statements. If you deselect the \uicontrol {Use built-in preprocessor to show pre-processed files} check - box in \uicontrol Edit > \uicontrol Preferences > \uicontrol C++ > - \uicontrol {Code Model}, this action also expands all - \c {"#include <foo.h>"} statements to their actual contents. + box in \preferences > \uicontrol C++ > \uicontrol {Code Model}, this action + also expands all \c {"#include <foo.h>"} statements to their actual contents. \image qtcreator-preferences-code-model.webp {C++ Code Model preferences} diff --git a/doc/qtcreator/src/editors/creator-diff-editor.qdoc b/doc/qtcreator/src/editors/creator-diff-editor.qdoc index 2cc78bbfbaf..92e25c5dcac 100644 --- a/doc/qtcreator/src/editors/creator-diff-editor.qdoc +++ b/doc/qtcreator/src/editors/creator-diff-editor.qdoc @@ -100,7 +100,7 @@ \section1 Changing the Colors - To change the default colors, select \uicontrol Edit > \uicontrol Preferences > + To change the default colors, select \preferences > \uicontrol {Text Editor} > \uicontrol {Font & Colors}. Create your own color scheme and select new colors for the following items: diff --git a/doc/qtcreator/src/editors/creator-editors-options-text.qdoc b/doc/qtcreator/src/editors/creator-editors-options-text.qdoc index e4779703627..a9352a5bc36 100644 --- a/doc/qtcreator/src/editors/creator-editors-options-text.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-options-text.qdoc @@ -23,9 +23,8 @@ \endif Set the font preferences and apply color schemes for syntax highlighting, - diff editor, and code analysis results in \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > - \uicontrol {Font & Colors}. + diff editor, and code analysis results in \preferences > + \uicontrol {Text Editor} > \uicontrol {Font & Colors}. \image qtcreator-font-colors.png "Text editor preferences" @@ -35,9 +34,8 @@ percentage for viewing the text. You can also zoom in or out by pressing \key {Ctrl++} or \key {Ctrl+-}, or by pressing \key Ctrl and rolling the mouse button up or down. To disable the mouse wheel function, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > - \uicontrol Behavior and deselect the - \uicontrol {Enable scroll wheel zooming} check box. + \preferences > \uicontrol {Text Editor} > \uicontrol Behavior and deselect + the \uicontrol {Enable scroll wheel zooming} check box. To improve the readability of text in the editor, adjust the line spacing in the \uicontrol {Line spacing} field. @@ -55,9 +53,8 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Text Editor} > \uicontrol {Fonts & Color} > - \uicontrol Copy. + \li Select \preferences > \uicontrol {Text Editor} > + \uicontrol {Fonts & Color} > \uicontrol Copy. \li Enter a name for the color scheme and click \uicontrol OK. @@ -86,7 +83,7 @@ \section2 Exporting and Importing Color Schemes To share color schemes with others, export and import them as XML files. - To export a color scheme, select \uicontrol Edit > \uicontrol Preferences > + To export a color scheme, select \preferences > \uicontrol {Text Editor} > \uicontrol {Fonts & Color} > \uicontrol Export, and then select the filename and location for the XML file. @@ -101,8 +98,8 @@ \section2 File Encoding - To define the default file encoding, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Behavior, and + To define the default file encoding, select \preferences > + \uicontrol {Text Editor} > \uicontrol Behavior, and then select a suitable option in \uicontrol {Default encoding}. \image qtcreator-options-texteditor-behavior-file-encodings.png "File encoding preferences" diff --git a/doc/qtcreator/src/editors/creator-editors-options.qdoc b/doc/qtcreator/src/editors/creator-editors-options.qdoc index d56f130c122..e17a11c8a98 100644 --- a/doc/qtcreator/src/editors/creator-editors-options.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-options.qdoc @@ -19,7 +19,7 @@ \title Configuring the Editor You can configure the text editor to suit your specific needs by selecting - \uicontrol Edit > \uicontrol Preferences > \uicontrol{Text Editor}. + \preferences > \uicontrol{Text Editor}. \image qtcreator-font-colors.png "Text Editor preferences" diff --git a/doc/qtcreator/src/editors/creator-locator.qdoc b/doc/qtcreator/src/editors/creator-locator.qdoc index f26024a6864..44cdc361bc7 100644 --- a/doc/qtcreator/src/editors/creator-locator.qdoc +++ b/doc/qtcreator/src/editors/creator-locator.qdoc @@ -231,8 +231,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Environment > \uicontrol Locator > + \li Select \preferences > \uicontrol Environment > \uicontrol Locator > \uicontrol {Web Search} > \uicontrol Edit. \li Select \uicontrol Add to add a new entry to the list. @@ -307,8 +306,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Environment > \uicontrol Locator. + \li Select \preferences > \uicontrol Environment > \uicontrol Locator. \li In \uicontrol {Refresh interval}, define new time in minutes. diff --git a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc index d994a175e35..20a04c003f0 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc @@ -52,14 +52,14 @@ \uicontrol Beautifier to enable the plugin. \note Since \QC 10.0.0, the ClangFormat plugin is enabled by - default. Select \uicontrol Edit > \uicontrol Preferences > + default. Select \preferences > \uicontrol {C++} > \uicontrol {Formatting mode} > \uicontrol Disable to turn off ClangFormat if you enable Beautifier because combining them can lead to unexpected results. \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \li Select \uicontrol Edit > \uicontrol Preferences > + \li Select \preferences > \uicontrol Beautifier to specify settings for beautifying files. \li Select the \uicontrol {Enable auto format on file save} check box to @@ -148,7 +148,7 @@ \endlist - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Beautifier + \li Select \preferences > \uicontrol Beautifier > \uicontrol {Artistic Style}, \uicontrol ClangFormat, or \uicontrol Uncrustify > \uicontrol {Format Current File} to format the currently open file. diff --git a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc index a0b5a416980..cd7a71f3d70 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc @@ -82,7 +82,7 @@ \endlist - To use the built-in code model instead, select \uicontrol Edit > \uicontrol Preferences > + To use the built-in code model instead, select \preferences > \uicontrol C++ > \uicontrol clangd, and deselect the \uicontrol {Use clangd} check box. This setting also exists on the project level, so that you can have the clang-based services generally enabled, but switch them off for certain projects, or vice versa. @@ -100,7 +100,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol C++ > + \li Select \preferences > \uicontrol C++ > \uicontrol {Code Model}. \image qtcreator-preferences-code-model.webp {C++ Code Model preferences} @@ -159,7 +159,7 @@ To specify settings for clangd: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol C++ > + \li Select \preferences > \uicontrol C++ > \uicontrol Clangd > \uicontrol {Use clangd}. \image qtcreator-options-clangd.png "clangd preferences" \li In \uicontrol {Path to executable}, enter the path to clangd diff --git a/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc b/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc index e12c5e29fdf..7e77b016b4c 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc @@ -23,8 +23,7 @@ To specify settings for the code pasting service: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Code Pasting}. + \li Select \preferences > \uicontrol {Code Pasting}. \image qtcreator-code-pasting-options.png "Code Pasting preferences" \li In the \uicontrol {Default protocol} field, select a code pasting service to use by default. diff --git a/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc b/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc index 4596447924d..0f4933bee49 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc @@ -17,8 +17,8 @@ \image qtcreator-editortoolbar-symbols.webp {Edit mode toolbar} - To add more space around the toolbar items, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Environment > \uicontrol Interface, and + To add more space around the toolbar items, select \preferences > + \uicontrol Environment > \uicontrol Interface, and then select \uicontrol Relaxed in the \uicontrol {Toolbar style} field. \image qtcreator-preferences-environment-interface.webp {Interface tab in Environment preferences} @@ -81,7 +81,7 @@ \section2 Changing Text Encoding To show the file encoding of the current file on the editor toolbar (5), - select \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > + select \preferences > \uicontrol {Text Editor} > \uicontrol Display > \uicontrol {Display file encoding}. To change the text encoding, click it on the toolbar and select new @@ -97,11 +97,11 @@ To switch between Windows line endings (CRLF) and Unix line endings (LF), select the ending style on the editor toolbar (6). To hide this field, - select \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} + select \preferences > \uicontrol {Text Editor} > \uicontrol Display, and deselect \uicontrol {Display file line ending}. To set the line endings to use for all projects by default, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > + \preferences > \uicontrol {Text Editor} > \uicontrol Behavior, and then select the ending style in the \uicontrol {Default line endings} field. @@ -269,9 +269,8 @@ splits opened, you can open the link in the next split by holding \key Ctrl and \key Alt while clicking the symbol. - To enable this moving function, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Behavior > - \uicontrol {Enable mouse navigation}. + To enable this moving function, select \preferences > \uicontrol {Text Editor} + > \uicontrol Behavior > \uicontrol {Enable mouse navigation}. There are several additional ways of moving between symbol definitions and declarations. All the functions described below are also available from the @@ -307,8 +306,8 @@ split, prepend \key {Ctrl+E} to the shortcut. For example, press \key {Ctrl+E,F2} to follow the symbol in the next split. If necessary, the view is automatically split. To change the default behavior, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > - \uicontrol Display > \uicontrol {Always open links in another split}. + \preferen \uicontrol {Text Editor} > \uicontrol Display > + \uicontrol {Always open links in another split}. Additional symbols are displayed and switching between definition and declaration is done in another split. If you change the default behavior, the shortcuts for opening diff --git a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc index 76dc97baabb..62f0f72da63 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc @@ -46,8 +46,7 @@ To set preferences for using Copilot: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Copilot. + \li Select \preferences > \uicontrol Copilot. \image qtcreator-preferences-copilot.webp {Copilot tab in Preferences} \li Select the \uicontrol {Enable Copilot} check box to use Copilot. \li Select \uicontrol {Sign In} to sign into your subscription, activate @@ -95,8 +94,7 @@ To enable or disable Copilot suggestions globally, select the \inlineimage icons/copilot.png (\uicontrol {Toggle Copilot}) button. This also sets the value of the - \uicontrol {Enable Copilot} check box in \uicontrol Edit > - \uicontrol Preferences accordingly. + \uicontrol {Enable Copilot} check box in \preferences accordingly. To enable or disable Copilot suggestions for a particular project, select \uicontrol Projects > \uicontrol {Project Settings} > diff --git a/doc/qtcreator/src/editors/creator-only/creator-fakevim.qdoc b/doc/qtcreator/src/editors/creator-only/creator-fakevim.qdoc index c366cf82a4b..59c613a8fbe 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-fakevim.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-fakevim.qdoc @@ -93,7 +93,7 @@ \section2 Plugin Emulation FakeVim also emulates some popular vim plugins. To enable plugin emulation - for particular plugins, select \uicontrol Edit > \uicontrol Preferences > + for particular plugins, select \preferences > \uicontrol FakeVim > \uicontrol General > \uicontrol {Plugin Emulation}. \image qtcreator-fakevim-options-general-plugin-emulation.png "FakeVim Plugin Emulation preferences" @@ -269,8 +269,8 @@ \section1 Mapping FakeVim Commands To map commands entered on the \uicontrol FakeVim command line to - \QC functions, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol FakeVim > \uicontrol {Ex Command Mapping}. + \QC functions, select \preferences > \uicontrol FakeVim > + \uicontrol {Ex Command Mapping}. Enter a string in the \uicontrol Filter field to search for a specific \QC function. @@ -284,17 +284,17 @@ To reset the trigger expressions for all functions, select \uicontrol {Reset All}. - To map \e {user commands} to keyboard shortcuts, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol FakeVim > - \uicontrol {User Command Mapping}. The user command mapped to the shortcut - is executed by FakeVim as if you were typing it (as when replaying a macro). + To map \e {user commands} to keyboard shortcuts, select \preferences > + \uicontrol FakeVim > \uicontrol {User Command Mapping}. The user command + mapped to the shortcut is executed by FakeVim as if you were typing it + (as when replaying a macro). \image qtcreator-fakevim-options-user-command-mapping.png "FakeVim User Command Mapping preferences" \section1 Setting FakeVim Preferences - To make changes to the Vim-style settings, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol FakeVim > \uicontrol General. + To make changes to the Vim-style settings, select \preferences > + \uicontrol FakeVim > \uicontrol General. \image qtcreator-fakevim-options.png "FakeVim preferences" @@ -304,13 +304,13 @@ select \uicontrol {Set Plain Style}. You can then change any of the preselected settings. - To use a Vim-style color scheme, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol {Fonts & Color}. + To use a Vim-style color scheme, select \preferences > + \uicontrol {Text Editor} > \uicontrol {Fonts & Color}. In the \uicontrol {Color Scheme} list, select \uicontrol {Vim (dark)}. \section1 Quitting FakeVim Mode - To quit the FakeVim mode, deselect \uicontrol Edit > \uicontrol Preferences > + To quit the FakeVim mode, deselect \preferences > \uicontrol FakeVim > \uicontrol {Use FakeVim} or press \key {Alt+V,Alt+V}. You can temporarily escape FakeVim mode to access the normal \QC keyboard diff --git a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc index 9ca34ea7b31..aca41d7c835 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc @@ -18,8 +18,7 @@ \li \l{Completing Code}{Code completion} \li Sending document formatting requests to the language server to automatically format documents using the settings specified in - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} - > \uicontrol Behavior + \preferences > \uicontrol {Text Editor} > \uicontrol Behavior \li Highlighting the symbol under cursor \li \l{View function tooltips} \li \l{Semantic Highlighting}{Semantic highlighting}, as defined in @@ -62,10 +61,8 @@ server is added by default and you can edit its preferences. For other languages, you can add generic stdIO language servers. - To add language servers, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Language Client} > \uicontrol Add (or \uicontrol {Qt Creator} > - \uicontrol Preferences > \uicontrol {Language Client} > \uicontrol Add - on \macos). + To add language servers, select \preferences > + \uicontrol {Language Client} > \uicontrol Add. To enable a language server, select the check box next to the language server name and set server preferences. @@ -77,9 +74,8 @@ To add a generic language server: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Language Client} > \uicontrol Add > - \uicontrol {Generic StdIO Language Server} + \li Select \preferences > \uicontrol {Language Client} > + \uicontrol Add > \uicontrol {Generic StdIO Language Server} to add a generic language server. \image qtcreator-language-server-generic-stdio.png \li In the \uicontrol Name field, enter a name for the language server. @@ -110,9 +106,9 @@ To add a Java language server: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Language Client} > \uicontrol Add > - \uicontrol {Java Language Server} to add a Java language server. + \li Select \preferences > \uicontrol {Language Client} > + \uicontrol Add > \uicontrol {Java Language Server} to add + a Java language server. \image qtcreator-language-client-options-java.png "Java language server preferences" \li In the \uicontrol Name field, enter a name for the language server. Select the \inlineimage icons/replace.png @@ -130,8 +126,8 @@ To set preferences for Python language servers: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Python > \uicontrol {Language Server Configuration} to + \li Select \preferences> \uicontrol Python > + \uicontrol {Language Server Configuration} to select the Python language server plugins to use. \image qtcreator-python-plugins.png "Python Language Server Configuration" \li Select \uicontrol Advanced to configure the plugins. @@ -149,7 +145,7 @@ Since Qt 6.4, the \c qmlls language server offers code completion and issues warnings for QML. To enable QML language server support, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Qt Quick} > + \preferences > \uicontrol {Qt Quick} > \uicontrol {QML/JS Editing} > \uicontrol {Use qmlls (EXPERIMENTAL!)}. To use the latest version of the language server installed on your system, select the \uicontrol {Always use latest qmlls} check box. diff --git a/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc b/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc index 662b3c0fa20..4e66db714c1 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc @@ -46,7 +46,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > + \li Select \preferences > \uicontrol Environment > \uicontrol {MIME Types}. \image qtcreator-mime-types.png "MIME Types" diff --git a/doc/qtcreator/src/editors/creator-only/creator-preferences-cpp-code-style.qdoc b/doc/qtcreator/src/editors/creator-only/creator-preferences-cpp-code-style.qdoc index b8e9d5e38b6..44622426af8 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-preferences-cpp-code-style.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-preferences-cpp-code-style.qdoc @@ -18,7 +18,7 @@ To specify global indentation settings for the C++ editor: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol {C++}. + \li Select \preferences > \uicontrol {C++}. \image qtcreator-code-style-clang-format-global.webp {Code Style preferences} \li In \uicontrol {Formatting mode}, select: \list diff --git a/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc b/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc index e1d5d185087..3d77de55346 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc @@ -14,7 +14,7 @@ To specify settings for the Nim editor (experimental): \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Nim. + \li Select \preferences > \uicontrol Nim. \li In the \uicontrol {Current settings} field, select the settings to modify and click \uicontrol Copy. \image qtcreator-options-code-style-nim.png {Nim Code Style preferences} diff --git a/doc/qtcreator/src/editors/creator-only/creator-text-editing-macros.qdoc b/doc/qtcreator/src/editors/creator-only/creator-text-editing-macros.qdoc index 6687e0241ae..1ea89d69d8f 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-text-editing-macros.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-text-editing-macros.qdoc @@ -24,12 +24,12 @@ \uicontrol {Text Editing Macros} > \uicontrol {Save Last Macro}. To assign a keyboard shortcut to a text editing macro, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Environment > + \preferences > \uicontrol Environment > \uicontrol Keyboard. For more information, see \l{Assign keyboard shortcuts}. You can also use the \c rm locator filter to run a macro. For more information, see \l{Searching with the Locator}. - To view and remove saved macros, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Macros. + To view and remove saved macros, select \preferences > + \uicontrol {Text Editor} > \uicontrol Macros. */ diff --git a/doc/qtcreator/src/editors/creator-preferences-text-editor-behavior.qdoc b/doc/qtcreator/src/editors/creator-preferences-text-editor-behavior.qdoc index 440d9a9e239..553e0993961 100644 --- a/doc/qtcreator/src/editors/creator-preferences-text-editor-behavior.qdoc +++ b/doc/qtcreator/src/editors/creator-preferences-text-editor-behavior.qdoc @@ -17,8 +17,8 @@ \brief Set preferences for the behavior of the text editor. To specify indentation settings for text files that do not have C++ or - QML code (such as Python code files), select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Behavior. + QML code (such as Python code files), select \preferences > + \uicontrol {Text Editor} > \uicontrol Behavior. \image qtcreator-indentation.png {Text Editor Behavior preferences} @@ -64,7 +64,7 @@ When you type text or code, it is indented automatically according to the selected text editor or code style preferences. To set typing preferences, - select \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > + select \preferences > \uicontrol {Text Editor} > \uicontrol Behavior > \uicontrol Typing. To disable automatic indentation, deselect the diff --git a/doc/qtcreator/src/editors/creator-quick-fixes.qdoc b/doc/qtcreator/src/editors/creator-quick-fixes.qdoc index 88fddf01514..ed482dfcedc 100644 --- a/doc/qtcreator/src/editors/creator-quick-fixes.qdoc +++ b/doc/qtcreator/src/editors/creator-quick-fixes.qdoc @@ -83,8 +83,7 @@ You can specify settings for the refactoring actions either globally for all projects or separately for each project. To specify global options, - select \uicontrol Edit > \uicontrol Preferences > \uicontrol C++ > - \uicontrol {Quick Fixes}. + select \preferences > \uicontrol C++ > \uicontrol {Quick Fixes}. To specify custom settings for a particular project, select \uicontrol Projects > \uicontrol {Project Settings} > @@ -728,7 +727,7 @@ By default, \QC uses the \c auto variable type when creating the variable. To label the variable with its actual type, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol C++ > + \preferences > \uicontrol C++ > \uicontrol {Quick Fixes}, and then deselect the \uicontrol {Use type "auto" when creating new variables} check box. diff --git a/doc/qtcreator/src/editors/creator-search.qdoc b/doc/qtcreator/src/editors/creator-search.qdoc index 904452fbe39..f01e547e8d3 100644 --- a/doc/qtcreator/src/editors/creator-search.qdoc +++ b/doc/qtcreator/src/editors/creator-search.qdoc @@ -95,7 +95,7 @@ The locations of search hits, breakpoints, and bookmarks in your document are highlighted on the editor scroll bar. To turn highlighting off, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > + \preferences > \uicontrol {Text Editor} > \uicontrol Display > \uicontrol {Highlight search results on the scrollbar}. To search using more advanced options, select \uicontrol Advanced. @@ -243,11 +243,9 @@ \li If Silver Searcher is not found, you might have installed it in a location that is not found via the \c{PATH} environment variable. - Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Environment > - \uicontrol System (or \uicontrol {\QC} > \uicontrol Preferences > - \uicontrol Environment > \uicontrol System on macOS), then select - \uicontrol Change in the \uicontrol Environment field and add an entry - \c{PATH=/path/to/bin:${PATH}}. + Select \preferences > \uicontrol Environment > \uicontrol System, + then select \uicontrol Change in the \uicontrol Environment field, + and add the entry \c{PATH=/path/to/bin:${PATH}}. \endlist \endif diff --git a/doc/qtcreator/src/editors/creator-semantic-highlighting.qdoc b/doc/qtcreator/src/editors/creator-semantic-highlighting.qdoc index 41e8c1ea961..e6d119bb818 100644 --- a/doc/qtcreator/src/editors/creator-semantic-highlighting.qdoc +++ b/doc/qtcreator/src/editors/creator-semantic-highlighting.qdoc @@ -24,8 +24,7 @@ \endlist To specify the color scheme to use for semantic highlighting, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > - \uicontrol {Fonts & Color}. + \preferences > \uicontrol {Text Editor} > \uicontrol {Fonts & Color}. \QC supports syntax highlighting also for other types of files than C++, QML, or JavaScript. @@ -48,7 +47,7 @@ If more than one highlight definition is available for the file that you open for editing, the editor asks you to select the one to use. To save the selection, select \uicontrol {Remember My Choice}. To reset the - remembered definitions, select \uicontrol Edit > \uicontrol Preferences > + remembered definitions, select \preferences > \uicontrol {Text Editor} > \uicontrol {Generic Highlighter} > \uicontrol {Reset Remembered Definitions}. @@ -58,10 +57,9 @@ To view information about the downloaded files, open the \l{View output} {General Messages} view. - To suppress the message for a particular file pattern, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} - > \uicontrol {Generic Highlighter} and add the pattern to the - \uicontrol {Ignored file patterns} field. + To suppress the message for a particular file pattern, select \preferences > + \uicontrol {Text Editor} > \uicontrol {Generic Highlighter} and add the + pattern to the \uicontrol {Ignored file patterns} field. \image qtcreator-syntax-highlighter.png "Generic Highlighter preferences" @@ -79,15 +77,14 @@ \image qtcreator-blockhighlighting.png - To enable block highlighting, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Display > - \uicontrol {Highlight blocks}. + To enable block highlighting, select \preferences > \uicontrol {Text Editor} + > \uicontrol Display > \uicontrol {Highlight blocks}. Use the folding markers to collapse and expand blocks of code within braces. Click the folding marker to collapse or expand a block. In the figure above, the folding markers are located between the line number and the text pane. - To show the folding markers, select \uicontrol Edit > \uicontrol Preferences > + To show the folding markers, select \preferences > \uicontrol {Text Editor} > \uicontrol Display > \uicontrol {Display folding markers}. This option is enabled by default. @@ -95,7 +92,7 @@ When the cursor is on a brace, the matching brace is animated by default. To turn off the animation and just highlight the block and the braces, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > + \preferences > \uicontrol {Text Editor} > \uicontrol Display and deselect \uicontrol {Animate matching parentheses}. You can use keyboard shortcuts to move within and between blocks. To go to @@ -107,7 +104,7 @@ To select the current block, press \key Ctrl+U. A second key press extends the selection to the parent block. To undo the last selection, press \key {Ctrl+Alt+Shift+U}. To enable smart block selection, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > + \preferences > \uicontrol {Text Editor} > \uicontrol Behavior > \uicontrol {Enable smart selection changing}. \image qtcreator-options-text-editor-behavior.png "Text Editor Behavior preferences" diff --git a/doc/qtcreator/src/howto/creator-external-tools.qdoc b/doc/qtcreator/src/howto/creator-external-tools.qdoc index 79e0599c3c3..53ba24a3f4b 100644 --- a/doc/qtcreator/src/howto/creator-external-tools.qdoc +++ b/doc/qtcreator/src/howto/creator-external-tools.qdoc @@ -31,7 +31,7 @@ \section1 Configure external tools You can change the configuration of preconfigured tools and configure - additional tools in \QC \uicontrol Preferences. + additional tools in \QC \preferences. \image qtcreator-external-tools.png @@ -90,7 +90,7 @@ To globally change the system environment from the one in which - \QC is started, select \uicontrol Edit > \uicontrol Preferences > + \QC is started, select \preferences > \uicontrol Environment > \uicontrol System, and then select \uicontrol Change in the \uicontrol Environment field. \if defined(qtcreator) diff --git a/doc/qtcreator/src/howto/creator-help.qdoc b/doc/qtcreator/src/howto/creator-help.qdoc index 005153cb13c..434ee6fe9b2 100644 --- a/doc/qtcreator/src/howto/creator-help.qdoc +++ b/doc/qtcreator/src/howto/creator-help.qdoc @@ -36,7 +36,7 @@ space, in the fullscreen \uicontrol Help mode. \li To select and configure how the documentation is displayed in the - \uicontrol Help mode, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Help. + \uicontrol Help mode, select \preferences > \uicontrol Help. \endlist The following image displays the context sensitive help in the \uicontrol Edit @@ -47,8 +47,8 @@ \section1 Change the font If the help HTML file does not use a style sheet, you can change the font - family, style, and size in \uicontrol Edit > \uicontrol Preferences > - \uicontrol Help > \uicontrol General. + family, style, and size in \preferences > \uicontrol Help > + \uicontrol General. \image qtcreator-preferences-help-general.webp {General tab in Help preferences} @@ -74,8 +74,8 @@ \section1 View function tooltips - To hide function tooltips by default, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Behavior > + To hide function tooltips by default, select \preferences > + \uicontrol {Text Editor} > \uicontrol Behavior > \uicontrol {Show help tooltips using the mouse} > \uicontrol {On Shift+Mouseover}. You can still view the tooltips by pressing and holding down the \key Shift key. @@ -108,9 +108,8 @@ By default, \QC registers only the latest available version of the documentation for each installed Qt module. To register all installed - documentation, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Kits > \uicontrol {Qt Versions} > - \uicontrol {Register documentation}. + documentation, select \preferences > \uicontrol Kits > + \uicontrol {Qt Versions} > \uicontrol {Register documentation}. \image qtcreator-qt-versions.png {Register documentation field in Qt Versions tab in Kit Preferences} @@ -174,9 +173,9 @@ \section1 Import and export bookmarks - To import and export bookmarks, select \uicontrol Edit > \uicontrol Preferences - > \uicontrol Help > \uicontrol General > \uicontrol {Import Bookmarks} or - \uicontrol {Export Bookmarks}. + To import and export bookmarks, select \preferences > + \uicontrol Help > \uicontrol General > \uicontrol {Import Bookmarks} or + \uicontrol {Export Bookmarks}. \sa {Find information in Qt documentation} */ @@ -260,7 +259,7 @@ For information on how to prepare your documentation and create a .qch file, see \l{The Qt Help Framework}. - \li To add the .qch file to \QC, select \uicontrol Edit > \uicontrol Preferences > + \li To add the .qch file to \QC, select \preferences > \uicontrol Help > \uicontrol Documentation > \uicontrol Add. \image qtcreator-preferences-help-documentation.webp {Documentation tab in Help Preferences} @@ -289,8 +288,8 @@ \image qtcreator-context-sensitive-help.png {Context-sensitive help in Edit mode} To specify that the help always opens in full-screen mode or - is detached to an external window, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Help > \uicontrol General. + is detached to an external window, select \preferences > \uicontrol Help > + \uicontrol General. \image qtcreator-preferences-help-general.webp {General tab in Help preferences} @@ -317,8 +316,8 @@ \title Select the help start page You can select the page to display when you open the \uicontrol Help mode in the - \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > \uicontrol General - > \uicontrol {On help start} field. + \preferences > \uicontrol Help > \uicontrol General > + \uicontrol {On help start} field. \image qtcreator-preferences-help-general.webp {General tab in Help preferences} @@ -367,8 +366,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > - \uicontrol Filters. + \li Select \preferences > \uicontrol Help > \uicontrol Filters. \image qtcreator-help-filter-attributes.png {Filters tab in Help preferences} diff --git a/doc/qtcreator/src/howto/creator-how-to-set-high-dpi-scaling.qdoc b/doc/qtcreator/src/howto/creator-how-to-set-high-dpi-scaling.qdoc index 2beda1e8f5d..c0b2d4d6bea 100644 --- a/doc/qtcreator/src/howto/creator-how-to-set-high-dpi-scaling.qdoc +++ b/doc/qtcreator/src/howto/creator-how-to-set-high-dpi-scaling.qdoc @@ -32,7 +32,7 @@ To override the default approach and always enable high DPI scaling: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > + \li Select \preferences > \uicontrol Environment > \uicontrol Interface. \image qtcreator-preferences-environment-interface.webp {Interface tab in Environment preferences} \li Select \uicontrol {Enable high DPI scaling}. diff --git a/doc/qtcreator/src/howto/creator-how-to-switch-ui-themes.qdoc b/doc/qtcreator/src/howto/creator-how-to-switch-ui-themes.qdoc index 69272441a38..41146ea2c62 100644 --- a/doc/qtcreator/src/howto/creator-how-to-switch-ui-themes.qdoc +++ b/doc/qtcreator/src/howto/creator-how-to-switch-ui-themes.qdoc @@ -20,7 +20,7 @@ To switch themes: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > + \li Select \preferences > \uicontrol Environment > \uicontrol Interface. \image qtcreator-preferences-environment-interface.webp {Interface preferences} \li In \uicontrol Theme, select a theme. diff --git a/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc b/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc index 910e89dd97a..7dd3457be45 100644 --- a/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc +++ b/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc @@ -24,8 +24,7 @@ \QC has various keyboard shortcuts that speed up your development process. To view all \QC functions in and their keyboard shortcuts, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Environment > - \uicontrol Keyboard. + \preferences > \uicontrol Environment > \uicontrol Keyboard. \image qtcreator-keyboard-shortcuts.png @@ -47,7 +46,7 @@ To override the platform default value that determines whether keyboard shortcuts are shown in the labels of context menu items, - select \uicontrol Edit > \uicontrol Preferences > \uicontrol Environment > + select \preferences > \uicontrol Environment > \uicontrol Interface. The label of the \uicontrol {Show keyboard shortcuts in context menus} check box indicates whether the platform default value is \c on or \c off. @@ -218,8 +217,8 @@ By default, \QC exits without asking for confirmation, unless there are unsaved changes in open files. To always be asked, select the \uicontrol {Ask for confirmation before exiting} - check box in \uicontrol Edit > \uicontrol Preferences > - \uicontrol Environment > \uicontrol System. + check box in \preferences > \uicontrol Environment > + \uicontrol System. \li Ctrl+Q \endtable @@ -316,9 +315,8 @@ \li Select the current block The second press extends the selection to the parent block. To - enable this behavior, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > - \uicontrol Behavior > + enable this behavior, select \preferences > + \uicontrol {Text Editor} > \uicontrol Behavior > \uicontrol {Enable smart selection changing}. \li Ctrl+U \row @@ -819,8 +817,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Environment - > \uicontrol Keyboard. + \li Select \preferences > \uicontrol Environment > \uicontrol Keyboard. \image qtcreator-keyboard-shortcuts.png {Keyboard preferences} \li Select a command from the list. @@ -877,8 +874,7 @@ To look up keyboard shortcuts: \list 1 - \li Select uicontrol Edit > \uicontrol Preferences > - \uicontrol Environment > \uicontrol Keyboard. + \li Select \preferences > \uicontrol Environment > \uicontrol Keyboard. \image qtcreator-keyboard-shortcuts.png {Keyboard preferences} \li Start typing the name of a function or shortcut in the \uicontrol Filter field. @@ -909,8 +905,7 @@ \list 1 - \li Select uicontrol Edit > \uicontrol Preferences > - \uicontrol Environment > \uicontrol Keyboard. + \li Select \preferences > \uicontrol Environment > \uicontrol Keyboard. \image qtcreator-keyboard-shortcuts.png {Keyboard preferences} \li To import a keyboard shortcut mapping scheme, click \uicontrol Import diff --git a/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc b/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc index dab584171bc..47611d26c3f 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc @@ -39,7 +39,7 @@ By default, \QC does not handle build system based tests to avoid interference with code based parsers. To enable build system based tests, - select the respective test tool in \uicontrol Preferences > \uicontrol Testing + select the respective test tool in \preferences > \uicontrol Testing > \uicontrol General. The detection of tests is usually much faster for build system based @@ -341,8 +341,8 @@ with the build system. If a test takes more than a minute to execute, the default timeout might - stop the test execution. To increase the timeout, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Testing} > \uicontrol General. + stop the test execution. To increase the timeout, select \preferences > + \uicontrol {Testing} > \uicontrol General. \section2 Selecting Tests to Run @@ -389,8 +389,7 @@ \section1 Specifying Test Settings To customize the handling of tests, test frameworks, and test tools, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Testing} > - \uicontrol General. + \preferences > \uicontrol {Testing} > \uicontrol General. \image qtcreator-preferences-testing-general.webp {General tab in Testing preferences} @@ -444,8 +443,8 @@ The code inside a benchmark test is measured, and possibly also repeated several times in order to get an accurate measurement. This depends on the measurement back-end that you can select in the - \uicontrol {Benchmark Metrics} group in \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Testing} > \uicontrol {Qt Test}: + \uicontrol {Benchmark Metrics} group in \preferences > \uicontrol {Testing} > + \uicontrol {Qt Test}: walltime, CPU tick counter, event counter, Valgrind Callgrind, and Linux Perf. For more information, see \l{Creating a Benchmark}. @@ -472,8 +471,8 @@ \section2 Specifying Settings for Running Google Tests - To specify settings for running Google tests, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Testing} > \uicontrol {Google Test}. + To specify settings for running Google tests, select \preferences > + \uicontrol {Testing} > \uicontrol {Google Test}. \image qtcreator-preferences-testing-googletest.webp {Gooble Test tab in Testing preferences} @@ -500,9 +499,8 @@ \section2 Specifying Settings for Running Boost Tests \list 1 - \li To specify settings for running Boost tests, select \uicontrol Edit - > \uicontrol Preferences > \uicontrol {Testing} > - \uicontrol {Boost Test}. + \li To specify settings for running Boost tests, select \preferences > + \uicontrol {Testing} > \uicontrol {Boost Test}. \image qtcreator-preferences-testing-boosttest.webp {Boost Test tab in Testing preferences} \li In the \uicontrol {Log format} field, select the error report format to specify the type of events to record in the @@ -526,8 +524,7 @@ \section2 Specifying Settings for Running Catch2 Tests \list 1 \li To specify settings for running Catch2 tests, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Testing} > - \uicontrol {Catch Test}. + \preferences > \uicontrol {Testing} > \uicontrol {Catch Test}. \image qtcreator-preferences-testing-catchtest.webp {Catch Test tab in Testing preferences} \li Select the \uicontrol {Show success} check box to show succeeding expressions as well. By default Catch2 will print only fails. @@ -557,8 +554,7 @@ \section2 Specifying Settings for Running CTest-Based Tests \list 1 \li To specify settings for running CTest-based tests, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Testing} > - \uicontrol {CTest}. + \preferences > \uicontrol {Testing} > \uicontrol {CTest}. \image qtcreator-preferences-testing-ctest.webp {CTest tab in Testing preferences} \li Select the \uicontrol {Output on failure} check box to show test specific output if a test fails. Contrary to the CTest default @@ -595,8 +591,8 @@ the lost information when viewing the results as plain text. To view the - results of Qt and Qt Quick tests as plain text, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Testing} > \uicontrol {Qt Test}, and + results of Qt and Qt Quick tests as plain text, select \preferences > + \uicontrol {Testing} > \uicontrol {Qt Test}, and then deselect the \uicontrol {Use XML output} check box. Then select the \inlineimage icons/text.png (\uicontrol {Switch Between Visual and Text Display}) button in diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-to-document-code.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-to-document-code.qdoc index 3050f4a9a4e..d56a1f288cb 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-to-document-code.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-to-document-code.qdoc @@ -20,7 +20,7 @@ \image qtcreator-preferences-documentation-comments.webp {Documentation Comments settings} - To set global preferences, select \uicontrol Edit > \uicontrol Preferences > + To set global preferences, select \preferences > \uicontrol {Text Editor} > \uicontrol {Documentation Comments}. \sa {Configuring Projects} diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-to-record-screens.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-to-record-screens.qdoc index e12aebd6188..c8a624622d3 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-to-record-screens.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-to-record-screens.qdoc @@ -106,8 +106,7 @@ To set up screen recording: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > - \uicontrol {Screen Recording}. + \li Select \preferences > \uicontrol Help > \uicontrol {Screen Recording}. \image qtcreator-preferences-screen-recording.webp {Screen Recording preferences} \li In \uicontrol {ffmpeg tool}, set the path to the FFmpeg executable. \li In \uicontrol {ffprobe tool}, set the path to the FFprobe executable. diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 025c2bd2ef1..99206c237a8 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -103,7 +103,7 @@ \title Find a particular preference - To find a particular preference in \uicontrol Edit > \uicontrol Preferences, + To find a particular preference in \preferences, use the filter located at the top left of the \uicontrol Preferences dialog. \image qtcreator-preferences.webp {Filtering preferences} @@ -208,7 +208,7 @@ create your own locator filters. That way you can locate files in a directory structure you have defined. - To create locator filters, select \uicontrol Edit > \uicontrol Preferences > + To create locator filters, select \preferences > \uicontrol Environment > \uicontrol Locator > \uicontrol Add. \image qtcreator-locator-customize.webp "Locator preferences" @@ -253,9 +253,8 @@ \title Add a license header template for C++ code - Specify a file that has a license header for C++ in \uicontrol Edit > - \uicontrol Preferences > \uicontrol C++ > \uicontrol {File Naming} > - \uicontrol {License template}. + Specify a file that has a license header for C++ in \preferences > + \uicontrol C++ > \uicontrol {File Naming} > \uicontrol {License template}. \image qtcreator-options-cpp-files.png "File Naming preferences" @@ -321,8 +320,7 @@ \endlist To specify whether to automatically insert matching characters, - select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Text Editor} > \uicontrol Completion. + select \preferences > \uicontrol {Text Editor} > \uicontrol Completion. \image qtcreator-preferences-texteditor-completion.webp "Completion preferences" @@ -349,8 +347,8 @@ \title Add code snippets to the auto-complete menu Add, modify, and remove snippets in the snippet editor. - To open the editor, select \uicontrol Edit > \uicontrol Preferences - > \uicontrol {Text Editor} > \uicontrol Snippets. + To open the editor, select \preferences > \uicontrol {Text Editor} > + \uicontrol Snippets. \image qtcreator-snippet-modifiers.png "Snippets preferences" @@ -398,8 +396,7 @@ \uicontrol {Recent Files}: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Environment > \uicontrol System. + \li Select \preferences > \uicontrol Environment > \uicontrol System. \image qtcreator-options-environment-system.png {System preferences} \li In \uicontrol {Maximum number of entries in "Recent Files"}, set the number of files to show. diff --git a/doc/qtcreator/src/howto/creator-only/creator-squish.qdoc b/doc/qtcreator/src/howto/creator-only/creator-squish.qdoc index 25b2d54dad5..c931fd98ed4 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-squish.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-squish.qdoc @@ -57,7 +57,7 @@ To specify a Squish Server to run: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Squish. + \li Select \preferences > \uicontrol Squish. \image qtcreator-squish-preferences.png "Squish general preferences" \li In the \uicontrol {Squish path} field, specify the path to the Squish installation directory. diff --git a/doc/qtcreator/src/howto/creator-only/creator-vcpkg.qdoc b/doc/qtcreator/src/howto/creator-only/creator-vcpkg.qdoc index 456e793aa01..fb013f4fd36 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-vcpkg.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-vcpkg.qdoc @@ -31,15 +31,13 @@ \section1 Setting vcpkg Preferences By default, vcpkg is automatically set up for use with CMake. To disable - automatic setup, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol CMake > \uicontrol General > - \uicontrol {Package manager auto setup}. + automatic setup, select \preferences > \uicontrol CMake > \uicontrol General + > \uicontrol {Package manager auto setup}. \image qtcreator-preferences-cmake-general.webp {General tab in CMake Preferences} To set the \uicontrol Path to the directory where you installed vcpkg, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol CMake > - \uicontrol Vcpkg. + \preferences > \uicontrol CMake > \uicontrol Vcpkg. \image qtcreator-preferences-cmake-vcpkg.webp {Vcpkg tab in CMake Preferences} diff --git a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc index 25172cf94d3..beadc0eb86a 100644 --- a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc +++ b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc @@ -34,7 +34,7 @@ compiler. What should I do?} Make sure that the application is in your system PATH when starting \QC. - Also select \uicontrol Edit > \uicontrol Preferences to check the settings + Also select \preferences to check the settings specified for the application. Many plugins specify either the path to the tool they need or the environment they run in. @@ -45,7 +45,7 @@ \QC has been localized into several languages. If the system language is one of the supported languages, it is automatically selected. - To change the language, select \uicontrol Edit > \uicontrol Preferences > + To change the language, select \preferences > \uicontrol Environment and select a language in the \uicontrol Language field. Select \uicontrol {Restart Now} to restart \QC and have the change take effect. @@ -145,7 +145,7 @@ \uicontrol Help mode. To view the documentation that is available and to add documentation, - select \uicontrol Edit > \uicontrol Preferences > \uicontrol Help > + select \preferences > \uicontrol Help > \uicontrol Documentation. For more information, see \l{Add external documentation}. @@ -232,9 +232,9 @@ For console applications that require input, select \uicontrol Projects > \uicontrol {Run Settings} > \uicontrol {Run in terminal}. To specify the - terminal to use, select \uicontrol Edit > \uicontrol Preferences > + terminal to use, select \preferences > \uicontrol Environment > \uicontrol System. To use an \l{Terminal} - {internal terminal}, select \uicontrol Edit > \uicontrol Preferences + {internal terminal}, select \preferences > \uicontrol Terminal > \uicontrol {Use internal terminal}. \b {On Windows:} Output is displayed differently for \e{console diff --git a/doc/qtcreator/src/howto/creator-telemetry.qdoc b/doc/qtcreator/src/howto/creator-telemetry.qdoc index 128d358910b..058e6cfbebe 100644 --- a/doc/qtcreator/src/howto/creator-telemetry.qdoc +++ b/doc/qtcreator/src/howto/creator-telemetry.qdoc @@ -90,7 +90,7 @@ To determine what data is transmitted to the backend storage: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Telemetry + \li Select \preferences > \uicontrol Telemetry > \uicontrol {Usage Statistics}. \image qtcreator-telemetry-settings.png "Telemetry settings" \li In the \uicontrol {Telemetry mode} list, select the mode that diff --git a/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc b/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc index 00bc24e1224..def1727a1fc 100644 --- a/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc +++ b/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc @@ -34,7 +34,7 @@ \section1 Adding Boot2Qt Devices If \QC does not automatically detect a device you connected with USB, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices > + \preferences > \uicontrol Devices > \uicontrol Devices > \uicontrol Add > \uicontrol {Boot2Qt Device} to create either a network connection or a USB connection to it. @@ -49,7 +49,7 @@ \l{https://doc.qt.io/Boot2Qt/b2qt-requirements-x11.html#setting-up-usb-access-to-embedded-devices} {Boot2Qt: Setting Up USB Access to Embedded Devices}. - You can edit the settings later in \uicontrol Edit > \uicontrol Preferences > + You can edit the settings later in \preferences > \uicontrol Devices > \uicontrol Devices. To reboot the selected device, select \uicontrol {Reboot Device}. @@ -74,7 +74,7 @@ need to enter the password upon every connection to the device, or if caching is enabled, at every \QC restart. If you frequently run into the timeout, consider using key-based authentication. On \macos and Linux, you - can also select \uicontrol Preferences > \uicontrol Devices > \uicontrol SSH + can also select \preferences > \uicontrol Devices > \uicontrol SSH and increase the time (in minutes) to use the same SSH connection in the \uicontrol {Connection sharing timeout} field. Windows does not support shared connections. @@ -97,10 +97,9 @@ \list 1 \li Check that you can reach the IP address of the device, or use USB to connect it. - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > - \uicontrol {Qt Versions} > \uicontrol Add to add the Qt version - for Boot2Qt. - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > + \li Select \preferences > \uicontrol Kits > \uicontrol {Qt Versions} > + \uicontrol Add to add the Qt version for Boot2Qt. + \li Select \preferences > \uicontrol Kits > \uicontrol Compilers > \uicontrol Add to add the compiler for building the applications. \li Select \uicontrol Tools > \uicontrol {Flash Boot to Qt Device} @@ -109,16 +108,15 @@ parameters for connecting to the devices over the network (\QC automatically detects devices connected with USB): \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Devices > \uicontrol Devices > \uicontrol Add > - \uicontrol Boot2Qt. + \li Select \preferences > \uicontrol Devices > + \uicontrol Devices > \uicontrol Add > \uicontrol Boot2Qt. \image qtcreator-devices-boot2qt.png {Boot2Qt Network Device Setup wizard} \li In the \uicontrol {Device name} field, enter a name for the connection. \li In the \uicontrol {Device address} field, enter the host name or IP address of the device. This value will be available in the \c %{Device:HostAddress} variable. - \li Click > \uicontrol {Finish} to test the connection and + \li Click \uicontrol {Finish} to test the connection and add the device. You can edit the connection parameters in the @@ -131,7 +129,7 @@ \uicontrol {Boot2Qt Device} in the pull-down menu of the \uicontrol Add button. \endlist - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > + \li Select \preferences > \uicontrol Kits > \uicontrol Add to add a kit for building applications for the device. Select the Qt version, compiler, and device that you added above, and choose \uicontrol Boot2Qt as the device type. diff --git a/doc/qtcreator/src/linux-mobile/linuxdev-keys.qdocinc b/doc/qtcreator/src/linux-mobile/linuxdev-keys.qdocinc index 172c4a74feb..f3582f23736 100644 --- a/doc/qtcreator/src/linux-mobile/linuxdev-keys.qdocinc +++ b/doc/qtcreator/src/linux-mobile/linuxdev-keys.qdocinc @@ -19,8 +19,8 @@ development PC. To tell \QC where it can find the tools, specify the paths to the - directories where the tools are installed in \uicontrol Edit > - \uicontrol Preferences > \uicontrol Devices > \uicontrol SSH: + directories where the tools are installed in \preferences > + \uicontrol Devices > \uicontrol SSH: \image qtcreator-ssh-options.png "SSH preferences" @@ -60,7 +60,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices + \li Select \preferences > \uicontrol Devices > \uicontrol Devices > \uicontrol {Create New}. \image qtcreator-ssh-key-configuration.png "SSH Key Configuration dialog" diff --git a/doc/qtcreator/src/linux-mobile/linuxdev-processes.qdocinc b/doc/qtcreator/src/linux-mobile/linuxdev-processes.qdocinc index 2992d6b2ecc..1c9c2d0a4ab 100644 --- a/doc/qtcreator/src/linux-mobile/linuxdev-processes.qdocinc +++ b/doc/qtcreator/src/linux-mobile/linuxdev-processes.qdocinc @@ -7,7 +7,7 @@ \section2 Managing Device Processes You can view processes running on devices and kill them. Select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices > + \preferences > \uicontrol Devices > \uicontrol Devices > \uicontrol {Show Running Processes}. You can filter the processes by name or ID in the diff --git a/doc/qtcreator/src/linux-mobile/linuxdev.qdoc b/doc/qtcreator/src/linux-mobile/linuxdev.qdoc index 41820632d36..401fdbd8c1e 100644 --- a/doc/qtcreator/src/linux-mobile/linuxdev.qdoc +++ b/doc/qtcreator/src/linux-mobile/linuxdev.qdoc @@ -22,7 +22,7 @@ {kit}. You use a wizard to create the connections. You can edit the settings later - in \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices > + in \preferences > \uicontrol Devices > \uicontrol Devices. \image qtcreator-preferences-devices-remote-linux.webp "Remote Linux Device in the Devices tab" @@ -49,11 +49,11 @@ \li Make sure that your device can be reached via an IP address. - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > + \li Select \preferences > \uicontrol Kits > \uicontrol {Qt Versions} > \uicontrol Add to add the Qt version for embedded Linux. - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > + \li Select \preferences > \uicontrol Kits > \uicontrol Compilers > \uicontrol Add to add the compiler for building the applications. @@ -62,7 +62,7 @@ \list a - \li Select \uicontrol Edit > \uicontrol Preferences > + \li Select \preferences > \uicontrol Devices > \uicontrol Devices > \uicontrol Add > \uicontrol {Remote Linux Device} > \uicontrol {Start Wizard}. @@ -111,7 +111,7 @@ \uicontrol {Add Remote Linux Device} in the pull-down menu of the \uicontrol Add button. - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > + \li Select \preferences > \uicontrol Kits > \uicontrol Add to add a kit for building for the device. Select the Qt version, compiler, and device that you added above, and select \uicontrol {Remote Linux Device} in \uicontrol {Run device type}. diff --git a/doc/qtcreator/src/mcu/creator-mcu-dev.qdoc b/doc/qtcreator/src/mcu/creator-mcu-dev.qdoc index f2ad72b6402..65fba314e28 100644 --- a/doc/qtcreator/src/mcu/creator-mcu-dev.qdoc +++ b/doc/qtcreator/src/mcu/creator-mcu-dev.qdoc @@ -60,8 +60,7 @@ \section2 Specifying MCU Settings To configure a connection between \QC and your MCU board, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices > - \uicontrol MCU: + \preferences > \uicontrol Devices > \uicontrol MCU: \image qtcreator-mcu-options.png "MCU preferences" @@ -121,9 +120,8 @@ \image qtcreator-mcu-device.png "MCU devices" - To add MCU devices, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Devices > \uicontrol Add > \uicontrol {MCU Device} > - \uicontrol {Start Wizard}: + To add MCU devices, select \preferences > \uicontrol Devices > \uicontrol Add + > \uicontrol {MCU Device} > \uicontrol {Start Wizard}: \list 1 \li In the \uicontrol Name field, give the device a name. @@ -141,8 +139,7 @@ \image qtcreator-mcu-kit.png "MCU kits" - You can edit and/or remove individual kits in \uicontrol Edit > - \uicontrol Preferences > \uicontrol Kits. + You can edit and/or remove individual kits in \preferences > \uicontrol Kits. However, for adding new kits you should use the \uicontrol {Create Kit} button in the {\QMCU} settings tab. This method adds the paths to diff --git a/doc/qtcreator/src/meson/creator-projects-meson.qdoc b/doc/qtcreator/src/meson/creator-projects-meson.qdoc index e38e820bef6..43a15c65782 100644 --- a/doc/qtcreator/src/meson/creator-projects-meson.qdoc +++ b/doc/qtcreator/src/meson/creator-projects-meson.qdoc @@ -35,7 +35,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Meson > + \li Select \preferences > \uicontrol Meson > \uicontrol Tools > \uicontrol Add. \image qtcreator-mesonexecutable.png @@ -50,7 +50,7 @@ \endlist Select the - \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > \uicontrol Kits + \preferences > \uicontrol Kits > \uicontrol Kits tab to add the Meson and Ninja tools to a build and run kit: \image qtcreator-kits-meson.png "Setting Meson executable in Kit preferences" diff --git a/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc b/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc index 41991eebbde..e891bd8ce89 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-configuring.qdoc @@ -45,22 +45,21 @@ available in \QC. If it does not, you must add the kits yourself to tell \QC where everything is. - To add kits, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Kits > \uicontrol Add. + To add kits, select \preferences > \uicontrol Kits > \uicontrol Add. For more information, see \l{Add kits}. Each kit consists of a set of values that define one environment, such as a - \l{glossary-device}{device}, compiler, and Qt version. If \uicontrol Edit > - \uicontrol Preferences > \uicontrol Kits > \uicontrol {Qt Versions} does not - show all the installed Qt versions, select \uicontrol {Link with Qt}. + \l{glossary-device}{device}, compiler, and Qt version. If \preferences > + \uicontrol Kits > \uicontrol {Qt Versions} does not show all the installed + Qt versions, select \uicontrol {Link with Qt}. If \uicontrol Auto-detected still does not show the Qt version, select \uicontrol {Add} to add it manually. For more information, see \l{Add Qt versions}. - Also check that \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > + Also check that \preferences > \uicontrol Kits > \uicontrol {Compilers} shows your compiler. For more information, see \l{Add compilers}. @@ -71,8 +70,8 @@ over a WLAN. You must also configure a connection between \QC and the development PC and specify the device in a kit. - To add devices, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Devices > \uicontrol Devices > \uicontrol Add. + To add devices, select \preferences > \uicontrol Devices > + \uicontrol Devices > \uicontrol Add. For more information, see \l{Connecting Devices}. @@ -81,7 +80,8 @@ You can use \QC with your favorite keyboard shortcuts. To view and edit all keyboard shortcuts defined in \QC, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Environment > + \preferences > + \uicontrol Environment > \uicontrol Keyboard. For more information, see \l{Keyboard Shortcuts}. \section1 Changing Color Schemes @@ -89,9 +89,8 @@ Themes enable you to customize the appearance of the \QC UI: widgets, colors, and icons. - To switch themes, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Environment, and then select a theme - in the \uicontrol Theme field. + To switch themes, select \preferences > \uicontrol Environment, and then + select a theme in the \uicontrol Theme field. You can use the \QC text and code editors with your favorite color scheme that defines how to highlight code elements and which background color to @@ -99,7 +98,7 @@ ones. The color schemes apply to highlighting C++ files, QML files, and generic files. - To change the color scheme, select \uicontrol Edit > \uicontrol Preferences > + To change the color scheme, select \preferences > \uicontrol {Text Editor} > \uicontrol {Fonts & Color}. For more information, see \l{Defining Color Schemes}. @@ -109,8 +108,8 @@ highlighting engine for Kate syntax definitions. \QC comes with most of the commonly used syntax files, and you can download additional files. - To download and use highlight definition files, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol {Generic Highlighter}. + To download and use highlight definition files, select \preferences > + \uicontrol {Text Editor} > \uicontrol {Generic Highlighter}. For more information, see \l{Generic Highlighting}. @@ -121,7 +120,7 @@ the statement currently under your cursor. You can add, modify, and remove snippets in the snippet editor. - To open the snippet editor, select \uicontrol Edit > \uicontrol Preferences > + To open the snippet editor, select \preferences > \uicontrol {Text Editor} > \uicontrol Snippets. For more information, see \l{Editing Code Snippets}. @@ -133,8 +132,8 @@ \QC. However, some configuration options are available and you can set them in - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Version Control} > - \uicontrol General. + \preferences > + \uicontrol {Version Control} > \uicontrol General. For more information about the supported functions, see \l{Version Control Systems}. diff --git a/doc/qtcreator/src/overview/creator-only/creator-glossary.qdoc b/doc/qtcreator/src/overview/creator-only/creator-glossary.qdoc index ebc66b84236..ac5e1cae6b4 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-glossary.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-glossary.qdoc @@ -78,7 +78,7 @@ cross-platform development easier. Each kit consists of a set of values that define one environment, such as a \e {device}, tool chain, Qt version, and debugger command to use. Configure kits at - \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. + \preferences > \uicontrol Kits. \row \li Mode diff --git a/doc/qtcreator/src/overview/creator-only/creator-issues.qdoc b/doc/qtcreator/src/overview/creator-only/creator-issues.qdoc index 593184d22b9..db2af2c5ebf 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-issues.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-issues.qdoc @@ -74,7 +74,7 @@ \QC or the conflicting shortcut in ibus. To set another \l {Keyboard Shortcuts}{keyboard shortcut} - in \QC, select \uicontrol Edit > \uicontrol Preferences > + in \QC, select \preferences > \uicontrol Environment > \uicontrol Keyboard. To change the ibus shortcut, enter the following command on the diff --git a/doc/qtcreator/src/overview/creator-only/creator-supported-platforms.qdoc b/doc/qtcreator/src/overview/creator-only/creator-supported-platforms.qdoc index 7dc67a57bbf..5ea6d94a0cf 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-supported-platforms.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-supported-platforms.qdoc @@ -73,8 +73,7 @@ To develop for UWP using Qt 5, use \QC 7.0, or earlier. \QC automatically runs scheduled checks for updates based on the settings - specified in \uicontrol Edit > \uicontrol Preferences \uicontrol Environment > - \uicontrol Update. + specified in \preferences > \uicontrol Environment > \uicontrol Update. \sa {Desktop Platforms}, {Embedded Platforms}, {Mobile Platforms} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-build-settings-qmake.qdoc b/doc/qtcreator/src/projects/creator-only/creator-build-settings-qmake.qdoc index e0f2d11ac10..17a1b43c9c3 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-build-settings-qmake.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-build-settings-qmake.qdoc @@ -19,7 +19,7 @@ \uicontrol {Build Directory} field. To make in-source builds the default option for all projects, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Build & Run} > + \preferences > \uicontrol {Build & Run} > \uicontrol {Default Build Properties}, and enter a period (.) in the \uicontrol {Default build directory} field. @@ -46,15 +46,13 @@ \section1 Global qmake Settings - To specify settings for all qmake builds, select \uicontrol Edit - > \uicontrol Preferences > \uicontrol {Build & Run} > - \uicontrol Qmake. + To specify settings for all qmake builds, select \preferences > + \uicontrol {Build & Run} > \uicontrol Qmake. \image qtcreator-preferences-build-run-qmake.png "Qmake tab in Build & Run Preferences" - To set the default build properties, select \uicontrol Edit - > \uicontrol Preferences > \uicontrol {Build & Run} > - \uicontrol {Default Build Properties}. + To set the default build properties, select \preferences > + \uicontrol {Build & Run} > \uicontrol {Default Build Properties}. \image qtcreator-build-settings-default.png "Default Build Properties tab in Build & Run Preferences" @@ -70,9 +68,8 @@ select \uicontrol Enable in the \uicontrol {Qt Quick Compiler} field. To use default settings, select \uicontrol {Leave at Default}. - You can specify default behavior for compiling QML code in \uicontrol Edit - > \uicontrol Preferences > \uicontrol {Build & Run} > \uicontrol Qmake > - \uicontrol {Use qmlcachegen}. + You can specify default behavior for compiling QML code in \preferences > + \uicontrol {Build & Run} > \uicontrol Qmake > \uicontrol {Use qmlcachegen}. \section1 qmake Build Steps diff --git a/doc/qtcreator/src/projects/creator-only/creator-custom-output-parser.qdoc b/doc/qtcreator/src/projects/creator-only/creator-custom-output-parser.qdoc index 37fb44ee119..d07124bf309 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-custom-output-parser.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-custom-output-parser.qdoc @@ -12,8 +12,7 @@ and warning patterns that you specify and create entries for found patterns in \l Issues. - To view or add custom output parsers, select - \uicontrol Edit > \uicontrol Preferences > + To view or add custom output parsers, select \preferences > \uicontrol {Build & Run} > \uicontrol {Custom Output Parsers}. \image qtcreator-custom-parser-list.png @@ -40,9 +39,8 @@ To create a custom output parser: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Build & Run} > \uicontrol {Custom Output Parsers} - > \uicontrol Add. + \li Select \preferences > \uicontrol {Build & Run} > + \uicontrol {Custom Output Parsers} > \uicontrol Add. \li In the \uicontrol {Error message capture pattern} field, specify a regular expression to define what is an error. The custom parser matches the compile output line by line against the diff --git a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc index 6498f2c70dd..63d14734597 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc @@ -106,8 +106,8 @@ \section1 Set file naming preferences The names of the header and source file are based on the class name. To - change the default suffix of a file, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {C++} > \uicontrol {File Naming}. + change the default suffix of a file, select \preferences > \uicontrol {C++} > + \uicontrol {File Naming}. \image qtcreator-options-cpp-files.png "C++ File Naming preferences" diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-edit-qbs-profiles.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-edit-qbs-profiles.qdoc index bbe2c7ea594..a5037be5b91 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-how-to-edit-qbs-profiles.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-edit-qbs-profiles.qdoc @@ -9,8 +9,8 @@ \title Edit Qbs profiles - To view the Qbs profile associated with a kit, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Qbs > \uicontrol Profiles. + To view the Qbs profile associated with a kit, select \preferences > + \uicontrol Qbs > \uicontrol Profiles. \image creator-qbs-profiles.png "Qbs Profiles tab" @@ -22,7 +22,7 @@ To edit the Qbs profile associated with a kit: \list 1 - \li In \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits, select + \li In \preferences > \uicontrol Kits, select the kit, and then select \uicontrol Change next to the \uicontrol {Additional Qbs Profile Settings} field to open the \uicontrol {Custom Properties} dialog. diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc index 0dfe9178a86..b2732eae0a5 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc @@ -50,8 +50,8 @@ \section1 Set preferences for building and running To change the location of the project directory, and to specify settings - for building and running projects, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Build & Run} > \uicontrol General. + for building and running projects, select \preferences > + \uicontrol {Build & Run} > \uicontrol General. Specify build and run settings for different target platforms, in the \uicontrol Projects mode. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-building.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-building.qdoc index acf362877d0..b9c95f32239 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-building.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-building.qdoc @@ -98,10 +98,9 @@ \section1 Building with CMake \QC automatically runs CMake when you make changes to \c {CMakeLists.txt} - files. To disable this feature, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol CMake > \uicontrol General. Select the - CMake executable to edit, and then deselect the \uicontrol {Autorun CMake} - check box. + files. To disable this feature, select \preferences > \uicontrol CMake > + \uicontrol General. Select the CMake executable to edit, and then deselect + the \uicontrol {Autorun CMake} check box. \image qtcreator-preferences-cmake-tools.webp "Tools tab in CMake Preferences" @@ -111,8 +110,8 @@ To prevent failures on incremental builds, it might make sense to always run qmake before building, even though it means that - building will take more time. To enable this option, select \uicontrol Edit - > \uicontrol Preferences > \uicontrol {Build & Run} > \uicontrol Qmake > + building will take more time. To enable this option, select \preferences > + \uicontrol {Build & Run} > \uicontrol Qmake > \uicontrol {Run qmake on every build}. \image qtcreator-preferences-build-run-qmake.png "qmake tab in Build & Run Preferences" diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-builds-customizing.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-builds-customizing.qdoc index 0a7c1df2ac6..48f1bf87611 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-builds-customizing.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-builds-customizing.qdoc @@ -15,8 +15,7 @@ \title Customizing the Build Process To configure how projects are built, deployed, and run, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Build & Run} - > \uicontrol General. + \preferences > \uicontrol {Build & Run} > \uicontrol General. \image qtcreator-project-options-deploy.png "Project General preferences" diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-compilers.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-compilers.qdoc index 0499de45f7a..b95dfa284dd 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-compilers.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-compilers.qdoc @@ -23,8 +23,8 @@ particular platform. \QC automatically detects the compilers that your system or \QOI - registers and lists them in \uicontrol Edit > \uicontrol Preferences > - \uicontrol Kits > \uicontrol Compilers. + registers and lists them in \preferences > \uicontrol Kits > + \uicontrol Compilers. \image qtcreator-toolchains.png @@ -51,8 +51,7 @@ To add a C or C++ compiler: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Kits > \uicontrol Compilers. + \li Select \preferences > \uicontrol Kits > \uicontrol Compilers. \li Select \uicontrol Add to add a new compiler or \uicontrol Clone to add another version of the selected compiler. \li Select a compiler in the list. @@ -197,12 +196,11 @@ these compilers, you also specify the path to the script that sets up the command prompt in the \uicontrol Initialization field. - You specify the compiler to use for each kit in \uicontrol Edit > - \uicontrol Preferences > \uicontrol Kits. + You specify the compiler to use for each kit in \preferences > + \uicontrol Kits. To set compiler preferences according to the compiler type, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > - \uicontrol Compilers: + \preferences > \uicontrol Kits > \uicontrol Compilers: \list @@ -265,10 +263,9 @@ \title Add Nim compilers - To build an application using the Nim Compiler, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Kits > \uicontrol Compilers > - \uicontrol Add > \uicontrol Nim, and specify the path to the directory where - the compiler is located. + To build an application using the Nim Compiler, select \preferences > + \uicontrol Kits > \uicontrol Compilers > \uicontrol Add > \uicontrol Nim, + and specify the path to the directory where the compiler is located. \sa {Add compilers}, {Compilers} */ @@ -281,8 +278,8 @@ \title Add custom compilers - To add a compiler that is not listed \uicontrol Edit > \uicontrol Preferences - > \uicontrol Kits > \uicontrol Compilers or to add a remote compiler, use the + To add a compiler that is not listed \preferences > + \uicontrol Kits > \uicontrol Compilers or to add a remote compiler, use the \uicontrol Custom option. Specify the paths to the directories where the compiler and make tool are located and set preferences for the compiler. @@ -292,7 +289,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > + \li Select \preferences > \uicontrol Kits > \uicontrol Compilers > \uicontrol Add > \uicontrol Custom > \uicontrol C or \uicontrol C++. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index 291450cf57e..e1949ac815e 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -165,9 +165,9 @@ not need to navigate to \uicontrol File > \uicontrol {New File} or \uicontrol {New Project}. - Set keyboard shortcuts for wizards in \uicontrol Edit > - \uicontrol Preferences > \uicontrol Environment > \uicontrol Keyboard > - \uicontrol Wizard. All wizard actions start with \uicontrol Impl there. + Set keyboard shortcuts for wizards in \preferences > \uicontrol Environment > + \uicontrol Keyboard > \uicontrol Wizard. All wizard actions start with + \uicontrol Impl there. \sa {Assign keyboard shortcuts}, {Activate kits for a project}, {Create files}, {Creating Projects} diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc index 8f685b728dd..3abd3a1ab6a 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc @@ -85,9 +85,8 @@ \QC has some actions that can improve the wizard development process. They don't have keyboard shortcuts by default, so you cannot trigger them. To - enable them, assign keyboard shortcuts in \uicontrol Edit > - \uicontrol Preferences > \uicontrol Environment > \uicontrol Keyboard > - \uicontrol Wizard. + enable them, assign keyboard shortcuts in \preferences > + \uicontrol Environment > \uicontrol Keyboard > \uicontrol Wizard. The following actions can help with wizard development: diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-debuggers.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-debuggers.qdoc index 4594fa34251..8762a9e97b1 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-debuggers.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-debuggers.qdoc @@ -22,14 +22,13 @@ The debugger plugin automatically selects a suitable native debugger for each \l{glossary-buildandrun-kit}{kit} from the ones found on your system. - To override this choice, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Kits. + To override this choice, select \preferences > \uicontrol Kits. To add debuggers: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > + \li Select \preferences > \uicontrol Kits > \uicontrol Debuggers > \uicontrol Add. \image qtcreator-preferences-kits-debuggers.webp {Debuggers tab in Kits preferences} diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc index 16f14496f8d..b6967cfcc6b 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc @@ -43,7 +43,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. + \li Select \preferences > \uicontrol Kits. \li Select \uicontrol Add to start from an empty kit or \uicontrol Clone to clone the selected kit and edit its preferences. \image qtcreator-kits.png @@ -78,7 +78,7 @@ Typically, only a subset of the kit preferences is relevant for a particular setup. Therefore, \QC plugins register sets of relevant preferences that you - can view and modify in \uicontrol Edit > \uicontrol Preferences > + can view and modify in \preferences > \uicontrol Kits. For example, if you use CMake to build all your projects, you can hide Qbs and qmake preferences by default. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc index 1b89d7a3e22..d9e1f9bb8a9 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc @@ -32,7 +32,7 @@ To configure \QC to build Nim executables: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits + \li Select \preferences > \uicontrol Kits > \uicontrol Compilers > \uicontrol Add > \uicontrol Nim to specify the path to the Nim compiler. \li Select \uicontrol Apply to add the compiler. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc index 789dd63700c..a7290ca18cc 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc @@ -71,13 +71,12 @@ \endlist The \uicontrol {Configure Project} tab displays a list of kits that you - install on the development PC and configure in \uicontrol Edit > - \uicontrol Preferences > \uicontrol Kits. + install on the development PC and configure in \preferences > \uicontrol Kits. Even if you do not intend to build the project, the C++ and QML code models need a Qt version and compiler to offer code completion. To specify them, - select the \uicontrol Preferences link, or select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Kits. + select the \uicontrol Preferences link, or select \preferences > + \uicontrol Kits. Qt for Python projects rely on the \l{Using Language Servers} {language server client} for code completion, highlighting, and diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc index deb2041ad6a..bf88413305f 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-qbs.qdoc @@ -22,8 +22,8 @@ with the build and run kit. \QC automatically creates a Qbs profile for each kit. You can edit the build profiles by adding new keys and values. - To check which Qbs version is being used, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Qbs > \uicontrol General. + To check which Qbs version is being used, select \preferences > + \uicontrol Qbs > \uicontrol General. \section1 Building Qbs @@ -49,7 +49,7 @@ To specify settings for Qbs: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Qbs. + \li Select \preferences > \uicontrol Qbs. \image qtcreator-options-qbs.png "Qbs preferences" \li Deselect the \uicontrol {Use \QC settings directory for Qbs} check box to store Qbs profiles in the Qbs settings directory. @@ -64,7 +64,7 @@ \image creator-qbs-profiles.png "Qbs Profiles tab" \li In the \uicontrol Kit field, select a build and run kit to view the properties of the associated profile. To modify the properties, - select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. + select \preferences > \uicontrol Kits. For more information, see \l{Edit Qbs profiles}. \endlist diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-qt-versions.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-qt-versions.qdoc index 1e6f3abf67a..63090c65c87 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-qt-versions.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-qt-versions.qdoc @@ -19,8 +19,8 @@ build your projects. For example, \l{glossary-device}{device} manufacturers offer special Qt versions for developing applications for their devices. - To view the installed Qt versions, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Kits \uicontrol {Qt Versions}. + To view the installed Qt versions, select \preferences > \uicontrol Kits > + \uicontrol {Qt Versions}. \image qtcreator-qt-versions.png {Qt Versions tab in Kit preferences} @@ -42,9 +42,7 @@ To link to a Qt installation: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - (or \uicontrol {Qt Creator} > \uicontrol Preferences on - \macos) > \uicontrol Kits > \uicontrol {Qt Versions} > + \li Select \preferences > \uicontrol Kits > \uicontrol {Qt Versions} > \uicontrol {Link with Qt}. \image qtcreator-link-with-qt.png {Choose Qt Installation dialog} \li In the \uicontrol {Qt installation path} field, enter the path to @@ -61,8 +59,8 @@ under \uicontrol Auto-detected, set it up manually. You specify the Qt version to use for each \l{glossary-buildandrun-kit} - {kit} for building and running your projects - in \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. + {kit} for building and running your projects in \preferences > + \uicontrol Kits. \section1 Set up new Qt versions @@ -70,7 +68,7 @@ \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > + \li Select \preferences > \uicontrol Kits > \uicontrol {Qt Versions} > \uicontrol Add. \li Select the qmake executable for the Qt version to add. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-environment.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-environment.qdoc index 1d99a0bf650..dd3534bb904 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-environment.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-environment.qdoc @@ -19,7 +19,7 @@ based on your project requirements. To globally change the system environment from the one in which - \QC is started, select \uicontrol Edit > \uicontrol Preferences > + \QC is started, select \preferences > \uicontrol Environment > \uicontrol System, and then select \uicontrol Change in the \uicontrol Environment field. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc index 3276706a95e..e71e2d26844 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc @@ -70,7 +70,7 @@ \image qtcreator-project-kits.png - The list displays kits from \uicontrol Edit > \uicontrol Preferences > + The list displays kits from \preferences > \uicontrol Kits. Warning and error icons indicate that the kit configuration is not suitable for the project type. To view the warning and error messages, move the mouse pointer over the kit name. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run-analyze.qdocinc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run-analyze.qdocinc index f7adfa4cd2d..e54035966d5 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run-analyze.qdocinc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run-analyze.qdocinc @@ -47,8 +47,8 @@ Click \uicontrol {Restore Global} to revert to the global settings. - To specify global Valgrind settings, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Analyzer. + To specify global Valgrind settings, select \preferences > + \uicontrol Analyzer. //! [settings valgrind] */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run-desktop.qdocinc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run-desktop.qdocinc index 82217c4d7a1..caadbe3b463 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run-desktop.qdocinc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run-desktop.qdocinc @@ -20,10 +20,9 @@ \image qtcreator-settings-run-desktop.webp {Run Settings} For console applications, check the \uicontrol{Run in terminal} check box. - To specify the terminal to use on Linux and \macos, select \uicontrol Edit - > \uicontrol Preferences > \uicontrol Environment > \uicontrol System. To use - an \l{Terminal}{internal terminal}, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Terminal > + To specify the terminal to use on Linux and \macos, select \preferences > + \uicontrol Environment > \uicontrol System. To use an \l{Terminal} + {internal terminal}, select \preferences > \uicontrol Terminal > \uicontrol {Use internal terminal}. To run with special environment variables set up, select them in the @@ -40,8 +39,8 @@ To disable library linking for the current project, deselect the \uicontrol {Add build library search path to PATH} check box. To disable - library linking for all projects, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Build & Run}, and then deselect the + library linking for all projects, select \preferences > + \uicontrol {Build & Run}, and then deselect the \uicontrol {Add linker library search paths to run environment} check box. The \uicontrol {Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug)} option diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc index 2a157391d08..e574c00a4c3 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc @@ -24,7 +24,7 @@ \image qtcreator-settings-run.webp {Run Settings} To prevent \QC from automatically creating run configurations, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Build & Run}, + \preferences > \uicontrol {Build & Run}, and then deselect the \uicontrol {Create suitable run configurations automatically} check box. diff --git a/doc/qtcreator/src/projects/creator-projects-running.qdoc b/doc/qtcreator/src/projects/creator-projects-running.qdoc index a6311d58d0a..81756d4a408 100644 --- a/doc/qtcreator/src/projects/creator-projects-running.qdoc +++ b/doc/qtcreator/src/projects/creator-projects-running.qdoc @@ -25,7 +25,7 @@ To run executable files without deploying them first, select \uicontrol Build > \uicontrol {Run Without Deployment}. To make this the default option, deselect the - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Build & Run} > + \preferences > \uicontrol {Build & Run} > \uicontrol General > \uicontrol {Always deploy project before running it} check box. diff --git a/doc/qtcreator/src/python/creator-python-development.qdoc b/doc/qtcreator/src/python/creator-python-development.qdoc index a41cb1f777d..550172738ec 100644 --- a/doc/qtcreator/src/python/creator-python-development.qdoc +++ b/doc/qtcreator/src/python/creator-python-development.qdoc @@ -90,8 +90,7 @@ To see the available interpreters and choose another interpreter, select the current interpreter, and then select \uicontrol {Manage Python Interpreters}. - Or, select \uicontrol Edit > \uicontrol Preferences > \uicontrol Python > - \uicontrol Interpreters. + Or, select \preferences > \uicontrol Python > \uicontrol Interpreters. \image qtcreator-python-interpreters.webp {Python Interpreters in Preferences} diff --git a/doc/qtcreator/src/qnx/creator-developing-qnx.qdoc b/doc/qtcreator/src/qnx/creator-developing-qnx.qdoc index 8adb5ebe37e..d7ec1e64177 100644 --- a/doc/qtcreator/src/qnx/creator-developing-qnx.qdoc +++ b/doc/qtcreator/src/qnx/creator-developing-qnx.qdoc @@ -24,7 +24,7 @@ \section1 Add kits for QNX Devices - To view QNX device settings, select \uicontrol Edit > \uicontrol Preferences > + To view QNX device settings, select \preferences > \uicontrol Devices > \uicontrol QNX. Select the \uicontrol {Generate kits} check box to allow \QC to generate kits for QNX development. diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc b/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc index 93a0b3ee5ad..09efdaec1a2 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc @@ -92,10 +92,8 @@ \li Select \l{glossary-buildandrun-kit}{kits} for the platforms that you want to build the application for. - \note Kits are listed if they have been specified in \uicontrol Edit - > \uicontrol Preferences > \uicontrol Kits (on Windows and Linux) - or in \uicontrol {\QC} > \uicontrol Preferences > - \uicontrol Kits (on \macos). + \note Kits are listed if they have been specified in \preferences > + \uicontrol Kits. For more information, see \l {Add kits} and \l {Kits}. \li Select \uicontrol Next to open the \uicontrol {Project Management} @@ -170,10 +168,8 @@ \li Select \l{glossary-buildandrun-kit}{kits} for the platforms that you want to build the application for. - \note Kits are listed if they have been specified in \uicontrol Edit - > \uicontrol Preferences > \uicontrol Kits (on Windows and Linux) - or in \uicontrol {\QC} > \uicontrol Preferences > - \uicontrol Kits (on \macos). + \note Kits are listed if they have been specified in \preferences > + \uicontrol Kits. For more information, see \l {Add kits} and \l {Kits}. \li Select \uicontrol Next to open the \uicontrol {Project Management} diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc b/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc index c6c11ebb917..1abd280e56b 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc @@ -42,10 +42,8 @@ applications for mobile devices, select kits also for Android and iOS. - \note The list shows kits that you specify in \uicontrol Edit - > \uicontrol Preferences > \uicontrol Kits (on Windows and Linux) - or in \uicontrol {\QC} > \uicontrol Preferences > - \uicontrol Kits (on \macos). + \note The list shows kits that you specify in \preferences > + \uicontrol Kits. For more information, see \l {Add kits} and \l {Kits}. \li Select \uicontrol Next to open the \uicontrol {Project Management} diff --git a/doc/qtcreator/src/qtquick/creator-preferences-qtquick-code-style.qdoc b/doc/qtcreator/src/qtquick/creator-preferences-qtquick-code-style.qdoc index 6b179916457..333ff9694eb 100644 --- a/doc/qtcreator/src/qtquick/creator-preferences-qtquick-code-style.qdoc +++ b/doc/qtcreator/src/qtquick/creator-preferences-qtquick-code-style.qdoc @@ -19,8 +19,7 @@ To specify QML code style globally: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Qt Quick}. + \li Select \preferences > \uicontrol {Qt Quick}. \li In the \uicontrol {Current settings} field, select the settings to modify and click \uicontrol Copy. \image qtcreator-options-code-style-qml.png {QML Code Style preferences} diff --git a/doc/qtcreator/src/qtquick/qtquick-profiler.qdoc b/doc/qtcreator/src/qtquick/qtquick-profiler.qdoc index 61033ee685d..0fd232d8b9c 100644 --- a/doc/qtcreator/src/qtquick/qtquick-profiler.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-profiler.qdoc @@ -124,7 +124,7 @@ You can specify flushing settings for the QML Profiler either globally for all projects or separately for each project. To specify global settings, - select \uicontrol Edit > \uicontrol Preferences > \uicontrol Analyzer. + select \preferences > \uicontrol Analyzer. To specify custom QML Profiler settings for a particular project, select \uicontrol Projects > \uicontrol Run and then select \uicontrol Custom in diff --git a/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc b/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc index f5c3bafc894..2363e10a56b 100644 --- a/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc @@ -24,7 +24,7 @@ . Select the icon to open the toolbar. To open toolbars immediately when you select a QML type, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Qt Quick} > + \preferences > \uicontrol {Qt Quick} > \uicontrol {QML/JS Editing} > \uicontrol {Always show Qt Quick Toolbar}. \image qtcreator-qml-js-editing.webp {QML/JS Editing preferences} diff --git a/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc b/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc index e8d4eeb97e5..b76e90ec8ea 100644 --- a/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc @@ -32,8 +32,8 @@ in the menu (1). Select \uicontrol Home to move to the user's home directory. Further, you can select a project to move to an open project or \uicontrol Projects to move to the directory specified in the - \uicontrol {Projects directory} field in \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Build & Run} > \uicontrol General. + \uicontrol {Projects directory} field in \preferences > + \uicontrol {Build & Run} > \uicontrol General. The file that is currently active in the editor determines which folder to display in the \uicontrol {File System} view: @@ -62,12 +62,11 @@ \li Show the file or directory in the file explorer. \li Open a terminal window in the selected directory or in the directory that has the file. To specify the terminal to use on Linux and - \macos, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol Environment > \uicontrol System. + \macos, select \preferences > \uicontrol Environment > + \uicontrol System. \if defined(qtcreator) - To use an \l{Terminal} {internal terminal}, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Terminal > - \uicontrol {Use internal terminal}. + To use an \l{Terminal} {internal terminal}, select \preferences > + \uicontrol Terminal > \uicontrol {Use internal terminal}. \endif \li Search from the selected directory. \li View file properties, such as name, path, MIME type, default editor, diff --git a/doc/qtcreator/src/user-interface/creator-how-to-view-output.qdoc b/doc/qtcreator/src/user-interface/creator-how-to-view-output.qdoc index a6e4746e7c8..b83a54dbe39 100644 --- a/doc/qtcreator/src/user-interface/creator-how-to-view-output.qdoc +++ b/doc/qtcreator/src/user-interface/creator-how-to-view-output.qdoc @@ -52,8 +52,8 @@ If the text in the output is not displayed correctly, \QC might be using a different codec from the one used by the tools that generate - the output. To specify the codec to use, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Environment > \uicontrol Interface, and + the output. To specify the codec to use, select \preferences > + \uicontrol Environment > \uicontrol Interface, and then select the codec in the \uicontrol {Text codec for tools} field. \image qtcreator-preferences-environment-interface.webp {Interface tab in Environment preferences} diff --git a/doc/qtcreator/src/user-interface/creator-only/creator-reference-terminal-view.qdoc b/doc/qtcreator/src/user-interface/creator-only/creator-reference-terminal-view.qdoc index abfae8ba8b2..96cecd089dc 100644 --- a/doc/qtcreator/src/user-interface/creator-only/creator-reference-terminal-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-only/creator-reference-terminal-view.qdoc @@ -15,13 +15,12 @@ application or the \uicontrol {Open Terminal} button to open a terminal, it opens as an output view. - To open the terminal in a separate window, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Terminal, and deselet the - \uicontrol {Use internal terminal} check box. + To open the terminal in a separate window, select \preferences > + \uicontrol Terminal, and deselet the \uicontrol {Use internal terminal} + check box. On Linux and \macos, you can set the terminal to open by selecting - \uicontrol Edit > \uicontrol Preferences > - \uicontrol Environment > \uicontrol System. + \preferences > \uicontrol Environment > \uicontrol System. \image qtcreator-output-terminal.webp {Terminal pane} @@ -63,9 +62,9 @@ \section1 Terminal Preferences - To set preferences for the internal terminal, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Terminal, or select the - \uicontrol Configure button in the \uicontrol Terminal pane. + To set preferences for the internal terminal, select \preferences > + \uicontrol Terminal, or select the \uicontrol Configure button in + the \uicontrol Terminal pane. \image qtcreator-preferences-terminal.webp {Terminal tab in Preferences} diff --git a/doc/qtcreator/src/user-interface/creator-only/creator-reference-to-do-entries-view.qdoc b/doc/qtcreator/src/user-interface/creator-only/creator-reference-to-do-entries-view.qdoc index da32faf7bf0..f7d1b97a428 100644 --- a/doc/qtcreator/src/user-interface/creator-only/creator-reference-to-do-entries-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-only/creator-reference-to-do-entries-view.qdoc @@ -34,7 +34,7 @@ \section1 To-Do Preferences - To add keywords, select \uicontrol Edit > \uicontrol Preferences > + To add keywords, select \preferences > \uicontrol {To-Do} > \uicontrol Add. Set an icon and a line background color for the keyword. diff --git a/doc/qtcreator/src/user-interface/creator-open-documents-view.qdoc b/doc/qtcreator/src/user-interface/creator-open-documents-view.qdoc index 0ad0967dc0c..e758c6c2b27 100644 --- a/doc/qtcreator/src/user-interface/creator-open-documents-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-open-documents-view.qdoc @@ -36,8 +36,7 @@ \section1 Setting Preferences for Opening Files To set preferences for opening files and handling open files, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol Environment > - \uicontrol System: + \preferences > \uicontrol Environment > \uicontrol System: \image qtcreator-options-environment-system.png {System tab in Environment preferences} diff --git a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc index 9c811bd2799..27984807fd0 100644 --- a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc @@ -92,12 +92,11 @@ \li Search from the selected directory. \li Open a terminal window in the project directory. To specify the - terminal to use on Linux and \macos, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Environment > \uicontrol System. + terminal to use on Linux and \macos, select \preferences > + \uicontrol Environment > \uicontrol System. \if defined(qtcreator) - To use an \l{Terminal}{internal terminal}, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol Terminal > - \uicontrol {Use internal terminal}. + To use an \l{Terminal}{internal terminal}, select \preferences > + \uicontrol Terminal > \uicontrol {Use internal terminal}. \endif \li Open a terminal window in the project directory that you configured for building or running the project. @@ -106,9 +105,9 @@ \li Close all files in a project. \li Close the selected project or all projects except the selected one. By default, this closes all files in the projects. To keep - them open, deselect the \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Build & Run} > \uicontrol General - > \uicontrol {Close source files along with project} check box. + them open, deselect the \preferences > \uicontrol {Build & Run} > + \uicontrol General > \uicontrol {Close source files along with project} + check box. \endlist For managing files and directories, use the same functions as in diff --git a/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc b/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc index 7fdfc296f02..523906cbc75 100644 --- a/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc +++ b/doc/qtcreator/src/user-interface/creator-reference-output-views.qdoc @@ -57,8 +57,8 @@ or press \key F6 and \key Shift+F6. By default, a new build clears the \uicontrol Issues view. To keep - the issues from the previous build rounds, deselect \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Build & Run} > \uicontrol General > + the issues from the previous build rounds, deselect \preferences > + \uicontrol {Build & Run} > \uicontrol General > \uicontrol {Clear issues list on new build}. \sa {View output} @@ -133,8 +133,8 @@ To set preferences for displaying application output: \list - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Build & Run} > \uicontrol {Application Output}. + \li Select \preferences > \uicontrol {Build & Run} > + \uicontrol {Application Output}. \li Select the \inlineimage icons/settings.png (\uicontrol {Open Settings Page}) button. \endlist @@ -190,8 +190,8 @@ \li In the \uicontrol {Compile Output} view, select \inlineimage icons/settings.png (\uicontrol {Open Settings Page}). - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Build & Run} > \uicontrol {Compile Output}. + \li Select \preferences > \uicontrol {Build & Run} > + \uicontrol {Compile Output}. \endlist \image qtcreator-preferences-compile-output.webp {Compile Output tab in Preferences} \li Select the \uicontrol {Open Compile Output when building} check box. diff --git a/doc/qtcreator/src/user-interface/creator-ui.qdoc b/doc/qtcreator/src/user-interface/creator-ui.qdoc index d7cd495e515..9d0e642b325 100644 --- a/doc/qtcreator/src/user-interface/creator-ui.qdoc +++ b/doc/qtcreator/src/user-interface/creator-ui.qdoc @@ -103,7 +103,7 @@ To toggle the visibility of these menu items: \list 1 - \li Go to \uicontrol Edit > \uicontrol Preferences. + \li Go to \preferences. \li On the \uicontrol Environment tab, select \uicontrol{Qt Design Studio Configuration}. \li Clear the checkbox for the items that you want to be visible. diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-bazaar.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-bazaar.qdoc index de27eee29ff..d5d2b9a06a8 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-bazaar.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-bazaar.qdoc @@ -46,7 +46,7 @@ \section1 Bazaar Preferences - To set Bazaar preferences, select \uicontrol Edit > \uicontrol Preferences > + To set Bazaar preferences, select \preferences > \uicontrol {Version Control} > \uicontrol Bazaar: \image qtcreator-preferences-vcs-bazaar.webp {Bazaar preferences} diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-clearcase.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-clearcase.qdoc index 8ada90c1193..740eabe5a8b 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-clearcase.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-clearcase.qdoc @@ -31,8 +31,8 @@ \li Download \l{http://gnuwin32.sourceforge.net/packages/diffutils.htm} {Diffutils} and extract it to a directory in your PATH. - \li Select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Version Control} > \uicontrol ClearCase. + \li Select \preferences > \uicontrol {Version Control} > + \uicontrol ClearCase. \image qtcreator-preferences-vcs-clearcase.webp {ClearCase preferences} @@ -53,8 +53,8 @@ \uicontrol ClearCase > \uicontrol {Check Out}. If you check out files in a Unified Change Management (UCM) view, they are added to the change set of a UCM activity. By default, the activities are automatically assigned names. - To disable this functionality, select \uicontrol Edit > \uicontrol Preferences - > \uicontrol {Version Control} > \uicontrol ClearCase, and then deselect the + To disable this functionality, select \preferences > + \uicontrol {Version Control} > \uicontrol ClearCase, and then deselect the \uicontrol {Auto assign activity names} check box. To automatically check out files when you edit them, select the @@ -71,15 +71,14 @@ To create a permanent new version of the current file or all files in the versioned object base (VOB), select \uicontrol Tools > \uicontrol {ClearCase} > \uicontrol {Check In}. To confirm - that you want to check in the files, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Version Control} > \uicontrol ClearCase, + that you want to check in the files, select \preferences > + \uicontrol {Version Control} > \uicontrol ClearCase, and then select the \uicontrol {Prompt on check-in} check box. By default, you have to enter a comment when checking files out or in. - To suppress this prompt, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Version Control} > \uicontrol ClearCase, and then select the - \uicontrol {Do not prompt for comment during checkout or check-in} check - box. + To suppress this prompt, select \preferences > \uicontrol {Version Control} > + \uicontrol ClearCase, and then select the + \uicontrol {Do not prompt for comment during checkout or check-in} check box. If you change the read-only attribute of a file that is loaded into a snapshot view and modify the file without checking it out, you \e hijack the @@ -87,8 +86,8 @@ \uicontrol Tools > \uicontrol ClearCase > \uicontrol {Undo Hijack}. By default, the files in the VOBs are indexed for quick access to their - statuses. To disable indexing, select \uicontrol Edit > \uicontrol Preferences - > \uicontrol {Version Control} > \uicontrol ClearCase, and then select the + statuses. To disable indexing, select \preferences > + \uicontrol {Version Control} > \uicontrol ClearCase, and then select the \uicontrol {Disable indexer} check box. To only have some VOBs indexed, specify them in the \uicontrol {Index only VOBs} field. diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-cvs.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-cvs.qdoc index f0650434bd1..54e9b67eb91 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-cvs.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-cvs.qdoc @@ -34,7 +34,7 @@ \section1 CVS Preferences - To set CVS preferences, select \uicontrol Edit > \uicontrol Preferences > + To set CVS preferences, select \preferences > \uicontrol {Version Control} > \uicontrol CVS: \image qtcreator-preferences-vcs-cvs.webp {CVS preferences} diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-fossil.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-fossil.qdoc index e52c1c37b94..f8707657876 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-fossil.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-fossil.qdoc @@ -29,7 +29,7 @@ \li Create or designate a directory to store local Fossil repositories and remote clones. For example: \c ~/fossils/qt. - \li Select \uicontrol Edit > \uicontrol Preferences > + \li Select \preferences > \uicontrol {Version Control} > \uicontrol Fossil, and set the designated directory in the \uicontrol {Default path} field. @@ -71,7 +71,7 @@ \section1 Fossil Preferences - To set Fossil preferences, select \uicontrol Edit > \uicontrol Preferences > + To set Fossil preferences, select \preferences > \uicontrol {Version Control} > \uicontrol Fossil: \list diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc index 2efdb151dda..154a18ebbf5 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc @@ -31,8 +31,8 @@ port number, as well as an access token that you create in GitLab for \QC. The permission scope of the token must be at least \c read_api or \c api. - To specify connections to GitLab servers, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Version Control} > \uicontrol GitLab: + To specify connections to GitLab servers, select \preferences > + \uicontrol {Version Control} > \uicontrol GitLab: \image qtcreator-gitlab-preferences.png diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-mercurial.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-mercurial.qdoc index f729c382eb9..624e00a080a 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-mercurial.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-mercurial.qdoc @@ -48,8 +48,8 @@ \section1 Mercurial Preferences - To set preferences for Mercurial, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Version Control} > \uicontrol Mercurial: + To set preferences for Mercurial, select \preferences > + \uicontrol {Version Control} > \uicontrol Mercurial: \image qtcreator-preferences-vcs-mercurial.webp {Mercurial preferences} diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc index 595b81bd06e..3acacf2234f 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc @@ -32,8 +32,8 @@ \section1 Configuring Perforce - To set Perforce preferences, select \uicontrol Edit > \uicontrol Preferences - > \uicontrol {Version Control} > \uicontrol Perforce: + To set Perforce preferences, select \preferences > + \uicontrol {Version Control} > \uicontrol Perforce: \image qtcreator-preferences-vcs-perforce.webp {Perforce preferences} @@ -55,8 +55,8 @@ \l {Use common VCS Functions}, you can select \uicontrol Tools > \uicontrol Perforce > \uicontrol {Edit File} to open a file for editing within the client workspace. By default, files are automatically opened for - editing. To disable this feature, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Version Control} > \uicontrol Perforce, + editing. To disable this feature, select \preferences > + \uicontrol {Version Control} > \uicontrol Perforce, and then deselect the \uicontrol {Automatically open files when editing} check box. diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-preferences.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-preferences.qdoc index 2cdfbc73803..2bf02fbe4c8 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-preferences.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-preferences.qdoc @@ -12,8 +12,8 @@ \QC uses the version control system's command-line clients to access your repositories. Make sure that the command-line clients are in the \c{PATH} environment variable, or specify the path to the command-line client - executable in the version control system specific tab in \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Version Control}. + executable in the version control system specific tab in \preferences > + \uicontrol {Version Control}. \image qtcreator-preferences-vcs-bazaar.webp {Bazaar preferences} @@ -27,7 +27,7 @@ \section1 General VCS preferences - Select \uicontrol Edit > \uicontrol Preferences > \uicontrol {Version Control} + Select \preferences > \uicontrol {Version Control} > \uicontrol General to specify settings for submit messages: \image qtcreator-preferences-vcs-general.webp {General tab in Version Control preferences} diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-subversion.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-subversion.qdoc index 30aafae0d8b..b4bbe897aaf 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-subversion.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-subversion.qdoc @@ -29,9 +29,8 @@ \section1 Subversion Preferences - To set Subversion preferences, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Version Control} > - \uicontrol Subversion: + To set Subversion preferences, select \preferences > + \uicontrol {Version Control} > \uicontrol Subversion: \image qtcreator-preferences-vcs-subversion.webp {Subversion preferences} diff --git a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc index 1b34918ba89..ee1ba25ed15 100644 --- a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc +++ b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc @@ -45,9 +45,8 @@ you run Git from a Windows command prompt, it looks for the SSH keys in its installation directory, and therefore, the authorization fails. - You can set the \c HOME environment variable from \QC. Select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Version Control} > - \uicontrol Git, and then select the + You can set the \c HOME environment variable from \QC. Select \preferences > + \uicontrol {Version Control} > \uicontrol Git, and then select the \uicontrol {Set "HOME" environment variable} check box. \c HOME is set to \c %HOMEDRIVE%%HOMEPATH% when the Git executable is run and authorization works as it would with \c {git bash}. @@ -93,9 +92,8 @@ The log output has the date, the commit message, and a commit identifier. - You can set the maximum number of log entries to show in \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Version Control} > \uicontrol Git > - \uicontrol {Log count}. + You can set the maximum number of log entries to show in \preferences > + \uicontrol {Version Control} > \uicontrol Git > \uicontrol {Log count}. Click on the commit identifier to view commit details. @@ -144,8 +142,8 @@ \image qtcreator-git-blame.webp {Git Blame view} By default, each line is annotated in the editor when you scroll through - the file. To disable this feature, select \uicontrol Edit > - \uicontrol Preferences > \uicontrol {Version Control} > \uicontrol Git, and + the file. To disable this feature, select \preferences > + \uicontrol {Version Control} > \uicontrol Git, and deselect \uicontrol {Add instant blame annotations to editor}. To view annotations for the current line, select \uicontrol Tools > \uicontrol Git > \uicontrol {Current File} > \uicontrol {Instant Blame}. @@ -490,7 +488,7 @@ To pull changes from the remote repository, select \uicontrol Pull. If there are locally modified files, you are prompted to stash the changes. Select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Version Control} > + \preferences > \uicontrol {Version Control} > \uicontrol Git and then select the \uicontrol {Pull with rebase} check box to perform a rebase operation while pulling. @@ -579,8 +577,8 @@ To refresh the list of changes, select \uicontrol Refresh. The \uicontrol Remote field lists the remotes of the current repository that - are detected as Gerrit servers. Select \uicontrol Edit > \uicontrol Preferences - > \uicontrol {Version Control} > \uicontrol Gerrit to specify a fallback + are detected as Gerrit servers. Select \preferences > + \uicontrol {Version Control} > \uicontrol Gerrit to specify a fallback connection to a Gerrit server over SSH. The Gerrit REST interface and the \l{https://curl.haxx.se/}{curl} tool are used for HTTP connections. @@ -596,7 +594,7 @@ \note On \macos, the default Git installation does not have Git Gui. To use Git Gui, install it separately. To start Git Gui from \QC, select - \uicontrol Preferences > \uicontrol {Version Control} > \uicontrol Git, and + \preferences > \uicontrol {Version Control} > \uicontrol Git, and set the path to the environment that has Git Gui in the \uicontrol {Prepend to PATH} field. @@ -604,12 +602,11 @@ \uicontrol Git > \uicontrol {Git Tools} > \uicontrol Gitk. You can also start the tool to view commits in the current document or in the folder that has the current document. To specify arguments for running Gitk, select - \uicontrol Edit > \uicontrol Preferences > \uicontrol {Version Control} > - \uicontrol Git. + \preferences > \uicontrol {Version Control} > \uicontrol Git. To use some other application for viewing Git history, such as GitX or - QGit viewer, select \uicontrol Edit > \uicontrol Preferences > - \uicontrol {Version Control} > \uicontrol Git and specify the path to the + QGit viewer, select \preferences > \uicontrol {Version Control} > + \uicontrol Git and specify the path to the application executable in the \uicontrol {Command} field. To start the application, select \uicontrol Tools > \uicontrol Git > \uicontrol {Git Tools} > \uicontrol {Repository Browser}. diff --git a/doc/qtcreator/src/webassembly/creator-webassembly.qdoc b/doc/qtcreator/src/webassembly/creator-webassembly.qdoc index 64f8cd0e75e..7a84cc8c37d 100644 --- a/doc/qtcreator/src/webassembly/creator-webassembly.qdoc +++ b/doc/qtcreator/src/webassembly/creator-webassembly.qdoc @@ -71,15 +71,14 @@ To configure \QC for building Qt apps for the web: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices > - \uicontrol WebAssembly. + \li Select \preferences > \uicontrol Devices > \uicontrol WebAssembly. \li In the \uicontrol {Emscripten SDK path} field, enter the root directory where \c emsdk is installed. \li \QC configures the \uicontrol {Emscripten SDK environment} for you if the \c emsdk is supported by the Qt for WebAssembly version that you will use for developing the application. \image qtcreator-webassembly-options.png "Qt for WebAssembly device preferences" - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits. + \li Select \preferences > \uicontrol Kits. \image qtcreator-kit-webassembly.png "Qt for WebAssembly kit" \li In the \uicontrol Compiler group, \uicontrol {Emscripten Compiler} should have been automatically detected for both C++ and C. If not, @@ -92,8 +91,7 @@ to \QC. To add kits: \list 1 - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > - \uicontrol Add. + \li Select \preferences > \uicontrol Kits > \uicontrol Add. \li In the \uicontrol Name field, specify a name for the kit. \li In the \uicontrol {Run device type} field, select \uicontrol {WebAssembly Runtime}. diff --git a/doc/qtcreator/src/widgets/qtdesigner-overview.qdoc b/doc/qtcreator/src/widgets/qtdesigner-overview.qdoc index 390db7f2b89..71e53130bc6 100644 --- a/doc/qtcreator/src/widgets/qtdesigner-overview.qdoc +++ b/doc/qtcreator/src/widgets/qtdesigner-overview.qdoc @@ -60,7 +60,7 @@ \list - \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Designer. + \li Select \preferences > \uicontrol Designer. \li Specify embedded device profiles, that determine style, font, and screen resolution, for example, in \uicontrol{Embedded Design}. @@ -91,7 +91,7 @@ \list 1 - \li \uicontrol Edit > \uicontrol Preferences > \uicontrol Designer. + \li \preferences > \uicontrol Designer. \image qtdesigner-embedded-design.png "Qt Designer Embedded Design preferences" \li In \uicontrol {Embedded Design}, select \inlineimage icons/plus.png to open the \uicontrol {Add Profile} dialog. From 3438b03af6408a8ec029625c40cde0215da5c182 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Wed, 18 Oct 2023 21:25:41 +0200 Subject: [PATCH 1664/1777] ScreenRecorder: Remember the crop area across recordings of same size If multiple recordings were made in a row, the crop area was reset each time and had to be reselected by users. This change implements the retaining of the cropping area during the lifetime of the Recording dialog, as long as the clip size does not change. A potential trap is now, though, that the cropping area remains the same even if the screen gets changed or the screen recording area was just moved. But I believe that the new convenience outweighs this corner case. Change-Id: I0326dfcad6827b2d504a4e309891824b16b6a47c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/screenrecorder/cropandtrim.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp index e7b113cc194..c52cc011610 100644 --- a/src/plugins/screenrecorder/cropandtrim.cpp +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -783,8 +783,9 @@ CropAndTrimWidget::CropAndTrimWidget(QWidget *parent) void CropAndTrimWidget::setClip(const ClipInfo &clip) { + if (clip.dimensions != m_clipInfo.dimensions) + m_cropRect = {QPoint(), clip.dimensions}; // Reset only if clip size changed m_clipInfo = clip; - m_cropRect = {QPoint(), clip.dimensions}; m_currentFrame = 0; m_trimRange = {m_currentFrame, m_clipInfo.framesCount()}; updateWidgets(); From 479f955e941f7b8a1ddede2ad758d0df39747407 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 19 Oct 2023 08:39:25 +0200 Subject: [PATCH 1665/1777] GenericDeployStep: Add missing reference, avoid auto Change-Id: Ib240bfefaea6c0637cbe66310cb4cc98db78c0d9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/remotelinux/genericdeploystep.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/remotelinux/genericdeploystep.cpp b/src/plugins/remotelinux/genericdeploystep.cpp index 9ca4063e390..5def5465258 100644 --- a/src/plugins/remotelinux/genericdeploystep.cpp +++ b/src/plugins/remotelinux/genericdeploystep.cpp @@ -99,7 +99,7 @@ GroupItem GenericDeployStep::mkdirTask() FilePath::removeDuplicates(remoteDirs); async.setConcurrentCallData([remoteDirs](QPromise<ResultType> &promise) { - for (auto dir : remoteDirs) { + for (const FilePath &dir : remoteDirs) { const expected_str<void> result = dir.ensureWritableDir(); promise.addResult(result); if (!result) @@ -117,7 +117,7 @@ GroupItem GenericDeployStep::mkdirTask() } for (int i = 0; i < numResults; ++i) { - const auto result = async.future().resultAt(i); + const ResultType result = async.future().resultAt(i); if (!result.has_value()) addErrorMessage(result.error()); } From 901e32a0ea52de68221b2db4037a5881e100d4f8 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 17 Oct 2023 09:44:20 +0200 Subject: [PATCH 1666/1777] Utils: remove Q_ASSERT in FileSystemWatcher In the worst case scenarios we either track unregistered files or do not track the files that had been registered. Both are less intrusive than a crash. Change-Id: I880d80dddc401fd996ac1f18e82414665510fd30 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/filesystemwatcher.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libs/utils/filesystemwatcher.cpp b/src/libs/utils/filesystemwatcher.cpp index ac9043f878c..7933d31543e 100644 --- a/src/libs/utils/filesystemwatcher.cpp +++ b/src/libs/utils/filesystemwatcher.cpp @@ -275,7 +275,7 @@ void FileSystemWatcher::addFiles(const QStringList &files, WatchMode wm) d->m_files.insert(file, WatchEntry(file, wm)); const int count = ++d->m_staticData->m_fileCount[file]; - Q_ASSERT(count > 0); + QTC_CHECK(count > 0); if (count == 1) { toAdd << file; @@ -284,7 +284,7 @@ void FileSystemWatcher::addFiles(const QStringList &files, WatchMode wm) if (!fi.exists()) { const QString directory = fi.path(); const int dirCount = ++d->m_staticData->m_directoryCount[directory]; - Q_ASSERT(dirCount > 0); + QTC_CHECK(dirCount > 0); if (dirCount == 1) toAdd << directory; @@ -315,7 +315,7 @@ void FileSystemWatcher::removeFiles(const QStringList &files) d->m_files.erase(it); const int count = --(d->m_staticData->m_fileCount[file]); - Q_ASSERT(count >= 0); + QTC_CHECK(count >= 0); if (!count) { toRemove << file; @@ -324,7 +324,7 @@ void FileSystemWatcher::removeFiles(const QStringList &files) if (!fi.exists()) { const QString directory = fi.path(); const int dirCount = --d->m_staticData->m_directoryCount[directory]; - Q_ASSERT(dirCount >= 0); + QTC_CHECK(dirCount >= 0); if (!dirCount) toRemove << directory; @@ -381,7 +381,7 @@ void FileSystemWatcher::addDirectories(const QStringList &directories, WatchMode d->m_directories.insert(directory, WatchEntry(directory, wm)); const int count = ++d->m_staticData->m_directoryCount[directory]; - Q_ASSERT(count > 0); + QTC_CHECK(count > 0); if (count == 1) toAdd << directory; @@ -411,7 +411,7 @@ void FileSystemWatcher::removeDirectories(const QStringList &directories) d->m_directories.erase(it); const int count = --d->m_staticData->m_directoryCount[directory]; - Q_ASSERT(count >= 0); + QTC_CHECK(count >= 0); if (!count) toRemove << directory; @@ -438,7 +438,7 @@ void FileSystemWatcher::slotFileChanged(const QString &path) if (!fi.exists()) { const QString directory = fi.path(); const int dirCount = ++d->m_staticData->m_directoryCount[directory]; - Q_ASSERT(dirCount > 0); + QTC_CHECK(dirCount > 0); if (dirCount == 1) d->m_staticData->m_watcher->addPath(directory); @@ -474,7 +474,7 @@ void FileSystemWatcher::slotDirectoryChanged(const QString &path) for (const QString &reAdded : std::as_const(toReadd)) { const QString directory = QFileInfo(reAdded).path(); const int dirCount = --d->m_staticData->m_directoryCount[directory]; - Q_ASSERT(dirCount >= 0); + QTC_CHECK(dirCount >= 0); if (!dirCount) d->m_staticData->m_watcher->removePath(directory); From aee3d9323719c5bbc5bf11a222372bc4eb6b28fb Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Wed, 18 Oct 2023 10:24:48 +0200 Subject: [PATCH 1667/1777] Core: Use QDialog::open instead of exec Task-number: QTBUG-117814 Change-Id: If92d627c2ae71721e61916cf50c26f5a41e35725 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../coreplugin/dialogs/settingsdialog.cpp | 49 ++++++++----------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 1f7aa77d2e4..d503c71671f 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -455,7 +455,6 @@ private: QCheckBox *m_sortCheckBox; QListView *m_categoryList; QLabel *m_headerLabel; - std::vector<QEventLoop *> m_eventLoops; bool m_running = false; bool m_applied = false; bool m_finished = false; @@ -757,11 +756,6 @@ void SettingsDialog::done(int val) ICore::saveSettings(ICore::SettingsDialogDone); // save all settings - // exit event loops in reverse order of addition - for (QEventLoop *eventLoop : m_eventLoops) - eventLoop->exit(); - m_eventLoops.clear(); - QDialog::done(val); } @@ -773,29 +767,28 @@ bool SettingsDialog::execDialog() static const char kPreferenceDialogSize[] = "Core/PreferenceDialogSize"; const QSize initialSize(kInitialWidth, kInitialHeight); resize(ICore::settings()->value(kPreferenceDialogSize, initialSize).toSize()); - exec(); - m_running = false; - m_instance = nullptr; - ICore::settings()->setValueWithDefault(kPreferenceDialogSize, - size(), - initialSize); - // make sure that the current "single" instance is deleted - // we can't delete right away, since we still access the m_applied member - deleteLater(); - } else { - // exec dialog is called while the instance is already running - // this can happen when a event triggers a code path that wants to - // show the settings dialog again - // e.g. when starting the debugger (with non-built debugging helpers), - // and manually opening the settings dialog, after the debugger hit - // a break point it will complain about missing helper, and offer the - // option to open the settings dialog. - // Keep the UI running by creating another event loop. - QEventLoop eventLoop; - m_eventLoops.emplace(m_eventLoops.begin(), &eventLoop); - eventLoop.exec(); - QTC_ASSERT(m_eventLoops.empty(), return m_applied;); + + // We call open here as exec is no longer the preferred method of displaying + // modal dialogs. The issue that triggered the change here was QTBUG-117814 + // (on macOS: Caps Lock indicator does not update) + open(); + connect(this, &QDialog::finished, this, [this, initialSize] { + m_running = false; + m_instance = nullptr; + ICore::settings()->setValueWithDefault(kPreferenceDialogSize, size(), initialSize); + // make sure that the current "single" instance is deleted + // we can't delete right away, since we still access the m_applied member + deleteLater(); + }); } + + // This function needs to be blocking, so we need to wait for the dialog to finish. + // We cannot use QDialog::exec due to the issue described above at "open()". + // Since execDialog can be called multiple times, we need to run potentially multiple + // loops here, to have every invocation of execDialog() wait for the dialog to finish. + while (m_running) + QApplication::processEvents(QEventLoop::WaitForMoreEvents); + return m_applied; } From 5cb40870b105a755e86c50b1784aed29deafce2d Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 16 Oct 2023 19:56:53 +0200 Subject: [PATCH 1668/1777] Tr: Fix some source texts Change-Id: I06458b177af2691a362368faed2b6bea3883a2f5 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- src/libs/advanceddockingsystem/dockmanager.cpp | 4 ++-- src/plugins/clangcodemodel/clangdfollowsymbol.cpp | 2 +- src/plugins/coreplugin/vcsmanager.cpp | 5 +++-- src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp | 2 +- .../cppeditor/followsymbol_switchmethoddecldef_test.cpp | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp index ee21f77ac29..49ce3945748 100644 --- a/src/libs/advanceddockingsystem/dockmanager.cpp +++ b/src/libs/advanceddockingsystem/dockmanager.cpp @@ -1345,13 +1345,13 @@ expected_str<QString> DockManager::exportWorkspace(const QString &targetFilePath // Check if the target directory exists if (!targetFile.parentDir().exists()) return make_unexpected( - Tr::tr("Directory does not exist\"%1\".").arg(targetFile.parentDir().toUserOutput())); + Tr::tr("The directory \"%1\" does not exist.").arg(targetFile.parentDir().toUserOutput())); // Check if the workspace exists const FilePath workspaceFile = userDirectory().pathAppended(sourceFileName); if (!workspaceFile.exists()) return make_unexpected( - Tr::tr("Workspace does not exist \"%1\"").arg(workspaceFile.toUserOutput())); + Tr::tr("The workspace \"%1\" does not exist ").arg(workspaceFile.toUserOutput())); // Finally copy the workspace to the target const expected_str<void> copyResult = workspaceFile.copyFile(targetFile); diff --git a/src/plugins/clangcodemodel/clangdfollowsymbol.cpp b/src/plugins/clangcodemodel/clangdfollowsymbol.cpp index ee56e3f4c75..8be15c7327d 100644 --- a/src/plugins/clangcodemodel/clangdfollowsymbol.cpp +++ b/src/plugins/clangcodemodel/clangdfollowsymbol.cpp @@ -340,7 +340,7 @@ IAssistProposal *ClangdFollowSymbol::VirtualFunctionAssistProcessor::createPropo items << createEntry({}, m_followSymbol->d->defLink); if (!final) { const auto infoItem = new VirtualFunctionProposalItem({}, false); - infoItem->setText(Tr::tr("collecting overrides ...")); + infoItem->setText(Tr::tr("collecting overrides...")); infoItem->setOrder(-1); items << infoItem; } diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index ce4138721fc..4e04a687d80 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -333,8 +333,9 @@ FilePaths VcsManager::promptToDelete(IVersionControl *vc, const FilePaths &fileP return fp.toUserOutput(); }).join("</li><li>") + "</li></ul>"; const QString title = Tr::tr("Version Control"); - const QString msg = Tr::tr("Remove the following files from the version control system (%2)? " - "%1Note: This might remove the local file.").arg(fileListForUi, vc->displayName()); + const QString msg = Tr::tr("Remove the following files from the version control system (%1)?") + .arg(vc->displayName()) + + fileListForUi + Tr::tr("Note: This might remove the local file."); const QMessageBox::StandardButton button = QMessageBox::question(ICore::dialogParent(), title, msg, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); if (button != QMessageBox::Yes) diff --git a/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp b/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp index 19fc0890257..34aa3d6fd07 100644 --- a/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp +++ b/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp @@ -94,7 +94,7 @@ public: QTC_ASSERT(m_params.function, return nullptr); auto *hintItem = new VirtualFunctionProposalItem(Utils::Link()); - hintItem->setText(Tr::tr("collecting overrides ...")); + hintItem->setText(Tr::tr("collecting overrides...")); hintItem->setOrder(-1000); QList<AssistProposalItemInterface *> items; diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp index feac4e70fa7..21664ea1402 100644 --- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp +++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp @@ -449,7 +449,7 @@ F2TestCase::F2TestCase(CppEditorAction action, first.text = "<base declaration>"; expectedImmediate << first; } - expectedImmediate << OverrideItem(QLatin1String("collecting overrides ...")); + expectedImmediate << OverrideItem(QLatin1String("collecting overrides...")); } QCOMPARE(immediateVirtualSymbolResults, expectedImmediate); if (useClangd) { From 720a77e0c0f13156ade37b76ca0f2ed1dee664e2 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 19 Oct 2023 11:06:00 +0200 Subject: [PATCH 1669/1777] Tr: Fix camera mode switcher action name Change-Id: Ifae8d8551aa1c1869dc12993d25adf17b174edb3 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> --- src/plugins/qmldesigner/components/edit3d/edit3dview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp b/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp index f8c1cc2a7e8..028732cebca 100644 --- a/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp +++ b/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp @@ -716,7 +716,7 @@ void Edit3DView::createEdit3DActions() QmlDesigner::Constants::EDIT3D_EDIT_CAMERA, View3DActionType::CameraToggle, QCoreApplication::translate("CameraToggleAction", - "Toggle Perspective/Orthographic Edit Camera"), + "Toggle Perspective/Orthographic Camera Mode"), QKeySequence(Qt::Key_T), true, false, From 6ae4d71a1b1e4095d7736cb3186609a16868b883 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Wed, 18 Oct 2023 16:53:07 +0200 Subject: [PATCH 1670/1777] Doc: Update GitHub Copilot docs - Change link to Neovim plugin installation to point to the Readme.md - Add instructions for macOS users for finding the About Plugins and Preferences (using the \preferences macro) - Describe proxy settings - Fix a changed check box name Fixes: QTCREATORBUG-29734 Fixes: QTCREATORBUG-29613 Task-number: QTCREATORBUG-29392 Change-Id: I2b392e805322fd95a7b87295756d5df76015bbbc Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- .../images/qtcreator-preferences-copilot.webp | Bin 8724 -> 10032 bytes .../editors/creator-only/creator-copilot.qdoc | 39 +++++++++++++----- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/doc/qtcreator/images/qtcreator-preferences-copilot.webp b/doc/qtcreator/images/qtcreator-preferences-copilot.webp index b98f74e43dfca45013258dc0e9738cf29b74a108..48df99f87b113039d897fcafedd9b01d78ccd46d 100644 GIT binary patch literal 10032 zcmWIYbaT^CXJ80-bqWXzu<(&lXJF93?lgnpDp&KiUKQ0piRU-(-pec?D12Z(_c`%B zJGfk@i2QLql$I9|5a>5eqv3cA(;Lgm*M<+gzp?3^$vKmIZGBXL!GwEW3pUCY)w}1L z@W=lwJf|=4_V%%YPiq|)KNl}C61S}T>dIxfqGM0!&iAgX?EQ9p{r^99>BN82Z^m7& zesBA%$yCvJvQwwx<3+)`!Siz8?+rJ)U7cE8TlHV{{Li_E_ZHl}{_FOh9*vtVim6;n zW(XHNSQOV;y!b^VOSee&ZSCzp8+hE7PX5i5)p>ijNmpRR4D$z~B9#I8lOiw1CRtAM zUp(i}`a2o_KX3cF_kYtB*$3xb_E|V^n5}xkdMC3f<eiP9Si$tWGiKGNHso($D-kTc zULUz7*R{7KudOwxB3mKpQl-l*egAd2xBK4Q3X7W}tlDUJ^xJ*sF3o52IQ?5w4;dv| z-V#X9U;F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2Liqo(~ai8e6q8;ZpE6(b?p}ZpQ-S7Ur)-F-mW+!)*RBwJ_<m9sG zrQx$rdg^OD8sGojA9L;D^65>_)ZL{P@VXt}rqmIoYN*Sby*zZf;H8wEnaOtrX3lUo zynWVAS@?u{ac~Mh+v4PCy(jfnPab3#8_e);XWlxA)$#iw+1qVAQ<uhCob>ki^ljl& z@3TIe52WP&yXp4s|I_kMMa}2DrJm)URa-pwjX}^$+X`zrfk(V-Gao;{w|Y{Z`K}UO zPVfEy*Lq&D{clmaP*QmJR{OlaUq8#*-#B*dPm0siUpdN0Cb2I|o_#n+TCHX>hv&Vg z4-cJWn%owr-tF;UU+Rl(q=(~kHlN1I#}hLq^}Wt)*pM;7vg+O5i8V&P$7gngeBZl1 zR((!O^2f-#i(DP`#avD~b*b|E9^bY|=L18L(QZGn8&78DPO-S~|8%k*>)h(O1p$(> zaVoz$j_!7hFgfw&NrPyi(Mvn=a_-_ycmKctxB0Qpp^YVO*FF30ukq<r<qtf*ZIPSx z%vg2qGoQ{({1-pPvM{ziQ{b7)BFi-!3MN?AyxXgkDZC`kU-e4zYR>JGW={V<tNNsa z3A=%d?CnYW&prtj?`=#io2#?I@_~=^CXfI6{X75KJ!O=fcDYr!^BF(P5UI@BtL8;d zVA<w&-Lp-{(wMvXV3yj0M-pu-lB2)<7LK+*nJsS-`CziCowrr@m;XgGE-%<z61B&z zUAS{wV&-dU4sN!Yho9eDJ^9_doPBi`ADHv)wHJq`FkaQWt{DHtc%4K?8khYv8v)td zlLC{EZ96tSY<2F0JW=z1!Lz03+Vi^Tvu{hj&9Pup?IqoomaF~W-aIr5^Z2!L;jve* y*0{C&uHV@@VZ$!PZw@&(vN9|7AK_oUO4ihU=XZ`((|`X<zF+?)zp0t|n=SyeRI_{l diff --git a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc index 62f0f72da63..1f30da9120e 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc @@ -26,9 +26,9 @@ \list \li An active \l{https://docs.github.com/en/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot} {GitHub Copilot subscription}. - \li GitHub Copilot Neovim plugin installed, as described in - \l{https://docs.github.com/en/copilot/getting-started-with-github-copilot?tool=neovim} - {About GitHub Copilot and Neovim}. + \li GitHub Copilot Neovim plugin installed (requires Node.js), as described in + \l{https://github.com/github/copilot.vim/blob/release/README.md} + {Copilot.vim/Readme.md}. \endlist \section1 Enabling the Copilot Plugin @@ -36,8 +36,9 @@ To enable the Copilot plugin: \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol Utilities > \uicontrol Copilot to enable the plugin. + \li Select \uicontrol Help (or \uicontrol {\QC} on \macos) > + \uicontrol {About Plugins} > \uicontrol Utilities > + \uicontrol Copilot to enable the plugin. \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. \endlist @@ -56,17 +57,33 @@ \li In the \uicontrol {Node.js path} field, enter the full path to the Node.js executable. \li In the \uicontrol {Path to agent.js} field, enter the path to - agent.js in the Copilot Neovim plugin. - \li Select the \uicontrol {Request completions automatically} checkbox to - receive suggestions for the current text cursor position when you - make changes. + agent.js in the Copilot Neovim plugin installation folder. + \li Select the \uicontrol {Auto request} check box to receive suggestions + for the current text cursor position when you make changes. + \li Select the \uicontrol {Use proxy} check box to use a proxy server to + connect to Copilot servers. + \li In the \uicontrol {Proxy host} field, enter the host name of the + proxy server. + \li In the \uicontrol {Proxy port} field, enter the port number of the + proxy server. + \li Select the \uicontrol {Reject unauthorized} check box to prevent the + security risk presented by accepting unauthorized certificates from + the proxy server. + \li In the \uicontrol {Proxy user} field, enter the user name to + authenticate to the proxy server. + \li Select the \uicontrol {Save proxy password} check box to save the + password to authenticate to the proxy server. + \note The password is saved insecurely. + \li In the \uicontrol {Proxy password} field, enter the password to save. + To see the password as you type, select the \inlineimage icons/original-size.png + button. \endlist \section1 Receiving Suggestions When you write code in the \l {Working in Edit Mode}{Edit} mode and - \uicontrol {Request completions automatically} is enabled, Copilot - automatically makes suggestions when you type. + \uicontrol {Auto request} is enabled, Copilot automatically makes + suggestions when you type. \image qtcreator-copilot.gif {Receiving suggestions from Copilot in the editor} From 24ed69b2ec09b5d1cd82ab51231485f052841bd2 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 19 Oct 2023 10:37:27 +0200 Subject: [PATCH 1671/1777] LanguageClient: Simplify group box title and fix "JSON" It already under a title "Language Server", no need to repeat Change-Id: Ib0da722dfdaede194e48fa5f0ff3948ec0f16842 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- src/plugins/languageclient/languageclientsettings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index 95d5b1a2e1b..7b6c4a41bfe 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -1117,10 +1117,10 @@ ProjectSettingsWidget::ProjectSettingsWidget(ProjectExplorer::Project *project) auto layout = new QVBoxLayout; setLayout(layout); - auto group = new QGroupBox(Tr::tr("Language Server Workspace Configuration")); + auto group = new QGroupBox(Tr::tr("Workspace Configuration")); group->setLayout(new QVBoxLayout); group->layout()->addWidget(new QLabel(Tr::tr( - "Additional json configuration sent to all running language servers for this project.\n" + "Additional JSON configuration sent to all running language servers for this project.\n" "See the documentation of the specific language server for valid settings."))); group->layout()->addWidget(editor->widget()); layout->addWidget(group); From b706fab6c642072750935a0f13290d098cf49233 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 19 Oct 2023 15:12:34 +0200 Subject: [PATCH 1672/1777] Ios: Fix synchronization This fixes the synchronization on early shutdown, e.g. when Creator is started with "-test Ios". Change-Id: Ia18215a090809b6095d51ee3647728b4b2ad2d5f Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/ios/iosconfigurations.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/ios/iosconfigurations.cpp b/src/plugins/ios/iosconfigurations.cpp index 04ab69b8a25..105ba236eaa 100644 --- a/src/plugins/ios/iosconfigurations.cpp +++ b/src/plugins/ios/iosconfigurations.cpp @@ -12,6 +12,8 @@ #include <coreplugin/icore.h> +#include <extensionsystem/pluginmanager.h> + #include <projectexplorer/kitaspects.h> #include <projectexplorer/kitmanager.h> #include <projectexplorer/devicesupport/devicemanager.h> @@ -31,6 +33,7 @@ #include <qtsupport/qtversionfactory.h> #include <utils/algorithm.h> +#include <utils/futuresynchronizer.h> #include <utils/process.h> #include <utils/qtcassert.h> @@ -405,7 +408,8 @@ void IosConfigurations::updateSimulators() dev = IDevice::ConstPtr(new IosSimulator(devId)); devManager->addDevice(dev); } - SimulatorControl::updateAvailableSimulators(this); + ExtensionSystem::PluginManager::futureSynchronizer()->addFuture( + SimulatorControl::updateAvailableSimulators(this)); } void IosConfigurations::setDeveloperPath(const FilePath &devPath) From 66d94a82a32cdfdb344d55ef2c610ee9b3f03f7f Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 19 Oct 2023 09:49:34 +0200 Subject: [PATCH 1673/1777] QmlPreview: Do not act on any editor / document change If no preview is running there is no need to process anything. In theory the basic connections inside the plugin might be better properly done and explicitly connected and disconnected, but I wanted to avoid an intrusive change after the beta. Fixes ongoing message box displaying when editing a qml file. Kind of amends 5336fd83a004c1fe5265b9f9ba87320c031d2040 as it revealed this misbehavior. Change-Id: I5081e1c7d2154e3cc75ad9da32af1b0c7f86dff2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/qmlpreview/qmlpreviewplugin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/qmlpreview/qmlpreviewplugin.cpp b/src/plugins/qmlpreview/qmlpreviewplugin.cpp index 2722ecb016e..464c9b88f05 100644 --- a/src/plugins/qmlpreview/qmlpreviewplugin.cpp +++ b/src/plugins/qmlpreview/qmlpreviewplugin.cpp @@ -413,6 +413,8 @@ void QmlPreviewPluginPrivate::attachToEditor() void QmlPreviewPluginPrivate::checkEditor() { + if (m_runningPreviews.isEmpty()) + return; QmlJS::Dialect::Enum dialect = QmlJS::Dialect::AnyLanguage; Core::IDocument *doc = m_lastEditor->document(); const QString mimeType = doc->mimeType(); From eccbff7698557ff4706ab21890b4fb044ff3a9c1 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Wed, 18 Oct 2023 17:11:12 +0200 Subject: [PATCH 1674/1777] Doc: Describe Tools > C++ > Fold/Unfold All Comment Blocks Task-number: QTCREATORBUG-29392 Change-Id: Ie92253165b5004455be6f7dd8e031431c4358dae Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../src/editors/creator-editors-options.qdoc | 5 ++- .../creator-semantic-highlighting.qdoc | 33 ++++++++++++++----- .../creator-projects-settings-editor.qdoc | 2 +- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/doc/qtcreator/src/editors/creator-editors-options.qdoc b/doc/qtcreator/src/editors/creator-editors-options.qdoc index e17a11c8a98..595c79b81c3 100644 --- a/doc/qtcreator/src/editors/creator-editors-options.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-options.qdoc @@ -57,9 +57,8 @@ \li Set \l{Indent text or code}{tabs, indentation, the handling of whitespace, and mouse operations} in \uicontrol Behavior. - \li Set various display properties, such as - \l{Highlighting and folding blocks} - {highlighting and folding blocks} or text + \li Set various display properties, such as \l{Highlighting Blocks} + {highlighting} or \l{Folding Blocks}{folding} blocks or text wrapping in \uicontrol Display. \li Add, modify, and remove \l{Editing Code Snippets}{code snippets} in diff --git a/doc/qtcreator/src/editors/creator-semantic-highlighting.qdoc b/doc/qtcreator/src/editors/creator-semantic-highlighting.qdoc index e6d119bb818..23dfc01a4f0 100644 --- a/doc/qtcreator/src/editors/creator-semantic-highlighting.qdoc +++ b/doc/qtcreator/src/editors/creator-semantic-highlighting.qdoc @@ -69,7 +69,7 @@ apply the changes you make to the definition files, select \uicontrol {Reload Definitions}. - \section1 Highlighting and Folding Blocks + \section1 Highlighting Blocks Use block highlighting to visually separate parts of the code that belong together. For example, when you place the cursor within the braces, the code @@ -80,6 +80,8 @@ To enable block highlighting, select \preferences > \uicontrol {Text Editor} > \uicontrol Display > \uicontrol {Highlight blocks}. + \section1 Folding Blocks + Use the folding markers to collapse and expand blocks of code within braces. Click the folding marker to collapse or expand a block. In the figure above, the folding markers are located between the line number and the text pane. @@ -90,10 +92,21 @@ \image qtcreator-options-text-editor-display.png "Text Editor Display preferences" - When the cursor is on a brace, the matching brace is animated by default. To - turn off the animation and just highlight the block and the braces, select - \preferences > \uicontrol {Text Editor} > - \uicontrol Display and deselect \uicontrol {Animate matching parentheses}. + \section2 Folding All Comment Blocks + + To fold all comment blocks, select \uicontrol Tools > \uicontrol C++ > + \uicontrol {Fold All Comment Blocks}. To unfold all comment blocks, select + \uicontrol {Unfold All Comment Blocks}. + + \section1 Animating Matching Braces + + When the cursor is on a brace, the matching brace is animated by default. + + To turn off the animation and just highlight the block and the braces, select + \preferences > \uicontrol {Text Editor} > \uicontrol Display and deselect + \uicontrol {Animate matching parentheses}. + + \section1 Moving Between Blocks You can use keyboard shortcuts to move within and between blocks. To go to block end, press \key {Ctrl+]} and to go to block start, press @@ -101,11 +114,15 @@ or beginning of the block, press \key {Ctrl+Shift+]} and \key {Ctrl+Shift+[}, respectively. + \section1 Selecting the Current Block + To select the current block, press \key Ctrl+U. A second key press extends the selection to the parent block. To undo the last selection, press - \key {Ctrl+Alt+Shift+U}. To enable smart block selection, select - \preferences > \uicontrol {Text Editor} > - \uicontrol Behavior > \uicontrol {Enable smart selection changing}. + \key {Ctrl+Alt+Shift+U}. + + To enable smart block selection, select \preferences + > \uicontrol {Text Editor} > \uicontrol Behavior > + \uicontrol {Enable smart selection changing}. \image qtcreator-options-text-editor-behavior.png "Text Editor Behavior preferences" */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc index 384874405a7..ba622d8b2ae 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc @@ -38,6 +38,6 @@ \sa {Configuring Fonts}, {File Encoding}, {Moving to Symbol Definition or Declaration}, {Indent text or code}, - {Highlighting and Folding Blocks}, {Selecting Line Ending Style}, + {Selecting Line Ending Style}, {Semantic Highlighting}, {View function tooltips} */ From b5d0c5dd36078a9499c494c0429107c5171e5189 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 17 Oct 2023 16:01:45 +0200 Subject: [PATCH 1675/1777] CMakePM: Save CMAKE_PREFIX|MODULE_PATH as cache variables for conan This way it's visible in the project settings where the Conan paths are added. Change-Id: I95aa59c836bf3b9ed122e9bffdd61b0dd3c7354e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/share/3rdparty/package-manager/auto-setup.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/share/3rdparty/package-manager/auto-setup.cmake b/src/share/3rdparty/package-manager/auto-setup.cmake index f6e6ce129aa..00948cb9678 100644 --- a/src/share/3rdparty/package-manager/auto-setup.cmake +++ b/src/share/3rdparty/package-manager/auto-setup.cmake @@ -119,6 +119,10 @@ macro(qtc_auto_setup_conan) file(WRITE \"${CMAKE_BINARY_DIR}/conan-dependencies/conan_paths.cmake\" \" list(PREPEND CMAKE_PREFIX_PATH \\\"\${CONAN_GENERATORS_FOLDER}\\\") list(PREPEND CMAKE_MODULE_PATH \\\"\${CONAN_GENERATORS_FOLDER}\\\") + list(REMOVE_DUPLICATES CMAKE_PREFIX_PATH) + list(REMOVE_DUPLICATES CMAKE_MODULE_PATH) + set(CMAKE_PREFIX_PATH \\\"\\\${CMAKE_PREFIX_PATH}\\\" CACHE STRING \\\"\\\" FORCE) + set(CMAKE_MODULE_PATH \\\"\\\${CMAKE_MODULE_PATH}\\\" CACHE STRING \\\"\\\" FORCE) \") endif() else() From cdc785757276457125524ceff6578d47d4186cb3 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 17 Oct 2023 16:10:03 +0200 Subject: [PATCH 1676/1777] CMakePM: Search for Config modules also in CMAKE_MODULE_PATH This is allowed by `find_package`, and can be tested with the `fmt` package provided by conan. Change-Id: Ib9bf2a6cbd80b8eb322cb6d8a1a9c25af0ca4031 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index 7a656722bb4..d0b14614344 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -400,7 +400,8 @@ static QPair<QStringList, QStringList> getFindAndConfigCMakePackages( std::function<QString(const QString &)> function; QStringList &result; } mapping[] = {{"CMAKE_PREFIX_PATH", "lib/cmake", configPackageName, configPackages}, - {"CMAKE_MODULE_PATH", QString(), findPackageName, modulePackages}}; + {"CMAKE_MODULE_PATH", QString(), findPackageName, modulePackages}, + {"CMAKE_MODULE_PATH", QString(), configPackageName, configPackages}}; for (const auto &m : mapping) { FilePaths paths = Utils::transform<FilePaths>(cmakeCache.valueOf(m.cmakeVariable).split(';'), From a071d4354a4efc732239a25f584afac8fb3c6eee Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 17 Oct 2023 17:15:26 +0200 Subject: [PATCH 1677/1777] CMakePM: Save CMAKE_MODULE|PREFIX_PATH in cache for vcpkg This would allow the user to see the paths set by vcpkg. Change-Id: I6d4ed9a9c69c2296851c8f8363b78d5adb7d2723 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/share/3rdparty/package-manager/auto-setup.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/share/3rdparty/package-manager/auto-setup.cmake b/src/share/3rdparty/package-manager/auto-setup.cmake index 00948cb9678..bae90ee6429 100644 --- a/src/share/3rdparty/package-manager/auto-setup.cmake +++ b/src/share/3rdparty/package-manager/auto-setup.cmake @@ -226,6 +226,14 @@ macro(qtc_auto_setup_vcpkg) endif() set(CMAKE_TOOLCHAIN_FILE "${CMAKE_BINARY_DIR}/vcpkg-dependencies/toolchain.cmake" CACHE PATH "" FORCE) + + # Save CMAKE_PREFIX_PATH and CMAKE_MODULE_PATH as cache variables + if (CMAKE_VERSION GREATER_EQUAL "3.19") + cmake_language(DEFER CALL list REMOVE_DUPLICATES CMAKE_PREFIX_PATH) + cmake_language(DEFER CALL list REMOVE_DUPLICATES CMAKE_MODULE_PATH) + cmake_language(DEFER CALL set CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}" CACHE STRING "" FORCE) + cmake_language(DEFER CALL set CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" CACHE STRING "" FORCE) + endif() endif() endmacro() qtc_auto_setup_vcpkg() From 105fd8becb3a65b7310eb4dc7c6eb69b3631eea2 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 17 Oct 2023 17:19:10 +0200 Subject: [PATCH 1678/1777] CMakePM: Add "share" for CMAKE_PREFIX_PATH for completion This would allow packages from vcpkg to be found. Change-Id: Ie0921d9ed6cfe692bc18235bfaf678ede5c98e14 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index d0b14614344..6dc754d2bed 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -400,6 +400,7 @@ static QPair<QStringList, QStringList> getFindAndConfigCMakePackages( std::function<QString(const QString &)> function; QStringList &result; } mapping[] = {{"CMAKE_PREFIX_PATH", "lib/cmake", configPackageName, configPackages}, + {"CMAKE_PREFIX_PATH", "share", configPackageName, configPackages}, {"CMAKE_MODULE_PATH", QString(), findPackageName, modulePackages}, {"CMAKE_MODULE_PATH", QString(), configPackageName, configPackages}}; From ada1a7b1c07d879d16422b666a401ff7439ffb3e Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 19 Oct 2023 15:27:04 +0200 Subject: [PATCH 1679/1777] LanguageClient: Fix qbs mingw build Change-Id: Idb7102597a9a7cdf8a8cd5cd1ce249770e559c16 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/languageclient/languageclient.qbs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/languageclient/languageclient.qbs b/src/plugins/languageclient/languageclient.qbs index 7f1899927fe..5bb5e1ac11e 100644 --- a/src/plugins/languageclient/languageclient.qbs +++ b/src/plugins/languageclient/languageclient.qbs @@ -67,5 +67,10 @@ QtcPlugin { "snippet.h", ] + Properties { + condition: qbs.toolchain.contains("mingw") + cpp.cxxFlags: "-Wa,-mbig-obj" + } + Export { Depends { name: "LanguageServerProtocol" } } } From 3f647a4bc594bdaeb5c9f33b717c69196a440c5d Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 19 Oct 2023 11:30:17 +0200 Subject: [PATCH 1680/1777] Debugger: Fix lldb fetchFullBacktrace Change-Id: Ib0a513ecd6c0a0094797fe987aeaddc57d0b5149 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- share/qtcreator/debugger/lldbbridge.py | 4 ++-- src/plugins/debugger/lldb/lldbengine.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index da99546cec2..7b5c002b432 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -1836,11 +1836,11 @@ class Dumper(DumperBase): self.process.SetSelectedThreadByID(int(args['id'])) self.reportResult('', args) - def fetchFullBacktrace(self, _=None): + def fetchFullBacktrace(self, args): command = 'thread backtrace all' result = lldb.SBCommandReturnObject() self.debugger.GetCommandInterpreter().HandleCommand(command, result) - self.reportResult(self.hexencode(result.GetOutput()), {}) + self.reportResult('fulltrace="%s"' % self.hexencode(result.GetOutput()), args) def executeDebuggerCommand(self, args): self.reportToken(args) diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 9d1717fff54..12da7a86fc4 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -1030,8 +1030,8 @@ void LldbEngine::fetchDisassembler(DisassemblerAgent *agent) void LldbEngine::fetchFullBacktrace() { DebuggerCommand cmd("fetchFullBacktrace"); - cmd.callback = [](const DebuggerResponse &response) { - Internal::openTextEditor("Backtrace $", fromHex(response.data.data())); + cmd.callback = [](const DebuggerResponse &response) { + Internal::openTextEditor("Backtrace $", fromHex(response.data["fulltrace"].data())); }; runCommand(cmd); } From b3109755e67ee514b09063f1edc5e0f1fb0af51c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Thu, 19 Oct 2023 19:20:03 +0200 Subject: [PATCH 1681/1777] Tr: Fix some source texts Don't use exclamation marks! Add "the" articles (conforming to the other source texts). Finish error sentences with dot. Change-Id: I1faa547e2c3bae90ea900b781eccf327ea810326 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- share/qtcreator/translations/qtcreator_de.ts | 8 ++------ share/qtcreator/translations/qtcreator_fr.ts | 8 ++------ .../qtcreator/translations/qtcreator_zh_CN.ts | 4 +--- src/libs/extensionsystem/pluginmanager.cpp | 3 +-- src/plugins/docker/dockerdevice.cpp | 18 +++++++++--------- 5 files changed, 15 insertions(+), 26 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 57623ee8908..b16f1fe0ac9 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -28233,12 +28233,8 @@ zu deaktivieren, deaktiviert auch die folgenden Plugins: <translation>Hilfe > Plugins</translation> </message> <message> - <source>If you temporarily disable %1, the following plugins that depend on it are also disabled: %2. - -</source> - <translation>Wenn Sie %1 vorübergehend deaktivieren, werden die folgenden Plugins, die davon abhängen, auch deaktiviert: %2. - -</translation> + <source>If you temporarily disable %1, the following plugins that depend on it are also disabled: %2.</source> + <translation>Wenn Sie %1 vorübergehend deaktivieren, werden die folgenden Plugins, die davon abhängen, auch deaktiviert: %2.</translation> </message> <message> <source>Disable plugins permanently in %1.</source> diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index c050a6f3a0a..059f2e80e93 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -27836,12 +27836,8 @@ Raison : %3</translation> <translation>Aide > À propos des greffons</translation> </message> <message> - <source>If you temporarily disable %1, the following plugins that depend on it are also disabled: %2. - -</source> - <translation>Si vous désactivez temporairement %1, les greffons suivants qui en dépendent seront également désactivés : %2. - -</translation> + <source>If you temporarily disable %1, the following plugins that depend on it are also disabled: %2.</source> + <translation>Si vous désactivez temporairement %1, les greffons suivants qui en dépendent seront également désactivés : %2.</translation> </message> <message> <source>Disable plugins permanently in %1.</source> diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 92175bdf0c5..ff7a8e061ce 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -18505,9 +18505,7 @@ Rebuilding the project might help.</source> <translation type="unfinished"></translation> </message> <message> - <source>If you temporarily disable %1, the following plugins that depend on it are also disabled: %2. - -</source> + <source>If you temporarily disable %1, the following plugins that depend on it are also disabled: %2.</source> <translation type="unfinished"></translation> </message> <message> diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 84bea5b7bfa..1f86693f907 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -1540,8 +1540,7 @@ void PluginManagerPrivate::checkForProblematicPlugins() : Tr::tr("Help > About Plugins"); const QString otherPluginsText = Tr::tr("If you temporarily disable %1, the following plugins that depend on " - "it are also disabled: %2.\n\n") - .arg(spec->name(), dependentsList); + "it are also disabled: %2.").arg(spec->name(), dependentsList) + "\n\n"; const QString detailsText = (dependents.isEmpty() ? QString() : otherPluginsText) + Tr::tr("Disable plugins permanently in %1.").arg(pluginsMenu); const QString text = Tr::tr("The last time you started %1, it seems to have closed because " diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index c47de707914..386e0342fa6 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -220,7 +220,7 @@ DockerDeviceSettings::DockerDeviceSettings() }); cb(items); } else { - QStandardItem *errorItem = new QStandardItem(Tr::tr("Error!")); + QStandardItem *errorItem = new QStandardItem(Tr::tr("Error")); errorItem->setToolTip(result.error()); cb({errorItem}); } @@ -247,7 +247,7 @@ DockerDeviceSettings::DockerDeviceSettings() path = onDevicePath; } else { return make_unexpected( - Tr::tr("Path \"%1\" does not exist.").arg(onDevicePath.toUserOutput())); + Tr::tr("The path \"%1\" does not exist.").arg(onDevicePath.toUserOutput())); } } QString error; @@ -766,32 +766,32 @@ QStringList toMountArg(const DockerDevicePrivate::TemporaryMountInfo &mi) expected_str<void> isValidMountInfo(const DockerDevicePrivate::TemporaryMountInfo &mi) { if (mi.path.needsDevice()) - return make_unexpected(QString("Path \"%1\" is not local").arg(mi.path.toUserOutput())); + return make_unexpected(QString("The path \"%1\" is not local.").arg(mi.path.toUserOutput())); if (mi.path.isEmpty() && mi.containerPath.isEmpty()) - return make_unexpected(QString("Both paths are empty")); + return make_unexpected(QString("Both paths are empty.")); if (mi.path.isEmpty()) { - return make_unexpected(QString("Local path is empty, container path is \"%1\"") + return make_unexpected(QString("The local path is empty, the container path is \"%1\".") .arg(mi.containerPath.toUserOutput())); } if (mi.containerPath.isEmpty()) { return make_unexpected( - QString("Container path is empty, local path is \"%1\"").arg(mi.path.toUserOutput())); + QString("The container path is empty, the local path is \"%1\".").arg(mi.path.toUserOutput())); } if (!mi.path.isAbsolutePath() || !mi.containerPath.isAbsolutePath()) { - return make_unexpected(QString("Path \"%1\" or \"%2\" is not absolute") + return make_unexpected(QString("The path \"%1\" or \"%2\" is not absolute.") .arg(mi.path.toUserOutput()) .arg(mi.containerPath.toUserOutput())); } if (mi.containerPath.isRootPath()) - return make_unexpected(QString("Path \"%1\" is root").arg(mi.containerPath.toUserOutput())); + return make_unexpected(QString("The path \"%1\" is root.").arg(mi.containerPath.toUserOutput())); if (!mi.path.exists()) - return make_unexpected(QString("Path \"%1\" does not exist").arg(mi.path.toUserOutput())); + return make_unexpected(QString("The path \"%1\" does not exist.").arg(mi.path.toUserOutput())); return {}; } From 9df0571ff92f16a71a3d0682d0acf9a2b2d887ee Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 19 Oct 2023 09:47:00 +0200 Subject: [PATCH 1682/1777] VCS/macOS: Fix message box when closing submit editor When using the "Close" and "Cancel" standard buttons, it is no longer possible to change the button text on macOS. Additionally, the behavior on pressing <esc> is broken when using QtC in german (it should just close the dialog == cancel, but in german it triggers "close"). Task-number: QTBUG-118241 Change-Id: Ia35e6a29cd97fb91552dc5600f91be8b8e443f39 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/vcsbase/vcsbasesubmiteditor.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index 3b78546526e..ccf56e55d29 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -39,18 +39,19 @@ #include <projectexplorer/project.h> #include <projectexplorer/projectmanager.h> +#include <QAction> +#include <QApplication> +#include <QCompleter> #include <QDir> #include <QFileInfo> +#include <QMessageBox> #include <QPointer> #include <QProcess> +#include <QPushButton> #include <QSet> #include <QStringListModel> #include <QStyle> #include <QToolBar> -#include <QAction> -#include <QApplication> -#include <QMessageBox> -#include <QCompleter> #include <cstring> @@ -472,13 +473,12 @@ bool VcsBaseSubmitEditor::promptSubmit(VcsBasePluginPrivate *plugin) mb.setWindowTitle(plugin->commitAbortTitle()); mb.setIcon(QMessageBox::Warning); mb.setText(plugin->commitAbortMessage()); - mb.setStandardButtons(QMessageBox::Close | QMessageBox::Cancel); - // On Windows there is no mnemonic for Close. Set it explicitly. - mb.button(QMessageBox::Close)->setText(Tr::tr("&Close")); - mb.button(QMessageBox::Cancel)->setText(Tr::tr("&Keep Editing")); - mb.setDefaultButton(QMessageBox::Cancel); + QPushButton *closeButton = mb.addButton(Tr::tr("&Close"), QMessageBox::AcceptRole); + QPushButton *keepButton = mb.addButton(Tr::tr("&Keep Editing"), QMessageBox::RejectRole); + mb.setDefaultButton(keepButton); + mb.setEscapeButton(keepButton); mb.exec(); - return mb.result() == QMessageBox::Close; + return mb.clickedButton() == closeButton; } QString VcsBaseSubmitEditor::promptForNickName() From 1824db503e57467c4cc64fc5f21d4b16c9ec6702 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 5 Oct 2023 17:26:05 +0200 Subject: [PATCH 1683/1777] Utils: Restore original default DPI rounding policy Qt Creator 11.0.2 changed the default DPI rounding policy to "PassThrough" for Windows. In QtC 12, there is now a setting that allows the user to chose the policy. The default was changed to "PassThrough" also for Linux. This change sets the default back to the original policy "Round" which Qt Creator used from the beginnings of HighDPI support. Amends: 3726f0d6c1d05452f070b911683c51fe95df65c4 Change-Id: I74f2310f1b5379c8dea0bf86aee965374ca2732e Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/utils/stylehelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp index 506601e8260..b93481ef9d4 100644 --- a/src/libs/utils/stylehelper.cpp +++ b/src/libs/utils/stylehelper.cpp @@ -715,7 +715,7 @@ bool StyleHelper::isQDSTheme() Qt::HighDpiScaleFactorRoundingPolicy StyleHelper::defaultHighDpiScaleFactorRoundingPolicy() { return HostOsInfo::isMacHost() ? Qt::HighDpiScaleFactorRoundingPolicy::Unset - : Qt::HighDpiScaleFactorRoundingPolicy::PassThrough; + : Qt::HighDpiScaleFactorRoundingPolicy::Round; } QIcon StyleHelper::getIconFromIconFont(const QString &fontName, const QList<IconFontHelper> ¶meters) From fbe9f2c614e0a8cd07def34944dfc355abbafe29 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 19 Oct 2023 11:09:33 +0200 Subject: [PATCH 1684/1777] Docker/Tr: The state is "shut down", two words Change-Id: I62b47e4d3f7e9a0e22a086ee8db743bb004a0ac3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/docker/dockerdevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 386e0342fa6..7dc014eadaf 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -941,7 +941,7 @@ expected_str<void> DockerDevicePrivate::updateContainerAccess() } if (m_isShutdown) - return make_unexpected(Tr::tr("Device is shutdown")); + return make_unexpected(Tr::tr("Device is shut down")); if (DockerApi::isDockerDaemonAvailable(false).value_or(false) == false) return make_unexpected(Tr::tr("Docker system is not reachable")); From 32b6e6309e02369404b3a164d7c283a61f0312bd Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 20 Oct 2023 11:01:59 +0200 Subject: [PATCH 1685/1777] CMakePM: Remove remainders of extraGenerator It was not possible to set the toolset for Visual Studio 2022 generator. Amends 4f26d802ca863d90d213813d7117cdc179ab4336 Change-Id: I56caf9c0d66812eb599646a3679602af7372f419 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakekitaspect.cpp | 7 ++----- src/plugins/cmakeprojectmanager/cmaketool.cpp | 4 ++-- src/plugins/cmakeprojectmanager/cmaketool.h | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp index c18d047e613..6c112f01d5c 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp @@ -503,11 +503,9 @@ class GeneratorInfo public: GeneratorInfo() = default; GeneratorInfo(const QString &generator_, - const QString &extraGenerator_ = QString(), const QString &platform_ = QString(), const QString &toolset_ = QString()) : generator(generator_) - , extraGenerator(extraGenerator_) , platform(platform_) , toolset(toolset_) {} @@ -747,7 +745,7 @@ Tasks CMakeGeneratorKitAspectFactory::validate(const Kit *k) const const GeneratorInfo info = generatorInfo(k); QList<CMakeTool::Generator> known = tool->supportedGenerators(); auto it = std::find_if(known.constBegin(), known.constEnd(), [info](const CMakeTool::Generator &g) { - return g.matches(info.generator, info.extraGenerator); + return g.matches(info.generator); }); if (it == known.constEnd()) { addWarning(Tr::tr("CMake Tool does not support the configured generator.")); @@ -786,7 +784,7 @@ void CMakeGeneratorKitAspectFactory::fix(Kit *k) QList<CMakeTool::Generator> known = tool->supportedGenerators(); auto it = std::find_if(known.constBegin(), known.constEnd(), [info](const CMakeTool::Generator &g) { - return g.matches(info.generator, info.extraGenerator); + return g.matches(info.generator); }); if (it == known.constEnd()) { GeneratorInfo dv; @@ -794,7 +792,6 @@ void CMakeGeneratorKitAspectFactory::fix(Kit *k) setGeneratorInfo(k, dv); } else { const GeneratorInfo dv(isIos(k) ? QString("Xcode") : info.generator, - info.extraGenerator, it->supportsPlatform ? info.platform : QString(), it->supportsToolset ? info.toolset : QString()); setGeneratorInfo(k, dv); diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index a24114bb352..f49df2083b3 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -45,9 +45,9 @@ const char CMAKE_INFORMATION_AUTODETECTED[] = "AutoDetected"; const char CMAKE_INFORMATION_DETECTIONSOURCE[] = "DetectionSource"; const char CMAKE_INFORMATION_READERTYPE[] = "ReaderType"; -bool CMakeTool::Generator::matches(const QString &n, const QString &ex) const +bool CMakeTool::Generator::matches(const QString &n) const { - return n == name && (ex.isEmpty() || extraGenerators.contains(ex)); + return n == name; } namespace Internal { diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index c9bc6e02e3c..0fa06e5ca14 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -63,7 +63,7 @@ public: bool supportsPlatform = true; bool supportsToolset = true; - bool matches(const QString &n, const QString &ex = QString()) const; + bool matches(const QString &n) const; }; using PathMapper = std::function<Utils::FilePath (const Utils::FilePath &)>; From fb788dec30bc6638138c880ad5c41907c7c39264 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 20 Oct 2023 11:56:01 +0200 Subject: [PATCH 1686/1777] Doc: Describe new and changed preferences in C++ > Clangd Task-number: QTCREATORBUG-29392 Change-Id: I54c56b65a531bccd233f5405c3add4f0dc4c18ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../images/qtcreator-options-clangd.png | Bin 16621 -> 0 bytes .../images/qtcreator-preferences-clangd.webp | Bin 0 -> 11832 bytes .../creator-only/creator-clang-codemodel.qdoc | 16 +++++++++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) delete mode 100644 doc/qtcreator/images/qtcreator-options-clangd.png create mode 100644 doc/qtcreator/images/qtcreator-preferences-clangd.webp diff --git a/doc/qtcreator/images/qtcreator-options-clangd.png b/doc/qtcreator/images/qtcreator-options-clangd.png deleted file mode 100644 index a4251e7be8f09933d2dbef50a41ac04ad5b080ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16621 zcmeAS@N?(olHy`uVBq!ia0y~yVA5e=U~1-IVqjp{7Jsajfx%&mr;B4q#jUq<z58X{ zt1`BJFDo-SqjuHzWPkQXPp>WQyyv&vNt^t4(UnP__78R*5KUOfnbCDiVgsYJ1iy<@ zaLeAE(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H~!STnQb%=05h z=CwYqbvd4Q%ULJv%YoT9Ca0ZY4>~@7hER2Z_X9D$?~Ok1)L!xzFfqJX+p^1Hxm*P^ z1A|9~<1;1(1{IU({$jrmNHZ|p&;bp?f<|Rg3RuvnEan_ITnT7w7032Xly)0j1E|mj knc1)b)a(m8^q>9m_3-DOYF}3~FfcH9y85}Sb4q9e08)CU0RR91 diff --git a/doc/qtcreator/images/qtcreator-preferences-clangd.webp b/doc/qtcreator/images/qtcreator-preferences-clangd.webp new file mode 100644 index 0000000000000000000000000000000000000000..6d363c02f930dba521b073ff07e696cbf99c206b GIT binary patch literal 11832 zcmWIYbaOM%V_*n(bqWXzu<%jVV_?wFbXv{u^~L`G@26h&_!Xb_xopOqVm{f{f>#f6 zCMEussGeNLzUQF5zk%)S>78~-#q%6~*6;X#ao*nZ&wp3Wt9~DRbZ@`2V)2S;cYUVR ztP1fkU7dU`pl{2Y#(lY~k4hA0w6pe4u*%%%b%llHit~gEDzlR<uW#F%`{}~OYaa1c zZfo2;_3bZ2tGzllP17eQXYb@J&v-SfX&=*f)hM`bzw`J1e7B!_HcD@6Zk|*6i9>PY zce|HY?#?-P^5oik&z{s@+bvXQ|K{!#`N^#|Uh|g!-=}bU-R)c3);1Y#X_7Ju&lS)) zr4*6Q+_HXsi%!(N&V36nmTm}I)6{Zm_V0ai_Y@;zWZ#RtZ`jXdHuYn<>7v323IB`i zAx4ko{(s$nGvj{m1{opk+uvok%vhgYq8h_*HnnrT=wlr|?#G(H8obi(2>*?5ycfgA zInDgIZrUT~4{{q;+Sq+Gf4b2^r)T*KX04fp_I8GLvs4zFeO{G%_4lhhq4w5~BDD^x zChx-KKb-V>(Z=Hav@WPbSUg9-W1ql{JZJO02X>jByfG&r$ncZgt?17N6aHM=P;p*j z%J&V*8fxb0&Ti-Z&i{6JW*dGnqwAEkqvHF&{mXxzjjwjBFH#8cIC^I?PmgIkld|B} zx-AnK?f2d1HL*-sz~kKKbi3L<Ss)?8yRC<%cIAh!M*<gq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dm0d5x=FV`6%~VtJvdd?ZUq4I~!epujV{Dd0wrEZ_TdW)1ikgLWJeS^b3>M{L2)m zsFb;^IK^$X<W2X0D_V<IF3ylnHZ_iDejwO?^-(6fAVcImai-hP_TEuh;rb=O*)uWV z-gU_p%HRBooZ5mcFQ1hB>An0Yn^uGQQ_HuC$A7)}7!^=>E7n&-tm<2!$w$G`MdAzj zZav*#F4Q5I<;c(L6!YnH3CB{wthTRuXCl|0y4O8x#nKSjh)j{5iKZMk%_n8_td`A? z6Z(9d<66n2%cncyp1oRDxLq%#d(Esat-hVR*6gXsTE>xWc&u!K%(aq9-3rO=nL7ha zQ!BQ_rd$m%DSTk<=4oRZ+_F_-q3n%j-MLSMUK*!2Sp}Ub=~^@E)1%Jhgo$+tLf&U@ zgms_X#yq_&?Z4yC3{$J`vz>0w?Vc-d`8j0ji^^46Rvs^{N^C<*H8ZRxUoEcF+u`Pa ziSPP}n|q|*dYQ!(>-YFwIb(G*;k)n~9@Wf}7J)Bu#fIhQfA6xKbuK{4a@{k<&#US; zuag&h`7AW~17GZ-|C7CU&i*bi`{k20&&A$8d#b&qS%gdR?(>*i>c>D8@%h>h7F&u~ F7yuj1^Opbs literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc index cd7a71f3d70..0edfdcc22c7 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc @@ -161,7 +161,7 @@ \list 1 \li Select \preferences > \uicontrol C++ > \uicontrol Clangd > \uicontrol {Use clangd}. - \image qtcreator-options-clangd.png "clangd preferences" + \image qtcreator-preferences-clangd.webp "Clangd preferences" \li In \uicontrol {Path to executable}, enter the path to clangd version 14, or later. \li In the \uicontrol {Background indexing} field, select \uicontrol Off @@ -169,15 +169,25 @@ by default. You can set the indexing priority depending on whether the accuracy of results or speed is more important to you during global symbol searches. + \li In \uicontrol {Header/source switch mode}, select the C/C++ + backend for switching between header and source files. While the + clangd implementation has more capabilities than the built-in + code model, it tends to find false positives. \uicontrol {Try Both} + uses clangd if the built-in code model does not find anything. \li By default, clangd attempts to use all unused cores. You can set a fixed number of cores to use in \uicontrol {Worker thread count}. Background indexing also uses this many worker threads. - \li Select \uicontrol {Insert header files on completion} to allow - clangd to insert header files as part of symbol completion. \li Set the number of \uicontrol {Completion results} if you regularly miss important results during code completion. Set it to 0 to remove the limit on the number of completion results. Setting this to 0 or a very high number can make code completion slow. + \li In \uicontrol {Completion ranking model}, select the clangd model to + use for ranking completion suggestions. This determines their order + in the selection list. The \uicontrol {Decision Forest} model + (\uicontrol Default) results from pre-trained machine learning + and usually provides better results than the hand-crafted + \uicontrol Heuristic model. Select the latter if the completion + suggestions stray too much from your expectations for your code base. \li In \uicontrol {Document update threshold}, specify the amount of time \QC waits before sending document changes to the server. If the document changes again while waiting, this timeout is reset. From 26b2a755a81bc5b26f7a59f0a87362c6dc80d353 Mon Sep 17 00:00:00 2001 From: Ludovic Le Brun <ludovic.lebrun310@gmail.com> Date: Wed, 18 Oct 2023 19:02:58 +0200 Subject: [PATCH 1687/1777] Fix install .so plugins Remove the period from the file extension .so because the completeSuffix function of the FilePath class does not return the first period of the extension. Change-Id: Ifd850e54337c399d6440b6ad765c3b23df9ed330 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/coreplugin/plugininstallwizard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/plugininstallwizard.cpp b/src/plugins/coreplugin/plugininstallwizard.cpp index 85f2f3effef..9a0b92c871e 100644 --- a/src/plugins/coreplugin/plugininstallwizard.cpp +++ b/src/plugins/coreplugin/plugininstallwizard.cpp @@ -58,7 +58,7 @@ static QStringList libraryNameFilter() static bool hasLibSuffix(const FilePath &path) { return (HostOsInfo::isWindowsHost() && path.endsWith(".dll")) - || (HostOsInfo::isLinuxHost() && path.completeSuffix().startsWith(".so")) + || (HostOsInfo::isLinuxHost() && path.completeSuffix().startsWith("so")) || (HostOsInfo::isMacHost() && path.endsWith(".dylib")); } From fe129cc0c4c098532e89bc046968caaca82d9f81 Mon Sep 17 00:00:00 2001 From: hjk <hjk@qt.io> Date: Tue, 17 Oct 2023 17:30:17 +0200 Subject: [PATCH 1688/1777] CMake: Reduce number of FilePath conversions in fileapidataextractor.cpp Change-Id: If143843782b0bfdbdd68ab1a387d0feabfb60a33 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- .../fileapidataextractor.cpp | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 13a240d4e85..aa53ff0437f 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -420,21 +420,13 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture QStringList fragments = splitFragments(ci.fragments); // Get all sources from the compiler group, except generated sources - QStringList sources; - auto addToSources = [sourceDirectory, &sources](const QString &source) { - const FilePath sourcePath = FilePath::fromString(source); - if (sourcePath.isAbsolutePath()) - sources.push_back(source); - else - sources.push_back( - sourceDirectory.pathAppended(source).absoluteFilePath().path()); - }; + FilePaths sources; for (auto idx: ci.sources) { SourceInfo si = t.sources.at(idx); if (si.isGenerated) continue; - addToSources(si.path); + sources.append(sourceDirectory.resolvePath(si.path)); } // Skip groups with only generated source files e.g. <build-dir>/.rcc/qrc_<target>.cpp @@ -442,12 +434,12 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture continue; // If we are not in a pch compiler group, add all the headers that are not generated - const bool hasPchSource = anyOf(sources, [buildDirectory](const QString &path) { - return isPchFile(buildDirectory, FilePath::fromString(path)); + const bool hasPchSource = anyOf(sources, [buildDirectory](const FilePath &path) { + return isPchFile(buildDirectory, path); }); - const bool hasUnitySources = allOf(sources, [buildDirectory](const QString &path) { - return isUnityFile(buildDirectory, FilePath::fromString(path)); + const bool hasUnitySources = allOf(sources, [buildDirectory](const FilePath &path) { + return isUnityFile(buildDirectory, path); }); QString headerMimeType; @@ -469,19 +461,20 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture const bool sourceUnityType = hasUnitySources ? mime.inherits(sourceMimeType) : false; if (headerType || sourceUnityType) - addToSources(si.path); + sources.append(sourceDirectory.resolvePath(si.path)); } } } - sources.removeDuplicates(); + FilePath::removeDuplicates(sources); // Set project files except pch / unity files - rpp.setFiles(Utils::filtered(sources, - [buildDirectory](const QString &path) { - const FilePath filePath = FilePath::fromString(path); + const FilePaths filtered = Utils::filtered(sources, + [buildDirectory](const FilePath &filePath) { return !isPchFile(buildDirectory, filePath) && !isUnityFile(buildDirectory, filePath); - }), + }); + + rpp.setFiles(Utils::transform(filtered, &FilePath::toFSPathString), {}, [headerMimeType](const QString &path) { // Similar to ProjectFile::classify but classify headers with language From 5f45c36b6f665babe67d3cb0c805a13ee1e3ef2c Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 20 Oct 2023 09:03:09 +0200 Subject: [PATCH 1689/1777] TextEditor: do not scroll to cursor postion on select all Since Qt 6.5.1 QPlainTextEdit::selectAll emits correctly cursorPositionChanged on selectAll which calls some multitextcursor update code on our side. Avoid setting the cursor back to the QPlainTextEdit in this update code by setting the expected MultiTextCursor before calling selectAll. Fixes: QTCREATORBUG-29763 Change-Id: I77f05ac40a9dd126efcd72089a699c908c68da21 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/texteditor/texteditor.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 66e3616af91..4a87ecc62af 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -8038,10 +8038,12 @@ void TextEditorWidget::cut() void TextEditorWidget::selectAll() { - QPlainTextEdit::selectAll(); // Directly update the internal multi text cursor here to prevent calling setTextCursor. - // This would indirectly makes sure the cursor is visible which is not desired for select all. - const_cast<MultiTextCursor &>(d->m_cursors).setCursors({QPlainTextEdit::textCursor()}); + // This would indirectly make sure the cursor is visible which is not desired for select all. + QTextCursor c = QPlainTextEdit::textCursor(); + c.select(QTextCursor::Document); + const_cast<MultiTextCursor &>(d->m_cursors).setCursors({c}); + QPlainTextEdit::selectAll(); } void TextEditorWidget::copy() From a18ea390e1cf4f4f300053abb3b7328f99145335 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Fri, 20 Oct 2023 10:53:59 +0200 Subject: [PATCH 1690/1777] LanguageClient: Fix crashed client restart condition Change-Id: I4b0195a512b6b1dcbcc6fd02f6014a27b4606ea0 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/languageclient/client.cpp | 4 +++- src/plugins/languageclient/client.h | 1 + src/plugins/languageclient/languageclientmanager.cpp | 3 ++- src/plugins/qmljseditor/qmljseditordocument.cpp | 1 + src/plugins/qmljseditor/qmllsclient.cpp | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 2fcfc0210fc..7583b065988 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -574,6 +574,8 @@ QString Client::stateString() const //: language client state case InitializeRequested: return Tr::tr("initialize requested"); //: language client state + case FailedToInitialize: return Tr::tr("failed to initialize"); + //: language client state case Initialized: return Tr::tr("initialized"); //: language client state case ShutdownRequested: return Tr::tr("shutdown requested"); @@ -1696,7 +1698,7 @@ bool ClientPrivate::reset() void Client::setError(const QString &message) { log(message); - d->m_state = Error; + d->m_state = d->m_state < Initialized ? FailedToInitialize : Error; } ProgressManager *Client::progressManager() diff --git a/src/plugins/languageclient/client.h b/src/plugins/languageclient/client.h index da8c8166644..aba2b996754 100644 --- a/src/plugins/languageclient/client.h +++ b/src/plugins/languageclient/client.h @@ -77,6 +77,7 @@ public: enum State { Uninitialized, InitializeRequested, + FailedToInitialize, Initialized, ShutdownRequested, Shutdown, diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index 839ececce7c..bb655e2d8f8 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -172,7 +172,8 @@ void LanguageClientManager::clientFinished(Client *client) = managerInstance->m_clientForDocument.keys(client); if (unexpectedFinish) { if (!PluginManager::isShuttingDown()) { - if (client->state() == Client::Initialized && client->reset()) { + const bool shouldRestart = client->state() > Client::FailedToInitialize; + if (shouldRestart && client->reset()) { qCDebug(Log) << "restart unexpectedly finished client: " << client->name() << client; client->log( Tr::tr("Unexpectedly finished. Restarting in %1 seconds.").arg(restartTimeoutS)); diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 065e39e0c37..37f49d08712 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -784,6 +784,7 @@ void QmlJSEditorDocumentPrivate::settingsChanged() case LanguageClient::Client::State::Initialized: setSourcesWithCapabilities(client->capabilities()); break; + case LanguageClient::Client::State::FailedToInitialize: case LanguageClient::Client::State::Error: qCWarning(qmllsLog) << "qmlls" << newQmlls << "requested for document" << q->filePath() << "had errors, skipping setSourcesWithCababilities"; diff --git a/src/plugins/qmljseditor/qmllsclient.cpp b/src/plugins/qmljseditor/qmllsclient.cpp index 6777f267cc1..4cc8769bb1b 100644 --- a/src/plugins/qmljseditor/qmllsclient.cpp +++ b/src/plugins/qmljseditor/qmllsclient.cpp @@ -39,6 +39,7 @@ QmllsClient *QmllsClient::clientForQmlls(const FilePath &qmlls) case Client::State::InitializeRequested: case Client::State::Initialized: return client; + case Client::State::FailedToInitialize: case Client::State::ShutdownRequested: case Client::State::Shutdown: case Client::State::Error: From 3d77369e4c714a9af4586c86f5ed4d7abcee6dba Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Thu, 19 Oct 2023 17:38:35 +0200 Subject: [PATCH 1691/1777] ClangTools: Fix clang-tidy documentationUrl for version 17.x.x Amends 51a650f30b0d75129b3eb77ed7b7d38a07cf810e Fixes: QTCREATORBUG-29782 Change-Id: I4ce740900beb718d9628c35042b3467ec23de8d3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/clangtools/clangtoolsutils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/clangtools/clangtoolsutils.cpp b/src/plugins/clangtools/clangtoolsutils.cpp index 1ad142fd459..029a879ce11 100644 --- a/src/plugins/clangtools/clangtoolsutils.cpp +++ b/src/plugins/clangtools/clangtoolsutils.cpp @@ -316,7 +316,7 @@ static QVersionNumber fixupVersion(const VersionAndSuffix &versionAndSuffix) version = QVersionNumber(12); // Version 17.0.0 was never released due to a git issue - if (version == QVersionNumber(17)) + if (version.majorVersion() == 17) version = QVersionNumber(17, 0, 1); return version; From 19511eaf1a4eff9f26d21c8dfba5f55374a2baa6 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Fri, 20 Oct 2023 13:04:32 +0200 Subject: [PATCH 1692/1777] BuildManager: Don't stop the run control being started Fixes: QTCREATORBUG-29689 Change-Id: I65b5b6e94176ae2dcf09374755b4c3d70e844a3c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/clangtools/clangtool.cpp | 19 ++++++++++++------- src/plugins/projectexplorer/buildmanager.cpp | 13 +++++++++---- src/plugins/projectexplorer/buildmanager.h | 5 +++-- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index 2e3a5c3ae5d..c25108a4185 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -70,16 +70,20 @@ static Q_LOGGING_CATEGORY(LOG, "qtc.clangtools.runcontrol", QtWarningMsg) namespace ClangTools::Internal { -class ProjectBuilderTaskAdapter : public TaskAdapter<QPointer<Target>> +class ProjectBuilderTaskAdapter : public TaskAdapter<QPointer<RunControl>> { public: void start() final { connect(BuildManager::instance(), &BuildManager::buildQueueFinished, this, &TaskInterface::done); - Target *target = *task(); + RunControl *runControl = *task(); + QTC_ASSERT(runControl, emit done(false); return); + Target *target = runControl->target(); QTC_ASSERT(target, emit done(false); return); - if (!BuildManager::isBuilding(target)) - BuildManager::buildProjectWithDependencies(target->project()); + if (!BuildManager::isBuilding(target)) { + BuildManager::buildProjectWithDependencies(target->project(), ConfigSelection::Active, + runControl); + } } }; @@ -678,10 +682,11 @@ Group ClangTool::runRecipe(const RunSettings &runSettings, QList<GroupItem> topTasks { onGroupSetup(onTopSetup) }; if (buildBeforeAnalysis) { - const auto onSetup = [target](QPointer<Target> &buildTarget) { - buildTarget = target; + QPointer<RunControl> runControl(m_runControl); + const auto onSetup = [runControl](QPointer<RunControl> &buildRunControl) { + buildRunControl = runControl; }; - const auto onError = [this](const QPointer<Target> &) { + const auto onError = [this](const QPointer<RunControl> &) { const QString message(Tr::tr("Failed to build the project.")); m_infoBarWidget->setError(InfoBarWidget::Error, message, [this] { showOutputPane(); }); m_runControl->postMessage(message, ErrorMessageFormat); diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index dcb0bdf87ff..6c74b5cf828 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -106,7 +106,8 @@ static const QList<BuildConfiguration *> buildConfigsForSelection(const Target * } static int queue(const QList<Project *> &projects, const QList<Id> &stepIds, - ConfigSelection configSelection, const RunConfiguration *forRunConfig = nullptr) + ConfigSelection configSelection, const RunConfiguration *forRunConfig = nullptr, + RunControl *starter = nullptr) { if (!ProjectExplorerPlugin::saveModifiedFiles()) return -1; @@ -117,7 +118,10 @@ static int queue(const QList<Project *> &projects, const QList<Id> &stepIds, StopBeforeBuild stopCondition = settings.stopBeforeBuild; if (stopCondition == StopBeforeBuild::SameApp && !forRunConfig) stopCondition = StopBeforeBuild::SameBuildDir; - const auto isStoppableRc = [&projects, stopCondition, configSelection, forRunConfig](RunControl *rc) { + const auto isStoppableRc = [&projects, stopCondition, configSelection, forRunConfig, + starter](RunControl *rc) { + if (rc == starter) + return false; if (!rc->isRunning()) return false; @@ -354,10 +358,11 @@ void BuildManager::rebuildProjectWithoutDependencies(Project *project) ConfigSelection::Active); } -void BuildManager::buildProjectWithDependencies(Project *project, ConfigSelection configSelection) +void BuildManager::buildProjectWithDependencies(Project *project, ConfigSelection configSelection, + RunControl *starter) { queue(ProjectManager::projectOrder(project), {Id(Constants::BUILDSTEPS_BUILD)}, - configSelection); + configSelection, nullptr, starter); } void BuildManager::cleanProjectWithDependencies(Project *project, ConfigSelection configSelection) diff --git a/src/plugins/projectexplorer/buildmanager.h b/src/plugins/projectexplorer/buildmanager.h index 3ad4c84afd2..ec068615ab5 100644 --- a/src/plugins/projectexplorer/buildmanager.h +++ b/src/plugins/projectexplorer/buildmanager.h @@ -14,6 +14,7 @@ namespace ProjectExplorer { class BuildItem; class Project; class RunConfiguration; +class RunControl; class Task; enum class BuildForRunConfigStatus { Building, NotBuilding, BuildFailed }; @@ -33,8 +34,8 @@ public: static void buildProjectWithoutDependencies(Project *project); static void cleanProjectWithoutDependencies(Project *project); static void rebuildProjectWithoutDependencies(Project *project); - static void buildProjectWithDependencies( - Project *project, ConfigSelection configSelection = ConfigSelection::Active); + static void buildProjectWithDependencies(Project *project, + ConfigSelection configSelection = ConfigSelection::Active, RunControl *starter = nullptr); static void cleanProjectWithDependencies(Project *project, ConfigSelection configSelection); static void rebuildProjectWithDependencies(Project *project, ConfigSelection configSelection); static void buildProjects(const QList<Project *> &projects, ConfigSelection configSelection); From 531fe36ac56ec93d37fe9e554a987459d4528057 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 20 Oct 2023 08:22:13 +0200 Subject: [PATCH 1693/1777] CMakePM: Silence warning This is not handling the respective role correctly, just silencing the warning. No change in current functionality. Change-Id: Icd904941d5fc496d66b8e1eb7eec0031840f519d Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp index b26f9a70b5b..7d017d5d86a 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp @@ -174,6 +174,9 @@ QVariant CMakeTargetNode::data(Id role) const if (role == Ios::Constants::IosCmakeGenerator) return value("CMAKE_GENERATOR"); + if (role == ProjectExplorer::Constants::QT_KEYWORDS_ENABLED) // FIXME handle correctly + return value(role.toString().toUtf8()); + QTC_ASSERT(false, qDebug() << "Unknown role" << role.toString()); // Better guess than "not present". return value(role.toString().toUtf8()); From 73d0c4a29db71f8f95591f99023b3dc936346abc Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 20 Oct 2023 08:18:47 +0200 Subject: [PATCH 1694/1777] AutoTest: Tweak Test Case wizard We now support Catch2 in two different versions which means we need different include directives depending on the version. Let the user choose the correct version instead of providing a fixed one that may be correct or not. Change-Id: I0199070b4f4602b8e08b7ac60731071f0cd33141 Reviewed-by: David Schulz <david.schulz@qt.io> --- .../templates/wizards/files/testing/file.cpp | 6 +++++- .../wizards/files/testing/wizard.json | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/templates/wizards/files/testing/file.cpp b/share/qtcreator/templates/wizards/files/testing/file.cpp index 981fd0478e7..de5539dc022 100644 --- a/share/qtcreator/templates/wizards/files/testing/file.cpp +++ b/share/qtcreator/templates/wizards/files/testing/file.cpp @@ -24,8 +24,12 @@ BOOST_AUTO_TEST_CASE( %{TestCaseName} ) BOOST_AUTO_TEST_SUITE_END() @endif -@if "%{TestFrameWork}" == "Catch2" +@if "%{TestFrameWork}" == "Catch2" +@if "%{Catch2Version}" == "V2" #include <catch2/catch.hpp> +@else +#include <catch2/catch_test_macros.hpp> +@endif TEST_CASE("Another test with Catch2", "[fancy]") { diff --git a/share/qtcreator/templates/wizards/files/testing/wizard.json b/share/qtcreator/templates/wizards/files/testing/wizard.json index 8a5bb84bf56..e15997abf0a 100644 --- a/share/qtcreator/templates/wizards/files/testing/wizard.json +++ b/share/qtcreator/templates/wizards/files/testing/wizard.json @@ -61,6 +61,26 @@ ] } }, + { + "name": "Catch2Version", + "trDisplayName": "Catch2 version:", + "visible": "%{JS: value('TestFrameWork') == 'Catch2'}", + "type": "ComboBox", + "data": { + "index": 1, + "items": + [ + { + "trKey": "2.x", + "value": "V2" + }, + { + "trKey": "3.x", + "value": "V3" + } + ] + } + }, { "name": "TestSuiteName", "trDisplayName": "Test suite name:", From 60de12efd2cc3afeea140746d757989ed0f9873b Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 20 Oct 2023 14:42:46 +0200 Subject: [PATCH 1695/1777] CMakePM: clang-tidy fix for "performance-unnecessary-value-param" Change-Id: Ia22d7c3fe6c29a5e0999145b6c4b281818dd72bf Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 2 +- src/plugins/cmakeprojectmanager/cmaketool.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 40562776967..ed81a8fea95 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1098,7 +1098,7 @@ static bool isWindowsARM64(const Kit *k) && targetAbi.wordWidth() == 64; } -static CommandLine defaultInitialCMakeCommand(const Kit *k, const QString buildType) +static CommandLine defaultInitialCMakeCommand(const Kit *k, const QString &buildType) { // Generator: CMakeTool *tool = CMakeKitAspect::cmakeTool(k); diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index f49df2083b3..e50cecc821b 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -656,7 +656,7 @@ void CMakeTool::fetchFromCapabilities(bool ignoreCache) const QTC_ASSERT_EXPECTED(result, return); } -static int getVersion(const QVariantMap &obj, const QString value) +static int getVersion(const QVariantMap &obj, const QString &value) { bool ok; int result = obj.value(value).toInt(&ok); From 43121fa574c2de4c8b5268e707104552894aab9e Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 20 Oct 2023 14:46:33 +0200 Subject: [PATCH 1696/1777] CMakePM: clang-tidy fix for 'perf*-unnecessary-copy-initialization' Change-Id: I9c407f7254328e7278096239f6f3946c34e873d5 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp | 6 +++--- src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp | 2 +- src/plugins/cmakeprojectmanager/cmaketool.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp b/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp index 2646c5c5808..b02b2e779c0 100644 --- a/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp @@ -372,9 +372,9 @@ CMakeConfig CMakeConfig::fromFile(const Utils::FilePath &cacheFile, QString *err continue; QTC_ASSERT(pieces.size() == 3, continue); - const QByteArray key = pieces.at(0); - const QByteArray type = pieces.at(1); - const QByteArray value = pieces.at(2); + const QByteArray &key = pieces.at(0); + const QByteArray &type = pieces.at(1); + const QByteArray &value = pieces.at(2); if (key.endsWith("-ADVANCED") && value == "1") { advancedSet.insert(key.left(key.size() - 9 /* "-ADVANCED" */)); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index 583729ee933..74d5056bf78 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -1085,7 +1085,7 @@ void CMakeProjectImporter::persistTemporaryCMake(Kit *k, const QVariantList &vl) if (vl.isEmpty()) return; // No temporary CMake QTC_ASSERT(vl.count() == 1, return); - const QVariant data = vl.at(0); + const QVariant &data = vl.at(0); CMakeTool *tmpCmake = CMakeToolManager::findById(Id::fromSetting(data)); CMakeTool *actualCmake = CMakeKitAspect::cmakeTool(k); diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index e50cecc821b..f9d7149a344 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -490,7 +490,7 @@ void CMakeTool::parseFunctionDetailsOutput(const QString &output) const QStringList lines = output.split('\n'); for (int i = 0; i < lines.count(); ++i) { - const QString line = lines.at(i); + const QString &line = lines.at(i); if (line == "::") { expectDefinition = true; From 69815af272d40092db04cb452f06e02315e265c6 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 20 Oct 2023 14:51:43 +0200 Subject: [PATCH 1697/1777] CMakePM: clang-tidy fix for 'performance-implicit-conversion-in-loop' Change-Id: I67e5adad19a3454986381c5548bbe96cf1cc1e6a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 2 +- .../cmakeprojectmanager/fileapiparser.cpp | 18 +++++++++--------- .../cmakeprojectmanager/presetsparser.cpp | 18 +++++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 57c7cda2961..7f7ebccdd0a 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1521,7 +1521,7 @@ void CMakeBuildSystem::runCTest() const QJsonArray nodes = btGraph.value("nodes").toArray(); const QJsonArray tests = jsonObj.value("tests").toArray(); int counter = 0; - for (const QJsonValue &testVal : tests) { + for (const auto &testVal : tests) { ++counter; const QJsonObject test = testVal.toObject(); QTC_ASSERT(!test.isEmpty(), continue); diff --git a/src/plugins/cmakeprojectmanager/fileapiparser.cpp b/src/plugins/cmakeprojectmanager/fileapiparser.cpp index 943bebc1c18..e70ed3ced7a 100644 --- a/src/plugins/cmakeprojectmanager/fileapiparser.cpp +++ b/src/plugins/cmakeprojectmanager/fileapiparser.cpp @@ -91,7 +91,7 @@ std::vector<int> indexList(const QJsonValue &v) std::vector<int> result; result.reserve(static_cast<size_t>(indexList.count())); - for (const QJsonValue &v : indexList) { + for (const auto &v : indexList) { result.push_back(v.toInt(-1)); } return result; @@ -139,7 +139,7 @@ static ReplyFileContents readReplyFile(const FilePath &filePath, QString &errorM bool hadInvalidObject = false; { const QJsonArray objects = rootObject.value("objects").toArray(); - for (const QJsonValue &v : objects) { + for (const auto &v : objects) { const QJsonObject object = v.toObject(); { ReplyObject r; @@ -178,7 +178,7 @@ static CMakeConfig readCacheFile(const FilePath &cacheFile, QString &errorMessag } const QJsonArray entries = root.value("entries").toArray(); - for (const QJsonValue &v : entries) { + for (const auto &v : entries) { CMakeConfigItem item; const QJsonObject entry = v.toObject(); @@ -190,7 +190,7 @@ static CMakeConfig readCacheFile(const FilePath &cacheFile, QString &errorMessag { const QJsonArray properties = entry.value("properties").toArray(); - for (const QJsonValue &v : properties) { + for (const auto &v : properties) { const QJsonObject prop = v.toObject(); auto nv = nameValue(prop); if (nv.first == "ADVANCED") { @@ -223,7 +223,7 @@ static std::vector<CMakeFileInfo> readCMakeFilesFile(const FilePath &cmakeFilesF } const QJsonArray inputs = root.value("inputs").toArray(); - for (const QJsonValue &v : inputs) { + for (const auto &v : inputs) { CMakeFileInfo info; const QJsonObject input = v.toObject(); info.path = cmakeFilesFile.withNewPath(input.value("path").toString()); @@ -253,7 +253,7 @@ std::vector<Directory> extractDirectories(const QJsonArray &directories, QString } std::vector<Directory> result; - for (const QJsonValue &v : directories) { + for (const auto &v : directories) { const QJsonObject obj = v.toObject(); if (obj.isEmpty()) { errorMessage = Tr::tr( @@ -283,7 +283,7 @@ static std::vector<Project> extractProjects(const QJsonArray &projects, QString } std::vector<Project> result; - for (const QJsonValue &v : projects) { + for (const auto &v : projects) { const QJsonObject obj = v.toObject(); if (obj.isEmpty()) { qCDebug(cmakeFileApi) << "Empty project skipped!"; @@ -314,7 +314,7 @@ static std::vector<Project> extractProjects(const QJsonArray &projects, QString static std::vector<Target> extractTargets(const QJsonArray &targets, QString &errorMessage) { std::vector<Target> result; - for (const QJsonValue &v : targets) { + for (const auto &v : targets) { const QJsonObject obj = v.toObject(); if (obj.isEmpty()) { errorMessage = Tr::tr( @@ -436,7 +436,7 @@ static std::vector<Configuration> extractConfigurations(const QJsonArray &config } std::vector<FileApiDetails::Configuration> result; - for (const QJsonValue &v : configs) { + for (const auto &v : configs) { const QJsonObject obj = v.toObject(); if (obj.isEmpty()) { errorMessage = Tr::tr( diff --git a/src/plugins/cmakeprojectmanager/presetsparser.cpp b/src/plugins/cmakeprojectmanager/presetsparser.cpp index 91943b02f7d..3befe4d99d8 100644 --- a/src/plugins/cmakeprojectmanager/presetsparser.cpp +++ b/src/plugins/cmakeprojectmanager/presetsparser.cpp @@ -44,7 +44,7 @@ std::optional<QStringList> parseInclude(const QJsonValue &jsonValue) if (jsonValue.isArray()) { includes = QStringList(); const QJsonArray includeArray = jsonValue.toArray(); - for (const QJsonValue &includeValue : includeArray) + for (const auto &includeValue : includeArray) includes.value() << includeValue.toString(); } } @@ -103,7 +103,7 @@ std::optional<PresetsDetails::Condition> parseCondition(const QJsonValue &jsonVa if (object.value("list").isArray()) { condition->list = QStringList(); const QJsonArray listArray = object.value("list").toArray(); - for (const QJsonValue &listValue : listArray) + for (const auto &listValue : listArray) condition->list.value() << listValue.toString(); } } @@ -127,7 +127,7 @@ std::optional<PresetsDetails::Condition> parseCondition(const QJsonValue &jsonVa if (object.value("conditions").isArray()) { condition->conditions = std::vector<PresetsDetails::Condition::ConditionPtr>(); const QJsonArray conditionsArray = object.value("conditions").toArray(); - for (const QJsonValue &conditionsValue : conditionsArray) { + for (const auto &conditionsValue : conditionsArray) { condition->conditions.value().emplace_back( std::make_shared<PresetsDetails::Condition>( parseCondition(conditionsValue).value())); @@ -160,7 +160,7 @@ bool parseConfigurePresets(const QJsonValue &jsonValue, return false; const QJsonArray configurePresetsArray = jsonValue.toArray(); - for (const QJsonValue &presetJson : configurePresetsArray) { + for (const auto &presetJson : configurePresetsArray) { if (!presetJson.isObject()) continue; @@ -176,7 +176,7 @@ bool parseConfigurePresets(const QJsonValue &jsonValue, preset.inherits = QStringList(); if (inherits.isArray()) { const QJsonArray inheritsArray = inherits.toArray(); - for (const QJsonValue &inheritsValue : inheritsArray) + for (const auto &inheritsValue : inheritsArray) preset.inherits.value() << inheritsValue.toString(); } else { QString inheritsValue = inherits.toString(); @@ -350,7 +350,7 @@ bool parseBuildPresets(const QJsonValue &jsonValue, return false; const QJsonArray buildPresetsArray = jsonValue.toArray(); - for (const QJsonValue &presetJson : buildPresetsArray) { + for (const auto &presetJson : buildPresetsArray) { if (!presetJson.isObject()) continue; @@ -366,7 +366,7 @@ bool parseBuildPresets(const QJsonValue &jsonValue, preset.inherits = QStringList(); if (inherits.isArray()) { const QJsonArray inheritsArray = inherits.toArray(); - for (const QJsonValue &inheritsValue : inheritsArray) + for (const auto &inheritsValue : inheritsArray) preset.inherits.value() << inheritsValue.toString(); } else { QString inheritsValue = inherits.toString(); @@ -404,7 +404,7 @@ bool parseBuildPresets(const QJsonValue &jsonValue, preset.targets = QStringList(); if (targets.isArray()) { const QJsonArray targetsArray = targets.toArray(); - for (const QJsonValue &targetsValue : targetsArray) + for (const auto &targetsValue : targetsArray) preset.targets.value() << targetsValue.toString(); } else { QString targetsValue = targets.toString(); @@ -424,7 +424,7 @@ bool parseBuildPresets(const QJsonValue &jsonValue, if (nativeToolOptions.isArray()) { preset.nativeToolOptions = QStringList(); const QJsonArray toolOptionsArray = nativeToolOptions.toArray(); - for (const QJsonValue &toolOptionsValue : toolOptionsArray) + for (const auto &toolOptionsValue : toolOptionsArray) preset.nativeToolOptions.value() << toolOptionsValue.toString(); } } From 55cccfa59eb68dd59de90939063acda56241c082 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 20 Oct 2023 15:00:44 +0200 Subject: [PATCH 1698/1777] CMakePM: clang-tidy fix for 'no-automatic-move' See https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang- tidy/checks/performance/no-automatic-move.html Change-Id: If265c9b0e2aea49e5923f079cd621e10bb958286 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 2 +- src/plugins/cmakeprojectmanager/cmaketool.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 8187311a887..31a6ae23c02 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -372,7 +372,7 @@ GroupItem CMakeBuildStep::runRecipe() const auto onEnd = [this] { updateDeploymentData(); }; - const Group root { + Group root { ignoreReturnValue() ? finishAllAndDone : stopOnError, ProjectParserTask(onParserSetup, {}, onParserError), defaultProcessTask(), diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 7f7ebccdd0a..7c0001c6a86 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1532,7 +1532,7 @@ void CMakeBuildSystem::runCTest() if (bt != -1) { QSet<int> seen; std::function<QJsonObject(int)> findAncestor = [&](int index){ - const QJsonObject node = nodes.at(index).toObject(); + QJsonObject node = nodes.at(index).toObject(); const int parent = node.value("parent").toInt(-1); if (parent < 0 || !Utils::insert(seen, parent)) return node; diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index f9d7149a344..fdaf5e6bfc6 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -228,7 +228,7 @@ FilePath CMakeTool::cmakeExecutable(const FilePath &path) } } - const FilePath resolvedPath = path.canonicalPath(); + FilePath resolvedPath = path.canonicalPath(); // Evil hack to make snap-packages of CMake work. See QTCREATORBUG-23376 if (path.osType() == OsTypeLinux && resolvedPath.fileName() == "snap") return path; From aef415a25d8088a993d78ca409f66930d2c9937a Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 20 Oct 2023 15:05:12 +0200 Subject: [PATCH 1699/1777] CMakePM: clang-tidy fix for 'move-const-arg' See https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang- tidy/checks/performance/move-const-arg.html Change-Id: Ic20445321286fdcb8b02e1b2cf170e0fe60fd1fd Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/fileapiparser.cpp | 4 ++-- src/plugins/cmakeprojectmanager/fileapireader.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapiparser.cpp b/src/plugins/cmakeprojectmanager/fileapiparser.cpp index e70ed3ced7a..5038f2e85e3 100644 --- a/src/plugins/cmakeprojectmanager/fileapiparser.cpp +++ b/src/plugins/cmakeprojectmanager/fileapiparser.cpp @@ -874,11 +874,11 @@ FileApiData FileApiParser::parseData(QPromise<std::shared_ptr<FileApiQtcData>> & return result; } - auto it = std::find_if(codeModels.cbegin(), codeModels.cend(), + auto it = std::find_if(codeModels.begin(), codeModels.end(), [cmakeBuildType](const Configuration& cfg) { return QString::compare(cfg.name, cmakeBuildType, Qt::CaseInsensitive) == 0; }); - if (it == codeModels.cend()) { + if (it == codeModels.end()) { QStringList buildTypes; for (const Configuration &cfg: codeModels) buildTypes << cfg.name; diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp index 732be976b7e..ee1edb26c02 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.cpp +++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp @@ -285,8 +285,8 @@ void FileApiReader::endState(const FilePath &replyFilePath, bool restoredFromBac m_projectParts = std::move(value->projectParts); m_rootProjectNode = std::move(value->rootProjectNode); m_ctestPath = std::move(value->ctestPath); - m_isMultiConfig = std::move(value->isMultiConfig); - m_usesAllCapsTargets = std::move(value->usesAllCapsTargets); + m_isMultiConfig = value->isMultiConfig; + m_usesAllCapsTargets = value->usesAllCapsTargets; if (value->errorMessage.isEmpty()) { emit this->dataAvailable(restoredFromBackup); From 76f082186eafe8066187e581c8668e0ef69bf96e Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 26 Sep 2023 18:20:11 +0200 Subject: [PATCH 1700/1777] Android: Fix build dir for Qt6/CMake + changed LIBRARY_OUTPUT_DIRECTORY The "proper" build directory is required during different stages of the Android application deployment. For example in order to determine the input .json file for the androiddeployqt launch. If the CMake target has a modified LIBRARY_OUTPUT_DIRECTORY property, an incorrect build directory was determined. This change adds a hack which in such case (and only for Qt6 + CMake) tries to find the right build directory, which also contains the .json file. Fixes: QTCREATORBUG-26479 Change-Id: I24342f696aed7a322030eb9310d3ca71bcada81c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> --- src/plugins/android/androidmanager.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index b161698d686..aa8e3fe43aa 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -262,6 +262,19 @@ FilePath buildDirectory(const Target *target) FilePath parentDuildDir = buildDir.parentDir(); if (parentDuildDir.endsWith(libsDir) || libsDir.endsWith(libsDir + "/")) return parentDuildDir.parentDir().parentDir(); + } else { + // Qt6 + CMake: Very cautios hack to work around QTCREATORBUG-26479 for simple projects + const QString jsonFileName = + AndroidQtVersion::androidDeploymentSettingsFileName(target); + const FilePath jsonFile = buildDir / jsonFileName; + if (!jsonFile.exists()) { + const FilePath projectBuildDir = bs->buildConfiguration()->buildDirectory(); + if (buildDir != projectBuildDir) { + const FilePath projectJsonFile = projectBuildDir / jsonFileName; + if (projectJsonFile.exists()) + buildDir = projectBuildDir; + } + } } return buildDir; } From 61088bba699be5a42afbf394506c3a5d5773810c Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 20 Oct 2023 16:08:07 +0200 Subject: [PATCH 1701/1777] Fix UI text capitalization, punctuation, and phrasing Change-Id: I41951660a464601063e5cedd417db2cb7cd37e44 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/libs/utils/process.cpp | 2 +- src/plugins/debugger/dap/pydapengine.cpp | 2 +- src/plugins/qmlpreview/qmlpreviewplugin.cpp | 4 ++-- src/plugins/screenrecorder/cropandtrim.cpp | 4 ++-- src/plugins/screenrecorder/export.cpp | 2 +- src/plugins/screenrecorder/ffmpegutils.cpp | 2 +- src/plugins/screenrecorder/record.cpp | 6 +++--- src/plugins/screenrecorder/screenrecordersettings.cpp | 6 +++--- src/plugins/terminal/terminalsettings.cpp | 2 +- src/plugins/texteditor/jsoneditor.cpp | 2 +- src/plugins/texteditor/markdowneditor.cpp | 2 +- src/plugins/texteditor/texteditor.cpp | 2 +- src/plugins/valgrind/xmlprotocol/parser.cpp | 8 ++++---- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/libs/utils/process.cpp b/src/libs/utils/process.cpp index b10ea090dfc..534dcff78f1 100644 --- a/src/libs/utils/process.cpp +++ b/src/libs/utils/process.cpp @@ -1257,7 +1257,7 @@ void Process::start() d->m_result = ProcessResult::StartFailed; d->m_resultData.m_exitCode = 255; d->m_resultData.m_exitStatus = QProcess::CrashExit; - d->m_resultData.m_errorString = Tr::tr("Failed to create process interface for \"%1\"") + d->m_resultData.m_errorString = Tr::tr("Failed to create process interface for \"%1\".") .arg(d->m_setup.m_commandLine.toUserOutput()); d->m_resultData.m_error = QProcess::FailedToStart; d->emitGuardedSignal(&Process::done); diff --git a/src/plugins/debugger/dap/pydapengine.cpp b/src/plugins/debugger/dap/pydapengine.cpp index 2257aab76ad..4bbb479126f 100644 --- a/src/plugins/debugger/dap/pydapengine.cpp +++ b/src/plugins/debugger/dap/pydapengine.cpp @@ -253,7 +253,7 @@ void PyDapEngine::setupEngine() Utils::InfoBarEntry info(installDebugPyInfoBarId, Tr::tr( - "Python Debugging Support is not available. Please install debugpy package."), + "Python debugging support is not available. Install the debugpy package."), Utils::InfoBarEntry::GlobalSuppression::Enabled); info.addCustomButton(Tr::tr("Install debugpy"), [this] { Core::ICore::infoBar()->removeInfo(installDebugPyInfoBarId); diff --git a/src/plugins/qmlpreview/qmlpreviewplugin.cpp b/src/plugins/qmlpreview/qmlpreviewplugin.cpp index 464c9b88f05..011b6f43d2f 100644 --- a/src/plugins/qmlpreview/qmlpreviewplugin.cpp +++ b/src/plugins/qmlpreview/qmlpreviewplugin.cpp @@ -333,8 +333,8 @@ void QmlPreviewPlugin::previewCurrentFile() return; if (runningPreviews().isEmpty()) - QMessageBox::warning(Core::ICore::dialogParent(), Tr::tr("QML Preview not running"), - Tr::tr("Please start the QML Preview for the project before selecting " + QMessageBox::warning(Core::ICore::dialogParent(), Tr::tr("QML Preview Not Running"), + Tr::tr("Start the QML Preview for the project before selecting " "a specific file for preview.")); const QString file = currentNode->filePath().toString(); diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp index c52cc011610..819f0e285b6 100644 --- a/src/plugins/screenrecorder/cropandtrim.cpp +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -299,11 +299,11 @@ CropWidget::CropWidget(QWidget *parent) m_warningIcon = new CropSizeWarningIcon(CropSizeWarningIcon::StandardVariant); auto saveImageButton = new QToolButton; - saveImageButton->setToolTip(Tr::tr("Save current, cropped frame as image file...")); + saveImageButton->setToolTip(Tr::tr("Save current, cropped frame as image file.")); saveImageButton->setIcon(Icons::SAVEFILE.icon()); auto copyImageToClipboardAction = new QAction(Tr::tr("Copy current, cropped frame as image " - "into the Clipboard"), this); + "to the clipboard."), this); copyImageToClipboardAction->setIcon(Icons::SNAPSHOT.icon()); copyImageToClipboardAction->setShortcut(QKeySequence::Copy); diff --git a/src/plugins/screenrecorder/export.cpp b/src/plugins/screenrecorder/export.cpp index 76696250943..0c9b67d2a34 100644 --- a/src/plugins/screenrecorder/export.cpp +++ b/src/plugins/screenrecorder/export.cpp @@ -155,7 +155,7 @@ ExportWidget::ExportWidget(QWidget *parent) [&lastFormat] (const Format &f) { return f.displayName == lastFormat(); }).fileDialogFilter(); - FilePath file = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save as"), lastDir(), + FilePath file = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save As"), lastDir(), fileDialogFilters(), &selectedFilter); if (!file.isEmpty()) { m_currentFormat = findOr(formats(), defaultFormat, diff --git a/src/plugins/screenrecorder/ffmpegutils.cpp b/src/plugins/screenrecorder/ffmpegutils.cpp index 08a018e0a6e..96223c3781e 100644 --- a/src/plugins/screenrecorder/ffmpegutils.cpp +++ b/src/plugins/screenrecorder/ffmpegutils.cpp @@ -98,7 +98,7 @@ CropSizeWarningIcon::CropSizeWarningIcon(IconVariant backgroundType, QWidget *pa { setMinimumSize(warningIconSize); setToolTip(Tr::tr("Width and height are not both divisible by 2. " - "The Video export for some of the lossy formats will not work.")); + "The video export for some of the lossy formats will not work.")); m_updateTimer = new QTimer(this); m_updateTimer->setInterval(350); m_updateTimer->setSingleShot(true); diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index 60635219bba..40efe047911 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -108,7 +108,7 @@ RecordOptionsDialog::RecordOptionsDialog(QWidget *parent) Column { Row { m_screenId, st }, Group { - title(Tr::tr("Recorded screen area")), + title(Tr::tr("Recorded screen area:")), Column { m_cropScene, Row { st, m_cropRectLabel, m_resetButton }, @@ -210,7 +210,7 @@ RecordWidget::RecordWidget(const FilePath &recordFile, QWidget *parent) progressLabel->setEnabled(false); progressLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight); - m_openClipAction = new QAction(Tr::tr("Open Mov/qtrle rgb24 file"), this); + m_openClipAction = new QAction(Tr::tr("Open Mov/qtrle rgb24 File"), this); addAction(m_openClipAction); setContextMenuPolicy(Qt::ActionsContextMenu); @@ -289,7 +289,7 @@ RecordWidget::RecordWidget(const FilePath &recordFile, QWidget *parent) } else if (!clip.isLossless()) { QMessageBox::critical(Core::ICore::dialogParent(), Tr::tr("Clip Not Supported"), - Tr::tr("Please chose a clip with the \"qtrle\" codec and " + Tr::tr("Choose a clip with the \"qtrle\" codec and " "pixel format \"rgb24\".")); } else { m_clipInfo.duration = 0; diff --git a/src/plugins/screenrecorder/screenrecordersettings.cpp b/src/plugins/screenrecorder/screenrecordersettings.cpp index f5ac792a949..2d492af2509 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.cpp +++ b/src/plugins/screenrecorder/screenrecordersettings.cpp @@ -173,7 +173,7 @@ ScreenRecorderSettings::ScreenRecorderSettings() using namespace Layouting; return Column { Group { - title(Tr::tr("FFmpeg installation")), + title(Tr::tr("FFmpeg Installation")), Form { ffmpegTool, br, ffprobeTool, br, @@ -181,7 +181,7 @@ ScreenRecorderSettings::ScreenRecorderSettings() }, }, Group { - title(Tr::tr("Record settings")), + title(Tr::tr("Record Settings")), Column { captureCursor, captureMouseClicks, @@ -191,7 +191,7 @@ ScreenRecorderSettings::ScreenRecorderSettings() }, }, Group { - title(Tr::tr("Export settings")), + title(Tr::tr("Export Settings")), Column { animatedImagesAsEndlessLoop, }, diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index 57093d20a6e..b6bfe3c37c7 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -489,7 +489,7 @@ TerminalSettings::TerminalSettings() lockKeyboard.setSettingsKey("LockKeyboard"); lockKeyboard.setLabelText(Tr::tr("Block shortcuts in terminal")); lockKeyboard.setToolTip( - Tr::tr("Keeps Qt Creator short cuts from interfering with the terminal.")); + Tr::tr("Keeps Qt Creator shortcuts from interfering with the terminal.")); lockKeyboard.setDefaultValue(true); audibleBell.setSettingsKey("AudibleBell"); diff --git a/src/plugins/texteditor/jsoneditor.cpp b/src/plugins/texteditor/jsoneditor.cpp index d49f5efacea..348df6f4d1f 100644 --- a/src/plugins/texteditor/jsoneditor.cpp +++ b/src/plugins/texteditor/jsoneditor.cpp @@ -151,7 +151,7 @@ public: JsonEditorFactory::JsonEditorFactory() { setId(JSON_EDITOR_ID); - setDisplayName(Tr::tr("Json Editor")); + setDisplayName(Tr::tr("JSON Editor")); addMimeType(JSON_MIME_TYPE); setEditorCreator([] { return new BaseTextEditor; }); diff --git a/src/plugins/texteditor/markdowneditor.cpp b/src/plugins/texteditor/markdowneditor.cpp index 0ad3f0ac2f3..935d215f321 100644 --- a/src/plugins/texteditor/markdowneditor.cpp +++ b/src/plugins/texteditor/markdowneditor.cpp @@ -487,7 +487,7 @@ MarkdownEditorFactory::MarkdownEditorFactory() editor->triggerInlineCode(); }); cmd = ActionManager::registerAction(&m_linkAction, LINK_ACTION, textContext); - cmd->setDescription(Tr::tr("Hyper Link")); + cmd->setDescription(Tr::tr("Hyperlink")); QObject::connect(&m_linkAction, &QAction::triggered, EditorManager::instance(), [] { auto editor = qobject_cast<MarkdownEditor *>(EditorManager::currentEditor()); if (editor) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 4a87ecc62af..4905d745f9a 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -9072,7 +9072,7 @@ expected_str<void> TextEditorWidget::configureGenericHighlighter(const QString & { Highlighter::Definition definition = TextEditor::Highlighter::definitionForName(definitionName); if (!definition.isValid()) - return make_unexpected(Tr::tr("Could not find definition")); + return make_unexpected(Tr::tr("Could not find definition.")); d->configureGenericHighlighter(definition); d->removeSyntaxInfoBar(); diff --git a/src/plugins/valgrind/xmlprotocol/parser.cpp b/src/plugins/valgrind/xmlprotocol/parser.cpp index 33d78b3ef49..df464e33247 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.cpp +++ b/src/plugins/valgrind/xmlprotocol/parser.cpp @@ -126,11 +126,11 @@ private: QMutexLocker locker(&m_mutex); while (true) { if (m_state == State::Canceled) - return make_unexpected(Tr::tr("Parsing canceled")); + return make_unexpected(Tr::tr("Parsing canceled.")); if (!m_inputBuffer.isEmpty()) return std::exchange(m_inputBuffer, {}); if (m_state == State::Finalized) - return make_unexpected(Tr::tr("Premature end of XML document")); + return make_unexpected(Tr::tr("Premature end of XML document.")); m_waitCondition.wait(&m_mutex); } QTC_CHECK(false); @@ -198,7 +198,7 @@ static qint64 parseInt64(const QString &str, const QString &context) bool ok; const quint64 v = str.toLongLong(&ok); if (!ok) - throw ParserException{Tr::tr("Could not parse hex number from \"%1\" (%2)").arg(str, context)}; + throw ParserException{Tr::tr("Could not parse hex number from \"%1\" (%2).").arg(str, context)}; return v; } @@ -238,7 +238,7 @@ QString ParserThread::blockingReadElementText() //affects at least Qt <= 4.7.1. Reported as QTBUG-14661. if (!m_reader.isStartElement()) - throw ParserException{Tr::tr("Trying to read element text although current position is not start of element")}; + throw ParserException{Tr::tr("Trying to read element text although current position is not start of element.")}; QString result; From 423315178ae35e95cc6111451ff7a8f554466855 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 20 Oct 2023 18:11:33 +0200 Subject: [PATCH 1702/1777] CMakePM: Fix display of header / source files Qt Creator will display the header / source files based on the sourceDirectory of the target as base directory. The source_group(TREE <dir>) will result CMake in making a source group named "TREE" which should not be displayed in the project view. Amends 9280f7f757b8ceb50000a1baeac702f23b66e7d5 Fixes: QTCREATORBUG-23942 Fixes: QTCREATORBUG-29105 Change-Id: Ib71ffcc559376ea1596a5b21cb7e7fa779bd8d79 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../fileapidataextractor.cpp | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index aa53ff0437f..e097ef2c76d 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -644,29 +644,18 @@ static void addCompileGroups(ProjectNode *targetRoot, } } - // Calculate base directory for source groups: for (size_t i = 0; i < sourceGroupFileNodes.size(); ++i) { std::vector<std::unique_ptr<FileNode>> ¤t = sourceGroupFileNodes[i]; - FilePath baseDirectory; - // All the sourceGroupFileNodes are below sourceDirectory, so this is safe: - for (const std::unique_ptr<FileNode> &fn : current) { - if (baseDirectory.isEmpty()) { - baseDirectory = fn->filePath().parentDir(); - } else { - baseDirectory = FileUtils::commonPath(baseDirectory, fn->filePath()); - } - } - - FolderNode *insertNode = createSourceGroupNode(td.sourceGroups[i], - baseDirectory, - targetRoot); - + FolderNode *insertNode = td.sourceGroups[i] == "TREE" + ? targetRoot + : createSourceGroupNode(td.sourceGroups[i], + sourceDirectory, + targetRoot); if (showSourceFolders) { - insertNode->addNestedNodes(std::move(current), baseDirectory); + insertNode->addNestedNodes(std::move(current), sourceDirectory); } else { - for (auto &fileNodes : current) { + for (auto &fileNodes : current) insertNode->addNode(std::move(fileNodes)); - } } } From e454dc0f1f80590db54ab4a5b1d083db2fff6b7d Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 20 Oct 2023 17:12:58 +0200 Subject: [PATCH 1703/1777] Doc: Describe setting default C++ file name extensions for a project Task-number: QTCREATORBUG-29392 Change-Id: I2bba1d26dc6177a1f6b3f78483e669244fa15ff1 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- dist/changelog/changes-12.0.0.md | 2 ++ ...tor-projects-settings-cpp-file-naming.webp | Bin 0 -> 4726 bytes .../creator-only/creator-files-creating.qdoc | 27 ++++++++++++++---- .../creator-projects-settings-overview.qdoc | 1 + 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-projects-settings-cpp-file-naming.webp diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index b26621ddf2e..8ab1abf9cc2 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -172,7 +172,9 @@ Projects * Project specific settings * Added C++ file naming settings ([QTCREATORBUG-22033](https://bugreports.qt.io/browse/QTCREATORBUG-22033)) + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-set-cpp-file-naming.html)) * Added documentation comment settings + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-document-code.html)) * Added an option for the Doxygen command prefix ([QTCREATORBUG-8096](https://bugreports.qt.io/browse/QTCREATORBUG-8096)) * Improved performance of filtering the target setup page diff --git a/doc/qtcreator/images/qtcreator-projects-settings-cpp-file-naming.webp b/doc/qtcreator/images/qtcreator-projects-settings-cpp-file-naming.webp new file mode 100644 index 0000000000000000000000000000000000000000..9e222cc6e91a8a2c3b171b90f0d8ba9f4be08aba GIT binary patch literal 4726 zcmWIYbaTrSVqge&bqWXzu<%I~Vqnm}c`%RRE7#*~y)rZZPT%`5@3Xm*nnHCr-woTv zJe9u9i)1FGaQuvaRkzE%gJnO9(SrNie%E(tTk3C_WPavMcX(pk)4iuepW8USTXFb| z$)x*-^F@}v{{KI8=Pv)<|BBtdwd_26qigBYAkSj)bAfj@XZ2b=u#k1juQ;h%`ouNf zGE3TXLepY)chmpx#rm?P#LaS*IlT(rJe2tN*QPg?C;nT!n950~+h>YB7B*~Rm(UhE zzIXf2#VXOarOa=8r}ZdDF$5R4pPgpC>J0Bx-6L@>)q=N<Y*($n|NGRX+wn6NH&~sq zc%*Tr({X9f4B=o^<#YY-&+~*9Y<Zh|`+>k0NuLJ`r0&|5R<D_ywp=~A{q?*<U-rFh zmiFA1o%-CpVV60>7u$Z8E!P+|xc#eV+)`mEs(wC^@u+3Rj{U3tPq<-Lq!Ky3Ds9_? zLtmf1sNxIRko(Mj^GAsvZF2>A;@KY`=<$-d=y)b-7jyA3{l&`5a*xcLC_R6#+NH9% zTRFi~+jMsR`@HYSj_vnvZ2UHtyZ*8J>mN%z)t?<X`!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v^V0o!T{BYs${#yUx6~^T$?wW4Y6Rzn&73{X9GD?TyvDD~`)5PmPRNwfKH( z%ao{}Qryx^Zo+jXmI-RHt_kh}o9B0zy^!hDzBAMR$U(j-?|(E^^zm<+#8tD#NG^WE zk;jdHR^|LslUud*Qaks3vs(vh9!4uBotu69py7NAla6C5I%zk%iWtIu4ybQ(y)0Qg zS;jz(yD28=dijez1v@R-%C<~;FR_f_-0ru%fx6*S!(Q*~Z_TO<Vcoo>pLN$Rsk<#1 z`dw^ql;k!zny4j~mcFgKy;$Zzs5ql}x~;JmW5P7%Fjm<$o1eXndA!BSTUooNtou2` z`IqTO_dd9Cu+Q!Dy5`D@wohL@uoeBY<8+?2h{uA(&HfYKe4A#s%FSW(<Bf_5BDs7L zpK@gVR(QWT!BeKPuE3K2cFqCC{`nzMr)rMBzI{t8Sbfru&Q&TwYuJy!-jghL$=`g6 z<hf}5+=Ek_9~@`9IHTog_nA=cZk`vvC*}%E9rrwU+5TGB)XA3}wEg6snauhll-wiC zX~2-M_Q$<Mzr`oNyIiSwug-dWc|(|t{h3UYbFEt!%1&mtKbLK?uJrHJy$fZ7p&ZjS PaG9oD<Nq^@`q>!(DPjxu literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc index 63d14734597..f1f6441ee24 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc @@ -103,19 +103,34 @@ You can also create your own project and class wizards. - \section1 Set file naming preferences + \sa {Create files}, {Set C++ file naming preferences}, {Use project wizards}, + {Custom Wizards} +*/ - The names of the header and source file are based on the class name. To - change the default suffix of a file, select \preferences > \uicontrol {C++} > - \uicontrol {File Naming}. +/*! + \page creator-how-to-set-cpp-file-naming.html + \previouspage creator-how-tos.html - \image qtcreator-options-cpp-files.png "C++ File Naming preferences" + \ingroup creator-how-to-projects + + \title Set C++ file naming preferences + + When you use the new file wizard to create a C++ header and source file for a + new class in a C++ project, the names of the header and source file are based + on the class name. To change the default suffix of a file for a project, + select \uicontrol Projects > \uicontrol {Project Settings} > + \uicontrol {C++ File Naming}. + + \image qtcreator-projects-settings-cpp-file-naming.webp {C++ File Naming settings for a project} In the \uicontrol {License template} field, enter \l{Using Variables in Wizards}{predefined wizard variables} to specify the path and filename of the license to use in the source and header files. - \sa {Create files}, {Use project wizards}, {Custom Wizards} + To globally change the preferences, select \preferences > \uicontrol {C++} > + \uicontrol {File Naming}. + + \sa {Create C++ classes}, {Use project wizards} */ /*! diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc index e71e2d26844..ba199b27297 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc @@ -40,6 +40,7 @@ \li \l{Parsing C++ Files with the Clang Code Model}{Clangd} \li \l{Using Clang Tools}{Clang Tools} \li \l{Specify code style}{C++ Code Style} + \li \l{Set C++ file naming preferences}{C++ File Naming} \li \l{Using Custom Output Parsers}{Custom Output Parsers} \li \l{Specify dependencies}{Dependencies} \li \l{Document code}{Documentation Comments} From 76bcd85f215f8256230132df816c6d9eb89ec77d Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Fri, 20 Oct 2023 11:44:27 +0200 Subject: [PATCH 1704/1777] WebAssembly: Avoid soft assert on toolchain auto detection Windows only: When toolchains get restored on startup, WebAssemblyToolChain would try to add MinGW to an environment. That env is used for querying the compiler version. In order to find MinGW, the MinGW toolchain is queried from ToolChainManager. But since the ToolChainManager is not yet loaded at this moment, we get a QTC_CHEK assert from ToolChainManager::toolChain. This change prevents querying the ToolChainManager before it is loaded. The compiler version can successfully be determined without MinGW in path. Whether we really need to query compiler versions that early is another question outside the scope of this change. Change-Id: I46edbb80edc58d7465e90e99f7f8381708f704a1 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/webassembly/webassemblytoolchain.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/webassembly/webassemblytoolchain.cpp b/src/plugins/webassembly/webassemblytoolchain.cpp index 3174e0e9548..925b7f5dbfb 100644 --- a/src/plugins/webassembly/webassemblytoolchain.cpp +++ b/src/plugins/webassembly/webassemblytoolchain.cpp @@ -42,6 +42,12 @@ static const Abi &toolChainAbi() static void addRegisteredMinGWToEnvironment(Environment &env) { + if (!ToolChainManager::isLoaded()) { + // Avoid querying the ToolChainManager before it is loaded, which is the case during + // toolchain restoration. The compiler version can be determined without MinGW in path. + return; + } + const ToolChain *toolChain = ToolChainManager::toolChain([](const ToolChain *t){ return t->typeId() == ProjectExplorer::Constants::MINGW_TOOLCHAIN_TYPEID; }); @@ -54,7 +60,7 @@ void WebAssemblyToolChain::addToEnvironment(Environment &env) const const FilePath emSdk = settings().emSdk(); WebAssemblyEmSdk::addToEnvironment(emSdk, env); if (env.osType() == OsTypeWindows) - addRegisteredMinGWToEnvironment(env); + addRegisteredMinGWToEnvironment(env); // qmake based builds require [mingw32-]make.exe } WebAssemblyToolChain::WebAssemblyToolChain() : From 86e8676bec36b3dfbb5faf529545753d4988c6c3 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Thu, 19 Oct 2023 16:36:34 +0200 Subject: [PATCH 1705/1777] Doc: Describe setting DPI rounding policy Task-number: QTCREATORBUG-29392 Change-Id: I45eef9d1282f7df3f75f08ff55745c4205f553d9 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- ...tor-preferences-environment-interface.webp | Bin 5980 -> 6132 bytes .../creator-how-to-set-high-dpi-scaling.qdoc | 17 ++++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/qtcreator/images/qtcreator-preferences-environment-interface.webp b/doc/qtcreator/images/qtcreator-preferences-environment-interface.webp index d6d5098bc638ef8f44b946e11d90d59e793815b2..a03cb3d5794eca8053ef82558153a047bba53ce0 100644 GIT binary patch literal 6132 zcmWIYbaQ(n&cG1v>J$(bVBzyXoPk0Af1@wM*9X=A|4)?iJfB*w|9npIzD}0oy^}X= z)L+gy<D)I3cI>&6+|w`5zhcu-<rTd@|3~Q6^{ZcP=iGjEQ-iBdhGA=daat9VdS29( zQ!IwXZeI$7b#`1UeD3)ra>v`B>o&4(QTG(ezRlV4;=95^R!_da=1rWuD|RzqGw?6U zy<K{H&SEK+4Xn%tzw=va_-8%$R^Uy!QtvfEg)?uq6sI6NXTbSKEJg|2tG>;<|MOGc z9o6#W8()9jD1UIhGvBFu^~Tv7MGvn}PLBWm>FcN0AG8hj%=*(dJ<xCKOxYP%rf+=v zWZk=y*MIx0xPG7M{=ZG4_nRMH{j&Y!dS_$>Fa4ztF2B!o+4`dt&w9C8|DyI<Tum!W z2#P<pZSwA2@<y%8FB!aE*>AM!?3)8i_VwhdPcN;1FhBN2liHO|ev!*g<=W9Pu~wUR zAKI9c8D(}lZ|&WEp409wx@>%7_U-F0xe7~Tjd}aCE$)83V-jA)>wbQf`}3*GdPLa5 zCinB*Y3;aUm*12B)cyMQ6;=lMd&~ZQF=e&*P`azCEBW0nGf&YCiK}J`h|N=Fxf@_} z+3Uudbu6cR&%d<0o))!p@BNtDj>ZArXCLHDoc7M!QdKwM+&2e78`*}i!fhw!xGZ%3 zCZN_*a$je?Tv%zVOyABs`j<p+HtqH=*I!pKb>0L$(Qx~_`7YC<Hmu$?Nl7<kd6)K* z%fecho_{O-_T}}gyjjZ@2F>tVJZbTjSy9gxPu|Ss<$C3EedxVEKP12UEq+&DoVl}} z^X`iDs{7|v1($ft-?%X9RqacOu=EF}e<ey<@7R@!D+OmBt)1XKJ2^f7{qf00F(2-A z*A_aoTje*N%YMdqH2$*x(rs)@P8d{}&kxf7wba-DMB_^TkpJw@)=s&+wm)u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;o-^>&Koh(ypvHif&HToMZF51spef8JkSnE2oe_6pj3;CamRs0F@&(8R9 z@oVh**_)GVO<ca2&6fWu?mIh41f*?tT=4Cj{<BA{*zU$XJ280*OI4TX@{JzXVs)nM z{jo6g;qjfU^WNTiTWLNm?YFHNf4IxsB`Q~f*X-FHp>b~0j+Y?mRo{MmKK?Fh``&kQ zuhhdfnFVH+Z*<sJY@XYd_~r2(ru&~v*3S*QyEk-Gt+M;yBVO0kwBG88ow#?`cAHko zd0m5x;_sSWmsN^?6JE{nPDSj*Hl1xX7TXUv2$#5e{_1Si^IOC8Lzk2L*|fI_XJ&d{ zdZki!xXj?$5s}PNq1zjhMXWows-9Z7`$pH>0JghF<-W;9@=4u2Dg_JM+7Pq(pZ~2d zExFgfwa@M5%z#gffd^X~bauXKkFq=><(_Q&X{X}cgsKz&o^!9x_}o|+68|_u!p-^@ zr&s5xDEH9o7Fj7XwqLu*;T+c<8nr2O+oix29Me8~tt{HGBKL%z=2cOblh?lOwVQ0= zyYJuH!YdsHd21I7w(a3ty(eY$l1o~5mGo3~rfNA>A5x9>tciJ?QBh+uPsdIElhv9} zU2`XStuCqGm=f!|Qb>hkTFz4Qyk9$y1v(#Ev$fAnVgui5eg|E<X76p6yzhP~>|Oj& z__*LU#r21^^lxgd+_Gv@;rA&_-cvcOe15XE9+PrUwgDMBY3(G_7AIGZO)_gb?vyS~ z59RzhMRVJqn8z7Ej)eKtuzpfHam_+%-9|y-oei5z``WTi9w|*S?VEM-cig(tl6&>f X{;Hp{;Ac0JJ#8{g?z2GB|Bb8woT{5k diff --git a/doc/qtcreator/src/howto/creator-how-to-set-high-dpi-scaling.qdoc b/doc/qtcreator/src/howto/creator-how-to-set-high-dpi-scaling.qdoc index c0b2d4d6bea..103565ef95d 100644 --- a/doc/qtcreator/src/howto/creator-how-to-set-high-dpi-scaling.qdoc +++ b/doc/qtcreator/src/howto/creator-how-to-set-high-dpi-scaling.qdoc @@ -15,27 +15,30 @@ \title Set high DPI scaling The operating systems that \QC supports implement high dots-per-inch (DPI) - scaling at varying levels. Therefore, \QC handles high DPI scaling - differently on different operating systems: + scaling at varying levels. Therefore, \QC handles \l{High DPI}{high DPI} + scaling differently on different operating systems: \list \li On \macos, \QC forces high DPI scaling, which means that it allows Qt to use the system scaling factor as the \QC scaling factor. - \li On Windows, if you do not set \l{High DPI} - {scaling environment variables}, \QC instructs Qt to detect the - scaling factor and use it as the \QC scaling factor. \li On Linux, \QC leaves it to the user to enable high DPI scaling because the process varies so much on different distributions and windowing systems that it cannot be reliably done automatically. \endlist - To override the default approach and always enable high DPI scaling: + Setting the scale factor or DPI to the exact physical display DPI may not + give good visual results due to the fractional scaling involved. + \l {Qt::HighDpiScaleFactorRoundingPolicy}{Rounding} the scale factor to 25% + increments can improve the results. + + To set the DPI rounding policy: \list 1 \li Select \preferences > \uicontrol Environment > \uicontrol Interface. \image qtcreator-preferences-environment-interface.webp {Interface tab in Environment preferences} - \li Select \uicontrol {Enable high DPI scaling}. + \li In \uicontrol {DPI rounding policy}, select an option to round + DPI up or down. \li Restart \QC to have the change take effect. \endlist */ From 8da7d88e3a3f09c35041d906918576e41e7da6f1 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Mon, 23 Oct 2023 14:15:07 +0200 Subject: [PATCH 1706/1777] ProjectExplorer: Fix restoring project dependencies Amends d6fe357d81da96475c02eb3c73f660d8121381e4. Fixes: QTCREATORBUG-29796 Change-Id: I7788b4e5c2477bb3edf9764b08cfa344a5e9c9c0 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/projectexplorer/projectmanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projectmanager.cpp b/src/plugins/projectexplorer/projectmanager.cpp index 9706a011ae2..4943773f4b0 100644 --- a/src/plugins/projectexplorer/projectmanager.cpp +++ b/src/plugins/projectexplorer/projectmanager.cpp @@ -573,7 +573,8 @@ void ProjectManager::removeProjects(const QList<Project *> &remove) void ProjectManagerPrivate::restoreDependencies() { - QMap<QString, QVariant> depMap = SessionManager::sessionValue("ProjectDependencies").toMap(); + QMap<QString, QVariant> depMap = mapEntryFromStoreEntry(SessionManager::sessionValue( + "ProjectDependencies")).toMap(); auto i = depMap.constBegin(); while (i != depMap.constEnd()) { const QString &key = i.key(); From 4645c713d2dc871e52e146456a11f084d428db5c Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Mon, 23 Oct 2023 16:13:51 +0200 Subject: [PATCH 1707/1777] GenericDeployStep: Fix rsync step Don't use a copy of m_files for mkdirTask(), as m_files is modified by the running recipe. So, when the recipe is prepared, the m_files doesn't contain the right data, yet. This is going to be refactored in master, as it seems the isDeploymentNecessary() operating on mutable internals is confusing. Fixes: QTCREATORBUG-29609 Change-Id: I3f34584ffd9486322e8b26f95ac72b96a9306f8b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/remotelinux/genericdeploystep.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/remotelinux/genericdeploystep.cpp b/src/plugins/remotelinux/genericdeploystep.cpp index 5def5465258..4ae804689c2 100644 --- a/src/plugins/remotelinux/genericdeploystep.cpp +++ b/src/plugins/remotelinux/genericdeploystep.cpp @@ -90,9 +90,9 @@ GroupItem GenericDeployStep::mkdirTask() { using ResultType = expected_str<void>; - const auto onSetup = [files = m_files](Async<ResultType> &async) { + const auto onSetup = [this](Async<ResultType> &async) { FilePaths remoteDirs; - for (const FileToTransfer &file : std::as_const(files)) + for (const FileToTransfer &file : std::as_const(m_files)) remoteDirs << file.m_target.parentDir(); FilePath::sort(remoteDirs); From f401d51a66bf655cd677ae0b232ae5588b683f11 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 23 Oct 2023 10:24:34 +0200 Subject: [PATCH 1708/1777] McuSupport: Fix dependencies and tests There is nowadays a hard dependency on QmlJSTools as there is need to access its QmlJSModelManager. Beside this adapt the tests to reflect the Key / QString changes happened inside the settings to avoid crashing the tests. Change-Id: I71cd0457e5f567da28cc089b514655418bd60b7d Reviewed-by: Yasser Grimes <yasser.grimes@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/mcusupport/CMakeLists.txt | 2 +- src/plugins/mcusupport/mcusupport.qbs | 1 + src/plugins/mcusupport/test/unittest.cpp | 67 ++++++++++++------------ 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/src/plugins/mcusupport/CMakeLists.txt b/src/plugins/mcusupport/CMakeLists.txt index f52c31b82ab..aa8b4f2bf1b 100644 --- a/src/plugins/mcusupport/CMakeLists.txt +++ b/src/plugins/mcusupport/CMakeLists.txt @@ -1,6 +1,6 @@ add_qtc_plugin(McuSupport DEPENDS Qt::Core QmlJS - PLUGIN_DEPENDS Core BareMetal ProjectExplorer Debugger CMakeProjectManager QtSupport + PLUGIN_DEPENDS Core BareMetal ProjectExplorer Debugger CMakeProjectManager QmlJSTools QtSupport SOURCES mcukitaspect.cpp mcukitaspect.h mcusupport.qrc diff --git a/src/plugins/mcusupport/mcusupport.qbs b/src/plugins/mcusupport/mcusupport.qbs index b14c6a90a23..e944ba5ce97 100644 --- a/src/plugins/mcusupport/mcusupport.qbs +++ b/src/plugins/mcusupport/mcusupport.qbs @@ -14,6 +14,7 @@ QtcPlugin { Depends { name: "Debugger" } Depends { name: "CMakeProjectManager" } Depends { name: "QmlJS" } + Depends { name: "QmlJSTools" } Depends { name: "QtSupport" } Depends { name: "qtc_gtest_gmock"; condition: qtc.withPluginTests; required: false } diff --git a/src/plugins/mcusupport/test/unittest.cpp b/src/plugins/mcusupport/test/unittest.cpp index 5692ceee751..13ed66f8035 100644 --- a/src/plugins/mcusupport/test/unittest.cpp +++ b/src/plugins/mcusupport/test/unittest.cpp @@ -954,34 +954,34 @@ void McuSupportTest::test_legacy_createTargetWithToolchainPackages_data() QTest::newRow("armgcc_mimxrt1050_evk_freertos_json") << armgcc_mimxrt1050_evk_freertos_json << armGccToolchainFilePath - << armGccToolchainFileUnexpandedPath << armGccDir << armGccDirectorySetting + << armGccToolchainFileUnexpandedPath << armGccDir << keyFromString(armGccDirectorySetting) << QStringList{armGccVersion}; QTest::newRow("armgcc_mimxrt1064_evk_freertos_json") << armgcc_mimxrt1064_evk_freertos_json << armGccToolchainFilePath - << armGccToolchainFileUnexpandedPath << armGccDir << armGccDirectorySetting + << armGccToolchainFileUnexpandedPath << armGccDir << keyFromString(armGccDirectorySetting) << QStringList{armGccVersion}; QTest::newRow("armgcc_mimxrt1170_evk_freertos_json") << armgcc_mimxrt1170_evk_freertos_json << armGccToolchainFilePath - << armGccToolchainFileUnexpandedPath << armGccDir << armGccDirectorySetting + << armGccToolchainFileUnexpandedPath << armGccDir << keyFromString(armGccDirectorySetting) << QStringList{armGccVersion}; QTest::newRow("armgcc_stm32h750b_discovery_baremetal_json") << armgcc_stm32h750b_discovery_baremetal_json << armGccToolchainFilePath - << armGccToolchainFileUnexpandedPath << armGccDir << armGccDirectorySetting + << armGccToolchainFileUnexpandedPath << armGccDir << keyFromString(armGccDirectorySetting) << QStringList{armGccVersion}; QTest::newRow("armgcc_stm32f769i_discovery_freertos_json") << armgcc_stm32f769i_discovery_freertos_json << armGccToolchainFilePath - << armGccToolchainFileUnexpandedPath << armGccDir << armGccDirectorySetting + << armGccToolchainFileUnexpandedPath << armGccDir << keyFromString(armGccDirectorySetting) << QStringList{armGccVersion}; QTest::newRow("iar_stm32f469i_discovery_baremetal_json") << iar_stm32f469i_discovery_baremetal_json << iarToolchainFilePath - << iarToolchainFileUnexpandedPath << iarDir << iarSetting << iarVersions; + << iarToolchainFileUnexpandedPath << iarDir << keyFromString(iarSetting) << iarVersions; QTest::newRow("iar_mimxrt1064_evk_freertos_json") << iar_mimxrt1064_evk_freertos_json << iarToolchainFilePath - << iarToolchainFileUnexpandedPath << iarDir << iarSetting << iarVersions; + << iarToolchainFileUnexpandedPath << iarDir << keyFromString(iarSetting) << iarVersions; QTest::newRow("ghs_rh850_d1m1a_baremetal_json") << ghs_rh850_d1m1a_baremetal_json << greenhillToolchainFilePath - << greenhillToolchainFileUnexpandedPath << greenhillCompilerDir << greenhillSetting - << greenhillVersions; + << greenhillToolchainFileUnexpandedPath << greenhillCompilerDir + << keyFromString(greenhillSetting) << greenhillVersions; } void McuSupportTest::test_legacy_createTargetWithToolchainPackages() @@ -1145,22 +1145,22 @@ void McuSupportTest::test_legacy_createFreeRtosPackage_data() QTest::newRow("armgcc_mimxrt1050_evk_freertos_json") << armgcc_mimxrt1050_evk_freertos_json << QStringList{boardSdkVersion} - << QString{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(nxp1050) + << keyFromString(QString{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(nxp1050)) << FilePath::fromUserInput(boardSdkDir) / freeRtosNxpPathSuffix << FilePath::fromUserInput(freeRtosDetectionPath); QTest::newRow("armgcc_mimxrt1064_evk_freertos_json") << armgcc_mimxrt1064_evk_freertos_json << QStringList{boardSdkVersion} - << QString{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(nxp1064) + << keyFromString(QString{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(nxp1064)) << FilePath::fromUserInput(boardSdkDir) / freeRtosNxpPathSuffix << FilePath::fromUserInput(freeRtosDetectionPath); QTest::newRow("iar_mimxrt1064_evk_freertos_json") << iar_mimxrt1064_evk_freertos_json << QStringList{boardSdkVersion} - << QString{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(nxp1064) + << keyFromString(QString{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(nxp1064)) << FilePath::fromUserInput(boardSdkDir) / freeRtosNxpPathSuffix << FilePath::fromUserInput(freeRtosDetectionPath); QTest::newRow("armgcc_stm32f769i_discovery_freertos_json") << armgcc_stm32f769i_discovery_freertos_json << QStringList{"1.16.0"} - << QString{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(stm32f7) + << keyFromString(QString{Legacy::Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(stm32f7)) << FilePath::fromUserInput(boardSdkDir) / freeRtosStmPathSuffix << FilePath::fromUserInput(freeRtosDetectionPath); } @@ -1495,7 +1495,7 @@ void McuSupportTest::test_legacy_createThirdPartyPackage_data() QTest::addColumn<QString>("json"); QTest::addColumn<QString>("path"); QTest::addColumn<QString>("defaultPath"); - QTest::addColumn<QString>("setting"); + QTest::addColumn<Key>("setting"); QTest::addColumn<QString>("cmakeVar"); QTest::addColumn<QString>("envVar"); QTest::addColumn<QString>("label"); @@ -1504,42 +1504,42 @@ void McuSupportTest::test_legacy_createThirdPartyPackage_data() QTest::newRow("armgcc_mimxrt1050_evk_freertos_json mcuXpresso") << PackageCreator{[this]() { return Legacy::createMcuXpressoIdePackage(settingsMockPtr); }} << armgcc_mimxrt1050_evk_freertos_json << xpressoIdePath << xpressoIdePath - << xpressoIdeSetting << xpressoIdeCmakeVar << xpressoIdeEnvVar << xpressoIdeLabel + << keyFromString(xpressoIdeSetting) << xpressoIdeCmakeVar << xpressoIdeEnvVar << xpressoIdeLabel << xpressoIdeDetectionPath; QTest::newRow("armgcc_mimxrt1064_evk_freertos_json mcuXpresso") << PackageCreator{[this]() { return Legacy::createMcuXpressoIdePackage(settingsMockPtr); }} << armgcc_mimxrt1064_evk_freertos_json << xpressoIdePath << xpressoIdePath - << xpressoIdeSetting << xpressoIdeCmakeVar << xpressoIdeEnvVar << xpressoIdeLabel - << xpressoIdeDetectionPath; + << keyFromString(xpressoIdeSetting) << xpressoIdeCmakeVar << xpressoIdeEnvVar + << xpressoIdeLabel << xpressoIdeDetectionPath; QTest::newRow("armgcc_mimxrt1170_evk_freertos_json mcuXpresso") << PackageCreator{[this]() { return Legacy::createMcuXpressoIdePackage(settingsMockPtr); }} << armgcc_mimxrt1170_evk_freertos_json << xpressoIdePath << xpressoIdePath - << xpressoIdeSetting << xpressoIdeCmakeVar << xpressoIdeEnvVar << xpressoIdeLabel - << xpressoIdeDetectionPath; + << keyFromString(xpressoIdeSetting) << xpressoIdeCmakeVar << xpressoIdeEnvVar + << xpressoIdeLabel << xpressoIdeDetectionPath; QTest::newRow("armgcc_stm32h750b_discovery_baremetal_json stmCubeProgrammer") << PackageCreator{[this]() { return Legacy::createStm32CubeProgrammerPackage(settingsMockPtr); }} << armgcc_stm32h750b_discovery_baremetal_json << stmCubeProgrammerPath - << stmCubeProgrammerPath << stmCubeProgrammerSetting << empty << empty + << stmCubeProgrammerPath << keyFromString(stmCubeProgrammerSetting) << empty << empty << stmCubeProgrammerLabel << stmCubeProgrammerDetectionPath; QTest::newRow("armgcc_stm32f769i_discovery_freertos_json stmCubeProgrammer") << PackageCreator{[this]() { return Legacy::createStm32CubeProgrammerPackage(settingsMockPtr); }} << armgcc_stm32f769i_discovery_freertos_json << stmCubeProgrammerPath - << stmCubeProgrammerPath << stmCubeProgrammerSetting << empty << empty + << stmCubeProgrammerPath << keyFromString(stmCubeProgrammerSetting) << empty << empty << stmCubeProgrammerLabel << stmCubeProgrammerDetectionPath; QTest::newRow("ghs_rh850_d1m1a_baremetal_json renesasProgrammer") << PackageCreator{[this]() { return Legacy::createRenesasProgrammerPackage(settingsMockPtr); }} - << ghs_rh850_d1m1a_baremetal_json << empty << empty << renesasProgrammerSetting - << renesasProgrammerCmakeVar << renesasProgrammerEnvVar << renesasProgrammerLabel - << renesasProgrammerDetectionPath; + << ghs_rh850_d1m1a_baremetal_json << empty << empty + << keyFromString(renesasProgrammerSetting) << renesasProgrammerCmakeVar + << renesasProgrammerEnvVar << renesasProgrammerLabel << renesasProgrammerDetectionPath; } void McuSupportTest::test_legacy_createThirdPartyPackage() @@ -1592,33 +1592,34 @@ void McuSupportTest::test_createThirdPartyPackage_data() QTest::newRow("armgcc_mimxrt1050_evk_freertos_json mcuXpresso") << armgcc_mimxrt1050_evk_freertos_json << xpressoIdePath << xpressoIdePath - << xpressoIdeSetting << xpressoIdeCmakeVar << xpressoIdeEnvVar << xpressoIdeLabel - << xpressoIdeDetectionPath; + << keyFromString(xpressoIdeSetting) << xpressoIdeCmakeVar << xpressoIdeEnvVar + << xpressoIdeLabel << xpressoIdeDetectionPath; QTest::newRow("armgcc_mimxrt1064_evk_freertos_json mcuXpresso") << armgcc_mimxrt1064_evk_freertos_json << xpressoIdePath << xpressoIdePath - << xpressoIdeSetting << xpressoIdeCmakeVar << xpressoIdeEnvVar << xpressoIdeLabel - << xpressoIdeDetectionPath; + << keyFromString(xpressoIdeSetting) << xpressoIdeCmakeVar << xpressoIdeEnvVar + << xpressoIdeLabel << xpressoIdeDetectionPath; QTest::newRow("armgcc_mimxrt1170_evk_freertos_json mcuXpresso") << armgcc_mimxrt1170_evk_freertos_json << xpressoIdePath << xpressoIdePath - << xpressoIdeSetting << xpressoIdeCmakeVar << xpressoIdeEnvVar << xpressoIdeLabel + << keyFromString(xpressoIdeSetting) << xpressoIdeCmakeVar << xpressoIdeEnvVar << xpressoIdeLabel << xpressoIdeDetectionPath; QTest::newRow("armgcc_stm32h750b_discovery_baremetal_json stmCubeProgrammer") << armgcc_stm32h750b_discovery_baremetal_json << stmCubeProgrammerPath - << stmCubeProgrammerPath << stmCubeProgrammerSetting << empty << empty + << stmCubeProgrammerPath << keyFromString(stmCubeProgrammerSetting) << empty << empty << stmCubeProgrammerLabel << stmCubeProgrammerDetectionPath; QTest::newRow("armgcc_stm32f769i_discovery_freertos_json stmCubeProgrammer") << armgcc_stm32f769i_discovery_freertos_json << stmCubeProgrammerPath - << stmCubeProgrammerPath << stmCubeProgrammerSetting << empty << empty + << stmCubeProgrammerPath << keyFromString(stmCubeProgrammerSetting) << empty << empty << stmCubeProgrammerLabel << stmCubeProgrammerDetectionPath; QTest::newRow("ghs_rh850_d1m1a_baremetal_json renesasProgrammer") << ghs_rh850_d1m1a_baremetal_json << renesasProgrammerDefaultPath << empty - << "FlashProgrammerPath" << renesasProgrammerCmakeVar << "RenesasFlashProgrammer_PATH" - << renesasProgrammerLabel << renesasProgrammerDetectionPath; + << keyFromString("FlashProgrammerPath") << renesasProgrammerCmakeVar + << "RenesasFlashProgrammer_PATH" << renesasProgrammerLabel + << renesasProgrammerDetectionPath; } void McuSupportTest::test_createThirdPartyPackage() From bed9ed55c4fa950e3f2168fb318b4dcf345bbe7f Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 19 Oct 2023 15:44:57 +0200 Subject: [PATCH 1709/1777] EditorManager: Native dialogs on macOS can't change their buttons In this case we try to add a menu to a button. "Native" is the default, so explicitly request a non-native message box. This is the message box that pops up e.g. when trying to open an empty file foo.ui (the widget designer rejects to open it, Qt Creator provides the option to open with a different editor in the error dialog). Task-number: QTBUG-118419 Change-Id: Iab3ee14593a55c2056303cfa16b99cea25893522 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- src/plugins/coreplugin/editormanager/editormanager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 4b059a10fd7..ad31e04ea98 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -873,6 +873,9 @@ IEditor *EditorManagerPrivate::openEditor(EditorView *view, const FilePath &file IEditorFactory *selectedFactory = nullptr; if (!factories.isEmpty()) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0) + msgbox.setOptions(QMessageBox::Option::DontUseNativeDialog); +#endif auto button = qobject_cast<QPushButton *>(msgbox.button(QMessageBox::Open)); QTC_ASSERT(button, return nullptr); auto menu = new QMenu(button); From 176be6a563da09817d7a195b5d22866602af639b Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 20 Oct 2023 10:38:08 +0200 Subject: [PATCH 1710/1777] COIN/GitHub: Switch to Qt 6.6.0 Which we use for the packages Change-Id: I7fa6c001f356ca23409444567d94246731d0fffe Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- .github/workflows/build_cmake.yml | 4 ++-- coin/instructions/common_environment.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 416223c75af..d866f1f6d70 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -7,7 +7,7 @@ on: - 'doc/**' env: - QT_VERSION: 6.5.2 + QT_VERSION: 6.6.0 MACOS_DEPLOYMENT_TARGET: 10.15 CLANG_VERSION: 17.0.1 ELFUTILS_VERSION: 0.175 @@ -201,7 +201,7 @@ jobs: set(url_os "linux_x64") set(qt_package_arch_suffix "gcc_64") set(qt_dir_prefix "${qt_version}/gcc_64") - set(qt_package_suffix "-Linux-RHEL_8_4-GCC-Linux-RHEL_8_4-X86_64") + set(qt_package_suffix "-Linux-RHEL_8_6-GCC-Linux-RHEL_8_6-X86_64") elseif ("${{ runner.os }}" STREQUAL "macOS") set(url_os "mac_x64") set(qt_package_arch_suffix "clang_64") diff --git a/coin/instructions/common_environment.yaml b/coin/instructions/common_environment.yaml index ea72589c1df..0f651d187a8 100644 --- a/coin/instructions/common_environment.yaml +++ b/coin/instructions/common_environment.yaml @@ -10,7 +10,7 @@ instructions: variableValue: https://ci-files02-hki.ci.qt.io/packages/jenkins/qtcreator_libclang/libclang-release_17.0.1-based - type: EnvironmentVariable variableName: QTC_QT_BASE_URL - variableValue: "https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.2-released/Qt" + variableValue: "https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.6/6.6.0-released/Qt" - type: EnvironmentVariable variableName: QTC_QT_MODULES variableValue: "qt5compat qtbase qtdeclarative qtimageformats qtquick3d qtquickcontrols2 qtquicktimeline qtserialport qtshadertools qtsvg qttools qttranslations qtwebengine" @@ -39,7 +39,7 @@ instructions: instructions: - type: EnvironmentVariable variableName: QTC_QT_POSTFIX - variableValue: "-Linux-RHEL_8_4-GCC-Linux-RHEL_8_4-X86_64.7z" + variableValue: "-Linux-RHEL_8_6-GCC-Linux-RHEL_8_6-X86_64.7z" - type: EnvironmentVariable variableName: QTC_SDKTOOL_QT_EXT variableValue: ".tar.xz" From 1d64d764acfd110c1717ba1602f194bd46a2e550 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 20 Oct 2023 13:03:05 +0200 Subject: [PATCH 1711/1777] Clangd: Edit tooltip text for "Header/source switch mode" field Use the phrasing "tends to find false positives" instead of "has some bugs". Add </p> at the ends of paragraph elements. Change-Id: Ie524f2615625b52bf2de5b66b8938f49e3d0255f Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- share/qtcreator/translations/qtcreator_fr.ts | 4 ++-- .../cppeditor/cppcodemodelsettingspage.cpp | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index 059f2e80e93..673d54af1ea 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -20281,8 +20281,8 @@ Double-cliquez pour modifier l’élément.</translation> <translation>C++</translation> </message> <message> - <source><p>If background indexing is enabled, global symbol searches will yield more accurate results, at the cost of additional CPU load when the project is first opened. The indexing result is persisted in the project's build directory. If you disable background indexing, a faster, but less accurate, built-in indexer is used instead. The thread priority for building the background index can be adjusted since clangd 15.</p><p>Background Priority: Minimum priority, runs on idle CPUs. May leave 'performance' cores unused.</p><p>Normal Priority: Reduced priority compared to interactive work.</p>Low Priority: Same priority as other clangd work.</source> - <translation><p>Si l’indexation en arrière-plan est activée, les recherches globales de symboles donneront des résultats plus précis, au prix d’une charge de travail supplémentaire du CPU lors de la première ouverture du projet. Le résultat de l’indexation est conservé dans le répertoire de construction du projet. Si vous désactivez l’indexation en arrière-plan, un indexeur intégré plus rapide, mais moins précis, est utilisé à la place. La priorité des threads pour la construction de l’index d’arrière-plan peut être ajustée depuis clangd 15.</p><p>Priorité d’arrière-plan : priorité minimale, s’exécute sur les processeurs inactifs. Peut laisser les cœurs de « performance » inutilisés.</p><p>Priorité normale : priorité réduite par rapport au travail interactif.</p>Priorité basse : même priorité que les autres travaux de clangd.</translation> + <source><p>If background indexing is enabled, global symbol searches will yield more accurate results, at the cost of additional CPU load when the project is first opened. The indexing result is persisted in the project's build directory. If you disable background indexing, a faster, but less accurate, built-in indexer is used instead. The thread priority for building the background index can be adjusted since clangd 15.</p><p>Background Priority: Minimum priority, runs on idle CPUs. May leave 'performance' cores unused.</p><p>Normal Priority: Reduced priority compared to interactive work.</p><p>Low Priority: Same priority as other clangd work.</p></source> + <translation><p>Si l’indexation en arrière-plan est activée, les recherches globales de symboles donneront des résultats plus précis, au prix d’une charge de travail supplémentaire du CPU lors de la première ouverture du projet. Le résultat de l’indexation est conservé dans le répertoire de construction du projet. Si vous désactivez l’indexation en arrière-plan, un indexeur intégré plus rapide, mais moins précis, est utilisé à la place. La priorité des threads pour la construction de l’index d’arrière-plan peut être ajustée depuis clangd 15.</p><p>Priorité d’arrière-plan : priorité minimale, s’exécute sur les processeurs inactifs. Peut laisser les cœurs de « performance » inutilisés.</p><p>Priorité normale : priorité réduite par rapport au travail interactif.</p><p>Priorité basse : même priorité que les autres travaux de clangd.</p></translation> </message> <message> <source><p>Which C/C++ backend to use when switching between header and source file.<p>The clangd implementation has more capabilities, but also has some bugs not present in the built-in variant.<p>When "Try Both" is selected, clangd will be employed only if the built-in variant does not find anything.</source> diff --git a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp index 1c8ff05fee8..2c46504f17f 100644 --- a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp @@ -223,21 +223,21 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD "<p>Background Priority: Minimum priority, runs on idle CPUs. May leave 'performance' " "cores unused.</p>" "<p>Normal Priority: Reduced priority compared to interactive work.</p>" - "Low Priority: Same priority as other clangd work."); + "<p>Low Priority: Same priority as other clangd work.</p>"); const QString headerSourceSwitchToolTip = Tr::tr( - "<p>Which C/C++ backend to use when switching between header and source file." - "<p>The clangd implementation has more capabilities, but also has some bugs not present " - "in the built-in variant." - "<p>When \"Try Both\" is selected, clangd will be employed only if the built-in variant " - "does not find anything."); + "<p>The C/C++ backend to use for switching between header and source files.</p>" + "<p>While the clangd implementation has more capabilities than the built-in " + "code model, it tends to find false positives.</p>" + "<p>When \"Try Both\" is selected, clangd is used only if the built-in variant " + "does not find anything.</p>"); using RankingModel = ClangdSettings::CompletionRankingModel; const QString completionRankingModelToolTip = Tr::tr( - "<p>Which model clangd should use to rank possible completions." - "<p>This determines the order of candidates in the combo box when doing code completion." + "<p>Which model clangd should use to rank possible completions.</p>" + "<p>This determines the order of candidates in the combo box when doing code completion.</p>" "<p>The \"%1\" model used by default results from (pre-trained) machine learning and " - "provides superior results on average." + "provides superior results on average.</p>" "<p>If you feel that its suggestions stray too much from your expectations for your " - "code base, you can try switching to the hand-crafted \"%2\" model.").arg( + "code base, you can try switching to the hand-crafted \"%2\" model.</p>").arg( ClangdSettings::rankingModelToDisplayString(RankingModel::DecisionForest), ClangdSettings::rankingModelToDisplayString(RankingModel::Heuristics)); const QString workerThreadsToolTip = Tr::tr( From f811edf4a28d06c4e36ebbe2a69d8c75ea64810f Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Tue, 24 Oct 2023 09:08:16 +0200 Subject: [PATCH 1712/1777] Help: Fix text of View > Show Left Sidebar check item The text should never be "Hide Left Sidebar", because it is a checked item. Just set the tooltip, like done in coreplugin/navigationwidget.cpp Task-number: QTCREATORBUG-27733 Change-Id: I0cda56712724a69cb08411e62be57b88909416fe Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> --- src/plugins/help/helpwidget.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp index a2d9eca985a..daa6e83c576 100644 --- a/src/plugins/help/helpwidget.cpp +++ b/src/plugins/help/helpwidget.cpp @@ -229,11 +229,14 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget m_toggleSideBarAction->setChecked(false); cmd = Core::ActionManager::registerAction(m_toggleSideBarAction, Core::Constants::TOGGLE_LEFT_SIDEBAR, context); - connect(m_toggleSideBarAction, &QAction::toggled, m_toggleSideBarAction, [this](bool checked) { - m_toggleSideBarAction->setText(::Core::Tr::tr( - checked ? Core::Constants::TR_HIDE_LEFT_SIDEBAR - : Core::Constants::TR_SHOW_LEFT_SIDEBAR)); - }); + connect(m_toggleSideBarAction, + &QAction::toggled, + m_toggleSideBarAction, + [this](bool checked) { + m_toggleSideBarAction->setToolTip( + ::Core::Tr::tr(checked ? Core::Constants::TR_HIDE_LEFT_SIDEBAR + : Core::Constants::TR_SHOW_LEFT_SIDEBAR)); + }); addSideBar(); m_toggleSideBarAction->setChecked(m_sideBar->isVisibleTo(this)); connect(m_toggleSideBarAction, &QAction::triggered, m_sideBar, &Core::SideBar::setVisible); From ddffbe676de3d87e71a7379db3405853ebee518a Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 20 Oct 2023 14:26:04 +0200 Subject: [PATCH 1713/1777] Help: Do not allow opening temporary in Help mode In case we have no documentation for an "F1 help request" we display some temporary with a small hint. Disallow opening this inside the Help mode to avoid triggering an open request which ends up in a system dialog trying to open the temporary local file. Fixes: QTCREATORBUG-29371 Change-Id: If61c37eb2576cf6f9dcc70b58527a66b284b30f0 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/help/helpwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp index daa6e83c576..c79bb052eb5 100644 --- a/src/plugins/help/helpwidget.cpp +++ b/src/plugins/help/helpwidget.cpp @@ -695,6 +695,8 @@ HelpViewer *HelpWidget::insertViewer(int index, const QUrl &url) if (currentViewer() == viewer) { m_addBookmarkAction->setEnabled(isBookmarkable(url)); m_openOnlineDocumentationAction->setEnabled(LocalHelpManager::canOpenOnlineHelp(url)); + if (m_switchToHelp) + m_switchToHelp->setEnabled(url != QUrl("about:blank")); } }); connect(viewer, &HelpViewer::forwardAvailable, this, [viewer, this](bool available) { From 0fe891678a9d47b4bc956edba911659bd22d9bb8 Mon Sep 17 00:00:00 2001 From: Riitta-Leena Miettinen <Riitta-Leena.Miettinen@qt.io> Date: Thu, 19 Oct 2023 10:46:46 +0200 Subject: [PATCH 1714/1777] Doc: Use a link to "Find preferences" as value of \preferences - Add the instructions for finding the Preferences menu to the "Find a particular preference" topic and rename it "Find preferences". - Remove the "Find menu items on macOS" topic Change-Id: I627e5c20d2c63efb4490d446608b923ac15a6aac Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- doc/config/macros.qdocconf | 2 +- .../creator-coding-edit-mode.qdoc | 2 +- .../creator-only/creator-preferences-nim.qdoc | 2 +- ...ator-preferences-text-editor-behavior.qdoc | 2 +- .../creator-how-to-find-preferences.qdoc | 33 ++++++++++++++++ .../src/howto/creator-how-to-macos.qdoc | 38 ------------------- .../howto/creator-only/creator-how-tos.qdoc | 14 ------- ...reator-preferences-qtquick-code-style.qdoc | 2 +- .../src/user-interface/creator-ui.qdoc | 2 +- 9 files changed, 39 insertions(+), 58 deletions(-) create mode 100644 doc/qtcreator/src/howto/creator-how-to-find-preferences.qdoc delete mode 100644 doc/qtcreator/src/howto/creator-how-to-macos.qdoc diff --git a/doc/config/macros.qdocconf b/doc/config/macros.qdocconf index f70ce0c3926..f881062d136 100644 --- a/doc/config/macros.qdocconf +++ b/doc/config/macros.qdocconf @@ -39,7 +39,7 @@ macro.QOI = "Qt Online Installer" macro.QMT = "Qt Maintenance Tool" macro.qtcversion = $QTC_VERSION macro.param = "\\e" -macro.preferences = "\\uicontrol Edit (or \\uicontrol {\\QC} on \\macos) > \\uicontrol Preferences" +macro.preferences = "\\l{Find preferences}{Preferences}" macro.raisedaster.HTML = "<sup>*</sup>" macro.rarrow.HTML = "→" macro.reg.HTML = "<sup>®</sup>" diff --git a/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc b/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc index 0f4933bee49..6a649e96db7 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc @@ -306,7 +306,7 @@ split, prepend \key {Ctrl+E} to the shortcut. For example, press \key {Ctrl+E,F2} to follow the symbol in the next split. If necessary, the view is automatically split. To change the default behavior, select - \preferen \uicontrol {Text Editor} > \uicontrol Display > + \preferences > \uicontrol {Text Editor} > \uicontrol Display > \uicontrol {Always open links in another split}. Additional symbols are displayed and switching between definition and declaration is done in diff --git a/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc b/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc index 3d77de55346..a72320b71fe 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc @@ -29,6 +29,6 @@ To specify different settings for a particular project, select \uicontrol Projects > \uicontrol {Code Style}. - \sa {Find a particular preference}, {Indent text or code}, + \sa {Find preferences}, {Indent text or code}, {Specify code style}, {Setting Up Nimble} */ diff --git a/doc/qtcreator/src/editors/creator-preferences-text-editor-behavior.qdoc b/doc/qtcreator/src/editors/creator-preferences-text-editor-behavior.qdoc index 553e0993961..aeaf45def30 100644 --- a/doc/qtcreator/src/editors/creator-preferences-text-editor-behavior.qdoc +++ b/doc/qtcreator/src/editors/creator-preferences-text-editor-behavior.qdoc @@ -89,7 +89,7 @@ commenting out a selection, select \uicontrol {Prefer single line comments}. \if defined(qtcreator) - \sa {Find a particular preference}, {C++ Code Style}, {Nim} + \sa {Find preferences}, {C++ Code Style}, {Nim} \endif \sa {Indent text or code}, {Qt Quick Code Style} diff --git a/doc/qtcreator/src/howto/creator-how-to-find-preferences.qdoc b/doc/qtcreator/src/howto/creator-how-to-find-preferences.qdoc new file mode 100644 index 00000000000..a39f64963d9 --- /dev/null +++ b/doc/qtcreator/src/howto/creator-how-to-find-preferences.qdoc @@ -0,0 +1,33 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-how-to-find-preferences.html + \if defined(qtcreator) + \previouspage creator-how-tos.html + \else + \previouspage creator-quick-tour.html + \endif + + \ingroup creator-how-to-ui + \ingroup studio-how-to + + \title Find preferences + + \QC uses standard names and locations on Linux, \macos, and Windows for + standard features, such as \e preferences. + + \table + \header + \li Linux and Windows + \li \macos + \row + \li \uicontrol Edit > \uicontrol Preferences + \li \uicontrol {\QC} > \uicontrol Preferences + \endtable + + To find a particular preference, use the filter located at the top left of + the \uicontrol Preferences dialog. + + \image qtcreator-preferences.webp {Filtering preferences} +*/ diff --git a/doc/qtcreator/src/howto/creator-how-to-macos.qdoc b/doc/qtcreator/src/howto/creator-how-to-macos.qdoc deleted file mode 100644 index 30e5815efd9..00000000000 --- a/doc/qtcreator/src/howto/creator-how-to-macos.qdoc +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \page creator-how-to-macos.html - \if defined(qtcreator) - \previouspage creator-how-tos.html - \else - \previouspage creator-quick-tour.html - \endif - - \ingroup creator-how-to-ui - \ingroup studio-how-to - - \title Find menu items on \macos - - \QC uses standard names and locations for standard features, such as - \e preferences. In this manual, the names and locations on - Windows and Linux are usually used to keep the instructions short. Here are - some places to check if you cannot find a function, dialog, or keyboard - shortcut on \macos when following the instructions: - - \table - \header - \li For - \li Look In - \row - \li \uicontrol Edit > \uicontrol Preferences - \li \uicontrol {\QC} > \uicontrol Preferences - \row - \li \uicontrol Help > \uicontrol {About Plugins} - \li \uicontrol {\QC} > \uicontrol {About Plugins} - \row - \li Keyboard shortcuts - \li \uicontrol {\QC} > \uicontrol Preferences > \uicontrol Environment > - \uicontrol Keyboard - \endtable -*/ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 99206c237a8..fb9bccd529c 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -95,20 +95,6 @@ \endlist */ -/*! - \page creator-how-to-find-preferences.html - \previouspage creator-how-tos.html - - \ingroup creator-how-to-ui - - \title Find a particular preference - - To find a particular preference in \preferences, - use the filter located at the top left of the \uicontrol Preferences dialog. - - \image qtcreator-preferences.webp {Filtering preferences} -*/ - /*! \page creator-how-to-run-from-cli.html \previouspage creator-how-tos.html diff --git a/doc/qtcreator/src/qtquick/creator-preferences-qtquick-code-style.qdoc b/doc/qtcreator/src/qtquick/creator-preferences-qtquick-code-style.qdoc index 333ff9694eb..6ea13251620 100644 --- a/doc/qtcreator/src/qtquick/creator-preferences-qtquick-code-style.qdoc +++ b/doc/qtcreator/src/qtquick/creator-preferences-qtquick-code-style.qdoc @@ -40,6 +40,6 @@ \sa {Indent text or code} \if defined(qtcreator) - \sa {Find a particular preference}, {Specify code style} + \sa {Find preferences}, {Specify code style} \endif */ diff --git a/doc/qtcreator/src/user-interface/creator-ui.qdoc b/doc/qtcreator/src/user-interface/creator-ui.qdoc index 9d0e642b325..bf4bb2c455d 100644 --- a/doc/qtcreator/src/user-interface/creator-ui.qdoc +++ b/doc/qtcreator/src/user-interface/creator-ui.qdoc @@ -118,7 +118,7 @@ The following topics describe how to customize the UI: \list - \li \l {Find menu items on \macos} + \li \l {Find preferences} \li \l {Set high DPI scaling} \li \l {Switch UI themes} \li \l {View output} From 5e3d14e2e932da0a3dc3314d2802bc3df0dc504c Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Sun, 22 Oct 2023 14:22:20 +0200 Subject: [PATCH 1715/1777] CMakePM: Allow CMAKE_SYSROOT to be taken from the CMake preset probe One could have a toolchainfile that sets the CMAKE_SYSROOT. We need to be able to read the value later, and not just from the CMake Presets cmakeCache array. Task-number: QTCREATORBUG-29643 Change-Id: I63697219195b043813516c8214329ce583dc0676 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index 74d5056bf78..b8748bc6f98 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -264,6 +264,7 @@ static CMakeConfig configurationFromPresetProbe( const QString prefixPath = cache.stringValueOf("CMAKE_PREFIX_PATH"); const QString findRootPath = cache.stringValueOf("CMAKE_FIND_ROOT_PATH"); const QString qtHostPath = cache.stringValueOf("QT_HOST_PATH"); + const QString sysRoot = cache.stringValueOf("CMAKE_SYSROOT"); if (!cmakeMakeProgram.isEmpty()) { args.emplace_back( @@ -282,6 +283,9 @@ static CMakeConfig configurationFromPresetProbe( if (!qtHostPath.isEmpty()) { args.emplace_back(QStringLiteral("-DQT_HOST_PATH=%1").arg(qtHostPath)); } + if (!sysRoot.isEmpty()) { + args.emplace_back(QStringLiteral("-DCMAKE_SYSROOT=%1").arg(sysRoot)); + } } qCDebug(cmInputLog) << "CMake probing for compilers: " << cmakeExecutable.toUserOutput() @@ -745,9 +749,6 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath, const CMakeConfig cache = configurePreset.cacheVariables ? configurePreset.cacheVariables.value() : CMakeConfig(); - - data->sysroot = cache.filePathValueOf("CMAKE_SYSROOT"); - CMakeConfig config; const bool noCompilers = cache.valueOf("CMAKE_C_COMPILER").isEmpty() && cache.valueOf("CMAKE_CXX_COMPILER").isEmpty(); @@ -778,6 +779,8 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath, configurePreset.generator.value().toUtf8()); } + data->sysroot = config.filePathValueOf("CMAKE_SYSROOT"); + const auto [qmake, cmakePrefixPath] = qtInfoFromCMakeCache(config, env); if (!qmake.isEmpty()) data->qt = findOrCreateQtVersion(qmake); From 6eca31c4243b859401f6660dad21c34e5e456460 Mon Sep 17 00:00:00 2001 From: Thiago Macieira <thiago.macieira@intel.com> Date: Tue, 24 Oct 2023 08:43:11 -0700 Subject: [PATCH 1716/1777] Add missing includes for QPointer qtbase removed some indirect include somewhere. Change-Id: I477e6dccebda4fbb81f6fffd179115840c67002f Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/coreplugin/locator/commandlocator.cpp | 1 + src/plugins/qmlprojectmanager/qmlproject.h | 2 ++ src/shared/qtsingleapplication/qtsingleapplication.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/src/plugins/coreplugin/locator/commandlocator.cpp b/src/plugins/coreplugin/locator/commandlocator.cpp index b740bdeeacd..6fd21a524ba 100644 --- a/src/plugins/coreplugin/locator/commandlocator.cpp +++ b/src/plugins/coreplugin/locator/commandlocator.cpp @@ -8,6 +8,7 @@ #include <utils/stringutils.h> #include <QAction> +#include <QPointer> using namespace Utils; diff --git a/src/plugins/qmlprojectmanager/qmlproject.h b/src/plugins/qmlprojectmanager/qmlproject.h index b716d442d05..a41b05e57bb 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.h +++ b/src/plugins/qmlprojectmanager/qmlproject.h @@ -7,6 +7,8 @@ #include "qmlprojectmanager_global.h" #include <projectexplorer/project.h> +#include <QPointer> + namespace QmlProjectManager { class QmlProject; diff --git a/src/shared/qtsingleapplication/qtsingleapplication.cpp b/src/shared/qtsingleapplication/qtsingleapplication.cpp index b791d1875f7..c38d568004c 100644 --- a/src/shared/qtsingleapplication/qtsingleapplication.cpp +++ b/src/shared/qtsingleapplication/qtsingleapplication.cpp @@ -7,6 +7,7 @@ #include <QDir> #include <QFileOpenEvent> #include <QLockFile> +#include <QPointer> #include <QSharedMemory> #include <QWidget> From 22693e32811a3cf041607a5703cebdd5d0a60fe1 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 24 Oct 2023 18:17:32 +0200 Subject: [PATCH 1717/1777] Doc: Add links to documentation to the change log Task-number: QTCREATORBUG-29392 Change-Id: Ic5233954320447e7ef3152e25f4ddce43936fbc6 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- dist/changelog/changes-12.0.0.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 8ab1abf9cc2..6e7a8f496e4 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -212,6 +212,7 @@ Projects * Added auto-detection of PySide from the installer ([PYSIDE-2153](https://bugreports.qt.io/browse/PYSIDE-2153)) + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-python-development.html#set-up-pyside6)) * Added the option to forward the display for remote Linux * Fixed PySide wheels installation on macOS @@ -224,6 +225,7 @@ Projects ### Qt Safe Renderer * Added a wizard for Qt Safe Renderer 2.1 and later + ([Documentation](https://doc.qt.io/QtSafeRenderer/qtsr-safety-project.html#using-qt-safe-renderer-project-template-in-qt-creator)) Debugging --------- From 3d95bafdbbee0a7350779f834972ade2095c9acd Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 24 Oct 2023 13:54:55 +0200 Subject: [PATCH 1718/1777] Axivion: Support building without ssl Change-Id: I027317410321725e8e295d236243e50e1ea6019d Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/axivion/axivionplugin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index 0c09ecb475d..a22885afb01 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -158,12 +158,15 @@ bool AxivionPlugin::handleCertificateIssue() AxivionPluginPrivate::AxivionPluginPrivate() { +#if QT_CONFIG(ssl) connect(&m_networkAccessManager, &QNetworkAccessManager::sslErrors, this, &AxivionPluginPrivate::handleSslErrors); +#endif // ssl } void AxivionPluginPrivate::handleSslErrors(QNetworkReply *reply, const QList<QSslError> &errors) { +#if QT_CONFIG(ssl) const QList<QSslError::SslError> accepted{ QSslError::CertificateNotYetValid, QSslError::CertificateExpired, QSslError::InvalidCaCertificate, QSslError::CertificateUntrusted, @@ -174,6 +177,10 @@ void AxivionPluginPrivate::handleSslErrors(QNetworkReply *reply, const QList<QSs if (!settings().server.validateCert || AxivionPlugin::handleCertificateIssue()) reply->ignoreSslErrors(errors); } +#else // ssl + Q_UNUSED(reply) + Q_UNUSED(errors) +#endif // ssl } void AxivionPluginPrivate::onStartupProjectChanged() From 0bf69bc499b64fe2cb29ac2c32213cf8644c9554 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 25 Oct 2023 09:18:49 +0200 Subject: [PATCH 1719/1777] NavigationWidgets: Fix the side that shortcuts open The activationsMap logs were a specific view was opened last. We need to clear outdated information from the navigation widgets' (left|right) settings (if a view was opened last in the left widget, that was written to the left widget's settings, but it was not cleared from the right widget's settings, so if it ever was opened last on the right side, that information stuck). When restoring the state of the left|right widgets, we may not overwrite the previously restored activationsMap. Fixes: QTCREATORBUG-29770 Change-Id: I14c85c24f279208fb94707514cc4a8cba184e03c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/coreplugin/navigationwidget.cpp | 19 +++++++++++++------ src/plugins/coreplugin/navigationwidget.h | 4 +++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/plugins/coreplugin/navigationwidget.cpp b/src/plugins/coreplugin/navigationwidget.cpp index 382a290bc6d..d2b1dafcd51 100644 --- a/src/plugins/coreplugin/navigationwidget.cpp +++ b/src/plugins/coreplugin/navigationwidget.cpp @@ -7,7 +7,6 @@ #include "coreplugintr.h" #include "icontext.h" #include "icore.h" -#include "imode.h" #include "inavigationwidgetfactory.h" #include "modemanager.h" #include "navigationsubwidget.h" @@ -297,7 +296,9 @@ static QIcon closeIconForSide(Side side, int itemCount) : Utils::Icons::CLOSE_SPLIT_RIGHT.icon(); } -Internal::NavigationSubWidget *NavigationWidget::insertSubItem(int position, int factoryIndex) +Internal::NavigationSubWidget *NavigationWidget::insertSubItem(int position, + int factoryIndex, + bool updateActivationsMap) { for (int pos = position + 1; pos < d->m_subWidgets.size(); ++pos) { Internal::NavigationSubWidget *nsw = d->m_subWidgets.at(pos); @@ -323,7 +324,8 @@ Internal::NavigationSubWidget *NavigationWidget::insertSubItem(int position, int d->m_subWidgets.insert(position, nsw); d->m_subWidgets.at(0)->setCloseIcon(closeIconForSide(d->m_side, d->m_subWidgets.size())); - NavigationWidgetPrivate::updateActivationsMap(nsw->factory()->id(), {d->m_side, position}); + if (updateActivationsMap) + NavigationWidgetPrivate::updateActivationsMap(nsw->factory()->id(), {d->m_side, position}); return nsw; } @@ -400,8 +402,11 @@ void NavigationWidget::saveSettings(QtcSettings *settings) const auto keys = NavigationWidgetPrivate::s_activationsMap.keys(); for (const auto &factoryId : keys) { const auto &info = NavigationWidgetPrivate::s_activationsMap[factoryId]; + const Utils::Key key = settingsKey(activationKey + factoryId.name()); if (info.side == d->m_side) - settings->setValue(settingsKey(activationKey + factoryId.name()), info.position); + settings->setValue(key, info.position); + else + settings->remove(key); } } @@ -434,7 +439,7 @@ void NavigationWidget::restoreSettings(QtcSettings *settings) int index = factoryIndex(Id::fromString(id)); if (index >= 0) { // Only add if the id was actually found! - insertSubItem(position, index); + insertSubItem(position, index, /*updateActivationsMap=*/false); ++position; } else { restoreSplitterState = false; @@ -443,7 +448,9 @@ void NavigationWidget::restoreSettings(QtcSettings *settings) if (d->m_subWidgets.isEmpty()) // Make sure we have at least the projects widget or outline widget - insertSubItem(0, qMax(0, factoryIndex(Id::fromString(defaultFirstView(d->m_side))))); + insertSubItem(0, + qMax(0, factoryIndex(Id::fromString(defaultFirstView(d->m_side)))), + /*updateActivationsMap=*/false); setShown(settings->value(settingsKey("Visible"), defaultVisible(d->m_side)).toBool()); diff --git a/src/plugins/coreplugin/navigationwidget.h b/src/plugins/coreplugin/navigationwidget.h index d89105e75d9..40ea1a5fa0c 100644 --- a/src/plugins/coreplugin/navigationwidget.h +++ b/src/plugins/coreplugin/navigationwidget.h @@ -97,7 +97,9 @@ protected: private: void closeSubWidget(Internal::NavigationSubWidget *subWidget); void updateToggleText(); - Internal::NavigationSubWidget *insertSubItem(int position, int factoryIndex); + Internal::NavigationSubWidget *insertSubItem(int position, + int factoryIndex, + bool updateActivationsMap = true); int factoryIndex(Utils::Id id); Utils::Key settingsKey(const Utils::Key &key) const; From 99c749043dfb1bf9d7381be21234525cfbde5789 Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jaroslaw.kobus@qt.io> Date: Tue, 24 Oct 2023 17:48:25 +0200 Subject: [PATCH 1720/1777] SshProcessInterface: Ensure non-zero PID when destructing Fixes: QTCREATORBUG-29788 Change-Id: Ia906469526ebeaea6421f1f27a74e66d59bcaea3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/remotelinux/linuxdevice.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 8386175e82c..565b0675503 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -427,7 +427,7 @@ void SshProcessInterface::emitStarted(qint64 processId) void SshProcessInterface::killIfRunning() { - if (d->m_killed || d->m_process.state() != QProcess::Running) + if (d->m_killed || d->m_process.state() != QProcess::Running || d->m_processId == 0) return; sendControlSignal(ControlSignal::Kill); d->m_killed = true; @@ -449,9 +449,12 @@ bool SshProcessInterface::runInShell(const CommandLine &command, const QByteArra process.setCommand(cmd); process.setWriteData(data); process.start(); - bool isFinished = process.waitForFinished(2000); // TODO: it may freeze on some devices - // otherwise we may start producing killers for killers - QTC_CHECK(isFinished); + bool isFinished = process.waitForFinished(2000); // It may freeze on some devices + if (!isFinished) { + Core::MessageManager::writeFlashing(tr("Can't send control signal to the %1 device. " + "The device might have been disconnected.") + .arg(d->m_device->displayName())); + } return isFinished; } From d72fa048339b4d3b9bd69706aca7fe27baa647f5 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Fri, 20 Oct 2023 14:37:20 +0200 Subject: [PATCH 1721/1777] Doc: Update QML Language Server preferences docs - Some labels changed - "Use QML Language Server advanced features" was added Task-number: QTCREATORBUG-29392 Change-Id: I2c4f4d43b8f8e9d74186439e31a9d8cf13ec4967 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- .../images/qtcreator-qml-js-editing.webp | Bin 14272 -> 11266 bytes .../src/editors/creator-code-syntax.qdoc | 2 ++ .../creator-only/creator-language-server.qdoc | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/doc/qtcreator/images/qtcreator-qml-js-editing.webp b/doc/qtcreator/images/qtcreator-qml-js-editing.webp index 7e759cf2da686bc283be4719150ff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3EDaIMR_@Z-sW=NDa%sM~q2VGdE7q~&$| z>I$}Aecn5*>y*|w7j>VxIo0#2aLA8cwNAxt=Svf0CfWVoe9!q%6?=jbYhkMK8}p6n zN=q%150x^sKY6AdlYLA0&-LU(&$P>yPtTpccKv#Hd(j=Xd)uD%#9e2UnY6}k^9obj z<tm4C&Rw~-Nd9t^mEg5G6ANS)Oj@(nwmJIpy_WM8J{H2;tbgy(xaVkZZd^M*y!e>i zbw;g|<v*@%v5({DjAKt=><hej>59=Z%f(Co>J^A822axc*22@q*8ADM1jPIFWSg+& OudFg_?TyM|R~Z32I=1)# diff --git a/doc/qtcreator/src/editors/creator-code-syntax.qdoc b/doc/qtcreator/src/editors/creator-code-syntax.qdoc index 15c4fa47229..ad86edbf2d9 100644 --- a/doc/qtcreator/src/editors/creator-code-syntax.qdoc +++ b/doc/qtcreator/src/editors/creator-code-syntax.qdoc @@ -712,6 +712,8 @@ \uicontrol {Disable messages for non Qt Quick UI}. You cannot enable messages just for non-Qt Quick UI files. + \sa {QML Language Server} + \section1 Resetting the Code Model If you change the build and run kit when you have QML files open in the code diff --git a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc index aca41d7c835..8ebbaa74d4b 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc @@ -143,15 +143,22 @@ \section2 QML Language Server - Since Qt 6.4, the \c qmlls language server offers code completion and - issues warnings for QML. To enable QML language server support, select - \preferences > \uicontrol {Qt Quick} > - \uicontrol {QML/JS Editing} > \uicontrol {Use qmlls (EXPERIMENTAL!)}. + Since Qt 6.4, the QML language server offers code completion and + issues warnings for QML. To use it, select \preferences > + \uicontrol {Qt Quick} > \uicontrol {QML/JS Editing} > + \uicontrol {Enable QML Language Server}. + + To use advanced features, such as renaming and finding usages, select the + \uicontrol {Use QML Language Server advanced features} check box. + To use the latest version of the language server installed on your - system, select the \uicontrol {Always use latest qmlls} check box. + system, select the + \uicontrol {Use QML Language Server from latest Qt version} check box. \image qtcreator-qml-js-editing.webp {QML/JS Editing preferences} + \sa {Enabling and Disabling Messages} + \section1 Supported Locator Filters The locator enables you to browse not only files, but any items defined by From ea1a745813a3f4e492ce01c3253a7d990fde724a Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 24 Oct 2023 19:31:21 +0200 Subject: [PATCH 1722/1777] Utils: Restore the prior edit-clear-locationbar icon direction On left-to-right KDE systems, the clear icon on the right was originally (up to QtC 11) pointing to the left. In Qt Creator 12 it started pointing to the right. Reproducible with KDE Plasma 5.27. This change restores the prior mapping of "writing direction" to "clear icon direction". It also restores the fall back to the freedesktop standard name "clear-icon". Amends: 67212a31ee4cc5c026b677329ace9f1fdaa3320c Change-Id: I3d1340195a82422ac310128b9e81982e0d57a6ca Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/libs/utils/fancylineedit.cpp | 14 ++++++++------ src/libs/utils/icon.cpp | 11 ++++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index f1e177e0633..a3acaad0f44 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -428,12 +428,14 @@ void FancyLineEdit::setFiltering(bool on) d->m_isFiltering = on; if (on) { d->m_lastFilterText = text(); - // KDE has custom icons for this. Notice that icon namings are counter intuitive. - // If these icons are not available we use the freedesktop standard name before - // falling back to a bundled resource. - static const QIcon rtl = Icon::fromTheme("edit-clear-locationbar-rtl"); - static const QIcon ltr = Icon::fromTheme("edit-clear-locationbar-ltr"); - setButtonIcon(Right, layoutDirection() == Qt::LeftToRight ? ltr : rtl); + // KDE has custom icons for this. The "ltr" and "rtl" suffixes describe the direction + // into which the arrows are pointing. They do not describe which writing direction they + // are intended to be used for. + const QLatin1String pointingWest("edit-clear-locationbar-rtl"); + const QLatin1String pointingEast("edit-clear-locationbar-ltr"); + const QIcon icon = Icon::fromTheme(layoutDirection() == Qt::LeftToRight ? pointingWest + : pointingEast); + setButtonIcon(Right, icon); setButtonVisible(Right, true); setPlaceholderText(Tr::tr("Filter")); setButtonToolTip(Right, Tr::tr("Clear text")); diff --git a/src/libs/utils/icon.cpp b/src/libs/utils/icon.cpp index e4945efa9bd..5bd862c8f14 100644 --- a/src/libs/utils/icon.cpp +++ b/src/libs/utils/icon.cpp @@ -268,13 +268,14 @@ QIcon Icon::fromTheme(const QString &name) cache.insert(name, !icon.isNull() ? icon : Icons::ZOOMOUT_TOOLBAR.icon()); } else if (name == "zoom-original") { cache.insert(name, !icon.isNull() ? icon : Icons::EYE_OPEN_TOOLBAR.icon()); + } else if (name == "edit-clear") { + cache.insert(name, !icon.isNull() ? icon : Icons::EDIT_CLEAR.icon()); } else if (name == "edit-clear-locationbar-rtl") { - // KDE has custom icons for this. Notice that icon namings are counter intuitive. - // If these icons are not available we use the freedesktop standard name before - // falling back to a bundled resource. - cache.insert(name, !icon.isNull() ? icon : Icons::EDIT_CLEAR.icon()); + // KDE has custom icons for this. If these icons are not available we use the freedesktop + // standard name "edit-clear" before falling back to a bundled resource. + cache.insert(name, !icon.isNull() ? icon : fromTheme("edit-clear")); } else if (name == "edit-clear-locationbar-ltr") { - cache.insert(name, !icon.isNull() ? icon : Icons::EDIT_CLEAR.icon()); + cache.insert(name, !icon.isNull() ? icon : fromTheme("edit-clear")); } else { cache.insert(name, icon); } From 8b2d676ae87699a0ed78d79051e5dccd30f1ed85 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Wed, 25 Oct 2023 12:51:11 +0200 Subject: [PATCH 1723/1777] Designer: Ignore layout name changes from property editor As it turns out, changes to "objectName" and "layoutName" both result in the objectNameChanged() signal getting emitted. We must handle these the same way. Fixes: QTCREATORBUG-29644 Change-Id: I41ecc4867f3df8eedf325eda750b947a57c90c10 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/designer/qtcreatorintegration.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index fb4c1afd5d6..31a5336342a 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -134,7 +134,8 @@ QtCreatorIntegration::QtCreatorIntegration(QDesignerFormEditorInterface *core, Q connect(this, &QtCreatorIntegration::propertyChanged, this, [this](QDesignerFormWindowInterface *formWindow, const QString &name, const QVariant &) { - if (name == "objectName") { + qCDebug(log) << "got propertyChanged() signal" << name; + if (name.endsWith("Name")) { if (const auto extraCompiler = d->extraCompilers.find(formWindow); extraCompiler != d->extraCompilers.end()) { (*extraCompiler)->unblock(); From 2ad3520e5a29338ca237b4c5408b4c6d88ef4cb8 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Wed, 25 Oct 2023 10:47:26 +0200 Subject: [PATCH 1724/1777] CppEditor/LanguageClient: Do not rename in generated files by default Fixes: QTCREATORBUG-29778 Change-Id: I4e56b6bda4e22c71995ab19ac6469ea88d22ee11 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> --- src/plugins/clangcodemodel/clangdfindreferences.cpp | 7 ++++--- src/plugins/cppeditor/cppfindreferences.cpp | 3 ++- .../languageclient/languageclientsymbolsupport.cpp | 10 ++++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugins/clangcodemodel/clangdfindreferences.cpp b/src/plugins/clangcodemodel/clangdfindreferences.cpp index c3ba6c2b8f6..19e1df4dd16 100644 --- a/src/plugins/clangcodemodel/clangdfindreferences.cpp +++ b/src/plugins/clangcodemodel/clangdfindreferences.cpp @@ -456,9 +456,10 @@ void ClangdFindReferences::Private::addSearchResultsForFile(const FilePath &file item.setContainingFunctionName(getContainingFunction(astPath, range).detail()); if (search->supportsReplace()) { - const bool fileInSession = ProjectManager::projectForFile(file); - item.setSelectForReplacement(fileInSession); - if (fileInSession && file.baseName().compare(replacementData->oldSymbolName, + const Node * const node = ProjectTree::nodeForFile(file); + item.setSelectForReplacement(!ProjectManager::hasProjects() + || (node && !node->isGenerated())); + if (node && file.baseName().compare(replacementData->oldSymbolName, Qt::CaseInsensitive) == 0) { replacementData->fileRenameCandidates << file; } diff --git a/src/plugins/cppeditor/cppfindreferences.cpp b/src/plugins/cppeditor/cppfindreferences.cpp index a894c3ffe06..25b3e110d53 100644 --- a/src/plugins/cppeditor/cppfindreferences.cpp +++ b/src/plugins/cppeditor/cppfindreferences.cpp @@ -577,8 +577,9 @@ static void displayResults(SearchResult *search, item.setStyle(colorStyleForUsageType(result.tags)); item.setUseTextEditorFont(true); if (search->supportsReplace()) { + const Node * const node = ProjectTree::nodeForFile(result.path); item.setSelectForReplacement(!ProjectManager::hasProjects() - || ProjectManager::projectForFile(result.path)); + || (node && !node->isGenerated())); } search->addResult(item); diff --git a/src/plugins/languageclient/languageclientsymbolsupport.cpp b/src/plugins/languageclient/languageclientsymbolsupport.cpp index 13dddd38e23..867137fcc07 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.cpp +++ b/src/plugins/languageclient/languageclientsymbolsupport.cpp @@ -14,6 +14,8 @@ #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectmanager.h> +#include <projectexplorer/projectnodes.h> +#include <projectexplorer/projecttree.h> #include <utils/algorithm.h> #include <utils/mimeutils.h> @@ -308,10 +310,10 @@ Utils::SearchResultItems generateSearchResultItems( item.setFilePath(filePath); item.setUseTextEditorFont(true); if (renaming && limitToProjects) { - const bool fileBelongsToProject = ProjectExplorer::ProjectManager::projectForFile( - filePath); - item.setSelectForReplacement(fileBelongsToProject); - if (fileBelongsToProject + const ProjectExplorer::Node * const node + = ProjectExplorer::ProjectTree::nodeForFile(filePath); + item.setSelectForReplacement(node && !node->isGenerated()); + if (node && filePath.baseName().compare(oldSymbolName, Qt::CaseInsensitive) == 0) { fileRenameCandidates << filePath; } From 9d4c31cb7445e211bc402c9bf27f6ccebea774a2 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Wed, 25 Oct 2023 15:04:12 +0200 Subject: [PATCH 1725/1777] Doc: Describe using the locator to go to tabs in Preferences dialog Change-Id: I9644cdc830494c4e02599b72c584eb02aed1f4f8 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../images/qtcreator-locator-filter-t.webp | Bin 0 -> 3256 bytes .../howto/creator-how-to-find-preferences.qdoc | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 doc/qtcreator/images/qtcreator-locator-filter-t.webp diff --git a/doc/qtcreator/images/qtcreator-locator-filter-t.webp b/doc/qtcreator/images/qtcreator-locator-filter-t.webp new file mode 100644 index 0000000000000000000000000000000000000000..d201f0672e12b4711e4f3ac6eb00b249c5af6f21 GIT binary patch literal 3256 zcmWIYbaUIl!@v;k>J$(bVBxcbhk-%=Pm?0U*BeRy<4a}I%TJ#<^W(&sGk5gf+kMQ_ z3~`%2Q&MTlr;ueHdMu}E;)Tv;-``QXv$m_~U%|ic_aghB>+MLgD4H^{eUU8J4qIc* zU1wy|uk4+;{7#{4du)Ww<gA&h*SD=rJ|7mcb5ri^>ocM~=1%;UoqYS*bCvzQ>5iLo z-&Pdo1>An7e|uj1@&$q^r7UHSzpp-Pv2|<Me^swZG273|oZ!mrxOtROVa0L&n7~xC z!ea@W&)&UppJ{riU>VEdYtfk#OW#bEocx;0VphbbhsPLI3ZgdY%gdDC_4_O-$QYg9 zyL6g|qm2DZ%@v7v{v^CIG+SpSsFz$cfA5NFpV{80E(gDqJEIjP5&TZbVa@Um-VZjJ z+w}7^Orz_)x#w@5xlu#*;yc&EbIMaP=3RTPWU}pER!+y1qgu8z<yJ0@SfR}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%1)Z#h&jwG<|t;n2x<i)nqogzcoGes=i(V_$x+IMUm$ zHEnI&bbmQzb~oPFe(ag-H=Wi0+f8*A)}4F!^L~X5>z00aU8nmqeuGEcWF}Fcqkr_Z zl3dOTtO%d4pV;$*!F<ObhPl&ZV_eK~Z+&r9TrH>lH2uI=k-B993$HnI*jS}-Rdk4C z%kRDUxbNbEiJq?WZIb<^wl;oH-gj!A#ttoI))4<vo(f|Ydm{nMSDUw1KKI=k#T#0< ziJf6u_4{d#@>&Tu-7ijMk>NP8R`p%PewLgF@1(%fzAr1zGTXjd%YE^NYWO1dIoZb& zS*xtsqoyD5nqZvMQ4!Xu@?-9-TNh7vXo{_qoN<l!>g%o$og;Dy%Ksin#Y9|K#>!+D z6}QNB6DQx5$w%)eK2YGi)+K7dt**j4{i_s<QLgryCl*^1V_y6$@D;g|`P}APfo<`W z;>)|XY-3&9vdW|L+vL=nzwdtuoKW2*@$NwX>64Etj963TPp^DopuDQM#3DTPuhPWJ zeYZLiYp;7BePAEILgd3<U)ww__qLrvFHfEeosj*sY2_oqd_$dQ8th)Yc^OOiyPr?} z!D_BwxBr3pEWrh!RLroq>s`@uu2ny*A6(MayZdW>=p1>o3pe(79=aRwQ@-T3=+x6s zZCSl%Y`N>Y%4gG^ox6GS4hbCbUbHKMQL^crZ1d7BR$uR|VeH9BIrQIbv5u9pV(+bl zQ`dsh9<5u|`P)xWZr>BH-XqS*S-lQ>-#vcRrSTzu^14|H*PX8!J+(NPdf9J|L5pNT v@B7<JW@=`BTYY7_=<I(Rt_M{wJid6LV(}%@iM<OpFnv?~D|nWXtA!B&b-^`* literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/howto/creator-how-to-find-preferences.qdoc b/doc/qtcreator/src/howto/creator-how-to-find-preferences.qdoc index a39f64963d9..ffd14e18915 100644 --- a/doc/qtcreator/src/howto/creator-how-to-find-preferences.qdoc +++ b/doc/qtcreator/src/howto/creator-how-to-find-preferences.qdoc @@ -26,8 +26,19 @@ \li \uicontrol {\QC} > \uicontrol Preferences \endtable + \section1 Filter preferences + To find a particular preference, use the filter located at the top left of the \uicontrol Preferences dialog. \image qtcreator-preferences.webp {Filtering preferences} + + \section1 Go to tabs in Preferences + + To go to a tab in the \uicontrol Preferences dialog from anywhere in \QC, + use the \c t \l{Searching with the Locator}{locator} filter. For example, + to open the \uicontrol Interface tab, enter \c {t preferences interface} + in the locator. + + \image qtcreator-locator-filter-t.webp {Using the locator to open a tab in Preferences} */ From 70ed0aaa820da09351434d42cb9dd87c9f812d81 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Wed, 25 Oct 2023 14:02:57 +0200 Subject: [PATCH 1726/1777] Doc: Describe using variables in "Default build directory" field In Preferences > Build & Run > Default Build Properties Fixes: QTCREATORBUG-29779 Change-Id: Ic893058d081655e21a294b0dcc25ccb0184f4564 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../qtcreator-build-settings-default.webp | Bin 0 -> 5322 bytes .../images/qtcreator-projectpane.webp | Bin 0 -> 5690 bytes .../src/debugger/qtquick-debugging.qdoc | 2 +- .../creator-build-settings-qmake.qdoc | 30 +++++++++++++----- .../creator-projects-settings-build.qdoc | 3 +- 5 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-build-settings-default.webp create mode 100644 doc/qtcreator/images/qtcreator-projectpane.webp diff --git a/doc/qtcreator/images/qtcreator-build-settings-default.webp b/doc/qtcreator/images/qtcreator-build-settings-default.webp new file mode 100644 index 0000000000000000000000000000000000000000..32d59fc9d239ce2125b52251a77f11ad03fcae9b GIT binary patch literal 5322 zcmWIYbaOi-!oU#j>J$(bVBxb>gn>c7ze$VXYQ*+`{|lv_$6d0%eYv{df6me!dF2I% zZ~J@;WnTXM)!Ox!YCnkPIPPr!ulw`A_W%DPzUO?nq7I8)@aRb8*(9lQyv0?6z2(}6 z$rF;pF6HEAFR^KUetQz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~a%Zkz2!#=hkZNCGLwi%lg!a<h@(6cb8M8&i>NLUko`` zyuVo|k{j++m2*7#-|tnuKi{wZ#$OY^wM5vG=fcq{!OPr-r>o!jA=Y~N>mpaBeOYhr zTNZFK%wN#cvQH_xti|12uyg&akKG$j{7rIUjNs<sJ>#(`^S<ELAFD(^zDY=#bF`{8 zV^zt|l251pYp$EI!tneNiIssXw|#4z*s=bW+RU}bc1<<sx+S*4dX2`r87nTPKkB)% zK_FX6Fn+5Nt8`$lh?K~5pDR1QRz}W<oY^T?b2a9M?&R>cCJp85M=T5iKTqm79Deq} znnkyz^-VUdc)nEPxmwmTUa@v*!RGa|7Js*0nRzoM?bh=`eQi&bvZF4&cEZe}Nxm(Q zR)?)xCwp35Zq|yaWuL^JWeN7KpOx=(#mvi>yLfBIvGB9}YFS6T&mM}&JyRdQ)$o7q z)nhSVL%9R@Wu3XsCVlylh|1ZOGaNpLa$k3`+?Q3Sdg^0nF;|WJ#)LRosZBxJbL4ni zZ>&_ztq9GGVBQ#YxQJIR=SZsWZ9x}_eOZ2t_S)T77dB3f61-KZ*UvXqB0JSYA-1^k z&F(alL}~V|vosEcpJm-p9yMoHSo^Wc^#YtH-Z8CL?cKcXQO$K8wH%kiCy!RQ$zJW) zcxu@su8PtOzJuAG#+xRa&)y)YBptuCcjA$x_nwbmU8s0*r{U-QXFZlusfX_<J-Z-% zv1|P-W`E<H>1iyxXDVJcTGaUB5XfyZf?expX}{O0+?lh*<4E{f;XN^CQ7VsCKjW0s Ulg`bF0|kNP=lO>JIjgi70J8HeGXMYp literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-projectpane.webp b/doc/qtcreator/images/qtcreator-projectpane.webp new file mode 100644 index 0000000000000000000000000000000000000000..a8391a678d2451ab05be4eb353bc7fc7cf53f0e0 GIT binary patch literal 5690 zcmWIYbaOKjV_*n(bqWXzu<%h8V_?uf(B#JO^+EOj|Aort=b!#Ft9tL+uzP#?@2b0x z?!6W}u=ji3PL7UC)h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xiV*5){=+6j!aC~S)sCSmc%b_r9)pF zFKaGSj!~Mi<F`!3-;FW4*O<%pP6>X^`)6fGXqLk<_nHZ(RV`CDs`Pu$x{|s(=%U73 z`SyyRmO7!j>W7MJ!_QpVlf2A&3q#($dcXMn+iztYv<^R$z52?=ySru>et#HOaqdmm zOZ_ZoUjBW|7I~LvR4jWqcjbfp-o;BUuZw-Q;CF$(O}d%r7q0lZ98vO*eJ4%7w?Rzb ka-++>jb_glu<sC?mwr>!_`Usgcfo&d_v-Vi=5R0o0A+RG00000 literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/debugger/qtquick-debugging.qdoc b/doc/qtcreator/src/debugger/qtquick-debugging.qdoc index 29589073f9a..56cefd70e62 100644 --- a/doc/qtcreator/src/debugger/qtquick-debugging.qdoc +++ b/doc/qtcreator/src/debugger/qtquick-debugging.qdoc @@ -94,7 +94,7 @@ You can enable or disable QML debugging globally in \preferences > \uicontrol {Build & Run} > \uicontrol {Default Build Properties}. - \image qtcreator-build-settings-default.png "Default Build Properties tab in Build & Run Preferences" + \image qtcreator-build-settings-default.webp "Default Build Properties tab in Build & Run Preferences" The value of the \uicontrol {QML debugging} field determines what happens when creating new build configurations. The values \uicontrol Enable diff --git a/doc/qtcreator/src/projects/creator-only/creator-build-settings-qmake.qdoc b/doc/qtcreator/src/projects/creator-only/creator-build-settings-qmake.qdoc index 17a1b43c9c3..2d427ee15aa 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-build-settings-qmake.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-build-settings-qmake.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! @@ -8,15 +8,22 @@ \title qmake Build Configuration - \image qtcreator-projectpane.png "qmake build settings" + Specify build settings for the selected \l{glossary-buildandrun-kit} + {build and run kit} in \uicontrol Projects > \uicontrol {Build & Run} + > \uicontrol Build > \uicontrol {Build Settings}. + + \image qtcreator-projectpane.webp {qmake build settings} By default, \QC builds qmake projects in a separate directory from the source directory, as \l{glossary-shadow-build} {shadow builds}. This - keeps the files generated for each \l{glossary-buildandrun-kit} - {build and run kit} separate. If you only build and run with a single - \l{glossary-buildandrun-kit}{kit}, you can deselect the - \uicontrol {Shadow build} checkbox. Select the build directory in the - \uicontrol {Build Directory} field. + keeps the files generated for each kit separate. If you only build and + run with a single kit, you can deselect the \uicontrol {Shadow build} + checkbox. + + Select the build directory in the \uicontrol {Build Directory} field. You + can use the \l{Using Qt Creator Variables}{variables} that are listed when + you select the \inlineimage icons/replace.png (\uicontrol {Variables}) + button. To make in-source builds the default option for all projects, select \preferences > \uicontrol {Build & Run} > @@ -54,7 +61,14 @@ To set the default build properties, select \preferences > \uicontrol {Build & Run} > \uicontrol {Default Build Properties}. - \image qtcreator-build-settings-default.png "Default Build Properties tab in Build & Run Preferences" + \image qtcreator-build-settings-default.webp {Default Build Properties tab in Build & Run Preferences} + + In the \uicontrol {Default build directory} field, you can use the variables + that are listed when you select \inlineimage icons/replace.png, as well as + variables that are available for a particular kit. Those you can see when + you select the button in the \uicontrol Projects > \uicontrol {Build & Run} > + \uicontrol Build > \uicontrol {Build Settings} > \uicontrol {Build Directory} + field for a kit. \section1 Compiling QML diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc index 73a2f34bbab..5cde8af4c03 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc @@ -35,7 +35,8 @@ \section1 Managing Build Configurations - Specify build settings in \uicontrol Projects > \uicontrol {Build & Run} + Specify build settings for the selected \l{glossary-buildandrun-kit} + {build and run kit} in \uicontrol Projects > \uicontrol {Build & Run} > \uicontrol Build > \uicontrol {Build Settings}. \image qtcreator-build-configurations.png "Build Settings" From 9936eeba1349685cdbd1b710beedb4944f039cd2 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 26 Oct 2023 08:05:18 +0200 Subject: [PATCH 1727/1777] Utils: Handle filePathInfo() like other path tests filePathInfo() should not result in warning messages if the path is for a non existing device, just like exists etc. Fixes: QTCREATORBUG-28439 Change-Id: I47a66bd38a40a86460c4769c1a2156167e467c1b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/libs/utils/filepath.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 1a34bd038c8..8b898344278 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -628,11 +628,6 @@ expected_str<qint64> FilePath::writeFileContents(const QByteArray &data, qint64 return fileAccess()->writeFileContents(*this, data, offset); } -FilePathInfo FilePath::filePathInfo() const -{ - return fileAccess()->filePathInfo(*this); -} - FileStreamHandle FilePath::asyncCopy(const FilePath &target, QObject *context, const CopyContinuation &cont) const { @@ -1188,6 +1183,14 @@ bool FilePath::hasFileAccess() const return access.has_value(); } +FilePathInfo FilePath::filePathInfo() const +{ + const expected_str<DeviceFileAccess *> access = getFileAccess(*this); + if (!access) + return {}; + return (*access)->filePathInfo(*this); +} + /*! Returns a bool indicating whether a file or directory with this FilePath exists. */ From 1b82616f350043e96311d91d6525583d304211dd Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Wed, 25 Oct 2023 16:38:32 +0200 Subject: [PATCH 1728/1777] Doc: Describe the "Forward to local display" check box In the run settings for a remote linux device. Task-number: QTCREATORBUG-29392 Change-Id: Ib46241b62b4b0208f4f1e52419cc1b2a18e40295 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- dist/changelog/changes-12.0.0.md | 1 + .../images/qtcreator-run-settings-linux.png | Bin 8497 -> 0 bytes .../qtcreator-run-settings-remote-linux.webp | Bin 0 -> 7964 bytes .../creator-projects-settings-run-linux.qdocinc | 5 ++++- 4 files changed, 5 insertions(+), 1 deletion(-) delete mode 100644 doc/qtcreator/images/qtcreator-run-settings-linux.png create mode 100644 doc/qtcreator/images/qtcreator-run-settings-remote-linux.webp diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 6e7a8f496e4..944a3451aec 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -214,6 +214,7 @@ Projects ([PYSIDE-2153](https://bugreports.qt.io/browse/PYSIDE-2153)) ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-python-development.html#set-up-pyside6)) * Added the option to forward the display for remote Linux + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-run-settings.html#specifying-run-settings-for-linux-based-devices)) * Fixed PySide wheels installation on macOS ### vcpkg diff --git a/doc/qtcreator/images/qtcreator-run-settings-linux.png b/doc/qtcreator/images/qtcreator-run-settings-linux.png deleted file mode 100644 index 14e4d5f9695e1e693c9d9a27deb099acf9c27542..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8497 zcmeAS@N?(olHy`uVBq!ia0y~yV3uZJV7S4-#K6G7qme1ez@YHM)5S5Q;?~=_xBKoK zo7wPLj!h>!MRO9<5xJ9AXMBV_?Rrcmt!dsHmc}+|?tuvPZ%RQtUu+!mbPjN(y(<!C ztWHd1ihJj}&U9_;ei!?*|58LxT1~E%Df|BYvGbwC$w!kmMtm&|-TAfKc)txd0|NuY z;}6_jAevz@$PoutfY=6FAhM?`2t+}ItkOfa&)+X+@$pqO7f4?M%i>=zZ~r-;A1_+J zr*5BXB_jg^Lr+>r^sn_vGrV3;mD=>{-SSrkwWn6kk9+C3_WJqv0XrBN7#ad^CWoxw zXMH&*<k`2^@_E7g7#J81SgkUe61CMptJvO+m4SglB6OkGtp%&5zI2wD`Y;jXhSRpM zmw#Pxca1z$K0`J%Gw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&cmMzZ diff --git a/doc/qtcreator/images/qtcreator-run-settings-remote-linux.webp b/doc/qtcreator/images/qtcreator-run-settings-remote-linux.webp new file mode 100644 index 0000000000000000000000000000000000000000..0c2b00e89b01ff21d13712f3ef2e7c23ba1b1fbb GIT binary patch literal 7964 zcmWIYbaNAtXJ80-bqWXzu<&7*XJF9(;pENmHDUJu`%{J8->1&A%xWr3Ec>`ZC;#4D z4SzXywTWtWH}*_6d*5gL?OExh;=YiTCP$@j6v%%vs^BjExBvhDIn}?lz7z^9RJqk5 z)wUovae_<KGFA21t<L=_Pcly}n5VIu<F1cWmb>HpFkeLtalR8*x8>%}-fm)O!DZ~( z_i)qcGjofCZdMDN2{unl%R6qc{K=`1XI8tWG{v_4pICZ(+a|MYSG%Cj$EEH3omcMu z+pWzfSzGjj$^YXWum71Bw~1~m<m=r1Wa8b=^9~*>d?uRtbv4u5+U#%h&u1=f>gIkg zYO`?G^7EqITfgmST{>TD)s|0Z=Kj_)-Tr*rulA+S*R$tonXQoZcr+)xd~g37i{*db zseRvegS~oRp^fUp%pC!&LK~ly%rpKU?R7+U{ey|+^4{k@@_tdx3(@%|ety^fzWtk@ zgzwMII4t^*Pt82CykNn~`rvcBCf{1I?$(PtcXrx8<*mLy>+kZL^>(k%b3dpokTPL< zyZXGjS7cBBqD+N-@kx8c@{hPJke%Cie!7#`<0TnVEc4QLuswh9^ajV4h3{pBHc6<v zUREfOis_%8xcI_5`A3mG(-&nb?3l9BZK3B8_lqVXG5ph$7GJQkkSz={;br;!Q7A{` zR@S*!7Mioznkp*{&A8r1p4(g)WU}u@oyv)#+>p=DW!_cExBvcY`18cS2RmkTO`jW+ zpFg|m$Cur8Ti*2gMosNl`8+z<-0s2^^NHU!Sv-H2^Nx*?n}xaCRNf>0`9<%aoI;oP z9GxfOwlURO&F|?smdSrwrgxvbJ2$fQ-MgF3-Q9P#uQ83O_}>0ISei*YbobvAA45*1 zbNthL_Q-Wbws>Hy+5MZ>syUpZ?3ojt=l@*%@vc-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zL7&O3jo(z|rUu*%FMaf);(tg<U|roGmV3e%?0*(~pD1i}#;a-f*UcN5*}h-AQ?J$K zprG{rcbP}nY%lAGfbUzkaX<82c*5(rfvlJJtpg^7E7x8*mV1)*?*DTh4!)6BzE;0@ zw?cSz^`v<RG9P#pXn%An>3+9(9{;q>+|_T7r~kcIJEN`WeIG}h=C*ee*X&CFe=j-N zQ+(b6T`kU8*2`~j`)6BwPoBHeYW1zfOmA-P+In|_uj+mSb2B5ewMzvx_C^M>MK4ci zSU6SDNA}1cN4=z3I%o8Lh!(b#GX}d!TPMt!vTV`sW4-1xqzmQePw2Ftw`e2#W&M*~ zW+n!u0+T12Eiu$ucJi1*xT{jQ$g}bT2O2ytlxIBfu%9NsVEbm3qN6DvQ(GfD#n14v zU%D1K`H=WaX4Zd=EE3zd9eyTvkSkvM!&h&f{>;_8?<)(wJraA&-=$-Qn(Vg^!jI<$ tGyZqDs`S4o=KI0+$FZ}ta)UGfxQG~t{eRDB^4tIO)f>OB`RHjf003Z~W$pj~ literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/linux-mobile/creator-projects-settings-run-linux.qdocinc b/doc/qtcreator/src/linux-mobile/creator-projects-settings-run-linux.qdocinc index 017163c3eeb..ea58383ea44 100644 --- a/doc/qtcreator/src/linux-mobile/creator-projects-settings-run-linux.qdocinc +++ b/doc/qtcreator/src/linux-mobile/creator-projects-settings-run-linux.qdocinc @@ -21,10 +21,13 @@ command in the \uicontrol {Alternate executable on device} field and select the \uicontrol {Use this command instead} check box. - \image qtcreator-run-settings-linux.png "Run settings for Linux-based devices" + \image qtcreator-run-settings-remote-linux.webp {Run settings for Linux-based devices} You can specify arguments to pass to your application in the \uicontrol {Command line arguments} field. + Select the \uicontrol {Forward to local display} check box to show a remotely + running X11 client on a local display. + //! [run settings linux] */ From 042aa1aa25e3dadd5b94c3a926058820a1e2bf53 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 16 Oct 2023 13:15:17 +0200 Subject: [PATCH 1729/1777] LogViewer: Add Filter Change-Id: I3df36ad7dcbe4a28fb5430397063d70bbc61c80b Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/coreplugin/loggingviewer.cpp | 197 ++++++++++++++++------- 1 file changed, 137 insertions(+), 60 deletions(-) diff --git a/src/plugins/coreplugin/loggingviewer.cpp b/src/plugins/coreplugin/loggingviewer.cpp index bf1f8b736f0..1cb95ae8b7f 100644 --- a/src/plugins/coreplugin/loggingviewer.cpp +++ b/src/plugins/coreplugin/loggingviewer.cpp @@ -7,7 +7,9 @@ #include "coreplugintr.h" #include "icore.h" +#include <utils/async.h> #include <utils/basetreeview.h> +#include <utils/fancylineedit.h> #include <utils/fileutils.h> #include <utils/layoutbuilder.h> #include <utils/listmodel.h> @@ -31,7 +33,6 @@ #include <QSplitter> #include <QToolButton> #include <QVBoxLayout> - namespace Core::Internal { static QColor colorForCategory(const QString &category); @@ -209,6 +210,13 @@ public: return false; } + bool isEnabledOriginally(QtMsgType msgType) const + { + if (m_originalSettings) + return (*m_originalSettings)[msgType]; + return isEnabled(msgType); + } + void setEnabled(QtMsgType msgType, bool isEnabled) { QTC_ASSERT(!m_useOriginal, return); @@ -308,6 +316,8 @@ public: ~LoggingCategoryModel() override; enum Column { Color, Name, Debug, Warning, Critical, Fatal, Info }; + enum Role { OriginalStateRole = Qt::UserRole + 1 }; + void append(const LoggingCategoryEntry &entry); int columnCount(const QModelIndex &) const final { return 7; } int rowCount(const QModelIndex & = QModelIndex()) const final { return m_categories.size(); } @@ -363,12 +373,18 @@ QVariant LoggingCategoryModel::data(const QModelIndex &index, int role) const static const QColor defaultColor = Utils::creatorTheme()->palette().text().color(); return defaultColor; - } else if (role == Qt::CheckStateRole && index.column() >= Column::Debug - && index.column() <= Column::Info) { - const LoggingCategoryEntry &entry = m_categories.at(index.row()); - return entry.isEnabled(static_cast<QtMsgType>(index.column() - Column::Debug)) - ? Qt::Checked - : Qt::Unchecked; + } else if (index.column() >= Column::Debug && index.column() <= Column::Info) { + if (role == Qt::CheckStateRole) { + const LoggingCategoryEntry &entry = m_categories.at(index.row()); + const bool isEnabled = entry.isEnabled( + static_cast<QtMsgType>(index.column() - Column::Debug)); + return isEnabled ? Qt::Checked : Qt::Unchecked; + } else if (role == OriginalStateRole) { + const LoggingCategoryEntry &entry = m_categories.at(index.row()); + return entry.isEnabledOriginally(static_cast<QtMsgType>(index.column() - Column::Debug)) + ? Qt::Checked + : Qt::Unchecked; + } } return {}; } @@ -609,9 +625,8 @@ LoggingViewManagerWidget::LoggingViewManagerWidget(QWidget *parent) auto qtInternal = new QToolButton; qtInternal->setIcon(Core::Icons::QTLOGO.icon()); - qtInternal->setToolTip(Tr::tr("Toggle Qt Internal Logging")); - qtInternal->setCheckable(true); - qtInternal->setChecked(false); + qtInternal->setToolTip(Tr::tr("Filter Qt Internal Log Categories")); + qtInternal->setCheckable(false); auto autoScroll = new QToolButton; autoScroll->setIcon(Utils::Icons::ARROW_DOWN.icon()); @@ -663,26 +678,52 @@ LoggingViewManagerWidget::LoggingViewManagerWidget(QWidget *parent) for (int i = LoggingCategoryModel::Column::Color; i < LoggingCategoryModel::Column::Info; i++) m_categoryView->resizeColumnToContents(i); + auto filterEdit = new Utils::FancyLineEdit; + filterEdit->setHistoryCompleter("LogFilterCompletionHistory"); + filterEdit->setFiltering(true); + filterEdit->setPlaceholderText(Tr::tr("Filter categories by regular expression")); + filterEdit->setText("^(?!qt\\.).+"); + filterEdit->setValidationFunction( + [](const QString &input) { + return Utils::asyncRun([input]() -> Utils::expected_str<QString> { + QRegularExpression re(input); + if (re.isValid()) + return input; + + return Utils::make_unexpected( + Tr::tr("Invalid regular expression: %1").arg(re.errorString())); + }); + }); + QSplitter *splitter{nullptr}; using namespace Layouting; // clang-format off Column { - Row { - spacing(0), - save, - clean, - m_stopLog, - qtInternal, - autoScroll, - m_timestamps, - m_messageTypes, - st, - }, Splitter { bindTo(&splitter), - m_logView, - m_categoryView, + Column { + noMargin(), + Row { + spacing(0), + save, + clean, + m_stopLog, + autoScroll, + m_timestamps, + m_messageTypes, + st, + }, + m_logView + }, + Column { + noMargin(), + Row { + qtInternal, + filterEdit, + }, + m_categoryView, + } } }.attachTo(this); // clang-format on @@ -746,14 +787,19 @@ LoggingViewManagerWidget::LoggingViewManagerWidget(QWidget *parent) m_sortFilterModel->setFilterRegularExpression("^(?!qt\\.).+"); - connect(qtInternal, &QToolButton::toggled, m_sortFilterModel, [this](bool checked) { - if (checked) { - m_sortFilterModel->setFilterRegularExpression(""); - } else { - m_sortFilterModel->setFilterRegularExpression("^(?!qt\\.).+"); - } + connect(qtInternal, &QToolButton::clicked, filterEdit, [filterEdit] { + filterEdit->setText("^(?!qt\\.).+"); }); + connect(filterEdit, + &Utils::FancyLineEdit::textChanged, + m_sortFilterModel, + [this](const QString &f) { + QRegularExpression re(f); + if (re.isValid()) + m_sortFilterModel->setFilterRegularExpression(f); + }); + connect(m_timestamps, &QToolButton::toggled, this, [this](bool checked) { m_logView->setColumnHidden(0, !checked); }); @@ -802,40 +848,70 @@ void LoggingViewManagerWidget::showLogCategoryContextMenu(const QPoint &pos) con QMenu m; auto uncheckAll = new QAction(Tr::tr("Uncheck All"), &m); + auto resetAll = new QAction(Tr::tr("Reset All"), &m); - int column = 0; + auto isTypeColumn = [](int column) { + return column >= LoggingCategoryModel::Column::Debug + && column <= LoggingCategoryModel::Column::Info; + }; - if (idx.isValid()) { - column = idx.column(); - if (column >= LoggingCategoryModel::Column::Debug - && column <= LoggingCategoryModel::Column::Info) { - bool isChecked = idx.data(Qt::CheckStateRole).toBool(); - - QString text = isChecked ? Tr::tr("Uncheck All %1") : Tr::tr("Check All %1"); - - uncheckAll->setText(text.arg(messageTypeToString( - static_cast<QtMsgType>(column - LoggingCategoryModel::Column::Debug)))); - - connect(uncheckAll, &QAction::triggered, m_sortFilterModel, [this, idx, isChecked] { - for (int i = 0; i < m_sortFilterModel->rowCount(); ++i) { - m_sortFilterModel->setData(m_sortFilterModel->index(i, idx.column()), - !isChecked, - Qt::CheckStateRole); - } - }); - } else { - connect(uncheckAll, &QAction::triggered, m_sortFilterModel, [this] { - for (int i = 0; i < m_sortFilterModel->rowCount(); ++i) { - for (int c = LoggingCategoryModel::Column::Debug; - c <= LoggingCategoryModel::Column::Info; - ++c) { - m_sortFilterModel->setData(m_sortFilterModel->index(i, c), - false, - Qt::CheckStateRole); - } - } - }); + auto setChecked = [this](std::initializer_list<LoggingCategoryModel::Column> columns, + Qt::CheckState checked) { + for (int row = 0, count = m_sortFilterModel->rowCount(); row < count; ++row) { + for (int column : columns) { + m_sortFilterModel->setData(m_sortFilterModel->index(row, column), + checked, + Qt::CheckStateRole); + } } + }; + auto resetToOriginal = [this](std::initializer_list<LoggingCategoryModel::Column> columns) { + for (int row = 0, count = m_sortFilterModel->rowCount(); row < count; ++row) { + for (int column : columns) { + const QModelIndex id = m_sortFilterModel->index(row, column); + m_sortFilterModel->setData(id, + id.data(LoggingCategoryModel::OriginalStateRole), + Qt::CheckStateRole); + } + } + }; + + if (idx.isValid() && isTypeColumn(idx.column())) { + const LoggingCategoryModel::Column column = static_cast<LoggingCategoryModel::Column>( + idx.column()); + bool isChecked = idx.data(Qt::CheckStateRole).toInt() == Qt::Checked; + const QString uncheckText = isChecked ? Tr::tr("Uncheck All %1") : Tr::tr("Check All %1"); + + uncheckAll->setText(uncheckText.arg(messageTypeToString( + static_cast<QtMsgType>(column - LoggingCategoryModel::Column::Debug)))); + resetAll->setText(Tr::tr("Reset All %1") + .arg(messageTypeToString(static_cast<QtMsgType>( + column - LoggingCategoryModel::Column::Debug)))); + + Qt::CheckState newState = isChecked ? Qt::Unchecked : Qt::Checked; + + connect(uncheckAll, + &QAction::triggered, + m_sortFilterModel, + [setChecked, column, newState]() { setChecked({column}, newState); }); + + connect(resetAll, &QAction::triggered, m_sortFilterModel, [resetToOriginal, column]() { + resetToOriginal({column}); + }); + + } else { + // No need to add Fatal here, as it is read-only + static auto allColumns = {LoggingCategoryModel::Column::Debug, + LoggingCategoryModel::Column::Warning, + LoggingCategoryModel::Column::Critical, + LoggingCategoryModel::Column::Info}; + + connect(uncheckAll, &QAction::triggered, m_sortFilterModel, [setChecked]() { + setChecked(allColumns, Qt::Unchecked); + }); + connect(resetAll, &QAction::triggered, m_sortFilterModel, [resetToOriginal]() { + resetToOriginal(allColumns); + }); } // minimal load/save - plugins could later provide presets on their own? @@ -844,6 +920,7 @@ void LoggingViewManagerWidget::showLogCategoryContextMenu(const QPoint &pos) con auto loadPreset = new QAction(Tr::tr("Update from Preset..."), &m); m.addAction(loadPreset); m.addAction(uncheckAll); + m.addAction(resetAll); connect(savePreset, &QAction::triggered, m_categoryModel, From 1a398a83b51b9e220fd95993d0872bf4baba0723 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Wed, 25 Oct 2023 14:23:57 +0200 Subject: [PATCH 1730/1777] Core: Fix dialogParent for separate windows The dialog parent is supposed to fall back to the main window, if there is no modal window and the active window is not a popup or a splash screen. But testing for "popup or splash screen" does not work with `testAnyFlags(Popup | SplashScreen)` because these flags are combined flags - e.g. "Popup" is "Window + something", so when using testAnyFlags(Popup), that returns true for _any_ Window, regardless of popup or not. Amends 60f11cf6371fd6f482d257c54a48070874dc4b73 Fixes: QTCREATORBUG-29741 Change-Id: I9e8defc6dd7193f5008decda0eda04dedc62f9df Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/coreplugin/icore.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index eaf94e45cf5..1c04ebd2b6d 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -874,8 +874,10 @@ QWidget *ICore::dialogParent() QWidget *active = QApplication::activeModalWidget(); if (!active) active = QApplication::activeWindow(); - if (!active || (active && active->windowFlags().testAnyFlags(Qt::SplashScreen | Qt::Popup))) + if (!active || active->windowFlags().testFlag(Qt::SplashScreen) + || active->windowFlags().testFlag(Qt::Popup)) { active = d->m_mainwindow; + } return active; } From 46c0e63a6f5d79072b0d8e34e463481c598b0cf4 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 26 Oct 2023 10:09:45 +0200 Subject: [PATCH 1731/1777] Todo: Do not store current editor ...just use it when needed. Avoids a crash when heading back from Quick Designer view. Change-Id: I1dae404d0d1cd41518d46773b35a78b4cdb03947 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/todo/todoitemsprovider.cpp | 8 +++----- src/plugins/todo/todoitemsprovider.h | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/plugins/todo/todoitemsprovider.cpp b/src/plugins/todo/todoitemsprovider.cpp index 02ba71e2fcc..3ef6b344afa 100644 --- a/src/plugins/todo/todoitemsprovider.cpp +++ b/src/plugins/todo/todoitemsprovider.cpp @@ -69,8 +69,8 @@ void TodoItemsProvider::updateList() // Show only items of the current file if any if (m_settings.scanningScope == ScanningScopeCurrentFile) { - if (m_currentEditor) - m_itemsList = m_itemsHash.value(m_currentEditor->document()->filePath()); + if (auto currentEditor = Core::EditorManager::currentEditor()) + m_itemsList = m_itemsHash.value(currentEditor->document()->filePath()); // Show only items of the current sub-project } else if (m_settings.scanningScope == ScanningScopeSubProject) { if (m_startupProject) @@ -164,9 +164,8 @@ void TodoItemsProvider::projectsFilesChanged() updateList(); } -void TodoItemsProvider::currentEditorChanged(Core::IEditor *editor) +void TodoItemsProvider::currentEditorChanged() { - m_currentEditor = editor; if (m_settings.scanningScope == ScanningScopeCurrentFile || m_settings.scanningScope == ScanningScopeSubProject) { updateList(); @@ -192,7 +191,6 @@ void TodoItemsProvider::setupStartupProjectBinding() void TodoItemsProvider::setupCurrentEditorBinding() { - m_currentEditor = Core::EditorManager::currentEditor(); connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged, this, &TodoItemsProvider::currentEditorChanged); } diff --git a/src/plugins/todo/todoitemsprovider.h b/src/plugins/todo/todoitemsprovider.h index 2843d3df62a..1a7702b9eef 100644 --- a/src/plugins/todo/todoitemsprovider.h +++ b/src/plugins/todo/todoitemsprovider.h @@ -46,7 +46,6 @@ private: QList<TodoItemsScanner *> m_scanners; ProjectExplorer::Project *m_startupProject; - Core::IEditor* m_currentEditor; bool m_shouldUpdateList; @@ -63,7 +62,7 @@ private: void itemsFetched(const QString &fileName, const QList<TodoItem> &items); void startupProjectChanged(ProjectExplorer::Project *project); void projectsFilesChanged(); - void currentEditorChanged(Core::IEditor *editor); + void currentEditorChanged(); void updateListTimeoutElapsed(); }; From 6ee59b3d3f27b24cb8af42098627b241df06daee Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Thu, 26 Oct 2023 12:42:37 +0200 Subject: [PATCH 1732/1777] Valgrind: Fix QColor warning The code for generating random colors nowadays results in HSL parameters out of range warnings. Fix the generation of random color values. Change-Id: I27dfb1c59ced8f6776e83679532b296b69c089a9 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/valgrind/callgrindhelper.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/valgrind/callgrindhelper.cpp b/src/plugins/valgrind/callgrindhelper.cpp index 62dd37b0723..18c25a201fe 100644 --- a/src/plugins/valgrind/callgrindhelper.cpp +++ b/src/plugins/valgrind/callgrindhelper.cpp @@ -20,10 +20,9 @@ QColor CallgrindHelper::colorForString(const QString &text) return colorCache.value(text); // Minimum lightness of 100 to be readable with black text. - const QColor color = QColor::fromHsl( - ((qreal) QRandomGenerator::global()->generate() / RAND_MAX * 359), - ((qreal) QRandomGenerator::global()->generate() / RAND_MAX * 255), - ((qreal) QRandomGenerator::global()->generate() / RAND_MAX * 127) + 128); + const QColor color = QColor::fromHsl(QRandomGenerator::global()->generate() % 360, + QRandomGenerator::global()->generate() % 256, + QRandomGenerator::global()->generate() % 128 + 128); colorCache[text] = color; return color; } From a71d404d7d6eb429ca2862342aab57c971934121 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 26 Oct 2023 10:09:21 +0200 Subject: [PATCH 1733/1777] ProjectExplorer: Add "poky" os flavor (Boot2Qt) Task-number: QTCREATORBUG-28863 Change-Id: Iae24a74651362a32c42b96215c8d71abe9bad7e3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/projectexplorer/abi.cpp | 4 ++++ src/plugins/projectexplorer/abi.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 165eaf2b58a..07365fc5dd0 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -100,6 +100,7 @@ static void setupPreregisteredOsFlavors() { Abi::OS::UnixOS, Abi::OS::QnxOS, Abi::OS::BareMetalOS}); + registerOsFlavor(Abi::PokyFlavor, "poky", {Abi::OS::LinuxOS}); registerOsFlavor(Abi::UnknownFlavor, "unknown", {Abi::OS::BsdOS, Abi::OS::LinuxOS, Abi::OS::DarwinOS, @@ -618,6 +619,9 @@ Abi Abi::abiFromTargetTriplet(const QString &triple) width = 32; } else if (p.startsWith("asmjs")) { arch = AsmJsArchitecture; + } else if (p == "poky") { + os = LinuxOS; + flavor = PokyFlavor; } else if (p == "none") { os = BareMetalOS; flavor = GenericFlavor; diff --git a/src/plugins/projectexplorer/abi.h b/src/plugins/projectexplorer/abi.h index 13fc0191282..7bf808071cc 100644 --- a/src/plugins/projectexplorer/abi.h +++ b/src/plugins/projectexplorer/abi.h @@ -102,6 +102,9 @@ public: RtosFlavor, GenericFlavor, + // Yocto + PokyFlavor, + UnknownFlavor // keep last in this enum! }; From 6b831a3737054a12d96580d4153cb24cad5b8460 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 26 Oct 2023 09:39:07 +0200 Subject: [PATCH 1734/1777] Utils: Disable Native Dialogs when not supported Task-number: QTBUG-118241 Change-Id: I1c7d16f44b5fdcba94dd2a6691a73dd2e549164b Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/libs/utils/checkablemessagebox.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/checkablemessagebox.cpp b/src/libs/utils/checkablemessagebox.cpp index 40f8b17076a..8e43debc4f7 100644 --- a/src/libs/utils/checkablemessagebox.cpp +++ b/src/libs/utils/checkablemessagebox.cpp @@ -53,15 +53,18 @@ static QMessageBox::StandardButton exec( msgBox.setTextFormat(Qt::RichText); msgBox.setTextInteractionFlags(Qt::LinksAccessibleByKeyboard | Qt::LinksAccessibleByMouse); +#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0) if (HostOsInfo::isMacHost()) { // Message boxes on macOS cannot display links. // If the message contains a link, we need to disable native dialogs. - if (text.contains("<a ")) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0) + if (text.contains("<a ")) + msgBox.setOptions(QMessageBox::Option::DontUseNativeDialog); + + // Workaround for QTBUG-118241 + if (!buttonTextOverrides.isEmpty()) msgBox.setOptions(QMessageBox::Option::DontUseNativeDialog); -#endif - } } +#endif if (decider.shouldAskAgain) { if (!decider.shouldAskAgain()) From cb8d79bb2fc727508cefe3ce01ef6d2055ada562 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Thu, 26 Oct 2023 13:02:56 +0200 Subject: [PATCH 1735/1777] LanguageClient: check correct provider for various goto targets Change-Id: Ie0acf800fad46cc11f7bb5b5134fc5b70beeaddd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../languageclientsymbolsupport.cpp | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/plugins/languageclient/languageclientsymbolsupport.cpp b/src/plugins/languageclient/languageclientsymbolsupport.cpp index 867137fcc07..2631a853996 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.cpp +++ b/src/plugins/languageclient/languageclientsymbolsupport.cpp @@ -78,8 +78,10 @@ SymbolSupport::SymbolSupport(Client *client) : m_client(client) {} -template<typename Request> -static MessageId sendTextDocumentPositionParamsRequest(Client *client, const Request &request) +template<typename Request, typename R> +static MessageId sendTextDocumentPositionParamsRequest(Client *client, + const Request &request, + R ServerCapabilities::*member) { if (!request.isValid(nullptr)) return {}; @@ -97,8 +99,7 @@ static MessageId sendTextDocumentPositionParamsRequest(Client *client, const Req else sendMessage = supportedFile; } else { - const std::optional<std::variant<bool, WorkDoneProgressOptions>> &provider - = serverCapability.referencesProvider(); + const auto provider = std::mem_fn(member)(serverCapability); sendMessage = provider.has_value(); if (sendMessage && std::holds_alternative<bool>(*provider)) sendMessage = std::get<bool>(*provider); @@ -110,7 +111,8 @@ static MessageId sendTextDocumentPositionParamsRequest(Client *client, const Req return {}; } -static void handleGotoResponse(const GotoDefinitionRequest::Response &response, +template<typename Request> +static void handleGotoResponse(const typename Request::Response &response, Utils::LinkHandler callback, std::optional<Utils::Link> linkUnderCursor, const Client *client) @@ -141,19 +143,20 @@ static TextDocumentPositionParams generateDocPosParams(TextEditor::TextDocument return TextDocumentPositionParams(documentId, pos); } -template<typename Request> +template<typename Request, typename R> static MessageId sendGotoRequest(TextEditor::TextDocument *document, const QTextCursor &cursor, Utils::LinkHandler callback, Client *client, - std::optional<Utils::Link> linkUnderCursor) + std::optional<Utils::Link> linkUnderCursor, + R ServerCapabilities::*member) { Request request(generateDocPosParams(document, cursor, client)); request.setResponseCallback([callback, linkUnderCursor, client]( - const GotoDefinitionRequest::Response &response) { - handleGotoResponse(response, callback, linkUnderCursor, client); + const typename Request::Response &response) { + handleGotoResponse<Request>(response, callback, linkUnderCursor, client); }); - return sendTextDocumentPositionParamsRequest(client, request); + return sendTextDocumentPositionParamsRequest(client, request, member); return request.id(); } @@ -223,19 +226,22 @@ MessageId SymbolSupport::findLinkAt(TextEditor::TextDocument *document, cursor, callback, m_client, - linkUnderCursor); + linkUnderCursor, + &ServerCapabilities::definitionProvider); case LinkTarget::SymbolTypeDef: return sendGotoRequest<GotoTypeDefinitionRequest>(document, cursor, callback, m_client, - linkUnderCursor); + linkUnderCursor, + &ServerCapabilities::typeDefinitionProvider); case LinkTarget::SymbolImplementation: return sendGotoRequest<GotoImplementationRequest>(document, cursor, callback, m_client, - linkUnderCursor); + linkUnderCursor, + &ServerCapabilities::implementationProvider); } return {}; } @@ -389,7 +395,7 @@ std::optional<MessageId> SymbolSupport::findUsages(TextEditor::TextDocument *doc handleFindReferencesResponse(response, wordUnderCursor, handler); }); - sendTextDocumentPositionParamsRequest(m_client, request); + sendTextDocumentPositionParamsRequest(m_client, request, &ServerCapabilities::referencesProvider); return request.id(); } From ee4f6ca1ae06ea932789fb41fdf8b9427ad27478 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 26 Oct 2023 11:19:47 +0200 Subject: [PATCH 1736/1777] Qt: Fix qt abi version saving / restoring Fixes: QTCREATORBUG-28863 Change-Id: Ifd6024f3d4b1fc108136093299d76227b7b09c71 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/qtsupport/baseqtversion.cpp | 65 ++++++++++++++++--------- src/plugins/qtsupport/baseqtversion.h | 2 + 2 files changed, 45 insertions(+), 22 deletions(-) diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 8bc703e1817..5e5d29c30d9 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -78,13 +78,14 @@ class QtVersionData { public: // Update version if you add data members! - static const int version = 1; + static const int version = 2; bool installed = true; bool hasExamples = false; bool hasDemos = false; bool hasDocumentation = false; - bool hasQtAbis = false; + + std::optional<Abis> qtAbis; DisplayName unexpandedDisplayName; QString qtVersionString; @@ -114,8 +115,6 @@ public: Utils::FilePath hostDataPath; Utils::FilePath hostPrefixPath; - Abis qtAbis; - QHash<ProKey, ProString> versionInfo; bool versionInfoUpToDate = false; @@ -143,7 +142,6 @@ public: result.insert("HasExamples", hasExamples); result.insert("HasDemos", hasDemos); result.insert("HasDocumentation", hasDocumentation); - result.insert("HasQtAbis", hasQtAbis); result.insert("VersionInfoUpToDate", versionInfoUpToDate); unexpandedDisplayName.toMap(result, "UnexpandedDisplayName"); @@ -169,7 +167,8 @@ public: result.insert("HostLibexecPath", hostLibexecPath.toSettings()); result.insert("HostDataPath", hostDataPath.toSettings()); result.insert("HostPrefixPath", hostPrefixPath.toSettings()); - result.insert("QtAbis", Utils::transform(qtAbis, &Abi::toString)); + if (qtAbis) + result.insert("QtAbis", Utils::transform(*qtAbis, &Abi::toString)); result.insert("VersionInfo", QVariant::fromValue(toStore(versionInfo))); return result; @@ -184,7 +183,6 @@ public: hasExamples = map.value("HasExamples").toBool(); hasDemos = map.value("HasDemos").toBool(); hasDocumentation = map.value("HasDocumentation").toBool(); - hasQtAbis = map.value("HasQtAbis").toBool(); versionInfoUpToDate = map.value("VersionInfoUpToDate", false).toBool(); unexpandedDisplayName.fromMap(map, "UnexpandedDisplayName"); qtVersionString = map.value("QtVersionString").toString(); @@ -208,7 +206,9 @@ public: hostLibexecPath = FilePath::fromSettings(map.value("HostLibexecPath")); hostDataPath = FilePath::fromSettings(map.value("HostDataPath")); hostPrefixPath = FilePath::fromSettings(map.value("HostPrefixPath")); - qtAbis = Utils::transform(map.value("QtAbis").toStringList(), &Abi::fromString); + auto it = map.find("QtAbis"); + if (it != map.end()) + qtAbis = Utils::transform(it.value().toStringList(), &Abi::fromString); versionInfo = fromStore(map.value("VersionInfo").value<Store>()); } }; @@ -767,18 +767,22 @@ void QtVersion::fromMap(const Store &map, const FilePath &filePath, bool forceRe const expected_str<Utils::Store> persistentStore = PersistentCacheStore::byKey( Key("QtVersionData" + d->m_qmakeCommand.toString().toUtf8())); - if (persistentStore && !forceRefreshCache) { + if (persistentStore && !forceRefreshCache) d->m_data.fromMap(*persistentStore); - } else { + else d->m_data.qtSources = FilePath::fromSettings(map.value(QTVERSIONSOURCEPATH)); - // Handle ABIs provided by the SDKTool: - // Note: Creator does not write these settings itself, so it has to come from the SDKTool! - d->m_data.qtAbis = Utils::transform<Abis>(map.value(QTVERSION_ABIS).toStringList(), - &Abi::fromString); - d->m_data.qtAbis = Utils::filtered(d->m_data.qtAbis, &Abi::isValid); - d->m_data.hasQtAbis = !d->m_data.qtAbis.isEmpty(); + Store::const_iterator itQtAbis = map.find(QTVERSION_ABIS); + if (itQtAbis != map.end()) { + // Only the SDK Tool writes abis to the settings. If we find abis in the settings, we want + // to make sure to use them as our automatic detection is not perfect. + const QStringList abiList = itQtAbis.value().toStringList(); + if (!abiList.isEmpty()) { + const Abis abis = Utils::transform<Abis>(abiList, &Abi::fromString); + d->m_data.qtAbis = Utils::filtered(abis, &Abi::isValid); + } } + updateDefaultDisplayName(); // Clear the cached qmlscene command, it might not match the restored path anymore. @@ -798,9 +802,10 @@ Store QtVersion::toMap() const result.insert(QTVERSIONQMAKEPATH, qmakeFilePath().toSettings()); - if (d->m_data.versionInfoUpToDate) + if (d->m_data.versionInfoUpToDate) { PersistentCacheStore::write(Key("QtVersionData" + d->m_qmakeCommand.toString().toUtf8()), d->m_data.toMap()); + } return result; } @@ -858,13 +863,22 @@ FilePath QtVersion::qmakeFilePath() const return d->m_qmakeCommand; } +bool QtVersion::hasQtAbisSet() const +{ + return d->m_data.qtAbis.has_value(); +} + Abis QtVersion::qtAbis() const { - if (!d->m_data.hasQtAbis) { + if (!d->m_data.qtAbis) d->m_data.qtAbis = detectQtAbis(); - d->m_data.hasQtAbis = true; - } - return d->m_data.qtAbis; + + return *d->m_data.qtAbis; +} + +void QtVersion::setQtAbis(const Abis &abis) +{ + d->m_data.qtAbis = abis; } Abis QtVersion::detectQtAbis() const @@ -2354,7 +2368,6 @@ Abis QtVersion::qtAbisFromLibrary(const FilePaths &coreLibraries) void QtVersion::resetCache() const { - d->m_data.hasQtAbis = false; d->m_mkspecReadUpToDate = false; } @@ -2458,6 +2471,14 @@ QtVersion *QtVersion::clone(bool forceRefreshCache) const QtVersion *version = factory->create(); QTC_ASSERT(version, return nullptr); version->fromMap(toMap(), {}, forceRefreshCache); + + // Qt Abis are either provided by SDK Tool, or detected from the binaries. + // The auto detection is not perfect, and we always want to use the data provided by + // SDK Tool if available. Since the Abis are not contained in toMap() as we + // don't let the user change them, and we probably forced the cache to refresh, we have + // to re-set them here. + if (hasQtAbisSet()) + version->setQtAbis(qtAbis()); return version; } } diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index f75ef202b18..796d76aa3e9 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -75,7 +75,9 @@ public: virtual QString description() const = 0; virtual QString toHtml(bool verbose) const; + bool hasQtAbisSet() const; ProjectExplorer::Abis qtAbis() const; + void setQtAbis(const ProjectExplorer::Abis &abis); bool hasAbi(ProjectExplorer::Abi::OS, ProjectExplorer::Abi::OSFlavor flavor = ProjectExplorer::Abi::UnknownFlavor) const; void applyProperties(QMakeGlobals *qmakeGlobals) const; From 620ef537aaea58854d1e5f85f7edc23ddeef8030 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Thu, 26 Oct 2023 12:24:52 +0200 Subject: [PATCH 1737/1777] ScreenRecorder: Add a label to the FPS spinbox For some reason I never noticed that it was missing. Fixes: QTCREATORBUG-29809 Change-Id: I1da933d3e220c035ecdeb2f0a5d044d68081b413 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/screenrecorder/record.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index 40efe047911..cade82dbe9c 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -96,6 +96,8 @@ RecordOptionsDialog::RecordOptionsDialog(QWidget *parent) m_cropScene = new CropScene; + m_recordFrameRate.setLabelText(Tr::tr("FPS:")); + m_resetButton = new QToolButton; m_resetButton->setIcon(Icons::RESET.icon()); From 5bdd3f8e1d0eabe3a6e054a8deef164866e0f701 Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 26 Oct 2023 15:51:41 +0200 Subject: [PATCH 1738/1777] Bump version to 12.0.0-rc1 Change-Id: I3b687e44c90dc18bb0d48bb47f230d8de6c8ca66 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- cmake/QtCreatorIDEBranding.cmake | 6 +++--- qbs/modules/qtc/qtc.qbs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index 40cee3ed827..5bb17f228bd 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,6 +1,6 @@ -set(IDE_VERSION "11.0.83") # The IDE version. -set(IDE_VERSION_COMPAT "11.0.83") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "12.0.0-beta2") # The IDE display version. +set(IDE_VERSION "11.0.84") # The IDE version. +set(IDE_VERSION_COMPAT "11.0.84") # The IDE Compatibility version. +set(IDE_VERSION_DISPLAY "12.0.0-rc1") # The IDE display version. set(IDE_COPYRIGHT_YEAR "2023") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index e225d1189aa..b8e5aac0e35 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -4,16 +4,16 @@ import qbs.FileInfo import qbs.Utilities Module { - property string qtcreator_display_version: '12.0.0-beta2' + property string qtcreator_display_version: '12.0.0-rc1' property string ide_version_major: '11' property string ide_version_minor: '0' - property string ide_version_release: '83' + property string ide_version_release: '84' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release property string ide_compat_version_major: '11' property string ide_compat_version_minor: '0' - property string ide_compat_version_release: '83' + property string ide_compat_version_release: '84' property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release From 25fa42c3a2c5ffed072581ca9b89c5034836c23e Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii <artem.sokolovskii@qt.io> Date: Thu, 26 Oct 2023 11:48:09 +0200 Subject: [PATCH 1739/1777] ClangFormat: Remove set standard to cpp11 Standard sets to Auto a few lines further. Change-Id: Id0bb61cb38fbabd682123baa3860ebdaf5b10846 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- src/plugins/clangformat/clangformatutils.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 9ed92d367d0..f3e5c8f6749 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -179,7 +179,6 @@ clang::format::FormatStyle calculateQtcStyle() #endif style.SpacesInSquareBrackets = false; addQtcStatementMacros(style); - style.Standard = FormatStyle::LS_Cpp11; style.TabWidth = 4; style.UseTab = FormatStyle::UT_Never; style.Standard = FormatStyle::LS_Auto; From b77b12c97b55c941f197062e939298dae8cfca5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= <robert.loehning@qt.io> Date: Thu, 26 Oct 2023 16:51:07 +0200 Subject: [PATCH 1740/1777] SquishTests: Restore lines removed from projecttrees Partially reverts 3970a834bcc0b158a577134b32cb9992c847cd1a and 5bce234986201691839928a0e9a3e5b7bfc023af Change-Id: Iaf05f4c19e16b4e0d817350d4121ad371b8b1661 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- .../testdata/projecttree_creator.tsv | 8 ++++++++ .../testdata/projecttree_creator.tsv | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv b/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv index 38d08efa6c1..241ce7f8791 100644 --- a/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv +++ b/tests/system/suite_general/tst_opencreator_qbs/testdata/projecttree_creator.tsv @@ -12738,6 +12738,8 @@ "errorlistmodel.h" "4" "frame.cpp" "4" "frame.h" "4" +"modelhelpers.cpp" "4" +"modelhelpers.h" "4" "parser.cpp" "4" "parser.h" "4" "stack.cpp" "4" @@ -12748,6 +12750,8 @@ "status.h" "4" "suppression.cpp" "4" "suppression.h" "4" +"threadedparser.cpp" "4" +"threadedparser.h" "4" "VcsBase" "2" "vcsbase.qbs:3" "3" "PluginMetaData" "3" @@ -14807,6 +14811,8 @@ "errorlistmodel.h" "6" "frame.cpp" "6" "frame.h" "6" +"modelhelpers.cpp" "6" +"modelhelpers.h" "6" "parser.cpp" "6" "parser.h" "6" "stack.cpp" "6" @@ -14817,6 +14823,8 @@ "status.h" "6" "suppression.cpp" "6" "suppression.h" "6" +"threadedparser.cpp" "6" +"threadedparser.h" "6" "callgrindparsertests.cpp" "5" "callgrindparsertests.h" "5" "QtcManualtests" "1" diff --git a/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv b/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv index 6c5372af0a2..662eb4fe255 100644 --- a/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv +++ b/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv @@ -15805,21 +15805,25 @@ "error.h" "5" "errorlistmodel.h" "5" "frame.h" "5" +"modelhelpers.h" "5" "parser.h" "5" "stack.h" "5" "stackmodel.h" "5" "status.h" "5" "suppression.h" "5" +"threadedparser.h" "5" "Sources" "4" "announcethread.cpp" "5" "error.cpp" "5" "errorlistmodel.cpp" "5" "frame.cpp" "5" +"modelhelpers.cpp" "5" "parser.cpp" "5" "stack.cpp" "5" "stackmodel.cpp" "5" "status.cpp" "5" "suppression.cpp" "5" +"threadedparser.cpp" "5" "Headers" "3" "callgrindcostdelegate.h" "4" "callgrindcostview.h" "4" @@ -20141,11 +20145,13 @@ "error.h" "8" "errorlistmodel.h" "8" "frame.h" "8" +"modelhelpers.h" "8" "parser.h" "8" "stack.h" "8" "stackmodel.h" "8" "status.h" "8" "suppression.h" "8" +"threadedparser.h" "8" "valgrindrunner.h" "7" "Sources" "6" "callgrind" "7" @@ -20166,11 +20172,13 @@ "error.cpp" "8" "errorlistmodel.cpp" "8" "frame.cpp" "8" +"modelhelpers.cpp" "8" "parser.cpp" "8" "stack.cpp" "8" "stackmodel.cpp" "8" "status.cpp" "8" "suppression.cpp" "8" +"threadedparser.cpp" "8" "valgrindrunner.cpp" "7" "Headers" "5" "callgrindparsertests.h" "6" @@ -20250,11 +20258,13 @@ "error.h" "8" "errorlistmodel.h" "8" "frame.h" "8" +"modelhelpers.h" "8" "parser.h" "8" "stack.h" "8" "stackmodel.h" "8" "status.h" "8" "suppression.h" "8" +"threadedparser.h" "8" "valgrindrunner.h" "7" "Sources" "6" "callgrind" "7" @@ -20275,11 +20285,13 @@ "error.cpp" "8" "errorlistmodel.cpp" "8" "frame.cpp" "8" +"modelhelpers.cpp" "8" "parser.cpp" "8" "stack.cpp" "8" "stackmodel.cpp" "8" "status.cpp" "8" "suppression.cpp" "8" +"threadedparser.cpp" "8" "valgrindrunner.cpp" "7" "Headers" "5" "modeldemo.h" "6" From 022847c852c2dc71434843e02c6d902a2c6882fa Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Thu, 26 Oct 2023 13:22:49 +0200 Subject: [PATCH 1741/1777] Doc: Make the instructions for enabling plugins more consistent - Add the following for documented plugins that are disabled by default: \note Enable the <name> plugin to use it - Add \sa {Enable and disable plugins} for the above plugins and describe there how to find the About Plugins dialog on macOS - For the one occurrence in the QDS Manual, add instructions for finding the About Plugins dialog on macOS ("Enable and disable plugins" is not included in the QDS Manual - Mostly remove other kinds of references to enabling plugins Task-number: QTCREATORBUG-29734 Change-Id: I7b12bd651c1c99e0c6b3ca6f94d3831ebe038438 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../src/analyze/creator-axivion.qdoc | 14 ++++--------- doc/qtcreator/src/analyze/creator-coco.qdoc | 12 ++--------- .../src/analyze/creator-cppcheck.qdoc | 14 ++++--------- .../src/baremetal/creator-baremetal-dev.qdoc | 15 +++----------- .../src/conan/creator-projects-conan.qdoc | 6 +++--- doc/qtcreator/src/editors/creator-coding.qdoc | 2 +- .../creator-only/creator-beautifier.qdoc | 19 ++++++++---------- .../creator-compilation-database.qdocinc | 6 +++--- .../editors/creator-only/creator-copilot.qdoc | 13 ++---------- .../editors/creator-only/creator-scxml.qdoc | 16 +++++---------- doc/qtcreator/src/editors/creator-search.qdoc | 12 +++++------ .../src/howto/creator-keyboard-shortcuts.qdoc | 12 +++++++++-- .../creator-how-to-enable-plugins.qdoc | 16 +++++++++++++-- .../creator-how-to-install-plugins.qdoc | 5 ++--- .../howto/creator-only/creator-squish.qdoc | 12 +++-------- .../src/howto/creator-only/creator-vcpkg.qdoc | 12 +++-------- .../src/howto/creator-telemetry.qdoc | 4 +++- .../src/meson/creator-projects-meson.qdoc | 6 +++--- .../creator-projects-autotools.qdoc | 10 +++++----- .../creator-only/creator-projects-nimble.qdoc | 7 +++---- .../creator-only/qtquick-designer-plugin.qdoc | 10 +--------- .../creator-reference-to-do-entries-view.qdoc | 13 ++---------- .../vcs/creator-only/creator-vcs-gitlab.qdoc | 11 ++++------ .../creator-only/creator-vcs-perforce.qdoc | 14 +++---------- .../src/vcs/creator-only/creator-vcs.qdoc | 20 ++++++------------- .../src/webassembly/creator-webassembly.qdoc | 14 ++++--------- .../src/widgets/qtdesigner-plugins.qdoc | 3 ++- 27 files changed, 108 insertions(+), 190 deletions(-) diff --git a/doc/qtcreator/src/analyze/creator-axivion.qdoc b/doc/qtcreator/src/analyze/creator-axivion.qdoc index 610fee09b3f..f188c84151b 100644 --- a/doc/qtcreator/src/analyze/creator-axivion.qdoc +++ b/doc/qtcreator/src/analyze/creator-axivion.qdoc @@ -25,6 +25,8 @@ The experimental Axivion plugin integrates the Axivion dashboard server into \QC. + \note Enable the Axivion plugin to use it. + To use the plugin, you must set up a project in the Axivion dashboard server and link to it from \QC. You can then see style violations in the \uicontrol Edit mode and descriptions and issue counts in the @@ -44,16 +46,6 @@ To view the issue counts, select \inlineimage icons/home.png (\uicontrol {Show Dashboard}). - \section1 Enabling the Axivion Plugin - - To enable the Axivion plugin: - - \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Code Analyzer} > \uicontrol Axivion to enable the plugin. - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \endlist - \section1 Connecting to Axivion Dashboard Servers To connect to Axivion: @@ -106,4 +98,6 @@ To clear the view, select \inlineimage icons/clean_pane_small.png (\uicontrol Clear). + + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/analyze/creator-coco.qdoc b/doc/qtcreator/src/analyze/creator-coco.qdoc index b95c1901fb8..7dcc9a29397 100644 --- a/doc/qtcreator/src/analyze/creator-coco.qdoc +++ b/doc/qtcreator/src/analyze/creator-coco.qdoc @@ -42,15 +42,7 @@ To use the plugin, you must download and install Coco. - \section1 Enabling the Coco Plugin - - To enable the Coco plugin: - - \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol Utilities > \uicontrol Coco to enable the plugin. - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \endlist + \note Enable the Coco plugin to use it. \section1 Configuring Coco @@ -93,5 +85,5 @@ \li Implicit Manual Coverage Validation \endlist - For more information, see \l{Specifying Text Editor Settings}. + \sa {Enable and disable plugins}, {Specifying Text Editor Settings} */ diff --git a/doc/qtcreator/src/analyze/creator-cppcheck.qdoc b/doc/qtcreator/src/analyze/creator-cppcheck.qdoc index 324f747da47..e3cc393d705 100644 --- a/doc/qtcreator/src/analyze/creator-cppcheck.qdoc +++ b/doc/qtcreator/src/analyze/creator-cppcheck.qdoc @@ -15,20 +15,12 @@ The experimental Cppcheck Diagnostics plugin integrates diagnostics that are generated by the Cppcheck tool into the C++ editor. + \note Enable the Cppcheck plugin to use it. + Cppcheck is automatically run on open files. To select the files to check in the currently active project, select \uicontrol Analyze > \uicontrol Cppcheck. - \section1 Enabling the Cppcheck Plugin - - To enable the Cppcheck plugin: - - \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Code Analyzer} > \uicontrol Cppcheck to enable the - plugin. - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \endlist \section1 Running Cppcheck on Selected Files @@ -74,4 +66,6 @@ To specify the settings above for the automatically run checks, select \preferences > \uicontrol Analyzer > \uicontrol Cppcheck. + + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc b/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc index d49d947ff34..722cf8d89ba 100644 --- a/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc +++ b/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc @@ -54,18 +54,7 @@ ST-Link and J-Link debug server providers can be used together with the \l {uVision IDE}. - \section1 Enabling the Bare Metal Device Plugin - - To enable the Bare Metal Device plugin: - - \list 1 - - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Device Support} > \uicontrol {Bare Metal}. - - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - - \endlist + \note Enable the Bare Metal plugin to use it. \section1 Specifying Settings for Debug Server Providers @@ -273,4 +262,6 @@ You can build applications for and run them on bare metal devices in the same way as for and on the desktop. For more information, see \l{Building for Multiple Platforms} and \l{Running on Multiple Platforms}. + + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/conan/creator-projects-conan.qdoc b/doc/qtcreator/src/conan/creator-projects-conan.qdoc index 2309f0453b5..3136e2a5888 100644 --- a/doc/qtcreator/src/conan/creator-projects-conan.qdoc +++ b/doc/qtcreator/src/conan/creator-projects-conan.qdoc @@ -35,9 +35,7 @@ your operating system has. For example, on Windows, you can use the \c {choco install conan} or \c {pip install conan} command. - To enable the experimental Conan plugin, select \uicontrol Help > - \uicontrol {About Plugins} > \uicontrol Utilities > \uicontrol Conan. - Then select \uicontrol {Restart Now} to restart \QC and load the plugin. + \note Enable the Conan plugin to use it. For each project, you must write a \l{https://docs.conan.io/en/latest/reference/conanfile.html}{conanfile.py} @@ -49,4 +47,6 @@ Alternatively, you can automatically set up the Conan package manager for use with CMake. For more information, see \l{Using CMake with Conan}. + + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/editors/creator-coding.qdoc b/doc/qtcreator/src/editors/creator-coding.qdoc index b8c989f0150..b74b3b627da 100644 --- a/doc/qtcreator/src/editors/creator-coding.qdoc +++ b/doc/qtcreator/src/editors/creator-coding.qdoc @@ -107,7 +107,7 @@ You can use \QC to create applications that embed state machines. A project wizard creates \l{https://www.w3.org/TR/scxml/} {State Chart XML (SCXML)} files with boilerplate code that you can - edit using an experimental SCXML editor. You can use the classes in + edit using an SCXML editor. You can use the classes in the Qt SCXML module to embed state machines created from the files in Qt applications. diff --git a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc index 20a04c003f0..84eef9dcc0f 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc @@ -32,6 +32,12 @@ specified in the Beautifier preferences. You can use a predefined style or define your own style. + \note Enable the Beautifier plugin to use it. Since \QC 10.0.0, the + ClangFormat plugin is enabled by default. Select \preferences > + \uicontrol {C++} > \uicontrol {Formatting mode} > \uicontrol Disable + to turn off ClangFormat if you enable Beautifier because combining + them can lead to unexpected results. + To use the Beautifier plugin: \list 1 @@ -48,17 +54,6 @@ You might have to build the tools from sources for some platforms. - \li Select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol {C++} > - \uicontrol Beautifier to enable the plugin. - - \note Since \QC 10.0.0, the ClangFormat plugin is enabled by - default. Select \preferences > - \uicontrol {C++} > \uicontrol {Formatting mode} > \uicontrol Disable - to turn off ClangFormat if you enable Beautifier because combining - them can lead to unexpected results. - - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \li Select \preferences > \uicontrol Beautifier to specify settings for beautifying files. @@ -168,4 +163,6 @@ select it when no text is selected, the whole file is formatted by default. To disable this behavior, deselect the \uicontrol {Format entire file if no text was selected} check box. + + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdocinc b/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdocinc index 8b779607368..d7e74fc9128 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdocinc +++ b/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdocinc @@ -25,6 +25,8 @@ the files in a compilation database with access to all the editing features of the Clang code model. + \note Enable the Compilation Database Project Manager plugin to use it. + To switch between header and source files, select \uicontrol Tools > \uicontrol C++ > \uicontrol {Switch Header/Source}. @@ -32,9 +34,7 @@ database projects in the \uicontrol Projects mode. For more information, see \l{Adding Custom Build Steps} and \l {Specifying Run Settings}. - To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Build Systems} > \uicontrol {Compilation Database Project Manager}. - Then select \uicontrol {Restart Now} to restart \QC and load the plugin. + \sa {Enable and disable plugins} //! [using compilation databases] */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc index 1f30da9120e..6717a526199 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc @@ -31,17 +31,6 @@ {Copilot.vim/Readme.md}. \endlist - \section1 Enabling the Copilot Plugin - - To enable the Copilot plugin: - - \list 1 - \li Select \uicontrol Help (or \uicontrol {\QC} on \macos) > - \uicontrol {About Plugins} > \uicontrol Utilities > - \uicontrol Copilot to enable the plugin. - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \endlist - \section1 Setting Copilot Preferences To set preferences for using Copilot: @@ -117,4 +106,6 @@ select \uicontrol Projects > \uicontrol {Project Settings} > \uicontrol Copilot, and then select or deselect the \uicontrol {Enable Copilot} check box. + + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc b/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc index fbfbd3df294..93ac2b8de6e 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc @@ -22,12 +22,11 @@ \e event, but also on earlier events. With state charts, you can easily share this information. - \QC has a project wizard for adding \l{https://www.w3.org/TR/scxml/} - {State Chart XML (SCXML)} files with boilerplate code to projects and an - experimental SCXML editor for editing the state charts. You can use the - SCXML editor to add \e states and \e transitions to the files. You can then - use the classes in the Qt SCXML module to embed the state machines created - from the files in Qt applications. + With the \QC project wizard you can add \l{https://www.w3.org/TR/scxml/} + {State Chart XML (SCXML)} files with boilerplate code to projects. Edit + the state charts with the SCXML editor to add \e states and \e transitions + to the files. Then, use the classes in the Qt SCXML module to embed the + state machines created from the files in Qt applications. \image qtcreator-scxml-editor.png SXCML Editor @@ -83,11 +82,6 @@ \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol Modeling > \uicontrol ScxmlEditor. - - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \li Select \uicontrol File > \uicontrol {New File} > \uicontrol {Files and Classes} > \uicontrol Modeling > \uicontrol {State Chart} > \uicontrol Choose to create an empty diff --git a/doc/qtcreator/src/editors/creator-search.qdoc b/doc/qtcreator/src/editors/creator-search.qdoc index f01e547e8d3..a5fd8c9e15a 100644 --- a/doc/qtcreator/src/editors/creator-search.qdoc +++ b/doc/qtcreator/src/editors/creator-search.qdoc @@ -219,7 +219,9 @@ \section1 Enabling Silver Searcher You can use Silver Searcher as a search engine in \QC if you install - Silver Searcher on the development PC and enable the experimental plugin. + Silver Searcher on the development PC. + + \note Enable the SilverSearcher plugin to use it. To use Silver Searcher: @@ -232,12 +234,6 @@ You might have to build Silver Searcher from sources for some platforms. - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Utilities} > \uicontrol {SilverSearcher} to enable the - plugin. - - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \li When searching, select \uicontrol {Silver Searcher} in the \uicontrol {Search engine} field. @@ -248,5 +244,7 @@ and add the entry \c{PATH=/path/to/bin:${PATH}}. \endlist + + \sa {Enable and disable plugins} \endif */ diff --git a/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc b/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc index 7dd3457be45..fa45ee66a28 100644 --- a/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc +++ b/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc @@ -453,7 +453,11 @@ You can specify shortcuts for executing actions in a way that is familiar to \l{https://www.gnu.org/software/emacs/manual/html_node/emacs/index.html} {Emacs} editor users. The actions are not bound to any key combinations by - default. The following actions are available: + default. + + \note Enable the EmacsKeys plugin to use the shortcuts. + + The following actions are available: \list \li Copy @@ -790,7 +794,11 @@ \endif \sa {Assign keyboard shortcuts}, {Find keyboard shortcuts}, - {Import and export keyboard shortcuts} + {Import and export keyboard shortcuts} + + \if defined(qtcreator) + \sa {Enable and disable plugins} + \endif */ /*! diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-to-enable-plugins.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-to-enable-plugins.qdoc index e631c568311..ad5b4e45938 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-to-enable-plugins.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-to-enable-plugins.qdoc @@ -9,6 +9,18 @@ \title Enable and disable plugins + \QC uses standard names and locations on Linux, \macos, and Windows for + standard features, such as \e about dialogs. + + \table + \header + \li Linux and Windows + \li \macos + \row + \li \uicontrol Help > \uicontrol {About Plugins} + \li \uicontrol {\QC} > \uicontrol {About Plugins} + \endtable + New \QC plugins are often introduced as \e {experimental plugins} to let you try them out before they are fully supported. Experimental plugins are disabled by default and you must enable them for them to become visible @@ -24,7 +36,7 @@ To enable and disable plugins: \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins}. + \li Go to \uicontrol {About Plugins}. \li Start typing in the \uicontrol Filter field to find a plugin. \image qtcreator-installed-plugins.webp {Installed Plugins dialog} \li Select the \uicontrol Load check box to enable a plugin, or deselect @@ -34,5 +46,5 @@ take effect. \endlist - \sa {Install plugins}{How To: Install plugins} + \sa {Install plugins} */ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-to-install-plugins.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-to-install-plugins.qdoc index 2f14eb42262..a0f0bb9adb8 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-to-install-plugins.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-to-install-plugins.qdoc @@ -22,8 +22,7 @@ To install plugins: \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Install Plugins}. + \li Go to \uicontrol {About Plugins} > \uicontrol {Install Plugins}. \li In the \uicontrol Source dialog, enter the path to the archive or library that has the plugin. \image qtcreator-install-plugin-source.png @@ -39,5 +38,5 @@ \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. \endlist - \sa {Enable and disable plugins}{How To: Enable and disable plugins} + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/howto/creator-only/creator-squish.qdoc b/doc/qtcreator/src/howto/creator-only/creator-squish.qdoc index c931fd98ed4..4284085e721 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-squish.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-squish.qdoc @@ -42,15 +42,7 @@ To use the plugin, you must download and install Squish, create a connection to the Squish Server, and specify AUTs to run. - \section1 Enabling the Squish Plugin - - To enable the Squish plugin: - - \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol Utilities > \uicontrol Squish to enable the plugin. - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \endlist + \note Enable the Squish plugin to use it. \section1 Specifying a Squish Server @@ -328,4 +320,6 @@ output, \uicontrol {Runner/Server Log} tab. \image qtcreator-squish-output-runner-server-log.png "Runner and Server Log output" + + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/howto/creator-only/creator-vcpkg.qdoc b/doc/qtcreator/src/howto/creator-only/creator-vcpkg.qdoc index fb013f4fd36..dd498be5db8 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-vcpkg.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-vcpkg.qdoc @@ -18,15 +18,7 @@ You can use \QC to create and edit vcpkg.json files to specify packages to build as part of your project when using CMake as the build system. - \section1 Enabling the vcpkg Plugin - - To enable the vcpkg plugin: - - \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol Utilities > \uicontrol Vcpkg to enable the plugin. - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \endlist + \note Enable the Vcpkg plugin to use it. \section1 Setting vcpkg Preferences @@ -86,4 +78,6 @@ To set the path to the directory where you installed vcpkg, select \inlineimage icons/settings.png (\uicontrol Configure) on the editor toolbar. + + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/howto/creator-telemetry.qdoc b/doc/qtcreator/src/howto/creator-telemetry.qdoc index 058e6cfbebe..672ef719eb0 100644 --- a/doc/qtcreator/src/howto/creator-telemetry.qdoc +++ b/doc/qtcreator/src/howto/creator-telemetry.qdoc @@ -34,7 +34,9 @@ {Enable Usage Statistics} in the splash screen that appears when you first launch \QDS. If the splash screen does not appear, you can enable the telemetry plugin by selecting \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol Utilities > \uicontrol UsageStatistic. + \uicontrol Utilities > \uicontrol UsageStatistic on Linux and Windows (or + \uicontrol {\QDS} > \uicontrol {About Plugins} > \uicontrol Utilities > + \uicontrol UsageStatistic on \macos). \image studio-usage-statistics.png "Enabling Usage Statistics" \endif diff --git a/doc/qtcreator/src/meson/creator-projects-meson.qdoc b/doc/qtcreator/src/meson/creator-projects-meson.qdoc index 43a15c65782..44b25eed93d 100644 --- a/doc/qtcreator/src/meson/creator-projects-meson.qdoc +++ b/doc/qtcreator/src/meson/creator-projects-meson.qdoc @@ -23,8 +23,7 @@ \c PATH. You can add paths to other Meson or Ninja executables and use them in different build and run \l{glossary-buildandrun-kit}{kits}. - \note Meson build plugin is disabled by default, see - \l{Enable and disable plugins}{How To: Enable and disable plugins}. + \note Enable the Meson plugin to use it. \section1 Adding Meson Tools @@ -86,5 +85,6 @@ \li Adding files to Meson projects from \QC. \endlist - \sa {Open projects}, {Meson Build Configuration}, {Specifying Run Settings} + \sa {Enable and disable plugins}, {Open projects}, + {Meson Build Configuration}, {Specifying Run Settings} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-autotools.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-autotools.qdoc index a33de36884e..7cf87b25684 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-autotools.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-autotools.qdoc @@ -12,11 +12,9 @@ \brief \QC can open projects that use the Autotools build system. You can build and run the projects directly from \QC. - The AutotoolsProjectManager is a plugin for autotools support. It is - disabled by default. To enable the plugin, select \uicontrol Help > - \uicontrol {About Plugins} > \uicontrol {Build Systems} > - \uicontrol AutotoolsProjectManager. Then select \uicontrol {Restart Now} - to restart \QC and load the plugin. + The AutotoolsProjectManager is a plugin for autotools support. + + \note Enable the Autotools plugin to use it. To work with your Autotools project in \QC: @@ -47,4 +45,6 @@ \image qtcreator-autotools-buildsettings.png \endlist + + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc index d9e1f9bb8a9..4062cf775e5 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc @@ -17,10 +17,7 @@ \l{https://nim-lang.org/}{Nim} and uses the Nim compiler to generate executables that are supported on Windows, Linux, and \macos. - To use \QC for Nim development, you need to enable the experimental - Nim plugin. Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Other Languages} > \uicontrol Nim. Then select - \uicontrol {Restart Now} to restart \QC and load the plugin. + \note Enable the Nim plugin to use Nimble and Nim. In addition, you have to download and install Nim and set up a Nim kit in \QC. @@ -62,4 +59,6 @@ \image qtcreator-project-nimble.png \li Select \uicontrol Next to create the project. \endlist + + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-designer-plugin.qdoc b/doc/qtcreator/src/qtquick/creator-only/qtquick-designer-plugin.qdoc index 7e95c03bb20..9d90b78ace5 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-designer-plugin.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-designer-plugin.qdoc @@ -21,13 +21,5 @@ For more information about using \QMLD, see \l{Qt Design Studio Manual}. - \section1 Enabling the \QMLD Plugin - - To enable the \QMLD plugin: - - \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Qt Quick} > \uicontrol {QmlDesigner}. - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \endlist + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/user-interface/creator-only/creator-reference-to-do-entries-view.qdoc b/doc/qtcreator/src/user-interface/creator-only/creator-reference-to-do-entries-view.qdoc index f7d1b97a428..e6ca1c51815 100644 --- a/doc/qtcreator/src/user-interface/creator-only/creator-reference-to-do-entries-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-only/creator-reference-to-do-entries-view.qdoc @@ -9,6 +9,8 @@ \title To-Do Entries + \note Enable the Todo plugin to use it. + \brief Lists the BUG, FIXME, NOTE, TODO, and WARNING keywords from the current file, from all project files, or from a subproject. @@ -21,17 +23,6 @@ analysis tools in \l Issues. For more information, see \l{Show task list files in Issues}. - \section1 Enabling the To-Do Plugin - - The Todo plugin is disabled by default. To enable it: - - \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol Utilities > \uicontrol Todo. - \li Select \uicontrol OK. - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \endlist - \section1 To-Do Preferences To add keywords, select \preferences > diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc index 154a18ebbf5..72dc3dacea2 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-gitlab.qdoc @@ -15,16 +15,13 @@ GitLab servers and use \l{Git} to manage your local and remote repositories. - To enable the experimental GitLab plugin, select \uicontrol Help > - \uicontrol {About Plugins} > \uicontrol {Version Control} > - \uicontrol GitLab. Then select \uicontrol {Restart Now} to - restart \QC and load the plugin. - To use GitLab, you must create a connection to the GitLab server and clone the projects you want to work on. You can also link previously cloned projects to GitLab in the project settings. This enables you to receive event notifications in the \l {View output}{Version Control} pane. + \note Enable the GitLab plugin to use it. + \section1 Connecting to GitLab Servers To connect to a GitLab server, you need to specify the server host name and @@ -125,6 +122,6 @@ To stop the reception of event notifications, select \uicontrol {Unlink from GitLab}. - \sa {Set up version control systems}, {Use common VCS functions}, - {Version Control Systems}, {Git} + \sa {Enable and disable plugins}, {Set up version control systems}, + {Use common VCS functions}, {Version Control Systems}, {Git} */ diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc index 3acacf2234f..443aa40be45 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc @@ -20,15 +20,7 @@ Perforce is a fast software configuration management system developed by Perforce Software. - \section1 Enabling the Perforce Plugin - - To enable the Perforce plugin: - - \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Version Control} > \uicontrol Perforce. - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \endlist + \note Enable the Perforce plugin to use it. \section1 Configuring Perforce @@ -69,6 +61,6 @@ To view information about change lists and the files in them, select \uicontrol Tools > \uicontrol Perforce > \uicontrol Describe. - \sa {Set up version control systems}, {Use common VCS functions}, - {Version Control Systems} + \sa {Enable and disable plugins}, {Set up version control systems}, + {Use common VCS functions}, {Version Control Systems} */ diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc index c9442420080..e0e0eab6b37 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc @@ -35,21 +35,15 @@ \row \li \l{ClearCase} \li \l{http://www-01.ibm.com/software/awdtools/clearcase/} - \li Disabled by default. To enable the plugin, select - \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Version Control} > \uicontrol ClearCase. - Then select \uicontrol {Restart Now} to restart \QC - and load the plugin. + \li Enable the plugin to use it. \row \li \l{CVS} \li \l{http://www.nongnu.org/cvs/} - \li + \li Enable the plugin to use it. \row \li \l{Fossil} \li \l{https://fossil-scm.org/index.html/doc/trunk/www/index.wiki} - \li Disabled by default. To enable the plugin, select - \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Version Control} > \uicontrol Fossil. + \li Enable the plugin to use it. \row \li \l{Git} \li \l{http://git-scm.com/} @@ -59,7 +53,7 @@ \row \li \l{GitLab} \li \l{http://gitlab.com/} - \li Experimental + \li Enable the plugin to use it. \row \li \l{Mercurial} \li \l{http://mercurial.selenic.com/} @@ -69,16 +63,14 @@ \li \l{http://www.perforce.com} \li Server version 2006.1 and later - Disabled by default. To enable the plugin, select - \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Version Control} > \uicontrol Perforce. + Enable the plugin to use it. \row \li \l{Subversion} \li \l{http://subversion.apache.org/} \li Subversion version 1.7.0 and later \endtable - \sa {Create VCS repositories for new projects}, + \sa {Create VCS repositories for new projects}, {Enable and disable plugins}, {Set up version control systems}, {Use common VCS functions} */ diff --git a/doc/qtcreator/src/webassembly/creator-webassembly.qdoc b/doc/qtcreator/src/webassembly/creator-webassembly.qdoc index 7a84cc8c37d..f53830d29f8 100644 --- a/doc/qtcreator/src/webassembly/creator-webassembly.qdoc +++ b/doc/qtcreator/src/webassembly/creator-webassembly.qdoc @@ -21,6 +21,8 @@ You can change the web browser in the project's \l{Specifying Run Settings} {run settings}. + \note Enable the WebAssembly plugin to use it. + To build applications for the web and run them in a web browser, you need to install Qt for WebAssembly and the tool chain for compiling to WebAssembly. @@ -56,16 +58,6 @@ {Install Emscripten}. \endlist - \section2 Enabling the WebAssembly Plugin - - To enable the plugin: - - \list 1 - \li In \QC, select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Device Support} > \uicontrol {WebAssembly}. - \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. - \endlist - \section2 Specifying WebAssembly Settings To configure \QC for building Qt apps for the web: @@ -119,4 +111,6 @@ You can now build Qt applications in WebAssembly format and run them in a web browser as described in \l {Building for Multiple Platforms} and \l{Running on Multiple Platforms}. + + \sa {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/widgets/qtdesigner-plugins.qdoc b/doc/qtcreator/src/widgets/qtdesigner-plugins.qdoc index f782199c379..ddd3266df60 100644 --- a/doc/qtcreator/src/widgets/qtdesigner-plugins.qdoc +++ b/doc/qtcreator/src/widgets/qtdesigner-plugins.qdoc @@ -47,7 +47,8 @@ located in \c {<Qt_version>\<compiler>\bin} in the Qt installation directory. It fetches plugins from the \c {\plugins\designer} subdirectory of \c bin. To check which plugins were loaded successfully and which failed, - choose \uicontrol Help > \uicontrol {About Plugins}. + choose \uicontrol Help > \uicontrol {About Plugins} on Linux and Windows + (or \uicontrol {\QC} > \uicontrol {About Plugins} on \macos). \section1 Matching Build Keys From cca7bc98a9b031e5454406f33a42edae61d44dbe Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 24 Oct 2023 09:15:02 +0200 Subject: [PATCH 1742/1777] CMake: Fix deployment path Previously the path would be created based on the build device instead of the target device. Therefore when building on windows with a linux target the path might become "c:\usr\bin\..." instead of "/usr/bin/...". Fixes: QTCREATORBUG-29797 Change-Id: I13a9941b87b863f3e1b8420bcab230db1f70a28b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- .../cmakeprojectmanager/cmakebuildstep.cpp | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 31a6ae23c02..370799fe260 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -775,22 +775,23 @@ void CMakeBuildStep::updateDeploymentData() DeploymentData deploymentData; deploymentData.setLocalInstallRoot(rootDir); - IDeviceConstPtr device = BuildDeviceKitAspect::device(buildSystem()->kit()); + IDeviceConstPtr runDevice = DeviceKitAspect::device(buildSystem()->kit()); const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(), [](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); }); - auto handleFile = [&appFileNames, rootDir, &deploymentData, device](const FilePath &filePath) { - const DeployableFile::Type type = appFileNames.contains(filePath.fileName()) - ? DeployableFile::TypeExecutable - : DeployableFile::TypeNormal; + auto handleFile = + [&appFileNames, rootDir, &deploymentData, runDevice](const FilePath &filePath) { + const DeployableFile::Type type = appFileNames.contains(filePath.fileName()) + ? DeployableFile::TypeExecutable + : DeployableFile::TypeNormal; - FilePath targetDirPath = filePath.parentDir().relativePathFrom(rootDir); + FilePath targetDirPath = filePath.parentDir().relativePathFrom(rootDir); - const FilePath targetDir = device->rootPath().pathAppended(targetDirPath.path()); - deploymentData.addFile(filePath, targetDir.nativePath(), type); - return IterationPolicy::Continue; - }; + const FilePath targetDir = runDevice->rootPath().pathAppended(targetDirPath.path()); + deploymentData.addFile(filePath, targetDir.nativePath(), type); + return IterationPolicy::Continue; + }; rootDir.iterateDirectory(handleFile, {{}, QDir::Files | QDir::Hidden, QDirIterator::Subdirectories}); From a3853ecc444ba87506d16dc14cdbdaa1fc269de1 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Fri, 27 Oct 2023 11:15:39 +0200 Subject: [PATCH 1743/1777] Terminal: Q_ASSERT workaround Change-Id: I7e1bf06db437b523e8b06695c3b12f2562a73ce8 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/terminal/shortcutmap.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/terminal/shortcutmap.cpp b/src/plugins/terminal/shortcutmap.cpp index 436757fd256..4e17f0c35e4 100644 --- a/src/plugins/terminal/shortcutmap.cpp +++ b/src/plugins/terminal/shortcutmap.cpp @@ -550,12 +550,18 @@ bool ShortcutMap::dispatchEvent(QKeyEvent *e) << "\", " << next->id << ", " << static_cast<bool>(enabledShortcuts > 1) << ") to object(" << next->owner << ')'; } - QShortcutEvent se(next->keyseq, next->id, enabledShortcuts > 1); - QCoreApplication::sendEvent(const_cast<QObject *>(next->owner), &se); - QAction *action = qobject_cast<QAction *>(next->owner); - if (action) + if (auto action = qobject_cast<QAction *>(next->owner)) { + // We call the action here ourselves instead of relying on sending a ShortCut event, + // as the action will try to match the shortcut id to the global shortcutmap. + // This triggers an annoying Q_ASSERT when linking against a debug Qt. Calling trigger + // directly circumvents this. + action->trigger(); return action->isEnabled(); + } else { + QShortcutEvent se(next->keyseq, next->id, enabledShortcuts > 1); + QCoreApplication::sendEvent(const_cast<QObject *>(next->owner), &se); + } return true; } From d0c61823a9ebe76a303991a5f1b05e6bed0fb068 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@qt.io> Date: Fri, 27 Oct 2023 10:27:06 +0200 Subject: [PATCH 1744/1777] Update qbs submodule to HEAD of 2.2 branch Change-Id: Ib0d39635b334757a6d33d40cef50d9e56ddb89e8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 40327c8277b..d99256dd794 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 40327c8277b904944dbd9a227f9a819e3d53666d +Subproject commit d99256dd79460628aafb5fa34a8dde7761ff7b1c From 8f1c8790e23d9170a5a598762284f56b6e02e3ac Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Fri, 27 Oct 2023 11:17:51 +0200 Subject: [PATCH 1745/1777] Update change log Change-Id: Ia079c3c93b0b33f93fa462cd3cac634f158ee2b8 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- dist/changelog/changes-12.0.0.md | 64 +++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 944a3451aec..efbecf4c1b0 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -71,7 +71,15 @@ General without a unified menu bar ([QTCREATORBUG-29498](https://bugreports.qt.io/browse/QTCREATORBUG-29498)) ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-show-and-hide-main-menu.html)) +* Changed the `Enable high DPI scaling` setting to a `DPI rounding policy` + setting, which fits Qt's settings better + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-set-high-dpi-scaling.html)) * Fixed an issue with growing session files +* Fixed that the shortcuts for the navigation views could be stuck to opening a + view in the right side bar + ([QTCREATORBUG-29770](https://bugreports.qt.io/browse/QTCREATORBUG-29770)) +* Fixed that the shortcut for Locator switched to the main window + ([QTCREATORBUG-29741](https://bugreports.qt.io/browse/QTCREATORBUG-29741)) Help ---- @@ -90,6 +98,7 @@ Editing ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-coding-navigating.html#navigating-between-open-files-and-symbols)) * Added an indenter, auto-brace and auto-quote for JSON ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-enclose-code-in-characters.html)) +* Improved the performance of searching in big documents * Fixed that the historical order of open documents was not restored * Fixed that suggestions were rendered with the wrong tab size ([QTCREATORBUG-29483](https://bugreports.qt.io/browse/QTCREATORBUG-29483)) @@ -119,8 +128,17 @@ Editing * Fixed that automatically created functions could be added between another function and its documentation ([QTCREATORBUG-6934](https://bugreports.qt.io/browse/QTCREATORBUG-6934)) -* Fixed that the refactoring actions from Clangd were not available in the - context menu +* Fixed that scope names were considered when searching for `C++ Symbols` with + advanced find + ([QTCREATORBUG-29133](https://bugreports.qt.io/browse/QTCREATORBUG-29133)) +* Clangd + * Added the `Completion ranking model` option for choosing the order of + completion results + ([QTCREATORBUG-29013](https://bugreports.qt.io/browse/QTCREATORBUG-29013)) + * Fixed that the refactoring actions from Clangd were not available in the + context menu + * Fixed that renaming symbols could rename them in generated files + ([QTCREATORBUG-29778](https://bugreports.qt.io/browse/QTCREATORBUG-29778)) * Clang Format * Fixed the style settings for Clang Format 16 and later ([QTCREATORBUG-29434](https://bugreports.qt.io/browse/QTCREATORBUG-29434)) @@ -144,11 +162,18 @@ Editing of files ([QTCREATORBUG-29542](https://bugreports.qt.io/browse/QTCREATORBUG-29542)) +### Widget Designer + +* Fixed that renaming layouts in the property editor switched to edit mode + ([QTCREATORBUG-29644](https://bugreports.qt.io/browse/QTCREATORBUG-29644)) + ### Copilot * Added support for proxies ([QTCREATORBUG-29485](https://bugreports.qt.io/browse/QTCREATORBUG-29485)) ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-copilot.html)) +* Fixed the auto-detection of `agent.js` + ([QTCREATORBUG-29750](https://bugreports.qt.io/browse/QTCREATORBUG-29750)) ### TODO @@ -207,6 +232,15 @@ Projects * Added help tooltips ([QTCREATORBUG-25780](https://bugreports.qt.io/browse/QTCREATORBUG-25780)) * Extended context help for variables, properties and modules +* Improved performance when switching sessions + ([QTCREATORBUG-27729](https://bugreports.qt.io/browse/QTCREATORBUG-27729)) +* Fixed issues with the subdirectory structure of the project tree + ([QTCREATORBUG-23942](https://bugreports.qt.io/browse/QTCREATORBUG-23942), + [QTCREATORBUG-29105](https://bugreports.qt.io/browse/QTCREATORBUG-29105)) +* Presets + * Fixed that variables were not expanded for `cmakeExecutable` + ([QTCREATORBUG-29643](https://bugreports.qt.io/browse/QTCREATORBUG-29643)) + * Fixed unnecessary restrictions on the preset name ### Python @@ -217,6 +251,11 @@ Projects ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-run-settings.html#specifying-run-settings-for-linux-based-devices)) * Fixed PySide wheels installation on macOS +### qmake + +* Fixed the project tree structure in case of some subfolder structures + ([QTCREATORBUG-29733](https://bugreports.qt.io/browse/QTCREATORBUG-29733)) + ### vcpkg * Added the generation of code for `CMakeLists.txt` @@ -244,6 +283,8 @@ Analyzer * Fixed that error messages were not shown ([QTCREATORBUG-29298](https://bugreports.qt.io/browse/QTCREATORBUG-29298)) +* Fixed that `-mno-direct-extern-access` could be passed to `clang-tidy` which + does not support it ### CTF Visualizer @@ -275,6 +316,23 @@ Test Integration * Added an option for the number of threads used for scanning ([QTCREATORBUG-29301](https://bugreports.qt.io/browse/QTCREATORBUG-29301)) +* Improved the wizards for `GTest` and `Catch2` + +Platforms +--------- + +### Android + +* Fixed issues when `LIBRARY_OUTPUT_DIRECTORY` is set in the CMake build files + ([QTCREATORBUG-26479](https://bugreports.qt.io/browse/QTCREATORBUG-26479)) + +### iOS + +* Known Issue: iOS 17 devices are not supported + +### Docker + +* Fixed the check for commands that are built-ins of the shell Credits for these changes go to: -------------------------------- @@ -304,6 +362,7 @@ Jonas Karlsson Jussi Witick Knud Dollereder Leena Miettinen +Ludovic Le Brun Mahmoud Badri Marco Bubke Marcus Tillmanns @@ -317,6 +376,7 @@ Pranta Dastider Robert Löhning Sami Shalayel Samuel Ghinet +Samuli Piippo Semih Yavuz Tasuku Suzuki Thiago Macieira From 7891a7f5b43aa453edf362f8735684c61246b253 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 27 Oct 2023 12:33:30 +0200 Subject: [PATCH 1746/1777] AutoTest: Fix crash Amends 6b6d9dc21e78d10a4b637e234828e57604ab7fa0. Change-Id: I5fc2bd2b3788a660d038328f00e73db0ab25d7b0 Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/autotest/qtest/qttesttreeitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/autotest/qtest/qttesttreeitem.cpp b/src/plugins/autotest/qtest/qttesttreeitem.cpp index de27cb089ff..68b50be9079 100644 --- a/src/plugins/autotest/qtest/qttesttreeitem.cpp +++ b/src/plugins/autotest/qtest/qttesttreeitem.cpp @@ -76,7 +76,7 @@ QVariant QtTestTreeItem::data(int column, int role) const return m_multiTest; } case LinkRole: - if (type() == GroupNode) + if (type() == GroupNode || type() == Root) return QVariant(); if (type() == TestDataFunction || type() == TestDataTag) return TestTreeItem::data(column, role); From 79becbaeac933d49d30fe3a92cff949851337b38 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Fri, 27 Oct 2023 14:46:31 +0200 Subject: [PATCH 1747/1777] CMakePM: Protect against accidental nullptr access Wizard summary page does not provide a list to put in failed files, so ending up inside the build systems addFiles() may pass in a nullptr. Guard against its access. Change-Id: Ia858f8029b1b840cc341d87614576f2634b995dc Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 7c0001c6a86..b5630faf28c 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -272,6 +272,8 @@ static QString newFilesForFunction(const std::string &cmakeFunction, bool CMakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FilePaths *notAdded) { + if (notAdded) + *notAdded = filePaths; if (auto n = dynamic_cast<CMakeTargetNode *>(context)) { const QString targetName = n->buildKey(); auto target = Utils::findOrDefault(buildTargets(), @@ -279,10 +281,9 @@ bool CMakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FileP return target.title == targetName; }); - if (target.backtrace.isEmpty()) { - *notAdded = filePaths; + if (target.backtrace.isEmpty()) return false; - } + const FilePath targetCMakeFile = target.backtrace.last().path; const int targetDefinitionLine = target.backtrace.last().line; @@ -297,7 +298,6 @@ bool CMakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FileP if (!cmakeListFile.ParseString(fileContent->toStdString(), targetCMakeFile.fileName().toStdString(), errorString)) { - *notAdded = filePaths; return false; } } @@ -308,10 +308,8 @@ bool CMakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FileP return func.Line() == targetDefinitionLine; }); - if (function == cmakeListFile.Functions.end()) { - *notAdded = filePaths; + if (function == cmakeListFile.Functions.end()) return false; - } // Special case: when qt_add_executable and qt_add_qml_module use the same target name // then qt_add_qml_module function should be used @@ -385,16 +383,16 @@ bool CMakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FileP Core::EditorManager::openEditorAt({targetCMakeFile, line, column + extraChars}, Constants::CMAKE_EDITOR_ID, Core::EditorManager::DoNotMakeVisible)); - if (!editor) { - *notAdded = filePaths; + if (!editor) return false; - } editor->insert(snippet); editor->editorWidget()->autoIndent(); if (!Core::DocumentManager::saveDocument(editor->document())) return false; + if (notAdded) + notAdded->clear(); return true; } From 936015b34565ecc2cb34fbde1f33279c98783fd4 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 30 Oct 2023 08:11:11 +0100 Subject: [PATCH 1748/1777] Core: Don't create Log Viewer just to close it Change-Id: I92a724b0b1bc6a749fbd18f91494be0f2eff11d8 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/coreplugin/loggingviewer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/coreplugin/loggingviewer.cpp b/src/plugins/coreplugin/loggingviewer.cpp index 1cb95ae8b7f..0ee6c0b7f42 100644 --- a/src/plugins/coreplugin/loggingviewer.cpp +++ b/src/plugins/coreplugin/loggingviewer.cpp @@ -1100,6 +1100,8 @@ void setCategoryColor(const QString &category, const QColor &color) s_categoryColor.remove(category); } +static bool wasLogViewerShown = false; + void LoggingViewer::showLoggingView() { LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance(); @@ -1108,10 +1110,15 @@ void LoggingViewer::showLoggingView() staticLogWidget->show(); staticLogWidget->raise(); staticLogWidget->activateWindow(); + + wasLogViewerShown = true; } void LoggingViewer::hideLoggingView() { + if (!wasLogViewerShown) + return; + LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance(); QTC_ASSERT(staticLogWidget, return); staticLogWidget->close(); From 53931b18ad7443879b0172bfda7611f540b9f0eb Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Thu, 26 Oct 2023 15:22:27 +0200 Subject: [PATCH 1749/1777] Debugger: Fix QDateTime dumpers with TZ != UTC Fixes it for Qt 5.4 and onwards hopefully. Fixes: QTCREATORBUG-29737 Change-Id: Ic555e304a872dfbd458a95097e4e0b6a6632509a Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- share/qtcreator/debugger/qttypes.py | 12 +++++++++--- src/plugins/debugger/debuggerprotocol.cpp | 6 ++++-- tests/auto/debugger/tst_dumpers.cpp | 17 +++++++++++++---- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 5a406c03190..784691e81a7 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -328,10 +328,16 @@ def qdump__QDateTime(d, value): isValid = status & 0x08 else: dptr = d.extractPointer(value) - (msecs, status, offsetFromUtc, ref, timeZone) = d.split('qIIIp', dptr) + (_, status, msecs, offsetFromUtc, _, timeZone) = d.split('iIqII{QTimeZone}', dptr) spec = (status & 0x30) >> 4 isValid = True - + tzD = d.extractPointer(timeZone) + if tzD == 0: + timeZone = 'UTC' + else: + idAddr = tzD + 2 * d.ptrSize() + tzBa = d.encodeByteArray(idAddr, limit=100) + timeZone = tzBa d.putValue( '%s/%s/%s/%s/%s/%s' % (msecs, @@ -365,7 +371,7 @@ def qdump__QDateTime(d, value): tz = '' else: idBase = tzp + 2 * d.ptrSize() # [QSharedData] + [vptr] - elided, tz = d.encodeByteArray(idBase, limit=100) + tz = d.encodeByteArray(idBase, limit=100) d.putValue('%s/%s/%s/%s/%s/%s' % (msecs, spec, offset, tz, status, 0), 'datetimeinternal') else: diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index 3740b5b3b63..6df472afa52 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -737,9 +737,11 @@ QString decodeData(const QString &ba, const QString &encoding) if (spec == Qt::OffsetFromUTC) { dateTime = QDateTime(date, time, spec, offset); } else if (spec == Qt::TimeZone) { - if (!QTimeZone::isTimeZoneIdAvailable(timeZoneId)) + QTimeZone tz(timeZoneId); + if (!tz.isValid()) return QLatin1String("<unavailable>"); - dateTime = QDateTime(date, time, QTimeZone(timeZoneId)); + + dateTime = QDateTime(date, time, tz); } else { dateTime = QDateTime(date, time, spec); } diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index f58f8f73731..06ebfe1b638 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -2260,7 +2260,10 @@ void tst_Dumpers::dumper_data() QTest::newRow("QDateTime") - << Data("#include <QDateTime>", + << Data("#include <QDateTime>\n" + "#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)\n" + "#include <QTimeZone>\n" + "#endif", "QDate d0;\n" "QDate d1;\n" @@ -2270,9 +2273,12 @@ void tst_Dumpers::dumper_data() "QTime t1(13, 15, 32);\n" "QDateTime dt0;\n" - "QDateTime dt1(QDate(1980, 1, 1), QTime(13, 15, 32), Qt::UTC);", + "QDateTime dt1(QDate(1980, 1, 1), QTime(13, 15, 32), Qt::UTC);\n" + "#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)\n" + "QDateTime dt2(QDate(1980, 1, 1), QTime(13, 15, 32), QTimeZone(60 * 60));\n" + "#endif\n", - "&d0, &d1, &t0, &t1, &dt0, &dt1") + "&d0, &d1, &t0, &t1, &dt0, &dt1, &dt2") + CoreProfile() @@ -2297,6 +2303,7 @@ void tst_Dumpers::dumper_data() + Check("dt0", "(invalid)", "@QDateTime") + Check("dt1", Value4("Tue Jan 1 13:15:32 1980"), "@QDateTime") + Check("dt1", Value5("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime") + + Check("dt1", Value6("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime") + Check("dt1.(ISO)", "\"1980-01-01T13:15:32Z\"", "@QString") % NeedsInferiorCall + Check("dt1.(Locale)", AnyValue, "@QString") % NeedsInferiorCall @@ -2306,11 +2313,13 @@ void tst_Dumpers::dumper_data() + Check("dt1.toString", Value4("\"Tue Jan 1 13:15:32 1980\""), "@QString") % NeedsInferiorCall + Check("dt1.toString", - Value5("\"Tue Jan 1 13:15:32 1980 GMT\""), "@QString") % NeedsInferiorCall; + Value5("\"Tue Jan 1 13:15:32 1980 GMT\""), "@QString") % NeedsInferiorCall //+ Check("dt1.toUTC", // Value4("Tue Jan 1 13:15:32 1980"), "@QDateTime") % Optional() //+ Check("dt1.toUTC", // Value5("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime") % Optional(); + + Check("dt2", Value5("Tue Jan 1 13:15:32 1980 UTC+01:00"), "@QDateTime") + + Check("dt2", Value6("Tue Jan 1 13:15:32 1980 UTC+01:00"), "@QDateTime"); QTest::newRow("QFileInfo") From ee3e6376f014d411692095bf23ce93cef3ab3ccc Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 30 Oct 2023 08:25:29 +0100 Subject: [PATCH 1750/1777] Core: Handle async log category init If a log category is first used by a different thread than the main thread, we need to make sure that we dispatch the call into the main thread ourselves. Change-Id: I0908366b254649f30a1d18cb4e0da4a7e3988dcc Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/coreplugin/loggingviewer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/coreplugin/loggingviewer.cpp b/src/plugins/coreplugin/loggingviewer.cpp index 0ee6c0b7f42..cc2b8226810 100644 --- a/src/plugins/coreplugin/loggingviewer.cpp +++ b/src/plugins/coreplugin/loggingviewer.cpp @@ -95,6 +95,12 @@ private: void onFilter(QLoggingCategory *category) { + if (QThread::currentThread() != thread()) { + QMetaObject::invokeMethod( + this, [category, this] { onFilter(category); }, Qt::QueuedConnection); + return; + } + if (!m_categories.contains(category)) { m_categories.append(category); emit newLogCategory(category); From 78b56e7defc5279cb03646c7edbe979ba2c6d881 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 30 Oct 2023 08:43:19 +0100 Subject: [PATCH 1751/1777] Core: Initialize old log category filter Change-Id: I732761977b9ca0e14a072f28db0830f57edc6989 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/coreplugin/loggingviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/loggingviewer.cpp b/src/plugins/coreplugin/loggingviewer.cpp index cc2b8226810..57a1f42282b 100644 --- a/src/plugins/coreplugin/loggingviewer.cpp +++ b/src/plugins/coreplugin/loggingviewer.cpp @@ -114,7 +114,7 @@ private: bool m_started{false}; }; -QLoggingCategory::CategoryFilter LogCategoryRegistry::s_oldFilter; +QLoggingCategory::CategoryFilter LogCategoryRegistry::s_oldFilter = nullptr; struct SavedEntry { From 250b82ba3243f03a3b09c8302bcb86e18d2f117d Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Mon, 30 Oct 2023 09:46:39 +0100 Subject: [PATCH 1752/1777] Ios: Finish deploy on failure Previously the deploy step would seemingly run forever if the startSimulator step failed, as no result was added to the promise. Change-Id: Ib320d051e78057e536d4ad371cb30108e848c65f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/ios/iostoolhandler.cpp | 2 ++ src/plugins/ios/simulatorcontrol.cpp | 29 +++++++++++++++++++++------- src/plugins/ios/simulatorcontrol.h | 8 ++++++++ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/plugins/ios/iostoolhandler.cpp b/src/plugins/ios/iostoolhandler.cpp index 67f4fb981c5..43cc6fab142 100644 --- a/src/plugins/ios/iostoolhandler.cpp +++ b/src/plugins/ios/iostoolhandler.cpp @@ -746,6 +746,8 @@ void IosSimulatorToolHandlerPrivate::requestTransferApp(const FilePath &appBundl installAppOnSimulator(); } else { errorMsg(Tr::tr("Application install on simulator failed. Simulator not running.")); + if (!response.commandOutput.isEmpty()) + errorMsg(response.commandOutput); didTransferApp(m_bundlePath, m_deviceId, IosToolHandler::Failure); emit q->finished(q); } diff --git a/src/plugins/ios/simulatorcontrol.cpp b/src/plugins/ios/simulatorcontrol.cpp index 0832a5faf37..900309fc31c 100644 --- a/src/plugins/ios/simulatorcontrol.cpp +++ b/src/plugins/ios/simulatorcontrol.cpp @@ -3,6 +3,7 @@ #include "simulatorcontrol.h" #include "iosconfigurations.h" +#include "iostr.h" #include <utils/algorithm.h> #include <utils/async.h> @@ -399,10 +400,10 @@ void startSimulator(QPromise<SimulatorControl::ResponseData> &promise, const QSt SimulatorInfo simInfo = deviceInfo(simUdid); if (!simInfo.available) { - qCDebug(simulatorLog) << "Simulator device is not available." << simUdid; + promise.addResult( + response.withError(Tr::tr("Simulator device is not available. (%1)").arg(simUdid))); return; } - // Shutting down state checks are for the case when simulator start is called within a short // interval of closing the previous interval of the simulator. We wait untill the shutdown // process is complete. @@ -414,8 +415,14 @@ void startSimulator(QPromise<SimulatorControl::ResponseData> &promise, const QSt } if (simInfo.isShuttingDown()) { - qCDebug(simulatorLog) << "Cannot start Simulator device. " - << "Previous instance taking too long to shutdown." << simInfo; + promise.addResult(response.withError( + Tr::tr("Cannot start Simulator device. Previous instance taking " + "too long to shut down. (name=%1, udid=%2, available=%3, state=%4, runtime=%5)") + .arg(simInfo.name) + .arg(simInfo.identifier) + .arg(simInfo.available) + .arg(simInfo.state) + .arg(simInfo.runtimeName))); return; } @@ -436,11 +443,19 @@ void startSimulator(QPromise<SimulatorControl::ResponseData> &promise, const QSt if (info.isBooted()) response.success = true; } else { - qCDebug(simulatorLog) << "Error starting simulator."; + promise.addResult(response.withError(Tr::tr("Error starting simulator."))); + return; } } else { - qCDebug(simulatorLog) << "Cannot start Simulator device. Simulator not in shutdown state." - << simInfo; + promise.addResult(response.withError( + Tr::tr("Cannot start Simulator device. Simulator not in shutdown state.(name=%1, " + "udid=%2, available=%3, state=%4, runtime=%5)") + .arg(simInfo.name) + .arg(simInfo.identifier) + .arg(simInfo.available) + .arg(simInfo.state) + .arg(simInfo.runtimeName))); + return; } if (!promise.isCanceled()) diff --git a/src/plugins/ios/simulatorcontrol.h b/src/plugins/ios/simulatorcontrol.h index 402100fbeac..c1519b39b32 100644 --- a/src/plugins/ios/simulatorcontrol.h +++ b/src/plugins/ios/simulatorcontrol.h @@ -61,6 +61,14 @@ public: bool success = false; qint64 pID = -1; QString commandOutput; + + ResponseData withError(const QString errorMsg) + { + ResponseData result = *this; + result.commandOutput = errorMsg; + result.success = false; + return result; + } }; public: From 0117b1669b879b25759c440dd4acde44cdb6f162 Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Tue, 24 Oct 2023 11:19:51 +0200 Subject: [PATCH 1753/1777] Python: use correct python language server after installation Change-Id: Ie5e26eedffc51e8916d849121fa60ea3d56e5a66 Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- src/plugins/python/pythonlanguageclient.cpp | 16 +++++----------- src/plugins/python/pythonlanguageclient.h | 2 -- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/plugins/python/pythonlanguageclient.cpp b/src/plugins/python/pythonlanguageclient.cpp index 750ab333826..b13aef42077 100644 --- a/src/plugins/python/pythonlanguageclient.cpp +++ b/src/plugins/python/pythonlanguageclient.cpp @@ -301,10 +301,13 @@ void PyLSConfigureAssistant::installPythonLanguageServer(const FilePath &python, auto install = new PipInstallTask(python); connect(install, &PipInstallTask::finished, this, [=](const bool success) { + const QList<TextEditor::TextDocument *> additionalDocuments = m_infoBarEntries.take(python); if (success) { - if (document) { - if (PyLSClient *client = clientForPython(python)) + if (PyLSClient *client = clientForPython(python)) { + if (document) LanguageClientManager::openDocumentWithClient(document, client); + for (TextEditor::TextDocument *additionalDocument : additionalDocuments) + LanguageClientManager::openDocumentWithClient(additionalDocument, client); } } install->deleteLater(); @@ -375,15 +378,6 @@ void PyLSConfigureAssistant::handlePyLSState(const FilePath &python, } } -void PyLSConfigureAssistant::updateEditorInfoBars(const FilePath &python, Client *client) -{ - for (TextEditor::TextDocument *document : instance()->m_infoBarEntries.take(python)) { - instance()->resetEditorInfoBar(document); - if (client) - LanguageClientManager::openDocumentWithClient(document, client); - } -} - void PyLSConfigureAssistant::resetEditorInfoBar(TextEditor::TextDocument *document) { for (QList<TextEditor::TextDocument *> &documents : m_infoBarEntries) diff --git a/src/plugins/python/pythonlanguageclient.h b/src/plugins/python/pythonlanguageclient.h index 82a4a73ea4f..41b559a0427 100644 --- a/src/plugins/python/pythonlanguageclient.h +++ b/src/plugins/python/pythonlanguageclient.h @@ -53,8 +53,6 @@ class PyLSConfigureAssistant : public QObject public: static PyLSConfigureAssistant *instance(); - static void updateEditorInfoBars(const Utils::FilePath &python, - LanguageClient::Client *client); static void openDocumentWithPython(const Utils::FilePath &python, TextEditor::TextDocument *document); From 472b4cb35810fa9c2ad6e6021a161e790c419517 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Mon, 30 Oct 2023 10:55:21 +0100 Subject: [PATCH 1754/1777] Doc: Describe changes in Git Instant Blame "Instant Blame" is now a check box. The "Add instant blame annotations to editor" check box was removed and the following were added: "Ignore whitespace changes" and "Ignore line moves". Task-number: QTCREATORBUG-29392 Change-Id: I8dd0a779dd4a72fef7a5bb1a9023c3b705f0f174 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- dist/changelog/changes-12.0.0.md | 4 +++- .../images/qtcreator-preferences-vcs-git.webp | Bin 5634 -> 5744 bytes doc/qtcreator/src/vcs/creator-vcs-git.qdoc | 10 +++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index efbecf4c1b0..177ae477ff0 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -304,8 +304,10 @@ Version Control Systems ### Git -* Added option for ignoring whitespace changes and line moves in `Instant Blame` +* Added the `Ignore whitespace changes` and `Ignore line moves` options to + `Preferences > Version Control > Git > Instant Blame` ([QTCREATORBUG-29378](https://bugreports.qt.io/browse/QTCREATORBUG-29378)) + ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-vcs-git.html)) ### CVS diff --git a/doc/qtcreator/images/qtcreator-preferences-vcs-git.webp b/doc/qtcreator/images/qtcreator-preferences-vcs-git.webp index 1d76dc557bcb65759ee3229e46754998024fb640..bb450df15c9188fd4d210f8a74e56e91364f9a60 100644 GIT binary patch literal 5744 zcmWIYbaTrPV_*n(bqWXzu<(fyV_?wFKUB(awPN@G`-Qh}Y`f?EJTE<ZWAVGK)090^ zS8itV^whR}RkomN>2o>fC`;=}+Ru+v34YcsJ^TN^y|bw1wGajqhMU~0oEYWUJaw|U z0vaT)FmZ1<pvidp$%NF~Ww*`J`P3eMi5FDeoBn67x!{ujmyYTv1s|BGa(mk?tLkhn zL7VS&=f6BLNdI$YNxAGZi%Xwne))HAySgi}WJcArSnItBPv;8g{CsU_YklMJrnR4I zZQB;F%8~Al{;Igbm9bhv{*r&zgliQ`9>3=6e$=q{e@yyE_g&tm5p^4PUYRjh`F6#2 zv5EtSp44$H$$$CgqI|}LYc*Wb(N<?SXz<<m-GB0!-qj@OUfsFR-pJfc+bDRh;jD-M ztfTE)D;?%vQ&@ZLkBskTF|nhJ)&C7wzFK%I<67GD6W3<FZ#PabzBD=Nv*KRa4Igel zy`2~+v*r7*9k$W#-^whfFwR~$?~dMl{j-L$fx2N9`8^+Vk4y2)F+bvQVN=-g%QB4? zf67y=dG36%u&woUo%fAv_34L2lhS)b=M?Kt+wS;r%j%aqAIk~*o%FcGxns}DQyv#B z%^#h(woAv!c|!0u{qV1EBvtzP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6Yj*ugwPgWO4Y2VJgw0P&g^B=lzv1pu%@t?Y5-mZ?hG21pA z(pt7Nr%_2YW6rB7)_EEWoL&a*c++6BLL~mkV~>@uc24?{@o&$f?_QOkjn(%2yt!x6 Te;NI*N&l10^?%xzeeMPT4F}Mp diff --git a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc index ee1ba25ed15..9f5f79f3910 100644 --- a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc +++ b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc @@ -144,9 +144,13 @@ By default, each line is annotated in the editor when you scroll through the file. To disable this feature, select \preferences > \uicontrol {Version Control} > \uicontrol Git, and - deselect \uicontrol {Add instant blame annotations to editor}. To view - annotations for the current line, select \uicontrol Tools > \uicontrol Git > - \uicontrol {Current File} > \uicontrol {Instant Blame}. + deselect \uicontrol {Instant Blame}. To find the commit that introduced + the last real code change, select \uicontrol {Ignore whitespace changes}. + To find the commit that introduced a line before it was moved, select + \uicontrol {Ignore line moves}. + + To view annotations for the current line, select \uicontrol Tools > + \uicontrol Git > \uicontrol {Current File} > \uicontrol {Instant Blame}. Click the commit identifier to show a detailed description of the change. From 7fce843949ac704cec0df875832f0ca2e3550388 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Sun, 29 Oct 2023 00:49:13 +0200 Subject: [PATCH 1755/1777] ScreenRecorder: Make recording options dialog non-resizable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ther resizing behavior is quite odd. One planned feature for the plugin is a zoomable crop view. Once that is in place (in QtC 13 or later), like suggested in the report, the dialog can be scalable and the crop view can grow using the available space. Fixes: QTCREATORBUG-29810 Change-Id: Ic77f81f704546d2730599b00664606aada3280d8 Reviewed-by: Robert Löhning <robert.loehning@qt.io> --- src/plugins/screenrecorder/record.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index cade82dbe9c..12aa27f46da 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -120,6 +120,7 @@ RecordOptionsDialog::RecordOptionsDialog(QWidget *parent) st, buttonBox, }.attachTo(this); + layout()->setSizeConstraint(QLayout::SetFixedSize); connect(buttonBox, &QDialogButtonBox::accepted, this, [this] { const QRect cropRect = m_cropScene->fullySelected() ? QRect() : screenCropRect(); From dc4703e5c0a3e07bb722c1496e0c244387992aaf Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Mon, 30 Oct 2023 11:43:16 +0100 Subject: [PATCH 1756/1777] Doc: Describe Preferences > Testing > General > Scan threads Task-number: QTCREATORBUG-29392 Change-Id: I71f253b0ffd6df615525da0c4c31e72245970bec Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- ...qtcreator-preferences-testing-general.webp | Bin 8014 -> 8460 bytes .../howto/creator-only/creator-autotest.qdoc | 4 ++++ 2 files changed, 4 insertions(+) diff --git a/doc/qtcreator/images/qtcreator-preferences-testing-general.webp b/doc/qtcreator/images/qtcreator-preferences-testing-general.webp index 0b92925e6a12cf86639fa663f38499446dbae4ab..8fb41b64f7dcaa5a28ff61139755649341088d0a 100644 GIT binary patch literal 8460 zcmWIYbaP`-WMBw)bqWXzu<-ezz`&qyeyEJ$>x0?b-cP;kaX-~ezwD%C&MX;879}h9 zq8l=iVVlg~$NNndp3FLXbMvkH4{KD<{pNmu^11B;(V`a<H=gqRRI++v)hb?V6SW&! zGJU6|40l9yO=XR{v&lU}w{*Aq$rbUz3Yo$I-ZyW3+m`z!uAz)^=Dbvw2_Elv{`2uJ zO#Yf@_0l<I`BjlUMR~dTx1UwcFsn4m4176TwJW6R{QLK@ikt???W!5x=P%VqZ^>ov z)Lr}elw5$rdk3$*lZuO&>gI;;2oitbRC><OrgEKMlU8V1^(U#hEB$W$Qm@}tAmw*S zKKS^W-(Q^WP0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6&CePC8nv=QP>meY{2KwK*4* z&mM1@U}K#(;hy-@uc8$z1J}2Bb_R&eJQTht|FCC~;Wgn0r}tFZT@!wwUH9wa?)*2G u!gzDO9M1zK3a?rBcJy*umh*aEmVREocVB4Oab~I2tls94Uqa8gG5`QnwzV1n diff --git a/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc b/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc index 47611d26c3f..8d72d3ba896 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc @@ -406,6 +406,10 @@ \uicontrol {Active Test Frameworks} list. By default, \QC groups tests that are in the same directory. + By default, \QC uses a quarter of the available logical CPUs when + scanning for tests. You can set the amount of worker threads used + in \uicontrol {Scan threads}. + \QC omits internal messages and run configuration warnings for deduced configurations by default. To view them, deselect the \uicontrol {Omit internal messages} and From 3581d1c5dd624c7d6f3cf06be9353c1d22213a79 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Fri, 20 Oct 2023 13:50:53 +0200 Subject: [PATCH 1757/1777] CMakePM: Fix C/C++ code model preparation Only set the compiler flags for the active language. Select source and header files accordingly to the active language. Fixes: QTCREATORBUG-29707 Change-Id: Ieeaa56f85ccc937f31253ac047538fa19ae4166f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> --- .../fileapidataextractor.cpp | 66 +++++++++++-------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index e097ef2c76d..2a0f0eaf678 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -10,6 +10,7 @@ #include "projecttreehelper.h" #include <cppeditor/cppeditorconstants.h> +#include <cppeditor/projectinfo.h> #include <projectexplorer/projecttree.h> @@ -442,27 +443,41 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture return isUnityFile(buildDirectory, path); }); - QString headerMimeType; - QString sourceMimeType; - if (ci.language == "C") { - headerMimeType = CppEditor::Constants::C_HEADER_MIMETYPE; - sourceMimeType = CppEditor::Constants::C_SOURCE_MIMETYPE; - } else if (ci.language == "CXX") { - headerMimeType = CppEditor::Constants::CPP_HEADER_MIMETYPE; - sourceMimeType = CppEditor::Constants::CPP_SOURCE_MIMETYPE; - } + const QString headerMimeType = [&]() -> QString { + if (ci.language == "C") { + return CppEditor::Constants::C_HEADER_MIMETYPE; + } else if (ci.language == "CXX") { + return CppEditor::Constants::CPP_HEADER_MIMETYPE; + } + return {}; + }(); + + auto haveFileKindForLanguage = [&](const auto &kind) { + if (kind == CppEditor::ProjectFile::AmbiguousHeader) + return true; + + if (ci.language == "C") + return CppEditor::ProjectFile::isC(kind); + else if (ci.language == "CXX") + return CppEditor::ProjectFile::isCxx(kind); + + return false; + }; + if (!hasPchSource) { for (const SourceInfo &si : t.sources) { if (si.isGenerated) continue; - const auto mimeTypes = Utils::mimeTypesForFileName(si.path); - for (const auto &mime : mimeTypes) { - const bool headerType = mime.inherits(headerMimeType); - const bool sourceUnityType = hasUnitySources ? mime.inherits(sourceMimeType) - : false; - if (headerType || sourceUnityType) - sources.append(sourceDirectory.resolvePath(si.path)); - } + + const auto kind = CppEditor::ProjectFile::classify(si.path); + const bool headerType = CppEditor::ProjectFile::isHeader(kind) + && haveFileKindForLanguage(kind); + const bool sourceUnityType = hasUnitySources + ? CppEditor::ProjectFile::isSource(kind) + && haveFileKindForLanguage(kind) + : false; + if (headerType || sourceUnityType) + sources.append(sourceDirectory.resolvePath(si.path)); } } FilePath::removeDuplicates(sources); @@ -477,9 +492,7 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture rpp.setFiles(Utils::transform(filtered, &FilePath::toFSPathString), {}, [headerMimeType](const QString &path) { - // Similar to ProjectFile::classify but classify headers with language - // of compile group instead of ambiguous header - if (path.endsWith(".h")) + if (CppEditor::ProjectFile::isAmbiguousHeader(path)) return headerMimeType; return Utils::mimeTypeForFile(path).name(); }); @@ -514,13 +527,12 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture rpp.setPreCompiledHeaders({qtc_precompiled_header.path()}); } - RawProjectPartFlags cProjectFlags; - cProjectFlags.commandLineFlags = fragments; - rpp.setFlagsForC(cProjectFlags); - - RawProjectPartFlags cxxProjectFlags; - cxxProjectFlags.commandLineFlags = cProjectFlags.commandLineFlags; - rpp.setFlagsForCxx(cxxProjectFlags); + RawProjectPartFlags projectFlags; + projectFlags.commandLineFlags = fragments; + if (ci.language == "C") + rpp.setFlagsForC(projectFlags); + else if (ci.language == "CXX") + rpp.setFlagsForCxx(projectFlags); const bool isExecutable = t.type == "EXECUTABLE"; rpp.setBuildTargetType(isExecutable ? BuildTargetType::Executable From 7c64f1d4dce6ac0fd1d26a97ea63413cacb6570a Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@qt.io> Date: Thu, 19 Oct 2023 15:32:04 +0200 Subject: [PATCH 1758/1777] Examples: Avoid warning about scaling null image Change-Id: I16f75c2c6d05017b99596ca0855e0d86f4a74a6f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/qtsupport/exampleslistmodel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 83d1659a5f8..2a48449ef32 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -251,8 +251,11 @@ static QPixmap fetchPixmapAndUpdatePixmapCache(const QString &url) // boundedTo -> don't scale thumbnails up const QSize scaledSize = WelcomePageHelpers::GridItemImageSize.boundedTo(img.size()) * dpr; - pixmap = QPixmap::fromImage( - img.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + const QImage scaled = img.isNull() ? img + : img.scaled(scaledSize, + Qt::KeepAspectRatio, + Qt::SmoothTransformation); + pixmap = QPixmap::fromImage(scaled); pixmap.setDevicePixelRatio(dpr); } } else { From 857b4a67bbb6bd52cd4fc902a01ab75a11079e28 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <thomas.hartmann@qt.io> Date: Thu, 26 Oct 2023 13:43:17 +0200 Subject: [PATCH 1759/1777] QmlDesigner: Add missing qualifier Most of the time the QML runtime seems to ignore this, but there is race condition and it can fail. Change-Id: I6330b5b70bb15a9886349020c976213d66c8e481 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> --- share/qtcreator/qmldesigner/stateseditor/Main.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/qmldesigner/stateseditor/Main.qml b/share/qtcreator/qmldesigner/stateseditor/Main.qml index 1e9c3dccde0..b160bd5e86f 100644 --- a/share/qtcreator/qmldesigner/stateseditor/Main.qml +++ b/share/qtcreator/qmldesigner/stateseditor/Main.qml @@ -579,7 +579,7 @@ Rectangle { anchors.topMargin: root.topMargin anchors.leftMargin: root.leftMargin - ScrollBar.horizontal: StudioControls.TransientScrollBar { + Basic.ScrollBar.horizontal: StudioControls.TransientScrollBar { id: horizontalBar style: StudioTheme.Values.viewStyle parent: scrollView @@ -594,7 +594,7 @@ Rectangle { otherInUse: verticalBar.inUse } - ScrollBar.vertical: StudioControls.TransientScrollBar { + Basic.ScrollBar.vertical: StudioControls.TransientScrollBar { id: verticalBar style: StudioTheme.Values.viewStyle parent: scrollView From 52a6d2ab6b3bdddb70ed50b204e00c610b7615fe Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Mon, 30 Oct 2023 17:14:26 +0100 Subject: [PATCH 1760/1777] Doc: Describe the Preferences > "Sort categories" option Task-number: QTCREATORBUG-29392 Change-Id: Icfe9caa387fdf809be136b813de6b9ffe4a05718 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../images/qtcreator-preferences-sort.webp | Bin 0 -> 12348 bytes .../howto/creator-how-to-find-preferences.qdoc | 7 +++++++ 2 files changed, 7 insertions(+) create mode 100644 doc/qtcreator/images/qtcreator-preferences-sort.webp diff --git a/doc/qtcreator/images/qtcreator-preferences-sort.webp b/doc/qtcreator/images/qtcreator-preferences-sort.webp new file mode 100644 index 0000000000000000000000000000000000000000..5691024ada227f68e2e5a8a09e6d7ee9f2004071 GIT binary patch literal 12348 zcmWIYbaOK?U|<M$bqWXzu<%hgU|`U<KUB>i+WmN2uZm~bzsT=zBi~pnsWAlISSVKF z<b3E$Xi&nw7w_8UO;{iGah{5uG&h6qjCmX8JKgzkulC#CQocP#|94~w-TxBwQTS=v z@8u_Yt%4MT%8FA1gl}nuSsEK3<~aLi;+ZouUVg0iG}!&wMya?exT*M<k8A|5Mp#;F zpM<*6?uL_3#QL08vKucK3F0tkU^sNqSKzjc=Ik45a>CtGZ<l@A_VyIN=cL@r*J|(O zGrhX|Z?k*G?QQne+j=+ef4l#`tn+`#oxMv=l)j2gt6}{1^8Z}h+$ZI~>%TC?S?>KV zck_k^Q_Ll2(G5pay}6WHbJyD>&w1;;iha-eU1`(WYj2<4`}F_EA9L=%FF#j%-@X6c zZ^@iH5#~>Nj;ZcdS1^wAl=iGRvRL<8v*@<W^JdcuQ>V(cU2Rt9E@G3M?)koOcI<Y} zP7!U}t}jgPZqp`iTc3O=OQ3j0K#GLhlHC)x1#I4WHuv@(?gDcT?kW8BLdFeRv6Bj9 zA8Nf!U9y5P%f(Yah2@oiU%v5|neEfo<mTUgR%^${xK!NCA+;@Bu*2#5yVRD|A=fTm zxx?|teoEYmpRNb)?mOf2Ki6@S?6$Qg*B{wkP$^!ZprZRSE}r4H>&^fF4_8@liSEj^ zj=Z@o_x85j+hs-m#{WOh?|e2@9W1c*?=`b+W@+Xtb3cdAtu?*+F7oOz)f+a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^HjobryR`L2T!f_paE$XjteZG{NExY&T zwmR3uo|oybI)$x&JyoxomG|h#LG#GO<ImHAA7B2y_2pA;t4mQgR3xObEo!g3h)1W| zhU8vxGq@C4@Mj(C;flKx(vH8ss(tC~=1%jaZ!~<&P2x1I*PdB<E9cOs9=V@lvL|Pr z++}xG`_k3T8_k!#v7E6|dFrN>seV_}lBcDAIkEo2#5pt9yk4oud*bA-Z~N|~XUp!< zOx-N_%6H+`MO#01+<Desae3|C+-&K};1mB|9OYKL-w-m}>Gk;)QPTM*&R#!ky>5}7 z{F{5x@BSW~vhlFk{Y25bf9g8y6xZGoiQ4YG>e?~oU%YqsNZ)(bo)O==M$C50KevxF YjauIryRVL#eWCyUBaZ(!Qw60M0Qg#_9smFU literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/howto/creator-how-to-find-preferences.qdoc b/doc/qtcreator/src/howto/creator-how-to-find-preferences.qdoc index ffd14e18915..b59e9709212 100644 --- a/doc/qtcreator/src/howto/creator-how-to-find-preferences.qdoc +++ b/doc/qtcreator/src/howto/creator-how-to-find-preferences.qdoc @@ -26,6 +26,13 @@ \li \uicontrol {\QC} > \uicontrol Preferences \endtable + \section1 Sort preference categories + + To sort the preference categories in alphabetic order, select the + \uicontrol {Sort categories} check box. + + \image qtcreator-preferences-sort.webp {Preference categories in alphabetic order} + \section1 Filter preferences To find a particular preference, use the filter located at the top left of From 8762af4912ac54e4efa5b30b6695a3bd448586e1 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 31 Oct 2023 11:49:22 +0100 Subject: [PATCH 1761/1777] Doc: Describe the "Stage for installation" option ...in Projects > Build & Run > Build Settings. Updated screenshots. Task-number: QTCREATORBUG-29392 Change-Id: Ieb44b593452e4999c9603ae51148075cb23b6e86 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- .../images/qtcreator-cmake-build-steps.png | Bin 8576 -> 0 bytes .../images/qtcreator-cmake-build-steps.webp | Bin 0 -> 7656 bytes .../images/qtcreator-cmake-clean-steps.png | Bin 8215 -> 0 bytes .../images/qtcreator-cmake-clean-steps.webp | Bin 0 -> 8334 bytes .../images/qtcreator-cmake-generator.png | Bin 4822 -> 0 bytes .../images/qtcreator-cmake-generator.webp | Bin 0 -> 3622 bytes .../cmake/creator-projects-cmake-building.qdoc | 12 +++++++++--- .../creator-projects-settings-build.qdoc | 2 +- 8 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 doc/qtcreator/images/qtcreator-cmake-build-steps.png create mode 100644 doc/qtcreator/images/qtcreator-cmake-build-steps.webp delete mode 100644 doc/qtcreator/images/qtcreator-cmake-clean-steps.png create mode 100644 doc/qtcreator/images/qtcreator-cmake-clean-steps.webp delete mode 100644 doc/qtcreator/images/qtcreator-cmake-generator.png create mode 100644 doc/qtcreator/images/qtcreator-cmake-generator.webp diff --git a/doc/qtcreator/images/qtcreator-cmake-build-steps.png b/doc/qtcreator/images/qtcreator-cmake-build-steps.png deleted file mode 100644 index 9ecce473c5be888c53c88e1f4e3a2018d77a6255..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8576 zcmeAS@N?(olHy`uVBq!ia0y~yV4BLnz*xk=#K6FyJ!@My1B0Twr;B4q#jUq@@As>O zC+dIrBVWnzerk@gik`szZjpQ@wbzEnzBNsL<M+m*^2W*92<v^Dck{bA8NJ!0<FT2) zZ;HoBRrAe<{J7aw6_i+iM<w%1tm}|}Xm{Z4ezoOw^H*72jkUdOd)fB0X6=^S!L_S) z?b@|#f34r#b)Td8?LTQSY>2Eot;fLdlb7K{K7&IYbHg7t1~be3>)-ls&a8j_a4!4L zwd~iUSj#^B=FhXwT+V#p)u-Plt=TVM+p>T2qCa}?RxM9Dxb`;tQKslP6^00t{hyEM zDp$t5tz7u0Pk!ky<MTN`c^QtMdG9h!{NtX@@!@A*|150$RAyWH`FGIFOXYg5{k!X{ zSI@b>cFOjwSE<zwJ9GKJeV=W8>%PjX<KIFV8a_w-?^CXHsS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zW+-u|h&B6Mx3 zX}QSJ&HJstFPDp|V=kEX*_!9U$CJME=k5M}uloBu>sOb+CV^&^8$_Rf5B9hH8h`$~ z$hU?+YzdP;{Z^L$dE#id`231ToyF4k9`0<n75LV?n5Cij<okZRFBe+5#pUY%d|bPB z?Q(dkwE1$uxlf3}Ol^Pjga-@1{k;9Wl<RzK1@neVc;Y`$`E`DnVn-;mUFH%71_lOC LS3j3^P6<r_Gq0gd diff --git a/doc/qtcreator/images/qtcreator-cmake-build-steps.webp b/doc/qtcreator/images/qtcreator-cmake-build-steps.webp new file mode 100644 index 0000000000000000000000000000000000000000..d90c97cb81f6b69065e83da00526ef2a6d8dcbb1 GIT binary patch literal 7656 zcmWIYbaQ(k%fJxs>J$(bVBvFFmVrTk>!B=$xWqf#CMvJ|zsdaW%R|;mY7O~ceFFAA zD|#+^@9u4ObIGUIc<)`(Tru;(gQZi7@7=xiq<r?O?3Z=s+=WNK{`voATVdSUFIj=V zq@K*a$y3_7OVj+7n})0Y_gcfMr>A#@O^=LkWMHghkNq+2)BoE2`~N>w^lh!z=So`9 zn_HGVm-T``lcKXx$3xD;d2bjMHwUpZJ(pN1GWp<sZ?U^)+=M0x$_E8bVpO?#E67s& z<eA=k%$ZBOUR3Ko>~~=4ID4n{R7YZe=hk%%TC1iD{M@YUv2E+}+_K4mj*-naT$+3q zKc@eiw92T(GW6!*p3uC#%(8PI%ZmI{{TeTpa@+BC%=Rsd%q-t~GBw7_&v@d!ZCicY zlRKA=ZJXPZ>;HZ7a;;~nH_YB|*u8vXZ0VQyBikmMx_=kAZFy>DZulIV4LP^XWKA_a zZ*H64o4x0AQq5B7)Z1B#EVs9vvq}DydpkGz_Q~Iiqz-S$?c4CbK*BRf#Z~U{qS7A; zzJkv(<X8WDee2{brKFRAVkd1jWh~PPHgOFx3lMu-c|67Lh0VpA9{syp*h~BZe`vES z_PEDBxE9}WNHR-tLrJ5Az15{erWK5LGcV41w|Pomp!bU97L$K69TbjOAI}jrvH!|Z zov2T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euzO4uG}Pkj+*`f;t$q}49({USda zOzL1uxbnEp@Jjf}Nw0St*>70V#w5Gtg*2;b=;Cti|Dg-NztOQQ{(54*TS!&x-&s$s z8KYd3RW65g@4u=fyLCd0Zq@Y-UxK*>oR>}BH%WE-k>Bsui-#uuS?fD(Ld>fW1%^$l ze+PstI{LOIV9ELgrjK64MLTky3|(BlkilV>#uf3+Ppme-Uu;=($X9h&c=!3Otxudj z?w5CaHu<n`p<>Uk7N^>&Iy=|Bs}`#dveVkI-PCK%`?qBuyKn7OdD676{~2S{|D_9q z-c*bIzoW2jyU6c<AFQwJxTo}+bL%>t%f<aW;{N2M_4%kjUECC;;qK_w@Pl3auke1x QnQMQoKg}FvAIZZ20EYkLX#fBK literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-cmake-clean-steps.png b/doc/qtcreator/images/qtcreator-cmake-clean-steps.png deleted file mode 100644 index 9e1b9d512321f3f56990f955c46090c1ccab5693..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8215 zcmeAS@N?(olHy`uVBq!ia0y~yV4B9jz*xk=#K6FCU@dP51B3iMPZ!6Kid%2*`u58l zPh?B@&o8fI*r0N_LHV>7O9V@j=9O2or#+g$&FRH==ZS;nDZR=7KQ<5HEe%f(wo7>M z9TZw-B(A*ep-j&4i0s^h;<B}K<0rp*|LWDNpEvH_oEvG^%bt?&U+(Yke|}HwRnyq` z%2zMb85(*&i|%G%aIs)eIK;>x$j6}cXXf%UIlu0Q4|%Hv7_ONeT7SoKPTApybHmRm z94hBq_A$WrV%S#2_VR6eav2P)552xJNABL<OaCf2Y`(=&|MXpA^|}jxB9Cq3U~gbm z-qZI=&3CoP{>d&C>yOlIn5^se{gZ`GMZpET4O8{MTvzA)8pK|{?blRB<N388bdF}a zzZdPbvu22C;n-hj;CtC*uUMRF#`;CO&s?0_T(;8U{p$kV=bm1-Z&v-j7tHVdQ2D%^ zz4zpgM=Q3fp0zqG+*!aNcbVh=lFqYnzqY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uJo<UyFp)VE@qw5d^*RzD#X9)OW>Yq8(jZ#o_sZFs`%=vFE2j7S@r7S?)!h= z_1FJ-{9mixK<HnNJeRdg3-g9Z!Fx|~r$0<w(|O?6!G}{ULfH#%>Rz=m;raFIpi$fF znN{k7XUkMF@2pMV@F^+u?5B(0(t>SH<_q#2IOg(0I)Bf{7}FTtPw%q~za<JT41cV7 z_D8{~;`6rC{~AYTN%8mFt&!{U`n>tt9X@%xtm*HbNv_+oz2b9J(c$}3oQ(|M2ng~W zP;;#iYIS|5EBf%}1{uApwvon}|7J~=$Unz$i$i{0%|?#%e4xna_;5YG{%`crg0FQe z*!TZjTeU;7>HWW}&-VX%_-9I<#<DNhKE6ns5uz_@8*uiPPV{>9Swi+v|8MHuvAdG{ ze$7<(+q+)~lyz{hClo8$c%C);m3NKzOxL%>t2~D_GrP8j-ZKB)d0XtmV^Q<hGX)<W zZk_GB=D(kuzj@M5(1@I*pq$mWif>K4`S<_-egA%c?VY8E`C#Lct2;l0$Jc(<=e-EA z;I8tY?D*feo}Qi_U-eS;WGruDc#Eu1S@&bMhOK=c)aTWFy0p|=f8UQs*REY#-Tzmh z%;|<`V!O@HCzB!RvRUBK!V5pa$y{+i<BcB394vT{m6<{M`G3Y`x%PW_EW7qGFfcH9 My85}Sb4q9e0BPv-A^-pY diff --git a/doc/qtcreator/images/qtcreator-cmake-clean-steps.webp b/doc/qtcreator/images/qtcreator-cmake-clean-steps.webp new file mode 100644 index 0000000000000000000000000000000000000000..ea074e567180688ec6901eacd1bc8daa0cf23a52 GIT binary patch literal 8334 zcmWIYbaQJ{U|<M$bqWXzu<)r;U|`T+>r~9}mFuzFBq`sg@@55W|9d((Pt+`&e<IiQ z54)?7=zo`OG5*zSmuJ3S>3!96X>iT?ZTo|iUtZ4P`|?a?rp%r<Ph?)S*lf0Zp7A#R zUvY5)^Xy_5r&swK7Vf+B=ic+m`sXqR^Qzk4-O5nD+96l9`eVrD71NFyEjKGV(jsKg zIPF&1^CM-A)7BnKS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(ZOC8s(ngo< zxHDVoie2Y>&YhLrSbWc*m(xnwkAqiWQT5*=+nsHg_I6#4?)n^-7s4NW@pRHvYd*D) zM)`gl1kDme(zjokYMA(W$*kv`Qy270*j?CE^H0U%j9rqB1QYL<)_v9ws~2=G2rt|g zS5mw9i_!VV`rphnlOC`g;e37EzvFj*!lMZ<vhIq$P+PuR^CFLvs*6m;{kx4k3Y({T zb*x`usxPdic(r7TCuh=~-0b4mLiQJ|Iotj>b(AKVe0b_+s=DX_(`{G3@<l?)C$0+G zFPXnf>rM9Q$7dBnHs#(vI)9(7>Gh>&8I0b4H)7m&->P=Cof_*A1>vy%z6%BH502(G z<e1-CaLwhj(#7s?@fQU3ieC4`{@doiBE@*y1IgQQw_~R0TwlYva9iWUsH&N}d_F%q zGy9RqcZRqc`+NHNsj5o9ep_Gb|F-L0`j++cihmu~7drB7*3%`jN4#W;PHa<p<@$O} zL6FXVJ{~Kl$4}O`R2jY$k9{t+yy1o>cOjqfamx#@uYBU0D{$OAwZ43gxvJ6$#-NMO zYaTv6-fNvIGP5*TiN|=!qwG2RzaN{MADD8_vaw$wX43rq+f<Gz*<U%Bc(d}+%3AMV rl^de%tnO>DPP}vHd*k^w|H)S-=$Uuex22~4zaN~ucgmmR>pU0%{k<ZT literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-cmake-generator.png b/doc/qtcreator/images/qtcreator-cmake-generator.png deleted file mode 100644 index 19c883bcb5b31236e7a93df68d9a47377bd31232..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4822 zcmeAS@N?(olHy`uVBq!ia0y~yV02+%V7SA<#K6GNe#)Plfk9}lr;B4q#jUq<Zx+jj z&u#c?#QNV^Zja3lwr7g>6cRkArD)&M(cJc=qWA3)&kzm`o$%Him6@lQSIvwN);_kx zNz`<z)K!ndq-J&JP8I%(N!Jc>MrtTr*I{H55e;e#;MrriKQ8b4OS|V^-fEZLU;6%g zsQT6KcjC^yzw`O4<@WV=_Loj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`lNO0rKQ!%t>x#|bR6FFX@c_SpWaKSav%S++M#ly!RJXg-)+)( z@p%7xE6cajwaTp8J8~rS9nw4$Ki^m={PynON?momHEUulq%`+@zT@@s(ceu<M%FuC z?*s+zvx5f@=4K~;d2{K~&5KKP{mxI_qniS*L8t%B-c+wy)sRq~el<4OE3CVv^GxgX zpB2^R@o}d)(^LM{EctL{=hW5D{l4rpinlG_pYvevnevGS#Zzuxzm&4kU!nLxN@eW* zyPAOo_gp}Zd2#S@ZfxyN-Q{-*BQ!1R5+lEqU5lOB|9$J-`jt<nKiT0iqw-|VW=kEu zWADBg9q(&DGr{ZG?OVI5ieqZR_fC(Wu=49C;pL}ZD{T(0d&0T%c<n=vc~>VG<Qnnw z@Z`iQ|NFA@Ptlh*H!tTc<an_!=F|12MQe|3zj`=R^<vYji3SsQJ}`Q3Uy+mk{OnJ? z@3CCZdc@yzpOT#^zyEA~<@wF$@-MU(uWoLcx%kY!NvGyS=|;_(9qlz?XN}>9=T~lB zeCDTYykt`4{e#K#-|X4>;k4cEGoQ{gZ{NZINtMz4bw%O+55+l!XM*gxU-aOGx>Xg| zeozGe{`D&_hf&2RMQ_)c<aYau8<&3oh2)8tlwbRI+_`Lj$=;+Y`1d;|eW3-y&%~#H z6^qzkS6f|OU0z<k(RUgs2Z_z(_C9`OdX;>IpVhAuFBBzrbM5rV5K4I8JiV;;)t-Ay zpCWWB&%{PYN9X6~$2(5EpyI%3e3sd2;?B;A=@(8-2z}%J)~ms7vh9-Y(@>60miU6L v4rvT2Y;fd|#sEhtYz=DDB^kI5{AV^wJzmKD<b^Z?0|SGntDnm{r-UW|qA6e& diff --git a/doc/qtcreator/images/qtcreator-cmake-generator.webp b/doc/qtcreator/images/qtcreator-cmake-generator.webp new file mode 100644 index 0000000000000000000000000000000000000000..1984984499c4cfb6239c41830e71d41b834856fc GIT binary patch literal 3622 zcmWIYbaRvAV_*n(bqWXzu<#M$V_?wNcGPFMdSlkN_(Em(@}F|m(=&p(j4xkZpmXz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X<2ZuK6V}Y@6$pyW&|=#*#a$ zf)-a<JnUo**l>2z1ewnZ`c>7AE?_%d#-&x}DRaE@WZJ1!eX9a}s?IPf+dPxFp1634 z$I(}o?Jipv&f0N3P<qwl($9;{r|^k2OIegexR$=yv~An9gJ-84Wi)-A&~N$EW63$K zpK0vfiMA7ztNb`K4{VQIU}d#phr?~nJ8fLEEO#H`xFz#EtmO*#EOy(4E|EN1r`EQ+ zZ7E1iUHbn*qNwOq)l+uGKKrNj%G_AW9@dj(=>8>8XyUboESLBd1&!N+cWj-M#uU{! zcREY8#7uTuoj^@D(@pu)7tQ(+_|jN9eD%ipsoP$L8~=Y5Vjeo%Mfs8Rl~s;f%967M zx7@zu@s=sWx^<`e(~$Mol=kTt2O7KXa=v*wDdIQ3%+f1$x;kRtH{E}8c~jEIbw1Z` zMk}+~%AFOoUCwg#`EH$tpp~~$@@*YK-guSsRz-Qm-;JyfUg+trJIighxaxq-i?nx% z6TQ4=<T-4r^M7_Q^vqqIpqCQQwxrnh{Ih)A6;QU(W9ig6b8MHV`811*pL*U}6sTbx zsdDMh%KzRsi&tICn8|wnbN6}+t<u;NPZjm|3uKnW?ESOi%bv^7yzz3)^U9;*;$B8q VZ(ZXLwq3radjE3gBgsocm;uV*1$_Vj literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc index 2ef8d2e107c..f8c8842b1f5 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc @@ -192,11 +192,17 @@ You can add arguments to pass to CMake and the generator and targets for the build command in \uicontrol {Build Steps}. - \image qtcreator-cmake-build-steps.png {CMake build steps} + \image qtcreator-cmake-build-steps.webp {CMake build steps} \note While the other CMake generators are installed together with Qt, you usually need to install Ninja yourself. + To install the application to a staging directory when cross-compiling, + select the \uicontrol {Stage for installation} check box and specify + the path to a directory in the \uicontrol {Staging directory} field. + The packaging tool constructs the package from the contents of the + directory. + \section1 Using Ninja as a CMake Generator To use \l {https://ninja-build.org/}{Ninja} with CMake, you must install it @@ -211,7 +217,7 @@ \image qtcreator-cmake-kit-configuration.png {Kit CMake Configuration dialog} \li Select \uicontrol Change next to the \uicontrol {CMake generator} field to open the \uicontrol {CMake Generator} dialog. - \image qtcreator-cmake-generator.png {CMake Generator dialog} + \image qtcreator-cmake-generator.webp {CMake Generator dialog} \li In \uicontrol Generator, select \uicontrol Ninja. \li Select \uicontrol OK to save your changes and close the dialog. \li Select \uicontrol Close to close the @@ -247,7 +253,7 @@ When building with CMake, you can add arguments to pass to CMake and the generator and targets for the clean command in \uicontrol {Clean Steps}. - \image qtcreator-cmake-clean-steps.png + \image qtcreator-cmake-clean-steps.webp {CMake clean steps} The build errors and warnings are parsed and displayed in \l Issues. */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc index 5cde8af4c03..3a54e8e4e7e 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-build.qdoc @@ -117,7 +117,7 @@ \section1 Build Steps - \image qtcreator-cmake-build-steps.png "CMake build steps" + \image qtcreator-cmake-build-steps.webp {CMake build steps} In \uicontrol{Build Steps}, you can change the settings for the build system selected for building the project: From bc250d9cf0e541a2fad77446d9631b4d295f9b76 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Mon, 30 Oct 2023 18:52:24 +0100 Subject: [PATCH 1762/1777] QtSupport: Don't show semi laid out examples while updating This hides the examples SectionedGridView while the examples.xml files are loaded. When shown, they are directly in the full size. An additional benefit lies in the initial loading of less thumbnail images because with QTCREATORBUG-29811, many more thumbnails were visible in the initial view than now. Fixes: QTCREATORBUG-29811 Change-Id: I42f362497859b0b98dc48ef0f1b6399d91c0db28 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- src/plugins/qtsupport/exampleslistmodel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 2a48449ef32..3d67706b77f 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -364,8 +364,6 @@ void ExamplesViewController::updateExamples() const QStringList sources = m_exampleSetModel->exampleSources(&examplesInstallPath, &demosInstallPath, &qtVersion); - m_view->clear(); - QStringList categoryOrder; QList<ExampleItem *> items; for (const QString &exampleSource : sources) { @@ -404,12 +402,18 @@ void ExamplesViewController::updateExamples() : categoryOrder; const QList<std::pair<Section, QList<ExampleItem *>>> sections = getCategories(items, sortIntoCategories, order, m_isExamples); + + m_view->setVisible(false); + m_view->clear(); + for (int i = 0; i < sections.size(); ++i) { m_view->addSection(sections.at(i).first, static_container_cast<ListItem *>(sections.at(i).second)); } if (!m_searchField->text().isEmpty()) m_view->setSearchString(m_searchField->text()); + + m_view->setVisible(true); } void ExamplesViewController::setVisible(bool visible) From 7621b9f0f1009a729858cf7a7aaccd342ec0c3e2 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Mon, 30 Oct 2023 17:38:37 +0100 Subject: [PATCH 1763/1777] Doc: Update screenshots of Examples tab and kit selector In the Building and Running an Example tutorial. Task-number: QTCREATORBUG-29392 Change-Id: I7fa0bfe0917e54f6706f555879015501e81ef525 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../images/qtcreator-examples-kit-selector.webp | Bin 0 -> 5468 bytes .../images/qtcreator-examples-open.webp | Bin 0 -> 65258 bytes .../qtcreator-gs-build-example-kit-selector.png | Bin 5012 -> 0 bytes .../images/qtcreator-gs-build-example-open.png | Bin 54061 -> 0 bytes .../creator-projects-build-run-tutorial.qdoc | 4 ++-- 5 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-examples-kit-selector.webp create mode 100644 doc/qtcreator/images/qtcreator-examples-open.webp delete mode 100644 doc/qtcreator/images/qtcreator-gs-build-example-kit-selector.png delete mode 100644 doc/qtcreator/images/qtcreator-gs-build-example-open.png diff --git a/doc/qtcreator/images/qtcreator-examples-kit-selector.webp b/doc/qtcreator/images/qtcreator-examples-kit-selector.webp new file mode 100644 index 0000000000000000000000000000000000000000..0f712f9e29fefbac8221193d8951b5a0de30b9dd GIT binary patch literal 5468 zcmWIYbaM+4Wnc(*bqWXzu<-E^Wnj?1+vvz3`Y`F+`>E3A@AiI=+xGpQ_4e@aU6(@( z-ka@xxA%65Z~t!24!`$$F<vG4;l-ja%*uDZd8>8dyZ(L4_RYoTw)++>Y+_UrP(0I| za=_$P<afoVs|>D8k|+*lb5i3t_{D9<?CzEp!yBGEA1}*a$g(zJnQ@^lgJX{q>x4Vi z$_C+Aq<*zMS#mCJ$@gU*>$c>cUTk9=9kg@zap5};MZSxyki1p0W9|F-J&Ov<x4++; zdiPe@o{OcmFJCRO+FY7)`|r`@+kMYZ-{8vH{eO#s=ce0kTd%}1u$`E9I6>?{(uW^s z9qlz=Kbo~dD^*`8=Bvi<(4((@T+d!`X_L^prqziasg~+`{Q5t$|0}f{#tY5AVE6R% zqWa2Dr=0ht?K{Txsl2_!(c++H!K68&x9pzf|CsbsYWstP1wTTxp3iAJnwU6k;?<uM zXMBEqrhqR(@b`6xdS;p9_8MP)%~eRB^v^59ap9|)Q%~+}K7QThwcQdI4T;?H;tVan zD_L{pH%7fa6rk1J%=Mz{P{~}!1D6+lNnJUmvp!1Q@leL@qz9#J&Q}A?L*~kN9&|Zz zJnK%*mzT1EN<5c^-|<{BXl$F5xA1!Zfz69osn1yv*u6?BtVl+q=B&?dj@LgY&S1D! zGgrh)g?V1zq?>{dT;!OR7?iM0O+HY%^g(6sh4!eg8DU%=f$|>?e7=>qz)H)&;=`9d zm)`adC0}03IynB|pZ2IK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)pbNkc;xaY(IvzTza065`TJv z;Q4zm*5!Rl$YNXh;_byH+YcunSFYAH%1o_VJJ+Y?+nV}$e-AG#P5B@7srmmNF&0^` zcMo5`u3x-F^xMDRPyN37%1udpu$8Cr`gvXL347~WXP<nqzB|A3<1vd_`i~=u__Y&b zCVDJSk*Lsh{v_1$<D~1!2A*$e?Lo7C9&7Q~%yC)uu;}wi)f#_zj$OVktpZlY)b`}0 z>%-Y%9@-#<6ZT%wnrYH{GXB%#BSozTwdF%XFYK%O>*1BTIwZ^fZQ<0#K1$s`CS5p` z|JOQHgWK8rQMBjv{WpaE7yJ+SuM?`V@bCW%?@yTgdpL<-%Q^B>d#~j6^FK1w<nm2| Wf8{PVF*A!}l4g$Yte)AwOAi3eN4Q=9 literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-examples-open.webp b/doc/qtcreator/images/qtcreator-examples-open.webp new file mode 100644 index 0000000000000000000000000000000000000000..81a148ccab837547a0c76e8f067399d1e7139bec GIT binary patch literal 65258 zcmWIYbaQ+3kAWfF)hQq>z{2P1KL!T<kB1gB^m^n-drngE_&xvEAM+inHdP;M>iFm1 z@aY*-i`7Tdr~WsuZCR`Dpp~Skuqb@Xr)}(d>$+bD?Cx5vut4d`(vWqp!n9^C&(lA= zjYob%n*S>6tJgg5W@fJ1y<!1Z#x9%Aw%vzbz9?Sw^ns1$YQ_v11#vcCc1L0J4Z-pk zf)`GExbCHb)Ri_q{-zby9*Y~|1l#!o(tOLaF0PB(W^HO4;%NTLEjYDU&&xk&MpkoI z*S0H~989Zr9B!L=p=yTy=V=!E!`t0LH=8+KJKm@M%5Bbk&9;2uCoX4ReYxnSZrSzu z*bYTUWp<qt-!I)?GChVVasKj$&U*hp9^YCOY5(=}<@^59$NXIbL-GR+uY9wfC*`;1 z_zZ3H_;7z8m7UwZZ97}|U8DBK=KrlJH%_0Z;HXO9rSRuRV}O1Aq*H7vE4D55xU}%D z^{u<5|Gi%pdN(O}+8K&%v7QifJMVUk!Q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LMomW4vh<IadxZs>{-ap0#oBOqOC){UH+8`)#e)sxr<*vO4GX9AP zy8gJ{#!&F7b7QEs;P(Gw`kt>RCfPqdApH2O((|<^wU4j<`9SyVr+oRic|j~^H_kbn z`YJc>SlHT+sd?_@ObiD)4-}Q|m>PURTQKg&H0Jz^N>MwNJ}<bphJPmC6|V;wdv3U{ z?}&|iW4485Z{n3Ccl)x+jp3ozpP3KM`8n&}9<ljWckB00QJg8a=<&8Ywfjn9eMBVr zo?Y3q_qJ>F`xEKaImeD?n#`(s(tfehZW`#G@Ri#w``1Q^&+mUFd+Byg?XD{y>qEay z-??D3m=3=~s=RpPAGQtkA%;IZmx$G$n_nWq5NEe>Th>yI>c<9d?_Xcyn{&fFJw5R2 zv9h_`QtC`TOWe;%A7A}*ew9g6?dkOM$4<?ioxAI2Mnctpcb^^8J|A8q(=g$zai`6f zk3LSv9rx*fZ9OF;mMGKkcjvi_8K&n$R!T0tVk6LUYi;)D*3B~Z&+m)hto|?ix+GP; z{KK@_{l}jC{B+ZHqtNVJtE+wUnJ-uWpUS>U$!OMD)_>7T6CUPVXTBh{=Ii&T5wTNE z_pI9Wnz3SI{y!O6>)+maC-!t#z6r_9tog&eF#7wS$65dH?0<E>IC}ffDDx|qY~Ek{ rJICyqWpMznY{CCFg9FQR|E5R(zj>{GTkbTQvOTk;!7U+QEd~YvbwDLu literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-gs-build-example-kit-selector.png b/doc/qtcreator/images/qtcreator-gs-build-example-kit-selector.png deleted file mode 100644 index 77c83b0c3e64fe68b14f42890c3b3f669d329862..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5012 zcmeAS@N?(olHy`uVBq!ia0y~yV02+%V0gg6#=yW(Eg;{;z#ts$>EaktaqG=o-@H2( z0<E>3o|k6ms2%i4o7QF?w@aL@rt9Vhk-b+1i<)<J=sh}J&{nWK-rIlGqM00<)~G)? zxHfF_m(%B$M1=0SXtZC3uU*IU((m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Z=?8un<<9Pe(t?SLbwr$&{Bh+c3Klk_V-&><fzCC~by!6cx zL#f_d-@a{QZFU6fa9*V;;=Nbq+P<&}QnIi2d@GGRE_E-JEr7+*rc&dx`@z%qpYg}v oW&ZHL`Gf$Dngg|RQU5Mod`Iei!++MT3=9kmp00i_>zopr03Cq}qyPW_ diff --git a/doc/qtcreator/images/qtcreator-gs-build-example-open.png b/doc/qtcreator/images/qtcreator-gs-build-example-open.png deleted file mode 100644 index 89e377b645938b926c1245ebcafd80d83182679c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 54061 zcmeAS@N?(olHy`uVBq!ia0y~yV0y;Dz~som#K6GN`sjHO1H+{+o-U3d6}R5(4X+S6 zerwz6!~b*UzujE>_x`8t*FF`c2=YiI&rUJw$T+|_TgIi}m|4Q2j%|ep)VviY6`iy6 zI~SQ~GD$#5{rQ`}A?5z7)0d^22sw3bU-w&R@w|EOUWF~*_4QhGsGxHjUv<@mdd?;V zjwXd)MuJOpSR4gd94BlNK%q}LLHKC2CO1g201FxoHADbPqZ<a}pSq;V#w%^}YwpL% zlb-qc&3c~tPeeahQolK~hc&?}Sy8$2A<r=-gWv~KJsQK6gX89^ez=v>XW4U|HAwvY zS0nweyaw?PeCJIMp8i3{BleW>$Hz0jXn@>#<nU^p#pZiWoWI`kx%|k(xPtji(jLp` zgp)GIF6|VXm-<=a^ud~AUDF#&k21aXn%8<QG(j-gwBqQtw&$U@qdrI}zbb7k?S9*1 z{^qr%*&fXeg`5RBF|R7Pb&B_#HGX`0`pZC2Xmzv)Mhe7N=3Q>dycM24BaYozvOE1( zSNHYUX&mpAI!<4zj4PjcU$VT?bjt2E-%G{)V%{|EU<eWe1$BkQ)YJ<X4lceYZy&ld zW7f;7FPB|Ez{B=lulwkN?matxu*XjO+0m`KV@E`D=jmMvk2WQCUXNW?Z#iF%6|DWm zl+-KB3WKL`FPDmM+*GjVndtQE%tw!I-+sdWk&?cik>K>JvAsKT6jBvAniM+P{UR^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7{dN0xR%Dc)T?@z9+g1P)X{~M<lnKP=m$<5+9 z(s=T|+?$6-CanE@N7(t|?kRJA@vd4_@l4~|%kW9TK}!z?%qlvT^)`T4QW>1kyLX&F ztX12c9(T`Db;Irt#>M@*cQ?B}`gPJ~v7qhBl>W0a{RTqTA1$|*d|fvsbh0x4`uNw! zq?cUY@n-{@PW_3ScCyd@=(WvIzq9l{S4VnVQta6uMPAX<W~#Sc<GK3ru}Ax)3pUeO zH|P{|ygT~ae&MWIpVN=tXU(#kKK(9hLn@=n?%vdw*L-ZA9oRJIG&raEB}L|?S<38h zN<9eX^L<F*K+cJv<jn}qlpAyk98Q1g@6KkwK5bfS{_NL2pyU@S#;{6<AtaJvgAPN4 t7=sSCLgXd$1Q0hu46KcTFF&%5Ave7DR?}RU!wd`z44$rjF6*2UngH0Zi7fyC diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc index ef286dfb45e..77e9263a323 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc @@ -34,7 +34,7 @@ \li In the \uicontrol Welcome mode, select \uicontrol Examples (1). - \image qtcreator-gs-build-example-open.png "Selecting an example" + \image qtcreator-examples-open.webp {Selecting an example} If you cannot see any examples, check that the list of \l{Add Qt versions}{Qt versions} (2) is not empty. If @@ -52,7 +52,7 @@ \l{glossary-buildandrun-kit}{kit} for the device. - \image qtcreator-gs-build-example-kit-selector.png "Selecting a kit to build with" + \image qtcreator-examples-kit-selector.webp {Selecting a kit to build with} If you installed \QC as part of a Qt installation, it should have automatically detected the installed kit. If you cannot see any kits, From 1341a75c78887ba6bf0b5da09753e52cb6a9c4f8 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Mon, 30 Oct 2023 16:27:02 +0100 Subject: [PATCH 1764/1777] Doc: Add new groups for creating projects and files ...and configuring projects. Task-number: QTCREATORBUG-29361 Change-Id: Icaaa9271b43efe4bba6a4ea436fe0dc6b76bb614 Reviewed-by: Eike Ziller <eike.ziller@qt.io> --- .../src/howto/creator-only/creator-how-tos.qdoc | 14 +++++++++++++- .../creator-only/creator-files-creating.qdoc | 10 +++++----- .../creator-only/creator-how-to-add-wizards.qdoc | 2 +- ...ator-how-to-create-compiler-explorer-setup.qdoc | 2 +- .../creator-how-to-select-build-systems.qdoc | 2 +- .../creator-only/creator-projects-creating.qdoc | 6 +++--- .../creator-only/creator-projects-libraries.qdoc | 2 +- .../creator-only/creator-projects-opening.qdoc | 2 +- .../creator-projects-settings-dependencies.qdoc | 2 +- .../creator-projects-settings-editor.qdoc | 2 +- .../creator-projects-settings-overview.qdoc | 2 +- doc/qtcreator/src/qtcreator-toc.qdoc | 8 ++++++++ .../src/vcs/creator-only/creator-vcs.qdoc | 2 +- 13 files changed, 38 insertions(+), 18 deletions(-) diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index fb9bccd529c..a63eb2959ed 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -40,6 +40,18 @@ \generatelist creator-how-to-projects + \section2 Create Projects + + \generatelist creator-how-to-projects-create + + \section2 Create Files + + \generatelist creator-how-to-projects-files + + \section2 Configure Projects + + \generatelist creator-how-to-projects-configure + \section1 Read Qt Documentation \generatelist creator-how-to-get-help @@ -235,7 +247,7 @@ \page creator-how-to-add-license-header-templates.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-files \title Add a license header template for C++ code diff --git a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc index f1f6441ee24..21c189a6986 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc @@ -5,7 +5,7 @@ \page creator-file-creating.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-files \title Create files @@ -81,7 +81,7 @@ \page creator-how-to-create-cpp-classes.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-files \title Create C++ classes @@ -111,7 +111,7 @@ \page creator-how-to-set-cpp-file-naming.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-files \title Set C++ file naming preferences @@ -137,7 +137,7 @@ \page creator-how-to-create-resource-files.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-files \title Create resource files @@ -203,7 +203,7 @@ \page creator-how-to-create-opengl-shaders.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-files \title Create OpenGL fragment and vertex shaders diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-add-wizards.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-add-wizards.qdoc index eaa7ce6b95a..1181b3a9cdb 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-how-to-add-wizards.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-add-wizards.qdoc @@ -6,7 +6,7 @@ \previouspage creator-project-qmake-libraries.html \nextpage creator-version-control.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-create \title Add wizards diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc index 5c20e55d2c2..08bc4764434 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc @@ -5,7 +5,7 @@ \page creator-how-to-create-compiler-explorer-sessions.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-files \title Create compiler explorer sessions diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc index b2732eae0a5..480ae3db940 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc @@ -6,7 +6,7 @@ \page creator-how-to-select-build-system.html \nextpage creator-file-creating.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-create \title Select the build system diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index e1949ac815e..7d74e00410f 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -76,7 +76,7 @@ \page creator-how-to-use-project-wizards.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-create \title Use project wizards @@ -177,7 +177,7 @@ \page creator-how-to-specify-project-contents.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-configure \title Specify project contents @@ -251,7 +251,7 @@ \page creator-how-to-add-subprojects-to-projects.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-create \title Add subprojects to projects diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc index 840326fbdf3..51edcf39b77 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc @@ -11,7 +11,7 @@ \page creator-project-qmake-libraries.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-create \title Add libraries to projects diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc index a7290ca18cc..ccbe2316b47 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc @@ -12,7 +12,7 @@ \page creator-project-opening.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-configure \title Open projects diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc index 6bc316b0e31..0fb7729d887 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-dependencies.qdoc @@ -11,7 +11,7 @@ \page creator-build-dependencies.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-configure \title Specify dependencies diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc index ba622d8b2ae..684a960ed35 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc @@ -11,7 +11,7 @@ \page creator-editor-settings.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-configure \title Specify editor settings diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc index ba199b27297..6a15f763200 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc @@ -61,7 +61,7 @@ \page creator-how-to-activate-kits.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-configure \title Activate kits for a project diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 7e633a338c3..e82802be2a2 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -190,6 +190,14 @@ \generatelist creator-how-to-manage-kits \li Manage Projects \generatelist creator-how-to-projects + \list + \li Create Projects + \generatelist creator-how-to-projects-create + \li Create Files + \generatelist creator-how-to-projects-files + \li Configure Projects + \generatelist creator-how-to-projects-configure + \endlist \li Read Qt Documentation \generatelist creator-how-to-get-help \li Use \QC diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc index e0e0eab6b37..d483e54ca9d 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc @@ -78,7 +78,7 @@ \page creator-how-to-create-vcs-repositories.html \previouspage creator-how-tos.html - \ingroup creator-how-to-projects + \ingroup creator-how-to-projects-create \title Create VCS repositories for new projects From edea408026dde40d6b3b7ed5102718c2ff28fc46 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Mon, 30 Oct 2023 10:27:01 +0100 Subject: [PATCH 1765/1777] Doc: Describe new Terminal features Task-number: QTCREATORBUG-29392 Change-Id: I00aaf4cad1ec521e42f5c55bb236d0c3cb04a4d6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- dist/changelog/changes-12.0.0.md | 2 ++ doc/qtcreator/images/icons/shortcuts.png | Bin 0 -> 484 bytes .../images/qtcreator-output-terminal.webp | Bin 3064 -> 4474 bytes .../qtcreator-preferences-terminal.webp | Bin 6012 -> 6548 bytes .../creator-reference-terminal-view.qdoc | 17 +++++++++++++---- 5 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 doc/qtcreator/images/icons/shortcuts.png diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 177ae477ff0..98c65bc68a3 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -299,6 +299,8 @@ Terminal * Added support for Windows Terminal schemes * Fixed `Ctrl+C/V` on Windows +([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-reference-terminal-view.html)) + Version Control Systems ----------------------- diff --git a/doc/qtcreator/images/icons/shortcuts.png b/doc/qtcreator/images/icons/shortcuts.png new file mode 100644 index 0000000000000000000000000000000000000000..e059023486e5892f98dfa9d27d7bb222bdefe7a5 GIT binary patch literal 484 zcmeAS@N?(olHy`uVBq!ia0y~yU=RUe4mJh`hTcwDUIqrn)t)YnAr`%Bubl1f3zT5{ zaR2u#PQ|C%YjkpI&fIc4b?Dd(jWcNymvY{^N5)8Jr5H+w1$E47t(n?7HR&P$f+HQg zowJNQD~@ldIA^^~^S!b0&R16~zkj}SedoI0ckcd4H@P)i#eXArEccTijT=?e(>NyE z9OtV!rtNcfa*k%z2Bz(kcuXeC=%lQloO3{V&GBWkwn{Db411*A=cIg+S>}M?mq#gq z|8~2@GVd?oI=+Fweb<I{H}=halC^QS?a2!DZ7R$=8jUL=57`#WFOa@}JH?Z&aN&*U zpnsK<Q=%u$_FOmp*VzT{T=m7+h5t=^5WKv_>d@1ShkWxyTxBn=`S~v*v`sO_`;u2t z*~J#mUmGN!7lel%Kj>#Et2@0dKDzJjs<5A%G7c@u3%%+8aPF%2&wOtj+N2^qxyEPH zv-nO=KJlaXtpx8KF0AngQjTN3yz1JkT=v;NBJ<v8_S!TR?pYhDZ!qP_DV;>&*oqEY zi~fBohb7icHfOgsocpB6_#}tgM*EXDoFXRW_<rJv4oS{;dzBgER6nWi>*Qs<-x})r s_iko>EA759+SKBCv*#Usy@T?{BD!1K4oy>FU|?YIboFyt=akR{06i<-ivR!s literal 0 HcmV?d00001 diff --git a/doc/qtcreator/images/qtcreator-output-terminal.webp b/doc/qtcreator/images/qtcreator-output-terminal.webp index ac3f444cef233f3a0fe8e69324a5fd2a97637f2b..83668815694b3d32420e838fad4f4c5ca139e046 100644 GIT binary patch literal 4474 zcmWIYbaN{bWMBw)bqWXzu<%J0WMI(mcG6_H+V*H$u1x0tt&?N)&v(pVxb@cKrlhsQ z?1TiL??>!foE9zk?885AMuqo=e(ki~wmc<s%a*R!zPr6k>zr-cbhGylo<|jZJD+QE z+&lirJuW+^_{2GCu?IGvGiLh5wAZLgcX_nWm2)?rUDK9z&A9gd`+spwufzJ=T$|$i zbPs7rE}C<eGxppwo^C0IyxiNXR)w;>6Og^bb-_BXWOc11-_F<N<>$Zd*qHme;vKJg zf^_|wdoTW7tPB0)tB{sj_j<m=u78J{R3bf$XDl)BI{WZv&4bE+!8iWjFG$|oVVZs0 zZ}YZX>7#MCx8>emHF?d~N$)22_-zY*60=m@HuC)vuT?J>?V7vt_LFnDlh(GlO;YjX z%Dl%~{9iCrxB2Owf>XT;x6}6SKP~$E{efH+*CO5bj@kU;@*keoU%q<usYj)0;m*8S zz9M@caUAe|m(*d{5M}Z3cf_>Df;+4t>`Q`gGt7vxP-h5We4#Pv!3{ORtSu{7Bp6QG zaWYh|Td2A72=`r<@1AyT$&u9-R}^x!tV9J)>B}5n(fDBH?9aI(3!nU#p6Idkh1#Pn z_Q#^iI;XCx>^uMCM75Ok+o~EbEv?JXCbx(+$Vf{3o$%gq#&n69d5<#pn5G04eU;4X z@hlhA4plj0<TmHb^ljTJ9&v72!QmtJt!>Utn|YqItWGWKS$Hc@*|6}UdHepbGv^h* z*Pr_IG5)^HwMF;)ueEZ_c)DcErpHHr7kyb3w`PxM-xj&tt8-J8xVEZY^Gr!h-C`<e z(x9EBFWG;i@rg^&wz$PxnLhg*(==cFl;he3(-4{CADiu$T@N_^<Z0y2*GgsXrN{bB zmpk0wD|<u6RU_STi|h4L{psS`e3lPZ^OP(s3-Wxcnr3v~RWh~OZ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`)JplALYHOFJu)ps!gkF-S;=?*t0JO%gt}U z+y6mMfA6l;S&C`5&7{}y%jfi8kWF&id+hJ@{+Ri~O7UE0owe(7fBmXUJvYg~=kn3( zzvcZ3l5@|$-(T{YSFU<lH~%*GMIx2zFE%qZzngGZ<9z!T`SUNXvnhRJY<`~jV$z{! z53D_Wq&@gPi-p{_JI<VLUtjqBd3oF<v#4hR6Ix>C+ux8oIBAxo(_>cF?M4rOO^}(S z?tJma`S%u8AD;c5Zg<bf*-YBo{`tDhXB<6hKE^HcG}~{uWqh_PXskSxV8~URf5s#+ z?pTbE&eub)9bQb~&0rI1w(D84)>&H6`<4}lz%EaflE#HOi>^0ta&~@?IP`7B!(S6( zbj%B{%=L1QoxlIy|AMB5TXPC(e^mWH%sI)6b6cZnhU8}##;CU6>V4bp)-xuHZEo46 z(6G~x<(b%8>0Z^Ut-@0lR`+e_Y?`7nLBf6042D3?h(m|^pHF0IU$$+ArpLC84KB8U zot#f{QzsWH9bjetAm?!KevrxQN7)|CjK&hB3Uw2{Z{t&9SDetnByDy<;E3_+138Zq z=7l)iu2smtWH#%mvCAKUB1X$52eZuAKF^Ci-e&}u-DFX`H9_HUb@CN6zGs~q8N6)f zZ?J7rO*(V5h4bu#4>oZPlYP%_`dt(}MI>w01qM+y^+kcRB^lJ47IOS{R=SxYV;v|a zxlFnJ&!0Y3nKSC=XBTueh)ga#;>xkTH`QX3x^av2*+u!rX|r;_>oU3tKMUX}7j(X- z@NUBMkItLY{5FR~r~TAt*SB{}s1kd)JAKoMBh#KaO}1Sa|Lt0O$GpcInK~={XR+BY zUhtpgulfsn$N!wa{4dlu{S*E&ACFKvhfQtrsp%4@w(I<~Tk*c+*Wa}nQ}lP-*q^`U jWcUY}2rZqjU+40gyv;M+$#6wc{(-W=SIMLWo`DPiCS>WT diff --git a/doc/qtcreator/images/qtcreator-preferences-terminal.webp b/doc/qtcreator/images/qtcreator-preferences-terminal.webp index 5772f8ee94ff9b049d626d0a7ef766a8d04699b8..d3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H z+NwGZm)OG?c7<D1h4oCoY3h4Gvx9AC|L4i7&tJ|sKL6p)e~(T#zOK5Oy1n^Hdc~w? z7V~)QHnP6g|8qip+oZI;wjUhzRceg6KIis;vo$2I&w9LLm&{F_%)ZB(|9=}xPI`0R z#c`s(?%pWHpe6r&L?n-AzC7sj?LybA2dT3+#6DcAp*ZKzQ7y*ayk=I-jk7O>t^4P* z;`nr-xJkS`aa}^EGBp)^SUxm*9sOmjcx`4&OrBtkugvl#^B?7eUHxU;IP(qX;c~B? zxijW0`kL-klG0>;LezBOoKKw6k=4!ze;GH*&Sc=v5Ll7n>MO%@bxU7c*(#~ssqrzw zUvIp<`)Jk*sd>8VJYTK)=QG7$zTA3J#Lq1=KFy!<pGUqaOaA7XTZUTZqN-2-^E}k} O&hv1|C%28IJPZK#?2)Vh diff --git a/doc/qtcreator/src/user-interface/creator-only/creator-reference-terminal-view.qdoc b/doc/qtcreator/src/user-interface/creator-only/creator-reference-terminal-view.qdoc index 96cecd089dc..2be2fd8a2c3 100644 --- a/doc/qtcreator/src/user-interface/creator-only/creator-reference-terminal-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-only/creator-reference-terminal-view.qdoc @@ -52,6 +52,8 @@ \li To open terminal preferences, select \inlineimage icons/settings.png (\uicontrol Configure). + \li To keep \QC keyboard shortcuts from interfering in the terminal, + select \inlineimage icons/shortcuts.png. \endlist Most of the \QC keyboard shortcuts are disabled in the terminal, except the @@ -79,12 +81,18 @@ \row \li \uicontrol {Send escape key to terminal} \li Send the escape key to the terminal instead of closing the terminal. + \row + \li \uicontrol {Block shortcuts in terminal} + \li Keep \QC keyboard shortcuts from interfering in the terminal. \row \li \uicontrol {Audible bell} \li Play an audible bell when the a bell character is received. \row \li \uicontrol {Allow blinking cursor} \li Allow the cursor to blink. + \row + \li \uicontrol {Enable mouse tracking} + \li Enable mouse tracking in the terminal. \row \li \uicontrol {Font} \li Select the \uicontrol {Font family} and \uicontrol Size for the text @@ -96,6 +104,10 @@ \li Set colors for the \uicontrol Terminal pane \uicontrol Foreground, \uicontrol Background, \uicontrol Selection, and \uicontrol {Find match}. + + To use an existing color scheme, select \uicontrol {Load Theme}. + + To revert color changes, select \uicontrol {Reset Theme}. \row \li \uicontrol {Default shell} \li Set the full path to the default terminal executable in @@ -103,8 +115,5 @@ in \uicontrol {Shell arguments}. \endtable - To use an existing color scheme, select \uicontrol {Load Theme}. To revert - color changes, select \uicontrol {Reset Theme}. - - \sa {View output} + \sa {View output}, {Keyboard Shortcuts} */ From 141cf78b2d51ed80b828649d14a302c7303d835b Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 31 Oct 2023 12:52:37 +0100 Subject: [PATCH 1766/1777] CompilerExplorer: Fix adding text marks to ASM Change-Id: I99d5090f770ad74c0e0c0317186d436ced492280 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/compilerexplorer/compilerexplorereditor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/compilerexplorer/compilerexplorereditor.cpp b/src/plugins/compilerexplorer/compilerexplorereditor.cpp index 180878ef937..f71010744ef 100644 --- a/src/plugins/compilerexplorer/compilerexplorereditor.cpp +++ b/src/plugins/compilerexplorer/compilerexplorereditor.cpp @@ -479,6 +479,7 @@ void CompilerWidget::doCompile() auto mark = new TextMark(m_asmDocument.get(), i, TextMarkCategory{Tr::tr("Bytes"), "Bytes"}); + m_asmDocument->addMark(mark); mark->setLineAnnotation(l.opcodes.join(' ')); m_marks.append(mark); } From 76a8f81ea7b3fe163ad2072342e77db993e31be9 Mon Sep 17 00:00:00 2001 From: Alessandro Portale <alessandro.portale@qt.io> Date: Tue, 31 Oct 2023 14:48:52 +0100 Subject: [PATCH 1767/1777] Welcome: Fix initial welcome screen layout for small window The visibility of some Welcome screen elements depends on the size of the Welcome screen. When starting Qt Creator with a small initial window size, the hiding of the side bar did not work. This change removes the check for visibility as the main fix for QTCREATORBUG-29800. The QTimer::singleShot is replaced with immediate layout calculation in order to avoid another initial layout issue which is only visible during startup. Amends: 1c24ef6406d56c4e5e45741caf5ea023ae5f9f31 Fixes: QTCREATORBUG-29800 Change-Id: I4b058791f2ed2e85b9cbca932585b71a985445f9 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/welcome/welcomeplugin.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 342375c4e2f..c0a2f25ac94 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -80,8 +80,7 @@ signals: void ResizeSignallingWidget::resizeEvent(QResizeEvent *event) { - if (isVisible()) - emit resized(event->size(), event->oldSize()); + emit resized(event->size(), event->oldSize()); } class WelcomeMode : public IMode @@ -357,11 +356,9 @@ WelcomeMode::WelcomeMode() const bool hideSideArea = size.width() <= 750; const bool hideBottomArea = size.width() <= 850; const bool compactVertically = size.height() <= 530; - QTimer::singleShot(0, this, [this, hideSideArea, hideBottomArea, compactVertically] { - m_sideArea->setVisible(!hideSideArea); - m_bottomArea->setVisible(!(hideBottomArea || compactVertically)); - m_topArea->setCompact(compactVertically); - }); + m_sideArea->setVisible(!hideSideArea); + m_bottomArea->setVisible(!(hideBottomArea || compactVertically)); + m_topArea->setCompact(compactVertically); }); m_sideArea = new SideArea(m_modeWidget); From 4a220ab20acc94161d1037395277b37fd474cd0a Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 31 Oct 2023 14:36:37 +0100 Subject: [PATCH 1768/1777] CMakePM: Fix coverity PASS_BY_VALUE warnings Coverity-Id: 1569153 Performance inefficiencies (PASS_BY_VALUE) Change-Id: I03663b09ac3cbbaf3dec87dc9389c2015c16fafd Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/plugins/cmakeprojectmanager/fileapidataextractor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 2a0f0eaf678..8b44f4427f6 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -388,7 +388,7 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture // CMake users worked around Creator's inability of listing header files by creating // custom targets with all the header files. This target breaks the code model, so // keep quiet about it:-) - if (ci.defines.empty() && ci.includes.empty() && allOf(ci.sources, [t](const int sid) { + if (ci.defines.empty() && ci.includes.empty() && allOf(ci.sources, [&t](const int sid) { const SourceInfo &source = t.sources[static_cast<size_t>(sid)]; return Node::fileTypeForFileName(FilePath::fromString(source.path)) == FileType::Header; @@ -431,7 +431,7 @@ static RawProjectParts generateRawProjectParts(const QFuture<void> &cancelFuture } // Skip groups with only generated source files e.g. <build-dir>/.rcc/qrc_<target>.cpp - if (allOf(ci.sources, [t](const auto &idx) { return t.sources.at(idx).isGenerated; })) + if (allOf(ci.sources, [&t](const auto &idx) { return t.sources.at(idx).isGenerated; })) continue; // If we are not in a pch compiler group, add all the headers that are not generated From 973e9dcf9014a382d2b2ac89205edc08a6d5e18d Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 30 Oct 2023 14:54:25 +0100 Subject: [PATCH 1769/1777] CMakePM: Treat all sourceGroups as sourcesOrHeaders project nodes Previously only "Source Files" and "Header Files" were treated as sourceOrHeaders project nodes. But source_group can introduce a new source group which needs to be also treated as sourcesOrHeaders project node. Fixes: QTCREATORBUG-29799 Change-Id: I833d80155fba3fb0269aeab149ea74b0d2edd271 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/fileapidataextractor.cpp | 2 +- src/plugins/cmakeprojectmanager/projecttreehelper.cpp | 11 ++++++----- src/plugins/cmakeprojectmanager/projecttreehelper.h | 6 ++++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 8b44f4427f6..b5b692da080 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -594,7 +594,7 @@ static FolderNode *createSourceGroupNode(const QString &sourceGroupName, FolderNode *existingNode = currentNode->findChildFolderNode( [&p](const FolderNode *fn) { return fn->displayName() == p; }); if (!existingNode) { - auto node = createCMakeVFolder(sourceDirectory, Node::DefaultFolderPriority + 5, p); + auto node = createCMakeVFolder(sourceDirectory, Node::DefaultFolderPriority + 5, p, true); node->setListInProject(false); node->setIcon([] { return Icon::fromTheme("edit-copy"); }); diff --git a/src/plugins/cmakeprojectmanager/projecttreehelper.cpp b/src/plugins/cmakeprojectmanager/projecttreehelper.cpp index 7b9efb07b94..d8dcbde1322 100644 --- a/src/plugins/cmakeprojectmanager/projecttreehelper.cpp +++ b/src/plugins/cmakeprojectmanager/projecttreehelper.cpp @@ -19,13 +19,13 @@ namespace CMakeProjectManager::Internal { std::unique_ptr<FolderNode> createCMakeVFolder(const Utils::FilePath &basePath, int priority, - const QString &displayName) + const QString &displayName, + bool sourcesOrHeaders) { auto newFolder = std::make_unique<VirtualFolderNode>(basePath); newFolder->setPriority(priority); newFolder->setDisplayName(displayName); - newFolder->setIsSourcesOrHeaders(displayName == "Source Files" - || displayName == "Header Files"); + newFolder->setIsSourcesOrHeaders(sourcesOrHeaders); return newFolder; } @@ -33,13 +33,14 @@ void addCMakeVFolder(FolderNode *base, const Utils::FilePath &basePath, int priority, const QString &displayName, - std::vector<std::unique_ptr<FileNode>> &&files) + std::vector<std::unique_ptr<FileNode>> &&files, + bool sourcesOrHeaders) { if (files.size() == 0) return; FolderNode *folder = base; if (!displayName.isEmpty()) { - auto newFolder = createCMakeVFolder(basePath, priority, displayName); + auto newFolder = createCMakeVFolder(basePath, priority, displayName, sourcesOrHeaders); folder = newFolder.get(); base->addNode(std::move(newFolder)); } diff --git a/src/plugins/cmakeprojectmanager/projecttreehelper.h b/src/plugins/cmakeprojectmanager/projecttreehelper.h index 34a8723759f..aa655492d4a 100644 --- a/src/plugins/cmakeprojectmanager/projecttreehelper.h +++ b/src/plugins/cmakeprojectmanager/projecttreehelper.h @@ -11,13 +11,15 @@ namespace CMakeProjectManager::Internal { std::unique_ptr<ProjectExplorer::FolderNode> createCMakeVFolder(const Utils::FilePath &basePath, int priority, - const QString &displayName); + const QString &displayName, + bool sourcesOrHeaders); void addCMakeVFolder(ProjectExplorer::FolderNode *base, const Utils::FilePath &basePath, int priority, const QString &displayName, - std::vector<std::unique_ptr<ProjectExplorer::FileNode>> &&files); + std::vector<std::unique_ptr<ProjectExplorer::FileNode>> &&files, + bool sourcesOrHeaders = false); std::vector<std::unique_ptr<ProjectExplorer::FileNode>> &&removeKnownNodes( const QSet<Utils::FilePath> &knownFiles, From bcc45d8bb989716abd221537e800450afd600d03 Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Mon, 30 Oct 2023 16:01:52 +0100 Subject: [PATCH 1770/1777] CMakePM: Allow navigation to ${PROJECT_NAME} Task-number: QTCREATORBUG-27211 Change-Id: I23e2c6f39ff3d4c89ef78a66c10e619e3df3245f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 10 +++++----- .../cmakeprojectmanager/cmakeeditor.cpp | 19 ++++++++++++++----- .../completion/CMakeLists.txt | 5 +++-- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index b5630faf28c..b05fbbe9174 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -1310,7 +1310,7 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() // Handle project targets, unfortunately the CMake file-api doesn't deliver the // column of the target, just the line. Make sure to find it out - QHash<FilePath, int> projectTargetsSourceAndLine; + QHash<FilePath, QPair<int, QString>> projectTargetsSourceAndLine; for (const auto &target : std::as_const(buildTargets())) { if (target.targetType == TargetType::UtilityType) continue; @@ -1318,11 +1318,11 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() continue; projectTargetsSourceAndLine.insert(target.backtrace.last().path, - target.backtrace.last().line); + {target.backtrace.last().line, target.title}); } auto handleProjectTargets = [&](const CMakeFileInfo &cmakeFile, const cmListFileFunction &func) { - if (!projectTargetsSourceAndLine.contains(cmakeFile.path) - || projectTargetsSourceAndLine.value(cmakeFile.path) != func.Line()) + const auto it = projectTargetsSourceAndLine.find(cmakeFile.path); + if (it == projectTargetsSourceAndLine.end() || it->first != func.Line()) return; if (func.Arguments().size() == 0) @@ -1333,7 +1333,7 @@ void CMakeBuildSystem::setupCMakeSymbolsHash() link.targetFilePath = cmakeFile.path; link.targetLine = arg.Line; link.targetColumn = arg.Column - 1; - m_cmakeSymbolsHash.insert(QString::fromUtf8(arg.Value), link); + m_cmakeSymbolsHash.insert(it->second, link); }; // Gather the exported variables for the Find<Package> CMake packages diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index a821648f24b..85822697d2e 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -160,7 +160,7 @@ static bool isValidIdentifierChar(const QChar &chr) return chr.isLetterOrNumber() || chr == '_' || chr == '-'; } -QHash<QString, Utils::Link> getLocalSymbolsHash(const QByteArray &content, const Utils::FilePath &filePath) +QHash<QString, Utils::Link> getLocalSymbolsHash(const QByteArray &content, const Utils::FilePath &filePath, QString &projectName) { cmListFile cmakeListFile; if (!content.isEmpty()) { @@ -172,6 +172,11 @@ QHash<QString, Utils::Link> getLocalSymbolsHash(const QByteArray &content, const QHash<QString, Utils::Link> hash; for (const auto &func : cmakeListFile.Functions) { + if (func.LowerCaseName() == "project" && func.Arguments().size() > 0) { + projectName = QString::fromUtf8(func.Arguments()[0].Value); + continue; + } + if (func.LowerCaseName() != "function" && func.LowerCaseName() != "macro" && func.LowerCaseName() != "set" && func.LowerCaseName() != "option") continue; @@ -310,6 +315,14 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, const int funcStart = findFunctionStart(); const int funcEnd = findFunctionEnd(); + // Resolve local variables and functions + QString projectName; + auto hash = getLocalSymbolsHash(textDocument()->textAt(0, funcEnd + 1).toUtf8(), + textDocument()->filePath(), + projectName); + if (!projectName.isEmpty()) + buffer.replace("${PROJECT_NAME}", projectName); + if (auto project = ProjectTree::currentProject()) { buffer.replace("${CMAKE_SOURCE_DIR}", project->projectDirectory().path()); if (auto bs = ProjectTree::currentBuildSystem(); bs->buildConfiguration()) { @@ -366,10 +379,6 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, } // TODO: Resolve more variables - // Resolve local variables and functions - auto hash = getLocalSymbolsHash(textDocument()->textAt(0, funcEnd + 1).toUtf8(), - textDocument()->filePath()); - // Strip variable coating if (buffer.startsWith("${") && buffer.endsWith("}")) buffer = buffer.mid(2, buffer.size() - 3); diff --git a/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt b/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt index a3b5ddf4efb..ae03231e90d 100644 --- a/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt +++ b/tests/manual/cmakeprojectmanager/completion/CMakeLists.txt @@ -61,7 +61,7 @@ endif() # and F1 should open the help page message(STATUS $ENV{CXX}) -qt_add_executable(completion ${SOURCE_FILES}) +qt_add_executable(${PROJECT_NAME} ${SOURCE_FILES}) # here code completino on "target_link_libraries(comp|" should poupup "completion" # with a hammer icon, which suggests a project target @@ -76,7 +76,8 @@ qt_add_executable(completion ${SOURCE_FILES}) # F2 on "completion" would jump above to qt_add_executable target_link_libraries(completion PRIVATE Qt6::Widgets) -set_target_properties(completion PROPERTIES +# F2 on ${PROJECT_NAME} would jump above to qt_add_executable +set_target_properties(${PROJECT_NAME} PROPERTIES # F1 on WIN32_EXECUTABLE should open the help WIN32_EXECUTABLE ON MACOSX_BUNDLE ON From b39476dd472a71600f0c622e4f365a993bf1fd55 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Mon, 30 Oct 2023 10:52:45 +0100 Subject: [PATCH 1771/1777] Python: Avoid warning in QFutureWatcher Re-using a watcher will trigger the warning as the future had been set on the "old" watcher even though it may have finished or disconnected. Change-Id: I32d937b1d73d8bba9ec5639c62393da84638099e Reviewed-by: David Schulz <david.schulz@qt.io> --- src/plugins/python/pythonrunconfiguration.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 12141ba1a93..d8a842ef3fb 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -161,7 +161,7 @@ public: PythonInterpreterAspect *q; RunConfiguration *rc; QList<PySideUicExtraCompiler *> m_extraCompilers; - QFutureWatcher<PipPackageInfo> m_watcher; + QFutureWatcher<PipPackageInfo> *m_watcher = nullptr; QMetaObject::Connection m_watcherConnection; }; @@ -218,11 +218,13 @@ void PythonInterpreterAspectPrivate::checkForPySide(const FilePath &python, { const PipPackage package(pySidePackageName); QObject::disconnect(m_watcherConnection); - m_watcherConnection = QObject::connect(&m_watcher, &QFutureWatcherBase::finished, q, [=] { - handlePySidePackageInfo(m_watcher.result(), python, pySidePackageName); + delete m_watcher; + m_watcher = new QFutureWatcher<PipPackageInfo>(this); + m_watcherConnection = QObject::connect(m_watcher, &QFutureWatcherBase::finished, q, [=] { + handlePySidePackageInfo(m_watcher->result(), python, pySidePackageName); }); const auto future = Pip::instance(python)->info(package); - m_watcher.setFuture(future); + m_watcher->setFuture(future); ExtensionSystem::PluginManager::futureSynchronizer()->addFuture(future); } From 145a0c75386fb58cb9e8b4f2940254b94fd83526 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 31 Oct 2023 15:40:45 +0100 Subject: [PATCH 1772/1777] ScreenRecorder: Add additional search paths Adds a function FileUtils::usefullExtraSearchPaths() that returns OS specific paths that often are not in PATH by default, but contain useful apps we want to find. Change-Id: Ideb7c45b241c69c9f2db8f75726bb63249000a5f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> --- src/libs/utils/fileutils.cpp | 15 +++++++++++++++ src/libs/utils/fileutils.h | 3 +++ .../screenrecorder/screenrecordersettings.cpp | 10 ++++++---- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index fdae7c6b8d8..3d8f074962e 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -6,6 +6,7 @@ #include "algorithm.h" #include "devicefileaccess.h" +#include "environment.h" #include "qtcassert.h" #include "utilstr.h" @@ -843,4 +844,18 @@ qint64 FileUtils::bytesAvailableFromDFOutput(const QByteArray &dfOutput) return -1; } +FilePaths FileUtils::usefulExtraSearchPaths() +{ + if (HostOsInfo::isMacHost()) { + return {"/opt/homebrew/bin"}; + } else if (HostOsInfo::isWindowsHost()) { + const QString programData = + qtcEnvironmentVariable("ProgramData", + qtcEnvironmentVariable("ALLUSERSPROFILE", "C:/ProgramData")); + return {FilePath::fromUserInput(programData) / "chocolatey/bin"}; + } + + return {}; +} + } // namespace Utils diff --git a/src/libs/utils/fileutils.h b/src/libs/utils/fileutils.h index a1a7ffef977..316030b0397 100644 --- a/src/libs/utils/fileutils.h +++ b/src/libs/utils/fileutils.h @@ -85,6 +85,9 @@ public: static FilePathInfo filePathInfoFromTriple(const QString &infos, int modeBase); + //! Returns known paths like /opt/homebrew on macOS that might not be in PATH + static FilePaths usefulExtraSearchPaths(); + #ifdef QT_WIDGETS_LIB static void setDialogParentGetter(const std::function<QWidget *()> &getter); diff --git a/src/plugins/screenrecorder/screenrecordersettings.cpp b/src/plugins/screenrecorder/screenrecordersettings.cpp index 2d492af2509..cc00f6da065 100644 --- a/src/plugins/screenrecorder/screenrecordersettings.cpp +++ b/src/plugins/screenrecorder/screenrecordersettings.cpp @@ -54,16 +54,18 @@ ScreenRecorderSettings::ScreenRecorderSettings() ffmpegTool.setSettingsKey("FFmpegTool"); ffmpegTool.setExpectedKind(PathChooser::ExistingCommand); ffmpegTool.setCommandVersionArguments(versionArgs); - const FilePath ffmpegDefault = - Environment::systemEnvironment().searchInPath(Constants::FFMPEG_COMMAND); + const FilePath ffmpegDefault + = Environment::systemEnvironment().searchInPath(Constants::FFMPEG_COMMAND, + FileUtils::usefulExtraSearchPaths()); ffmpegTool.setDefaultValue(ffmpegDefault.toUserOutput()); ffmpegTool.setLabelText(Tr::tr("ffmpeg tool:")); ffprobeTool.setSettingsKey("FFprobeTool"); ffprobeTool.setExpectedKind(PathChooser::ExistingCommand); ffprobeTool.setCommandVersionArguments(versionArgs); - const FilePath ffprobeDefault = - Environment::systemEnvironment().searchInPath(Constants::FFPROBE_COMMAND); + const FilePath ffprobeDefault + = Environment::systemEnvironment().searchInPath(Constants::FFPROBE_COMMAND, + FileUtils::usefulExtraSearchPaths()); ffprobeTool.setDefaultValue(ffprobeDefault.toUserOutput()); ffprobeTool.setLabelText(Tr::tr("ffprobe tool:")); From 165db819c09179cc8a48ac970ba83db18dba6072 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns <marcus.tillmanns@qt.io> Date: Tue, 31 Oct 2023 13:51:41 +0100 Subject: [PATCH 1773/1777] Core: Fix analyzer warnings Change-Id: I37be348b954f5fd1ba3942fb976b23aa3d7ed869 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/coreplugin/loggingviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/loggingviewer.cpp b/src/plugins/coreplugin/loggingviewer.cpp index 57a1f42282b..5e83c76df3e 100644 --- a/src/plugins/coreplugin/loggingviewer.cpp +++ b/src/plugins/coreplugin/loggingviewer.cpp @@ -120,7 +120,7 @@ struct SavedEntry { QColor color; QString name; - QtMsgType level; + QtMsgType level{QtFatalMsg}; std::optional<std::array<bool, 5>> levels; static Utils::expected_str<SavedEntry> fromJson(const QJsonObject &obj) @@ -990,7 +990,7 @@ void LoggingCategoryModel::saveEnabledCategoryPreset() const QJsonArray array; - for (auto item : m_categories) { + for (const auto &item : m_categories) { QJsonObject itemObj; itemObj.insert("name", item.name()); QJsonObject entryObj; From 62198d1a4de99e9a3d3bd430b19cb8ab4b6d16fc Mon Sep 17 00:00:00 2001 From: Cristian Adam <cristian.adam@qt.io> Date: Tue, 31 Oct 2023 19:28:46 +0100 Subject: [PATCH 1774/1777] Autotest: Enable ANSI colors for ctest Qt Creator can interpret ANSI color and we make sure that ctest will print colored output. Change-Id: I723917b8ca604d6a51fc7c46a6a9918bd421594e Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> --- src/plugins/autotest/ctest/ctesttreeitem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/autotest/ctest/ctesttreeitem.cpp b/src/plugins/autotest/ctest/ctesttreeitem.cpp index 60f1081e77a..ad744bb5c87 100644 --- a/src/plugins/autotest/ctest/ctesttreeitem.cpp +++ b/src/plugins/autotest/ctest/ctesttreeitem.cpp @@ -106,6 +106,7 @@ QList<ITestConfiguration *> CTestTreeItem::testConfigurationsFor(const QStringLi env.set("QT_FORCE_STDERR_LOGGING", "1"); env.set("QT_LOGGING_TO_CONSOLE", "1"); } + env.setFallback("CLICOLOR_FORCE", "1"); config->setEnvironment(env); const ProjectExplorer::BuildConfiguration *buildConfig = target->activeBuildConfiguration(); if (QTC_GUARD(buildConfig)) From 372d19f9f4644218d328d69096f211c99e4b45e7 Mon Sep 17 00:00:00 2001 From: Leena Miettinen <riitta-leena.miettinen@qt.io> Date: Tue, 31 Oct 2023 15:16:34 +0100 Subject: [PATCH 1775/1777] Doc: Describe CMake changes - Divide the "Setting Up CMake" into several how-to topics. - Rename it as "CMake" and link to all the new topics. - Update related topics accordingly. Task-number: QTCREATORBUG-29361 Task-number: QTCREATORBUG-29392 Change-Id: Ib8f4a1951b5ffd7eaa25a4e5cf40e7bb252f9cf4 Reviewed-by: Cristian Adam <cristian.adam@qt.io> --- dist/changelog/changes-12.0.0.md | 2 + ...qtcreator-preferences-cmake-formatter.webp | Bin 4310 -> 4120 bytes .../creator-how-to-debug-cmake-files.qdoc | 3 +- .../src/cmake/creator-projects-cmake.qdoc | 304 ++++++++++++++---- .../external-resources.qdoc | 28 ++ .../src/howto/creator-keyboard-shortcuts.qdoc | 3 +- .../howto/creator-only/creator-how-tos.qdoc | 10 +- .../creator-how-to-select-build-systems.qdoc | 2 +- .../creator-projects-building.qdoc | 2 +- .../creator-projects-creating.qdoc | 2 +- .../creator-only/creator-projects-kits.qdoc | 7 +- .../creator-projects-libraries.qdoc | 44 +-- doc/qtcreator/src/qtcreator-toc.qdoc | 6 +- doc/qtcreator/src/qtcreator.qdoc | 2 +- .../creator-only/qtquick-creating.qdoc | 2 +- .../creator-file-system-view.qdoc | 2 + .../user-interface/creator-projects-view.qdoc | 4 +- .../src/widgets/qtdesigner-app-tutorial.qdoc | 2 +- 18 files changed, 319 insertions(+), 106 deletions(-) diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 98c65bc68a3..6e96ada76bb 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -242,6 +242,8 @@ Projects ([QTCREATORBUG-29643](https://bugreports.qt.io/browse/QTCREATORBUG-29643)) * Fixed unnecessary restrictions on the preset name +([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-project-cmake.html)) + ### Python * Added auto-detection of PySide from the installer diff --git a/doc/qtcreator/images/qtcreator-preferences-cmake-formatter.webp b/doc/qtcreator/images/qtcreator-preferences-cmake-formatter.webp index a61b2d727016d39a41cd612589ede466bb7c36ce..03ff71ace4f3dcbe0e247df3e879e818a766bdb2 100644 GIT binary patch literal 4120 zcmWIYbaN9BU|<M$bqWXzu<&6PU|`Tc>Zr}|HKOGI{nFddVt0MNSIvK0Qe>{Jjg*(% zP3uXa_Kl31cW+L9cQ5jh_nh!cmjD0%pJS~Pn`XJ`O2w6gb_HX`&CkES4RD<Dq4aEr z*8+(Y7Pqt|o4l7Y^KaNvoRAh!Vk@AzZQIMvFM3L@-+jaku9PQfd-pgu9(s7I_t3`1 zDUary3EvU+CoE*K+tZ0jxz%^w?nj$&OK2X5JMbes-{Yo3#EqN-Iyn&&BX7L%WtROr zQ~LE)BdN`ff0wg*PP!1b%JOxR;ic7rr<*pmef@5I@KuHMuLFxBFQ`0gv`zZ|;P=C| zlU_e~l>2DyhpG)mm-6GkOml56PE@<0`cC4^lgrPRzm=)DzeqXJEJD)xz36(!-|0=Y zN%d7FC;n`?&(_ztFgejGLh^O{CH`9-?3bNipY{K}_JKr&T3)VAvhlo)3U80By_C_U za6|pwp43i-V_h?rl<tmQ%=m22yBpp<mt<F0{^Dx(dEV!Hdd@n@hN))y>!Ng3(hi*y zSvNCprb?1$`NZXKdQNP-eo4MR-Z-=B_@*AG_`(#Q^y`L4KkxF6X?c2P^|3TV&+Tr{ zg%VlS_}#R(n<a)Xcd9lt*wfx^=-GbuXn_2-+^yHDTcsznD?6=y;Ba!|bsN_`CYNnY zEq1zC+f5M?x-RhDXYIvbv+~3wV(v)UcC39D^NHPTd#+>7R~GS37JjoWyFRM2zt=r* zPF3#1r)FU%UukB!D7FjQoXa*xum0NbcwzI;lRqZam(R+4DSrFyo|k!^<&r6r=XK=Y zHf~kjwpcgo&|&!-Z&>#o-|i+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n*-f6j_;8pGY%{buLa@;wP(cv5P5eQW9D;Yv01R6Q(z>es|)m z%M0OVknOCc1sS4Vkw4`WS`Bx6bmvLr{{Oq*D4<KoUP<x7m)@Y3Fqf(X(M^dm9`mm( z-?q5_^^Ro~2`6Mjxi0U2!m&6c=%m5l>{A;~emEE#DF3IOZT64z$4nk>|6ly_pNUzB GF9QH%Jtu(x diff --git a/doc/qtcreator/src/cmake/creator-how-to-debug-cmake-files.qdoc b/doc/qtcreator/src/cmake/creator-how-to-debug-cmake-files.qdoc index 3631b24cec1..ac3ffb12a90 100644 --- a/doc/qtcreator/src/cmake/creator-how-to-debug-cmake-files.qdoc +++ b/doc/qtcreator/src/cmake/creator-how-to-debug-cmake-files.qdoc @@ -6,6 +6,7 @@ \previouspage creator-how-tos.html \ingroup creator-how-to-debug + \ingroup creator-how-to-build-with-cmake \title Debug CMake project files @@ -28,5 +29,5 @@ \uicontrol Debug mode views. \sa {Debugging},{Examining Data},{Debug Mode Views},{Setting Breakpoints}, - {Setting Up CMake} + {CMake} */ diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc index 999d58c67bc..3d2babbc53c 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc @@ -13,43 +13,84 @@ \ingroup creator-reference-build-systems - \title Setting Up CMake + \title CMake \brief CMake is an alternative to qmake for automating the generation of build systems. - CMake automates the configuration of build systems. It controls the software - compilation process by using simple + \l{https://cmake.org/}{CMake} automates the configuration of build systems. + It controls the software compilation process by using simple configuration files, called \c {CMakeLists.txt} files. CMake generates native build configurations and workspaces that you can use in the compiler environment of your choice. You can use CMake from \QC to build applications for the desktop, as well - as mobile and embedded devices. You can also build single files to test - your changes. + as mobile and embedded devices. Or, build single files to test your changes. - \QC automatically detects the CMake executable specified in the \c PATH. - You can add paths to other CMake executables and use them in different - build and run \l{glossary-buildandrun-kit}{kits}. + \section1 Supported CMake Versions - CMake documentation is installed in Qt help file format (.qch) when you - install CMake. It is automatically registered by \QC, and you can view it - in the Help mode. + \QC requires CMake's \l{https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html} + {file-based API}, and therefore you'll need CMake version 3.14, or later. - \QC automatically runs CMake to refresh project information when you edit - a \c CMakeLists.txt configuration file in a project. Project information is - also automatically refreshed when you build the project. To disable this - behavior, select \preferences > \uicontrol CMake > \uicontrol General, and - then deselect the \uicontrol {Autorun CMake} check box. + For systems with older versions of CMake, only workarounds are available: + + \list + \li For CMake version 3.5 or later, generate a + \l{CMake: CMAKE_EXPORT_COMPILE_COMMANDS}{compilation database} and + open that in \QC, as described in \l{Using Compilation Databases}. + \li Create an ad-hoc project file for a qmake build using + \c{qmake -project} and \l{Open projects}{open} that in \QC. + Typically, you cannot compile such projects without manual changes. + \li Manually create an ad-hoc project file for a + \l{Setting Up a Generic Project}{generic project} and + open that in \QC. + Typically, you cannot compile such projects without manual changes. + \endlist + + \sa {Build with CMake}{How To: Build with CMake}, {Open projects}, + {CMake Build Configuration}, {Debug CMake project files}, + {Specifying Build Settings}, {Specifying Run Settings}, + {Deploying to Remote Linux} +*/ + +/*! + \page creator-how-to-view-cmake-project-contents.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-build-with-cmake + + \title View CMake project contents + + The \l Projects view visualizes the build system structure of the project as + a tree and lists all files that are part of the project. + \QC automatically runs CMake to refresh project information in the + view when you edit a \c CMakeLists.txt configuration file + in a project. Project information is also automatically refreshed when + you build the project. \image qtcreator-projects-view-edit.png {CMake project in Projects view} - If \QC cannot load the CMake project, the \l Projects view shows a + To disable this + behavior, select \preferences > \uicontrol CMake > \uicontrol General, and + then deselect the \uicontrol {Autorun CMake} check box. + + \image qtcreator-preferences-cmake-general.webp {General tab in CMake Preferences} + + \section1 Re-configure CMake projects + + If \QC cannot load the CMake project, the \uicontrol Projects view shows a \uicontrol {<File System>} project node to avoid scanning the file system and load the project faster. The node shows the same files - as the \l {File System} view. Select \uicontrol Build > - \uicontrol {Clear CMake Configuration}, and then select \uicontrol Build - > \uicontrol {Run CMake} to reconfigure the project. + as the \l {File System} view. + + To re-configure the project: + + \list 1 + \li Select \uicontrol Build > \uicontrol {Clear CMake Configuration}. + \li Select \uicontrol Build > \uicontrol {Run CMake}. + \endlist + + \section1 Hide subfolder names in Projects view The \uicontrol Projects view shows the names of the subfolders where the source files are located. To hide the subfolder names and arrange the files @@ -59,32 +100,47 @@ box. The change takes effect after you select \uicontrol Build > \uicontrol {Run CMake}. - \section1 Adding CMake Tools + \sa {CMake}, {Manage files in CMake projects}, {Open projects}, + {File System}, {Projects} +*/ - \QC requires CMake's \l{https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html} - {file-based API}, and therefore you'll need CMake version 3.14, or later. +/*! + \page creator-how-to-read-cmake-documentation.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-build-with-cmake + \ingroup creator-how-to-get-help + + \title Read CMake documentation + + CMake documentation is installed in Qt help file format (.qch) when you + install CMake. It is automatically registered by \QC, and you can view it by: - For systems with older versions of CMake, only workarounds are available: \list - - \li For CMake version 3.5 or later it is possible to generate a - \l{https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html}{compilation database} - and open that in \QC, as described in \l{Using Compilation Databases}. - - \li Create an ad-hoc project file for a qmake build using - \c{qmake -project} and \l{Open projects}{open} that in \QC. - Be aware that this is typically - not compilable without further manual changes. - - \li Manually create an ad-hoc project file for a - \l{Setting Up a Generic Project}{generic project} and - open that in \QC. Be aware this is typically - not compilable without further manual changes. - + \li Hovering the mouse over a function, variable, property, policy, + environment variable, or CMake find or include module to show + tooltips + \li Selecting any of the above elements and pressing \key F1 to show + its documentation + \li Switching to the Help mode \endlist + \sa {CMake}, {Read Documentation}{How To: Read Documentation} +*/ - To view and specify settings for CMake: +/*! + \page creator-how-to-add-cmake-tools.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-build-with-cmake + + \title Add CMake tools + + \QC automatically detects the CMake executable that you specify in the + \c PATH. You can add paths to other CMake executables and use them in + different build and run \l{glossary-buildandrun-kit}{kits}. + + To see the CMake installations that \QC automatically detects: \list 1 @@ -101,20 +157,24 @@ \li The \uicontrol {Help file} field displays the path to the CMake help file (.qch) that comes with CMake. - \li Select \uicontrol Apply to save your changes. - \endlist + \section2 Add or remove CMake tools + To add a path to a CMake executable that \QC does not detect automatically, and to specify settings for it, select \uicontrol Add. To make changes to automatically detected installations, select \uicontrol Clone. + To remove the selected CMake executable from the list, select + \uicontrol Remove. + + \section2 Set the default CMake tool + \QC uses the \e {default CMake} if it does not have enough information to choose the CMake to use. To set the selected CMake executable as the default, select \uicontrol {Make Default}. - To remove the selected CMake executable from the list, select - \uicontrol Remove. + \section2 Add CMake tools to kits To add the CMake tool to a build and run kit, select \preferences > \uicontrol Kits. @@ -123,9 +183,16 @@ \image qtcreator-kits-cmake.png {Kits preferences} - For more information, see \l {Add kits} and \l {Kits}. + \sa {CMake}, {Add kits}, {Kits} +*/ - \section1 Editing CMake Configuration Files +/*! + \page creator-how-to-edit-cmake-config-files.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-build-with-cmake + + \title Edit CMake configuration files To open a CMakeLists.txt file for editing, right-click it in the \uicontrol Projects view and select \uicontrol {Open With} > @@ -140,11 +207,22 @@ \list - \li Pressing \key F2 when the cursor is on a filename to open the file + \li Pressing \key F2 when the cursor is on a: + \list + \li Filename - to open the file + \li CMake function, macro, option, target, CMake's Find or + Include module, local variable created by \c set or \c list, + or package - to go to that item + \endlist \li Keyword completion - \li Code completion + \li Code completion for local functions and variables, cache variables, + \c ENV, targets, packages, and variables that \c find_package adds + + \li Pre-defined code snippets for setting CMake print properties and + variables, as well as creating Qt console and GUI applications and + sample Find modules \li Path completion @@ -156,13 +234,48 @@ Warnings and errors are displayed in \l {Issues}. - \section1 Formatting CMake Files + \sa {CMake}, {Add libraries to CMake projects}, {Complete CMake code}, + {Completing Code Snippets}, {Format CMake files} +*/ - You can use the \c {cmake-format} tool to format any text in CMake files that +/*! + \page creator-how-to-complete-cmake-code.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-build-with-cmake + + \title Complete CMake code + + \QC uses \l{Generic Highlighting}{generic highlighting} to provide + code completion specific arguments for the CMake commands. For + example, only source file properties are suggested for the + \l {CMake: set_source_files_properties command}, not the test or + target properties. + + The following CMake-specific trigger tokens are supported: + + \list + \li \c{$} for variables + \li \c{$<} for generator expressions + \li \c{$ENV} for environment variables + \endlist + + \sa {CMake}, {Completing Code}, {Completing Code Snippets}, + {Edit CMake configuration files} +*/ + +/*! + \page creator-how-to-format-cmake-files.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-build-with-cmake + + \title Format CMake files + + You can use the \l {cmake-format} tool and local \c .cmake-format, \c.py, or + \c .json configuration files to format any text in CMake files that you do not guard with a pair of fences. You must install the tool and tell - \QC where you installed it. For more information about the tool and how to - install it, see \l{https://cmake-format.readthedocs.io/en/latest/index.html} - {cmake language tools}. + \QC where you installed it. To automatically format CMake files upon file save: @@ -171,7 +284,7 @@ \image qtcreator-preferences-cmake-formatter.webp {Formatter tab in CMake Preferences} \li In \uicontrol {CMakeFormat command}, enter the path to \c {cmake-format.exe}. - \li Select \uicontrol {Enable auto format on file save} to automatically + \li Select \uicontrol {Automatic formatting on file save} to automatically format CMake files when you save them. \li In \uicontrol {Restrict to MIME types}, add the \l{Editing MIME Types} {MIME types} of the files to format, separated by semicolons. The @@ -182,37 +295,86 @@ current project. \endlist - \section1 Managing Files + \sa {CMake},{Complete CMake code}, {Edit CMake configuration files}, + {Editing MIME Types} +*/ + +/*! + \page creator-how-to-manage-files-in-cmake-projects.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-build-with-cmake + + \title Manage files in CMake projects When you use project wizard templates to \l{Create files}{add files} to - a project, \QC automatically adds them to the \c {qt_add_executable()}, - \c {add_executable()}, or \c {qt_add_library()} function in the - CMakeLists.txt file. + a project, \QC automatically adds them to the \l {qt_add_executable}, + \l{CMake: add_executable command}{add_executable}, or \l {qt_add_library} + function in the CMakeLists.txt file. - If you use custom API, \QC uses \c {target_sources()} to add the files. + If you use custom API, \QC uses the \l{CMake: target_sources command} + {target_sources} function to add the files. - For Qt Quick projects, the files are added to the \c {qt_add_qml_module()} + For Qt Quick projects, the files are added to the \l {qt_add_qml_module} function, prefixed with the \c QML_FILES, \c SOURCES, or \c RESOURCES function argument. When you rename or remove files in the \l {Projects} or \l {File System} view, \QC renames them in the CMakeLists.txt file or removes them from it. - \section1 Adding External Libraries to CMake Projects + \sa {CMake}, {Add libraries to CMake projects}, {Create files}, + {Edit CMake configuration files}, {View CMake project contents}, + {File System}, {Projects} +*/ + +/*! + \page creator-how-to-add-external-libraries-to-cmake-projects.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects + \ingroup creator-how-to-build-with-cmake + + \title Add libraries to CMake projects + + \include creator-projects-libraries.qdoc libraries + + \section1 Add your own libraries + + Use the \l qt_add_library command to create a library and link against it in + the CMakeLists.txt file, as instructed in \l{Structuring projects}. + + Specify whether the library is statically or dynamically linked. + For a statically linked internal library, add the + \l{CMake: target_link_libraries command} to the CMakeLists.txt + project file to specify dependencies. + + \section1 Add external libraries Through external libraries, \QC can support code completion and syntax - highlighting as if they were part of the current project or the Qt library. + highlighting as if the code were a part of the current project or the + Qt library. - \QC detects the external libraries using the \c {find_package()} - macro. Some libraries come with the CMake installation. You can find those + \QC detects the external libraries using the \l{CMake: find_package command} + command. Some libraries come with the CMake installation. You can find those in the \c {Modules} directory of your CMake installation. - For more information, see - \l{https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html} - {cmake-packages(7)}. + For more information, see \l{CMake: cmake-packages(7)}. - Syntax completion and highlighting work once your project successfully - builds and links against the external library. + \section1 Use local CMake Find packages - \sa {Open projects}, {CMake Build Configuration}, {Debug CMake project files}, - {Specifying Run Settings}, {Deploying to Remote Linux} + For CMake projects that have external dependencies, use + \l{CMake: Find Modules}{Find<package>.cmake} modules that + expose imported targets. You can use the pre-defined \c sample_find_module + \l{Completing Code Snippets}{code snippet} to add sample commands + to a \c .cmake file. You can then change the commands as necessary. + + Place Find modules in the \c ${CMAKE_CURRENT_SOURCE_DIR}/cmake directory, and + append the directory name to the CMAKE_MODULE_PATH list variable. + For example: + + \code + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + \endcode + + \sa {CMake}, {Edit CMake configuration files}, {Complete CMake code}, + {Completing Code Snippets} */ diff --git a/doc/qtcreator/src/external-resources/external-resources.qdoc b/doc/qtcreator/src/external-resources/external-resources.qdoc index 5d21be4257c..e3295245df2 100644 --- a/doc/qtcreator/src/external-resources/external-resources.qdoc +++ b/doc/qtcreator/src/external-resources/external-resources.qdoc @@ -101,6 +101,18 @@ \externalpage https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html \title CMake: cmake-variables(7) */ +/*! + \externalpage https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html + \title CMake: cmake-packages(7) +*/ +/*! + \externalpage https://cmake.org/cmake/help/latest/command/add_executable.html + \title CMake: add_executable command +*/ +/*! + \externalpage https://cmake.org/cmake/help/latest/command/find_package.html + \title CMake: find_package command +*/ /*! \externalpage https://cmake.org/cmake/help/latest/command/install.html \title CMake: install command @@ -109,6 +121,10 @@ \externalpage https://cmake.org/cmake/help/latest/command/set_property.html \title CMake: set_property command */ +/*! + \externalpage https://cmake.org/cmake/help/latest/command/set_source_files_properties.html + \title CMake: set_source_files_properties command +*/ /*! \externalpage https://cmake.org/cmake/help/latest/command/target_compile_definitions.html \title CMake: target_compile_definitions command @@ -121,6 +137,10 @@ \externalpage https://cmake.org/cmake/help/latest/command/target_sources.html \title CMake: target_sources command */ +/*! + \externalpage https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#find-modules + \title CMake: Find Modules +*/ /*! \externalpage https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html \title CMake: CMAKE_OSX_DEPLOYMENT_TARGET @@ -129,6 +149,14 @@ \externalpage https://cmake.org/cmake/help/latest/prop_sf/HEADER_FILE_ONLY.html \title CMake: HEADER_FILE_ONLY */ +/*! + \externalpage https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html + \title CMake: CMAKE_EXPORT_COMPILE_COMMANDS +*/ +/*! + \externalpage https://cmake-format.readthedocs.io/en/latest/cmake-format.html + \title cmake-format +*/ /*! \externalpage https://microsoft.github.io/language-server-protocol/ \title Language Server Protocol diff --git a/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc b/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc index fa45ee66a28..bbc5942cae4 100644 --- a/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc +++ b/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc @@ -371,7 +371,8 @@ \li Follow symbol under cursor Works with namespaces, classes, functions, variables, include - statements, and macros. Also, opens URLs in the default browser + statements, and macros, as well as CMake functions, macros, + targets, and packages. Also, opens URLs in the default browser \if defined(qtcreator) and Qt resource files (.qrc) in the \l{Resource Files} {resource editor} diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index a63eb2959ed..dfcba68e12b 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -20,6 +20,14 @@ \generatelist creator-how-to-build + \section2 Build with CMake + + \generatelist creator-how-to-build-with-cmake + + \section2 Build with qmake + + \generatelist creator-how-to-build-with-qmake + \section1 Debug \generatelist creator-how-to-debug @@ -52,7 +60,7 @@ \generatelist creator-how-to-projects-configure - \section1 Read Qt Documentation + \section1 Read Documentation \generatelist creator-how-to-get-help diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc index 480ae3db940..38d0cb73d72 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-select-build-systems.qdoc @@ -16,7 +16,7 @@ \li \l {Build with CMake}{CMake} is a cross-platform system for build automation that helps simplify the build process for development projects across different platforms. It automates the generation of - build configurations. For more information, see \l {Setting Up CMake}. + build configurations. For more information, see \l {CMake}. \li \l{qmake Manual}{qmake} is an alternative to CMake for automating the generation of build configurations. Qt installers install and configure qmake. To use one of the other supported build systems, diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-building.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-building.qdoc index b9c95f32239..6a5c085fd47 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-building.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-building.qdoc @@ -104,7 +104,7 @@ \image qtcreator-preferences-cmake-tools.webp "Tools tab in CMake Preferences" - For more information, see \l {Setting Up CMake}. + For more information, see \l {CMake}. \section1 Building with qmake diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index 7d74e00410f..c94870b6db1 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -316,5 +316,5 @@ To specify dependencies, use the \uicontrol{Add Library} wizard. \sa {Creating Projects}, {Use project wizards}, - {Add libraries to projects} + {Add libraries to qmake projects}, {Add libraries to CMake projects} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc index b6967cfcc6b..3e1f9fcd62e 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-kits.qdoc @@ -188,7 +188,7 @@ \li \uicontrol {CMake Tool} \li CMake executable to use for building the project. Select \uicontrol Manage to add installed CMake executables to - the list. For more information, see \l{Adding CMake Tools}. + the list. For more information, see \l{Add CMake Tools}. \row \li \uicontrol {CMake generator} \li Select \uicontrol Change to edit the CMake Generator to use for @@ -212,6 +212,7 @@ \uicontrol Manage to add installed Ninja tools to the list. \endtable - \sa {Activate kits for a project}, {Open projects}, {Add compilers}, - {Add debuggers}, {Add kits}, {Add Qt versions}, {Edit Qbs profiles} + \sa {Activate kits for a project}, {Open projects}, {Add CMake Tools}, + {Add compilers}, {Add debuggers}, {Add kits}, {Add Qt versions}, + {Edit Qbs profiles} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc index 51edcf39b77..9d03ea4e892 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc @@ -12,9 +12,11 @@ \previouspage creator-how-tos.html \ingroup creator-how-to-projects-create + \ingroup creator-how-to-build-with-qmake - \title Add libraries to projects + \title Add libraries to qmake projects + //! [libraries} In addition to Qt libraries, you can add other libraries to your projects. The process depends on the type and location of the library: @@ -24,17 +26,13 @@ \li A 3rd party library \endlist + \QC supports code completion and syntax highlighting for the added + libraries once your project successfully builds and links to them. + //! [libraries} + The library can be located either in the build tree of the current project or in another build tree. - \section1 CMake projects - - If you use CMake to build the project, use the \l qt_add_library command to - create a library and link against it in the CMakeLists.txt file, as - instructed in \l{Structuring projects}. - - \section1 qmake projects - To add libraries to projects that you build with qmake: \list 1 @@ -46,7 +44,7 @@ The settings depend on the library type. \endlist - \section1 Library settings + \section1 Library location Because system libraries do not typically change and are often found by default, you do not need to specify the path to the library or to its @@ -58,13 +56,18 @@ but you need to check it and modify it if necessary. \QC automatically adds the include path for an internal library. + \section1 Target platform + For all libraries, select the target platforms for the application, library, or plugin. + \section1 Linking + Specify whether the library is statically or dynamically linked. For a - statically linked internal library, \QC adds dependencies - (\l{CMake: target_link_libraries command}{target_link_libraries} when using - CMake or \l PRE_TARGETDEPS when using qmake) in the project file. + statically linked internal library, \QC adds dependencies as the value of + the \l PRE_TARGETDEPS qmake variable in the project file (.pro). + + \section1 Development platform Depending on the development platform, \QC might detect some options automatically. For example, on \macos, it detects the library type @@ -85,14 +88,12 @@ If the library name ends in \e d, deselect the \uicontrol {Remove "d" suffix for release version} option. - \QC supports code completion and syntax highlighting for the added - libraries once your project successfully builds and links to them. - For more information about the project file settings, see - \l{Declaring Other Libraries}. + \l{Declaring Other Libraries}{qmake Manual: Declaring Other Libraries}. - \sa {Adding an Internal Library to a qmake Project}, - {Add subprojects to projects}, {Use project wizards}, {Creating Projects} + \sa {Adding an Internal Library to a qmake Project}{Tutorial: Adding an Internal Library to a qmake Project}, + {Add subprojects to projects}, {Add libraries to CMake projects}, + {Use project wizards}, {Creating Projects} */ /*! @@ -198,6 +199,7 @@ else:unix: PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/libmylib.a \endcode - \sa {Add libraries to projects}, {Add subprojects to projects}, - {Select the build system}, {Use project wizards}, {Creating Projects} + \sa {Add libraries to qmake projects}, {Add libraries to CMake projects}, + {Add subprojects to projects}, {Select the build system}, + {Use project wizards}, {Creating Projects} */ diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index e82802be2a2..fce5024189b 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -180,6 +180,10 @@ \list \li Build and Run \generatelist creator-how-to-build + \li Build with CMake + \generatelist creator-how-to-build-with-cmake + \li Build with qmake + \generatelist creator-how-to-build-with-qmake \li Debug \generatelist creator-how-to-debug \li Design UIs @@ -198,7 +202,7 @@ \li Configure Projects \generatelist creator-how-to-projects-configure \endlist - \li Read Qt Documentation + \li Read Documentation \generatelist creator-how-to-get-help \li Use \QC \generatelist creator-how-to-use diff --git a/doc/qtcreator/src/qtcreator.qdoc b/doc/qtcreator/src/qtcreator.qdoc index 72d421c678c..fc48d434c86 100644 --- a/doc/qtcreator/src/qtcreator.qdoc +++ b/doc/qtcreator/src/qtcreator.qdoc @@ -97,7 +97,7 @@ \li \l{Edit Code} \li \l{Manage Projects} \li \l{Build and Run} - \li \l{Read Qt Documentation} + \li \l{Read Documentation} \li \l{Use \QC} \li \l{Use the UI} \endlist diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc b/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc index 09efdaec1a2..42e3b987c2c 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc @@ -67,7 +67,7 @@ \QDS, select \uicontrol {Create a project that you can open in \QDS}. \li In the \uicontrol {Build system} field, select the build system to - use for building and running the project: \l {Setting Up CMake} + use for building and running the project: \l {CMake} {CMake} or \l {Setting Up Qbs}{Qbs}. \li Select \uicontrol Next to open the diff --git a/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc b/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc index b76e90ec8ea..2b4ddbdb942 100644 --- a/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc @@ -110,5 +110,7 @@ To stop the synchronization with the file currently open in the editor, deselect \inlineimage icons/linkicon.png (\uicontrol {Synchronize with Editor}). + + \sa {View CMake project contents}, {Projects} \endif */ diff --git a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc index 27984807fd0..4c1e9e9c54d 100644 --- a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc @@ -85,7 +85,7 @@ {generic projects}. \li Add existing files and directories. \li Add libraries. For more information, see - \l{Add libraries to projects}. + \l{Add libraries to qmake projects}. \li Add and remove subprojects. \li Find unused functions. \endif @@ -151,5 +151,7 @@ from the version control system in brackets after the project name. \QC currently implements this for Git (the view displays the branch name or a tag) and ClearCase (the view displays the branch name). + + \sa {View CMake project contents}, {File System} \endif */ diff --git a/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc b/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc index 5d2164693e9..1bcfb832d7f 100644 --- a/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc +++ b/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc @@ -44,7 +44,7 @@ \image qtcreator-new-project-build-system-qt-gui.png {Define Build System dialog} - \li In the \uicontrol {Build system} field, select \l {Setting Up CMake} + \li In the \uicontrol {Build system} field, select \l {CMake} {CMake} as the build system to use for building the project. \li Select \uicontrol Next or \uicontrol Continue to open the From 7f1eaff3982ec2436c2b6a952a2aebd9d952eb1f Mon Sep 17 00:00:00 2001 From: David Schulz <david.schulz@qt.io> Date: Wed, 1 Nov 2023 10:29:55 +0100 Subject: [PATCH 1776/1777] Debugger: improve std::unique_ptr dumper for cdb Fixes: QTCREATORBUG-29739 Change-Id: Ia8808c54137c762c54ad28f576c9d3be921d7d9c Reviewed-by: Christian Stenger <christian.stenger@qt.io> --- share/qtcreator/debugger/stdtypes.py | 9 ++++++++- tests/auto/debugger/tst_dumpers.cpp | 11 +++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index 622bec4e5c1..5b8b699165c 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -646,7 +646,14 @@ def qdump__std__unique_ptr(d, value): if p == 0: d.putValue("(null)") else: - d.putItem(d.createValue(p, value.type[0])) + if d.isMsvcTarget(): + try: + d.putItem(value["_Mypair"]["_Myval2"]) + d.putValue(d.currentValue.value, d.currentValue.encoding) + except: + d.putItem(d.createValue(p, value.type[0])) + else: + d.putItem(d.createValue(p, value.type[0])) d.putBetterType(value.type) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 06ebfe1b638..ac175bffd29 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -5024,16 +5024,18 @@ void tst_Dumpers::dumper_data() "#include <string>\n" + fooData + "static Foo *alloc_foo() { return new Foo; }\n" - "static void free_foo(Foo *f) { delete f; }\n", + "static void free_foo(Foo *f) { delete f; }\n" + "class Bar : public Foo { public: int bar = 42;};\n", "std::unique_ptr<int> p0;\n\n" "std::unique_ptr<int> p1(new int(32));\n\n" "std::unique_ptr<Foo> p2(new Foo);\n\n" "std::unique_ptr<std::string> p3(new std::string(\"ABC\"));\n" - "std::unique_ptr<Foo, void(*)(Foo*)> p4{alloc_foo(), free_foo};", + "std::unique_ptr<Foo, void(*)(Foo*)> p4{alloc_foo(), free_foo};\n" + "std::unique_ptr<Foo> p5(new Bar);", - "&p0, &p1, &p2, &p3, &p4") + "&p0, &p1, &p2, &p3, &p4, &p5") + CoreProfile() + Cxx11Profile() @@ -5043,7 +5045,8 @@ void tst_Dumpers::dumper_data() + Check("p1", "32", "std::unique_ptr<int, std::default_delete<int> >") + Check("p2", Pointer(), "std::unique_ptr<Foo, std::default_delete<Foo> >") + Check("p3", "\"ABC\"", "std::unique_ptr<std::string, std::default_delete<std::string> >") - + Check("p4.b", "2", "int"); + + Check("p4.b", "2", "int") + + Check("p5.bar", "42", "int"); QTest::newRow("StdOnce") From 9893768461cde6a8df732bf1f0e001bd052390bb Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@qt.io> Date: Wed, 1 Nov 2023 14:02:45 +0100 Subject: [PATCH 1777/1777] Debugger: Fix dumping std::unique_ptr on macOS Change-Id: If718201d0f32f1eb210bd0f786f62182225b94c8 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> --- share/qtcreator/debugger/libcpp_stdtypes.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/libcpp_stdtypes.py b/share/qtcreator/debugger/libcpp_stdtypes.py index 23b26f798e3..bce83a4fe68 100644 --- a/share/qtcreator/debugger/libcpp_stdtypes.py +++ b/share/qtcreator/debugger/libcpp_stdtypes.py @@ -404,7 +404,19 @@ def qdump__std____1__weak_ptr(d, value): def qdump__std____1__unique_ptr(d, value): - qdump__std__unique_ptr(d, value) + if value.type.size() == d.ptrSize(): + p = d.extractPointer(value) + else: + _, p = value.split("pp"); # For custom deleters. + if p == 0: + d.putValue("(null)") + else: + try: + d.putItem(value["__value_"]) + d.putValue(d.currentValue.value, d.currentValue.encoding) + except: + d.putItem(d.createValue(p, value.type[0])) + d.putBetterType(value.type) def qform__std____1__unordered_map():